diff --git a/.config b/.config new file mode 100644 index 0000000..fc39d50 --- /dev/null +++ b/.config @@ -0,0 +1,29 @@ +# +# Automatically generated make config: don't edit +# Chameleon Configuration +# Wed Aug 7 21:43:55 2013 +# +CONFIG_OPTIMIZATION_LEVEL="-Oz" +CONFIG_BDMESG=y +CONFIG_FDISK440=y +# CONFIG_OPENUP is not set +# CONFIG_BOOT0_DEBUG is not set +CONFIG_BOOT0_VERBOSE=y +CONFIG_BOOT1_HFS=y +# CONFIG_BOOT1_HFS_DEBUG is not set +CONFIG_BOOT1_HFS_VERBOSE=y +CONFIG_BOOT1_HFS_ACTIVE=y +# CONFIG_BOOT1_HFS_ACTIVE_DEBUG is not set +CONFIG_BOOT1_HFS_ACTIVE_VERBOSE=y +CONFIG_MODULES=y +# CONFIG_MODULE_DEBUG is not set + +# +# Modules +# +# CONFIG_RESOLUTION_MODULE is not set +# CONFIG_KLIBC_MODULE is not set +# CONFIG_SATA_MODULE is not set +CONFIG_KEYLAYOUT_MODULE=m +# CONFIG_ACPICODEC_MODULE is not set +# CONFIG_EMBED_THEME is not set diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47042c2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +xcuserdata diff --git a/.svn/all-wcprops b/.svn/all-wcprops new file mode 100644 index 0000000..a3cdedb --- /dev/null +++ b/.svn/all-wcprops @@ -0,0 +1,119 @@ +K 25 +svn:wc:ra_dav:version-url +V 45 +/svn/chameleon/!svn/ver/2256/branches/Chimera +END +.config +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2256/branches/Chimera/.config +END +coding_standards.txt +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/coding_standards.txt +END +version +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2256/branches/Chimera/version +END +autoconf.inc +K 25 +svn:wc:ra_dav:version-url +V 58 +/svn/chameleon/!svn/ver/2256/branches/Chimera/autoconf.inc +END +GPL_V2_LICENSE +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/chameleon/!svn/ver/2225/branches/Chimera/GPL_V2_LICENSE +END +auto.conf +K 25 +svn:wc:ra_dav:version-url +V 55 +/svn/chameleon/!svn/ver/2256/branches/Chimera/auto.conf +END +CREDITS +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2249/branches/Chimera/CREDITS +END +README +K 25 +svn:wc:ra_dav:version-url +V 52 +/svn/chameleon/!svn/ver/2225/branches/Chimera/README +END +revision +K 25 +svn:wc:ra_dav:version-url +V 54 +/svn/chameleon/!svn/ver/2252/branches/Chimera/revision +END +MEMTEST86_LICENSE +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/MEMTEST86_LICENSE +END +APPLE_LICENSE +K 25 +svn:wc:ra_dav:version-url +V 59 +/svn/chameleon/!svn/ver/2225/branches/Chimera/APPLE_LICENSE +END +BLOCKERS +K 25 +svn:wc:ra_dav:version-url +V 54 +/svn/chameleon/!svn/ver/2225/branches/Chimera/BLOCKERS +END +autoconf.h +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2256/branches/Chimera/autoconf.h +END +TODO +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/chameleon/!svn/ver/2225/branches/Chimera/TODO +END +Make.rules +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Make.rules +END +README.translators +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/README.translators +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Cconfig +END +CHANGES +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2256/branches/Chimera/CHANGES +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 54 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Makefile +END diff --git a/.svn/entries b/.svn/entries new file mode 100644 index 0000000..bac2017 --- /dev/null +++ b/.svn/entries @@ -0,0 +1,692 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera +http://forge.voodooprojects.org/svn/chameleon + + + +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +.config +file + + + + +2013-08-27T23:58:04.000000Z +884ef91b6b29d82700c1e02924e4862c +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +703 + +coding_standards.txt +file + + + + +2013-08-27T23:58:04.000000Z +bad281c1529e220297a7d79a85388f22 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2625 + +version +file + + + + +2013-08-27T23:58:04.000000Z +37b34738ddce9734ae7857ca4d8ee6d3 +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +6 + +autoconf.inc +file + + + + +2013-08-27T23:58:04.000000Z +e35650eeca2267543a78985a8230abc4 +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +622 + +Chameleon.xcodeproj +dir + +i386 +dir + +artwork +dir + +package +dir + +GPL_V2_LICENSE +file + + + + +2013-08-27T23:58:04.000000Z +54d5eb51b30876653cb44521d2ba22df +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18090 + +auto.conf +file + + + + +2013-08-27T23:58:04.000000Z +b50b12554af579101a6456c9e5ab4d96 +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +345 + +CREDITS +file + + + + +2013-08-27T23:58:04.000000Z +2f517b907797725bd2307629d7e2c82e +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +540 + +README +file + + + + +2013-08-27T23:58:04.000000Z +5660fc2eb63802b719620ad0b2ebb636 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +382 + +MEMTEST86_LICENSE +file + + + + +2013-08-27T23:58:04.000000Z +a586ea5a8d230d4c1b33d5e0c89c50ad +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1248 + +revision +file + + + + +2013-08-27T23:58:04.000000Z +932c8b88ad6314e00ad072976f6867cc +2013-06-27T13:26:48.960340Z +2252 +macman + + + + + + + + + + + + + + + + + + + + + +5 + +APPLE_LICENSE +file + + + + +2013-08-27T23:58:04.000000Z +dacaafbaf91483700da837d31213a1e8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +19829 + +BLOCKERS +file + + + + +2013-08-27T23:58:04.000000Z +4eaaa4c237ca0926e9f261af983bad34 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +777 + +autoconf.h +file + + + + +2013-08-27T23:58:04.000000Z +7f42d9512b36165ac459cf6e3d1f7503 +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +634 + +doc +dir + +TODO +file + + + + +2013-08-27T23:58:04.000000Z +ef2f3b521bd7c8f60cb4c973bffbc621 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3713 + +Make.rules +file + + + + +2013-08-27T23:58:04.000000Z +6030c83b0c999e6784bdc364a74215b1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5353 + +README.translators +file + + + + +2013-08-27T23:58:04.000000Z +beeb4e16988a7fd6977a0b9927f97266 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1270 + +Cconfig +file + + + + +2013-08-27T23:58:04.000000Z +c3ef701991ef8e2b7809ea437263884b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +88 + +CHANGES +file + + + + +2013-08-27T23:58:04.000000Z +7d94bb592bf5067d9619ddffeb81585c +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +7656 + +Keymaps +dir + +Makefile +file + + + + +2013-08-27T23:58:04.000000Z +ed82ed7b50f5b22fd24057110505ff49 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5041 + diff --git a/.svn/text-base/.config.svn-base b/.svn/text-base/.config.svn-base new file mode 100644 index 0000000..fc39d50 --- /dev/null +++ b/.svn/text-base/.config.svn-base @@ -0,0 +1,29 @@ +# +# Automatically generated make config: don't edit +# Chameleon Configuration +# Wed Aug 7 21:43:55 2013 +# +CONFIG_OPTIMIZATION_LEVEL="-Oz" +CONFIG_BDMESG=y +CONFIG_FDISK440=y +# CONFIG_OPENUP is not set +# CONFIG_BOOT0_DEBUG is not set +CONFIG_BOOT0_VERBOSE=y +CONFIG_BOOT1_HFS=y +# CONFIG_BOOT1_HFS_DEBUG is not set +CONFIG_BOOT1_HFS_VERBOSE=y +CONFIG_BOOT1_HFS_ACTIVE=y +# CONFIG_BOOT1_HFS_ACTIVE_DEBUG is not set +CONFIG_BOOT1_HFS_ACTIVE_VERBOSE=y +CONFIG_MODULES=y +# CONFIG_MODULE_DEBUG is not set + +# +# Modules +# +# CONFIG_RESOLUTION_MODULE is not set +# CONFIG_KLIBC_MODULE is not set +# CONFIG_SATA_MODULE is not set +CONFIG_KEYLAYOUT_MODULE=m +# CONFIG_ACPICODEC_MODULE is not set +# CONFIG_EMBED_THEME is not set diff --git a/.svn/text-base/APPLE_LICENSE.svn-base b/.svn/text-base/APPLE_LICENSE.svn-base new file mode 100644 index 0000000..fe81a60 --- /dev/null +++ b/.svn/text-base/APPLE_LICENSE.svn-base @@ -0,0 +1,367 @@ +APPLE PUBLIC SOURCE LICENSE +Version 2.0 - August 6, 2003 + +Please read this License carefully before downloading this software. +By downloading or using this software, you are agreeing to be bound by +the terms of this License. If you do not or cannot agree to the terms +of this License, please do not download or use the software. + +1. General; Definitions. This License applies to any program or other +work which Apple Computer, Inc. ("Apple") makes publicly available and +which contains a notice placed by Apple identifying such program or +work as "Original Code" and stating that it is subject to the terms of +this Apple Public Source License version 2.0 ("License"). As used in +this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is +the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to Apple and (ii) that cover subject +matter contained in the Original Code, but only to the extent +necessary to use, reproduce and/or distribute the Original Code +without infringement; and (b) in the case where You are the grantor of +rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to You and (ii) that cover subject matter in Your +Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or +contributes to the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the +combination of Original Code and any Modifications, and/or any +respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or +otherwise make Covered Code available, directly or indirectly, to +anyone other than You; and/or (b) to use Covered Code, alone or as +part of a Larger Work, in any way to provide a service, including but +not limited to delivery of content, through electronic communication +with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions +thereof with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change +to, the substance and/or structure of the Original Code, any previous +Modifications, the combination of Original Code and any previous +Modifications, and/or any respective portions thereof. When code is +released as a series of files, a Modification is: (a) any addition to +or deletion from the contents of a file containing Covered Code; +and/or (b) any new file or other representation of computer program +statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other +work as originally made available by Apple under this License, +including the Source Code of any updates or upgrades to such programs +or works made available by Apple under this License, and that has been +expressly identified by Apple as such in the header file(s) of such +work; and (b) the object code compiled from such Source Code and +originally made available by Apple under this License. + +1.8 "Source Code" means the human readable form of a program or other +work that is suitable for making modifications to it, including all +modules it contains, plus any associated interface definition files, +scripts used to control compilation and installation of an executable +(object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising +rights under this License. For legal entities, "You" or "Your" +includes any entity which controls, is controlled by, or is under +common control with, You, where "control" means (a) the power, direct +or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of fifty percent +(50%) or more of the outstanding shares or beneficial ownership of +such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms +and conditions of this License, Apple hereby grants You, effective on +the date You accept this License and download the Original Code, a +world-wide, royalty-free, non-exclusive license, to the extent of +Apple's Applicable Patent Rights and copyrights covering the Original +Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, +internally distribute within Your organization, and Externally Deploy +verbatim, unmodified copies of the Original Code, for commercial or +non-commercial purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the +copyright and other proprietary notices and disclaimers of Apple as +they appear in the Original Code, and keep intact all notices in the +Original Code that refer to this License; and + +(b) You must include a copy of this License with every copy of Source +Code of Covered Code and documentation You distribute or Externally +Deploy, and You may not offer or impose any terms on such Source Code +that alter or restrict this License or the recipients' rights +hereunder, except as permitted under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, +display, perform, internally distribute within Your organization, and +Externally Deploy Your Modifications and Covered Code, for commercial +or non-commercial purposes, provided that in each instance You also +meet all of these conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to +the Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the +notice in Exhibit A in each file of the Source Code of all Your +Modifications, and cause the modified files to carry prominent notices +stating that You changed the files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make +Source Code of all Your Externally Deployed Modifications either +available to those to whom You have Externally Deployed Your +Modifications, or publicly available. Source Code of Your Externally +Deployed Modifications must be released under the terms set forth in +this License, including the license grants set forth in Section 3 +below, for as long as you Externally Deploy the Covered Code or twelve +(12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your +Externally Deployed Modifications electronically (e.g. download from a +web site). + +2.3 Distribution of Executable Versions. In addition, if You +Externally Deploy Covered Code (Original Code and/or Modifications) in +object code, executable form only, You must include a prominent +notice, in the code itself as well as in related documentation, +stating that Source Code of the Covered Code is available under the +terms of this License with information on how and where to obtain such +Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that +although Apple and each Contributor grants the licenses to their +respective portions of the Covered Code set forth herein, no +assurances are provided by Apple or any Contributor that the Covered +Code does not infringe the patent or other intellectual property +rights of any other entity. Apple and each Contributor disclaim any +liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a +condition to exercising the rights and licenses granted hereunder, You +hereby assume sole responsibility to secure any other intellectual +property rights needed, if any. For example, if a third party patent +license is required to allow You to distribute the Covered Code, it is +Your responsibility to acquire that license before distributing the +Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the +licenses granted to You under this License, You hereby grant to any +person or entity receiving or distributing Covered Code under this +License a non-exclusive, royalty-free, perpetual, irrevocable license, +under Your Applicable Patent Rights and other intellectual property +rights (other than patent) owned or controlled by You, to use, +reproduce, display, perform, modify, sublicense, distribute and +Externally Deploy Your Modifications of the same scope and extent as +Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered +Code with other code not governed by the terms of this License and +distribute the Larger Work as a single product. In each such instance, +You must make sure the requirements of this License are fulfilled for +the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in +Section 2, no other patent rights, express or implied, are granted by +Apple herein. Modifications and/or Larger Works may require additional +patent licenses from Apple which Apple may grant in its sole +discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, +warranty, support, indemnity or liability obligations and/or other +rights consistent with the scope of the license granted herein +("Additional Terms") to one or more recipients of Covered Code. +However, You may do so only on Your own behalf and as Your sole +responsibility, and not on behalf of Apple or any Contributor. You +must obtain the recipient's agreement that any such Additional Terms +are offered by You alone, and You hereby agree to indemnify, defend +and hold Apple and every Contributor harmless for any liability +incurred by or claims asserted against Apple or such Contributor by +reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new +versions of this License from time to time. Each version will be given +a distinguishing version number. Once Original Code has been published +under a particular version of this License, You may continue to use it +under the terms of that version. You may also choose to use such +Original Code under the terms of any subsequent version of this +License published by Apple. No one other than Apple has the right to +modify the terms applicable to Covered Code created under this +License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in +part pre-release, untested, or not fully tested works. The Covered +Code may contain errors that could cause failures or loss of data, and +may be incomplete or contain inaccuracies. You expressly acknowledge +and agree that use of the Covered Code, or any portion thereof, is at +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. +You acknowledge that the Covered Code is not intended for use in the +operation of nuclear facilities, aircraft navigation, communication +systems, or air traffic control machines in which case the failure of +the Covered Code could lead to death, personal injury, or severe +physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY +TO YOU. In no event shall Apple's total liability to You for all +damages (other than as may be required by applicable law) under this +License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS", +"QuickTime", "QuickTime Streaming Server" or any other trademarks, +service marks, logos or trade names belonging to Apple (collectively +"Apple Marks") or to any trademark, service mark, logo or trade name +belonging to any Contributor. You agree not to use any Apple Marks in +or as part of the name of products derived from the Original Code or +to endorse or promote products derived from the Original Code other +than as expressly permitted by and in strict compliance at all times +with Apple's third party trademark usage guidelines which are posted +at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, +each Contributor retains all rights, title and interest in and to any +Modifications made by such Contributor. Apple retains all rights, +title and interest in and to the Original Code and any Modifications +made by or on behalf of Apple ("Apple Modifications"), and such Apple +Modifications will not be automatically subject to this License. Apple +may, at its sole discretion, choose to license such Apple +Modifications under this License, or on different terms from those +contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with +any term(s) of this License and fail to cure such breach within 30 +days of becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during +the term of this License, commence an action for patent infringement +against Apple; provided that Apple did not first commence +an action for patent infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately +stop any further use, reproduction, modification, sublicensing and +distribution of the Covered Code. All sublicenses to the Covered Code +which have been properly granted prior to termination shall survive +any termination of this License. Provisions which, by their nature, +should remain in effect beyond the termination of this License shall +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, +12.2 and 13. No party will be liable to any other for compensation, +indemnity or damages of any sort solely as a result of terminating +this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of +any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as +defined in FAR 2.101. Government software and technical data rights in +the Covered Code include only those rights customarily provided to the +public as defined in this License. This customary commercial license +in technical data and software is provided in accordance with FAR +12.211 (Technical Data) and 12.212 (Computer Software) and, for +Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- +Commercial Items) and 227.7202-3 (Rights in Commercial Computer +Software or Computer Software Documentation). Accordingly, all U.S. +Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as +creating an agency, partnership, joint venture or any other form of +legal association between or among You, Apple or any Contributor, and +You will not represent to the contrary, whether expressly, by +implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair +Apple's right to acquire, license, develop, have others develop for +it, market and/or distribute technology or products that perform the +same or similar functions as, or otherwise compete with, +Modifications, Larger Works, technology or products that You may +develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to +enforce any provision of this License will not be deemed a waiver of +future enforcement of that or any other provision. Any law or +regulation which provides that the language of a contract shall be +construed against the drafter will not apply to this License. + +13.5 Severability. (a) If for any reason a court of competent +jurisdiction finds any provision of this License, or portion thereof, +to be unenforceable, that provision of the License will be enforced to +the maximum extent permissible so as to effect the economic benefits +and intent of the parties, and the remainder of this License will +continue in full force and effect. (b) Notwithstanding the foregoing, +if applicable law prohibits or restricts You from fully and/or +specifically complying with Sections 2 and/or 3 or prevents the +enforceability of either of those Sections, this License will +immediately terminate and You must immediately discontinue any use of +the Covered Code and destroy all copies of it that are in your +possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution +between You and Apple relating to this License shall take place in the +Northern District of California, and You and Apple hereby consent to +the personal jurisdiction of, and venue in, the state and federal +courts within that District with respect to this License. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the +entire agreement between the parties with respect to the subject +matter hereof. This License shall be governed by the laws of the +United States and the State of California, except that body of +California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following +clause applies: The parties hereby confirm that they have requested +that this License and all related documents be drafted in English. Les +parties ont exige que le present contrat et tous les documents +connexes soient rediges en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +Reserved. + +This file contains Original Code and/or Modifications of Original Code +as defined in and that are subject to the Apple Public Source License +Version 2.0 (the 'License'). You may not use this file except in +compliance with the License. Please obtain a copy of the License at +http://www.opensource.apple.com/apsl/ and read it before using this +file. + +The Original Code and all software distributed under the License are +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +Please see the License for the specific language governing rights and +limitations under the License." diff --git a/.svn/text-base/BLOCKERS.svn-base b/.svn/text-base/BLOCKERS.svn-base new file mode 100644 index 0000000..0926231 --- /dev/null +++ b/.svn/text-base/BLOCKERS.svn-base @@ -0,0 +1,13 @@ + Nvidia GT 540M && 310M : can't find rom to patch : http://forge.voodooprojects.org/p/chameleon/issues/99/ + ** This is also http://forge.voodooprojects.org/p/chameleon/issues/48/ + ** GT 440 --> http://forge.voodooprojects.org/p/chameleon/issues/98/ + Extra Kext Loading dependency error: http://forge.voodooprojects.org/p/chameleon/issues/94/ + AMD reported issues in cpu.c http://forge.voodooprojects.org/p/chameleon/issues/92/ + Make Package: http://forge.voodooprojects.org/p/chameleon/issues/82/ + +=== Done === + Multi Booting: http://forge.voodooprojects.org/p/chameleon/issues/62/ + Memory Allocation Error on boot1 loading /boot: http://forge.voodooprojects.org/p/chameleon/issues/101/ + +== Closed == + SMBus : http://forge.voodooprojects.org/p/chameleon/issues/10/ diff --git a/.svn/text-base/CHANGES.svn-base b/.svn/text-base/CHANGES.svn-base new file mode 100644 index 0000000..6194da9 --- /dev/null +++ b/.svn/text-base/CHANGES.svn-base @@ -0,0 +1,116 @@ +-macman: Chimera 2.1.2 specific changes: + Removed all closed source modules +-macman: Chimera 2.1.i specific changes: + Rollbacked FileNVRAM.dylib to v1.1.2 + Includes most changes from trunk r2248 while retaining all previous Chimera v2.1.0 fixes and enhancements +- Fix issue booting x86 after rev.2175 (Credits to Mario, Alex and Leon). +-macman: Chimera 2.1.0 specific changes: + Added Haswell CPU support with model and speed detection + Disabled writing of boot arguments to nvram + Reverted AMD graphics card reporting and log messages to Chimera v1.11.1 style + Reverted NVIDIA graphics card reporting to Chimera v1.11.1 style + Included mosts changes from trunk r2246 that didn't conflict with Chimera 2.0.1 fixes and enhancements +- Add boot support to 10.9 (thx old napalm) +- ErmaC : Update gui Icons OS detection +- Update default theme Icon set (thx BlackOsx) +- Add Linux GPT Partition Label +- Fix menuBVR initialization problem +- Implement ErmaC's HDAEnabler.dylib module +- Fix Bug in the loop that look for an ATI card. Credits to Jief Luce +- Fix extension without kPropOSBundleRequired property weren't loaded. Credits to Jief Luce +- Fix Revision mismatch http://forge.voodooprojects.org/p/chameleon/issues/330/ +- ErmaC : Improve PCI info. Interface program and device revision. +- Fix Possible bug in i386/libsaio/device_inject.c devprop_add_device() http://forge.voodooprojects.org/p/chameleon/issues/319/ +- Fix warnings/errors from new llvm/clang (xcode 4.6) +- Fix base64 decode, fixes Issue http://forge.voodooprojects.org/p/chameleon/issues/320/ +- meklort : FileNVRAM module import +-macman: Chimera 2.0.1 specific changes: + iMessage login fix by Meklort from Chameleon 2.2 r2169 + HD4000 support from Chimera 1.11.1 + CPU bus and processor speed fix from Chimera 1.11.1 + Reverted AMD and NVIDIA card reporting to Chimera 1.11.1 style +- cparm : Added a workaroud for Xcode 4.4.x compatibility 504B030414030100630004731141000000007D0000008B00000003000B0062696E01990700020041450308001AED80DA50DF6080B0390FE095B3BC129E1FC27C104EC97897EF27CD1175766CB18C66FF42EFB7023911BDFD5E4BC9AEEC32FF3473963F70B255581D7B74DE9F +- cparm : Fixed a buffer overflow in the plist loader +- cparm : Ported the nvidia plist helper (less time to spend on the device id more time to code :-) ) +- cparm : Added a Sata module, known as YellowIconFixer in my branch, useful to fix yellow icon issue (can also fix an issue with the apple's dvd player application in moutain lion) + , for now not added in the pkg script !!! + +- cparm : Ported the OS detection to the trunk, updated the default theme to v 1.1 (credit to blackosx) + +- Added AtiPorts option to GraphicsEnabler, so users can override the default number of ports. It proved + to be useful when used to limit the number of ports that a framebuffer registers, which seems to be a + requirement on laptops that can only use 2 ports at the same time. + Thanks to Akbar for testing and AniV also for the tip: + http://forum.voodooprojects.org/index.php/topic,1959.msg10402.html#msg10402 +- Added NVidia ION AHCI controllers dev id to AHCIPortInjector kext. + Forgot to mention source on the commit: http://forum.voodooprojects.org/index.php/topic,1170.0.html +- Renamed com.apple.Boot.plist to org.chameleon.Boot.plist. +- Added "ShowInfo" key (enabled by default for now), which enables/disables the display of + partition and resolution related info, on the Gui. + This info may not play well with some custom themes. +- Modules can now be selected between not compiled, compiled into chameleon, or compiled as modules. +- New makefile + configuration system. +- Added the BOOT2_MAX_LENGTH constant in memory.h. This is now used in mboot.c to relocate the correct + number of bytes for boot2. +- Added new ATi/AMD Graphics Card Enabler. +- Added new SMBIOS patcher. + Includes changes to "manufacter" keys, from SM*manufacter to SM*manufacturer. +- Added module system. +- Added automatic P-States & C-States generation for native power management. +- Added Booter Log Dump Tool +- Added Booter message Logging (":/boot-log" ioreg property) +- Removed -x32 option, use arch=i386 instead +- Added automatic SMBusspeed detection for lga1156 core i5/7 cpus +- Added new iMac11,1 sbios default model for lga1156 core i5/17 mobos +- md0 code. Notified xnu when an md ramdisk is specified +- Added rollover image support for selected device icons. + Use device__o.png in theme folder. Credits goes to Blackosx. +- Revisited theme resource embedding. Using the device_ icons are optional with + the exception of device_generic. +- Optimized memory detection speed +- Added displaying source device and partition number for file read operations. +- Increased boot2's maximum size from 383.5k to 447.5k. + Updated stage 1 loaders for handling the new size limit. +- Added alternate format for setting the default partition. The user can specify the selected + volume UUID for the "Default Partition" key. +- Implemented SPD memory automatic detection and injection,seems to work really great ... +- Factorized code to prepare a dynamic memory detection algorithm ... +- Optimized smbios table address search +- Optimized cursor spinout in textmode if no verbose mode is set +- Added ram table structures definitions +- Added getSmbios() a param permitting to select between orig and new smbios entries +- Changed "Default Partition" behavior to accept only native system volumes or foreign partitions. +- Added NVIDIA new NVCAP customization support and support for ION gfx cards from aserebln +- Added ATI new framebuffers support and new cards from PCEFI10.6 +- improved ACPI file search algo by implementing a cache. +- Nvidia injection fix +- pciroot would not always return correct UID in auto detection mode +- Fixed the hibernation problem in boot2/resume.c +- Fixed all new booter versions with SystemType would override the facp value even if correct, + now keeps the facp value if correct and no override has been done, implemented a best effort algo. + for maximizing the chance to get the most correct value before we decide to use a fixed value (1=desktop) +- Fixed display cosmetics of UUID, now a convert.c file contains all + conversions api, to be completed by function that we should reuse. + +- Fixed SystemType would be always forced to a value, now optionally changed + only if overridden +- Kept SystemID as the only option to change manually the system-id + For theses reasons, SystemId from bootConfig and SMUUID from smbiosConfig are now DEPRECATED. + +- Integrated JrCs fadt patch (kept for RC5 the existing DSDT.aml retry algo that disappeared in his patch, + should be more discussed for RC6) +- Added JrCs modified convention name change to coding_standards +- Now malloc (ex. MALLOC in Asere patch) is renamed malloc(size) and is an alias + to safe_malloc(size, file, line) with _FILE_ and _LINE_ preprocessor definitions +- Added a new 'Rename Partition Feature', now permitting to rename partition + like 'System reserved' to a more meaningful name +- Added SystemID option permitting to change the System UUID to a fixed value. +- Added the PciRoot auto detection feature imported from pcefi10.5 +- Added automatic "system-id" injection from dmi bios, also compatible + with SystemID boot option and former SMUUID from smbios,plist +- Added "system-type' automatic injection (1=Desktop) plus override possibility + with the new system-type option in bootConfig +- Added SMserial and SMproductname new options for smbios.plist +- Merged with asere patch, while keeping my fake_efi.c changes, and adding a new + stringForKey() API, also changed the DT__XXXX() set of functions + to handle const char * values instead of char*. diff --git a/.svn/text-base/CREDITS.svn-base b/.svn/text-base/CREDITS.svn-base new file mode 100644 index 0000000..fa20dac --- /dev/null +++ b/.svn/text-base/CREDITS.svn-base @@ -0,0 +1,18 @@ +Credit goes to: +=============== + +Developers: +---------- +zef, Turbo, dfe, netkas, mackerintel, mercurysquad, fassl, Kabyl, Crazor, Dense, kaitek, iNDi, munky, DHP, JrCs, asereBLN, rekursor, mozodojo, meklort, AnV, valv, AzimutZ, Slice, cosmo1t, cparm, Conti, ErmaC + +Thanks to: +--------- +bumby, kalyway, Krazubu, Eddie11c, JaS, fassl, XyZ, SMF, flama, Galaxy, sckevyn, MasterChief, smith@@, blackosx, DHP, nawcom, scorpius, macman, dmazar + +Package: +--------- +kalyway, AzimutZ, blackosx, ErmaC, scrax, JrCs + +Copyright: +--------- +2008-2013 diff --git a/.svn/text-base/Cconfig.svn-base b/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..e5dd69a --- /dev/null +++ b/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,6 @@ +# +# Chameleon Configuration +# +mainmenu "Chameleon Configuration" + +source "i386/Cconfig" diff --git a/.svn/text-base/GPL_V2_LICENSE.svn-base b/.svn/text-base/GPL_V2_LICENSE.svn-base new file mode 100644 index 0000000..0137d46 --- /dev/null +++ b/.svn/text-base/GPL_V2_LICENSE.svn-base @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/.svn/text-base/MEMTEST86_LICENSE.svn-base b/.svn/text-base/MEMTEST86_LICENSE.svn-base new file mode 100644 index 0000000..1a94914 --- /dev/null +++ b/.svn/text-base/MEMTEST86_LICENSE.svn-base @@ -0,0 +1,32 @@ +dram_controllers.c/h that scans from the pci host controller USES +an adaptation for chameleon 2.0 RC5 from original : + +======================== +memtest86 license notice +======================== + + Released under version 2 of the Gnu Public License. + By Chris Brady, cbrady@sgi.com + ---------------------------------------------------- + MemTest86+ V4.00 Specific code (GPL V2.0) + By Samuel DEMEULEMEESTER, sdemeule@memtest.org + http://www.canardpc.com - http://www.memtest.org + + +============================ +GPL version 2 license notice +============================ + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/.svn/text-base/Make.rules.svn-base b/.svn/text-base/Make.rules.svn-base new file mode 100644 index 0000000..5f4a373 --- /dev/null +++ b/.svn/text-base/Make.rules.svn-base @@ -0,0 +1,174 @@ + +-include $(SRCROOT)/auto.conf + +export USE_APPLE_PB_SUPPORT = all + +ifneq "" "$(wildcard /bin/mkdirs)" + MKDIRS = /bin/mkdirs +else + MKDIRS = /bin/mkdir -p +endif +AS = as +LD = ld +CC = cc +CPP = c++ + +PAX = /bin/pax +NASM = $(shell which nasm) -p $(SRCROOT)/autoconf.inc + + +CFLAGS = $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror +CPPFLAGS = $(MORECPP) -g -Wmost -Werror -fno-exceptions -fno-rtti +DEFINES= + +DIST_SUBDIRS += $(SUBDIRS) + +# +# Common makefile targets. +# +# Define these variables (if desired) in directory makefiles: +# DIRS_NEEDED +# INSTALLDIR +# SRCROOT +# + +# Toggle this as to whether you want a frame pointer (%ebp) to be used. It is +# invaluable for debugging the booter. For example using GDB attached to VMware. +# In fact, it's so invaluable that it's now the default. Not only that but the +# compiler seems to generate slightly smaller code and the real<->prot code +# clearly handles it appropriately so I have no idea why Apple omitted it. +#OMIT_FRAME_POINTER_CFLAG=-fomit-frame-pointer +OMIT_FRAME_POINTER_CFLAG= + +-include $(OBJROOT)/*.Makedep + +$(OBJROOT)/%.o32: %.c + @echo "\t[CC32] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch i386 $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch i386 $< -o $@ + +$(OBJROOT)/%.o64: %.c + @echo "\t[CC64] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -o $@ + + +$(OBJROOT)/%.o: %.c + @echo "\t[CC] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ + +$(OBJROOT)/%.o: %.m + @echo "\t[M] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ + +$(OBJROOT)/%.o: %.cpp + @echo "\t[CPP] $<" + @$(CPP) $(CPPFLAGS) $(CFLAGS) -c "$<" $(INC) -MM -M -o $@.Makedep + @$(CPP) $(CPPFLAGS) $(CFLAGS) -c "$<" $(INC) -o $@ + +$(OBJROOT)/%.o: %.s + @echo "\t[AS] $<" + @$(CC) $(CPPFLAGS) -c $(INC) -arch i386 $< -MM -M -o $@.Makedep + @$(CC) $(CPPFLAGS) -c $(INC) -arch i386 $< -o $@ + +CONFIG_FILES=$(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h $(SRCROOT)/autoconf.inc $(SRCROOT)/.config +$(CONFIG_FILES): $(SRCROOT)/.config + @echo "\t[MAKE] config" + @make -C $(SRCROOT)/i386/config rebuild_config + +HEADER_VERSION=$(SRCROOT)/vers.h +$(HEADER_VERSION): $(SRCROOT)/version + @echo "#define I386BOOT_VERSION \"5.0.132\"" > $@ + @echo "#define I386BOOT_BUILDDATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $@ + @echo "#define I386BOOT_CHAMELEONVERSION \"`cat $(SRCROOT)/version`\"" >> $@ + @echo "#define I386BOOT_CHAMELEONREVISION \"`cat $(SRCROOT)/revision`\"" >> $@ +# @echo "#define I386BOOT_CHAMELEONREVISION \"`svnversion -n | tr -d [:alpha:]`\"" >> $@ + +CONFIG_HEADERS=$(CONFIG_FILES) $(HEADER_VERSION) + +# This breaks make, must use make all (FIXME) +$(DIRS_NEEDED) $(INSTALLDIR) $(OBJROOT) $(SYMROOT): + @echo "\t[MKDIR] $@" + @$(MKDIRS) $@ + +# Recursive rules +RECURSIVE_TARGETS = all-recursive +RECURSIVE_CLEAN_TARGETS = distclean-recursive clean-recursive +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) + +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo ================= Making $$target in $$subdir =================; \ + (cd $$subdir && $(MAKE) $$target) \ + || eval $$failcom; \ + done; + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-local"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $$local_target) \ + || eval $$failcom; \ + done + + +clean-dep: + @if [ -f "$(OBJROOT)/Makedep" ];then echo "\t[RM] $(OBJROOT)/Makedep"; fi + @rm -f $(OBJROOT)/Makedep + + +FIND_IGNORE := \( -name .git -o -name .svn \) -prune -o -name Cconfig -o + +# clean: remove almost everything (execpt auto.conf, autoconf.h, autoconf.inc) +clean: clean-recursive clean-dep + @if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi + @if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi + @if [ -d "$(DSTROOT)" ];then echo "\t[RMDIR] $(DSTROOT)"; fi + @if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \ + echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \ + fi + @rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \ + $(SRCROOT)/i386/modules/module_includes + +distclean: distclean-recursive clean-local clean-dep + @find . $(FIND_IGNORE) \ + \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ + -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ + -o -name '.*.rej' -o -size 0 \ + -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ + -type f -print | xargs rm -f + +clean-local: + +distclean-local: + +.DEFAULT_GOAL := all + +# Local Variables: # +# mode: Makefile # +# tab-width: 2 # +# indent-tabs-mode: t # +# End: # +# +# vi: set noexpandtab ts=2 sw=2 sts=2: # diff --git a/.svn/text-base/Makefile.svn-base b/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..eec40fe --- /dev/null +++ b/.svn/text-base/Makefile.svn-base @@ -0,0 +1,148 @@ +# Makefile for kernel booter +SRCROOT = $(CURDIR) +OBJROOT = $(SRCROOT)/obj +SYMROOT = $(SRCROOT)/sym +DSTROOT = $(SRCROOT)/dst +DOCROOT = $(SRCROOT)/doc +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot +PKG_BUILD_DIR = $(SYMROOT)/package + +include Make.rules + + +THEME = default + +VERSION = `cat ${SRCROOT}/version` +REVISION = `cat ${SRCROOT}/revision` +PRODUCT = Chameleon-$(VERSION)-r$(REVISION) +CDLABEL = ${PRODUCT} +ISOIMAGE = ${SYMROOT}/${CDLABEL}.iso +DISTFILE = ${SYMROOT}/${PRODUCT} + +IMGROOT = $(SRCROOT)/sym/${PRODUCT} +DISTROOT= ./${PRODUCT} + + +EXCLUDE = --exclude=.svn --exclude=.DS_Store --exclude=sym --exclude=obj \ + --exclude=package --exclude=archive --exclude=User_Guide_src --exclude=*.sh + +#RC_CFLAGS = i386 +ARCHLESS_RC_CFLAGS=`echo $(RC_CFLAGS) | sed 's/-arch [a-z0-9]*//g'` + +GENERIC_SUBDIRS = +SUBDIRS = $(GENERIC_SUBDIRS) i386 +DIST_SUBDIRS = $(SUBDIRS) + +$(SRCROOT)/revision: + @svnversion -n | tr -d [:alpha:] > $(SRCROOT)/revision + +# +# Currently builds for i386 +# +config rebuild_config: + @make -C $(SRCROOT)/i386/config $@ + +all: $(SYMROOT) $(OBJROOT) $(CONFIG_HEADERS) $(HEADER_VERSION) $(SRCROOT)/revision + @$(MAKE) all-recursive + +dist image: all + @# To force the read of auto.conf (generated by 'all' target) + @make $@-local + +dist-local image-local: + @echo "================= Distrib =================" + @echo "\t[RM] ${IMGROOT}" + @rm -rf ${IMGROOT} + @echo "\t[MKDIR] ${IMGROOT}/usr/standalone/i386" + @mkdir -p ${IMGROOT}/usr/standalone/i386 + @echo "\t[MKDIR] ${IMGROOT}/Extra/modules" + @mkdir -p ${IMGROOT}/Extra/modules + @echo "\t[MKDIR] ${IMGROOT}/Extra/Themes/Default" + @mkdir -p ${IMGROOT}/Extra/Themes/Default + @echo "\t[MKDIR] ${IMGROOT}/usr/bin" + @mkdir -p ${IMGROOT}/usr/bin + @if [ -e "$(IMGSKELROOT)" ]; then \ + @echo "\t[CP] ${IMGROOTSKEL} ${IMGROOT}" \ + @cp -R -f "${IMGSKELROOT}"/* "${IMGROOT}"; \ + fi; + @cp -f ${SYMROOT}/i386/cdboot ${CDBOOT} + @cp -f ${SYMROOT}/i386/modules/* ${IMGROOT}/Extra/modules + @cp -f ${SRCROOT}/artwork/themes/default/* ${IMGROOT}/Extra/Themes/Default + @cp -f ${SYMROOT}/i386/boot ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot0 ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot0hfs ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot0md ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot1h ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot1f32 ${IMGROOT}/usr/standalone/i386 +ifdef CONFIG_FDISK440 + @cp -f ${SYMROOT}/i386/fdisk440 ${IMGROOT}/usr/bin +endif +ifdef CONFIG_BDMESG + @cp -f ${SYMROOT}/i386/bdmesg ${IMGROOT}/usr/bin +endif +ifdef CONFIG_KEYLAYOUT_MODULE + @cp -f ${SYMROOT}/i386/cham-mklayout ${IMGROOT}/usr/bin + @echo "\t[MKDIR] ${IMGROOT}/Extra/Keymaps" + @mkdir -p ${IMGROOT}/Extra/Keymaps + @echo "\t[CP] Keymaps ${IMGROOT}/Extra/Keymaps" + @cp -R -f "Keymaps"/* "${IMGROOT}/Extra/Keymaps/" +endif + + @echo "\t[HDIUTIL] ${ISOIMAGE}" + @hdiutil makehybrid -iso -joliet -hfs -hfs-volume-name \ + ${CDLABEL} -eltorito-boot ${CDBOOT} -no-emul-boot -ov -o \ + "${ISOIMAGE}" ${IMGROOT} -quiet + @echo "\t[GZ] ${DISTFILE}.tgz" + @rm -f ${DISTFILE}.tar.gz + @cd ${SYMROOT} && tar -cf ${DISTFILE}.tar ${DISTROOT} + @gzip --best ${DISTFILE}.tar + @mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz + +clean-local: + @if [ -d "$(PKG_BUILD_DIR)" ];then echo "\t[RMDIR] $(PKG_BUILD_DIR)"; fi + @if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi + @if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi + @rm -rf "$(PKG_BUILD_DIR)" $(HEADER_VERSION) $(SRCROOT)/revision + +AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \ + $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old + +distclean-local: + @if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi + @if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi + @if [ -d "$(DSTROOT)" ];then echo "\t[RMDIR] $(DSTROOT)"; fi + @if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \ + echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \ + fi + @for cfg in $(AUTOCONF_FILES); do if [ -f "$${cfg}" ];then echo "\t[RM] $${cfg}"; fi; done + @rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \ + $(SRCROOT)/i386/modules/module_includes \ + $(AUTOCONF_FILES) + +pkg installer: all + @echo "================= Building Package =================" + @${SRCROOT}/package/buildpkg.sh "$(SRCROOT)" "$(SYMROOT)" "$(PKG_BUILD_DIR)" + +help: + @echo 'Configuration target:' + @echo ' config - Show configuration menu' + @echo + @echo 'Build targets:' + @echo ' all - Build all targets [DEFAULT]' + @echo ' dist - Build distribution tarball' + @echo ' pkg - Build installer package' + @echo + @echo 'Cleaning targets:' + @echo ' clean - Remove most generated files' + @echo ' distclean - Remove all generated files + config' +#@echo +# @echo 'Build options:' +# @echo 'make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' + +.PHONY: config +.PHONY: clean +.PHONY: image +.PHONY: pkg +.PHONY: installer +.PHONY: help diff --git a/.svn/text-base/README.svn-base b/.svn/text-base/README.svn-base new file mode 100644 index 0000000..b6d621f --- /dev/null +++ b/.svn/text-base/README.svn-base @@ -0,0 +1,7 @@ +Chameleon is a Darwin/XNU boot loader based on Apple's boot-132. + +Because Chameleon now uses part of GPL V2 licensed code in 2 files, +it *must* conform to the most restrictive license that it uses that is the: +GPL Version 2 LICENSE + +Chameleon can thus be (and has to be) freely distributed under the term of the GPL V2 license which prevails, as it is the most restrictive license. diff --git a/.svn/text-base/README.translators.svn-base b/.svn/text-base/README.translators.svn-base new file mode 100644 index 0000000..dfb78b8 --- /dev/null +++ b/.svn/text-base/README.translators.svn-base @@ -0,0 +1,26 @@ +Hi all translators, + +we can help us to translate the Chameleon Project. + +You need to have gettext utilities installed. +You can install them : + * With MacPorts or Fink + or + * With the package http://dl.dropbox.com/u/112112/Chameleon.Dev/gettext-0.18.1.1.dmg + You need to change your ~/.bashrc or ~/.bash_profile to add the path to the utilities: + # MacPorts Installer: adding an appropriate PATH variable for use with MacPorts. + export PATH=/opt/local/bin:/opt/local/sbin:$PATH + # Finished adapting your PATH environment variable for use with MacPorts. + + # MacPorts Installer: adding an appropriate MANPATH variable for use with MacPorts. + export MANPATH=/opt/local/share/man:$MANPATH + # Finished adapting your MANPATH environment variable for use with MacPorts. + +You must also have a PO editor like Poedit: http://www.poedit.net/download.php + +The files to translate are in package/po directory. Open them with your PO editor and translate :D. + +If you want to add a new language copy the package/po/chameleon.pot to po/$lang.po where $lang is +the new language you want to add. Example to add belgian language: + # cp package/po/chameleon.pot package/po/be.po +Now you can start translating the new po file with your PO editor diff --git a/.svn/text-base/TODO.svn-base b/.svn/text-base/TODO.svn-base new file mode 100644 index 0000000..bf7ceae --- /dev/null +++ b/.svn/text-base/TODO.svn-base @@ -0,0 +1,87 @@ +TODO List for Chameleon Boot Loader +==================================== +- Fix boot prompt parsing. + +- Bring code closer to coding_standards.txt. + +- Fix the module system when booting chameleon with multiboot. Cleanup the xcode 4 fix. + +- Integrate Prasys current work on options and quick shortcut modified version of 18seven + +- Add auto detection of efi string algorithm, so graphics enabler can be enabled by default while not + conflicting with other efi string overridden content + (original idea of Galaxy) + + - Case insensitive parsing for the bootConfig options: + should help the common/novice user to setup more easily. + +- Find out how we can avoid section overlap with the xcode4.4 LD version (we must first reduce the size of the bootloader but it's not enought, maybe we should use a thing comparable to the gnu ld.script, QUESTION: is the xcode4.4 linker still suitable to build standalone app ? ) +==================================== + +DONE + +- Create a dummy module for any modules that are compiled in. This is needed for linking modules with + dependencies that are not compiled in. + +- Add a more sophisticated acpi loading mechanism to enable loading custom acpi tables when dsdtdrop=y + Here's a specification to think about: + First we must care about if a forced DSDT full path has been specified + (was what pb smith had in his first tries) and take it for the DSDT path as is. + Then we have the case where no DSDT path was set where we run our usual DSDT search algorithm to + find this file. + In the latter case, the file has to be named DSDT.aml and be in one of the / /Extra or bt(0,0)/Extra + directory. + + Now a first idea to implement correctly the acpi tables loading would be: + + Whether the path was hardcoded in the DSDT option or was automatically found, we extract the path part + of the DSDT file that has been successfully found and we run a loop to enumerate all other acpi + files in the same directory. + Now for each acpi file found, we should compare the name with an existing acpi table found in + the system that we would normally load and replace this usual injection by the content of the file. + + Once DropDSDT=y is set, no other acpi table than dsdt is loaded, then it is the responsibility of the + user to provide any other acpi table. + +- Add a new module capable of writing proprietary Chameleon data to ioreg: + Using the DT__xxx() API, we will create a set of functions to write + to log info, chameleon boot info to be retrieved by helper applications... + the only public function for log info purpose of this module would be: + logMessageToIOREG(...); // var args printf style format + flushLogToIOREG(); // store a unique log info property to the ioreg + + The preferred internal behavior of the log info ioreg buffer + would be to store the messages in a consolidated buffer then only write once, + this buffer (i.e just before call the kernel) with flushLogToIOREG(); + The other public function for writing chameleon boot info data would be: + + verbose() should incorporate a call to logMessageToIOREG() + to permit helper applications to extract + this log info (i.e: the chameleon system pref pane) + +- Add API for displaying and logging messages like: + + void verbose(...) + { + ... + logMessageToIOREG("%s: %sn", title, s); + + } + + void display_and_log( const char* title, const char* msg) + { + printf("%s: %sn", title, s); + logMessageToIOREG(title,s); + } + + void deprecated(const char * s) + { + display_and_log("WARNING: Deprecated option",s); + sleep(1); + } + + void error_message(const char * s) + { + display_and_log("ERROR",s); + getc(); + } diff --git a/.svn/text-base/auto.conf.svn-base b/.svn/text-base/auto.conf.svn-base new file mode 100644 index 0000000..ee3cbf3 --- /dev/null +++ b/.svn/text-base/auto.conf.svn-base @@ -0,0 +1,15 @@ +# +# Automatically generated make config: don't edit +# Chameleon Configuration +# Wed Aug 7 21:43:55 2013 +# +CONFIG_BOOT1_HFS_VERBOSE=y +CONFIG_BOOT1_HFS=y +CONFIG_MODULES=y +CONFIG_BOOT0_VERBOSE=y +CONFIG_OPTIMIZATION_LEVEL="-Oz" +CONFIG_BDMESG=y +CONFIG_BOOT1_HFS_ACTIVE_VERBOSE=y +CONFIG_BOOT1_HFS_ACTIVE=y +CONFIG_FDISK440=y +CONFIG_KEYLAYOUT_MODULE=m diff --git a/.svn/text-base/autoconf.h.svn-base b/.svn/text-base/autoconf.h.svn-base new file mode 100644 index 0000000..17dc47b --- /dev/null +++ b/.svn/text-base/autoconf.h.svn-base @@ -0,0 +1,17 @@ +// +// Automatically generated make config: don't edit +// Chameleon Configuration +// Wed Aug 7 21:43:55 2013 +// +#define CONFIG_IS_BUILTIN 1 +#define CONFIG_IS_MODULE 2 +#define CONFIG_BOOT1_HFS_VERBOSE CONFIG_IS_BUILTIN +#define CONFIG_BOOT1_HFS CONFIG_IS_BUILTIN +#define CONFIG_MODULES CONFIG_IS_BUILTIN +#define CONFIG_BOOT0_VERBOSE CONFIG_IS_BUILTIN +#define CONFIG_OPTIMIZATION_LEVEL "-Oz" +#define CONFIG_BDMESG CONFIG_IS_BUILTIN +#define CONFIG_BOOT1_HFS_ACTIVE_VERBOSE CONFIG_IS_BUILTIN +#define CONFIG_BOOT1_HFS_ACTIVE CONFIG_IS_BUILTIN +#define CONFIG_FDISK440 CONFIG_IS_BUILTIN +#define CONFIG_KEYLAYOUT_MODULE CONFIG_IS_MODULE diff --git a/.svn/text-base/autoconf.inc.svn-base b/.svn/text-base/autoconf.inc.svn-base new file mode 100644 index 0000000..08f3b54 --- /dev/null +++ b/.svn/text-base/autoconf.inc.svn-base @@ -0,0 +1,24 @@ +; +; Automatically generated make config: don't edit +; Chameleon Configuration +; Wed Aug 7 21:43:55 2013 +; +CONFIG_BOOT1_HFS_DEBUG EQU 0 +CONFIG_SATA_MODULE EQU 0 +CONFIG_KLIBC_MODULE EQU 0 +CONFIG_BOOT0_DEBUG EQU 0 +CONFIG_OPENUP EQU 0 +CONFIG_BOOT1_HFS_VERBOSE EQU 1 +CONFIG_EMBED_THEME EQU 0 +CONFIG_BOOT1_HFS EQU 1 +CONFIG_MODULES EQU 1 +CONFIG_BOOT0_VERBOSE EQU 1 +CONFIG_ACPICODEC_MODULE EQU 0 +CONFIG_BDMESG EQU 1 +CONFIG_BOOT1_HFS_ACTIVE_VERBOSE EQU 1 +CONFIG_BOOT1_HFS_ACTIVE EQU 1 +CONFIG_BOOT1_HFS_ACTIVE_DEBUG EQU 0 +CONFIG_FDISK440 EQU 1 +CONFIG_RESOLUTION_MODULE EQU 0 +CONFIG_KEYLAYOUT_MODULE EQU 1 +CONFIG_MODULE_DEBUG EQU 0 diff --git a/.svn/text-base/coding_standards.txt.svn-base b/.svn/text-base/coding_standards.txt.svn-base new file mode 100644 index 0000000..78ebeb7 --- /dev/null +++ b/.svn/text-base/coding_standards.txt.svn-base @@ -0,0 +1,83 @@ +Coding Standard rev. 0 (First Draft) + +1. Indentation + having seen most indentation styles going from 2 to 8 spaces, I would suggest a indentation of 4 spaces. + +2. Comments +I see here two main differents cases: +function description comments and one-line code quite comments + +For functions documentation, I suggest to use this syntax +/** + * + */ +Note the use of /** that will make future html auto-documentation easier (i.e: Doxygen at least recognize this marker) + +for punctual, short code comment, let's use: +// +3) #define at top of document +4) Global vars right below #include / #define (notation: gLobal) +Note that global vars and static vars should be avoided as much as possible in favor of local variables use, get/set functions (properties). + +5) No curly brackets for single lines + +6) else +{ + .... +} + +instead of: + +else { + .... +} + +7) if +{ + .... +} +instead of: + +if { + .... +} + +8) fall through code (using indention) or bail out early (using returns)? +Using early bail out for preconditions early in the function code, +use common sense to avoid as an example more than 4 imbricated if() constructions. +In the later case, consider decomposing your function in more manageable primitives. + +9) Spaces/readability i.e. not: if (fd<0) +but: if (fd < 0) + +10. types, variables, functions, naming +non const variables should follow the (currently mostly used) CamelCase convention: +int myVariableIsFine; +instead of : +int my_variable_is_ok; + +Functions should follow the same conventions except for standard c lib related functions. +Types should share the same convention but start with a Captial letter instead of lower case. + +11. Please make sure you extensively initialize variables: +avoid as much as possible: +int myVar +... +myVar = 10; + +but use instead: +int myVar = 10; + +12. const values: +const int MY_CONST_VARIABLE=42; is also ok for me, depending on the context of use. +or +const int MyConstVariable = 42; (with a Capital first letter) + +13. macro definitions should follow this convention: +#define MY_HANDY_MACROS_PSEUDO_FUNC() ... + +14. Macros use should be limited to really special cases where they bring real value (like special optimization cases) +Most of the time inlining a function is much better than the use of macros + +15. Don't optimize your code blindly, always favor readability when in doubt. +Very often, optimization is not necessary where you think it is, think about the bubble sort algorithm, where people would code it in assembly, where a heap or quick sort algorithm would be much more efficient (n log(n) instead of quadratic complexity), as an example when values count to be sorted get high. diff --git a/.svn/text-base/revision.svn-base b/.svn/text-base/revision.svn-base new file mode 100644 index 0000000..c29e53f --- /dev/null +++ b/.svn/text-base/revision.svn-base @@ -0,0 +1 @@ +2248 diff --git a/.svn/text-base/version.svn-base b/.svn/text-base/version.svn-base new file mode 100644 index 0000000..eca07e4 --- /dev/null +++ b/.svn/text-base/version.svn-base @@ -0,0 +1 @@ +2.1.2 diff --git a/APPLE_LICENSE b/APPLE_LICENSE new file mode 100644 index 0000000..fe81a60 --- /dev/null +++ b/APPLE_LICENSE @@ -0,0 +1,367 @@ +APPLE PUBLIC SOURCE LICENSE +Version 2.0 - August 6, 2003 + +Please read this License carefully before downloading this software. +By downloading or using this software, you are agreeing to be bound by +the terms of this License. If you do not or cannot agree to the terms +of this License, please do not download or use the software. + +1. General; Definitions. This License applies to any program or other +work which Apple Computer, Inc. ("Apple") makes publicly available and +which contains a notice placed by Apple identifying such program or +work as "Original Code" and stating that it is subject to the terms of +this Apple Public Source License version 2.0 ("License"). As used in +this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is +the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to Apple and (ii) that cover subject +matter contained in the Original Code, but only to the extent +necessary to use, reproduce and/or distribute the Original Code +without infringement; and (b) in the case where You are the grantor of +rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to You and (ii) that cover subject matter in Your +Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or +contributes to the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the +combination of Original Code and any Modifications, and/or any +respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or +otherwise make Covered Code available, directly or indirectly, to +anyone other than You; and/or (b) to use Covered Code, alone or as +part of a Larger Work, in any way to provide a service, including but +not limited to delivery of content, through electronic communication +with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions +thereof with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change +to, the substance and/or structure of the Original Code, any previous +Modifications, the combination of Original Code and any previous +Modifications, and/or any respective portions thereof. When code is +released as a series of files, a Modification is: (a) any addition to +or deletion from the contents of a file containing Covered Code; +and/or (b) any new file or other representation of computer program +statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other +work as originally made available by Apple under this License, +including the Source Code of any updates or upgrades to such programs +or works made available by Apple under this License, and that has been +expressly identified by Apple as such in the header file(s) of such +work; and (b) the object code compiled from such Source Code and +originally made available by Apple under this License. + +1.8 "Source Code" means the human readable form of a program or other +work that is suitable for making modifications to it, including all +modules it contains, plus any associated interface definition files, +scripts used to control compilation and installation of an executable +(object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising +rights under this License. For legal entities, "You" or "Your" +includes any entity which controls, is controlled by, or is under +common control with, You, where "control" means (a) the power, direct +or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of fifty percent +(50%) or more of the outstanding shares or beneficial ownership of +such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms +and conditions of this License, Apple hereby grants You, effective on +the date You accept this License and download the Original Code, a +world-wide, royalty-free, non-exclusive license, to the extent of +Apple's Applicable Patent Rights and copyrights covering the Original +Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, +internally distribute within Your organization, and Externally Deploy +verbatim, unmodified copies of the Original Code, for commercial or +non-commercial purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the +copyright and other proprietary notices and disclaimers of Apple as +they appear in the Original Code, and keep intact all notices in the +Original Code that refer to this License; and + +(b) You must include a copy of this License with every copy of Source +Code of Covered Code and documentation You distribute or Externally +Deploy, and You may not offer or impose any terms on such Source Code +that alter or restrict this License or the recipients' rights +hereunder, except as permitted under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, +display, perform, internally distribute within Your organization, and +Externally Deploy Your Modifications and Covered Code, for commercial +or non-commercial purposes, provided that in each instance You also +meet all of these conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to +the Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the +notice in Exhibit A in each file of the Source Code of all Your +Modifications, and cause the modified files to carry prominent notices +stating that You changed the files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make +Source Code of all Your Externally Deployed Modifications either +available to those to whom You have Externally Deployed Your +Modifications, or publicly available. Source Code of Your Externally +Deployed Modifications must be released under the terms set forth in +this License, including the license grants set forth in Section 3 +below, for as long as you Externally Deploy the Covered Code or twelve +(12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your +Externally Deployed Modifications electronically (e.g. download from a +web site). + +2.3 Distribution of Executable Versions. In addition, if You +Externally Deploy Covered Code (Original Code and/or Modifications) in +object code, executable form only, You must include a prominent +notice, in the code itself as well as in related documentation, +stating that Source Code of the Covered Code is available under the +terms of this License with information on how and where to obtain such +Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that +although Apple and each Contributor grants the licenses to their +respective portions of the Covered Code set forth herein, no +assurances are provided by Apple or any Contributor that the Covered +Code does not infringe the patent or other intellectual property +rights of any other entity. Apple and each Contributor disclaim any +liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a +condition to exercising the rights and licenses granted hereunder, You +hereby assume sole responsibility to secure any other intellectual +property rights needed, if any. For example, if a third party patent +license is required to allow You to distribute the Covered Code, it is +Your responsibility to acquire that license before distributing the +Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the +licenses granted to You under this License, You hereby grant to any +person or entity receiving or distributing Covered Code under this +License a non-exclusive, royalty-free, perpetual, irrevocable license, +under Your Applicable Patent Rights and other intellectual property +rights (other than patent) owned or controlled by You, to use, +reproduce, display, perform, modify, sublicense, distribute and +Externally Deploy Your Modifications of the same scope and extent as +Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered +Code with other code not governed by the terms of this License and +distribute the Larger Work as a single product. In each such instance, +You must make sure the requirements of this License are fulfilled for +the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in +Section 2, no other patent rights, express or implied, are granted by +Apple herein. Modifications and/or Larger Works may require additional +patent licenses from Apple which Apple may grant in its sole +discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, +warranty, support, indemnity or liability obligations and/or other +rights consistent with the scope of the license granted herein +("Additional Terms") to one or more recipients of Covered Code. +However, You may do so only on Your own behalf and as Your sole +responsibility, and not on behalf of Apple or any Contributor. You +must obtain the recipient's agreement that any such Additional Terms +are offered by You alone, and You hereby agree to indemnify, defend +and hold Apple and every Contributor harmless for any liability +incurred by or claims asserted against Apple or such Contributor by +reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new +versions of this License from time to time. Each version will be given +a distinguishing version number. Once Original Code has been published +under a particular version of this License, You may continue to use it +under the terms of that version. You may also choose to use such +Original Code under the terms of any subsequent version of this +License published by Apple. No one other than Apple has the right to +modify the terms applicable to Covered Code created under this +License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in +part pre-release, untested, or not fully tested works. The Covered +Code may contain errors that could cause failures or loss of data, and +may be incomplete or contain inaccuracies. You expressly acknowledge +and agree that use of the Covered Code, or any portion thereof, is at +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. +You acknowledge that the Covered Code is not intended for use in the +operation of nuclear facilities, aircraft navigation, communication +systems, or air traffic control machines in which case the failure of +the Covered Code could lead to death, personal injury, or severe +physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY +TO YOU. In no event shall Apple's total liability to You for all +damages (other than as may be required by applicable law) under this +License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS", +"QuickTime", "QuickTime Streaming Server" or any other trademarks, +service marks, logos or trade names belonging to Apple (collectively +"Apple Marks") or to any trademark, service mark, logo or trade name +belonging to any Contributor. You agree not to use any Apple Marks in +or as part of the name of products derived from the Original Code or +to endorse or promote products derived from the Original Code other +than as expressly permitted by and in strict compliance at all times +with Apple's third party trademark usage guidelines which are posted +at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, +each Contributor retains all rights, title and interest in and to any +Modifications made by such Contributor. Apple retains all rights, +title and interest in and to the Original Code and any Modifications +made by or on behalf of Apple ("Apple Modifications"), and such Apple +Modifications will not be automatically subject to this License. Apple +may, at its sole discretion, choose to license such Apple +Modifications under this License, or on different terms from those +contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with +any term(s) of this License and fail to cure such breach within 30 +days of becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during +the term of this License, commence an action for patent infringement +against Apple; provided that Apple did not first commence +an action for patent infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately +stop any further use, reproduction, modification, sublicensing and +distribution of the Covered Code. All sublicenses to the Covered Code +which have been properly granted prior to termination shall survive +any termination of this License. Provisions which, by their nature, +should remain in effect beyond the termination of this License shall +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, +12.2 and 13. No party will be liable to any other for compensation, +indemnity or damages of any sort solely as a result of terminating +this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of +any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as +defined in FAR 2.101. Government software and technical data rights in +the Covered Code include only those rights customarily provided to the +public as defined in this License. This customary commercial license +in technical data and software is provided in accordance with FAR +12.211 (Technical Data) and 12.212 (Computer Software) and, for +Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- +Commercial Items) and 227.7202-3 (Rights in Commercial Computer +Software or Computer Software Documentation). Accordingly, all U.S. +Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as +creating an agency, partnership, joint venture or any other form of +legal association between or among You, Apple or any Contributor, and +You will not represent to the contrary, whether expressly, by +implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair +Apple's right to acquire, license, develop, have others develop for +it, market and/or distribute technology or products that perform the +same or similar functions as, or otherwise compete with, +Modifications, Larger Works, technology or products that You may +develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to +enforce any provision of this License will not be deemed a waiver of +future enforcement of that or any other provision. Any law or +regulation which provides that the language of a contract shall be +construed against the drafter will not apply to this License. + +13.5 Severability. (a) If for any reason a court of competent +jurisdiction finds any provision of this License, or portion thereof, +to be unenforceable, that provision of the License will be enforced to +the maximum extent permissible so as to effect the economic benefits +and intent of the parties, and the remainder of this License will +continue in full force and effect. (b) Notwithstanding the foregoing, +if applicable law prohibits or restricts You from fully and/or +specifically complying with Sections 2 and/or 3 or prevents the +enforceability of either of those Sections, this License will +immediately terminate and You must immediately discontinue any use of +the Covered Code and destroy all copies of it that are in your +possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution +between You and Apple relating to this License shall take place in the +Northern District of California, and You and Apple hereby consent to +the personal jurisdiction of, and venue in, the state and federal +courts within that District with respect to this License. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the +entire agreement between the parties with respect to the subject +matter hereof. This License shall be governed by the laws of the +United States and the State of California, except that body of +California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following +clause applies: The parties hereby confirm that they have requested +that this License and all related documents be drafted in English. Les +parties ont exige que le present contrat et tous les documents +connexes soient rediges en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +Reserved. + +This file contains Original Code and/or Modifications of Original Code +as defined in and that are subject to the Apple Public Source License +Version 2.0 (the 'License'). You may not use this file except in +compliance with the License. Please obtain a copy of the License at +http://www.opensource.apple.com/apsl/ and read it before using this +file. + +The Original Code and all software distributed under the License are +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +Please see the License for the specific language governing rights and +limitations under the License." diff --git a/BLOCKERS b/BLOCKERS new file mode 100644 index 0000000..0926231 --- /dev/null +++ b/BLOCKERS @@ -0,0 +1,13 @@ + Nvidia GT 540M && 310M : can't find rom to patch : http://forge.voodooprojects.org/p/chameleon/issues/99/ + ** This is also http://forge.voodooprojects.org/p/chameleon/issues/48/ + ** GT 440 --> http://forge.voodooprojects.org/p/chameleon/issues/98/ + Extra Kext Loading dependency error: http://forge.voodooprojects.org/p/chameleon/issues/94/ + AMD reported issues in cpu.c http://forge.voodooprojects.org/p/chameleon/issues/92/ + Make Package: http://forge.voodooprojects.org/p/chameleon/issues/82/ + +=== Done === + Multi Booting: http://forge.voodooprojects.org/p/chameleon/issues/62/ + Memory Allocation Error on boot1 loading /boot: http://forge.voodooprojects.org/p/chameleon/issues/101/ + +== Closed == + SMBus : http://forge.voodooprojects.org/p/chameleon/issues/10/ diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..6194da9 --- /dev/null +++ b/CHANGES @@ -0,0 +1,116 @@ +-macman: Chimera 2.1.2 specific changes: + Removed all closed source modules +-macman: Chimera 2.1.i specific changes: + Rollbacked FileNVRAM.dylib to v1.1.2 + Includes most changes from trunk r2248 while retaining all previous Chimera v2.1.0 fixes and enhancements +- Fix issue booting x86 after rev.2175 (Credits to Mario, Alex and Leon). +-macman: Chimera 2.1.0 specific changes: + Added Haswell CPU support with model and speed detection + Disabled writing of boot arguments to nvram + Reverted AMD graphics card reporting and log messages to Chimera v1.11.1 style + Reverted NVIDIA graphics card reporting to Chimera v1.11.1 style + Included mosts changes from trunk r2246 that didn't conflict with Chimera 2.0.1 fixes and enhancements +- Add boot support to 10.9 (thx old napalm) +- ErmaC : Update gui Icons OS detection +- Update default theme Icon set (thx BlackOsx) +- Add Linux GPT Partition Label +- Fix menuBVR initialization problem +- Implement ErmaC's HDAEnabler.dylib module +- Fix Bug in the loop that look for an ATI card. Credits to Jief Luce +- Fix extension without kPropOSBundleRequired property weren't loaded. Credits to Jief Luce +- Fix Revision mismatch http://forge.voodooprojects.org/p/chameleon/issues/330/ +- ErmaC : Improve PCI info. Interface program and device revision. +- Fix Possible bug in i386/libsaio/device_inject.c devprop_add_device() http://forge.voodooprojects.org/p/chameleon/issues/319/ +- Fix warnings/errors from new llvm/clang (xcode 4.6) +- Fix base64 decode, fixes Issue http://forge.voodooprojects.org/p/chameleon/issues/320/ +- meklort : FileNVRAM module import +-macman: Chimera 2.0.1 specific changes: + iMessage login fix by Meklort from Chameleon 2.2 r2169 + HD4000 support from Chimera 1.11.1 + CPU bus and processor speed fix from Chimera 1.11.1 + Reverted AMD and NVIDIA card reporting to Chimera 1.11.1 style +- cparm : Added a workaroud for Xcode 4.4.x compatibility 504B030414030100630004731141000000007D0000008B00000003000B0062696E01990700020041450308001AED80DA50DF6080B0390FE095B3BC129E1FC27C104EC97897EF27CD1175766CB18C66FF42EFB7023911BDFD5E4BC9AEEC32FF3473963F70B255581D7B74DE9F +- cparm : Fixed a buffer overflow in the plist loader +- cparm : Ported the nvidia plist helper (less time to spend on the device id more time to code :-) ) +- cparm : Added a Sata module, known as YellowIconFixer in my branch, useful to fix yellow icon issue (can also fix an issue with the apple's dvd player application in moutain lion) + , for now not added in the pkg script !!! + +- cparm : Ported the OS detection to the trunk, updated the default theme to v 1.1 (credit to blackosx) + +- Added AtiPorts option to GraphicsEnabler, so users can override the default number of ports. It proved + to be useful when used to limit the number of ports that a framebuffer registers, which seems to be a + requirement on laptops that can only use 2 ports at the same time. + Thanks to Akbar for testing and AniV also for the tip: + http://forum.voodooprojects.org/index.php/topic,1959.msg10402.html#msg10402 +- Added NVidia ION AHCI controllers dev id to AHCIPortInjector kext. + Forgot to mention source on the commit: http://forum.voodooprojects.org/index.php/topic,1170.0.html +- Renamed com.apple.Boot.plist to org.chameleon.Boot.plist. +- Added "ShowInfo" key (enabled by default for now), which enables/disables the display of + partition and resolution related info, on the Gui. + This info may not play well with some custom themes. +- Modules can now be selected between not compiled, compiled into chameleon, or compiled as modules. +- New makefile + configuration system. +- Added the BOOT2_MAX_LENGTH constant in memory.h. This is now used in mboot.c to relocate the correct + number of bytes for boot2. +- Added new ATi/AMD Graphics Card Enabler. +- Added new SMBIOS patcher. + Includes changes to "manufacter" keys, from SM*manufacter to SM*manufacturer. +- Added module system. +- Added automatic P-States & C-States generation for native power management. +- Added Booter Log Dump Tool +- Added Booter message Logging (":/boot-log" ioreg property) +- Removed -x32 option, use arch=i386 instead +- Added automatic SMBusspeed detection for lga1156 core i5/7 cpus +- Added new iMac11,1 sbios default model for lga1156 core i5/17 mobos +- md0 code. Notified xnu when an md ramdisk is specified +- Added rollover image support for selected device icons. + Use device__o.png in theme folder. Credits goes to Blackosx. +- Revisited theme resource embedding. Using the device_ icons are optional with + the exception of device_generic. +- Optimized memory detection speed +- Added displaying source device and partition number for file read operations. +- Increased boot2's maximum size from 383.5k to 447.5k. + Updated stage 1 loaders for handling the new size limit. +- Added alternate format for setting the default partition. The user can specify the selected + volume UUID for the "Default Partition" key. +- Implemented SPD memory automatic detection and injection,seems to work really great ... +- Factorized code to prepare a dynamic memory detection algorithm ... +- Optimized smbios table address search +- Optimized cursor spinout in textmode if no verbose mode is set +- Added ram table structures definitions +- Added getSmbios() a param permitting to select between orig and new smbios entries +- Changed "Default Partition" behavior to accept only native system volumes or foreign partitions. +- Added NVIDIA new NVCAP customization support and support for ION gfx cards from aserebln +- Added ATI new framebuffers support and new cards from PCEFI10.6 +- improved ACPI file search algo by implementing a cache. +- Nvidia injection fix +- pciroot would not always return correct UID in auto detection mode +- Fixed the hibernation problem in boot2/resume.c +- Fixed all new booter versions with SystemType would override the facp value even if correct, + now keeps the facp value if correct and no override has been done, implemented a best effort algo. + for maximizing the chance to get the most correct value before we decide to use a fixed value (1=desktop) +- Fixed display cosmetics of UUID, now a convert.c file contains all + conversions api, to be completed by function that we should reuse. + +- Fixed SystemType would be always forced to a value, now optionally changed + only if overridden +- Kept SystemID as the only option to change manually the system-id + For theses reasons, SystemId from bootConfig and SMUUID from smbiosConfig are now DEPRECATED. + +- Integrated JrCs fadt patch (kept for RC5 the existing DSDT.aml retry algo that disappeared in his patch, + should be more discussed for RC6) +- Added JrCs modified convention name change to coding_standards +- Now malloc (ex. MALLOC in Asere patch) is renamed malloc(size) and is an alias + to safe_malloc(size, file, line) with _FILE_ and _LINE_ preprocessor definitions +- Added a new 'Rename Partition Feature', now permitting to rename partition + like 'System reserved' to a more meaningful name +- Added SystemID option permitting to change the System UUID to a fixed value. +- Added the PciRoot auto detection feature imported from pcefi10.5 +- Added automatic "system-id" injection from dmi bios, also compatible + with SystemID boot option and former SMUUID from smbios,plist +- Added "system-type' automatic injection (1=Desktop) plus override possibility + with the new system-type option in bootConfig +- Added SMserial and SMproductname new options for smbios.plist +- Merged with asere patch, while keeping my fake_efi.c changes, and adding a new + stringForKey() API, also changed the DT__XXXX() set of functions + to handle const char * values instead of char*. diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..fa20dac --- /dev/null +++ b/CREDITS @@ -0,0 +1,18 @@ +Credit goes to: +=============== + +Developers: +---------- +zef, Turbo, dfe, netkas, mackerintel, mercurysquad, fassl, Kabyl, Crazor, Dense, kaitek, iNDi, munky, DHP, JrCs, asereBLN, rekursor, mozodojo, meklort, AnV, valv, AzimutZ, Slice, cosmo1t, cparm, Conti, ErmaC + +Thanks to: +--------- +bumby, kalyway, Krazubu, Eddie11c, JaS, fassl, XyZ, SMF, flama, Galaxy, sckevyn, MasterChief, smith@@, blackosx, DHP, nawcom, scorpius, macman, dmazar + +Package: +--------- +kalyway, AzimutZ, blackosx, ErmaC, scrax, JrCs + +Copyright: +--------- +2008-2013 diff --git a/Cconfig b/Cconfig new file mode 100644 index 0000000..e5dd69a --- /dev/null +++ b/Cconfig @@ -0,0 +1,6 @@ +# +# Chameleon Configuration +# +mainmenu "Chameleon Configuration" + +source "i386/Cconfig" diff --git a/Chameleon.xcodeproj/.svn/all-wcprops b/Chameleon.xcodeproj/.svn/all-wcprops new file mode 100644 index 0000000..a3b594c --- /dev/null +++ b/Chameleon.xcodeproj/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Chameleon.xcodeproj +END +project.pbxproj +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Chameleon.xcodeproj/project.pbxproj +END diff --git a/Chameleon.xcodeproj/.svn/entries b/Chameleon.xcodeproj/.svn/entries new file mode 100644 index 0000000..75c4625 --- /dev/null +++ b/Chameleon.xcodeproj/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/Chameleon.xcodeproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +project.pbxproj +file + + + + +2013-08-27T23:54:01.000000Z +0fd7a21d2e34f9e851e29124292e44c9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +349004 + diff --git a/Chameleon.xcodeproj/.svn/text-base/project.pbxproj.svn-base b/Chameleon.xcodeproj/.svn/text-base/project.pbxproj.svn-base new file mode 100644 index 0000000..9c39841 --- /dev/null +++ b/Chameleon.xcodeproj/.svn/text-base/project.pbxproj.svn-base @@ -0,0 +1,4095 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXFileReference section */ + 012E60F7137AC68F00E35218 /* ati_reg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ati_reg.h; sourceTree = ""; }; + 012E60F8137AC68F00E35218 /* smbios_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios_decode.c; sourceTree = ""; }; + 012E60F9137AC68F00E35218 /* smbios_getters.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios_getters.c; sourceTree = ""; }; + 012E60FA137AC68F00E35218 /* smbios_getters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smbios_getters.h; sourceTree = ""; }; + 012E60FB137AC68F00E35218 /* smbios.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios.c; sourceTree = ""; }; + 0172D0DC11FB66820030222E /* dram_controllers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dram_controllers.h; sourceTree = ""; }; + 0172D0DD11FB66820030222E /* dram_controllers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dram_controllers.c; sourceTree = ""; }; + 019DFBAF11FB94090013E8CC /* MEMTEST86_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MEMTEST86_LICENSE; sourceTree = ""; }; + 1D2A1AF513743A2600787720 /* bootargs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootargs.h; sourceTree = ""; }; + 361BC70214BD977700236488 /* Changes.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changes.txt; sourceTree = ""; }; + 361BC70B14BD97C800236488 /* pkg.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; name = pkg.zip; path = Icons/pkg.zip; sourceTree = ""; }; + 369689D014BD0AF10013D77F /* BLOCKERS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BLOCKERS; sourceTree = ""; }; + 369689D114BD0AF10013D77F /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + 369689D214BD0B470013D77F /* version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = version; sourceTree = ""; }; + 36AB75A114BD0866005B8045 /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; + 36AB75A214BD0866005B8045 /* boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot.png; sourceTree = ""; }; + 36AB75A314BD0866005B8045 /* device_befs_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_befs_o.png; sourceTree = ""; }; + 36AB75A414BD0866005B8045 /* device_befs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_befs.png; sourceTree = ""; }; + 36AB75A514BD0866005B8045 /* device_cdrom_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom_o.png; sourceTree = ""; }; + 36AB75A614BD0866005B8045 /* device_cdrom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom.png; sourceTree = ""; }; + 36AB75A714BD0866005B8045 /* device_ext3_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3_o.png; sourceTree = ""; }; + 36AB75A814BD0866005B8045 /* device_ext3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3.png; sourceTree = ""; }; + 36AB75A914BD0866005B8045 /* device_fat_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat_o.png; sourceTree = ""; }; + 36AB75AA14BD0866005B8045 /* device_fat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat.png; sourceTree = ""; }; + 36AB75AB14BD0866005B8045 /* device_freebsd_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_freebsd_o.png; sourceTree = ""; }; + 36AB75AC14BD0866005B8045 /* device_freebsd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_freebsd.png; sourceTree = ""; }; + 36AB75AD14BD0866005B8045 /* device_generic_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic_o.png; sourceTree = ""; }; + 36AB75AE14BD0866005B8045 /* device_generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic.png; sourceTree = ""; }; + 36AB75AF14BD0866005B8045 /* device_hfsplus_leo_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_leo_o.png; sourceTree = ""; }; + 36AB75B014BD0866005B8045 /* device_hfsplus_leo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_leo.png; sourceTree = ""; }; + 36AB75B114BD0866005B8045 /* device_hfsplus_lion_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_lion_o.png; sourceTree = ""; }; + 36AB75B214BD0866005B8045 /* device_hfsplus_lion.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_lion.png; sourceTree = ""; }; + 36AB75B314BD0866005B8045 /* device_hfsplus_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_o.png; sourceTree = ""; }; + 36AB75B414BD0866005B8045 /* device_hfsplus_sl_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_sl_o.png; sourceTree = ""; }; + 36AB75B514BD0866005B8045 /* device_hfsplus_sl.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_sl.png; sourceTree = ""; }; + 36AB75B614BD0866005B8045 /* device_hfsplus_tiger_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_tiger_o.png; sourceTree = ""; }; + 36AB75B714BD0866005B8045 /* device_hfsplus_tiger.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_tiger.png; sourceTree = ""; }; + 36AB75B814BD0866005B8045 /* device_hfsplus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus.png; sourceTree = ""; }; + 36AB75B914BD0866005B8045 /* device_hfsraid_leo_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_leo_o.png; sourceTree = ""; }; + 36AB75BA14BD0866005B8045 /* device_hfsraid_leo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_leo.png; sourceTree = ""; }; + 36AB75BB14BD0866005B8045 /* device_hfsraid_lion_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_lion_o.png; sourceTree = ""; }; + 36AB75BC14BD0866005B8045 /* device_hfsraid_lion.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_lion.png; sourceTree = ""; }; + 36AB75BD14BD0866005B8045 /* device_hfsraid_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_o.png; sourceTree = ""; }; + 36AB75BE14BD0866005B8045 /* device_hfsraid_sl_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_sl_o.png; sourceTree = ""; }; + 36AB75BF14BD0866005B8045 /* device_hfsraid_sl.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_sl.png; sourceTree = ""; }; + 36AB75C014BD0866005B8045 /* device_hfsraid_tiger_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_tiger_o.png; sourceTree = ""; }; + 36AB75C114BD0866005B8045 /* device_hfsraid_tiger.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_tiger.png; sourceTree = ""; }; + 36AB75C214BD0866005B8045 /* device_hfsraid.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid.png; sourceTree = ""; }; + 36AB75C314BD0866005B8045 /* device_ntfs_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs_o.png; sourceTree = ""; }; + 36AB75C414BD0866005B8045 /* device_ntfs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs.png; sourceTree = ""; }; + 36AB75C514BD0866005B8045 /* device_openbsd_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_openbsd_o.png; sourceTree = ""; }; + 36AB75C614BD0866005B8045 /* device_openbsd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_openbsd.png; sourceTree = ""; }; + 36AB75C714BD0866005B8045 /* device_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_next.png; sourceTree = ""; }; + 36AB75C814BD0866005B8045 /* device_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_prev.png; sourceTree = ""; }; + 36AB75C914BD0866005B8045 /* device_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_selection.png; sourceTree = ""; }; + 36AB75CA14BD0866005B8045 /* font_console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_console.png; sourceTree = ""; }; + 36AB75CB14BD0866005B8045 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + 36AB75CC14BD0866005B8045 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + 36AB75CD14BD0866005B8045 /* menu_boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_boot.png; sourceTree = ""; }; + 36AB75CE14BD0866005B8045 /* menu_help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_help.png; sourceTree = ""; }; + 36AB75CF14BD0866005B8045 /* menu_ignore_caches_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches_disabled.png; sourceTree = ""; }; + 36AB75D014BD0866005B8045 /* menu_ignore_caches.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches.png; sourceTree = ""; }; + 36AB75D114BD0866005B8045 /* menu_memory_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_memory_info.png; sourceTree = ""; }; + 36AB75D214BD0866005B8045 /* menu_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_selection.png; sourceTree = ""; }; + 36AB75D314BD0866005B8045 /* menu_single_user_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user_disabled.png; sourceTree = ""; }; + 36AB75D414BD0866005B8045 /* menu_single_user.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user.png; sourceTree = ""; }; + 36AB75D514BD0866005B8045 /* menu_verbose_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose_disabled.png; sourceTree = ""; }; + 36AB75D614BD0866005B8045 /* menu_verbose.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose.png; sourceTree = ""; }; + 36AB75D714BD0866005B8045 /* menu_video_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_video_info.png; sourceTree = ""; }; + 36AB75D814BD0866005B8045 /* progress_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar_background.png; sourceTree = ""; }; + 36AB75D914BD0866005B8045 /* progress_bar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar.png; sourceTree = ""; }; + 36AB75DA14BD0866005B8045 /* text_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_next.png; sourceTree = ""; }; + 36AB75DB14BD0866005B8045 /* text_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_prev.png; sourceTree = ""; }; + 36AB75DC14BD0866005B8045 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + 36AB75DD14BD0866005B8045 /* thumb.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = thumb.png; sourceTree = ""; }; + 36AB75E114BD091C005B8045 /* InstallLog.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = InstallLog.sh; sourceTree = ""; }; + 36AB75E314BD0925005B8045 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + 36AB75E414BD092D005B8045 /* preinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = preinstall; sourceTree = ""; }; + 36AB75E514BD095E005B8045 /* Control.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Control.txt; path = OptionalSettings/Control.txt; sourceTree = ""; }; + 36AB75E614BD095E005B8045 /* General.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = General.txt; path = OptionalSettings/General.txt; sourceTree = ""; }; + 36AB75E714BD095E005B8045 /* KernelFlags.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = KernelFlags.txt; path = OptionalSettings/KernelFlags.txt; sourceTree = ""; }; + 36AB75E814BD095E005B8045 /* PowerManagement.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = PowerManagement.txt; path = OptionalSettings/PowerManagement.txt; sourceTree = ""; }; + 36AB75E914BD095E005B8045 /* Resolution.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Resolution.txt; path = OptionalSettings/Resolution.txt; sourceTree = ""; }; + 36AB75EA14BD095E005B8045 /* Video.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Video.txt; path = OptionalSettings/Video.txt; sourceTree = ""; }; + 65ED53931204B83200B22507 /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; + 6DBAFD1313B0D21E0047ED33 /* modules_support.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = modules_support.s; sourceTree = ""; }; + 6DBAFD1413B0D21E0047ED33 /* modules.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = modules.c; sourceTree = ""; }; + 6DBAFD1513B0D21E0047ED33 /* modules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modules.h; sourceTree = ""; }; + 6DBAFD1813B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFD1913B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFD1B13B0D4590047ED33 /* alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignment.h; sourceTree = ""; }; + 6DBAFD1C13B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFD1E13B0D4590047ED33 /* alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignment.h; sourceTree = ""; }; + 6DBAFD1F13B0D4590047ED33 /* asm_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm_help.h; sourceTree = ""; }; + 6DBAFD2013B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFD2113B0D4590047ED33 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpu.h; sourceTree = ""; }; + 6DBAFD2213B0D4590047ED33 /* desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = desc.h; sourceTree = ""; }; + 6DBAFD2313B0D4590047ED33 /* fenv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fenv.h; sourceTree = ""; }; + 6DBAFD2413B0D4590047ED33 /* fpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fpu.h; sourceTree = ""; }; + 6DBAFD2513B0D4590047ED33 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = ""; }; + 6DBAFD2613B0D4590047ED33 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = ""; }; + 6DBAFD2713B0D4590047ED33 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math.h; sourceTree = ""; }; + 6DBAFD2813B0D4590047ED33 /* pio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pio.h; sourceTree = ""; }; + 6DBAFD2913B0D4590047ED33 /* reg_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reg_help.h; sourceTree = ""; }; + 6DBAFD2A13B0D4590047ED33 /* sel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sel.h; sourceTree = ""; }; + 6DBAFD2B13B0D4590047ED33 /* table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = table.h; sourceTree = ""; }; + 6DBAFD2C13B0D4590047ED33 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; + 6DBAFD2E13B0D4590047ED33 /* alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignment.h; sourceTree = ""; }; + 6DBAFD2F13B0D4590047ED33 /* asm_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm_help.h; sourceTree = ""; }; + 6DBAFD3013B0D4590047ED33 /* basic_regs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basic_regs.h; sourceTree = ""; }; + 6DBAFD3113B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFD3213B0D4590047ED33 /* cframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cframe.h; sourceTree = ""; }; + 6DBAFD3313B0D4590047ED33 /* fenv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fenv.h; sourceTree = ""; }; + 6DBAFD3413B0D4590047ED33 /* fp_regs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp_regs.h; sourceTree = ""; }; + 6DBAFD3513B0D4590047ED33 /* macro_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macro_help.h; sourceTree = ""; }; + 6DBAFD3613B0D4590047ED33 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math.h; sourceTree = ""; }; + 6DBAFD3713B0D4590047ED33 /* mode_independent_asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mode_independent_asm.h; sourceTree = ""; }; + 6DBAFD3813B0D4590047ED33 /* pseudo_inst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pseudo_inst.h; sourceTree = ""; }; + 6DBAFD3913B0D4590047ED33 /* reg_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reg_help.h; sourceTree = ""; }; + 6DBAFD3A13B0D4590047ED33 /* assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = ""; }; + 6DBAFD3B13B0D4590047ED33 /* ctype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctype.h; sourceTree = ""; }; + 6DBAFD3D13B0D4590047ED33 /* device_port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_port.h; sourceTree = ""; }; + 6DBAFD3E13B0D4590047ED33 /* device_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_types.h; sourceTree = ""; }; + 6DBAFD3F13B0D4590047ED33 /* errno.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errno.h; sourceTree = ""; }; + 6DBAFD4013B0D4590047ED33 /* float.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = float.h; sourceTree = ""; }; + 6DBAFD4213B0D4590047ED33 /* hfs_encodings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_encodings.h; sourceTree = ""; }; + 6DBAFD4313B0D4590047ED33 /* hfs_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_format.h; sourceTree = ""; }; + 6DBAFD4413B0D4590047ED33 /* hfs_mount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_mount.h; sourceTree = ""; }; + 6DBAFD4613B0D4590047ED33 /* _limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _limits.h; sourceTree = ""; }; + 6DBAFD4713B0D4590047ED33 /* _param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _param.h; sourceTree = ""; }; + 6DBAFD4813B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFD4913B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFD4A13B0D4590047ED33 /* eflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eflags.h; sourceTree = ""; }; + 6DBAFD4B13B0D4590047ED33 /* endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = endian.h; sourceTree = ""; }; + 6DBAFD4C13B0D4590047ED33 /* fasttrap_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fasttrap_isa.h; sourceTree = ""; }; + 6DBAFD4D13B0D4590047ED33 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + 6DBAFD4E13B0D4590047ED33 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = ""; }; + 6DBAFD4F13B0D4590047ED33 /* profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = profile.h; sourceTree = ""; }; + 6DBAFD5013B0D4590047ED33 /* setjmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; + 6DBAFD5113B0D4590047ED33 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + 6DBAFD5213B0D4590047ED33 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 6DBAFD5313B0D4590047ED33 /* user_ldt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = user_ldt.h; sourceTree = ""; }; + 6DBAFD5413B0D4590047ED33 /* vmparam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vmparam.h; sourceTree = ""; }; + 6DBAFD5513B0D4590047ED33 /* inttypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inttypes.h; sourceTree = ""; }; + 6DBAFD5813B0D4590047ED33 /* IOACPIPlatformDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOACPIPlatformDevice.h; sourceTree = ""; }; + 6DBAFD5913B0D4590047ED33 /* IOACPIPlatformExpert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOACPIPlatformExpert.h; sourceTree = ""; }; + 6DBAFD5A13B0D4590047ED33 /* IOACPITypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOACPITypes.h; sourceTree = ""; }; + 6DBAFD5B13B0D4590047ED33 /* assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = ""; }; + 6DBAFD5D13B0D4590047ED33 /* ATADeviceNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATADeviceNub.h; sourceTree = ""; }; + 6DBAFD5E13B0D4590047ED33 /* ATATimerEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATATimerEventSource.h; sourceTree = ""; }; + 6DBAFD5F13B0D4590047ED33 /* IOATABusCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATABusCommand.h; sourceTree = ""; }; + 6DBAFD6013B0D4590047ED33 /* IOATABusInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATABusInfo.h; sourceTree = ""; }; + 6DBAFD6113B0D4590047ED33 /* IOATACommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATACommand.h; sourceTree = ""; }; + 6DBAFD6213B0D4590047ED33 /* IOATAController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATAController.h; sourceTree = ""; }; + 6DBAFD6313B0D4590047ED33 /* IOATADevConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATADevConfig.h; sourceTree = ""; }; + 6DBAFD6413B0D4590047ED33 /* IOATADevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATADevice.h; sourceTree = ""; }; + 6DBAFD6513B0D4590047ED33 /* IOATARegI386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATARegI386.h; sourceTree = ""; }; + 6DBAFD6613B0D4590047ED33 /* IOATATypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATATypes.h; sourceTree = ""; }; + 6DBAFD6713B0D4590047ED33 /* IOPCIATA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPCIATA.h; sourceTree = ""; }; + 6DBAFD6813B0D4590047ED33 /* MacIOATA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacIOATA.h; sourceTree = ""; }; + 6DBAFD6A13B0D4590047ED33 /* IOAudioControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioControl.h; sourceTree = ""; }; + 6DBAFD6B13B0D4590047ED33 /* IOAudioControlUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioControlUserClient.h; sourceTree = ""; }; + 6DBAFD6C13B0D4590047ED33 /* IOAudioDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioDebug.h; sourceTree = ""; }; + 6DBAFD6D13B0D4590047ED33 /* IOAudioDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioDefines.h; sourceTree = ""; }; + 6DBAFD6E13B0D4590047ED33 /* IOAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioDevice.h; sourceTree = ""; }; + 6DBAFD6F13B0D4590047ED33 /* IOAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioEngine.h; sourceTree = ""; }; + 6DBAFD7013B0D4590047ED33 /* IOAudioEngineUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioEngineUserClient.h; sourceTree = ""; }; + 6DBAFD7113B0D4590047ED33 /* IOAudioLevelControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioLevelControl.h; sourceTree = ""; }; + 6DBAFD7213B0D4590047ED33 /* IOAudioPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioPort.h; sourceTree = ""; }; + 6DBAFD7313B0D4590047ED33 /* IOAudioSelectorControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioSelectorControl.h; sourceTree = ""; }; + 6DBAFD7413B0D4590047ED33 /* IOAudioStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioStream.h; sourceTree = ""; }; + 6DBAFD7513B0D4590047ED33 /* IOAudioToggleControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioToggleControl.h; sourceTree = ""; }; + 6DBAFD7613B0D4590047ED33 /* IOAudioTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioTypes.h; sourceTree = ""; }; + 6DBAFD7813B0D4590047ED33 /* IOFireWireAVCCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCCommand.h; sourceTree = ""; }; + 6DBAFD7913B0D4590047ED33 /* IOFireWireAVCConsts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCConsts.h; sourceTree = ""; }; + 6DBAFD7A13B0D4590047ED33 /* IOFireWireAVCRequestSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCRequestSpace.h; sourceTree = ""; }; + 6DBAFD7B13B0D4590047ED33 /* IOFireWireAVCTargetSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCTargetSpace.h; sourceTree = ""; }; + 6DBAFD7C13B0D4590047ED33 /* IOFireWireAVCUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCUnit.h; sourceTree = ""; }; + 6DBAFD7D13B0D4590047ED33 /* IOFireWireAVCUserClientCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCUserClientCommon.h; sourceTree = ""; }; + 6DBAFD7E13B0D4590047ED33 /* IOFireWirePCRSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWirePCRSpace.h; sourceTree = ""; }; + 6DBAFD8013B0D4590047ED33 /* Bluetooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bluetooth.h; sourceTree = ""; }; + 6DBAFD8113B0D4590047ED33 /* BluetoothAssignedNumbers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BluetoothAssignedNumbers.h; sourceTree = ""; }; + 6DBAFD8213B0D4590047ED33 /* IOBluetoothHCIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHCIController.h; sourceTree = ""; }; + 6DBAFD8313B0D4590047ED33 /* IOBluetoothHCIRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHCIRequest.h; sourceTree = ""; }; + 6DBAFD8413B0D4590047ED33 /* IOBluetoothHIDDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHIDDriver.h; sourceTree = ""; }; + 6DBAFD8513B0D4590047ED33 /* IOBluetoothHIDDriverTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHIDDriverTypes.h; sourceTree = ""; }; + 6DBAFD8613B0D4590047ED33 /* IOBluetoothInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothInternal.h; sourceTree = ""; }; + 6DBAFD8713B0D4590047ED33 /* IOBluetoothTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothTypes.h; sourceTree = ""; }; + 6DBAFD8913B0D4590047ED33 /* IOConfigDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOConfigDirectory.h; sourceTree = ""; }; + 6DBAFD8A13B0D4590047ED33 /* IOFireWireBus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireBus.h; sourceTree = ""; }; + 6DBAFD8B13B0D4590047ED33 /* IOFireWireController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireController.h; sourceTree = ""; }; + 6DBAFD8C13B0D4590047ED33 /* IOFireWireDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireDevice.h; sourceTree = ""; }; + 6DBAFD8D13B0D4590047ED33 /* IOFireWireFamilyCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireFamilyCommon.h; sourceTree = ""; }; + 6DBAFD8E13B0D4590047ED33 /* IOFireWireIRMAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireIRMAllocation.h; sourceTree = ""; }; + 6DBAFD8F13B0D4590047ED33 /* IOFireWireLocalNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireLocalNode.h; sourceTree = ""; }; + 6DBAFD9013B0D4590047ED33 /* IOFireWireMultiIsochReceive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireMultiIsochReceive.h; sourceTree = ""; }; + 6DBAFD9113B0D4590047ED33 /* IOFireWireNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireNub.h; sourceTree = ""; }; + 6DBAFD9213B0D4590047ED33 /* IOFireWirePowerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWirePowerManager.h; sourceTree = ""; }; + 6DBAFD9313B0D4590047ED33 /* IOFireWireUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireUnit.h; sourceTree = ""; }; + 6DBAFD9413B0D4590047ED33 /* IOFWAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWAddressSpace.h; sourceTree = ""; }; + 6DBAFD9513B0D4590047ED33 /* IOFWAsyncStreamListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWAsyncStreamListener.h; sourceTree = ""; }; + 6DBAFD9613B0D4590047ED33 /* IOFWCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWCommand.h; sourceTree = ""; }; + 6DBAFD9713B0D4590047ED33 /* IOFWDCL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCL.h; sourceTree = ""; }; + 6DBAFD9813B0D4590047ED33 /* IOFWDCLPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCLPool.h; sourceTree = ""; }; + 6DBAFD9913B0D4590047ED33 /* IOFWDCLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCLProgram.h; sourceTree = ""; }; + 6DBAFD9A13B0D4590047ED33 /* IOFWDCLTranslator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCLTranslator.h; sourceTree = ""; }; + 6DBAFD9B13B0D4590047ED33 /* IOFWIsochChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWIsochChannel.h; sourceTree = ""; }; + 6DBAFD9C13B0D4590047ED33 /* IOFWIsochPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWIsochPort.h; sourceTree = ""; }; + 6DBAFD9D13B0D4590047ED33 /* IOFWLocalIsochPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWLocalIsochPort.h; sourceTree = ""; }; + 6DBAFD9E13B0D4590047ED33 /* IOFWPHYPacketListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWPHYPacketListener.h; sourceTree = ""; }; + 6DBAFD9F13B0D4590047ED33 /* IOFWPhysicalAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWPhysicalAddressSpace.h; sourceTree = ""; }; + 6DBAFDA013B0D4590047ED33 /* IOFWPseudoAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWPseudoAddressSpace.h; sourceTree = ""; }; + 6DBAFDA113B0D4590047ED33 /* IOFWRegs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWRegs.h; sourceTree = ""; }; + 6DBAFDA213B0D4590047ED33 /* IOFWSimpleContiguousPhysicalAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWSimpleContiguousPhysicalAddressSpace.h; sourceTree = ""; }; + 6DBAFDA313B0D4590047ED33 /* IOFWSimplePhysicalAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWSimplePhysicalAddressSpace.h; sourceTree = ""; }; + 6DBAFDA413B0D4590047ED33 /* IOFWSyncer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWSyncer.h; sourceTree = ""; }; + 6DBAFDA513B0D4590047ED33 /* IOFWUserObjectExporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWUserObjectExporter.h; sourceTree = ""; }; + 6DBAFDA613B0D4590047ED33 /* IOFWUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWUtils.h; sourceTree = ""; }; + 6DBAFDA713B0D4590047ED33 /* IOLocalConfigDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLocalConfigDirectory.h; sourceTree = ""; }; + 6DBAFDA813B0D4590047ED33 /* IORemoteConfigDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORemoteConfigDirectory.h; sourceTree = ""; }; + 6DBAFDAA13B0D4590047ED33 /* IOAccelClientConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelClientConnect.h; sourceTree = ""; }; + 6DBAFDAB13B0D4590047ED33 /* IOAccelerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelerator.h; sourceTree = ""; }; + 6DBAFDAC13B0D4590047ED33 /* IOAccelSurfaceConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelSurfaceConnect.h; sourceTree = ""; }; + 6DBAFDAD13B0D4590047ED33 /* IOAccelTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelTypes.h; sourceTree = ""; }; + 6DBAFDAE13B0D4590047ED33 /* IODisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODisplay.h; sourceTree = ""; }; + 6DBAFDAF13B0D4590047ED33 /* IOFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFramebuffer.h; sourceTree = ""; }; + 6DBAFDB013B0D4590047ED33 /* IOFramebufferShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFramebufferShared.h; sourceTree = ""; }; + 6DBAFDB113B0D4590047ED33 /* IOGraphicsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsDevice.h; sourceTree = ""; }; + 6DBAFDB213B0D4590047ED33 /* IOGraphicsEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsEngine.h; sourceTree = ""; }; + 6DBAFDB313B0D4590047ED33 /* IOGraphicsInterfaceTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsInterfaceTypes.h; sourceTree = ""; }; + 6DBAFDB413B0D4590047ED33 /* IOGraphicsTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsTypes.h; sourceTree = ""; }; + 6DBAFDB613B0D4590047ED33 /* IOHIDDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDDevice.h; sourceTree = ""; }; + 6DBAFDB713B0D4590047ED33 /* IOHIDElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDElement.h; sourceTree = ""; }; + 6DBAFDB813B0D4590047ED33 /* IOHIDInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDInterface.h; sourceTree = ""; }; + 6DBAFDB913B0D4590047ED33 /* IOHIDKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDKeys.h; sourceTree = ""; }; + 6DBAFDBA13B0D4590047ED33 /* IOHIDUsageTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDUsageTables.h; sourceTree = ""; }; + 6DBAFDBC13B0D4590047ED33 /* IOHIDEventDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDEventDriver.h; sourceTree = ""; }; + 6DBAFDBD13B0D4590047ED33 /* IOHIDEventService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDEventService.h; sourceTree = ""; }; + 6DBAFDBF13B0D4590047ED33 /* ev_keymap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ev_keymap.h; sourceTree = ""; }; + 6DBAFDC013B0D4590047ED33 /* IOHIDDescriptorParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDDescriptorParser.h; sourceTree = ""; }; + 6DBAFDC113B0D4590047ED33 /* IOHIDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDevice.h; sourceTree = ""; }; + 6DBAFDC213B0D4590047ED33 /* IOHIDParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDParameter.h; sourceTree = ""; }; + 6DBAFDC313B0D4590047ED33 /* IOHIDShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDShared.h; sourceTree = ""; }; + 6DBAFDC413B0D4590047ED33 /* IOHIDSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDSystem.h; sourceTree = ""; }; + 6DBAFDC513B0D4590047ED33 /* IOHIDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDTypes.h; sourceTree = ""; }; + 6DBAFDC613B0D4590047ED33 /* IOHIDUsageTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDUsageTables.h; sourceTree = ""; }; + 6DBAFDC713B0D4590047ED33 /* IOHIKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIKeyboard.h; sourceTree = ""; }; + 6DBAFDC813B0D4590047ED33 /* IOHIKeyboardMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIKeyboardMapper.h; sourceTree = ""; }; + 6DBAFDC913B0D4590047ED33 /* IOHIPointing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIPointing.h; sourceTree = ""; }; + 6DBAFDCA13B0D4590047ED33 /* IOLLEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLLEvent.h; sourceTree = ""; }; + 6DBAFDCC13B0D4590047ED33 /* IOI2CInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOI2CInterface.h; sourceTree = ""; }; + 6DBAFDCD13B0D4590047ED33 /* IOBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBSD.h; sourceTree = ""; }; + 6DBAFDCE13B0D4590047ED33 /* IOBufferMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBufferMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDCF13B0D4590047ED33 /* IOCatalogue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCatalogue.h; sourceTree = ""; }; + 6DBAFDD013B0D4590047ED33 /* IOCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCommand.h; sourceTree = ""; }; + 6DBAFDD113B0D4590047ED33 /* IOCommandGate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCommandGate.h; sourceTree = ""; }; + 6DBAFDD213B0D4590047ED33 /* IOCommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCommandPool.h; sourceTree = ""; }; + 6DBAFDD313B0D4590047ED33 /* IOConditionLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOConditionLock.h; sourceTree = ""; }; + 6DBAFDD413B0D4590047ED33 /* IODataQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODataQueue.h; sourceTree = ""; }; + 6DBAFDD513B0D4590047ED33 /* IODataQueueShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODataQueueShared.h; sourceTree = ""; }; + 6DBAFDD613B0D4590047ED33 /* IODeviceMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODeviceMemory.h; sourceTree = ""; }; + 6DBAFDD713B0D4590047ED33 /* IODeviceTreeSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODeviceTreeSupport.h; sourceTree = ""; }; + 6DBAFDD813B0D4590047ED33 /* IODMACommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODMACommand.h; sourceTree = ""; }; + 6DBAFDD913B0D4590047ED33 /* IODMAController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODMAController.h; sourceTree = ""; }; + 6DBAFDDA13B0D4590047ED33 /* IODMAEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODMAEventSource.h; sourceTree = ""; }; + 6DBAFDDB13B0D4590047ED33 /* IOEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEventSource.h; sourceTree = ""; }; + 6DBAFDDC13B0D4590047ED33 /* IOFilterInterruptEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFilterInterruptEventSource.h; sourceTree = ""; }; + 6DBAFDDD13B0D4590047ED33 /* IOInterleavedMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterleavedMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDDE13B0D4590047ED33 /* IOInterruptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterruptController.h; sourceTree = ""; }; + 6DBAFDDF13B0D4590047ED33 /* IOInterruptEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterruptEventSource.h; sourceTree = ""; }; + 6DBAFDE013B0D4590047ED33 /* IOInterrupts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterrupts.h; sourceTree = ""; }; + 6DBAFDE113B0D4590047ED33 /* IOKitDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitDebug.h; sourceTree = ""; }; + 6DBAFDE213B0D4590047ED33 /* IOKitKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitKeys.h; sourceTree = ""; }; + 6DBAFDE313B0D4590047ED33 /* IOKitServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitServer.h; sourceTree = ""; }; + 6DBAFDE413B0D4590047ED33 /* IOLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLib.h; sourceTree = ""; }; + 6DBAFDE513B0D4590047ED33 /* IOLocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLocks.h; sourceTree = ""; }; + 6DBAFDE613B0D4590047ED33 /* IOMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMapper.h; sourceTree = ""; }; + 6DBAFDE713B0D4590047ED33 /* IOMemoryCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMemoryCursor.h; sourceTree = ""; }; + 6DBAFDE813B0D4590047ED33 /* IOMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDE913B0D4590047ED33 /* IOMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMessage.h; sourceTree = ""; }; + 6DBAFDEA13B0D4590047ED33 /* IOMultiMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMultiMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDEB13B0D4590047ED33 /* IONotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONotifier.h; sourceTree = ""; }; + 6DBAFDEC13B0D4590047ED33 /* IONVRAM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONVRAM.h; sourceTree = ""; }; + 6DBAFDED13B0D4590047ED33 /* IOPlatformExpert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPlatformExpert.h; sourceTree = ""; }; + 6DBAFDEE13B0D4590047ED33 /* IORangeAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORangeAllocator.h; sourceTree = ""; }; + 6DBAFDEF13B0D4590047ED33 /* IORegistryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORegistryEntry.h; sourceTree = ""; }; + 6DBAFDF013B0D4590047ED33 /* IOReturn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOReturn.h; sourceTree = ""; }; + 6DBAFDF113B0D4590047ED33 /* IOService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOService.h; sourceTree = ""; }; + 6DBAFDF213B0D4590047ED33 /* IOServicePM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOServicePM.h; sourceTree = ""; }; + 6DBAFDF313B0D4590047ED33 /* IOSharedDataQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSharedDataQueue.h; sourceTree = ""; }; + 6DBAFDF413B0D4590047ED33 /* IOSharedLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSharedLock.h; sourceTree = ""; }; + 6DBAFDF513B0D4590047ED33 /* IOSubMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSubMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDF613B0D4590047ED33 /* IOSyncer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSyncer.h; sourceTree = ""; }; + 6DBAFDF713B0D4590047ED33 /* IOTimerEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTimerEventSource.h; sourceTree = ""; }; + 6DBAFDF813B0D4590047ED33 /* IOTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTimeStamp.h; sourceTree = ""; }; + 6DBAFDF913B0D4590047ED33 /* IOTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTypes.h; sourceTree = ""; }; + 6DBAFDFA13B0D4590047ED33 /* IOUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUserClient.h; sourceTree = ""; }; + 6DBAFDFB13B0D4590047ED33 /* IOWorkLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOWorkLoop.h; sourceTree = ""; }; + 6DBAFDFD13B0D4590047ED33 /* IOMacOSTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMacOSTypes.h; sourceTree = ""; }; + 6DBAFDFE13B0D4590047ED33 /* IOMacOSVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMacOSVideo.h; sourceTree = ""; }; + 6DBAFDFF13B0D4590047ED33 /* IONDRVFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONDRVFramebuffer.h; sourceTree = ""; }; + 6DBAFE0013B0D4590047ED33 /* IONDRVLibraries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONDRVLibraries.h; sourceTree = ""; }; + 6DBAFE0113B0D4590047ED33 /* IONDRVSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONDRVSupport.h; sourceTree = ""; }; + 6DBAFE0313B0D4590047ED33 /* IOBasicOutputQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBasicOutputQueue.h; sourceTree = ""; }; + 6DBAFE0413B0D4590047ED33 /* IOEthernetController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetController.h; sourceTree = ""; }; + 6DBAFE0513B0D4590047ED33 /* IOEthernetInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetInterface.h; sourceTree = ""; }; + 6DBAFE0613B0D4590047ED33 /* IOEthernetStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetStats.h; sourceTree = ""; }; + 6DBAFE0713B0D4590047ED33 /* IOGatedOutputQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGatedOutputQueue.h; sourceTree = ""; }; + 6DBAFE0813B0D4590047ED33 /* IOKernelDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKernelDebugger.h; sourceTree = ""; }; + 6DBAFE0913B0D4590047ED33 /* IOMbufMemoryCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMbufMemoryCursor.h; sourceTree = ""; }; + 6DBAFE0A13B0D4590047ED33 /* IONetworkController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkController.h; sourceTree = ""; }; + 6DBAFE0B13B0D4590047ED33 /* IONetworkData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkData.h; sourceTree = ""; }; + 6DBAFE0C13B0D4590047ED33 /* IONetworkInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkInterface.h; sourceTree = ""; }; + 6DBAFE0D13B0D4590047ED33 /* IONetworkMedium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkMedium.h; sourceTree = ""; }; + 6DBAFE0E13B0D4590047ED33 /* IONetworkStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkStats.h; sourceTree = ""; }; + 6DBAFE0F13B0D4590047ED33 /* IOOutputQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOOutputQueue.h; sourceTree = ""; }; + 6DBAFE1013B0D4590047ED33 /* IOPacketQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPacketQueue.h; sourceTree = ""; }; + 6DBAFE1213B0D4590047ED33 /* IONVRAMController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONVRAMController.h; sourceTree = ""; }; + 6DBAFE1313B0D4590047ED33 /* OSMessageNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSMessageNotification.h; sourceTree = ""; }; + 6DBAFE1513B0D4590047ED33 /* IOAGPDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAGPDevice.h; sourceTree = ""; }; + 6DBAFE1613B0D4590047ED33 /* IOPCIBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPCIBridge.h; sourceTree = ""; }; + 6DBAFE1713B0D4590047ED33 /* IOPCIDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPCIDevice.h; sourceTree = ""; }; + 6DBAFE1913B0D4590047ED33 /* AppleMacIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleMacIO.h; sourceTree = ""; }; + 6DBAFE1A13B0D4590047ED33 /* AppleMacIODevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleMacIODevice.h; sourceTree = ""; }; + 6DBAFE1B13B0D4590047ED33 /* AppleNMI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleNMI.h; sourceTree = ""; }; + 6DBAFE1C13B0D4590047ED33 /* ApplePlatformExpert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePlatformExpert.h; sourceTree = ""; }; + 6DBAFE1E13B0D4590047ED33 /* IOPwrController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPwrController.h; sourceTree = ""; }; + 6DBAFE2013B0D4590047ED33 /* IODBDMA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODBDMA.h; sourceTree = ""; }; + 6DBAFE2213B0D4590047ED33 /* IOPM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPM.h; sourceTree = ""; }; + 6DBAFE2313B0D4590047ED33 /* IOPMDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMDeprecated.h; sourceTree = ""; }; + 6DBAFE2413B0D4590047ED33 /* IOPMLibDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMLibDefs.h; sourceTree = ""; }; + 6DBAFE2513B0D4590047ED33 /* IOPMPowerSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMPowerSource.h; sourceTree = ""; }; + 6DBAFE2613B0D4590047ED33 /* IOPMPowerSourceList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMPowerSourceList.h; sourceTree = ""; }; + 6DBAFE2713B0D4590047ED33 /* IOPMpowerState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMpowerState.h; sourceTree = ""; }; + 6DBAFE2813B0D4590047ED33 /* IOPMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMPrivate.h; sourceTree = ""; }; + 6DBAFE2913B0D4590047ED33 /* IOPowerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPowerConnection.h; sourceTree = ""; }; + 6DBAFE2A13B0D4590047ED33 /* RootDomain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootDomain.h; sourceTree = ""; }; + 6DBAFE2C13B0D4590047ED33 /* IORTCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORTCController.h; sourceTree = ""; }; + 6DBAFE2E13B0D4590047ED33 /* IOFireWireSBP2Login.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2Login.h; sourceTree = ""; }; + 6DBAFE2F13B0D4590047ED33 /* IOFireWireSBP2LSIWorkaroundDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2LSIWorkaroundDescriptor.h; sourceTree = ""; }; + 6DBAFE3013B0D4590047ED33 /* IOFireWireSBP2LUN.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2LUN.h; sourceTree = ""; }; + 6DBAFE3113B0D4590047ED33 /* IOFireWireSBP2ManagementORB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2ManagementORB.h; sourceTree = ""; }; + 6DBAFE3213B0D4590047ED33 /* IOFireWireSBP2ORB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2ORB.h; sourceTree = ""; }; + 6DBAFE3313B0D4590047ED33 /* IOFireWireSBP2Target.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2Target.h; sourceTree = ""; }; + 6DBAFE3413B0D4590047ED33 /* IOFireWireSBP2UserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2UserClient.h; sourceTree = ""; }; + 6DBAFE3513B0D4590047ED33 /* IOFireWireSBP2UserClientCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2UserClientCommon.h; sourceTree = ""; }; + 6DBAFE3613B0D4590047ED33 /* IOFireWireSerialBusProtocolTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSerialBusProtocolTransport.h; sourceTree = ""; }; + 6DBAFE3813B0D4590047ED33 /* IOBDServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDServices.h; sourceTree = ""; }; + 6DBAFE3913B0D4590047ED33 /* IOBlockStorageServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBlockStorageServices.h; sourceTree = ""; }; + 6DBAFE3A13B0D4590047ED33 /* IOCompactDiscServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCompactDiscServices.h; sourceTree = ""; }; + 6DBAFE3B13B0D4590047ED33 /* IODVDServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDServices.h; sourceTree = ""; }; + 6DBAFE3C13B0D4590047ED33 /* IOReducedBlockServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOReducedBlockServices.h; sourceTree = ""; }; + 6DBAFE3D13B0D4590047ED33 /* IOSCSIBlockCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIBlockCommandsDevice.h; sourceTree = ""; }; + 6DBAFE3E13B0D4590047ED33 /* IOSCSIMultimediaCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIMultimediaCommandsDevice.h; sourceTree = ""; }; + 6DBAFE3F13B0D4590047ED33 /* IOSCSIPeripheralDeviceNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceNub.h; sourceTree = ""; }; + 6DBAFE4013B0D4590047ED33 /* IOSCSIPeripheralDeviceType00.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType00.h; sourceTree = ""; }; + 6DBAFE4113B0D4590047ED33 /* IOSCSIPeripheralDeviceType05.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType05.h; sourceTree = ""; }; + 6DBAFE4213B0D4590047ED33 /* IOSCSIPeripheralDeviceType07.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType07.h; sourceTree = ""; }; + 6DBAFE4313B0D4590047ED33 /* IOSCSIPeripheralDeviceType0E.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType0E.h; sourceTree = ""; }; + 6DBAFE4413B0D4590047ED33 /* IOSCSIPrimaryCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPrimaryCommandsDevice.h; sourceTree = ""; }; + 6DBAFE4513B0D4590047ED33 /* IOSCSIProtocolInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIProtocolInterface.h; sourceTree = ""; }; + 6DBAFE4613B0D4590047ED33 /* IOSCSIProtocolServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIProtocolServices.h; sourceTree = ""; }; + 6DBAFE4713B0D4590047ED33 /* IOSCSIReducedBlockCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIReducedBlockCommandsDevice.h; sourceTree = ""; }; + 6DBAFE4813B0D4590047ED33 /* SCSICmds_INQUIRY_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_INQUIRY_Definitions.h; sourceTree = ""; }; + 6DBAFE4913B0D4590047ED33 /* SCSICmds_MODE_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_MODE_Definitions.h; sourceTree = ""; }; + 6DBAFE4A13B0D4590047ED33 /* SCSICmds_READ_CAPACITY_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_READ_CAPACITY_Definitions.h; sourceTree = ""; }; + 6DBAFE4B13B0D4590047ED33 /* SCSICmds_REPORT_LUNS_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_REPORT_LUNS_Definitions.h; sourceTree = ""; }; + 6DBAFE4C13B0D4590047ED33 /* SCSICmds_REQUEST_SENSE_Defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_REQUEST_SENSE_Defs.h; sourceTree = ""; }; + 6DBAFE4D13B0D4590047ED33 /* SCSICommandDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICommandDefinitions.h; sourceTree = ""; }; + 6DBAFE4E13B0D4590047ED33 /* SCSICommandOperationCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICommandOperationCodes.h; sourceTree = ""; }; + 6DBAFE4F13B0D4590047ED33 /* SCSIPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSIPort.h; sourceTree = ""; }; + 6DBAFE5013B0D4590047ED33 /* SCSITask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSITask.h; sourceTree = ""; }; + 6DBAFE5213B0D4590047ED33 /* IOSCSIParallelInterfaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIParallelInterfaceController.h; sourceTree = ""; }; + 6DBAFE5413B0D4590047ED33 /* IOModemSerialStreamSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOModemSerialStreamSync.h; sourceTree = ""; }; + 6DBAFE5513B0D4590047ED33 /* IORS232SerialStreamSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORS232SerialStreamSync.h; sourceTree = ""; }; + 6DBAFE5613B0D4590047ED33 /* IOSerialDriverSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSerialDriverSync.h; sourceTree = ""; }; + 6DBAFE5713B0D4590047ED33 /* IOSerialKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSerialKeys.h; sourceTree = ""; }; + 6DBAFE5813B0D4590047ED33 /* IOSerialStreamSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSerialStreamSync.h; sourceTree = ""; }; + 6DBAFE5B13B0D4590047ED33 /* IOATAPIProtocolTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATAPIProtocolTransport.h; sourceTree = ""; }; + 6DBAFE5C13B0D4590047ED33 /* IOATAStorageDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATAStorageDefines.h; sourceTree = ""; }; + 6DBAFE5D13B0D4590047ED33 /* IOAppleLabelScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAppleLabelScheme.h; sourceTree = ""; }; + 6DBAFE5E13B0D4590047ED33 /* IOApplePartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOApplePartitionScheme.h; sourceTree = ""; }; + 6DBAFE5F13B0D4590047ED33 /* IOBDBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6013B0D4590047ED33 /* IOBDBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6113B0D4590047ED33 /* IOBDMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDMedia.h; sourceTree = ""; }; + 6DBAFE6213B0D4590047ED33 /* IOBDMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE6313B0D4590047ED33 /* IOBDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDTypes.h; sourceTree = ""; }; + 6DBAFE6413B0D4590047ED33 /* IOBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6513B0D4590047ED33 /* IOBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6613B0D4590047ED33 /* IOCDBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6713B0D4590047ED33 /* IOCDBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6813B0D4590047ED33 /* IOCDMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDMedia.h; sourceTree = ""; }; + 6DBAFE6913B0D4590047ED33 /* IOCDMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE6A13B0D4590047ED33 /* IOCDPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDPartitionScheme.h; sourceTree = ""; }; + 6DBAFE6B13B0D4590047ED33 /* IOCDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDTypes.h; sourceTree = ""; }; + 6DBAFE6C13B0D4590047ED33 /* IODVDBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6D13B0D4590047ED33 /* IODVDBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6E13B0D4590047ED33 /* IODVDMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDMedia.h; sourceTree = ""; }; + 6DBAFE6F13B0D4590047ED33 /* IODVDMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE7013B0D4590047ED33 /* IODVDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDTypes.h; sourceTree = ""; }; + 6DBAFE7113B0D4590047ED33 /* IOFDiskPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFDiskPartitionScheme.h; sourceTree = ""; }; + 6DBAFE7213B0D4590047ED33 /* IOFilterScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFilterScheme.h; sourceTree = ""; }; + 6DBAFE7313B0D4590047ED33 /* IOFireWireStorageCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireStorageCharacteristics.h; sourceTree = ""; }; + 6DBAFE7413B0D4590047ED33 /* IOGUIDPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGUIDPartitionScheme.h; sourceTree = ""; }; + 6DBAFE7513B0D4590047ED33 /* IOMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMedia.h; sourceTree = ""; }; + 6DBAFE7613B0D4590047ED33 /* IOMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE7713B0D4590047ED33 /* IOPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPartitionScheme.h; sourceTree = ""; }; + 6DBAFE7813B0D4590047ED33 /* IOStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStorage.h; sourceTree = ""; }; + 6DBAFE7913B0D4590047ED33 /* IOStorageDeviceCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStorageDeviceCharacteristics.h; sourceTree = ""; }; + 6DBAFE7A13B0D4590047ED33 /* IOStorageProtocolCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStorageProtocolCharacteristics.h; sourceTree = ""; }; + 6DBAFE7C13B0D4590047ED33 /* IOStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStream.h; sourceTree = ""; }; + 6DBAFE7D13B0D4590047ED33 /* IOStreamFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStreamFamily.h; sourceTree = ""; }; + 6DBAFE7E13B0D4590047ED33 /* IOStreamShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStreamShared.h; sourceTree = ""; }; + 6DBAFE7F13B0D4590047ED33 /* IOStreamUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStreamUserClient.h; sourceTree = ""; }; + 6DBAFE8013B0D4590047ED33 /* system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = system.h; sourceTree = ""; }; + 6DBAFE8213B0D4590047ED33 /* IOWatchDogTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOWatchDogTimer.h; sourceTree = ""; }; + 6DBAFE8413B0D4590047ED33 /* IOUFIStorageServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUFIStorageServices.h; sourceTree = ""; }; + 6DBAFE8513B0D4590047ED33 /* IOUSBBus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBBus.h; sourceTree = ""; }; + 6DBAFE8613B0D4590047ED33 /* IOUSBCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBCommand.h; sourceTree = ""; }; + 6DBAFE8713B0D4590047ED33 /* IOUSBCompositeDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBCompositeDriver.h; sourceTree = ""; }; + 6DBAFE8813B0D4590047ED33 /* IOUSBController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBController.h; sourceTree = ""; }; + 6DBAFE8913B0D4590047ED33 /* IOUSBControllerListElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBControllerListElement.h; sourceTree = ""; }; + 6DBAFE8A13B0D4590047ED33 /* IOUSBControllerV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBControllerV2.h; sourceTree = ""; }; + 6DBAFE8B13B0D4590047ED33 /* IOUSBControllerV3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBControllerV3.h; sourceTree = ""; }; + 6DBAFE8C13B0D4590047ED33 /* IOUSBDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBDevice.h; sourceTree = ""; }; + 6DBAFE8D13B0D4590047ED33 /* IOUSBHIDDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBHIDDriver.h; sourceTree = ""; }; + 6DBAFE8E13B0D4590047ED33 /* IOUSBHubDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBHubDevice.h; sourceTree = ""; }; + 6DBAFE8F13B0D4590047ED33 /* IOUSBHubPolicyMaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBHubPolicyMaker.h; sourceTree = ""; }; + 6DBAFE9013B0D4590047ED33 /* IOUSBInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBInterface.h; sourceTree = ""; }; + 6DBAFE9113B0D4590047ED33 /* IOUSBLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBLog.h; sourceTree = ""; }; + 6DBAFE9213B0D4590047ED33 /* IOUSBMassStorageClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBMassStorageClass.h; sourceTree = ""; }; + 6DBAFE9313B0D4590047ED33 /* IOUSBMassStorageUFISubclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBMassStorageUFISubclass.h; sourceTree = ""; }; + 6DBAFE9413B0D4590047ED33 /* IOUSBNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBNub.h; sourceTree = ""; }; + 6DBAFE9513B0D4590047ED33 /* IOUSBPipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBPipe.h; sourceTree = ""; }; + 6DBAFE9613B0D4590047ED33 /* IOUSBRootHubDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBRootHubDevice.h; sourceTree = ""; }; + 6DBAFE9713B0D4590047ED33 /* IOUSBUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBUserClient.h; sourceTree = ""; }; + 6DBAFE9813B0D4590047ED33 /* IOUSBWorkLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBWorkLoop.h; sourceTree = ""; }; + 6DBAFE9913B0D4590047ED33 /* USB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USB.h; sourceTree = ""; }; + 6DBAFE9A13B0D4590047ED33 /* USBHub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USBHub.h; sourceTree = ""; }; + 6DBAFE9B13B0D4590047ED33 /* USBSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USBSpec.h; sourceTree = ""; }; + 6DBAFE9C13B0D4590047ED33 /* USBTracepoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USBTracepoints.h; sourceTree = ""; }; + 6DBAFE9E13B0D4590047ED33 /* _OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA013B0D4590047ED33 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; + 6DBAFEA113B0D4590047ED33 /* sha1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha1.h; sourceTree = ""; }; + 6DBAFEA313B0D4590047ED33 /* _OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA413B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA613B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA713B0D4590047ED33 /* OSAtomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAtomic.h; sourceTree = ""; }; + 6DBAFEA813B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA913B0D4590047ED33 /* OSCacheControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSCacheControl.h; sourceTree = ""; }; + 6DBAFEAA13B0D4590047ED33 /* OSDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSDebug.h; sourceTree = ""; }; + 6DBAFEAB13B0D4590047ED33 /* OSKextLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSKextLib.h; sourceTree = ""; }; + 6DBAFEAC13B0D4590047ED33 /* OSReturn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSReturn.h; sourceTree = ""; }; + 6DBAFEAD13B0D4590047ED33 /* OSTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSTypes.h; sourceTree = ""; }; + 6DBAFEAF13B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEB013B0D4590047ED33 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + 6DBAFEB113B0D4590047ED33 /* locale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = locale.h; sourceTree = ""; }; + 6DBAFEB313B0D4590047ED33 /* audit_triggers.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = audit_triggers.defs; sourceTree = ""; }; + 6DBAFEB413B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFEB513B0D4590047ED33 /* bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstrap.h; sourceTree = ""; }; + 6DBAFEB613B0D4590047ED33 /* clock.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock.defs; sourceTree = ""; }; + 6DBAFEB713B0D4590047ED33 /* clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock.h; sourceTree = ""; }; + 6DBAFEB813B0D4590047ED33 /* clock_priv.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock_priv.defs; sourceTree = ""; }; + 6DBAFEB913B0D4590047ED33 /* clock_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock_priv.h; sourceTree = ""; }; + 6DBAFEBA13B0D4590047ED33 /* clock_reply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock_reply.defs; sourceTree = ""; }; + 6DBAFEBB13B0D4590047ED33 /* clock_reply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock_reply.h; sourceTree = ""; }; + 6DBAFEBC13B0D4590047ED33 /* clock_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock_types.defs; sourceTree = ""; }; + 6DBAFEBD13B0D4590047ED33 /* clock_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock_types.h; sourceTree = ""; }; + 6DBAFEBE13B0D4590047ED33 /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = ""; }; + 6DBAFEBF13B0D4590047ED33 /* exc.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = exc.defs; sourceTree = ""; }; + 6DBAFEC013B0D4590047ED33 /* exc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exc.h; sourceTree = ""; }; + 6DBAFEC113B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFEC213B0D4590047ED33 /* exception_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception_types.h; sourceTree = ""; }; + 6DBAFEC313B0D4590047ED33 /* host_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_info.h; sourceTree = ""; }; + 6DBAFEC413B0D4590047ED33 /* host_notify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_notify.h; sourceTree = ""; }; + 6DBAFEC513B0D4590047ED33 /* host_notify_reply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = host_notify_reply.defs; sourceTree = ""; }; + 6DBAFEC613B0D4590047ED33 /* host_priv.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = host_priv.defs; sourceTree = ""; }; + 6DBAFEC713B0D4590047ED33 /* host_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_priv.h; sourceTree = ""; }; + 6DBAFEC813B0D4590047ED33 /* host_reboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_reboot.h; sourceTree = ""; }; + 6DBAFEC913B0D4590047ED33 /* host_security.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = host_security.defs; sourceTree = ""; }; + 6DBAFECA13B0D4590047ED33 /* host_security.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_security.h; sourceTree = ""; }; + 6DBAFECB13B0D4590047ED33 /* host_special_ports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_special_ports.h; sourceTree = ""; }; + 6DBAFECD13B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFECE13B0D4590047ED33 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + 6DBAFECF13B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFED013B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFED113B0D4590047ED33 /* fp_reg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp_reg.h; sourceTree = ""; }; + 6DBAFED213B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFED313B0D4590047ED33 /* machine_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = machine_types.defs; sourceTree = ""; }; + 6DBAFED413B0D4590047ED33 /* ndr_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr_def.h; sourceTree = ""; }; + 6DBAFED513B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFED613B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFED713B0D4590047ED33 /* sdt_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt_isa.h; sourceTree = ""; }; + 6DBAFED813B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFED913B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFEDA13B0D4590047ED33 /* thread_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_state.h; sourceTree = ""; }; + 6DBAFEDB13B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFEDC13B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFEDD13B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFEDE13B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFEDF13B0D4590047ED33 /* kmod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kmod.h; sourceTree = ""; }; + 6DBAFEE013B0D4590047ED33 /* ledger.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = ledger.defs; sourceTree = ""; }; + 6DBAFEE113B0D4590047ED33 /* ledger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ledger.h; sourceTree = ""; }; + 6DBAFEE213B0D4590047ED33 /* lock_set.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = lock_set.defs; sourceTree = ""; }; + 6DBAFEE313B0D4590047ED33 /* lock_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock_set.h; sourceTree = ""; }; + 6DBAFEE413B0D4590047ED33 /* mach.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach.h; sourceTree = ""; }; + 6DBAFEE513B0D4590047ED33 /* mach_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_error.h; sourceTree = ""; }; + 6DBAFEE613B0D4590047ED33 /* mach_exc.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_exc.defs; sourceTree = ""; }; + 6DBAFEE713B0D4590047ED33 /* mach_host.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_host.defs; sourceTree = ""; }; + 6DBAFEE813B0D4590047ED33 /* mach_host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_host.h; sourceTree = ""; }; + 6DBAFEE913B0D4590047ED33 /* mach_init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_init.h; sourceTree = ""; }; + 6DBAFEEA13B0D4590047ED33 /* mach_interface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_interface.h; sourceTree = ""; }; + 6DBAFEEB13B0D4590047ED33 /* mach_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_param.h; sourceTree = ""; }; + 6DBAFEEC13B0D4590047ED33 /* mach_port.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_port.defs; sourceTree = ""; }; + 6DBAFEED13B0D4590047ED33 /* mach_port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_port.h; sourceTree = ""; }; + 6DBAFEEE13B0D4590047ED33 /* mach_syscalls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_syscalls.h; sourceTree = ""; }; + 6DBAFEEF13B0D4590047ED33 /* mach_time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_time.h; sourceTree = ""; }; + 6DBAFEF013B0D4590047ED33 /* mach_traps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_traps.h; sourceTree = ""; }; + 6DBAFEF113B0D4590047ED33 /* mach_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_types.defs; sourceTree = ""; }; + 6DBAFEF213B0D4590047ED33 /* mach_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_types.h; sourceTree = ""; }; + 6DBAFEF313B0D4590047ED33 /* mach_vm.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_vm.defs; sourceTree = ""; }; + 6DBAFEF413B0D4590047ED33 /* mach_vm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_vm.h; sourceTree = ""; }; + 6DBAFEF613B0D4590047ED33 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + 6DBAFEF713B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFEF813B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFEF913B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFEFA13B0D4590047ED33 /* machine_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = machine_types.defs; sourceTree = ""; }; + 6DBAFEFB13B0D4590047ED33 /* ndr_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr_def.h; sourceTree = ""; }; + 6DBAFEFC13B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFEFD13B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFEFE13B0D4590047ED33 /* sdt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt.h; sourceTree = ""; }; + 6DBAFEFF13B0D4590047ED33 /* sdt_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt_isa.h; sourceTree = ""; }; + 6DBAFF0013B0D4590047ED33 /* thread_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_state.h; sourceTree = ""; }; + 6DBAFF0113B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFF0213B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFF0313B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFF0413B0D4590047ED33 /* machine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machine.h; sourceTree = ""; }; + 6DBAFF0513B0D4590047ED33 /* memory_object_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory_object_types.h; sourceTree = ""; }; + 6DBAFF0613B0D4590047ED33 /* message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = message.h; sourceTree = ""; }; + 6DBAFF0713B0D4590047ED33 /* mig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mig.h; sourceTree = ""; }; + 6DBAFF0813B0D4590047ED33 /* mig_errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mig_errors.h; sourceTree = ""; }; + 6DBAFF0913B0D4590047ED33 /* ndr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr.h; sourceTree = ""; }; + 6DBAFF0A13B0D4590047ED33 /* notify.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = notify.defs; sourceTree = ""; }; + 6DBAFF0B13B0D4590047ED33 /* notify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = notify.h; sourceTree = ""; }; + 6DBAFF0C13B0D4590047ED33 /* policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = policy.h; sourceTree = ""; }; + 6DBAFF0D13B0D4590047ED33 /* port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = port.h; sourceTree = ""; }; + 6DBAFF0E13B0D4590047ED33 /* port_obj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = port_obj.h; sourceTree = ""; }; + 6DBAFF1013B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFF1113B0D4590047ED33 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + 6DBAFF1213B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFF1313B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFF1413B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFF1513B0D4590047ED33 /* machine_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = machine_types.defs; sourceTree = ""; }; + 6DBAFF1613B0D4590047ED33 /* ndr_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr_def.h; sourceTree = ""; }; + 6DBAFF1713B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFF1813B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFF1913B0D4590047ED33 /* sdt_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt_isa.h; sourceTree = ""; }; + 6DBAFF1A13B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFF1B13B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFF1C13B0D4590047ED33 /* thread_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_state.h; sourceTree = ""; }; + 6DBAFF1D13B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFF1E13B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFF1F13B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFF2013B0D4590047ED33 /* processor.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = processor.defs; sourceTree = ""; }; + 6DBAFF2113B0D4590047ED33 /* processor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor.h; sourceTree = ""; }; + 6DBAFF2213B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFF2313B0D4590047ED33 /* processor_set.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = processor_set.defs; sourceTree = ""; }; + 6DBAFF2413B0D4590047ED33 /* processor_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_set.h; sourceTree = ""; }; + 6DBAFF2513B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFF2613B0D4590047ED33 /* sdt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt.h; sourceTree = ""; }; + 6DBAFF2713B0D4590047ED33 /* security.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = security.defs; sourceTree = ""; }; + 6DBAFF2813B0D4590047ED33 /* semaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = semaphore.h; sourceTree = ""; }; + 6DBAFF2913B0D4590047ED33 /* shared_memory_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_memory_server.h; sourceTree = ""; }; + 6DBAFF2A13B0D4590047ED33 /* shared_region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_region.h; sourceTree = ""; }; + 6DBAFF2B13B0D4590047ED33 /* std_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = std_types.defs; sourceTree = ""; }; + 6DBAFF2C13B0D4590047ED33 /* std_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = std_types.h; sourceTree = ""; }; + 6DBAFF2D13B0D4590047ED33 /* sync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sync.h; sourceTree = ""; }; + 6DBAFF2E13B0D4590047ED33 /* sync_policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sync_policy.h; sourceTree = ""; }; + 6DBAFF2F13B0D4590047ED33 /* task.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = task.defs; sourceTree = ""; }; + 6DBAFF3013B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFF3113B0D4590047ED33 /* task_access.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = task_access.defs; sourceTree = ""; }; + 6DBAFF3213B0D4590047ED33 /* task_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_info.h; sourceTree = ""; }; + 6DBAFF3313B0D4590047ED33 /* task_ledger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_ledger.h; sourceTree = ""; }; + 6DBAFF3413B0D4590047ED33 /* task_policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_policy.h; sourceTree = ""; }; + 6DBAFF3513B0D4590047ED33 /* task_special_ports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_special_ports.h; sourceTree = ""; }; + 6DBAFF3613B0D4590047ED33 /* thread_act.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = thread_act.defs; sourceTree = ""; }; + 6DBAFF3713B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFF3813B0D4590047ED33 /* thread_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_info.h; sourceTree = ""; }; + 6DBAFF3913B0D4590047ED33 /* thread_policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_policy.h; sourceTree = ""; }; + 6DBAFF3A13B0D4590047ED33 /* thread_special_ports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_special_ports.h; sourceTree = ""; }; + 6DBAFF3B13B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFF3C13B0D4590047ED33 /* thread_switch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_switch.h; sourceTree = ""; }; + 6DBAFF3D13B0D4590047ED33 /* time_value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time_value.h; sourceTree = ""; }; + 6DBAFF3E13B0D4590047ED33 /* vm_attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_attributes.h; sourceTree = ""; }; + 6DBAFF3F13B0D4590047ED33 /* vm_behavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_behavior.h; sourceTree = ""; }; + 6DBAFF4013B0D4590047ED33 /* vm_inherit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_inherit.h; sourceTree = ""; }; + 6DBAFF4113B0D4590047ED33 /* vm_map.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = vm_map.defs; sourceTree = ""; }; + 6DBAFF4213B0D4590047ED33 /* vm_map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_map.h; sourceTree = ""; }; + 6DBAFF4313B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFF4413B0D4590047ED33 /* vm_prot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_prot.h; sourceTree = ""; }; + 6DBAFF4513B0D4590047ED33 /* vm_purgable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_purgable.h; sourceTree = ""; }; + 6DBAFF4613B0D4590047ED33 /* vm_region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_region.h; sourceTree = ""; }; + 6DBAFF4713B0D4590047ED33 /* vm_statistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_statistics.h; sourceTree = ""; }; + 6DBAFF4813B0D4590047ED33 /* vm_sync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_sync.h; sourceTree = ""; }; + 6DBAFF4913B0D4590047ED33 /* vm_task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_task.h; sourceTree = ""; }; + 6DBAFF4A13B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFF4C13B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFF4D13B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFF4F13B0D4590047ED33 /* arch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = arch.h; sourceTree = ""; }; + 6DBAFF5013B0D4590047ED33 /* compact_unwind_encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compact_unwind_encoding.h; sourceTree = ""; }; + 6DBAFF5113B0D4590047ED33 /* dyld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dyld.h; sourceTree = ""; }; + 6DBAFF5213B0D4590047ED33 /* dyld_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dyld_images.h; sourceTree = ""; }; + 6DBAFF5313B0D4590047ED33 /* fat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fat.h; sourceTree = ""; }; + 6DBAFF5413B0D4590047ED33 /* getsect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsect.h; sourceTree = ""; }; + 6DBAFF5613B0D4590047ED33 /* swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap.h; sourceTree = ""; }; + 6DBAFF5713B0D4590047ED33 /* ldsyms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ldsyms.h; sourceTree = ""; }; + 6DBAFF5813B0D4590047ED33 /* loader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loader.h; sourceTree = ""; }; + 6DBAFF5913B0D4590047ED33 /* nlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nlist.h; sourceTree = ""; }; + 6DBAFF5B13B0D4590047ED33 /* reloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reloc.h; sourceTree = ""; }; + 6DBAFF5C13B0D4590047ED33 /* swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap.h; sourceTree = ""; }; + 6DBAFF5D13B0D4590047ED33 /* ranlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ranlib.h; sourceTree = ""; }; + 6DBAFF5E13B0D4590047ED33 /* reloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reloc.h; sourceTree = ""; }; + 6DBAFF5F13B0D4590047ED33 /* stab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stab.h; sourceTree = ""; }; + 6DBAFF6013B0D4590047ED33 /* swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap.h; sourceTree = ""; }; + 6DBAFF6213B0D4590047ED33 /* reloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reloc.h; sourceTree = ""; }; + 6DBAFF6413B0D4590047ED33 /* _limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _limits.h; sourceTree = ""; }; + 6DBAFF6513B0D4590047ED33 /* _param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _param.h; sourceTree = ""; }; + 6DBAFF6613B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFF6713B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFF6813B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFF6913B0D4590047ED33 /* endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = endian.h; sourceTree = ""; }; + 6DBAFF6A13B0D4590047ED33 /* fasttrap_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fasttrap_isa.h; sourceTree = ""; }; + 6DBAFF6B13B0D4590047ED33 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + 6DBAFF6C13B0D4590047ED33 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = ""; }; + 6DBAFF6D13B0D4590047ED33 /* profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = profile.h; sourceTree = ""; }; + 6DBAFF6E13B0D4590047ED33 /* setjmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; + 6DBAFF6F13B0D4590047ED33 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + 6DBAFF7013B0D4590047ED33 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 6DBAFF7113B0D4590047ED33 /* vmparam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vmparam.h; sourceTree = ""; }; + 6DBAFF7213B0D4590047ED33 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math.h; sourceTree = ""; }; + 6DBAFF7413B0D4590047ED33 /* bootp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootp.h; sourceTree = ""; }; + 6DBAFF7513B0D4590047ED33 /* icmp6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icmp6.h; sourceTree = ""; }; + 6DBAFF7613B0D4590047ED33 /* icmp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icmp_var.h; sourceTree = ""; }; + 6DBAFF7713B0D4590047ED33 /* if_ether.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = if_ether.h; sourceTree = ""; }; + 6DBAFF7813B0D4590047ED33 /* igmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = igmp.h; sourceTree = ""; }; + 6DBAFF7913B0D4590047ED33 /* igmp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = igmp_var.h; sourceTree = ""; }; + 6DBAFF7A13B0D4590047ED33 /* in.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in.h; sourceTree = ""; }; + 6DBAFF7B13B0D4590047ED33 /* in_pcb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in_pcb.h; sourceTree = ""; }; + 6DBAFF7C13B0D4590047ED33 /* in_systm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in_systm.h; sourceTree = ""; }; + 6DBAFF7D13B0D4590047ED33 /* in_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in_var.h; sourceTree = ""; }; + 6DBAFF7E13B0D4590047ED33 /* ip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip.h; sourceTree = ""; }; + 6DBAFF7F13B0D4590047ED33 /* ip6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip6.h; sourceTree = ""; }; + 6DBAFF8013B0D4590047ED33 /* ip_fw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_fw.h; sourceTree = ""; }; + 6DBAFF8113B0D4590047ED33 /* ip_fw2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_fw2.h; sourceTree = ""; }; + 6DBAFF8213B0D4590047ED33 /* ip_icmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_icmp.h; sourceTree = ""; }; + 6DBAFF8313B0D4590047ED33 /* ip_mroute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_mroute.h; sourceTree = ""; }; + 6DBAFF8413B0D4590047ED33 /* ip_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_var.h; sourceTree = ""; }; + 6DBAFF8513B0D4590047ED33 /* tcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp.h; sourceTree = ""; }; + 6DBAFF8613B0D4590047ED33 /* tcp_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_fsm.h; sourceTree = ""; }; + 6DBAFF8713B0D4590047ED33 /* tcp_seq.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_seq.h; sourceTree = ""; }; + 6DBAFF8813B0D4590047ED33 /* tcp_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_timer.h; sourceTree = ""; }; + 6DBAFF8913B0D4590047ED33 /* tcp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_var.h; sourceTree = ""; }; + 6DBAFF8A13B0D4590047ED33 /* tcpip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpip.h; sourceTree = ""; }; + 6DBAFF8B13B0D4590047ED33 /* udp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udp.h; sourceTree = ""; }; + 6DBAFF8C13B0D4590047ED33 /* udp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udp_var.h; sourceTree = ""; }; + 6DBAFF8E13B0D4590047ED33 /* ah.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ah.h; sourceTree = ""; }; + 6DBAFF8F13B0D4590047ED33 /* esp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = esp.h; sourceTree = ""; }; + 6DBAFF9013B0D4590047ED33 /* in6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in6.h; sourceTree = ""; }; + 6DBAFF9113B0D4590047ED33 /* in6_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in6_var.h; sourceTree = ""; }; + 6DBAFF9213B0D4590047ED33 /* ip6_fw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip6_fw.h; sourceTree = ""; }; + 6DBAFF9313B0D4590047ED33 /* ip6_mroute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip6_mroute.h; sourceTree = ""; }; + 6DBAFF9413B0D4590047ED33 /* ipcomp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipcomp.h; sourceTree = ""; }; + 6DBAFF9513B0D4590047ED33 /* ipsec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipsec.h; sourceTree = ""; }; + 6DBAFF9613B0D4590047ED33 /* nd6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nd6.h; sourceTree = ""; }; + 6DBAFF9713B0D4590047ED33 /* pim6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pim6.h; sourceTree = ""; }; + 6DBAFF9813B0D4590047ED33 /* raw_ip6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raw_ip6.h; sourceTree = ""; }; + 6DBAFF9913B0D4590047ED33 /* runetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runetype.h; sourceTree = ""; }; + 6DBAFF9B13B0D4590047ED33 /* _common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _common.h; sourceTree = ""; }; + 6DBAFF9C13B0D4590047ED33 /* _stdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _stdio.h; sourceTree = ""; }; + 6DBAFF9D13B0D4590047ED33 /* setjmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; + 6DBAFF9E13B0D4590047ED33 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + 6DBAFF9F13B0D4590047ED33 /* stdarg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdarg.h; sourceTree = ""; }; + 6DBAFFA013B0D4590047ED33 /* stdbool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdbool.h; sourceTree = ""; }; + 6DBAFFA113B0D4590047ED33 /* stddef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stddef.h; sourceTree = ""; }; + 6DBAFFA213B0D4590047ED33 /* stdint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdint.h; sourceTree = ""; }; + 6DBAFFA313B0D4590047ED33 /* stdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdio.h; sourceTree = ""; }; + 6DBAFFA413B0D4590047ED33 /* stdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdlib.h; sourceTree = ""; }; + 6DBAFFA513B0D4590047ED33 /* string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; + 6DBAFFA713B0D4590047ED33 /* _endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _endian.h; sourceTree = ""; }; + 6DBAFFA813B0D4590047ED33 /* _select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _select.h; sourceTree = ""; }; + 6DBAFFA913B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFFAA13B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFFAB13B0D4590047ED33 /* appleapiopts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleapiopts.h; sourceTree = ""; }; + 6DBAFFAC13B0D4590047ED33 /* buf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buf.h; sourceTree = ""; }; + 6DBAFFAD13B0D4590047ED33 /* cdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cdefs.h; sourceTree = ""; }; + 6DBAFFAE13B0D4590047ED33 /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; + 6DBAFFAF13B0D4590047ED33 /* kernel_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_types.h; sourceTree = ""; }; + 6DBAFFB013B0D4590047ED33 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = ""; }; + 6DBAFFB113B0D4590047ED33 /* reboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reboot.h; sourceTree = ""; }; + 6DBAFFB213B0D4590047ED33 /* select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = select.h; sourceTree = ""; }; + 6DBAFFB313B0D4590047ED33 /* socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socket.h; sourceTree = ""; }; + 6DBAFFB413B0D4590047ED33 /* syscall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syscall.h; sourceTree = ""; }; + 6DBAFFB513B0D4590047ED33 /* syslimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syslimits.h; sourceTree = ""; }; + 6DBAFFB613B0D4590047ED33 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + 6DBAFFB713B0D4590047ED33 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 6DBAFFB813B0D4590047ED33 /* unistd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unistd.h; sourceTree = ""; }; + 6DBAFFB913B0D4590047ED33 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + 6DBAFFBC13B0D4590047ED33 /* ffs_extern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffs_extern.h; sourceTree = ""; }; + 6DBAFFBD13B0D4590047ED33 /* fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fs.h; sourceTree = ""; }; + 6DBAFFBF13B0D4590047ED33 /* dinode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dinode.h; sourceTree = ""; }; + 6DBAFFC013B0D4590047ED33 /* dir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dir.h; sourceTree = ""; }; + 6DBAFFC113B0D4590047ED33 /* inode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inode.h; sourceTree = ""; }; + 6DBAFFC213B0D4590047ED33 /* ufs_extern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs_extern.h; sourceTree = ""; }; + 6DBAFFC313B0D4590047ED33 /* ufsmount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufsmount.h; sourceTree = ""; }; + 6DBAFFC413B0D4590047ED33 /* unistd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unistd.h; sourceTree = ""; }; + 6DBAFFC513B0D4590047ED33 /* unwind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unwind.h; sourceTree = ""; }; + A31301A71503CB9900E8C718 /* README.translators */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.translators; sourceTree = ""; }; + A354B6271495124F00D81AA5 /* ESPpostinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ESPpostinstall; sourceTree = ""; }; + A354B62A1495124F00D81AA5 /* Standardpostinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Standardpostinstall; sourceTree = ""; }; + A354B62C149514DE00D81AA5 /* CheckDiskMicrocode.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckDiskMicrocode.sh; sourceTree = ""; }; + A354B62D149514DE00D81AA5 /* CheckFatType.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckFatType.sh; sourceTree = ""; }; + A354B62E149514DE00D81AA5 /* CheckGRUBLinuxLoader.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckGRUBLinuxLoader.sh; sourceTree = ""; }; + A354B62F149514DE00D81AA5 /* CheckPartitionScheme.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckPartitionScheme.sh; sourceTree = ""; }; + A354B630149514DE00D81AA5 /* CheckPreviousChameleon.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckPreviousChameleon.sh; sourceTree = ""; }; + A354B631149514DE00D81AA5 /* CheckProceed.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckProceed.sh; sourceTree = ""; }; + A354B632149514DE00D81AA5 /* CheckWindowsDiskSignature.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckWindowsDiskSignature.sh; sourceTree = ""; }; + A354B634149514DE00D81AA5 /* MountESP.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = MountESP.sh; sourceTree = ""; }; + A354B635149514DE00D81AA5 /* patch */ = {isa = PBXFileReference; lastKnownFileType = file; path = patch; sourceTree = ""; }; + A354B636149514DE00D81AA5 /* SetActivePartition.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = SetActivePartition.sh; sourceTree = ""; }; + A354B637149514DE00D81AA5 /* UnMountEFIvolumes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = UnMountEFIvolumes.sh; sourceTree = ""; }; + A354B638149514DE00D81AA5 /* WriteChameleonStage0.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = WriteChameleonStage0.sh; sourceTree = ""; }; + A354B639149514DE00D81AA5 /* WriteChameleonStage1.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = WriteChameleonStage1.sh; sourceTree = ""; }; + A354B63A149514DE00D81AA5 /* WriteChameleonStage2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = WriteChameleonStage2.sh; sourceTree = ""; }; + A3561C731413FD7800E9B51E /* auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = auto.c; sourceTree = ""; }; + A3561C741413FD7800E9B51E /* auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auto.h; sourceTree = ""; }; + A3561C751413FD7800E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561C761413FD7800E9B51E /* cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cmd.c; sourceTree = ""; }; + A3561C771413FD7800E9B51E /* cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cmd.h; sourceTree = ""; }; + A3561C781413FD7800E9B51E /* disk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = disk.c; sourceTree = ""; }; + A3561C791413FD7800E9B51E /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; + A3561C7A1413FD7800E9B51E /* fdisk.8 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fdisk.8; sourceTree = ""; }; + A3561C7B1413FD7800E9B51E /* fdisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fdisk.c; sourceTree = ""; }; + A3561C7C1413FD7800E9B51E /* getrawpartition.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getrawpartition.c; sourceTree = ""; }; + A3561C7D1413FD7800E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561C7E1413FD7800E9B51E /* mbr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mbr.c; sourceTree = ""; }; + A3561C7F1413FD7800E9B51E /* mbr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mbr.h; sourceTree = ""; }; + A3561C801413FD7800E9B51E /* mbrcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mbrcode.h; sourceTree = ""; }; + A3561C811413FD7800E9B51E /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + A3561C821413FD7800E9B51E /* misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = misc.h; sourceTree = ""; }; + A3561C831413FD7800E9B51E /* opendev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opendev.c; sourceTree = ""; }; + A3561C841413FD7800E9B51E /* part.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = part.c; sourceTree = ""; }; + A3561C851413FD7800E9B51E /* part.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = part.h; sourceTree = ""; }; + A3561C861413FD7800E9B51E /* user.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = user.c; sourceTree = ""; }; + A3561C871413FD7800E9B51E /* user.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = user.h; sourceTree = ""; }; + A3561C881413FD7800E9B51E /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; + A3561C891413FD7800E9B51E /* openUp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = openUp.c; sourceTree = ""; }; + A3561C8A1413FD7800E9B51E /* dyldsymboltool.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dyldsymboltool.c; sourceTree = ""; }; + A3561C8B1413FD7800E9B51E /* bdmesg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bdmesg.c; sourceTree = ""; }; + A3561CAC1414024C00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561CAE1414024C00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561CAF1414024C00E9B51E /* HelloWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HelloWorld.cpp; sourceTree = ""; }; + A3561CB11414024C00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561CB31414024C00E9B51E /* modules */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = modules; sourceTree = ""; }; + A3561CB81414024D00E9B51E /* __ashldi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __ashldi3.c; sourceTree = ""; }; + A3561CB91414024D00E9B51E /* __ashrdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __ashrdi3.c; sourceTree = ""; }; + A3561CBA1414024D00E9B51E /* __clzsi2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __clzsi2.c; sourceTree = ""; }; + A3561CBB1414024D00E9B51E /* __divdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __divdi3.c; sourceTree = ""; }; + A3561CBC1414024D00E9B51E /* __divsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __divsi3.c; sourceTree = ""; }; + A3561CBD1414024D00E9B51E /* __lshrdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __lshrdi3.c; sourceTree = ""; }; + A3561CBE1414024D00E9B51E /* __moddi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __moddi3.c; sourceTree = ""; }; + A3561CBF1414024D00E9B51E /* __modsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __modsi3.c; sourceTree = ""; }; + A3561CC01414024D00E9B51E /* __udivdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivdi3.c; sourceTree = ""; }; + A3561CC11414024D00E9B51E /* __udivmoddi4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivmoddi4.c; sourceTree = ""; }; + A3561CC21414024D00E9B51E /* __udivmodsi4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivmodsi4.c; sourceTree = ""; }; + A3561CC31414024D00E9B51E /* __udivsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivsi3.c; sourceTree = ""; }; + A3561CC41414024D00E9B51E /* __umoddi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __umoddi3.c; sourceTree = ""; }; + A3561CC51414024D00E9B51E /* __umodsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __umodsi3.c; sourceTree = ""; }; + A3561CC61414024D00E9B51E /* atexit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atexit.c; sourceTree = ""; }; + A3561CC71414024D00E9B51E /* atexit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atexit.h; sourceTree = ""; }; + A3561CC81414024D00E9B51E /* atoi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atoi.c; sourceTree = ""; }; + A3561CC91414024D00E9B51E /* atol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atol.c; sourceTree = ""; }; + A3561CCA1414024D00E9B51E /* atoll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atoll.c; sourceTree = ""; }; + A3561CCB1414024D00E9B51E /* atox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atox.c; sourceTree = ""; }; + A3561CCC1414024D00E9B51E /* bsearch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bsearch.c; sourceTree = ""; }; + A3561CCD1414024D00E9B51E /* calloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = calloc.c; sourceTree = ""; }; + A3561CCE1414024D00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561CCF1414024D00E9B51E /* exit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = exit.c; sourceTree = ""; }; + A3561CD01414024D00E9B51E /* jrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jrand48.c; sourceTree = ""; }; + A3561CD11414024D00E9B51E /* klibc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = klibc.c; sourceTree = ""; }; + A3561CD21414024D00E9B51E /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + A3561CD31414024D00E9B51E /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + A3561CD41414024D00E9B51E /* lrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lrand48.c; sourceTree = ""; }; + A3561CD51414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561CD61414024D00E9B51E /* memccpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memccpy.c; sourceTree = ""; }; + A3561CD71414024D00E9B51E /* memchr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memchr.c; sourceTree = ""; }; + A3561CD81414024D00E9B51E /* memmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memmem.c; sourceTree = ""; }; + A3561CD91414024D00E9B51E /* memmove.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memmove.c; sourceTree = ""; }; + A3561CDA1414024D00E9B51E /* memrchr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memrchr.c; sourceTree = ""; }; + A3561CDB1414024D00E9B51E /* memswap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memswap.c; sourceTree = ""; }; + A3561CDC1414024D00E9B51E /* mrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mrand48.c; sourceTree = ""; }; + A3561CDD1414024D00E9B51E /* nrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nrand48.c; sourceTree = ""; }; + A3561CDE1414024D00E9B51E /* onexit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = onexit.c; sourceTree = ""; }; + A3561CDF1414024D00E9B51E /* qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qsort.c; sourceTree = ""; }; + A3561CE01414024D00E9B51E /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + A3561CE11414024D00E9B51E /* seed48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = seed48.c; sourceTree = ""; }; + A3561CE21414024D00E9B51E /* sha1hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1hash.c; sourceTree = ""; }; + A3561CE31414024D00E9B51E /* snprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snprintf.c; sourceTree = ""; }; + A3561CE41414024D00E9B51E /* srand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = srand48.c; sourceTree = ""; }; + A3561CE51414024D00E9B51E /* sscanf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sscanf.c; sourceTree = ""; }; + A3561CE61414024D00E9B51E /* strcasecmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strcasecmp.c; sourceTree = ""; }; + A3561CE71414024D00E9B51E /* strdup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strdup.c; sourceTree = ""; }; + A3561CE81414024D00E9B51E /* strlcat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strlcat.c; sourceTree = ""; }; + A3561CE91414024D00E9B51E /* strncasecmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strncasecmp.c; sourceTree = ""; }; + A3561CEA1414024D00E9B51E /* strndup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strndup.c; sourceTree = ""; }; + A3561CEB1414024D00E9B51E /* strnlen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strnlen.c; sourceTree = ""; }; + A3561CEC1414024D00E9B51E /* strntoimax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strntoimax.c; sourceTree = ""; }; + A3561CED1414024D00E9B51E /* strntoumax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strntoumax.c; sourceTree = ""; }; + A3561CEE1414024D00E9B51E /* strpbrk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strpbrk.c; sourceTree = ""; }; + A3561CEF1414024D00E9B51E /* strsep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strsep.c; sourceTree = ""; }; + A3561CF01414024D00E9B51E /* strtoimax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoimax.c; sourceTree = ""; }; + A3561CF11414024D00E9B51E /* strtok.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtok.c; sourceTree = ""; }; + A3561CF21414024D00E9B51E /* strtok_r.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtok_r.c; sourceTree = ""; }; + A3561CF31414024D00E9B51E /* strtol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtol.c; sourceTree = ""; }; + A3561CF41414024D00E9B51E /* strtoll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoll.c; sourceTree = ""; }; + A3561CF51414024D00E9B51E /* strtotimespec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtotimespec.c; sourceTree = ""; }; + A3561CF61414024D00E9B51E /* strtotimeval.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtotimeval.c; sourceTree = ""; }; + A3561CF71414024D00E9B51E /* strtotimex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtotimex.c; sourceTree = ""; }; + A3561CF81414024D00E9B51E /* strtoul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoul.c; sourceTree = ""; }; + A3561CF91414024D00E9B51E /* strtoull.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoull.c; sourceTree = ""; }; + A3561CFA1414024D00E9B51E /* strtoumax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoumax.c; sourceTree = ""; }; + A3561CFB1414024D00E9B51E /* strtox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtox.c; sourceTree = ""; }; + A3561CFC1414024D00E9B51E /* strxspn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strxspn.c; sourceTree = ""; }; + A3561CFD1414024D00E9B51E /* strxspn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strxspn.h; sourceTree = ""; }; + A3561CFE1414024D00E9B51E /* version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = version; sourceTree = ""; }; + A3561CFF1414024D00E9B51E /* vsnprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vsnprintf.c; sourceTree = ""; }; + A3561D001414024D00E9B51E /* vsscanf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vsscanf.c; sourceTree = ""; }; + A3561D011414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D021414024D00E9B51E /* MakeInc.dir */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MakeInc.dir; sourceTree = ""; }; + A3561D031414024D00E9B51E /* Modules.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Modules.txt; sourceTree = ""; }; + A3561D051414024D00E9B51E /* 915resolution.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = 915resolution.c; sourceTree = ""; }; + A3561D061414024D00E9B51E /* 915resolution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 915resolution.h; sourceTree = ""; }; + A3561D071414024D00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561D081414024D00E9B51E /* edid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = edid.c; sourceTree = ""; }; + A3561D0A1414024D00E9B51E /* edid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = edid.h; sourceTree = ""; }; + A3561D0B1414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D0C1414024D00E9B51E /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + A3561D0D1414024D00E9B51E /* Resolution.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Resolution.c; sourceTree = ""; }; + A3561D0E1414024D00E9B51E /* shortatombios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shortatombios.h; sourceTree = ""; }; + A3561D101414024D00E9B51E /* abi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = abi.cpp; sourceTree = ""; }; + A3561D111414024D00E9B51E /* algorithm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = algorithm.cpp; sourceTree = ""; }; + A3561D121414024D00E9B51E /* associative_base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = associative_base.cpp; sourceTree = ""; }; + A3561D131414024D00E9B51E /* bitset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bitset.cpp; sourceTree = ""; }; + A3561D141414024D00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561D151414024D00E9B51E /* char_traits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = char_traits.cpp; sourceTree = ""; }; + A3561D161414024D00E9B51E /* complex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = complex.cpp; sourceTree = ""; }; + A3561D171414024D00E9B51E /* del_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_op.cpp; sourceTree = ""; }; + A3561D181414024D00E9B51E /* del_opnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_opnt.cpp; sourceTree = ""; }; + A3561D191414024D00E9B51E /* del_opv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_opv.cpp; sourceTree = ""; }; + A3561D1A1414024D00E9B51E /* del_opvnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_opvnt.cpp; sourceTree = ""; }; + A3561D1B1414024D00E9B51E /* deque.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deque.cpp; sourceTree = ""; }; + A3561D1C1414024D00E9B51E /* eh_alloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eh_alloc.cpp; sourceTree = ""; }; + A3561D1D1414024D00E9B51E /* eh_globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eh_globals.cpp; sourceTree = ""; }; + A3561D1E1414024D00E9B51E /* exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exception.cpp; sourceTree = ""; }; + A3561D1F1414024D00E9B51E /* fstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fstream.cpp; sourceTree = ""; }; + A3561D201414024D00E9B51E /* func_exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = func_exception.cpp; sourceTree = ""; }; + A3561D221414024D00E9B51E /* algorithm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = algorithm; sourceTree = ""; }; + A3561D231414024D00E9B51E /* associative_base */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = associative_base; sourceTree = ""; }; + A3561D241414024D00E9B51E /* basic_definitions */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = basic_definitions; sourceTree = ""; }; + A3561D251414024D00E9B51E /* bitset */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bitset; sourceTree = ""; }; + A3561D261414024D00E9B51E /* cassert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cassert; sourceTree = ""; }; + A3561D271414024D00E9B51E /* cctype */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cctype; sourceTree = ""; }; + A3561D281414024D00E9B51E /* cerrno */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cerrno; sourceTree = ""; }; + A3561D291414024D00E9B51E /* cfloat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cfloat; sourceTree = ""; }; + A3561D2A1414024D00E9B51E /* char_traits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = char_traits; sourceTree = ""; }; + A3561D2B1414024D00E9B51E /* climits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = climits; sourceTree = ""; }; + A3561D2C1414024D00E9B51E /* clocale */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = clocale; sourceTree = ""; }; + A3561D2D1414024D00E9B51E /* cmath */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cmath; sourceTree = ""; }; + A3561D2E1414024D00E9B51E /* complex */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = complex; sourceTree = ""; }; + A3561D2F1414024D00E9B51E /* csetjmp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = csetjmp; sourceTree = ""; }; + A3561D301414024D00E9B51E /* csignal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = csignal; sourceTree = ""; }; + A3561D311414024D00E9B51E /* cstdarg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstdarg; sourceTree = ""; }; + A3561D321414024D00E9B51E /* cstddef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstddef; sourceTree = ""; }; + A3561D331414024D00E9B51E /* cstdio */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstdio; sourceTree = ""; }; + A3561D341414024D00E9B51E /* cstdlib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstdlib; sourceTree = ""; }; + A3561D351414024D00E9B51E /* cstring */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstring; sourceTree = ""; }; + A3561D361414024D00E9B51E /* ctime */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ctime; sourceTree = ""; }; + A3561D371414024D00E9B51E /* cwchar */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cwchar; sourceTree = ""; }; + A3561D381414024D00E9B51E /* cwctype */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cwctype; sourceTree = ""; }; + A3561D391414024D00E9B51E /* deque */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = deque; sourceTree = ""; }; + A3561D3A1414024D00E9B51E /* exception */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = exception; sourceTree = ""; }; + A3561D3B1414024D00E9B51E /* fstream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fstream; sourceTree = ""; }; + A3561D3C1414024D00E9B51E /* func_exception */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = func_exception; sourceTree = ""; }; + A3561D3D1414024D00E9B51E /* functional */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = functional; sourceTree = ""; }; + A3561D3E1414024D00E9B51E /* iomanip */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iomanip; sourceTree = ""; }; + A3561D3F1414024D00E9B51E /* ios */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ios; sourceTree = ""; }; + A3561D401414024D00E9B51E /* iosfwd */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iosfwd; sourceTree = ""; }; + A3561D411414024D00E9B51E /* iostream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iostream; sourceTree = ""; }; + A3561D421414024D00E9B51E /* istream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = istream; sourceTree = ""; }; + A3561D431414024D00E9B51E /* istream_helpers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = istream_helpers; sourceTree = ""; }; + A3561D441414024D00E9B51E /* iterator */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iterator; sourceTree = ""; }; + A3561D451414024D00E9B51E /* iterator_base */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iterator_base; sourceTree = ""; }; + A3561D461414024D00E9B51E /* limits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = limits; sourceTree = ""; }; + A3561D471414024D00E9B51E /* list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = list; sourceTree = ""; }; + A3561D481414024D00E9B51E /* locale */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = locale; sourceTree = ""; }; + A3561D491414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D4A1414024D00E9B51E /* map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = map; sourceTree = ""; }; + A3561D4B1414024D00E9B51E /* map.old */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = map.old; sourceTree = ""; }; + A3561D4C1414024D00E9B51E /* memory */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = memory; sourceTree = ""; }; + A3561D4D1414024D00E9B51E /* new */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = new; sourceTree = ""; }; + A3561D4E1414024D00E9B51E /* numeric */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = numeric; sourceTree = ""; }; + A3561D4F1414024D00E9B51E /* ostream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ostream; sourceTree = ""; }; + A3561D501414024D00E9B51E /* ostream_helpers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ostream_helpers; sourceTree = ""; }; + A3561D511414024D00E9B51E /* queue */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = queue; sourceTree = ""; }; + A3561D521414024D00E9B51E /* set */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set; sourceTree = ""; }; + A3561D531414024D00E9B51E /* set.old */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set.old; sourceTree = ""; }; + A3561D541414024D00E9B51E /* sstream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sstream; sourceTree = ""; }; + A3561D551414024D00E9B51E /* stack */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stack; sourceTree = ""; }; + A3561D561414024D00E9B51E /* stdexcept */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stdexcept; sourceTree = ""; }; + A3561D571414024D00E9B51E /* streambuf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = streambuf; sourceTree = ""; }; + A3561D581414024D00E9B51E /* string */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string; sourceTree = ""; }; + A3561D591414024D00E9B51E /* string_iostream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string_iostream; sourceTree = ""; }; + A3561D5A1414024D00E9B51E /* support */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = support; sourceTree = ""; }; + A3561D5B1414024D00E9B51E /* system_configuration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = system_configuration.h; sourceTree = ""; }; + A3561D5C1414024D00E9B51E /* type_traits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = type_traits; sourceTree = ""; }; + A3561D5D1414024D00E9B51E /* typeinfo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = typeinfo; sourceTree = ""; }; + A3561D5E1414024D00E9B51E /* types */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = types; sourceTree = ""; }; + A3561D5F1414024D00E9B51E /* unwind-cxx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "unwind-cxx.h"; sourceTree = ""; }; + A3561D601414024D00E9B51E /* utility */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = utility; sourceTree = ""; }; + A3561D611414024D00E9B51E /* valarray */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = valarray; sourceTree = ""; }; + A3561D621414024D00E9B51E /* vector */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vector; sourceTree = ""; }; + A3561D631414024D00E9B51E /* iomanip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iomanip.cpp; sourceTree = ""; }; + A3561D641414024D00E9B51E /* ios.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ios.cpp; sourceTree = ""; }; + A3561D651414024D00E9B51E /* iostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iostream.cpp; sourceTree = ""; }; + A3561D661414024D00E9B51E /* istream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = istream.cpp; sourceTree = ""; }; + A3561D671414024D00E9B51E /* iterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iterator.cpp; sourceTree = ""; }; + A3561D681414024D00E9B51E /* limits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = limits.cpp; sourceTree = ""; }; + A3561D691414024D00E9B51E /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = list.cpp; sourceTree = ""; }; + A3561D6A1414024D00E9B51E /* locale.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = locale.cpp; sourceTree = ""; }; + A3561D6B1414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D6C1414024D00E9B51E /* map.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = map.cpp; sourceTree = ""; }; + A3561D6D1414024D00E9B51E /* new_handler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_handler.cpp; sourceTree = ""; }; + A3561D6E1414024D00E9B51E /* new_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_op.cpp; sourceTree = ""; }; + A3561D6F1414024D00E9B51E /* new_opnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_opnt.cpp; sourceTree = ""; }; + A3561D701414024D00E9B51E /* new_opv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_opv.cpp; sourceTree = ""; }; + A3561D711414024D00E9B51E /* new_opvnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_opvnt.cpp; sourceTree = ""; }; + A3561D721414024D00E9B51E /* numeric.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = numeric.cpp; sourceTree = ""; }; + A3561D731414024D00E9B51E /* ostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ostream.cpp; sourceTree = ""; }; + A3561D741414024D00E9B51E /* queue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = queue.cpp; sourceTree = ""; }; + A3561D751414024D00E9B51E /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + A3561D761414024D00E9B51E /* set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = set.cpp; sourceTree = ""; }; + A3561D771414024D00E9B51E /* sstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sstream.cpp; sourceTree = ""; }; + A3561D781414024D00E9B51E /* stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stack.cpp; sourceTree = ""; }; + A3561D791414024D00E9B51E /* stdexcept.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdexcept.cpp; sourceTree = ""; }; + A3561D7A1414024D00E9B51E /* streambuf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = streambuf.cpp; sourceTree = ""; }; + A3561D7B1414024D00E9B51E /* string.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string.cpp; sourceTree = ""; }; + A3561D7C1414024D00E9B51E /* support.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = support.cpp; sourceTree = ""; }; + A3561D7D1414024D00E9B51E /* typeinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = typeinfo.cpp; sourceTree = ""; }; + A3561D7E1414024D00E9B51E /* uClibc++.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "uClibc++.c"; sourceTree = ""; }; + A3561D7F1414024D00E9B51E /* utility.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = utility.cpp; sourceTree = ""; }; + A3561D801414024D00E9B51E /* valarray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = valarray.cpp; sourceTree = ""; }; + A3561D811414024D00E9B51E /* vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vector.cpp; sourceTree = ""; }; + A3561DA61414296600E9B51E /* Keylayout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Keylayout.c; sourceTree = ""; }; + A3561DA71414296600E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561DA81414296600E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A35D216F141A73B000969AC0 /* cham-mklayout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "cham-mklayout.c"; sourceTree = ""; }; + A35D2171141A73B000969AC0 /* mac-de.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-de.slt"; sourceTree = ""; }; + A35D2172141A73B000969AC0 /* mac-es.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-es.slt"; sourceTree = ""; }; + A35D2173141A73B000969AC0 /* mac-fr.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-fr.slt"; sourceTree = ""; }; + A35D2174141A73B000969AC0 /* mac-it.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-it.slt"; sourceTree = ""; }; + A35D2175141A73B000969AC0 /* mac-se.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-se.slt"; sourceTree = ""; }; + A35D2176141A73B000969AC0 /* pc-fr.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pc-fr.slt"; sourceTree = ""; }; + A35D2177141A73B000969AC0 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A35D2178141A753E00969AC0 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + A35D2187141A75DC00969AC0 /* slimpkg.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = slimpkg.sh; sourceTree = ""; }; + A35D2188141A75DC00969AC0 /* buildpkg.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = buildpkg.sh; sourceTree = ""; }; + A360AA7D14136C1A00084D3F /* Make.rules */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Make.rules; sourceTree = ""; }; + A396E2CC150247630025A245 /* License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = License.rtf; sourceTree = ""; }; + A396E2CE150247630025A245 /* background.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = background.tiff; sourceTree = ""; }; + A396E2D1150247630025A245 /* Description.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Description.html; sourceTree = ""; }; + A396E2D2150247630025A245 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; + A396E35915028C9C0025A245 /* Welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Welcome.html; sourceTree = ""; }; + A396E4F51502D0580025A245 /* ar */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ar; path = ar.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E4F71502D0580025A245 /* ar */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ar; path = ar.lproj/Description.html; sourceTree = ""; }; + A396E4F91502D0580025A245 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ar; path = ar.lproj/License.rtf; sourceTree = ""; }; + A396E4FB1502D0580025A245 /* ar */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; + A396E4FD1502D0580025A245 /* ar */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ar; path = ar.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E4FE1502D0580025A245 /* background.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = background.tiff; sourceTree = ""; }; + A396E4FF1502D0580025A245 /* bg */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bg; path = bg.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5001502D0580025A245 /* bg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = bg; path = bg.lproj/Description.html; sourceTree = ""; }; + A396E5011502D0580025A245 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = bg; path = bg.lproj/License.rtf; sourceTree = ""; }; + A396E5021502D0580025A245 /* bg */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = bg; path = bg.lproj/Localizable.strings; sourceTree = ""; }; + A396E5031502D0580025A245 /* bg */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bg; path = bg.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5041502D0580025A245 /* bs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bs; path = bs.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5051502D0580025A245 /* bs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = bs; path = bs.lproj/Description.html; sourceTree = ""; }; + A396E5061502D0580025A245 /* bs */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = bs; path = bs.lproj/License.rtf; sourceTree = ""; }; + A396E5071502D0580025A245 /* bs */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = bs; path = bs.lproj/Localizable.strings; sourceTree = ""; }; + A396E5081502D0580025A245 /* bs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bs; path = bs.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5091502D0580025A245 /* ca */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ca; path = ca.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E50A1502D0580025A245 /* ca */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ca; path = ca.lproj/Description.html; sourceTree = ""; }; + A396E50B1502D0580025A245 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ca; path = ca.lproj/License.rtf; sourceTree = ""; }; + A396E50C1502D0580025A245 /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + A396E50D1502D0580025A245 /* ca */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ca; path = ca.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E50E1502D0580025A245 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = de; path = de.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E50F1502D0580025A245 /* de */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = de; path = de.lproj/Description.html; sourceTree = ""; }; + A396E5101502D0580025A245 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = de; path = de.lproj/License.rtf; sourceTree = ""; }; + A396E5111502D0580025A245 /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; + A396E5121502D0580025A245 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = de; path = de.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5131502D0580025A245 /* el */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = el; path = el.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5141502D0580025A245 /* el */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = el; path = el.lproj/Description.html; sourceTree = ""; }; + A396E5151502D0580025A245 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = el; path = el.lproj/License.rtf; sourceTree = ""; }; + A396E5161502D0580025A245 /* el */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Localizable.strings; sourceTree = ""; }; + A396E5171502D0580025A245 /* el */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = el; path = el.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5181502D0580025A245 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = en; path = en.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5191502D0580025A245 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = en; path = en.lproj/Description.html; sourceTree = ""; }; + A396E51A1502D0580025A245 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/License.rtf; sourceTree = ""; }; + A396E51B1502D0580025A245 /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + A396E51C1502D0580025A245 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = en; path = en.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E51D1502D0580025A245 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = es; path = es.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E51E1502D0580025A245 /* es */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = es; path = es.lproj/Description.html; sourceTree = ""; }; + A396E51F1502D0580025A245 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = es; path = es.lproj/License.rtf; sourceTree = ""; }; + A396E5201502D0580025A245 /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; + A396E5211502D0580025A245 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = es; path = es.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5221502D0580025A245 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = fr; path = fr.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5231502D0580025A245 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = fr; path = fr.lproj/Description.html; sourceTree = ""; }; + A396E5241502D0580025A245 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = fr; path = fr.lproj/License.rtf; sourceTree = ""; }; + A396E5251502D0580025A245 /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; + A396E5261502D0580025A245 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = fr; path = fr.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5271502D0580025A245 /* he */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = he; path = he.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5281502D0580025A245 /* he */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = he; path = he.lproj/Description.html; sourceTree = ""; }; + A396E5291502D0580025A245 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = he; path = he.lproj/License.rtf; sourceTree = ""; }; + A396E52A1502D0580025A245 /* he */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; + A396E52B1502D0580025A245 /* he */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = he; path = he.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E52C1502D0580025A245 /* hr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = hr; path = hr.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E52D1502D0580025A245 /* hr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = hr; path = hr.lproj/Description.html; sourceTree = ""; }; + A396E52E1502D0580025A245 /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = hr; path = hr.lproj/License.rtf; sourceTree = ""; }; + A396E52F1502D0580025A245 /* hr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/Localizable.strings; sourceTree = ""; }; + A396E5301502D0580025A245 /* hr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = hr; path = hr.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5311502D0580025A245 /* id */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = id; path = id.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5321502D0580025A245 /* id */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = id; path = id.lproj/Description.html; sourceTree = ""; }; + A396E5331502D0580025A245 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = id; path = id.lproj/License.rtf; sourceTree = ""; }; + A396E5341502D0580025A245 /* id */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; + A396E5351502D0580025A245 /* id */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = id; path = id.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5361502D0580025A245 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = it; path = it.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5371502D0580025A245 /* it */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = it; path = it.lproj/Description.html; sourceTree = ""; }; + A396E5381502D0580025A245 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = it; path = it.lproj/License.rtf; sourceTree = ""; }; + A396E5391502D0580025A245 /* it */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; + A396E53A1502D0580025A245 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = it; path = it.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E53B1502D0580025A245 /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ja; path = ja.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E53C1502D0580025A245 /* ja */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ja; path = ja.lproj/Description.html; sourceTree = ""; }; + A396E53D1502D0580025A245 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ja; path = ja.lproj/License.rtf; sourceTree = ""; }; + A396E53E1502D0580025A245 /* ja */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + A396E53F1502D0580025A245 /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ja; path = ja.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5401502D0580025A245 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ko; path = ko.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5411502D0580025A245 /* ko */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ko; path = ko.lproj/Description.html; sourceTree = ""; }; + A396E5421502D0580025A245 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ko; path = ko.lproj/License.rtf; sourceTree = ""; }; + A396E5431502D0580025A245 /* ko */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; + A396E5441502D0580025A245 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ko; path = ko.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5451502D0580025A245 /* mk */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = mk; path = mk.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5461502D0580025A245 /* mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = mk; path = mk.lproj/Description.html; sourceTree = ""; }; + A396E5471502D0580025A245 /* mk */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = mk; path = mk.lproj/License.rtf; sourceTree = ""; }; + A396E5481502D0580025A245 /* mk */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = mk; path = mk.lproj/Localizable.strings; sourceTree = ""; }; + A396E5491502D0580025A245 /* mk */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = mk; path = mk.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E54A1502D0580025A245 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = nl; path = nl.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E54B1502D0580025A245 /* nl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = nl; path = nl.lproj/Description.html; sourceTree = ""; }; + A396E54C1502D0580025A245 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = nl; path = nl.lproj/License.rtf; sourceTree = ""; }; + A396E54D1502D0580025A245 /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + A396E54E1502D0580025A245 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = nl; path = nl.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E54F1502D0580025A245 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = pl; path = pl.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5501502D0580025A245 /* pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = pl; path = pl.lproj/Description.html; sourceTree = ""; }; + A396E5511502D0580025A245 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = pl; path = pl.lproj/License.rtf; sourceTree = ""; }; + A396E5521502D0580025A245 /* pl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + A396E5531502D0580025A245 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = pl; path = pl.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5541502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-BR"; path = "pt-BR.lproj/Conclusion.rtfd"; sourceTree = ""; }; + A396E5551502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "pt-BR"; path = "pt-BR.lproj/Description.html"; sourceTree = ""; }; + A396E5561502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = "pt-BR"; path = "pt-BR.lproj/License.rtf"; sourceTree = ""; }; + A396E5571502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; + A396E5581502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-BR"; path = "pt-BR.lproj/Welcome.rtfd"; sourceTree = ""; }; + A396E5591502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-PT"; path = "pt-PT.lproj/Conclusion.rtfd"; sourceTree = ""; }; + A396E55A1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "pt-PT"; path = "pt-PT.lproj/Description.html"; sourceTree = ""; }; + A396E55B1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = "pt-PT"; path = "pt-PT.lproj/License.rtf"; sourceTree = ""; }; + A396E55C1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; + A396E55D1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-PT"; path = "pt-PT.lproj/Welcome.rtfd"; sourceTree = ""; }; + A396E55E1502D0580025A245 /* ro */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ro; path = ro.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E55F1502D0580025A245 /* ro */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ro; path = ro.lproj/Description.html; sourceTree = ""; }; + A396E5601502D0580025A245 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ro; path = ro.lproj/License.rtf; sourceTree = ""; }; + A396E5611502D0580025A245 /* ro */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Localizable.strings; sourceTree = ""; }; + A396E5621502D0580025A245 /* ro */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ro; path = ro.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5631502D0580025A245 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ru; path = ru.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5641502D0580025A245 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ru; path = ru.lproj/Description.html; sourceTree = ""; }; + A396E5651502D0580025A245 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ru; path = ru.lproj/License.rtf; sourceTree = ""; }; + A396E5661502D0580025A245 /* ru */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + A396E5671502D0580025A245 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ru; path = ru.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5681502D0580025A245 /* sr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = sr; path = sr.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5691502D0580025A245 /* sr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = sr; path = sr.lproj/Description.html; sourceTree = ""; }; + A396E56A1502D0580025A245 /* sr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = sr; path = sr.lproj/License.rtf; sourceTree = ""; }; + A396E56B1502D0580025A245 /* sr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sr; path = sr.lproj/Localizable.strings; sourceTree = ""; }; + A396E56C1502D0580025A245 /* sr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = sr; path = sr.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E56D1502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_CN; path = zh_CN.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E56E1502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = zh_CN; path = zh_CN.lproj/Description.html; sourceTree = ""; }; + A396E56F1502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = zh_CN; path = zh_CN.lproj/License.rtf; sourceTree = ""; }; + A396E5701502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Localizable.strings; sourceTree = ""; }; + A396E5711502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_CN; path = zh_CN.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5721502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_TW; path = zh_TW.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5731502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = zh_TW; path = zh_TW.lproj/Description.html; sourceTree = ""; }; + A396E5741502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = zh_TW; path = zh_TW.lproj/License.rtf; sourceTree = ""; }; + A396E5751502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = ""; }; + A396E5761502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_TW; path = zh_TW.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5821502D3320025A245 /* Conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Conclusion.html; sourceTree = ""; }; + A3F1F267141B9B3B00DDA709 /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + AB1DE71815B6E2D00088E06B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + AB1DE71A15B6E2D00088E06B /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + AB1DE71B15B6E2D00088E06B /* Sata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Sata.c; sourceTree = ""; }; + AB30C92E15DE60ED0047BE7B /* ld_classic */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = ld_classic; sourceTree = ""; }; + AB30C92F15DE60ED0047BE7B /* ld_classic.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; path = ld_classic.1; sourceTree = ""; }; + AB30C93215DE66D90047BE7B /* Cconfig */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + AB30C93315DE66D90047BE7B /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + AB30C93415DE66D90047BE7B /* md.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = md.1; sourceTree = ""; }; + AB30C93515DE66D90047BE7B /* md.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = md.c; sourceTree = ""; }; + AB47D38A15B702F00083D898 /* org.chameleon.Boot.nvidia.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = org.chameleon.Boot.nvidia.plist; sourceTree = ""; }; + AB4DDA8D15CEFF2100E77157 /* acpi_codec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_codec.c; sourceTree = ""; }; + AB4DDA8E15CEFF2100E77157 /* acpi_tools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_tools.c; sourceTree = ""; }; + AB4DDA8F15CEFF2100E77157 /* acpicode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpicode.c; sourceTree = ""; }; + AB4DDA9015CEFF2100E77157 /* ACPICodec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ACPICodec.c; sourceTree = ""; }; + AB4DDA9115CEFF2100E77157 /* acpidecode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpidecode.c; sourceTree = ""; }; + AB4DDA9215CEFF2100E77157 /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + AB4DDA9415CEFF2100E77157 /* acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi.h; sourceTree = ""; }; + AB4DDA9515CEFF2100E77157 /* acpi_codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_codec.h; sourceTree = ""; }; + AB4DDA9615CEFF2100E77157 /* acpi_tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_tools.h; sourceTree = ""; }; + AB4DDA9715CEFF2100E77157 /* acpicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpicode.h; sourceTree = ""; }; + AB4DDA9815CEFF2100E77157 /* acpidecode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpidecode.h; sourceTree = ""; }; + AB4DDA9915CEFF2100E77157 /* datatype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = datatype.h; sourceTree = ""; }; + AB4DDA9A15CEFF2100E77157 /* intel_acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intel_acpi.h; sourceTree = ""; }; + AB4DDA9B15CEFF2100E77157 /* ppm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ppm.h; sourceTree = ""; }; + AB4DDA9C15CEFF2100E77157 /* ppmsetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ppmsetup.h; sourceTree = ""; }; + AB4DDA9D15CEFF2100E77157 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + AB4DDA9E15CEFF2100E77157 /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + ABE4A59C15B6EA73007812A6 /* nvidia_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nvidia_helper.h; sourceTree = ""; }; + ABE4A59D15B6EA73007812A6 /* nvidia_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nvidia_helper.c; sourceTree = ""; }; + B0056CE711F3868000754B65 /* boot0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0.s; sourceTree = ""; }; + B0056CE811F3868000754B65 /* chain0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = chain0.s; sourceTree = ""; }; + B0056CE911F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056CED11F3868000754B65 /* boot1f32-install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "boot1f32-install.sh"; sourceTree = ""; }; + B0056CEE11F3868000754B65 /* boot1f32.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1f32.s; sourceTree = ""; }; + B0056CEF11F3868000754B65 /* boot1he.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1he.s; sourceTree = ""; }; + B0056CF011F3868000754B65 /* boot1hp.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1hp.s; sourceTree = ""; }; + B0056CF111F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056CF311F3868000754B65 /* appleboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleboot.h; sourceTree = ""; }; + B0056CF411F3868000754B65 /* appleClut8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleClut8.h; sourceTree = ""; }; + B0056CF511F3868000754B65 /* bmdecompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bmdecompress.c; sourceTree = ""; }; + B0056CF611F3868000754B65 /* boot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = boot.c; sourceTree = ""; }; + B0056CF711F3868000754B65 /* boot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boot.h; sourceTree = ""; }; + B0056CF811F3868000754B65 /* boot2.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot2.s; sourceTree = ""; }; + B0056CF911F3868000754B65 /* drivers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = drivers.c; sourceTree = ""; }; + B0056CFA11F3868000754B65 /* graphic_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphic_utils.c; sourceTree = ""; }; + B0056CFB11F3868000754B65 /* graphic_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphic_utils.h; sourceTree = ""; }; + B0056CFC11F3868000754B65 /* graphics.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphics.c; sourceTree = ""; }; + B0056CFD11F3868000754B65 /* graphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphics.h; sourceTree = ""; }; + B0056CFE11F3868000754B65 /* gui.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gui.c; sourceTree = ""; }; + B0056CFF11F3868000754B65 /* gui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gui.h; sourceTree = ""; }; + B0056D0011F3868000754B65 /* IOHibernatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHibernatePrivate.h; sourceTree = ""; }; + B0056D0111F3868000754B65 /* lzss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lzss.c; sourceTree = ""; }; + B0056D0211F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D0311F3868000754B65 /* mboot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mboot.c; sourceTree = ""; }; + B0056D0411F3868000754B65 /* mboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mboot.h; sourceTree = ""; }; + B0056D0511F3868000754B65 /* multiboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = multiboot.h; sourceTree = ""; }; + B0056D0611F3868000754B65 /* options.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = options.c; sourceTree = ""; }; + B0056D0711F3868000754B65 /* picopng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = picopng.c; sourceTree = ""; }; + B0056D0811F3868000754B65 /* picopng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = picopng.h; sourceTree = ""; }; + B0056D0911F3868000754B65 /* prompt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prompt.c; sourceTree = ""; }; + B0056D0A11F3868000754B65 /* ramdisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ramdisk.c; sourceTree = ""; }; + B0056D0B11F3868000754B65 /* ramdisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ramdisk.h; sourceTree = ""; }; + B0056D0C11F3868000754B65 /* resume.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resume.c; sourceTree = ""; }; + B0056D0D11F3868000754B65 /* WKdm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKdm.h; sourceTree = ""; }; + B0056D0E11F3868000754B65 /* WKdmDecompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WKdmDecompress.c; sourceTree = ""; }; + B0056D1011F3868000754B65 /* cdboot.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = cdboot.s; sourceTree = ""; }; + B0056D1111F3868000754B65 /* cdboothdd.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = cdboothdd.s; sourceTree = ""; }; + B0056D1211F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D1411F3868000754B65 /* Limits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Limits; sourceTree = ""; }; + B0056D1511F3868000754B65 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0056D1711F3868000754B65 /* efi_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = efi_tables.c; sourceTree = ""; }; + B0056D1811F3868000754B65 /* efi_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi_tables.h; sourceTree = ""; }; + B0056D1911F3868000754B65 /* error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = error.c; sourceTree = ""; }; + B0056D1A11F3868000754B65 /* libsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsa.h; sourceTree = ""; }; + B0056D1B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D1C11F3868000754B65 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = ""; }; + B0056D1D11F3868000754B65 /* prf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prf.c; sourceTree = ""; }; + B0056D1E11F3868000754B65 /* printf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = printf.c; sourceTree = ""; }; + B0056D1F11F3868000754B65 /* qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qsort.c; sourceTree = ""; }; + B0056D2011F3868000754B65 /* setjmp.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; + B0056D2111F3868000754B65 /* string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = ""; }; + B0056D2211F3868000754B65 /* strtol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtol.c; sourceTree = ""; }; + B0056D2311F3868000754B65 /* zalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zalloc.c; sourceTree = ""; }; + B0056D2511F3868000754B65 /* acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi.h; sourceTree = ""; }; + B0056D2611F3868000754B65 /* acpi_patcher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_patcher.c; sourceTree = ""; }; + B0056D2711F3868000754B65 /* acpi_patcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_patcher.h; sourceTree = ""; }; + B0056D2811F3868000754B65 /* allocate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = allocate.c; sourceTree = ""; }; + B0056D2911F3868000754B65 /* asm.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = asm.s; sourceTree = ""; }; + B0056D2A11F3868000754B65 /* ati.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ati.c; sourceTree = ""; }; + B0056D2C11F3868000754B65 /* bios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bios.h; sourceTree = ""; }; + B0056D2D11F3868000754B65 /* bios.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = bios.s; sourceTree = ""; }; + B0056D2E11F3868000754B65 /* biosfn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = biosfn.c; sourceTree = ""; }; + B0056D2F11F3868000754B65 /* bootstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bootstruct.c; sourceTree = ""; }; + B0056D3011F3868000754B65 /* bootstruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstruct.h; sourceTree = ""; }; + B0056D3111F3868000754B65 /* cache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = ""; }; + B0056D3211F3868000754B65 /* console.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = console.c; sourceTree = ""; }; + B0056D3311F3868000754B65 /* convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = convert.c; sourceTree = ""; }; + B0056D3411F3868000754B65 /* convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = convert.h; sourceTree = ""; }; + B0056D3511F3868000754B65 /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpu.c; sourceTree = ""; }; + B0056D3611F3868000754B65 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpu.h; sourceTree = ""; }; + B0056D3711F3868000754B65 /* device_inject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = device_inject.c; sourceTree = ""; }; + B0056D3811F3868000754B65 /* device_inject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_inject.h; sourceTree = ""; }; + B0056D3911F3868000754B65 /* device_tree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = device_tree.c; sourceTree = ""; }; + B0056D3A11F3868000754B65 /* device_tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_tree.h; sourceTree = ""; }; + B0056D3B11F3868000754B65 /* disk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = disk.c; sourceTree = ""; }; + B0056D3C11F3868000754B65 /* efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi.h; sourceTree = ""; }; + B0056D3D11F3868000754B65 /* ext2fs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ext2fs.c; sourceTree = ""; }; + B0056D3E11F3868000754B65 /* ext2fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ext2fs.h; sourceTree = ""; }; + B0056D3F11F3868000754B65 /* fake_efi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fake_efi.c; sourceTree = ""; }; + B0056D4011F3868000754B65 /* fake_efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fake_efi.h; sourceTree = ""; }; + B0056D4111F3868000754B65 /* fdisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fdisk.h; sourceTree = ""; }; + B0056D4211F3868000754B65 /* hfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hfs.c; sourceTree = ""; }; + B0056D4311F3868000754B65 /* hfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs.h; sourceTree = ""; }; + B0056D4411F3868000754B65 /* hfs_CaseTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_CaseTables.h; sourceTree = ""; }; + B0056D4511F3868000754B65 /* hfs_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hfs_compare.c; sourceTree = ""; }; + B0056D4611F3868000754B65 /* hpet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hpet.c; sourceTree = ""; }; + B0056D4711F3868000754B65 /* hpet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hpet.h; sourceTree = ""; }; + B0056D4811F3868000754B65 /* io_inline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io_inline.h; sourceTree = ""; }; + B0056D4911F3868000754B65 /* libsaio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsaio.h; sourceTree = ""; }; + B0056D4A11F3868000754B65 /* load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = load.c; sourceTree = ""; }; + B0056D4B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D4C11F3868000754B65 /* md5c.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5c.c; sourceTree = ""; }; + B0056D4F11F3868000754B65 /* memvendors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memvendors.h; sourceTree = ""; }; + B0056D5011F3868000754B65 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + B0056D5111F3868000754B65 /* msdos.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msdos.c; sourceTree = ""; }; + B0056D5211F3868000754B65 /* msdos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msdos.h; sourceTree = ""; }; + B0056D5311F3868000754B65 /* msdos_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msdos_private.h; sourceTree = ""; }; + B0056D5411F3868000754B65 /* nbp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nbp.c; sourceTree = ""; }; + B0056D5511F3868000754B65 /* nbp_cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nbp_cmd.h; sourceTree = ""; }; + B0056D5611F3868000754B65 /* ntfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ntfs.c; sourceTree = ""; }; + B0056D5711F3868000754B65 /* ntfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ntfs.h; sourceTree = ""; }; + B0056D5811F3868000754B65 /* ntfs_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ntfs_private.h; sourceTree = ""; }; + B0056D5911F3868000754B65 /* nvidia.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nvidia.c; sourceTree = ""; }; + B0056D5A11F3868000754B65 /* nvidia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nvidia.h; sourceTree = ""; }; + B0056D5B11F3868000754B65 /* pci.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci.c; sourceTree = ""; }; + B0056D5C11F3868000754B65 /* pci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pci.h; sourceTree = ""; }; + B0056D5D11F3868000754B65 /* pci_root.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci_root.c; sourceTree = ""; }; + B0056D5E11F3868000754B65 /* pci_root.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pci_root.h; sourceTree = ""; }; + B0056D5F11F3868000754B65 /* pci_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci_setup.c; sourceTree = ""; }; + B0056D6011F3868000754B65 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = ""; }; + B0056D6111F3868000754B65 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; + B0056D6211F3868000754B65 /* saio_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saio_internal.h; sourceTree = ""; }; + B0056D6311F3868000754B65 /* saio_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saio_types.h; sourceTree = ""; }; + B0056D6411F3868000754B65 /* sl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sl.h; sourceTree = ""; }; + B0056D6511F3868000754B65 /* SMBIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMBIOS.h; sourceTree = ""; }; + B0056D6811F3868000754B65 /* spd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = spd.c; sourceTree = ""; }; + B0056D6911F3868000754B65 /* spd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spd.h; sourceTree = ""; }; + B0056D6A11F3868000754B65 /* stringTable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stringTable.c; sourceTree = ""; }; + B0056D6B11F3868000754B65 /* sys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sys.c; sourceTree = ""; }; + B0056D6C11F3868000754B65 /* table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = table.c; sourceTree = ""; }; + B0056D6E11F3868000754B65 /* ufs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs.h; sourceTree = ""; }; + B0056D7011F3868000754B65 /* ufs_byteorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs_byteorder.h; sourceTree = ""; }; + B0056D7111F3868000754B65 /* usb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = usb.c; sourceTree = ""; }; + B0056D7211F3868000754B65 /* vbe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vbe.c; sourceTree = ""; }; + B0056D7311F3868000754B65 /* vbe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vbe.h; sourceTree = ""; }; + B0056D7411F3868000754B65 /* xml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xml.c; sourceTree = ""; }; + B0056D7511F3868000754B65 /* xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xml.h; sourceTree = ""; }; + B0056D7611F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7A11F3868000754B65 /* machOconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = machOconv.c; sourceTree = ""; }; + B0056D7B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7C11F3868000754B65 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; + B0056D7D11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7F11F3868000754B65 /* CREDITS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CREDITS; sourceTree = ""; }; + B0056D8011F3868000754B65 /* coding_standards.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coding_standards.txt; sourceTree = ""; }; + B0056D8111F3868000754B65 /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES; sourceTree = ""; }; + B0056D8211F3868000754B65 /* APPLE_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = APPLE_LICENSE; sourceTree = ""; }; + B0056D8511F3868000754B65 /* Distribution */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Distribution; sourceTree = ""; }; + B0056DB911F3868000754B65 /* smbios.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = smbios.plist; sourceTree = ""; }; + B0056DBD11F3868000754B65 /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; + B0056DBE11F3868000754B65 /* boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot.png; sourceTree = ""; }; + B0056DBF11F3868000754B65 /* device_cdrom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom.png; sourceTree = ""; }; + B0056DC011F3868000754B65 /* device_ext3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3.png; sourceTree = ""; }; + B0056DC111F3868000754B65 /* device_fat16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat16.png; sourceTree = ""; }; + B0056DC211F3868000754B65 /* device_fat32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat32.png; sourceTree = ""; }; + B0056DC311F3868000754B65 /* device_generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic.png; sourceTree = ""; }; + B0056DC411F3868000754B65 /* device_hfsplus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus.png; sourceTree = ""; }; + B0056DC511F3868000754B65 /* device_ntfs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs.png; sourceTree = ""; }; + B0056DC611F3868000754B65 /* device_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_next.png; sourceTree = ""; }; + B0056DC711F3868000754B65 /* device_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_prev.png; sourceTree = ""; }; + B0056DC811F3868000754B65 /* device_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_selection.png; sourceTree = ""; }; + B0056DC911F3868000754B65 /* font_console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_console.png; sourceTree = ""; }; + B0056DCA11F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056DCB11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DCC11F3868000754B65 /* menu_boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_boot.png; sourceTree = ""; }; + B0056DCD11F3868000754B65 /* menu_help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_help.png; sourceTree = ""; }; + B0056DCE11F3868000754B65 /* menu_ignore_caches.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches.png; sourceTree = ""; }; + B0056DCF11F3868000754B65 /* menu_ignore_caches_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches_disabled.png; sourceTree = ""; }; + B0056DD011F3868000754B65 /* menu_memory_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_memory_info.png; sourceTree = ""; }; + B0056DD111F3868000754B65 /* menu_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_selection.png; sourceTree = ""; }; + B0056DD211F3868000754B65 /* menu_single_user.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user.png; sourceTree = ""; }; + B0056DD311F3868000754B65 /* menu_single_user_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user_disabled.png; sourceTree = ""; }; + B0056DD411F3868000754B65 /* menu_verbose.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose.png; sourceTree = ""; }; + B0056DD511F3868000754B65 /* menu_verbose_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose_disabled.png; sourceTree = ""; }; + B0056DD611F3868000754B65 /* menu_video_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_video_info.png; sourceTree = ""; }; + B0056DD711F3868000754B65 /* progress_bar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar.png; sourceTree = ""; }; + B0056DD811F3868000754B65 /* progress_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar_background.png; sourceTree = ""; }; + B0056DD911F3868000754B65 /* text_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_next.png; sourceTree = ""; }; + B0056DDA11F3868000754B65 /* text_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_prev.png; sourceTree = ""; }; + B0056DDB11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056DFD11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DFE11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0011F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056E0111F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0311F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056E0411F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056E0511F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0811F3868000754B65 /* Users_Guide0.4.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide0.4.pdf; sourceTree = ""; }; + B0056E0911F3868000754B65 /* Users_Guide_v0.3.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide_v0.3.pdf; sourceTree = ""; }; + B0056E0A11F3868000754B65 /* UsersGuide-v0.2.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "UsersGuide-v0.2.pdf"; sourceTree = ""; }; + B0056E0B11F3868000754B65 /* BootHelp.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BootHelp.txt; sourceTree = ""; }; + B0056E0C11F3868000754B65 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0056E0D11F3868000754B65 /* themeinfo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = themeinfo.png; sourceTree = ""; }; + B0056E0F11F3868000754B65 /* Chameleon 2 v0.4.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Chameleon 2 v0.4.xml"; sourceTree = ""; }; + B0056E1011F3868000754B65 /* Chameleon 2 v0.5.docx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Chameleon 2 v0.5.docx"; sourceTree = ""; }; + B0056E1111F3868000754B65 /* chameleon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chameleon.png; sourceTree = ""; }; + B0056E1211F3868000754B65 /* colorchart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = colorchart.png; sourceTree = ""; }; + B0056E1311F3868000754B65 /* install_complete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_complete.png; sourceTree = ""; }; + B0056E1411F3868000754B65 /* install_cust.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_cust.png; sourceTree = ""; }; + B0056E1511F3868000754B65 /* install_dest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_dest.png; sourceTree = ""; }; + B0056E1611F3868000754B65 /* install_stand.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_stand.png; sourceTree = ""; }; + B0056E1711F3868000754B65 /* install_start.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_start.png; sourceTree = ""; }; + B0056E1811F3868000754B65 /* screen_format.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screen_format.png; sourceTree = ""; }; + B0056E1911F3868000754B65 /* xnulogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = xnulogo.png; sourceTree = ""; }; + B0056E1A11F3868000754B65 /* Users_Guide0.5.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide0.5.pdf; sourceTree = ""; }; + B00F494911F6089500B1D7C5 /* aml_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aml_generator.h; sourceTree = ""; }; + B00F494A11F6089500B1D7C5 /* aml_generator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aml_generator.c; sourceTree = ""; }; + B0146EFF11FDEF550010765C /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0146F0011FDEFB90010765C /* GPL_V2_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GPL_V2_LICENSE; sourceTree = ""; }; + B4118C63153EFEC200C8D926 /* clean_po_headers.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = clean_po_headers.sh; sourceTree = ""; }; + B4118C65153EFEC200C8D926 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = COPYING; sourceTree = ""; }; + B4118C69153EFEC200C8D926 /* BibTeX.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = BibTeX.pm; sourceTree = ""; }; + B4118C6A153EFEC200C8D926 /* Chooser.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Chooser.pm; sourceTree = ""; }; + B4118C6B153EFEC200C8D926 /* Common.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Common.pm; sourceTree = ""; }; + B4118C6C153EFEC200C8D926 /* Debconf.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Debconf.pm; sourceTree = ""; }; + B4118C6D153EFEC200C8D926 /* Dia.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Dia.pm; sourceTree = ""; }; + B4118C6E153EFEC200C8D926 /* Docbook.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Docbook.pm; sourceTree = ""; }; + B4118C6F153EFEC200C8D926 /* Guide.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Guide.pm; sourceTree = ""; }; + B4118C70153EFEC200C8D926 /* Halibut.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Halibut.pm; sourceTree = ""; }; + B4118C71153EFEC200C8D926 /* Html.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Html.pm; sourceTree = ""; }; + B4118C72153EFEC200C8D926 /* Ini.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Ini.pm; sourceTree = ""; }; + B4118C73153EFEC200C8D926 /* KernelHelp.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = KernelHelp.pm; sourceTree = ""; }; + B4118C74153EFEC200C8D926 /* LaTeX.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = LaTeX.pm; sourceTree = ""; }; + B4118C75153EFEC200C8D926 /* Man.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Man.pm; sourceTree = ""; }; + B4118C76153EFEC200C8D926 /* NewsDebian.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = NewsDebian.pm; sourceTree = ""; }; + B4118C77153EFEC200C8D926 /* Po.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Po.pm; sourceTree = ""; }; + B4118C78153EFEC200C8D926 /* Pod.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Pod.pm; sourceTree = ""; }; + B4118C79153EFEC200C8D926 /* Prop.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Prop.pm; sourceTree = ""; }; + B4118C7A153EFEC200C8D926 /* Sgml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Sgml.pm; sourceTree = ""; }; + B4118C7B153EFEC200C8D926 /* TeX.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = TeX.pm; sourceTree = ""; }; + B4118C7C153EFEC200C8D926 /* Texinfo.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Texinfo.pm; sourceTree = ""; }; + B4118C7D153EFEC200C8D926 /* Text.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Text.pm; sourceTree = ""; }; + B4118C7E153EFEC200C8D926 /* TransTractor.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = TransTractor.pm; sourceTree = ""; }; + B4118C7F153EFEC200C8D926 /* Wml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Wml.pm; sourceTree = ""; }; + B4118C80153EFEC200C8D926 /* Xhtml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Xhtml.pm; sourceTree = ""; }; + B4118C81153EFEC200C8D926 /* Xml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Xml.pm; sourceTree = ""; }; + B4118C82153EFEC200C8D926 /* MANIFEST */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MANIFEST; sourceTree = ""; }; + B4118C83153EFEC200C8D926 /* NEWS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NEWS; sourceTree = ""; }; + B4118C84153EFEC200C8D926 /* po4a */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = po4a; sourceTree = ""; }; + B4118C85153EFEC200C8D926 /* po4a-gettextize */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-gettextize"; sourceTree = ""; }; + B4118C86153EFEC200C8D926 /* po4a-normalize */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-normalize"; sourceTree = ""; }; + B4118C87153EFEC200C8D926 /* po4a-translate */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-translate"; sourceTree = ""; }; + B4118C88153EFEC200C8D926 /* po4a-updatepo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-updatepo"; sourceTree = ""; }; + B4118C89153EFEC200C8D926 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B4118C8A153EFEC200C8D926 /* README.maintainers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.maintainers; sourceTree = ""; }; + B4118C8B153EFEC200C8D926 /* README.tests */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.tests; sourceTree = ""; }; + B4118C8C153EFEC200C8D926 /* README.translators */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.translators; sourceTree = ""; }; + B4118C8F153EFF3300C8D926 /* ar.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ar.po; sourceTree = ""; }; + B4118C90153EFF3300C8D926 /* bg.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bg.po; sourceTree = ""; }; + B4118C91153EFF3300C8D926 /* bs.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bs.po; sourceTree = ""; }; + B4118C92153EFF3300C8D926 /* ca.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ca.po; sourceTree = ""; }; + B4118C93153EFF3300C8D926 /* chameleon.pot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = chameleon.pot; sourceTree = ""; }; + B4118C94153EFF3300C8D926 /* cs.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cs.po; sourceTree = ""; }; + B4118C95153EFF3300C8D926 /* de.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = de.po; sourceTree = ""; }; + B4118C96153EFF3300C8D926 /* el.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = el.po; sourceTree = ""; }; + B4118C97153EFF3300C8D926 /* en.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = en.po; sourceTree = ""; }; + B4118C98153EFF3300C8D926 /* es.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = es.po; sourceTree = ""; }; + B4118C99153EFF3300C8D926 /* fa.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fa.po; sourceTree = ""; }; + B4118C9A153EFF3300C8D926 /* fr.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fr.po; sourceTree = ""; }; + B4118C9B153EFF3300C8D926 /* he.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = he.po; sourceTree = ""; }; + B4118C9C153EFF3300C8D926 /* hr.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hr.po; sourceTree = ""; }; + B4118C9D153EFF3300C8D926 /* hu.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hu.po; sourceTree = ""; }; + B4118C9E153EFF3300C8D926 /* id.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = id.po; sourceTree = ""; }; + B4118C9F153EFF3300C8D926 /* it.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = it.po; sourceTree = ""; }; + B4118CA0153EFF3300C8D926 /* ko.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ko.po; sourceTree = ""; }; + B4118CA1153EFF3300C8D926 /* mk.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mk.po; sourceTree = ""; }; + B4118CA2153EFF3300C8D926 /* nl.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = nl.po; sourceTree = ""; }; + B4118CA3153EFF3300C8D926 /* pl.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pl.po; sourceTree = ""; }; + B4118CA4153EFF3300C8D926 /* pt-BR.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pt-BR.po"; sourceTree = ""; }; + B4118CA5153EFF3300C8D926 /* pt-PT.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pt-PT.po"; sourceTree = ""; }; + B4118CA6153EFF3300C8D926 /* ro.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ro.po; sourceTree = ""; }; + B4118CA7153EFF3300C8D926 /* ru.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ru.po; sourceTree = ""; }; + B4118CA8153EFF3300C8D926 /* sr.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sr.po; sourceTree = ""; }; + B4118CA9153EFF3300C8D926 /* zh_CN.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zh_CN.po; sourceTree = ""; }; + B4118CAA153EFF3300C8D926 /* zh_TW.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zh_TW.po; sourceTree = ""; }; + B4118CAB153EFF3D00C8D926 /* po4a-chameleon.cfg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-chameleon.cfg"; sourceTree = ""; }; + B41899FB14BFBE2400ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B41899FD14BFBE4500ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B41899FE14BFBE5200ED5B0B /* boot0md.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0md.s; sourceTree = ""; }; + B41899FF14BFBE5D00ED5B0B /* boot0hfs.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0hfs.s; sourceTree = ""; }; + B4189A0014BFBE7D00ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A0114BFBE8900ED5B0B /* boot1h.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1h.s; sourceTree = ""; }; + B4189A0214BFBE9E00ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A0514BFBF0A00ED5B0B /* BIG.FAT.WARNING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = BIG.FAT.WARNING; path = config/lxdialog/BIG.FAT.WARNING; sourceTree = ""; }; + B4189A0614BFBF0A00ED5B0B /* check-lxdialog.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "check-lxdialog.sh"; path = "config/lxdialog/check-lxdialog.sh"; sourceTree = ""; }; + B4189A0714BFBF0A00ED5B0B /* checklist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checklist.c; path = config/lxdialog/checklist.c; sourceTree = ""; }; + B4189A0814BFBF0A00ED5B0B /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dialog.h; path = config/lxdialog/dialog.h; sourceTree = ""; }; + B4189A0914BFBF0A00ED5B0B /* inputbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inputbox.c; path = config/lxdialog/inputbox.c; sourceTree = ""; }; + B4189A0A14BFBF0A00ED5B0B /* menubox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menubox.c; path = config/lxdialog/menubox.c; sourceTree = ""; }; + B4189A0B14BFBF0A00ED5B0B /* textbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = textbox.c; path = config/lxdialog/textbox.c; sourceTree = ""; }; + B4189A0C14BFBF0A00ED5B0B /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = config/lxdialog/util.c; sourceTree = ""; }; + B4189A0D14BFBF0A00ED5B0B /* yesno.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = yesno.c; path = config/lxdialog/yesno.c; sourceTree = ""; }; + B4189A0E14BFBF1C00ED5B0B /* cconfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cconfig.c; path = config/cconfig.c; sourceTree = ""; }; + B4189A0F14BFBF1C00ED5B0B /* checklist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checklist.c; path = config/checklist.c; sourceTree = ""; }; + B4189A1014BFBF1C00ED5B0B /* confdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = confdata.c; path = config/confdata.c; sourceTree = ""; }; + B4189A1114BFBF1C00ED5B0B /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dialog.h; path = config/dialog.h; sourceTree = ""; }; + B4189A1214BFBF1C00ED5B0B /* expr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = expr.c; path = config/expr.c; sourceTree = ""; }; + B4189A1314BFBF1C00ED5B0B /* expr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = expr.h; path = config/expr.h; sourceTree = ""; }; + B4189A1414BFBF1C00ED5B0B /* inputbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inputbox.c; path = config/inputbox.c; sourceTree = ""; }; + B4189A1514BFBF1C00ED5B0B /* lex.zconf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lex.zconf.c; path = config/lex.zconf.c; sourceTree = ""; }; + B4189A1614BFBF1C00ED5B0B /* lkc_proto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lkc_proto.h; path = config/lkc_proto.h; sourceTree = ""; }; + B4189A1714BFBF1C00ED5B0B /* lkc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lkc.h; path = config/lkc.h; sourceTree = ""; }; + B4189A1814BFBF1C00ED5B0B /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = config/Makefile; sourceTree = ""; }; + B4189A1914BFBF1C00ED5B0B /* menu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menu.c; path = config/menu.c; sourceTree = ""; }; + B4189A1A14BFBF1C00ED5B0B /* menubox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menubox.c; path = config/menubox.c; sourceTree = ""; }; + B4189A1B14BFBF1C00ED5B0B /* nconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nconf.h; path = config/nconf.h; sourceTree = ""; }; + B4189A1C14BFBF1C00ED5B0B /* symbol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = symbol.c; path = config/symbol.c; sourceTree = ""; }; + B4189A1D14BFBF1C00ED5B0B /* textbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = textbox.c; path = config/textbox.c; sourceTree = ""; }; + B4189A1E14BFBF1C00ED5B0B /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = config/util.c; sourceTree = ""; }; + B4189A1F14BFBF1C00ED5B0B /* yesno.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = yesno.c; path = config/yesno.c; sourceTree = ""; }; + B4189A2014BFBF1C00ED5B0B /* zconf.hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zconf.hash.c; path = config/zconf.hash.c; sourceTree = ""; }; + B4189A2114BFBF1C00ED5B0B /* zconf.tab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zconf.tab.c; path = config/zconf.tab.c; sourceTree = ""; }; + B4189A2214BFBF5600ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A2314BFBF7200ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A2414BFBFD100ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4AABE5914C3B8B90055ECD1 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B4AABE5B14C3B8C70055ECD1 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B4AABE5D14C3B8D70055ECD1 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B4AABE5E14C3B8EF0055ECD1 /* clean_bootplist.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = clean_bootplist.pl; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* Chameleon */ = { + isa = PBXGroup; + children = ( + AB30C92D15DE60ED0047BE7B /* bin */, + B0056D8211F3868000754B65 /* APPLE_LICENSE */, + B0056DBA11F3868000754B65 /* artwork */, + 369689D014BD0AF10013D77F /* BLOCKERS */, + 369689D114BD0AF10013D77F /* Cconfig */, + B0056D8111F3868000754B65 /* CHANGES */, + B0056D8011F3868000754B65 /* coding_standards.txt */, + B0056D7F11F3868000754B65 /* CREDITS */, + B0056E0611F3868000754B65 /* doc */, + B0146F0011FDEFB90010765C /* GPL_V2_LICENSE */, + B0056CE511F3868000754B65 /* i386 */, + A360AA7D14136C1A00084D3F /* Make.rules */, + B0056D7D11F3868000754B65 /* Makefile */, + 019DFBAF11FB94090013E8CC /* MEMTEST86_LICENSE */, + B0056D8311F3868000754B65 /* package */, + B0146EFF11FDEF550010765C /* README */, + A31301A71503CB9900E8C718 /* README.translators */, + B0056D7C11F3868000754B65 /* TODO */, + 369689D214BD0B470013D77F /* version */, + ); + name = Chameleon; + sourceTree = ""; + }; + 361BC70414BD979700236488 /* Icons */ = { + isa = PBXGroup; + children = ( + 361BC70B14BD97C800236488 /* pkg.zip */, + ); + name = Icons; + sourceTree = ""; + }; + 364E0DDF14BCFB6600F55E58 /* Scripts.templates */ = { + isa = PBXGroup; + children = ( + B4AABE5814C3B8B90055ECD1 /* AddOption */, + 364E0DE114BCFB7A00F55E58 /* InstallerLog */, + B4AABE5A14C3B8C70055ECD1 /* InstallModule */, + B4AABE5C14C3B8D70055ECD1 /* InstallTheme */, + 364E0DE314BCFB7A00F55E58 /* Post */, + 364E0DE514BCFB7A00F55E58 /* Pre */, + ); + name = Scripts.templates; + sourceTree = ""; + }; + 364E0DE114BCFB7A00F55E58 /* InstallerLog */ = { + isa = PBXGroup; + children = ( + 36AB75E114BD091C005B8045 /* InstallLog.sh */, + ); + name = InstallerLog; + path = Scripts.templates/InstallerLog; + sourceTree = ""; + }; + 364E0DE314BCFB7A00F55E58 /* Post */ = { + isa = PBXGroup; + children = ( + 36AB75E314BD0925005B8045 /* postinstall */, + ); + name = Post; + path = Scripts.templates/Post; + sourceTree = ""; + }; + 364E0DE514BCFB7A00F55E58 /* Pre */ = { + isa = PBXGroup; + children = ( + B4AABE5E14C3B8EF0055ECD1 /* clean_bootplist.pl */, + 36AB75E414BD092D005B8045 /* preinstall */, + ); + name = Pre; + path = Scripts.templates/Pre; + sourceTree = ""; + }; + 36B43E8114BCE91300D29461 /* OptionalSettings */ = { + isa = PBXGroup; + children = ( + 36AB75E514BD095E005B8045 /* Control.txt */, + 36AB75E614BD095E005B8045 /* General.txt */, + 36AB75E714BD095E005B8045 /* KernelFlags.txt */, + 36AB75E814BD095E005B8045 /* PowerManagement.txt */, + 36AB75E914BD095E005B8045 /* Resolution.txt */, + 36AB75EA14BD095E005B8045 /* Video.txt */, + ); + name = OptionalSettings; + sourceTree = ""; + }; + 6DBAFD1713B0D4590047ED33 /* include */ = { + isa = PBXGroup; + children = ( + 6DBAFD1813B0D4590047ED33 /* _structs.h */, + 6DBAFD1913B0D4590047ED33 /* _types.h */, + 6DBAFD1A13B0D4590047ED33 /* architecture */, + 6DBAFD3A13B0D4590047ED33 /* assert.h */, + 6DBAFD3B13B0D4590047ED33 /* ctype.h */, + 6DBAFD3C13B0D4590047ED33 /* device */, + 6DBAFD3F13B0D4590047ED33 /* errno.h */, + 6DBAFD4013B0D4590047ED33 /* float.h */, + 6DBAFD4113B0D4590047ED33 /* hfs */, + 6DBAFD4513B0D4590047ED33 /* i386 */, + 6DBAFD5513B0D4590047ED33 /* inttypes.h */, + 6DBAFD5613B0D4590047ED33 /* IOKit */, + 6DBAFE9D13B0D4590047ED33 /* libkern */, + 6DBAFEB013B0D4590047ED33 /* limits.h */, + 6DBAFEB113B0D4590047ED33 /* locale.h */, + 6DBAFEB213B0D4590047ED33 /* mach */, + 6DBAFF4E13B0D4590047ED33 /* mach-o */, + 6DBAFF6313B0D4590047ED33 /* machine */, + 6DBAFF7213B0D4590047ED33 /* math.h */, + 6DBAFF7313B0D4590047ED33 /* netinet */, + 6DBAFF8D13B0D4590047ED33 /* netinet6 */, + 6DBAFF9913B0D4590047ED33 /* runetype.h */, + 6DBAFF9A13B0D4590047ED33 /* secure */, + 6DBAFF9D13B0D4590047ED33 /* setjmp.h */, + 6DBAFF9E13B0D4590047ED33 /* signal.h */, + 6DBAFF9F13B0D4590047ED33 /* stdarg.h */, + 6DBAFFA013B0D4590047ED33 /* stdbool.h */, + 6DBAFFA113B0D4590047ED33 /* stddef.h */, + 6DBAFFA213B0D4590047ED33 /* stdint.h */, + 6DBAFFA313B0D4590047ED33 /* stdio.h */, + 6DBAFFA413B0D4590047ED33 /* stdlib.h */, + 6DBAFFA513B0D4590047ED33 /* string.h */, + 6DBAFFA613B0D4590047ED33 /* sys */, + 6DBAFFB913B0D4590047ED33 /* time.h */, + 6DBAFFBA13B0D4590047ED33 /* ufs */, + 6DBAFFC413B0D4590047ED33 /* unistd.h */, + 6DBAFFC513B0D4590047ED33 /* unwind.h */, + ); + path = include; + sourceTree = ""; + }; + 6DBAFD1A13B0D4590047ED33 /* architecture */ = { + isa = PBXGroup; + children = ( + 6DBAFD1B13B0D4590047ED33 /* alignment.h */, + 6DBAFD1C13B0D4590047ED33 /* byte_order.h */, + 6DBAFD1D13B0D4590047ED33 /* i386 */, + 6DBAFD2D13B0D4590047ED33 /* ppc */, + ); + path = architecture; + sourceTree = ""; + }; + 6DBAFD1D13B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFD1E13B0D4590047ED33 /* alignment.h */, + 6DBAFD1F13B0D4590047ED33 /* asm_help.h */, + 6DBAFD2013B0D4590047ED33 /* byte_order.h */, + 6DBAFD2113B0D4590047ED33 /* cpu.h */, + 6DBAFD2213B0D4590047ED33 /* desc.h */, + 6DBAFD2313B0D4590047ED33 /* fenv.h */, + 6DBAFD2413B0D4590047ED33 /* fpu.h */, + 6DBAFD2513B0D4590047ED33 /* frame.h */, + 6DBAFD2613B0D4590047ED33 /* io.h */, + 6DBAFD2713B0D4590047ED33 /* math.h */, + 6DBAFD2813B0D4590047ED33 /* pio.h */, + 6DBAFD2913B0D4590047ED33 /* reg_help.h */, + 6DBAFD2A13B0D4590047ED33 /* sel.h */, + 6DBAFD2B13B0D4590047ED33 /* table.h */, + 6DBAFD2C13B0D4590047ED33 /* tss.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFD2D13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFD2E13B0D4590047ED33 /* alignment.h */, + 6DBAFD2F13B0D4590047ED33 /* asm_help.h */, + 6DBAFD3013B0D4590047ED33 /* basic_regs.h */, + 6DBAFD3113B0D4590047ED33 /* byte_order.h */, + 6DBAFD3213B0D4590047ED33 /* cframe.h */, + 6DBAFD3313B0D4590047ED33 /* fenv.h */, + 6DBAFD3413B0D4590047ED33 /* fp_regs.h */, + 6DBAFD3513B0D4590047ED33 /* macro_help.h */, + 6DBAFD3613B0D4590047ED33 /* math.h */, + 6DBAFD3713B0D4590047ED33 /* mode_independent_asm.h */, + 6DBAFD3813B0D4590047ED33 /* pseudo_inst.h */, + 6DBAFD3913B0D4590047ED33 /* reg_help.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFD3C13B0D4590047ED33 /* device */ = { + isa = PBXGroup; + children = ( + 6DBAFD3D13B0D4590047ED33 /* device_port.h */, + 6DBAFD3E13B0D4590047ED33 /* device_types.h */, + ); + path = device; + sourceTree = ""; + }; + 6DBAFD4113B0D4590047ED33 /* hfs */ = { + isa = PBXGroup; + children = ( + 6DBAFD4213B0D4590047ED33 /* hfs_encodings.h */, + 6DBAFD4313B0D4590047ED33 /* hfs_format.h */, + 6DBAFD4413B0D4590047ED33 /* hfs_mount.h */, + ); + path = hfs; + sourceTree = ""; + }; + 6DBAFD4513B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFD4613B0D4590047ED33 /* _limits.h */, + 6DBAFD4713B0D4590047ED33 /* _param.h */, + 6DBAFD4813B0D4590047ED33 /* _structs.h */, + 6DBAFD4913B0D4590047ED33 /* _types.h */, + 6DBAFD4A13B0D4590047ED33 /* eflags.h */, + 6DBAFD4B13B0D4590047ED33 /* endian.h */, + 6DBAFD4C13B0D4590047ED33 /* fasttrap_isa.h */, + 6DBAFD4D13B0D4590047ED33 /* limits.h */, + 6DBAFD4E13B0D4590047ED33 /* param.h */, + 6DBAFD4F13B0D4590047ED33 /* profile.h */, + 6DBAFD5013B0D4590047ED33 /* setjmp.h */, + 6DBAFD5113B0D4590047ED33 /* signal.h */, + 6DBAFD5213B0D4590047ED33 /* types.h */, + 6DBAFD5313B0D4590047ED33 /* user_ldt.h */, + 6DBAFD5413B0D4590047ED33 /* vmparam.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFD5613B0D4590047ED33 /* IOKit */ = { + isa = PBXGroup; + children = ( + 6DBAFD5713B0D4590047ED33 /* acpi */, + 6DBAFD5B13B0D4590047ED33 /* assert.h */, + 6DBAFD5C13B0D4590047ED33 /* ata */, + 6DBAFD6913B0D4590047ED33 /* audio */, + 6DBAFD7713B0D4590047ED33 /* avc */, + 6DBAFD7F13B0D4590047ED33 /* bluetooth */, + 6DBAFD8813B0D4590047ED33 /* firewire */, + 6DBAFDA913B0D4590047ED33 /* graphics */, + 6DBAFDB513B0D4590047ED33 /* hid */, + 6DBAFDBB13B0D4590047ED33 /* hidevent */, + 6DBAFDBE13B0D4590047ED33 /* hidsystem */, + 6DBAFDCB13B0D4590047ED33 /* i2c */, + 6DBAFDCD13B0D4590047ED33 /* IOBSD.h */, + 6DBAFDCE13B0D4590047ED33 /* IOBufferMemoryDescriptor.h */, + 6DBAFDCF13B0D4590047ED33 /* IOCatalogue.h */, + 6DBAFDD013B0D4590047ED33 /* IOCommand.h */, + 6DBAFDD113B0D4590047ED33 /* IOCommandGate.h */, + 6DBAFDD213B0D4590047ED33 /* IOCommandPool.h */, + 6DBAFDD313B0D4590047ED33 /* IOConditionLock.h */, + 6DBAFDD413B0D4590047ED33 /* IODataQueue.h */, + 6DBAFDD513B0D4590047ED33 /* IODataQueueShared.h */, + 6DBAFDD613B0D4590047ED33 /* IODeviceMemory.h */, + 6DBAFDD713B0D4590047ED33 /* IODeviceTreeSupport.h */, + 6DBAFDD813B0D4590047ED33 /* IODMACommand.h */, + 6DBAFDD913B0D4590047ED33 /* IODMAController.h */, + 6DBAFDDA13B0D4590047ED33 /* IODMAEventSource.h */, + 6DBAFDDB13B0D4590047ED33 /* IOEventSource.h */, + 6DBAFDDC13B0D4590047ED33 /* IOFilterInterruptEventSource.h */, + 6DBAFDDD13B0D4590047ED33 /* IOInterleavedMemoryDescriptor.h */, + 6DBAFDDE13B0D4590047ED33 /* IOInterruptController.h */, + 6DBAFDDF13B0D4590047ED33 /* IOInterruptEventSource.h */, + 6DBAFDE013B0D4590047ED33 /* IOInterrupts.h */, + 6DBAFDE113B0D4590047ED33 /* IOKitDebug.h */, + 6DBAFDE213B0D4590047ED33 /* IOKitKeys.h */, + 6DBAFDE313B0D4590047ED33 /* IOKitServer.h */, + 6DBAFDE413B0D4590047ED33 /* IOLib.h */, + 6DBAFDE513B0D4590047ED33 /* IOLocks.h */, + 6DBAFDE613B0D4590047ED33 /* IOMapper.h */, + 6DBAFDE713B0D4590047ED33 /* IOMemoryCursor.h */, + 6DBAFDE813B0D4590047ED33 /* IOMemoryDescriptor.h */, + 6DBAFDE913B0D4590047ED33 /* IOMessage.h */, + 6DBAFDEA13B0D4590047ED33 /* IOMultiMemoryDescriptor.h */, + 6DBAFDEB13B0D4590047ED33 /* IONotifier.h */, + 6DBAFDEC13B0D4590047ED33 /* IONVRAM.h */, + 6DBAFDED13B0D4590047ED33 /* IOPlatformExpert.h */, + 6DBAFDEE13B0D4590047ED33 /* IORangeAllocator.h */, + 6DBAFDEF13B0D4590047ED33 /* IORegistryEntry.h */, + 6DBAFDF013B0D4590047ED33 /* IOReturn.h */, + 6DBAFDF113B0D4590047ED33 /* IOService.h */, + 6DBAFDF213B0D4590047ED33 /* IOServicePM.h */, + 6DBAFDF313B0D4590047ED33 /* IOSharedDataQueue.h */, + 6DBAFDF413B0D4590047ED33 /* IOSharedLock.h */, + 6DBAFDF513B0D4590047ED33 /* IOSubMemoryDescriptor.h */, + 6DBAFDF613B0D4590047ED33 /* IOSyncer.h */, + 6DBAFDF713B0D4590047ED33 /* IOTimerEventSource.h */, + 6DBAFDF813B0D4590047ED33 /* IOTimeStamp.h */, + 6DBAFDF913B0D4590047ED33 /* IOTypes.h */, + 6DBAFDFA13B0D4590047ED33 /* IOUserClient.h */, + 6DBAFDFB13B0D4590047ED33 /* IOWorkLoop.h */, + 6DBAFDFC13B0D4590047ED33 /* ndrvsupport */, + 6DBAFE0213B0D4590047ED33 /* network */, + 6DBAFE1113B0D4590047ED33 /* nvram */, + 6DBAFE1313B0D4590047ED33 /* OSMessageNotification.h */, + 6DBAFE1413B0D4590047ED33 /* pci */, + 6DBAFE1813B0D4590047ED33 /* platform */, + 6DBAFE1D13B0D4590047ED33 /* power */, + 6DBAFE1F13B0D4590047ED33 /* ppc */, + 6DBAFE2113B0D4590047ED33 /* pwr_mgt */, + 6DBAFE2B13B0D4590047ED33 /* rtc */, + 6DBAFE2D13B0D4590047ED33 /* sbp2 */, + 6DBAFE3713B0D4590047ED33 /* scsi */, + 6DBAFE5313B0D4590047ED33 /* serial */, + 6DBAFE5913B0D4590047ED33 /* storage */, + 6DBAFE7B13B0D4590047ED33 /* stream */, + 6DBAFE8013B0D4590047ED33 /* system.h */, + 6DBAFE8113B0D4590047ED33 /* system_management */, + 6DBAFE8313B0D4590047ED33 /* usb */, + ); + path = IOKit; + sourceTree = ""; + }; + 6DBAFD5713B0D4590047ED33 /* acpi */ = { + isa = PBXGroup; + children = ( + 6DBAFD5813B0D4590047ED33 /* IOACPIPlatformDevice.h */, + 6DBAFD5913B0D4590047ED33 /* IOACPIPlatformExpert.h */, + 6DBAFD5A13B0D4590047ED33 /* IOACPITypes.h */, + ); + path = acpi; + sourceTree = ""; + }; + 6DBAFD5C13B0D4590047ED33 /* ata */ = { + isa = PBXGroup; + children = ( + 6DBAFD5D13B0D4590047ED33 /* ATADeviceNub.h */, + 6DBAFD5E13B0D4590047ED33 /* ATATimerEventSource.h */, + 6DBAFD5F13B0D4590047ED33 /* IOATABusCommand.h */, + 6DBAFD6013B0D4590047ED33 /* IOATABusInfo.h */, + 6DBAFD6113B0D4590047ED33 /* IOATACommand.h */, + 6DBAFD6213B0D4590047ED33 /* IOATAController.h */, + 6DBAFD6313B0D4590047ED33 /* IOATADevConfig.h */, + 6DBAFD6413B0D4590047ED33 /* IOATADevice.h */, + 6DBAFD6513B0D4590047ED33 /* IOATARegI386.h */, + 6DBAFD6613B0D4590047ED33 /* IOATATypes.h */, + 6DBAFD6713B0D4590047ED33 /* IOPCIATA.h */, + 6DBAFD6813B0D4590047ED33 /* MacIOATA.h */, + ); + path = ata; + sourceTree = ""; + }; + 6DBAFD6913B0D4590047ED33 /* audio */ = { + isa = PBXGroup; + children = ( + 6DBAFD6A13B0D4590047ED33 /* IOAudioControl.h */, + 6DBAFD6B13B0D4590047ED33 /* IOAudioControlUserClient.h */, + 6DBAFD6C13B0D4590047ED33 /* IOAudioDebug.h */, + 6DBAFD6D13B0D4590047ED33 /* IOAudioDefines.h */, + 6DBAFD6E13B0D4590047ED33 /* IOAudioDevice.h */, + 6DBAFD6F13B0D4590047ED33 /* IOAudioEngine.h */, + 6DBAFD7013B0D4590047ED33 /* IOAudioEngineUserClient.h */, + 6DBAFD7113B0D4590047ED33 /* IOAudioLevelControl.h */, + 6DBAFD7213B0D4590047ED33 /* IOAudioPort.h */, + 6DBAFD7313B0D4590047ED33 /* IOAudioSelectorControl.h */, + 6DBAFD7413B0D4590047ED33 /* IOAudioStream.h */, + 6DBAFD7513B0D4590047ED33 /* IOAudioToggleControl.h */, + 6DBAFD7613B0D4590047ED33 /* IOAudioTypes.h */, + ); + path = audio; + sourceTree = ""; + }; + 6DBAFD7713B0D4590047ED33 /* avc */ = { + isa = PBXGroup; + children = ( + 6DBAFD7813B0D4590047ED33 /* IOFireWireAVCCommand.h */, + 6DBAFD7913B0D4590047ED33 /* IOFireWireAVCConsts.h */, + 6DBAFD7A13B0D4590047ED33 /* IOFireWireAVCRequestSpace.h */, + 6DBAFD7B13B0D4590047ED33 /* IOFireWireAVCTargetSpace.h */, + 6DBAFD7C13B0D4590047ED33 /* IOFireWireAVCUnit.h */, + 6DBAFD7D13B0D4590047ED33 /* IOFireWireAVCUserClientCommon.h */, + 6DBAFD7E13B0D4590047ED33 /* IOFireWirePCRSpace.h */, + ); + path = avc; + sourceTree = ""; + }; + 6DBAFD7F13B0D4590047ED33 /* bluetooth */ = { + isa = PBXGroup; + children = ( + 6DBAFD8013B0D4590047ED33 /* Bluetooth.h */, + 6DBAFD8113B0D4590047ED33 /* BluetoothAssignedNumbers.h */, + 6DBAFD8213B0D4590047ED33 /* IOBluetoothHCIController.h */, + 6DBAFD8313B0D4590047ED33 /* IOBluetoothHCIRequest.h */, + 6DBAFD8413B0D4590047ED33 /* IOBluetoothHIDDriver.h */, + 6DBAFD8513B0D4590047ED33 /* IOBluetoothHIDDriverTypes.h */, + 6DBAFD8613B0D4590047ED33 /* IOBluetoothInternal.h */, + 6DBAFD8713B0D4590047ED33 /* IOBluetoothTypes.h */, + ); + path = bluetooth; + sourceTree = ""; + }; + 6DBAFD8813B0D4590047ED33 /* firewire */ = { + isa = PBXGroup; + children = ( + 6DBAFD8913B0D4590047ED33 /* IOConfigDirectory.h */, + 6DBAFD8A13B0D4590047ED33 /* IOFireWireBus.h */, + 6DBAFD8B13B0D4590047ED33 /* IOFireWireController.h */, + 6DBAFD8C13B0D4590047ED33 /* IOFireWireDevice.h */, + 6DBAFD8D13B0D4590047ED33 /* IOFireWireFamilyCommon.h */, + 6DBAFD8E13B0D4590047ED33 /* IOFireWireIRMAllocation.h */, + 6DBAFD8F13B0D4590047ED33 /* IOFireWireLocalNode.h */, + 6DBAFD9013B0D4590047ED33 /* IOFireWireMultiIsochReceive.h */, + 6DBAFD9113B0D4590047ED33 /* IOFireWireNub.h */, + 6DBAFD9213B0D4590047ED33 /* IOFireWirePowerManager.h */, + 6DBAFD9313B0D4590047ED33 /* IOFireWireUnit.h */, + 6DBAFD9413B0D4590047ED33 /* IOFWAddressSpace.h */, + 6DBAFD9513B0D4590047ED33 /* IOFWAsyncStreamListener.h */, + 6DBAFD9613B0D4590047ED33 /* IOFWCommand.h */, + 6DBAFD9713B0D4590047ED33 /* IOFWDCL.h */, + 6DBAFD9813B0D4590047ED33 /* IOFWDCLPool.h */, + 6DBAFD9913B0D4590047ED33 /* IOFWDCLProgram.h */, + 6DBAFD9A13B0D4590047ED33 /* IOFWDCLTranslator.h */, + 6DBAFD9B13B0D4590047ED33 /* IOFWIsochChannel.h */, + 6DBAFD9C13B0D4590047ED33 /* IOFWIsochPort.h */, + 6DBAFD9D13B0D4590047ED33 /* IOFWLocalIsochPort.h */, + 6DBAFD9E13B0D4590047ED33 /* IOFWPHYPacketListener.h */, + 6DBAFD9F13B0D4590047ED33 /* IOFWPhysicalAddressSpace.h */, + 6DBAFDA013B0D4590047ED33 /* IOFWPseudoAddressSpace.h */, + 6DBAFDA113B0D4590047ED33 /* IOFWRegs.h */, + 6DBAFDA213B0D4590047ED33 /* IOFWSimpleContiguousPhysicalAddressSpace.h */, + 6DBAFDA313B0D4590047ED33 /* IOFWSimplePhysicalAddressSpace.h */, + 6DBAFDA413B0D4590047ED33 /* IOFWSyncer.h */, + 6DBAFDA513B0D4590047ED33 /* IOFWUserObjectExporter.h */, + 6DBAFDA613B0D4590047ED33 /* IOFWUtils.h */, + 6DBAFDA713B0D4590047ED33 /* IOLocalConfigDirectory.h */, + 6DBAFDA813B0D4590047ED33 /* IORemoteConfigDirectory.h */, + ); + path = firewire; + sourceTree = ""; + }; + 6DBAFDA913B0D4590047ED33 /* graphics */ = { + isa = PBXGroup; + children = ( + 6DBAFDAA13B0D4590047ED33 /* IOAccelClientConnect.h */, + 6DBAFDAB13B0D4590047ED33 /* IOAccelerator.h */, + 6DBAFDAC13B0D4590047ED33 /* IOAccelSurfaceConnect.h */, + 6DBAFDAD13B0D4590047ED33 /* IOAccelTypes.h */, + 6DBAFDAE13B0D4590047ED33 /* IODisplay.h */, + 6DBAFDAF13B0D4590047ED33 /* IOFramebuffer.h */, + 6DBAFDB013B0D4590047ED33 /* IOFramebufferShared.h */, + 6DBAFDB113B0D4590047ED33 /* IOGraphicsDevice.h */, + 6DBAFDB213B0D4590047ED33 /* IOGraphicsEngine.h */, + 6DBAFDB313B0D4590047ED33 /* IOGraphicsInterfaceTypes.h */, + 6DBAFDB413B0D4590047ED33 /* IOGraphicsTypes.h */, + ); + path = graphics; + sourceTree = ""; + }; + 6DBAFDB513B0D4590047ED33 /* hid */ = { + isa = PBXGroup; + children = ( + 6DBAFDB613B0D4590047ED33 /* IOHIDDevice.h */, + 6DBAFDB713B0D4590047ED33 /* IOHIDElement.h */, + 6DBAFDB813B0D4590047ED33 /* IOHIDInterface.h */, + 6DBAFDB913B0D4590047ED33 /* IOHIDKeys.h */, + 6DBAFDBA13B0D4590047ED33 /* IOHIDUsageTables.h */, + ); + path = hid; + sourceTree = ""; + }; + 6DBAFDBB13B0D4590047ED33 /* hidevent */ = { + isa = PBXGroup; + children = ( + 6DBAFDBC13B0D4590047ED33 /* IOHIDEventDriver.h */, + 6DBAFDBD13B0D4590047ED33 /* IOHIDEventService.h */, + ); + path = hidevent; + sourceTree = ""; + }; + 6DBAFDBE13B0D4590047ED33 /* hidsystem */ = { + isa = PBXGroup; + children = ( + 6DBAFDBF13B0D4590047ED33 /* ev_keymap.h */, + 6DBAFDC013B0D4590047ED33 /* IOHIDDescriptorParser.h */, + 6DBAFDC113B0D4590047ED33 /* IOHIDevice.h */, + 6DBAFDC213B0D4590047ED33 /* IOHIDParameter.h */, + 6DBAFDC313B0D4590047ED33 /* IOHIDShared.h */, + 6DBAFDC413B0D4590047ED33 /* IOHIDSystem.h */, + 6DBAFDC513B0D4590047ED33 /* IOHIDTypes.h */, + 6DBAFDC613B0D4590047ED33 /* IOHIDUsageTables.h */, + 6DBAFDC713B0D4590047ED33 /* IOHIKeyboard.h */, + 6DBAFDC813B0D4590047ED33 /* IOHIKeyboardMapper.h */, + 6DBAFDC913B0D4590047ED33 /* IOHIPointing.h */, + 6DBAFDCA13B0D4590047ED33 /* IOLLEvent.h */, + ); + path = hidsystem; + sourceTree = ""; + }; + 6DBAFDCB13B0D4590047ED33 /* i2c */ = { + isa = PBXGroup; + children = ( + 6DBAFDCC13B0D4590047ED33 /* IOI2CInterface.h */, + ); + path = i2c; + sourceTree = ""; + }; + 6DBAFDFC13B0D4590047ED33 /* ndrvsupport */ = { + isa = PBXGroup; + children = ( + 6DBAFDFD13B0D4590047ED33 /* IOMacOSTypes.h */, + 6DBAFDFE13B0D4590047ED33 /* IOMacOSVideo.h */, + 6DBAFDFF13B0D4590047ED33 /* IONDRVFramebuffer.h */, + 6DBAFE0013B0D4590047ED33 /* IONDRVLibraries.h */, + 6DBAFE0113B0D4590047ED33 /* IONDRVSupport.h */, + ); + path = ndrvsupport; + sourceTree = ""; + }; + 6DBAFE0213B0D4590047ED33 /* network */ = { + isa = PBXGroup; + children = ( + 6DBAFE0313B0D4590047ED33 /* IOBasicOutputQueue.h */, + 6DBAFE0413B0D4590047ED33 /* IOEthernetController.h */, + 6DBAFE0513B0D4590047ED33 /* IOEthernetInterface.h */, + 6DBAFE0613B0D4590047ED33 /* IOEthernetStats.h */, + 6DBAFE0713B0D4590047ED33 /* IOGatedOutputQueue.h */, + 6DBAFE0813B0D4590047ED33 /* IOKernelDebugger.h */, + 6DBAFE0913B0D4590047ED33 /* IOMbufMemoryCursor.h */, + 6DBAFE0A13B0D4590047ED33 /* IONetworkController.h */, + 6DBAFE0B13B0D4590047ED33 /* IONetworkData.h */, + 6DBAFE0C13B0D4590047ED33 /* IONetworkInterface.h */, + 6DBAFE0D13B0D4590047ED33 /* IONetworkMedium.h */, + 6DBAFE0E13B0D4590047ED33 /* IONetworkStats.h */, + 6DBAFE0F13B0D4590047ED33 /* IOOutputQueue.h */, + 6DBAFE1013B0D4590047ED33 /* IOPacketQueue.h */, + ); + path = network; + sourceTree = ""; + }; + 6DBAFE1113B0D4590047ED33 /* nvram */ = { + isa = PBXGroup; + children = ( + 6DBAFE1213B0D4590047ED33 /* IONVRAMController.h */, + ); + path = nvram; + sourceTree = ""; + }; + 6DBAFE1413B0D4590047ED33 /* pci */ = { + isa = PBXGroup; + children = ( + 6DBAFE1513B0D4590047ED33 /* IOAGPDevice.h */, + 6DBAFE1613B0D4590047ED33 /* IOPCIBridge.h */, + 6DBAFE1713B0D4590047ED33 /* IOPCIDevice.h */, + ); + path = pci; + sourceTree = ""; + }; + 6DBAFE1813B0D4590047ED33 /* platform */ = { + isa = PBXGroup; + children = ( + 6DBAFE1913B0D4590047ED33 /* AppleMacIO.h */, + 6DBAFE1A13B0D4590047ED33 /* AppleMacIODevice.h */, + 6DBAFE1B13B0D4590047ED33 /* AppleNMI.h */, + 6DBAFE1C13B0D4590047ED33 /* ApplePlatformExpert.h */, + ); + path = platform; + sourceTree = ""; + }; + 6DBAFE1D13B0D4590047ED33 /* power */ = { + isa = PBXGroup; + children = ( + 6DBAFE1E13B0D4590047ED33 /* IOPwrController.h */, + ); + path = power; + sourceTree = ""; + }; + 6DBAFE1F13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFE2013B0D4590047ED33 /* IODBDMA.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFE2113B0D4590047ED33 /* pwr_mgt */ = { + isa = PBXGroup; + children = ( + 6DBAFE2213B0D4590047ED33 /* IOPM.h */, + 6DBAFE2313B0D4590047ED33 /* IOPMDeprecated.h */, + 6DBAFE2413B0D4590047ED33 /* IOPMLibDefs.h */, + 6DBAFE2513B0D4590047ED33 /* IOPMPowerSource.h */, + 6DBAFE2613B0D4590047ED33 /* IOPMPowerSourceList.h */, + 6DBAFE2713B0D4590047ED33 /* IOPMpowerState.h */, + 6DBAFE2813B0D4590047ED33 /* IOPMPrivate.h */, + 6DBAFE2913B0D4590047ED33 /* IOPowerConnection.h */, + 6DBAFE2A13B0D4590047ED33 /* RootDomain.h */, + ); + path = pwr_mgt; + sourceTree = ""; + }; + 6DBAFE2B13B0D4590047ED33 /* rtc */ = { + isa = PBXGroup; + children = ( + 6DBAFE2C13B0D4590047ED33 /* IORTCController.h */, + ); + path = rtc; + sourceTree = ""; + }; + 6DBAFE2D13B0D4590047ED33 /* sbp2 */ = { + isa = PBXGroup; + children = ( + 6DBAFE2E13B0D4590047ED33 /* IOFireWireSBP2Login.h */, + 6DBAFE2F13B0D4590047ED33 /* IOFireWireSBP2LSIWorkaroundDescriptor.h */, + 6DBAFE3013B0D4590047ED33 /* IOFireWireSBP2LUN.h */, + 6DBAFE3113B0D4590047ED33 /* IOFireWireSBP2ManagementORB.h */, + 6DBAFE3213B0D4590047ED33 /* IOFireWireSBP2ORB.h */, + 6DBAFE3313B0D4590047ED33 /* IOFireWireSBP2Target.h */, + 6DBAFE3413B0D4590047ED33 /* IOFireWireSBP2UserClient.h */, + 6DBAFE3513B0D4590047ED33 /* IOFireWireSBP2UserClientCommon.h */, + 6DBAFE3613B0D4590047ED33 /* IOFireWireSerialBusProtocolTransport.h */, + ); + path = sbp2; + sourceTree = ""; + }; + 6DBAFE3713B0D4590047ED33 /* scsi */ = { + isa = PBXGroup; + children = ( + 6DBAFE3813B0D4590047ED33 /* IOBDServices.h */, + 6DBAFE3913B0D4590047ED33 /* IOBlockStorageServices.h */, + 6DBAFE3A13B0D4590047ED33 /* IOCompactDiscServices.h */, + 6DBAFE3B13B0D4590047ED33 /* IODVDServices.h */, + 6DBAFE3C13B0D4590047ED33 /* IOReducedBlockServices.h */, + 6DBAFE3D13B0D4590047ED33 /* IOSCSIBlockCommandsDevice.h */, + 6DBAFE3E13B0D4590047ED33 /* IOSCSIMultimediaCommandsDevice.h */, + 6DBAFE3F13B0D4590047ED33 /* IOSCSIPeripheralDeviceNub.h */, + 6DBAFE4013B0D4590047ED33 /* IOSCSIPeripheralDeviceType00.h */, + 6DBAFE4113B0D4590047ED33 /* IOSCSIPeripheralDeviceType05.h */, + 6DBAFE4213B0D4590047ED33 /* IOSCSIPeripheralDeviceType07.h */, + 6DBAFE4313B0D4590047ED33 /* IOSCSIPeripheralDeviceType0E.h */, + 6DBAFE4413B0D4590047ED33 /* IOSCSIPrimaryCommandsDevice.h */, + 6DBAFE4513B0D4590047ED33 /* IOSCSIProtocolInterface.h */, + 6DBAFE4613B0D4590047ED33 /* IOSCSIProtocolServices.h */, + 6DBAFE4713B0D4590047ED33 /* IOSCSIReducedBlockCommandsDevice.h */, + 6DBAFE4813B0D4590047ED33 /* SCSICmds_INQUIRY_Definitions.h */, + 6DBAFE4913B0D4590047ED33 /* SCSICmds_MODE_Definitions.h */, + 6DBAFE4A13B0D4590047ED33 /* SCSICmds_READ_CAPACITY_Definitions.h */, + 6DBAFE4B13B0D4590047ED33 /* SCSICmds_REPORT_LUNS_Definitions.h */, + 6DBAFE4C13B0D4590047ED33 /* SCSICmds_REQUEST_SENSE_Defs.h */, + 6DBAFE4D13B0D4590047ED33 /* SCSICommandDefinitions.h */, + 6DBAFE4E13B0D4590047ED33 /* SCSICommandOperationCodes.h */, + 6DBAFE4F13B0D4590047ED33 /* SCSIPort.h */, + 6DBAFE5013B0D4590047ED33 /* SCSITask.h */, + 6DBAFE5113B0D4590047ED33 /* spi */, + ); + path = scsi; + sourceTree = ""; + }; + 6DBAFE5113B0D4590047ED33 /* spi */ = { + isa = PBXGroup; + children = ( + 6DBAFE5213B0D4590047ED33 /* IOSCSIParallelInterfaceController.h */, + ); + path = spi; + sourceTree = ""; + }; + 6DBAFE5313B0D4590047ED33 /* serial */ = { + isa = PBXGroup; + children = ( + 6DBAFE5413B0D4590047ED33 /* IOModemSerialStreamSync.h */, + 6DBAFE5513B0D4590047ED33 /* IORS232SerialStreamSync.h */, + 6DBAFE5613B0D4590047ED33 /* IOSerialDriverSync.h */, + 6DBAFE5713B0D4590047ED33 /* IOSerialKeys.h */, + 6DBAFE5813B0D4590047ED33 /* IOSerialStreamSync.h */, + ); + path = serial; + sourceTree = ""; + }; + 6DBAFE5913B0D4590047ED33 /* storage */ = { + isa = PBXGroup; + children = ( + 6DBAFE5A13B0D4590047ED33 /* ata */, + 6DBAFE5D13B0D4590047ED33 /* IOAppleLabelScheme.h */, + 6DBAFE5E13B0D4590047ED33 /* IOApplePartitionScheme.h */, + 6DBAFE5F13B0D4590047ED33 /* IOBDBlockStorageDevice.h */, + 6DBAFE6013B0D4590047ED33 /* IOBDBlockStorageDriver.h */, + 6DBAFE6113B0D4590047ED33 /* IOBDMedia.h */, + 6DBAFE6213B0D4590047ED33 /* IOBDMediaBSDClient.h */, + 6DBAFE6313B0D4590047ED33 /* IOBDTypes.h */, + 6DBAFE6413B0D4590047ED33 /* IOBlockStorageDevice.h */, + 6DBAFE6513B0D4590047ED33 /* IOBlockStorageDriver.h */, + 6DBAFE6613B0D4590047ED33 /* IOCDBlockStorageDevice.h */, + 6DBAFE6713B0D4590047ED33 /* IOCDBlockStorageDriver.h */, + 6DBAFE6813B0D4590047ED33 /* IOCDMedia.h */, + 6DBAFE6913B0D4590047ED33 /* IOCDMediaBSDClient.h */, + 6DBAFE6A13B0D4590047ED33 /* IOCDPartitionScheme.h */, + 6DBAFE6B13B0D4590047ED33 /* IOCDTypes.h */, + 6DBAFE6C13B0D4590047ED33 /* IODVDBlockStorageDevice.h */, + 6DBAFE6D13B0D4590047ED33 /* IODVDBlockStorageDriver.h */, + 6DBAFE6E13B0D4590047ED33 /* IODVDMedia.h */, + 6DBAFE6F13B0D4590047ED33 /* IODVDMediaBSDClient.h */, + 6DBAFE7013B0D4590047ED33 /* IODVDTypes.h */, + 6DBAFE7113B0D4590047ED33 /* IOFDiskPartitionScheme.h */, + 6DBAFE7213B0D4590047ED33 /* IOFilterScheme.h */, + 6DBAFE7313B0D4590047ED33 /* IOFireWireStorageCharacteristics.h */, + 6DBAFE7413B0D4590047ED33 /* IOGUIDPartitionScheme.h */, + 6DBAFE7513B0D4590047ED33 /* IOMedia.h */, + 6DBAFE7613B0D4590047ED33 /* IOMediaBSDClient.h */, + 6DBAFE7713B0D4590047ED33 /* IOPartitionScheme.h */, + 6DBAFE7813B0D4590047ED33 /* IOStorage.h */, + 6DBAFE7913B0D4590047ED33 /* IOStorageDeviceCharacteristics.h */, + 6DBAFE7A13B0D4590047ED33 /* IOStorageProtocolCharacteristics.h */, + ); + path = storage; + sourceTree = ""; + }; + 6DBAFE5A13B0D4590047ED33 /* ata */ = { + isa = PBXGroup; + children = ( + 6DBAFE5B13B0D4590047ED33 /* IOATAPIProtocolTransport.h */, + 6DBAFE5C13B0D4590047ED33 /* IOATAStorageDefines.h */, + ); + path = ata; + sourceTree = ""; + }; + 6DBAFE7B13B0D4590047ED33 /* stream */ = { + isa = PBXGroup; + children = ( + 6DBAFE7C13B0D4590047ED33 /* IOStream.h */, + 6DBAFE7D13B0D4590047ED33 /* IOStreamFamily.h */, + 6DBAFE7E13B0D4590047ED33 /* IOStreamShared.h */, + 6DBAFE7F13B0D4590047ED33 /* IOStreamUserClient.h */, + ); + path = stream; + sourceTree = ""; + }; + 6DBAFE8113B0D4590047ED33 /* system_management */ = { + isa = PBXGroup; + children = ( + 6DBAFE8213B0D4590047ED33 /* IOWatchDogTimer.h */, + ); + path = system_management; + sourceTree = ""; + }; + 6DBAFE8313B0D4590047ED33 /* usb */ = { + isa = PBXGroup; + children = ( + 6DBAFE8413B0D4590047ED33 /* IOUFIStorageServices.h */, + 6DBAFE8513B0D4590047ED33 /* IOUSBBus.h */, + 6DBAFE8613B0D4590047ED33 /* IOUSBCommand.h */, + 6DBAFE8713B0D4590047ED33 /* IOUSBCompositeDriver.h */, + 6DBAFE8813B0D4590047ED33 /* IOUSBController.h */, + 6DBAFE8913B0D4590047ED33 /* IOUSBControllerListElement.h */, + 6DBAFE8A13B0D4590047ED33 /* IOUSBControllerV2.h */, + 6DBAFE8B13B0D4590047ED33 /* IOUSBControllerV3.h */, + 6DBAFE8C13B0D4590047ED33 /* IOUSBDevice.h */, + 6DBAFE8D13B0D4590047ED33 /* IOUSBHIDDriver.h */, + 6DBAFE8E13B0D4590047ED33 /* IOUSBHubDevice.h */, + 6DBAFE8F13B0D4590047ED33 /* IOUSBHubPolicyMaker.h */, + 6DBAFE9013B0D4590047ED33 /* IOUSBInterface.h */, + 6DBAFE9113B0D4590047ED33 /* IOUSBLog.h */, + 6DBAFE9213B0D4590047ED33 /* IOUSBMassStorageClass.h */, + 6DBAFE9313B0D4590047ED33 /* IOUSBMassStorageUFISubclass.h */, + 6DBAFE9413B0D4590047ED33 /* IOUSBNub.h */, + 6DBAFE9513B0D4590047ED33 /* IOUSBPipe.h */, + 6DBAFE9613B0D4590047ED33 /* IOUSBRootHubDevice.h */, + 6DBAFE9713B0D4590047ED33 /* IOUSBUserClient.h */, + 6DBAFE9813B0D4590047ED33 /* IOUSBWorkLoop.h */, + 6DBAFE9913B0D4590047ED33 /* USB.h */, + 6DBAFE9A13B0D4590047ED33 /* USBHub.h */, + 6DBAFE9B13B0D4590047ED33 /* USBSpec.h */, + 6DBAFE9C13B0D4590047ED33 /* USBTracepoints.h */, + ); + path = usb; + sourceTree = ""; + }; + 6DBAFE9D13B0D4590047ED33 /* libkern */ = { + isa = PBXGroup; + children = ( + 6DBAFE9E13B0D4590047ED33 /* _OSByteOrder.h */, + 6DBAFE9F13B0D4590047ED33 /* crypto */, + 6DBAFEA213B0D4590047ED33 /* i386 */, + 6DBAFEA513B0D4590047ED33 /* machine */, + 6DBAFEA713B0D4590047ED33 /* OSAtomic.h */, + 6DBAFEA813B0D4590047ED33 /* OSByteOrder.h */, + 6DBAFEA913B0D4590047ED33 /* OSCacheControl.h */, + 6DBAFEAA13B0D4590047ED33 /* OSDebug.h */, + 6DBAFEAB13B0D4590047ED33 /* OSKextLib.h */, + 6DBAFEAC13B0D4590047ED33 /* OSReturn.h */, + 6DBAFEAD13B0D4590047ED33 /* OSTypes.h */, + 6DBAFEAE13B0D4590047ED33 /* ppc */, + ); + path = libkern; + sourceTree = ""; + }; + 6DBAFE9F13B0D4590047ED33 /* crypto */ = { + isa = PBXGroup; + children = ( + 6DBAFEA013B0D4590047ED33 /* md5.h */, + 6DBAFEA113B0D4590047ED33 /* sha1.h */, + ); + path = crypto; + sourceTree = ""; + }; + 6DBAFEA213B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFEA313B0D4590047ED33 /* _OSByteOrder.h */, + 6DBAFEA413B0D4590047ED33 /* OSByteOrder.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFEA513B0D4590047ED33 /* machine */ = { + isa = PBXGroup; + children = ( + 6DBAFEA613B0D4590047ED33 /* OSByteOrder.h */, + ); + path = machine; + sourceTree = ""; + }; + 6DBAFEAE13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFEAF13B0D4590047ED33 /* OSByteOrder.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFEB213B0D4590047ED33 /* mach */ = { + isa = PBXGroup; + children = ( + 6DBAFEB313B0D4590047ED33 /* audit_triggers.defs */, + 6DBAFEB413B0D4590047ED33 /* boolean.h */, + 6DBAFEB513B0D4590047ED33 /* bootstrap.h */, + 6DBAFEB613B0D4590047ED33 /* clock.defs */, + 6DBAFEB713B0D4590047ED33 /* clock.h */, + 6DBAFEB813B0D4590047ED33 /* clock_priv.defs */, + 6DBAFEB913B0D4590047ED33 /* clock_priv.h */, + 6DBAFEBA13B0D4590047ED33 /* clock_reply.defs */, + 6DBAFEBB13B0D4590047ED33 /* clock_reply.h */, + 6DBAFEBC13B0D4590047ED33 /* clock_types.defs */, + 6DBAFEBD13B0D4590047ED33 /* clock_types.h */, + 6DBAFEBE13B0D4590047ED33 /* error.h */, + 6DBAFEBF13B0D4590047ED33 /* exc.defs */, + 6DBAFEC013B0D4590047ED33 /* exc.h */, + 6DBAFEC113B0D4590047ED33 /* exception.h */, + 6DBAFEC213B0D4590047ED33 /* exception_types.h */, + 6DBAFEC313B0D4590047ED33 /* host_info.h */, + 6DBAFEC413B0D4590047ED33 /* host_notify.h */, + 6DBAFEC513B0D4590047ED33 /* host_notify_reply.defs */, + 6DBAFEC613B0D4590047ED33 /* host_priv.defs */, + 6DBAFEC713B0D4590047ED33 /* host_priv.h */, + 6DBAFEC813B0D4590047ED33 /* host_reboot.h */, + 6DBAFEC913B0D4590047ED33 /* host_security.defs */, + 6DBAFECA13B0D4590047ED33 /* host_security.h */, + 6DBAFECB13B0D4590047ED33 /* host_special_ports.h */, + 6DBAFECC13B0D4590047ED33 /* i386 */, + 6DBAFEDE13B0D4590047ED33 /* kern_return.h */, + 6DBAFEDF13B0D4590047ED33 /* kmod.h */, + 6DBAFEE013B0D4590047ED33 /* ledger.defs */, + 6DBAFEE113B0D4590047ED33 /* ledger.h */, + 6DBAFEE213B0D4590047ED33 /* lock_set.defs */, + 6DBAFEE313B0D4590047ED33 /* lock_set.h */, + 6DBAFEE413B0D4590047ED33 /* mach.h */, + 6DBAFEE513B0D4590047ED33 /* mach_error.h */, + 6DBAFEE613B0D4590047ED33 /* mach_exc.defs */, + 6DBAFEE713B0D4590047ED33 /* mach_host.defs */, + 6DBAFEE813B0D4590047ED33 /* mach_host.h */, + 6DBAFEE913B0D4590047ED33 /* mach_init.h */, + 6DBAFEEA13B0D4590047ED33 /* mach_interface.h */, + 6DBAFEEB13B0D4590047ED33 /* mach_param.h */, + 6DBAFEEC13B0D4590047ED33 /* mach_port.defs */, + 6DBAFEED13B0D4590047ED33 /* mach_port.h */, + 6DBAFEEE13B0D4590047ED33 /* mach_syscalls.h */, + 6DBAFEEF13B0D4590047ED33 /* mach_time.h */, + 6DBAFEF013B0D4590047ED33 /* mach_traps.h */, + 6DBAFEF113B0D4590047ED33 /* mach_types.defs */, + 6DBAFEF213B0D4590047ED33 /* mach_types.h */, + 6DBAFEF313B0D4590047ED33 /* mach_vm.defs */, + 6DBAFEF413B0D4590047ED33 /* mach_vm.h */, + 6DBAFEF513B0D4590047ED33 /* machine */, + 6DBAFF0413B0D4590047ED33 /* machine.h */, + 6DBAFF0513B0D4590047ED33 /* memory_object_types.h */, + 6DBAFF0613B0D4590047ED33 /* message.h */, + 6DBAFF0713B0D4590047ED33 /* mig.h */, + 6DBAFF0813B0D4590047ED33 /* mig_errors.h */, + 6DBAFF0913B0D4590047ED33 /* ndr.h */, + 6DBAFF0A13B0D4590047ED33 /* notify.defs */, + 6DBAFF0B13B0D4590047ED33 /* notify.h */, + 6DBAFF0C13B0D4590047ED33 /* policy.h */, + 6DBAFF0D13B0D4590047ED33 /* port.h */, + 6DBAFF0E13B0D4590047ED33 /* port_obj.h */, + 6DBAFF0F13B0D4590047ED33 /* ppc */, + 6DBAFF2013B0D4590047ED33 /* processor.defs */, + 6DBAFF2113B0D4590047ED33 /* processor.h */, + 6DBAFF2213B0D4590047ED33 /* processor_info.h */, + 6DBAFF2313B0D4590047ED33 /* processor_set.defs */, + 6DBAFF2413B0D4590047ED33 /* processor_set.h */, + 6DBAFF2513B0D4590047ED33 /* rpc.h */, + 6DBAFF2613B0D4590047ED33 /* sdt.h */, + 6DBAFF2713B0D4590047ED33 /* security.defs */, + 6DBAFF2813B0D4590047ED33 /* semaphore.h */, + 6DBAFF2913B0D4590047ED33 /* shared_memory_server.h */, + 6DBAFF2A13B0D4590047ED33 /* shared_region.h */, + 6DBAFF2B13B0D4590047ED33 /* std_types.defs */, + 6DBAFF2C13B0D4590047ED33 /* std_types.h */, + 6DBAFF2D13B0D4590047ED33 /* sync.h */, + 6DBAFF2E13B0D4590047ED33 /* sync_policy.h */, + 6DBAFF2F13B0D4590047ED33 /* task.defs */, + 6DBAFF3013B0D4590047ED33 /* task.h */, + 6DBAFF3113B0D4590047ED33 /* task_access.defs */, + 6DBAFF3213B0D4590047ED33 /* task_info.h */, + 6DBAFF3313B0D4590047ED33 /* task_ledger.h */, + 6DBAFF3413B0D4590047ED33 /* task_policy.h */, + 6DBAFF3513B0D4590047ED33 /* task_special_ports.h */, + 6DBAFF3613B0D4590047ED33 /* thread_act.defs */, + 6DBAFF3713B0D4590047ED33 /* thread_act.h */, + 6DBAFF3813B0D4590047ED33 /* thread_info.h */, + 6DBAFF3913B0D4590047ED33 /* thread_policy.h */, + 6DBAFF3A13B0D4590047ED33 /* thread_special_ports.h */, + 6DBAFF3B13B0D4590047ED33 /* thread_status.h */, + 6DBAFF3C13B0D4590047ED33 /* thread_switch.h */, + 6DBAFF3D13B0D4590047ED33 /* time_value.h */, + 6DBAFF3E13B0D4590047ED33 /* vm_attributes.h */, + 6DBAFF3F13B0D4590047ED33 /* vm_behavior.h */, + 6DBAFF4013B0D4590047ED33 /* vm_inherit.h */, + 6DBAFF4113B0D4590047ED33 /* vm_map.defs */, + 6DBAFF4213B0D4590047ED33 /* vm_map.h */, + 6DBAFF4313B0D4590047ED33 /* vm_param.h */, + 6DBAFF4413B0D4590047ED33 /* vm_prot.h */, + 6DBAFF4513B0D4590047ED33 /* vm_purgable.h */, + 6DBAFF4613B0D4590047ED33 /* vm_region.h */, + 6DBAFF4713B0D4590047ED33 /* vm_statistics.h */, + 6DBAFF4813B0D4590047ED33 /* vm_sync.h */, + 6DBAFF4913B0D4590047ED33 /* vm_task.h */, + 6DBAFF4A13B0D4590047ED33 /* vm_types.h */, + 6DBAFF4B13B0D4590047ED33 /* x86_64 */, + ); + path = mach; + sourceTree = ""; + }; + 6DBAFECC13B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFECD13B0D4590047ED33 /* _structs.h */, + 6DBAFECE13B0D4590047ED33 /* asm.h */, + 6DBAFECF13B0D4590047ED33 /* boolean.h */, + 6DBAFED013B0D4590047ED33 /* exception.h */, + 6DBAFED113B0D4590047ED33 /* fp_reg.h */, + 6DBAFED213B0D4590047ED33 /* kern_return.h */, + 6DBAFED313B0D4590047ED33 /* machine_types.defs */, + 6DBAFED413B0D4590047ED33 /* ndr_def.h */, + 6DBAFED513B0D4590047ED33 /* processor_info.h */, + 6DBAFED613B0D4590047ED33 /* rpc.h */, + 6DBAFED713B0D4590047ED33 /* sdt_isa.h */, + 6DBAFED813B0D4590047ED33 /* task.h */, + 6DBAFED913B0D4590047ED33 /* thread_act.h */, + 6DBAFEDA13B0D4590047ED33 /* thread_state.h */, + 6DBAFEDB13B0D4590047ED33 /* thread_status.h */, + 6DBAFEDC13B0D4590047ED33 /* vm_param.h */, + 6DBAFEDD13B0D4590047ED33 /* vm_types.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFEF513B0D4590047ED33 /* machine */ = { + isa = PBXGroup; + children = ( + 6DBAFEF613B0D4590047ED33 /* asm.h */, + 6DBAFEF713B0D4590047ED33 /* boolean.h */, + 6DBAFEF813B0D4590047ED33 /* exception.h */, + 6DBAFEF913B0D4590047ED33 /* kern_return.h */, + 6DBAFEFA13B0D4590047ED33 /* machine_types.defs */, + 6DBAFEFB13B0D4590047ED33 /* ndr_def.h */, + 6DBAFEFC13B0D4590047ED33 /* processor_info.h */, + 6DBAFEFD13B0D4590047ED33 /* rpc.h */, + 6DBAFEFE13B0D4590047ED33 /* sdt.h */, + 6DBAFEFF13B0D4590047ED33 /* sdt_isa.h */, + 6DBAFF0013B0D4590047ED33 /* thread_state.h */, + 6DBAFF0113B0D4590047ED33 /* thread_status.h */, + 6DBAFF0213B0D4590047ED33 /* vm_param.h */, + 6DBAFF0313B0D4590047ED33 /* vm_types.h */, + ); + path = machine; + sourceTree = ""; + }; + 6DBAFF0F13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFF1013B0D4590047ED33 /* _structs.h */, + 6DBAFF1113B0D4590047ED33 /* asm.h */, + 6DBAFF1213B0D4590047ED33 /* boolean.h */, + 6DBAFF1313B0D4590047ED33 /* exception.h */, + 6DBAFF1413B0D4590047ED33 /* kern_return.h */, + 6DBAFF1513B0D4590047ED33 /* machine_types.defs */, + 6DBAFF1613B0D4590047ED33 /* ndr_def.h */, + 6DBAFF1713B0D4590047ED33 /* processor_info.h */, + 6DBAFF1813B0D4590047ED33 /* rpc.h */, + 6DBAFF1913B0D4590047ED33 /* sdt_isa.h */, + 6DBAFF1A13B0D4590047ED33 /* task.h */, + 6DBAFF1B13B0D4590047ED33 /* thread_act.h */, + 6DBAFF1C13B0D4590047ED33 /* thread_state.h */, + 6DBAFF1D13B0D4590047ED33 /* thread_status.h */, + 6DBAFF1E13B0D4590047ED33 /* vm_param.h */, + 6DBAFF1F13B0D4590047ED33 /* vm_types.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFF4B13B0D4590047ED33 /* x86_64 */ = { + isa = PBXGroup; + children = ( + 6DBAFF4C13B0D4590047ED33 /* task.h */, + 6DBAFF4D13B0D4590047ED33 /* thread_act.h */, + ); + path = x86_64; + sourceTree = ""; + }; + 6DBAFF4E13B0D4590047ED33 /* mach-o */ = { + isa = PBXGroup; + children = ( + 6DBAFF4F13B0D4590047ED33 /* arch.h */, + 6DBAFF5013B0D4590047ED33 /* compact_unwind_encoding.h */, + 6DBAFF5113B0D4590047ED33 /* dyld.h */, + 6DBAFF5213B0D4590047ED33 /* dyld_images.h */, + 6DBAFF5313B0D4590047ED33 /* fat.h */, + 6DBAFF5413B0D4590047ED33 /* getsect.h */, + 6DBAFF5513B0D4590047ED33 /* i386 */, + 6DBAFF5713B0D4590047ED33 /* ldsyms.h */, + 6DBAFF5813B0D4590047ED33 /* loader.h */, + 6DBAFF5913B0D4590047ED33 /* nlist.h */, + 6DBAFF5A13B0D4590047ED33 /* ppc */, + 6DBAFF5D13B0D4590047ED33 /* ranlib.h */, + 6DBAFF5E13B0D4590047ED33 /* reloc.h */, + 6DBAFF5F13B0D4590047ED33 /* stab.h */, + 6DBAFF6013B0D4590047ED33 /* swap.h */, + 6DBAFF6113B0D4590047ED33 /* x86_64 */, + ); + path = "mach-o"; + sourceTree = ""; + }; + 6DBAFF5513B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFF5613B0D4590047ED33 /* swap.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFF5A13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFF5B13B0D4590047ED33 /* reloc.h */, + 6DBAFF5C13B0D4590047ED33 /* swap.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFF6113B0D4590047ED33 /* x86_64 */ = { + isa = PBXGroup; + children = ( + 6DBAFF6213B0D4590047ED33 /* reloc.h */, + ); + path = x86_64; + sourceTree = ""; + }; + 6DBAFF6313B0D4590047ED33 /* machine */ = { + isa = PBXGroup; + children = ( + 6DBAFF6413B0D4590047ED33 /* _limits.h */, + 6DBAFF6513B0D4590047ED33 /* _param.h */, + 6DBAFF6613B0D4590047ED33 /* _structs.h */, + 6DBAFF6713B0D4590047ED33 /* _types.h */, + 6DBAFF6813B0D4590047ED33 /* byte_order.h */, + 6DBAFF6913B0D4590047ED33 /* endian.h */, + 6DBAFF6A13B0D4590047ED33 /* fasttrap_isa.h */, + 6DBAFF6B13B0D4590047ED33 /* limits.h */, + 6DBAFF6C13B0D4590047ED33 /* param.h */, + 6DBAFF6D13B0D4590047ED33 /* profile.h */, + 6DBAFF6E13B0D4590047ED33 /* setjmp.h */, + 6DBAFF6F13B0D4590047ED33 /* signal.h */, + 6DBAFF7013B0D4590047ED33 /* types.h */, + 6DBAFF7113B0D4590047ED33 /* vmparam.h */, + ); + path = machine; + sourceTree = ""; + }; + 6DBAFF7313B0D4590047ED33 /* netinet */ = { + isa = PBXGroup; + children = ( + 6DBAFF7413B0D4590047ED33 /* bootp.h */, + 6DBAFF7513B0D4590047ED33 /* icmp6.h */, + 6DBAFF7613B0D4590047ED33 /* icmp_var.h */, + 6DBAFF7713B0D4590047ED33 /* if_ether.h */, + 6DBAFF7813B0D4590047ED33 /* igmp.h */, + 6DBAFF7913B0D4590047ED33 /* igmp_var.h */, + 6DBAFF7A13B0D4590047ED33 /* in.h */, + 6DBAFF7B13B0D4590047ED33 /* in_pcb.h */, + 6DBAFF7C13B0D4590047ED33 /* in_systm.h */, + 6DBAFF7D13B0D4590047ED33 /* in_var.h */, + 6DBAFF7E13B0D4590047ED33 /* ip.h */, + 6DBAFF7F13B0D4590047ED33 /* ip6.h */, + 6DBAFF8013B0D4590047ED33 /* ip_fw.h */, + 6DBAFF8113B0D4590047ED33 /* ip_fw2.h */, + 6DBAFF8213B0D4590047ED33 /* ip_icmp.h */, + 6DBAFF8313B0D4590047ED33 /* ip_mroute.h */, + 6DBAFF8413B0D4590047ED33 /* ip_var.h */, + 6DBAFF8513B0D4590047ED33 /* tcp.h */, + 6DBAFF8613B0D4590047ED33 /* tcp_fsm.h */, + 6DBAFF8713B0D4590047ED33 /* tcp_seq.h */, + 6DBAFF8813B0D4590047ED33 /* tcp_timer.h */, + 6DBAFF8913B0D4590047ED33 /* tcp_var.h */, + 6DBAFF8A13B0D4590047ED33 /* tcpip.h */, + 6DBAFF8B13B0D4590047ED33 /* udp.h */, + 6DBAFF8C13B0D4590047ED33 /* udp_var.h */, + ); + path = netinet; + sourceTree = ""; + }; + 6DBAFF8D13B0D4590047ED33 /* netinet6 */ = { + isa = PBXGroup; + children = ( + 6DBAFF8E13B0D4590047ED33 /* ah.h */, + 6DBAFF8F13B0D4590047ED33 /* esp.h */, + 6DBAFF9013B0D4590047ED33 /* in6.h */, + 6DBAFF9113B0D4590047ED33 /* in6_var.h */, + 6DBAFF9213B0D4590047ED33 /* ip6_fw.h */, + 6DBAFF9313B0D4590047ED33 /* ip6_mroute.h */, + 6DBAFF9413B0D4590047ED33 /* ipcomp.h */, + 6DBAFF9513B0D4590047ED33 /* ipsec.h */, + 6DBAFF9613B0D4590047ED33 /* nd6.h */, + 6DBAFF9713B0D4590047ED33 /* pim6.h */, + 6DBAFF9813B0D4590047ED33 /* raw_ip6.h */, + ); + path = netinet6; + sourceTree = ""; + }; + 6DBAFF9A13B0D4590047ED33 /* secure */ = { + isa = PBXGroup; + children = ( + 6DBAFF9B13B0D4590047ED33 /* _common.h */, + 6DBAFF9C13B0D4590047ED33 /* _stdio.h */, + ); + path = secure; + sourceTree = ""; + }; + 6DBAFFA613B0D4590047ED33 /* sys */ = { + isa = PBXGroup; + children = ( + 6DBAFFA713B0D4590047ED33 /* _endian.h */, + 6DBAFFA813B0D4590047ED33 /* _select.h */, + 6DBAFFA913B0D4590047ED33 /* _structs.h */, + 6DBAFFAA13B0D4590047ED33 /* _types.h */, + 6DBAFFAB13B0D4590047ED33 /* appleapiopts.h */, + 6DBAFFAC13B0D4590047ED33 /* buf.h */, + 6DBAFFAD13B0D4590047ED33 /* cdefs.h */, + 6DBAFFAE13B0D4590047ED33 /* disk.h */, + 6DBAFFAF13B0D4590047ED33 /* kernel_types.h */, + 6DBAFFB013B0D4590047ED33 /* param.h */, + 6DBAFFB113B0D4590047ED33 /* reboot.h */, + 6DBAFFB213B0D4590047ED33 /* select.h */, + 6DBAFFB313B0D4590047ED33 /* socket.h */, + 6DBAFFB413B0D4590047ED33 /* syscall.h */, + 6DBAFFB513B0D4590047ED33 /* syslimits.h */, + 6DBAFFB613B0D4590047ED33 /* time.h */, + 6DBAFFB713B0D4590047ED33 /* types.h */, + 6DBAFFB813B0D4590047ED33 /* unistd.h */, + ); + path = sys; + sourceTree = ""; + }; + 6DBAFFBA13B0D4590047ED33 /* ufs */ = { + isa = PBXGroup; + children = ( + 6DBAFFBB13B0D4590047ED33 /* ffs */, + 6DBAFFBE13B0D4590047ED33 /* ufs */, + ); + path = ufs; + sourceTree = ""; + }; + 6DBAFFBB13B0D4590047ED33 /* ffs */ = { + isa = PBXGroup; + children = ( + 6DBAFFBC13B0D4590047ED33 /* ffs_extern.h */, + 6DBAFFBD13B0D4590047ED33 /* fs.h */, + ); + path = ffs; + sourceTree = ""; + }; + 6DBAFFBE13B0D4590047ED33 /* ufs */ = { + isa = PBXGroup; + children = ( + 6DBAFFBF13B0D4590047ED33 /* dinode.h */, + 6DBAFFC013B0D4590047ED33 /* dir.h */, + 6DBAFFC113B0D4590047ED33 /* inode.h */, + 6DBAFFC213B0D4590047ED33 /* ufs_extern.h */, + 6DBAFFC313B0D4590047ED33 /* ufsmount.h */, + ); + path = ufs; + sourceTree = ""; + }; + A354B6261495124F00D81AA5 /* Main */ = { + isa = PBXGroup; + children = ( + A354B6271495124F00D81AA5 /* ESPpostinstall */, + A354B62A1495124F00D81AA5 /* Standardpostinstall */, + ); + path = Main; + sourceTree = ""; + }; + A354B62B149514DE00D81AA5 /* Sub */ = { + isa = PBXGroup; + children = ( + A354B62C149514DE00D81AA5 /* CheckDiskMicrocode.sh */, + A354B62D149514DE00D81AA5 /* CheckFatType.sh */, + A354B62E149514DE00D81AA5 /* CheckGRUBLinuxLoader.sh */, + A354B62F149514DE00D81AA5 /* CheckPartitionScheme.sh */, + A354B630149514DE00D81AA5 /* CheckPreviousChameleon.sh */, + A354B631149514DE00D81AA5 /* CheckProceed.sh */, + A354B632149514DE00D81AA5 /* CheckWindowsDiskSignature.sh */, + A354B634149514DE00D81AA5 /* MountESP.sh */, + A354B635149514DE00D81AA5 /* patch */, + A354B636149514DE00D81AA5 /* SetActivePartition.sh */, + A354B637149514DE00D81AA5 /* UnMountEFIvolumes.sh */, + A354B638149514DE00D81AA5 /* WriteChameleonStage0.sh */, + A354B639149514DE00D81AA5 /* WriteChameleonStage1.sh */, + A354B63A149514DE00D81AA5 /* WriteChameleonStage2.sh */, + ); + path = Sub; + sourceTree = ""; + }; + A3561C721413FD7800E9B51E /* fdisk */ = { + isa = PBXGroup; + children = ( + A3561C731413FD7800E9B51E /* auto.c */, + A3561C741413FD7800E9B51E /* auto.h */, + A3561C751413FD7800E9B51E /* Cconfig */, + A3561C761413FD7800E9B51E /* cmd.c */, + A3561C771413FD7800E9B51E /* cmd.h */, + A3561C781413FD7800E9B51E /* disk.c */, + A3561C791413FD7800E9B51E /* disk.h */, + A3561C7A1413FD7800E9B51E /* fdisk.8 */, + A3561C7B1413FD7800E9B51E /* fdisk.c */, + A3561C7C1413FD7800E9B51E /* getrawpartition.c */, + A3561C7D1413FD7800E9B51E /* Makefile */, + A3561C7E1413FD7800E9B51E /* mbr.c */, + A3561C7F1413FD7800E9B51E /* mbr.h */, + A3561C801413FD7800E9B51E /* mbrcode.h */, + A3561C811413FD7800E9B51E /* misc.c */, + A3561C821413FD7800E9B51E /* misc.h */, + A3561C831413FD7800E9B51E /* opendev.c */, + A3561C841413FD7800E9B51E /* part.c */, + A3561C851413FD7800E9B51E /* part.h */, + A3561C861413FD7800E9B51E /* user.c */, + A3561C871413FD7800E9B51E /* user.h */, + A3561C881413FD7800E9B51E /* util.h */, + ); + path = fdisk; + sourceTree = ""; + }; + A3561CAB1414024C00E9B51E /* modules */ = { + isa = PBXGroup; + children = ( + AB4DDA8C15CEFF2100E77157 /* AcpiCodec */, + A3561CAC1414024C00E9B51E /* Cconfig */, + A3561CAD1414024C00E9B51E /* HelloWorld */, + A3561CB21414024C00E9B51E /* include */, + A3561CB41414024C00E9B51E /* Keylayout */, + A3561CB71414024D00E9B51E /* klibc */, + A3561D011414024D00E9B51E /* Makefile */, + A3561D021414024D00E9B51E /* MakeInc.dir */, + A3561D031414024D00E9B51E /* Modules.txt */, + A3561D041414024D00E9B51E /* Resolution */, + AB1DE71715B6E2D00088E06B /* Sata */, + A3561D0F1414024D00E9B51E /* uClibcxx */, + ); + path = modules; + sourceTree = ""; + }; + A3561CAD1414024C00E9B51E /* HelloWorld */ = { + isa = PBXGroup; + children = ( + A3561CAE1414024C00E9B51E /* Cconfig */, + A3561CAF1414024C00E9B51E /* HelloWorld.cpp */, + A3561CB01414024C00E9B51E /* include */, + A3561CB11414024C00E9B51E /* Makefile */, + ); + path = HelloWorld; + sourceTree = ""; + }; + A3561CB01414024C00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + ); + path = include; + sourceTree = ""; + }; + A3561CB21414024C00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + A3561CB31414024C00E9B51E /* modules */, + ); + path = include; + sourceTree = ""; + }; + A3561CB41414024C00E9B51E /* Keylayout */ = { + isa = PBXGroup; + children = ( + A3F1F267141B9B3B00DDA709 /* Readme.txt */, + A35D216E141A73B000969AC0 /* layouts */, + A3561DA81414296600E9B51E /* Cconfig */, + A3561DA61414296600E9B51E /* Keylayout.c */, + A3561DA71414296600E9B51E /* Makefile */, + ); + path = Keylayout; + sourceTree = ""; + }; + A3561CB71414024D00E9B51E /* klibc */ = { + isa = PBXGroup; + children = ( + A3561CB81414024D00E9B51E /* __ashldi3.c */, + A3561CB91414024D00E9B51E /* __ashrdi3.c */, + A3561CBA1414024D00E9B51E /* __clzsi2.c */, + A3561CBB1414024D00E9B51E /* __divdi3.c */, + A3561CBC1414024D00E9B51E /* __divsi3.c */, + A3561CBD1414024D00E9B51E /* __lshrdi3.c */, + A3561CBE1414024D00E9B51E /* __moddi3.c */, + A3561CBF1414024D00E9B51E /* __modsi3.c */, + A3561CC01414024D00E9B51E /* __udivdi3.c */, + A3561CC11414024D00E9B51E /* __udivmoddi4.c */, + A3561CC21414024D00E9B51E /* __udivmodsi4.c */, + A3561CC31414024D00E9B51E /* __udivsi3.c */, + A3561CC41414024D00E9B51E /* __umoddi3.c */, + A3561CC51414024D00E9B51E /* __umodsi3.c */, + A3561CC61414024D00E9B51E /* atexit.c */, + A3561CC71414024D00E9B51E /* atexit.h */, + A3561CC81414024D00E9B51E /* atoi.c */, + A3561CC91414024D00E9B51E /* atol.c */, + A3561CCA1414024D00E9B51E /* atoll.c */, + A3561CCB1414024D00E9B51E /* atox.c */, + A3561CCC1414024D00E9B51E /* bsearch.c */, + A3561CCD1414024D00E9B51E /* calloc.c */, + A3561CCE1414024D00E9B51E /* Cconfig */, + A3561CCF1414024D00E9B51E /* exit.c */, + A3561CD01414024D00E9B51E /* jrand48.c */, + A3561CD11414024D00E9B51E /* klibc.c */, + A3561CD21414024D00E9B51E /* LICENSE */, + A3561CD31414024D00E9B51E /* limits.h */, + A3561CD41414024D00E9B51E /* lrand48.c */, + A3561CD51414024D00E9B51E /* Makefile */, + A3561CD61414024D00E9B51E /* memccpy.c */, + A3561CD71414024D00E9B51E /* memchr.c */, + A3561CD81414024D00E9B51E /* memmem.c */, + A3561CD91414024D00E9B51E /* memmove.c */, + A3561CDA1414024D00E9B51E /* memrchr.c */, + A3561CDB1414024D00E9B51E /* memswap.c */, + A3561CDC1414024D00E9B51E /* mrand48.c */, + A3561CDD1414024D00E9B51E /* nrand48.c */, + A3561CDE1414024D00E9B51E /* onexit.c */, + A3561CDF1414024D00E9B51E /* qsort.c */, + A3561CE01414024D00E9B51E /* Readme.txt */, + A3561CE11414024D00E9B51E /* seed48.c */, + A3561CE21414024D00E9B51E /* sha1hash.c */, + A3561CE31414024D00E9B51E /* snprintf.c */, + A3561CE41414024D00E9B51E /* srand48.c */, + A3561CE51414024D00E9B51E /* sscanf.c */, + A3561CE61414024D00E9B51E /* strcasecmp.c */, + A3561CE71414024D00E9B51E /* strdup.c */, + A3561CE81414024D00E9B51E /* strlcat.c */, + A3561CE91414024D00E9B51E /* strncasecmp.c */, + A3561CEA1414024D00E9B51E /* strndup.c */, + A3561CEB1414024D00E9B51E /* strnlen.c */, + A3561CEC1414024D00E9B51E /* strntoimax.c */, + A3561CED1414024D00E9B51E /* strntoumax.c */, + A3561CEE1414024D00E9B51E /* strpbrk.c */, + A3561CEF1414024D00E9B51E /* strsep.c */, + A3561CF01414024D00E9B51E /* strtoimax.c */, + A3561CF11414024D00E9B51E /* strtok.c */, + A3561CF21414024D00E9B51E /* strtok_r.c */, + A3561CF31414024D00E9B51E /* strtol.c */, + A3561CF41414024D00E9B51E /* strtoll.c */, + A3561CF51414024D00E9B51E /* strtotimespec.c */, + A3561CF61414024D00E9B51E /* strtotimeval.c */, + A3561CF71414024D00E9B51E /* strtotimex.c */, + A3561CF81414024D00E9B51E /* strtoul.c */, + A3561CF91414024D00E9B51E /* strtoull.c */, + A3561CFA1414024D00E9B51E /* strtoumax.c */, + A3561CFB1414024D00E9B51E /* strtox.c */, + A3561CFC1414024D00E9B51E /* strxspn.c */, + A3561CFD1414024D00E9B51E /* strxspn.h */, + A3561CFE1414024D00E9B51E /* version */, + A3561CFF1414024D00E9B51E /* vsnprintf.c */, + A3561D001414024D00E9B51E /* vsscanf.c */, + ); + path = klibc; + sourceTree = ""; + }; + A3561D041414024D00E9B51E /* Resolution */ = { + isa = PBXGroup; + children = ( + A3561D051414024D00E9B51E /* 915resolution.c */, + A3561D061414024D00E9B51E /* 915resolution.h */, + A3561D071414024D00E9B51E /* Cconfig */, + A3561D081414024D00E9B51E /* edid.c */, + A3561D091414024D00E9B51E /* include */, + A3561D0B1414024D00E9B51E /* Makefile */, + A3561D0C1414024D00E9B51E /* Readme.txt */, + A3561D0D1414024D00E9B51E /* Resolution.c */, + A3561D0E1414024D00E9B51E /* shortatombios.h */, + ); + path = Resolution; + sourceTree = ""; + }; + A3561D091414024D00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + A3561D0A1414024D00E9B51E /* edid.h */, + ); + path = include; + sourceTree = ""; + }; + A3561D0F1414024D00E9B51E /* uClibcxx */ = { + isa = PBXGroup; + children = ( + A3561D101414024D00E9B51E /* abi.cpp */, + A3561D111414024D00E9B51E /* algorithm.cpp */, + A3561D121414024D00E9B51E /* associative_base.cpp */, + A3561D131414024D00E9B51E /* bitset.cpp */, + A3561D141414024D00E9B51E /* Cconfig */, + A3561D151414024D00E9B51E /* char_traits.cpp */, + A3561D161414024D00E9B51E /* complex.cpp */, + A3561D171414024D00E9B51E /* del_op.cpp */, + A3561D181414024D00E9B51E /* del_opnt.cpp */, + A3561D191414024D00E9B51E /* del_opv.cpp */, + A3561D1A1414024D00E9B51E /* del_opvnt.cpp */, + A3561D1B1414024D00E9B51E /* deque.cpp */, + A3561D1C1414024D00E9B51E /* eh_alloc.cpp */, + A3561D1D1414024D00E9B51E /* eh_globals.cpp */, + A3561D1E1414024D00E9B51E /* exception.cpp */, + A3561D1F1414024D00E9B51E /* fstream.cpp */, + A3561D201414024D00E9B51E /* func_exception.cpp */, + A3561D211414024D00E9B51E /* include */, + A3561D631414024D00E9B51E /* iomanip.cpp */, + A3561D641414024D00E9B51E /* ios.cpp */, + A3561D651414024D00E9B51E /* iostream.cpp */, + A3561D661414024D00E9B51E /* istream.cpp */, + A3561D671414024D00E9B51E /* iterator.cpp */, + A3561D681414024D00E9B51E /* limits.cpp */, + A3561D691414024D00E9B51E /* list.cpp */, + A3561D6A1414024D00E9B51E /* locale.cpp */, + A3561D6B1414024D00E9B51E /* Makefile */, + A3561D6C1414024D00E9B51E /* map.cpp */, + A3561D6D1414024D00E9B51E /* new_handler.cpp */, + A3561D6E1414024D00E9B51E /* new_op.cpp */, + A3561D6F1414024D00E9B51E /* new_opnt.cpp */, + A3561D701414024D00E9B51E /* new_opv.cpp */, + A3561D711414024D00E9B51E /* new_opvnt.cpp */, + A3561D721414024D00E9B51E /* numeric.cpp */, + A3561D731414024D00E9B51E /* ostream.cpp */, + A3561D741414024D00E9B51E /* queue.cpp */, + A3561D751414024D00E9B51E /* Readme.txt */, + A3561D761414024D00E9B51E /* set.cpp */, + A3561D771414024D00E9B51E /* sstream.cpp */, + A3561D781414024D00E9B51E /* stack.cpp */, + A3561D791414024D00E9B51E /* stdexcept.cpp */, + A3561D7A1414024D00E9B51E /* streambuf.cpp */, + A3561D7B1414024D00E9B51E /* string.cpp */, + A3561D7C1414024D00E9B51E /* support.cpp */, + A3561D7D1414024D00E9B51E /* typeinfo.cpp */, + A3561D7E1414024D00E9B51E /* uClibc++.c */, + A3561D7F1414024D00E9B51E /* utility.cpp */, + A3561D801414024D00E9B51E /* valarray.cpp */, + A3561D811414024D00E9B51E /* vector.cpp */, + ); + path = uClibcxx; + sourceTree = ""; + }; + A3561D211414024D00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + A3561D221414024D00E9B51E /* algorithm */, + A3561D231414024D00E9B51E /* associative_base */, + A3561D241414024D00E9B51E /* basic_definitions */, + A3561D251414024D00E9B51E /* bitset */, + A3561D261414024D00E9B51E /* cassert */, + A3561D271414024D00E9B51E /* cctype */, + A3561D281414024D00E9B51E /* cerrno */, + A3561D291414024D00E9B51E /* cfloat */, + A3561D2A1414024D00E9B51E /* char_traits */, + A3561D2B1414024D00E9B51E /* climits */, + A3561D2C1414024D00E9B51E /* clocale */, + A3561D2D1414024D00E9B51E /* cmath */, + A3561D2E1414024D00E9B51E /* complex */, + A3561D2F1414024D00E9B51E /* csetjmp */, + A3561D301414024D00E9B51E /* csignal */, + A3561D311414024D00E9B51E /* cstdarg */, + A3561D321414024D00E9B51E /* cstddef */, + A3561D331414024D00E9B51E /* cstdio */, + A3561D341414024D00E9B51E /* cstdlib */, + A3561D351414024D00E9B51E /* cstring */, + A3561D361414024D00E9B51E /* ctime */, + A3561D371414024D00E9B51E /* cwchar */, + A3561D381414024D00E9B51E /* cwctype */, + A3561D391414024D00E9B51E /* deque */, + A3561D3A1414024D00E9B51E /* exception */, + A3561D3B1414024D00E9B51E /* fstream */, + A3561D3C1414024D00E9B51E /* func_exception */, + A3561D3D1414024D00E9B51E /* functional */, + A3561D3E1414024D00E9B51E /* iomanip */, + A3561D3F1414024D00E9B51E /* ios */, + A3561D401414024D00E9B51E /* iosfwd */, + A3561D411414024D00E9B51E /* iostream */, + A3561D421414024D00E9B51E /* istream */, + A3561D431414024D00E9B51E /* istream_helpers */, + A3561D441414024D00E9B51E /* iterator */, + A3561D451414024D00E9B51E /* iterator_base */, + A3561D461414024D00E9B51E /* limits */, + A3561D471414024D00E9B51E /* list */, + A3561D481414024D00E9B51E /* locale */, + A3561D491414024D00E9B51E /* Makefile */, + A3561D4A1414024D00E9B51E /* map */, + A3561D4B1414024D00E9B51E /* map.old */, + A3561D4C1414024D00E9B51E /* memory */, + A3561D4D1414024D00E9B51E /* new */, + A3561D4E1414024D00E9B51E /* numeric */, + A3561D4F1414024D00E9B51E /* ostream */, + A3561D501414024D00E9B51E /* ostream_helpers */, + A3561D511414024D00E9B51E /* queue */, + A3561D521414024D00E9B51E /* set */, + A3561D531414024D00E9B51E /* set.old */, + A3561D541414024D00E9B51E /* sstream */, + A3561D551414024D00E9B51E /* stack */, + A3561D561414024D00E9B51E /* stdexcept */, + A3561D571414024D00E9B51E /* streambuf */, + A3561D581414024D00E9B51E /* string */, + A3561D591414024D00E9B51E /* string_iostream */, + A3561D5A1414024D00E9B51E /* support */, + A3561D5B1414024D00E9B51E /* system_configuration.h */, + A3561D5C1414024D00E9B51E /* type_traits */, + A3561D5D1414024D00E9B51E /* typeinfo */, + A3561D5E1414024D00E9B51E /* types */, + A3561D5F1414024D00E9B51E /* unwind-cxx.h */, + A3561D601414024D00E9B51E /* utility */, + A3561D611414024D00E9B51E /* valarray */, + A3561D621414024D00E9B51E /* vector */, + ); + path = include; + sourceTree = ""; + }; + A35D216E141A73B000969AC0 /* layouts */ = { + isa = PBXGroup; + children = ( + A35D216F141A73B000969AC0 /* cham-mklayout.c */, + A35D2170141A73B000969AC0 /* layouts-src */, + A35D2177141A73B000969AC0 /* Makefile */, + ); + path = layouts; + sourceTree = ""; + }; + A35D2170141A73B000969AC0 /* layouts-src */ = { + isa = PBXGroup; + children = ( + A35D2178141A753E00969AC0 /* README */, + A35D2171141A73B000969AC0 /* mac-de.slt */, + A35D2172141A73B000969AC0 /* mac-es.slt */, + A35D2173141A73B000969AC0 /* mac-fr.slt */, + A35D2174141A73B000969AC0 /* mac-it.slt */, + A35D2175141A73B000969AC0 /* mac-se.slt */, + A35D2176141A73B000969AC0 /* pc-fr.slt */, + ); + path = "layouts-src"; + sourceTree = ""; + }; + A396E2CA150247630025A245 /* Resources */ = { + isa = PBXGroup; + children = ( + A396E2CB150247630025A245 /* common */, + A396E2CD150247630025A245 /* distribution */, + A396E2CF150247630025A245 /* templates */, + ); + path = Resources; + sourceTree = ""; + }; + A396E2CB150247630025A245 /* common */ = { + isa = PBXGroup; + children = ( + A396E2CC150247630025A245 /* License.rtf */, + ); + path = common; + sourceTree = ""; + }; + A396E2CD150247630025A245 /* distribution */ = { + isa = PBXGroup; + children = ( + A396E2CE150247630025A245 /* background.tiff */, + ); + path = distribution; + sourceTree = ""; + }; + A396E2CF150247630025A245 /* templates */ = { + isa = PBXGroup; + children = ( + A396E35915028C9C0025A245 /* Welcome.html */, + A396E2D1150247630025A245 /* Description.html */, + A396E5821502D3320025A245 /* Conclusion.html */, + A396E2D2150247630025A245 /* Localizable.strings */, + ); + path = templates; + sourceTree = ""; + }; + A396E4F31502D0580025A245 /* Resources.old */ = { + isa = PBXGroup; + children = ( + A396E4F41502D0580025A245 /* Conclusion.rtfd */, + A396E4F61502D0580025A245 /* Description.html */, + A396E4F81502D0580025A245 /* License.rtf */, + A396E4FA1502D0580025A245 /* Localizable.strings */, + A396E4FC1502D0580025A245 /* Welcome.rtfd */, + A396E4FE1502D0580025A245 /* background.tiff */, + ); + path = Resources.old; + sourceTree = ""; + }; + A3F1F20D141B9B0D00DDA709 /* Scripts */ = { + isa = PBXGroup; + children = ( + A354B6261495124F00D81AA5 /* Main */, + A354B62B149514DE00D81AA5 /* Sub */, + ); + path = Scripts; + sourceTree = ""; + }; + AB1DE71715B6E2D00088E06B /* Sata */ = { + isa = PBXGroup; + children = ( + AB1DE71815B6E2D00088E06B /* Cconfig */, + AB1DE71915B6E2D00088E06B /* include */, + AB1DE71A15B6E2D00088E06B /* Makefile */, + AB1DE71B15B6E2D00088E06B /* Sata.c */, + ); + path = Sata; + sourceTree = ""; + }; + AB1DE71915B6E2D00088E06B /* include */ = { + isa = PBXGroup; + children = ( + ); + path = include; + sourceTree = ""; + }; + AB30C92D15DE60ED0047BE7B /* bin */ = { + isa = PBXGroup; + children = ( + AB30C92E15DE60ED0047BE7B /* ld_classic */, + AB30C92F15DE60ED0047BE7B /* ld_classic.1 */, + ); + path = bin; + sourceTree = ""; + }; + AB30C93115DE66D90047BE7B /* md */ = { + isa = PBXGroup; + children = ( + AB30C93215DE66D90047BE7B /* Cconfig */, + AB30C93315DE66D90047BE7B /* Makefile */, + AB30C93415DE66D90047BE7B /* md.1 */, + AB30C93515DE66D90047BE7B /* md.c */, + ); + path = md; + sourceTree = ""; + }; + AB4DDA8C15CEFF2100E77157 /* AcpiCodec */ = { + isa = PBXGroup; + children = ( + AB4DDA8D15CEFF2100E77157 /* acpi_codec.c */, + AB4DDA8E15CEFF2100E77157 /* acpi_tools.c */, + AB4DDA8F15CEFF2100E77157 /* acpicode.c */, + AB4DDA9015CEFF2100E77157 /* ACPICodec.c */, + AB4DDA9115CEFF2100E77157 /* acpidecode.c */, + AB4DDA9215CEFF2100E77157 /* Cconfig */, + AB4DDA9315CEFF2100E77157 /* include */, + AB4DDA9D15CEFF2100E77157 /* Makefile */, + AB4DDA9E15CEFF2100E77157 /* Readme.txt */, + ); + path = AcpiCodec; + sourceTree = ""; + }; + AB4DDA9315CEFF2100E77157 /* include */ = { + isa = PBXGroup; + children = ( + AB4DDA9415CEFF2100E77157 /* acpi.h */, + AB4DDA9515CEFF2100E77157 /* acpi_codec.h */, + AB4DDA9615CEFF2100E77157 /* acpi_tools.h */, + AB4DDA9715CEFF2100E77157 /* acpicode.h */, + AB4DDA9815CEFF2100E77157 /* acpidecode.h */, + AB4DDA9915CEFF2100E77157 /* datatype.h */, + AB4DDA9A15CEFF2100E77157 /* intel_acpi.h */, + AB4DDA9B15CEFF2100E77157 /* ppm.h */, + AB4DDA9C15CEFF2100E77157 /* ppmsetup.h */, + ); + path = include; + sourceTree = ""; + }; + B0056CE511F3868000754B65 /* i386 */ = { + isa = PBXGroup; + children = ( + B0056CE611F3868000754B65 /* boot0 */, + B0056CEA11F3868000754B65 /* boot1 */, + B0056CF211F3868000754B65 /* boot2 */, + B41899FB14BFBE2400ED5B0B /* Cconfig */, + B0056D0F11F3868000754B65 /* cdboot */, + B4189A0314BFBED900ED5B0B /* config */, + B0056D1311F3868000754B65 /* doc */, + 6DBAFD1713B0D4590047ED33 /* include */, + B0056D1611F3868000754B65 /* libsa */, + B0056D2411F3868000754B65 /* libsaio */, + B0056D7611F3868000754B65 /* Makefile */, + AB30C93115DE66D90047BE7B /* md */, + A3561CAB1414024C00E9B51E /* modules */, + B0056D7911F3868000754B65 /* util */, + ); + path = i386; + sourceTree = ""; + }; + B0056CE611F3868000754B65 /* boot0 */ = { + isa = PBXGroup; + children = ( + B0056CE711F3868000754B65 /* boot0.s */, + B41899FF14BFBE5D00ED5B0B /* boot0hfs.s */, + B41899FE14BFBE5200ED5B0B /* boot0md.s */, + B41899FD14BFBE4500ED5B0B /* Cconfig */, + B0056CE811F3868000754B65 /* chain0.s */, + B0056CE911F3868000754B65 /* Makefile */, + ); + path = boot0; + sourceTree = ""; + }; + B0056CEA11F3868000754B65 /* boot1 */ = { + isa = PBXGroup; + children = ( + B0056CED11F3868000754B65 /* boot1f32-install.sh */, + B0056CEE11F3868000754B65 /* boot1f32.s */, + B4189A0114BFBE8900ED5B0B /* boot1h.s */, + B0056CEF11F3868000754B65 /* boot1he.s */, + B0056CF011F3868000754B65 /* boot1hp.s */, + B4189A0014BFBE7D00ED5B0B /* Cconfig */, + B0056CF111F3868000754B65 /* Makefile */, + ); + path = boot1; + sourceTree = ""; + }; + B0056CF211F3868000754B65 /* boot2 */ = { + isa = PBXGroup; + children = ( + B0056CF311F3868000754B65 /* appleboot.h */, + B0056CF411F3868000754B65 /* appleClut8.h */, + B0056CF511F3868000754B65 /* bmdecompress.c */, + B0056CF611F3868000754B65 /* boot.c */, + B0056CF711F3868000754B65 /* boot.h */, + B0056CF811F3868000754B65 /* boot2.s */, + B4189A0214BFBE9E00ED5B0B /* Cconfig */, + B0056CF911F3868000754B65 /* drivers.c */, + B0056CFA11F3868000754B65 /* graphic_utils.c */, + B0056CFB11F3868000754B65 /* graphic_utils.h */, + B0056CFC11F3868000754B65 /* graphics.c */, + B0056CFD11F3868000754B65 /* graphics.h */, + B0056CFE11F3868000754B65 /* gui.c */, + 6DBAFD1313B0D21E0047ED33 /* modules_support.s */, + 6DBAFD1413B0D21E0047ED33 /* modules.c */, + 6DBAFD1513B0D21E0047ED33 /* modules.h */, + B0056CFF11F3868000754B65 /* gui.h */, + B0056D0011F3868000754B65 /* IOHibernatePrivate.h */, + B0056D0111F3868000754B65 /* lzss.c */, + B0056D0211F3868000754B65 /* Makefile */, + B0056D0311F3868000754B65 /* mboot.c */, + B0056D0411F3868000754B65 /* mboot.h */, + B0056D0511F3868000754B65 /* multiboot.h */, + B0056D0611F3868000754B65 /* options.c */, + B0056D0711F3868000754B65 /* picopng.c */, + B0056D0811F3868000754B65 /* picopng.h */, + B0056D0911F3868000754B65 /* prompt.c */, + B0056D0A11F3868000754B65 /* ramdisk.c */, + B0056D0B11F3868000754B65 /* ramdisk.h */, + B0056D0C11F3868000754B65 /* resume.c */, + B0056D0D11F3868000754B65 /* WKdm.h */, + B0056D0E11F3868000754B65 /* WKdmDecompress.c */, + ); + path = boot2; + sourceTree = ""; + }; + B0056D0F11F3868000754B65 /* cdboot */ = { + isa = PBXGroup; + children = ( + B0056D1011F3868000754B65 /* cdboot.s */, + B0056D1111F3868000754B65 /* cdboothdd.s */, + B0056D1211F3868000754B65 /* Makefile */, + ); + path = cdboot; + sourceTree = ""; + }; + B0056D1311F3868000754B65 /* doc */ = { + isa = PBXGroup; + children = ( + B0056D1411F3868000754B65 /* Limits */, + B0056D1511F3868000754B65 /* README */, + ); + path = doc; + sourceTree = ""; + }; + B0056D1611F3868000754B65 /* libsa */ = { + isa = PBXGroup; + children = ( + B4189A2214BFBF5600ED5B0B /* Cconfig */, + B0056D1711F3868000754B65 /* efi_tables.c */, + B0056D1811F3868000754B65 /* efi_tables.h */, + B0056D1911F3868000754B65 /* error.c */, + B0056D1A11F3868000754B65 /* libsa.h */, + B0056D1B11F3868000754B65 /* Makefile */, + B0056D1C11F3868000754B65 /* memory.h */, + B0056D1D11F3868000754B65 /* prf.c */, + B0056D1E11F3868000754B65 /* printf.c */, + B0056D1F11F3868000754B65 /* qsort.c */, + B0056D2011F3868000754B65 /* setjmp.s */, + B0056D2111F3868000754B65 /* string.c */, + B0056D2211F3868000754B65 /* strtol.c */, + B0056D2311F3868000754B65 /* zalloc.c */, + ); + path = libsa; + sourceTree = ""; + }; + B0056D2411F3868000754B65 /* libsaio */ = { + isa = PBXGroup; + children = ( + B0056D2511F3868000754B65 /* acpi.h */, + B0056D2611F3868000754B65 /* acpi_patcher.c */, + B0056D2711F3868000754B65 /* acpi_patcher.h */, + B0056D2811F3868000754B65 /* allocate.c */, + B00F494A11F6089500B1D7C5 /* aml_generator.c */, + B00F494911F6089500B1D7C5 /* aml_generator.h */, + B0056D2911F3868000754B65 /* asm.s */, + 012E60F7137AC68F00E35218 /* ati_reg.h */, + B0056D2A11F3868000754B65 /* ati.c */, + B0056D2C11F3868000754B65 /* bios.h */, + B0056D2D11F3868000754B65 /* bios.s */, + B0056D2E11F3868000754B65 /* biosfn.c */, + 1D2A1AF513743A2600787720 /* bootargs.h */, + B0056D2F11F3868000754B65 /* bootstruct.c */, + B0056D3011F3868000754B65 /* bootstruct.h */, + B0056D3111F3868000754B65 /* cache.c */, + B4189A2314BFBF7200ED5B0B /* Cconfig */, + B0056D3211F3868000754B65 /* console.c */, + B0056D3311F3868000754B65 /* convert.c */, + B0056D3411F3868000754B65 /* convert.h */, + B0056D3511F3868000754B65 /* cpu.c */, + B0056D3611F3868000754B65 /* cpu.h */, + B0056D3711F3868000754B65 /* device_inject.c */, + B0056D3811F3868000754B65 /* device_inject.h */, + B0056D3911F3868000754B65 /* device_tree.c */, + B0056D3A11F3868000754B65 /* device_tree.h */, + B0056D3B11F3868000754B65 /* disk.c */, + 65ED53931204B83200B22507 /* disk.h */, + 0172D0DC11FB66820030222E /* dram_controllers.h */, + 0172D0DD11FB66820030222E /* dram_controllers.c */, + B0056D3C11F3868000754B65 /* efi.h */, + B0056D3D11F3868000754B65 /* ext2fs.c */, + B0056D3E11F3868000754B65 /* ext2fs.h */, + B0056D3F11F3868000754B65 /* fake_efi.c */, + B0056D4011F3868000754B65 /* fake_efi.h */, + B0056D4111F3868000754B65 /* fdisk.h */, + B0056D4211F3868000754B65 /* hfs.c */, + B0056D4311F3868000754B65 /* hfs.h */, + B0056D4411F3868000754B65 /* hfs_CaseTables.h */, + B0056D4511F3868000754B65 /* hfs_compare.c */, + B0056D4611F3868000754B65 /* hpet.c */, + B0056D4711F3868000754B65 /* hpet.h */, + B0056D4811F3868000754B65 /* io_inline.h */, + B0056D4911F3868000754B65 /* libsaio.h */, + B0056D4A11F3868000754B65 /* load.c */, + B0056D4B11F3868000754B65 /* Makefile */, + B0056D4C11F3868000754B65 /* md5c.c */, + B0056D4F11F3868000754B65 /* memvendors.h */, + B0056D5011F3868000754B65 /* misc.c */, + B0056D5111F3868000754B65 /* msdos.c */, + B0056D5211F3868000754B65 /* msdos.h */, + B0056D5311F3868000754B65 /* msdos_private.h */, + B0056D5411F3868000754B65 /* nbp.c */, + B0056D5511F3868000754B65 /* nbp_cmd.h */, + B0056D5611F3868000754B65 /* ntfs.c */, + B0056D5711F3868000754B65 /* ntfs.h */, + B0056D5811F3868000754B65 /* ntfs_private.h */, + B0056D5911F3868000754B65 /* nvidia.c */, + B0056D5A11F3868000754B65 /* nvidia.h */, + ABE4A59C15B6EA73007812A6 /* nvidia_helper.h */, + ABE4A59D15B6EA73007812A6 /* nvidia_helper.c */, + B0056D5B11F3868000754B65 /* pci.c */, + B0056D5C11F3868000754B65 /* pci.h */, + B0056D5D11F3868000754B65 /* pci_root.c */, + B0056D5E11F3868000754B65 /* pci_root.h */, + B0056D5F11F3868000754B65 /* pci_setup.c */, + B0056D6011F3868000754B65 /* platform.c */, + B0056D6111F3868000754B65 /* platform.h */, + B0056D6211F3868000754B65 /* saio_internal.h */, + B0056D6311F3868000754B65 /* saio_types.h */, + B0056D6411F3868000754B65 /* sl.h */, + B0056D6511F3868000754B65 /* SMBIOS.h */, + 012E60F8137AC68F00E35218 /* smbios_decode.c */, + 012E60F9137AC68F00E35218 /* smbios_getters.c */, + 012E60FA137AC68F00E35218 /* smbios_getters.h */, + 012E60FB137AC68F00E35218 /* smbios.c */, + B0056D6811F3868000754B65 /* spd.c */, + B0056D6911F3868000754B65 /* spd.h */, + B0056D6A11F3868000754B65 /* stringTable.c */, + B0056D6B11F3868000754B65 /* sys.c */, + B0056D6C11F3868000754B65 /* table.c */, + B0056D6E11F3868000754B65 /* ufs.h */, + B0056D7011F3868000754B65 /* ufs_byteorder.h */, + B0056D7111F3868000754B65 /* usb.c */, + B0056D7211F3868000754B65 /* vbe.c */, + B0056D7311F3868000754B65 /* vbe.h */, + B0056D7411F3868000754B65 /* xml.c */, + B0056D7511F3868000754B65 /* xml.h */, + 1D2A1AF513743A2600787720 /* bootargs.h */, + ); + path = libsaio; + sourceTree = ""; + }; + B0056D7911F3868000754B65 /* util */ = { + isa = PBXGroup; + children = ( + A3561C8B1413FD7800E9B51E /* bdmesg.c */, + B4189A2414BFBFD100ED5B0B /* Cconfig */, + A3561C8A1413FD7800E9B51E /* dyldsymboltool.c */, + A3561C721413FD7800E9B51E /* fdisk */, + B0056D7A11F3868000754B65 /* machOconv.c */, + B0056D7B11F3868000754B65 /* Makefile */, + A3561C891413FD7800E9B51E /* openUp.c */, + ); + path = util; + sourceTree = ""; + }; + B0056D8311F3868000754B65 /* package */ = { + isa = PBXGroup; + children = ( + B4118C62153EFEC200C8D926 /* bin */, + A35D2188141A75DC00969AC0 /* buildpkg.sh */, + 361BC70214BD977700236488 /* Changes.txt */, + B0056D8511F3868000754B65 /* Distribution */, + 361BC70414BD979700236488 /* Icons */, + 36B43E8114BCE91300D29461 /* OptionalSettings */, + B4118C8E153EFF3300C8D926 /* po */, + B4118CAB153EFF3D00C8D926 /* po4a-chameleon.cfg */, + A396E2CA150247630025A245 /* Resources */, + A396E4F31502D0580025A245 /* Resources.old */, + A3F1F20D141B9B0D00DDA709 /* Scripts */, + 364E0DDF14BCFB6600F55E58 /* Scripts.templates */, + A35D2187141A75DC00969AC0 /* slimpkg.sh */, + B0056DB911F3868000754B65 /* smbios.plist */, + ); + path = package; + sourceTree = ""; + }; + B0056DBA11F3868000754B65 /* artwork */ = { + isa = PBXGroup; + children = ( + B0056DBB11F3868000754B65 /* themes */, + ); + path = artwork; + sourceTree = ""; + }; + B0056DBB11F3868000754B65 /* themes */ = { + isa = PBXGroup; + children = ( + B0056DBC11F3868000754B65 /* bullet */, + B0056DDC11F3868000754B65 /* default */, + B0056DFC11F3868000754B65 /* msi_netbook */, + B0056DFF11F3868000754B65 /* pinktink */, + B0056E0211F3868000754B65 /* twilight */, + ); + path = themes; + sourceTree = ""; + }; + B0056DBC11F3868000754B65 /* bullet */ = { + isa = PBXGroup; + children = ( + B0056DBD11F3868000754B65 /* background.png */, + B0056DBE11F3868000754B65 /* boot.png */, + B0056DBF11F3868000754B65 /* device_cdrom.png */, + B0056DC011F3868000754B65 /* device_ext3.png */, + B0056DC111F3868000754B65 /* device_fat16.png */, + B0056DC211F3868000754B65 /* device_fat32.png */, + B0056DC311F3868000754B65 /* device_generic.png */, + B0056DC411F3868000754B65 /* device_hfsplus.png */, + B0056DC511F3868000754B65 /* device_ntfs.png */, + B0056DC611F3868000754B65 /* device_scroll_next.png */, + B0056DC711F3868000754B65 /* device_scroll_prev.png */, + B0056DC811F3868000754B65 /* device_selection.png */, + B0056DC911F3868000754B65 /* font_console.png */, + B0056DCA11F3868000754B65 /* font_small.png */, + B0056DCB11F3868000754B65 /* logo.png */, + B0056DCC11F3868000754B65 /* menu_boot.png */, + B0056DCD11F3868000754B65 /* menu_help.png */, + B0056DCE11F3868000754B65 /* menu_ignore_caches.png */, + B0056DCF11F3868000754B65 /* menu_ignore_caches_disabled.png */, + B0056DD011F3868000754B65 /* menu_memory_info.png */, + B0056DD111F3868000754B65 /* menu_selection.png */, + B0056DD211F3868000754B65 /* menu_single_user.png */, + B0056DD311F3868000754B65 /* menu_single_user_disabled.png */, + B0056DD411F3868000754B65 /* menu_verbose.png */, + B0056DD511F3868000754B65 /* menu_verbose_disabled.png */, + B0056DD611F3868000754B65 /* menu_video_info.png */, + B0056DD711F3868000754B65 /* progress_bar.png */, + B0056DD811F3868000754B65 /* progress_bar_background.png */, + B0056DD911F3868000754B65 /* text_scroll_next.png */, + B0056DDA11F3868000754B65 /* text_scroll_prev.png */, + B0056DDB11F3868000754B65 /* theme.plist */, + ); + path = bullet; + sourceTree = ""; + }; + B0056DDC11F3868000754B65 /* default */ = { + isa = PBXGroup; + children = ( + 36AB75A114BD0866005B8045 /* background.png */, + 36AB75A214BD0866005B8045 /* boot.png */, + 36AB75A314BD0866005B8045 /* device_befs_o.png */, + 36AB75A414BD0866005B8045 /* device_befs.png */, + 36AB75A514BD0866005B8045 /* device_cdrom_o.png */, + 36AB75A614BD0866005B8045 /* device_cdrom.png */, + 36AB75A714BD0866005B8045 /* device_ext3_o.png */, + 36AB75A814BD0866005B8045 /* device_ext3.png */, + 36AB75A914BD0866005B8045 /* device_fat_o.png */, + 36AB75AA14BD0866005B8045 /* device_fat.png */, + 36AB75AB14BD0866005B8045 /* device_freebsd_o.png */, + 36AB75AC14BD0866005B8045 /* device_freebsd.png */, + 36AB75AD14BD0866005B8045 /* device_generic_o.png */, + 36AB75AE14BD0866005B8045 /* device_generic.png */, + 36AB75AF14BD0866005B8045 /* device_hfsplus_leo_o.png */, + 36AB75B014BD0866005B8045 /* device_hfsplus_leo.png */, + 36AB75B114BD0866005B8045 /* device_hfsplus_lion_o.png */, + 36AB75B214BD0866005B8045 /* device_hfsplus_lion.png */, + 36AB75B314BD0866005B8045 /* device_hfsplus_o.png */, + 36AB75B414BD0866005B8045 /* device_hfsplus_sl_o.png */, + 36AB75B514BD0866005B8045 /* device_hfsplus_sl.png */, + 36AB75B614BD0866005B8045 /* device_hfsplus_tiger_o.png */, + 36AB75B714BD0866005B8045 /* device_hfsplus_tiger.png */, + 36AB75B814BD0866005B8045 /* device_hfsplus.png */, + 36AB75B914BD0866005B8045 /* device_hfsraid_leo_o.png */, + 36AB75BA14BD0866005B8045 /* device_hfsraid_leo.png */, + 36AB75BB14BD0866005B8045 /* device_hfsraid_lion_o.png */, + 36AB75BC14BD0866005B8045 /* device_hfsraid_lion.png */, + 36AB75BD14BD0866005B8045 /* device_hfsraid_o.png */, + 36AB75BE14BD0866005B8045 /* device_hfsraid_sl_o.png */, + 36AB75BF14BD0866005B8045 /* device_hfsraid_sl.png */, + 36AB75C014BD0866005B8045 /* device_hfsraid_tiger_o.png */, + 36AB75C114BD0866005B8045 /* device_hfsraid_tiger.png */, + 36AB75C214BD0866005B8045 /* device_hfsraid.png */, + 36AB75C314BD0866005B8045 /* device_ntfs_o.png */, + 36AB75C414BD0866005B8045 /* device_ntfs.png */, + 36AB75C514BD0866005B8045 /* device_openbsd_o.png */, + 36AB75C614BD0866005B8045 /* device_openbsd.png */, + 36AB75C714BD0866005B8045 /* device_scroll_next.png */, + 36AB75C814BD0866005B8045 /* device_scroll_prev.png */, + 36AB75C914BD0866005B8045 /* device_selection.png */, + 36AB75CA14BD0866005B8045 /* font_console.png */, + 36AB75CB14BD0866005B8045 /* font_small.png */, + 36AB75CC14BD0866005B8045 /* logo.png */, + 36AB75CD14BD0866005B8045 /* menu_boot.png */, + 36AB75CE14BD0866005B8045 /* menu_help.png */, + 36AB75CF14BD0866005B8045 /* menu_ignore_caches_disabled.png */, + 36AB75D014BD0866005B8045 /* menu_ignore_caches.png */, + 36AB75D114BD0866005B8045 /* menu_memory_info.png */, + 36AB75D214BD0866005B8045 /* menu_selection.png */, + 36AB75D314BD0866005B8045 /* menu_single_user_disabled.png */, + 36AB75D414BD0866005B8045 /* menu_single_user.png */, + 36AB75D514BD0866005B8045 /* menu_verbose_disabled.png */, + 36AB75D614BD0866005B8045 /* menu_verbose.png */, + 36AB75D714BD0866005B8045 /* menu_video_info.png */, + 36AB75D814BD0866005B8045 /* progress_bar_background.png */, + 36AB75D914BD0866005B8045 /* progress_bar.png */, + 36AB75DA14BD0866005B8045 /* text_scroll_next.png */, + 36AB75DB14BD0866005B8045 /* text_scroll_prev.png */, + 36AB75DC14BD0866005B8045 /* theme.plist */, + 36AB75DD14BD0866005B8045 /* thumb.png */, + ); + path = default; + sourceTree = ""; + }; + B0056DFC11F3868000754B65 /* msi_netbook */ = { + isa = PBXGroup; + children = ( + B0056DFD11F3868000754B65 /* logo.png */, + B0056DFE11F3868000754B65 /* theme.plist */, + ); + path = msi_netbook; + sourceTree = ""; + }; + B0056DFF11F3868000754B65 /* pinktink */ = { + isa = PBXGroup; + children = ( + B0056E0011F3868000754B65 /* logo.png */, + B0056E0111F3868000754B65 /* theme.plist */, + ); + path = pinktink; + sourceTree = ""; + }; + B0056E0211F3868000754B65 /* twilight */ = { + isa = PBXGroup; + children = ( + B0056E0311F3868000754B65 /* font_small.png */, + B0056E0411F3868000754B65 /* logo.png */, + B0056E0511F3868000754B65 /* theme.plist */, + ); + path = twilight; + sourceTree = ""; + }; + B0056E0611F3868000754B65 /* doc */ = { + isa = PBXGroup; + children = ( + B0056E0711F3868000754B65 /* archive */, + B0056E0B11F3868000754B65 /* BootHelp.txt */, + AB47D38A15B702F00083D898 /* org.chameleon.Boot.nvidia.plist */, + B0056E0C11F3868000754B65 /* README */, + B0056E0D11F3868000754B65 /* themeinfo.png */, + B0056E0E11F3868000754B65 /* User_Guide_src */, + B0056E1A11F3868000754B65 /* Users_Guide0.5.pdf */, + ); + path = doc; + sourceTree = ""; + }; + B0056E0711F3868000754B65 /* archive */ = { + isa = PBXGroup; + children = ( + B0056E0811F3868000754B65 /* Users_Guide0.4.pdf */, + B0056E0911F3868000754B65 /* Users_Guide_v0.3.pdf */, + B0056E0A11F3868000754B65 /* UsersGuide-v0.2.pdf */, + ); + path = archive; + sourceTree = ""; + }; + B0056E0E11F3868000754B65 /* User_Guide_src */ = { + isa = PBXGroup; + children = ( + B0056E0F11F3868000754B65 /* Chameleon 2 v0.4.xml */, + B0056E1011F3868000754B65 /* Chameleon 2 v0.5.docx */, + B0056E1111F3868000754B65 /* chameleon.png */, + B0056E1211F3868000754B65 /* colorchart.png */, + B0056E1311F3868000754B65 /* install_complete.png */, + B0056E1411F3868000754B65 /* install_cust.png */, + B0056E1511F3868000754B65 /* install_dest.png */, + B0056E1611F3868000754B65 /* install_stand.png */, + B0056E1711F3868000754B65 /* install_start.png */, + B0056E1811F3868000754B65 /* screen_format.png */, + B0056E1911F3868000754B65 /* xnulogo.png */, + ); + path = User_Guide_src; + sourceTree = ""; + }; + B4118C62153EFEC200C8D926 /* bin */ = { + isa = PBXGroup; + children = ( + B4118C63153EFEC200C8D926 /* clean_po_headers.sh */, + B4118C64153EFEC200C8D926 /* po4a */, + ); + path = bin; + sourceTree = ""; + }; + B4118C64153EFEC200C8D926 /* po4a */ = { + isa = PBXGroup; + children = ( + B4118C65153EFEC200C8D926 /* COPYING */, + B4118C66153EFEC200C8D926 /* lib */, + B4118C82153EFEC200C8D926 /* MANIFEST */, + B4118C83153EFEC200C8D926 /* NEWS */, + B4118C84153EFEC200C8D926 /* po4a */, + B4118C85153EFEC200C8D926 /* po4a-gettextize */, + B4118C86153EFEC200C8D926 /* po4a-normalize */, + B4118C87153EFEC200C8D926 /* po4a-translate */, + B4118C88153EFEC200C8D926 /* po4a-updatepo */, + B4118C89153EFEC200C8D926 /* README */, + B4118C8A153EFEC200C8D926 /* README.maintainers */, + B4118C8B153EFEC200C8D926 /* README.tests */, + B4118C8C153EFEC200C8D926 /* README.translators */, + ); + path = po4a; + sourceTree = ""; + }; + B4118C66153EFEC200C8D926 /* lib */ = { + isa = PBXGroup; + children = ( + B4118C67153EFEC200C8D926 /* Locale */, + ); + path = lib; + sourceTree = ""; + }; + B4118C67153EFEC200C8D926 /* Locale */ = { + isa = PBXGroup; + children = ( + B4118C68153EFEC200C8D926 /* Po4a */, + ); + path = Locale; + sourceTree = ""; + }; + B4118C68153EFEC200C8D926 /* Po4a */ = { + isa = PBXGroup; + children = ( + B4118C69153EFEC200C8D926 /* BibTeX.pm */, + B4118C6A153EFEC200C8D926 /* Chooser.pm */, + B4118C6B153EFEC200C8D926 /* Common.pm */, + B4118C6C153EFEC200C8D926 /* Debconf.pm */, + B4118C6D153EFEC200C8D926 /* Dia.pm */, + B4118C6E153EFEC200C8D926 /* Docbook.pm */, + B4118C6F153EFEC200C8D926 /* Guide.pm */, + B4118C70153EFEC200C8D926 /* Halibut.pm */, + B4118C71153EFEC200C8D926 /* Html.pm */, + B4118C72153EFEC200C8D926 /* Ini.pm */, + B4118C73153EFEC200C8D926 /* KernelHelp.pm */, + B4118C74153EFEC200C8D926 /* LaTeX.pm */, + B4118C75153EFEC200C8D926 /* Man.pm */, + B4118C76153EFEC200C8D926 /* NewsDebian.pm */, + B4118C77153EFEC200C8D926 /* Po.pm */, + B4118C78153EFEC200C8D926 /* Pod.pm */, + B4118C79153EFEC200C8D926 /* Prop.pm */, + B4118C7A153EFEC200C8D926 /* Sgml.pm */, + B4118C7B153EFEC200C8D926 /* TeX.pm */, + B4118C7C153EFEC200C8D926 /* Texinfo.pm */, + B4118C7D153EFEC200C8D926 /* Text.pm */, + B4118C7E153EFEC200C8D926 /* TransTractor.pm */, + B4118C7F153EFEC200C8D926 /* Wml.pm */, + B4118C80153EFEC200C8D926 /* Xhtml.pm */, + B4118C81153EFEC200C8D926 /* Xml.pm */, + ); + path = Po4a; + sourceTree = ""; + }; + B4118C8E153EFF3300C8D926 /* po */ = { + isa = PBXGroup; + children = ( + B4118C8F153EFF3300C8D926 /* ar.po */, + B4118C90153EFF3300C8D926 /* bg.po */, + B4118C91153EFF3300C8D926 /* bs.po */, + B4118C92153EFF3300C8D926 /* ca.po */, + B4118C93153EFF3300C8D926 /* chameleon.pot */, + B4118C94153EFF3300C8D926 /* cs.po */, + B4118C95153EFF3300C8D926 /* de.po */, + B4118C96153EFF3300C8D926 /* el.po */, + B4118C97153EFF3300C8D926 /* en.po */, + B4118C98153EFF3300C8D926 /* es.po */, + B4118C99153EFF3300C8D926 /* fa.po */, + B4118C9A153EFF3300C8D926 /* fr.po */, + B4118C9B153EFF3300C8D926 /* he.po */, + B4118C9C153EFF3300C8D926 /* hr.po */, + B4118C9D153EFF3300C8D926 /* hu.po */, + B4118C9E153EFF3300C8D926 /* id.po */, + B4118C9F153EFF3300C8D926 /* it.po */, + B4118CA0153EFF3300C8D926 /* ko.po */, + B4118CA1153EFF3300C8D926 /* mk.po */, + B4118CA2153EFF3300C8D926 /* nl.po */, + B4118CA3153EFF3300C8D926 /* pl.po */, + B4118CA4153EFF3300C8D926 /* pt-BR.po */, + B4118CA5153EFF3300C8D926 /* pt-PT.po */, + B4118CA6153EFF3300C8D926 /* ro.po */, + B4118CA7153EFF3300C8D926 /* ru.po */, + B4118CA8153EFF3300C8D926 /* sr.po */, + B4118CA9153EFF3300C8D926 /* zh_CN.po */, + B4118CAA153EFF3300C8D926 /* zh_TW.po */, + ); + path = po; + sourceTree = ""; + }; + B4189A0314BFBED900ED5B0B /* config */ = { + isa = PBXGroup; + children = ( + B4189A0E14BFBF1C00ED5B0B /* cconfig.c */, + B4189A0F14BFBF1C00ED5B0B /* checklist.c */, + B4189A1014BFBF1C00ED5B0B /* confdata.c */, + B4189A1114BFBF1C00ED5B0B /* dialog.h */, + B4189A1214BFBF1C00ED5B0B /* expr.c */, + B4189A1314BFBF1C00ED5B0B /* expr.h */, + B4189A1414BFBF1C00ED5B0B /* inputbox.c */, + B4189A1514BFBF1C00ED5B0B /* lex.zconf.c */, + B4189A1614BFBF1C00ED5B0B /* lkc_proto.h */, + B4189A1714BFBF1C00ED5B0B /* lkc.h */, + B4189A0414BFBEEF00ED5B0B /* lxdialog */, + B4189A1814BFBF1C00ED5B0B /* Makefile */, + B4189A1914BFBF1C00ED5B0B /* menu.c */, + B4189A1A14BFBF1C00ED5B0B /* menubox.c */, + B4189A1B14BFBF1C00ED5B0B /* nconf.h */, + B4189A1C14BFBF1C00ED5B0B /* symbol.c */, + B4189A1D14BFBF1C00ED5B0B /* textbox.c */, + B4189A1E14BFBF1C00ED5B0B /* util.c */, + B4189A1F14BFBF1C00ED5B0B /* yesno.c */, + B4189A2014BFBF1C00ED5B0B /* zconf.hash.c */, + B4189A2114BFBF1C00ED5B0B /* zconf.tab.c */, + ); + name = config; + sourceTree = ""; + }; + B4189A0414BFBEEF00ED5B0B /* lxdialog */ = { + isa = PBXGroup; + children = ( + B4189A0514BFBF0A00ED5B0B /* BIG.FAT.WARNING */, + B4189A0614BFBF0A00ED5B0B /* check-lxdialog.sh */, + B4189A0714BFBF0A00ED5B0B /* checklist.c */, + B4189A0814BFBF0A00ED5B0B /* dialog.h */, + B4189A0914BFBF0A00ED5B0B /* inputbox.c */, + B4189A0A14BFBF0A00ED5B0B /* menubox.c */, + B4189A0B14BFBF0A00ED5B0B /* textbox.c */, + B4189A0C14BFBF0A00ED5B0B /* util.c */, + B4189A0D14BFBF0A00ED5B0B /* yesno.c */, + ); + name = lxdialog; + sourceTree = ""; + }; + B4AABE5814C3B8B90055ECD1 /* AddOption */ = { + isa = PBXGroup; + children = ( + B4AABE5914C3B8B90055ECD1 /* postinstall */, + ); + name = AddOption; + path = Scripts.templates/AddOption; + sourceTree = ""; + }; + B4AABE5A14C3B8C70055ECD1 /* InstallModule */ = { + isa = PBXGroup; + children = ( + B4AABE5B14C3B8C70055ECD1 /* postinstall */, + ); + name = InstallModule; + path = Scripts.templates/InstallModule; + sourceTree = ""; + }; + B4AABE5C14C3B8D70055ECD1 /* InstallTheme */ = { + isa = PBXGroup; + children = ( + B4AABE5D14C3B8D70055ECD1 /* postinstall */, + ); + name = InstallTheme; + path = Scripts.templates/InstallTheme; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXLegacyTarget section */ + D28A88AD04BDD90700651E21 /* Chameleon */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "$(ACTION)"; + buildConfigurationList = 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "Chameleon" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/make; + buildWorkingDirectory = ""; + dependencies = ( + ); + name = Chameleon; + passBuildSettingsInEnvironment = 1; + productName = Chameleon; + }; +/* End PBXLegacyTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + ar, + bg, + bs, + ca, + cs, + da, + de, + el, + en, + es, + fi, + fr, + he, + hr, + hu, + id, + it, + ja, + ko, + mk, + ms, + nl, + no, + pl, + "pt-BR", + "pt-PT", + ro, + ru, + sk, + sr, + sv, + th, + tr, + uk, + vi, + zh_CN, + zh_TW, + ); + mainGroup = 08FB7794FE84155DC02AAC07 /* Chameleon */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D28A88AD04BDD90700651E21 /* Chameleon */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXVariantGroup section */ + A396E4F41502D0580025A245 /* Conclusion.rtfd */ = { + isa = PBXVariantGroup; + children = ( + A396E4F51502D0580025A245 /* ar */, + A396E4FF1502D0580025A245 /* bg */, + A396E5041502D0580025A245 /* bs */, + A396E5091502D0580025A245 /* ca */, + A396E50E1502D0580025A245 /* de */, + A396E5131502D0580025A245 /* el */, + A396E5181502D0580025A245 /* en */, + A396E51D1502D0580025A245 /* es */, + A396E5221502D0580025A245 /* fr */, + A396E5271502D0580025A245 /* he */, + A396E52C1502D0580025A245 /* hr */, + A396E5311502D0580025A245 /* id */, + A396E5361502D0580025A245 /* it */, + A396E53B1502D0580025A245 /* ja */, + A396E5401502D0580025A245 /* ko */, + A396E5451502D0580025A245 /* mk */, + A396E54A1502D0580025A245 /* nl */, + A396E54F1502D0580025A245 /* pl */, + A396E5541502D0580025A245 /* pt-BR */, + A396E5591502D0580025A245 /* pt-PT */, + A396E55E1502D0580025A245 /* ro */, + A396E5631502D0580025A245 /* ru */, + A396E5681502D0580025A245 /* sr */, + A396E56D1502D0580025A245 /* zh_CN */, + A396E5721502D0580025A245 /* zh_TW */, + ); + name = Conclusion.rtfd; + sourceTree = ""; + }; + A396E4F61502D0580025A245 /* Description.html */ = { + isa = PBXVariantGroup; + children = ( + A396E4F71502D0580025A245 /* ar */, + A396E5001502D0580025A245 /* bg */, + A396E5051502D0580025A245 /* bs */, + A396E50A1502D0580025A245 /* ca */, + A396E50F1502D0580025A245 /* de */, + A396E5141502D0580025A245 /* el */, + A396E5191502D0580025A245 /* en */, + A396E51E1502D0580025A245 /* es */, + A396E5231502D0580025A245 /* fr */, + A396E5281502D0580025A245 /* he */, + A396E52D1502D0580025A245 /* hr */, + A396E5321502D0580025A245 /* id */, + A396E5371502D0580025A245 /* it */, + A396E53C1502D0580025A245 /* ja */, + A396E5411502D0580025A245 /* ko */, + A396E5461502D0580025A245 /* mk */, + A396E54B1502D0580025A245 /* nl */, + A396E5501502D0580025A245 /* pl */, + A396E5551502D0580025A245 /* pt-BR */, + A396E55A1502D0580025A245 /* pt-PT */, + A396E55F1502D0580025A245 /* ro */, + A396E5641502D0580025A245 /* ru */, + A396E5691502D0580025A245 /* sr */, + A396E56E1502D0580025A245 /* zh_CN */, + A396E5731502D0580025A245 /* zh_TW */, + ); + name = Description.html; + sourceTree = ""; + }; + A396E4F81502D0580025A245 /* License.rtf */ = { + isa = PBXVariantGroup; + children = ( + A396E4F91502D0580025A245 /* ar */, + A396E5011502D0580025A245 /* bg */, + A396E5061502D0580025A245 /* bs */, + A396E50B1502D0580025A245 /* ca */, + A396E5101502D0580025A245 /* de */, + A396E5151502D0580025A245 /* el */, + A396E51A1502D0580025A245 /* en */, + A396E51F1502D0580025A245 /* es */, + A396E5241502D0580025A245 /* fr */, + A396E5291502D0580025A245 /* he */, + A396E52E1502D0580025A245 /* hr */, + A396E5331502D0580025A245 /* id */, + A396E5381502D0580025A245 /* it */, + A396E53D1502D0580025A245 /* ja */, + A396E5421502D0580025A245 /* ko */, + A396E5471502D0580025A245 /* mk */, + A396E54C1502D0580025A245 /* nl */, + A396E5511502D0580025A245 /* pl */, + A396E5561502D0580025A245 /* pt-BR */, + A396E55B1502D0580025A245 /* pt-PT */, + A396E5601502D0580025A245 /* ro */, + A396E5651502D0580025A245 /* ru */, + A396E56A1502D0580025A245 /* sr */, + A396E56F1502D0580025A245 /* zh_CN */, + A396E5741502D0580025A245 /* zh_TW */, + ); + name = License.rtf; + sourceTree = ""; + }; + A396E4FA1502D0580025A245 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + A396E4FB1502D0580025A245 /* ar */, + A396E5021502D0580025A245 /* bg */, + A396E5071502D0580025A245 /* bs */, + A396E50C1502D0580025A245 /* ca */, + A396E5111502D0580025A245 /* de */, + A396E5161502D0580025A245 /* el */, + A396E51B1502D0580025A245 /* en */, + A396E5201502D0580025A245 /* es */, + A396E5251502D0580025A245 /* fr */, + A396E52A1502D0580025A245 /* he */, + A396E52F1502D0580025A245 /* hr */, + A396E5341502D0580025A245 /* id */, + A396E5391502D0580025A245 /* it */, + A396E53E1502D0580025A245 /* ja */, + A396E5431502D0580025A245 /* ko */, + A396E5481502D0580025A245 /* mk */, + A396E54D1502D0580025A245 /* nl */, + A396E5521502D0580025A245 /* pl */, + A396E5571502D0580025A245 /* pt-BR */, + A396E55C1502D0580025A245 /* pt-PT */, + A396E5611502D0580025A245 /* ro */, + A396E5661502D0580025A245 /* ru */, + A396E56B1502D0580025A245 /* sr */, + A396E5701502D0580025A245 /* zh_CN */, + A396E5751502D0580025A245 /* zh_TW */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + A396E4FC1502D0580025A245 /* Welcome.rtfd */ = { + isa = PBXVariantGroup; + children = ( + A396E4FD1502D0580025A245 /* ar */, + A396E5031502D0580025A245 /* bg */, + A396E5081502D0580025A245 /* bs */, + A396E50D1502D0580025A245 /* ca */, + A396E5121502D0580025A245 /* de */, + A396E5171502D0580025A245 /* el */, + A396E51C1502D0580025A245 /* en */, + A396E5211502D0580025A245 /* es */, + A396E5261502D0580025A245 /* fr */, + A396E52B1502D0580025A245 /* he */, + A396E5301502D0580025A245 /* hr */, + A396E5351502D0580025A245 /* id */, + A396E53A1502D0580025A245 /* it */, + A396E53F1502D0580025A245 /* ja */, + A396E5441502D0580025A245 /* ko */, + A396E5491502D0580025A245 /* mk */, + A396E54E1502D0580025A245 /* nl */, + A396E5531502D0580025A245 /* pl */, + A396E5581502D0580025A245 /* pt-BR */, + A396E55D1502D0580025A245 /* pt-PT */, + A396E5621502D0580025A245 /* ro */, + A396E5671502D0580025A245 /* ru */, + A396E56C1502D0580025A245 /* sr */, + A396E5711502D0580025A245 /* zh_CN */, + A396E5761502D0580025A245 /* zh_TW */, + ); + name = Welcome.rtfd; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 1DEB919008733D9F0010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = Chameleon; + }; + name = Debug; + }; + 1DEB919108733D9F0010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = Chameleon; + }; + name = Release; + }; + 1DEB919408733D9F0010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 1DEB919508733D9F0010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "Chameleon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB919008733D9F0010E9CD /* Debug */, + 1DEB919108733D9F0010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB919408733D9F0010E9CD /* Debug */, + 1DEB919508733D9F0010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/Chameleon.xcodeproj/project.pbxproj b/Chameleon.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9c39841 --- /dev/null +++ b/Chameleon.xcodeproj/project.pbxproj @@ -0,0 +1,4095 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXFileReference section */ + 012E60F7137AC68F00E35218 /* ati_reg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ati_reg.h; sourceTree = ""; }; + 012E60F8137AC68F00E35218 /* smbios_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios_decode.c; sourceTree = ""; }; + 012E60F9137AC68F00E35218 /* smbios_getters.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios_getters.c; sourceTree = ""; }; + 012E60FA137AC68F00E35218 /* smbios_getters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smbios_getters.h; sourceTree = ""; }; + 012E60FB137AC68F00E35218 /* smbios.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smbios.c; sourceTree = ""; }; + 0172D0DC11FB66820030222E /* dram_controllers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dram_controllers.h; sourceTree = ""; }; + 0172D0DD11FB66820030222E /* dram_controllers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dram_controllers.c; sourceTree = ""; }; + 019DFBAF11FB94090013E8CC /* MEMTEST86_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MEMTEST86_LICENSE; sourceTree = ""; }; + 1D2A1AF513743A2600787720 /* bootargs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootargs.h; sourceTree = ""; }; + 361BC70214BD977700236488 /* Changes.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changes.txt; sourceTree = ""; }; + 361BC70B14BD97C800236488 /* pkg.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; name = pkg.zip; path = Icons/pkg.zip; sourceTree = ""; }; + 369689D014BD0AF10013D77F /* BLOCKERS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BLOCKERS; sourceTree = ""; }; + 369689D114BD0AF10013D77F /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + 369689D214BD0B470013D77F /* version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = version; sourceTree = ""; }; + 36AB75A114BD0866005B8045 /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; + 36AB75A214BD0866005B8045 /* boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot.png; sourceTree = ""; }; + 36AB75A314BD0866005B8045 /* device_befs_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_befs_o.png; sourceTree = ""; }; + 36AB75A414BD0866005B8045 /* device_befs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_befs.png; sourceTree = ""; }; + 36AB75A514BD0866005B8045 /* device_cdrom_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom_o.png; sourceTree = ""; }; + 36AB75A614BD0866005B8045 /* device_cdrom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom.png; sourceTree = ""; }; + 36AB75A714BD0866005B8045 /* device_ext3_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3_o.png; sourceTree = ""; }; + 36AB75A814BD0866005B8045 /* device_ext3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3.png; sourceTree = ""; }; + 36AB75A914BD0866005B8045 /* device_fat_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat_o.png; sourceTree = ""; }; + 36AB75AA14BD0866005B8045 /* device_fat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat.png; sourceTree = ""; }; + 36AB75AB14BD0866005B8045 /* device_freebsd_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_freebsd_o.png; sourceTree = ""; }; + 36AB75AC14BD0866005B8045 /* device_freebsd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_freebsd.png; sourceTree = ""; }; + 36AB75AD14BD0866005B8045 /* device_generic_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic_o.png; sourceTree = ""; }; + 36AB75AE14BD0866005B8045 /* device_generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic.png; sourceTree = ""; }; + 36AB75AF14BD0866005B8045 /* device_hfsplus_leo_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_leo_o.png; sourceTree = ""; }; + 36AB75B014BD0866005B8045 /* device_hfsplus_leo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_leo.png; sourceTree = ""; }; + 36AB75B114BD0866005B8045 /* device_hfsplus_lion_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_lion_o.png; sourceTree = ""; }; + 36AB75B214BD0866005B8045 /* device_hfsplus_lion.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_lion.png; sourceTree = ""; }; + 36AB75B314BD0866005B8045 /* device_hfsplus_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_o.png; sourceTree = ""; }; + 36AB75B414BD0866005B8045 /* device_hfsplus_sl_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_sl_o.png; sourceTree = ""; }; + 36AB75B514BD0866005B8045 /* device_hfsplus_sl.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_sl.png; sourceTree = ""; }; + 36AB75B614BD0866005B8045 /* device_hfsplus_tiger_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_tiger_o.png; sourceTree = ""; }; + 36AB75B714BD0866005B8045 /* device_hfsplus_tiger.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus_tiger.png; sourceTree = ""; }; + 36AB75B814BD0866005B8045 /* device_hfsplus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus.png; sourceTree = ""; }; + 36AB75B914BD0866005B8045 /* device_hfsraid_leo_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_leo_o.png; sourceTree = ""; }; + 36AB75BA14BD0866005B8045 /* device_hfsraid_leo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_leo.png; sourceTree = ""; }; + 36AB75BB14BD0866005B8045 /* device_hfsraid_lion_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_lion_o.png; sourceTree = ""; }; + 36AB75BC14BD0866005B8045 /* device_hfsraid_lion.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_lion.png; sourceTree = ""; }; + 36AB75BD14BD0866005B8045 /* device_hfsraid_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_o.png; sourceTree = ""; }; + 36AB75BE14BD0866005B8045 /* device_hfsraid_sl_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_sl_o.png; sourceTree = ""; }; + 36AB75BF14BD0866005B8045 /* device_hfsraid_sl.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_sl.png; sourceTree = ""; }; + 36AB75C014BD0866005B8045 /* device_hfsraid_tiger_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_tiger_o.png; sourceTree = ""; }; + 36AB75C114BD0866005B8045 /* device_hfsraid_tiger.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid_tiger.png; sourceTree = ""; }; + 36AB75C214BD0866005B8045 /* device_hfsraid.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsraid.png; sourceTree = ""; }; + 36AB75C314BD0866005B8045 /* device_ntfs_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs_o.png; sourceTree = ""; }; + 36AB75C414BD0866005B8045 /* device_ntfs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs.png; sourceTree = ""; }; + 36AB75C514BD0866005B8045 /* device_openbsd_o.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_openbsd_o.png; sourceTree = ""; }; + 36AB75C614BD0866005B8045 /* device_openbsd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_openbsd.png; sourceTree = ""; }; + 36AB75C714BD0866005B8045 /* device_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_next.png; sourceTree = ""; }; + 36AB75C814BD0866005B8045 /* device_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_prev.png; sourceTree = ""; }; + 36AB75C914BD0866005B8045 /* device_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_selection.png; sourceTree = ""; }; + 36AB75CA14BD0866005B8045 /* font_console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_console.png; sourceTree = ""; }; + 36AB75CB14BD0866005B8045 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + 36AB75CC14BD0866005B8045 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + 36AB75CD14BD0866005B8045 /* menu_boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_boot.png; sourceTree = ""; }; + 36AB75CE14BD0866005B8045 /* menu_help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_help.png; sourceTree = ""; }; + 36AB75CF14BD0866005B8045 /* menu_ignore_caches_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches_disabled.png; sourceTree = ""; }; + 36AB75D014BD0866005B8045 /* menu_ignore_caches.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches.png; sourceTree = ""; }; + 36AB75D114BD0866005B8045 /* menu_memory_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_memory_info.png; sourceTree = ""; }; + 36AB75D214BD0866005B8045 /* menu_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_selection.png; sourceTree = ""; }; + 36AB75D314BD0866005B8045 /* menu_single_user_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user_disabled.png; sourceTree = ""; }; + 36AB75D414BD0866005B8045 /* menu_single_user.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user.png; sourceTree = ""; }; + 36AB75D514BD0866005B8045 /* menu_verbose_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose_disabled.png; sourceTree = ""; }; + 36AB75D614BD0866005B8045 /* menu_verbose.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose.png; sourceTree = ""; }; + 36AB75D714BD0866005B8045 /* menu_video_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_video_info.png; sourceTree = ""; }; + 36AB75D814BD0866005B8045 /* progress_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar_background.png; sourceTree = ""; }; + 36AB75D914BD0866005B8045 /* progress_bar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar.png; sourceTree = ""; }; + 36AB75DA14BD0866005B8045 /* text_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_next.png; sourceTree = ""; }; + 36AB75DB14BD0866005B8045 /* text_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_prev.png; sourceTree = ""; }; + 36AB75DC14BD0866005B8045 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + 36AB75DD14BD0866005B8045 /* thumb.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = thumb.png; sourceTree = ""; }; + 36AB75E114BD091C005B8045 /* InstallLog.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = InstallLog.sh; sourceTree = ""; }; + 36AB75E314BD0925005B8045 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + 36AB75E414BD092D005B8045 /* preinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = preinstall; sourceTree = ""; }; + 36AB75E514BD095E005B8045 /* Control.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Control.txt; path = OptionalSettings/Control.txt; sourceTree = ""; }; + 36AB75E614BD095E005B8045 /* General.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = General.txt; path = OptionalSettings/General.txt; sourceTree = ""; }; + 36AB75E714BD095E005B8045 /* KernelFlags.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = KernelFlags.txt; path = OptionalSettings/KernelFlags.txt; sourceTree = ""; }; + 36AB75E814BD095E005B8045 /* PowerManagement.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = PowerManagement.txt; path = OptionalSettings/PowerManagement.txt; sourceTree = ""; }; + 36AB75E914BD095E005B8045 /* Resolution.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Resolution.txt; path = OptionalSettings/Resolution.txt; sourceTree = ""; }; + 36AB75EA14BD095E005B8045 /* Video.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Video.txt; path = OptionalSettings/Video.txt; sourceTree = ""; }; + 65ED53931204B83200B22507 /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; + 6DBAFD1313B0D21E0047ED33 /* modules_support.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = modules_support.s; sourceTree = ""; }; + 6DBAFD1413B0D21E0047ED33 /* modules.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = modules.c; sourceTree = ""; }; + 6DBAFD1513B0D21E0047ED33 /* modules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modules.h; sourceTree = ""; }; + 6DBAFD1813B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFD1913B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFD1B13B0D4590047ED33 /* alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignment.h; sourceTree = ""; }; + 6DBAFD1C13B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFD1E13B0D4590047ED33 /* alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignment.h; sourceTree = ""; }; + 6DBAFD1F13B0D4590047ED33 /* asm_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm_help.h; sourceTree = ""; }; + 6DBAFD2013B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFD2113B0D4590047ED33 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpu.h; sourceTree = ""; }; + 6DBAFD2213B0D4590047ED33 /* desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = desc.h; sourceTree = ""; }; + 6DBAFD2313B0D4590047ED33 /* fenv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fenv.h; sourceTree = ""; }; + 6DBAFD2413B0D4590047ED33 /* fpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fpu.h; sourceTree = ""; }; + 6DBAFD2513B0D4590047ED33 /* frame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = frame.h; sourceTree = ""; }; + 6DBAFD2613B0D4590047ED33 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = ""; }; + 6DBAFD2713B0D4590047ED33 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math.h; sourceTree = ""; }; + 6DBAFD2813B0D4590047ED33 /* pio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pio.h; sourceTree = ""; }; + 6DBAFD2913B0D4590047ED33 /* reg_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reg_help.h; sourceTree = ""; }; + 6DBAFD2A13B0D4590047ED33 /* sel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sel.h; sourceTree = ""; }; + 6DBAFD2B13B0D4590047ED33 /* table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = table.h; sourceTree = ""; }; + 6DBAFD2C13B0D4590047ED33 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; + 6DBAFD2E13B0D4590047ED33 /* alignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alignment.h; sourceTree = ""; }; + 6DBAFD2F13B0D4590047ED33 /* asm_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm_help.h; sourceTree = ""; }; + 6DBAFD3013B0D4590047ED33 /* basic_regs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basic_regs.h; sourceTree = ""; }; + 6DBAFD3113B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFD3213B0D4590047ED33 /* cframe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cframe.h; sourceTree = ""; }; + 6DBAFD3313B0D4590047ED33 /* fenv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fenv.h; sourceTree = ""; }; + 6DBAFD3413B0D4590047ED33 /* fp_regs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp_regs.h; sourceTree = ""; }; + 6DBAFD3513B0D4590047ED33 /* macro_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macro_help.h; sourceTree = ""; }; + 6DBAFD3613B0D4590047ED33 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math.h; sourceTree = ""; }; + 6DBAFD3713B0D4590047ED33 /* mode_independent_asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mode_independent_asm.h; sourceTree = ""; }; + 6DBAFD3813B0D4590047ED33 /* pseudo_inst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pseudo_inst.h; sourceTree = ""; }; + 6DBAFD3913B0D4590047ED33 /* reg_help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reg_help.h; sourceTree = ""; }; + 6DBAFD3A13B0D4590047ED33 /* assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = ""; }; + 6DBAFD3B13B0D4590047ED33 /* ctype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctype.h; sourceTree = ""; }; + 6DBAFD3D13B0D4590047ED33 /* device_port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_port.h; sourceTree = ""; }; + 6DBAFD3E13B0D4590047ED33 /* device_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_types.h; sourceTree = ""; }; + 6DBAFD3F13B0D4590047ED33 /* errno.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = errno.h; sourceTree = ""; }; + 6DBAFD4013B0D4590047ED33 /* float.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = float.h; sourceTree = ""; }; + 6DBAFD4213B0D4590047ED33 /* hfs_encodings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_encodings.h; sourceTree = ""; }; + 6DBAFD4313B0D4590047ED33 /* hfs_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_format.h; sourceTree = ""; }; + 6DBAFD4413B0D4590047ED33 /* hfs_mount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_mount.h; sourceTree = ""; }; + 6DBAFD4613B0D4590047ED33 /* _limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _limits.h; sourceTree = ""; }; + 6DBAFD4713B0D4590047ED33 /* _param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _param.h; sourceTree = ""; }; + 6DBAFD4813B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFD4913B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFD4A13B0D4590047ED33 /* eflags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = eflags.h; sourceTree = ""; }; + 6DBAFD4B13B0D4590047ED33 /* endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = endian.h; sourceTree = ""; }; + 6DBAFD4C13B0D4590047ED33 /* fasttrap_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fasttrap_isa.h; sourceTree = ""; }; + 6DBAFD4D13B0D4590047ED33 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + 6DBAFD4E13B0D4590047ED33 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = ""; }; + 6DBAFD4F13B0D4590047ED33 /* profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = profile.h; sourceTree = ""; }; + 6DBAFD5013B0D4590047ED33 /* setjmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; + 6DBAFD5113B0D4590047ED33 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + 6DBAFD5213B0D4590047ED33 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 6DBAFD5313B0D4590047ED33 /* user_ldt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = user_ldt.h; sourceTree = ""; }; + 6DBAFD5413B0D4590047ED33 /* vmparam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vmparam.h; sourceTree = ""; }; + 6DBAFD5513B0D4590047ED33 /* inttypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inttypes.h; sourceTree = ""; }; + 6DBAFD5813B0D4590047ED33 /* IOACPIPlatformDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOACPIPlatformDevice.h; sourceTree = ""; }; + 6DBAFD5913B0D4590047ED33 /* IOACPIPlatformExpert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOACPIPlatformExpert.h; sourceTree = ""; }; + 6DBAFD5A13B0D4590047ED33 /* IOACPITypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOACPITypes.h; sourceTree = ""; }; + 6DBAFD5B13B0D4590047ED33 /* assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assert.h; sourceTree = ""; }; + 6DBAFD5D13B0D4590047ED33 /* ATADeviceNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATADeviceNub.h; sourceTree = ""; }; + 6DBAFD5E13B0D4590047ED33 /* ATATimerEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATATimerEventSource.h; sourceTree = ""; }; + 6DBAFD5F13B0D4590047ED33 /* IOATABusCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATABusCommand.h; sourceTree = ""; }; + 6DBAFD6013B0D4590047ED33 /* IOATABusInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATABusInfo.h; sourceTree = ""; }; + 6DBAFD6113B0D4590047ED33 /* IOATACommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATACommand.h; sourceTree = ""; }; + 6DBAFD6213B0D4590047ED33 /* IOATAController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATAController.h; sourceTree = ""; }; + 6DBAFD6313B0D4590047ED33 /* IOATADevConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATADevConfig.h; sourceTree = ""; }; + 6DBAFD6413B0D4590047ED33 /* IOATADevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATADevice.h; sourceTree = ""; }; + 6DBAFD6513B0D4590047ED33 /* IOATARegI386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATARegI386.h; sourceTree = ""; }; + 6DBAFD6613B0D4590047ED33 /* IOATATypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATATypes.h; sourceTree = ""; }; + 6DBAFD6713B0D4590047ED33 /* IOPCIATA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPCIATA.h; sourceTree = ""; }; + 6DBAFD6813B0D4590047ED33 /* MacIOATA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacIOATA.h; sourceTree = ""; }; + 6DBAFD6A13B0D4590047ED33 /* IOAudioControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioControl.h; sourceTree = ""; }; + 6DBAFD6B13B0D4590047ED33 /* IOAudioControlUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioControlUserClient.h; sourceTree = ""; }; + 6DBAFD6C13B0D4590047ED33 /* IOAudioDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioDebug.h; sourceTree = ""; }; + 6DBAFD6D13B0D4590047ED33 /* IOAudioDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioDefines.h; sourceTree = ""; }; + 6DBAFD6E13B0D4590047ED33 /* IOAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioDevice.h; sourceTree = ""; }; + 6DBAFD6F13B0D4590047ED33 /* IOAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioEngine.h; sourceTree = ""; }; + 6DBAFD7013B0D4590047ED33 /* IOAudioEngineUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioEngineUserClient.h; sourceTree = ""; }; + 6DBAFD7113B0D4590047ED33 /* IOAudioLevelControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioLevelControl.h; sourceTree = ""; }; + 6DBAFD7213B0D4590047ED33 /* IOAudioPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioPort.h; sourceTree = ""; }; + 6DBAFD7313B0D4590047ED33 /* IOAudioSelectorControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioSelectorControl.h; sourceTree = ""; }; + 6DBAFD7413B0D4590047ED33 /* IOAudioStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioStream.h; sourceTree = ""; }; + 6DBAFD7513B0D4590047ED33 /* IOAudioToggleControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioToggleControl.h; sourceTree = ""; }; + 6DBAFD7613B0D4590047ED33 /* IOAudioTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAudioTypes.h; sourceTree = ""; }; + 6DBAFD7813B0D4590047ED33 /* IOFireWireAVCCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCCommand.h; sourceTree = ""; }; + 6DBAFD7913B0D4590047ED33 /* IOFireWireAVCConsts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCConsts.h; sourceTree = ""; }; + 6DBAFD7A13B0D4590047ED33 /* IOFireWireAVCRequestSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCRequestSpace.h; sourceTree = ""; }; + 6DBAFD7B13B0D4590047ED33 /* IOFireWireAVCTargetSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCTargetSpace.h; sourceTree = ""; }; + 6DBAFD7C13B0D4590047ED33 /* IOFireWireAVCUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCUnit.h; sourceTree = ""; }; + 6DBAFD7D13B0D4590047ED33 /* IOFireWireAVCUserClientCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireAVCUserClientCommon.h; sourceTree = ""; }; + 6DBAFD7E13B0D4590047ED33 /* IOFireWirePCRSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWirePCRSpace.h; sourceTree = ""; }; + 6DBAFD8013B0D4590047ED33 /* Bluetooth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bluetooth.h; sourceTree = ""; }; + 6DBAFD8113B0D4590047ED33 /* BluetoothAssignedNumbers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BluetoothAssignedNumbers.h; sourceTree = ""; }; + 6DBAFD8213B0D4590047ED33 /* IOBluetoothHCIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHCIController.h; sourceTree = ""; }; + 6DBAFD8313B0D4590047ED33 /* IOBluetoothHCIRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHCIRequest.h; sourceTree = ""; }; + 6DBAFD8413B0D4590047ED33 /* IOBluetoothHIDDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHIDDriver.h; sourceTree = ""; }; + 6DBAFD8513B0D4590047ED33 /* IOBluetoothHIDDriverTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothHIDDriverTypes.h; sourceTree = ""; }; + 6DBAFD8613B0D4590047ED33 /* IOBluetoothInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothInternal.h; sourceTree = ""; }; + 6DBAFD8713B0D4590047ED33 /* IOBluetoothTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBluetoothTypes.h; sourceTree = ""; }; + 6DBAFD8913B0D4590047ED33 /* IOConfigDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOConfigDirectory.h; sourceTree = ""; }; + 6DBAFD8A13B0D4590047ED33 /* IOFireWireBus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireBus.h; sourceTree = ""; }; + 6DBAFD8B13B0D4590047ED33 /* IOFireWireController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireController.h; sourceTree = ""; }; + 6DBAFD8C13B0D4590047ED33 /* IOFireWireDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireDevice.h; sourceTree = ""; }; + 6DBAFD8D13B0D4590047ED33 /* IOFireWireFamilyCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireFamilyCommon.h; sourceTree = ""; }; + 6DBAFD8E13B0D4590047ED33 /* IOFireWireIRMAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireIRMAllocation.h; sourceTree = ""; }; + 6DBAFD8F13B0D4590047ED33 /* IOFireWireLocalNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireLocalNode.h; sourceTree = ""; }; + 6DBAFD9013B0D4590047ED33 /* IOFireWireMultiIsochReceive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireMultiIsochReceive.h; sourceTree = ""; }; + 6DBAFD9113B0D4590047ED33 /* IOFireWireNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireNub.h; sourceTree = ""; }; + 6DBAFD9213B0D4590047ED33 /* IOFireWirePowerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWirePowerManager.h; sourceTree = ""; }; + 6DBAFD9313B0D4590047ED33 /* IOFireWireUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireUnit.h; sourceTree = ""; }; + 6DBAFD9413B0D4590047ED33 /* IOFWAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWAddressSpace.h; sourceTree = ""; }; + 6DBAFD9513B0D4590047ED33 /* IOFWAsyncStreamListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWAsyncStreamListener.h; sourceTree = ""; }; + 6DBAFD9613B0D4590047ED33 /* IOFWCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWCommand.h; sourceTree = ""; }; + 6DBAFD9713B0D4590047ED33 /* IOFWDCL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCL.h; sourceTree = ""; }; + 6DBAFD9813B0D4590047ED33 /* IOFWDCLPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCLPool.h; sourceTree = ""; }; + 6DBAFD9913B0D4590047ED33 /* IOFWDCLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCLProgram.h; sourceTree = ""; }; + 6DBAFD9A13B0D4590047ED33 /* IOFWDCLTranslator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWDCLTranslator.h; sourceTree = ""; }; + 6DBAFD9B13B0D4590047ED33 /* IOFWIsochChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWIsochChannel.h; sourceTree = ""; }; + 6DBAFD9C13B0D4590047ED33 /* IOFWIsochPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWIsochPort.h; sourceTree = ""; }; + 6DBAFD9D13B0D4590047ED33 /* IOFWLocalIsochPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWLocalIsochPort.h; sourceTree = ""; }; + 6DBAFD9E13B0D4590047ED33 /* IOFWPHYPacketListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWPHYPacketListener.h; sourceTree = ""; }; + 6DBAFD9F13B0D4590047ED33 /* IOFWPhysicalAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWPhysicalAddressSpace.h; sourceTree = ""; }; + 6DBAFDA013B0D4590047ED33 /* IOFWPseudoAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWPseudoAddressSpace.h; sourceTree = ""; }; + 6DBAFDA113B0D4590047ED33 /* IOFWRegs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWRegs.h; sourceTree = ""; }; + 6DBAFDA213B0D4590047ED33 /* IOFWSimpleContiguousPhysicalAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWSimpleContiguousPhysicalAddressSpace.h; sourceTree = ""; }; + 6DBAFDA313B0D4590047ED33 /* IOFWSimplePhysicalAddressSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWSimplePhysicalAddressSpace.h; sourceTree = ""; }; + 6DBAFDA413B0D4590047ED33 /* IOFWSyncer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWSyncer.h; sourceTree = ""; }; + 6DBAFDA513B0D4590047ED33 /* IOFWUserObjectExporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWUserObjectExporter.h; sourceTree = ""; }; + 6DBAFDA613B0D4590047ED33 /* IOFWUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFWUtils.h; sourceTree = ""; }; + 6DBAFDA713B0D4590047ED33 /* IOLocalConfigDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLocalConfigDirectory.h; sourceTree = ""; }; + 6DBAFDA813B0D4590047ED33 /* IORemoteConfigDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORemoteConfigDirectory.h; sourceTree = ""; }; + 6DBAFDAA13B0D4590047ED33 /* IOAccelClientConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelClientConnect.h; sourceTree = ""; }; + 6DBAFDAB13B0D4590047ED33 /* IOAccelerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelerator.h; sourceTree = ""; }; + 6DBAFDAC13B0D4590047ED33 /* IOAccelSurfaceConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelSurfaceConnect.h; sourceTree = ""; }; + 6DBAFDAD13B0D4590047ED33 /* IOAccelTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAccelTypes.h; sourceTree = ""; }; + 6DBAFDAE13B0D4590047ED33 /* IODisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODisplay.h; sourceTree = ""; }; + 6DBAFDAF13B0D4590047ED33 /* IOFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFramebuffer.h; sourceTree = ""; }; + 6DBAFDB013B0D4590047ED33 /* IOFramebufferShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFramebufferShared.h; sourceTree = ""; }; + 6DBAFDB113B0D4590047ED33 /* IOGraphicsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsDevice.h; sourceTree = ""; }; + 6DBAFDB213B0D4590047ED33 /* IOGraphicsEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsEngine.h; sourceTree = ""; }; + 6DBAFDB313B0D4590047ED33 /* IOGraphicsInterfaceTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsInterfaceTypes.h; sourceTree = ""; }; + 6DBAFDB413B0D4590047ED33 /* IOGraphicsTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGraphicsTypes.h; sourceTree = ""; }; + 6DBAFDB613B0D4590047ED33 /* IOHIDDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDDevice.h; sourceTree = ""; }; + 6DBAFDB713B0D4590047ED33 /* IOHIDElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDElement.h; sourceTree = ""; }; + 6DBAFDB813B0D4590047ED33 /* IOHIDInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDInterface.h; sourceTree = ""; }; + 6DBAFDB913B0D4590047ED33 /* IOHIDKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDKeys.h; sourceTree = ""; }; + 6DBAFDBA13B0D4590047ED33 /* IOHIDUsageTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDUsageTables.h; sourceTree = ""; }; + 6DBAFDBC13B0D4590047ED33 /* IOHIDEventDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDEventDriver.h; sourceTree = ""; }; + 6DBAFDBD13B0D4590047ED33 /* IOHIDEventService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDEventService.h; sourceTree = ""; }; + 6DBAFDBF13B0D4590047ED33 /* ev_keymap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ev_keymap.h; sourceTree = ""; }; + 6DBAFDC013B0D4590047ED33 /* IOHIDDescriptorParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDDescriptorParser.h; sourceTree = ""; }; + 6DBAFDC113B0D4590047ED33 /* IOHIDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDevice.h; sourceTree = ""; }; + 6DBAFDC213B0D4590047ED33 /* IOHIDParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDParameter.h; sourceTree = ""; }; + 6DBAFDC313B0D4590047ED33 /* IOHIDShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDShared.h; sourceTree = ""; }; + 6DBAFDC413B0D4590047ED33 /* IOHIDSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDSystem.h; sourceTree = ""; }; + 6DBAFDC513B0D4590047ED33 /* IOHIDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDTypes.h; sourceTree = ""; }; + 6DBAFDC613B0D4590047ED33 /* IOHIDUsageTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIDUsageTables.h; sourceTree = ""; }; + 6DBAFDC713B0D4590047ED33 /* IOHIKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIKeyboard.h; sourceTree = ""; }; + 6DBAFDC813B0D4590047ED33 /* IOHIKeyboardMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIKeyboardMapper.h; sourceTree = ""; }; + 6DBAFDC913B0D4590047ED33 /* IOHIPointing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHIPointing.h; sourceTree = ""; }; + 6DBAFDCA13B0D4590047ED33 /* IOLLEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLLEvent.h; sourceTree = ""; }; + 6DBAFDCC13B0D4590047ED33 /* IOI2CInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOI2CInterface.h; sourceTree = ""; }; + 6DBAFDCD13B0D4590047ED33 /* IOBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBSD.h; sourceTree = ""; }; + 6DBAFDCE13B0D4590047ED33 /* IOBufferMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBufferMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDCF13B0D4590047ED33 /* IOCatalogue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCatalogue.h; sourceTree = ""; }; + 6DBAFDD013B0D4590047ED33 /* IOCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCommand.h; sourceTree = ""; }; + 6DBAFDD113B0D4590047ED33 /* IOCommandGate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCommandGate.h; sourceTree = ""; }; + 6DBAFDD213B0D4590047ED33 /* IOCommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCommandPool.h; sourceTree = ""; }; + 6DBAFDD313B0D4590047ED33 /* IOConditionLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOConditionLock.h; sourceTree = ""; }; + 6DBAFDD413B0D4590047ED33 /* IODataQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODataQueue.h; sourceTree = ""; }; + 6DBAFDD513B0D4590047ED33 /* IODataQueueShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODataQueueShared.h; sourceTree = ""; }; + 6DBAFDD613B0D4590047ED33 /* IODeviceMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODeviceMemory.h; sourceTree = ""; }; + 6DBAFDD713B0D4590047ED33 /* IODeviceTreeSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODeviceTreeSupport.h; sourceTree = ""; }; + 6DBAFDD813B0D4590047ED33 /* IODMACommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODMACommand.h; sourceTree = ""; }; + 6DBAFDD913B0D4590047ED33 /* IODMAController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODMAController.h; sourceTree = ""; }; + 6DBAFDDA13B0D4590047ED33 /* IODMAEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODMAEventSource.h; sourceTree = ""; }; + 6DBAFDDB13B0D4590047ED33 /* IOEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEventSource.h; sourceTree = ""; }; + 6DBAFDDC13B0D4590047ED33 /* IOFilterInterruptEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFilterInterruptEventSource.h; sourceTree = ""; }; + 6DBAFDDD13B0D4590047ED33 /* IOInterleavedMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterleavedMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDDE13B0D4590047ED33 /* IOInterruptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterruptController.h; sourceTree = ""; }; + 6DBAFDDF13B0D4590047ED33 /* IOInterruptEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterruptEventSource.h; sourceTree = ""; }; + 6DBAFDE013B0D4590047ED33 /* IOInterrupts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOInterrupts.h; sourceTree = ""; }; + 6DBAFDE113B0D4590047ED33 /* IOKitDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitDebug.h; sourceTree = ""; }; + 6DBAFDE213B0D4590047ED33 /* IOKitKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitKeys.h; sourceTree = ""; }; + 6DBAFDE313B0D4590047ED33 /* IOKitServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitServer.h; sourceTree = ""; }; + 6DBAFDE413B0D4590047ED33 /* IOLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLib.h; sourceTree = ""; }; + 6DBAFDE513B0D4590047ED33 /* IOLocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOLocks.h; sourceTree = ""; }; + 6DBAFDE613B0D4590047ED33 /* IOMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMapper.h; sourceTree = ""; }; + 6DBAFDE713B0D4590047ED33 /* IOMemoryCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMemoryCursor.h; sourceTree = ""; }; + 6DBAFDE813B0D4590047ED33 /* IOMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDE913B0D4590047ED33 /* IOMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMessage.h; sourceTree = ""; }; + 6DBAFDEA13B0D4590047ED33 /* IOMultiMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMultiMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDEB13B0D4590047ED33 /* IONotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONotifier.h; sourceTree = ""; }; + 6DBAFDEC13B0D4590047ED33 /* IONVRAM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONVRAM.h; sourceTree = ""; }; + 6DBAFDED13B0D4590047ED33 /* IOPlatformExpert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPlatformExpert.h; sourceTree = ""; }; + 6DBAFDEE13B0D4590047ED33 /* IORangeAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORangeAllocator.h; sourceTree = ""; }; + 6DBAFDEF13B0D4590047ED33 /* IORegistryEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORegistryEntry.h; sourceTree = ""; }; + 6DBAFDF013B0D4590047ED33 /* IOReturn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOReturn.h; sourceTree = ""; }; + 6DBAFDF113B0D4590047ED33 /* IOService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOService.h; sourceTree = ""; }; + 6DBAFDF213B0D4590047ED33 /* IOServicePM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOServicePM.h; sourceTree = ""; }; + 6DBAFDF313B0D4590047ED33 /* IOSharedDataQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSharedDataQueue.h; sourceTree = ""; }; + 6DBAFDF413B0D4590047ED33 /* IOSharedLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSharedLock.h; sourceTree = ""; }; + 6DBAFDF513B0D4590047ED33 /* IOSubMemoryDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSubMemoryDescriptor.h; sourceTree = ""; }; + 6DBAFDF613B0D4590047ED33 /* IOSyncer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSyncer.h; sourceTree = ""; }; + 6DBAFDF713B0D4590047ED33 /* IOTimerEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTimerEventSource.h; sourceTree = ""; }; + 6DBAFDF813B0D4590047ED33 /* IOTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTimeStamp.h; sourceTree = ""; }; + 6DBAFDF913B0D4590047ED33 /* IOTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOTypes.h; sourceTree = ""; }; + 6DBAFDFA13B0D4590047ED33 /* IOUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUserClient.h; sourceTree = ""; }; + 6DBAFDFB13B0D4590047ED33 /* IOWorkLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOWorkLoop.h; sourceTree = ""; }; + 6DBAFDFD13B0D4590047ED33 /* IOMacOSTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMacOSTypes.h; sourceTree = ""; }; + 6DBAFDFE13B0D4590047ED33 /* IOMacOSVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMacOSVideo.h; sourceTree = ""; }; + 6DBAFDFF13B0D4590047ED33 /* IONDRVFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONDRVFramebuffer.h; sourceTree = ""; }; + 6DBAFE0013B0D4590047ED33 /* IONDRVLibraries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONDRVLibraries.h; sourceTree = ""; }; + 6DBAFE0113B0D4590047ED33 /* IONDRVSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONDRVSupport.h; sourceTree = ""; }; + 6DBAFE0313B0D4590047ED33 /* IOBasicOutputQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBasicOutputQueue.h; sourceTree = ""; }; + 6DBAFE0413B0D4590047ED33 /* IOEthernetController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetController.h; sourceTree = ""; }; + 6DBAFE0513B0D4590047ED33 /* IOEthernetInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetInterface.h; sourceTree = ""; }; + 6DBAFE0613B0D4590047ED33 /* IOEthernetStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOEthernetStats.h; sourceTree = ""; }; + 6DBAFE0713B0D4590047ED33 /* IOGatedOutputQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGatedOutputQueue.h; sourceTree = ""; }; + 6DBAFE0813B0D4590047ED33 /* IOKernelDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKernelDebugger.h; sourceTree = ""; }; + 6DBAFE0913B0D4590047ED33 /* IOMbufMemoryCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMbufMemoryCursor.h; sourceTree = ""; }; + 6DBAFE0A13B0D4590047ED33 /* IONetworkController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkController.h; sourceTree = ""; }; + 6DBAFE0B13B0D4590047ED33 /* IONetworkData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkData.h; sourceTree = ""; }; + 6DBAFE0C13B0D4590047ED33 /* IONetworkInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkInterface.h; sourceTree = ""; }; + 6DBAFE0D13B0D4590047ED33 /* IONetworkMedium.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkMedium.h; sourceTree = ""; }; + 6DBAFE0E13B0D4590047ED33 /* IONetworkStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONetworkStats.h; sourceTree = ""; }; + 6DBAFE0F13B0D4590047ED33 /* IOOutputQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOOutputQueue.h; sourceTree = ""; }; + 6DBAFE1013B0D4590047ED33 /* IOPacketQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPacketQueue.h; sourceTree = ""; }; + 6DBAFE1213B0D4590047ED33 /* IONVRAMController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IONVRAMController.h; sourceTree = ""; }; + 6DBAFE1313B0D4590047ED33 /* OSMessageNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSMessageNotification.h; sourceTree = ""; }; + 6DBAFE1513B0D4590047ED33 /* IOAGPDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAGPDevice.h; sourceTree = ""; }; + 6DBAFE1613B0D4590047ED33 /* IOPCIBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPCIBridge.h; sourceTree = ""; }; + 6DBAFE1713B0D4590047ED33 /* IOPCIDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPCIDevice.h; sourceTree = ""; }; + 6DBAFE1913B0D4590047ED33 /* AppleMacIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleMacIO.h; sourceTree = ""; }; + 6DBAFE1A13B0D4590047ED33 /* AppleMacIODevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleMacIODevice.h; sourceTree = ""; }; + 6DBAFE1B13B0D4590047ED33 /* AppleNMI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleNMI.h; sourceTree = ""; }; + 6DBAFE1C13B0D4590047ED33 /* ApplePlatformExpert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplePlatformExpert.h; sourceTree = ""; }; + 6DBAFE1E13B0D4590047ED33 /* IOPwrController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPwrController.h; sourceTree = ""; }; + 6DBAFE2013B0D4590047ED33 /* IODBDMA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODBDMA.h; sourceTree = ""; }; + 6DBAFE2213B0D4590047ED33 /* IOPM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPM.h; sourceTree = ""; }; + 6DBAFE2313B0D4590047ED33 /* IOPMDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMDeprecated.h; sourceTree = ""; }; + 6DBAFE2413B0D4590047ED33 /* IOPMLibDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMLibDefs.h; sourceTree = ""; }; + 6DBAFE2513B0D4590047ED33 /* IOPMPowerSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMPowerSource.h; sourceTree = ""; }; + 6DBAFE2613B0D4590047ED33 /* IOPMPowerSourceList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMPowerSourceList.h; sourceTree = ""; }; + 6DBAFE2713B0D4590047ED33 /* IOPMpowerState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMpowerState.h; sourceTree = ""; }; + 6DBAFE2813B0D4590047ED33 /* IOPMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMPrivate.h; sourceTree = ""; }; + 6DBAFE2913B0D4590047ED33 /* IOPowerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPowerConnection.h; sourceTree = ""; }; + 6DBAFE2A13B0D4590047ED33 /* RootDomain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootDomain.h; sourceTree = ""; }; + 6DBAFE2C13B0D4590047ED33 /* IORTCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORTCController.h; sourceTree = ""; }; + 6DBAFE2E13B0D4590047ED33 /* IOFireWireSBP2Login.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2Login.h; sourceTree = ""; }; + 6DBAFE2F13B0D4590047ED33 /* IOFireWireSBP2LSIWorkaroundDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2LSIWorkaroundDescriptor.h; sourceTree = ""; }; + 6DBAFE3013B0D4590047ED33 /* IOFireWireSBP2LUN.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2LUN.h; sourceTree = ""; }; + 6DBAFE3113B0D4590047ED33 /* IOFireWireSBP2ManagementORB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2ManagementORB.h; sourceTree = ""; }; + 6DBAFE3213B0D4590047ED33 /* IOFireWireSBP2ORB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2ORB.h; sourceTree = ""; }; + 6DBAFE3313B0D4590047ED33 /* IOFireWireSBP2Target.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2Target.h; sourceTree = ""; }; + 6DBAFE3413B0D4590047ED33 /* IOFireWireSBP2UserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2UserClient.h; sourceTree = ""; }; + 6DBAFE3513B0D4590047ED33 /* IOFireWireSBP2UserClientCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSBP2UserClientCommon.h; sourceTree = ""; }; + 6DBAFE3613B0D4590047ED33 /* IOFireWireSerialBusProtocolTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireSerialBusProtocolTransport.h; sourceTree = ""; }; + 6DBAFE3813B0D4590047ED33 /* IOBDServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDServices.h; sourceTree = ""; }; + 6DBAFE3913B0D4590047ED33 /* IOBlockStorageServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBlockStorageServices.h; sourceTree = ""; }; + 6DBAFE3A13B0D4590047ED33 /* IOCompactDiscServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCompactDiscServices.h; sourceTree = ""; }; + 6DBAFE3B13B0D4590047ED33 /* IODVDServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDServices.h; sourceTree = ""; }; + 6DBAFE3C13B0D4590047ED33 /* IOReducedBlockServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOReducedBlockServices.h; sourceTree = ""; }; + 6DBAFE3D13B0D4590047ED33 /* IOSCSIBlockCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIBlockCommandsDevice.h; sourceTree = ""; }; + 6DBAFE3E13B0D4590047ED33 /* IOSCSIMultimediaCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIMultimediaCommandsDevice.h; sourceTree = ""; }; + 6DBAFE3F13B0D4590047ED33 /* IOSCSIPeripheralDeviceNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceNub.h; sourceTree = ""; }; + 6DBAFE4013B0D4590047ED33 /* IOSCSIPeripheralDeviceType00.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType00.h; sourceTree = ""; }; + 6DBAFE4113B0D4590047ED33 /* IOSCSIPeripheralDeviceType05.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType05.h; sourceTree = ""; }; + 6DBAFE4213B0D4590047ED33 /* IOSCSIPeripheralDeviceType07.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType07.h; sourceTree = ""; }; + 6DBAFE4313B0D4590047ED33 /* IOSCSIPeripheralDeviceType0E.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPeripheralDeviceType0E.h; sourceTree = ""; }; + 6DBAFE4413B0D4590047ED33 /* IOSCSIPrimaryCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIPrimaryCommandsDevice.h; sourceTree = ""; }; + 6DBAFE4513B0D4590047ED33 /* IOSCSIProtocolInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIProtocolInterface.h; sourceTree = ""; }; + 6DBAFE4613B0D4590047ED33 /* IOSCSIProtocolServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIProtocolServices.h; sourceTree = ""; }; + 6DBAFE4713B0D4590047ED33 /* IOSCSIReducedBlockCommandsDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIReducedBlockCommandsDevice.h; sourceTree = ""; }; + 6DBAFE4813B0D4590047ED33 /* SCSICmds_INQUIRY_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_INQUIRY_Definitions.h; sourceTree = ""; }; + 6DBAFE4913B0D4590047ED33 /* SCSICmds_MODE_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_MODE_Definitions.h; sourceTree = ""; }; + 6DBAFE4A13B0D4590047ED33 /* SCSICmds_READ_CAPACITY_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_READ_CAPACITY_Definitions.h; sourceTree = ""; }; + 6DBAFE4B13B0D4590047ED33 /* SCSICmds_REPORT_LUNS_Definitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_REPORT_LUNS_Definitions.h; sourceTree = ""; }; + 6DBAFE4C13B0D4590047ED33 /* SCSICmds_REQUEST_SENSE_Defs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICmds_REQUEST_SENSE_Defs.h; sourceTree = ""; }; + 6DBAFE4D13B0D4590047ED33 /* SCSICommandDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICommandDefinitions.h; sourceTree = ""; }; + 6DBAFE4E13B0D4590047ED33 /* SCSICommandOperationCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSICommandOperationCodes.h; sourceTree = ""; }; + 6DBAFE4F13B0D4590047ED33 /* SCSIPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSIPort.h; sourceTree = ""; }; + 6DBAFE5013B0D4590047ED33 /* SCSITask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSITask.h; sourceTree = ""; }; + 6DBAFE5213B0D4590047ED33 /* IOSCSIParallelInterfaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSCSIParallelInterfaceController.h; sourceTree = ""; }; + 6DBAFE5413B0D4590047ED33 /* IOModemSerialStreamSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOModemSerialStreamSync.h; sourceTree = ""; }; + 6DBAFE5513B0D4590047ED33 /* IORS232SerialStreamSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IORS232SerialStreamSync.h; sourceTree = ""; }; + 6DBAFE5613B0D4590047ED33 /* IOSerialDriverSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSerialDriverSync.h; sourceTree = ""; }; + 6DBAFE5713B0D4590047ED33 /* IOSerialKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSerialKeys.h; sourceTree = ""; }; + 6DBAFE5813B0D4590047ED33 /* IOSerialStreamSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSerialStreamSync.h; sourceTree = ""; }; + 6DBAFE5B13B0D4590047ED33 /* IOATAPIProtocolTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATAPIProtocolTransport.h; sourceTree = ""; }; + 6DBAFE5C13B0D4590047ED33 /* IOATAStorageDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOATAStorageDefines.h; sourceTree = ""; }; + 6DBAFE5D13B0D4590047ED33 /* IOAppleLabelScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOAppleLabelScheme.h; sourceTree = ""; }; + 6DBAFE5E13B0D4590047ED33 /* IOApplePartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOApplePartitionScheme.h; sourceTree = ""; }; + 6DBAFE5F13B0D4590047ED33 /* IOBDBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6013B0D4590047ED33 /* IOBDBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6113B0D4590047ED33 /* IOBDMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDMedia.h; sourceTree = ""; }; + 6DBAFE6213B0D4590047ED33 /* IOBDMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE6313B0D4590047ED33 /* IOBDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBDTypes.h; sourceTree = ""; }; + 6DBAFE6413B0D4590047ED33 /* IOBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6513B0D4590047ED33 /* IOBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6613B0D4590047ED33 /* IOCDBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6713B0D4590047ED33 /* IOCDBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6813B0D4590047ED33 /* IOCDMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDMedia.h; sourceTree = ""; }; + 6DBAFE6913B0D4590047ED33 /* IOCDMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE6A13B0D4590047ED33 /* IOCDPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDPartitionScheme.h; sourceTree = ""; }; + 6DBAFE6B13B0D4590047ED33 /* IOCDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOCDTypes.h; sourceTree = ""; }; + 6DBAFE6C13B0D4590047ED33 /* IODVDBlockStorageDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDBlockStorageDevice.h; sourceTree = ""; }; + 6DBAFE6D13B0D4590047ED33 /* IODVDBlockStorageDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDBlockStorageDriver.h; sourceTree = ""; }; + 6DBAFE6E13B0D4590047ED33 /* IODVDMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDMedia.h; sourceTree = ""; }; + 6DBAFE6F13B0D4590047ED33 /* IODVDMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE7013B0D4590047ED33 /* IODVDTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IODVDTypes.h; sourceTree = ""; }; + 6DBAFE7113B0D4590047ED33 /* IOFDiskPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFDiskPartitionScheme.h; sourceTree = ""; }; + 6DBAFE7213B0D4590047ED33 /* IOFilterScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFilterScheme.h; sourceTree = ""; }; + 6DBAFE7313B0D4590047ED33 /* IOFireWireStorageCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOFireWireStorageCharacteristics.h; sourceTree = ""; }; + 6DBAFE7413B0D4590047ED33 /* IOGUIDPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOGUIDPartitionScheme.h; sourceTree = ""; }; + 6DBAFE7513B0D4590047ED33 /* IOMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMedia.h; sourceTree = ""; }; + 6DBAFE7613B0D4590047ED33 /* IOMediaBSDClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOMediaBSDClient.h; sourceTree = ""; }; + 6DBAFE7713B0D4590047ED33 /* IOPartitionScheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPartitionScheme.h; sourceTree = ""; }; + 6DBAFE7813B0D4590047ED33 /* IOStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStorage.h; sourceTree = ""; }; + 6DBAFE7913B0D4590047ED33 /* IOStorageDeviceCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStorageDeviceCharacteristics.h; sourceTree = ""; }; + 6DBAFE7A13B0D4590047ED33 /* IOStorageProtocolCharacteristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStorageProtocolCharacteristics.h; sourceTree = ""; }; + 6DBAFE7C13B0D4590047ED33 /* IOStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStream.h; sourceTree = ""; }; + 6DBAFE7D13B0D4590047ED33 /* IOStreamFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStreamFamily.h; sourceTree = ""; }; + 6DBAFE7E13B0D4590047ED33 /* IOStreamShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStreamShared.h; sourceTree = ""; }; + 6DBAFE7F13B0D4590047ED33 /* IOStreamUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOStreamUserClient.h; sourceTree = ""; }; + 6DBAFE8013B0D4590047ED33 /* system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = system.h; sourceTree = ""; }; + 6DBAFE8213B0D4590047ED33 /* IOWatchDogTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOWatchDogTimer.h; sourceTree = ""; }; + 6DBAFE8413B0D4590047ED33 /* IOUFIStorageServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUFIStorageServices.h; sourceTree = ""; }; + 6DBAFE8513B0D4590047ED33 /* IOUSBBus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBBus.h; sourceTree = ""; }; + 6DBAFE8613B0D4590047ED33 /* IOUSBCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBCommand.h; sourceTree = ""; }; + 6DBAFE8713B0D4590047ED33 /* IOUSBCompositeDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBCompositeDriver.h; sourceTree = ""; }; + 6DBAFE8813B0D4590047ED33 /* IOUSBController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBController.h; sourceTree = ""; }; + 6DBAFE8913B0D4590047ED33 /* IOUSBControllerListElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBControllerListElement.h; sourceTree = ""; }; + 6DBAFE8A13B0D4590047ED33 /* IOUSBControllerV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBControllerV2.h; sourceTree = ""; }; + 6DBAFE8B13B0D4590047ED33 /* IOUSBControllerV3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBControllerV3.h; sourceTree = ""; }; + 6DBAFE8C13B0D4590047ED33 /* IOUSBDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBDevice.h; sourceTree = ""; }; + 6DBAFE8D13B0D4590047ED33 /* IOUSBHIDDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBHIDDriver.h; sourceTree = ""; }; + 6DBAFE8E13B0D4590047ED33 /* IOUSBHubDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBHubDevice.h; sourceTree = ""; }; + 6DBAFE8F13B0D4590047ED33 /* IOUSBHubPolicyMaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBHubPolicyMaker.h; sourceTree = ""; }; + 6DBAFE9013B0D4590047ED33 /* IOUSBInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBInterface.h; sourceTree = ""; }; + 6DBAFE9113B0D4590047ED33 /* IOUSBLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBLog.h; sourceTree = ""; }; + 6DBAFE9213B0D4590047ED33 /* IOUSBMassStorageClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBMassStorageClass.h; sourceTree = ""; }; + 6DBAFE9313B0D4590047ED33 /* IOUSBMassStorageUFISubclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBMassStorageUFISubclass.h; sourceTree = ""; }; + 6DBAFE9413B0D4590047ED33 /* IOUSBNub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBNub.h; sourceTree = ""; }; + 6DBAFE9513B0D4590047ED33 /* IOUSBPipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBPipe.h; sourceTree = ""; }; + 6DBAFE9613B0D4590047ED33 /* IOUSBRootHubDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBRootHubDevice.h; sourceTree = ""; }; + 6DBAFE9713B0D4590047ED33 /* IOUSBUserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBUserClient.h; sourceTree = ""; }; + 6DBAFE9813B0D4590047ED33 /* IOUSBWorkLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOUSBWorkLoop.h; sourceTree = ""; }; + 6DBAFE9913B0D4590047ED33 /* USB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USB.h; sourceTree = ""; }; + 6DBAFE9A13B0D4590047ED33 /* USBHub.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USBHub.h; sourceTree = ""; }; + 6DBAFE9B13B0D4590047ED33 /* USBSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USBSpec.h; sourceTree = ""; }; + 6DBAFE9C13B0D4590047ED33 /* USBTracepoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = USBTracepoints.h; sourceTree = ""; }; + 6DBAFE9E13B0D4590047ED33 /* _OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA013B0D4590047ED33 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; + 6DBAFEA113B0D4590047ED33 /* sha1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha1.h; sourceTree = ""; }; + 6DBAFEA313B0D4590047ED33 /* _OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA413B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA613B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA713B0D4590047ED33 /* OSAtomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAtomic.h; sourceTree = ""; }; + 6DBAFEA813B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEA913B0D4590047ED33 /* OSCacheControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSCacheControl.h; sourceTree = ""; }; + 6DBAFEAA13B0D4590047ED33 /* OSDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSDebug.h; sourceTree = ""; }; + 6DBAFEAB13B0D4590047ED33 /* OSKextLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSKextLib.h; sourceTree = ""; }; + 6DBAFEAC13B0D4590047ED33 /* OSReturn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSReturn.h; sourceTree = ""; }; + 6DBAFEAD13B0D4590047ED33 /* OSTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSTypes.h; sourceTree = ""; }; + 6DBAFEAF13B0D4590047ED33 /* OSByteOrder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSByteOrder.h; sourceTree = ""; }; + 6DBAFEB013B0D4590047ED33 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + 6DBAFEB113B0D4590047ED33 /* locale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = locale.h; sourceTree = ""; }; + 6DBAFEB313B0D4590047ED33 /* audit_triggers.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = audit_triggers.defs; sourceTree = ""; }; + 6DBAFEB413B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFEB513B0D4590047ED33 /* bootstrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstrap.h; sourceTree = ""; }; + 6DBAFEB613B0D4590047ED33 /* clock.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock.defs; sourceTree = ""; }; + 6DBAFEB713B0D4590047ED33 /* clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock.h; sourceTree = ""; }; + 6DBAFEB813B0D4590047ED33 /* clock_priv.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock_priv.defs; sourceTree = ""; }; + 6DBAFEB913B0D4590047ED33 /* clock_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock_priv.h; sourceTree = ""; }; + 6DBAFEBA13B0D4590047ED33 /* clock_reply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock_reply.defs; sourceTree = ""; }; + 6DBAFEBB13B0D4590047ED33 /* clock_reply.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock_reply.h; sourceTree = ""; }; + 6DBAFEBC13B0D4590047ED33 /* clock_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = clock_types.defs; sourceTree = ""; }; + 6DBAFEBD13B0D4590047ED33 /* clock_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = clock_types.h; sourceTree = ""; }; + 6DBAFEBE13B0D4590047ED33 /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = error.h; sourceTree = ""; }; + 6DBAFEBF13B0D4590047ED33 /* exc.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = exc.defs; sourceTree = ""; }; + 6DBAFEC013B0D4590047ED33 /* exc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exc.h; sourceTree = ""; }; + 6DBAFEC113B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFEC213B0D4590047ED33 /* exception_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception_types.h; sourceTree = ""; }; + 6DBAFEC313B0D4590047ED33 /* host_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_info.h; sourceTree = ""; }; + 6DBAFEC413B0D4590047ED33 /* host_notify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_notify.h; sourceTree = ""; }; + 6DBAFEC513B0D4590047ED33 /* host_notify_reply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = host_notify_reply.defs; sourceTree = ""; }; + 6DBAFEC613B0D4590047ED33 /* host_priv.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = host_priv.defs; sourceTree = ""; }; + 6DBAFEC713B0D4590047ED33 /* host_priv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_priv.h; sourceTree = ""; }; + 6DBAFEC813B0D4590047ED33 /* host_reboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_reboot.h; sourceTree = ""; }; + 6DBAFEC913B0D4590047ED33 /* host_security.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = host_security.defs; sourceTree = ""; }; + 6DBAFECA13B0D4590047ED33 /* host_security.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_security.h; sourceTree = ""; }; + 6DBAFECB13B0D4590047ED33 /* host_special_ports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = host_special_ports.h; sourceTree = ""; }; + 6DBAFECD13B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFECE13B0D4590047ED33 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + 6DBAFECF13B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFED013B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFED113B0D4590047ED33 /* fp_reg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fp_reg.h; sourceTree = ""; }; + 6DBAFED213B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFED313B0D4590047ED33 /* machine_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = machine_types.defs; sourceTree = ""; }; + 6DBAFED413B0D4590047ED33 /* ndr_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr_def.h; sourceTree = ""; }; + 6DBAFED513B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFED613B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFED713B0D4590047ED33 /* sdt_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt_isa.h; sourceTree = ""; }; + 6DBAFED813B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFED913B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFEDA13B0D4590047ED33 /* thread_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_state.h; sourceTree = ""; }; + 6DBAFEDB13B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFEDC13B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFEDD13B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFEDE13B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFEDF13B0D4590047ED33 /* kmod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kmod.h; sourceTree = ""; }; + 6DBAFEE013B0D4590047ED33 /* ledger.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = ledger.defs; sourceTree = ""; }; + 6DBAFEE113B0D4590047ED33 /* ledger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ledger.h; sourceTree = ""; }; + 6DBAFEE213B0D4590047ED33 /* lock_set.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = lock_set.defs; sourceTree = ""; }; + 6DBAFEE313B0D4590047ED33 /* lock_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock_set.h; sourceTree = ""; }; + 6DBAFEE413B0D4590047ED33 /* mach.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach.h; sourceTree = ""; }; + 6DBAFEE513B0D4590047ED33 /* mach_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_error.h; sourceTree = ""; }; + 6DBAFEE613B0D4590047ED33 /* mach_exc.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_exc.defs; sourceTree = ""; }; + 6DBAFEE713B0D4590047ED33 /* mach_host.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_host.defs; sourceTree = ""; }; + 6DBAFEE813B0D4590047ED33 /* mach_host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_host.h; sourceTree = ""; }; + 6DBAFEE913B0D4590047ED33 /* mach_init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_init.h; sourceTree = ""; }; + 6DBAFEEA13B0D4590047ED33 /* mach_interface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_interface.h; sourceTree = ""; }; + 6DBAFEEB13B0D4590047ED33 /* mach_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_param.h; sourceTree = ""; }; + 6DBAFEEC13B0D4590047ED33 /* mach_port.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_port.defs; sourceTree = ""; }; + 6DBAFEED13B0D4590047ED33 /* mach_port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_port.h; sourceTree = ""; }; + 6DBAFEEE13B0D4590047ED33 /* mach_syscalls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_syscalls.h; sourceTree = ""; }; + 6DBAFEEF13B0D4590047ED33 /* mach_time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_time.h; sourceTree = ""; }; + 6DBAFEF013B0D4590047ED33 /* mach_traps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_traps.h; sourceTree = ""; }; + 6DBAFEF113B0D4590047ED33 /* mach_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_types.defs; sourceTree = ""; }; + 6DBAFEF213B0D4590047ED33 /* mach_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_types.h; sourceTree = ""; }; + 6DBAFEF313B0D4590047ED33 /* mach_vm.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mach_vm.defs; sourceTree = ""; }; + 6DBAFEF413B0D4590047ED33 /* mach_vm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_vm.h; sourceTree = ""; }; + 6DBAFEF613B0D4590047ED33 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + 6DBAFEF713B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFEF813B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFEF913B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFEFA13B0D4590047ED33 /* machine_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = machine_types.defs; sourceTree = ""; }; + 6DBAFEFB13B0D4590047ED33 /* ndr_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr_def.h; sourceTree = ""; }; + 6DBAFEFC13B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFEFD13B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFEFE13B0D4590047ED33 /* sdt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt.h; sourceTree = ""; }; + 6DBAFEFF13B0D4590047ED33 /* sdt_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt_isa.h; sourceTree = ""; }; + 6DBAFF0013B0D4590047ED33 /* thread_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_state.h; sourceTree = ""; }; + 6DBAFF0113B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFF0213B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFF0313B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFF0413B0D4590047ED33 /* machine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = machine.h; sourceTree = ""; }; + 6DBAFF0513B0D4590047ED33 /* memory_object_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory_object_types.h; sourceTree = ""; }; + 6DBAFF0613B0D4590047ED33 /* message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = message.h; sourceTree = ""; }; + 6DBAFF0713B0D4590047ED33 /* mig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mig.h; sourceTree = ""; }; + 6DBAFF0813B0D4590047ED33 /* mig_errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mig_errors.h; sourceTree = ""; }; + 6DBAFF0913B0D4590047ED33 /* ndr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr.h; sourceTree = ""; }; + 6DBAFF0A13B0D4590047ED33 /* notify.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = notify.defs; sourceTree = ""; }; + 6DBAFF0B13B0D4590047ED33 /* notify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = notify.h; sourceTree = ""; }; + 6DBAFF0C13B0D4590047ED33 /* policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = policy.h; sourceTree = ""; }; + 6DBAFF0D13B0D4590047ED33 /* port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = port.h; sourceTree = ""; }; + 6DBAFF0E13B0D4590047ED33 /* port_obj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = port_obj.h; sourceTree = ""; }; + 6DBAFF1013B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFF1113B0D4590047ED33 /* asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asm.h; sourceTree = ""; }; + 6DBAFF1213B0D4590047ED33 /* boolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boolean.h; sourceTree = ""; }; + 6DBAFF1313B0D4590047ED33 /* exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception.h; sourceTree = ""; }; + 6DBAFF1413B0D4590047ED33 /* kern_return.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kern_return.h; sourceTree = ""; }; + 6DBAFF1513B0D4590047ED33 /* machine_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = machine_types.defs; sourceTree = ""; }; + 6DBAFF1613B0D4590047ED33 /* ndr_def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ndr_def.h; sourceTree = ""; }; + 6DBAFF1713B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFF1813B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFF1913B0D4590047ED33 /* sdt_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt_isa.h; sourceTree = ""; }; + 6DBAFF1A13B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFF1B13B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFF1C13B0D4590047ED33 /* thread_state.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_state.h; sourceTree = ""; }; + 6DBAFF1D13B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFF1E13B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFF1F13B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFF2013B0D4590047ED33 /* processor.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = processor.defs; sourceTree = ""; }; + 6DBAFF2113B0D4590047ED33 /* processor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor.h; sourceTree = ""; }; + 6DBAFF2213B0D4590047ED33 /* processor_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_info.h; sourceTree = ""; }; + 6DBAFF2313B0D4590047ED33 /* processor_set.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = processor_set.defs; sourceTree = ""; }; + 6DBAFF2413B0D4590047ED33 /* processor_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = processor_set.h; sourceTree = ""; }; + 6DBAFF2513B0D4590047ED33 /* rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc.h; sourceTree = ""; }; + 6DBAFF2613B0D4590047ED33 /* sdt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdt.h; sourceTree = ""; }; + 6DBAFF2713B0D4590047ED33 /* security.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = security.defs; sourceTree = ""; }; + 6DBAFF2813B0D4590047ED33 /* semaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = semaphore.h; sourceTree = ""; }; + 6DBAFF2913B0D4590047ED33 /* shared_memory_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_memory_server.h; sourceTree = ""; }; + 6DBAFF2A13B0D4590047ED33 /* shared_region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared_region.h; sourceTree = ""; }; + 6DBAFF2B13B0D4590047ED33 /* std_types.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = std_types.defs; sourceTree = ""; }; + 6DBAFF2C13B0D4590047ED33 /* std_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = std_types.h; sourceTree = ""; }; + 6DBAFF2D13B0D4590047ED33 /* sync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sync.h; sourceTree = ""; }; + 6DBAFF2E13B0D4590047ED33 /* sync_policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sync_policy.h; sourceTree = ""; }; + 6DBAFF2F13B0D4590047ED33 /* task.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = task.defs; sourceTree = ""; }; + 6DBAFF3013B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFF3113B0D4590047ED33 /* task_access.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = task_access.defs; sourceTree = ""; }; + 6DBAFF3213B0D4590047ED33 /* task_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_info.h; sourceTree = ""; }; + 6DBAFF3313B0D4590047ED33 /* task_ledger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_ledger.h; sourceTree = ""; }; + 6DBAFF3413B0D4590047ED33 /* task_policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_policy.h; sourceTree = ""; }; + 6DBAFF3513B0D4590047ED33 /* task_special_ports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task_special_ports.h; sourceTree = ""; }; + 6DBAFF3613B0D4590047ED33 /* thread_act.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = thread_act.defs; sourceTree = ""; }; + 6DBAFF3713B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFF3813B0D4590047ED33 /* thread_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_info.h; sourceTree = ""; }; + 6DBAFF3913B0D4590047ED33 /* thread_policy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_policy.h; sourceTree = ""; }; + 6DBAFF3A13B0D4590047ED33 /* thread_special_ports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_special_ports.h; sourceTree = ""; }; + 6DBAFF3B13B0D4590047ED33 /* thread_status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_status.h; sourceTree = ""; }; + 6DBAFF3C13B0D4590047ED33 /* thread_switch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_switch.h; sourceTree = ""; }; + 6DBAFF3D13B0D4590047ED33 /* time_value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time_value.h; sourceTree = ""; }; + 6DBAFF3E13B0D4590047ED33 /* vm_attributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_attributes.h; sourceTree = ""; }; + 6DBAFF3F13B0D4590047ED33 /* vm_behavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_behavior.h; sourceTree = ""; }; + 6DBAFF4013B0D4590047ED33 /* vm_inherit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_inherit.h; sourceTree = ""; }; + 6DBAFF4113B0D4590047ED33 /* vm_map.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = vm_map.defs; sourceTree = ""; }; + 6DBAFF4213B0D4590047ED33 /* vm_map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_map.h; sourceTree = ""; }; + 6DBAFF4313B0D4590047ED33 /* vm_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_param.h; sourceTree = ""; }; + 6DBAFF4413B0D4590047ED33 /* vm_prot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_prot.h; sourceTree = ""; }; + 6DBAFF4513B0D4590047ED33 /* vm_purgable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_purgable.h; sourceTree = ""; }; + 6DBAFF4613B0D4590047ED33 /* vm_region.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_region.h; sourceTree = ""; }; + 6DBAFF4713B0D4590047ED33 /* vm_statistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_statistics.h; sourceTree = ""; }; + 6DBAFF4813B0D4590047ED33 /* vm_sync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_sync.h; sourceTree = ""; }; + 6DBAFF4913B0D4590047ED33 /* vm_task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_task.h; sourceTree = ""; }; + 6DBAFF4A13B0D4590047ED33 /* vm_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vm_types.h; sourceTree = ""; }; + 6DBAFF4C13B0D4590047ED33 /* task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = task.h; sourceTree = ""; }; + 6DBAFF4D13B0D4590047ED33 /* thread_act.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread_act.h; sourceTree = ""; }; + 6DBAFF4F13B0D4590047ED33 /* arch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = arch.h; sourceTree = ""; }; + 6DBAFF5013B0D4590047ED33 /* compact_unwind_encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compact_unwind_encoding.h; sourceTree = ""; }; + 6DBAFF5113B0D4590047ED33 /* dyld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dyld.h; sourceTree = ""; }; + 6DBAFF5213B0D4590047ED33 /* dyld_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dyld_images.h; sourceTree = ""; }; + 6DBAFF5313B0D4590047ED33 /* fat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fat.h; sourceTree = ""; }; + 6DBAFF5413B0D4590047ED33 /* getsect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsect.h; sourceTree = ""; }; + 6DBAFF5613B0D4590047ED33 /* swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap.h; sourceTree = ""; }; + 6DBAFF5713B0D4590047ED33 /* ldsyms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ldsyms.h; sourceTree = ""; }; + 6DBAFF5813B0D4590047ED33 /* loader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loader.h; sourceTree = ""; }; + 6DBAFF5913B0D4590047ED33 /* nlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nlist.h; sourceTree = ""; }; + 6DBAFF5B13B0D4590047ED33 /* reloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reloc.h; sourceTree = ""; }; + 6DBAFF5C13B0D4590047ED33 /* swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap.h; sourceTree = ""; }; + 6DBAFF5D13B0D4590047ED33 /* ranlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ranlib.h; sourceTree = ""; }; + 6DBAFF5E13B0D4590047ED33 /* reloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reloc.h; sourceTree = ""; }; + 6DBAFF5F13B0D4590047ED33 /* stab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stab.h; sourceTree = ""; }; + 6DBAFF6013B0D4590047ED33 /* swap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = swap.h; sourceTree = ""; }; + 6DBAFF6213B0D4590047ED33 /* reloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reloc.h; sourceTree = ""; }; + 6DBAFF6413B0D4590047ED33 /* _limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _limits.h; sourceTree = ""; }; + 6DBAFF6513B0D4590047ED33 /* _param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _param.h; sourceTree = ""; }; + 6DBAFF6613B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFF6713B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFF6813B0D4590047ED33 /* byte_order.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = byte_order.h; sourceTree = ""; }; + 6DBAFF6913B0D4590047ED33 /* endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = endian.h; sourceTree = ""; }; + 6DBAFF6A13B0D4590047ED33 /* fasttrap_isa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fasttrap_isa.h; sourceTree = ""; }; + 6DBAFF6B13B0D4590047ED33 /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + 6DBAFF6C13B0D4590047ED33 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = ""; }; + 6DBAFF6D13B0D4590047ED33 /* profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = profile.h; sourceTree = ""; }; + 6DBAFF6E13B0D4590047ED33 /* setjmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; + 6DBAFF6F13B0D4590047ED33 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + 6DBAFF7013B0D4590047ED33 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 6DBAFF7113B0D4590047ED33 /* vmparam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vmparam.h; sourceTree = ""; }; + 6DBAFF7213B0D4590047ED33 /* math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math.h; sourceTree = ""; }; + 6DBAFF7413B0D4590047ED33 /* bootp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootp.h; sourceTree = ""; }; + 6DBAFF7513B0D4590047ED33 /* icmp6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icmp6.h; sourceTree = ""; }; + 6DBAFF7613B0D4590047ED33 /* icmp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = icmp_var.h; sourceTree = ""; }; + 6DBAFF7713B0D4590047ED33 /* if_ether.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = if_ether.h; sourceTree = ""; }; + 6DBAFF7813B0D4590047ED33 /* igmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = igmp.h; sourceTree = ""; }; + 6DBAFF7913B0D4590047ED33 /* igmp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = igmp_var.h; sourceTree = ""; }; + 6DBAFF7A13B0D4590047ED33 /* in.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in.h; sourceTree = ""; }; + 6DBAFF7B13B0D4590047ED33 /* in_pcb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in_pcb.h; sourceTree = ""; }; + 6DBAFF7C13B0D4590047ED33 /* in_systm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in_systm.h; sourceTree = ""; }; + 6DBAFF7D13B0D4590047ED33 /* in_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in_var.h; sourceTree = ""; }; + 6DBAFF7E13B0D4590047ED33 /* ip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip.h; sourceTree = ""; }; + 6DBAFF7F13B0D4590047ED33 /* ip6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip6.h; sourceTree = ""; }; + 6DBAFF8013B0D4590047ED33 /* ip_fw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_fw.h; sourceTree = ""; }; + 6DBAFF8113B0D4590047ED33 /* ip_fw2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_fw2.h; sourceTree = ""; }; + 6DBAFF8213B0D4590047ED33 /* ip_icmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_icmp.h; sourceTree = ""; }; + 6DBAFF8313B0D4590047ED33 /* ip_mroute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_mroute.h; sourceTree = ""; }; + 6DBAFF8413B0D4590047ED33 /* ip_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_var.h; sourceTree = ""; }; + 6DBAFF8513B0D4590047ED33 /* tcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp.h; sourceTree = ""; }; + 6DBAFF8613B0D4590047ED33 /* tcp_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_fsm.h; sourceTree = ""; }; + 6DBAFF8713B0D4590047ED33 /* tcp_seq.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_seq.h; sourceTree = ""; }; + 6DBAFF8813B0D4590047ED33 /* tcp_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_timer.h; sourceTree = ""; }; + 6DBAFF8913B0D4590047ED33 /* tcp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_var.h; sourceTree = ""; }; + 6DBAFF8A13B0D4590047ED33 /* tcpip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpip.h; sourceTree = ""; }; + 6DBAFF8B13B0D4590047ED33 /* udp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udp.h; sourceTree = ""; }; + 6DBAFF8C13B0D4590047ED33 /* udp_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udp_var.h; sourceTree = ""; }; + 6DBAFF8E13B0D4590047ED33 /* ah.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ah.h; sourceTree = ""; }; + 6DBAFF8F13B0D4590047ED33 /* esp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = esp.h; sourceTree = ""; }; + 6DBAFF9013B0D4590047ED33 /* in6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in6.h; sourceTree = ""; }; + 6DBAFF9113B0D4590047ED33 /* in6_var.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = in6_var.h; sourceTree = ""; }; + 6DBAFF9213B0D4590047ED33 /* ip6_fw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip6_fw.h; sourceTree = ""; }; + 6DBAFF9313B0D4590047ED33 /* ip6_mroute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip6_mroute.h; sourceTree = ""; }; + 6DBAFF9413B0D4590047ED33 /* ipcomp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipcomp.h; sourceTree = ""; }; + 6DBAFF9513B0D4590047ED33 /* ipsec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipsec.h; sourceTree = ""; }; + 6DBAFF9613B0D4590047ED33 /* nd6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nd6.h; sourceTree = ""; }; + 6DBAFF9713B0D4590047ED33 /* pim6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pim6.h; sourceTree = ""; }; + 6DBAFF9813B0D4590047ED33 /* raw_ip6.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raw_ip6.h; sourceTree = ""; }; + 6DBAFF9913B0D4590047ED33 /* runetype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runetype.h; sourceTree = ""; }; + 6DBAFF9B13B0D4590047ED33 /* _common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _common.h; sourceTree = ""; }; + 6DBAFF9C13B0D4590047ED33 /* _stdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _stdio.h; sourceTree = ""; }; + 6DBAFF9D13B0D4590047ED33 /* setjmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = setjmp.h; sourceTree = ""; }; + 6DBAFF9E13B0D4590047ED33 /* signal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = signal.h; sourceTree = ""; }; + 6DBAFF9F13B0D4590047ED33 /* stdarg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdarg.h; sourceTree = ""; }; + 6DBAFFA013B0D4590047ED33 /* stdbool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdbool.h; sourceTree = ""; }; + 6DBAFFA113B0D4590047ED33 /* stddef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stddef.h; sourceTree = ""; }; + 6DBAFFA213B0D4590047ED33 /* stdint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdint.h; sourceTree = ""; }; + 6DBAFFA313B0D4590047ED33 /* stdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdio.h; sourceTree = ""; }; + 6DBAFFA413B0D4590047ED33 /* stdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdlib.h; sourceTree = ""; }; + 6DBAFFA513B0D4590047ED33 /* string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; + 6DBAFFA713B0D4590047ED33 /* _endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _endian.h; sourceTree = ""; }; + 6DBAFFA813B0D4590047ED33 /* _select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _select.h; sourceTree = ""; }; + 6DBAFFA913B0D4590047ED33 /* _structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _structs.h; sourceTree = ""; }; + 6DBAFFAA13B0D4590047ED33 /* _types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _types.h; sourceTree = ""; }; + 6DBAFFAB13B0D4590047ED33 /* appleapiopts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleapiopts.h; sourceTree = ""; }; + 6DBAFFAC13B0D4590047ED33 /* buf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buf.h; sourceTree = ""; }; + 6DBAFFAD13B0D4590047ED33 /* cdefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cdefs.h; sourceTree = ""; }; + 6DBAFFAE13B0D4590047ED33 /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; + 6DBAFFAF13B0D4590047ED33 /* kernel_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kernel_types.h; sourceTree = ""; }; + 6DBAFFB013B0D4590047ED33 /* param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = param.h; sourceTree = ""; }; + 6DBAFFB113B0D4590047ED33 /* reboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reboot.h; sourceTree = ""; }; + 6DBAFFB213B0D4590047ED33 /* select.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = select.h; sourceTree = ""; }; + 6DBAFFB313B0D4590047ED33 /* socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socket.h; sourceTree = ""; }; + 6DBAFFB413B0D4590047ED33 /* syscall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syscall.h; sourceTree = ""; }; + 6DBAFFB513B0D4590047ED33 /* syslimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = syslimits.h; sourceTree = ""; }; + 6DBAFFB613B0D4590047ED33 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + 6DBAFFB713B0D4590047ED33 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 6DBAFFB813B0D4590047ED33 /* unistd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unistd.h; sourceTree = ""; }; + 6DBAFFB913B0D4590047ED33 /* time.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time.h; sourceTree = ""; }; + 6DBAFFBC13B0D4590047ED33 /* ffs_extern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffs_extern.h; sourceTree = ""; }; + 6DBAFFBD13B0D4590047ED33 /* fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fs.h; sourceTree = ""; }; + 6DBAFFBF13B0D4590047ED33 /* dinode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dinode.h; sourceTree = ""; }; + 6DBAFFC013B0D4590047ED33 /* dir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dir.h; sourceTree = ""; }; + 6DBAFFC113B0D4590047ED33 /* inode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = inode.h; sourceTree = ""; }; + 6DBAFFC213B0D4590047ED33 /* ufs_extern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs_extern.h; sourceTree = ""; }; + 6DBAFFC313B0D4590047ED33 /* ufsmount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufsmount.h; sourceTree = ""; }; + 6DBAFFC413B0D4590047ED33 /* unistd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unistd.h; sourceTree = ""; }; + 6DBAFFC513B0D4590047ED33 /* unwind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unwind.h; sourceTree = ""; }; + A31301A71503CB9900E8C718 /* README.translators */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.translators; sourceTree = ""; }; + A354B6271495124F00D81AA5 /* ESPpostinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ESPpostinstall; sourceTree = ""; }; + A354B62A1495124F00D81AA5 /* Standardpostinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Standardpostinstall; sourceTree = ""; }; + A354B62C149514DE00D81AA5 /* CheckDiskMicrocode.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckDiskMicrocode.sh; sourceTree = ""; }; + A354B62D149514DE00D81AA5 /* CheckFatType.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckFatType.sh; sourceTree = ""; }; + A354B62E149514DE00D81AA5 /* CheckGRUBLinuxLoader.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckGRUBLinuxLoader.sh; sourceTree = ""; }; + A354B62F149514DE00D81AA5 /* CheckPartitionScheme.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckPartitionScheme.sh; sourceTree = ""; }; + A354B630149514DE00D81AA5 /* CheckPreviousChameleon.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckPreviousChameleon.sh; sourceTree = ""; }; + A354B631149514DE00D81AA5 /* CheckProceed.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckProceed.sh; sourceTree = ""; }; + A354B632149514DE00D81AA5 /* CheckWindowsDiskSignature.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = CheckWindowsDiskSignature.sh; sourceTree = ""; }; + A354B634149514DE00D81AA5 /* MountESP.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = MountESP.sh; sourceTree = ""; }; + A354B635149514DE00D81AA5 /* patch */ = {isa = PBXFileReference; lastKnownFileType = file; path = patch; sourceTree = ""; }; + A354B636149514DE00D81AA5 /* SetActivePartition.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = SetActivePartition.sh; sourceTree = ""; }; + A354B637149514DE00D81AA5 /* UnMountEFIvolumes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = UnMountEFIvolumes.sh; sourceTree = ""; }; + A354B638149514DE00D81AA5 /* WriteChameleonStage0.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = WriteChameleonStage0.sh; sourceTree = ""; }; + A354B639149514DE00D81AA5 /* WriteChameleonStage1.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = WriteChameleonStage1.sh; sourceTree = ""; }; + A354B63A149514DE00D81AA5 /* WriteChameleonStage2.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = WriteChameleonStage2.sh; sourceTree = ""; }; + A3561C731413FD7800E9B51E /* auto.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = auto.c; sourceTree = ""; }; + A3561C741413FD7800E9B51E /* auto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auto.h; sourceTree = ""; }; + A3561C751413FD7800E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561C761413FD7800E9B51E /* cmd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cmd.c; sourceTree = ""; }; + A3561C771413FD7800E9B51E /* cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cmd.h; sourceTree = ""; }; + A3561C781413FD7800E9B51E /* disk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = disk.c; sourceTree = ""; }; + A3561C791413FD7800E9B51E /* disk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disk.h; sourceTree = ""; }; + A3561C7A1413FD7800E9B51E /* fdisk.8 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fdisk.8; sourceTree = ""; }; + A3561C7B1413FD7800E9B51E /* fdisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fdisk.c; sourceTree = ""; }; + A3561C7C1413FD7800E9B51E /* getrawpartition.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getrawpartition.c; sourceTree = ""; }; + A3561C7D1413FD7800E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561C7E1413FD7800E9B51E /* mbr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mbr.c; sourceTree = ""; }; + A3561C7F1413FD7800E9B51E /* mbr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mbr.h; sourceTree = ""; }; + A3561C801413FD7800E9B51E /* mbrcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mbrcode.h; sourceTree = ""; }; + A3561C811413FD7800E9B51E /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + A3561C821413FD7800E9B51E /* misc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = misc.h; sourceTree = ""; }; + A3561C831413FD7800E9B51E /* opendev.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = opendev.c; sourceTree = ""; }; + A3561C841413FD7800E9B51E /* part.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = part.c; sourceTree = ""; }; + A3561C851413FD7800E9B51E /* part.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = part.h; sourceTree = ""; }; + A3561C861413FD7800E9B51E /* user.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = user.c; sourceTree = ""; }; + A3561C871413FD7800E9B51E /* user.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = user.h; sourceTree = ""; }; + A3561C881413FD7800E9B51E /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = ""; }; + A3561C891413FD7800E9B51E /* openUp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = openUp.c; sourceTree = ""; }; + A3561C8A1413FD7800E9B51E /* dyldsymboltool.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dyldsymboltool.c; sourceTree = ""; }; + A3561C8B1413FD7800E9B51E /* bdmesg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bdmesg.c; sourceTree = ""; }; + A3561CAC1414024C00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561CAE1414024C00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561CAF1414024C00E9B51E /* HelloWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HelloWorld.cpp; sourceTree = ""; }; + A3561CB11414024C00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561CB31414024C00E9B51E /* modules */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = modules; sourceTree = ""; }; + A3561CB81414024D00E9B51E /* __ashldi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __ashldi3.c; sourceTree = ""; }; + A3561CB91414024D00E9B51E /* __ashrdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __ashrdi3.c; sourceTree = ""; }; + A3561CBA1414024D00E9B51E /* __clzsi2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __clzsi2.c; sourceTree = ""; }; + A3561CBB1414024D00E9B51E /* __divdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __divdi3.c; sourceTree = ""; }; + A3561CBC1414024D00E9B51E /* __divsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __divsi3.c; sourceTree = ""; }; + A3561CBD1414024D00E9B51E /* __lshrdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __lshrdi3.c; sourceTree = ""; }; + A3561CBE1414024D00E9B51E /* __moddi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __moddi3.c; sourceTree = ""; }; + A3561CBF1414024D00E9B51E /* __modsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __modsi3.c; sourceTree = ""; }; + A3561CC01414024D00E9B51E /* __udivdi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivdi3.c; sourceTree = ""; }; + A3561CC11414024D00E9B51E /* __udivmoddi4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivmoddi4.c; sourceTree = ""; }; + A3561CC21414024D00E9B51E /* __udivmodsi4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivmodsi4.c; sourceTree = ""; }; + A3561CC31414024D00E9B51E /* __udivsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __udivsi3.c; sourceTree = ""; }; + A3561CC41414024D00E9B51E /* __umoddi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __umoddi3.c; sourceTree = ""; }; + A3561CC51414024D00E9B51E /* __umodsi3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __umodsi3.c; sourceTree = ""; }; + A3561CC61414024D00E9B51E /* atexit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atexit.c; sourceTree = ""; }; + A3561CC71414024D00E9B51E /* atexit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atexit.h; sourceTree = ""; }; + A3561CC81414024D00E9B51E /* atoi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atoi.c; sourceTree = ""; }; + A3561CC91414024D00E9B51E /* atol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atol.c; sourceTree = ""; }; + A3561CCA1414024D00E9B51E /* atoll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atoll.c; sourceTree = ""; }; + A3561CCB1414024D00E9B51E /* atox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = atox.c; sourceTree = ""; }; + A3561CCC1414024D00E9B51E /* bsearch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bsearch.c; sourceTree = ""; }; + A3561CCD1414024D00E9B51E /* calloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = calloc.c; sourceTree = ""; }; + A3561CCE1414024D00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561CCF1414024D00E9B51E /* exit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = exit.c; sourceTree = ""; }; + A3561CD01414024D00E9B51E /* jrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jrand48.c; sourceTree = ""; }; + A3561CD11414024D00E9B51E /* klibc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = klibc.c; sourceTree = ""; }; + A3561CD21414024D00E9B51E /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + A3561CD31414024D00E9B51E /* limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = limits.h; sourceTree = ""; }; + A3561CD41414024D00E9B51E /* lrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lrand48.c; sourceTree = ""; }; + A3561CD51414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561CD61414024D00E9B51E /* memccpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memccpy.c; sourceTree = ""; }; + A3561CD71414024D00E9B51E /* memchr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memchr.c; sourceTree = ""; }; + A3561CD81414024D00E9B51E /* memmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memmem.c; sourceTree = ""; }; + A3561CD91414024D00E9B51E /* memmove.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memmove.c; sourceTree = ""; }; + A3561CDA1414024D00E9B51E /* memrchr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memrchr.c; sourceTree = ""; }; + A3561CDB1414024D00E9B51E /* memswap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = memswap.c; sourceTree = ""; }; + A3561CDC1414024D00E9B51E /* mrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mrand48.c; sourceTree = ""; }; + A3561CDD1414024D00E9B51E /* nrand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nrand48.c; sourceTree = ""; }; + A3561CDE1414024D00E9B51E /* onexit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = onexit.c; sourceTree = ""; }; + A3561CDF1414024D00E9B51E /* qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qsort.c; sourceTree = ""; }; + A3561CE01414024D00E9B51E /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + A3561CE11414024D00E9B51E /* seed48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = seed48.c; sourceTree = ""; }; + A3561CE21414024D00E9B51E /* sha1hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1hash.c; sourceTree = ""; }; + A3561CE31414024D00E9B51E /* snprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snprintf.c; sourceTree = ""; }; + A3561CE41414024D00E9B51E /* srand48.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = srand48.c; sourceTree = ""; }; + A3561CE51414024D00E9B51E /* sscanf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sscanf.c; sourceTree = ""; }; + A3561CE61414024D00E9B51E /* strcasecmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strcasecmp.c; sourceTree = ""; }; + A3561CE71414024D00E9B51E /* strdup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strdup.c; sourceTree = ""; }; + A3561CE81414024D00E9B51E /* strlcat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strlcat.c; sourceTree = ""; }; + A3561CE91414024D00E9B51E /* strncasecmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strncasecmp.c; sourceTree = ""; }; + A3561CEA1414024D00E9B51E /* strndup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strndup.c; sourceTree = ""; }; + A3561CEB1414024D00E9B51E /* strnlen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strnlen.c; sourceTree = ""; }; + A3561CEC1414024D00E9B51E /* strntoimax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strntoimax.c; sourceTree = ""; }; + A3561CED1414024D00E9B51E /* strntoumax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strntoumax.c; sourceTree = ""; }; + A3561CEE1414024D00E9B51E /* strpbrk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strpbrk.c; sourceTree = ""; }; + A3561CEF1414024D00E9B51E /* strsep.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strsep.c; sourceTree = ""; }; + A3561CF01414024D00E9B51E /* strtoimax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoimax.c; sourceTree = ""; }; + A3561CF11414024D00E9B51E /* strtok.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtok.c; sourceTree = ""; }; + A3561CF21414024D00E9B51E /* strtok_r.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtok_r.c; sourceTree = ""; }; + A3561CF31414024D00E9B51E /* strtol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtol.c; sourceTree = ""; }; + A3561CF41414024D00E9B51E /* strtoll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoll.c; sourceTree = ""; }; + A3561CF51414024D00E9B51E /* strtotimespec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtotimespec.c; sourceTree = ""; }; + A3561CF61414024D00E9B51E /* strtotimeval.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtotimeval.c; sourceTree = ""; }; + A3561CF71414024D00E9B51E /* strtotimex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtotimex.c; sourceTree = ""; }; + A3561CF81414024D00E9B51E /* strtoul.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoul.c; sourceTree = ""; }; + A3561CF91414024D00E9B51E /* strtoull.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoull.c; sourceTree = ""; }; + A3561CFA1414024D00E9B51E /* strtoumax.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtoumax.c; sourceTree = ""; }; + A3561CFB1414024D00E9B51E /* strtox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtox.c; sourceTree = ""; }; + A3561CFC1414024D00E9B51E /* strxspn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strxspn.c; sourceTree = ""; }; + A3561CFD1414024D00E9B51E /* strxspn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strxspn.h; sourceTree = ""; }; + A3561CFE1414024D00E9B51E /* version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = version; sourceTree = ""; }; + A3561CFF1414024D00E9B51E /* vsnprintf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vsnprintf.c; sourceTree = ""; }; + A3561D001414024D00E9B51E /* vsscanf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vsscanf.c; sourceTree = ""; }; + A3561D011414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D021414024D00E9B51E /* MakeInc.dir */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MakeInc.dir; sourceTree = ""; }; + A3561D031414024D00E9B51E /* Modules.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Modules.txt; sourceTree = ""; }; + A3561D051414024D00E9B51E /* 915resolution.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = 915resolution.c; sourceTree = ""; }; + A3561D061414024D00E9B51E /* 915resolution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 915resolution.h; sourceTree = ""; }; + A3561D071414024D00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561D081414024D00E9B51E /* edid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = edid.c; sourceTree = ""; }; + A3561D0A1414024D00E9B51E /* edid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = edid.h; sourceTree = ""; }; + A3561D0B1414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D0C1414024D00E9B51E /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + A3561D0D1414024D00E9B51E /* Resolution.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Resolution.c; sourceTree = ""; }; + A3561D0E1414024D00E9B51E /* shortatombios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shortatombios.h; sourceTree = ""; }; + A3561D101414024D00E9B51E /* abi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = abi.cpp; sourceTree = ""; }; + A3561D111414024D00E9B51E /* algorithm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = algorithm.cpp; sourceTree = ""; }; + A3561D121414024D00E9B51E /* associative_base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = associative_base.cpp; sourceTree = ""; }; + A3561D131414024D00E9B51E /* bitset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bitset.cpp; sourceTree = ""; }; + A3561D141414024D00E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A3561D151414024D00E9B51E /* char_traits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = char_traits.cpp; sourceTree = ""; }; + A3561D161414024D00E9B51E /* complex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = complex.cpp; sourceTree = ""; }; + A3561D171414024D00E9B51E /* del_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_op.cpp; sourceTree = ""; }; + A3561D181414024D00E9B51E /* del_opnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_opnt.cpp; sourceTree = ""; }; + A3561D191414024D00E9B51E /* del_opv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_opv.cpp; sourceTree = ""; }; + A3561D1A1414024D00E9B51E /* del_opvnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = del_opvnt.cpp; sourceTree = ""; }; + A3561D1B1414024D00E9B51E /* deque.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = deque.cpp; sourceTree = ""; }; + A3561D1C1414024D00E9B51E /* eh_alloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eh_alloc.cpp; sourceTree = ""; }; + A3561D1D1414024D00E9B51E /* eh_globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = eh_globals.cpp; sourceTree = ""; }; + A3561D1E1414024D00E9B51E /* exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exception.cpp; sourceTree = ""; }; + A3561D1F1414024D00E9B51E /* fstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fstream.cpp; sourceTree = ""; }; + A3561D201414024D00E9B51E /* func_exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = func_exception.cpp; sourceTree = ""; }; + A3561D221414024D00E9B51E /* algorithm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = algorithm; sourceTree = ""; }; + A3561D231414024D00E9B51E /* associative_base */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = associative_base; sourceTree = ""; }; + A3561D241414024D00E9B51E /* basic_definitions */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = basic_definitions; sourceTree = ""; }; + A3561D251414024D00E9B51E /* bitset */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bitset; sourceTree = ""; }; + A3561D261414024D00E9B51E /* cassert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cassert; sourceTree = ""; }; + A3561D271414024D00E9B51E /* cctype */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cctype; sourceTree = ""; }; + A3561D281414024D00E9B51E /* cerrno */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cerrno; sourceTree = ""; }; + A3561D291414024D00E9B51E /* cfloat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cfloat; sourceTree = ""; }; + A3561D2A1414024D00E9B51E /* char_traits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = char_traits; sourceTree = ""; }; + A3561D2B1414024D00E9B51E /* climits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = climits; sourceTree = ""; }; + A3561D2C1414024D00E9B51E /* clocale */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = clocale; sourceTree = ""; }; + A3561D2D1414024D00E9B51E /* cmath */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cmath; sourceTree = ""; }; + A3561D2E1414024D00E9B51E /* complex */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = complex; sourceTree = ""; }; + A3561D2F1414024D00E9B51E /* csetjmp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = csetjmp; sourceTree = ""; }; + A3561D301414024D00E9B51E /* csignal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = csignal; sourceTree = ""; }; + A3561D311414024D00E9B51E /* cstdarg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstdarg; sourceTree = ""; }; + A3561D321414024D00E9B51E /* cstddef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstddef; sourceTree = ""; }; + A3561D331414024D00E9B51E /* cstdio */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstdio; sourceTree = ""; }; + A3561D341414024D00E9B51E /* cstdlib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstdlib; sourceTree = ""; }; + A3561D351414024D00E9B51E /* cstring */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstring; sourceTree = ""; }; + A3561D361414024D00E9B51E /* ctime */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ctime; sourceTree = ""; }; + A3561D371414024D00E9B51E /* cwchar */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cwchar; sourceTree = ""; }; + A3561D381414024D00E9B51E /* cwctype */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cwctype; sourceTree = ""; }; + A3561D391414024D00E9B51E /* deque */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = deque; sourceTree = ""; }; + A3561D3A1414024D00E9B51E /* exception */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = exception; sourceTree = ""; }; + A3561D3B1414024D00E9B51E /* fstream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fstream; sourceTree = ""; }; + A3561D3C1414024D00E9B51E /* func_exception */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = func_exception; sourceTree = ""; }; + A3561D3D1414024D00E9B51E /* functional */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = functional; sourceTree = ""; }; + A3561D3E1414024D00E9B51E /* iomanip */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iomanip; sourceTree = ""; }; + A3561D3F1414024D00E9B51E /* ios */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ios; sourceTree = ""; }; + A3561D401414024D00E9B51E /* iosfwd */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iosfwd; sourceTree = ""; }; + A3561D411414024D00E9B51E /* iostream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iostream; sourceTree = ""; }; + A3561D421414024D00E9B51E /* istream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = istream; sourceTree = ""; }; + A3561D431414024D00E9B51E /* istream_helpers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = istream_helpers; sourceTree = ""; }; + A3561D441414024D00E9B51E /* iterator */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iterator; sourceTree = ""; }; + A3561D451414024D00E9B51E /* iterator_base */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iterator_base; sourceTree = ""; }; + A3561D461414024D00E9B51E /* limits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = limits; sourceTree = ""; }; + A3561D471414024D00E9B51E /* list */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = list; sourceTree = ""; }; + A3561D481414024D00E9B51E /* locale */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = locale; sourceTree = ""; }; + A3561D491414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D4A1414024D00E9B51E /* map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = map; sourceTree = ""; }; + A3561D4B1414024D00E9B51E /* map.old */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = map.old; sourceTree = ""; }; + A3561D4C1414024D00E9B51E /* memory */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = memory; sourceTree = ""; }; + A3561D4D1414024D00E9B51E /* new */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = new; sourceTree = ""; }; + A3561D4E1414024D00E9B51E /* numeric */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = numeric; sourceTree = ""; }; + A3561D4F1414024D00E9B51E /* ostream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ostream; sourceTree = ""; }; + A3561D501414024D00E9B51E /* ostream_helpers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ostream_helpers; sourceTree = ""; }; + A3561D511414024D00E9B51E /* queue */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = queue; sourceTree = ""; }; + A3561D521414024D00E9B51E /* set */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set; sourceTree = ""; }; + A3561D531414024D00E9B51E /* set.old */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set.old; sourceTree = ""; }; + A3561D541414024D00E9B51E /* sstream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sstream; sourceTree = ""; }; + A3561D551414024D00E9B51E /* stack */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stack; sourceTree = ""; }; + A3561D561414024D00E9B51E /* stdexcept */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stdexcept; sourceTree = ""; }; + A3561D571414024D00E9B51E /* streambuf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = streambuf; sourceTree = ""; }; + A3561D581414024D00E9B51E /* string */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string; sourceTree = ""; }; + A3561D591414024D00E9B51E /* string_iostream */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = string_iostream; sourceTree = ""; }; + A3561D5A1414024D00E9B51E /* support */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = support; sourceTree = ""; }; + A3561D5B1414024D00E9B51E /* system_configuration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = system_configuration.h; sourceTree = ""; }; + A3561D5C1414024D00E9B51E /* type_traits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = type_traits; sourceTree = ""; }; + A3561D5D1414024D00E9B51E /* typeinfo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = typeinfo; sourceTree = ""; }; + A3561D5E1414024D00E9B51E /* types */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = types; sourceTree = ""; }; + A3561D5F1414024D00E9B51E /* unwind-cxx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "unwind-cxx.h"; sourceTree = ""; }; + A3561D601414024D00E9B51E /* utility */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = utility; sourceTree = ""; }; + A3561D611414024D00E9B51E /* valarray */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = valarray; sourceTree = ""; }; + A3561D621414024D00E9B51E /* vector */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = vector; sourceTree = ""; }; + A3561D631414024D00E9B51E /* iomanip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iomanip.cpp; sourceTree = ""; }; + A3561D641414024D00E9B51E /* ios.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ios.cpp; sourceTree = ""; }; + A3561D651414024D00E9B51E /* iostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iostream.cpp; sourceTree = ""; }; + A3561D661414024D00E9B51E /* istream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = istream.cpp; sourceTree = ""; }; + A3561D671414024D00E9B51E /* iterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iterator.cpp; sourceTree = ""; }; + A3561D681414024D00E9B51E /* limits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = limits.cpp; sourceTree = ""; }; + A3561D691414024D00E9B51E /* list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = list.cpp; sourceTree = ""; }; + A3561D6A1414024D00E9B51E /* locale.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = locale.cpp; sourceTree = ""; }; + A3561D6B1414024D00E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561D6C1414024D00E9B51E /* map.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = map.cpp; sourceTree = ""; }; + A3561D6D1414024D00E9B51E /* new_handler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_handler.cpp; sourceTree = ""; }; + A3561D6E1414024D00E9B51E /* new_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_op.cpp; sourceTree = ""; }; + A3561D6F1414024D00E9B51E /* new_opnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_opnt.cpp; sourceTree = ""; }; + A3561D701414024D00E9B51E /* new_opv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_opv.cpp; sourceTree = ""; }; + A3561D711414024D00E9B51E /* new_opvnt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_opvnt.cpp; sourceTree = ""; }; + A3561D721414024D00E9B51E /* numeric.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = numeric.cpp; sourceTree = ""; }; + A3561D731414024D00E9B51E /* ostream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ostream.cpp; sourceTree = ""; }; + A3561D741414024D00E9B51E /* queue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = queue.cpp; sourceTree = ""; }; + A3561D751414024D00E9B51E /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + A3561D761414024D00E9B51E /* set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = set.cpp; sourceTree = ""; }; + A3561D771414024D00E9B51E /* sstream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sstream.cpp; sourceTree = ""; }; + A3561D781414024D00E9B51E /* stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stack.cpp; sourceTree = ""; }; + A3561D791414024D00E9B51E /* stdexcept.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stdexcept.cpp; sourceTree = ""; }; + A3561D7A1414024D00E9B51E /* streambuf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = streambuf.cpp; sourceTree = ""; }; + A3561D7B1414024D00E9B51E /* string.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string.cpp; sourceTree = ""; }; + A3561D7C1414024D00E9B51E /* support.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = support.cpp; sourceTree = ""; }; + A3561D7D1414024D00E9B51E /* typeinfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = typeinfo.cpp; sourceTree = ""; }; + A3561D7E1414024D00E9B51E /* uClibc++.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "uClibc++.c"; sourceTree = ""; }; + A3561D7F1414024D00E9B51E /* utility.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = utility.cpp; sourceTree = ""; }; + A3561D801414024D00E9B51E /* valarray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = valarray.cpp; sourceTree = ""; }; + A3561D811414024D00E9B51E /* vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vector.cpp; sourceTree = ""; }; + A3561DA61414296600E9B51E /* Keylayout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Keylayout.c; sourceTree = ""; }; + A3561DA71414296600E9B51E /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A3561DA81414296600E9B51E /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + A35D216F141A73B000969AC0 /* cham-mklayout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "cham-mklayout.c"; sourceTree = ""; }; + A35D2171141A73B000969AC0 /* mac-de.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-de.slt"; sourceTree = ""; }; + A35D2172141A73B000969AC0 /* mac-es.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-es.slt"; sourceTree = ""; }; + A35D2173141A73B000969AC0 /* mac-fr.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-fr.slt"; sourceTree = ""; }; + A35D2174141A73B000969AC0 /* mac-it.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-it.slt"; sourceTree = ""; }; + A35D2175141A73B000969AC0 /* mac-se.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "mac-se.slt"; sourceTree = ""; }; + A35D2176141A73B000969AC0 /* pc-fr.slt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pc-fr.slt"; sourceTree = ""; }; + A35D2177141A73B000969AC0 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + A35D2178141A753E00969AC0 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + A35D2187141A75DC00969AC0 /* slimpkg.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = slimpkg.sh; sourceTree = ""; }; + A35D2188141A75DC00969AC0 /* buildpkg.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = buildpkg.sh; sourceTree = ""; }; + A360AA7D14136C1A00084D3F /* Make.rules */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Make.rules; sourceTree = ""; }; + A396E2CC150247630025A245 /* License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = License.rtf; sourceTree = ""; }; + A396E2CE150247630025A245 /* background.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = background.tiff; sourceTree = ""; }; + A396E2D1150247630025A245 /* Description.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Description.html; sourceTree = ""; }; + A396E2D2150247630025A245 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; + A396E35915028C9C0025A245 /* Welcome.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Welcome.html; sourceTree = ""; }; + A396E4F51502D0580025A245 /* ar */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ar; path = ar.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E4F71502D0580025A245 /* ar */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ar; path = ar.lproj/Description.html; sourceTree = ""; }; + A396E4F91502D0580025A245 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ar; path = ar.lproj/License.rtf; sourceTree = ""; }; + A396E4FB1502D0580025A245 /* ar */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; + A396E4FD1502D0580025A245 /* ar */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ar; path = ar.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E4FE1502D0580025A245 /* background.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = background.tiff; sourceTree = ""; }; + A396E4FF1502D0580025A245 /* bg */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bg; path = bg.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5001502D0580025A245 /* bg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = bg; path = bg.lproj/Description.html; sourceTree = ""; }; + A396E5011502D0580025A245 /* bg */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = bg; path = bg.lproj/License.rtf; sourceTree = ""; }; + A396E5021502D0580025A245 /* bg */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = bg; path = bg.lproj/Localizable.strings; sourceTree = ""; }; + A396E5031502D0580025A245 /* bg */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bg; path = bg.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5041502D0580025A245 /* bs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bs; path = bs.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5051502D0580025A245 /* bs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = bs; path = bs.lproj/Description.html; sourceTree = ""; }; + A396E5061502D0580025A245 /* bs */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = bs; path = bs.lproj/License.rtf; sourceTree = ""; }; + A396E5071502D0580025A245 /* bs */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = bs; path = bs.lproj/Localizable.strings; sourceTree = ""; }; + A396E5081502D0580025A245 /* bs */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = bs; path = bs.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5091502D0580025A245 /* ca */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ca; path = ca.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E50A1502D0580025A245 /* ca */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ca; path = ca.lproj/Description.html; sourceTree = ""; }; + A396E50B1502D0580025A245 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ca; path = ca.lproj/License.rtf; sourceTree = ""; }; + A396E50C1502D0580025A245 /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; + A396E50D1502D0580025A245 /* ca */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ca; path = ca.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E50E1502D0580025A245 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = de; path = de.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E50F1502D0580025A245 /* de */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = de; path = de.lproj/Description.html; sourceTree = ""; }; + A396E5101502D0580025A245 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = de; path = de.lproj/License.rtf; sourceTree = ""; }; + A396E5111502D0580025A245 /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; + A396E5121502D0580025A245 /* de */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = de; path = de.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5131502D0580025A245 /* el */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = el; path = el.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5141502D0580025A245 /* el */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = el; path = el.lproj/Description.html; sourceTree = ""; }; + A396E5151502D0580025A245 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = el; path = el.lproj/License.rtf; sourceTree = ""; }; + A396E5161502D0580025A245 /* el */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Localizable.strings; sourceTree = ""; }; + A396E5171502D0580025A245 /* el */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = el; path = el.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5181502D0580025A245 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = en; path = en.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5191502D0580025A245 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = en; path = en.lproj/Description.html; sourceTree = ""; }; + A396E51A1502D0580025A245 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/License.rtf; sourceTree = ""; }; + A396E51B1502D0580025A245 /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + A396E51C1502D0580025A245 /* en */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = en; path = en.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E51D1502D0580025A245 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = es; path = es.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E51E1502D0580025A245 /* es */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = es; path = es.lproj/Description.html; sourceTree = ""; }; + A396E51F1502D0580025A245 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = es; path = es.lproj/License.rtf; sourceTree = ""; }; + A396E5201502D0580025A245 /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; + A396E5211502D0580025A245 /* es */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = es; path = es.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5221502D0580025A245 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = fr; path = fr.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5231502D0580025A245 /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = fr; path = fr.lproj/Description.html; sourceTree = ""; }; + A396E5241502D0580025A245 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = fr; path = fr.lproj/License.rtf; sourceTree = ""; }; + A396E5251502D0580025A245 /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; + A396E5261502D0580025A245 /* fr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = fr; path = fr.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5271502D0580025A245 /* he */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = he; path = he.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5281502D0580025A245 /* he */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = he; path = he.lproj/Description.html; sourceTree = ""; }; + A396E5291502D0580025A245 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = he; path = he.lproj/License.rtf; sourceTree = ""; }; + A396E52A1502D0580025A245 /* he */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; + A396E52B1502D0580025A245 /* he */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = he; path = he.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E52C1502D0580025A245 /* hr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = hr; path = hr.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E52D1502D0580025A245 /* hr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = hr; path = hr.lproj/Description.html; sourceTree = ""; }; + A396E52E1502D0580025A245 /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = hr; path = hr.lproj/License.rtf; sourceTree = ""; }; + A396E52F1502D0580025A245 /* hr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/Localizable.strings; sourceTree = ""; }; + A396E5301502D0580025A245 /* hr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = hr; path = hr.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5311502D0580025A245 /* id */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = id; path = id.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5321502D0580025A245 /* id */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = id; path = id.lproj/Description.html; sourceTree = ""; }; + A396E5331502D0580025A245 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = id; path = id.lproj/License.rtf; sourceTree = ""; }; + A396E5341502D0580025A245 /* id */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; + A396E5351502D0580025A245 /* id */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = id; path = id.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5361502D0580025A245 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = it; path = it.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5371502D0580025A245 /* it */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = it; path = it.lproj/Description.html; sourceTree = ""; }; + A396E5381502D0580025A245 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = it; path = it.lproj/License.rtf; sourceTree = ""; }; + A396E5391502D0580025A245 /* it */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; + A396E53A1502D0580025A245 /* it */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = it; path = it.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E53B1502D0580025A245 /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ja; path = ja.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E53C1502D0580025A245 /* ja */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ja; path = ja.lproj/Description.html; sourceTree = ""; }; + A396E53D1502D0580025A245 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ja; path = ja.lproj/License.rtf; sourceTree = ""; }; + A396E53E1502D0580025A245 /* ja */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + A396E53F1502D0580025A245 /* ja */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ja; path = ja.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5401502D0580025A245 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ko; path = ko.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5411502D0580025A245 /* ko */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ko; path = ko.lproj/Description.html; sourceTree = ""; }; + A396E5421502D0580025A245 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ko; path = ko.lproj/License.rtf; sourceTree = ""; }; + A396E5431502D0580025A245 /* ko */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; + A396E5441502D0580025A245 /* ko */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ko; path = ko.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5451502D0580025A245 /* mk */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = mk; path = mk.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5461502D0580025A245 /* mk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = mk; path = mk.lproj/Description.html; sourceTree = ""; }; + A396E5471502D0580025A245 /* mk */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = mk; path = mk.lproj/License.rtf; sourceTree = ""; }; + A396E5481502D0580025A245 /* mk */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = mk; path = mk.lproj/Localizable.strings; sourceTree = ""; }; + A396E5491502D0580025A245 /* mk */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = mk; path = mk.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E54A1502D0580025A245 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = nl; path = nl.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E54B1502D0580025A245 /* nl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = nl; path = nl.lproj/Description.html; sourceTree = ""; }; + A396E54C1502D0580025A245 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = nl; path = nl.lproj/License.rtf; sourceTree = ""; }; + A396E54D1502D0580025A245 /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; + A396E54E1502D0580025A245 /* nl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = nl; path = nl.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E54F1502D0580025A245 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = pl; path = pl.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5501502D0580025A245 /* pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = pl; path = pl.lproj/Description.html; sourceTree = ""; }; + A396E5511502D0580025A245 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = pl; path = pl.lproj/License.rtf; sourceTree = ""; }; + A396E5521502D0580025A245 /* pl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; + A396E5531502D0580025A245 /* pl */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = pl; path = pl.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5541502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-BR"; path = "pt-BR.lproj/Conclusion.rtfd"; sourceTree = ""; }; + A396E5551502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "pt-BR"; path = "pt-BR.lproj/Description.html"; sourceTree = ""; }; + A396E5561502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = "pt-BR"; path = "pt-BR.lproj/License.rtf"; sourceTree = ""; }; + A396E5571502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; + A396E5581502D0580025A245 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-BR"; path = "pt-BR.lproj/Welcome.rtfd"; sourceTree = ""; }; + A396E5591502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-PT"; path = "pt-PT.lproj/Conclusion.rtfd"; sourceTree = ""; }; + A396E55A1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "pt-PT"; path = "pt-PT.lproj/Description.html"; sourceTree = ""; }; + A396E55B1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = "pt-PT"; path = "pt-PT.lproj/License.rtf"; sourceTree = ""; }; + A396E55C1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; + A396E55D1502D0580025A245 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = "pt-PT"; path = "pt-PT.lproj/Welcome.rtfd"; sourceTree = ""; }; + A396E55E1502D0580025A245 /* ro */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ro; path = ro.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E55F1502D0580025A245 /* ro */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ro; path = ro.lproj/Description.html; sourceTree = ""; }; + A396E5601502D0580025A245 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ro; path = ro.lproj/License.rtf; sourceTree = ""; }; + A396E5611502D0580025A245 /* ro */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Localizable.strings; sourceTree = ""; }; + A396E5621502D0580025A245 /* ro */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ro; path = ro.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5631502D0580025A245 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ru; path = ru.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5641502D0580025A245 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ru; path = ru.lproj/Description.html; sourceTree = ""; }; + A396E5651502D0580025A245 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = ru; path = ru.lproj/License.rtf; sourceTree = ""; }; + A396E5661502D0580025A245 /* ru */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; + A396E5671502D0580025A245 /* ru */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = ru; path = ru.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5681502D0580025A245 /* sr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = sr; path = sr.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5691502D0580025A245 /* sr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = sr; path = sr.lproj/Description.html; sourceTree = ""; }; + A396E56A1502D0580025A245 /* sr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = sr; path = sr.lproj/License.rtf; sourceTree = ""; }; + A396E56B1502D0580025A245 /* sr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sr; path = sr.lproj/Localizable.strings; sourceTree = ""; }; + A396E56C1502D0580025A245 /* sr */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = sr; path = sr.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E56D1502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_CN; path = zh_CN.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E56E1502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = zh_CN; path = zh_CN.lproj/Description.html; sourceTree = ""; }; + A396E56F1502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = zh_CN; path = zh_CN.lproj/License.rtf; sourceTree = ""; }; + A396E5701502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Localizable.strings; sourceTree = ""; }; + A396E5711502D0580025A245 /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_CN; path = zh_CN.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5721502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_TW; path = zh_TW.lproj/Conclusion.rtfd; sourceTree = ""; }; + A396E5731502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = zh_TW; path = zh_TW.lproj/Description.html; sourceTree = ""; }; + A396E5741502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = zh_TW; path = zh_TW.lproj/License.rtf; sourceTree = ""; }; + A396E5751502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Localizable.strings; sourceTree = ""; }; + A396E5761502D0580025A245 /* zh_TW */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; name = zh_TW; path = zh_TW.lproj/Welcome.rtfd; sourceTree = ""; }; + A396E5821502D3320025A245 /* Conclusion.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Conclusion.html; sourceTree = ""; }; + A3F1F267141B9B3B00DDA709 /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + AB1DE71815B6E2D00088E06B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + AB1DE71A15B6E2D00088E06B /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + AB1DE71B15B6E2D00088E06B /* Sata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Sata.c; sourceTree = ""; }; + AB30C92E15DE60ED0047BE7B /* ld_classic */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = ld_classic; sourceTree = ""; }; + AB30C92F15DE60ED0047BE7B /* ld_classic.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; path = ld_classic.1; sourceTree = ""; }; + AB30C93215DE66D90047BE7B /* Cconfig */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + AB30C93315DE66D90047BE7B /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + AB30C93415DE66D90047BE7B /* md.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = md.1; sourceTree = ""; }; + AB30C93515DE66D90047BE7B /* md.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = md.c; sourceTree = ""; }; + AB47D38A15B702F00083D898 /* org.chameleon.Boot.nvidia.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = org.chameleon.Boot.nvidia.plist; sourceTree = ""; }; + AB4DDA8D15CEFF2100E77157 /* acpi_codec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_codec.c; sourceTree = ""; }; + AB4DDA8E15CEFF2100E77157 /* acpi_tools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_tools.c; sourceTree = ""; }; + AB4DDA8F15CEFF2100E77157 /* acpicode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpicode.c; sourceTree = ""; }; + AB4DDA9015CEFF2100E77157 /* ACPICodec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ACPICodec.c; sourceTree = ""; }; + AB4DDA9115CEFF2100E77157 /* acpidecode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpidecode.c; sourceTree = ""; }; + AB4DDA9215CEFF2100E77157 /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + AB4DDA9415CEFF2100E77157 /* acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi.h; sourceTree = ""; }; + AB4DDA9515CEFF2100E77157 /* acpi_codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_codec.h; sourceTree = ""; }; + AB4DDA9615CEFF2100E77157 /* acpi_tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_tools.h; sourceTree = ""; }; + AB4DDA9715CEFF2100E77157 /* acpicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpicode.h; sourceTree = ""; }; + AB4DDA9815CEFF2100E77157 /* acpidecode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpidecode.h; sourceTree = ""; }; + AB4DDA9915CEFF2100E77157 /* datatype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = datatype.h; sourceTree = ""; }; + AB4DDA9A15CEFF2100E77157 /* intel_acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intel_acpi.h; sourceTree = ""; }; + AB4DDA9B15CEFF2100E77157 /* ppm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ppm.h; sourceTree = ""; }; + AB4DDA9C15CEFF2100E77157 /* ppmsetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ppmsetup.h; sourceTree = ""; }; + AB4DDA9D15CEFF2100E77157 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + AB4DDA9E15CEFF2100E77157 /* Readme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.txt; sourceTree = ""; }; + ABE4A59C15B6EA73007812A6 /* nvidia_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nvidia_helper.h; sourceTree = ""; }; + ABE4A59D15B6EA73007812A6 /* nvidia_helper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nvidia_helper.c; sourceTree = ""; }; + B0056CE711F3868000754B65 /* boot0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0.s; sourceTree = ""; }; + B0056CE811F3868000754B65 /* chain0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = chain0.s; sourceTree = ""; }; + B0056CE911F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056CED11F3868000754B65 /* boot1f32-install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "boot1f32-install.sh"; sourceTree = ""; }; + B0056CEE11F3868000754B65 /* boot1f32.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1f32.s; sourceTree = ""; }; + B0056CEF11F3868000754B65 /* boot1he.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1he.s; sourceTree = ""; }; + B0056CF011F3868000754B65 /* boot1hp.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1hp.s; sourceTree = ""; }; + B0056CF111F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056CF311F3868000754B65 /* appleboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleboot.h; sourceTree = ""; }; + B0056CF411F3868000754B65 /* appleClut8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = appleClut8.h; sourceTree = ""; }; + B0056CF511F3868000754B65 /* bmdecompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bmdecompress.c; sourceTree = ""; }; + B0056CF611F3868000754B65 /* boot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = boot.c; sourceTree = ""; }; + B0056CF711F3868000754B65 /* boot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boot.h; sourceTree = ""; }; + B0056CF811F3868000754B65 /* boot2.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot2.s; sourceTree = ""; }; + B0056CF911F3868000754B65 /* drivers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = drivers.c; sourceTree = ""; }; + B0056CFA11F3868000754B65 /* graphic_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphic_utils.c; sourceTree = ""; }; + B0056CFB11F3868000754B65 /* graphic_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphic_utils.h; sourceTree = ""; }; + B0056CFC11F3868000754B65 /* graphics.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = graphics.c; sourceTree = ""; }; + B0056CFD11F3868000754B65 /* graphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphics.h; sourceTree = ""; }; + B0056CFE11F3868000754B65 /* gui.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gui.c; sourceTree = ""; }; + B0056CFF11F3868000754B65 /* gui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gui.h; sourceTree = ""; }; + B0056D0011F3868000754B65 /* IOHibernatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOHibernatePrivate.h; sourceTree = ""; }; + B0056D0111F3868000754B65 /* lzss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lzss.c; sourceTree = ""; }; + B0056D0211F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D0311F3868000754B65 /* mboot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mboot.c; sourceTree = ""; }; + B0056D0411F3868000754B65 /* mboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mboot.h; sourceTree = ""; }; + B0056D0511F3868000754B65 /* multiboot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = multiboot.h; sourceTree = ""; }; + B0056D0611F3868000754B65 /* options.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = options.c; sourceTree = ""; }; + B0056D0711F3868000754B65 /* picopng.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = picopng.c; sourceTree = ""; }; + B0056D0811F3868000754B65 /* picopng.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = picopng.h; sourceTree = ""; }; + B0056D0911F3868000754B65 /* prompt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prompt.c; sourceTree = ""; }; + B0056D0A11F3868000754B65 /* ramdisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ramdisk.c; sourceTree = ""; }; + B0056D0B11F3868000754B65 /* ramdisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ramdisk.h; sourceTree = ""; }; + B0056D0C11F3868000754B65 /* resume.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resume.c; sourceTree = ""; }; + B0056D0D11F3868000754B65 /* WKdm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKdm.h; sourceTree = ""; }; + B0056D0E11F3868000754B65 /* WKdmDecompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WKdmDecompress.c; sourceTree = ""; }; + B0056D1011F3868000754B65 /* cdboot.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = cdboot.s; sourceTree = ""; }; + B0056D1111F3868000754B65 /* cdboothdd.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = cdboothdd.s; sourceTree = ""; }; + B0056D1211F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D1411F3868000754B65 /* Limits */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Limits; sourceTree = ""; }; + B0056D1511F3868000754B65 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0056D1711F3868000754B65 /* efi_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = efi_tables.c; sourceTree = ""; }; + B0056D1811F3868000754B65 /* efi_tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi_tables.h; sourceTree = ""; }; + B0056D1911F3868000754B65 /* error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = error.c; sourceTree = ""; }; + B0056D1A11F3868000754B65 /* libsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsa.h; sourceTree = ""; }; + B0056D1B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D1C11F3868000754B65 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = ""; }; + B0056D1D11F3868000754B65 /* prf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prf.c; sourceTree = ""; }; + B0056D1E11F3868000754B65 /* printf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = printf.c; sourceTree = ""; }; + B0056D1F11F3868000754B65 /* qsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = qsort.c; sourceTree = ""; }; + B0056D2011F3868000754B65 /* setjmp.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = setjmp.s; sourceTree = ""; }; + B0056D2111F3868000754B65 /* string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = string.c; sourceTree = ""; }; + B0056D2211F3868000754B65 /* strtol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = strtol.c; sourceTree = ""; }; + B0056D2311F3868000754B65 /* zalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zalloc.c; sourceTree = ""; }; + B0056D2511F3868000754B65 /* acpi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi.h; sourceTree = ""; }; + B0056D2611F3868000754B65 /* acpi_patcher.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = acpi_patcher.c; sourceTree = ""; }; + B0056D2711F3868000754B65 /* acpi_patcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acpi_patcher.h; sourceTree = ""; }; + B0056D2811F3868000754B65 /* allocate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = allocate.c; sourceTree = ""; }; + B0056D2911F3868000754B65 /* asm.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = asm.s; sourceTree = ""; }; + B0056D2A11F3868000754B65 /* ati.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ati.c; sourceTree = ""; }; + B0056D2C11F3868000754B65 /* bios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bios.h; sourceTree = ""; }; + B0056D2D11F3868000754B65 /* bios.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = bios.s; sourceTree = ""; }; + B0056D2E11F3868000754B65 /* biosfn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = biosfn.c; sourceTree = ""; }; + B0056D2F11F3868000754B65 /* bootstruct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bootstruct.c; sourceTree = ""; }; + B0056D3011F3868000754B65 /* bootstruct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootstruct.h; sourceTree = ""; }; + B0056D3111F3868000754B65 /* cache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cache.c; sourceTree = ""; }; + B0056D3211F3868000754B65 /* console.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = console.c; sourceTree = ""; }; + B0056D3311F3868000754B65 /* convert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = convert.c; sourceTree = ""; }; + B0056D3411F3868000754B65 /* convert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = convert.h; sourceTree = ""; }; + B0056D3511F3868000754B65 /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cpu.c; sourceTree = ""; }; + B0056D3611F3868000754B65 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cpu.h; sourceTree = ""; }; + B0056D3711F3868000754B65 /* device_inject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = device_inject.c; sourceTree = ""; }; + B0056D3811F3868000754B65 /* device_inject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_inject.h; sourceTree = ""; }; + B0056D3911F3868000754B65 /* device_tree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = device_tree.c; sourceTree = ""; }; + B0056D3A11F3868000754B65 /* device_tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = device_tree.h; sourceTree = ""; }; + B0056D3B11F3868000754B65 /* disk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = disk.c; sourceTree = ""; }; + B0056D3C11F3868000754B65 /* efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = efi.h; sourceTree = ""; }; + B0056D3D11F3868000754B65 /* ext2fs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ext2fs.c; sourceTree = ""; }; + B0056D3E11F3868000754B65 /* ext2fs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ext2fs.h; sourceTree = ""; }; + B0056D3F11F3868000754B65 /* fake_efi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fake_efi.c; sourceTree = ""; }; + B0056D4011F3868000754B65 /* fake_efi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fake_efi.h; sourceTree = ""; }; + B0056D4111F3868000754B65 /* fdisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fdisk.h; sourceTree = ""; }; + B0056D4211F3868000754B65 /* hfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hfs.c; sourceTree = ""; }; + B0056D4311F3868000754B65 /* hfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs.h; sourceTree = ""; }; + B0056D4411F3868000754B65 /* hfs_CaseTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hfs_CaseTables.h; sourceTree = ""; }; + B0056D4511F3868000754B65 /* hfs_compare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hfs_compare.c; sourceTree = ""; }; + B0056D4611F3868000754B65 /* hpet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hpet.c; sourceTree = ""; }; + B0056D4711F3868000754B65 /* hpet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hpet.h; sourceTree = ""; }; + B0056D4811F3868000754B65 /* io_inline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io_inline.h; sourceTree = ""; }; + B0056D4911F3868000754B65 /* libsaio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsaio.h; sourceTree = ""; }; + B0056D4A11F3868000754B65 /* load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = load.c; sourceTree = ""; }; + B0056D4B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D4C11F3868000754B65 /* md5c.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5c.c; sourceTree = ""; }; + B0056D4F11F3868000754B65 /* memvendors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memvendors.h; sourceTree = ""; }; + B0056D5011F3868000754B65 /* misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = misc.c; sourceTree = ""; }; + B0056D5111F3868000754B65 /* msdos.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msdos.c; sourceTree = ""; }; + B0056D5211F3868000754B65 /* msdos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msdos.h; sourceTree = ""; }; + B0056D5311F3868000754B65 /* msdos_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msdos_private.h; sourceTree = ""; }; + B0056D5411F3868000754B65 /* nbp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nbp.c; sourceTree = ""; }; + B0056D5511F3868000754B65 /* nbp_cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nbp_cmd.h; sourceTree = ""; }; + B0056D5611F3868000754B65 /* ntfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ntfs.c; sourceTree = ""; }; + B0056D5711F3868000754B65 /* ntfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ntfs.h; sourceTree = ""; }; + B0056D5811F3868000754B65 /* ntfs_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ntfs_private.h; sourceTree = ""; }; + B0056D5911F3868000754B65 /* nvidia.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nvidia.c; sourceTree = ""; }; + B0056D5A11F3868000754B65 /* nvidia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nvidia.h; sourceTree = ""; }; + B0056D5B11F3868000754B65 /* pci.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci.c; sourceTree = ""; }; + B0056D5C11F3868000754B65 /* pci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pci.h; sourceTree = ""; }; + B0056D5D11F3868000754B65 /* pci_root.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci_root.c; sourceTree = ""; }; + B0056D5E11F3868000754B65 /* pci_root.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pci_root.h; sourceTree = ""; }; + B0056D5F11F3868000754B65 /* pci_setup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pci_setup.c; sourceTree = ""; }; + B0056D6011F3868000754B65 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = ""; }; + B0056D6111F3868000754B65 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = ""; }; + B0056D6211F3868000754B65 /* saio_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saio_internal.h; sourceTree = ""; }; + B0056D6311F3868000754B65 /* saio_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = saio_types.h; sourceTree = ""; }; + B0056D6411F3868000754B65 /* sl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sl.h; sourceTree = ""; }; + B0056D6511F3868000754B65 /* SMBIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMBIOS.h; sourceTree = ""; }; + B0056D6811F3868000754B65 /* spd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = spd.c; sourceTree = ""; }; + B0056D6911F3868000754B65 /* spd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spd.h; sourceTree = ""; }; + B0056D6A11F3868000754B65 /* stringTable.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stringTable.c; sourceTree = ""; }; + B0056D6B11F3868000754B65 /* sys.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sys.c; sourceTree = ""; }; + B0056D6C11F3868000754B65 /* table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = table.c; sourceTree = ""; }; + B0056D6E11F3868000754B65 /* ufs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs.h; sourceTree = ""; }; + B0056D7011F3868000754B65 /* ufs_byteorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ufs_byteorder.h; sourceTree = ""; }; + B0056D7111F3868000754B65 /* usb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = usb.c; sourceTree = ""; }; + B0056D7211F3868000754B65 /* vbe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vbe.c; sourceTree = ""; }; + B0056D7311F3868000754B65 /* vbe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vbe.h; sourceTree = ""; }; + B0056D7411F3868000754B65 /* xml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xml.c; sourceTree = ""; }; + B0056D7511F3868000754B65 /* xml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xml.h; sourceTree = ""; }; + B0056D7611F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7A11F3868000754B65 /* machOconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = machOconv.c; sourceTree = ""; }; + B0056D7B11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7C11F3868000754B65 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; + B0056D7D11F3868000754B65 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + B0056D7F11F3868000754B65 /* CREDITS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CREDITS; sourceTree = ""; }; + B0056D8011F3868000754B65 /* coding_standards.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = coding_standards.txt; sourceTree = ""; }; + B0056D8111F3868000754B65 /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES; sourceTree = ""; }; + B0056D8211F3868000754B65 /* APPLE_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = APPLE_LICENSE; sourceTree = ""; }; + B0056D8511F3868000754B65 /* Distribution */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Distribution; sourceTree = ""; }; + B0056DB911F3868000754B65 /* smbios.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = smbios.plist; sourceTree = ""; }; + B0056DBD11F3868000754B65 /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; + B0056DBE11F3868000754B65 /* boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = boot.png; sourceTree = ""; }; + B0056DBF11F3868000754B65 /* device_cdrom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_cdrom.png; sourceTree = ""; }; + B0056DC011F3868000754B65 /* device_ext3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ext3.png; sourceTree = ""; }; + B0056DC111F3868000754B65 /* device_fat16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat16.png; sourceTree = ""; }; + B0056DC211F3868000754B65 /* device_fat32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_fat32.png; sourceTree = ""; }; + B0056DC311F3868000754B65 /* device_generic.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_generic.png; sourceTree = ""; }; + B0056DC411F3868000754B65 /* device_hfsplus.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_hfsplus.png; sourceTree = ""; }; + B0056DC511F3868000754B65 /* device_ntfs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_ntfs.png; sourceTree = ""; }; + B0056DC611F3868000754B65 /* device_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_next.png; sourceTree = ""; }; + B0056DC711F3868000754B65 /* device_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_scroll_prev.png; sourceTree = ""; }; + B0056DC811F3868000754B65 /* device_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = device_selection.png; sourceTree = ""; }; + B0056DC911F3868000754B65 /* font_console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_console.png; sourceTree = ""; }; + B0056DCA11F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056DCB11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DCC11F3868000754B65 /* menu_boot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_boot.png; sourceTree = ""; }; + B0056DCD11F3868000754B65 /* menu_help.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_help.png; sourceTree = ""; }; + B0056DCE11F3868000754B65 /* menu_ignore_caches.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches.png; sourceTree = ""; }; + B0056DCF11F3868000754B65 /* menu_ignore_caches_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_ignore_caches_disabled.png; sourceTree = ""; }; + B0056DD011F3868000754B65 /* menu_memory_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_memory_info.png; sourceTree = ""; }; + B0056DD111F3868000754B65 /* menu_selection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_selection.png; sourceTree = ""; }; + B0056DD211F3868000754B65 /* menu_single_user.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user.png; sourceTree = ""; }; + B0056DD311F3868000754B65 /* menu_single_user_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_single_user_disabled.png; sourceTree = ""; }; + B0056DD411F3868000754B65 /* menu_verbose.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose.png; sourceTree = ""; }; + B0056DD511F3868000754B65 /* menu_verbose_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_verbose_disabled.png; sourceTree = ""; }; + B0056DD611F3868000754B65 /* menu_video_info.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_video_info.png; sourceTree = ""; }; + B0056DD711F3868000754B65 /* progress_bar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar.png; sourceTree = ""; }; + B0056DD811F3868000754B65 /* progress_bar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progress_bar_background.png; sourceTree = ""; }; + B0056DD911F3868000754B65 /* text_scroll_next.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_next.png; sourceTree = ""; }; + B0056DDA11F3868000754B65 /* text_scroll_prev.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = text_scroll_prev.png; sourceTree = ""; }; + B0056DDB11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056DFD11F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056DFE11F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0011F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056E0111F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0311F3868000754B65 /* font_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = font_small.png; sourceTree = ""; }; + B0056E0411F3868000754B65 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + B0056E0511F3868000754B65 /* theme.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = theme.plist; sourceTree = ""; }; + B0056E0811F3868000754B65 /* Users_Guide0.4.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide0.4.pdf; sourceTree = ""; }; + B0056E0911F3868000754B65 /* Users_Guide_v0.3.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide_v0.3.pdf; sourceTree = ""; }; + B0056E0A11F3868000754B65 /* UsersGuide-v0.2.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "UsersGuide-v0.2.pdf"; sourceTree = ""; }; + B0056E0B11F3868000754B65 /* BootHelp.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BootHelp.txt; sourceTree = ""; }; + B0056E0C11F3868000754B65 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0056E0D11F3868000754B65 /* themeinfo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = themeinfo.png; sourceTree = ""; }; + B0056E0F11F3868000754B65 /* Chameleon 2 v0.4.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Chameleon 2 v0.4.xml"; sourceTree = ""; }; + B0056E1011F3868000754B65 /* Chameleon 2 v0.5.docx */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Chameleon 2 v0.5.docx"; sourceTree = ""; }; + B0056E1111F3868000754B65 /* chameleon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chameleon.png; sourceTree = ""; }; + B0056E1211F3868000754B65 /* colorchart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = colorchart.png; sourceTree = ""; }; + B0056E1311F3868000754B65 /* install_complete.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_complete.png; sourceTree = ""; }; + B0056E1411F3868000754B65 /* install_cust.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_cust.png; sourceTree = ""; }; + B0056E1511F3868000754B65 /* install_dest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_dest.png; sourceTree = ""; }; + B0056E1611F3868000754B65 /* install_stand.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_stand.png; sourceTree = ""; }; + B0056E1711F3868000754B65 /* install_start.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = install_start.png; sourceTree = ""; }; + B0056E1811F3868000754B65 /* screen_format.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screen_format.png; sourceTree = ""; }; + B0056E1911F3868000754B65 /* xnulogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = xnulogo.png; sourceTree = ""; }; + B0056E1A11F3868000754B65 /* Users_Guide0.5.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = Users_Guide0.5.pdf; sourceTree = ""; }; + B00F494911F6089500B1D7C5 /* aml_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aml_generator.h; sourceTree = ""; }; + B00F494A11F6089500B1D7C5 /* aml_generator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aml_generator.c; sourceTree = ""; }; + B0146EFF11FDEF550010765C /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B0146F0011FDEFB90010765C /* GPL_V2_LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GPL_V2_LICENSE; sourceTree = ""; }; + B4118C63153EFEC200C8D926 /* clean_po_headers.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = clean_po_headers.sh; sourceTree = ""; }; + B4118C65153EFEC200C8D926 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = COPYING; sourceTree = ""; }; + B4118C69153EFEC200C8D926 /* BibTeX.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = BibTeX.pm; sourceTree = ""; }; + B4118C6A153EFEC200C8D926 /* Chooser.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Chooser.pm; sourceTree = ""; }; + B4118C6B153EFEC200C8D926 /* Common.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Common.pm; sourceTree = ""; }; + B4118C6C153EFEC200C8D926 /* Debconf.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Debconf.pm; sourceTree = ""; }; + B4118C6D153EFEC200C8D926 /* Dia.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Dia.pm; sourceTree = ""; }; + B4118C6E153EFEC200C8D926 /* Docbook.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Docbook.pm; sourceTree = ""; }; + B4118C6F153EFEC200C8D926 /* Guide.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Guide.pm; sourceTree = ""; }; + B4118C70153EFEC200C8D926 /* Halibut.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Halibut.pm; sourceTree = ""; }; + B4118C71153EFEC200C8D926 /* Html.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Html.pm; sourceTree = ""; }; + B4118C72153EFEC200C8D926 /* Ini.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Ini.pm; sourceTree = ""; }; + B4118C73153EFEC200C8D926 /* KernelHelp.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = KernelHelp.pm; sourceTree = ""; }; + B4118C74153EFEC200C8D926 /* LaTeX.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = LaTeX.pm; sourceTree = ""; }; + B4118C75153EFEC200C8D926 /* Man.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Man.pm; sourceTree = ""; }; + B4118C76153EFEC200C8D926 /* NewsDebian.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = NewsDebian.pm; sourceTree = ""; }; + B4118C77153EFEC200C8D926 /* Po.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Po.pm; sourceTree = ""; }; + B4118C78153EFEC200C8D926 /* Pod.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Pod.pm; sourceTree = ""; }; + B4118C79153EFEC200C8D926 /* Prop.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Prop.pm; sourceTree = ""; }; + B4118C7A153EFEC200C8D926 /* Sgml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Sgml.pm; sourceTree = ""; }; + B4118C7B153EFEC200C8D926 /* TeX.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = TeX.pm; sourceTree = ""; }; + B4118C7C153EFEC200C8D926 /* Texinfo.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Texinfo.pm; sourceTree = ""; }; + B4118C7D153EFEC200C8D926 /* Text.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Text.pm; sourceTree = ""; }; + B4118C7E153EFEC200C8D926 /* TransTractor.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = TransTractor.pm; sourceTree = ""; }; + B4118C7F153EFEC200C8D926 /* Wml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Wml.pm; sourceTree = ""; }; + B4118C80153EFEC200C8D926 /* Xhtml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Xhtml.pm; sourceTree = ""; }; + B4118C81153EFEC200C8D926 /* Xml.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = Xml.pm; sourceTree = ""; }; + B4118C82153EFEC200C8D926 /* MANIFEST */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MANIFEST; sourceTree = ""; }; + B4118C83153EFEC200C8D926 /* NEWS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NEWS; sourceTree = ""; }; + B4118C84153EFEC200C8D926 /* po4a */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = po4a; sourceTree = ""; }; + B4118C85153EFEC200C8D926 /* po4a-gettextize */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-gettextize"; sourceTree = ""; }; + B4118C86153EFEC200C8D926 /* po4a-normalize */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-normalize"; sourceTree = ""; }; + B4118C87153EFEC200C8D926 /* po4a-translate */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-translate"; sourceTree = ""; }; + B4118C88153EFEC200C8D926 /* po4a-updatepo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-updatepo"; sourceTree = ""; }; + B4118C89153EFEC200C8D926 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + B4118C8A153EFEC200C8D926 /* README.maintainers */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.maintainers; sourceTree = ""; }; + B4118C8B153EFEC200C8D926 /* README.tests */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.tests; sourceTree = ""; }; + B4118C8C153EFEC200C8D926 /* README.translators */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.translators; sourceTree = ""; }; + B4118C8F153EFF3300C8D926 /* ar.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ar.po; sourceTree = ""; }; + B4118C90153EFF3300C8D926 /* bg.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bg.po; sourceTree = ""; }; + B4118C91153EFF3300C8D926 /* bs.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = bs.po; sourceTree = ""; }; + B4118C92153EFF3300C8D926 /* ca.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ca.po; sourceTree = ""; }; + B4118C93153EFF3300C8D926 /* chameleon.pot */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = chameleon.pot; sourceTree = ""; }; + B4118C94153EFF3300C8D926 /* cs.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cs.po; sourceTree = ""; }; + B4118C95153EFF3300C8D926 /* de.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = de.po; sourceTree = ""; }; + B4118C96153EFF3300C8D926 /* el.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = el.po; sourceTree = ""; }; + B4118C97153EFF3300C8D926 /* en.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = en.po; sourceTree = ""; }; + B4118C98153EFF3300C8D926 /* es.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = es.po; sourceTree = ""; }; + B4118C99153EFF3300C8D926 /* fa.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fa.po; sourceTree = ""; }; + B4118C9A153EFF3300C8D926 /* fr.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fr.po; sourceTree = ""; }; + B4118C9B153EFF3300C8D926 /* he.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = he.po; sourceTree = ""; }; + B4118C9C153EFF3300C8D926 /* hr.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hr.po; sourceTree = ""; }; + B4118C9D153EFF3300C8D926 /* hu.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = hu.po; sourceTree = ""; }; + B4118C9E153EFF3300C8D926 /* id.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = id.po; sourceTree = ""; }; + B4118C9F153EFF3300C8D926 /* it.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = it.po; sourceTree = ""; }; + B4118CA0153EFF3300C8D926 /* ko.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ko.po; sourceTree = ""; }; + B4118CA1153EFF3300C8D926 /* mk.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = mk.po; sourceTree = ""; }; + B4118CA2153EFF3300C8D926 /* nl.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = nl.po; sourceTree = ""; }; + B4118CA3153EFF3300C8D926 /* pl.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pl.po; sourceTree = ""; }; + B4118CA4153EFF3300C8D926 /* pt-BR.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pt-BR.po"; sourceTree = ""; }; + B4118CA5153EFF3300C8D926 /* pt-PT.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pt-PT.po"; sourceTree = ""; }; + B4118CA6153EFF3300C8D926 /* ro.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ro.po; sourceTree = ""; }; + B4118CA7153EFF3300C8D926 /* ru.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ru.po; sourceTree = ""; }; + B4118CA8153EFF3300C8D926 /* sr.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = sr.po; sourceTree = ""; }; + B4118CA9153EFF3300C8D926 /* zh_CN.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zh_CN.po; sourceTree = ""; }; + B4118CAA153EFF3300C8D926 /* zh_TW.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zh_TW.po; sourceTree = ""; }; + B4118CAB153EFF3D00C8D926 /* po4a-chameleon.cfg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "po4a-chameleon.cfg"; sourceTree = ""; }; + B41899FB14BFBE2400ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B41899FD14BFBE4500ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B41899FE14BFBE5200ED5B0B /* boot0md.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0md.s; sourceTree = ""; }; + B41899FF14BFBE5D00ED5B0B /* boot0hfs.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot0hfs.s; sourceTree = ""; }; + B4189A0014BFBE7D00ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A0114BFBE8900ED5B0B /* boot1h.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = boot1h.s; sourceTree = ""; }; + B4189A0214BFBE9E00ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A0514BFBF0A00ED5B0B /* BIG.FAT.WARNING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = BIG.FAT.WARNING; path = config/lxdialog/BIG.FAT.WARNING; sourceTree = ""; }; + B4189A0614BFBF0A00ED5B0B /* check-lxdialog.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "check-lxdialog.sh"; path = "config/lxdialog/check-lxdialog.sh"; sourceTree = ""; }; + B4189A0714BFBF0A00ED5B0B /* checklist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checklist.c; path = config/lxdialog/checklist.c; sourceTree = ""; }; + B4189A0814BFBF0A00ED5B0B /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dialog.h; path = config/lxdialog/dialog.h; sourceTree = ""; }; + B4189A0914BFBF0A00ED5B0B /* inputbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inputbox.c; path = config/lxdialog/inputbox.c; sourceTree = ""; }; + B4189A0A14BFBF0A00ED5B0B /* menubox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menubox.c; path = config/lxdialog/menubox.c; sourceTree = ""; }; + B4189A0B14BFBF0A00ED5B0B /* textbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = textbox.c; path = config/lxdialog/textbox.c; sourceTree = ""; }; + B4189A0C14BFBF0A00ED5B0B /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = config/lxdialog/util.c; sourceTree = ""; }; + B4189A0D14BFBF0A00ED5B0B /* yesno.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = yesno.c; path = config/lxdialog/yesno.c; sourceTree = ""; }; + B4189A0E14BFBF1C00ED5B0B /* cconfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cconfig.c; path = config/cconfig.c; sourceTree = ""; }; + B4189A0F14BFBF1C00ED5B0B /* checklist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = checklist.c; path = config/checklist.c; sourceTree = ""; }; + B4189A1014BFBF1C00ED5B0B /* confdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = confdata.c; path = config/confdata.c; sourceTree = ""; }; + B4189A1114BFBF1C00ED5B0B /* dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dialog.h; path = config/dialog.h; sourceTree = ""; }; + B4189A1214BFBF1C00ED5B0B /* expr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = expr.c; path = config/expr.c; sourceTree = ""; }; + B4189A1314BFBF1C00ED5B0B /* expr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = expr.h; path = config/expr.h; sourceTree = ""; }; + B4189A1414BFBF1C00ED5B0B /* inputbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = inputbox.c; path = config/inputbox.c; sourceTree = ""; }; + B4189A1514BFBF1C00ED5B0B /* lex.zconf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lex.zconf.c; path = config/lex.zconf.c; sourceTree = ""; }; + B4189A1614BFBF1C00ED5B0B /* lkc_proto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lkc_proto.h; path = config/lkc_proto.h; sourceTree = ""; }; + B4189A1714BFBF1C00ED5B0B /* lkc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lkc.h; path = config/lkc.h; sourceTree = ""; }; + B4189A1814BFBF1C00ED5B0B /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = config/Makefile; sourceTree = ""; }; + B4189A1914BFBF1C00ED5B0B /* menu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menu.c; path = config/menu.c; sourceTree = ""; }; + B4189A1A14BFBF1C00ED5B0B /* menubox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = menubox.c; path = config/menubox.c; sourceTree = ""; }; + B4189A1B14BFBF1C00ED5B0B /* nconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nconf.h; path = config/nconf.h; sourceTree = ""; }; + B4189A1C14BFBF1C00ED5B0B /* symbol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = symbol.c; path = config/symbol.c; sourceTree = ""; }; + B4189A1D14BFBF1C00ED5B0B /* textbox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = textbox.c; path = config/textbox.c; sourceTree = ""; }; + B4189A1E14BFBF1C00ED5B0B /* util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = util.c; path = config/util.c; sourceTree = ""; }; + B4189A1F14BFBF1C00ED5B0B /* yesno.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = yesno.c; path = config/yesno.c; sourceTree = ""; }; + B4189A2014BFBF1C00ED5B0B /* zconf.hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zconf.hash.c; path = config/zconf.hash.c; sourceTree = ""; }; + B4189A2114BFBF1C00ED5B0B /* zconf.tab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zconf.tab.c; path = config/zconf.tab.c; sourceTree = ""; }; + B4189A2214BFBF5600ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A2314BFBF7200ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4189A2414BFBFD100ED5B0B /* Cconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cconfig; sourceTree = ""; }; + B4AABE5914C3B8B90055ECD1 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B4AABE5B14C3B8C70055ECD1 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B4AABE5D14C3B8D70055ECD1 /* postinstall */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; + B4AABE5E14C3B8EF0055ECD1 /* clean_bootplist.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = clean_bootplist.pl; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 08FB7794FE84155DC02AAC07 /* Chameleon */ = { + isa = PBXGroup; + children = ( + AB30C92D15DE60ED0047BE7B /* bin */, + B0056D8211F3868000754B65 /* APPLE_LICENSE */, + B0056DBA11F3868000754B65 /* artwork */, + 369689D014BD0AF10013D77F /* BLOCKERS */, + 369689D114BD0AF10013D77F /* Cconfig */, + B0056D8111F3868000754B65 /* CHANGES */, + B0056D8011F3868000754B65 /* coding_standards.txt */, + B0056D7F11F3868000754B65 /* CREDITS */, + B0056E0611F3868000754B65 /* doc */, + B0146F0011FDEFB90010765C /* GPL_V2_LICENSE */, + B0056CE511F3868000754B65 /* i386 */, + A360AA7D14136C1A00084D3F /* Make.rules */, + B0056D7D11F3868000754B65 /* Makefile */, + 019DFBAF11FB94090013E8CC /* MEMTEST86_LICENSE */, + B0056D8311F3868000754B65 /* package */, + B0146EFF11FDEF550010765C /* README */, + A31301A71503CB9900E8C718 /* README.translators */, + B0056D7C11F3868000754B65 /* TODO */, + 369689D214BD0B470013D77F /* version */, + ); + name = Chameleon; + sourceTree = ""; + }; + 361BC70414BD979700236488 /* Icons */ = { + isa = PBXGroup; + children = ( + 361BC70B14BD97C800236488 /* pkg.zip */, + ); + name = Icons; + sourceTree = ""; + }; + 364E0DDF14BCFB6600F55E58 /* Scripts.templates */ = { + isa = PBXGroup; + children = ( + B4AABE5814C3B8B90055ECD1 /* AddOption */, + 364E0DE114BCFB7A00F55E58 /* InstallerLog */, + B4AABE5A14C3B8C70055ECD1 /* InstallModule */, + B4AABE5C14C3B8D70055ECD1 /* InstallTheme */, + 364E0DE314BCFB7A00F55E58 /* Post */, + 364E0DE514BCFB7A00F55E58 /* Pre */, + ); + name = Scripts.templates; + sourceTree = ""; + }; + 364E0DE114BCFB7A00F55E58 /* InstallerLog */ = { + isa = PBXGroup; + children = ( + 36AB75E114BD091C005B8045 /* InstallLog.sh */, + ); + name = InstallerLog; + path = Scripts.templates/InstallerLog; + sourceTree = ""; + }; + 364E0DE314BCFB7A00F55E58 /* Post */ = { + isa = PBXGroup; + children = ( + 36AB75E314BD0925005B8045 /* postinstall */, + ); + name = Post; + path = Scripts.templates/Post; + sourceTree = ""; + }; + 364E0DE514BCFB7A00F55E58 /* Pre */ = { + isa = PBXGroup; + children = ( + B4AABE5E14C3B8EF0055ECD1 /* clean_bootplist.pl */, + 36AB75E414BD092D005B8045 /* preinstall */, + ); + name = Pre; + path = Scripts.templates/Pre; + sourceTree = ""; + }; + 36B43E8114BCE91300D29461 /* OptionalSettings */ = { + isa = PBXGroup; + children = ( + 36AB75E514BD095E005B8045 /* Control.txt */, + 36AB75E614BD095E005B8045 /* General.txt */, + 36AB75E714BD095E005B8045 /* KernelFlags.txt */, + 36AB75E814BD095E005B8045 /* PowerManagement.txt */, + 36AB75E914BD095E005B8045 /* Resolution.txt */, + 36AB75EA14BD095E005B8045 /* Video.txt */, + ); + name = OptionalSettings; + sourceTree = ""; + }; + 6DBAFD1713B0D4590047ED33 /* include */ = { + isa = PBXGroup; + children = ( + 6DBAFD1813B0D4590047ED33 /* _structs.h */, + 6DBAFD1913B0D4590047ED33 /* _types.h */, + 6DBAFD1A13B0D4590047ED33 /* architecture */, + 6DBAFD3A13B0D4590047ED33 /* assert.h */, + 6DBAFD3B13B0D4590047ED33 /* ctype.h */, + 6DBAFD3C13B0D4590047ED33 /* device */, + 6DBAFD3F13B0D4590047ED33 /* errno.h */, + 6DBAFD4013B0D4590047ED33 /* float.h */, + 6DBAFD4113B0D4590047ED33 /* hfs */, + 6DBAFD4513B0D4590047ED33 /* i386 */, + 6DBAFD5513B0D4590047ED33 /* inttypes.h */, + 6DBAFD5613B0D4590047ED33 /* IOKit */, + 6DBAFE9D13B0D4590047ED33 /* libkern */, + 6DBAFEB013B0D4590047ED33 /* limits.h */, + 6DBAFEB113B0D4590047ED33 /* locale.h */, + 6DBAFEB213B0D4590047ED33 /* mach */, + 6DBAFF4E13B0D4590047ED33 /* mach-o */, + 6DBAFF6313B0D4590047ED33 /* machine */, + 6DBAFF7213B0D4590047ED33 /* math.h */, + 6DBAFF7313B0D4590047ED33 /* netinet */, + 6DBAFF8D13B0D4590047ED33 /* netinet6 */, + 6DBAFF9913B0D4590047ED33 /* runetype.h */, + 6DBAFF9A13B0D4590047ED33 /* secure */, + 6DBAFF9D13B0D4590047ED33 /* setjmp.h */, + 6DBAFF9E13B0D4590047ED33 /* signal.h */, + 6DBAFF9F13B0D4590047ED33 /* stdarg.h */, + 6DBAFFA013B0D4590047ED33 /* stdbool.h */, + 6DBAFFA113B0D4590047ED33 /* stddef.h */, + 6DBAFFA213B0D4590047ED33 /* stdint.h */, + 6DBAFFA313B0D4590047ED33 /* stdio.h */, + 6DBAFFA413B0D4590047ED33 /* stdlib.h */, + 6DBAFFA513B0D4590047ED33 /* string.h */, + 6DBAFFA613B0D4590047ED33 /* sys */, + 6DBAFFB913B0D4590047ED33 /* time.h */, + 6DBAFFBA13B0D4590047ED33 /* ufs */, + 6DBAFFC413B0D4590047ED33 /* unistd.h */, + 6DBAFFC513B0D4590047ED33 /* unwind.h */, + ); + path = include; + sourceTree = ""; + }; + 6DBAFD1A13B0D4590047ED33 /* architecture */ = { + isa = PBXGroup; + children = ( + 6DBAFD1B13B0D4590047ED33 /* alignment.h */, + 6DBAFD1C13B0D4590047ED33 /* byte_order.h */, + 6DBAFD1D13B0D4590047ED33 /* i386 */, + 6DBAFD2D13B0D4590047ED33 /* ppc */, + ); + path = architecture; + sourceTree = ""; + }; + 6DBAFD1D13B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFD1E13B0D4590047ED33 /* alignment.h */, + 6DBAFD1F13B0D4590047ED33 /* asm_help.h */, + 6DBAFD2013B0D4590047ED33 /* byte_order.h */, + 6DBAFD2113B0D4590047ED33 /* cpu.h */, + 6DBAFD2213B0D4590047ED33 /* desc.h */, + 6DBAFD2313B0D4590047ED33 /* fenv.h */, + 6DBAFD2413B0D4590047ED33 /* fpu.h */, + 6DBAFD2513B0D4590047ED33 /* frame.h */, + 6DBAFD2613B0D4590047ED33 /* io.h */, + 6DBAFD2713B0D4590047ED33 /* math.h */, + 6DBAFD2813B0D4590047ED33 /* pio.h */, + 6DBAFD2913B0D4590047ED33 /* reg_help.h */, + 6DBAFD2A13B0D4590047ED33 /* sel.h */, + 6DBAFD2B13B0D4590047ED33 /* table.h */, + 6DBAFD2C13B0D4590047ED33 /* tss.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFD2D13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFD2E13B0D4590047ED33 /* alignment.h */, + 6DBAFD2F13B0D4590047ED33 /* asm_help.h */, + 6DBAFD3013B0D4590047ED33 /* basic_regs.h */, + 6DBAFD3113B0D4590047ED33 /* byte_order.h */, + 6DBAFD3213B0D4590047ED33 /* cframe.h */, + 6DBAFD3313B0D4590047ED33 /* fenv.h */, + 6DBAFD3413B0D4590047ED33 /* fp_regs.h */, + 6DBAFD3513B0D4590047ED33 /* macro_help.h */, + 6DBAFD3613B0D4590047ED33 /* math.h */, + 6DBAFD3713B0D4590047ED33 /* mode_independent_asm.h */, + 6DBAFD3813B0D4590047ED33 /* pseudo_inst.h */, + 6DBAFD3913B0D4590047ED33 /* reg_help.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFD3C13B0D4590047ED33 /* device */ = { + isa = PBXGroup; + children = ( + 6DBAFD3D13B0D4590047ED33 /* device_port.h */, + 6DBAFD3E13B0D4590047ED33 /* device_types.h */, + ); + path = device; + sourceTree = ""; + }; + 6DBAFD4113B0D4590047ED33 /* hfs */ = { + isa = PBXGroup; + children = ( + 6DBAFD4213B0D4590047ED33 /* hfs_encodings.h */, + 6DBAFD4313B0D4590047ED33 /* hfs_format.h */, + 6DBAFD4413B0D4590047ED33 /* hfs_mount.h */, + ); + path = hfs; + sourceTree = ""; + }; + 6DBAFD4513B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFD4613B0D4590047ED33 /* _limits.h */, + 6DBAFD4713B0D4590047ED33 /* _param.h */, + 6DBAFD4813B0D4590047ED33 /* _structs.h */, + 6DBAFD4913B0D4590047ED33 /* _types.h */, + 6DBAFD4A13B0D4590047ED33 /* eflags.h */, + 6DBAFD4B13B0D4590047ED33 /* endian.h */, + 6DBAFD4C13B0D4590047ED33 /* fasttrap_isa.h */, + 6DBAFD4D13B0D4590047ED33 /* limits.h */, + 6DBAFD4E13B0D4590047ED33 /* param.h */, + 6DBAFD4F13B0D4590047ED33 /* profile.h */, + 6DBAFD5013B0D4590047ED33 /* setjmp.h */, + 6DBAFD5113B0D4590047ED33 /* signal.h */, + 6DBAFD5213B0D4590047ED33 /* types.h */, + 6DBAFD5313B0D4590047ED33 /* user_ldt.h */, + 6DBAFD5413B0D4590047ED33 /* vmparam.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFD5613B0D4590047ED33 /* IOKit */ = { + isa = PBXGroup; + children = ( + 6DBAFD5713B0D4590047ED33 /* acpi */, + 6DBAFD5B13B0D4590047ED33 /* assert.h */, + 6DBAFD5C13B0D4590047ED33 /* ata */, + 6DBAFD6913B0D4590047ED33 /* audio */, + 6DBAFD7713B0D4590047ED33 /* avc */, + 6DBAFD7F13B0D4590047ED33 /* bluetooth */, + 6DBAFD8813B0D4590047ED33 /* firewire */, + 6DBAFDA913B0D4590047ED33 /* graphics */, + 6DBAFDB513B0D4590047ED33 /* hid */, + 6DBAFDBB13B0D4590047ED33 /* hidevent */, + 6DBAFDBE13B0D4590047ED33 /* hidsystem */, + 6DBAFDCB13B0D4590047ED33 /* i2c */, + 6DBAFDCD13B0D4590047ED33 /* IOBSD.h */, + 6DBAFDCE13B0D4590047ED33 /* IOBufferMemoryDescriptor.h */, + 6DBAFDCF13B0D4590047ED33 /* IOCatalogue.h */, + 6DBAFDD013B0D4590047ED33 /* IOCommand.h */, + 6DBAFDD113B0D4590047ED33 /* IOCommandGate.h */, + 6DBAFDD213B0D4590047ED33 /* IOCommandPool.h */, + 6DBAFDD313B0D4590047ED33 /* IOConditionLock.h */, + 6DBAFDD413B0D4590047ED33 /* IODataQueue.h */, + 6DBAFDD513B0D4590047ED33 /* IODataQueueShared.h */, + 6DBAFDD613B0D4590047ED33 /* IODeviceMemory.h */, + 6DBAFDD713B0D4590047ED33 /* IODeviceTreeSupport.h */, + 6DBAFDD813B0D4590047ED33 /* IODMACommand.h */, + 6DBAFDD913B0D4590047ED33 /* IODMAController.h */, + 6DBAFDDA13B0D4590047ED33 /* IODMAEventSource.h */, + 6DBAFDDB13B0D4590047ED33 /* IOEventSource.h */, + 6DBAFDDC13B0D4590047ED33 /* IOFilterInterruptEventSource.h */, + 6DBAFDDD13B0D4590047ED33 /* IOInterleavedMemoryDescriptor.h */, + 6DBAFDDE13B0D4590047ED33 /* IOInterruptController.h */, + 6DBAFDDF13B0D4590047ED33 /* IOInterruptEventSource.h */, + 6DBAFDE013B0D4590047ED33 /* IOInterrupts.h */, + 6DBAFDE113B0D4590047ED33 /* IOKitDebug.h */, + 6DBAFDE213B0D4590047ED33 /* IOKitKeys.h */, + 6DBAFDE313B0D4590047ED33 /* IOKitServer.h */, + 6DBAFDE413B0D4590047ED33 /* IOLib.h */, + 6DBAFDE513B0D4590047ED33 /* IOLocks.h */, + 6DBAFDE613B0D4590047ED33 /* IOMapper.h */, + 6DBAFDE713B0D4590047ED33 /* IOMemoryCursor.h */, + 6DBAFDE813B0D4590047ED33 /* IOMemoryDescriptor.h */, + 6DBAFDE913B0D4590047ED33 /* IOMessage.h */, + 6DBAFDEA13B0D4590047ED33 /* IOMultiMemoryDescriptor.h */, + 6DBAFDEB13B0D4590047ED33 /* IONotifier.h */, + 6DBAFDEC13B0D4590047ED33 /* IONVRAM.h */, + 6DBAFDED13B0D4590047ED33 /* IOPlatformExpert.h */, + 6DBAFDEE13B0D4590047ED33 /* IORangeAllocator.h */, + 6DBAFDEF13B0D4590047ED33 /* IORegistryEntry.h */, + 6DBAFDF013B0D4590047ED33 /* IOReturn.h */, + 6DBAFDF113B0D4590047ED33 /* IOService.h */, + 6DBAFDF213B0D4590047ED33 /* IOServicePM.h */, + 6DBAFDF313B0D4590047ED33 /* IOSharedDataQueue.h */, + 6DBAFDF413B0D4590047ED33 /* IOSharedLock.h */, + 6DBAFDF513B0D4590047ED33 /* IOSubMemoryDescriptor.h */, + 6DBAFDF613B0D4590047ED33 /* IOSyncer.h */, + 6DBAFDF713B0D4590047ED33 /* IOTimerEventSource.h */, + 6DBAFDF813B0D4590047ED33 /* IOTimeStamp.h */, + 6DBAFDF913B0D4590047ED33 /* IOTypes.h */, + 6DBAFDFA13B0D4590047ED33 /* IOUserClient.h */, + 6DBAFDFB13B0D4590047ED33 /* IOWorkLoop.h */, + 6DBAFDFC13B0D4590047ED33 /* ndrvsupport */, + 6DBAFE0213B0D4590047ED33 /* network */, + 6DBAFE1113B0D4590047ED33 /* nvram */, + 6DBAFE1313B0D4590047ED33 /* OSMessageNotification.h */, + 6DBAFE1413B0D4590047ED33 /* pci */, + 6DBAFE1813B0D4590047ED33 /* platform */, + 6DBAFE1D13B0D4590047ED33 /* power */, + 6DBAFE1F13B0D4590047ED33 /* ppc */, + 6DBAFE2113B0D4590047ED33 /* pwr_mgt */, + 6DBAFE2B13B0D4590047ED33 /* rtc */, + 6DBAFE2D13B0D4590047ED33 /* sbp2 */, + 6DBAFE3713B0D4590047ED33 /* scsi */, + 6DBAFE5313B0D4590047ED33 /* serial */, + 6DBAFE5913B0D4590047ED33 /* storage */, + 6DBAFE7B13B0D4590047ED33 /* stream */, + 6DBAFE8013B0D4590047ED33 /* system.h */, + 6DBAFE8113B0D4590047ED33 /* system_management */, + 6DBAFE8313B0D4590047ED33 /* usb */, + ); + path = IOKit; + sourceTree = ""; + }; + 6DBAFD5713B0D4590047ED33 /* acpi */ = { + isa = PBXGroup; + children = ( + 6DBAFD5813B0D4590047ED33 /* IOACPIPlatformDevice.h */, + 6DBAFD5913B0D4590047ED33 /* IOACPIPlatformExpert.h */, + 6DBAFD5A13B0D4590047ED33 /* IOACPITypes.h */, + ); + path = acpi; + sourceTree = ""; + }; + 6DBAFD5C13B0D4590047ED33 /* ata */ = { + isa = PBXGroup; + children = ( + 6DBAFD5D13B0D4590047ED33 /* ATADeviceNub.h */, + 6DBAFD5E13B0D4590047ED33 /* ATATimerEventSource.h */, + 6DBAFD5F13B0D4590047ED33 /* IOATABusCommand.h */, + 6DBAFD6013B0D4590047ED33 /* IOATABusInfo.h */, + 6DBAFD6113B0D4590047ED33 /* IOATACommand.h */, + 6DBAFD6213B0D4590047ED33 /* IOATAController.h */, + 6DBAFD6313B0D4590047ED33 /* IOATADevConfig.h */, + 6DBAFD6413B0D4590047ED33 /* IOATADevice.h */, + 6DBAFD6513B0D4590047ED33 /* IOATARegI386.h */, + 6DBAFD6613B0D4590047ED33 /* IOATATypes.h */, + 6DBAFD6713B0D4590047ED33 /* IOPCIATA.h */, + 6DBAFD6813B0D4590047ED33 /* MacIOATA.h */, + ); + path = ata; + sourceTree = ""; + }; + 6DBAFD6913B0D4590047ED33 /* audio */ = { + isa = PBXGroup; + children = ( + 6DBAFD6A13B0D4590047ED33 /* IOAudioControl.h */, + 6DBAFD6B13B0D4590047ED33 /* IOAudioControlUserClient.h */, + 6DBAFD6C13B0D4590047ED33 /* IOAudioDebug.h */, + 6DBAFD6D13B0D4590047ED33 /* IOAudioDefines.h */, + 6DBAFD6E13B0D4590047ED33 /* IOAudioDevice.h */, + 6DBAFD6F13B0D4590047ED33 /* IOAudioEngine.h */, + 6DBAFD7013B0D4590047ED33 /* IOAudioEngineUserClient.h */, + 6DBAFD7113B0D4590047ED33 /* IOAudioLevelControl.h */, + 6DBAFD7213B0D4590047ED33 /* IOAudioPort.h */, + 6DBAFD7313B0D4590047ED33 /* IOAudioSelectorControl.h */, + 6DBAFD7413B0D4590047ED33 /* IOAudioStream.h */, + 6DBAFD7513B0D4590047ED33 /* IOAudioToggleControl.h */, + 6DBAFD7613B0D4590047ED33 /* IOAudioTypes.h */, + ); + path = audio; + sourceTree = ""; + }; + 6DBAFD7713B0D4590047ED33 /* avc */ = { + isa = PBXGroup; + children = ( + 6DBAFD7813B0D4590047ED33 /* IOFireWireAVCCommand.h */, + 6DBAFD7913B0D4590047ED33 /* IOFireWireAVCConsts.h */, + 6DBAFD7A13B0D4590047ED33 /* IOFireWireAVCRequestSpace.h */, + 6DBAFD7B13B0D4590047ED33 /* IOFireWireAVCTargetSpace.h */, + 6DBAFD7C13B0D4590047ED33 /* IOFireWireAVCUnit.h */, + 6DBAFD7D13B0D4590047ED33 /* IOFireWireAVCUserClientCommon.h */, + 6DBAFD7E13B0D4590047ED33 /* IOFireWirePCRSpace.h */, + ); + path = avc; + sourceTree = ""; + }; + 6DBAFD7F13B0D4590047ED33 /* bluetooth */ = { + isa = PBXGroup; + children = ( + 6DBAFD8013B0D4590047ED33 /* Bluetooth.h */, + 6DBAFD8113B0D4590047ED33 /* BluetoothAssignedNumbers.h */, + 6DBAFD8213B0D4590047ED33 /* IOBluetoothHCIController.h */, + 6DBAFD8313B0D4590047ED33 /* IOBluetoothHCIRequest.h */, + 6DBAFD8413B0D4590047ED33 /* IOBluetoothHIDDriver.h */, + 6DBAFD8513B0D4590047ED33 /* IOBluetoothHIDDriverTypes.h */, + 6DBAFD8613B0D4590047ED33 /* IOBluetoothInternal.h */, + 6DBAFD8713B0D4590047ED33 /* IOBluetoothTypes.h */, + ); + path = bluetooth; + sourceTree = ""; + }; + 6DBAFD8813B0D4590047ED33 /* firewire */ = { + isa = PBXGroup; + children = ( + 6DBAFD8913B0D4590047ED33 /* IOConfigDirectory.h */, + 6DBAFD8A13B0D4590047ED33 /* IOFireWireBus.h */, + 6DBAFD8B13B0D4590047ED33 /* IOFireWireController.h */, + 6DBAFD8C13B0D4590047ED33 /* IOFireWireDevice.h */, + 6DBAFD8D13B0D4590047ED33 /* IOFireWireFamilyCommon.h */, + 6DBAFD8E13B0D4590047ED33 /* IOFireWireIRMAllocation.h */, + 6DBAFD8F13B0D4590047ED33 /* IOFireWireLocalNode.h */, + 6DBAFD9013B0D4590047ED33 /* IOFireWireMultiIsochReceive.h */, + 6DBAFD9113B0D4590047ED33 /* IOFireWireNub.h */, + 6DBAFD9213B0D4590047ED33 /* IOFireWirePowerManager.h */, + 6DBAFD9313B0D4590047ED33 /* IOFireWireUnit.h */, + 6DBAFD9413B0D4590047ED33 /* IOFWAddressSpace.h */, + 6DBAFD9513B0D4590047ED33 /* IOFWAsyncStreamListener.h */, + 6DBAFD9613B0D4590047ED33 /* IOFWCommand.h */, + 6DBAFD9713B0D4590047ED33 /* IOFWDCL.h */, + 6DBAFD9813B0D4590047ED33 /* IOFWDCLPool.h */, + 6DBAFD9913B0D4590047ED33 /* IOFWDCLProgram.h */, + 6DBAFD9A13B0D4590047ED33 /* IOFWDCLTranslator.h */, + 6DBAFD9B13B0D4590047ED33 /* IOFWIsochChannel.h */, + 6DBAFD9C13B0D4590047ED33 /* IOFWIsochPort.h */, + 6DBAFD9D13B0D4590047ED33 /* IOFWLocalIsochPort.h */, + 6DBAFD9E13B0D4590047ED33 /* IOFWPHYPacketListener.h */, + 6DBAFD9F13B0D4590047ED33 /* IOFWPhysicalAddressSpace.h */, + 6DBAFDA013B0D4590047ED33 /* IOFWPseudoAddressSpace.h */, + 6DBAFDA113B0D4590047ED33 /* IOFWRegs.h */, + 6DBAFDA213B0D4590047ED33 /* IOFWSimpleContiguousPhysicalAddressSpace.h */, + 6DBAFDA313B0D4590047ED33 /* IOFWSimplePhysicalAddressSpace.h */, + 6DBAFDA413B0D4590047ED33 /* IOFWSyncer.h */, + 6DBAFDA513B0D4590047ED33 /* IOFWUserObjectExporter.h */, + 6DBAFDA613B0D4590047ED33 /* IOFWUtils.h */, + 6DBAFDA713B0D4590047ED33 /* IOLocalConfigDirectory.h */, + 6DBAFDA813B0D4590047ED33 /* IORemoteConfigDirectory.h */, + ); + path = firewire; + sourceTree = ""; + }; + 6DBAFDA913B0D4590047ED33 /* graphics */ = { + isa = PBXGroup; + children = ( + 6DBAFDAA13B0D4590047ED33 /* IOAccelClientConnect.h */, + 6DBAFDAB13B0D4590047ED33 /* IOAccelerator.h */, + 6DBAFDAC13B0D4590047ED33 /* IOAccelSurfaceConnect.h */, + 6DBAFDAD13B0D4590047ED33 /* IOAccelTypes.h */, + 6DBAFDAE13B0D4590047ED33 /* IODisplay.h */, + 6DBAFDAF13B0D4590047ED33 /* IOFramebuffer.h */, + 6DBAFDB013B0D4590047ED33 /* IOFramebufferShared.h */, + 6DBAFDB113B0D4590047ED33 /* IOGraphicsDevice.h */, + 6DBAFDB213B0D4590047ED33 /* IOGraphicsEngine.h */, + 6DBAFDB313B0D4590047ED33 /* IOGraphicsInterfaceTypes.h */, + 6DBAFDB413B0D4590047ED33 /* IOGraphicsTypes.h */, + ); + path = graphics; + sourceTree = ""; + }; + 6DBAFDB513B0D4590047ED33 /* hid */ = { + isa = PBXGroup; + children = ( + 6DBAFDB613B0D4590047ED33 /* IOHIDDevice.h */, + 6DBAFDB713B0D4590047ED33 /* IOHIDElement.h */, + 6DBAFDB813B0D4590047ED33 /* IOHIDInterface.h */, + 6DBAFDB913B0D4590047ED33 /* IOHIDKeys.h */, + 6DBAFDBA13B0D4590047ED33 /* IOHIDUsageTables.h */, + ); + path = hid; + sourceTree = ""; + }; + 6DBAFDBB13B0D4590047ED33 /* hidevent */ = { + isa = PBXGroup; + children = ( + 6DBAFDBC13B0D4590047ED33 /* IOHIDEventDriver.h */, + 6DBAFDBD13B0D4590047ED33 /* IOHIDEventService.h */, + ); + path = hidevent; + sourceTree = ""; + }; + 6DBAFDBE13B0D4590047ED33 /* hidsystem */ = { + isa = PBXGroup; + children = ( + 6DBAFDBF13B0D4590047ED33 /* ev_keymap.h */, + 6DBAFDC013B0D4590047ED33 /* IOHIDDescriptorParser.h */, + 6DBAFDC113B0D4590047ED33 /* IOHIDevice.h */, + 6DBAFDC213B0D4590047ED33 /* IOHIDParameter.h */, + 6DBAFDC313B0D4590047ED33 /* IOHIDShared.h */, + 6DBAFDC413B0D4590047ED33 /* IOHIDSystem.h */, + 6DBAFDC513B0D4590047ED33 /* IOHIDTypes.h */, + 6DBAFDC613B0D4590047ED33 /* IOHIDUsageTables.h */, + 6DBAFDC713B0D4590047ED33 /* IOHIKeyboard.h */, + 6DBAFDC813B0D4590047ED33 /* IOHIKeyboardMapper.h */, + 6DBAFDC913B0D4590047ED33 /* IOHIPointing.h */, + 6DBAFDCA13B0D4590047ED33 /* IOLLEvent.h */, + ); + path = hidsystem; + sourceTree = ""; + }; + 6DBAFDCB13B0D4590047ED33 /* i2c */ = { + isa = PBXGroup; + children = ( + 6DBAFDCC13B0D4590047ED33 /* IOI2CInterface.h */, + ); + path = i2c; + sourceTree = ""; + }; + 6DBAFDFC13B0D4590047ED33 /* ndrvsupport */ = { + isa = PBXGroup; + children = ( + 6DBAFDFD13B0D4590047ED33 /* IOMacOSTypes.h */, + 6DBAFDFE13B0D4590047ED33 /* IOMacOSVideo.h */, + 6DBAFDFF13B0D4590047ED33 /* IONDRVFramebuffer.h */, + 6DBAFE0013B0D4590047ED33 /* IONDRVLibraries.h */, + 6DBAFE0113B0D4590047ED33 /* IONDRVSupport.h */, + ); + path = ndrvsupport; + sourceTree = ""; + }; + 6DBAFE0213B0D4590047ED33 /* network */ = { + isa = PBXGroup; + children = ( + 6DBAFE0313B0D4590047ED33 /* IOBasicOutputQueue.h */, + 6DBAFE0413B0D4590047ED33 /* IOEthernetController.h */, + 6DBAFE0513B0D4590047ED33 /* IOEthernetInterface.h */, + 6DBAFE0613B0D4590047ED33 /* IOEthernetStats.h */, + 6DBAFE0713B0D4590047ED33 /* IOGatedOutputQueue.h */, + 6DBAFE0813B0D4590047ED33 /* IOKernelDebugger.h */, + 6DBAFE0913B0D4590047ED33 /* IOMbufMemoryCursor.h */, + 6DBAFE0A13B0D4590047ED33 /* IONetworkController.h */, + 6DBAFE0B13B0D4590047ED33 /* IONetworkData.h */, + 6DBAFE0C13B0D4590047ED33 /* IONetworkInterface.h */, + 6DBAFE0D13B0D4590047ED33 /* IONetworkMedium.h */, + 6DBAFE0E13B0D4590047ED33 /* IONetworkStats.h */, + 6DBAFE0F13B0D4590047ED33 /* IOOutputQueue.h */, + 6DBAFE1013B0D4590047ED33 /* IOPacketQueue.h */, + ); + path = network; + sourceTree = ""; + }; + 6DBAFE1113B0D4590047ED33 /* nvram */ = { + isa = PBXGroup; + children = ( + 6DBAFE1213B0D4590047ED33 /* IONVRAMController.h */, + ); + path = nvram; + sourceTree = ""; + }; + 6DBAFE1413B0D4590047ED33 /* pci */ = { + isa = PBXGroup; + children = ( + 6DBAFE1513B0D4590047ED33 /* IOAGPDevice.h */, + 6DBAFE1613B0D4590047ED33 /* IOPCIBridge.h */, + 6DBAFE1713B0D4590047ED33 /* IOPCIDevice.h */, + ); + path = pci; + sourceTree = ""; + }; + 6DBAFE1813B0D4590047ED33 /* platform */ = { + isa = PBXGroup; + children = ( + 6DBAFE1913B0D4590047ED33 /* AppleMacIO.h */, + 6DBAFE1A13B0D4590047ED33 /* AppleMacIODevice.h */, + 6DBAFE1B13B0D4590047ED33 /* AppleNMI.h */, + 6DBAFE1C13B0D4590047ED33 /* ApplePlatformExpert.h */, + ); + path = platform; + sourceTree = ""; + }; + 6DBAFE1D13B0D4590047ED33 /* power */ = { + isa = PBXGroup; + children = ( + 6DBAFE1E13B0D4590047ED33 /* IOPwrController.h */, + ); + path = power; + sourceTree = ""; + }; + 6DBAFE1F13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFE2013B0D4590047ED33 /* IODBDMA.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFE2113B0D4590047ED33 /* pwr_mgt */ = { + isa = PBXGroup; + children = ( + 6DBAFE2213B0D4590047ED33 /* IOPM.h */, + 6DBAFE2313B0D4590047ED33 /* IOPMDeprecated.h */, + 6DBAFE2413B0D4590047ED33 /* IOPMLibDefs.h */, + 6DBAFE2513B0D4590047ED33 /* IOPMPowerSource.h */, + 6DBAFE2613B0D4590047ED33 /* IOPMPowerSourceList.h */, + 6DBAFE2713B0D4590047ED33 /* IOPMpowerState.h */, + 6DBAFE2813B0D4590047ED33 /* IOPMPrivate.h */, + 6DBAFE2913B0D4590047ED33 /* IOPowerConnection.h */, + 6DBAFE2A13B0D4590047ED33 /* RootDomain.h */, + ); + path = pwr_mgt; + sourceTree = ""; + }; + 6DBAFE2B13B0D4590047ED33 /* rtc */ = { + isa = PBXGroup; + children = ( + 6DBAFE2C13B0D4590047ED33 /* IORTCController.h */, + ); + path = rtc; + sourceTree = ""; + }; + 6DBAFE2D13B0D4590047ED33 /* sbp2 */ = { + isa = PBXGroup; + children = ( + 6DBAFE2E13B0D4590047ED33 /* IOFireWireSBP2Login.h */, + 6DBAFE2F13B0D4590047ED33 /* IOFireWireSBP2LSIWorkaroundDescriptor.h */, + 6DBAFE3013B0D4590047ED33 /* IOFireWireSBP2LUN.h */, + 6DBAFE3113B0D4590047ED33 /* IOFireWireSBP2ManagementORB.h */, + 6DBAFE3213B0D4590047ED33 /* IOFireWireSBP2ORB.h */, + 6DBAFE3313B0D4590047ED33 /* IOFireWireSBP2Target.h */, + 6DBAFE3413B0D4590047ED33 /* IOFireWireSBP2UserClient.h */, + 6DBAFE3513B0D4590047ED33 /* IOFireWireSBP2UserClientCommon.h */, + 6DBAFE3613B0D4590047ED33 /* IOFireWireSerialBusProtocolTransport.h */, + ); + path = sbp2; + sourceTree = ""; + }; + 6DBAFE3713B0D4590047ED33 /* scsi */ = { + isa = PBXGroup; + children = ( + 6DBAFE3813B0D4590047ED33 /* IOBDServices.h */, + 6DBAFE3913B0D4590047ED33 /* IOBlockStorageServices.h */, + 6DBAFE3A13B0D4590047ED33 /* IOCompactDiscServices.h */, + 6DBAFE3B13B0D4590047ED33 /* IODVDServices.h */, + 6DBAFE3C13B0D4590047ED33 /* IOReducedBlockServices.h */, + 6DBAFE3D13B0D4590047ED33 /* IOSCSIBlockCommandsDevice.h */, + 6DBAFE3E13B0D4590047ED33 /* IOSCSIMultimediaCommandsDevice.h */, + 6DBAFE3F13B0D4590047ED33 /* IOSCSIPeripheralDeviceNub.h */, + 6DBAFE4013B0D4590047ED33 /* IOSCSIPeripheralDeviceType00.h */, + 6DBAFE4113B0D4590047ED33 /* IOSCSIPeripheralDeviceType05.h */, + 6DBAFE4213B0D4590047ED33 /* IOSCSIPeripheralDeviceType07.h */, + 6DBAFE4313B0D4590047ED33 /* IOSCSIPeripheralDeviceType0E.h */, + 6DBAFE4413B0D4590047ED33 /* IOSCSIPrimaryCommandsDevice.h */, + 6DBAFE4513B0D4590047ED33 /* IOSCSIProtocolInterface.h */, + 6DBAFE4613B0D4590047ED33 /* IOSCSIProtocolServices.h */, + 6DBAFE4713B0D4590047ED33 /* IOSCSIReducedBlockCommandsDevice.h */, + 6DBAFE4813B0D4590047ED33 /* SCSICmds_INQUIRY_Definitions.h */, + 6DBAFE4913B0D4590047ED33 /* SCSICmds_MODE_Definitions.h */, + 6DBAFE4A13B0D4590047ED33 /* SCSICmds_READ_CAPACITY_Definitions.h */, + 6DBAFE4B13B0D4590047ED33 /* SCSICmds_REPORT_LUNS_Definitions.h */, + 6DBAFE4C13B0D4590047ED33 /* SCSICmds_REQUEST_SENSE_Defs.h */, + 6DBAFE4D13B0D4590047ED33 /* SCSICommandDefinitions.h */, + 6DBAFE4E13B0D4590047ED33 /* SCSICommandOperationCodes.h */, + 6DBAFE4F13B0D4590047ED33 /* SCSIPort.h */, + 6DBAFE5013B0D4590047ED33 /* SCSITask.h */, + 6DBAFE5113B0D4590047ED33 /* spi */, + ); + path = scsi; + sourceTree = ""; + }; + 6DBAFE5113B0D4590047ED33 /* spi */ = { + isa = PBXGroup; + children = ( + 6DBAFE5213B0D4590047ED33 /* IOSCSIParallelInterfaceController.h */, + ); + path = spi; + sourceTree = ""; + }; + 6DBAFE5313B0D4590047ED33 /* serial */ = { + isa = PBXGroup; + children = ( + 6DBAFE5413B0D4590047ED33 /* IOModemSerialStreamSync.h */, + 6DBAFE5513B0D4590047ED33 /* IORS232SerialStreamSync.h */, + 6DBAFE5613B0D4590047ED33 /* IOSerialDriverSync.h */, + 6DBAFE5713B0D4590047ED33 /* IOSerialKeys.h */, + 6DBAFE5813B0D4590047ED33 /* IOSerialStreamSync.h */, + ); + path = serial; + sourceTree = ""; + }; + 6DBAFE5913B0D4590047ED33 /* storage */ = { + isa = PBXGroup; + children = ( + 6DBAFE5A13B0D4590047ED33 /* ata */, + 6DBAFE5D13B0D4590047ED33 /* IOAppleLabelScheme.h */, + 6DBAFE5E13B0D4590047ED33 /* IOApplePartitionScheme.h */, + 6DBAFE5F13B0D4590047ED33 /* IOBDBlockStorageDevice.h */, + 6DBAFE6013B0D4590047ED33 /* IOBDBlockStorageDriver.h */, + 6DBAFE6113B0D4590047ED33 /* IOBDMedia.h */, + 6DBAFE6213B0D4590047ED33 /* IOBDMediaBSDClient.h */, + 6DBAFE6313B0D4590047ED33 /* IOBDTypes.h */, + 6DBAFE6413B0D4590047ED33 /* IOBlockStorageDevice.h */, + 6DBAFE6513B0D4590047ED33 /* IOBlockStorageDriver.h */, + 6DBAFE6613B0D4590047ED33 /* IOCDBlockStorageDevice.h */, + 6DBAFE6713B0D4590047ED33 /* IOCDBlockStorageDriver.h */, + 6DBAFE6813B0D4590047ED33 /* IOCDMedia.h */, + 6DBAFE6913B0D4590047ED33 /* IOCDMediaBSDClient.h */, + 6DBAFE6A13B0D4590047ED33 /* IOCDPartitionScheme.h */, + 6DBAFE6B13B0D4590047ED33 /* IOCDTypes.h */, + 6DBAFE6C13B0D4590047ED33 /* IODVDBlockStorageDevice.h */, + 6DBAFE6D13B0D4590047ED33 /* IODVDBlockStorageDriver.h */, + 6DBAFE6E13B0D4590047ED33 /* IODVDMedia.h */, + 6DBAFE6F13B0D4590047ED33 /* IODVDMediaBSDClient.h */, + 6DBAFE7013B0D4590047ED33 /* IODVDTypes.h */, + 6DBAFE7113B0D4590047ED33 /* IOFDiskPartitionScheme.h */, + 6DBAFE7213B0D4590047ED33 /* IOFilterScheme.h */, + 6DBAFE7313B0D4590047ED33 /* IOFireWireStorageCharacteristics.h */, + 6DBAFE7413B0D4590047ED33 /* IOGUIDPartitionScheme.h */, + 6DBAFE7513B0D4590047ED33 /* IOMedia.h */, + 6DBAFE7613B0D4590047ED33 /* IOMediaBSDClient.h */, + 6DBAFE7713B0D4590047ED33 /* IOPartitionScheme.h */, + 6DBAFE7813B0D4590047ED33 /* IOStorage.h */, + 6DBAFE7913B0D4590047ED33 /* IOStorageDeviceCharacteristics.h */, + 6DBAFE7A13B0D4590047ED33 /* IOStorageProtocolCharacteristics.h */, + ); + path = storage; + sourceTree = ""; + }; + 6DBAFE5A13B0D4590047ED33 /* ata */ = { + isa = PBXGroup; + children = ( + 6DBAFE5B13B0D4590047ED33 /* IOATAPIProtocolTransport.h */, + 6DBAFE5C13B0D4590047ED33 /* IOATAStorageDefines.h */, + ); + path = ata; + sourceTree = ""; + }; + 6DBAFE7B13B0D4590047ED33 /* stream */ = { + isa = PBXGroup; + children = ( + 6DBAFE7C13B0D4590047ED33 /* IOStream.h */, + 6DBAFE7D13B0D4590047ED33 /* IOStreamFamily.h */, + 6DBAFE7E13B0D4590047ED33 /* IOStreamShared.h */, + 6DBAFE7F13B0D4590047ED33 /* IOStreamUserClient.h */, + ); + path = stream; + sourceTree = ""; + }; + 6DBAFE8113B0D4590047ED33 /* system_management */ = { + isa = PBXGroup; + children = ( + 6DBAFE8213B0D4590047ED33 /* IOWatchDogTimer.h */, + ); + path = system_management; + sourceTree = ""; + }; + 6DBAFE8313B0D4590047ED33 /* usb */ = { + isa = PBXGroup; + children = ( + 6DBAFE8413B0D4590047ED33 /* IOUFIStorageServices.h */, + 6DBAFE8513B0D4590047ED33 /* IOUSBBus.h */, + 6DBAFE8613B0D4590047ED33 /* IOUSBCommand.h */, + 6DBAFE8713B0D4590047ED33 /* IOUSBCompositeDriver.h */, + 6DBAFE8813B0D4590047ED33 /* IOUSBController.h */, + 6DBAFE8913B0D4590047ED33 /* IOUSBControllerListElement.h */, + 6DBAFE8A13B0D4590047ED33 /* IOUSBControllerV2.h */, + 6DBAFE8B13B0D4590047ED33 /* IOUSBControllerV3.h */, + 6DBAFE8C13B0D4590047ED33 /* IOUSBDevice.h */, + 6DBAFE8D13B0D4590047ED33 /* IOUSBHIDDriver.h */, + 6DBAFE8E13B0D4590047ED33 /* IOUSBHubDevice.h */, + 6DBAFE8F13B0D4590047ED33 /* IOUSBHubPolicyMaker.h */, + 6DBAFE9013B0D4590047ED33 /* IOUSBInterface.h */, + 6DBAFE9113B0D4590047ED33 /* IOUSBLog.h */, + 6DBAFE9213B0D4590047ED33 /* IOUSBMassStorageClass.h */, + 6DBAFE9313B0D4590047ED33 /* IOUSBMassStorageUFISubclass.h */, + 6DBAFE9413B0D4590047ED33 /* IOUSBNub.h */, + 6DBAFE9513B0D4590047ED33 /* IOUSBPipe.h */, + 6DBAFE9613B0D4590047ED33 /* IOUSBRootHubDevice.h */, + 6DBAFE9713B0D4590047ED33 /* IOUSBUserClient.h */, + 6DBAFE9813B0D4590047ED33 /* IOUSBWorkLoop.h */, + 6DBAFE9913B0D4590047ED33 /* USB.h */, + 6DBAFE9A13B0D4590047ED33 /* USBHub.h */, + 6DBAFE9B13B0D4590047ED33 /* USBSpec.h */, + 6DBAFE9C13B0D4590047ED33 /* USBTracepoints.h */, + ); + path = usb; + sourceTree = ""; + }; + 6DBAFE9D13B0D4590047ED33 /* libkern */ = { + isa = PBXGroup; + children = ( + 6DBAFE9E13B0D4590047ED33 /* _OSByteOrder.h */, + 6DBAFE9F13B0D4590047ED33 /* crypto */, + 6DBAFEA213B0D4590047ED33 /* i386 */, + 6DBAFEA513B0D4590047ED33 /* machine */, + 6DBAFEA713B0D4590047ED33 /* OSAtomic.h */, + 6DBAFEA813B0D4590047ED33 /* OSByteOrder.h */, + 6DBAFEA913B0D4590047ED33 /* OSCacheControl.h */, + 6DBAFEAA13B0D4590047ED33 /* OSDebug.h */, + 6DBAFEAB13B0D4590047ED33 /* OSKextLib.h */, + 6DBAFEAC13B0D4590047ED33 /* OSReturn.h */, + 6DBAFEAD13B0D4590047ED33 /* OSTypes.h */, + 6DBAFEAE13B0D4590047ED33 /* ppc */, + ); + path = libkern; + sourceTree = ""; + }; + 6DBAFE9F13B0D4590047ED33 /* crypto */ = { + isa = PBXGroup; + children = ( + 6DBAFEA013B0D4590047ED33 /* md5.h */, + 6DBAFEA113B0D4590047ED33 /* sha1.h */, + ); + path = crypto; + sourceTree = ""; + }; + 6DBAFEA213B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFEA313B0D4590047ED33 /* _OSByteOrder.h */, + 6DBAFEA413B0D4590047ED33 /* OSByteOrder.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFEA513B0D4590047ED33 /* machine */ = { + isa = PBXGroup; + children = ( + 6DBAFEA613B0D4590047ED33 /* OSByteOrder.h */, + ); + path = machine; + sourceTree = ""; + }; + 6DBAFEAE13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFEAF13B0D4590047ED33 /* OSByteOrder.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFEB213B0D4590047ED33 /* mach */ = { + isa = PBXGroup; + children = ( + 6DBAFEB313B0D4590047ED33 /* audit_triggers.defs */, + 6DBAFEB413B0D4590047ED33 /* boolean.h */, + 6DBAFEB513B0D4590047ED33 /* bootstrap.h */, + 6DBAFEB613B0D4590047ED33 /* clock.defs */, + 6DBAFEB713B0D4590047ED33 /* clock.h */, + 6DBAFEB813B0D4590047ED33 /* clock_priv.defs */, + 6DBAFEB913B0D4590047ED33 /* clock_priv.h */, + 6DBAFEBA13B0D4590047ED33 /* clock_reply.defs */, + 6DBAFEBB13B0D4590047ED33 /* clock_reply.h */, + 6DBAFEBC13B0D4590047ED33 /* clock_types.defs */, + 6DBAFEBD13B0D4590047ED33 /* clock_types.h */, + 6DBAFEBE13B0D4590047ED33 /* error.h */, + 6DBAFEBF13B0D4590047ED33 /* exc.defs */, + 6DBAFEC013B0D4590047ED33 /* exc.h */, + 6DBAFEC113B0D4590047ED33 /* exception.h */, + 6DBAFEC213B0D4590047ED33 /* exception_types.h */, + 6DBAFEC313B0D4590047ED33 /* host_info.h */, + 6DBAFEC413B0D4590047ED33 /* host_notify.h */, + 6DBAFEC513B0D4590047ED33 /* host_notify_reply.defs */, + 6DBAFEC613B0D4590047ED33 /* host_priv.defs */, + 6DBAFEC713B0D4590047ED33 /* host_priv.h */, + 6DBAFEC813B0D4590047ED33 /* host_reboot.h */, + 6DBAFEC913B0D4590047ED33 /* host_security.defs */, + 6DBAFECA13B0D4590047ED33 /* host_security.h */, + 6DBAFECB13B0D4590047ED33 /* host_special_ports.h */, + 6DBAFECC13B0D4590047ED33 /* i386 */, + 6DBAFEDE13B0D4590047ED33 /* kern_return.h */, + 6DBAFEDF13B0D4590047ED33 /* kmod.h */, + 6DBAFEE013B0D4590047ED33 /* ledger.defs */, + 6DBAFEE113B0D4590047ED33 /* ledger.h */, + 6DBAFEE213B0D4590047ED33 /* lock_set.defs */, + 6DBAFEE313B0D4590047ED33 /* lock_set.h */, + 6DBAFEE413B0D4590047ED33 /* mach.h */, + 6DBAFEE513B0D4590047ED33 /* mach_error.h */, + 6DBAFEE613B0D4590047ED33 /* mach_exc.defs */, + 6DBAFEE713B0D4590047ED33 /* mach_host.defs */, + 6DBAFEE813B0D4590047ED33 /* mach_host.h */, + 6DBAFEE913B0D4590047ED33 /* mach_init.h */, + 6DBAFEEA13B0D4590047ED33 /* mach_interface.h */, + 6DBAFEEB13B0D4590047ED33 /* mach_param.h */, + 6DBAFEEC13B0D4590047ED33 /* mach_port.defs */, + 6DBAFEED13B0D4590047ED33 /* mach_port.h */, + 6DBAFEEE13B0D4590047ED33 /* mach_syscalls.h */, + 6DBAFEEF13B0D4590047ED33 /* mach_time.h */, + 6DBAFEF013B0D4590047ED33 /* mach_traps.h */, + 6DBAFEF113B0D4590047ED33 /* mach_types.defs */, + 6DBAFEF213B0D4590047ED33 /* mach_types.h */, + 6DBAFEF313B0D4590047ED33 /* mach_vm.defs */, + 6DBAFEF413B0D4590047ED33 /* mach_vm.h */, + 6DBAFEF513B0D4590047ED33 /* machine */, + 6DBAFF0413B0D4590047ED33 /* machine.h */, + 6DBAFF0513B0D4590047ED33 /* memory_object_types.h */, + 6DBAFF0613B0D4590047ED33 /* message.h */, + 6DBAFF0713B0D4590047ED33 /* mig.h */, + 6DBAFF0813B0D4590047ED33 /* mig_errors.h */, + 6DBAFF0913B0D4590047ED33 /* ndr.h */, + 6DBAFF0A13B0D4590047ED33 /* notify.defs */, + 6DBAFF0B13B0D4590047ED33 /* notify.h */, + 6DBAFF0C13B0D4590047ED33 /* policy.h */, + 6DBAFF0D13B0D4590047ED33 /* port.h */, + 6DBAFF0E13B0D4590047ED33 /* port_obj.h */, + 6DBAFF0F13B0D4590047ED33 /* ppc */, + 6DBAFF2013B0D4590047ED33 /* processor.defs */, + 6DBAFF2113B0D4590047ED33 /* processor.h */, + 6DBAFF2213B0D4590047ED33 /* processor_info.h */, + 6DBAFF2313B0D4590047ED33 /* processor_set.defs */, + 6DBAFF2413B0D4590047ED33 /* processor_set.h */, + 6DBAFF2513B0D4590047ED33 /* rpc.h */, + 6DBAFF2613B0D4590047ED33 /* sdt.h */, + 6DBAFF2713B0D4590047ED33 /* security.defs */, + 6DBAFF2813B0D4590047ED33 /* semaphore.h */, + 6DBAFF2913B0D4590047ED33 /* shared_memory_server.h */, + 6DBAFF2A13B0D4590047ED33 /* shared_region.h */, + 6DBAFF2B13B0D4590047ED33 /* std_types.defs */, + 6DBAFF2C13B0D4590047ED33 /* std_types.h */, + 6DBAFF2D13B0D4590047ED33 /* sync.h */, + 6DBAFF2E13B0D4590047ED33 /* sync_policy.h */, + 6DBAFF2F13B0D4590047ED33 /* task.defs */, + 6DBAFF3013B0D4590047ED33 /* task.h */, + 6DBAFF3113B0D4590047ED33 /* task_access.defs */, + 6DBAFF3213B0D4590047ED33 /* task_info.h */, + 6DBAFF3313B0D4590047ED33 /* task_ledger.h */, + 6DBAFF3413B0D4590047ED33 /* task_policy.h */, + 6DBAFF3513B0D4590047ED33 /* task_special_ports.h */, + 6DBAFF3613B0D4590047ED33 /* thread_act.defs */, + 6DBAFF3713B0D4590047ED33 /* thread_act.h */, + 6DBAFF3813B0D4590047ED33 /* thread_info.h */, + 6DBAFF3913B0D4590047ED33 /* thread_policy.h */, + 6DBAFF3A13B0D4590047ED33 /* thread_special_ports.h */, + 6DBAFF3B13B0D4590047ED33 /* thread_status.h */, + 6DBAFF3C13B0D4590047ED33 /* thread_switch.h */, + 6DBAFF3D13B0D4590047ED33 /* time_value.h */, + 6DBAFF3E13B0D4590047ED33 /* vm_attributes.h */, + 6DBAFF3F13B0D4590047ED33 /* vm_behavior.h */, + 6DBAFF4013B0D4590047ED33 /* vm_inherit.h */, + 6DBAFF4113B0D4590047ED33 /* vm_map.defs */, + 6DBAFF4213B0D4590047ED33 /* vm_map.h */, + 6DBAFF4313B0D4590047ED33 /* vm_param.h */, + 6DBAFF4413B0D4590047ED33 /* vm_prot.h */, + 6DBAFF4513B0D4590047ED33 /* vm_purgable.h */, + 6DBAFF4613B0D4590047ED33 /* vm_region.h */, + 6DBAFF4713B0D4590047ED33 /* vm_statistics.h */, + 6DBAFF4813B0D4590047ED33 /* vm_sync.h */, + 6DBAFF4913B0D4590047ED33 /* vm_task.h */, + 6DBAFF4A13B0D4590047ED33 /* vm_types.h */, + 6DBAFF4B13B0D4590047ED33 /* x86_64 */, + ); + path = mach; + sourceTree = ""; + }; + 6DBAFECC13B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFECD13B0D4590047ED33 /* _structs.h */, + 6DBAFECE13B0D4590047ED33 /* asm.h */, + 6DBAFECF13B0D4590047ED33 /* boolean.h */, + 6DBAFED013B0D4590047ED33 /* exception.h */, + 6DBAFED113B0D4590047ED33 /* fp_reg.h */, + 6DBAFED213B0D4590047ED33 /* kern_return.h */, + 6DBAFED313B0D4590047ED33 /* machine_types.defs */, + 6DBAFED413B0D4590047ED33 /* ndr_def.h */, + 6DBAFED513B0D4590047ED33 /* processor_info.h */, + 6DBAFED613B0D4590047ED33 /* rpc.h */, + 6DBAFED713B0D4590047ED33 /* sdt_isa.h */, + 6DBAFED813B0D4590047ED33 /* task.h */, + 6DBAFED913B0D4590047ED33 /* thread_act.h */, + 6DBAFEDA13B0D4590047ED33 /* thread_state.h */, + 6DBAFEDB13B0D4590047ED33 /* thread_status.h */, + 6DBAFEDC13B0D4590047ED33 /* vm_param.h */, + 6DBAFEDD13B0D4590047ED33 /* vm_types.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFEF513B0D4590047ED33 /* machine */ = { + isa = PBXGroup; + children = ( + 6DBAFEF613B0D4590047ED33 /* asm.h */, + 6DBAFEF713B0D4590047ED33 /* boolean.h */, + 6DBAFEF813B0D4590047ED33 /* exception.h */, + 6DBAFEF913B0D4590047ED33 /* kern_return.h */, + 6DBAFEFA13B0D4590047ED33 /* machine_types.defs */, + 6DBAFEFB13B0D4590047ED33 /* ndr_def.h */, + 6DBAFEFC13B0D4590047ED33 /* processor_info.h */, + 6DBAFEFD13B0D4590047ED33 /* rpc.h */, + 6DBAFEFE13B0D4590047ED33 /* sdt.h */, + 6DBAFEFF13B0D4590047ED33 /* sdt_isa.h */, + 6DBAFF0013B0D4590047ED33 /* thread_state.h */, + 6DBAFF0113B0D4590047ED33 /* thread_status.h */, + 6DBAFF0213B0D4590047ED33 /* vm_param.h */, + 6DBAFF0313B0D4590047ED33 /* vm_types.h */, + ); + path = machine; + sourceTree = ""; + }; + 6DBAFF0F13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFF1013B0D4590047ED33 /* _structs.h */, + 6DBAFF1113B0D4590047ED33 /* asm.h */, + 6DBAFF1213B0D4590047ED33 /* boolean.h */, + 6DBAFF1313B0D4590047ED33 /* exception.h */, + 6DBAFF1413B0D4590047ED33 /* kern_return.h */, + 6DBAFF1513B0D4590047ED33 /* machine_types.defs */, + 6DBAFF1613B0D4590047ED33 /* ndr_def.h */, + 6DBAFF1713B0D4590047ED33 /* processor_info.h */, + 6DBAFF1813B0D4590047ED33 /* rpc.h */, + 6DBAFF1913B0D4590047ED33 /* sdt_isa.h */, + 6DBAFF1A13B0D4590047ED33 /* task.h */, + 6DBAFF1B13B0D4590047ED33 /* thread_act.h */, + 6DBAFF1C13B0D4590047ED33 /* thread_state.h */, + 6DBAFF1D13B0D4590047ED33 /* thread_status.h */, + 6DBAFF1E13B0D4590047ED33 /* vm_param.h */, + 6DBAFF1F13B0D4590047ED33 /* vm_types.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFF4B13B0D4590047ED33 /* x86_64 */ = { + isa = PBXGroup; + children = ( + 6DBAFF4C13B0D4590047ED33 /* task.h */, + 6DBAFF4D13B0D4590047ED33 /* thread_act.h */, + ); + path = x86_64; + sourceTree = ""; + }; + 6DBAFF4E13B0D4590047ED33 /* mach-o */ = { + isa = PBXGroup; + children = ( + 6DBAFF4F13B0D4590047ED33 /* arch.h */, + 6DBAFF5013B0D4590047ED33 /* compact_unwind_encoding.h */, + 6DBAFF5113B0D4590047ED33 /* dyld.h */, + 6DBAFF5213B0D4590047ED33 /* dyld_images.h */, + 6DBAFF5313B0D4590047ED33 /* fat.h */, + 6DBAFF5413B0D4590047ED33 /* getsect.h */, + 6DBAFF5513B0D4590047ED33 /* i386 */, + 6DBAFF5713B0D4590047ED33 /* ldsyms.h */, + 6DBAFF5813B0D4590047ED33 /* loader.h */, + 6DBAFF5913B0D4590047ED33 /* nlist.h */, + 6DBAFF5A13B0D4590047ED33 /* ppc */, + 6DBAFF5D13B0D4590047ED33 /* ranlib.h */, + 6DBAFF5E13B0D4590047ED33 /* reloc.h */, + 6DBAFF5F13B0D4590047ED33 /* stab.h */, + 6DBAFF6013B0D4590047ED33 /* swap.h */, + 6DBAFF6113B0D4590047ED33 /* x86_64 */, + ); + path = "mach-o"; + sourceTree = ""; + }; + 6DBAFF5513B0D4590047ED33 /* i386 */ = { + isa = PBXGroup; + children = ( + 6DBAFF5613B0D4590047ED33 /* swap.h */, + ); + path = i386; + sourceTree = ""; + }; + 6DBAFF5A13B0D4590047ED33 /* ppc */ = { + isa = PBXGroup; + children = ( + 6DBAFF5B13B0D4590047ED33 /* reloc.h */, + 6DBAFF5C13B0D4590047ED33 /* swap.h */, + ); + path = ppc; + sourceTree = ""; + }; + 6DBAFF6113B0D4590047ED33 /* x86_64 */ = { + isa = PBXGroup; + children = ( + 6DBAFF6213B0D4590047ED33 /* reloc.h */, + ); + path = x86_64; + sourceTree = ""; + }; + 6DBAFF6313B0D4590047ED33 /* machine */ = { + isa = PBXGroup; + children = ( + 6DBAFF6413B0D4590047ED33 /* _limits.h */, + 6DBAFF6513B0D4590047ED33 /* _param.h */, + 6DBAFF6613B0D4590047ED33 /* _structs.h */, + 6DBAFF6713B0D4590047ED33 /* _types.h */, + 6DBAFF6813B0D4590047ED33 /* byte_order.h */, + 6DBAFF6913B0D4590047ED33 /* endian.h */, + 6DBAFF6A13B0D4590047ED33 /* fasttrap_isa.h */, + 6DBAFF6B13B0D4590047ED33 /* limits.h */, + 6DBAFF6C13B0D4590047ED33 /* param.h */, + 6DBAFF6D13B0D4590047ED33 /* profile.h */, + 6DBAFF6E13B0D4590047ED33 /* setjmp.h */, + 6DBAFF6F13B0D4590047ED33 /* signal.h */, + 6DBAFF7013B0D4590047ED33 /* types.h */, + 6DBAFF7113B0D4590047ED33 /* vmparam.h */, + ); + path = machine; + sourceTree = ""; + }; + 6DBAFF7313B0D4590047ED33 /* netinet */ = { + isa = PBXGroup; + children = ( + 6DBAFF7413B0D4590047ED33 /* bootp.h */, + 6DBAFF7513B0D4590047ED33 /* icmp6.h */, + 6DBAFF7613B0D4590047ED33 /* icmp_var.h */, + 6DBAFF7713B0D4590047ED33 /* if_ether.h */, + 6DBAFF7813B0D4590047ED33 /* igmp.h */, + 6DBAFF7913B0D4590047ED33 /* igmp_var.h */, + 6DBAFF7A13B0D4590047ED33 /* in.h */, + 6DBAFF7B13B0D4590047ED33 /* in_pcb.h */, + 6DBAFF7C13B0D4590047ED33 /* in_systm.h */, + 6DBAFF7D13B0D4590047ED33 /* in_var.h */, + 6DBAFF7E13B0D4590047ED33 /* ip.h */, + 6DBAFF7F13B0D4590047ED33 /* ip6.h */, + 6DBAFF8013B0D4590047ED33 /* ip_fw.h */, + 6DBAFF8113B0D4590047ED33 /* ip_fw2.h */, + 6DBAFF8213B0D4590047ED33 /* ip_icmp.h */, + 6DBAFF8313B0D4590047ED33 /* ip_mroute.h */, + 6DBAFF8413B0D4590047ED33 /* ip_var.h */, + 6DBAFF8513B0D4590047ED33 /* tcp.h */, + 6DBAFF8613B0D4590047ED33 /* tcp_fsm.h */, + 6DBAFF8713B0D4590047ED33 /* tcp_seq.h */, + 6DBAFF8813B0D4590047ED33 /* tcp_timer.h */, + 6DBAFF8913B0D4590047ED33 /* tcp_var.h */, + 6DBAFF8A13B0D4590047ED33 /* tcpip.h */, + 6DBAFF8B13B0D4590047ED33 /* udp.h */, + 6DBAFF8C13B0D4590047ED33 /* udp_var.h */, + ); + path = netinet; + sourceTree = ""; + }; + 6DBAFF8D13B0D4590047ED33 /* netinet6 */ = { + isa = PBXGroup; + children = ( + 6DBAFF8E13B0D4590047ED33 /* ah.h */, + 6DBAFF8F13B0D4590047ED33 /* esp.h */, + 6DBAFF9013B0D4590047ED33 /* in6.h */, + 6DBAFF9113B0D4590047ED33 /* in6_var.h */, + 6DBAFF9213B0D4590047ED33 /* ip6_fw.h */, + 6DBAFF9313B0D4590047ED33 /* ip6_mroute.h */, + 6DBAFF9413B0D4590047ED33 /* ipcomp.h */, + 6DBAFF9513B0D4590047ED33 /* ipsec.h */, + 6DBAFF9613B0D4590047ED33 /* nd6.h */, + 6DBAFF9713B0D4590047ED33 /* pim6.h */, + 6DBAFF9813B0D4590047ED33 /* raw_ip6.h */, + ); + path = netinet6; + sourceTree = ""; + }; + 6DBAFF9A13B0D4590047ED33 /* secure */ = { + isa = PBXGroup; + children = ( + 6DBAFF9B13B0D4590047ED33 /* _common.h */, + 6DBAFF9C13B0D4590047ED33 /* _stdio.h */, + ); + path = secure; + sourceTree = ""; + }; + 6DBAFFA613B0D4590047ED33 /* sys */ = { + isa = PBXGroup; + children = ( + 6DBAFFA713B0D4590047ED33 /* _endian.h */, + 6DBAFFA813B0D4590047ED33 /* _select.h */, + 6DBAFFA913B0D4590047ED33 /* _structs.h */, + 6DBAFFAA13B0D4590047ED33 /* _types.h */, + 6DBAFFAB13B0D4590047ED33 /* appleapiopts.h */, + 6DBAFFAC13B0D4590047ED33 /* buf.h */, + 6DBAFFAD13B0D4590047ED33 /* cdefs.h */, + 6DBAFFAE13B0D4590047ED33 /* disk.h */, + 6DBAFFAF13B0D4590047ED33 /* kernel_types.h */, + 6DBAFFB013B0D4590047ED33 /* param.h */, + 6DBAFFB113B0D4590047ED33 /* reboot.h */, + 6DBAFFB213B0D4590047ED33 /* select.h */, + 6DBAFFB313B0D4590047ED33 /* socket.h */, + 6DBAFFB413B0D4590047ED33 /* syscall.h */, + 6DBAFFB513B0D4590047ED33 /* syslimits.h */, + 6DBAFFB613B0D4590047ED33 /* time.h */, + 6DBAFFB713B0D4590047ED33 /* types.h */, + 6DBAFFB813B0D4590047ED33 /* unistd.h */, + ); + path = sys; + sourceTree = ""; + }; + 6DBAFFBA13B0D4590047ED33 /* ufs */ = { + isa = PBXGroup; + children = ( + 6DBAFFBB13B0D4590047ED33 /* ffs */, + 6DBAFFBE13B0D4590047ED33 /* ufs */, + ); + path = ufs; + sourceTree = ""; + }; + 6DBAFFBB13B0D4590047ED33 /* ffs */ = { + isa = PBXGroup; + children = ( + 6DBAFFBC13B0D4590047ED33 /* ffs_extern.h */, + 6DBAFFBD13B0D4590047ED33 /* fs.h */, + ); + path = ffs; + sourceTree = ""; + }; + 6DBAFFBE13B0D4590047ED33 /* ufs */ = { + isa = PBXGroup; + children = ( + 6DBAFFBF13B0D4590047ED33 /* dinode.h */, + 6DBAFFC013B0D4590047ED33 /* dir.h */, + 6DBAFFC113B0D4590047ED33 /* inode.h */, + 6DBAFFC213B0D4590047ED33 /* ufs_extern.h */, + 6DBAFFC313B0D4590047ED33 /* ufsmount.h */, + ); + path = ufs; + sourceTree = ""; + }; + A354B6261495124F00D81AA5 /* Main */ = { + isa = PBXGroup; + children = ( + A354B6271495124F00D81AA5 /* ESPpostinstall */, + A354B62A1495124F00D81AA5 /* Standardpostinstall */, + ); + path = Main; + sourceTree = ""; + }; + A354B62B149514DE00D81AA5 /* Sub */ = { + isa = PBXGroup; + children = ( + A354B62C149514DE00D81AA5 /* CheckDiskMicrocode.sh */, + A354B62D149514DE00D81AA5 /* CheckFatType.sh */, + A354B62E149514DE00D81AA5 /* CheckGRUBLinuxLoader.sh */, + A354B62F149514DE00D81AA5 /* CheckPartitionScheme.sh */, + A354B630149514DE00D81AA5 /* CheckPreviousChameleon.sh */, + A354B631149514DE00D81AA5 /* CheckProceed.sh */, + A354B632149514DE00D81AA5 /* CheckWindowsDiskSignature.sh */, + A354B634149514DE00D81AA5 /* MountESP.sh */, + A354B635149514DE00D81AA5 /* patch */, + A354B636149514DE00D81AA5 /* SetActivePartition.sh */, + A354B637149514DE00D81AA5 /* UnMountEFIvolumes.sh */, + A354B638149514DE00D81AA5 /* WriteChameleonStage0.sh */, + A354B639149514DE00D81AA5 /* WriteChameleonStage1.sh */, + A354B63A149514DE00D81AA5 /* WriteChameleonStage2.sh */, + ); + path = Sub; + sourceTree = ""; + }; + A3561C721413FD7800E9B51E /* fdisk */ = { + isa = PBXGroup; + children = ( + A3561C731413FD7800E9B51E /* auto.c */, + A3561C741413FD7800E9B51E /* auto.h */, + A3561C751413FD7800E9B51E /* Cconfig */, + A3561C761413FD7800E9B51E /* cmd.c */, + A3561C771413FD7800E9B51E /* cmd.h */, + A3561C781413FD7800E9B51E /* disk.c */, + A3561C791413FD7800E9B51E /* disk.h */, + A3561C7A1413FD7800E9B51E /* fdisk.8 */, + A3561C7B1413FD7800E9B51E /* fdisk.c */, + A3561C7C1413FD7800E9B51E /* getrawpartition.c */, + A3561C7D1413FD7800E9B51E /* Makefile */, + A3561C7E1413FD7800E9B51E /* mbr.c */, + A3561C7F1413FD7800E9B51E /* mbr.h */, + A3561C801413FD7800E9B51E /* mbrcode.h */, + A3561C811413FD7800E9B51E /* misc.c */, + A3561C821413FD7800E9B51E /* misc.h */, + A3561C831413FD7800E9B51E /* opendev.c */, + A3561C841413FD7800E9B51E /* part.c */, + A3561C851413FD7800E9B51E /* part.h */, + A3561C861413FD7800E9B51E /* user.c */, + A3561C871413FD7800E9B51E /* user.h */, + A3561C881413FD7800E9B51E /* util.h */, + ); + path = fdisk; + sourceTree = ""; + }; + A3561CAB1414024C00E9B51E /* modules */ = { + isa = PBXGroup; + children = ( + AB4DDA8C15CEFF2100E77157 /* AcpiCodec */, + A3561CAC1414024C00E9B51E /* Cconfig */, + A3561CAD1414024C00E9B51E /* HelloWorld */, + A3561CB21414024C00E9B51E /* include */, + A3561CB41414024C00E9B51E /* Keylayout */, + A3561CB71414024D00E9B51E /* klibc */, + A3561D011414024D00E9B51E /* Makefile */, + A3561D021414024D00E9B51E /* MakeInc.dir */, + A3561D031414024D00E9B51E /* Modules.txt */, + A3561D041414024D00E9B51E /* Resolution */, + AB1DE71715B6E2D00088E06B /* Sata */, + A3561D0F1414024D00E9B51E /* uClibcxx */, + ); + path = modules; + sourceTree = ""; + }; + A3561CAD1414024C00E9B51E /* HelloWorld */ = { + isa = PBXGroup; + children = ( + A3561CAE1414024C00E9B51E /* Cconfig */, + A3561CAF1414024C00E9B51E /* HelloWorld.cpp */, + A3561CB01414024C00E9B51E /* include */, + A3561CB11414024C00E9B51E /* Makefile */, + ); + path = HelloWorld; + sourceTree = ""; + }; + A3561CB01414024C00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + ); + path = include; + sourceTree = ""; + }; + A3561CB21414024C00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + A3561CB31414024C00E9B51E /* modules */, + ); + path = include; + sourceTree = ""; + }; + A3561CB41414024C00E9B51E /* Keylayout */ = { + isa = PBXGroup; + children = ( + A3F1F267141B9B3B00DDA709 /* Readme.txt */, + A35D216E141A73B000969AC0 /* layouts */, + A3561DA81414296600E9B51E /* Cconfig */, + A3561DA61414296600E9B51E /* Keylayout.c */, + A3561DA71414296600E9B51E /* Makefile */, + ); + path = Keylayout; + sourceTree = ""; + }; + A3561CB71414024D00E9B51E /* klibc */ = { + isa = PBXGroup; + children = ( + A3561CB81414024D00E9B51E /* __ashldi3.c */, + A3561CB91414024D00E9B51E /* __ashrdi3.c */, + A3561CBA1414024D00E9B51E /* __clzsi2.c */, + A3561CBB1414024D00E9B51E /* __divdi3.c */, + A3561CBC1414024D00E9B51E /* __divsi3.c */, + A3561CBD1414024D00E9B51E /* __lshrdi3.c */, + A3561CBE1414024D00E9B51E /* __moddi3.c */, + A3561CBF1414024D00E9B51E /* __modsi3.c */, + A3561CC01414024D00E9B51E /* __udivdi3.c */, + A3561CC11414024D00E9B51E /* __udivmoddi4.c */, + A3561CC21414024D00E9B51E /* __udivmodsi4.c */, + A3561CC31414024D00E9B51E /* __udivsi3.c */, + A3561CC41414024D00E9B51E /* __umoddi3.c */, + A3561CC51414024D00E9B51E /* __umodsi3.c */, + A3561CC61414024D00E9B51E /* atexit.c */, + A3561CC71414024D00E9B51E /* atexit.h */, + A3561CC81414024D00E9B51E /* atoi.c */, + A3561CC91414024D00E9B51E /* atol.c */, + A3561CCA1414024D00E9B51E /* atoll.c */, + A3561CCB1414024D00E9B51E /* atox.c */, + A3561CCC1414024D00E9B51E /* bsearch.c */, + A3561CCD1414024D00E9B51E /* calloc.c */, + A3561CCE1414024D00E9B51E /* Cconfig */, + A3561CCF1414024D00E9B51E /* exit.c */, + A3561CD01414024D00E9B51E /* jrand48.c */, + A3561CD11414024D00E9B51E /* klibc.c */, + A3561CD21414024D00E9B51E /* LICENSE */, + A3561CD31414024D00E9B51E /* limits.h */, + A3561CD41414024D00E9B51E /* lrand48.c */, + A3561CD51414024D00E9B51E /* Makefile */, + A3561CD61414024D00E9B51E /* memccpy.c */, + A3561CD71414024D00E9B51E /* memchr.c */, + A3561CD81414024D00E9B51E /* memmem.c */, + A3561CD91414024D00E9B51E /* memmove.c */, + A3561CDA1414024D00E9B51E /* memrchr.c */, + A3561CDB1414024D00E9B51E /* memswap.c */, + A3561CDC1414024D00E9B51E /* mrand48.c */, + A3561CDD1414024D00E9B51E /* nrand48.c */, + A3561CDE1414024D00E9B51E /* onexit.c */, + A3561CDF1414024D00E9B51E /* qsort.c */, + A3561CE01414024D00E9B51E /* Readme.txt */, + A3561CE11414024D00E9B51E /* seed48.c */, + A3561CE21414024D00E9B51E /* sha1hash.c */, + A3561CE31414024D00E9B51E /* snprintf.c */, + A3561CE41414024D00E9B51E /* srand48.c */, + A3561CE51414024D00E9B51E /* sscanf.c */, + A3561CE61414024D00E9B51E /* strcasecmp.c */, + A3561CE71414024D00E9B51E /* strdup.c */, + A3561CE81414024D00E9B51E /* strlcat.c */, + A3561CE91414024D00E9B51E /* strncasecmp.c */, + A3561CEA1414024D00E9B51E /* strndup.c */, + A3561CEB1414024D00E9B51E /* strnlen.c */, + A3561CEC1414024D00E9B51E /* strntoimax.c */, + A3561CED1414024D00E9B51E /* strntoumax.c */, + A3561CEE1414024D00E9B51E /* strpbrk.c */, + A3561CEF1414024D00E9B51E /* strsep.c */, + A3561CF01414024D00E9B51E /* strtoimax.c */, + A3561CF11414024D00E9B51E /* strtok.c */, + A3561CF21414024D00E9B51E /* strtok_r.c */, + A3561CF31414024D00E9B51E /* strtol.c */, + A3561CF41414024D00E9B51E /* strtoll.c */, + A3561CF51414024D00E9B51E /* strtotimespec.c */, + A3561CF61414024D00E9B51E /* strtotimeval.c */, + A3561CF71414024D00E9B51E /* strtotimex.c */, + A3561CF81414024D00E9B51E /* strtoul.c */, + A3561CF91414024D00E9B51E /* strtoull.c */, + A3561CFA1414024D00E9B51E /* strtoumax.c */, + A3561CFB1414024D00E9B51E /* strtox.c */, + A3561CFC1414024D00E9B51E /* strxspn.c */, + A3561CFD1414024D00E9B51E /* strxspn.h */, + A3561CFE1414024D00E9B51E /* version */, + A3561CFF1414024D00E9B51E /* vsnprintf.c */, + A3561D001414024D00E9B51E /* vsscanf.c */, + ); + path = klibc; + sourceTree = ""; + }; + A3561D041414024D00E9B51E /* Resolution */ = { + isa = PBXGroup; + children = ( + A3561D051414024D00E9B51E /* 915resolution.c */, + A3561D061414024D00E9B51E /* 915resolution.h */, + A3561D071414024D00E9B51E /* Cconfig */, + A3561D081414024D00E9B51E /* edid.c */, + A3561D091414024D00E9B51E /* include */, + A3561D0B1414024D00E9B51E /* Makefile */, + A3561D0C1414024D00E9B51E /* Readme.txt */, + A3561D0D1414024D00E9B51E /* Resolution.c */, + A3561D0E1414024D00E9B51E /* shortatombios.h */, + ); + path = Resolution; + sourceTree = ""; + }; + A3561D091414024D00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + A3561D0A1414024D00E9B51E /* edid.h */, + ); + path = include; + sourceTree = ""; + }; + A3561D0F1414024D00E9B51E /* uClibcxx */ = { + isa = PBXGroup; + children = ( + A3561D101414024D00E9B51E /* abi.cpp */, + A3561D111414024D00E9B51E /* algorithm.cpp */, + A3561D121414024D00E9B51E /* associative_base.cpp */, + A3561D131414024D00E9B51E /* bitset.cpp */, + A3561D141414024D00E9B51E /* Cconfig */, + A3561D151414024D00E9B51E /* char_traits.cpp */, + A3561D161414024D00E9B51E /* complex.cpp */, + A3561D171414024D00E9B51E /* del_op.cpp */, + A3561D181414024D00E9B51E /* del_opnt.cpp */, + A3561D191414024D00E9B51E /* del_opv.cpp */, + A3561D1A1414024D00E9B51E /* del_opvnt.cpp */, + A3561D1B1414024D00E9B51E /* deque.cpp */, + A3561D1C1414024D00E9B51E /* eh_alloc.cpp */, + A3561D1D1414024D00E9B51E /* eh_globals.cpp */, + A3561D1E1414024D00E9B51E /* exception.cpp */, + A3561D1F1414024D00E9B51E /* fstream.cpp */, + A3561D201414024D00E9B51E /* func_exception.cpp */, + A3561D211414024D00E9B51E /* include */, + A3561D631414024D00E9B51E /* iomanip.cpp */, + A3561D641414024D00E9B51E /* ios.cpp */, + A3561D651414024D00E9B51E /* iostream.cpp */, + A3561D661414024D00E9B51E /* istream.cpp */, + A3561D671414024D00E9B51E /* iterator.cpp */, + A3561D681414024D00E9B51E /* limits.cpp */, + A3561D691414024D00E9B51E /* list.cpp */, + A3561D6A1414024D00E9B51E /* locale.cpp */, + A3561D6B1414024D00E9B51E /* Makefile */, + A3561D6C1414024D00E9B51E /* map.cpp */, + A3561D6D1414024D00E9B51E /* new_handler.cpp */, + A3561D6E1414024D00E9B51E /* new_op.cpp */, + A3561D6F1414024D00E9B51E /* new_opnt.cpp */, + A3561D701414024D00E9B51E /* new_opv.cpp */, + A3561D711414024D00E9B51E /* new_opvnt.cpp */, + A3561D721414024D00E9B51E /* numeric.cpp */, + A3561D731414024D00E9B51E /* ostream.cpp */, + A3561D741414024D00E9B51E /* queue.cpp */, + A3561D751414024D00E9B51E /* Readme.txt */, + A3561D761414024D00E9B51E /* set.cpp */, + A3561D771414024D00E9B51E /* sstream.cpp */, + A3561D781414024D00E9B51E /* stack.cpp */, + A3561D791414024D00E9B51E /* stdexcept.cpp */, + A3561D7A1414024D00E9B51E /* streambuf.cpp */, + A3561D7B1414024D00E9B51E /* string.cpp */, + A3561D7C1414024D00E9B51E /* support.cpp */, + A3561D7D1414024D00E9B51E /* typeinfo.cpp */, + A3561D7E1414024D00E9B51E /* uClibc++.c */, + A3561D7F1414024D00E9B51E /* utility.cpp */, + A3561D801414024D00E9B51E /* valarray.cpp */, + A3561D811414024D00E9B51E /* vector.cpp */, + ); + path = uClibcxx; + sourceTree = ""; + }; + A3561D211414024D00E9B51E /* include */ = { + isa = PBXGroup; + children = ( + A3561D221414024D00E9B51E /* algorithm */, + A3561D231414024D00E9B51E /* associative_base */, + A3561D241414024D00E9B51E /* basic_definitions */, + A3561D251414024D00E9B51E /* bitset */, + A3561D261414024D00E9B51E /* cassert */, + A3561D271414024D00E9B51E /* cctype */, + A3561D281414024D00E9B51E /* cerrno */, + A3561D291414024D00E9B51E /* cfloat */, + A3561D2A1414024D00E9B51E /* char_traits */, + A3561D2B1414024D00E9B51E /* climits */, + A3561D2C1414024D00E9B51E /* clocale */, + A3561D2D1414024D00E9B51E /* cmath */, + A3561D2E1414024D00E9B51E /* complex */, + A3561D2F1414024D00E9B51E /* csetjmp */, + A3561D301414024D00E9B51E /* csignal */, + A3561D311414024D00E9B51E /* cstdarg */, + A3561D321414024D00E9B51E /* cstddef */, + A3561D331414024D00E9B51E /* cstdio */, + A3561D341414024D00E9B51E /* cstdlib */, + A3561D351414024D00E9B51E /* cstring */, + A3561D361414024D00E9B51E /* ctime */, + A3561D371414024D00E9B51E /* cwchar */, + A3561D381414024D00E9B51E /* cwctype */, + A3561D391414024D00E9B51E /* deque */, + A3561D3A1414024D00E9B51E /* exception */, + A3561D3B1414024D00E9B51E /* fstream */, + A3561D3C1414024D00E9B51E /* func_exception */, + A3561D3D1414024D00E9B51E /* functional */, + A3561D3E1414024D00E9B51E /* iomanip */, + A3561D3F1414024D00E9B51E /* ios */, + A3561D401414024D00E9B51E /* iosfwd */, + A3561D411414024D00E9B51E /* iostream */, + A3561D421414024D00E9B51E /* istream */, + A3561D431414024D00E9B51E /* istream_helpers */, + A3561D441414024D00E9B51E /* iterator */, + A3561D451414024D00E9B51E /* iterator_base */, + A3561D461414024D00E9B51E /* limits */, + A3561D471414024D00E9B51E /* list */, + A3561D481414024D00E9B51E /* locale */, + A3561D491414024D00E9B51E /* Makefile */, + A3561D4A1414024D00E9B51E /* map */, + A3561D4B1414024D00E9B51E /* map.old */, + A3561D4C1414024D00E9B51E /* memory */, + A3561D4D1414024D00E9B51E /* new */, + A3561D4E1414024D00E9B51E /* numeric */, + A3561D4F1414024D00E9B51E /* ostream */, + A3561D501414024D00E9B51E /* ostream_helpers */, + A3561D511414024D00E9B51E /* queue */, + A3561D521414024D00E9B51E /* set */, + A3561D531414024D00E9B51E /* set.old */, + A3561D541414024D00E9B51E /* sstream */, + A3561D551414024D00E9B51E /* stack */, + A3561D561414024D00E9B51E /* stdexcept */, + A3561D571414024D00E9B51E /* streambuf */, + A3561D581414024D00E9B51E /* string */, + A3561D591414024D00E9B51E /* string_iostream */, + A3561D5A1414024D00E9B51E /* support */, + A3561D5B1414024D00E9B51E /* system_configuration.h */, + A3561D5C1414024D00E9B51E /* type_traits */, + A3561D5D1414024D00E9B51E /* typeinfo */, + A3561D5E1414024D00E9B51E /* types */, + A3561D5F1414024D00E9B51E /* unwind-cxx.h */, + A3561D601414024D00E9B51E /* utility */, + A3561D611414024D00E9B51E /* valarray */, + A3561D621414024D00E9B51E /* vector */, + ); + path = include; + sourceTree = ""; + }; + A35D216E141A73B000969AC0 /* layouts */ = { + isa = PBXGroup; + children = ( + A35D216F141A73B000969AC0 /* cham-mklayout.c */, + A35D2170141A73B000969AC0 /* layouts-src */, + A35D2177141A73B000969AC0 /* Makefile */, + ); + path = layouts; + sourceTree = ""; + }; + A35D2170141A73B000969AC0 /* layouts-src */ = { + isa = PBXGroup; + children = ( + A35D2178141A753E00969AC0 /* README */, + A35D2171141A73B000969AC0 /* mac-de.slt */, + A35D2172141A73B000969AC0 /* mac-es.slt */, + A35D2173141A73B000969AC0 /* mac-fr.slt */, + A35D2174141A73B000969AC0 /* mac-it.slt */, + A35D2175141A73B000969AC0 /* mac-se.slt */, + A35D2176141A73B000969AC0 /* pc-fr.slt */, + ); + path = "layouts-src"; + sourceTree = ""; + }; + A396E2CA150247630025A245 /* Resources */ = { + isa = PBXGroup; + children = ( + A396E2CB150247630025A245 /* common */, + A396E2CD150247630025A245 /* distribution */, + A396E2CF150247630025A245 /* templates */, + ); + path = Resources; + sourceTree = ""; + }; + A396E2CB150247630025A245 /* common */ = { + isa = PBXGroup; + children = ( + A396E2CC150247630025A245 /* License.rtf */, + ); + path = common; + sourceTree = ""; + }; + A396E2CD150247630025A245 /* distribution */ = { + isa = PBXGroup; + children = ( + A396E2CE150247630025A245 /* background.tiff */, + ); + path = distribution; + sourceTree = ""; + }; + A396E2CF150247630025A245 /* templates */ = { + isa = PBXGroup; + children = ( + A396E35915028C9C0025A245 /* Welcome.html */, + A396E2D1150247630025A245 /* Description.html */, + A396E5821502D3320025A245 /* Conclusion.html */, + A396E2D2150247630025A245 /* Localizable.strings */, + ); + path = templates; + sourceTree = ""; + }; + A396E4F31502D0580025A245 /* Resources.old */ = { + isa = PBXGroup; + children = ( + A396E4F41502D0580025A245 /* Conclusion.rtfd */, + A396E4F61502D0580025A245 /* Description.html */, + A396E4F81502D0580025A245 /* License.rtf */, + A396E4FA1502D0580025A245 /* Localizable.strings */, + A396E4FC1502D0580025A245 /* Welcome.rtfd */, + A396E4FE1502D0580025A245 /* background.tiff */, + ); + path = Resources.old; + sourceTree = ""; + }; + A3F1F20D141B9B0D00DDA709 /* Scripts */ = { + isa = PBXGroup; + children = ( + A354B6261495124F00D81AA5 /* Main */, + A354B62B149514DE00D81AA5 /* Sub */, + ); + path = Scripts; + sourceTree = ""; + }; + AB1DE71715B6E2D00088E06B /* Sata */ = { + isa = PBXGroup; + children = ( + AB1DE71815B6E2D00088E06B /* Cconfig */, + AB1DE71915B6E2D00088E06B /* include */, + AB1DE71A15B6E2D00088E06B /* Makefile */, + AB1DE71B15B6E2D00088E06B /* Sata.c */, + ); + path = Sata; + sourceTree = ""; + }; + AB1DE71915B6E2D00088E06B /* include */ = { + isa = PBXGroup; + children = ( + ); + path = include; + sourceTree = ""; + }; + AB30C92D15DE60ED0047BE7B /* bin */ = { + isa = PBXGroup; + children = ( + AB30C92E15DE60ED0047BE7B /* ld_classic */, + AB30C92F15DE60ED0047BE7B /* ld_classic.1 */, + ); + path = bin; + sourceTree = ""; + }; + AB30C93115DE66D90047BE7B /* md */ = { + isa = PBXGroup; + children = ( + AB30C93215DE66D90047BE7B /* Cconfig */, + AB30C93315DE66D90047BE7B /* Makefile */, + AB30C93415DE66D90047BE7B /* md.1 */, + AB30C93515DE66D90047BE7B /* md.c */, + ); + path = md; + sourceTree = ""; + }; + AB4DDA8C15CEFF2100E77157 /* AcpiCodec */ = { + isa = PBXGroup; + children = ( + AB4DDA8D15CEFF2100E77157 /* acpi_codec.c */, + AB4DDA8E15CEFF2100E77157 /* acpi_tools.c */, + AB4DDA8F15CEFF2100E77157 /* acpicode.c */, + AB4DDA9015CEFF2100E77157 /* ACPICodec.c */, + AB4DDA9115CEFF2100E77157 /* acpidecode.c */, + AB4DDA9215CEFF2100E77157 /* Cconfig */, + AB4DDA9315CEFF2100E77157 /* include */, + AB4DDA9D15CEFF2100E77157 /* Makefile */, + AB4DDA9E15CEFF2100E77157 /* Readme.txt */, + ); + path = AcpiCodec; + sourceTree = ""; + }; + AB4DDA9315CEFF2100E77157 /* include */ = { + isa = PBXGroup; + children = ( + AB4DDA9415CEFF2100E77157 /* acpi.h */, + AB4DDA9515CEFF2100E77157 /* acpi_codec.h */, + AB4DDA9615CEFF2100E77157 /* acpi_tools.h */, + AB4DDA9715CEFF2100E77157 /* acpicode.h */, + AB4DDA9815CEFF2100E77157 /* acpidecode.h */, + AB4DDA9915CEFF2100E77157 /* datatype.h */, + AB4DDA9A15CEFF2100E77157 /* intel_acpi.h */, + AB4DDA9B15CEFF2100E77157 /* ppm.h */, + AB4DDA9C15CEFF2100E77157 /* ppmsetup.h */, + ); + path = include; + sourceTree = ""; + }; + B0056CE511F3868000754B65 /* i386 */ = { + isa = PBXGroup; + children = ( + B0056CE611F3868000754B65 /* boot0 */, + B0056CEA11F3868000754B65 /* boot1 */, + B0056CF211F3868000754B65 /* boot2 */, + B41899FB14BFBE2400ED5B0B /* Cconfig */, + B0056D0F11F3868000754B65 /* cdboot */, + B4189A0314BFBED900ED5B0B /* config */, + B0056D1311F3868000754B65 /* doc */, + 6DBAFD1713B0D4590047ED33 /* include */, + B0056D1611F3868000754B65 /* libsa */, + B0056D2411F3868000754B65 /* libsaio */, + B0056D7611F3868000754B65 /* Makefile */, + AB30C93115DE66D90047BE7B /* md */, + A3561CAB1414024C00E9B51E /* modules */, + B0056D7911F3868000754B65 /* util */, + ); + path = i386; + sourceTree = ""; + }; + B0056CE611F3868000754B65 /* boot0 */ = { + isa = PBXGroup; + children = ( + B0056CE711F3868000754B65 /* boot0.s */, + B41899FF14BFBE5D00ED5B0B /* boot0hfs.s */, + B41899FE14BFBE5200ED5B0B /* boot0md.s */, + B41899FD14BFBE4500ED5B0B /* Cconfig */, + B0056CE811F3868000754B65 /* chain0.s */, + B0056CE911F3868000754B65 /* Makefile */, + ); + path = boot0; + sourceTree = ""; + }; + B0056CEA11F3868000754B65 /* boot1 */ = { + isa = PBXGroup; + children = ( + B0056CED11F3868000754B65 /* boot1f32-install.sh */, + B0056CEE11F3868000754B65 /* boot1f32.s */, + B4189A0114BFBE8900ED5B0B /* boot1h.s */, + B0056CEF11F3868000754B65 /* boot1he.s */, + B0056CF011F3868000754B65 /* boot1hp.s */, + B4189A0014BFBE7D00ED5B0B /* Cconfig */, + B0056CF111F3868000754B65 /* Makefile */, + ); + path = boot1; + sourceTree = ""; + }; + B0056CF211F3868000754B65 /* boot2 */ = { + isa = PBXGroup; + children = ( + B0056CF311F3868000754B65 /* appleboot.h */, + B0056CF411F3868000754B65 /* appleClut8.h */, + B0056CF511F3868000754B65 /* bmdecompress.c */, + B0056CF611F3868000754B65 /* boot.c */, + B0056CF711F3868000754B65 /* boot.h */, + B0056CF811F3868000754B65 /* boot2.s */, + B4189A0214BFBE9E00ED5B0B /* Cconfig */, + B0056CF911F3868000754B65 /* drivers.c */, + B0056CFA11F3868000754B65 /* graphic_utils.c */, + B0056CFB11F3868000754B65 /* graphic_utils.h */, + B0056CFC11F3868000754B65 /* graphics.c */, + B0056CFD11F3868000754B65 /* graphics.h */, + B0056CFE11F3868000754B65 /* gui.c */, + 6DBAFD1313B0D21E0047ED33 /* modules_support.s */, + 6DBAFD1413B0D21E0047ED33 /* modules.c */, + 6DBAFD1513B0D21E0047ED33 /* modules.h */, + B0056CFF11F3868000754B65 /* gui.h */, + B0056D0011F3868000754B65 /* IOHibernatePrivate.h */, + B0056D0111F3868000754B65 /* lzss.c */, + B0056D0211F3868000754B65 /* Makefile */, + B0056D0311F3868000754B65 /* mboot.c */, + B0056D0411F3868000754B65 /* mboot.h */, + B0056D0511F3868000754B65 /* multiboot.h */, + B0056D0611F3868000754B65 /* options.c */, + B0056D0711F3868000754B65 /* picopng.c */, + B0056D0811F3868000754B65 /* picopng.h */, + B0056D0911F3868000754B65 /* prompt.c */, + B0056D0A11F3868000754B65 /* ramdisk.c */, + B0056D0B11F3868000754B65 /* ramdisk.h */, + B0056D0C11F3868000754B65 /* resume.c */, + B0056D0D11F3868000754B65 /* WKdm.h */, + B0056D0E11F3868000754B65 /* WKdmDecompress.c */, + ); + path = boot2; + sourceTree = ""; + }; + B0056D0F11F3868000754B65 /* cdboot */ = { + isa = PBXGroup; + children = ( + B0056D1011F3868000754B65 /* cdboot.s */, + B0056D1111F3868000754B65 /* cdboothdd.s */, + B0056D1211F3868000754B65 /* Makefile */, + ); + path = cdboot; + sourceTree = ""; + }; + B0056D1311F3868000754B65 /* doc */ = { + isa = PBXGroup; + children = ( + B0056D1411F3868000754B65 /* Limits */, + B0056D1511F3868000754B65 /* README */, + ); + path = doc; + sourceTree = ""; + }; + B0056D1611F3868000754B65 /* libsa */ = { + isa = PBXGroup; + children = ( + B4189A2214BFBF5600ED5B0B /* Cconfig */, + B0056D1711F3868000754B65 /* efi_tables.c */, + B0056D1811F3868000754B65 /* efi_tables.h */, + B0056D1911F3868000754B65 /* error.c */, + B0056D1A11F3868000754B65 /* libsa.h */, + B0056D1B11F3868000754B65 /* Makefile */, + B0056D1C11F3868000754B65 /* memory.h */, + B0056D1D11F3868000754B65 /* prf.c */, + B0056D1E11F3868000754B65 /* printf.c */, + B0056D1F11F3868000754B65 /* qsort.c */, + B0056D2011F3868000754B65 /* setjmp.s */, + B0056D2111F3868000754B65 /* string.c */, + B0056D2211F3868000754B65 /* strtol.c */, + B0056D2311F3868000754B65 /* zalloc.c */, + ); + path = libsa; + sourceTree = ""; + }; + B0056D2411F3868000754B65 /* libsaio */ = { + isa = PBXGroup; + children = ( + B0056D2511F3868000754B65 /* acpi.h */, + B0056D2611F3868000754B65 /* acpi_patcher.c */, + B0056D2711F3868000754B65 /* acpi_patcher.h */, + B0056D2811F3868000754B65 /* allocate.c */, + B00F494A11F6089500B1D7C5 /* aml_generator.c */, + B00F494911F6089500B1D7C5 /* aml_generator.h */, + B0056D2911F3868000754B65 /* asm.s */, + 012E60F7137AC68F00E35218 /* ati_reg.h */, + B0056D2A11F3868000754B65 /* ati.c */, + B0056D2C11F3868000754B65 /* bios.h */, + B0056D2D11F3868000754B65 /* bios.s */, + B0056D2E11F3868000754B65 /* biosfn.c */, + 1D2A1AF513743A2600787720 /* bootargs.h */, + B0056D2F11F3868000754B65 /* bootstruct.c */, + B0056D3011F3868000754B65 /* bootstruct.h */, + B0056D3111F3868000754B65 /* cache.c */, + B4189A2314BFBF7200ED5B0B /* Cconfig */, + B0056D3211F3868000754B65 /* console.c */, + B0056D3311F3868000754B65 /* convert.c */, + B0056D3411F3868000754B65 /* convert.h */, + B0056D3511F3868000754B65 /* cpu.c */, + B0056D3611F3868000754B65 /* cpu.h */, + B0056D3711F3868000754B65 /* device_inject.c */, + B0056D3811F3868000754B65 /* device_inject.h */, + B0056D3911F3868000754B65 /* device_tree.c */, + B0056D3A11F3868000754B65 /* device_tree.h */, + B0056D3B11F3868000754B65 /* disk.c */, + 65ED53931204B83200B22507 /* disk.h */, + 0172D0DC11FB66820030222E /* dram_controllers.h */, + 0172D0DD11FB66820030222E /* dram_controllers.c */, + B0056D3C11F3868000754B65 /* efi.h */, + B0056D3D11F3868000754B65 /* ext2fs.c */, + B0056D3E11F3868000754B65 /* ext2fs.h */, + B0056D3F11F3868000754B65 /* fake_efi.c */, + B0056D4011F3868000754B65 /* fake_efi.h */, + B0056D4111F3868000754B65 /* fdisk.h */, + B0056D4211F3868000754B65 /* hfs.c */, + B0056D4311F3868000754B65 /* hfs.h */, + B0056D4411F3868000754B65 /* hfs_CaseTables.h */, + B0056D4511F3868000754B65 /* hfs_compare.c */, + B0056D4611F3868000754B65 /* hpet.c */, + B0056D4711F3868000754B65 /* hpet.h */, + B0056D4811F3868000754B65 /* io_inline.h */, + B0056D4911F3868000754B65 /* libsaio.h */, + B0056D4A11F3868000754B65 /* load.c */, + B0056D4B11F3868000754B65 /* Makefile */, + B0056D4C11F3868000754B65 /* md5c.c */, + B0056D4F11F3868000754B65 /* memvendors.h */, + B0056D5011F3868000754B65 /* misc.c */, + B0056D5111F3868000754B65 /* msdos.c */, + B0056D5211F3868000754B65 /* msdos.h */, + B0056D5311F3868000754B65 /* msdos_private.h */, + B0056D5411F3868000754B65 /* nbp.c */, + B0056D5511F3868000754B65 /* nbp_cmd.h */, + B0056D5611F3868000754B65 /* ntfs.c */, + B0056D5711F3868000754B65 /* ntfs.h */, + B0056D5811F3868000754B65 /* ntfs_private.h */, + B0056D5911F3868000754B65 /* nvidia.c */, + B0056D5A11F3868000754B65 /* nvidia.h */, + ABE4A59C15B6EA73007812A6 /* nvidia_helper.h */, + ABE4A59D15B6EA73007812A6 /* nvidia_helper.c */, + B0056D5B11F3868000754B65 /* pci.c */, + B0056D5C11F3868000754B65 /* pci.h */, + B0056D5D11F3868000754B65 /* pci_root.c */, + B0056D5E11F3868000754B65 /* pci_root.h */, + B0056D5F11F3868000754B65 /* pci_setup.c */, + B0056D6011F3868000754B65 /* platform.c */, + B0056D6111F3868000754B65 /* platform.h */, + B0056D6211F3868000754B65 /* saio_internal.h */, + B0056D6311F3868000754B65 /* saio_types.h */, + B0056D6411F3868000754B65 /* sl.h */, + B0056D6511F3868000754B65 /* SMBIOS.h */, + 012E60F8137AC68F00E35218 /* smbios_decode.c */, + 012E60F9137AC68F00E35218 /* smbios_getters.c */, + 012E60FA137AC68F00E35218 /* smbios_getters.h */, + 012E60FB137AC68F00E35218 /* smbios.c */, + B0056D6811F3868000754B65 /* spd.c */, + B0056D6911F3868000754B65 /* spd.h */, + B0056D6A11F3868000754B65 /* stringTable.c */, + B0056D6B11F3868000754B65 /* sys.c */, + B0056D6C11F3868000754B65 /* table.c */, + B0056D6E11F3868000754B65 /* ufs.h */, + B0056D7011F3868000754B65 /* ufs_byteorder.h */, + B0056D7111F3868000754B65 /* usb.c */, + B0056D7211F3868000754B65 /* vbe.c */, + B0056D7311F3868000754B65 /* vbe.h */, + B0056D7411F3868000754B65 /* xml.c */, + B0056D7511F3868000754B65 /* xml.h */, + 1D2A1AF513743A2600787720 /* bootargs.h */, + ); + path = libsaio; + sourceTree = ""; + }; + B0056D7911F3868000754B65 /* util */ = { + isa = PBXGroup; + children = ( + A3561C8B1413FD7800E9B51E /* bdmesg.c */, + B4189A2414BFBFD100ED5B0B /* Cconfig */, + A3561C8A1413FD7800E9B51E /* dyldsymboltool.c */, + A3561C721413FD7800E9B51E /* fdisk */, + B0056D7A11F3868000754B65 /* machOconv.c */, + B0056D7B11F3868000754B65 /* Makefile */, + A3561C891413FD7800E9B51E /* openUp.c */, + ); + path = util; + sourceTree = ""; + }; + B0056D8311F3868000754B65 /* package */ = { + isa = PBXGroup; + children = ( + B4118C62153EFEC200C8D926 /* bin */, + A35D2188141A75DC00969AC0 /* buildpkg.sh */, + 361BC70214BD977700236488 /* Changes.txt */, + B0056D8511F3868000754B65 /* Distribution */, + 361BC70414BD979700236488 /* Icons */, + 36B43E8114BCE91300D29461 /* OptionalSettings */, + B4118C8E153EFF3300C8D926 /* po */, + B4118CAB153EFF3D00C8D926 /* po4a-chameleon.cfg */, + A396E2CA150247630025A245 /* Resources */, + A396E4F31502D0580025A245 /* Resources.old */, + A3F1F20D141B9B0D00DDA709 /* Scripts */, + 364E0DDF14BCFB6600F55E58 /* Scripts.templates */, + A35D2187141A75DC00969AC0 /* slimpkg.sh */, + B0056DB911F3868000754B65 /* smbios.plist */, + ); + path = package; + sourceTree = ""; + }; + B0056DBA11F3868000754B65 /* artwork */ = { + isa = PBXGroup; + children = ( + B0056DBB11F3868000754B65 /* themes */, + ); + path = artwork; + sourceTree = ""; + }; + B0056DBB11F3868000754B65 /* themes */ = { + isa = PBXGroup; + children = ( + B0056DBC11F3868000754B65 /* bullet */, + B0056DDC11F3868000754B65 /* default */, + B0056DFC11F3868000754B65 /* msi_netbook */, + B0056DFF11F3868000754B65 /* pinktink */, + B0056E0211F3868000754B65 /* twilight */, + ); + path = themes; + sourceTree = ""; + }; + B0056DBC11F3868000754B65 /* bullet */ = { + isa = PBXGroup; + children = ( + B0056DBD11F3868000754B65 /* background.png */, + B0056DBE11F3868000754B65 /* boot.png */, + B0056DBF11F3868000754B65 /* device_cdrom.png */, + B0056DC011F3868000754B65 /* device_ext3.png */, + B0056DC111F3868000754B65 /* device_fat16.png */, + B0056DC211F3868000754B65 /* device_fat32.png */, + B0056DC311F3868000754B65 /* device_generic.png */, + B0056DC411F3868000754B65 /* device_hfsplus.png */, + B0056DC511F3868000754B65 /* device_ntfs.png */, + B0056DC611F3868000754B65 /* device_scroll_next.png */, + B0056DC711F3868000754B65 /* device_scroll_prev.png */, + B0056DC811F3868000754B65 /* device_selection.png */, + B0056DC911F3868000754B65 /* font_console.png */, + B0056DCA11F3868000754B65 /* font_small.png */, + B0056DCB11F3868000754B65 /* logo.png */, + B0056DCC11F3868000754B65 /* menu_boot.png */, + B0056DCD11F3868000754B65 /* menu_help.png */, + B0056DCE11F3868000754B65 /* menu_ignore_caches.png */, + B0056DCF11F3868000754B65 /* menu_ignore_caches_disabled.png */, + B0056DD011F3868000754B65 /* menu_memory_info.png */, + B0056DD111F3868000754B65 /* menu_selection.png */, + B0056DD211F3868000754B65 /* menu_single_user.png */, + B0056DD311F3868000754B65 /* menu_single_user_disabled.png */, + B0056DD411F3868000754B65 /* menu_verbose.png */, + B0056DD511F3868000754B65 /* menu_verbose_disabled.png */, + B0056DD611F3868000754B65 /* menu_video_info.png */, + B0056DD711F3868000754B65 /* progress_bar.png */, + B0056DD811F3868000754B65 /* progress_bar_background.png */, + B0056DD911F3868000754B65 /* text_scroll_next.png */, + B0056DDA11F3868000754B65 /* text_scroll_prev.png */, + B0056DDB11F3868000754B65 /* theme.plist */, + ); + path = bullet; + sourceTree = ""; + }; + B0056DDC11F3868000754B65 /* default */ = { + isa = PBXGroup; + children = ( + 36AB75A114BD0866005B8045 /* background.png */, + 36AB75A214BD0866005B8045 /* boot.png */, + 36AB75A314BD0866005B8045 /* device_befs_o.png */, + 36AB75A414BD0866005B8045 /* device_befs.png */, + 36AB75A514BD0866005B8045 /* device_cdrom_o.png */, + 36AB75A614BD0866005B8045 /* device_cdrom.png */, + 36AB75A714BD0866005B8045 /* device_ext3_o.png */, + 36AB75A814BD0866005B8045 /* device_ext3.png */, + 36AB75A914BD0866005B8045 /* device_fat_o.png */, + 36AB75AA14BD0866005B8045 /* device_fat.png */, + 36AB75AB14BD0866005B8045 /* device_freebsd_o.png */, + 36AB75AC14BD0866005B8045 /* device_freebsd.png */, + 36AB75AD14BD0866005B8045 /* device_generic_o.png */, + 36AB75AE14BD0866005B8045 /* device_generic.png */, + 36AB75AF14BD0866005B8045 /* device_hfsplus_leo_o.png */, + 36AB75B014BD0866005B8045 /* device_hfsplus_leo.png */, + 36AB75B114BD0866005B8045 /* device_hfsplus_lion_o.png */, + 36AB75B214BD0866005B8045 /* device_hfsplus_lion.png */, + 36AB75B314BD0866005B8045 /* device_hfsplus_o.png */, + 36AB75B414BD0866005B8045 /* device_hfsplus_sl_o.png */, + 36AB75B514BD0866005B8045 /* device_hfsplus_sl.png */, + 36AB75B614BD0866005B8045 /* device_hfsplus_tiger_o.png */, + 36AB75B714BD0866005B8045 /* device_hfsplus_tiger.png */, + 36AB75B814BD0866005B8045 /* device_hfsplus.png */, + 36AB75B914BD0866005B8045 /* device_hfsraid_leo_o.png */, + 36AB75BA14BD0866005B8045 /* device_hfsraid_leo.png */, + 36AB75BB14BD0866005B8045 /* device_hfsraid_lion_o.png */, + 36AB75BC14BD0866005B8045 /* device_hfsraid_lion.png */, + 36AB75BD14BD0866005B8045 /* device_hfsraid_o.png */, + 36AB75BE14BD0866005B8045 /* device_hfsraid_sl_o.png */, + 36AB75BF14BD0866005B8045 /* device_hfsraid_sl.png */, + 36AB75C014BD0866005B8045 /* device_hfsraid_tiger_o.png */, + 36AB75C114BD0866005B8045 /* device_hfsraid_tiger.png */, + 36AB75C214BD0866005B8045 /* device_hfsraid.png */, + 36AB75C314BD0866005B8045 /* device_ntfs_o.png */, + 36AB75C414BD0866005B8045 /* device_ntfs.png */, + 36AB75C514BD0866005B8045 /* device_openbsd_o.png */, + 36AB75C614BD0866005B8045 /* device_openbsd.png */, + 36AB75C714BD0866005B8045 /* device_scroll_next.png */, + 36AB75C814BD0866005B8045 /* device_scroll_prev.png */, + 36AB75C914BD0866005B8045 /* device_selection.png */, + 36AB75CA14BD0866005B8045 /* font_console.png */, + 36AB75CB14BD0866005B8045 /* font_small.png */, + 36AB75CC14BD0866005B8045 /* logo.png */, + 36AB75CD14BD0866005B8045 /* menu_boot.png */, + 36AB75CE14BD0866005B8045 /* menu_help.png */, + 36AB75CF14BD0866005B8045 /* menu_ignore_caches_disabled.png */, + 36AB75D014BD0866005B8045 /* menu_ignore_caches.png */, + 36AB75D114BD0866005B8045 /* menu_memory_info.png */, + 36AB75D214BD0866005B8045 /* menu_selection.png */, + 36AB75D314BD0866005B8045 /* menu_single_user_disabled.png */, + 36AB75D414BD0866005B8045 /* menu_single_user.png */, + 36AB75D514BD0866005B8045 /* menu_verbose_disabled.png */, + 36AB75D614BD0866005B8045 /* menu_verbose.png */, + 36AB75D714BD0866005B8045 /* menu_video_info.png */, + 36AB75D814BD0866005B8045 /* progress_bar_background.png */, + 36AB75D914BD0866005B8045 /* progress_bar.png */, + 36AB75DA14BD0866005B8045 /* text_scroll_next.png */, + 36AB75DB14BD0866005B8045 /* text_scroll_prev.png */, + 36AB75DC14BD0866005B8045 /* theme.plist */, + 36AB75DD14BD0866005B8045 /* thumb.png */, + ); + path = default; + sourceTree = ""; + }; + B0056DFC11F3868000754B65 /* msi_netbook */ = { + isa = PBXGroup; + children = ( + B0056DFD11F3868000754B65 /* logo.png */, + B0056DFE11F3868000754B65 /* theme.plist */, + ); + path = msi_netbook; + sourceTree = ""; + }; + B0056DFF11F3868000754B65 /* pinktink */ = { + isa = PBXGroup; + children = ( + B0056E0011F3868000754B65 /* logo.png */, + B0056E0111F3868000754B65 /* theme.plist */, + ); + path = pinktink; + sourceTree = ""; + }; + B0056E0211F3868000754B65 /* twilight */ = { + isa = PBXGroup; + children = ( + B0056E0311F3868000754B65 /* font_small.png */, + B0056E0411F3868000754B65 /* logo.png */, + B0056E0511F3868000754B65 /* theme.plist */, + ); + path = twilight; + sourceTree = ""; + }; + B0056E0611F3868000754B65 /* doc */ = { + isa = PBXGroup; + children = ( + B0056E0711F3868000754B65 /* archive */, + B0056E0B11F3868000754B65 /* BootHelp.txt */, + AB47D38A15B702F00083D898 /* org.chameleon.Boot.nvidia.plist */, + B0056E0C11F3868000754B65 /* README */, + B0056E0D11F3868000754B65 /* themeinfo.png */, + B0056E0E11F3868000754B65 /* User_Guide_src */, + B0056E1A11F3868000754B65 /* Users_Guide0.5.pdf */, + ); + path = doc; + sourceTree = ""; + }; + B0056E0711F3868000754B65 /* archive */ = { + isa = PBXGroup; + children = ( + B0056E0811F3868000754B65 /* Users_Guide0.4.pdf */, + B0056E0911F3868000754B65 /* Users_Guide_v0.3.pdf */, + B0056E0A11F3868000754B65 /* UsersGuide-v0.2.pdf */, + ); + path = archive; + sourceTree = ""; + }; + B0056E0E11F3868000754B65 /* User_Guide_src */ = { + isa = PBXGroup; + children = ( + B0056E0F11F3868000754B65 /* Chameleon 2 v0.4.xml */, + B0056E1011F3868000754B65 /* Chameleon 2 v0.5.docx */, + B0056E1111F3868000754B65 /* chameleon.png */, + B0056E1211F3868000754B65 /* colorchart.png */, + B0056E1311F3868000754B65 /* install_complete.png */, + B0056E1411F3868000754B65 /* install_cust.png */, + B0056E1511F3868000754B65 /* install_dest.png */, + B0056E1611F3868000754B65 /* install_stand.png */, + B0056E1711F3868000754B65 /* install_start.png */, + B0056E1811F3868000754B65 /* screen_format.png */, + B0056E1911F3868000754B65 /* xnulogo.png */, + ); + path = User_Guide_src; + sourceTree = ""; + }; + B4118C62153EFEC200C8D926 /* bin */ = { + isa = PBXGroup; + children = ( + B4118C63153EFEC200C8D926 /* clean_po_headers.sh */, + B4118C64153EFEC200C8D926 /* po4a */, + ); + path = bin; + sourceTree = ""; + }; + B4118C64153EFEC200C8D926 /* po4a */ = { + isa = PBXGroup; + children = ( + B4118C65153EFEC200C8D926 /* COPYING */, + B4118C66153EFEC200C8D926 /* lib */, + B4118C82153EFEC200C8D926 /* MANIFEST */, + B4118C83153EFEC200C8D926 /* NEWS */, + B4118C84153EFEC200C8D926 /* po4a */, + B4118C85153EFEC200C8D926 /* po4a-gettextize */, + B4118C86153EFEC200C8D926 /* po4a-normalize */, + B4118C87153EFEC200C8D926 /* po4a-translate */, + B4118C88153EFEC200C8D926 /* po4a-updatepo */, + B4118C89153EFEC200C8D926 /* README */, + B4118C8A153EFEC200C8D926 /* README.maintainers */, + B4118C8B153EFEC200C8D926 /* README.tests */, + B4118C8C153EFEC200C8D926 /* README.translators */, + ); + path = po4a; + sourceTree = ""; + }; + B4118C66153EFEC200C8D926 /* lib */ = { + isa = PBXGroup; + children = ( + B4118C67153EFEC200C8D926 /* Locale */, + ); + path = lib; + sourceTree = ""; + }; + B4118C67153EFEC200C8D926 /* Locale */ = { + isa = PBXGroup; + children = ( + B4118C68153EFEC200C8D926 /* Po4a */, + ); + path = Locale; + sourceTree = ""; + }; + B4118C68153EFEC200C8D926 /* Po4a */ = { + isa = PBXGroup; + children = ( + B4118C69153EFEC200C8D926 /* BibTeX.pm */, + B4118C6A153EFEC200C8D926 /* Chooser.pm */, + B4118C6B153EFEC200C8D926 /* Common.pm */, + B4118C6C153EFEC200C8D926 /* Debconf.pm */, + B4118C6D153EFEC200C8D926 /* Dia.pm */, + B4118C6E153EFEC200C8D926 /* Docbook.pm */, + B4118C6F153EFEC200C8D926 /* Guide.pm */, + B4118C70153EFEC200C8D926 /* Halibut.pm */, + B4118C71153EFEC200C8D926 /* Html.pm */, + B4118C72153EFEC200C8D926 /* Ini.pm */, + B4118C73153EFEC200C8D926 /* KernelHelp.pm */, + B4118C74153EFEC200C8D926 /* LaTeX.pm */, + B4118C75153EFEC200C8D926 /* Man.pm */, + B4118C76153EFEC200C8D926 /* NewsDebian.pm */, + B4118C77153EFEC200C8D926 /* Po.pm */, + B4118C78153EFEC200C8D926 /* Pod.pm */, + B4118C79153EFEC200C8D926 /* Prop.pm */, + B4118C7A153EFEC200C8D926 /* Sgml.pm */, + B4118C7B153EFEC200C8D926 /* TeX.pm */, + B4118C7C153EFEC200C8D926 /* Texinfo.pm */, + B4118C7D153EFEC200C8D926 /* Text.pm */, + B4118C7E153EFEC200C8D926 /* TransTractor.pm */, + B4118C7F153EFEC200C8D926 /* Wml.pm */, + B4118C80153EFEC200C8D926 /* Xhtml.pm */, + B4118C81153EFEC200C8D926 /* Xml.pm */, + ); + path = Po4a; + sourceTree = ""; + }; + B4118C8E153EFF3300C8D926 /* po */ = { + isa = PBXGroup; + children = ( + B4118C8F153EFF3300C8D926 /* ar.po */, + B4118C90153EFF3300C8D926 /* bg.po */, + B4118C91153EFF3300C8D926 /* bs.po */, + B4118C92153EFF3300C8D926 /* ca.po */, + B4118C93153EFF3300C8D926 /* chameleon.pot */, + B4118C94153EFF3300C8D926 /* cs.po */, + B4118C95153EFF3300C8D926 /* de.po */, + B4118C96153EFF3300C8D926 /* el.po */, + B4118C97153EFF3300C8D926 /* en.po */, + B4118C98153EFF3300C8D926 /* es.po */, + B4118C99153EFF3300C8D926 /* fa.po */, + B4118C9A153EFF3300C8D926 /* fr.po */, + B4118C9B153EFF3300C8D926 /* he.po */, + B4118C9C153EFF3300C8D926 /* hr.po */, + B4118C9D153EFF3300C8D926 /* hu.po */, + B4118C9E153EFF3300C8D926 /* id.po */, + B4118C9F153EFF3300C8D926 /* it.po */, + B4118CA0153EFF3300C8D926 /* ko.po */, + B4118CA1153EFF3300C8D926 /* mk.po */, + B4118CA2153EFF3300C8D926 /* nl.po */, + B4118CA3153EFF3300C8D926 /* pl.po */, + B4118CA4153EFF3300C8D926 /* pt-BR.po */, + B4118CA5153EFF3300C8D926 /* pt-PT.po */, + B4118CA6153EFF3300C8D926 /* ro.po */, + B4118CA7153EFF3300C8D926 /* ru.po */, + B4118CA8153EFF3300C8D926 /* sr.po */, + B4118CA9153EFF3300C8D926 /* zh_CN.po */, + B4118CAA153EFF3300C8D926 /* zh_TW.po */, + ); + path = po; + sourceTree = ""; + }; + B4189A0314BFBED900ED5B0B /* config */ = { + isa = PBXGroup; + children = ( + B4189A0E14BFBF1C00ED5B0B /* cconfig.c */, + B4189A0F14BFBF1C00ED5B0B /* checklist.c */, + B4189A1014BFBF1C00ED5B0B /* confdata.c */, + B4189A1114BFBF1C00ED5B0B /* dialog.h */, + B4189A1214BFBF1C00ED5B0B /* expr.c */, + B4189A1314BFBF1C00ED5B0B /* expr.h */, + B4189A1414BFBF1C00ED5B0B /* inputbox.c */, + B4189A1514BFBF1C00ED5B0B /* lex.zconf.c */, + B4189A1614BFBF1C00ED5B0B /* lkc_proto.h */, + B4189A1714BFBF1C00ED5B0B /* lkc.h */, + B4189A0414BFBEEF00ED5B0B /* lxdialog */, + B4189A1814BFBF1C00ED5B0B /* Makefile */, + B4189A1914BFBF1C00ED5B0B /* menu.c */, + B4189A1A14BFBF1C00ED5B0B /* menubox.c */, + B4189A1B14BFBF1C00ED5B0B /* nconf.h */, + B4189A1C14BFBF1C00ED5B0B /* symbol.c */, + B4189A1D14BFBF1C00ED5B0B /* textbox.c */, + B4189A1E14BFBF1C00ED5B0B /* util.c */, + B4189A1F14BFBF1C00ED5B0B /* yesno.c */, + B4189A2014BFBF1C00ED5B0B /* zconf.hash.c */, + B4189A2114BFBF1C00ED5B0B /* zconf.tab.c */, + ); + name = config; + sourceTree = ""; + }; + B4189A0414BFBEEF00ED5B0B /* lxdialog */ = { + isa = PBXGroup; + children = ( + B4189A0514BFBF0A00ED5B0B /* BIG.FAT.WARNING */, + B4189A0614BFBF0A00ED5B0B /* check-lxdialog.sh */, + B4189A0714BFBF0A00ED5B0B /* checklist.c */, + B4189A0814BFBF0A00ED5B0B /* dialog.h */, + B4189A0914BFBF0A00ED5B0B /* inputbox.c */, + B4189A0A14BFBF0A00ED5B0B /* menubox.c */, + B4189A0B14BFBF0A00ED5B0B /* textbox.c */, + B4189A0C14BFBF0A00ED5B0B /* util.c */, + B4189A0D14BFBF0A00ED5B0B /* yesno.c */, + ); + name = lxdialog; + sourceTree = ""; + }; + B4AABE5814C3B8B90055ECD1 /* AddOption */ = { + isa = PBXGroup; + children = ( + B4AABE5914C3B8B90055ECD1 /* postinstall */, + ); + name = AddOption; + path = Scripts.templates/AddOption; + sourceTree = ""; + }; + B4AABE5A14C3B8C70055ECD1 /* InstallModule */ = { + isa = PBXGroup; + children = ( + B4AABE5B14C3B8C70055ECD1 /* postinstall */, + ); + name = InstallModule; + path = Scripts.templates/InstallModule; + sourceTree = ""; + }; + B4AABE5C14C3B8D70055ECD1 /* InstallTheme */ = { + isa = PBXGroup; + children = ( + B4AABE5D14C3B8D70055ECD1 /* postinstall */, + ); + name = InstallTheme; + path = Scripts.templates/InstallTheme; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXLegacyTarget section */ + D28A88AD04BDD90700651E21 /* Chameleon */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "$(ACTION)"; + buildConfigurationList = 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "Chameleon" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/make; + buildWorkingDirectory = ""; + dependencies = ( + ); + name = Chameleon; + passBuildSettingsInEnvironment = 1; + productName = Chameleon; + }; +/* End PBXLegacyTarget section */ + +/* Begin PBXProject section */ + 08FB7793FE84155DC02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + ar, + bg, + bs, + ca, + cs, + da, + de, + el, + en, + es, + fi, + fr, + he, + hr, + hu, + id, + it, + ja, + ko, + mk, + ms, + nl, + no, + pl, + "pt-BR", + "pt-PT", + ro, + ru, + sk, + sr, + sv, + th, + tr, + uk, + vi, + zh_CN, + zh_TW, + ); + mainGroup = 08FB7794FE84155DC02AAC07 /* Chameleon */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D28A88AD04BDD90700651E21 /* Chameleon */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXVariantGroup section */ + A396E4F41502D0580025A245 /* Conclusion.rtfd */ = { + isa = PBXVariantGroup; + children = ( + A396E4F51502D0580025A245 /* ar */, + A396E4FF1502D0580025A245 /* bg */, + A396E5041502D0580025A245 /* bs */, + A396E5091502D0580025A245 /* ca */, + A396E50E1502D0580025A245 /* de */, + A396E5131502D0580025A245 /* el */, + A396E5181502D0580025A245 /* en */, + A396E51D1502D0580025A245 /* es */, + A396E5221502D0580025A245 /* fr */, + A396E5271502D0580025A245 /* he */, + A396E52C1502D0580025A245 /* hr */, + A396E5311502D0580025A245 /* id */, + A396E5361502D0580025A245 /* it */, + A396E53B1502D0580025A245 /* ja */, + A396E5401502D0580025A245 /* ko */, + A396E5451502D0580025A245 /* mk */, + A396E54A1502D0580025A245 /* nl */, + A396E54F1502D0580025A245 /* pl */, + A396E5541502D0580025A245 /* pt-BR */, + A396E5591502D0580025A245 /* pt-PT */, + A396E55E1502D0580025A245 /* ro */, + A396E5631502D0580025A245 /* ru */, + A396E5681502D0580025A245 /* sr */, + A396E56D1502D0580025A245 /* zh_CN */, + A396E5721502D0580025A245 /* zh_TW */, + ); + name = Conclusion.rtfd; + sourceTree = ""; + }; + A396E4F61502D0580025A245 /* Description.html */ = { + isa = PBXVariantGroup; + children = ( + A396E4F71502D0580025A245 /* ar */, + A396E5001502D0580025A245 /* bg */, + A396E5051502D0580025A245 /* bs */, + A396E50A1502D0580025A245 /* ca */, + A396E50F1502D0580025A245 /* de */, + A396E5141502D0580025A245 /* el */, + A396E5191502D0580025A245 /* en */, + A396E51E1502D0580025A245 /* es */, + A396E5231502D0580025A245 /* fr */, + A396E5281502D0580025A245 /* he */, + A396E52D1502D0580025A245 /* hr */, + A396E5321502D0580025A245 /* id */, + A396E5371502D0580025A245 /* it */, + A396E53C1502D0580025A245 /* ja */, + A396E5411502D0580025A245 /* ko */, + A396E5461502D0580025A245 /* mk */, + A396E54B1502D0580025A245 /* nl */, + A396E5501502D0580025A245 /* pl */, + A396E5551502D0580025A245 /* pt-BR */, + A396E55A1502D0580025A245 /* pt-PT */, + A396E55F1502D0580025A245 /* ro */, + A396E5641502D0580025A245 /* ru */, + A396E5691502D0580025A245 /* sr */, + A396E56E1502D0580025A245 /* zh_CN */, + A396E5731502D0580025A245 /* zh_TW */, + ); + name = Description.html; + sourceTree = ""; + }; + A396E4F81502D0580025A245 /* License.rtf */ = { + isa = PBXVariantGroup; + children = ( + A396E4F91502D0580025A245 /* ar */, + A396E5011502D0580025A245 /* bg */, + A396E5061502D0580025A245 /* bs */, + A396E50B1502D0580025A245 /* ca */, + A396E5101502D0580025A245 /* de */, + A396E5151502D0580025A245 /* el */, + A396E51A1502D0580025A245 /* en */, + A396E51F1502D0580025A245 /* es */, + A396E5241502D0580025A245 /* fr */, + A396E5291502D0580025A245 /* he */, + A396E52E1502D0580025A245 /* hr */, + A396E5331502D0580025A245 /* id */, + A396E5381502D0580025A245 /* it */, + A396E53D1502D0580025A245 /* ja */, + A396E5421502D0580025A245 /* ko */, + A396E5471502D0580025A245 /* mk */, + A396E54C1502D0580025A245 /* nl */, + A396E5511502D0580025A245 /* pl */, + A396E5561502D0580025A245 /* pt-BR */, + A396E55B1502D0580025A245 /* pt-PT */, + A396E5601502D0580025A245 /* ro */, + A396E5651502D0580025A245 /* ru */, + A396E56A1502D0580025A245 /* sr */, + A396E56F1502D0580025A245 /* zh_CN */, + A396E5741502D0580025A245 /* zh_TW */, + ); + name = License.rtf; + sourceTree = ""; + }; + A396E4FA1502D0580025A245 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + A396E4FB1502D0580025A245 /* ar */, + A396E5021502D0580025A245 /* bg */, + A396E5071502D0580025A245 /* bs */, + A396E50C1502D0580025A245 /* ca */, + A396E5111502D0580025A245 /* de */, + A396E5161502D0580025A245 /* el */, + A396E51B1502D0580025A245 /* en */, + A396E5201502D0580025A245 /* es */, + A396E5251502D0580025A245 /* fr */, + A396E52A1502D0580025A245 /* he */, + A396E52F1502D0580025A245 /* hr */, + A396E5341502D0580025A245 /* id */, + A396E5391502D0580025A245 /* it */, + A396E53E1502D0580025A245 /* ja */, + A396E5431502D0580025A245 /* ko */, + A396E5481502D0580025A245 /* mk */, + A396E54D1502D0580025A245 /* nl */, + A396E5521502D0580025A245 /* pl */, + A396E5571502D0580025A245 /* pt-BR */, + A396E55C1502D0580025A245 /* pt-PT */, + A396E5611502D0580025A245 /* ro */, + A396E5661502D0580025A245 /* ru */, + A396E56B1502D0580025A245 /* sr */, + A396E5701502D0580025A245 /* zh_CN */, + A396E5751502D0580025A245 /* zh_TW */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + A396E4FC1502D0580025A245 /* Welcome.rtfd */ = { + isa = PBXVariantGroup; + children = ( + A396E4FD1502D0580025A245 /* ar */, + A396E5031502D0580025A245 /* bg */, + A396E5081502D0580025A245 /* bs */, + A396E50D1502D0580025A245 /* ca */, + A396E5121502D0580025A245 /* de */, + A396E5171502D0580025A245 /* el */, + A396E51C1502D0580025A245 /* en */, + A396E5211502D0580025A245 /* es */, + A396E5261502D0580025A245 /* fr */, + A396E52B1502D0580025A245 /* he */, + A396E5301502D0580025A245 /* hr */, + A396E5351502D0580025A245 /* id */, + A396E53A1502D0580025A245 /* it */, + A396E53F1502D0580025A245 /* ja */, + A396E5441502D0580025A245 /* ko */, + A396E5491502D0580025A245 /* mk */, + A396E54E1502D0580025A245 /* nl */, + A396E5531502D0580025A245 /* pl */, + A396E5581502D0580025A245 /* pt-BR */, + A396E55D1502D0580025A245 /* pt-PT */, + A396E5621502D0580025A245 /* ro */, + A396E5671502D0580025A245 /* ru */, + A396E56C1502D0580025A245 /* sr */, + A396E5711502D0580025A245 /* zh_CN */, + A396E5761502D0580025A245 /* zh_TW */, + ); + name = Welcome.rtfd; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 1DEB919008733D9F0010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + GCC_DYNAMIC_NO_PIC = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = Chameleon; + }; + name = Debug; + }; + 1DEB919108733D9F0010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = Chameleon; + }; + name = Release; + }; + 1DEB919408733D9F0010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 1DEB919508733D9F0010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = macosx; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB918F08733D9F0010E9CD /* Build configuration list for PBXLegacyTarget "Chameleon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB919008733D9F0010E9CD /* Debug */, + 1DEB919108733D9F0010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB919308733D9F0010E9CD /* Build configuration list for PBXProject "Chameleon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB919408733D9F0010E9CD /* Debug */, + 1DEB919508733D9F0010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; +} diff --git a/Chameleon.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chameleon.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..d504682 --- /dev/null +++ b/Chameleon.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/GPL_V2_LICENSE b/GPL_V2_LICENSE new file mode 100644 index 0000000..0137d46 --- /dev/null +++ b/GPL_V2_LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/Keymaps/.svn/all-wcprops b/Keymaps/.svn/all-wcprops new file mode 100644 index 0000000..c6e8e00 --- /dev/null +++ b/Keymaps/.svn/all-wcprops @@ -0,0 +1,41 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps +END +mac-it.lyt +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps/mac-it.lyt +END +mac-es.lyt +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps/mac-es.lyt +END +mac-fr.lyt +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps/mac-fr.lyt +END +mac-se.lyt +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps/mac-se.lyt +END +mac-de.lyt +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps/mac-de.lyt +END +pc-fr.lyt +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/Keymaps/pc-fr.lyt +END diff --git a/Keymaps/.svn/entries b/Keymaps/.svn/entries new file mode 100644 index 0000000..e9d28e4 --- /dev/null +++ b/Keymaps/.svn/entries @@ -0,0 +1,232 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/Keymaps +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +mac-it.lyt +file + + + + +2013-08-27T23:58:04.000000Z +9a6d584d61defeb849b8baacfc010a0e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +464 + +mac-es.lyt +file + + + + +2013-08-27T23:58:04.000000Z +d39d948c9fefc241903b46ffcce47354 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +464 + +mac-fr.lyt +file + + + + +2013-08-27T23:58:04.000000Z +dd0d0ebab62f75dfc05e10f0a251b3be +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +464 + +mac-se.lyt +file + + + + +2013-08-27T23:58:04.000000Z +d3ae0ea6f4f4477d2a06386b81cb4b75 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +464 + +mac-de.lyt +file + + + + +2013-08-27T23:58:04.000000Z +bcfcd66278e9df555503d22e6cfd77f1 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +464 + +pc-fr.lyt +file + + + + +2013-08-27T23:58:04.000000Z +887a1c6f4f4a6085960e6016625d45c3 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +464 + diff --git a/Keymaps/.svn/prop-base/mac-de.lyt.svn-base b/Keymaps/.svn/prop-base/mac-de.lyt.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/Keymaps/.svn/prop-base/mac-de.lyt.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/Keymaps/.svn/prop-base/mac-es.lyt.svn-base b/Keymaps/.svn/prop-base/mac-es.lyt.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/Keymaps/.svn/prop-base/mac-es.lyt.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/Keymaps/.svn/prop-base/mac-fr.lyt.svn-base b/Keymaps/.svn/prop-base/mac-fr.lyt.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/Keymaps/.svn/prop-base/mac-fr.lyt.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/Keymaps/.svn/prop-base/mac-it.lyt.svn-base b/Keymaps/.svn/prop-base/mac-it.lyt.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/Keymaps/.svn/prop-base/mac-it.lyt.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/Keymaps/.svn/prop-base/mac-se.lyt.svn-base b/Keymaps/.svn/prop-base/mac-se.lyt.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/Keymaps/.svn/prop-base/mac-se.lyt.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/Keymaps/.svn/prop-base/pc-fr.lyt.svn-base b/Keymaps/.svn/prop-base/pc-fr.lyt.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/Keymaps/.svn/prop-base/pc-fr.lyt.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/Keymaps/.svn/text-base/mac-de.lyt.svn-base b/Keymaps/.svn/text-base/mac-de.lyt.svn-base new file mode 100644 index 0000000..391f946 Binary files /dev/null and b/Keymaps/.svn/text-base/mac-de.lyt.svn-base differ diff --git a/Keymaps/.svn/text-base/mac-es.lyt.svn-base b/Keymaps/.svn/text-base/mac-es.lyt.svn-base new file mode 100644 index 0000000..7fec13d Binary files /dev/null and b/Keymaps/.svn/text-base/mac-es.lyt.svn-base differ diff --git a/Keymaps/.svn/text-base/mac-fr.lyt.svn-base b/Keymaps/.svn/text-base/mac-fr.lyt.svn-base new file mode 100644 index 0000000..026ce55 Binary files /dev/null and b/Keymaps/.svn/text-base/mac-fr.lyt.svn-base differ diff --git a/Keymaps/.svn/text-base/mac-it.lyt.svn-base b/Keymaps/.svn/text-base/mac-it.lyt.svn-base new file mode 100644 index 0000000..f0fd4bb Binary files /dev/null and b/Keymaps/.svn/text-base/mac-it.lyt.svn-base differ diff --git a/Keymaps/.svn/text-base/mac-se.lyt.svn-base b/Keymaps/.svn/text-base/mac-se.lyt.svn-base new file mode 100644 index 0000000..73fee66 Binary files /dev/null and b/Keymaps/.svn/text-base/mac-se.lyt.svn-base differ diff --git a/Keymaps/.svn/text-base/pc-fr.lyt.svn-base b/Keymaps/.svn/text-base/pc-fr.lyt.svn-base new file mode 100644 index 0000000..c3f2b52 Binary files /dev/null and b/Keymaps/.svn/text-base/pc-fr.lyt.svn-base differ diff --git a/Keymaps/mac-de.lyt b/Keymaps/mac-de.lyt new file mode 100644 index 0000000..391f946 Binary files /dev/null and b/Keymaps/mac-de.lyt differ diff --git a/Keymaps/mac-es.lyt b/Keymaps/mac-es.lyt new file mode 100644 index 0000000..7fec13d Binary files /dev/null and b/Keymaps/mac-es.lyt differ diff --git a/Keymaps/mac-fr.lyt b/Keymaps/mac-fr.lyt new file mode 100644 index 0000000..026ce55 Binary files /dev/null and b/Keymaps/mac-fr.lyt differ diff --git a/Keymaps/mac-it.lyt b/Keymaps/mac-it.lyt new file mode 100644 index 0000000..f0fd4bb Binary files /dev/null and b/Keymaps/mac-it.lyt differ diff --git a/Keymaps/mac-se.lyt b/Keymaps/mac-se.lyt new file mode 100644 index 0000000..73fee66 Binary files /dev/null and b/Keymaps/mac-se.lyt differ diff --git a/Keymaps/pc-fr.lyt b/Keymaps/pc-fr.lyt new file mode 100644 index 0000000..c3f2b52 Binary files /dev/null and b/Keymaps/pc-fr.lyt differ diff --git a/MEMTEST86_LICENSE b/MEMTEST86_LICENSE new file mode 100644 index 0000000..1a94914 --- /dev/null +++ b/MEMTEST86_LICENSE @@ -0,0 +1,32 @@ +dram_controllers.c/h that scans from the pci host controller USES +an adaptation for chameleon 2.0 RC5 from original : + +======================== +memtest86 license notice +======================== + + Released under version 2 of the Gnu Public License. + By Chris Brady, cbrady@sgi.com + ---------------------------------------------------- + MemTest86+ V4.00 Specific code (GPL V2.0) + By Samuel DEMEULEMEESTER, sdemeule@memtest.org + http://www.canardpc.com - http://www.memtest.org + + +============================ +GPL version 2 license notice +============================ + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/Make.rules b/Make.rules new file mode 100644 index 0000000..5f4a373 --- /dev/null +++ b/Make.rules @@ -0,0 +1,174 @@ + +-include $(SRCROOT)/auto.conf + +export USE_APPLE_PB_SUPPORT = all + +ifneq "" "$(wildcard /bin/mkdirs)" + MKDIRS = /bin/mkdirs +else + MKDIRS = /bin/mkdir -p +endif +AS = as +LD = ld +CC = cc +CPP = c++ + +PAX = /bin/pax +NASM = $(shell which nasm) -p $(SRCROOT)/autoconf.inc + + +CFLAGS = $(CONFIG_OPTIMIZATION_LEVEL) -g -Wmost -Werror +CPPFLAGS = $(MORECPP) -g -Wmost -Werror -fno-exceptions -fno-rtti +DEFINES= + +DIST_SUBDIRS += $(SUBDIRS) + +# +# Common makefile targets. +# +# Define these variables (if desired) in directory makefiles: +# DIRS_NEEDED +# INSTALLDIR +# SRCROOT +# + +# Toggle this as to whether you want a frame pointer (%ebp) to be used. It is +# invaluable for debugging the booter. For example using GDB attached to VMware. +# In fact, it's so invaluable that it's now the default. Not only that but the +# compiler seems to generate slightly smaller code and the real<->prot code +# clearly handles it appropriately so I have no idea why Apple omitted it. +#OMIT_FRAME_POINTER_CFLAG=-fomit-frame-pointer +OMIT_FRAME_POINTER_CFLAG= + +-include $(OBJROOT)/*.Makedep + +$(OBJROOT)/%.o32: %.c + @echo "\t[CC32] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch i386 $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch i386 $< -o $@ + +$(OBJROOT)/%.o64: %.c + @echo "\t[CC64] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) -arch x86_64 $< -o $@ + + +$(OBJROOT)/%.o: %.c + @echo "\t[CC] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ + +$(OBJROOT)/%.o: %.m + @echo "\t[M] $<" + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -MM -M -o $@.Makedep + @$(CC) $(CFLAGS) $(DEFINES) -c $(INC) $< -o $@ + +$(OBJROOT)/%.o: %.cpp + @echo "\t[CPP] $<" + @$(CPP) $(CPPFLAGS) $(CFLAGS) -c "$<" $(INC) -MM -M -o $@.Makedep + @$(CPP) $(CPPFLAGS) $(CFLAGS) -c "$<" $(INC) -o $@ + +$(OBJROOT)/%.o: %.s + @echo "\t[AS] $<" + @$(CC) $(CPPFLAGS) -c $(INC) -arch i386 $< -MM -M -o $@.Makedep + @$(CC) $(CPPFLAGS) -c $(INC) -arch i386 $< -o $@ + +CONFIG_FILES=$(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h $(SRCROOT)/autoconf.inc $(SRCROOT)/.config +$(CONFIG_FILES): $(SRCROOT)/.config + @echo "\t[MAKE] config" + @make -C $(SRCROOT)/i386/config rebuild_config + +HEADER_VERSION=$(SRCROOT)/vers.h +$(HEADER_VERSION): $(SRCROOT)/version + @echo "#define I386BOOT_VERSION \"5.0.132\"" > $@ + @echo "#define I386BOOT_BUILDDATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $@ + @echo "#define I386BOOT_CHAMELEONVERSION \"`cat $(SRCROOT)/version`\"" >> $@ + @echo "#define I386BOOT_CHAMELEONREVISION \"`cat $(SRCROOT)/revision`\"" >> $@ +# @echo "#define I386BOOT_CHAMELEONREVISION \"`svnversion -n | tr -d [:alpha:]`\"" >> $@ + +CONFIG_HEADERS=$(CONFIG_FILES) $(HEADER_VERSION) + +# This breaks make, must use make all (FIXME) +$(DIRS_NEEDED) $(INSTALLDIR) $(OBJROOT) $(SYMROOT): + @echo "\t[MKDIR] $@" + @$(MKDIRS) $@ + +# Recursive rules +RECURSIVE_TARGETS = all-recursive +RECURSIVE_CLEAN_TARGETS = distclean-recursive clean-recursive +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) + +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo ================= Making $$target in $$subdir =================; \ + (cd $$subdir && $(MAKE) $$target) \ + || eval $$failcom; \ + done; + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-local"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $$local_target) \ + || eval $$failcom; \ + done + + +clean-dep: + @if [ -f "$(OBJROOT)/Makedep" ];then echo "\t[RM] $(OBJROOT)/Makedep"; fi + @rm -f $(OBJROOT)/Makedep + + +FIND_IGNORE := \( -name .git -o -name .svn \) -prune -o -name Cconfig -o + +# clean: remove almost everything (execpt auto.conf, autoconf.h, autoconf.inc) +clean: clean-recursive clean-dep + @if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi + @if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi + @if [ -d "$(DSTROOT)" ];then echo "\t[RMDIR] $(DSTROOT)"; fi + @if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \ + echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \ + fi + @rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \ + $(SRCROOT)/i386/modules/module_includes + +distclean: distclean-recursive clean-local clean-dep + @find . $(FIND_IGNORE) \ + \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ + -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ + -o -name '.*.rej' -o -size 0 \ + -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \ + -type f -print | xargs rm -f + +clean-local: + +distclean-local: + +.DEFAULT_GOAL := all + +# Local Variables: # +# mode: Makefile # +# tab-width: 2 # +# indent-tabs-mode: t # +# End: # +# +# vi: set noexpandtab ts=2 sw=2 sts=2: # diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eec40fe --- /dev/null +++ b/Makefile @@ -0,0 +1,148 @@ +# Makefile for kernel booter +SRCROOT = $(CURDIR) +OBJROOT = $(SRCROOT)/obj +SYMROOT = $(SRCROOT)/sym +DSTROOT = $(SRCROOT)/dst +DOCROOT = $(SRCROOT)/doc +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot +PKG_BUILD_DIR = $(SYMROOT)/package + +include Make.rules + + +THEME = default + +VERSION = `cat ${SRCROOT}/version` +REVISION = `cat ${SRCROOT}/revision` +PRODUCT = Chameleon-$(VERSION)-r$(REVISION) +CDLABEL = ${PRODUCT} +ISOIMAGE = ${SYMROOT}/${CDLABEL}.iso +DISTFILE = ${SYMROOT}/${PRODUCT} + +IMGROOT = $(SRCROOT)/sym/${PRODUCT} +DISTROOT= ./${PRODUCT} + + +EXCLUDE = --exclude=.svn --exclude=.DS_Store --exclude=sym --exclude=obj \ + --exclude=package --exclude=archive --exclude=User_Guide_src --exclude=*.sh + +#RC_CFLAGS = i386 +ARCHLESS_RC_CFLAGS=`echo $(RC_CFLAGS) | sed 's/-arch [a-z0-9]*//g'` + +GENERIC_SUBDIRS = +SUBDIRS = $(GENERIC_SUBDIRS) i386 +DIST_SUBDIRS = $(SUBDIRS) + +$(SRCROOT)/revision: + @svnversion -n | tr -d [:alpha:] > $(SRCROOT)/revision + +# +# Currently builds for i386 +# +config rebuild_config: + @make -C $(SRCROOT)/i386/config $@ + +all: $(SYMROOT) $(OBJROOT) $(CONFIG_HEADERS) $(HEADER_VERSION) $(SRCROOT)/revision + @$(MAKE) all-recursive + +dist image: all + @# To force the read of auto.conf (generated by 'all' target) + @make $@-local + +dist-local image-local: + @echo "================= Distrib =================" + @echo "\t[RM] ${IMGROOT}" + @rm -rf ${IMGROOT} + @echo "\t[MKDIR] ${IMGROOT}/usr/standalone/i386" + @mkdir -p ${IMGROOT}/usr/standalone/i386 + @echo "\t[MKDIR] ${IMGROOT}/Extra/modules" + @mkdir -p ${IMGROOT}/Extra/modules + @echo "\t[MKDIR] ${IMGROOT}/Extra/Themes/Default" + @mkdir -p ${IMGROOT}/Extra/Themes/Default + @echo "\t[MKDIR] ${IMGROOT}/usr/bin" + @mkdir -p ${IMGROOT}/usr/bin + @if [ -e "$(IMGSKELROOT)" ]; then \ + @echo "\t[CP] ${IMGROOTSKEL} ${IMGROOT}" \ + @cp -R -f "${IMGSKELROOT}"/* "${IMGROOT}"; \ + fi; + @cp -f ${SYMROOT}/i386/cdboot ${CDBOOT} + @cp -f ${SYMROOT}/i386/modules/* ${IMGROOT}/Extra/modules + @cp -f ${SRCROOT}/artwork/themes/default/* ${IMGROOT}/Extra/Themes/Default + @cp -f ${SYMROOT}/i386/boot ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot0 ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot0hfs ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot0md ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot1h ${IMGROOT}/usr/standalone/i386 + @cp -f ${SYMROOT}/i386/boot1f32 ${IMGROOT}/usr/standalone/i386 +ifdef CONFIG_FDISK440 + @cp -f ${SYMROOT}/i386/fdisk440 ${IMGROOT}/usr/bin +endif +ifdef CONFIG_BDMESG + @cp -f ${SYMROOT}/i386/bdmesg ${IMGROOT}/usr/bin +endif +ifdef CONFIG_KEYLAYOUT_MODULE + @cp -f ${SYMROOT}/i386/cham-mklayout ${IMGROOT}/usr/bin + @echo "\t[MKDIR] ${IMGROOT}/Extra/Keymaps" + @mkdir -p ${IMGROOT}/Extra/Keymaps + @echo "\t[CP] Keymaps ${IMGROOT}/Extra/Keymaps" + @cp -R -f "Keymaps"/* "${IMGROOT}/Extra/Keymaps/" +endif + + @echo "\t[HDIUTIL] ${ISOIMAGE}" + @hdiutil makehybrid -iso -joliet -hfs -hfs-volume-name \ + ${CDLABEL} -eltorito-boot ${CDBOOT} -no-emul-boot -ov -o \ + "${ISOIMAGE}" ${IMGROOT} -quiet + @echo "\t[GZ] ${DISTFILE}.tgz" + @rm -f ${DISTFILE}.tar.gz + @cd ${SYMROOT} && tar -cf ${DISTFILE}.tar ${DISTROOT} + @gzip --best ${DISTFILE}.tar + @mv ${DISTFILE}.tar.gz ${DISTFILE}.tgz + +clean-local: + @if [ -d "$(PKG_BUILD_DIR)" ];then echo "\t[RMDIR] $(PKG_BUILD_DIR)"; fi + @if [ -f "$(HEADER_VERSION)" ];then echo "\t[RM] $(HEADER_VERSION)"; fi + @if [ -f "$(SRCROOT)/revision" ];then echo "\t[RM] $(SRCROOT)/revision"; fi + @rm -rf "$(PKG_BUILD_DIR)" $(HEADER_VERSION) $(SRCROOT)/revision + +AUTOCONF_FILES = $(SRCROOT)/auto.conf $(SRCROOT)/autoconf.h \ + $(SRCROOT)/autoconf.inc $(SRCROOT)/.config $(SRCROOT)/.config.old + +distclean-local: + @if [ -d "$(OBJROOT)" ];then echo "\t[RMDIR] $(OBJROOT)"; fi + @if [ -d "$(SYMROOT)" ];then echo "\t[RMDIR] $(SYMROOT)"; fi + @if [ -d "$(DSTROOT)" ];then echo "\t[RMDIR] $(DSTROOT)"; fi + @if [ -d "$(SRCROOT)/i386/modules/module_includes" ];then \ + echo "\t[RMDIR] $(SRCROOT)/i386/modules/module_includes"; \ + fi + @for cfg in $(AUTOCONF_FILES); do if [ -f "$${cfg}" ];then echo "\t[RM] $${cfg}"; fi; done + @rm -rf $(OBJROOT) $(SYMROOT) $(DSTROOT) \ + $(SRCROOT)/i386/modules/module_includes \ + $(AUTOCONF_FILES) + +pkg installer: all + @echo "================= Building Package =================" + @${SRCROOT}/package/buildpkg.sh "$(SRCROOT)" "$(SYMROOT)" "$(PKG_BUILD_DIR)" + +help: + @echo 'Configuration target:' + @echo ' config - Show configuration menu' + @echo + @echo 'Build targets:' + @echo ' all - Build all targets [DEFAULT]' + @echo ' dist - Build distribution tarball' + @echo ' pkg - Build installer package' + @echo + @echo 'Cleaning targets:' + @echo ' clean - Remove most generated files' + @echo ' distclean - Remove all generated files + config' +#@echo +# @echo 'Build options:' +# @echo 'make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build' + +.PHONY: config +.PHONY: clean +.PHONY: image +.PHONY: pkg +.PHONY: installer +.PHONY: help diff --git a/README b/README new file mode 100644 index 0000000..b6d621f --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +Chameleon is a Darwin/XNU boot loader based on Apple's boot-132. + +Because Chameleon now uses part of GPL V2 licensed code in 2 files, +it *must* conform to the most restrictive license that it uses that is the: +GPL Version 2 LICENSE + +Chameleon can thus be (and has to be) freely distributed under the term of the GPL V2 license which prevails, as it is the most restrictive license. diff --git a/README.translators b/README.translators new file mode 100644 index 0000000..dfb78b8 --- /dev/null +++ b/README.translators @@ -0,0 +1,26 @@ +Hi all translators, + +we can help us to translate the Chameleon Project. + +You need to have gettext utilities installed. +You can install them : + * With MacPorts or Fink + or + * With the package http://dl.dropbox.com/u/112112/Chameleon.Dev/gettext-0.18.1.1.dmg + You need to change your ~/.bashrc or ~/.bash_profile to add the path to the utilities: + # MacPorts Installer: adding an appropriate PATH variable for use with MacPorts. + export PATH=/opt/local/bin:/opt/local/sbin:$PATH + # Finished adapting your PATH environment variable for use with MacPorts. + + # MacPorts Installer: adding an appropriate MANPATH variable for use with MacPorts. + export MANPATH=/opt/local/share/man:$MANPATH + # Finished adapting your MANPATH environment variable for use with MacPorts. + +You must also have a PO editor like Poedit: http://www.poedit.net/download.php + +The files to translate are in package/po directory. Open them with your PO editor and translate :D. + +If you want to add a new language copy the package/po/chameleon.pot to po/$lang.po where $lang is +the new language you want to add. Example to add belgian language: + # cp package/po/chameleon.pot package/po/be.po +Now you can start translating the new po file with your PO editor diff --git a/TODO b/TODO new file mode 100644 index 0000000..bf7ceae --- /dev/null +++ b/TODO @@ -0,0 +1,87 @@ +TODO List for Chameleon Boot Loader +==================================== +- Fix boot prompt parsing. + +- Bring code closer to coding_standards.txt. + +- Fix the module system when booting chameleon with multiboot. Cleanup the xcode 4 fix. + +- Integrate Prasys current work on options and quick shortcut modified version of 18seven + +- Add auto detection of efi string algorithm, so graphics enabler can be enabled by default while not + conflicting with other efi string overridden content + (original idea of Galaxy) + + - Case insensitive parsing for the bootConfig options: + should help the common/novice user to setup more easily. + +- Find out how we can avoid section overlap with the xcode4.4 LD version (we must first reduce the size of the bootloader but it's not enought, maybe we should use a thing comparable to the gnu ld.script, QUESTION: is the xcode4.4 linker still suitable to build standalone app ? ) +==================================== + +DONE + +- Create a dummy module for any modules that are compiled in. This is needed for linking modules with + dependencies that are not compiled in. + +- Add a more sophisticated acpi loading mechanism to enable loading custom acpi tables when dsdtdrop=y + Here's a specification to think about: + First we must care about if a forced DSDT full path has been specified + (was what pb smith had in his first tries) and take it for the DSDT path as is. + Then we have the case where no DSDT path was set where we run our usual DSDT search algorithm to + find this file. + In the latter case, the file has to be named DSDT.aml and be in one of the / /Extra or bt(0,0)/Extra + directory. + + Now a first idea to implement correctly the acpi tables loading would be: + + Whether the path was hardcoded in the DSDT option or was automatically found, we extract the path part + of the DSDT file that has been successfully found and we run a loop to enumerate all other acpi + files in the same directory. + Now for each acpi file found, we should compare the name with an existing acpi table found in + the system that we would normally load and replace this usual injection by the content of the file. + + Once DropDSDT=y is set, no other acpi table than dsdt is loaded, then it is the responsibility of the + user to provide any other acpi table. + +- Add a new module capable of writing proprietary Chameleon data to ioreg: + Using the DT__xxx() API, we will create a set of functions to write + to log info, chameleon boot info to be retrieved by helper applications... + the only public function for log info purpose of this module would be: + logMessageToIOREG(...); // var args printf style format + flushLogToIOREG(); // store a unique log info property to the ioreg + + The preferred internal behavior of the log info ioreg buffer + would be to store the messages in a consolidated buffer then only write once, + this buffer (i.e just before call the kernel) with flushLogToIOREG(); + The other public function for writing chameleon boot info data would be: + + verbose() should incorporate a call to logMessageToIOREG() + to permit helper applications to extract + this log info (i.e: the chameleon system pref pane) + +- Add API for displaying and logging messages like: + + void verbose(...) + { + ... + logMessageToIOREG("%s: %sn", title, s); + + } + + void display_and_log( const char* title, const char* msg) + { + printf("%s: %sn", title, s); + logMessageToIOREG(title,s); + } + + void deprecated(const char * s) + { + display_and_log("WARNING: Deprecated option",s); + sleep(1); + } + + void error_message(const char * s) + { + display_and_log("ERROR",s); + getc(); + } diff --git a/artwork/.svn/all-wcprops b/artwork/.svn/all-wcprops new file mode 100644 index 0000000..036533e --- /dev/null +++ b/artwork/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork +END diff --git a/artwork/.svn/entries b/artwork/.svn/entries new file mode 100644 index 0000000..7f4a088 --- /dev/null +++ b/artwork/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/artwork +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +themes +dir + diff --git a/artwork/themes/.svn/all-wcprops b/artwork/themes/.svn/all-wcprops new file mode 100644 index 0000000..8a2a83a --- /dev/null +++ b/artwork/themes/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes +END diff --git a/artwork/themes/.svn/entries b/artwork/themes/.svn/entries new file mode 100644 index 0000000..10ad1ca --- /dev/null +++ b/artwork/themes/.svn/entries @@ -0,0 +1,40 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/artwork/themes +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +default +dir + +legacy +dir + +bullet +dir + +embed +dir + diff --git a/artwork/themes/bullet/.svn/all-wcprops b/artwork/themes/bullet/.svn/all-wcprops new file mode 100644 index 0000000..30e9272 --- /dev/null +++ b/artwork/themes/bullet/.svn/all-wcprops @@ -0,0 +1,191 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet +END +text_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/text_scroll_prev.png +END +logo.png +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/logo.png +END +device_ext3.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_ext3.png +END +menu_single_user.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_single_user.png +END +boot.png +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/boot.png +END +device_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_scroll_prev.png +END +menu_ignore_caches.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_ignore_caches.png +END +menu_verbose_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_verbose_disabled.png +END +menu_boot.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_boot.png +END +font_console.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/font_console.png +END +device_ntfs.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_ntfs.png +END +menu_single_user_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_single_user_disabled.png +END +device_fat32.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_fat32.png +END +font_small.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/font_small.png +END +text_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/text_scroll_next.png +END +device_fat16.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_fat16.png +END +device_hfsplus.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_hfsplus.png +END +menu_ignore_caches_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_ignore_caches_disabled.png +END +device_selection.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_selection.png +END +menu_video_info.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_video_info.png +END +menu_memory_info.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_memory_info.png +END +theme.plist +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/theme.plist +END +menu_selection.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_selection.png +END +device_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_scroll_next.png +END +menu_help.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_help.png +END +background.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/background.png +END +device_cdrom.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_cdrom.png +END +progress_bar_background.png +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/progress_bar_background.png +END +progress_bar.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/progress_bar.png +END +menu_verbose.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/menu_verbose.png +END +device_generic.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/bullet/device_generic.png +END diff --git a/artwork/themes/bullet/.svn/entries b/artwork/themes/bullet/.svn/entries new file mode 100644 index 0000000..b7a4c23 --- /dev/null +++ b/artwork/themes/bullet/.svn/entries @@ -0,0 +1,1082 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/artwork/themes/bullet +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +text_scroll_prev.png +file + + + + +2013-08-27T23:55:47.000000Z +79d10d5928715edc655d1bfce09161ab +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3042 + +logo.png +file + + + + +2013-08-27T23:55:47.000000Z +d2d7dbf9f4cb5fc1cec31e4d10d122eb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3016 + +device_ext3.png +file + + + + +2013-08-27T23:55:47.000000Z +71e5769ec7c7705e8de213aa0d5849fc +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6542 + +menu_single_user.png +file + + + + +2013-08-27T23:55:47.000000Z +566416b6bc50704f6c4b1cb7105cfa9a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3231 + +boot.png +file + + + + +2013-08-27T23:55:47.000000Z +9cde979bfa1742027688d14abf41e719 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6200 + +device_scroll_prev.png +file + + + + +2013-08-27T23:55:47.000000Z +ad5b8036860887e63e1d568f66733ad3 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3001 + +menu_ignore_caches.png +file + + + + +2013-08-27T23:55:47.000000Z +bfc1c31252eedacecc576e27b2cf8aa3 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3197 + +menu_verbose_disabled.png +file + + + + +2013-08-27T23:55:47.000000Z +8caf1ad316bcc8adc47154502dd06fe5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3325 + +menu_boot.png +file + + + + +2013-08-27T23:55:47.000000Z +84f0a8e515ff74830b548cb7d8b7662c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3260 + +font_console.png +file + + + + +2013-08-27T23:55:47.000000Z +f69e965934c42f64dbb6c4c7b06d0517 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6574 + +device_ntfs.png +file + + + + +2013-08-27T23:55:47.000000Z +90abe67e14567586848cb331c71a64f1 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6582 + +menu_single_user_disabled.png +file + + + + +2013-08-27T23:55:47.000000Z +8caf1ad316bcc8adc47154502dd06fe5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3325 + +device_fat32.png +file + + + + +2013-08-27T23:55:47.000000Z +514fbe2345408d11371c8eb4e789b7f6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +5585 + +font_small.png +file + + + + +2013-08-27T23:55:47.000000Z +c91dc2c39eb0ec9fca72e35be23af43f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8900 + +text_scroll_next.png +file + + + + +2013-08-27T23:55:47.000000Z +c6dcc3bf38d10b2fbfdde72fa886f246 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3046 + +device_fat16.png +file + + + + +2013-08-27T23:55:47.000000Z +b60d9e4a53df7e6d9e335df92fc4ba4a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +5942 + +device_hfsplus.png +file + + + + +2013-08-27T23:55:47.000000Z +9cde979bfa1742027688d14abf41e719 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6200 + +menu_ignore_caches_disabled.png +file + + + + +2013-08-27T23:55:47.000000Z +8caf1ad316bcc8adc47154502dd06fe5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3325 + +device_selection.png +file + + + + +2013-08-27T23:55:47.000000Z +c0e5d5d05780cdcbb062c148278cea0c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7516 + +menu_video_info.png +file + + + + +2013-08-27T23:55:47.000000Z +7e0944168f8a343f29f010f248256dd8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3280 + +menu_memory_info.png +file + + + + +2013-08-27T23:55:47.000000Z +9b510e0c9c45dd045599f81fb094f442 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3099 + +theme.plist +file + + + + +2013-08-27T23:55:47.000000Z +6663f6062e0b5be8e00901e425d46770 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2710 + +menu_selection.png +file + + + + +2013-08-27T23:55:47.000000Z +2f5e31c374916fe3a480162e7ea82ecd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2976 + +device_scroll_next.png +file + + + + +2013-08-27T23:55:47.000000Z +deb80699cad5bb9850e7925b3e005636 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3004 + +menu_help.png +file + + + + +2013-08-27T23:55:47.000000Z +a99d0202f49b0d1c8d138e82a178fb06 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3309 + +background.png +file + + + + +2013-08-27T23:55:47.000000Z +72e8ca42831fd0e2f47e7960ea7a6c53 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +966 + +device_cdrom.png +file + + + + +2013-08-27T23:55:47.000000Z +b60d9e4a53df7e6d9e335df92fc4ba4a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +5942 + +progress_bar_background.png +file + + + + +2013-08-27T23:55:47.000000Z +cc8df636e78810ac784df30ef5823ddd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2803 + +progress_bar.png +file + + + + +2013-08-27T23:55:47.000000Z +125097d030896ad12f7ef2e5976465fd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2805 + +menu_verbose.png +file + + + + +2013-08-27T23:55:47.000000Z +356dfe600ef2e9984cc8e8d343a54486 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3265 + +device_generic.png +file + + + + +2013-08-27T23:55:47.000000Z +514fbe2345408d11371c8eb4e789b7f6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +5585 + diff --git a/artwork/themes/bullet/.svn/prop-base/background.png.svn-base b/artwork/themes/bullet/.svn/prop-base/background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/boot.png.svn-base b/artwork/themes/bullet/.svn/prop-base/boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_cdrom.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_cdrom.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_ext3.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_ext3.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_ext3.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_fat16.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_fat16.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_fat16.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_fat32.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_fat32.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_fat32.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_generic.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_generic.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_generic.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_hfsplus.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_hfsplus.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_ntfs.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_ntfs.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_scroll_next.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_scroll_prev.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/device_selection.png.svn-base b/artwork/themes/bullet/.svn/prop-base/device_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/device_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/font_console.png.svn-base b/artwork/themes/bullet/.svn/prop-base/font_console.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/font_console.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/font_small.png.svn-base b/artwork/themes/bullet/.svn/prop-base/font_small.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/font_small.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/logo.png.svn-base b/artwork/themes/bullet/.svn/prop-base/logo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/logo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_boot.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_help.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_help.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_help.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_ignore_caches.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_ignore_caches.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_memory_info.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_memory_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_selection.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_single_user.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_single_user.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_single_user_disabled.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_single_user_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_verbose.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_verbose.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_verbose_disabled.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_verbose_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/menu_video_info.png.svn-base b/artwork/themes/bullet/.svn/prop-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/menu_video_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/progress_bar.png.svn-base b/artwork/themes/bullet/.svn/prop-base/progress_bar.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/progress_bar.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/progress_bar_background.png.svn-base b/artwork/themes/bullet/.svn/prop-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/progress_bar_background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/text_scroll_next.png.svn-base b/artwork/themes/bullet/.svn/prop-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/text_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/prop-base/text_scroll_prev.png.svn-base b/artwork/themes/bullet/.svn/prop-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/bullet/.svn/prop-base/text_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/bullet/.svn/text-base/background.png.svn-base b/artwork/themes/bullet/.svn/text-base/background.png.svn-base new file mode 100644 index 0000000..20a2c3f Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/background.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/boot.png.svn-base b/artwork/themes/bullet/.svn/text-base/boot.png.svn-base new file mode 100644 index 0000000..2ab8454 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/boot.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_cdrom.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..933ca34 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_cdrom.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_ext3.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_ext3.png.svn-base new file mode 100644 index 0000000..a6f20cc Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_ext3.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_fat16.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_fat16.png.svn-base new file mode 100644 index 0000000..933ca34 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_fat16.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_fat32.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_fat32.png.svn-base new file mode 100644 index 0000000..77f1d4a Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_fat32.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_generic.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_generic.png.svn-base new file mode 100644 index 0000000..77f1d4a Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_generic.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_hfsplus.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..2ab8454 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_hfsplus.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_ntfs.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..db5332a Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_ntfs.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_scroll_next.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..d29dc12 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_scroll_next.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_scroll_prev.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..285d2c2 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_scroll_prev.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/device_selection.png.svn-base b/artwork/themes/bullet/.svn/text-base/device_selection.png.svn-base new file mode 100644 index 0000000..d5b4a7b Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/device_selection.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/font_console.png.svn-base b/artwork/themes/bullet/.svn/text-base/font_console.png.svn-base new file mode 100644 index 0000000..e3b265c Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/font_console.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/font_small.png.svn-base b/artwork/themes/bullet/.svn/text-base/font_small.png.svn-base new file mode 100644 index 0000000..ef9f55f Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/font_small.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/logo.png.svn-base b/artwork/themes/bullet/.svn/text-base/logo.png.svn-base new file mode 100644 index 0000000..4071645 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/logo.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_boot.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_boot.png.svn-base new file mode 100644 index 0000000..d844861 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_boot.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_help.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_help.png.svn-base new file mode 100644 index 0000000..797b12a Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_help.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_ignore_caches.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..160c19d Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_ignore_caches.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..3885001 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_ignore_caches_disabled.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_memory_info.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..c155825 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_memory_info.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_selection.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_selection.png.svn-base new file mode 100644 index 0000000..71fdfcc Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_selection.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_single_user.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..b41f9ec Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_single_user.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_single_user_disabled.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..3885001 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_single_user_disabled.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_verbose.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..3ecf55a Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_verbose.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_verbose_disabled.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..3885001 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_verbose_disabled.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/menu_video_info.png.svn-base b/artwork/themes/bullet/.svn/text-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..759e0d9 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/menu_video_info.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/progress_bar.png.svn-base b/artwork/themes/bullet/.svn/text-base/progress_bar.png.svn-base new file mode 100644 index 0000000..7c72d56 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/progress_bar.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/progress_bar_background.png.svn-base b/artwork/themes/bullet/.svn/text-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..12dfb20 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/progress_bar_background.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/text_scroll_next.png.svn-base b/artwork/themes/bullet/.svn/text-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..d249b6d Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/text_scroll_next.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/text_scroll_prev.png.svn-base b/artwork/themes/bullet/.svn/text-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..034af65 Binary files /dev/null and b/artwork/themes/bullet/.svn/text-base/text_scroll_prev.png.svn-base differ diff --git a/artwork/themes/bullet/.svn/text-base/theme.plist.svn-base b/artwork/themes/bullet/.svn/text-base/theme.plist.svn-base new file mode 100644 index 0000000..dbcc1a1 --- /dev/null +++ b/artwork/themes/bullet/.svn/text-base/theme.plist.svn-base @@ -0,0 +1,116 @@ + + + + + Enabled + yes + + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #aaaaaa + + background_pos_x + 50% + background_pos_y + 0 + + logo_pos_x + + logo_pos_y + 3% + logo_bgcolor + #aaaaaa + logo_transparency + 255 + + devices_pos_x + + devices_pos_y + + devices_bgcolor + #aaaaaa + devices_transparency + 0 + devices_max_visible + 5 + devices_iconspacing + 20 + devices_layout + horizontal + + bootprompt_pos_x + %50 + bootprompt_pos_y + -2 + bootprompt_width + 50% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #aaaaaa + bootprompt_transparency + 1 + + infobox_pos_x + + infobox_pos_y + + infobox_width + 650 + infobox_height + 406 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #aaaaaa + infobox_transparency + 10 + + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #aaaaaa + menu_transparency + 1 + + progressbar_pos_x + + progressbar_pos_y + -37% + progressbar_width + 100 + progressbar_height + 40 + + countdown_pos_x + + countdown_pos_y + -30% + + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #aaaaaa + + diff --git a/artwork/themes/bullet/background.png b/artwork/themes/bullet/background.png new file mode 100644 index 0000000..20a2c3f Binary files /dev/null and b/artwork/themes/bullet/background.png differ diff --git a/artwork/themes/bullet/boot.png b/artwork/themes/bullet/boot.png new file mode 100644 index 0000000..2ab8454 Binary files /dev/null and b/artwork/themes/bullet/boot.png differ diff --git a/artwork/themes/bullet/device_cdrom.png b/artwork/themes/bullet/device_cdrom.png new file mode 100644 index 0000000..933ca34 Binary files /dev/null and b/artwork/themes/bullet/device_cdrom.png differ diff --git a/artwork/themes/bullet/device_ext3.png b/artwork/themes/bullet/device_ext3.png new file mode 100644 index 0000000..a6f20cc Binary files /dev/null and b/artwork/themes/bullet/device_ext3.png differ diff --git a/artwork/themes/bullet/device_fat16.png b/artwork/themes/bullet/device_fat16.png new file mode 100644 index 0000000..933ca34 Binary files /dev/null and b/artwork/themes/bullet/device_fat16.png differ diff --git a/artwork/themes/bullet/device_fat32.png b/artwork/themes/bullet/device_fat32.png new file mode 100644 index 0000000..77f1d4a Binary files /dev/null and b/artwork/themes/bullet/device_fat32.png differ diff --git a/artwork/themes/bullet/device_generic.png b/artwork/themes/bullet/device_generic.png new file mode 100644 index 0000000..77f1d4a Binary files /dev/null and b/artwork/themes/bullet/device_generic.png differ diff --git a/artwork/themes/bullet/device_hfsplus.png b/artwork/themes/bullet/device_hfsplus.png new file mode 100644 index 0000000..2ab8454 Binary files /dev/null and b/artwork/themes/bullet/device_hfsplus.png differ diff --git a/artwork/themes/bullet/device_ntfs.png b/artwork/themes/bullet/device_ntfs.png new file mode 100644 index 0000000..db5332a Binary files /dev/null and b/artwork/themes/bullet/device_ntfs.png differ diff --git a/artwork/themes/bullet/device_scroll_next.png b/artwork/themes/bullet/device_scroll_next.png new file mode 100644 index 0000000..d29dc12 Binary files /dev/null and b/artwork/themes/bullet/device_scroll_next.png differ diff --git a/artwork/themes/bullet/device_scroll_prev.png b/artwork/themes/bullet/device_scroll_prev.png new file mode 100644 index 0000000..285d2c2 Binary files /dev/null and b/artwork/themes/bullet/device_scroll_prev.png differ diff --git a/artwork/themes/bullet/device_selection.png b/artwork/themes/bullet/device_selection.png new file mode 100644 index 0000000..d5b4a7b Binary files /dev/null and b/artwork/themes/bullet/device_selection.png differ diff --git a/artwork/themes/bullet/font_console.png b/artwork/themes/bullet/font_console.png new file mode 100644 index 0000000..e3b265c Binary files /dev/null and b/artwork/themes/bullet/font_console.png differ diff --git a/artwork/themes/bullet/font_small.png b/artwork/themes/bullet/font_small.png new file mode 100644 index 0000000..ef9f55f Binary files /dev/null and b/artwork/themes/bullet/font_small.png differ diff --git a/artwork/themes/bullet/logo.png b/artwork/themes/bullet/logo.png new file mode 100644 index 0000000..4071645 Binary files /dev/null and b/artwork/themes/bullet/logo.png differ diff --git a/artwork/themes/bullet/menu_boot.png b/artwork/themes/bullet/menu_boot.png new file mode 100644 index 0000000..d844861 Binary files /dev/null and b/artwork/themes/bullet/menu_boot.png differ diff --git a/artwork/themes/bullet/menu_help.png b/artwork/themes/bullet/menu_help.png new file mode 100644 index 0000000..797b12a Binary files /dev/null and b/artwork/themes/bullet/menu_help.png differ diff --git a/artwork/themes/bullet/menu_ignore_caches.png b/artwork/themes/bullet/menu_ignore_caches.png new file mode 100644 index 0000000..160c19d Binary files /dev/null and b/artwork/themes/bullet/menu_ignore_caches.png differ diff --git a/artwork/themes/bullet/menu_ignore_caches_disabled.png b/artwork/themes/bullet/menu_ignore_caches_disabled.png new file mode 100644 index 0000000..3885001 Binary files /dev/null and b/artwork/themes/bullet/menu_ignore_caches_disabled.png differ diff --git a/artwork/themes/bullet/menu_memory_info.png b/artwork/themes/bullet/menu_memory_info.png new file mode 100644 index 0000000..c155825 Binary files /dev/null and b/artwork/themes/bullet/menu_memory_info.png differ diff --git a/artwork/themes/bullet/menu_selection.png b/artwork/themes/bullet/menu_selection.png new file mode 100644 index 0000000..71fdfcc Binary files /dev/null and b/artwork/themes/bullet/menu_selection.png differ diff --git a/artwork/themes/bullet/menu_single_user.png b/artwork/themes/bullet/menu_single_user.png new file mode 100644 index 0000000..b41f9ec Binary files /dev/null and b/artwork/themes/bullet/menu_single_user.png differ diff --git a/artwork/themes/bullet/menu_single_user_disabled.png b/artwork/themes/bullet/menu_single_user_disabled.png new file mode 100644 index 0000000..3885001 Binary files /dev/null and b/artwork/themes/bullet/menu_single_user_disabled.png differ diff --git a/artwork/themes/bullet/menu_verbose.png b/artwork/themes/bullet/menu_verbose.png new file mode 100644 index 0000000..3ecf55a Binary files /dev/null and b/artwork/themes/bullet/menu_verbose.png differ diff --git a/artwork/themes/bullet/menu_verbose_disabled.png b/artwork/themes/bullet/menu_verbose_disabled.png new file mode 100644 index 0000000..3885001 Binary files /dev/null and b/artwork/themes/bullet/menu_verbose_disabled.png differ diff --git a/artwork/themes/bullet/menu_video_info.png b/artwork/themes/bullet/menu_video_info.png new file mode 100644 index 0000000..759e0d9 Binary files /dev/null and b/artwork/themes/bullet/menu_video_info.png differ diff --git a/artwork/themes/bullet/progress_bar.png b/artwork/themes/bullet/progress_bar.png new file mode 100644 index 0000000..7c72d56 Binary files /dev/null and b/artwork/themes/bullet/progress_bar.png differ diff --git a/artwork/themes/bullet/progress_bar_background.png b/artwork/themes/bullet/progress_bar_background.png new file mode 100644 index 0000000..12dfb20 Binary files /dev/null and b/artwork/themes/bullet/progress_bar_background.png differ diff --git a/artwork/themes/bullet/text_scroll_next.png b/artwork/themes/bullet/text_scroll_next.png new file mode 100644 index 0000000..d249b6d Binary files /dev/null and b/artwork/themes/bullet/text_scroll_next.png differ diff --git a/artwork/themes/bullet/text_scroll_prev.png b/artwork/themes/bullet/text_scroll_prev.png new file mode 100644 index 0000000..034af65 Binary files /dev/null and b/artwork/themes/bullet/text_scroll_prev.png differ diff --git a/artwork/themes/bullet/theme.plist b/artwork/themes/bullet/theme.plist new file mode 100644 index 0000000..dbcc1a1 --- /dev/null +++ b/artwork/themes/bullet/theme.plist @@ -0,0 +1,116 @@ + + + + + Enabled + yes + + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #aaaaaa + + background_pos_x + 50% + background_pos_y + 0 + + logo_pos_x + + logo_pos_y + 3% + logo_bgcolor + #aaaaaa + logo_transparency + 255 + + devices_pos_x + + devices_pos_y + + devices_bgcolor + #aaaaaa + devices_transparency + 0 + devices_max_visible + 5 + devices_iconspacing + 20 + devices_layout + horizontal + + bootprompt_pos_x + %50 + bootprompt_pos_y + -2 + bootprompt_width + 50% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #aaaaaa + bootprompt_transparency + 1 + + infobox_pos_x + + infobox_pos_y + + infobox_width + 650 + infobox_height + 406 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #aaaaaa + infobox_transparency + 10 + + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #aaaaaa + menu_transparency + 1 + + progressbar_pos_x + + progressbar_pos_y + -37% + progressbar_width + 100 + progressbar_height + 40 + + countdown_pos_x + + countdown_pos_y + -30% + + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #aaaaaa + + diff --git a/artwork/themes/default/.svn/all-wcprops b/artwork/themes/default/.svn/all-wcprops new file mode 100644 index 0000000..267bbd9 --- /dev/null +++ b/artwork/themes/default/.svn/all-wcprops @@ -0,0 +1,431 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default +END +device_befs.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_befs.png +END +text_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/text_scroll_prev.png +END +device_hfsraid.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid.png +END +device_hfsplus_sl.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_sl.png +END +device_ext3.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_ext3.png +END +device_hfsplus_leo.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_leo.png +END +menu_single_user.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_single_user.png +END +boot.png +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/boot.png +END +device_ntfs_o.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_ntfs_o.png +END +device_openbsd.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_openbsd.png +END +device_hfsraid_sl_o.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_sl_o.png +END +menu_ignore_caches.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_ignore_caches.png +END +device_hfsraid_mav_o.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default/device_hfsraid_mav_o.png +END +menu_boot.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_boot.png +END +device_hfsraid_ml.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_ml.png +END +device_hfsraid_tiger.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_tiger.png +END +device_freebsd.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_freebsd.png +END +device_fat.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_fat.png +END +menu_single_user_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_single_user_disabled.png +END +font_small.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/font_small.png +END +device_hfsraid_lion_o.png +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_lion_o.png +END +device_cdrom_o.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_cdrom_o.png +END +device_hfsraid_mav.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default/device_hfsraid_mav.png +END +device_hfsplus.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus.png +END +menu_video_info.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_video_info.png +END +device_generic_o.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_generic_o.png +END +device_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_scroll_next.png +END +device_hfsraid_o.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_o.png +END +background.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/background.png +END +device_hfsplus_sl_o.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_sl_o.png +END +device_hfsraid_lion.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_lion.png +END +device_hfsplus_mav_o.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default/device_hfsplus_mav_o.png +END +device_openbsd_o.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_openbsd_o.png +END +progress_bar_background.png +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/progress_bar_background.png +END +device_hfsplus_ml.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_ml.png +END +device_hfsplus_tiger.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_tiger.png +END +logo.png +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/logo.png +END +device_hfsplus_lion_o.png +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_lion_o.png +END +device_hfsraid_ml_o.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_ml_o.png +END +device_hfsplus_mav.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default/device_hfsplus_mav.png +END +device_hfsraid_tiger_o.png +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_tiger_o.png +END +device_freebsd_o.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_freebsd_o.png +END +device_fat_o.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_fat_o.png +END +device_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_scroll_prev.png +END +device_hfsraid_leo_o.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_leo_o.png +END +menu_verbose_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_verbose_disabled.png +END +device_hfsplus_o.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_o.png +END +device_hfsplus_lion.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_lion.png +END +font_console.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/font_console.png +END +device_ntfs.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_ntfs.png +END +device_hfsraid_sl.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_sl.png +END +device_hfsraid_leo.png +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsraid_leo.png +END +text_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/text_scroll_next.png +END +menu_ignore_caches_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_ignore_caches_disabled.png +END +device_selection.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_selection.png +END +device_hfsfusion_mav_o.png +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default/device_hfsfusion_mav_o.png +END +menu_memory_info.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_memory_info.png +END +menu_selection.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_selection.png +END +device_hfsplus_ml_o.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_ml_o.png +END +theme.plist +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/theme.plist +END +device_hfsplus_tiger_o.png +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_tiger_o.png +END +menu_help.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_help.png +END +device_befs_o.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_befs_o.png +END +thumb.png +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/thumb.png +END +device_ext3_o.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_ext3_o.png +END +device_hfsplus_leo_o.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_hfsplus_leo_o.png +END +device_cdrom.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_cdrom.png +END +device_hfsfusion_mav.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2249/branches/Chimera/artwork/themes/default/device_hfsfusion_mav.png +END +progress_bar.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/progress_bar.png +END +menu_verbose.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/menu_verbose.png +END +device_generic.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/default/device_generic.png +END diff --git a/artwork/themes/default/.svn/entries b/artwork/themes/default/.svn/entries new file mode 100644 index 0000000..6ae1d1f --- /dev/null +++ b/artwork/themes/default/.svn/entries @@ -0,0 +1,2442 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/artwork/themes/default +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +device_befs.png +file + + + + +2013-08-27T23:55:39.000000Z +35923165edd28f9fd86c997eb0679d67 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +27817 + +text_scroll_prev.png +file + + + + +2013-08-27T23:55:39.000000Z +29bc5b19ceb6effcec59f7c197c172fe +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +562 + +device_hfsraid.png +file + + + + +2013-08-27T23:55:39.000000Z +c5fd84b4fff68a6b2802530708c1a87e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33806 + +device_hfsplus_sl.png +file + + + + +2013-08-27T23:55:39.000000Z +d65b9756d4a88f14d84de0af0c67a74a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29902 + +device_ext3.png +file + + + + +2013-08-27T23:55:39.000000Z +0e21d23cc9a831087f58433793dfcefc +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33010 + +device_hfsplus_leo.png +file + + + + +2013-08-27T23:55:39.000000Z +a21f843f902aa0b01c456381507ce87e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28892 + +menu_single_user.png +file + + + + +2013-08-27T23:55:39.000000Z +c8169de77f69cec3184b52fa223b5513 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +137 + +boot.png +file + + + + +2013-08-27T23:55:39.000000Z +caeca06d2e978198ff71f39dbec71701 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6231 + +device_ntfs_o.png +file + + + + +2013-08-27T23:55:39.000000Z +f92aebb8ecc532d729d51d1a3393bb18 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +34992 + +device_openbsd.png +file + + + + +2013-08-27T23:55:39.000000Z +950666f173ab3ec922ce800606fac8e5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28850 + +device_hfsraid_sl_o.png +file + + + + +2013-08-27T23:55:39.000000Z +8d0cda2152fea310a14a1dc1cf2488f8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31378 + +menu_ignore_caches.png +file + + + + +2013-08-27T23:55:39.000000Z +c8169de77f69cec3184b52fa223b5513 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +137 + +device_hfsraid_mav_o.png +file + + + + +2013-08-27T23:55:39.000000Z +6aa23ca624cf3e61c962b9ba55fb11be +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +37530 + +menu_boot.png +file + + + + +2013-08-27T23:55:39.000000Z +c8169de77f69cec3184b52fa223b5513 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +137 + +device_hfsraid_ml.png +file + + + + +2013-08-27T23:55:39.000000Z +782d1d6862853c4e7bb10d588881db6d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +30436 + +device_hfsraid_tiger.png +file + + + + +2013-08-27T23:55:39.000000Z +bde80a4736810b44bd07fd0b231b8cb6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29104 + +device_freebsd.png +file + + + + +2013-08-27T23:55:39.000000Z +767d05bec8f3cf3c3e9b6f1062dc8f37 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +27264 + +device_fat.png +file + + + + +2013-08-27T23:55:39.000000Z +6a01ac35b1eea8a1c655cf325f7e9d6d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32113 + +menu_single_user_disabled.png +file + + + + +2013-08-27T23:55:39.000000Z +12607a49db2921550605a6c811504f2f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +135 + +font_small.png +file + + + + +2013-08-27T23:55:39.000000Z +a7bc6e9cd5fe19228bb1c3d442653e89 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3371 + +device_hfsraid_lion_o.png +file + + + + +2013-08-27T23:55:39.000000Z +cb9f7c13e2ae96e72174888c83c74a24 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29725 + +device_cdrom_o.png +file + + + + +2013-08-27T23:55:39.000000Z +26176e0d4e9d2146e4c2022a7217f4f6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31312 + +device_hfsraid_mav.png +file + + + + +2013-08-27T23:55:39.000000Z +b3d13ef60300145dad92c5d57406e823 +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +36575 + +device_hfsplus.png +file + + + + +2013-08-27T23:55:39.000000Z +a5a5330334a931e3e63f17ec2ee6d5be +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33224 + +menu_video_info.png +file + + + + +2013-08-27T23:55:39.000000Z +36a5204d5fc0d110ecd2f135fea564ce +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +136 + +device_generic_o.png +file + + + + +2013-08-27T23:55:39.000000Z +7551eb7bccdb1129e35b917b5a10a263 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31641 + +device_scroll_next.png +file + + + + +2013-08-27T23:55:39.000000Z +bfd34a6daa42b34b3607a2ca1d109c8e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3898 + +device_hfsraid_o.png +file + + + + +2013-08-27T23:55:39.000000Z +a78d95fbc45a226bbb7d3fb5ae2dcf46 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +34633 + +background.png +file + + + + +2013-08-27T23:55:39.000000Z +fbb57766f4f45c8fc10797fa6611e0d8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +160 + +device_hfsplus_sl_o.png +file + + + + +2013-08-27T23:55:39.000000Z +d6e72afa823cd87cc56be421249a8830 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +30684 + +device_hfsraid_lion.png +file + + + + +2013-08-27T23:55:39.000000Z +a26ad58957b467659bee98dc2b3e3199 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28949 + +device_hfsplus_mav_o.png +file + + + + +2013-08-27T23:55:39.000000Z +871998e32a067328cfb56b619f312627 +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +36996 + +device_openbsd_o.png +file + + + + +2013-08-27T23:55:39.000000Z +2b52f2a945524c7cad3e870caee6bcdd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29596 + +progress_bar_background.png +file + + + + +2013-08-27T23:55:39.000000Z +d22cbd5aa26545c085c53fd42aa11e08 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +139 + +device_hfsplus_ml.png +file + + + + +2013-08-27T23:55:39.000000Z +ccf517d006c5e36c494e0b464a24b49a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29768 + +device_hfsplus_tiger.png +file + + + + +2013-08-27T23:55:39.000000Z +70a13912c9cea1a62e8e4f7d04436cb2 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28400 + +logo.png +file + + + + +2013-08-27T23:55:39.000000Z +2d87089df2185fbe9ad4dbbd7c9257dd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +9791 + +device_hfsplus_lion_o.png +file + + + + +2013-08-27T23:55:39.000000Z +63a4399c7b5b008bd759cf9da8613556 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28963 + +device_hfsraid_ml_o.png +file + + + + +2013-08-27T23:55:39.000000Z +dbce8c3159d695fabf48692206f72e69 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31257 + +device_hfsplus_mav.png +file + + + + +2013-08-27T23:55:39.000000Z +d87aef60bdbe4f27bdfc25d8a9e1fb1a +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +36079 + +device_hfsraid_tiger_o.png +file + + + + +2013-08-27T23:55:39.000000Z +f7f7ac8e8f81b192d7911cdd3b2a882f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29917 + +device_freebsd_o.png +file + + + + +2013-08-27T23:55:39.000000Z +04fbcd6eb5205609e8063b642b7d9214 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28018 + +device_fat_o.png +file + + + + +2013-08-27T23:55:39.000000Z +1989db35033b55b9768eb0c7c367bcbd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33007 + +device_scroll_prev.png +file + + + + +2013-08-27T23:55:39.000000Z +04bc5e7114644b2ec05e8cbb88763d4f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3995 + +device_hfsraid_leo_o.png +file + + + + +2013-08-27T23:55:39.000000Z +28563817ce40463665e99d41bcddcdc0 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +30429 + +menu_verbose_disabled.png +file + + + + +2013-08-27T23:55:39.000000Z +12607a49db2921550605a6c811504f2f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +135 + +device_hfsplus_o.png +file + + + + +2013-08-27T23:55:39.000000Z +5be943e37e80d9e6380517464ef5e91d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +34030 + +device_hfsplus_lion.png +file + + + + +2013-08-27T23:55:39.000000Z +8d9a8298bf48114fc8a10252197bb710 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28223 + +font_console.png +file + + + + +2013-08-27T23:55:39.000000Z +95a5b599d7ecf308f747fb2ecce4203d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2931 + +device_ntfs.png +file + + + + +2013-08-27T23:55:39.000000Z +9a2952c50f6fc07314368bdc6fa4d798 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +34190 + +device_hfsraid_sl.png +file + + + + +2013-08-27T23:55:39.000000Z +4257d77842a1c75a5edce33d4dac0e2d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +30605 + +device_hfsraid_leo.png +file + + + + +2013-08-27T23:55:39.000000Z +36775664cfa422d0b642dbb2d0e0acf8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29649 + +text_scroll_next.png +file + + + + +2013-08-27T23:55:39.000000Z +9a071516c1a05677fa76d00fa6f2edfb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +557 + +menu_ignore_caches_disabled.png +file + + + + +2013-08-27T23:55:39.000000Z +12607a49db2921550605a6c811504f2f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +135 + +device_selection.png +file + + + + +2013-08-27T23:55:39.000000Z +3a07b37ce4b99bdce3c7963a06195de7 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +148 + +device_hfsfusion_mav_o.png +file + + + + +2013-08-27T23:55:39.000000Z +90a45f561e81fed92dfad257b38ada95 +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +37713 + +menu_memory_info.png +file + + + + +2013-08-27T23:55:39.000000Z +36a5204d5fc0d110ecd2f135fea564ce +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +136 + +menu_selection.png +file + + + + +2013-08-27T23:55:39.000000Z +75a61def630b6eb13037504a2f80d5d8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +158 + +device_hfsplus_ml_o.png +file + + + + +2013-08-27T23:55:39.000000Z +84fdcdc62b6148efdcea7483839200ad +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +30578 + +theme.plist +file + + + + +2013-08-27T23:55:39.000000Z +1c0cce0bb5c5c02ef2ec810972e427e1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2787 + +device_hfsplus_tiger_o.png +file + + + + +2013-08-27T23:55:39.000000Z +fe002cf2f8658ad968fe54d35e1ace11 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29157 + +menu_help.png +file + + + + +2013-08-27T23:55:39.000000Z +36a5204d5fc0d110ecd2f135fea564ce +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +136 + +device_befs_o.png +file + + + + +2013-08-27T23:55:39.000000Z +25e08a8b6f7c1f5273bb289f14989bde +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28529 + +thumb.png +file + + + + +2013-08-27T23:55:39.000000Z +dc6725380470a91fca9b18b71364f06a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +17757 + +device_ext3_o.png +file + + + + +2013-08-27T23:55:39.000000Z +39e1e4b9adfbcb4e684b92e3478bbe93 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33943 + +device_hfsplus_leo_o.png +file + + + + +2013-08-27T23:55:39.000000Z +1067d68c73da44914d7218c57a61b909 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +29666 + +device_cdrom.png +file + + + + +2013-08-27T23:55:39.000000Z +510aff84b41d68fa7e6cc7994f078b88 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31453 + +device_hfsfusion_mav.png +file + + + + +2013-08-27T23:55:39.000000Z +66bc2cfac7b799ddc90b14156a58f97a +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +36800 + +progress_bar.png +file + + + + +2013-08-27T23:55:39.000000Z +0d06e6f58599847925098e92f91b5d07 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +292 + +menu_verbose.png +file + + + + +2013-08-27T23:55:39.000000Z +c8169de77f69cec3184b52fa223b5513 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +137 + +device_generic.png +file + + + + +2013-08-27T23:55:39.000000Z +9e4ddc5c76af9965c15d012639226a75 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +30749 + diff --git a/artwork/themes/default/.svn/prop-base/background.png.svn-base b/artwork/themes/default/.svn/prop-base/background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/boot.png.svn-base b/artwork/themes/default/.svn/prop-base/boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_befs.png.svn-base b/artwork/themes/default/.svn/prop-base/device_befs.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_befs.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_befs_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_befs_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_befs_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_cdrom.png.svn-base b/artwork/themes/default/.svn/prop-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_cdrom.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_cdrom_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_cdrom_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_cdrom_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_ext3.png.svn-base b/artwork/themes/default/.svn/prop-base/device_ext3.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_ext3.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_ext3_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_ext3_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_ext3_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_fat.png.svn-base b/artwork/themes/default/.svn/prop-base/device_fat.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_fat.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_fat_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_fat_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_fat_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_freebsd.png.svn-base b/artwork/themes/default/.svn/prop-base/device_freebsd.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_freebsd.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_freebsd_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_freebsd_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_freebsd_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_generic.png.svn-base b/artwork/themes/default/.svn/prop-base/device_generic.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_generic.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_generic_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_generic_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_generic_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsfusion_mav.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsfusion_mav.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsfusion_mav.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsfusion_mav_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsfusion_mav_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsfusion_mav_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_leo.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_leo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_leo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_leo_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_leo_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_leo_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_lion.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_lion.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_lion.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_lion_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_lion_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_lion_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_mav.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_mav.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_mav.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_mav_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_mav_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_mav_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_ml.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_ml.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_ml.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_ml_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_ml_o.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_ml_o.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_sl.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_sl.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_sl.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_sl_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_sl_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_sl_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_tiger.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_tiger.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_tiger.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsplus_tiger_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsplus_tiger_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsplus_tiger_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_leo.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_leo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_leo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_leo_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_leo_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_leo_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_lion.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_lion.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_lion.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_lion_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_lion_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_lion_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_mav.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_mav.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_mav.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_mav_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_mav_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_mav_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_ml.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_ml.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_ml.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_ml_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_ml_o.png.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_ml_o.png.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_sl.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_sl.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_sl.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_sl_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_sl_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_sl_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_tiger.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_tiger.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_tiger.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_hfsraid_tiger_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_hfsraid_tiger_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_hfsraid_tiger_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_ntfs.png.svn-base b/artwork/themes/default/.svn/prop-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_ntfs.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_ntfs_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_ntfs_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_ntfs_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_openbsd.png.svn-base b/artwork/themes/default/.svn/prop-base/device_openbsd.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_openbsd.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_openbsd_o.png.svn-base b/artwork/themes/default/.svn/prop-base/device_openbsd_o.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_openbsd_o.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_scroll_next.png.svn-base b/artwork/themes/default/.svn/prop-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_scroll_prev.png.svn-base b/artwork/themes/default/.svn/prop-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/device_selection.png.svn-base b/artwork/themes/default/.svn/prop-base/device_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/device_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/font_console.png.svn-base b/artwork/themes/default/.svn/prop-base/font_console.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/font_console.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/font_small.png.svn-base b/artwork/themes/default/.svn/prop-base/font_small.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/font_small.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/logo.png.svn-base b/artwork/themes/default/.svn/prop-base/logo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/logo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_boot.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_help.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_help.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_help.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_ignore_caches.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_ignore_caches.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_memory_info.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_memory_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_selection.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_single_user.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_single_user.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_single_user_disabled.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_single_user_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_verbose.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_verbose.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_verbose_disabled.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_verbose_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/menu_video_info.png.svn-base b/artwork/themes/default/.svn/prop-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/menu_video_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/progress_bar.png.svn-base b/artwork/themes/default/.svn/prop-base/progress_bar.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/progress_bar.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/progress_bar_background.png.svn-base b/artwork/themes/default/.svn/prop-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/progress_bar_background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/text_scroll_next.png.svn-base b/artwork/themes/default/.svn/prop-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/text_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/text_scroll_prev.png.svn-base b/artwork/themes/default/.svn/prop-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/text_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/prop-base/thumb.png.svn-base b/artwork/themes/default/.svn/prop-base/thumb.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/default/.svn/prop-base/thumb.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/default/.svn/text-base/background.png.svn-base b/artwork/themes/default/.svn/text-base/background.png.svn-base new file mode 100644 index 0000000..3c273b6 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/background.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/boot.png.svn-base b/artwork/themes/default/.svn/text-base/boot.png.svn-base new file mode 100644 index 0000000..68b34af Binary files /dev/null and b/artwork/themes/default/.svn/text-base/boot.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_befs.png.svn-base b/artwork/themes/default/.svn/text-base/device_befs.png.svn-base new file mode 100644 index 0000000..adda95c Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_befs.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_befs_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_befs_o.png.svn-base new file mode 100644 index 0000000..d83fa89 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_befs_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_cdrom.png.svn-base b/artwork/themes/default/.svn/text-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..2b3e0e1 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_cdrom.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_cdrom_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_cdrom_o.png.svn-base new file mode 100644 index 0000000..bec8c34 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_cdrom_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_ext3.png.svn-base b/artwork/themes/default/.svn/text-base/device_ext3.png.svn-base new file mode 100644 index 0000000..b31d234 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_ext3.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_ext3_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_ext3_o.png.svn-base new file mode 100644 index 0000000..c1775b0 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_ext3_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_fat.png.svn-base b/artwork/themes/default/.svn/text-base/device_fat.png.svn-base new file mode 100644 index 0000000..80c5922 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_fat.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_fat_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_fat_o.png.svn-base new file mode 100644 index 0000000..817a15f Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_fat_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_freebsd.png.svn-base b/artwork/themes/default/.svn/text-base/device_freebsd.png.svn-base new file mode 100644 index 0000000..f5796dc Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_freebsd.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_freebsd_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_freebsd_o.png.svn-base new file mode 100644 index 0000000..dab4fb7 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_freebsd_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_generic.png.svn-base b/artwork/themes/default/.svn/text-base/device_generic.png.svn-base new file mode 100644 index 0000000..1ca9d15 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_generic.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_generic_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_generic_o.png.svn-base new file mode 100644 index 0000000..3df9977 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_generic_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsfusion_mav.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsfusion_mav.png.svn-base new file mode 100644 index 0000000..efe6414 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsfusion_mav.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsfusion_mav_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsfusion_mav_o.png.svn-base new file mode 100644 index 0000000..f5301e0 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsfusion_mav_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..010b64c Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_leo.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_leo.png.svn-base new file mode 100644 index 0000000..daf029d Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_leo.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_leo_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_leo_o.png.svn-base new file mode 100644 index 0000000..438e94e Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_leo_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_lion.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_lion.png.svn-base new file mode 100644 index 0000000..873dae2 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_lion.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_lion_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_lion_o.png.svn-base new file mode 100644 index 0000000..88ca17d Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_lion_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_mav.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_mav.png.svn-base new file mode 100644 index 0000000..b773f18 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_mav.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_mav_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_mav_o.png.svn-base new file mode 100644 index 0000000..6667950 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_mav_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_ml.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_ml.png.svn-base new file mode 100644 index 0000000..25eb4a7 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_ml.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_ml_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_ml_o.png.svn-base new file mode 100644 index 0000000..9119bf6 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_ml_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_o.png.svn-base new file mode 100644 index 0000000..c4f6d18 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_sl.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_sl.png.svn-base new file mode 100644 index 0000000..f45c1ea Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_sl.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_sl_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_sl_o.png.svn-base new file mode 100644 index 0000000..f370017 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_sl_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_tiger.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_tiger.png.svn-base new file mode 100644 index 0000000..02605cc Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_tiger.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsplus_tiger_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsplus_tiger_o.png.svn-base new file mode 100644 index 0000000..a43bc88 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsplus_tiger_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid.png.svn-base new file mode 100644 index 0000000..2283de5 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_leo.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_leo.png.svn-base new file mode 100644 index 0000000..8c986c3 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_leo.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_leo_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_leo_o.png.svn-base new file mode 100644 index 0000000..4d688eb Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_leo_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_lion.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_lion.png.svn-base new file mode 100644 index 0000000..8641e63 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_lion.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_lion_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_lion_o.png.svn-base new file mode 100644 index 0000000..b07f0f5 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_lion_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_mav.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_mav.png.svn-base new file mode 100644 index 0000000..6577e8b Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_mav.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_mav_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_mav_o.png.svn-base new file mode 100644 index 0000000..1f72ec9 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_mav_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_ml.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_ml.png.svn-base new file mode 100644 index 0000000..3555222 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_ml.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_ml_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_ml_o.png.svn-base new file mode 100644 index 0000000..0e08f74 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_ml_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_o.png.svn-base new file mode 100644 index 0000000..dcbc2b7 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_sl.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_sl.png.svn-base new file mode 100644 index 0000000..618b91b Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_sl.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_sl_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_sl_o.png.svn-base new file mode 100644 index 0000000..7560b1d Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_sl_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_tiger.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_tiger.png.svn-base new file mode 100644 index 0000000..ccafd53 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_tiger.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_hfsraid_tiger_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_hfsraid_tiger_o.png.svn-base new file mode 100644 index 0000000..e3f2da9 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_hfsraid_tiger_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_ntfs.png.svn-base b/artwork/themes/default/.svn/text-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..c51555c Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_ntfs.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_ntfs_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_ntfs_o.png.svn-base new file mode 100644 index 0000000..d9125a3 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_ntfs_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_openbsd.png.svn-base b/artwork/themes/default/.svn/text-base/device_openbsd.png.svn-base new file mode 100644 index 0000000..6c0851c Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_openbsd.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_openbsd_o.png.svn-base b/artwork/themes/default/.svn/text-base/device_openbsd_o.png.svn-base new file mode 100644 index 0000000..425f791 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_openbsd_o.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_scroll_next.png.svn-base b/artwork/themes/default/.svn/text-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..cba70b7 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_scroll_next.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_scroll_prev.png.svn-base b/artwork/themes/default/.svn/text-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..6fafc58 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_scroll_prev.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/device_selection.png.svn-base b/artwork/themes/default/.svn/text-base/device_selection.png.svn-base new file mode 100644 index 0000000..6ecd188 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/device_selection.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/font_console.png.svn-base b/artwork/themes/default/.svn/text-base/font_console.png.svn-base new file mode 100644 index 0000000..3619154 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/font_console.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/font_small.png.svn-base b/artwork/themes/default/.svn/text-base/font_small.png.svn-base new file mode 100644 index 0000000..0c43412 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/font_small.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/logo.png.svn-base b/artwork/themes/default/.svn/text-base/logo.png.svn-base new file mode 100644 index 0000000..9795758 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/logo.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_boot.png.svn-base b/artwork/themes/default/.svn/text-base/menu_boot.png.svn-base new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_boot.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_help.png.svn-base b/artwork/themes/default/.svn/text-base/menu_help.png.svn-base new file mode 100644 index 0000000..0584c22 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_help.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_ignore_caches.png.svn-base b/artwork/themes/default/.svn/text-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_ignore_caches.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/default/.svn/text-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..a1977f9 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_ignore_caches_disabled.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_memory_info.png.svn-base b/artwork/themes/default/.svn/text-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..0584c22 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_memory_info.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_selection.png.svn-base b/artwork/themes/default/.svn/text-base/menu_selection.png.svn-base new file mode 100644 index 0000000..348b48e Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_selection.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_single_user.png.svn-base b/artwork/themes/default/.svn/text-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_single_user.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_single_user_disabled.png.svn-base b/artwork/themes/default/.svn/text-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..a1977f9 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_single_user_disabled.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_verbose.png.svn-base b/artwork/themes/default/.svn/text-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_verbose.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_verbose_disabled.png.svn-base b/artwork/themes/default/.svn/text-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..a1977f9 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_verbose_disabled.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/menu_video_info.png.svn-base b/artwork/themes/default/.svn/text-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..0584c22 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/menu_video_info.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/progress_bar.png.svn-base b/artwork/themes/default/.svn/text-base/progress_bar.png.svn-base new file mode 100644 index 0000000..b2bca38 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/progress_bar.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/progress_bar_background.png.svn-base b/artwork/themes/default/.svn/text-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..70abf8b Binary files /dev/null and b/artwork/themes/default/.svn/text-base/progress_bar_background.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/text_scroll_next.png.svn-base b/artwork/themes/default/.svn/text-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..7fc1d0d Binary files /dev/null and b/artwork/themes/default/.svn/text-base/text_scroll_next.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/text_scroll_prev.png.svn-base b/artwork/themes/default/.svn/text-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..df92cf1 Binary files /dev/null and b/artwork/themes/default/.svn/text-base/text_scroll_prev.png.svn-base differ diff --git a/artwork/themes/default/.svn/text-base/theme.plist.svn-base b/artwork/themes/default/.svn/text-base/theme.plist.svn-base new file mode 100644 index 0000000..bfea899 --- /dev/null +++ b/artwork/themes/default/.svn/text-base/theme.plist.svn-base @@ -0,0 +1,110 @@ + + + + + Author + Blackosx + Version + 1.1 + Enabled + no + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #767f73 + background_pos_x + 50% + background_pos_y + 0 + logo_pos_x + + logo_pos_y + 5% + logo_bgcolor + #000000 + logo_transparency + 255 + devices_pos_x + + devices_pos_y + + devices_bgcolor + #767f73 + devices_transparency + 0 + devices_max_visible + 4 + devices_iconspacing + 45 + devices_layout + horizontal + bootprompt_pos_x + + bootprompt_pos_y + -6 + bootprompt_width + 40% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #3e3e3e + bootprompt_transparency + 1 + infobox_pos_x + + infobox_pos_y + 30% + infobox_width + 660 + infobox_height + 320 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #3e3e3e + infobox_transparency + 35 + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #3e3e3e + menu_transparency + 1 + progressbar_pos_x + + progressbar_pos_y + -30% + progressbar_width + 100 + progressbar_height + 40 + countdown_pos_x + + countdown_pos_y + -20% + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #AAAAAA + + diff --git a/artwork/themes/default/.svn/text-base/thumb.png.svn-base b/artwork/themes/default/.svn/text-base/thumb.png.svn-base new file mode 100644 index 0000000..66c8dfd Binary files /dev/null and b/artwork/themes/default/.svn/text-base/thumb.png.svn-base differ diff --git a/artwork/themes/default/background.png b/artwork/themes/default/background.png new file mode 100644 index 0000000..3c273b6 Binary files /dev/null and b/artwork/themes/default/background.png differ diff --git a/artwork/themes/default/boot.png b/artwork/themes/default/boot.png new file mode 100644 index 0000000..68b34af Binary files /dev/null and b/artwork/themes/default/boot.png differ diff --git a/artwork/themes/default/device_befs.png b/artwork/themes/default/device_befs.png new file mode 100644 index 0000000..adda95c Binary files /dev/null and b/artwork/themes/default/device_befs.png differ diff --git a/artwork/themes/default/device_befs_o.png b/artwork/themes/default/device_befs_o.png new file mode 100644 index 0000000..d83fa89 Binary files /dev/null and b/artwork/themes/default/device_befs_o.png differ diff --git a/artwork/themes/default/device_cdrom.png b/artwork/themes/default/device_cdrom.png new file mode 100644 index 0000000..2b3e0e1 Binary files /dev/null and b/artwork/themes/default/device_cdrom.png differ diff --git a/artwork/themes/default/device_cdrom_o.png b/artwork/themes/default/device_cdrom_o.png new file mode 100644 index 0000000..bec8c34 Binary files /dev/null and b/artwork/themes/default/device_cdrom_o.png differ diff --git a/artwork/themes/default/device_ext3.png b/artwork/themes/default/device_ext3.png new file mode 100644 index 0000000..b31d234 Binary files /dev/null and b/artwork/themes/default/device_ext3.png differ diff --git a/artwork/themes/default/device_ext3_o.png b/artwork/themes/default/device_ext3_o.png new file mode 100644 index 0000000..c1775b0 Binary files /dev/null and b/artwork/themes/default/device_ext3_o.png differ diff --git a/artwork/themes/default/device_fat.png b/artwork/themes/default/device_fat.png new file mode 100644 index 0000000..80c5922 Binary files /dev/null and b/artwork/themes/default/device_fat.png differ diff --git a/artwork/themes/default/device_fat_o.png b/artwork/themes/default/device_fat_o.png new file mode 100644 index 0000000..817a15f Binary files /dev/null and b/artwork/themes/default/device_fat_o.png differ diff --git a/artwork/themes/default/device_freebsd.png b/artwork/themes/default/device_freebsd.png new file mode 100644 index 0000000..f5796dc Binary files /dev/null and b/artwork/themes/default/device_freebsd.png differ diff --git a/artwork/themes/default/device_freebsd_o.png b/artwork/themes/default/device_freebsd_o.png new file mode 100644 index 0000000..dab4fb7 Binary files /dev/null and b/artwork/themes/default/device_freebsd_o.png differ diff --git a/artwork/themes/default/device_generic.png b/artwork/themes/default/device_generic.png new file mode 100644 index 0000000..1ca9d15 Binary files /dev/null and b/artwork/themes/default/device_generic.png differ diff --git a/artwork/themes/default/device_generic_o.png b/artwork/themes/default/device_generic_o.png new file mode 100644 index 0000000..3df9977 Binary files /dev/null and b/artwork/themes/default/device_generic_o.png differ diff --git a/artwork/themes/default/device_hfsfusion_mav.png b/artwork/themes/default/device_hfsfusion_mav.png new file mode 100644 index 0000000..efe6414 Binary files /dev/null and b/artwork/themes/default/device_hfsfusion_mav.png differ diff --git a/artwork/themes/default/device_hfsfusion_mav_o.png b/artwork/themes/default/device_hfsfusion_mav_o.png new file mode 100644 index 0000000..f5301e0 Binary files /dev/null and b/artwork/themes/default/device_hfsfusion_mav_o.png differ diff --git a/artwork/themes/default/device_hfsplus.png b/artwork/themes/default/device_hfsplus.png new file mode 100644 index 0000000..010b64c Binary files /dev/null and b/artwork/themes/default/device_hfsplus.png differ diff --git a/artwork/themes/default/device_hfsplus_leo.png b/artwork/themes/default/device_hfsplus_leo.png new file mode 100644 index 0000000..daf029d Binary files /dev/null and b/artwork/themes/default/device_hfsplus_leo.png differ diff --git a/artwork/themes/default/device_hfsplus_leo_o.png b/artwork/themes/default/device_hfsplus_leo_o.png new file mode 100644 index 0000000..438e94e Binary files /dev/null and b/artwork/themes/default/device_hfsplus_leo_o.png differ diff --git a/artwork/themes/default/device_hfsplus_lion.png b/artwork/themes/default/device_hfsplus_lion.png new file mode 100644 index 0000000..873dae2 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_lion.png differ diff --git a/artwork/themes/default/device_hfsplus_lion_o.png b/artwork/themes/default/device_hfsplus_lion_o.png new file mode 100644 index 0000000..88ca17d Binary files /dev/null and b/artwork/themes/default/device_hfsplus_lion_o.png differ diff --git a/artwork/themes/default/device_hfsplus_mav.png b/artwork/themes/default/device_hfsplus_mav.png new file mode 100644 index 0000000..b773f18 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_mav.png differ diff --git a/artwork/themes/default/device_hfsplus_mav_o.png b/artwork/themes/default/device_hfsplus_mav_o.png new file mode 100644 index 0000000..6667950 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_mav_o.png differ diff --git a/artwork/themes/default/device_hfsplus_ml.png b/artwork/themes/default/device_hfsplus_ml.png new file mode 100755 index 0000000..25eb4a7 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_ml.png differ diff --git a/artwork/themes/default/device_hfsplus_ml_o.png b/artwork/themes/default/device_hfsplus_ml_o.png new file mode 100755 index 0000000..9119bf6 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_ml_o.png differ diff --git a/artwork/themes/default/device_hfsplus_o.png b/artwork/themes/default/device_hfsplus_o.png new file mode 100644 index 0000000..c4f6d18 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_o.png differ diff --git a/artwork/themes/default/device_hfsplus_sl.png b/artwork/themes/default/device_hfsplus_sl.png new file mode 100644 index 0000000..f45c1ea Binary files /dev/null and b/artwork/themes/default/device_hfsplus_sl.png differ diff --git a/artwork/themes/default/device_hfsplus_sl_o.png b/artwork/themes/default/device_hfsplus_sl_o.png new file mode 100644 index 0000000..f370017 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_sl_o.png differ diff --git a/artwork/themes/default/device_hfsplus_tiger.png b/artwork/themes/default/device_hfsplus_tiger.png new file mode 100644 index 0000000..02605cc Binary files /dev/null and b/artwork/themes/default/device_hfsplus_tiger.png differ diff --git a/artwork/themes/default/device_hfsplus_tiger_o.png b/artwork/themes/default/device_hfsplus_tiger_o.png new file mode 100644 index 0000000..a43bc88 Binary files /dev/null and b/artwork/themes/default/device_hfsplus_tiger_o.png differ diff --git a/artwork/themes/default/device_hfsraid.png b/artwork/themes/default/device_hfsraid.png new file mode 100644 index 0000000..2283de5 Binary files /dev/null and b/artwork/themes/default/device_hfsraid.png differ diff --git a/artwork/themes/default/device_hfsraid_leo.png b/artwork/themes/default/device_hfsraid_leo.png new file mode 100644 index 0000000..8c986c3 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_leo.png differ diff --git a/artwork/themes/default/device_hfsraid_leo_o.png b/artwork/themes/default/device_hfsraid_leo_o.png new file mode 100644 index 0000000..4d688eb Binary files /dev/null and b/artwork/themes/default/device_hfsraid_leo_o.png differ diff --git a/artwork/themes/default/device_hfsraid_lion.png b/artwork/themes/default/device_hfsraid_lion.png new file mode 100644 index 0000000..8641e63 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_lion.png differ diff --git a/artwork/themes/default/device_hfsraid_lion_o.png b/artwork/themes/default/device_hfsraid_lion_o.png new file mode 100644 index 0000000..b07f0f5 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_lion_o.png differ diff --git a/artwork/themes/default/device_hfsraid_mav.png b/artwork/themes/default/device_hfsraid_mav.png new file mode 100644 index 0000000..6577e8b Binary files /dev/null and b/artwork/themes/default/device_hfsraid_mav.png differ diff --git a/artwork/themes/default/device_hfsraid_mav_o.png b/artwork/themes/default/device_hfsraid_mav_o.png new file mode 100644 index 0000000..1f72ec9 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_mav_o.png differ diff --git a/artwork/themes/default/device_hfsraid_ml.png b/artwork/themes/default/device_hfsraid_ml.png new file mode 100755 index 0000000..3555222 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_ml.png differ diff --git a/artwork/themes/default/device_hfsraid_ml_o.png b/artwork/themes/default/device_hfsraid_ml_o.png new file mode 100755 index 0000000..0e08f74 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_ml_o.png differ diff --git a/artwork/themes/default/device_hfsraid_o.png b/artwork/themes/default/device_hfsraid_o.png new file mode 100644 index 0000000..dcbc2b7 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_o.png differ diff --git a/artwork/themes/default/device_hfsraid_sl.png b/artwork/themes/default/device_hfsraid_sl.png new file mode 100644 index 0000000..618b91b Binary files /dev/null and b/artwork/themes/default/device_hfsraid_sl.png differ diff --git a/artwork/themes/default/device_hfsraid_sl_o.png b/artwork/themes/default/device_hfsraid_sl_o.png new file mode 100644 index 0000000..7560b1d Binary files /dev/null and b/artwork/themes/default/device_hfsraid_sl_o.png differ diff --git a/artwork/themes/default/device_hfsraid_tiger.png b/artwork/themes/default/device_hfsraid_tiger.png new file mode 100644 index 0000000..ccafd53 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_tiger.png differ diff --git a/artwork/themes/default/device_hfsraid_tiger_o.png b/artwork/themes/default/device_hfsraid_tiger_o.png new file mode 100644 index 0000000..e3f2da9 Binary files /dev/null and b/artwork/themes/default/device_hfsraid_tiger_o.png differ diff --git a/artwork/themes/default/device_ntfs.png b/artwork/themes/default/device_ntfs.png new file mode 100644 index 0000000..c51555c Binary files /dev/null and b/artwork/themes/default/device_ntfs.png differ diff --git a/artwork/themes/default/device_ntfs_o.png b/artwork/themes/default/device_ntfs_o.png new file mode 100644 index 0000000..d9125a3 Binary files /dev/null and b/artwork/themes/default/device_ntfs_o.png differ diff --git a/artwork/themes/default/device_openbsd.png b/artwork/themes/default/device_openbsd.png new file mode 100644 index 0000000..6c0851c Binary files /dev/null and b/artwork/themes/default/device_openbsd.png differ diff --git a/artwork/themes/default/device_openbsd_o.png b/artwork/themes/default/device_openbsd_o.png new file mode 100644 index 0000000..425f791 Binary files /dev/null and b/artwork/themes/default/device_openbsd_o.png differ diff --git a/artwork/themes/default/device_scroll_next.png b/artwork/themes/default/device_scroll_next.png new file mode 100644 index 0000000..cba70b7 Binary files /dev/null and b/artwork/themes/default/device_scroll_next.png differ diff --git a/artwork/themes/default/device_scroll_prev.png b/artwork/themes/default/device_scroll_prev.png new file mode 100644 index 0000000..6fafc58 Binary files /dev/null and b/artwork/themes/default/device_scroll_prev.png differ diff --git a/artwork/themes/default/device_selection.png b/artwork/themes/default/device_selection.png new file mode 100644 index 0000000..6ecd188 Binary files /dev/null and b/artwork/themes/default/device_selection.png differ diff --git a/artwork/themes/default/font_console.png b/artwork/themes/default/font_console.png new file mode 100644 index 0000000..3619154 Binary files /dev/null and b/artwork/themes/default/font_console.png differ diff --git a/artwork/themes/default/font_small.png b/artwork/themes/default/font_small.png new file mode 100644 index 0000000..0c43412 Binary files /dev/null and b/artwork/themes/default/font_small.png differ diff --git a/artwork/themes/default/logo.png b/artwork/themes/default/logo.png new file mode 100644 index 0000000..9795758 Binary files /dev/null and b/artwork/themes/default/logo.png differ diff --git a/artwork/themes/default/menu_boot.png b/artwork/themes/default/menu_boot.png new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/menu_boot.png differ diff --git a/artwork/themes/default/menu_help.png b/artwork/themes/default/menu_help.png new file mode 100644 index 0000000..0584c22 Binary files /dev/null and b/artwork/themes/default/menu_help.png differ diff --git a/artwork/themes/default/menu_ignore_caches.png b/artwork/themes/default/menu_ignore_caches.png new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/menu_ignore_caches.png differ diff --git a/artwork/themes/default/menu_ignore_caches_disabled.png b/artwork/themes/default/menu_ignore_caches_disabled.png new file mode 100644 index 0000000..a1977f9 Binary files /dev/null and b/artwork/themes/default/menu_ignore_caches_disabled.png differ diff --git a/artwork/themes/default/menu_memory_info.png b/artwork/themes/default/menu_memory_info.png new file mode 100644 index 0000000..0584c22 Binary files /dev/null and b/artwork/themes/default/menu_memory_info.png differ diff --git a/artwork/themes/default/menu_selection.png b/artwork/themes/default/menu_selection.png new file mode 100644 index 0000000..348b48e Binary files /dev/null and b/artwork/themes/default/menu_selection.png differ diff --git a/artwork/themes/default/menu_single_user.png b/artwork/themes/default/menu_single_user.png new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/menu_single_user.png differ diff --git a/artwork/themes/default/menu_single_user_disabled.png b/artwork/themes/default/menu_single_user_disabled.png new file mode 100644 index 0000000..a1977f9 Binary files /dev/null and b/artwork/themes/default/menu_single_user_disabled.png differ diff --git a/artwork/themes/default/menu_verbose.png b/artwork/themes/default/menu_verbose.png new file mode 100644 index 0000000..1748d77 Binary files /dev/null and b/artwork/themes/default/menu_verbose.png differ diff --git a/artwork/themes/default/menu_verbose_disabled.png b/artwork/themes/default/menu_verbose_disabled.png new file mode 100644 index 0000000..a1977f9 Binary files /dev/null and b/artwork/themes/default/menu_verbose_disabled.png differ diff --git a/artwork/themes/default/menu_video_info.png b/artwork/themes/default/menu_video_info.png new file mode 100644 index 0000000..0584c22 Binary files /dev/null and b/artwork/themes/default/menu_video_info.png differ diff --git a/artwork/themes/default/progress_bar.png b/artwork/themes/default/progress_bar.png new file mode 100644 index 0000000..b2bca38 Binary files /dev/null and b/artwork/themes/default/progress_bar.png differ diff --git a/artwork/themes/default/progress_bar_background.png b/artwork/themes/default/progress_bar_background.png new file mode 100644 index 0000000..70abf8b Binary files /dev/null and b/artwork/themes/default/progress_bar_background.png differ diff --git a/artwork/themes/default/text_scroll_next.png b/artwork/themes/default/text_scroll_next.png new file mode 100644 index 0000000..7fc1d0d Binary files /dev/null and b/artwork/themes/default/text_scroll_next.png differ diff --git a/artwork/themes/default/text_scroll_prev.png b/artwork/themes/default/text_scroll_prev.png new file mode 100644 index 0000000..df92cf1 Binary files /dev/null and b/artwork/themes/default/text_scroll_prev.png differ diff --git a/artwork/themes/default/theme.plist b/artwork/themes/default/theme.plist new file mode 100644 index 0000000..bfea899 --- /dev/null +++ b/artwork/themes/default/theme.plist @@ -0,0 +1,110 @@ + + + + + Author + Blackosx + Version + 1.1 + Enabled + no + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #767f73 + background_pos_x + 50% + background_pos_y + 0 + logo_pos_x + + logo_pos_y + 5% + logo_bgcolor + #000000 + logo_transparency + 255 + devices_pos_x + + devices_pos_y + + devices_bgcolor + #767f73 + devices_transparency + 0 + devices_max_visible + 4 + devices_iconspacing + 45 + devices_layout + horizontal + bootprompt_pos_x + + bootprompt_pos_y + -6 + bootprompt_width + 40% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #3e3e3e + bootprompt_transparency + 1 + infobox_pos_x + + infobox_pos_y + 30% + infobox_width + 660 + infobox_height + 320 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #3e3e3e + infobox_transparency + 35 + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #3e3e3e + menu_transparency + 1 + progressbar_pos_x + + progressbar_pos_y + -30% + progressbar_width + 100 + progressbar_height + 40 + countdown_pos_x + + countdown_pos_y + -20% + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #AAAAAA + + diff --git a/artwork/themes/default/thumb.png b/artwork/themes/default/thumb.png new file mode 100644 index 0000000..66c8dfd Binary files /dev/null and b/artwork/themes/default/thumb.png differ diff --git a/artwork/themes/embed/.svn/all-wcprops b/artwork/themes/embed/.svn/all-wcprops new file mode 100644 index 0000000..104dcbd --- /dev/null +++ b/artwork/themes/embed/.svn/all-wcprops @@ -0,0 +1,191 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed +END +text_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/text_scroll_prev.png +END +device_hfsraid.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_hfsraid.png +END +logo.png +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/logo.png +END +device_ext3.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_ext3.png +END +menu_single_user.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_single_user.png +END +boot.png +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/boot.png +END +device_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_scroll_prev.png +END +menu_ignore_caches.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_ignore_caches.png +END +menu_verbose_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_verbose_disabled.png +END +menu_boot.png +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_boot.png +END +font_console.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/font_console.png +END +device_fat.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_fat.png +END +device_ntfs.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_ntfs.png +END +menu_single_user_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_single_user_disabled.png +END +font_small.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/font_small.png +END +text_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/text_scroll_next.png +END +device_hfsplus.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_hfsplus.png +END +menu_ignore_caches_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_ignore_caches_disabled.png +END +device_selection.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_selection.png +END +menu_video_info.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_video_info.png +END +menu_memory_info.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_memory_info.png +END +theme.plist +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/theme.plist +END +menu_selection.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_selection.png +END +device_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_scroll_next.png +END +menu_help.png +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_help.png +END +background.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/background.png +END +device_cdrom.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_cdrom.png +END +progress_bar_background.png +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/progress_bar_background.png +END +progress_bar.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/progress_bar.png +END +menu_verbose.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/menu_verbose.png +END +device_generic.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/embed/device_generic.png +END diff --git a/artwork/themes/embed/.svn/entries b/artwork/themes/embed/.svn/entries new file mode 100644 index 0000000..b78038b --- /dev/null +++ b/artwork/themes/embed/.svn/entries @@ -0,0 +1,1082 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/artwork/themes/embed +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +text_scroll_prev.png +file + + + + +2013-08-27T23:55:56.000000Z +119a9be6ebc1a04ef085e11b191efe1c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +589 + +device_hfsraid.png +file + + + + +2013-08-27T23:55:56.000000Z +c81e9d7454c6853422fc4a1a19e342a2 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8707 + +logo.png +file + + + + +2013-08-27T23:55:56.000000Z +c2d17e64b7f8979aa9595825f13f706d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +10385 + +device_ext3.png +file + + + + +2013-08-27T23:55:56.000000Z +413e646458c6d94cc59d62be2500c2fa +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8523 + +menu_single_user.png +file + + + + +2013-08-27T23:55:56.000000Z +a2a465d70706c821d3f31a684b1068bb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +174 + +boot.png +file + + + + +2013-08-27T23:55:56.000000Z +6f0bdfa8b98e53c1dc5f5b2a13f77a4a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6461 + +device_scroll_prev.png +file + + + + +2013-08-27T23:55:56.000000Z +2e185ee6f9b44d49dadc7e9be561c92e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1689 + +menu_ignore_caches.png +file + + + + +2013-08-27T23:55:56.000000Z +a2a465d70706c821d3f31a684b1068bb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +174 + +menu_verbose_disabled.png +file + + + + +2013-08-27T23:55:56.000000Z +793cdd3f319488dabf20fe9f91856569 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +173 + +menu_boot.png +file + + + + +2013-08-27T23:55:56.000000Z +a2a465d70706c821d3f31a684b1068bb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +174 + +font_console.png +file + + + + +2013-08-27T23:55:56.000000Z +c54ecfc288e38129b3ff6f438866322e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3499 + +device_fat.png +file + + + + +2013-08-27T23:55:56.000000Z +5cb4989b1fe73e5779109c6c9b644716 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8067 + +device_ntfs.png +file + + + + +2013-08-27T23:55:56.000000Z +ebd47449bc176e0eef1192e4cf3d5460 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +9092 + +menu_single_user_disabled.png +file + + + + +2013-08-27T23:55:56.000000Z +793cdd3f319488dabf20fe9f91856569 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +173 + +font_small.png +file + + + + +2013-08-27T23:55:56.000000Z +32f38f88620d2ea9398b49240ee8bfe4 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +4641 + +text_scroll_next.png +file + + + + +2013-08-27T23:55:56.000000Z +e2ed9f18b71d0013fb9f9b3384df23b8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +591 + +device_hfsplus.png +file + + + + +2013-08-27T23:55:56.000000Z +087f6d34cd01076d2e4a75137090bf13 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8552 + +menu_ignore_caches_disabled.png +file + + + + +2013-08-27T23:55:56.000000Z +793cdd3f319488dabf20fe9f91856569 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +173 + +device_selection.png +file + + + + +2013-08-27T23:55:56.000000Z +611f997e2e2aaac4c198749e5398bb14 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1938 + +menu_video_info.png +file + + + + +2013-08-27T23:55:56.000000Z +41f8abca53887b0073c68843e5ee9f6a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +166 + +menu_memory_info.png +file + + + + +2013-08-27T23:55:56.000000Z +41f8abca53887b0073c68843e5ee9f6a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +166 + +theme.plist +file + + + + +2013-08-27T23:55:56.000000Z +d104964a9e93917c7fbdf663e7e404fa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2798 + +menu_selection.png +file + + + + +2013-08-27T23:55:56.000000Z +ed4ae177eb58aa58fa4afa32d6231b3a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +206 + +device_scroll_next.png +file + + + + +2013-08-27T23:55:56.000000Z +ba3aeebe944fa8d5f0435a56c2473c4e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1683 + +menu_help.png +file + + + + +2013-08-27T23:55:56.000000Z +41f8abca53887b0073c68843e5ee9f6a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +166 + +background.png +file + + + + +2013-08-27T23:55:56.000000Z +72e8ca42831fd0e2f47e7960ea7a6c53 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +966 + +device_cdrom.png +file + + + + +2013-08-27T23:55:56.000000Z +6471d89dc02aa00e4b694acebadaf3e5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8094 + +progress_bar_background.png +file + + + + +2013-08-27T23:55:56.000000Z +8208ebdde873a936c4643fa53317c841 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +176 + +progress_bar.png +file + + + + +2013-08-27T23:55:56.000000Z +461dcaab0bceac2c3c26f81536c5f298 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +337 + +menu_verbose.png +file + + + + +2013-08-27T23:55:56.000000Z +a2a465d70706c821d3f31a684b1068bb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +174 + +device_generic.png +file + + + + +2013-08-27T23:55:56.000000Z +b816ba05f2081665f1b00df94b2ba290 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7245 + diff --git a/artwork/themes/embed/.svn/prop-base/background.png.svn-base b/artwork/themes/embed/.svn/prop-base/background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/boot.png.svn-base b/artwork/themes/embed/.svn/prop-base/boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_cdrom.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_cdrom.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_ext3.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_ext3.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_ext3.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_fat.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_fat.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_fat.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_generic.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_generic.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_generic.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_hfsplus.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_hfsplus.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_hfsraid.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_hfsraid.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_hfsraid.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_ntfs.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_ntfs.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_scroll_next.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_scroll_prev.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/device_selection.png.svn-base b/artwork/themes/embed/.svn/prop-base/device_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/device_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/font_console.png.svn-base b/artwork/themes/embed/.svn/prop-base/font_console.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/font_console.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/font_small.png.svn-base b/artwork/themes/embed/.svn/prop-base/font_small.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/font_small.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/logo.png.svn-base b/artwork/themes/embed/.svn/prop-base/logo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/logo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_boot.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_help.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_help.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_help.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_ignore_caches.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_ignore_caches.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_memory_info.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_memory_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_selection.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_single_user.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_single_user.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_single_user_disabled.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_single_user_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_verbose.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_verbose.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_verbose_disabled.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_verbose_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/menu_video_info.png.svn-base b/artwork/themes/embed/.svn/prop-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/menu_video_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/progress_bar.png.svn-base b/artwork/themes/embed/.svn/prop-base/progress_bar.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/progress_bar.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/progress_bar_background.png.svn-base b/artwork/themes/embed/.svn/prop-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/progress_bar_background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/text_scroll_next.png.svn-base b/artwork/themes/embed/.svn/prop-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/text_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/prop-base/text_scroll_prev.png.svn-base b/artwork/themes/embed/.svn/prop-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/embed/.svn/prop-base/text_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/embed/.svn/text-base/background.png.svn-base b/artwork/themes/embed/.svn/text-base/background.png.svn-base new file mode 100644 index 0000000..20a2c3f Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/background.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/boot.png.svn-base b/artwork/themes/embed/.svn/text-base/boot.png.svn-base new file mode 100644 index 0000000..14197ac Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/boot.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_cdrom.png.svn-base b/artwork/themes/embed/.svn/text-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..5631906 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_cdrom.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_ext3.png.svn-base b/artwork/themes/embed/.svn/text-base/device_ext3.png.svn-base new file mode 100644 index 0000000..74a736a Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_ext3.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_fat.png.svn-base b/artwork/themes/embed/.svn/text-base/device_fat.png.svn-base new file mode 100644 index 0000000..00c9fa4 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_fat.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_generic.png.svn-base b/artwork/themes/embed/.svn/text-base/device_generic.png.svn-base new file mode 100644 index 0000000..5e3646f Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_generic.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_hfsplus.png.svn-base b/artwork/themes/embed/.svn/text-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..b97941a Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_hfsplus.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_hfsraid.png.svn-base b/artwork/themes/embed/.svn/text-base/device_hfsraid.png.svn-base new file mode 100644 index 0000000..95be722 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_hfsraid.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_ntfs.png.svn-base b/artwork/themes/embed/.svn/text-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..a7ed4fd Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_ntfs.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_scroll_next.png.svn-base b/artwork/themes/embed/.svn/text-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..db72eae Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_scroll_next.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_scroll_prev.png.svn-base b/artwork/themes/embed/.svn/text-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..f26d783 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_scroll_prev.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/device_selection.png.svn-base b/artwork/themes/embed/.svn/text-base/device_selection.png.svn-base new file mode 100644 index 0000000..274cb37 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/device_selection.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/font_console.png.svn-base b/artwork/themes/embed/.svn/text-base/font_console.png.svn-base new file mode 100644 index 0000000..7652856 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/font_console.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/font_small.png.svn-base b/artwork/themes/embed/.svn/text-base/font_small.png.svn-base new file mode 100644 index 0000000..4920282 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/font_small.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/logo.png.svn-base b/artwork/themes/embed/.svn/text-base/logo.png.svn-base new file mode 100644 index 0000000..b7b505b Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/logo.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_boot.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_boot.png.svn-base new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_boot.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_help.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_help.png.svn-base new file mode 100644 index 0000000..58884f3 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_help.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_ignore_caches.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_ignore_caches.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..385d7a5 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_ignore_caches_disabled.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_memory_info.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..58884f3 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_memory_info.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_selection.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_selection.png.svn-base new file mode 100644 index 0000000..29c5b08 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_selection.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_single_user.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_single_user.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_single_user_disabled.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..385d7a5 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_single_user_disabled.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_verbose.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_verbose.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_verbose_disabled.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..385d7a5 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_verbose_disabled.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/menu_video_info.png.svn-base b/artwork/themes/embed/.svn/text-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..58884f3 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/menu_video_info.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/progress_bar.png.svn-base b/artwork/themes/embed/.svn/text-base/progress_bar.png.svn-base new file mode 100644 index 0000000..18b01fc Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/progress_bar.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/progress_bar_background.png.svn-base b/artwork/themes/embed/.svn/text-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..fc8aaa2 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/progress_bar_background.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/text_scroll_next.png.svn-base b/artwork/themes/embed/.svn/text-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..fb721ee Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/text_scroll_next.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/text_scroll_prev.png.svn-base b/artwork/themes/embed/.svn/text-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..e2a4719 Binary files /dev/null and b/artwork/themes/embed/.svn/text-base/text_scroll_prev.png.svn-base differ diff --git a/artwork/themes/embed/.svn/text-base/theme.plist.svn-base b/artwork/themes/embed/.svn/text-base/theme.plist.svn-base new file mode 100644 index 0000000..5bc1ae9 --- /dev/null +++ b/artwork/themes/embed/.svn/text-base/theme.plist.svn-base @@ -0,0 +1,121 @@ + + + + + Author + Blackosx + Version + 1.0 + + Enabled + no + + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #767f73 + + background_pos_x + 50% + background_pos_y + 0 + + logo_pos_x + + logo_pos_y + 5% + logo_bgcolor + #000000 + logo_transparency + 255 + + devices_pos_x + + devices_pos_y + + devices_bgcolor + #767f73 + devices_transparency + 0 + devices_max_visible + 5 + devices_iconspacing + 35 + devices_layout + horizontal + + bootprompt_pos_x + + bootprompt_pos_y + -6 + bootprompt_width + 40% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #3e3e3e + bootprompt_transparency + 1 + + infobox_pos_x + + infobox_pos_y + 30% + infobox_width + 660 + infobox_height + 320 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #3e3e3e + infobox_transparency + 35 + + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #3e3e3e + menu_transparency + 1 + + progressbar_pos_x + + progressbar_pos_y + -30% + progressbar_width + 100 + progressbar_height + 40 + + countdown_pos_x + + countdown_pos_y + -20% + + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #AAAAAA + + diff --git a/artwork/themes/embed/background.png b/artwork/themes/embed/background.png new file mode 100644 index 0000000..20a2c3f Binary files /dev/null and b/artwork/themes/embed/background.png differ diff --git a/artwork/themes/embed/boot.png b/artwork/themes/embed/boot.png new file mode 100644 index 0000000..14197ac Binary files /dev/null and b/artwork/themes/embed/boot.png differ diff --git a/artwork/themes/embed/device_cdrom.png b/artwork/themes/embed/device_cdrom.png new file mode 100644 index 0000000..5631906 Binary files /dev/null and b/artwork/themes/embed/device_cdrom.png differ diff --git a/artwork/themes/embed/device_ext3.png b/artwork/themes/embed/device_ext3.png new file mode 100644 index 0000000..74a736a Binary files /dev/null and b/artwork/themes/embed/device_ext3.png differ diff --git a/artwork/themes/embed/device_fat.png b/artwork/themes/embed/device_fat.png new file mode 100644 index 0000000..00c9fa4 Binary files /dev/null and b/artwork/themes/embed/device_fat.png differ diff --git a/artwork/themes/embed/device_generic.png b/artwork/themes/embed/device_generic.png new file mode 100644 index 0000000..5e3646f Binary files /dev/null and b/artwork/themes/embed/device_generic.png differ diff --git a/artwork/themes/embed/device_hfsplus.png b/artwork/themes/embed/device_hfsplus.png new file mode 100644 index 0000000..b97941a Binary files /dev/null and b/artwork/themes/embed/device_hfsplus.png differ diff --git a/artwork/themes/embed/device_hfsraid.png b/artwork/themes/embed/device_hfsraid.png new file mode 100644 index 0000000..95be722 Binary files /dev/null and b/artwork/themes/embed/device_hfsraid.png differ diff --git a/artwork/themes/embed/device_ntfs.png b/artwork/themes/embed/device_ntfs.png new file mode 100644 index 0000000..a7ed4fd Binary files /dev/null and b/artwork/themes/embed/device_ntfs.png differ diff --git a/artwork/themes/embed/device_scroll_next.png b/artwork/themes/embed/device_scroll_next.png new file mode 100644 index 0000000..db72eae Binary files /dev/null and b/artwork/themes/embed/device_scroll_next.png differ diff --git a/artwork/themes/embed/device_scroll_prev.png b/artwork/themes/embed/device_scroll_prev.png new file mode 100644 index 0000000..f26d783 Binary files /dev/null and b/artwork/themes/embed/device_scroll_prev.png differ diff --git a/artwork/themes/embed/device_selection.png b/artwork/themes/embed/device_selection.png new file mode 100644 index 0000000..274cb37 Binary files /dev/null and b/artwork/themes/embed/device_selection.png differ diff --git a/artwork/themes/embed/font_console.png b/artwork/themes/embed/font_console.png new file mode 100644 index 0000000..7652856 Binary files /dev/null and b/artwork/themes/embed/font_console.png differ diff --git a/artwork/themes/embed/font_small.png b/artwork/themes/embed/font_small.png new file mode 100644 index 0000000..4920282 Binary files /dev/null and b/artwork/themes/embed/font_small.png differ diff --git a/artwork/themes/embed/logo.png b/artwork/themes/embed/logo.png new file mode 100644 index 0000000..b7b505b Binary files /dev/null and b/artwork/themes/embed/logo.png differ diff --git a/artwork/themes/embed/menu_boot.png b/artwork/themes/embed/menu_boot.png new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/menu_boot.png differ diff --git a/artwork/themes/embed/menu_help.png b/artwork/themes/embed/menu_help.png new file mode 100644 index 0000000..58884f3 Binary files /dev/null and b/artwork/themes/embed/menu_help.png differ diff --git a/artwork/themes/embed/menu_ignore_caches.png b/artwork/themes/embed/menu_ignore_caches.png new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/menu_ignore_caches.png differ diff --git a/artwork/themes/embed/menu_ignore_caches_disabled.png b/artwork/themes/embed/menu_ignore_caches_disabled.png new file mode 100644 index 0000000..385d7a5 Binary files /dev/null and b/artwork/themes/embed/menu_ignore_caches_disabled.png differ diff --git a/artwork/themes/embed/menu_memory_info.png b/artwork/themes/embed/menu_memory_info.png new file mode 100644 index 0000000..58884f3 Binary files /dev/null and b/artwork/themes/embed/menu_memory_info.png differ diff --git a/artwork/themes/embed/menu_selection.png b/artwork/themes/embed/menu_selection.png new file mode 100644 index 0000000..29c5b08 Binary files /dev/null and b/artwork/themes/embed/menu_selection.png differ diff --git a/artwork/themes/embed/menu_single_user.png b/artwork/themes/embed/menu_single_user.png new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/menu_single_user.png differ diff --git a/artwork/themes/embed/menu_single_user_disabled.png b/artwork/themes/embed/menu_single_user_disabled.png new file mode 100644 index 0000000..385d7a5 Binary files /dev/null and b/artwork/themes/embed/menu_single_user_disabled.png differ diff --git a/artwork/themes/embed/menu_verbose.png b/artwork/themes/embed/menu_verbose.png new file mode 100644 index 0000000..b8b010e Binary files /dev/null and b/artwork/themes/embed/menu_verbose.png differ diff --git a/artwork/themes/embed/menu_verbose_disabled.png b/artwork/themes/embed/menu_verbose_disabled.png new file mode 100644 index 0000000..385d7a5 Binary files /dev/null and b/artwork/themes/embed/menu_verbose_disabled.png differ diff --git a/artwork/themes/embed/menu_video_info.png b/artwork/themes/embed/menu_video_info.png new file mode 100644 index 0000000..58884f3 Binary files /dev/null and b/artwork/themes/embed/menu_video_info.png differ diff --git a/artwork/themes/embed/progress_bar.png b/artwork/themes/embed/progress_bar.png new file mode 100644 index 0000000..18b01fc Binary files /dev/null and b/artwork/themes/embed/progress_bar.png differ diff --git a/artwork/themes/embed/progress_bar_background.png b/artwork/themes/embed/progress_bar_background.png new file mode 100644 index 0000000..fc8aaa2 Binary files /dev/null and b/artwork/themes/embed/progress_bar_background.png differ diff --git a/artwork/themes/embed/text_scroll_next.png b/artwork/themes/embed/text_scroll_next.png new file mode 100644 index 0000000..fb721ee Binary files /dev/null and b/artwork/themes/embed/text_scroll_next.png differ diff --git a/artwork/themes/embed/text_scroll_prev.png b/artwork/themes/embed/text_scroll_prev.png new file mode 100644 index 0000000..e2a4719 Binary files /dev/null and b/artwork/themes/embed/text_scroll_prev.png differ diff --git a/artwork/themes/embed/theme.plist b/artwork/themes/embed/theme.plist new file mode 100644 index 0000000..5bc1ae9 --- /dev/null +++ b/artwork/themes/embed/theme.plist @@ -0,0 +1,121 @@ + + + + + Author + Blackosx + Version + 1.0 + + Enabled + no + + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #767f73 + + background_pos_x + 50% + background_pos_y + 0 + + logo_pos_x + + logo_pos_y + 5% + logo_bgcolor + #000000 + logo_transparency + 255 + + devices_pos_x + + devices_pos_y + + devices_bgcolor + #767f73 + devices_transparency + 0 + devices_max_visible + 5 + devices_iconspacing + 35 + devices_layout + horizontal + + bootprompt_pos_x + + bootprompt_pos_y + -6 + bootprompt_width + 40% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #3e3e3e + bootprompt_transparency + 1 + + infobox_pos_x + + infobox_pos_y + 30% + infobox_width + 660 + infobox_height + 320 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #3e3e3e + infobox_transparency + 35 + + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #3e3e3e + menu_transparency + 1 + + progressbar_pos_x + + progressbar_pos_y + -30% + progressbar_width + 100 + progressbar_height + 40 + + countdown_pos_x + + countdown_pos_y + -20% + + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #AAAAAA + + diff --git a/artwork/themes/legacy/.svn/all-wcprops b/artwork/themes/legacy/.svn/all-wcprops new file mode 100644 index 0000000..63b708d --- /dev/null +++ b/artwork/themes/legacy/.svn/all-wcprops @@ -0,0 +1,185 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy +END +font_small.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/font_small.png +END +text_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/text_scroll_prev.png +END +logo.png +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/logo.png +END +text_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/text_scroll_next.png +END +device_ext3.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_ext3.png +END +device_hfsplus.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_hfsplus.png +END +boot.png +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/boot.png +END +menu_single_user.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_single_user.png +END +device_selection.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_selection.png +END +menu_ignore_caches_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_ignore_caches_disabled.png +END +menu_video_info.png +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_video_info.png +END +menu_memory_info.png +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_memory_info.png +END +device_scroll_prev.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_scroll_prev.png +END +menu_selection.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_selection.png +END +theme.plist +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/theme.plist +END +device_scroll_next.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_scroll_next.png +END +menu_help.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_help.png +END +menu_ignore_caches.png +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_ignore_caches.png +END +background.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/background.png +END +menu_verbose_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_verbose_disabled.png +END +device_cdrom.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_cdrom.png +END +menu_boot.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_boot.png +END +progress_bar_background.png +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/progress_bar_background.png +END +font_console.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/font_console.png +END +progress_bar.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/progress_bar.png +END +device_ntfs.png +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_ntfs.png +END +device_fat.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_fat.png +END +menu_verbose.png +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_verbose.png +END +menu_single_user_disabled.png +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/menu_single_user_disabled.png +END +device_generic.png +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/artwork/themes/legacy/device_generic.png +END diff --git a/artwork/themes/legacy/.svn/entries b/artwork/themes/legacy/.svn/entries new file mode 100644 index 0000000..7c62621 --- /dev/null +++ b/artwork/themes/legacy/.svn/entries @@ -0,0 +1,1048 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/artwork/themes/legacy +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +font_small.png +file + + + + +2013-08-27T23:55:40.000000Z +6219e17d1f0388dfe4e0c03564b0f9a5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +6244 + +text_scroll_prev.png +file + + + + +2013-08-27T23:55:40.000000Z +e98cec98c1d8e40cc67a120064a65258 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +252 + +logo.png +file + + + + +2013-08-27T23:55:40.000000Z +24fde3aa31af7a57e0916c9e1b6faed3 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +17389 + +text_scroll_next.png +file + + + + +2013-08-27T23:55:40.000000Z +1fd7e5bc567a71b0b42ce2f39db21bab +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +255 + +device_ext3.png +file + + + + +2013-08-27T23:55:40.000000Z +16db93491fc9f60d65fa23a0d4e07e71 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +12591 + +device_hfsplus.png +file + + + + +2013-08-27T23:55:40.000000Z +c43fcee60f316d2b91df38b19ce5223a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +10950 + +boot.png +file + + + + +2013-08-27T23:55:40.000000Z +c43fcee60f316d2b91df38b19ce5223a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +10950 + +menu_single_user.png +file + + + + +2013-08-27T23:55:40.000000Z +e3ef979f034cd599cf463e8695e494ba +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1407 + +device_selection.png +file + + + + +2013-08-27T23:55:40.000000Z +896fb25a210a862d7aa159cd142a2e06 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +899 + +menu_ignore_caches_disabled.png +file + + + + +2013-08-27T23:55:40.000000Z +f546d932b028191a8c62afcf2a02b456 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1341 + +menu_video_info.png +file + + + + +2013-08-27T23:55:40.000000Z +d03494c5663808923a1dfacc9124401f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1593 + +menu_memory_info.png +file + + + + +2013-08-27T23:55:40.000000Z +288f6a1a4cea73cb427038e7d6904e57 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1634 + +device_scroll_prev.png +file + + + + +2013-08-27T23:55:40.000000Z +3fcb0f5e0d8edab9ddb7b6e03e5d0035 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +271 + +menu_selection.png +file + + + + +2013-08-27T23:55:40.000000Z +d163766c78918bba287920168aaed75a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +323 + +theme.plist +file + + + + +2013-08-27T23:55:40.000000Z +6a20fe6d3839617754afa1dc39ec6bdb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2699 + +device_scroll_next.png +file + + + + +2013-08-27T23:55:40.000000Z +b7646a46fd97376da13d5b9fd3e41940 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +268 + +menu_help.png +file + + + + +2013-08-27T23:55:40.000000Z +6d749837db9ae96eac5f16cfbe7d3e25 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1711 + +menu_ignore_caches.png +file + + + + +2013-08-27T23:55:40.000000Z +980607d45ecea57fd1bea5174b9b2007 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1355 + +background.png +file + + + + +2013-08-27T23:55:40.000000Z +72e8ca42831fd0e2f47e7960ea7a6c53 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +966 + +menu_verbose_disabled.png +file + + + + +2013-08-27T23:55:40.000000Z +e101578837f4db723d4dc01a3dfe549b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1420 + +device_cdrom.png +file + + + + +2013-08-27T23:55:40.000000Z +d493cae2f5162392d6748dcd90f9995d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +13605 + +menu_boot.png +file + + + + +2013-08-27T23:55:40.000000Z +e11b5960525419dc54e2ef6626f3a1d8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1747 + +progress_bar_background.png +file + + + + +2013-08-27T23:55:40.000000Z +0992a3d2b98e7879787c37d5bcbe2fe3 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +233 + +font_console.png +file + + + + +2013-08-27T23:55:40.000000Z +c54ecfc288e38129b3ff6f438866322e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3499 + +progress_bar.png +file + + + + +2013-08-27T23:55:40.000000Z +ff730738be9582b9a9853bb9907aedf5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +372 + +device_ntfs.png +file + + + + +2013-08-27T23:55:40.000000Z +2d7d8eb2106b081cf843b7a76a1be041 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +14905 + +device_fat.png +file + + + + +2013-08-27T23:55:40.000000Z +986d9a6d17ffc96f79c65437f6302d0d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +12713 + +menu_verbose.png +file + + + + +2013-08-27T23:55:40.000000Z +cfa8033783aaa069eafaccbf6575d776 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1407 + +menu_single_user_disabled.png +file + + + + +2013-08-27T23:55:40.000000Z +adc075d2f9e4f82061f926cd903de56c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1404 + +device_generic.png +file + + + + +2013-08-27T23:55:40.000000Z +986d9a6d17ffc96f79c65437f6302d0d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +12713 + diff --git a/artwork/themes/legacy/.svn/prop-base/background.png.svn-base b/artwork/themes/legacy/.svn/prop-base/background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/boot.png.svn-base b/artwork/themes/legacy/.svn/prop-base/boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_cdrom.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_cdrom.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_ext3.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_ext3.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_ext3.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_fat.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_fat.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_fat.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_generic.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_generic.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_generic.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_hfsplus.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_hfsplus.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_ntfs.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_ntfs.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_scroll_next.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_scroll_prev.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/device_selection.png.svn-base b/artwork/themes/legacy/.svn/prop-base/device_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/device_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/font_console.png.svn-base b/artwork/themes/legacy/.svn/prop-base/font_console.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/font_console.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/font_small.png.svn-base b/artwork/themes/legacy/.svn/prop-base/font_small.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/font_small.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/logo.png.svn-base b/artwork/themes/legacy/.svn/prop-base/logo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/logo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_boot.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_boot.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_boot.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_help.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_help.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_help.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_ignore_caches.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_ignore_caches.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_ignore_caches_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_memory_info.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_memory_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_selection.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_selection.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_selection.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_single_user.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_single_user.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_single_user_disabled.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_single_user_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_verbose.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_verbose.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_verbose_disabled.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_verbose_disabled.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/menu_video_info.png.svn-base b/artwork/themes/legacy/.svn/prop-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/menu_video_info.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/progress_bar.png.svn-base b/artwork/themes/legacy/.svn/prop-base/progress_bar.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/progress_bar.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/progress_bar_background.png.svn-base b/artwork/themes/legacy/.svn/prop-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/progress_bar_background.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/text_scroll_next.png.svn-base b/artwork/themes/legacy/.svn/prop-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/text_scroll_next.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/prop-base/text_scroll_prev.png.svn-base b/artwork/themes/legacy/.svn/prop-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/artwork/themes/legacy/.svn/prop-base/text_scroll_prev.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/artwork/themes/legacy/.svn/text-base/background.png.svn-base b/artwork/themes/legacy/.svn/text-base/background.png.svn-base new file mode 100644 index 0000000..20a2c3f Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/background.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/boot.png.svn-base b/artwork/themes/legacy/.svn/text-base/boot.png.svn-base new file mode 100644 index 0000000..27143ae Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/boot.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_cdrom.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_cdrom.png.svn-base new file mode 100644 index 0000000..6efd79e Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_cdrom.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_ext3.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_ext3.png.svn-base new file mode 100644 index 0000000..8486333 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_ext3.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_fat.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_fat.png.svn-base new file mode 100644 index 0000000..0d11b19 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_fat.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_generic.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_generic.png.svn-base new file mode 100644 index 0000000..0d11b19 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_generic.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_hfsplus.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_hfsplus.png.svn-base new file mode 100644 index 0000000..27143ae Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_hfsplus.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_ntfs.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_ntfs.png.svn-base new file mode 100644 index 0000000..921d8bf Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_ntfs.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_scroll_next.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_scroll_next.png.svn-base new file mode 100644 index 0000000..66d533e Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_scroll_next.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_scroll_prev.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_scroll_prev.png.svn-base new file mode 100644 index 0000000..e74337a Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_scroll_prev.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/device_selection.png.svn-base b/artwork/themes/legacy/.svn/text-base/device_selection.png.svn-base new file mode 100644 index 0000000..f375e03 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/device_selection.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/font_console.png.svn-base b/artwork/themes/legacy/.svn/text-base/font_console.png.svn-base new file mode 100644 index 0000000..7652856 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/font_console.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/font_small.png.svn-base b/artwork/themes/legacy/.svn/text-base/font_small.png.svn-base new file mode 100644 index 0000000..d402ebb Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/font_small.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/logo.png.svn-base b/artwork/themes/legacy/.svn/text-base/logo.png.svn-base new file mode 100644 index 0000000..d6627f0 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/logo.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_boot.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_boot.png.svn-base new file mode 100644 index 0000000..b5e0d24 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_boot.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_help.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_help.png.svn-base new file mode 100644 index 0000000..07d837f Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_help.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_ignore_caches.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_ignore_caches.png.svn-base new file mode 100644 index 0000000..448a57d Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_ignore_caches.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_ignore_caches_disabled.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_ignore_caches_disabled.png.svn-base new file mode 100644 index 0000000..94b5854 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_ignore_caches_disabled.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_memory_info.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_memory_info.png.svn-base new file mode 100644 index 0000000..6e7c7b5 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_memory_info.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_selection.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_selection.png.svn-base new file mode 100644 index 0000000..34b33a2 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_selection.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_single_user.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_single_user.png.svn-base new file mode 100644 index 0000000..fa4d1f2 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_single_user.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_single_user_disabled.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_single_user_disabled.png.svn-base new file mode 100644 index 0000000..5daf5b7 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_single_user_disabled.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_verbose.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_verbose.png.svn-base new file mode 100644 index 0000000..79d3ca7 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_verbose.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_verbose_disabled.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_verbose_disabled.png.svn-base new file mode 100644 index 0000000..f44cd6d Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_verbose_disabled.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/menu_video_info.png.svn-base b/artwork/themes/legacy/.svn/text-base/menu_video_info.png.svn-base new file mode 100644 index 0000000..e30042f Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/menu_video_info.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/progress_bar.png.svn-base b/artwork/themes/legacy/.svn/text-base/progress_bar.png.svn-base new file mode 100644 index 0000000..ac41b39 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/progress_bar.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/progress_bar_background.png.svn-base b/artwork/themes/legacy/.svn/text-base/progress_bar_background.png.svn-base new file mode 100644 index 0000000..c23c8a7 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/progress_bar_background.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/text_scroll_next.png.svn-base b/artwork/themes/legacy/.svn/text-base/text_scroll_next.png.svn-base new file mode 100644 index 0000000..97d2947 Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/text_scroll_next.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/text_scroll_prev.png.svn-base b/artwork/themes/legacy/.svn/text-base/text_scroll_prev.png.svn-base new file mode 100644 index 0000000..3d05a9b Binary files /dev/null and b/artwork/themes/legacy/.svn/text-base/text_scroll_prev.png.svn-base differ diff --git a/artwork/themes/legacy/.svn/text-base/theme.plist.svn-base b/artwork/themes/legacy/.svn/text-base/theme.plist.svn-base new file mode 100644 index 0000000..cdc1350 --- /dev/null +++ b/artwork/themes/legacy/.svn/text-base/theme.plist.svn-base @@ -0,0 +1,106 @@ + + + + + Enabled + no + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #222334 + background_pos_x + 50% + background_pos_y + 0 + logo_pos_x + + logo_pos_y + 3% + logo_bgcolor + #000000 + logo_transparency + 255 + devices_pos_x + + devices_pos_y + + devices_bgcolor + #222334 + devices_transparency + 0 + devices_max_visible + 5 + devices_iconspacing + 20 + devices_layout + horizontal + bootprompt_pos_x + %50 + bootprompt_pos_y + -2 + bootprompt_width + 50% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #222334 + bootprompt_transparency + 1 + infobox_pos_x + + infobox_pos_y + + infobox_width + 650 + infobox_height + 406 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #222334 + infobox_transparency + 10 + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #222334 + menu_transparency + 1 + progressbar_pos_x + + progressbar_pos_y + -30% + progressbar_width + 100 + progressbar_height + 40 + countdown_pos_x + + countdown_pos_y + -20% + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #AAAAAA + + diff --git a/artwork/themes/legacy/background.png b/artwork/themes/legacy/background.png new file mode 100644 index 0000000..20a2c3f Binary files /dev/null and b/artwork/themes/legacy/background.png differ diff --git a/artwork/themes/legacy/boot.png b/artwork/themes/legacy/boot.png new file mode 100644 index 0000000..27143ae Binary files /dev/null and b/artwork/themes/legacy/boot.png differ diff --git a/artwork/themes/legacy/device_cdrom.png b/artwork/themes/legacy/device_cdrom.png new file mode 100644 index 0000000..6efd79e Binary files /dev/null and b/artwork/themes/legacy/device_cdrom.png differ diff --git a/artwork/themes/legacy/device_ext3.png b/artwork/themes/legacy/device_ext3.png new file mode 100644 index 0000000..8486333 Binary files /dev/null and b/artwork/themes/legacy/device_ext3.png differ diff --git a/artwork/themes/legacy/device_fat.png b/artwork/themes/legacy/device_fat.png new file mode 100644 index 0000000..0d11b19 Binary files /dev/null and b/artwork/themes/legacy/device_fat.png differ diff --git a/artwork/themes/legacy/device_generic.png b/artwork/themes/legacy/device_generic.png new file mode 100644 index 0000000..0d11b19 Binary files /dev/null and b/artwork/themes/legacy/device_generic.png differ diff --git a/artwork/themes/legacy/device_hfsplus.png b/artwork/themes/legacy/device_hfsplus.png new file mode 100644 index 0000000..27143ae Binary files /dev/null and b/artwork/themes/legacy/device_hfsplus.png differ diff --git a/artwork/themes/legacy/device_ntfs.png b/artwork/themes/legacy/device_ntfs.png new file mode 100644 index 0000000..921d8bf Binary files /dev/null and b/artwork/themes/legacy/device_ntfs.png differ diff --git a/artwork/themes/legacy/device_scroll_next.png b/artwork/themes/legacy/device_scroll_next.png new file mode 100644 index 0000000..66d533e Binary files /dev/null and b/artwork/themes/legacy/device_scroll_next.png differ diff --git a/artwork/themes/legacy/device_scroll_prev.png b/artwork/themes/legacy/device_scroll_prev.png new file mode 100644 index 0000000..e74337a Binary files /dev/null and b/artwork/themes/legacy/device_scroll_prev.png differ diff --git a/artwork/themes/legacy/device_selection.png b/artwork/themes/legacy/device_selection.png new file mode 100644 index 0000000..f375e03 Binary files /dev/null and b/artwork/themes/legacy/device_selection.png differ diff --git a/artwork/themes/legacy/font_console.png b/artwork/themes/legacy/font_console.png new file mode 100644 index 0000000..7652856 Binary files /dev/null and b/artwork/themes/legacy/font_console.png differ diff --git a/artwork/themes/legacy/font_small.png b/artwork/themes/legacy/font_small.png new file mode 100644 index 0000000..d402ebb Binary files /dev/null and b/artwork/themes/legacy/font_small.png differ diff --git a/artwork/themes/legacy/logo.png b/artwork/themes/legacy/logo.png new file mode 100644 index 0000000..d6627f0 Binary files /dev/null and b/artwork/themes/legacy/logo.png differ diff --git a/artwork/themes/legacy/menu_boot.png b/artwork/themes/legacy/menu_boot.png new file mode 100644 index 0000000..b5e0d24 Binary files /dev/null and b/artwork/themes/legacy/menu_boot.png differ diff --git a/artwork/themes/legacy/menu_help.png b/artwork/themes/legacy/menu_help.png new file mode 100644 index 0000000..07d837f Binary files /dev/null and b/artwork/themes/legacy/menu_help.png differ diff --git a/artwork/themes/legacy/menu_ignore_caches.png b/artwork/themes/legacy/menu_ignore_caches.png new file mode 100644 index 0000000..448a57d Binary files /dev/null and b/artwork/themes/legacy/menu_ignore_caches.png differ diff --git a/artwork/themes/legacy/menu_ignore_caches_disabled.png b/artwork/themes/legacy/menu_ignore_caches_disabled.png new file mode 100644 index 0000000..94b5854 Binary files /dev/null and b/artwork/themes/legacy/menu_ignore_caches_disabled.png differ diff --git a/artwork/themes/legacy/menu_memory_info.png b/artwork/themes/legacy/menu_memory_info.png new file mode 100644 index 0000000..6e7c7b5 Binary files /dev/null and b/artwork/themes/legacy/menu_memory_info.png differ diff --git a/artwork/themes/legacy/menu_selection.png b/artwork/themes/legacy/menu_selection.png new file mode 100644 index 0000000..34b33a2 Binary files /dev/null and b/artwork/themes/legacy/menu_selection.png differ diff --git a/artwork/themes/legacy/menu_single_user.png b/artwork/themes/legacy/menu_single_user.png new file mode 100644 index 0000000..fa4d1f2 Binary files /dev/null and b/artwork/themes/legacy/menu_single_user.png differ diff --git a/artwork/themes/legacy/menu_single_user_disabled.png b/artwork/themes/legacy/menu_single_user_disabled.png new file mode 100644 index 0000000..5daf5b7 Binary files /dev/null and b/artwork/themes/legacy/menu_single_user_disabled.png differ diff --git a/artwork/themes/legacy/menu_verbose.png b/artwork/themes/legacy/menu_verbose.png new file mode 100644 index 0000000..79d3ca7 Binary files /dev/null and b/artwork/themes/legacy/menu_verbose.png differ diff --git a/artwork/themes/legacy/menu_verbose_disabled.png b/artwork/themes/legacy/menu_verbose_disabled.png new file mode 100644 index 0000000..f44cd6d Binary files /dev/null and b/artwork/themes/legacy/menu_verbose_disabled.png differ diff --git a/artwork/themes/legacy/menu_video_info.png b/artwork/themes/legacy/menu_video_info.png new file mode 100644 index 0000000..e30042f Binary files /dev/null and b/artwork/themes/legacy/menu_video_info.png differ diff --git a/artwork/themes/legacy/progress_bar.png b/artwork/themes/legacy/progress_bar.png new file mode 100644 index 0000000..ac41b39 Binary files /dev/null and b/artwork/themes/legacy/progress_bar.png differ diff --git a/artwork/themes/legacy/progress_bar_background.png b/artwork/themes/legacy/progress_bar_background.png new file mode 100644 index 0000000..c23c8a7 Binary files /dev/null and b/artwork/themes/legacy/progress_bar_background.png differ diff --git a/artwork/themes/legacy/text_scroll_next.png b/artwork/themes/legacy/text_scroll_next.png new file mode 100644 index 0000000..97d2947 Binary files /dev/null and b/artwork/themes/legacy/text_scroll_next.png differ diff --git a/artwork/themes/legacy/text_scroll_prev.png b/artwork/themes/legacy/text_scroll_prev.png new file mode 100644 index 0000000..3d05a9b Binary files /dev/null and b/artwork/themes/legacy/text_scroll_prev.png differ diff --git a/artwork/themes/legacy/theme.plist b/artwork/themes/legacy/theme.plist new file mode 100644 index 0000000..cdc1350 --- /dev/null +++ b/artwork/themes/legacy/theme.plist @@ -0,0 +1,106 @@ + + + + + Enabled + no + screen_width + 1024 + screen_height + 768 + screen_textmargin_h + 10 + screen_textmargin_v + 10 + screen_bgcolor + #222334 + background_pos_x + 50% + background_pos_y + 0 + logo_pos_x + + logo_pos_y + 3% + logo_bgcolor + #000000 + logo_transparency + 255 + devices_pos_x + + devices_pos_y + + devices_bgcolor + #222334 + devices_transparency + 0 + devices_max_visible + 5 + devices_iconspacing + 20 + devices_layout + horizontal + bootprompt_pos_x + %50 + bootprompt_pos_y + -2 + bootprompt_width + 50% + bootprompt_height + 20 + bootprompt_textmargin_h + 10 + bootprompt_textmargin_v + 5 + bootprompt_bgcolor + #222334 + bootprompt_transparency + 1 + infobox_pos_x + + infobox_pos_y + + infobox_width + 650 + infobox_height + 406 + infobox_textmargin_h + 10 + infobox_textmargin_v + 10 + infobox_bgcolor + #222334 + infobox_transparency + 10 + menu_pos_x + + menu_pos_y + -5% + menu_textmargin_h + 10 + menu_textmargin_v + 5 + menu_bgcolor + #222334 + menu_transparency + 1 + progressbar_pos_x + + progressbar_pos_y + -30% + progressbar_width + 100 + progressbar_height + 40 + countdown_pos_x + + countdown_pos_y + -20% + boot_width + 1024 + boot_height + 768 + boot_bgcolor + #AAAAAA + + diff --git a/auto.conf b/auto.conf new file mode 100644 index 0000000..ee3cbf3 --- /dev/null +++ b/auto.conf @@ -0,0 +1,15 @@ +# +# Automatically generated make config: don't edit +# Chameleon Configuration +# Wed Aug 7 21:43:55 2013 +# +CONFIG_BOOT1_HFS_VERBOSE=y +CONFIG_BOOT1_HFS=y +CONFIG_MODULES=y +CONFIG_BOOT0_VERBOSE=y +CONFIG_OPTIMIZATION_LEVEL="-Oz" +CONFIG_BDMESG=y +CONFIG_BOOT1_HFS_ACTIVE_VERBOSE=y +CONFIG_BOOT1_HFS_ACTIVE=y +CONFIG_FDISK440=y +CONFIG_KEYLAYOUT_MODULE=m diff --git a/autoconf.h b/autoconf.h new file mode 100644 index 0000000..17dc47b --- /dev/null +++ b/autoconf.h @@ -0,0 +1,17 @@ +// +// Automatically generated make config: don't edit +// Chameleon Configuration +// Wed Aug 7 21:43:55 2013 +// +#define CONFIG_IS_BUILTIN 1 +#define CONFIG_IS_MODULE 2 +#define CONFIG_BOOT1_HFS_VERBOSE CONFIG_IS_BUILTIN +#define CONFIG_BOOT1_HFS CONFIG_IS_BUILTIN +#define CONFIG_MODULES CONFIG_IS_BUILTIN +#define CONFIG_BOOT0_VERBOSE CONFIG_IS_BUILTIN +#define CONFIG_OPTIMIZATION_LEVEL "-Oz" +#define CONFIG_BDMESG CONFIG_IS_BUILTIN +#define CONFIG_BOOT1_HFS_ACTIVE_VERBOSE CONFIG_IS_BUILTIN +#define CONFIG_BOOT1_HFS_ACTIVE CONFIG_IS_BUILTIN +#define CONFIG_FDISK440 CONFIG_IS_BUILTIN +#define CONFIG_KEYLAYOUT_MODULE CONFIG_IS_MODULE diff --git a/autoconf.inc b/autoconf.inc new file mode 100644 index 0000000..08f3b54 --- /dev/null +++ b/autoconf.inc @@ -0,0 +1,24 @@ +; +; Automatically generated make config: don't edit +; Chameleon Configuration +; Wed Aug 7 21:43:55 2013 +; +CONFIG_BOOT1_HFS_DEBUG EQU 0 +CONFIG_SATA_MODULE EQU 0 +CONFIG_KLIBC_MODULE EQU 0 +CONFIG_BOOT0_DEBUG EQU 0 +CONFIG_OPENUP EQU 0 +CONFIG_BOOT1_HFS_VERBOSE EQU 1 +CONFIG_EMBED_THEME EQU 0 +CONFIG_BOOT1_HFS EQU 1 +CONFIG_MODULES EQU 1 +CONFIG_BOOT0_VERBOSE EQU 1 +CONFIG_ACPICODEC_MODULE EQU 0 +CONFIG_BDMESG EQU 1 +CONFIG_BOOT1_HFS_ACTIVE_VERBOSE EQU 1 +CONFIG_BOOT1_HFS_ACTIVE EQU 1 +CONFIG_BOOT1_HFS_ACTIVE_DEBUG EQU 0 +CONFIG_FDISK440 EQU 1 +CONFIG_RESOLUTION_MODULE EQU 0 +CONFIG_KEYLAYOUT_MODULE EQU 1 +CONFIG_MODULE_DEBUG EQU 0 diff --git a/coding_standards.txt b/coding_standards.txt new file mode 100644 index 0000000..78ebeb7 --- /dev/null +++ b/coding_standards.txt @@ -0,0 +1,83 @@ +Coding Standard rev. 0 (First Draft) + +1. Indentation + having seen most indentation styles going from 2 to 8 spaces, I would suggest a indentation of 4 spaces. + +2. Comments +I see here two main differents cases: +function description comments and one-line code quite comments + +For functions documentation, I suggest to use this syntax +/** + * + */ +Note the use of /** that will make future html auto-documentation easier (i.e: Doxygen at least recognize this marker) + +for punctual, short code comment, let's use: +// +3) #define at top of document +4) Global vars right below #include / #define (notation: gLobal) +Note that global vars and static vars should be avoided as much as possible in favor of local variables use, get/set functions (properties). + +5) No curly brackets for single lines + +6) else +{ + .... +} + +instead of: + +else { + .... +} + +7) if +{ + .... +} +instead of: + +if { + .... +} + +8) fall through code (using indention) or bail out early (using returns)? +Using early bail out for preconditions early in the function code, +use common sense to avoid as an example more than 4 imbricated if() constructions. +In the later case, consider decomposing your function in more manageable primitives. + +9) Spaces/readability i.e. not: if (fd<0) +but: if (fd < 0) + +10. types, variables, functions, naming +non const variables should follow the (currently mostly used) CamelCase convention: +int myVariableIsFine; +instead of : +int my_variable_is_ok; + +Functions should follow the same conventions except for standard c lib related functions. +Types should share the same convention but start with a Captial letter instead of lower case. + +11. Please make sure you extensively initialize variables: +avoid as much as possible: +int myVar +... +myVar = 10; + +but use instead: +int myVar = 10; + +12. const values: +const int MY_CONST_VARIABLE=42; is also ok for me, depending on the context of use. +or +const int MyConstVariable = 42; (with a Capital first letter) + +13. macro definitions should follow this convention: +#define MY_HANDY_MACROS_PSEUDO_FUNC() ... + +14. Macros use should be limited to really special cases where they bring real value (like special optimization cases) +Most of the time inlining a function is much better than the use of macros + +15. Don't optimize your code blindly, always favor readability when in doubt. +Very often, optimization is not necessary where you think it is, think about the bubble sort algorithm, where people would code it in assembly, where a heap or quick sort algorithm would be much more efficient (n log(n) instead of quadratic complexity), as an example when values count to be sorted get high. diff --git a/doc/.svn/all-wcprops b/doc/.svn/all-wcprops new file mode 100644 index 0000000..c387433 --- /dev/null +++ b/doc/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/chameleon/!svn/ver/2249/branches/Chimera/doc +END +themeinfo.png +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/themeinfo.png +END +org.chameleon.Boot.nvidia.plist +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/org.chameleon.Boot.nvidia.plist +END +Users_Guide0.5.pdf +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/Users_Guide0.5.pdf +END +BootHelp.txt +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/BootHelp.txt +END +README +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2249/branches/Chimera/doc/README +END diff --git a/doc/.svn/entries b/doc/.svn/entries new file mode 100644 index 0000000..74c4053 --- /dev/null +++ b/doc/.svn/entries @@ -0,0 +1,204 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/doc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +archive +dir + +themeinfo.png +file + + + + +2013-08-27T23:58:04.000000Z +cb30579d0d8643e2e083f97da89b2d58 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +158462 + +User_Guide_src +dir + +org.chameleon.Boot.nvidia.plist +file + + + + +2013-08-27T23:58:04.000000Z +30322f29ef64ab6746dc0472c0cfe843 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +752 + +Users_Guide0.5.pdf +file + + + + +2013-08-27T23:58:04.000000Z +56f2821a398cbac7f69a031ada2017b4 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +335862 + +BootHelp.txt +file + + + + +2013-08-27T23:58:04.000000Z +72fc6602a640a39767fd63586411175c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6805 + +README +file + + + + +2013-08-27T23:58:04.000000Z +4ecc770e8b659e2d271727f91ddeb300 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +2491 + diff --git a/doc/.svn/prop-base/Users_Guide0.5.pdf.svn-base b/doc/.svn/prop-base/Users_Guide0.5.pdf.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/.svn/prop-base/Users_Guide0.5.pdf.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/.svn/prop-base/org.chameleon.Boot.nvidia.plist.svn-base b/doc/.svn/prop-base/org.chameleon.Boot.nvidia.plist.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/doc/.svn/prop-base/org.chameleon.Boot.nvidia.plist.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/doc/.svn/prop-base/themeinfo.png.svn-base b/doc/.svn/prop-base/themeinfo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/.svn/prop-base/themeinfo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/.svn/text-base/BootHelp.txt.svn-base b/doc/.svn/text-base/BootHelp.txt.svn-base new file mode 100644 index 0000000..56503f4 --- /dev/null +++ b/doc/.svn/text-base/BootHelp.txt.svn-base @@ -0,0 +1,137 @@ +The boot: prompt waits for you to type advanced startup options. +If you don't type anything, the computer continues starting up normally. It +uses the kernel and configuration files on the startup device, which it also +uses as the root device. + +Advanced startup options use the following syntax: + + [device] [arguments] + +Example arguments include + + device: rd= (e.g. rd=disk0s2) + rd=* (e.g. rd=*/PCI0@0/CHN0@0/@0:1) + + kernel: kernel name (e.g. "mach_kernel" - must be in "/" ) + + flags: -v (verbose) -s (single user mode) + -x (safe mode) -f (ignore caches) + -F (ignore "Kernel Flags" specified in boot configuration file) + + "Graphics Mode"="WIDTHxHEIGHTxDEPTH" (e.g. "1024x768x32") + + kernel flags (e.g. debug=0x144) + io=0xffffffff (defined in IOKit/IOKitDebug.h) + +Example: mach_kernel rd=disk0s1 -v "Graphics Mode"="1920x1200x32" + +If the computer won't start up properly, you may be able to start it up +using safe mode. Type -x to start up in safe mode, which ignores all +cached driver files. + +Special booter hotkeys: + F5 Rescans optical drive. + F10 Scans and displays all BIOS accessible drives. + +Special booter commands: + ?memory Displays information about the computer's memory. + ?video Displays VESA video modes supported by the computer's BIOS. + ?norescan Leaves optical drive rescan mode. + +Additional useful command-line options: + config= Use an alternate Boot.plist file. + +Options useful in the org.chameleon.Boot.plist file: + Wait=Yes|No Prompt for a key press before starting the kernel. + "Quiet Boot"=Yes|No Use quiet boot mode (no messages or prompt). + Timeout=8 Number of seconds to pause at the boot: prompt. + "Instant Menu"=Yes Force displaying the partition selection menu. + + "Default Partition" Sets the default boot partition, + =hd(x,y)|UUID|"Label" Specified as a disk/partition pair, an UUID, or a + label enclosed in quotes. + + "Hide Partition" Remove unwanted partition(s) from the boot menu. + =partition Specified, possibly multiple times, as hd(x,y), an + [;partition2 ...] UUID or label enclosed in quotes. + + "Rename Partition" Rename partition(s) for the boot menu. + =partition Where partition is hd(x,y), UUID or label enclosed + [;partition2 in quotes. The alias can optionally be quoted too. + ...] + + GUI=No Disable the GUI (enabled by default). + "Boot Banner"=Yes|No Show boot banner in GUI mode (enabled by default). + ShowInfo=No Disables display of partition and resolution details. + "Boot Banner"=No will also disable this info. + "Legacy Logo"=Yes|No Use the legacy grey apple logo (disabled by default). + + PciRoot= Use an alternate value for PciRoot (default value 0). + + UseKernelCache=Yes|No Yes will load pre-linked kernel and will ignore /E/E + and /S/L/E/Extensions.mkext. + Default is No but Yes if you use Lion on a Raid partition. + + KeyLayout=keymap Use to change the keyboard mapping of the bootloader + (e.g. KeyLayout=mac-fr) + + GraphicsEnabler=Yes|No Automatic device-properties generation for gfx cards. + AtiConfig= Use a different card config, e.g. AtiConfig=Megalodon. + AtiPorts= Specify the number of ports, e.g. AtiPorts=2. + UseAtiROM=Yes|No Use an alternate Ati ROM image + (path: /Extra/__.rom) + UseNvidiaROM=Yes|No Use an alternate Nvidia ROM image + (path: /Extra/_.rom) + VBIOS=Yes|No Inject NVIDIA VBIOS into device-properties. + display_0= Inject alternate value of display-cfg into NVDA,Display-A@0 (HEX). + display_1= Inject alternate value of display-cfg into NVDA,Display-B@1 (HEX). + EnableHDMIAudio=Yes Inject HDMI audio for NVIDIA + + EthernetBuiltIn=Yes|No Automatic "built-in"=yes device-properties generation + for ethernet interfaces. + + USBBusFix=Yes Enable all USB fixes below: + EHCIacquire=Yes Enable the EHCI fix (disabled by default). + UHCIreset=Yes Enable the UHCI fix (disabled by default). + USBLegacyOff=Yes Enable the USB Legacy fix (disabled by default). + + ForceHPET=Yes|No Force Enable HPET. + + Wake=No Disable wake up after hibernation (default: enabled). + ForceWake=Yes Force using the sleepimage (disabled by default). + WakeImage= Use an alternate sleepimage file. + (default path is /private/var/vm/sleepimage). + + DropSSDT=Yes Skip the SSDT tables while relocating the ACPI tables. + DSDT= Use an alternate DSDT.aml file + (default paths: + /DSDT.aml /Extra/DSDT.aml bt(0,0)/Extra/DSDT.aml). + + GenerateCStates=Yes Enable auto generation of processor idle sleep states + (C-States). + GeneratePStates=Yes Enable auto generation of processor power performance + states (P-States). + CSTUsingSystemIO=Yes New C-State _CST generation method using SystemIO + registers instead of FixedHW. + + EnableC2State=Yes Enable specific Processor power state, C2. + EnableC3State=Yes Enable specific Processor power state, C3. + EnableC4State=Yes Enable specific Processor power state, C4. + + SMBIOS= Use an alternate SMBIOS.plist file + (default paths: + /Extra/SMBIOS.plist bt(0,0)/Extra/SMBIOS.plist). + + SMBIOSdefaults=No Don't use the Default values for SMBIOS overriding if + smbios.plist doesn't exist, factory values are kept. + + "Scan Single Drive" Scan the drive only where the booter got loaded from. + =Yes|No Fix rescan pbs when using a DVD reader in AHCI mode. + Rescan=Yes Enable CD-ROM rescan mode. + "Rescan Prompt"=Yes Prompts for enable CD-ROM rescan mode. + SystemId= Set manually the system id UUID, + SMUUID in smbios config (reserved field) isn't used. + SystemType= Set the system type where n is between 0..6 + (default =1 (Desktop) + md0= Load raw img file into memory for use as XNU's md0 + ramdisk. /Extra/Postboot.img is used otherwise. diff --git a/doc/.svn/text-base/README.svn-base b/doc/.svn/text-base/README.svn-base new file mode 100644 index 0000000..0d1a93d --- /dev/null +++ b/doc/.svn/text-base/README.svn-base @@ -0,0 +1,89 @@ + + Chameleon Boot Loader + ===================== + + What is it? + ----------- + + Chameleon is combination of various boot loader components. It is based + on David Elliott's fake EFI implementation added to Apple's boot-132 + project. Chameleon is extended with the following key features: + + + Features + -------- + + - Device Property Injection via device-properties string in org.chameleon.Boot.plist + - hybrid boot0+boot1h loaders for both MBR and GPT partitioned disks. + - automatic FSB detection code even for recent AMD CPUs. + - Apple Software RAID support. + - stage2 loader (boot) can be placed as a regular file in the boot + partition's root folder. + - Modules + + + Installation + ============ + + Normal Install (non-RAID): + -------------------------- + + Suppose that your installation is on /dev/disk0s2 + + - Install boot0 to the MBR: + sudo ./fdisk440 -f boot0 -u -y /dev/rdisk0 + + - Install boot1h to the partition's bootsector: + sudo dd if=boot1h of=/dev/rdisk0s2 + + - Install boot to the partition's root directory: + sudo cp boot / + + No need to use startupfiletool anymore! + + + RAID Install: + ------------- + + Suppose that your installation is on /dev/disk3, which is either a mirror- or a + stripeset consisting of /dev/disk0 and /dev/disk1 + + Mac OS X creates a small helper partition at the end of each RAID member disk, + namely /dev/disk0s3 and /dev/disk1s3 + + - Install boot0 to the MBR of both disks: + sudo ./fdisk440 -f boot0 -u -y /dev/rdisk0 + sudo ./fdisk440 -f boot0 -u -y /dev/rdisk1 + + - Install boot1h to the bootsector of each boot partition: + sudo dd if=boot1h of=/dev/rdisk0s3 + sudo dd if=boot1h of=/dev/rdisk1s3 + + - Install boot to both helper partition's root directories. + diskutil mount disk0s3 + cp boot /Volumes/Boot\ OSX + diskutil unmount disk0s3 + diskutil mount disk1s3 + cp boot /Volumes/Boot\ OSX + diskutil unmount disk1s3 + + Support: + -------- + + If you have any questions, issues etc. feel free to join us + at irc.voodooprojects.org #chameleon or http://forum.voodooprojects.org/ + + + Source Code + ----------- + + For downloading the source code please visit the project page at + http://forge.voodooprojects.org/p/chameleon/ + + + + Licensing + --------- + + Chameleon is released under the terms and conditions of + Apple Public Source License (see APPLE_LICENSE). diff --git a/doc/.svn/text-base/Users_Guide0.5.pdf.svn-base b/doc/.svn/text-base/Users_Guide0.5.pdf.svn-base new file mode 100644 index 0000000..293c7e5 Binary files /dev/null and b/doc/.svn/text-base/Users_Guide0.5.pdf.svn-base differ diff --git a/doc/.svn/text-base/org.chameleon.Boot.nvidia.plist.svn-base b/doc/.svn/text-base/org.chameleon.Boot.nvidia.plist.svn-base new file mode 100644 index 0000000..3e6bfa8 --- /dev/null +++ b/doc/.svn/text-base/org.chameleon.Boot.nvidia.plist.svn-base @@ -0,0 +1,31 @@ + + + + + Default Partition + + GraphicsEnabler + Yes + Kernel + mach_kernel + Kernel Flags + + NVIDIA + + + Chipset Name + Quadro FX 380 + IOPCIPrimaryMatch + 0x10DE0658 + IOPCISubDevId + 0x00000000 + VRam Size + 256 + + + Quiet Boot + No + Timeout + 5 + + diff --git a/doc/.svn/text-base/themeinfo.png.svn-base b/doc/.svn/text-base/themeinfo.png.svn-base new file mode 100644 index 0000000..9181553 Binary files /dev/null and b/doc/.svn/text-base/themeinfo.png.svn-base differ diff --git a/doc/BootHelp.txt b/doc/BootHelp.txt new file mode 100644 index 0000000..56503f4 --- /dev/null +++ b/doc/BootHelp.txt @@ -0,0 +1,137 @@ +The boot: prompt waits for you to type advanced startup options. +If you don't type anything, the computer continues starting up normally. It +uses the kernel and configuration files on the startup device, which it also +uses as the root device. + +Advanced startup options use the following syntax: + + [device] [arguments] + +Example arguments include + + device: rd= (e.g. rd=disk0s2) + rd=* (e.g. rd=*/PCI0@0/CHN0@0/@0:1) + + kernel: kernel name (e.g. "mach_kernel" - must be in "/" ) + + flags: -v (verbose) -s (single user mode) + -x (safe mode) -f (ignore caches) + -F (ignore "Kernel Flags" specified in boot configuration file) + + "Graphics Mode"="WIDTHxHEIGHTxDEPTH" (e.g. "1024x768x32") + + kernel flags (e.g. debug=0x144) + io=0xffffffff (defined in IOKit/IOKitDebug.h) + +Example: mach_kernel rd=disk0s1 -v "Graphics Mode"="1920x1200x32" + +If the computer won't start up properly, you may be able to start it up +using safe mode. Type -x to start up in safe mode, which ignores all +cached driver files. + +Special booter hotkeys: + F5 Rescans optical drive. + F10 Scans and displays all BIOS accessible drives. + +Special booter commands: + ?memory Displays information about the computer's memory. + ?video Displays VESA video modes supported by the computer's BIOS. + ?norescan Leaves optical drive rescan mode. + +Additional useful command-line options: + config= Use an alternate Boot.plist file. + +Options useful in the org.chameleon.Boot.plist file: + Wait=Yes|No Prompt for a key press before starting the kernel. + "Quiet Boot"=Yes|No Use quiet boot mode (no messages or prompt). + Timeout=8 Number of seconds to pause at the boot: prompt. + "Instant Menu"=Yes Force displaying the partition selection menu. + + "Default Partition" Sets the default boot partition, + =hd(x,y)|UUID|"Label" Specified as a disk/partition pair, an UUID, or a + label enclosed in quotes. + + "Hide Partition" Remove unwanted partition(s) from the boot menu. + =partition Specified, possibly multiple times, as hd(x,y), an + [;partition2 ...] UUID or label enclosed in quotes. + + "Rename Partition" Rename partition(s) for the boot menu. + =partition Where partition is hd(x,y), UUID or label enclosed + [;partition2 in quotes. The alias can optionally be quoted too. + ...] + + GUI=No Disable the GUI (enabled by default). + "Boot Banner"=Yes|No Show boot banner in GUI mode (enabled by default). + ShowInfo=No Disables display of partition and resolution details. + "Boot Banner"=No will also disable this info. + "Legacy Logo"=Yes|No Use the legacy grey apple logo (disabled by default). + + PciRoot= Use an alternate value for PciRoot (default value 0). + + UseKernelCache=Yes|No Yes will load pre-linked kernel and will ignore /E/E + and /S/L/E/Extensions.mkext. + Default is No but Yes if you use Lion on a Raid partition. + + KeyLayout=keymap Use to change the keyboard mapping of the bootloader + (e.g. KeyLayout=mac-fr) + + GraphicsEnabler=Yes|No Automatic device-properties generation for gfx cards. + AtiConfig= Use a different card config, e.g. AtiConfig=Megalodon. + AtiPorts= Specify the number of ports, e.g. AtiPorts=2. + UseAtiROM=Yes|No Use an alternate Ati ROM image + (path: /Extra/__.rom) + UseNvidiaROM=Yes|No Use an alternate Nvidia ROM image + (path: /Extra/_.rom) + VBIOS=Yes|No Inject NVIDIA VBIOS into device-properties. + display_0= Inject alternate value of display-cfg into NVDA,Display-A@0 (HEX). + display_1= Inject alternate value of display-cfg into NVDA,Display-B@1 (HEX). + EnableHDMIAudio=Yes Inject HDMI audio for NVIDIA + + EthernetBuiltIn=Yes|No Automatic "built-in"=yes device-properties generation + for ethernet interfaces. + + USBBusFix=Yes Enable all USB fixes below: + EHCIacquire=Yes Enable the EHCI fix (disabled by default). + UHCIreset=Yes Enable the UHCI fix (disabled by default). + USBLegacyOff=Yes Enable the USB Legacy fix (disabled by default). + + ForceHPET=Yes|No Force Enable HPET. + + Wake=No Disable wake up after hibernation (default: enabled). + ForceWake=Yes Force using the sleepimage (disabled by default). + WakeImage= Use an alternate sleepimage file. + (default path is /private/var/vm/sleepimage). + + DropSSDT=Yes Skip the SSDT tables while relocating the ACPI tables. + DSDT= Use an alternate DSDT.aml file + (default paths: + /DSDT.aml /Extra/DSDT.aml bt(0,0)/Extra/DSDT.aml). + + GenerateCStates=Yes Enable auto generation of processor idle sleep states + (C-States). + GeneratePStates=Yes Enable auto generation of processor power performance + states (P-States). + CSTUsingSystemIO=Yes New C-State _CST generation method using SystemIO + registers instead of FixedHW. + + EnableC2State=Yes Enable specific Processor power state, C2. + EnableC3State=Yes Enable specific Processor power state, C3. + EnableC4State=Yes Enable specific Processor power state, C4. + + SMBIOS= Use an alternate SMBIOS.plist file + (default paths: + /Extra/SMBIOS.plist bt(0,0)/Extra/SMBIOS.plist). + + SMBIOSdefaults=No Don't use the Default values for SMBIOS overriding if + smbios.plist doesn't exist, factory values are kept. + + "Scan Single Drive" Scan the drive only where the booter got loaded from. + =Yes|No Fix rescan pbs when using a DVD reader in AHCI mode. + Rescan=Yes Enable CD-ROM rescan mode. + "Rescan Prompt"=Yes Prompts for enable CD-ROM rescan mode. + SystemId= Set manually the system id UUID, + SMUUID in smbios config (reserved field) isn't used. + SystemType= Set the system type where n is between 0..6 + (default =1 (Desktop) + md0= Load raw img file into memory for use as XNU's md0 + ramdisk. /Extra/Postboot.img is used otherwise. diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..0d1a93d --- /dev/null +++ b/doc/README @@ -0,0 +1,89 @@ + + Chameleon Boot Loader + ===================== + + What is it? + ----------- + + Chameleon is combination of various boot loader components. It is based + on David Elliott's fake EFI implementation added to Apple's boot-132 + project. Chameleon is extended with the following key features: + + + Features + -------- + + - Device Property Injection via device-properties string in org.chameleon.Boot.plist + - hybrid boot0+boot1h loaders for both MBR and GPT partitioned disks. + - automatic FSB detection code even for recent AMD CPUs. + - Apple Software RAID support. + - stage2 loader (boot) can be placed as a regular file in the boot + partition's root folder. + - Modules + + + Installation + ============ + + Normal Install (non-RAID): + -------------------------- + + Suppose that your installation is on /dev/disk0s2 + + - Install boot0 to the MBR: + sudo ./fdisk440 -f boot0 -u -y /dev/rdisk0 + + - Install boot1h to the partition's bootsector: + sudo dd if=boot1h of=/dev/rdisk0s2 + + - Install boot to the partition's root directory: + sudo cp boot / + + No need to use startupfiletool anymore! + + + RAID Install: + ------------- + + Suppose that your installation is on /dev/disk3, which is either a mirror- or a + stripeset consisting of /dev/disk0 and /dev/disk1 + + Mac OS X creates a small helper partition at the end of each RAID member disk, + namely /dev/disk0s3 and /dev/disk1s3 + + - Install boot0 to the MBR of both disks: + sudo ./fdisk440 -f boot0 -u -y /dev/rdisk0 + sudo ./fdisk440 -f boot0 -u -y /dev/rdisk1 + + - Install boot1h to the bootsector of each boot partition: + sudo dd if=boot1h of=/dev/rdisk0s3 + sudo dd if=boot1h of=/dev/rdisk1s3 + + - Install boot to both helper partition's root directories. + diskutil mount disk0s3 + cp boot /Volumes/Boot\ OSX + diskutil unmount disk0s3 + diskutil mount disk1s3 + cp boot /Volumes/Boot\ OSX + diskutil unmount disk1s3 + + Support: + -------- + + If you have any questions, issues etc. feel free to join us + at irc.voodooprojects.org #chameleon or http://forum.voodooprojects.org/ + + + Source Code + ----------- + + For downloading the source code please visit the project page at + http://forge.voodooprojects.org/p/chameleon/ + + + + Licensing + --------- + + Chameleon is released under the terms and conditions of + Apple Public Source License (see APPLE_LICENSE). diff --git a/doc/User_Guide_src/.svn/all-wcprops b/doc/User_Guide_src/.svn/all-wcprops new file mode 100644 index 0000000..4820811 --- /dev/null +++ b/doc/User_Guide_src/.svn/all-wcprops @@ -0,0 +1,71 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src +END +install_complete.png +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/install_complete.png +END +Chameleon 2 v0.5.docx +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/Chameleon%202%20v0.5.docx +END +install_stand.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/install_stand.png +END +colorchart.png +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/colorchart.png +END +Chameleon 2 v0.4.xml +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/Chameleon%202%20v0.4.xml +END +install_start.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/install_start.png +END +install_cust.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/install_cust.png +END +install_dest.png +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/install_dest.png +END +screen_format.png +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/screen_format.png +END +chameleon.png +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/chameleon.png +END +xnulogo.png +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/User_Guide_src/xnulogo.png +END diff --git a/doc/User_Guide_src/.svn/entries b/doc/User_Guide_src/.svn/entries new file mode 100644 index 0000000..19831a9 --- /dev/null +++ b/doc/User_Guide_src/.svn/entries @@ -0,0 +1,402 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/doc/User_Guide_src +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +install_complete.png +file + + + + +2013-08-27T23:57:58.000000Z +f208024faadf045ca86d01815958adb8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +125856 + +Chameleon 2 v0.5.docx +file + + + + +2013-08-27T23:57:58.000000Z +aa9ed976a190832b01de5b91de84e71b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +762420 + +install_stand.png +file + + + + +2013-08-27T23:57:58.000000Z +7991ffcd9920302cd669dc184d241d78 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +128580 + +colorchart.png +file + + + + +2013-08-27T23:57:58.000000Z +c090580ae3b24c15dbdda7025721ee85 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +10707 + +Chameleon 2 v0.4.xml +file + + + + +2013-08-27T23:57:58.000000Z +3906676ca2b404effaf7b8dba3f668c3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1169621 + +install_start.png +file + + + + +2013-08-27T23:57:58.000000Z +4b1acd7f8e92c48d0b38e078285e33fa +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +126684 + +install_cust.png +file + + + + +2013-08-27T23:57:58.000000Z +fa18703f85eb4b3116b8961578cfb00b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +103154 + +install_dest.png +file + + + + +2013-08-27T23:57:58.000000Z +320bf35aabd818463a4d43546d211ce4 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +136313 + +screen_format.png +file + + + + +2013-08-27T23:57:58.000000Z +711121157c456d1559476a042cb9dd63 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +26010 + +chameleon.png +file + + + + +2013-08-27T23:57:58.000000Z +79227399f7bc498d02570f6d7bdeb8fd +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +117302 + +xnulogo.png +file + + + + +2013-08-27T23:57:58.000000Z +5281fd1b2f1f5b08d7e236e5eb494691 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8389 + diff --git a/doc/User_Guide_src/.svn/prop-base/Chameleon 2 v0.5.docx.svn-base b/doc/User_Guide_src/.svn/prop-base/Chameleon 2 v0.5.docx.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/Chameleon 2 v0.5.docx.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/chameleon.png.svn-base b/doc/User_Guide_src/.svn/prop-base/chameleon.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/chameleon.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/colorchart.png.svn-base b/doc/User_Guide_src/.svn/prop-base/colorchart.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/colorchart.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/install_complete.png.svn-base b/doc/User_Guide_src/.svn/prop-base/install_complete.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/install_complete.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/install_cust.png.svn-base b/doc/User_Guide_src/.svn/prop-base/install_cust.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/install_cust.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/install_dest.png.svn-base b/doc/User_Guide_src/.svn/prop-base/install_dest.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/install_dest.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/install_stand.png.svn-base b/doc/User_Guide_src/.svn/prop-base/install_stand.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/install_stand.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/install_start.png.svn-base b/doc/User_Guide_src/.svn/prop-base/install_start.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/install_start.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/screen_format.png.svn-base b/doc/User_Guide_src/.svn/prop-base/screen_format.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/screen_format.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/prop-base/xnulogo.png.svn-base b/doc/User_Guide_src/.svn/prop-base/xnulogo.png.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/User_Guide_src/.svn/prop-base/xnulogo.png.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/User_Guide_src/.svn/text-base/Chameleon 2 v0.4.xml.svn-base b/doc/User_Guide_src/.svn/text-base/Chameleon 2 v0.4.xml.svn-base new file mode 100644 index 0000000..917d8d8 --- /dev/null +++ b/doc/User_Guide_src/.svn/text-base/Chameleon 2 v0.4.xml.svn-base @@ -0,0 +1,12299 @@ + + +Kevyn ShortellKevyn Shortell202009-03-29T08:05:00Z2009-03-30T07:05:00Z2009-03-30T07:05:00Z1415138626Apple71171059312iVBORw0KGgoAAAANSUhEUgAAAtAAAAD5CAYAAAAOawJLAAADJWlDQ1BJQ0MgUHJvZmlsZQAAeAGF +lE1IFGEYx/+zjQSxBtGXCMXQwSRUJgtSAtP1K1O2ZdVMCWKdfXedHGenmd0tRSKE6Jh1jC5WRIeI +TuGhQ6c6RASZdYmgo0UQBV4itv87k7tjVL4wM795nv/7fL3DAFWPUo5jRTRgys67yd6Ydnp0TNv8 +GlWoRhRcKcNzOhKJAZ+plc/1a/UtFGlZapSx1vs2fKt2mRBQNCp3ZAM+LHk84OOSL+SdPDVnJBsT +qTTZITe4Q8lO8i3y1myIx0OcFp4BVLVTkzMcl3EiO8gtRSMrYz4g63batMnvpT3tGVPUsN/INzkL +2rjy/UDbHmDTi4ptzAMe3AN211Vs9TXAzhFg8VDF9j3pz0fZ9crLHGr2wynRGGv6UCp9rwM23wB+ +Xi+VftwulX7eYQ7W8dQyCm7R17Iw5SUQ1BvsZvzkGv2Lg558VQuwwDmObAH6rwA3PwL7HwLbHwOJ +amCoFZHLbDe48uIi5wJ05pxp18xO5LVmXT+idfBohdZnG00NWsqyNN/laa7whFsU6SZMWQXO2V/b +eI8Ke3iQT/YXuSS87t+szKVTXZwlmtjWp7To6iY3kO9nzJ4+cj2v9xm3Zzhg5YCZ7xsKOHLKtuI8 +F6mJ1Njj8ZNkxldUJx+T85A85xUHZUzffi51IkGupT05meuXml3c2z4zMcQzkqx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pMrH3ikPOKAXwOwM9d2sforucg5vzluuHmZ/fZPjsxONBfR0kQhtZS +cYUJ/PzufFcJk3teRFWXj6+yd1mAgKz3iuS8wLJXLk1y3BUP8PkC/AbER3Qe/Wo62fXQKz//J+GS +Lc/GOSD2yvn6Cgh8srM8jzfh/sHJ5rVw7KUwPQC2AP8UdDurTsUnZ/AsxJaL/fRKMehJXHxHXOxj +MDpAls+RXnoBxmeoLYH4KTqrSEWTM8ABD2cqd8UDPFnLj6rHHP9i5jauR02JNzWOKbin8LS8YGpz +FjUXnfrTu+94csUALifaNoo5fQdJft2uWP80uFQa4ay54D3n1XIhDFa8YgCX97Dgyy569vmYmNlN +i54OhqkGp2YdOK+G0RVJ2JOw+FKljO75SuotATN9mkUmj2a6ZQyrg0uvqk2xMptYdcUAnljMJ5oi +wz3Uj34ZjFYg3n76hSa1eDOdWE3XNx88oOX2PJgrBvCED2Ms0emXIqvXUlYZmM1wM76nIRmhOinj +amVzayp+Wq9iroDAJ7SnMLEjSRVz8QZUHBJPnr6nqwagkvXrRlmcOZH6CU9fi/4Krz2g1GXB+sUC +dPSFcuY+yw5Pw03xoj87qfKKAXy2u0koixxfe9DkCwmt4GMtFR/mMF4xgM9l9wveV+RVGcbSfyHN +sFRVVV9ba5ToiTOSfyUNQL1D8ajIF86Y2h0PoDjnfJxEzY01ntjx/wO01j38AzCIrwAAAABJRU5E +rkJggk== +Chameleon 2.0 Users GuideRevision 0.4Table of ContentsIntroductionPage 2Running the InstallerPage 3Custom InstallPage 4Advanced OptionsPage 6Boot.plist configurationPage 7Custom boot.plist variablesPage 6ThemesPage 8Screen LayoutPage 9Boot devicesPage 8Boot promptPage 9Info boxPage 10MenuPage 11Boot displayPage 12IntroductionChameleon 2.0 the latest version of the of the Chameleon boot loader for OS X on X86 hardware. It is an EFI boot loader that is designed to replace the Darwin and PC_EFI boot loaders. It has several new features including:Graphical User Interface modeCustomizable ImagesSupport for GPT/MBR partition typesRAID supportiVBORw0KGgoAAAANSUhEUgAABAAAAAMACAIAAAA12IJaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ +bWFnZVJlYWR5ccllPAABydhJREFUeNrs/WmQZNmVH3b+zzn3vufuseZWmVlZe2FtoFBAA91NtjXZ +UnWTHJFscdE2kmkkcUbkjGnMNF/GZr6MaT7OhzGbxUY2MtkMKaMojc2IklEUF0ndTfRONIAG0I1G +YakqFGqvyj0zItz9vXfvPWc+3OceHpGZ1SDZpDGRJ5DI8vD4uWeEx4vMe+/Z6IUXfx6AmRIxTr6d +vFMBfsCH3Lt37969e/fu3bt3/3D48X0iBnTtNu5cv8vr+927d+/evXv37t27d/+QenrhxZc2tw4P +3jHgvlsN9+7du3fv3r179+7dP0Seq17vEh60jdj4qHv37t27d+/evXv37h9WT7UG4MTuwRQnNwoP +2Gq4d+/evXv37t27d+/+IfN87+4BG6lCY57QSm/uJ9y7d+/evXv37t27d//Q+XUE4FTm0OlEons2 +Ge7du3fv3r179+7du3/4/Lp2+NQe4tSD791kuHfv3r179+7du3fv/uHzTHRv/6BT0QReP6wC9+7d +u3fv3r179+7dP6x+owhYzfAHjQ/YfHPv3r179+7du3fv3v1D5k91AdpE+IPSjNy7d+/evXv37t27 +d/+QeT4ZHcBGhtBm7GB9p7p37969e/fu3bt37/7h9ccRgPUG4kN2EvfdcLh37969e/fu3bt37/5h +8bxZPXDqBu7TWBTu3bt37969e/fu3bt/eD0/aHTwamTA5m1e7Rncu3fv3r179+7du3f/UHr69Gde +uidAcHpqwH0jC+7du3fv3r179+7du3/oPBPdWwd8n8HCpyIL7t27d+/evXv37t27fxj9Zp7Q6ajB +yee6d76Ae/fu3bt37969e/fuHzJPL7z40oMCBA8oH1b37t27d+/evXv37t0/pP6BRcCnthEbH3Xv +3r179+7du3fv3v3D6k9NAlaAYQr6IWeMuXfv3r179+7du3fv/mHyfO/uARupQicbDN3bRtS9e/fu +3bt37969e/cPk19HAE5lDp1OJLpnk+HevXv37t27d+/evfuHz69rh0/tIU49+N5Nhnv37t27d+/e +vXv37h8+z0T39g86FU3g9cMqcO/evXv37t27d+/e/cPqN4qA1Qz3FhN8SIWBe/fu3bt37969e/fu +Hy5/qgvQJsIflGbk3r179+7du3fv3r37h8zfOzd4nSG0GTtY36nu3bt37969e/fu3bt/eP1xBGC9 +gfiQncR9Nxzu3bt37969e/fu3bt/WDxvVg+cuoH7NBaFe/fu3bt37969e/fuH17PDxodvBoZsHmb +V3sG9+7du3fv3r179+7dP5SePv2Zl+4JEJyeGnDfyIJ79+7du3fv3r179+4fOs9E99YB32ew8KnI +gnv37t27d+/evXv37h9Gv5kndDpqcPK57p0v4N69e/fu3bt37969+4fM0wsvvvSgAMEDyofVvXv3 +7t27d+/evXv3D6l/YBHwqW3Exkfdu3fv3r179+7du3f/sPpTk4AVYJiCfsgZY+7du3fv3r179+7d +u3+YPN+7e8BGqtDJBkP3thF17969e/fu3bt37979w+TXEYBTmUOnE4nu2WS4d+/evXv37t27d+/+ +4fPr2uFTe4hTD753k+HevXv37t27d+/evfuHzzPRvf2DTkUTeP2wCty7d+/evXv37t27d/+w+o0i +YDXDvcUEH1Jh4N69e/fu3bt37969+4fLn+oCtInwB6UZuXfv3r179+7du3fv/iHz984NXmcIbcYO +1neqe/fu3bt37969e/fuH15/HAFYbyA+ZCdx3w2He/fu3bt37969e/fuHxbPm9UDp27gPo1F4d69 +e/fu3bt37969+4fX84NGB69GBmze5tWewb179+7du3fv3r179w+lp09/5qV7AgSnpwbcN7Lg3r17 +9+7du3fv3r37h84z0b11wPcZLHwqsuDevXv37t27d+/evfuH0W/mCZ2OGpx8rnvnC7h37969e/fu +3bt37/4h8/TCiy89KEDwgPJhde/evXv37t27d+/e/UPqH1gEfGobsfFR9+7du3fv3r179+7dP6z+ +1CRgBRimoB9yxph79+7du3fv3r179+4fJs/37h6wkSp0ssHQvW1E3bt37969e/fu3bt3/zD5dQTg +VObQ6USiezYZ7t27d+/evXv37t27f/j8unb41B7i1IPv3WS4d+/evXv37t27d+/+4fNMdG//oFPR +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mel6glqx9VlbTyL6pSWgAl3U9dMaijf60aDIbvxsT3v/POO+/8JE+Ik/5B +Y9UEql+WAOedd955553/InitF+kbzvy1oB8RVSKApowAANVA1KKUOp8U4qvVob+qxLq3OBn/QyX+ +UTPf/84777zzm/ONJmA1gycaH9C8Oe+888477/wXw9OwA7i0BwUAQisbhQGs1AXV31sKQKZabyNN ++EpBf20MCqO+n77/nXfeeec35cdcgJoQPJHMyHnnnXfeeee/SL6ZA5haw/wHGotY5aJ+bRlUbaSW ++I/8WNn+qO9/55133vmz8DRaHYCGQqhZO6gfVOedd955553/v+e18vkxbej4RdWg+jNc2K+8PssG +AAAQtXqGQPlyHat0+/533nnnnd+cH1YA6gTiLJnEpgmH884777zzzn/RPDVW95MiqC4IpMaAM2xz +ZNU/bURUfH8677zzzj8hT83ugbE7sImxKDjvvPPOO+/8l5DXaoxXqgaM2flbdVPR5n0AME1zf8sU +Qs18fzrvvPPOPxmezjQ6uBoZ0LxPdWnVeeedd95557+EfB35ayXpkcr3J91J6UF1PzX7lqv+pTDI +96fzzjvv/JPj8eprb5woEIy3T21aWXDeeeedd975p4ivp4Y1RwiP3TYT/Pj+dN55551/Yp4QJ/uA +NxksPFZZcN5555133vmnjlcbuv4njVD1iKUJYLXgx/en88477/wXyjd1QuNVg9FtTc4XcN555513 +3nnnnXfeeefPMR6vue7GMxUIztA+rM4777zzzjvvvPPOO+/8OcqfsQl4LI1oPOu8884777zzzjvv +vPPOn6v82CRgBSAwBXySM8acd95555133nnnnXfe+XOJp8nsARpSoVGDoUkbUeedd95555133nnn +nXf+XOLrCsCYcmhcSDSRZDjvvPPOO++8884777zz5x5f9w6P5RBjL55MMpx33nnnnXfeeeedd975 +c48nxEn/oLFqAtUvS4DzzjvvvPPOO++88847f67yjSZgNYPJZoKzdBg477zzzjvvvPPOO++88+cW +P+YC1ITgiWRGzjvvvPPOO++888477/w5xk/ODa4VQs3aQf2gOu+8884777zzzjvvvPPnLj+sANQJ +xFkyiU0TDuedd95555133nnnnXf+XOGp2T0wdgc2MRYF55133nnnnXfeeeedd/7c5elMo4OrkQHN ++1TlDM4777zzzjvvvPPOO+/8Ocnj1dfeOFEgGJ8asGllwXnnnXfeeeedd955550/53hCnOwD3mSw +8FhlwXnnnXfeeeedd955550/F/mmTmi8ajC6rcn5As4777zzzjvvvPPOO+/8OcbjNdfdeKYCwRna +h9V555133nnnnXfeeeedP0f5MzYBj6URjWedd95555133nnnnXfe+XOVH5sErAAEpoBPcsaY8847 +77zzzjvvvPPOO38u8TSZPUBDKjRqMDRpI+q8884777zzzjvvvPPOn0t8XQEYUw6NC4kmkgznnXfe +eeedd9555513/tzj697hsRxi7MWTSYbzzjvvvPPOO++88847f+7xhDjpHzRWTaD6ZQlw3nnnnXfe +eeedd955589VvtEErGYw2Uxwlg4D55133nnnnXfeeeedd/7c4sdcgJoQPJHMyHnnnXfeeeedd955 +550/x/jJucG1QqhZO6gfVOedd95555133nnnnXf+3OWHFYA6gThLJrFpwuG8884777zzzjvvvPPO +nys8NbsHxu7AJsai4LzzzjvvvPPOO++8886fuzydaXRwNTKgeZ+qnMF555133nnnnXfeeeedPyd5 +vPraGycKBONTAzatLDjvvPPOO++8884777zz5xxPiJN9wJsMFh6rLDjvvPPOO++8884777zz5yLf +1AmNVw1GtzU5X8B555133nnnnXfeeeedP8d4vOa6G89UIDhD+7A677zzzjvvvPPOO++88+cof8Ym +4LE0ovGs884777zzzjvvvPPOO3+u8mOTgBWAwBTwSc4Yc95555133nnnnXfeeefPJZ4mswdoSIVG +DYYmbUSdd95555133nnnnXfe+XOJrysAY8qhcSHRRJLhvPPOO++8884777zzzp97fN07PJZDjL14 +Mslw3nnnnXfeeeedd9555889nhAn/YPGqglUvywBzjvvvPPOO++888477/y5yjeagNUMJpsJztJh +4LzzzjvvvPPOO++8886fW/yYC1ATgieSGTnvvPPOO++8884777zz5xg/OTe4Vgg1awf1g+q88847 +77zzzjvvvPPOn7v8sAJQJxBnySQ2TTicd95555133nnnnXfe+XOFp2b3wNgd2MRYFJx33nnnnXfe +eeedd975c5enM40OrkYGNO9TlTM477zzzjvvvPPOO++88+ckj1dfe+NEgWB8asCmlQXnnXfeeeed +d9555513/pzjCXGyD3iTwcJjlQXnnXfeeeedd9555513/lzkmzqh8arB6LYm5ws477zzzjvvvPPO +O++88+cYj9dcd+OZCgRnaB9W55133nnnnXfeeeedd/4c5c/YBDyWRjSedd5555133nnnnXfeeefP +VX5sErACEJgCPskZY84777zzzjvvvPPOO+/8ucTTZPYADanQqMHQpI2o884777zzzjvvvPPOO38u +8XUFYEw5NC4kmkgynHfeeeedd95555133vlzj697h8dyiLEXTyYZzjvvvPPOO++888477/y5xxPi +pH/QWDWB6pclwHnnnXfeeeedd955550/V/lGE7CawWQzwVk6DJx33nnnnXfeeeedd975c4sfcwFq +QvBEMiPnnXfeeeedd9555513/hzj8Zrrvmr0lZu2CzQLB+S886O87N2z44rLD+zdu/vgpQf2nbdn +lAcAQCzvI5Z/18/W989R/vHDR+6/74HDh4/e87kHjhw9WT3r54/zzjvvvPPOO/8M5YcVgPplZ8kk +Nk04nN+y/PRU+3Wvu/HVN3zFFVdc2u1OiYiqiCiOBdGbb98SVt85R3kkZOIQwsbG+j333PfXf3PT +hz/8V+sbAz9/nHfeeeedd975ZyaP11x345lGB4+9uLqvzjvPjG/55te94x3/ZG5udmOj9/DDj9x+ ++2cff/zxo0ePr66uWlo2Hw2mn0xgfc7xiDg7O7t7947zztt33XXPufDCC6anp1ZWVv/zf/6d3/nd +/60Gfv4477zzzjvvvPPPNL6sAEymC83NTeYQzm9lfufOhd/4wL/ZuXPn0tLSX/7VRz/84f/z0EOH +YiGAKCqEBABqShVf3R/e6kcm7pyTPCKaSqvduuiifa973dfd+OpXLi4uHD9+/F3f+QNHjy35+eO8 +884777zzzj+jeLz62hsnCgRPNodwfgvy11x9yb/7hZ8kos9+9p5f/MVfefDBR5AIqbk0bgBnXFk3 +tVH4WcWbGhjs33/+e9/73c95zhWq+i++70c+c+cDfv4477zzzjvvvP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5AVBvr6cz19/R+/5CNnnLFQrqfwwgsvvPDDndftY6cxU6zxit8kDmLpNGv+RuGFF174 +1wd/0inHdO7a/vvf//7pp5/OZrPt7e1JUim1Y8eOO++4Y9u2bQdOmeIH4eGHz3vp5TVbt27bP3/v +5APHdXX1xFhrS2Oh4Mt8EF544YUXvoJP2gWoKpNobRlCeOGFF/71wWvECQccsGnTprVr1z777LNx +IqD4tWrVqueff76lpbmxvi7luZlMevKUSX9zfy6/7KIVyxYvX7po+dJFX7ny0wdOGvvq/t6bvv/N +8897j+VPOvGoT33qIvsV+9j+We95y/Kliw6ZPV3mj/DCCy/865tPmgZUOUSDnCm88MIL/zrhDfHU +qVMnTZrkuu769et37do1cIJSQRC88MILzc3Ns2fPJgZDBABhaP7O/rz//Rf/+398/swz3/T2t536 +1/b/kNnTly9ddPllF9Xkn3zquaOPPszykw88YOnSFzZs3P7XXx+W+SO88MIL//rmq+sGxx5ClSfH +1cWEF1544V8nvCGl1CGHHAIAfX19L774YmITDFu2bNm0adPUqVPHjG4PwhAAiBiA/57+2Ncrr2xM +qmcuv+xiaxa4/LILY/7yyy4qHbwobv+6674MAB8896zlSxe1NDdUtL906QvTp09taW4AgKOPPmzj +xs32owMnjf/ud660Zgf7KaJ64P6ffvc7V77n3W9+4P7bTj7paNtfADjllGOXL11820+/feCksbb9 +2HBx+WUXxb/3Q//yLtu9FcsWn3zSMfbgpElj/+/bX16+dNFXv3J5U1ODzDfhhRde+P2TH3ABqllS +uOLkpMuQ8MILL/xw5wERAGbPnl1fX6+UWrlyZRAEcSKglStXFgqFg2bPdlMeEAPbNRT+nv7Y15FH +zt++feeSJY8z0+WXXXTqwhPPOPNfzjjzX05deNLll11snYUSB0+8/LILbQuXXvpfAPDT2+6eO/+0 +PV29Fe1v3Lh53Lj2Y485vKmpobmlefXq9bY/H/3oBwFg7vzTjj76sIULj497d8IJxyLi6W8+9+El +j9sjALBjZ8dJJ7979Ki2j370g1Y4SfbkissvBoCjj5rzqU9dcuONPzp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eHh4eHh4eHh4c3q9cNAhZSUuhggj5GGMDD +w8PDw8PDw8PDm8sbZgHSI7pQmhE8PDw8PDw8PDw8vMl86LrBwQwhfd9BcKeAh4eHh4eHh4eHhzev +7+4BCAYQfUQSYQMOeHh4eHh4eHh4eHizeK4fPWDYoDATixI8PDw8PDw8PDw8vHk9723p4K4lA/Tb +vCtmgIeHh4eHh4eHh4c3pWeTs4tDOgiMqwaE7VmAh4eHh4eHh4eHhzed54yFjgMOs7CwoWcBHh4e +Hh4eHh4eHt6MXp8nZOw16FlW6PoC8PDw8PDw8PDw8PAm8ywrp7i3DoJehg8LeHh4eHh4eHh4eHiT ++l4HARvCCN278PDw8PDw8PDw8PBm9YaVgAURJymIXeQaY/Dw8PDw8PDw8PDwZvI8NHogXapQzwmG +QqcRhYeHh4eHh4eHh4c3kw/2ABgyh4yJRCFBBjw8PDw8PDw8PDy8+Xxw7LAhhjAcHBpkwMPDw8PD +w8PDw8Obz3PGQucPMvQm8OBhGoCHh4eHh4eHh4eHN6vXDQIWUlLoYII+RhjAw8PDw8PDw8PDw5vL +G2YB0iO6UJoRPDw8PDw8PDw8PLzJfOi6wcEMIX3fQXCngIeHh4eHh4eHh4c3r+/uAQgGEH1EEmED +Dnh4eHh4eHh4eHh4s3iuHz1g2KAwE4sSPDw8PDw8PDw8PLx5Pe9t6eCuJQP027wrZoCHh4eHh4eH +h4eHN6Vnk7OLQzoIjKsGhO1ZgIeHh4eHh4eHh4c3nf//Etp73CXrfDAAAAAASUVORK5CYIJ= +Chameleon can be installed on any BIOS bootable device such as USB flash drives, hard drives, and of course off a cd-rom.Installing ChameleonChameleon 2.0 includes it’s own installer package which will install the required boot loader components as well as the new themes onto a hard drive or other bootable device. Once the install is complete you will need to reboot your computer to use the new boot loader featuresTo get started, double click on the Chameleon Installer.iVBORw0KGgoAAAANSUhEUgAAAnEAAAG6CAIAAADoKIeFAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZD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ZAI7DTI4BsattsyBg6 +kZSqfZR2+jdCA6AR0AhoBDQCW4oAWl/W0ODv6yCvYlHVh0ZAI6AR0AhoBDQCW4aA0v3y6SCiaoPq +loGoc2kENAIaAY2ARgAEYFJC58sublFoQq371W+FRkAjoBHQCGgEthABUf3CrIEhPkpaTt1CFHU2 +jYBGQCOgEdAIsIOkCKmhaRmWqWVU/UK8IQgUi8X//u///tKXvvSG1PaGVvLzn/+crr3wwgtbXyur +3JYvX05RuVxuoLRtWP5Ama958qZU+pqt2soEjz76KE/q97//vSpnh+zjVkKks28ZAiZcGrA3s28R +9VfT6paBuLPlOv3009va2h566CHV8V//+td8ZYRSX+GAsWPHXnPNNRuDpVqtXnXVVb/61a82lmD7 +vf63v/2Nrq1atWprutDe3v7BD35w2rRp+++//6GHHjpz5kzO7733XsrcJuVvbtvesEr7+vp4kThK +pdLmNnJz0zNZ4Undf//9KuMb1sfNbadOv/0hYBqmiTXVkr3etKS6/T2/N6PF++677wMPPPD4448f +dNBB1P/kk0/y+cwzz6i2PPbYY7xK8MGb0bQtqfP//u//br/99ne84x0LFizYrPxLly79xS9+0djY +eMEFF2xWxk0kXr169WGHHZbNZmfNmvXe9753/PjxL7744l/+8pdyubyJXPqWQuD1eCIaW43AZiEA +j8KpQRiwlgZW1TEfNgu9nTTxfvvtR8/hVNX/p556ipPnnnvO8zzHcR5++OHm5ubZs2dvL+jccsst +f/jDH+bPn7+5DYbt0BlCgZubcRPpv/e970GooPfnP/+5qalJpfzMZz6DcL+JXPqWQuD1eCIaW43A +ZiEQ4PUbGGiALeFWfWgERoAAcip7BCpOxTi6ePFiFB2VSoUTcj/yyCOQLgk4R6V21FFHobqEeJAF +N1Y2NHzqqafuuuuuu+222wknnJDP50mJCvQjH/nIXnvtBcFwd4DC0S0jUL7nPe9ZtGjRaaedRpbz +zz8f6yPK5IMPPviII4647bbbBip6zQaQ64477iD9pZdeevjhh6uMG6t6oFhOUPBedNFFnNBf2vP3 +v/994C6N+drXvkbLzzjjj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xCBg319MXdF6Y/tZ98TUJEoN +BAKBHggkk7noniIhs1qppu8zWqdlz2/qvATJc+2hJViBQCAwEgSsK2JWbRthbL4fCeJRSCAwPAIy +qJIv0BVO/bVjCOm4WFQzp8lV5U/4qcMDHJKBwBojwDpLi5doWk2+HhWH6K8xuKEuEFhDBOSeKkQt ++3517AOW1Q5Uwq4mb5U3V9ew0FAVCAQCK0OgY0nTqow97MYVCAQCJxcCbkeplltW+zRN+50ZHdii +12lKleSnJvsqK3tytSVqEwhscgTs0dY6anrUtSXVuAKBQOBkQUCmsV9ttBnCHFT7GI1tA07Oavip +/QALfiCw/gikqV+K4fupzWYjXlBdf8SjhEBghQi40yknldwQ+Knpi294q7ygansi4CV257RCPS+v +sKwQDwQCgeNBwN4Sxzlt2U6H+Cb58SAZeQOBdUFABjVX7Zz29G/apiQnlVdsbBt/1+VZulKCEQgE +AmuJAPZU3Y29gmlD/loqD12BQCCwlgjQV9VdRXA+IdoxoukTyEZVyuO4rWtZZOgKBAKBFSKgI1Z4 +141jQmM9dYXghXggMBIE1Dfpq5Qmg0qIn6oIb9So65ZL2FSbBR5JpaKQQCAQKCJAF7V9+J2zV2I9 +tQhQxDcHAvV63RYg7TXszXPRb+3NGVtPTS+octRvedxeWk12d/O0M1oSCGwoBPRMyxn6egjeUHWP +yp6sCHAzfeADH/jiF7947bXXnnvuuTe/+c1/+qd/evfu3etRXwo688wz73znOw9Q/rCHPew+97nP +s5/97AEyPZO+853vfPSjH/3Wt751/vnn3/e+973jHe/YU2xubu5///d/P/3pTy8sLDzqUY+6zW1u +42KY83/8x3/8yle+cve73/0XfuEXnA+B/Pve976b3OQmv/zLv3zKKad40je/+c23ve1tqKLa5AJM +XE+F7qTKT7WXU9mglL6e2hrjA+WLBz6Et+p4BhEIjAwBe8DluZY9SvbdKD3sjqzwKGiTInDDDTdg +DJ7+9KdjaW5729tiVp///OdjX9epuf/0T/+EcVqd8p/85Cc//OEP++X967/+6+c+97kXXHDB7/zO +79zhDnd41ateh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Mo0/rGSXhTpHmCxuLFPs/S4StbcfoMulOxrZwR0E7lzIimIQtrwskrRbVCYvpAIvFRClXPBVB +oWS3Uiwp6U2RpGAxbjnaFVfZSYWyZAwOdmxLOnOxRLEMgZS5U6SqwSo2BClqiRFtSQ5g7uTstC3F +vc0kJ9oyqJqdMqULVUmd2teuIDk81WpEFkGRCkZR5+dQfLFalNDJmJKUl8z5r2CqrFKLkp2qp9yL +gAvyljbIKZLrh2NqrT0JnwRcp54pklpsdUptNiytzPTHIgkRE0xgmoxATtKm3NK42vkUEaeTlCUm +hX6jpne61UZTpBq4BitnUYWzIUw2KTWmtS+xjLbOZsClavG729nbnSjp1jKTklpiCeRUdOLmgCcV +lqWdiTzQyms5SyUrC46lW6AMFLlYAinkSEkmBWYqOWVIKVZspqQtnQo1fY43uYmlfG09KeMSnUmm +HYBCqq3X3u6BvPBUkzZTdbCcqbIpT6pCm6OUdm5LoCLWlgSGNcwydv6mqAfiJgHjkSvlbv9AqUou +spipvSMlAbAk2fDgomDVhij6rKle98QymSTRzpCAVEZLT4MMdWjXJtVdkoaS3Z/Ipv8t4GpLJp2k +lmsVO4B2epaPxmoAt6qqClYfy6HiU26Lkp4Qs7+dH6LdiJSUBNsqnN/JbXlM5WIplpJqqYJSYaqx +agFNKWKbZLtRHYYUS50XAtHNaUtSdKpDLtxWu4SliIl2+mhC0IAuW/1JsWoDoT5hZKnWZRJTIVGT +sa/sGWH0WOn/A0B1iDc2vLUPAAAAAElFTkSuQmCC +Click “Continue” and you will be given the option of selecting, “Install” using the default settings, “Customize” to pick addition options or “Change Install Location” to pick a different volume to install to.iVBORw0KGgoAAAANSUhEUgAAAm4AAAG6CAIAAAA+jV3gAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOw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oLyFa6D4Mzdc3/HM4lq/ +Kt7UNGbe/Hmnnb6NxTd0tt/0jxuWLn8mX+qnwoZs434z5p/8utPHjn6Z1rfQKZ28lyJgRl7OWjlm +1AuF2rju/FwczkI7sZdioYetEdAI7CQEso7yil30gW9+/awDh60T3qrVaov/fvtDv7g6l0yOHjO6 +beJEErvXru3o6CzV64eee86C15+QTCaHZdO4+HN3/H3Jb67KJBNjxo9rnjgFt6m+tas71q8vV2tz +3/neOce/fuvF73jgtmtu+kUq57ZNbBszeiz+bBs61nev6/HKwdmnnHf84SduqfiwI9KJeyECrlVq +dZeOSj7XYixzXaOSyxqh5+Sj8rq5q51FXcnxrz4myuMRH0jcd//XV3PbuzHg3rntRbYvJ/orx3G2 +r6wupRHYexD48o1Po+AVn95hx4w8+vTtdzxyxc+mZrP7T5l8wMknzz77XXggP//La57629+eWr2a +R5AobIpsOrQGir9w599fuubHs8fkDl44bepxbxj3hn/GCXrDbdeuuP3mxx57kUc4F88+/sQtFb/z +wb9fdf2PW6ZkFxw24w2HnnLSQWeWaoUbHvr1PU/cufTRNb+4/se0DpsOW3xof3TK3oZA1LHs0OYn +G2YtMcpJw/DYHVKr+ZViXyaNC7uVnL04m+8r9e633JrRGzWyf2gzfO69995Ro0btu+++m6Xv+Nfr +1fXTn/6Uqv7t3/5t//33P+ecc4ZWy2L0wQcffPHFF3t6esaOHTtx4sSFCxdms9mtFBlayXan9PX1 +/fM///MVV1wxderU7a5EF9QI7A0IsM/Taci5auvSMOPtbm9/8pfXzM6kD81mJwdh67p14fPPQ6Wt +69ctCMOWTPahKCLDhHn7jZ4wYWj53vb1a/581f7TsoctaGscl0zb+SjfzvafjNU/fUqi1R394OLo +hT9fNXruvFETJg4t3t6x/n9u+kXbjOz848ePGZ31kv0d5VXlejHMlCbs05BsnfDsne1kmDtj3oRx +wxQfWqFO2dsQKAeOVXnBrj9RDudVKm4h3133vTBK9DtOS2uupdlOtt7t1BoW1NynCsmuzMzN8Pmf +//mfAw88cNasWZulb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77xjGc8o/Ch4j75yU+uO89/nFRFhifCB7Purf247Xak +r6dleXT5dfVT7r33Xtfi4+XFXceeIPq77757xYqY93/77bcffPDBN9988xve8AYu3+c85zkSb7zx +xle/+tUtLS3f+ta3JkyYAEFlAZkPPPDAfffd9653vWvrrbdua2s7++yzDbvC0ZUrV5588sl62R/6 +0Idee/Su2+84pbG+obm+8unj77j998tfcfQWT91r2sU/ffR3ly6m18KGqFZZAc5Wa26xq1FsywB1 +0rAwlhnw2TIx7MhApty5nlIO11w6HhH7cxv6NO1ODky+X/Fw1yWCqkIAc9pbwJVqDnPNPM/cO4nT +Mla7Fo9l+m9jvlKiEbahtUesTGqdbxneh6JPtPC0hELPDgvDlzDZBYfHhCG2P9WMHkMKWexCehw8 +qEsAGHuUSCCZyZvOTGwLeKhCCXKJjk6MW/d4ZmpQJl4iCjDLKkgMNIKsnorLUvr3aQHHo9KVKRlh +c1JKRy6IhEfdmHTfyve9+4Qvf+GUvr7+zedstnjxsm989Qd33n5vwa2gr9R1dfZ+62vnLFu6ouQN +GcKbmoxcsq1QRqcH5yxRs4RICBPwlixe+YkPfv3hhxaW4kstUMoVVcMqC9I90koxFq4NM33Bo4sf +uH+hapq/XToETNJ+60jT113Au8ihx2asVIHhGamPA9qam5tanU9UV9fV13fzTfd2rOw2U0mwurS5 +pXGo0hGAG02B5PEP3/3ud3VS/Yovvvjix5/738FRfW+99Va/5b+Dxz826w9+8APutL+1DDW65ZZb +/tZca6F/6KGH7r///hrBY5Oqlv2vRtbbD+avSv64E/iNxxlTj0vgfPBlzJo1a8MNN2ymEpqawGdf +Xx8YA4qewr+/qSDdMbl0A9/97nfXMp522ml+V//+7/++ww47PO95z4Osl1566Utf+lJoiuaDH/zg +05/+9GnTpn31q19lGW+77bZdXV0EWLhw4aJF8+e9dFJ9c3VZR/+Dd3U98kDPU3afus1TJs7YuOWy +ny+4+Zplu+83gxnHzwZsbO4GTYGQbeoqTEbw1hZKzFJUSiyMvMa6nu66Siw5rQNVPazPob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eA5x9z0uztL +EahFli/vPOrQD19w3pUF1dRICMArRaOpr7vgF1e85Q3/ee1Vtx36kuMPnHfMmd8731OUSjzj2784 +5MB3PWun173nrZ9TnVNPOufaq2798VkXHzDvrZdf8jsN/v3Tzn/dKz6499OOOPLVJ9x68x+j0Ojm +RIj2iauheiOnrvHqeh3JVq07/JUfQ3DMG/5r72cca2ckO0P/9srbX/L898zZfMenPvWpX/va16JP +9z+DGQk777zz5Zdfzg04e/bsAw44oPxYUOlK6n1usskm8tZGT374wx/y+vzoRz968pOfTOcaQDE+ +8olPfAITxg3+Rkme8pSn+Anvu+++119/fSltTK5S6NVXXy27nzwHkk7AW97yls033xzzRx555H/K +GHd+tvvttx8CctbYjibDzRgNaY3sLFiwwCOUrq95zWvIpnutf+xHDVa33HLLo446yq/b0yLJdddd +p6aYm3WBrLBdtGjRK17xCuI961nPYnOXRNfVSjKmgsiuuOIKQC77a1/7Wtqmln10RMW9FClrEeOk +k07afffd6UZ8UDID6LH58+erVHEak+2Vr3wlA2C33XYr3EYXMSa+qvCf+cxnvNzvfe97GJ5//vno +a1KJY77PPvt4m57KW76ftUg7urjFixdjNXfuXA3+xje+US5Px3wwo+mfgPEJbbyZj1O9YZgRTY0O +vfySp0+fvsEGG/im/Zyk19Bu3Uvz1hH7bYzO4oN2+x//8R9//OMf9eZ4cb3agLgMSgGfpawSd/vi +F7/41FNPPeTQPe+/t/Pkj99h1HPKjDAfNtu6/aQf7/ap03c58Yc7v/MT2/IcUk423dUizMrQwCI5 +xRTIOa8UFNnMQUncjMz59okBh5SpFOtY7A5I+zNAw4OXNhYQjQHXVJcmJZWx1XjEr1jOXEtlGvga +SBBl2W6XIVs8jbRwCJFqHfoG6iSIRomJ1mQMt20iEBlwBpwB5In3gGGYLN25Iy2UZaFKIUMbJz3K +KGgkDiaVAual10IpV0H+/EOPZ2QUi8bKCPpRyBoiqW+OfUYFtXriK1YCGYo96jb+srKyw5PCMP7T +82iKZUWdy4N+wqS6hx56hBbYcadtFO0PfwRR5SJAZklhBu+/75H+3vCfnvOD33z6hG+99JDnXnz1 +qd8484Qtt940SwjS3p7+d77pxC232fS5+z/L67MWRe9SOgK3EQFuQ3XGXG+64a5TTjrrHccfftSx +L/vCp7+/cmW3p/PnL/zSiWd88dTjf3PNN9727kM14Gtev/8uu213wIv3PP3sj+317J3xmj17xvs/ +euTFV3995sypp536iyJn+USbDTZEA+q6RVczZh5F90IXsHLSKeGJ+ein3viT8z9jauCjDy8+9OUf +2WveU353808+/vGPGzA7/fTTQ75RAcbAwg9/+MOQDED6JX76058uz7l2/B75aY499tiaj8dk+6uu +uuonP/kJN91LXvISvxG/XGaN+Qd+etw/VLOCuJTmzZt34IEHFlwck6sU+ta3vpWqPe+88+AQuHrS +k57EgrznnnvcjhJwOApLPvvZz/r90g9f+tKXViV43/ve94IXvODBBx+88MILy+R/8IDsy1/+MtkM +IWmxPffck0kHdH/9619fcMEFnhZJjjzySLhrIQAftWthTjZ2rcoa9xltAq5WkjEVfPTRRzm9wIaM +YFsbriqwFNJq8LWIoVtjjMl7MQ5l6gbKnXba6fjjj9cIKnXCCSdI4ckjqiGt97///Yi7u+MbW1NY +VXgv12RPomKo9yNjTaqHH37YG9xnn328zf/MUL6ftTTa6HJ9P96+kVcIjaduiqdjPpjR9E/AeFtr +rAd/fCruE9cR9mM224hdaDHMxIkTTfnxCXqLnq62GD85r6cEfeHRNDpobv2KBAOofjlu9UwBp+HP +M844A45K5GQYDaWUVLl1VaghWx9Wd0/ncw+aOWlyU0+3+Xf1T9p12gYbt957Z+ePv3X/A3d33X3L +iusuWWahvGUw4Taj/en29MQyT3V5+3pjrKvSVJ3YHhsbaLG2dsxj1m4MgprvY2bvQF3XioAZ+MoI +80icccOQEqhlEVngChs00CUxuDQ+n2cxMUFh2IXphIz8xX5JpHHnRcF7ef0VnoSEFW7JHJZrS4Br +eQb4y/Bq4BnMS84RiSktWToQwj8fESYs2vIlpLtVrrDMcrg0Of6PS4CoBOg14it2F5Jn0EQha/w3 +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Is4M1 +jd+lFdi103QX3vwCq9b20yXnlvcLU9olVGtYTA/YNddc87KXveywww8rl+wssnrtuMBZ7YKt8Gbh +mACv1arV2pVXXvGGN7xhw4YNz3zmM3tmTfWLrOF22qbqa6TpLkrzC6wW8qje4n5PrdRnrshu0xaD +tcYRmJ6eZlL3oosuesUrXrF169bqdLVWSl+cNisaTWemdZgtTaNSBqZbtmw58/Fnnv36s//nf/6H +md5KZZF3JMhqkp2yDyM68zNk1IHbdGlCuDk1m9T6bFIEN4/md6BgpQoKGcrMhV/5nV/Zj9+JXCBW +s6mu8Co9W1zw1zgCtLm9e/d+/etfv8997oKYn60AABNXSURBVMMYi3UUAKHjVt8tvxuIfv7zn3/1 +q1/97W9/y7Tncccdx94cFly7SbgUMp/73OcOP/zwW93qVouoHKBAg+ccApTwN23eBGhf+cpX7nGP +e2zatKl7rLov1VLo7D73FS658KbLNMx55533y1/+EpyPP/54Wuxd73rXLmvN2+fVV19Nj3/LW97y +Zje72Vx/qX/9139917ve9YMf/KDL7BbY/BaOVaGc7Ey83vWud5vb3KbAX3gwR+a+973vXe5yl5e8 +5CVzUrtArGbLC7WL/L48W07BPxAR4L3vy1/+Mk8F3QH0+PjY8PCI9Qupb+hyVPpP//RPb3zTGx/x +iEfc4ua32Llz54c+9KEf/uCHZ5999pwAueyyyzBRRx111JxStRWmADzkN7/ZzdvGzo9pUzs8TMlR +zrHRMXxA+8UvfsE7xP3vf/+BgYH5aY5U80NggU33ggsuOOtvz+K17z6n36e/0v+db3/n7W9/+w++ +361to3mPj48fcb0jXvziFw8PD5Nw48aN3VekVk3vZNP25tqNW2DzWyBWrSX853/+Z147bnXLub2t +7t69+49//ONNb3rTVoXOyZHhaePllXkyj+2GWCBWs2VBZximdDZw1jqfljo2Nvb73//+xje+MasI +kxOTY/39tN1KZUATLCya7hcjRrSvfd1rP/JfHznttNNcGM1YGg92Qzz72c8+7vjjXvPq13Qj3Fnm +3//t3xGYawE666xzUKVmszscEJpIDqAA7aSTTmIs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UK3rCJwk1y+kprNZJ +pvkTCSZK1tRouTYKKpBNo0FlIuYMIFFN36OyyKTQG2o6gq06miKVoJncEDStbZzJesFIiZQyq9vD +ZsClIL87/0yLYpslbKpNmAAysemXh58B3kjT5FgQWmktZalkecGxapunBGRpRfOCW8uxKJNKuag+ +KaWRyrSppCGdMk05ml5XZgHXkxLuo1Oam/obOZi8FcDaQLNQFpWUNpgqQ5IzWZU1+RaS81JYWpRa +XRKvkUFBvJGqwU1ajUWqlLrxA6UiSUEzQZLSAysA9okmvTkyVrkIoi/VRxWyHJSpJBoJElsJLT51 +MoaJSpMSSNJQMqyQTf+bh2tIJp3Elgf7aVt9o+NTU1PqwCkOolYoK4+lSAVsJE8xJEjMmR9CMpam +IddQ4Xyi5EhjKmdyMbZSJeGUmUqsUqgYYptko1JNhrRKnejZOA0+uaQy5MINtfuwFDDR1IyaORjQ +6doiYqzYQKj+yipuj0xiyidoMvZpReP//4ctrxHxuTLyAAAAAElFTkSuQmCC +Custom InstallIf you select Customize you have the option of selecting different themes or variables to be passed at boot time to the kerneliVBORw0KGgoAAAANSUhEUgAAAm0AAAG6CAIAAADVuubjAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2OtDzA2gei1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+we51cZFQUU +BRQFFAUUBbZmCgg/DJwPtTWTQPVdUUBRQFFAUUBRoMcUwDdQx55celyiyqgooCigKKAooCiw9VDA +QD269fRW9VRRQFFAUUBRQFGgbylgiIPM1KUooCigKKAooCigKNAjCigc7RHZVCZFAUUBRQFFAUWB +AgUM7IwUKRQFFAUUBRQFFAUUBXpGAeyMepZR5VIUUBRQFFAUUBRQFNCUnZEaBIoCigKKAooCigI9 +p4DBCSo9z61yKgooCigKKAooCmzdFOBYxq2bAKr3igKKAooCigKKAr2gAPpRxY/2gn4qq6KAooCi +gKLA1k0BhaNb9/tXvVcUUBRQFFAU6B0FFI72jn4qt6KAooCigKLA1k0Bc5sd9zzx4H22biKo3q8f +BTgFb+nSpatXr+Zcd3m0+/rl74+p33777VtuuYXz7SdOnEj/7rjjjocffpgzw6urqzdEd5PJ5Ftv +vTVy5Mh0Ov3666+PGjVqQ9TSpsz33ntvzpw55eXl0Wi0zSP/9r777uPci8GDBz/33HN//etfBwwY +MGTIEP+pCigK9EsKGLpSj/bLF7thOlVbW/uNb3xjzJgxu++++3777Tdu3DjCL7300oaprbelgmpM +6FyATW/LWlf+Tz755O67737llVdkwqeeeorb5cuXrytfD5/vv//+pmmS+ZBDDnEch8D9998vO8sv +sLrXXnvdeuutPSy9k2zXXHPNqaee+tFHH3XyXEQDn3R88eLFjAoCn3/+eReJ1SNFgf5BAUvBaP94 +kRuhFytWrGD6bm1t3W677U466aRhw4Z9+umnTzzxRCaT6Vnt//nPf5555pljjjlm+vTpPSthQ+da +tGjRnXfeWVFR8f3vf39D19X98gGnhoYG+DzeCIg1YsQIPy/hnXfe+eWXX164cOFVV1212267TZs2 +zX/ay8BRRx0Ftw2T3UU54PqLL75IMw488MBnn322uG1d5FKPFAW2aApY6ty0Lfr9bczG33DDDYDo ++PHj//nPf1ZWVsqqL7nkklwu17Nm/Otf//rHP/7BXN+z7BshFwsFJLSsHjZCXd2vYtasWch1r732 +2mOPPRbiX3nllUhTZfYpU6bcdtttRE6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Aat4WgGpRIOa+edEf9J1iA0zhgj2185ZpBoHVsmAPx9bastQ/igKKAooCmz0F +kMwh6utZMy3/XN+e5Ve5ekMB180m3GcT+Sebs7VpjG7x32d6eO/DBBez2HBY13mt7FcxtWxO2BNl +klomj/WQ09gCmjqgY021XlNVubqxvqk578HGRjU4zJaMDfcZKxM6y3RGACTwiZg3mxGKT7BTsLEI +dRHwZsVvqLCbRXQEJairRYNsFbUakxglGUZKaEQ5PbQ33SQv53c+8MADnBrdy3JUdkWBTUUB12WL +dm8/hE3V+O7Uu7l1kJOJ8dPW9Qm4HfZrfTtC+g7L6X6khffy7qdWKfuQAlnns4bMnen8J1k3b7tu +wLAwFUvqLpZBJWVwkOAmG1xQfXpsTcErAqrNTNpm92cBAx14U06SLi2x5i9fTap0zgmXsAtFa2yx +rXDBktbR0uBuWnCZOSyMslogVIBMrHMLG2D4Fb4XTHErrHilybeLPBn0xdOg1pp32EVDlxnNxR0v +KyvjAOrm5uYRI0b86U9/mjp1avHTDsPLli374x//eOGFF3b4tMeRb7755owZM1566aVp06ZRCLUc +fvjhs2bN6nGBKqOiQGcUsO188YfASexjxozhYNfrr7++syzEY4Aize6OP/74r3zlK6TvIvGmfdSm +g5u2MZdddtlbb73FwmXkyJF33333008/fc899zz44IPdadX6doT03Sm2izRWv15gddHxTfyoMTOz +xb3b0t28mw9bwVyGgFufyMXCJVPGlLS0JgZUDrSs/Oq6+tLSUGmkvCneasfx9VewAMJbAgFD23Z4 +STrrNscz7OwEI/W8FsceCIY0qLk5LRHX8LEhPC0U9J3IeAXfiWY0I8yLpCzXEpZMQsxLjJDrFvAU +HSoiDrm8kqusvExdRLN//vOfgOh3v/vdG264gVFe9KTjoGCxNSrt7XhtU7oslhOqX3311WAwuIFq +aVOput06KeA4KFz+N4AfffRRhhxSlssvv5xAhzSZNGnSY489tt122/H0jjvuIFlxCR1m2YSRbTq4 +CVvS0NDADPPBBx+wBGHtAtH222+/vffeu5vUW9+OkL6XnbXgeHpZhMq+XhSw3Xhd9u547hmQKpMz +4APTmPSEwql8qiwcrY5ULa5tTOXsAeXZPIAmeEGvMZNoSWfTGQ9oRAIhdm1a2qCh2pAhwTkLMppj +jh9WncmnF61szaD1NNBoBkHchkwuENYiBfMztKTkokaKBIMFYKJZxaSoIN3FXldsXykgp+A/8dyL +nTBQml1rxFu8DJedZUCz0B43btzDDz/M0/PPP3/BggWpVOo73/nO1772NdK8/PLLP//5zxOJRCAQ +ePHFF2V6UtbW1nKg9K233soys30uCiGysbFxn332YTXKHDR48OBnn332iiuugAk+55xzjj322GJq +A5y777479V533XU/+tGP/FpWrlx58cUX19XVUfu1114Lx/zJJ5/84Ac/+PKXv/yHP/yhqqqKSY30 +s2fPPvfcc8877zzK7KKW4hpVeKulAIOt+ENg+ShH3RNPPHH00UdDFsbhT3/602eeeYax+vWvf51b +1BkwoAcccMCVV175wx/+8MADDzziiCOI//GPf/zaa6+R5cwzz+STIcBwZZRi8DJ37lwGpByTG5nU +bTq4kWsvro65Zc2aNe+///7kyZOJh+wslKEzrD+E+vDDD4lMp9PHHXccH/V7771HZEVFBVTda6+9 +eLS+HSF9ce09CPfUf0MPqlJZePf2wuUtNwUjy6PBSGsCUyEb50SIcxN4TEhpzS2ts1pasb8dUG7W +NjaGgnokbLamcolsCkVmsmB2C+56eSH4HTG4LJ0O1bU0Dq4uKQlF5n7eAIjqlgYy57Pu6nob5Sje +dJE34EpX7I1hOMKJFt4CYbnXhafEwLCSmD/BfdoaJ6QBq0H867JFpjDA2i8Dm5qa+OZvv/32M844 +g6ff/va3x48fz/gGBRncVHLRRRcxF5x++ul8EqbJUW24AfZaWlqYVhj0iIU7zPWrX/3qoIMOIi+f +zUMPPZRh808uxwTEJ1RaWvqlL33pkEMOKV77UywK/t/+9rdHHXUUEl3SUAslh8Pha665ZptttgE1 +EQftsMMO6FreeecdCn/llVeY40488UQaTztB1rPOOotlbxe1qJGrKAAFGGz+h7B48eLPPvsMgGQs +3XfffYcddhgJ4FDfffddvothw4aR2LKse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9plIpxuG/ZnLotHK+guXhPM4razeynaIwZtDbLs/aWrrj3WQDdnlaeF1kJm72boj0B2BB/4I +ECgSArfuO3/g97m1hz10dosSIBm7ZNOiiH30qCH+R1EsSJfYsRUKsKc97WnZdxR5d87DmxSDZruF +kFRAmxO//OUvs9eS/5xzznnNa16D+MJIgaqMrJxUnYj82muvXdjKjbf8y+cuO396duqYEwaB4bVX +bg0z2Gbzmiu2rTomtijByGWrHL7d/P5Ve9752h+9/Gn/9vsv+f61/7oLzDgxje9X7NAB3XwpUItS +Q9b6w3oIEQRSliH9gyEGHRmuADxKU1WHCJePBcDWCNIpLigOkrRFtRnC1Z5gepkLgtvgsom8xiU4 +Z7SSZwbMUgpmCUSVB3shfZWYOC7Y9tWfOpkXwWOMmfmSIAMoVU00lKTBuDJCrOZgyeLJggmC+hog +CumTXBqix1/UEYmHDKOpoiR18GwsDPsu35P/KEEPklzek1q7ebsj0B2B+20EwASpVSGwvd/6cW8b +zsYx97Z0SzkC8auuuooglzgXxbz55pt9ZtHulVdeme2sWrLvi8rARuszn/kMOTClplT7h3hro4vm +BQpnf/GLX5x339to+LjHPY76k30zFzbZi41VzAte8AICAVpoG/OZcaoBuBaw/b0bP/GV735wz9ge +3G/Zyr4HP2TZT6/bNTHGeXrz+mt2nH72avljH8ts49Ybxj/wRzcS+Z73u6f2D1b+4q037djBQZCT +vfftMyHRBXtAq1LDceMglsZsFbrRg4KuLVvjJFE4gfDlAPPCqtYelZnQiQIkEgiQHCgI2whdmewy +6008UhGwJ8A5kOkqKEMcASTuyfJI+eCRCfbkzJnxYMzYLhqoiacODMenzkzsTebBCT6BIk4MswNW +qXujpkBWyJ1dBuqnDPk5CARNTRuukPHGf/luup/dEeiOQHcEuiPQeQQWzV6XepIRM3UXc0dCXSsL +2EmlTLrLEtpV0LiwC3zNSKTowjszyfj4xz8OCNkK8QKFlTKe/sY3vsF4Mm/mA5yqfc973sOkiDMa +emnEd+3atXbQa0K7dtDnVuZmp7517Z/96LbLHRS63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eu211ceMwX6lpokfLLi3IcuCIplx4dcpE6UM6qZl8VFX +d+qf98waM75xeNNUrZtdLEFKt2AstDGS3NExaJDMpxYfJJw9e3Z53IpTuWbpIzA/HKuuumrfi54z +Zw43d+zYsWWSfPDBB7NmzRozZkwulytj5lFlEGCMtExsuSjrMhJGi9WrQXwmB4J0anqoHGvosOyQ +N/PCwYemEwJBlHbEQbPUWA1anglBY80GwQyoockmoLTLieX4EhJ6ohK4ebBiBGbMmLHXXnsde+yx +e+6553e+853y+Rjyesu4LxzxLbb2kxCee+65rbbaap999qGUn/70p6Si3yEhZtpUOKPU/JXkAtvK +eiUVOA9Zefj4KVM6OjsYnp0+8/1rbrgebiSPpx5/PN+WJ3lTbqXmzBj4k3GiMPgCJQubsrdRXYMM +6j7z6Ox33mydl3+jozPPlSbYNHHt//rXvz7/+c9PmTLloYceSkQRnDdv3le+8pWNNtroF7/4RXHs +Y489ttpqq51xxhkW9fvf/x7Nk08+iWb//fffYIMN1l9//YMOOuj55583m2VBgBK22GKL9dZb70tf ++tLUqVMHqkq//vWvv/Wtb/WWW/nY3lL1XX/wwQcfcMABRx999N577z1z5kxNuMcee6y99trrhuMf +//hHIrdf/vKXJDn55JM/8YlPPP7444lYgii33357cj7xxBM32WSTr33tayi572usscbGG2/8yU9+ +8uc//3lxKtcUI9C/+dHi9NZrJKIWq1eDOJU+UFtCgsTa2exVEycsI1sqtdGgKRFMLjaIo2LZiouV +sWwGLiwdBK688kp+9j/60Y8obsGCBYstVG+WtTcEqA4O41APkhyQORNlB49Nq6yyyu233/7hhx9C +Tg8++ODOO++MEnbE2yMhlsicNSEaCkJDEIpVJdmOX2+9d19/Y+aMGSNHjDx4n33YA4LNAtlO6fUX +X5q0wRQ4fXB2/Jz067IpYEY2MOIsLmk6lW9NicOAY5pJtbXPbsnPyNWvqdUj85IHHeJvfvObww47 +rGQszwE//OEP//CHP0CoJQ2am5v/8pe/fO9739PYP/3pT2jMEv0XvvCF//zP/zz33HP/93//1/TL +gsBFjR49mker//mf/zn77LMHpEo8c3BPe8uqfGxvqfquB+SRI0di//Wvf/2qq6467rjjNO1tt902 +ceLEkvlg841vfIOo888//4orrthss81iM8iYZ6Cf/OQn++23H3oa0vvvv68GFMTT0rPPPrvLLrvw +hApVxwldLkaA5+diZb819Bd6JFL2qJNlmF4FOhcEPVsUQQ7z+RCKNb0pNRWdlwnqMWgwPpfJM66J +yVpPTRUrExfuwaWJALeDh2jGryhUO3o6mlNPPZV+5GMf+9hJJ52kUffff//nPvc5HsDpPhgh4/ZB +ut/97nfpX3bccUf8CTRvvPEG3cpnPvOZCy64gJ4l0X4wwPtceeWVIdR8Pq/+KD0Ufg+k8uKLL6r9 +I488csghh8Be+Hl0ZFApvdK3v/1tBI7LL7/8ubfebM/nZ8ycceOdd+LMorzlrrv+cv1fSII8b+ag +/zvtlQtPfvGev7yXYkF9XaqtteuqX75+zvHP/ebHU+d80CHreNOtD/71VnhCebQ3Nh0xYgS17e1e +UP+11lqrt1j0PJ3wiKCOzttvv93a2oo/GtuDBgPC2r/H+mVBbmhowDHlRmtl7rrrrk996lOf/exn +eTJQzfHHH8+94FGAy0TgKYHxBjw8JggwiFuLPmdce+21P/vZz4h64YUXaEi0MbxeBidABmX5WHI4 +8sgjP/7xj/ME9sUvfvGWW24hycMPP3zEEUcg9OUwkLmhDMD0JQnNVc0YMGDwIJHk6quvxoDxFdUj +J0aMaTy0EJp6IqEHixGQh+4BPLgZHMUZltdrLGfjJwRTqt5i1cbO2nNZEMFoUpUETTBjEzQqLiuW +S8YWX51rPloEDj30UH7zECTOotZk7ty5dFXQ2wMPPECv98c//hE9j9WXXXbZfffdxy2+4447ON90 +003//Oc/b7zxRjpNBrVoFQxkIZDPE0888dRTT6GJn8DY7QjL0047DbbjUZ2od955hyLoUg8//PCL +LroIe9rMeeedB3njolGr6dOn48S0tLQgkAoZUs93dKy/2WYd7R1z583L1efqMunpuALdqW8ccTQ9 +183X37/trpOO/uHab7w0/80XFzA5+uRDs7o6u7951jp7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ChcaxKwtIX +pfNoX1CqaRv9dc2aNevkk08etdqoTFreOdYu2zdnrrJldPP5UFYoMGDe1dXZ2fXuu9N+9rOfDR48 ++LjjjusvleodqbI+K1jyGmm6lbWixL12rMr84hJYFQfrho/b4PD9diuOcI0jAAIdHR1MiD7xxBMn +nHDCaquthkY6fvwn/Q83amkdjDi15dv4qkJlBTKb29HZQY9TWfIKUgEdhYIYaemkOAtupY5AonLi +l7zW2LVuvvlm0q699trxjkVxawyPMYvsWe8kGuOj8rLTdEvd83K6uOWUs1s0rr+tKEZsecEqRqb8 +b2pRbJKharCKcTM5S79oARccgRgB+v358+fff//9u+22G04STEasdeLFfTeLj6677rrnnnuOOdRd +dtll3LhxcW5VyuR8zDHHvP3225Xl86UvfWnYsGGMTieS85Sw+uqrb7755gl99cHf/OY3v/71rx9/ +/HGy2n333T/5yU+eeOKJiWxBGBj5lSMAL+ehw4aC9j333LPjjjsOHTq0GGTLoUyU2dSs0N+mWwwU +AzA33HADjRmcJ06cSJPebrvtis1KalhGMH369Gw2u/HGG2+44Yb9vVNxyymZf0JZTSsiq+qxStTn +o/1NJSqTCFaJVSI3C/p6XYPChSQCPP3dfffd0Ax9AXJra0tjY5N0CqFjSAzqQqJT1p+y7z770uPQ +jzD8e+ihh9Jqn3322bFjxw4ZMiSZez/DXZ1dpOjsEC6v4KAm0FVx8p/+9Kf0j5tsvEm/8pw7d+7r +r7++wQYblElFhSlUS+yt9G68SuLCAY+2LGjhDNqAdu+9937mM5+pr68vU4RH9YZAv5pucSYPPfTQ +YYcfNmHChN123a0uW/f3v/39ggsuePwxeSTqy3HWWWe1traOXn309773vcbGRhL2q/3HLacvxVXZ +iqrEqriGH+1vqrg+saZKrOKsYtl5NEbD5YUI0Le3tLS88sorU6ZMYbwx35ZvqauDirLZeh60sYMp +F1qnUpdedulGG22kDh/Te0RBCfQmW2+z9Z133Fm9w2dOW1xo32XjqkSS3vQJs0Twhhtv+MlPfvLv +p/+d0MdBhr4JAgJnKaVLPM7YQ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CmcutNyLZJDUCjmPZWSqFBDaRgotQ5iKBaFuvakDOmDjUqSlkzlWsJlFgpImBdSFbQhV1GRKqQu +3KBQumbQkyBY6Q9WAVgkWvDgoGC9FoLkF66np+5BJTbBopAgAKkJJT50MoKJ1ibUUi0FEPm9YBv+ +lxNHwTLkSWwmV0fbSi1obW9v1w6cwjCVIqU+kkKLl8RySHxATP4GA1EGGwQtW9LqVfToJWU4SCPm +kouaiFZTaZ3USpSF+FCNnnzsonoUwTxUSqWesxbQE1r4V4oOdVioQtJsF1FpQExDM+rJT4AOexMR +I9UGQu2vkCXA/1J1jZLfLeby6/1/vtg6hnINXbEAAAAASUVORK5CYIJ= +OptionsEHCIacquireCan fix some rare USB issues on boot.ForceWakeCleans the hibernate image on resumeGUIGUI bootloader on or ofUHCIresetReset USB for some rare USB issues on bootThemes Default theme and Twilight are offered as for you to use ExtrasKexts for AHCI and Intel PIIXATA will get installed into /ExtraFinishing Chameleon installiVBORw0KGgoAAAANSUhEUgAAAm0AAAG6CAIAAADVuubjAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2OtDzA2gei1WPtZVa+8Yf/s9a9az0wA57oEVndDqr +uUSqFNBoAnNcjGeAd/SRa0D/T6BALm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tOOOEETz/33HP/ +93//92Mf+9ixxx571113vepVr3ryk5/88Y9/fNOmTS972ctOPvnkpUuXnn/++aAgMDw4OPi+971v +27ZtZ5111pve9CYofP3rX//KV77ygQ984Pvf//6vfvWrxz72sV/+8pe/973vUaSvr++DH/zgE5/4 +RLJB8Le//e369evXrFkDzZe//OXwA523vvWtj3vc41avXg0Pr3/96y+88MJisXjOOeckk0mg9Gc/ ++9kNN9zwT//0T673TVfXwaVZNXtD5rtGkjqXjs/y7qFDSuXZ2fyuUO/MyMTmUHiqLVEo5TPJRGSg +IxWJhScncqUi5xex+tdelIZiTUQxa9hRg7XqjkE0JZgLNBIAXdQralTmIKc0sCs0Hokno8loeyTc +nk60JSKcdJOORNrjkbZUvCMWbYuGbUHwfIx2pRf3DqXyzN9CCs8wAZAQAumj0MAPoQBxM6ZNaesh +s3fodM8IV2womZqZnslMd3f1DPQub0t3NQNnc7wZQUXIQluid1HvATsmbmGDCocAM1bAO9qe6hrs +X9KMnR5v7pQGAf1thlLiQX8RyRexm8ezhSlMf3AaT6xPuwosDRppHnFhKnQaQAVNDPq6HBzbEAI7 +i6JqutwAvCY9o/foCTsJZmvy1/vOM3g6ZAmIEYlRnI4zmTFD3h+qLYIaE7ccGdFRGZjK7soVJyIC +zPpKMQmfO7t6RwjixahoCnZtQp3qJjKbWcY82L2vHrRCSwItCSyoBBYMR7Hnfnj55sqRHetHqltn +wl3p8HQunM9XK/GOH16+6YwzSqBRwPnjH//4I444Aqv0KU95ytlnnw0Q4mvl6cjICPA2y2GvWjJT +dKgL4hdddNHKlStBVhCOUkDjcccdt27duk9+8pNQaGtrGx8fpwiPTjzxRODw2muvPe2004DbI488 +8rvf/S4QSwTFjc4FoVetWvVv//Zvn/jEJ8i8ePFiVOo999zD1N6f//xn4HbJkiX77LPPL37xi9// +/vdPfepTmTT9yU9+csopp/iiJCi40nfFHajmQEEHLd1bJB7jPJ1VPO1Z+jg8f1Xe4tWbLRSnKqFM +sTgTbs90tuVr1WyqLcb6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TkSuQmCC +If you see this screen, you’re done with the install and everything has installed. All you need to do now is reboot and watch your computer load the new Chameleon and enjoy the extra features that it has over the previous versions!BootingChameleon is setup to automatically boot your operating system with the default settings but has the ability to pass variables to the kernel. You can pass startup options to the kernel by pressing any key when you see the boot logo and the type them to be sent to the operating system after you hit enter.Advanced OptionsAdvanced startup options use the following syntax: [device]<kernel> [arguments]Example arguments includedevice: rd= device name> rd=*<IODeviceTree path> (Device name sample rd=/dev/disk0s2)(Device tree sample rd=*/PCI0@0/CHN0@0/@0:1)Kernel: Sometimes you need to use a different kernel for testing, or you need to use the old one after an install that didn’t work the way you wanted it too =)kernel: kernel name Example: mach_kernel.voodooFlags allow you pass arguments without having to make them a permanent config settings. Examples of valid flags are:-f This forces rebuilding of extensions cache-sBoots into a single user command line mode-vVerbose, boots in text mode showing all debug info and errors-xBoots into safe mode "Graphics Mode"="1024x768x32" : Tells VESA to boot with this resolution, the x32 is bit depth and is only compatible with VESA 3.0 and uprd=disk0s1: Tells Darwin to boot from a certain partition specified in BSD format. Disk 0 specifies first HDD and s1 specifies first partition as 0 is the MBR.cpus=1: Tells the system how many CPUs or cores to use, useful for Core Duo users.platform=X86PC: Can be used if problems with normal booting, platform=ACPI: another option if normal booting fails-legacy - Boots OS X in 32bit mode rather than 64bit if 64bit is used due to a 64bit processoridehalt=0 - May stop stutteringkernel debug flags (e.g. debug=0x144) io=0xffffffff defined in IOKit/IOKitDebug.h)Example: mach_kernel rd=disk0s1 -v "Graphics Mode"="1024x768x32@85"If the computer won't start up properly, you may be able to start it up using safe mode. Use the startup command “-x to start up in safe mode, which ignores all cached driver files.Example: -x -vSpecial booter commands: ?memory Displays information about the computer's memory ?video Displays VESA video modes supported by the computer's BIOS. ?norescan Leaves CD-ROM rescan mode.Additional useful command-line options: config=<file> Use an alternate Boot.plist file.Boot.plistOptions useful in the com.apple.Boot.plist file:"Boot Graphics"=Yes|NoUse graphics mode or text mode when starting."Quiet Boot"=Yes|NoUse quiet boot mode (no messages or prompt).Timeout=8Number of seconds to pause at the boot: prompt."Instant Menu"=YesForce displaying the partition selection menu. GUI=NoDisable the GUI (enabled by default).USBBusFix=YesEnable the EHCI and UHCI fixes (disabled by default). EHCIacquire=YesEnable the EHCI fix (disabled by default).UHCIreset=YesEnable the UHCI fix (disabled by default).Wake=NoDisable wake up after hibernation (enabled by default). ForceWake=YesForce using the sleepimage (disabled by default). WakeImage=<file>Use an alternate sleepimage file (default path is /private/var/vm/sleepimage).DropSSDT=YesSkip the SSDT tables while relocating the ACPI tables.DSDT=<file>Use an alternate DSDT.aml file (default paths are /DSDT.aml or /Extra/DSDT.aml).Rescan=YesEnable CD-ROM rescan mode."Rescan Prompt"=YesPrompts for enable CD-ROM rescan mode.ThemesChameleon 2 lets you create or customize the boot loader themes! You can edit the file in /Extra/Themes/Default/theme.plist. The following variables are changeable in the theme.plist to customize your theme.Images and ColorChameleon 2 has user replaceable images, and colors that you can customize. The images are saved in the /Extra/Themes/Default folder. All images must be in .png format .You can change the color of all the text and other widgets by using RGB color codes. Below is a basic color code chart but the full RGB color pallet is supported.iVBORw0KGgoAAAANSUhEUgAAAVMAAAClCAIAAABulYmTAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2Ot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MG3DwjHjh0zCfBr1aqlYfFfaGHUP3HiBDkUhRHZGeLi4rQkJ65+ +rSa/9kYg2/JpJ75VGNLXrzdG+4YNXQ3XL58yyDM4m8EHGxebBQTo9zF7Qr16xq8W3nOPYfmw97KD +CBU/PL9//7uCtBcvPddcY5D8h0nwzbcPCM2aNfMkwPdfaGHUZ8uAPNPS0rTxs70PvSeSnLj6w+Qq +hHkzndbphoGeEmrnWVrMcp0AnTZuNrmF9N/gwW5pLo3qVcChQy4pBP4ELcTyCWwTMB3AjZc+1D68 +dNw4HQaBuff+/fvZaatevfr69evhzOWQ7iCPmg7JNyt/tvd0/uzzs8NPPCeu/jyqhmRboBCwWr5n +5W6/3ViuswTAL8uUKQqXm7fdpj791FPRJUGfEYUl/csvG9T9M2YYcu3The6jfn1jj4B9BLb6GjUy +Rn69/xdWU33ffPs5IpvbE5g9fvumcPEULg/PzJ49+7777iOeE1d/bsuRdIUJgctbPk+UFiwwtv1Y +k+M/4/HHjS26KlVybCTzBby8Vq9uzOQfekhlZalx47JXCnpsx10fu4CEu+82fimieXMjEj4BsmcW +28y32Wxr2bJlXjd8zJgxCxYsSEpKqlq1auvWrTs4XaDwqebkyZPbtGkDQ0v79u2nTZsWHx+f1zWR +/AsIAhFwRfkZePtr3z5VvLixM+dPQJmlAeM8+3nhHLZv34Zp8Twfx7Wh/UoXbx+QeWPw7pcDlv6U +lBQ2/MV5tjssNo7zlS43ZABGyeY/L/n5H3zMC/zPRDSDiIBe3lsyzImr36ImhzZD4PKzfZs1OFTN +4a2pUBUt5QoCFgSEh88CiBwKAuGCgIz54XKlpZ2CgDsC7PD52uLz+p2Jmd73DFbSmkARASvNf+Yu +lLggEBIEDAbOkBQcnoWyoRqeDZdWFzQEGJX/HwS7wKDdB5jPAAAAAElFTkSuQmCC +Screen Set the display dimensions to use when in the graphic user interface, will attempt to find the closest one available.screen_width <key>screen_width</key><string>1024</string>1024 pixels wide screenscreen_height <key>screen_height</key><string>768</string>768 pixels high screenscreen_bgcolor <key>screen_bgcolor</key><string>#222334</string>web format #RRGGBBiVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAIAAAC6s0uzAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2OtDzA2gei1WPtZVa+8Yf/s9a9az0wA57oEVndDqr +uUSqFNBoAnNcjGeAd/SRa0D/T6BALmagp9MdVzOkFLiYz00kLauueopS5/Oyl1d5TpHJDi5VnOkp +xj76IPLIYQJJWHzqsNTZSe38S+CWvNZo/v31QsaTFlSeRDPJrbhPvaVqLTCyvLkV0xh3xB3TsFKp +e/gHmVWEZApHLZsAACAASURBVHgB7b133BRFvr59yDlnJCpZkqJIDi6IIMecAHENuLqu4nrMrBkx +YVzEsGvYVUFE5awYQFBBQQRdRUSUIEFyzjn5Xj/r3fr0mZ7p7plnQs/MPX88T3V1ddW3rqruuyt2 +oV9//fW/9BMBERABERABEUgvgcLpTU6piYAIiIAIiIAI/D8CEmDVAxEQAREQARHIAAEJcAagK0kR +EAEREAERkACrDoiACIiACIhABggUuffee9Oc7Kuvvjpt2rQOHTo40121atUrr7zy7LPPrlu3rmHD +hqVLl7ZnPU7ZMOl3TJ8+/cEHH/zb3/721VdfNWrUqHLlytaG8Bi8c+fO8ePHDx8+/MMPP2S2XfPm +zUNopDXJ6bjttts++eSTXr16Wc/wULUm4fj6669Hjx791FNPff7556VKlTr22GPt2QwanIakw5lx +Cz+WIyvqVfhv26x4+kXUgZDqDs/ldP527drFQ+qCCy5wJrpy5cpy5crVq1fvnHPOqVq1atu2bXfs +2GECeJxyxpBm98svv0zpHnPMMWeccUaJEiVKliw5d+7csBl88ODBVq1a1apV64orrqhTpw4Gjx07 +NmxGRi24d955B2v79Oljz4azGnz00UcUfePGjc8///yKFSsWKlToueeeyzjhNLAKZ8ZtbYnlyIp6 +Ff7bNiuefhF1ILS6818RhqbucM6cOdddd139+vV5tkYIMDLWokULGJH6L7/8UqFCheuvv95Y4nEq +dab6xlyzZk0aZ0eOHCEkTXaaPjyCw2bwQw89VKNGDXhi2IEDB/r27du7d++wGWnscf5dv349L2GV +KlVyCnA4q8EJJ5zQrVs3npjYv2/fPl4cqbr79+/nMIMGpyHpcGbcWYvc7mypV+G/bbPi6WcrQMh1 +J30C/Oabb/JI5VemTJkLL7zQAtq4cSOSTOez9aEdXLt27aNHj3qcsoHT79i7d2+RIkXo17VJ051+ +2mmncRgqg9Gwu+66yxr5008/jRkzJmxGWvOs48wzzxwwYEC/fv1OP/104xkqqtZOqkHRokVffPFF +6/PYY49Rk7///vsMGpyGpMOZcVsKsRzZUq9Cfttmy9PPVoOQ6076JmEhupN/+5lGMI8q81uyZAkO +WhL/8fgvhlTXrl27ZcsWj1M2cPodtHdpSr722mvmYffpp5/ykkX7EkvCY/DWrVu3bdvGa8G8efPo +F6XzuXr16gMHDgyVke6yYx4AY+rPPPOM81R4qDqt2rNnD5MAIGw9f/75Z9xVqlTJoMFpSDqcGbel +ENWRLfUq/LdtVjz9nHUg5LqTPgF2QnG6zWOrWrVq1pNBNdzIm8cpGzgjjieffPLQoUM00xm3/t3v +foceX3311VgSHoOXLl2KPRMmTKC38M4777zkkkuaNm06c+bMUBkZUXb0lv/5z39+4YUXnDPaQmsw +/eS33HJL3bp1TS6+/PL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9DoUAREQAREQARSRyDsAhxLLL0l +Fl6+AVLHVDGLgAiIgAiIgC+BUAtwwuprsi0N9i1+BRABERABEcgUgVALcMGhoMGS4YJjVAwiIAIi +IAJJJ+C/EUfSkyxghAkIKpc4G9MJxFBAm3V5bhNQjXKWr/Nec/rLLQIiEEEgywQ44SddwhdG8NKh +CIiACIiACCSFQKi7oCNUM+IwKflXJCIgAiIgAiKQEQJhbwFLdDNSLZSoCIiACIhAqgmEugWc6swr +fhEQAREQARHIFAEJcKbIK10REAEREIG8JiABzuviV+ZFQAREQAQyRUACnCnySlcEREAERCCvCUiA +87r4lXkREAEREIFMEZAAZ4q80hUBERABEchrAhLgvC5+ZV4EREAERCBTBCTAmSKvdEVABERABPKa +gAQ4r4tfmRcBERABEcgUAQlwpsgrXREQAREQgbwmIAHO6+JX5kVABERABDJFQAKcKfJKN08JVKlS +5aGHHsrTzCvbIiACDgISYAcMOUVABERABEQgXQTiEGA+TLR///6DBw+myzalIwIiIAIiIAI5SyAO +AT5w4MDXX3+9cOFCfSIwZ6uDMpZ2Ak8//XSbNm3KlSvXvn37iRMnOtN/6qmn8OzZs+fo0aPfeeed +W2+91Z71uMqE2blzZ//+/WfOnHnbbbc1b968VatWo0aNspeffvrpU6ZMefzxx0888cQmTZrccMMN +hw8ftmc90rVh5BABEUgCAdQ04G/Tpk0333zzc889d+TIkYCXuO0LeGHwYGlIIrgxCpkPBApY5SpX +rvzggw8aULfffnvRokXvvPPOMWPGXHrppcSMw5y65ZZbihUrdvnll990003ly5evWbNm27Ztfa+y +/Ddv3kxstWvXRmufffbZSy65hMPHHnvMBChZsmSjRo1atmyJ1v7hD3/g1AMPPOCbro3c20FsET/v +8DorAiEnEFGfOUyWwXFExC3NQ+H555+XACeLvuLJRgIFvButAK9atapEiRLDhw+3EM477zyE9ujR +o7/88kvx4sWtTnPrcRUNZUJ6XGXjwWEEuF27djRtjf/FF19csWJFRpE4RICbNWu2b98+c6pz5840 +l3F7pGtCBvlbQD5BklAYEUg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gBNGpwtFQAREQAREIHECEuDE2elKERABERABEUiYQHzrgBNORheKQA4TcK/Tz+HMKmsiIALJ +IqAWcLJIKh4REAEREAERiIOABDgOWAoqAiIgAiIgAskiIAFOFknFIwIiIAIiIAJxEJAAxwFLQUVA +BERABEQgWQQkwMkiqXjyhQDfBMuXrCYjn8KVDIqKIzcJaBZ0bparcpVSAhKVlOJV5CKQJwTUAs6T +glY2RUAEREAEwkVAAhyu8pA1IiACIiACeUJAApwnBa1sioAIiIAIhIuABDhc5SFrREAEREAE8oRA +fAJ88ODBw4cP5wkaZVMEREAEREAEUkcgDgHet2/fzJkzv//+e00BTV15KGYREAEREIE8IRCHAO/a +tetf//rXF198IQHOk8qhbIqACIiACKSOQBwCXKRIkbJly5YsWTJ11ihmERABERABEcgTAnEIcNGi +RevWrVutWjVawGoE50n9UDZFQAREQARSRCDQTlhMvNq0adPy5ctLly7NSPCcOXNw1K5du0qVKjSL +U2SZohUBERABERCBHCbgL8A0dpctW/a3v/1t+vTpR48eZSS4cuXKFSpU6NSp08UXX9y4cWNpcA7X +D2VNBERABEQgRQT8BXj37t3vvvvu1KlTzzzzzHLlyk2aNKlNmzbHHHPMe++9R2v4z3/+c61atVJk +nKIVAREQAREQgVwl4C/AmzdvXrBgQf/+/YcPH24obN++/Y9//GPr1q1feeWVxYsXV69eXY3gXK0f +ypcIiIAIiECKCPhPwjp06BD6Wq9ePTPxitHfVatWrVu3rmnTpvRIMzZ85MiRFBmnaEVABERABEQg +Vwn4t4ArVarEzOePP/64bdu2pUqVmjt3btWqVZkR/f7772/dupWzav7mauVQvkRABERABFJHwF+A +K1as+Lvf/W7evHl33XUXY8D79+8fOHAgf5kL3bVr15YtW0qAU1c8ilkEREAERCBXCRQKsqKXruYv +v/ySqVjbtm1jKtZpp522fv36FStWoL6sRPJAU6hQoYizQZKLuMT7MA1JeBugsyIgAiIgAjlMIHUq +E1SAWX2E4rIeie8xFC9evGbNmixAQn3dljmLwX1WAuzkI7cIiIAIiEDICaROy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qeNBBQfUgD5PxJInXVyV+Aobx///45c+ZM +njyZzShxY03JkiXbt29/5plnMgvaoxhSZ7dNNA1J2LTkCC0BVYPQFk1GDFN9yAj2XE00ddUpkAAb +rOzFwXok2r4s/zX90kWL+vRgp85uW9JpSMKmJUdoCagahLZoMmKY6kNGsOdqoqmrTnEIcAJwU2e3 +NSYNSdi05AgtAVWD0BZNRgxTfcgI9lxNNHXVyX8WdK4yVb5EQAREQAREIIMEJMAZhK+kRUAEREAE +8peABDh/y145FwEREAERyCABCXAG4StpERABERCB/CUgAc7fslfORUAEREAEMkhAApxB+EpaBERA +BEQgfwlIgPO37JVzERABERCBDBKQAGcQvpIWAREQARHIXwIS4Pwte+VcBERABEQggwQkwBmEr6RF +QAREQATyl4AEOH/LXjkXAREQARHIIAEJcAbhK2kREAEREIH8JSABzt+yV85FQAREQAQySEACnEH4 +SloEREAERCB/CUiA87fslXMREAEREIEMEpAAZxC+kg4FgcOHDx84cCAUpsgIERCBfCIgAc6n0lZe +oxEYMWJE69ato50J5FeqVKmRI0cGCpr6QFWqVHnooYcSTmfx4sU//fSTuTxU+Uo4R7pQBMJMoGiY +jZNtIhB+AhdeeGHz5s3Db2cQC2+77bbdu3dPnTqVwLmUryB5VxgRSD8BCXD6mSvFnCLwz3/+M6fy +85/M5Gq+/pM//ReBzBNQF3Tmy0AWpJ8AncYdf/s9/PDDR48edRrw4Ycf9u7du169emeddZZpC3L2 +T3/60+WXX+4MxuGdd96Jz7nnnvvOO++YU7/++uujjz7aokWLWrVqDRky5IsvvrCXRI3Wno3q+OWX +X+655x5iO/bYY0lux44dNljA2GIFi2onBs+cOfObb7459dRTd+3a5cwX6T799NNt2rQpV65c+/bt +J06caC05/fTTp0yZ8vjjj5944olNmjS54YYbGFO3Z41j586d/fv3J3Ja2PQWtGrVatSoUTaMdwxP +PfUUKfbs2XP06NFwvvXWW+2FcohA1hPgVkzdz00n6WmlIYmk26wIk04grmpw0003FSpU6A9/+MNf +/vKXyr/9UA5j0quvv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3zp07t3fv3vfcc0+JEiWKFi2KiPJ79dVX0eBFixaddNJJfPIv58tAGRQBERABERCBJBLw +EU6EdufOnXQ7t2vXjs/dlypVqlixYsWLF0eJO3XqVKRIkQ0bNhw+fDiJBikqERABERABEcgHAj4C +TNO7cuXKjPjOnDlz8+bNe/bsQYyRZHqhv/76a6SXCVm0ifOBlPIoAiIgAiIgAkkk4D8GjMrS1Xzf +ffeRKr3NzMDatGnT4sWLly5deu21115zzTUaA05ieSgqERABERCBUBFI3RiwvwADgo7oBQsWvPji +i9999x0zomnyVq1alSnQZ511VpkyZTxIpc5um2gakrBpySECIiACIpBvBFKnMoEE2In7yJEjDP06 +fTzcqbPbJpqGJGxacoiACIiACOQbgdSpjM8YsBt0cPV1XysfERABERABERABQyBuARY4ERABERAB +ERCBghOQABecoWIQAREQAREQgbgJSIDjRqYLREAEREAERKDgBCTABWeoGERABERABEQgbgIS4LiR +6QIREAEREAERKDgBCXDBGSoGERABERABEYibgAQ4bmS6QAREQAREQAQKTkACXHCGikEEREAEREAE +4iYgAY4bmS4QAREQAREQgYITkAAXnKFiEAEREAEREIG4CUiA40amC0RABERABESg4AQkwAVnqBhE +QAREQAREIG4CEuC4kekCERABERABESg4AQlwwRkqBhEQAREQARGIm4AEOG5kukAEREAEREAECk5A +AlxwhopBBERABERABOImUDTuK3SBCGQ5gUKFCmV5DnLf/F9//TX3M6kc5j0BtYDzvgrkGQCpb1YU +uIopK4pJRhaQgL8A8yp66NChAiajy0VABERABERABJwE/Lug9+/fP3v27OXLl3fq1KlZs2ZcvH79 ++nnz5lWoUOGEE04oUaKEMzq5RUAEREAEREAEghDwbwHv3bv3k08+GTFixMiRI7/88ksi3b59+0cf +ffTAAw988MEH+/btC5KMwoiACIiACIiACDgJ+Asw/c979uypUaPGgQMHXnnlla1btx5zzDGnn346 +LeD33ntvxYoVR48edcYotwiIgAiIgAiIgC8BfwFmDLh48eI9evS4+uqrt23b9u2335YrV65nz55D +hgzZsWPHsmXLjhw54puMAohAaAlQw3P1t3nzZrB/+OGH4c9gaKuHDBOB1BHwF2DSZkZimTJlOnTo +0LFjxy+++GLXrl3FihWrWbMm/c80jrm3U2efYhaB9BDYuXNn//79Z86cedtttzVv3rxVq1ajRo2y +SZ911ln09zz33HMtWrSg1wf/p59+uk2bNryMtm/ffuLEiTYkjqeeegpPXlJHjx79zjvv3Hrrreas +OxKksXfv3vXq1ePU1KlTbSS//PLLPffcQ1rHHnvs5ZdfzpuuORXL314Y1UHWiISOq+OPP/6xxx6z +NyydW08++eRpp52GARdeeOHLL79sL3ebak55U6JjbMqUKY8//viJJ57YpEmTG2644fDhwzbOWFhs +ADlEIO8I+L4ar1279sYbb/zLX/5CyPnz55977rl33HEHD44//vGPXbt2/fzzz2kBx4rETTNWyIT9 +05BEwrbpwhASiFVhTGOxdu3aqMizzz57ySWXENLIFbmoXLkyL6CFCxfmLJMQb7/99qJFi955551j +xoy59NJLCYnDZPaWW27h9RTBu+mmm8qXL897atu2bc2piEheffVVXm27dOmC0l900UVEOH78eEIe +PHiwcePGJMeIDwkZkzz8TeRR/5pMYQZaji5eccUVmHr//febwFhYunTpP/zhD6+99tpll13GqX/+ +85/mVISpNnJvSiVLlmzUqFHLli3RWqIlQmaKmGs9sJgABI742UTlEIHMEoiomRwmyx7/iBBgbp67 +7rqLJHk0MBXrpJNOon1w3HHHcXdt2rTJw5TU2W0TTUMSNi05coBArApjpKVdu3Y02kw2L7744ooV +K7IKgEMEqWzZskuWLMG9atUqJv8PHz7c0jjvvPMQWiZD0EJlvObBBx80p4iTC2kom0NnJHQdcQlJ +OCOhhcohSwwwcsKECeYUUyB508WMWP42BrfDZKpfv37YZs7yAo0eM7OSw1NOOYV2tvEnAK3tq666 +yhw6TTU+5q83JQSYhRJ0jJnAnTt3plMBtzcWEzhWuZiz+isCGSSQusrpvwyJ2/Xss882y43Mq33r +1q1RZTrfuIGrVKniNk4+IpClBJDSIkWKGOMvuOCCcePGMcuBHml86JWleYdj+vTpTEik59bmETdd +zQjz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ix/pS4CIiACIpCnBCTAeVrwyrYIiIAIiEBmCUiAM8tfqYuACIiACOQpAQlw +nha8si0CIiACIpBZAhLgzPJX6ukmkPTNUNOdgfxIT8WUH+Wc77nULOh8rwF5mH893POw0JVlEQgh +AbWAQ1goMkkEREAERCD3CUiAc7+MlUMREAEREIEQEpAAh7BQZJIIiIAIiEDuE5AA534ZK4ciIAIi +IAIhJCABDmGhyCQREAEREIHcJyABzv0yVg5FQAREQARCSEACHMJCkUkiIAIiIAK5T0ACnPtlrByK +gAiIgAiEkIAEOISFIpNEQAREQARyn4AEOPfLWDkUAREQAREIIQEJcAgLRSaJgAiIgAjkPgEJcO6X +sXIoAiIgAiIQQgIS4BAWikwSAREQARHIfQJxCPDR3365j0Q5FAEREAEREIHUEwgqwEeOHPnll1++ +/PLLnTt3pt4qpSACIiACIiACOU4gqAAfPHjw888/HzFixOTJk7dv357jVJQ9ERABERABEUgxgaIB +4z98+PCaNWvWr18/bdo0BLhXr14NGzYsVKhQwMsVTAREQAREQAREwEkgaAu4aNGixYsX79GjR79+ +/RYuXPj666/PnTsXVXbGJbcIiIAIiIAIiEBAAv4tYFR23bp1ixcvZgx427ZttWrVatas2Ycffjhv +3ryzzz67b9++VapUUVM4IG4FEwEREAEREAFDwF+A9+7di9yOHTt206ZNuA8cOFCqVClaw0uWLPn7 +3/9et27drl27FilSREBFQAREQAREQASCE/AX4BIlSpx00knEOHv2bKZAX3zxxbgLFy7MoqRff/1V +I8HBWSukCIiACIiACFgChRBRexDVQQDWIB06dOinn35avXp1t27dypYty5AwAkzvNG1fj+avu2va +N7moNnh4piEJj9R1SgREQAREILcJpE5l/AXYkF26dOnUqVMZCUZ3GfStWbNmhw4dWrVq5c09dXbb +dNOQhE1Ljpwk4K5COZnNrM5U0l/cs5qGjE8zAfcjIlkV0l+Aaf5+9913f/3rX1euXFm5cmV6pGny +bt26FcfVV1/ds2dPxoNj4Uid3TbFNCRh05Ij9wi460/u5TE3cpSsR15u0FAu0knA/ZRIVm30HwNm +3Pejjz5iBfBll13WoEGD8uXL0x29cePGcePGvfvuu40bNz722GPTyUJpiYAIiIAIiEAOEPAX4C1b +ttD2ZbnRhRdeSGOX5u9ve0IfZS70Sy+9RNd0vXr1GBLOARbKggiIgAiIgAikjYC/cDLhmQY4HdEo +rjELH34VKlSgKYx/2mxVQiIgAiIgAiKQMwT8BbhatWrsvPH222/T8GXWFVOgd+zYsWrVqvfee69G +jRrHHXecxyzonMGkjIiACIiACIhAcgn4T8JitHn58uXsPfnpp5/u27cPud2/fz9t36ZNm15zzTVd +unQpWbJkLJtSN3ZtU0xDEjYtOXKPgOpPOMtU5RLOcslPq1JXG/0FGOK0fdkG64cffmDu1e7duxkJ +LleuHNOv+HmoLxemzm5bD9KQhE1LjtwjoPoTzjJVuYSzXPLTqtTVxkACbKAz3Gt+ZgyYiVdusyKK +xx0gWbO3bUJpSMKmJUfuEVD9CWeZqlzCWS75aVXqaqP/GLAlTuczP3sohwiIgAiIgAiIQMIEgn6O +MOEEdKEIiIAIiIAIiICbgATYzUQ+IuBFgIEYPs3JPESvQDonAiIgAn4EJMB+hHReBBwEvv322+rV +q7MlHN8mcXjH4WRD9YSvjSOZ2EHZy/2hhx4y553u2FfojAiIQEoIxDEGnJL0FakIZBUBsyD+k08+ +YRleYobfdtttLCXg0yaJXa6rREAEcoaABDhnilIZSQeBDRs20Pw99dRT05GY0hABEchpAuqCzuni +VeaSSuDmm2+eMmUK+9L0799/xYoVxP3000+3adOGZfHt27efOHGiTe30008n5OOPP37iiSc2adLk +hhtu4OPZnB0yZMjMmTO/+eYbJHzXrl02vNvBMPM999zTokULPnZy+eWXs/2cCUPM//u//zty5MgT +TjihR48e77zzDp8mu+SSS3gt6N69+6xZs0wwhqiffPLJ0047ja3a2cX95ZdfdicRy4fvr5BB7KSx +3rx5c/a/GzVqlA0cK2smwFNPPQUKPpI2evRobLv11lvthXKIgAhEEFALOAKIDkUgJgE07/PPP2cx +HlJXpkyZO+6447HHHrv99ttRKb4YdtZZ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uvvbZr165My4plROrGrm2KaUjCpiWHCIiACIhAvhFIncr4CzCs0eANGzawFwfjwXwZ +CcVlKhZt3yZNmnioLxemzm5bA9KQhE1LDhEQAREQgXwjkDqVCSTABjcTr8yPnTfMMLDbrIiCcQdI ++oBxGpKIyJQORUAEREAE8odA6lTGfwzYUjaiaw/lEAEREAEREAERSJiAtnFOGJ0uFAEREAEREIHE +CUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpSBERABERABBImIAFOGJ0uFAER +EAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpSBERABERABBImIAFO +GJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpSBERABERA +BBImIAFOGJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpS +BERABERABBImIAFOGJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyA +BDhxdrpSBERABERABBImIAFOGJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAER +EAERSJyABDhxdrpSBERABERABBImIAFOGJ0uFAEREAEREIHECQQV4KNHj+7du/fAgQOJJ6UrRUAE +REAEREAE/kOg6H8cXv/37ds3f/78H3/8sUKFCt26dStSpMjq1av5W79+/dKlS3tdqXMiIAIiIAIi +IALRCPgL8OHDh//9738/9dRTGzZsKFu27Lp16woXLjx79uyDBw8OGDCgV69epUqVihZzMv0KFSpk +o/v111+tO6CjgJcHTEXBREAEREAERCA4AX8B3rFjxwcffPDLL79ceuml27Zte+2110qWLNmgQQN8 +xo4d26hRo2bNmjkVLnjaAUNGRM5hXBpcwMsDGqlgIiACIiACIhAXAX8B3rx585o1ay666KKhQ4fu +3r17xowZ9Dzfe++99EiPHDly0aJFaHCxYsXiSrWAgYNrcIT6FjBdXS4CIiACIiACySLgMwmLtuaR +I0dIjNFf/jIViw7n8uXL0wiuVKkSPnREJ8uUuOIJoqxBwsSVqAKLgAiIgAiIQLII+LSA0bAqVarQ +5J08eXKJEiXojqYRvGLFihdeeGHJkiXVqlVr3Lgxs7GSZU1c8WCbR1+01DcumAosAiIgAiKQZgJe +GmZMQeRQ3DFjxtDbjBifd955RYsWpSOayVn9+/dv2bIlc7JiGe1WQQ/JjBUJ/u54PAKThEf4xAzw +SE6nREAEREAEcpiAW1CSpSP+Amyw7ty5c9myZZs2bapatWrFihVNR7TvGqQk2u2OKoHyTha1BJLW +JSIgAiIgAtlIwK0+yZISny5oA4tu588+++zTTz9dv349a4IZA65cufIpp5zSp08fHOkBSobdFOJK +OlnI4kpUgUVABERABEQgKgF/AWb3qylTpowaNQqtPfbYY5mNxVSsVatWPffcc1u2bBk8eLCZnxU1 +9uR6FkSDpb7JLQvFJgIiIAIiUEAC/gK8devWmTNn1qtX78Ybb6xZsybzn5kXvX37dhYEz5o1q1On +Tm3btvUYBi6gfRGXJ6bBUt8IjDoUAREQARHIOIGY86esZbt27WLyc48ePRBaBJgBYKZiHXfccawM +pim8du1as07JhpdDBERABERABETAl4C/AJcrV47O52nTps2dO5fBYBb+sh8WE7ImTpyIm1NpXoYU +b3M23vC+yBRABERABERABApOwH8WNCo7ffr00aNHo74s/GUGFgK8ceNGDgcOHHj55Zd7zMNyT5tK +lhy6Y47KIlnJRY1cniIgAiIgAjlPwC03yVIWfwEGLr3QfH2Btb98j2HPnj1Yw1cZWrdu3a9fP8aG +3cbZ8nCfSpbdJOGO3KZrHElMKyJmHYqACIiACOQJAbfWJEtcAgkwlGkHM/GK1cB8FZidn8uUKUPD +l79uy5xF4j6bLLtNKu74berJTchGK4cIiIAIiEBeEXALTbL0JagAW9wmYbdBNoDT4Q6WLLttKu4k +OJX0VGxycoiACIiACOQVAbfKJEti/JchRYB2mxIRIM2H7heCZKFJc0aUnAiIgAiIQF4RiFuAw0lH +ohvOcpFVIiACIiACsQj4L0OKdaX8RUAEREAEREAEEiYgAU4YnS4UAREQAREQgcQ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atX +r+YjSHREV69e/cwzz7zggguc+1OmNMOKXAREQAREQARyiYB/FzTrgCdOnDhy5EhWIrVp04ZPEPJ9 +pMWLF/NBpMGDBw8ZMsRjHbBawLlUV5QXERABERABCKSvBcyS3zlz5px88sm33HIL3c5mHfCePXvG +jRv3zTffoMQnnHCCxzCwSksEREAEREAERMBNwH8ZklkHfMoppzRo0KBq1aplypShycswcJ8+fdiR +Y+3atXRQu+M1Psl6TYgVv/xFQAREQAREIJ0Ekqhr/mPA7PzMb9asWQz6VqxYkXyiu/z9+uuvWQfM +vhwsT/LIfBJt9UhFp0RABERABEQguwj4CzD7XnXr1u2RRx656KKLWrVqRfN3y5Yty5cvZ0b0wIED +mzZt6i3A2YVD1oqACIiACIhAegj4T8LCDmY+0wJ+6623li1bxpeRGPFFhnv16sVulHXr1tVMq/QU +lVIRAREQARHIJQKBBJgMHzx4EBlmRjQjvggwq4/YhJLxYE2/yqXaoLyIgAiIgAikjUBQAU6bQUpI +BERABERABPKBgP8s6HygoDyKgAiIgAiIQJoJSIDTDFzJiYAIiIAIiMD/IyABVj0QAREQAREQgQwQ +kABnALqSFAEREAEREAEJsOqACIiACIiACGSAgAQ4A9CVpAiIgAiIgAhIgFUHREAEREAERCADBCTA +GYCuJEVABERABERAAqw6IAIiIAIiIAIZICABzgB0JSkCIiACIiACEmDVAREQAREQARHIAIH/Dz93 +dVWwJbMUAAAAAElFTkSuQmCC +The Chameleon screen layoutBackground Set the position of background.png within the screenbackground_pos_x<key>background_pos_x</key><string>-0</string>0 pixels from reverse origin along the x axisbackground_pos_y <key>background_pos_y</key><string>-0</string>0 pixels from reverse origin along the y axisLogoSet the position of logo.png within the screenlogo_pos_x <key>logo_pos_x</key><string>0</string>0 pixels from origin along the x axislogo_pos_y <key>logo_pos_y</key><string>0</string>0 pixels from origin along the y axisDevices Set the position of the device list within the screendevices_pos_x <key>devices_pos_x</key><string></string>blank to center on the x axisdevices_pos_y <key>logo_pos_y</key><string></string>blank to center on the y axisdevices_max_visible <key>devices_max_visible</key>maximum number of devices visible<string>4</string>devices_icon_spacing <key>devices_icon_spacing</key>spaces between the drive icons<string>20</string>devices_layout <key>devices_layout</key><string>horizontal</string>horizontal or vertical listdevices_bgcolor <key>devices_bgcolor</key><string>#000000</string>web format #RRGGBBdevices_transparency <key>devices_transparency</key><string>128</string>0 (Opaque) -> 255 (Transparent)Boot prompt Set the position of the boot prompt within the screenbootprompt_pos_x <key>bootprompt_pos_x</key><string></string>blank to center on the x axisbootprompt_pos_y <key>bootprompt_pos_y</key><string></string>blank to center on the y axisbootprompt_width <key>bootprompt_width</key><string>-20</string>20 pixels less than the screen's width windowbootprompt_height <key>bootprompt_height</key><string>20</string>20 pixel high windowbootprompt_textmargin_h <key>bootprompt_textmargin_h</key>8 pixel horizontal text margin left and right<string>8</string>bootprompt_textmargin_v <key>bootprompt_textmargin_v</key>4 px vertical text margin both top and bottom<string>4</string>bootprompt_bgcolor <key>bootprompt_bgcolor</key><string>0x333445</string>web format #RRGGBBbootprompt_transparency <key>bootprompt_transparency</key><string>0</string>0 (Opaque) -> 255 (Transparent)Info box Set the position of the info box within the screeninfobox_pos_x <key>infobox_pos_x</key><string></string>blank to center on the x axisinfobox_pos_y <key>infobox_pos_y</key><string></string>blank center on the y axisinfobox_width <key>infobox_width</key><string>550</string>550 pixels wideinfobox_height <key>infobox_height</key><string>406</string>406 pixels highinfobox_bgcolor <key>infobox_bgcolor</key><string>#333445</string>web format #RRGGBBinfobox_transparency <key>infobox_transparency</key><string>64</string>0 (Opaque) -> 255 (Transparent)Menu Set the position of the pop up menu within the screenmenu_pos_x <key>menu_pos_x</key><string></string>center on the x axismenu_pos_y <key>menu_pos_y</key><string></string>center on the y axismenu_bgcolor <key>menu_bgcolor</key><string>#111223</string>web format #RRGGBBmenu_transparency <key>menu_transparency</key><string>0</string>0 (Opaque) -> 255 (Transparent)Boot DisplaySet the display dimensions to use when booting the kernel, will attempt to find the closest one available.boot_width <key>boot_width</key><string>1280</string>1280 pixels wide screenboot_height <key>boot_height</key><string>1024</string>1024 pixels tall screenGetting in touchChameleon homepagehttp://chameleon.osx86.hu/E-mail : voodoo@mercurysquad.comHope you guys like the bootloader!We appreciate your feedback and supportPAGE PAGE 1 \ No newline at end of file diff --git a/doc/User_Guide_src/.svn/text-base/Chameleon 2 v0.5.docx.svn-base b/doc/User_Guide_src/.svn/text-base/Chameleon 2 v0.5.docx.svn-base new file mode 100644 index 0000000..2ca6d30 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/Chameleon 2 v0.5.docx.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/chameleon.png.svn-base b/doc/User_Guide_src/.svn/text-base/chameleon.png.svn-base new file mode 100644 index 0000000..db23bc8 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/chameleon.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/colorchart.png.svn-base b/doc/User_Guide_src/.svn/text-base/colorchart.png.svn-base new file mode 100644 index 0000000..69a05b4 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/colorchart.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/install_complete.png.svn-base b/doc/User_Guide_src/.svn/text-base/install_complete.png.svn-base new file mode 100644 index 0000000..7a9f892 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/install_complete.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/install_cust.png.svn-base b/doc/User_Guide_src/.svn/text-base/install_cust.png.svn-base new file mode 100644 index 0000000..bf0b622 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/install_cust.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/install_dest.png.svn-base b/doc/User_Guide_src/.svn/text-base/install_dest.png.svn-base new file mode 100644 index 0000000..6b0a239 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/install_dest.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/install_stand.png.svn-base b/doc/User_Guide_src/.svn/text-base/install_stand.png.svn-base new file mode 100644 index 0000000..6971b82 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/install_stand.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/install_start.png.svn-base b/doc/User_Guide_src/.svn/text-base/install_start.png.svn-base new file mode 100644 index 0000000..5645d03 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/install_start.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/screen_format.png.svn-base b/doc/User_Guide_src/.svn/text-base/screen_format.png.svn-base new file mode 100644 index 0000000..148417f Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/screen_format.png.svn-base differ diff --git a/doc/User_Guide_src/.svn/text-base/xnulogo.png.svn-base b/doc/User_Guide_src/.svn/text-base/xnulogo.png.svn-base new file mode 100644 index 0000000..8901077 Binary files /dev/null and b/doc/User_Guide_src/.svn/text-base/xnulogo.png.svn-base differ diff --git a/doc/User_Guide_src/Chameleon 2 v0.4.xml b/doc/User_Guide_src/Chameleon 2 v0.4.xml new file mode 100644 index 0000000..917d8d8 --- /dev/null +++ b/doc/User_Guide_src/Chameleon 2 v0.4.xml @@ -0,0 +1,12299 @@ + + +Kevyn ShortellKevyn Shortell202009-03-29T08:05:00Z2009-03-30T07:05:00Z2009-03-30T07:05:00Z1415138626Apple71171059312iVBORw0KGgoAAAANSUhEUgAAAtAAAAD5CAYAAAAOawJLAAADJWlDQ1BJQ0MgUHJvZmlsZQAAeAGF +lE1IFGEYx/+zjQSxBtGXCMXQwSRUJgtSAtP1K1O2ZdVMCWKdfXedHGenmd0tRSKE6Jh1jC5WRIeI +TuGhQ6c6RASZdYmgo0UQBV4itv87k7tjVL4wM795nv/7fL3DAFWPUo5jRTRgys67yd6Ydnp0TNv8 +GlWoRhRcKcNzOhKJAZ+plc/1a/UtFGlZapSx1vs2fKt2mRBQNCp3ZAM+LHk84OOSL+SdPDVnJBsT +qTTZITe4Q8lO8i3y1myIx0OcFp4BVLVTkzMcl3EiO8gtRSMrYz4g63batMnvpT3tGVPUsN/INzkL +2rj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2h0PoDjnfJxEzY01ntjx/wO01j38AzCIrwAAAABJRU5E +rkJggk== +Chameleon 2.0 Users GuideRevision 0.4Table of ContentsIntroductionPage 2Running the InstallerPage 3Custom InstallPage 4Advanced OptionsPage 6Boot.plist configurationPage 7Custom boot.plist variablesPage 6ThemesPage 8Screen LayoutPage 9Boot devicesPage 8Boot promptPage 9Info boxPage 10MenuPage 11Boot displayPage 12IntroductionChameleon 2.0 the latest version of the of the Chameleon boot loader for OS X on X86 hardware. It is an EFI boot loader that is designed to replace the Darwin and PC_EFI boot loaders. It has several new features including:Graphical User Interface modeCustomizable ImagesSupport for GPT/MBR partition typesRAID supportiVBORw0KGgoAAAANSUhEUgAABAAAAAMACAIAAAA12IJaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ +bWFnZVJlYWR5ccllPAABydhJREFUeNrs/WmQZNmVH3b+zzn3vufuseZWmVlZe2FtoFBAA91NtjXZ +UnWTHJFscdE2kmkkcUbkjGnMNF/GZr6MaT7OhzGbxUY2MtkMKaMojc2IklEUF0ndTfRONIAG0I1G +YakqFGqvyj0zItz9vXfvPWc+3OceHpGZ1SDZpDGRJ5DI8vD4uWeEx4vMe+/Z6IUXfx6AmRIxTr6d +vFMBfsCH3Lt37969e/fu3bt3/3D48X0iBnTtNu5cv8vr+927d+/evXv37t27d/+QenrhxZc2tw4P +3jHgvlsN9+7du3fv3r179+7dP0Seq17vEh60jdj4qHv37t27d+/evXv37h9WT7UG4MTuwRQnNwoP +2Gq4d+/evXv37t27d+/+IfN87+4BG6lCY57QSm/uJ9y7d+/evXv37t27d//Q+XUE4FTm0OlEons2 +Ge7du3fv3r179+7du3/4/Lp2+NQe4tSD791kuHfv3r179+7du3fv/uHzTHRv/6BT0QReP6wC9+7d +u3fv3r179+7dP6x+owhYzfAHjQ/YfHPv3r179+7du3fv3v1D5k91AdpE+IPSjNy7d+/evXv37t27 +d/+QeT4ZHcBGhtBm7GB9p7p37969e/fu3bt37/7h9ccRgPUG4kN2EvfdcLh37969e/fu3bt37/5h +8bxZPXDqBu7TWBTu3bt37969e/fu3bt/eD0/aHTwamTA5m1e7Rncu3fv3r179+7du3f/UHr69Gde +uidAcHpqwH0jC+7du3fv3r179+7du3/oPBPdWwd8n8HCpyIL7t27d+/evXv37t27fxj9Zp7Q6ajB +yee6d76Ae/fu3bt37969e/fuHzJPL7z40oMCBA8oH1b37t27d+/evXv37t0/pP6BRcCnthEbH3Xv +3r179+7du3fv3v3D6k9NAlaAYQr6IWeMuXfv3r179+7du3fv/mHyfO/uARupQicbDN3bRtS9e/fu +3bt37969e/cPk19HAE5lDp1OJLpnk+HevXv37t27d+/evfuHz69rh0/tIU49+N5Nhnv37t27d+/e +vXv37h8+z0T39g86FU3g9cMqcO/evXv37t27d+/e/cPqN4qA1Qz3FhN8SIWBe/fu3bt37969e/fu +Hy5/qgvQJsIflGbk3r179+7du3fv3r37h8zfOzd4nSG0GTtY36nu3bt37969e/fu3bt/eP1xBGC9 +gfiQncR9Nxzu3bt37969e/fu3bt/WDxvVg+cuoH7NBaFe/fu3bt37969e/fuH17PDxodvBoZsHmb +V3sG9+7du3fv3r179+7dP5SePv2Zl+4JEJyeGnDfyIJ79+7du3fv3r179+4fOs9E99YB32ew8KnI +gnv37t27d+/evXv37h9Gv5kndDpqcPK57p0v4N69e/fu3bt37969+4fM0wsvvvSgAMEDyofVvXv3 +7t27d+/evXv3D6l/YBHwqW3Exkfdu3fv3r179+7du3f/sPpTk4AVYJiCfsgZY+7du3fv3r179+7d +u3+YPN+7e8BGqtDJBkP3thF17969e/fu3bt37979w+TXEYBTmUOnE4nu2WS4d+/evXv37t27d+/+ +4fPr2uFTe4hTD753k+HevXv37t27d+/evfuHzzPRvf2DTkUTeP2wCty7d+/evXv37t27d/+w+o0i +YDXDvcUEH1Jh4N69e/fu3bt37969+4fLn+oCtInwB6UZuXfv3r179+7du3fv/iHz984NXmcIbcYO +1neqe/fu3bt37969e/fuH15/HAFYbyA+ZCdx3w2He/fu3bt37969e/fuHxbPm9UDp27gPo1F4d69 +e/fu3bt37969+4fX84NGB69GBmze5tWewb179+7du3fv3r179w+lp09/5qV7AgSnpwbcN7Lg3r17 +9+7du3fv3r37h84z0b11wPcZLHwqsuDevXv37t27d+/evfuH0W/mCZ2OGpx8rnvnC7h37969e/fu +3bt37/4h8/TCiy89KEDwgPJhde/evXv37t27d+/e/UPqH1gEfGobsfFR9+7du3fv3r179+7dP6z+ +1CRgBRimoB9yxph79+7du3fv3r179+4fJs/37h6wkSp0ssHQvW1E3bt37969e/fu3bt3/zD5dQTg +VObQ6USiezYZ7t27d+/evXv37t27f/j8unb41B7i1IPv3WS4d+/evXv37t27d+/+4fNMdG//oFPR +BF4/rAL37t27d+/evXv37t0/rH6jCFjNcG8xwYdUGLh37969e/fu3bt37/7h8qe6AG0i/EFpRu7d +u3fv3r179+7du3/I/L1zg9cZQpuxg/Wd6t69e/fu3bt37969+4fXH0cA1huID9lJ3HfD4d69e/fu +3bt37969+4fF82b1wKkbuE9jUbh37969e/fu3bt37/7h9fyg0cGrkQGbt3m1Z3Dv3r179+7du3fv +3v1D6enTn3npngDB6akB940suHfv3r179+7du3fv/qHzTHRvHfB9Bgufiiy4d+/evXv37t27d+/+ +YfSbeUKnowYnn+ve+QLu3bt37969e/fu3bt/yDy98OJLDwoQPKB8WN27d+/e/T9vnokAA+i+XK2C +k89uxV9P9+7du38E/QOLgE9tIzY+6t69e/fu/7nwTLT+pWbETEwA6l3rG8QswsSod65W/8YkdVdQ +lb+e7t27d/+I+FOTgBVgmIJ+yBlj7t27d+/+n6lnluO/1plMbb2spxNn/AaQmZ28E/UeMzsdIIAB +pGZ1L+Gvv3v37t3/CHu+d/eAjVShkw2G7m0j6t69e/fu/1n4elq/Xv2PB/xELExEwkQEJjBBmJgg +zMIUhFfvjr8H4XqDCLR6A1CjByKrfxuINo6O/PV37969+x8pv44AnMocOp1IdM8mw7179+7d/7Pw +dam/XvQDVj+6kc4DItpM7/nQ59d10MDUVlGB+oH1Px6bH4W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KmWr3QzGKUtPwPkPRD1oz+/Xg577zzzg9TgtFJwApAYAr4JGeMOe+88847 +7/wT86kAkEoB9Xjg8suJeDgwODUFlw0DqAZc9gDU2y+zCQCoRwqYWUozUqNwSipgxADUj5fzzjvv +/JCnyewBGlKhUYOhSRtR55133nnnnX8y/DCOVykbAOoH0pDgUsijpa1n8vUX1Sha/63lLGCTqLXu +X3TE8TNF/0MZkO9/55133vlRvq4AjCmHxoVEE0mG884777zzzn8BfC3iR0pDK7GqDAAxVZMsEcAI +kajyqBirAFSdwSnQVwOzSmI07DMeJgNJduT733nnnXe+yde9w2M5xNiLJ5MM55133nnnnf8C+KTS +SdPBoPTxLAP1JO1XiWmel6glqx9VlbTyL6pSWgAl3U9dMaijf60aDIbvxsT3v/POO+/8JE+Ik/5B +Y9UEql+WAOedd955553/InitF+kbzvy1oB8RVSKApowAANVA1KKUOp8U4qvVob+qxLq3OBn/QyX+ +UTPf/84777zzm/ONJmA1gycaH9C8Oe+888477/wXw9OwA7i0BwUAQisbhQGs1AXV31sKQKZabyNN ++EpBf20MCqO+n77/nXfeeec35cdcgJoQPJHMyHnnnXfeeee/SL6ZA5haw/wHGotY5aJ+bRlUbaSW ++I/8WNn+qO9/55133vmz8DRaHYCGQqhZO6gfVOedd955553/v+e18vkxbej4RdWg+jNc2K+8PssG +AAAQtXqGQPlyHat0+/533nnnnd+cH1YA6gTiLJnEpgmH884777zzzn/RPDVW95MiqC4IpMaAM2xz +ZNU/bURUfH8677zzzj8hT83ugbE7sImxKDjvvPPOO+/8l5DXaoxXqgaM2flbdVPR5n0AME1zf8sU +Qs18fzrvvPPOPxmezjQ6uBoZ0LxPdWnVeeedd95557+EfB35ayXpkcr3J91J6UF1PzX7lqv+pTDI +96fzzjvv/JPj8eprb5woEIy3T21aWXDeeeedd975p4ivp4Y1RwiP3TYT/Pj+dN55551/Yp4QJ/uA +NxksPFZZcN5555133vmnjlcbuv4njVD1iKUJYLXgx/en88477/wXyjd1QuNVg9FtTc4XcN555513 +3nnnnXfeeefPMR6vue7GMxUIztA+rM4777zzzjvvvPPOO+/8OcqfsQl4LI1oPOu8884777zzzjvv +vPPOn6v82CRgBSAwBXySM8acd95555133nnnnXfe+XOJp8nsARpSoVGDoUkbUeedd95555133nnn +nXf+XOLrCsCYcmhcSDSRZDjvvPPOO++8884777zz5x5f9w6P5RBjL55MMpx33nnnnXfeeeedd975 +c48nxEn/oLFqAtUvS4DzzjvvvPPOO++88847f67yjSZgNYPJZoKzdBg477zzzjvvvPPOO++88+cW +P+YC1ITgiWRGzjvvvPPOO++888477/w5xk/ODa4VQs3aQf2gOu+8884777zzzjvvvPPnLj+sANQJ +xFkyiU0TDuedd95555133nnnnXf+XOGp2T0wdgc2MRYF55133nnnnXfeeeedd/7c5elMo4OrkQHN ++1TlDM4777zzzjvvvPPOO+/8Ocnj1dfeOFEgGJ8asGllwXnnnXfeeeedd955550/53hCnOwD3mSw +8FhlwXnnnXfeeeedd955550/F/mmTmi8ajC6rcn5As4777zzzjvvvPPOO+/8OcbjNdfdeKYCwRna +h9V555133nnnnXfeeeedP0f5MzYBj6URjWedd95555133nnnnXfe+XOVH5sErAAEpoBPcsaY8847 +77zzzjvvvPPOO38u8TSZPUBDKjRqMDRpI+q8884777zzzjvvvPPOn0t8XQEYUw6NC4kmkgznnXfe +eeedd9555513/tzj697hsRxi7MWTSYbzzjvvvPPOO++88847f+7xhDjpHzRWTaD6ZQlw3nnnnXfe +eeedd955589VvtEErGYw2Uxwlg4D55133nnnnXfeeeedd/7c4sdcgJoQPJHMyHnnnXfeeeedd955 +550/x/jJucG1QqhZO6gfVOedd95555133nnnnXf+3OWHFYA6gThLJrFpwuG8884777zzzjvvvPPO +nys8NbsHxu7AJsai4LzzzjvvvPPOO++8886fuzydaXRwNTKgeZ+qnMF555133nnnnXfeeeedPyd5 +vPraGycKBONTAzatLDjvvPPOO++8884777zz5xxPiJN9wJsMFh6rLDjvvPPOO++8884777zz5yLf +1AmNVw1GtzU5X8B555133nnnnXfeeeedP8d4vOa6G89UIDhD+7A677zzzjvvvPPOO++88+cof8Ym +4LE0ovGs884777zzzjvvvPPOO3+u8mOTgBWAwBTwSc4Yc95555133nnnnXfeeefPJZ4mswdoSIVG +DYYmbUSdd95555133nnnnXfe+XOJrysAY8qhcSHRRJLhvPPOO++8884777zzzp97fN07PJZDjL14 +Mslw3nnnnXfeeeedd9555889nhAn/YPGqglUvywBzjvvvPPOO++888477/y5yjeagNUMJpsJztJh +4LzzzjvvvPPOO++8886fW/yYC1ATgieSGTnvvPPOO++8884777zz5xg/OTe4Vgg1awf1g+q88847 +77zzzjvvvPPOn7v8sAJQJxBnySQ2TTicd95555133nnnnXfe+XOFp2b3wNgd2MRYFJx33nnnnXfe +eeedd975c5enM40OrkYGNO9TlTM477zzzjvvvPPOO++88+ckj1dfe+NEgWB8asCmlQXnnXfeeeed +d9555513/pzjCXGyD3iTwcJjlQXnnXfeeeedd9555513/lzkmzqh8arB6LYm5ws477zzzjvvvPPO +O++88+cYj9dcd+OZCgRnaB9W55133nnnnXfeeeedd/4c5c/YBDyWRjSedd5555133nnnnXfeeefP +VX5sErACEJgCPskZY84777zzzjvvvPPOO+/8ucTTZPYADanQqMHQpI2o884777zzzjvvvPPOO38u +8XUFYEw5NC4kmkgynHfeeeedd95555133vlzj697h8dyiLEXTyYZzjvvvPPOO++888477/y5xxPi +pH/QWDWB6pclwHnnnXfeeeedd955550/V/lGE7CawWQzwVk6DJx33nnnnXfeeeedd975c4sfcwFq +QvBEMiPnnXfeeeedd9555513/hzj8Zrrvmr0lZu2CzQLB+S886O87N2z44rLD+zdu/vgpQf2nbdn +lAcAQCzvI5Z/18/W989R/vHDR+6/74HDh4/e87kHjhw9WT3r54/zzjvvvPPOO/8M5YcVgPplZ8kk +Nk04nN+y/PRU+3Wvu/HVN3zFFVdc2u1OiYiqiCiOBdGbb98SVt85R3kkZOIQwsbG+j333PfXf3PT +hz/8V+sbAz9/nHfeeeedd975ZyaP11x345lGB4+9uLqvzjvPjG/55te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FF1544YUfZvxQQcC1rAlDGRSEF1544YUXXnjhhRde+P2cHzQIuGZzg8cWCC+88MIPP/78 +88856qj5YRgiADOXcqgxIBIzGXI9Z+XKNT/72S+7u3rlegovvPDCC/864a0AUPYxEwwSU1xb2hBe +eOGFH578l6/89LvOfBMM8jJEZKg/n//1b/5w/XdvzeeLcj2FF1544YV/HfAV5dMVAEDCVShZUx3K +wwiEF1544Yc77xd9AKBBXgjAAEqpd73zLeef/16bQl6up/DCCy+88MOdH6gYXGEpsH9WNJ2sMCy8 +8MIL//rgVemFpVeMaq20Uoh48UXnfeDcd8j1FF544YUX/nXAx7HDFTJEhdtQtZAhvPDCC/864MEY +E4ahMaamF5AVBvr6cz19/R+/5CNnnLFQrqfwwgsvvPDDndftY6cxU6zxit8kDmLpNGv+RuGFF174 +1wd/0inHdO7a/vvf//7pp5/OZrPt7e1JUim1Y8eOO++4Y9u2bQdOmeIH4eGHz3vp5TVbt27bP3/v +5APHdXX1xFhrS2Oh4Mt8EF544YUXvoJP2gWoKpNobRlCeOGFF/71wWvECQccsGnTprVr1z777LNx +IqD4tWrVqueff76lpbmxvi7luZlMevKUSX9zfy6/7KIVyxYvX7po+dJFX7ny0wdOGvvq/t6bvv/N +8897j+VPOvGoT33qIvsV+9j+We95y/Kliw6ZPV3mj/DCCy/865tPmgZUOUSDnCm88MIL/zrhDfHU +qVMnTZrkuu769et37do1cIJSQRC88MILzc3Ns2fPJgZDBABhaP7O/rz//Rf/+398/swz3/T2t536 +1/b/kNnTly9ddPllF9Xkn3zquaOPPszykw88YOnSFzZs3P7XXx+W+SO88MIL//rmq+sGxx5ClSfH +1cWEF1544V8nvCGl1CGHHAIAfX19L774YmITDFu2bNm0adPUqVPHjG4PwhAAiBiA/57+2Ncrr2xM +qmcuv+xiaxa4/LILY/7yyy4qHbwobv+6674MAB8896zlSxe1NDdUtL906QvTp09taW4AgKOPPmzj +xs32owMnjf/ud660Zgf7KaJ64P6ffvc7V77n3W9+4P7bTj7paNtfADjllG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w8PDw8PLx5Pe9t6eCuJQP027wrZoCHh4eHh4eH +h4eHN6Vnk7OLQzoIjKsGhO1ZgIeHh4eHh4eHh4c3nf//Etp73CXrfDAAAAAASUVORK5CYIJ= +Chameleon can be installed on any BIOS bootable device such as USB flash drives, hard drives, and of course off a cd-rom.Installing ChameleonChameleon 2.0 includes it’s own installer package which will install the required boot loader components as well as the new themes onto a hard drive or other bootable device. Once the install is complete you will need to reboot your computer to use the new boot loader featuresTo get started, double click on the Chameleon Installer.iVBORw0KGgoAAAANSUhEUgAAAnEAAAG6CAIAAADoKIeFAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2OtDzA2gei1WPtZVa+8Yf/s9a9az0wA57oEVndDqr +uUSqFNBoAnNcjGeAd/SRa0D/T6BALmagp9MdVzOkFLiYz00kLauueopS5/Oyl1d5TpHJDi5VnOkp +xj76IPLIYQJJWHzqsNTZSe38S+CWvNZo/v31QsaTFlSeRDPJrbhPvaVqLTCyvLkV0xh3xB3TsFKp +e/gHmVWEZApHLZsAAAAJcEhZcwAACxMAAAsTAQCanBgAACAASURBVHgB7L0HgF1Vuf696+lTM5lM +ek8oCRAgdCX0jgh8ooKIivdvA6+KXq5YsSIqXMtVRKWJq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fvvtR8/hVNX/p556ipPnnnvO8zzHcR5++OHm5ubZs2dvL+jccsst +f/jDH+bPn7+5DYbt0BlCgZubcRPpv/e970GooPfnP/+5qalJpfzMZz6DcL+JXPqWQuD1eCIaW43A +ZiEQ4PUbGGiALeFWfWgERoAAcip7BCpOxTi6ePFiFB2VSoUTcj/yyCOQLgk4R6V21FFHobqEeJAF +N1Y2NHzqqafuuuuuu+222wknnJDP50mJCvQjH/nIXnvtBcFwd4DC0S0jUL7nPe9ZtGjRaaedRpbz +zz8f6yPK5IMPPviII4647bbbBip6zQaQ64477iD9pZdeevjhh6uMG6t6oFhOUPBedNFFnNBf2vP3 +v/994C6N+drXvkbLzzjjjAHxHVL8+te/DjJKAF27du1A+oGTQqHw29/+lq8o0gcIVd2NxWIDyYYt +/5e//CVy7Zw5cwDhC1/4Qmdnp0p/880307wrrrji+uuvf9vb3ob+4IYbbkDq/fSnP03iD3zgAytX +rlQpR9JCUq5YseLss8/eZZdd9tlnH7rJvssqOzOq//mf/3n729/O46bGK6+8knZySz2v448/ni6/ +733vo9ILL7xQPWKVcWOfquWXXHIJD5S36MADDxxsL6C/7373u6dPn87bePHFF1PIsE9kY7BsrFJ1 +fdjXZqAjvOe8kICw6UL03Z0TAdS9vPnEUbIYAuHVnRMF3evNQqC+vh6e6+npWbJkycKFCxlVjz32 +WEqAP2BWxFaGP74yFJ5zzjnYxlCNIntxznA8tCJsWqeccgrW2b333ps0FM77CLscd9xxyGp77LEH +9Ik++aSTTnriiSfITnUMak8//TQDNIX39/f/7ne/+9CHPvSNb3wDKRlxmVFY1TKSBsyYMQP9Kunn +zp3LuM/JJqpWxarPdDrNaM55a2sr8wCsgAN3v/Od7+D8kkql7rvvPuROdf1Tn/rUj370oz333JM+ +cp0GD6QfOEF1qShq07LvsOVjcG1paYHmeTRIz1dffbUqFiMlcP3mN7+BeCBm/J5I8/73vx8wYUH0 +3sjoKuVIWshzBCU0/7SfycGPf/xjuFNl/6//+q9vfetbvAD/+Z//yUP54he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+yp6sCHAzfeADH/jiF7947bXXnnvuuTe/+c1/+qd/evfu3etRXwo688wz73znOw9Q/rCHPew+97nP +s5/97AEyPZO+853vfPSjH/3Wt751/vnn3/e+973jHe/YU2xubu5///d/P/3pTy8sLDzqUY+6zW1u +42KY83/8x3/8yle+cve73/0XfuEXnA+B/Pve976b3OQmv/zLv3zKKad40je/+c23ve1tqKLa5AJM +XE+F7qTKT7WXU9mglL6e2hrjA+WLBz6Et+p4BhEIjAwBe8DluZY9SvbdKD3sjqzwKGiTInDDDTdg +DJ7+9KdjaW5729tiVp///OdjX9epuf/0T/+EcVqd8p/85Cc//OEP++X967/+6+c+97kXXHDB7/zO +79zhDnd41atehVXGRnbL/9u//dszn/lMzjbiO8QPetCD/uEf/sFlHv/4x7/zne8Eh7/927/9/d// +fedjNZ/whCdgqr/73e+S5cCBA0r67Gc/SxToZmZmHvrQh77rXe8qWEdFZVPtLEK6sO1LMp+1YnO/ +dnkpQQQCgcAoEUi+qR3CwndpbB54lGVHWZsVgec973nf//73P/OZz5x22mnexnSDeWwtiTe84Q2r +Vofhv8UtbvHnf/7n3Rre/OY3Hz58+C1veQvm7f3vf//8/PxznvOcD37wg3/xF3/R7e/igD7ucY+T +klqt9nd/93e/8Ru/QfQTn/jEpz71Kdzcqamphz/84ZSFHb31rW+Ntmc961mvfOUrMZ+IPfKRj8Rg +/8Ef/AE0pfzqr/7qC17wAuib3exmf/iHf/iIRzzCZ62xl3JYLUwvqNqOXz0O2ys1i34q2cO4AkJc +gcCIEbC+aXsc0jLMiMuO4jYfAjfeeOPrXve63/u938sNKs3U+P65z33u/ve/P7OdTKJiUWRoyUL0 +P/7jP/BumcV9yEMe8qMf/YgsT3rSkzDPDhGW7KUvfamEP/7xjz/gAQ94zGMeQ+oTn/hEbJjE8Imx +bTe96U0vueSSF73oRcz3enYIbOeFF15IBZinJXr55Zd/8pOffNOb3kTpWM1cEh/xrW99KyVSK+Zy +8T6xavv377/00ku/8Y1v/PjHP86Fod3mQTOLi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tHNaUtSdKpDLtxWu4SliIl2+mhC0IAuW/1JsWoDoT5hZKnWZRJTIVGT +sa/sGWH0WOn/A0B1iDc2vLUPAAAAAElFTkSuQmCC +Click “Continue” and you will be given the option of selecting, “Install” using the default settings, “Customize” to pick addition options or “Change Install Location” to pick a different volume to install to.iVBORw0KGgoAAAANSUhEUgAAAm4AAAG6CAIAAAA+jV3gAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2OtDzA2gei1WPtZVa+8Yf/s9a9az0wA57oEVndDqr +uUSqFNBoAnNcjGeAd/SRa0D/T6BALmagp9MdVzOkFLiYz00kLauueopS5/Oyl1d5TpHJDi5VnOkp +xj76IPLIYQJJWHzqsNTZSe38S+CWvNZo/v31QsaTFlSeRDPJrbhPvaVqLTCyvLkV0xh3xB3TsFKp +e/gHmVWEZApHLZsAAAAJcEhZcwAACxMAAAsTAQCanBgAACAASURBVHgB7J0HgF1Vnf9vfX1qJr0n +JCEkAQKEjhRRkaaCu6gogqJrAxd1Xf+irmtdRBHbWlARFF3FRhGlSJHeS4CEll4m0+f19277f37n +JrOzmUkIKZBJzjU+7jv31O99c77nV87vmK//0vVhre7XSn61HIW+ZZkRVxhuvIkibszICAzDMgzT +Mkwjik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jKeeyhS7VpfmHrcxws2QTkBa/LqKxeKnPvWpiy666I9//OPT +Tz990EEHfexjH8NIT/brrrvutttu6+rqQvX66U9/+qWXXoICESg/+MEPHnDAAR/+8IdvuOEGyHX1 +6tXIqe95z3tmz55NKarlc+B3G7cyuHFavPnmmz/72c9WKpVhd6lR5De/+Q152trazj///LjaYdu6 +66677rzzztNOO+2qq67q7+9/97vfvd9++33ve99D3j3xxBPf+973xv259tpr//a3v2GUOemkk84+ +++yB7tFJLpobmoE8S5cu/fnPf47E3NzcfMopp5x66qlIsVuBa/AY9b1GYI9BwCcyGn8nW1p1Zvvz +41ynJZVssO2E49iuQwAlCauUTDi+b/t+6AfjzFp/f37YGlrd0phJbanRDcmWjJtNWimHRT7RnAw/ +49QSdjphus6YSZX+YtewxYthft6MsblcxnWISmg5lvxjFvJCm/iDdN1PhONntC5Z1z5s8T3mJemB +bB8CK7uqE51KLm063qzKunE9rX8aO6GfkGTs+soX04WuSfWuKVGl0fS7rQlrvNwwzkfwBxe/Lrxv +1q1b9+1vf/u888674IILPvKRj9x///3HHHNMZ2cnStff/e5348ePh07IOXPmzA984AOwKRdf8dqb +MGHCZz7zmX322eeLX/wivPuJT3yC4fBHx2f8ux1oZfAw4TnSp0yZArcNTo/veYSx9dhjj/3+97// +wx/+8A9/+AMszqNh26IPS5YsQSf8ta99DVr90Y9+BO8yBCphQfDGN75xzJgxt9xyC3SLWZSRvv/9 +72do2GXj7sXzw7AZEJE///nPw7v04dFHH/3Sl76USqVOOOGELcE1dCA6RSOwZyCArsghBmb8NzN0 +SAiDSdfONTSwALfTKTObNdJpiVxYrZrlslmp5Kq1lFkgSumwNQRE5m1IJVtziea0nUkggxqu8uzw +Q7PmmwlY2bIb8mQbtrjr2KlUMpdKUQ1aubTjpmwHJq4GfsXza0xwdpiG1O2NNqeh/dcpezMCo+Yc +sKQ4Zer6u8a3lJNhk+19uKvjZsPrKqyb6hfGWBLjs+IkyoYT2p2Pd7sNoZMeChd8I38eSvd74YUX +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VwsNL4vZ +QHlwWTxCoJpT2x1SoHui0Qb9QSATxOzMF1N50VTqvvrFs5+7xzGHvuT9N/3ujzgLx7/1y6d9/ZfQ +zrrem2+86y1HfWzfZx7+4v2OWbxwebwUIYFw/oOLDnru25YvWylXZ0fvQfu940dnXBjvtFr35f86 +43vfveDeBxYcsPdb/3zfI1gVae06GRPCDdMmTAafwNeo8iknnXPNlbf+5KxL9tvrLZf85jpf1LdP +Pf/lL/zAU7Z73YsPfM+dN92jk+H4tfhK9e0qjZ2dXS854H0/Puu8obplGDpPd4899nBq4cEHH7xw +4WpOZOODWZedrte0HVXUelR46Utf+oMf/KAkGNe88sor999//1HPh6O4cfOyWsY8UouvfOUrT3nK +Uwi87777cjsjAPPYisybN+/Vr371mCwOFDrqqKO23npr3CB3eerQw5NPPvk973nP3LlzeZI5lku6 +kxP3228/JvgLX/jCwly6Qr/+9a9bxMw7vf322zvbUaK2cs6jcVnpl112Wck++rpaURE4w1FT85az +3R3DoMTRucSZ77vuuquWKel84ChvvfXWNTHUiTniiCMKsYOtdt555/vvv99tKcjJyir4ne98pxDU +rmrnsEgOAM1ywgknSF8T/8Ln17/+9TOf+UzN6KzJu+++W49Hx6V2jhOZlatS2s35zc6T5p/A06uR +Xk5xdvu6173um9/8pggy19e85jWe+kWJr/Y79Jq87re+9a3aeU1bcMv7hAqll5w67J+t3r6wEmom +qdvzzjvPd8A9NdrZK72oVKp5Rdcjl9/06V9c8cE/PnBLtZ5BGXUHbNbKzzJ9MlRbGBamodCGTUa8 +YhMcY6s2QqLiq2w+BK0TQ31aR1qMyKKOMYegPj/KGc7Bg/7YgyimyUiBkZQyfI2VMLlaNIwYMFMJ +BA1LyOFiVknm7F/x4J9ngMeKDmYccxMotg0jq7z+MAzczdFWtSBYQdOw80iSm+ADKlAN6TGxe77J +O5CVGc3t2dw2UGle2VldvLDrvodW3HjXgitufvCc6+897YrbT7nkti/8+oaPn3f1h8797bt/cc17 +Mb9v/tX3Pnr1nxdc98DCGx5adMN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huWf+zY277yoT+0tjfQdJRjf06EWdFh4QH7kpYNNd2WU4cgyYAJSlAhvJGVng56N55GrvQAx+Sj +9kgJzLPcM3eEZ84yZKlJzcxqYbNSxFSqtYuFAI56HKdtO4smR1Vj7DPBLAzctJkUyqCMsrwrpmpC +Bd1bptsMj4kmXMkI1RTkD+Pw3KYZSl1jFXaqp6Au8TLgLQULAzSNLUUEGJRtEHBgEKcPVlupVABP +0rsGriRkhjDRToHH/guSNP7cuS38RQkWxaVZhmb4KQhJYpWKULJjmwWFnCIZR9DVWde9MjoEfX0d +5//8N4e+7qXTZ0zRIIUg6htImHyS//JlHQe/4K0P3P9IFFet/vC7Fxz8/Lc98ymvOeA5x9z0uztL +EahFli/vPOrQD19w3pUF1dRICMArRaOpr7vgF1e85Q3/ee1Vtx36kuMPnHfMmd8731OUSjzj2784 +5MB3PWun173nrZ9TnVNPOufaq2798VkXHzDvrZdf8jsN/v3Tzn/dKz6499OOOPLVJ9x68x+j0Ojm +RIj2iauheiOnrvHqeh3JVq07/JUfQ3DMG/5r72cca2ckO0P/9srbX/L898zZfMenPvWpX/va16JP +9z+DGQk777zz5Zdfzg04e/bsAw44oPxYUOlK6n1usskm8tZGT374wx/y+vzoRz968pOfTOcaQDE+ +8olPfAITxg3+Rkme8pSn+Anvu+++119/fSltTK5S6NVXXy27nzwHkk7AW97yls033xzzRx555H/K +GHd+tvvttx8CctbYjibDzRgNaY3sLFiwwCOUrq95zWvIpnutf+xHDVa33HLLo446yq/b0yLJdddd +p6aYm3WBrLBdtGjRK17xCuI961nPYnOXRNfVSjKmgsiuuOIKQC77a1/7Wtqmln10RMW9FClrEeOk +k07afffd6UZ8UDID6LH58+erVHEak+2Vr3wlA2C33XYr3EYXMSa+qvCf+cxnvNzvfe97GJ5//vno +a1KJY77PPvt4m57KW76ftUg7urjFixdjNXfuXA3+xje+US5Px3wwo+mfgPEJbbyZj1O9YZgRTY0O +vfySp0+fvsEGG/im/Zyk19Bu3Uvz1hH7bYzO4oN2+x//8R9//OMf9eZ4cb3agLgMSgGfpawSd/vi +F7/41FNPPeTQPe+/t/Pkj99h1HPKjDAfNtu6/aQf7/ap03c58Yc7v/MT2/IcUk423dUizMrQwCI5 +xRTIOa8UFNnMQUncjMz59okBh5SpFOtY7A5I+zNAw4OXNhYQjQHXVJcmJZWx1XjEr1jOXEtlGvga +SBBl2W6XIVs8jbRwCJFqHfoG6iSIRomJ1mQMt20iEBlwBpwB5In3gGGYLN25Iy2UZaFKIUMbJz3K +KGgkDiaVAual10IpV0H+/EOPZ2QUi8bKCPpRyBoiqW+OfUYFtXriK1YCGYo96jb+srKyw5PCMP7T +82iKZUWdy4N+wqS6hx56hBbYcadtFO0PfwRR5SJAZklhBu+/75H+3vCfnvOD33z6hG+99JDnXnz1 +qd8484Qtt940SwjS3p7+d77pxC232fS5+z/L67MWRe9SOgK3EQFuQ3XGXG+64a5TTjrrHccfftSx +L/vCp7+/cmW3p/PnL/zSiWd88dTjf3PNN9727kM14Gtev/8uu213wIv3PP3sj+317J3xmj17xvs/ +euTFV3995sypp536iyJn+USbDTZEA+q6RVczZh5F90IXsHLSKeGJ+ein3viT8z9jauCjDy8+9OUf +2WveU353808+/vGPGzA7/fTTQ75RAcbAwg9/+MOQDED6JX76058uz7l2/B75aY499tiaj8dk+6uu +uuonP/kJN91LXvISvxG/XGaN+Qd+etw/VLOCuJTmzZt34IEHFlwck6sU+ta3vpWqPe+88+AQuHrS +k57EgrznnnvcjhJwOApLPvvZz/r90g9f+tKXViV43/ve94IXvODBBx+88MILy+R/8IDsy1/+MtkM +IWmxPffck0kHdH/9619fcMEFnhZJjjzySLhrIQAftWthTjZ2rcoa9xltAq5WkjEVfPTRRzm9wIaM +YFsbriqwFNJq8LWIoVtjjMl7MQ5l6gbKnXba6fjjj9cIKnXCCSdI4ckjqiGt97///Yi7u+MbW1NY +VXgv12RPomKo9yNjTaqHH37YG9xnn328zf/MUL6ftTTa6HJ9P96+kVcIjaduiqdjPpjR9E/AeFtr +rAd/fC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3Etxk8m8TDktjOI0ao/TbBa86FVxMBCKOjo7/+9a9vfOMbs/o1OTE5xpfm +arVKZUDTdxqRe5URfsITn3Cve93rrW95q2OifpZOFjF8EZ6kZ0Tdxk7W4881x2c/+9nHHX/ca179 +mg4JTXXNlEu/E54EGwtt5nbuBXAlrcR5nznv1a9+9c9++jNFPeLhj+Df4mbRmqlz6jwlNXtMmNOe +SI4K0k6YeGA5gMawadMmbwaeatEJsLencdH1hsJAIBBYRATUFzT89AUKuy8Qq8o0b4mrBGdGpWTa +g45jEavWjSo6RDrJG9zgBtjOcn+ZTnNsdBzm3r17zedv9u+DH/ogM5zPe97zRsdmokTjk93lV1z+ +V3/9V1gmRq7bd2wnLf5TnvqUU+5wyol/ceITn/TEHTt3SCEm+W1vf9trX/fam9z0Jvc67V4XfOsC +8S/+48WPfNQjjz3u2Dvf5c6vfs2rT737qeL/6ZI/ofmYY4+5zW1vc/4Xzxcz9yen7AisOO//wPsf ++rCHfvFLX7zbqXdDPxmJf9XVV1GGk2580vE3PP69574X5uv+6XVf/8bXP/CBD5x865M/9elPzVZa +TAj6kVc1x8bHpND9sbExql/g79m75y1vfQuajzr6qNPufZrXEf47znkHFTniyCNuerObfu3rX0MP +hTz9PqcD3RkPOEOSF373wpe//OVXXnklGp71989CRvVSppdedikYnnDiCQL2sssvE382YBU7J5/q +UlRGxjSGyYkJKshJGNoJrWV83BpJNw1sUWRsiSVcIBAIrEwEsIsF02gTvIxKjd2wpgVTSkUKSVZm +1bosFbaHPpFj+Kx70UvKYVBJjvHAafjlPuPX61//+rY1qZ0j1XOf+9zTTjvtgx/84De+8Y3Pfe5z +SDFpfLvb3e79738/08hf/epXWZRVUqZV3/72t2OYzz33XNYXocV/6lOfSt/NWuz73vc+lj8vvvhi +8Z/+9KdTSA44nnnmmRgYMXOf0lIAcVjN/d73vvfGN77xZS972d/93d+95jWvue6664iiYORL2b72 +ta/d9a53hfP4xz/+Nre5DWucnKa9053uNFtpAQon5Z6Lgu4LNA9CYK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jsePmxMoo +1yKUwn99Jxao1CFyYoEKV05yh8iJhZeN27FjrXThMK4VDTxU1Wr1M5/5zPe+970dO3ZMTU2tvsds +fr8lz+TQ0NC2bdtue9vb/uVf/mV/f/8iPqUqEgodbSkvBL3ki561az5widXddPnFF7H5BVbzaOf8 +BKUT7v5X3/zQm+aROJKsKQRkRP/7v//7xBNPvNOd7nSjG93okEMOwWasKRBmqyzg/PnPf/7Vr371 +rW9966KLLj799HufccYZSwGOm8/ZShJ2tBWZVd90F7H5BVat7acbzi3v/7TS8Xd91Lc+8uZupENm +zSIwOTn5tre97aqrrnrCE55w5zvfOfrrti0BO8eHz775zW++973vPfjgg5/1rGcNDg62lVwIs4M1 +jd+lFdi103QX3vwCq9b20yXnlvcLU9olVGtYTA/YNddc87KXveywww8rl+wssnrtuMBZ7YKt8Gbh +mACv1arV2pVXXvGGN7xhw4YNz3zmM3tmTfWLrOF22qbqa6TpLkrzC6wW8qje4n5PrdRnrshu0xaD +tcYRmJ6eZlL3oosuesUrXrF169bqdLVWSl+cNisaTWemdZgtTaNSBqZbtmw58/Fnnv36s//nf/6H +md5KZZF3JMhqkp2yDyM68zNk1IHbdGlCuDk1m9T6bFIEN4/md6BgpQoKGcrMhV/5nV/Zj9+JXCBW +s6mu8Co9W1zw1zgCtLm9e/d+/etfv8997oKYn60AABNXSURBVMMYi3UUAKHjVt8tvxuIfv7zn3/1 +q1/97W9/y7Tncccdx94cFly7SbgUMp/73OcOP/zwW93qVouoHKBAg+ccApTwN23eBGhf+cpX7nGP +e2zatKl7rLov1VLo7D73FS658KbLNMx55533y1/+EpyPP/54Wuxd73rXLmvN2+fVV19Nj3/LW97y +Zje72Vx/qX/9139917ve9YMf/KDL7BbY/BaOVaGc7Ey83vWud5vb3KbAX3gwR+a+973vXe5yl5e8 +5CVzUrtArGbLC7WL/L48W07BPxAR4L3vy1/+Mk8F3QH0+PjY8PCI9Qupb+hyVPpP//RPb3zTGx/x +iEfc4ua32Llz54c+9KEf/uCHZ5999pwAueyyyzBRRx111JxStRWmADzkN7/ZzdvGzo9pUzs8TMlR +zrHRMXxA+8UvfsE7xP3vf/+BgYH5aY5U80NggU33ggsuOOtvz+K17z6n36e/0v+db3/n7W9/+w++ +361to3mPj48fcb0jXvziFw8PD5Nw48aN3VekVk3vZNP25tqNW2DzWyBWrSX853/+Z147bnXLub2t +7t69+49//ONNb3rTVoXOyZHhaePllXkyj+2GWCBWs2VBZximdDZw1jqfljo2Nvb73//+xje+MasI +kxOTY/39tN1KZUATLCya7hcjRrSvfd1rP/JfHznttNNcGM1YGg92Qzz72c8+7vjjXvPq13Qj3Fnm +3//t3xGYawE666xzUKVmszscEJpIDqAA7aSTTmIsDowgNtehSeccI7YDAgtsuqOjo0944hPuec97 +vu2tb/NfbU6NFuF73eter3zFK6+44opbnXyr/3z/fz75SU/uUOBCVK1eg9N9E11I81sgVoWSK4hO +XPflV6rzPnPeq1/96p/99GdtdYqZI2N51Oacy0Kw6lAwFrvi09+d8FnjcfQp2IYb3OAGWIJyfxl6 +bHQcJrO+5vN3f//e9P+9iUmYO97pjrnk6JilPeed5/DiL/7Ff7z45Fuf/Ovf/JrgVVdf9cQnPfGk +G590/A2Pf++574Xzun963de/8fUPfOADyHzq05+C841vfuNep93rqKOPgvO2t79tz949MC+7/DKC +SD7s4Q879rhj6Q2vufaaZ/7dM7HBD33YQ/9w0R+Q4R/8t7/j7RCoQj7/980Lvgn/T5f86a/++q+O +OfaY29z2Nud/8Xyl6uxTH8rAazXITE5M0Gw4CQNoQMduDrBa4w2p99UH83k33Q988AMcbXr+85+v +hqqf3ulLL7uUJnTCiSec+Bcn0lBpda1tgxcpcofPhiBawmGHHQa9fcf2pzz1Kafc4RQl3LFzhxJe +8K0L7nu/+x59zNE0+Fe88hUwaTNoUOzLXv6ypz7tqWrh4rT6C2x+C8GqtTBwvPp6JHmseKB4DHne +AUFJ3vyWN9/hjneg1o993GPhXPjdC1/+8pdfeeWVPI/P+vtnweG5Pv0+p5PqjAecAURKlSND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Udhlmz +8ETFA4FAIBAIBAKBjghgRwu2s2BTlbp06C0e/JMvvLOjqogMBAKBQCAQCAQCgfYI3Oz0p5QOveWD +bc20XivZMdO0flqv1e07lBZI6Yg0DhcMEi6VCBq/3lc3jr5YaZSEmzlxHyFakYehlM0Y2I3bCnVn +YTNhQ7gp1kglrWhIwpbWBVSepN8UUqCmKhORcgknPjIIWC4WlfSmQFIwE7YUSaohIw1KosKIU04F +QdKZMzmKZQhItpFlCpbKVgxLpZoY0ZC0qJTAYiSQwl5nohNtCUyk7rWULlRZMhVW+smr1MjJclQS +QZEyRlHz51B4pljk0FSbohrZJRg9wlRZoZzhRU+pZwAXnHW2uiHRxHafVFZUK3rCJwk1y+kprNZJ +pvkTCSZK1tRouTYKKpBNo0FlIuYMIFFN36OyyKTQG2o6gq06miKVoJncEDStbZzJesFIiZQyq9vD +ZsClIL87/0yLYpslbKpNmAAysemXh58B3kjT5FgQWmktZalkecGxapunBGRpRfOCW8uxKJNKuag+ +KaWRyrSppCGdMk05ml5XZgHXkxLuo1Oam/obOZi8FcDaQLNQFpWUNpgqQ5IzWZU1+RaS81JYWpRa +XRKvkUFBvJGqwU1ajUWqlLrxA6UiSUEzQZLSAysA9okmvTkyVrkIoi/VRxWyHJSpJBoJElsJLT51 +MoaJSpMSSNJQMqyQTf+bh2tIJp3Elgf7aVt9o+NTU1PqwCkOolYoK4+lSAVsJE8xJEjMmR9CMpam +IddQ4Xyi5EhjKmdyMbZSJeGUmUqsUqgYYptko1JNhrRKnejZOA0+uaQy5MINtfuwFDDR1IyaORjQ +6doiYqzYQKj+yipuj0xiyidoMvZpReP//4ctrxHxuTLyAAAAAElFTkSuQmCC +Custom InstallIf you select Customize you have the option of selecting different themes or variables to be passed at boot time to the kerneliVBORw0KGgoAAAANSUhEUgAAAm0AAAG6CAIAAADVuubjAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdl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+rY0CKccy0gvM3Icpd1I6HYi3NuTsvOsFWyyrsqqkssIMVb1iZUsnZwMfx0P10bFt6PO3v/1typQp +48aNaxPf9W0qlaqtrR0zZkwXyVj5wefJ745wMBhs/w22trZec801y5cvP+yww8DypUuX3nfffYAo +oNtZli5q7MEjUJxcLFXbt60HpaksigL9mALWoIpQZ9/J/KefrfS8fUpKhmteWbw1Mnu22LzvetG5 +c/VEPKhrwVisJZ4gWdVpp7Sn0YqX/jMg5u2/59BQeThQalhOrb3sVfbYmvbKULlRaZTuX2I1vrCU +ZBUnntk++/NvPGWGvF2PHFlayb5xr95d8mHdS3k3mzDrIpWBQbHy6JGhV+76nGQnHX1G++wqRlEg +VDlw3rLy6nCzl39NDwzRgsMDZtA0025+Tf3K+vhqe/AwPRwKvbMq0hAbgYC1DcWwa0f02tnX0Sax +fwsXe//99999991+TPsAEMUlSy4OF6ekhDVr1jz00EMSZcHdSCTS0NCAXUNnWYqz9z4sxVT8ri8F +el+1KkFRYMuigBXCz0Uncl1r0aKdotFtDGOArkc1L9DUaLzzLt0LZDKIyYI4pHA9EqxYtKjDEkrr +542eVBWpKQ1VRAKlISviGPmFLHDNUpQuMStqGiFr6qSqxQ3zO8y+tPnTMbsNHDS80gqauE/SzUyd +vQDHFpRTEow4TigSDY/edeDS2k87zL5lvQbV2j6nQHDVrPG5+fFM9ZrPD4kNfbrMXGW4ecex7XQz +blJCIS2X1z7+OJqoX5acMH2tD5t2jQCxGF2JROL73//+xRdf/Oijj86ePXvnnXf+zne+g2Ke5I8/ +/vhzzz1XX1+PxPWHP/zh559/Dv7BSn7zm9/caaedzj333CeffBJkXbZsGRzqqaeeut1225GLYvn1 +x62spbhyanz66acvvfTSdDrd4YY0sjz44IOkqa6uPvvss2WxHdb18ssvv/TSS0cdddS9997b0tJy +yimnTJw48fe//z2c7oEHHnj66afL9jz88MNPPfUUuphDDz305JNP9ptHI7morn0C0syfP/+uu+6C +V66oqDjiiCOOPPJI+NcuyFXcRxVWFOg3FLD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ddHxTfyoMTOz +xb3b0t28mw9bwVyGgFufyMXCJVPGlLS0JgZUDrSs/Oq6+tLSUGmkvCneasfx9VewAMJbAgFD23Z4 +STrrNscz7OwEI/W8FsceCIY0qLk5LRHX8LEhPC0U9J3IeAXfiWY0I8yLpCzXEpZMQsxLjJDrFvAU +HSoiDrm8kqusvExdRLN//vOfgOh3v/vdG264gVFe9KTjoGCxNSrt7XhtU7oslhOqX3311WAwuIFq +aVOput06KeA4KFz+N4AfffRRhhxSlssvv5xAhzSZNGnSY489tt122/H0jjvuIFlxCR1m2YSRbTq4 +CVvS0NDADPPBBx+wBGHtAtH222+/vffeu5vUW9+OkL6XnbXgeHpZhMq+XhSw3Xhd9u547hmQKpMz +4APTmPSEwql8qiwcrY5ULa5tTOXsAeXZPIAmeEGvMZNoSWfTGQ9oRAIhdm1a2qCh2pAhwTkLMppj +jh9WncmnF61szaD1NNBoBkHchkwuENYiBfMztKTkokaKBIMFYKJZxaSoIN3FXldsXykgp+A/8dyL +nTBQml1rxFu8DJedZUCz0B43btzDDz/M0/PPP3/BggWpVOo73/nO1772NdK8/PLLP//5zxOJRCAQ +ePHFF2V6UtbW1nKg9K233soys30uCiGysbFxn332YTXKHDR48OBnn332iiuugAk+55xzjj322GJq +A5y777479V533XU/+tGP/FpWrlx58cUX19XVUfu1114Lx/zJJ5/84Ac/+PKXv/yHP/yhqqqKSY30 +s2fPPvfcc8877zzK7KKW4hpVeKulAIOt+ENg+ShH3RNPPHH00UdDFsbhT3/602eeeYax+vWvf51b +1BkwoAcccMCVV175wx/+8MADDzziiCOI//GPf/zaa6+R5cwzz+STIcBwZZRi8DJ37lwGpByTG5nU +bTq4kWsvro65Zc2aNe+///7kyZOJh+wslKEzrD+E+vDDD4lMp9PHHXccH/V7771HZEVFBVTda6+9 +eLS+HSF9ce09CPfUf0MPqlJZePf2wuUtNwUjy6PBSGsCUyEb50SIcxN4TEhpzS2ts1pasb8dUG7W +NjaGgnokbLamcolsCkVmsmB2C+56eSH4HT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xp1CkuSKPVRNlU/FZlDZaI4tETyUQGNGqBB4NzQ +2Ljh1ls9cf8DH8yayVeNunO55samBa2tuc76Rx7+60677UpC6tBcN7Gz7jVyYVURmckHeiUixWtH +zJhm+Vhvd6qxPjU//3YotnDCxIrWCvjZEXAElhoCfDetkrL40VrfEadfrD7xaycTNBzWKVhupkSj +sQhx92cVMMHSqkAOpknIGuSsAmYqJIIJvViXyrM3vZWuQpzWck7Y1HjQIDKh74BMmzatsbFx+PDh +ZZKQLa3FMqc5YaxBzhzqkmID+XG2g6BqVIBBOZRxETDTWM2EPFVjxlokNadyAAAgAElEQVSl5iFD +Nthqq4dvvy2b6e7IdDXU5+BRinn7jdffeu211ceMwX6lpokfLLi3IcuCIplx4dcpE6UM6qZl8VFX +d+qf98waM75xeNNUrZtdLEFKt2AstDGS3NExaJDMpxYfJJw9e3Z53IpTuWbpIzA/HKuuumrfi54z +Zw43d+zYsWWSfPDBB7NmzRozZkwulytj5lFlEGCMtExsuSjrMhJGi9WrQXwmB4J0anqoHGvosOyQ +N/PCwYemEwJBlHbEQbPUWA1anglBY80GwQyoockmoLTLieX4EhJ6ohK4ebBiBGbMmLHXXnsde+yx +e+6553e+853y+Rjyesu4LxzxLbb2kxCee+65rbbaap999qGUn/70p6Si3yEhZtpUOKPU/JXkAtvK +eiUVOA9Zefj4KVM6OjsYnp0+8/1rbrgebiSPpx5/PN+WJ3lTbqXmzBj4k3GiMPgCJQubsrdRXYMM +6j7z6Ox33mydl3+jozPPlSbYNHHt//rXvz7/+c9PmTLloYceSkQRnDdv3le+8pWNNtroF7/4RXHs +Y489ttpqq51xxhkW9fvf/x7Nk08+iWb//fffYIMN1l9//YMOOuj55583m2VBgBK22GKL9dZb70tf ++tLUqVMHqkq//vWvv/Wtb/WWW/nY3lL1XX/wwQcfcMABRx999N577z1z5kxNuMcee6y99trrhuMf +//hHIrdf/vKXJDn55JM/8YlPPP7444lYgii33357cj7xxBM32WSTr33tayi572usscbGG2/8yU9+ +8uc//3l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9OUwkLmhDMD0JQnNVc0YMGDwIJHk6quvxoDxFdUj +J0aMaTy0EJp6IqEHixGQh+4BPLgZHMUZltdrLGfjJwRTqt5i1cbO2nNZEMFoUpUETTBjEzQqLiuW +S8YWX51rPloEDj30UH7zECTOotZk7ty5dFXQ2wMPPECv98c//hE9j9WXXXbZfffdxy2+4447ON90 +003//Oc/b7zxRjpNBrVoFQxkIZDPE0888dRTT6GJn8DY7QjL0047DbbjUZ2od955hyLoUg8//PCL +LroIe9rMeeedB3njolGr6dOn48S0tLQgkAoZUs93dKy/2WYd7R1z583L1efqMunpuALdqW8ccTQ9 +183X37/trpOO/uHab7w0/80XFzA5+uRDs7o6u7951jp7fHF0vo1hYlmFtPr4LL4gDGrgx7IpqxGA +CMKAIcgEmtl3333j3EAJhJmB41kk1i8L8qOPPsqtvPXWW7kv1Adkvv/97+Okcvz4xz/mGQgl7hf0 +iRk+K4Ofr7zyCrdyzTXXpFUQm2gtaGhUTCUikJxni1dffZW2hL3iUz4W9HgKofGceeaZr7/+urI7 +D3knnHACGfb9oFBgP/DAAzXJqFGjvvzlL1N5HWwvzofHu6233pphia9+9auJ2JdffpmfDC02oScI +69OAyfmSSy4p8xxWnLBmNWExw0BfvVFRIuPe9JhZlAnKYX080xrssCSqsaDlXCz0ZpOovweXTQSG +DBlChwipMHtkU33bbrstj/9sGIQLcu+991JzBvpYcXPzzTezqkJ9iOuuuw5uoCukSeBaEYvXwlQi +o52wHYI1IQQaCf7rnXfeec011+CX4B+Q5O677yZnnFcSPv3009AkPR1cyJQk/hAVIFadRc7wKO6d +Bsetu87wEasgM2bCKPLgQYM22XDDOR/MZFkI1P76cx23Xv1O64LOl5+eSw4vPDV3/Y8Pq89lVluj +ccRqOfas72hnI/s5EyZMIJaDfFQY8DP+yg033MADxPXXX/8f//Efcf6Uvvnmm/OYoiDEUR+5zHMS +/hYkqoOZDFdw77hNTPdyj2wq8aijjsJnZRkOj0RQGjeOoA5vFreW+KJw3ZhTZPBjnXXWeffdd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K8z12t03 +ocpLM4hMqDLDZSe5QWRC9XXz+dHqMayVHPhFdXZ23njjjf/4xz9mzpzZ3t6+4v3GlvK95Jfc0NCw +8sorf/zjH//sZz+r282XrAOWhrb+/hNBSzWAvYPlubwLK3bT7Xsr6st9dKz6glLCJr32Dgc9ePU5 +Ca0HHYEEAsqgN9100+TJkz/xiU+su+66I0eOpN9PmHmwXwiA6vvvv//8888//PDDr7762q677rLn +nnuWQdW4s7dSnESLkVnhm25/W1ExRKZxrAyKfgnpidsd8PA15/YrjRvXGgL5fP78889/7733vvrV +r2677bbeWQ9sA4Ad+Qjagw8+eNlll40YMeKb3/xmLpfrrYgyVOr3pRi02mm6/WpFxUChcaxKwtIX +pfNoX1CqaRv9dc2aNevkk08etdqoTFreOdYu2zdnrrJldPP5UFYoMGDe1dXZ2fXuu9N+9rOfDR48 ++LjjjusvleodqbI+K1jyGmm6lbWixL12rMr84hJYFQfrho/b4PD9diuOcI0jAAIdHR1MiD7xxBMn +nHDCaquthkY6fvwn/Q83amkdjDi15dv4qkJlBTKb29HZQY9TWfIKUgEdhYIYaemkOAtupY5AonLi +l7zW2LVuvvlm0q699trxjkVxawyPMYvsWe8kGuOj8rLTdEvd83K6uOWUs1s0rr+tKEZsecEqRqb8 +b2pRbJKharCKcTM5S79oARccgRgB+v358+fff//9u+22G04STEasdeLFfTeLj6677rrnnnuOOdRd +dtll3LhxcW5VyuR8zDHHvP3225Xl86UvfWnYsGGMTieS85Sw+uqrb7755gl99cHf/OY3v/71rx9/ +/HGy2n333T/5yU+eeOKJiWxBGBj5lSMAL+ehw4aC9j333LPjjjsOHTq0GGTLoUyU2dSs0N+mWwwU +AzA33HADjRmcJ06cSJPebrvtis1KalhGMH369Gw2u/HGG2+44Yb9vVNxyymZf0JZTSsiq+qxStTn +o/1NJSqTCFaJVSI3C/p6XYPChSQCPP3dfffd0Ax9AXJra0tjY5N0CqFjSAzqQqJT1p+y7z770uPQ +jzD8e+ihh9Jqn3322bFjxw4ZMiSZez/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VARLUy4sUVWCQCGBFhmC6YxUQ1LplYhQsJSokEBi1CCE7ZqJDrIkEJNu +RQVR8+KvJCtcX6GCpLDYQhKFIhRMRj23Q8MLqxVlG6IKxQUYe3KUwkKlTGFVJ41UsadCCmc3X4rB +QgPBIoSCBttQ9YBPUPfUMwTCFSMFmwCtlCnZh0BARAxDUCGIypZ6hCMkKMgFTU9UITfRiqqnPhLm +t6EwygVpDUQdDrmZC7Po0cpfsdW8QkDqoPXoDhmSLAS57/yTXDS2B5eebMkjgExsuPPoF97TQo4U +JHBoAciaVlKm01r50HLkpIVQpFTNKi4tR6Ikl0L7CtmFvCQqFNqTScE6FCr5Gd6SJly05RMSLpJn +sCmcutNyLZJDUCjmPZWSqFBDaRgotQ5iKBaFuvakDOmDjUqSlkzlWsJlFgpImBdSFbQhV1GRKqQu +3KBQumbQkyBY6Q9WAVgkWvDgoGC9FoLkF66np+5BJTbBopAgAKkJJT50MoKJ1ibUUi0FEPm9YBv+ +lxNHwTLkSWwmV0fbSi1obW9v1w6cwjCVIqU+kkKLl8RySHxATP4GA1EGGwQtW9LqVfToJWU4SCPm +kouaiFZTaZ3USpSF+FCNnnzsonoUwTxUSqWesxbQE1r4V4oOdVioQtJsF1FpQExDM+rJT4AOexMR +I9UGQu2vkCXA/1J1jZLfLeby6/1/vtg6hnINXbEAAAAASUVORK5CYIJ= +OptionsEHCIacquireCan fix some rare USB issues on boot.ForceWakeCleans the hibernate image on resumeGUIGUI bootloader on or ofUHCIresetReset USB for some rare USB issues on bootThemes Default theme and Twilight are offered as for you to use ExtrasKexts for AHCI and Intel PIIXATA will get installed into /ExtraFinishing Chameleon installiVBORw0KGgoAAAANSUhEUgAAAm0AAAG6CAIAAADVuubjAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+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AgoBhcAuIwB11tYktvsZ +jabOxXuoUqn0trc/dsPf21euxB+J+0Vra6cuXrzsjNMap061bXu79XWkjlSrr7zhr50rV5QGgup1 +da2Llyw+48wdrN7R1X7jP29YvW5lOjdAgzXJ2v3nLTn1VWdOaXmRu4/UI5U3eRHQ/UrK2NDatCZT +mtqT3s/3DM+MTF441JMrBBQC44GAaer6Lbfcgp53xNYgLaTVFf+4ffkvrklFoy2tLc3Tp5PZs2VL +Z2dXrlw+/MILlr7mxGg0OiKVhtWfueMfq35zdSIaaZ02tX76LNyE+7ds6ty2Ddvsfm99x6ITXjN2 +9TseuO3aG38RS9nN05tbW6ZgxO3o3NaztbeSd8877aITjjxptOojPpHKnIQI2Eau0V7dFH2mQVtr +21ohldS8ipX281v322Qd1h2d9vJjwrSVXwd6IG7NV5qfz2i/wRH7tgtVRmznRTNDtdWLFlMFFAKT +HAGRR0eDAEn0qdvvePjKn81OJg+YNfPAU09deN7bfM999pfXPnnTTU9u2sQlhgCoFKl0eCNUX3Pn +P56/9icLW1OHLJsz+/iTp578Zs0wO267fv3tNz/66HNcMnRt4QknjVb9zgf/cfVff9IwK7n0iHkn +H37aKQefnStlblj+63sev3P1I5t/8defcHeodMTqw/ujciYbAn7n2sPrn6hZsErLRzWtomtGqeQU +sv2JuB1LGNGFK5Lp/lzf/uuMeX1+ra8PnU3ee++9TU1N++6777jj9tfg+OlPf0rLH//4xw844IAL +Lrhg+F3g2gcffPC5557DAXDKlCnTp09ftmxZMpkco8rwRnY5p7+//81vfvOVV145e/bsXW5EVVQI +TAYEhEf5uY74qD3t7U/88tqFifjhyeRM12vcutV79ll4tHHb1qWe15BILvd9CrQt3r+lrW14C33t +2zb/+eoD5iSPWNpcOzUaN9N+ul0zjIQxMHdWpNFueXCFv+bPV7fst7ipbfrw6u2d23574y+a5yWX +nDCttSVZiQ505jfmy1kvkWubXxNtbHv6znYK7DdvcdvUEaoPb1DlTDYE8q5lFNaY5cfz3uJCwc6k +e8pOxfMjA5bV0Jh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8W6a1IY1H +o9H3vOc9kUhk3G+0ZzY45PH3zE7upl794Q9/oOX//M//PP3003fTLVSzCoExEJB9vMe4rC4pBMYR +ARgUdesVV1wxjm1WmxrSOFT9hS98oXp1wieGPP6Ef97BD7ht2zY+IowOzlRphcDLhoBa9/KyQT2h +bnTDDTccf/zxl19++c0333zyyScfddRRVV0Zz3n//fdfeumlmNwWL158yimnlEolMi+++GJIlMSp +p54aMtzDDz/8vve975hjjsEO+u///u/33Xffi2KUzWYRO2hh/vz5b3rTm6688sqwyvDGM5kMPaRk +WMBxHOxnr3rVqxhtyadidcfAj370o+TQ5y9+8YsHHXTQueeei9VwxJ50dXV96EMfOuyww8JGbr31 +1rAYKugzzjiDLh1yyCH/7//9v56enjA/ROknP/nJtddee9xxxx1xxBG/+c1visXiRz7ykSVLllx0 +0UWhErLaVYR1lOcLFix4y1vegs1yxD5g8b3gggv23Xdf7kWHXdel2PDHJxOFMK+GrmILvOWWW6qt +rV69+swzz6S3b3zjG0lX84cnRnyPvGjg4qHC8gDCx0ceeST8OCJEdPLHP/4x3cBWDXqf+9znwsIj +PguXRrzvaPlvfvObN2zYwFVAoCeAOXYPw1sPOfPN5KtCdV5BeCmdToMeL25ISfVRITAcAaXXHY6J +ynlxBHACYghGmYEXDOP+unXroLc3vOENNTU1DEDnnXceA9NnPvMZwzCqIyxEcuONN8Jer3vd65Yu +Xco9nnzyyd7e3gsvvBDvj6997WurVq3CAWTsew8MDDDIMsBxC3yRuAXNQirDG2fspoeJRCJs8D/+ +4z8YE2fPng3PYSGjIkIMLidcZRSmJOnOzs5kMnnXXXehE77mmmuG9ASDK3OCLVu2zJkz5wMf+MBz +zz2HsY0yd955J7QXi8VQIz/66KPY6h566KE77rgDlXKIEjlbt26dMWPGmjVrLrvssj//+c9wJLz+ +v//7v7j40Z+wq5THmltfXw/R0ib9+Z//+Z8hfQBbhnvgYv7BvX74wx+2tLS8973vHf74zG8AFrL8 +2Mc+9rOf/Yz0Aw88MGvWLCYiZ511Fr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MOm66zb++j33fIQtjHUERa9L +0nYC01emr7167S/+YuSpFKF3FkVvor6/XwM7UQO7DUcZ4DriiCM2btz4hCc8ARCN1xR4w3AkvDv8 +NVPCE0444cMf/vDy5cvf+ta3Hn/88divixcvhugd73gHPboJda1WO/300+n7pYsYVszvjY/5sMMO +g4YOZG7xkHskuerGT6+489pSyStVWIPISkhpuHRxIHfIUbNvu2Eziu+U1y7DjMOhItGw8xbq5nmv +OHD5cxYQO1jKlhlMYRZMThvkAoqzhrMbmhxQKsBjc93qlEzAclnGqCxCj59hBbLLLu1dhkVD82pS +rgBaHMgFDT7GprJengiYEYuT7WV9guVETy8O3SoUsTHKLX3LqGZKwBWND73Ide8JriZDiYfekGYn +EgXNtGFGc403Leb90iJgihNZgRnAGE+egrvPE04Nm794MFvJF9SBklvL1cEw5WmkUWUT51s83CZq +DQmRXHxcCvLCYgZ+uCeKH3LS7Ah/cCMqMlKqwFRKZiglez24gFIEI98w8sAztwYYUwwxyIinxhVi +vwsK5wCZokejhYhOTSc8U384SZtFNTwsZi2x9e7kuORRRri4mi0XPQWenbsH8KjdEIU1gYATfW7W +QKN6ki0qPb0AJCSSilH2egP+MOFxEMIyGRICohDQY0FqjmnLNHWQH0HVep3B0Xyu2kptTrdL+6C6 +p/eIXqJvbvhebW46HcZo1HjUYK9flWcXgXihCX8SQmDin+FJKM251ph+TOuIC5Z9bJB5d103VZ96 ++y3vXlcY46PshEWqRJjwEMcTn5f+5vrvPfmgJ1KrD6SRuoz7f/s18DvUgFvXvwP9A5IyMvqsZz0r +phdhMoJ5WKUYmrfeeuuzn/1sYh8oJfOJ3vSmNzGnlytw+LKXvYy3HNOTMVCMVOYoXXnllQyvEsVM +YAxQJgDDau3atZVK5aijjqLfmHOkP/axjzHv99/+7d+I2jh+0013XYklKrzRIaOsfG+gl7lhOcqR +x2lMdM780oJFw3MWSB2yowLjo3960gK+uB9csubKH2xYd2/1yks33PjrCRClUcdWSJWG0pPTLZig +H+GMtYdmhDkKmlv2uk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1CgFeD+LAdX6WlwPBHdwrVKCcQCAQCgUDgQCDgJMrLM3Q4ePRAnPXoZCAQCAQCgcCOIMCH2c0T +hUSHz0dZCL4jRUchgUAgEAgEAoHA/kbggQceeP/73890rpHo8Pno/u5z9C4QCAQCgUAgENgRBCBR +vuL+tre9DRJ98MEHjVApWbtg7EgFUUggEAgEAoFAILBfESiQqE/t0t94PrpfT3r0KxAIBAKBQGBn +EOALB7knCom6V0oF4Y/uDMpRSiAQCAQCgcC+RIAp3HvvvdeJMydRZLocPLovz3t0KhAIBAKBQGAH +EIBEC8RZIFTqKP/ar/3aW97ylh2oLYoIBAKBQCAQCAQOHgL/P+31m0OBwkolAAAAAElFTkSuQmCC +If you see this screen, you’re done with the install and everything has installed. All you need to do now is reboot and watch your computer load the new Chameleon and enjoy the extra features that it has over the previous versions!BootingChameleon is setup to automatically boot your operating system with the default settings but has the ability to pass variables to the kernel. You can pass startup options to the kernel by pressing any key when you see the boot logo and the type them to be sent to the operating system after you hit enter.Advanced OptionsAdvanced startup options use the following syntax: [device]<kernel> [arguments]Example arguments includedevice: rd= device name> rd=*<IODeviceTree path> (Device name sample rd=/dev/disk0s2)(Device tree sample rd=*/PCI0@0/CHN0@0/@0:1)Kernel: Sometimes you need to use a different kernel for testing, or you need to use the old one after an install that didn’t work the way you wanted it too =)kernel: kernel name Example: mach_kernel.voodooFlags allow you pass arguments without having to make them a permanent config settings. Examples of valid flags are:-f This forces rebuilding of extensions cache-sBoots into a single user command line mode-vVerbose, boots in text mode showing all debug info and errors-xBoots into safe mode "Graphics Mode"="1024x768x32" : Tells VESA to boot with this resolution, the x32 is bit depth and is only compatible with VESA 3.0 and uprd=disk0s1: Tells Darwin to boot from a certain partition specified in BSD format. Disk 0 specifies first HDD and s1 specifies first partition as 0 is the MBR.cpus=1: Tells the system how many CPUs or cores to use, useful for Core Duo users.platform=X86PC: Can be used if problems with normal booting, platform=ACPI: another option if normal booting fails-legacy - Boots OS X in 32bit mode rather than 64bit if 64bit is used due to a 64bit processoridehalt=0 - May stop stutteringkernel debug flags (e.g. debug=0x144) io=0xffffffff defined in IOKit/IOKitDebug.h)Example: mach_kernel rd=disk0s1 -v "Graphics Mode"="1024x768x32@85"If the computer won't start up properly, you may be able to start it up using safe mode. Use the startup command “-x to start up in safe mode, which ignores all cached driver files.Example: -x -vSpecial booter commands: ?memory Displays information about the computer's memory ?video Displays VESA video modes supported by the computer's BIOS. ?norescan Leaves CD-ROM rescan mode.Additional useful command-line options: config=<file> Use an alternate Boot.plist file.Boot.plistOptions useful in the com.apple.Boot.plist file:"Boot Graphics"=Yes|NoUse graphics mode or text mode when starting."Quiet Boot"=Yes|NoUse quiet boot mode (no messages or prompt).Timeout=8Number of seconds to pause at the boot: prompt."Instant Menu"=YesForce displaying the partition selection menu. GUI=NoDisable the GUI (enabled by default).USBBusFix=YesEnable the EHCI and UHCI fixes (disabled by default). EHCIacquire=YesEnable the EHCI fix (disabled by default).UHCIreset=YesEnable the UHCI fix (disabled by default).Wake=NoDisable wake up after hibernation (enabled by default). ForceWake=YesForce using the sleepimage (disabled by default). WakeImage=<file>Use an alternate sleepimage file (default path is /private/var/vm/sleepimage).DropSSDT=YesSkip the SSDT tables while relocating the ACPI tables.DSDT=<file>Use an alternate DSDT.aml file (default paths are /DSDT.aml or /Extra/DSDT.aml).Rescan=YesEnable CD-ROM rescan mode."Rescan Prompt"=YesPrompts for enable CD-ROM rescan mode.ThemesChameleon 2 lets you create or customize the boot loader themes! You can edit the file in /Extra/Themes/Default/theme.plist. The following variables are changeable in the theme.plist to customize your theme.Images and ColorChameleon 2 has user replaceable images, and colors that you can customize. The images are saved in the /Extra/Themes/Default folder. All images must be in .png format .You can change the color of all the text and other widgets by using RGB color codes. Below is a basic color code chart but the full RGB color pallet is supported.iVBORw0KGgoAAAANSUhEUgAAAVMAAAClCAIAAABulYmTAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzf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4LNKGnPvnwF3Hi +hOepQioJ8Zi/a9euNm3aMOBj+XfccQfD/ooVK77//vtWrVoVUkCl2gUHgdRRoyJOncq66qqCU6WC +U5MQj/kvvfQSZs9Q/9VXX7311luzZs1aunRpUlISANEL9OnTp169ehzec88969ev90QtPT39zTff +vPHGG+k4mjdv/t5772VlZaHGrIF+ZMiQIfQj999//3//+1/PtCLJCwQijh6NHzKkxHXXlaxSpdgd +d+iBOnbaNOIJ3boZM4WsrISHH+awyKRJVCChd+8SDRqUrFy5RN26ifffH7l9u65V5N69id26lahR +o1jLlpHbtmVXNSuryOTJxW++mSTFGzcuOnYsGRpnHY7YGTOKtW5dIimp+HXXxT/6KLIis2bFP/NM +9DffEI8bOZJC0U/o2bNEcjKZRxw/XvStt4o3aZJ4773RX39tZJJzffRZO/2GeMz/9ttvQfNhboVi +xTSsNzgD3UHHjh137Nhx2223lS9fnh6hXbt29A7Vq1d3R3/UqFFjx469+uqre/bsOW/evKeeeioj +I2PgwIG8pLBhw4atW7e+//776NMLuKeS+JUjkNirlyMignyif/wxO7fMzMROnaJ/+OF8//6OhARm +6Yndu5/87rsL3bsXmTYtdtmyrFdfzSpVKvaTTzLr1Uvr0YOEUb/8ktG8OUJsL2blyrj4+LP//rdK +T6cXiNqxw1GsWFb16qzzjSIcDn6w1bhXXklv0SKtW7ciM2Zgz1lly17o0aPI22/HjxyJRsZttxm9 +wIcfpv7zn5G7d0dv2BB56BAJdTxq48asWrWYCMQsW0b35ChVSqWmxqxZE5GWdnrxYtS814cTtguh +tHzM++DBg0BarVo1C7Cff/45Zl+lSpXZs2dHRkYytjNuT58+/cUXXzQ1Gd7fffddDln5N23atEWL +Fr169ZowYQKWr3UqVKgwevToUqVKETFTSSQoCMQsX+6ZT/Tnn2P2mTVrpt99N2czly+nX4hZvfpC +165np00r3rp1kXHjVFSUIzHxzPTpKj4enVNffx1x8GD0xo2O8uWjt2yJWbhQnTnDKG2YfUzMyU2b +MM7ELl0iV6xQdDQOB0t3Ul3o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nhHLZv34Zp8Twfx7Wh/UoXbx+QeWPw7pcDlv6U +lBQ2/MV5tjssNo7zlS43ZABGyeY/L/n5H3zMC/zPRDSDiIBe3lsyzImr36ImhzZD4PKzfZs1OFTN +4a2pUBUt5QoCFgSEh88CiBwKAuGCgIz54XKlpZ2CgDsC7PD52uLz+p2Jmd73DFbSmkARASvNf+Yu +lLggEBIEDAbOkBQcnoWyoRqeDZdWFzQEGJX/HwS7wKDdB5jPAAAAAElFTkSuQmCC +Screen Set the display dimensions to use when in the graphic user interface, will attempt to find the closest one available.screen_width <key>screen_width</key><string>1024</string>1024 pixels wide screenscreen_height <key>screen_height</key><string>768</string>768 pixels high screenscreen_bgcolor <key>screen_bgcolor</key><string>#222334</string>web format #RRGGBBiVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAIAAAC6s0uzAAAB32lDQ1BJQ0MgUHJvZmlsZQAAeAGt +ksFLFHEUx78zErthLGJWRAZDqJjMxjJ7qdtuewhhhUVXzfCy/nbdlZxxmBndig5dunUrOnReJOrW +RS/hHjsUKKJpnfobJImWZfr+5seyHpQuvuHN+/we39+bee/3A3oGS667rAOwncCbfHDfeDj3yIgd +QsNNJq+gtyR8N1so5Lk6w473qabtJmWtT/7e2I2v6deNkVbs1efi1hmbOumExw8CmsnEQFVxRvKC +4qLkeuAG1NQki1qpTH5ONr3iZI78npyoKt6UvKD4i+Q1UZV7D8gpp7zkAHqcfLdc8QU5QxZlX9jk +Btm07RXW17fJo8L1uFf/Qx6Sc2GkPdsHsh9ZM9HNzbwBPqwB12U7RiTD8GPg8m9gc72bOzqIZqVd +jfuLaSvSab0bwIW3YXg0C8RuA+3vYdjaCMP2OtDzA2gei1WPtZVa+8Yf/s9a9az0wA57oEVndDqr +uUSqFNBoAnNcjGeAd/SRa0D/T6BALmagp9MdVzOkFLiYz00kLauueopS5/Oyl1d5TpHJDi5VnOkp +xj76IPLIYQJJWHzqsNTZSe38S+CWvNZo/v31QsaTFlSeRDPJrbhPvaVqLTCyvLkV0xh3xB3TsFKp +e/gHmVWEZApHLZsAACAASURBVHgB7b133BRFvr59yDlnJCpZkqJIDi6IIMecAHENuLqu4nrMrBkx +YVzEsGvYVUFE5awYQFBBQQRdRUSUIEFyzjn5Xj/r3fr0mZ7p7plnQs/MPX88T3V1ddW3rqruuyt2 +oV9//fW/9BMBERABERABEUgvgcLpTU6piYAIiIAIiIAI/D8CEmDVAxEQAREQARHIAAEJcAagK0kR +EAEREAERkACrDoiACIiACIhABggUuffee9Oc7Kuvvjpt2rQOHTo40121atUrr7zy7LPPrlu3rmHD +hqVLl7ZnPU7ZMOl3TJ8+/cEHH/zb3/721VdfNWrUqHLlytaG8Bi8c+fO8ePHDx8+/MMPP2S2XfPm +zUNopDXJ6bjttts++eSTXr16Wc/wULUm4fj6669Hjx791FNPff7556VKlTr22GPt2QwanIakw5lx +Cz+WIyvqVfhv26x4+kXUgZDqDs/ldP527drFQ+qCCy5wJrpy5cpy5crVq1fvnHPOqVq1atu2bXfs +2GECeJxyxpBm98svv0zpHnPMMWeccUaJEiVKliw5d+7csBl88ODBVq1a1apV64orrqhTpw4Gjx07 +NmxGRi24d955B2v79Oljz4azGnz00UcUfePGjc8///yKFSsWKlToueeeyzjhNLAKZ8ZtbYnlyIp6 +Ff7bNiuefhF1ILS6818RhqbucM6cOdddd139+vV5tkYIMDLWokULGJH6L7/8UqFCheuvv95Y4nEq +dab6xlyzZk0aZ0eOHCEkTXaaPjyCw2bwQw89VKNGDXhi2IEDB/r27du7d++wGWnscf5dv349L2GV +KlVyCnA4q8EJJ5zQrVs3npjYv2/fPl4cqbr79+/nMIMGpyHpcGbcWYvc7mypV+G/bbPi6WcrQMh1 +J30C/Oabb/JI5VemTJkLL7zQAtq4cSOSTOez9aEdXLt27aNHj3qcsoHT79i7d2+RIkXo17VJ051+ +2mmncRgqg9Gwu+66yxr5008/jRkzJmxGWvOs48wzzxwwYEC/fv1OP/104xkqqtZOqkHRokVffPFF +6/PYY49Rk7///vsMGpyGpMOZcV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BABEUgCAdQ04G/Tpk0333zzc889d+TIkYCXuO0LeGHwYGlIIrgxCpkPBApY5SpX +rvzggw8aULfffnvRokXvvPPOMWPGXHrppcSMw5y65ZZbihUrdvnll990003ly5evWbNm27Ztfa+y +/Ddv3kxstWvXRmufffbZSy65hMPHHnvMBChZsmSjRo1atmyJ1v7hD3/g1AMPPOCbro3c20FsET/v +8DorAiEnEFGfOUyWwXFExC3NQ+H555+XACeLvuLJRgIFvButAK9atapEiRLDhw+3EM477zyE9ujR +o7/88kvx4sWtTnPrcRUNZUJ6XGXjwWEEuF27djRtjf/FF19csWJFRpE4RICbNWu2b98+c6pz5840 +l3F7pGtCBvlbQD5BklAYEUgngdRV6aBd0OQWI+rVq1erVq1ChQq5DZKPCIhAXASmT5/OsM5pp51m +r8K9fv16JHbGjBlMthg0aJA5xcTps88+27g9rrLxWAeKXqRIEXN4wQUXbN++fdmyZebw/PPPR4aN ++/jjj1+6dCluj3RNSP0VARFIIoFAAnzo0CHuzzlz5vAgaN26NS/Ra9asWbt2rSZkJbEkFFW+EVi+ +fDkSeMIJJ9iM0y2Mm5uLliiN4zp16thTvPgat8dVNrB1HHfccRHuDRs2GB+a1PYUrW26tTj0SNcG +lkMERCBZBIr6RsSd+cMPPzD0u3jxYp4CpUuXplPriy++oKOM9+tTTjmFu9c3EgUQARGIIFCmTBla +wLRKq1WrZk799NNPOLjLypYty9vt1q1bq1atak6hu8bhcZUJ4PxL/PaQhHDTiWV8CheO8vLtka6N +Rw4REIFkEYhyE0ZEzXTKf/3rX5999tnJJ59coUKFRx99lDmZP/744+TJk1966aWVK1ea3umIq3Qo +AiLgTYBRWO4d7iwb7KuvvkJx69atS8uVU/Q2m1Po6KxZs4zb4yobj3V8++231k1CvCvXr1/f+rgd +Hum6A8tHBESggAT8BZjZHD///DPDUSNHjmQWJenVqFGDJQ0jRoxYsWIFSmw6rwpohy4XgXwj0KdP +H9SUXbHo+KU/adKkSePHj7/++usZtTWnhg0bhs/cuXMHDx68evVqw8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aD4myqYcsZJMXcvdppiGJGxacogABFTlvKuB+Hjz0dmsI5C6Ku3fAmbQl0WKyDB7ySK6zK6k +4Us7uFevXkzCYo1E1tGUwSIgAiIgAiKQcQL+LWBj4p49e1iDxHgwnc9MgWZdP93R7NHh3f+cuhcH +Cy4NSdi05BABCKjKeVcD8fHmo7NZRyB1VTqoABtktH2Z+Yw1AWddpc5uW4RpSMKmJYcIQEBVzrsa +iI83H53NOgKpq9L+XdBOWNjh3eR1BpZbBERABERABEQgFgH/vaBjXSl/ERABERABERCBhAlIgBNG +pwtFQAREQAREIHECEuDE2elKERABERABEUiYgAQ4YXS6UAREQAREQAQSJyABTpydrhQBERABERCB +hAlIgBNGpwtFQAREQAREIHECEuDE2elKERABERABEUiYQHzrgBNORheKQA4TcK/Tz+HMKmsiIALJ +IqAWcLJIKh4REAEREAERiIOABDgOWAoqAiIgAiIgAskiIAFOFknFIwIiIAIiIAJxEJAAxwFLQUVA +BERABEQgWQQkwMkiqXjyhQDfBMuXrCYjn8KVDIqKIzcJaBZ0bparcpVSAhKVlOJV5CKQJwTUAs6T +glY2RUAEREAEwkVAAhyu8pA1IiACIiACeUJAApwnBa1sioAIiIAIhIuABDhc5SFrREAEREAE8oRA +fAJ88ODBw4cP5wkaZVMEREAEREAEUkcgDgHet2/fzJkzv//+e00BTV15KGYREAEREIE8IRCHAO/a +tetf//rXF198IQHOk8qhbIqACIiACKSOQBwCXKRIkbJly5YsWTJ11ihmERABERABEcgTAnEIcNGi +RevWrVutWjVawGoE50n9UDZFQAREQARSRCDQTlhMvNq0adPy5ctLly7NSPCcOXNw1K5du0qVKjSL +U2SZohUBERABERCBHCbgL8A0dpctW/a3v/1t+vTpR48eZSS4cuXKFSpU6NSp08UXX9y4cWNpcA7X +D2VNBERABEQgRQT8BXj37t3vvvvu1KlTzzzzzHLlyk2aNKlNmzbHHHPMe++9R2v4z3/+c61atVJk +nKIVAREQAREQgVwl4C/AmzdvXrBgQf/+/YcPH24obN++/Y9//GPr1q1feeWVxYsXV69eXY3gXK0f +ypcIiIAIiECKCPhPwjp06BD6Wq9ePTPxitHfVatWrVu3rmnTpvRIMzZ85MiRFBmnaEVABERABEQg +Vwn4t4ArVarEzOePP/64bdu2pUqVmjt3btWqVZkR/f7772/dupWzav7mauVQvkRABERABFJHwF+A +K1as+Lvf/W7evHl33XUXY8D79+8fOHAgf5kL3bVr15YtW0qAU1c8ilkEREAERCBXCRQKsqKXruYv +v/ySqVjbtm1jKtZpp522fv36FStWoL6sRPJAU6hQoYizQZKLuMT7MA1JeBugsyIgAiIgAjlMIHUq +E1SAWX2E4rIeie8xFC9evGbNmixAQn3dljmLwX1WAuzkI7cIiIAIiEDICaROyPy7oGn+Ll26dOzY +sYz+mq8hMRJcrFixhg0bDhgwoFWrVrhDjk/miYAIiIAIiEDYCPgL8M6dO5lvxXeQOnbsyFxotoNG +hjds2DB79uxx48axKUeDBg3ClivZIwIiIAIiIAIhJ+AvwKwDnj9/fu/evW+99VZnZqZNm/bXv/51 +yZIlbBCteVhOMnKLgAiIgAiIgC8B/3XAdH/zBSTWHR04cMCM4NIpzeJgPEuUKMEiYA59k1EAERAB +ERABERABJwH/FjAzrRo1asRG0Cz/pbHLADCbU7L/xpQpU+iOrl+/vpq/TqByi4AIiIAIiEAQAv4C +XL58edYdsfvVG2+8wTZYTLnas2cPA8OsCR4yZAhTsQoX9m9GBzFFYURABERABEQgfwgEWoYEDhSX +zxGyDpgPMKDBKHGd337e6pu62du2hNKQhE1LDhEQAREQgXwjkDqVCSrAiRFPnd3WnjQkYdOSQwRE +QAREIN8IpE5l1Hucb3VJ+RUBERABEQgFAQlwKIpBRoiACIiACOQbAQlwvpW48isCIiACIhAKAhLg +UBSDjBABERABEcg3AhLgfCtx5VcEREAERCAUBCTAoSgGGSECIiACIpBvBCTA+Vbiyq8IiIAIiEAo +CEiAQ1EMMkIEREAERCDfCEiA863ElV8REAEREIFQEJAAh6IYZIQIiIAIiEC+EZAA51uJK78iIAIi +IAKhICABDkUxyA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eihUrVqlSpVWrVr169apZs6bbuFwtBuVLBERA +BERA+CEylAAAIABJREFUBJJFwF+ADxw4wBYcTz/9NE3eRo0a1alTh9Ywk6JnzJjBphy///3vNQs6 +WYWheERABERABPKHgL8Ao7LTp09v3Ljx8OHD69WrZ9CwGdaoUaP4MhKTok8++WSPYeD8QamcioAI +iIAIiEBwAjHnT9ko2AKapcDdu3e36sspPslw9tln85clwkzIsoHlEAEREAEREAERCELAvwWMyjLi +++2339LYZQ0SS35ZjEQvNKPCNHzpf9YYcBDQCiMCIiACIiACTgL+s6CRW7qg2fqK1UcIMHtPMg+L +H8uCTz31VDbDQp6dMTrdbm3WMiQnH7mTRSANNS1ZpiqeNBBQfUgD5PxJInXVyV+Aobx///45c+ZM +njyZzShxY03JkiXbt29/5plnMgvaoxhSZ7dNNA1J2LTkCC0BVYPQFk1GDFN9yAj2XE00ddUpkAAb +rOzFwXok2r4s/zX90kWL+vRgp85uW9JpSMKmJUdoCagahLZoMmKY6kNGsOdqoqmrTnEIcAJwU2e3 +NSYNSdi05AgtAVWD0BZNRgxTfcgI9lxNNHXVyX8WdK4yVb5EQAREQAREIIMEJMAZhK+kRUAEREAE +8peABDh/y145FwEREAERyCABCXAG4StpERABERCB/CUgAc7fslfORUAEREAEMkhAApxB+EpaBERA +BEQgfwlIgPO37JVzERABERCBDBKQAGcQvpIWAREQARHIXwIS4Pwte+VcBERABEQggwQkwBmEr6RF +QAREQATyl4AEOH/LXjkXAREQARHIIAEJcAbhK2kREAEREIH8JSABzt+yV85FQAREQAQySEACnEH4 +SloEREAERCB/CUiA87fslXMREAEREIEMEpAAZxC+kg4FgcOHDx84cCAUpsgIERCBfCIgAc6n0lZe +oxEYMWJE69ato50J5FeqVKmRI0cGCpr6QFWqVHnooYcSTmfx4sU//fSTuTxU+Uo4R7pQBMJMoGiY +jZNtIhB+AhdeeGHz5s3Db2cQC2+77bbdu3dPnTqVwLmUryB5VxgRSD8BCXD6mSvFnCLwz3/+M6fy +85/M5Gq+/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AREQgQITkAAXGKEiEAEREAEREIH4CUiA42emK0RABERABESgwASyeCMOm3fnCHkIZ1lbO+UQ +AREQAREQAUsg61vATvUlVxGHNp9yiIAIiIAIiECoCGS9AIeKpowRAREQAREQgYAEJMABQSmYCIiA +CIiACCSTgAQ4mTQVlwiIgAiIgAgEJBDfJCx2V+YjB9WqVWN35YAJKJgIiIAIiIAIiICbQCAB3rdv +34cffvjKK6+sWrVq79695cuXR4D5iP1FF11Urlw5d6TyEQEREAEREAER8Cbgvxf0/v37x48f/+ij +jzZp0uTkk0+uVasWX+6bN2/ep59+OmjQID7HyzeFYqXhnpOc9GVCaUgiVu7kLwIiIAIikPMEUqcy +/i3grVu3zp07t3fv3vfcc0+JEiWKFi2KiPJ79dVX0eBFixaddNJJfPIv58tAGRQBERABERCBJBLw +EU6EdufOnXQ7t2vXjs/dlypVqlixYsWLF0eJO3XqVKRIkQ0bNhw+fDiJBikqERABERABEcgHAj4C +TNO7cuXKjPjOnDlz8+bNe/bsQYyRZHqhv/76a6SXCVm0ifOBlPIoAiIgAiIgAkkk4D8GjMrS1Xzf +ffeRKr3NzMDatGnT4sWLly5deu21115zzTUaA05ieSgqERABERCBUBFI3RiwvwADgo7oBQsWvPji +i9999x0zomnyVq1alSnQZ511VpkyZTxIpc5um2gakrBpySECIiACIpBvBFKnMoEE2In7yJEjDP06 +fTzcqbPbJpqGJGxacoiACIiACOQbgdSpjM8YsBt0cPV1XysfERABERABERABQyBuARY4ERABERAB +ERCBghOQABecoWIQAREQAREQgbgJSIDjRqYLREAEREAERKDgBCTABWeoGERABERABEQgbgIS4LiR +6QIREAEREAERKDgBCXDBGSoGERABERABEYibgAQ4bmS6QAREQAREQAQKTkACXHCGikEEREAEREAE +4iYgAY4bmS4QAREQAREQgYITkAAXnKFiEAEREAEREIG4CUiA40amC0RABERABESg4AQkwAVnqBhE +QAREQAREIG4CEuC4kekCERABERABESg4AQlwwRkqBhEQAREQARGIm4AEOG5kukAEREAEREAECk5A +AlxwhopBBERABERABOImUDTuK3SBCGQ5gUKFCmV5DnLf/F9//TX3M6kc5j0BtYDzvgrkGQCpb1YU +uIopK4pJRhaQgL8A8yp66NChAiajy0VABERABERABJwE/Lug9+/fP3v27OXLl3fq1KlZs2ZcvH79 ++nnz5lWoUOGEE04oUaKEMzq5RUAEREAEREAEghDwbwHv3bv3k08+GTFixMiRI7/88ksi3b59+0cf +ffTAAw988MEH+/btC5KMwoiACIiACIiACDgJ+Asw/c979uypUaPGgQMHXnnlla1btx5zzDGnn346 +LeD33ntvxYoVR48edcYotwiIgAiIgAiIgC8BfwFmDLh48eI9evS4+uqrt23b9u2335YrV65nz55D +hgzZsWPHsmXLjhw54puMAohAaAlQw3P1t3nzZrB/+OGH4c9gaKuHDBOB1BHwF2DSZkZimTJlOnTo +0LFjxy+++GLXrl3FihWrWbMm/c80jrm3U2efYhaB9BDYuXNn//79Z86cedtttzVv3rxVq1ajRo2y +SZ911ln09zz33HMtWrSg1wf/p59+uk2bNryMtm/ffuLEiTYkjqeeegpPXlJHjx79zjvv3Hrrreas +OxKksXfv3vXq1ePU1KlTbSS//PLLPffcQ1rHHnvs5ZdfzpuuORXL314Y1UHWiISOq+OPP/6xxx6z +NyydW08++eRpp52GARdeeOHLL79sL3ebak55U6JjbMqUKY8//viJJ57YpEmTG2644fDhwzbOWFhs +ADlEIO8I+L4ar1279sYbb/zLX/5CyPnz55977rl33HEHD44//vGPXbt2/fzzz2kBx4rETTNWyIT9 +05BEwrbpwhASiFVhTGOxdu3aqMizzz57ySWXENLIFbmoXLkyL6CFCxfmLJMQb7/99qJFi955551j +xoy59NJLCYnDZPaWW27h9RTBu+mmm8qXL897atu2bc2piEheffVVXm27dOmC0l900UVEOH78eEIe +PHiwcePGJMeIDwkZkzz8TeRR/5pMYQZaji5eccUVmHr//febwFhYunTpP/zhD6+99tpll13GqX/+ +85/mVISpNnJvSiVLlmzUqFHLli3RWqIlQmaKmGs9sJgABI742UTlEIHMEoiomRwmyx7/iBBgbp67 +7rqL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JXa6rREAEcoaABDhnilIZSQeBDRs20Pw99dRT05GY0hABEchpAuqCzuni +VeaSSuDmm2+eMmUK+9L0799/xYoVxP3000+3adOGZfHt27efOHGiTe30008n5OOPP37iiSc2adLk +hhtu4OPZnB0yZMjMmTO/+eYbJHzXrl02vNvBMPM999zTokULPnZy+eWXs/2cCUPM//u//zty5MgT +TjihR48e77zzDp8mu+SSS3gt6N69+6xZs0wwhqiffPLJ0047ja3a2cX95ZdfdicRy4fvr5BB7KSx +3rx5c/a/GzVqlA0cK2smwFNPPQUKPpI2evRobLv11lvthXKIgAhEEFALOAKIDkUgJgE07/PPP2cx +HlJXpkyZO+6447HHHrv99ttRKb4YdtZZZ40ZM2bgwIFc/9lnn/GdErapQXF//PFHvubJyPFf/vIX +do6bPXv2gQMH+LpJsWLFYqWEfPbu3ZsBWgRs0aJFr7766sUXXzxp0iQTM0PIpUuXRlZJbsCAASg0 ++8VeccUVHCKc7JbDGn1se+655xDmSy+9lA7zK6+8Ek/csVJ0+pP6Bx98MHfu3NatWw8dOhRR5+/B +gwdvuukmY0DUrHEKaxFgEuW7pcOGDcNIPhzujFluERCB/0OAnTFS9/s/Kf12kPS00pBE0m1WhOEh +EG/9Qec6deqE/WyHziexhw8fbvNy3nnnoTdsG4cP0ssO6mzdas527twZaTTus88+u1evXvaqqI55 +8+Zh2IQJE8xZFLRr165sAcshMR9//PHMxMaNRhKM1wITjBYnhwsWLODwlFNOoQFt/DEJkb7qqqvM +Ier44IMPut3Gh7+bN28mnnbt2tFqN57If8WKFa0BUbNGk5098mzMREJCdA/YaONyYEDEL67LFVgE +kkggoipymKzI1QXtZisfEfAnMH36dBqy9PHaoLj5bDbCbHzOP/98u1Erkkmr0Yb0dSDktI9pRL71 +1lt0PtNfTcsbvTcXnnHGGexGh7t+/fr8peVt/M28MISQQ9rZ9957LxbSgH7zzTfppqYJa4IF/Mv7 +hN1454ILLti+ffuyZcvMtVGzNmPGDJIYNGiQCUPznVeNgGkpmAjkJwEJcH6W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cuTI999/zzKkZcuWMeJLFzSt2G3btjEefM0113Tv3p21SbHKI3V22xTT +kIRNSw4REAEREIF8I5A6lYmpnRYxM61o+/7yyy+DBg1q2LAhO2+wKxbzn8eNGzdhwoRjjz0WTxtY +DhEQAREQAREQgSAE/AV48+bN9D+z8HfgwIHFixdnzjM7ctAspgXMmuCff/6ZkWCPRnAQIxRGBERA +BERABPKNgL8Am1VGSC9bQBs6+PCrUaMGK4D5JX1eVb6VgfIrAiIgAiKQhwT8Bbhy5crsPfnmm2/S +8G3Xrh0NXwaAV65cSf8zS4TpglbzNw/rjbIsAiIgAiJQQAL+k7DQXaZfvfrqq5988sn+/fuR2337 +9jEM3KxZs2uvvbZr165My4plROrGrm2KaUjCpiWHCIiACIhAvhFIncr4CzCs0eANGzawFwfjwXwZ +CcVlKhZt3yZNmnioLxemzm5bA9KQhE1LDhEQAREQgXwjkDqVCSTABjcTr8yPnTfMMLDbrIiCcQdI ++oBxGpKIyJQORUAEREAE8odA6lTGfwzYUjaiaw/lEAEREAEREAERSJiAtnFOGJ0uFAEREAEREIHE +CUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpSBERABERABBImIAFOGJ0uFAER +EAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpSBERABERABBImIAFO +GJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpSBERABERA +BBImIAFOGJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyABDhxdrpS +BERABERABBImIAFOGJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAEREAERSJyA +BDhxdrpSBERABERABBImIAFOGJ0uFAEREAEREIHECUiAE2enK0VABERABEQgYQIS4ITR6UIREAER +EAERSJyABDhxdrpSBERABERABBImIAFOGJ0uFAEREAEREIHECQQV4KNHj+7du/fAgQOJJ6UrRUAE +REAEREAE/kOg6H8cXv/37ds3f/78H3/8sUKFCt26dStSpMjq1av5W79+/dKlS3tdqXMiIAIiIAIi +IALRCPgL8OHDh//9738/9dRTGzZsKFu27Lp16woXLjx79uyDBw8OGDCgV69epUqVihZzMv0KFSpk +o/v111+tO6CjgJcHTEXBREAEREAERCA4AX8B3rFjxwcffPDLL79ceuml27Zte+2110qWLNmgQQN8 +xo4d26hRo2bNmjkVLnjaAUNGRM5hXBpcwMsDGqlgIiACIiACIhAXAX8B3rx585o1ay666KKhQ4fu +3r17xowZ9Dzfe++99EiPHDly0aJFaHCxYsXiSrWAgYNrcIT6FjBdXS4CIiACIiACySLgMwmLtuaR +I0dIjNFf/jIViw7n8uXL0wiuVKkSPnREJ8uUuOIJoqxBwsSVqAKLgAiIgAiIQLII+LSA0bAqVarQ +5J08eXKJEiXojqYRvGLFihdeeGHJkiXVqlVr3Lgxs7GSZU1c8WCbR1+01DcumAosAiIgAiKQZgJe +GmZMQeRQ3DFjxtDbjBifd955RYsWpSOayVn9+/dv2bIlc7JiGe1WQQ/JjBUJ/u54PAKThEf4xAzw +SE6nREAEREAEcpiAW1CSpSP+Amyw7ty5c9myZZs2bapatWrFihVNR7TvGqQk2u2OKoHyTha1BJLW +JSIgAiIgAtlIwK0+yZISny5oA4tu588+++zTTz9dv349a4IZA65cufIpp5zSp08fHOkBSobdFOJK +OlnI4kpUgUVABERABEQgKgF/AWb3qylTpowaNQqtPfbYY5mNxVSsVatWPffcc1u2bBk8eLCZnxU1 +9uR6FkSDpb7JLQvFJgIiIAIiUEAC/gK8devWmTNn1qtX78Ybb6xZsybzn5kXvX37dhYEz5o1q1On +Tm3btvUYBi6gfRGXJ6bBUt8IjDoUAREQARHIOIGY86esZbt27WLyc48ePRBaBJgBYKZiHXfccawM +pim8du1as07JhpdDBERABERABETAl4C/AJcrV47O52nTps2dO5fBYBb+sh8WE7ImTpyIm1NpXoYU +b3M23vC+yBRABERABERABApOwH8WNCo7ffr00aNHo74s/GUGFgK8ceNGDgcOHHj55Zd7zMN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f8XEaXu5+aV9LTcSchHBJJOIGC9XbRoUcmSJZHhAwcOtGzZskGDBrt37/a49owzzujS +pcumTZuKFClyxx132JAvvvhiz54958yZY3xmzpzZq1evDz/8kMNzzjnn7bffNv4rVqy4++67aRDT +/qYre/v27TYGOUQgfwh43O9JgeCOPynREokE2M1WPiIQhUDAW+7RRx/l4k6dOvH3448/9rhq48aN +dD6PHj2aMKeeeioiagMjpcccc0ybNm0YUUbLkdi2bdsePHiQAAg8SeDgsHHjxh06dHjllVduv/32 +2rVrn3766TaGWI4oGZOXCOQ0gVj3QnB/N57g13qHlAC72cpHBKIQ8L6R7NnDhw+3a9eO6y+//HLr +GdVB1zQN3w0bNnD22Wef5ZIvv/zShnzvvffweeyxx+6///5ixYp999135pQVYLqsCcAQsvH/5JNP +unbtun//fhuD20F4/UQg3wi4b4R4fdzE4o0hVngJsJutfEQgCoFYt1CEP/3J1atX5/qOHTseOXIk +4qzzsH379qeddprxWbduXeHChYcOHeoMMGjQoDJlypQoUeLee++1/laAUW6EuVmzZuPHjw/Y+Rwl +V/ISgVwnYO+dhB1uQglHFXFh1gsw+XHTkY8IJJ1AxJ0T65BZymgkkokBjz/+eKxgixcvJgD6Wus/ +PwS4Zs2aTs1eunQpYcqVK8dkaRuPFWB8GBU2rW1a0t27d3///fdtsKgOYtNPBPKNQNR7IS5PN7G4 +LvcInAsCTPbcgOQjAkkk4HELOU+99dZbJPrwww/jSeuW1UdLlixxBrBuJk8VL1786aef/ut/fldf +fTXXOoeNhwwZUrp0aTzpiLYXOgXYeP70009PPPEEc76Q4e+//96GdDuSCERRiUC2EHDfCPH6uHMa +bwyxwueFAMfKvPxFIIkEmFRVrVq1E088kZlTREv7FQFmRvTRo0fdqRx33HH//d//7fTftm0bXcqI +rvGcOnUqtz1jw5deeinx0GI2/laAp02bduaZZzLkbPyZEU34f/zjH8443W73o0Q+IpDDBNy3QAI+ +bj4JRBL1krwQYPBFzbw8RSCJBC644AJmNc+dO9fGSVOYuvfMM89YH+O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AANSSURBVH0V/w4dOvDBNXVHx8td4UVABERABPKcgP847s6dO3fs2NG9e3dWHNWuXZsWMP3PrAC+ +8MILzagwf/McorIvAiIgAiIgAvES8Bdg1vuy3yTfBkeGbexMwmZxMBOyOKvmr8UihwiIgAiIgAgE +JOC/DIlZV4wBv/baa0WKFGH+M13Qu3fvRoy3bdvWu3fv3//+9zVr1oyVWOpmb8dKUf4iIAIiIAIi +kEQCqRMyfwEmG8jt7NmzZ86cuX37dvSYPmc24mDo94wzzqhXr55HC9htdxKhKCoREAEREAERSD+B +DGzEQcN34cKFGzZsoMnLdGgmRRct6jOHSwKc/pqhFEVABERABFJKIFkC7KOgJg+sO6IXeuzYsatX +r+YjSHREV69e/cwzz7zggguc+1OmNMOKXAREQAREQARyiYB/FzTrgCdOnDhy5EhWIrVp04ZPEPJ9 +pMWLF/NBpMGDBw8ZMsRjHbBawLlUV5QXERABERABCKSvBcyS3zlz5px88sm33HIL3c5mHfCePXvG +jRv3zTffoMQnnHCCxzCwSksEREAEREAERMBNwH8ZklkHfMoppzRo0KBq1aplypShycswcJ8+fdiR +Y+3atXRQu+M1Psl6TYgVv/xFQAREQAREIJ0Ekqhr/mPA7PzMb9asWQz6VqxYkXyiu/z9+uuvWQfM +vhwsT/LIfBJt9UhFp0RABERABEQguwj4CzD7XnXr1u2RRx656KKLWrVqRfN3y5Yty5cvZ0b0wIED +mzZt6i3A2YVD1oqACIiACIhAegj4T8LCDmY+0wJ+6623li1bxpeRGPFFhnv16sVulHXr1tVMq/QU +lVIRAREQARHIJQKBBJgMHzx4EBlmRjQjvggwq4/YhJLxYE2/yqXaoLyIgAiIgAikjUBQAU6bQUpI +BERABERABPKBgP8s6HygoDyKgAiIgAiIQJoJSIDTDFzJiYAIiIAIiMD/IyABVj0QAREQAREQgQwQ +kABnALqSFAEREAEREAEJsOqACIiACIiACGSAgAQ4A9CVpAiIgAiIgAhIgFUHREAEREAERCADBCTA +GYCuJEVABERABERAAqw6IAIiIAIiIAIZICABzgB0JSkCIiACIiACEmDVAREQAREQARHIAIH/Dz93 +dVWwJbMUAAAAAElFTkSuQmCC +The Chameleon screen layoutBackground Set the position of background.png within the screenbackground_pos_x<key>background_pos_x</key><string>-0</string>0 pixels from reverse origin along the x axisbackground_pos_y <key>background_pos_y</key><string>-0</string>0 pixels from reverse origin along the y axisLogoSet the position of logo.png within the screenlogo_pos_x <key>logo_pos_x</key><string>0</string>0 pixels from origin along the x axislogo_pos_y <key>logo_pos_y</key><string>0</string>0 pixels from origin along the y axisDevices Set the position of the device list within the screendevices_pos_x <key>devices_pos_x</key><string></string>blank to center on the x axisdevices_pos_y <key>logo_pos_y</key><string></string>blank to center on the y axisdevices_max_visible <key>devices_max_visible</key>maximum number of devices visible<string>4</string>devices_icon_spacing <key>devices_icon_spacing</key>spaces between the drive icons<string>20</string>devices_layout <key>devices_layout</key><string>horizontal</string>horizontal or vertical listdevices_bgcolor <key>devices_bgcolor</key><string>#000000</string>web format #RRGGBBdevices_transparency <key>devices_transparency</key><string>128</string>0 (Opaque) -> 255 (Transparent)Boot prompt Set the position of the boot prompt within the screenbootprompt_pos_x <key>bootprompt_pos_x</key><string></string>blank to center on the x axisbootprompt_pos_y <key>bootprompt_pos_y</key><string></string>blank to center on the y axisbootprompt_width <key>bootprompt_width</key><string>-20</string>20 pixels less than the screen's width windowbootprompt_height <key>bootprompt_height</key><string>20</string>20 pixel high windowbootprompt_textmargin_h <key>bootprompt_textmargin_h</key>8 pixel horizontal text margin left and right<string>8</string>bootprompt_textmargin_v <key>bootprompt_textmargin_v</key>4 px vertical text margin both top and bottom<string>4</string>bootprompt_bgcolor <key>bootprompt_bgcolor</key><string>0x333445</string>web format #RRGGBBbootprompt_transparency <key>bootprompt_transparency</key><string>0</string>0 (Opaque) -> 255 (Transparent)Info box Set the position of the info box within the screeninfobox_pos_x <key>infobox_pos_x</key><string></string>blank to center on the x axisinfobox_pos_y <key>infobox_pos_y</key><string></string>blank center on the y axisinfobox_width <key>infobox_width</key><string>550</string>550 pixels wideinfobox_height <key>infobox_height</key><string>406</string>406 pixels highinfobox_bgcolor <key>infobox_bgcolor</key><string>#333445</string>web format #RRGGBBinfobox_transparency <key>infobox_transparency</key><string>64</string>0 (Opaque) -> 255 (Transparent)Menu Set the position of the pop up menu within the screenmenu_pos_x <key>menu_pos_x</key><string></string>center on the x axismenu_pos_y <key>menu_pos_y</key><string></string>center on the y axismenu_bgcolor <key>menu_bgcolor</key><string>#111223</string>web format #RRGGBBmenu_transparency <key>menu_transparency</key><string>0</string>0 (Opaque) -> 255 (Transparent)Boot DisplaySet the display dimensions to use when booting the kernel, will attempt to find the closest one available.boot_width <key>boot_width</key><string>1280</string>1280 pixels wide screenboot_height <key>boot_height</key><string>1024</string>1024 pixels tall screenGetting in touchChameleon homepagehttp://chameleon.osx86.hu/E-mail : voodoo@mercurysquad.comHope you guys like the bootloader!We appreciate your feedback and supportPAGE PAGE 1 \ No newline at end of file diff --git a/doc/User_Guide_src/Chameleon 2 v0.5.docx b/doc/User_Guide_src/Chameleon 2 v0.5.docx new file mode 100644 index 0000000..2ca6d30 Binary files /dev/null and b/doc/User_Guide_src/Chameleon 2 v0.5.docx differ diff --git a/doc/User_Guide_src/chameleon.png b/doc/User_Guide_src/chameleon.png new file mode 100644 index 0000000..db23bc8 Binary files /dev/null and b/doc/User_Guide_src/chameleon.png differ diff --git a/doc/User_Guide_src/colorchart.png b/doc/User_Guide_src/colorchart.png new file mode 100644 index 0000000..69a05b4 Binary files /dev/null and b/doc/User_Guide_src/colorchart.png differ diff --git a/doc/User_Guide_src/install_complete.png b/doc/User_Guide_src/install_complete.png new file mode 100644 index 0000000..7a9f892 Binary files /dev/null and b/doc/User_Guide_src/install_complete.png differ diff --git a/doc/User_Guide_src/install_cust.png b/doc/User_Guide_src/install_cust.png new file mode 100644 index 0000000..bf0b622 Binary files /dev/null and b/doc/User_Guide_src/install_cust.png differ diff --git a/doc/User_Guide_src/install_dest.png b/doc/User_Guide_src/install_dest.png new file mode 100644 index 0000000..6b0a239 Binary files /dev/null and b/doc/User_Guide_src/install_dest.png differ diff --git a/doc/User_Guide_src/install_stand.png b/doc/User_Guide_src/install_stand.png new file mode 100644 index 0000000..6971b82 Binary files /dev/null and b/doc/User_Guide_src/install_stand.png differ diff --git a/doc/User_Guide_src/install_start.png b/doc/User_Guide_src/install_start.png new file mode 100644 index 0000000..5645d03 Binary files /dev/null and b/doc/User_Guide_src/install_start.png differ diff --git a/doc/User_Guide_src/screen_format.png b/doc/User_Guide_src/screen_format.png new file mode 100644 index 0000000..148417f Binary files /dev/null and b/doc/User_Guide_src/screen_format.png differ diff --git a/doc/User_Guide_src/xnulogo.png b/doc/User_Guide_src/xnulogo.png new file mode 100644 index 0000000..8901077 Binary files /dev/null and b/doc/User_Guide_src/xnulogo.png differ diff --git a/doc/Users_Guide0.5.pdf b/doc/Users_Guide0.5.pdf new file mode 100644 index 0000000..293c7e5 Binary files /dev/null and b/doc/Users_Guide0.5.pdf differ diff --git a/doc/archive/.svn/all-wcprops b/doc/archive/.svn/all-wcprops new file mode 100644 index 0000000..6e8e74a --- /dev/null +++ b/doc/archive/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/archive +END +Users_Guide0.4.pdf +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/archive/Users_Guide0.4.pdf +END +UsersGuide-v0.2.pdf +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/archive/UsersGuide-v0.2.pdf +END +Users_Guide_v0.3.pdf +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/doc/archive/Users_Guide_v0.3.pdf +END diff --git a/doc/archive/.svn/entries b/doc/archive/.svn/entries new file mode 100644 index 0000000..6650f34 --- /dev/null +++ b/doc/archive/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/doc/archive +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Users_Guide0.4.pdf +file + + + + +2013-08-27T23:57:15.000000Z +41bcc59dad88594872aae77790463b71 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +335828 + +UsersGuide-v0.2.pdf +file + + + + +2013-08-27T23:57:15.000000Z +328ae988f1b572b13b181d1f61eed13f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +595461 + +Users_Guide_v0.3.pdf +file + + + + +2013-08-27T23:57:15.000000Z +437bbf681e9dd5cccac75849258e953b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +633861 + diff --git a/doc/archive/.svn/prop-base/UsersGuide-v0.2.pdf.svn-base b/doc/archive/.svn/prop-base/UsersGuide-v0.2.pdf.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/archive/.svn/prop-base/UsersGuide-v0.2.pdf.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/archive/.svn/prop-base/Users_Guide0.4.pdf.svn-base b/doc/archive/.svn/prop-base/Users_Guide0.4.pdf.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/archive/.svn/prop-base/Users_Guide0.4.pdf.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/archive/.svn/prop-base/Users_Guide_v0.3.pdf.svn-base b/doc/archive/.svn/prop-base/Users_Guide_v0.3.pdf.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/doc/archive/.svn/prop-base/Users_Guide_v0.3.pdf.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/doc/archive/.svn/text-base/UsersGuide-v0.2.pdf.svn-base b/doc/archive/.svn/text-base/UsersGuide-v0.2.pdf.svn-base new file mode 100644 index 0000000..d6d9580 Binary files /dev/null and b/doc/archive/.svn/text-base/UsersGuide-v0.2.pdf.svn-base differ diff --git a/doc/archive/.svn/text-base/Users_Guide0.4.pdf.svn-base b/doc/archive/.svn/text-base/Users_Guide0.4.pdf.svn-base new file mode 100644 index 0000000..04d479a Binary files /dev/null and b/doc/archive/.svn/text-base/Users_Guide0.4.pdf.svn-base differ diff --git a/doc/archive/.svn/text-base/Users_Guide_v0.3.pdf.svn-base b/doc/archive/.svn/text-base/Users_Guide_v0.3.pdf.svn-base new file mode 100644 index 0000000..a233757 Binary files /dev/null and b/doc/archive/.svn/text-base/Users_Guide_v0.3.pdf.svn-base differ diff --git a/doc/archive/UsersGuide-v0.2.pdf b/doc/archive/UsersGuide-v0.2.pdf new file mode 100644 index 0000000..d6d9580 Binary files /dev/null and b/doc/archive/UsersGuide-v0.2.pdf differ diff --git a/doc/archive/Users_Guide0.4.pdf b/doc/archive/Users_Guide0.4.pdf new file mode 100644 index 0000000..04d479a Binary files /dev/null and b/doc/archive/Users_Guide0.4.pdf differ diff --git a/doc/archive/Users_Guide_v0.3.pdf b/doc/archive/Users_Guide_v0.3.pdf new file mode 100644 index 0000000..a233757 Binary files /dev/null and b/doc/archive/Users_Guide_v0.3.pdf differ diff --git a/doc/org.chameleon.Boot.nvidia.plist b/doc/org.chameleon.Boot.nvidia.plist new file mode 100755 index 0000000..3e6bfa8 --- /dev/null +++ b/doc/org.chameleon.Boot.nvidia.plist @@ -0,0 +1,31 @@ + + + + + Default Partition + + GraphicsEnabler + Yes + Kernel + mach_kernel + Kernel Flags + + NVIDIA + + + Chipset Name + Quadro FX 380 + IOPCIPrimaryMatch + 0x10DE0658 + IOPCISubDevId + 0x00000000 + VRam Size + 256 + + + Quiet Boot + No + Timeout + 5 + + diff --git a/doc/themeinfo.png b/doc/themeinfo.png new file mode 100644 index 0000000..9181553 Binary files /dev/null and b/doc/themeinfo.png differ diff --git a/i386/.svn/all-wcprops b/i386/.svn/all-wcprops new file mode 100644 index 0000000..edf83c8 --- /dev/null +++ b/i386/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386 +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 58 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/Cconfig +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 59 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/Makefile +END diff --git a/i386/.svn/entries b/i386/.svn/entries new file mode 100644 index 0000000..5f93990 --- /dev/null +++ b/i386/.svn/entries @@ -0,0 +1,132 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +libsaio +dir + +boot0 +dir + +include +dir + +boot1 +dir + +klibc +dir + +boot2 +dir + +config +dir + +doc +dir + +modules +dir + +Cconfig +file + + + + +2013-08-27T23:55:06.000000Z +547fb1f5ed040b65bc6dac0cac4c2002 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +332 + +cdboot +dir + +libsa +dir + +util +dir + +Makefile +file + + + + +2013-08-27T23:55:06.000000Z +57d2668384a3daf86bf73fb47c46047a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +680 + diff --git a/i386/.svn/text-base/Cconfig.svn-base b/i386/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..2ad2aec --- /dev/null +++ b/i386/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,21 @@ +# +# Chameleon Utilities +# + +config OPTIMIZATION_LEVEL + string "Optimization Level" + default "-Oz" + ---help--- + Specify the level to compile chameleon with. + +source "i386/util/Cconfig" + +source "i386/boot0/Cconfig" + +source "i386/boot1/Cconfig" + +source "i386/boot2/Cconfig" + +source "i386/libsa/Cconfig" + +source "i386/libsaio/Cconfig" diff --git a/i386/.svn/text-base/Makefile.svn-base b/i386/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..e3d5999 --- /dev/null +++ b/i386/.svn/text-base/Makefile.svn-base @@ -0,0 +1,29 @@ +# Makefile for i386 boot program + +# +# these paths are only valid in subdirectories of this directory +# +SRCROOT = $(abspath $(CURDIR)/..) +BINROOT = $(SRCROOT)/bin +OBJROOT = $(SRCROOT)/obj/i386 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +include ${SRCROOT}/Make.rules + +# The order of building is important. +SUBDIRS_PRE = + +SUBDIRS_PRE += util + +SUBDIRS = $(SUBDIRS_PRE) klibc libsa libsaio boot0 boot1 boot2 cdboot modules + +modules-builtin: + @cd modules; ${MAKE} BUILT_IN=yes + +all: $(CONFIG_HEADERS) modules-builtin all-recursive + diff --git a/i386/Cconfig b/i386/Cconfig new file mode 100644 index 0000000..2ad2aec --- /dev/null +++ b/i386/Cconfig @@ -0,0 +1,21 @@ +# +# Chameleon Utilities +# + +config OPTIMIZATION_LEVEL + string "Optimization Level" + default "-Oz" + ---help--- + Specify the level to compile chameleon with. + +source "i386/util/Cconfig" + +source "i386/boot0/Cconfig" + +source "i386/boot1/Cconfig" + +source "i386/boot2/Cconfig" + +source "i386/libsa/Cconfig" + +source "i386/libsaio/Cconfig" diff --git a/i386/Makefile b/i386/Makefile new file mode 100644 index 0000000..e3d5999 --- /dev/null +++ b/i386/Makefile @@ -0,0 +1,29 @@ +# Makefile for i386 boot program + +# +# these paths are only valid in subdirectories of this directory +# +SRCROOT = $(abspath $(CURDIR)/..) +BINROOT = $(SRCROOT)/bin +OBJROOT = $(SRCROOT)/obj/i386 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +include ${SRCROOT}/Make.rules + +# The order of building is important. +SUBDIRS_PRE = + +SUBDIRS_PRE += util + +SUBDIRS = $(SUBDIRS_PRE) klibc libsa libsaio boot0 boot1 boot2 cdboot modules + +modules-builtin: + @cd modules; ${MAKE} BUILT_IN=yes + +all: $(CONFIG_HEADERS) modules-builtin all-recursive + diff --git a/i386/boot0/.svn/all-wcprops b/i386/boot0/.svn/all-wcprops new file mode 100644 index 0000000..8371801 --- /dev/null +++ b/i386/boot0/.svn/all-wcprops @@ -0,0 +1,41 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0 +END +chain0.s +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0/chain0.s +END +boot0.s +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0/boot0.s +END +boot0hfs.s +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0/boot0hfs.s +END +boot0md.s +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0/boot0md.s +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0/Cconfig +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot0/Makefile +END diff --git a/i386/boot0/.svn/entries b/i386/boot0/.svn/entries new file mode 100644 index 0000000..cb7f80a --- /dev/null +++ b/i386/boot0/.svn/entries @@ -0,0 +1,232 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/boot0 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +chain0.s +file + + + + +2013-08-27T23:54:12.000000Z +b8eaeac2d032dfe388cfc11b1e37df57 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20480 + +boot0.s +file + + + + +2013-08-27T23:54:12.000000Z +6770a238a2b3d30291799e53b4d209f1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22530 + +boot0hfs.s +file + + + + +2013-08-27T23:54:12.000000Z +6e82070e99eded9e7973244defe2411c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22528 + +boot0md.s +file + + + + +2013-08-27T23:54:12.000000Z +94f3adbae8b22cf5bc79a23bb4c50a58 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +26386 + +Cconfig +file + + + + +2013-08-27T23:54:12.000000Z +b23bd2688af77b4cbb7fb3c255d9585d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +568 + +Makefile +file + + + + +2013-08-27T23:54:12.000000Z +e8fb70bae5bad72ac4f506dec54c4ee6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +636 + diff --git a/i386/boot0/.svn/text-base/Cconfig.svn-base b/i386/boot0/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..45e7663 --- /dev/null +++ b/i386/boot0/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,20 @@ +config BOOT0_DEBUG + bool "boot0 debug support" + default n + help + Say Y here if you want to enable boot0 debug messages. + On an error, boot0 will print one of the following: + > start_reloc was called + * Boot partition found + J Jumping to partition booter + < read_lba + R INT13/F42 error + +config BOOT0_VERBOSE + bool "boot0 verbose support" + default y + help + Say Y here if you want to enable boot0 verbose messages. + boot0 will print out status updates as it executes to + notify the user of progress in the initial boot sequence. + When in doubt, say "Y". diff --git a/i386/boot0/.svn/text-base/Makefile.svn-base b/i386/boot0/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..15f699a --- /dev/null +++ b/i386/boot0/.svn/text-base/Makefile.svn-base @@ -0,0 +1,26 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/boot0 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = boot0 +include ${SRCROOT}/Make.rules + +DIRS_NEEDED = $(SYMROOT) + +OBJS = boot0 boot0hfs boot0md chain0 +OBJS := $(addprefix $(SYMROOT)/, $(OBJS)) + +all: $(DIRS_NEEDED) $(OBJS) + +$(OBJS): $(SRCROOT)/autoconf.inc + @echo "\t[NASM] $(@F)" + @$(NASM) $(@F).s -o $@ + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(OBJS) diff --git a/i386/boot0/.svn/text-base/boot0.s.svn-base b/i386/boot0/.svn/text-base/boot0.s.svn-base new file mode 100644 index 0000000..42d1b08 --- /dev/null +++ b/i386/boot0/.svn/text-base/boot0.s.svn-base @@ -0,0 +1,805 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + +; +; This version of boot0 implements hybrid GUID/MBR partition scheme support +; +; Written by Tams Kosrszky on 2008-03-10 +; +; Turbo added EFI System Partition boot support +; +; Added KillerJK's switchPass2 modifications +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT0_DEBUG + +; +; Set to 1 to enable verbose mode +; +VERBOSE EQU CONFIG_BOOT0_VERBOSE + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kLBA1Buffer EQU 0x1200 ; LBA1 - GPT Partition Table Header buffer address +kGPTABuffer EQU 0x1400 ; GUID Partition Entry Array buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kHFSPSignature EQU 'H+' ; HFS+ volume signature +kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code + + +kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature +kGPTSignatureHigh EQU 'PART' +kGUIDLastDwordOffs EQU 12 ; last 4 byte offset of a GUID + +kPartCount EQU 4 ; number of paritions per table +kPartTypeHFS EQU 0xaf ; HFS+ Filesystem type +kPartTypePMBR EQU 0xee ; On all GUID Partition Table disks a Protective MBR (PMBR) + ; in LBA 0 (that is, the first block) precedes the + ; GUID Partition Table Header to maintain compatibility + ; with existing tools that do not understand GPT partition structures. + ; The Protective MBR has the same format as a legacy MBR + ; and contains one partition entry with an OSType set to 0xEE + ; reserving the entire space used on the disk by the GPT partitions, + ; including all headers. + +kPartActive EQU 0x80 ; active flag enabled +kPartInactive EQU 0x00 ; active flag disabled +kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: + ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B + +%ifdef FLOPPY +kDriveNumber EQU 0x00 +%else +kDriveNumber EQU 0x80 +%endif + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Format of GPT Partition Table Header +; + struc gpth +.Signature resb 8 +.Revision resb 4 +.HeaderSize resb 4 +.HeaderCRC32 resb 4 +.Reserved resb 4 +.MyLBA resb 8 +.AlternateLBA resb 8 +.FirstUsableLBA resb 8 +.LastUsableLBA resb 8 +.DiskGUID resb 16 +.PartitionEntryLBA resb 8 +.NumberOfPartitionEntries resb 4 +.SizeOfPartitionEntry resb 4 +.PartitionEntryArrayCRC32 resb 4 + endstruc + +; +; Format of GUID Partition Entry Array +; + struc gpta +.PartitionTypeGUID resb 16 +.UniquePartitionGUID resb 16 +.StartingLBA resb 8 +.EndingLBA resb 8 +.Attributes resb 8 +.PartitionName resb 72 + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%else +%define DebugChar(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + DebugChar('>') + +%if DEBUG + mov al, dl + call print_hex +%endif + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. + ; + + xor eax, eax + mov [my_lba], eax ; store LBA sector 0 for read_lba function + mov al, 2 ; load two sectors: MBR and LBA1 + mov bx, kMBRBuffer ; MBR load address + call load + jc error ; MBR load error + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov si, kMBRPartTable ; pointer to partition table + call find_boot ; will not return on success + +error: + LogString(boot_error_str) + +hang: + hlt + jmp hang + + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; DL = drive number (0x80 + unit number) +; SI = pointer to fdisk partition table. +; +; Clobber list: +; EAX, BX, EBP +; +find_boot: + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [si + part_size * kPartCount], kBootSignature + jne .exit ; boot signature not found. + + xor bx, bx ; BL will be set to 1 later in case of + ; Protective MBR has been found + + inc bh ; BH = 1. Giving a chance for a second pass + ; to boot an inactive but boot1h aware HFS+ partition + ; by scanning the MBR partition entries again. + +.start_scan: + mov cx, kPartCount ; number of partition entries per table + +.loop: + + ; + ; First scan through the partition table looking for the active + ; partition. + ; +%if DEBUG + mov al, [si + part.type] ; print partition type + call print_hex +%endif + + mov eax, [si + part.lba] ; save starting LBA of current + mov [my_lba], eax ; MBR partition entry for read_lba function + cmp BYTE [si + part.type], 0 ; unused partition? + je .continue ; skip to next entry + cmp BYTE [si + part.type], kPartTypePMBR ; check for Protective MBR + jne .testPass + + mov BYTE [si + part.bootid], kPartInactive ; found Protective MBR + ; clear active flag to make sure this protective + ; partition won't be used as a bootable partition. + mov bl, 1 ; Assume we can deal with GPT but try to scan + ; later if not found any other bootable partitions. + +.testPass: + cmp bh, 1 + jne .Pass2 + +.Pass1: + cmp BYTE [si + part.bootid], kPartActive ; In pass 1 we are walking on the standard path + ; by trying to hop on the active partition. + jne .continue + xor dh, dh ; Argument for loadBootSector to skip HFS+ partition + ; signature check. + jmp .tryToBoot + +.Pass2: + cmp BYTE [si + part.type], kPartTypeHFS ; In pass 2 we're going to find a HFS+ partition + ; equipped with boot1h in its boot record + ; regardless if it's active or not. + jne .continue + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + + DebugChar('*') + + ; + ; Found boot partition, read boot sector to memory. + ; + +.tryToBoot: + + call loadBootSector + jne .continue + jmp SHORT initBootLoader + +.continue: + add si, BYTE part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + + ; + ; Scanned all partitions but not found any with active flag enabled + ; Anyway if we found a protective MBR before we still have a chance + ; for a possible GPT Header at LBA 1 + ; + dec bl + jnz .switchPass2 ; didn't find Protective MBR before + call checkGPT + +.switchPass2: + ; + ; Switching to Pass 2 + ; try to find a boot1h aware HFS+ MBR partition + ; + dec bh + mov si, kMBRPartTable ; set SI to first entry of MBR Partition table + jz .start_scan ; scan again + +.exit: + ret ; Giving up. + + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; +initBootLoader: + +DebugChar('J') + +%if VERBOSE + LogString(done_str) +%endif + + jmp kBoot0LoadAddr + + + ; + ; Found Protective MBR Partition Type: 0xEE + ; Check for 'EFI PART' string at the beginning + ; of LBA1 for possible GPT Table Header + ; +checkGPT: + push bx + + mov di, kLBA1Buffer ; address of GUID Partition Table Header + cmp DWORD [di], kGPTSignatureLow ; looking for 'EFI ' + jne .exit ; not found. Giving up. + cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' + jne .exit ; not found. Giving up indeed. + mov si, di + + ; + ; Loading GUID Partition Table Array + ; + mov eax, [si + gpth.PartitionEntryLBA] ; starting LBA of GPT Array + mov [my_lba], eax ; save starting LBA for read_lba function + mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries + mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry + + ; + ; Calculating number of sectors we need to read for loading a GPT Array + ; +; push dx ; preserve DX (DL = BIOS drive unit number) +; mov ax, cx ; AX * BX = number of entries * size of one entry +; mul bx ; AX = total byte size of GPT Array +; pop dx ; restore DX +; shr ax, 9 ; convert to sectors + + ; + ; ... or: + ; Current GPT Arrays uses 128 partition entries each 128 bytes long + ; 128 entries * 128 bytes long GPT Array entries / 512 bytes per sector = 32 sectors + ; + mov al, 32 ; maximum sector size of GPT Array (hardcoded method) + + mov bx, kGPTABuffer + push bx ; push address of GPT Array + call load ; read GPT Array + pop si ; SI = address of GPT Array + pop bx ; BX = size of GUID Partition Array entry + jc error + + ; + ; Walk through GUID Partition Table Array + ; and load boot record from first available HFS+ partition. + ; + ; If it has boot signature (0xAA55) then jump to it + ; otherwise skip to next partition. + ; + +%if VERBOSE + LogString(gpt_str) +%endif + +.gpt_loop: + + mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] + + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type + je .gpt_ok + + ; + ; Turbo - also try EFI System Partition + ; + + cmp eax, kEFISystemGUID ; check current GUID Partition for EFI System Partition GUID type + jne .gpt_continue + +.gpt_ok: + ; + ; Found HFS Partition + ; + + mov eax, [si + gpta.StartingLBA] ; load boot sector from StartingLBA + mov [my_lba], eax + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + call loadBootSector + jne .gpt_continue ; no boot loader signature + + mov si, kMBRPartTable ; fake the current GUID Partition + mov [si + part.lba], eax ; as MBR style partition for boot1h + mov BYTE [si + part.type], kPartTypeHFS ; with HFS+ filesystem type (0xAF) + jmp SHORT initBootLoader + +.gpt_continue: + + add si, bx ; advance SI to next partition entry + loop .gpt_loop ; loop through all partition entries + +.exit: + pop bx + ret ; no more GUID partitions. Giving up. + + +;-------------------------------------------------------------------------- +; loadBootSector - Load boot sector +; +; Arguments: +; DL = drive number (0x80 + unit number) +; DH = 0 skip HFS+ partition signature checking +; 1 enable HFS+ partition signature checking +; [my_lba] = starting LBA. +; +; Returns: +; ZF = 0 if boot sector hasn't kBootSignature +; 1 if boot sector has kBootSignature +; +loadBootSector: + pusha + + mov al, 3 + mov bx, kBoot0LoadAddr + call load + jc error + + or dh, dh + jz .checkBootSignature + +.checkHFSSignature: + +%if VERBOSE + LogString(test_str) +%endif + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kBoot0LoadAddr + 2 * kSectorBytes] + cmp ax, kHFSPSignature ; 'H+' + je .checkBootSignature + cmp ax, kHFSPCaseSignature ; 'HX' + je .checkBootSignature + + ; + ; Looking for boot1f32 magic string. + ; + mov ax, [kBoot0LoadAddr + kFAT32BootCodeOffset] + cmp ax, kBoot1FAT32Magic + jne .exit + +.checkBootSignature: + ; + ; Check for boot block signature 0xAA55 + ; + mov di, bx + cmp WORD [di + kSectorBytes - 2], kBootSignature + +.exit: + + popa + + ret + + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop + +.exit: + pop cx + ret + + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + +; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + mov ecx, [my_lba] ; offset 8, lower 32-bit LBA + push ecx + push es ; offset 6, memory segment + push bx ; offset 4, memory offset + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + ; It pushes 2 bytes with a smaller opcode than if WORD was used + push BYTE 16 ; offset 0-1, packet size + + DebugChar('<') +%if DEBUG + mov eax, ecx + call print_hex +%endif + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + + +;-------------------------------------------------------------------------- +; Write a string with 'boot0: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pusha + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popa + + ret + + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +log_title_str db 10, 13, 'boot0: ', 0 +boot_error_str db 'error', 0 + +%if VERBOSE +gpt_str db 'GPT', 0 +test_str db 'test', 0 +done_str db 'done', 0 +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; According to EFI specification, maximum boot code size is 440 bytes +; + +; +; XXX - compilation errors with debug enabled (see comment above about nasm) +; Azi: boot0.s:808: error: TIMES value -111 is negative +; boot0.s:811: error: TIMES value -41 is negative +; +pad_boot: + times 440-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + + ABSOLUTE 0xE400 + +; +; In memory variables. +; +my_lba resd 1 ; Starting LBA for read_lba function + +; END diff --git a/i386/boot0/.svn/text-base/boot0hfs.s.svn-base b/i386/boot0/.svn/text-base/boot0hfs.s.svn-base new file mode 100644 index 0000000..c4a0308 --- /dev/null +++ b/i386/boot0/.svn/text-base/boot0hfs.s.svn-base @@ -0,0 +1,805 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + +; +; This version of boot0 implements hybrid GUID/MBR partition scheme support +; +; Written by Tams Kosrszky on 2008-03-10 +; +; Turbo added EFI System Partition boot support +; +; Added KillerJK's switchPass2 modifications +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT0_DEBUG + +; +; Set to 1 to enable verbose mode +; +VERBOSE EQU CONFIG_BOOT0_VERBOSE + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kLBA1Buffer EQU 0x1200 ; LBA1 - GPT Partition Table Header buffer address +kGPTABuffer EQU 0x1400 ; GUID Partition Entry Array buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kHFSPSignature EQU 'H+' ; HFS+ volume signature +kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code + + +kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature +kGPTSignatureHigh EQU 'PART' +kGUIDLastDwordOffs EQU 12 ; last 4 byte offset of a GUID + +kPartCount EQU 4 ; number of paritions per table +kPartTypeHFS EQU 0xaf ; HFS+ Filesystem type +kPartTypePMBR EQU 0xee ; On all GUID Partition Table disks a Protective MBR (PMBR) + ; in LBA 0 (that is, the first block) precedes the + ; GUID Partition Table Header to maintain compatibility + ; with existing tools that do not understand GPT partition structures. + ; The Protective MBR has the same format as a legacy MBR + ; and contains one partition entry with an OSType set to 0xEE + ; reserving the entire space used on the disk by the GPT partitions, + ; including all headers. + +kPartActive EQU 0x80 ; active flag enabled +kPartInactive EQU 0x00 ; active flag disabled +kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: + ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B + +%ifdef FLOPPY +kDriveNumber EQU 0x00 +%else +kDriveNumber EQU 0x80 +%endif + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Format of GPT Partition Table Header +; + struc gpth +.Signature resb 8 +.Revision resb 4 +.HeaderSize resb 4 +.HeaderCRC32 resb 4 +.Reserved resb 4 +.MyLBA resb 8 +.AlternateLBA resb 8 +.FirstUsableLBA resb 8 +.LastUsableLBA resb 8 +.DiskGUID resb 16 +.PartitionEntryLBA resb 8 +.NumberOfPartitionEntries resb 4 +.SizeOfPartitionEntry resb 4 +.PartitionEntryArrayCRC32 resb 4 + endstruc + +; +; Format of GUID Partition Entry Array +; + struc gpta +.PartitionTypeGUID resb 16 +.UniquePartitionGUID resb 16 +.StartingLBA resb 8 +.EndingLBA resb 8 +.Attributes resb 8 +.PartitionName resb 72 + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%else +%define DebugChar(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + DebugChar('>') + +%if DEBUG + mov al, dl + call print_hex +%endif + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. + ; + + xor eax, eax + mov [my_lba], eax ; store LBA sector 0 for read_lba function + mov al, 2 ; load two sectors: MBR and LBA1 + mov bx, kMBRBuffer ; MBR load address + call load + jc error ; MBR load error + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov si, kMBRPartTable ; pointer to partition table + call find_boot ; will not return on success + +error: + LogString(boot_error_str) + +hang: + hlt + jmp hang + + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; DL = drive number (0x80 + unit number) +; SI = pointer to fdisk partition table. +; +; Clobber list: +; EAX, BX, EBP +; +find_boot: + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [si + part_size * kPartCount], kBootSignature + jne .exit ; boot signature not found. + + xor bx, bx ; BL will be set to 1 later in case of + ; Protective MBR has been found + + inc bh ; BH = 1. Giving a chance for a second pass + ; to boot an inactive but boot1h aware HFS+ partition + ; by scanning the MBR partition entries again. + +.start_scan: + mov cx, kPartCount ; number of partition entries per table + +.loop: + + ; + ; First scan through the partition table looking for the active + ; partition. + ; +%if DEBUG + mov al, [si + part.type] ; print partition type + call print_hex +%endif + + mov eax, [si + part.lba] ; save starting LBA of current + mov [my_lba], eax ; MBR partition entry for read_lba function + cmp BYTE [si + part.type], 0 ; unused partition? + je .continue ; skip to next entry + cmp BYTE [si + part.type], kPartTypePMBR ; check for Protective MBR + jne .testPass + + mov BYTE [si + part.bootid], kPartInactive ; found Protective MBR + ; clear active flag to make sure this protective + ; partition won't be used as a bootable partition. + mov bl, 1 ; Assume we can deal with GPT but try to scan + ; later if not found any other bootable partitions. + +.testPass: + cmp bh, 1 + jne .Pass2 + +.Pass1: + cmp BYTE [si + part.type], kPartTypeHFS ; In pass 1 we're going to find a HFS+ partition + ; equipped with boot1h in its boot record + ; regardless if it's active or not. + jne .continue + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + + jmp .tryToBoot + +.Pass2: + cmp BYTE [si + part.bootid], kPartActive ; In pass 2 we are walking on the standard path + ; by trying to hop on the active partition. + jne .continue + xor dh, dh ; Argument for loadBootSector to skip HFS+ partition + ; signature check. + DebugChar('*') + + ; + ; Found boot partition, read boot sector to memory. + ; + +.tryToBoot: + + call loadBootSector + jne .continue + jmp SHORT initBootLoader + +.continue: + add si, BYTE part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + + ; + ; Scanned all partitions but not found any with active flag enabled + ; Anyway if we found a protective MBR before we still have a chance + ; for a possible GPT Header at LBA 1 + ; + dec bl + jnz .switchPass2 ; didn't find Protective MBR before + call checkGPT + +.switchPass2: + ; + ; Switching to Pass 2 + ; try to find a boot1h aware HFS+ MBR partition + ; + dec bh + mov si, kMBRPartTable ; set SI to first entry of MBR Partition table + jz .start_scan ; scan again + +.exit: + ret ; Giving up. + + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; +initBootLoader: + +DebugChar('J') + +%if VERBOSE + LogString(done_str) +%endif + + jmp kBoot0LoadAddr + + + ; + ; Found Protective MBR Partition Type: 0xEE + ; Check for 'EFI PART' string at the beginning + ; of LBA1 for possible GPT Table Header + ; +checkGPT: + push bx + + mov di, kLBA1Buffer ; address of GUID Partition Table Header + cmp DWORD [di], kGPTSignatureLow ; looking for 'EFI ' + jne .exit ; not found. Giving up. + cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' + jne .exit ; not found. Giving up indeed. + mov si, di + + ; + ; Loading GUID Partition Table Array + ; + mov eax, [si + gpth.PartitionEntryLBA] ; starting LBA of GPT Array + mov [my_lba], eax ; save starting LBA for read_lba function + mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries + mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry + + ; + ; Calculating number of sectors we need to read for loading a GPT Array + ; +; push dx ; preserve DX (DL = BIOS drive unit number) +; mov ax, cx ; AX * BX = number of entries * size of one entry +; mul bx ; AX = total byte size of GPT Array +; pop dx ; restore DX +; shr ax, 9 ; convert to sectors + + ; + ; ... or: + ; Current GPT Arrays uses 128 partition entries each 128 bytes long + ; 128 entries * 128 bytes long GPT Array entries / 512 bytes per sector = 32 sectors + ; + mov al, 32 ; maximum sector size of GPT Array (hardcoded method) + + mov bx, kGPTABuffer + push bx ; push address of GPT Array + call load ; read GPT Array + pop si ; SI = address of GPT Array + pop bx ; BX = size of GUID Partition Array entry + jc error + + ; + ; Walk through GUID Partition Table Array + ; and load boot record from first available HFS+ partition. + ; + ; If it has boot signature (0xAA55) then jump to it + ; otherwise skip to next partition. + ; + +%if VERBOSE + LogString(gpt_str) +%endif + +.gpt_loop: + + mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] + + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type + je .gpt_ok + + ; + ; Turbo - also try EFI System Partition + ; + + cmp eax, kEFISystemGUID ; check current GUID Partition for EFI System Partition GUID type + jne .gpt_continue + +.gpt_ok: + ; + ; Found HFS Partition + ; + + mov eax, [si + gpta.StartingLBA] ; load boot sector from StartingLBA + mov [my_lba], eax + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + call loadBootSector + jne .gpt_continue ; no boot loader signature + + mov si, kMBRPartTable ; fake the current GUID Partition + mov [si + part.lba], eax ; as MBR style partition for boot1h + mov BYTE [si + part.type], kPartTypeHFS ; with HFS+ filesystem type (0xAF) + jmp SHORT initBootLoader + +.gpt_continue: + + add si, bx ; advance SI to next partition entry + loop .gpt_loop ; loop through all partition entries + +.exit: + pop bx + ret ; no more GUID partitions. Giving up. + + +;-------------------------------------------------------------------------- +; loadBootSector - Load boot sector +; +; Arguments: +; DL = drive number (0x80 + unit number) +; DH = 0 skip HFS+ partition signature checking +; 1 enable HFS+ partition signature checking +; [my_lba] = starting LBA. +; +; Returns: +; ZF = 0 if boot sector hasn't kBootSignature +; 1 if boot sector has kBootSignature +; +loadBootSector: + pusha + + mov al, 3 + mov bx, kBoot0LoadAddr + call load + jc error + + or dh, dh + jz .checkBootSignature + +.checkHFSSignature: + +%if VERBOSE + LogString(test_str) +%endif + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kBoot0LoadAddr + 2 * kSectorBytes] + cmp ax, kHFSPSignature ; 'H+' + je .checkBootSignature + cmp ax, kHFSPCaseSignature ; 'HX' + je .checkBootSignature + + ; + ; Looking for boot1f32 magic string. + ; + mov ax, [kBoot0LoadAddr + kFAT32BootCodeOffset] + cmp ax, kBoot1FAT32Magic + jne .exit + +.checkBootSignature: + ; + ; Check for boot block signature 0xAA55 + ; + mov di, bx + cmp WORD [di + kSectorBytes - 2], kBootSignature + +.exit: + + popa + + ret + + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop + +.exit: + pop cx + ret + + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + +; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + mov ecx, [my_lba] ; offset 8, lower 32-bit LBA + push ecx + push es ; offset 6, memory segment + push bx ; offset 4, memory offset + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + ; It pushes 2 bytes with a smaller opcode than if WORD was used + push BYTE 16 ; offset 0-1, packet size + + DebugChar('<') +%if DEBUG + mov eax, ecx + call print_hex +%endif + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + + +;-------------------------------------------------------------------------- +; Write a string with 'boot0: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pusha + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popa + + ret + + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +log_title_str db 10, 13, 'boot0: ', 0 +boot_error_str db 'error', 0 + +%if VERBOSE +gpt_str db 'GPT', 0 +test_str db 'test', 0 +done_str db 'done', 0 +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; According to EFI specification, maximum boot code size is 440 bytes +; + +; +; XXX - compilation errors with debug enabled (see comment above about nasm) +; Azi: boot0.s:808: error: TIMES value -111 is negative +; boot0.s:811: error: TIMES value -41 is negative +; +pad_boot: + times 440-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + + ABSOLUTE 0xE400 + +; +; In memory variables. +; +my_lba resd 1 ; Starting LBA for read_lba function + +; END diff --git a/i386/boot0/.svn/text-base/boot0md.s.svn-base b/i386/boot0/.svn/text-base/boot0md.s.svn-base new file mode 100644 index 0000000..ca229bb --- /dev/null +++ b/i386/boot0/.svn/text-base/boot0md.s.svn-base @@ -0,0 +1,905 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + +; +; This version of boot0 implements hybrid GUID/MBR partition scheme support +; +; Written by Tams Kosrszky on 2008-03-10 +; +; Turbo added EFI System Partition boot support +; +; Added KillerJK's switchPass2 modifications +; +; dmazar: 10/7/2011 added scanning of all BIOS accessible drives: +; - iterates over all drives and searches for HSF bootable partition (with boot1h) +; and loads from it +; - if not found, itarates over drives again and searches for active partition and +; loads from it +; +; dmazar: 19/7/2011 +; Searching for bootable partition works in 3 passes now: +; +; - Pass1: +; - for the boot drive only: +; - searches MBR partition table for an active HSF+ bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT array and boots it +; - if still not found, then continues with Pass2 +; +; - Pass2: +; - iterates over all drives and for each drive: +; - searches MBR partition table for the first HSF+ bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT array and boots it +; - if still not found, then continues with the next drive +; - if all drives are searched and nothing found, then continues with Pass3 + +; - Pass3: +; - iterates over all drives and for each drive: +; - searches MBR partition table for the first active bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT and boots it +; - if still not found, then continues with the next drive +; - if all drives are searched and nothing found, finishes with "boot0: error" +; +; Bootable partition above means a partition with the boot sector signature (0xAA55) +; at the end of the partition boot sector. +; Booting partition means loading partition boot sector and passing control to partition +; boot loader (for example boot1h). +; Drives are searched in the order defined in the BIOS. Drive which is selected as the boot drive +; is searched first. +; +; If compiled with DEBUG=1 gives debug output: +; P - starting new pass +; D - starting disk scanning: MBR and then GPT +; p - checking MBR partition entry +; t - testing MBR partition +; l - MBR or GPT partition satisfies conditions - loading partition boot sector +; G - found GPT +; + - stage 1 booter loaded, press a key to continue +; E - error +; + +; +; Set to 1 to enable obscure debug messages. +; +;DEBUG EQU CONFIG_BOOT0_DEBUG +DEBUG EQU 0 +NOT_USED EQU 0 ; exclude print_hex - no space for it + +; +; Verbose - write boot0 messages +; No space for verbose and debug in the same time +; +;VERBOSE EQU CONFIG_BOOT0_VERBOSE +%if DEBUG +VERBOSE EQU 0 +%else +VERBOSE EQU 1 +%endif + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kLBA1Buffer EQU 0x1200 ; LBA1 - GPT Partition Table Header buffer address +kGPTABuffer EQU 0x1400 ; GUID Partition Entry Array buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kHFSPSignature EQU 'H+' ; HFS+ volume signature +kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code + + +kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature +kGPTSignatureHigh EQU 'PART' +kGUIDLastDwordOffs EQU 12 ; last 4 byte offset of a GUID + +kPartCount EQU 4 ; number of paritions per table +kPartTypeHFS EQU 0xaf ; HFS+ Filesystem type +kPartTypePMBR EQU 0xee ; On all GUID Partition Table disks a Protective MBR (PMBR) + ; in LBA 0 (that is, the first block) precedes the + ; GUID Partition Table Header to maintain compatibility + ; with existing tools that do not understand GPT partition structures. + ; The Protective MBR has the same format as a legacy MBR + ; and contains one partition entry with an OSType set to 0xEE + ; reserving the entire space used on the disk by the GPT partitions, + ; including all headers. + +kPartActive EQU 0x80 ; active flag enabled +kPartInactive EQU 0x00 ; active flag disabled +kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: + ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B + +%ifdef FLOPPY +kDriveNumber EQU 0x00 +%else +kDriveNumber EQU 0x80 +%endif + +kPass1 EQU 3 ; Pass1 +kPass2 EQU 2 ; Pass2 +kPass3 EQU 1 ; Pass3 + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Format of GPT Partition Table Header +; + struc gpth +.Signature resb 8 +.Revision resb 4 +.HeaderSize resb 4 +.HeaderCRC32 resb 4 +.Reserved resb 4 +.MyLBA resb 8 +.AlternateLBA resb 8 +.FirstUsableLBA resb 8 +.LastUsableLBA resb 8 +.DiskGUID resb 16 +.PartitionEntryLBA resb 8 +.NumberOfPartitionEntries resb 4 +.SizeOfPartitionEntry resb 4 +.PartitionEntryArrayCRC32 resb 4 + endstruc + +; +; Format of GUID Partition Entry Array +; + struc gpta +.PartitionTypeGUID resb 16 +.UniquePartitionGUID resb 16 +.StartingLBA resb 8 +.EndingLBA resb 8 +.Attributes resb 8 +.PartitionName resb 72 + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%macro DebugPauseMacro 0 + call getc +%endmacro + +%macro LogStringMacro 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%define DebugPause DebugPauseMacro +%else +%define DebugChar(x) +%define DebugPause +%endif + +%if VERBOSE +%define LogString(x) LogStringMacro x +%else +%define LogString(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + ; + ; BH is pass counter + ; Pass1 BH=3, Pass2 BH=2, Pass3 BH=1 + ; + mov bh, kPass1 ; BH = 3. Pass1 + +pass_loop: + + DebugChar('P') ; starting new pass + push dx ; save dl (boot drive) for next pass + + +.scan_drive: + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. + ; + + push bx ; save BH (scan pass counter) + xor eax, eax + mov [my_lba], eax ; store LBA sector 0 for read_lba function + mov al, 2 ; load two sectors: MBR and LBA1 + mov bx, kMBRBuffer ; MBR load address + call load + pop bx ; restore BH + jc .next_pass ; MBR load error - normally because we scanned all drives + + DebugChar('D') ; starting disk scanning + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov si, kMBRPartTable ; pointer to partition table + call find_boot ; will not return on success + + ; if returns - booter partition is not found + + ; skip scanning of all drives in Pass1 + cmp bh, kPass1 + je .next_pass + + ; try next drive + ; if next drive does not exists - will break on the MBR load error above + inc dl + jmp short .scan_drive + + +.next_pass: + ; all drives scanned - move to next pass + pop dx ; restore orig boot drive + dec bh ; decrement scan pass counter + jnz pass_loop ; if not zero - exec next pass + + ; we ran all passes - nothing found - error + +error: + DebugChar('E') + DebugPause + LogString(boot_error_str) + +hang: + hlt + jmp short hang + + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; DL = drive number (0x80 + unit number) +; SI = pointer to fdisk partition table. +; BH = pass counter +; +; Clobber list: +; EAX, BX, EBP +; +find_boot: + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [si + part_size * kPartCount], kBootSignature + jne .exit ; boot signature not found. + + xor bl, bl ; BL will be set to 1 later in case of + ; Protective MBR has been found + +.start_scan: + mov cx, kPartCount ; number of partition entries per table + +.loop: + + DebugChar('p') ; checking partition entry + mov eax, [si + part.lba] ; save starting LBA of current + mov [my_lba], eax ; MBR partition entry for read_lba function + cmp BYTE [si + part.type], 0 ; unused partition? + je .continue ; skip to next entry + cmp BYTE [si + part.type], kPartTypePMBR ; check for Protective MBR + jne .testPass + + mov BYTE [si + part.bootid], kPartInactive ; found Protective MBR + ; clear active flag to make sure this protective + ; partition won't be used as a bootable partition. + mov bl, 1 ; Assume we can deal with GPT but try to scan + ; later if not found any other bootable partitions. + + ; + ; The following code between .testPass and .tryToBoot performs checking for 3 passes: + ; Pass1 (BH=3) if (partition is HFS+ and active) then { DH=1; call loadBootSector} + ; Pass2 (BH=2) if (partition is HFS+) then { DH=1; call loadBootSector} + ; Pass3 (BH=1) if (partition is active) then { DH=0; call loadBootSector} + ; + ; BH is Pass counter + ; DH is argument to loadBootSector + ; = 0 - skip HFS+ partition signature check + ; = 1 - check for HFS+ partition signature + ; + ; Code may be harder to read because I tried to optimized it for minimum size. + ; + +.testPass: + DebugChar('t') ; testing partition + xor dh, dh ; DH=0 This will be used in Pass3 (partition is active, not HFS+). + + cmp bh, kPass3 ; If this is Pass3 (BH=1) + je .checkActive ; check for active flag only. + +.checkHFS: + ; We are in Pass1 (BH=3) or Pass2 (BH=2). + inc dh ; DH=1 + cmp BYTE [si + part.type], kPartTypeHFS ; Check for a HFS+ partition. + jne .continue + + cmp bh, kPass2 ; It's HFS+. That's enough checking for Pass2, + je .tryToBoot ; so try to boot (with DH=1) + ; Pass1 needs active flag check also ... + +.checkActive: + ; We are in Pass1 or Pass3 + cmp BYTE [si + part.bootid], kPartActive ; Check if partition is Active + jne .continue + + + ; + ; Found boot partition, read boot sector to memory. + ; + +.tryToBoot: + + call loadBootSector + jne .continue + jmp SHORT initBootLoader + +.continue: + add si, BYTE part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + + ; + ; Scanned all partitions but not found any with active flag enabled + ; Anyway if we found a protective MBR before we still have a chance + ; for a possible GPT Header at LBA 1 + ; + dec bl + jnz .exit ; didn't find Protective MBR before + call checkGPT + +.exit: + ret ; Giving up. + + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; +initBootLoader: + + DebugChar('+') + DebugPause + + LogString(done_str) + + jmp kBoot0LoadAddr + + + ; + ; Found Protective MBR Partition Type: 0xEE + ; Check for 'EFI PART' string at the beginning + ; of LBA1 for possible GPT Table Header + ; +checkGPT: + push bx + + mov di, kLBA1Buffer ; address of GUID Partition Table Header + cmp DWORD [di], kGPTSignatureLow ; looking for 'EFI ' + jne .exit ; not found. Giving up. + cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' + jne .exit ; not found. Giving up indeed. + + DebugChar('G') ; found GPT + mov si, di + + ; + ; Loading GUID Partition Table Array + ; + mov eax, [si + gpth.PartitionEntryLBA] ; starting LBA of GPT Array + mov [my_lba], eax ; save starting LBA for read_lba function + mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries + mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry + + ; + ; Calculating number of sectors we need to read for loading a GPT Array + ; +; push dx ; preserve DX (DL = BIOS drive unit number) +; mov ax, cx ; AX * BX = number of entries * size of one entry +; mul bx ; AX = total byte size of GPT Array +; pop dx ; restore DX +; shr ax, 9 ; convert to sectors + + ; + ; ... or: + ; Current GPT Arrays uses 128 partition entries each 128 bytes long + ; 128 entries * 128 bytes long GPT Array entries / 512 bytes per sector = 32 sectors + ; + mov al, 32 ; maximum sector size of GPT Array (hardcoded method) + + mov bx, kGPTABuffer + push bx ; push address of GPT Array + call load ; read GPT Array + pop si ; SI = address of GPT Array + pop bx ; BX = size of GUID Partition Array entry + ;jc error + jc .exit ; dmazar's change to continue disk scanning if encountering invalid LBA. + + ; + ; Walk through GUID Partition Table Array + ; and load boot record from first available HFS+ partition. + ; + ; If it has boot signature (0xAA55) then jump to it + ; otherwise skip to next partition. + ; + + LogString(gpt_str) + +.gpt_loop: + + mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] + + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type + je .gpt_ok + + ; + ; Turbo - also try EFI System Partition + ; + + cmp eax, kEFISystemGUID ; check current GUID Partition for EFI System Partition GUID type + jne .gpt_continue + +.gpt_ok: + ; + ; Found HFS Partition + ; + + mov eax, [si + gpta.StartingLBA] ; load boot sector from StartingLBA + mov [my_lba], eax + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + call loadBootSector + jne .gpt_continue ; no boot loader signature + + mov si, kMBRPartTable ; fake the current GUID Partition + mov [si + part.lba], eax ; as MBR style partition for boot1h + mov BYTE [si + part.type], kPartTypeHFS ; with HFS+ filesystem type (0xAF) + jmp SHORT initBootLoader + +.gpt_continue: + + add si, bx ; advance SI to next partition entry + loop .gpt_loop ; loop through all partition entries + +.exit: + pop bx + ret ; no more GUID partitions. Giving up. + + +;-------------------------------------------------------------------------- +; loadBootSector - Load boot sector +; +; Arguments: +; DL = drive number (0x80 + unit number) +; DH = 0 skip HFS+ partition signature checking +; 1 enable HFS+ partition signature checking +; [my_lba] = starting LBA. +; +; Returns: +; ZF = 0 if boot sector hasn't kBootSignature +; 1 if boot sector has kBootSignature +; +loadBootSector: + pusha + + DebugChar('l') ; loading partition boot sector + + mov al, 3 + mov bx, kBoot0LoadAddr + call load + ;jc error + or dl, dl ; to set flag Z=0 ; dmazar's change to continue disk scanning if encountering invalid LBA. + jc .exit ; dmazar's change to continue disk scanning if encountering invalid LBA. + + or dh, dh + jz .checkBootSignature + +.checkHFSSignature: + + ;LogString(test_str) ; dmazar: removed to get space + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kBoot0LoadAddr + 2 * kSectorBytes] + cmp ax, kHFSPSignature ; 'H+' + je .checkBootSignature + cmp ax, kHFSPCaseSignature ; 'HX' + je .checkBootSignature + + ; + ; Looking for boot1f32 magic string. + ; + mov ax, [kBoot0LoadAddr + kFAT32BootCodeOffset] + cmp ax, kBoot1FAT32Magic + jne .exit + +.checkBootSignature: + ; + ; Check for boot block signature 0xAA55 + ; + mov di, bx + cmp WORD [di + kSectorBytes - 2], kBootSignature + +.exit: + + popa + + ret + + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop + +.exit: + pop cx + ret + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + +; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + mov ecx, [my_lba] ; offset 8, lower 32-bit LBA + push ecx + push es ; offset 6, memory segment + push bx ; offset 4, memory offset + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + ; It pushes 2 bytes with a smaller opcode than if WORD was used + push BYTE 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot0: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pusha + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popa + + ret + + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + +%endif ;VERBOSE + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + +%if NOT_USED + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +%endif ; NOT_USED + + + +%if VERBOSE + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +log_title_str db 10, 13, 'boot0:', 0 +boot_error_str db 'error', 0 + +gpt_str db 'GPT', 0 +;test_str db 'test', 0 +done_str db 'done', 0 + +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; According to EFI specification, maximum boot code size is 440 bytes +; + +pad_boot: + times 440-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + + ABSOLUTE 0xE400 + +; +; In memory variables. +; +my_lba resd 1 ; Starting LBA for read_lba function + +; END diff --git a/i386/boot0/.svn/text-base/chain0.s.svn-base b/i386/boot0/.svn/text-base/chain0.s.svn-base new file mode 100644 index 0000000..689fbbc --- /dev/null +++ b/i386/boot0/.svn/text-base/chain0.s.svn-base @@ -0,0 +1,700 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT0_DEBUG + +; +; Set to 1 to support loading the partition booter (boot1) from a +; logical partition. +; +EXT_PART_SUPPORT EQU 1 + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kExtBuffer EQU 0x1200 ; EXT boot block buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset +kExtPartTable EQU kExtBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kPartCount EQU 4 ; number of paritions per table +kPartTypeBoot EQU 0xab ; boot2 partition type +kPartTypeUFS EQU 0xa8 ; UFS partition type +kPartTypeHFS EQU 0xaf ; HFS partition type +kPartTypeExtDOS EQU 0x05 ; DOS extended partition type +kPartTypeExtWin EQU 0x0f ; Windows extended partition type +kPartTypeExtLinux EQU 0x85 ; Linux extended partition type + +kPartActive EQU 0x80 + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid: resb 1 ; bootable or not +.head: resb 1 ; starting head, sector, cylinder +.sect: resb 1 ; +.cyl: resb 1 ; +.type: resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect: resb 1 ; +.endcyl: resb 1 ; +.lba: resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%else +%define DebugChar(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG 0xE000 ; must match kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + ; + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp 0:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + DebugChar('>') + +.loop: + +%if DEBUG + mov al, dl + call print_hex +%endif + + ; + ; Clear various flags in memory. + ; + xor eax, eax + mov [ebios_lba], eax ; clear EBIOS LBA offset + mov [ebios_present], al ; clear EBIOS support flag + + ; + ; Check if EBIOS is supported for this hard drive. + ; + mov ah, 0x41 ; Function 0x41 + mov bx, 0x55AA ; check signature + int 0x13 + + ; + ; If successful, the return values are as follows: + ; + ; carry = 0 + ; ah = major version of EBIOS extensions (0x21 = version 1.1) + ; al = altered + ; bx = 0xAA55 + ; cx = support bits. bit 0 must be set for function 0x42. + ; + jc .ebios_check_done + cmp bx, 0xAA55 ; check BX = 0xAA55 + jnz .ebios_check_done + test cl, 0x01 ; check enhanced drive read support + setnz [ebios_present] ; EBIOS supported, set flag + DebugChar('E') ; EBIOS supported +.ebios_check_done: + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer. + ; + mov al, 1 ; load one sector + xor bx, bx + mov es, bx ; MBR load segment = 0 + mov bx, kMBRBuffer ; MBR load address + mov si, bx ; pointer to fake partition entry + mov WORD [si], 0x0000 ; CHS DX: head = 0 + mov WORD [si + 2], 0x0001 ; CHS CX: cylinder = 0, sector = 1 + mov DWORD [si + part.lba], 0x00000000 ; LBA sector 0 + + call load + jc .next_drive ; MBR load error + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov di, kMBRPartTable ; pointer to partition table + mov ah, 0 ; initial nesting level is 0 + call find_boot ; will not return on success + +.next_drive: + inc dl ; next drive number + test dl, 0x4 ; went through all 4 drives? + jz .loop ; not yet, loop again + + mov si, boot_error_str + call print_string + +hang: + jmp SHORT hang + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; AH = recursion nesting level +; DL = drive number (0x80 + unit number) +; DI = pointer to fdisk partition table. +; +; Clobber list: +; AX, BX, EBP +; +find_boot: + push cx ; preserve CX and SI + push si + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [di + part_size * kPartCount], kBootSignature + jne NEAR .exit ; boot signature not found + + mov si, di ; make SI a pointer to partition table + mov cx, kPartCount ; number of partition entries per table + +.loop: + ; + ; First scan through the partition table looking for the active + ; partition. Postpone walking the extended partition chain for + ; the second pass. Do not merge the two without changing the + ; buffering scheme used to store extended partition tables. + ; +%if DEBUG + mov al, ah ; indent based on nesting level + call print_spaces + mov al, [si + part.type] ; print partition type + call print_hex +%endif + + cmp BYTE [si + part.type], kPartTypeBoot + je .found + cmp BYTE [si + part.type], kPartTypeUFS + je .found + cmp BYTE [si + part.type], kPartTypeHFS + je .found + + jmp .continue + +.found: + DebugChar('*') + + ; + ; Found boot partition, read boot sector to memory. + ; + mov al, 1 + mov bx, kBoot0Segment + mov es, bx + mov bx, kBoot0LoadAddr + call load + jc .continue ; load error, keep looking? + + ; + ; Check signature + ; + cmp WORD [bx + 510], kBootSignature + jne NEAR .exit ; boot signature not found + + DebugChar('&') + + ; + ; Fix up absolute block location in partition record. + ; + mov eax, [si + part.lba] + add eax, [ebios_lba] + mov [si + part.lba], eax + + DebugChar('%') + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; + jmp kBoot0Segment:kBoot0LoadAddr + +.continue: + add si, part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + +%if EXT_PART_SUPPORT + ; + ; No primary (or logical) boot partition found in the current + ; partition table. Restart and look for extended partitions. + ; + mov si, di ; make SI a pointer to partition table + mov cx, kPartCount ; number of partition entries per table + +.ext_loop: + + mov al, [si + part.type] ; AL <- partition type + + cmp al, kPartTypeExtDOS ; Extended DOS + je .ext_load + + cmp al, kPartTypeExtWin ; Extended Windows(95) + je .ext_load + + cmp al, kPartTypeExtLinux ; Extended Linux + je .ext_load + +.ext_continue: + ; + ; Advance si to the next partition entry in the extended + ; partition table. + ; + add si, part_size ; advance SI to next partition entry + loop .ext_loop ; loop through all partition entries + jmp .exit ; boot partition not found + +.ext_load: + ; + ; Setup the arguments for the load function call to bring the + ; extended partition table into memory. + ; Remember that SI points to the extended partition entry. + ; + mov al, 1 ; read 1 sector + xor bx, bx + mov es, bx ; es = 0 + mov bx, kExtBuffer ; load extended boot sector + call load + jc .ext_continue ; load error + + ; + ; The LBA address of all extended partitions is relative based + ; on the LBA address of the extended partition in the MBR, or + ; the extended partition at the head of the chain. Thus it is + ; necessary to save the LBA address of the first extended partition. + ; + or ah, ah + jnz .ext_find_boot + mov ebp, [si + part.lba] + mov [ebios_lba], ebp + +.ext_find_boot: + ; + ; Call find_boot recursively to scan through the extended partition + ; table. Load DI with a pointer to the extended table in memory. + ; + inc ah ; increment recursion level + mov di, kExtPartTable ; partition table pointer + call find_boot ; recursion... + ;dec ah + + ; + ; Since there is an "unwritten" rule that limits each partition table + ; to have 0 or 1 extended partitions, there is no point in looking for + ; any additional extended partition entries at this point. There is no + ; boot partition linked beyond the extended partition that was loaded + ; above. + ; + +%endif ; EXT_PART_SUPPORT + +.exit: + ; + ; Boot partition not found. Giving up. + ; + DebugChar('X') + pop si + pop cx + ret + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; SI = pointer to the partition entry. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + test BYTE [ebios_present], 1 + jz .chs + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop +.chs: + mov cx, 5 ; load retry count +.chs_loop: + call read_chs ; use INT13/F2 + jnc .exit + loop .chs_loop + +.exit: + DebugChar('R') + pop cx + ret + +;-------------------------------------------------------------------------- +; read_chs - Read sectors from a partition using CHS addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; SI = pointer to the partition entry. +; +; Returns: +; CF = 0 success +; 1 error +; +read_chs: + pushad ; save all registers + + ; + ; Read the CHS start values from the partition entry. + ; + mov dh, [ si + part.head ] ; drive head + mov cx, [ si + part.sect ] ; drive sector + cylinder + + ; + ; INT13 Func 2 - Read Disk Sectors + ; + ; Arguments: + ; AH = 2 + ; AL = number of sectors to read + ; CH = lowest 8 bits of the 10-bit cylinder number + ; CL = bits 6 & 7: cylinder number bits 8 and 9 + ; bits 0 - 5: starting sector number (1-63) + ; DH = starting head number (0 to 255) + ; DL = drive number (80h + drive unit) + ; es:bx = pointer where to place sectors read from disk + ; + ; Returns: + ; AH = return status (sucess is 0) + ; AL = burst error length if ah=0x11 (ECC corrected) + ; carry = 0 success + ; 1 error + ; + mov ah, 0x02 ; Func 2 + int 0x13 ; INT 13 + jnc .exit + + DebugChar('r') ; indicate INT13/F2 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; SI = pointer to the partition entry. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + mov ecx, [ebios_lba] ; offset 8, lower 32-bit LBA + add ecx, [si + part.lba] + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + +%if DEBUG +;-------------------------------------------------------------------------- +; Write a variable number of spaces to the console. +; +; Arguments: +; AL = number to spaces. +; +print_spaces: + pusha + xor cx, cx + mov cl, al ; use CX as the loop counter + mov al, ' ' ; character to print +.loop: + jcxz .exit + call print_char + loop .loop +.exit: + popa + ret +%endif + +;-------------------------------------------------------------------------- +; Write the byte value to the console in hex. +; +; Arguments: +; AL = Value to be displayed in hex. +; +print_hex: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +boot_error_str db 10, 13, 'Chain booting error', 0 + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; In memory variables. +; +ebios_lba dd 0 ; starting LBA of the intial extended partition. +ebios_present db 0 ; 1 if EBIOS is supported, 0 otherwise. + +pad_boot: + times 446-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + +; END diff --git a/i386/boot0/Cconfig b/i386/boot0/Cconfig new file mode 100644 index 0000000..45e7663 --- /dev/null +++ b/i386/boot0/Cconfig @@ -0,0 +1,20 @@ +config BOOT0_DEBUG + bool "boot0 debug support" + default n + help + Say Y here if you want to enable boot0 debug messages. + On an error, boot0 will print one of the following: + > start_reloc was called + * Boot partition found + J Jumping to partition booter + < read_lba + R INT13/F42 error + +config BOOT0_VERBOSE + bool "boot0 verbose support" + default y + help + Say Y here if you want to enable boot0 verbose messages. + boot0 will print out status updates as it executes to + notify the user of progress in the initial boot sequence. + When in doubt, say "Y". diff --git a/i386/boot0/Makefile b/i386/boot0/Makefile new file mode 100644 index 0000000..15f699a --- /dev/null +++ b/i386/boot0/Makefile @@ -0,0 +1,26 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/boot0 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = boot0 +include ${SRCROOT}/Make.rules + +DIRS_NEEDED = $(SYMROOT) + +OBJS = boot0 boot0hfs boot0md chain0 +OBJS := $(addprefix $(SYMROOT)/, $(OBJS)) + +all: $(DIRS_NEEDED) $(OBJS) + +$(OBJS): $(SRCROOT)/autoconf.inc + @echo "\t[NASM] $(@F)" + @$(NASM) $(@F).s -o $@ + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(OBJS) diff --git a/i386/boot0/boot0.s b/i386/boot0/boot0.s new file mode 100644 index 0000000..42d1b08 --- /dev/null +++ b/i386/boot0/boot0.s @@ -0,0 +1,805 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + +; +; This version of boot0 implements hybrid GUID/MBR partition scheme support +; +; Written by Tams Kosrszky on 2008-03-10 +; +; Turbo added EFI System Partition boot support +; +; Added KillerJK's switchPass2 modifications +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT0_DEBUG + +; +; Set to 1 to enable verbose mode +; +VERBOSE EQU CONFIG_BOOT0_VERBOSE + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kLBA1Buffer EQU 0x1200 ; LBA1 - GPT Partition Table Header buffer address +kGPTABuffer EQU 0x1400 ; GUID Partition Entry Array buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kHFSPSignature EQU 'H+' ; HFS+ volume signature +kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code + + +kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature +kGPTSignatureHigh EQU 'PART' +kGUIDLastDwordOffs EQU 12 ; last 4 byte offset of a GUID + +kPartCount EQU 4 ; number of paritions per table +kPartTypeHFS EQU 0xaf ; HFS+ Filesystem type +kPartTypePMBR EQU 0xee ; On all GUID Partition Table disks a Protective MBR (PMBR) + ; in LBA 0 (that is, the first block) precedes the + ; GUID Partition Table Header to maintain compatibility + ; with existing tools that do not understand GPT partition structures. + ; The Protective MBR has the same format as a legacy MBR + ; and contains one partition entry with an OSType set to 0xEE + ; reserving the entire space used on the disk by the GPT partitions, + ; including all headers. + +kPartActive EQU 0x80 ; active flag enabled +kPartInactive EQU 0x00 ; active flag disabled +kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: + ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B + +%ifdef FLOPPY +kDriveNumber EQU 0x00 +%else +kDriveNumber EQU 0x80 +%endif + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Format of GPT Partition Table Header +; + struc gpth +.Signature resb 8 +.Revision resb 4 +.HeaderSize resb 4 +.HeaderCRC32 resb 4 +.Reserved resb 4 +.MyLBA resb 8 +.AlternateLBA resb 8 +.FirstUsableLBA resb 8 +.LastUsableLBA resb 8 +.DiskGUID resb 16 +.PartitionEntryLBA resb 8 +.NumberOfPartitionEntries resb 4 +.SizeOfPartitionEntry resb 4 +.PartitionEntryArrayCRC32 resb 4 + endstruc + +; +; Format of GUID Partition Entry Array +; + struc gpta +.PartitionTypeGUID resb 16 +.UniquePartitionGUID resb 16 +.StartingLBA resb 8 +.EndingLBA resb 8 +.Attributes resb 8 +.PartitionName resb 72 + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%else +%define DebugChar(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + DebugChar('>') + +%if DEBUG + mov al, dl + call print_hex +%endif + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. + ; + + xor eax, eax + mov [my_lba], eax ; store LBA sector 0 for read_lba function + mov al, 2 ; load two sectors: MBR and LBA1 + mov bx, kMBRBuffer ; MBR load address + call load + jc error ; MBR load error + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov si, kMBRPartTable ; pointer to partition table + call find_boot ; will not return on success + +error: + LogString(boot_error_str) + +hang: + hlt + jmp hang + + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; DL = drive number (0x80 + unit number) +; SI = pointer to fdisk partition table. +; +; Clobber list: +; EAX, BX, EBP +; +find_boot: + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [si + part_size * kPartCount], kBootSignature + jne .exit ; boot signature not found. + + xor bx, bx ; BL will be set to 1 later in case of + ; Protective MBR has been found + + inc bh ; BH = 1. Giving a chance for a second pass + ; to boot an inactive but boot1h aware HFS+ partition + ; by scanning the MBR partition entries again. + +.start_scan: + mov cx, kPartCount ; number of partition entries per table + +.loop: + + ; + ; First scan through the partition table looking for the active + ; partition. + ; +%if DEBUG + mov al, [si + part.type] ; print partition type + call print_hex +%endif + + mov eax, [si + part.lba] ; save starting LBA of current + mov [my_lba], eax ; MBR partition entry for read_lba function + cmp BYTE [si + part.type], 0 ; unused partition? + je .continue ; skip to next entry + cmp BYTE [si + part.type], kPartTypePMBR ; check for Protective MBR + jne .testPass + + mov BYTE [si + part.bootid], kPartInactive ; found Protective MBR + ; clear active flag to make sure this protective + ; partition won't be used as a bootable partition. + mov bl, 1 ; Assume we can deal with GPT but try to scan + ; later if not found any other bootable partitions. + +.testPass: + cmp bh, 1 + jne .Pass2 + +.Pass1: + cmp BYTE [si + part.bootid], kPartActive ; In pass 1 we are walking on the standard path + ; by trying to hop on the active partition. + jne .continue + xor dh, dh ; Argument for loadBootSector to skip HFS+ partition + ; signature check. + jmp .tryToBoot + +.Pass2: + cmp BYTE [si + part.type], kPartTypeHFS ; In pass 2 we're going to find a HFS+ partition + ; equipped with boot1h in its boot record + ; regardless if it's active or not. + jne .continue + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + + DebugChar('*') + + ; + ; Found boot partition, read boot sector to memory. + ; + +.tryToBoot: + + call loadBootSector + jne .continue + jmp SHORT initBootLoader + +.continue: + add si, BYTE part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + + ; + ; Scanned all partitions but not found any with active flag enabled + ; Anyway if we found a protective MBR before we still have a chance + ; for a possible GPT Header at LBA 1 + ; + dec bl + jnz .switchPass2 ; didn't find Protective MBR before + call checkGPT + +.switchPass2: + ; + ; Switching to Pass 2 + ; try to find a boot1h aware HFS+ MBR partition + ; + dec bh + mov si, kMBRPartTable ; set SI to first entry of MBR Partition table + jz .start_scan ; scan again + +.exit: + ret ; Giving up. + + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; +initBootLoader: + +DebugChar('J') + +%if VERBOSE + LogString(done_str) +%endif + + jmp kBoot0LoadAddr + + + ; + ; Found Protective MBR Partition Type: 0xEE + ; Check for 'EFI PART' string at the beginning + ; of LBA1 for possible GPT Table Header + ; +checkGPT: + push bx + + mov di, kLBA1Buffer ; address of GUID Partition Table Header + cmp DWORD [di], kGPTSignatureLow ; looking for 'EFI ' + jne .exit ; not found. Giving up. + cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' + jne .exit ; not found. Giving up indeed. + mov si, di + + ; + ; Loading GUID Partition Table Array + ; + mov eax, [si + gpth.PartitionEntryLBA] ; starting LBA of GPT Array + mov [my_lba], eax ; save starting LBA for read_lba function + mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries + mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry + + ; + ; Calculating number of sectors we need to read for loading a GPT Array + ; +; push dx ; preserve DX (DL = BIOS drive unit number) +; mov ax, cx ; AX * BX = number of entries * size of one entry +; mul bx ; AX = total byte size of GPT Array +; pop dx ; restore DX +; shr ax, 9 ; convert to sectors + + ; + ; ... or: + ; Current GPT Arrays uses 128 partition entries each 128 bytes long + ; 128 entries * 128 bytes long GPT Array entries / 512 bytes per sector = 32 sectors + ; + mov al, 32 ; maximum sector size of GPT Array (hardcoded method) + + mov bx, kGPTABuffer + push bx ; push address of GPT Array + call load ; read GPT Array + pop si ; SI = address of GPT Array + pop bx ; BX = size of GUID Partition Array entry + jc error + + ; + ; Walk through GUID Partition Table Array + ; and load boot record from first available HFS+ partition. + ; + ; If it has boot signature (0xAA55) then jump to it + ; otherwise skip to next partition. + ; + +%if VERBOSE + LogString(gpt_str) +%endif + +.gpt_loop: + + mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] + + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type + je .gpt_ok + + ; + ; Turbo - also try EFI System Partition + ; + + cmp eax, kEFISystemGUID ; check current GUID Partition for EFI System Partition GUID type + jne .gpt_continue + +.gpt_ok: + ; + ; Found HFS Partition + ; + + mov eax, [si + gpta.StartingLBA] ; load boot sector from StartingLBA + mov [my_lba], eax + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + call loadBootSector + jne .gpt_continue ; no boot loader signature + + mov si, kMBRPartTable ; fake the current GUID Partition + mov [si + part.lba], eax ; as MBR style partition for boot1h + mov BYTE [si + part.type], kPartTypeHFS ; with HFS+ filesystem type (0xAF) + jmp SHORT initBootLoader + +.gpt_continue: + + add si, bx ; advance SI to next partition entry + loop .gpt_loop ; loop through all partition entries + +.exit: + pop bx + ret ; no more GUID partitions. Giving up. + + +;-------------------------------------------------------------------------- +; loadBootSector - Load boot sector +; +; Arguments: +; DL = drive number (0x80 + unit number) +; DH = 0 skip HFS+ partition signature checking +; 1 enable HFS+ partition signature checking +; [my_lba] = starting LBA. +; +; Returns: +; ZF = 0 if boot sector hasn't kBootSignature +; 1 if boot sector has kBootSignature +; +loadBootSector: + pusha + + mov al, 3 + mov bx, kBoot0LoadAddr + call load + jc error + + or dh, dh + jz .checkBootSignature + +.checkHFSSignature: + +%if VERBOSE + LogString(test_str) +%endif + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kBoot0LoadAddr + 2 * kSectorBytes] + cmp ax, kHFSPSignature ; 'H+' + je .checkBootSignature + cmp ax, kHFSPCaseSignature ; 'HX' + je .checkBootSignature + + ; + ; Looking for boot1f32 magic string. + ; + mov ax, [kBoot0LoadAddr + kFAT32BootCodeOffset] + cmp ax, kBoot1FAT32Magic + jne .exit + +.checkBootSignature: + ; + ; Check for boot block signature 0xAA55 + ; + mov di, bx + cmp WORD [di + kSectorBytes - 2], kBootSignature + +.exit: + + popa + + ret + + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop + +.exit: + pop cx + ret + + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + +; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + mov ecx, [my_lba] ; offset 8, lower 32-bit LBA + push ecx + push es ; offset 6, memory segment + push bx ; offset 4, memory offset + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + ; It pushes 2 bytes with a smaller opcode than if WORD was used + push BYTE 16 ; offset 0-1, packet size + + DebugChar('<') +%if DEBUG + mov eax, ecx + call print_hex +%endif + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + + +;-------------------------------------------------------------------------- +; Write a string with 'boot0: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pusha + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popa + + ret + + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +log_title_str db 10, 13, 'boot0: ', 0 +boot_error_str db 'error', 0 + +%if VERBOSE +gpt_str db 'GPT', 0 +test_str db 'test', 0 +done_str db 'done', 0 +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; According to EFI specification, maximum boot code size is 440 bytes +; + +; +; XXX - compilation errors with debug enabled (see comment above about nasm) +; Azi: boot0.s:808: error: TIMES value -111 is negative +; boot0.s:811: error: TIMES value -41 is negative +; +pad_boot: + times 440-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + + ABSOLUTE 0xE400 + +; +; In memory variables. +; +my_lba resd 1 ; Starting LBA for read_lba function + +; END diff --git a/i386/boot0/boot0hfs.s b/i386/boot0/boot0hfs.s new file mode 100644 index 0000000..c4a0308 --- /dev/null +++ b/i386/boot0/boot0hfs.s @@ -0,0 +1,805 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + +; +; This version of boot0 implements hybrid GUID/MBR partition scheme support +; +; Written by Tams Kosrszky on 2008-03-10 +; +; Turbo added EFI System Partition boot support +; +; Added KillerJK's switchPass2 modifications +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT0_DEBUG + +; +; Set to 1 to enable verbose mode +; +VERBOSE EQU CONFIG_BOOT0_VERBOSE + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kLBA1Buffer EQU 0x1200 ; LBA1 - GPT Partition Table Header buffer address +kGPTABuffer EQU 0x1400 ; GUID Partition Entry Array buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kHFSPSignature EQU 'H+' ; HFS+ volume signature +kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code + + +kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature +kGPTSignatureHigh EQU 'PART' +kGUIDLastDwordOffs EQU 12 ; last 4 byte offset of a GUID + +kPartCount EQU 4 ; number of paritions per table +kPartTypeHFS EQU 0xaf ; HFS+ Filesystem type +kPartTypePMBR EQU 0xee ; On all GUID Partition Table disks a Protective MBR (PMBR) + ; in LBA 0 (that is, the first block) precedes the + ; GUID Partition Table Header to maintain compatibility + ; with existing tools that do not understand GPT partition structures. + ; The Protective MBR has the same format as a legacy MBR + ; and contains one partition entry with an OSType set to 0xEE + ; reserving the entire space used on the disk by the GPT partitions, + ; including all headers. + +kPartActive EQU 0x80 ; active flag enabled +kPartInactive EQU 0x00 ; active flag disabled +kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: + ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B + +%ifdef FLOPPY +kDriveNumber EQU 0x00 +%else +kDriveNumber EQU 0x80 +%endif + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Format of GPT Partition Table Header +; + struc gpth +.Signature resb 8 +.Revision resb 4 +.HeaderSize resb 4 +.HeaderCRC32 resb 4 +.Reserved resb 4 +.MyLBA resb 8 +.AlternateLBA resb 8 +.FirstUsableLBA resb 8 +.LastUsableLBA resb 8 +.DiskGUID resb 16 +.PartitionEntryLBA resb 8 +.NumberOfPartitionEntries resb 4 +.SizeOfPartitionEntry resb 4 +.PartitionEntryArrayCRC32 resb 4 + endstruc + +; +; Format of GUID Partition Entry Array +; + struc gpta +.PartitionTypeGUID resb 16 +.UniquePartitionGUID resb 16 +.StartingLBA resb 8 +.EndingLBA resb 8 +.Attributes resb 8 +.PartitionName resb 72 + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%else +%define DebugChar(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + DebugChar('>') + +%if DEBUG + mov al, dl + call print_hex +%endif + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. + ; + + xor eax, eax + mov [my_lba], eax ; store LBA sector 0 for read_lba function + mov al, 2 ; load two sectors: MBR and LBA1 + mov bx, kMBRBuffer ; MBR load address + call load + jc error ; MBR load error + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov si, kMBRPartTable ; pointer to partition table + call find_boot ; will not return on success + +error: + LogString(boot_error_str) + +hang: + hlt + jmp hang + + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; DL = drive number (0x80 + unit number) +; SI = pointer to fdisk partition table. +; +; Clobber list: +; EAX, BX, EBP +; +find_boot: + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [si + part_size * kPartCount], kBootSignature + jne .exit ; boot signature not found. + + xor bx, bx ; BL will be set to 1 later in case of + ; Protective MBR has been found + + inc bh ; BH = 1. Giving a chance for a second pass + ; to boot an inactive but boot1h aware HFS+ partition + ; by scanning the MBR partition entries again. + +.start_scan: + mov cx, kPartCount ; number of partition entries per table + +.loop: + + ; + ; First scan through the partition table looking for the active + ; partition. + ; +%if DEBUG + mov al, [si + part.type] ; print partition type + call print_hex +%endif + + mov eax, [si + part.lba] ; save starting LBA of current + mov [my_lba], eax ; MBR partition entry for read_lba function + cmp BYTE [si + part.type], 0 ; unused partition? + je .continue ; skip to next entry + cmp BYTE [si + part.type], kPartTypePMBR ; check for Protective MBR + jne .testPass + + mov BYTE [si + part.bootid], kPartInactive ; found Protective MBR + ; clear active flag to make sure this protective + ; partition won't be used as a bootable partition. + mov bl, 1 ; Assume we can deal with GPT but try to scan + ; later if not found any other bootable partitions. + +.testPass: + cmp bh, 1 + jne .Pass2 + +.Pass1: + cmp BYTE [si + part.type], kPartTypeHFS ; In pass 1 we're going to find a HFS+ partition + ; equipped with boot1h in its boot record + ; regardless if it's active or not. + jne .continue + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + + jmp .tryToBoot + +.Pass2: + cmp BYTE [si + part.bootid], kPartActive ; In pass 2 we are walking on the standard path + ; by trying to hop on the active partition. + jne .continue + xor dh, dh ; Argument for loadBootSector to skip HFS+ partition + ; signature check. + DebugChar('*') + + ; + ; Found boot partition, read boot sector to memory. + ; + +.tryToBoot: + + call loadBootSector + jne .continue + jmp SHORT initBootLoader + +.continue: + add si, BYTE part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + + ; + ; Scanned all partitions but not found any with active flag enabled + ; Anyway if we found a protective MBR before we still have a chance + ; for a possible GPT Header at LBA 1 + ; + dec bl + jnz .switchPass2 ; didn't find Protective MBR before + call checkGPT + +.switchPass2: + ; + ; Switching to Pass 2 + ; try to find a boot1h aware HFS+ MBR partition + ; + dec bh + mov si, kMBRPartTable ; set SI to first entry of MBR Partition table + jz .start_scan ; scan again + +.exit: + ret ; Giving up. + + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; +initBootLoader: + +DebugChar('J') + +%if VERBOSE + LogString(done_str) +%endif + + jmp kBoot0LoadAddr + + + ; + ; Found Protective MBR Partition Type: 0xEE + ; Check for 'EFI PART' string at the beginning + ; of LBA1 for possible GPT Table Header + ; +checkGPT: + push bx + + mov di, kLBA1Buffer ; address of GUID Partition Table Header + cmp DWORD [di], kGPTSignatureLow ; looking for 'EFI ' + jne .exit ; not found. Giving up. + cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' + jne .exit ; not found. Giving up indeed. + mov si, di + + ; + ; Loading GUID Partition Table Array + ; + mov eax, [si + gpth.PartitionEntryLBA] ; starting LBA of GPT Array + mov [my_lba], eax ; save starting LBA for read_lba function + mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries + mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry + + ; + ; Calculating number of sectors we need to read for loading a GPT Array + ; +; push dx ; preserve DX (DL = BIOS drive unit number) +; mov ax, cx ; AX * BX = number of entries * size of one entry +; mul bx ; AX = total byte size of GPT Array +; pop dx ; restore DX +; shr ax, 9 ; convert to sectors + + ; + ; ... or: + ; Current GPT Arrays uses 128 partition entries each 128 bytes long + ; 128 entries * 128 bytes long GPT Array entries / 512 bytes per sector = 32 sectors + ; + mov al, 32 ; maximum sector size of GPT Array (hardcoded method) + + mov bx, kGPTABuffer + push bx ; push address of GPT Array + call load ; read GPT Array + pop si ; SI = address of GPT Array + pop bx ; BX = size of GUID Partition Array entry + jc error + + ; + ; Walk through GUID Partition Table Array + ; and load boot record from first available HFS+ partition. + ; + ; If it has boot signature (0xAA55) then jump to it + ; otherwise skip to next partition. + ; + +%if VERBOSE + LogString(gpt_str) +%endif + +.gpt_loop: + + mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] + + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type + je .gpt_ok + + ; + ; Turbo - also try EFI System Partition + ; + + cmp eax, kEFISystemGUID ; check current GUID Partition for EFI System Partition GUID type + jne .gpt_continue + +.gpt_ok: + ; + ; Found HFS Partition + ; + + mov eax, [si + gpta.StartingLBA] ; load boot sector from StartingLBA + mov [my_lba], eax + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + call loadBootSector + jne .gpt_continue ; no boot loader signature + + mov si, kMBRPartTable ; fake the current GUID Partition + mov [si + part.lba], eax ; as MBR style partition for boot1h + mov BYTE [si + part.type], kPartTypeHFS ; with HFS+ filesystem type (0xAF) + jmp SHORT initBootLoader + +.gpt_continue: + + add si, bx ; advance SI to next partition entry + loop .gpt_loop ; loop through all partition entries + +.exit: + pop bx + ret ; no more GUID partitions. Giving up. + + +;-------------------------------------------------------------------------- +; loadBootSector - Load boot sector +; +; Arguments: +; DL = drive number (0x80 + unit number) +; DH = 0 skip HFS+ partition signature checking +; 1 enable HFS+ partition signature checking +; [my_lba] = starting LBA. +; +; Returns: +; ZF = 0 if boot sector hasn't kBootSignature +; 1 if boot sector has kBootSignature +; +loadBootSector: + pusha + + mov al, 3 + mov bx, kBoot0LoadAddr + call load + jc error + + or dh, dh + jz .checkBootSignature + +.checkHFSSignature: + +%if VERBOSE + LogString(test_str) +%endif + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kBoot0LoadAddr + 2 * kSectorBytes] + cmp ax, kHFSPSignature ; 'H+' + je .checkBootSignature + cmp ax, kHFSPCaseSignature ; 'HX' + je .checkBootSignature + + ; + ; Looking for boot1f32 magic string. + ; + mov ax, [kBoot0LoadAddr + kFAT32BootCodeOffset] + cmp ax, kBoot1FAT32Magic + jne .exit + +.checkBootSignature: + ; + ; Check for boot block signature 0xAA55 + ; + mov di, bx + cmp WORD [di + kSectorBytes - 2], kBootSignature + +.exit: + + popa + + ret + + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop + +.exit: + pop cx + ret + + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + +; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + mov ecx, [my_lba] ; offset 8, lower 32-bit LBA + push ecx + push es ; offset 6, memory segment + push bx ; offset 4, memory offset + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + ; It pushes 2 bytes with a smaller opcode than if WORD was used + push BYTE 16 ; offset 0-1, packet size + + DebugChar('<') +%if DEBUG + mov eax, ecx + call print_hex +%endif + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + + +;-------------------------------------------------------------------------- +; Write a string with 'boot0: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pusha + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popa + + ret + + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +log_title_str db 10, 13, 'boot0: ', 0 +boot_error_str db 'error', 0 + +%if VERBOSE +gpt_str db 'GPT', 0 +test_str db 'test', 0 +done_str db 'done', 0 +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; According to EFI specification, maximum boot code size is 440 bytes +; + +; +; XXX - compilation errors with debug enabled (see comment above about nasm) +; Azi: boot0.s:808: error: TIMES value -111 is negative +; boot0.s:811: error: TIMES value -41 is negative +; +pad_boot: + times 440-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + + ABSOLUTE 0xE400 + +; +; In memory variables. +; +my_lba resd 1 ; Starting LBA for read_lba function + +; END diff --git a/i386/boot0/boot0md.s b/i386/boot0/boot0md.s new file mode 100644 index 0000000..ca229bb --- /dev/null +++ b/i386/boot0/boot0md.s @@ -0,0 +1,905 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + +; +; This version of boot0 implements hybrid GUID/MBR partition scheme support +; +; Written by Tams Kosrszky on 2008-03-10 +; +; Turbo added EFI System Partition boot support +; +; Added KillerJK's switchPass2 modifications +; +; dmazar: 10/7/2011 added scanning of all BIOS accessible drives: +; - iterates over all drives and searches for HSF bootable partition (with boot1h) +; and loads from it +; - if not found, itarates over drives again and searches for active partition and +; loads from it +; +; dmazar: 19/7/2011 +; Searching for bootable partition works in 3 passes now: +; +; - Pass1: +; - for the boot drive only: +; - searches MBR partition table for an active HSF+ bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT array and boots it +; - if still not found, then continues with Pass2 +; +; - Pass2: +; - iterates over all drives and for each drive: +; - searches MBR partition table for the first HSF+ bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT array and boots it +; - if still not found, then continues with the next drive +; - if all drives are searched and nothing found, then continues with Pass3 + +; - Pass3: +; - iterates over all drives and for each drive: +; - searches MBR partition table for the first active bootable partition and boots it +; - if not found and disk is actually GPT, then searches for the first HFS+ bootable +; partition (or EFI with boot1f32) in the GPT and boots it +; - if still not found, then continues with the next drive +; - if all drives are searched and nothing found, finishes with "boot0: error" +; +; Bootable partition above means a partition with the boot sector signature (0xAA55) +; at the end of the partition boot sector. +; Booting partition means loading partition boot sector and passing control to partition +; boot loader (for example boot1h). +; Drives are searched in the order defined in the BIOS. Drive which is selected as the boot drive +; is searched first. +; +; If compiled with DEBUG=1 gives debug output: +; P - starting new pass +; D - starting disk scanning: MBR and then GPT +; p - checking MBR partition entry +; t - testing MBR partition +; l - MBR or GPT partition satisfies conditions - loading partition boot sector +; G - found GPT +; + - stage 1 booter loaded, press a key to continue +; E - error +; + +; +; Set to 1 to enable obscure debug messages. +; +;DEBUG EQU CONFIG_BOOT0_DEBUG +DEBUG EQU 0 +NOT_USED EQU 0 ; exclude print_hex - no space for it + +; +; Verbose - write boot0 messages +; No space for verbose and debug in the same time +; +;VERBOSE EQU CONFIG_BOOT0_VERBOSE +%if DEBUG +VERBOSE EQU 0 +%else +VERBOSE EQU 1 +%endif + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kLBA1Buffer EQU 0x1200 ; LBA1 - GPT Partition Table Header buffer address +kGPTABuffer EQU 0x1400 ; GUID Partition Entry Array buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kHFSPSignature EQU 'H+' ; HFS+ volume signature +kHFSPCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kFAT32BootCodeOffset EQU 0x5a ; offset of boot code in FAT32 boot sector +kBoot1FAT32Magic EQU 'BO' ; Magic string to detect our boot1f32 code + + +kGPTSignatureLow EQU 'EFI ' ; GUID Partition Table Header Signature +kGPTSignatureHigh EQU 'PART' +kGUIDLastDwordOffs EQU 12 ; last 4 byte offset of a GUID + +kPartCount EQU 4 ; number of paritions per table +kPartTypeHFS EQU 0xaf ; HFS+ Filesystem type +kPartTypePMBR EQU 0xee ; On all GUID Partition Table disks a Protective MBR (PMBR) + ; in LBA 0 (that is, the first block) precedes the + ; GUID Partition Table Header to maintain compatibility + ; with existing tools that do not understand GPT partition structures. + ; The Protective MBR has the same format as a legacy MBR + ; and contains one partition entry with an OSType set to 0xEE + ; reserving the entire space used on the disk by the GPT partitions, + ; including all headers. + +kPartActive EQU 0x80 ; active flag enabled +kPartInactive EQU 0x00 ; active flag disabled +kHFSGUID EQU 0x48465300 ; first 4 bytes of Apple HFS Partition Type GUID. +kAppleGUID EQU 0xACEC4365 ; last 4 bytes of Apple type GUIDs. +kEFISystemGUID EQU 0x3BC93EC9 ; last 4 bytes of EFI System Partition Type GUID: + ; C12A7328-F81F-11D2-BA4B-00A0C93EC93B + +%ifdef FLOPPY +kDriveNumber EQU 0x00 +%else +kDriveNumber EQU 0x80 +%endif + +kPass1 EQU 3 ; Pass1 +kPass2 EQU 2 ; Pass2 +kPass3 EQU 1 ; Pass3 + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Format of GPT Partition Table Header +; + struc gpth +.Signature resb 8 +.Revision resb 4 +.HeaderSize resb 4 +.HeaderCRC32 resb 4 +.Reserved resb 4 +.MyLBA resb 8 +.AlternateLBA resb 8 +.FirstUsableLBA resb 8 +.LastUsableLBA resb 8 +.DiskGUID resb 16 +.PartitionEntryLBA resb 8 +.NumberOfPartitionEntries resb 4 +.SizeOfPartitionEntry resb 4 +.PartitionEntryArrayCRC32 resb 4 + endstruc + +; +; Format of GUID Partition Entry Array +; + struc gpta +.PartitionTypeGUID resb 16 +.UniquePartitionGUID resb 16 +.StartingLBA resb 8 +.EndingLBA resb 8 +.Attributes resb 8 +.PartitionName resb 72 + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%macro DebugPauseMacro 0 + call getc +%endmacro + +%macro LogStringMacro 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%define DebugPause DebugPauseMacro +%else +%define DebugChar(x) +%define DebugPause +%endif + +%if VERBOSE +%define LogString(x) LogStringMacro x +%else +%define LogString(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + ; + ; BH is pass counter + ; Pass1 BH=3, Pass2 BH=2, Pass3 BH=1 + ; + mov bh, kPass1 ; BH = 3. Pass1 + +pass_loop: + + DebugChar('P') ; starting new pass + push dx ; save dl (boot drive) for next pass + + +.scan_drive: + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer and LBA1 to kGPTBuffer. + ; + + push bx ; save BH (scan pass counter) + xor eax, eax + mov [my_lba], eax ; store LBA sector 0 for read_lba function + mov al, 2 ; load two sectors: MBR and LBA1 + mov bx, kMBRBuffer ; MBR load address + call load + pop bx ; restore BH + jc .next_pass ; MBR load error - normally because we scanned all drives + + DebugChar('D') ; starting disk scanning + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov si, kMBRPartTable ; pointer to partition table + call find_boot ; will not return on success + + ; if returns - booter partition is not found + + ; skip scanning of all drives in Pass1 + cmp bh, kPass1 + je .next_pass + + ; try next drive + ; if next drive does not exists - will break on the MBR load error above + inc dl + jmp short .scan_drive + + +.next_pass: + ; all drives scanned - move to next pass + pop dx ; restore orig boot drive + dec bh ; decrement scan pass counter + jnz pass_loop ; if not zero - exec next pass + + ; we ran all passes - nothing found - error + +error: + DebugChar('E') + DebugPause + LogString(boot_error_str) + +hang: + hlt + jmp short hang + + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; DL = drive number (0x80 + unit number) +; SI = pointer to fdisk partition table. +; BH = pass counter +; +; Clobber list: +; EAX, BX, EBP +; +find_boot: + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [si + part_size * kPartCount], kBootSignature + jne .exit ; boot signature not found. + + xor bl, bl ; BL will be set to 1 later in case of + ; Protective MBR has been found + +.start_scan: + mov cx, kPartCount ; number of partition entries per table + +.loop: + + DebugChar('p') ; checking partition entry + mov eax, [si + part.lba] ; save starting LBA of current + mov [my_lba], eax ; MBR partition entry for read_lba function + cmp BYTE [si + part.type], 0 ; unused partition? + je .continue ; skip to next entry + cmp BYTE [si + part.type], kPartTypePMBR ; check for Protective MBR + jne .testPass + + mov BYTE [si + part.bootid], kPartInactive ; found Protective MBR + ; clear active flag to make sure this protective + ; partition won't be used as a bootable partition. + mov bl, 1 ; Assume we can deal with GPT but try to scan + ; later if not found any other bootable partitions. + + ; + ; The following code between .testPass and .tryToBoot performs checking for 3 passes: + ; Pass1 (BH=3) if (partition is HFS+ and active) then { DH=1; call loadBootSector} + ; Pass2 (BH=2) if (partition is HFS+) then { DH=1; call loadBootSector} + ; Pass3 (BH=1) if (partition is active) then { DH=0; call loadBootSector} + ; + ; BH is Pass counter + ; DH is argument to loadBootSector + ; = 0 - skip HFS+ partition signature check + ; = 1 - check for HFS+ partition signature + ; + ; Code may be harder to read because I tried to optimized it for minimum size. + ; + +.testPass: + DebugChar('t') ; testing partition + xor dh, dh ; DH=0 This will be used in Pass3 (partition is active, not HFS+). + + cmp bh, kPass3 ; If this is Pass3 (BH=1) + je .checkActive ; check for active flag only. + +.checkHFS: + ; We are in Pass1 (BH=3) or Pass2 (BH=2). + inc dh ; DH=1 + cmp BYTE [si + part.type], kPartTypeHFS ; Check for a HFS+ partition. + jne .continue + + cmp bh, kPass2 ; It's HFS+. That's enough checking for Pass2, + je .tryToBoot ; so try to boot (with DH=1) + ; Pass1 needs active flag check also ... + +.checkActive: + ; We are in Pass1 or Pass3 + cmp BYTE [si + part.bootid], kPartActive ; Check if partition is Active + jne .continue + + + ; + ; Found boot partition, read boot sector to memory. + ; + +.tryToBoot: + + call loadBootSector + jne .continue + jmp SHORT initBootLoader + +.continue: + add si, BYTE part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + + ; + ; Scanned all partitions but not found any with active flag enabled + ; Anyway if we found a protective MBR before we still have a chance + ; for a possible GPT Header at LBA 1 + ; + dec bl + jnz .exit ; didn't find Protective MBR before + call checkGPT + +.exit: + ret ; Giving up. + + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; +initBootLoader: + + DebugChar('+') + DebugPause + + LogString(done_str) + + jmp kBoot0LoadAddr + + + ; + ; Found Protective MBR Partition Type: 0xEE + ; Check for 'EFI PART' string at the beginning + ; of LBA1 for possible GPT Table Header + ; +checkGPT: + push bx + + mov di, kLBA1Buffer ; address of GUID Partition Table Header + cmp DWORD [di], kGPTSignatureLow ; looking for 'EFI ' + jne .exit ; not found. Giving up. + cmp DWORD [di + 4], kGPTSignatureHigh ; looking for 'PART' + jne .exit ; not found. Giving up indeed. + + DebugChar('G') ; found GPT + mov si, di + + ; + ; Loading GUID Partition Table Array + ; + mov eax, [si + gpth.PartitionEntryLBA] ; starting LBA of GPT Array + mov [my_lba], eax ; save starting LBA for read_lba function + mov cx, [si + gpth.NumberOfPartitionEntries] ; number of GUID Partition Array entries + mov bx, [si + gpth.SizeOfPartitionEntry] ; size of GUID Partition Array entry + push bx ; push size of GUID Partition entry + + ; + ; Calculating number of sectors we need to read for loading a GPT Array + ; +; push dx ; preserve DX (DL = BIOS drive unit number) +; mov ax, cx ; AX * BX = number of entries * size of one entry +; mul bx ; AX = total byte size of GPT Array +; pop dx ; restore DX +; shr ax, 9 ; convert to sectors + + ; + ; ... or: + ; Current GPT Arrays uses 128 partition entries each 128 bytes long + ; 128 entries * 128 bytes long GPT Array entries / 512 bytes per sector = 32 sectors + ; + mov al, 32 ; maximum sector size of GPT Array (hardcoded method) + + mov bx, kGPTABuffer + push bx ; push address of GPT Array + call load ; read GPT Array + pop si ; SI = address of GPT Array + pop bx ; BX = size of GUID Partition Array entry + ;jc error + jc .exit ; dmazar's change to continue disk scanning if encountering invalid LBA. + + ; + ; Walk through GUID Partition Table Array + ; and load boot record from first available HFS+ partition. + ; + ; If it has boot signature (0xAA55) then jump to it + ; otherwise skip to next partition. + ; + + LogString(gpt_str) + +.gpt_loop: + + mov eax, [si + gpta.PartitionTypeGUID + kGUIDLastDwordOffs] + + cmp eax, kAppleGUID ; check current GUID Partition for Apple's GUID type + je .gpt_ok + + ; + ; Turbo - also try EFI System Partition + ; + + cmp eax, kEFISystemGUID ; check current GUID Partition for EFI System Partition GUID type + jne .gpt_continue + +.gpt_ok: + ; + ; Found HFS Partition + ; + + mov eax, [si + gpta.StartingLBA] ; load boot sector from StartingLBA + mov [my_lba], eax + mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature. + call loadBootSector + jne .gpt_continue ; no boot loader signature + + mov si, kMBRPartTable ; fake the current GUID Partition + mov [si + part.lba], eax ; as MBR style partition for boot1h + mov BYTE [si + part.type], kPartTypeHFS ; with HFS+ filesystem type (0xAF) + jmp SHORT initBootLoader + +.gpt_continue: + + add si, bx ; advance SI to next partition entry + loop .gpt_loop ; loop through all partition entries + +.exit: + pop bx + ret ; no more GUID partitions. Giving up. + + +;-------------------------------------------------------------------------- +; loadBootSector - Load boot sector +; +; Arguments: +; DL = drive number (0x80 + unit number) +; DH = 0 skip HFS+ partition signature checking +; 1 enable HFS+ partition signature checking +; [my_lba] = starting LBA. +; +; Returns: +; ZF = 0 if boot sector hasn't kBootSignature +; 1 if boot sector has kBootSignature +; +loadBootSector: + pusha + + DebugChar('l') ; loading partition boot sector + + mov al, 3 + mov bx, kBoot0LoadAddr + call load + ;jc error + or dl, dl ; to set flag Z=0 ; dmazar's change to continue disk scanning if encountering invalid LBA. + jc .exit ; dmazar's change to continue disk scanning if encountering invalid LBA. + + or dh, dh + jz .checkBootSignature + +.checkHFSSignature: + + ;LogString(test_str) ; dmazar: removed to get space + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kBoot0LoadAddr + 2 * kSectorBytes] + cmp ax, kHFSPSignature ; 'H+' + je .checkBootSignature + cmp ax, kHFSPCaseSignature ; 'HX' + je .checkBootSignature + + ; + ; Looking for boot1f32 magic string. + ; + mov ax, [kBoot0LoadAddr + kFAT32BootCodeOffset] + cmp ax, kBoot1FAT32Magic + jne .exit + +.checkBootSignature: + ; + ; Check for boot block signature 0xAA55 + ; + mov di, bx + cmp WORD [di + kSectorBytes - 2], kBootSignature + +.exit: + + popa + + ret + + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop + +.exit: + pop cx + ret + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; [my_lba] = starting LBA. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + +; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + mov ecx, [my_lba] ; offset 8, lower 32-bit LBA + push ecx + push es ; offset 6, memory segment + push bx ; offset 4, memory offset + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + ; It pushes 2 bytes with a smaller opcode than if WORD was used + push BYTE 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot0: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pusha + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popa + + ret + + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + +%endif ;VERBOSE + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret +%endif ;DEBUG + +%if NOT_USED + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +%endif ; NOT_USED + + + +%if VERBOSE + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +log_title_str db 10, 13, 'boot0:', 0 +boot_error_str db 'error', 0 + +gpt_str db 'GPT', 0 +;test_str db 'test', 0 +done_str db 'done', 0 + +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; According to EFI specification, maximum boot code size is 440 bytes +; + +pad_boot: + times 440-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + + ABSOLUTE 0xE400 + +; +; In memory variables. +; +my_lba resd 1 ; Starting LBA for read_lba function + +; END diff --git a/i386/boot0/chain0.s b/i386/boot0/chain0.s new file mode 100644 index 0000000..689fbbc --- /dev/null +++ b/i386/boot0/chain0.s @@ -0,0 +1,700 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Boot Loader: boot0 +; +; A small boot sector program written in x86 assembly whose only +; responsibility is to locate the active partition, load the +; partition booter into memory, and jump to the booter's entry point. +; It leaves the boot drive in DL and a pointer to the partition entry in SI. +; +; This boot loader must be placed in the Master Boot Record. +; +; In order to coexist with a fdisk partition table (64 bytes), and +; leave room for a two byte signature (0xAA55) in the end, boot0 is +; restricted to 446 bytes (512 - 64 - 2). If boot0 did not have to +; live in the MBR, then we would have 510 bytes to work with. +; +; boot0 is always loaded by the BIOS or another booter to 0:7C00h. +; +; This code is written for the NASM assembler. +; nasm boot0.s -o boot0 + + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT0_DEBUG + +; +; Set to 1 to support loading the partition booter (boot1) from a +; logical partition. +; +EXT_PART_SUPPORT EQU 1 + +; +; Various constants. +; +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address + +kMBRBuffer EQU 0x1000 ; MBR buffer address +kExtBuffer EQU 0x1200 ; EXT boot block buffer address + +kPartTableOffset EQU 0x1be +kMBRPartTable EQU kMBRBuffer + kPartTableOffset +kExtPartTable EQU kExtBuffer + kPartTableOffset + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kPartCount EQU 4 ; number of paritions per table +kPartTypeBoot EQU 0xab ; boot2 partition type +kPartTypeUFS EQU 0xa8 ; UFS partition type +kPartTypeHFS EQU 0xaf ; HFS partition type +kPartTypeExtDOS EQU 0x05 ; DOS extended partition type +kPartTypeExtWin EQU 0x0f ; Windows extended partition type +kPartTypeExtLinux EQU 0x85 ; Linux extended partition type + +kPartActive EQU 0x80 + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid: resb 1 ; bootable or not +.head: resb 1 ; starting head, sector, cylinder +.sect: resb 1 ; +.cyl: resb 1 ; +.type: resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect: resb 1 ; +.endcyl: resb 1 ; +.lba: resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +; +; Macros. +; +%macro DebugCharMacro 1 + mov al, %1 + call print_char +%endmacro + +%if DEBUG +%define DebugChar(x) DebugCharMacro x +%else +%define DebugChar(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG 0xE000 ; must match kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + ; + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp 0:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + + DebugChar('>') + +.loop: + +%if DEBUG + mov al, dl + call print_hex +%endif + + ; + ; Clear various flags in memory. + ; + xor eax, eax + mov [ebios_lba], eax ; clear EBIOS LBA offset + mov [ebios_present], al ; clear EBIOS support flag + + ; + ; Check if EBIOS is supported for this hard drive. + ; + mov ah, 0x41 ; Function 0x41 + mov bx, 0x55AA ; check signature + int 0x13 + + ; + ; If successful, the return values are as follows: + ; + ; carry = 0 + ; ah = major version of EBIOS extensions (0x21 = version 1.1) + ; al = altered + ; bx = 0xAA55 + ; cx = support bits. bit 0 must be set for function 0x42. + ; + jc .ebios_check_done + cmp bx, 0xAA55 ; check BX = 0xAA55 + jnz .ebios_check_done + test cl, 0x01 ; check enhanced drive read support + setnz [ebios_present] ; EBIOS supported, set flag + DebugChar('E') ; EBIOS supported +.ebios_check_done: + + ; + ; Since this code may not always reside in the MBR, always start by + ; loading the MBR to kMBRBuffer. + ; + mov al, 1 ; load one sector + xor bx, bx + mov es, bx ; MBR load segment = 0 + mov bx, kMBRBuffer ; MBR load address + mov si, bx ; pointer to fake partition entry + mov WORD [si], 0x0000 ; CHS DX: head = 0 + mov WORD [si + 2], 0x0001 ; CHS CX: cylinder = 0, sector = 1 + mov DWORD [si + part.lba], 0x00000000 ; LBA sector 0 + + call load + jc .next_drive ; MBR load error + + ; + ; Look for the booter partition in the MBR partition table, + ; which is at offset kMBRPartTable. + ; + mov di, kMBRPartTable ; pointer to partition table + mov ah, 0 ; initial nesting level is 0 + call find_boot ; will not return on success + +.next_drive: + inc dl ; next drive number + test dl, 0x4 ; went through all 4 drives? + jz .loop ; not yet, loop again + + mov si, boot_error_str + call print_string + +hang: + jmp SHORT hang + +;-------------------------------------------------------------------------- +; Find the active (boot) partition and load the booter from the partition. +; +; Arguments: +; AH = recursion nesting level +; DL = drive number (0x80 + unit number) +; DI = pointer to fdisk partition table. +; +; Clobber list: +; AX, BX, EBP +; +find_boot: + push cx ; preserve CX and SI + push si + + ; + ; Check for boot block signature 0xAA55 following the 4 partition + ; entries. + ; + cmp WORD [di + part_size * kPartCount], kBootSignature + jne NEAR .exit ; boot signature not found + + mov si, di ; make SI a pointer to partition table + mov cx, kPartCount ; number of partition entries per table + +.loop: + ; + ; First scan through the partition table looking for the active + ; partition. Postpone walking the extended partition chain for + ; the second pass. Do not merge the two without changing the + ; buffering scheme used to store extended partition tables. + ; +%if DEBUG + mov al, ah ; indent based on nesting level + call print_spaces + mov al, [si + part.type] ; print partition type + call print_hex +%endif + + cmp BYTE [si + part.type], kPartTypeBoot + je .found + cmp BYTE [si + part.type], kPartTypeUFS + je .found + cmp BYTE [si + part.type], kPartTypeHFS + je .found + + jmp .continue + +.found: + DebugChar('*') + + ; + ; Found boot partition, read boot sector to memory. + ; + mov al, 1 + mov bx, kBoot0Segment + mov es, bx + mov bx, kBoot0LoadAddr + call load + jc .continue ; load error, keep looking? + + ; + ; Check signature + ; + cmp WORD [bx + 510], kBootSignature + jne NEAR .exit ; boot signature not found + + DebugChar('&') + + ; + ; Fix up absolute block location in partition record. + ; + mov eax, [si + part.lba] + add eax, [ebios_lba] + mov [si + part.lba], eax + + DebugChar('%') + + ; + ; Jump to partition booter. The drive number is already in register DL. + ; SI is pointing to the modified partition entry. + ; + jmp kBoot0Segment:kBoot0LoadAddr + +.continue: + add si, part_size ; advance SI to next partition entry + loop .loop ; loop through all partition entries + +%if EXT_PART_SUPPORT + ; + ; No primary (or logical) boot partition found in the current + ; partition table. Restart and look for extended partitions. + ; + mov si, di ; make SI a pointer to partition table + mov cx, kPartCount ; number of partition entries per table + +.ext_loop: + + mov al, [si + part.type] ; AL <- partition type + + cmp al, kPartTypeExtDOS ; Extended DOS + je .ext_load + + cmp al, kPartTypeExtWin ; Extended Windows(95) + je .ext_load + + cmp al, kPartTypeExtLinux ; Extended Linux + je .ext_load + +.ext_continue: + ; + ; Advance si to the next partition entry in the extended + ; partition table. + ; + add si, part_size ; advance SI to next partition entry + loop .ext_loop ; loop through all partition entries + jmp .exit ; boot partition not found + +.ext_load: + ; + ; Setup the arguments for the load function call to bring the + ; extended partition table into memory. + ; Remember that SI points to the extended partition entry. + ; + mov al, 1 ; read 1 sector + xor bx, bx + mov es, bx ; es = 0 + mov bx, kExtBuffer ; load extended boot sector + call load + jc .ext_continue ; load error + + ; + ; The LBA address of all extended partitions is relative based + ; on the LBA address of the extended partition in the MBR, or + ; the extended partition at the head of the chain. Thus it is + ; necessary to save the LBA address of the first extended partition. + ; + or ah, ah + jnz .ext_find_boot + mov ebp, [si + part.lba] + mov [ebios_lba], ebp + +.ext_find_boot: + ; + ; Call find_boot recursively to scan through the extended partition + ; table. Load DI with a pointer to the extended table in memory. + ; + inc ah ; increment recursion level + mov di, kExtPartTable ; partition table pointer + call find_boot ; recursion... + ;dec ah + + ; + ; Since there is an "unwritten" rule that limits each partition table + ; to have 0 or 1 extended partitions, there is no point in looking for + ; any additional extended partition entries at this point. There is no + ; boot partition linked beyond the extended partition that was loaded + ; above. + ; + +%endif ; EXT_PART_SUPPORT + +.exit: + ; + ; Boot partition not found. Giving up. + ; + DebugChar('X') + pop si + pop cx + ret + +;-------------------------------------------------------------------------- +; load - Load one or more sectors from a partition. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; SI = pointer to the partition entry. +; +; Returns: +; CF = 0 success +; 1 error +; +load: + push cx + test BYTE [ebios_present], 1 + jz .chs + +.ebios: + mov cx, 5 ; load retry count +.ebios_loop: + call read_lba ; use INT13/F42 + jnc .exit + loop .ebios_loop +.chs: + mov cx, 5 ; load retry count +.chs_loop: + call read_chs ; use INT13/F2 + jnc .exit + loop .chs_loop + +.exit: + DebugChar('R') + pop cx + ret + +;-------------------------------------------------------------------------- +; read_chs - Read sectors from a partition using CHS addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read. +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; SI = pointer to the partition entry. +; +; Returns: +; CF = 0 success +; 1 error +; +read_chs: + pushad ; save all registers + + ; + ; Read the CHS start values from the partition entry. + ; + mov dh, [ si + part.head ] ; drive head + mov cx, [ si + part.sect ] ; drive sector + cylinder + + ; + ; INT13 Func 2 - Read Disk Sectors + ; + ; Arguments: + ; AH = 2 + ; AL = number of sectors to read + ; CH = lowest 8 bits of the 10-bit cylinder number + ; CL = bits 6 & 7: cylinder number bits 8 and 9 + ; bits 0 - 5: starting sector number (1-63) + ; DH = starting head number (0 to 255) + ; DL = drive number (80h + drive unit) + ; es:bx = pointer where to place sectors read from disk + ; + ; Returns: + ; AH = return status (sucess is 0) + ; AL = burst error length if ah=0x11 (ECC corrected) + ; carry = 0 success + ; 1 error + ; + mov ah, 0x02 ; Func 2 + int 0x13 ; INT 13 + jnc .exit + + DebugChar('r') ; indicate INT13/F2 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; read_lba - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; ES:BX = pointer to where the sectors should be stored. +; DL = drive number (0x80 + unit number) +; SI = pointer to the partition entry. +; +; Returns: +; CF = 0 success +; 1 error +; +read_lba: + pushad ; save all registers + mov bp, sp ; save current SP + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + mov ecx, [ebios_lba] ; offset 8, lower 32-bit LBA + add ecx, [si + part.lba] + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; DL = drive number (80h + drive unit) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + popad + ret + +;-------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + cld ; increment SI after each lodsb call +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp short .loop +.exit: + ret + + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char + pusha + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popa + ret + +%if DEBUG +;-------------------------------------------------------------------------- +; Write a variable number of spaces to the console. +; +; Arguments: +; AL = number to spaces. +; +print_spaces: + pusha + xor cx, cx + mov cl, al ; use CX as the loop counter + mov al, ' ' ; character to print +.loop: + jcxz .exit + call print_char + loop .loop +.exit: + popa + ret +%endif + +;-------------------------------------------------------------------------- +; Write the byte value to the console in hex. +; +; Arguments: +; AL = Value to be displayed in hex. +; +print_hex: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +getc: + pusha + mov ah, 0 + int 0x16 + popa + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; NULL terminated strings. +; +boot_error_str db 10, 13, 'Chain booting error', 0 + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized booter with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; In memory variables. +; +ebios_lba dd 0 ; starting LBA of the intial extended partition. +ebios_present db 0 ; 1 if EBIOS is supported, 0 otherwise. + +pad_boot: + times 446-($-$$) db 0 + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + +; END diff --git a/i386/boot1/.svn/all-wcprops b/i386/boot1/.svn/all-wcprops new file mode 100644 index 0000000..57c1df0 --- /dev/null +++ b/i386/boot1/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1 +END +boot1f32.s +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/boot1f32.s +END +boot1he.s +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/boot1he.s +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/Cconfig +END +boot1f32-install.sh +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/boot1f32-install.sh +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/Makefile +END +boot1h.s +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/boot1h.s +END +boot1hp.s +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot1/boot1hp.s +END diff --git a/i386/boot1/.svn/entries b/i386/boot1/.svn/entries new file mode 100644 index 0000000..d89db2c --- /dev/null +++ b/i386/boot1/.svn/entries @@ -0,0 +1,266 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/boot1 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +boot1f32.s +file + + + + +2013-08-27T23:54:51.000000Z +6585316ee936a40bd11e1146f6c538e4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14369 + +boot1he.s +file + + + + +2013-08-27T23:54:51.000000Z +7f4ea4def81b0ec9b02f423fc0ea2be0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +38146 + +Cconfig +file + + + + +2013-08-27T23:54:51.000000Z +7ee47106243ff3113975a42ca2fbf756 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +950 + +boot1f32-install.sh +file + + + + +2013-08-27T23:54:51.000000Z +9fa45f7a3131f07695f7f1465bfe3c8a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +634 + +Makefile +file + + + + +2013-08-27T23:54:51.000000Z +95024bad068b502f14952fc977a57c00 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +969 + +boot1h.s +file + + + + +2013-08-27T23:54:51.000000Z +c042f40becebdc9e947fe8107a7b7c2e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +35951 + +boot1hp.s +file + + + + +2013-08-27T23:54:51.000000Z +67719b8cc817fb75d14aee9b37e076ec +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17405 + diff --git a/i386/boot1/.svn/prop-base/boot1f32-install.sh.svn-base b/i386/boot1/.svn/prop-base/boot1f32-install.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/boot1/.svn/prop-base/boot1f32-install.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/boot1/.svn/text-base/Cconfig.svn-base b/i386/boot1/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..9e231a7 --- /dev/null +++ b/i386/boot1/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,47 @@ +# +# boot1h +# +config BOOT1_HFS + bool "boot1h second stage booter" + default y + help + Say Y here if you want to compile the default second + stage bootloader. + +config BOOT1_HFS_DEBUG + bool "debug support" + default n + depends on BOOT1_HFS + help + Say Y here if you want to enable boot1h debug messages. + +config BOOT1_HFS_VERBOSE + bool "verbose support" + default y + depends on BOOT1_HFS + help + Say Y here if you want to enable boot1h verbose messages. + +# +# boot1he +# +config BOOT1_HFS_ACTIVE + bool "boot1he second stage booter" + default y + help + Say Y here if you want to compile the boot1he second + stage bootloader. + +config BOOT1_HFS_ACTIVE_DEBUG + bool "debug support" + default n + depends on BOOT1_HFS_ACTIVE + help + Say Y here if you want to enable boot1he debug messages. + +config BOOT1_HFS_ACTIVE_VERBOSE + bool "verbose support" + default y + depends on BOOT1_HFS_ACTIVE + help + Say Y here if you want to enable boot1he verbose messages. diff --git a/i386/boot1/.svn/text-base/Makefile.svn-base b/i386/boot1/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..65e334c --- /dev/null +++ b/i386/boot1/.svn/text-base/Makefile.svn-base @@ -0,0 +1,45 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/boot1 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +include ${SRCROOT}/Make.rules + +DIR = boot1 + +DIRS_NEEDED = $(SYMROOT) + +VERS = `vers_string -f 5.0 | tr - .` +NEW_VERS = Darwin boot1h v$(VERS) + +PROGRAMS = boot1hp boot1f32 + +ifeq (${CONFIG_BOOT1_HFS}, y) +PROGRAMS += boot1h +endif + +ifeq (${CONFIG_BOOT1_HFS_ACTIVE}, y) +PROGRAMS += boot1he +endif + + +PROGRAMS := $(addprefix $(SYMROOT)/, $(PROGRAMS)) + +all: $(DIRS_NEEDED) $(PROGRAMS) + + +$(PROGRAMS): $(SRCROOT)/autoconf.inc + @echo "\t[NASM] $(@F)" + @$(NASM) $(@F).s -o $@ + +install_i386:: all $(INSTALLDIR) + cp $(SYMROOT)/boot1h $(INSTALLDIR)/ + cd $(INSTALLDIR); chmod u+w $(VERSIONED_FILES) + +clean-local: + @for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @rm -f $(PROGRAMS) diff --git a/i386/boot1/.svn/text-base/boot1f32-install.sh.svn-base b/i386/boot1/.svn/text-base/boot1f32-install.sh.svn-base new file mode 100644 index 0000000..b75ed32 --- /dev/null +++ b/i386/boot1/.svn/text-base/boot1f32-install.sh.svn-base @@ -0,0 +1,26 @@ +#!/bin/sh + +# boot1f32-install.sh +# +# Created by mackerintel on 2/2/09. +# Copyright 2009 mackerintel. All rights reserved. + +if [[ x$1 == x ]]; then + echo Usage: $0 disknumber; + exit 0; +fi + +if [[ `dd if=/dev/disk${1}s1 count=8 bs=1 skip=82 | uuencode -m -|head -n 2|tail -n 1` != "RkFUMzIgICA=" ]]; then + echo "/dev/disk${1}s1" "isn't" a FAT32 partition; + exit 1; +fi + +if [ ! -f boot1f32 ]; then + echo "boot1f32 not found"; + exit 1; +fi + +dd if=/dev/disk${1}s1 count=1 bs=512 of=/tmp/origbs +cp boot1f32 /tmp/newbs +dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc +dd of=/dev/disk${1}s1 count=1 bs=512 if=/tmp/newbs diff --git a/i386/boot1/.svn/text-base/boot1f32.s.svn-base b/i386/boot1/.svn/text-base/boot1f32.s.svn-base new file mode 100644 index 0000000..b0b343d --- /dev/null +++ b/i386/boot1/.svn/text-base/boot1f32.s.svn-base @@ -0,0 +1,636 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Loader: boot1f32 +; +; This program is designed to reside in sector 0 of a FAT32 partition. +; It expects that the MBR has left the drive number in DL +; and a pointer to the partition entry in SI. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1f32.s -o boot1f32 +; +; dd if=origbs of=newbs skip=3 seek=3 bs=1 count=87 conv=notrunc +; + +; +; This version of boot1f32 tries to find a stage2 boot file in the root folder. +; +; Written by mackerintel on 2009-01-26 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Set to 1 to make this stage 1 loader expecting arguments in SI and DL registers. +; +USESIDL EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +maxSectorCount EQU 64 ; maximum sector count for readSectors +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address + +kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +FATBUF EQU 0x7000 ; Just place for one sectors +DIRBUFSEG EQU 0x1000 ; Cluster sizes >64KB aren't supported + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + + struc direntry +.nameext resb 11 +.attr resb 1 +.nused1 resb 8 +.highclus resw 1 +.nused2 resb 4 +.lowclus resw 1 +.size resd 1 + endstruc + + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1LoadAddr + + jmp start + times 3-($-$$) nop + +gOEMName times 8 db 0 ;OEMNAME +gBPS dw 0 +gSPC db 0 +gReservedSectors dw 0 +gNumFats db 0 +gCrap1 times 11 db 0 +gPartLBA dd 0 +gPartSize dd 0 +gSectPerFat dd 0 +gCrap2 times 4 db 0 +gRootCluster dd 0 +gCrap3 times 16 db 0 + +gBIOSDriveNumber db 0 +gExtInfo times 25 db 0 +gFileName db "BOOT " + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor eax, eax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Initializing global variables. + ; + mov ax, word [gReservedSectors] +%if USESIDL + add eax, [si + part.lba] +%else + add eax, [gPartLBA] +%endif + mov [gPartLBA], eax ; save the current FAT LBA offset +%if USESIDL + mov [gBIOSDriveNumber], dl ; save BIOS drive number +%endif + xor eax,eax + mov al, [gNumFats] + mul dword [gSectPerFat] + mov [gSectPerFat], eax + +;-------------------------------------------------------------------------- +; Find stage2 boot file in a FAT32 Volume's root folder. +; +findRootBoot: + +%if VERBOSE + LogString(init_str) +%endif + + mov eax, [gRootCluster] + +nextdirclus: + mov edx, DIRBUFSEG<<4 + call readCluster + jc error + xor si, si + mov bl, [gSPC] + shl bx, 9 + add bx, si + +nextdirent: + mov di, gFileName + push ds + push DIRBUFSEG + pop ds + mov cl, [si] + test cl, cl + jz dserror + mov cx, 11 + repe cmpsb + jz direntfound + +falsealert: + pop ds + add cl, 21 + add si, cx + cmp si, bx + jz nextdirclus + jmp nextdirent + +direntfound: +; test byte [ds:si+direntry.attr-11], 0x18 + lodsb + test al, 0x18 + jnz falsealert + push WORD [si + direntry.highclus - 12] + push WORD [si + direntry.lowclus - 12] + pop eax + pop ds + mov edx, (kBoot2Segment << 4) + kBoot2Address + +cont_read: + push edx + call readCluster + pop edx + pushf + xor ebx,ebx + mov bl, [gSPC] + shl ebx, 9 + add edx, ebx + popf + jnc cont_read + +boot2: + +%if DEBUG + DebugChar ('!') +%endif + +%if UNUSED + ; + ; Waiting for a key press. + ; + + mov ah, 0 + int 0x16 +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +dserror: + pop ds + +error: + +%if VERBOSE + LogString(error_str) +%endif + +hang: + hlt + jmp hang + + ; readCluster - Reads cluster EAX to (EDX), updates EAX to next cluster +readCluster: + cmp eax, 0x0ffffff8 + jb do_read + stc + ret + +do_read: + push eax + xor ecx,ecx + dec eax + dec eax + mov cl, [gSPC] + push edx + mul ecx + pop edx + add eax, [gSectPerFat] + mov ecx, eax + xor ah,ah + mov al, [gSPC] + call readSectors + jc clusend + pop ecx + push cx + shr ecx, 7 + xor ax, ax + inc ax + mov edx, FATBUF + call readSectors + jc clusend + pop si + and si, 0x7f + shl si, 2 + mov eax, [FATBUF + si] + and eax, 0x0fffffff + clc + ret + +clusend: + pop eax + ret + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jc error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; +; xor ax, ax ; Func 0 +; int 0x13 ; INT 13 +; stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'b1f: ', NULL +init_str db 'init', NULL +error_str db 'error', NULL +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + ABSOLUTE kBoot1LoadAddr + kSectorBytes + +; END diff --git a/i386/boot1/.svn/text-base/boot1h.s.svn-base b/i386/boot1/.svn/text-base/boot1h.s.svn-base new file mode 100644 index 0000000..3e58465 --- /dev/null +++ b/i386/boot1/.svn/text-base/boot1h.s.svn-base @@ -0,0 +1,1486 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Loader: boot1h +; +; This program is designed to reside in sector 0+1 of an HFS+ partition. +; It expects that the MBR has left the drive number in DL +; and a pointer to the partition entry in SI. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1.s -o boot1h + +; +; This version of boot1h tries to find a stage2 boot file in the root folder. +; +; NOTE: this is an experimental version with multiple extent support. +; +; Written by Tams Kosrszky on 2008-04-14 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT1_HFS_DEBUG + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU CONFIG_BOOT1_HFS_VERBOSE + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +mallocStart EQU 0x1000 ; start address of local workspace area +maxSectorCount EQU 64 ; maximum sector count for readSectors +maxNodeSize EQU 16384 + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address +kBoot1Sector1Addr EQU kBoot1RelocAddr + kSectorBytes ; boot1 load address for sector 1 +kHFSPlusBuffer EQU kBoot1Sector1Addr + kSectorBytes ; HFS+ Volume Header address + +kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +;------------------------------------------------------------------------- +; HFS+ related structures and constants +; +kHFSPlusSignature EQU 'H+' ; HFS+ volume signature +kHFSPlusCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kHFSPlusCaseSigX EQU 'X' ; upper byte of HFS+ volume case-sensitive signature +kHFSPlusExtentDensity EQU 8 ; 8 extent descriptors / extent record + +; +; HFSUniStr255 +; + struc HFSUniStr255 +.length resw 1 +.unicode resw 255 + endstruc + +; +; HFSPlusExtentDescriptor +; + struc HFSPlusExtentDescriptor +.startBlock resd 1 +.blockCount resd 1 + endstruc + +; +; HFSPlusForkData +; + struc HFSPlusForkData +.logicalSize resq 1 +.clumpSize resd 1 +.totalBlocks resd 1 +.extents resb kHFSPlusExtentDensity * HFSPlusExtentDescriptor_size + endstruc + +; +; HFSPlusVolumeHeader +; + struc HFSPlusVolumeHeader +.signature resw 1 +.version resw 1 +.attributes resd 1 +.lastMountedVersion resd 1 +.journalInfoBlock resd 1 +.createDate resd 1 +.modifyDate resd 1 +.backupDate resd 1 +.checkedDate resd 1 +.fileCount resd 1 +.folderCount resd 1 +.blockSize resd 1 +.totalBlocks resd 1 +.freeBlocks resd 1 +.nextAllocation resd 1 +.rsrcClumpSize resd 1 +.dataClumpSize resd 1 +.nextCatalogID resd 1 +.writeCount resd 1 +.encodingsBitmap resq 1 +.finderInfo resd 8 +.allocationFile resb HFSPlusForkData_size +.extentsFile resb HFSPlusForkData_size +.catalogFile resb HFSPlusForkData_size +.attributesFile resb HFSPlusForkData_size +.startupFile resb HFSPlusForkData_size + endstruc + +; +; B-tree related structures and constants +; + +kBTIndexNode EQU 0 +kBTMaxRecordLength EQU 264 ; sizeof(kHFSPlusFileThreadRecord) +kHFSRootParentID EQU 1 ; Parent ID of the root folder +kHFSRootFolderID EQU 2 ; Folder ID of the root folder +kHFSExtentsFileID EQU 3 ; File ID of the extents overflow file +kHFSCatalogFileID EQU 4 ; File ID of the catalog file +kHFSPlusFileRecord EQU 0x200 +kForkTypeData EQU 0 +kForkTypeResource EQU 0xFF + +; +; BTNodeDescriptor +; + struc BTNodeDescriptor +.fLink resd 1 +.bLink resd 1 +.kind resb 1 +.height resb 1 +.numRecords resw 1 +.reserved resw 1 + endstruc + +; +; BTHeaderRec +; + struc BTHeaderRec +.treeDepth resw 1 +.rootNode resd 1 +.leafRecords resd 1 +.firstLeafNode resd 1 +.lastLeafNode resd 1 +.nodeSize resw 1 +.maxKeyLength resw 1 +.totalNodes resd 1 +.freeNodes resd 1 +.reserved1 resw 1 +.clumpSize resd 1 +.btreeType resb 1 +.keyCompareType resb 1 +.attributes resd 1 +.reserved3 resd 16 + endstruc + +; +; BTIndexRec +; + struc BTIndexRec +.childID resd 1 + endstruc + +; +; HFSPlusCatalogKey +; + struc HFSPlusCatalogKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.parentID resd 1 +.nodeName resb HFSUniStr255_size + endstruc + +; +; HFSPlusExtentKey +; + struc HFSPlusExtentKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.forkType resb 1 +.pad resb 1 +.fileID resd 1 +.startBlock resd 1 + endstruc + +; +; HFSPlusBSDInfo +; + struc HFSPlusBSDInfo +.ownerID resd 1 +.groupID resd 1 +.adminFlags resb 1 +.ownerFlags resb 1 +.fileMode resw 1 +.special resd 1 + endstruc + +; +; FileInfo +; + struc FileInfo +.fileType resd 1 +.fileCreator resd 1 +.finderFlags resw 1 +.location resw 2 +.reservedField resw 1 + endstruc + +; +; ExtendedFileInfo +; + struc ExtendedFileInfo +.reserved1 resw 4 +.extFinderFlags resw 1 +.reserved2 resw 1 +.putAwayFolderID resd 1 + endstruc + +; +; HFSPlusCatalogFile +; + struc HFSPlusCatalogFile +.recordType resw 1 +.flags resw 1 +.reserved1 resd 1 +.fileID resd 1 +.createDate resd 1 +.contentModDate resd 1 +.attributeModDate resd 1 +.accessDate resd 1 +.backupDate resd 1 +.permissions resb HFSPlusBSDInfo_size +.userInfo resb FileInfo_size +.finderInfo resb ExtendedFileInfo_size +.textEncoding resd 1 +.reserved2 resd 1 +.dataFork resb HFSPlusForkData_size +.resourceFork resb HFSPlusForkData_size + endstruc + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Relocate boot1 code. + ; + push si + mov si, kBoot1LoadAddr ; si <- source + mov di, kBoot1RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes ; copy 256 words + rep movsb ; repeat string move (word) operation + pop si + + ; + ; Code relocated, jump to startReloc in relocated location. + ; + ; FIXME: Is there any way to instruct NASM to compile a near jump + ; using absolute address instead of relative displacement? + ; + jmpabs startReloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +startReloc: + + ; + ; Initializing global variables. + ; + mov eax, [si + part.lba] + mov [gPartLBA], eax ; save the current partition LBA offset + mov [gBIOSDriveNumber], dl ; save BIOS drive number + mov WORD [gMallocPtr], mallocStart ; set free space pointer + + ; + ; Loading upper 512 bytes of boot1h and HFS+ Volume Header. + ; + xor ecx, ecx ; sector 1 of current partition + inc ecx + mov al, 2 ; read 2 sectors: sector 1 of boot1h + HFS+ Volume Header + mov edx, kBoot1Sector1Addr + call readLBA + + ; + ; Initializing more global variables. + ; + mov eax, [kHFSPlusBuffer + HFSPlusVolumeHeader.blockSize] + bswap eax ; convert to little-endian + shr eax, 9 ; convert to sector unit + mov [gBlockSize], eax ; save blockSize as little-endian sector unit! + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kHFSPlusBuffer + HFSPlusVolumeHeader.signature] + cmp ax, kHFSPlusCaseSignature + je findRootBoot + cmp ax, kHFSPlusSignature + jne error + +;-------------------------------------------------------------------------- +; Find stage2 boot file in a HFS+ Volume's root folder. +; +findRootBoot: + mov al, kHFSCatalogFileID + lea si, [searchCatalogKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.catalogFile + HFSPlusForkData.extents] + call lookUpBTree + jne error + + lea si, [bp + BTree.recordDataPtr] + mov si, [si] + cmp WORD [si], kHFSPlusFileRecord + jne error + +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData + + ; + ; Use the second big-endian double-word as the file length in HFSPlusForkData.logicalSize + ; + mov ebx, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.logicalSize + 4] + bswap ebx ; convert file size to little-endian + add ebx, kSectorBytes - 1 ; adjust size before unit conversion + shr ebx, 9 ; convert file size to sector unit + cmp bx, kBoot2Sectors ; check if bigger than max stage2 size + ja error + mov eax, [si + HFSPlusCatalogFile.fileID] + bswap eax ; convert fileID to little-endian + xor ecx, ecx + mov edx, (kBoot2Segment << 4) + kBoot2Address + lea di, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.extents] + call readExtent + +%if VERBOSE + LogString(root_str) +%endif + +boot2: + +%if DEBUG + DebugChar ('!') +%endif + +%if UNUSED + ; + ; Waiting for a key press. + ; + + mov ah, 0 + int 0x16 +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +error: + +%if VERBOSE + LogString(error_str) +%endif + +hang: + hlt + jmp hang + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jc error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; +; xor ax, ax ; Func 0 +; int 0x13 ; INT 13 +; stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert null terminated string to HFSUniStr255 +; +; Arguments: +; DS:DX pointer to a NULL terminated string. +; ES:DI pointer to result. +; +ConvertStrToUni: + pushad ; save registers + push di ; save DI for unicode string length pointer + mov si, dx ; use SI as source string pointer + xor ax, ax ; AX = unicode character + mov cl, al ; CL = string length + +.loop: + stosw ; store unicode character (length 0 at first run) + lodsb ; load next character to AL + inc cl ; increment string length count + cmp al, NULL ; check for string terminator + jne .loop + + pop di ; restore unicode string length pointer + dec cl ; ignoring terminator from length count + mov [di], cl ; save string length + popad ; restore registers + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian HFSUniStr255 to little-endian +; +; Arguments: +; DS:SI = pointer to big-endian HFSUniStr255 +; ES:DI = pointer to result buffer +; +ConvertHFSUniStr255ToLE: + pushad + lodsw + xchg ah, al + stosw + cmp al, 0 + je .exit + mov cx, ax + +.loop: + lodsw + xchg ah, al ; convert AX to little-endian + + ; + ; When working with a case-sensitive HFS+ (HX) filesystem, we shouldn't change the case. + ; + cmp BYTE [kHFSPlusBuffer + HFSPlusVolumeHeader.signature + 1], kHFSPlusCaseSigX + je .keepcase + + or ax, ax + jne .convertToLE + dec ax ; NULL must be the strongest char + +.convertToLE: + cmp ah, 0 + ja .keepcase + cmp al, 'A' + jb .keepcase + cmp al, 'Z' + ja .keepcase + add al, 32 ; convert to lower-case + +.keepcase: + stosw + loop .loop + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; compare HFSPlusExtentKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusExtentKeys: + pushad + + mov dl, 0 ; DL = result of comparison, DH = bestGuess + mov eax, [si + HFSPlusExtentKey.fileID] + cmp eax, [di + HFSPlusExtentKey.fileID] + jne .checkFlags + + cmp BYTE [si + HFSPlusExtentKey.forkType], kForkTypeData + jne .checkFlags + + mov eax, [si + HFSPlusExtentKey.startBlock] + cmp eax, [di + HFSPlusExtentKey.startBlock] + je compareHFSPlusCatalogKeys.exit + +.checkFlags: + ja compareHFSPlusCatalogKeys.searchKeyGreater ; search key > trial key + jb compareHFSPlusCatalogKeys.trialKeyGreater ; search key < trial key + +;-------------------------------------------------------------------------- +; Compare HFSPlusCatalogKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusCatalogKeys: + pushad + xor dx, dx ; DL = result of comparison, DH = bestGuess + xchg si, di + lodsd + mov ecx, eax ; ECX = trial parentID + xchg si, di + lodsd ; EAX = search parentID + cmp eax, ecx + ja .searchKeyGreater ; search parentID > trial parentID + jb .trialKeyGreater ; search parentID < trial parentID + +.compareNodeName: ; search parentID = trial parentID + xchg si, di + lodsw + mov cx, ax ; CX = trial nodeName.length + xchg si, di + lodsw ; AX = search nodeName.length + cmp cl, 0 ; trial nodeName.length = 0? + je .searchKeyGreater + + cmp ax, cx + je .strCompare + ja .searchStrLonger + +.trialStrLonger: + dec dh + mov cx, ax + jmp .strCompare + +.searchStrLonger: + inc dh + +.strCompare: + repe cmpsw + ja .searchKeyGreater + jb .trialKeyGreater + mov dl, dh + jmp .exit + +.trialKeyGreater: + dec dl + jmp .exit + +.searchKeyGreater: + inc dl + +.exit: + mov [bp + BTree.searchResult], dl + cmp dl, 0 ; set flags to check relation between keys + + popad + ret + +;-------------------------------------------------------------------------- +; Allocate memory +; +; Arguments: +; CX = size of requested memory +; +; Returns: +; BP = start address of allocated memory +; +; Clobber list: +; CX +; +malloc: + push ax ; save AX + push di ; save DI + mov di, [gMallocPtr] ; start address of free space + push di ; save free space start address + inc di ; + inc di ; keep the first word untouched + dec cx ; for the last memory block pointer. + dec cx ; + mov al, NULL ; fill with zero + rep stosb ; repeat fill + mov [gMallocPtr], di ; adjust free space pointer + pop bp ; BP = start address of allocated memory + mov [di], bp ; set start address of allocated memory at next + ; allocation block's free space address. + pop di ; restore DI + pop ax ; restore AX + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Free allocated memory +; +; Returns: +; BP = start address of previously allocated memory +; +free: + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +root_str db '/boot', NULL +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; XXX - compilation errors with debug enabled (see comment above about nasm) +; Azi: boot1h.s:994: error: TIMES value -67 is negative +; +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + +; +; Sector 1 code area +; + +;-------------------------------------------------------------------------- +; lookUpBTree - initializes a new BTree instance and +; look up for HFSPlus Catalog File or Extent Overflow keys +; +; Arguments: +; AL = kHFSPlusFileID (Catalog or Extents Overflow) +; SI = address of searchKey +; DI = address of HFSPlusForkData.extents +; +; Returns: +; BP = address of BTree instance +; ECX = rootNode's logical offset in sectors +; +lookUpBTree: + mov cx, BTree_size ; allocate memory with BTree_size + call malloc ; BP = start address of allocated memory. + mov [bp + BTree.fileID], al ; save fileFileID + mov edx, [di] ; first extent of current file + call blockToSector ; ECX = converted to sector unit + mov al, 1 ; 1 sector is enough for + xor edx, edx ; reading current file's header. + lea dx, [bp + BTree.BTHeaderBuffer] ; load into BTreeHeaderBuffer + call readLBA ; read + mov ax, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.nodeSize] + xchg ah, al ; convert to little-endian + mov [bp + BTree.nodeSize], ax ; save nodeSize + + ; + ; Always start the lookup process with the root node. + ; + mov edx, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.rootNode] + +.readNode: + ; + ; Converting nodeID to sector unit + ; + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + mov bx, ax ; BX = read sector count + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with nodeSize converted to sector unit + mov ecx, eax ; ECX = file offset in BTree + + mov eax, [bp + BTree.fileID] + lea edx, [bp + BTree.nodeBuffer] + call readExtent + + ; + ; AX = lowerBound = 0 + ; + xor ax, ax + + ; + ; BX = upperBound = numRecords - 1 + ; + mov bx, [bp + BTree.nodeBuffer + BTNodeDescriptor.numRecords] + xchg bh, bl + dec bx + +.bsearch: + cmp ax, bx + ja .checkResult ; jump if lowerBound > upperBound + + mov cx, ax + add cx, bx + shr cx, 1 ; test index = (lowerBound + upperBound / 2) + + call getBTreeRecord + +%if UNUSED + pushad + jl .csearchLessThanTrial + jg .csearchGreaterThanTrial + PrintChar('=') + jmp .csearchCont +.csearchGreaterThanTrial: + PrintChar('>') + jmp .csearchCont +.csearchLessThanTrial: + PrintChar('<') +.csearchCont: + popad +%endif ; UNUSED + +.adjustBounds: + je .checkResult + jl .searchLessThanTrial + jg .searchGreaterThanTrial + jmp .bsearch + +.searchLessThanTrial: + mov bx, cx + dec bx ; upperBound = index - 1 + jmp .bsearch + +.searchGreaterThanTrial: + mov ax, cx + inc ax ; lowerBound = index + 1 + jmp .bsearch + +.checkResult: + cmp BYTE [bp + BTree.searchResult], 0 + jge .foundKey + + mov cx, bx + call getBTreeRecord + +.foundKey: + cmp BYTE [bp + BTree.nodeBuffer + BTNodeDescriptor.kind], kBTIndexNode + jne .exit + + lea bx, [bp + BTree.recordDataPtr] + mov bx, [bx] + mov edx, [bx] + jmp .readNode + +.exit: + cmp BYTE [bp + BTree.searchResult], 0 + ret + +;-------------------------------------------------------------------------- +; getBTreeRecord - read and compare BTree record +; +; Arguments: +; CX = record index +; SI = address of search key +; +; Returns: +; [BTree.searchResult] = result of key compare +; [BTree.recordDataPtr] = address of record data +; +getBTreeRecord: + pushad + push si ; save SI + lea di, [bp + BTree.nodeBuffer] ; DI = start of nodeBuffer + push di ; use later + mov ax, [bp + BTree.nodeSize] ; get nodeSize + add di, ax ; DI = beyond nodeBuffer + inc cx ; increment index + shl cx, 1 ; * 2 + sub di, cx ; DI = pointer to record + mov ax, [di] ; offset to record + xchg ah, al ; convert to little-endian + pop di ; start of nodeBuffer + add di, ax ; DI = address of record key + mov si, di ; save to SI + mov ax, [di] ; keyLength + xchg ah, al ; convert to little-endian + inc ax ; suppress keySize (2 bytes) + inc ax ; + add di, ax ; DI = address of record data + mov [bp + BTree.recordDataPtr], di ; save address of record data + lea di, [bp + BTree.trialKey] + push di ; save address of trialKey + lodsw ; suppress keySize (2 bytes) + ; + ; Don't need to compare as DWORD since all reserved CNIDs fits to a single byte + ; + cmp BYTE [bp + BTree.fileID], kHFSCatalogFileID + je .prepareTrialCatalogKey + +.prepareTrialExtentKey: + mov bx, compareHFSPlusExtentKeys + movsw ; copy forkType + pad + mov cx, 2 ; copy fileID + startBlock + +.extentLoop: + lodsd + bswap eax ; convert to little-endian + stosd + loop .extentLoop + jmp .exit + +.prepareTrialCatalogKey: + mov bx, compareHFSPlusCatalogKeys + lodsd + bswap eax ; convert ParentID to little-endian + stosd + call ConvertHFSUniStr255ToLE ; convert nodeName to little-endian + +.exit: + pop di ; restore address of trialKey + +%if UNUSED +; +; Print catalog trial key +; + pushad + mov si, di + lodsd + PrintChar('k') + PrintHex() + lodsw + cmp ax, 0 + je .printExit + mov cx, ax +.printLoop: + lodsw + call print_char + loop .printLoop +.printExit: + popad +; +; +; +%endif ; UNUSED + +%if UNUSED +; +; Print extent trial key +; + pushad + PrintChar('k') + mov si, di + xor eax, eax + lodsw + PrintHex() + lodsd + PrintHex() + lodsd + PrintHex() + popad +; +; +; +%endif ; UNUSED + + pop si ; restore SI + call bx ; call key compare proc + popad + ret + +;-------------------------------------------------------------------------- +; readExtent - read extents from a HFS+ file (multiple extent support) +; +; Arguments: +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData.extents +; +readExtent: + pushad + ; + ; Save Catalog File ID as part of a search HFSPlusExtentKey + ; for a possible Extents Overflow lookup. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.fileID], eax + mov [bp + BTree.readBufferPtr], edx + mov ax, bx + cwde + mov [bp + BTree.readSize], eax + mov ebx, ecx ; EBX = file offset + xor eax, eax + mov [bp + BTree.currentExtentOffs], eax + +.beginExtentBlock: + mov BYTE [bp + BTree.extentCount], 0 + +.extentSearch: + cmp BYTE [bp + BTree.extentCount], kHFSPlusExtentDensity + jb .continue + +.getNextExtentBlock: + push ebx + mov eax, [bp + BTree.currentExtentOffs] + + ; + ; Converting sector unit to HFS+ allocation block unit. + ; + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + + ; + ; Preparing searchExtentKey's startBlock field. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.startBlock], eax + + mov al, kHFSExtentsFileID + lea si, [bp + BTree.searchExtentKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.extentsFile + HFSPlusForkData.extents] + call lookUpBTree + jnz NEAR .exit + + ; + ; BP points to the new workspace allocated by lookUpBTree. + ; + lea di, [bp + BTree.recordDataPtr] + mov di, [di] + + ; + ; Switch back to the previous workspace. + ; + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + + pop ebx + jmp .beginExtentBlock + +.continue: + mov edx, [di + HFSPlusExtentDescriptor.blockCount] + call blockToSector ; ECX = converted current extent's blockCount to sectors + mov eax, [bp + BTree.currentExtentOffs] ; EAX = current extent's start offset (sector) + mov edx, eax + add edx, ecx ; EDX = next extent's start offset (sector) + cmp ebx, edx + mov [bp + BTree.currentExtentOffs], edx ; set currentExtentOffs as the next extent's start offset + jae .nextExtent ; jump to next extent if file offset > next extent's start offset + +.foundExtent: + mov edx, ebx + sub edx, eax ; EDX = relative offset within current extent + mov eax, edx ; will be used below to determine read size + mov esi, [bp + BTree.readSize] ; ESI = remaining sectors to be read + add edx, esi + cmp edx, ecx ; test if relative offset + readSize fits to this extent + jbe .read ; read all remaining sectors from this extent + +.splitRead: + sub ecx, eax ; read amount of sectors beginning at relative offset + mov esi, ecx ; of current extent up to the end of current extent + +.read: + mov edx, [di + HFSPlusExtentDescriptor.startBlock] + call blockToSector ; ECX = converted to sectors + add ecx, eax ; file offset converted to sectors + + push si + mov ax, si + mov edx, [bp + BTree.readBufferPtr] + call readSectors + pop si + + add ebx, esi + mov ax, si + cwde + shl ax, 9 ; convert SI (read sector count) to byte unit + add [bp + BTree.readBufferPtr], eax + sub [bp + BTree.readSize], esi + + jz .exit + +.nextExtent: + add di, kHFSPlusExtentDensity + inc BYTE [bp + BTree.extentCount] + jmp .extentSearch + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; Convert big-endian HFSPlus allocation block to sector unit +; +; Arguments: +; EDX = allocation block +; +; Returns: +; ECX = allocation block converted to sector unit +; +; Clobber list: +; EDX +; +blockToSector: + push eax + mov eax, [gBlockSize] + bswap edx ; convert allocation block to little-endian + mul edx ; multiply with block number + mov ecx, eax ; result in EAX + pop eax + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert sector unit to HFSPlus allocation block unit +; +; Arguments: +; EDX = sector +; +; Returns: +; ECX = converted to allocation block unit +; +; Clobber list: +; EDX +; +sectorToBlock: + push eax + mov eax, edx + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian BTree node ID to sector unit +; +; Arguments: +; EDX = node ID +; +; Returns: +; ECX = node ID converted to sector unit +; +; Clobber list: +; EDX +; +nodeToSector: + push eax + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with node ID + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'boot1: ', NULL +error_str db 'error', NULL +%endif + +searchCatalogKey dd kHFSRootFolderID + dw searchCatKeyNameLen +searchCatKeyName dw 'b', 'o', 'o', 't' ; must be lower case +searchCatKeyNameLen EQU ($ - searchCatKeyName) / 2 + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; + +; +; XXX - compilation errors with debug enabled +; Azi: boot1h.s:1452: error: TIMES value -64 is negative +; +pad_sector_1: + times 1022-($-$$) db 0 + dw kBootSignature + +; +; Local BTree variables +; + struc BTree +.mallocLink resw 1 ; pointer to previously allocated memory block +.fileID resd 1 ; will use as BYTE +.nodeSize resd 1 ; will use as WORD +.searchExtentKey resb HFSPlusExtentKey_size +.searchResult resb 1 +.trialKey resb kBTMaxRecordLength +.recordDataPtr resw 1 +.readBufferPtr resd 1 +.currentExtentOffs resd 1 +.readSize resd 1 +.extentCount resb 1 + ALIGNB 2 +.BTHeaderBuffer resb kSectorBytes +.nodeBuffer resb maxNodeSize + endstruc + +; +; Global variables +; + + ABSOLUTE kHFSPlusBuffer + HFSPlusVolumeHeader_size + +gPartLBA resd 1 +gBIOSDriveNumber resw 1 +gBlockSize resd 1 +gMallocPtr resw 1 + +; END diff --git a/i386/boot1/.svn/text-base/boot1he.s.svn-base b/i386/boot1/.svn/text-base/boot1he.s.svn-base new file mode 100644 index 0000000..7752733 --- /dev/null +++ b/i386/boot1/.svn/text-base/boot1he.s.svn-base @@ -0,0 +1,1597 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Loader: boot1h extended sectors +; +; This program is designed to reside between sectors 40-47 of a block device. +; It expects that the partition boot loader left the drive number in DL +; and a pointer to the partition entry in SI. Starting sector of this loader +; should be passed in ECX. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1he.s -o boot1he + +; +; This version of boot1he tries to find a stage2 boot file in the root folder. +; +; +; Written by zef @ 2008-04-17, +; updated with large boot file loading support @ 2008-10-27 +; +; NOTE: this is an experimental version with multiple extent support. +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT1_HFS_ACTIVE_DEBUG + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU CONFIG_BOOT1_HFS_ACTIVE_VERBOSE + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +mallocStart EQU 0x1000 ; start address of local workspace area +maxSectorCount EQU 64 ; maximum sector count for readSectors +maxNodeSize EQU 16384 + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kBoot1ExtSize EQU 4096 +kBoot1ExtSignature EQU 'b1he' + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address +kBoot1ExtAddr EQU kBoot1RelocAddr + kSectorBytes ; boot1 load address for sector 41-47 +kHFSPlusBuffer EQU kBoot1RelocAddr + kBoot1ExtSize ; HFS+ Volume Header address + +kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +;------------------------------------------------------------------------- +; HFS+ related structures and constants +; +kHFSPlusSignature EQU 'H+' ; HFS+ volume signature +kHFSPlusCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kHFSPlusCaseSigX EQU 'X' ; upper byte of HFS+ volume case-sensitive signature +kHFSPlusExtentDensity EQU 8 ; 8 extent descriptors / extent record + +; +; HFSUniStr255 +; + struc HFSUniStr255 +.length resw 1 +.unicode resw 255 + endstruc + +; +; HFSPlusExtentDescriptor +; + struc HFSPlusExtentDescriptor +.startBlock resd 1 +.blockCount resd 1 + endstruc + +; +; HFSPlusForkData +; + struc HFSPlusForkData +.logicalSize resq 1 +.clumpSize resd 1 +.totalBlocks resd 1 +.extents resb kHFSPlusExtentDensity * HFSPlusExtentDescriptor_size + endstruc + +; +; HFSPlusVolumeHeader +; + struc HFSPlusVolumeHeader +.signature resw 1 +.version resw 1 +.attributes resd 1 +.lastMountedVersion resd 1 +.journalInfoBlock resd 1 +.createDate resd 1 +.modifyDate resd 1 +.backupDate resd 1 +.checkedDate resd 1 +.fileCount resd 1 +.folderCount resd 1 +.blockSize resd 1 +.totalBlocks resd 1 +.freeBlocks resd 1 +.nextAllocation resd 1 +.rsrcClumpSize resd 1 +.dataClumpSize resd 1 +.nextCatalogID resd 1 +.writeCount resd 1 +.encodingsBitmap resq 1 +.finderInfo resd 8 +.allocationFile resb HFSPlusForkData_size +.extentsFile resb HFSPlusForkData_size +.catalogFile resb HFSPlusForkData_size +.attributesFile resb HFSPlusForkData_size +.startupFile resb HFSPlusForkData_size + endstruc + +; +; B-tree related structures and constants +; + +kBTIndexNode EQU 0 +kBTMaxRecordLength EQU 264 ; sizeof(kHFSPlusFileThreadRecord) +kHFSRootParentID EQU 1 ; Parent ID of the root folder +kHFSRootFolderID EQU 2 ; Folder ID of the root folder +kHFSExtentsFileID EQU 3 ; File ID of the extents overflow file +kHFSCatalogFileID EQU 4 ; File ID of the catalog file +kHFSPlusFileRecord EQU 0x200 +kForkTypeData EQU 0 +kForkTypeResource EQU 0xFF + +; +; BTNodeDescriptor +; + struc BTNodeDescriptor +.fLink resd 1 +.bLink resd 1 +.kind resb 1 +.height resb 1 +.numRecords resw 1 +.reserved resw 1 + endstruc + +; +; BTHeaderRec +; + struc BTHeaderRec +.treeDepth resw 1 +.rootNode resd 1 +.leafRecords resd 1 +.firstLeafNode resd 1 +.lastLeafNode resd 1 +.nodeSize resw 1 +.maxKeyLength resw 1 +.totalNodes resd 1 +.freeNodes resd 1 +.reserved1 resw 1 +.clumpSize resd 1 +.btreeType resb 1 +.keyCompareType resb 1 +.attributes resd 1 +.reserved3 resd 16 + endstruc + +; +; BTIndexRec +; + struc BTIndexRec +.childID resd 1 + endstruc + +; +; HFSPlusCatalogKey +; + struc HFSPlusCatalogKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.parentID resd 1 +.nodeName resb HFSUniStr255_size + endstruc + +; +; HFSPlusExtentKey +; + struc HFSPlusExtentKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.forkType resb 1 +.pad resb 1 +.fileID resd 1 +.startBlock resd 1 + endstruc + +; +; HFSPlusBSDInfo +; + struc HFSPlusBSDInfo +.ownerID resd 1 +.groupID resd 1 +.adminFlags resb 1 +.ownerFlags resb 1 +.fileMode resw 1 +.special resd 1 + endstruc + +; +; FileInfo +; + struc FileInfo +.fileType resd 1 +.fileCreator resd 1 +.finderFlags resw 1 +.location resw 2 +.reservedField resw 1 + endstruc + +; +; ExtendedFileInfo +; + struc ExtendedFileInfo +.reserved1 resw 4 +.extFinderFlags resw 1 +.reserved2 resw 1 +.putAwayFolderID resd 1 + endstruc + +; +; HFSPlusCatalogFile +; + struc HFSPlusCatalogFile +.recordType resw 1 +.flags resw 1 +.reserved1 resd 1 +.fileID resd 1 +.createDate resd 1 +.contentModDate resd 1 +.attributeModDate resd 1 +.accessDate resd 1 +.backupDate resd 1 +.permissions resb HFSPlusBSDInfo_size +.userInfo resb FileInfo_size +.finderInfo resb ExtendedFileInfo_size +.textEncoding resd 1 +.reserved2 resd 1 +.dataFork resb HFSPlusForkData_size +.resourceFork resb HFSPlusForkData_size + endstruc + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Relocate boot1 code. + ; + pushad + mov si, kBoot1LoadAddr ; si <- source + mov di, kBoot1RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes ; copy 256 words + rep movsb ; repeat string move (word) operation + popad + + ; + ; Code relocated, jump to startReloc in relocated location. + ; + ; FIXME: Is there any way to instruct NASM to compile a near jump + ; using absolute address instead of relative displacement? + ; + jmpabs startReloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +startReloc: + + ; + ; Initializing global variables. + ; + mov eax, [si + part.lba] + mov [gPartLBA], eax ; save the current partition LBA offset + mov [gBIOSDriveNumber], dl ; save BIOS drive number + mov WORD [gMallocPtr], mallocStart ; set free space pointer + + ; + ; Loading remaining sectors of boot1h extended code. + ; + mov eax, [gPartLBA] ; save starting LBA of current partition + push eax + xor eax, eax + mov [gPartLBA], eax ; will be read sectors from the beginning of the disk + mov al, (kBoot1ExtSize - kSectorBytes) / kSectorBytes + inc ecx ; ECX = next sector to boot1h extended code starting sector + mov edx, kBoot1ExtAddr + call readLBA + jc NEAR bios_read_error + pop eax + mov [gPartLBA], eax ; restore starting LBA of current partition + + ; + ; Loading HFS+ Volume Header. + ; + mov ecx, 2 ; sector 2 of current partition + mov al, 1 ; read HFS+ Volume Header + mov edx, kHFSPlusBuffer + call readLBA + jc NEAR bios_read_error + + ; + ; Initializing more global variables. + ; + mov eax, [kHFSPlusBuffer + HFSPlusVolumeHeader.blockSize] + bswap eax ; convert to little-endian + shr eax, 9 ; convert to sector unit + mov [gBlockSize], eax ; save blockSize as little-endian sector unit! + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kHFSPlusBuffer + HFSPlusVolumeHeader.signature] + cmp ax, kHFSPlusCaseSignature + je findRootBoot + cmp ax, kHFSPlusSignature + jne NEAR error + +;-------------------------------------------------------------------------- +; Find stage2 boot file in a HFS+ Volume's root folder. +; +findRootBoot: + mov al, kHFSCatalogFileID + lea si, [searchCatalogKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.catalogFile + HFSPlusForkData.extents] + call lookUpBTree + jne error + + lea si, [bp + BTree.recordDataPtr] + mov si, [si] + cmp WORD [si], kHFSPlusFileRecord + jne error + +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData + + ; + ; Use the second big-endian double-word as the file length in HFSPlusForkData.logicalSize + ; + mov ebx, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.logicalSize + 4] + bswap ebx ; convert file size to little-endian + add ebx, kSectorBytes - 1 ; adjust size before unit conversion + shr ebx, 9 ; convert file size to sector unit + cmp bx, kBoot2Sectors ; check if bigger than max stage2 size + ja error + mov eax, [si + HFSPlusCatalogFile.fileID] + bswap eax ; convert fileID to little-endian + xor ecx, ecx + mov edx, (kBoot2Segment << 4) + kBoot2Address + lea di, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.extents] + call readExtent + +%if VERBOSE + LogString(root_str) +%endif + + ; + ; Jump to boot2. + ; +boot2: + +%if DEBUG + DebugChar ('!') +%endif + +;%if UNUSED + ; + ; Waiting for a key press. + ; + + call getc +;%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +bios_read_error: + +%if VERBOSE + LogString(bios_error_str) +%endif + + jmp hang + +hfsp_error: + +%if VERBOSE + LogString(hfsp_error_str) +%endif + + jmp hang + +error: + +%if VERBOSE + LogString(error_str) +%endif + +hang: + hlt + jmp hang + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + jnc .exit + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Convert big-endian HFSPlus allocation block to sector unit +; +; Arguments: +; EDX = allocation block +; +; Returns: +; ECX = allocation block converted to sector unit +; +; Clobber list: +; EDX +; +blockToSector: + push eax + mov eax, [gBlockSize] + bswap edx ; convert allocation block to little-endian + mul edx ; multiply with block number + mov ecx, eax ; result in EAX + pop eax + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'boot1ext: ', NULL +bios_error_str db 'BIOS int 13h error', NULL +hfsp_error_str db 'HFS+ signature error', NULL +error_str db 'error', NULL +%endif ; VERBOSE + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +pad_table_and_sig: + times (kSectorBytes - 6)-($-$$) db 0 + dd kBoot1ExtSignature + dw kBootSignature + +; +; Sector 1 code area +; + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc bios_read_error + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert null terminated string to HFSUniStr255 +; +; Arguments: +; DS:DX pointer to a NULL terminated string. +; ES:DI pointer to result. +; +ConvertStrToUni: + pushad ; save registers + push di ; save DI for unicode string length pointer + mov si, dx ; use SI as source string pointer + xor ax, ax ; AX = unicode character + mov cl, al ; CL = string length + +.loop: + stosw ; store unicode character (length 0 at first run) + lodsb ; load next character to AL + inc cl ; increment string length count + cmp al, NULL ; check for string terminator + jne .loop + + pop di ; restore unicode string length pointer + dec cl ; ignoring terminator from length count + mov [di], cl ; save string length + popad ; restore registers + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian HFSUniStr255 to little-endian +; +; Arguments: +; DS:SI = pointer to big-endian HFSUniStr255 +; ES:DI = pointer to result buffer +; +ConvertHFSUniStr255ToLE: + pushad + lodsw + xchg ah, al + stosw + cmp al, 0 + je .exit + mov cx, ax + +.loop: + lodsw + xchg ah, al ; convert AX to little-endian + + ; + ; When working with a case-sensitive HFS+ (HX) filesystem, we shouldn't change the case. + ; + cmp BYTE [kHFSPlusBuffer + HFSPlusVolumeHeader.signature + 1], kHFSPlusCaseSigX + je .keepcase + + or ax, ax + jne .convertToLE + dec ax ; NULL must be the strongest char + +.convertToLE: + cmp ah, 0 + ja .keepcase + cmp al, 'A' + jb .keepcase + cmp al, 'Z' + ja .keepcase + add al, 32 ; convert to lower-case + +.keepcase: + stosw + loop .loop + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; compare HFSPlusExtentKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusExtentKeys: + pushad + + mov dl, 0 ; DL = result of comparison, DH = bestGuess + mov eax, [si + HFSPlusExtentKey.fileID] + cmp eax, [di + HFSPlusExtentKey.fileID] + jne .checkFlags + + cmp BYTE [si + HFSPlusExtentKey.forkType], kForkTypeData + jne .checkFlags + + mov eax, [si + HFSPlusExtentKey.startBlock] + cmp eax, [di + HFSPlusExtentKey.startBlock] + je compareHFSPlusCatalogKeys.exit + +.checkFlags: + ja compareHFSPlusCatalogKeys.searchKeyGreater ; search key > trial key + jb compareHFSPlusCatalogKeys.trialKeyGreater ; search key < trial key + +;-------------------------------------------------------------------------- +; Compare HFSPlusCatalogKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusCatalogKeys: + pushad + xor dx, dx ; DL = result of comparison, DH = bestGuess + xchg si, di + lodsd + mov ecx, eax ; ECX = trial parentID + xchg si, di + lodsd ; EAX = search parentID + cmp eax, ecx + ja .searchKeyGreater ; search parentID > trial parentID + jb .trialKeyGreater ; search parentID < trial parentID + +.compareNodeName: ; search parentID = trial parentID + xchg si, di + lodsw + mov cx, ax ; CX = trial nodeName.length + xchg si, di + lodsw ; AX = search nodeName.length + cmp cl, 0 ; trial nodeName.length = 0? + je .searchKeyGreater + + cmp ax, cx + je .strCompare + ja .searchStrLonger + +.trialStrLonger: + dec dh + mov cx, ax + jmp .strCompare + +.searchStrLonger: + inc dh + +.strCompare: + repe cmpsw + ja .searchKeyGreater + jb .trialKeyGreater + mov dl, dh + jmp .exit + +.trialKeyGreater: + dec dl + jmp .exit + +.searchKeyGreater: + inc dl + +.exit: + mov [bp + BTree.searchResult], dl + +;%if UNUSED + pushad + jl .csearchLessThanTrial + jg .csearchGreaterThanTrial + PrintChar('=') + jmp .csearchCont +.csearchGreaterThanTrial: + PrintChar('>') + jmp .csearchCont +.csearchLessThanTrial: + PrintChar('<') +.csearchCont: + popad +;%endif ; UNUSED + + cmp dl, 0 ; set flags to check relation between keys + + popad + ret + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; Allocate memory +; +; Arguments: +; CX = size of requested memory +; +; Returns: +; BP = start address of allocated memory +; +; Clobber list: +; CX +; +malloc: + push ax ; save AX + push di ; save DI + mov di, [gMallocPtr] ; start address of free space + push di ; save free space start address + inc di ; + inc di ; keep the first word untouched + dec cx ; for the last memory block pointer. + dec cx ; + mov al, NULL ; fill with zero + rep stosb ; repeat fill + mov [gMallocPtr], di ; adjust free space pointer + pop bp ; BP = start address of allocated memory + mov [di], bp ; set start address of allocated memory at next + ; allocation block's free space address. + pop di ; restore DI + pop ax ; restore AX + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Free allocated memory +; +; Returns: +; BP = start address of previously allocated memory +; +free: + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; lookUpBTree - initializes a new BTree instance and +; look up for HFSPlus Catalog File or Extent Overflow keys +; +; Arguments: +; AL = kHFSPlusFileID (Catalog or Extents Overflow) +; SI = address of searchKey +; DI = address of HFSPlusForkData.extents +; +; Returns: +; BP = address of BTree instance +; ECX = rootNode's logical offset in sectors +; +lookUpBTree: + mov cx, BTree_size ; allocate memory with BTree_size + call malloc ; BP = start address of allocated memory. + mov [bp + BTree.fileID], al ; save fileFileID + mov edx, [di] ; first extent of current file + call blockToSector ; ECX = converted to sector unit + mov al, 1 ; 1 sector is enough for + xor edx, edx ; reading current file's header. + lea dx, [bp + BTree.BTHeaderBuffer] ; load into BTreeHeaderBuffer + call readLBA ; read + mov ax, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.nodeSize] + xchg ah, al ; convert to little-endian + mov [bp + BTree.nodeSize], ax ; save nodeSize + + ; + ; Always start the lookup process with the root node. + ; + mov edx, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.rootNode] + +.readNode: + ; + ; Converting nodeID to sector unit + ; + + pushad + PrintChar('n') + mov eax, edx + bswap eax + PrintHex() + popad + + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + mov bx, ax ; BX = read sector count + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with nodeSize converted to sector unit + mov ecx, eax ; ECX = file offset in BTree + + mov eax, [bp + BTree.fileID] + lea edx, [bp + BTree.nodeBuffer] + call readExtent + + ; + ; AX = lowerBound = 0 + ; + xor ax, ax + + ; + ; BX = upperBound = numRecords - 1 + ; + mov bx, [bp + BTree.nodeBuffer + BTNodeDescriptor.numRecords] + xchg bh, bl + + pushad + PrintChar('u') + mov ax,bx + cwde + PrintHex() + popad + + dec bx + +.bsearch: + cmp ax, bx + ja .checkResult ; jump if lowerBound > upperBound + + mov cx, ax + add cx, bx + shr cx, 1 ; test index = (lowerBound + upperBound / 2) + + pushad + PrintChar('i') + mov ax,cx + cwde + PrintHex() + popad + + call getBTreeRecord + +%if UNUSED + pushad + jl .csearchLessThanTrial + jg .csearchGreaterThanTrial + PrintChar('=') + jmp .csearchCont +.csearchGreaterThanTrial: + PrintChar('>') + jmp .csearchCont +.csearchLessThanTrial: + PrintChar('<') +.csearchCont: + popad +%endif ; UNUSED + +.adjustBounds: + je .checkResult + jl .searchLessThanTrial + jg .searchGreaterThanTrial + jmp .bsearch + +.searchLessThanTrial: + mov bx, cx + dec bx ; upperBound = index - 1 + jmp .bsearch + +.searchGreaterThanTrial: + mov ax, cx + inc ax ; lowerBound = index + 1 + jmp .bsearch + +.checkResult: + cmp BYTE [bp + BTree.searchResult], 0 + jge .foundKey + + mov cx, bx + call getBTreeRecord + +.foundKey: + cmp BYTE [bp + BTree.nodeBuffer + BTNodeDescriptor.kind], kBTIndexNode + jne .exit + + lea bx, [bp + BTree.recordDataPtr] + mov bx, [bx] + mov edx, [bx] + jmp .readNode + +.exit: + cmp BYTE [bp + BTree.searchResult], 0 + ret + +;-------------------------------------------------------------------------- +; getBTreeRecord - read and compare BTree record +; +; Arguments: +; CX = record index +; SI = address of search key +; +; Returns: +; [BTree.searchResult] = result of key compare +; [BTree.recordDataPtr] = address of record data +; +getBTreeRecord: + pushad + push si ; save SI + lea di, [bp + BTree.nodeBuffer] ; DI = start of nodeBuffer + push di ; use later + mov ax, [bp + BTree.nodeSize] ; get nodeSize + add di, ax ; DI = beyond nodeBuffer + inc cx ; increment index + shl cx, 1 ; * 2 + sub di, cx ; DI = pointer to record + mov ax, [di] ; offset to record + xchg ah, al ; convert to little-endian + pop di ; start of nodeBuffer + add di, ax ; DI = address of record key + mov si, di ; save to SI + mov ax, [di] ; keyLength + xchg ah, al ; convert to little-endian + inc ax ; suppress keySize (2 bytes) + inc ax ; + add di, ax ; DI = address of record data + mov [bp + BTree.recordDataPtr], di ; save address of record data + lea di, [bp + BTree.trialKey] + push di ; save address of trialKey + lodsw ; suppress keySize (2 bytes) + ; + ; Don't need to compare as DWORD since all reserved CNIDs fits to a single byte + ; + cmp BYTE [bp + BTree.fileID], kHFSCatalogFileID + je .prepareTrialCatalogKey + +.prepareTrialExtentKey: + mov bx, compareHFSPlusExtentKeys + movsw ; copy forkType + pad + mov cx, 2 ; copy fileID + startBlock + +.extentLoop: + lodsd + bswap eax ; convert to little-endian + stosd + loop .extentLoop + jmp .exit + +.prepareTrialCatalogKey: + mov bx, compareHFSPlusCatalogKeys + lodsd + bswap eax ; convert ParentID to little-endian + stosd + call ConvertHFSUniStr255ToLE ; convert nodeName to little-endian + +.exit: + pop di ; restore address of trialKey + +%if DEBUG +; +; Print catalog trial key +; + pushad + mov si, di + lodsd + PrintChar('k') + PrintHex() + lodsw + cmp ax, 0 + je .printExit + mov cx, ax +.printLoop: + lodsw + call print_char + loop .printLoop +.printExit: + popad +; +; +; +%endif ; DEBUG + +%if UNUSED +; +; Print extent trial key +; + pushad + PrintChar('k') + mov si, di + xor eax, eax + lodsw + PrintHex() + lodsd + PrintHex() + lodsd + PrintHex() + popad +; +; +; +%endif ; UNUSED + + pop si ; restore SI + call bx ; call key compare proc + popad + ret + +;-------------------------------------------------------------------------- +; readExtent - read extents from a HFS+ file (multiple extent support) +; +; Arguments: +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData.extents +; +readExtent: + pushad + ; + ; Save Catalog File ID as part of a search HFSPlusExtentKey + ; for a possible Extents Overflow lookup. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.fileID], eax + mov [bp + BTree.readBufferPtr], edx + mov ax, bx + cwde + mov [bp + BTree.readSize], eax + mov ebx, ecx ; EBX = file offset + xor eax, eax + mov [bp + BTree.currentExtentOffs], eax + +.beginExtentBlock: + mov BYTE [bp + BTree.extentCount], 0 + +.extentSearch: + cmp BYTE [bp + BTree.extentCount], kHFSPlusExtentDensity + jb .continue + +.getNextExtentBlock: + push ebx + mov eax, [bp + BTree.currentExtentOffs] + + ; + ; Converting sector unit to HFS+ allocation block unit. + ; + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + + ; + ; Preparing searchExtentKey's startBlock field. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.startBlock], eax + + mov al, kHFSExtentsFileID + lea si, [bp + BTree.searchExtentKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.extentsFile + HFSPlusForkData.extents] + call lookUpBTree + jnz NEAR .exit + + ; + ; BP points to the new workspace allocated by lookUpBTree. + ; + lea di, [bp + BTree.recordDataPtr] + mov di, [di] + + ; + ; Switch back to the previous workspace. + ; + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + + pop ebx + jmp .beginExtentBlock + +.continue: + mov edx, [di + HFSPlusExtentDescriptor.blockCount] + call blockToSector ; ECX = converted current extent's blockCount to sectors + mov eax, [bp + BTree.currentExtentOffs] ; EAX = current extent's start offset (sector) + mov edx, eax + add edx, ecx ; EDX = next extent's start offset (sector) + cmp ebx, edx + mov [bp + BTree.currentExtentOffs], edx ; set currentExtentOffs as the next extent's start offset + jae .nextExtent ; jump to next extent if file offset > next extent's start offset + +.foundExtent: + mov edx, ebx + sub edx, eax ; EDX = relative offset within current extent + mov eax, edx ; will be used below to determine read size + mov esi, [bp + BTree.readSize] ; ESI = remaining sectors to be read + add edx, esi + cmp edx, ecx ; test if relative offset + readSize fits to this extent + jbe .read ; read all remaining sectors from this extent + +.splitRead: + sub ecx, eax ; read amount of sectors beginning at relative offset + mov esi, ecx ; of current extent up to the end of current extent + +.read: + mov edx, [di + HFSPlusExtentDescriptor.startBlock] + call blockToSector ; ECX = converted to sectors + add ecx, eax ; file offset converted to sectors + + push si + mov ax, si + mov edx, [bp + BTree.readBufferPtr] + + pushad + PrintChar('s') + mov eax, ecx + PrintHex() + popad + + call readSectors + pop si + + add ebx, esi + mov ax, si + cwde + shl ax, 9 ; convert SI (read sector count) to byte unit + add [bp + BTree.readBufferPtr], eax + sub [bp + BTree.readSize], esi + + jz .exit + +.nextExtent: + add di, kHFSPlusExtentDensity + inc BYTE [bp + BTree.extentCount] + jmp .extentSearch + +.exit: + popad + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; readExtent - read extents from a HFS+ file (single extent support) +; +; Arguments: +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData.extents +; +readExtent: + ; + ; Save Catalog File ID as part of a search HFSPlusExtentKey + ; for a possible Extents Overflow lookup. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.fileID], eax + push edx + mov eax, ecx ; EAX = relative offset in sectors + mov edx, [di] + bswap edx + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.startBlock], edx + bswap edx + call blockToSector ; ECX = starting block of current extent + add ecx, eax ; ECX = relative sector within current partition + pop edx + mov al, bl + call readLBA + ret + +%endif ; UNUSED + + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert sector unit to HFSPlus allocation block unit +; +; Arguments: +; EDX = sector +; +; Returns: +; ECX = converted to allocation block unit +; +; Clobber list: +; EDX +; +sectorToBlock: + push eax + mov eax, edx + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian BTree node ID to sector unit +; +; Arguments: +; EDX = node ID +; +; Returns: +; ECX = node ID converted to sector unit +; +; Clobber list: +; EDX +; +nodeToSector: + push eax + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with node ID + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +root_str db '/boot', NULL +%endif + +searchCatalogKey dd kHFSRootFolderID + dw searchCatKeyNameLen +searchCatKeyName dw 'b', 'o', 'o', 't' ; must be upper case +searchCatKeyNameLen EQU ($ - searchCatKeyName) / 2 + +;-------------------------------------------------------------------------- +; Pad the rest of the 4096 byte sized loader with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +pad_sectors: + times kBoot1ExtSize-($-$$) db 0 + +; +; Local BTree variables +; + struc BTree +.mallocLink resw 1 ; pointer to previously allocated memory block +.fileID resd 1 ; will use as BYTE +.nodeSize resd 1 ; will use as WORD +.searchExtentKey resb HFSPlusExtentKey_size +.searchResult resb 1 +.trialKey resb kBTMaxRecordLength +.recordDataPtr resw 1 +.readBufferPtr resd 1 +.currentExtentOffs resd 1 +.readSize resd 1 +.extentCount resb 1 + ALIGNB 2 +.BTHeaderBuffer resb kSectorBytes +.nodeBuffer resb maxNodeSize + endstruc + +; +; Global variables +; + + ABSOLUTE kHFSPlusBuffer + HFSPlusVolumeHeader_size + +gPartLBA resd 1 +gBIOSDriveNumber resw 1 +gBlockSize resd 1 +gMallocPtr resw 1 + +; END diff --git a/i386/boot1/.svn/text-base/boot1hp.s.svn-base b/i386/boot1/.svn/text-base/boot1hp.s.svn-base new file mode 100644 index 0000000..fe12b8c --- /dev/null +++ b/i386/boot1/.svn/text-base/boot1hp.s.svn-base @@ -0,0 +1,693 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Preloader: boot1hp +; +; This program is designed to reside in sector 0 of an HFS+ partition. +; It expects that the MBR has left the drive number in DL +; and a pointer to the partition entry in SI. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1hp.s -o boot1hp + +; +; This version of boot1hp tries to find a boot1h extended loader. +; If it fails then uses the traditional method by loading the startupfile. +; +; Written by zef @ 2008-04-17 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +maxSectorCount EQU 64 ; maximum sector count for read_sectors + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address +kHFSPlusBuffer EQU kBoot1RelocAddr + kSectorBytes ; HFS+ Volume Header address + +kBoot1ExtSector EQU 40 +kBoot1ExtSignature EQU 'b1he' + +kBoot2Sectors EQU 126 ; sectors to load for boot2 +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +;------------------------------------------------------------------------- +; HFS+ related structures and constants +; +kHFSPlusSignature EQU 'H+' ; HFS+ volume signature +kHFSPlusCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kHFSPlusCaseSigX EQU 'X' ; upper byte of HFS+ volume case-sensitive signature +kHFSPlusExtentDensity EQU 8 ; 8 extent descriptors / extent record + +; +; HFSPlusExtentDescriptor +; + struc HFSPlusExtentDescriptor +.startBlock resd 1 +.blockCount resd 1 + endstruc + +; +; HFSPlusForkData +; + struc HFSPlusForkData +.logicalSize resq 1 +.clumpSize resd 1 +.totalBlocks resd 1 +.extents resb kHFSPlusExtentDensity * HFSPlusExtentDescriptor_size + endstruc + +; +; HFSPlusVolumeHeader +; + struc HFSPlusVolumeHeader +.signature resw 1 +.version resw 1 +.attributes resd 1 +.lastMountedVersion resd 1 +.journalInfoBlock resd 1 +.createDate resd 1 +.modifyDate resd 1 +.backupDate resd 1 +.checkedDate resd 1 +.fileCount resd 1 +.folderCount resd 1 +.blockSize resd 1 +.totalBlocks resd 1 +.freeBlocks resd 1 +.nextAllocation resd 1 +.rsrcClumpSize resd 1 +.dataClumpSize resd 1 +.nextCatalogID resd 1 +.writeCount resd 1 +.encodingsBitmap resq 1 +.finderInfo resd 8 +.allocationFile resb HFSPlusForkData_size +.extentsFile resb HFSPlusForkData_size +.catalogFile resb HFSPlusForkData_size +.attributesFile resb HFSPlusForkData_size +.startupFile resb HFSPlusForkData_size + endstruc + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Relocate boot1 code. + ; + push si + mov si, kBoot1LoadAddr ; si <- source + mov di, kBoot1RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes ; copy 256 words + rep movsb ; repeat string move (word) operation + pop si + + ; + ; Code relocated, jump to startReloc in relocated location. + ; + ; FIXME: Is there any way to instruct NASM to compile a near jump + ; using absolute address instead of relative displacement? + ; + jmpabs startReloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +startReloc: + + ; + ; Initializing global variables. + ; + mov eax, [si + part.lba] + mov [gPartLBA], eax ; save the current partition LBA offset + mov [gBIOSDriveNumber], dl ; save BIOS drive number + + ; + ; Loading HFS+ Volume Header. + ; + mov ecx, 2 ; sector 2 of current partition + mov al, 1 ; read HFS+ Volume Header + mov edx, kHFSPlusBuffer + call readLBA + jc NEAR bios_read_error + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kHFSPlusBuffer + HFSPlusVolumeHeader.signature] + cmp ax, kHFSPlusCaseSignature + je .foundHFSPlus + cmp ax, kHFSPlusSignature + jne NEAR hfsp_error + +.foundHFSPlus: + ; + ; Loading first sector of boot1h extended code. + ; + mov eax, [gPartLBA] ; save starting LBA of current partition + push eax + xor eax, eax + mov [gPartLBA], eax ; will be read sectors from the beginning of the disk + mov ecx, kBoot1ExtSector ; sector 1 of boot1h extended code + mov al, 1 ; read HFS+ Volume Header + mov edx, kBoot1LoadAddr + call readLBA + jc bios_read_error + pop eax + mov [gPartLBA], eax ; restore starting LBA of current partition + + ; + ; Looking for boot1h extended code signature. + ; + cmp WORD [kBoot1LoadAddr + kSectorBytes - 2], kBootSignature + jne boot1h_ext_not_found + cmp DWORD [kBoot1LoadAddr + kSectorBytes - 6], kBoot1ExtSignature + jne boot1h_ext_not_found + +%if VERBOSE + LogString(boot1he_start_str) +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmpabs kBoot1LoadAddr + +boot1h_ext_not_found: + +%if VERBOSE + LogString(boot1he_error_str) +%endif + + ; + ; Initializing more global variables. + ; + mov eax, [kHFSPlusBuffer + HFSPlusVolumeHeader.blockSize] + bswap eax ; convert to little-endian + shr eax, 9 ; convert to sector unit + mov [gBlockSize], eax ; save blockSize as little-endian sector unit! + +;-------------------------------------------------------------------------- +; findStartup - Find HFS+ startup file in a partition. +; +findStartup: + mov edx, [kHFSPlusBuffer + HFSPlusVolumeHeader.startupFile + HFSPlusForkData.extents] + call blockToSector ; result in ECX + or ecx, ecx + je startupfile_error + + mov al, kBoot2Sectors + mov edx, (kBoot2Segment << 4) + kBoot2Address + call readLBA + jc bios_read_error + +%if VERBOSE + LogString(startupfile_str) +%endif + + ; + ; Jump to boot2. + ; +boot2: + +%if DEBUG + DebugChar ('!') +%endif + + call getc + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +bios_read_error: + +%if VERBOSE + LogString(bios_error_str) +%endif + + jmp hang + +startupfile_error: + +%if VERBOSE + LogString(startupfile_err_str) +%endif + + jmp hang + +hfsp_error: + +%if VERBOSE + LogString(hfsp_error_str) +%endif + +hang: + hlt + jmp hang + +%if UNUSED + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc bios_read_error + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + jnc .exit + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Convert big-endian HFSPlus allocation block to sector unit +; +; Arguments: +; EDX = allocation block +; +; Returns: +; ECX = allocation block converted to sector unit +; +; Clobber list: +; EDX +; +blockToSector: + push eax + mov eax, [gBlockSize] + bswap edx ; convert allocation block to little-endian + mul edx ; multiply with block number + mov ecx, eax ; result in EAX + pop eax + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'boot1: ', NULL +boot1he_error_str db 'extended block signature not found', NULL +startupfile_err_str db 'startupfile not found', NULL +hfsp_error_str db 'HFS+ signature error', NULL +bios_error_str db 'BIOS int 13h error', NULL +startupfile_str db 'loading startupfile', NULL +boot1he_start_str db 'starting extended block', NULL +%endif ; VERBOSE + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + +; +; Global variables +; + + ABSOLUTE kHFSPlusBuffer + HFSPlusVolumeHeader_size + +gPartLBA resd 1 +gBIOSDriveNumber resw 1 +gBlockSize resd 1 + +; END diff --git a/i386/boot1/Cconfig b/i386/boot1/Cconfig new file mode 100644 index 0000000..9e231a7 --- /dev/null +++ b/i386/boot1/Cconfig @@ -0,0 +1,47 @@ +# +# boot1h +# +config BOOT1_HFS + bool "boot1h second stage booter" + default y + help + Say Y here if you want to compile the default second + stage bootloader. + +config BOOT1_HFS_DEBUG + bool "debug support" + default n + depends on BOOT1_HFS + help + Say Y here if you want to enable boot1h debug messages. + +config BOOT1_HFS_VERBOSE + bool "verbose support" + default y + depends on BOOT1_HFS + help + Say Y here if you want to enable boot1h verbose messages. + +# +# boot1he +# +config BOOT1_HFS_ACTIVE + bool "boot1he second stage booter" + default y + help + Say Y here if you want to compile the boot1he second + stage bootloader. + +config BOOT1_HFS_ACTIVE_DEBUG + bool "debug support" + default n + depends on BOOT1_HFS_ACTIVE + help + Say Y here if you want to enable boot1he debug messages. + +config BOOT1_HFS_ACTIVE_VERBOSE + bool "verbose support" + default y + depends on BOOT1_HFS_ACTIVE + help + Say Y here if you want to enable boot1he verbose messages. diff --git a/i386/boot1/Makefile b/i386/boot1/Makefile new file mode 100644 index 0000000..65e334c --- /dev/null +++ b/i386/boot1/Makefile @@ -0,0 +1,45 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/boot1 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +include ${SRCROOT}/Make.rules + +DIR = boot1 + +DIRS_NEEDED = $(SYMROOT) + +VERS = `vers_string -f 5.0 | tr - .` +NEW_VERS = Darwin boot1h v$(VERS) + +PROGRAMS = boot1hp boot1f32 + +ifeq (${CONFIG_BOOT1_HFS}, y) +PROGRAMS += boot1h +endif + +ifeq (${CONFIG_BOOT1_HFS_ACTIVE}, y) +PROGRAMS += boot1he +endif + + +PROGRAMS := $(addprefix $(SYMROOT)/, $(PROGRAMS)) + +all: $(DIRS_NEEDED) $(PROGRAMS) + + +$(PROGRAMS): $(SRCROOT)/autoconf.inc + @echo "\t[NASM] $(@F)" + @$(NASM) $(@F).s -o $@ + +install_i386:: all $(INSTALLDIR) + cp $(SYMROOT)/boot1h $(INSTALLDIR)/ + cd $(INSTALLDIR); chmod u+w $(VERSIONED_FILES) + +clean-local: + @for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @rm -f $(PROGRAMS) diff --git a/i386/boot1/boot1f32-install.sh b/i386/boot1/boot1f32-install.sh new file mode 100755 index 0000000..b75ed32 --- /dev/null +++ b/i386/boot1/boot1f32-install.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# boot1f32-install.sh +# +# Created by mackerintel on 2/2/09. +# Copyright 2009 mackerintel. All rights reserved. + +if [[ x$1 == x ]]; then + echo Usage: $0 disknumber; + exit 0; +fi + +if [[ `dd if=/dev/disk${1}s1 count=8 bs=1 skip=82 | uuencode -m -|head -n 2|tail -n 1` != "RkFUMzIgICA=" ]]; then + echo "/dev/disk${1}s1" "isn't" a FAT32 partition; + exit 1; +fi + +if [ ! -f boot1f32 ]; then + echo "boot1f32 not found"; + exit 1; +fi + +dd if=/dev/disk${1}s1 count=1 bs=512 of=/tmp/origbs +cp boot1f32 /tmp/newbs +dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc +dd of=/dev/disk${1}s1 count=1 bs=512 if=/tmp/newbs diff --git a/i386/boot1/boot1f32.s b/i386/boot1/boot1f32.s new file mode 100644 index 0000000..b0b343d --- /dev/null +++ b/i386/boot1/boot1f32.s @@ -0,0 +1,636 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Loader: boot1f32 +; +; This program is designed to reside in sector 0 of a FAT32 partition. +; It expects that the MBR has left the drive number in DL +; and a pointer to the partition entry in SI. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1f32.s -o boot1f32 +; +; dd if=origbs of=newbs skip=3 seek=3 bs=1 count=87 conv=notrunc +; + +; +; This version of boot1f32 tries to find a stage2 boot file in the root folder. +; +; Written by mackerintel on 2009-01-26 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Set to 1 to make this stage 1 loader expecting arguments in SI and DL registers. +; +USESIDL EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +maxSectorCount EQU 64 ; maximum sector count for readSectors +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address + +kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +FATBUF EQU 0x7000 ; Just place for one sectors +DIRBUFSEG EQU 0x1000 ; Cluster sizes >64KB aren't supported + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + + struc direntry +.nameext resb 11 +.attr resb 1 +.nused1 resb 8 +.highclus resw 1 +.nused2 resb 4 +.lowclus resw 1 +.size resd 1 + endstruc + + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1LoadAddr + + jmp start + times 3-($-$$) nop + +gOEMName times 8 db 0 ;OEMNAME +gBPS dw 0 +gSPC db 0 +gReservedSectors dw 0 +gNumFats db 0 +gCrap1 times 11 db 0 +gPartLBA dd 0 +gPartSize dd 0 +gSectPerFat dd 0 +gCrap2 times 4 db 0 +gRootCluster dd 0 +gCrap3 times 16 db 0 + +gBIOSDriveNumber db 0 +gExtInfo times 25 db 0 +gFileName db "BOOT " + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor eax, eax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Initializing global variables. + ; + mov ax, word [gReservedSectors] +%if USESIDL + add eax, [si + part.lba] +%else + add eax, [gPartLBA] +%endif + mov [gPartLBA], eax ; save the current FAT LBA offset +%if USESIDL + mov [gBIOSDriveNumber], dl ; save BIOS drive number +%endif + xor eax,eax + mov al, [gNumFats] + mul dword [gSectPerFat] + mov [gSectPerFat], eax + +;-------------------------------------------------------------------------- +; Find stage2 boot file in a FAT32 Volume's root folder. +; +findRootBoot: + +%if VERBOSE + LogString(init_str) +%endif + + mov eax, [gRootCluster] + +nextdirclus: + mov edx, DIRBUFSEG<<4 + call readCluster + jc error + xor si, si + mov bl, [gSPC] + shl bx, 9 + add bx, si + +nextdirent: + mov di, gFileName + push ds + push DIRBUFSEG + pop ds + mov cl, [si] + test cl, cl + jz dserror + mov cx, 11 + repe cmpsb + jz direntfound + +falsealert: + pop ds + add cl, 21 + add si, cx + cmp si, bx + jz nextdirclus + jmp nextdirent + +direntfound: +; test byte [ds:si+direntry.attr-11], 0x18 + lodsb + test al, 0x18 + jnz falsealert + push WORD [si + direntry.highclus - 12] + push WORD [si + direntry.lowclus - 12] + pop eax + pop ds + mov edx, (kBoot2Segment << 4) + kBoot2Address + +cont_read: + push edx + call readCluster + pop edx + pushf + xor ebx,ebx + mov bl, [gSPC] + shl ebx, 9 + add edx, ebx + popf + jnc cont_read + +boot2: + +%if DEBUG + DebugChar ('!') +%endif + +%if UNUSED + ; + ; Waiting for a key press. + ; + + mov ah, 0 + int 0x16 +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +dserror: + pop ds + +error: + +%if VERBOSE + LogString(error_str) +%endif + +hang: + hlt + jmp hang + + ; readCluster - Reads cluster EAX to (EDX), updates EAX to next cluster +readCluster: + cmp eax, 0x0ffffff8 + jb do_read + stc + ret + +do_read: + push eax + xor ecx,ecx + dec eax + dec eax + mov cl, [gSPC] + push edx + mul ecx + pop edx + add eax, [gSectPerFat] + mov ecx, eax + xor ah,ah + mov al, [gSPC] + call readSectors + jc clusend + pop ecx + push cx + shr ecx, 7 + xor ax, ax + inc ax + mov edx, FATBUF + call readSectors + jc clusend + pop si + and si, 0x7f + shl si, 2 + mov eax, [FATBUF + si] + and eax, 0x0fffffff + clc + ret + +clusend: + pop eax + ret + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jc error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; +; xor ax, ax ; Func 0 +; int 0x13 ; INT 13 +; stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'b1f: ', NULL +init_str db 'init', NULL +error_str db 'error', NULL +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + + ABSOLUTE kBoot1LoadAddr + kSectorBytes + +; END diff --git a/i386/boot1/boot1h.s b/i386/boot1/boot1h.s new file mode 100644 index 0000000..3e58465 --- /dev/null +++ b/i386/boot1/boot1h.s @@ -0,0 +1,1486 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Loader: boot1h +; +; This program is designed to reside in sector 0+1 of an HFS+ partition. +; It expects that the MBR has left the drive number in DL +; and a pointer to the partition entry in SI. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1.s -o boot1h + +; +; This version of boot1h tries to find a stage2 boot file in the root folder. +; +; NOTE: this is an experimental version with multiple extent support. +; +; Written by Tams Kosrszky on 2008-04-14 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT1_HFS_DEBUG + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU CONFIG_BOOT1_HFS_VERBOSE + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +mallocStart EQU 0x1000 ; start address of local workspace area +maxSectorCount EQU 64 ; maximum sector count for readSectors +maxNodeSize EQU 16384 + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address +kBoot1Sector1Addr EQU kBoot1RelocAddr + kSectorBytes ; boot1 load address for sector 1 +kHFSPlusBuffer EQU kBoot1Sector1Addr + kSectorBytes ; HFS+ Volume Header address + +kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +;------------------------------------------------------------------------- +; HFS+ related structures and constants +; +kHFSPlusSignature EQU 'H+' ; HFS+ volume signature +kHFSPlusCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kHFSPlusCaseSigX EQU 'X' ; upper byte of HFS+ volume case-sensitive signature +kHFSPlusExtentDensity EQU 8 ; 8 extent descriptors / extent record + +; +; HFSUniStr255 +; + struc HFSUniStr255 +.length resw 1 +.unicode resw 255 + endstruc + +; +; HFSPlusExtentDescriptor +; + struc HFSPlusExtentDescriptor +.startBlock resd 1 +.blockCount resd 1 + endstruc + +; +; HFSPlusForkData +; + struc HFSPlusForkData +.logicalSize resq 1 +.clumpSize resd 1 +.totalBlocks resd 1 +.extents resb kHFSPlusExtentDensity * HFSPlusExtentDescriptor_size + endstruc + +; +; HFSPlusVolumeHeader +; + struc HFSPlusVolumeHeader +.signature resw 1 +.version resw 1 +.attributes resd 1 +.lastMountedVersion resd 1 +.journalInfoBlock resd 1 +.createDate resd 1 +.modifyDate resd 1 +.backupDate resd 1 +.checkedDate resd 1 +.fileCount resd 1 +.folderCount resd 1 +.blockSize resd 1 +.totalBlocks resd 1 +.freeBlocks resd 1 +.nextAllocation resd 1 +.rsrcClumpSize resd 1 +.dataClumpSize resd 1 +.nextCatalogID resd 1 +.writeCount resd 1 +.encodingsBitmap resq 1 +.finderInfo resd 8 +.allocationFile resb HFSPlusForkData_size +.extentsFile resb HFSPlusForkData_size +.catalogFile resb HFSPlusForkData_size +.attributesFile resb HFSPlusForkData_size +.startupFile resb HFSPlusForkData_size + endstruc + +; +; B-tree related structures and constants +; + +kBTIndexNode EQU 0 +kBTMaxRecordLength EQU 264 ; sizeof(kHFSPlusFileThreadRecord) +kHFSRootParentID EQU 1 ; Parent ID of the root folder +kHFSRootFolderID EQU 2 ; Folder ID of the root folder +kHFSExtentsFileID EQU 3 ; File ID of the extents overflow file +kHFSCatalogFileID EQU 4 ; File ID of the catalog file +kHFSPlusFileRecord EQU 0x200 +kForkTypeData EQU 0 +kForkTypeResource EQU 0xFF + +; +; BTNodeDescriptor +; + struc BTNodeDescriptor +.fLink resd 1 +.bLink resd 1 +.kind resb 1 +.height resb 1 +.numRecords resw 1 +.reserved resw 1 + endstruc + +; +; BTHeaderRec +; + struc BTHeaderRec +.treeDepth resw 1 +.rootNode resd 1 +.leafRecords resd 1 +.firstLeafNode resd 1 +.lastLeafNode resd 1 +.nodeSize resw 1 +.maxKeyLength resw 1 +.totalNodes resd 1 +.freeNodes resd 1 +.reserved1 resw 1 +.clumpSize resd 1 +.btreeType resb 1 +.keyCompareType resb 1 +.attributes resd 1 +.reserved3 resd 16 + endstruc + +; +; BTIndexRec +; + struc BTIndexRec +.childID resd 1 + endstruc + +; +; HFSPlusCatalogKey +; + struc HFSPlusCatalogKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.parentID resd 1 +.nodeName resb HFSUniStr255_size + endstruc + +; +; HFSPlusExtentKey +; + struc HFSPlusExtentKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.forkType resb 1 +.pad resb 1 +.fileID resd 1 +.startBlock resd 1 + endstruc + +; +; HFSPlusBSDInfo +; + struc HFSPlusBSDInfo +.ownerID resd 1 +.groupID resd 1 +.adminFlags resb 1 +.ownerFlags resb 1 +.fileMode resw 1 +.special resd 1 + endstruc + +; +; FileInfo +; + struc FileInfo +.fileType resd 1 +.fileCreator resd 1 +.finderFlags resw 1 +.location resw 2 +.reservedField resw 1 + endstruc + +; +; ExtendedFileInfo +; + struc ExtendedFileInfo +.reserved1 resw 4 +.extFinderFlags resw 1 +.reserved2 resw 1 +.putAwayFolderID resd 1 + endstruc + +; +; HFSPlusCatalogFile +; + struc HFSPlusCatalogFile +.recordType resw 1 +.flags resw 1 +.reserved1 resd 1 +.fileID resd 1 +.createDate resd 1 +.contentModDate resd 1 +.attributeModDate resd 1 +.accessDate resd 1 +.backupDate resd 1 +.permissions resb HFSPlusBSDInfo_size +.userInfo resb FileInfo_size +.finderInfo resb ExtendedFileInfo_size +.textEncoding resd 1 +.reserved2 resd 1 +.dataFork resb HFSPlusForkData_size +.resourceFork resb HFSPlusForkData_size + endstruc + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Relocate boot1 code. + ; + push si + mov si, kBoot1LoadAddr ; si <- source + mov di, kBoot1RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes ; copy 256 words + rep movsb ; repeat string move (word) operation + pop si + + ; + ; Code relocated, jump to startReloc in relocated location. + ; + ; FIXME: Is there any way to instruct NASM to compile a near jump + ; using absolute address instead of relative displacement? + ; + jmpabs startReloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +startReloc: + + ; + ; Initializing global variables. + ; + mov eax, [si + part.lba] + mov [gPartLBA], eax ; save the current partition LBA offset + mov [gBIOSDriveNumber], dl ; save BIOS drive number + mov WORD [gMallocPtr], mallocStart ; set free space pointer + + ; + ; Loading upper 512 bytes of boot1h and HFS+ Volume Header. + ; + xor ecx, ecx ; sector 1 of current partition + inc ecx + mov al, 2 ; read 2 sectors: sector 1 of boot1h + HFS+ Volume Header + mov edx, kBoot1Sector1Addr + call readLBA + + ; + ; Initializing more global variables. + ; + mov eax, [kHFSPlusBuffer + HFSPlusVolumeHeader.blockSize] + bswap eax ; convert to little-endian + shr eax, 9 ; convert to sector unit + mov [gBlockSize], eax ; save blockSize as little-endian sector unit! + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kHFSPlusBuffer + HFSPlusVolumeHeader.signature] + cmp ax, kHFSPlusCaseSignature + je findRootBoot + cmp ax, kHFSPlusSignature + jne error + +;-------------------------------------------------------------------------- +; Find stage2 boot file in a HFS+ Volume's root folder. +; +findRootBoot: + mov al, kHFSCatalogFileID + lea si, [searchCatalogKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.catalogFile + HFSPlusForkData.extents] + call lookUpBTree + jne error + + lea si, [bp + BTree.recordDataPtr] + mov si, [si] + cmp WORD [si], kHFSPlusFileRecord + jne error + +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData + + ; + ; Use the second big-endian double-word as the file length in HFSPlusForkData.logicalSize + ; + mov ebx, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.logicalSize + 4] + bswap ebx ; convert file size to little-endian + add ebx, kSectorBytes - 1 ; adjust size before unit conversion + shr ebx, 9 ; convert file size to sector unit + cmp bx, kBoot2Sectors ; check if bigger than max stage2 size + ja error + mov eax, [si + HFSPlusCatalogFile.fileID] + bswap eax ; convert fileID to little-endian + xor ecx, ecx + mov edx, (kBoot2Segment << 4) + kBoot2Address + lea di, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.extents] + call readExtent + +%if VERBOSE + LogString(root_str) +%endif + +boot2: + +%if DEBUG + DebugChar ('!') +%endif + +%if UNUSED + ; + ; Waiting for a key press. + ; + + mov ah, 0 + int 0x16 +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +error: + +%if VERBOSE + LogString(error_str) +%endif + +hang: + hlt + jmp hang + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jc error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; +; xor ax, ax ; Func 0 +; int 0x13 ; INT 13 +; stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert null terminated string to HFSUniStr255 +; +; Arguments: +; DS:DX pointer to a NULL terminated string. +; ES:DI pointer to result. +; +ConvertStrToUni: + pushad ; save registers + push di ; save DI for unicode string length pointer + mov si, dx ; use SI as source string pointer + xor ax, ax ; AX = unicode character + mov cl, al ; CL = string length + +.loop: + stosw ; store unicode character (length 0 at first run) + lodsb ; load next character to AL + inc cl ; increment string length count + cmp al, NULL ; check for string terminator + jne .loop + + pop di ; restore unicode string length pointer + dec cl ; ignoring terminator from length count + mov [di], cl ; save string length + popad ; restore registers + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian HFSUniStr255 to little-endian +; +; Arguments: +; DS:SI = pointer to big-endian HFSUniStr255 +; ES:DI = pointer to result buffer +; +ConvertHFSUniStr255ToLE: + pushad + lodsw + xchg ah, al + stosw + cmp al, 0 + je .exit + mov cx, ax + +.loop: + lodsw + xchg ah, al ; convert AX to little-endian + + ; + ; When working with a case-sensitive HFS+ (HX) filesystem, we shouldn't change the case. + ; + cmp BYTE [kHFSPlusBuffer + HFSPlusVolumeHeader.signature + 1], kHFSPlusCaseSigX + je .keepcase + + or ax, ax + jne .convertToLE + dec ax ; NULL must be the strongest char + +.convertToLE: + cmp ah, 0 + ja .keepcase + cmp al, 'A' + jb .keepcase + cmp al, 'Z' + ja .keepcase + add al, 32 ; convert to lower-case + +.keepcase: + stosw + loop .loop + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; compare HFSPlusExtentKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusExtentKeys: + pushad + + mov dl, 0 ; DL = result of comparison, DH = bestGuess + mov eax, [si + HFSPlusExtentKey.fileID] + cmp eax, [di + HFSPlusExtentKey.fileID] + jne .checkFlags + + cmp BYTE [si + HFSPlusExtentKey.forkType], kForkTypeData + jne .checkFlags + + mov eax, [si + HFSPlusExtentKey.startBlock] + cmp eax, [di + HFSPlusExtentKey.startBlock] + je compareHFSPlusCatalogKeys.exit + +.checkFlags: + ja compareHFSPlusCatalogKeys.searchKeyGreater ; search key > trial key + jb compareHFSPlusCatalogKeys.trialKeyGreater ; search key < trial key + +;-------------------------------------------------------------------------- +; Compare HFSPlusCatalogKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusCatalogKeys: + pushad + xor dx, dx ; DL = result of comparison, DH = bestGuess + xchg si, di + lodsd + mov ecx, eax ; ECX = trial parentID + xchg si, di + lodsd ; EAX = search parentID + cmp eax, ecx + ja .searchKeyGreater ; search parentID > trial parentID + jb .trialKeyGreater ; search parentID < trial parentID + +.compareNodeName: ; search parentID = trial parentID + xchg si, di + lodsw + mov cx, ax ; CX = trial nodeName.length + xchg si, di + lodsw ; AX = search nodeName.length + cmp cl, 0 ; trial nodeName.length = 0? + je .searchKeyGreater + + cmp ax, cx + je .strCompare + ja .searchStrLonger + +.trialStrLonger: + dec dh + mov cx, ax + jmp .strCompare + +.searchStrLonger: + inc dh + +.strCompare: + repe cmpsw + ja .searchKeyGreater + jb .trialKeyGreater + mov dl, dh + jmp .exit + +.trialKeyGreater: + dec dl + jmp .exit + +.searchKeyGreater: + inc dl + +.exit: + mov [bp + BTree.searchResult], dl + cmp dl, 0 ; set flags to check relation between keys + + popad + ret + +;-------------------------------------------------------------------------- +; Allocate memory +; +; Arguments: +; CX = size of requested memory +; +; Returns: +; BP = start address of allocated memory +; +; Clobber list: +; CX +; +malloc: + push ax ; save AX + push di ; save DI + mov di, [gMallocPtr] ; start address of free space + push di ; save free space start address + inc di ; + inc di ; keep the first word untouched + dec cx ; for the last memory block pointer. + dec cx ; + mov al, NULL ; fill with zero + rep stosb ; repeat fill + mov [gMallocPtr], di ; adjust free space pointer + pop bp ; BP = start address of allocated memory + mov [di], bp ; set start address of allocated memory at next + ; allocation block's free space address. + pop di ; restore DI + pop ax ; restore AX + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Free allocated memory +; +; Returns: +; BP = start address of previously allocated memory +; +free: + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +root_str db '/boot', NULL +%endif + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +; +; XXX - compilation errors with debug enabled (see comment above about nasm) +; Azi: boot1h.s:994: error: TIMES value -67 is negative +; +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + +; +; Sector 1 code area +; + +;-------------------------------------------------------------------------- +; lookUpBTree - initializes a new BTree instance and +; look up for HFSPlus Catalog File or Extent Overflow keys +; +; Arguments: +; AL = kHFSPlusFileID (Catalog or Extents Overflow) +; SI = address of searchKey +; DI = address of HFSPlusForkData.extents +; +; Returns: +; BP = address of BTree instance +; ECX = rootNode's logical offset in sectors +; +lookUpBTree: + mov cx, BTree_size ; allocate memory with BTree_size + call malloc ; BP = start address of allocated memory. + mov [bp + BTree.fileID], al ; save fileFileID + mov edx, [di] ; first extent of current file + call blockToSector ; ECX = converted to sector unit + mov al, 1 ; 1 sector is enough for + xor edx, edx ; reading current file's header. + lea dx, [bp + BTree.BTHeaderBuffer] ; load into BTreeHeaderBuffer + call readLBA ; read + mov ax, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.nodeSize] + xchg ah, al ; convert to little-endian + mov [bp + BTree.nodeSize], ax ; save nodeSize + + ; + ; Always start the lookup process with the root node. + ; + mov edx, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.rootNode] + +.readNode: + ; + ; Converting nodeID to sector unit + ; + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + mov bx, ax ; BX = read sector count + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with nodeSize converted to sector unit + mov ecx, eax ; ECX = file offset in BTree + + mov eax, [bp + BTree.fileID] + lea edx, [bp + BTree.nodeBuffer] + call readExtent + + ; + ; AX = lowerBound = 0 + ; + xor ax, ax + + ; + ; BX = upperBound = numRecords - 1 + ; + mov bx, [bp + BTree.nodeBuffer + BTNodeDescriptor.numRecords] + xchg bh, bl + dec bx + +.bsearch: + cmp ax, bx + ja .checkResult ; jump if lowerBound > upperBound + + mov cx, ax + add cx, bx + shr cx, 1 ; test index = (lowerBound + upperBound / 2) + + call getBTreeRecord + +%if UNUSED + pushad + jl .csearchLessThanTrial + jg .csearchGreaterThanTrial + PrintChar('=') + jmp .csearchCont +.csearchGreaterThanTrial: + PrintChar('>') + jmp .csearchCont +.csearchLessThanTrial: + PrintChar('<') +.csearchCont: + popad +%endif ; UNUSED + +.adjustBounds: + je .checkResult + jl .searchLessThanTrial + jg .searchGreaterThanTrial + jmp .bsearch + +.searchLessThanTrial: + mov bx, cx + dec bx ; upperBound = index - 1 + jmp .bsearch + +.searchGreaterThanTrial: + mov ax, cx + inc ax ; lowerBound = index + 1 + jmp .bsearch + +.checkResult: + cmp BYTE [bp + BTree.searchResult], 0 + jge .foundKey + + mov cx, bx + call getBTreeRecord + +.foundKey: + cmp BYTE [bp + BTree.nodeBuffer + BTNodeDescriptor.kind], kBTIndexNode + jne .exit + + lea bx, [bp + BTree.recordDataPtr] + mov bx, [bx] + mov edx, [bx] + jmp .readNode + +.exit: + cmp BYTE [bp + BTree.searchResult], 0 + ret + +;-------------------------------------------------------------------------- +; getBTreeRecord - read and compare BTree record +; +; Arguments: +; CX = record index +; SI = address of search key +; +; Returns: +; [BTree.searchResult] = result of key compare +; [BTree.recordDataPtr] = address of record data +; +getBTreeRecord: + pushad + push si ; save SI + lea di, [bp + BTree.nodeBuffer] ; DI = start of nodeBuffer + push di ; use later + mov ax, [bp + BTree.nodeSize] ; get nodeSize + add di, ax ; DI = beyond nodeBuffer + inc cx ; increment index + shl cx, 1 ; * 2 + sub di, cx ; DI = pointer to record + mov ax, [di] ; offset to record + xchg ah, al ; convert to little-endian + pop di ; start of nodeBuffer + add di, ax ; DI = address of record key + mov si, di ; save to SI + mov ax, [di] ; keyLength + xchg ah, al ; convert to little-endian + inc ax ; suppress keySize (2 bytes) + inc ax ; + add di, ax ; DI = address of record data + mov [bp + BTree.recordDataPtr], di ; save address of record data + lea di, [bp + BTree.trialKey] + push di ; save address of trialKey + lodsw ; suppress keySize (2 bytes) + ; + ; Don't need to compare as DWORD since all reserved CNIDs fits to a single byte + ; + cmp BYTE [bp + BTree.fileID], kHFSCatalogFileID + je .prepareTrialCatalogKey + +.prepareTrialExtentKey: + mov bx, compareHFSPlusExtentKeys + movsw ; copy forkType + pad + mov cx, 2 ; copy fileID + startBlock + +.extentLoop: + lodsd + bswap eax ; convert to little-endian + stosd + loop .extentLoop + jmp .exit + +.prepareTrialCatalogKey: + mov bx, compareHFSPlusCatalogKeys + lodsd + bswap eax ; convert ParentID to little-endian + stosd + call ConvertHFSUniStr255ToLE ; convert nodeName to little-endian + +.exit: + pop di ; restore address of trialKey + +%if UNUSED +; +; Print catalog trial key +; + pushad + mov si, di + lodsd + PrintChar('k') + PrintHex() + lodsw + cmp ax, 0 + je .printExit + mov cx, ax +.printLoop: + lodsw + call print_char + loop .printLoop +.printExit: + popad +; +; +; +%endif ; UNUSED + +%if UNUSED +; +; Print extent trial key +; + pushad + PrintChar('k') + mov si, di + xor eax, eax + lodsw + PrintHex() + lodsd + PrintHex() + lodsd + PrintHex() + popad +; +; +; +%endif ; UNUSED + + pop si ; restore SI + call bx ; call key compare proc + popad + ret + +;-------------------------------------------------------------------------- +; readExtent - read extents from a HFS+ file (multiple extent support) +; +; Arguments: +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData.extents +; +readExtent: + pushad + ; + ; Save Catalog File ID as part of a search HFSPlusExtentKey + ; for a possible Extents Overflow lookup. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.fileID], eax + mov [bp + BTree.readBufferPtr], edx + mov ax, bx + cwde + mov [bp + BTree.readSize], eax + mov ebx, ecx ; EBX = file offset + xor eax, eax + mov [bp + BTree.currentExtentOffs], eax + +.beginExtentBlock: + mov BYTE [bp + BTree.extentCount], 0 + +.extentSearch: + cmp BYTE [bp + BTree.extentCount], kHFSPlusExtentDensity + jb .continue + +.getNextExtentBlock: + push ebx + mov eax, [bp + BTree.currentExtentOffs] + + ; + ; Converting sector unit to HFS+ allocation block unit. + ; + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + + ; + ; Preparing searchExtentKey's startBlock field. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.startBlock], eax + + mov al, kHFSExtentsFileID + lea si, [bp + BTree.searchExtentKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.extentsFile + HFSPlusForkData.extents] + call lookUpBTree + jnz NEAR .exit + + ; + ; BP points to the new workspace allocated by lookUpBTree. + ; + lea di, [bp + BTree.recordDataPtr] + mov di, [di] + + ; + ; Switch back to the previous workspace. + ; + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + + pop ebx + jmp .beginExtentBlock + +.continue: + mov edx, [di + HFSPlusExtentDescriptor.blockCount] + call blockToSector ; ECX = converted current extent's blockCount to sectors + mov eax, [bp + BTree.currentExtentOffs] ; EAX = current extent's start offset (sector) + mov edx, eax + add edx, ecx ; EDX = next extent's start offset (sector) + cmp ebx, edx + mov [bp + BTree.currentExtentOffs], edx ; set currentExtentOffs as the next extent's start offset + jae .nextExtent ; jump to next extent if file offset > next extent's start offset + +.foundExtent: + mov edx, ebx + sub edx, eax ; EDX = relative offset within current extent + mov eax, edx ; will be used below to determine read size + mov esi, [bp + BTree.readSize] ; ESI = remaining sectors to be read + add edx, esi + cmp edx, ecx ; test if relative offset + readSize fits to this extent + jbe .read ; read all remaining sectors from this extent + +.splitRead: + sub ecx, eax ; read amount of sectors beginning at relative offset + mov esi, ecx ; of current extent up to the end of current extent + +.read: + mov edx, [di + HFSPlusExtentDescriptor.startBlock] + call blockToSector ; ECX = converted to sectors + add ecx, eax ; file offset converted to sectors + + push si + mov ax, si + mov edx, [bp + BTree.readBufferPtr] + call readSectors + pop si + + add ebx, esi + mov ax, si + cwde + shl ax, 9 ; convert SI (read sector count) to byte unit + add [bp + BTree.readBufferPtr], eax + sub [bp + BTree.readSize], esi + + jz .exit + +.nextExtent: + add di, kHFSPlusExtentDensity + inc BYTE [bp + BTree.extentCount] + jmp .extentSearch + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; Convert big-endian HFSPlus allocation block to sector unit +; +; Arguments: +; EDX = allocation block +; +; Returns: +; ECX = allocation block converted to sector unit +; +; Clobber list: +; EDX +; +blockToSector: + push eax + mov eax, [gBlockSize] + bswap edx ; convert allocation block to little-endian + mul edx ; multiply with block number + mov ecx, eax ; result in EAX + pop eax + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert sector unit to HFSPlus allocation block unit +; +; Arguments: +; EDX = sector +; +; Returns: +; ECX = converted to allocation block unit +; +; Clobber list: +; EDX +; +sectorToBlock: + push eax + mov eax, edx + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian BTree node ID to sector unit +; +; Arguments: +; EDX = node ID +; +; Returns: +; ECX = node ID converted to sector unit +; +; Clobber list: +; EDX +; +nodeToSector: + push eax + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with node ID + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'boot1: ', NULL +error_str db 'error', NULL +%endif + +searchCatalogKey dd kHFSRootFolderID + dw searchCatKeyNameLen +searchCatKeyName dw 'b', 'o', 'o', 't' ; must be lower case +searchCatKeyNameLen EQU ($ - searchCatKeyName) / 2 + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; + +; +; XXX - compilation errors with debug enabled +; Azi: boot1h.s:1452: error: TIMES value -64 is negative +; +pad_sector_1: + times 1022-($-$$) db 0 + dw kBootSignature + +; +; Local BTree variables +; + struc BTree +.mallocLink resw 1 ; pointer to previously allocated memory block +.fileID resd 1 ; will use as BYTE +.nodeSize resd 1 ; will use as WORD +.searchExtentKey resb HFSPlusExtentKey_size +.searchResult resb 1 +.trialKey resb kBTMaxRecordLength +.recordDataPtr resw 1 +.readBufferPtr resd 1 +.currentExtentOffs resd 1 +.readSize resd 1 +.extentCount resb 1 + ALIGNB 2 +.BTHeaderBuffer resb kSectorBytes +.nodeBuffer resb maxNodeSize + endstruc + +; +; Global variables +; + + ABSOLUTE kHFSPlusBuffer + HFSPlusVolumeHeader_size + +gPartLBA resd 1 +gBIOSDriveNumber resw 1 +gBlockSize resd 1 +gMallocPtr resw 1 + +; END diff --git a/i386/boot1/boot1he.s b/i386/boot1/boot1he.s new file mode 100644 index 0000000..7752733 --- /dev/null +++ b/i386/boot1/boot1he.s @@ -0,0 +1,1597 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Loader: boot1h extended sectors +; +; This program is designed to reside between sectors 40-47 of a block device. +; It expects that the partition boot loader left the drive number in DL +; and a pointer to the partition entry in SI. Starting sector of this loader +; should be passed in ECX. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1he.s -o boot1he + +; +; This version of boot1he tries to find a stage2 boot file in the root folder. +; +; +; Written by zef @ 2008-04-17, +; updated with large boot file loading support @ 2008-10-27 +; +; NOTE: this is an experimental version with multiple extent support. +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU CONFIG_BOOT1_HFS_ACTIVE_DEBUG + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU CONFIG_BOOT1_HFS_ACTIVE_VERBOSE + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +mallocStart EQU 0x1000 ; start address of local workspace area +maxSectorCount EQU 64 ; maximum sector count for readSectors +maxNodeSize EQU 16384 + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature +kBoot1ExtSize EQU 4096 +kBoot1ExtSignature EQU 'b1he' + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address +kBoot1ExtAddr EQU kBoot1RelocAddr + kSectorBytes ; boot1 load address for sector 41-47 +kHFSPlusBuffer EQU kBoot1RelocAddr + kBoot1ExtSize ; HFS+ Volume Header address + +kBoot2Sectors EQU (448 * 1024 - 512) / kSectorBytes ; max size of 'boot' file in sectors +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +;------------------------------------------------------------------------- +; HFS+ related structures and constants +; +kHFSPlusSignature EQU 'H+' ; HFS+ volume signature +kHFSPlusCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kHFSPlusCaseSigX EQU 'X' ; upper byte of HFS+ volume case-sensitive signature +kHFSPlusExtentDensity EQU 8 ; 8 extent descriptors / extent record + +; +; HFSUniStr255 +; + struc HFSUniStr255 +.length resw 1 +.unicode resw 255 + endstruc + +; +; HFSPlusExtentDescriptor +; + struc HFSPlusExtentDescriptor +.startBlock resd 1 +.blockCount resd 1 + endstruc + +; +; HFSPlusForkData +; + struc HFSPlusForkData +.logicalSize resq 1 +.clumpSize resd 1 +.totalBlocks resd 1 +.extents resb kHFSPlusExtentDensity * HFSPlusExtentDescriptor_size + endstruc + +; +; HFSPlusVolumeHeader +; + struc HFSPlusVolumeHeader +.signature resw 1 +.version resw 1 +.attributes resd 1 +.lastMountedVersion resd 1 +.journalInfoBlock resd 1 +.createDate resd 1 +.modifyDate resd 1 +.backupDate resd 1 +.checkedDate resd 1 +.fileCount resd 1 +.folderCount resd 1 +.blockSize resd 1 +.totalBlocks resd 1 +.freeBlocks resd 1 +.nextAllocation resd 1 +.rsrcClumpSize resd 1 +.dataClumpSize resd 1 +.nextCatalogID resd 1 +.writeCount resd 1 +.encodingsBitmap resq 1 +.finderInfo resd 8 +.allocationFile resb HFSPlusForkData_size +.extentsFile resb HFSPlusForkData_size +.catalogFile resb HFSPlusForkData_size +.attributesFile resb HFSPlusForkData_size +.startupFile resb HFSPlusForkData_size + endstruc + +; +; B-tree related structures and constants +; + +kBTIndexNode EQU 0 +kBTMaxRecordLength EQU 264 ; sizeof(kHFSPlusFileThreadRecord) +kHFSRootParentID EQU 1 ; Parent ID of the root folder +kHFSRootFolderID EQU 2 ; Folder ID of the root folder +kHFSExtentsFileID EQU 3 ; File ID of the extents overflow file +kHFSCatalogFileID EQU 4 ; File ID of the catalog file +kHFSPlusFileRecord EQU 0x200 +kForkTypeData EQU 0 +kForkTypeResource EQU 0xFF + +; +; BTNodeDescriptor +; + struc BTNodeDescriptor +.fLink resd 1 +.bLink resd 1 +.kind resb 1 +.height resb 1 +.numRecords resw 1 +.reserved resw 1 + endstruc + +; +; BTHeaderRec +; + struc BTHeaderRec +.treeDepth resw 1 +.rootNode resd 1 +.leafRecords resd 1 +.firstLeafNode resd 1 +.lastLeafNode resd 1 +.nodeSize resw 1 +.maxKeyLength resw 1 +.totalNodes resd 1 +.freeNodes resd 1 +.reserved1 resw 1 +.clumpSize resd 1 +.btreeType resb 1 +.keyCompareType resb 1 +.attributes resd 1 +.reserved3 resd 16 + endstruc + +; +; BTIndexRec +; + struc BTIndexRec +.childID resd 1 + endstruc + +; +; HFSPlusCatalogKey +; + struc HFSPlusCatalogKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.parentID resd 1 +.nodeName resb HFSUniStr255_size + endstruc + +; +; HFSPlusExtentKey +; + struc HFSPlusExtentKey +; +; won't use the keyLength field for easier addressing data inside this structure +; +;.keyLength resw 1 + +.forkType resb 1 +.pad resb 1 +.fileID resd 1 +.startBlock resd 1 + endstruc + +; +; HFSPlusBSDInfo +; + struc HFSPlusBSDInfo +.ownerID resd 1 +.groupID resd 1 +.adminFlags resb 1 +.ownerFlags resb 1 +.fileMode resw 1 +.special resd 1 + endstruc + +; +; FileInfo +; + struc FileInfo +.fileType resd 1 +.fileCreator resd 1 +.finderFlags resw 1 +.location resw 2 +.reservedField resw 1 + endstruc + +; +; ExtendedFileInfo +; + struc ExtendedFileInfo +.reserved1 resw 4 +.extFinderFlags resw 1 +.reserved2 resw 1 +.putAwayFolderID resd 1 + endstruc + +; +; HFSPlusCatalogFile +; + struc HFSPlusCatalogFile +.recordType resw 1 +.flags resw 1 +.reserved1 resd 1 +.fileID resd 1 +.createDate resd 1 +.contentModDate resd 1 +.attributeModDate resd 1 +.accessDate resd 1 +.backupDate resd 1 +.permissions resb HFSPlusBSDInfo_size +.userInfo resb FileInfo_size +.finderInfo resb ExtendedFileInfo_size +.textEncoding resd 1 +.reserved2 resd 1 +.dataFork resb HFSPlusForkData_size +.resourceFork resb HFSPlusForkData_size + endstruc + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Relocate boot1 code. + ; + pushad + mov si, kBoot1LoadAddr ; si <- source + mov di, kBoot1RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes ; copy 256 words + rep movsb ; repeat string move (word) operation + popad + + ; + ; Code relocated, jump to startReloc in relocated location. + ; + ; FIXME: Is there any way to instruct NASM to compile a near jump + ; using absolute address instead of relative displacement? + ; + jmpabs startReloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +startReloc: + + ; + ; Initializing global variables. + ; + mov eax, [si + part.lba] + mov [gPartLBA], eax ; save the current partition LBA offset + mov [gBIOSDriveNumber], dl ; save BIOS drive number + mov WORD [gMallocPtr], mallocStart ; set free space pointer + + ; + ; Loading remaining sectors of boot1h extended code. + ; + mov eax, [gPartLBA] ; save starting LBA of current partition + push eax + xor eax, eax + mov [gPartLBA], eax ; will be read sectors from the beginning of the disk + mov al, (kBoot1ExtSize - kSectorBytes) / kSectorBytes + inc ecx ; ECX = next sector to boot1h extended code starting sector + mov edx, kBoot1ExtAddr + call readLBA + jc NEAR bios_read_error + pop eax + mov [gPartLBA], eax ; restore starting LBA of current partition + + ; + ; Loading HFS+ Volume Header. + ; + mov ecx, 2 ; sector 2 of current partition + mov al, 1 ; read HFS+ Volume Header + mov edx, kHFSPlusBuffer + call readLBA + jc NEAR bios_read_error + + ; + ; Initializing more global variables. + ; + mov eax, [kHFSPlusBuffer + HFSPlusVolumeHeader.blockSize] + bswap eax ; convert to little-endian + shr eax, 9 ; convert to sector unit + mov [gBlockSize], eax ; save blockSize as little-endian sector unit! + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kHFSPlusBuffer + HFSPlusVolumeHeader.signature] + cmp ax, kHFSPlusCaseSignature + je findRootBoot + cmp ax, kHFSPlusSignature + jne NEAR error + +;-------------------------------------------------------------------------- +; Find stage2 boot file in a HFS+ Volume's root folder. +; +findRootBoot: + mov al, kHFSCatalogFileID + lea si, [searchCatalogKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.catalogFile + HFSPlusForkData.extents] + call lookUpBTree + jne error + + lea si, [bp + BTree.recordDataPtr] + mov si, [si] + cmp WORD [si], kHFSPlusFileRecord + jne error + +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData + + ; + ; Use the second big-endian double-word as the file length in HFSPlusForkData.logicalSize + ; + mov ebx, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.logicalSize + 4] + bswap ebx ; convert file size to little-endian + add ebx, kSectorBytes - 1 ; adjust size before unit conversion + shr ebx, 9 ; convert file size to sector unit + cmp bx, kBoot2Sectors ; check if bigger than max stage2 size + ja error + mov eax, [si + HFSPlusCatalogFile.fileID] + bswap eax ; convert fileID to little-endian + xor ecx, ecx + mov edx, (kBoot2Segment << 4) + kBoot2Address + lea di, [si + HFSPlusCatalogFile.dataFork + HFSPlusForkData.extents] + call readExtent + +%if VERBOSE + LogString(root_str) +%endif + + ; + ; Jump to boot2. + ; +boot2: + +%if DEBUG + DebugChar ('!') +%endif + +;%if UNUSED + ; + ; Waiting for a key press. + ; + + call getc +;%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +bios_read_error: + +%if VERBOSE + LogString(bios_error_str) +%endif + + jmp hang + +hfsp_error: + +%if VERBOSE + LogString(hfsp_error_str) +%endif + + jmp hang + +error: + +%if VERBOSE + LogString(error_str) +%endif + +hang: + hlt + jmp hang + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + jnc .exit + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Convert big-endian HFSPlus allocation block to sector unit +; +; Arguments: +; EDX = allocation block +; +; Returns: +; ECX = allocation block converted to sector unit +; +; Clobber list: +; EDX +; +blockToSector: + push eax + mov eax, [gBlockSize] + bswap edx ; convert allocation block to little-endian + mul edx ; multiply with block number + mov ecx, eax ; result in EAX + pop eax + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'boot1ext: ', NULL +bios_error_str db 'BIOS int 13h error', NULL +hfsp_error_str db 'HFS+ signature error', NULL +error_str db 'error', NULL +%endif ; VERBOSE + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +pad_table_and_sig: + times (kSectorBytes - 6)-($-$$) db 0 + dd kBoot1ExtSignature + dw kBootSignature + +; +; Sector 1 code area +; + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc bios_read_error + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert null terminated string to HFSUniStr255 +; +; Arguments: +; DS:DX pointer to a NULL terminated string. +; ES:DI pointer to result. +; +ConvertStrToUni: + pushad ; save registers + push di ; save DI for unicode string length pointer + mov si, dx ; use SI as source string pointer + xor ax, ax ; AX = unicode character + mov cl, al ; CL = string length + +.loop: + stosw ; store unicode character (length 0 at first run) + lodsb ; load next character to AL + inc cl ; increment string length count + cmp al, NULL ; check for string terminator + jne .loop + + pop di ; restore unicode string length pointer + dec cl ; ignoring terminator from length count + mov [di], cl ; save string length + popad ; restore registers + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian HFSUniStr255 to little-endian +; +; Arguments: +; DS:SI = pointer to big-endian HFSUniStr255 +; ES:DI = pointer to result buffer +; +ConvertHFSUniStr255ToLE: + pushad + lodsw + xchg ah, al + stosw + cmp al, 0 + je .exit + mov cx, ax + +.loop: + lodsw + xchg ah, al ; convert AX to little-endian + + ; + ; When working with a case-sensitive HFS+ (HX) filesystem, we shouldn't change the case. + ; + cmp BYTE [kHFSPlusBuffer + HFSPlusVolumeHeader.signature + 1], kHFSPlusCaseSigX + je .keepcase + + or ax, ax + jne .convertToLE + dec ax ; NULL must be the strongest char + +.convertToLE: + cmp ah, 0 + ja .keepcase + cmp al, 'A' + jb .keepcase + cmp al, 'Z' + ja .keepcase + add al, 32 ; convert to lower-case + +.keepcase: + stosw + loop .loop + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; compare HFSPlusExtentKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusExtentKeys: + pushad + + mov dl, 0 ; DL = result of comparison, DH = bestGuess + mov eax, [si + HFSPlusExtentKey.fileID] + cmp eax, [di + HFSPlusExtentKey.fileID] + jne .checkFlags + + cmp BYTE [si + HFSPlusExtentKey.forkType], kForkTypeData + jne .checkFlags + + mov eax, [si + HFSPlusExtentKey.startBlock] + cmp eax, [di + HFSPlusExtentKey.startBlock] + je compareHFSPlusCatalogKeys.exit + +.checkFlags: + ja compareHFSPlusCatalogKeys.searchKeyGreater ; search key > trial key + jb compareHFSPlusCatalogKeys.trialKeyGreater ; search key < trial key + +;-------------------------------------------------------------------------- +; Compare HFSPlusCatalogKey structures +; +; Arguments: +; DS:SI = search key +; ES:DI = trial key +; +; Returns: +; [BTree.searchResult] = result +; FLAGS = relation between search and trial keys +; +compareHFSPlusCatalogKeys: + pushad + xor dx, dx ; DL = result of comparison, DH = bestGuess + xchg si, di + lodsd + mov ecx, eax ; ECX = trial parentID + xchg si, di + lodsd ; EAX = search parentID + cmp eax, ecx + ja .searchKeyGreater ; search parentID > trial parentID + jb .trialKeyGreater ; search parentID < trial parentID + +.compareNodeName: ; search parentID = trial parentID + xchg si, di + lodsw + mov cx, ax ; CX = trial nodeName.length + xchg si, di + lodsw ; AX = search nodeName.length + cmp cl, 0 ; trial nodeName.length = 0? + je .searchKeyGreater + + cmp ax, cx + je .strCompare + ja .searchStrLonger + +.trialStrLonger: + dec dh + mov cx, ax + jmp .strCompare + +.searchStrLonger: + inc dh + +.strCompare: + repe cmpsw + ja .searchKeyGreater + jb .trialKeyGreater + mov dl, dh + jmp .exit + +.trialKeyGreater: + dec dl + jmp .exit + +.searchKeyGreater: + inc dl + +.exit: + mov [bp + BTree.searchResult], dl + +;%if UNUSED + pushad + jl .csearchLessThanTrial + jg .csearchGreaterThanTrial + PrintChar('=') + jmp .csearchCont +.csearchGreaterThanTrial: + PrintChar('>') + jmp .csearchCont +.csearchLessThanTrial: + PrintChar('<') +.csearchCont: + popad +;%endif ; UNUSED + + cmp dl, 0 ; set flags to check relation between keys + + popad + ret + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; Allocate memory +; +; Arguments: +; CX = size of requested memory +; +; Returns: +; BP = start address of allocated memory +; +; Clobber list: +; CX +; +malloc: + push ax ; save AX + push di ; save DI + mov di, [gMallocPtr] ; start address of free space + push di ; save free space start address + inc di ; + inc di ; keep the first word untouched + dec cx ; for the last memory block pointer. + dec cx ; + mov al, NULL ; fill with zero + rep stosb ; repeat fill + mov [gMallocPtr], di ; adjust free space pointer + pop bp ; BP = start address of allocated memory + mov [di], bp ; set start address of allocated memory at next + ; allocation block's free space address. + pop di ; restore DI + pop ax ; restore AX + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; Free allocated memory +; +; Returns: +; BP = start address of previously allocated memory +; +free: + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; lookUpBTree - initializes a new BTree instance and +; look up for HFSPlus Catalog File or Extent Overflow keys +; +; Arguments: +; AL = kHFSPlusFileID (Catalog or Extents Overflow) +; SI = address of searchKey +; DI = address of HFSPlusForkData.extents +; +; Returns: +; BP = address of BTree instance +; ECX = rootNode's logical offset in sectors +; +lookUpBTree: + mov cx, BTree_size ; allocate memory with BTree_size + call malloc ; BP = start address of allocated memory. + mov [bp + BTree.fileID], al ; save fileFileID + mov edx, [di] ; first extent of current file + call blockToSector ; ECX = converted to sector unit + mov al, 1 ; 1 sector is enough for + xor edx, edx ; reading current file's header. + lea dx, [bp + BTree.BTHeaderBuffer] ; load into BTreeHeaderBuffer + call readLBA ; read + mov ax, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.nodeSize] + xchg ah, al ; convert to little-endian + mov [bp + BTree.nodeSize], ax ; save nodeSize + + ; + ; Always start the lookup process with the root node. + ; + mov edx, [bp + BTree.BTHeaderBuffer + BTNodeDescriptor_size + BTHeaderRec.rootNode] + +.readNode: + ; + ; Converting nodeID to sector unit + ; + + pushad + PrintChar('n') + mov eax, edx + bswap eax + PrintHex() + popad + + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + mov bx, ax ; BX = read sector count + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with nodeSize converted to sector unit + mov ecx, eax ; ECX = file offset in BTree + + mov eax, [bp + BTree.fileID] + lea edx, [bp + BTree.nodeBuffer] + call readExtent + + ; + ; AX = lowerBound = 0 + ; + xor ax, ax + + ; + ; BX = upperBound = numRecords - 1 + ; + mov bx, [bp + BTree.nodeBuffer + BTNodeDescriptor.numRecords] + xchg bh, bl + + pushad + PrintChar('u') + mov ax,bx + cwde + PrintHex() + popad + + dec bx + +.bsearch: + cmp ax, bx + ja .checkResult ; jump if lowerBound > upperBound + + mov cx, ax + add cx, bx + shr cx, 1 ; test index = (lowerBound + upperBound / 2) + + pushad + PrintChar('i') + mov ax,cx + cwde + PrintHex() + popad + + call getBTreeRecord + +%if UNUSED + pushad + jl .csearchLessThanTrial + jg .csearchGreaterThanTrial + PrintChar('=') + jmp .csearchCont +.csearchGreaterThanTrial: + PrintChar('>') + jmp .csearchCont +.csearchLessThanTrial: + PrintChar('<') +.csearchCont: + popad +%endif ; UNUSED + +.adjustBounds: + je .checkResult + jl .searchLessThanTrial + jg .searchGreaterThanTrial + jmp .bsearch + +.searchLessThanTrial: + mov bx, cx + dec bx ; upperBound = index - 1 + jmp .bsearch + +.searchGreaterThanTrial: + mov ax, cx + inc ax ; lowerBound = index + 1 + jmp .bsearch + +.checkResult: + cmp BYTE [bp + BTree.searchResult], 0 + jge .foundKey + + mov cx, bx + call getBTreeRecord + +.foundKey: + cmp BYTE [bp + BTree.nodeBuffer + BTNodeDescriptor.kind], kBTIndexNode + jne .exit + + lea bx, [bp + BTree.recordDataPtr] + mov bx, [bx] + mov edx, [bx] + jmp .readNode + +.exit: + cmp BYTE [bp + BTree.searchResult], 0 + ret + +;-------------------------------------------------------------------------- +; getBTreeRecord - read and compare BTree record +; +; Arguments: +; CX = record index +; SI = address of search key +; +; Returns: +; [BTree.searchResult] = result of key compare +; [BTree.recordDataPtr] = address of record data +; +getBTreeRecord: + pushad + push si ; save SI + lea di, [bp + BTree.nodeBuffer] ; DI = start of nodeBuffer + push di ; use later + mov ax, [bp + BTree.nodeSize] ; get nodeSize + add di, ax ; DI = beyond nodeBuffer + inc cx ; increment index + shl cx, 1 ; * 2 + sub di, cx ; DI = pointer to record + mov ax, [di] ; offset to record + xchg ah, al ; convert to little-endian + pop di ; start of nodeBuffer + add di, ax ; DI = address of record key + mov si, di ; save to SI + mov ax, [di] ; keyLength + xchg ah, al ; convert to little-endian + inc ax ; suppress keySize (2 bytes) + inc ax ; + add di, ax ; DI = address of record data + mov [bp + BTree.recordDataPtr], di ; save address of record data + lea di, [bp + BTree.trialKey] + push di ; save address of trialKey + lodsw ; suppress keySize (2 bytes) + ; + ; Don't need to compare as DWORD since all reserved CNIDs fits to a single byte + ; + cmp BYTE [bp + BTree.fileID], kHFSCatalogFileID + je .prepareTrialCatalogKey + +.prepareTrialExtentKey: + mov bx, compareHFSPlusExtentKeys + movsw ; copy forkType + pad + mov cx, 2 ; copy fileID + startBlock + +.extentLoop: + lodsd + bswap eax ; convert to little-endian + stosd + loop .extentLoop + jmp .exit + +.prepareTrialCatalogKey: + mov bx, compareHFSPlusCatalogKeys + lodsd + bswap eax ; convert ParentID to little-endian + stosd + call ConvertHFSUniStr255ToLE ; convert nodeName to little-endian + +.exit: + pop di ; restore address of trialKey + +%if DEBUG +; +; Print catalog trial key +; + pushad + mov si, di + lodsd + PrintChar('k') + PrintHex() + lodsw + cmp ax, 0 + je .printExit + mov cx, ax +.printLoop: + lodsw + call print_char + loop .printLoop +.printExit: + popad +; +; +; +%endif ; DEBUG + +%if UNUSED +; +; Print extent trial key +; + pushad + PrintChar('k') + mov si, di + xor eax, eax + lodsw + PrintHex() + lodsd + PrintHex() + lodsd + PrintHex() + popad +; +; +; +%endif ; UNUSED + + pop si ; restore SI + call bx ; call key compare proc + popad + ret + +;-------------------------------------------------------------------------- +; readExtent - read extents from a HFS+ file (multiple extent support) +; +; Arguments: +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData.extents +; +readExtent: + pushad + ; + ; Save Catalog File ID as part of a search HFSPlusExtentKey + ; for a possible Extents Overflow lookup. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.fileID], eax + mov [bp + BTree.readBufferPtr], edx + mov ax, bx + cwde + mov [bp + BTree.readSize], eax + mov ebx, ecx ; EBX = file offset + xor eax, eax + mov [bp + BTree.currentExtentOffs], eax + +.beginExtentBlock: + mov BYTE [bp + BTree.extentCount], 0 + +.extentSearch: + cmp BYTE [bp + BTree.extentCount], kHFSPlusExtentDensity + jb .continue + +.getNextExtentBlock: + push ebx + mov eax, [bp + BTree.currentExtentOffs] + + ; + ; Converting sector unit to HFS+ allocation block unit. + ; + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + + ; + ; Preparing searchExtentKey's startBlock field. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.startBlock], eax + + mov al, kHFSExtentsFileID + lea si, [bp + BTree.searchExtentKey] + lea di, [kHFSPlusBuffer + HFSPlusVolumeHeader.extentsFile + HFSPlusForkData.extents] + call lookUpBTree + jnz NEAR .exit + + ; + ; BP points to the new workspace allocated by lookUpBTree. + ; + lea di, [bp + BTree.recordDataPtr] + mov di, [di] + + ; + ; Switch back to the previous workspace. + ; + lea bp, [gMallocPtr] + mov bp, [bp] + mov [gMallocPtr], bp + + pop ebx + jmp .beginExtentBlock + +.continue: + mov edx, [di + HFSPlusExtentDescriptor.blockCount] + call blockToSector ; ECX = converted current extent's blockCount to sectors + mov eax, [bp + BTree.currentExtentOffs] ; EAX = current extent's start offset (sector) + mov edx, eax + add edx, ecx ; EDX = next extent's start offset (sector) + cmp ebx, edx + mov [bp + BTree.currentExtentOffs], edx ; set currentExtentOffs as the next extent's start offset + jae .nextExtent ; jump to next extent if file offset > next extent's start offset + +.foundExtent: + mov edx, ebx + sub edx, eax ; EDX = relative offset within current extent + mov eax, edx ; will be used below to determine read size + mov esi, [bp + BTree.readSize] ; ESI = remaining sectors to be read + add edx, esi + cmp edx, ecx ; test if relative offset + readSize fits to this extent + jbe .read ; read all remaining sectors from this extent + +.splitRead: + sub ecx, eax ; read amount of sectors beginning at relative offset + mov esi, ecx ; of current extent up to the end of current extent + +.read: + mov edx, [di + HFSPlusExtentDescriptor.startBlock] + call blockToSector ; ECX = converted to sectors + add ecx, eax ; file offset converted to sectors + + push si + mov ax, si + mov edx, [bp + BTree.readBufferPtr] + + pushad + PrintChar('s') + mov eax, ecx + PrintHex() + popad + + call readSectors + pop si + + add ebx, esi + mov ax, si + cwde + shl ax, 9 ; convert SI (read sector count) to byte unit + add [bp + BTree.readBufferPtr], eax + sub [bp + BTree.readSize], esi + + jz .exit + +.nextExtent: + add di, kHFSPlusExtentDensity + inc BYTE [bp + BTree.extentCount] + jmp .extentSearch + +.exit: + popad + ret + +%if UNUSED + +;-------------------------------------------------------------------------- +; readExtent - read extents from a HFS+ file (single extent support) +; +; Arguments: +; EAX = Catalog File ID +; BX = read size in sectors +; ECX = file offset in sectors +; EDX = address of read buffer +; DI = address of HFSPlusForkData.extents +; +readExtent: + ; + ; Save Catalog File ID as part of a search HFSPlusExtentKey + ; for a possible Extents Overflow lookup. + ; + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.fileID], eax + push edx + mov eax, ecx ; EAX = relative offset in sectors + mov edx, [di] + bswap edx + mov [bp + BTree.searchExtentKey + HFSPlusExtentKey.startBlock], edx + bswap edx + call blockToSector ; ECX = starting block of current extent + add ecx, eax ; ECX = relative sector within current partition + pop edx + mov al, bl + call readLBA + ret + +%endif ; UNUSED + + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert sector unit to HFSPlus allocation block unit +; +; Arguments: +; EDX = sector +; +; Returns: +; ECX = converted to allocation block unit +; +; Clobber list: +; EDX +; +sectorToBlock: + push eax + mov eax, edx + xor edx, edx + div DWORD [gBlockSize] ; divide with blockSize + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +%if UNUSED + +;-------------------------------------------------------------------------- +; Convert big-endian BTree node ID to sector unit +; +; Arguments: +; EDX = node ID +; +; Returns: +; ECX = node ID converted to sector unit +; +; Clobber list: +; EDX +; +nodeToSector: + push eax + mov ax, [bp + BTree.nodeSize] + shr ax, 9 ; convert nodeSize to sectors + cwde + bswap edx ; convert node ID to little-endian + mul edx ; multiply with node ID + mov ecx, eax ; result in EAX + pop eax + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +root_str db '/boot', NULL +%endif + +searchCatalogKey dd kHFSRootFolderID + dw searchCatKeyNameLen +searchCatKeyName dw 'b', 'o', 'o', 't' ; must be upper case +searchCatKeyNameLen EQU ($ - searchCatKeyName) / 2 + +;-------------------------------------------------------------------------- +; Pad the rest of the 4096 byte sized loader with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +pad_sectors: + times kBoot1ExtSize-($-$$) db 0 + +; +; Local BTree variables +; + struc BTree +.mallocLink resw 1 ; pointer to previously allocated memory block +.fileID resd 1 ; will use as BYTE +.nodeSize resd 1 ; will use as WORD +.searchExtentKey resb HFSPlusExtentKey_size +.searchResult resb 1 +.trialKey resb kBTMaxRecordLength +.recordDataPtr resw 1 +.readBufferPtr resd 1 +.currentExtentOffs resd 1 +.readSize resd 1 +.extentCount resb 1 + ALIGNB 2 +.BTHeaderBuffer resb kSectorBytes +.nodeBuffer resb maxNodeSize + endstruc + +; +; Global variables +; + + ABSOLUTE kHFSPlusBuffer + HFSPlusVolumeHeader_size + +gPartLBA resd 1 +gBIOSDriveNumber resw 1 +gBlockSize resd 1 +gMallocPtr resw 1 + +; END diff --git a/i386/boot1/boot1hp.s b/i386/boot1/boot1hp.s new file mode 100644 index 0000000..fe12b8c --- /dev/null +++ b/i386/boot1/boot1hp.s @@ -0,0 +1,693 @@ +; Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ +; +; Partition Boot Preloader: boot1hp +; +; This program is designed to reside in sector 0 of an HFS+ partition. +; It expects that the MBR has left the drive number in DL +; and a pointer to the partition entry in SI. +; +; This version requires a BIOS with EBIOS (LBA) support. +; +; This code is written for the NASM assembler. +; nasm boot1hp.s -o boot1hp + +; +; This version of boot1hp tries to find a boot1h extended loader. +; If it fails then uses the traditional method by loading the startupfile. +; +; Written by zef @ 2008-04-17 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +maxSectorCount EQU 64 ; maximum sector count for read_sectors + +kSectorBytes EQU 512 ; sector size in bytes +kBootSignature EQU 0xAA55 ; boot sector signature + +kBoot1StackAddress EQU 0xFFF0 ; boot1 stack pointer +kBoot1LoadAddr EQU 0x7C00 ; boot1 load address +kBoot1RelocAddr EQU 0xE000 ; boot1 relocated address +kHFSPlusBuffer EQU kBoot1RelocAddr + kSectorBytes ; HFS+ Volume Header address + +kBoot1ExtSector EQU 40 +kBoot1ExtSignature EQU 'b1he' + +kBoot2Sectors EQU 126 ; sectors to load for boot2 +kBoot2Segment EQU 0x2000 ; boot2 load segment +kBoot2Address EQU kSectorBytes ; boot2 load address + +; +; Format of fdisk partition entry. +; +; The symbol 'part_size' is automatically defined as an `EQU' +; giving the size of the structure. +; + struc part +.bootid resb 1 ; bootable or not +.head resb 1 ; starting head, sector, cylinder +.sect resb 1 ; +.cyl resb 1 ; +.type resb 1 ; partition type +.endhead resb 1 ; ending head, sector, cylinder +.endsect resb 1 ; +.endcyl resb 1 ; +.lba resd 1 ; starting lba +.sectors resd 1 ; size in sectors + endstruc + +;------------------------------------------------------------------------- +; HFS+ related structures and constants +; +kHFSPlusSignature EQU 'H+' ; HFS+ volume signature +kHFSPlusCaseSignature EQU 'HX' ; HFS+ volume case-sensitive signature +kHFSPlusCaseSigX EQU 'X' ; upper byte of HFS+ volume case-sensitive signature +kHFSPlusExtentDensity EQU 8 ; 8 extent descriptors / extent record + +; +; HFSPlusExtentDescriptor +; + struc HFSPlusExtentDescriptor +.startBlock resd 1 +.blockCount resd 1 + endstruc + +; +; HFSPlusForkData +; + struc HFSPlusForkData +.logicalSize resq 1 +.clumpSize resd 1 +.totalBlocks resd 1 +.extents resb kHFSPlusExtentDensity * HFSPlusExtentDescriptor_size + endstruc + +; +; HFSPlusVolumeHeader +; + struc HFSPlusVolumeHeader +.signature resw 1 +.version resw 1 +.attributes resd 1 +.lastMountedVersion resd 1 +.journalInfoBlock resd 1 +.createDate resd 1 +.modifyDate resd 1 +.backupDate resd 1 +.checkedDate resd 1 +.fileCount resd 1 +.folderCount resd 1 +.blockSize resd 1 +.totalBlocks resd 1 +.freeBlocks resd 1 +.nextAllocation resd 1 +.rsrcClumpSize resd 1 +.dataClumpSize resd 1 +.nextCatalogID resd 1 +.writeCount resd 1 +.encodingsBitmap resq 1 +.finderInfo resd 8 +.allocationFile resb HFSPlusForkData_size +.extentsFile resb HFSPlusForkData_size +.catalogFile resb HFSPlusForkData_size +.attributesFile resb HFSPlusForkData_size +.startupFile resb HFSPlusForkData_size + endstruc + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot1RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; +start: + ; + ; Set up the stack to grow down from kBoot1StackSegment:kBoot1StackAddress. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot1StackAddress ; sp <- top of stack + sti ; reenable interrupts + + mov ds, ax ; ds <- 0 + mov es, ax ; es <- 0 + + ; + ; Relocate boot1 code. + ; + push si + mov si, kBoot1LoadAddr ; si <- source + mov di, kBoot1RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes ; copy 256 words + rep movsb ; repeat string move (word) operation + pop si + + ; + ; Code relocated, jump to startReloc in relocated location. + ; + ; FIXME: Is there any way to instruct NASM to compile a near jump + ; using absolute address instead of relative displacement? + ; + jmpabs startReloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +startReloc: + + ; + ; Initializing global variables. + ; + mov eax, [si + part.lba] + mov [gPartLBA], eax ; save the current partition LBA offset + mov [gBIOSDriveNumber], dl ; save BIOS drive number + + ; + ; Loading HFS+ Volume Header. + ; + mov ecx, 2 ; sector 2 of current partition + mov al, 1 ; read HFS+ Volume Header + mov edx, kHFSPlusBuffer + call readLBA + jc NEAR bios_read_error + + ; + ; Looking for HFSPlus ('H+') or HFSPlus case-sensitive ('HX') signature. + ; + mov ax, [kHFSPlusBuffer + HFSPlusVolumeHeader.signature] + cmp ax, kHFSPlusCaseSignature + je .foundHFSPlus + cmp ax, kHFSPlusSignature + jne NEAR hfsp_error + +.foundHFSPlus: + ; + ; Loading first sector of boot1h extended code. + ; + mov eax, [gPartLBA] ; save starting LBA of current partition + push eax + xor eax, eax + mov [gPartLBA], eax ; will be read sectors from the beginning of the disk + mov ecx, kBoot1ExtSector ; sector 1 of boot1h extended code + mov al, 1 ; read HFS+ Volume Header + mov edx, kBoot1LoadAddr + call readLBA + jc bios_read_error + pop eax + mov [gPartLBA], eax ; restore starting LBA of current partition + + ; + ; Looking for boot1h extended code signature. + ; + cmp WORD [kBoot1LoadAddr + kSectorBytes - 2], kBootSignature + jne boot1h_ext_not_found + cmp DWORD [kBoot1LoadAddr + kSectorBytes - 6], kBoot1ExtSignature + jne boot1h_ext_not_found + +%if VERBOSE + LogString(boot1he_start_str) +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmpabs kBoot1LoadAddr + +boot1h_ext_not_found: + +%if VERBOSE + LogString(boot1he_error_str) +%endif + + ; + ; Initializing more global variables. + ; + mov eax, [kHFSPlusBuffer + HFSPlusVolumeHeader.blockSize] + bswap eax ; convert to little-endian + shr eax, 9 ; convert to sector unit + mov [gBlockSize], eax ; save blockSize as little-endian sector unit! + +;-------------------------------------------------------------------------- +; findStartup - Find HFS+ startup file in a partition. +; +findStartup: + mov edx, [kHFSPlusBuffer + HFSPlusVolumeHeader.startupFile + HFSPlusForkData.extents] + call blockToSector ; result in ECX + or ecx, ecx + je startupfile_error + + mov al, kBoot2Sectors + mov edx, (kBoot2Segment << 4) + kBoot2Address + call readLBA + jc bios_read_error + +%if VERBOSE + LogString(startupfile_str) +%endif + + ; + ; Jump to boot2. + ; +boot2: + +%if DEBUG + DebugChar ('!') +%endif + + call getc + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +bios_read_error: + +%if VERBOSE + LogString(bios_error_str) +%endif + + jmp hang + +startupfile_error: + +%if VERBOSE + LogString(startupfile_err_str) +%endif + + jmp hang + +hfsp_error: + +%if VERBOSE + LogString(hfsp_error_str) +%endif + +hang: + hlt + jmp hang + +%if UNUSED + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 512-byte sectors to read (valid from 1-1280). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc bios_read_error + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl ax, 9 ; convert sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +%endif ; UNUSED + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [bios_drive_number] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + add ecx, [gPartLBA] ; offset 8, lower 32-bit LBA + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [bios_drive_number] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + jnc .exit + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +%if VERBOSE + +;-------------------------------------------------------------------------- +; Write a string with 'boot1: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +%endif ; VERBOSE + +%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +%endif ; DEBUG + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Convert big-endian HFSPlus allocation block to sector unit +; +; Arguments: +; EDX = allocation block +; +; Returns: +; ECX = allocation block converted to sector unit +; +; Clobber list: +; EDX +; +blockToSector: + push eax + mov eax, [gBlockSize] + bswap edx ; convert allocation block to little-endian + mul edx ; multiply with block number + mov ecx, eax ; result in EAX + pop eax + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'boot1: ', NULL +boot1he_error_str db 'extended block signature not found', NULL +startupfile_err_str db 'startupfile not found', NULL +hfsp_error_str db 'HFS+ signature error', NULL +bios_error_str db 'BIOS int 13h error', NULL +startupfile_str db 'loading startupfile', NULL +boot1he_start_str db 'starting extended block', NULL +%endif ; VERBOSE + +;-------------------------------------------------------------------------- +; Pad the rest of the 512 byte sized sector with zeroes. The last +; two bytes is the mandatory boot sector signature. +; +; If the booter code becomes too large, then nasm will complain +; that the 'times' argument is negative. + +pad_table_and_sig: + times 510-($-$$) db 0 + dw kBootSignature + +; +; Global variables +; + + ABSOLUTE kHFSPlusBuffer + HFSPlusVolumeHeader_size + +gPartLBA resd 1 +gBIOSDriveNumber resw 1 +gBlockSize resd 1 + +; END diff --git a/i386/boot2/.svn/all-wcprops b/i386/boot2/.svn/all-wcprops new file mode 100644 index 0000000..b0108ff --- /dev/null +++ b/i386/boot2/.svn/all-wcprops @@ -0,0 +1,197 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/boot2 +END +ramdisk.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/ramdisk.h +END +picopng.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/picopng.c +END +graphics.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/graphics.c +END +graphic_utils.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/graphic_utils.h +END +picopng.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/picopng.h +END +graphics.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/graphics.h +END +drivers.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/drivers.c +END +mboot.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/mboot.c +END +prompt.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/prompt.c +END +mboot.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/mboot.h +END +WKdmDecompress.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/WKdmDecompress.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/Makefile +END +resume.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/resume.c +END +boot.c +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/boot.c +END +boot2.s +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/boot2.s +END +WKdm.h +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/WKdm.h +END +modules.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/modules.c +END +boot.h +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/boot.h +END +modules.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/boot2/modules.h +END +multiboot.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/multiboot.h +END +bmdecompress.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/bmdecompress.c +END +modules_support.s +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/modules_support.s +END +gui.c +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/gui.c +END +appleClut8.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/appleClut8.h +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/Cconfig +END +gui.h +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/gui.h +END +IOHibernatePrivate.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/IOHibernatePrivate.h +END +ramdisk.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/ramdisk.c +END +appleboot.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/appleboot.h +END +options.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/boot2/options.c +END +lzss.c +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/lzss.c +END +graphic_utils.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/boot2/graphic_utils.c +END diff --git a/i386/boot2/.svn/entries b/i386/boot2/.svn/entries new file mode 100644 index 0000000..cd767b4 --- /dev/null +++ b/i386/boot2/.svn/entries @@ -0,0 +1,1116 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/boot2 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ramdisk.h +file + + + + +2013-08-27T23:54:54.000000Z +8c40d63107b03fbb595976fc9c9831a9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +956 + +picopng.c +file + + + + +2013-08-27T23:54:54.000000Z +ae60f9d8fa946da8e713d11957888e52 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +37900 + +graphics.c +file + + + + +2013-08-27T23:54:54.000000Z +cef63c249b4032d128e451a4a62d16dc +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +35226 + +graphic_utils.h +file + + + + +2013-08-27T23:54:54.000000Z +f2f7f277014c73125a349c36e719381a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1817 + +picopng.h +file + + + + +2013-08-27T23:54:54.000000Z +ccba5539245be91d43e6870f32fc2480 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +613 + +graphics.h +file + + + + +2013-08-27T23:54:54.000000Z +3966f59e2ed52d150de55002f457728a +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +1423 + +drivers.c +file + + + + +2013-08-27T23:54:54.000000Z +724f7df62ed4c0cfb67b2f3d726a31ef +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +24033 + +mboot.c +file + + + + +2013-08-27T23:54:54.000000Z +1afd58ca3079424cc015a0045bbdf159 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +19551 + +prompt.c +file + + + + +2013-08-27T23:54:54.000000Z +64038f23c29895d4fd62dbb228f2b77c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1949 + +mboot.h +file + + + + +2013-08-27T23:54:54.000000Z +682c56ca9a6c7b94e28c97d2f5782b7b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +907 + +WKdmDecompress.c +file + + + + +2013-08-27T23:54:54.000000Z +b0334d24b80557d095fa8860e9c7eceb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8633 + +Makefile +file + + + + +2013-08-27T23:54:54.000000Z +59d3a261028f5fc934f51a67c5192482 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7984 + +resume.c +file + + + + +2013-08-27T23:54:54.000000Z +771d2be9c2a660f5d0a38494f147b757 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6140 + +boot.c +file + + + + +2013-08-27T23:54:54.000000Z +7bc8e06624f7d34795fcfd685d7cddf4 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +23282 + +boot2.s +file + + + + +2013-08-27T23:54:54.000000Z +645b97140dbe4126551f434afad0b5d3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14063 + +WKdm.h +file + + + + +2013-08-27T23:54:54.000000Z +3670f46f7ff2ee2ae3882b2875e70437 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8019 + +modules.c +file + + + + +2013-08-27T23:54:54.000000Z +45a55a292c629a5f60e2744d1f39748c +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +29650 + +boot.h +file + + + + +2013-08-27T23:54:54.000000Z +f485be6f3c2d73949e94e2fea320544f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8659 + +modules.h +file + + + + +2013-08-27T23:54:54.000000Z +af1c07a1154bec2f24c6f50b3d40e325 +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +3648 + +multiboot.h +file + + + + +2013-08-27T23:54:54.000000Z +138b76320331e2355b0ff1e576bd7aff +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6864 + +bmdecompress.c +file + + + + +2013-08-27T23:54:54.000000Z +d04b1b7be86e187acbab5f70b7e18869 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7219 + +modules_support.s +file + + + + +2013-08-27T23:54:54.000000Z +bb6f935d1c38c7a973c1bb065be21646 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +148 + +gui.c +file + + + + +2013-08-27T23:54:54.000000Z +aaf2fe177ad5e63111144133cabab85f +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +60515 + +appleClut8.h +file + + + + +2013-08-27T23:54:54.000000Z +839e793ec6631bbbf9796e21be7d649a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5358 + +Cconfig +file + + + + +2013-08-27T23:54:54.000000Z +2aeb1eac2f848b4aeca20f269a762844 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +580 + +gui.h +file + + + + +2013-08-27T23:54:54.000000Z +33875d4e9accbcd7ac8f10514b40176f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3585 + +IOHibernatePrivate.h +file + + + + +2013-08-27T23:54:54.000000Z +dda6c95bc0dc444cd607787928c2ea22 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11460 + +ramdisk.c +file + + + + +2013-08-27T23:54:54.000000Z +3d678e557f9c5dc9d312412d57c3a77d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6723 + +appleboot.h +file + + + + +2013-08-27T23:54:54.000000Z +e7f9a57d0b5d6b9afa1b278dcac35e8c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10374 + +options.c +file + + + + +2013-08-27T23:54:54.000000Z +bc9a54c125e4596339e807f8d2662fb8 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +40339 + +lzss.c +file + + + + +2013-08-27T23:54:54.000000Z +4ad032607dc567304241ee488bb31b08 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3242 + +graphic_utils.c +file + + + + +2013-08-27T23:54:54.000000Z +1a612b1ffe76bd2c51f7d0419b42b115 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2813 + diff --git a/i386/boot2/.svn/text-base/Cconfig.svn-base b/i386/boot2/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..714f895 --- /dev/null +++ b/i386/boot2/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,29 @@ +config MODULES + bool "Module System" + default y + ---help--- + Say Y here if you want to enable the use of modules. + +config MODULE_DEBUG + bool "debug support" + default n + depends on MODULES + ---help--- + Say Y here if you want to enable debug mode for the + module system. + +source "i386/modules/Cconfig" + +config EMBED_THEME + bool "Embed Theme" + default n + ---help--- + Say Y here if you want compile in the default theme (Embed). + +config EMBEDED_THEME + string "Theme name" + default "embed" + depends on EMBED_THEME + ---help--- + Specify the name of the theme to compile in. + diff --git a/i386/boot2/.svn/text-base/IOHibernatePrivate.h.svn-base b/i386/boot2/.svn/text-base/IOHibernatePrivate.h.svn-base new file mode 100644 index 0000000..94627f4 --- /dev/null +++ b/i386/boot2/.svn/text-base/IOHibernatePrivate.h.svn-base @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef KERNEL +#include +#endif + +struct IOPolledFileExtent +{ + uint64_t start; + uint64_t length; +}; +typedef struct IOPolledFileExtent IOPolledFileExtent; + +struct IOHibernateImageHeader +{ + uint64_t imageSize; + uint64_t image1Size; + + uint32_t restore1CodePage; + uint32_t restore1PageCount; + uint32_t restore1CodeOffset; + uint32_t restore1StackOffset; + + uint32_t pageCount; + uint32_t bitmapSize; + + uint32_t restore1Sum; + uint32_t image1Sum; + uint32_t image2Sum; + + uint32_t actualRestore1Sum; + uint32_t actualImage1Sum; + uint32_t actualImage2Sum; + + uint32_t actualUncompressedPages; + uint32_t conflictCount; + uint32_t nextFree; + + uint32_t signature; + uint32_t processorFlags; + + uint32_t runtimePages; + uint32_t runtimePageCount; + + uint8_t reserved2[16]; + + uint64_t encryptStart; + uint64_t machineSignature; + + uint32_t previewSize; + uint32_t previewPageListSize; + + uint32_t diag[4]; + + int32_t graphicsInfoOffset; + int32_t cryptVarsOffset; + int32_t memoryMapOffset; + uint32_t memoryMapSize; + uint32_t systemTableOffset; + + uint32_t reserved[77]; // make sizeof == 512 + + uint32_t fileExtentMapSize; + IOPolledFileExtent fileExtentMap[2]; +}; +typedef struct IOHibernateImageHeader IOHibernateImageHeader; + + +struct hibernate_bitmap_t +{ + uint32_t first_page; + uint32_t last_page; + uint32_t bitmapwords; + uint32_t bitmap[0]; +}; +typedef struct hibernate_bitmap_t hibernate_bitmap_t; + +struct hibernate_page_list_t +{ + uint32_t list_size; + uint32_t page_count; + uint32_t bank_count; + hibernate_bitmap_t bank_bitmap[0]; +}; +typedef struct hibernate_page_list_t hibernate_page_list_t; + +#if defined(_AES_H) + +struct hibernate_cryptwakevars_t +{ + uint8_t aes_iv[AES_BLOCK_SIZE]; +}; +typedef struct hibernate_cryptwakevars_t hibernate_cryptwakevars_t; + +struct hibernate_cryptvars_t +{ + uint8_t aes_iv[AES_BLOCK_SIZE]; + aes_ctx ctx; +}; +typedef struct hibernate_cryptvars_t hibernate_cryptvars_t; + +#endif /* defined(_AES_H) */ + + +enum +{ + kIOHibernateProgressCount = 19, + kIOHibernateProgressWidth = 7, + kIOHibernateProgressHeight = 16, + kIOHibernateProgressSpacing = 3, + kIOHibernateProgressOriginY = 81, + + kIOHibernateProgressSaveUnderSize = 2*5+14*2, + + kIOHibernateProgressLightGray = 230, + kIOHibernateProgressMidGray = 174, + kIOHibernateProgressDarkGray = 92 +}; + +enum +{ + kIOHibernatePostWriteSleep = 0, + kIOHibernatePostWriteWake = 1, + kIOHibernatePostWriteHalt = 2, + kIOHibernatePostWriteRestart = 3 +}; + + +struct hibernate_graphics_t +{ + uint32_t physicalAddress; // Base address of video memory + uint32_t mode; // + uint32_t rowBytes; // Number of bytes per pixel row + uint32_t width; // Width + uint32_t height; // Height + uint32_t depth; // Pixel Depth + + uint8_t progressSaveUnder[kIOHibernateProgressCount][kIOHibernateProgressSaveUnderSize]; +}; +typedef struct hibernate_graphics_t hibernate_graphics_t; + +#define DECLARE_IOHIBERNATEPROGRESSALPHA \ +static const uint8_t gIOHibernateProgressAlpha \ +[kIOHibernateProgressHeight][kIOHibernateProgressWidth] = \ +{ \ + { 0x00,0x63,0xd8,0xf0,0xd8,0x63,0x00 }, \ + { 0x51,0xff,0xff,0xff,0xff,0xff,0x51 }, \ + { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \ + { 0x54,0xff,0xff,0xff,0xff,0xff,0x54 }, \ + { 0x00,0x66,0xdb,0xf3,0xdb,0x66,0x00 } \ +}; + +#ifdef KERNEL + +#ifdef __cplusplus + +void IOHibernateSystemInit(IOPMrootDomain * rootDomain); + +IOReturn IOHibernateSystemSleep(void); +IOReturn IOHibernateSystemHasSlept(void); +IOReturn IOHibernateSystemWake(void); +IOReturn IOHibernateSystemPostWake(void); + +#endif /* __cplusplus */ + +#ifdef _SYS_CONF_H_ +typedef void (*kern_get_file_extents_callback_t)(void * ref, uint64_t start, uint64_t size); + +struct kern_direct_file_io_ref_t * +kern_open_file_for_direct_io(const char * name, + kern_get_file_extents_callback_t callback, + void * callback_ref, + dev_t * device, + uint64_t * partitionbase_result, + uint64_t * maxiocount_result); +void +kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref); +int +kern_write_file(struct kern_direct_file_io_ref_t * ref, off_t offset, caddr_t addr, vm_size_t len); +int get_kernel_symfile(struct proc *p, char const **symfile); +#endif /* _SYS_CONF_H_ */ + +hibernate_page_list_t * +hibernate_page_list_allocate(void); + +kern_return_t +hibernate_setup(IOHibernateImageHeader * header, + uint32_t free_page_ratio, + uint32_t free_page_time, + hibernate_page_list_t ** page_list_ret, + hibernate_page_list_t ** page_list_wired_ret, + boolean_t * encryptedswap); +kern_return_t +hibernate_teardown(hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired); + +kern_return_t +hibernate_processor_setup(IOHibernateImageHeader * header); + +void +hibernate_vm_lock(void); +void +hibernate_vm_unlock(void); + +// mark pages not to be saved, based on VM system accounting +void +hibernate_page_list_setall(hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + uint32_t * pagesOut); + +// mark pages to be saved, or pages not to be saved but available +// for scratch usage during restore +void +hibernate_page_list_setall_machine(hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + uint32_t * pagesOut); + +// mark pages not to be saved and not for scratch usage during restore +void +hibernate_page_list_set_volatile( hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + uint32_t * pagesOut); + +void +hibernate_page_list_discard(hibernate_page_list_t * page_list); + +void +hibernate_set_page_state(hibernate_page_list_t * page_list, hibernate_page_list_t * page_list_wired, + vm_offset_t ppnum, vm_offset_t count, uint32_t kind); + +void +hibernate_page_bitset(hibernate_page_list_t * list, boolean_t set, uint32_t page); + +boolean_t +hibernate_page_bittst(hibernate_page_list_t * list, uint32_t page); + +hibernate_bitmap_t * +hibernate_page_bitmap_pin(hibernate_page_list_t * list, uint32_t * page); + +uint32_t +hibernate_page_bitmap_count(hibernate_bitmap_t * bitmap, uint32_t set, uint32_t page); + +void +hibernate_restore_phys_page(uint64_t src, uint64_t dst, uint32_t len, uint32_t procFlags); + +void +hibernate_machine_init(void); + +uint32_t +hibernate_write_image(void); + +long +hibernate_machine_entrypoint(IOHibernateImageHeader * header, void * p2, void * p3, void * p4); +long +hibernate_kernel_entrypoint(IOHibernateImageHeader * header, void * p2, void * p3, void * p4); +void +hibernate_newruntime_map(void * map, vm_size_t map_size, + uint32_t system_table_offset); + + +extern uint32_t gIOHibernateState; +extern uint32_t gIOHibernateMode; +extern uint32_t gIOHibernateFreeTime; // max time to spend freeing pages (ms) +extern uint8_t gIOHibernateRestoreStack[]; +extern uint8_t gIOHibernateRestoreStackEnd[]; +extern IOHibernateImageHeader * gIOHibernateCurrentHeader; +extern hibernate_graphics_t * gIOHibernateGraphicsInfo; +extern hibernate_cryptwakevars_t * gIOHibernateCryptWakeVars; + +#define HIBLOG(fmt, args...) \ + { kprintf(fmt, ## args); printf(fmt, ## args); } + +#define HIBPRINT(fmt, args...) \ + { kprintf(fmt, ## args); } + +#endif /* KERNEL */ + +// gIOHibernateState, kIOHibernateStateKey +enum +{ + kIOHibernateStateInactive = 0, + kIOHibernateStateHibernating = 1, /* writing image */ + kIOHibernateStateWakingFromHibernate = 2 /* booted and restored image */ +}; + +// gIOHibernateMode, kIOHibernateModeKey +enum +{ + kIOHibernateModeOn = 0x00000001, + kIOHibernateModeSleep = 0x00000002, + kIOHibernateModeEncrypt = 0x00000004, + kIOHibernateModeDiscardCleanInactive = 0x00000008, + kIOHibernateModeDiscardCleanActive = 0x00000010, + kIOHibernateModeSwitch = 0x00000020, + kIOHibernateModeRestart = 0x00000040 +}; + +// IOHibernateImageHeader.signature +enum +{ + kIOHibernateHeaderSignature = 0x73696d65, + kIOHibernateHeaderInvalidSignature = 0x7a7a7a7a +}; + +// kind for hibernate_set_page_state() +enum +{ + kIOHibernatePageStateFree = 0, + kIOHibernatePageStateWiredSave = 1, + kIOHibernatePageStateUnwiredSave = 2 +}; + +#define kIOHibernateModeKey "Hibernate Mode" +#define kIOHibernateFileKey "Hibernate File" +#define kIOHibernateFreeRatioKey "Hibernate Free Ratio" +#define kIOHibernateFreeTimeKey "Hibernate Free Time" + +#define kIOHibernateStateKey "IOHibernateState" +#define kIOHibernateFeatureKey "Hibernation" +#define kIOHibernatePreviewBufferKey "IOPreviewBuffer" + +#define kIOHibernatePreviewActiveKey "IOHibernatePreviewActive" +// values for kIOHibernatePreviewActiveKey +enum { + kIOHibernatePreviewActive = 0x00000001, + kIOHibernatePreviewUpdates = 0x00000002 +}; + +#define kIOHibernateBootImageKey "boot-image" +#define kIOHibernateBootImageKeyKey "boot-image-key" +#define kIOHibernateBootSignatureKey "boot-signature" + +#define kIOHibernateMemorySignatureKey "memory-signature" +#define kIOHibernateMemorySignatureEnvKey "mem-sig" +#define kIOHibernateMachineSignatureKey "machine-signature" + +#define kIOHibernateRTCVariablesKey "IOHibernateRTCVariables" + +#define kIOHibernateBootSwitchVarsKey "boot-switch-vars" + + +#ifdef __cplusplus +} +#endif diff --git a/i386/boot2/.svn/text-base/Makefile.svn-base b/i386/boot2/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..0ce2b16 --- /dev/null +++ b/i386/boot2/.svn/text-base/Makefile.svn-base @@ -0,0 +1,210 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +BINROOT = $(SRCROOT)/bin +OBJROOT = $(SRCROOT)/obj/i386/boot2 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +VPATH = $(SYMROOT) + +# Makefile for i386 boot program +# define FLOPPY and SMALL using DEFINES macro as necessary + +PNGCRUSH = `which pngcrush` +PNGOPTIONS = -rem cHRM -rem gAMA -rem iCCP -rem sRGB + +DIR = boot2 +include ${SRCROOT}/Make.rules + +OPTIM = -Os -Oz +CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ -include $(SRCROOT)/autoconf.h + +DEFINES= +CONFIG = hd +SYMDIR = $(SYMROOT) +LIBSADIR = ../libsa +LIBSAIODIR = ../libsaio +THEME = $(CONFIG_EMBEDED_THEME) +THEMEDIR = ../../artwork/themes/$(THEME) +INC = -I. -I$(SRCROOT) -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I${SRCROOT}/i386/include + +LIBS= -L$(SYMDIR) -lsaio -lsa -lklibc +LIBDEP= libsaio.a libsa.a libklibc.a + +OTHER_FILES = + +# The ordering is important; +# boot2.o must be first. +OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \ + ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o \ + modules_support.o boot_modules.o +# button.o browser.o scrollbar.o == NOTYET +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +UTILDIR = ../util +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) +BOOT2ADDR = 20200 +MAXBOOTSIZE = 458240 + + +# +# Strings used to retrieve the start location for the Symbols.dylib module +# +SYMBOLS_MODULE = Symbols.dylib +SYMBOL_START= _symbols_module_start +SYMBOL_ADDR = $(shell printf "%d" 0x`nm -s __DATA __data $(SYMROOT)/boot.sys | grep " $(SYMBOL_START)$$" | cut -f 1 -d " "`) +DATA_OFFSET = $(shell otool -l $(SYMROOT)/boot.sys | grep __data -A 4 | grep __DATA -A 3 | tail -n 1 | cut -f 6 -d " ") +DATA_ADDR = $(shell printf "%d" `otool -l $(SYMROOT)/boot.sys | grep __data -A 4 | grep __DATA -A 3 | head -n 2 | tail -n 1 | cut -f 8 -d " "`) +PATCH_ADDR = $(shell echo ${SYMBOL_ADDR}-${DATA_ADDR}+${DATA_OFFSET} | bc) + +#### NOTE #### This value is currently *not* calculated and *should* be. It is currently determined experimentally… +DATA_PAD = 3582 + +all: $(DIRS_NEEDED) boot all-recursive + +ifeq (${CONFIG_EMBED_THEME}, y) + +boot: $(CONFIG_HEADERS) $(SYMROOT)/art.h $(SYMROOT)/embedded.h $(OBJS) $(addprefix $(SYMROOT)/, $(LIBDEP)) + +else + +boot: $(CONFIG_HEADERS) $(SYMROOT)/embedded.h $(OBJS) $(addprefix $(SYMROOT)/, $(LIBDEP)) + + +endif + @${MKDIRS} $(OBJROOT)/../boot2_modules/ + + @### First pass, don't worry abount segment alignment. + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + + +ifeq (${CONFIG_MODULES}, y) + + @# Generate the Symbols.dylib file + @echo "\t[dyldsymboltool] Symbols.dylib" + @$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE} + + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + + + @# Second pass, fixup global var locations + @${RM} $(SYMROOT)/${SYMBOLS_MODULE} + + @# Generate the Symbols.dylib file + @echo "\t[dyldsymboltool] Symbols.dylib" + @$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE} + + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + + @#${RM} $(SYMROOT)/${SYMBOLS_MODULE} + + @$(LD) -arch i386 \ + -undefined dynamic_lookup \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + $(filter %.o,$^) $(LIBS) \ + -final_output Symbols \ + -macosx_version_min 10.6 \ + -o $(OBJROOT)/Symbols_LINKER_ONLY.dylib + +else + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys +endif + + + @echo "\t[MACHOCONV] boot" + @$(SYMROOT)/machOconv ${SYMROOT}/$@.sys $(SYMROOT)/$@ &> /dev/null + + @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \ + if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\ + then \ + echo "\t******* boot is $$size bytes *******"; \ + echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\ + rm $(SYMROOT)/boot ;\ + exit 1;\ + else \ + echo "\t******* boot is $$size bytes *******"; \ + fi) + +$(SYMROOT)/art.h: + @if [ "$(PNGCRUSH)" ]; then \ + echo "optimizing art files ...\n$(PNGCRUSH) $(PNGOPTIONS) artwork/$(THEME)"; \ + cd $(THEMEDIR) && find . -name '*.png' -exec $(PNGCRUSH) -q $(PNGOPTIONS) -d $(SYMROOT)/embed {} \;; \ + cp theme.plist $(SYMROOT)/embed; \ + else \ + cp -R $(THEMEDIR) $(SYMROOT)/embed; \ + fi; + @echo "#ifndef __BOOT2_ART_H" >> $(SYMROOT)/art.h + @echo "#define __BOOT2_ART_H" >> $(SYMROOT)/art.h + @cd $(SYMROOT)/embed && find . -name 'theme.plist' -exec xxd -i >> $(SYMROOT)/art.h {} \; + @cd $(SYMROOT)/embed && find . -name '*.png' -exec xxd -i >> $(SYMROOT)/art.h {} \; + + @echo "typedef struct {" >> $(SYMROOT)/art.h + @echo " char name[32];" >> $(SYMROOT)/art.h + @echo " unsigned char *pngdata;" >> $(SYMROOT)/art.h + @echo " unsigned int *length;" >> $(SYMROOT)/art.h + @echo "} embeddedpng_t;" >> $(SYMROOT)/art.h + @echo "" >> $(SYMROOT)/art.h + @echo "embeddedpng_t embeddedImages[] = {" >> $(SYMROOT)/art.h + @cd $(SYMROOT)/embed && find . -name '*.png' | sort | cut -f 2 -d '/' | cut -f 1 -d '.' | \ + awk '{ printf "\t{.name = \"%s\", .pngdata = __%s_png, .length = &__%s_png_len},\n", $$1, $$1, $$1 }' >> $(SYMROOT)/art.h + @echo "};" >> $(SYMROOT)/art.h + + @echo "#endif /* !__BOOT2_ART_H */" >> $(SYMROOT)/art.h ;\ + +$(SYMROOT)/embedded.h: + @cd $(SYMROOT)/../../doc && xxd -i BootHelp.txt > $(SYMROOT)/embedded.h + + +#dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(SYMROOT)/boot $(SYMROOT)/boot.sys $(SYMROOT)/embedded.h $(OBJROOT)/Symbols_LINKER_ONLY.dylib; do \ + if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @if [ -d "$(OBJROOT)" ];then echo "\t[RM] all objects in $(OBJROOT)"; fi + @rm -f $(SYMROOT)/boot $(SYMROOT)/boot.sys $(SYMROOT)/embedded.h $(OBJS) + @rm -rf $(OBJROOT) diff --git a/i386/boot2/.svn/text-base/WKdm.h.svn-base b/i386/boot2/.svn/text-base/WKdm.h.svn-base new file mode 100644 index 0000000..be3ca2d --- /dev/null +++ b/i386/boot2/.svn/text-base/WKdm.h.svn-base @@ -0,0 +1,227 @@ +/* direct-mapped partial matching compressor with simple 22/10 split + * + * Compresses buffers using a dictionary based match and partial match + * (high bits only or full match) scheme. + * + * Paul Wilson -- wilson@cs.utexas.edu + * Scott F. Kaplan -- sfkaplan@cs.utexas.edu + * September 1997 + */ + +/* compressed output format, in memory order + * 1. a four-word HEADER containing four one-word values: + * i. a one-word code saying what algorithm compressed the data + * ii. an integer WORD offset into the page saying + * where the queue position area starts + * iii. an integer WORD offset into the page saying where + * the low-bits area starts + * iv. an integer WORD offset into the page saying where the + * low-bits area ends + * + * 2. a 64-word TAGS AREA holding one two-bit tag for each word in + * the original (1024-word) page, packed 16 per word + * + * 3. a variable-sized FULL WORDS AREA (always word aligned and an + * integral number of words) holding full-word patterns that + * were not in the dictionary when encoded (i.e., dictionary misses) + * + * 4. a variable-sized QUEUE POSITIONS AREA (always word aligned and + * an integral number of words) holding four-bit queue positions, + * packed eight per word. + * + * 5. a variable-sized LOW BITS AREA (always word aligned and an + * integral number of words) holding ten-bit low-bit patterns + * (from partial matches), packed three per word. + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* ============================================================ */ +/* Included files */ + +//#include +//#include +//#include +//#include + +typedef unsigned long WK_word; + +/* at the moment we have dependencies on the page size. That should + * be changed to work for any power-of-two size that's at least 16 + * words, or something like that + */ + +#define PAGE_SIZE_IN_WORDS 1024 +#define PAGE_SIZE_IN_BYTES 4096 + +#define DICTIONARY_SIZE 16 + +/* + * macros defining the basic layout of stuff in a page + */ +#define HEADER_SIZE_IN_WORDS 4 +#define TAGS_AREA_OFFSET 4 +#define TAGS_AREA_SIZE 64 + +/* the next few are used during compression to write the header */ +#define SET_QPOS_AREA_START(compr_dest_buf,qpos_start_addr) \ + (compr_dest_buf[1] = qpos_start_addr - compr_dest_buf) +#define SET_LOW_BITS_AREA_START(compr_dest_buf,lb_start_addr) \ + (compr_dest_buf[2] = lb_start_addr - compr_dest_buf) +#define SET_LOW_BITS_AREA_END(compr_dest_buf,lb_end_addr) \ + (compr_dest_buf[3] = lb_end_addr - compr_dest_buf) + +/* the next few are only use during decompression to read the header */ +#define TAGS_AREA_START(decomp_src_buf) \ + (decomp_src_buf + TAGS_AREA_OFFSET) +#define TAGS_AREA_END(decomp_src_buf) \ + (TAGS_AREA_START(decomp_src_buf) + TAGS_AREA_SIZE) +#define FULL_WORD_AREA_START(the_buf) TAGS_AREA_END(the_buf) +#define QPOS_AREA_START(decomp_src_buf) \ + (decomp_src_buf + decomp_src_buf[1]) +#define LOW_BITS_AREA_START(decomp_src_buf) \ + (decomp_src_buf + (decomp_src_buf[2])) +#define QPOS_AREA_END(the_buf) LOW_BITS_AREA_START(the_buf) +#define LOW_BITS_AREA_END(decomp_src_buf) \ + (decomp_src_buf + (decomp_src_buf[3])) + +/* ============================================================ */ +/* Types and structures */ + +/* A structure to store each element of the dictionary. */ +typedef WK_word DictionaryElement; + +/* ============================================================ */ +/* Misc constants */ + +#define BITS_PER_WORD 32 +#define BYTES_PER_WORD 4 +#define NUM_LOW_BITS 10 +#define LOW_BITS_MASK 0x3FF +#define ALL_ONES_MASK 0xFFFFFFFF + +#define TWO_BITS_PACKING_MASK 0x03030303 +#define FOUR_BITS_PACKING_MASK 0x0F0F0F0F +#define TEN_LOW_BITS_MASK 0x000003FF +#define TWENTY_TWO_HIGH_BITS_MASK 0xFFFFFC00 + +/* Tag values. NOTE THAT CODE MAY DEPEND ON THE NUMBERS USED. + * Check for conditionals doing arithmetic on these things + * before changing them + */ +#define ZERO_TAG 0x0 +#define PARTIAL_TAG 0x1 +#define MISS_TAG 0x2 +#define EXACT_TAG 0x3 + +#define BITS_PER_BYTE 8 + +/* ============================================================ */ +/* Global macros */ + +/* Shift out the low bits of a pattern to give the high bits pattern. + The stripped patterns are used for initial tests of partial + matches. */ +#define HIGH_BITS(word_pattern) (word_pattern >> NUM_LOW_BITS) + +/* String the high bits of a pattern so the low order bits can + be included in an encoding of a partial match. */ +#define LOW_BITS(word_pattern) (word_pattern & LOW_BITS_MASK) + +#if defined DEBUG_WK +#define DEBUG_PRINT_1(string) printf (string) +#define DEBUG_PRINT_2(string,value) printf(string, value) +#else +#define DEBUG_PRINT_1(string) +#define DEBUG_PRINT_2(string, value) +#endif + +/* Set up the dictionary before performing compression or + decompression. Each element is loaded with some value, the + high-bits version of that value, and a next pointer. */ +#define PRELOAD_DICTIONARY { \ + dictionary[0] = 1; \ + dictionary[1] = 1; \ + dictionary[2] = 1; \ + dictionary[3] = 1; \ + dictionary[4] = 1; \ + dictionary[5] = 1; \ + dictionary[6] = 1; \ + dictionary[7] = 1; \ + dictionary[8] = 1; \ + dictionary[9] = 1; \ + dictionary[10] = 1; \ + dictionary[11] = 1; \ + dictionary[12] = 1; \ + dictionary[13] = 1; \ + dictionary[14] = 1; \ + dictionary[15] = 1; \ +} + +/* these are the constants for the hash function lookup table. + * Only zero maps to zero. The rest of the tabale is the result + * of appending 17 randomizations of the multiples of 4 from + * 4 to 56. Generated by a Scheme script in hash.scm. + */ +#define HASH_LOOKUP_TABLE_CONTENTS { \ + 0, 52, 8, 56, 16, 12, 28, 20, 4, 36, 48, 24, 44, 40, 32, 60, \ + 8, 12, 28, 20, 4, 60, 16, 36, 24, 48, 44, 32, 52, 56, 40, 12, \ + 8, 48, 16, 52, 60, 28, 56, 32, 20, 24, 36, 40, 44, 4, 8, 40, \ + 60, 32, 20, 44, 4, 36, 52, 24, 16, 56, 48, 12, 28, 16, 8, 40, \ + 36, 28, 32, 12, 4, 44, 52, 20, 24, 48, 60, 56, 40, 48, 8, 32, \ + 28, 36, 4, 44, 20, 56, 60, 24, 52, 16, 12, 12, 4, 48, 20, 8, \ + 52, 16, 60, 24, 36, 44, 28, 56, 40, 32, 36, 20, 24, 60, 40, 44, \ + 52, 16, 32, 4, 48, 8, 28, 56, 12, 28, 32, 40, 52, 36, 16, 20, \ + 48, 8, 4, 60, 24, 56, 44, 12, 8, 36, 24, 28, 16, 60, 20, 56, \ + 32, 40, 48, 12, 4, 44, 52, 44, 40, 12, 56, 8, 36, 24, 60, 28, \ + 48, 4, 32, 20, 16, 52, 60, 12, 24, 36, 8, 4, 16, 56, 48, 44, \ + 40, 52, 32, 20, 28, 32, 12, 36, 28, 24, 56, 40, 16, 52, 44, 4, \ + 20, 60, 8, 48, 48, 52, 12, 20, 32, 44, 36, 28, 4, 40, 24, 8, \ + 56, 60, 16, 36, 32, 8, 40, 4, 52, 24, 44, 20, 12, 28, 48, 56, \ + 16, 60, 4, 52, 60, 48, 20, 16, 56, 44, 24, 8, 40, 12, 32, 28, \ + 36, 24, 32, 12, 4, 20, 16, 60, 36, 28, 8, 52, 40, 48, 44, 56 \ +} + +#define HASH_TO_DICT_BYTE_OFFSET(pattern) \ + (hashLookupTable[((pattern) >> 10) & 0xFF]) + +extern const char hashLookupTable[]; + +/* EMIT... macros emit bytes or words into the intermediate arrays + */ + +#define EMIT_BYTE(fill_ptr, byte_value) {*fill_ptr = byte_value; fill_ptr++;} +#define EMIT_WORD(fill_ptr,word_value) {*fill_ptr = word_value; fill_ptr++;} + +/* RECORD... macros record the results of modeling in the intermediate + * arrays + */ + +#define RECORD_ZERO { EMIT_BYTE(next_tag,ZERO_TAG); } + +#define RECORD_EXACT(queue_posn) EMIT_BYTE(next_tag,EXACT_TAG); \ + EMIT_BYTE(next_qp,(queue_posn)); + +#define RECORD_PARTIAL(queue_posn,low_bits_pattern) { \ + EMIT_BYTE(next_tag,PARTIAL_TAG); \ + EMIT_BYTE(next_qp,(queue_posn)); \ + EMIT_WORD(next_low_bits,(low_bits_pattern)) } + +#define RECORD_MISS(word_pattern) EMIT_BYTE(next_tag,MISS_TAG); \ + EMIT_WORD(next_full_patt,(word_pattern)); + +void +WKdm_decompress (WK_word* src_buf, + WK_word* dest_buf, + unsigned int words); +unsigned int +WKdm_compress (WK_word* src_buf, + WK_word* dest_buf, + unsigned int num_input_words); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/i386/boot2/.svn/text-base/WKdmDecompress.c.svn-base b/i386/boot2/.svn/text-base/WKdmDecompress.c.svn-base new file mode 100644 index 0000000..fd230ca --- /dev/null +++ b/i386/boot2/.svn/text-base/WKdmDecompress.c.svn-base @@ -0,0 +1,285 @@ +#include +#include "WKdm.h" + +/* Part of __HIB section */ + +/*************************************************************************** + * THE UNPACKING ROUTINES should GO HERE + */ + +const char hashLookupTable [] = HASH_LOOKUP_TABLE_CONTENTS; + +#if 0 +#define GET_NEXT_TAG tags[tagsIndex++] +#define GET_NEXT_FULL_PATTERN fullPatterns[fullPatternsIndex++] +#define GET_NEXT_LOW_BITS lowBits[lowBitsIndex++] +#define GET_NEXT_DICTIONARY_INDEX dictionaryIndices[dictionaryIndicesIndex++] +#endif + +/* WK_unpack_2bits takes any number of words containing 16 two-bit values + * and unpacks them into four times as many words containg those + * two bit values as bytes (with the low two bits of each byte holding + * the actual value. + */ +static WK_word* +WK_unpack_2bits(WK_word *input_buf, + WK_word *input_end, + WK_word *output_buf) { + + register WK_word *input_next = input_buf; + register WK_word *output_next = output_buf; + register WK_word packing_mask = TWO_BITS_PACKING_MASK; + + /* loop to repeatedly grab one input word and unpack it into + * 4 output words. This loop could be unrolled a little---it's + * designed to be easy to do that. + */ + while (input_next < input_end) { + register WK_word temp = input_next[0]; + DEBUG_PRINT_2("Unpacked tags word: %.8x\n", temp); + output_next[0] = temp & packing_mask; + output_next[1] = (temp >> 2) & packing_mask; + output_next[2] = (temp >> 4) & packing_mask; + output_next[3] = (temp >> 6) & packing_mask; + + output_next += 4; + input_next++; + } + + return output_next; + +} + +/* unpack four bits consumes any number of words (between input_buf + * and input_end) holding 8 4-bit values per word, and unpacks them + * into twice as many words, with each value in a separate byte. + * (The four-bit values occupy the low halves of the bytes in the + * result). + */ +static WK_word* +WK_unpack_4bits(WK_word *input_buf, + WK_word *input_end, + WK_word *output_buf) { + + register WK_word *input_next = input_buf; + register WK_word *output_next = output_buf; + register WK_word packing_mask = FOUR_BITS_PACKING_MASK; + + + /* loop to repeatedly grab one input word and unpack it into + * 4 output words. This loop should probably be unrolled + * a little---it's designed to be easy to do that. + */ + while (input_next < input_end) { + register WK_word temp = input_next[0]; + DEBUG_PRINT_2("Unpacked dictionary indices word: %.8x\n", temp); + output_next[0] = temp & packing_mask; + output_next[1] = (temp >> 4) & packing_mask; + + output_next += 2; + input_next++; + } + + return output_next; + +} + +/* unpack_3_tenbits unpacks three 10-bit items from (the low 30 bits of) + * a 32-bit word + */ +static WK_word* +WK_unpack_3_tenbits(WK_word *input_buf, + WK_word *input_end, + WK_word *output_buf) { + + register WK_word *input_next = input_buf; + register WK_word *output_next = output_buf; + register WK_word packing_mask = LOW_BITS_MASK; + + /* loop to fetch words of input, splitting each into three + * words of output with 10 meaningful low bits. This loop + * probably ought to be unrolled and maybe coiled + */ + while (input_next < input_end) { + register WK_word temp = input_next[0]; + + output_next[0] = temp & packing_mask; + output_next[1] = (temp >> 10) & packing_mask; + output_next[2] = temp >> 20; + + input_next++; + output_next += 3; + } + + return output_next; + +} + +/********************************************************************* + * WKdm_decompress --- THE DECOMPRESSOR + * Expects WORD pointers to the source and destination buffers + * and a page size in words. The page size had better be 1024 unless + * somebody finds the places that are dependent on the page size and + * fixes them + */ + +void +WKdm_decompress (WK_word* src_buf, + WK_word* dest_buf, + __unused unsigned int words) +{ + + DictionaryElement dictionary[DICTIONARY_SIZE]; + + /* arrays that hold output data in intermediate form during modeling */ + /* and whose contents are packed into the actual output after modeling */ + + /* sizes of these arrays should be increased if you want to compress + * pages larger than 4KB + */ + WK_word tempTagsArray[300]; /* tags for everything */ + WK_word tempQPosArray[300]; /* queue positions for matches */ + WK_word tempLowBitsArray[1200]; /* low bits for partial matches */ + + PRELOAD_DICTIONARY; + +#ifdef WK_DEBUG + printf("\nIn DECOMPRESSOR\n"); + printf("tempTagsArray is at %u\n", (unsigned long int) tempTagsArray); + printf("tempQPosArray is at %u\n", (unsigned long int) tempQPosArray); + printf("tempLowBitsArray is at %u\n", (unsigned long int) tempLowBitsArray); + + printf(" first four words of source buffer are:\n"); + printf(" %u\n %u\n %u\n %u\n", + src_buf[0], src_buf[1], src_buf[2], src_buf[3]); + + { int i; + WK_word *arr =(src_buf + TAGS_AREA_OFFSET + (PAGE_SIZE_IN_WORDS / 16)); + + printf(" first 20 full patterns are: \n"); + for (i = 0; i < 20; i++) { + printf(" %d", arr[i]); + } + printf("\n"); + } +#endif + + WK_unpack_2bits(TAGS_AREA_START(src_buf), + TAGS_AREA_END(src_buf), + tempTagsArray); + +#ifdef WK_DEBUG + { int i; + char* arr = (char *) tempTagsArray; + + printf(" first 200 tags are: \n"); + for (i = 0; i < 200; i++) { + printf(" %d", arr[i]); + } + printf("\n"); + } +#endif + + WK_unpack_4bits(QPOS_AREA_START(src_buf), + QPOS_AREA_END(src_buf), + tempQPosArray); + +#ifdef WK_DEBUG + { int i; + char* arr = (char *) tempQPosArray; + + printf(" first 200 queue positions are: \n"); + for (i = 0; i < 200; i++) { + printf(" %d", arr[i]); + } + printf("\n"); + } +#endif + + WK_unpack_3_tenbits(LOW_BITS_AREA_START(src_buf), + LOW_BITS_AREA_END(src_buf), + tempLowBitsArray); + +#ifdef WK_DEBUG + printf("AFTER UNPACKING, about to enter main block \n"); +#endif + + { + register char *next_tag = (char *) tempTagsArray; + char *tags_area_end = + ((char *) tempTagsArray) + PAGE_SIZE_IN_WORDS; + char *next_q_pos = (char *) tempQPosArray; + WK_word *next_low_bits = tempLowBitsArray; + WK_word *next_full_word = FULL_WORD_AREA_START(src_buf); + + WK_word *next_output = dest_buf; + +#ifdef WK_DEBUG + printf("next_output is %u\n", next_output); + + printf("next_tag is %u \n", next_tag); + printf("tags_area_end is %u\n", tags_area_end); + printf("next_q_pos is %u\n", next_q_pos); + printf("next_low_bits is %u\n", next_low_bits); + printf("next_full_word is %u\n", next_full_word); +#endif + + /* this loop should probably be unrolled. Maybe we should unpack + * as 4 bit values, giving two consecutive tags, and switch on + * that 16 ways to decompress 2 words at a whack + */ + while (next_tag < tags_area_end) { + + char tag = next_tag[0]; + + switch(tag) { + + case ZERO_TAG: { + *next_output = 0; + break; + } + case EXACT_TAG: { + WK_word *dict_location = dictionary + *(next_q_pos++); + /* no need to replace dict. entry if matched exactly */ + *next_output = *dict_location; + break; + } + case PARTIAL_TAG: { + WK_word *dict_location = dictionary + *(next_q_pos++); + { + WK_word temp = *dict_location; + + /* strip out low bits */ + temp = ((temp >> NUM_LOW_BITS) << NUM_LOW_BITS); + + /* add in stored low bits from temp array */ + temp = temp | *(next_low_bits++); + + *dict_location = temp; /* replace old value in dict. */ + *next_output = temp; /* and echo it to output */ + } + break; + } + case MISS_TAG: { + WK_word missed_word = *(next_full_word++); + WK_word *dict_location = + (WK_word *) + (((char *) dictionary) + HASH_TO_DICT_BYTE_OFFSET(missed_word)); + *dict_location = missed_word; + *next_output = missed_word; + break; + } + } + next_tag++; + next_output++; + } + +#ifdef WK_DEBUG + printf("AFTER DECOMPRESSING\n"); + printf("next_output is %u\n", (unsigned long int) next_output); + printf("next_tag is %u\n", (unsigned long int) next_tag); + printf("next_full_word is %u\n", (unsigned long int) next_full_word); + printf("next_q_pos is %u\n", (unsigned long int) next_q_pos); +#endif + } +} diff --git a/i386/boot2/.svn/text-base/appleClut8.h.svn-base b/i386/boot2/.svn/text-base/appleClut8.h.svn-base new file mode 100644 index 0000000..50416f7 --- /dev/null +++ b/i386/boot2/.svn/text-base/appleClut8.h.svn-base @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOT2_APPLECLUT8_H +#define __BOOT2_APPLECLUT8_H + +static const unsigned char appleClut8[ 256 * 3 ] = +{ + 0xff,0xff,0xff, 0xbf,0xbf,0xbf, 0xbe,0xbe,0xbe, 0xbd,0xbd,0xbd, + 0xbc,0xbc,0xbc, 0xff,0xff,0x00, 0xba,0xba,0xba, 0xb9,0xb9,0xb9, + 0xb8,0xb8,0xb8, 0xb7,0xb7,0xb7, 0xb6,0xb6,0xb6, 0xb5,0xb5,0xb5, + 0xb4,0xb4,0xb4, 0xb3,0xb3,0xb3, 0xb2,0xb2,0xb2, 0x00,0x00,0x00, + 0xb1,0xb1,0xb1, 0xb0,0xb0,0xb0, 0xaf,0xaf,0xaf, 0xae,0xae,0xae, + 0xad,0xad,0xad, 0xac,0xac,0xac, 0xab,0xab,0xab, 0xaa,0xaa,0xaa, + 0xff,0x00,0xff, 0xa9,0xa9,0xa9, 0xa8,0xa8,0xa8, 0xa7,0xa7,0xa7, + 0xa6,0xa6,0xa6, 0xa5,0xa5,0xa5, 0xa4,0xa4,0xa4, 0xa3,0xa3,0xa3, + 0xa2,0xa2,0xa2, 0xa1,0xa1,0xa1, 0xa0,0xa0,0xa0, 0xff,0x00,0x00, + 0x9f,0x9f,0x9f, 0x9e,0x9e,0x9e, 0x9d,0x9d,0x9d, 0x9c,0x9c,0x9c, + 0x9b,0x9b,0x9b, 0x9a,0x9a,0x9a, 0xcc,0xcc,0xff, 0xcc,0xcc,0xcc, + 0x99,0x99,0x99, 0x98,0x98,0x98, 0x97,0x97,0x97, 0x96,0x96,0x96, + 0x95,0x95,0x95, 0x94,0x94,0x94, 0x93,0x93,0x93, 0x92,0x92,0x92, + 0x91,0x91,0x91, 0x90,0x90,0x90, 0x8f,0x8f,0x8f, 0x8e,0x8e,0x8e, + 0x8d,0x8d,0x8d, 0x8c,0x8c,0x8c, 0x8b,0x8b,0x8b, 0x8a,0x8a,0x8a, + 0x89,0x89,0x89, 0x87,0x87,0x87, 0x86,0x86,0x86, 0x85,0x85,0x85, + 0x84,0x84,0x84, 0x83,0x83,0x83, 0x82,0x82,0x82, 0x81,0x81,0x81, + 0x80,0x80,0x80, 0x7f,0x7f,0x7f, 0x7e,0x7e,0x7e, 0x7d,0x7d,0x7d, + 0x7c,0x7c,0x7c, 0x7b,0x7b,0x7b, 0x7a,0x7a,0x7a, 0x79,0x79,0x79, + 0x78,0x78,0x78, 0x76,0x76,0x76, 0x75,0x75,0x75, 0x74,0x74,0x74, + 0x73,0x73,0x73, 0x72,0x72,0x72, 0x71,0x71,0x71, 0x70,0x70,0x70, + 0x6f,0x6f,0x6f, 0x6e,0x6e,0x6e, 0x6d,0x6d,0x6d, 0x6c,0x6c,0x6c, + 0x6b,0x6b,0x6b, 0x6a,0x6a,0x6a, 0x69,0x69,0x69, 0x68,0x68,0x68, + 0x67,0x67,0x67, 0x66,0x66,0x66, 0x64,0x64,0x64, 0x63,0x63,0x63, + 0x62,0x62,0x62, 0x61,0x61,0x61, 0x60,0x60,0x60, 0x5f,0x5f,0x5f, + 0x5e,0x5e,0x5e, 0x5d,0x5d,0x5d, 0x5c,0x5c,0x5c, 0x5b,0x5b,0x5b, + 0x5a,0x5a,0x5a, 0x59,0x59,0x59, 0x58,0x58,0x58, 0x57,0x57,0x57, + 0x56,0x56,0x56, 0x54,0x54,0x54, 0x53,0x53,0x53, 0x52,0x52,0x52, + 0x51,0x51,0x51, 0x50,0x50,0x50, 0x4f,0x4f,0x4f, 0x4e,0x4e,0x4e, + 0x4d,0x4d,0x4d, 0x4c,0x4c,0x4c, 0x4b,0x4b,0x4b, 0x4a,0x4a,0x4a, + 0x49,0x49,0x49, 0x48,0x48,0x48, 0x47,0x47,0x47, 0x46,0x46,0x46, + 0x45,0x45,0x45, 0x43,0x43,0x43, 0x42,0x42,0x42, 0x41,0x41,0x41, + 0x40,0x40,0x40, 0x3f,0x3f,0x3f, 0x3e,0x3e,0x3e, 0x3d,0x3d,0x3d, + 0x3c,0x3c,0x3c, 0x3b,0x3b,0x3b, 0x3a,0x3a,0x3a, 0x39,0x39,0x39, + 0x38,0x38,0x38, 0x37,0x37,0x37, 0x36,0x36,0x36, 0x35,0x35,0x35, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x00,0xff,0xff, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x00,0xff,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x00,0x00,0xff, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0xdd,0x00,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x00,0xbb,0x00, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0xbb,0xbb,0xbb, + 0x65,0x65,0x65, 0x88,0x88,0x88, 0x77,0x77,0x77, 0x55,0x55,0x55, + 0x44,0x44,0x44, 0x22,0x22,0x22, 0x65,0x65,0x65, 0x00,0x00,0x00 +}; + +#endif /* !__BOOT2_APPLECLUT8_H */ diff --git a/i386/boot2/.svn/text-base/appleboot.h.svn-base b/i386/boot2/.svn/text-base/appleboot.h.svn-base new file mode 100644 index 0000000..f14abd1 --- /dev/null +++ b/i386/boot2/.svn/text-base/appleboot.h.svn-base @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * appleboot.h - Apple logo shown durring boot + * + * Copyright (c) 2002 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#define kAppleBootWidth (128) +#define kAppleBootHeight (128) +#define kAppleBootOffset (0) +#define kAppleBootFrames (1) +#define kAppleBootFPS (0) +#define kAppleBootRLEBlocks (686) + +// The original data was 16K in size (128x128) and would make the booter +// cross a 64K segment boundary. boot0 cannot load more than 127 sectors +// without changes. To eiminate that complexity, the data was run length +// encoded to save space. The reduced size is 1372 bytes. + +const unsigned char gAppleBootPictRLE[] = +{ + 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0x50, 0x01, 0x01, 0x02, 0x01, 0x17, + 0x01, 0x34, 0x01, 0x47, 0x03, 0x50, 0x01, 0x13, 0x76, 0x01, 0x01, 0x03, + 0x01, 0x20, 0x01, 0x40, 0x06, 0x50, 0x01, 0x13, 0x75, 0x01, 0x01, 0x1a, + 0x01, 0x42, 0x07, 0x50, 0x01, 0xfa, 0x01, 0x0a, 0x73, 0x01, 0x01, 0x07, + 0x01, 0x34, 0x09, 0x50, 0x01, 0x43, 0x01, 0x02, 0x72, 0x01, 0x01, 0x0e, + 0x01, 0x43, 0x0a, 0x50, 0x01, 0x36, 0x72, 0x01, 0x01, 0x14, 0x01, 0x4a, + 0x0b, 0x50, 0x01, 0x20, 0x71, 0x01, 0x01, 0x12, 0x01, 0x4b, 0x0b, 0x50, + 0x01, 0x4d, 0x01, 0x0b, 0x70, 0x01, 0x01, 0x0b, 0x01, 0x48, 0x0c, 0x50, + 0x01, 0xf9, 0x70, 0x01, 0x01, 0x03, 0x01, 0x3e, 0x0d, 0x50, 0x01, 0x1f, + 0x70, 0x01, 0x01, 0x2f, 0x0d, 0x50, 0x01, 0x48, 0x01, 0x06, 0x6f, 0x01, + 0x01, 0x15, 0x01, 0x4f, 0x0d, 0x50, 0x01, 0x27, 0x6f, 0x01, 0x01, 0x02, + 0x01, 0x3f, 0x0d, 0x50, 0x01, 0x45, 0x01, 0xf7, 0x6f, 0x01, 0x01, 0x1d, + 0x0e, 0x50, 0x01, 0x19, 0x6f, 0x01, 0x01, 0x02, 0x01, 0x40, 0x0d, 0x50, + 0x01, 0x2f, 0x70, 0x01, 0x01, 0x15, 0x0d, 0x50, 0x01, 0x3b, 0x01, 0x03, + 0x70, 0x01, 0x01, 0x34, 0x0c, 0x50, 0x01, 0x3f, 0x01, 0x07, 0x70, 0x01, + 0x01, 0xf7, 0x01, 0x47, 0x0b, 0x50, 0x01, 0xf9, 0x01, 0x07, 0x71, 0x01, + 0x01, 0x14, 0x0b, 0x50, 0x01, 0x36, 0x01, 0xf7, 0x72, 0x01, 0x01, 0x24, + 0x09, 0x50, 0x01, 0x4d, 0x01, 0x28, 0x74, 0x01, 0x01, 0x33, 0x08, 0x50, + 0x01, 0x3f, 0x01, 0x14, 0x75, 0x01, 0x01, 0x3a, 0x06, 0x50, 0x01, 0x41, + 0x01, 0x1f, 0x01, 0x02, 0x76, 0x01, 0x01, 0x3a, 0x03, 0x50, 0x01, 0x48, + 0x01, 0x35, 0x01, 0x17, 0x01, 0x02, 0x78, 0x01, 0x01, 0x15, 0x01, 0x33, + 0x01, 0x27, 0x01, 0x15, 0x01, 0xf7, 0x67, 0x01, 0x01, 0x02, 0x01, 0x08, + 0x01, 0x0e, 0x01, 0x13, 0x01, 0x14, 0x01, 0x12, 0x01, 0x0d, 0x01, 0x06, + 0x01, 0x02, 0x1c, 0x01, 0x01, 0x04, 0x01, 0x0b, 0x01, 0x12, 0x01, 0x17, + 0x01, 0x19, 0x01, 0x15, 0x01, 0x11, 0x01, 0x08, 0x01, 0x02, 0x4e, 0x01, + 0x01, 0x02, 0x01, 0x11, 0x01, 0x26, 0x01, 0x39, 0x01, 0x44, 0x01, 0x4c, + 0x01, 0x4f, 0x02, 0x50, 0x01, 0x4f, 0x01, 0x4d, 0x01, 0x4a, 0x01, 0x3f, + 0x01, 0x31, 0x01, 0x19, 0x01, 0xf7, 0x15, 0x01, 0x01, 0x0b, 0x01, 0x1c, + 0x01, 0x2e, 0x01, 0xf9, 0x01, 0x46, 0x01, 0x4d, 0x04, 0x50, 0x01, 0x4f, + 0x01, 0x4b, 0x01, 0x42, 0x01, 0x34, 0x01, 0x1f, 0x01, 0x0a, 0x49, 0x01, + 0x01, 0xf7, 0x01, 0x21, 0x01, 0x3f, 0x01, 0x4f, 0x0d, 0x50, 0x01, 0x47, + 0x01, 0x2d, 0x01, 0x0d, 0x10, 0x01, 0x01, 0x0d, 0x01, 0x25, 0x01, 0x3d, + 0x01, 0xfa, 0x0e, 0x50, 0x01, 0x4c, 0x01, 0x37, 0x01, 0x15, 0x45, 0x01, + 0x01, 0x04, 0x01, 0x25, 0x01, 0x45, 0x12, 0x50, 0x01, 0x4d, 0x01, 0x39, + 0x01, 0x19, 0x01, 0x02, 0x0a, 0x01, 0x01, 0x09, 0x01, 0x21, 0x01, 0xf9, + 0x01, 0x4d, 0x14, 0x50, 0x01, 0xf9, 0x01, 0x15, 0x42, 0x01, 0x01, 0x17, + 0x01, 0x42, 0x17, 0x50, 0x01, 0x42, 0x01, 0x27, 0x01, 0x0e, 0x01, 0x02, + 0x03, 0x01, 0x01, 0x02, 0x01, 0x0b, 0x01, 0x1f, 0x01, 0x38, 0x01, 0x4b, + 0x19, 0x50, 0x01, 0x33, 0x01, 0x06, 0x3e, 0x01, 0x01, 0x03, 0x01, 0x2e, + 0x1b, 0x50, 0x01, 0x4d, 0x01, 0x43, 0x01, 0x3a, 0x01, 0x37, 0x01, 0x3a, + 0x01, 0x42, 0x01, 0x4d, 0x1d, 0x50, 0x01, 0x42, 0x01, 0x0e, 0x3c, 0x01, + 0x01, 0x0a, 0x01, 0xf9, 0x41, 0x50, 0x01, 0x48, 0x01, 0x13, 0x3a, 0x01, + 0x01, 0x0d, 0x01, 0x45, 0x43, 0x50, 0x01, 0x4b, 0x01, 0x12, 0x38, 0x01, + 0x01, 0x10, 0x01, 0x48, 0x45, 0x50, 0x01, 0x48, 0x01, 0x0b, 0x36, 0x01, + 0x01, 0x0c, 0x01, 0x48, 0x47, 0x50, 0x01, 0x3d, 0x01, 0x03, 0x34, 0x01, + 0x01, 0x07, 0x01, 0x42, 0x49, 0x50, 0x01, 0x21, 0x34, 0x01, 0x01, 0x37, + 0x49, 0x50, 0x01, 0x42, 0x01, 0x12, 0x33, 0x01, 0x01, 0x22, 0x49, 0x50, + 0x01, 0x34, 0x01, 0xf7, 0x33, 0x01, 0x01, 0x0b, 0x01, 0x4b, 0x48, 0x50, + 0x01, 0x2c, 0x35, 0x01, 0x01, 0x36, 0x48, 0x50, 0x01, 0x29, 0x35, 0x01, + 0x01, 0x11, 0x01, 0x4f, 0x47, 0x50, 0x01, 0x2e, 0x36, 0x01, 0x01, 0x36, + 0x47, 0x50, 0x01, 0x3a, 0x01, 0x02, 0x35, 0x01, 0x01, 0x0b, 0x01, 0xfa, + 0x46, 0x50, 0x01, 0x46, 0x01, 0x08, 0x36, 0x01, 0x01, 0x26, 0x46, 0x50, + 0x01, 0x4e, 0x01, 0x15, 0x36, 0x01, 0x01, 0x02, 0x01, 0x40, 0x46, 0x50, + 0x01, 0x31, 0x37, 0x01, 0x01, 0x0e, 0x01, 0x4e, 0x45, 0x50, 0x01, 0x49, + 0x01, 0x08, 0x37, 0x01, 0x01, 0x25, 0x46, 0x50, 0x01, 0x29, 0x38, 0x01, + 0x01, 0x39, 0x45, 0x50, 0x01, 0x4c, 0x01, 0x0a, 0x37, 0x01, 0x01, 0xf7, + 0x01, 0x47, 0x45, 0x50, 0x01, 0x3a, 0x38, 0x01, 0x01, 0x10, 0x01, 0x4f, + 0x45, 0x50, 0x01, 0x22, 0x38, 0x01, 0x01, 0x1d, 0x46, 0x50, 0x01, 0x12, + 0x38, 0x01, 0x01, 0x29, 0x45, 0x50, 0x01, 0x4b, 0x01, 0x07, 0x38, 0x01, + 0x01, 0x36, 0x45, 0x50, 0x01, 0x42, 0x01, 0x02, 0x38, 0x01, 0x01, 0xf9, + 0x45, 0x50, 0x01, 0x3e, 0x39, 0x01, 0x01, 0x42, 0x45, 0x50, 0x01, 0x3c, + 0x39, 0x01, 0x01, 0x46, 0x45, 0x50, 0x01, 0x3b, 0x39, 0x01, 0x01, 0x48, + 0x45, 0x50, 0x01, 0xf9, 0x39, 0x01, 0x01, 0x48, 0x45, 0x50, 0x01, 0x3f, + 0x01, 0x02, 0x38, 0x01, 0x01, 0x46, 0x45, 0x50, 0x01, 0x48, 0x01, 0xf7, + 0x38, 0x01, 0x01, 0x43, 0x45, 0x50, 0x01, 0x4e, 0x01, 0x0e, 0x38, 0x01, + 0x01, 0x3f, 0x46, 0x50, 0x01, 0x1c, 0x38, 0x01, 0x01, 0x3a, 0x46, 0x50, + 0x01, 0x33, 0x38, 0x01, 0x01, 0x34, 0x46, 0x50, 0x01, 0x46, 0x01, 0x04, + 0x37, 0x01, 0x01, 0x2c, 0x47, 0x50, 0x01, 0x19, 0x37, 0x01, 0x01, 0x1f, + 0x47, 0x50, 0x01, 0x3a, 0x37, 0x01, 0x01, 0x15, 0x47, 0x50, 0x01, 0x4e, + 0x01, 0x11, 0x36, 0x01, 0x01, 0x0a, 0x01, 0xfa, 0x47, 0x50, 0x01, 0x37, + 0x36, 0x01, 0x01, 0x02, 0x01, 0x42, 0x47, 0x50, 0x01, 0x4f, 0x01, 0x15, + 0x36, 0x01, 0x01, 0x37, 0x48, 0x50, 0x01, 0x42, 0x01, 0x04, 0x35, 0x01, + 0x01, 0x25, 0x49, 0x50, 0x01, 0x2c, 0x35, 0x01, 0x01, 0x13, 0x49, 0x50, + 0x01, 0x4e, 0x01, 0x15, 0x34, 0x01, 0x01, 0xf7, 0x01, 0x47, 0x49, 0x50, + 0x01, 0x48, 0x01, 0x0b, 0x34, 0x01, 0x01, 0x37, 0x4a, 0x50, 0x01, 0x44, + 0x01, 0x0a, 0x33, 0x01, 0x01, 0x1f, 0x4b, 0x50, 0x01, 0x44, 0x01, 0x0d, + 0x32, 0x01, 0x01, 0x0a, 0x01, 0xfa, 0x4b, 0x50, 0x01, 0x48, 0x01, 0x17, + 0x32, 0x01, 0x01, 0x3a, 0x4c, 0x50, 0x01, 0x4f, 0x01, 0x2c, 0x01, 0x04, + 0x30, 0x01, 0x01, 0x1f, 0x4e, 0x50, 0x01, 0x41, 0x01, 0x19, 0x2f, 0x01, + 0x01, 0x07, 0x01, 0x4a, 0x4e, 0x50, 0x01, 0x44, 0x30, 0x01, 0x01, 0x33, + 0x4e, 0x50, 0x01, 0x36, 0x30, 0x01, 0x01, 0x14, 0x4e, 0x50, 0x01, 0x1f, + 0x30, 0x01, 0x01, 0x02, 0x01, 0x3f, 0x4c, 0x50, 0x01, 0x4d, 0x01, 0x0b, + 0x31, 0x01, 0x01, 0x1e, 0x4c, 0x50, 0x01, 0x3c, 0x32, 0x01, 0x01, 0x04, + 0x01, 0x44, 0x4b, 0x50, 0x01, 0x20, 0x33, 0x01, 0x01, 0x20, 0x4a, 0x50, + 0x01, 0x4a, 0x01, 0x07, 0x33, 0x01, 0x01, 0x04, 0x01, 0x43, 0x49, 0x50, + 0x01, 0x30, 0x35, 0x01, 0x01, 0x1c, 0x48, 0x50, 0x01, 0x4d, 0x01, 0x0e, + 0x35, 0x01, 0x01, 0x02, 0x01, 0x3e, 0x47, 0x50, 0x01, 0x36, 0x37, 0x01, + 0x01, 0x14, 0x01, 0x4f, 0x45, 0x50, 0x01, 0x4d, 0x01, 0x0e, 0x38, 0x01, + 0x01, 0x32, 0x45, 0x50, 0x01, 0x33, 0x39, 0x01, 0x01, 0x07, 0x01, 0x47, + 0x43, 0x50, 0x01, 0x4b, 0x01, 0x0b, 0x3a, 0x01, 0x01, 0x1c, 0x43, 0x50, + 0x01, 0x26, 0x3c, 0x01, 0x01, 0x37, 0x41, 0x50, 0x01, 0x41, 0x01, 0x04, + 0x3c, 0x01, 0x01, 0x08, 0x01, 0x48, 0x3f, 0x50, 0x01, 0x4e, 0x01, 0x13, + 0x3e, 0x01, 0x01, 0x19, 0x3f, 0x50, 0x01, 0x2d, 0x40, 0x01, 0x01, 0x2e, + 0x3d, 0x50, 0x01, 0x3f, 0x01, 0x03, 0x40, 0x01, 0x01, 0x03, 0x01, 0xf9, + 0x3b, 0x50, 0x01, 0x4a, 0x01, 0x0d, 0x42, 0x01, 0x01, 0x09, 0x01, 0x46, + 0x39, 0x50, 0x01, 0x4e, 0x01, 0x19, 0x44, 0x01, 0x01, 0x11, 0x01, 0x4b, + 0x38, 0x50, 0x01, 0x25, 0x46, 0x01, 0x01, 0x17, 0x01, 0x4d, 0x36, 0x50, + 0x01, 0x2e, 0x48, 0x01, 0x01, 0x1b, 0x01, 0x4d, 0x34, 0x50, 0x01, 0x31, + 0x4a, 0x01, 0x01, 0x17, 0x01, 0x4a, 0x14, 0x50, 0x01, 0x4d, 0x01, 0x44, + 0x01, 0x3b, 0x01, 0x34, 0x01, 0x2e, 0x01, 0x2c, 0x01, 0x2e, 0x01, 0x35, + 0x01, 0x3e, 0x01, 0x4a, 0x14, 0x50, 0x01, 0x2e, 0x4c, 0x01, 0x01, 0x0e, + 0x01, 0x41, 0x10, 0x50, 0x01, 0x4a, 0x01, 0x37, 0x01, 0x1f, 0x01, 0x0c, + 0x01, 0x03, 0x07, 0x01, 0x01, 0x06, 0x01, 0x15, 0x01, 0x2d, 0x01, 0x41, + 0x0f, 0x50, 0x01, 0x4a, 0x01, 0x1f, 0x4e, 0x01, 0x01, 0xf7, 0x01, 0x2e, + 0x01, 0xfa, 0x0b, 0x50, 0x01, 0x4f, 0x01, 0xf9, 0x01, 0x1e, 0x01, 0x07, + 0x0e, 0x01, 0x01, 0x02, 0x01, 0x14, 0x01, 0x31, 0x01, 0x48, 0x0b, 0x50, + 0x01, 0x37, 0x01, 0x0c, 0x51, 0x01, 0x01, 0x0d, 0x01, 0x2f, 0x01, 0x45, + 0x01, 0x4f, 0x05, 0x50, 0x01, 0x4f, 0x01, 0x43, 0x01, 0x2e, 0x01, 0x11, + 0x14, 0x01, 0x01, 0x07, 0x01, 0x1f, 0x01, 0x3c, 0x01, 0x4c, 0x04, 0x50, + 0x01, 0x4f, 0x01, 0x46, 0x01, 0x33, 0x01, 0x13, 0x55, 0x01, 0x01, 0x04, + 0x01, 0x12, 0x01, 0x1f, 0x01, 0x26, 0x01, 0x28, 0x01, 0x26, 0x01, 0x1e, + 0x01, 0x10, 0x01, 0x02, 0x19, 0x01, 0x01, 0x09, 0x01, 0x16, 0x01, 0x1e, + 0x01, 0x1f, 0x01, 0x1c, 0x01, 0x11, 0x01, 0x04, 0xff, 0x01, 0xff, 0x01, + 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, + 0xff, 0x01, 0xb3, 0x01 +}; diff --git a/i386/boot2/.svn/text-base/bmdecompress.c.svn-base b/i386/boot2/.svn/text-base/bmdecompress.c.svn-base new file mode 100644 index 0000000..aadb9ca --- /dev/null +++ b/i386/boot2/.svn/text-base/bmdecompress.c.svn-base @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1995-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "libsa.h" + +static void +PreviewDecompress16(uint32_t * compressBuffer, + uint32_t width, uint32_t height, uint32_t row, + uint16_t * output) +{ + int i, j; + uint32_t * input; + + uint16_t * sc0 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc1 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc2 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc3 = malloc((width+2) * sizeof(uint16_t)); + uint32_t sr0, sr1, sr2, sr3; + + bzero(sc0, (width+2) * sizeof(uint16_t)); + bzero(sc1, (width+2) * sizeof(uint16_t)); + bzero(sc2, (width+2) * sizeof(uint16_t)); + bzero(sc3, (width+2) * sizeof(uint16_t)); + + uint32_t tmp1, tmp2, out; + for (j = 0; j < (height + 2); j++) + { + input = compressBuffer; + if (j < height) + input += j; + else + input += height - 1; + input = (uint32_t *)(input[3] + ((uint8_t *)compressBuffer)); + + uint32_t data = 0, repeat = 0, fetch = 0, count = 0; + sr0 = sr1 = sr2 = sr3 = 0; + + for (i = 0; i < (width + 2); i++) + { + if (i < width) + { + if (!count) + { + count = *input++; + repeat = (count & 0xff000000); + count ^= repeat; + fetch = true; + } + else + fetch = (0 == repeat); + + count--; + + if (fetch) + { + data = *((uint16_t *)input); + (*((uint16_t *)input))++; + + // grayscale + // srgb 13933, 46871, 4732 + // ntsc 19595, 38470, 7471 + data = 13933 * (0x1f & (data >> 10)) + + 46871 * (0x1f & (data >> 5)) + + 4732 * (0x1f & data); + data >>= 13; + + // 70% white, 30 % black + data *= 19661; + data += (103 << 16); + data >>= 16; + } + } + + // gauss blur + tmp2 = sr0 + data; + sr0 = data; + tmp1 = sr1 + tmp2; + sr1 = tmp2; + tmp2 = sr2 + tmp1; + sr2 = tmp1; + tmp1 = sr3 + tmp2; + sr3 = tmp2; + + tmp2 = sc0[i] + tmp1; + sc0[i] = tmp1; + tmp1 = sc1[i] + tmp2; + sc1[i] = tmp2; + tmp2 = sc2[i] + tmp1; + sc2[i] = tmp1; + out = (128 + sc3[i] + tmp2) >> 11; + sc3[i] = tmp2; + + out &= 0x1f; + if ((i > 1) && (j > 1)) + output[i-2] = out | (out << 5) | (out << 10); + } + + if (j > 1) + output += row; + } + free(sc3); + free(sc2); + free(sc1); + free(sc0); +} + +static void +PreviewDecompress32(uint32_t * compressBuffer, + uint32_t width, uint32_t height, uint32_t row, + uint32_t * output) +{ + int i, j; + uint32_t * input; + + uint16_t * sc0 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc1 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc2 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc3 = malloc((width+2) * sizeof(uint16_t)); + uint32_t sr0, sr1, sr2, sr3; + + bzero(sc0, (width+2) * sizeof(uint16_t)); + bzero(sc1, (width+2) * sizeof(uint16_t)); + bzero(sc2, (width+2) * sizeof(uint16_t)); + bzero(sc3, (width+2) * sizeof(uint16_t)); + + uint32_t tmp1, tmp2, out; + for (j = 0; j < (height + 2); j++) + { + input = compressBuffer; + if (j < height) + input += j; + else + input += height - 1; + input = (uint32_t *)(input[3] + ((uint8_t *)compressBuffer)); + + uint32_t data = 0, repeat = 0, fetch = 0, count = 0; + sr0 = sr1 = sr2 = sr3 = 0; + + for (i = 0; i < (width + 2); i++) + { + if (i < width) + { + if (!count) + { + count = *input++; + repeat = (count & 0xff000000); + count ^= repeat; + fetch = true; + } + else + fetch = (0 == repeat); + + count--; + + if (fetch) + { + data = *input++; + + // grayscale + // srgb 13933, 46871, 4732 + // ntsc 19595, 38470, 7471 + data = 13933 * (0xff & (data >> 24)) + + 46871 * (0xff & (data >> 16)) + + 4732 * (0xff & data); + data >>= 16; + + // 70% white, 30 % black + data *= 19661; + data += (103 << 16); + data >>= 16; + } + } + + // gauss blur + tmp2 = sr0 + data; + sr0 = data; + tmp1 = sr1 + tmp2; + sr1 = tmp2; + tmp2 = sr2 + tmp1; + sr2 = tmp1; + tmp1 = sr3 + tmp2; + sr3 = tmp2; + + tmp2 = sc0[i] + tmp1; + sc0[i] = tmp1; + tmp1 = sc1[i] + tmp2; + sc1[i] = tmp2; + tmp2 = sc2[i] + tmp1; + sc2[i] = tmp1; + out = (128 + sc3[i] + tmp2) >> 8; + sc3[i] = tmp2; + + out &= 0xff; + if ((i > 1) && (j > 1)) + output[i-2] = out | (out << 8) | (out << 16); + } + + if (j > 1) + output += row; + } + + free(sc3); + free(sc2); + free(sc1); + free(sc0); +} + +void * +DecompressData(void *srcbase, int *dw, int *dh, int *bitsPerPixel) +{ + uint32_t * src = (uint32_t *) srcbase; + void * ret; + + *bitsPerPixel = 8 * ((int) src[0]); + *dw = (int) src[1]; + *dh = (int) src[2]; + + ret = malloc ((*dw * *dh * *bitsPerPixel)/ 8); + + switch(*bitsPerPixel) + { + case 32: + PreviewDecompress32((uint32_t *)srcbase, *dw, *dh, *dw, ret); + return ret; + case 16: + PreviewDecompress16((uint32_t *)srcbase, *dw, *dh, *dw, ret); + return ret; + default: + return 0; + } +} diff --git a/i386/boot2/.svn/text-base/boot.c.svn-base b/i386/boot2/.svn/text-base/boot.c.svn-base new file mode 100644 index 0000000..483515e --- /dev/null +++ b/i386/boot2/.svn/text-base/boot.c.svn-base @@ -0,0 +1,794 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 by Intel Corporation + */ + +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + */ + +/* + * Completely reworked by Sam Streeper (sam_s@NeXT.com) + * Reworked again by Curtis Galloway (galloway@NeXT.com) + */ + +#include "boot.h" +#include "bootstruct.h" +#include "fake_efi.h" +#include "sl.h" +#include "libsa.h" +#include "ramdisk.h" +#include "gui.h" +#include "platform.h" +#include "modules.h" + +/* + * How long to wait (in seconds) to load the + * kernel after displaying the "boot:" prompt. + */ +#define kBootErrorTimeout 5 + +bool gOverrideKernel, gEnableCDROMRescan, gScanSingleDrive, useGUI; +static bool gUnloadPXEOnExit = false; + +static char gCacheNameAdler[64 + 256]; +char *gPlatformName = gCacheNameAdler; + +char gRootDevice[ROOT_DEVICE_SIZE]; +char gMKextName[512]; +char gMacOSVersion[8]; +int bvCount = 0, gDeviceCount = 0; +//int menucount = 0; +long gBootMode; /* defaults to 0 == kBootModeNormal */ +BVRef bvr, menuBVR, bvChain; + +static bool checkOSVersion(const char * version); +static void getOSVersion(); +static unsigned long Adler32(unsigned char *buffer, long length); +//static void selectBiosDevice(void); + +/** options.c **/ +extern char* msgbuf; +void showTextBuffer(char *buf, int size); + + +//========================================================================== +// Zero the BSS. + +static void zeroBSS(void) +{ + extern char bss_start __asm("section$start$__DATA$__bss"); + extern char bss_end __asm("section$end$__DATA$__bss"); + extern char common_start __asm("section$start$__DATA$__common"); + extern char common_end __asm("section$end$__DATA$__common"); + + bzero(&bss_start, (&bss_end - &bss_start)); + bzero(&common_start, (&common_end - &common_start)); +} + +//========================================================================== +// Malloc error function + +static void malloc_error(char *addr, size_t size, const char *file, int line) +{ + stop("\nMemory allocation error! Addr: 0x%x, Size: 0x%x, File: %s, Line: %d\n", + (unsigned)addr, (unsigned)size, file, line); +} + +//========================================================================== +//Initializes the runtime. Right now this means zeroing the BSS and initializing malloc. +// +void initialize_runtime(void) +{ + zeroBSS(); + malloc_init(0, 0, 0, malloc_error); +} + +//========================================================================== +// execKernel - Load the kernel image (mach-o) and jump to its entry point. + +static int ExecKernel(void *binary) +{ + int ret; + entry_t kernelEntry; + + bootArgs->kaddr = bootArgs->ksize = 0; + execute_hook("ExecKernel", (void*)binary, NULL, NULL, NULL); + + ret = DecodeKernel(binary, + &kernelEntry, + (char **) &bootArgs->kaddr, + (int *)&bootArgs->ksize ); + + if ( ret != 0 ) + return ret; + + // Reserve space for boot args + reserveKernBootStruct(); + + // Notify modules that the kernel has been decoded + execute_hook("DecodedKernel", (void*)binary, (void*)bootArgs->kaddr, (void*)bootArgs->ksize, NULL); + + setupFakeEfi(); + + // Load boot drivers from the specifed root path. + //if (!gHaveKernelCache) + LoadDrivers("/"); + + execute_hook("DriversLoaded", (void*)binary, NULL, NULL, NULL); + + clearActivityIndicator(); + + if (gErrors) { + printf("Errors encountered while starting up the computer.\n"); + printf("Pausing %d seconds...\n", kBootErrorTimeout); + sleep(kBootErrorTimeout); + } + + md0Ramdisk(); + + verbose("Starting Darwin %s\n",( archCpuType == CPU_TYPE_I386 ) ? "x86" : "x86_64"); + verbose("Boot Args: %s\n", bootArgs->CommandLine); + + // Cleanup the PXE base code. + + if ( (gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit ) { + if ( (ret = nbpUnloadBaseCode()) != nbpStatusSuccess ) + { + printf("nbpUnloadBaseCode error %d\n", (int) ret); + sleep(2); + } + } + + bool dummyVal; + if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->chameleonConfig) && dummyVal) { + showTextBuffer(msgbuf, strlen(msgbuf)); + } + + usb_loop(); + + // If we were in text mode, switch to graphics mode. + // This will draw the boot graphics unless we are in + // verbose mode. + if (gVerboseMode) + setVideoMode( GRAPHICS_MODE, 0 ); + else + drawBootGraphics(); + + setupBooterLog(); + + finalizeBootStruct(); + + // Jump to kernel's entry point. There's no going back now. + if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9"))) + { + + // Notify modules that the kernel is about to be started + execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgs, NULL, NULL); + + // Masking out so that Lion doesn't doublefault + outb(0x21, 0xff); /* Maskout all interrupts Pic1 */ + outb(0xa1, 0xff); /* Maskout all interrupts Pic2 */ + + startprog( kernelEntry, bootArgs ); + } + else { + // Notify modules that the kernel is about to be started + execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgsPreLion, NULL, NULL); + + startprog( kernelEntry, bootArgsPreLion ); + } + + // Not reached + return 0; +} + + +//========================================================================== +// LoadKernelCache - Try to load Kernel Cache. +// return the length of the loaded cache file or -1 on error +long LoadKernelCache(const char* cacheFile, void **binary) { + char kernelCacheFile[512]; + char kernelCachePath[512]; + long flags, time, cachetime, kerneltime, exttime, ret=-1; + unsigned long adler32; + + if((gBootMode & kBootModeSafe) != 0) + { + verbose("Kernel Cache ignored.\n"); + return -1; + } + + // Use specify kernel cache file if not empty + if (cacheFile[0] != 0) + { + strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile)); + } + else + { + // Lion, Mountain Lion and Mavericks prelink kernel cache file + if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9"))) + { + sprintf(kernelCacheFile, "%skernelcache", kDefaultCachePathSnow); + } + // Snow Leopard prelink kernel cache file + else if (checkOSVersion("10.6")) { + sprintf(kernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386) + ? "i386" : "x86_64"); + int lnam = strlen(kernelCacheFile) + 9; //with adler32 + + char* name; + long prev_time = 0; + + struct dirstuff* cacheDir = opendir(kDefaultCachePathSnow); + + while(readdir(cacheDir, (const char**)&name, &flags, &time) >= 0) + { + if (((flags & kFileTypeMask) != kFileTypeDirectory) && time > prev_time + && strstr(name, kernelCacheFile) && (name[lnam] != '.')) + { + sprintf(kernelCacheFile, "%s%s", kDefaultCachePathSnow, name); + prev_time = time; + } + } + } + else { + // Reset cache name. + bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64); + sprintf(gCacheNameAdler + 64, "%s,%s", gRootDevice, bootInfo->bootFile); + adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler)); + sprintf(kernelCacheFile, "%s.%08lX", kDefaultCachePathLeo, adler32); + } + } + + // Check if the kernel cache file exists + ret = -1; + + // If boot from a boot helper partition check the kernel cache file on it + if (gBootVolume->flags & kBVFlagBooter) { + sprintf(kernelCachePath, "com.apple.boot.P%s", kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) + { + sprintf(kernelCachePath, "com.apple.boot.R%s", kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) + { + sprintf(kernelCachePath, "com.apple.boot.S%s", kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((flags & kFileTypeMask) != kFileTypeFlat) + ret = -1; + } + } + } + // If not found, use the original kernel cache path. + if (ret == -1) { + strcpy(kernelCachePath, kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((flags & kFileTypeMask) != kFileTypeFlat) + ret = -1; + } + + // Exit if kernel cache file wasn't found + if (ret == -1) { + verbose("No Kernel Cache File '%s' found\n", kernelCacheFile); + return -1; + } + + // Check if the kernel cache file is more recent (mtime) + // than the kernel file or the S/L/E directory + ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime); + // Check if the kernel file is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat) + && (kerneltime > cachetime)) { + verbose("Kernel file (%s) is more recent than KernelCache (%s), ignoring KernelCache\n", + bootInfo->bootFile, kernelCacheFile); + return -1; + } + + ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime); + // Check if the S/L/E directory time is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) + && (exttime > cachetime)) { + verbose("/System/Library/Extensions is more recent than KernelCache (%s), ignoring KernelCache\n", + kernelCacheFile); + return -1; + } + + // Since the kernel cache file exists and is the most recent try to load it + verbose("Loading kernel cache %s\n", kernelCachePath); + + ret = LoadThinFatFile(kernelCachePath, binary); + return ret; // ret contain the length of the binary +} + +//========================================================================== +// This is the entrypoint from real-mode which functions exactly as it did +// before. Multiboot does its own runtime initialization, does some of its +// own things, and then calls common_boot. +void boot(int biosdev) +{ + initialize_runtime(); + // Enable A20 gate before accessing memory above 1Mb. + enableA20(); + common_boot(biosdev); +} + +//========================================================================== +// The 'main' function for the booter. Called by boot0 when booting +// from a block device, or by the network booter. +// +// arguments: +// biosdev - Value passed from boot1/NBP to specify the device +// that the booter was loaded from. +// +// If biosdev is kBIOSDevNetwork, then this function will return if +// booting was unsuccessful. This allows the PXE firmware to try the +// next boot device on its list. +void common_boot(int biosdev) +{ + bool quiet; + bool firstRun = true; + bool instantMenu; + bool rescanPrompt; + int status; + unsigned int allowBVFlags = kBVFlagSystemVolume | kBVFlagForeignBoot; + unsigned int denyBVFlags = kBVFlagEFISystem; + + // Set reminder to unload the PXE base code. Neglect to unload + // the base code will result in a hang or kernel panic. + gUnloadPXEOnExit = true; + + // Record the device that the booter was loaded from. + gBIOSDev = biosdev & kBIOSDevMask; + + // Initialize boot info structure. + initKernBootStruct(); + + initBooterLog(); + + // Setup VGA text mode. + // Not sure if it is safe to call setVideoMode() before the + // config table has been loaded. Call video_mode() instead. +#if DEBUG + printf("before video_mode\n"); +#endif + video_mode( 2 ); // 80x25 mono text mode. +#if DEBUG + printf("after video_mode\n"); +#endif + + // Scan and record the system's hardware information. + scan_platform(); + + // First get info for boot volume. + scanBootVolumes(gBIOSDev, 0); + bvChain = getBVChainForBIOSDev(gBIOSDev); + setBootGlobals(bvChain); + + // Load boot.plist config file + status = loadChameleonConfig(&bootInfo->chameleonConfig); + + if (getBoolForKey(kQuietBootKey, &quiet, &bootInfo->chameleonConfig) && quiet) { + gBootMode |= kBootModeQuiet; + } + + // Override firstRun to get to the boot menu instantly by setting "Instant Menu"=y in system config + if (getBoolForKey(kInstantMenuKey, &instantMenu, &bootInfo->chameleonConfig) && instantMenu) { + firstRun = false; + } + + // Loading preboot ramdisk if exists. + loadPrebootRAMDisk(); + + // Disable rescan option by default + gEnableCDROMRescan = false; + + // Enable it with Rescan=y in system config + if (getBoolForKey(kRescanKey, &gEnableCDROMRescan, &bootInfo->chameleonConfig) + && gEnableCDROMRescan) { + gEnableCDROMRescan = true; + } + + // Ask the user for Rescan option by setting "Rescan Prompt"=y in system config. + rescanPrompt = false; + if (getBoolForKey(kRescanPromptKey, &rescanPrompt , &bootInfo->chameleonConfig) + && rescanPrompt && biosDevIsCDROM(gBIOSDev)) + { + gEnableCDROMRescan = promptForRescanOption(); + } + + // Enable touching a single BIOS device only if "Scan Single Drive"=y is set in system config. + if (getBoolForKey(kScanSingleDriveKey, &gScanSingleDrive, &bootInfo->chameleonConfig) + && gScanSingleDrive) { + gScanSingleDrive = true; + } + + // Create a list of partitions on device(s). + if (gScanSingleDrive) { + scanBootVolumes(gBIOSDev, &bvCount); + } else { + scanDisks(gBIOSDev, &bvCount); + } + + // Create a separated bvr chain using the specified filters. + bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount); + + gBootVolume = selectBootVolume(bvChain); + + // Intialize module system + init_module_system(); + +#if DEBUG + printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", + gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags); + printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", + gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags); + getchar(); +#endif + + useGUI = true; + // Override useGUI default + getBoolForKey(kGUIKey, &useGUI, &bootInfo->chameleonConfig); + if (useGUI && initGUI()) + { + // initGUI() returned with an error, disabling GUI. + useGUI = false; + } + + setBootGlobals(bvChain); + + // Parse args, load and start kernel. + while (1) + { + bool tryresume, tryresumedefault, forceresume; + bool useKernelCache = true; // by default try to use the prelinked kernel + const char *val; + int len, ret = -1; + long flags, sleeptime, time; + void *binary = (void *)kLoadAddr; + + char bootFile[sizeof(bootInfo->bootFile)]; + char bootFilePath[512]; + char kernelCacheFile[512]; + + // Initialize globals. + sysConfigValid = false; + gErrors = false; + + status = getBootOptions(firstRun); + firstRun = false; + if (status == -1) continue; + + status = processBootOptions(); + // Status == 1 means to chainboot + if ( status == 1 ) break; + // Status == -1 means that the config file couldn't be loaded or that gBootVolume is NULL + if ( status == -1 ) + { + // gBootVolume == NULL usually means the user hit escape. + if (gBootVolume == NULL) + { + freeFilteredBVChain(bvChain); + + if (gEnableCDROMRescan) + rescanBIOSDevice(gBIOSDev); + + bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount); + setBootGlobals(bvChain); + setupDeviceList(&bootInfo->themeConfig); + } + continue; + } + + // Other status (e.g. 0) means that we should proceed with boot. + + // Turn off any GUI elements + if ( bootArgs->Video.v_display == GRAPHICS_MODE ) + { + gui.devicelist.draw = false; + gui.bootprompt.draw = false; + gui.menu.draw = false; + gui.infobox.draw = false; + gui.logo.draw = false; + drawBackground(); + updateVRAM(); + } + + // Find out which version mac os we're booting. + getOSVersion(); + + if (platformCPUFeature(CPU_FEATURE_EM64T)) { + archCpuType = CPU_TYPE_X86_64; + } else { + archCpuType = CPU_TYPE_I386; + } + + if (getValueForKey(karch, &val, &len, &bootInfo->chameleonConfig)) { + if (strncmp(val, "i386", 4) == 0) { + archCpuType = CPU_TYPE_I386; + } + } + + if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig)) { + if (strncmp(val, "i386", 4) == 0) { + archCpuType = CPU_TYPE_I386; + } + } + + // Notify modules that we are attempting to boot + execute_hook("PreBoot", NULL, NULL, NULL, NULL); + + if (!getBoolForKey (kWake, &tryresume, &bootInfo->chameleonConfig)) { + tryresume = true; + tryresumedefault = true; + } else { + tryresumedefault = false; + } + + if (!getBoolForKey (kForceWake, &forceresume, &bootInfo->chameleonConfig)) { + forceresume = false; + } + + if (forceresume) { + tryresume = true; + tryresumedefault = false; + } + + while (tryresume) { + const char *tmp; + BVRef bvr; + if (!getValueForKey(kWakeImage, &val, &len, &bootInfo->chameleonConfig)) + val = "/private/var/vm/sleepimage"; + + // Do this first to be sure that root volume is mounted + ret = GetFileInfo(0, val, &flags, &sleeptime); + + if ((bvr = getBootVolumeRef(val, &tmp)) == NULL) + break; + + // Can't check if it was hibernation Wake=y is required + if (bvr->modTime == 0 && tryresumedefault) + break; + + if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) + break; + + if (!forceresume && ((sleeptime+3)modTime)) { +#if DEBUG + printf ("Hibernate image is too old by %d seconds. Use ForceWake=y to override\n", + bvr->modTime-sleeptime); +#endif + break; + } + + HibernateBoot((char *)val); + break; + } + + verbose("Loading Darwin %s\n", gMacOSVersion); + + getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig); + if (useKernelCache) do { + + // Determine the name of the Kernel Cache + if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) { + if (val[0] == '\\') + { + len--; + val++; + } + strlcpy(kernelCacheFile, val, len + 1); + } else { + kernelCacheFile[0] = 0; // Use default kernel cache file + } + + if (gOverrideKernel && kernelCacheFile[0] == 0) { + verbose("Using a non default kernel (%s) without specifying 'Kernel Cache' path, KernelCache will not be used\n", + bootInfo->bootFile); + useKernelCache = false; + break; + } + if (gMKextName[0] != 0) { + verbose("Using a specific MKext Cache (%s), KernelCache will not be used\n", + gMKextName); + useKernelCache = false; + break; + } + if (gBootFileType != kBlockDeviceType) + useKernelCache = false; + + } while(0); + + do { + if (useKernelCache) { + ret = LoadKernelCache(kernelCacheFile, &binary); + if (ret >= 0) + break; + } + + bool bootFileWithDevice = false; + // Check if bootFile start with a device ex: bt(0,0)/Extra/mach_kernel + if (strncmp(bootInfo->bootFile,"bt(",3) == 0 || + strncmp(bootInfo->bootFile,"hd(",3) == 0 || + strncmp(bootInfo->bootFile,"rd(",3) == 0) + bootFileWithDevice = true; + + // bootFile must start with a / if it not start with a device name + if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/') + sprintf(bootFile, "/%s", bootInfo->bootFile); // append a leading / + else + strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile)); + + // Try to load kernel image from alternate locations on boot helper partitions. + ret = -1; + if ((gBootVolume->flags & kBVFlagBooter) && !bootFileWithDevice) { + sprintf(bootFilePath, "com.apple.boot.P%s", bootFile); + ret = GetFileInfo(NULL, bootFilePath, &flags, &time); + if (ret == -1) + { + sprintf(bootFilePath, "com.apple.boot.R%s", bootFile); + ret = GetFileInfo(NULL, bootFilePath, &flags, &time); + if (ret == -1) + { + sprintf(bootFilePath, "com.apple.boot.S%s", bootFile); + ret = GetFileInfo(NULL, bootFilePath, &flags, &time); + } + } + } + if (ret == -1) { + // No alternate location found, using the original kernel image path. + strlcpy(bootFilePath, bootFile,sizeof(bootFilePath)); + } + + verbose("Loading kernel %s\n", bootFilePath); + ret = LoadThinFatFile(bootFilePath, &binary); + if (ret <= 0 && archCpuType == CPU_TYPE_X86_64) + { + archCpuType = CPU_TYPE_I386; + ret = LoadThinFatFile(bootFilePath, &binary); + } + } while (0); + + clearActivityIndicator(); + +#if DEBUG + printf("Pausing..."); + sleep(8); +#endif + + if (ret <= 0) { + printf("Can't find %s\n", bootFile); + sleep(1); + + if (gBootFileType == kNetworkDeviceType) { + // Return control back to PXE. Don't unload PXE base code. + gUnloadPXEOnExit = false; + break; + } + pause(); + + } else { + /* Won't return if successful. */ + ret = ExecKernel(binary); + } + } + + // chainboot + if (status == 1) { + // if we are already in graphics-mode, + if (getVideoMode() == GRAPHICS_MODE) { + setVideoMode(VGA_TEXT_MODE, 0); // switch back to text mode. + } + } + + if ((gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit) { + nbpUnloadBaseCode(); + } +} + +/*! + Selects a new BIOS device, taking care to update the global state appropriately. + */ +/* +static void selectBiosDevice(void) +{ + struct DiskBVMap *oldMap = diskResetBootVolumes(gBIOSDev); + CacheReset(); + diskFreeMap(oldMap); + oldMap = NULL; + + int dev = selectAlternateBootDevice(gBIOSDev); + + BVRef bvchain = scanBootVolumes(dev, 0); + BVRef bootVol = selectBootVolume(bvchain); + gBootVolume = bootVol; + setRootVolume(bootVol); + gBIOSDev = dev; +} +*/ + +bool checkOSVersion(const char * version) +{ + return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1]) + && (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3])); +} + +static void getOSVersion() +{ + strlcpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion)); +} + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5000 +// NMAX (was 5521) the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 + +#define DO1(buf, i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf, i) DO1(buf, i); DO1(buf, i + 1); +#define DO4(buf, i) DO2(buf, i); DO2(buf, i + 2); +#define DO8(buf, i) DO4(buf, i); DO4(buf, i + 4); +#define DO16(buf) DO8(buf, 0); DO8(buf, 8); + +unsigned long Adler32(unsigned char *buf, long len) +{ + unsigned long s1 = 1; // adler & 0xffff; + unsigned long s2 = 0; // (adler >> 16) & 0xffff; + unsigned long result; + int k; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + result = (s2 << 16) | s1; + return OSSwapHostToBigInt32(result); +} diff --git a/i386/boot2/.svn/text-base/boot.h.svn-base b/i386/boot2/.svn/text-base/boot.h.svn-base new file mode 100644 index 0000000..d5162cd --- /dev/null +++ b/i386/boot2/.svn/text-base/boot.h.svn-base @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1994 NeXT Computer, Inc. + * All rights reserved. + */ + +#ifndef __BOOT2_BOOT_H +#define __BOOT2_BOOT_H + +#include "libsaio.h" +/* + * Paths used by chameleon + */ + +//kernel cache +#define kDefaultCachePathLeo "/System/Library/Caches/com.apple.kernelcaches/" +#define kDefaultCachePathSnow "/System/Library/Caches/com.apple.kext.caches/Startup/" + +// Lion installer +#define kLionInstallerDataFolder "/Mac OS X Install Data/" +#define kLionInstallerPlist kLionInstallerDataFolder "com.apple.Boot.plist" + +/* + * Keys used in system Boot.plist + */ +#define kGraphicsModeKey "Graphics Mode" +#define kTextModeKey "Text Mode" +#define kQuietBootKey "Quiet Boot" +#define kKernelFlagsKey "Kernel Flags" +#define kKernelArchKey "Kernel Architecture" +#define karch "arch" /* boot.c */ +#define kProductVersion "ProductVersion" /* boot.c */ +#define kMKextCacheKey "MKext Cache" +#define kKernelNameKey "Kernel" +#define kKernelCacheKey "Kernel Cache" +#define kUseKernelCache "UseKernelCache" /* boot.c */ +#define kBootDeviceKey "Boot Device" +#define kTimeoutKey "Timeout" +#define kRootDeviceKey "rd" +#define kBootUUIDKey "boot-uuid" +#define kHelperRootUUIDKey "Root UUID" +#define kPlatformKey "platform" +#define kACPIKey "acpi" +#define kCDROMPromptKey "CD-ROM Prompt" +#define kCDROMOptionKey "CD-ROM Option Key" +#define kRescanPromptKey "Rescan Prompt" +#define kRescanKey "Rescan" +#define kScanSingleDriveKey "Scan Single Drive" +#define kInstantMenuKey "Instant Menu" +#define kDefaultKernel "mach_kernel" +#define kGUIKey "GUI" +#define kBootBannerKey "Boot Banner" +#define kShowInfoKey "ShowInfo" // gui.c +#define kWaitForKeypressKey "Wait" + +#define kDSDT "DSDT" /* acpi_patcher.c */ +#define kDropSSDT "DropSSDT" /* acpi_patcher.c */ +#define kRestartFix "RestartFix" /* acpi_patcher.c */ +#define kPS2RestartFix "PS2RestartFix" /* acpi_patcher.c */ +#define kGeneratePStates "GeneratePStates" /* acpi_patcher.c */ +#define kGenerateCStates "GenerateCStates" /* acpi_patcher.c */ +#define kCSTUsingSystemIO "CSTUsingSystemIO" /* acpi_patcher.c */ +#define kEnableC2State "EnableC2State" /* acpi_patcher.c */ +#define kEnableC3State "EnableC3State" /* acpi_patcher.c */ +#define kEnableC4State "EnableC4State" /* acpi_patcher.c */ + +#define kWake "Wake" /* boot.c */ +#define kForceWake "ForceWake" /* boot.c */ +#define kWakeImage "WakeImage" /* boot.c */ + +#define kbusratio "busratio" /* cpu.c */ + +#define kDeviceProperties "device-properties" /* device_inject.c */ + +#define kHidePartition "Hide Partition" /* disk.c */ +#define kRenamePartition "Rename Partition" /* disk.c */ +#define kDefaultPartition "Default Partition" /* sys.c */ + +#define kSMBIOSKey "SMBIOS" /* fake_efi.c */ +#define kSMBIOSdefaults "SMBIOSdefaults" /* smbios_patcher.c */ +#define kSystemID "SystemId" /* fake_efi.c */ +#define kSystemType "SystemType" /* fake_efi.c */ + +#define kUseMemDetect "UseMemDetect" /* platform.c */ + +#define kPCIRootUID "PCIRootUID" /* pci_root.c */ + +#define kUseAtiROM "UseAtiROM" /* ati.c */ +#define kAtiConfig "AtiConfig" /* ati.c */ +#define kAtiPorts "AtiPorts" /* ati.c */ +#define kATYbinimage "ATYbinimage" /* ati.c */ + +#define kUseNvidiaROM "UseNvidiaROM" /* nvidia.c */ +#define kVBIOS "VBIOS" /* nvidia.c */ +#define kDcfg0 "display_0" /* nvidia.c */ +#define kDcfg1 "display_1" /* nvidia.c */ + +#define kEthernetBuiltIn "EthernetBuiltIn" /* pci_setup.c */ +#define kGraphicsEnabler "GraphicsEnabler" /* pci_setup.c */ +#define kEnableHDMIAudio "EnableHDMIAudio" /*ati.c && nvidia.c */ +#define kForceHPET "ForceHPET" /* pci_setup.c */ + +#define kMD0Image "md0" /* ramdisk.h */ + +#define kUSBBusFix "USBBusFix" /* usb.c */ +#define kEHCIacquire "EHCIacquire" /* usb.c */ +#define kUHCIreset "UHCIreset" /* usb.c */ +#define kLegacyOff "USBLegacyOff" /* usb.c */ +#define kEHCIhard "EHCIhard" /* usb.c */ + +/* + * Flags to the booter or kernel + */ +#define kVerboseModeFlag "-v" +#define kSafeModeFlag "-x" +#define kIgnoreCachesFlag "-f" +#define kIgnoreBootFileFlag "-F" +#define kSingleUserModeFlag "-s" + +/* + * Booter behavior control + */ +#define kBootTimeout -1 +#define kCDBootTimeout 8 + +/* + * A global set by boot() to record the device that the booter + * was loaded from. + */ +#define ROOT_DEVICE_SIZE 512 +extern int gBIOSDev; +extern long gBootMode; +extern bool sysConfigValid; +extern char bootBanner[]; +extern char bootPrompt[]; +extern bool gOverrideKernel; +extern char *gPlatformName; +extern char gMKextName[]; +extern char gRootDevice[]; +extern bool gEnableCDROMRescan; +extern bool gScanSingleDrive; +extern bool useGUI; + +/* + * Boot Modes + */ +enum { + kBootModeNormal = 0, + kBootModeSafe = 1, + kBootModeSecure = 2, + kBootModeQuiet = 4 +}; + +extern void initialize_runtime(); +extern void common_boot(int biosdev); + +/* + * usb.c + */ +extern int usb_loop(); + +/* + * graphics.c + */ +extern void printVBEModeInfo(); +extern void setVideoMode(int mode, int drawgraphics); +extern int getVideoMode(); +extern void spinActivityIndicator(); +extern void clearActivityIndicator(); +extern void drawColorRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char colorIndex ); +extern void drawDataRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char * data ); +extern int +convertImage( unsigned short width, + unsigned short height, + const unsigned char *imageData, + unsigned char **newImageData ); +extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes ); +extern void drawBootGraphics(void); +extern void drawPreview(void *src, uint8_t * saveunder); +extern int getVideoMode(void); +extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or); + +/* + * drivers.c + */ +extern long LoadExtraDrivers(char * dirSpec); +extern long LoadDrivers(char * dirSpec); +extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize); + +typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin); +/*! + Hookable function pointer called during the driver loading phase that + allows other code to cause additional drivers to be loaded. + */ +extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p); + +/* + * options.c + */ +extern char gBootUUIDString[]; + +extern int getBootOptions(bool firstRun); +extern int processBootOptions(); +extern int selectAlternateBootDevice(int bootdevice); +extern bool promptForRescanOption(void); + +void showHelp(); +void showTextFile(); +char *getMemoryInfoString(); + +typedef struct { + char name[80]; + void * param; +} MenuItem; + +/* + * lzss.c + */ +extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen); + +struct compressed_kernel_header { + u_int32_t signature; + u_int32_t compress_type; + u_int32_t adler32; + u_int32_t uncompressed_size; + u_int32_t compressed_size; + u_int32_t reserved[11]; + char platform_name[64]; + char root_path[256]; + u_int8_t data[0]; +}; +typedef struct compressed_kernel_header compressed_kernel_header; + +/* resume.c */ +void HibernateBoot(char *boot_device); + +/* bmdecompress.c */ +void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel); + +#endif /* !__BOOT2_BOOT_H */ diff --git a/i386/boot2/.svn/text-base/boot2.s.svn-base b/i386/boot2/.svn/text-base/boot2.s.svn-base new file mode 100644 index 0000000..9f30899 --- /dev/null +++ b/i386/boot2/.svn/text-base/boot2.s.svn-base @@ -0,0 +1,345 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.1 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * boot2() -- second stage boot. + * + * This function must be located at 0:BOOTER_ADDR and will be called + * by boot1 or by NBP. + */ + +#include +#include "memory.h" +#include "mboot.h" + +#define data32 .byte 0x66 +#define retf .byte 0xcb + + .file "boot2.s" + .section __INIT,__text // turbo - This initialization code must reside within the first segment + + //.data + .section __INIT,__data // turbo - Data that must be in the first segment + +EXPORT(_chainbootdev) .byte 0x80 +EXPORT(_chainbootflag) .byte 0x00 + + //.text + .section __INIT,__text // turbo + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Booter entry point. Called by boot1 or by the NBP. +# This routine must be the first in the TEXT segment. +# +# Arguments: +# DX = Boot device +# +# Returns: +# +LABEL(boot2) + pushl %ecx # Save general purpose registers + pushl %ebx + pushl %ebp + pushl %esi + pushl %edi + push %ds # Save DS, ES + push %es + + mov %cs, %ax # Update segment registers. + mov %ax, %ds # Set DS and ES to match CS + mov %ax, %es + + data32 + call __switch_stack # Switch to new stack + + data32 + call __real_to_prot # Enter protected mode. + + fninit # FPU init + + # We are now in 32-bit protected mode. + # Transfer execution to C by calling boot(). + + pushl %edx # bootdev + call _boot + + testb $0xff, _chainbootflag + jnz start_chain_boot # Jump to a foreign booter + + call __prot_to_real # Back to real mode. + + data32 + call __switch_stack # Restore original stack + + pop %es # Restore original ES and DS + pop %ds + popl %edi # Restore all general purpose registers + popl %esi # except EAX. + popl %ebp + popl %ebx + popl %ecx + + retf # Hardcode a far return + +start_chain_boot: + xorl %edx, %edx + movb _chainbootdev, %dl # Setup DL with the BIOS device number + + call __prot_to_real # Back to real mode. + + data32 + call __switch_stack # Restore original stack + + pop %es # Restore original ES and DS + pop %ds + popl %edi # Restore all general purpose registers + popl %esi # except EAX. + popl %ebp + popl %ebx + popl %ecx + + data32 + ljmp $0, $0x7c00 # Jump to boot code already in memory + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Multiboot support added by David F. Elliott on 2007/06/26 +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Multiboot section +# The above is used when booting with the normal booter (boot1h/boot1u). +# The following is used when booting with a multiboot capable loader such as grub +# Unlike the normal booter which starts in real mode, we start in protected mode + +# Unforuntately, GRUB refuses to load a multiboot "kernel" below 1MB. +# This is basically due to the fact that GRUB likes to live below 1MB because +# it starts up in real mode just like we would normally be starting up if +# we weren't being Multiboot loaded by GRUB. +# Therefore, we must tell our loader to load us above 1MB. To make it easy, +# we simply specify exactly 1 MB higher than we want. +# This means of course that when we enter we are not where the assembler +# and linker expect us to be. Please remember this when modifying code. +#define OFFSET_1MEG 0x100000 + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# NOTE: While we would ideally place the header in say __TEXT,__const we +# cannot do that and have GRUB find it because GRUB only searches the first +# 8k of the binary. Since __TEXT,__const follows __TEXT,__text (the code +# section) and since the code is well over 8k long, it doesn't work. +.align 2, 0x90 # Make sure we're on a 4-byte boundary. Required by Multiboot. +_multiboot_header: + # magic (NOTE: this shows up as 02b0 ad1b in a hex dump) + .long MULTIBOOT_HEADER_MAGIC + # flags + .long MULTIBOOT_HEADER_FLAGS + # checksum + .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) + # header_addr + .long (_multiboot_header + OFFSET_1MEG) + # load_addr + .long (boot2 + OFFSET_1MEG) + # load_end_addr # Tell multiboot to load the whole file + .long 0 + # bss_end_addr # boot() will zero its own bss + .long 0 + # entry_addr + .long (_multiboot_entry + OFFSET_1MEG) + +# Stick a couple of nop here so that we hopefully make disassemblers realize we have instructions again + nop + nop + nop +.align 3, 0x90 # Align to 8 byte boundary which should be enough nops + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +_multiboot_entry: + # First thing's first, let's get ourselves a usable GDT. + # Multiboot specifically says that GDT is not to be considered valid + # because for all we know the loader could have erased the memory where + # the GDT was located. Even if it doesn't, it's very likely that we'll + # clobber it when we move ourselves into low memory. + + # We have a GDT at the _Gdt symbol location which is defined in + # i386/libsaio/table.c. Like all GDTs, entry 0 is unusable. The first + # entry (0x08) is the one normally used by the booter. However, it is + # specifically defined as byte-granularity to ensure the booter does not + # execute any code above 1 MB. As mentioned above, we are above 1 MB so + # we can't use the 0x08 selector. Fortunately, the booter specifies the + # 0x28 selector for the kernel init code using the typical 4K granularity + # and making all 32-bits of address space available. + + # To load a GDT with the lgdt instruction we need to have the linear + # address of a GDTR structure. The 16-bit boot code uses the _Gdtr + # variable which we will use later. However, we are still in extended + # memory so even if we added 1 MB to _Gdtr the contents of it would + # still be pointing in low memory. Therefore we have a _Gdtr_high + # which points to _Gdt + OFFSET_1MEG (see bottom of file) + # Notice that _Gdtr_high itself is located 1 MB above where the + # assembler/linker thinks it is. + lgdt _Gdtr_high + OFFSET_1MEG + + # Now that we have a GDT we want to first reload the CS register. We do + # that using a far jump to the desired selector with the desired offset. + # The desired offset in this case is exactly 1 MB higher than the + # assembler/linker thinks it is. As mentioned above, we use the kernel + # init code selector instead of the boot code selector. + jmp $0x28,$(Lpost_gdt_switch+OFFSET_1MEG) +Lpost_gdt_switch: + + # Now that we have the right code selector we also want the rest of the + # selectors to be correct. We use the same selector (0x10) as the + # __real_to_prot function in libsaio/asm.s. This is important as it + # means we won't need to do this again after the next GDT switch. + + # We have to clobber one register because segment registers can only be + # loaded from GP registers. Fortunately, only eax and ebx are provided + # by multiboot so we can clobber anything else. We choose ecx. + + movl $0x10, %ecx + movl %ecx,%ss + movl %ecx,%ds + movl %ecx,%es + movl %ecx,%fs + movl %ecx,%gs + + # Initialize our stack pointer to the one normally used by the booter + # NOTE: This is somewhat dangerous considering it seems to be a de-facto + # Multiboot standard that the area below 1 MB is for the loader (e.g. GRUB) + # We may consider later putting the stack at + 1MB just like the code + # but we'd have to eventually get it below 1 MB because until we do we can't + # run any real-mode code (e.g. BIOS functions). + # Doing it this early we potentially run the risk that our multiboot_info + # pointer in ebx is already stuck somewhere in our stack segment + # Of course, the best method would be to have a couple of choices for + # stack space and put it wherever the multiboot_info is not. + movl $ADDR32(STACK_SEG,STACK_OFS), %esp + + # Some final notes about machine state: + + # We have no IDT and thus we leave interrupts disabled. This is the same + # state that __real_to_prot leaves the machine in so it's not a problem. + + # The A20 gate is enabled (it better be, we're above 1 MB) + # It is enabled as the first thing in boot() but it won't hurt for it + # to be enabled when it already is. + + # Unlike when booting from real mode, when booting from Multiboot we have + # no stack to begin with. This means that __switch_stack must never be + # called because it is preloaded with STACK_SEG,STACK_OFS which is where + # we already are. Were it to be called it would effectively reset to the + # top of the stack which would not be good. + # We might think about adding a couple of instructions here to change + # its default values to something that could be used if necessary. + + # At this point we're good enough to run C code. I am no assembler guru + # so we won't be returning from it. + pushl %ebx + pushl %eax + call _multiboot_to_boot # NOTE: near relative call, so we stay in high mem + # NORETURN + + # NOTE: Once we get in to C, we should never return + # We let the C code take care of doing a chain boot which right now + # means to print an error message and restart the booter + +Lhltloop: + hlt # This causes Parallels to power off although a normal PC will just hang + jmp Lhltloop + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _continue_at_low_address does some trickery to get the caller running from the low address with the right selector + .globl _continue_at_low_address + .align 2, 0x90 +_continue_at_low_address: + # Our stack frame has been set up with the return address on top + # First, fix that to be 1 MB lower + subl $OFFSET_1MEG, (%esp) + # Now load the proper low-memory GDTR from the low-memory location which + # will cause the low-memory GDT to be used. + lgdt _Gdtr + # Now jump to GDT selector 8 using the low address of this function + # This finally puts us in low memory in the right selector (0x08) + jmpl $0x08,$L_continue_at_low_address_next +L_continue_at_low_address_next: + # We don't need to set ss,ds,es,fs, or gs because they are already 0x10 + # and the old GDT had the same information for selector 0x10 as the new + # one does. + # Since we've already fixed our return pointer, simply return + # Note that our caller must fix his return pointer as well and that his + # caller must fix his return pointer and so on and so forth. + ret + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _jump_to_chainbooter sets up dl, switches from protected to real mode, and +# jumps to 0:7C00. Unlike the usual code, the stack is not switched since +# there is no stack to switch to. + .globl _jump_to_chainbooter +_jump_to_chainbooter: + # TODO: Take segment/offset arguments and put them in ES:SI? + + xorl %edx, %edx + movb _chainbootdev, %dl # Setup DL with the BIOS device number + + call __prot_to_real # Back to real mode. + + # TODO: Set SS:SP to something reasonable? For instance, Microsoft MBR + # code starts out by setting up the stack at 0:7c00 for itself and leaves + # that intact. Thus the stack by default will grow down from the code + # entrypoint. On the other hand, our own boot0 sets up the stack at + # 0:fff0 and it seems that most boot code doesn't care and simply sets + # SS:SP itself as one of the first things it does. + + data32 + ljmp $0, $0x7c00 # Jump to boot code already in memory + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _cause_crash jumps to offset 0 of a selector we know is not in our GDT +# This causes Parallels to output all sorts of nice debugging information +# We aren't using it right now so it's in an if 0 block. +#if 0 + .globl _cause_crash + .align 2, 0x90 +_cause_crash: + # Cause a crash, there is no GDT selector f0 + jmp $0xf0,$0 + hlt + jmp _cause_crash +#endif + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _Gdtr_high is a pointer to the extended-memory loaded _Gdt +# See the comments above as to why we have OFFSET_1MEG. + //.data + .section __INIT,__data // turbo + .align 2, 0x90 +_Gdtr_high: + .word GDTLIMIT + .long vtop(_Gdt + OFFSET_1MEG) + diff --git a/i386/boot2/.svn/text-base/drivers.c.svn-base b/i386/boot2/.svn/text-base/drivers.c.svn-base new file mode 100644 index 0000000..531564c --- /dev/null +++ b/i386/boot2/.svn/text-base/drivers.c.svn-base @@ -0,0 +1,850 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * drivers.c - Driver Loading Functions. + * + * Copyright (c) 2000 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include +#include +#include + +#include "sl.h" +#include "boot.h" +#include "bootstruct.h" +#include "xml.h" +#include "ramdisk.h" +#include "modules.h" + +//extern char gMacOSVersion[8]; + +struct Module { + struct Module *nextModule; + long willLoad; + TagPtr dict; + char *plistAddr; + long plistLength; + char *executablePath; + char *bundlePath; + long bundlePathLength; +}; +typedef struct Module Module, *ModulePtr; + +struct DriverInfo { + char *plistAddr; + long plistLength; + void *executableAddr; + long executableLength; + void *bundlePathAddr; + long bundlePathLength; +}; +typedef struct DriverInfo DriverInfo, *DriverInfoPtr; + +#define kDriverPackageSignature1 'MKXT' +#define kDriverPackageSignature2 'MOSX' + +struct DriversPackage { + unsigned long signature1; + unsigned long signature2; + unsigned long length; + unsigned long adler32; + unsigned long version; + unsigned long numDrivers; + unsigned long reserved1; + unsigned long reserved2; +}; +typedef struct DriversPackage DriversPackage; + +enum { + kCFBundleType2, + kCFBundleType3 +}; + +long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p); + +/*static*/ unsigned long Adler32( unsigned char * buffer, long length ); + +long FileLoadDrivers(char *dirSpec, long plugin); +long NetLoadDrivers(char *dirSpec); +long LoadDriverMKext(char *fileSpec); +long LoadDriverPList(char *dirSpec, char *name, long bundleType); +long LoadMatchedModules(void); + +static long MatchPersonalities(void); +static long MatchLibraries(void); +#ifdef NOTDEF +static ModulePtr FindModule(char *name); +static void ThinFatFile(void **loadAddrP, unsigned long *lengthP); +#endif +static long ParseXML(char *buffer, ModulePtr *module, TagPtr *personalities); +static long InitDriverSupport(void); + +ModulePtr gModuleHead, gModuleTail; +static TagPtr gPersonalityHead, gPersonalityTail; +static char * gExtensionsSpec; +static char * gDriverSpec; +static char * gFileSpec; +static char * gTempSpec; +static char * gFileName; + +/*static*/ unsigned long +Adler32( unsigned char * buffer, long length ) +{ + long cnt; + unsigned long result, lowHalf, highHalf; + + lowHalf = 1; + highHalf = 0; + + for ( cnt = 0; cnt < length; cnt++ ) + { + if ((cnt % 5000) == 0) + { + lowHalf %= 65521L; + highHalf %= 65521L; + } + + lowHalf += buffer[cnt]; + highHalf += lowHalf; + } + + lowHalf %= 65521L; + highHalf %= 65521L; + + result = (highHalf << 16) | lowHalf; + + return result; +} + + +//========================================================================== +// InitDriverSupport + +static long +InitDriverSupport( void ) +{ + gExtensionsSpec = malloc( 4096 ); + gDriverSpec = malloc( 4096 ); + gFileSpec = malloc( 4096 ); + gTempSpec = malloc( 4096 ); + gFileName = malloc( 4096 ); + + if ( !gExtensionsSpec || !gDriverSpec || !gFileSpec || !gTempSpec || !gFileName ) + stop("InitDriverSupport error"); + + return 0; +} + +//========================================================================== +// LoadDrivers + +long LoadDrivers( char * dirSpec ) +{ + char dirSpecExtra[1024]; + + if ( InitDriverSupport() != 0 ) + return 0; + + // Load extra drivers if a hook has been installed. + if (LoadExtraDrivers_p != NULL) + { + (*LoadExtraDrivers_p)(&FileLoadDrivers); + } + + if ( gBootFileType == kNetworkDeviceType ) + { + if (NetLoadDrivers(dirSpec) != 0) { + error("Could not load drivers from the network\n"); + return -1; + } + } + else if ( gBootFileType == kBlockDeviceType ) + { + // First try to load Extra extensions from the ramdisk if isn't aliased as bt(0,0). + if (gRAMDiskVolume && !gRAMDiskBTAliased) + { + strcpy(dirSpecExtra, "rd(0,0)/Extra/"); + FileLoadDrivers(dirSpecExtra, 0); + } + + // Next try to load Extra extensions from the selected root partition. + strcpy(dirSpecExtra, "/Extra/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + // If failed, then try to load Extra extensions from the boot partition + // in case we have a separate booter partition or a bt(0,0) aliased ramdisk. + if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no) + || (gRAMDiskVolume && gRAMDiskBTAliased) ) + { + // Next try a specfic OS version folder ie 10.5 + sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + // Next we'll try the base + strcpy(dirSpecExtra, "bt(0,0)/Extra/"); + FileLoadDrivers(dirSpecExtra, 0); + } + } + } + if(!gHaveKernelCache) + { + // Don't load main driver (from /System/Library/Extentions) if gHaveKernelCache is set. + // since these drivers will already be in the kernel cache. + // NOTE: when gHaveKernelCache, xnu cannot (by default) load *any* extra kexts from the bootloader. + // The /Extra code is not disabled in this case due to a kernel patch that allows for this to happen. + + // Also try to load Extensions from boot helper partitions. + if (gBootVolume->flags & kBVFlagBooter) + { + strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/"); + FileLoadDrivers(dirSpecExtra, 0); + } + } + } + + if (gMKextName[0] != '\0') + { + verbose("LoadDrivers: Loading from [%s]\n", gMKextName); + if ( LoadDriverMKext(gMKextName) != 0 ) + { + error("Could not load %s\n", gMKextName); + return -1; + } + } + else + { + strcpy(gExtensionsSpec, dirSpec); + strcat(gExtensionsSpec, "System/Library/"); + FileLoadDrivers(gExtensionsSpec, 0); + } + + } + } + else + { + return 0; + } + + MatchPersonalities(); + + MatchLibraries(); + + LoadMatchedModules(); + + return 0; +} + +//========================================================================== +// FileLoadMKext + +static long +FileLoadMKext( const char * dirSpec, const char * extDirSpec ) +{ + long ret, flags, time, time2; + char altDirSpec[512]; + + sprintf (altDirSpec, "%s%s", dirSpec, extDirSpec); + ret = GetFileInfo(altDirSpec, "Extensions.mkext", &flags, &time); + + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat)) + { + ret = GetFileInfo(dirSpec, "Extensions", &flags, &time2); + + if ((ret != 0) + || ((flags & kFileTypeMask) != kFileTypeDirectory) + || (((gBootMode & kBootModeSafe) == 0) && (time == (time2 + 1)))) + { + sprintf(gDriverSpec, "%sExtensions.mkext", altDirSpec); + verbose("LoadDrivers: Loading from [%s]\n", gDriverSpec); + + if (LoadDriverMKext(gDriverSpec) == 0) + return 0; + } + } + return -1; +} + +//========================================================================== +// FileLoadDrivers + +long +FileLoadDrivers( char * dirSpec, long plugin ) +{ + long ret, length, flags, time, bundleType; + long long index; + long result = -1; + const char * name; + + if ( !plugin ) + { + // First try 10.6's path for loading Extensions.mkext. + if (FileLoadMKext(dirSpec, "Caches/com.apple.kext.caches/Startup/") == 0) + return 0; + + // Next try the legacy path. + else if (FileLoadMKext(dirSpec, "") == 0) + return 0; + + strcat(dirSpec, "Extensions"); + } + + index = 0; + while (1) { + ret = GetDirEntry(dirSpec, &index, &name, &flags, &time); + if (ret == -1) break; + + // Make sure this is a directory. + if ((flags & kFileTypeMask) != kFileTypeDirectory) continue; + + // Make sure this is a kext. + length = strlen(name); + if (strcmp(name + length - 5, ".kext")) continue; + + // Save the file name. + strcpy(gFileName, name); + + // Determine the bundle type. + sprintf(gTempSpec, "%s/%s", dirSpec, gFileName); + ret = GetFileInfo(gTempSpec, "Contents", &flags, &time); + if (ret == 0) bundleType = kCFBundleType2; + else bundleType = kCFBundleType3; + + if (!plugin) + sprintf(gDriverSpec, "%s/%s/%sPlugIns", dirSpec, gFileName, + (bundleType == kCFBundleType2) ? "Contents/" : ""); + + ret = LoadDriverPList(dirSpec, gFileName, bundleType); + + if (result != 0) + result = ret; + + if (!plugin) + FileLoadDrivers(gDriverSpec, 1); + } + + return result; +} + + +//========================================================================== +// + +long +NetLoadDrivers( char * dirSpec ) +{ + long tries; + +#if NODEF + long cnt; + + // Get the name of the kernel + cnt = strlen(gBootFile); + while (cnt--) { + if ((gBootFile[cnt] == '\\') || (gBootFile[cnt] == ',')) { + cnt++; + break; + } + } +#endif + + // INTEL modification + sprintf(gDriverSpec, "%s%s.mkext", dirSpec, bootInfo->bootFile); + + verbose("NetLoadDrivers: Loading from [%s]\n", gDriverSpec); + + tries = 3; + while (tries--) + { + if (LoadDriverMKext(gDriverSpec) == 0) break; + } + if (tries == -1) return -1; + + return 0; +} + +//========================================================================== +// loadDriverMKext + +long +LoadDriverMKext( char * fileSpec ) +{ + unsigned long driversAddr, driversLength; + long length; + char segName[32]; + DriversPackage * package; + +#define GetPackageElement(e) OSSwapBigToHostInt32(package->e) + + // Load the MKext. + length = LoadThinFatFile(fileSpec, (void **)&package); + if (length < sizeof (DriversPackage)) return -1; + + // call hook to notify modules that the mkext has been loaded + execute_hook("LoadDriverMKext", (void*)fileSpec, (void*)package, (void*) &length, NULL); + + + // Verify the MKext. + if (( GetPackageElement(signature1) != kDriverPackageSignature1) || + ( GetPackageElement(signature2) != kDriverPackageSignature2) || + ( GetPackageElement(length) > kLoadSize ) || + ( GetPackageElement(adler32) != + Adler32((unsigned char *)&package->version, GetPackageElement(length) - 0x10) ) ) + { + return -1; + } + + // Make space for the MKext. + driversLength = GetPackageElement(length); + driversAddr = AllocateKernelMemory(driversLength); + + // Copy the MKext. + memcpy((void *)driversAddr, (void *)package, driversLength); + + // Add the MKext to the memory map. + sprintf(segName, "DriversPackage-%lx", driversAddr); + AllocateMemoryRange(segName, driversAddr, driversLength, + kBootDriverTypeMKEXT); + + return 0; +} + +//========================================================================== +// LoadDriverPList + +long +LoadDriverPList( char * dirSpec, char * name, long bundleType ) +{ + long length, executablePathLength, bundlePathLength; + ModulePtr module; + TagPtr personalities; + char * buffer = 0; + char * tmpExecutablePath = 0; + char * tmpBundlePath = 0; + long ret = -1; + + do { + // Save the driver path. + + if(name) sprintf(gFileSpec, "%s/%s/%s", dirSpec, name, + (bundleType == kCFBundleType2) ? "Contents/MacOS/" : ""); + else sprintf(gFileSpec, "%s/%s", dirSpec, + (bundleType == kCFBundleType2) ? "Contents/MacOS/" : ""); + executablePathLength = strlen(gFileSpec) + 1; + + tmpExecutablePath = malloc(executablePathLength); + if (tmpExecutablePath == 0) break; + strcpy(tmpExecutablePath, gFileSpec); + + if(name) sprintf(gFileSpec, "%s/%s", dirSpec, name); + else sprintf(gFileSpec, "%s", dirSpec); + bundlePathLength = strlen(gFileSpec) + 1; + + tmpBundlePath = malloc(bundlePathLength); + if (tmpBundlePath == 0) break; + + strcpy(tmpBundlePath, gFileSpec); + + // Construct the file spec to the plist, then load it. + + if(name) sprintf(gFileSpec, "%s/%s/%sInfo.plist", dirSpec, name, + (bundleType == kCFBundleType2) ? "Contents/" : ""); + else sprintf(gFileSpec, "%s/%sInfo.plist", dirSpec, + (bundleType == kCFBundleType2) ? "Contents/" : ""); + + length = LoadFile(gFileSpec); + if (length == -1) break; + length = length + 1; + buffer = malloc(length); + if (buffer == 0) break; + strlcpy(buffer, (char *)kLoadAddr, length); + + // Parse the plist. + + ret = ParseXML(buffer, &module, &personalities); + if (ret != 0) { break; } + // Allocate memory for the driver path and the plist. + + module->executablePath = tmpExecutablePath; + module->bundlePath = tmpBundlePath; + module->bundlePathLength = bundlePathLength; + module->plistAddr = malloc(length); + + if ((module->executablePath == 0) || (module->bundlePath == 0) || (module->plistAddr == 0)) + break; + // Save the driver path in the module. + //strcpy(module->driverPath, tmpDriverPath); + tmpExecutablePath = 0; + tmpBundlePath = 0; + + // Add the plist to the module. + + strlcpy(module->plistAddr, (char *)kLoadAddr, length); + module->plistLength = length; + + // Add the module to the end of the module list. + + if (gModuleHead == 0) + gModuleHead = module; + else + gModuleTail->nextModule = module; + gModuleTail = module; + + // Add the persionalities to the personality list. + + if (personalities) personalities = personalities->tag; + while (personalities != 0) + { + if (gPersonalityHead == 0) + gPersonalityHead = personalities->tag; + else + gPersonalityTail->tagNext = personalities->tag; + + gPersonalityTail = personalities->tag; + personalities = personalities->tagNext; + } + + ret = 0; + } + while (0); + + if ( buffer ) free( buffer ); + if ( tmpExecutablePath ) free( tmpExecutablePath ); + if ( tmpBundlePath ) free( tmpBundlePath ); + + return ret; +} + + +//========================================================================== +// LoadMatchedModules + +long +LoadMatchedModules( void ) +{ + TagPtr prop; + ModulePtr module; + char *fileName, segName[32]; + DriverInfoPtr driver; + long length, driverAddr, driverLength; + void *executableAddr = 0; + + + module = gModuleHead; + + while (module != 0) + { + if (module->willLoad) + { + prop = XMLGetProperty(module->dict, kPropCFBundleExecutable); + + if (prop != 0) + { + fileName = prop->string; + sprintf(gFileSpec, "%s%s", module->executablePath, fileName); + length = LoadThinFatFile(gFileSpec, &executableAddr); + if (length == 0) + { + length = LoadFile(gFileSpec); + executableAddr = (void *)kLoadAddr; + } +// printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar(); + } + else + length = 0; + + if (length != -1) + { +// driverModuleAddr = (void *)kLoadAddr; +// if (length != 0) +// { +// ThinFatFile(&driverModuleAddr, &length); +// } + + // Make make in the image area. + + execute_hook("LoadMatchedModules", module, &length, executableAddr, NULL); + + driverLength = sizeof(DriverInfo) + module->plistLength + length + module->bundlePathLength; + driverAddr = AllocateKernelMemory(driverLength); + + // Set up the DriverInfo. + driver = (DriverInfoPtr)driverAddr; + driver->plistAddr = (char *)(driverAddr + sizeof(DriverInfo)); + driver->plistLength = module->plistLength; + if (length != 0) + { + driver->executableAddr = (void *)(driverAddr + sizeof(DriverInfo) + + module->plistLength); + driver->executableLength = length; + } + else + { + driver->executableAddr = 0; + driver->executableLength = 0; + } + driver->bundlePathAddr = (void *)(driverAddr + sizeof(DriverInfo) + + module->plistLength + driver->executableLength); + driver->bundlePathLength = module->bundlePathLength; + + // Save the plist, module and bundle. + strcpy(driver->plistAddr, module->plistAddr); + if (length != 0) + { + memcpy(driver->executableAddr, executableAddr, length); + } + strcpy(driver->bundlePathAddr, module->bundlePath); + + // Add an entry to the memory map. + sprintf(segName, "Driver-%lx", (unsigned long)driver); + AllocateMemoryRange(segName, driverAddr, driverLength, + kBootDriverTypeKEXT); + } + } + module = module->nextModule; + } + + return 0; +} + +//========================================================================== +// MatchPersonalities + +static long +MatchPersonalities( void ) +{ + /* IONameMatch support not implemented */ + return 0; +} + +//========================================================================== +// MatchLibraries + +static long +MatchLibraries( void ) +{ + TagPtr prop, prop2; + ModulePtr module, module2; + long done; + + do { + done = 1; + module = gModuleHead; + + while (module != 0) + { + if (module->willLoad == 1) + { + prop = XMLGetProperty(module->dict, kPropOSBundleLibraries); + if (prop != 0) + { + prop = prop->tag; + while (prop != 0) + { + module2 = gModuleHead; + while (module2 != 0) + { + prop2 = XMLGetProperty(module2->dict, kPropCFBundleIdentifier); + if ((prop2 != 0) && (!strcmp(prop->string, prop2->string))) + { + if (module2->willLoad == 0) module2->willLoad = 1; + break; + } + module2 = module2->nextModule; + } + prop = prop->tagNext; + } + } + module->willLoad = 2; + done = 0; + } + module = module->nextModule; + } + } + while (!done); + + return 0; +} + + +//========================================================================== +// FindModule + +#if NOTDEF +static ModulePtr +FindModule( char * name ) +{ + ModulePtr module; + TagPtr prop; + + module = gModuleHead; + + while (module != 0) + { + prop = GetProperty(module->dict, kPropCFBundleIdentifier); + if ((prop != 0) && !strcmp(name, prop->string)) break; + module = module->nextModule; + } + + return module; +} +#endif /* NOTDEF */ + +//========================================================================== +// ParseXML + +static long +ParseXML( char * buffer, ModulePtr * module, TagPtr * personalities ) +{ + long length, pos; + TagPtr moduleDict, required; + ModulePtr tmpModule; + + pos = 0; + + while (1) + { + length = XMLParseNextTag(buffer + pos, &moduleDict); + if (length == -1) break; + + pos += length; + + if (moduleDict == 0) continue; + if (moduleDict->type == kTagTypeDict) break; + + XMLFreeTag(moduleDict); + } + + if (length == -1) return -1; + + required = XMLGetProperty(moduleDict, kPropOSBundleRequired); + if ( (required != NULL) && (required->type == kTagTypeString) && !strcmp(required->string, "Safe Boot")) + { + XMLFreeTag(moduleDict); + return -2; + } + + tmpModule = malloc(sizeof(Module)); + if (tmpModule == 0) + { + XMLFreeTag(moduleDict); + return -1; + } + tmpModule->dict = moduleDict; + + // For now, load any module that has OSBundleRequired != "Safe Boot". + + tmpModule->willLoad = 1; + + *module = tmpModule; + + // Get the personalities. + + *personalities = XMLGetProperty(moduleDict, kPropIOKitPersonalities); + + return 0; +} + +#if NOTDEF +static char gPlatformName[64]; +#endif + +long +DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize) +{ + long ret; + compressed_kernel_header * kernel_header = (compressed_kernel_header *) binary; + u_int32_t uncompressed_size, size; + void *buffer; + unsigned long len; + +#if 0 + printf("kernel header:\n"); + printf("signature: 0x%x\n", kernel_header->signature); + printf("compress_type: 0x%x\n", kernel_header->compress_type); + printf("adler32: 0x%x\n", kernel_header->adler32); + printf("uncompressed_size: 0x%x\n", kernel_header->uncompressed_size); + printf("compressed_size: 0x%x\n", kernel_header->compressed_size); + getchar(); +#endif + + if (kernel_header->signature == OSSwapBigToHostConstInt32('comp')) + { + if (kernel_header->compress_type != OSSwapBigToHostConstInt32('lzss')) + { + error("kernel compression is bad\n"); + return -1; + } +#if NOTDEF + if (kernel_header->platform_name[0] && strcmp(gPlatformName, kernel_header->platform_name)) + return -1; + if (kernel_header->root_path[0] && strcmp(gBootFile, kernel_header->root_path)) + return -1; +#endif + uncompressed_size = OSSwapBigToHostInt32(kernel_header->uncompressed_size); + binary = buffer = malloc(uncompressed_size); + + size = decompress_lzss((u_int8_t *) binary, &kernel_header->data[0], + OSSwapBigToHostInt32(kernel_header->compressed_size)); + if (uncompressed_size != size) { + error("size mismatch from lzss: %x\n", size); + return -1; + } + + if (OSSwapBigToHostInt32(kernel_header->adler32) != + Adler32(binary, uncompressed_size)) + { + printf("adler mismatch\n"); + return -1; + } + } + + ret = ThinFatFile(&binary, &len); + if (ret == 0 && len == 0 && archCpuType==CPU_TYPE_X86_64) + { + archCpuType=CPU_TYPE_I386; + ret = ThinFatFile(&binary, &len); + } + + // Notify modules that the kernel has been decompressed, thinned and is about to be decoded + execute_hook("DecodeKernel", (void*)binary, NULL, NULL, NULL); + + + ret = DecodeMachO(binary, rentry, raddr, rsize); + if (ret<0 && archCpuType==CPU_TYPE_X86_64) + { + archCpuType=CPU_TYPE_I386; + ret = DecodeMachO(binary, rentry, raddr, rsize); + } + + return ret; +} diff --git a/i386/boot2/.svn/text-base/graphic_utils.c.svn-base b/i386/boot2/.svn/text-base/graphic_utils.c.svn-base new file mode 100644 index 0000000..9ad9ac1 --- /dev/null +++ b/i386/boot2/.svn/text-base/graphic_utils.c.svn-base @@ -0,0 +1,81 @@ + + /* Graphic utility functions and data types + * Prashant Vaibhav (C) 12/12/2008 + * Chameleon + */ +#include "boot.h" +#include "graphic_utils.h" +#include "gui.h" + +void blend( const pixmap_t *blendThis, // Source image + pixmap_t *blendInto, // Dest image + const position_t position) // Where to place the source image +{ + uint16_t sx, sy, dx, dy; + uint32_t dstrb, dstag, srcrb, srcag, drb, dag, rb, ag, alpha; + + uint16_t width = (blendThis->width + position.x < blendInto->width) ? blendThis->width: blendInto->width-position.x; + uint16_t height = (blendThis->height + position.y < blendInto->height) ? blendThis->height: blendInto->height-position.y; + + for (dy = position.y, sy = 0; sy < height; dy++, sy++) { + for (dx = position.x, sx = 0; sx < width; dx++, sx++) { + alpha = (pixel(blendThis, sx, sy).ch.a); + + /* Skip blending for fully transparent pixel */ + if (alpha == 0) continue; + + /* For fully opaque pixel, there is no need to interpolate */ + if (alpha == 255) { + pixel(blendInto, dx, dy).value = pixel(blendThis, sx, sy).value; + continue; + } + + /* For semi-transparent pixels, do a full blend */ + //alpha++ + /* This is needed to spread the alpha over [0..256] instead of [0..255] + Boundary conditions were handled above */ + dstrb = pixel(blendInto, dx, dy).value & 0xFF00FF; + dstag = (pixel(blendInto, dx, dy).value >> 8) & 0xFF00FF; + srcrb = pixel(blendThis, sx, sy).value & 0xFF00FF; + srcag = (pixel(blendThis, sx, sy).value >> 8) & 0xFF00FF; + drb = srcrb - dstrb; + dag = srcag - dstag; + drb *= alpha; dag *= alpha; + drb >>= 8; dag >>= 8; + rb = (drb + dstrb) & 0x00FF00FF; + ag = ((dag + dstag) << 8) & 0xFF00FF00; + pixel(blendInto, dx, dy).value = (rb | ag); + } + } +} + +position_t centeredIn( const pixmap_t *background, const pixmap_t *toCenter ) +{ + position_t centered; + centered.x = ( background->width - toCenter->width ) / 2; + centered.y = ( background->height - toCenter->height ) / 2; + return centered; +} + +position_t centeredAt( const pixmap_t *pixmap, const position_t center ) +{ + position_t topleft; + topleft.x = center.x - (pixmap->width / 2); + topleft.y = center.y - (pixmap->height / 2); + return topleft; +} + +position_t pos(const uint16_t x, const uint16_t y) { position_t p; p.x = x; p.y = y; return p; } + +void flipRB(pixmap_t *p) +{ + //if(testForQemu()) return; + + uint32_t x; + register uint8_t tempB; + for (x = 0; x < (p->height) * (p->width) ; x++) { + tempB = (p->pixels[x]).ch.b; + (p->pixels[x]).ch.b = (p->pixels[x]).ch.r; + (p->pixels[x]).ch.r = tempB; + } +} diff --git a/i386/boot2/.svn/text-base/graphic_utils.h.svn-base b/i386/boot2/.svn/text-base/graphic_utils.h.svn-base new file mode 100644 index 0000000..53905a4 --- /dev/null +++ b/i386/boot2/.svn/text-base/graphic_utils.h.svn-base @@ -0,0 +1,61 @@ + /* Graphic utility functions and data types + * Prashant Vaibhav (C) 12/12/2008 + * Chameleon + */ + +// Everything here is 32 bits per pixel non-premultiplied ARGB format +// + +#ifndef GRAPHIC_UTILS_H +#define GRAPHIC_UTILS_H + +#include "boot.h" + + +typedef union { + struct { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; + } ch; + uint8_t channel[4]; + uint32_t value; +} pixel_t; + +typedef struct { + uint16_t height; + uint16_t width; + pixel_t* pixels; +} pixmap_t; + +typedef struct { + uint32_t x; + uint32_t y; +} position_t; + +// Blends the given pixmap into the given background at the given position +// Uses the alpha channels to blend, and preserves the final alpha (so the +// resultant pixmap can be blended again with another background). +// ported from www.stereopsis.com/doubleblend.html +void blend( const pixmap_t *blendThis, // Source image + pixmap_t *blendInto, // Dest image + const position_t position); // Where to place the source image +// Returns the topleft co-ordinate where if you put the 'toCenter' pixmap, +// it is centered in the background. +position_t centeredIn( const pixmap_t *background, const pixmap_t *toCenter ); + +// Returns the topleft co-ordinate where if you put the given pixmap, its +// center will coincide with the th given center. +position_t centeredAt( const pixmap_t *pixmap, const position_t center ); + +// Utility function returns a position_t struct given the x and y coords as uint16 +position_t pos(const uint16_t x, const uint16_t y); + +// Flips the R and B components of all pixels in the given pixmap +void flipRB(pixmap_t *p); + +// Utility function to get pixel at (x,y) in a pixmap +#define pixel(p,x,y) ((p)->pixels[(x) + (y) * (p)->width]) + +#endif//GRAPHIC_UTILS_H diff --git a/i386/boot2/.svn/text-base/graphics.c.svn-base b/i386/boot2/.svn/text-base/graphics.c.svn-base new file mode 100644 index 0000000..d9473b4 --- /dev/null +++ b/i386/boot2/.svn/text-base/graphics.c.svn-base @@ -0,0 +1,1248 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "boot.h" +#include "vbe.h" +#include "appleClut8.h" +#include "gui.h" +#include "IOHibernatePrivate.h" + +/* + * for spinning disk + */ +static int currentIndicator = 0; + +int previewTotalSectors = 0; +int previewLoadedSectors = 0; +uint8_t *previewSaveunder = 0; + +#define VIDEO(x) (bootArgs->Video.v_ ## x) + +//========================================================================== +// getVBEVideoRam + +uint32_t getVBEVideoRam() +{ + VBEInfoBlock vbeInfo; + int err, small; + char *buff = malloc(sizeof(char)*256); + if(!buff) return 0; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if (err != errSuccess) + return 0; + + if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) ) + return 0; + + small = (vbeInfo.TotalMemory < 16); + + return vbeInfo.TotalMemory * 64 * 1024; +} + +//========================================================================== +// getVBEInfoString + +char *getVBEInfoString() +{ + VBEInfoBlock vbeInfo; + int err, small; + char *buff = malloc(sizeof(char)*256); + if(!buff) return 0; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if (err != errSuccess) + return 0; + + if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) ) + return 0; + + small = (vbeInfo.TotalMemory < 16); + + sprintf(buff, "VESA v%d.%d %d%s (%s)\n", + vbeInfo.VESAVersion >> 8, + vbeInfo.VESAVersion & 0xf, + small ? (vbeInfo.TotalMemory * 64) : (vbeInfo.TotalMemory / 16), + small ? "KB" : "MB", + VBEDecodeFP(const char *, vbeInfo.OEMStringPtr) ); + + return buff; +} + +//========================================================================== +// + +void +printVBEModeInfo() +{ + VBEInfoBlock vbeInfo; + unsigned short * modePtr; + VBEModeInfoBlock modeInfo; + int err; + int line; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if ( err != errSuccess ) + return; + + line = 0; + + // Activate and clear page 1 + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition( 0, 0, 1 ); + + printf( getVBEInfoString() ); + printf("Video modes supported:\n", VBEDecodeFP(const char *, vbeInfo.OEMStringPtr)); + + // Loop through the mode list, and find the matching mode. + + for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); + *modePtr != modeEndOfList; modePtr++ ) + { + // Get mode information. + + bzero( &modeInfo, sizeof(modeInfo) ); + err = getVBEModeInfo( *modePtr, &modeInfo ); + if ( err != errSuccess ) + { + continue; + } + + printf("Mode %x: %dx%dx%d mm:%d attr:%x\n", + *modePtr, modeInfo.XResolution, modeInfo.YResolution, + modeInfo.BitsPerPixel, modeInfo.MemoryModel, + modeInfo.ModeAttributes); + + if (line++ >= 20) { + pause(); + line = 0; + clearScreenRows(0, 24); + setCursorPosition( 0, 0, 1 ); + } + } + if (line != 0) { + pause(); + } + setActiveDisplayPage(0); +} + +char *getVBEModeInfoString() +{ + VBEInfoBlock vbeInfo; + unsigned short * modePtr; + VBEModeInfoBlock modeInfo; + int err; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if ( err != errSuccess ) + return 0; + + char *buff=malloc(sizeof(char)*3072); + if(!buff) return 0; + + // Loop through the mode list, and find the matching mode. + for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); + *modePtr != modeEndOfList; modePtr++ ) + { + // Get mode information. + + bzero( &modeInfo, sizeof(modeInfo) ); + err = getVBEModeInfo( *modePtr, &modeInfo ); + if ( err != errSuccess ) + { + continue; + } + + sprintf(buff+strlen(buff), "Mode %x: %dx%dx%d mm:%d attr:%x\n", + *modePtr, modeInfo.XResolution, modeInfo.YResolution, + modeInfo.BitsPerPixel, modeInfo.MemoryModel, + modeInfo.ModeAttributes); + + } + return buff; +} + +//========================================================================== +// getVESAModeWithProperties +// +// Return the VESA mode that matches the properties specified. +// If a mode is not found, then return the "best" available mode. + +static unsigned short +getVESAModeWithProperties( unsigned short width, + unsigned short height, + unsigned char bitsPerPixel, + unsigned short attributesSet, + unsigned short attributesClear, + VBEModeInfoBlock * outModeInfo, + unsigned short * vesaVersion ) +{ + VBEInfoBlock vbeInfo; + unsigned short * modePtr; + VBEModeInfoBlock modeInfo; + unsigned char modeBitsPerPixel; + unsigned short matchedMode = modeEndOfList; + int err; + + // Clear output mode info. + + bzero( outModeInfo, sizeof(*outModeInfo) ); + + // Get VBE controller info containing the list of supported modes. + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if ( err != errSuccess ) + { + return modeEndOfList; + } + + // Report the VESA major/minor version number. + + if (vesaVersion) *vesaVersion = vbeInfo.VESAVersion; + + // Loop through the mode list, and find the matching mode. + + for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); + *modePtr != modeEndOfList; modePtr++ ) + { + // Get mode information. + + bzero( &modeInfo, sizeof(modeInfo) ); + err = getVBEModeInfo( *modePtr, &modeInfo ); + if ( err != errSuccess ) + { + continue; + } + +#if DEBUG + printf("Mode %x: %dx%dx%d mm:%d attr:%x\n", + *modePtr, modeInfo.XResolution, modeInfo.YResolution, + modeInfo.BitsPerPixel, modeInfo.MemoryModel, + modeInfo.ModeAttributes); +#endif + + // Filter out unwanted modes based on mode attributes. + + if ( ( ( modeInfo.ModeAttributes & attributesSet ) != attributesSet ) + || ( ( modeInfo.ModeAttributes & attributesClear ) != 0 ) ) + { + continue; + } + + // Pixel depth in bits. + + modeBitsPerPixel = modeInfo.BitsPerPixel; + + if ( ( modeBitsPerPixel == 4 ) && ( modeInfo.MemoryModel == 0 ) ) + { + // Text mode, 16 colors. + } + else if ( ( modeBitsPerPixel == 8 ) && ( modeInfo.MemoryModel == 4 ) ) + { + // Packed pixel, 256 colors. + } + else if ( ( ( modeBitsPerPixel == 16 ) || ( modeBitsPerPixel == 15 ) ) + && ( modeInfo.MemoryModel == 6 ) + && ( modeInfo.RedMaskSize == 5 ) + && ( modeInfo.GreenMaskSize == 5 ) + && ( modeInfo.BlueMaskSize == 5 ) ) + { + // Direct color, 16 bpp (1:5:5:5). + modeInfo.BitsPerPixel = modeBitsPerPixel = 16; + } + else if ( ( modeBitsPerPixel == 32 ) + && ( modeInfo.MemoryModel == 6 ) + && ( modeInfo.RedMaskSize == 8 ) + && ( modeInfo.GreenMaskSize == 8 ) + && ( modeInfo.BlueMaskSize == 8 ) ) + { + // Direct color, 32 bpp (8:8:8:8). + } + else + { + continue; // Not a supported mode. + } + + // Modes larger than the specified dimensions are skipped. + + if ( ( modeInfo.XResolution > width ) || + ( modeInfo.YResolution > height ) ) + { + continue; + } + + // Perfect match, we're done looking. + + if ( ( modeInfo.XResolution == width ) && + ( modeInfo.YResolution == height ) && + ( modeBitsPerPixel == bitsPerPixel ) ) + { + matchedMode = *modePtr; + bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) ); + break; + } + + // Save the next "best" mode in case a perfect match is not found. + + if ( modeInfo.XResolution == outModeInfo->XResolution && + modeInfo.YResolution == outModeInfo->YResolution && + modeBitsPerPixel <= outModeInfo->BitsPerPixel ) + { + continue; // Saved mode has more depth. + } + if ( modeInfo.XResolution < outModeInfo->XResolution || + modeInfo.YResolution < outModeInfo->YResolution || + modeBitsPerPixel < outModeInfo->BitsPerPixel ) + { + continue; // Saved mode has more resolution. + } + + matchedMode = *modePtr; + bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) ); + } + + return matchedMode; +} + +//========================================================================== +// setupPalette + +static void setupPalette( VBEPalette * p, const unsigned char * g ) +{ + int i; + unsigned char * source = (unsigned char *) g; + + for (i = 0; i < 256; i++) + { + (*p)[i] = 0; + (*p)[i] |= ((unsigned long)((*source++) >> 2)) << 16; // Red + (*p)[i] |= ((unsigned long)((*source++) >> 2)) << 8; // Green + (*p)[i] |= ((unsigned long)((*source++) >> 2)); // Blue + } +} + +//========================================================================== +// Simple decompressor for boot images encoded in RLE format. + +char * decodeRLE( const void * rleData, int rleBlocks, int outBytes ) +{ + char *out, *cp; + + struct RLEBlock { + unsigned char count; + unsigned char value; + } * bp = (struct RLEBlock *) rleData; + + out = cp = malloc( outBytes ); + if ( out == NULL ) return NULL; + + while ( rleBlocks-- ) + { + memset( cp, bp->value, bp->count ); + cp += bp->count; + bp++; + } + + return out; +} + +//========================================================================== +// setVESAGraphicsMode + +static int +setVESAGraphicsMode( unsigned short width, + unsigned short height, + unsigned char bitsPerPixel, + unsigned short refreshRate ) +{ + VBEModeInfoBlock minfo; + unsigned short mode; + unsigned short vesaVersion; + int err = errFuncNotSupported; + + do { + mode = getVESAModeWithProperties( width, height, bitsPerPixel, + maColorModeBit | + maModeIsSupportedBit | + maGraphicsModeBit | + maLinearFrameBufferAvailBit, + 0, + &minfo, &vesaVersion ); + if ( mode == modeEndOfList ) + { + break; + } + +// +// FIXME : generateCRTCTiming() causes crash. +// + +// if ( (vesaVersion >> 8) >= 3 && refreshRate >= 60 && +// (gBootMode & kBootModeSafe) == 0 ) +// { +// VBECRTCInfoBlock timing; +// +// // Generate CRTC timing for given refresh rate. +// +// generateCRTCTiming( minfo.XResolution, minfo.YResolution, +// refreshRate, kCRTCParamRefreshRate, +// &timing ); +// +// // Find the actual pixel clock supported by the hardware. +// +// getVBEPixelClock( mode, &timing.PixelClock ); +// +// // Re-compute CRTC timing based on actual pixel clock. +// +// generateCRTCTiming( minfo.XResolution, minfo.YResolution, +// timing.PixelClock, kCRTCParamPixelClock, +// &timing ); +// +// // Set the video mode and use specified CRTC timing. +// +// err = setVBEMode( mode | kLinearFrameBufferBit | +// kCustomRefreshRateBit, &timing ); +// } +// else +// { +// // Set the mode with default refresh rate. +// +// err = setVBEMode( mode | kLinearFrameBufferBit, NULL ); +// } + + // Set the mode with default refresh rate. + + err = setVBEMode( mode | kLinearFrameBufferBit, NULL ); + + if ( err != errSuccess ) + { + break; + } + + // Set 8-bit color palette. + + if ( minfo.BitsPerPixel == 8 ) + { + VBEPalette palette; + setupPalette( &palette, appleClut8 ); + if ((err = setVBEPalette(palette)) != errSuccess) + { + break; + } + } + + // Is this required for buggy Video BIOS implementations? + // On which adapter? + + if ( minfo.BytesPerScanline == 0 ) + minfo.BytesPerScanline = ( minfo.XResolution * + minfo.BitsPerPixel ) >> 3; + + // Update KernBootStruct using info provided by the selected + // VESA mode. + + bootArgs->Video.v_display = GRAPHICS_MODE; + bootArgs->Video.v_width = minfo.XResolution; + bootArgs->Video.v_height = minfo.YResolution; + bootArgs->Video.v_depth = minfo.BitsPerPixel; + bootArgs->Video.v_rowBytes = minfo.BytesPerScanline; + bootArgs->Video.v_baseAddr = VBEMakeUInt32(minfo.PhysBasePtr); + + } + while ( 0 ); + + return err; +} + +int +convertImage( unsigned short width, + unsigned short height, + const unsigned char *imageData, + unsigned char **newImageData ) +{ + int cnt; + unsigned char *img = 0; + unsigned short *img16; + unsigned long *img32; + + switch ( VIDEO(depth) ) { + case 16 : + img16 = malloc(width * height * 2); + if ( !img16 ) break; + for (cnt = 0; cnt < (width * height); cnt++) + img16[cnt] = lookUpCLUTIndex(imageData[cnt], 16); + img = (unsigned char *)img16; + break; + + case 32 : + img32 = malloc(width * height * 4); + if ( !img32 ) break; + for (cnt = 0; cnt < (width * height); cnt++) + img32[cnt] = lookUpCLUTIndex(imageData[cnt], 32); + img = (unsigned char *)img32; + break; + + default : + img = malloc(width * height); + bcopy(imageData, img, width * height); + break; + } + *newImageData = img; + return 0; +} + +int loadPngImage(const char *filename, uint16_t *width, uint16_t *height, + uint8_t **imageData) +{ + uint8_t *pngData = NULL; + int pngFile = 0, pngSize; + PNG_info_t *info; + int error = 0; + + pngFile = open_bvdev("bt(0,0)", filename, 0); + if (pngFile == -1) { + error = -1; + goto failed; + } + pngSize = file_size(pngFile); + if (!pngSize) { + error = -1; + goto failed; + } + pngData = malloc(pngSize); + if (read(pngFile, (char *) pngData, pngSize) != pngSize) { + error = -1; + goto failed; + } + + PNG_error = -1; + info = PNG_decode(pngData, pngSize); + if (PNG_error != 0) { + error = PNG_error; + goto failed; + } else if ((info->width > 0xffff) || (info->height > 0xffff)) { + error = -1; + goto failed; + } else if ((info->width * info->height * 4) != info->image->size) { + error = -1; + goto failed; + } + uint8_t *result = malloc(info->width*4*info->height); + *width = info->width; + *height = info->height; + memcpy(result, info->image->data, info->width*4*info->height); + *imageData = result; + +failed: + png_alloc_free_all(); + if (pngData) + free(pngData); + if (pngFile != -1) + close(pngFile); + + return error; +} + +int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData) { + PNG_info_t *info; + int error = 0; + + PNG_error = -1; + info = PNG_decode(pngData, pngSize); + if (PNG_error != 0) { + error = PNG_error; + goto failed; + } else if ((info->width > 0xffff) || (info->height > 0xffff)) { + error = -1; + goto failed; + } else if ((info->width * info->height * 4) != info->image->size) { + error = -1; + goto failed; + } + uint8_t *result = malloc(info->width*4*info->height); + *width = info->width; + *height = info->height; + memcpy(result, info->image->data, info->width*4*info->height); + *imageData = result; + +failed: + png_alloc_free_all(); + + return error; +} + +void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, + uint8_t *data) +{ + uint16_t drawWidth; + uint8_t *vram = (uint8_t *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + 4 * x; + + drawWidth = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); + while (height--) { + switch (VIDEO (depth)) + { + case 32: /* Optimized version*/ + { + uint32_t s; uint32_t* d; // Source (img) and destination (bkgd) pixels + uint32_t a; // Alpha + uint32_t dstrb, dstg, srcrb, srcg, drb, dg, rb, g, tempB; // Intermediate variables + uint16_t pos; + + for (pos = 0; pos < drawWidth * 4; pos += 4) { + // Fast pseudo-vector alpha blending, adapted from: http://www.stereopsis.com/doubleblend.html + s = *((uint32_t*) (data + pos)); + d = (uint32_t*) (vram + pos); + + // Flip B and R in source + // TODO: use XCHG and inline assembly to do this in a faster, saner way + tempB = (s & 0xFF0000); // save B + s = (s & 0xFF00FFFF) | ((s & 0xFF) << 16); // put R in B + s = (s & 0xFFFFFF00) | (tempB >> 16); // put B in R + + a = (s >> 24) + 1; + + dstrb = *d & 0xFF00FF; dstg = *d & 0xFF00; + srcrb = s & 0xFF00FF; srcg = s & 0xFF00; + + drb = srcrb - dstrb; + dg = srcg - dstg; + drb *= a; dg *= a; + drb >>= 8; dg >>= 8; + + rb = (drb + dstrb) & 0xFF00FF; + g = (dg + dstg) & 0xFF00; + + *d = rb | g; + } + } + break; + + default: /*Universal version*/ + { + uint32_t s; + uint32_t a; // Alpha + uint32_t dr, dg, db, sr, sg, sb; // Intermediate variables + uint16_t pos; + int bpp = (VIDEO (depth) + 7)/8; + + for (pos = 0; pos < drawWidth; pos ++) { + // Fast pseudo-vector alpha blending, adapted from: http://www.stereopsis.com/doubleblend.html + s = *((uint32_t*) (data + 4*pos)); + + sb = (s & 0xFF0000) >> 16; + sg = (s & 0xFF00) >> 8; + sr = (s & 0xFF); + + a = (s >> 24) + 1; + + switch (VIDEO (depth)) + { + case 24: + db = ((*(uint32_t *)(vram + bpp*pos))&0xff); + dg = ((*(uint32_t *)(vram + bpp*pos))&0xff00)>>8; + dr = ((*(uint32_t *)(vram + bpp*pos))&0xff0000)>>16; + break; + case 16://16-bit seems to be 15-bit +/* db = ((*(uint16_t *)(vram + bpp*pos))&0x1f)<<3; + dg = ((*(uint16_t *)(vram + bpp*pos))&0x07e0)>>3; + dr = ((*(uint16_t *)(vram + bpp*pos))&0xf800)>>8; + break; */ + case 15: + db = ((*(uint16_t *)(vram + bpp*pos))&0x1f)<<3; + dg = ((*(uint16_t *)(vram + bpp*pos))&0x03e0)>>2; + dr = ((*(uint16_t *)(vram + bpp*pos))&0x7c00)>>7; + break; + default: + return; + } + + dr = (((sr - dr) * a) >> 8) + dr; + dg = (((sg - dg) * a) >> 8) + dg; + db = (((sb - db) * a) >> 8) + db; + switch (VIDEO (depth)) + { + case 24: + *(uint32_t *)(vram + bpp*pos) = (*(uint32_t *)(vram + bpp*pos) &0xff000000) + | (db&0xff) | ((dg&0xff)<<8) | ((dr&0xff)<<16); + break; + case 16: +// *(uint16_t *)(vram + bpp*pos) = ((db&0xf8)>>3) | ((dg&0xfc)<<3) | ((dr&0xf8)<<8); +// break; + case 15: + *(uint16_t *)(vram + bpp*pos) = ((db&0xf8)>>3) | ((dg&0xf8)<<2) | ((dr&0xf8)<<7); + break; + } + + } + } + break; + } + vram += VIDEO(rowBytes); + data += width * 4; + } +} + +void drawCheckerBoard() +{ + uint32_t *vram = (uint32_t *) VIDEO(baseAddr); + uint16_t x, y; + uint8_t color; + + for (y = 0; y < VIDEO(height); y++, vram += VIDEO(width)) { + for (x = 0; x < VIDEO(width); x++) { + color = 204 + 51 * (((x / 8) % 2) == ((y / 8) % 2)); + vram[x] = (color << 16) | (color << 8) | color; + } + } +} + +//========================================================================== +// LookUpCLUTIndex + +unsigned long lookUpCLUTIndex( unsigned char index, + unsigned char depth ) +{ + long result, red, green, blue; + + red = appleClut8[index * 3 + 0]; + green = appleClut8[index * 3 + 1]; + blue = appleClut8[index * 3 + 2]; + + switch (depth) { + case 16 : + result = ((red & 0xF8) << 7) | + ((green & 0xF8) << 2) | + ((blue & 0xF8) >> 3); + result |= (result << 16); + break; + + case 32 : + result = (red << 16) | (green << 8) | blue; + break; + + default : + result = index | (index << 8); + result |= (result << 16); + break; + } + + return result; +} + +//========================================================================== +// drawColorRectangle + +void * stosl(void * dst, long val, long len) +{ + asm volatile ( "rep; stosl" + : "=c" (len), "=D" (dst) + : "0" (len), "1" (dst), "a" (val) + : "memory" ); + + return dst; +} + +void drawColorRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char colorIndex ) +{ + long pixelBytes; + long color = lookUpCLUTIndex( colorIndex, VIDEO(depth) ); + char * vram; + + pixelBytes = VIDEO(depth) / 8; + vram = (char *) VIDEO(baseAddr) + + VIDEO(rowBytes) * y + pixelBytes * x; + + width = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); + + while ( height-- ) + { + int rem = ( pixelBytes * width ) % 4; + if ( rem ) bcopy( &color, vram, rem ); + stosl( vram + rem, color, pixelBytes * width / 4 ); + vram += VIDEO(rowBytes); + } +} + +//========================================================================== +// drawDataRectangle + +void drawDataRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char * data ) +{ + unsigned short drawWidth; + long pixelBytes = VIDEO(depth) / 8; + unsigned char * vram = (unsigned char *) VIDEO(baseAddr) + + VIDEO(rowBytes) * y + pixelBytes * x; + + drawWidth = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); + while ( height-- ) { + bcopy( data, vram, drawWidth * pixelBytes ); + vram += VIDEO(rowBytes); + data += width * pixelBytes; + } +} + +void +loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or) +{ + int x,y, off; + int red=0x7f, green=0x7f, blue=0x7f; + for (x=0;x>7)&0xf8; + green=(val>>2)&0xf8; + blue=(val<<3)&0xf8; + break; + } + case 32: + { + uint32_t val; + val=((uint32_t *)input)[off]; + red=(val>>16)&0xff; + green=(val>>8)&0xff; + blue=(val)&0xff; + break; + } + } + char *ptr=(char *)output+x*(op/8)+y*or; + switch (op) + { + case 16: + *((uint16_t *)ptr) = ((red & 0xF8) << 7) | + ((green & 0xF8) << 2) | + ((blue & 0xF8) >> 3); + break; + case 32 : + *((uint32_t *)ptr) = (red << 16) | (green << 8) | blue; + break; + } + } +} + +DECLARE_IOHIBERNATEPROGRESSALPHA + +void drawPreview(void *src, uint8_t * saveunder) +{ + uint8_t * screen; + uint32_t rowBytes, pixelShift; + uint32_t x, y; + int32_t blob; + uint32_t alpha, in, color, result; + uint8_t * out; + void *uncomp; + int origwidth, origheight, origbpx; + uint32_t saveindex[kIOHibernateProgressCount] = { 0 }; + + if (src && (uncomp=DecompressData(src, &origwidth, &origheight, &origbpx))) + { + if (!setVESAGraphicsMode(origwidth, origheight, origbpx, 0)) + if (initGraphicsMode () != errSuccess) + return; + screen = (uint8_t *) VIDEO (baseAddr); + rowBytes = VIDEO (rowBytes); + loadImageScale (uncomp, origwidth, origheight, origbpx, screen, VIDEO(width), VIDEO(height), VIDEO(depth), VIDEO (rowBytes)); + } + else + { + if (initGraphicsMode () != errSuccess) + return; + screen = (uint8_t *) VIDEO (baseAddr); + rowBytes = VIDEO (rowBytes); + // Set the screen to 75% grey. + drawColorRectangle(0, 0, VIDEO(width), VIDEO(height), 0x01 /* color index */); + } + + + pixelShift = VIDEO (depth) >> 4; + if (pixelShift < 1) return; + + screen += ((VIDEO (width) + - kIOHibernateProgressCount * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << (pixelShift - 1)) + + (VIDEO (height) - kIOHibernateProgressOriginY - kIOHibernateProgressHeight) * rowBytes; + + for (y = 0; y < kIOHibernateProgressHeight; y++) + { + out = screen + y * rowBytes; + for (blob = 0; blob < kIOHibernateProgressCount; blob++) + { + color = blob ? kIOHibernateProgressDarkGray : kIOHibernateProgressMidGray; + for (x = 0; x < kIOHibernateProgressWidth; x++) + { + alpha = gIOHibernateProgressAlpha[y][x]; + result = color; + if (alpha) + { + if (0xff != alpha) + { + if (1 == pixelShift) + { + in = *((uint16_t *)out) & 0x1f; // 16 + in = (in << 3) | (in >> 2); + } + else + in = *((uint32_t *)out) & 0xff; // 32 + saveunder[blob * kIOHibernateProgressSaveUnderSize + saveindex[blob]++] = in; + result = ((255 - alpha) * in + alpha * result + 0xff) >> 8; + } + if (1 == pixelShift) + { + result >>= 3; + *((uint16_t *)out) = (result << 10) | (result << 5) | result; // 16 + } + else + *((uint32_t *)out) = (result << 16) | (result << 8) | result; // 32 + } + out += (1 << pixelShift); + } + out += (kIOHibernateProgressSpacing << pixelShift); + } + } +} + +void updateProgressBar(uint8_t * saveunder, int32_t firstBlob, int32_t select) +{ + uint8_t * screen; + uint32_t rowBytes, pixelShift; + uint32_t x, y; + int32_t blob, lastBlob; + uint32_t alpha, in, color, result; + uint8_t * out; + uint32_t saveindex[kIOHibernateProgressCount] = { 0 }; + + pixelShift = VIDEO(depth) >> 4; + if (pixelShift < 1) return; + screen = (uint8_t *) VIDEO (baseAddr); + rowBytes = VIDEO (rowBytes); + + screen += ((VIDEO (width) + - kIOHibernateProgressCount * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << (pixelShift - 1)) + + (VIDEO (height) - kIOHibernateProgressOriginY - kIOHibernateProgressHeight) * rowBytes; + + lastBlob = (select < kIOHibernateProgressCount) ? select : (kIOHibernateProgressCount - 1); + + screen += (firstBlob * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << pixelShift; + + for (y = 0; y < kIOHibernateProgressHeight; y++) + { + out = screen + y * rowBytes; + for (blob = firstBlob; blob <= lastBlob; blob++) + { + color = (blob < select) ? kIOHibernateProgressLightGray : kIOHibernateProgressMidGray; + for (x = 0; x < kIOHibernateProgressWidth; x++) + { + alpha = gIOHibernateProgressAlpha[y][x]; + result = color; + if (alpha) + { + if (0xff != alpha) + { + in = saveunder[blob * kIOHibernateProgressSaveUnderSize + saveindex[blob]++]; + result = ((255 - alpha) * in + alpha * result + 0xff) / 255; + } + if (1 == pixelShift) + { + result >>= 3; + *((uint16_t *)out) = (result << 10) | (result << 5) | result; // 16 + } + else + *((uint32_t *)out) = (result << 16) | (result << 8) | result; // 32 + } + out += (1 << pixelShift); + } + out += (kIOHibernateProgressSpacing << pixelShift); + } + } +} + + +//========================================================================== +// setVESATextMode + +static int +setVESATextMode( unsigned short cols, + unsigned short rows, + unsigned char bitsPerPixel ) +{ + VBEModeInfoBlock minfo; + unsigned short mode = modeEndOfList; + + if ( (cols != 80) || (rows != 25) ) // not 80x25 mode + { + mode = getVESAModeWithProperties( cols, rows, bitsPerPixel, + maColorModeBit | + maModeIsSupportedBit, + maGraphicsModeBit, + &minfo, NULL ); + } + + if ( ( mode == modeEndOfList ) || ( setVBEMode(mode, NULL) != errSuccess ) ) + { + video_mode( 2 ); // VGA BIOS, 80x25 text mode. + minfo.XResolution = 80; + minfo.YResolution = 25; + } + + // Update KernBootStruct using info provided by the selected + // VESA mode. + + bootArgs->Video.v_display = VGA_TEXT_MODE; + bootArgs->Video.v_baseAddr = 0xb8000; + bootArgs->Video.v_width = minfo.XResolution; + bootArgs->Video.v_height = minfo.YResolution; + bootArgs->Video.v_depth = 8; + bootArgs->Video.v_rowBytes = 0x8000; + + return errSuccess; // always return success +} + +//========================================================================== +// getNumberArrayFromProperty + +static int +getNumberArrayFromProperty( const char * propKey, + unsigned long numbers[], + unsigned long maxArrayCount ) +{ + char * propStr; + unsigned long count = 0; + + propStr = newStringForKey( (char *) propKey , &bootInfo->chameleonConfig ); + if ( propStr ) + { + char * delimiter = propStr; + char * p = propStr; + + while ( count < maxArrayCount && *p != '\0' ) + { + unsigned long val = strtoul( p, &delimiter, 10 ); + if ( p != delimiter ) + { + numbers[count++] = val; + p = delimiter; + } + while ( ( *p != '\0' ) && !isdigit(*p) ) + p++; + } + + free( propStr ); + } + + return count; +} + +int initGraphicsMode () +{ + unsigned long params[4]; + int count; + + params[3] = 0; + count = getNumberArrayFromProperty( kGraphicsModeKey, params, 4 ); + + // Try to find a resolution if "Graphics Mode" setting is not available. + if ( count < 3 ) + { + // Use the default resolution if we don't have an initialized GUI. + if (gui.screen.width == 0 || gui.screen.height == 0) + { + gui.screen.width = DEFAULT_SCREEN_WIDTH; + gui.screen.height = DEFAULT_SCREEN_HEIGHT; + } + + params[0] = gui.screen.width; + params[1] = gui.screen.height; + params[2] = 32; + } + + // Map from pixel format to bits per pixel. + + if ( params[2] == 256 ) params[2] = 8; + if ( params[2] == 555 ) params[2] = 16; + if ( params[2] == 888 ) params[2] = 32; + + return setVESAGraphicsMode( params[0], params[1], params[2], params[3] ); +} + +//========================================================================== +// setVideoMode +// +// Set the video mode to VGA_TEXT_MODE or GRAPHICS_MODE. + +void +setVideoMode( int mode, int drawgraphics) +{ + unsigned long params[4]; + int count; + int err = errSuccess; + + if ( mode == GRAPHICS_MODE ) + { + if ( (err=initGraphicsMode ()) == errSuccess ) { + if (gVerboseMode) { + // Tell the kernel to use text mode on a linear frame buffer display + bootArgs->Video.v_display = FB_TEXT_MODE; + } else { + bootArgs->Video.v_display = GRAPHICS_MODE; + } + } + } + + if ( (mode == VGA_TEXT_MODE) || (err != errSuccess) ) + { + count = getNumberArrayFromProperty( kTextModeKey, params, 2 ); + if ( count < 2 ) + { + params[0] = 80; // Default text mode is 80x25. + params[1] = 25; + } + + setVESATextMode( params[0], params[1], 4 ); + bootArgs->Video.v_display = VGA_TEXT_MODE; + } + + currentIndicator = 0; +} + +void getGraphicModeParams(unsigned long params[]) { + + params[3] = 0; + + VBEModeInfoBlock minfo; + + unsigned short vesaVersion; + unsigned short mode = modeEndOfList; + + getNumberArrayFromProperty( kGraphicsModeKey, params, 4); + + mode = getVESAModeWithProperties( params[0], params[1], params[2], + maColorModeBit | + maModeIsSupportedBit | + maGraphicsModeBit | + maLinearFrameBufferAvailBit, + 0, + &minfo, &vesaVersion ); + + params[0] = minfo.XResolution; + params[1] = minfo.YResolution; + params[2] = 32; +} + +//========================================================================== +// Return the current video mode, VGA_TEXT_MODE or GRAPHICS_MODE. + +int getVideoMode(void) +{ + return bootArgs->Video.v_display; +} + +//========================================================================== +// Display and clear the activity indicator. + +static char indicator[] = {'-', '\\', '|', '/', '-', '\\', '|', '/', '\0'}; + +// To prevent a ridiculously fast-spinning indicator, +// ensure a minimum of 1/9 sec between animation frames. +#define MIN_TICKS 2 + +void +spinActivityIndicator(int sectors) +{ + static unsigned long lastTickTime = 0, currentTickTime; + + if (previewTotalSectors && previewSaveunder) + { + int blob, lastBlob; + + lastBlob = (previewLoadedSectors * kIOHibernateProgressCount) / previewTotalSectors; + previewLoadedSectors+=sectors; + blob = (previewLoadedSectors * kIOHibernateProgressCount) / previewTotalSectors; + + if (blob!=lastBlob) + updateProgressBar (previewSaveunder, lastBlob, blob); + return; + } + + currentTickTime = time18(); // late binding + if (currentTickTime < lastTickTime + MIN_TICKS) + { + return; + } + else + { + lastTickTime = currentTickTime; + } + + if (getVideoMode() == VGA_TEXT_MODE) + { + if (currentIndicator >= sizeof(indicator)) + { + currentIndicator = 0; + } + putchar(indicator[currentIndicator++]); + putchar('\b'); + } +} + +void +clearActivityIndicator( void ) +{ + if ( getVideoMode() == VGA_TEXT_MODE ) + { + putchar(' '); + putchar('\b'); + } +} + diff --git a/i386/boot2/.svn/text-base/graphics.h.svn-base b/i386/boot2/.svn/text-base/graphics.h.svn-base new file mode 100644 index 0000000..132bd95 --- /dev/null +++ b/i386/boot2/.svn/text-base/graphics.h.svn-base @@ -0,0 +1,45 @@ +/* + * graphics.h + * + * + * Created by fassl on 22.12.08. + * Copyright 2008 __MyCompanyName__. All rights reserved. + * + */ + +#include "boot.h" +#include "bootstruct.h" +#include "graphic_utils.h" + + +#ifndef __BOOT_GRAPHICS_H +#define __BOOT_GRAPHICS_H + +#define DEFAULT_SCREEN_WIDTH 1024 +#define DEFAULT_SCREEN_HEIGHT 768 + +int loadPngImage(const char *filename, uint16_t *width, uint16_t *height, uint8_t **imageData); + +unsigned long lookUpCLUTIndex( unsigned char index, unsigned char depth ); + +void drawColorRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char colorIndex ); +void drawDataRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char * data ); +int convertImage( unsigned short width, unsigned short height, const unsigned char *imageData, unsigned char **newImageData ); + +int initGraphicsMode (); + +void drawCheckerBoard(); + +void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *data); + +void drawCheckerBoard(); +void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *data); + +int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData); + +uint32_t getVBEVideoRam(); +char *getVBEInfoString(); +char *getVBEModeInfoString(); +void getGraphicModeParams(unsigned long params[]); + +#endif /* !__BOOT_GRAPHICS_H */ diff --git a/i386/boot2/.svn/text-base/gui.c.svn-base b/i386/boot2/.svn/text-base/gui.c.svn-base new file mode 100644 index 0000000..54cc8ed --- /dev/null +++ b/i386/boot2/.svn/text-base/gui.c.svn-base @@ -0,0 +1,2119 @@ +/* + * gui.c + * + * + * Created by Jasmin Fazlic on 18.12.08. + * Copyright 2008/09 Jasmin Fazlic All rights reserved. + * Copyright 2008/09 iNDi All rights reserved. + * + */ + +#include "gui.h" +#include "term.h" +#include "appleboot.h" +#include "vers.h" + +#define IMG_REQUIRED -1 +#define THEME_NAME_DEFAULT "Default" +static const char *theme_name = THEME_NAME_DEFAULT; + +#ifdef CONFIG_EMBED_THEME +#include "art.h" +#endif + +#define LOADPNG(img, alt_img) if (loadThemeImage(#img, alt_img) != 0) { return 1; } + +#define VIDEO(x) (bootArgs->Video.v_ ## x) + +#define vram VIDEO(baseAddr) + +#define TAB_PIXELS_WIDTH (font->chars[0]->width * 4) // tab = 4 spaces + +int lasttime = 0; // we need this for animating maybe + + +/* + * ATTENTION: the enum and the following array images[] MUST match !!! + */ +enum { + iBackground = 0, + iLogo, + + iDeviceGeneric, + iDeviceGeneric_o, + iDeviceHFS, + iDeviceHFS_o, + iDeviceHFS_mav, + iDeviceHFS_mav_o, + iDeviceHFS_ML, + iDeviceHFS_ML_o, + iDeviceHFS_Lion, + iDeviceHFS_Lion_o, + iDeviceHFS_SL, + iDeviceHFS_SL_o, + iDeviceHFS_Leo, + iDeviceHFS_Leo_o, + iDeviceHFS_Tiger, + iDeviceHFS_Tiger_o, + iDeviceHFSRAID, + iDeviceHFSRAID_o, + iDeviceHFSRAID_mav, + iDeviceHFSRAID_mav_o, + iDeviceHFSRAID_ML, + iDeviceHFSRAID_ML_o, + iDeviceHFSRAID_Lion, + iDeviceHFSRAID_Lion_o, + iDeviceHFSRAID_SL, + iDeviceHFSRAID_SL_o, + iDeviceHFSRAID_Leo, + iDeviceHFSRAID_Leo_o, + iDeviceHFSRAID_Tiger, + iDeviceHFSRAID_Tiger_o, + iDeviceEXT3, + iDeviceEXT3_o, + iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceFreeBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceOpenBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceOpenBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceBEFS, /* Haiku detection and Icon credits to scorpius */ + iDeviceBEFS_o, /* Haiku detection and Icon credits to scorpius */ + iDeviceFAT, + iDeviceFAT_o, + iDeviceFAT16, + iDeviceFAT16_o, + iDeviceFAT32, + iDeviceFAT32_o, + iDeviceNTFS, + iDeviceNTFS_o, + iDeviceCDROM, + iDeviceCDROM_o, + + iSelection, + iDeviceScrollPrev, + iDeviceScrollNext, + + iMenuBoot, + iMenuVerbose, + iMenuIgnoreCaches, + iMenuSingleUser, + iMenuMemoryInfo, + iMenuVideoInfo, + iMenuHelp, + iMenuVerboseDisabled, + iMenuIgnoreCachesDisabled, + iMenuSingleUserDisabled, + iMenuSelection, + + iProgressBar, + iProgressBarBackground, + + iTextScrollPrev, + iTextScrollNext, + + iFontConsole, + iFontSmall, +}; + +image_t images[] = { + {.name = "background", .image = NULL}, + {.name = "logo", .image = NULL}, + + {.name = "device_generic", .image = NULL}, + {.name = "device_generic_o", .image = NULL}, + {.name = "device_hfsplus", .image = NULL}, + {.name = "device_hfsplus_o", .image = NULL}, + {.name = "device_hfsplus_mav", .image = NULL}, + {.name = "device_hfsplus_mav_o", .image = NULL}, + {.name = "device_hfsplus_ml", .image = NULL}, + {.name = "device_hfsplus_ml_o", .image = NULL}, + {.name = "device_hfsplus_lion", .image = NULL}, + {.name = "device_hfsplus_lion_o", .image = NULL}, + {.name = "device_hfsplus_sl", .image = NULL}, + {.name = "device_hfsplus_sl_o", .image = NULL}, + {.name = "device_hfsplus_leo", .image = NULL}, + {.name = "device_hfsplus_leo_o", .image = NULL}, + {.name = "device_hfsplus_tiger", .image = NULL}, + {.name = "device_hfsplus_tiger_o", .image = NULL}, + + {.name = "device_hfsraid", .image = NULL}, + {.name = "device_hfsraid_o", .image = NULL}, + {.name = "device_hfsraid_mav", .image = NULL}, + {.name = "device_hfsraid_mav_o", .image = NULL}, + {.name = "device_hfsraid_ml", .image = NULL}, + {.name = "device_hfsraid_ml_o", .image = NULL}, + {.name = "device_hfsraid_lion", .image = NULL}, + {.name = "device_hfsraid_lion_o", .image = NULL}, + {.name = "device_hfsraid_sl", .image = NULL}, + {.name = "device_hfsraid_sl_o", .image = NULL}, + {.name = "device_hfsraid_leo", .image = NULL}, + {.name = "device_hfsraid_leo_o", .image = NULL}, + {.name = "device_hfsraid_tiger", .image = NULL}, + {.name = "device_hfsraid_tiger_o", .image = NULL}, + {.name = "device_ext3", .image = NULL}, + {.name = "device_ext3_o", .image = NULL}, + {.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_freebsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_openbsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_openbsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_befs", .image = NULL}, /* Haiku detection and Icon credits to scorpius */ + {.name = "device_befs_o", .image = NULL}, /* Haiku detection and Icon credits to scorpius */ + {.name = "device_fat", .image = NULL}, + {.name = "device_fat_o", .image = NULL}, + {.name = "device_fat16", .image = NULL}, + {.name = "device_fat16_o", .image = NULL}, + {.name = "device_fat32", .image = NULL}, + {.name = "device_fat32_o", .image = NULL}, + {.name = "device_ntfs", .image = NULL}, + {.name = "device_ntfs_o", .image = NULL}, + {.name = "device_cdrom", .image = NULL}, + {.name = "device_cdrom_o", .image = NULL}, + + {.name = "device_selection", .image = NULL}, + {.name = "device_scroll_prev", .image = NULL}, + {.name = "device_scroll_next", .image = NULL}, + + {.name = "menu_boot", .image = NULL}, + {.name = "menu_verbose", .image = NULL}, + {.name = "menu_ignore_caches", .image = NULL}, + {.name = "menu_single_user", .image = NULL}, + {.name = "menu_memory_info", .image = NULL}, + {.name = "menu_video_info", .image = NULL}, + {.name = "menu_help", .image = NULL}, + {.name = "menu_verbose_disabled", .image = NULL}, + {.name = "menu_ignore_caches_disabled", .image = NULL}, + {.name = "menu_single_user_disabled", .image = NULL}, + {.name = "menu_selection", .image = NULL}, + + {.name = "progress_bar", .image = NULL}, + {.name = "progress_bar_background", .image = NULL}, + + {.name = "text_scroll_prev", .image = NULL}, + {.name = "text_scroll_next", .image = NULL}, + + {.name = "font_console", .image = NULL}, + {.name = "font_small", .image = NULL}, +}; + +int imageCnt = 0; + +extern int gDeviceCount; +extern int selectIndex; + +extern MenuItem *menuItems; + +//char prompt[BOOT_STRING_LEN]; +extern char gBootArgs[BOOT_STRING_LEN]; + +char prompt_text[] = "boot: "; + +menuitem_t infoMenuItems[] = +{ + { .text = "Boot" }, + { .text = "Boot Verbose" }, + { .text = "Boot Ignore Caches" }, + { .text = "Boot Single User" }, + { .text = "Memory Info" }, + { .text = "Video Info" }, + { .text = "Help" } +}; + +int initFont(font_t *font, image_t *image); +int destroyFont(font_t *font); +void colorFont(font_t *font, uint32_t color); +void makeRoundedCorners(pixmap_t *p); + +static int infoMenuSelection = 0; +static int infoMenuItemsCount = sizeof(infoMenuItems)/sizeof(infoMenuItems[0]); + +static bool infoMenuNativeBoot = false; + +// here we store the used screen resolution +static unsigned long screen_params[4] = {DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0}; + +static int getImageIndexByName(const char *name) +{ + int i; + for (i = 0; i < sizeof(images) / sizeof(images[0]); i++) + { + if (strcmp(name, images[i].name) == 0) + { + return i; // found the name + } + } + return -1; +} + +#ifdef CONFIG_EMBED_THEME +static int getEmbeddedImageIndexByName(const char *name) +{ + int upperLimit = sizeof(embeddedImages) / sizeof(embeddedImages[0]) - 1; + int lowerLimit = 0; + int compareIndex = (upperLimit - lowerLimit) >> 1; // Midpoint + int result; + + // NOTE: This algorithm assumes that the embedded images are sorted. + // This is currently done using the make file. If the array is + // generated manualy, this *will* fail to work properly. + while((result = strcmp(name, embeddedImages[compareIndex].name)) != 0) + { + if (result > 0) // We need to search a HIGHER index + { + if (compareIndex != lowerLimit) + { + lowerLimit = compareIndex; + } + else + { + return -1; + } + compareIndex = (upperLimit + lowerLimit + 1) >> 1; // Midpoint, round up + } + else // We Need to search a LOWER index + { + if (compareIndex != upperLimit) + { + upperLimit = compareIndex; + } + else + { + return -1; + } + compareIndex = (upperLimit + lowerLimit) >> 1; // Midpoint, round down + } + } + return compareIndex; +} +#endif + +static int loadThemeImage(const char *image, int alt_image) +{ + char dirspec[256]; + int i; +#ifdef CONFIG_EMBED_THEME + int e; +#endif + uint16_t width; + uint16_t height; + uint8_t *imagedata; + + if ((strlen(image) + strlen(theme_name) + 20) > sizeof(dirspec)) + return 1; + if ((i = getImageIndexByName(image)) < 0) + return 1; + if (!images[i].image && !(images[i].image = malloc(sizeof(pixmap_t)))) + return 1; + sprintf(dirspec, "/Extra/Themes/%s/%s.png", theme_name, image); + width = 0; + height = 0; + imagedata = NULL; + if ((loadPngImage(dirspec, &width, &height, &imagedata)) == 0) + { + images[i].image->width = width; + images[i].image->height = height; + images[i].image->pixels = (pixel_t *)imagedata; + flipRB(images[i].image); + return 0; + } +#ifdef CONFIG_EMBED_THEME + else if ((e = getEmbeddedImageIndexByName(image)) >= 0) + { + unsigned char *embed_data; + unsigned int embed_size; + embed_data = embeddedImages[e].pngdata; + embed_size = *embeddedImages[e].length; + + if (loadEmbeddedPngImage(embed_data, embed_size, &width, &height, &imagedata) == 0) + { + images[i].image->width = width; + images[i].image->height = height; + images[i].image->pixels = (pixel_t *)imagedata; + flipRB(images[i].image); + return 0; + } + } +#endif + else if (alt_image != IMG_REQUIRED && is_image_loaded(alt_image)) + { + // Using the passed alternate image for non-mandatory images. + // We don't clone the already existing pixmap, but using its properties instead! + images[i].image->width = images[alt_image].image->width; + images[i].image->height = images[alt_image].image->height; + images[i].image->pixels = images[alt_image].image->pixels; + return 0; + } + + // If we got here it's an error +#ifndef CONFIG_EMBED_THEME + printf("ERROR: GUI: could not open '%s/%s.png'!\n", theme_name, image); + sleep(2); +#endif + free(images[i].image); + images[i].image = NULL; + return 1; +} + +static int loadGraphics(void) +{ + LOADPNG(background, IMG_REQUIRED); + LOADPNG(logo, IMG_REQUIRED); + + LOADPNG(device_generic, IMG_REQUIRED); + LOADPNG(device_generic_o, iDeviceGeneric); + LOADPNG(device_hfsplus, iDeviceGeneric); + LOADPNG(device_hfsplus_o, iDeviceHFS); + LOADPNG(device_hfsplus_mav, iDeviceHFS); + LOADPNG(device_hfsplus_mav_o, iDeviceHFS_mav); + LOADPNG(device_hfsplus_ml, iDeviceHFS); + LOADPNG(device_hfsplus_ml_o, iDeviceHFS_ML); + LOADPNG(device_hfsplus_lion, iDeviceHFS); + LOADPNG(device_hfsplus_lion_o, iDeviceHFS_Lion); + LOADPNG(device_hfsplus_sl, iDeviceHFS); + LOADPNG(device_hfsplus_sl_o, iDeviceHFS_SL); + LOADPNG(device_hfsplus_leo, iDeviceHFS); + LOADPNG(device_hfsplus_leo_o, iDeviceHFS_Leo); + LOADPNG(device_hfsplus_tiger, iDeviceHFS); + LOADPNG(device_hfsplus_tiger_o, iDeviceHFS_Tiger); + + LOADPNG(device_hfsraid, iDeviceHFS); + LOADPNG(device_hfsraid_o, iDeviceHFSRAID); + LOADPNG(device_hfsraid_mav, iDeviceHFSRAID); + LOADPNG(device_hfsraid_mav_o, iDeviceHFSRAID_mav); + LOADPNG(device_hfsraid_ml, iDeviceHFSRAID); + LOADPNG(device_hfsraid_ml_o, iDeviceHFSRAID_ML); + LOADPNG(device_hfsraid_lion, iDeviceHFSRAID); + LOADPNG(device_hfsraid_lion_o, iDeviceHFSRAID_Lion); + LOADPNG(device_hfsraid_sl, iDeviceHFSRAID); + LOADPNG(device_hfsraid_sl_o, iDeviceHFSRAID_SL); + LOADPNG(device_hfsraid_leo, iDeviceHFSRAID); + LOADPNG(device_hfsraid_leo_o, iDeviceHFSRAID_Leo); + LOADPNG(device_hfsraid_tiger, iDeviceHFSRAID); + LOADPNG(device_hfsraid_tiger_o, iDeviceHFSRAID_Tiger); + LOADPNG(device_ext3, iDeviceGeneric); + LOADPNG(device_ext3_o, iDeviceEXT3); + LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_freebsd_o, iDeviceFreeBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_openbsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_openbsd_o, iDeviceOpenBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_befs, iDeviceGeneric); /* Haiku detection and Icon credits to scorpius */ + LOADPNG(device_befs_o, iDeviceBEFS); /* Haiku detection and Icon credits to scorpius */ + LOADPNG(device_fat, iDeviceGeneric); + LOADPNG(device_fat_o, iDeviceFAT); + LOADPNG(device_fat16, iDeviceFAT); + LOADPNG(device_fat16_o, iDeviceFAT16); + LOADPNG(device_fat32, iDeviceFAT); + LOADPNG(device_fat32_o, iDeviceFAT32); + LOADPNG(device_ntfs, iDeviceGeneric); + LOADPNG(device_ntfs_o, iDeviceNTFS); + LOADPNG(device_cdrom, iDeviceGeneric); + LOADPNG(device_cdrom_o, iDeviceCDROM); + + LOADPNG(device_selection, IMG_REQUIRED); + LOADPNG(device_scroll_prev, IMG_REQUIRED); + LOADPNG(device_scroll_next, IMG_REQUIRED); + + LOADPNG(menu_boot, IMG_REQUIRED); + LOADPNG(menu_verbose, IMG_REQUIRED); + LOADPNG(menu_ignore_caches, IMG_REQUIRED); + LOADPNG(menu_single_user, IMG_REQUIRED); + LOADPNG(menu_memory_info, IMG_REQUIRED); + LOADPNG(menu_video_info, IMG_REQUIRED); + LOADPNG(menu_help, IMG_REQUIRED); + LOADPNG(menu_verbose_disabled, IMG_REQUIRED); + LOADPNG(menu_ignore_caches_disabled, IMG_REQUIRED); + LOADPNG(menu_single_user_disabled, IMG_REQUIRED); + LOADPNG(menu_selection, IMG_REQUIRED); + + LOADPNG(progress_bar, IMG_REQUIRED); + LOADPNG(progress_bar_background, IMG_REQUIRED); + + LOADPNG(text_scroll_prev, IMG_REQUIRED); + LOADPNG(text_scroll_next, IMG_REQUIRED); + + LOADPNG(font_console, IMG_REQUIRED); + LOADPNG(font_small, IMG_REQUIRED); + + initFont( &font_console, &images[iFontConsole]); + initFont( &font_small, &images[iFontSmall]); + + return 0; +} + +static int unloadGraphics(void) +{ + int i; + + destroyFont(&font_console); + destroyFont(&font_small); + for (i = 0; i < sizeof(images) / sizeof(images[0]); i++) + { + if (images[i].image) + { + if (images[i].image->pixels) free(images[i].image->pixels); + free (images[i].image); + images[i].image = 0; + } + } + return 0; +} + +int freeBackBuffer( window_t *window ) +{ + if (gui.backbuffer && gui.backbuffer->pixels) + { + free(gui.backbuffer->pixels); + free(gui.backbuffer); + gui.backbuffer = 0; + return 0; + } + + return 1; +} + +pixmap_t *getCroppedPixmapAtPosition( pixmap_t *from, position_t pos, uint16_t width, uint16_t height ) +{ + + pixmap_t *cropped = malloc( sizeof( pixmap_t ) ); + if( !cropped ) + return 0; + cropped->pixels = malloc( width * height * 4 ); + if ( !cropped->pixels ) + return 0; + + cropped->width = width; + cropped->height = height; + + int destx = 0, desty = 0; + int srcx = pos.x, srcy = pos.y; + + for( ; desty < height; desty++, srcy++) + { + for( destx = 0, srcx = pos.x; destx < width; destx++, srcx++ ) + { + pixel( cropped, destx, desty ).value = pixel( from, srcx, srcy ).value; + } + } + return cropped; +} + +int createBackBuffer( window_t *window ) +{ + gui.backbuffer = malloc(sizeof(pixmap_t)); + if(!gui.backbuffer) + { + return 1; + } + gui.backbuffer->pixels = malloc( window->width * window->height * 4 ); + if(!gui.backbuffer->pixels) + { + free(gui.backbuffer); + gui.backbuffer = 0; + return 1; + } + + gui.backbuffer->width = gui.screen.width; + gui.backbuffer->height = gui.screen.height; + + return 0; +} + +int createWindowBuffer( window_t *window ) +{ + window->pixmap = malloc(sizeof(pixmap_t)); + if(!window->pixmap) + { + return 1; + } + + window->pixmap->pixels = malloc( window->width * window->height * 4 ); + if(!window->pixmap->pixels) + { + free(window->pixmap); + window->pixmap = 0; + return 1; + } + + window->pixmap->width = window->width; + window->pixmap->height = window->height; + + return 0; +} + +int freeWindowBuffer( window_t *window ) +{ + if (window->pixmap && window->pixmap->pixels) + { + free(window->pixmap->pixels); + free(window->pixmap); + return 0; + } + + return 1; +} + +void fillPixmapWithColor(pixmap_t *pm, uint32_t color) +{ + int x,y; + + // fill with given color AARRGGBB + for( x=0; x < pm->width; x++ ) + for( y=0; y< pm->height; y++) + pixel(pm,x,y).value = color; +} + +void drawBackground() +{ + // reset text cursor + gui.screen.cursor.x = gui.screen.hborder; + gui.screen.cursor.y = gui.screen.vborder; + + fillPixmapWithColor( gui.screen.pixmap, gui.screen.bgcolor); + + // draw background.png into background buffer + blend( images[iBackground].image, gui.screen.pixmap, gui.background.pos ); + + // draw logo.png into background buffer + if (gui.logo.draw) + { + blend( images[iLogo].image, gui.screen.pixmap, gui.logo.pos); + } + + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); +} + +void setupDeviceList(config_file_t *theme) +{ + unsigned int pixel; + int alpha; // transparency level 0 (obligue) - 255 (transparent) + uint32_t color; // color value formatted RRGGBB + int val, len; + const char *string; + + if(getIntForKey("devices_max_visible", &val, theme )) + gui.maxdevices = MIN( val, gDeviceCount ); + + if(getIntForKey("devices_iconspacing", &val, theme )) + gui.devicelist.iconspacing = val; + + // check layout for horizontal or vertical + gui.layout = HorizontalLayout; + if(getValueForKey( "devices_layout", &string, &len, theme)) { + if (!strcmp (string, "vertical")) { + gui.layout = VerticalLayout; + } + } + + switch (gui.layout) { + case VerticalLayout: + gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); + gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing); + + if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) ) + gui.devicelist.pos.x = pixel; + + if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) ) + gui.devicelist.pos.y = pixel; + break; + + case HorizontalLayout: + default: + gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); + gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing); + + if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) ) + gui.devicelist.pos.x = pixel; + else + gui.devicelist.pos.x = ( gui.screen.width - gui.devicelist.width ) / 2; + + if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , images[iSelection].image->height ) ) + gui.devicelist.pos.y = pixel; + else + gui.devicelist.pos.y = ( gui.screen.height - gui.devicelist.height ) / 2; + break; + } + + if(getColorForKey("devices_bgcolor", &color, theme)) + gui.devicelist.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("devices_transparency", &alpha, theme)) + gui.devicelist.bgcolor = gui.devicelist.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + if (gui.devicelist.pixmap) + { + freeWindowBuffer(&gui.devicelist); + createWindowBuffer(&gui.devicelist); + } +} + +void loadThemeValues(config_file_t *theme) +{ + unsigned int screen_width = gui.screen.width; + unsigned int screen_height = gui.screen.height; + unsigned int pixel; + int alpha; // transparency level 0 (obligue) - 255 (transparent) + uint32_t color; // color value formatted RRGGBB + int val; + + /* + * Parse screen parameters + */ + if(getColorForKey("screen_bgcolor", &color, theme )) + gui.screen.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("screen_textmargin_h", &val, theme)) + gui.screen.hborder = MIN( gui.screen.width , val ); + + if(getIntForKey("screen_textmargin_v", &val, theme)) + gui.screen.vborder = MIN( gui.screen.height , val ); + + /* + * Parse background parameters + */ + if(getDimensionForKey("background_pos_x", &pixel, theme, screen_width , images[iBackground].image->width ) ) + gui.background.pos.x = pixel; + + if(getDimensionForKey("background_pos_y", &pixel, theme, screen_height , images[iBackground].image->height ) ) + gui.background.pos.y = pixel; + + /* + * Parse logo parameters + */ + if(getDimensionForKey("logo_pos_x", &pixel, theme, screen_width , images[iLogo].image->width ) ) + gui.logo.pos.x = pixel; + + if(getDimensionForKey("logo_pos_y", &pixel, theme, screen_height , images[iLogo].image->height ) ) + gui.logo.pos.y = pixel; + + /* + * Parse progress bar parameters + */ + if(getDimensionForKey("progressbar_pos_x", &pixel, theme, screen_width , 0 ) ) + gui.progressbar.pos.x = pixel; + + if(getDimensionForKey("progressbar_pos_y", &pixel, theme, screen_height , 0 ) ) + gui.progressbar.pos.y = pixel; + + /* + * Parse countdown text parameters + */ + if(getDimensionForKey("countdown_pos_x", &pixel, theme, screen_width , 0 ) ) + gui.countdown.pos.x = pixel; + + if(getDimensionForKey("countdown_pos_y", &pixel, theme, screen_height , 0 ) ) + gui.countdown.pos.y = pixel; + + /* + * Parse devicelist parameters + */ + setupDeviceList(theme); + + /* + * Parse infobox parameters + */ + if(getIntForKey("infobox_width", &val, theme)) + gui.infobox.width = MIN( screen_width , val ); + + if(getIntForKey("infobox_height", &val, theme)) + gui.infobox.height = MIN( screen_height , val ); + + if(getDimensionForKey("infobox_pos_x", &pixel, theme, screen_width , gui.infobox.width ) ) + gui.infobox.pos.x = pixel; + + if(getDimensionForKey("infobox_pos_y", &pixel, theme, screen_height , gui.infobox.height ) ) + gui.infobox.pos.y = pixel; + + if(getIntForKey("infobox_textmargin_h", &val, theme)) + gui.infobox.hborder = MIN( gui.infobox.width , val ); + + if(getIntForKey("infobox_textmargin_v", &val, theme)) + gui.infobox.vborder = MIN( gui.infobox.height , val ); + + if(getColorForKey("infobox_bgcolor", &color, theme)) + gui.infobox.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("infobox_transparency", &alpha, theme)) + gui.infobox.bgcolor = gui.infobox.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + /* + * Parse menu parameters + */ + if(getDimensionForKey("menu_width", &pixel, theme, gui.screen.width , 0 ) ) + gui.menu.width = pixel; + else + gui.menu.width = images[iMenuSelection].image->width; + + if(getDimensionForKey("menu_height", &pixel, theme, gui.screen.height , 0 ) ) + gui.menu.height = pixel; + else + gui.menu.height = (infoMenuItemsCount) * images[iMenuSelection].image->height; + + if(getDimensionForKey("menu_pos_x", &pixel, theme, screen_width , gui.menu.width ) ) + gui.menu.pos.x = pixel; + + if(getDimensionForKey("menu_pos_y", &pixel, theme, screen_height , gui.menu.height ) ) + gui.menu.pos.y = pixel; + + if(getIntForKey("menu_textmargin_h", &val, theme)) + gui.menu.hborder = MIN( gui.menu.width , val ); + + if(getIntForKey("menu_textmargin_v", &val, theme)) + gui.menu.vborder = MIN( gui.menu.height , val ); + + if(getColorForKey("menu_bgcolor", &color, theme)) + gui.menu.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("menu_transparency", &alpha, theme)) + gui.menu.bgcolor = gui.menu.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + /* + * Parse bootprompt parameters + */ + if(getDimensionForKey("bootprompt_width", &pixel, theme, screen_width , 0 ) ) + gui.bootprompt.width = pixel; + + if(getIntForKey("bootprompt_height", &val, theme)) + gui.bootprompt.height = MIN( screen_height , val ); + + if(getDimensionForKey("bootprompt_pos_x", &pixel, theme, screen_width , gui.bootprompt.width ) ) + gui.bootprompt.pos.x = pixel; + + if(getDimensionForKey("bootprompt_pos_y", &pixel, theme, screen_height , gui.bootprompt.height ) ) + gui.bootprompt.pos.y = pixel; + + if(getIntForKey("bootprompt_textmargin_h", &val, theme)) + gui.bootprompt.hborder = MIN( gui.bootprompt.width , val ); + + if(getIntForKey("bootprompt_textmargin_v", &val, theme)) + gui.bootprompt.vborder = MIN( gui.bootprompt.height , val ); + + if(getColorForKey("bootprompt_bgcolor", &color, theme)) + gui.bootprompt.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("bootprompt_transparency", &alpha, theme)) + gui.bootprompt.bgcolor = gui.bootprompt.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + if(getColorForKey("font_small_color", &color, theme)) + gui.screen.font_small_color = (color & 0x00FFFFFF); + + if(getColorForKey("font_console_color", &color, theme)) + gui.screen.font_console_color = (color & 0x00FFFFFF); +} + +int initGUI(void) +{ + int val; + int len; + char dirspec[256]; + + getValueForKey( "Theme", &theme_name, &len, &bootInfo->chameleonConfig ); + if ((strlen(theme_name) + 27) > sizeof(dirspec)) { + return 1; + } + sprintf(dirspec, "/Extra/Themes/%s/theme.plist", theme_name); + if (loadConfigFile(dirspec, &bootInfo->themeConfig) != 0) { +#ifdef CONFIG_EMBED_THEME + config_file_t *config; + + config = &bootInfo->themeConfig; + if (ParseXMLFile((char *)__theme_plist, &config->dictionary) != 0) { + return 1; + } +#else + return 1; +#endif + } + // parse display size parameters + if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) { + screen_params[0] = val; + } + if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0) { + screen_params[1] = val; + } + + // Initalizing GUI strucutre. + bzero(&gui, sizeof(gui_t)); + + // find best matching vesa mode for our requested width & height + getGraphicModeParams(screen_params); + + // set our screen structure with the mode width & height + gui.screen.width = screen_params[0]; + gui.screen.height = screen_params[1]; + + // load graphics otherwise fail and return + if (loadGraphics() == 0) { + loadThemeValues(&bootInfo->themeConfig); + colorFont(&font_small, gui.screen.font_small_color); + colorFont(&font_console, gui.screen.font_console_color); + + // create the screen & window buffers + if (createBackBuffer(&gui.screen) == 0) { + if (createWindowBuffer(&gui.screen) == 0) { + if (createWindowBuffer(&gui.devicelist) == 0) { + if (createWindowBuffer(&gui.bootprompt) == 0) { + if (createWindowBuffer(&gui.infobox) == 0) { + if (createWindowBuffer(&gui.menu) == 0) { + gui.logo.draw = true; + drawBackground(); + // lets copy the screen into the back buffer + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + setVideoMode( GRAPHICS_MODE, 0 ); + gui.initialised = true; + return 0; + } + } + } + } + } + } + } + + // not available memory, freeing resources + freeWindowBuffer(&gui.menu); + freeWindowBuffer(&gui.infobox); + freeWindowBuffer(&gui.bootprompt); + freeWindowBuffer(&gui.devicelist); + freeWindowBuffer(&gui.screen); + freeBackBuffer(&gui.screen); + unloadGraphics(); + + return 1; +} + +bool is_image_loaded(int i) +{ + return (images[i].image != NULL) ? true : false; +} + +void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected) +{ + int devicetype; + + if( diskIsCDROM(device) ) + devicetype = iDeviceCDROM; // Use CDROM icon + else + { + switch (device->part_type) + { + case kPartitionTypeHFS: + { + // Use HFS or HFSRAID icon depending on bvr flags. Fallbacks are handled by alt_image above. + switch (device->OSVersion[3]) { + case '9': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_mav : iDeviceHFS_mav); + break; + case '8': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_ML : iDeviceHFS_ML); + break; + case '7': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_Lion : iDeviceHFS_Lion); + break; + case '6': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_SL : iDeviceHFS_SL); + break; + case '5': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_Leo : iDeviceHFS_Leo); + break; + case '4': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_Tiger : iDeviceHFS_Tiger); + break; + default: + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID : iDeviceHFS); + break; + } + + break; + + } + case kPartitionTypeHPFS: + devicetype = iDeviceNTFS; // Use HPFS / NTFS icon + break; + + case kPartitionTypeFAT16: + devicetype = iDeviceFAT16; // Use FAT16 icon + break; + + case kPartitionTypeFAT32: + devicetype = iDeviceFAT32; // Use FAT32 icon + break; + + case kPartitionTypeEXT3: + devicetype = iDeviceEXT3; // Use EXT2/3 icon + break; + + case kPartitionTypeFreeBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + devicetype = iDeviceFreeBSD; // Use FreeBSD icon + break; + + case kPartitionTypeOpenBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + devicetype = iDeviceOpenBSD; // Use OpenBSD icon + break; + + case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */ + devicetype = iDeviceBEFS; // Use BEFS / Haiku icon + break; + + default: + devicetype = iDeviceGeneric; // Use Generic icon + break; + } + } + + // Draw the selection image and use the next (device_*_o) image for the selected item. + if (isSelected) + { + blend(images[iSelection].image, buffer, centeredAt(images[iSelection].image, p)); + devicetype++; // select override image + } + + // draw icon + blend(images[devicetype].image, buffer, centeredAt(images[devicetype].image, p)); + + p.y += (images[iSelection].image->height / 2) + font_console.chars[0]->height; + + // draw volume label + drawStrCenteredAt( device->label, &font_small, buffer, p); + +} + +void drawDeviceList (int start, int end, int selection) +{ + int i; + bool shoWinfo = false; + extern bool showBootBanner; + position_t p, p_prev, p_next; + + //uint8_t maxDevices = MIN( gui.maxdevices, menucount ); + + fillPixmapWithColor( gui.devicelist.pixmap, gui.devicelist.bgcolor); + + makeRoundedCorners( gui.devicelist.pixmap); + + switch (gui.layout) + { + + case VerticalLayout: + p.x = (gui.devicelist.width /2); + p.y = ( ( images[iSelection].image->height / 2 ) + images[iDeviceScrollPrev].image->height + gui.devicelist.iconspacing ); + + // place scroll indicators at top & bottom edges + p_prev = pos ( gui.devicelist.width / 2 , gui.devicelist.iconspacing ); + p_next = pos ( p_prev.x, gui.devicelist.height - gui.devicelist.iconspacing ); + + break; + + default: // use Horizontal layout as the default + + case HorizontalLayout: + p.x = (gui.devicelist.width - ( gui.devicelist.width / gui.maxdevices ) * gui.maxdevices ) / 2 + ( images[iSelection].image->width / 2) + images[iDeviceScrollPrev].image->width + gui.devicelist.iconspacing; + p.y = ((gui.devicelist.height - font_console.chars[0]->height ) - images[iSelection].image->height) / 2 + ( images[iSelection].image->height / 2 ); + + // place scroll indicators at left & right edges + p_prev = pos ( images[iDeviceScrollPrev].image->width / 2 + gui.devicelist.iconspacing / 2, gui.devicelist.height / 2 ); + p_next = pos ( gui.devicelist.width - ( images[iDeviceScrollNext].image->width / 2 + gui.devicelist.iconspacing / 2), gui.devicelist.height / 2 ); + + break; + + } + + // draw visible device icons + for (i = 0; i < gui.maxdevices; i++) + { + BVRef param = menuItems[start + i].param; + + bool isSelected = ((start + i) == selection) ? true : false; + if (isSelected) + { + if (param->flags & kBVFlagNativeBoot) + { + infoMenuNativeBoot = true; + } + else + { + infoMenuNativeBoot = false; + if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END) + infoMenuSelection = 0; + } + + if (gui.menu.draw) + drawInfoMenuItems(); + + getBoolForKey(kShowInfoKey, &shoWinfo, &bootInfo->chameleonConfig); + + if (shoWinfo && showBootBanner) + { + gui.debug.cursor = pos( 10, 100); + dprintf( &gui.screen, "label: %s\n", param->label ); + dprintf( &gui.screen, "biosdev: 0x%x\n", param->biosdev ); + dprintf( &gui.screen, "type: 0x%x\n", param->type ); + dprintf( &gui.screen, "flags: 0x%x\n", param->flags ); + dprintf( &gui.screen, "part_no: %d\n", param->part_no ); + dprintf( &gui.screen, "part_boff: 0x%x\n", param->part_boff ); + dprintf( &gui.screen, "part_type: 0x%x\n", param->part_type ); + dprintf( &gui.screen, "bps: 0x%x\n", param->bps ); + dprintf( &gui.screen, "name: %s\n", param->name ); + dprintf( &gui.screen, "type_name: %s\n", param->type_name ); + dprintf( &gui.screen, "modtime: %d\n", param->modTime ); +// // res + dprintf( &gui.screen, "width: %d\n", gui.screen.width ); + dprintf( &gui.screen, "height: %d\n", gui.screen.height ); +// dprintf( &gui.screen, "attr: 0x%x\n", gui.screen.attr ); //Azi: reminder +// dprintf( &gui.screen, "mm: %d\n", gui.screen.mm ); + } + } + + drawDeviceIcon( param, gui.devicelist.pixmap, p, isSelected); + + if (gui.layout == HorizontalLayout) + { + p.x += images[iSelection].image->width + gui.devicelist.iconspacing; + } + if (gui.layout == VerticalLayout) + { + p.y += ( images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing ); + } + } + + // draw prev indicator + if (start) + blend( images[iDeviceScrollPrev].image, gui.devicelist.pixmap, centeredAt( images[iDeviceScrollPrev].image, p_prev ) ); + + // draw next indicator + if ( end < gDeviceCount - 1 ) + blend( images[iDeviceScrollNext].image, gui.devicelist.pixmap, centeredAt( images[iDeviceScrollNext].image, p_next ) ); + + gui.redraw = true; + + updateVRAM(); + +} + +void clearGraphicBootPrompt() +{ + // clear text buffer + //prompt[0] = '\0'; + //prompt_pos=0; + + + if( gui.bootprompt.draw == true ) + { + gui.bootprompt.draw = false; + gui.redraw = true; + // this causes extra frames to be drawn + //updateVRAM(); + } + + return; +} + +void updateGraphicBootPrompt() +{ + fillPixmapWithColor( gui.bootprompt.pixmap, gui.bootprompt.bgcolor); + + makeRoundedCorners( gui.bootprompt.pixmap); + + position_t p_text = pos( gui.bootprompt.hborder , ( ( gui.bootprompt.height - font_console.chars[0]->height) ) / 2 ); + + // print the boot prompt text + drawStr(prompt_text, &font_console, gui.bootprompt.pixmap, p_text); + + // get the position of the end of the boot prompt text to display user input + position_t p_prompt = pos( p_text.x + ( ( strlen(prompt_text) ) * font_console.chars[0]->width ), p_text.y ); + + drawStr( gBootArgs, &font_console, gui.bootprompt.pixmap, p_prompt); + + gui.menu.draw = false; + gui.bootprompt.draw = true; + gui.redraw = true; + + updateVRAM(); + + return; +} + +static inline +void vramwrite (void *data, int width, int height) +{ + if (VIDEO (depth) == 32 && VIDEO (rowBytes) == gui.backbuffer->width * 4) + memcpy((uint8_t *)vram, gui.backbuffer->pixels, VIDEO (rowBytes)*VIDEO (height)); + else + { + uint32_t r, g, b; + int i, j; + for (i = 0; i < VIDEO (height); i++) + for (j = 0; j < VIDEO (width); j++) + { + b = ((uint8_t *) data)[4*i*width + 4*j]; + g = ((uint8_t *) data)[4*i*width + 4*j + 1]; + r = ((uint8_t *) data)[4*i*width + 4*j + 2]; + switch (VIDEO (depth)) + { + case 32: + *(uint32_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*4) = (b&0xff) | ((g&0xff)<<8) | ((r&0xff)<<16); + break; + case 24: + *(uint32_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*3) = ((*(uint32_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*3))&0xff000000) + | (b&0xff) | ((g&0xff)<<8) | ((r&0xff)<<16); + break; + case 16: + // Somehow 16-bit is always 15-bits really + // *(uint16_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*2) = ((b&0xf8)>>3) | ((g&0xfc)<<3) | ((r&0xf8)<<8); + // break; + case 15: + *(uint16_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*2) = ((b&0xf8)>>3) | ((g&0xf8)<<2) | ((r&0xf8)<<7); + break; + } + } + } +} + +void updateVRAM() +{ + if (gui.redraw) + { + if (gui.devicelist.draw) + blend( gui.devicelist.pixmap, gui.backbuffer, gui.devicelist.pos ); + + if (gui.bootprompt.draw) + blend( gui.bootprompt.pixmap, gui.backbuffer, gui.bootprompt.pos ); + + if (gui.menu.draw) + blend( gui.menu.pixmap, gui.backbuffer, gui.menu.pos ); + + if (gui.infobox.draw) + blend( gui.infobox.pixmap, gui.backbuffer, gui.infobox.pos ); + } + + vramwrite ( gui.backbuffer->pixels, gui.backbuffer->width, gui.backbuffer->height ); + + if (gui.redraw) + { + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + gui.redraw = false; + } +} + +struct putc_info //Azi: exists on console.c & printf.c +{ + char * str; + char * last_str; +}; + +static int +sputc(int c, struct putc_info * pi) //Azi: same as above +{ + if (pi->last_str) + if (pi->str == pi->last_str) { + *(pi->str) = '\0'; + return 0; + } + *(pi->str)++ = c; + return c; +} + +int gprintf( window_t * window, const char * fmt, ...) +{ + char *formattedtext; + + va_list ap; + + struct putc_info pi; + + if ((formattedtext = malloc(1024)) != NULL) { + // format the text + va_start(ap, fmt); + pi.str = formattedtext; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + va_end(ap); + + position_t origin, cursor, bounds; + + int i; + int character; + + origin.x = MAX( window->cursor.x, window->hborder ); + origin.y = MAX( window->cursor.y, window->vborder ); + + bounds.x = ( window->width - window->hborder ); + bounds.y = ( window->height - window->vborder ); + + cursor = origin; + + font_t *font = &font_console; + + for( i=0; i< strlen(formattedtext); i++ ) + { + character = formattedtext[i]; + + character -= 32; + + // newline ? + if( formattedtext[i] == '\n' ) + { + cursor.x = window->hborder; + cursor.y += font->height; + + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + + continue; + } + + // tab ? + if( formattedtext[i] == '\t' ) + cursor.x += ( font->chars[0]->width * 5 ); + + // draw the character + if( font->chars[character]) + blend(font->chars[character], window->pixmap, cursor); + + cursor.x += font->chars[character]->width; + + // check x pos and do newline + if ( cursor.x > bounds.x ) + { + cursor.x = origin.x; + cursor.y += font->height; + } + + // check y pos and reset to origin.y + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + } + + // update cursor postition + window->cursor = cursor; + + free(formattedtext); + + return 0; + + } + return 1; +} + +int dprintf( window_t * window, const char * fmt, ...) +{ + char *formattedtext; + + va_list ap; + + //window = &gui.debug; + + struct putc_info pi; + + if ((formattedtext = malloc(1024)) != NULL) { + // format the text + va_start(ap, fmt); + pi.str = formattedtext; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + va_end(ap); + + position_t origin, cursor, bounds; + + int i; + int character; + + origin.x = MAX( gui.debug.cursor.x, window->hborder ); + origin.y = MAX( gui.debug.cursor.y, window->vborder ); + + bounds.x = ( window->width - window->hborder ); + bounds.y = ( window->height - window->vborder ); + + cursor = origin; + + font_t *font = &font_console; + + for( i=0; i< strlen(formattedtext); i++ ) + { + character = formattedtext[i]; + + character -= 32; + + // newline ? + if( formattedtext[i] == '\n' ) + { + cursor.x = window->hborder; + cursor.y += font->height; + + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + + continue; + } + + // tab ? + if( formattedtext[i] == '\t' ) + cursor.x += ( font->chars[0]->width * 5 ); + + // draw the character + if( font->chars[character]) + blend(font->chars[character], gui.backbuffer, cursor); + + cursor.x += font->chars[character]->width; + + // check x pos and do newline + if ( cursor.x > bounds.x ) + { + cursor.x = origin.x; + cursor.y += font->height; + } + + // check y pos and reset to origin.y + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + } + + // update cursor postition + gui.debug.cursor = cursor; + + free(formattedtext); + + return 0; + + } + return 1; +} + +int vprf(const char * fmt, va_list ap) +{ + int i; + int character; + + char *formattedtext; + window_t *window = &gui.screen; + struct putc_info pi; + + position_t origin, cursor, bounds; + font_t *font = &font_console; + + if ((formattedtext = malloc(1024)) != NULL) { + // format the text + pi.str = formattedtext; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + + origin.x = MAX( window->cursor.x, window->hborder ); + origin.y = MAX( window->cursor.y, window->vborder ); + bounds.x = ( window->width - ( window->hborder * 2 ) ); + bounds.y = ( window->height - ( window->vborder * 2 ) ); + cursor = origin; + + for( i=0; i< strlen(formattedtext); i++ ) + { + character = formattedtext[i]; + character -= 32; + + // newline ? + if( formattedtext[i] == '\n' ) + { + cursor.x = window->hborder; + cursor.y += font->height; + if ( cursor.y > bounds.y ) + { + gui.redraw = true; + updateVRAM(); + cursor.y = window->vborder; + } + window->cursor.y = cursor.y; + continue; + } + + // tab ? + if( formattedtext[i] == '\t' ) + { + cursor.x = ( cursor.x / ( font->chars[0]->width * 8 ) + 1 ) * ( font->chars[0]->width * 8 ); + continue; + } + cursor.x += font->chars[character]->width; + + // check x pos and do newline + if ( cursor.x > bounds.x ) + { + cursor.x = origin.x; + cursor.y += font->height; + } + + // check y pos and reset to origin.y + if ( cursor.y > ( bounds.y + font->chars[0]->height) ) + { + gui.redraw = true; + updateVRAM(); + cursor.y = window->vborder; + } + // draw the character + if( font->chars[character]) + blend(font->chars[character], gui.backbuffer, cursor); + } + // save cursor postition + window->cursor.x = cursor.x; + updateVRAM(); + free(formattedtext); + return 0; + } + return 1; +} + +pixmap_t* charToPixmap(unsigned char ch, font_t *font) { + unsigned int cha = (unsigned int)ch - 32; + if (cha >= font->count) + // return ? if the font for the char doesn't exists + cha = '?' - 32; + + return font->chars[cha] ? font->chars[cha] : NULL; +} + +position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p) { + pixmap_t* pm = charToPixmap(ch, font); + if (pm && ((p.x + pm->width) < blendInto->width)) + { + blend(pm, blendInto, p); + return pos(p.x + pm->width, p.y); + } + else + return p; +} + +void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p) +{ + int i=0; + position_t current_pos = pos(p.x, p.y); + + for (i=0; i < strlen(ch); i++) + { + // newline ? + if ( ch[i] == '\n' ) + { + current_pos.x = p.x; + current_pos.y += font->height; + continue; + } + + // tab ? + if ( ch[i] == '\t' ) + { + current_pos.x += TAB_PIXELS_WIDTH; + continue; + } + + current_pos = drawChar(ch[i], font, blendInto, current_pos); + } +} + +void drawStrCenteredAt(char *text, font_t *font, pixmap_t *blendInto, position_t p) +{ + int i = 0; + int width = 0; + int max_width = 0; + int height = font->height; + + // calculate the width in pixels + for (i=0; i < strlen(text); i++) { + if (text[i] == '\n') + { + width = 0; + height += font->height; + } + else if (text[i] == '\t') + width += TAB_PIXELS_WIDTH; + else + { + pixmap_t* pm = charToPixmap(text[i], font); + if (pm) + width += pm->width; + } + if (width > max_width) + max_width = width; + } + + p.x = ( p.x - ( max_width / 2 ) ); + p.y = ( p.y - ( height / 2 ) ); + + drawStr(text, font, blendInto, p); +} + +int destroyFont(font_t *font) +{ + int i; + for (i = 0; i < CHARACTERS_COUNT; i++) + { + if (font->chars[i]) + { + if (font->chars[i]->pixels) free (font->chars[i]->pixels); + free (font->chars[i]); + font->chars[i] = 0; + } + } + return 0; +} + +int initFont(font_t *font, image_t *data) +{ + unsigned int x = 0, y = 0, x2 = 0, x3 = 0; + + int start = 0, end = 0, count = 0, space = 0; + + bool monospaced = false; + + font->height = data->image->height; + + for( x = 0; x < data->image->width && count < CHARACTERS_COUNT; x++) + { + start = end; + + // if the pixel is red we've reached the end of the char + if( pixel( data->image, x, 0 ).value == 0xFFFF0000) + { + end = x + 1; + + if( (font->chars[count] = malloc(sizeof(pixmap_t)) ) ) + { + font->chars[count]->width = ( end - start) - 1; + font->chars[count]->height = font->height; + + if ( ( font->chars[count]->pixels = malloc( font->chars[count]->width * data->image->height * 4) ) ) + { + space += ( font->chars[count]->width * data->image->height * 4 ); + // we skip the first line because there are just the red pixels for the char width + for( y = 1; y< (font->height); y++) + { + for( x2 = start, x3 = 0; x2 < end; x2++, x3++) + { + pixel( font->chars[count], x3, y ) = pixel( data->image, x2, y ); + } + } + + // check if font is monospaced + if( ( count > 0 ) && ( font->width != font->chars[count]->width ) ) + monospaced = true; + + font->width = font->chars[count]->width; + + count++; + } + } + } + } + + for (x = count; x < CHARACTERS_COUNT; x++) + font->chars[x] = NULL; + + if(monospaced) + font->width = 0; + + font->count = count; + + return 0; +} + +void colorFont(font_t *font, uint32_t color) +{ + if( !color ) + return; + + int x, y, width, height; + int count = 0; + pixel_t *buff; + + while( font->chars[count++] ) + { + width = font->chars[count-1]->width; + height = font->chars[count-1]->height; + for( y = 0; y < height; y++ ) + { + for( x = 0; x < width; x++ ) + { + buff = &(pixel( font->chars[count-1], x, y )); + if( buff->ch.a ) + { + buff->ch.r = (color & 0xFFFF0000) >> 16; + buff->ch.g = (color & 0xFF00FF00) >> 8; + buff->ch.b = (color & 0xFF0000FF); + } + } + } + } +} + +void makeRoundedCorners(pixmap_t *p) +{ + int x,y; + int width=p->width-1; + int height=p->height-1; + + // 10px rounded corner alpha values + uint8_t roundedCorner[10][10] = + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0xC0, 0xFF}, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0x00, 0x00, 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0x00, 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} + }; + + uint8_t alpha=0; + + for( y=0; y<10; y++) + { + for( x=0; x<10; x++) + { + // skip if the pixel should be visible + if(roundedCorner[y][x] != 0xFF) + { + alpha = ( roundedCorner[y][x] ? (uint8_t) (roundedCorner[y][x] * pixel(p, x, y).ch.a) / 255 : 0 ); + // Upper left corner + pixel(p, x, y).ch.a = alpha; + + // upper right corner + pixel(p, width-x,y).ch.a = alpha; + + // lower left corner + pixel(p, x, height-y).ch.a = alpha; + + // lower right corner + pixel(p, width-x, height-y).ch.a = alpha; + } + } + } +} + +void showInfoBox(char *title, char *text_orig) +{ + char* text; + int i, key, lines, visiblelines; + + int currentline=0; + int cnt=0; + int offset=0; + + if( !title || !text_orig ) + return; + + // Create a copy so that we don't mangle the original + text = malloc(strlen(text_orig) + 1); + strcpy(text, text_orig); + + + position_t pos_title = pos ( gui.infobox.vborder, gui.infobox.vborder ); + + // calculate number of lines in the title + for ( i = 0, lines = 1; iwidth - ( gui.infobox.vborder / 2) ), pos_text.y ); + + // draw prev indicator + if(offset) + { + blend( images[iTextScrollPrev].image, gui.infobox.pixmap, centeredAt( images[iTextScrollPrev].image, pos_indicator )); + } + + // draw next indicator + if( lines > ( currentline + visiblelines ) ) + { + pos_indicator.y = ( gui.infobox.height - ( ( images[iTextScrollNext].image->width + gui.infobox.vborder ) / 2 ) ); + blend( images[iTextScrollNext].image, gui.infobox.pixmap, centeredAt( images[iTextScrollNext].image, pos_indicator ) ); + } + + gui.bootprompt.draw = false; + gui.infobox.draw = true; + gui.redraw = true; + + updateVRAM(); + + key = getchar(); + + if( key == KEY_UP ) + if( currentline > 0 ) + currentline--; + + if( key == KEY_DOWN ) + if( lines > ( currentline + visiblelines ) ) + currentline++; + + if( key == KEY_ESC || key == 'q' || key == 'Q') + { + gui.infobox.draw = false; + gui.redraw = true; + updateVRAM(); + break; + } + + if(key == ' ') // spacebar = next page + { + if( lines > ( currentline + visiblelines ) ) + currentline += visiblelines; + + if(lines < (currentline + visiblelines)) + currentline = lines - visiblelines; + } + } +} + +void animateProgressBar() +{ + int y; + + if( time18() > lasttime) + { + lasttime = time18(); + + pixmap_t *buffBar = images[iProgressBar].image; + + uint32_t buff = buffBar->pixels[0].value; + + memcpy( buffBar->pixels, buffBar->pixels + 1, ( (buffBar->width*buffBar->height) - 1 ) * 4 ); + + for( y = buffBar->height - 1; y > 0; y--) + pixel(buffBar, buffBar->width - 1, y) = pixel(buffBar, buffBar->width - 1, y - 1); + + pixel(buffBar, buffBar->width-1, 0).value = buff; + } +} + +void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress) +{ + if(progress>100) + return; + + p.x = ( p.x - ( width / 2 ) ); + + int todraw = (width * progress) / 100; + + pixmap_t *buff = images[iProgressBar].image; + pixmap_t *buffBG = images[iProgressBarBackground].image; + if(!buff || !buffBG) + return; + + pixmap_t progressbar; + progressbar.pixels=malloc(width * 4 * buff->height); + if(!progressbar.pixels) + return; + + progressbar.width = width; + progressbar.height = buff->height; + + int x=0,x2=0,y=0; + + for(y=0; yheight; y++) + { + for(x=0; xwidth-1)) x2=0; + pixel(&progressbar, x,y).value = pixel(buff, x2,y).value; + } + x2=0; + } + + for(y=0; yheight; y++) + { + for(x=todraw, x2 = 0; x < width - 1; x++, x2++) + { + if(x2 == (buffBG->width -2 )) x2 = 0; + pixel(&progressbar, x,y).value = pixel(buffBG, x2,y).value; + } + if(progress < 100) + pixel(&progressbar, width - 1, y).value = pixel(buffBG, buffBG->width - 1, y).value; + if(progress == 0) + pixel(&progressbar, 0, y).value = pixel(buffBG, buffBG->width - 1, y).value; + x2=0; + } + + blend(&progressbar, blendInto, p); + animateProgressBar(); + free(progressbar.pixels); +} + +void drawInfoMenuItems() +{ + int i,n; + + position_t position; + + pixmap_t *selection = images[iMenuSelection].image; + + pixmap_t *pbuff; + + fillPixmapWithColor(gui.menu.pixmap, gui.menu.bgcolor); + + makeRoundedCorners(gui.menu.pixmap); + + uint8_t offset = infoMenuNativeBoot ? 0 : infoMenuItemsCount - 1; + + position = pos(0,0); + + for ( i = 0, n = iMenuBoot; i < infoMenuItemsCount; i++, n++) + { + if (i == infoMenuSelection) + { + blend(selection, gui.menu.pixmap, position); + } + + pbuff = images[n].image; + if (offset && i >= INFOMENU_NATIVEBOOT_START && i <= INFOMENU_NATIVEBOOT_END) + { + blend( images[n + (iMenuHelp - iMenuBoot)].image , gui.menu.pixmap, + pos((position.x + (gui.menu.hborder / 2)), position.y + ((selection->height - pbuff->height) / 2))); + } + else + { + blend( pbuff, gui.menu.pixmap, + pos((position.x + (gui.menu.hborder / 2)), position.y + ((selection->height - pbuff->height) / 2))); + } + + drawStr(infoMenuItems[i].text, &font_console, gui.menu.pixmap, + pos(position.x + (pbuff->width + gui.menu.hborder), + position.y + ((selection->height - font_console.height) / 2))); + position.y += images[iMenuSelection].image->height; + + } + + gui.redraw = true; +} + +int drawInfoMenu() +{ + drawInfoMenuItems(); + + gui.menu.draw = true; + + updateVRAM(); + + return 1; +} + +int updateInfoMenu(int key) +{ + switch (key) + { + + case KEY_UP: // up arrow + if (infoMenuSelection > 0) + { + if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_END + 1) + { + infoMenuSelection -= 4; + } + else + { + infoMenuSelection--; + } + drawInfoMenuItems(); + updateVRAM(); + + } + else + { + + gui.menu.draw = false; + gui.redraw = true; + + updateVRAM(); + + return CLOSE_INFO_MENU; + } + break; + + case KEY_DOWN: // down arrow + if (infoMenuSelection < infoMenuItemsCount - 1) + { + if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_START - 1) + infoMenuSelection += 4; + else + infoMenuSelection++; + drawInfoMenuItems(); + updateVRAM(); + } + break; + + case KEY_ENTER: + key = 0; + if( infoMenuSelection == MENU_SHOW_MEMORY_INFO ) + showInfoBox( "Memory Info. Press q to quit.\n", getMemoryInfoString()); + + else if( infoMenuSelection == MENU_SHOW_VIDEO_INFO ) + showInfoBox( getVBEInfoString(), getVBEModeInfoString() ); + + else if( infoMenuSelection == MENU_SHOW_HELP ) + showHelp(); + + else + { + int buff = infoMenuSelection; + infoMenuSelection = 0; + return buff; + } + break; + } + return DO_NOT_BOOT; +} + +uint16_t bootImageWidth = 0; +uint16_t bootImageHeight = 0; +uint8_t *bootImageData = NULL; +static bool usePngImage = true; + +//========================================================================== +// loadBootGraphics +static void loadBootGraphics(void) +{ + if (bootImageData != NULL) { + return; + } + + char dirspec[256]; + + if ((strlen(theme_name) + 24) > sizeof(dirspec)) { + usePngImage = false; + return; + } + sprintf(dirspec, "/Extra/Themes/%s/boot.png", theme_name); + if (loadPngImage(dirspec, &bootImageWidth, &bootImageHeight, &bootImageData) != 0) { +#ifdef CONFIG_EMBED_THEME + if ((loadEmbeddedPngImage(__boot_png, __boot_png_len, &bootImageWidth, &bootImageHeight, &bootImageData)) != 0) +#endif + usePngImage = false; + } +} + +//========================================================================== +// drawBootGraphics +void drawBootGraphics(void) +{ + int pos; + int length; + const char *dummyVal; + int oldScreenWidth, oldScreenHeight; + bool legacy_logo; + uint16_t x, y; + + if (getBoolForKey("Legacy Logo", &legacy_logo, &bootInfo->chameleonConfig) && legacy_logo) { + usePngImage = false; + } else if (bootImageData == NULL) { + loadBootGraphics(); + } + + // parse screen size parameters + if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) { + screen_params[0] = pos; + } else { + screen_params[0] = DEFAULT_SCREEN_WIDTH; + } + if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0) { + screen_params[1] = pos; + } else { + screen_params[1] = DEFAULT_SCREEN_HEIGHT; + } + + // Save current screen resolution. + oldScreenWidth = gui.screen.width; + oldScreenHeight = gui.screen.height; + + gui.screen.width = screen_params[0]; + gui.screen.height = screen_params[1]; + + // find best matching vesa mode for our requested width & height + getGraphicModeParams(screen_params); + + // Set graphics mode if the booter was in text mode or the screen resolution has changed. + if (bootArgs->Video.v_display == VGA_TEXT_MODE + || (screen_params[0] != oldScreenWidth && screen_params[1] != oldScreenHeight) ) + { + setVideoMode(GRAPHICS_MODE, 0); + } + + if (getValueForKey("-checkers", &dummyVal, &length, &bootInfo->chameleonConfig)) { + drawCheckerBoard(); + } else { + // Fill the background to 75% grey (same as BootX). + drawColorRectangle(0, 0, screen_params[0], screen_params[1], 0x01); + } + if ((bootImageData) && (usePngImage)) { + x = (screen_params[0] - MIN(bootImageWidth, screen_params[0])) / 2; + y = (screen_params[1] - MIN(bootImageHeight, screen_params[1])) / 2; + + // Draw the image in the center of the display. + blendImage(x, y, bootImageWidth, bootImageHeight, bootImageData); + } else { + uint8_t *appleBootPict; + bootImageData = NULL; + bootImageWidth = kAppleBootWidth; + bootImageHeight = kAppleBootHeight; + + // Prepare the data for the default Apple boot image. + appleBootPict = (uint8_t *) decodeRLE(gAppleBootPictRLE, kAppleBootRLEBlocks, bootImageWidth * bootImageHeight); + if (appleBootPict) { + convertImage(bootImageWidth, bootImageHeight, appleBootPict, &bootImageData); + if (bootImageData) { + x = (screen_params[0] - MIN(kAppleBootWidth, screen_params[0])) / 2; + y = (screen_params[1] - MIN(kAppleBootHeight, screen_params[1])) / 2; + drawDataRectangle(x, y, kAppleBootWidth, kAppleBootHeight, bootImageData); + free(bootImageData); + } + free(appleBootPict); + } + } +} diff --git a/i386/boot2/.svn/text-base/gui.h.svn-base b/i386/boot2/.svn/text-base/gui.h.svn-base new file mode 100644 index 0000000..94e28fe --- /dev/null +++ b/i386/boot2/.svn/text-base/gui.h.svn-base @@ -0,0 +1,152 @@ +/* + * gui.h + * + * + * Created by Jasmin Fazlic on 18.12.08. + * Copyright 2008/09 Jasmin Fazlic All rights reserved. + * Copyright 2008/09 iNDi All rights reserved. + * + */ + +#ifndef __BOOT2_GUI_H +#define __BOOT2_GUI_H + +#include "boot.h" +#include "bootstruct.h" +#include "graphics.h" +#include "graphic_utils.h" +#include "picopng.h" + +#define CHARACTERS_COUNT 223 + +#define BOOT_NORMAL 0 +#define BOOT_VERBOSE 1 +#define BOOT_IGNORECACHE 2 +#define BOOT_SINGLEUSER 3 +#define DO_NOT_BOOT 4 +#define CLOSE_INFO_MENU 5 + +#define INFOMENU_NATIVEBOOT_START 1 +#define INFOMENU_NATIVEBOOT_END 3 + +#define MENU_SHOW_MEMORY_INFO 4 +#define MENU_SHOW_VIDEO_INFO 5 +#define MENU_SHOW_HELP 6 + +enum { + HorizontalLayout = 0, + VerticalLayout = 1, +}; + +/* + * Menu item structure. + */ + +typedef struct { + position_t pos; + char *text; + bool enabled; + bool expandable; +} menuitem_t; + +/* + * Image structure. + */ +typedef struct { + pixmap_t *image; + char name[32]; +} image_t; + +/* + * Font structure. + */ +typedef struct { + uint16_t height; // Font Height + uint16_t width; // Font Width for monospace font only + pixmap_t *chars[CHARACTERS_COUNT]; + uint16_t count; // Number of chars in font +} font_t; + +/* + * Window structure. + */ +typedef struct +{ + position_t pos; // X,Y Position of window on screen + pixmap_t *pixmap; // Buffer + uint16_t width; // Width + uint16_t height; // Height + uint16_t hborder; // Horizontal border + uint16_t vborder; // Vertical border + uint16_t iconspacing; // Icon spacing + position_t cursor; // Text Cursor X,Y Position will be multiples of font width & height + uint32_t bgcolor; // Background color AARRGGBB + uint32_t fgcolor; // Foreground color AARRGGBB + uint32_t font_small_color; // Color for small font AARRGGBB + uint32_t font_console_color; // Color for consle font AARRGGBB + bool draw; // Draw flag +} window_t; + +/* + * gui structure + */ +typedef struct +{ + uint8_t maxdevices; // + uint8_t layout; // Horizontal or Vertical layout + + pixmap_t *backbuffer; // Off screen buffer + + window_t screen; // + window_t background; // Position of background graphic within screen + window_t logo; // Logo + window_t bootprompt; // Bootprompt Window + window_t devicelist; // Devicelist Window + window_t infobox; // Infobox Window + window_t menu; // Menu + + window_t progressbar; // Progress bar + window_t countdown; // Countdown text + + window_t debug; // Debug + + bool initialised; // Initialised + bool redraw; // Redraw flag +} gui_t; + + +gui_t gui; // gui structure + +font_t font_small; +font_t font_console; + +int initGUI(); +void drawBackground(); + +void setupDeviceList(config_file_t *theme); +bool is_image_loaded(int i); +void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected); +void drawDeviceList(int start, int end, int selection); +void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress); + +void showInfoBox(char *title, char *text); + +int dprintf( window_t * window, const char * fmt, ...); +int gprintf( window_t * window, const char * fmt, ...); +int vprf(const char * fmt, va_list ap); + +int drawInfoMenu(); +int updateInfoMenu(int key); +void drawInfoMenuItems(); + +void showGraphicBootPrompt(); +void clearGraphicBootPrompt(); +void updateGraphicBootPrompt(); + +void updateVRAM(); + +position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p); +void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p); +void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p); + +#endif /* !__BOOT2_GUI_H */ diff --git a/i386/boot2/.svn/text-base/lzss.c.svn-base b/i386/boot2/.svn/text-base/lzss.c.svn-base new file mode 100644 index 0000000..69f08ea --- /dev/null +++ b/i386/boot2/.svn/text-base/lzss.c.svn-base @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/************************************************************** + LZSS.C -- A Data Compression Program +*************************************************************** + 4/6/1989 Haruhiko Okumura + Use, distribute, and modify this program freely. + Please send me your improved versions. + PC-VAN SCIENCE + NIFTY-Serve PAF01022 + CompuServe 74050,1022 + +**************************************************************/ +/* + * lzss.c - Package for decompressing lzss compressed objects + * + * Copyright (c) 2003 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include + +#define N 4096 /* size of ring buffer - must be power of 2 */ +#define F 18 /* upper limit for match_length */ +#define THRESHOLD 2 /* encode string into position and length + if match_length is greater than this */ +#define NIL N /* index for root of binary search trees */ + +int +decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen) +{ + /* ring buffer of size N, with extra F-1 bytes to aid string comparison */ + u_int8_t text_buf[N + F - 1]; + u_int8_t *dststart = dst; + u_int8_t *srcend = src + srclen; + int i, j, k, r, c; + unsigned int flags; + + dst = dststart; + srcend = src + srclen; + for (i = 0; i < N - F; i++) + text_buf[i] = ' '; + r = N - F; + flags = 0; + for ( ; ; ) { + if (((flags >>= 1) & 0x100) == 0) { + if (src < srcend) c = *src++; else break; + flags = c | 0xFF00; /* uses higher byte cleverly */ + } /* to count eight */ + if (flags & 1) { + if (src < srcend) c = *src++; else break; + *dst++ = c; + text_buf[r++] = c; + r &= (N - 1); + } else { + if (src < srcend) i = *src++; else break; + if (src < srcend) j = *src++; else break; + i |= ((j & 0xF0) << 4); + j = (j & 0x0F) + THRESHOLD; + for (k = 0; k <= j; k++) { + c = text_buf[(i + k) & (N - 1)]; + *dst++ = c; + text_buf[r++] = c; + r &= (N - 1); + } + } + } + + return dst - dststart; +} diff --git a/i386/boot2/.svn/text-base/mboot.c.svn-base b/i386/boot2/.svn/text-base/mboot.c.svn-base new file mode 100644 index 0000000..258096a --- /dev/null +++ b/i386/boot2/.svn/text-base/mboot.c.svn-base @@ -0,0 +1,513 @@ +/* + File added by David F. Elliott on 2007/06/26 +*/ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" + +#include "mboot.h" + +int multiboot_timeout=0; +int multiboot_timeout_set=0; +int multiboot_partition=0; +int multiboot_partition_set=0; +int multiboot_skip_partition=0; +int multiboot_skip_partition_set=0; + +// Global multiboot info, if using multiboot. +struct multiboot_info *gMI; + +extern void continue_at_low_address(void); + +// prototype hi_multiboot and keep its implementation below multiboot_to_boot +// to ensure that it doesn't get inlined by the compiler +// We don't want it inlined because we specifically want the stack frame +// pointer to be as high as possible and the hi_multiboot function +// copies multiboot_info onto its stack. +uint32_t hi_multiboot(int multiboot_magic, struct multiboot_info *mi_orig); +// prototype dochainload for the same reason. +void dochainload(); + +#define OFFSET_1MEG 0x100000 +#define BAD_BOOT_DEVICE 0xffffffff + +// This assumes that the address of the first argument to the function will +// be exactly 4 bytes above the address of the return address. +// It is intended to be used as an lvalue with a statement like this -= OFFSET_1MEG; +#define RETURN_ADDRESS_USING_FIRST_ARG(arg) \ + (*(uint32_t*)((char*)&(arg) - 4)) + +#define FIX_RETURN_ADDRESS_USING_FIRST_ARG(arg) \ + RETURN_ADDRESS_USING_FIRST_ARG(arg) -= OFFSET_1MEG + +extern void jump_to_chainbooter(); +extern unsigned char chainbootdev; +extern unsigned char chainbootflag; + +void chainLoad(); +void waitThenReload(); + +int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ); +int multiboot_get_ramdisk_info(int biosdev, struct driveInfo *dip); +static long multiboot_LoadExtraDrivers(FileLoadDrivers_t FileLoadDrivers_p); + +// Starts off in the multiboot context 1 MB high but eventually gets into low memory +// and winds up with a bootdevice in eax which is all that boot() wants +// This lets the stack pointer remain very high. +// If we were to call boot directly from multiboot then the whole multiboot_info +// would be on the stack which would possibly be using way too much stack. +void multiboot_to_boot(int multiboot_magic, struct multiboot_info *mi_orig) +{ + uint32_t bootdevice = hi_multiboot(multiboot_magic, mi_orig); + if(bootdevice != BAD_BOOT_DEVICE) + { + // boot only returns to do a chain load. + for(;;) + { // NOTE: boot only uses the last byte (the drive number) + common_boot(bootdevice); + if(chainbootflag) + chainLoad(); + else + waitThenReload(); + } + } + // Avoid returning to high-memory address which isn't valid in the segment + // we are now in. + // Calling sleep() ensures the user ought to be able to use Ctrl+Alt+Del + // because the BIOS will have interrupts on. + for(;;) + sleep(10); + // NOTE: *IF* we needed to return we'd have to fix up our return address to + // be in low memory using the same trick as below. + // However, there doesn't seem to be any point in returning to assembly + // particularly when the remaining code merely halts the processor. +} + +void chainLoad() +{ + /* TODO: We ought to load the appropriate partition table, for example + the MBR if booting a primary partition or the particular extended + partition table if booting a logical drive. For example, the + regular MS MBR booter will relocate itself (e.g. the MBR) from + 0:7C00 to 0:0600 and will use SI as the offset when reading + the partition data from itself. Thus when it jumps to the partition + boot sector, SI will be 0x600 + 446 + i<<4 where i is the partition + table index. + + On the other hand, our code for the non-Multiboot case doesn't do + this either, although GRUB does. + */ + + const unsigned char *bootcode = (const unsigned char*)0x7c00; + if(bootcode[0x1fe] == 0x55 && bootcode[0x1ff] == 0xaa) + { + printf("Calling chainbooter\n"); + jump_to_chainbooter(); + /* NORETURN */ + } + else + { + printf("Bad chain boot sector magic: %02x%02x\n", bootcode[0x1fe], bootcode[0x1ff]); + } +} + +void waitThenReload() +{ + /* FIXME: Ctrl+Alt+Del does not work under Boot Camp */ + printf("Darwin booter exited for some reason.\n"); + printf("Please reboot (Ctrl+Alt+Del) your machine.\n"); + printf("Restarting Darwin booter in 5 seconds..."); + sleep(1); + printf("4..."); + sleep(1); + printf("3..."); + sleep(1); + printf("2..."); + sleep(1); + printf("1..."); + sleep(1); + printf("0\n"); +} + +// Declare boot2_sym as an opaque struct so it can't be converted to a pointer +// i.e. ensure the idiot programmer (me) makes sure to use address-of +// Technically it's a function but it's real mode code and we sure don't +// want to call it under any circumstances. +extern struct {} boot2_sym asm("boot2"); + +// prototype multiboot and keep its implementation below hi_multiboot to +// ensure that it doesn't get inlined by the compiler +static inline uint32_t multiboot(int multiboot_magic, struct multiboot_info *mi); + + +/*! + Returns a pointer to the first safe address we can use for stowing the multiboot info. + This might actually be a bit pedantic because mboot.c32 and GRUB both stow the multiboot + info in low memory meaning that the >= 128 MB location we choose is plenty high enough. + */ +void *determine_safe_hi_addr(int multiboot_magic, struct multiboot_info *mi_orig) +{ + // hi_addr must be at least up in 128MB+ space so it doesn't get clobbered + void *hi_addr = (void*)PREBOOT_DATA; + + // Fail if the magic isn't correct. We'll complain later. + if(multiboot_magic != MULTIBOOT_INFO_MAGIC) + return NULL; + // Make sure the command-line isn't in high memory. + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) + { + char *end = mi_orig->mi_cmdline; + if(end != NULL) + { + for(; *end != '\0'; ++end) + ; + ++end; + if( (void*)end > hi_addr) + hi_addr = end; + } + } + // Make sure the module information isn't in high memory + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_MODS) + { + struct multiboot_module *modules = (void*)mi_orig->mi_mods_addr; + int i; + for(i=0; i < mi_orig->mi_mods_count; ++i) + { + // make sure the multiboot_module struct itself won't get clobbered + void *modinfo_end = modules+i+1; + if(modinfo_end > hi_addr) + hi_addr = modinfo_end; + // make sure the module itself won't get clobbered + modinfo_end = (void*)modules[i].mm_mod_end; + if(modinfo_end > hi_addr) + hi_addr = modinfo_end; + // make sure the module string doesn't get clobbered + char *end = modules[i].mm_string; + for(; *end != '\0'; ++end) + ; + ++end; + modinfo_end = end; + if(modinfo_end > hi_addr) + hi_addr = modinfo_end; + } + } + // TODO: Copy syms (never needed), mmap, drives, config table, loader name, apm table, VBE info + + // Round up to page size + hi_addr = (void*)(((uint32_t)hi_addr + 0xfff) & ~(uint32_t)0xfff); + return hi_addr; +} + +/*! + Like malloc but with a preceding input/output parameter which points to the next available + location for data. The original value of *hi_addr is returned and *hi_addr is incremented + by size bytes. + */ +void * _hi_malloc(void **hi_addr, size_t size) +{ + void *ret = *hi_addr; + *hi_addr += size; + return ret; +} + +/*! + Like strdup but with a preceding input/output parameter. The original value of *hi_addr is + returned and *hi_addr is incremented by the number of bytes necessary to complete the string + copy including its NUL terminator. + */ +char * _hi_strdup(void **hi_addr, char *src) +{ + char *dstStart; + char *dst = dstStart = *hi_addr; + for(; *src != '\0'; ++src, ++dst, ++(*hi_addr)) + *dst = *src; + *dst = '\0'; + ++(*hi_addr); + return dstStart; +} + +// Convenience macros +#define hi_malloc(size) _hi_malloc(&hi_addr, (size)) +#define hi_strdup(src) _hi_strdup(&hi_addr, (src)) + +/*! + Copies the Multiboot info and any associated data (e.g. various strings and any multiboot modules) + up to very high RAM (above 128 MB) to ensure it doesn't get clobbered by the booter. + */ +struct multiboot_info * copyMultibootInfo(int multiboot_magic, struct multiboot_info *mi_orig) +{ + void *hi_addr = determine_safe_hi_addr(multiboot_magic, mi_orig); + if(hi_addr == NULL) + return NULL; + + struct multiboot_info *mi_copy = hi_malloc(sizeof(*mi_copy)); + memcpy(mi_copy, mi_orig, sizeof(*mi_copy)); + + // Copy the command line + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) + { + mi_copy->mi_cmdline = hi_strdup(mi_orig->mi_cmdline); + } + // Copy the loader name + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_LOADER_NAME) + { + mi_copy->mi_loader_name = hi_strdup(mi_orig->mi_loader_name); + } + // Copy the module info + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_MODS) + { + struct multiboot_module *dst_modules = hi_malloc(sizeof(*dst_modules)*mi_orig->mi_mods_count); + struct multiboot_module *src_modules = (void*)mi_orig->mi_mods_addr; + mi_copy->mi_mods_addr = (uint32_t)dst_modules; + + // Copy all of the module info plus the actual module into high memory + int i; + for(i=0; i < mi_orig->mi_mods_count; ++i) + { + // Assume mod_end is 1 past the actual end (i.e. it is start + size, not really end (i.e. start + size - 1)) + // This is what GRUB and mboot.c32 do although the spec is unclear on this. + uint32_t mod_length = src_modules[i].mm_mod_end - src_modules[i].mm_mod_start; + + dst_modules[i].mm_mod_start = (uint32_t)hi_malloc(mod_length); + dst_modules[i].mm_mod_end = (uint32_t)dst_modules[i].mm_mod_start + mod_length; + memcpy((char*)dst_modules[i].mm_mod_start, (char*)src_modules[i].mm_mod_start, mod_length); + + dst_modules[i].mm_string = hi_strdup(src_modules[i].mm_string); + dst_modules[i].mm_reserved = src_modules[i].mm_reserved; + } + } + // Make sure that only stuff that didn't need to be copied or that we did deep copy is indicated in the copied struct. + mi_copy->mi_flags &= MULTIBOOT_INFO_HAS_MEMORY | MULTIBOOT_INFO_HAS_BOOT_DEVICE | MULTIBOOT_INFO_HAS_CMDLINE | MULTIBOOT_INFO_HAS_LOADER_NAME | MULTIBOOT_INFO_HAS_MODS; + + return mi_copy; +} + +// When we enter, we're actually 1 MB high. +// Fortunately, memcpy is position independent, and it's all we need +uint32_t hi_multiboot(int multiboot_magic, struct multiboot_info *mi_orig) +{ + // Copy the multiboot info out of the way. + // We can't bitch about the magic yet because printf won't work + // because it contains an absolute location of putchar which + // contains absolute locations to other things which eventually + // makes a BIOS call from real mode which of course won't work + // because we're stuck in extended memory at this point. + struct multiboot_info *mi_p = copyMultibootInfo(multiboot_magic, mi_orig); + + // Get us in to low memory so we can run everything + + // We cannot possibly be more than 447k and copying extra won't really hurt anything + // We use the address of the assembly entrypoint to get our starting location. + memcpy(&boot2_sym, (char*)&boot2_sym + OFFSET_1MEG, BOOT2_MAX_LENGTH /* 447k */); + + // This is a little assembler routine that returns to us in the correct selector + // instead of the kernel selector we're running in now and at the correct + // instruction pointer ( current minus 1 MB ). It does not fix our return + // address nor does it fix the return address of our caller. + continue_at_low_address(); + + // Now fix our return address. + // JrCs: this macro should be rewritten because the code generated by XCode 4.x + // change the value of the argument passed as parameter (multiboot_magic) + // FIX_RETURN_ADDRESS_USING_FIRST_ARG(multiboot_magic); + + // We can now do just about anything, including return to our caller correctly. + // However, our caller must fix his return address if he wishes to return to + // his caller and so on and so forth. + + /* Zero the BSS and initialize malloc */ + initialize_runtime(); + + gMI = mi_p; + + /* Set up a temporary bootArgs so we can call console output routines + like printf that check the v_display. Note that we purposefully + do not initialize anything else at this early stage. + + We are reasonably sure we're already in text mode if GRUB booted us. + This is the same assumption that initKernBootStruct makes. + We could check the multiboot info I guess, but why bother? + */ + boot_args temporaryBootArgsData; + bzero(&temporaryBootArgsData, sizeof(boot_args)); + bootArgs = &temporaryBootArgsData; + bootArgs->Video.v_display = VGA_TEXT_MODE; + + // Install ramdisk and extra driver hooks + p_get_ramdisk_info = &multiboot_get_ramdisk_info; + p_ramdiskReadBytes = &multibootRamdiskReadBytes; + LoadExtraDrivers_p = &multiboot_LoadExtraDrivers; + + // Since we call multiboot ourselves, its return address will be correct. + // That is unless it's inlined in which case it does not matter. + uint32_t bootdevice = multiboot(multiboot_magic, mi_p); + // We're about to exit and temporaryBootArgs will no longer be valid + bootArgs = NULL; + return bootdevice; +} + +// This is the meat of our implementation. It grabs the boot device from +// the multiboot_info and returns it as is. If it fails it returns +// BAD_BOOT_DEVICE. We can call an awful lot of libsa and libsaio but +// we need to take care not to call anything that requires malloc because +// it won't be initialized until boot() does it. +static inline uint32_t multiboot(int multiboot_magic, struct multiboot_info *mi) +{ + if(multiboot_magic != MULTIBOOT_INFO_MAGIC) + { + printf("Wrong Multiboot magic\n"); + sleep(2); + return BAD_BOOT_DEVICE; + } + printf("Multiboot info @0x%x\n", (uint32_t)mi); + if(mi->mi_flags & MULTIBOOT_INFO_HAS_LOADER_NAME) + printf("Loaded by %s\n", mi->mi_loader_name); + + // Multiboot puts boot device in high byte + // Normal booter wants it in low byte + int bootdevice = mi->mi_boot_device_drive; + + bool doSelectDevice = false; + if(mi->mi_flags & MULTIBOOT_INFO_HAS_BOOT_DEVICE) + { + printf("Boot device 0x%x\n", bootdevice); + } + else + { + printf("Multiboot info does not include chosen boot device\n"); + doSelectDevice = true; + bootdevice = BAD_BOOT_DEVICE; + } + if(mi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) + { + const char *val; + int size; + + if(getValueForBootKey(mi->mi_cmdline, "biosdev", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 16 /* always hex */); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Boot device overridden to %02x with biosdev=%s\n", intVal, val); + bootdevice = intVal; + doSelectDevice = false; + } + else + doSelectDevice = true; + } + + if(getValueForBootKey(mi->mi_cmdline, "timeout", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 0); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Timeout overridden to %d with timeout=%s\n", intVal, val); + multiboot_timeout = intVal; + multiboot_timeout_set = 1; + } + } + + if(getValueForBootKey(mi->mi_cmdline, "partno", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 0); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Default partition overridden to %d with partno=%s\n", intVal, val); + multiboot_partition = intVal; + multiboot_partition_set = 1; + } + } + if(getValueForBootKey(mi->mi_cmdline, "skip_partno", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 0); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Skipping partition %d with skip_partno=%s\n", intVal, val); + multiboot_skip_partition = intVal; + multiboot_skip_partition_set = 1; + } + } + } + if(doSelectDevice) + { + bootdevice = selectAlternateBootDevice(bootdevice); + } + if(bootdevice == BAD_BOOT_DEVICE) + sleep(2); // pause for a second before halting + return bootdevice; +} + +/////////////////////////////////////////////////////////////////////////// +// Ramdisk and extra drivers code + +int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ) +{ + int module_count = gMI->mi_mods_count; + struct multiboot_module *modules = (void*)gMI->mi_mods_addr; + if(biosdev < 0x100) + return -1; + if(biosdev >= (0x100 + module_count)) + return -1; + struct multiboot_module *module = modules + (biosdev - 0x100); + + void *p_initrd = (void*)module->mm_mod_start; + bcopy(p_initrd + blkno*512 + byteoff, buffer, byteCount); + return 0; +} + +int multiboot_get_ramdisk_info(int biosdev, struct driveInfo *dip) +{ + int module_count = gMI->mi_mods_count; + struct multiboot_module *modules = (void*)gMI->mi_mods_addr; + if(biosdev < 0x100) + return -1; + if(biosdev >= (0x100 + module_count)) + return -1; + struct multiboot_module *module = modules + (biosdev - 0x100); + dip->biosdev = biosdev; + dip->uses_ebios = true; // XXX aserebln uses_ebios isn't a boolean at all + dip->di.params.phys_sectors = (module->mm_mod_end - module->mm_mod_start + 511) / 512; + dip->valid = true; + return 0; +} + +static long multiboot_LoadExtraDrivers(FileLoadDrivers_t FileLoadDrivers_p) +{ + char extensionsSpec[1024]; + int ramdiskUnit; + for(ramdiskUnit = 0; ramdiskUnit < gMI->mi_mods_count; ++ramdiskUnit) + { + int partCount; // unused + BVRef ramdiskChain = diskScanBootVolumes(0x100 + ramdiskUnit, &partCount); + if(ramdiskChain == NULL) + { + verbose("Ramdisk contains no partitions\n"); + continue; + } + for(; ramdiskChain != NULL; ramdiskChain = ramdiskChain->next) + { + sprintf(extensionsSpec, "rd(%d,%d)/Extra/", ramdiskUnit, ramdiskChain->part_no); + struct dirstuff *extradir = opendir(extensionsSpec); + closedir(extradir); + if(extradir != NULL) + { + int ret = FileLoadDrivers_p(extensionsSpec, 0 /* this is a kext root dir, not a kext with plugins */); + if(ret != 0) + { + verbose("FileLoadDrivers failed on a ramdisk\n"); + return ret; + } + } + } + } + return 0; +} diff --git a/i386/boot2/.svn/text-base/mboot.h.svn-base b/i386/boot2/.svn/text-base/mboot.h.svn-base new file mode 100644 index 0000000..b746093 --- /dev/null +++ b/i386/boot2/.svn/text-base/mboot.h.svn-base @@ -0,0 +1,21 @@ +/* File added by David F. Elliott on 2007/06/27 */ +#include "multiboot.h" + +/* +The following DWORD tells the loader what features we require of it. +bit 0 set: Align modules on 4KB. We have no modules, we may not need this. +bit 1 set: Provide info about memory. We probably don't need this either +bit 2 : We might want this. If so we need to tell the loader to stick + us in text mode. We currently assume that the loader will put + us in text mode if we lack this because that is what GRUB does. +bit 16 set: This is not ELF, use the multiboot_header fields. + We definitely need this flag. +*/ +/* #define MULTIBOOT_HEADER_FLAGS 0x00010003 */ + +#define MULTIBOOT_HEADER_FLAGS \ + (MULTIBOOT_HEADER_HAS_ADDR|MULTIBOOT_HEADER_WANT_MEMORY|MULTIBOOT_HEADER_MODS_ALIGNED) + +#ifndef __ASSEMBLER__ +/* Put any desired prototypes or other C stuff here. */ +#endif diff --git a/i386/boot2/.svn/text-base/modules.c.svn-base b/i386/boot2/.svn/text-base/modules.c.svn-base new file mode 100644 index 0000000..4e70d99 --- /dev/null +++ b/i386/boot2/.svn/text-base/modules.c.svn-base @@ -0,0 +1,1160 @@ +/* + * Copyright 2010 Evan Lojewski. All rights reserved. + * + */ +#include "boot.h" +#include "bootstruct.h" +#include "modules.h" +#include "boot_modules.h" +#include + +#ifdef CONFIG_MODULES +#ifndef CONFIG_MODULE_DEBUG +#define CONFIG_MODULE_DEBUG 0 +#endif + + +#if CONFIG_MODULE_DEBUG +#define DBG(x...) printf(x) +#define DBGPAUSE() getchar() +#else +#define DBG(x...) +#define DBGPAUSE() +#endif + +// NOTE: Global so that modules can link with this +static UInt64 textAddress = 0; +static UInt64 textSection = 0; + +/** Internal symbols, however there are accessor methods **/ +moduleHook_t* moduleCallbacks = NULL; +moduleList_t* loadedModules = NULL; +symbolList_t* moduleSymbols = NULL; +unsigned int (*lookup_symbol)(const char*) = NULL; + + +/* + * Initialize the module system by loading the Symbols.dylib module. + * Once loaded, locate the _lookup_symbol function so that internal + * symbols can be resolved. + */ +int init_module_system() +{ + // Start any modules that were compiled in first. + start_built_in_modules(); + + + int retVal = 0; + void (*module_start)(void) = NULL; + + extern char symbols_start __asm("section$start$__DATA$__Symbols"); + char* module_data = &symbols_start; + + // Intialize module system + if(module_data) + { + // Module system was compiled in (Symbols.dylib addr known) + module_start = parse_mach(module_data, &load_module, &add_symbol, NULL); + + if(module_start && module_start != (void*)0xFFFFFFFF) + { + // Notify the system that it was laoded + module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT); + (*module_start)(); // Start the module. This will point to load_all_modules due to the way the dylib was constructed. + execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL); + DBG("Module %s Loaded.\n", SYMBOLS_MODULE); + retVal = 1; + + } + else + { + // The module does not have a valid start function + printf("Unable to start %s at 0x%x\n", SYMBOLS_MODULE, module_data); pause(); + } + } + return retVal; +} + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)) +{ + start_function(); + // Notify the module system that this module really exists, specificaly, let other module link with it + module_loaded(name, author, description, version, compat); +} + +/* + * Load all modules in the /Extra/modules/ directory + * Module depencdies will be loaded first + * Modules will only be loaded once. When loaded a module must + * setup apropriete function calls and hooks as required. + * NOTE: To ensure a module loads after another you may + * link one module with the other. For dyld to allow this, you must + * reference at least one symbol within the module. + */ +void load_all_modules() +{ + char* name; + long flags; + long time; + struct dirstuff* moduleDir = opendir("/Extra/modules/"); + while(readdir(moduleDir, (const char**)&name, &flags, &time) >= 0) + { + if(strcmp(&name[strlen(name) - sizeof("dylib")], ".dylib") == 0) + { + char* tmp = malloc(strlen(name) + 1); + strcpy(tmp, name); + + if(!load_module(tmp)) + { + // failed to load + // free(tmp); + } + } + else + { + DBG("Ignoring %s\n", name); + } + + } +} + + +/* + * Load a module file in /Extra/modules/ + */ +int load_module(char* module) +{ + int retVal = 1; + void (*module_start)(void) = NULL; + char modString[128]; + int fh = -1; + + // Check to see if the module has already been loaded + if(is_module_loaded(module)) + { + return 1; + } + + sprintf(modString, MODULE_PATH "%s", module); + fh = open(modString, 0); + if(fh < 0) + { + DBG("WARNING: Unable to locate module %s\n", modString); DBGPAUSE(); + return 0; + } + + unsigned int moduleSize = file_size(fh); + if(moduleSize == 0) + { + DBG("WARNING: The module %s has a file size of %d, the module will not be loaded.\n", modString, moduleSize); + return 0; + } + char* module_base = (char*) malloc(moduleSize); + if (moduleSize && read(fh, module_base, moduleSize) == moduleSize) + { + // Module loaded into memory, parse it + module_start = parse_mach(module_base, &load_module, &add_symbol, NULL); + + if(module_start && module_start != (void*)0xFFFFFFFF) + { + // Notify the system that it was laoded + module_loaded(module, NULL, NULL, 0, 0 /*moduleName, NULL, moduleVersion, moduleCompat*/); + (*module_start)(); // Start the module + DBG("Module %s Loaded.\n", module); DBGPAUSE(); + } +#if CONFIG_MODULE_DEBUG + else // The module does not have a valid start function. This may be a library. + { + printf("WARNING: Unable to start %s\n", module); + getchar(); + } +#else + else msglog("WARNING: Unable to start %s\n", module); +#endif + } + else + { + DBG("Unable to read in module %s\n.", module); DBGPAUSE(); + retVal = 0; + } + + close(fh); + return retVal; +} + +/* + * add_symbol + * This function adds a symbol from a module to the list of known symbols + * possibly change to a pointer and add this to the Symbol module so that it can + * adjust it's internal symbol list (sort) to optimize locating new symbols + * NOTE: returns the address if the symbol is "start", else returns 0xFFFFFFFF + */ +long long add_symbol(char* symbol, long long addr, char is64) +{ + // This only can handle 32bit symbols + symbolList_t* entry; + //DBG("Adding symbol %s at 0x%X\n", symbol, addr); + + entry = malloc(sizeof(symbolList_t)); + entry->next = moduleSymbols; + moduleSymbols = entry; + + entry->addr = (UInt32)addr; + entry->symbol = symbol; + + if(!is64 && strcmp(symbol, "start") == 0) + { + return addr; + } + else + { + return 0xFFFFFFFF; // fixme + } +} + + +/* + * print out the information about the loaded module + */ +void module_loaded(const char* name, const char* author, const char* description, UInt32 version, UInt32 compat) +{ + moduleList_t* new_entry = malloc(sizeof(moduleList_t)); + new_entry->next = loadedModules; + + loadedModules = new_entry; + + if(!name) name = "Unknown"; + if(!author) author = "Unknown"; + if(!description) description = ""; + + new_entry->name = name; + new_entry->author = author; + new_entry->description = description; + new_entry->version = version; + new_entry->compat = compat; + + msglog("Module '%s' by '%s' Loaded.\n", name, author); + msglog("\tDescription: %s\n", description); + msglog("\tVersion: %d\n", version); // todo: sperate to major.minor.bugfix + msglog("\tCompat: %d\n", compat); // todo: ^^^ major.minor.bugfix +} + +int is_module_loaded(const char* name) +{ + // todo sorted search + moduleList_t* entry = loadedModules; + while(entry) + { + if(strcmp(entry->name, name) == 0) + { + DBG("Located module %s\n", name); DBGPAUSE(); + return 1; + } + else + { + entry = entry->next; + } + + } + + DBG("Module %s not loaded\n", name); DBGPAUSE(); + return 0; +} + +/* + * lookup symbols in all loaded modules. Thins inludes boot syms due to Symbols.dylib construction + * + */ +unsigned int lookup_all_symbols(const char* name) +{ + symbolList_t* entry = moduleSymbols; + while(entry) + { + if(strcmp(entry->symbol, name) == 0) + { + //DBG("External symbol %s located at 0x%X\n", name, entry->addr); + return entry->addr; + } + else + { + entry = entry->next; + } + } + +#if CONFIG_MODULE_DEBUG + printf("Unable to locate symbol %s\n", name); + getchar(); +#endif + + if(strcmp(name, VOID_SYMBOL) == 0) return 0xFFFFFFFF; + // In the event that a symbol does not exist + // Return a pointer to a void function. + else return lookup_all_symbols(VOID_SYMBOL); +} + +/********************************************************************************/ +/* Macho Parser */ +/********************************************************************************/ + +/* + * Parse through a macho module. The module will be rebased and binded + * as specified in the macho header. If the module is sucessfuly laoded + * the module iinit address will be returned. + * NOTE; all dependecies will be loaded before this module is started + * NOTE: If the module is unable to load ot completeion, the modules + * symbols will still be available. + */ +void* parse_mach(void* binary, + int(*dylib_loader)(char*), + long long(*symbol_handler)(char*, long long, char), + void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address) +) +{ + char is64 = false; + void (*module_start)(void) = NULL; + + // Module info + /*char* moduleName = NULL; + UInt32 moduleVersion = 0; + UInt32 moduleCompat = 0; + */ + // TODO convert all of the structs to a union + struct load_command *loadCommand = NULL; + struct dylib_command* dylibCommand = NULL; + struct dyld_info_command* dyldInfoCommand = NULL; + + struct symtab_command* symtabCommand = NULL; + struct segment_command *segCommand = NULL; + struct segment_command_64 *segCommand64 = NULL; + + //struct dysymtab_command* dysymtabCommand = NULL; + UInt32 binaryIndex = 0; + UInt16 cmd = 0; + + textSection = 0; + textAddress = 0; // reinitialize text location in case it doesn't exist; + + // Parse through the load commands + if(((struct mach_header*)binary)->magic == MH_MAGIC) + { + is64 = false; + binaryIndex += sizeof(struct mach_header); + } + else if(((struct mach_header_64*)binary)->magic == MH_MAGIC_64) + { + // NOTE: modules cannot be 64bit. This is used to parse the kernel and kexts + is64 = true; + binaryIndex += sizeof(struct mach_header_64); + } + else + { + verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic); + return NULL; + } + + + + /*if(((struct mach_header*)binary)->filetype != MH_DYLIB) + { + printf("Module is not a dylib. Unable to load.\n"); + getchar(); + return NULL; // Module is in the incorrect format + }*/ + + while(cmd < ((struct mach_header*)binary)->ncmds) + { + cmd++; + + loadCommand = binary + binaryIndex; + UInt32 cmdSize = loadCommand->cmdsize; + + + switch ((loadCommand->cmd & 0x7FFFFFFF)) + { + case LC_SYMTAB: + symtabCommand = binary + binaryIndex; + break; + + case LC_SEGMENT: // 32bit macho + { + segCommand = binary + binaryIndex; + + UInt32 sectionIndex; + + sectionIndex = sizeof(struct segment_command); + + struct section *sect; + + while(sectionIndex < segCommand->cmdsize) + { + sect = binary + binaryIndex + sectionIndex; + + sectionIndex += sizeof(struct section); + + if(section_handler) section_handler(sect->sectname, segCommand->segname, (void*)sect, sect->offset, sect->addr); + + if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + { + // __TEXT,__text found, save the offset and address for when looking for the calls. + textSection = sect->offset; + textAddress = sect->addr; + } + } + } + break; + case LC_SEGMENT_64: // 64bit macho's + { + segCommand64 = binary + binaryIndex; + UInt32 sectionIndex; + + sectionIndex = sizeof(struct segment_command_64); + + struct section_64 *sect; + + while(sectionIndex < segCommand64->cmdsize) + { + sect = binary + binaryIndex + sectionIndex; + + sectionIndex += sizeof(struct section_64); + + if(section_handler) section_handler(sect->sectname, segCommand64->segname, (void*)sect, sect->offset, sect->addr); + + if((strcmp("__TEXT", segCommand64->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + { + // __TEXT,__text found, save the offset and address for when looking for the calls. + textSection = sect->offset; + textAddress = sect->addr; + } + } + } + break; + + + case LC_LOAD_DYLIB: + case LC_LOAD_WEAK_DYLIB ^ LC_REQ_DYLD: + // Required modules + dylibCommand = binary + binaryIndex; + char* module = binary + binaryIndex + ((UInt32)*((UInt32*)&dylibCommand->dylib.name)); + // Possible enhancments: verify version + // = dylibCommand->dylib.current_version; + // = dylibCommand->dylib.compatibility_version; + if(dylib_loader) + { + char* name = malloc(strlen(module) + strlen(".dylib") + 1); + sprintf(name, "%s.dylib", module); + + if (!dylib_loader(name)) + { + // NOTE: any symbols exported by dep will be replace with the void function + free(name); + } + } + + break; + + case LC_ID_DYLIB: + //dylibCommand = binary + binaryIndex; + /*moduleName = binary + binaryIndex + ((UInt32)*((UInt32*)&dylibCommand->dylib.name)); + moduleVersion = dylibCommand->dylib.current_version; + moduleCompat = dylibCommand->dylib.compatibility_version; + */ + break; + + case LC_DYLD_INFO: + //case LC_DYLD_INFO_ONLY: // compressed info, 10.6+ macho files, already handeled + // Bind and rebase info is stored here + dyldInfoCommand = binary + binaryIndex; + break; + + case LC_DYSYMTAB: + case LC_UUID: + case LC_UNIXTHREAD: + break; + + default: + DBG("Unhandled loadcommand 0x%X\n", loadCommand->cmd & 0x7FFFFFFF); + break; + + } + + binaryIndex += cmdSize; + } + + // bind_macho uses the symbols, if the textAdd does not exist (Symbols.dylib, no code), addresses are static and not relative + module_start = (void*)handle_symtable((UInt32)binary, symtabCommand, symbol_handler, is64); + + if(dyldInfoCommand) + { + // Rebase the module before binding it. + if(dyldInfoCommand->rebase_off) rebase_macho(binary, (char*)dyldInfoCommand->rebase_off, dyldInfoCommand->rebase_size); + // Bind all symbols. + if(dyldInfoCommand->bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->bind_off, dyldInfoCommand->bind_size); + if(dyldInfoCommand->weak_bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->weak_bind_off, dyldInfoCommand->weak_bind_size); + if(dyldInfoCommand->lazy_bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->lazy_bind_off, dyldInfoCommand->lazy_bind_size); + } + + return module_start; + +} + +/* + * parse the symbol table + * Lookup any undefined symbols + */ + +unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, long long(*symbol_handler)(char*, long long, char), char is64) +{ + unsigned int module_start = 0xFFFFFFFF; + UInt32 symbolIndex = 0; + char* symbolString = base + (char*)symtabCommand->stroff; + + if(!is64) + { + struct nlist* symbolEntry = (void*)base + symtabCommand->symoff; + while(symbolIndex < symtabCommand->nsyms) + { + // If the symbol is exported by this module + if(symbolEntry->n_value && + symbol_handler(symbolString + symbolEntry->n_un.n_strx, textAddress ? (long long)base + symbolEntry->n_value : symbolEntry->n_value, is64) != 0xFFFFFFFF) + { + + // Module start located. Start is an alias so don't register it + module_start = textAddress ? base + symbolEntry->n_value : symbolEntry->n_value; + } + + symbolEntry++; + symbolIndex++; // TODO remove + } + } + else + { + struct nlist_64* symbolEntry = (void*)base + symtabCommand->symoff; + // NOTE First entry is *not* correct, but we can ignore it (i'm getting radar:// right now, verify later) + while(symbolIndex < symtabCommand->nsyms) + { + + + // If the symbol is exported by this module + if(symbolEntry->n_value && + symbol_handler(symbolString + symbolEntry->n_un.n_strx, textAddress ? (long long)base + symbolEntry->n_value : symbolEntry->n_value, is64) != 0xFFFFFFFF) + { + + // Module start located. Start is an alias so don't register it + module_start = textAddress ? base + symbolEntry->n_value : symbolEntry->n_value; + } + + symbolEntry++; + symbolIndex++; // TODO remove + } + } + return module_start; +} + +// Based on code from dylibinfo.cpp and ImageLoaderMachOCompressed.cpp +void rebase_macho(void* base, char* rebase_stream, UInt32 size) +{ + rebase_stream += (UInt32)base; + + UInt8 immediate = 0; + UInt8 opcode = 0; + UInt8 type = 0; + UInt32 segmentAddress = 0; + + + UInt32 tmp = 0; + UInt32 tmp2 = 0; + UInt8 bits = 0; + int index = 0; + unsigned int i = 0; + + while(i < size) + { + immediate = rebase_stream[i] & REBASE_IMMEDIATE_MASK; + opcode = rebase_stream[i] & REBASE_OPCODE_MASK; + + + switch(opcode) + { + case REBASE_OPCODE_DONE: + // Rebase complete, reset vars + immediate = 0; + opcode = 0; + type = 0; + segmentAddress = 0; + default: + break; + + + case REBASE_OPCODE_SET_TYPE_IMM: + type = immediate; + break; + + + case REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: + // Locate address to begin rebasing + segmentAddress = 0; + struct segment_command* segCommand = NULL; // NOTE: 32bit only + + unsigned int binIndex = 0; + index = 0; + do + { + segCommand = base + sizeof(struct mach_header) + binIndex; + + + binIndex += segCommand->cmdsize; + index++; + } + while(index <= immediate); + + + segmentAddress = segCommand->fileoff; + + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + segmentAddress += tmp; + break; + + + case REBASE_OPCODE_ADD_ADDR_ULEB: + // Add value to rebase address + tmp = 0; + bits = 0; + do + { + tmp <<= bits; + tmp |= rebase_stream[++i] & 0x7f; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + segmentAddress += tmp; + break; + + case REBASE_OPCODE_ADD_ADDR_IMM_SCALED: + segmentAddress += immediate * sizeof(void*); + break; + + + case REBASE_OPCODE_DO_REBASE_IMM_TIMES: + index = 0; + for (index = 0; index < immediate; ++index) { + rebase_location(base + segmentAddress, (char*)base, type); + segmentAddress += sizeof(void*); + } + break; + + + case REBASE_OPCODE_DO_REBASE_ULEB_TIMES: + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + index = 0; + for (index = 0; index < tmp; ++index) { + //DBG("\tRebasing 0x%X\n", segmentAddress); + rebase_location(base + segmentAddress, (char*)base, type); + segmentAddress += sizeof(void*); + } + break; + + case REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB: + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + rebase_location(base + segmentAddress, (char*)base, type); + + segmentAddress += tmp + sizeof(void*); + break; + + case REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB: + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + + tmp2 = 0; + bits = 0; + do + { + tmp2 |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + index = 0; + for (index = 0; index < tmp; ++index) { + + rebase_location(base + segmentAddress, (char*)base, type); + + segmentAddress += tmp2 + sizeof(void*); + } + break; + } + i++; + } +} + +inline void rebase_location(UInt32* location, char* base, int type) +{ + switch(type) + { + case REBASE_TYPE_POINTER: + case REBASE_TYPE_TEXT_ABSOLUTE32: + *location += (UInt32)base; + break; + + default: + break; + } +} + + +UInt32 read_uleb(UInt8* bind_stream, unsigned int* i) +{ + // Read in offset + UInt32 tmp = 0; + UInt8 bits = 0; + do + { + if(bits < sizeof(UInt32)*8) // hack + { + tmp |= (bind_stream[++(*i)] & 0x7f) << bits; + bits += 7; + } + else + { + ++(*i); + } + } + while(bind_stream[*i] & 0x80); + return tmp; +} + + +// Based on code from dylibinfo.cpp and ImageLoaderMachOCompressed.cpp +// NOTE: this uses 32bit values, and not 64bit values. +// There is a possibility that this could cause issues, +// however the modules are 32 bits, so it shouldn't matter too much +void bind_macho(void* base, UInt8* bind_stream, UInt32 size) +{ + bind_stream += (UInt32)base; + + UInt8 immediate = 0; + UInt8 opcode = 0; + UInt8 type = BIND_TYPE_POINTER; + + UInt32 segmentAddress = 0; + + UInt32 address = 0; + + SInt32 addend = 0; + SInt32 libraryOrdinal = 0; + + const char* symbolName = NULL; + UInt8 symboFlags = 0; + UInt32 symbolAddr = 0xFFFFFFFF; + + // Temperary variables + UInt32 tmp = 0; + UInt32 tmp2 = 0; + UInt32 index = 0; + unsigned int i = 0; + + while(i < size) + { + immediate = bind_stream[i] & BIND_IMMEDIATE_MASK; + opcode = bind_stream[i] & BIND_OPCODE_MASK; + + + switch(opcode) + { + case BIND_OPCODE_DONE: + // reset vars + type = BIND_TYPE_POINTER; + segmentAddress = 0; + address = 0; + addend = 0; + libraryOrdinal = 0; + symbolAddr = 0xFFFFFFFF; + default: + break; + + case BIND_OPCODE_SET_DYLIB_ORDINAL_IMM: + libraryOrdinal = immediate; + break; + + case BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB: + libraryOrdinal = read_uleb(bind_stream, &i); + break; + + case BIND_OPCODE_SET_DYLIB_SPECIAL_IMM: + libraryOrdinal = immediate ? (SInt8)(BIND_OPCODE_MASK | immediate) : immediate; + break; + + case BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: + symboFlags = immediate; + symbolName = (char*)&bind_stream[++i]; + i += strlen((char*)&bind_stream[i]); + + symbolAddr = lookup_all_symbols(symbolName); + break; + + case BIND_OPCODE_SET_TYPE_IMM: + type = immediate; + break; + + case BIND_OPCODE_SET_ADDEND_SLEB: + addend = read_uleb(bind_stream, &i); + if(!(bind_stream[i-1] & 0x40)) addend *= -1; + break; + + case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: + segmentAddress = 0; + + // Locate address + struct segment_command* segCommand = NULL; // NOTE: 32bit only + + unsigned int binIndex = 0; + index = 0; + do + { + segCommand = base + sizeof(struct mach_header) + binIndex; + binIndex += segCommand->cmdsize; + index++; + } + while(index <= immediate); + + segmentAddress = segCommand->fileoff; + + segmentAddress += read_uleb(bind_stream, &i); + break; + + case BIND_OPCODE_ADD_ADDR_ULEB: + segmentAddress += read_uleb(bind_stream, &i); + break; + + case BIND_OPCODE_DO_BIND: + if(symbolAddr != 0xFFFFFFFF) + { + address = segmentAddress + (UInt32)base; + + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + + segmentAddress += sizeof(void*); + break; + + case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: + // Read in offset + tmp = read_uleb(bind_stream, &i); + + if(symbolAddr != 0xFFFFFFFF) + { + address = segmentAddress + (UInt32)base; + + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + + segmentAddress += tmp + sizeof(void*); + + + break; + + case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: + if(symbolAddr != 0xFFFFFFFF) + { + address = segmentAddress + (UInt32)base; + + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + segmentAddress += (immediate * sizeof(void*)) + sizeof(void*); + + + break; + + case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: + tmp = read_uleb(bind_stream, &i); + + tmp2 = read_uleb(bind_stream, &i); + + if(symbolAddr != 0xFFFFFFFF) + { + for(index = 0; index < tmp; index++) + { + + address = segmentAddress + (UInt32)base; + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + segmentAddress += tmp2 + sizeof(void*); + } + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + break; + } + i++; + } +} + + +inline void bind_location(UInt32* location, char* value, UInt32 addend, int type) +{ + // do actual update + char* newValue = value + addend; + + switch (type) { + case BIND_TYPE_POINTER: + case BIND_TYPE_TEXT_ABSOLUTE32: + break; + + case BIND_TYPE_TEXT_PCREL32: + newValue -= ((UInt32)location + 4); + + break; + default: + return; + } + //DBG("Binding 0x%X to 0x%X (was 0x%X)\n", location, newValue, *location); + *location = (UInt32)newValue; +} + +/********************************************************************************/ +/* Module Hook Interface */ +/********************************************************************************/ + +/* +* Locate the symbol for an already loaded function and modify the beginning of +* the function to jump directly to the new one +* example: replace_function("_HelloWorld_start", &replacement_start); +*/ +int replace_function(const char* symbol, void* newAddress) +{ + UInt32* jumpPointer = malloc(sizeof(UInt32*)); + UInt32 addr = lookup_all_symbols(symbol); + + char* binary = (char*)addr; + if(addr != 0xFFFFFFFF) + { + //DBG("Replacing %s to point to 0x%x\n", symbol, newAddress); + *binary++ = 0xFF; // Jump + *binary++ = 0x25; // Long Jump + *((UInt32*)binary) = (UInt32)jumpPointer; + + *jumpPointer = (UInt32)newAddress; + return 1; + } + return 0; +} + + +/* + * execute_hook( const char* name ) + * name - Name of the module hook + * If any callbacks have been registered for this hook + * they will be executed now in the same order that the + * hooks were added. +*/ +int execute_hook(const char* name, void* arg1, void* arg2, void* arg3, void* arg4) +{ + DBG("Attempting to execute hook '%s'\n", name); DBGPAUSE(); + moduleHook_t* hook = hook_exists(name); + + if(hook) + { + // Loop through all callbacks for this module + callbackList_t* callbacks = hook->callbacks; + + while(callbacks) + { + // Execute callback + callbacks->callback(arg1, arg2, arg3, arg4); + callbacks = callbacks->next; + } + DBG("Hook '%s' executed.\n", name); DBGPAUSE(); + return 1; + } + else + { + // Callback for this hook doesn't exist; + DBG("No callbacks for '%s' hook.\n", name); + return 0; + } +} + + + +/* + * register_hook_callback( const char* name, void(*callback)()) + * name - Name of the module hook to attach to. + * callbacks - The funciton pointer that will be called when the + * hook is executed. When registering a new callback name, the callback is added sorted. + * NOTE: the hooks take four void* arguments. + */ +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)) +{ + DBG("Adding callback for '%s' hook.\n", name); DBGPAUSE(); + + moduleHook_t* hook = hook_exists(name); + + if(hook) + { + // append + callbackList_t* newCallback = malloc(sizeof(callbackList_t)); + newCallback->next = hook->callbacks; + hook->callbacks = newCallback; + newCallback->callback = callback; + } + else + { + // create new hook + moduleHook_t* newHook = malloc(sizeof(moduleHook_t)); + newHook->name = name; + newHook->callbacks = malloc(sizeof(callbackList_t)); + newHook->callbacks->callback = callback; + newHook->callbacks->next = NULL; + + newHook->next = moduleCallbacks; + moduleCallbacks = newHook; + + } + +#if CONFIG_MODULE_DEBUG + //print_hook_list(); + //getchar(); +#endif + +} + + +moduleHook_t* hook_exists(const char* name) +{ + moduleHook_t* hooks = moduleCallbacks; + + // look for a hook. If it exists, return the moduleHook_t*, + // If not, return NULL. + while(hooks) + { + if(strcmp(name, hooks->name) == 0) + { + //DBG("Located hook %s\n", name); + return hooks; + } + hooks = hooks->next; + } + //DBG("Hook %s does not exist\n", name); + return NULL; + +} + +#if CONFIG_MODULE_DEBUG +void print_hook_list() +{ + printf("---Hook Table---\n"); + + moduleHook_t* hooks = moduleCallbacks; + while(hooks) + { + printf("Hook: %s\n", hooks->name); + hooks = hooks->next; + } +} + +#endif + +/********************************************************************************/ +/* dyld / Linker Interface */ +/********************************************************************************/ + +void dyld_stub_binder() +{ + printf("ERROR: dyld_stub_binder was called, should have been take care of by the linker.\n"); + getchar(); +} + +#else /* CONFIG_MODULES */ + +int init_module_system() +{ + return 0; +} + +void load_all_modules() +{ + +} + +int execute_hook(const char* name, void* arg1, void* arg2, void* arg3, void* arg4) +{ + return 0; +} + +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)) +{ + printf("WARNING: register_hook_callback is not supported when compiled in.\n"); + pause(); +} + +int replace_function(const char* symbol, void* newAddress) +{ + printf("WARNING: replace_functions is not supported when compiled in.\n"); + pause(); + return 0; +} + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)) +{ + start_function(); +} + +#endif \ No newline at end of file diff --git a/i386/boot2/.svn/text-base/modules.h.svn-base b/i386/boot2/.svn/text-base/modules.h.svn-base new file mode 100644 index 0000000..23292e6 --- /dev/null +++ b/i386/boot2/.svn/text-base/modules.h.svn-base @@ -0,0 +1,122 @@ +/* + * Module Loading functionality + * Copyright 2009 Evan Lojewski. All rights reserved. + * + */ + +#include +#include +#include + + +#ifndef __BOOT_MODULES_H +#define __BOOT_MODULES_H + +#define MODULE_PATH "/Extra/modules/" + +#define SYMBOLS_MODULE "Symbols.dylib" +#define SYMBOLS_AUTHOR "Chameleon" +#define SYMBOLS_DESCRIPTION "Chameleon symbols for linking" +#define SYMBOLS_VERSION 0 +#define SYMBOLS_COMPAT 0 + +#define VOID_SYMBOL "dyld_void_start" + + + +typedef struct symbolList_t +{ + char* symbol; + UInt64 addr; + struct symbolList_t* next; +} symbolList_t; + + +typedef struct callbackList_t +{ + void(*callback)(void*, void*, void*, void*); + struct callbackList_t* next; +} callbackList_t; + +typedef struct moduleHook_t +{ + const char* name; + callbackList_t* callbacks; + struct moduleHook_t* next; +} moduleHook_t; + +typedef struct modulesList_t +{ + const char* name; + const char* author; + const char* description; + UInt32 version; + UInt32 compat; + struct modulesList_t* next; +} moduleList_t; + + + +int init_module_system(); +void load_all_modules(); + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)); + +int load_module(char* module); +int is_module_loaded(const char* name); +void module_loaded(const char* name, const char* author, const char* description, UInt32 version, UInt32 compat); + + + + +/********************************************************************************/ +/* Symbol Functions */ +/********************************************************************************/ +long long add_symbol(char* symbol, long long addr, char is64); +unsigned int lookup_all_symbols(const char* name); + + + +/********************************************************************************/ +/* Macho Parser */ +/********************************************************************************/ +void* parse_mach(void* binary, + int(*dylib_loader)(char*), + long long(*symbol_handler)(char*, long long, char), + void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address) + ); +unsigned int handle_symtable(UInt32 base, + struct symtab_command* symtabCommand, + long long(*symbol_handler)(char*, long long, char), + char is64); +void rebase_macho(void* base, char* rebase_stream, UInt32 size); +inline void rebase_location(UInt32* location, char* base, int type); +void bind_macho(void* base, UInt8* bind_stream, UInt32 size); +inline void bind_location(UInt32* location, char* value, UInt32 addend, int type); + + + + +/********************************************************************************/ +/* Module Interface */ +/********************************************************************************/ +int replace_function(const char* symbol, void* newAddress); +int execute_hook(const char* name, void*, void*, void*, void*); +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)); +moduleHook_t* hook_exists(const char* name); + +#if DEBUG_MODULES +void print_hook_list(); +#endif + +/********************************************************************************/ +/* dyld Interface */ +/********************************************************************************/ +void dyld_stub_binder(); + +#endif /* __BOOT_MODULES_H */ diff --git a/i386/boot2/.svn/text-base/modules_support.s.svn-base b/i386/boot2/.svn/text-base/modules_support.s.svn-base new file mode 100644 index 0000000..22d2bec --- /dev/null +++ b/i386/boot2/.svn/text-base/modules_support.s.svn-base @@ -0,0 +1,10 @@ +#ifdef CONFIG_MODULES +#include + +LABEL(dyld_stub_binder) + jmp _dyld_stub_binder + +LABEL(dyld_void_start) + ret + +#endif \ No newline at end of file diff --git a/i386/boot2/.svn/text-base/multiboot.h.svn-base b/i386/boot2/.svn/text-base/multiboot.h.svn-base new file mode 100644 index 0000000..f948bf6 --- /dev/null +++ b/i386/boot2/.svn/text-base/multiboot.h.svn-base @@ -0,0 +1,203 @@ +/* $NetBSD: multiboot.h,v 1.4 2006/10/25 13:56:16 jmmv Exp $ */ + +/*- + * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Julio M. Merino Vidal. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Modified by David Elliott on 2007/06/27 + - Removed checks for KERNEL define + - Replaced _LOCORE def check with __ASSEMBLER__ def check + - Removed prototypes for C functions we don't have + - Replaced all paddr_t and vaddr_t types with uint32_t and a comment +*/ + +/* --------------------------------------------------------------------- */ + +/* + * Multiboot header structure. + */ +#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 +#define MULTIBOOT_HEADER_MODS_ALIGNED 0x00000001 +#define MULTIBOOT_HEADER_WANT_MEMORY 0x00000002 +#define MULTIBOOT_HEADER_HAS_VBE 0x00000004 +#define MULTIBOOT_HEADER_HAS_ADDR 0x00010000 + +#if !defined(__ASSEMBLER__) +struct multiboot_header { + uint32_t mh_magic; + uint32_t mh_flags; + uint32_t mh_checksum; + + /* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_ADDR. */ + uint32_t mh_header_addr; /* paddr_t */ + uint32_t mh_load_addr; /* paddr_t */ + uint32_t mh_load_end_addr; /* paddr_t */ + uint32_t mh_bss_end_addr; /* paddr_t */ + uint32_t mh_entry_addr; /* paddr_t */ + + /* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_VBE. */ + uint32_t mh_mode_type; + uint32_t mh_width; + uint32_t mh_height; + uint32_t mh_depth; +}; +#endif /* !defined(__ASSEMBLER__) */ + +/* + * Symbols defined in locore.S. + */ +#if !defined(__ASSEMBLER__) +extern struct multiboot_header *Multiboot_Header; +#endif /* !defined(__ASSEMBLER__) */ + +/* --------------------------------------------------------------------- */ + +/* + * Multiboot information structure. + */ +#define MULTIBOOT_INFO_MAGIC 0x2BADB002 +#define MULTIBOOT_INFO_HAS_MEMORY 0x00000001 +#define MULTIBOOT_INFO_HAS_BOOT_DEVICE 0x00000002 +#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004 +#define MULTIBOOT_INFO_HAS_MODS 0x00000008 +#define MULTIBOOT_INFO_HAS_AOUT_SYMS 0x00000010 +#define MULTIBOOT_INFO_HAS_ELF_SYMS 0x00000020 +#define MULTIBOOT_INFO_HAS_MMAP 0x00000040 +#define MULTIBOOT_INFO_HAS_DRIVES 0x00000080 +#define MULTIBOOT_INFO_HAS_CONFIG_TABLE 0x00000100 +#define MULTIBOOT_INFO_HAS_LOADER_NAME 0x00000200 +#define MULTIBOOT_INFO_HAS_APM_TABLE 0x00000400 +#define MULTIBOOT_INFO_HAS_VBE 0x00000800 + +#if !defined(__ASSEMBLER__) +struct multiboot_info { + uint32_t mi_flags; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MEMORY. */ + uint32_t mi_mem_lower; + uint32_t mi_mem_upper; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_BOOT_DEVICE. */ + uint8_t mi_boot_device_part3; + uint8_t mi_boot_device_part2; + uint8_t mi_boot_device_part1; + uint8_t mi_boot_device_drive; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CMDLINE. */ + char * mi_cmdline; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MODS. */ + uint32_t mi_mods_count; + uint32_t mi_mods_addr; /* vaddr_t */ + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_{AOUT,ELF}_SYMS. */ + uint32_t mi_elfshdr_num; + uint32_t mi_elfshdr_size; + uint32_t mi_elfshdr_addr; /* vaddr_t */ + uint32_t mi_elfshdr_shndx; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MMAP. */ + uint32_t mi_mmap_length; + uint32_t mi_mmap_addr; /* vaddr_t */ + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_DRIVES. */ + uint32_t mi_drives_length; + uint32_t mi_drives_addr; /* vaddr_t */ + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CONFIG_TABLE. */ + void * unused_mi_config_table; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_LOADER_NAME. */ + char * mi_loader_name; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_APM. */ + void * unused_mi_apm_table; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_VBE. */ + void * unused_mi_vbe_control_info; + void * unused_mi_vbe_mode_info; + uint32_t unused_mi_vbe_interface_seg; /* paddr_t */ + uint32_t unused_mi_vbe_interface_off; /* paddr_t */ + uint32_t unused_mi_vbe_interface_len; +}; +typedef struct multiboot_info multiboot_info; + +/* --------------------------------------------------------------------- */ + +struct multiboot_module { + uint32_t mm_mod_start; + uint32_t mm_mod_end; + char * mm_string; + uint32_t mm_reserved; +}; +typedef struct multiboot_module multiboot_module; + +/* + * Drive information. This describes an entry in the drives table as + * pointed to by mi_drives_addr. + */ +struct multiboot_drive { + uint32_t md_length; + uint8_t md_number; + uint8_t md_mode; + uint16_t md_cylinders; + uint8_t md_heads; + uint8_t md_sectors; + + /* The variable-sized 'ports' field comes here, so this structure + * can be longer. */ +}; + +/* --------------------------------------------------------------------- */ + +/* + * Memory mapping. This describes an entry in the memory mappings table + * as pointed to by mi_mmap_addr. + * + * Be aware that mm_size specifies the size of all other fields *except* + * for mm_size. In order to jump between two different entries, you + * have to count mm_size + 4 bytes. + */ +struct multiboot_mmap { + uint32_t mm_size; + uint64_t mm_base_addr; + uint64_t mm_length; + uint32_t mm_type; +}; + +#endif /* !defined(__ASSEMBLER__) */ + +/* --------------------------------------------------------------------- */ + diff --git a/i386/boot2/.svn/text-base/options.c.svn-base b/i386/boot2/.svn/text-base/options.c.svn-base new file mode 100644 index 0000000..472085d --- /dev/null +++ b/i386/boot2/.svn/text-base/options.c.svn-base @@ -0,0 +1,1534 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2004 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "boot.h" +#include "bootstruct.h" +#include "fdisk.h" +#include "ramdisk.h" +#include "gui.h" +#include "term.h" +#include "embedded.h" +#include "pci.h" +#include "modules.h" + +bool showBootBanner = true; //Azi:showinfo +static bool shouldboot = false; + +extern int multiboot_timeout; +extern int multiboot_timeout_set; + +extern BVRef bvChain; +//extern int menucount; + +extern int gDeviceCount; + +int selectIndex = 0; +MenuItem * menuItems = NULL; + +enum { + kMenuTopRow = 5, + kMenuMaxItems = 10, + kScreenLastRow = 24 +}; + +//========================================================================== + +typedef struct { + int x; + int y; + int type; +} CursorState; + +static void changeCursor( int col, int row, int type, CursorState * cs ) +{ + if (cs) getCursorPositionAndType( &cs->x, &cs->y, &cs->type ); + setCursorType( type ); + setCursorPosition( col, row, 0 ); +} + +static void moveCursor( int col, int row ) +{ + setCursorPosition( col, row, 0 ); +} + +static void restoreCursor( const CursorState * cs ) +{ + setCursorPosition( cs->x, cs->y, 0 ); + setCursorType( cs->type ); +} + +//========================================================================== + +/* Flush keyboard buffer; returns TRUE if any of the flushed + * characters was F8. + */ + +static bool flushKeyboardBuffer(void) +{ + bool status = false; + + while ( readKeyboardStatus() ) { + if (bgetc() == 0x4200) status = true; + } + return status; +} + +//========================================================================== + +static int countdown( const char * msg, int row, int timeout ) +{ + unsigned long time; + int ch = 0; + int col = strlen(msg) + 1; + + flushKeyboardBuffer(); + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + moveCursor( 0, row ); + printf(msg); + + } else { + + position_t p = pos( gui.screen.width / 2 + 1 , ( gui.devicelist.pos.y + 3 ) + ( ( gui.devicelist.height - gui.devicelist.iconspacing ) / 2 ) ); + + char dummy[80]; + getBootVolumeDescription( gBootVolume, dummy, sizeof(dummy) - 1, true ); + drawDeviceIcon( gBootVolume, gui.screen.pixmap, p, true ); + drawStrCenteredAt( (char *) msg, &font_small, gui.screen.pixmap, gui.countdown.pos ); + + // make this screen the new background + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + + } + + int multi_buff = 18 * (timeout); + int multi = ++multi_buff; + + int lasttime=0; + + for ( time = time18(), timeout++; timeout > 0; ) + { + if( time18() > lasttime) + { + multi--; + lasttime=time18(); + } + + if ( (ch = readKeyboardStatus()) ) + break; + + // Count can be interrupted by holding down shift, + // control or alt key + if ( ( readKeyboardShiftFlags() & 0x0F ) != 0 ) + { + ch = 1; + break; + } + + if ( time18() >= time ) + { + time += 18; + timeout--; + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + moveCursor( col, row ); + printf("(%d) ", timeout); + } + } + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) + { + drawProgressBar( gui.screen.pixmap, 100, gui.progressbar.pos , ( multi * 100 / multi_buff ) ); + gui.redraw = true; + updateVRAM(); + } + + } + + flushKeyboardBuffer(); + + return ch; +} + +//========================================================================== + +char gBootArgs[BOOT_STRING_LEN]; +static char * gBootArgsPtr = gBootArgs; +static char * gBootArgsEnd = gBootArgs + BOOT_STRING_LEN - 1; +static char booterCommand[BOOT_STRING_LEN]; +static char booterParam[BOOT_STRING_LEN]; + +static void clearBootArgs(void) +{ + gBootArgsPtr = gBootArgs; + memset(gBootArgs, '\0', BOOT_STRING_LEN); + + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + clearGraphicBootPrompt(); + } + execute_hook("ClearArgs", NULL, NULL, NULL, NULL); +} + +void addBootArg(const char * argStr) +{ + if ( (gBootArgsPtr + strlen(argStr) + 1) < gBootArgsEnd) + { + if(gBootArgsPtr != gBootArgs) *gBootArgsPtr++ = ' '; + strcat(gBootArgs, argStr); + gBootArgsPtr += strlen(argStr); + } +} + +//========================================================================== + +static void showBootPrompt(int row, bool visible) +{ + extern char bootPrompt[]; + extern char bootRescanPrompt[]; + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) { + changeCursor( 0, row, kCursorTypeUnderline, 0 ); + clearScreenRows( row, kScreenLastRow ); + } + + clearBootArgs(); + + if (visible) { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + if (gEnableCDROMRescan) { + printf( bootRescanPrompt ); + } else { + printf( bootPrompt ); + printf( gBootArgs ); + } + } + } else { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + clearGraphicBootPrompt(); + } else { + printf("Press Enter to start up the foreign OS. "); + } + } +} + +//========================================================================== + +static void updateBootArgs( int key ) +{ + key = ASCII_KEY(key); + + switch ( key ) + { + case KEY_BKSP: + if ( gBootArgsPtr > gBootArgs ) + { + *--gBootArgsPtr = '\0'; + + int x, y, t; + getCursorPositionAndType( &x, &y, &t ); + if ( x == 0 && y ) + { + x = 80; y--; + } + if (x) x--; + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + setCursorPosition( x, y, 0 ); + putca(' ', 0x07, 1); + } + else + { + updateGraphicBootPrompt(); + } + } + break; + + default: + if ( key >= ' ' && gBootArgsPtr < gBootArgsEnd) + { + *gBootArgsPtr++ = key; + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) updateGraphicBootPrompt(); + else if ( key >= ' ' && key < 0x7f) putchar(key); + } + + break; + } +} + +//========================================================================== + +static const MenuItem * gMenuItems = NULL; + +static int gMenuItemCount; +static int gMenuRow; +static int gMenuHeight; +static int gMenuTop; +static int gMenuBottom; +static int gMenuSelection; + +static int gMenuStart; +static int gMenuEnd; + +static void printMenuItem( const MenuItem * item, int highlight ) +{ + printf(" "); + + if ( highlight ) + putca(' ', 0x70, strlen(item->name) + 4); + else + putca(' ', 0x07, 40); + + printf(" %40s\n", item->name); +} + +//========================================================================== + +static void showMenu( const MenuItem * items, int count, + int selection, int row, int height ) +{ + int i; + CursorState cursorState; + + if ( items == NULL || count == 0 ) + return; + + // head and tail points to the start and the end of the list. + // top and bottom points to the first and last visible items + // in the menu window. + + gMenuItems = items; + gMenuRow = row; + gMenuHeight = height; + gMenuItemCount = count; + gMenuTop = 0; + gMenuBottom = MIN( count, height ) - 1; + gMenuSelection = selection; + + gMenuStart = 0; + gMenuEnd = MIN( count, gui.maxdevices ) - 1; + + // If the selected item is not visible, shift the list down. + + if ( gMenuSelection > gMenuBottom ) + { + gMenuTop += ( gMenuSelection - gMenuBottom ); + gMenuBottom = gMenuSelection; + } + + if ( gMenuSelection > gMenuEnd ) + { + gMenuStart += ( gMenuSelection - gMenuEnd ); + gMenuEnd = gMenuSelection; + } + + // Draw the visible items. + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) + + drawDeviceList(gMenuStart, gMenuEnd, gMenuSelection); + + else { + + changeCursor( 0, row, kCursorTypeHidden, &cursorState ); + + for ( i = gMenuTop; i <= gMenuBottom; i++ ) + { + printMenuItem( &items[i], (i == gMenuSelection) ); + } + + restoreCursor( &cursorState ); + } +} + +//========================================================================== + +static int updateMenu( int key, void ** paramPtr ) +{ + int moved = 0; + + union { + struct { + unsigned int + selectionUp : 1, + selectionDown : 1, + scrollUp : 1, + scrollDown : 1; + } f; + unsigned int w; + } draw = {{0}}; + + if ( gMenuItems == NULL ) + return 0; + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) + { + int res; + + // set navigation keys for horizontal layout as defaults + int previous = 0x4B00; // left arrow + int subsequent = 0x4D00; // right arrow + int menu = 0x5000; // down arrow + + if ( gui.layout == VerticalLayout ) + { + // set navigation keys for vertical layout + previous = 0x4800; // up arrow + subsequent = 0x5000; // down arrow + menu = 0x4B00; // right arrow + } + + if ( key == previous ) + { + if ( gMenuSelection > gMenuTop ) + draw.f.selectionUp = 1; + else if ( gMenuTop > 0 ) + draw.f.scrollDown = 1; + + } + + else if ( key == subsequent ) + { + if ( gMenuSelection != gMenuBottom) + draw.f.selectionDown = 1; + else if ( gMenuBottom < ( gMenuItemCount - 1 ) ) + draw.f.scrollUp = 1; + } + + else if ( key == menu ) + { + if ( gui.menu.draw ) + updateInfoMenu(key); + else + drawInfoMenu(); + } + + else if ( gui.menu.draw ) + { + res = updateInfoMenu(key); + + if ( res == CLOSE_INFO_MENU ) + gui.menu.draw = false; + else + { + shouldboot = ( res != DO_NOT_BOOT ); + + if ( shouldboot ) + gui.menu.draw = false; + + switch (res) + { + case BOOT_NORMAL: + gVerboseMode = false; + gBootMode = kBootModeNormal; + break; + + case BOOT_VERBOSE: + gVerboseMode = true; + gBootMode = kBootModeNormal; + addBootArg(kVerboseModeFlag); + break; + + case BOOT_IGNORECACHE: + gVerboseMode = false; + gBootMode = kBootModeNormal; + addBootArg(kIgnoreCachesFlag); + break; + + case BOOT_SINGLEUSER: + gVerboseMode = true; + gBootMode = kBootModeNormal; + addBootArg(kSingleUserModeFlag); + break; + } + + } + + } + + } else { + switch ( key ) + { + case 0x4800: // Up Arrow + if ( gMenuSelection != gMenuTop ) + draw.f.selectionUp = 1; + else if ( gMenuTop > 0 ) + draw.f.scrollDown = 1; + break; + + case 0x5000: // Down Arrow + if ( gMenuSelection != gMenuBottom ) + draw.f.selectionDown = 1; + else if ( gMenuBottom < (gMenuItemCount - 1) ) + draw.f.scrollUp = 1; + break; + } + } + + if ( draw.w ) + { + if ( draw.f.scrollUp ) + { + scollPage(0, gMenuRow, 40, gMenuRow + gMenuHeight - 1, 0x07, 1, 1); + gMenuTop++; gMenuBottom++; + gMenuStart++; gMenuEnd++; + draw.f.selectionDown = 1; + } + + if ( draw.f.scrollDown ) + { + scollPage(0, gMenuRow, 40, gMenuRow + gMenuHeight - 1, 0x07, 1, -1); + gMenuTop--; gMenuBottom--; + gMenuStart--; gMenuEnd--; + draw.f.selectionUp = 1; + } + + if ( draw.f.selectionUp || draw.f.selectionDown ) + { + + CursorState cursorState; + + // Set cursor at current position, and clear inverse video. + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + changeCursor( 0, gMenuRow + gMenuSelection - gMenuTop, kCursorTypeHidden, &cursorState ); + printMenuItem( &gMenuItems[gMenuSelection], 0 ); + } + + if ( draw.f.selectionUp ) + { + gMenuSelection--; + if(( gMenuSelection - gMenuStart) == -1 ) + { + gMenuStart--; + gMenuEnd--; + } + + } else { + gMenuSelection++; + if(( gMenuSelection - ( gui.maxdevices - 1) - gMenuStart) > 0 ) + { + gMenuStart++; + gMenuEnd++; + } + } + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + moveCursor( 0, gMenuRow + gMenuSelection - gMenuTop ); + printMenuItem( &gMenuItems[gMenuSelection], 1 ); + restoreCursor( &cursorState ); + + } else + + drawDeviceList (gMenuStart, gMenuEnd, gMenuSelection); + + } + + *paramPtr = gMenuItems[gMenuSelection].param; + moved = 1; + } + + return moved; +} + +//========================================================================== + +static void skipblanks( const char ** cpp ) +{ + while ( **(cpp) == ' ' || **(cpp) == '\t' ) ++(*cpp); +} + +//========================================================================== + +static const char * extractKernelName( char ** cpp ) +{ + char * kn = *cpp; + char * cp = *cpp; + char c; + + // Convert char to lower case. + + c = *cp | 0x20; + + // Must start with a letter or a '/'. + + if ( (c < 'a' || c > 'z') && ( c != '/' ) ) + return 0; + + // Keep consuming characters until we hit a separator. + + while ( *cp && (*cp != '=') && (*cp != ' ') && (*cp != '\t') ) + cp++; + + // Only SPACE or TAB separator is accepted. + // Reject everything else. + + if (*cp == '=') + return 0; + + // Overwrite the separator, and move the pointer past + // the kernel name. + + if (*cp != '\0') *cp++ = '\0'; + *cpp = cp; + + return kn; +} + +//========================================================================== + +static void +printMemoryInfo(void) +{ + int line; + int i; + MemoryRange *mp = bootInfo->memoryMap; + + // Activate and clear page 1 + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition( 0, 0, 1 ); + + printf("BIOS reported memory ranges:\n"); + line = 1; + for (i=0; imemoryMapCount; i++) { + printf("Base 0x%08x%08x, ", + (unsigned long)(mp->base >> 32), + (unsigned long)(mp->base)); + printf("length 0x%08x%08x, type %d\n", + (unsigned long)(mp->length >> 32), + (unsigned long)(mp->length), + mp->type); + if (line++ > 20) { + pause(); + line = 0; + } + mp++; + } + if (line > 0) { + pause(); + } + + setActiveDisplayPage(0); +} + +char *getMemoryInfoString() +{ + int i; + MemoryRange *mp = bootInfo->memoryMap; + char *buff = malloc(sizeof(char)*1024); + if(!buff) return 0; + + char info[] = "BIOS reported memory ranges:\n"; + sprintf(buff, "%s", info); + for (i=0; imemoryMapCount; i++) { + sprintf( buff+strlen(buff), "Base 0x%08x%08x, ", + (unsigned long)(mp->base >> 32), + (unsigned long)(mp->base)); + sprintf( buff+strlen(buff), "length 0x%08x%08x, type %d\n", + (unsigned long)(mp->length >> 32), + (unsigned long)(mp->length), + mp->type); + mp++; + } + return buff; +} + +//========================================================================== + +void lspci(void) +{ + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + } + + dump_pci_dt(root_pci_dev->children); + + pause(); + + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + setActiveDisplayPage(0); + } +} + +//========================================================================== + +int getBootOptions(bool firstRun) +{ + int i; + int key; + int nextRow; + int timeout; + int bvCount; + BVRef bvr; + BVRef menuBVR; + bool showPrompt, newShowPrompt, isCDROM; + + // Initialize default menu selection entry. + gBootVolume = menuBVR = selectBootVolume(bvChain); + + if (biosDevIsCDROM(gBIOSDev)) { + isCDROM = true; + } else { + isCDROM = false; + } + + // ensure we're in graphics mode if gui is setup + if (firstRun && gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE) + { + setVideoMode(GRAPHICS_MODE, 0); + } + + // Clear command line boot arguments + clearBootArgs(); + + // Allow user to override default timeout. + if (multiboot_timeout_set) { + timeout = multiboot_timeout; + } else if (!getIntForKey(kTimeoutKey, &timeout, &bootInfo->chameleonConfig)) { + /* If there is no timeout key in the file use the default timeout + which is different for CDs vs. hard disks. However, if not booting + a CD and no config file could be loaded set the timeout + to zero which causes the menu to display immediately. + This way, if no partitions can be found, that is the disk is unpartitioned + or simply cannot be read) then an empty menu is displayed. + If some partitions are found, for example a Windows partition, then + these will be displayed in the menu as foreign partitions. + */ + if (isCDROM) { + timeout = kCDBootTimeout; + } else { + timeout = sysConfigValid ? kBootTimeout : 0; + } + } + + if (timeout < 0) { + gBootMode |= kBootModeQuiet; + } + + // If the user is holding down a modifier key, enter safe mode. + if ((readKeyboardShiftFlags() & 0x0F) != 0) { + gBootMode |= kBootModeSafe; + } + + // Checking user pressed keys + bool f8press = false, spress = false, vpress = false; + while (readKeyboardStatus()) { + key = bgetc (); + if (key == 0x4200) f8press = true; + if ((key & 0xff) == 's' || (key & 0xff) == 'S') spress = true; + if ((key & 0xff) == 'v' || (key & 0xff) == 'V') vpress = true; + } + // If user typed F8, abort quiet mode, and display the menu. + if (f8press) { + gBootMode &= ~kBootModeQuiet; + timeout = 0; + } + // If user typed 'v' or 'V', boot in verbose mode. + if ((gBootMode & kBootModeQuiet) && firstRun && vpress) { + addBootArg(kVerboseModeFlag); + } + // If user typed 's' or 'S', boot in single user mode. + if ((gBootMode & kBootModeQuiet) && firstRun && spress) { + addBootArg(kSingleUserModeFlag); + } + + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + setCursorPosition(0, 0, 0); + clearScreenRows(0, kScreenLastRow); + if (!(gBootMode & kBootModeQuiet)) { + // Display banner and show hardware info. + printf(bootBanner, (bootInfo->convmem + bootInfo->extmem) / 1024); + printf(getVBEInfoString()); + } + changeCursor(0, kMenuTopRow, kCursorTypeUnderline, 0); + verbose("Scanning device %x...", gBIOSDev); + } + + // When booting from CD, default to hard drive boot when possible. + if (isCDROM && firstRun) { + const char *val; + char *prompt = NULL; + char *name = NULL; + int cnt; + int optionKey; + + if (getValueForKey(kCDROMPromptKey, &val, &cnt, &bootInfo->chameleonConfig)) { + prompt = malloc(cnt + 1); + strncat(prompt, val, cnt); + } else { + name = malloc(80); + getBootVolumeDescription(gBootVolume, name, 79, false); + prompt = malloc(256); + sprintf(prompt, "Press any key to start up from %s, or press F8 to enter startup options.", name); + free(name); + } + + if (getIntForKey( kCDROMOptionKey, &optionKey, &bootInfo->chameleonConfig )) { + // The key specified is a special key. + } else { + // Default to F8. + optionKey = 0x4200; + } + + // If the timeout is zero then it must have been set above due to the + // early catch of F8 which means the user wants to set boot options + // which we ought to interpret as meaning he wants to boot the CD. + if (timeout != 0) { + key = countdown(prompt, kMenuTopRow, timeout); + } else { + key = optionKey; + } + + if (prompt != NULL) { + free(prompt); + } + + clearScreenRows( kMenuTopRow, kMenuTopRow + 2 ); + + // Hit the option key ? + if (key == optionKey) { + gBootMode &= ~kBootModeQuiet; + timeout = 0; + } else { + key = key & 0xFF; + + // Try booting hard disk if user pressed 'h' + if (biosDevIsCDROM(gBIOSDev) && key == 'h') { + BVRef bvr; + + // Look at partitions hosting OS X other than the CD-ROM + for (bvr = bvChain; bvr; bvr=bvr->next) { + if ((bvr->flags & kBVFlagSystemVolume) && bvr->biosdev != gBIOSDev) { + gBootVolume = bvr; + } + } + } + goto done; + } + } + + if (gBootMode & kBootModeQuiet) { + // No input allowed from user. + goto done; + } + + if (firstRun && timeout > 0 && countdown("Press any key to enter startup options.", kMenuTopRow, timeout) == 0) { + // If the user is holding down a modifier key, + // enter safe mode. + if ((readKeyboardShiftFlags() & 0x0F) != 0) { + gBootMode |= kBootModeSafe; + } + goto done; + } + + if (gDeviceCount >0) { + // Allocate memory for an array of menu items. + menuItems = malloc(sizeof(MenuItem) * gDeviceCount); + if (menuItems == NULL) { + goto done; + } + + // Associate a menu item for each BVRef. + for (bvr=bvChain, i=gDeviceCount-1, selectIndex=-1; bvr; bvr=bvr->next) { + if (bvr->visible) { + getBootVolumeDescription(bvr, menuItems[i].name, sizeof(menuItems[i].name) - 1, true); + menuItems[i].param = (void *) bvr; + if (bvr == menuBVR) { + selectIndex = i; + } + i--; + } + } + // Jief : In case the default partition (returned by selectBootVolume) is not in the menu + if ( selectIndex == -1 ) + { + selectIndex = 0; + + // gDeviceCount is actually > 0, so menuItems[selectIndex] exists + menuBVR = (BVRef)(menuItems[selectIndex].param); + // what happen is bvChain is empty ? + } + } + + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + // redraw the background buffer + gui.logo.draw = true; + drawBackground(); + gui.devicelist.draw = true; + gui.redraw = true; + if (!(gBootMode & kBootModeQuiet)) { + + // Check if "Boot Banner"=N switch is present in config file. + getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->chameleonConfig); + if (showBootBanner) { + // Display banner and show hardware info. + gprintf(&gui.screen, bootBanner + 1, (bootInfo->convmem + bootInfo->extmem) / 1024); + } + + // redraw background + memcpy(gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4); + } + } else { + // Clear screen and hide the blinking cursor. + clearScreenRows(kMenuTopRow, kMenuTopRow + 2); + changeCursor(0, kMenuTopRow, kCursorTypeHidden, 0); + } + + nextRow = kMenuTopRow; + showPrompt = true; + + if (gDeviceCount) { + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) { + printf("Use \30\31 keys to select the startup volume."); + } + showMenu( menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems ); + nextRow += MIN( gDeviceCount, kMenuMaxItems ) + 3; + } + + // Show the boot prompt. + showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); + showBootPrompt( nextRow, showPrompt ); + + do { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + // redraw background + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + // reset cursor co-ords + gui.debug.cursor = pos( gui.screen.width - 160 , 10 ); + } + key = getchar(); + updateMenu( key, (void **) &menuBVR ); + newShowPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); + + if (newShowPrompt != showPrompt) { + showPrompt = newShowPrompt; + showBootPrompt( nextRow, showPrompt ); + } + + if (showPrompt) { + updateBootArgs(key); + } + + switch (key) { + case KEY_ENTER: + if (gui.menu.draw) { + key=0; + break; + } + if (*gBootArgs == '?') { + char * argPtr = gBootArgs; + + // Skip the leading "?" character. + argPtr++; + getNextArg(&argPtr, booterCommand); + getNextArg(&argPtr, booterParam); + + /* + * TODO: this needs to be refactored. + */ + if (strcmp( booterCommand, "video" ) == 0) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + showInfoBox(getVBEInfoString(), getVBEModeInfoString()); + } else { + printVBEModeInfo(); + } + } else if ( strcmp( booterCommand, "memory" ) == 0) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE ) { + showInfoBox("Memory Map", getMemoryInfoString()); + } else { + printMemoryInfo(); + } + } else if (strcmp(booterCommand, "lspci") == 0) { + lspci(); + } else if (strcmp(booterCommand, "more") == 0) { + showTextFile(booterParam); + } else if (strcmp(booterCommand, "rd") == 0) { + processRAMDiskCommand(&argPtr, booterParam); + } else if (strcmp(booterCommand, "norescan") == 0) { + if (gEnableCDROMRescan) { + gEnableCDROMRescan = false; + break; + } + } else { + showHelp(); + } + key = 0; + showBootPrompt(nextRow, showPrompt); + break; + } + gBootVolume = menuBVR; + setRootVolume(menuBVR); + gBIOSDev = menuBVR->biosdev; + break; + + case KEY_ESC: + clearBootArgs(); + break; + + case KEY_F5: + // New behavior: + // Clear gBootVolume to restart the loop + // if the user enabled rescanning the optical drive. + // Otherwise boot the default boot volume. + if (gEnableCDROMRescan) { + gBootVolume = NULL; + clearBootArgs(); + } + break; + + case KEY_F10: + gScanSingleDrive = false; + scanDisks(gBIOSDev, &bvCount); + gBootVolume = NULL; + clearBootArgs(); + break; + + case KEY_TAB: + // New behavior: + // Switch between text & graphic interfaces + // Only Permitted if started in graphics interface + if (useGUI) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + setVideoMode(VGA_TEXT_MODE, 0); + + setCursorPosition(0, 0, 0); + clearScreenRows(0, kScreenLastRow); + + // Display banner and show hardware info. + printf(bootBanner, (bootInfo->convmem + bootInfo->extmem) / 1024); + printf(getVBEInfoString()); + + clearScreenRows(kMenuTopRow, kMenuTopRow + 2); + changeCursor(0, kMenuTopRow, kCursorTypeHidden, 0); + + nextRow = kMenuTopRow; + showPrompt = true; + + if (gDeviceCount) { + printf("Use \30\31 keys to select the startup volume."); + showMenu(menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems); + nextRow += MIN(gDeviceCount, kMenuMaxItems) + 3; + } + + showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); + showBootPrompt(nextRow, showPrompt); + //changeCursor( 0, kMenuTopRow, kCursorTypeUnderline, 0 ); + } else { + gui.redraw = true; + setVideoMode(GRAPHICS_MODE, 0); + updateVRAM(); + updateGraphicBootPrompt(); + } + } + key = 0; + break; + + default: + key = 0; + break; + } + } while (0 == key); + +done: + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + clearScreenRows(kMenuTopRow, kScreenLastRow); + changeCursor(0, kMenuTopRow, kCursorTypeUnderline, 0); + } + shouldboot = false; + gui.menu.draw = false; + if (menuItems) { + free(menuItems); + menuItems = NULL; + } +// The next line if uncommented will write the command line boot options to nvram +// execute_hook("BootOptions", gBootArgs, gBootArgsPtr, NULL, NULL); + return 0; +} + +//========================================================================== + +char gBootUUIDString[32+4+1] = ""; // UUID of the boot volume e.g. 5EB1869F-C4FA-3502-BDEB-3B8ED5D87292 +extern unsigned char chainbootdev; +extern unsigned char chainbootflag; + +bool copyArgument(const char *argName, const char *val, int cnt, char **argP, int *cntRemainingP) +{ + int argLen = argName ? strlen(argName) : 0; + int len = argLen + cnt + 1; // +1 to account for space + + if (argName) + len++; // +1 to account for '=' + + if (len > *cntRemainingP) { + error("Warning: boot arguments too long, truncating\n"); + return false; + } + + if (argName) { + strncpy( *argP, argName, argLen ); + *argP += argLen; + *argP[0] = '='; + (*argP)++; + } + + strncpy( *argP, val, cnt ); + *argP += cnt; + *argP[0] = ' '; + (*argP)++; + + *cntRemainingP -= len; + return true; +} + +// +// Returns TRUE if an argument was copied, FALSE otherwise +bool +processBootArgument( + const char *argName, // The argument to search for + const char *userString, // Typed-in boot arguments + const char *kernelFlags, // Kernel flags from config table + const char *configTable, + char **argP, // Output value + int *cntRemainingP, // Output count + char *foundVal, // found value + int foundValSize // max found value size + ) +{ + const char *val; + int cnt; + bool found = false; + + if (getValueForBootKey(userString, argName, &val, &cnt)) { + // Don't copy; these values will be copied at the end of argument processing. + found = true; + } else if (getValueForBootKey(kernelFlags, argName, &val, &cnt)) { + // Don't copy; these values will be copied at the end of argument processing. + found = true; + } else if (getValueForKey(argName, &val, &cnt, &bootInfo->chameleonConfig)) { + copyArgument(argName, val, cnt, argP, cntRemainingP); + found = true; + } + if (found && foundVal) + strlcpy(foundVal, val, foundValSize); + return found; +} + +// Maximum config table value size +#define VALUE_SIZE 2048 + +int +processBootOptions() +{ + const char *cp = gBootArgs; + const char *val = 0; + const char *kernel; + int cnt; + int userCnt; + int cntRemaining; + char *argP; + char *configKernelFlags; + char *valueBuffer; + + valueBuffer = malloc(VALUE_SIZE); + + skipblanks( &cp ); + + // Update the unit and partition number. + + if ( gBootVolume ) + { + if (!( gBootVolume->flags & kBVFlagNativeBoot )) + { + readBootSector( gBootVolume->biosdev, gBootVolume->part_boff, + (void *) 0x7c00 ); + + // + // Setup edx, and signal intention to chain load the + // foreign booter. + // + + chainbootdev = gBootVolume->biosdev; + chainbootflag = 1; + + return 1; + } + + setRootVolume(gBootVolume); + + } + // If no boot volume fail immediately because we're just going to fail + // trying to load the config file anyway. + else + return -1; + + // Load config table specified by the user, or use the default. + + if (!getValueForBootKey(cp, "config", &val, &cnt)) { + val = 0; + cnt = 0; + } + + // Load com.apple.Boot.plist from the selected volume + // and use its contents to override default bootConfig. + + loadSystemConfig(&bootInfo->bootConfig); + loadChameleonConfig(&bootInfo->chameleonConfig); + + // Use the kernel name specified by the user, or fetch the name + // in the config table, or use the default if not specified. + // Specifying a kernel name on the command line, or specifying + // a non-default kernel name in the config file counts as + // overriding the kernel, which causes the kernelcache not + // to be used. + + gOverrideKernel = false; + if (( kernel = extractKernelName((char **)&cp) )) { + strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) ); + } else { + if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) { + strlcpy( bootInfo->bootFile, val, cnt+1 ); + } else { + strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) ); + } + } + if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) { + gOverrideKernel = true; + } + + cntRemaining = BOOT_STRING_LEN - 2; // save 1 for NULL, 1 for space + argP = bootArgs->CommandLine; + + // Get config kernel flags, if not ignored. + if (getValueForBootKey(cp, kIgnoreBootFileFlag, &val, &cnt) || + !getValueForKey( kKernelFlagsKey, &val, &cnt, &bootInfo->bootConfig )) { + val = ""; + cnt = 0; + } + configKernelFlags = malloc(cnt + 1); + strlcpy(configKernelFlags, val, cnt + 1); + + // boot-uuid can be set either on the command-line or in the config file + if (!processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config, + &argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString))) { + // + // Try an alternate method for getting the root UUID on boot helper partitions. + // + if (gBootVolume->flags & kBVFlagBooter) + { + // Load the configuration store in the boot helper partition + if (loadHelperConfig(&bootInfo->helperConfig) == 0) + { + val = getStringForKey(kHelperRootUUIDKey, &bootInfo->helperConfig); + if (val != NULL) + strlcpy(gBootUUIDString, val, sizeof(gBootUUIDString)); + } + } + + // Try to get the volume uuid string + if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) + gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString); + + // If we have the volume uuid add it to the commandline arguments + if (strlen(gBootUUIDString)) + copyArgument(kBootUUIDKey, gBootUUIDString, strlen(gBootUUIDString), &argP, &cntRemaining); + } + + if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, + &argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) { + cnt = 0; + if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) { + valueBuffer[0] = '*'; + cnt++; + strlcpy(valueBuffer + 1, val, cnt); + val = valueBuffer; + } else { + if (strlen(gBootUUIDString)) { + val = "*uuid"; + cnt = 5; + } else { + // Don't set "rd=.." if there is no boot device key + // and no UUID. + val = ""; + cnt = 0; + } + } + if (cnt > 0) { + copyArgument( kRootDeviceKey, val, cnt, &argP, &cntRemaining); + } + strlcpy( gRootDevice, val, (cnt + 1)); + } + + /* + * Removed. We don't need this anymore. + * + if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config, + &argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) { + getPlatformName(gPlatformName); + copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining); + } + */ + + if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) && + !getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt)) { + if (gBootMode & kBootModeSafe) { + copyArgument(0, kSafeModeFlag, strlen(kSafeModeFlag), &argP, &cntRemaining); + } + } + + // Store the merged kernel flags and boot args. + + cnt = strlen(configKernelFlags); + if (cnt) { + if (cnt > cntRemaining) { + error("Warning: boot arguments too long, truncating\n"); + cnt = cntRemaining; + } + strncpy(argP, configKernelFlags, cnt); + argP[cnt++] = ' '; + cntRemaining -= cnt; + } + userCnt = strlen(cp); + if (userCnt > cntRemaining) { + error("Warning: boot arguments too long, truncating\n"); + userCnt = cntRemaining; + } + strncpy(&argP[cnt], cp, userCnt); + argP[cnt+userCnt] = '\0'; + + if(!shouldboot) + { + gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) || + getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->chameleonConfig ); + + gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) ? + kBootModeSafe : kBootModeNormal; + + if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) { + gBootMode = kBootModeSafe; + } + } + + if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) + strlcpy(gMKextName, val, cnt + 1); + else + gMKextName[0]=0; + + free(configKernelFlags); + free(valueBuffer); + + return 0; +} + + +//========================================================================== +// Load the help file and display the file contents on the screen. + +void showTextBuffer(char *buf_orig, int size) +{ + char *bp; + char* buf; + int line; + int line_offset; + int c; + + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + showInfoBox( "Press q to continue, space for next page.\n",buf_orig ); + return; + } + + // Create a copy so that we don't mangle the original + buf = malloc(size + 1); + memcpy(buf, buf_orig, size); + + + bp = buf; + while (size-- > 0) { + if (*bp == '\n') { + *bp = '\0'; + } + bp++; + } + *bp = '\1'; + line_offset = 0; + + setActiveDisplayPage(1); + + while (1) { + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + bp = buf; + for (line = 0; *bp != '\1' && line < line_offset; line++) { + while (*bp != '\0') { + bp++; + } + bp++; + } + for (line = 0; *bp != '\1' && line < 23; line++) { + setCursorPosition(0, line, 1); + printf("%s\n", bp); + while (*bp != '\0') { + bp++; + } + bp++; + } + + setCursorPosition(0, 23, 1); + if (*bp == '\1') { + printf("[Type %sq or space to quit viewer]", (line_offset > 0) ? "p for previous page, " : ""); + } else { + printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); + } + + c = getchar(); + if (c == 'q' || c == 'Q') { + break; + } + if ((c == 'p' || c == 'P') && line_offset > 0) { + line_offset -= 23; + } + if (c == ' ') { + if (*bp == '\1') { + break; + } else { + line_offset += 23; + } + } + } + setActiveDisplayPage(0); +} + +void showHelp(void) +{ + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + showInfoBox("Help. Press q to quit.\n", (char *)BootHelp_txt); + } else { + showTextBuffer((char *)BootHelp_txt, BootHelp_txt_len); + } +} + +void showTextFile(const char * filename) +{ +#define MAX_TEXT_FILE_SIZE 65536 + char *buf; + int fd; + int size; + + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) { + printf("\nFile not found: %s\n", filename); + sleep(2); + return; + } + + size = file_size(fd); + if (size > MAX_TEXT_FILE_SIZE) { + size = MAX_TEXT_FILE_SIZE; + } + buf = malloc(size); + read(fd, buf, size); + close(fd); + showTextBuffer(buf, size); + free(buf); +} + +// This is a very simplistic prompting scheme that just grabs two hex characters +// Eventually we need to do something more user-friendly like display a menu +// based off of the Multiboot device list + +int selectAlternateBootDevice(int bootdevice) +{ + int key; + int newbootdevice; + int digitsI = 0; + char *end; + char digits[3] = {0,0,0}; + + // We've already printed the current boot device so user knows what it is + printf("Typical boot devices are 80 (First HD), 81 (Second HD)\n"); + printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice); + do { + key = getchar(); + switch (ASCII_KEY(key)) { + case KEY_BKSP: + if (digitsI > 0) { + int x, y, t; + getCursorPositionAndType(&x, &y, &t); + // Assume x is not 0; + x--; + setCursorPosition(x,y,0); // back up one char + // Overwrite with space without moving cursor position + putca(' ', 0x07, 1); + digitsI--; + } else { + // TODO: Beep or something + } + break; + + case KEY_ENTER: + digits[digitsI] = '\0'; + newbootdevice = strtol(digits, &end, 16); + if (end == digits && *end == '\0') { + // User entered empty string + printf("\nUsing default boot device %x\n", bootdevice); + key = 0; + } else if(end != digits && *end == '\0') { + bootdevice = newbootdevice; + printf("\n"); + key = 0; // We gots da boot device + } else { + printf("\nCouldn't parse. try again: "); + digitsI = 0; + } + break; + + default: + if (isxdigit(ASCII_KEY(key)) && digitsI < 2) { + putchar(ASCII_KEY(key)); + digits[digitsI++] = ASCII_KEY(key); + } else { + // TODO: Beep or something + } + break; + }; + } while (key != 0); + + return bootdevice; +} + +bool promptForRescanOption(void) +{ + printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n"); + if (getchar() == KEY_ENTER) { + return true; + } else { + return false; + } +} diff --git a/i386/boot2/.svn/text-base/picopng.c.svn-base b/i386/boot2/.svn/text-base/picopng.c.svn-base new file mode 100644 index 0000000..6a6392b --- /dev/null +++ b/i386/boot2/.svn/text-base/picopng.c.svn-base @@ -0,0 +1,1151 @@ +// picoPNG version 20080503 (cleaned up and ported to c by kaitek) +// Copyright (c) 2005-2008 Lode Vandevenne +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +#include +#include "libsa.h" +#include "picopng.h" + +/*************************************************************************************************/ + +typedef struct png_alloc_node { + struct png_alloc_node *prev, *next; + void *addr; + size_t size; +} png_alloc_node_t; + +png_alloc_node_t *png_alloc_head = NULL; +png_alloc_node_t *png_alloc_tail = NULL; + +png_alloc_node_t *png_alloc_find_node(void *addr) +{ + png_alloc_node_t *node; + for (node = png_alloc_head; node; node = node->next) + if (node->addr == addr) + break; + return node; +} + +void png_alloc_add_node(void *addr, size_t size) +{ + png_alloc_node_t *node; + if (png_alloc_find_node(addr)) + return; + node = malloc(sizeof (png_alloc_node_t)); + node->addr = addr; + node->size = size; + node->prev = png_alloc_tail; + node->next = NULL; + png_alloc_tail = node; + if (node->prev) + node->prev->next = node; + if (!png_alloc_head) + png_alloc_head = node; +} + +void png_alloc_remove_node(png_alloc_node_t *node) +{ + if (node->prev) + node->prev->next = node->next; + if (node->next) + node->next->prev = node->prev; + if (node == png_alloc_head) + png_alloc_head = node->next; + if (node == png_alloc_tail) + png_alloc_tail = node->prev; + node->prev = node->next = node->addr = NULL; + free(node); +} + +void *png_alloc_malloc(size_t size) +{ + void *addr = malloc(size); + png_alloc_add_node(addr, size); + return addr; +} + +void *png_alloc_realloc(void *addr, size_t size) +{ + void *new_addr; + if (!addr) + return png_alloc_malloc(size); + new_addr = realloc(addr, size); + if (new_addr != addr) { + png_alloc_node_t *old_node; + old_node = png_alloc_find_node(addr); + png_alloc_remove_node(old_node); + png_alloc_add_node(new_addr, size); + } + return new_addr; +} + +void png_alloc_free(void *addr) +{ + png_alloc_node_t *node = png_alloc_find_node(addr); + if (!node) + return; + png_alloc_remove_node(node); + free(addr); +} + +void png_alloc_free_all() +{ + while (png_alloc_tail) { + void *addr = png_alloc_tail->addr; + png_alloc_remove_node(png_alloc_tail); + free(addr); + } +} + +/*************************************************************************************************/ + +__unused void vector32_cleanup(vector32_t *p) +{ + p->size = p->allocsize = 0; + if (p->data) + png_alloc_free(p->data); + p->data = NULL; +} + +uint32_t vector32_resize(vector32_t *p, size_t size) +{ // returns 1 if success, 0 if failure ==> nothing done + if (size * sizeof (uint32_t) > p->allocsize) { + size_t newsize = size * sizeof (uint32_t) * 2; + void *data = png_alloc_realloc(p->data, newsize); + if (data) { + p->allocsize = newsize; + p->data = (uint32_t *) data; + p->size = size; + } else + return 0; + } else + p->size = size; + return 1; +} + +uint32_t vector32_resizev(vector32_t *p, size_t size, uint32_t value) +{ // resize and give all new elements the value + size_t oldsize = p->size, i; + if (!vector32_resize(p, size)) + return 0; + for (i = oldsize; i < size; i++) + p->data[i] = value; + return 1; +} + +void vector32_init(vector32_t *p) +{ + p->data = NULL; + p->size = p->allocsize = 0; +} + +vector32_t *vector32_new(size_t size, uint32_t value) +{ + vector32_t *p = png_alloc_malloc(sizeof (vector32_t)); + vector32_init(p); + if (size && !vector32_resizev(p, size, value)) + return NULL; + return p; +} + +/*************************************************************************************************/ + +__unused void vector8_cleanup(vector8_t *p) +{ + p->size = p->allocsize = 0; + if (p->data) + png_alloc_free(p->data); + p->data = NULL; +} + +uint32_t vector8_resize(vector8_t *p, size_t size) +{ // returns 1 if success, 0 if failure ==> nothing done + // xxx: the use of sizeof uint32_t here seems like a bug (this descends from the lodepng vector + // compatibility functions which do the same). without this there is corruption in certain cases, + // so this was probably done to cover up allocation bug(s) in the original picopng code! + if (size * sizeof (uint32_t) > p->allocsize) { + size_t newsize = size * sizeof (uint32_t) * 2; + void *data = png_alloc_realloc(p->data, newsize); + if (data) { + p->allocsize = newsize; + p->data = (uint8_t *) data; + p->size = size; + } else + return 0; // error: not enough memory + } else + p->size = size; + return 1; +} + +uint32_t vector8_resizev(vector8_t *p, size_t size, uint8_t value) +{ // resize and give all new elements the value + size_t oldsize = p->size, i; + if (!vector8_resize(p, size)) + return 0; + for (i = oldsize; i < size; i++) + p->data[i] = value; + return 1; +} + +void vector8_init(vector8_t *p) +{ + p->data = NULL; + p->size = p->allocsize = 0; +} + +vector8_t *vector8_new(size_t size, uint8_t value) +{ + vector8_t *p = png_alloc_malloc(sizeof (vector8_t)); + vector8_init(p); + if (size && !vector8_resizev(p, size, value)) + return NULL; + return p; +} + +vector8_t *vector8_copy(vector8_t *p) +{ + vector8_t *q = vector8_new(p->size, 0); + uint32_t n; + for (n = 0; n < q->size; n++) + q->data[n] = p->data[n]; + return q; +} + +/*************************************************************************************************/ + +const uint32_t LENBASE[29] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, + 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; +const uint32_t LENEXTRA[29] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, + 4, 5, 5, 5, 5, 0 }; +const uint32_t DISTBASE[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, + 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; +const uint32_t DISTEXTRA[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, + 10, 10, 11, 11, 12, 12, 13, 13 }; +// code length code lengths +const uint32_t CLCL[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + +/*************************************************************************************************/ + +typedef struct { + // 2D representation of a huffman tree: The one dimension is "0" or "1", the other contains all + // nodes and leaves of the tree. + vector32_t *tree2d; +} HuffmanTree; + +HuffmanTree *HuffmanTree_new() +{ + HuffmanTree *tree = png_alloc_malloc(sizeof (HuffmanTree)); + tree->tree2d = NULL; + return tree; +} + +int HuffmanTree_makeFromLengths(HuffmanTree *tree, const vector32_t *bitlen, uint32_t maxbitlen) +{ // make tree given the lengths + uint32_t bits, n, i; + uint32_t numcodes = (uint32_t) bitlen->size, treepos = 0, nodefilled = 0; + vector32_t *tree1d, *blcount, *nextcode; + tree1d = vector32_new(numcodes, 0); + blcount = vector32_new(maxbitlen + 1, 0); + nextcode = vector32_new(maxbitlen + 1, 0); + for (bits = 0; bits < numcodes; bits++) + blcount->data[bitlen->data[bits]]++; // count number of instances of each code length + for (bits = 1; bits <= maxbitlen; bits++) + nextcode->data[bits] = (nextcode->data[bits - 1] + blcount->data[bits - 1]) << 1; + for (n = 0; n < numcodes; n++) + if (bitlen->data[n] != 0) + tree1d->data[n] = nextcode->data[bitlen->data[n]]++; // generate all the codes + // 0x7fff here means the tree2d isn't filled there yet + vector32_t *tree2d = vector32_new(numcodes * 2, 0x7fff); + tree->tree2d = tree2d; + for (n = 0; n < numcodes; n++) // the codes + for (i = 0; i < bitlen->data[n]; i++) { // the bits for this code + uint32_t bit = (tree1d->data[n] >> (bitlen->data[n] - i - 1)) & 1; + if (treepos > numcodes - 2) + return 55; + if (tree2d->data[2 * treepos + bit] == 0x7fff) { // not yet filled in + if (i + 1 == bitlen->data[n]) { // last bit + tree2d->data[2 * treepos + bit] = n; + treepos = 0; + } else { // addresses are encoded as values > numcodes + tree2d->data[2 * treepos + bit] = ++nodefilled + numcodes; + treepos = nodefilled; + } + } else // subtract numcodes from address to get address value + treepos = tree2d->data[2 * treepos + bit] - numcodes; + } + return 0; +} + +int HuffmanTree_decode(const HuffmanTree *tree, bool *decoded, uint32_t *result, size_t *treepos, + uint32_t bit) +{ // Decodes a symbol from the tree + const vector32_t *tree2d = tree->tree2d; + uint32_t numcodes = (uint32_t) tree2d->size / 2; + if (*treepos >= numcodes) + return 11; // error: you appeared outside the codetree + *result = tree2d->data[2 * (*treepos) + bit]; + *decoded = (*result < numcodes); + *treepos = *decoded ? 0 : *result - numcodes; + return 0; +} + +/*************************************************************************************************/ + +int Inflator_error; + +uint32_t Zlib_readBitFromStream(size_t *bitp, const uint8_t *bits) +{ + uint32_t result = (bits[*bitp >> 3] >> (*bitp & 0x7)) & 1; + (*bitp)++; + return result; +} + +uint32_t Zlib_readBitsFromStream(size_t *bitp, const uint8_t *bits, size_t nbits) +{ + uint32_t i, result = 0; + for (i = 0; i < nbits; i++) + result += (Zlib_readBitFromStream(bitp, bits)) << i; + return result; +} + +void Inflator_generateFixedTrees(HuffmanTree *tree, HuffmanTree *treeD) +{ // get the tree of a deflated block with fixed tree + size_t i; + vector32_t *bitlen, *bitlenD; + bitlen = vector32_new(288, 8); + bitlenD = vector32_new(32, 5); + for (i = 144; i <= 255; i++) + bitlen->data[i] = 9; + for (i = 256; i <= 279; i++) + bitlen->data[i] = 7; + HuffmanTree_makeFromLengths(tree, bitlen, 15); + HuffmanTree_makeFromLengths(treeD, bitlenD, 15); +} + +uint32_t Inflator_huffmanDecodeSymbol(const uint8_t *in, size_t *bp, const HuffmanTree *codetree, + size_t inlength) +{ // decode a single symbol from given list of bits with given code tree. returns the symbol + bool decoded = false; + uint32_t ct = 0; + size_t treepos = 0; + for (;;) { + if ((*bp & 0x07) == 0 && (*bp >> 3) > inlength) { + Inflator_error = 10; // error: end reached without endcode + return 0; + } + Inflator_error = HuffmanTree_decode(codetree, &decoded, &ct, &treepos, + Zlib_readBitFromStream(bp, in)); + if (Inflator_error) + return 0; // stop, an error happened + if (decoded) + return ct; + } +} + +void Inflator_getTreeInflateDynamic(HuffmanTree *tree, HuffmanTree *treeD, const uint8_t *in, + size_t *bp, size_t inlength) +{ // get the tree of a deflated block with dynamic tree, the tree itself is also Huffman + // compressed with a known tree + size_t i, n; + HuffmanTree *codelengthcodetree = HuffmanTree_new(); // the code tree for code length codes + vector32_t *bitlen, *bitlenD; + bitlen = vector32_new(288, 0); + bitlenD = vector32_new(32, 0); + if (*bp >> 3 >= inlength - 2) { + Inflator_error = 49; // the bit pointer is or will go past the memory + return; + } + size_t HLIT = Zlib_readBitsFromStream(bp, in, 5) + 257; // number of literal/length codes + 257 + size_t HDIST = Zlib_readBitsFromStream(bp, in, 5) + 1; // number of dist codes + 1 + size_t HCLEN = Zlib_readBitsFromStream(bp, in, 4) + 4; // number of code length codes + 4 + vector32_t *codelengthcode; // lengths of tree to decode the lengths of the dynamic tree + codelengthcode = vector32_new(19, 0); + for (i = 0; i < 19; i++) + codelengthcode->data[CLCL[i]] = (i < HCLEN) ? Zlib_readBitsFromStream(bp, in, 3) : 0; + Inflator_error = HuffmanTree_makeFromLengths(codelengthcodetree, codelengthcode, 7); + if (Inflator_error) + return; + size_t replength; + for (i = 0; i < HLIT + HDIST; ) { + uint32_t code = Inflator_huffmanDecodeSymbol(in, bp, codelengthcodetree, inlength); + if (Inflator_error) + return; + if (code <= 15) { // a length code + if (i < HLIT) + bitlen->data[i++] = code; + else + bitlenD->data[i++ - HLIT] = code; + } else if (code == 16) { // repeat previous + if (*bp >> 3 >= inlength) { + Inflator_error = 50; // error, bit pointer jumps past memory + return; + } + replength = 3 + Zlib_readBitsFromStream(bp, in, 2); + uint32_t value; // set value to the previous code + if ((i - 1) < HLIT) + value = bitlen->data[i - 1]; + else + value = bitlenD->data[i - HLIT - 1]; + for (n = 0; n < replength; n++) { // repeat this value in the next lengths + if (i >= HLIT + HDIST) { + Inflator_error = 13; // error: i is larger than the amount of codes + return; + } + if (i < HLIT) + bitlen->data[i++] = value; + else + bitlenD->data[i++ - HLIT] = value; + } + } else if (code == 17) { // repeat "0" 3-10 times + if (*bp >> 3 >= inlength) { + Inflator_error = 50; // error, bit pointer jumps past memory + return; + } + replength = 3 + Zlib_readBitsFromStream(bp, in, 3); + for (n = 0; n < replength; n++) { // repeat this value in the next lengths + if (i >= HLIT + HDIST) { + Inflator_error = 14; // error: i is larger than the amount of codes + return; + } + if (i < HLIT) + bitlen->data[i++] = 0; + else + bitlenD->data[i++ - HLIT] = 0; + } + } else if (code == 18) { // repeat "0" 11-138 times + if (*bp >> 3 >= inlength) { + Inflator_error = 50; // error, bit pointer jumps past memory + return; + } + replength = 11 + Zlib_readBitsFromStream(bp, in, 7); + for (n = 0; n < replength; n++) { // repeat this value in the next lengths + if (i >= HLIT + HDIST) { + Inflator_error = 15; // error: i is larger than the amount of codes + return; + } + if (i < HLIT) + bitlen->data[i++] = 0; + else + bitlenD->data[i++ - HLIT] = 0; + } + } else { + Inflator_error = 16; // error: an nonexitent code appeared. This can never happen. + return; + } + } + if (bitlen->data[256] == 0) { + Inflator_error = 64; // the length of the end code 256 must be larger than 0 + return; + } + // now we've finally got HLIT and HDIST, so generate the code trees, and the function is done + Inflator_error = HuffmanTree_makeFromLengths(tree, bitlen, 15); + if (Inflator_error) + return; + Inflator_error = HuffmanTree_makeFromLengths(treeD, bitlenD, 15); + if (Inflator_error) + return; +} + +void Inflator_inflateHuffmanBlock(vector8_t *out, const uint8_t *in, size_t *bp, size_t *pos, + size_t inlength, uint32_t btype) +{ + HuffmanTree *codetree, *codetreeD; // the code tree for Huffman codes, dist codes + codetree = HuffmanTree_new(); + codetreeD = HuffmanTree_new(); + if (btype == 1) + Inflator_generateFixedTrees(codetree, codetreeD); + else if (btype == 2) { + Inflator_getTreeInflateDynamic(codetree, codetreeD, in, bp, inlength); + if (Inflator_error) + return; + } + for (;;) { + uint32_t code = Inflator_huffmanDecodeSymbol(in, bp, codetree, inlength); + if (Inflator_error) + return; + if (code == 256) // end code + return; + else if (code <= 255) { // literal symbol + if (*pos >= out->size) + vector8_resize(out, (*pos + 1) * 2); // reserve more room + out->data[(*pos)++] = (uint8_t) code; + } else if (code >= 257 && code <= 285) { // length code + size_t length = LENBASE[code - 257], numextrabits = LENEXTRA[code - 257]; + if ((*bp >> 3) >= inlength) { + Inflator_error = 51; // error, bit pointer will jump past memory + return; + } + length += Zlib_readBitsFromStream(bp, in, numextrabits); + uint32_t codeD = Inflator_huffmanDecodeSymbol(in, bp, codetreeD, inlength); + if (Inflator_error) + return; + if (codeD > 29) { + Inflator_error = 18; // error: invalid dist code (30-31 are never used) + return; + } + uint32_t dist = DISTBASE[codeD], numextrabitsD = DISTEXTRA[codeD]; + if ((*bp >> 3) >= inlength) { + Inflator_error = 51; // error, bit pointer will jump past memory + return; + } + dist += Zlib_readBitsFromStream(bp, in, numextrabitsD); + size_t start = *pos, back = start - dist; // backwards + if (*pos + length >= out->size) + vector8_resize(out, (*pos + length) * 2); // reserve more room + size_t i; + for (i = 0; i < length; i++) { + out->data[(*pos)++] = out->data[back++]; + if (back >= start) + back = start - dist; + } + } + } +} + +void Inflator_inflateNoCompression(vector8_t *out, const uint8_t *in, size_t *bp, size_t *pos, + size_t inlength) +{ + while ((*bp & 0x7) != 0) + (*bp)++; // go to first boundary of byte + size_t p = *bp / 8; + if (p >= inlength - 4) { + Inflator_error = 52; // error, bit pointer will jump past memory + return; + } + uint32_t LEN = in[p] + 256 * in[p + 1], NLEN = in[p + 2] + 256 * in[p + 3]; + p += 4; + if (LEN + NLEN != 65535) { + Inflator_error = 21; // error: NLEN is not one's complement of LEN + return; + } + if (*pos + LEN >= out->size) + vector8_resize(out, *pos + LEN); + if (p + LEN > inlength) { + Inflator_error = 23; // error: reading outside of in buffer + return; + } + uint32_t n; + for (n = 0; n < LEN; n++) + out->data[(*pos)++] = in[p++]; // read LEN bytes of literal data + *bp = p * 8; +} + +void Inflator_inflate(vector8_t *out, const vector8_t *in, size_t inpos) +{ + size_t bp = 0, pos = 0; // bit pointer and byte pointer + Inflator_error = 0; + uint32_t BFINAL = 0; + while (!BFINAL && !Inflator_error) { + if (bp >> 3 >= in->size) { + Inflator_error = 52; // error, bit pointer will jump past memory + return; + } + BFINAL = Zlib_readBitFromStream(&bp, &in->data[inpos]); + uint32_t BTYPE = Zlib_readBitFromStream(&bp, &in->data[inpos]); + BTYPE += 2 * Zlib_readBitFromStream(&bp, &in->data[inpos]); + if (BTYPE == 3) { + Inflator_error = 20; // error: invalid BTYPE + return; + } + else if (BTYPE == 0) + Inflator_inflateNoCompression(out, &in->data[inpos], &bp, &pos, in->size); + else + Inflator_inflateHuffmanBlock(out, &in->data[inpos], &bp, &pos, in->size, BTYPE); + } + if (!Inflator_error) + vector8_resize(out, pos); // Only now we know the true size of out, resize it to that +} + +/*************************************************************************************************/ + +int Zlib_decompress(vector8_t *out, const vector8_t *in) // returns error value +{ + if (in->size < 2) + return 53; // error, size of zlib data too small + if ((in->data[0] * 256 + in->data[1]) % 31 != 0) + // error: 256 * in->data[0] + in->data[1] must be a multiple of 31, the FCHECK value is + // supposed to be made that way + return 24; + uint32_t CM = in->data[0] & 15, CINFO = (in->data[0] >> 4) & 15, FDICT = (in->data[1] >> 5) & 1; + if (CM != 8 || CINFO > 7) + // error: only compression method 8: inflate with sliding window of 32k is supported by + // the PNG spec + return 25; + if (FDICT != 0) + // error: the specification of PNG says about the zlib stream: "The additional flags shall + // not specify a preset dictionary." + return 26; + Inflator_inflate(out, in, 2); + return Inflator_error; // note: adler32 checksum was skipped and ignored +} + +/*************************************************************************************************/ + +#define PNG_SIGNATURE 0x0a1a0a0d474e5089ull + +#define CHUNK_IHDR 0x52444849 +#define CHUNK_IDAT 0x54414449 +#define CHUNK_IEND 0x444e4549 +#define CHUNK_PLTE 0x45544c50 +#define CHUNK_tRNS 0x534e5274 + +int PNG_error; + +uint32_t PNG_readBitFromReversedStream(size_t *bitp, const uint8_t *bits) +{ + uint32_t result = (bits[*bitp >> 3] >> (7 - (*bitp & 0x7))) & 1; + (*bitp)++; + return result; +} + +uint32_t PNG_readBitsFromReversedStream(size_t *bitp, const uint8_t *bits, uint32_t nbits) +{ + uint32_t i, result = 0; + for (i = nbits - 1; i < nbits; i--) + result += ((PNG_readBitFromReversedStream(bitp, bits)) << i); + return result; +} + +void PNG_setBitOfReversedStream(size_t *bitp, uint8_t *bits, uint32_t bit) +{ + bits[*bitp >> 3] |= (bit << (7 - (*bitp & 0x7))); + (*bitp)++; +} + +uint32_t PNG_read32bitInt(const uint8_t *buffer) +{ + return (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]; +} + +int PNG_checkColorValidity(uint32_t colorType, uint32_t bd) // return type is a LodePNG error code +{ + if ((colorType == 2 || colorType == 4 || colorType == 6)) { + if (!(bd == 8 || bd == 16)) + return 37; + else + return 0; + } else if (colorType == 0) { + if (!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) + return 37; + else + return 0; + } else if (colorType == 3) { + if (!(bd == 1 || bd == 2 || bd == 4 || bd == 8)) + return 37; + else + return 0; + } else + return 31; // nonexistent color type +} + +uint32_t PNG_getBpp(const PNG_info_t *info) +{ + uint32_t bitDepth, colorType; + bitDepth = info->bitDepth; + colorType = info->colorType; + if (colorType == 2) + return (3 * bitDepth); + else if (colorType >= 4) + return (colorType - 2) * bitDepth; + else + return bitDepth; +} + +void PNG_readPngHeader(PNG_info_t *info, const uint8_t *in, size_t inlength) +{ // read the information from the header and store it in the Info + if (inlength < 29) { + PNG_error = 27; // error: the data length is smaller than the length of the header + return; + } + if (*(uint64_t *) in != PNG_SIGNATURE) { + PNG_error = 28; // no PNG signature + return; + } + if (*(uint32_t *) &in[12] != CHUNK_IHDR) { + PNG_error = 29; // error: it doesn't start with a IHDR chunk! + return; + } + info->width = PNG_read32bitInt(&in[16]); + info->height = PNG_read32bitInt(&in[20]); + info->bitDepth = in[24]; + info->colorType = in[25]; + info->compressionMethod = in[26]; + if (in[26] != 0) { + PNG_error = 32; // error: only compression method 0 is allowed in the specification + return; + } + info->filterMethod = in[27]; + if (in[27] != 0) { + PNG_error = 33; // error: only filter method 0 is allowed in the specification + return; + } + info->interlaceMethod = in[28]; + if (in[28] > 1) { + PNG_error = 34; // error: only interlace methods 0 and 1 exist in the specification + return; + } + PNG_error = PNG_checkColorValidity(info->colorType, info->bitDepth); +} + +int PNG_paethPredictor(int a, int b, int c) // Paeth predicter, used by PNG filter type 4 +{ + int p, pa, pb, pc; + p = a + b - c; + pa = p > a ? (p - a) : (a - p); + pb = p > b ? (p - b) : (b - p); + pc = p > c ? (p - c) : (c - p); + return (pa <= pb && pa <= pc) ? a : (pb <= pc ? b : c); +} + +void PNG_unFilterScanline(uint8_t *recon, const uint8_t *scanline, const uint8_t *precon, + size_t bytewidth, uint32_t filterType, size_t length) +{ + size_t i; + switch (filterType) { + case 0: + for (i = 0; i < length; i++) + recon[i] = scanline[i]; + break; + case 1: + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + recon[i - bytewidth]; + break; + case 2: + if (precon) + for (i = 0; i < length; i++) + recon[i] = scanline[i] + precon[i]; + else + for (i = 0; i < length; i++) + recon[i] = scanline[i]; + break; + case 3: + if (precon) { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i] + precon[i] / 2; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) / 2); + } else { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + recon[i - bytewidth] / 2; + } + break; + case 4: + if (precon) { + for (i = 0; i < bytewidth; i++) + recon[i] = (uint8_t) (scanline[i] + PNG_paethPredictor(0, precon[i], 0)); + for (i = bytewidth; i < length; i++) + recon[i] = (uint8_t) (scanline[i] + PNG_paethPredictor(recon[i - bytewidth], + precon[i], precon[i - bytewidth])); + } else { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = (uint8_t) (scanline[i] + PNG_paethPredictor(recon[i - bytewidth], 0, 0)); + } + break; + default: + PNG_error = 36; // error: nonexistent filter type given + return; + } +} + +void PNG_adam7Pass(uint8_t *out, uint8_t *linen, uint8_t *lineo, const uint8_t *in, uint32_t w, + size_t passleft, size_t passtop, size_t spacex, size_t spacey, size_t passw, size_t passh, + uint32_t bpp) +{ // filter and reposition the pixels into the output when the image is Adam7 interlaced. This + // function can only do it after the full image is already decoded. The out buffer must have + // the correct allocated memory size already. + if (passw == 0) + return; + size_t bytewidth = (bpp + 7) / 8, linelength = 1 + ((bpp * passw + 7) / 8); + uint32_t y; + for (y = 0; y < passh; y++) { + size_t i, b; + uint8_t filterType = in[y * linelength], *prevline = (y == 0) ? 0 : lineo; + PNG_unFilterScanline(linen, &in[y * linelength + 1], prevline, bytewidth, filterType, + (w * bpp + 7) / 8); + if (PNG_error) + return; + if (bpp >= 8) + for (i = 0; i < passw; i++) + for (b = 0; b < bytewidth; b++) // b = current byte of this pixel + out[bytewidth * w * (passtop + spacey * y) + bytewidth * + (passleft + spacex * i) + b] = linen[bytewidth * i + b]; + else + for (i = 0; i < passw; i++) { + size_t obp, bp; + obp = bpp * w * (passtop + spacey * y) + bpp * (passleft + spacex * i); + bp = i * bpp; + for (b = 0; b < bpp; b++) + PNG_setBitOfReversedStream(&obp, out, PNG_readBitFromReversedStream(&bp, linen)); + } + uint8_t *temp = linen; + linen = lineo; + lineo = temp; // swap the two buffer pointers "line old" and "line new" + } +} + +int PNG_convert(const PNG_info_t *info, vector8_t *out, const uint8_t *in) +{ // converts from any color type to 32-bit. return value = LodePNG error code + size_t i, c; + uint32_t bitDepth, colorType; + bitDepth = info->bitDepth; + colorType = info->colorType; + size_t numpixels = info->width * info->height, bp = 0; + vector8_resize(out, numpixels * 4); + uint8_t *out_data = out->size ? out->data : 0; + if (bitDepth == 8 && colorType == 0) // greyscale + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[i]; + out_data[4 * i + 3] = (info->key_defined && (in[i] == info->key_r)) ? 0 : 255; + } + else if (bitDepth == 8 && colorType == 2) // RGB color + for (i = 0; i < numpixels; i++) { + for (c = 0; c < 3; c++) + out_data[4 * i + c] = in[3 * i + c]; + out_data[4 * i + 3] = (info->key_defined && (in[3 * i + 0] == info->key_r) && + (in[3 * i + 1] == info->key_g) && (in[3 * i + 2] == info->key_b)) ? 0 : 255; + } + else if (bitDepth == 8 && colorType == 3) // indexed color (palette) + for (i = 0; i < numpixels; i++) { + if (4U * in[i] >= info->palette->size) + return 46; + for (c = 0; c < 4; c++) // get rgb colors from the palette + out_data[4 * i + c] = info->palette->data[4 * in[i] + c]; + } + else if (bitDepth == 8 && colorType == 4) // greyscale with alpha + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[2 * i + 0]; + out_data[4 * i + 3] = in[2 * i + 1]; + } + else if (bitDepth == 8 && colorType == 6) + for (i = 0; i < numpixels; i++) + for (c = 0; c < 4; c++) + out_data[4 * i + c] = in[4 * i + c]; // RGB with alpha + else if (bitDepth == 16 && colorType == 0) // greyscale + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[2 * i]; + out_data[4 * i + 3] = (info->key_defined && (256U * in[i] + in[i + 1] == info->key_r)) + ? 0 : 255; + } + else if (bitDepth == 16 && colorType == 2) // RGB color + for (i = 0; i < numpixels; i++) { + for (c = 0; c < 3; c++) + out_data[4 * i + c] = in[6 * i + 2 * c]; + out_data[4 * i + 3] = (info->key_defined && + (256U * in[6 * i + 0] + in[6 * i + 1] == info->key_r) && + (256U * in[6 * i + 2] + in[6 * i + 3] == info->key_g) && + (256U * in[6 * i + 4] + in[6 * i + 5] == info->key_b)) ? 0 : 255; + } + else if (bitDepth == 16 && colorType == 4) // greyscale with alpha + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[4 * i]; // msb + out_data[4 * i + 3] = in[4 * i + 2]; + } + else if (bitDepth == 16 && colorType == 6) + for (i = 0; i < numpixels; i++) + for (c = 0; c < 4; c++) + out_data[4 * i + c] = in[8 * i + 2 * c]; // RGB with alpha + else if (bitDepth < 8 && colorType == 0) // greyscale + for (i = 0; i < numpixels; i++) { + uint32_t value = (PNG_readBitsFromReversedStream(&bp, in, bitDepth) * 255) / + ((1 << bitDepth) - 1); // scale value from 0 to 255 + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = (uint8_t) value; + out_data[4 * i + 3] = (info->key_defined && value && + (((1U << bitDepth) - 1U) == info->key_r) && ((1U << bitDepth) - 1U)) ? 0 : 255; + } + else if (bitDepth < 8 && colorType == 3) // palette + for (i = 0; i < numpixels; i++) { + uint32_t value = PNG_readBitsFromReversedStream(&bp, in, bitDepth); + if (4 * value >= info->palette->size) + return 47; + for (c = 0; c < 4; c++) // get rgb colors from the palette + out_data[4 * i + c] = info->palette->data[4 * value + c]; + } + return 0; +} + +PNG_info_t *PNG_info_new() +{ + PNG_info_t *info = png_alloc_malloc(sizeof (PNG_info_t)); + uint32_t i; + for (i = 0; i < sizeof (PNG_info_t); i++) + ((uint8_t *) info)[i] = 0; + info->palette = vector8_new(0, 0); + info->image = vector8_new(0, 0); + return info; +} + +PNG_info_t *PNG_decode(const uint8_t *in, uint32_t size) +{ + PNG_info_t *info; + PNG_error = 0; + if (size == 0 || in == 0) { + PNG_error = 48; // the given data is empty + return NULL; + } + info = PNG_info_new(); + PNG_readPngHeader(info, in, size); + if (PNG_error) + return NULL; + size_t pos = 33; // first byte of the first chunk after the header + vector8_t *idat = NULL; // the data from idat chunks + bool IEND = false, known_type = true; + info->key_defined = false; + // loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. IDAT data is + // put at the start of the in buffer + while (!IEND) { + size_t i, j; + if (pos + 8 >= size) { + PNG_error = 30; // error: size of the in buffer too small to contain next chunk + return NULL; + } + size_t chunkLength = PNG_read32bitInt(&in[pos]); + pos += 4; + if (chunkLength > 0x7fffffff) { + PNG_error = 63; + return NULL; + } + if (pos + chunkLength >= size) { + PNG_error = 35; // error: size of the in buffer too small to contain next chunk + return NULL; + } + uint32_t chunkType = *(uint32_t *) &in[pos]; + if (chunkType == CHUNK_IDAT) { // IDAT: compressed image data chunk + size_t offset = 0; + if (idat) { + offset = idat->size; + vector8_resize(idat, offset + chunkLength); + } else + idat = vector8_new(chunkLength, 0); + for (i = 0; i < chunkLength; i++) + idat->data[offset + i] = in[pos + 4 + i]; + pos += (4 + chunkLength); + } else if (chunkType == CHUNK_IEND) { // IEND + pos += 4; + IEND = true; + } else if (chunkType == CHUNK_PLTE) { // PLTE: palette chunk + pos += 4; // go after the 4 letters + vector8_resize(info->palette, 4 * (chunkLength / 3)); + if (info->palette->size > (4 * 256)) { + PNG_error = 38; // error: palette too big + return NULL; + } + for (i = 0; i < info->palette->size; i += 4) { + for (j = 0; j < 3; j++) + info->palette->data[i + j] = in[pos++]; // RGB + info->palette->data[i + 3] = 255; // alpha + } + } else if (chunkType == CHUNK_tRNS) { // tRNS: palette transparency chunk + pos += 4; // go after the 4 letters + if (info->colorType == 3) { + if (4 * chunkLength > info->palette->size) { + PNG_error = 39; // error: more alpha values given than there are palette entries + return NULL; + } + for (i = 0; i < chunkLength; i++) + info->palette->data[4 * i + 3] = in[pos++]; + } else if (info->colorType == 0) { + if (chunkLength != 2) { + PNG_error = 40; // error: this chunk must be 2 bytes for greyscale image + return NULL; + } + info->key_defined = true; + info->key_r = info->key_g = info->key_b = 256 * in[pos] + in[pos + 1]; + pos += 2; + } else if (info->colorType == 2) { + if (chunkLength != 6) { + PNG_error = 41; // error: this chunk must be 6 bytes for RGB image + return NULL; + } + info->key_defined = true; + info->key_r = 256 * in[pos] + in[pos + 1]; + pos += 2; + info->key_g = 256 * in[pos] + in[pos + 1]; + pos += 2; + info->key_b = 256 * in[pos] + in[pos + 1]; + pos += 2; + } else { + PNG_error = 42; // error: tRNS chunk not allowed for other color models + return NULL; + } + } else { // it's not an implemented chunk type, so ignore it: skip over the data + if (!(in[pos + 0] & 32)) { + // error: unknown critical chunk (5th bit of first byte of chunk type is 0) + PNG_error = 69; + return NULL; + } + pos += (chunkLength + 4); // skip 4 letters and uninterpreted data of unimplemented chunk + known_type = false; + } + pos += 4; // step over CRC (which is ignored) + } + uint32_t bpp = PNG_getBpp(info); + vector8_t *scanlines; // now the out buffer will be filled + scanlines = vector8_new(((info->width * (info->height * bpp + 7)) / 8) + info->height, 0); + PNG_error = Zlib_decompress(scanlines, idat); + if (PNG_error) + return NULL; // stop if the zlib decompressor returned an error + size_t bytewidth = (bpp + 7) / 8, outlength = (info->height * info->width * bpp + 7) / 8; + vector8_resize(info->image, outlength); // time to fill the out buffer + uint8_t *out_data = outlength ? info->image->data : 0; + if (info->interlaceMethod == 0) { // no interlace, just filter + size_t y, obp, bp; + size_t linestart, linelength; + linestart = 0; + // length in bytes of a scanline, excluding the filtertype byte + linelength = (info->width * bpp + 7) / 8; + if (bpp >= 8) // byte per byte + for (y = 0; y < info->height; y++) { + uint32_t filterType = scanlines->data[linestart]; + const uint8_t *prevline; + prevline = (y == 0) ? 0 : &out_data[(y - 1) * info->width * bytewidth]; + PNG_unFilterScanline(&out_data[linestart - y], &scanlines->data[linestart + 1], + prevline, bytewidth, filterType, linelength); + if (PNG_error) + return NULL; + linestart += (1 + linelength); // go to start of next scanline + } else { // less than 8 bits per pixel, so fill it up bit per bit + vector8_t *templine; // only used if bpp < 8 + templine = vector8_new((info->width * bpp + 7) >> 3, 0); + for (y = 0, obp = 0; y < info->height; y++) { + uint32_t filterType = scanlines->data[linestart]; + const uint8_t *prevline; + prevline = (y == 0) ? 0 : &out_data[(y - 1) * info->width * bytewidth]; + PNG_unFilterScanline(templine->data, &scanlines->data[linestart + 1], prevline, + bytewidth, filterType, linelength); + if (PNG_error) + return NULL; + for (bp = 0; bp < info->width * bpp;) + PNG_setBitOfReversedStream(&obp, out_data, PNG_readBitFromReversedStream(&bp, + templine->data)); + linestart += (1 + linelength); // go to start of next scanline + } + } + } else { // interlaceMethod is 1 (Adam7) + int i; + size_t passw[7] = { + (info->width + 7) / 8, (info->width + 3) / 8, (info->width + 3) / 4, + (info->width + 1) / 4, (info->width + 1) / 2, (info->width + 0) / 2, + (info->width + 0) / 1 + }; + size_t passh[7] = { + (info->height + 7) / 8, (info->height + 7) / 8, (info->height + 3) / 8, + (info->height + 3) / 4, (info->height + 1) / 4, (info->height + 1) / 2, + (info->height + 0) / 2 + }; + size_t passstart[7] = { 0 }; + size_t pattern[28] = { 0, 4, 0, 2, 0, 1, 0, 0, 0, 4, 0, 2, 0, 1, 8, 8, 4, 4, 2, 2, 1, 8, 8, + 8, 4, 4, 2, 2 }; // values for the adam7 passes + for (i = 0; i < 6; i++) + passstart[i + 1] = passstart[i] + passh[i] * ((passw[i] ? 1 : 0) + (passw[i] * bpp + 7) / 8); + vector8_t *scanlineo, *scanlinen; // "old" and "new" scanline + scanlineo = vector8_new((info->width * bpp + 7) / 8, 0); + scanlinen = vector8_new((info->width * bpp + 7) / 8, 0); + for (i = 0; i < 7; i++) + PNG_adam7Pass(out_data, scanlinen->data, scanlineo->data, &scanlines->data[passstart[i]], + info->width, pattern[i], pattern[i + 7], pattern[i + 14], pattern[i + 21], + passw[i], passh[i], bpp); + } + if (info->colorType != 6 || info->bitDepth != 8) { // conversion needed + vector8_t *copy = vector8_copy(info->image); // xxx: is this copy necessary? + PNG_error = PNG_convert(info, info->image, copy->data); + } + return info; +} + +/*************************************************************************************************/ + +#ifdef TEST + +#include +#include + +int main(int argc, char **argv) +{ + char *fname = (argc > 1) ? argv[1] : "test.png"; + PNG_info_t *info; + struct stat statbuf; + uint32_t insize, outsize; + FILE *infp, *outfp; + uint8_t *inbuf; + uint32_t n; + + if (stat(fname, &statbuf) != 0) { + perror("stat"); + return 1; + } else if (!statbuf.st_size) { + printf("file empty\n"); + return 1; + } + insize = (uint32_t) statbuf.st_size; + inbuf = malloc(insize); + infp = fopen(fname, "rb"); + if (!infp) { + perror("fopen"); + return 1; + } else if (fread(inbuf, 1, insize, infp) != insize) { + perror("fread"); + return 1; + } + fclose(infp); + + printf("input file: %s (size: %d)\n", fname, insize); + + info = PNG_decode(inbuf, insize); + free(inbuf); + printf("PNG_error: %d\n", PNG_error); + if (PNG_error != 0) + return 1; + + printf("width: %d, height: %d\nfirst 16 bytes: ", info->width, info->height); + for (n = 0; n < 16; n++) + printf("%02x ", info->image->data[n]); + printf("\n"); + + outsize = info->width * info->height * 4; + printf("image size: %d\n", outsize); + if (outsize != info->image->size) { + printf("error: image size doesn't match dimensions\n"); + return 1; + } + outfp = fopen("out.bin", "wb"); + if (!outfp) { + perror("fopen"); + return 1; + } else if (fwrite(info->image->data, 1, outsize, outfp) != outsize) { + perror("fwrite"); + return 1; + } + fclose(outfp); + +#ifdef ALLOC_DEBUG + png_alloc_node_t *node; + for (node = png_alloc_head, n = 1; node; node = node->next, n++) + printf("node %d (%p) addr = %p, size = %ld\n", n, node, node->addr, node->size); +#endif + png_alloc_free_all(); // also frees info and image data from PNG_decode + + return 0; +} + +#endif diff --git a/i386/boot2/.svn/text-base/picopng.h.svn-base b/i386/boot2/.svn/text-base/picopng.h.svn-base new file mode 100644 index 0000000..66c2c9e --- /dev/null +++ b/i386/boot2/.svn/text-base/picopng.h.svn-base @@ -0,0 +1,33 @@ +#ifndef _PICOPNG_H +#define _PICOPNG_H + +#include + +typedef struct { + uint32_t *data; + size_t size; + size_t allocsize; +} vector32_t; + +typedef struct { + uint8_t *data; + size_t size; + size_t allocsize; +} vector8_t; + +typedef struct { + uint32_t width, height; + uint32_t colorType, bitDepth; + uint32_t compressionMethod, filterMethod, interlaceMethod; + uint32_t key_r, key_g, key_b; + bool key_defined; // is a transparent color key given? + vector8_t *palette; + vector8_t *image; +} PNG_info_t; + +PNG_info_t *PNG_decode(const uint8_t *in, uint32_t size); +void png_alloc_free_all(); + +extern int PNG_error; + +#endif diff --git a/i386/boot2/.svn/text-base/prompt.c.svn-base b/i386/boot2/.svn/text-base/prompt.c.svn-base new file mode 100644 index 0000000..a3734cd --- /dev/null +++ b/i386/boot2/.svn/text-base/prompt.c.svn-base @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include + +char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n" + "Build date: " I386BOOT_BUILDDATE "\n" + "%dMB memory\n"; + +char bootPrompt[] = + "Press Enter to start up Darwin/x86 with no options, or you can:\n" + " Type -v and press Enter to start up with diagnostic messages\n" + " Type ? and press Enter to learn about advanced startup options\n\n" + "boot: "; + +char bootRescanPrompt[] = + "Press Enter to start up Darwin/x86 with no options, or you can:\n" + " Press F5 after you swapped the media. The drive will be rescanned.\n" + " Type -v and press Enter to start up with diagnostic messages\n" + " Type ? and press Enter to learn about advanced startup options\n\n" + "boot: "; diff --git a/i386/boot2/.svn/text-base/ramdisk.c.svn-base b/i386/boot2/.svn/text-base/ramdisk.c.svn-base new file mode 100644 index 0000000..0f00a8a --- /dev/null +++ b/i386/boot2/.svn/text-base/ramdisk.c.svn-base @@ -0,0 +1,309 @@ +/* + * Supplemental ramdisk functions for the multiboot ramdisk driver. + * Copyright 2009 Tamas Kosarszky. All rights reserved. + * + */ + +#include "boot.h" +#include "bootstruct.h" +#include "multiboot.h" +#include "ramdisk.h" + +struct multiboot_info * gRAMDiskMI = NULL; + +// gRAMDiskVolume holds the bvr for the mounted ramdisk image. +BVRef gRAMDiskVolume = NULL; +bool gRAMDiskBTAliased = false; +char gRAMDiskFile[512]; + +// Notify OS X that a ramdisk has been setup. XNU with attach this to /dev/md0 +void md0Ramdisk() +{ + RAMDiskParam ramdiskPtr; + char filename[512]; + const char* override_filename = 0; + int fh = -1; + int len; + + if(getValueForKey(kMD0Image, &override_filename, &len, + &bootInfo->chameleonConfig)) + { + // Use user specified md0 file + sprintf(filename, "%s", override_filename); + fh = open(filename, 0); + + if(fh < 0) + { + sprintf(filename, "rd(0,0)/Extra/%s", override_filename); + fh = open(filename, 0); + + if(fh < 0) + { + sprintf(filename, "/Extra/%s", override_filename); + fh = open(filename, 0); + } + } + } + + if(fh < 0) + { + sprintf(filename, "rd(0,0)/Extra/Postboot.img"); + fh = open(filename, 0); + + if(fh < 0) + { + sprintf(filename, "/Extra/Postboot.img"); // Check /Extra if not in rd(0,0) + fh = open(filename, 0); + } + } + + if (fh >= 0) + { + verbose("Enabling ramdisk %s\n", filename); + + ramdiskPtr.size = file_size(fh); + ramdiskPtr.base = AllocateKernelMemory(ramdiskPtr.size); + + if(ramdiskPtr.size && ramdiskPtr.base) + { + // Read new ramdisk image contents in kernel memory. + if (read(fh, (char*) ramdiskPtr.base, ramdiskPtr.size) == ramdiskPtr.size) + { + AllocateMemoryRange("RAMDisk", ramdiskPtr.base, ramdiskPtr.size, kBootDriverTypeInvalid); + Node* node = DT__FindNode("/chosen/memory-map", false); + if(node != NULL) + { + DT__AddProperty(node, "RAMDisk", sizeof(RAMDiskParam), (void*)&ramdiskPtr); + } + else + { + verbose("Unable to notify Mac OS X of the ramdisk %s.\n", filename); + } + } + else + { + verbose("Unable to read md0 image %s.\n", filename); + } + } + else + { + verbose("md0 image %s is empty.\n", filename); + } + + close(fh); + + } +} + +void umountRAMDisk() +{ + if (gRAMDiskMI != NULL) + { + // Release ramdisk BVRef and DiskBVMap. + struct DiskBVMap *oldMap = diskResetBootVolumes(0x100); + CacheReset(); + diskFreeMap(oldMap); + + // Free multiboot info and module structures. + if ((void *)gRAMDiskMI->mi_mods_addr != NULL) free((void *)gRAMDiskMI->mi_mods_addr); + if (gRAMDiskMI != NULL) free(gRAMDiskMI); + + // Reset multiboot structures. + gMI = gRAMDiskMI = NULL; + *gRAMDiskFile = '\0'; + + // Release ramdisk driver hooks. + p_get_ramdisk_info = NULL; + p_ramdiskReadBytes = NULL; + + // Reset ramdisk bvr + gRAMDiskVolume = NULL; + printf("\nunmounting: done"); + } +} + +int mountRAMDisk(const char * param) +{ + int fh = 0, ramDiskSize; + int error = 0; + + // Get file handle for ramdisk file. + fh = open(param, 0); + if (fh != -1) + { + printf("\nreading ramdisk image: %s", param); + + ramDiskSize = file_size(fh); + if (ramDiskSize > 0) + { + // Unmount previously mounted image if exists. + umountRAMDisk(); + + // Read new ramdisk image contents into PREBOOT_DATA area. + if (read(fh, (char *)PREBOOT_DATA, ramDiskSize) != ramDiskSize) error = -1; + } + else error = -1; + + close(fh); + } + else error = -1; + + if (error == 0) + { + // Save filename in gRAMDiskFile to display information. + strcpy(gRAMDiskFile, param); + + // Set gMI as well for the multiboot ramdisk driver hook. + gMI = gRAMDiskMI = malloc(sizeof(multiboot_info)); + struct multiboot_module * ramdisk_module = malloc(sizeof(multiboot_module)); + + // Fill in multiboot info and module structures. + if (gRAMDiskMI != NULL && ramdisk_module != NULL) + { + gRAMDiskMI->mi_mods_count = 1; + gRAMDiskMI->mi_mods_addr = (uint32_t)ramdisk_module; + ramdisk_module->mm_mod_start = PREBOOT_DATA; + ramdisk_module->mm_mod_end = PREBOOT_DATA + ramDiskSize; + + // Set ramdisk driver hooks. + p_get_ramdisk_info = &multiboot_get_ramdisk_info; + p_ramdiskReadBytes = &multibootRamdiskReadBytes; + + int partCount; // unused + // Save bvr of the mounted image. + gRAMDiskVolume = diskScanBootVolumes(0x100, &partCount); + if(gRAMDiskVolume == NULL) + { + umountRAMDisk(); + printf("\nRamdisk contains no partitions."); + } + else + { + char dirSpec[128]; + + // Reading ramdisk configuration. + strcpy(dirSpec, RAMDISKCONFIG_FILENAME); + + if (loadConfigFile(dirSpec, &bootInfo->ramdiskConfig) == 0) + { + getBoolForKey("BTAlias", &gRAMDiskBTAliased, &bootInfo->ramdiskConfig); + } + else + { + printf("\nno ramdisk config...\n"); + } + + printf("\nmounting: done"); + } + } + } + + return error; +} + +void setRAMDiskBTHook(bool mode) +{ + gRAMDiskBTAliased = mode; + if (mode) + { + printf("\nEnabled bt(0,0) alias."); + } + else + { + printf("\nDisabled bt(0,0) alias."); + } +} + +void showInfoRAMDisk(void) +{ + int len; + const char *val; + + if (gRAMDiskMI != NULL) + { + struct multiboot_module * ramdisk_module = (void *)gRAMDiskMI->mi_mods_addr; + + printf("\nfile: %s %d", gRAMDiskFile, + ramdisk_module->mm_mod_end - ramdisk_module->mm_mod_start); + printf("\nalias: %s", gRAMDiskBTAliased ? "enabled" : "disabled"); + + // Display ramdisk information if available. + if (getValueForKey("Info", &val, &len, &bootInfo->ramdiskConfig)) + { + printf("\ninfo: %s", val); + } + else + { + printf("\nramdisk info not available."); + } + } + else + { + printf("\nNo ramdisk mounted."); + } +} + +int loadPrebootRAMDisk() +{ + mountRAMDisk("bt(0,0)/Extra/Preboot.dmg"); + if (gRAMDiskMI != NULL) + { + printf("\n"); + return 0; + } + else + { + return -1; + } +} + +void processRAMDiskCommand(char ** argPtr, const char * cmd) +{ + char * ptr = *argPtr; + char param[1024]; + getNextArg(&ptr, param); + + if (strcmp(cmd, "m") == 0) + { + mountRAMDisk(param); + sleep(2); + } + else if (strcmp(cmd, "u") == 0) + { + umountRAMDisk(); + sleep(2); + } + else if (strcmp(cmd, "e") == 0) + { + setRAMDiskBTHook(true); + sleep(2); + } + else if (strcmp(cmd, "d") == 0) + { + setRAMDiskBTHook(false); + sleep(2); + } + else if (strcmp(cmd, "i") == 0) + { + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + showInfoRAMDisk(); + printf("\n\nPress any key to continue.\n"); + getchar(); + setActiveDisplayPage(0); + } + else + { + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + printf("\nusage:\n"); + printf("\n?rd i - display ramdisk information"); + printf("\n?rd m - mount ramdisk image\n?rd u - unmount ramdisk image"); + printf("\n?rd e - enable bt(0,0) alias\n?rd d - disable bt(0,0) alias"); + printf("\n\nPress any key to continue.\n"); + getchar(); + setActiveDisplayPage(0); + } +} diff --git a/i386/boot2/.svn/text-base/ramdisk.h.svn-base b/i386/boot2/.svn/text-base/ramdisk.h.svn-base new file mode 100644 index 0000000..44845a6 --- /dev/null +++ b/i386/boot2/.svn/text-base/ramdisk.h.svn-base @@ -0,0 +1,36 @@ +/* + * Supplemental ramdisk functions for the multiboot ramdisk driver + * Copyright 2009 Tamas Kosarszky. All rights reserved. + * + */ + +#ifndef __BOOT_RAMDISK_H +#define __BOOT_RAMDISK_H + +#define RAMDISKCONFIG_FILENAME "rd(0,0)/RAMDisk.plist" +//#define kPostbootRamdisk +void md0Ramdisk(); + +typedef struct RAMDiskParam +{ + ppnum_t base; + unsigned int size; +} RAMDiskParam; + +/* mboot.c */ +extern struct multiboot_info *gMI; +extern int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ); +extern int multiboot_get_ramdisk_info(int biosdev, struct driveInfo *dip); +// + +extern BVRef gRAMDiskVolume; +extern bool gRAMDiskBTAliased; + +extern void setRAMDiskBTHook(bool mode); +extern int mountRAMDisk(const char * param); +extern void processRAMDiskCommand(char ** argPtr, const char * cmd); +extern int loadPrebootRAMDisk(); + +#endif /* !__BOOT_RAMDISK_H */ diff --git a/i386/boot2/.svn/text-base/resume.c.svn-base b/i386/boot2/.svn/text-base/resume.c.svn-base new file mode 100644 index 0000000..8498010 --- /dev/null +++ b/i386/boot2/.svn/text-base/resume.c.svn-base @@ -0,0 +1,215 @@ +/* + * resume.c + * + * + * Created by mackerintel on 1/22/09. + * Copyright 2009 mackerintel. All rights reserved. + * + */ + +#include "saio_internal.h" +#include "libsa.h" +#include "IOHibernatePrivate.h" +#include "memory.h" +#include "bootstruct.h" +#include "boot.h" +#include "pci.h" + +extern int previewTotalSectors; +extern int previewLoadedSectors; +extern uint8_t *previewSaveunder; + +static unsigned long +getmemorylimit(void) +{ + int line; + int i; + MemoryRange *mp = bootInfo->memoryMap; + + // Activate and clear page 1 + line = 1; + for (i = 0; i < bootInfo->memoryMapCount; i++) + { + if((mp->type == 1) && ((unsigned long)mp->base == 0x100000)) + { + return (unsigned long)(mp->base + mp->length); + } + mp++; + } + return 0x10000000; +} + +static void WakeKernel(IOHibernateImageHeader * header) +{ + uint32_t proc; + unsigned long cnt, newSP; + unsigned long *src, *dst; + unsigned int count; + unsigned int page; + unsigned int compressedSize; + int32_t byteCnt; + u_int32_t lowHalf, highHalf; + u_int32_t sum; + + printf("\nWake Kernel!\n"); + + dst = (unsigned long *) (header->restore1CodePage << 12); + count = header->restore1PageCount; + proc = (header->restore1CodeOffset + ((uint32_t) dst)); + newSP = header->restore1StackOffset + (header->restore1CodePage << 12); + + src = (unsigned long *) (((u_int32_t) &header->fileExtentMap[0]) + + header->fileExtentMapSize); + sum = 0; + + for (page = 0; page < count; page++) + { + compressedSize = 4096; + + lowHalf = 1; + highHalf = 0; + + for (cnt = 0; cnt < compressedSize; cnt += 0x20) { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; + for (byteCnt = 0; byteCnt < 0x20; byteCnt++) { + lowHalf += ((u_int8_t *) dst)[byteCnt]; + highHalf += lowHalf; + } + src += 8; + dst += 8; + } + + lowHalf %= 65521L; + highHalf %= 65521L; + sum += (highHalf << 16) | lowHalf; + } + header->actualRestore1Sum = sum; + startprog (proc, header); + + return; +} + +void HibernateBoot(char *image_filename) +{ + long long size, imageSize, codeSize, allocSize; + long mem_base; + IOHibernateImageHeader _header; + IOHibernateImageHeader * header = &_header; + long buffer; + + size = ReadFileAtOffset (image_filename, header, 0, sizeof(IOHibernateImageHeader)); + printf("header read size %x\n", size); + + imageSize = header->image1Size; + codeSize = header->restore1PageCount << 12; + if (kIOHibernateHeaderSignature != header->signature) + { + printf ("Incorrect image signature\n"); + return; + } + if (header->encryptStart) + { + printf ("Resuming from Encrypted image is unsupported.\n" + "Uncheck \"Use secure virtual memory\" in \"Security\" pane on system preferences.\n" + "Press any key to proceed with normal boot.\n"); + getchar(); + return; + } +// depends on NVRAM +#if 0 + { + uint32_t machineSignature; + size = GetProp(gChosenPH, kIOHibernateMachineSignatureKey, + (char *)&machineSignature, sizeof(machineSignature)); + if (size != sizeof(machineSignature)) machineSignature = 0; + if (machineSignature != header->machineSignature) + break; + } +#endif + + allocSize = imageSize + ((4095 + sizeof(hibernate_graphics_t)) & ~4095); + + mem_base = getmemorylimit() - allocSize;//TODO: lower this + + printf("mem_base %x\n", mem_base); + if (((long long)mem_base + allocSize) < (1024 * bootInfo->extmem + 0x100000)) + { + printf ("Not enough space to restore image. Press any key to proceed with normal boot.\n"); + getchar(); + return; + } + + bcopy(header, (void *) mem_base, sizeof(IOHibernateImageHeader)); + header = (IOHibernateImageHeader *) mem_base; + + imageSize -= sizeof(IOHibernateImageHeader); + buffer = (long)(header + 1); + + if (header->previewSize) + { + uint64_t preview_offset = header->fileExtentMapSize - sizeof(header->fileExtentMap) + codeSize; + uint8_t progressSaveUnder[kIOHibernateProgressCount][kIOHibernateProgressSaveUnderSize]; + + ReadFileAtOffset (image_filename, (char *)buffer, sizeof(IOHibernateImageHeader), preview_offset+header->previewSize); + drawPreview ((void *)(long)(buffer+preview_offset + header->previewPageListSize), &(progressSaveUnder[0][0])); + previewTotalSectors = (imageSize-(preview_offset+header->previewSize))/512; + previewLoadedSectors = 0; + previewSaveunder = &(progressSaveUnder[0][0]); + if (preview_offset+header->previewSizepreviewSize), + sizeof(IOHibernateImageHeader)+preview_offset+header->previewSize, + imageSize-(preview_offset+header->previewSize)); + previewTotalSectors = 0; + previewLoadedSectors = 0; + previewSaveunder = 0; +#if 0 + AsereBLN: + check_vga_nvidia() didn't work as expected (recursion level > 0 & return value). + Unforutnaltely I cannot find a note why to switch back to text mode for nVidia cards only + and because it check_vga_nvidia does not work (cards normally are behind a bridge) I will + remove it completely + setVideoMode( VGA_TEXT_MODE, 0 ); +#endif + } + else + ReadFileAtOffset (image_filename, (char *)buffer, sizeof(IOHibernateImageHeader), imageSize); + +// Depends on NVRAM +#if 0 + if (header->encryptStart) { + // decryption data + static const unsigned char first_iv[AES_BLOCK_SIZE] + = { 0xa3, 0x63, 0x65, 0xa9, 0x0b, 0x71, 0x7b, 0x1c, + 0xdf, 0x9e, 0x5f, 0x32, 0xd7, 0x61, 0x63, 0xda }; + hibernate_cryptvars_t _cryptvars; + hibernate_cryptvars_t * cryptvars = &_cryptvars; + + aes_decrypt_key(&decryptkey, + decryptkeysize, + &cryptvars->ctx.decrypt); + + // set the vector for the following decryptions + bcopy(((uint8_t *) header) + header->image1Size - AES_BLOCK_SIZE, + &cryptvars->aes_iv[0], AES_BLOCK_SIZE); + + // decrypt the buffer + uint32_t len = (uint32_t)(header->image1Size - header->encryptStart); + aes_decrypt_cbc(((uint8_t *) header) + header->encryptStart, + &first_iv[0], + len >> 4, + ((uint8_t *) header) + header->encryptStart, + &cryptvars->ctx.decrypt); + bzero(&cryptvars->aes_iv[0], sizeof(cryptvars)); + bzero(&decryptkey, sizeof(decryptkey)); + } +#endif + + WakeKernel(header); +} diff --git a/i386/boot2/Cconfig b/i386/boot2/Cconfig new file mode 100644 index 0000000..714f895 --- /dev/null +++ b/i386/boot2/Cconfig @@ -0,0 +1,29 @@ +config MODULES + bool "Module System" + default y + ---help--- + Say Y here if you want to enable the use of modules. + +config MODULE_DEBUG + bool "debug support" + default n + depends on MODULES + ---help--- + Say Y here if you want to enable debug mode for the + module system. + +source "i386/modules/Cconfig" + +config EMBED_THEME + bool "Embed Theme" + default n + ---help--- + Say Y here if you want compile in the default theme (Embed). + +config EMBEDED_THEME + string "Theme name" + default "embed" + depends on EMBED_THEME + ---help--- + Specify the name of the theme to compile in. + diff --git a/i386/boot2/IOHibernatePrivate.h b/i386/boot2/IOHibernatePrivate.h new file mode 100644 index 0000000..94627f4 --- /dev/null +++ b/i386/boot2/IOHibernatePrivate.h @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef KERNEL +#include +#endif + +struct IOPolledFileExtent +{ + uint64_t start; + uint64_t length; +}; +typedef struct IOPolledFileExtent IOPolledFileExtent; + +struct IOHibernateImageHeader +{ + uint64_t imageSize; + uint64_t image1Size; + + uint32_t restore1CodePage; + uint32_t restore1PageCount; + uint32_t restore1CodeOffset; + uint32_t restore1StackOffset; + + uint32_t pageCount; + uint32_t bitmapSize; + + uint32_t restore1Sum; + uint32_t image1Sum; + uint32_t image2Sum; + + uint32_t actualRestore1Sum; + uint32_t actualImage1Sum; + uint32_t actualImage2Sum; + + uint32_t actualUncompressedPages; + uint32_t conflictCount; + uint32_t nextFree; + + uint32_t signature; + uint32_t processorFlags; + + uint32_t runtimePages; + uint32_t runtimePageCount; + + uint8_t reserved2[16]; + + uint64_t encryptStart; + uint64_t machineSignature; + + uint32_t previewSize; + uint32_t previewPageListSize; + + uint32_t diag[4]; + + int32_t graphicsInfoOffset; + int32_t cryptVarsOffset; + int32_t memoryMapOffset; + uint32_t memoryMapSize; + uint32_t systemTableOffset; + + uint32_t reserved[77]; // make sizeof == 512 + + uint32_t fileExtentMapSize; + IOPolledFileExtent fileExtentMap[2]; +}; +typedef struct IOHibernateImageHeader IOHibernateImageHeader; + + +struct hibernate_bitmap_t +{ + uint32_t first_page; + uint32_t last_page; + uint32_t bitmapwords; + uint32_t bitmap[0]; +}; +typedef struct hibernate_bitmap_t hibernate_bitmap_t; + +struct hibernate_page_list_t +{ + uint32_t list_size; + uint32_t page_count; + uint32_t bank_count; + hibernate_bitmap_t bank_bitmap[0]; +}; +typedef struct hibernate_page_list_t hibernate_page_list_t; + +#if defined(_AES_H) + +struct hibernate_cryptwakevars_t +{ + uint8_t aes_iv[AES_BLOCK_SIZE]; +}; +typedef struct hibernate_cryptwakevars_t hibernate_cryptwakevars_t; + +struct hibernate_cryptvars_t +{ + uint8_t aes_iv[AES_BLOCK_SIZE]; + aes_ctx ctx; +}; +typedef struct hibernate_cryptvars_t hibernate_cryptvars_t; + +#endif /* defined(_AES_H) */ + + +enum +{ + kIOHibernateProgressCount = 19, + kIOHibernateProgressWidth = 7, + kIOHibernateProgressHeight = 16, + kIOHibernateProgressSpacing = 3, + kIOHibernateProgressOriginY = 81, + + kIOHibernateProgressSaveUnderSize = 2*5+14*2, + + kIOHibernateProgressLightGray = 230, + kIOHibernateProgressMidGray = 174, + kIOHibernateProgressDarkGray = 92 +}; + +enum +{ + kIOHibernatePostWriteSleep = 0, + kIOHibernatePostWriteWake = 1, + kIOHibernatePostWriteHalt = 2, + kIOHibernatePostWriteRestart = 3 +}; + + +struct hibernate_graphics_t +{ + uint32_t physicalAddress; // Base address of video memory + uint32_t mode; // + uint32_t rowBytes; // Number of bytes per pixel row + uint32_t width; // Width + uint32_t height; // Height + uint32_t depth; // Pixel Depth + + uint8_t progressSaveUnder[kIOHibernateProgressCount][kIOHibernateProgressSaveUnderSize]; +}; +typedef struct hibernate_graphics_t hibernate_graphics_t; + +#define DECLARE_IOHIBERNATEPROGRESSALPHA \ +static const uint8_t gIOHibernateProgressAlpha \ +[kIOHibernateProgressHeight][kIOHibernateProgressWidth] = \ +{ \ + { 0x00,0x63,0xd8,0xf0,0xd8,0x63,0x00 }, \ + { 0x51,0xff,0xff,0xff,0xff,0xff,0x51 }, \ + { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \ + { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \ + { 0x54,0xff,0xff,0xff,0xff,0xff,0x54 }, \ + { 0x00,0x66,0xdb,0xf3,0xdb,0x66,0x00 } \ +}; + +#ifdef KERNEL + +#ifdef __cplusplus + +void IOHibernateSystemInit(IOPMrootDomain * rootDomain); + +IOReturn IOHibernateSystemSleep(void); +IOReturn IOHibernateSystemHasSlept(void); +IOReturn IOHibernateSystemWake(void); +IOReturn IOHibernateSystemPostWake(void); + +#endif /* __cplusplus */ + +#ifdef _SYS_CONF_H_ +typedef void (*kern_get_file_extents_callback_t)(void * ref, uint64_t start, uint64_t size); + +struct kern_direct_file_io_ref_t * +kern_open_file_for_direct_io(const char * name, + kern_get_file_extents_callback_t callback, + void * callback_ref, + dev_t * device, + uint64_t * partitionbase_result, + uint64_t * maxiocount_result); +void +kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref); +int +kern_write_file(struct kern_direct_file_io_ref_t * ref, off_t offset, caddr_t addr, vm_size_t len); +int get_kernel_symfile(struct proc *p, char const **symfile); +#endif /* _SYS_CONF_H_ */ + +hibernate_page_list_t * +hibernate_page_list_allocate(void); + +kern_return_t +hibernate_setup(IOHibernateImageHeader * header, + uint32_t free_page_ratio, + uint32_t free_page_time, + hibernate_page_list_t ** page_list_ret, + hibernate_page_list_t ** page_list_wired_ret, + boolean_t * encryptedswap); +kern_return_t +hibernate_teardown(hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired); + +kern_return_t +hibernate_processor_setup(IOHibernateImageHeader * header); + +void +hibernate_vm_lock(void); +void +hibernate_vm_unlock(void); + +// mark pages not to be saved, based on VM system accounting +void +hibernate_page_list_setall(hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + uint32_t * pagesOut); + +// mark pages to be saved, or pages not to be saved but available +// for scratch usage during restore +void +hibernate_page_list_setall_machine(hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + uint32_t * pagesOut); + +// mark pages not to be saved and not for scratch usage during restore +void +hibernate_page_list_set_volatile( hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + uint32_t * pagesOut); + +void +hibernate_page_list_discard(hibernate_page_list_t * page_list); + +void +hibernate_set_page_state(hibernate_page_list_t * page_list, hibernate_page_list_t * page_list_wired, + vm_offset_t ppnum, vm_offset_t count, uint32_t kind); + +void +hibernate_page_bitset(hibernate_page_list_t * list, boolean_t set, uint32_t page); + +boolean_t +hibernate_page_bittst(hibernate_page_list_t * list, uint32_t page); + +hibernate_bitmap_t * +hibernate_page_bitmap_pin(hibernate_page_list_t * list, uint32_t * page); + +uint32_t +hibernate_page_bitmap_count(hibernate_bitmap_t * bitmap, uint32_t set, uint32_t page); + +void +hibernate_restore_phys_page(uint64_t src, uint64_t dst, uint32_t len, uint32_t procFlags); + +void +hibernate_machine_init(void); + +uint32_t +hibernate_write_image(void); + +long +hibernate_machine_entrypoint(IOHibernateImageHeader * header, void * p2, void * p3, void * p4); +long +hibernate_kernel_entrypoint(IOHibernateImageHeader * header, void * p2, void * p3, void * p4); +void +hibernate_newruntime_map(void * map, vm_size_t map_size, + uint32_t system_table_offset); + + +extern uint32_t gIOHibernateState; +extern uint32_t gIOHibernateMode; +extern uint32_t gIOHibernateFreeTime; // max time to spend freeing pages (ms) +extern uint8_t gIOHibernateRestoreStack[]; +extern uint8_t gIOHibernateRestoreStackEnd[]; +extern IOHibernateImageHeader * gIOHibernateCurrentHeader; +extern hibernate_graphics_t * gIOHibernateGraphicsInfo; +extern hibernate_cryptwakevars_t * gIOHibernateCryptWakeVars; + +#define HIBLOG(fmt, args...) \ + { kprintf(fmt, ## args); printf(fmt, ## args); } + +#define HIBPRINT(fmt, args...) \ + { kprintf(fmt, ## args); } + +#endif /* KERNEL */ + +// gIOHibernateState, kIOHibernateStateKey +enum +{ + kIOHibernateStateInactive = 0, + kIOHibernateStateHibernating = 1, /* writing image */ + kIOHibernateStateWakingFromHibernate = 2 /* booted and restored image */ +}; + +// gIOHibernateMode, kIOHibernateModeKey +enum +{ + kIOHibernateModeOn = 0x00000001, + kIOHibernateModeSleep = 0x00000002, + kIOHibernateModeEncrypt = 0x00000004, + kIOHibernateModeDiscardCleanInactive = 0x00000008, + kIOHibernateModeDiscardCleanActive = 0x00000010, + kIOHibernateModeSwitch = 0x00000020, + kIOHibernateModeRestart = 0x00000040 +}; + +// IOHibernateImageHeader.signature +enum +{ + kIOHibernateHeaderSignature = 0x73696d65, + kIOHibernateHeaderInvalidSignature = 0x7a7a7a7a +}; + +// kind for hibernate_set_page_state() +enum +{ + kIOHibernatePageStateFree = 0, + kIOHibernatePageStateWiredSave = 1, + kIOHibernatePageStateUnwiredSave = 2 +}; + +#define kIOHibernateModeKey "Hibernate Mode" +#define kIOHibernateFileKey "Hibernate File" +#define kIOHibernateFreeRatioKey "Hibernate Free Ratio" +#define kIOHibernateFreeTimeKey "Hibernate Free Time" + +#define kIOHibernateStateKey "IOHibernateState" +#define kIOHibernateFeatureKey "Hibernation" +#define kIOHibernatePreviewBufferKey "IOPreviewBuffer" + +#define kIOHibernatePreviewActiveKey "IOHibernatePreviewActive" +// values for kIOHibernatePreviewActiveKey +enum { + kIOHibernatePreviewActive = 0x00000001, + kIOHibernatePreviewUpdates = 0x00000002 +}; + +#define kIOHibernateBootImageKey "boot-image" +#define kIOHibernateBootImageKeyKey "boot-image-key" +#define kIOHibernateBootSignatureKey "boot-signature" + +#define kIOHibernateMemorySignatureKey "memory-signature" +#define kIOHibernateMemorySignatureEnvKey "mem-sig" +#define kIOHibernateMachineSignatureKey "machine-signature" + +#define kIOHibernateRTCVariablesKey "IOHibernateRTCVariables" + +#define kIOHibernateBootSwitchVarsKey "boot-switch-vars" + + +#ifdef __cplusplus +} +#endif diff --git a/i386/boot2/Makefile b/i386/boot2/Makefile new file mode 100644 index 0000000..0ce2b16 --- /dev/null +++ b/i386/boot2/Makefile @@ -0,0 +1,210 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +BINROOT = $(SRCROOT)/bin +OBJROOT = $(SRCROOT)/obj/i386/boot2 +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +VPATH = $(SYMROOT) + +# Makefile for i386 boot program +# define FLOPPY and SMALL using DEFINES macro as necessary + +PNGCRUSH = `which pngcrush` +PNGOPTIONS = -rem cHRM -rem gAMA -rem iCCP -rem sRGB + +DIR = boot2 +include ${SRCROOT}/Make.rules + +OPTIM = -Os -Oz +CFLAGS = $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ -include $(SRCROOT)/autoconf.h + +DEFINES= +CONFIG = hd +SYMDIR = $(SYMROOT) +LIBSADIR = ../libsa +LIBSAIODIR = ../libsaio +THEME = $(CONFIG_EMBEDED_THEME) +THEMEDIR = ../../artwork/themes/$(THEME) +INC = -I. -I$(SRCROOT) -I$(SYMDIR) -I$(LIBSADIR) -I$(LIBSAIODIR) -I${SRCROOT}/i386/include + +LIBS= -L$(SYMDIR) -lsaio -lsa -lklibc +LIBDEP= libsaio.a libsa.a libklibc.a + +OTHER_FILES = + +# The ordering is important; +# boot2.o must be first. +OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \ + ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o \ + modules_support.o boot_modules.o +# button.o browser.o scrollbar.o == NOTYET +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +UTILDIR = ../util +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) +BOOT2ADDR = 20200 +MAXBOOTSIZE = 458240 + + +# +# Strings used to retrieve the start location for the Symbols.dylib module +# +SYMBOLS_MODULE = Symbols.dylib +SYMBOL_START= _symbols_module_start +SYMBOL_ADDR = $(shell printf "%d" 0x`nm -s __DATA __data $(SYMROOT)/boot.sys | grep " $(SYMBOL_START)$$" | cut -f 1 -d " "`) +DATA_OFFSET = $(shell otool -l $(SYMROOT)/boot.sys | grep __data -A 4 | grep __DATA -A 3 | tail -n 1 | cut -f 6 -d " ") +DATA_ADDR = $(shell printf "%d" `otool -l $(SYMROOT)/boot.sys | grep __data -A 4 | grep __DATA -A 3 | head -n 2 | tail -n 1 | cut -f 8 -d " "`) +PATCH_ADDR = $(shell echo ${SYMBOL_ADDR}-${DATA_ADDR}+${DATA_OFFSET} | bc) + +#### NOTE #### This value is currently *not* calculated and *should* be. It is currently determined experimentally… +DATA_PAD = 3582 + +all: $(DIRS_NEEDED) boot all-recursive + +ifeq (${CONFIG_EMBED_THEME}, y) + +boot: $(CONFIG_HEADERS) $(SYMROOT)/art.h $(SYMROOT)/embedded.h $(OBJS) $(addprefix $(SYMROOT)/, $(LIBDEP)) + +else + +boot: $(CONFIG_HEADERS) $(SYMROOT)/embedded.h $(OBJS) $(addprefix $(SYMROOT)/, $(LIBDEP)) + + +endif + @${MKDIRS} $(OBJROOT)/../boot2_modules/ + + @### First pass, don't worry abount segment alignment. + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + + +ifeq (${CONFIG_MODULES}, y) + + @# Generate the Symbols.dylib file + @echo "\t[dyldsymboltool] Symbols.dylib" + @$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE} + + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + + + @# Second pass, fixup global var locations + @${RM} $(SYMROOT)/${SYMBOLS_MODULE} + + @# Generate the Symbols.dylib file + @echo "\t[dyldsymboltool] Symbols.dylib" + @$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE} + + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys + + @#${RM} $(SYMROOT)/${SYMBOLS_MODULE} + + @$(LD) -arch i386 \ + -undefined dynamic_lookup \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + $(filter %.o,$^) $(LIBS) \ + -final_output Symbols \ + -macosx_version_min 10.6 \ + -o $(OBJROOT)/Symbols_LINKER_ONLY.dylib + +else + @echo "\t[LD] boot.sys" + @$(CC) -Wl,-preload -Wl,-alias,boot2,start \ + -nostdlib -arch i386 -Wl,-pie \ + -Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \ + -Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \ + -Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \ + -Wl,-read_only_relocs,suppress \ + -lcc_kext \ + $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \ + -o ${SYMROOT}/$@.sys +endif + + + @echo "\t[MACHOCONV] boot" + @$(SYMROOT)/machOconv ${SYMROOT}/$@.sys $(SYMROOT)/$@ &> /dev/null + + @( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \ + if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\ + then \ + echo "\t******* boot is $$size bytes *******"; \ + echo "Booter executable larger than $(MAXBOOTSIZE) bytes" ;\ + rm $(SYMROOT)/boot ;\ + exit 1;\ + else \ + echo "\t******* boot is $$size bytes *******"; \ + fi) + +$(SYMROOT)/art.h: + @if [ "$(PNGCRUSH)" ]; then \ + echo "optimizing art files ...\n$(PNGCRUSH) $(PNGOPTIONS) artwork/$(THEME)"; \ + cd $(THEMEDIR) && find . -name '*.png' -exec $(PNGCRUSH) -q $(PNGOPTIONS) -d $(SYMROOT)/embed {} \;; \ + cp theme.plist $(SYMROOT)/embed; \ + else \ + cp -R $(THEMEDIR) $(SYMROOT)/embed; \ + fi; + @echo "#ifndef __BOOT2_ART_H" >> $(SYMROOT)/art.h + @echo "#define __BOOT2_ART_H" >> $(SYMROOT)/art.h + @cd $(SYMROOT)/embed && find . -name 'theme.plist' -exec xxd -i >> $(SYMROOT)/art.h {} \; + @cd $(SYMROOT)/embed && find . -name '*.png' -exec xxd -i >> $(SYMROOT)/art.h {} \; + + @echo "typedef struct {" >> $(SYMROOT)/art.h + @echo " char name[32];" >> $(SYMROOT)/art.h + @echo " unsigned char *pngdata;" >> $(SYMROOT)/art.h + @echo " unsigned int *length;" >> $(SYMROOT)/art.h + @echo "} embeddedpng_t;" >> $(SYMROOT)/art.h + @echo "" >> $(SYMROOT)/art.h + @echo "embeddedpng_t embeddedImages[] = {" >> $(SYMROOT)/art.h + @cd $(SYMROOT)/embed && find . -name '*.png' | sort | cut -f 2 -d '/' | cut -f 1 -d '.' | \ + awk '{ printf "\t{.name = \"%s\", .pngdata = __%s_png, .length = &__%s_png_len},\n", $$1, $$1, $$1 }' >> $(SYMROOT)/art.h + @echo "};" >> $(SYMROOT)/art.h + + @echo "#endif /* !__BOOT2_ART_H */" >> $(SYMROOT)/art.h ;\ + +$(SYMROOT)/embedded.h: + @cd $(SYMROOT)/../../doc && xxd -i BootHelp.txt > $(SYMROOT)/embedded.h + + +#dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(SYMROOT)/boot $(SYMROOT)/boot.sys $(SYMROOT)/embedded.h $(OBJROOT)/Symbols_LINKER_ONLY.dylib; do \ + if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @if [ -d "$(OBJROOT)" ];then echo "\t[RM] all objects in $(OBJROOT)"; fi + @rm -f $(SYMROOT)/boot $(SYMROOT)/boot.sys $(SYMROOT)/embedded.h $(OBJS) + @rm -rf $(OBJROOT) diff --git a/i386/boot2/WKdm.h b/i386/boot2/WKdm.h new file mode 100644 index 0000000..be3ca2d --- /dev/null +++ b/i386/boot2/WKdm.h @@ -0,0 +1,227 @@ +/* direct-mapped partial matching compressor with simple 22/10 split + * + * Compresses buffers using a dictionary based match and partial match + * (high bits only or full match) scheme. + * + * Paul Wilson -- wilson@cs.utexas.edu + * Scott F. Kaplan -- sfkaplan@cs.utexas.edu + * September 1997 + */ + +/* compressed output format, in memory order + * 1. a four-word HEADER containing four one-word values: + * i. a one-word code saying what algorithm compressed the data + * ii. an integer WORD offset into the page saying + * where the queue position area starts + * iii. an integer WORD offset into the page saying where + * the low-bits area starts + * iv. an integer WORD offset into the page saying where the + * low-bits area ends + * + * 2. a 64-word TAGS AREA holding one two-bit tag for each word in + * the original (1024-word) page, packed 16 per word + * + * 3. a variable-sized FULL WORDS AREA (always word aligned and an + * integral number of words) holding full-word patterns that + * were not in the dictionary when encoded (i.e., dictionary misses) + * + * 4. a variable-sized QUEUE POSITIONS AREA (always word aligned and + * an integral number of words) holding four-bit queue positions, + * packed eight per word. + * + * 5. a variable-sized LOW BITS AREA (always word aligned and an + * integral number of words) holding ten-bit low-bit patterns + * (from partial matches), packed three per word. + */ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* ============================================================ */ +/* Included files */ + +//#include +//#include +//#include +//#include + +typedef unsigned long WK_word; + +/* at the moment we have dependencies on the page size. That should + * be changed to work for any power-of-two size that's at least 16 + * words, or something like that + */ + +#define PAGE_SIZE_IN_WORDS 1024 +#define PAGE_SIZE_IN_BYTES 4096 + +#define DICTIONARY_SIZE 16 + +/* + * macros defining the basic layout of stuff in a page + */ +#define HEADER_SIZE_IN_WORDS 4 +#define TAGS_AREA_OFFSET 4 +#define TAGS_AREA_SIZE 64 + +/* the next few are used during compression to write the header */ +#define SET_QPOS_AREA_START(compr_dest_buf,qpos_start_addr) \ + (compr_dest_buf[1] = qpos_start_addr - compr_dest_buf) +#define SET_LOW_BITS_AREA_START(compr_dest_buf,lb_start_addr) \ + (compr_dest_buf[2] = lb_start_addr - compr_dest_buf) +#define SET_LOW_BITS_AREA_END(compr_dest_buf,lb_end_addr) \ + (compr_dest_buf[3] = lb_end_addr - compr_dest_buf) + +/* the next few are only use during decompression to read the header */ +#define TAGS_AREA_START(decomp_src_buf) \ + (decomp_src_buf + TAGS_AREA_OFFSET) +#define TAGS_AREA_END(decomp_src_buf) \ + (TAGS_AREA_START(decomp_src_buf) + TAGS_AREA_SIZE) +#define FULL_WORD_AREA_START(the_buf) TAGS_AREA_END(the_buf) +#define QPOS_AREA_START(decomp_src_buf) \ + (decomp_src_buf + decomp_src_buf[1]) +#define LOW_BITS_AREA_START(decomp_src_buf) \ + (decomp_src_buf + (decomp_src_buf[2])) +#define QPOS_AREA_END(the_buf) LOW_BITS_AREA_START(the_buf) +#define LOW_BITS_AREA_END(decomp_src_buf) \ + (decomp_src_buf + (decomp_src_buf[3])) + +/* ============================================================ */ +/* Types and structures */ + +/* A structure to store each element of the dictionary. */ +typedef WK_word DictionaryElement; + +/* ============================================================ */ +/* Misc constants */ + +#define BITS_PER_WORD 32 +#define BYTES_PER_WORD 4 +#define NUM_LOW_BITS 10 +#define LOW_BITS_MASK 0x3FF +#define ALL_ONES_MASK 0xFFFFFFFF + +#define TWO_BITS_PACKING_MASK 0x03030303 +#define FOUR_BITS_PACKING_MASK 0x0F0F0F0F +#define TEN_LOW_BITS_MASK 0x000003FF +#define TWENTY_TWO_HIGH_BITS_MASK 0xFFFFFC00 + +/* Tag values. NOTE THAT CODE MAY DEPEND ON THE NUMBERS USED. + * Check for conditionals doing arithmetic on these things + * before changing them + */ +#define ZERO_TAG 0x0 +#define PARTIAL_TAG 0x1 +#define MISS_TAG 0x2 +#define EXACT_TAG 0x3 + +#define BITS_PER_BYTE 8 + +/* ============================================================ */ +/* Global macros */ + +/* Shift out the low bits of a pattern to give the high bits pattern. + The stripped patterns are used for initial tests of partial + matches. */ +#define HIGH_BITS(word_pattern) (word_pattern >> NUM_LOW_BITS) + +/* String the high bits of a pattern so the low order bits can + be included in an encoding of a partial match. */ +#define LOW_BITS(word_pattern) (word_pattern & LOW_BITS_MASK) + +#if defined DEBUG_WK +#define DEBUG_PRINT_1(string) printf (string) +#define DEBUG_PRINT_2(string,value) printf(string, value) +#else +#define DEBUG_PRINT_1(string) +#define DEBUG_PRINT_2(string, value) +#endif + +/* Set up the dictionary before performing compression or + decompression. Each element is loaded with some value, the + high-bits version of that value, and a next pointer. */ +#define PRELOAD_DICTIONARY { \ + dictionary[0] = 1; \ + dictionary[1] = 1; \ + dictionary[2] = 1; \ + dictionary[3] = 1; \ + dictionary[4] = 1; \ + dictionary[5] = 1; \ + dictionary[6] = 1; \ + dictionary[7] = 1; \ + dictionary[8] = 1; \ + dictionary[9] = 1; \ + dictionary[10] = 1; \ + dictionary[11] = 1; \ + dictionary[12] = 1; \ + dictionary[13] = 1; \ + dictionary[14] = 1; \ + dictionary[15] = 1; \ +} + +/* these are the constants for the hash function lookup table. + * Only zero maps to zero. The rest of the tabale is the result + * of appending 17 randomizations of the multiples of 4 from + * 4 to 56. Generated by a Scheme script in hash.scm. + */ +#define HASH_LOOKUP_TABLE_CONTENTS { \ + 0, 52, 8, 56, 16, 12, 28, 20, 4, 36, 48, 24, 44, 40, 32, 60, \ + 8, 12, 28, 20, 4, 60, 16, 36, 24, 48, 44, 32, 52, 56, 40, 12, \ + 8, 48, 16, 52, 60, 28, 56, 32, 20, 24, 36, 40, 44, 4, 8, 40, \ + 60, 32, 20, 44, 4, 36, 52, 24, 16, 56, 48, 12, 28, 16, 8, 40, \ + 36, 28, 32, 12, 4, 44, 52, 20, 24, 48, 60, 56, 40, 48, 8, 32, \ + 28, 36, 4, 44, 20, 56, 60, 24, 52, 16, 12, 12, 4, 48, 20, 8, \ + 52, 16, 60, 24, 36, 44, 28, 56, 40, 32, 36, 20, 24, 60, 40, 44, \ + 52, 16, 32, 4, 48, 8, 28, 56, 12, 28, 32, 40, 52, 36, 16, 20, \ + 48, 8, 4, 60, 24, 56, 44, 12, 8, 36, 24, 28, 16, 60, 20, 56, \ + 32, 40, 48, 12, 4, 44, 52, 44, 40, 12, 56, 8, 36, 24, 60, 28, \ + 48, 4, 32, 20, 16, 52, 60, 12, 24, 36, 8, 4, 16, 56, 48, 44, \ + 40, 52, 32, 20, 28, 32, 12, 36, 28, 24, 56, 40, 16, 52, 44, 4, \ + 20, 60, 8, 48, 48, 52, 12, 20, 32, 44, 36, 28, 4, 40, 24, 8, \ + 56, 60, 16, 36, 32, 8, 40, 4, 52, 24, 44, 20, 12, 28, 48, 56, \ + 16, 60, 4, 52, 60, 48, 20, 16, 56, 44, 24, 8, 40, 12, 32, 28, \ + 36, 24, 32, 12, 4, 20, 16, 60, 36, 28, 8, 52, 40, 48, 44, 56 \ +} + +#define HASH_TO_DICT_BYTE_OFFSET(pattern) \ + (hashLookupTable[((pattern) >> 10) & 0xFF]) + +extern const char hashLookupTable[]; + +/* EMIT... macros emit bytes or words into the intermediate arrays + */ + +#define EMIT_BYTE(fill_ptr, byte_value) {*fill_ptr = byte_value; fill_ptr++;} +#define EMIT_WORD(fill_ptr,word_value) {*fill_ptr = word_value; fill_ptr++;} + +/* RECORD... macros record the results of modeling in the intermediate + * arrays + */ + +#define RECORD_ZERO { EMIT_BYTE(next_tag,ZERO_TAG); } + +#define RECORD_EXACT(queue_posn) EMIT_BYTE(next_tag,EXACT_TAG); \ + EMIT_BYTE(next_qp,(queue_posn)); + +#define RECORD_PARTIAL(queue_posn,low_bits_pattern) { \ + EMIT_BYTE(next_tag,PARTIAL_TAG); \ + EMIT_BYTE(next_qp,(queue_posn)); \ + EMIT_WORD(next_low_bits,(low_bits_pattern)) } + +#define RECORD_MISS(word_pattern) EMIT_BYTE(next_tag,MISS_TAG); \ + EMIT_WORD(next_full_patt,(word_pattern)); + +void +WKdm_decompress (WK_word* src_buf, + WK_word* dest_buf, + unsigned int words); +unsigned int +WKdm_compress (WK_word* src_buf, + WK_word* dest_buf, + unsigned int num_input_words); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/i386/boot2/WKdmDecompress.c b/i386/boot2/WKdmDecompress.c new file mode 100644 index 0000000..fd230ca --- /dev/null +++ b/i386/boot2/WKdmDecompress.c @@ -0,0 +1,285 @@ +#include +#include "WKdm.h" + +/* Part of __HIB section */ + +/*************************************************************************** + * THE UNPACKING ROUTINES should GO HERE + */ + +const char hashLookupTable [] = HASH_LOOKUP_TABLE_CONTENTS; + +#if 0 +#define GET_NEXT_TAG tags[tagsIndex++] +#define GET_NEXT_FULL_PATTERN fullPatterns[fullPatternsIndex++] +#define GET_NEXT_LOW_BITS lowBits[lowBitsIndex++] +#define GET_NEXT_DICTIONARY_INDEX dictionaryIndices[dictionaryIndicesIndex++] +#endif + +/* WK_unpack_2bits takes any number of words containing 16 two-bit values + * and unpacks them into four times as many words containg those + * two bit values as bytes (with the low two bits of each byte holding + * the actual value. + */ +static WK_word* +WK_unpack_2bits(WK_word *input_buf, + WK_word *input_end, + WK_word *output_buf) { + + register WK_word *input_next = input_buf; + register WK_word *output_next = output_buf; + register WK_word packing_mask = TWO_BITS_PACKING_MASK; + + /* loop to repeatedly grab one input word and unpack it into + * 4 output words. This loop could be unrolled a little---it's + * designed to be easy to do that. + */ + while (input_next < input_end) { + register WK_word temp = input_next[0]; + DEBUG_PRINT_2("Unpacked tags word: %.8x\n", temp); + output_next[0] = temp & packing_mask; + output_next[1] = (temp >> 2) & packing_mask; + output_next[2] = (temp >> 4) & packing_mask; + output_next[3] = (temp >> 6) & packing_mask; + + output_next += 4; + input_next++; + } + + return output_next; + +} + +/* unpack four bits consumes any number of words (between input_buf + * and input_end) holding 8 4-bit values per word, and unpacks them + * into twice as many words, with each value in a separate byte. + * (The four-bit values occupy the low halves of the bytes in the + * result). + */ +static WK_word* +WK_unpack_4bits(WK_word *input_buf, + WK_word *input_end, + WK_word *output_buf) { + + register WK_word *input_next = input_buf; + register WK_word *output_next = output_buf; + register WK_word packing_mask = FOUR_BITS_PACKING_MASK; + + + /* loop to repeatedly grab one input word and unpack it into + * 4 output words. This loop should probably be unrolled + * a little---it's designed to be easy to do that. + */ + while (input_next < input_end) { + register WK_word temp = input_next[0]; + DEBUG_PRINT_2("Unpacked dictionary indices word: %.8x\n", temp); + output_next[0] = temp & packing_mask; + output_next[1] = (temp >> 4) & packing_mask; + + output_next += 2; + input_next++; + } + + return output_next; + +} + +/* unpack_3_tenbits unpacks three 10-bit items from (the low 30 bits of) + * a 32-bit word + */ +static WK_word* +WK_unpack_3_tenbits(WK_word *input_buf, + WK_word *input_end, + WK_word *output_buf) { + + register WK_word *input_next = input_buf; + register WK_word *output_next = output_buf; + register WK_word packing_mask = LOW_BITS_MASK; + + /* loop to fetch words of input, splitting each into three + * words of output with 10 meaningful low bits. This loop + * probably ought to be unrolled and maybe coiled + */ + while (input_next < input_end) { + register WK_word temp = input_next[0]; + + output_next[0] = temp & packing_mask; + output_next[1] = (temp >> 10) & packing_mask; + output_next[2] = temp >> 20; + + input_next++; + output_next += 3; + } + + return output_next; + +} + +/********************************************************************* + * WKdm_decompress --- THE DECOMPRESSOR + * Expects WORD pointers to the source and destination buffers + * and a page size in words. The page size had better be 1024 unless + * somebody finds the places that are dependent on the page size and + * fixes them + */ + +void +WKdm_decompress (WK_word* src_buf, + WK_word* dest_buf, + __unused unsigned int words) +{ + + DictionaryElement dictionary[DICTIONARY_SIZE]; + + /* arrays that hold output data in intermediate form during modeling */ + /* and whose contents are packed into the actual output after modeling */ + + /* sizes of these arrays should be increased if you want to compress + * pages larger than 4KB + */ + WK_word tempTagsArray[300]; /* tags for everything */ + WK_word tempQPosArray[300]; /* queue positions for matches */ + WK_word tempLowBitsArray[1200]; /* low bits for partial matches */ + + PRELOAD_DICTIONARY; + +#ifdef WK_DEBUG + printf("\nIn DECOMPRESSOR\n"); + printf("tempTagsArray is at %u\n", (unsigned long int) tempTagsArray); + printf("tempQPosArray is at %u\n", (unsigned long int) tempQPosArray); + printf("tempLowBitsArray is at %u\n", (unsigned long int) tempLowBitsArray); + + printf(" first four words of source buffer are:\n"); + printf(" %u\n %u\n %u\n %u\n", + src_buf[0], src_buf[1], src_buf[2], src_buf[3]); + + { int i; + WK_word *arr =(src_buf + TAGS_AREA_OFFSET + (PAGE_SIZE_IN_WORDS / 16)); + + printf(" first 20 full patterns are: \n"); + for (i = 0; i < 20; i++) { + printf(" %d", arr[i]); + } + printf("\n"); + } +#endif + + WK_unpack_2bits(TAGS_AREA_START(src_buf), + TAGS_AREA_END(src_buf), + tempTagsArray); + +#ifdef WK_DEBUG + { int i; + char* arr = (char *) tempTagsArray; + + printf(" first 200 tags are: \n"); + for (i = 0; i < 200; i++) { + printf(" %d", arr[i]); + } + printf("\n"); + } +#endif + + WK_unpack_4bits(QPOS_AREA_START(src_buf), + QPOS_AREA_END(src_buf), + tempQPosArray); + +#ifdef WK_DEBUG + { int i; + char* arr = (char *) tempQPosArray; + + printf(" first 200 queue positions are: \n"); + for (i = 0; i < 200; i++) { + printf(" %d", arr[i]); + } + printf("\n"); + } +#endif + + WK_unpack_3_tenbits(LOW_BITS_AREA_START(src_buf), + LOW_BITS_AREA_END(src_buf), + tempLowBitsArray); + +#ifdef WK_DEBUG + printf("AFTER UNPACKING, about to enter main block \n"); +#endif + + { + register char *next_tag = (char *) tempTagsArray; + char *tags_area_end = + ((char *) tempTagsArray) + PAGE_SIZE_IN_WORDS; + char *next_q_pos = (char *) tempQPosArray; + WK_word *next_low_bits = tempLowBitsArray; + WK_word *next_full_word = FULL_WORD_AREA_START(src_buf); + + WK_word *next_output = dest_buf; + +#ifdef WK_DEBUG + printf("next_output is %u\n", next_output); + + printf("next_tag is %u \n", next_tag); + printf("tags_area_end is %u\n", tags_area_end); + printf("next_q_pos is %u\n", next_q_pos); + printf("next_low_bits is %u\n", next_low_bits); + printf("next_full_word is %u\n", next_full_word); +#endif + + /* this loop should probably be unrolled. Maybe we should unpack + * as 4 bit values, giving two consecutive tags, and switch on + * that 16 ways to decompress 2 words at a whack + */ + while (next_tag < tags_area_end) { + + char tag = next_tag[0]; + + switch(tag) { + + case ZERO_TAG: { + *next_output = 0; + break; + } + case EXACT_TAG: { + WK_word *dict_location = dictionary + *(next_q_pos++); + /* no need to replace dict. entry if matched exactly */ + *next_output = *dict_location; + break; + } + case PARTIAL_TAG: { + WK_word *dict_location = dictionary + *(next_q_pos++); + { + WK_word temp = *dict_location; + + /* strip out low bits */ + temp = ((temp >> NUM_LOW_BITS) << NUM_LOW_BITS); + + /* add in stored low bits from temp array */ + temp = temp | *(next_low_bits++); + + *dict_location = temp; /* replace old value in dict. */ + *next_output = temp; /* and echo it to output */ + } + break; + } + case MISS_TAG: { + WK_word missed_word = *(next_full_word++); + WK_word *dict_location = + (WK_word *) + (((char *) dictionary) + HASH_TO_DICT_BYTE_OFFSET(missed_word)); + *dict_location = missed_word; + *next_output = missed_word; + break; + } + } + next_tag++; + next_output++; + } + +#ifdef WK_DEBUG + printf("AFTER DECOMPRESSING\n"); + printf("next_output is %u\n", (unsigned long int) next_output); + printf("next_tag is %u\n", (unsigned long int) next_tag); + printf("next_full_word is %u\n", (unsigned long int) next_full_word); + printf("next_q_pos is %u\n", (unsigned long int) next_q_pos); +#endif + } +} diff --git a/i386/boot2/appleClut8.h b/i386/boot2/appleClut8.h new file mode 100644 index 0000000..50416f7 --- /dev/null +++ b/i386/boot2/appleClut8.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOT2_APPLECLUT8_H +#define __BOOT2_APPLECLUT8_H + +static const unsigned char appleClut8[ 256 * 3 ] = +{ + 0xff,0xff,0xff, 0xbf,0xbf,0xbf, 0xbe,0xbe,0xbe, 0xbd,0xbd,0xbd, + 0xbc,0xbc,0xbc, 0xff,0xff,0x00, 0xba,0xba,0xba, 0xb9,0xb9,0xb9, + 0xb8,0xb8,0xb8, 0xb7,0xb7,0xb7, 0xb6,0xb6,0xb6, 0xb5,0xb5,0xb5, + 0xb4,0xb4,0xb4, 0xb3,0xb3,0xb3, 0xb2,0xb2,0xb2, 0x00,0x00,0x00, + 0xb1,0xb1,0xb1, 0xb0,0xb0,0xb0, 0xaf,0xaf,0xaf, 0xae,0xae,0xae, + 0xad,0xad,0xad, 0xac,0xac,0xac, 0xab,0xab,0xab, 0xaa,0xaa,0xaa, + 0xff,0x00,0xff, 0xa9,0xa9,0xa9, 0xa8,0xa8,0xa8, 0xa7,0xa7,0xa7, + 0xa6,0xa6,0xa6, 0xa5,0xa5,0xa5, 0xa4,0xa4,0xa4, 0xa3,0xa3,0xa3, + 0xa2,0xa2,0xa2, 0xa1,0xa1,0xa1, 0xa0,0xa0,0xa0, 0xff,0x00,0x00, + 0x9f,0x9f,0x9f, 0x9e,0x9e,0x9e, 0x9d,0x9d,0x9d, 0x9c,0x9c,0x9c, + 0x9b,0x9b,0x9b, 0x9a,0x9a,0x9a, 0xcc,0xcc,0xff, 0xcc,0xcc,0xcc, + 0x99,0x99,0x99, 0x98,0x98,0x98, 0x97,0x97,0x97, 0x96,0x96,0x96, + 0x95,0x95,0x95, 0x94,0x94,0x94, 0x93,0x93,0x93, 0x92,0x92,0x92, + 0x91,0x91,0x91, 0x90,0x90,0x90, 0x8f,0x8f,0x8f, 0x8e,0x8e,0x8e, + 0x8d,0x8d,0x8d, 0x8c,0x8c,0x8c, 0x8b,0x8b,0x8b, 0x8a,0x8a,0x8a, + 0x89,0x89,0x89, 0x87,0x87,0x87, 0x86,0x86,0x86, 0x85,0x85,0x85, + 0x84,0x84,0x84, 0x83,0x83,0x83, 0x82,0x82,0x82, 0x81,0x81,0x81, + 0x80,0x80,0x80, 0x7f,0x7f,0x7f, 0x7e,0x7e,0x7e, 0x7d,0x7d,0x7d, + 0x7c,0x7c,0x7c, 0x7b,0x7b,0x7b, 0x7a,0x7a,0x7a, 0x79,0x79,0x79, + 0x78,0x78,0x78, 0x76,0x76,0x76, 0x75,0x75,0x75, 0x74,0x74,0x74, + 0x73,0x73,0x73, 0x72,0x72,0x72, 0x71,0x71,0x71, 0x70,0x70,0x70, + 0x6f,0x6f,0x6f, 0x6e,0x6e,0x6e, 0x6d,0x6d,0x6d, 0x6c,0x6c,0x6c, + 0x6b,0x6b,0x6b, 0x6a,0x6a,0x6a, 0x69,0x69,0x69, 0x68,0x68,0x68, + 0x67,0x67,0x67, 0x66,0x66,0x66, 0x64,0x64,0x64, 0x63,0x63,0x63, + 0x62,0x62,0x62, 0x61,0x61,0x61, 0x60,0x60,0x60, 0x5f,0x5f,0x5f, + 0x5e,0x5e,0x5e, 0x5d,0x5d,0x5d, 0x5c,0x5c,0x5c, 0x5b,0x5b,0x5b, + 0x5a,0x5a,0x5a, 0x59,0x59,0x59, 0x58,0x58,0x58, 0x57,0x57,0x57, + 0x56,0x56,0x56, 0x54,0x54,0x54, 0x53,0x53,0x53, 0x52,0x52,0x52, + 0x51,0x51,0x51, 0x50,0x50,0x50, 0x4f,0x4f,0x4f, 0x4e,0x4e,0x4e, + 0x4d,0x4d,0x4d, 0x4c,0x4c,0x4c, 0x4b,0x4b,0x4b, 0x4a,0x4a,0x4a, + 0x49,0x49,0x49, 0x48,0x48,0x48, 0x47,0x47,0x47, 0x46,0x46,0x46, + 0x45,0x45,0x45, 0x43,0x43,0x43, 0x42,0x42,0x42, 0x41,0x41,0x41, + 0x40,0x40,0x40, 0x3f,0x3f,0x3f, 0x3e,0x3e,0x3e, 0x3d,0x3d,0x3d, + 0x3c,0x3c,0x3c, 0x3b,0x3b,0x3b, 0x3a,0x3a,0x3a, 0x39,0x39,0x39, + 0x38,0x38,0x38, 0x37,0x37,0x37, 0x36,0x36,0x36, 0x35,0x35,0x35, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x00,0xff,0xff, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x00,0xff,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x00,0x00,0xff, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0xdd,0x00,0x00, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x00,0xbb,0x00, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, + 0x65,0x65,0x65, 0x65,0x65,0x65, 0x65,0x65,0x65, 0xbb,0xbb,0xbb, + 0x65,0x65,0x65, 0x88,0x88,0x88, 0x77,0x77,0x77, 0x55,0x55,0x55, + 0x44,0x44,0x44, 0x22,0x22,0x22, 0x65,0x65,0x65, 0x00,0x00,0x00 +}; + +#endif /* !__BOOT2_APPLECLUT8_H */ diff --git a/i386/boot2/appleboot.h b/i386/boot2/appleboot.h new file mode 100644 index 0000000..f14abd1 --- /dev/null +++ b/i386/boot2/appleboot.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * appleboot.h - Apple logo shown durring boot + * + * Copyright (c) 2002 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#define kAppleBootWidth (128) +#define kAppleBootHeight (128) +#define kAppleBootOffset (0) +#define kAppleBootFrames (1) +#define kAppleBootFPS (0) +#define kAppleBootRLEBlocks (686) + +// The original data was 16K in size (128x128) and would make the booter +// cross a 64K segment boundary. boot0 cannot load more than 127 sectors +// without changes. To eiminate that complexity, the data was run length +// encoded to save space. The reduced size is 1372 bytes. + +const unsigned char gAppleBootPictRLE[] = +{ + 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0x50, 0x01, 0x01, 0x02, 0x01, 0x17, + 0x01, 0x34, 0x01, 0x47, 0x03, 0x50, 0x01, 0x13, 0x76, 0x01, 0x01, 0x03, + 0x01, 0x20, 0x01, 0x40, 0x06, 0x50, 0x01, 0x13, 0x75, 0x01, 0x01, 0x1a, + 0x01, 0x42, 0x07, 0x50, 0x01, 0xfa, 0x01, 0x0a, 0x73, 0x01, 0x01, 0x07, + 0x01, 0x34, 0x09, 0x50, 0x01, 0x43, 0x01, 0x02, 0x72, 0x01, 0x01, 0x0e, + 0x01, 0x43, 0x0a, 0x50, 0x01, 0x36, 0x72, 0x01, 0x01, 0x14, 0x01, 0x4a, + 0x0b, 0x50, 0x01, 0x20, 0x71, 0x01, 0x01, 0x12, 0x01, 0x4b, 0x0b, 0x50, + 0x01, 0x4d, 0x01, 0x0b, 0x70, 0x01, 0x01, 0x0b, 0x01, 0x48, 0x0c, 0x50, + 0x01, 0xf9, 0x70, 0x01, 0x01, 0x03, 0x01, 0x3e, 0x0d, 0x50, 0x01, 0x1f, + 0x70, 0x01, 0x01, 0x2f, 0x0d, 0x50, 0x01, 0x48, 0x01, 0x06, 0x6f, 0x01, + 0x01, 0x15, 0x01, 0x4f, 0x0d, 0x50, 0x01, 0x27, 0x6f, 0x01, 0x01, 0x02, + 0x01, 0x3f, 0x0d, 0x50, 0x01, 0x45, 0x01, 0xf7, 0x6f, 0x01, 0x01, 0x1d, + 0x0e, 0x50, 0x01, 0x19, 0x6f, 0x01, 0x01, 0x02, 0x01, 0x40, 0x0d, 0x50, + 0x01, 0x2f, 0x70, 0x01, 0x01, 0x15, 0x0d, 0x50, 0x01, 0x3b, 0x01, 0x03, + 0x70, 0x01, 0x01, 0x34, 0x0c, 0x50, 0x01, 0x3f, 0x01, 0x07, 0x70, 0x01, + 0x01, 0xf7, 0x01, 0x47, 0x0b, 0x50, 0x01, 0xf9, 0x01, 0x07, 0x71, 0x01, + 0x01, 0x14, 0x0b, 0x50, 0x01, 0x36, 0x01, 0xf7, 0x72, 0x01, 0x01, 0x24, + 0x09, 0x50, 0x01, 0x4d, 0x01, 0x28, 0x74, 0x01, 0x01, 0x33, 0x08, 0x50, + 0x01, 0x3f, 0x01, 0x14, 0x75, 0x01, 0x01, 0x3a, 0x06, 0x50, 0x01, 0x41, + 0x01, 0x1f, 0x01, 0x02, 0x76, 0x01, 0x01, 0x3a, 0x03, 0x50, 0x01, 0x48, + 0x01, 0x35, 0x01, 0x17, 0x01, 0x02, 0x78, 0x01, 0x01, 0x15, 0x01, 0x33, + 0x01, 0x27, 0x01, 0x15, 0x01, 0xf7, 0x67, 0x01, 0x01, 0x02, 0x01, 0x08, + 0x01, 0x0e, 0x01, 0x13, 0x01, 0x14, 0x01, 0x12, 0x01, 0x0d, 0x01, 0x06, + 0x01, 0x02, 0x1c, 0x01, 0x01, 0x04, 0x01, 0x0b, 0x01, 0x12, 0x01, 0x17, + 0x01, 0x19, 0x01, 0x15, 0x01, 0x11, 0x01, 0x08, 0x01, 0x02, 0x4e, 0x01, + 0x01, 0x02, 0x01, 0x11, 0x01, 0x26, 0x01, 0x39, 0x01, 0x44, 0x01, 0x4c, + 0x01, 0x4f, 0x02, 0x50, 0x01, 0x4f, 0x01, 0x4d, 0x01, 0x4a, 0x01, 0x3f, + 0x01, 0x31, 0x01, 0x19, 0x01, 0xf7, 0x15, 0x01, 0x01, 0x0b, 0x01, 0x1c, + 0x01, 0x2e, 0x01, 0xf9, 0x01, 0x46, 0x01, 0x4d, 0x04, 0x50, 0x01, 0x4f, + 0x01, 0x4b, 0x01, 0x42, 0x01, 0x34, 0x01, 0x1f, 0x01, 0x0a, 0x49, 0x01, + 0x01, 0xf7, 0x01, 0x21, 0x01, 0x3f, 0x01, 0x4f, 0x0d, 0x50, 0x01, 0x47, + 0x01, 0x2d, 0x01, 0x0d, 0x10, 0x01, 0x01, 0x0d, 0x01, 0x25, 0x01, 0x3d, + 0x01, 0xfa, 0x0e, 0x50, 0x01, 0x4c, 0x01, 0x37, 0x01, 0x15, 0x45, 0x01, + 0x01, 0x04, 0x01, 0x25, 0x01, 0x45, 0x12, 0x50, 0x01, 0x4d, 0x01, 0x39, + 0x01, 0x19, 0x01, 0x02, 0x0a, 0x01, 0x01, 0x09, 0x01, 0x21, 0x01, 0xf9, + 0x01, 0x4d, 0x14, 0x50, 0x01, 0xf9, 0x01, 0x15, 0x42, 0x01, 0x01, 0x17, + 0x01, 0x42, 0x17, 0x50, 0x01, 0x42, 0x01, 0x27, 0x01, 0x0e, 0x01, 0x02, + 0x03, 0x01, 0x01, 0x02, 0x01, 0x0b, 0x01, 0x1f, 0x01, 0x38, 0x01, 0x4b, + 0x19, 0x50, 0x01, 0x33, 0x01, 0x06, 0x3e, 0x01, 0x01, 0x03, 0x01, 0x2e, + 0x1b, 0x50, 0x01, 0x4d, 0x01, 0x43, 0x01, 0x3a, 0x01, 0x37, 0x01, 0x3a, + 0x01, 0x42, 0x01, 0x4d, 0x1d, 0x50, 0x01, 0x42, 0x01, 0x0e, 0x3c, 0x01, + 0x01, 0x0a, 0x01, 0xf9, 0x41, 0x50, 0x01, 0x48, 0x01, 0x13, 0x3a, 0x01, + 0x01, 0x0d, 0x01, 0x45, 0x43, 0x50, 0x01, 0x4b, 0x01, 0x12, 0x38, 0x01, + 0x01, 0x10, 0x01, 0x48, 0x45, 0x50, 0x01, 0x48, 0x01, 0x0b, 0x36, 0x01, + 0x01, 0x0c, 0x01, 0x48, 0x47, 0x50, 0x01, 0x3d, 0x01, 0x03, 0x34, 0x01, + 0x01, 0x07, 0x01, 0x42, 0x49, 0x50, 0x01, 0x21, 0x34, 0x01, 0x01, 0x37, + 0x49, 0x50, 0x01, 0x42, 0x01, 0x12, 0x33, 0x01, 0x01, 0x22, 0x49, 0x50, + 0x01, 0x34, 0x01, 0xf7, 0x33, 0x01, 0x01, 0x0b, 0x01, 0x4b, 0x48, 0x50, + 0x01, 0x2c, 0x35, 0x01, 0x01, 0x36, 0x48, 0x50, 0x01, 0x29, 0x35, 0x01, + 0x01, 0x11, 0x01, 0x4f, 0x47, 0x50, 0x01, 0x2e, 0x36, 0x01, 0x01, 0x36, + 0x47, 0x50, 0x01, 0x3a, 0x01, 0x02, 0x35, 0x01, 0x01, 0x0b, 0x01, 0xfa, + 0x46, 0x50, 0x01, 0x46, 0x01, 0x08, 0x36, 0x01, 0x01, 0x26, 0x46, 0x50, + 0x01, 0x4e, 0x01, 0x15, 0x36, 0x01, 0x01, 0x02, 0x01, 0x40, 0x46, 0x50, + 0x01, 0x31, 0x37, 0x01, 0x01, 0x0e, 0x01, 0x4e, 0x45, 0x50, 0x01, 0x49, + 0x01, 0x08, 0x37, 0x01, 0x01, 0x25, 0x46, 0x50, 0x01, 0x29, 0x38, 0x01, + 0x01, 0x39, 0x45, 0x50, 0x01, 0x4c, 0x01, 0x0a, 0x37, 0x01, 0x01, 0xf7, + 0x01, 0x47, 0x45, 0x50, 0x01, 0x3a, 0x38, 0x01, 0x01, 0x10, 0x01, 0x4f, + 0x45, 0x50, 0x01, 0x22, 0x38, 0x01, 0x01, 0x1d, 0x46, 0x50, 0x01, 0x12, + 0x38, 0x01, 0x01, 0x29, 0x45, 0x50, 0x01, 0x4b, 0x01, 0x07, 0x38, 0x01, + 0x01, 0x36, 0x45, 0x50, 0x01, 0x42, 0x01, 0x02, 0x38, 0x01, 0x01, 0xf9, + 0x45, 0x50, 0x01, 0x3e, 0x39, 0x01, 0x01, 0x42, 0x45, 0x50, 0x01, 0x3c, + 0x39, 0x01, 0x01, 0x46, 0x45, 0x50, 0x01, 0x3b, 0x39, 0x01, 0x01, 0x48, + 0x45, 0x50, 0x01, 0xf9, 0x39, 0x01, 0x01, 0x48, 0x45, 0x50, 0x01, 0x3f, + 0x01, 0x02, 0x38, 0x01, 0x01, 0x46, 0x45, 0x50, 0x01, 0x48, 0x01, 0xf7, + 0x38, 0x01, 0x01, 0x43, 0x45, 0x50, 0x01, 0x4e, 0x01, 0x0e, 0x38, 0x01, + 0x01, 0x3f, 0x46, 0x50, 0x01, 0x1c, 0x38, 0x01, 0x01, 0x3a, 0x46, 0x50, + 0x01, 0x33, 0x38, 0x01, 0x01, 0x34, 0x46, 0x50, 0x01, 0x46, 0x01, 0x04, + 0x37, 0x01, 0x01, 0x2c, 0x47, 0x50, 0x01, 0x19, 0x37, 0x01, 0x01, 0x1f, + 0x47, 0x50, 0x01, 0x3a, 0x37, 0x01, 0x01, 0x15, 0x47, 0x50, 0x01, 0x4e, + 0x01, 0x11, 0x36, 0x01, 0x01, 0x0a, 0x01, 0xfa, 0x47, 0x50, 0x01, 0x37, + 0x36, 0x01, 0x01, 0x02, 0x01, 0x42, 0x47, 0x50, 0x01, 0x4f, 0x01, 0x15, + 0x36, 0x01, 0x01, 0x37, 0x48, 0x50, 0x01, 0x42, 0x01, 0x04, 0x35, 0x01, + 0x01, 0x25, 0x49, 0x50, 0x01, 0x2c, 0x35, 0x01, 0x01, 0x13, 0x49, 0x50, + 0x01, 0x4e, 0x01, 0x15, 0x34, 0x01, 0x01, 0xf7, 0x01, 0x47, 0x49, 0x50, + 0x01, 0x48, 0x01, 0x0b, 0x34, 0x01, 0x01, 0x37, 0x4a, 0x50, 0x01, 0x44, + 0x01, 0x0a, 0x33, 0x01, 0x01, 0x1f, 0x4b, 0x50, 0x01, 0x44, 0x01, 0x0d, + 0x32, 0x01, 0x01, 0x0a, 0x01, 0xfa, 0x4b, 0x50, 0x01, 0x48, 0x01, 0x17, + 0x32, 0x01, 0x01, 0x3a, 0x4c, 0x50, 0x01, 0x4f, 0x01, 0x2c, 0x01, 0x04, + 0x30, 0x01, 0x01, 0x1f, 0x4e, 0x50, 0x01, 0x41, 0x01, 0x19, 0x2f, 0x01, + 0x01, 0x07, 0x01, 0x4a, 0x4e, 0x50, 0x01, 0x44, 0x30, 0x01, 0x01, 0x33, + 0x4e, 0x50, 0x01, 0x36, 0x30, 0x01, 0x01, 0x14, 0x4e, 0x50, 0x01, 0x1f, + 0x30, 0x01, 0x01, 0x02, 0x01, 0x3f, 0x4c, 0x50, 0x01, 0x4d, 0x01, 0x0b, + 0x31, 0x01, 0x01, 0x1e, 0x4c, 0x50, 0x01, 0x3c, 0x32, 0x01, 0x01, 0x04, + 0x01, 0x44, 0x4b, 0x50, 0x01, 0x20, 0x33, 0x01, 0x01, 0x20, 0x4a, 0x50, + 0x01, 0x4a, 0x01, 0x07, 0x33, 0x01, 0x01, 0x04, 0x01, 0x43, 0x49, 0x50, + 0x01, 0x30, 0x35, 0x01, 0x01, 0x1c, 0x48, 0x50, 0x01, 0x4d, 0x01, 0x0e, + 0x35, 0x01, 0x01, 0x02, 0x01, 0x3e, 0x47, 0x50, 0x01, 0x36, 0x37, 0x01, + 0x01, 0x14, 0x01, 0x4f, 0x45, 0x50, 0x01, 0x4d, 0x01, 0x0e, 0x38, 0x01, + 0x01, 0x32, 0x45, 0x50, 0x01, 0x33, 0x39, 0x01, 0x01, 0x07, 0x01, 0x47, + 0x43, 0x50, 0x01, 0x4b, 0x01, 0x0b, 0x3a, 0x01, 0x01, 0x1c, 0x43, 0x50, + 0x01, 0x26, 0x3c, 0x01, 0x01, 0x37, 0x41, 0x50, 0x01, 0x41, 0x01, 0x04, + 0x3c, 0x01, 0x01, 0x08, 0x01, 0x48, 0x3f, 0x50, 0x01, 0x4e, 0x01, 0x13, + 0x3e, 0x01, 0x01, 0x19, 0x3f, 0x50, 0x01, 0x2d, 0x40, 0x01, 0x01, 0x2e, + 0x3d, 0x50, 0x01, 0x3f, 0x01, 0x03, 0x40, 0x01, 0x01, 0x03, 0x01, 0xf9, + 0x3b, 0x50, 0x01, 0x4a, 0x01, 0x0d, 0x42, 0x01, 0x01, 0x09, 0x01, 0x46, + 0x39, 0x50, 0x01, 0x4e, 0x01, 0x19, 0x44, 0x01, 0x01, 0x11, 0x01, 0x4b, + 0x38, 0x50, 0x01, 0x25, 0x46, 0x01, 0x01, 0x17, 0x01, 0x4d, 0x36, 0x50, + 0x01, 0x2e, 0x48, 0x01, 0x01, 0x1b, 0x01, 0x4d, 0x34, 0x50, 0x01, 0x31, + 0x4a, 0x01, 0x01, 0x17, 0x01, 0x4a, 0x14, 0x50, 0x01, 0x4d, 0x01, 0x44, + 0x01, 0x3b, 0x01, 0x34, 0x01, 0x2e, 0x01, 0x2c, 0x01, 0x2e, 0x01, 0x35, + 0x01, 0x3e, 0x01, 0x4a, 0x14, 0x50, 0x01, 0x2e, 0x4c, 0x01, 0x01, 0x0e, + 0x01, 0x41, 0x10, 0x50, 0x01, 0x4a, 0x01, 0x37, 0x01, 0x1f, 0x01, 0x0c, + 0x01, 0x03, 0x07, 0x01, 0x01, 0x06, 0x01, 0x15, 0x01, 0x2d, 0x01, 0x41, + 0x0f, 0x50, 0x01, 0x4a, 0x01, 0x1f, 0x4e, 0x01, 0x01, 0xf7, 0x01, 0x2e, + 0x01, 0xfa, 0x0b, 0x50, 0x01, 0x4f, 0x01, 0xf9, 0x01, 0x1e, 0x01, 0x07, + 0x0e, 0x01, 0x01, 0x02, 0x01, 0x14, 0x01, 0x31, 0x01, 0x48, 0x0b, 0x50, + 0x01, 0x37, 0x01, 0x0c, 0x51, 0x01, 0x01, 0x0d, 0x01, 0x2f, 0x01, 0x45, + 0x01, 0x4f, 0x05, 0x50, 0x01, 0x4f, 0x01, 0x43, 0x01, 0x2e, 0x01, 0x11, + 0x14, 0x01, 0x01, 0x07, 0x01, 0x1f, 0x01, 0x3c, 0x01, 0x4c, 0x04, 0x50, + 0x01, 0x4f, 0x01, 0x46, 0x01, 0x33, 0x01, 0x13, 0x55, 0x01, 0x01, 0x04, + 0x01, 0x12, 0x01, 0x1f, 0x01, 0x26, 0x01, 0x28, 0x01, 0x26, 0x01, 0x1e, + 0x01, 0x10, 0x01, 0x02, 0x19, 0x01, 0x01, 0x09, 0x01, 0x16, 0x01, 0x1e, + 0x01, 0x1f, 0x01, 0x1c, 0x01, 0x11, 0x01, 0x04, 0xff, 0x01, 0xff, 0x01, + 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, 0xff, 0x01, + 0xff, 0x01, 0xb3, 0x01 +}; diff --git a/i386/boot2/bmdecompress.c b/i386/boot2/bmdecompress.c new file mode 100644 index 0000000..aadb9ca --- /dev/null +++ b/i386/boot2/bmdecompress.c @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1995-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "libsa.h" + +static void +PreviewDecompress16(uint32_t * compressBuffer, + uint32_t width, uint32_t height, uint32_t row, + uint16_t * output) +{ + int i, j; + uint32_t * input; + + uint16_t * sc0 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc1 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc2 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc3 = malloc((width+2) * sizeof(uint16_t)); + uint32_t sr0, sr1, sr2, sr3; + + bzero(sc0, (width+2) * sizeof(uint16_t)); + bzero(sc1, (width+2) * sizeof(uint16_t)); + bzero(sc2, (width+2) * sizeof(uint16_t)); + bzero(sc3, (width+2) * sizeof(uint16_t)); + + uint32_t tmp1, tmp2, out; + for (j = 0; j < (height + 2); j++) + { + input = compressBuffer; + if (j < height) + input += j; + else + input += height - 1; + input = (uint32_t *)(input[3] + ((uint8_t *)compressBuffer)); + + uint32_t data = 0, repeat = 0, fetch = 0, count = 0; + sr0 = sr1 = sr2 = sr3 = 0; + + for (i = 0; i < (width + 2); i++) + { + if (i < width) + { + if (!count) + { + count = *input++; + repeat = (count & 0xff000000); + count ^= repeat; + fetch = true; + } + else + fetch = (0 == repeat); + + count--; + + if (fetch) + { + data = *((uint16_t *)input); + (*((uint16_t *)input))++; + + // grayscale + // srgb 13933, 46871, 4732 + // ntsc 19595, 38470, 7471 + data = 13933 * (0x1f & (data >> 10)) + + 46871 * (0x1f & (data >> 5)) + + 4732 * (0x1f & data); + data >>= 13; + + // 70% white, 30 % black + data *= 19661; + data += (103 << 16); + data >>= 16; + } + } + + // gauss blur + tmp2 = sr0 + data; + sr0 = data; + tmp1 = sr1 + tmp2; + sr1 = tmp2; + tmp2 = sr2 + tmp1; + sr2 = tmp1; + tmp1 = sr3 + tmp2; + sr3 = tmp2; + + tmp2 = sc0[i] + tmp1; + sc0[i] = tmp1; + tmp1 = sc1[i] + tmp2; + sc1[i] = tmp2; + tmp2 = sc2[i] + tmp1; + sc2[i] = tmp1; + out = (128 + sc3[i] + tmp2) >> 11; + sc3[i] = tmp2; + + out &= 0x1f; + if ((i > 1) && (j > 1)) + output[i-2] = out | (out << 5) | (out << 10); + } + + if (j > 1) + output += row; + } + free(sc3); + free(sc2); + free(sc1); + free(sc0); +} + +static void +PreviewDecompress32(uint32_t * compressBuffer, + uint32_t width, uint32_t height, uint32_t row, + uint32_t * output) +{ + int i, j; + uint32_t * input; + + uint16_t * sc0 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc1 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc2 = malloc((width+2) * sizeof(uint16_t)); + uint16_t * sc3 = malloc((width+2) * sizeof(uint16_t)); + uint32_t sr0, sr1, sr2, sr3; + + bzero(sc0, (width+2) * sizeof(uint16_t)); + bzero(sc1, (width+2) * sizeof(uint16_t)); + bzero(sc2, (width+2) * sizeof(uint16_t)); + bzero(sc3, (width+2) * sizeof(uint16_t)); + + uint32_t tmp1, tmp2, out; + for (j = 0; j < (height + 2); j++) + { + input = compressBuffer; + if (j < height) + input += j; + else + input += height - 1; + input = (uint32_t *)(input[3] + ((uint8_t *)compressBuffer)); + + uint32_t data = 0, repeat = 0, fetch = 0, count = 0; + sr0 = sr1 = sr2 = sr3 = 0; + + for (i = 0; i < (width + 2); i++) + { + if (i < width) + { + if (!count) + { + count = *input++; + repeat = (count & 0xff000000); + count ^= repeat; + fetch = true; + } + else + fetch = (0 == repeat); + + count--; + + if (fetch) + { + data = *input++; + + // grayscale + // srgb 13933, 46871, 4732 + // ntsc 19595, 38470, 7471 + data = 13933 * (0xff & (data >> 24)) + + 46871 * (0xff & (data >> 16)) + + 4732 * (0xff & data); + data >>= 16; + + // 70% white, 30 % black + data *= 19661; + data += (103 << 16); + data >>= 16; + } + } + + // gauss blur + tmp2 = sr0 + data; + sr0 = data; + tmp1 = sr1 + tmp2; + sr1 = tmp2; + tmp2 = sr2 + tmp1; + sr2 = tmp1; + tmp1 = sr3 + tmp2; + sr3 = tmp2; + + tmp2 = sc0[i] + tmp1; + sc0[i] = tmp1; + tmp1 = sc1[i] + tmp2; + sc1[i] = tmp2; + tmp2 = sc2[i] + tmp1; + sc2[i] = tmp1; + out = (128 + sc3[i] + tmp2) >> 8; + sc3[i] = tmp2; + + out &= 0xff; + if ((i > 1) && (j > 1)) + output[i-2] = out | (out << 8) | (out << 16); + } + + if (j > 1) + output += row; + } + + free(sc3); + free(sc2); + free(sc1); + free(sc0); +} + +void * +DecompressData(void *srcbase, int *dw, int *dh, int *bitsPerPixel) +{ + uint32_t * src = (uint32_t *) srcbase; + void * ret; + + *bitsPerPixel = 8 * ((int) src[0]); + *dw = (int) src[1]; + *dh = (int) src[2]; + + ret = malloc ((*dw * *dh * *bitsPerPixel)/ 8); + + switch(*bitsPerPixel) + { + case 32: + PreviewDecompress32((uint32_t *)srcbase, *dw, *dh, *dw, ret); + return ret; + case 16: + PreviewDecompress16((uint32_t *)srcbase, *dw, *dh, *dw, ret); + return ret; + default: + return 0; + } +} diff --git a/i386/boot2/boot.c b/i386/boot2/boot.c new file mode 100644 index 0000000..483515e --- /dev/null +++ b/i386/boot2/boot.c @@ -0,0 +1,794 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 by Intel Corporation + */ + +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + */ + +/* + * Completely reworked by Sam Streeper (sam_s@NeXT.com) + * Reworked again by Curtis Galloway (galloway@NeXT.com) + */ + +#include "boot.h" +#include "bootstruct.h" +#include "fake_efi.h" +#include "sl.h" +#include "libsa.h" +#include "ramdisk.h" +#include "gui.h" +#include "platform.h" +#include "modules.h" + +/* + * How long to wait (in seconds) to load the + * kernel after displaying the "boot:" prompt. + */ +#define kBootErrorTimeout 5 + +bool gOverrideKernel, gEnableCDROMRescan, gScanSingleDrive, useGUI; +static bool gUnloadPXEOnExit = false; + +static char gCacheNameAdler[64 + 256]; +char *gPlatformName = gCacheNameAdler; + +char gRootDevice[ROOT_DEVICE_SIZE]; +char gMKextName[512]; +char gMacOSVersion[8]; +int bvCount = 0, gDeviceCount = 0; +//int menucount = 0; +long gBootMode; /* defaults to 0 == kBootModeNormal */ +BVRef bvr, menuBVR, bvChain; + +static bool checkOSVersion(const char * version); +static void getOSVersion(); +static unsigned long Adler32(unsigned char *buffer, long length); +//static void selectBiosDevice(void); + +/** options.c **/ +extern char* msgbuf; +void showTextBuffer(char *buf, int size); + + +//========================================================================== +// Zero the BSS. + +static void zeroBSS(void) +{ + extern char bss_start __asm("section$start$__DATA$__bss"); + extern char bss_end __asm("section$end$__DATA$__bss"); + extern char common_start __asm("section$start$__DATA$__common"); + extern char common_end __asm("section$end$__DATA$__common"); + + bzero(&bss_start, (&bss_end - &bss_start)); + bzero(&common_start, (&common_end - &common_start)); +} + +//========================================================================== +// Malloc error function + +static void malloc_error(char *addr, size_t size, const char *file, int line) +{ + stop("\nMemory allocation error! Addr: 0x%x, Size: 0x%x, File: %s, Line: %d\n", + (unsigned)addr, (unsigned)size, file, line); +} + +//========================================================================== +//Initializes the runtime. Right now this means zeroing the BSS and initializing malloc. +// +void initialize_runtime(void) +{ + zeroBSS(); + malloc_init(0, 0, 0, malloc_error); +} + +//========================================================================== +// execKernel - Load the kernel image (mach-o) and jump to its entry point. + +static int ExecKernel(void *binary) +{ + int ret; + entry_t kernelEntry; + + bootArgs->kaddr = bootArgs->ksize = 0; + execute_hook("ExecKernel", (void*)binary, NULL, NULL, NULL); + + ret = DecodeKernel(binary, + &kernelEntry, + (char **) &bootArgs->kaddr, + (int *)&bootArgs->ksize ); + + if ( ret != 0 ) + return ret; + + // Reserve space for boot args + reserveKernBootStruct(); + + // Notify modules that the kernel has been decoded + execute_hook("DecodedKernel", (void*)binary, (void*)bootArgs->kaddr, (void*)bootArgs->ksize, NULL); + + setupFakeEfi(); + + // Load boot drivers from the specifed root path. + //if (!gHaveKernelCache) + LoadDrivers("/"); + + execute_hook("DriversLoaded", (void*)binary, NULL, NULL, NULL); + + clearActivityIndicator(); + + if (gErrors) { + printf("Errors encountered while starting up the computer.\n"); + printf("Pausing %d seconds...\n", kBootErrorTimeout); + sleep(kBootErrorTimeout); + } + + md0Ramdisk(); + + verbose("Starting Darwin %s\n",( archCpuType == CPU_TYPE_I386 ) ? "x86" : "x86_64"); + verbose("Boot Args: %s\n", bootArgs->CommandLine); + + // Cleanup the PXE base code. + + if ( (gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit ) { + if ( (ret = nbpUnloadBaseCode()) != nbpStatusSuccess ) + { + printf("nbpUnloadBaseCode error %d\n", (int) ret); + sleep(2); + } + } + + bool dummyVal; + if (getBoolForKey(kWaitForKeypressKey, &dummyVal, &bootInfo->chameleonConfig) && dummyVal) { + showTextBuffer(msgbuf, strlen(msgbuf)); + } + + usb_loop(); + + // If we were in text mode, switch to graphics mode. + // This will draw the boot graphics unless we are in + // verbose mode. + if (gVerboseMode) + setVideoMode( GRAPHICS_MODE, 0 ); + else + drawBootGraphics(); + + setupBooterLog(); + + finalizeBootStruct(); + + // Jump to kernel's entry point. There's no going back now. + if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9"))) + { + + // Notify modules that the kernel is about to be started + execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgs, NULL, NULL); + + // Masking out so that Lion doesn't doublefault + outb(0x21, 0xff); /* Maskout all interrupts Pic1 */ + outb(0xa1, 0xff); /* Maskout all interrupts Pic2 */ + + startprog( kernelEntry, bootArgs ); + } + else { + // Notify modules that the kernel is about to be started + execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgsPreLion, NULL, NULL); + + startprog( kernelEntry, bootArgsPreLion ); + } + + // Not reached + return 0; +} + + +//========================================================================== +// LoadKernelCache - Try to load Kernel Cache. +// return the length of the loaded cache file or -1 on error +long LoadKernelCache(const char* cacheFile, void **binary) { + char kernelCacheFile[512]; + char kernelCachePath[512]; + long flags, time, cachetime, kerneltime, exttime, ret=-1; + unsigned long adler32; + + if((gBootMode & kBootModeSafe) != 0) + { + verbose("Kernel Cache ignored.\n"); + return -1; + } + + // Use specify kernel cache file if not empty + if (cacheFile[0] != 0) + { + strlcpy(kernelCacheFile, cacheFile, sizeof(kernelCacheFile)); + } + else + { + // Lion, Mountain Lion and Mavericks prelink kernel cache file + if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")) || (checkOSVersion("10.9"))) + { + sprintf(kernelCacheFile, "%skernelcache", kDefaultCachePathSnow); + } + // Snow Leopard prelink kernel cache file + else if (checkOSVersion("10.6")) { + sprintf(kernelCacheFile, "kernelcache_%s", (archCpuType == CPU_TYPE_I386) + ? "i386" : "x86_64"); + int lnam = strlen(kernelCacheFile) + 9; //with adler32 + + char* name; + long prev_time = 0; + + struct dirstuff* cacheDir = opendir(kDefaultCachePathSnow); + + while(readdir(cacheDir, (const char**)&name, &flags, &time) >= 0) + { + if (((flags & kFileTypeMask) != kFileTypeDirectory) && time > prev_time + && strstr(name, kernelCacheFile) && (name[lnam] != '.')) + { + sprintf(kernelCacheFile, "%s%s", kDefaultCachePathSnow, name); + prev_time = time; + } + } + } + else { + // Reset cache name. + bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64); + sprintf(gCacheNameAdler + 64, "%s,%s", gRootDevice, bootInfo->bootFile); + adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler)); + sprintf(kernelCacheFile, "%s.%08lX", kDefaultCachePathLeo, adler32); + } + } + + // Check if the kernel cache file exists + ret = -1; + + // If boot from a boot helper partition check the kernel cache file on it + if (gBootVolume->flags & kBVFlagBooter) { + sprintf(kernelCachePath, "com.apple.boot.P%s", kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) + { + sprintf(kernelCachePath, "com.apple.boot.R%s", kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) + { + sprintf(kernelCachePath, "com.apple.boot.S%s", kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((flags & kFileTypeMask) != kFileTypeFlat) + ret = -1; + } + } + } + // If not found, use the original kernel cache path. + if (ret == -1) { + strcpy(kernelCachePath, kernelCacheFile); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + if ((flags & kFileTypeMask) != kFileTypeFlat) + ret = -1; + } + + // Exit if kernel cache file wasn't found + if (ret == -1) { + verbose("No Kernel Cache File '%s' found\n", kernelCacheFile); + return -1; + } + + // Check if the kernel cache file is more recent (mtime) + // than the kernel file or the S/L/E directory + ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime); + // Check if the kernel file is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat) + && (kerneltime > cachetime)) { + verbose("Kernel file (%s) is more recent than KernelCache (%s), ignoring KernelCache\n", + bootInfo->bootFile, kernelCacheFile); + return -1; + } + + ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime); + // Check if the S/L/E directory time is more recent than the cache file + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory) + && (exttime > cachetime)) { + verbose("/System/Library/Extensions is more recent than KernelCache (%s), ignoring KernelCache\n", + kernelCacheFile); + return -1; + } + + // Since the kernel cache file exists and is the most recent try to load it + verbose("Loading kernel cache %s\n", kernelCachePath); + + ret = LoadThinFatFile(kernelCachePath, binary); + return ret; // ret contain the length of the binary +} + +//========================================================================== +// This is the entrypoint from real-mode which functions exactly as it did +// before. Multiboot does its own runtime initialization, does some of its +// own things, and then calls common_boot. +void boot(int biosdev) +{ + initialize_runtime(); + // Enable A20 gate before accessing memory above 1Mb. + enableA20(); + common_boot(biosdev); +} + +//========================================================================== +// The 'main' function for the booter. Called by boot0 when booting +// from a block device, or by the network booter. +// +// arguments: +// biosdev - Value passed from boot1/NBP to specify the device +// that the booter was loaded from. +// +// If biosdev is kBIOSDevNetwork, then this function will return if +// booting was unsuccessful. This allows the PXE firmware to try the +// next boot device on its list. +void common_boot(int biosdev) +{ + bool quiet; + bool firstRun = true; + bool instantMenu; + bool rescanPrompt; + int status; + unsigned int allowBVFlags = kBVFlagSystemVolume | kBVFlagForeignBoot; + unsigned int denyBVFlags = kBVFlagEFISystem; + + // Set reminder to unload the PXE base code. Neglect to unload + // the base code will result in a hang or kernel panic. + gUnloadPXEOnExit = true; + + // Record the device that the booter was loaded from. + gBIOSDev = biosdev & kBIOSDevMask; + + // Initialize boot info structure. + initKernBootStruct(); + + initBooterLog(); + + // Setup VGA text mode. + // Not sure if it is safe to call setVideoMode() before the + // config table has been loaded. Call video_mode() instead. +#if DEBUG + printf("before video_mode\n"); +#endif + video_mode( 2 ); // 80x25 mono text mode. +#if DEBUG + printf("after video_mode\n"); +#endif + + // Scan and record the system's hardware information. + scan_platform(); + + // First get info for boot volume. + scanBootVolumes(gBIOSDev, 0); + bvChain = getBVChainForBIOSDev(gBIOSDev); + setBootGlobals(bvChain); + + // Load boot.plist config file + status = loadChameleonConfig(&bootInfo->chameleonConfig); + + if (getBoolForKey(kQuietBootKey, &quiet, &bootInfo->chameleonConfig) && quiet) { + gBootMode |= kBootModeQuiet; + } + + // Override firstRun to get to the boot menu instantly by setting "Instant Menu"=y in system config + if (getBoolForKey(kInstantMenuKey, &instantMenu, &bootInfo->chameleonConfig) && instantMenu) { + firstRun = false; + } + + // Loading preboot ramdisk if exists. + loadPrebootRAMDisk(); + + // Disable rescan option by default + gEnableCDROMRescan = false; + + // Enable it with Rescan=y in system config + if (getBoolForKey(kRescanKey, &gEnableCDROMRescan, &bootInfo->chameleonConfig) + && gEnableCDROMRescan) { + gEnableCDROMRescan = true; + } + + // Ask the user for Rescan option by setting "Rescan Prompt"=y in system config. + rescanPrompt = false; + if (getBoolForKey(kRescanPromptKey, &rescanPrompt , &bootInfo->chameleonConfig) + && rescanPrompt && biosDevIsCDROM(gBIOSDev)) + { + gEnableCDROMRescan = promptForRescanOption(); + } + + // Enable touching a single BIOS device only if "Scan Single Drive"=y is set in system config. + if (getBoolForKey(kScanSingleDriveKey, &gScanSingleDrive, &bootInfo->chameleonConfig) + && gScanSingleDrive) { + gScanSingleDrive = true; + } + + // Create a list of partitions on device(s). + if (gScanSingleDrive) { + scanBootVolumes(gBIOSDev, &bvCount); + } else { + scanDisks(gBIOSDev, &bvCount); + } + + // Create a separated bvr chain using the specified filters. + bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount); + + gBootVolume = selectBootVolume(bvChain); + + // Intialize module system + init_module_system(); + +#if DEBUG + printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", + gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags); + printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", + gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags); + getchar(); +#endif + + useGUI = true; + // Override useGUI default + getBoolForKey(kGUIKey, &useGUI, &bootInfo->chameleonConfig); + if (useGUI && initGUI()) + { + // initGUI() returned with an error, disabling GUI. + useGUI = false; + } + + setBootGlobals(bvChain); + + // Parse args, load and start kernel. + while (1) + { + bool tryresume, tryresumedefault, forceresume; + bool useKernelCache = true; // by default try to use the prelinked kernel + const char *val; + int len, ret = -1; + long flags, sleeptime, time; + void *binary = (void *)kLoadAddr; + + char bootFile[sizeof(bootInfo->bootFile)]; + char bootFilePath[512]; + char kernelCacheFile[512]; + + // Initialize globals. + sysConfigValid = false; + gErrors = false; + + status = getBootOptions(firstRun); + firstRun = false; + if (status == -1) continue; + + status = processBootOptions(); + // Status == 1 means to chainboot + if ( status == 1 ) break; + // Status == -1 means that the config file couldn't be loaded or that gBootVolume is NULL + if ( status == -1 ) + { + // gBootVolume == NULL usually means the user hit escape. + if (gBootVolume == NULL) + { + freeFilteredBVChain(bvChain); + + if (gEnableCDROMRescan) + rescanBIOSDevice(gBIOSDev); + + bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount); + setBootGlobals(bvChain); + setupDeviceList(&bootInfo->themeConfig); + } + continue; + } + + // Other status (e.g. 0) means that we should proceed with boot. + + // Turn off any GUI elements + if ( bootArgs->Video.v_display == GRAPHICS_MODE ) + { + gui.devicelist.draw = false; + gui.bootprompt.draw = false; + gui.menu.draw = false; + gui.infobox.draw = false; + gui.logo.draw = false; + drawBackground(); + updateVRAM(); + } + + // Find out which version mac os we're booting. + getOSVersion(); + + if (platformCPUFeature(CPU_FEATURE_EM64T)) { + archCpuType = CPU_TYPE_X86_64; + } else { + archCpuType = CPU_TYPE_I386; + } + + if (getValueForKey(karch, &val, &len, &bootInfo->chameleonConfig)) { + if (strncmp(val, "i386", 4) == 0) { + archCpuType = CPU_TYPE_I386; + } + } + + if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig)) { + if (strncmp(val, "i386", 4) == 0) { + archCpuType = CPU_TYPE_I386; + } + } + + // Notify modules that we are attempting to boot + execute_hook("PreBoot", NULL, NULL, NULL, NULL); + + if (!getBoolForKey (kWake, &tryresume, &bootInfo->chameleonConfig)) { + tryresume = true; + tryresumedefault = true; + } else { + tryresumedefault = false; + } + + if (!getBoolForKey (kForceWake, &forceresume, &bootInfo->chameleonConfig)) { + forceresume = false; + } + + if (forceresume) { + tryresume = true; + tryresumedefault = false; + } + + while (tryresume) { + const char *tmp; + BVRef bvr; + if (!getValueForKey(kWakeImage, &val, &len, &bootInfo->chameleonConfig)) + val = "/private/var/vm/sleepimage"; + + // Do this first to be sure that root volume is mounted + ret = GetFileInfo(0, val, &flags, &sleeptime); + + if ((bvr = getBootVolumeRef(val, &tmp)) == NULL) + break; + + // Can't check if it was hibernation Wake=y is required + if (bvr->modTime == 0 && tryresumedefault) + break; + + if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) + break; + + if (!forceresume && ((sleeptime+3)modTime)) { +#if DEBUG + printf ("Hibernate image is too old by %d seconds. Use ForceWake=y to override\n", + bvr->modTime-sleeptime); +#endif + break; + } + + HibernateBoot((char *)val); + break; + } + + verbose("Loading Darwin %s\n", gMacOSVersion); + + getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig); + if (useKernelCache) do { + + // Determine the name of the Kernel Cache + if (getValueForKey(kKernelCacheKey, &val, &len, &bootInfo->bootConfig)) { + if (val[0] == '\\') + { + len--; + val++; + } + strlcpy(kernelCacheFile, val, len + 1); + } else { + kernelCacheFile[0] = 0; // Use default kernel cache file + } + + if (gOverrideKernel && kernelCacheFile[0] == 0) { + verbose("Using a non default kernel (%s) without specifying 'Kernel Cache' path, KernelCache will not be used\n", + bootInfo->bootFile); + useKernelCache = false; + break; + } + if (gMKextName[0] != 0) { + verbose("Using a specific MKext Cache (%s), KernelCache will not be used\n", + gMKextName); + useKernelCache = false; + break; + } + if (gBootFileType != kBlockDeviceType) + useKernelCache = false; + + } while(0); + + do { + if (useKernelCache) { + ret = LoadKernelCache(kernelCacheFile, &binary); + if (ret >= 0) + break; + } + + bool bootFileWithDevice = false; + // Check if bootFile start with a device ex: bt(0,0)/Extra/mach_kernel + if (strncmp(bootInfo->bootFile,"bt(",3) == 0 || + strncmp(bootInfo->bootFile,"hd(",3) == 0 || + strncmp(bootInfo->bootFile,"rd(",3) == 0) + bootFileWithDevice = true; + + // bootFile must start with a / if it not start with a device name + if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/') + sprintf(bootFile, "/%s", bootInfo->bootFile); // append a leading / + else + strlcpy(bootFile, bootInfo->bootFile, sizeof(bootFile)); + + // Try to load kernel image from alternate locations on boot helper partitions. + ret = -1; + if ((gBootVolume->flags & kBVFlagBooter) && !bootFileWithDevice) { + sprintf(bootFilePath, "com.apple.boot.P%s", bootFile); + ret = GetFileInfo(NULL, bootFilePath, &flags, &time); + if (ret == -1) + { + sprintf(bootFilePath, "com.apple.boot.R%s", bootFile); + ret = GetFileInfo(NULL, bootFilePath, &flags, &time); + if (ret == -1) + { + sprintf(bootFilePath, "com.apple.boot.S%s", bootFile); + ret = GetFileInfo(NULL, bootFilePath, &flags, &time); + } + } + } + if (ret == -1) { + // No alternate location found, using the original kernel image path. + strlcpy(bootFilePath, bootFile,sizeof(bootFilePath)); + } + + verbose("Loading kernel %s\n", bootFilePath); + ret = LoadThinFatFile(bootFilePath, &binary); + if (ret <= 0 && archCpuType == CPU_TYPE_X86_64) + { + archCpuType = CPU_TYPE_I386; + ret = LoadThinFatFile(bootFilePath, &binary); + } + } while (0); + + clearActivityIndicator(); + +#if DEBUG + printf("Pausing..."); + sleep(8); +#endif + + if (ret <= 0) { + printf("Can't find %s\n", bootFile); + sleep(1); + + if (gBootFileType == kNetworkDeviceType) { + // Return control back to PXE. Don't unload PXE base code. + gUnloadPXEOnExit = false; + break; + } + pause(); + + } else { + /* Won't return if successful. */ + ret = ExecKernel(binary); + } + } + + // chainboot + if (status == 1) { + // if we are already in graphics-mode, + if (getVideoMode() == GRAPHICS_MODE) { + setVideoMode(VGA_TEXT_MODE, 0); // switch back to text mode. + } + } + + if ((gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit) { + nbpUnloadBaseCode(); + } +} + +/*! + Selects a new BIOS device, taking care to update the global state appropriately. + */ +/* +static void selectBiosDevice(void) +{ + struct DiskBVMap *oldMap = diskResetBootVolumes(gBIOSDev); + CacheReset(); + diskFreeMap(oldMap); + oldMap = NULL; + + int dev = selectAlternateBootDevice(gBIOSDev); + + BVRef bvchain = scanBootVolumes(dev, 0); + BVRef bootVol = selectBootVolume(bvchain); + gBootVolume = bootVol; + setRootVolume(bootVol); + gBIOSDev = dev; +} +*/ + +bool checkOSVersion(const char * version) +{ + return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1]) + && (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3])); +} + +static void getOSVersion() +{ + strlcpy(gMacOSVersion, gBootVolume->OSVersion, sizeof(gMacOSVersion)); +} + +#define BASE 65521L /* largest prime smaller than 65536 */ +#define NMAX 5000 +// NMAX (was 5521) the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 + +#define DO1(buf, i) {s1 += buf[i]; s2 += s1;} +#define DO2(buf, i) DO1(buf, i); DO1(buf, i + 1); +#define DO4(buf, i) DO2(buf, i); DO2(buf, i + 2); +#define DO8(buf, i) DO4(buf, i); DO4(buf, i + 4); +#define DO16(buf) DO8(buf, 0); DO8(buf, 8); + +unsigned long Adler32(unsigned char *buf, long len) +{ + unsigned long s1 = 1; // adler & 0xffff; + unsigned long s2 = 0; // (adler >> 16) & 0xffff; + unsigned long result; + int k; + + while (len > 0) { + k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) { + DO16(buf); + buf += 16; + k -= 16; + } + if (k != 0) do { + s1 += *buf++; + s2 += s1; + } while (--k); + s1 %= BASE; + s2 %= BASE; + } + result = (s2 << 16) | s1; + return OSSwapHostToBigInt32(result); +} diff --git a/i386/boot2/boot.h b/i386/boot2/boot.h new file mode 100644 index 0000000..d5162cd --- /dev/null +++ b/i386/boot2/boot.h @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1994 NeXT Computer, Inc. + * All rights reserved. + */ + +#ifndef __BOOT2_BOOT_H +#define __BOOT2_BOOT_H + +#include "libsaio.h" +/* + * Paths used by chameleon + */ + +//kernel cache +#define kDefaultCachePathLeo "/System/Library/Caches/com.apple.kernelcaches/" +#define kDefaultCachePathSnow "/System/Library/Caches/com.apple.kext.caches/Startup/" + +// Lion installer +#define kLionInstallerDataFolder "/Mac OS X Install Data/" +#define kLionInstallerPlist kLionInstallerDataFolder "com.apple.Boot.plist" + +/* + * Keys used in system Boot.plist + */ +#define kGraphicsModeKey "Graphics Mode" +#define kTextModeKey "Text Mode" +#define kQuietBootKey "Quiet Boot" +#define kKernelFlagsKey "Kernel Flags" +#define kKernelArchKey "Kernel Architecture" +#define karch "arch" /* boot.c */ +#define kProductVersion "ProductVersion" /* boot.c */ +#define kMKextCacheKey "MKext Cache" +#define kKernelNameKey "Kernel" +#define kKernelCacheKey "Kernel Cache" +#define kUseKernelCache "UseKernelCache" /* boot.c */ +#define kBootDeviceKey "Boot Device" +#define kTimeoutKey "Timeout" +#define kRootDeviceKey "rd" +#define kBootUUIDKey "boot-uuid" +#define kHelperRootUUIDKey "Root UUID" +#define kPlatformKey "platform" +#define kACPIKey "acpi" +#define kCDROMPromptKey "CD-ROM Prompt" +#define kCDROMOptionKey "CD-ROM Option Key" +#define kRescanPromptKey "Rescan Prompt" +#define kRescanKey "Rescan" +#define kScanSingleDriveKey "Scan Single Drive" +#define kInstantMenuKey "Instant Menu" +#define kDefaultKernel "mach_kernel" +#define kGUIKey "GUI" +#define kBootBannerKey "Boot Banner" +#define kShowInfoKey "ShowInfo" // gui.c +#define kWaitForKeypressKey "Wait" + +#define kDSDT "DSDT" /* acpi_patcher.c */ +#define kDropSSDT "DropSSDT" /* acpi_patcher.c */ +#define kRestartFix "RestartFix" /* acpi_patcher.c */ +#define kPS2RestartFix "PS2RestartFix" /* acpi_patcher.c */ +#define kGeneratePStates "GeneratePStates" /* acpi_patcher.c */ +#define kGenerateCStates "GenerateCStates" /* acpi_patcher.c */ +#define kCSTUsingSystemIO "CSTUsingSystemIO" /* acpi_patcher.c */ +#define kEnableC2State "EnableC2State" /* acpi_patcher.c */ +#define kEnableC3State "EnableC3State" /* acpi_patcher.c */ +#define kEnableC4State "EnableC4State" /* acpi_patcher.c */ + +#define kWake "Wake" /* boot.c */ +#define kForceWake "ForceWake" /* boot.c */ +#define kWakeImage "WakeImage" /* boot.c */ + +#define kbusratio "busratio" /* cpu.c */ + +#define kDeviceProperties "device-properties" /* device_inject.c */ + +#define kHidePartition "Hide Partition" /* disk.c */ +#define kRenamePartition "Rename Partition" /* disk.c */ +#define kDefaultPartition "Default Partition" /* sys.c */ + +#define kSMBIOSKey "SMBIOS" /* fake_efi.c */ +#define kSMBIOSdefaults "SMBIOSdefaults" /* smbios_patcher.c */ +#define kSystemID "SystemId" /* fake_efi.c */ +#define kSystemType "SystemType" /* fake_efi.c */ + +#define kUseMemDetect "UseMemDetect" /* platform.c */ + +#define kPCIRootUID "PCIRootUID" /* pci_root.c */ + +#define kUseAtiROM "UseAtiROM" /* ati.c */ +#define kAtiConfig "AtiConfig" /* ati.c */ +#define kAtiPorts "AtiPorts" /* ati.c */ +#define kATYbinimage "ATYbinimage" /* ati.c */ + +#define kUseNvidiaROM "UseNvidiaROM" /* nvidia.c */ +#define kVBIOS "VBIOS" /* nvidia.c */ +#define kDcfg0 "display_0" /* nvidia.c */ +#define kDcfg1 "display_1" /* nvidia.c */ + +#define kEthernetBuiltIn "EthernetBuiltIn" /* pci_setup.c */ +#define kGraphicsEnabler "GraphicsEnabler" /* pci_setup.c */ +#define kEnableHDMIAudio "EnableHDMIAudio" /*ati.c && nvidia.c */ +#define kForceHPET "ForceHPET" /* pci_setup.c */ + +#define kMD0Image "md0" /* ramdisk.h */ + +#define kUSBBusFix "USBBusFix" /* usb.c */ +#define kEHCIacquire "EHCIacquire" /* usb.c */ +#define kUHCIreset "UHCIreset" /* usb.c */ +#define kLegacyOff "USBLegacyOff" /* usb.c */ +#define kEHCIhard "EHCIhard" /* usb.c */ + +/* + * Flags to the booter or kernel + */ +#define kVerboseModeFlag "-v" +#define kSafeModeFlag "-x" +#define kIgnoreCachesFlag "-f" +#define kIgnoreBootFileFlag "-F" +#define kSingleUserModeFlag "-s" + +/* + * Booter behavior control + */ +#define kBootTimeout -1 +#define kCDBootTimeout 8 + +/* + * A global set by boot() to record the device that the booter + * was loaded from. + */ +#define ROOT_DEVICE_SIZE 512 +extern int gBIOSDev; +extern long gBootMode; +extern bool sysConfigValid; +extern char bootBanner[]; +extern char bootPrompt[]; +extern bool gOverrideKernel; +extern char *gPlatformName; +extern char gMKextName[]; +extern char gRootDevice[]; +extern bool gEnableCDROMRescan; +extern bool gScanSingleDrive; +extern bool useGUI; + +/* + * Boot Modes + */ +enum { + kBootModeNormal = 0, + kBootModeSafe = 1, + kBootModeSecure = 2, + kBootModeQuiet = 4 +}; + +extern void initialize_runtime(); +extern void common_boot(int biosdev); + +/* + * usb.c + */ +extern int usb_loop(); + +/* + * graphics.c + */ +extern void printVBEModeInfo(); +extern void setVideoMode(int mode, int drawgraphics); +extern int getVideoMode(); +extern void spinActivityIndicator(); +extern void clearActivityIndicator(); +extern void drawColorRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char colorIndex ); +extern void drawDataRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char * data ); +extern int +convertImage( unsigned short width, + unsigned short height, + const unsigned char *imageData, + unsigned char **newImageData ); +extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes ); +extern void drawBootGraphics(void); +extern void drawPreview(void *src, uint8_t * saveunder); +extern int getVideoMode(void); +extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or); + +/* + * drivers.c + */ +extern long LoadExtraDrivers(char * dirSpec); +extern long LoadDrivers(char * dirSpec); +extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize); + +typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin); +/*! + Hookable function pointer called during the driver loading phase that + allows other code to cause additional drivers to be loaded. + */ +extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p); + +/* + * options.c + */ +extern char gBootUUIDString[]; + +extern int getBootOptions(bool firstRun); +extern int processBootOptions(); +extern int selectAlternateBootDevice(int bootdevice); +extern bool promptForRescanOption(void); + +void showHelp(); +void showTextFile(); +char *getMemoryInfoString(); + +typedef struct { + char name[80]; + void * param; +} MenuItem; + +/* + * lzss.c + */ +extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen); + +struct compressed_kernel_header { + u_int32_t signature; + u_int32_t compress_type; + u_int32_t adler32; + u_int32_t uncompressed_size; + u_int32_t compressed_size; + u_int32_t reserved[11]; + char platform_name[64]; + char root_path[256]; + u_int8_t data[0]; +}; +typedef struct compressed_kernel_header compressed_kernel_header; + +/* resume.c */ +void HibernateBoot(char *boot_device); + +/* bmdecompress.c */ +void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel); + +#endif /* !__BOOT2_BOOT_H */ diff --git a/i386/boot2/boot2.s b/i386/boot2/boot2.s new file mode 100644 index 0000000..9f30899 --- /dev/null +++ b/i386/boot2/boot2.s @@ -0,0 +1,345 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.1 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * boot2() -- second stage boot. + * + * This function must be located at 0:BOOTER_ADDR and will be called + * by boot1 or by NBP. + */ + +#include +#include "memory.h" +#include "mboot.h" + +#define data32 .byte 0x66 +#define retf .byte 0xcb + + .file "boot2.s" + .section __INIT,__text // turbo - This initialization code must reside within the first segment + + //.data + .section __INIT,__data // turbo - Data that must be in the first segment + +EXPORT(_chainbootdev) .byte 0x80 +EXPORT(_chainbootflag) .byte 0x00 + + //.text + .section __INIT,__text // turbo + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Booter entry point. Called by boot1 or by the NBP. +# This routine must be the first in the TEXT segment. +# +# Arguments: +# DX = Boot device +# +# Returns: +# +LABEL(boot2) + pushl %ecx # Save general purpose registers + pushl %ebx + pushl %ebp + pushl %esi + pushl %edi + push %ds # Save DS, ES + push %es + + mov %cs, %ax # Update segment registers. + mov %ax, %ds # Set DS and ES to match CS + mov %ax, %es + + data32 + call __switch_stack # Switch to new stack + + data32 + call __real_to_prot # Enter protected mode. + + fninit # FPU init + + # We are now in 32-bit protected mode. + # Transfer execution to C by calling boot(). + + pushl %edx # bootdev + call _boot + + testb $0xff, _chainbootflag + jnz start_chain_boot # Jump to a foreign booter + + call __prot_to_real # Back to real mode. + + data32 + call __switch_stack # Restore original stack + + pop %es # Restore original ES and DS + pop %ds + popl %edi # Restore all general purpose registers + popl %esi # except EAX. + popl %ebp + popl %ebx + popl %ecx + + retf # Hardcode a far return + +start_chain_boot: + xorl %edx, %edx + movb _chainbootdev, %dl # Setup DL with the BIOS device number + + call __prot_to_real # Back to real mode. + + data32 + call __switch_stack # Restore original stack + + pop %es # Restore original ES and DS + pop %ds + popl %edi # Restore all general purpose registers + popl %esi # except EAX. + popl %ebp + popl %ebx + popl %ecx + + data32 + ljmp $0, $0x7c00 # Jump to boot code already in memory + + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Multiboot support added by David F. Elliott on 2007/06/26 +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Multiboot section +# The above is used when booting with the normal booter (boot1h/boot1u). +# The following is used when booting with a multiboot capable loader such as grub +# Unlike the normal booter which starts in real mode, we start in protected mode + +# Unforuntately, GRUB refuses to load a multiboot "kernel" below 1MB. +# This is basically due to the fact that GRUB likes to live below 1MB because +# it starts up in real mode just like we would normally be starting up if +# we weren't being Multiboot loaded by GRUB. +# Therefore, we must tell our loader to load us above 1MB. To make it easy, +# we simply specify exactly 1 MB higher than we want. +# This means of course that when we enter we are not where the assembler +# and linker expect us to be. Please remember this when modifying code. +#define OFFSET_1MEG 0x100000 + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# NOTE: While we would ideally place the header in say __TEXT,__const we +# cannot do that and have GRUB find it because GRUB only searches the first +# 8k of the binary. Since __TEXT,__const follows __TEXT,__text (the code +# section) and since the code is well over 8k long, it doesn't work. +.align 2, 0x90 # Make sure we're on a 4-byte boundary. Required by Multiboot. +_multiboot_header: + # magic (NOTE: this shows up as 02b0 ad1b in a hex dump) + .long MULTIBOOT_HEADER_MAGIC + # flags + .long MULTIBOOT_HEADER_FLAGS + # checksum + .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) + # header_addr + .long (_multiboot_header + OFFSET_1MEG) + # load_addr + .long (boot2 + OFFSET_1MEG) + # load_end_addr # Tell multiboot to load the whole file + .long 0 + # bss_end_addr # boot() will zero its own bss + .long 0 + # entry_addr + .long (_multiboot_entry + OFFSET_1MEG) + +# Stick a couple of nop here so that we hopefully make disassemblers realize we have instructions again + nop + nop + nop +.align 3, 0x90 # Align to 8 byte boundary which should be enough nops + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +_multiboot_entry: + # First thing's first, let's get ourselves a usable GDT. + # Multiboot specifically says that GDT is not to be considered valid + # because for all we know the loader could have erased the memory where + # the GDT was located. Even if it doesn't, it's very likely that we'll + # clobber it when we move ourselves into low memory. + + # We have a GDT at the _Gdt symbol location which is defined in + # i386/libsaio/table.c. Like all GDTs, entry 0 is unusable. The first + # entry (0x08) is the one normally used by the booter. However, it is + # specifically defined as byte-granularity to ensure the booter does not + # execute any code above 1 MB. As mentioned above, we are above 1 MB so + # we can't use the 0x08 selector. Fortunately, the booter specifies the + # 0x28 selector for the kernel init code using the typical 4K granularity + # and making all 32-bits of address space available. + + # To load a GDT with the lgdt instruction we need to have the linear + # address of a GDTR structure. The 16-bit boot code uses the _Gdtr + # variable which we will use later. However, we are still in extended + # memory so even if we added 1 MB to _Gdtr the contents of it would + # still be pointing in low memory. Therefore we have a _Gdtr_high + # which points to _Gdt + OFFSET_1MEG (see bottom of file) + # Notice that _Gdtr_high itself is located 1 MB above where the + # assembler/linker thinks it is. + lgdt _Gdtr_high + OFFSET_1MEG + + # Now that we have a GDT we want to first reload the CS register. We do + # that using a far jump to the desired selector with the desired offset. + # The desired offset in this case is exactly 1 MB higher than the + # assembler/linker thinks it is. As mentioned above, we use the kernel + # init code selector instead of the boot code selector. + jmp $0x28,$(Lpost_gdt_switch+OFFSET_1MEG) +Lpost_gdt_switch: + + # Now that we have the right code selector we also want the rest of the + # selectors to be correct. We use the same selector (0x10) as the + # __real_to_prot function in libsaio/asm.s. This is important as it + # means we won't need to do this again after the next GDT switch. + + # We have to clobber one register because segment registers can only be + # loaded from GP registers. Fortunately, only eax and ebx are provided + # by multiboot so we can clobber anything else. We choose ecx. + + movl $0x10, %ecx + movl %ecx,%ss + movl %ecx,%ds + movl %ecx,%es + movl %ecx,%fs + movl %ecx,%gs + + # Initialize our stack pointer to the one normally used by the booter + # NOTE: This is somewhat dangerous considering it seems to be a de-facto + # Multiboot standard that the area below 1 MB is for the loader (e.g. GRUB) + # We may consider later putting the stack at + 1MB just like the code + # but we'd have to eventually get it below 1 MB because until we do we can't + # run any real-mode code (e.g. BIOS functions). + # Doing it this early we potentially run the risk that our multiboot_info + # pointer in ebx is already stuck somewhere in our stack segment + # Of course, the best method would be to have a couple of choices for + # stack space and put it wherever the multiboot_info is not. + movl $ADDR32(STACK_SEG,STACK_OFS), %esp + + # Some final notes about machine state: + + # We have no IDT and thus we leave interrupts disabled. This is the same + # state that __real_to_prot leaves the machine in so it's not a problem. + + # The A20 gate is enabled (it better be, we're above 1 MB) + # It is enabled as the first thing in boot() but it won't hurt for it + # to be enabled when it already is. + + # Unlike when booting from real mode, when booting from Multiboot we have + # no stack to begin with. This means that __switch_stack must never be + # called because it is preloaded with STACK_SEG,STACK_OFS which is where + # we already are. Were it to be called it would effectively reset to the + # top of the stack which would not be good. + # We might think about adding a couple of instructions here to change + # its default values to something that could be used if necessary. + + # At this point we're good enough to run C code. I am no assembler guru + # so we won't be returning from it. + pushl %ebx + pushl %eax + call _multiboot_to_boot # NOTE: near relative call, so we stay in high mem + # NORETURN + + # NOTE: Once we get in to C, we should never return + # We let the C code take care of doing a chain boot which right now + # means to print an error message and restart the booter + +Lhltloop: + hlt # This causes Parallels to power off although a normal PC will just hang + jmp Lhltloop + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _continue_at_low_address does some trickery to get the caller running from the low address with the right selector + .globl _continue_at_low_address + .align 2, 0x90 +_continue_at_low_address: + # Our stack frame has been set up with the return address on top + # First, fix that to be 1 MB lower + subl $OFFSET_1MEG, (%esp) + # Now load the proper low-memory GDTR from the low-memory location which + # will cause the low-memory GDT to be used. + lgdt _Gdtr + # Now jump to GDT selector 8 using the low address of this function + # This finally puts us in low memory in the right selector (0x08) + jmpl $0x08,$L_continue_at_low_address_next +L_continue_at_low_address_next: + # We don't need to set ss,ds,es,fs, or gs because they are already 0x10 + # and the old GDT had the same information for selector 0x10 as the new + # one does. + # Since we've already fixed our return pointer, simply return + # Note that our caller must fix his return pointer as well and that his + # caller must fix his return pointer and so on and so forth. + ret + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _jump_to_chainbooter sets up dl, switches from protected to real mode, and +# jumps to 0:7C00. Unlike the usual code, the stack is not switched since +# there is no stack to switch to. + .globl _jump_to_chainbooter +_jump_to_chainbooter: + # TODO: Take segment/offset arguments and put them in ES:SI? + + xorl %edx, %edx + movb _chainbootdev, %dl # Setup DL with the BIOS device number + + call __prot_to_real # Back to real mode. + + # TODO: Set SS:SP to something reasonable? For instance, Microsoft MBR + # code starts out by setting up the stack at 0:7c00 for itself and leaves + # that intact. Thus the stack by default will grow down from the code + # entrypoint. On the other hand, our own boot0 sets up the stack at + # 0:fff0 and it seems that most boot code doesn't care and simply sets + # SS:SP itself as one of the first things it does. + + data32 + ljmp $0, $0x7c00 # Jump to boot code already in memory + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _cause_crash jumps to offset 0 of a selector we know is not in our GDT +# This causes Parallels to output all sorts of nice debugging information +# We aren't using it right now so it's in an if 0 block. +#if 0 + .globl _cause_crash + .align 2, 0x90 +_cause_crash: + # Cause a crash, there is no GDT selector f0 + jmp $0xf0,$0 + hlt + jmp _cause_crash +#endif + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# _Gdtr_high is a pointer to the extended-memory loaded _Gdt +# See the comments above as to why we have OFFSET_1MEG. + //.data + .section __INIT,__data // turbo + .align 2, 0x90 +_Gdtr_high: + .word GDTLIMIT + .long vtop(_Gdt + OFFSET_1MEG) + diff --git a/i386/boot2/drivers.c b/i386/boot2/drivers.c new file mode 100644 index 0000000..531564c --- /dev/null +++ b/i386/boot2/drivers.c @@ -0,0 +1,850 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the 'License'). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * drivers.c - Driver Loading Functions. + * + * Copyright (c) 2000 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include +#include +#include + +#include "sl.h" +#include "boot.h" +#include "bootstruct.h" +#include "xml.h" +#include "ramdisk.h" +#include "modules.h" + +//extern char gMacOSVersion[8]; + +struct Module { + struct Module *nextModule; + long willLoad; + TagPtr dict; + char *plistAddr; + long plistLength; + char *executablePath; + char *bundlePath; + long bundlePathLength; +}; +typedef struct Module Module, *ModulePtr; + +struct DriverInfo { + char *plistAddr; + long plistLength; + void *executableAddr; + long executableLength; + void *bundlePathAddr; + long bundlePathLength; +}; +typedef struct DriverInfo DriverInfo, *DriverInfoPtr; + +#define kDriverPackageSignature1 'MKXT' +#define kDriverPackageSignature2 'MOSX' + +struct DriversPackage { + unsigned long signature1; + unsigned long signature2; + unsigned long length; + unsigned long adler32; + unsigned long version; + unsigned long numDrivers; + unsigned long reserved1; + unsigned long reserved2; +}; +typedef struct DriversPackage DriversPackage; + +enum { + kCFBundleType2, + kCFBundleType3 +}; + +long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p); + +/*static*/ unsigned long Adler32( unsigned char * buffer, long length ); + +long FileLoadDrivers(char *dirSpec, long plugin); +long NetLoadDrivers(char *dirSpec); +long LoadDriverMKext(char *fileSpec); +long LoadDriverPList(char *dirSpec, char *name, long bundleType); +long LoadMatchedModules(void); + +static long MatchPersonalities(void); +static long MatchLibraries(void); +#ifdef NOTDEF +static ModulePtr FindModule(char *name); +static void ThinFatFile(void **loadAddrP, unsigned long *lengthP); +#endif +static long ParseXML(char *buffer, ModulePtr *module, TagPtr *personalities); +static long InitDriverSupport(void); + +ModulePtr gModuleHead, gModuleTail; +static TagPtr gPersonalityHead, gPersonalityTail; +static char * gExtensionsSpec; +static char * gDriverSpec; +static char * gFileSpec; +static char * gTempSpec; +static char * gFileName; + +/*static*/ unsigned long +Adler32( unsigned char * buffer, long length ) +{ + long cnt; + unsigned long result, lowHalf, highHalf; + + lowHalf = 1; + highHalf = 0; + + for ( cnt = 0; cnt < length; cnt++ ) + { + if ((cnt % 5000) == 0) + { + lowHalf %= 65521L; + highHalf %= 65521L; + } + + lowHalf += buffer[cnt]; + highHalf += lowHalf; + } + + lowHalf %= 65521L; + highHalf %= 65521L; + + result = (highHalf << 16) | lowHalf; + + return result; +} + + +//========================================================================== +// InitDriverSupport + +static long +InitDriverSupport( void ) +{ + gExtensionsSpec = malloc( 4096 ); + gDriverSpec = malloc( 4096 ); + gFileSpec = malloc( 4096 ); + gTempSpec = malloc( 4096 ); + gFileName = malloc( 4096 ); + + if ( !gExtensionsSpec || !gDriverSpec || !gFileSpec || !gTempSpec || !gFileName ) + stop("InitDriverSupport error"); + + return 0; +} + +//========================================================================== +// LoadDrivers + +long LoadDrivers( char * dirSpec ) +{ + char dirSpecExtra[1024]; + + if ( InitDriverSupport() != 0 ) + return 0; + + // Load extra drivers if a hook has been installed. + if (LoadExtraDrivers_p != NULL) + { + (*LoadExtraDrivers_p)(&FileLoadDrivers); + } + + if ( gBootFileType == kNetworkDeviceType ) + { + if (NetLoadDrivers(dirSpec) != 0) { + error("Could not load drivers from the network\n"); + return -1; + } + } + else if ( gBootFileType == kBlockDeviceType ) + { + // First try to load Extra extensions from the ramdisk if isn't aliased as bt(0,0). + if (gRAMDiskVolume && !gRAMDiskBTAliased) + { + strcpy(dirSpecExtra, "rd(0,0)/Extra/"); + FileLoadDrivers(dirSpecExtra, 0); + } + + // Next try to load Extra extensions from the selected root partition. + strcpy(dirSpecExtra, "/Extra/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + // If failed, then try to load Extra extensions from the boot partition + // in case we have a separate booter partition or a bt(0,0) aliased ramdisk. + if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no) + || (gRAMDiskVolume && gRAMDiskBTAliased) ) + { + // Next try a specfic OS version folder ie 10.5 + sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + // Next we'll try the base + strcpy(dirSpecExtra, "bt(0,0)/Extra/"); + FileLoadDrivers(dirSpecExtra, 0); + } + } + } + if(!gHaveKernelCache) + { + // Don't load main driver (from /System/Library/Extentions) if gHaveKernelCache is set. + // since these drivers will already be in the kernel cache. + // NOTE: when gHaveKernelCache, xnu cannot (by default) load *any* extra kexts from the bootloader. + // The /Extra code is not disabled in this case due to a kernel patch that allows for this to happen. + + // Also try to load Extensions from boot helper partitions. + if (gBootVolume->flags & kBVFlagBooter) + { + strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/"); + if (FileLoadDrivers(dirSpecExtra, 0) != 0) + { + strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/"); + FileLoadDrivers(dirSpecExtra, 0); + } + } + } + + if (gMKextName[0] != '\0') + { + verbose("LoadDrivers: Loading from [%s]\n", gMKextName); + if ( LoadDriverMKext(gMKextName) != 0 ) + { + error("Could not load %s\n", gMKextName); + return -1; + } + } + else + { + strcpy(gExtensionsSpec, dirSpec); + strcat(gExtensionsSpec, "System/Library/"); + FileLoadDrivers(gExtensionsSpec, 0); + } + + } + } + else + { + return 0; + } + + MatchPersonalities(); + + MatchLibraries(); + + LoadMatchedModules(); + + return 0; +} + +//========================================================================== +// FileLoadMKext + +static long +FileLoadMKext( const char * dirSpec, const char * extDirSpec ) +{ + long ret, flags, time, time2; + char altDirSpec[512]; + + sprintf (altDirSpec, "%s%s", dirSpec, extDirSpec); + ret = GetFileInfo(altDirSpec, "Extensions.mkext", &flags, &time); + + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeFlat)) + { + ret = GetFileInfo(dirSpec, "Extensions", &flags, &time2); + + if ((ret != 0) + || ((flags & kFileTypeMask) != kFileTypeDirectory) + || (((gBootMode & kBootModeSafe) == 0) && (time == (time2 + 1)))) + { + sprintf(gDriverSpec, "%sExtensions.mkext", altDirSpec); + verbose("LoadDrivers: Loading from [%s]\n", gDriverSpec); + + if (LoadDriverMKext(gDriverSpec) == 0) + return 0; + } + } + return -1; +} + +//========================================================================== +// FileLoadDrivers + +long +FileLoadDrivers( char * dirSpec, long plugin ) +{ + long ret, length, flags, time, bundleType; + long long index; + long result = -1; + const char * name; + + if ( !plugin ) + { + // First try 10.6's path for loading Extensions.mkext. + if (FileLoadMKext(dirSpec, "Caches/com.apple.kext.caches/Startup/") == 0) + return 0; + + // Next try the legacy path. + else if (FileLoadMKext(dirSpec, "") == 0) + return 0; + + strcat(dirSpec, "Extensions"); + } + + index = 0; + while (1) { + ret = GetDirEntry(dirSpec, &index, &name, &flags, &time); + if (ret == -1) break; + + // Make sure this is a directory. + if ((flags & kFileTypeMask) != kFileTypeDirectory) continue; + + // Make sure this is a kext. + length = strlen(name); + if (strcmp(name + length - 5, ".kext")) continue; + + // Save the file name. + strcpy(gFileName, name); + + // Determine the bundle type. + sprintf(gTempSpec, "%s/%s", dirSpec, gFileName); + ret = GetFileInfo(gTempSpec, "Contents", &flags, &time); + if (ret == 0) bundleType = kCFBundleType2; + else bundleType = kCFBundleType3; + + if (!plugin) + sprintf(gDriverSpec, "%s/%s/%sPlugIns", dirSpec, gFileName, + (bundleType == kCFBundleType2) ? "Contents/" : ""); + + ret = LoadDriverPList(dirSpec, gFileName, bundleType); + + if (result != 0) + result = ret; + + if (!plugin) + FileLoadDrivers(gDriverSpec, 1); + } + + return result; +} + + +//========================================================================== +// + +long +NetLoadDrivers( char * dirSpec ) +{ + long tries; + +#if NODEF + long cnt; + + // Get the name of the kernel + cnt = strlen(gBootFile); + while (cnt--) { + if ((gBootFile[cnt] == '\\') || (gBootFile[cnt] == ',')) { + cnt++; + break; + } + } +#endif + + // INTEL modification + sprintf(gDriverSpec, "%s%s.mkext", dirSpec, bootInfo->bootFile); + + verbose("NetLoadDrivers: Loading from [%s]\n", gDriverSpec); + + tries = 3; + while (tries--) + { + if (LoadDriverMKext(gDriverSpec) == 0) break; + } + if (tries == -1) return -1; + + return 0; +} + +//========================================================================== +// loadDriverMKext + +long +LoadDriverMKext( char * fileSpec ) +{ + unsigned long driversAddr, driversLength; + long length; + char segName[32]; + DriversPackage * package; + +#define GetPackageElement(e) OSSwapBigToHostInt32(package->e) + + // Load the MKext. + length = LoadThinFatFile(fileSpec, (void **)&package); + if (length < sizeof (DriversPackage)) return -1; + + // call hook to notify modules that the mkext has been loaded + execute_hook("LoadDriverMKext", (void*)fileSpec, (void*)package, (void*) &length, NULL); + + + // Verify the MKext. + if (( GetPackageElement(signature1) != kDriverPackageSignature1) || + ( GetPackageElement(signature2) != kDriverPackageSignature2) || + ( GetPackageElement(length) > kLoadSize ) || + ( GetPackageElement(adler32) != + Adler32((unsigned char *)&package->version, GetPackageElement(length) - 0x10) ) ) + { + return -1; + } + + // Make space for the MKext. + driversLength = GetPackageElement(length); + driversAddr = AllocateKernelMemory(driversLength); + + // Copy the MKext. + memcpy((void *)driversAddr, (void *)package, driversLength); + + // Add the MKext to the memory map. + sprintf(segName, "DriversPackage-%lx", driversAddr); + AllocateMemoryRange(segName, driversAddr, driversLength, + kBootDriverTypeMKEXT); + + return 0; +} + +//========================================================================== +// LoadDriverPList + +long +LoadDriverPList( char * dirSpec, char * name, long bundleType ) +{ + long length, executablePathLength, bundlePathLength; + ModulePtr module; + TagPtr personalities; + char * buffer = 0; + char * tmpExecutablePath = 0; + char * tmpBundlePath = 0; + long ret = -1; + + do { + // Save the driver path. + + if(name) sprintf(gFileSpec, "%s/%s/%s", dirSpec, name, + (bundleType == kCFBundleType2) ? "Contents/MacOS/" : ""); + else sprintf(gFileSpec, "%s/%s", dirSpec, + (bundleType == kCFBundleType2) ? "Contents/MacOS/" : ""); + executablePathLength = strlen(gFileSpec) + 1; + + tmpExecutablePath = malloc(executablePathLength); + if (tmpExecutablePath == 0) break; + strcpy(tmpExecutablePath, gFileSpec); + + if(name) sprintf(gFileSpec, "%s/%s", dirSpec, name); + else sprintf(gFileSpec, "%s", dirSpec); + bundlePathLength = strlen(gFileSpec) + 1; + + tmpBundlePath = malloc(bundlePathLength); + if (tmpBundlePath == 0) break; + + strcpy(tmpBundlePath, gFileSpec); + + // Construct the file spec to the plist, then load it. + + if(name) sprintf(gFileSpec, "%s/%s/%sInfo.plist", dirSpec, name, + (bundleType == kCFBundleType2) ? "Contents/" : ""); + else sprintf(gFileSpec, "%s/%sInfo.plist", dirSpec, + (bundleType == kCFBundleType2) ? "Contents/" : ""); + + length = LoadFile(gFileSpec); + if (length == -1) break; + length = length + 1; + buffer = malloc(length); + if (buffer == 0) break; + strlcpy(buffer, (char *)kLoadAddr, length); + + // Parse the plist. + + ret = ParseXML(buffer, &module, &personalities); + if (ret != 0) { break; } + // Allocate memory for the driver path and the plist. + + module->executablePath = tmpExecutablePath; + module->bundlePath = tmpBundlePath; + module->bundlePathLength = bundlePathLength; + module->plistAddr = malloc(length); + + if ((module->executablePath == 0) || (module->bundlePath == 0) || (module->plistAddr == 0)) + break; + // Save the driver path in the module. + //strcpy(module->driverPath, tmpDriverPath); + tmpExecutablePath = 0; + tmpBundlePath = 0; + + // Add the plist to the module. + + strlcpy(module->plistAddr, (char *)kLoadAddr, length); + module->plistLength = length; + + // Add the module to the end of the module list. + + if (gModuleHead == 0) + gModuleHead = module; + else + gModuleTail->nextModule = module; + gModuleTail = module; + + // Add the persionalities to the personality list. + + if (personalities) personalities = personalities->tag; + while (personalities != 0) + { + if (gPersonalityHead == 0) + gPersonalityHead = personalities->tag; + else + gPersonalityTail->tagNext = personalities->tag; + + gPersonalityTail = personalities->tag; + personalities = personalities->tagNext; + } + + ret = 0; + } + while (0); + + if ( buffer ) free( buffer ); + if ( tmpExecutablePath ) free( tmpExecutablePath ); + if ( tmpBundlePath ) free( tmpBundlePath ); + + return ret; +} + + +//========================================================================== +// LoadMatchedModules + +long +LoadMatchedModules( void ) +{ + TagPtr prop; + ModulePtr module; + char *fileName, segName[32]; + DriverInfoPtr driver; + long length, driverAddr, driverLength; + void *executableAddr = 0; + + + module = gModuleHead; + + while (module != 0) + { + if (module->willLoad) + { + prop = XMLGetProperty(module->dict, kPropCFBundleExecutable); + + if (prop != 0) + { + fileName = prop->string; + sprintf(gFileSpec, "%s%s", module->executablePath, fileName); + length = LoadThinFatFile(gFileSpec, &executableAddr); + if (length == 0) + { + length = LoadFile(gFileSpec); + executableAddr = (void *)kLoadAddr; + } +// printf("%s length = %d addr = 0x%x\n", gFileSpec, length, driverModuleAddr); getchar(); + } + else + length = 0; + + if (length != -1) + { +// driverModuleAddr = (void *)kLoadAddr; +// if (length != 0) +// { +// ThinFatFile(&driverModuleAddr, &length); +// } + + // Make make in the image area. + + execute_hook("LoadMatchedModules", module, &length, executableAddr, NULL); + + driverLength = sizeof(DriverInfo) + module->plistLength + length + module->bundlePathLength; + driverAddr = AllocateKernelMemory(driverLength); + + // Set up the DriverInfo. + driver = (DriverInfoPtr)driverAddr; + driver->plistAddr = (char *)(driverAddr + sizeof(DriverInfo)); + driver->plistLength = module->plistLength; + if (length != 0) + { + driver->executableAddr = (void *)(driverAddr + sizeof(DriverInfo) + + module->plistLength); + driver->executableLength = length; + } + else + { + driver->executableAddr = 0; + driver->executableLength = 0; + } + driver->bundlePathAddr = (void *)(driverAddr + sizeof(DriverInfo) + + module->plistLength + driver->executableLength); + driver->bundlePathLength = module->bundlePathLength; + + // Save the plist, module and bundle. + strcpy(driver->plistAddr, module->plistAddr); + if (length != 0) + { + memcpy(driver->executableAddr, executableAddr, length); + } + strcpy(driver->bundlePathAddr, module->bundlePath); + + // Add an entry to the memory map. + sprintf(segName, "Driver-%lx", (unsigned long)driver); + AllocateMemoryRange(segName, driverAddr, driverLength, + kBootDriverTypeKEXT); + } + } + module = module->nextModule; + } + + return 0; +} + +//========================================================================== +// MatchPersonalities + +static long +MatchPersonalities( void ) +{ + /* IONameMatch support not implemented */ + return 0; +} + +//========================================================================== +// MatchLibraries + +static long +MatchLibraries( void ) +{ + TagPtr prop, prop2; + ModulePtr module, module2; + long done; + + do { + done = 1; + module = gModuleHead; + + while (module != 0) + { + if (module->willLoad == 1) + { + prop = XMLGetProperty(module->dict, kPropOSBundleLibraries); + if (prop != 0) + { + prop = prop->tag; + while (prop != 0) + { + module2 = gModuleHead; + while (module2 != 0) + { + prop2 = XMLGetProperty(module2->dict, kPropCFBundleIdentifier); + if ((prop2 != 0) && (!strcmp(prop->string, prop2->string))) + { + if (module2->willLoad == 0) module2->willLoad = 1; + break; + } + module2 = module2->nextModule; + } + prop = prop->tagNext; + } + } + module->willLoad = 2; + done = 0; + } + module = module->nextModule; + } + } + while (!done); + + return 0; +} + + +//========================================================================== +// FindModule + +#if NOTDEF +static ModulePtr +FindModule( char * name ) +{ + ModulePtr module; + TagPtr prop; + + module = gModuleHead; + + while (module != 0) + { + prop = GetProperty(module->dict, kPropCFBundleIdentifier); + if ((prop != 0) && !strcmp(name, prop->string)) break; + module = module->nextModule; + } + + return module; +} +#endif /* NOTDEF */ + +//========================================================================== +// ParseXML + +static long +ParseXML( char * buffer, ModulePtr * module, TagPtr * personalities ) +{ + long length, pos; + TagPtr moduleDict, required; + ModulePtr tmpModule; + + pos = 0; + + while (1) + { + length = XMLParseNextTag(buffer + pos, &moduleDict); + if (length == -1) break; + + pos += length; + + if (moduleDict == 0) continue; + if (moduleDict->type == kTagTypeDict) break; + + XMLFreeTag(moduleDict); + } + + if (length == -1) return -1; + + required = XMLGetProperty(moduleDict, kPropOSBundleRequired); + if ( (required != NULL) && (required->type == kTagTypeString) && !strcmp(required->string, "Safe Boot")) + { + XMLFreeTag(moduleDict); + return -2; + } + + tmpModule = malloc(sizeof(Module)); + if (tmpModule == 0) + { + XMLFreeTag(moduleDict); + return -1; + } + tmpModule->dict = moduleDict; + + // For now, load any module that has OSBundleRequired != "Safe Boot". + + tmpModule->willLoad = 1; + + *module = tmpModule; + + // Get the personalities. + + *personalities = XMLGetProperty(moduleDict, kPropIOKitPersonalities); + + return 0; +} + +#if NOTDEF +static char gPlatformName[64]; +#endif + +long +DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize) +{ + long ret; + compressed_kernel_header * kernel_header = (compressed_kernel_header *) binary; + u_int32_t uncompressed_size, size; + void *buffer; + unsigned long len; + +#if 0 + printf("kernel header:\n"); + printf("signature: 0x%x\n", kernel_header->signature); + printf("compress_type: 0x%x\n", kernel_header->compress_type); + printf("adler32: 0x%x\n", kernel_header->adler32); + printf("uncompressed_size: 0x%x\n", kernel_header->uncompressed_size); + printf("compressed_size: 0x%x\n", kernel_header->compressed_size); + getchar(); +#endif + + if (kernel_header->signature == OSSwapBigToHostConstInt32('comp')) + { + if (kernel_header->compress_type != OSSwapBigToHostConstInt32('lzss')) + { + error("kernel compression is bad\n"); + return -1; + } +#if NOTDEF + if (kernel_header->platform_name[0] && strcmp(gPlatformName, kernel_header->platform_name)) + return -1; + if (kernel_header->root_path[0] && strcmp(gBootFile, kernel_header->root_path)) + return -1; +#endif + uncompressed_size = OSSwapBigToHostInt32(kernel_header->uncompressed_size); + binary = buffer = malloc(uncompressed_size); + + size = decompress_lzss((u_int8_t *) binary, &kernel_header->data[0], + OSSwapBigToHostInt32(kernel_header->compressed_size)); + if (uncompressed_size != size) { + error("size mismatch from lzss: %x\n", size); + return -1; + } + + if (OSSwapBigToHostInt32(kernel_header->adler32) != + Adler32(binary, uncompressed_size)) + { + printf("adler mismatch\n"); + return -1; + } + } + + ret = ThinFatFile(&binary, &len); + if (ret == 0 && len == 0 && archCpuType==CPU_TYPE_X86_64) + { + archCpuType=CPU_TYPE_I386; + ret = ThinFatFile(&binary, &len); + } + + // Notify modules that the kernel has been decompressed, thinned and is about to be decoded + execute_hook("DecodeKernel", (void*)binary, NULL, NULL, NULL); + + + ret = DecodeMachO(binary, rentry, raddr, rsize); + if (ret<0 && archCpuType==CPU_TYPE_X86_64) + { + archCpuType=CPU_TYPE_I386; + ret = DecodeMachO(binary, rentry, raddr, rsize); + } + + return ret; +} diff --git a/i386/boot2/graphic_utils.c b/i386/boot2/graphic_utils.c new file mode 100644 index 0000000..9ad9ac1 --- /dev/null +++ b/i386/boot2/graphic_utils.c @@ -0,0 +1,81 @@ + + /* Graphic utility functions and data types + * Prashant Vaibhav (C) 12/12/2008 + * Chameleon + */ +#include "boot.h" +#include "graphic_utils.h" +#include "gui.h" + +void blend( const pixmap_t *blendThis, // Source image + pixmap_t *blendInto, // Dest image + const position_t position) // Where to place the source image +{ + uint16_t sx, sy, dx, dy; + uint32_t dstrb, dstag, srcrb, srcag, drb, dag, rb, ag, alpha; + + uint16_t width = (blendThis->width + position.x < blendInto->width) ? blendThis->width: blendInto->width-position.x; + uint16_t height = (blendThis->height + position.y < blendInto->height) ? blendThis->height: blendInto->height-position.y; + + for (dy = position.y, sy = 0; sy < height; dy++, sy++) { + for (dx = position.x, sx = 0; sx < width; dx++, sx++) { + alpha = (pixel(blendThis, sx, sy).ch.a); + + /* Skip blending for fully transparent pixel */ + if (alpha == 0) continue; + + /* For fully opaque pixel, there is no need to interpolate */ + if (alpha == 255) { + pixel(blendInto, dx, dy).value = pixel(blendThis, sx, sy).value; + continue; + } + + /* For semi-transparent pixels, do a full blend */ + //alpha++ + /* This is needed to spread the alpha over [0..256] instead of [0..255] + Boundary conditions were handled above */ + dstrb = pixel(blendInto, dx, dy).value & 0xFF00FF; + dstag = (pixel(blendInto, dx, dy).value >> 8) & 0xFF00FF; + srcrb = pixel(blendThis, sx, sy).value & 0xFF00FF; + srcag = (pixel(blendThis, sx, sy).value >> 8) & 0xFF00FF; + drb = srcrb - dstrb; + dag = srcag - dstag; + drb *= alpha; dag *= alpha; + drb >>= 8; dag >>= 8; + rb = (drb + dstrb) & 0x00FF00FF; + ag = ((dag + dstag) << 8) & 0xFF00FF00; + pixel(blendInto, dx, dy).value = (rb | ag); + } + } +} + +position_t centeredIn( const pixmap_t *background, const pixmap_t *toCenter ) +{ + position_t centered; + centered.x = ( background->width - toCenter->width ) / 2; + centered.y = ( background->height - toCenter->height ) / 2; + return centered; +} + +position_t centeredAt( const pixmap_t *pixmap, const position_t center ) +{ + position_t topleft; + topleft.x = center.x - (pixmap->width / 2); + topleft.y = center.y - (pixmap->height / 2); + return topleft; +} + +position_t pos(const uint16_t x, const uint16_t y) { position_t p; p.x = x; p.y = y; return p; } + +void flipRB(pixmap_t *p) +{ + //if(testForQemu()) return; + + uint32_t x; + register uint8_t tempB; + for (x = 0; x < (p->height) * (p->width) ; x++) { + tempB = (p->pixels[x]).ch.b; + (p->pixels[x]).ch.b = (p->pixels[x]).ch.r; + (p->pixels[x]).ch.r = tempB; + } +} diff --git a/i386/boot2/graphic_utils.h b/i386/boot2/graphic_utils.h new file mode 100644 index 0000000..53905a4 --- /dev/null +++ b/i386/boot2/graphic_utils.h @@ -0,0 +1,61 @@ + /* Graphic utility functions and data types + * Prashant Vaibhav (C) 12/12/2008 + * Chameleon + */ + +// Everything here is 32 bits per pixel non-premultiplied ARGB format +// + +#ifndef GRAPHIC_UTILS_H +#define GRAPHIC_UTILS_H + +#include "boot.h" + + +typedef union { + struct { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; + } ch; + uint8_t channel[4]; + uint32_t value; +} pixel_t; + +typedef struct { + uint16_t height; + uint16_t width; + pixel_t* pixels; +} pixmap_t; + +typedef struct { + uint32_t x; + uint32_t y; +} position_t; + +// Blends the given pixmap into the given background at the given position +// Uses the alpha channels to blend, and preserves the final alpha (so the +// resultant pixmap can be blended again with another background). +// ported from www.stereopsis.com/doubleblend.html +void blend( const pixmap_t *blendThis, // Source image + pixmap_t *blendInto, // Dest image + const position_t position); // Where to place the source image +// Returns the topleft co-ordinate where if you put the 'toCenter' pixmap, +// it is centered in the background. +position_t centeredIn( const pixmap_t *background, const pixmap_t *toCenter ); + +// Returns the topleft co-ordinate where if you put the given pixmap, its +// center will coincide with the th given center. +position_t centeredAt( const pixmap_t *pixmap, const position_t center ); + +// Utility function returns a position_t struct given the x and y coords as uint16 +position_t pos(const uint16_t x, const uint16_t y); + +// Flips the R and B components of all pixels in the given pixmap +void flipRB(pixmap_t *p); + +// Utility function to get pixel at (x,y) in a pixmap +#define pixel(p,x,y) ((p)->pixels[(x) + (y) * (p)->width]) + +#endif//GRAPHIC_UTILS_H diff --git a/i386/boot2/graphics.c b/i386/boot2/graphics.c new file mode 100644 index 0000000..d9473b4 --- /dev/null +++ b/i386/boot2/graphics.c @@ -0,0 +1,1248 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "boot.h" +#include "vbe.h" +#include "appleClut8.h" +#include "gui.h" +#include "IOHibernatePrivate.h" + +/* + * for spinning disk + */ +static int currentIndicator = 0; + +int previewTotalSectors = 0; +int previewLoadedSectors = 0; +uint8_t *previewSaveunder = 0; + +#define VIDEO(x) (bootArgs->Video.v_ ## x) + +//========================================================================== +// getVBEVideoRam + +uint32_t getVBEVideoRam() +{ + VBEInfoBlock vbeInfo; + int err, small; + char *buff = malloc(sizeof(char)*256); + if(!buff) return 0; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if (err != errSuccess) + return 0; + + if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) ) + return 0; + + small = (vbeInfo.TotalMemory < 16); + + return vbeInfo.TotalMemory * 64 * 1024; +} + +//========================================================================== +// getVBEInfoString + +char *getVBEInfoString() +{ + VBEInfoBlock vbeInfo; + int err, small; + char *buff = malloc(sizeof(char)*256); + if(!buff) return 0; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if (err != errSuccess) + return 0; + + if ( strncmp( (char *)vbeInfo.VESASignature, "VESA", 4 ) ) + return 0; + + small = (vbeInfo.TotalMemory < 16); + + sprintf(buff, "VESA v%d.%d %d%s (%s)\n", + vbeInfo.VESAVersion >> 8, + vbeInfo.VESAVersion & 0xf, + small ? (vbeInfo.TotalMemory * 64) : (vbeInfo.TotalMemory / 16), + small ? "KB" : "MB", + VBEDecodeFP(const char *, vbeInfo.OEMStringPtr) ); + + return buff; +} + +//========================================================================== +// + +void +printVBEModeInfo() +{ + VBEInfoBlock vbeInfo; + unsigned short * modePtr; + VBEModeInfoBlock modeInfo; + int err; + int line; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if ( err != errSuccess ) + return; + + line = 0; + + // Activate and clear page 1 + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition( 0, 0, 1 ); + + printf( getVBEInfoString() ); + printf("Video modes supported:\n", VBEDecodeFP(const char *, vbeInfo.OEMStringPtr)); + + // Loop through the mode list, and find the matching mode. + + for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); + *modePtr != modeEndOfList; modePtr++ ) + { + // Get mode information. + + bzero( &modeInfo, sizeof(modeInfo) ); + err = getVBEModeInfo( *modePtr, &modeInfo ); + if ( err != errSuccess ) + { + continue; + } + + printf("Mode %x: %dx%dx%d mm:%d attr:%x\n", + *modePtr, modeInfo.XResolution, modeInfo.YResolution, + modeInfo.BitsPerPixel, modeInfo.MemoryModel, + modeInfo.ModeAttributes); + + if (line++ >= 20) { + pause(); + line = 0; + clearScreenRows(0, 24); + setCursorPosition( 0, 0, 1 ); + } + } + if (line != 0) { + pause(); + } + setActiveDisplayPage(0); +} + +char *getVBEModeInfoString() +{ + VBEInfoBlock vbeInfo; + unsigned short * modePtr; + VBEModeInfoBlock modeInfo; + int err; + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if ( err != errSuccess ) + return 0; + + char *buff=malloc(sizeof(char)*3072); + if(!buff) return 0; + + // Loop through the mode list, and find the matching mode. + for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); + *modePtr != modeEndOfList; modePtr++ ) + { + // Get mode information. + + bzero( &modeInfo, sizeof(modeInfo) ); + err = getVBEModeInfo( *modePtr, &modeInfo ); + if ( err != errSuccess ) + { + continue; + } + + sprintf(buff+strlen(buff), "Mode %x: %dx%dx%d mm:%d attr:%x\n", + *modePtr, modeInfo.XResolution, modeInfo.YResolution, + modeInfo.BitsPerPixel, modeInfo.MemoryModel, + modeInfo.ModeAttributes); + + } + return buff; +} + +//========================================================================== +// getVESAModeWithProperties +// +// Return the VESA mode that matches the properties specified. +// If a mode is not found, then return the "best" available mode. + +static unsigned short +getVESAModeWithProperties( unsigned short width, + unsigned short height, + unsigned char bitsPerPixel, + unsigned short attributesSet, + unsigned short attributesClear, + VBEModeInfoBlock * outModeInfo, + unsigned short * vesaVersion ) +{ + VBEInfoBlock vbeInfo; + unsigned short * modePtr; + VBEModeInfoBlock modeInfo; + unsigned char modeBitsPerPixel; + unsigned short matchedMode = modeEndOfList; + int err; + + // Clear output mode info. + + bzero( outModeInfo, sizeof(*outModeInfo) ); + + // Get VBE controller info containing the list of supported modes. + + bzero( &vbeInfo, sizeof(vbeInfo) ); + strcpy( (char*)&vbeInfo, "VBE2" ); + err = getVBEInfo( &vbeInfo ); + if ( err != errSuccess ) + { + return modeEndOfList; + } + + // Report the VESA major/minor version number. + + if (vesaVersion) *vesaVersion = vbeInfo.VESAVersion; + + // Loop through the mode list, and find the matching mode. + + for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr ); + *modePtr != modeEndOfList; modePtr++ ) + { + // Get mode information. + + bzero( &modeInfo, sizeof(modeInfo) ); + err = getVBEModeInfo( *modePtr, &modeInfo ); + if ( err != errSuccess ) + { + continue; + } + +#if DEBUG + printf("Mode %x: %dx%dx%d mm:%d attr:%x\n", + *modePtr, modeInfo.XResolution, modeInfo.YResolution, + modeInfo.BitsPerPixel, modeInfo.MemoryModel, + modeInfo.ModeAttributes); +#endif + + // Filter out unwanted modes based on mode attributes. + + if ( ( ( modeInfo.ModeAttributes & attributesSet ) != attributesSet ) + || ( ( modeInfo.ModeAttributes & attributesClear ) != 0 ) ) + { + continue; + } + + // Pixel depth in bits. + + modeBitsPerPixel = modeInfo.BitsPerPixel; + + if ( ( modeBitsPerPixel == 4 ) && ( modeInfo.MemoryModel == 0 ) ) + { + // Text mode, 16 colors. + } + else if ( ( modeBitsPerPixel == 8 ) && ( modeInfo.MemoryModel == 4 ) ) + { + // Packed pixel, 256 colors. + } + else if ( ( ( modeBitsPerPixel == 16 ) || ( modeBitsPerPixel == 15 ) ) + && ( modeInfo.MemoryModel == 6 ) + && ( modeInfo.RedMaskSize == 5 ) + && ( modeInfo.GreenMaskSize == 5 ) + && ( modeInfo.BlueMaskSize == 5 ) ) + { + // Direct color, 16 bpp (1:5:5:5). + modeInfo.BitsPerPixel = modeBitsPerPixel = 16; + } + else if ( ( modeBitsPerPixel == 32 ) + && ( modeInfo.MemoryModel == 6 ) + && ( modeInfo.RedMaskSize == 8 ) + && ( modeInfo.GreenMaskSize == 8 ) + && ( modeInfo.BlueMaskSize == 8 ) ) + { + // Direct color, 32 bpp (8:8:8:8). + } + else + { + continue; // Not a supported mode. + } + + // Modes larger than the specified dimensions are skipped. + + if ( ( modeInfo.XResolution > width ) || + ( modeInfo.YResolution > height ) ) + { + continue; + } + + // Perfect match, we're done looking. + + if ( ( modeInfo.XResolution == width ) && + ( modeInfo.YResolution == height ) && + ( modeBitsPerPixel == bitsPerPixel ) ) + { + matchedMode = *modePtr; + bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) ); + break; + } + + // Save the next "best" mode in case a perfect match is not found. + + if ( modeInfo.XResolution == outModeInfo->XResolution && + modeInfo.YResolution == outModeInfo->YResolution && + modeBitsPerPixel <= outModeInfo->BitsPerPixel ) + { + continue; // Saved mode has more depth. + } + if ( modeInfo.XResolution < outModeInfo->XResolution || + modeInfo.YResolution < outModeInfo->YResolution || + modeBitsPerPixel < outModeInfo->BitsPerPixel ) + { + continue; // Saved mode has more resolution. + } + + matchedMode = *modePtr; + bcopy( &modeInfo, outModeInfo, sizeof(modeInfo) ); + } + + return matchedMode; +} + +//========================================================================== +// setupPalette + +static void setupPalette( VBEPalette * p, const unsigned char * g ) +{ + int i; + unsigned char * source = (unsigned char *) g; + + for (i = 0; i < 256; i++) + { + (*p)[i] = 0; + (*p)[i] |= ((unsigned long)((*source++) >> 2)) << 16; // Red + (*p)[i] |= ((unsigned long)((*source++) >> 2)) << 8; // Green + (*p)[i] |= ((unsigned long)((*source++) >> 2)); // Blue + } +} + +//========================================================================== +// Simple decompressor for boot images encoded in RLE format. + +char * decodeRLE( const void * rleData, int rleBlocks, int outBytes ) +{ + char *out, *cp; + + struct RLEBlock { + unsigned char count; + unsigned char value; + } * bp = (struct RLEBlock *) rleData; + + out = cp = malloc( outBytes ); + if ( out == NULL ) return NULL; + + while ( rleBlocks-- ) + { + memset( cp, bp->value, bp->count ); + cp += bp->count; + bp++; + } + + return out; +} + +//========================================================================== +// setVESAGraphicsMode + +static int +setVESAGraphicsMode( unsigned short width, + unsigned short height, + unsigned char bitsPerPixel, + unsigned short refreshRate ) +{ + VBEModeInfoBlock minfo; + unsigned short mode; + unsigned short vesaVersion; + int err = errFuncNotSupported; + + do { + mode = getVESAModeWithProperties( width, height, bitsPerPixel, + maColorModeBit | + maModeIsSupportedBit | + maGraphicsModeBit | + maLinearFrameBufferAvailBit, + 0, + &minfo, &vesaVersion ); + if ( mode == modeEndOfList ) + { + break; + } + +// +// FIXME : generateCRTCTiming() causes crash. +// + +// if ( (vesaVersion >> 8) >= 3 && refreshRate >= 60 && +// (gBootMode & kBootModeSafe) == 0 ) +// { +// VBECRTCInfoBlock timing; +// +// // Generate CRTC timing for given refresh rate. +// +// generateCRTCTiming( minfo.XResolution, minfo.YResolution, +// refreshRate, kCRTCParamRefreshRate, +// &timing ); +// +// // Find the actual pixel clock supported by the hardware. +// +// getVBEPixelClock( mode, &timing.PixelClock ); +// +// // Re-compute CRTC timing based on actual pixel clock. +// +// generateCRTCTiming( minfo.XResolution, minfo.YResolution, +// timing.PixelClock, kCRTCParamPixelClock, +// &timing ); +// +// // Set the video mode and use specified CRTC timing. +// +// err = setVBEMode( mode | kLinearFrameBufferBit | +// kCustomRefreshRateBit, &timing ); +// } +// else +// { +// // Set the mode with default refresh rate. +// +// err = setVBEMode( mode | kLinearFrameBufferBit, NULL ); +// } + + // Set the mode with default refresh rate. + + err = setVBEMode( mode | kLinearFrameBufferBit, NULL ); + + if ( err != errSuccess ) + { + break; + } + + // Set 8-bit color palette. + + if ( minfo.BitsPerPixel == 8 ) + { + VBEPalette palette; + setupPalette( &palette, appleClut8 ); + if ((err = setVBEPalette(palette)) != errSuccess) + { + break; + } + } + + // Is this required for buggy Video BIOS implementations? + // On which adapter? + + if ( minfo.BytesPerScanline == 0 ) + minfo.BytesPerScanline = ( minfo.XResolution * + minfo.BitsPerPixel ) >> 3; + + // Update KernBootStruct using info provided by the selected + // VESA mode. + + bootArgs->Video.v_display = GRAPHICS_MODE; + bootArgs->Video.v_width = minfo.XResolution; + bootArgs->Video.v_height = minfo.YResolution; + bootArgs->Video.v_depth = minfo.BitsPerPixel; + bootArgs->Video.v_rowBytes = minfo.BytesPerScanline; + bootArgs->Video.v_baseAddr = VBEMakeUInt32(minfo.PhysBasePtr); + + } + while ( 0 ); + + return err; +} + +int +convertImage( unsigned short width, + unsigned short height, + const unsigned char *imageData, + unsigned char **newImageData ) +{ + int cnt; + unsigned char *img = 0; + unsigned short *img16; + unsigned long *img32; + + switch ( VIDEO(depth) ) { + case 16 : + img16 = malloc(width * height * 2); + if ( !img16 ) break; + for (cnt = 0; cnt < (width * height); cnt++) + img16[cnt] = lookUpCLUTIndex(imageData[cnt], 16); + img = (unsigned char *)img16; + break; + + case 32 : + img32 = malloc(width * height * 4); + if ( !img32 ) break; + for (cnt = 0; cnt < (width * height); cnt++) + img32[cnt] = lookUpCLUTIndex(imageData[cnt], 32); + img = (unsigned char *)img32; + break; + + default : + img = malloc(width * height); + bcopy(imageData, img, width * height); + break; + } + *newImageData = img; + return 0; +} + +int loadPngImage(const char *filename, uint16_t *width, uint16_t *height, + uint8_t **imageData) +{ + uint8_t *pngData = NULL; + int pngFile = 0, pngSize; + PNG_info_t *info; + int error = 0; + + pngFile = open_bvdev("bt(0,0)", filename, 0); + if (pngFile == -1) { + error = -1; + goto failed; + } + pngSize = file_size(pngFile); + if (!pngSize) { + error = -1; + goto failed; + } + pngData = malloc(pngSize); + if (read(pngFile, (char *) pngData, pngSize) != pngSize) { + error = -1; + goto failed; + } + + PNG_error = -1; + info = PNG_decode(pngData, pngSize); + if (PNG_error != 0) { + error = PNG_error; + goto failed; + } else if ((info->width > 0xffff) || (info->height > 0xffff)) { + error = -1; + goto failed; + } else if ((info->width * info->height * 4) != info->image->size) { + error = -1; + goto failed; + } + uint8_t *result = malloc(info->width*4*info->height); + *width = info->width; + *height = info->height; + memcpy(result, info->image->data, info->width*4*info->height); + *imageData = result; + +failed: + png_alloc_free_all(); + if (pngData) + free(pngData); + if (pngFile != -1) + close(pngFile); + + return error; +} + +int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData) { + PNG_info_t *info; + int error = 0; + + PNG_error = -1; + info = PNG_decode(pngData, pngSize); + if (PNG_error != 0) { + error = PNG_error; + goto failed; + } else if ((info->width > 0xffff) || (info->height > 0xffff)) { + error = -1; + goto failed; + } else if ((info->width * info->height * 4) != info->image->size) { + error = -1; + goto failed; + } + uint8_t *result = malloc(info->width*4*info->height); + *width = info->width; + *height = info->height; + memcpy(result, info->image->data, info->width*4*info->height); + *imageData = result; + +failed: + png_alloc_free_all(); + + return error; +} + +void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, + uint8_t *data) +{ + uint16_t drawWidth; + uint8_t *vram = (uint8_t *) VIDEO(baseAddr) + VIDEO(rowBytes) * y + 4 * x; + + drawWidth = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); + while (height--) { + switch (VIDEO (depth)) + { + case 32: /* Optimized version*/ + { + uint32_t s; uint32_t* d; // Source (img) and destination (bkgd) pixels + uint32_t a; // Alpha + uint32_t dstrb, dstg, srcrb, srcg, drb, dg, rb, g, tempB; // Intermediate variables + uint16_t pos; + + for (pos = 0; pos < drawWidth * 4; pos += 4) { + // Fast pseudo-vector alpha blending, adapted from: http://www.stereopsis.com/doubleblend.html + s = *((uint32_t*) (data + pos)); + d = (uint32_t*) (vram + pos); + + // Flip B and R in source + // TODO: use XCHG and inline assembly to do this in a faster, saner way + tempB = (s & 0xFF0000); // save B + s = (s & 0xFF00FFFF) | ((s & 0xFF) << 16); // put R in B + s = (s & 0xFFFFFF00) | (tempB >> 16); // put B in R + + a = (s >> 24) + 1; + + dstrb = *d & 0xFF00FF; dstg = *d & 0xFF00; + srcrb = s & 0xFF00FF; srcg = s & 0xFF00; + + drb = srcrb - dstrb; + dg = srcg - dstg; + drb *= a; dg *= a; + drb >>= 8; dg >>= 8; + + rb = (drb + dstrb) & 0xFF00FF; + g = (dg + dstg) & 0xFF00; + + *d = rb | g; + } + } + break; + + default: /*Universal version*/ + { + uint32_t s; + uint32_t a; // Alpha + uint32_t dr, dg, db, sr, sg, sb; // Intermediate variables + uint16_t pos; + int bpp = (VIDEO (depth) + 7)/8; + + for (pos = 0; pos < drawWidth; pos ++) { + // Fast pseudo-vector alpha blending, adapted from: http://www.stereopsis.com/doubleblend.html + s = *((uint32_t*) (data + 4*pos)); + + sb = (s & 0xFF0000) >> 16; + sg = (s & 0xFF00) >> 8; + sr = (s & 0xFF); + + a = (s >> 24) + 1; + + switch (VIDEO (depth)) + { + case 24: + db = ((*(uint32_t *)(vram + bpp*pos))&0xff); + dg = ((*(uint32_t *)(vram + bpp*pos))&0xff00)>>8; + dr = ((*(uint32_t *)(vram + bpp*pos))&0xff0000)>>16; + break; + case 16://16-bit seems to be 15-bit +/* db = ((*(uint16_t *)(vram + bpp*pos))&0x1f)<<3; + dg = ((*(uint16_t *)(vram + bpp*pos))&0x07e0)>>3; + dr = ((*(uint16_t *)(vram + bpp*pos))&0xf800)>>8; + break; */ + case 15: + db = ((*(uint16_t *)(vram + bpp*pos))&0x1f)<<3; + dg = ((*(uint16_t *)(vram + bpp*pos))&0x03e0)>>2; + dr = ((*(uint16_t *)(vram + bpp*pos))&0x7c00)>>7; + break; + default: + return; + } + + dr = (((sr - dr) * a) >> 8) + dr; + dg = (((sg - dg) * a) >> 8) + dg; + db = (((sb - db) * a) >> 8) + db; + switch (VIDEO (depth)) + { + case 24: + *(uint32_t *)(vram + bpp*pos) = (*(uint32_t *)(vram + bpp*pos) &0xff000000) + | (db&0xff) | ((dg&0xff)<<8) | ((dr&0xff)<<16); + break; + case 16: +// *(uint16_t *)(vram + bpp*pos) = ((db&0xf8)>>3) | ((dg&0xfc)<<3) | ((dr&0xf8)<<8); +// break; + case 15: + *(uint16_t *)(vram + bpp*pos) = ((db&0xf8)>>3) | ((dg&0xf8)<<2) | ((dr&0xf8)<<7); + break; + } + + } + } + break; + } + vram += VIDEO(rowBytes); + data += width * 4; + } +} + +void drawCheckerBoard() +{ + uint32_t *vram = (uint32_t *) VIDEO(baseAddr); + uint16_t x, y; + uint8_t color; + + for (y = 0; y < VIDEO(height); y++, vram += VIDEO(width)) { + for (x = 0; x < VIDEO(width); x++) { + color = 204 + 51 * (((x / 8) % 2) == ((y / 8) % 2)); + vram[x] = (color << 16) | (color << 8) | color; + } + } +} + +//========================================================================== +// LookUpCLUTIndex + +unsigned long lookUpCLUTIndex( unsigned char index, + unsigned char depth ) +{ + long result, red, green, blue; + + red = appleClut8[index * 3 + 0]; + green = appleClut8[index * 3 + 1]; + blue = appleClut8[index * 3 + 2]; + + switch (depth) { + case 16 : + result = ((red & 0xF8) << 7) | + ((green & 0xF8) << 2) | + ((blue & 0xF8) >> 3); + result |= (result << 16); + break; + + case 32 : + result = (red << 16) | (green << 8) | blue; + break; + + default : + result = index | (index << 8); + result |= (result << 16); + break; + } + + return result; +} + +//========================================================================== +// drawColorRectangle + +void * stosl(void * dst, long val, long len) +{ + asm volatile ( "rep; stosl" + : "=c" (len), "=D" (dst) + : "0" (len), "1" (dst), "a" (val) + : "memory" ); + + return dst; +} + +void drawColorRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char colorIndex ) +{ + long pixelBytes; + long color = lookUpCLUTIndex( colorIndex, VIDEO(depth) ); + char * vram; + + pixelBytes = VIDEO(depth) / 8; + vram = (char *) VIDEO(baseAddr) + + VIDEO(rowBytes) * y + pixelBytes * x; + + width = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); + + while ( height-- ) + { + int rem = ( pixelBytes * width ) % 4; + if ( rem ) bcopy( &color, vram, rem ); + stosl( vram + rem, color, pixelBytes * width / 4 ); + vram += VIDEO(rowBytes); + } +} + +//========================================================================== +// drawDataRectangle + +void drawDataRectangle( unsigned short x, + unsigned short y, + unsigned short width, + unsigned short height, + unsigned char * data ) +{ + unsigned short drawWidth; + long pixelBytes = VIDEO(depth) / 8; + unsigned char * vram = (unsigned char *) VIDEO(baseAddr) + + VIDEO(rowBytes) * y + pixelBytes * x; + + drawWidth = MIN(width, VIDEO(width) - x); + height = MIN(height, VIDEO(height) - y); + while ( height-- ) { + bcopy( data, vram, drawWidth * pixelBytes ); + vram += VIDEO(rowBytes); + data += width * pixelBytes; + } +} + +void +loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or) +{ + int x,y, off; + int red=0x7f, green=0x7f, blue=0x7f; + for (x=0;x>7)&0xf8; + green=(val>>2)&0xf8; + blue=(val<<3)&0xf8; + break; + } + case 32: + { + uint32_t val; + val=((uint32_t *)input)[off]; + red=(val>>16)&0xff; + green=(val>>8)&0xff; + blue=(val)&0xff; + break; + } + } + char *ptr=(char *)output+x*(op/8)+y*or; + switch (op) + { + case 16: + *((uint16_t *)ptr) = ((red & 0xF8) << 7) | + ((green & 0xF8) << 2) | + ((blue & 0xF8) >> 3); + break; + case 32 : + *((uint32_t *)ptr) = (red << 16) | (green << 8) | blue; + break; + } + } +} + +DECLARE_IOHIBERNATEPROGRESSALPHA + +void drawPreview(void *src, uint8_t * saveunder) +{ + uint8_t * screen; + uint32_t rowBytes, pixelShift; + uint32_t x, y; + int32_t blob; + uint32_t alpha, in, color, result; + uint8_t * out; + void *uncomp; + int origwidth, origheight, origbpx; + uint32_t saveindex[kIOHibernateProgressCount] = { 0 }; + + if (src && (uncomp=DecompressData(src, &origwidth, &origheight, &origbpx))) + { + if (!setVESAGraphicsMode(origwidth, origheight, origbpx, 0)) + if (initGraphicsMode () != errSuccess) + return; + screen = (uint8_t *) VIDEO (baseAddr); + rowBytes = VIDEO (rowBytes); + loadImageScale (uncomp, origwidth, origheight, origbpx, screen, VIDEO(width), VIDEO(height), VIDEO(depth), VIDEO (rowBytes)); + } + else + { + if (initGraphicsMode () != errSuccess) + return; + screen = (uint8_t *) VIDEO (baseAddr); + rowBytes = VIDEO (rowBytes); + // Set the screen to 75% grey. + drawColorRectangle(0, 0, VIDEO(width), VIDEO(height), 0x01 /* color index */); + } + + + pixelShift = VIDEO (depth) >> 4; + if (pixelShift < 1) return; + + screen += ((VIDEO (width) + - kIOHibernateProgressCount * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << (pixelShift - 1)) + + (VIDEO (height) - kIOHibernateProgressOriginY - kIOHibernateProgressHeight) * rowBytes; + + for (y = 0; y < kIOHibernateProgressHeight; y++) + { + out = screen + y * rowBytes; + for (blob = 0; blob < kIOHibernateProgressCount; blob++) + { + color = blob ? kIOHibernateProgressDarkGray : kIOHibernateProgressMidGray; + for (x = 0; x < kIOHibernateProgressWidth; x++) + { + alpha = gIOHibernateProgressAlpha[y][x]; + result = color; + if (alpha) + { + if (0xff != alpha) + { + if (1 == pixelShift) + { + in = *((uint16_t *)out) & 0x1f; // 16 + in = (in << 3) | (in >> 2); + } + else + in = *((uint32_t *)out) & 0xff; // 32 + saveunder[blob * kIOHibernateProgressSaveUnderSize + saveindex[blob]++] = in; + result = ((255 - alpha) * in + alpha * result + 0xff) >> 8; + } + if (1 == pixelShift) + { + result >>= 3; + *((uint16_t *)out) = (result << 10) | (result << 5) | result; // 16 + } + else + *((uint32_t *)out) = (result << 16) | (result << 8) | result; // 32 + } + out += (1 << pixelShift); + } + out += (kIOHibernateProgressSpacing << pixelShift); + } + } +} + +void updateProgressBar(uint8_t * saveunder, int32_t firstBlob, int32_t select) +{ + uint8_t * screen; + uint32_t rowBytes, pixelShift; + uint32_t x, y; + int32_t blob, lastBlob; + uint32_t alpha, in, color, result; + uint8_t * out; + uint32_t saveindex[kIOHibernateProgressCount] = { 0 }; + + pixelShift = VIDEO(depth) >> 4; + if (pixelShift < 1) return; + screen = (uint8_t *) VIDEO (baseAddr); + rowBytes = VIDEO (rowBytes); + + screen += ((VIDEO (width) + - kIOHibernateProgressCount * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << (pixelShift - 1)) + + (VIDEO (height) - kIOHibernateProgressOriginY - kIOHibernateProgressHeight) * rowBytes; + + lastBlob = (select < kIOHibernateProgressCount) ? select : (kIOHibernateProgressCount - 1); + + screen += (firstBlob * (kIOHibernateProgressWidth + kIOHibernateProgressSpacing)) << pixelShift; + + for (y = 0; y < kIOHibernateProgressHeight; y++) + { + out = screen + y * rowBytes; + for (blob = firstBlob; blob <= lastBlob; blob++) + { + color = (blob < select) ? kIOHibernateProgressLightGray : kIOHibernateProgressMidGray; + for (x = 0; x < kIOHibernateProgressWidth; x++) + { + alpha = gIOHibernateProgressAlpha[y][x]; + result = color; + if (alpha) + { + if (0xff != alpha) + { + in = saveunder[blob * kIOHibernateProgressSaveUnderSize + saveindex[blob]++]; + result = ((255 - alpha) * in + alpha * result + 0xff) / 255; + } + if (1 == pixelShift) + { + result >>= 3; + *((uint16_t *)out) = (result << 10) | (result << 5) | result; // 16 + } + else + *((uint32_t *)out) = (result << 16) | (result << 8) | result; // 32 + } + out += (1 << pixelShift); + } + out += (kIOHibernateProgressSpacing << pixelShift); + } + } +} + + +//========================================================================== +// setVESATextMode + +static int +setVESATextMode( unsigned short cols, + unsigned short rows, + unsigned char bitsPerPixel ) +{ + VBEModeInfoBlock minfo; + unsigned short mode = modeEndOfList; + + if ( (cols != 80) || (rows != 25) ) // not 80x25 mode + { + mode = getVESAModeWithProperties( cols, rows, bitsPerPixel, + maColorModeBit | + maModeIsSupportedBit, + maGraphicsModeBit, + &minfo, NULL ); + } + + if ( ( mode == modeEndOfList ) || ( setVBEMode(mode, NULL) != errSuccess ) ) + { + video_mode( 2 ); // VGA BIOS, 80x25 text mode. + minfo.XResolution = 80; + minfo.YResolution = 25; + } + + // Update KernBootStruct using info provided by the selected + // VESA mode. + + bootArgs->Video.v_display = VGA_TEXT_MODE; + bootArgs->Video.v_baseAddr = 0xb8000; + bootArgs->Video.v_width = minfo.XResolution; + bootArgs->Video.v_height = minfo.YResolution; + bootArgs->Video.v_depth = 8; + bootArgs->Video.v_rowBytes = 0x8000; + + return errSuccess; // always return success +} + +//========================================================================== +// getNumberArrayFromProperty + +static int +getNumberArrayFromProperty( const char * propKey, + unsigned long numbers[], + unsigned long maxArrayCount ) +{ + char * propStr; + unsigned long count = 0; + + propStr = newStringForKey( (char *) propKey , &bootInfo->chameleonConfig ); + if ( propStr ) + { + char * delimiter = propStr; + char * p = propStr; + + while ( count < maxArrayCount && *p != '\0' ) + { + unsigned long val = strtoul( p, &delimiter, 10 ); + if ( p != delimiter ) + { + numbers[count++] = val; + p = delimiter; + } + while ( ( *p != '\0' ) && !isdigit(*p) ) + p++; + } + + free( propStr ); + } + + return count; +} + +int initGraphicsMode () +{ + unsigned long params[4]; + int count; + + params[3] = 0; + count = getNumberArrayFromProperty( kGraphicsModeKey, params, 4 ); + + // Try to find a resolution if "Graphics Mode" setting is not available. + if ( count < 3 ) + { + // Use the default resolution if we don't have an initialized GUI. + if (gui.screen.width == 0 || gui.screen.height == 0) + { + gui.screen.width = DEFAULT_SCREEN_WIDTH; + gui.screen.height = DEFAULT_SCREEN_HEIGHT; + } + + params[0] = gui.screen.width; + params[1] = gui.screen.height; + params[2] = 32; + } + + // Map from pixel format to bits per pixel. + + if ( params[2] == 256 ) params[2] = 8; + if ( params[2] == 555 ) params[2] = 16; + if ( params[2] == 888 ) params[2] = 32; + + return setVESAGraphicsMode( params[0], params[1], params[2], params[3] ); +} + +//========================================================================== +// setVideoMode +// +// Set the video mode to VGA_TEXT_MODE or GRAPHICS_MODE. + +void +setVideoMode( int mode, int drawgraphics) +{ + unsigned long params[4]; + int count; + int err = errSuccess; + + if ( mode == GRAPHICS_MODE ) + { + if ( (err=initGraphicsMode ()) == errSuccess ) { + if (gVerboseMode) { + // Tell the kernel to use text mode on a linear frame buffer display + bootArgs->Video.v_display = FB_TEXT_MODE; + } else { + bootArgs->Video.v_display = GRAPHICS_MODE; + } + } + } + + if ( (mode == VGA_TEXT_MODE) || (err != errSuccess) ) + { + count = getNumberArrayFromProperty( kTextModeKey, params, 2 ); + if ( count < 2 ) + { + params[0] = 80; // Default text mode is 80x25. + params[1] = 25; + } + + setVESATextMode( params[0], params[1], 4 ); + bootArgs->Video.v_display = VGA_TEXT_MODE; + } + + currentIndicator = 0; +} + +void getGraphicModeParams(unsigned long params[]) { + + params[3] = 0; + + VBEModeInfoBlock minfo; + + unsigned short vesaVersion; + unsigned short mode = modeEndOfList; + + getNumberArrayFromProperty( kGraphicsModeKey, params, 4); + + mode = getVESAModeWithProperties( params[0], params[1], params[2], + maColorModeBit | + maModeIsSupportedBit | + maGraphicsModeBit | + maLinearFrameBufferAvailBit, + 0, + &minfo, &vesaVersion ); + + params[0] = minfo.XResolution; + params[1] = minfo.YResolution; + params[2] = 32; +} + +//========================================================================== +// Return the current video mode, VGA_TEXT_MODE or GRAPHICS_MODE. + +int getVideoMode(void) +{ + return bootArgs->Video.v_display; +} + +//========================================================================== +// Display and clear the activity indicator. + +static char indicator[] = {'-', '\\', '|', '/', '-', '\\', '|', '/', '\0'}; + +// To prevent a ridiculously fast-spinning indicator, +// ensure a minimum of 1/9 sec between animation frames. +#define MIN_TICKS 2 + +void +spinActivityIndicator(int sectors) +{ + static unsigned long lastTickTime = 0, currentTickTime; + + if (previewTotalSectors && previewSaveunder) + { + int blob, lastBlob; + + lastBlob = (previewLoadedSectors * kIOHibernateProgressCount) / previewTotalSectors; + previewLoadedSectors+=sectors; + blob = (previewLoadedSectors * kIOHibernateProgressCount) / previewTotalSectors; + + if (blob!=lastBlob) + updateProgressBar (previewSaveunder, lastBlob, blob); + return; + } + + currentTickTime = time18(); // late binding + if (currentTickTime < lastTickTime + MIN_TICKS) + { + return; + } + else + { + lastTickTime = currentTickTime; + } + + if (getVideoMode() == VGA_TEXT_MODE) + { + if (currentIndicator >= sizeof(indicator)) + { + currentIndicator = 0; + } + putchar(indicator[currentIndicator++]); + putchar('\b'); + } +} + +void +clearActivityIndicator( void ) +{ + if ( getVideoMode() == VGA_TEXT_MODE ) + { + putchar(' '); + putchar('\b'); + } +} + diff --git a/i386/boot2/graphics.h b/i386/boot2/graphics.h new file mode 100644 index 0000000..132bd95 --- /dev/null +++ b/i386/boot2/graphics.h @@ -0,0 +1,45 @@ +/* + * graphics.h + * + * + * Created by fassl on 22.12.08. + * Copyright 2008 __MyCompanyName__. All rights reserved. + * + */ + +#include "boot.h" +#include "bootstruct.h" +#include "graphic_utils.h" + + +#ifndef __BOOT_GRAPHICS_H +#define __BOOT_GRAPHICS_H + +#define DEFAULT_SCREEN_WIDTH 1024 +#define DEFAULT_SCREEN_HEIGHT 768 + +int loadPngImage(const char *filename, uint16_t *width, uint16_t *height, uint8_t **imageData); + +unsigned long lookUpCLUTIndex( unsigned char index, unsigned char depth ); + +void drawColorRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char colorIndex ); +void drawDataRectangle( unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned char * data ); +int convertImage( unsigned short width, unsigned short height, const unsigned char *imageData, unsigned char **newImageData ); + +int initGraphicsMode (); + +void drawCheckerBoard(); + +void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *data); + +void drawCheckerBoard(); +void blendImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t *data); + +int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData); + +uint32_t getVBEVideoRam(); +char *getVBEInfoString(); +char *getVBEModeInfoString(); +void getGraphicModeParams(unsigned long params[]); + +#endif /* !__BOOT_GRAPHICS_H */ diff --git a/i386/boot2/gui.c b/i386/boot2/gui.c new file mode 100644 index 0000000..54cc8ed --- /dev/null +++ b/i386/boot2/gui.c @@ -0,0 +1,2119 @@ +/* + * gui.c + * + * + * Created by Jasmin Fazlic on 18.12.08. + * Copyright 2008/09 Jasmin Fazlic All rights reserved. + * Copyright 2008/09 iNDi All rights reserved. + * + */ + +#include "gui.h" +#include "term.h" +#include "appleboot.h" +#include "vers.h" + +#define IMG_REQUIRED -1 +#define THEME_NAME_DEFAULT "Default" +static const char *theme_name = THEME_NAME_DEFAULT; + +#ifdef CONFIG_EMBED_THEME +#include "art.h" +#endif + +#define LOADPNG(img, alt_img) if (loadThemeImage(#img, alt_img) != 0) { return 1; } + +#define VIDEO(x) (bootArgs->Video.v_ ## x) + +#define vram VIDEO(baseAddr) + +#define TAB_PIXELS_WIDTH (font->chars[0]->width * 4) // tab = 4 spaces + +int lasttime = 0; // we need this for animating maybe + + +/* + * ATTENTION: the enum and the following array images[] MUST match !!! + */ +enum { + iBackground = 0, + iLogo, + + iDeviceGeneric, + iDeviceGeneric_o, + iDeviceHFS, + iDeviceHFS_o, + iDeviceHFS_mav, + iDeviceHFS_mav_o, + iDeviceHFS_ML, + iDeviceHFS_ML_o, + iDeviceHFS_Lion, + iDeviceHFS_Lion_o, + iDeviceHFS_SL, + iDeviceHFS_SL_o, + iDeviceHFS_Leo, + iDeviceHFS_Leo_o, + iDeviceHFS_Tiger, + iDeviceHFS_Tiger_o, + iDeviceHFSRAID, + iDeviceHFSRAID_o, + iDeviceHFSRAID_mav, + iDeviceHFSRAID_mav_o, + iDeviceHFSRAID_ML, + iDeviceHFSRAID_ML_o, + iDeviceHFSRAID_Lion, + iDeviceHFSRAID_Lion_o, + iDeviceHFSRAID_SL, + iDeviceHFSRAID_SL_o, + iDeviceHFSRAID_Leo, + iDeviceHFSRAID_Leo_o, + iDeviceHFSRAID_Tiger, + iDeviceHFSRAID_Tiger_o, + iDeviceEXT3, + iDeviceEXT3_o, + iDeviceFreeBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceFreeBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceOpenBSD, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceOpenBSD_o, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + iDeviceBEFS, /* Haiku detection and Icon credits to scorpius */ + iDeviceBEFS_o, /* Haiku detection and Icon credits to scorpius */ + iDeviceFAT, + iDeviceFAT_o, + iDeviceFAT16, + iDeviceFAT16_o, + iDeviceFAT32, + iDeviceFAT32_o, + iDeviceNTFS, + iDeviceNTFS_o, + iDeviceCDROM, + iDeviceCDROM_o, + + iSelection, + iDeviceScrollPrev, + iDeviceScrollNext, + + iMenuBoot, + iMenuVerbose, + iMenuIgnoreCaches, + iMenuSingleUser, + iMenuMemoryInfo, + iMenuVideoInfo, + iMenuHelp, + iMenuVerboseDisabled, + iMenuIgnoreCachesDisabled, + iMenuSingleUserDisabled, + iMenuSelection, + + iProgressBar, + iProgressBarBackground, + + iTextScrollPrev, + iTextScrollNext, + + iFontConsole, + iFontSmall, +}; + +image_t images[] = { + {.name = "background", .image = NULL}, + {.name = "logo", .image = NULL}, + + {.name = "device_generic", .image = NULL}, + {.name = "device_generic_o", .image = NULL}, + {.name = "device_hfsplus", .image = NULL}, + {.name = "device_hfsplus_o", .image = NULL}, + {.name = "device_hfsplus_mav", .image = NULL}, + {.name = "device_hfsplus_mav_o", .image = NULL}, + {.name = "device_hfsplus_ml", .image = NULL}, + {.name = "device_hfsplus_ml_o", .image = NULL}, + {.name = "device_hfsplus_lion", .image = NULL}, + {.name = "device_hfsplus_lion_o", .image = NULL}, + {.name = "device_hfsplus_sl", .image = NULL}, + {.name = "device_hfsplus_sl_o", .image = NULL}, + {.name = "device_hfsplus_leo", .image = NULL}, + {.name = "device_hfsplus_leo_o", .image = NULL}, + {.name = "device_hfsplus_tiger", .image = NULL}, + {.name = "device_hfsplus_tiger_o", .image = NULL}, + + {.name = "device_hfsraid", .image = NULL}, + {.name = "device_hfsraid_o", .image = NULL}, + {.name = "device_hfsraid_mav", .image = NULL}, + {.name = "device_hfsraid_mav_o", .image = NULL}, + {.name = "device_hfsraid_ml", .image = NULL}, + {.name = "device_hfsraid_ml_o", .image = NULL}, + {.name = "device_hfsraid_lion", .image = NULL}, + {.name = "device_hfsraid_lion_o", .image = NULL}, + {.name = "device_hfsraid_sl", .image = NULL}, + {.name = "device_hfsraid_sl_o", .image = NULL}, + {.name = "device_hfsraid_leo", .image = NULL}, + {.name = "device_hfsraid_leo_o", .image = NULL}, + {.name = "device_hfsraid_tiger", .image = NULL}, + {.name = "device_hfsraid_tiger_o", .image = NULL}, + {.name = "device_ext3", .image = NULL}, + {.name = "device_ext3_o", .image = NULL}, + {.name = "device_freebsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_freebsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_openbsd", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_openbsd_o", .image = NULL}, /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + {.name = "device_befs", .image = NULL}, /* Haiku detection and Icon credits to scorpius */ + {.name = "device_befs_o", .image = NULL}, /* Haiku detection and Icon credits to scorpius */ + {.name = "device_fat", .image = NULL}, + {.name = "device_fat_o", .image = NULL}, + {.name = "device_fat16", .image = NULL}, + {.name = "device_fat16_o", .image = NULL}, + {.name = "device_fat32", .image = NULL}, + {.name = "device_fat32_o", .image = NULL}, + {.name = "device_ntfs", .image = NULL}, + {.name = "device_ntfs_o", .image = NULL}, + {.name = "device_cdrom", .image = NULL}, + {.name = "device_cdrom_o", .image = NULL}, + + {.name = "device_selection", .image = NULL}, + {.name = "device_scroll_prev", .image = NULL}, + {.name = "device_scroll_next", .image = NULL}, + + {.name = "menu_boot", .image = NULL}, + {.name = "menu_verbose", .image = NULL}, + {.name = "menu_ignore_caches", .image = NULL}, + {.name = "menu_single_user", .image = NULL}, + {.name = "menu_memory_info", .image = NULL}, + {.name = "menu_video_info", .image = NULL}, + {.name = "menu_help", .image = NULL}, + {.name = "menu_verbose_disabled", .image = NULL}, + {.name = "menu_ignore_caches_disabled", .image = NULL}, + {.name = "menu_single_user_disabled", .image = NULL}, + {.name = "menu_selection", .image = NULL}, + + {.name = "progress_bar", .image = NULL}, + {.name = "progress_bar_background", .image = NULL}, + + {.name = "text_scroll_prev", .image = NULL}, + {.name = "text_scroll_next", .image = NULL}, + + {.name = "font_console", .image = NULL}, + {.name = "font_small", .image = NULL}, +}; + +int imageCnt = 0; + +extern int gDeviceCount; +extern int selectIndex; + +extern MenuItem *menuItems; + +//char prompt[BOOT_STRING_LEN]; +extern char gBootArgs[BOOT_STRING_LEN]; + +char prompt_text[] = "boot: "; + +menuitem_t infoMenuItems[] = +{ + { .text = "Boot" }, + { .text = "Boot Verbose" }, + { .text = "Boot Ignore Caches" }, + { .text = "Boot Single User" }, + { .text = "Memory Info" }, + { .text = "Video Info" }, + { .text = "Help" } +}; + +int initFont(font_t *font, image_t *image); +int destroyFont(font_t *font); +void colorFont(font_t *font, uint32_t color); +void makeRoundedCorners(pixmap_t *p); + +static int infoMenuSelection = 0; +static int infoMenuItemsCount = sizeof(infoMenuItems)/sizeof(infoMenuItems[0]); + +static bool infoMenuNativeBoot = false; + +// here we store the used screen resolution +static unsigned long screen_params[4] = {DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0}; + +static int getImageIndexByName(const char *name) +{ + int i; + for (i = 0; i < sizeof(images) / sizeof(images[0]); i++) + { + if (strcmp(name, images[i].name) == 0) + { + return i; // found the name + } + } + return -1; +} + +#ifdef CONFIG_EMBED_THEME +static int getEmbeddedImageIndexByName(const char *name) +{ + int upperLimit = sizeof(embeddedImages) / sizeof(embeddedImages[0]) - 1; + int lowerLimit = 0; + int compareIndex = (upperLimit - lowerLimit) >> 1; // Midpoint + int result; + + // NOTE: This algorithm assumes that the embedded images are sorted. + // This is currently done using the make file. If the array is + // generated manualy, this *will* fail to work properly. + while((result = strcmp(name, embeddedImages[compareIndex].name)) != 0) + { + if (result > 0) // We need to search a HIGHER index + { + if (compareIndex != lowerLimit) + { + lowerLimit = compareIndex; + } + else + { + return -1; + } + compareIndex = (upperLimit + lowerLimit + 1) >> 1; // Midpoint, round up + } + else // We Need to search a LOWER index + { + if (compareIndex != upperLimit) + { + upperLimit = compareIndex; + } + else + { + return -1; + } + compareIndex = (upperLimit + lowerLimit) >> 1; // Midpoint, round down + } + } + return compareIndex; +} +#endif + +static int loadThemeImage(const char *image, int alt_image) +{ + char dirspec[256]; + int i; +#ifdef CONFIG_EMBED_THEME + int e; +#endif + uint16_t width; + uint16_t height; + uint8_t *imagedata; + + if ((strlen(image) + strlen(theme_name) + 20) > sizeof(dirspec)) + return 1; + if ((i = getImageIndexByName(image)) < 0) + return 1; + if (!images[i].image && !(images[i].image = malloc(sizeof(pixmap_t)))) + return 1; + sprintf(dirspec, "/Extra/Themes/%s/%s.png", theme_name, image); + width = 0; + height = 0; + imagedata = NULL; + if ((loadPngImage(dirspec, &width, &height, &imagedata)) == 0) + { + images[i].image->width = width; + images[i].image->height = height; + images[i].image->pixels = (pixel_t *)imagedata; + flipRB(images[i].image); + return 0; + } +#ifdef CONFIG_EMBED_THEME + else if ((e = getEmbeddedImageIndexByName(image)) >= 0) + { + unsigned char *embed_data; + unsigned int embed_size; + embed_data = embeddedImages[e].pngdata; + embed_size = *embeddedImages[e].length; + + if (loadEmbeddedPngImage(embed_data, embed_size, &width, &height, &imagedata) == 0) + { + images[i].image->width = width; + images[i].image->height = height; + images[i].image->pixels = (pixel_t *)imagedata; + flipRB(images[i].image); + return 0; + } + } +#endif + else if (alt_image != IMG_REQUIRED && is_image_loaded(alt_image)) + { + // Using the passed alternate image for non-mandatory images. + // We don't clone the already existing pixmap, but using its properties instead! + images[i].image->width = images[alt_image].image->width; + images[i].image->height = images[alt_image].image->height; + images[i].image->pixels = images[alt_image].image->pixels; + return 0; + } + + // If we got here it's an error +#ifndef CONFIG_EMBED_THEME + printf("ERROR: GUI: could not open '%s/%s.png'!\n", theme_name, image); + sleep(2); +#endif + free(images[i].image); + images[i].image = NULL; + return 1; +} + +static int loadGraphics(void) +{ + LOADPNG(background, IMG_REQUIRED); + LOADPNG(logo, IMG_REQUIRED); + + LOADPNG(device_generic, IMG_REQUIRED); + LOADPNG(device_generic_o, iDeviceGeneric); + LOADPNG(device_hfsplus, iDeviceGeneric); + LOADPNG(device_hfsplus_o, iDeviceHFS); + LOADPNG(device_hfsplus_mav, iDeviceHFS); + LOADPNG(device_hfsplus_mav_o, iDeviceHFS_mav); + LOADPNG(device_hfsplus_ml, iDeviceHFS); + LOADPNG(device_hfsplus_ml_o, iDeviceHFS_ML); + LOADPNG(device_hfsplus_lion, iDeviceHFS); + LOADPNG(device_hfsplus_lion_o, iDeviceHFS_Lion); + LOADPNG(device_hfsplus_sl, iDeviceHFS); + LOADPNG(device_hfsplus_sl_o, iDeviceHFS_SL); + LOADPNG(device_hfsplus_leo, iDeviceHFS); + LOADPNG(device_hfsplus_leo_o, iDeviceHFS_Leo); + LOADPNG(device_hfsplus_tiger, iDeviceHFS); + LOADPNG(device_hfsplus_tiger_o, iDeviceHFS_Tiger); + + LOADPNG(device_hfsraid, iDeviceHFS); + LOADPNG(device_hfsraid_o, iDeviceHFSRAID); + LOADPNG(device_hfsraid_mav, iDeviceHFSRAID); + LOADPNG(device_hfsraid_mav_o, iDeviceHFSRAID_mav); + LOADPNG(device_hfsraid_ml, iDeviceHFSRAID); + LOADPNG(device_hfsraid_ml_o, iDeviceHFSRAID_ML); + LOADPNG(device_hfsraid_lion, iDeviceHFSRAID); + LOADPNG(device_hfsraid_lion_o, iDeviceHFSRAID_Lion); + LOADPNG(device_hfsraid_sl, iDeviceHFSRAID); + LOADPNG(device_hfsraid_sl_o, iDeviceHFSRAID_SL); + LOADPNG(device_hfsraid_leo, iDeviceHFSRAID); + LOADPNG(device_hfsraid_leo_o, iDeviceHFSRAID_Leo); + LOADPNG(device_hfsraid_tiger, iDeviceHFSRAID); + LOADPNG(device_hfsraid_tiger_o, iDeviceHFSRAID_Tiger); + LOADPNG(device_ext3, iDeviceGeneric); + LOADPNG(device_ext3_o, iDeviceEXT3); + LOADPNG(device_freebsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_freebsd_o, iDeviceFreeBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_openbsd, iDeviceGeneric); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_openbsd_o, iDeviceOpenBSD); /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + LOADPNG(device_befs, iDeviceGeneric); /* Haiku detection and Icon credits to scorpius */ + LOADPNG(device_befs_o, iDeviceBEFS); /* Haiku detection and Icon credits to scorpius */ + LOADPNG(device_fat, iDeviceGeneric); + LOADPNG(device_fat_o, iDeviceFAT); + LOADPNG(device_fat16, iDeviceFAT); + LOADPNG(device_fat16_o, iDeviceFAT16); + LOADPNG(device_fat32, iDeviceFAT); + LOADPNG(device_fat32_o, iDeviceFAT32); + LOADPNG(device_ntfs, iDeviceGeneric); + LOADPNG(device_ntfs_o, iDeviceNTFS); + LOADPNG(device_cdrom, iDeviceGeneric); + LOADPNG(device_cdrom_o, iDeviceCDROM); + + LOADPNG(device_selection, IMG_REQUIRED); + LOADPNG(device_scroll_prev, IMG_REQUIRED); + LOADPNG(device_scroll_next, IMG_REQUIRED); + + LOADPNG(menu_boot, IMG_REQUIRED); + LOADPNG(menu_verbose, IMG_REQUIRED); + LOADPNG(menu_ignore_caches, IMG_REQUIRED); + LOADPNG(menu_single_user, IMG_REQUIRED); + LOADPNG(menu_memory_info, IMG_REQUIRED); + LOADPNG(menu_video_info, IMG_REQUIRED); + LOADPNG(menu_help, IMG_REQUIRED); + LOADPNG(menu_verbose_disabled, IMG_REQUIRED); + LOADPNG(menu_ignore_caches_disabled, IMG_REQUIRED); + LOADPNG(menu_single_user_disabled, IMG_REQUIRED); + LOADPNG(menu_selection, IMG_REQUIRED); + + LOADPNG(progress_bar, IMG_REQUIRED); + LOADPNG(progress_bar_background, IMG_REQUIRED); + + LOADPNG(text_scroll_prev, IMG_REQUIRED); + LOADPNG(text_scroll_next, IMG_REQUIRED); + + LOADPNG(font_console, IMG_REQUIRED); + LOADPNG(font_small, IMG_REQUIRED); + + initFont( &font_console, &images[iFontConsole]); + initFont( &font_small, &images[iFontSmall]); + + return 0; +} + +static int unloadGraphics(void) +{ + int i; + + destroyFont(&font_console); + destroyFont(&font_small); + for (i = 0; i < sizeof(images) / sizeof(images[0]); i++) + { + if (images[i].image) + { + if (images[i].image->pixels) free(images[i].image->pixels); + free (images[i].image); + images[i].image = 0; + } + } + return 0; +} + +int freeBackBuffer( window_t *window ) +{ + if (gui.backbuffer && gui.backbuffer->pixels) + { + free(gui.backbuffer->pixels); + free(gui.backbuffer); + gui.backbuffer = 0; + return 0; + } + + return 1; +} + +pixmap_t *getCroppedPixmapAtPosition( pixmap_t *from, position_t pos, uint16_t width, uint16_t height ) +{ + + pixmap_t *cropped = malloc( sizeof( pixmap_t ) ); + if( !cropped ) + return 0; + cropped->pixels = malloc( width * height * 4 ); + if ( !cropped->pixels ) + return 0; + + cropped->width = width; + cropped->height = height; + + int destx = 0, desty = 0; + int srcx = pos.x, srcy = pos.y; + + for( ; desty < height; desty++, srcy++) + { + for( destx = 0, srcx = pos.x; destx < width; destx++, srcx++ ) + { + pixel( cropped, destx, desty ).value = pixel( from, srcx, srcy ).value; + } + } + return cropped; +} + +int createBackBuffer( window_t *window ) +{ + gui.backbuffer = malloc(sizeof(pixmap_t)); + if(!gui.backbuffer) + { + return 1; + } + gui.backbuffer->pixels = malloc( window->width * window->height * 4 ); + if(!gui.backbuffer->pixels) + { + free(gui.backbuffer); + gui.backbuffer = 0; + return 1; + } + + gui.backbuffer->width = gui.screen.width; + gui.backbuffer->height = gui.screen.height; + + return 0; +} + +int createWindowBuffer( window_t *window ) +{ + window->pixmap = malloc(sizeof(pixmap_t)); + if(!window->pixmap) + { + return 1; + } + + window->pixmap->pixels = malloc( window->width * window->height * 4 ); + if(!window->pixmap->pixels) + { + free(window->pixmap); + window->pixmap = 0; + return 1; + } + + window->pixmap->width = window->width; + window->pixmap->height = window->height; + + return 0; +} + +int freeWindowBuffer( window_t *window ) +{ + if (window->pixmap && window->pixmap->pixels) + { + free(window->pixmap->pixels); + free(window->pixmap); + return 0; + } + + return 1; +} + +void fillPixmapWithColor(pixmap_t *pm, uint32_t color) +{ + int x,y; + + // fill with given color AARRGGBB + for( x=0; x < pm->width; x++ ) + for( y=0; y< pm->height; y++) + pixel(pm,x,y).value = color; +} + +void drawBackground() +{ + // reset text cursor + gui.screen.cursor.x = gui.screen.hborder; + gui.screen.cursor.y = gui.screen.vborder; + + fillPixmapWithColor( gui.screen.pixmap, gui.screen.bgcolor); + + // draw background.png into background buffer + blend( images[iBackground].image, gui.screen.pixmap, gui.background.pos ); + + // draw logo.png into background buffer + if (gui.logo.draw) + { + blend( images[iLogo].image, gui.screen.pixmap, gui.logo.pos); + } + + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); +} + +void setupDeviceList(config_file_t *theme) +{ + unsigned int pixel; + int alpha; // transparency level 0 (obligue) - 255 (transparent) + uint32_t color; // color value formatted RRGGBB + int val, len; + const char *string; + + if(getIntForKey("devices_max_visible", &val, theme )) + gui.maxdevices = MIN( val, gDeviceCount ); + + if(getIntForKey("devices_iconspacing", &val, theme )) + gui.devicelist.iconspacing = val; + + // check layout for horizontal or vertical + gui.layout = HorizontalLayout; + if(getValueForKey( "devices_layout", &string, &len, theme)) { + if (!strcmp (string, "vertical")) { + gui.layout = VerticalLayout; + } + } + + switch (gui.layout) { + case VerticalLayout: + gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing); + gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing); + + if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) ) + gui.devicelist.pos.x = pixel; + + if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) ) + gui.devicelist.pos.y = pixel; + break; + + case HorizontalLayout: + default: + gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing); + gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing); + + if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) ) + gui.devicelist.pos.x = pixel; + else + gui.devicelist.pos.x = ( gui.screen.width - gui.devicelist.width ) / 2; + + if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , images[iSelection].image->height ) ) + gui.devicelist.pos.y = pixel; + else + gui.devicelist.pos.y = ( gui.screen.height - gui.devicelist.height ) / 2; + break; + } + + if(getColorForKey("devices_bgcolor", &color, theme)) + gui.devicelist.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("devices_transparency", &alpha, theme)) + gui.devicelist.bgcolor = gui.devicelist.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + if (gui.devicelist.pixmap) + { + freeWindowBuffer(&gui.devicelist); + createWindowBuffer(&gui.devicelist); + } +} + +void loadThemeValues(config_file_t *theme) +{ + unsigned int screen_width = gui.screen.width; + unsigned int screen_height = gui.screen.height; + unsigned int pixel; + int alpha; // transparency level 0 (obligue) - 255 (transparent) + uint32_t color; // color value formatted RRGGBB + int val; + + /* + * Parse screen parameters + */ + if(getColorForKey("screen_bgcolor", &color, theme )) + gui.screen.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("screen_textmargin_h", &val, theme)) + gui.screen.hborder = MIN( gui.screen.width , val ); + + if(getIntForKey("screen_textmargin_v", &val, theme)) + gui.screen.vborder = MIN( gui.screen.height , val ); + + /* + * Parse background parameters + */ + if(getDimensionForKey("background_pos_x", &pixel, theme, screen_width , images[iBackground].image->width ) ) + gui.background.pos.x = pixel; + + if(getDimensionForKey("background_pos_y", &pixel, theme, screen_height , images[iBackground].image->height ) ) + gui.background.pos.y = pixel; + + /* + * Parse logo parameters + */ + if(getDimensionForKey("logo_pos_x", &pixel, theme, screen_width , images[iLogo].image->width ) ) + gui.logo.pos.x = pixel; + + if(getDimensionForKey("logo_pos_y", &pixel, theme, screen_height , images[iLogo].image->height ) ) + gui.logo.pos.y = pixel; + + /* + * Parse progress bar parameters + */ + if(getDimensionForKey("progressbar_pos_x", &pixel, theme, screen_width , 0 ) ) + gui.progressbar.pos.x = pixel; + + if(getDimensionForKey("progressbar_pos_y", &pixel, theme, screen_height , 0 ) ) + gui.progressbar.pos.y = pixel; + + /* + * Parse countdown text parameters + */ + if(getDimensionForKey("countdown_pos_x", &pixel, theme, screen_width , 0 ) ) + gui.countdown.pos.x = pixel; + + if(getDimensionForKey("countdown_pos_y", &pixel, theme, screen_height , 0 ) ) + gui.countdown.pos.y = pixel; + + /* + * Parse devicelist parameters + */ + setupDeviceList(theme); + + /* + * Parse infobox parameters + */ + if(getIntForKey("infobox_width", &val, theme)) + gui.infobox.width = MIN( screen_width , val ); + + if(getIntForKey("infobox_height", &val, theme)) + gui.infobox.height = MIN( screen_height , val ); + + if(getDimensionForKey("infobox_pos_x", &pixel, theme, screen_width , gui.infobox.width ) ) + gui.infobox.pos.x = pixel; + + if(getDimensionForKey("infobox_pos_y", &pixel, theme, screen_height , gui.infobox.height ) ) + gui.infobox.pos.y = pixel; + + if(getIntForKey("infobox_textmargin_h", &val, theme)) + gui.infobox.hborder = MIN( gui.infobox.width , val ); + + if(getIntForKey("infobox_textmargin_v", &val, theme)) + gui.infobox.vborder = MIN( gui.infobox.height , val ); + + if(getColorForKey("infobox_bgcolor", &color, theme)) + gui.infobox.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("infobox_transparency", &alpha, theme)) + gui.infobox.bgcolor = gui.infobox.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + /* + * Parse menu parameters + */ + if(getDimensionForKey("menu_width", &pixel, theme, gui.screen.width , 0 ) ) + gui.menu.width = pixel; + else + gui.menu.width = images[iMenuSelection].image->width; + + if(getDimensionForKey("menu_height", &pixel, theme, gui.screen.height , 0 ) ) + gui.menu.height = pixel; + else + gui.menu.height = (infoMenuItemsCount) * images[iMenuSelection].image->height; + + if(getDimensionForKey("menu_pos_x", &pixel, theme, screen_width , gui.menu.width ) ) + gui.menu.pos.x = pixel; + + if(getDimensionForKey("menu_pos_y", &pixel, theme, screen_height , gui.menu.height ) ) + gui.menu.pos.y = pixel; + + if(getIntForKey("menu_textmargin_h", &val, theme)) + gui.menu.hborder = MIN( gui.menu.width , val ); + + if(getIntForKey("menu_textmargin_v", &val, theme)) + gui.menu.vborder = MIN( gui.menu.height , val ); + + if(getColorForKey("menu_bgcolor", &color, theme)) + gui.menu.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("menu_transparency", &alpha, theme)) + gui.menu.bgcolor = gui.menu.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + /* + * Parse bootprompt parameters + */ + if(getDimensionForKey("bootprompt_width", &pixel, theme, screen_width , 0 ) ) + gui.bootprompt.width = pixel; + + if(getIntForKey("bootprompt_height", &val, theme)) + gui.bootprompt.height = MIN( screen_height , val ); + + if(getDimensionForKey("bootprompt_pos_x", &pixel, theme, screen_width , gui.bootprompt.width ) ) + gui.bootprompt.pos.x = pixel; + + if(getDimensionForKey("bootprompt_pos_y", &pixel, theme, screen_height , gui.bootprompt.height ) ) + gui.bootprompt.pos.y = pixel; + + if(getIntForKey("bootprompt_textmargin_h", &val, theme)) + gui.bootprompt.hborder = MIN( gui.bootprompt.width , val ); + + if(getIntForKey("bootprompt_textmargin_v", &val, theme)) + gui.bootprompt.vborder = MIN( gui.bootprompt.height , val ); + + if(getColorForKey("bootprompt_bgcolor", &color, theme)) + gui.bootprompt.bgcolor = (color & 0x00FFFFFF); + + if(getIntForKey("bootprompt_transparency", &alpha, theme)) + gui.bootprompt.bgcolor = gui.bootprompt.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24); + + if(getColorForKey("font_small_color", &color, theme)) + gui.screen.font_small_color = (color & 0x00FFFFFF); + + if(getColorForKey("font_console_color", &color, theme)) + gui.screen.font_console_color = (color & 0x00FFFFFF); +} + +int initGUI(void) +{ + int val; + int len; + char dirspec[256]; + + getValueForKey( "Theme", &theme_name, &len, &bootInfo->chameleonConfig ); + if ((strlen(theme_name) + 27) > sizeof(dirspec)) { + return 1; + } + sprintf(dirspec, "/Extra/Themes/%s/theme.plist", theme_name); + if (loadConfigFile(dirspec, &bootInfo->themeConfig) != 0) { +#ifdef CONFIG_EMBED_THEME + config_file_t *config; + + config = &bootInfo->themeConfig; + if (ParseXMLFile((char *)__theme_plist, &config->dictionary) != 0) { + return 1; + } +#else + return 1; +#endif + } + // parse display size parameters + if (getIntForKey("screen_width", &val, &bootInfo->themeConfig) && val > 0) { + screen_params[0] = val; + } + if (getIntForKey("screen_height", &val, &bootInfo->themeConfig) && val > 0) { + screen_params[1] = val; + } + + // Initalizing GUI strucutre. + bzero(&gui, sizeof(gui_t)); + + // find best matching vesa mode for our requested width & height + getGraphicModeParams(screen_params); + + // set our screen structure with the mode width & height + gui.screen.width = screen_params[0]; + gui.screen.height = screen_params[1]; + + // load graphics otherwise fail and return + if (loadGraphics() == 0) { + loadThemeValues(&bootInfo->themeConfig); + colorFont(&font_small, gui.screen.font_small_color); + colorFont(&font_console, gui.screen.font_console_color); + + // create the screen & window buffers + if (createBackBuffer(&gui.screen) == 0) { + if (createWindowBuffer(&gui.screen) == 0) { + if (createWindowBuffer(&gui.devicelist) == 0) { + if (createWindowBuffer(&gui.bootprompt) == 0) { + if (createWindowBuffer(&gui.infobox) == 0) { + if (createWindowBuffer(&gui.menu) == 0) { + gui.logo.draw = true; + drawBackground(); + // lets copy the screen into the back buffer + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + setVideoMode( GRAPHICS_MODE, 0 ); + gui.initialised = true; + return 0; + } + } + } + } + } + } + } + + // not available memory, freeing resources + freeWindowBuffer(&gui.menu); + freeWindowBuffer(&gui.infobox); + freeWindowBuffer(&gui.bootprompt); + freeWindowBuffer(&gui.devicelist); + freeWindowBuffer(&gui.screen); + freeBackBuffer(&gui.screen); + unloadGraphics(); + + return 1; +} + +bool is_image_loaded(int i) +{ + return (images[i].image != NULL) ? true : false; +} + +void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected) +{ + int devicetype; + + if( diskIsCDROM(device) ) + devicetype = iDeviceCDROM; // Use CDROM icon + else + { + switch (device->part_type) + { + case kPartitionTypeHFS: + { + // Use HFS or HFSRAID icon depending on bvr flags. Fallbacks are handled by alt_image above. + switch (device->OSVersion[3]) { + case '9': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_mav : iDeviceHFS_mav); + break; + case '8': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_ML : iDeviceHFS_ML); + break; + case '7': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_Lion : iDeviceHFS_Lion); + break; + case '6': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_SL : iDeviceHFS_SL); + break; + case '5': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_Leo : iDeviceHFS_Leo); + break; + case '4': + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID_Tiger : iDeviceHFS_Tiger); + break; + default: + devicetype = (device->flags & kBVFlagBooter ? iDeviceHFSRAID : iDeviceHFS); + break; + } + + break; + + } + case kPartitionTypeHPFS: + devicetype = iDeviceNTFS; // Use HPFS / NTFS icon + break; + + case kPartitionTypeFAT16: + devicetype = iDeviceFAT16; // Use FAT16 icon + break; + + case kPartitionTypeFAT32: + devicetype = iDeviceFAT32; // Use FAT32 icon + break; + + case kPartitionTypeEXT3: + devicetype = iDeviceEXT3; // Use EXT2/3 icon + break; + + case kPartitionTypeFreeBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + devicetype = iDeviceFreeBSD; // Use FreeBSD icon + break; + + case kPartitionTypeOpenBSD: /* FreeBSD/OpenBSD detection,nawcom's code by valv, Icon credits to blackosx */ + devicetype = iDeviceOpenBSD; // Use OpenBSD icon + break; + + case kPartitionTypeBEFS: /* Haiku detection and Icon credits to scorpius */ + devicetype = iDeviceBEFS; // Use BEFS / Haiku icon + break; + + default: + devicetype = iDeviceGeneric; // Use Generic icon + break; + } + } + + // Draw the selection image and use the next (device_*_o) image for the selected item. + if (isSelected) + { + blend(images[iSelection].image, buffer, centeredAt(images[iSelection].image, p)); + devicetype++; // select override image + } + + // draw icon + blend(images[devicetype].image, buffer, centeredAt(images[devicetype].image, p)); + + p.y += (images[iSelection].image->height / 2) + font_console.chars[0]->height; + + // draw volume label + drawStrCenteredAt( device->label, &font_small, buffer, p); + +} + +void drawDeviceList (int start, int end, int selection) +{ + int i; + bool shoWinfo = false; + extern bool showBootBanner; + position_t p, p_prev, p_next; + + //uint8_t maxDevices = MIN( gui.maxdevices, menucount ); + + fillPixmapWithColor( gui.devicelist.pixmap, gui.devicelist.bgcolor); + + makeRoundedCorners( gui.devicelist.pixmap); + + switch (gui.layout) + { + + case VerticalLayout: + p.x = (gui.devicelist.width /2); + p.y = ( ( images[iSelection].image->height / 2 ) + images[iDeviceScrollPrev].image->height + gui.devicelist.iconspacing ); + + // place scroll indicators at top & bottom edges + p_prev = pos ( gui.devicelist.width / 2 , gui.devicelist.iconspacing ); + p_next = pos ( p_prev.x, gui.devicelist.height - gui.devicelist.iconspacing ); + + break; + + default: // use Horizontal layout as the default + + case HorizontalLayout: + p.x = (gui.devicelist.width - ( gui.devicelist.width / gui.maxdevices ) * gui.maxdevices ) / 2 + ( images[iSelection].image->width / 2) + images[iDeviceScrollPrev].image->width + gui.devicelist.iconspacing; + p.y = ((gui.devicelist.height - font_console.chars[0]->height ) - images[iSelection].image->height) / 2 + ( images[iSelection].image->height / 2 ); + + // place scroll indicators at left & right edges + p_prev = pos ( images[iDeviceScrollPrev].image->width / 2 + gui.devicelist.iconspacing / 2, gui.devicelist.height / 2 ); + p_next = pos ( gui.devicelist.width - ( images[iDeviceScrollNext].image->width / 2 + gui.devicelist.iconspacing / 2), gui.devicelist.height / 2 ); + + break; + + } + + // draw visible device icons + for (i = 0; i < gui.maxdevices; i++) + { + BVRef param = menuItems[start + i].param; + + bool isSelected = ((start + i) == selection) ? true : false; + if (isSelected) + { + if (param->flags & kBVFlagNativeBoot) + { + infoMenuNativeBoot = true; + } + else + { + infoMenuNativeBoot = false; + if(infoMenuSelection >= INFOMENU_NATIVEBOOT_START && infoMenuSelection <= INFOMENU_NATIVEBOOT_END) + infoMenuSelection = 0; + } + + if (gui.menu.draw) + drawInfoMenuItems(); + + getBoolForKey(kShowInfoKey, &shoWinfo, &bootInfo->chameleonConfig); + + if (shoWinfo && showBootBanner) + { + gui.debug.cursor = pos( 10, 100); + dprintf( &gui.screen, "label: %s\n", param->label ); + dprintf( &gui.screen, "biosdev: 0x%x\n", param->biosdev ); + dprintf( &gui.screen, "type: 0x%x\n", param->type ); + dprintf( &gui.screen, "flags: 0x%x\n", param->flags ); + dprintf( &gui.screen, "part_no: %d\n", param->part_no ); + dprintf( &gui.screen, "part_boff: 0x%x\n", param->part_boff ); + dprintf( &gui.screen, "part_type: 0x%x\n", param->part_type ); + dprintf( &gui.screen, "bps: 0x%x\n", param->bps ); + dprintf( &gui.screen, "name: %s\n", param->name ); + dprintf( &gui.screen, "type_name: %s\n", param->type_name ); + dprintf( &gui.screen, "modtime: %d\n", param->modTime ); +// // res + dprintf( &gui.screen, "width: %d\n", gui.screen.width ); + dprintf( &gui.screen, "height: %d\n", gui.screen.height ); +// dprintf( &gui.screen, "attr: 0x%x\n", gui.screen.attr ); //Azi: reminder +// dprintf( &gui.screen, "mm: %d\n", gui.screen.mm ); + } + } + + drawDeviceIcon( param, gui.devicelist.pixmap, p, isSelected); + + if (gui.layout == HorizontalLayout) + { + p.x += images[iSelection].image->width + gui.devicelist.iconspacing; + } + if (gui.layout == VerticalLayout) + { + p.y += ( images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing ); + } + } + + // draw prev indicator + if (start) + blend( images[iDeviceScrollPrev].image, gui.devicelist.pixmap, centeredAt( images[iDeviceScrollPrev].image, p_prev ) ); + + // draw next indicator + if ( end < gDeviceCount - 1 ) + blend( images[iDeviceScrollNext].image, gui.devicelist.pixmap, centeredAt( images[iDeviceScrollNext].image, p_next ) ); + + gui.redraw = true; + + updateVRAM(); + +} + +void clearGraphicBootPrompt() +{ + // clear text buffer + //prompt[0] = '\0'; + //prompt_pos=0; + + + if( gui.bootprompt.draw == true ) + { + gui.bootprompt.draw = false; + gui.redraw = true; + // this causes extra frames to be drawn + //updateVRAM(); + } + + return; +} + +void updateGraphicBootPrompt() +{ + fillPixmapWithColor( gui.bootprompt.pixmap, gui.bootprompt.bgcolor); + + makeRoundedCorners( gui.bootprompt.pixmap); + + position_t p_text = pos( gui.bootprompt.hborder , ( ( gui.bootprompt.height - font_console.chars[0]->height) ) / 2 ); + + // print the boot prompt text + drawStr(prompt_text, &font_console, gui.bootprompt.pixmap, p_text); + + // get the position of the end of the boot prompt text to display user input + position_t p_prompt = pos( p_text.x + ( ( strlen(prompt_text) ) * font_console.chars[0]->width ), p_text.y ); + + drawStr( gBootArgs, &font_console, gui.bootprompt.pixmap, p_prompt); + + gui.menu.draw = false; + gui.bootprompt.draw = true; + gui.redraw = true; + + updateVRAM(); + + return; +} + +static inline +void vramwrite (void *data, int width, int height) +{ + if (VIDEO (depth) == 32 && VIDEO (rowBytes) == gui.backbuffer->width * 4) + memcpy((uint8_t *)vram, gui.backbuffer->pixels, VIDEO (rowBytes)*VIDEO (height)); + else + { + uint32_t r, g, b; + int i, j; + for (i = 0; i < VIDEO (height); i++) + for (j = 0; j < VIDEO (width); j++) + { + b = ((uint8_t *) data)[4*i*width + 4*j]; + g = ((uint8_t *) data)[4*i*width + 4*j + 1]; + r = ((uint8_t *) data)[4*i*width + 4*j + 2]; + switch (VIDEO (depth)) + { + case 32: + *(uint32_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*4) = (b&0xff) | ((g&0xff)<<8) | ((r&0xff)<<16); + break; + case 24: + *(uint32_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*3) = ((*(uint32_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*3))&0xff000000) + | (b&0xff) | ((g&0xff)<<8) | ((r&0xff)<<16); + break; + case 16: + // Somehow 16-bit is always 15-bits really + // *(uint16_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*2) = ((b&0xf8)>>3) | ((g&0xfc)<<3) | ((r&0xf8)<<8); + // break; + case 15: + *(uint16_t *)(((uint8_t *)vram)+i*VIDEO (rowBytes) + j*2) = ((b&0xf8)>>3) | ((g&0xf8)<<2) | ((r&0xf8)<<7); + break; + } + } + } +} + +void updateVRAM() +{ + if (gui.redraw) + { + if (gui.devicelist.draw) + blend( gui.devicelist.pixmap, gui.backbuffer, gui.devicelist.pos ); + + if (gui.bootprompt.draw) + blend( gui.bootprompt.pixmap, gui.backbuffer, gui.bootprompt.pos ); + + if (gui.menu.draw) + blend( gui.menu.pixmap, gui.backbuffer, gui.menu.pos ); + + if (gui.infobox.draw) + blend( gui.infobox.pixmap, gui.backbuffer, gui.infobox.pos ); + } + + vramwrite ( gui.backbuffer->pixels, gui.backbuffer->width, gui.backbuffer->height ); + + if (gui.redraw) + { + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + gui.redraw = false; + } +} + +struct putc_info //Azi: exists on console.c & printf.c +{ + char * str; + char * last_str; +}; + +static int +sputc(int c, struct putc_info * pi) //Azi: same as above +{ + if (pi->last_str) + if (pi->str == pi->last_str) { + *(pi->str) = '\0'; + return 0; + } + *(pi->str)++ = c; + return c; +} + +int gprintf( window_t * window, const char * fmt, ...) +{ + char *formattedtext; + + va_list ap; + + struct putc_info pi; + + if ((formattedtext = malloc(1024)) != NULL) { + // format the text + va_start(ap, fmt); + pi.str = formattedtext; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + va_end(ap); + + position_t origin, cursor, bounds; + + int i; + int character; + + origin.x = MAX( window->cursor.x, window->hborder ); + origin.y = MAX( window->cursor.y, window->vborder ); + + bounds.x = ( window->width - window->hborder ); + bounds.y = ( window->height - window->vborder ); + + cursor = origin; + + font_t *font = &font_console; + + for( i=0; i< strlen(formattedtext); i++ ) + { + character = formattedtext[i]; + + character -= 32; + + // newline ? + if( formattedtext[i] == '\n' ) + { + cursor.x = window->hborder; + cursor.y += font->height; + + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + + continue; + } + + // tab ? + if( formattedtext[i] == '\t' ) + cursor.x += ( font->chars[0]->width * 5 ); + + // draw the character + if( font->chars[character]) + blend(font->chars[character], window->pixmap, cursor); + + cursor.x += font->chars[character]->width; + + // check x pos and do newline + if ( cursor.x > bounds.x ) + { + cursor.x = origin.x; + cursor.y += font->height; + } + + // check y pos and reset to origin.y + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + } + + // update cursor postition + window->cursor = cursor; + + free(formattedtext); + + return 0; + + } + return 1; +} + +int dprintf( window_t * window, const char * fmt, ...) +{ + char *formattedtext; + + va_list ap; + + //window = &gui.debug; + + struct putc_info pi; + + if ((formattedtext = malloc(1024)) != NULL) { + // format the text + va_start(ap, fmt); + pi.str = formattedtext; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + va_end(ap); + + position_t origin, cursor, bounds; + + int i; + int character; + + origin.x = MAX( gui.debug.cursor.x, window->hborder ); + origin.y = MAX( gui.debug.cursor.y, window->vborder ); + + bounds.x = ( window->width - window->hborder ); + bounds.y = ( window->height - window->vborder ); + + cursor = origin; + + font_t *font = &font_console; + + for( i=0; i< strlen(formattedtext); i++ ) + { + character = formattedtext[i]; + + character -= 32; + + // newline ? + if( formattedtext[i] == '\n' ) + { + cursor.x = window->hborder; + cursor.y += font->height; + + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + + continue; + } + + // tab ? + if( formattedtext[i] == '\t' ) + cursor.x += ( font->chars[0]->width * 5 ); + + // draw the character + if( font->chars[character]) + blend(font->chars[character], gui.backbuffer, cursor); + + cursor.x += font->chars[character]->width; + + // check x pos and do newline + if ( cursor.x > bounds.x ) + { + cursor.x = origin.x; + cursor.y += font->height; + } + + // check y pos and reset to origin.y + if ( cursor.y > bounds.y ) + cursor.y = origin.y; + } + + // update cursor postition + gui.debug.cursor = cursor; + + free(formattedtext); + + return 0; + + } + return 1; +} + +int vprf(const char * fmt, va_list ap) +{ + int i; + int character; + + char *formattedtext; + window_t *window = &gui.screen; + struct putc_info pi; + + position_t origin, cursor, bounds; + font_t *font = &font_console; + + if ((formattedtext = malloc(1024)) != NULL) { + // format the text + pi.str = formattedtext; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + + origin.x = MAX( window->cursor.x, window->hborder ); + origin.y = MAX( window->cursor.y, window->vborder ); + bounds.x = ( window->width - ( window->hborder * 2 ) ); + bounds.y = ( window->height - ( window->vborder * 2 ) ); + cursor = origin; + + for( i=0; i< strlen(formattedtext); i++ ) + { + character = formattedtext[i]; + character -= 32; + + // newline ? + if( formattedtext[i] == '\n' ) + { + cursor.x = window->hborder; + cursor.y += font->height; + if ( cursor.y > bounds.y ) + { + gui.redraw = true; + updateVRAM(); + cursor.y = window->vborder; + } + window->cursor.y = cursor.y; + continue; + } + + // tab ? + if( formattedtext[i] == '\t' ) + { + cursor.x = ( cursor.x / ( font->chars[0]->width * 8 ) + 1 ) * ( font->chars[0]->width * 8 ); + continue; + } + cursor.x += font->chars[character]->width; + + // check x pos and do newline + if ( cursor.x > bounds.x ) + { + cursor.x = origin.x; + cursor.y += font->height; + } + + // check y pos and reset to origin.y + if ( cursor.y > ( bounds.y + font->chars[0]->height) ) + { + gui.redraw = true; + updateVRAM(); + cursor.y = window->vborder; + } + // draw the character + if( font->chars[character]) + blend(font->chars[character], gui.backbuffer, cursor); + } + // save cursor postition + window->cursor.x = cursor.x; + updateVRAM(); + free(formattedtext); + return 0; + } + return 1; +} + +pixmap_t* charToPixmap(unsigned char ch, font_t *font) { + unsigned int cha = (unsigned int)ch - 32; + if (cha >= font->count) + // return ? if the font for the char doesn't exists + cha = '?' - 32; + + return font->chars[cha] ? font->chars[cha] : NULL; +} + +position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p) { + pixmap_t* pm = charToPixmap(ch, font); + if (pm && ((p.x + pm->width) < blendInto->width)) + { + blend(pm, blendInto, p); + return pos(p.x + pm->width, p.y); + } + else + return p; +} + +void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p) +{ + int i=0; + position_t current_pos = pos(p.x, p.y); + + for (i=0; i < strlen(ch); i++) + { + // newline ? + if ( ch[i] == '\n' ) + { + current_pos.x = p.x; + current_pos.y += font->height; + continue; + } + + // tab ? + if ( ch[i] == '\t' ) + { + current_pos.x += TAB_PIXELS_WIDTH; + continue; + } + + current_pos = drawChar(ch[i], font, blendInto, current_pos); + } +} + +void drawStrCenteredAt(char *text, font_t *font, pixmap_t *blendInto, position_t p) +{ + int i = 0; + int width = 0; + int max_width = 0; + int height = font->height; + + // calculate the width in pixels + for (i=0; i < strlen(text); i++) { + if (text[i] == '\n') + { + width = 0; + height += font->height; + } + else if (text[i] == '\t') + width += TAB_PIXELS_WIDTH; + else + { + pixmap_t* pm = charToPixmap(text[i], font); + if (pm) + width += pm->width; + } + if (width > max_width) + max_width = width; + } + + p.x = ( p.x - ( max_width / 2 ) ); + p.y = ( p.y - ( height / 2 ) ); + + drawStr(text, font, blendInto, p); +} + +int destroyFont(font_t *font) +{ + int i; + for (i = 0; i < CHARACTERS_COUNT; i++) + { + if (font->chars[i]) + { + if (font->chars[i]->pixels) free (font->chars[i]->pixels); + free (font->chars[i]); + font->chars[i] = 0; + } + } + return 0; +} + +int initFont(font_t *font, image_t *data) +{ + unsigned int x = 0, y = 0, x2 = 0, x3 = 0; + + int start = 0, end = 0, count = 0, space = 0; + + bool monospaced = false; + + font->height = data->image->height; + + for( x = 0; x < data->image->width && count < CHARACTERS_COUNT; x++) + { + start = end; + + // if the pixel is red we've reached the end of the char + if( pixel( data->image, x, 0 ).value == 0xFFFF0000) + { + end = x + 1; + + if( (font->chars[count] = malloc(sizeof(pixmap_t)) ) ) + { + font->chars[count]->width = ( end - start) - 1; + font->chars[count]->height = font->height; + + if ( ( font->chars[count]->pixels = malloc( font->chars[count]->width * data->image->height * 4) ) ) + { + space += ( font->chars[count]->width * data->image->height * 4 ); + // we skip the first line because there are just the red pixels for the char width + for( y = 1; y< (font->height); y++) + { + for( x2 = start, x3 = 0; x2 < end; x2++, x3++) + { + pixel( font->chars[count], x3, y ) = pixel( data->image, x2, y ); + } + } + + // check if font is monospaced + if( ( count > 0 ) && ( font->width != font->chars[count]->width ) ) + monospaced = true; + + font->width = font->chars[count]->width; + + count++; + } + } + } + } + + for (x = count; x < CHARACTERS_COUNT; x++) + font->chars[x] = NULL; + + if(monospaced) + font->width = 0; + + font->count = count; + + return 0; +} + +void colorFont(font_t *font, uint32_t color) +{ + if( !color ) + return; + + int x, y, width, height; + int count = 0; + pixel_t *buff; + + while( font->chars[count++] ) + { + width = font->chars[count-1]->width; + height = font->chars[count-1]->height; + for( y = 0; y < height; y++ ) + { + for( x = 0; x < width; x++ ) + { + buff = &(pixel( font->chars[count-1], x, y )); + if( buff->ch.a ) + { + buff->ch.r = (color & 0xFFFF0000) >> 16; + buff->ch.g = (color & 0xFF00FF00) >> 8; + buff->ch.b = (color & 0xFF0000FF); + } + } + } + } +} + +void makeRoundedCorners(pixmap_t *p) +{ + int x,y; + int width=p->width-1; + int height=p->height-1; + + // 10px rounded corner alpha values + uint8_t roundedCorner[10][10] = + { + { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0xC0, 0xFF}, + { 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0x00, 0x00, 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0x00, 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x00, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x40, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, + { 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} + }; + + uint8_t alpha=0; + + for( y=0; y<10; y++) + { + for( x=0; x<10; x++) + { + // skip if the pixel should be visible + if(roundedCorner[y][x] != 0xFF) + { + alpha = ( roundedCorner[y][x] ? (uint8_t) (roundedCorner[y][x] * pixel(p, x, y).ch.a) / 255 : 0 ); + // Upper left corner + pixel(p, x, y).ch.a = alpha; + + // upper right corner + pixel(p, width-x,y).ch.a = alpha; + + // lower left corner + pixel(p, x, height-y).ch.a = alpha; + + // lower right corner + pixel(p, width-x, height-y).ch.a = alpha; + } + } + } +} + +void showInfoBox(char *title, char *text_orig) +{ + char* text; + int i, key, lines, visiblelines; + + int currentline=0; + int cnt=0; + int offset=0; + + if( !title || !text_orig ) + return; + + // Create a copy so that we don't mangle the original + text = malloc(strlen(text_orig) + 1); + strcpy(text, text_orig); + + + position_t pos_title = pos ( gui.infobox.vborder, gui.infobox.vborder ); + + // calculate number of lines in the title + for ( i = 0, lines = 1; iwidth - ( gui.infobox.vborder / 2) ), pos_text.y ); + + // draw prev indicator + if(offset) + { + blend( images[iTextScrollPrev].image, gui.infobox.pixmap, centeredAt( images[iTextScrollPrev].image, pos_indicator )); + } + + // draw next indicator + if( lines > ( currentline + visiblelines ) ) + { + pos_indicator.y = ( gui.infobox.height - ( ( images[iTextScrollNext].image->width + gui.infobox.vborder ) / 2 ) ); + blend( images[iTextScrollNext].image, gui.infobox.pixmap, centeredAt( images[iTextScrollNext].image, pos_indicator ) ); + } + + gui.bootprompt.draw = false; + gui.infobox.draw = true; + gui.redraw = true; + + updateVRAM(); + + key = getchar(); + + if( key == KEY_UP ) + if( currentline > 0 ) + currentline--; + + if( key == KEY_DOWN ) + if( lines > ( currentline + visiblelines ) ) + currentline++; + + if( key == KEY_ESC || key == 'q' || key == 'Q') + { + gui.infobox.draw = false; + gui.redraw = true; + updateVRAM(); + break; + } + + if(key == ' ') // spacebar = next page + { + if( lines > ( currentline + visiblelines ) ) + currentline += visiblelines; + + if(lines < (currentline + visiblelines)) + currentline = lines - visiblelines; + } + } +} + +void animateProgressBar() +{ + int y; + + if( time18() > lasttime) + { + lasttime = time18(); + + pixmap_t *buffBar = images[iProgressBar].image; + + uint32_t buff = buffBar->pixels[0].value; + + memcpy( buffBar->pixels, buffBar->pixels + 1, ( (buffBar->width*buffBar->height) - 1 ) * 4 ); + + for( y = buffBar->height - 1; y > 0; y--) + pixel(buffBar, buffBar->width - 1, y) = pixel(buffBar, buffBar->width - 1, y - 1); + + pixel(buffBar, buffBar->width-1, 0).value = buff; + } +} + +void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress) +{ + if(progress>100) + return; + + p.x = ( p.x - ( width / 2 ) ); + + int todraw = (width * progress) / 100; + + pixmap_t *buff = images[iProgressBar].image; + pixmap_t *buffBG = images[iProgressBarBackground].image; + if(!buff || !buffBG) + return; + + pixmap_t progressbar; + progressbar.pixels=malloc(width * 4 * buff->height); + if(!progressbar.pixels) + return; + + progressbar.width = width; + progressbar.height = buff->height; + + int x=0,x2=0,y=0; + + for(y=0; yheight; y++) + { + for(x=0; xwidth-1)) x2=0; + pixel(&progressbar, x,y).value = pixel(buff, x2,y).value; + } + x2=0; + } + + for(y=0; yheight; y++) + { + for(x=todraw, x2 = 0; x < width - 1; x++, x2++) + { + if(x2 == (buffBG->width -2 )) x2 = 0; + pixel(&progressbar, x,y).value = pixel(buffBG, x2,y).value; + } + if(progress < 100) + pixel(&progressbar, width - 1, y).value = pixel(buffBG, buffBG->width - 1, y).value; + if(progress == 0) + pixel(&progressbar, 0, y).value = pixel(buffBG, buffBG->width - 1, y).value; + x2=0; + } + + blend(&progressbar, blendInto, p); + animateProgressBar(); + free(progressbar.pixels); +} + +void drawInfoMenuItems() +{ + int i,n; + + position_t position; + + pixmap_t *selection = images[iMenuSelection].image; + + pixmap_t *pbuff; + + fillPixmapWithColor(gui.menu.pixmap, gui.menu.bgcolor); + + makeRoundedCorners(gui.menu.pixmap); + + uint8_t offset = infoMenuNativeBoot ? 0 : infoMenuItemsCount - 1; + + position = pos(0,0); + + for ( i = 0, n = iMenuBoot; i < infoMenuItemsCount; i++, n++) + { + if (i == infoMenuSelection) + { + blend(selection, gui.menu.pixmap, position); + } + + pbuff = images[n].image; + if (offset && i >= INFOMENU_NATIVEBOOT_START && i <= INFOMENU_NATIVEBOOT_END) + { + blend( images[n + (iMenuHelp - iMenuBoot)].image , gui.menu.pixmap, + pos((position.x + (gui.menu.hborder / 2)), position.y + ((selection->height - pbuff->height) / 2))); + } + else + { + blend( pbuff, gui.menu.pixmap, + pos((position.x + (gui.menu.hborder / 2)), position.y + ((selection->height - pbuff->height) / 2))); + } + + drawStr(infoMenuItems[i].text, &font_console, gui.menu.pixmap, + pos(position.x + (pbuff->width + gui.menu.hborder), + position.y + ((selection->height - font_console.height) / 2))); + position.y += images[iMenuSelection].image->height; + + } + + gui.redraw = true; +} + +int drawInfoMenu() +{ + drawInfoMenuItems(); + + gui.menu.draw = true; + + updateVRAM(); + + return 1; +} + +int updateInfoMenu(int key) +{ + switch (key) + { + + case KEY_UP: // up arrow + if (infoMenuSelection > 0) + { + if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_END + 1) + { + infoMenuSelection -= 4; + } + else + { + infoMenuSelection--; + } + drawInfoMenuItems(); + updateVRAM(); + + } + else + { + + gui.menu.draw = false; + gui.redraw = true; + + updateVRAM(); + + return CLOSE_INFO_MENU; + } + break; + + case KEY_DOWN: // down arrow + if (infoMenuSelection < infoMenuItemsCount - 1) + { + if(!infoMenuNativeBoot && infoMenuSelection == INFOMENU_NATIVEBOOT_START - 1) + infoMenuSelection += 4; + else + infoMenuSelection++; + drawInfoMenuItems(); + updateVRAM(); + } + break; + + case KEY_ENTER: + key = 0; + if( infoMenuSelection == MENU_SHOW_MEMORY_INFO ) + showInfoBox( "Memory Info. Press q to quit.\n", getMemoryInfoString()); + + else if( infoMenuSelection == MENU_SHOW_VIDEO_INFO ) + showInfoBox( getVBEInfoString(), getVBEModeInfoString() ); + + else if( infoMenuSelection == MENU_SHOW_HELP ) + showHelp(); + + else + { + int buff = infoMenuSelection; + infoMenuSelection = 0; + return buff; + } + break; + } + return DO_NOT_BOOT; +} + +uint16_t bootImageWidth = 0; +uint16_t bootImageHeight = 0; +uint8_t *bootImageData = NULL; +static bool usePngImage = true; + +//========================================================================== +// loadBootGraphics +static void loadBootGraphics(void) +{ + if (bootImageData != NULL) { + return; + } + + char dirspec[256]; + + if ((strlen(theme_name) + 24) > sizeof(dirspec)) { + usePngImage = false; + return; + } + sprintf(dirspec, "/Extra/Themes/%s/boot.png", theme_name); + if (loadPngImage(dirspec, &bootImageWidth, &bootImageHeight, &bootImageData) != 0) { +#ifdef CONFIG_EMBED_THEME + if ((loadEmbeddedPngImage(__boot_png, __boot_png_len, &bootImageWidth, &bootImageHeight, &bootImageData)) != 0) +#endif + usePngImage = false; + } +} + +//========================================================================== +// drawBootGraphics +void drawBootGraphics(void) +{ + int pos; + int length; + const char *dummyVal; + int oldScreenWidth, oldScreenHeight; + bool legacy_logo; + uint16_t x, y; + + if (getBoolForKey("Legacy Logo", &legacy_logo, &bootInfo->chameleonConfig) && legacy_logo) { + usePngImage = false; + } else if (bootImageData == NULL) { + loadBootGraphics(); + } + + // parse screen size parameters + if (getIntForKey("boot_width", &pos, &bootInfo->themeConfig) && pos > 0) { + screen_params[0] = pos; + } else { + screen_params[0] = DEFAULT_SCREEN_WIDTH; + } + if (getIntForKey("boot_height", &pos, &bootInfo->themeConfig) && pos > 0) { + screen_params[1] = pos; + } else { + screen_params[1] = DEFAULT_SCREEN_HEIGHT; + } + + // Save current screen resolution. + oldScreenWidth = gui.screen.width; + oldScreenHeight = gui.screen.height; + + gui.screen.width = screen_params[0]; + gui.screen.height = screen_params[1]; + + // find best matching vesa mode for our requested width & height + getGraphicModeParams(screen_params); + + // Set graphics mode if the booter was in text mode or the screen resolution has changed. + if (bootArgs->Video.v_display == VGA_TEXT_MODE + || (screen_params[0] != oldScreenWidth && screen_params[1] != oldScreenHeight) ) + { + setVideoMode(GRAPHICS_MODE, 0); + } + + if (getValueForKey("-checkers", &dummyVal, &length, &bootInfo->chameleonConfig)) { + drawCheckerBoard(); + } else { + // Fill the background to 75% grey (same as BootX). + drawColorRectangle(0, 0, screen_params[0], screen_params[1], 0x01); + } + if ((bootImageData) && (usePngImage)) { + x = (screen_params[0] - MIN(bootImageWidth, screen_params[0])) / 2; + y = (screen_params[1] - MIN(bootImageHeight, screen_params[1])) / 2; + + // Draw the image in the center of the display. + blendImage(x, y, bootImageWidth, bootImageHeight, bootImageData); + } else { + uint8_t *appleBootPict; + bootImageData = NULL; + bootImageWidth = kAppleBootWidth; + bootImageHeight = kAppleBootHeight; + + // Prepare the data for the default Apple boot image. + appleBootPict = (uint8_t *) decodeRLE(gAppleBootPictRLE, kAppleBootRLEBlocks, bootImageWidth * bootImageHeight); + if (appleBootPict) { + convertImage(bootImageWidth, bootImageHeight, appleBootPict, &bootImageData); + if (bootImageData) { + x = (screen_params[0] - MIN(kAppleBootWidth, screen_params[0])) / 2; + y = (screen_params[1] - MIN(kAppleBootHeight, screen_params[1])) / 2; + drawDataRectangle(x, y, kAppleBootWidth, kAppleBootHeight, bootImageData); + free(bootImageData); + } + free(appleBootPict); + } + } +} diff --git a/i386/boot2/gui.h b/i386/boot2/gui.h new file mode 100644 index 0000000..94e28fe --- /dev/null +++ b/i386/boot2/gui.h @@ -0,0 +1,152 @@ +/* + * gui.h + * + * + * Created by Jasmin Fazlic on 18.12.08. + * Copyright 2008/09 Jasmin Fazlic All rights reserved. + * Copyright 2008/09 iNDi All rights reserved. + * + */ + +#ifndef __BOOT2_GUI_H +#define __BOOT2_GUI_H + +#include "boot.h" +#include "bootstruct.h" +#include "graphics.h" +#include "graphic_utils.h" +#include "picopng.h" + +#define CHARACTERS_COUNT 223 + +#define BOOT_NORMAL 0 +#define BOOT_VERBOSE 1 +#define BOOT_IGNORECACHE 2 +#define BOOT_SINGLEUSER 3 +#define DO_NOT_BOOT 4 +#define CLOSE_INFO_MENU 5 + +#define INFOMENU_NATIVEBOOT_START 1 +#define INFOMENU_NATIVEBOOT_END 3 + +#define MENU_SHOW_MEMORY_INFO 4 +#define MENU_SHOW_VIDEO_INFO 5 +#define MENU_SHOW_HELP 6 + +enum { + HorizontalLayout = 0, + VerticalLayout = 1, +}; + +/* + * Menu item structure. + */ + +typedef struct { + position_t pos; + char *text; + bool enabled; + bool expandable; +} menuitem_t; + +/* + * Image structure. + */ +typedef struct { + pixmap_t *image; + char name[32]; +} image_t; + +/* + * Font structure. + */ +typedef struct { + uint16_t height; // Font Height + uint16_t width; // Font Width for monospace font only + pixmap_t *chars[CHARACTERS_COUNT]; + uint16_t count; // Number of chars in font +} font_t; + +/* + * Window structure. + */ +typedef struct +{ + position_t pos; // X,Y Position of window on screen + pixmap_t *pixmap; // Buffer + uint16_t width; // Width + uint16_t height; // Height + uint16_t hborder; // Horizontal border + uint16_t vborder; // Vertical border + uint16_t iconspacing; // Icon spacing + position_t cursor; // Text Cursor X,Y Position will be multiples of font width & height + uint32_t bgcolor; // Background color AARRGGBB + uint32_t fgcolor; // Foreground color AARRGGBB + uint32_t font_small_color; // Color for small font AARRGGBB + uint32_t font_console_color; // Color for consle font AARRGGBB + bool draw; // Draw flag +} window_t; + +/* + * gui structure + */ +typedef struct +{ + uint8_t maxdevices; // + uint8_t layout; // Horizontal or Vertical layout + + pixmap_t *backbuffer; // Off screen buffer + + window_t screen; // + window_t background; // Position of background graphic within screen + window_t logo; // Logo + window_t bootprompt; // Bootprompt Window + window_t devicelist; // Devicelist Window + window_t infobox; // Infobox Window + window_t menu; // Menu + + window_t progressbar; // Progress bar + window_t countdown; // Countdown text + + window_t debug; // Debug + + bool initialised; // Initialised + bool redraw; // Redraw flag +} gui_t; + + +gui_t gui; // gui structure + +font_t font_small; +font_t font_console; + +int initGUI(); +void drawBackground(); + +void setupDeviceList(config_file_t *theme); +bool is_image_loaded(int i); +void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected); +void drawDeviceList(int start, int end, int selection); +void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress); + +void showInfoBox(char *title, char *text); + +int dprintf( window_t * window, const char * fmt, ...); +int gprintf( window_t * window, const char * fmt, ...); +int vprf(const char * fmt, va_list ap); + +int drawInfoMenu(); +int updateInfoMenu(int key); +void drawInfoMenuItems(); + +void showGraphicBootPrompt(); +void clearGraphicBootPrompt(); +void updateGraphicBootPrompt(); + +void updateVRAM(); + +position_t drawChar(unsigned char ch, font_t *font, pixmap_t *blendInto, position_t p); +void drawStr(char *ch, font_t *font, pixmap_t *blendInto, position_t p); +void drawStrCenteredAt(char *ch, font_t *font, pixmap_t *blendInto, position_t p); + +#endif /* !__BOOT2_GUI_H */ diff --git a/i386/boot2/lzss.c b/i386/boot2/lzss.c new file mode 100644 index 0000000..69f08ea --- /dev/null +++ b/i386/boot2/lzss.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/************************************************************** + LZSS.C -- A Data Compression Program +*************************************************************** + 4/6/1989 Haruhiko Okumura + Use, distribute, and modify this program freely. + Please send me your improved versions. + PC-VAN SCIENCE + NIFTY-Serve PAF01022 + CompuServe 74050,1022 + +**************************************************************/ +/* + * lzss.c - Package for decompressing lzss compressed objects + * + * Copyright (c) 2003 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include + +#define N 4096 /* size of ring buffer - must be power of 2 */ +#define F 18 /* upper limit for match_length */ +#define THRESHOLD 2 /* encode string into position and length + if match_length is greater than this */ +#define NIL N /* index for root of binary search trees */ + +int +decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen) +{ + /* ring buffer of size N, with extra F-1 bytes to aid string comparison */ + u_int8_t text_buf[N + F - 1]; + u_int8_t *dststart = dst; + u_int8_t *srcend = src + srclen; + int i, j, k, r, c; + unsigned int flags; + + dst = dststart; + srcend = src + srclen; + for (i = 0; i < N - F; i++) + text_buf[i] = ' '; + r = N - F; + flags = 0; + for ( ; ; ) { + if (((flags >>= 1) & 0x100) == 0) { + if (src < srcend) c = *src++; else break; + flags = c | 0xFF00; /* uses higher byte cleverly */ + } /* to count eight */ + if (flags & 1) { + if (src < srcend) c = *src++; else break; + *dst++ = c; + text_buf[r++] = c; + r &= (N - 1); + } else { + if (src < srcend) i = *src++; else break; + if (src < srcend) j = *src++; else break; + i |= ((j & 0xF0) << 4); + j = (j & 0x0F) + THRESHOLD; + for (k = 0; k <= j; k++) { + c = text_buf[(i + k) & (N - 1)]; + *dst++ = c; + text_buf[r++] = c; + r &= (N - 1); + } + } + } + + return dst - dststart; +} diff --git a/i386/boot2/mboot.c b/i386/boot2/mboot.c new file mode 100644 index 0000000..258096a --- /dev/null +++ b/i386/boot2/mboot.c @@ -0,0 +1,513 @@ +/* + File added by David F. Elliott on 2007/06/26 +*/ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" + +#include "mboot.h" + +int multiboot_timeout=0; +int multiboot_timeout_set=0; +int multiboot_partition=0; +int multiboot_partition_set=0; +int multiboot_skip_partition=0; +int multiboot_skip_partition_set=0; + +// Global multiboot info, if using multiboot. +struct multiboot_info *gMI; + +extern void continue_at_low_address(void); + +// prototype hi_multiboot and keep its implementation below multiboot_to_boot +// to ensure that it doesn't get inlined by the compiler +// We don't want it inlined because we specifically want the stack frame +// pointer to be as high as possible and the hi_multiboot function +// copies multiboot_info onto its stack. +uint32_t hi_multiboot(int multiboot_magic, struct multiboot_info *mi_orig); +// prototype dochainload for the same reason. +void dochainload(); + +#define OFFSET_1MEG 0x100000 +#define BAD_BOOT_DEVICE 0xffffffff + +// This assumes that the address of the first argument to the function will +// be exactly 4 bytes above the address of the return address. +// It is intended to be used as an lvalue with a statement like this -= OFFSET_1MEG; +#define RETURN_ADDRESS_USING_FIRST_ARG(arg) \ + (*(uint32_t*)((char*)&(arg) - 4)) + +#define FIX_RETURN_ADDRESS_USING_FIRST_ARG(arg) \ + RETURN_ADDRESS_USING_FIRST_ARG(arg) -= OFFSET_1MEG + +extern void jump_to_chainbooter(); +extern unsigned char chainbootdev; +extern unsigned char chainbootflag; + +void chainLoad(); +void waitThenReload(); + +int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ); +int multiboot_get_ramdisk_info(int biosdev, struct driveInfo *dip); +static long multiboot_LoadExtraDrivers(FileLoadDrivers_t FileLoadDrivers_p); + +// Starts off in the multiboot context 1 MB high but eventually gets into low memory +// and winds up with a bootdevice in eax which is all that boot() wants +// This lets the stack pointer remain very high. +// If we were to call boot directly from multiboot then the whole multiboot_info +// would be on the stack which would possibly be using way too much stack. +void multiboot_to_boot(int multiboot_magic, struct multiboot_info *mi_orig) +{ + uint32_t bootdevice = hi_multiboot(multiboot_magic, mi_orig); + if(bootdevice != BAD_BOOT_DEVICE) + { + // boot only returns to do a chain load. + for(;;) + { // NOTE: boot only uses the last byte (the drive number) + common_boot(bootdevice); + if(chainbootflag) + chainLoad(); + else + waitThenReload(); + } + } + // Avoid returning to high-memory address which isn't valid in the segment + // we are now in. + // Calling sleep() ensures the user ought to be able to use Ctrl+Alt+Del + // because the BIOS will have interrupts on. + for(;;) + sleep(10); + // NOTE: *IF* we needed to return we'd have to fix up our return address to + // be in low memory using the same trick as below. + // However, there doesn't seem to be any point in returning to assembly + // particularly when the remaining code merely halts the processor. +} + +void chainLoad() +{ + /* TODO: We ought to load the appropriate partition table, for example + the MBR if booting a primary partition or the particular extended + partition table if booting a logical drive. For example, the + regular MS MBR booter will relocate itself (e.g. the MBR) from + 0:7C00 to 0:0600 and will use SI as the offset when reading + the partition data from itself. Thus when it jumps to the partition + boot sector, SI will be 0x600 + 446 + i<<4 where i is the partition + table index. + + On the other hand, our code for the non-Multiboot case doesn't do + this either, although GRUB does. + */ + + const unsigned char *bootcode = (const unsigned char*)0x7c00; + if(bootcode[0x1fe] == 0x55 && bootcode[0x1ff] == 0xaa) + { + printf("Calling chainbooter\n"); + jump_to_chainbooter(); + /* NORETURN */ + } + else + { + printf("Bad chain boot sector magic: %02x%02x\n", bootcode[0x1fe], bootcode[0x1ff]); + } +} + +void waitThenReload() +{ + /* FIXME: Ctrl+Alt+Del does not work under Boot Camp */ + printf("Darwin booter exited for some reason.\n"); + printf("Please reboot (Ctrl+Alt+Del) your machine.\n"); + printf("Restarting Darwin booter in 5 seconds..."); + sleep(1); + printf("4..."); + sleep(1); + printf("3..."); + sleep(1); + printf("2..."); + sleep(1); + printf("1..."); + sleep(1); + printf("0\n"); +} + +// Declare boot2_sym as an opaque struct so it can't be converted to a pointer +// i.e. ensure the idiot programmer (me) makes sure to use address-of +// Technically it's a function but it's real mode code and we sure don't +// want to call it under any circumstances. +extern struct {} boot2_sym asm("boot2"); + +// prototype multiboot and keep its implementation below hi_multiboot to +// ensure that it doesn't get inlined by the compiler +static inline uint32_t multiboot(int multiboot_magic, struct multiboot_info *mi); + + +/*! + Returns a pointer to the first safe address we can use for stowing the multiboot info. + This might actually be a bit pedantic because mboot.c32 and GRUB both stow the multiboot + info in low memory meaning that the >= 128 MB location we choose is plenty high enough. + */ +void *determine_safe_hi_addr(int multiboot_magic, struct multiboot_info *mi_orig) +{ + // hi_addr must be at least up in 128MB+ space so it doesn't get clobbered + void *hi_addr = (void*)PREBOOT_DATA; + + // Fail if the magic isn't correct. We'll complain later. + if(multiboot_magic != MULTIBOOT_INFO_MAGIC) + return NULL; + // Make sure the command-line isn't in high memory. + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) + { + char *end = mi_orig->mi_cmdline; + if(end != NULL) + { + for(; *end != '\0'; ++end) + ; + ++end; + if( (void*)end > hi_addr) + hi_addr = end; + } + } + // Make sure the module information isn't in high memory + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_MODS) + { + struct multiboot_module *modules = (void*)mi_orig->mi_mods_addr; + int i; + for(i=0; i < mi_orig->mi_mods_count; ++i) + { + // make sure the multiboot_module struct itself won't get clobbered + void *modinfo_end = modules+i+1; + if(modinfo_end > hi_addr) + hi_addr = modinfo_end; + // make sure the module itself won't get clobbered + modinfo_end = (void*)modules[i].mm_mod_end; + if(modinfo_end > hi_addr) + hi_addr = modinfo_end; + // make sure the module string doesn't get clobbered + char *end = modules[i].mm_string; + for(; *end != '\0'; ++end) + ; + ++end; + modinfo_end = end; + if(modinfo_end > hi_addr) + hi_addr = modinfo_end; + } + } + // TODO: Copy syms (never needed), mmap, drives, config table, loader name, apm table, VBE info + + // Round up to page size + hi_addr = (void*)(((uint32_t)hi_addr + 0xfff) & ~(uint32_t)0xfff); + return hi_addr; +} + +/*! + Like malloc but with a preceding input/output parameter which points to the next available + location for data. The original value of *hi_addr is returned and *hi_addr is incremented + by size bytes. + */ +void * _hi_malloc(void **hi_addr, size_t size) +{ + void *ret = *hi_addr; + *hi_addr += size; + return ret; +} + +/*! + Like strdup but with a preceding input/output parameter. The original value of *hi_addr is + returned and *hi_addr is incremented by the number of bytes necessary to complete the string + copy including its NUL terminator. + */ +char * _hi_strdup(void **hi_addr, char *src) +{ + char *dstStart; + char *dst = dstStart = *hi_addr; + for(; *src != '\0'; ++src, ++dst, ++(*hi_addr)) + *dst = *src; + *dst = '\0'; + ++(*hi_addr); + return dstStart; +} + +// Convenience macros +#define hi_malloc(size) _hi_malloc(&hi_addr, (size)) +#define hi_strdup(src) _hi_strdup(&hi_addr, (src)) + +/*! + Copies the Multiboot info and any associated data (e.g. various strings and any multiboot modules) + up to very high RAM (above 128 MB) to ensure it doesn't get clobbered by the booter. + */ +struct multiboot_info * copyMultibootInfo(int multiboot_magic, struct multiboot_info *mi_orig) +{ + void *hi_addr = determine_safe_hi_addr(multiboot_magic, mi_orig); + if(hi_addr == NULL) + return NULL; + + struct multiboot_info *mi_copy = hi_malloc(sizeof(*mi_copy)); + memcpy(mi_copy, mi_orig, sizeof(*mi_copy)); + + // Copy the command line + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) + { + mi_copy->mi_cmdline = hi_strdup(mi_orig->mi_cmdline); + } + // Copy the loader name + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_LOADER_NAME) + { + mi_copy->mi_loader_name = hi_strdup(mi_orig->mi_loader_name); + } + // Copy the module info + if(mi_orig->mi_flags & MULTIBOOT_INFO_HAS_MODS) + { + struct multiboot_module *dst_modules = hi_malloc(sizeof(*dst_modules)*mi_orig->mi_mods_count); + struct multiboot_module *src_modules = (void*)mi_orig->mi_mods_addr; + mi_copy->mi_mods_addr = (uint32_t)dst_modules; + + // Copy all of the module info plus the actual module into high memory + int i; + for(i=0; i < mi_orig->mi_mods_count; ++i) + { + // Assume mod_end is 1 past the actual end (i.e. it is start + size, not really end (i.e. start + size - 1)) + // This is what GRUB and mboot.c32 do although the spec is unclear on this. + uint32_t mod_length = src_modules[i].mm_mod_end - src_modules[i].mm_mod_start; + + dst_modules[i].mm_mod_start = (uint32_t)hi_malloc(mod_length); + dst_modules[i].mm_mod_end = (uint32_t)dst_modules[i].mm_mod_start + mod_length; + memcpy((char*)dst_modules[i].mm_mod_start, (char*)src_modules[i].mm_mod_start, mod_length); + + dst_modules[i].mm_string = hi_strdup(src_modules[i].mm_string); + dst_modules[i].mm_reserved = src_modules[i].mm_reserved; + } + } + // Make sure that only stuff that didn't need to be copied or that we did deep copy is indicated in the copied struct. + mi_copy->mi_flags &= MULTIBOOT_INFO_HAS_MEMORY | MULTIBOOT_INFO_HAS_BOOT_DEVICE | MULTIBOOT_INFO_HAS_CMDLINE | MULTIBOOT_INFO_HAS_LOADER_NAME | MULTIBOOT_INFO_HAS_MODS; + + return mi_copy; +} + +// When we enter, we're actually 1 MB high. +// Fortunately, memcpy is position independent, and it's all we need +uint32_t hi_multiboot(int multiboot_magic, struct multiboot_info *mi_orig) +{ + // Copy the multiboot info out of the way. + // We can't bitch about the magic yet because printf won't work + // because it contains an absolute location of putchar which + // contains absolute locations to other things which eventually + // makes a BIOS call from real mode which of course won't work + // because we're stuck in extended memory at this point. + struct multiboot_info *mi_p = copyMultibootInfo(multiboot_magic, mi_orig); + + // Get us in to low memory so we can run everything + + // We cannot possibly be more than 447k and copying extra won't really hurt anything + // We use the address of the assembly entrypoint to get our starting location. + memcpy(&boot2_sym, (char*)&boot2_sym + OFFSET_1MEG, BOOT2_MAX_LENGTH /* 447k */); + + // This is a little assembler routine that returns to us in the correct selector + // instead of the kernel selector we're running in now and at the correct + // instruction pointer ( current minus 1 MB ). It does not fix our return + // address nor does it fix the return address of our caller. + continue_at_low_address(); + + // Now fix our return address. + // JrCs: this macro should be rewritten because the code generated by XCode 4.x + // change the value of the argument passed as parameter (multiboot_magic) + // FIX_RETURN_ADDRESS_USING_FIRST_ARG(multiboot_magic); + + // We can now do just about anything, including return to our caller correctly. + // However, our caller must fix his return address if he wishes to return to + // his caller and so on and so forth. + + /* Zero the BSS and initialize malloc */ + initialize_runtime(); + + gMI = mi_p; + + /* Set up a temporary bootArgs so we can call console output routines + like printf that check the v_display. Note that we purposefully + do not initialize anything else at this early stage. + + We are reasonably sure we're already in text mode if GRUB booted us. + This is the same assumption that initKernBootStruct makes. + We could check the multiboot info I guess, but why bother? + */ + boot_args temporaryBootArgsData; + bzero(&temporaryBootArgsData, sizeof(boot_args)); + bootArgs = &temporaryBootArgsData; + bootArgs->Video.v_display = VGA_TEXT_MODE; + + // Install ramdisk and extra driver hooks + p_get_ramdisk_info = &multiboot_get_ramdisk_info; + p_ramdiskReadBytes = &multibootRamdiskReadBytes; + LoadExtraDrivers_p = &multiboot_LoadExtraDrivers; + + // Since we call multiboot ourselves, its return address will be correct. + // That is unless it's inlined in which case it does not matter. + uint32_t bootdevice = multiboot(multiboot_magic, mi_p); + // We're about to exit and temporaryBootArgs will no longer be valid + bootArgs = NULL; + return bootdevice; +} + +// This is the meat of our implementation. It grabs the boot device from +// the multiboot_info and returns it as is. If it fails it returns +// BAD_BOOT_DEVICE. We can call an awful lot of libsa and libsaio but +// we need to take care not to call anything that requires malloc because +// it won't be initialized until boot() does it. +static inline uint32_t multiboot(int multiboot_magic, struct multiboot_info *mi) +{ + if(multiboot_magic != MULTIBOOT_INFO_MAGIC) + { + printf("Wrong Multiboot magic\n"); + sleep(2); + return BAD_BOOT_DEVICE; + } + printf("Multiboot info @0x%x\n", (uint32_t)mi); + if(mi->mi_flags & MULTIBOOT_INFO_HAS_LOADER_NAME) + printf("Loaded by %s\n", mi->mi_loader_name); + + // Multiboot puts boot device in high byte + // Normal booter wants it in low byte + int bootdevice = mi->mi_boot_device_drive; + + bool doSelectDevice = false; + if(mi->mi_flags & MULTIBOOT_INFO_HAS_BOOT_DEVICE) + { + printf("Boot device 0x%x\n", bootdevice); + } + else + { + printf("Multiboot info does not include chosen boot device\n"); + doSelectDevice = true; + bootdevice = BAD_BOOT_DEVICE; + } + if(mi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) + { + const char *val; + int size; + + if(getValueForBootKey(mi->mi_cmdline, "biosdev", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 16 /* always hex */); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Boot device overridden to %02x with biosdev=%s\n", intVal, val); + bootdevice = intVal; + doSelectDevice = false; + } + else + doSelectDevice = true; + } + + if(getValueForBootKey(mi->mi_cmdline, "timeout", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 0); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Timeout overridden to %d with timeout=%s\n", intVal, val); + multiboot_timeout = intVal; + multiboot_timeout_set = 1; + } + } + + if(getValueForBootKey(mi->mi_cmdline, "partno", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 0); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Default partition overridden to %d with partno=%s\n", intVal, val); + multiboot_partition = intVal; + multiboot_partition_set = 1; + } + } + if(getValueForBootKey(mi->mi_cmdline, "skip_partno", &val, &size)) + { + char *endptr; + int intVal = strtol(val, &endptr, 0); + if(*val != '\0' && (*endptr == '\0' || *endptr == ' ' || *endptr == '\t')) + { + printf("Skipping partition %d with skip_partno=%s\n", intVal, val); + multiboot_skip_partition = intVal; + multiboot_skip_partition_set = 1; + } + } + } + if(doSelectDevice) + { + bootdevice = selectAlternateBootDevice(bootdevice); + } + if(bootdevice == BAD_BOOT_DEVICE) + sleep(2); // pause for a second before halting + return bootdevice; +} + +/////////////////////////////////////////////////////////////////////////// +// Ramdisk and extra drivers code + +int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ) +{ + int module_count = gMI->mi_mods_count; + struct multiboot_module *modules = (void*)gMI->mi_mods_addr; + if(biosdev < 0x100) + return -1; + if(biosdev >= (0x100 + module_count)) + return -1; + struct multiboot_module *module = modules + (biosdev - 0x100); + + void *p_initrd = (void*)module->mm_mod_start; + bcopy(p_initrd + blkno*512 + byteoff, buffer, byteCount); + return 0; +} + +int multiboot_get_ramdisk_info(int biosdev, struct driveInfo *dip) +{ + int module_count = gMI->mi_mods_count; + struct multiboot_module *modules = (void*)gMI->mi_mods_addr; + if(biosdev < 0x100) + return -1; + if(biosdev >= (0x100 + module_count)) + return -1; + struct multiboot_module *module = modules + (biosdev - 0x100); + dip->biosdev = biosdev; + dip->uses_ebios = true; // XXX aserebln uses_ebios isn't a boolean at all + dip->di.params.phys_sectors = (module->mm_mod_end - module->mm_mod_start + 511) / 512; + dip->valid = true; + return 0; +} + +static long multiboot_LoadExtraDrivers(FileLoadDrivers_t FileLoadDrivers_p) +{ + char extensionsSpec[1024]; + int ramdiskUnit; + for(ramdiskUnit = 0; ramdiskUnit < gMI->mi_mods_count; ++ramdiskUnit) + { + int partCount; // unused + BVRef ramdiskChain = diskScanBootVolumes(0x100 + ramdiskUnit, &partCount); + if(ramdiskChain == NULL) + { + verbose("Ramdisk contains no partitions\n"); + continue; + } + for(; ramdiskChain != NULL; ramdiskChain = ramdiskChain->next) + { + sprintf(extensionsSpec, "rd(%d,%d)/Extra/", ramdiskUnit, ramdiskChain->part_no); + struct dirstuff *extradir = opendir(extensionsSpec); + closedir(extradir); + if(extradir != NULL) + { + int ret = FileLoadDrivers_p(extensionsSpec, 0 /* this is a kext root dir, not a kext with plugins */); + if(ret != 0) + { + verbose("FileLoadDrivers failed on a ramdisk\n"); + return ret; + } + } + } + } + return 0; +} diff --git a/i386/boot2/mboot.h b/i386/boot2/mboot.h new file mode 100644 index 0000000..b746093 --- /dev/null +++ b/i386/boot2/mboot.h @@ -0,0 +1,21 @@ +/* File added by David F. Elliott on 2007/06/27 */ +#include "multiboot.h" + +/* +The following DWORD tells the loader what features we require of it. +bit 0 set: Align modules on 4KB. We have no modules, we may not need this. +bit 1 set: Provide info about memory. We probably don't need this either +bit 2 : We might want this. If so we need to tell the loader to stick + us in text mode. We currently assume that the loader will put + us in text mode if we lack this because that is what GRUB does. +bit 16 set: This is not ELF, use the multiboot_header fields. + We definitely need this flag. +*/ +/* #define MULTIBOOT_HEADER_FLAGS 0x00010003 */ + +#define MULTIBOOT_HEADER_FLAGS \ + (MULTIBOOT_HEADER_HAS_ADDR|MULTIBOOT_HEADER_WANT_MEMORY|MULTIBOOT_HEADER_MODS_ALIGNED) + +#ifndef __ASSEMBLER__ +/* Put any desired prototypes or other C stuff here. */ +#endif diff --git a/i386/boot2/modules.c b/i386/boot2/modules.c new file mode 100644 index 0000000..4e70d99 --- /dev/null +++ b/i386/boot2/modules.c @@ -0,0 +1,1160 @@ +/* + * Copyright 2010 Evan Lojewski. All rights reserved. + * + */ +#include "boot.h" +#include "bootstruct.h" +#include "modules.h" +#include "boot_modules.h" +#include + +#ifdef CONFIG_MODULES +#ifndef CONFIG_MODULE_DEBUG +#define CONFIG_MODULE_DEBUG 0 +#endif + + +#if CONFIG_MODULE_DEBUG +#define DBG(x...) printf(x) +#define DBGPAUSE() getchar() +#else +#define DBG(x...) +#define DBGPAUSE() +#endif + +// NOTE: Global so that modules can link with this +static UInt64 textAddress = 0; +static UInt64 textSection = 0; + +/** Internal symbols, however there are accessor methods **/ +moduleHook_t* moduleCallbacks = NULL; +moduleList_t* loadedModules = NULL; +symbolList_t* moduleSymbols = NULL; +unsigned int (*lookup_symbol)(const char*) = NULL; + + +/* + * Initialize the module system by loading the Symbols.dylib module. + * Once loaded, locate the _lookup_symbol function so that internal + * symbols can be resolved. + */ +int init_module_system() +{ + // Start any modules that were compiled in first. + start_built_in_modules(); + + + int retVal = 0; + void (*module_start)(void) = NULL; + + extern char symbols_start __asm("section$start$__DATA$__Symbols"); + char* module_data = &symbols_start; + + // Intialize module system + if(module_data) + { + // Module system was compiled in (Symbols.dylib addr known) + module_start = parse_mach(module_data, &load_module, &add_symbol, NULL); + + if(module_start && module_start != (void*)0xFFFFFFFF) + { + // Notify the system that it was laoded + module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT); + (*module_start)(); // Start the module. This will point to load_all_modules due to the way the dylib was constructed. + execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL); + DBG("Module %s Loaded.\n", SYMBOLS_MODULE); + retVal = 1; + + } + else + { + // The module does not have a valid start function + printf("Unable to start %s at 0x%x\n", SYMBOLS_MODULE, module_data); pause(); + } + } + return retVal; +} + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)) +{ + start_function(); + // Notify the module system that this module really exists, specificaly, let other module link with it + module_loaded(name, author, description, version, compat); +} + +/* + * Load all modules in the /Extra/modules/ directory + * Module depencdies will be loaded first + * Modules will only be loaded once. When loaded a module must + * setup apropriete function calls and hooks as required. + * NOTE: To ensure a module loads after another you may + * link one module with the other. For dyld to allow this, you must + * reference at least one symbol within the module. + */ +void load_all_modules() +{ + char* name; + long flags; + long time; + struct dirstuff* moduleDir = opendir("/Extra/modules/"); + while(readdir(moduleDir, (const char**)&name, &flags, &time) >= 0) + { + if(strcmp(&name[strlen(name) - sizeof("dylib")], ".dylib") == 0) + { + char* tmp = malloc(strlen(name) + 1); + strcpy(tmp, name); + + if(!load_module(tmp)) + { + // failed to load + // free(tmp); + } + } + else + { + DBG("Ignoring %s\n", name); + } + + } +} + + +/* + * Load a module file in /Extra/modules/ + */ +int load_module(char* module) +{ + int retVal = 1; + void (*module_start)(void) = NULL; + char modString[128]; + int fh = -1; + + // Check to see if the module has already been loaded + if(is_module_loaded(module)) + { + return 1; + } + + sprintf(modString, MODULE_PATH "%s", module); + fh = open(modString, 0); + if(fh < 0) + { + DBG("WARNING: Unable to locate module %s\n", modString); DBGPAUSE(); + return 0; + } + + unsigned int moduleSize = file_size(fh); + if(moduleSize == 0) + { + DBG("WARNING: The module %s has a file size of %d, the module will not be loaded.\n", modString, moduleSize); + return 0; + } + char* module_base = (char*) malloc(moduleSize); + if (moduleSize && read(fh, module_base, moduleSize) == moduleSize) + { + // Module loaded into memory, parse it + module_start = parse_mach(module_base, &load_module, &add_symbol, NULL); + + if(module_start && module_start != (void*)0xFFFFFFFF) + { + // Notify the system that it was laoded + module_loaded(module, NULL, NULL, 0, 0 /*moduleName, NULL, moduleVersion, moduleCompat*/); + (*module_start)(); // Start the module + DBG("Module %s Loaded.\n", module); DBGPAUSE(); + } +#if CONFIG_MODULE_DEBUG + else // The module does not have a valid start function. This may be a library. + { + printf("WARNING: Unable to start %s\n", module); + getchar(); + } +#else + else msglog("WARNING: Unable to start %s\n", module); +#endif + } + else + { + DBG("Unable to read in module %s\n.", module); DBGPAUSE(); + retVal = 0; + } + + close(fh); + return retVal; +} + +/* + * add_symbol + * This function adds a symbol from a module to the list of known symbols + * possibly change to a pointer and add this to the Symbol module so that it can + * adjust it's internal symbol list (sort) to optimize locating new symbols + * NOTE: returns the address if the symbol is "start", else returns 0xFFFFFFFF + */ +long long add_symbol(char* symbol, long long addr, char is64) +{ + // This only can handle 32bit symbols + symbolList_t* entry; + //DBG("Adding symbol %s at 0x%X\n", symbol, addr); + + entry = malloc(sizeof(symbolList_t)); + entry->next = moduleSymbols; + moduleSymbols = entry; + + entry->addr = (UInt32)addr; + entry->symbol = symbol; + + if(!is64 && strcmp(symbol, "start") == 0) + { + return addr; + } + else + { + return 0xFFFFFFFF; // fixme + } +} + + +/* + * print out the information about the loaded module + */ +void module_loaded(const char* name, const char* author, const char* description, UInt32 version, UInt32 compat) +{ + moduleList_t* new_entry = malloc(sizeof(moduleList_t)); + new_entry->next = loadedModules; + + loadedModules = new_entry; + + if(!name) name = "Unknown"; + if(!author) author = "Unknown"; + if(!description) description = ""; + + new_entry->name = name; + new_entry->author = author; + new_entry->description = description; + new_entry->version = version; + new_entry->compat = compat; + + msglog("Module '%s' by '%s' Loaded.\n", name, author); + msglog("\tDescription: %s\n", description); + msglog("\tVersion: %d\n", version); // todo: sperate to major.minor.bugfix + msglog("\tCompat: %d\n", compat); // todo: ^^^ major.minor.bugfix +} + +int is_module_loaded(const char* name) +{ + // todo sorted search + moduleList_t* entry = loadedModules; + while(entry) + { + if(strcmp(entry->name, name) == 0) + { + DBG("Located module %s\n", name); DBGPAUSE(); + return 1; + } + else + { + entry = entry->next; + } + + } + + DBG("Module %s not loaded\n", name); DBGPAUSE(); + return 0; +} + +/* + * lookup symbols in all loaded modules. Thins inludes boot syms due to Symbols.dylib construction + * + */ +unsigned int lookup_all_symbols(const char* name) +{ + symbolList_t* entry = moduleSymbols; + while(entry) + { + if(strcmp(entry->symbol, name) == 0) + { + //DBG("External symbol %s located at 0x%X\n", name, entry->addr); + return entry->addr; + } + else + { + entry = entry->next; + } + } + +#if CONFIG_MODULE_DEBUG + printf("Unable to locate symbol %s\n", name); + getchar(); +#endif + + if(strcmp(name, VOID_SYMBOL) == 0) return 0xFFFFFFFF; + // In the event that a symbol does not exist + // Return a pointer to a void function. + else return lookup_all_symbols(VOID_SYMBOL); +} + +/********************************************************************************/ +/* Macho Parser */ +/********************************************************************************/ + +/* + * Parse through a macho module. The module will be rebased and binded + * as specified in the macho header. If the module is sucessfuly laoded + * the module iinit address will be returned. + * NOTE; all dependecies will be loaded before this module is started + * NOTE: If the module is unable to load ot completeion, the modules + * symbols will still be available. + */ +void* parse_mach(void* binary, + int(*dylib_loader)(char*), + long long(*symbol_handler)(char*, long long, char), + void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address) +) +{ + char is64 = false; + void (*module_start)(void) = NULL; + + // Module info + /*char* moduleName = NULL; + UInt32 moduleVersion = 0; + UInt32 moduleCompat = 0; + */ + // TODO convert all of the structs to a union + struct load_command *loadCommand = NULL; + struct dylib_command* dylibCommand = NULL; + struct dyld_info_command* dyldInfoCommand = NULL; + + struct symtab_command* symtabCommand = NULL; + struct segment_command *segCommand = NULL; + struct segment_command_64 *segCommand64 = NULL; + + //struct dysymtab_command* dysymtabCommand = NULL; + UInt32 binaryIndex = 0; + UInt16 cmd = 0; + + textSection = 0; + textAddress = 0; // reinitialize text location in case it doesn't exist; + + // Parse through the load commands + if(((struct mach_header*)binary)->magic == MH_MAGIC) + { + is64 = false; + binaryIndex += sizeof(struct mach_header); + } + else if(((struct mach_header_64*)binary)->magic == MH_MAGIC_64) + { + // NOTE: modules cannot be 64bit. This is used to parse the kernel and kexts + is64 = true; + binaryIndex += sizeof(struct mach_header_64); + } + else + { + verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic); + return NULL; + } + + + + /*if(((struct mach_header*)binary)->filetype != MH_DYLIB) + { + printf("Module is not a dylib. Unable to load.\n"); + getchar(); + return NULL; // Module is in the incorrect format + }*/ + + while(cmd < ((struct mach_header*)binary)->ncmds) + { + cmd++; + + loadCommand = binary + binaryIndex; + UInt32 cmdSize = loadCommand->cmdsize; + + + switch ((loadCommand->cmd & 0x7FFFFFFF)) + { + case LC_SYMTAB: + symtabCommand = binary + binaryIndex; + break; + + case LC_SEGMENT: // 32bit macho + { + segCommand = binary + binaryIndex; + + UInt32 sectionIndex; + + sectionIndex = sizeof(struct segment_command); + + struct section *sect; + + while(sectionIndex < segCommand->cmdsize) + { + sect = binary + binaryIndex + sectionIndex; + + sectionIndex += sizeof(struct section); + + if(section_handler) section_handler(sect->sectname, segCommand->segname, (void*)sect, sect->offset, sect->addr); + + if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + { + // __TEXT,__text found, save the offset and address for when looking for the calls. + textSection = sect->offset; + textAddress = sect->addr; + } + } + } + break; + case LC_SEGMENT_64: // 64bit macho's + { + segCommand64 = binary + binaryIndex; + UInt32 sectionIndex; + + sectionIndex = sizeof(struct segment_command_64); + + struct section_64 *sect; + + while(sectionIndex < segCommand64->cmdsize) + { + sect = binary + binaryIndex + sectionIndex; + + sectionIndex += sizeof(struct section_64); + + if(section_handler) section_handler(sect->sectname, segCommand64->segname, (void*)sect, sect->offset, sect->addr); + + if((strcmp("__TEXT", segCommand64->segname) == 0) && (strcmp("__text", sect->sectname) == 0)) + { + // __TEXT,__text found, save the offset and address for when looking for the calls. + textSection = sect->offset; + textAddress = sect->addr; + } + } + } + break; + + + case LC_LOAD_DYLIB: + case LC_LOAD_WEAK_DYLIB ^ LC_REQ_DYLD: + // Required modules + dylibCommand = binary + binaryIndex; + char* module = binary + binaryIndex + ((UInt32)*((UInt32*)&dylibCommand->dylib.name)); + // Possible enhancments: verify version + // = dylibCommand->dylib.current_version; + // = dylibCommand->dylib.compatibility_version; + if(dylib_loader) + { + char* name = malloc(strlen(module) + strlen(".dylib") + 1); + sprintf(name, "%s.dylib", module); + + if (!dylib_loader(name)) + { + // NOTE: any symbols exported by dep will be replace with the void function + free(name); + } + } + + break; + + case LC_ID_DYLIB: + //dylibCommand = binary + binaryIndex; + /*moduleName = binary + binaryIndex + ((UInt32)*((UInt32*)&dylibCommand->dylib.name)); + moduleVersion = dylibCommand->dylib.current_version; + moduleCompat = dylibCommand->dylib.compatibility_version; + */ + break; + + case LC_DYLD_INFO: + //case LC_DYLD_INFO_ONLY: // compressed info, 10.6+ macho files, already handeled + // Bind and rebase info is stored here + dyldInfoCommand = binary + binaryIndex; + break; + + case LC_DYSYMTAB: + case LC_UUID: + case LC_UNIXTHREAD: + break; + + default: + DBG("Unhandled loadcommand 0x%X\n", loadCommand->cmd & 0x7FFFFFFF); + break; + + } + + binaryIndex += cmdSize; + } + + // bind_macho uses the symbols, if the textAdd does not exist (Symbols.dylib, no code), addresses are static and not relative + module_start = (void*)handle_symtable((UInt32)binary, symtabCommand, symbol_handler, is64); + + if(dyldInfoCommand) + { + // Rebase the module before binding it. + if(dyldInfoCommand->rebase_off) rebase_macho(binary, (char*)dyldInfoCommand->rebase_off, dyldInfoCommand->rebase_size); + // Bind all symbols. + if(dyldInfoCommand->bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->bind_off, dyldInfoCommand->bind_size); + if(dyldInfoCommand->weak_bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->weak_bind_off, dyldInfoCommand->weak_bind_size); + if(dyldInfoCommand->lazy_bind_off) bind_macho(binary, (UInt8*)dyldInfoCommand->lazy_bind_off, dyldInfoCommand->lazy_bind_size); + } + + return module_start; + +} + +/* + * parse the symbol table + * Lookup any undefined symbols + */ + +unsigned int handle_symtable(UInt32 base, struct symtab_command* symtabCommand, long long(*symbol_handler)(char*, long long, char), char is64) +{ + unsigned int module_start = 0xFFFFFFFF; + UInt32 symbolIndex = 0; + char* symbolString = base + (char*)symtabCommand->stroff; + + if(!is64) + { + struct nlist* symbolEntry = (void*)base + symtabCommand->symoff; + while(symbolIndex < symtabCommand->nsyms) + { + // If the symbol is exported by this module + if(symbolEntry->n_value && + symbol_handler(symbolString + symbolEntry->n_un.n_strx, textAddress ? (long long)base + symbolEntry->n_value : symbolEntry->n_value, is64) != 0xFFFFFFFF) + { + + // Module start located. Start is an alias so don't register it + module_start = textAddress ? base + symbolEntry->n_value : symbolEntry->n_value; + } + + symbolEntry++; + symbolIndex++; // TODO remove + } + } + else + { + struct nlist_64* symbolEntry = (void*)base + symtabCommand->symoff; + // NOTE First entry is *not* correct, but we can ignore it (i'm getting radar:// right now, verify later) + while(symbolIndex < symtabCommand->nsyms) + { + + + // If the symbol is exported by this module + if(symbolEntry->n_value && + symbol_handler(symbolString + symbolEntry->n_un.n_strx, textAddress ? (long long)base + symbolEntry->n_value : symbolEntry->n_value, is64) != 0xFFFFFFFF) + { + + // Module start located. Start is an alias so don't register it + module_start = textAddress ? base + symbolEntry->n_value : symbolEntry->n_value; + } + + symbolEntry++; + symbolIndex++; // TODO remove + } + } + return module_start; +} + +// Based on code from dylibinfo.cpp and ImageLoaderMachOCompressed.cpp +void rebase_macho(void* base, char* rebase_stream, UInt32 size) +{ + rebase_stream += (UInt32)base; + + UInt8 immediate = 0; + UInt8 opcode = 0; + UInt8 type = 0; + UInt32 segmentAddress = 0; + + + UInt32 tmp = 0; + UInt32 tmp2 = 0; + UInt8 bits = 0; + int index = 0; + unsigned int i = 0; + + while(i < size) + { + immediate = rebase_stream[i] & REBASE_IMMEDIATE_MASK; + opcode = rebase_stream[i] & REBASE_OPCODE_MASK; + + + switch(opcode) + { + case REBASE_OPCODE_DONE: + // Rebase complete, reset vars + immediate = 0; + opcode = 0; + type = 0; + segmentAddress = 0; + default: + break; + + + case REBASE_OPCODE_SET_TYPE_IMM: + type = immediate; + break; + + + case REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: + // Locate address to begin rebasing + segmentAddress = 0; + struct segment_command* segCommand = NULL; // NOTE: 32bit only + + unsigned int binIndex = 0; + index = 0; + do + { + segCommand = base + sizeof(struct mach_header) + binIndex; + + + binIndex += segCommand->cmdsize; + index++; + } + while(index <= immediate); + + + segmentAddress = segCommand->fileoff; + + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + segmentAddress += tmp; + break; + + + case REBASE_OPCODE_ADD_ADDR_ULEB: + // Add value to rebase address + tmp = 0; + bits = 0; + do + { + tmp <<= bits; + tmp |= rebase_stream[++i] & 0x7f; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + segmentAddress += tmp; + break; + + case REBASE_OPCODE_ADD_ADDR_IMM_SCALED: + segmentAddress += immediate * sizeof(void*); + break; + + + case REBASE_OPCODE_DO_REBASE_IMM_TIMES: + index = 0; + for (index = 0; index < immediate; ++index) { + rebase_location(base + segmentAddress, (char*)base, type); + segmentAddress += sizeof(void*); + } + break; + + + case REBASE_OPCODE_DO_REBASE_ULEB_TIMES: + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + index = 0; + for (index = 0; index < tmp; ++index) { + //DBG("\tRebasing 0x%X\n", segmentAddress); + rebase_location(base + segmentAddress, (char*)base, type); + segmentAddress += sizeof(void*); + } + break; + + case REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB: + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + rebase_location(base + segmentAddress, (char*)base, type); + + segmentAddress += tmp + sizeof(void*); + break; + + case REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB: + tmp = 0; + bits = 0; + do + { + tmp |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + + tmp2 = 0; + bits = 0; + do + { + tmp2 |= (rebase_stream[++i] & 0x7f) << bits; + bits += 7; + } + while(rebase_stream[i] & 0x80); + + index = 0; + for (index = 0; index < tmp; ++index) { + + rebase_location(base + segmentAddress, (char*)base, type); + + segmentAddress += tmp2 + sizeof(void*); + } + break; + } + i++; + } +} + +inline void rebase_location(UInt32* location, char* base, int type) +{ + switch(type) + { + case REBASE_TYPE_POINTER: + case REBASE_TYPE_TEXT_ABSOLUTE32: + *location += (UInt32)base; + break; + + default: + break; + } +} + + +UInt32 read_uleb(UInt8* bind_stream, unsigned int* i) +{ + // Read in offset + UInt32 tmp = 0; + UInt8 bits = 0; + do + { + if(bits < sizeof(UInt32)*8) // hack + { + tmp |= (bind_stream[++(*i)] & 0x7f) << bits; + bits += 7; + } + else + { + ++(*i); + } + } + while(bind_stream[*i] & 0x80); + return tmp; +} + + +// Based on code from dylibinfo.cpp and ImageLoaderMachOCompressed.cpp +// NOTE: this uses 32bit values, and not 64bit values. +// There is a possibility that this could cause issues, +// however the modules are 32 bits, so it shouldn't matter too much +void bind_macho(void* base, UInt8* bind_stream, UInt32 size) +{ + bind_stream += (UInt32)base; + + UInt8 immediate = 0; + UInt8 opcode = 0; + UInt8 type = BIND_TYPE_POINTER; + + UInt32 segmentAddress = 0; + + UInt32 address = 0; + + SInt32 addend = 0; + SInt32 libraryOrdinal = 0; + + const char* symbolName = NULL; + UInt8 symboFlags = 0; + UInt32 symbolAddr = 0xFFFFFFFF; + + // Temperary variables + UInt32 tmp = 0; + UInt32 tmp2 = 0; + UInt32 index = 0; + unsigned int i = 0; + + while(i < size) + { + immediate = bind_stream[i] & BIND_IMMEDIATE_MASK; + opcode = bind_stream[i] & BIND_OPCODE_MASK; + + + switch(opcode) + { + case BIND_OPCODE_DONE: + // reset vars + type = BIND_TYPE_POINTER; + segmentAddress = 0; + address = 0; + addend = 0; + libraryOrdinal = 0; + symbolAddr = 0xFFFFFFFF; + default: + break; + + case BIND_OPCODE_SET_DYLIB_ORDINAL_IMM: + libraryOrdinal = immediate; + break; + + case BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB: + libraryOrdinal = read_uleb(bind_stream, &i); + break; + + case BIND_OPCODE_SET_DYLIB_SPECIAL_IMM: + libraryOrdinal = immediate ? (SInt8)(BIND_OPCODE_MASK | immediate) : immediate; + break; + + case BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM: + symboFlags = immediate; + symbolName = (char*)&bind_stream[++i]; + i += strlen((char*)&bind_stream[i]); + + symbolAddr = lookup_all_symbols(symbolName); + break; + + case BIND_OPCODE_SET_TYPE_IMM: + type = immediate; + break; + + case BIND_OPCODE_SET_ADDEND_SLEB: + addend = read_uleb(bind_stream, &i); + if(!(bind_stream[i-1] & 0x40)) addend *= -1; + break; + + case BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB: + segmentAddress = 0; + + // Locate address + struct segment_command* segCommand = NULL; // NOTE: 32bit only + + unsigned int binIndex = 0; + index = 0; + do + { + segCommand = base + sizeof(struct mach_header) + binIndex; + binIndex += segCommand->cmdsize; + index++; + } + while(index <= immediate); + + segmentAddress = segCommand->fileoff; + + segmentAddress += read_uleb(bind_stream, &i); + break; + + case BIND_OPCODE_ADD_ADDR_ULEB: + segmentAddress += read_uleb(bind_stream, &i); + break; + + case BIND_OPCODE_DO_BIND: + if(symbolAddr != 0xFFFFFFFF) + { + address = segmentAddress + (UInt32)base; + + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + + segmentAddress += sizeof(void*); + break; + + case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB: + // Read in offset + tmp = read_uleb(bind_stream, &i); + + if(symbolAddr != 0xFFFFFFFF) + { + address = segmentAddress + (UInt32)base; + + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + + segmentAddress += tmp + sizeof(void*); + + + break; + + case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED: + if(symbolAddr != 0xFFFFFFFF) + { + address = segmentAddress + (UInt32)base; + + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + segmentAddress += (immediate * sizeof(void*)) + sizeof(void*); + + + break; + + case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: + tmp = read_uleb(bind_stream, &i); + + tmp2 = read_uleb(bind_stream, &i); + + if(symbolAddr != 0xFFFFFFFF) + { + for(index = 0; index < tmp; index++) + { + + address = segmentAddress + (UInt32)base; + bind_location((UInt32*)address, (char*)symbolAddr, addend, type); + segmentAddress += tmp2 + sizeof(void*); + } + } + else + { + printf("Unable to bind symbol %s\n", symbolName); + getchar(); + } + break; + } + i++; + } +} + + +inline void bind_location(UInt32* location, char* value, UInt32 addend, int type) +{ + // do actual update + char* newValue = value + addend; + + switch (type) { + case BIND_TYPE_POINTER: + case BIND_TYPE_TEXT_ABSOLUTE32: + break; + + case BIND_TYPE_TEXT_PCREL32: + newValue -= ((UInt32)location + 4); + + break; + default: + return; + } + //DBG("Binding 0x%X to 0x%X (was 0x%X)\n", location, newValue, *location); + *location = (UInt32)newValue; +} + +/********************************************************************************/ +/* Module Hook Interface */ +/********************************************************************************/ + +/* +* Locate the symbol for an already loaded function and modify the beginning of +* the function to jump directly to the new one +* example: replace_function("_HelloWorld_start", &replacement_start); +*/ +int replace_function(const char* symbol, void* newAddress) +{ + UInt32* jumpPointer = malloc(sizeof(UInt32*)); + UInt32 addr = lookup_all_symbols(symbol); + + char* binary = (char*)addr; + if(addr != 0xFFFFFFFF) + { + //DBG("Replacing %s to point to 0x%x\n", symbol, newAddress); + *binary++ = 0xFF; // Jump + *binary++ = 0x25; // Long Jump + *((UInt32*)binary) = (UInt32)jumpPointer; + + *jumpPointer = (UInt32)newAddress; + return 1; + } + return 0; +} + + +/* + * execute_hook( const char* name ) + * name - Name of the module hook + * If any callbacks have been registered for this hook + * they will be executed now in the same order that the + * hooks were added. +*/ +int execute_hook(const char* name, void* arg1, void* arg2, void* arg3, void* arg4) +{ + DBG("Attempting to execute hook '%s'\n", name); DBGPAUSE(); + moduleHook_t* hook = hook_exists(name); + + if(hook) + { + // Loop through all callbacks for this module + callbackList_t* callbacks = hook->callbacks; + + while(callbacks) + { + // Execute callback + callbacks->callback(arg1, arg2, arg3, arg4); + callbacks = callbacks->next; + } + DBG("Hook '%s' executed.\n", name); DBGPAUSE(); + return 1; + } + else + { + // Callback for this hook doesn't exist; + DBG("No callbacks for '%s' hook.\n", name); + return 0; + } +} + + + +/* + * register_hook_callback( const char* name, void(*callback)()) + * name - Name of the module hook to attach to. + * callbacks - The funciton pointer that will be called when the + * hook is executed. When registering a new callback name, the callback is added sorted. + * NOTE: the hooks take four void* arguments. + */ +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)) +{ + DBG("Adding callback for '%s' hook.\n", name); DBGPAUSE(); + + moduleHook_t* hook = hook_exists(name); + + if(hook) + { + // append + callbackList_t* newCallback = malloc(sizeof(callbackList_t)); + newCallback->next = hook->callbacks; + hook->callbacks = newCallback; + newCallback->callback = callback; + } + else + { + // create new hook + moduleHook_t* newHook = malloc(sizeof(moduleHook_t)); + newHook->name = name; + newHook->callbacks = malloc(sizeof(callbackList_t)); + newHook->callbacks->callback = callback; + newHook->callbacks->next = NULL; + + newHook->next = moduleCallbacks; + moduleCallbacks = newHook; + + } + +#if CONFIG_MODULE_DEBUG + //print_hook_list(); + //getchar(); +#endif + +} + + +moduleHook_t* hook_exists(const char* name) +{ + moduleHook_t* hooks = moduleCallbacks; + + // look for a hook. If it exists, return the moduleHook_t*, + // If not, return NULL. + while(hooks) + { + if(strcmp(name, hooks->name) == 0) + { + //DBG("Located hook %s\n", name); + return hooks; + } + hooks = hooks->next; + } + //DBG("Hook %s does not exist\n", name); + return NULL; + +} + +#if CONFIG_MODULE_DEBUG +void print_hook_list() +{ + printf("---Hook Table---\n"); + + moduleHook_t* hooks = moduleCallbacks; + while(hooks) + { + printf("Hook: %s\n", hooks->name); + hooks = hooks->next; + } +} + +#endif + +/********************************************************************************/ +/* dyld / Linker Interface */ +/********************************************************************************/ + +void dyld_stub_binder() +{ + printf("ERROR: dyld_stub_binder was called, should have been take care of by the linker.\n"); + getchar(); +} + +#else /* CONFIG_MODULES */ + +int init_module_system() +{ + return 0; +} + +void load_all_modules() +{ + +} + +int execute_hook(const char* name, void* arg1, void* arg2, void* arg3, void* arg4) +{ + return 0; +} + +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)) +{ + printf("WARNING: register_hook_callback is not supported when compiled in.\n"); + pause(); +} + +int replace_function(const char* symbol, void* newAddress) +{ + printf("WARNING: replace_functions is not supported when compiled in.\n"); + pause(); + return 0; +} + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)) +{ + start_function(); +} + +#endif \ No newline at end of file diff --git a/i386/boot2/modules.h b/i386/boot2/modules.h new file mode 100644 index 0000000..23292e6 --- /dev/null +++ b/i386/boot2/modules.h @@ -0,0 +1,122 @@ +/* + * Module Loading functionality + * Copyright 2009 Evan Lojewski. All rights reserved. + * + */ + +#include +#include +#include + + +#ifndef __BOOT_MODULES_H +#define __BOOT_MODULES_H + +#define MODULE_PATH "/Extra/modules/" + +#define SYMBOLS_MODULE "Symbols.dylib" +#define SYMBOLS_AUTHOR "Chameleon" +#define SYMBOLS_DESCRIPTION "Chameleon symbols for linking" +#define SYMBOLS_VERSION 0 +#define SYMBOLS_COMPAT 0 + +#define VOID_SYMBOL "dyld_void_start" + + + +typedef struct symbolList_t +{ + char* symbol; + UInt64 addr; + struct symbolList_t* next; +} symbolList_t; + + +typedef struct callbackList_t +{ + void(*callback)(void*, void*, void*, void*); + struct callbackList_t* next; +} callbackList_t; + +typedef struct moduleHook_t +{ + const char* name; + callbackList_t* callbacks; + struct moduleHook_t* next; +} moduleHook_t; + +typedef struct modulesList_t +{ + const char* name; + const char* author; + const char* description; + UInt32 version; + UInt32 compat; + struct modulesList_t* next; +} moduleList_t; + + + +int init_module_system(); +void load_all_modules(); + +void start_built_in_module(const char* name, + const char* author, + const char* description, + UInt32 version, + UInt32 compat, + void(*start_function)(void)); + +int load_module(char* module); +int is_module_loaded(const char* name); +void module_loaded(const char* name, const char* author, const char* description, UInt32 version, UInt32 compat); + + + + +/********************************************************************************/ +/* Symbol Functions */ +/********************************************************************************/ +long long add_symbol(char* symbol, long long addr, char is64); +unsigned int lookup_all_symbols(const char* name); + + + +/********************************************************************************/ +/* Macho Parser */ +/********************************************************************************/ +void* parse_mach(void* binary, + int(*dylib_loader)(char*), + long long(*symbol_handler)(char*, long long, char), + void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address) + ); +unsigned int handle_symtable(UInt32 base, + struct symtab_command* symtabCommand, + long long(*symbol_handler)(char*, long long, char), + char is64); +void rebase_macho(void* base, char* rebase_stream, UInt32 size); +inline void rebase_location(UInt32* location, char* base, int type); +void bind_macho(void* base, UInt8* bind_stream, UInt32 size); +inline void bind_location(UInt32* location, char* value, UInt32 addend, int type); + + + + +/********************************************************************************/ +/* Module Interface */ +/********************************************************************************/ +int replace_function(const char* symbol, void* newAddress); +int execute_hook(const char* name, void*, void*, void*, void*); +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)); +moduleHook_t* hook_exists(const char* name); + +#if DEBUG_MODULES +void print_hook_list(); +#endif + +/********************************************************************************/ +/* dyld Interface */ +/********************************************************************************/ +void dyld_stub_binder(); + +#endif /* __BOOT_MODULES_H */ diff --git a/i386/boot2/modules_support.s b/i386/boot2/modules_support.s new file mode 100644 index 0000000..22d2bec --- /dev/null +++ b/i386/boot2/modules_support.s @@ -0,0 +1,10 @@ +#ifdef CONFIG_MODULES +#include + +LABEL(dyld_stub_binder) + jmp _dyld_stub_binder + +LABEL(dyld_void_start) + ret + +#endif \ No newline at end of file diff --git a/i386/boot2/multiboot.h b/i386/boot2/multiboot.h new file mode 100644 index 0000000..f948bf6 --- /dev/null +++ b/i386/boot2/multiboot.h @@ -0,0 +1,203 @@ +/* $NetBSD: multiboot.h,v 1.4 2006/10/25 13:56:16 jmmv Exp $ */ + +/*- + * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Julio M. Merino Vidal. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* Modified by David Elliott on 2007/06/27 + - Removed checks for KERNEL define + - Replaced _LOCORE def check with __ASSEMBLER__ def check + - Removed prototypes for C functions we don't have + - Replaced all paddr_t and vaddr_t types with uint32_t and a comment +*/ + +/* --------------------------------------------------------------------- */ + +/* + * Multiboot header structure. + */ +#define MULTIBOOT_HEADER_MAGIC 0x1BADB002 +#define MULTIBOOT_HEADER_MODS_ALIGNED 0x00000001 +#define MULTIBOOT_HEADER_WANT_MEMORY 0x00000002 +#define MULTIBOOT_HEADER_HAS_VBE 0x00000004 +#define MULTIBOOT_HEADER_HAS_ADDR 0x00010000 + +#if !defined(__ASSEMBLER__) +struct multiboot_header { + uint32_t mh_magic; + uint32_t mh_flags; + uint32_t mh_checksum; + + /* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_ADDR. */ + uint32_t mh_header_addr; /* paddr_t */ + uint32_t mh_load_addr; /* paddr_t */ + uint32_t mh_load_end_addr; /* paddr_t */ + uint32_t mh_bss_end_addr; /* paddr_t */ + uint32_t mh_entry_addr; /* paddr_t */ + + /* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_VBE. */ + uint32_t mh_mode_type; + uint32_t mh_width; + uint32_t mh_height; + uint32_t mh_depth; +}; +#endif /* !defined(__ASSEMBLER__) */ + +/* + * Symbols defined in locore.S. + */ +#if !defined(__ASSEMBLER__) +extern struct multiboot_header *Multiboot_Header; +#endif /* !defined(__ASSEMBLER__) */ + +/* --------------------------------------------------------------------- */ + +/* + * Multiboot information structure. + */ +#define MULTIBOOT_INFO_MAGIC 0x2BADB002 +#define MULTIBOOT_INFO_HAS_MEMORY 0x00000001 +#define MULTIBOOT_INFO_HAS_BOOT_DEVICE 0x00000002 +#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004 +#define MULTIBOOT_INFO_HAS_MODS 0x00000008 +#define MULTIBOOT_INFO_HAS_AOUT_SYMS 0x00000010 +#define MULTIBOOT_INFO_HAS_ELF_SYMS 0x00000020 +#define MULTIBOOT_INFO_HAS_MMAP 0x00000040 +#define MULTIBOOT_INFO_HAS_DRIVES 0x00000080 +#define MULTIBOOT_INFO_HAS_CONFIG_TABLE 0x00000100 +#define MULTIBOOT_INFO_HAS_LOADER_NAME 0x00000200 +#define MULTIBOOT_INFO_HAS_APM_TABLE 0x00000400 +#define MULTIBOOT_INFO_HAS_VBE 0x00000800 + +#if !defined(__ASSEMBLER__) +struct multiboot_info { + uint32_t mi_flags; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MEMORY. */ + uint32_t mi_mem_lower; + uint32_t mi_mem_upper; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_BOOT_DEVICE. */ + uint8_t mi_boot_device_part3; + uint8_t mi_boot_device_part2; + uint8_t mi_boot_device_part1; + uint8_t mi_boot_device_drive; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CMDLINE. */ + char * mi_cmdline; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MODS. */ + uint32_t mi_mods_count; + uint32_t mi_mods_addr; /* vaddr_t */ + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_{AOUT,ELF}_SYMS. */ + uint32_t mi_elfshdr_num; + uint32_t mi_elfshdr_size; + uint32_t mi_elfshdr_addr; /* vaddr_t */ + uint32_t mi_elfshdr_shndx; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MMAP. */ + uint32_t mi_mmap_length; + uint32_t mi_mmap_addr; /* vaddr_t */ + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_DRIVES. */ + uint32_t mi_drives_length; + uint32_t mi_drives_addr; /* vaddr_t */ + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CONFIG_TABLE. */ + void * unused_mi_config_table; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_LOADER_NAME. */ + char * mi_loader_name; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_APM. */ + void * unused_mi_apm_table; + + /* Valid if mi_flags sets MULTIBOOT_INFO_HAS_VBE. */ + void * unused_mi_vbe_control_info; + void * unused_mi_vbe_mode_info; + uint32_t unused_mi_vbe_interface_seg; /* paddr_t */ + uint32_t unused_mi_vbe_interface_off; /* paddr_t */ + uint32_t unused_mi_vbe_interface_len; +}; +typedef struct multiboot_info multiboot_info; + +/* --------------------------------------------------------------------- */ + +struct multiboot_module { + uint32_t mm_mod_start; + uint32_t mm_mod_end; + char * mm_string; + uint32_t mm_reserved; +}; +typedef struct multiboot_module multiboot_module; + +/* + * Drive information. This describes an entry in the drives table as + * pointed to by mi_drives_addr. + */ +struct multiboot_drive { + uint32_t md_length; + uint8_t md_number; + uint8_t md_mode; + uint16_t md_cylinders; + uint8_t md_heads; + uint8_t md_sectors; + + /* The variable-sized 'ports' field comes here, so this structure + * can be longer. */ +}; + +/* --------------------------------------------------------------------- */ + +/* + * Memory mapping. This describes an entry in the memory mappings table + * as pointed to by mi_mmap_addr. + * + * Be aware that mm_size specifies the size of all other fields *except* + * for mm_size. In order to jump between two different entries, you + * have to count mm_size + 4 bytes. + */ +struct multiboot_mmap { + uint32_t mm_size; + uint64_t mm_base_addr; + uint64_t mm_length; + uint32_t mm_type; +}; + +#endif /* !defined(__ASSEMBLER__) */ + +/* --------------------------------------------------------------------- */ + diff --git a/i386/boot2/options.c b/i386/boot2/options.c new file mode 100644 index 0000000..472085d --- /dev/null +++ b/i386/boot2/options.c @@ -0,0 +1,1534 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2004 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "boot.h" +#include "bootstruct.h" +#include "fdisk.h" +#include "ramdisk.h" +#include "gui.h" +#include "term.h" +#include "embedded.h" +#include "pci.h" +#include "modules.h" + +bool showBootBanner = true; //Azi:showinfo +static bool shouldboot = false; + +extern int multiboot_timeout; +extern int multiboot_timeout_set; + +extern BVRef bvChain; +//extern int menucount; + +extern int gDeviceCount; + +int selectIndex = 0; +MenuItem * menuItems = NULL; + +enum { + kMenuTopRow = 5, + kMenuMaxItems = 10, + kScreenLastRow = 24 +}; + +//========================================================================== + +typedef struct { + int x; + int y; + int type; +} CursorState; + +static void changeCursor( int col, int row, int type, CursorState * cs ) +{ + if (cs) getCursorPositionAndType( &cs->x, &cs->y, &cs->type ); + setCursorType( type ); + setCursorPosition( col, row, 0 ); +} + +static void moveCursor( int col, int row ) +{ + setCursorPosition( col, row, 0 ); +} + +static void restoreCursor( const CursorState * cs ) +{ + setCursorPosition( cs->x, cs->y, 0 ); + setCursorType( cs->type ); +} + +//========================================================================== + +/* Flush keyboard buffer; returns TRUE if any of the flushed + * characters was F8. + */ + +static bool flushKeyboardBuffer(void) +{ + bool status = false; + + while ( readKeyboardStatus() ) { + if (bgetc() == 0x4200) status = true; + } + return status; +} + +//========================================================================== + +static int countdown( const char * msg, int row, int timeout ) +{ + unsigned long time; + int ch = 0; + int col = strlen(msg) + 1; + + flushKeyboardBuffer(); + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + moveCursor( 0, row ); + printf(msg); + + } else { + + position_t p = pos( gui.screen.width / 2 + 1 , ( gui.devicelist.pos.y + 3 ) + ( ( gui.devicelist.height - gui.devicelist.iconspacing ) / 2 ) ); + + char dummy[80]; + getBootVolumeDescription( gBootVolume, dummy, sizeof(dummy) - 1, true ); + drawDeviceIcon( gBootVolume, gui.screen.pixmap, p, true ); + drawStrCenteredAt( (char *) msg, &font_small, gui.screen.pixmap, gui.countdown.pos ); + + // make this screen the new background + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + + } + + int multi_buff = 18 * (timeout); + int multi = ++multi_buff; + + int lasttime=0; + + for ( time = time18(), timeout++; timeout > 0; ) + { + if( time18() > lasttime) + { + multi--; + lasttime=time18(); + } + + if ( (ch = readKeyboardStatus()) ) + break; + + // Count can be interrupted by holding down shift, + // control or alt key + if ( ( readKeyboardShiftFlags() & 0x0F ) != 0 ) + { + ch = 1; + break; + } + + if ( time18() >= time ) + { + time += 18; + timeout--; + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + moveCursor( col, row ); + printf("(%d) ", timeout); + } + } + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) + { + drawProgressBar( gui.screen.pixmap, 100, gui.progressbar.pos , ( multi * 100 / multi_buff ) ); + gui.redraw = true; + updateVRAM(); + } + + } + + flushKeyboardBuffer(); + + return ch; +} + +//========================================================================== + +char gBootArgs[BOOT_STRING_LEN]; +static char * gBootArgsPtr = gBootArgs; +static char * gBootArgsEnd = gBootArgs + BOOT_STRING_LEN - 1; +static char booterCommand[BOOT_STRING_LEN]; +static char booterParam[BOOT_STRING_LEN]; + +static void clearBootArgs(void) +{ + gBootArgsPtr = gBootArgs; + memset(gBootArgs, '\0', BOOT_STRING_LEN); + + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + clearGraphicBootPrompt(); + } + execute_hook("ClearArgs", NULL, NULL, NULL, NULL); +} + +void addBootArg(const char * argStr) +{ + if ( (gBootArgsPtr + strlen(argStr) + 1) < gBootArgsEnd) + { + if(gBootArgsPtr != gBootArgs) *gBootArgsPtr++ = ' '; + strcat(gBootArgs, argStr); + gBootArgsPtr += strlen(argStr); + } +} + +//========================================================================== + +static void showBootPrompt(int row, bool visible) +{ + extern char bootPrompt[]; + extern char bootRescanPrompt[]; + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) { + changeCursor( 0, row, kCursorTypeUnderline, 0 ); + clearScreenRows( row, kScreenLastRow ); + } + + clearBootArgs(); + + if (visible) { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + if (gEnableCDROMRescan) { + printf( bootRescanPrompt ); + } else { + printf( bootPrompt ); + printf( gBootArgs ); + } + } + } else { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + clearGraphicBootPrompt(); + } else { + printf("Press Enter to start up the foreign OS. "); + } + } +} + +//========================================================================== + +static void updateBootArgs( int key ) +{ + key = ASCII_KEY(key); + + switch ( key ) + { + case KEY_BKSP: + if ( gBootArgsPtr > gBootArgs ) + { + *--gBootArgsPtr = '\0'; + + int x, y, t; + getCursorPositionAndType( &x, &y, &t ); + if ( x == 0 && y ) + { + x = 80; y--; + } + if (x) x--; + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + setCursorPosition( x, y, 0 ); + putca(' ', 0x07, 1); + } + else + { + updateGraphicBootPrompt(); + } + } + break; + + default: + if ( key >= ' ' && gBootArgsPtr < gBootArgsEnd) + { + *gBootArgsPtr++ = key; + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) updateGraphicBootPrompt(); + else if ( key >= ' ' && key < 0x7f) putchar(key); + } + + break; + } +} + +//========================================================================== + +static const MenuItem * gMenuItems = NULL; + +static int gMenuItemCount; +static int gMenuRow; +static int gMenuHeight; +static int gMenuTop; +static int gMenuBottom; +static int gMenuSelection; + +static int gMenuStart; +static int gMenuEnd; + +static void printMenuItem( const MenuItem * item, int highlight ) +{ + printf(" "); + + if ( highlight ) + putca(' ', 0x70, strlen(item->name) + 4); + else + putca(' ', 0x07, 40); + + printf(" %40s\n", item->name); +} + +//========================================================================== + +static void showMenu( const MenuItem * items, int count, + int selection, int row, int height ) +{ + int i; + CursorState cursorState; + + if ( items == NULL || count == 0 ) + return; + + // head and tail points to the start and the end of the list. + // top and bottom points to the first and last visible items + // in the menu window. + + gMenuItems = items; + gMenuRow = row; + gMenuHeight = height; + gMenuItemCount = count; + gMenuTop = 0; + gMenuBottom = MIN( count, height ) - 1; + gMenuSelection = selection; + + gMenuStart = 0; + gMenuEnd = MIN( count, gui.maxdevices ) - 1; + + // If the selected item is not visible, shift the list down. + + if ( gMenuSelection > gMenuBottom ) + { + gMenuTop += ( gMenuSelection - gMenuBottom ); + gMenuBottom = gMenuSelection; + } + + if ( gMenuSelection > gMenuEnd ) + { + gMenuStart += ( gMenuSelection - gMenuEnd ); + gMenuEnd = gMenuSelection; + } + + // Draw the visible items. + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) + + drawDeviceList(gMenuStart, gMenuEnd, gMenuSelection); + + else { + + changeCursor( 0, row, kCursorTypeHidden, &cursorState ); + + for ( i = gMenuTop; i <= gMenuBottom; i++ ) + { + printMenuItem( &items[i], (i == gMenuSelection) ); + } + + restoreCursor( &cursorState ); + } +} + +//========================================================================== + +static int updateMenu( int key, void ** paramPtr ) +{ + int moved = 0; + + union { + struct { + unsigned int + selectionUp : 1, + selectionDown : 1, + scrollUp : 1, + scrollDown : 1; + } f; + unsigned int w; + } draw = {{0}}; + + if ( gMenuItems == NULL ) + return 0; + + if( bootArgs->Video.v_display != VGA_TEXT_MODE ) + { + int res; + + // set navigation keys for horizontal layout as defaults + int previous = 0x4B00; // left arrow + int subsequent = 0x4D00; // right arrow + int menu = 0x5000; // down arrow + + if ( gui.layout == VerticalLayout ) + { + // set navigation keys for vertical layout + previous = 0x4800; // up arrow + subsequent = 0x5000; // down arrow + menu = 0x4B00; // right arrow + } + + if ( key == previous ) + { + if ( gMenuSelection > gMenuTop ) + draw.f.selectionUp = 1; + else if ( gMenuTop > 0 ) + draw.f.scrollDown = 1; + + } + + else if ( key == subsequent ) + { + if ( gMenuSelection != gMenuBottom) + draw.f.selectionDown = 1; + else if ( gMenuBottom < ( gMenuItemCount - 1 ) ) + draw.f.scrollUp = 1; + } + + else if ( key == menu ) + { + if ( gui.menu.draw ) + updateInfoMenu(key); + else + drawInfoMenu(); + } + + else if ( gui.menu.draw ) + { + res = updateInfoMenu(key); + + if ( res == CLOSE_INFO_MENU ) + gui.menu.draw = false; + else + { + shouldboot = ( res != DO_NOT_BOOT ); + + if ( shouldboot ) + gui.menu.draw = false; + + switch (res) + { + case BOOT_NORMAL: + gVerboseMode = false; + gBootMode = kBootModeNormal; + break; + + case BOOT_VERBOSE: + gVerboseMode = true; + gBootMode = kBootModeNormal; + addBootArg(kVerboseModeFlag); + break; + + case BOOT_IGNORECACHE: + gVerboseMode = false; + gBootMode = kBootModeNormal; + addBootArg(kIgnoreCachesFlag); + break; + + case BOOT_SINGLEUSER: + gVerboseMode = true; + gBootMode = kBootModeNormal; + addBootArg(kSingleUserModeFlag); + break; + } + + } + + } + + } else { + switch ( key ) + { + case 0x4800: // Up Arrow + if ( gMenuSelection != gMenuTop ) + draw.f.selectionUp = 1; + else if ( gMenuTop > 0 ) + draw.f.scrollDown = 1; + break; + + case 0x5000: // Down Arrow + if ( gMenuSelection != gMenuBottom ) + draw.f.selectionDown = 1; + else if ( gMenuBottom < (gMenuItemCount - 1) ) + draw.f.scrollUp = 1; + break; + } + } + + if ( draw.w ) + { + if ( draw.f.scrollUp ) + { + scollPage(0, gMenuRow, 40, gMenuRow + gMenuHeight - 1, 0x07, 1, 1); + gMenuTop++; gMenuBottom++; + gMenuStart++; gMenuEnd++; + draw.f.selectionDown = 1; + } + + if ( draw.f.scrollDown ) + { + scollPage(0, gMenuRow, 40, gMenuRow + gMenuHeight - 1, 0x07, 1, -1); + gMenuTop--; gMenuBottom--; + gMenuStart--; gMenuEnd--; + draw.f.selectionUp = 1; + } + + if ( draw.f.selectionUp || draw.f.selectionDown ) + { + + CursorState cursorState; + + // Set cursor at current position, and clear inverse video. + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + changeCursor( 0, gMenuRow + gMenuSelection - gMenuTop, kCursorTypeHidden, &cursorState ); + printMenuItem( &gMenuItems[gMenuSelection], 0 ); + } + + if ( draw.f.selectionUp ) + { + gMenuSelection--; + if(( gMenuSelection - gMenuStart) == -1 ) + { + gMenuStart--; + gMenuEnd--; + } + + } else { + gMenuSelection++; + if(( gMenuSelection - ( gui.maxdevices - 1) - gMenuStart) > 0 ) + { + gMenuStart++; + gMenuEnd++; + } + } + + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) + { + moveCursor( 0, gMenuRow + gMenuSelection - gMenuTop ); + printMenuItem( &gMenuItems[gMenuSelection], 1 ); + restoreCursor( &cursorState ); + + } else + + drawDeviceList (gMenuStart, gMenuEnd, gMenuSelection); + + } + + *paramPtr = gMenuItems[gMenuSelection].param; + moved = 1; + } + + return moved; +} + +//========================================================================== + +static void skipblanks( const char ** cpp ) +{ + while ( **(cpp) == ' ' || **(cpp) == '\t' ) ++(*cpp); +} + +//========================================================================== + +static const char * extractKernelName( char ** cpp ) +{ + char * kn = *cpp; + char * cp = *cpp; + char c; + + // Convert char to lower case. + + c = *cp | 0x20; + + // Must start with a letter or a '/'. + + if ( (c < 'a' || c > 'z') && ( c != '/' ) ) + return 0; + + // Keep consuming characters until we hit a separator. + + while ( *cp && (*cp != '=') && (*cp != ' ') && (*cp != '\t') ) + cp++; + + // Only SPACE or TAB separator is accepted. + // Reject everything else. + + if (*cp == '=') + return 0; + + // Overwrite the separator, and move the pointer past + // the kernel name. + + if (*cp != '\0') *cp++ = '\0'; + *cpp = cp; + + return kn; +} + +//========================================================================== + +static void +printMemoryInfo(void) +{ + int line; + int i; + MemoryRange *mp = bootInfo->memoryMap; + + // Activate and clear page 1 + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition( 0, 0, 1 ); + + printf("BIOS reported memory ranges:\n"); + line = 1; + for (i=0; imemoryMapCount; i++) { + printf("Base 0x%08x%08x, ", + (unsigned long)(mp->base >> 32), + (unsigned long)(mp->base)); + printf("length 0x%08x%08x, type %d\n", + (unsigned long)(mp->length >> 32), + (unsigned long)(mp->length), + mp->type); + if (line++ > 20) { + pause(); + line = 0; + } + mp++; + } + if (line > 0) { + pause(); + } + + setActiveDisplayPage(0); +} + +char *getMemoryInfoString() +{ + int i; + MemoryRange *mp = bootInfo->memoryMap; + char *buff = malloc(sizeof(char)*1024); + if(!buff) return 0; + + char info[] = "BIOS reported memory ranges:\n"; + sprintf(buff, "%s", info); + for (i=0; imemoryMapCount; i++) { + sprintf( buff+strlen(buff), "Base 0x%08x%08x, ", + (unsigned long)(mp->base >> 32), + (unsigned long)(mp->base)); + sprintf( buff+strlen(buff), "length 0x%08x%08x, type %d\n", + (unsigned long)(mp->length >> 32), + (unsigned long)(mp->length), + mp->type); + mp++; + } + return buff; +} + +//========================================================================== + +void lspci(void) +{ + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + } + + dump_pci_dt(root_pci_dev->children); + + pause(); + + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + setActiveDisplayPage(0); + } +} + +//========================================================================== + +int getBootOptions(bool firstRun) +{ + int i; + int key; + int nextRow; + int timeout; + int bvCount; + BVRef bvr; + BVRef menuBVR; + bool showPrompt, newShowPrompt, isCDROM; + + // Initialize default menu selection entry. + gBootVolume = menuBVR = selectBootVolume(bvChain); + + if (biosDevIsCDROM(gBIOSDev)) { + isCDROM = true; + } else { + isCDROM = false; + } + + // ensure we're in graphics mode if gui is setup + if (firstRun && gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE) + { + setVideoMode(GRAPHICS_MODE, 0); + } + + // Clear command line boot arguments + clearBootArgs(); + + // Allow user to override default timeout. + if (multiboot_timeout_set) { + timeout = multiboot_timeout; + } else if (!getIntForKey(kTimeoutKey, &timeout, &bootInfo->chameleonConfig)) { + /* If there is no timeout key in the file use the default timeout + which is different for CDs vs. hard disks. However, if not booting + a CD and no config file could be loaded set the timeout + to zero which causes the menu to display immediately. + This way, if no partitions can be found, that is the disk is unpartitioned + or simply cannot be read) then an empty menu is displayed. + If some partitions are found, for example a Windows partition, then + these will be displayed in the menu as foreign partitions. + */ + if (isCDROM) { + timeout = kCDBootTimeout; + } else { + timeout = sysConfigValid ? kBootTimeout : 0; + } + } + + if (timeout < 0) { + gBootMode |= kBootModeQuiet; + } + + // If the user is holding down a modifier key, enter safe mode. + if ((readKeyboardShiftFlags() & 0x0F) != 0) { + gBootMode |= kBootModeSafe; + } + + // Checking user pressed keys + bool f8press = false, spress = false, vpress = false; + while (readKeyboardStatus()) { + key = bgetc (); + if (key == 0x4200) f8press = true; + if ((key & 0xff) == 's' || (key & 0xff) == 'S') spress = true; + if ((key & 0xff) == 'v' || (key & 0xff) == 'V') vpress = true; + } + // If user typed F8, abort quiet mode, and display the menu. + if (f8press) { + gBootMode &= ~kBootModeQuiet; + timeout = 0; + } + // If user typed 'v' or 'V', boot in verbose mode. + if ((gBootMode & kBootModeQuiet) && firstRun && vpress) { + addBootArg(kVerboseModeFlag); + } + // If user typed 's' or 'S', boot in single user mode. + if ((gBootMode & kBootModeQuiet) && firstRun && spress) { + addBootArg(kSingleUserModeFlag); + } + + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + setCursorPosition(0, 0, 0); + clearScreenRows(0, kScreenLastRow); + if (!(gBootMode & kBootModeQuiet)) { + // Display banner and show hardware info. + printf(bootBanner, (bootInfo->convmem + bootInfo->extmem) / 1024); + printf(getVBEInfoString()); + } + changeCursor(0, kMenuTopRow, kCursorTypeUnderline, 0); + verbose("Scanning device %x...", gBIOSDev); + } + + // When booting from CD, default to hard drive boot when possible. + if (isCDROM && firstRun) { + const char *val; + char *prompt = NULL; + char *name = NULL; + int cnt; + int optionKey; + + if (getValueForKey(kCDROMPromptKey, &val, &cnt, &bootInfo->chameleonConfig)) { + prompt = malloc(cnt + 1); + strncat(prompt, val, cnt); + } else { + name = malloc(80); + getBootVolumeDescription(gBootVolume, name, 79, false); + prompt = malloc(256); + sprintf(prompt, "Press any key to start up from %s, or press F8 to enter startup options.", name); + free(name); + } + + if (getIntForKey( kCDROMOptionKey, &optionKey, &bootInfo->chameleonConfig )) { + // The key specified is a special key. + } else { + // Default to F8. + optionKey = 0x4200; + } + + // If the timeout is zero then it must have been set above due to the + // early catch of F8 which means the user wants to set boot options + // which we ought to interpret as meaning he wants to boot the CD. + if (timeout != 0) { + key = countdown(prompt, kMenuTopRow, timeout); + } else { + key = optionKey; + } + + if (prompt != NULL) { + free(prompt); + } + + clearScreenRows( kMenuTopRow, kMenuTopRow + 2 ); + + // Hit the option key ? + if (key == optionKey) { + gBootMode &= ~kBootModeQuiet; + timeout = 0; + } else { + key = key & 0xFF; + + // Try booting hard disk if user pressed 'h' + if (biosDevIsCDROM(gBIOSDev) && key == 'h') { + BVRef bvr; + + // Look at partitions hosting OS X other than the CD-ROM + for (bvr = bvChain; bvr; bvr=bvr->next) { + if ((bvr->flags & kBVFlagSystemVolume) && bvr->biosdev != gBIOSDev) { + gBootVolume = bvr; + } + } + } + goto done; + } + } + + if (gBootMode & kBootModeQuiet) { + // No input allowed from user. + goto done; + } + + if (firstRun && timeout > 0 && countdown("Press any key to enter startup options.", kMenuTopRow, timeout) == 0) { + // If the user is holding down a modifier key, + // enter safe mode. + if ((readKeyboardShiftFlags() & 0x0F) != 0) { + gBootMode |= kBootModeSafe; + } + goto done; + } + + if (gDeviceCount >0) { + // Allocate memory for an array of menu items. + menuItems = malloc(sizeof(MenuItem) * gDeviceCount); + if (menuItems == NULL) { + goto done; + } + + // Associate a menu item for each BVRef. + for (bvr=bvChain, i=gDeviceCount-1, selectIndex=-1; bvr; bvr=bvr->next) { + if (bvr->visible) { + getBootVolumeDescription(bvr, menuItems[i].name, sizeof(menuItems[i].name) - 1, true); + menuItems[i].param = (void *) bvr; + if (bvr == menuBVR) { + selectIndex = i; + } + i--; + } + } + // Jief : In case the default partition (returned by selectBootVolume) is not in the menu + if ( selectIndex == -1 ) + { + selectIndex = 0; + + // gDeviceCount is actually > 0, so menuItems[selectIndex] exists + menuBVR = (BVRef)(menuItems[selectIndex].param); + // what happen is bvChain is empty ? + } + } + + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + // redraw the background buffer + gui.logo.draw = true; + drawBackground(); + gui.devicelist.draw = true; + gui.redraw = true; + if (!(gBootMode & kBootModeQuiet)) { + + // Check if "Boot Banner"=N switch is present in config file. + getBoolForKey(kBootBannerKey, &showBootBanner, &bootInfo->chameleonConfig); + if (showBootBanner) { + // Display banner and show hardware info. + gprintf(&gui.screen, bootBanner + 1, (bootInfo->convmem + bootInfo->extmem) / 1024); + } + + // redraw background + memcpy(gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4); + } + } else { + // Clear screen and hide the blinking cursor. + clearScreenRows(kMenuTopRow, kMenuTopRow + 2); + changeCursor(0, kMenuTopRow, kCursorTypeHidden, 0); + } + + nextRow = kMenuTopRow; + showPrompt = true; + + if (gDeviceCount) { + if( bootArgs->Video.v_display == VGA_TEXT_MODE ) { + printf("Use \30\31 keys to select the startup volume."); + } + showMenu( menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems ); + nextRow += MIN( gDeviceCount, kMenuMaxItems ) + 3; + } + + // Show the boot prompt. + showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); + showBootPrompt( nextRow, showPrompt ); + + do { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + // redraw background + memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 ); + // reset cursor co-ords + gui.debug.cursor = pos( gui.screen.width - 160 , 10 ); + } + key = getchar(); + updateMenu( key, (void **) &menuBVR ); + newShowPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); + + if (newShowPrompt != showPrompt) { + showPrompt = newShowPrompt; + showBootPrompt( nextRow, showPrompt ); + } + + if (showPrompt) { + updateBootArgs(key); + } + + switch (key) { + case KEY_ENTER: + if (gui.menu.draw) { + key=0; + break; + } + if (*gBootArgs == '?') { + char * argPtr = gBootArgs; + + // Skip the leading "?" character. + argPtr++; + getNextArg(&argPtr, booterCommand); + getNextArg(&argPtr, booterParam); + + /* + * TODO: this needs to be refactored. + */ + if (strcmp( booterCommand, "video" ) == 0) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + showInfoBox(getVBEInfoString(), getVBEModeInfoString()); + } else { + printVBEModeInfo(); + } + } else if ( strcmp( booterCommand, "memory" ) == 0) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE ) { + showInfoBox("Memory Map", getMemoryInfoString()); + } else { + printMemoryInfo(); + } + } else if (strcmp(booterCommand, "lspci") == 0) { + lspci(); + } else if (strcmp(booterCommand, "more") == 0) { + showTextFile(booterParam); + } else if (strcmp(booterCommand, "rd") == 0) { + processRAMDiskCommand(&argPtr, booterParam); + } else if (strcmp(booterCommand, "norescan") == 0) { + if (gEnableCDROMRescan) { + gEnableCDROMRescan = false; + break; + } + } else { + showHelp(); + } + key = 0; + showBootPrompt(nextRow, showPrompt); + break; + } + gBootVolume = menuBVR; + setRootVolume(menuBVR); + gBIOSDev = menuBVR->biosdev; + break; + + case KEY_ESC: + clearBootArgs(); + break; + + case KEY_F5: + // New behavior: + // Clear gBootVolume to restart the loop + // if the user enabled rescanning the optical drive. + // Otherwise boot the default boot volume. + if (gEnableCDROMRescan) { + gBootVolume = NULL; + clearBootArgs(); + } + break; + + case KEY_F10: + gScanSingleDrive = false; + scanDisks(gBIOSDev, &bvCount); + gBootVolume = NULL; + clearBootArgs(); + break; + + case KEY_TAB: + // New behavior: + // Switch between text & graphic interfaces + // Only Permitted if started in graphics interface + if (useGUI) { + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + setVideoMode(VGA_TEXT_MODE, 0); + + setCursorPosition(0, 0, 0); + clearScreenRows(0, kScreenLastRow); + + // Display banner and show hardware info. + printf(bootBanner, (bootInfo->convmem + bootInfo->extmem) / 1024); + printf(getVBEInfoString()); + + clearScreenRows(kMenuTopRow, kMenuTopRow + 2); + changeCursor(0, kMenuTopRow, kCursorTypeHidden, 0); + + nextRow = kMenuTopRow; + showPrompt = true; + + if (gDeviceCount) { + printf("Use \30\31 keys to select the startup volume."); + showMenu(menuItems, gDeviceCount, selectIndex, kMenuTopRow + 2, kMenuMaxItems); + nextRow += MIN(gDeviceCount, kMenuMaxItems) + 3; + } + + showPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot); + showBootPrompt(nextRow, showPrompt); + //changeCursor( 0, kMenuTopRow, kCursorTypeUnderline, 0 ); + } else { + gui.redraw = true; + setVideoMode(GRAPHICS_MODE, 0); + updateVRAM(); + updateGraphicBootPrompt(); + } + } + key = 0; + break; + + default: + key = 0; + break; + } + } while (0 == key); + +done: + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + clearScreenRows(kMenuTopRow, kScreenLastRow); + changeCursor(0, kMenuTopRow, kCursorTypeUnderline, 0); + } + shouldboot = false; + gui.menu.draw = false; + if (menuItems) { + free(menuItems); + menuItems = NULL; + } +// The next line if uncommented will write the command line boot options to nvram +// execute_hook("BootOptions", gBootArgs, gBootArgsPtr, NULL, NULL); + return 0; +} + +//========================================================================== + +char gBootUUIDString[32+4+1] = ""; // UUID of the boot volume e.g. 5EB1869F-C4FA-3502-BDEB-3B8ED5D87292 +extern unsigned char chainbootdev; +extern unsigned char chainbootflag; + +bool copyArgument(const char *argName, const char *val, int cnt, char **argP, int *cntRemainingP) +{ + int argLen = argName ? strlen(argName) : 0; + int len = argLen + cnt + 1; // +1 to account for space + + if (argName) + len++; // +1 to account for '=' + + if (len > *cntRemainingP) { + error("Warning: boot arguments too long, truncating\n"); + return false; + } + + if (argName) { + strncpy( *argP, argName, argLen ); + *argP += argLen; + *argP[0] = '='; + (*argP)++; + } + + strncpy( *argP, val, cnt ); + *argP += cnt; + *argP[0] = ' '; + (*argP)++; + + *cntRemainingP -= len; + return true; +} + +// +// Returns TRUE if an argument was copied, FALSE otherwise +bool +processBootArgument( + const char *argName, // The argument to search for + const char *userString, // Typed-in boot arguments + const char *kernelFlags, // Kernel flags from config table + const char *configTable, + char **argP, // Output value + int *cntRemainingP, // Output count + char *foundVal, // found value + int foundValSize // max found value size + ) +{ + const char *val; + int cnt; + bool found = false; + + if (getValueForBootKey(userString, argName, &val, &cnt)) { + // Don't copy; these values will be copied at the end of argument processing. + found = true; + } else if (getValueForBootKey(kernelFlags, argName, &val, &cnt)) { + // Don't copy; these values will be copied at the end of argument processing. + found = true; + } else if (getValueForKey(argName, &val, &cnt, &bootInfo->chameleonConfig)) { + copyArgument(argName, val, cnt, argP, cntRemainingP); + found = true; + } + if (found && foundVal) + strlcpy(foundVal, val, foundValSize); + return found; +} + +// Maximum config table value size +#define VALUE_SIZE 2048 + +int +processBootOptions() +{ + const char *cp = gBootArgs; + const char *val = 0; + const char *kernel; + int cnt; + int userCnt; + int cntRemaining; + char *argP; + char *configKernelFlags; + char *valueBuffer; + + valueBuffer = malloc(VALUE_SIZE); + + skipblanks( &cp ); + + // Update the unit and partition number. + + if ( gBootVolume ) + { + if (!( gBootVolume->flags & kBVFlagNativeBoot )) + { + readBootSector( gBootVolume->biosdev, gBootVolume->part_boff, + (void *) 0x7c00 ); + + // + // Setup edx, and signal intention to chain load the + // foreign booter. + // + + chainbootdev = gBootVolume->biosdev; + chainbootflag = 1; + + return 1; + } + + setRootVolume(gBootVolume); + + } + // If no boot volume fail immediately because we're just going to fail + // trying to load the config file anyway. + else + return -1; + + // Load config table specified by the user, or use the default. + + if (!getValueForBootKey(cp, "config", &val, &cnt)) { + val = 0; + cnt = 0; + } + + // Load com.apple.Boot.plist from the selected volume + // and use its contents to override default bootConfig. + + loadSystemConfig(&bootInfo->bootConfig); + loadChameleonConfig(&bootInfo->chameleonConfig); + + // Use the kernel name specified by the user, or fetch the name + // in the config table, or use the default if not specified. + // Specifying a kernel name on the command line, or specifying + // a non-default kernel name in the config file counts as + // overriding the kernel, which causes the kernelcache not + // to be used. + + gOverrideKernel = false; + if (( kernel = extractKernelName((char **)&cp) )) { + strlcpy( bootInfo->bootFile, kernel, sizeof(bootInfo->bootFile) ); + } else { + if ( getValueForKey( kKernelNameKey, &val, &cnt, &bootInfo->bootConfig ) ) { + strlcpy( bootInfo->bootFile, val, cnt+1 ); + } else { + strlcpy( bootInfo->bootFile, kDefaultKernel, sizeof(bootInfo->bootFile) ); + } + } + if (strcmp( bootInfo->bootFile, kDefaultKernel ) != 0) { + gOverrideKernel = true; + } + + cntRemaining = BOOT_STRING_LEN - 2; // save 1 for NULL, 1 for space + argP = bootArgs->CommandLine; + + // Get config kernel flags, if not ignored. + if (getValueForBootKey(cp, kIgnoreBootFileFlag, &val, &cnt) || + !getValueForKey( kKernelFlagsKey, &val, &cnt, &bootInfo->bootConfig )) { + val = ""; + cnt = 0; + } + configKernelFlags = malloc(cnt + 1); + strlcpy(configKernelFlags, val, cnt + 1); + + // boot-uuid can be set either on the command-line or in the config file + if (!processBootArgument(kBootUUIDKey, cp, configKernelFlags, bootInfo->config, + &argP, &cntRemaining, gBootUUIDString, sizeof(gBootUUIDString))) { + // + // Try an alternate method for getting the root UUID on boot helper partitions. + // + if (gBootVolume->flags & kBVFlagBooter) + { + // Load the configuration store in the boot helper partition + if (loadHelperConfig(&bootInfo->helperConfig) == 0) + { + val = getStringForKey(kHelperRootUUIDKey, &bootInfo->helperConfig); + if (val != NULL) + strlcpy(gBootUUIDString, val, sizeof(gBootUUIDString)); + } + } + + // Try to get the volume uuid string + if (!strlen(gBootUUIDString) && gBootVolume->fs_getuuid) + gBootVolume->fs_getuuid(gBootVolume, gBootUUIDString); + + // If we have the volume uuid add it to the commandline arguments + if (strlen(gBootUUIDString)) + copyArgument(kBootUUIDKey, gBootUUIDString, strlen(gBootUUIDString), &argP, &cntRemaining); + } + + if (!processBootArgument(kRootDeviceKey, cp, configKernelFlags, bootInfo->config, + &argP, &cntRemaining, gRootDevice, ROOT_DEVICE_SIZE)) { + cnt = 0; + if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->chameleonConfig)) { + valueBuffer[0] = '*'; + cnt++; + strlcpy(valueBuffer + 1, val, cnt); + val = valueBuffer; + } else { + if (strlen(gBootUUIDString)) { + val = "*uuid"; + cnt = 5; + } else { + // Don't set "rd=.." if there is no boot device key + // and no UUID. + val = ""; + cnt = 0; + } + } + if (cnt > 0) { + copyArgument( kRootDeviceKey, val, cnt, &argP, &cntRemaining); + } + strlcpy( gRootDevice, val, (cnt + 1)); + } + + /* + * Removed. We don't need this anymore. + * + if (!processBootArgument(kPlatformKey, cp, configKernelFlags, bootInfo->config, + &argP, &cntRemaining, gPlatformName, sizeof(gCacheNameAdler))) { + getPlatformName(gPlatformName); + copyArgument(kPlatformKey, gPlatformName, strlen(gPlatformName), &argP, &cntRemaining); + } + */ + + if (!getValueForBootKey(cp, kSafeModeFlag, &val, &cnt) && + !getValueForBootKey(configKernelFlags, kSafeModeFlag, &val, &cnt)) { + if (gBootMode & kBootModeSafe) { + copyArgument(0, kSafeModeFlag, strlen(kSafeModeFlag), &argP, &cntRemaining); + } + } + + // Store the merged kernel flags and boot args. + + cnt = strlen(configKernelFlags); + if (cnt) { + if (cnt > cntRemaining) { + error("Warning: boot arguments too long, truncating\n"); + cnt = cntRemaining; + } + strncpy(argP, configKernelFlags, cnt); + argP[cnt++] = ' '; + cntRemaining -= cnt; + } + userCnt = strlen(cp); + if (userCnt > cntRemaining) { + error("Warning: boot arguments too long, truncating\n"); + userCnt = cntRemaining; + } + strncpy(&argP[cnt], cp, userCnt); + argP[cnt+userCnt] = '\0'; + + if(!shouldboot) + { + gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) || + getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->chameleonConfig ); + + gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) ? + kBootModeSafe : kBootModeNormal; + + if ( getValueForKey( kIgnoreCachesFlag, &val, &cnt, &bootInfo->chameleonConfig ) ) { + gBootMode = kBootModeSafe; + } + } + + if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) + strlcpy(gMKextName, val, cnt + 1); + else + gMKextName[0]=0; + + free(configKernelFlags); + free(valueBuffer); + + return 0; +} + + +//========================================================================== +// Load the help file and display the file contents on the screen. + +void showTextBuffer(char *buf_orig, int size) +{ + char *bp; + char* buf; + int line; + int line_offset; + int c; + + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + showInfoBox( "Press q to continue, space for next page.\n",buf_orig ); + return; + } + + // Create a copy so that we don't mangle the original + buf = malloc(size + 1); + memcpy(buf, buf_orig, size); + + + bp = buf; + while (size-- > 0) { + if (*bp == '\n') { + *bp = '\0'; + } + bp++; + } + *bp = '\1'; + line_offset = 0; + + setActiveDisplayPage(1); + + while (1) { + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + bp = buf; + for (line = 0; *bp != '\1' && line < line_offset; line++) { + while (*bp != '\0') { + bp++; + } + bp++; + } + for (line = 0; *bp != '\1' && line < 23; line++) { + setCursorPosition(0, line, 1); + printf("%s\n", bp); + while (*bp != '\0') { + bp++; + } + bp++; + } + + setCursorPosition(0, 23, 1); + if (*bp == '\1') { + printf("[Type %sq or space to quit viewer]", (line_offset > 0) ? "p for previous page, " : ""); + } else { + printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); + } + + c = getchar(); + if (c == 'q' || c == 'Q') { + break; + } + if ((c == 'p' || c == 'P') && line_offset > 0) { + line_offset -= 23; + } + if (c == ' ') { + if (*bp == '\1') { + break; + } else { + line_offset += 23; + } + } + } + setActiveDisplayPage(0); +} + +void showHelp(void) +{ + if (bootArgs->Video.v_display != VGA_TEXT_MODE) { + showInfoBox("Help. Press q to quit.\n", (char *)BootHelp_txt); + } else { + showTextBuffer((char *)BootHelp_txt, BootHelp_txt_len); + } +} + +void showTextFile(const char * filename) +{ +#define MAX_TEXT_FILE_SIZE 65536 + char *buf; + int fd; + int size; + + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) { + printf("\nFile not found: %s\n", filename); + sleep(2); + return; + } + + size = file_size(fd); + if (size > MAX_TEXT_FILE_SIZE) { + size = MAX_TEXT_FILE_SIZE; + } + buf = malloc(size); + read(fd, buf, size); + close(fd); + showTextBuffer(buf, size); + free(buf); +} + +// This is a very simplistic prompting scheme that just grabs two hex characters +// Eventually we need to do something more user-friendly like display a menu +// based off of the Multiboot device list + +int selectAlternateBootDevice(int bootdevice) +{ + int key; + int newbootdevice; + int digitsI = 0; + char *end; + char digits[3] = {0,0,0}; + + // We've already printed the current boot device so user knows what it is + printf("Typical boot devices are 80 (First HD), 81 (Second HD)\n"); + printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice); + do { + key = getchar(); + switch (ASCII_KEY(key)) { + case KEY_BKSP: + if (digitsI > 0) { + int x, y, t; + getCursorPositionAndType(&x, &y, &t); + // Assume x is not 0; + x--; + setCursorPosition(x,y,0); // back up one char + // Overwrite with space without moving cursor position + putca(' ', 0x07, 1); + digitsI--; + } else { + // TODO: Beep or something + } + break; + + case KEY_ENTER: + digits[digitsI] = '\0'; + newbootdevice = strtol(digits, &end, 16); + if (end == digits && *end == '\0') { + // User entered empty string + printf("\nUsing default boot device %x\n", bootdevice); + key = 0; + } else if(end != digits && *end == '\0') { + bootdevice = newbootdevice; + printf("\n"); + key = 0; // We gots da boot device + } else { + printf("\nCouldn't parse. try again: "); + digitsI = 0; + } + break; + + default: + if (isxdigit(ASCII_KEY(key)) && digitsI < 2) { + putchar(ASCII_KEY(key)); + digits[digitsI++] = ASCII_KEY(key); + } else { + // TODO: Beep or something + } + break; + }; + } while (key != 0); + + return bootdevice; +} + +bool promptForRescanOption(void) +{ + printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n"); + if (getchar() == KEY_ENTER) { + return true; + } else { + return false; + } +} diff --git a/i386/boot2/picopng.c b/i386/boot2/picopng.c new file mode 100644 index 0000000..6a6392b --- /dev/null +++ b/i386/boot2/picopng.c @@ -0,0 +1,1151 @@ +// picoPNG version 20080503 (cleaned up and ported to c by kaitek) +// Copyright (c) 2005-2008 Lode Vandevenne +// +// This software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. + +#include +#include "libsa.h" +#include "picopng.h" + +/*************************************************************************************************/ + +typedef struct png_alloc_node { + struct png_alloc_node *prev, *next; + void *addr; + size_t size; +} png_alloc_node_t; + +png_alloc_node_t *png_alloc_head = NULL; +png_alloc_node_t *png_alloc_tail = NULL; + +png_alloc_node_t *png_alloc_find_node(void *addr) +{ + png_alloc_node_t *node; + for (node = png_alloc_head; node; node = node->next) + if (node->addr == addr) + break; + return node; +} + +void png_alloc_add_node(void *addr, size_t size) +{ + png_alloc_node_t *node; + if (png_alloc_find_node(addr)) + return; + node = malloc(sizeof (png_alloc_node_t)); + node->addr = addr; + node->size = size; + node->prev = png_alloc_tail; + node->next = NULL; + png_alloc_tail = node; + if (node->prev) + node->prev->next = node; + if (!png_alloc_head) + png_alloc_head = node; +} + +void png_alloc_remove_node(png_alloc_node_t *node) +{ + if (node->prev) + node->prev->next = node->next; + if (node->next) + node->next->prev = node->prev; + if (node == png_alloc_head) + png_alloc_head = node->next; + if (node == png_alloc_tail) + png_alloc_tail = node->prev; + node->prev = node->next = node->addr = NULL; + free(node); +} + +void *png_alloc_malloc(size_t size) +{ + void *addr = malloc(size); + png_alloc_add_node(addr, size); + return addr; +} + +void *png_alloc_realloc(void *addr, size_t size) +{ + void *new_addr; + if (!addr) + return png_alloc_malloc(size); + new_addr = realloc(addr, size); + if (new_addr != addr) { + png_alloc_node_t *old_node; + old_node = png_alloc_find_node(addr); + png_alloc_remove_node(old_node); + png_alloc_add_node(new_addr, size); + } + return new_addr; +} + +void png_alloc_free(void *addr) +{ + png_alloc_node_t *node = png_alloc_find_node(addr); + if (!node) + return; + png_alloc_remove_node(node); + free(addr); +} + +void png_alloc_free_all() +{ + while (png_alloc_tail) { + void *addr = png_alloc_tail->addr; + png_alloc_remove_node(png_alloc_tail); + free(addr); + } +} + +/*************************************************************************************************/ + +__unused void vector32_cleanup(vector32_t *p) +{ + p->size = p->allocsize = 0; + if (p->data) + png_alloc_free(p->data); + p->data = NULL; +} + +uint32_t vector32_resize(vector32_t *p, size_t size) +{ // returns 1 if success, 0 if failure ==> nothing done + if (size * sizeof (uint32_t) > p->allocsize) { + size_t newsize = size * sizeof (uint32_t) * 2; + void *data = png_alloc_realloc(p->data, newsize); + if (data) { + p->allocsize = newsize; + p->data = (uint32_t *) data; + p->size = size; + } else + return 0; + } else + p->size = size; + return 1; +} + +uint32_t vector32_resizev(vector32_t *p, size_t size, uint32_t value) +{ // resize and give all new elements the value + size_t oldsize = p->size, i; + if (!vector32_resize(p, size)) + return 0; + for (i = oldsize; i < size; i++) + p->data[i] = value; + return 1; +} + +void vector32_init(vector32_t *p) +{ + p->data = NULL; + p->size = p->allocsize = 0; +} + +vector32_t *vector32_new(size_t size, uint32_t value) +{ + vector32_t *p = png_alloc_malloc(sizeof (vector32_t)); + vector32_init(p); + if (size && !vector32_resizev(p, size, value)) + return NULL; + return p; +} + +/*************************************************************************************************/ + +__unused void vector8_cleanup(vector8_t *p) +{ + p->size = p->allocsize = 0; + if (p->data) + png_alloc_free(p->data); + p->data = NULL; +} + +uint32_t vector8_resize(vector8_t *p, size_t size) +{ // returns 1 if success, 0 if failure ==> nothing done + // xxx: the use of sizeof uint32_t here seems like a bug (this descends from the lodepng vector + // compatibility functions which do the same). without this there is corruption in certain cases, + // so this was probably done to cover up allocation bug(s) in the original picopng code! + if (size * sizeof (uint32_t) > p->allocsize) { + size_t newsize = size * sizeof (uint32_t) * 2; + void *data = png_alloc_realloc(p->data, newsize); + if (data) { + p->allocsize = newsize; + p->data = (uint8_t *) data; + p->size = size; + } else + return 0; // error: not enough memory + } else + p->size = size; + return 1; +} + +uint32_t vector8_resizev(vector8_t *p, size_t size, uint8_t value) +{ // resize and give all new elements the value + size_t oldsize = p->size, i; + if (!vector8_resize(p, size)) + return 0; + for (i = oldsize; i < size; i++) + p->data[i] = value; + return 1; +} + +void vector8_init(vector8_t *p) +{ + p->data = NULL; + p->size = p->allocsize = 0; +} + +vector8_t *vector8_new(size_t size, uint8_t value) +{ + vector8_t *p = png_alloc_malloc(sizeof (vector8_t)); + vector8_init(p); + if (size && !vector8_resizev(p, size, value)) + return NULL; + return p; +} + +vector8_t *vector8_copy(vector8_t *p) +{ + vector8_t *q = vector8_new(p->size, 0); + uint32_t n; + for (n = 0; n < q->size; n++) + q->data[n] = p->data[n]; + return q; +} + +/*************************************************************************************************/ + +const uint32_t LENBASE[29] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, + 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 }; +const uint32_t LENEXTRA[29] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, + 4, 5, 5, 5, 5, 0 }; +const uint32_t DISTBASE[30] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, + 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 }; +const uint32_t DISTEXTRA[30] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, + 10, 10, 11, 11, 12, 12, 13, 13 }; +// code length code lengths +const uint32_t CLCL[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + +/*************************************************************************************************/ + +typedef struct { + // 2D representation of a huffman tree: The one dimension is "0" or "1", the other contains all + // nodes and leaves of the tree. + vector32_t *tree2d; +} HuffmanTree; + +HuffmanTree *HuffmanTree_new() +{ + HuffmanTree *tree = png_alloc_malloc(sizeof (HuffmanTree)); + tree->tree2d = NULL; + return tree; +} + +int HuffmanTree_makeFromLengths(HuffmanTree *tree, const vector32_t *bitlen, uint32_t maxbitlen) +{ // make tree given the lengths + uint32_t bits, n, i; + uint32_t numcodes = (uint32_t) bitlen->size, treepos = 0, nodefilled = 0; + vector32_t *tree1d, *blcount, *nextcode; + tree1d = vector32_new(numcodes, 0); + blcount = vector32_new(maxbitlen + 1, 0); + nextcode = vector32_new(maxbitlen + 1, 0); + for (bits = 0; bits < numcodes; bits++) + blcount->data[bitlen->data[bits]]++; // count number of instances of each code length + for (bits = 1; bits <= maxbitlen; bits++) + nextcode->data[bits] = (nextcode->data[bits - 1] + blcount->data[bits - 1]) << 1; + for (n = 0; n < numcodes; n++) + if (bitlen->data[n] != 0) + tree1d->data[n] = nextcode->data[bitlen->data[n]]++; // generate all the codes + // 0x7fff here means the tree2d isn't filled there yet + vector32_t *tree2d = vector32_new(numcodes * 2, 0x7fff); + tree->tree2d = tree2d; + for (n = 0; n < numcodes; n++) // the codes + for (i = 0; i < bitlen->data[n]; i++) { // the bits for this code + uint32_t bit = (tree1d->data[n] >> (bitlen->data[n] - i - 1)) & 1; + if (treepos > numcodes - 2) + return 55; + if (tree2d->data[2 * treepos + bit] == 0x7fff) { // not yet filled in + if (i + 1 == bitlen->data[n]) { // last bit + tree2d->data[2 * treepos + bit] = n; + treepos = 0; + } else { // addresses are encoded as values > numcodes + tree2d->data[2 * treepos + bit] = ++nodefilled + numcodes; + treepos = nodefilled; + } + } else // subtract numcodes from address to get address value + treepos = tree2d->data[2 * treepos + bit] - numcodes; + } + return 0; +} + +int HuffmanTree_decode(const HuffmanTree *tree, bool *decoded, uint32_t *result, size_t *treepos, + uint32_t bit) +{ // Decodes a symbol from the tree + const vector32_t *tree2d = tree->tree2d; + uint32_t numcodes = (uint32_t) tree2d->size / 2; + if (*treepos >= numcodes) + return 11; // error: you appeared outside the codetree + *result = tree2d->data[2 * (*treepos) + bit]; + *decoded = (*result < numcodes); + *treepos = *decoded ? 0 : *result - numcodes; + return 0; +} + +/*************************************************************************************************/ + +int Inflator_error; + +uint32_t Zlib_readBitFromStream(size_t *bitp, const uint8_t *bits) +{ + uint32_t result = (bits[*bitp >> 3] >> (*bitp & 0x7)) & 1; + (*bitp)++; + return result; +} + +uint32_t Zlib_readBitsFromStream(size_t *bitp, const uint8_t *bits, size_t nbits) +{ + uint32_t i, result = 0; + for (i = 0; i < nbits; i++) + result += (Zlib_readBitFromStream(bitp, bits)) << i; + return result; +} + +void Inflator_generateFixedTrees(HuffmanTree *tree, HuffmanTree *treeD) +{ // get the tree of a deflated block with fixed tree + size_t i; + vector32_t *bitlen, *bitlenD; + bitlen = vector32_new(288, 8); + bitlenD = vector32_new(32, 5); + for (i = 144; i <= 255; i++) + bitlen->data[i] = 9; + for (i = 256; i <= 279; i++) + bitlen->data[i] = 7; + HuffmanTree_makeFromLengths(tree, bitlen, 15); + HuffmanTree_makeFromLengths(treeD, bitlenD, 15); +} + +uint32_t Inflator_huffmanDecodeSymbol(const uint8_t *in, size_t *bp, const HuffmanTree *codetree, + size_t inlength) +{ // decode a single symbol from given list of bits with given code tree. returns the symbol + bool decoded = false; + uint32_t ct = 0; + size_t treepos = 0; + for (;;) { + if ((*bp & 0x07) == 0 && (*bp >> 3) > inlength) { + Inflator_error = 10; // error: end reached without endcode + return 0; + } + Inflator_error = HuffmanTree_decode(codetree, &decoded, &ct, &treepos, + Zlib_readBitFromStream(bp, in)); + if (Inflator_error) + return 0; // stop, an error happened + if (decoded) + return ct; + } +} + +void Inflator_getTreeInflateDynamic(HuffmanTree *tree, HuffmanTree *treeD, const uint8_t *in, + size_t *bp, size_t inlength) +{ // get the tree of a deflated block with dynamic tree, the tree itself is also Huffman + // compressed with a known tree + size_t i, n; + HuffmanTree *codelengthcodetree = HuffmanTree_new(); // the code tree for code length codes + vector32_t *bitlen, *bitlenD; + bitlen = vector32_new(288, 0); + bitlenD = vector32_new(32, 0); + if (*bp >> 3 >= inlength - 2) { + Inflator_error = 49; // the bit pointer is or will go past the memory + return; + } + size_t HLIT = Zlib_readBitsFromStream(bp, in, 5) + 257; // number of literal/length codes + 257 + size_t HDIST = Zlib_readBitsFromStream(bp, in, 5) + 1; // number of dist codes + 1 + size_t HCLEN = Zlib_readBitsFromStream(bp, in, 4) + 4; // number of code length codes + 4 + vector32_t *codelengthcode; // lengths of tree to decode the lengths of the dynamic tree + codelengthcode = vector32_new(19, 0); + for (i = 0; i < 19; i++) + codelengthcode->data[CLCL[i]] = (i < HCLEN) ? Zlib_readBitsFromStream(bp, in, 3) : 0; + Inflator_error = HuffmanTree_makeFromLengths(codelengthcodetree, codelengthcode, 7); + if (Inflator_error) + return; + size_t replength; + for (i = 0; i < HLIT + HDIST; ) { + uint32_t code = Inflator_huffmanDecodeSymbol(in, bp, codelengthcodetree, inlength); + if (Inflator_error) + return; + if (code <= 15) { // a length code + if (i < HLIT) + bitlen->data[i++] = code; + else + bitlenD->data[i++ - HLIT] = code; + } else if (code == 16) { // repeat previous + if (*bp >> 3 >= inlength) { + Inflator_error = 50; // error, bit pointer jumps past memory + return; + } + replength = 3 + Zlib_readBitsFromStream(bp, in, 2); + uint32_t value; // set value to the previous code + if ((i - 1) < HLIT) + value = bitlen->data[i - 1]; + else + value = bitlenD->data[i - HLIT - 1]; + for (n = 0; n < replength; n++) { // repeat this value in the next lengths + if (i >= HLIT + HDIST) { + Inflator_error = 13; // error: i is larger than the amount of codes + return; + } + if (i < HLIT) + bitlen->data[i++] = value; + else + bitlenD->data[i++ - HLIT] = value; + } + } else if (code == 17) { // repeat "0" 3-10 times + if (*bp >> 3 >= inlength) { + Inflator_error = 50; // error, bit pointer jumps past memory + return; + } + replength = 3 + Zlib_readBitsFromStream(bp, in, 3); + for (n = 0; n < replength; n++) { // repeat this value in the next lengths + if (i >= HLIT + HDIST) { + Inflator_error = 14; // error: i is larger than the amount of codes + return; + } + if (i < HLIT) + bitlen->data[i++] = 0; + else + bitlenD->data[i++ - HLIT] = 0; + } + } else if (code == 18) { // repeat "0" 11-138 times + if (*bp >> 3 >= inlength) { + Inflator_error = 50; // error, bit pointer jumps past memory + return; + } + replength = 11 + Zlib_readBitsFromStream(bp, in, 7); + for (n = 0; n < replength; n++) { // repeat this value in the next lengths + if (i >= HLIT + HDIST) { + Inflator_error = 15; // error: i is larger than the amount of codes + return; + } + if (i < HLIT) + bitlen->data[i++] = 0; + else + bitlenD->data[i++ - HLIT] = 0; + } + } else { + Inflator_error = 16; // error: an nonexitent code appeared. This can never happen. + return; + } + } + if (bitlen->data[256] == 0) { + Inflator_error = 64; // the length of the end code 256 must be larger than 0 + return; + } + // now we've finally got HLIT and HDIST, so generate the code trees, and the function is done + Inflator_error = HuffmanTree_makeFromLengths(tree, bitlen, 15); + if (Inflator_error) + return; + Inflator_error = HuffmanTree_makeFromLengths(treeD, bitlenD, 15); + if (Inflator_error) + return; +} + +void Inflator_inflateHuffmanBlock(vector8_t *out, const uint8_t *in, size_t *bp, size_t *pos, + size_t inlength, uint32_t btype) +{ + HuffmanTree *codetree, *codetreeD; // the code tree for Huffman codes, dist codes + codetree = HuffmanTree_new(); + codetreeD = HuffmanTree_new(); + if (btype == 1) + Inflator_generateFixedTrees(codetree, codetreeD); + else if (btype == 2) { + Inflator_getTreeInflateDynamic(codetree, codetreeD, in, bp, inlength); + if (Inflator_error) + return; + } + for (;;) { + uint32_t code = Inflator_huffmanDecodeSymbol(in, bp, codetree, inlength); + if (Inflator_error) + return; + if (code == 256) // end code + return; + else if (code <= 255) { // literal symbol + if (*pos >= out->size) + vector8_resize(out, (*pos + 1) * 2); // reserve more room + out->data[(*pos)++] = (uint8_t) code; + } else if (code >= 257 && code <= 285) { // length code + size_t length = LENBASE[code - 257], numextrabits = LENEXTRA[code - 257]; + if ((*bp >> 3) >= inlength) { + Inflator_error = 51; // error, bit pointer will jump past memory + return; + } + length += Zlib_readBitsFromStream(bp, in, numextrabits); + uint32_t codeD = Inflator_huffmanDecodeSymbol(in, bp, codetreeD, inlength); + if (Inflator_error) + return; + if (codeD > 29) { + Inflator_error = 18; // error: invalid dist code (30-31 are never used) + return; + } + uint32_t dist = DISTBASE[codeD], numextrabitsD = DISTEXTRA[codeD]; + if ((*bp >> 3) >= inlength) { + Inflator_error = 51; // error, bit pointer will jump past memory + return; + } + dist += Zlib_readBitsFromStream(bp, in, numextrabitsD); + size_t start = *pos, back = start - dist; // backwards + if (*pos + length >= out->size) + vector8_resize(out, (*pos + length) * 2); // reserve more room + size_t i; + for (i = 0; i < length; i++) { + out->data[(*pos)++] = out->data[back++]; + if (back >= start) + back = start - dist; + } + } + } +} + +void Inflator_inflateNoCompression(vector8_t *out, const uint8_t *in, size_t *bp, size_t *pos, + size_t inlength) +{ + while ((*bp & 0x7) != 0) + (*bp)++; // go to first boundary of byte + size_t p = *bp / 8; + if (p >= inlength - 4) { + Inflator_error = 52; // error, bit pointer will jump past memory + return; + } + uint32_t LEN = in[p] + 256 * in[p + 1], NLEN = in[p + 2] + 256 * in[p + 3]; + p += 4; + if (LEN + NLEN != 65535) { + Inflator_error = 21; // error: NLEN is not one's complement of LEN + return; + } + if (*pos + LEN >= out->size) + vector8_resize(out, *pos + LEN); + if (p + LEN > inlength) { + Inflator_error = 23; // error: reading outside of in buffer + return; + } + uint32_t n; + for (n = 0; n < LEN; n++) + out->data[(*pos)++] = in[p++]; // read LEN bytes of literal data + *bp = p * 8; +} + +void Inflator_inflate(vector8_t *out, const vector8_t *in, size_t inpos) +{ + size_t bp = 0, pos = 0; // bit pointer and byte pointer + Inflator_error = 0; + uint32_t BFINAL = 0; + while (!BFINAL && !Inflator_error) { + if (bp >> 3 >= in->size) { + Inflator_error = 52; // error, bit pointer will jump past memory + return; + } + BFINAL = Zlib_readBitFromStream(&bp, &in->data[inpos]); + uint32_t BTYPE = Zlib_readBitFromStream(&bp, &in->data[inpos]); + BTYPE += 2 * Zlib_readBitFromStream(&bp, &in->data[inpos]); + if (BTYPE == 3) { + Inflator_error = 20; // error: invalid BTYPE + return; + } + else if (BTYPE == 0) + Inflator_inflateNoCompression(out, &in->data[inpos], &bp, &pos, in->size); + else + Inflator_inflateHuffmanBlock(out, &in->data[inpos], &bp, &pos, in->size, BTYPE); + } + if (!Inflator_error) + vector8_resize(out, pos); // Only now we know the true size of out, resize it to that +} + +/*************************************************************************************************/ + +int Zlib_decompress(vector8_t *out, const vector8_t *in) // returns error value +{ + if (in->size < 2) + return 53; // error, size of zlib data too small + if ((in->data[0] * 256 + in->data[1]) % 31 != 0) + // error: 256 * in->data[0] + in->data[1] must be a multiple of 31, the FCHECK value is + // supposed to be made that way + return 24; + uint32_t CM = in->data[0] & 15, CINFO = (in->data[0] >> 4) & 15, FDICT = (in->data[1] >> 5) & 1; + if (CM != 8 || CINFO > 7) + // error: only compression method 8: inflate with sliding window of 32k is supported by + // the PNG spec + return 25; + if (FDICT != 0) + // error: the specification of PNG says about the zlib stream: "The additional flags shall + // not specify a preset dictionary." + return 26; + Inflator_inflate(out, in, 2); + return Inflator_error; // note: adler32 checksum was skipped and ignored +} + +/*************************************************************************************************/ + +#define PNG_SIGNATURE 0x0a1a0a0d474e5089ull + +#define CHUNK_IHDR 0x52444849 +#define CHUNK_IDAT 0x54414449 +#define CHUNK_IEND 0x444e4549 +#define CHUNK_PLTE 0x45544c50 +#define CHUNK_tRNS 0x534e5274 + +int PNG_error; + +uint32_t PNG_readBitFromReversedStream(size_t *bitp, const uint8_t *bits) +{ + uint32_t result = (bits[*bitp >> 3] >> (7 - (*bitp & 0x7))) & 1; + (*bitp)++; + return result; +} + +uint32_t PNG_readBitsFromReversedStream(size_t *bitp, const uint8_t *bits, uint32_t nbits) +{ + uint32_t i, result = 0; + for (i = nbits - 1; i < nbits; i--) + result += ((PNG_readBitFromReversedStream(bitp, bits)) << i); + return result; +} + +void PNG_setBitOfReversedStream(size_t *bitp, uint8_t *bits, uint32_t bit) +{ + bits[*bitp >> 3] |= (bit << (7 - (*bitp & 0x7))); + (*bitp)++; +} + +uint32_t PNG_read32bitInt(const uint8_t *buffer) +{ + return (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]; +} + +int PNG_checkColorValidity(uint32_t colorType, uint32_t bd) // return type is a LodePNG error code +{ + if ((colorType == 2 || colorType == 4 || colorType == 6)) { + if (!(bd == 8 || bd == 16)) + return 37; + else + return 0; + } else if (colorType == 0) { + if (!(bd == 1 || bd == 2 || bd == 4 || bd == 8 || bd == 16)) + return 37; + else + return 0; + } else if (colorType == 3) { + if (!(bd == 1 || bd == 2 || bd == 4 || bd == 8)) + return 37; + else + return 0; + } else + return 31; // nonexistent color type +} + +uint32_t PNG_getBpp(const PNG_info_t *info) +{ + uint32_t bitDepth, colorType; + bitDepth = info->bitDepth; + colorType = info->colorType; + if (colorType == 2) + return (3 * bitDepth); + else if (colorType >= 4) + return (colorType - 2) * bitDepth; + else + return bitDepth; +} + +void PNG_readPngHeader(PNG_info_t *info, const uint8_t *in, size_t inlength) +{ // read the information from the header and store it in the Info + if (inlength < 29) { + PNG_error = 27; // error: the data length is smaller than the length of the header + return; + } + if (*(uint64_t *) in != PNG_SIGNATURE) { + PNG_error = 28; // no PNG signature + return; + } + if (*(uint32_t *) &in[12] != CHUNK_IHDR) { + PNG_error = 29; // error: it doesn't start with a IHDR chunk! + return; + } + info->width = PNG_read32bitInt(&in[16]); + info->height = PNG_read32bitInt(&in[20]); + info->bitDepth = in[24]; + info->colorType = in[25]; + info->compressionMethod = in[26]; + if (in[26] != 0) { + PNG_error = 32; // error: only compression method 0 is allowed in the specification + return; + } + info->filterMethod = in[27]; + if (in[27] != 0) { + PNG_error = 33; // error: only filter method 0 is allowed in the specification + return; + } + info->interlaceMethod = in[28]; + if (in[28] > 1) { + PNG_error = 34; // error: only interlace methods 0 and 1 exist in the specification + return; + } + PNG_error = PNG_checkColorValidity(info->colorType, info->bitDepth); +} + +int PNG_paethPredictor(int a, int b, int c) // Paeth predicter, used by PNG filter type 4 +{ + int p, pa, pb, pc; + p = a + b - c; + pa = p > a ? (p - a) : (a - p); + pb = p > b ? (p - b) : (b - p); + pc = p > c ? (p - c) : (c - p); + return (pa <= pb && pa <= pc) ? a : (pb <= pc ? b : c); +} + +void PNG_unFilterScanline(uint8_t *recon, const uint8_t *scanline, const uint8_t *precon, + size_t bytewidth, uint32_t filterType, size_t length) +{ + size_t i; + switch (filterType) { + case 0: + for (i = 0; i < length; i++) + recon[i] = scanline[i]; + break; + case 1: + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + recon[i - bytewidth]; + break; + case 2: + if (precon) + for (i = 0; i < length; i++) + recon[i] = scanline[i] + precon[i]; + else + for (i = 0; i < length; i++) + recon[i] = scanline[i]; + break; + case 3: + if (precon) { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i] + precon[i] / 2; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) / 2); + } else { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = scanline[i] + recon[i - bytewidth] / 2; + } + break; + case 4: + if (precon) { + for (i = 0; i < bytewidth; i++) + recon[i] = (uint8_t) (scanline[i] + PNG_paethPredictor(0, precon[i], 0)); + for (i = bytewidth; i < length; i++) + recon[i] = (uint8_t) (scanline[i] + PNG_paethPredictor(recon[i - bytewidth], + precon[i], precon[i - bytewidth])); + } else { + for (i = 0; i < bytewidth; i++) + recon[i] = scanline[i]; + for (i = bytewidth; i < length; i++) + recon[i] = (uint8_t) (scanline[i] + PNG_paethPredictor(recon[i - bytewidth], 0, 0)); + } + break; + default: + PNG_error = 36; // error: nonexistent filter type given + return; + } +} + +void PNG_adam7Pass(uint8_t *out, uint8_t *linen, uint8_t *lineo, const uint8_t *in, uint32_t w, + size_t passleft, size_t passtop, size_t spacex, size_t spacey, size_t passw, size_t passh, + uint32_t bpp) +{ // filter and reposition the pixels into the output when the image is Adam7 interlaced. This + // function can only do it after the full image is already decoded. The out buffer must have + // the correct allocated memory size already. + if (passw == 0) + return; + size_t bytewidth = (bpp + 7) / 8, linelength = 1 + ((bpp * passw + 7) / 8); + uint32_t y; + for (y = 0; y < passh; y++) { + size_t i, b; + uint8_t filterType = in[y * linelength], *prevline = (y == 0) ? 0 : lineo; + PNG_unFilterScanline(linen, &in[y * linelength + 1], prevline, bytewidth, filterType, + (w * bpp + 7) / 8); + if (PNG_error) + return; + if (bpp >= 8) + for (i = 0; i < passw; i++) + for (b = 0; b < bytewidth; b++) // b = current byte of this pixel + out[bytewidth * w * (passtop + spacey * y) + bytewidth * + (passleft + spacex * i) + b] = linen[bytewidth * i + b]; + else + for (i = 0; i < passw; i++) { + size_t obp, bp; + obp = bpp * w * (passtop + spacey * y) + bpp * (passleft + spacex * i); + bp = i * bpp; + for (b = 0; b < bpp; b++) + PNG_setBitOfReversedStream(&obp, out, PNG_readBitFromReversedStream(&bp, linen)); + } + uint8_t *temp = linen; + linen = lineo; + lineo = temp; // swap the two buffer pointers "line old" and "line new" + } +} + +int PNG_convert(const PNG_info_t *info, vector8_t *out, const uint8_t *in) +{ // converts from any color type to 32-bit. return value = LodePNG error code + size_t i, c; + uint32_t bitDepth, colorType; + bitDepth = info->bitDepth; + colorType = info->colorType; + size_t numpixels = info->width * info->height, bp = 0; + vector8_resize(out, numpixels * 4); + uint8_t *out_data = out->size ? out->data : 0; + if (bitDepth == 8 && colorType == 0) // greyscale + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[i]; + out_data[4 * i + 3] = (info->key_defined && (in[i] == info->key_r)) ? 0 : 255; + } + else if (bitDepth == 8 && colorType == 2) // RGB color + for (i = 0; i < numpixels; i++) { + for (c = 0; c < 3; c++) + out_data[4 * i + c] = in[3 * i + c]; + out_data[4 * i + 3] = (info->key_defined && (in[3 * i + 0] == info->key_r) && + (in[3 * i + 1] == info->key_g) && (in[3 * i + 2] == info->key_b)) ? 0 : 255; + } + else if (bitDepth == 8 && colorType == 3) // indexed color (palette) + for (i = 0; i < numpixels; i++) { + if (4U * in[i] >= info->palette->size) + return 46; + for (c = 0; c < 4; c++) // get rgb colors from the palette + out_data[4 * i + c] = info->palette->data[4 * in[i] + c]; + } + else if (bitDepth == 8 && colorType == 4) // greyscale with alpha + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[2 * i + 0]; + out_data[4 * i + 3] = in[2 * i + 1]; + } + else if (bitDepth == 8 && colorType == 6) + for (i = 0; i < numpixels; i++) + for (c = 0; c < 4; c++) + out_data[4 * i + c] = in[4 * i + c]; // RGB with alpha + else if (bitDepth == 16 && colorType == 0) // greyscale + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[2 * i]; + out_data[4 * i + 3] = (info->key_defined && (256U * in[i] + in[i + 1] == info->key_r)) + ? 0 : 255; + } + else if (bitDepth == 16 && colorType == 2) // RGB color + for (i = 0; i < numpixels; i++) { + for (c = 0; c < 3; c++) + out_data[4 * i + c] = in[6 * i + 2 * c]; + out_data[4 * i + 3] = (info->key_defined && + (256U * in[6 * i + 0] + in[6 * i + 1] == info->key_r) && + (256U * in[6 * i + 2] + in[6 * i + 3] == info->key_g) && + (256U * in[6 * i + 4] + in[6 * i + 5] == info->key_b)) ? 0 : 255; + } + else if (bitDepth == 16 && colorType == 4) // greyscale with alpha + for (i = 0; i < numpixels; i++) { + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = in[4 * i]; // msb + out_data[4 * i + 3] = in[4 * i + 2]; + } + else if (bitDepth == 16 && colorType == 6) + for (i = 0; i < numpixels; i++) + for (c = 0; c < 4; c++) + out_data[4 * i + c] = in[8 * i + 2 * c]; // RGB with alpha + else if (bitDepth < 8 && colorType == 0) // greyscale + for (i = 0; i < numpixels; i++) { + uint32_t value = (PNG_readBitsFromReversedStream(&bp, in, bitDepth) * 255) / + ((1 << bitDepth) - 1); // scale value from 0 to 255 + out_data[4 * i + 0] = out_data[4 * i + 1] = out_data[4 * i + 2] = (uint8_t) value; + out_data[4 * i + 3] = (info->key_defined && value && + (((1U << bitDepth) - 1U) == info->key_r) && ((1U << bitDepth) - 1U)) ? 0 : 255; + } + else if (bitDepth < 8 && colorType == 3) // palette + for (i = 0; i < numpixels; i++) { + uint32_t value = PNG_readBitsFromReversedStream(&bp, in, bitDepth); + if (4 * value >= info->palette->size) + return 47; + for (c = 0; c < 4; c++) // get rgb colors from the palette + out_data[4 * i + c] = info->palette->data[4 * value + c]; + } + return 0; +} + +PNG_info_t *PNG_info_new() +{ + PNG_info_t *info = png_alloc_malloc(sizeof (PNG_info_t)); + uint32_t i; + for (i = 0; i < sizeof (PNG_info_t); i++) + ((uint8_t *) info)[i] = 0; + info->palette = vector8_new(0, 0); + info->image = vector8_new(0, 0); + return info; +} + +PNG_info_t *PNG_decode(const uint8_t *in, uint32_t size) +{ + PNG_info_t *info; + PNG_error = 0; + if (size == 0 || in == 0) { + PNG_error = 48; // the given data is empty + return NULL; + } + info = PNG_info_new(); + PNG_readPngHeader(info, in, size); + if (PNG_error) + return NULL; + size_t pos = 33; // first byte of the first chunk after the header + vector8_t *idat = NULL; // the data from idat chunks + bool IEND = false, known_type = true; + info->key_defined = false; + // loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. IDAT data is + // put at the start of the in buffer + while (!IEND) { + size_t i, j; + if (pos + 8 >= size) { + PNG_error = 30; // error: size of the in buffer too small to contain next chunk + return NULL; + } + size_t chunkLength = PNG_read32bitInt(&in[pos]); + pos += 4; + if (chunkLength > 0x7fffffff) { + PNG_error = 63; + return NULL; + } + if (pos + chunkLength >= size) { + PNG_error = 35; // error: size of the in buffer too small to contain next chunk + return NULL; + } + uint32_t chunkType = *(uint32_t *) &in[pos]; + if (chunkType == CHUNK_IDAT) { // IDAT: compressed image data chunk + size_t offset = 0; + if (idat) { + offset = idat->size; + vector8_resize(idat, offset + chunkLength); + } else + idat = vector8_new(chunkLength, 0); + for (i = 0; i < chunkLength; i++) + idat->data[offset + i] = in[pos + 4 + i]; + pos += (4 + chunkLength); + } else if (chunkType == CHUNK_IEND) { // IEND + pos += 4; + IEND = true; + } else if (chunkType == CHUNK_PLTE) { // PLTE: palette chunk + pos += 4; // go after the 4 letters + vector8_resize(info->palette, 4 * (chunkLength / 3)); + if (info->palette->size > (4 * 256)) { + PNG_error = 38; // error: palette too big + return NULL; + } + for (i = 0; i < info->palette->size; i += 4) { + for (j = 0; j < 3; j++) + info->palette->data[i + j] = in[pos++]; // RGB + info->palette->data[i + 3] = 255; // alpha + } + } else if (chunkType == CHUNK_tRNS) { // tRNS: palette transparency chunk + pos += 4; // go after the 4 letters + if (info->colorType == 3) { + if (4 * chunkLength > info->palette->size) { + PNG_error = 39; // error: more alpha values given than there are palette entries + return NULL; + } + for (i = 0; i < chunkLength; i++) + info->palette->data[4 * i + 3] = in[pos++]; + } else if (info->colorType == 0) { + if (chunkLength != 2) { + PNG_error = 40; // error: this chunk must be 2 bytes for greyscale image + return NULL; + } + info->key_defined = true; + info->key_r = info->key_g = info->key_b = 256 * in[pos] + in[pos + 1]; + pos += 2; + } else if (info->colorType == 2) { + if (chunkLength != 6) { + PNG_error = 41; // error: this chunk must be 6 bytes for RGB image + return NULL; + } + info->key_defined = true; + info->key_r = 256 * in[pos] + in[pos + 1]; + pos += 2; + info->key_g = 256 * in[pos] + in[pos + 1]; + pos += 2; + info->key_b = 256 * in[pos] + in[pos + 1]; + pos += 2; + } else { + PNG_error = 42; // error: tRNS chunk not allowed for other color models + return NULL; + } + } else { // it's not an implemented chunk type, so ignore it: skip over the data + if (!(in[pos + 0] & 32)) { + // error: unknown critical chunk (5th bit of first byte of chunk type is 0) + PNG_error = 69; + return NULL; + } + pos += (chunkLength + 4); // skip 4 letters and uninterpreted data of unimplemented chunk + known_type = false; + } + pos += 4; // step over CRC (which is ignored) + } + uint32_t bpp = PNG_getBpp(info); + vector8_t *scanlines; // now the out buffer will be filled + scanlines = vector8_new(((info->width * (info->height * bpp + 7)) / 8) + info->height, 0); + PNG_error = Zlib_decompress(scanlines, idat); + if (PNG_error) + return NULL; // stop if the zlib decompressor returned an error + size_t bytewidth = (bpp + 7) / 8, outlength = (info->height * info->width * bpp + 7) / 8; + vector8_resize(info->image, outlength); // time to fill the out buffer + uint8_t *out_data = outlength ? info->image->data : 0; + if (info->interlaceMethod == 0) { // no interlace, just filter + size_t y, obp, bp; + size_t linestart, linelength; + linestart = 0; + // length in bytes of a scanline, excluding the filtertype byte + linelength = (info->width * bpp + 7) / 8; + if (bpp >= 8) // byte per byte + for (y = 0; y < info->height; y++) { + uint32_t filterType = scanlines->data[linestart]; + const uint8_t *prevline; + prevline = (y == 0) ? 0 : &out_data[(y - 1) * info->width * bytewidth]; + PNG_unFilterScanline(&out_data[linestart - y], &scanlines->data[linestart + 1], + prevline, bytewidth, filterType, linelength); + if (PNG_error) + return NULL; + linestart += (1 + linelength); // go to start of next scanline + } else { // less than 8 bits per pixel, so fill it up bit per bit + vector8_t *templine; // only used if bpp < 8 + templine = vector8_new((info->width * bpp + 7) >> 3, 0); + for (y = 0, obp = 0; y < info->height; y++) { + uint32_t filterType = scanlines->data[linestart]; + const uint8_t *prevline; + prevline = (y == 0) ? 0 : &out_data[(y - 1) * info->width * bytewidth]; + PNG_unFilterScanline(templine->data, &scanlines->data[linestart + 1], prevline, + bytewidth, filterType, linelength); + if (PNG_error) + return NULL; + for (bp = 0; bp < info->width * bpp;) + PNG_setBitOfReversedStream(&obp, out_data, PNG_readBitFromReversedStream(&bp, + templine->data)); + linestart += (1 + linelength); // go to start of next scanline + } + } + } else { // interlaceMethod is 1 (Adam7) + int i; + size_t passw[7] = { + (info->width + 7) / 8, (info->width + 3) / 8, (info->width + 3) / 4, + (info->width + 1) / 4, (info->width + 1) / 2, (info->width + 0) / 2, + (info->width + 0) / 1 + }; + size_t passh[7] = { + (info->height + 7) / 8, (info->height + 7) / 8, (info->height + 3) / 8, + (info->height + 3) / 4, (info->height + 1) / 4, (info->height + 1) / 2, + (info->height + 0) / 2 + }; + size_t passstart[7] = { 0 }; + size_t pattern[28] = { 0, 4, 0, 2, 0, 1, 0, 0, 0, 4, 0, 2, 0, 1, 8, 8, 4, 4, 2, 2, 1, 8, 8, + 8, 4, 4, 2, 2 }; // values for the adam7 passes + for (i = 0; i < 6; i++) + passstart[i + 1] = passstart[i] + passh[i] * ((passw[i] ? 1 : 0) + (passw[i] * bpp + 7) / 8); + vector8_t *scanlineo, *scanlinen; // "old" and "new" scanline + scanlineo = vector8_new((info->width * bpp + 7) / 8, 0); + scanlinen = vector8_new((info->width * bpp + 7) / 8, 0); + for (i = 0; i < 7; i++) + PNG_adam7Pass(out_data, scanlinen->data, scanlineo->data, &scanlines->data[passstart[i]], + info->width, pattern[i], pattern[i + 7], pattern[i + 14], pattern[i + 21], + passw[i], passh[i], bpp); + } + if (info->colorType != 6 || info->bitDepth != 8) { // conversion needed + vector8_t *copy = vector8_copy(info->image); // xxx: is this copy necessary? + PNG_error = PNG_convert(info, info->image, copy->data); + } + return info; +} + +/*************************************************************************************************/ + +#ifdef TEST + +#include +#include + +int main(int argc, char **argv) +{ + char *fname = (argc > 1) ? argv[1] : "test.png"; + PNG_info_t *info; + struct stat statbuf; + uint32_t insize, outsize; + FILE *infp, *outfp; + uint8_t *inbuf; + uint32_t n; + + if (stat(fname, &statbuf) != 0) { + perror("stat"); + return 1; + } else if (!statbuf.st_size) { + printf("file empty\n"); + return 1; + } + insize = (uint32_t) statbuf.st_size; + inbuf = malloc(insize); + infp = fopen(fname, "rb"); + if (!infp) { + perror("fopen"); + return 1; + } else if (fread(inbuf, 1, insize, infp) != insize) { + perror("fread"); + return 1; + } + fclose(infp); + + printf("input file: %s (size: %d)\n", fname, insize); + + info = PNG_decode(inbuf, insize); + free(inbuf); + printf("PNG_error: %d\n", PNG_error); + if (PNG_error != 0) + return 1; + + printf("width: %d, height: %d\nfirst 16 bytes: ", info->width, info->height); + for (n = 0; n < 16; n++) + printf("%02x ", info->image->data[n]); + printf("\n"); + + outsize = info->width * info->height * 4; + printf("image size: %d\n", outsize); + if (outsize != info->image->size) { + printf("error: image size doesn't match dimensions\n"); + return 1; + } + outfp = fopen("out.bin", "wb"); + if (!outfp) { + perror("fopen"); + return 1; + } else if (fwrite(info->image->data, 1, outsize, outfp) != outsize) { + perror("fwrite"); + return 1; + } + fclose(outfp); + +#ifdef ALLOC_DEBUG + png_alloc_node_t *node; + for (node = png_alloc_head, n = 1; node; node = node->next, n++) + printf("node %d (%p) addr = %p, size = %ld\n", n, node, node->addr, node->size); +#endif + png_alloc_free_all(); // also frees info and image data from PNG_decode + + return 0; +} + +#endif diff --git a/i386/boot2/picopng.h b/i386/boot2/picopng.h new file mode 100644 index 0000000..66c2c9e --- /dev/null +++ b/i386/boot2/picopng.h @@ -0,0 +1,33 @@ +#ifndef _PICOPNG_H +#define _PICOPNG_H + +#include + +typedef struct { + uint32_t *data; + size_t size; + size_t allocsize; +} vector32_t; + +typedef struct { + uint8_t *data; + size_t size; + size_t allocsize; +} vector8_t; + +typedef struct { + uint32_t width, height; + uint32_t colorType, bitDepth; + uint32_t compressionMethod, filterMethod, interlaceMethod; + uint32_t key_r, key_g, key_b; + bool key_defined; // is a transparent color key given? + vector8_t *palette; + vector8_t *image; +} PNG_info_t; + +PNG_info_t *PNG_decode(const uint8_t *in, uint32_t size); +void png_alloc_free_all(); + +extern int PNG_error; + +#endif diff --git a/i386/boot2/prompt.c b/i386/boot2/prompt.c new file mode 100644 index 0000000..a3734cd --- /dev/null +++ b/i386/boot2/prompt.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include + +char bootBanner[] = "\nDarwin/x86 boot v" I386BOOT_VERSION " - Chimera v" I386BOOT_CHAMELEONVERSION " r" I386BOOT_CHAMELEONREVISION "\n" + "Build date: " I386BOOT_BUILDDATE "\n" + "%dMB memory\n"; + +char bootPrompt[] = + "Press Enter to start up Darwin/x86 with no options, or you can:\n" + " Type -v and press Enter to start up with diagnostic messages\n" + " Type ? and press Enter to learn about advanced startup options\n\n" + "boot: "; + +char bootRescanPrompt[] = + "Press Enter to start up Darwin/x86 with no options, or you can:\n" + " Press F5 after you swapped the media. The drive will be rescanned.\n" + " Type -v and press Enter to start up with diagnostic messages\n" + " Type ? and press Enter to learn about advanced startup options\n\n" + "boot: "; diff --git a/i386/boot2/ramdisk.c b/i386/boot2/ramdisk.c new file mode 100644 index 0000000..0f00a8a --- /dev/null +++ b/i386/boot2/ramdisk.c @@ -0,0 +1,309 @@ +/* + * Supplemental ramdisk functions for the multiboot ramdisk driver. + * Copyright 2009 Tamas Kosarszky. All rights reserved. + * + */ + +#include "boot.h" +#include "bootstruct.h" +#include "multiboot.h" +#include "ramdisk.h" + +struct multiboot_info * gRAMDiskMI = NULL; + +// gRAMDiskVolume holds the bvr for the mounted ramdisk image. +BVRef gRAMDiskVolume = NULL; +bool gRAMDiskBTAliased = false; +char gRAMDiskFile[512]; + +// Notify OS X that a ramdisk has been setup. XNU with attach this to /dev/md0 +void md0Ramdisk() +{ + RAMDiskParam ramdiskPtr; + char filename[512]; + const char* override_filename = 0; + int fh = -1; + int len; + + if(getValueForKey(kMD0Image, &override_filename, &len, + &bootInfo->chameleonConfig)) + { + // Use user specified md0 file + sprintf(filename, "%s", override_filename); + fh = open(filename, 0); + + if(fh < 0) + { + sprintf(filename, "rd(0,0)/Extra/%s", override_filename); + fh = open(filename, 0); + + if(fh < 0) + { + sprintf(filename, "/Extra/%s", override_filename); + fh = open(filename, 0); + } + } + } + + if(fh < 0) + { + sprintf(filename, "rd(0,0)/Extra/Postboot.img"); + fh = open(filename, 0); + + if(fh < 0) + { + sprintf(filename, "/Extra/Postboot.img"); // Check /Extra if not in rd(0,0) + fh = open(filename, 0); + } + } + + if (fh >= 0) + { + verbose("Enabling ramdisk %s\n", filename); + + ramdiskPtr.size = file_size(fh); + ramdiskPtr.base = AllocateKernelMemory(ramdiskPtr.size); + + if(ramdiskPtr.size && ramdiskPtr.base) + { + // Read new ramdisk image contents in kernel memory. + if (read(fh, (char*) ramdiskPtr.base, ramdiskPtr.size) == ramdiskPtr.size) + { + AllocateMemoryRange("RAMDisk", ramdiskPtr.base, ramdiskPtr.size, kBootDriverTypeInvalid); + Node* node = DT__FindNode("/chosen/memory-map", false); + if(node != NULL) + { + DT__AddProperty(node, "RAMDisk", sizeof(RAMDiskParam), (void*)&ramdiskPtr); + } + else + { + verbose("Unable to notify Mac OS X of the ramdisk %s.\n", filename); + } + } + else + { + verbose("Unable to read md0 image %s.\n", filename); + } + } + else + { + verbose("md0 image %s is empty.\n", filename); + } + + close(fh); + + } +} + +void umountRAMDisk() +{ + if (gRAMDiskMI != NULL) + { + // Release ramdisk BVRef and DiskBVMap. + struct DiskBVMap *oldMap = diskResetBootVolumes(0x100); + CacheReset(); + diskFreeMap(oldMap); + + // Free multiboot info and module structures. + if ((void *)gRAMDiskMI->mi_mods_addr != NULL) free((void *)gRAMDiskMI->mi_mods_addr); + if (gRAMDiskMI != NULL) free(gRAMDiskMI); + + // Reset multiboot structures. + gMI = gRAMDiskMI = NULL; + *gRAMDiskFile = '\0'; + + // Release ramdisk driver hooks. + p_get_ramdisk_info = NULL; + p_ramdiskReadBytes = NULL; + + // Reset ramdisk bvr + gRAMDiskVolume = NULL; + printf("\nunmounting: done"); + } +} + +int mountRAMDisk(const char * param) +{ + int fh = 0, ramDiskSize; + int error = 0; + + // Get file handle for ramdisk file. + fh = open(param, 0); + if (fh != -1) + { + printf("\nreading ramdisk image: %s", param); + + ramDiskSize = file_size(fh); + if (ramDiskSize > 0) + { + // Unmount previously mounted image if exists. + umountRAMDisk(); + + // Read new ramdisk image contents into PREBOOT_DATA area. + if (read(fh, (char *)PREBOOT_DATA, ramDiskSize) != ramDiskSize) error = -1; + } + else error = -1; + + close(fh); + } + else error = -1; + + if (error == 0) + { + // Save filename in gRAMDiskFile to display information. + strcpy(gRAMDiskFile, param); + + // Set gMI as well for the multiboot ramdisk driver hook. + gMI = gRAMDiskMI = malloc(sizeof(multiboot_info)); + struct multiboot_module * ramdisk_module = malloc(sizeof(multiboot_module)); + + // Fill in multiboot info and module structures. + if (gRAMDiskMI != NULL && ramdisk_module != NULL) + { + gRAMDiskMI->mi_mods_count = 1; + gRAMDiskMI->mi_mods_addr = (uint32_t)ramdisk_module; + ramdisk_module->mm_mod_start = PREBOOT_DATA; + ramdisk_module->mm_mod_end = PREBOOT_DATA + ramDiskSize; + + // Set ramdisk driver hooks. + p_get_ramdisk_info = &multiboot_get_ramdisk_info; + p_ramdiskReadBytes = &multibootRamdiskReadBytes; + + int partCount; // unused + // Save bvr of the mounted image. + gRAMDiskVolume = diskScanBootVolumes(0x100, &partCount); + if(gRAMDiskVolume == NULL) + { + umountRAMDisk(); + printf("\nRamdisk contains no partitions."); + } + else + { + char dirSpec[128]; + + // Reading ramdisk configuration. + strcpy(dirSpec, RAMDISKCONFIG_FILENAME); + + if (loadConfigFile(dirSpec, &bootInfo->ramdiskConfig) == 0) + { + getBoolForKey("BTAlias", &gRAMDiskBTAliased, &bootInfo->ramdiskConfig); + } + else + { + printf("\nno ramdisk config...\n"); + } + + printf("\nmounting: done"); + } + } + } + + return error; +} + +void setRAMDiskBTHook(bool mode) +{ + gRAMDiskBTAliased = mode; + if (mode) + { + printf("\nEnabled bt(0,0) alias."); + } + else + { + printf("\nDisabled bt(0,0) alias."); + } +} + +void showInfoRAMDisk(void) +{ + int len; + const char *val; + + if (gRAMDiskMI != NULL) + { + struct multiboot_module * ramdisk_module = (void *)gRAMDiskMI->mi_mods_addr; + + printf("\nfile: %s %d", gRAMDiskFile, + ramdisk_module->mm_mod_end - ramdisk_module->mm_mod_start); + printf("\nalias: %s", gRAMDiskBTAliased ? "enabled" : "disabled"); + + // Display ramdisk information if available. + if (getValueForKey("Info", &val, &len, &bootInfo->ramdiskConfig)) + { + printf("\ninfo: %s", val); + } + else + { + printf("\nramdisk info not available."); + } + } + else + { + printf("\nNo ramdisk mounted."); + } +} + +int loadPrebootRAMDisk() +{ + mountRAMDisk("bt(0,0)/Extra/Preboot.dmg"); + if (gRAMDiskMI != NULL) + { + printf("\n"); + return 0; + } + else + { + return -1; + } +} + +void processRAMDiskCommand(char ** argPtr, const char * cmd) +{ + char * ptr = *argPtr; + char param[1024]; + getNextArg(&ptr, param); + + if (strcmp(cmd, "m") == 0) + { + mountRAMDisk(param); + sleep(2); + } + else if (strcmp(cmd, "u") == 0) + { + umountRAMDisk(); + sleep(2); + } + else if (strcmp(cmd, "e") == 0) + { + setRAMDiskBTHook(true); + sleep(2); + } + else if (strcmp(cmd, "d") == 0) + { + setRAMDiskBTHook(false); + sleep(2); + } + else if (strcmp(cmd, "i") == 0) + { + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + showInfoRAMDisk(); + printf("\n\nPress any key to continue.\n"); + getchar(); + setActiveDisplayPage(0); + } + else + { + setActiveDisplayPage(1); + clearScreenRows(0, 24); + setCursorPosition(0, 0, 1); + printf("\nusage:\n"); + printf("\n?rd i - display ramdisk information"); + printf("\n?rd m - mount ramdisk image\n?rd u - unmount ramdisk image"); + printf("\n?rd e - enable bt(0,0) alias\n?rd d - disable bt(0,0) alias"); + printf("\n\nPress any key to continue.\n"); + getchar(); + setActiveDisplayPage(0); + } +} diff --git a/i386/boot2/ramdisk.h b/i386/boot2/ramdisk.h new file mode 100644 index 0000000..44845a6 --- /dev/null +++ b/i386/boot2/ramdisk.h @@ -0,0 +1,36 @@ +/* + * Supplemental ramdisk functions for the multiboot ramdisk driver + * Copyright 2009 Tamas Kosarszky. All rights reserved. + * + */ + +#ifndef __BOOT_RAMDISK_H +#define __BOOT_RAMDISK_H + +#define RAMDISKCONFIG_FILENAME "rd(0,0)/RAMDisk.plist" +//#define kPostbootRamdisk +void md0Ramdisk(); + +typedef struct RAMDiskParam +{ + ppnum_t base; + unsigned int size; +} RAMDiskParam; + +/* mboot.c */ +extern struct multiboot_info *gMI; +extern int multibootRamdiskReadBytes( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ); +extern int multiboot_get_ramdisk_info(int biosdev, struct driveInfo *dip); +// + +extern BVRef gRAMDiskVolume; +extern bool gRAMDiskBTAliased; + +extern void setRAMDiskBTHook(bool mode); +extern int mountRAMDisk(const char * param); +extern void processRAMDiskCommand(char ** argPtr, const char * cmd); +extern int loadPrebootRAMDisk(); + +#endif /* !__BOOT_RAMDISK_H */ diff --git a/i386/boot2/resume.c b/i386/boot2/resume.c new file mode 100644 index 0000000..8498010 --- /dev/null +++ b/i386/boot2/resume.c @@ -0,0 +1,215 @@ +/* + * resume.c + * + * + * Created by mackerintel on 1/22/09. + * Copyright 2009 mackerintel. All rights reserved. + * + */ + +#include "saio_internal.h" +#include "libsa.h" +#include "IOHibernatePrivate.h" +#include "memory.h" +#include "bootstruct.h" +#include "boot.h" +#include "pci.h" + +extern int previewTotalSectors; +extern int previewLoadedSectors; +extern uint8_t *previewSaveunder; + +static unsigned long +getmemorylimit(void) +{ + int line; + int i; + MemoryRange *mp = bootInfo->memoryMap; + + // Activate and clear page 1 + line = 1; + for (i = 0; i < bootInfo->memoryMapCount; i++) + { + if((mp->type == 1) && ((unsigned long)mp->base == 0x100000)) + { + return (unsigned long)(mp->base + mp->length); + } + mp++; + } + return 0x10000000; +} + +static void WakeKernel(IOHibernateImageHeader * header) +{ + uint32_t proc; + unsigned long cnt, newSP; + unsigned long *src, *dst; + unsigned int count; + unsigned int page; + unsigned int compressedSize; + int32_t byteCnt; + u_int32_t lowHalf, highHalf; + u_int32_t sum; + + printf("\nWake Kernel!\n"); + + dst = (unsigned long *) (header->restore1CodePage << 12); + count = header->restore1PageCount; + proc = (header->restore1CodeOffset + ((uint32_t) dst)); + newSP = header->restore1StackOffset + (header->restore1CodePage << 12); + + src = (unsigned long *) (((u_int32_t) &header->fileExtentMap[0]) + + header->fileExtentMapSize); + sum = 0; + + for (page = 0; page < count; page++) + { + compressedSize = 4096; + + lowHalf = 1; + highHalf = 0; + + for (cnt = 0; cnt < compressedSize; cnt += 0x20) { + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; + for (byteCnt = 0; byteCnt < 0x20; byteCnt++) { + lowHalf += ((u_int8_t *) dst)[byteCnt]; + highHalf += lowHalf; + } + src += 8; + dst += 8; + } + + lowHalf %= 65521L; + highHalf %= 65521L; + sum += (highHalf << 16) | lowHalf; + } + header->actualRestore1Sum = sum; + startprog (proc, header); + + return; +} + +void HibernateBoot(char *image_filename) +{ + long long size, imageSize, codeSize, allocSize; + long mem_base; + IOHibernateImageHeader _header; + IOHibernateImageHeader * header = &_header; + long buffer; + + size = ReadFileAtOffset (image_filename, header, 0, sizeof(IOHibernateImageHeader)); + printf("header read size %x\n", size); + + imageSize = header->image1Size; + codeSize = header->restore1PageCount << 12; + if (kIOHibernateHeaderSignature != header->signature) + { + printf ("Incorrect image signature\n"); + return; + } + if (header->encryptStart) + { + printf ("Resuming from Encrypted image is unsupported.\n" + "Uncheck \"Use secure virtual memory\" in \"Security\" pane on system preferences.\n" + "Press any key to proceed with normal boot.\n"); + getchar(); + return; + } +// depends on NVRAM +#if 0 + { + uint32_t machineSignature; + size = GetProp(gChosenPH, kIOHibernateMachineSignatureKey, + (char *)&machineSignature, sizeof(machineSignature)); + if (size != sizeof(machineSignature)) machineSignature = 0; + if (machineSignature != header->machineSignature) + break; + } +#endif + + allocSize = imageSize + ((4095 + sizeof(hibernate_graphics_t)) & ~4095); + + mem_base = getmemorylimit() - allocSize;//TODO: lower this + + printf("mem_base %x\n", mem_base); + if (((long long)mem_base + allocSize) < (1024 * bootInfo->extmem + 0x100000)) + { + printf ("Not enough space to restore image. Press any key to proceed with normal boot.\n"); + getchar(); + return; + } + + bcopy(header, (void *) mem_base, sizeof(IOHibernateImageHeader)); + header = (IOHibernateImageHeader *) mem_base; + + imageSize -= sizeof(IOHibernateImageHeader); + buffer = (long)(header + 1); + + if (header->previewSize) + { + uint64_t preview_offset = header->fileExtentMapSize - sizeof(header->fileExtentMap) + codeSize; + uint8_t progressSaveUnder[kIOHibernateProgressCount][kIOHibernateProgressSaveUnderSize]; + + ReadFileAtOffset (image_filename, (char *)buffer, sizeof(IOHibernateImageHeader), preview_offset+header->previewSize); + drawPreview ((void *)(long)(buffer+preview_offset + header->previewPageListSize), &(progressSaveUnder[0][0])); + previewTotalSectors = (imageSize-(preview_offset+header->previewSize))/512; + previewLoadedSectors = 0; + previewSaveunder = &(progressSaveUnder[0][0]); + if (preview_offset+header->previewSizepreviewSize), + sizeof(IOHibernateImageHeader)+preview_offset+header->previewSize, + imageSize-(preview_offset+header->previewSize)); + previewTotalSectors = 0; + previewLoadedSectors = 0; + previewSaveunder = 0; +#if 0 + AsereBLN: + check_vga_nvidia() didn't work as expected (recursion level > 0 & return value). + Unforutnaltely I cannot find a note why to switch back to text mode for nVidia cards only + and because it check_vga_nvidia does not work (cards normally are behind a bridge) I will + remove it completely + setVideoMode( VGA_TEXT_MODE, 0 ); +#endif + } + else + ReadFileAtOffset (image_filename, (char *)buffer, sizeof(IOHibernateImageHeader), imageSize); + +// Depends on NVRAM +#if 0 + if (header->encryptStart) { + // decryption data + static const unsigned char first_iv[AES_BLOCK_SIZE] + = { 0xa3, 0x63, 0x65, 0xa9, 0x0b, 0x71, 0x7b, 0x1c, + 0xdf, 0x9e, 0x5f, 0x32, 0xd7, 0x61, 0x63, 0xda }; + hibernate_cryptvars_t _cryptvars; + hibernate_cryptvars_t * cryptvars = &_cryptvars; + + aes_decrypt_key(&decryptkey, + decryptkeysize, + &cryptvars->ctx.decrypt); + + // set the vector for the following decryptions + bcopy(((uint8_t *) header) + header->image1Size - AES_BLOCK_SIZE, + &cryptvars->aes_iv[0], AES_BLOCK_SIZE); + + // decrypt the buffer + uint32_t len = (uint32_t)(header->image1Size - header->encryptStart); + aes_decrypt_cbc(((uint8_t *) header) + header->encryptStart, + &first_iv[0], + len >> 4, + ((uint8_t *) header) + header->encryptStart, + &cryptvars->ctx.decrypt); + bzero(&cryptvars->aes_iv[0], sizeof(cryptvars)); + bzero(&decryptkey, sizeof(decryptkey)); + } +#endif + + WakeKernel(header); +} diff --git a/i386/cdboot/.svn/all-wcprops b/i386/cdboot/.svn/all-wcprops new file mode 100644 index 0000000..6e83e7d --- /dev/null +++ b/i386/cdboot/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/cdboot +END +cdboot.s +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/cdboot/cdboot.s +END +cdboothdd.s +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/cdboot/cdboothdd.s +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/cdboot/Makefile +END diff --git a/i386/cdboot/.svn/entries b/i386/cdboot/.svn/entries new file mode 100644 index 0000000..0dee767 --- /dev/null +++ b/i386/cdboot/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/cdboot +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +cdboot.s +file + + + + +2013-08-27T23:55:05.000000Z +00448887e0ec26587b977a3c4ab84fd5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13780 + +cdboothdd.s +file + + + + +2013-08-27T23:55:05.000000Z +cd539169b4fe0251121c1a400c9fcded +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12284 + +Makefile +file + + + + +2013-08-27T23:55:05.000000Z +ba4fcf314cce9110eece37842a3f0ff8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +918 + diff --git a/i386/cdboot/.svn/text-base/Makefile.svn-base b/i386/cdboot/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..aae8c5f --- /dev/null +++ b/i386/cdboot/.svn/text-base/Makefile.svn-base @@ -0,0 +1,30 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/cdboot +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = cdboot +include ${SRCROOT}/Make.rules + +INSTALLDIR = $(DSTROOT)/usr/standalone/i386 +DIRS_NEEDED = $(SYMROOT) + +all embedtheme optionrom: $(DIRS_NEEDED) $(SYMROOT)/cdboot + +$(SYMROOT)/cdboot: + @echo "\t[NASM] cdboot.s" + @$(NASM) cdboot.s -o $(SYMROOT)/cdboot + @dd if=$(SYMROOT)/boot of=$(SYMROOT)/cdboot conv=sync bs=2k seek=1 &> /dev/null + + @# Update cdboot with boot file size info + @stat -f%z $(SYMROOT)/boot \ + | perl -ane "print pack('V',@F[0]);" \ + | dd of=$(SYMROOT)/cdboot bs=1 count=4 seek=2044 conv=notrunc &> /dev/null + +clean-local: + @if [ -f "$(SYMROOT)/cdboot" ];then echo "\t[RM] $(SYMROOT)/cdboot"; fi + @rm -f $(SYMROOT)/cdboot diff --git a/i386/cdboot/.svn/text-base/cdboot.s.svn-base b/i386/cdboot/.svn/text-base/cdboot.s.svn-base new file mode 100644 index 0000000..5d75a40 --- /dev/null +++ b/i386/cdboot/.svn/text-base/cdboot.s.svn-base @@ -0,0 +1,596 @@ +; Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ + +; +; This version of cdboot loads 256k of data. +; +; Modifications by Tams Kosrszky on 2008-10-20 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro DebugPauseMacro 0 + push ax + call getc + pop ax +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define DebugPause(x) DebugPauseMacro + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define DebugPause(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +maxSectorCount EQU 8 ; maximum sector count for readSectors +CDBootSizeMagic EQU 0xDEADFACE ; indicates if the size field was not specificed + ; at build time. +kSectorBytes EQU 2048 ; sector size in bytes +kBoot2Size EQU 65024 ; default load size for boot2 +kBoot2MaxSize EQU 458240 ; max size for boot2 +kBoot2Address EQU 0x0200 ; boot2 load address +kBoot2Segment EQU 0x2000 ; boot2 load segment + +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer + +kReadBuffer EQU 0x1000 ; disk data buffer address + +kVolSectorOffset EQU 0x47 ; offset in buffer of sector number + ; in volume descriptor +kBootSectorOffset EQU 0x28 ; offset in boot catalog + ; of sector number to load boot file +kBootCountOffset EQU 0x26 ; offset in boot catalog + ; of number of sectors to read +kCDBootSizeOffset EQU 2048 - 4 ; the file size can be found at the + ; last dword of this sector. + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG 0x7C00 + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; + +start: + cli + jmp 0:start1 + times 8-($-$$) nop ; Put boot information table at offset 8 + +; El Torito boot information table, filled in by the +; mkisofs -boot-info-table option, if used. +bi_pvd: dd 0 ; LBA of primary volume descriptor +bi_file: dd 0 ; LBA of boot file +bi_length: dd 0 ; Length of boot file +bi_csum: dd 0 ; Checksum of boot file +bi_reserved: times 10 dd 0 ; Reserved + +start1: + xor ax, ax ; zero %ax + mov ss, ax ; setup the + mov sp, kBoot0Stack ; stack + sti + cld ; increment SI after each lodsb call + mov ds, ax ; setup the + mov es, ax ; data segments + +%if VERBOSE + LogString(init_str) +%endif + + ;; BIOS boot drive is in DL + mov [gBIOSDriveNumber], dl ; save BIOS drive number + + DebugChar('!') + DebugPause() + +%if DEBUG + mov eax, [kBoot2LoadAddr] + call print_hex + call getc +%endif + + ;; + ;; The BIOS likely didn't load the rest of the booter, + ;; so we have to fetch it ourselves. + ;; + mov edx, kReadBuffer + mov al, 1 + mov ecx, 17 + call readLBA + jc NEAR error + + DebugChar('A') + + mov ecx, [kReadBuffer + kVolSectorOffset] + +%if DEBUG + mov eax, ecx + call print_hex + DebugPause() +%endif + + mov al, 1 + call readLBA + jc error + + ;; Now we have the boot catalog in the buffer. + ;; Really we should look at the validation entry, but oh well. + + DebugChar('B') + + mov ecx, [kReadBuffer + kBootSectorOffset] + mov al, 1 + call readLBA ; reading this boot sector + + inc ecx ; skip the first sector which is what we are in + +%if DEBUG + mov eax, ecx + call print_hex + DebugPause() +%endif + + ; + ; Testing cdboot size + ; + + mov eax, [kReadBuffer + kCDBootSizeOffset] + or eax, eax + jz .useDefaultSize ; use the default size if zero + cmp eax, CDBootSizeMagic + je .useDefaultSize ; use the default size if equals to magic + cmp eax, kBoot2MaxSize + jbe .calcSectors ; use the actual size + +.useDefaultSize: + + mov eax, kBoot2Size + +%if VERBOSE + LogString(defaultsize_str) +%endif + +.calcSectors: + +%if VERBOSE + LogString(size_str) + call print_hex +%endif + + add eax, kSectorBytes - 1 ; adjust size before unit conversion + shr eax, 11 ; convert file size to CD sector unit + +%if VERBOSE + LogString(read_str) + call print_hex +%endif + +%if VERBOSE + LogString(loading_str) +%endif + + mov edx, (kBoot2Segment << 4) + kBoot2Address + call readSectors + jc error + + DebugChar('C') + +%if DEBUG + mov eax, [es:kBoot2Address] + call print_hex + DebugPause() +%endif + + DebugChar('X') + DebugPause() + + ;; Jump to newly-loaded booter + +%if VERBOSE + LogString(done_str) +%endif + +%if UNUSED + LogString(keypress_str) + call getc +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +error: + +%if VERBOSE + LogString(error_str) +%endif + +.loop: + hlt + jmp .loop + +;; +;; Support functions +;; + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 2048-byte sectors to read (valid from 1-320). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + mov al, '.' + call print_char + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc .exit + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl eax, 11 ; convert CD sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [gBIOSDriveNumber] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [gBIOSDriveNumber] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + +%if VERBOSE + LogString(readerror_str) + mov eax, ecx + call print_hex +%endif + + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +;-------------------------------------------------------------------------- +; Write a string with 'cdboot: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +;%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'cdboot: ', NULL +init_str db 'init', NULL +defaultsize_str db 'using default size', NULL +size_str db 'file size: ', NULL +read_str db 'reading sectors: ', NULL +loading_str db 'loading', NULL +done_str db 'done', NULL +readerror_str db 'BIOS disk read error at sector: ', NULL +error_str db 'error', NULL +%endif + +%if UNUSED +keypress_str db 'Press any key to continue...', NULL +%endif + + +;; Pad this file to a size of 2048 bytes (one CD sector). +pad: + times 2044-($-$$) db 0 + +CDBootSize dd CDBootSizeMagic + +;; Location of loaded boot2 code. +kBoot2LoadAddr equ $ + +; +; Global variables +; + + ABSOLUTE kReadBuffer + kSectorBytes + +gBIOSDriveNumber resw 1 + +; END diff --git a/i386/cdboot/.svn/text-base/cdboothdd.s.svn-base b/i386/cdboot/.svn/text-base/cdboothdd.s.svn-base new file mode 100644 index 0000000..7488585 --- /dev/null +++ b/i386/cdboot/.svn/text-base/cdboothdd.s.svn-base @@ -0,0 +1,502 @@ +; Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ + +; +; This version of cdboot loads the MBR of bios drive 0x80. +; +; Modifications by Tams Kosrszky on 2009-03-30 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro DebugPauseMacro 0 + push ax + call getc + pop ax +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define DebugPause(x) DebugPauseMacro + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define DebugPause(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address +kSectorBytes EQU 2048 ; sector size in bytes +maxSectorCount EQU 32 ; maximum sector count for readSectors + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; + +start: + cli + jmp start1 + times 8-($-$$) nop ; Put boot information table at offset 8 + +; El Torito boot information table, filled in by the +; mkisofs -boot-info-table option, if used. +bi_pvd: dd 0 ; LBA of primary volume descriptor +bi_file: dd 0 ; LBA of boot file +bi_length: dd 0 ; Length of boot file +bi_csum: dd 0 ; Checksum of boot file +bi_reserved: times 10 dd 0 ; Reserved + +;-------------------------------------------------------------------------- + +start1: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + +%if VERBOSE + LogString(init_str) +%endif + +%if VERBOSE + LogString(read_str) +%endif + + ; forcing BIOS Int 13h operations to use drive 0x80 + mov WORD [gBIOSDriveNumber], 0x80 ; save BIOS drive number + mov al, 1 + mov edx, kBoot0LoadAddr ; load MBR code to 0x7C00 + mov ecx, 0 ; load sector 0 of drive 0x80 + call readLBA + +%if VERBOSE + LogString(done_str) +%endif + +%if UNUSED + LogString(keypress_str) + call getc +%endif + + ; Jump to newly-loaded booter + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot0Segment:kBoot0LoadAddr + +error: + +%if VERBOSE + LogString(error_str) +%endif + +.loop: + hlt + jmp .loop + +;; +;; Support functions +;; + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 2048-byte sectors to read (valid from 1-320). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + mov al, '.' + call print_char + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc .exit + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl eax, 11 ; convert CD sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [gBIOSDriveNumber] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [gBIOSDriveNumber] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + +%if VERBOSE + LogString(readerror_str) + mov eax, ecx + call print_hex +%endif + + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +;-------------------------------------------------------------------------- +; Write a string with 'cdboot: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +;%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'cdboot: ', NULL +init_str db 'init', NULL +read_str db 'reading MBR from device 0x80', NULL +done_str db 'done', NULL +readerror_str db 'BIOS disk read error at sector: ', NULL +error_str db 'error', NULL +%endif + +%if UNUSED +keypress_str db 'Press any key to continue...', NULL +%endif + + +;; Pad this file to a size of 2048 bytes (one CD sector). +pad: + times 2048-($-$$) db 0 + +; +; Global variables +; + + ABSOLUTE kBoot0RelocAddr + kSectorBytes + +gBIOSDriveNumber resw 1 + +; END diff --git a/i386/cdboot/Makefile b/i386/cdboot/Makefile new file mode 100644 index 0000000..aae8c5f --- /dev/null +++ b/i386/cdboot/Makefile @@ -0,0 +1,30 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/cdboot +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = cdboot +include ${SRCROOT}/Make.rules + +INSTALLDIR = $(DSTROOT)/usr/standalone/i386 +DIRS_NEEDED = $(SYMROOT) + +all embedtheme optionrom: $(DIRS_NEEDED) $(SYMROOT)/cdboot + +$(SYMROOT)/cdboot: + @echo "\t[NASM] cdboot.s" + @$(NASM) cdboot.s -o $(SYMROOT)/cdboot + @dd if=$(SYMROOT)/boot of=$(SYMROOT)/cdboot conv=sync bs=2k seek=1 &> /dev/null + + @# Update cdboot with boot file size info + @stat -f%z $(SYMROOT)/boot \ + | perl -ane "print pack('V',@F[0]);" \ + | dd of=$(SYMROOT)/cdboot bs=1 count=4 seek=2044 conv=notrunc &> /dev/null + +clean-local: + @if [ -f "$(SYMROOT)/cdboot" ];then echo "\t[RM] $(SYMROOT)/cdboot"; fi + @rm -f $(SYMROOT)/cdboot diff --git a/i386/cdboot/cdboot.s b/i386/cdboot/cdboot.s new file mode 100644 index 0000000..5d75a40 --- /dev/null +++ b/i386/cdboot/cdboot.s @@ -0,0 +1,596 @@ +; Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ + +; +; This version of cdboot loads 256k of data. +; +; Modifications by Tams Kosrszky on 2008-10-20 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro DebugPauseMacro 0 + push ax + call getc + pop ax +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define DebugPause(x) DebugPauseMacro + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define DebugPause(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +maxSectorCount EQU 8 ; maximum sector count for readSectors +CDBootSizeMagic EQU 0xDEADFACE ; indicates if the size field was not specificed + ; at build time. +kSectorBytes EQU 2048 ; sector size in bytes +kBoot2Size EQU 65024 ; default load size for boot2 +kBoot2MaxSize EQU 458240 ; max size for boot2 +kBoot2Address EQU 0x0200 ; boot2 load address +kBoot2Segment EQU 0x2000 ; boot2 load segment + +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer + +kReadBuffer EQU 0x1000 ; disk data buffer address + +kVolSectorOffset EQU 0x47 ; offset in buffer of sector number + ; in volume descriptor +kBootSectorOffset EQU 0x28 ; offset in boot catalog + ; of sector number to load boot file +kBootCountOffset EQU 0x26 ; offset in boot catalog + ; of number of sectors to read +kCDBootSizeOffset EQU 2048 - 4 ; the file size can be found at the + ; last dword of this sector. + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG 0x7C00 + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; + +start: + cli + jmp 0:start1 + times 8-($-$$) nop ; Put boot information table at offset 8 + +; El Torito boot information table, filled in by the +; mkisofs -boot-info-table option, if used. +bi_pvd: dd 0 ; LBA of primary volume descriptor +bi_file: dd 0 ; LBA of boot file +bi_length: dd 0 ; Length of boot file +bi_csum: dd 0 ; Checksum of boot file +bi_reserved: times 10 dd 0 ; Reserved + +start1: + xor ax, ax ; zero %ax + mov ss, ax ; setup the + mov sp, kBoot0Stack ; stack + sti + cld ; increment SI after each lodsb call + mov ds, ax ; setup the + mov es, ax ; data segments + +%if VERBOSE + LogString(init_str) +%endif + + ;; BIOS boot drive is in DL + mov [gBIOSDriveNumber], dl ; save BIOS drive number + + DebugChar('!') + DebugPause() + +%if DEBUG + mov eax, [kBoot2LoadAddr] + call print_hex + call getc +%endif + + ;; + ;; The BIOS likely didn't load the rest of the booter, + ;; so we have to fetch it ourselves. + ;; + mov edx, kReadBuffer + mov al, 1 + mov ecx, 17 + call readLBA + jc NEAR error + + DebugChar('A') + + mov ecx, [kReadBuffer + kVolSectorOffset] + +%if DEBUG + mov eax, ecx + call print_hex + DebugPause() +%endif + + mov al, 1 + call readLBA + jc error + + ;; Now we have the boot catalog in the buffer. + ;; Really we should look at the validation entry, but oh well. + + DebugChar('B') + + mov ecx, [kReadBuffer + kBootSectorOffset] + mov al, 1 + call readLBA ; reading this boot sector + + inc ecx ; skip the first sector which is what we are in + +%if DEBUG + mov eax, ecx + call print_hex + DebugPause() +%endif + + ; + ; Testing cdboot size + ; + + mov eax, [kReadBuffer + kCDBootSizeOffset] + or eax, eax + jz .useDefaultSize ; use the default size if zero + cmp eax, CDBootSizeMagic + je .useDefaultSize ; use the default size if equals to magic + cmp eax, kBoot2MaxSize + jbe .calcSectors ; use the actual size + +.useDefaultSize: + + mov eax, kBoot2Size + +%if VERBOSE + LogString(defaultsize_str) +%endif + +.calcSectors: + +%if VERBOSE + LogString(size_str) + call print_hex +%endif + + add eax, kSectorBytes - 1 ; adjust size before unit conversion + shr eax, 11 ; convert file size to CD sector unit + +%if VERBOSE + LogString(read_str) + call print_hex +%endif + +%if VERBOSE + LogString(loading_str) +%endif + + mov edx, (kBoot2Segment << 4) + kBoot2Address + call readSectors + jc error + + DebugChar('C') + +%if DEBUG + mov eax, [es:kBoot2Address] + call print_hex + DebugPause() +%endif + + DebugChar('X') + DebugPause() + + ;; Jump to newly-loaded booter + +%if VERBOSE + LogString(done_str) +%endif + +%if UNUSED + LogString(keypress_str) + call getc +%endif + + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot2Segment:kBoot2Address + +error: + +%if VERBOSE + LogString(error_str) +%endif + +.loop: + hlt + jmp .loop + +;; +;; Support functions +;; + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 2048-byte sectors to read (valid from 1-320). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + mov al, '.' + call print_char + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc .exit + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl eax, 11 ; convert CD sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [gBIOSDriveNumber] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [gBIOSDriveNumber] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + +%if VERBOSE + LogString(readerror_str) + mov eax, ecx + call print_hex +%endif + + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +;-------------------------------------------------------------------------- +; Write a string with 'cdboot: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +;%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'cdboot: ', NULL +init_str db 'init', NULL +defaultsize_str db 'using default size', NULL +size_str db 'file size: ', NULL +read_str db 'reading sectors: ', NULL +loading_str db 'loading', NULL +done_str db 'done', NULL +readerror_str db 'BIOS disk read error at sector: ', NULL +error_str db 'error', NULL +%endif + +%if UNUSED +keypress_str db 'Press any key to continue...', NULL +%endif + + +;; Pad this file to a size of 2048 bytes (one CD sector). +pad: + times 2044-($-$$) db 0 + +CDBootSize dd CDBootSizeMagic + +;; Location of loaded boot2 code. +kBoot2LoadAddr equ $ + +; +; Global variables +; + + ABSOLUTE kReadBuffer + kSectorBytes + +gBIOSDriveNumber resw 1 + +; END diff --git a/i386/cdboot/cdboothdd.s b/i386/cdboot/cdboothdd.s new file mode 100644 index 0000000..7488585 --- /dev/null +++ b/i386/cdboot/cdboothdd.s @@ -0,0 +1,502 @@ +; Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +; +; @APPLE_LICENSE_HEADER_START@ +; +; Portions Copyright (c) 2003 Apple Computer, Inc. All Rights +; Reserved. This file contains Original Code and/or Modifications of +; Original Code as defined in and that are subject to the Apple Public +; Source License Version 2.0 (the "License"). You may not use this file +; except in compliance with the License. Please obtain a copy of the +; License at http://www.apple.com/publicsource and read it before using +; this file. +; +; The Original Code and all software distributed under the License are +; distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +; EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +; INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +; FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the +; License for the specific language governing rights and limitations +; under the License. +; +; @APPLE_LICENSE_HEADER_END@ + +; +; This version of cdboot loads the MBR of bios drive 0x80. +; +; Modifications by Tams Kosrszky on 2009-03-30 +; + +; +; Set to 1 to enable obscure debug messages. +; +DEBUG EQU 0 + +; +; Set to 1 to enable unused code. +; +UNUSED EQU 0 + +; +; Set to 1 to enable verbose mode. +; +VERBOSE EQU 1 + +; +; Various constants. +; +NULL EQU 0 +CR EQU 0x0D +LF EQU 0x0A + +; +; Macros. +; +%macro jmpabs 1 + push WORD %1 + ret +%endmacro + +%macro DebugCharMacro 1 + pushad + mov al, %1 + call print_char + call getc + popad +%endmacro + +%macro DebugPauseMacro 0 + push ax + call getc + pop ax +%endmacro + +%macro PrintCharMacro 1 + pushad + mov al, %1 + call print_char + popad +%endmacro + +%macro PutCharMacro 1 + call print_char +%endmacro + +%macro PrintHexMacro 1 + call print_hex +%endmacro + +%macro PrintString 1 + mov si, %1 + call print_string +%endmacro + +%macro LogString 1 + mov di, %1 + call log_string +%endmacro + +%if DEBUG + %define DebugChar(x) DebugCharMacro x + %define DebugPause(x) DebugPauseMacro + %define PrintChar(x) PrintCharMacro x + %define PutChar(x) PutCharMacro + %define PrintHex(x) PrintHexMacro x +%else + %define DebugChar(x) + %define DebugPause(x) + %define PrintChar(x) + %define PutChar(x) + %define PrintHex(x) +%endif + +kBoot0Segment EQU 0x0000 +kBoot0Stack EQU 0xFFF0 ; boot0 stack pointer +kBoot0LoadAddr EQU 0x7C00 ; boot0 load address +kBoot0RelocAddr EQU 0xE000 ; boot0 relocated address +kSectorBytes EQU 2048 ; sector size in bytes +maxSectorCount EQU 32 ; maximum sector count for readSectors + +;-------------------------------------------------------------------------- +; Start of text segment. + + SEGMENT .text + + ORG kBoot0RelocAddr + +;-------------------------------------------------------------------------- +; Boot code is loaded at 0:7C00h. +; + +start: + cli + jmp start1 + times 8-($-$$) nop ; Put boot information table at offset 8 + +; El Torito boot information table, filled in by the +; mkisofs -boot-info-table option, if used. +bi_pvd: dd 0 ; LBA of primary volume descriptor +bi_file: dd 0 ; LBA of boot file +bi_length: dd 0 ; Length of boot file +bi_csum: dd 0 ; Checksum of boot file +bi_reserved: times 10 dd 0 ; Reserved + +;-------------------------------------------------------------------------- + +start1: + ; + ; Set up the stack to grow down from kBoot0Segment:kBoot0Stack. + ; Interrupts should be off while the stack is being manipulated. + ; + cli ; interrupts off + xor ax, ax ; zero ax + mov ss, ax ; ss <- 0 + mov sp, kBoot0Stack ; sp <- top of stack + sti ; reenable interrupts + + mov es, ax ; es <- 0 + mov ds, ax ; ds <- 0 + + ; + ; Relocate boot0 code. + ; + mov si, kBoot0LoadAddr ; si <- source + mov di, kBoot0RelocAddr ; di <- destination + cld ; auto-increment SI and/or DI registers + mov cx, kSectorBytes/2 ; copy 256 words + repnz movsw ; repeat string move (word) operation + + ; + ; Code relocated, jump to start_reloc in relocated location. + ; + jmp kBoot0Segment:start_reloc + +;-------------------------------------------------------------------------- +; Start execution from the relocated location. +; +start_reloc: + +%if VERBOSE + LogString(init_str) +%endif + +%if VERBOSE + LogString(read_str) +%endif + + ; forcing BIOS Int 13h operations to use drive 0x80 + mov WORD [gBIOSDriveNumber], 0x80 ; save BIOS drive number + mov al, 1 + mov edx, kBoot0LoadAddr ; load MBR code to 0x7C00 + mov ecx, 0 ; load sector 0 of drive 0x80 + call readLBA + +%if VERBOSE + LogString(done_str) +%endif + +%if UNUSED + LogString(keypress_str) + call getc +%endif + + ; Jump to newly-loaded booter + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + jmp kBoot0Segment:kBoot0LoadAddr + +error: + +%if VERBOSE + LogString(error_str) +%endif + +.loop: + hlt + jmp .loop + +;; +;; Support functions +;; + +;-------------------------------------------------------------------------- +; readSectors - Reads more than 127 sectors using LBA addressing. +; +; Arguments: +; AX = number of 2048-byte sectors to read (valid from 1-320). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; +; Returns: +; CF = 0 success +; 1 error +; +readSectors: + pushad + mov bx, ax + +.loop: + mov al, '.' + call print_char + xor eax, eax ; EAX = 0 + mov al, bl ; assume we reached the last block. + cmp bx, maxSectorCount ; check if we really reached the last block + jb .readBlock ; yes, BX < MaxSectorCount + mov al, maxSectorCount ; no, read MaxSectorCount + +.readBlock: + call readLBA + jc .exit + sub bx, ax ; decrease remaning sectors with the read amount + jz .exit ; exit if no more sectors left to be loaded + add ecx, eax ; adjust LBA sector offset + shl eax, 11 ; convert CD sectors to bytes + add edx, eax ; adjust target memory location + jmp .loop ; read remaining sectors + +.exit: + popad + ret + +;-------------------------------------------------------------------------- +; readLBA - Read sectors from a partition using LBA addressing. +; +; Arguments: +; AL = number of 512-byte sectors to read (valid from 1-127). +; EDX = pointer to where the sectors should be stored. +; ECX = sector offset in partition +; [gBIOSDriveNumber] = drive number (0x80 + unit number) +; +; Returns: +; CF = 0 success +; 1 error +; +readLBA: + pushad ; save all registers + push es ; save ES + mov bp, sp ; save current SP + + ; + ; Convert EDX to segment:offset model and set ES:BX + ; + ; Some BIOSes do not like offset to be negative while reading + ; from hard drives. This usually leads to "boot1: error" when trying + ; to boot from hard drive, while booting normally from USB flash. + ; The routines, responsible for this are apparently different. + ; Thus we split linear address slightly differently for these + ; capricious BIOSes to make sure offset is always positive. + ; + + mov bx, dx ; save offset to BX + and bh, 0x0f ; keep low 12 bits + shr edx, 4 ; adjust linear address to segment base + xor dl, dl ; mask low 8 bits + mov es, dx ; save segment to ES + + ; + ; Create the Disk Address Packet structure for the + ; INT13/F42 (Extended Read Sectors) on the stack. + ; + + ; push DWORD 0 ; offset 12, upper 32-bit LBA + push ds ; For sake of saving memory, + push ds ; push DS register, which is 0. + + push ecx + + push es ; offset 6, memory segment + + push bx ; offset 4, memory offset + + xor ah, ah ; offset 3, must be 0 + push ax ; offset 2, number of sectors + + push WORD 16 ; offset 0-1, packet size + + ; + ; INT13 Func 42 - Extended Read Sectors + ; + ; Arguments: + ; AH = 0x42 + ; [gBIOSDriveNumber] = drive number (0x80 + unit number) + ; DS:SI = pointer to Disk Address Packet + ; + ; Returns: + ; AH = return status (sucess is 0) + ; carry = 0 success + ; 1 error + ; + ; Packet offset 2 indicates the number of sectors read + ; successfully. + ; + mov dl, [gBIOSDriveNumber] ; load BIOS drive number + mov si, sp + mov ah, 0x42 + int 0x13 + + jnc .exit + + DebugChar('R') ; indicate INT13/F42 error + + ; + ; Issue a disk reset on error. + ; Should this be changed to Func 0xD to skip the diskette controller + ; reset? + ; + +%if VERBOSE + LogString(readerror_str) + mov eax, ecx + call print_hex +%endif + + xor ax, ax ; Func 0 + int 0x13 ; INT 13 + stc ; set carry to indicate error + +.exit: + mov sp, bp ; restore SP + pop es ; restore ES + popad + ret + +;-------------------------------------------------------------------------- +; Write a string with 'cdboot: ' prefix to the console. +; +; Arguments: +; ES:DI pointer to a NULL terminated string. +; +; Clobber list: +; DI +; +log_string: + pushad + + push di + mov si, log_title_str + call print_string + + pop si + call print_string + + popad + + ret + +;------------------------------------------------------------------------- +; Write a string to the console. +; +; Arguments: +; DS:SI pointer to a NULL terminated string. +; +; Clobber list: +; AX, BX, SI +; +print_string: + mov bx, 1 ; BH=0, BL=1 (blue) + +.loop: + lodsb ; load a byte from DS:SI into AL + cmp al, 0 ; Is it a NULL? + je .exit ; yes, all done + mov ah, 0xE ; INT10 Func 0xE + int 0x10 ; display byte in tty mode + jmp .loop + +.exit: + ret + +;%if DEBUG + +;-------------------------------------------------------------------------- +; Write the 4-byte value to the console in hex. +; +; Arguments: +; EAX = Value to be displayed in hex. +; +print_hex: + pushad + mov cx, WORD 4 + bswap eax +.loop: + push ax + ror al, 4 + call print_nibble ; display upper nibble + pop ax + call print_nibble ; display lower nibble + ror eax, 8 + loop .loop + +%if UNUSED + mov al, 10 ; carriage return + call print_char + mov al, 13 + call print_char +%endif ; UNUSED + + popad + ret + +print_nibble: + and al, 0x0f + add al, '0' + cmp al, '9' + jna .print_ascii + add al, 'A' - '9' - 1 +.print_ascii: + call print_char + ret + +;-------------------------------------------------------------------------- +; getc - wait for a key press +; +getc: + pushad + mov ah, 0 + int 0x16 + popad + ret + +;-------------------------------------------------------------------------- +; Write a ASCII character to the console. +; +; Arguments: +; AL = ASCII character. +; +print_char: + pushad + mov bx, 1 ; BH=0, BL=1 (blue) + mov ah, 0x0e ; bios INT 10, Function 0xE + int 0x10 ; display byte in tty mode + popad + ret + +;-------------------------------------------------------------------------- +; Static data. +; + +%if VERBOSE +log_title_str db CR, LF, 'cdboot: ', NULL +init_str db 'init', NULL +read_str db 'reading MBR from device 0x80', NULL +done_str db 'done', NULL +readerror_str db 'BIOS disk read error at sector: ', NULL +error_str db 'error', NULL +%endif + +%if UNUSED +keypress_str db 'Press any key to continue...', NULL +%endif + + +;; Pad this file to a size of 2048 bytes (one CD sector). +pad: + times 2048-($-$$) db 0 + +; +; Global variables +; + + ABSOLUTE kBoot0RelocAddr + kSectorBytes + +gBIOSDriveNumber resw 1 + +; END diff --git a/i386/config/.svn/all-wcprops b/i386/config/.svn/all-wcprops new file mode 100644 index 0000000..e5c6c87 --- /dev/null +++ b/i386/config/.svn/all-wcprops @@ -0,0 +1,125 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config +END +lkc_proto.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lkc_proto.h +END +zconf.hash.c +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/zconf.hash.c +END +menu.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/menu.c +END +dialog.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/dialog.h +END +symbol.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/symbol.c +END +lex.zconf.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lex.zconf.c +END +nconf.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/nconf.h +END +inputbox.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/inputbox.c +END +cconfig.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/cconfig.c +END +checklist.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/checklist.c +END +menubox.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/menubox.c +END +util.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/util.c +END +lkc.h +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lkc.h +END +expr.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/expr.c +END +confdata.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/confdata.c +END +expr.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/expr.h +END +zconf.tab.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/zconf.tab.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/Makefile +END +textbox.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/textbox.c +END +yesno.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/yesno.c +END diff --git a/i386/config/.svn/entries b/i386/config/.svn/entries new file mode 100644 index 0000000..8a178bc --- /dev/null +++ b/i386/config/.svn/entries @@ -0,0 +1,711 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/config +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +lkc_proto.h +file + + + + +2013-08-27T23:54:58.000000Z +c0d892c01bbd6980fda003d7803f937e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2375 + +zconf.hash.c +file + + + + +2013-08-27T23:54:58.000000Z +0130ca987e4d545deacaafe64cb884cd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10352 + +menu.c +file + + + + +2013-08-27T23:54:58.000000Z +1353c33c1cd701c141f488ec5209b515 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15191 + +dialog.h +file + + + + +2013-08-27T23:54:58.000000Z +6ab37e536b723f6cbe07fca073daef03 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6696 + +symbol.c +file + + + + +2013-08-27T23:54:58.000000Z +2136278bfd9c4dcabe44b8db0ea72621 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +26462 + +lex.zconf.c +file + + + + +2013-08-27T23:54:58.000000Z +fc1ff77f30202417204d1deb29ad0211 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +58478 + +nconf.h +file + + + + +2013-08-27T23:54:58.000000Z +d060fab962445335afb13cf4a4a8a2cf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1913 + +inputbox.c +file + + + + +2013-08-27T23:54:58.000000Z +836070cf260aa9285ff69828124b37c7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6054 + +cconfig.c +file + + + + +2013-08-27T23:54:58.000000Z +b98b88d9fd69920c57b481acaf39e875 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +36122 + +checklist.c +file + + + + +2013-08-27T23:54:58.000000Z +4b6cdf8fca5338adc5a995bb5f070d0e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8394 + +menubox.c +file + + + + +2013-08-27T23:54:58.000000Z +d3e9d71d6cfc6b8c1219678ea146e904 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11062 + +util.c +file + + + + +2013-08-27T23:54:58.000000Z +d9f12e61e7f4160d5c26beb943f2d0bb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +19977 + +lkc.h +file + + + + +2013-08-27T23:54:58.000000Z +309f1ed1963be925cb3927a053e1386a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4807 + +expr.c +file + + + + +2013-08-27T23:54:58.000000Z +1494f49397f6d27b07923b66097c2afc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +27270 + +confdata.c +file + + + + +2013-08-27T23:54:58.000000Z +964bc4ae99200f6e5086cac46b34d3bb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +23238 + +lxdialog +dir + +expr.h +file + + + + +2013-08-27T23:54:58.000000Z +f43e0ac3a68da4aa5c42057bdc0e1461 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7152 + +zconf.tab.c +file + + + + +2013-08-27T23:54:58.000000Z +195aa57e6c20512f9bfa47d9cc126b31 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +71879 + +Makefile +file + + + + +2013-08-27T23:54:58.000000Z +d209ebcde2e08e8fd03dc81499264812 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1741 + +textbox.c +file + + + + +2013-08-27T23:54:58.000000Z +e74891ce550d233ae0da469c1cfed13b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9150 + +yesno.c +file + + + + +2013-08-27T23:54:58.000000Z +9769589490ac420463d64a8b2221ab25 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2904 + diff --git a/i386/config/.svn/text-base/Makefile.svn-base b/i386/config/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..e02aa41 --- /dev/null +++ b/i386/config/.svn/text-base/Makefile.svn-base @@ -0,0 +1,57 @@ +# +# Until I can remove the dependency on the appkit, +# we'll just keep the generated files in this directory +# and install them directly, rather than generating them again. +# +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/config +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = util +include ${SRCROOT}/Make.rules + +OBJS = cconfig.o32 cconfig.o64 zconf.tab.o32 zconf.tab.o64 \ + yesno.o32 yesno.o64 textbox.o32 textbox.o64 menubox.o32 \ + menubox.o64 checklist.o32 checklist.o64 inputbox.o32 inputbox.o64 + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +DEFINES = -DKBUILD_NO_NLS -DCURSES_LOC=\ -DPATH_MAX=256 -DPACKAGE=\"chameleon\" +LDFLAGS = -lncurses -lmenu + +PROGRAMS = cconfig + +SYMPROG = $(addprefix $(SYMROOT)/, $(PROGRAMS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +all: $(DIRS_NEEDED) $(SYMPROG) + +$(SYMPROG): $(OBJS) + @echo "\t[LD32] $(@F)_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/*.o32 + @echo "\t[LD64] $(@F)_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/*.o64 + @echo "\t[LIPO] $(@F)" + @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 -output $(SYMROOT)/$(@F) + @$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64 + +config: $(DIRS_NEEDED) $(SYMPROG) + @cd ${SRCROOT} && $(SYMPROG) $(SRCROOT)/Cconfig + +rebuild_config: $(DIRS_NEEDED) $(SYMPROG) + @cd ${SRCROOT} && $(SYMPROG) $(SRCROOT)/Cconfig rebuild + + +.PHONY: config rebuild_config + +#dependencies +-include $(OBJROOT)/Makedep + +distclean-local: + @rm -f $(SYMPROG) $(OBJS) $(OBJROOT)/Makedep diff --git a/i386/config/.svn/text-base/cconfig.c.svn-base b/i386/config/.svn/text-base/cconfig.c.svn-base new file mode 100644 index 0000000..5f86c88 --- /dev/null +++ b/i386/config/.svn/text-base/cconfig.c.svn-base @@ -0,0 +1,883 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + * + * Introduced single menu mode (show all sub-menus in one large tree). + * 2002-11-06 Petr Baudis + * + * i18n, 2005, Arnaldo Carvalho de Melo + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" +#include "lxdialog/dialog.h" + +static const char mconf_readme[] = N_( + "Overview\n" + "--------\n" + "This interface let you select features and parameters for the build.\n" + "Features can either be built-in, modularized, or ignored. Parameters\n" + "must be entered in as decimal or hexadecimal numbers or text.\n" + "\n" + "Menu items beginning with following braces represent features that\n" + " [ ] can be built in or removed\n" + " < > can be built in, modularized or removed\n" + " { } can be built in or modularized (selected by other feature)\n" + " - - are selected by other feature,\n" + "while *, M or whitespace inside braces means to build in, build as\n" + "a module or to exclude the feature respectively.\n" + "\n" + "To change any of these features, highlight it with the cursor\n" + "keys and press to build it in, to make it a module or\n" + " to removed it. You may also press the to cycle\n" + "through the available options (ie. Y->N->M->Y).\n" + "\n" + "Some additional keyboard hints:\n" + "\n" + "Menus\n" + "----------\n" + "o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" + " you wish to change or submenu wish to select and press .\n" + " Submenus are designated by \"--->\".\n" + "\n" + " Shortcut: Press the option's highlighted letter (hotkey).\n" + " Pressing a hotkey more than once will sequence\n" + " through all visible items which use that hotkey.\n" + "\n" + " You may also use the and keys to scroll\n" + " unseen options into view.\n" + "\n" + "o To exit a menu use the cursor keys to highlight the button\n" + " and press .\n" + "\n" + " Shortcut: Press or or if there is no hotkey\n" + " using those letters. You may press a single , but\n" + " there is a delayed response which you may find annoying.\n" + "\n" + " Also, the and cursor keys will cycle between and\n" + " \n" + "\n" + "\n" + "Data Entry\n" + "-----------\n" + "o Enter the requested information and press \n" + " If you are entering hexadecimal values, it is not necessary to\n" + " add the '0x' prefix to the entry.\n" + "\n" + "o For help, use the or cursor keys to highlight the help option\n" + " and press . You can try as well.\n" + "\n" + "\n" + "Text Box (Help Window)\n" + "--------\n" + "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" + " keys h,j,k,l function here as do and for those\n" + " who are familiar with less and lynx.\n" + "\n" + "o Press , , or to exit.\n" + "\n" + "\n" + "Alternate Configuration Files\n" + "-----------------------------\n" + "Menuconfig supports the use of alternate configuration files for\n" + "those who, for various reasons, find it necessary to switch\n" + "between different configurations.\n" + "\n" + "At the end of the main menu you will find two options. One is\n" + "for saving the current configuration to a file of your choosing.\n" + "The other option is for loading a previously saved alternate\n" + "configuration.\n" + "\n" + "Even if you don't use alternate configuration files, but you\n" + "find during a Menuconfig session that you have completely messed\n" + "up your settings, you may use the \"Load Alternate...\" option to\n" + "restore your previously saved settings from \".config\" without\n" + "restarting Menuconfig.\n" + "\n" + "Other information\n" + "-----------------\n" + "If you use Menuconfig in an XTERM window make sure you have your\n" + "$TERM variable set to point to a xterm definition which supports color.\n" + "Otherwise, Menuconfig will look rather bad. Menuconfig will not\n" + "display correctly in a RXVT window because rxvt displays only one\n" + "intensity of color, bright.\n" + "\n" + "Menuconfig will display larger menus on screens or xterms which are\n" + "set to display more than the standard 25 row by 80 column geometry.\n" + "In order for this to work, the \"stty size\" command must be able to\n" + "display the screen's current row and column geometry. I STRONGLY\n" + "RECOMMEND that you make sure you do NOT have the shell variables\n" + "LINES and COLUMNS exported into your environment. Some distributions\n" + "export those variables via /etc/profile. Some ncurses programs can\n" + "become confused when those variables (LINES & COLUMNS) don't reflect\n" + "the true screen size.\n" + "\n" + "Optional personality available\n" + "------------------------------\n" + "If you prefer to have all of the options listed in a single menu, rather\n" + "than the default multimenu hierarchy, run the menuconfig with\n" + "MENUCONFIG_MODE environment variable set to single_menu. Example:\n" + "\n" + "make MENUCONFIG_MODE=single_menu menuconfig\n" + "\n" + " will then unroll the appropriate category, or enfold it if it\n" + "is already unrolled.\n" + "\n" + "Note that this mode can eventually be a little more CPU expensive\n" + "(especially with a larger number of unrolled categories) than the\n" + "default mode.\n" + "\n" + "Different color themes available\n" + "--------------------------------\n" + "It is possible to select different color themes using the variable\n" + "MENUCONFIG_COLOR. To select a theme use:\n" + "\n" + "make MENUCONFIG_COLOR= menuconfig\n" + "\n" + "Available themes are\n" + " mono => selects colors suitable for monochrome displays\n" + " blackbg => selects a color scheme with black background\n" + " classic => theme with blue background. The classic look\n" + " bluetitle => a LCD friendly version of classic. (default)\n" + "\n"), +menu_instructions[] = N_( + "Arrow keys navigate the menu. " + " selects submenus --->. " + "Highlighted letters are hotkeys. " + "Pressing includes, excludes, modularizes features. " + "Press to exit, for Help, for Search. " + "Legend: [*] built-in [ ] excluded module < > module capable"), +radiolist_instructions[] = N_( + "Use the arrow keys to navigate this window or " + "press the hotkey of the item you wish to select " + "followed by the . " + "Press for additional information about this option."), +inputbox_instructions_int[] = N_( + "Please enter a decimal value. " + "Fractions will not be accepted. " + "Use the key to move from the input field to the buttons below it."), +inputbox_instructions_hex[] = N_( + "Please enter a hexadecimal value. " + "Use the key to move from the input field to the buttons below it."), +inputbox_instructions_string[] = N_( + "Please enter a string value. " + "Use the key to move from the input field to the buttons below it."), +setmod_text[] = N_( + "This feature depends on another which has been configured as a module.\n" + "As a result, this feature will be built as a module."), +load_config_text[] = N_( + "Enter the name of the configuration file you wish to load. " + "Accept the name shown to restore the configuration you " + "last retrieved. Leave blank to abort."), +load_config_help[] = N_( + "\n" + "For various reasons, one may wish to keep several different\n" + "configurations available on a single machine.\n" + "\n" + "If you have saved a previous configuration in a file other than the\n" + "default one, entering its name here will allow you to modify that\n" + "configuration.\n" + "\n" + "If you are uncertain, then you have probably never used alternate\n" + "configuration files. You should therefore leave this blank to abort.\n"), +save_config_text[] = N_( + "Enter a filename to which this configuration should be saved " + "as an alternate. Leave blank to abort."), +save_config_help[] = N_( + "\n" + "For various reasons, one may wish to keep different configurations\n" + "available on a single machine.\n" + "\n" + "Entering a file name here will allow you to later retrieve, modify\n" + "and use the current configuration as an alternate to whatever\n" + "configuration options you have selected at that time.\n" + "\n" + "If you are uncertain what all this means then you should probably\n" + "leave this blank.\n"), +search_help[] = N_( + "\n" + "Search for symbols and display their relations.\n" + "Regular expressions are allowed.\n" + "Example: search for \"^FOO\"\n" + "Result:\n" + "-----------------------------------------------------------------\n" + "Symbol: FOO [=m]\n" + "Prompt: Foo bus is used to drive the bar HW\n" + "Defined at drivers/pci/Kconfig:47\n" + "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" + "Location:\n" + " -> Bus options (PCI, PCMCIA, EISA, MCA, ISA)\n" + " -> PCI support (PCI [=y])\n" + " -> PCI access mode ( [=y])\n" + "Selects: LIBCRC32\n" + "Selected by: BAR\n" + "-----------------------------------------------------------------\n" + "o The line 'Prompt:' shows the text used in the menu structure for\n" + " this symbol\n" + "o The 'Defined at' line tell at what file / line number the symbol\n" + " is defined\n" + "o The 'Depends on:' line tell what symbols needs to be defined for\n" + " this symbol to be visible in the menu (selectable)\n" + "o The 'Location:' lines tell where in the menu structure this symbol\n" + " is located\n" + " A location followed by a [=y] indicate that this is a selectable\n" + " menu item - and current value is displayed inside brackets.\n" + "o The 'Selects:' line tell what symbol will be automatically\n" + " selected if this symbol is selected (y or m)\n" + "o The 'Selected by' line tell what symbol has selected this symbol\n" + "\n" + "Only relevant lines are shown.\n" + "\n\n" + "Search examples:\n" + "Examples: USB => find all symbols containing USB\n" + " ^USB => find all symbols starting with USB\n" + " USB$ => find all symbols ending with USB\n" + "\n"); + +static int indent; +static struct menu *current_menu; +static int child_count; +static int single_menu_mode; +static int show_all_options; + +static void conf(struct menu *menu); +static void conf_choice(struct menu *menu); +static void conf_string(struct menu *menu); +static void conf_load(void); +static void conf_save(void); +static void show_textbox(const char *title, const char *text, int r, int c); +static void show_helptext(const char *title, const char *text); +static void show_help(struct menu *menu); + +static char filename[PATH_MAX+1]; +static void set_config_filename(const char *config_filename) +{ + static char menu_backtitle[PATH_MAX+128]; + int size; + + size = snprintf(menu_backtitle, sizeof(menu_backtitle), + "%s - %s", config_filename, rootmenu.prompt->text); + if (size >= sizeof(menu_backtitle)) + menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; + set_dialog_backtitle(menu_backtitle); + + size = snprintf(filename, sizeof(filename), "%s", config_filename); + if (size >= sizeof(filename)) + filename[sizeof(filename)-1] = '\0'; +} + + +static void search_conf(void) +{ + struct symbol **sym_arr; + struct gstr res; + char *dialog_input; + int dres; +again: + dialog_clear(); + dres = dialog_inputbox(_("Search Configuration Parameter"), + _("Enter " CONFIG_ " (sub)string to search for " + "(with or without \"" CONFIG_ "\")"), + 10, 75, ""); + switch (dres) { + case 0: + break; + case 1: + show_helptext(_("Search Configuration"), search_help); + goto again; + default: + return; + } + + /* strip the prefix if necessary */ + dialog_input = dialog_input_result; + if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) + dialog_input += strlen(CONFIG_); + + sym_arr = sym_re_search(dialog_input); + res = get_relations_str(sym_arr); + free(sym_arr); + show_textbox(_("Search Results"), str_get(&res), 0, 0); + str_free(&res); +} + +static void build_conf(struct menu *menu) +{ + struct symbol *sym; + struct property *prop; + struct menu *child; + int type, tmp, doint = 2; + tristate val; + char ch; + bool visible; + + /* + * note: menu_is_visible() has side effect that it will + * recalc the value of the symbol. + */ + visible = menu_is_visible(menu); + if (show_all_options && !menu_has_prompt(menu)) + return; + else if (!show_all_options && !visible) + return; + + sym = menu->sym; + prop = menu->prompt; + if (!sym) { + if (prop && menu != current_menu) { + const char *prompt = menu_get_prompt(menu); + switch (prop->type) { + case P_MENU: + child_count++; + prompt = _(prompt); + if (single_menu_mode) { + item_make("%s%*c%s", + menu->data ? "-->" : "++>", + indent + 1, ' ', prompt); + } else + item_make(" %*c%s --->", indent + 1, ' ', prompt); + + item_set_tag('m'); + item_set_data(menu); + if (single_menu_mode && menu->data) + goto conf_childs; + return; + case P_COMMENT: + if (prompt) { + child_count++; + item_make(" %*c*** %s ***", indent + 1, ' ', _(prompt)); + item_set_tag(':'); + item_set_data(menu); + } + break; + default: + if (prompt) { + child_count++; + item_make("---%*c%s", indent + 1, ' ', _(prompt)); + item_set_tag(':'); + item_set_data(menu); + } + } + } else + doint = 0; + goto conf_childs; + } + + type = sym_get_type(sym); + if (sym_is_choice(sym)) { + struct symbol *def_sym = sym_get_choice_value(sym); + struct menu *def_menu = NULL; + + child_count++; + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child) && child->sym == def_sym) + def_menu = child; + } + + val = sym_get_tristate_value(sym); + if (sym_is_changable(sym)) { + switch (type) { + case S_BOOLEAN: + item_make("[%c]", val == no ? ' ' : '*'); + break; + case S_TRISTATE: + switch (val) { + case yes: ch = '*'; break; + case mod: ch = 'M'; break; + default: ch = ' '; break; + } + item_make("<%c>", ch); + break; + } + item_set_tag('t'); + item_set_data(menu); + } else { + item_make(" "); + item_set_tag(def_menu ? 't' : ':'); + item_set_data(menu); + } + + item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); + if (val == yes) { + if (def_menu) { + item_add_str(" (%s)", _(menu_get_prompt(def_menu))); + item_add_str(" --->"); + if (def_menu->list) { + indent += 2; + build_conf(def_menu); + indent -= 2; + } + } + return; + } + } else { + if (menu == current_menu) { + item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); + item_set_tag(':'); + item_set_data(menu); + goto conf_childs; + } + child_count++; + val = sym_get_tristate_value(sym); + if (sym_is_choice_value(sym) && val == yes) { + item_make(" "); + item_set_tag(':'); + item_set_data(menu); + } else { + switch (type) { + case S_BOOLEAN: + if (sym_is_changable(sym)) + item_make("[%c]", val == no ? ' ' : '*'); + else + item_make("-%c-", val == no ? ' ' : '*'); + item_set_tag('t'); + item_set_data(menu); + break; + case S_TRISTATE: + switch (val) { + case yes: ch = '*'; break; + case mod: ch = 'M'; break; + default: ch = ' '; break; + } + if (sym_is_changable(sym)) { + if (sym->rev_dep.tri == mod) + item_make("{%c}", ch); + else + item_make("<%c>", ch); + } else + item_make("-%c-", ch); + item_set_tag('t'); + item_set_data(menu); + break; + default: + tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */ + item_make("(%s)", sym_get_string_value(sym)); + tmp = indent - tmp + 4; + if (tmp < 0) + tmp = 0; + item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)), + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : _(" (NEW)")); + item_set_tag('s'); + item_set_data(menu); + goto conf_childs; + } + } + item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)), + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : _(" (NEW)")); + if (menu->prompt->type == P_MENU) { + item_add_str(" --->"); + return; + } + } + +conf_childs: + indent += doint; + for (child = menu->list; child; child = child->next) + build_conf(child); + indent -= doint; +} + +static void conf(struct menu *menu) +{ + struct menu *submenu; + const char *prompt = menu_get_prompt(menu); + struct symbol *sym; + struct menu *active_menu = NULL; + int res; + int s_scroll = 0; + + while (1) { + + item_reset(); + current_menu = menu; + build_conf(menu); + if (!child_count) + break; + if (menu == &rootmenu) { + item_make("--- "); + item_set_tag(':'); + item_make(_(" Load an Alternate Configuration File")); + item_set_tag('L'); + item_make(_(" Save an Alternate Configuration File")); + item_set_tag('S'); + } + dialog_clear(); + res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), + _(menu_instructions), + active_menu, &s_scroll); + if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) + break; + if (!item_activate_selected()) + continue; + if (!item_tag()) + continue; + + submenu = item_data(); + active_menu = item_data(); + if (submenu) + sym = submenu->sym; + else + sym = NULL; + + switch (res) { + case 0: + switch (item_tag()) { + case 'm': + if (single_menu_mode) + submenu->data = (void *) (long) !submenu->data; + else + conf(submenu); + break; + case 't': + if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) + conf_choice(submenu); + else if (submenu->prompt->type == P_MENU) + conf(submenu); + break; + case 's': + conf_string(submenu); + break; + case 'L': + conf_load(); + break; + case 'S': + conf_save(); + break; + } + break; + case 2: + if (sym) + show_help(submenu); + else + show_helptext(_("README"), _(mconf_readme)); + break; + case 3: + if (item_is_tag('t')) { + if (sym_set_tristate_value(sym, yes)) + break; + if (sym_set_tristate_value(sym, mod)) + show_textbox(NULL, setmod_text, 6, 74); + } + break; + case 4: + if (item_is_tag('t')) + sym_set_tristate_value(sym, no); + break; + case 5: + if (item_is_tag('t')) + sym_set_tristate_value(sym, mod); + break; + case 6: + if (item_is_tag('t')) + sym_toggle_tristate_value(sym); + else if (item_is_tag('m')) + conf(submenu); + break; + case 7: + search_conf(); + break; + case 8: + show_all_options = !show_all_options; + break; + } + } +} + +static void show_textbox(const char *title, const char *text, int r, int c) +{ + dialog_clear(); + dialog_textbox(title, text, r, c); +} + +static void show_helptext(const char *title, const char *text) +{ + show_textbox(title, text, 0, 0); +} + +static void show_help(struct menu *menu) +{ + struct gstr help = str_new(); + + help.max_width = getmaxx(stdscr) - 10; + menu_get_ext_help(menu, &help); + + show_helptext(_(menu_get_prompt(menu)), str_get(&help)); + str_free(&help); +} + +static void conf_choice(struct menu *menu) +{ + const char *prompt = _(menu_get_prompt(menu)); + struct menu *child; + struct symbol *active; + + active = sym_get_choice_value(menu->sym); + while (1) { + int res; + int selected; + item_reset(); + + current_menu = menu; + for (child = menu->list; child; child = child->next) { + if (!menu_is_visible(child)) + continue; + if (child->sym) + item_make("%s", _(menu_get_prompt(child))); + else { + item_make("*** %s ***", _(menu_get_prompt(child))); + item_set_tag(':'); + } + item_set_data(child); + if (child->sym == active) + item_set_selected(1); + if (child->sym == sym_get_choice_value(menu->sym)) + item_set_tag('X'); + } + dialog_clear(); + res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"), + _(radiolist_instructions), + 15, 70, 6); + selected = item_activate_selected(); + switch (res) { + case 0: + if (selected) { + child = item_data(); + if (!child->sym) + break; + + sym_set_tristate_value(child->sym, yes); + } + return; + case 1: + if (selected) { + child = item_data(); + show_help(child); + active = child->sym; + } else + show_help(menu); + break; + case KEY_ESC: + return; + case -ERRDISPLAYTOOSMALL: + return; + } + } +} + +static void conf_string(struct menu *menu) +{ + const char *prompt = menu_get_prompt(menu); + + while (1) { + int res; + const char *heading; + + switch (sym_get_type(menu->sym)) { + case S_INT: + heading = _(inputbox_instructions_int); + break; + case S_HEX: + heading = _(inputbox_instructions_hex); + break; + case S_STRING: + heading = _(inputbox_instructions_string); + break; + default: + heading = _("Internal mconf error!"); + } + dialog_clear(); + res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"), + heading, 10, 75, + sym_get_string_value(menu->sym)); + switch (res) { + case 0: + if (sym_set_string_value(menu->sym, dialog_input_result)) + return; + show_textbox(NULL, _("You have made an invalid entry."), 5, 43); + break; + case 1: + show_help(menu); + break; + case KEY_ESC: + return; + } + } +} + +static void conf_load(void) +{ + + while (1) { + int res; + dialog_clear(); + res = dialog_inputbox(NULL, load_config_text, + 11, 55, filename); + switch(res) { + case 0: + if (!dialog_input_result[0]) + return; + if (!conf_read(dialog_input_result)) { + set_config_filename(dialog_input_result); + sym_set_change_count(1); + return; + } + show_textbox(NULL, _("File does not exist!"), 5, 38); + break; + case 1: + show_helptext(_("Load Alternate Configuration"), load_config_help); + break; + case KEY_ESC: + return; + } + } +} + +static void conf_save(void) +{ + while (1) { + int res; + dialog_clear(); + res = dialog_inputbox(NULL, save_config_text, + 11, 55, filename); + switch(res) { + case 0: + if (!dialog_input_result[0]) + return; + if (!conf_write(dialog_input_result)) { + set_config_filename(dialog_input_result); + return; + } + show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); + break; + case 1: + show_helptext(_("Save Alternate Configuration"), save_config_help); + break; + case KEY_ESC: + return; + } + } + +} + +int main(int ac, char **av) +{ + int saved_x = 0, saved_y = 0; + char *mode; + int res; + int rebuild = 0; + + if(ac > 2 && (strcmp(av[2], "rebuild") == 0)) rebuild = 1; + + + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + + textdomain(PACKAGE); + + conf_parse(av[1]); + conf_read(NULL); + + mode = getenv("MENUCONFIG_MODE"); + if (mode) { + if (!strcasecmp(mode, "single_menu")) + single_menu_mode = 1; + } + + if(!rebuild) + { + initscr(); + + getyx(stdscr, saved_y, saved_x); + if (init_dialog(NULL)) { + fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); + fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); + return 1; + } + } + set_config_filename(conf_get_configname()); + if(rebuild) + { + res = 0; + } + else + { + do { + conf(&rootmenu); + dialog_clear(); + if (conf_get_changed()) + res = dialog_yesno(NULL, + _("Do you wish to save your " + "new configuration?\n" + " to continue."), + 6, 60); + else + res = -1; + } while (res == KEY_ESC); + end_dialog(saved_x, saved_y); + } + + + switch (res) { + case 0: + if (conf_write(filename)) { + fprintf(stderr, _("\n\n" + "Error while writing of the configuration.\n" + "Your configuration changes were NOT saved." + "\n\n")); + return 1; + } + case -1: + if(!rebuild) + printf(_("\n\n" + "*** End of the configuration.\n" + "*** Execute 'make' to start the build or try 'make help'." + "\n\n")); + break; + default: + fprintf(stderr, _("\n\n" + "Your configuration changes were NOT saved." + "\n\n")); + } + + // Output headers + files needed by the make system + conf_write_autoconf(); + + return 0; +} + diff --git a/i386/config/.svn/text-base/checklist.c.svn-base b/i386/config/.svn/text-base/checklist.c.svn-base new file mode 100644 index 0000000..a2eb80f --- /dev/null +++ b/i386/config/.svn/text-base/checklist.c.svn-base @@ -0,0 +1,332 @@ +/* + * checklist.c -- implements the checklist box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension + * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static int list_width, check_x, item_x; + +/* + * Print list item + */ +static void print_item(WINDOW * win, int choice, int selected) +{ + int i; + char *list_item = malloc(list_width + 1); + + strncpy(list_item, item_str(), list_width - item_x); + list_item[list_width - item_x] = '\0'; + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, choice, 0); + for (i = 0; i < list_width; i++) + waddch(win, ' '); + + wmove(win, choice, check_x); + wattrset(win, selected ? dlg.check_selected.atr + : dlg.check.atr); + if (!item_is_tag(':')) + wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); + + wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); + mvwaddch(win, choice, item_x, list_item[0]); + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + waddstr(win, list_item + 1); + if (selected) { + wmove(win, choice, check_x + 1); + wrefresh(win); + } + free(list_item); +} + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int choice, int item_no, int scroll, + int y, int x, int height) +{ + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + + if ((height < item_no) && (scroll + choice < item_no - 1)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } +} + +/* + * Display the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext("Select"), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with a list of options that can be turned on or off + * in the style of radiolist (only one option turned on at a time). + */ +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height) +{ + int i, x, y, box_x, box_y; + int key = 0, button = 0, choice = 0, scroll = 0, max_choice; + WINDOW *dialog, *list; + + /* which item to highlight */ + item_foreach() { + if (item_is_tag('X')) + choice = item_n(); + if (item_is_selected()) { + choice = item_n(); + break; + } + } + +do_resize: + if (getmaxy(stdscr) < (height + 6)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 6)) + return -ERRDISPLAYTOOSMALL; + + max_choice = MIN(list_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + list_width = width - 6; + box_y = height - list_height - 5; + box_x = (width - list_width) / 2 - 1; + + /* create new window for the list */ + list = subwin(dialog, list_height, list_width, y + box_y + 1, + x + box_x + 1); + + keypad(list, TRUE); + + /* draw a box around the list items */ + draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + /* Find length of longest item in order to center checklist */ + check_x = 0; + item_foreach() + check_x = MAX(check_x, strlen(item_str()) + 4); + check_x = MIN(check_x, list_width); + + check_x = (list_width - check_x) / 2; + item_x = check_x + 4; + + if (choice >= list_height) { + scroll = choice - list_height + 1; + choice -= scroll; + } + + /* Print the list */ + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + print_item(list, i, i == choice); + } + + print_arrows(dialog, choice, item_count(), scroll, + box_y, box_x + check_x + 5, list_height); + + print_buttons(dialog, height, width, 0); + + wnoutrefresh(dialog); + wnoutrefresh(list); + doupdate(); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + for (i = 0; i < max_choice; i++) { + item_set(i + scroll); + if (toupper(key) == toupper(item_str()[0])) + break; + } + + if (i < max_choice || key == KEY_UP || key == KEY_DOWN || + key == '+' || key == '-') { + if (key == KEY_UP || key == '-') { + if (!choice) { + if (!scroll) + continue; + /* Scroll list down */ + if (list_height > 1) { + /* De-highlight current first item */ + item_set(scroll); + print_item(list, 0, FALSE); + scrollok(list, TRUE); + wscrl(list, -1); + scrollok(list, FALSE); + } + scroll--; + item_set(scroll); + print_item(list, 0, TRUE); + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice - 1; + } else if (key == KEY_DOWN || key == '+') { + if (choice == max_choice - 1) { + if (scroll + choice >= item_count() - 1) + continue; + /* Scroll list up */ + if (list_height > 1) { + /* De-highlight current last item before scrolling up */ + item_set(scroll + max_choice - 1); + print_item(list, + max_choice - 1, + FALSE); + scrollok(list, TRUE); + wscrl(list, 1); + scrollok(list, FALSE); + } + scroll++; + item_set(scroll + max_choice - 1); + print_item(list, max_choice - 1, TRUE); + + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice + 1; + } + if (i != choice) { + /* De-highlight current item */ + item_set(scroll + choice); + print_item(list, choice, FALSE); + /* Highlight new item */ + choice = i; + item_set(scroll + choice); + print_item(list, choice, TRUE); + wnoutrefresh(dialog); + wrefresh(list); + } + continue; /* wait for another key press */ + } + switch (key) { + case 'H': + case 'h': + case '?': + button = 1; + /* fall-through */ + case 'S': + case 's': + case ' ': + case '\n': + item_foreach() + item_set_selected(0); + item_set(scroll + choice); + item_set_selected(1); + delwin(list); + delwin(dialog); + return button; + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(list); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + + /* Now, update everything... */ + doupdate(); + } + delwin(list); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/.svn/text-base/confdata.c.svn-base b/i386/config/.svn/text-base/confdata.c.svn-base new file mode 100644 index 0000000..b10bd8c --- /dev/null +++ b/i386/config/.svn/text-base/confdata.c.svn-base @@ -0,0 +1,1078 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +static void conf_warning(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); + +static void conf_message(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); + +static const char *conf_filename; +static int conf_lineno, conf_warnings, conf_unsaved; + +const char conf_defname[] = "config/defconfig"; + +static void conf_warning(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "%s:%d:warning: ", conf_filename, conf_lineno); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + conf_warnings++; +} + +static void conf_default_message_callback(const char *fmt, va_list ap) +{ + printf("#\n# "); + vprintf(fmt, ap); + printf("\n#\n"); +} + +static void (*conf_message_callback) (const char *fmt, va_list ap) = + conf_default_message_callback; +void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap)) +{ + conf_message_callback = fn; +} + +static void conf_message(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (conf_message_callback) + conf_message_callback(fmt, ap); +} + +const char *conf_get_configname(void) +{ + char *name = getenv("KCONFIG_CONFIG"); + + return name ? name : ".config"; +} + +const char *conf_get_autoconfig_name(void) +{ + char *name = getenv("KCONFIG_AUTOCONFIG"); + + return name ? name : "auto.conf"; +} + +static char *conf_expand_value(const char *in) +{ + struct symbol *sym; + const char *src; + static char res_value[SYMBOL_MAXLENGTH]; + char *dst, name[SYMBOL_MAXLENGTH]; + + res_value[0] = 0; + dst = name; + while ((src = strchr(in, '$'))) { + strncat(res_value, in, src - in); + src++; + dst = name; + while (isalnum(*src) || *src == '_') + *dst++ = *src++; + *dst = 0; + sym = sym_lookup(name, 0); + sym_calc_value(sym); + strcat(res_value, sym_get_string_value(sym)); + in = src; + } + strcat(res_value, in); + + return res_value; +} + +char *conf_get_default_confname(void) +{ + struct stat buf; + static char fullname[PATH_MAX+1]; + char *env, *name; + + name = conf_expand_value(conf_defname); + env = getenv(SRCTREE); + if (env) { + sprintf(fullname, "%s/%s", env, name); + if (!stat(fullname, &buf)) + return fullname; + } + return name; +} + +static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) +{ + char *p2; + + switch (sym->type) { + case S_TRISTATE: + if (p[0] == 'm') { + sym->def[def].tri = mod; + sym->flags |= def_flags; + break; + } + case S_BOOLEAN: + if (p[0] == 'y') { + sym->def[def].tri = yes; + sym->flags |= def_flags; + break; + } + if (p[0] == 'n') { + sym->def[def].tri = no; + sym->flags |= def_flags; + break; + } + conf_warning("symbol value '%s' invalid for %s", p, sym->name); + break; + case S_OTHER: + if (*p != '"') { + for (p2 = p; *p2 && !isspace(*p2); p2++) + ; + sym->type = S_STRING; + goto done; + } + case S_STRING: + if (*p++ != '"') + break; + for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { + if (*p2 == '"') { + *p2 = 0; + break; + } + memmove(p2, p2 + 1, strlen(p2)); + } + if (!p2) { + conf_warning("invalid string found"); + return 1; + } + case S_INT: + case S_HEX: + done: + if (sym_string_valid(sym, p)) { + sym->def[def].val = strdup(p); + sym->flags |= def_flags; + } else { + conf_warning("symbol value '%s' invalid for %s", p, sym->name); + return 1; + } + break; + default: + ; + } + return 0; +} + +int conf_read_simple(const char *name, int def) +{ + FILE *in = NULL; + char line[1024]; + char *p, *p2; + struct symbol *sym; + int i, def_flags; + + if (name) { + in = zconf_fopen(name); + } else { + struct property *prop; + + name = conf_get_configname(); + in = zconf_fopen(name); + if (in) + goto load; + sym_add_change_count(1); + if (!sym_defconfig_list) { + if (modules_sym) + sym_calc_value(modules_sym); + return 1; + } + + for_all_defaults(sym_defconfig_list, prop) { + if (expr_calc_value(prop->visible.expr) == no || + prop->expr->type != E_SYMBOL) + continue; + name = conf_expand_value(prop->expr->left.sym->name); + in = zconf_fopen(name); + if (in) { + conf_message(_("using defaults found in %s"), + name); + goto load; + } + } + } + if (!in) + return 1; + +load: + conf_filename = name; + conf_lineno = 0; + conf_warnings = 0; + conf_unsaved = 0; + + def_flags = SYMBOL_DEF << def; + for_all_symbols(i, sym) { + sym->flags |= SYMBOL_CHANGED; + sym->flags &= ~(def_flags|SYMBOL_VALID); + if (sym_is_choice(sym)) + sym->flags |= def_flags; + switch (sym->type) { + case S_INT: + case S_HEX: + case S_STRING: + if (sym->def[def].val) + free(sym->def[def].val); + default: + sym->def[def].val = NULL; + sym->def[def].tri = no; + } + } + + while (fgets(line, sizeof(line), in)) { + conf_lineno++; + sym = NULL; + if (line[0] == '#') { + if (memcmp(line + 2, CONFIG_, strlen(CONFIG_))) + continue; + p = strchr(line + 2 + strlen(CONFIG_), ' '); + if (!p) + continue; + *p++ = 0; + if (strncmp(p, "is not set", 10)) + continue; + if (def == S_DEF_USER) { + sym = sym_find(line + 2 + strlen(CONFIG_)); + if (!sym) { + sym_add_change_count(1); + goto setsym; + } + } else { + sym = sym_lookup(line + 2 + strlen(CONFIG_), 0); + if (sym->type == S_UNKNOWN) + sym->type = S_BOOLEAN; + } + if (sym->flags & def_flags) { + conf_warning("override: reassigning to symbol %s", sym->name); + } + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + sym->def[def].tri = no; + sym->flags |= def_flags; + break; + default: + ; + } + } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) { + p = strchr(line + strlen(CONFIG_), '='); + if (!p) + continue; + *p++ = 0; + p2 = strchr(p, '\n'); + if (p2) { + *p2-- = 0; + if (*p2 == '\r') + *p2 = 0; + } + if (def == S_DEF_USER) { + sym = sym_find(line + strlen(CONFIG_)); + if (!sym) { + sym_add_change_count(1); + goto setsym; + } + } else { + sym = sym_lookup(line + strlen(CONFIG_), 0); + if (sym->type == S_UNKNOWN) + sym->type = S_OTHER; + } + if (sym->flags & def_flags) { + conf_warning("override: reassigning to symbol %s", sym->name); + } + if (conf_set_sym_val(sym, def, def_flags, p)) + continue; + } else { + if (line[0] != '\r' && line[0] != '\n') + conf_warning("unexpected data"); + continue; + } +setsym: + if (sym && sym_is_choice_value(sym)) { + struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); + switch (sym->def[def].tri) { + case no: + break; + case mod: + if (cs->def[def].tri == yes) { + conf_warning("%s creates inconsistent choice state", sym->name); + cs->flags &= ~def_flags; + } + break; + case yes: + if (cs->def[def].tri != no) + conf_warning("override: %s changes choice state", sym->name); + cs->def[def].val = sym; + break; + } + cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); + } + } + fclose(in); + + if (modules_sym) + sym_calc_value(modules_sym); + return 0; +} + +int conf_read(const char *name) +{ + struct symbol *sym, *choice_sym; + struct property *prop; + struct expr *e; + int i, flags; + + sym_set_change_count(0); + + if (conf_read_simple(name, S_DEF_USER)) + return 1; + + for_all_symbols(i, sym) { + sym_calc_value(sym); + if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) + goto sym_ok; + if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { + /* check that calculated value agrees with saved value */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) + break; + if (!sym_is_choice(sym)) + goto sym_ok; + default: + if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) + goto sym_ok; + break; + } + } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) + /* no previous value and not saved */ + goto sym_ok; + conf_unsaved++; + /* maybe print value in verbose mode... */ + sym_ok: + if (!sym_is_choice(sym)) + continue; + /* The choice symbol only has a set value (and thus is not new) + * if all its visible childs have values. + */ + prop = sym_get_choice_prop(sym); + flags = sym->flags; + expr_list_for_each_sym(prop->expr, e, choice_sym) + if (choice_sym->visible != no) + flags &= choice_sym->flags; + sym->flags &= flags | ~SYMBOL_DEF_USER; + } + + for_all_symbols(i, sym) { + if (sym_has_value(sym) && !sym_is_choice_value(sym)) { + /* Reset values of generates values, so they'll appear + * as new, if they should become visible, but that + * doesn't quite work if the Kconfig and the saved + * configuration disagree. + */ + if (sym->visible == no && !conf_unsaved) + sym->flags &= ~SYMBOL_DEF_USER; + switch (sym->type) { + case S_STRING: + case S_INT: + case S_HEX: + /* Reset a string value if it's out of range */ + if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) + break; + sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); + conf_unsaved++; + break; + default: + break; + } + } + } + + sym_add_change_count(conf_warnings || conf_unsaved); + + return 0; +} + +/* Write a S_STRING */ +static void conf_write_string(bool headerfile, const char *name, + const char *str, FILE *out) +{ + int l; + if (headerfile) + fprintf(out, "#define %s%s \"", CONFIG_, name); + else + fprintf(out, "%s%s=\"", CONFIG_, name); + + while (1) { + l = strcspn(str, "\"\\"); + if (l) { + xfwrite(str, l, 1, out); + str += l; + } + if (!*str) + break; + fprintf(out, "\\%c", *str++); + } + fputs("\"\n", out); +} + +static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no) +{ + const char *str; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (sym_get_tristate_value(sym)) { + case no: + if (write_no) + fprintf(out, "# %s%s is not set\n", + CONFIG_, sym->name); + break; + case mod: + fprintf(out, "%s%s=m\n", CONFIG_, sym->name); + break; + case yes: + fprintf(out, "%s%s=y\n", CONFIG_, sym->name); + break; + } + break; + case S_STRING: + conf_write_string(false, sym->name, sym_get_string_value(sym), out); + break; + case S_HEX: + case S_INT: + str = sym_get_string_value(sym); + fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str); + break; + case S_OTHER: + case S_UNKNOWN: + break; + } +} + +/* + * Write out a minimal config. + * All values that has default values are skipped as this is redundant. + */ +int conf_write_defconfig(const char *filename) +{ + struct symbol *sym; + struct menu *menu; + FILE *out; + + out = fopen(filename, "w"); + if (!out) + return 1; + + sym_clear_all_valid(); + + /* Traverse all menus to find all relevant symbols */ + menu = rootmenu.list; + + while (menu != NULL) + { + sym = menu->sym; + if (sym == NULL) { + if (!menu_is_visible(menu)) + goto next_menu; + } else if (!sym_is_choice(sym)) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE)) + goto next_menu; + sym->flags &= ~SYMBOL_WRITE; + /* If we cannot change the symbol - skip */ + if (!sym_is_changable(sym)) + goto next_menu; + /* If symbol equals to default value - skip */ + if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0) + goto next_menu; + + /* + * If symbol is a choice value and equals to the + * default for a choice - skip. + * But only if value is bool and equal to "y" and + * choice is not "optional". + * (If choice is "optional" then all values can be "n") + */ + if (sym_is_choice_value(sym)) { + struct symbol *cs; + struct symbol *ds; + + cs = prop_get_symbol(sym_get_choice_prop(sym)); + ds = sym_choice_default(cs); + if (!sym_is_optional(cs) && sym == ds) { + if ((sym->type == S_BOOLEAN) && + sym_get_tristate_value(sym) == yes) + goto next_menu; + } + } + conf_write_symbol(sym, out, true); + } +next_menu: + if (menu->list != NULL) { + menu = menu->list; + } + else if (menu->next != NULL) { + menu = menu->next; + } else { + while ((menu = menu->parent)) { + if (menu->next != NULL) { + menu = menu->next; + break; + } + } + } + } + fclose(out); + return 0; +} + +int conf_write(const char *name) +{ + FILE *out; + struct symbol *sym; + struct menu *menu; + const char *basename; + const char *str; + char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; + time_t now; + int use_timestamp = 1; + char *env; + + dirname[0] = 0; + if (name && name[0]) { + struct stat st; + char *slash; + + if (!stat(name, &st) && S_ISDIR(st.st_mode)) { + strcpy(dirname, name); + strcat(dirname, "/"); + basename = conf_get_configname(); + } else if ((slash = strrchr(name, '/'))) { + int size = slash - name + 1; + memcpy(dirname, name, size); + dirname[size] = 0; + if (slash[1]) + basename = slash + 1; + else + basename = conf_get_configname(); + } else + basename = name; + } else + basename = conf_get_configname(); + + sprintf(newname, "%s%s", dirname, basename); + env = getenv("KCONFIG_OVERWRITECONFIG"); + if (!env || !*env) { + sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); + out = fopen(tmpname, "w"); + } else { + *tmpname = 0; + out = fopen(newname, "w"); + } + if (!out) + return 1; + + time(&now); + env = getenv("KCONFIG_NOTIMESTAMP"); + if (env && *env) + use_timestamp = 0; + + fprintf(out, _("#\n" + "# Automatically generated make config: don't edit\n" + "# %s\n" + "%s%s" + "#\n"), + rootmenu.prompt->text, + use_timestamp ? "# " : "", + use_timestamp ? ctime(&now) : ""); + + if (!conf_get_changed()) + sym_clear_all_valid(); + + menu = rootmenu.list; + while (menu) { + sym = menu->sym; + if (!sym) { + if (!menu_is_visible(menu)) + goto next; + str = menu_get_prompt(menu); + fprintf(out, "\n" + "#\n" + "# %s\n" + "#\n", str); + } else if (!(sym->flags & SYMBOL_CHOICE)) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE)) + goto next; + sym->flags &= ~SYMBOL_WRITE; + /* Write config symbol to file */ + conf_write_symbol(sym, out, true); + } + +next: + if (menu->list) { + menu = menu->list; + continue; + } + if (menu->next) + menu = menu->next; + else while ((menu = menu->parent)) { + if (menu->next) { + menu = menu->next; + break; + } + } + } + fclose(out); + + if (*tmpname) { + strcat(dirname, basename); + strcat(dirname, ".old"); + rename(newname, dirname); + if (rename(tmpname, newname)) + return 1; + } + +// conf_message(_("configuration written to %s"), newname); + + sym_set_change_count(0); + + return 0; +} +#if 0 + +static int conf_split_config(void) +{ + const char *name; + char path[PATH_MAX+1]; + char *s, *d, c; + struct symbol *sym; + struct stat sb; + int res, i, fd; + + name = conf_get_autoconfig_name(); + conf_read_simple(name, S_DEF_AUTO); + + //if (chdir("include/config")) + // return 1; + + res = 0; + for_all_symbols(i, sym) { + sym_calc_value(sym); + if ((sym->flags & SYMBOL_AUTO) || !sym->name) + continue; + if (sym->flags & SYMBOL_WRITE) { + if (sym->flags & SYMBOL_DEF_AUTO) { + /* + * symbol has old and new value, + * so compare them... + */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_get_tristate_value(sym) == + sym->def[S_DEF_AUTO].tri) + continue; + break; + case S_STRING: + case S_HEX: + case S_INT: + if (!strcmp(sym_get_string_value(sym), + sym->def[S_DEF_AUTO].val)) + continue; + break; + default: + break; + } + } else { + /* + * If there is no old value, only 'no' (unset) + * is allowed as new value. + */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_get_tristate_value(sym) == no) + continue; + break; + default: + break; + } + } + } else if (!(sym->flags & SYMBOL_DEF_AUTO)) + /* There is neither an old nor a new value. */ + continue; + /* else + * There is an old value, but no new value ('no' (unset) + * isn't saved in auto.conf, so the old value is always + * different from 'no'). + */ + + /* Replace all '_' and append ".h" */ + s = sym->name; + d = path; + while ((c = *s++)) { + c = tolower(c); + *d++ = (c == '_') ? '/' : c; + } + strcpy(d, ".h"); + + /* Assume directory path already exists. */ + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == -1) { + if (errno != ENOENT) { + res = 1; + break; + } + /* + * Create directory components, + * unless they exist already. + */ + d = path; + while ((d = strchr(d, '/'))) { + *d = 0; + if (stat(path, &sb) && mkdir(path, 0755)) { + res = 1; + goto out; + } + *d++ = '/'; + } + /* Try it again. */ + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == -1) { + res = 1; + break; + } + } + close(fd); + } +out: + if (chdir("../..")) + return 1; + + return res; +} +#endif +int conf_write_autoconf(void) +{ + struct symbol *sym; + const char *str; + const char *name; + FILE *out, *out_h, *out_inc; + time_t now; + int i; + + sym_clear_all_valid(); + + /*if (conf_split_config()) + { + printf("ERR: conf_split_config"); + return 1; + }*/ + + out = fopen(".tmpconfig", "w"); + if (!out) + { + printf("ERR: .tmpconfig"); + return 1; + } + + out_h = fopen(".tmpconfig.h", "w"); + if (!out_h) { + fclose(out); + return 1; + } + + out_inc = fopen(".tmpconfig.inc", "w"); + if (!out_h) { + fclose(out); + fclose(out_h); + return 1; + } + + + time(&now); + fprintf(out, "#\n" + "# Automatically generated make config: don't edit\n" + "# %s\n" + "# %s" + "#\n", + rootmenu.prompt->text, ctime(&now)); + + fprintf(out_h, "//\n" + "// Automatically generated make config: don't edit\n" + "// %s\n" + "// %s" + "// \n", + rootmenu.prompt->text, ctime(&now)); + + fprintf(out_inc, ";\n" + "; Automatically generated make config: don't edit\n" + "; %s\n" + "; %s" + ";\n", + rootmenu.prompt->text, ctime(&now)); + + + fprintf(out_h, "#define CONFIG_IS_BUILTIN 1\n"); + fprintf(out_h, "#define CONFIG_IS_MODULE 2\n"); + + + for_all_symbols(i, sym) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE) || !sym->name) + continue; + + /* write symbol to config file */ + conf_write_symbol(sym, out, false); + + /* update autoconf and tristate files */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (sym_get_tristate_value(sym)) { + case no: + fprintf(out_inc, "%s%s EQU 0\n", + CONFIG_, sym->name); + + break; + case mod: + fprintf(out_inc, "%s%s EQU 1\n", + CONFIG_, sym->name); + fprintf(out_h, "#define %s%s CONFIG_IS_MODULE\n", + CONFIG_, sym->name); + + break; + case yes: + fprintf(out_inc, "%s%s EQU 1\n", + CONFIG_, sym->name); + fprintf(out_h, "#define %s%s CONFIG_IS_BUILTIN\n", + CONFIG_, sym->name); + break; + } + break; + case S_STRING: + conf_write_string(true, sym->name, sym_get_string_value(sym), out_h); + break; + case S_HEX: + str = sym_get_string_value(sym); + if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { + fprintf(out_inc, "%s%s EQU 0x%s\n", + CONFIG_, sym->name, str); + fprintf(out_h, "#define %s%s 0x%s\n", + CONFIG_, sym->name, str); + break; + } + case S_INT: + str = sym_get_string_value(sym); + fprintf(out_inc, "%s%s EQU %s\n", + CONFIG_, sym->name, str); + fprintf(out_h, "#define %s%s %s\n", + CONFIG_, sym->name, str); + break; + default: + break; + } + } + fclose(out); + fclose(out_h); + + name = getenv("CCONFIG_AUTOHEADER"); + if (!name) name = "autoconf.h"; + if (rename(".tmpconfig.h", name)) + return 1; + + name = getenv("CCONFIG_AUTOINC"); + if (!name) name = "autoconf.inc"; + if (rename(".tmpconfig.inc", name)) + return 1; + + + name = conf_get_autoconfig_name(); + /* + * This must be the last step, kbuild has a dependency on auto.conf + * and this marks the successful completion of the previous steps. + */ + if (rename(".tmpconfig", name)) + { + printf("rename"); + return 1; + } + return 0; +} + +static int sym_change_count; +static void (*conf_changed_callback)(void); + +void sym_set_change_count(int count) +{ + int _sym_change_count = sym_change_count; + sym_change_count = count; + if (conf_changed_callback && + (bool)_sym_change_count != (bool)count) + conf_changed_callback(); +} + +void sym_add_change_count(int count) +{ + sym_set_change_count(count + sym_change_count); +} + +bool conf_get_changed(void) +{ + return sym_change_count; +} + +void conf_set_changed_callback(void (*fn)(void)) +{ + conf_changed_callback = fn; +} + +static void randomize_choice_values(struct symbol *csym) +{ + struct property *prop; + struct symbol *sym; + struct expr *e; + int cnt, def; + + /* + * If choice is mod then we may have more items selected + * and if no then no-one. + * In both cases stop. + */ + if (csym->curr.tri != yes) + return; + + prop = sym_get_choice_prop(csym); + + /* count entries in choice block */ + cnt = 0; + expr_list_for_each_sym(prop->expr, e, sym) + cnt++; + + /* + * find a random value and set it to yes, + * set the rest to no so we have only one set + */ + def = (rand() % cnt); + + cnt = 0; + expr_list_for_each_sym(prop->expr, e, sym) { + if (def == cnt++) { + sym->def[S_DEF_USER].tri = yes; + csym->def[S_DEF_USER].val = sym; + } + else { + sym->def[S_DEF_USER].tri = no; + } + } + csym->flags |= SYMBOL_DEF_USER; + /* clear VALID to get value calculated */ + csym->flags &= ~(SYMBOL_VALID); +} + +static void set_all_choice_values(struct symbol *csym) +{ + struct property *prop; + struct symbol *sym; + struct expr *e; + + prop = sym_get_choice_prop(csym); + + /* + * Set all non-assinged choice values to no + */ + expr_list_for_each_sym(prop->expr, e, sym) { + if (!sym_has_value(sym)) + sym->def[S_DEF_USER].tri = no; + } + csym->flags |= SYMBOL_DEF_USER; + /* clear VALID to get value calculated */ + csym->flags &= ~(SYMBOL_VALID); +} + +void conf_set_all_new_symbols(enum conf_def_mode mode) +{ + struct symbol *sym, *csym; + int i, cnt; + + for_all_symbols(i, sym) { + if (sym_has_value(sym)) + continue; + switch (sym_get_type(sym)) { + case S_BOOLEAN: + case S_TRISTATE: + switch (mode) { + case def_yes: + sym->def[S_DEF_USER].tri = yes; + break; + case def_mod: + sym->def[S_DEF_USER].tri = mod; + break; + case def_no: + sym->def[S_DEF_USER].tri = no; + break; + case def_random: + cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2; + sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt); + break; + default: + continue; + } + if (!(sym_is_choice(sym) && mode == def_random)) + sym->flags |= SYMBOL_DEF_USER; + break; + default: + break; + } + + } + + sym_clear_all_valid(); + + /* + * We have different type of choice blocks. + * If curr.tri equals to mod then we can select several + * choice symbols in one block. + * In this case we do nothing. + * If curr.tri equals yes then only one symbol can be + * selected in a choice block and we set it to yes, + * and the rest to no. + */ + for_all_symbols(i, csym) { + if (sym_has_value(csym) || !sym_is_choice(csym)) + continue; + + sym_calc_value(csym); + if (mode == def_random) + randomize_choice_values(csym); + else + set_all_choice_values(csym); + } +} diff --git a/i386/config/.svn/text-base/dialog.h.svn-base b/i386/config/.svn/text-base/dialog.h.svn-base new file mode 100644 index 0000000..b5211fc --- /dev/null +++ b/i386/config/.svn/text-base/dialog.h.svn-base @@ -0,0 +1,230 @@ +/* + * dialog.h -- common declarations for all dialog modules + * + * AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef KBUILD_NO_NLS +# include +#else +# define gettext(Msgid) ((const char *) (Msgid)) +#endif + +#ifdef __sun__ +#define CURS_MACROS +#endif +#include CURSES_LOC + +/* + * Colors in ncurses 1.9.9e do not work properly since foreground and + * background colors are OR'd rather than separately masked. This version + * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible + * with standard curses. The simplest fix (to make this work with standard + * curses) uses the wbkgdset() function, not used in the original hack. + * Turn it off if we're building with 1.9.9e, since it just confuses things. + */ +#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE) +#define OLD_NCURSES 1 +#undef wbkgdset +#define wbkgdset(w,p) /*nothing */ +#else +#define OLD_NCURSES 0 +#endif + +#define TR(params) _tracef params + +#define KEY_ESC 27 +#define TAB 9 +#define MAX_LEN 2048 +#define BUF_SIZE (10*1024) +#define MIN(x,y) (x < y ? x : y) +#define MAX(x,y) (x > y ? x : y) + +#ifndef ACS_ULCORNER +#define ACS_ULCORNER '+' +#endif +#ifndef ACS_LLCORNER +#define ACS_LLCORNER '+' +#endif +#ifndef ACS_URCORNER +#define ACS_URCORNER '+' +#endif +#ifndef ACS_LRCORNER +#define ACS_LRCORNER '+' +#endif +#ifndef ACS_HLINE +#define ACS_HLINE '-' +#endif +#ifndef ACS_VLINE +#define ACS_VLINE '|' +#endif +#ifndef ACS_LTEE +#define ACS_LTEE '+' +#endif +#ifndef ACS_RTEE +#define ACS_RTEE '+' +#endif +#ifndef ACS_UARROW +#define ACS_UARROW '^' +#endif +#ifndef ACS_DARROW +#define ACS_DARROW 'v' +#endif + +/* error return codes */ +#define ERRDISPLAYTOOSMALL (KEY_MAX + 1) + +/* + * Color definitions + */ +struct dialog_color { + chtype atr; /* Color attribute */ + int fg; /* foreground */ + int bg; /* background */ + int hl; /* highlight this item */ +}; + +struct dialog_info { + const char *backtitle; + struct dialog_color screen; + struct dialog_color shadow; + struct dialog_color dialog; + struct dialog_color title; + struct dialog_color border; + struct dialog_color button_active; + struct dialog_color button_inactive; + struct dialog_color button_key_active; + struct dialog_color button_key_inactive; + struct dialog_color button_label_active; + struct dialog_color button_label_inactive; + struct dialog_color inputbox; + struct dialog_color inputbox_border; + struct dialog_color searchbox; + struct dialog_color searchbox_title; + struct dialog_color searchbox_border; + struct dialog_color position_indicator; + struct dialog_color menubox; + struct dialog_color menubox_border; + struct dialog_color item; + struct dialog_color item_selected; + struct dialog_color tag; + struct dialog_color tag_selected; + struct dialog_color tag_key; + struct dialog_color tag_key_selected; + struct dialog_color check; + struct dialog_color check_selected; + struct dialog_color uarrow; + struct dialog_color darrow; +}; + +/* + * Global variables + */ +extern struct dialog_info dlg; +extern char dialog_input_result[]; + +/* + * Function prototypes + */ + +/* item list as used by checklist and menubox */ +void item_reset(void); +void item_make(const char *fmt, ...); +void item_add_str(const char *fmt, ...); +void item_set_tag(char tag); +void item_set_data(void *p); +void item_set_selected(int val); +int item_activate_selected(void); +void *item_data(void); +char item_tag(void); + +/* item list manipulation for lxdialog use */ +#define MAXITEMSTR 200 +struct dialog_item { + char str[MAXITEMSTR]; /* promtp displayed */ + char tag; + void *data; /* pointer to menu item - used by menubox+checklist */ + int selected; /* Set to 1 by dialog_*() function if selected. */ +}; + +/* list of lialog_items */ +struct dialog_list { + struct dialog_item node; + struct dialog_list *next; +}; + +extern struct dialog_list *item_cur; +extern struct dialog_list item_nil; +extern struct dialog_list *item_head; + +int item_count(void); +void item_set(int n); +int item_n(void); +const char *item_str(void); +int item_is_selected(void); +int item_is_tag(char tag); +#define item_foreach() \ + for (item_cur = item_head ? item_head: item_cur; \ + item_cur && (item_cur != &item_nil); item_cur = item_cur->next) + +/* generic key handlers */ +int on_key_esc(WINDOW *win); +int on_key_resize(void); + +int init_dialog(const char *backtitle); +void set_dialog_backtitle(const char *backtitle); +void end_dialog(int x, int y); +void attr_clear(WINDOW * win, int height, int width, chtype attr); +void dialog_clear(void); +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x); +void print_button(WINDOW * win, const char *label, int y, int x, int selected); +void print_title(WINDOW *dialog, const char *title, int width); +void draw_box(WINDOW * win, int y, int x, int height, int width, chtype box, + chtype border); +void draw_shadow(WINDOW * win, int y, int x, int height, int width); + +int first_alpha(const char *string, const char *exempt); +int dialog_yesno(const char *title, const char *prompt, int height, int width); +int dialog_msgbox(const char *title, const char *prompt, int height, + int width, int pause); +int dialog_textbox(const char *title, const char *file, int height, int width); +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll); +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height); +extern char dialog_input_result[]; +int dialog_inputbox(const char *title, const char *prompt, int height, + int width, const char *init); + +/* + * This is the base for fictitious keys, which activate + * the buttons. + * + * Mouse-generated keys are the following: + * -- the first 32 are used as numbers, in addition to '0'-'9' + * -- the lowercase are used to signal mouse-enter events (M_EVENT + 'o') + * -- uppercase chars are used to invoke the button (M_EVENT + 'O') + */ +#define M_EVENT (KEY_MAX+1) diff --git a/i386/config/.svn/text-base/expr.c.svn-base b/i386/config/.svn/text-base/expr.c.svn-base new file mode 100644 index 0000000..0010034 --- /dev/null +++ b/i386/config/.svn/text-base/expr.c.svn-base @@ -0,0 +1,1173 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#define DEBUG_EXPR 0 + +struct expr *expr_alloc_symbol(struct symbol *sym) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = E_SYMBOL; + e->left.sym = sym; + return e; +} + +struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = type; + e->left.expr = ce; + return e; +} + +struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = type; + e->left.expr = e1; + e->right.expr = e2; + return e; +} + +struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = type; + e->left.sym = s1; + e->right.sym = s2; + return e; +} + +struct expr *expr_alloc_and(struct expr *e1, struct expr *e2) +{ + if (!e1) + return e2; + return e2 ? expr_alloc_two(E_AND, e1, e2) : e1; +} + +struct expr *expr_alloc_or(struct expr *e1, struct expr *e2) +{ + if (!e1) + return e2; + return e2 ? expr_alloc_two(E_OR, e1, e2) : e1; +} + +struct expr *expr_copy(const struct expr *org) +{ + struct expr *e; + + if (!org) + return NULL; + + e = malloc(sizeof(*org)); + memcpy(e, org, sizeof(*org)); + switch (org->type) { + case E_SYMBOL: + e->left = org->left; + break; + case E_NOT: + e->left.expr = expr_copy(org->left.expr); + break; + case E_EQUAL: + case E_UNEQUAL: + e->left.sym = org->left.sym; + e->right.sym = org->right.sym; + break; + case E_AND: + case E_OR: + case E_LIST: + e->left.expr = expr_copy(org->left.expr); + e->right.expr = expr_copy(org->right.expr); + break; + default: + printf("can't copy type %d\n", e->type); + free(e); + e = NULL; + break; + } + + return e; +} + +void expr_free(struct expr *e) +{ + if (!e) + return; + + switch (e->type) { + case E_SYMBOL: + break; + case E_NOT: + expr_free(e->left.expr); + return; + case E_EQUAL: + case E_UNEQUAL: + break; + case E_OR: + case E_AND: + expr_free(e->left.expr); + expr_free(e->right.expr); + break; + default: + printf("how to free type %d?\n", e->type); + break; + } + free(e); +} + +static int trans_count; + +#define e1 (*ep1) +#define e2 (*ep2) + +static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2) +{ + if (e1->type == type) { + __expr_eliminate_eq(type, &e1->left.expr, &e2); + __expr_eliminate_eq(type, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + __expr_eliminate_eq(type, &e1, &e2->left.expr); + __expr_eliminate_eq(type, &e1, &e2->right.expr); + return; + } + if (e1->type == E_SYMBOL && e2->type == E_SYMBOL && + e1->left.sym == e2->left.sym && + (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) + return; + if (!expr_eq(e1, e2)) + return; + trans_count++; + expr_free(e1); expr_free(e2); + switch (type) { + case E_OR: + e1 = expr_alloc_symbol(&symbol_no); + e2 = expr_alloc_symbol(&symbol_no); + break; + case E_AND: + e1 = expr_alloc_symbol(&symbol_yes); + e2 = expr_alloc_symbol(&symbol_yes); + break; + default: + ; + } +} + +void expr_eliminate_eq(struct expr **ep1, struct expr **ep2) +{ + if (!e1 || !e2) + return; + switch (e1->type) { + case E_OR: + case E_AND: + __expr_eliminate_eq(e1->type, ep1, ep2); + default: + ; + } + if (e1->type != e2->type) switch (e2->type) { + case E_OR: + case E_AND: + __expr_eliminate_eq(e2->type, ep1, ep2); + default: + ; + } + e1 = expr_eliminate_yn(e1); + e2 = expr_eliminate_yn(e2); +} + +#undef e1 +#undef e2 + +int expr_eq(struct expr *e1, struct expr *e2) +{ + int res, old_count; + + if (e1->type != e2->type) + return 0; + switch (e1->type) { + case E_EQUAL: + case E_UNEQUAL: + return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym; + case E_SYMBOL: + return e1->left.sym == e2->left.sym; + case E_NOT: + return expr_eq(e1->left.expr, e2->left.expr); + case E_AND: + case E_OR: + e1 = expr_copy(e1); + e2 = expr_copy(e2); + old_count = trans_count; + expr_eliminate_eq(&e1, &e2); + res = (e1->type == E_SYMBOL && e2->type == E_SYMBOL && + e1->left.sym == e2->left.sym); + expr_free(e1); + expr_free(e2); + trans_count = old_count; + return res; + case E_LIST: + case E_RANGE: + case E_NONE: + /* panic */; + } + + if (DEBUG_EXPR) { + expr_fprint(e1, stdout); + printf(" = "); + expr_fprint(e2, stdout); + printf(" ?\n"); + } + + return 0; +} + +struct expr *expr_eliminate_yn(struct expr *e) +{ + struct expr *tmp; + + if (e) switch (e->type) { + case E_AND: + e->left.expr = expr_eliminate_yn(e->left.expr); + e->right.expr = expr_eliminate_yn(e->right.expr); + if (e->left.expr->type == E_SYMBOL) { + if (e->left.expr->left.sym == &symbol_no) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + e->right.expr = NULL; + return e; + } else if (e->left.expr->left.sym == &symbol_yes) { + free(e->left.expr); + tmp = e->right.expr; + *e = *(e->right.expr); + free(tmp); + return e; + } + } + if (e->right.expr->type == E_SYMBOL) { + if (e->right.expr->left.sym == &symbol_no) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + e->right.expr = NULL; + return e; + } else if (e->right.expr->left.sym == &symbol_yes) { + free(e->right.expr); + tmp = e->left.expr; + *e = *(e->left.expr); + free(tmp); + return e; + } + } + break; + case E_OR: + e->left.expr = expr_eliminate_yn(e->left.expr); + e->right.expr = expr_eliminate_yn(e->right.expr); + if (e->left.expr->type == E_SYMBOL) { + if (e->left.expr->left.sym == &symbol_no) { + free(e->left.expr); + tmp = e->right.expr; + *e = *(e->right.expr); + free(tmp); + return e; + } else if (e->left.expr->left.sym == &symbol_yes) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + e->right.expr = NULL; + return e; + } + } + if (e->right.expr->type == E_SYMBOL) { + if (e->right.expr->left.sym == &symbol_no) { + free(e->right.expr); + tmp = e->left.expr; + *e = *(e->left.expr); + free(tmp); + return e; + } else if (e->right.expr->left.sym == &symbol_yes) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + e->right.expr = NULL; + return e; + } + } + break; + default: + ; + } + return e; +} + +/* + * bool FOO!=n => FOO + */ +struct expr *expr_trans_bool(struct expr *e) +{ + if (!e) + return NULL; + switch (e->type) { + case E_AND: + case E_OR: + case E_NOT: + e->left.expr = expr_trans_bool(e->left.expr); + e->right.expr = expr_trans_bool(e->right.expr); + break; + case E_UNEQUAL: + // FOO!=n -> FOO + if (e->left.sym->type == S_TRISTATE) { + if (e->right.sym == &symbol_no) { + e->type = E_SYMBOL; + e->right.sym = NULL; + } + } + break; + default: + ; + } + return e; +} + +/* + * e1 || e2 -> ? + */ +static struct expr *expr_join_or(struct expr *e1, struct expr *e2) +{ + struct expr *tmp; + struct symbol *sym1, *sym2; + + if (expr_eq(e1, e2)) + return expr_copy(e1); + if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT) + return NULL; + if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT) + return NULL; + if (e1->type == E_NOT) { + tmp = e1->left.expr; + if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL) + return NULL; + sym1 = tmp->left.sym; + } else + sym1 = e1->left.sym; + if (e2->type == E_NOT) { + if (e2->left.expr->type != E_SYMBOL) + return NULL; + sym2 = e2->left.expr->left.sym; + } else + sym2 = e2->left.sym; + if (sym1 != sym2) + return NULL; + if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE) + return NULL; + if (sym1->type == S_TRISTATE) { + if (e1->type == E_EQUAL && e2->type == E_EQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || + (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { + // (a='y') || (a='m') -> (a!='n') + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no); + } + if (e1->type == E_EQUAL && e2->type == E_EQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { + // (a='y') || (a='n') -> (a!='m') + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod); + } + if (e1->type == E_EQUAL && e2->type == E_EQUAL && + ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { + // (a='m') || (a='n') -> (a!='y') + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes); + } + } + if (sym1->type == S_BOOLEAN && sym1 == sym2) { + if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) || + (e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL)) + return expr_alloc_symbol(&symbol_yes); + } + + if (DEBUG_EXPR) { + printf("optimize ("); + expr_fprint(e1, stdout); + printf(") || ("); + expr_fprint(e2, stdout); + printf(")?\n"); + } + return NULL; +} + +static struct expr *expr_join_and(struct expr *e1, struct expr *e2) +{ + struct expr *tmp; + struct symbol *sym1, *sym2; + + if (expr_eq(e1, e2)) + return expr_copy(e1); + if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT) + return NULL; + if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT) + return NULL; + if (e1->type == E_NOT) { + tmp = e1->left.expr; + if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL) + return NULL; + sym1 = tmp->left.sym; + } else + sym1 = e1->left.sym; + if (e2->type == E_NOT) { + if (e2->left.expr->type != E_SYMBOL) + return NULL; + sym2 = e2->left.expr->left.sym; + } else + sym2 = e2->left.sym; + if (sym1 != sym2) + return NULL; + if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE) + return NULL; + + if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || + (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) + // (a) && (a='y') -> (a='y') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); + + if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) + // (a) && (a!='n') -> (a) + return expr_alloc_symbol(sym1); + + if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) + // (a) && (a!='m') -> (a='y') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); + + if (sym1->type == S_TRISTATE) { + if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) { + // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' + sym2 = e1->right.sym; + if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) + return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) + : expr_alloc_symbol(&symbol_no); + } + if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) { + // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' + sym2 = e2->right.sym; + if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) + return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) + : expr_alloc_symbol(&symbol_no); + } + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) + // (a!='y') && (a!='n') -> (a='m') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod); + + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || + (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) + // (a!='y') && (a!='m') -> (a='n') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_no); + + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && + ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) + // (a!='m') && (a!='n') -> (a='m') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); + + if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || + (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || + (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) + return NULL; + } + + if (DEBUG_EXPR) { + printf("optimize ("); + expr_fprint(e1, stdout); + printf(") && ("); + expr_fprint(e2, stdout); + printf(")?\n"); + } + return NULL; +} + +static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2) +{ +#define e1 (*ep1) +#define e2 (*ep2) + struct expr *tmp; + + if (e1->type == type) { + expr_eliminate_dups1(type, &e1->left.expr, &e2); + expr_eliminate_dups1(type, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + expr_eliminate_dups1(type, &e1, &e2->left.expr); + expr_eliminate_dups1(type, &e1, &e2->right.expr); + return; + } + if (e1 == e2) + return; + + switch (e1->type) { + case E_OR: case E_AND: + expr_eliminate_dups1(e1->type, &e1, &e1); + default: + ; + } + + switch (type) { + case E_OR: + tmp = expr_join_or(e1, e2); + if (tmp) { + expr_free(e1); expr_free(e2); + e1 = expr_alloc_symbol(&symbol_no); + e2 = tmp; + trans_count++; + } + break; + case E_AND: + tmp = expr_join_and(e1, e2); + if (tmp) { + expr_free(e1); expr_free(e2); + e1 = expr_alloc_symbol(&symbol_yes); + e2 = tmp; + trans_count++; + } + break; + default: + ; + } +#undef e1 +#undef e2 +} + +static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct expr **ep2) +{ +#define e1 (*ep1) +#define e2 (*ep2) + struct expr *tmp, *tmp1, *tmp2; + + if (e1->type == type) { + expr_eliminate_dups2(type, &e1->left.expr, &e2); + expr_eliminate_dups2(type, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + expr_eliminate_dups2(type, &e1, &e2->left.expr); + expr_eliminate_dups2(type, &e1, &e2->right.expr); + } + if (e1 == e2) + return; + + switch (e1->type) { + case E_OR: + expr_eliminate_dups2(e1->type, &e1, &e1); + // (FOO || BAR) && (!FOO && !BAR) -> n + tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1))); + tmp2 = expr_copy(e2); + tmp = expr_extract_eq_and(&tmp1, &tmp2); + if (expr_is_yes(tmp1)) { + expr_free(e1); + e1 = expr_alloc_symbol(&symbol_no); + trans_count++; + } + expr_free(tmp2); + expr_free(tmp1); + expr_free(tmp); + break; + case E_AND: + expr_eliminate_dups2(e1->type, &e1, &e1); + // (FOO && BAR) || (!FOO || !BAR) -> y + tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1))); + tmp2 = expr_copy(e2); + tmp = expr_extract_eq_or(&tmp1, &tmp2); + if (expr_is_no(tmp1)) { + expr_free(e1); + e1 = expr_alloc_symbol(&symbol_yes); + trans_count++; + } + expr_free(tmp2); + expr_free(tmp1); + expr_free(tmp); + break; + default: + ; + } +#undef e1 +#undef e2 +} + +struct expr *expr_eliminate_dups(struct expr *e) +{ + int oldcount; + if (!e) + return e; + + oldcount = trans_count; + while (1) { + trans_count = 0; + switch (e->type) { + case E_OR: case E_AND: + expr_eliminate_dups1(e->type, &e, &e); + expr_eliminate_dups2(e->type, &e, &e); + default: + ; + } + if (!trans_count) + break; + e = expr_eliminate_yn(e); + } + trans_count = oldcount; + return e; +} + +struct expr *expr_transform(struct expr *e) +{ + struct expr *tmp; + + if (!e) + return NULL; + switch (e->type) { + case E_EQUAL: + case E_UNEQUAL: + case E_SYMBOL: + case E_LIST: + break; + default: + e->left.expr = expr_transform(e->left.expr); + e->right.expr = expr_transform(e->right.expr); + } + + switch (e->type) { + case E_EQUAL: + if (e->left.sym->type != S_BOOLEAN) + break; + if (e->right.sym == &symbol_no) { + e->type = E_NOT; + e->left.expr = expr_alloc_symbol(e->left.sym); + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_mod) { + printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_yes) { + e->type = E_SYMBOL; + e->right.sym = NULL; + break; + } + break; + case E_UNEQUAL: + if (e->left.sym->type != S_BOOLEAN) + break; + if (e->right.sym == &symbol_no) { + e->type = E_SYMBOL; + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_mod) { + printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name); + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_yes) { + e->type = E_NOT; + e->left.expr = expr_alloc_symbol(e->left.sym); + e->right.sym = NULL; + break; + } + break; + case E_NOT: + switch (e->left.expr->type) { + case E_NOT: + // !!a -> a + tmp = e->left.expr->left.expr; + free(e->left.expr); + free(e); + e = tmp; + e = expr_transform(e); + break; + case E_EQUAL: + case E_UNEQUAL: + // !a='x' -> a!='x' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL; + break; + case E_OR: + // !(a || b) -> !a && !b + tmp = e->left.expr; + e->type = E_AND; + e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr); + tmp->type = E_NOT; + tmp->right.expr = NULL; + e = expr_transform(e); + break; + case E_AND: + // !(a && b) -> !a || !b + tmp = e->left.expr; + e->type = E_OR; + e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr); + tmp->type = E_NOT; + tmp->right.expr = NULL; + e = expr_transform(e); + break; + case E_SYMBOL: + if (e->left.expr->left.sym == &symbol_yes) { + // !'y' -> 'n' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + break; + } + if (e->left.expr->left.sym == &symbol_mod) { + // !'m' -> 'm' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = E_SYMBOL; + e->left.sym = &symbol_mod; + break; + } + if (e->left.expr->left.sym == &symbol_no) { + // !'n' -> 'y' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + break; + } + break; + default: + ; + } + break; + default: + ; + } + return e; +} + +int expr_contains_symbol(struct expr *dep, struct symbol *sym) +{ + if (!dep) + return 0; + + switch (dep->type) { + case E_AND: + case E_OR: + return expr_contains_symbol(dep->left.expr, sym) || + expr_contains_symbol(dep->right.expr, sym); + case E_SYMBOL: + return dep->left.sym == sym; + case E_EQUAL: + case E_UNEQUAL: + return dep->left.sym == sym || + dep->right.sym == sym; + case E_NOT: + return expr_contains_symbol(dep->left.expr, sym); + default: + ; + } + return 0; +} + +bool expr_depends_symbol(struct expr *dep, struct symbol *sym) +{ + if (!dep) + return false; + + switch (dep->type) { + case E_AND: + return expr_depends_symbol(dep->left.expr, sym) || + expr_depends_symbol(dep->right.expr, sym); + case E_SYMBOL: + return dep->left.sym == sym; + case E_EQUAL: + if (dep->left.sym == sym) { + if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) + return true; + } + break; + case E_UNEQUAL: + if (dep->left.sym == sym) { + if (dep->right.sym == &symbol_no) + return true; + } + break; + default: + ; + } + return false; +} + +struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) +{ + struct expr *tmp = NULL; + expr_extract_eq(E_AND, &tmp, ep1, ep2); + if (tmp) { + *ep1 = expr_eliminate_yn(*ep1); + *ep2 = expr_eliminate_yn(*ep2); + } + return tmp; +} + +struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) +{ + struct expr *tmp = NULL; + expr_extract_eq(E_OR, &tmp, ep1, ep2); + if (tmp) { + *ep1 = expr_eliminate_yn(*ep1); + *ep2 = expr_eliminate_yn(*ep2); + } + return tmp; +} + +void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) +{ +#define e1 (*ep1) +#define e2 (*ep2) + if (e1->type == type) { + expr_extract_eq(type, ep, &e1->left.expr, &e2); + expr_extract_eq(type, ep, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + expr_extract_eq(type, ep, ep1, &e2->left.expr); + expr_extract_eq(type, ep, ep1, &e2->right.expr); + return; + } + if (expr_eq(e1, e2)) { + *ep = *ep ? expr_alloc_two(type, *ep, e1) : e1; + expr_free(e2); + if (type == E_AND) { + e1 = expr_alloc_symbol(&symbol_yes); + e2 = expr_alloc_symbol(&symbol_yes); + } else if (type == E_OR) { + e1 = expr_alloc_symbol(&symbol_no); + e2 = expr_alloc_symbol(&symbol_no); + } + } +#undef e1 +#undef e2 +} + +struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) +{ + struct expr *e1, *e2; + + if (!e) { + e = expr_alloc_symbol(sym); + if (type == E_UNEQUAL) + e = expr_alloc_one(E_NOT, e); + return e; + } + switch (e->type) { + case E_AND: + e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); + e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); + if (sym == &symbol_yes) + e = expr_alloc_two(E_AND, e1, e2); + if (sym == &symbol_no) + e = expr_alloc_two(E_OR, e1, e2); + if (type == E_UNEQUAL) + e = expr_alloc_one(E_NOT, e); + return e; + case E_OR: + e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); + e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); + if (sym == &symbol_yes) + e = expr_alloc_two(E_OR, e1, e2); + if (sym == &symbol_no) + e = expr_alloc_two(E_AND, e1, e2); + if (type == E_UNEQUAL) + e = expr_alloc_one(E_NOT, e); + return e; + case E_NOT: + return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); + case E_UNEQUAL: + case E_EQUAL: + if (type == E_EQUAL) { + if (sym == &symbol_yes) + return expr_copy(e); + if (sym == &symbol_mod) + return expr_alloc_symbol(&symbol_no); + if (sym == &symbol_no) + return expr_alloc_one(E_NOT, expr_copy(e)); + } else { + if (sym == &symbol_yes) + return expr_alloc_one(E_NOT, expr_copy(e)); + if (sym == &symbol_mod) + return expr_alloc_symbol(&symbol_yes); + if (sym == &symbol_no) + return expr_copy(e); + } + break; + case E_SYMBOL: + return expr_alloc_comp(type, e->left.sym, sym); + case E_LIST: + case E_RANGE: + case E_NONE: + /* panic */; + } + return NULL; +} + +tristate expr_calc_value(struct expr *e) +{ + tristate val1, val2; + const char *str1, *str2; + + if (!e) + return yes; + + switch (e->type) { + case E_SYMBOL: + sym_calc_value(e->left.sym); + return e->left.sym->curr.tri; + case E_AND: + val1 = expr_calc_value(e->left.expr); + val2 = expr_calc_value(e->right.expr); + return EXPR_AND(val1, val2); + case E_OR: + val1 = expr_calc_value(e->left.expr); + val2 = expr_calc_value(e->right.expr); + return EXPR_OR(val1, val2); + case E_NOT: + val1 = expr_calc_value(e->left.expr); + return EXPR_NOT(val1); + case E_EQUAL: + sym_calc_value(e->left.sym); + sym_calc_value(e->right.sym); + str1 = sym_get_string_value(e->left.sym); + str2 = sym_get_string_value(e->right.sym); + return !strcmp(str1, str2) ? yes : no; + case E_UNEQUAL: + sym_calc_value(e->left.sym); + sym_calc_value(e->right.sym); + str1 = sym_get_string_value(e->left.sym); + str2 = sym_get_string_value(e->right.sym); + return !strcmp(str1, str2) ? no : yes; + default: + printf("expr_calc_value: %d?\n", e->type); + return no; + } +} + +int expr_compare_type(enum expr_type t1, enum expr_type t2) +{ +#if 0 + return 1; +#else + if (t1 == t2) + return 0; + switch (t1) { + case E_EQUAL: + case E_UNEQUAL: + if (t2 == E_NOT) + return 1; + case E_NOT: + if (t2 == E_AND) + return 1; + case E_AND: + if (t2 == E_OR) + return 1; + case E_OR: + if (t2 == E_LIST) + return 1; + case E_LIST: + if (t2 == 0) + return 1; + default: + return -1; + } + printf("[%dgt%d?]", t1, t2); + return 0; +#endif +} + +static inline struct expr * +expr_get_leftmost_symbol(const struct expr *e) +{ + + if (e == NULL) + return NULL; + + while (e->type != E_SYMBOL) + e = e->left.expr; + + return expr_copy(e); +} + +/* + * Given expression `e1' and `e2', returns the leaf of the longest + * sub-expression of `e1' not containing 'e2. + */ +struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2) +{ + struct expr *ret; + + switch (e1->type) { + case E_OR: + return expr_alloc_and( + expr_simplify_unmet_dep(e1->left.expr, e2), + expr_simplify_unmet_dep(e1->right.expr, e2)); + case E_AND: { + struct expr *e; + e = expr_alloc_and(expr_copy(e1), expr_copy(e2)); + e = expr_eliminate_dups(e); + ret = (!expr_eq(e, e1)) ? e1 : NULL; + expr_free(e); + break; + } + default: + ret = e1; + break; + } + + return expr_get_leftmost_symbol(ret); +} + +void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken) +{ + if (!e) { + fn(data, NULL, "y"); + return; + } + + if (expr_compare_type(prevtoken, e->type) > 0) + fn(data, NULL, "("); + switch (e->type) { + case E_SYMBOL: + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + break; + case E_NOT: + fn(data, NULL, "!"); + expr_print(e->left.expr, fn, data, E_NOT); + break; + case E_EQUAL: + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + fn(data, NULL, "="); + fn(data, e->right.sym, e->right.sym->name); + break; + case E_UNEQUAL: + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + fn(data, NULL, "!="); + fn(data, e->right.sym, e->right.sym->name); + break; + case E_OR: + expr_print(e->left.expr, fn, data, E_OR); + fn(data, NULL, " || "); + expr_print(e->right.expr, fn, data, E_OR); + break; + case E_AND: + expr_print(e->left.expr, fn, data, E_AND); + fn(data, NULL, " && "); + expr_print(e->right.expr, fn, data, E_AND); + break; + case E_LIST: + fn(data, e->right.sym, e->right.sym->name); + if (e->left.expr) { + fn(data, NULL, " ^ "); + expr_print(e->left.expr, fn, data, E_LIST); + } + break; + case E_RANGE: + fn(data, NULL, "["); + fn(data, e->left.sym, e->left.sym->name); + fn(data, NULL, " "); + fn(data, e->right.sym, e->right.sym->name); + fn(data, NULL, "]"); + break; + default: + { + char buf[32]; + sprintf(buf, "", e->type); + fn(data, NULL, buf); + break; + } + } + if (expr_compare_type(prevtoken, e->type) > 0) + fn(data, NULL, ")"); +} + +static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) +{ + xfwrite(str, strlen(str), 1, data); +} + +void expr_fprint(struct expr *e, FILE *out) +{ + expr_print(e, expr_print_file_helper, out, E_NONE); +} + +static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) +{ + struct gstr *gs = (struct gstr*)data; + const char *sym_str = NULL; + + if (sym) + sym_str = sym_get_string_value(sym); + + if (gs->max_width) { + unsigned extra_length = strlen(str); + const char *last_cr = strrchr(gs->s, '\n'); + unsigned last_line_length; + + if (sym_str) + extra_length += 4 + strlen(sym_str); + + if (!last_cr) + last_cr = gs->s; + + last_line_length = strlen(gs->s) - (last_cr - gs->s); + + if ((last_line_length + extra_length) > gs->max_width) + str_append(gs, "\\\n"); + } + + str_append(gs, str); + if (sym && sym->type != S_UNKNOWN) + str_printf(gs, " [=%s]", sym_str); +} + +void expr_gstr_print(struct expr *e, struct gstr *gs) +{ + expr_print(e, expr_print_gstr_helper, gs, E_NONE); +} diff --git a/i386/config/.svn/text-base/expr.h.svn-base b/i386/config/.svn/text-base/expr.h.svn-base new file mode 100644 index 0000000..3d238db --- /dev/null +++ b/i386/config/.svn/text-base/expr.h.svn-base @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#ifndef EXPR_H +#define EXPR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#ifndef __cplusplus +#include +#endif + +struct file { + struct file *next; + struct file *parent; + const char *name; + int lineno; + int flags; +}; + +#define FILE_BUSY 0x0001 +#define FILE_SCANNED 0x0002 + +typedef enum tristate { + no, mod, yes +} tristate; + +enum expr_type { + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LIST, E_SYMBOL, E_RANGE +}; + +union expr_data { + struct expr *expr; + struct symbol *sym; +}; + +struct expr { + enum expr_type type; + union expr_data left, right; +}; + +#define EXPR_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2)) +#define EXPR_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2)) +#define EXPR_NOT(dep) (2-(dep)) + +#define expr_list_for_each_sym(l, e, s) \ + for (e = (l); e && (s = e->right.sym); e = e->left.expr) + +struct expr_value { + struct expr *expr; + tristate tri; +}; + +struct symbol_value { + void *val; + tristate tri; +}; + +enum symbol_type { + S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_OTHER +}; + +/* enum values are used as index to symbol.def[] */ +enum { + S_DEF_USER, /* main user value */ + S_DEF_AUTO, /* values read from auto.conf */ + S_DEF_DEF3, /* Reserved for UI usage */ + S_DEF_DEF4, /* Reserved for UI usage */ + S_DEF_COUNT +}; + +struct symbol { + struct symbol *next; + char *name; + enum symbol_type type; + struct symbol_value curr; + struct symbol_value def[S_DEF_COUNT]; + tristate visible; + int flags; + struct property *prop; + struct expr_value dir_dep; + struct expr_value rev_dep; +}; + +#define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) + +#define SYMBOL_CONST 0x0001 /* symbol is const */ +#define SYMBOL_CHECK 0x0008 /* used during dependency checking */ +#define SYMBOL_CHOICE 0x0010 /* start of a choice block (null name) */ +#define SYMBOL_CHOICEVAL 0x0020 /* used as a value in a choice block */ +#define SYMBOL_VALID 0x0080 /* set when symbol.curr is calculated */ +#define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ +#define SYMBOL_WRITE 0x0200 /* ? */ +#define SYMBOL_CHANGED 0x0400 /* ? */ +#define SYMBOL_AUTO 0x1000 /* value from environment variable */ +#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ +#define SYMBOL_WARNED 0x8000 /* warning has been issued */ + +/* Set when symbol.def[] is used */ +#define SYMBOL_DEF 0x10000 /* First bit of SYMBOL_DEF */ +#define SYMBOL_DEF_USER 0x10000 /* symbol.def[S_DEF_USER] is valid */ +#define SYMBOL_DEF_AUTO 0x20000 /* symbol.def[S_DEF_AUTO] is valid */ +#define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */ +#define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */ + +#define SYMBOL_MAXLENGTH 256 +#define SYMBOL_HASHSIZE 9973 + +/* A property represent the config options that can be associated + * with a config "symbol". + * Sample: + * config FOO + * default y + * prompt "foo prompt" + * select BAR + * config BAZ + * int "BAZ Value" + * range 1..255 + */ +enum prop_type { + P_UNKNOWN, + P_PROMPT, /* prompt "foo prompt" or "BAZ Value" */ + P_COMMENT, /* text associated with a comment */ + P_MENU, /* prompt associated with a menuconfig option */ + P_DEFAULT, /* default y */ + P_CHOICE, /* choice value */ + P_SELECT, /* select BAR */ + P_RANGE, /* range 7..100 (for a symbol) */ + P_ENV, /* value from environment variable */ + P_SYMBOL, /* where a symbol is defined */ +}; + +struct property { + struct property *next; /* next property - null if last */ + struct symbol *sym; /* the symbol for which the property is associated */ + enum prop_type type; /* type of property */ + const char *text; /* the prompt value - P_PROMPT, P_MENU, P_COMMENT */ + struct expr_value visible; + struct expr *expr; /* the optional conditional part of the property */ + struct menu *menu; /* the menu the property are associated with + * valid for: P_SELECT, P_RANGE, P_CHOICE, + * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */ + struct file *file; /* what file was this property defined */ + int lineno; /* what lineno was this property defined */ +}; + +#define for_all_properties(sym, st, tok) \ + for (st = sym->prop; st; st = st->next) \ + if (st->type == (tok)) +#define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT) +#define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE) +#define for_all_prompts(sym, st) \ + for (st = sym->prop; st; st = st->next) \ + if (st->text) + +struct menu { + struct menu *next; + struct menu *parent; + struct menu *list; + struct symbol *sym; + struct property *prompt; + struct expr *visibility; + struct expr *dep; + unsigned int flags; + char *help; + struct file *file; + int lineno; + void *data; +}; + +#define MENU_CHANGED 0x0001 +#define MENU_ROOT 0x0002 + +#ifndef SWIG + +extern struct file *file_list; +extern struct file *current_file; +struct file *lookup_file(const char *name); + +extern struct symbol symbol_yes, symbol_no, symbol_mod; +extern struct symbol *modules_sym; +extern struct symbol *sym_defconfig_list; +extern int cdebug; +struct expr *expr_alloc_symbol(struct symbol *sym); +struct expr *expr_alloc_one(enum expr_type type, struct expr *ce); +struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2); +struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2); +struct expr *expr_alloc_and(struct expr *e1, struct expr *e2); +struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); +struct expr *expr_copy(const struct expr *org); +void expr_free(struct expr *e); +int expr_eq(struct expr *e1, struct expr *e2); +void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); +tristate expr_calc_value(struct expr *e); +struct expr *expr_eliminate_yn(struct expr *e); +struct expr *expr_trans_bool(struct expr *e); +struct expr *expr_eliminate_dups(struct expr *e); +struct expr *expr_transform(struct expr *e); +int expr_contains_symbol(struct expr *dep, struct symbol *sym); +bool expr_depends_symbol(struct expr *dep, struct symbol *sym); +struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2); +struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2); +void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2); +struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); +struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); + +void expr_fprint(struct expr *e, FILE *out); +struct gstr; /* forward */ +void expr_gstr_print(struct expr *e, struct gstr *gs); + +static inline int expr_is_yes(struct expr *e) +{ + return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes); +} + +static inline int expr_is_no(struct expr *e) +{ + return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* EXPR_H */ diff --git a/i386/config/.svn/text-base/inputbox.c.svn-base b/i386/config/.svn/text-base/inputbox.c.svn-base new file mode 100644 index 0000000..dd8e587 --- /dev/null +++ b/i386/config/.svn/text-base/inputbox.c.svn-base @@ -0,0 +1,238 @@ +/* + * inputbox.c -- implements the input box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +char dialog_input_result[MAX_LEN + 1]; + +/* + * Print the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext(" Ok "), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box for inputing a string + */ +int dialog_inputbox(const char *title, const char *prompt, int height, int width, + const char *init) +{ + int i, x, y, box_y, box_x, box_width; + int input_x = 0, scroll = 0, key = 0, button = -1; + char *instr = dialog_input_result; + WINDOW *dialog; + + if (!init) + instr[0] = '\0'; + else + strcpy(instr, init); + +do_resize: + if (getmaxy(stdscr) <= (height - 2)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) <= (width - 2)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + /* Draw the input field box */ + box_width = width - 6; + getyx(dialog, y, x); + box_y = y + 2; + box_x = (width - box_width) / 2; + draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, + dlg.dialog.atr, dlg.border.atr); + + print_buttons(dialog, height, width, 0); + + /* Set up the initial value */ + wmove(dialog, box_y, box_x); + wattrset(dialog, dlg.inputbox.atr); + + input_x = strlen(instr); + + if (input_x >= box_width) { + scroll = input_x - box_width + 1; + input_x = box_width - 1; + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr[scroll + i]); + } else { + waddstr(dialog, instr); + } + + wmove(dialog, box_y, box_x + input_x); + + wrefresh(dialog); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + if (button == -1) { /* Input box selected */ + switch (key) { + case TAB: + case KEY_UP: + case KEY_DOWN: + break; + case KEY_LEFT: + continue; + case KEY_RIGHT: + continue; + case KEY_BACKSPACE: + case 127: + if (input_x || scroll) { + wattrset(dialog, dlg.inputbox.atr); + if (!input_x) { + scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, + instr[scroll + input_x + i] ? + instr[scroll + input_x + i] : ' '); + input_x = strlen(instr) - scroll; + } else + input_x--; + instr[scroll + input_x] = '\0'; + mvwaddch(dialog, box_y, input_x + box_x, ' '); + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + continue; + default: + if (key < 0x100 && isprint(key)) { + if (scroll + input_x < MAX_LEN) { + wattrset(dialog, dlg.inputbox.atr); + instr[scroll + input_x] = key; + instr[scroll + input_x + 1] = '\0'; + if (input_x == box_width - 1) { + scroll++; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr [scroll + i]); + } else { + wmove(dialog, box_y, input_x++ + box_x); + waddch(dialog, key); + } + wrefresh(dialog); + } else + flash(); /* Alarm user about overflow */ + continue; + } + } + } + switch (key) { + case 'O': + case 'o': + delwin(dialog); + return 0; + case 'H': + case 'h': + delwin(dialog); + return 1; + case KEY_UP: + case KEY_LEFT: + switch (button) { + case -1: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 0: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + case 1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + } + break; + case TAB: + case KEY_DOWN: + case KEY_RIGHT: + switch (button) { + case -1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + case 0: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 1: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + } + break; + case ' ': + case '\n': + delwin(dialog); + return (button == -1 ? 0 : button); + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return KEY_ESC; /* ESC pressed */ +} diff --git a/i386/config/.svn/text-base/lex.zconf.c.svn-base b/i386/config/.svn/text-base/lex.zconf.c.svn-base new file mode 100644 index 0000000..6eb0397 --- /dev/null +++ b/i386/config/.svn/text-base/lex.zconf.c.svn-base @@ -0,0 +1,2430 @@ + +#line 3 "scripts/kconfig/lex.zconf.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer zconf_create_buffer +#define yy_delete_buffer zconf_delete_buffer +#define yy_flex_debug zconf_flex_debug +#define yy_init_buffer zconf_init_buffer +#define yy_flush_buffer zconf_flush_buffer +#define yy_load_buffer_state zconf_load_buffer_state +#define yy_switch_to_buffer zconf_switch_to_buffer +#define yyin zconfin +#define yyleng zconfleng +#define yylex zconflex +#define yylineno zconflineno +#define yyout zconfout +#define yyrestart zconfrestart +#define yytext zconftext +#define yywrap zconfwrap +#define yyalloc zconfalloc +#define yyrealloc zconfrealloc +#define yyfree zconffree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE zconfrestart(zconfin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int zconfleng; + +extern FILE *zconfin, *zconfout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up zconftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up zconftext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via zconfrestart()), so that the user can continue scanning by + * just pointing zconfin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when zconftext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int zconfleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow zconfwrap()'s to do buffer switches + * instead of setting up a fresh zconfin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void zconfrestart (FILE *input_file ); +void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size ); +void zconf_delete_buffer (YY_BUFFER_STATE b ); +void zconf_flush_buffer (YY_BUFFER_STATE b ); +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void zconfpop_buffer_state (void ); + +static void zconfensure_buffer_stack (void ); +static void zconf_load_buffer_state (void ); +static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len ); + +void *zconfalloc (yy_size_t ); +void *zconfrealloc (void *,yy_size_t ); +void zconffree (void * ); + +#define yy_new_buffer zconf_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + zconfensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + zconfensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define zconfwrap(n) 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0; + +typedef int yy_state_type; + +extern int zconflineno; + +int zconflineno = 1; + +extern char *zconftext; +#define yytext_ptr zconftext +static yyconst flex_int16_t yy_nxt[][17] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + }, + + { + 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12 + }, + + { + 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12 + }, + + { + 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 18, 16, 16, 16 + }, + + { + 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 18, 16, 16, 16 + + }, + + { + 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19 + }, + + { + 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19 + }, + + { + 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, + 22, 22, 22, 22, 22, 25, 22 + }, + + { + 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, + 22, 22, 22, 22, 22, 25, 22 + }, + + { + 11, 26, 26, 27, 28, 29, 30, 31, 29, 32, + 33, 34, 35, 35, 36, 37, 38 + + }, + + { + 11, 26, 26, 27, 28, 29, 30, 31, 29, 32, + 33, 34, 35, 35, 36, 37, 38 + }, + + { + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11 + }, + + { + 11, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12 + }, + + { + 11, -13, 39, 40, -13, -13, 41, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13 + }, + + { + 11, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14 + + }, + + { + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42 + }, + + { + 11, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16 + }, + + { + 11, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17 + }, + + { + 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, 44, -18, -18, -18 + }, + + { + 11, 45, 45, -19, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45 + + }, + + { + 11, -20, 46, 47, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20 + }, + + { + 11, 48, -21, -21, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48 + }, + + { + 11, 49, 49, 50, 49, -22, 49, 49, -22, 49, + 49, 49, 49, 49, 49, -22, 49 + }, + + { + 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23 + }, + + { + 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24 + + }, + + { + 11, 51, 51, 52, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51 + }, + + { + 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26 + }, + + { + 11, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27 + }, + + { + 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, 53, -28, -28 + }, + + { + 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29 + + }, + + { + 11, 54, 54, -30, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54 + }, + + { + 11, -31, -31, -31, -31, -31, -31, 55, -31, -31, + -31, -31, -31, -31, -31, -31, -31 + }, + + { + 11, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32 + }, + + { + 11, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33 + }, + + { + 11, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, 56, 57, 57, -34, -34, -34 + + }, + + { + 11, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, 57, 57, 57, -35, -35, -35 + }, + + { + 11, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36 + }, + + { + 11, -37, -37, 58, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37 + }, + + { + 11, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, 59 + }, + + { + 11, -39, 39, 40, -39, -39, 41, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39 + + }, + + { + 11, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40 + }, + + { + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42 + }, + + { + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42 + }, + + { + 11, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43 + }, + + { + 11, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, 44, -44, -44, -44 + + }, + + { + 11, 45, 45, -45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45 + }, + + { + 11, -46, 46, 47, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46 + }, + + { + 11, 48, -47, -47, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48 + }, + + { + 11, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48 + }, + + { + 11, 49, 49, 50, 49, -49, 49, 49, -49, 49, + 49, 49, 49, 49, 49, -49, 49 + + }, + + { + 11, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50 + }, + + { + 11, -51, -51, 52, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51 + }, + + { + 11, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52 + }, + + { + 11, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53 + }, + + { + 11, 54, 54, -54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54 + + }, + + { + 11, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55 + }, + + { + 11, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, 60, 57, 57, -56, -56, -56 + }, + + { + 11, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, 57, 57, 57, -57, -57, -57 + }, + + { + 11, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58 + }, + + { + 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59 + + }, + + { + 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, 57, 57, 57, -60, -60, -60 + }, + + } ; + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up zconftext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + zconfleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 33 +#define YY_END_OF_BUFFER 34 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[61] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 34, 5, 4, 2, 3, 7, 8, 6, 32, 29, + 31, 24, 28, 27, 26, 22, 17, 13, 16, 20, + 22, 11, 12, 19, 19, 14, 22, 22, 4, 2, + 3, 3, 1, 6, 32, 29, 31, 30, 24, 23, + 26, 25, 15, 20, 9, 19, 19, 21, 10, 18 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, + 10, 1, 1, 1, 11, 12, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, + 14, 1, 1, 1, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 1, 15, 1, 1, 13, 1, 13, 13, 13, 13, + + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 1, 16, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +extern int zconf_flex_debug; +int zconf_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *zconftext; +#define YY_NO_INPUT 1 + +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#define START_STRSIZE 16 + +static struct { + struct file *file; + int lineno; +} current_pos; + +static char *text; +static int text_size, text_asize; + +struct buffer { + struct buffer *parent; + YY_BUFFER_STATE state; +}; + +struct buffer *current_buf; + +static int last_ts, first_ts; + +static void zconf_endhelp(void); +static void zconf_endfile(void); + +static void new_string(void) +{ + text = malloc(START_STRSIZE); + text_asize = START_STRSIZE; + text_size = 0; + *text = 0; +} + +static void append_string(const char *str, int size) +{ + int new_size = text_size + size + 1; + if (new_size > text_asize) { + new_size += START_STRSIZE - 1; + new_size &= -START_STRSIZE; + text = realloc(text, new_size); + text_asize = new_size; + } + memcpy(text + text_size, str, size); + text_size += size; + text[text_size] = 0; +} + +static void alloc_string(const char *str, int size) +{ + text = malloc(size + 1); + memcpy(text, str, size); + text[size] = 0; +} + +#define INITIAL 0 +#define COMMAND 1 +#define HELP 2 +#define STRING 3 +#define PARAM 4 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int zconflex_destroy (void ); + +int zconfget_debug (void ); + +void zconfset_debug (int debug_flag ); + +YY_EXTRA_TYPE zconfget_extra (void ); + +void zconfset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *zconfget_in (void ); + +void zconfset_in (FILE * in_str ); + +FILE *zconfget_out (void ); + +void zconfset_out (FILE * out_str ); + +int zconfget_leng (void ); + +char *zconfget_text (void ); + +int zconfget_lineno (void ); + +void zconfset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int zconfwrap (void ); +#else +extern int zconfwrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(zconfin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int zconflex (void); + +#define YY_DECL int zconflex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after zconftext and zconfleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + int str = 0; + int ts, i; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! zconfin ) + zconfin = stdin; + + if ( ! zconfout ) + zconfout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + zconfensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + zconf_create_buffer(zconfin,YY_BUF_SIZE ); + } + + zconf_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of zconftext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) + ++yy_cp; + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +/* rule 1 can match eol */ +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +{ + current_file->lineno++; + return T_EOL; +} + YY_BREAK +case 3: +YY_RULE_SETUP + + YY_BREAK +case 4: +YY_RULE_SETUP +{ + BEGIN(COMMAND); +} + YY_BREAK +case 5: +YY_RULE_SETUP +{ + unput(zconftext[0]); + BEGIN(COMMAND); +} + YY_BREAK + +case 6: +YY_RULE_SETUP +{ + struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); + BEGIN(PARAM); + current_pos.file = current_file; + current_pos.lineno = current_file->lineno; + if (id && id->flags & TF_COMMAND) { + zconflval.id = id; + return id->token; + } + alloc_string(zconftext, zconfleng); + zconflval.string = text; + return T_WORD; + } + YY_BREAK +case 7: +YY_RULE_SETUP + + YY_BREAK +case 8: +/* rule 8 can match eol */ +YY_RULE_SETUP +{ + BEGIN(INITIAL); + current_file->lineno++; + return T_EOL; + } + YY_BREAK + +case 9: +YY_RULE_SETUP +return T_AND; + YY_BREAK +case 10: +YY_RULE_SETUP +return T_OR; + YY_BREAK +case 11: +YY_RULE_SETUP +return T_OPEN_PAREN; + YY_BREAK +case 12: +YY_RULE_SETUP +return T_CLOSE_PAREN; + YY_BREAK +case 13: +YY_RULE_SETUP +return T_NOT; + YY_BREAK +case 14: +YY_RULE_SETUP +return T_EQUAL; + YY_BREAK +case 15: +YY_RULE_SETUP +return T_UNEQUAL; + YY_BREAK +case 16: +YY_RULE_SETUP +{ + str = zconftext[0]; + new_string(); + BEGIN(STRING); + } + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP +BEGIN(INITIAL); current_file->lineno++; return T_EOL; + YY_BREAK +case 18: +YY_RULE_SETUP +/* ignore */ + YY_BREAK +case 19: +YY_RULE_SETUP +{ + struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); + if (id && id->flags & TF_PARAM) { + zconflval.id = id; + return id->token; + } + alloc_string(zconftext, zconfleng); + zconflval.string = text; + return T_WORD; + } + YY_BREAK +case 20: +YY_RULE_SETUP +/* comment */ + YY_BREAK +case 21: +/* rule 21 can match eol */ +YY_RULE_SETUP +current_file->lineno++; + YY_BREAK +case 22: +YY_RULE_SETUP + + YY_BREAK +case YY_STATE_EOF(PARAM): +{ + BEGIN(INITIAL); + } + YY_BREAK + +case 23: +/* rule 23 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ +YY_RULE_SETUP +{ + append_string(zconftext, zconfleng); + zconflval.string = text; + return T_WORD_QUOTE; + } + YY_BREAK +case 24: +YY_RULE_SETUP +{ + append_string(zconftext, zconfleng); + } + YY_BREAK +case 25: +/* rule 25 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ +YY_RULE_SETUP +{ + append_string(zconftext + 1, zconfleng - 1); + zconflval.string = text; + return T_WORD_QUOTE; + } + YY_BREAK +case 26: +YY_RULE_SETUP +{ + append_string(zconftext + 1, zconfleng - 1); + } + YY_BREAK +case 27: +YY_RULE_SETUP +{ + if (str == zconftext[0]) { + BEGIN(PARAM); + zconflval.string = text; + return T_WORD_QUOTE; + } else + append_string(zconftext, 1); + } + YY_BREAK +case 28: +/* rule 28 can match eol */ +YY_RULE_SETUP +{ + printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); + current_file->lineno++; + BEGIN(INITIAL); + return T_EOL; + } + YY_BREAK +case YY_STATE_EOF(STRING): +{ + BEGIN(INITIAL); + } + YY_BREAK + +case 29: +YY_RULE_SETUP +{ + ts = 0; + for (i = 0; i < zconfleng; i++) { + if (zconftext[i] == '\t') + ts = (ts & ~7) + 8; + else + ts++; + } + last_ts = ts; + if (first_ts) { + if (ts < first_ts) { + zconf_endhelp(); + return T_HELPTEXT; + } + ts -= first_ts; + while (ts > 8) { + append_string(" ", 8); + ts -= 8; + } + append_string(" ", ts); + } + } + YY_BREAK +case 30: +/* rule 30 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ +YY_RULE_SETUP +{ + current_file->lineno++; + zconf_endhelp(); + return T_HELPTEXT; + } + YY_BREAK +case 31: +/* rule 31 can match eol */ +YY_RULE_SETUP +{ + current_file->lineno++; + append_string("\n", 1); + } + YY_BREAK +case 32: +YY_RULE_SETUP +{ + while (zconfleng) { + if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t')) + break; + zconfleng--; + } + append_string(zconftext, zconfleng); + if (!first_ts) + first_ts = last_ts; + } + YY_BREAK +case YY_STATE_EOF(HELP): +{ + zconf_endhelp(); + return T_HELPTEXT; + } + YY_BREAK + +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMAND): +{ + if (current_file) { + zconf_endfile(); + return T_EOL; + } + fclose(zconfin); + yyterminate(); +} + YY_BREAK +case 33: +YY_RULE_SETUP +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed zconfin at a new source and called + * zconflex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( zconfwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * zconftext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of zconflex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + zconfrestart(zconfin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + + yy_current_state = yy_nxt[yy_current_state][1]; + yy_is_jam = (yy_current_state <= 0); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up zconftext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + zconfrestart(zconfin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( zconfwrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve zconftext */ + (yy_hold_char) = *++(yy_c_buf_p); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void zconfrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + zconfensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + zconf_create_buffer(zconfin,YY_BUF_SIZE ); + } + + zconf_init_buffer(YY_CURRENT_BUFFER,input_file ); + zconf_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * zconfpop_buffer_state(); + * zconfpush_buffer_state(new_buffer); + */ + zconfensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + zconf_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (zconfwrap()) processing, but the only time this flag + * is looked at is after zconfwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void zconf_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + zconf_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with zconf_create_buffer() + * + */ + void zconf_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + zconffree((void *) b->yy_ch_buf ); + + zconffree((void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a zconfrestart() or at EOF. + */ + static void zconf_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + zconf_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then zconf_init_buffer was _probably_ + * called from zconfrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void zconf_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + zconf_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + zconfensure_buffer_stack(); + + /* This block is copied from zconf_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from zconf_switch_to_buffer. */ + zconf_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void zconfpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + zconf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + zconf_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void zconfensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + zconf_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to zconflex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * zconf_scan_bytes() instead. + */ +YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) +{ + + return zconf_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) zconfalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = zconf_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up zconftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + zconftext[zconfleng] = (yy_hold_char); \ + (yy_c_buf_p) = zconftext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + zconfleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int zconfget_lineno (void) +{ + + return zconflineno; +} + +/** Get the input stream. + * + */ +FILE *zconfget_in (void) +{ + return zconfin; +} + +/** Get the output stream. + * + */ +FILE *zconfget_out (void) +{ + return zconfout; +} + +/** Get the length of the current token. + * + */ +int zconfget_leng (void) +{ + return zconfleng; +} + +/** Get the current token. + * + */ + +char *zconfget_text (void) +{ + return zconftext; +} + +/** Set the current line number. + * @param line_number + * + */ +void zconfset_lineno (int line_number ) +{ + + zconflineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see zconf_switch_to_buffer + */ +void zconfset_in (FILE * in_str ) +{ + zconfin = in_str ; +} + +void zconfset_out (FILE * out_str ) +{ + zconfout = out_str ; +} + +int zconfget_debug (void) +{ + return zconf_flex_debug; +} + +void zconfset_debug (int bdebug ) +{ + zconf_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from zconflex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + zconfin = stdin; + zconfout = stdout; +#else + zconfin = (FILE *) 0; + zconfout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * zconflex_init() + */ + return 0; +} + +/* zconflex_destroy is for both reentrant and non-reentrant scanners. */ +int zconflex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + zconf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + zconfpop_buffer_state(); + } + + /* Destroy the stack itself. */ + zconffree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * zconflex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *zconfalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *zconfrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void zconffree (void * ptr ) +{ + free( (char *) ptr ); /* see zconfrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +void zconf_starthelp(void) +{ + new_string(); + last_ts = first_ts = 0; + BEGIN(HELP); +} + +static void zconf_endhelp(void) +{ + zconflval.string = text; + BEGIN(INITIAL); +} + +/* + * Try to open specified file with following names: + * ./name + * $(srctree)/name + * The latter is used when srctree is separate from objtree + * when compiling the kernel. + * Return NULL if file is not found. + */ +FILE *zconf_fopen(const char *name) +{ + char *env, fullname[PATH_MAX+1]; + FILE *f; + + f = fopen(name, "r"); + if (!f && name != NULL && name[0] != '/') { + env = getenv(SRCTREE); + if (env) { + sprintf(fullname, "%s/%s", env, name); + f = fopen(fullname, "r"); + } + } + return f; +} + +void zconf_initscan(const char *name) +{ + zconfin = zconf_fopen(name); + if (!zconfin) { + printf("can't find file %s\n", name); + exit(1); + } + + current_buf = malloc(sizeof(*current_buf)); + memset(current_buf, 0, sizeof(*current_buf)); + + current_file = file_lookup(name); + current_file->lineno = 1; + current_file->flags = FILE_BUSY; +} + +void zconf_nextfile(const char *name) +{ + struct file *file = file_lookup(name); + struct buffer *buf = malloc(sizeof(*buf)); + memset(buf, 0, sizeof(*buf)); + + current_buf->state = YY_CURRENT_BUFFER; + zconfin = zconf_fopen(file->name); + if (!zconfin) { + printf("%s:%d: can't open file \"%s\"\n", + zconf_curname(), zconf_lineno(), file->name); + exit(1); + } + zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE)); + buf->parent = current_buf; + current_buf = buf; + + if (file->flags & FILE_BUSY) { + printf("%s:%d: do not source '%s' from itself\n", + zconf_curname(), zconf_lineno(), name); + exit(1); + } + if (file->flags & FILE_SCANNED) { + printf("%s:%d: file '%s' is already sourced from '%s'\n", + zconf_curname(), zconf_lineno(), name, + file->parent->name); + exit(1); + } + file->flags |= FILE_BUSY; + file->lineno = 1; + file->parent = current_file; + current_file = file; +} + +static void zconf_endfile(void) +{ + struct buffer *parent; + + current_file->flags |= FILE_SCANNED; + current_file->flags &= ~FILE_BUSY; + current_file = current_file->parent; + + parent = current_buf->parent; + if (parent) { + fclose(zconfin); + zconf_delete_buffer(YY_CURRENT_BUFFER); + zconf_switch_to_buffer(parent->state); + } + free(current_buf); + current_buf = parent; +} + +int zconf_lineno(void) +{ + return current_pos.lineno; +} + +const char *zconf_curname(void) +{ + return current_pos.file ? current_pos.file->name : ""; +} + diff --git a/i386/config/.svn/text-base/lkc.h.svn-base b/i386/config/.svn/text-base/lkc.h.svn-base new file mode 100644 index 0000000..febf0c9 --- /dev/null +++ b/i386/config/.svn/text-base/lkc.h.svn-base @@ -0,0 +1,196 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#ifndef LKC_H +#define LKC_H + +#include "expr.h" + +#ifndef KBUILD_NO_NLS +# include +#else +static inline const char *gettext(const char *txt) { return txt; } +static inline void textdomain(const char *domainname) {} +static inline void bindtextdomain(const char *name, const char *dir) {} +static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; } +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LKC_DIRECT_LINK +#define P(name,type,arg) extern type name arg +#else +#include "lkc_defs.h" +#define P(name,type,arg) extern type (*name ## _p) arg +#endif +#include "lkc_proto.h" +#undef P + +#define SRCTREE "srctree" + +#ifndef PACKAGE +#define PACKAGE "linux" +#endif + +#define LOCALEDIR "/usr/share/locale" + +#define _(text) gettext(text) +#define N_(text) (text) + +#ifndef CONFIG_ +#define CONFIG_ "CONFIG_" +#endif + +#define TF_COMMAND 0x0001 +#define TF_PARAM 0x0002 +#define TF_OPTION 0x0004 + +enum conf_def_mode { + def_default, + def_yes, + def_mod, + def_no, + def_random +}; + +#define T_OPT_MODULES 1 +#define T_OPT_DEFCONFIG_LIST 2 +#define T_OPT_ENV 3 + +struct kconf_id { + int name; + int token; + unsigned int flags; + enum symbol_type stype; +}; + +#ifdef YYDEBUG +extern int zconfdebug; +#endif + +int zconfparse(void); +void zconfdump(FILE *out); +void zconf_starthelp(void); +FILE *zconf_fopen(const char *name); +void zconf_initscan(const char *name); +void zconf_nextfile(const char *name); +int zconf_lineno(void); +const char *zconf_curname(void); + +/* conf.c */ +void xfgets(char *str, int size, FILE *in); + +/* confdata.c */ +const char *conf_get_configname(void); +const char *conf_get_autoconfig_name(void); +char *conf_get_default_confname(void); +void sym_set_change_count(int count); +void sym_add_change_count(int count); +void conf_set_all_new_symbols(enum conf_def_mode mode); + +/* confdata.c and expr.c */ +static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) +{ + if (fwrite(str, len, count, out) < count) + fprintf(stderr, "\nError in writing or end of file.\n"); +} + +/* kconfig_load.c */ +void kconfig_load(void); + +/* menu.c */ +void _menu_init(void); +void menu_warn(struct menu *menu, const char *fmt, ...); +struct menu *menu_add_menu(void); +void menu_end_menu(void); +void menu_add_entry(struct symbol *sym); +void menu_end_entry(void); +void menu_add_dep(struct expr *dep); +void menu_add_visibility(struct expr *dep); +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); +struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); +void menu_add_option(int token, char *arg); +void menu_finalize(struct menu *parent); +void menu_set_type(int type); + +/* util.c */ +struct file *file_lookup(const char *name); +int file_write_dep(const char *name); + +struct gstr { + size_t len; + char *s; + /* + * when max_width is not zero long lines in string s (if any) get + * wrapped not to exceed the max_width value + */ + int max_width; +}; +struct gstr str_new(void); +struct gstr str_assign(const char *s); +void str_free(struct gstr *gs); +void str_append(struct gstr *gs, const char *s); +void str_printf(struct gstr *gs, const char *fmt, ...); +const char *str_get(struct gstr *gs); + +/* symbol.c */ +extern struct expr *sym_env_list; + +void sym_init(void); +void sym_clear_all_valid(void); +void sym_set_all_changed(void); +void sym_set_changed(struct symbol *sym); +struct symbol *sym_choice_default(struct symbol *sym); +const char *sym_get_string_default(struct symbol *sym); +struct symbol *sym_check_deps(struct symbol *sym); +struct property *prop_alloc(enum prop_type type, struct symbol *sym); +struct symbol *prop_get_symbol(struct property *prop); +struct property *sym_get_env_prop(struct symbol *sym); + +static inline tristate sym_get_tristate_value(struct symbol *sym) +{ + return sym->curr.tri; +} + + +static inline struct symbol *sym_get_choice_value(struct symbol *sym) +{ + return (struct symbol *)sym->curr.val; +} + +static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval) +{ + return sym_set_tristate_value(chval, yes); +} + +static inline bool sym_is_choice(struct symbol *sym) +{ + return sym->flags & SYMBOL_CHOICE ? true : false; +} + +static inline bool sym_is_choice_value(struct symbol *sym) +{ + return sym->flags & SYMBOL_CHOICEVAL ? true : false; +} + +static inline bool sym_is_optional(struct symbol *sym) +{ + return sym->flags & SYMBOL_OPTIONAL ? true : false; +} + +static inline bool sym_has_value(struct symbol *sym) +{ + return sym->flags & SYMBOL_DEF_USER ? true : false; +} + +#ifdef __cplusplus +} +#endif + +#endif /* LKC_H */ diff --git a/i386/config/.svn/text-base/lkc_proto.h.svn-base b/i386/config/.svn/text-base/lkc_proto.h.svn-base new file mode 100644 index 0000000..17342fe --- /dev/null +++ b/i386/config/.svn/text-base/lkc_proto.h.svn-base @@ -0,0 +1,53 @@ +#include + +/* confdata.c */ +P(conf_parse,void,(const char *name)); +P(conf_read,int,(const char *name)); +P(conf_read_simple,int,(const char *name, int)); +P(conf_write_defconfig,int,(const char *name)); +P(conf_write,int,(const char *name)); +P(conf_write_autoconf,int,(void)); +P(conf_get_changed,bool,(void)); +P(conf_set_changed_callback, void,(void (*fn)(void))); +P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap))); + +/* menu.c */ +P(rootmenu,struct menu,); + +P(menu_is_visible, bool, (struct menu *menu)); +P(menu_has_prompt, bool, (struct menu *menu)); +P(menu_get_prompt,const char *,(struct menu *menu)); +P(menu_get_root_menu,struct menu *,(struct menu *menu)); +P(menu_get_parent_menu,struct menu *,(struct menu *menu)); +P(menu_has_help,bool,(struct menu *menu)); +P(menu_get_help,const char *,(struct menu *menu)); +P(get_symbol_str, void, (struct gstr *r, struct symbol *sym)); +P(get_relations_str, struct gstr, (struct symbol **sym_arr)); +P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); + +/* symbol.c */ +P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); + +P(sym_lookup,struct symbol *,(const char *name, int flags)); +P(sym_find,struct symbol *,(const char *name)); +P(sym_expand_string_value,const char *,(const char *in)); +P(sym_re_search,struct symbol **,(const char *pattern)); +P(sym_type_name,const char *,(enum symbol_type type)); +P(sym_calc_value,void,(struct symbol *sym)); +P(sym_get_type,enum symbol_type,(struct symbol *sym)); +P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); +P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); +P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); +P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); +P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); +P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); +P(sym_is_changable,bool,(struct symbol *sym)); +P(sym_get_choice_prop,struct property *,(struct symbol *sym)); +P(sym_get_default_prop,struct property *,(struct symbol *sym)); +P(sym_get_string_value,const char *,(struct symbol *sym)); + +P(prop_get_type_name,const char *,(enum prop_type type)); + +/* expr.c */ +P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); +P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)); diff --git a/i386/config/.svn/text-base/menu.c.svn-base b/i386/config/.svn/text-base/menu.c.svn-base new file mode 100644 index 0000000..48d9f20 --- /dev/null +++ b/i386/config/.svn/text-base/menu.c.svn-base @@ -0,0 +1,608 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +static const char nohelp_text[] = N_( + "There is no help available for this option.\n"); + +struct menu rootmenu; +static struct menu **last_entry_ptr; + +struct file *file_list; +struct file *current_file; + +void menu_warn(struct menu *menu, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +static void prop_warn(struct property *prop, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +void _menu_init(void) +{ + current_entry = current_menu = &rootmenu; + last_entry_ptr = &rootmenu.list; +} + +void menu_add_entry(struct symbol *sym) +{ + struct menu *menu; + + menu = malloc(sizeof(*menu)); + memset(menu, 0, sizeof(*menu)); + menu->sym = sym; + menu->parent = current_menu; + menu->file = current_file; + menu->lineno = zconf_lineno(); + + *last_entry_ptr = menu; + last_entry_ptr = &menu->next; + current_entry = menu; + if (sym) + menu_add_symbol(P_SYMBOL, sym, NULL); +} + +void menu_end_entry(void) +{ +} + +struct menu *menu_add_menu(void) +{ + menu_end_entry(); + last_entry_ptr = ¤t_entry->list; + return current_menu = current_entry; +} + +void menu_end_menu(void) +{ + last_entry_ptr = ¤t_menu->next; + current_menu = current_menu->parent; +} + +static struct expr *menu_check_dep(struct expr *e) +{ + if (!e) + return e; + + switch (e->type) { + case E_NOT: + e->left.expr = menu_check_dep(e->left.expr); + break; + case E_OR: + case E_AND: + e->left.expr = menu_check_dep(e->left.expr); + e->right.expr = menu_check_dep(e->right.expr); + break; + case E_SYMBOL: + /* change 'm' into 'm' && MODULES */ + if (e->left.sym == &symbol_mod) + return expr_alloc_and(e, expr_alloc_symbol(modules_sym)); + break; + default: + break; + } + return e; +} + +void menu_add_dep(struct expr *dep) +{ + current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); +} + +void menu_set_type(int type) +{ + struct symbol *sym = current_entry->sym; + + if (sym->type == type) + return; + if (sym->type == S_UNKNOWN) { + sym->type = type; + return; + } + menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'", + sym->name ? sym->name : "", + sym_type_name(sym->type), sym_type_name(type)); +} + +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) +{ + struct property *prop = prop_alloc(type, current_entry->sym); + + prop->menu = current_entry; + prop->expr = expr; + prop->visible.expr = menu_check_dep(dep); + + if (prompt) { + if (isspace(*prompt)) { + prop_warn(prop, "leading whitespace ignored"); + while (isspace(*prompt)) + prompt++; + } + if (current_entry->prompt && current_entry != &rootmenu) + prop_warn(prop, "prompt redefined"); + + /* Apply all upper menus' visibilities to actual prompts. */ + if(type == P_PROMPT) { + struct menu *menu = current_entry; + + while ((menu = menu->parent) != NULL) { + if (!menu->visibility) + continue; + prop->visible.expr + = expr_alloc_and(prop->visible.expr, + menu->visibility); + } + } + + current_entry->prompt = prop; + } + prop->text = prompt; + + return prop; +} + +struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep) +{ + return menu_add_prop(type, prompt, NULL, dep); +} + +void menu_add_visibility(struct expr *expr) +{ + current_entry->visibility = expr_alloc_and(current_entry->visibility, + expr); +} + +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep) +{ + menu_add_prop(type, NULL, expr, dep); +} + +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) +{ + menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); +} + +void menu_add_option(int token, char *arg) +{ + struct property *prop; + + switch (token) { + case T_OPT_MODULES: + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(current_entry->sym); + break; + case T_OPT_DEFCONFIG_LIST: + if (!sym_defconfig_list) + sym_defconfig_list = current_entry->sym; + else if (sym_defconfig_list != current_entry->sym) + zconf_error("trying to redefine defconfig symbol"); + break; + case T_OPT_ENV: + //prop_add_env(arg); + break; + } +} + +static int menu_validate_number(struct symbol *sym, struct symbol *sym2) +{ + return sym2->type == S_INT || sym2->type == S_HEX || + (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); +} + +static void sym_check_prop(struct symbol *sym) +{ + struct property *prop; + struct symbol *sym2; + for (prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_DEFAULT: + if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && + prop->expr->type != E_SYMBOL) + prop_warn(prop, + "default for config symbol '%s'" + " must be a single symbol", sym->name); + if (prop->expr->type != E_SYMBOL) + break; + sym2 = prop_get_symbol(prop); + if (sym->type == S_HEX || sym->type == S_INT) { + if (!menu_validate_number(sym, sym2)) + prop_warn(prop, + "'%s': number is invalid", + sym->name); + } + break; + case P_SELECT: + sym2 = prop_get_symbol(prop); + if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE) + prop_warn(prop, + "config symbol '%s' uses select, but is " + "not boolean or tristate", sym->name); + else if (sym2->type != S_UNKNOWN && + sym2->type != S_BOOLEAN && + sym2->type != S_TRISTATE) + prop_warn(prop, + "'%s' has wrong type. 'select' only " + "accept arguments of boolean and " + "tristate type", sym2->name); + break; + case P_RANGE: + if (sym->type != S_INT && sym->type != S_HEX) + prop_warn(prop, "range is only allowed " + "for int or hex symbols"); + if (!menu_validate_number(sym, prop->expr->left.sym) || + !menu_validate_number(sym, prop->expr->right.sym)) + prop_warn(prop, "range is invalid"); + break; + default: + ; + } + } +} + +void menu_finalize(struct menu *parent) +{ + struct menu *menu, *last_menu; + struct symbol *sym; + struct property *prop; + struct expr *parentdep, *basedep, *dep, *dep2, **ep; + + sym = parent->sym; + if (parent->list) { + if (sym && sym_is_choice(sym)) { + if (sym->type == S_UNKNOWN) { + /* find the first choice value to find out choice type */ + current_entry = parent; + for (menu = parent->list; menu; menu = menu->next) { + if (menu->sym && menu->sym->type != S_UNKNOWN) { + menu_set_type(menu->sym->type); + break; + } + } + } + /* set the type of the remaining choice values */ + for (menu = parent->list; menu; menu = menu->next) { + current_entry = menu; + if (menu->sym && menu->sym->type == S_UNKNOWN) + menu_set_type(sym->type); + } + parentdep = expr_alloc_symbol(sym); + } else if (parent->prompt) + parentdep = parent->prompt->visible.expr; + else + parentdep = parent->dep; + + for (menu = parent->list; menu; menu = menu->next) { + basedep = expr_transform(menu->dep); + basedep = expr_alloc_and(expr_copy(parentdep), basedep); + basedep = expr_eliminate_dups(basedep); + menu->dep = basedep; + if (menu->sym) + prop = menu->sym->prop; + else + prop = menu->prompt; + for (; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + dep = expr_transform(prop->visible.expr); + dep = expr_alloc_and(expr_copy(basedep), dep); + dep = expr_eliminate_dups(dep); + if (menu->sym && menu->sym->type != S_TRISTATE) + dep = expr_trans_bool(dep); + prop->visible.expr = dep; + if (prop->type == P_SELECT) { + struct symbol *es = prop_get_symbol(prop); + es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr, + expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); + } + } + } + for (menu = parent->list; menu; menu = menu->next) + menu_finalize(menu); + } else if (sym) { + basedep = parent->prompt ? parent->prompt->visible.expr : NULL; + basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); + basedep = expr_eliminate_dups(expr_transform(basedep)); + last_menu = NULL; + for (menu = parent->next; menu; menu = menu->next) { + dep = menu->prompt ? menu->prompt->visible.expr : menu->dep; + if (!expr_contains_symbol(dep, sym)) + break; + if (expr_depends_symbol(dep, sym)) + goto next; + dep = expr_trans_compare(dep, E_UNEQUAL, &symbol_no); + dep = expr_eliminate_dups(expr_transform(dep)); + dep2 = expr_copy(basedep); + expr_eliminate_eq(&dep, &dep2); + expr_free(dep); + if (!expr_is_yes(dep2)) { + expr_free(dep2); + break; + } + expr_free(dep2); + next: + menu_finalize(menu); + menu->parent = parent; + last_menu = menu; + } + if (last_menu) { + parent->list = parent->next; + parent->next = last_menu->next; + last_menu->next = NULL; + } + + sym->dir_dep.expr = parent->dep; + } + for (menu = parent->list; menu; menu = menu->next) { + if (sym && sym_is_choice(sym) && + menu->sym && !sym_is_choice_value(menu->sym)) { + current_entry = menu; + menu->sym->flags |= SYMBOL_CHOICEVAL; + if (!menu->prompt) + menu_warn(menu, "choice value must have a prompt"); + for (prop = menu->sym->prop; prop; prop = prop->next) { + if (prop->type == P_DEFAULT) + prop_warn(prop, "defaults for choice " + "values not supported"); + if (prop->menu == menu) + continue; + if (prop->type == P_PROMPT && + prop->menu->parent->sym != sym) + prop_warn(prop, "choice value used outside its choice group"); + } + /* Non-tristate choice values of tristate choices must + * depend on the choice being set to Y. The choice + * values' dependencies were propagated to their + * properties above, so the change here must be re- + * propagated. + */ + if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { + basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); + menu->dep = expr_alloc_and(basedep, menu->dep); + for (prop = menu->sym->prop; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + prop->visible.expr = expr_alloc_and(expr_copy(basedep), + prop->visible.expr); + } + } + menu_add_symbol(P_CHOICE, sym, NULL); + prop = sym_get_choice_prop(sym); + for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) + ; + *ep = expr_alloc_one(E_LIST, NULL); + (*ep)->right.sym = menu->sym; + } + if (menu->list && (!menu->prompt || !menu->prompt->text)) { + for (last_menu = menu->list; ; last_menu = last_menu->next) { + last_menu->parent = parent; + if (!last_menu->next) + break; + } + last_menu->next = menu->next; + menu->next = menu->list; + menu->list = NULL; + } + } + + if (sym && !(sym->flags & SYMBOL_WARNED)) { + if (sym->type == S_UNKNOWN) + menu_warn(parent, "config symbol defined without type"); + + if (sym_is_choice(sym) && !parent->prompt) + menu_warn(parent, "choice must have a prompt"); + + /* Check properties connected to this symbol */ + sym_check_prop(sym); + sym->flags |= SYMBOL_WARNED; + } + + if (sym && !sym_is_optional(sym) && parent->prompt) { + sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, + expr_alloc_and(parent->prompt->visible.expr, + expr_alloc_symbol(&symbol_mod))); + } +} + +bool menu_has_prompt(struct menu *menu) +{ + if (!menu->prompt) + return false; + return true; +} + +bool menu_is_visible(struct menu *menu) +{ + struct menu *child; + struct symbol *sym; + tristate visible; + + if (!menu->prompt) + return false; + + if (menu->visibility) { + if (expr_calc_value(menu->visibility) == no) + return no; + } + + sym = menu->sym; + if (sym) { + sym_calc_value(sym); + visible = menu->prompt->visible.tri; + } else + visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr); + + if (visible != no) + return true; + + if (!sym || sym_get_tristate_value(menu->sym) == no) + return false; + + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child)) { + if (sym) + sym->flags |= SYMBOL_DEF_USER; + return true; + } + } + + return false; +} + +const char *menu_get_prompt(struct menu *menu) +{ + if (menu->prompt) + return menu->prompt->text; + else if (menu->sym) + return menu->sym->name; + return NULL; +} + +struct menu *menu_get_root_menu(struct menu *menu) +{ + return &rootmenu; +} + +struct menu *menu_get_parent_menu(struct menu *menu) +{ + enum prop_type type; + + for (; menu != &rootmenu; menu = menu->parent) { + type = menu->prompt ? menu->prompt->type : 0; + if (type == P_MENU) + break; + } + return menu; +} + +bool menu_has_help(struct menu *menu) +{ + return menu->help != NULL; +} + +const char *menu_get_help(struct menu *menu) +{ + if (menu->help) + return menu->help; + else + return ""; +} + +static void get_prompt_str(struct gstr *r, struct property *prop) +{ + int i, j; + struct menu *submenu[8], *menu; + + str_printf(r, _("Prompt: %s\n"), _(prop->text)); + str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, + prop->menu->lineno); + if (!expr_is_yes(prop->visible.expr)) { + str_append(r, _(" Depends on: ")); + expr_gstr_print(prop->visible.expr, r); + str_append(r, "\n"); + } + menu = prop->menu->parent; + for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) + submenu[i++] = menu; + if (i > 0) { + str_printf(r, _(" Location:\n")); + for (j = 4; --i >= 0; j += 2) { + menu = submenu[i]; + str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); + if (menu->sym) { + str_printf(r, " (%s [=%s])", menu->sym->name ? + menu->sym->name : _(""), + sym_get_string_value(menu->sym)); + } + str_append(r, "\n"); + } + } +} + +void get_symbol_str(struct gstr *r, struct symbol *sym) +{ + bool hit; + struct property *prop; + + if (sym && sym->name) { + str_printf(r, "Symbol: %s [=%s]\n", sym->name, + sym_get_string_value(sym)); + str_printf(r, "Type : %s\n", sym_type_name(sym->type)); + if (sym->type == S_INT || sym->type == S_HEX) { + prop = sym_get_range_prop(sym); + if (prop) { + str_printf(r, "Range : "); + expr_gstr_print(prop->expr, r); + str_append(r, "\n"); + } + } + } + for_all_prompts(sym, prop) + get_prompt_str(r, prop); + hit = false; + for_all_properties(sym, prop, P_SELECT) { + if (!hit) { + str_append(r, " Selects: "); + hit = true; + } else + str_printf(r, " && "); + expr_gstr_print(prop->expr, r); + } + if (hit) + str_append(r, "\n"); + if (sym->rev_dep.expr) { + str_append(r, _(" Selected by: ")); + expr_gstr_print(sym->rev_dep.expr, r); + str_append(r, "\n"); + } + str_append(r, "\n\n"); +} + +struct gstr get_relations_str(struct symbol **sym_arr) +{ + struct symbol *sym; + struct gstr res = str_new(); + int i; + + for (i = 0; sym_arr && (sym = sym_arr[i]); i++) + get_symbol_str(&res, sym); + if (!i) + str_append(&res, _("No matches found.\n")); + return res; +} + + +void menu_get_ext_help(struct menu *menu, struct gstr *help) +{ + struct symbol *sym = menu->sym; + + if (menu_has_help(menu)) { + if (sym->name) { + str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); + str_append(help, _(menu_get_help(menu))); + str_append(help, "\n"); + } + } else { + str_append(help, nohelp_text); + } + if (sym) + get_symbol_str(help, sym); +} diff --git a/i386/config/.svn/text-base/menubox.c.svn-base b/i386/config/.svn/text-base/menubox.c.svn-base new file mode 100644 index 0000000..1d60473 --- /dev/null +++ b/i386/config/.svn/text-base/menubox.c.svn-base @@ -0,0 +1,434 @@ +/* + * menubox.c -- implements the menu box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Changes by Clifford Wolf (god@clifford.at) + * + * [ 1998-06-13 ] + * + * *) A bugfix for the Page-Down problem + * + * *) Formerly when I used Page Down and Page Up, the cursor would be set + * to the first position in the menu box. Now lxdialog is a bit + * smarter and works more like other menu systems (just have a look at + * it). + * + * *) Formerly if I selected something my scrolling would be broken because + * lxdialog is re-invoked by the Menuconfig shell script, can't + * remember the last scrolling position, and just sets it so that the + * cursor is at the bottom of the box. Now it writes the temporary file + * lxdialog.scrltmp which contains this information. The file is + * deleted by lxdialog if the user leaves a submenu or enters a new + * one, but it would be nice if Menuconfig could make another "rm -f" + * just to be sure. Just try it out - you will recognise a difference! + * + * [ 1998-06-14 ] + * + * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files + * and menus change their size on the fly. + * + * *) If for some reason the last scrolling position is not saved by + * lxdialog, it sets the scrolling so that the selected item is in the + * middle of the menu box, not at the bottom. + * + * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) + * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus. + * This fixes a bug in Menuconfig where using ' ' to descend into menus + * would leave mis-synchronized lxdialog.scrltmp files lying around, + * fscanf would read in 'scroll', and eventually that value would get used. + */ + +#include "dialog.h" + +static int menu_width, item_x; + +/* + * Print menu item + */ +static void do_print_item(WINDOW * win, const char *item, int line_y, + int selected, int hotkey) +{ + int j; + char *menu_item = malloc(menu_width + 1); + + strncpy(menu_item, item, menu_width - item_x); + menu_item[menu_width - item_x] = '\0'; + j = first_alpha(menu_item, "YyNnMmHh"); + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, line_y, 0); +#if OLD_NCURSES + { + int i; + for (i = 0; i < menu_width; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + mvwaddstr(win, line_y, item_x, menu_item); + if (hotkey) { + wattrset(win, selected ? dlg.tag_key_selected.atr + : dlg.tag_key.atr); + mvwaddch(win, line_y, item_x + j, menu_item[j]); + } + if (selected) { + wmove(win, line_y, item_x + 1); + } + free(menu_item); + wrefresh(win); +} + +#define print_item(index, choice, selected) \ +do { \ + item_set(index); \ + do_print_item(menu, item_str(), choice, selected, !item_is_tag(':')); \ +} while (0) + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x, + int height) +{ + int cur_y, cur_x; + + getyx(win, cur_y, cur_x); + + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + wrefresh(win); + + if ((height < item_no) && (scroll + height < item_no)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + wmove(win, cur_y, cur_x); + wrefresh(win); +} + +/* + * Display the termination buttons. + */ +static void print_buttons(WINDOW * win, int height, int width, int selected) +{ + int x = width / 2 - 16; + int y = height - 2; + + print_button(win, gettext("Select"), y, x, selected == 0); + print_button(win, gettext(" Exit "), y, x + 12, selected == 1); + print_button(win, gettext(" Help "), y, x + 24, selected == 2); + + wmove(win, y, x + 1 + 12 * selected); + wrefresh(win); +} + +/* scroll up n lines (n may be negative) */ +static void do_scroll(WINDOW *win, int *scroll, int n) +{ + /* Scroll menu up */ + scrollok(win, TRUE); + wscrl(win, n); + scrollok(win, FALSE); + *scroll = *scroll + n; + wrefresh(win); +} + +/* + * Display a menu for choosing among a number of options + */ +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll) +{ + int i, j, x, y, box_x, box_y; + int height, width, menu_height; + int key = 0, button = 0, scroll = 0, choice = 0; + int first_item = 0, max_choice; + WINDOW *dialog, *menu; + +do_resize: + height = getmaxy(stdscr); + width = getmaxx(stdscr); + if (height < 15 || width < 65) + return -ERRDISPLAYTOOSMALL; + + height -= 4; + width -= 5; + menu_height = height - 10; + + max_choice = MIN(menu_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + menu_width = width - 6; + box_y = height - menu_height - 5; + box_x = (width - menu_width) / 2 - 1; + + /* create new window for the menu */ + menu = subwin(dialog, menu_height, menu_width, + y + box_y + 1, x + box_x + 1); + keypad(menu, TRUE); + + /* draw a box around the menu items */ + draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + if (menu_width >= 80) + item_x = (menu_width - 70) / 2; + else + item_x = 4; + + /* Set choice to default item */ + item_foreach() + if (selected && (selected == item_data())) + choice = item_n(); + /* get the saved scroll info */ + scroll = *s_scroll; + if ((scroll <= choice) && (scroll + max_choice > choice) && + (scroll >= 0) && (scroll + max_choice <= item_count())) { + first_item = scroll; + choice = choice - scroll; + } else { + scroll = 0; + } + if ((choice >= max_choice)) { + if (choice >= item_count() - max_choice / 2) + scroll = first_item = item_count() - max_choice; + else + scroll = first_item = choice - max_choice / 2; + choice = choice - scroll; + } + + /* Print the menu */ + for (i = 0; i < max_choice; i++) { + print_item(first_item + i, i, i == choice); + } + + wnoutrefresh(menu); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + print_buttons(dialog, height, width, 0); + wmove(menu, choice, item_x + 1); + wrefresh(menu); + + while (key != KEY_ESC) { + key = wgetch(menu); + + if (key < 256 && isalpha(key)) + key = tolower(key); + + if (strchr("ynmh", key)) + i = max_choice; + else { + for (i = choice + 1; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + if (i == max_choice) + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + } + + if (i < max_choice || + key == KEY_UP || key == KEY_DOWN || + key == '-' || key == '+' || + key == KEY_PPAGE || key == KEY_NPAGE) { + /* Remove highligt of current item */ + print_item(scroll + choice, choice, FALSE); + + if (key == KEY_UP || key == '-') { + if (choice < 2 && scroll) { + /* Scroll menu down */ + do_scroll(menu, &scroll, -1); + + print_item(scroll, 0, FALSE); + } else + choice = MAX(choice - 1, 0); + + } else if (key == KEY_DOWN || key == '+') { + print_item(scroll+choice, choice, FALSE); + + if ((choice > max_choice - 3) && + (scroll + max_choice < item_count())) { + /* Scroll menu up */ + do_scroll(menu, &scroll, 1); + + print_item(scroll+max_choice - 1, + max_choice - 1, FALSE); + } else + choice = MIN(choice + 1, max_choice - 1); + + } else if (key == KEY_PPAGE) { + scrollok(menu, TRUE); + for (i = 0; (i < max_choice); i++) { + if (scroll > 0) { + do_scroll(menu, &scroll, -1); + print_item(scroll, 0, FALSE); + } else { + if (choice > 0) + choice--; + } + } + + } else if (key == KEY_NPAGE) { + for (i = 0; (i < max_choice); i++) { + if (scroll + max_choice < item_count()) { + do_scroll(menu, &scroll, 1); + print_item(scroll+max_choice-1, + max_choice - 1, FALSE); + } else { + if (choice + 1 < max_choice) + choice++; + } + } + } else + choice = i; + + print_item(scroll + choice, choice, TRUE); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + wnoutrefresh(dialog); + wrefresh(menu); + + continue; /* wait for another key press */ + } + + switch (key) { + case KEY_LEFT: + case TAB: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 2 : (button > 2 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(menu); + break; + case ' ': + case 's': + case 'y': + case 'n': + case 'm': + case '/': + case 'h': + case '?': + case 'z': + case '\n': + /* save scroll info */ + *s_scroll = scroll; + delwin(menu); + delwin(dialog); + item_set(scroll + choice); + item_set_selected(1); + switch (key) { + case 'h': + case '?': + return 2; + case 's': + case 'y': + return 3; + case 'n': + return 4; + case 'm': + return 5; + case ' ': + return 6; + case '/': + return 7; + case 'z': + return 8; + case '\n': + return button; + } + return 0; + case 'e': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(menu); + break; + case KEY_RESIZE: + on_key_resize(); + delwin(menu); + delwin(dialog); + goto do_resize; + } + } + delwin(menu); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/.svn/text-base/nconf.h.svn-base b/i386/config/.svn/text-base/nconf.h.svn-base new file mode 100644 index 0000000..58fbda8 --- /dev/null +++ b/i386/config/.svn/text-base/nconf.h.svn-base @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2008 Nir Tzachar +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ncurses.h" + +#define max(a, b) ({\ + typeof(a) _a = a;\ + typeof(b) _b = b;\ + _a > _b ? _a : _b; }) + +#define min(a, b) ({\ + typeof(a) _a = a;\ + typeof(b) _b = b;\ + _a < _b ? _a : _b; }) + +typedef enum { + NORMAL = 1, + MAIN_HEADING, + MAIN_MENU_BOX, + MAIN_MENU_FORE, + MAIN_MENU_BACK, + MAIN_MENU_GREY, + MAIN_MENU_HEADING, + SCROLLWIN_TEXT, + SCROLLWIN_HEADING, + SCROLLWIN_BOX, + DIALOG_TEXT, + DIALOG_MENU_FORE, + DIALOG_MENU_BACK, + DIALOG_BOX, + INPUT_BOX, + INPUT_HEADING, + INPUT_TEXT, + INPUT_FIELD, + FUNCTION_TEXT, + FUNCTION_HIGHLIGHT, + ATTR_MAX +} attributes_t; +extern attributes_t attributes[]; + +typedef enum { + F_HELP = 1, + F_SYMBOL = 2, + F_INSTS = 3, + F_CONF = 4, + F_BACK = 5, + F_SAVE = 6, + F_LOAD = 7, + F_SEARCH = 8, + F_EXIT = 9, +} function_key; + +void set_colors(void); + +/* this changes the windows attributes !!! */ +void print_in_middle(WINDOW *win, + int starty, + int startx, + int width, + const char *string, + chtype color); +int get_line_length(const char *line); +int get_line_no(const char *text); +const char *get_line(const char *text, int line_no); +void fill_window(WINDOW *win, const char *text); +int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...); +int dialog_inputbox(WINDOW *main_window, + const char *title, const char *prompt, + const char *init, char *result, int result_len); +void refresh_all_windows(WINDOW *main_window); +void show_scroll_win(WINDOW *main_window, + const char *title, + const char *text); diff --git a/i386/config/.svn/text-base/symbol.c.svn-base b/i386/config/.svn/text-base/symbol.c.svn-base new file mode 100644 index 0000000..91978a3 --- /dev/null +++ b/i386/config/.svn/text-base/symbol.c.svn-base @@ -0,0 +1,1231 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +struct symbol symbol_yes = { + .name = "y", + .curr = { "y", yes }, + .flags = SYMBOL_CONST|SYMBOL_VALID, +}, symbol_mod = { + .name = "m", + .curr = { "m", mod }, + .flags = SYMBOL_CONST|SYMBOL_VALID, +}, symbol_no = { + .name = "n", + .curr = { "n", no }, + .flags = SYMBOL_CONST|SYMBOL_VALID, +}, symbol_empty = { + .name = "", + .curr = { "", no }, + .flags = SYMBOL_VALID, +}; + +struct symbol *sym_defconfig_list; +struct symbol *modules_sym; +tristate modules_val; + +struct expr *sym_env_list; + +static void sym_add_default(struct symbol *sym, const char *def) +{ + struct property *prop = prop_alloc(P_DEFAULT, sym); + + prop->expr = expr_alloc_symbol(sym_lookup(def, SYMBOL_CONST)); +} + +void sym_init(void) +{ + struct symbol *sym; + struct utsname uts; + static bool inited = false; + + if (inited) + return; + inited = true; + + uname(&uts); + + sym = sym_lookup("UNAME_RELEASE", 0); + sym->type = S_STRING; + sym->flags |= SYMBOL_AUTO; + sym_add_default(sym, uts.release); +} + +enum symbol_type sym_get_type(struct symbol *sym) +{ + enum symbol_type type = sym->type; + + if (type == S_TRISTATE) { + if (sym_is_choice_value(sym) && sym->visible == yes) + type = S_BOOLEAN; + else if (modules_val == no) + type = S_BOOLEAN; + } + return type; +} + +const char *sym_type_name(enum symbol_type type) +{ + switch (type) { + case S_BOOLEAN: + return "boolean"; + case S_TRISTATE: + return "tristate"; + case S_INT: + return "integer"; + case S_HEX: + return "hex"; + case S_STRING: + return "string"; + case S_UNKNOWN: + return "unknown"; + case S_OTHER: + break; + } + return "???"; +} + +struct property *sym_get_choice_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_choices(sym, prop) + return prop; + return NULL; +} + +struct property *sym_get_env_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_properties(sym, prop, P_ENV) + return prop; + return NULL; +} + +struct property *sym_get_default_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_defaults(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri != no) + return prop; + } + return NULL; +} + +static struct property *sym_get_range_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_properties(sym, prop, P_RANGE) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri != no) + return prop; + } + return NULL; +} + +static int sym_get_range_val(struct symbol *sym, int base) +{ + sym_calc_value(sym); + switch (sym->type) { + case S_INT: + base = 10; + break; + case S_HEX: + base = 16; + break; + default: + break; + } + return strtol(sym->curr.val, NULL, base); +} + +static void sym_validate_range(struct symbol *sym) +{ + struct property *prop; + int base, val, val2; + char str[64]; + + switch (sym->type) { + case S_INT: + base = 10; + break; + case S_HEX: + base = 16; + break; + default: + return; + } + prop = sym_get_range_prop(sym); + if (!prop) + return; + val = strtol(sym->curr.val, NULL, base); + val2 = sym_get_range_val(prop->expr->left.sym, base); + if (val >= val2) { + val2 = sym_get_range_val(prop->expr->right.sym, base); + if (val <= val2) + return; + } + if (sym->type == S_INT) + sprintf(str, "%d", val2); + else + sprintf(str, "0x%x", val2); + sym->curr.val = strdup(str); +} + +static void sym_calc_visibility(struct symbol *sym) +{ + struct property *prop; + tristate tri; + + /* any prompt visible? */ + tri = no; + for_all_prompts(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + tri = EXPR_OR(tri, prop->visible.tri); + } + if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) + tri = yes; + if (sym->visible != tri) { + sym->visible = tri; + sym_set_changed(sym); + } + if (sym_is_choice_value(sym)) + return; + /* defaulting to "yes" if no explicit "depends on" are given */ + tri = yes; + if (sym->dir_dep.expr) + tri = expr_calc_value(sym->dir_dep.expr); + if (tri == mod) + tri = yes; + if (sym->dir_dep.tri != tri) { + sym->dir_dep.tri = tri; + sym_set_changed(sym); + } + tri = no; + if (sym->rev_dep.expr) + tri = expr_calc_value(sym->rev_dep.expr); + if (tri == mod && sym_get_type(sym) == S_BOOLEAN) + tri = yes; + if (sym->rev_dep.tri != tri) { + sym->rev_dep.tri = tri; + sym_set_changed(sym); + } +} + +/* + * Find the default symbol for a choice. + * First try the default values for the choice symbol + * Next locate the first visible choice value + * Return NULL if none was found + */ +struct symbol *sym_choice_default(struct symbol *sym) +{ + struct symbol *def_sym; + struct property *prop; + struct expr *e; + + /* any of the defaults visible? */ + for_all_defaults(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri == no) + continue; + def_sym = prop_get_symbol(prop); + if (def_sym->visible != no) + return def_sym; + } + + /* just get the first visible value */ + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, def_sym) + if (def_sym->visible != no) + return def_sym; + + /* failed to locate any defaults */ + return NULL; +} + +static struct symbol *sym_calc_choice(struct symbol *sym) +{ + struct symbol *def_sym; + struct property *prop; + struct expr *e; + + /* first calculate all choice values' visibilities */ + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, def_sym) + sym_calc_visibility(def_sym); + + /* is the user choice visible? */ + def_sym = sym->def[S_DEF_USER].val; + if (def_sym && def_sym->visible != no) + return def_sym; + + def_sym = sym_choice_default(sym); + + if (def_sym == NULL) + /* no choice? reset tristate value */ + sym->curr.tri = no; + + return def_sym; +} + +void sym_calc_value(struct symbol *sym) +{ + struct symbol_value newval, oldval; + struct property *prop; + struct expr *e; + + if (!sym) + return; + + if (sym->flags & SYMBOL_VALID) + return; + sym->flags |= SYMBOL_VALID; + + oldval = sym->curr; + + switch (sym->type) { + case S_INT: + case S_HEX: + case S_STRING: + newval = symbol_empty.curr; + break; + case S_BOOLEAN: + case S_TRISTATE: + newval = symbol_no.curr; + break; + default: + sym->curr.val = sym->name; + sym->curr.tri = no; + return; + } + if (!sym_is_choice_value(sym)) + sym->flags &= ~SYMBOL_WRITE; + + sym_calc_visibility(sym); + + /* set default if recursively called */ + sym->curr = newval; + + switch (sym_get_type(sym)) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_is_choice_value(sym) && sym->visible == yes) { + prop = sym_get_choice_prop(sym); + newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no; + } else { + if (sym->visible != no) { + /* if the symbol is visible use the user value + * if available, otherwise try the default value + */ + sym->flags |= SYMBOL_WRITE; + if (sym_has_value(sym)) { + newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri, + sym->visible); + goto calc_newval; + } + } + if (sym->rev_dep.tri != no) + sym->flags |= SYMBOL_WRITE; + if (!sym_is_choice(sym)) { + prop = sym_get_default_prop(sym); + if (prop) { + sym->flags |= SYMBOL_WRITE; + newval.tri = EXPR_AND(expr_calc_value(prop->expr), + prop->visible.tri); + } + } + calc_newval: + if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { + struct expr *e; + e = expr_simplify_unmet_dep(sym->rev_dep.expr, + sym->dir_dep.expr); + fprintf(stderr, "warning: ("); + expr_fprint(e, stderr); + fprintf(stderr, ") selects %s which has unmet direct dependencies (", + sym->name); + expr_fprint(sym->dir_dep.expr, stderr); + fprintf(stderr, ")\n"); + expr_free(e); + } + newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); + } + if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) + newval.tri = yes; + break; + case S_STRING: + case S_HEX: + case S_INT: + if (sym->visible != no) { + sym->flags |= SYMBOL_WRITE; + if (sym_has_value(sym)) { + newval.val = sym->def[S_DEF_USER].val; + break; + } + } + prop = sym_get_default_prop(sym); + if (prop) { + struct symbol *ds = prop_get_symbol(prop); + if (ds) { + sym->flags |= SYMBOL_WRITE; + sym_calc_value(ds); + newval.val = ds->curr.val; + } + } + break; + default: + ; + } + + sym->curr = newval; + if (sym_is_choice(sym) && newval.tri == yes) + sym->curr.val = sym_calc_choice(sym); + sym_validate_range(sym); + + if (memcmp(&oldval, &sym->curr, sizeof(oldval))) { + sym_set_changed(sym); + if (modules_sym == sym) { + sym_set_all_changed(); + modules_val = modules_sym->curr.tri; + } + } + + if (sym_is_choice(sym)) { + struct symbol *choice_sym; + + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, choice_sym) { + if ((sym->flags & SYMBOL_WRITE) && + choice_sym->visible != no) + choice_sym->flags |= SYMBOL_WRITE; + if (sym->flags & SYMBOL_CHANGED) + sym_set_changed(choice_sym); + } + } + + if (sym->flags & SYMBOL_AUTO) + sym->flags &= ~SYMBOL_WRITE; +} + +void sym_clear_all_valid(void) +{ + struct symbol *sym; + int i; + + for_all_symbols(i, sym) + sym->flags &= ~SYMBOL_VALID; + sym_add_change_count(1); + if (modules_sym) + sym_calc_value(modules_sym); +} + +void sym_set_changed(struct symbol *sym) +{ + struct property *prop; + + sym->flags |= SYMBOL_CHANGED; + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->menu) + prop->menu->flags |= MENU_CHANGED; + } +} + +void sym_set_all_changed(void) +{ + struct symbol *sym; + int i; + + for_all_symbols(i, sym) + sym_set_changed(sym); +} + +bool sym_tristate_within_range(struct symbol *sym, tristate val) +{ + int type = sym_get_type(sym); + + if (sym->visible == no) + return false; + + if (type != S_BOOLEAN && type != S_TRISTATE) + return false; + + if (type == S_BOOLEAN && val == mod) + return false; + if (sym->visible <= sym->rev_dep.tri) + return false; + if (sym_is_choice_value(sym) && sym->visible == yes) + return val == yes; + return val >= sym->rev_dep.tri && val <= sym->visible; +} + +bool sym_set_tristate_value(struct symbol *sym, tristate val) +{ + tristate oldval = sym_get_tristate_value(sym); + + if (oldval != val && !sym_tristate_within_range(sym, val)) + return false; + + if (!(sym->flags & SYMBOL_DEF_USER)) { + sym->flags |= SYMBOL_DEF_USER; + sym_set_changed(sym); + } + /* + * setting a choice value also resets the new flag of the choice + * symbol and all other choice values. + */ + if (sym_is_choice_value(sym) && val == yes) { + struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); + struct property *prop; + struct expr *e; + + cs->def[S_DEF_USER].val = sym; + cs->flags |= SYMBOL_DEF_USER; + prop = sym_get_choice_prop(cs); + for (e = prop->expr; e; e = e->left.expr) { + if (e->right.sym->visible != no) + e->right.sym->flags |= SYMBOL_DEF_USER; + } + } + + sym->def[S_DEF_USER].tri = val; + if (oldval != val) + sym_clear_all_valid(); + + return true; +} + +tristate sym_toggle_tristate_value(struct symbol *sym) +{ + tristate oldval, newval; + + oldval = newval = sym_get_tristate_value(sym); + do { + switch (newval) { + case no: + newval = mod; + break; + case mod: + newval = yes; + break; + case yes: + newval = no; + break; + } + if (sym_set_tristate_value(sym, newval)) + break; + } while (oldval != newval); + return newval; +} + +bool sym_string_valid(struct symbol *sym, const char *str) +{ + signed char ch; + + switch (sym->type) { + case S_STRING: + return true; + case S_INT: + ch = *str++; + if (ch == '-') + ch = *str++; + if (!isdigit(ch)) + return false; + if (ch == '0' && *str != 0) + return false; + while ((ch = *str++)) { + if (!isdigit(ch)) + return false; + } + return true; + case S_HEX: + if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) + str += 2; + ch = *str++; + do { + if (!isxdigit(ch)) + return false; + } while ((ch = *str++)); + return true; + case S_BOOLEAN: + case S_TRISTATE: + switch (str[0]) { + case 'y': case 'Y': + case 'm': case 'M': + case 'n': case 'N': + return true; + } + return false; + default: + return false; + } +} + +bool sym_string_within_range(struct symbol *sym, const char *str) +{ + struct property *prop; + int val; + + switch (sym->type) { + case S_STRING: + return sym_string_valid(sym, str); + case S_INT: + if (!sym_string_valid(sym, str)) + return false; + prop = sym_get_range_prop(sym); + if (!prop) + return true; + val = strtol(str, NULL, 10); + return val >= sym_get_range_val(prop->expr->left.sym, 10) && + val <= sym_get_range_val(prop->expr->right.sym, 10); + case S_HEX: + if (!sym_string_valid(sym, str)) + return false; + prop = sym_get_range_prop(sym); + if (!prop) + return true; + val = strtol(str, NULL, 16); + return val >= sym_get_range_val(prop->expr->left.sym, 16) && + val <= sym_get_range_val(prop->expr->right.sym, 16); + case S_BOOLEAN: + case S_TRISTATE: + switch (str[0]) { + case 'y': case 'Y': + return sym_tristate_within_range(sym, yes); + case 'm': case 'M': + return sym_tristate_within_range(sym, mod); + case 'n': case 'N': + return sym_tristate_within_range(sym, no); + } + return false; + default: + return false; + } +} + +bool sym_set_string_value(struct symbol *sym, const char *newval) +{ + const char *oldval; + char *val; + int size; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (newval[0]) { + case 'y': case 'Y': + return sym_set_tristate_value(sym, yes); + case 'm': case 'M': + return sym_set_tristate_value(sym, mod); + case 'n': case 'N': + return sym_set_tristate_value(sym, no); + } + return false; + default: + ; + } + + if (!sym_string_within_range(sym, newval)) + return false; + + if (!(sym->flags & SYMBOL_DEF_USER)) { + sym->flags |= SYMBOL_DEF_USER; + sym_set_changed(sym); + } + + oldval = sym->def[S_DEF_USER].val; + size = strlen(newval) + 1; + if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { + size += 2; + sym->def[S_DEF_USER].val = val = malloc(size); + *val++ = '0'; + *val++ = 'x'; + } else if (!oldval || strcmp(oldval, newval)) + sym->def[S_DEF_USER].val = val = malloc(size); + else + return true; + + strcpy(val, newval); + free((void *)oldval); + sym_clear_all_valid(); + + return true; +} + +/* + * Find the default value associated to a symbol. + * For tristate symbol handle the modules=n case + * in which case "m" becomes "y". + * If the symbol does not have any default then fallback + * to the fixed default values. + */ +const char *sym_get_string_default(struct symbol *sym) +{ + struct property *prop; + struct symbol *ds; + const char *str; + tristate val; + + sym_calc_visibility(sym); + sym_calc_value(modules_sym); + val = symbol_no.curr.tri; + str = symbol_empty.curr.val; + + /* If symbol has a default value look it up */ + prop = sym_get_default_prop(sym); + if (prop != NULL) { + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + /* The visibility may limit the value from yes => mod */ + val = EXPR_AND(expr_calc_value(prop->expr), prop->visible.tri); + break; + default: + /* + * The following fails to handle the situation + * where a default value is further limited by + * the valid range. + */ + ds = prop_get_symbol(prop); + if (ds != NULL) { + sym_calc_value(ds); + str = (const char *)ds->curr.val; + } + } + } + + /* Handle select statements */ + val = EXPR_OR(val, sym->rev_dep.tri); + + /* transpose mod to yes if modules are not enabled */ + if (val == mod) + if (!sym_is_choice_value(sym) && modules_sym->curr.tri == no) + val = yes; + + /* transpose mod to yes if type is bool */ + if (sym->type == S_BOOLEAN && val == mod) + val = yes; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (val) { + case no: return "n"; + case mod: return "m"; + case yes: return "y"; + } + case S_INT: + case S_HEX: + return str; + case S_STRING: + return str; + case S_OTHER: + case S_UNKNOWN: + break; + } + return ""; +} + +const char *sym_get_string_value(struct symbol *sym) +{ + tristate val; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + val = sym_get_tristate_value(sym); + switch (val) { + case no: + return "n"; + case mod: + return "m"; + case yes: + return "y"; + } + break; + default: + ; + } + return (const char *)sym->curr.val; +} + +bool sym_is_changable(struct symbol *sym) +{ + return sym->visible > sym->rev_dep.tri; +} + +static unsigned strhash(const char *s) +{ + /* fnv32 hash */ + unsigned hash = 2166136261U; + for (; *s; s++) + hash = (hash ^ *s) * 0x01000193; + return hash; +} + +struct symbol *sym_lookup(const char *name, int flags) +{ + struct symbol *symbol; + char *new_name; + int hash; + + if (name) { + if (name[0] && !name[1]) { + switch (name[0]) { + case 'y': return &symbol_yes; + case 'm': return &symbol_mod; + case 'n': return &symbol_no; + } + } + hash = strhash(name) % SYMBOL_HASHSIZE; + + for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { + if (symbol->name && + !strcmp(symbol->name, name) && + (flags ? symbol->flags & flags + : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) + return symbol; + } + new_name = strdup(name); + } else { + new_name = NULL; + hash = 0; + } + + symbol = malloc(sizeof(*symbol)); + memset(symbol, 0, sizeof(*symbol)); + symbol->name = new_name; + symbol->type = S_UNKNOWN; + symbol->flags |= flags; + + symbol->next = symbol_hash[hash]; + symbol_hash[hash] = symbol; + + return symbol; +} + +struct symbol *sym_find(const char *name) +{ + struct symbol *symbol = NULL; + int hash = 0; + + if (!name) + return NULL; + + if (name[0] && !name[1]) { + switch (name[0]) { + case 'y': return &symbol_yes; + case 'm': return &symbol_mod; + case 'n': return &symbol_no; + } + } + hash = strhash(name) % SYMBOL_HASHSIZE; + + for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { + if (symbol->name && + !strcmp(symbol->name, name) && + !(symbol->flags & SYMBOL_CONST)) + break; + } + + return symbol; +} + +/* + * Expand symbol's names embedded in the string given in argument. Symbols' + * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to + * the empty string. + */ +const char *sym_expand_string_value(const char *in) +{ + const char *src; + char *res; + size_t reslen; + + reslen = strlen(in) + 1; + res = malloc(reslen); + res[0] = '\0'; + + while ((src = strchr(in, '$'))) { + char *p, name[SYMBOL_MAXLENGTH]; + const char *symval = ""; + struct symbol *sym; + size_t newlen; + + strncat(res, in, src - in); + src++; + + p = name; + while (isalnum(*src) || *src == '_') + *p++ = *src++; + *p = '\0'; + + sym = sym_find(name); + if (sym != NULL) { + sym_calc_value(sym); + symval = sym_get_string_value(sym); + } + + newlen = strlen(res) + strlen(symval) + strlen(src) + 1; + if (newlen > reslen) { + reslen = newlen; + res = realloc(res, reslen); + } + + strcat(res, symval); + in = src; + } + strcat(res, in); + + return res; +} + +struct symbol **sym_re_search(const char *pattern) +{ + struct symbol *sym, **sym_arr = NULL; + int i, cnt, size; + regex_t re; + + cnt = size = 0; + /* Skip if empty */ + if (strlen(pattern) == 0) + return NULL; + if (regcomp(&re, pattern, REG_EXTENDED|REG_NOSUB|REG_ICASE)) + return NULL; + + for_all_symbols(i, sym) { + if (sym->flags & SYMBOL_CONST || !sym->name) + continue; + if (regexec(&re, sym->name, 0, NULL, 0)) + continue; + if (cnt + 1 >= size) { + void *tmp = sym_arr; + size += 16; + sym_arr = realloc(sym_arr, size * sizeof(struct symbol *)); + if (!sym_arr) { + free(tmp); + return NULL; + } + } + sym_calc_value(sym); + sym_arr[cnt++] = sym; + } + if (sym_arr) + sym_arr[cnt] = NULL; + regfree(&re); + + return sym_arr; +} + +/* + * When we check for recursive dependencies we use a stack to save + * current state so we can print out relevant info to user. + * The entries are located on the call stack so no need to free memory. + * Note inser() remove() must always match to properly clear the stack. + */ +static struct dep_stack { + struct dep_stack *prev, *next; + struct symbol *sym; + struct property *prop; + struct expr *expr; +} *check_top; + +static void dep_stack_insert(struct dep_stack *stack, struct symbol *sym) +{ + memset(stack, 0, sizeof(*stack)); + if (check_top) + check_top->next = stack; + stack->prev = check_top; + stack->sym = sym; + check_top = stack; +} + +static void dep_stack_remove(void) +{ + check_top = check_top->prev; + if (check_top) + check_top->next = NULL; +} + +/* + * Called when we have detected a recursive dependency. + * check_top point to the top of the stact so we use + * the ->prev pointer to locate the bottom of the stack. + */ +static void sym_check_print_recursive(struct symbol *last_sym) +{ + struct dep_stack *stack; + struct symbol *sym, *next_sym; + struct menu *menu = NULL; + struct property *prop; + struct dep_stack cv_stack; + + if (sym_is_choice_value(last_sym)) { + dep_stack_insert(&cv_stack, last_sym); + last_sym = prop_get_symbol(sym_get_choice_prop(last_sym)); + } + + for (stack = check_top; stack != NULL; stack = stack->prev) + if (stack->sym == last_sym) + break; + if (!stack) { + fprintf(stderr, "unexpected recursive dependency error\n"); + return; + } + + for (; stack; stack = stack->next) { + sym = stack->sym; + next_sym = stack->next ? stack->next->sym : last_sym; + prop = stack->prop; + if (prop == NULL) + prop = stack->sym->prop; + + /* for choice values find the menu entry (used below) */ + if (sym_is_choice(sym) || sym_is_choice_value(sym)) { + for (prop = sym->prop; prop; prop = prop->next) { + menu = prop->menu; + if (prop->menu) + break; + } + } + if (stack->sym == last_sym) + fprintf(stderr, "%s:%d:error: recursive dependency detected!\n", + prop->file->name, prop->lineno); + if (stack->expr) { + fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n", + prop->file->name, prop->lineno, + sym->name ? sym->name : "", + prop_get_type_name(prop->type), + next_sym->name ? next_sym->name : ""); + } else if (stack->prop) { + fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n", + prop->file->name, prop->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } else if (sym_is_choice(sym)) { + fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n", + menu->file->name, menu->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } else if (sym_is_choice_value(sym)) { + fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n", + menu->file->name, menu->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } else { + fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n", + prop->file->name, prop->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } + } + + if (check_top == &cv_stack) + dep_stack_remove(); +} + +static struct symbol *sym_check_expr_deps(struct expr *e) +{ + struct symbol *sym; + + if (!e) + return NULL; + switch (e->type) { + case E_OR: + case E_AND: + sym = sym_check_expr_deps(e->left.expr); + if (sym) + return sym; + return sym_check_expr_deps(e->right.expr); + case E_NOT: + return sym_check_expr_deps(e->left.expr); + case E_EQUAL: + case E_UNEQUAL: + sym = sym_check_deps(e->left.sym); + if (sym) + return sym; + return sym_check_deps(e->right.sym); + case E_SYMBOL: + return sym_check_deps(e->left.sym); + default: + break; + } + printf("Oops! How to check %d?\n", e->type); + return NULL; +} + +/* return NULL when dependencies are OK */ +static struct symbol *sym_check_sym_deps(struct symbol *sym) +{ + struct symbol *sym2; + struct property *prop; + struct dep_stack stack; + + dep_stack_insert(&stack, sym); + + sym2 = sym_check_expr_deps(sym->rev_dep.expr); + if (sym2) + goto out; + + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->type == P_CHOICE || prop->type == P_SELECT) + continue; + stack.prop = prop; + sym2 = sym_check_expr_deps(prop->visible.expr); + if (sym2) + break; + if (prop->type != P_DEFAULT || sym_is_choice(sym)) + continue; + stack.expr = prop->expr; + sym2 = sym_check_expr_deps(prop->expr); + if (sym2) + break; + stack.expr = NULL; + } + +out: + dep_stack_remove(); + + return sym2; +} + +static struct symbol *sym_check_choice_deps(struct symbol *choice) +{ + struct symbol *sym, *sym2; + struct property *prop; + struct expr *e; + struct dep_stack stack; + + dep_stack_insert(&stack, choice); + + prop = sym_get_choice_prop(choice); + expr_list_for_each_sym(prop->expr, e, sym) + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + + choice->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + sym2 = sym_check_sym_deps(choice); + choice->flags &= ~SYMBOL_CHECK; + if (sym2) + goto out; + + expr_list_for_each_sym(prop->expr, e, sym) { + sym2 = sym_check_sym_deps(sym); + if (sym2) + break; + } +out: + expr_list_for_each_sym(prop->expr, e, sym) + sym->flags &= ~SYMBOL_CHECK; + + if (sym2 && sym_is_choice_value(sym2) && + prop_get_symbol(sym_get_choice_prop(sym2)) == choice) + sym2 = choice; + + dep_stack_remove(); + + return sym2; +} + +struct symbol *sym_check_deps(struct symbol *sym) +{ + struct symbol *sym2; + struct property *prop; + + if (sym->flags & SYMBOL_CHECK) { + sym_check_print_recursive(sym); + return sym; + } + if (sym->flags & SYMBOL_CHECKED) + return NULL; + + if (sym_is_choice_value(sym)) { + struct dep_stack stack; + + /* for choice groups start the check with main choice symbol */ + dep_stack_insert(&stack, sym); + prop = sym_get_choice_prop(sym); + sym2 = sym_check_deps(prop_get_symbol(prop)); + dep_stack_remove(); + } else if (sym_is_choice(sym)) { + sym2 = sym_check_choice_deps(sym); + } else { + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + sym2 = sym_check_sym_deps(sym); + sym->flags &= ~SYMBOL_CHECK; + } + + if (sym2 && sym2 == sym) + sym2 = NULL; + + return sym2; +} + +struct property *prop_alloc(enum prop_type type, struct symbol *sym) +{ + struct property *prop; + struct property **propp; + + prop = malloc(sizeof(*prop)); + memset(prop, 0, sizeof(*prop)); + prop->type = type; + prop->sym = sym; + prop->file = current_file; + prop->lineno = zconf_lineno(); + + /* append property to the prop list of symbol */ + if (sym) { + for (propp = &sym->prop; *propp; propp = &(*propp)->next) + ; + *propp = prop; + } + + return prop; +} + +struct symbol *prop_get_symbol(struct property *prop) +{ + if (prop->expr && (prop->expr->type == E_SYMBOL || + prop->expr->type == E_LIST)) + return prop->expr->left.sym; + return NULL; +} + +const char *prop_get_type_name(enum prop_type type) +{ + switch (type) { + case P_PROMPT: + return "prompt"; + case P_ENV: + return "env"; + case P_COMMENT: + return "comment"; + case P_MENU: + return "menu"; + case P_DEFAULT: + return "default"; + case P_CHOICE: + return "choice"; + case P_SELECT: + return "select"; + case P_RANGE: + return "range"; + case P_SYMBOL: + return "symbol"; + case P_UNKNOWN: + break; + } + return "unknown"; +} diff --git a/i386/config/.svn/text-base/textbox.c.svn-base b/i386/config/.svn/text-base/textbox.c.svn-base new file mode 100644 index 0000000..c704712 --- /dev/null +++ b/i386/config/.svn/text-base/textbox.c.svn-base @@ -0,0 +1,391 @@ +/* + * textbox.c -- implements the text box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static void back_lines(int n); +static void print_page(WINDOW * win, int height, int width); +static void print_line(WINDOW * win, int row, int width); +static char *get_line(void); +static void print_position(WINDOW * win); + +static int hscroll; +static int begin_reached, end_reached, page_length; +static const char *buf; +static const char *page; + +/* + * refresh window content + */ +static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, + int cur_y, int cur_x) +{ + print_page(box, boxh, boxw); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); +} + + +/* + * Display text from a file in a dialog box. + */ +int dialog_textbox(const char *title, const char *tbuf, + int initial_height, int initial_width) +{ + int i, x, y, cur_x, cur_y, key = 0; + int height, width, boxh, boxw; + int passed_end; + WINDOW *dialog, *box; + + begin_reached = 1; + end_reached = 0; + page_length = 0; + hscroll = 0; + buf = tbuf; + page = buf; /* page is pointer to start of page to be displayed */ + +do_resize: + getmaxyx(stdscr, height, width); + if (height < 8 || width < 8) + return -ERRDISPLAYTOOSMALL; + if (initial_height != 0) + height = initial_height; + else + if (height > 4) + height -= 4; + else + height = 0; + if (initial_width != 0) + width = initial_width; + else + if (width > 5) + width -= 5; + else + width = 0; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + /* Create window for box region, used for scrolling text */ + boxh = height - 4; + boxw = width - 2; + box = subwin(dialog, boxh, boxw, y + 1, x + 1); + wattrset(box, dlg.dialog.atr); + wbkgdset(box, dlg.dialog.atr & A_COLOR); + + keypad(box, TRUE); + + /* register the new window, along with its borders */ + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE); + wnoutrefresh(dialog); + getyx(dialog, cur_y, cur_x); /* Save cursor position */ + + /* Print first page of text */ + attr_clear(box, boxh, boxw, dlg.dialog.atr); + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); + + while ((key != KEY_ESC) && (key != '\n')) { + key = wgetch(dialog); + switch (key) { + case 'E': /* Exit */ + case 'e': + case 'X': + case 'x': + delwin(box); + delwin(dialog); + return 0; + case 'g': /* First page */ + case KEY_HOME: + if (!begin_reached) { + begin_reached = 1; + page = buf; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + } + break; + case 'G': /* Last page */ + case KEY_END: + + end_reached = 1; + /* point to last char in buf */ + page = buf + strlen(buf); + back_lines(boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'K': /* Previous line */ + case 'k': + case KEY_UP: + if (!begin_reached) { + back_lines(page_length + 1); + + /* We don't call print_page() here but use + * scrolling to ensure faster screen update. + * However, 'end_reached' and 'page_length' + * should still be updated, and 'page' should + * point to start of next page. This is done + * by calling get_line() in the following + * 'for' loop. */ + scrollok(box, TRUE); + wscrl(box, -1); /* Scroll box region down one line */ + scrollok(box, FALSE); + page_length = 0; + passed_end = 0; + for (i = 0; i < boxh; i++) { + if (!i) { + /* print first line of page */ + print_line(box, 0, boxw); + wnoutrefresh(box); + } else + /* Called to update 'end_reached' and 'page' */ + get_line(); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case 'B': /* Previous page */ + case 'b': + case KEY_PPAGE: + if (begin_reached) + break; + back_lines(page_length + boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'J': /* Next line */ + case 'j': + case KEY_DOWN: + if (!end_reached) { + begin_reached = 0; + scrollok(box, TRUE); + scroll(box); /* Scroll box region up one line */ + scrollok(box, FALSE); + print_line(box, boxh - 1, boxw); + wnoutrefresh(box); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case KEY_NPAGE: /* Next page */ + case ' ': + if (end_reached) + break; + + begin_reached = 0; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case '0': /* Beginning of line */ + case 'H': /* Scroll left */ + case 'h': + case KEY_LEFT: + if (hscroll <= 0) + break; + + if (key == '0') + hscroll = 0; + else + hscroll--; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'L': /* Scroll right */ + case 'l': + case KEY_RIGHT: + if (hscroll >= MAX_LEN) + break; + hscroll++; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + back_lines(height); + delwin(box); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + delwin(box); + delwin(dialog); + return key; /* ESC pressed */ +} + +/* + * Go back 'n' lines in text. Called by dialog_textbox(). + * 'page' will be updated to point to the desired line in 'buf'. + */ +static void back_lines(int n) +{ + int i; + + begin_reached = 0; + /* Go back 'n' lines */ + for (i = 0; i < n; i++) { + if (*page == '\0') { + if (end_reached) { + end_reached = 0; + continue; + } + } + if (page == buf) { + begin_reached = 1; + return; + } + page--; + do { + if (page == buf) { + begin_reached = 1; + return; + } + page--; + } while (*page != '\n'); + page++; + } +} + +/* + * Print a new page of text. Called by dialog_textbox(). + */ +static void print_page(WINDOW * win, int height, int width) +{ + int i, passed_end = 0; + + page_length = 0; + for (i = 0; i < height; i++) { + print_line(win, i, width); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + wnoutrefresh(win); +} + +/* + * Print a new line of text. Called by dialog_textbox() and print_page(). + */ +static void print_line(WINDOW * win, int row, int width) +{ + int y, x; + char *line; + + line = get_line(); + line += MIN(strlen(line), hscroll); /* Scroll horizontally */ + wmove(win, row, 0); /* move cursor to correct line */ + waddch(win, ' '); + waddnstr(win, line, MIN(strlen(line), width - 2)); + + getyx(win, y, x); + /* Clear 'residue' of previous line */ +#if OLD_NCURSES + { + int i; + for (i = 0; i < width - x; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif +} + +/* + * Return current line of text. Called by dialog_textbox() and print_line(). + * 'page' should point to start of current line before calling, and will be + * updated to point to start of next line. + */ +static char *get_line(void) +{ + int i = 0; + static char line[MAX_LEN + 1]; + + end_reached = 0; + while (*page != '\n') { + if (*page == '\0') { + if (!end_reached) { + end_reached = 1; + break; + } + } else if (i < MAX_LEN) + line[i++] = *(page++); + else { + /* Truncate lines longer than MAX_LEN characters */ + if (i == MAX_LEN) + line[i++] = '\0'; + page++; + } + } + if (i <= MAX_LEN) + line[i] = '\0'; + if (!end_reached) + page++; /* move pass '\n' */ + + return line; +} + +/* + * Print current position + */ +static void print_position(WINDOW * win) +{ + int percent; + + wattrset(win, dlg.position_indicator.atr); + wbkgdset(win, dlg.position_indicator.atr & A_COLOR); + percent = (page - buf) * 100 / strlen(buf); + wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); + wprintw(win, "(%3d%%)", percent); +} diff --git a/i386/config/.svn/text-base/util.c.svn-base b/i386/config/.svn/text-base/util.c.svn-base new file mode 100644 index 0000000..d4b4525 --- /dev/null +++ b/i386/config/.svn/text-base/util.c.svn-base @@ -0,0 +1,796 @@ +/* + * util.c + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#include "dialog.h" + +struct dialog_info dlg; + +static void set_mono_theme(void) +{ + dlg.screen.atr = A_NORMAL; + dlg.shadow.atr = A_NORMAL; + dlg.dialog.atr = A_NORMAL; + dlg.title.atr = A_BOLD; + dlg.border.atr = A_NORMAL; + dlg.button_active.atr = A_REVERSE; + dlg.button_inactive.atr = A_DIM; + dlg.button_key_active.atr = A_REVERSE; + dlg.button_key_inactive.atr = A_BOLD; + dlg.button_label_active.atr = A_REVERSE; + dlg.button_label_inactive.atr = A_NORMAL; + dlg.inputbox.atr = A_NORMAL; + dlg.inputbox_border.atr = A_NORMAL; + dlg.searchbox.atr = A_NORMAL; + dlg.searchbox_title.atr = A_BOLD; + dlg.searchbox_border.atr = A_NORMAL; + dlg.position_indicator.atr = A_BOLD; + dlg.menubox.atr = A_NORMAL; + dlg.menubox_border.atr = A_NORMAL; + dlg.item.atr = A_NORMAL; + dlg.item_selected.atr = A_REVERSE; + dlg.tag.atr = A_BOLD; + dlg.tag_selected.atr = A_REVERSE; + dlg.tag_key.atr = A_BOLD; + dlg.tag_key_selected.atr = A_REVERSE; + dlg.check.atr = A_BOLD; + dlg.check_selected.atr = A_REVERSE; + dlg.uarrow.atr = A_BOLD; + dlg.darrow.atr = A_BOLD; +} + +#define DLG_COLOR(dialog, f, b, h) \ +do { \ + dlg.dialog.fg = (f); \ + dlg.dialog.bg = (b); \ + dlg.dialog.hl = (h); \ +} while (0) + +static void set_classic_theme(void) +{ + DLG_COLOR(screen, COLOR_CYAN, COLOR_BLUE, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, true); + DLG_COLOR(dialog, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(button_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_inactive, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(button_key_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_WHITE, false); + DLG_COLOR(button_label_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_WHITE, true); + DLG_COLOR(inputbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(inputbox_border, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(searchbox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(menubox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(menubox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(item, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(tag, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(tag_key, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(check, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(check_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(uarrow, COLOR_GREEN, COLOR_WHITE, true); + DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true); +} + +static void set_blackbg_theme(void) +{ + DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false); + DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(button_active, COLOR_YELLOW, COLOR_RED, false); + DLG_COLOR(button_inactive, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_RED, false); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(inputbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(inputbox_border, COLOR_YELLOW, COLOR_BLACK, false); + + DLG_COLOR(searchbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_BLACK, true); + DLG_COLOR(searchbox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(position_indicator, COLOR_RED, COLOR_BLACK, false); + + DLG_COLOR(menubox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(menubox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(item, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_RED, false); + + DLG_COLOR(tag, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(tag_key, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(check, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(check_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(uarrow, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(darrow, COLOR_RED, COLOR_BLACK, false); +} + +static void set_bluetitle_theme(void) +{ + set_classic_theme(); + DLG_COLOR(title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(searchbox_title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag_key, COLOR_BLUE, COLOR_WHITE, true); + +} + +/* + * Select color theme + */ +static int set_theme(const char *theme) +{ + int use_color = 1; + if (!theme) + set_bluetitle_theme(); + else if (strcmp(theme, "classic") == 0) + set_classic_theme(); + else if (strcmp(theme, "bluetitle") == 0) + set_bluetitle_theme(); + else if (strcmp(theme, "blackbg") == 0) + set_blackbg_theme(); + else if (strcmp(theme, "mono") == 0) + use_color = 0; + + return use_color; +} + +static void init_one_color(struct dialog_color *color) +{ + static int pair = 0; + + pair++; + init_pair(pair, color->fg, color->bg); + if (color->hl) + color->atr = A_BOLD | COLOR_PAIR(pair); + else + color->atr = COLOR_PAIR(pair); +} + +static void init_dialog_colors(void) +{ + init_one_color(&dlg.screen); + init_one_color(&dlg.shadow); + init_one_color(&dlg.dialog); + init_one_color(&dlg.title); + init_one_color(&dlg.border); + init_one_color(&dlg.button_active); + init_one_color(&dlg.button_inactive); + init_one_color(&dlg.button_key_active); + init_one_color(&dlg.button_key_inactive); + init_one_color(&dlg.button_label_active); + init_one_color(&dlg.button_label_inactive); + init_one_color(&dlg.inputbox); + init_one_color(&dlg.inputbox_border); + init_one_color(&dlg.searchbox); + init_one_color(&dlg.searchbox_title); + init_one_color(&dlg.searchbox_border); + init_one_color(&dlg.position_indicator); + init_one_color(&dlg.menubox); + init_one_color(&dlg.menubox_border); + init_one_color(&dlg.item); + init_one_color(&dlg.item_selected); + init_one_color(&dlg.tag); + init_one_color(&dlg.tag_selected); + init_one_color(&dlg.tag_key); + init_one_color(&dlg.tag_key_selected); + init_one_color(&dlg.check); + init_one_color(&dlg.check_selected); + init_one_color(&dlg.uarrow); + init_one_color(&dlg.darrow); +} + +/* + * Setup for color display + */ +static void color_setup(const char *theme) +{ + int use_color; + + use_color = set_theme(theme); + if (use_color && has_colors()) { + start_color(); + init_dialog_colors(); + } else + set_mono_theme(); +} + +/* + * Set window to attribute 'attr' + */ +void attr_clear(WINDOW * win, int height, int width, chtype attr) +{ + int i, j; + + wattrset(win, attr); + for (i = 0; i < height; i++) { + wmove(win, i, 0); + for (j = 0; j < width; j++) + waddch(win, ' '); + } + touchwin(win); +} + +void dialog_clear(void) +{ + attr_clear(stdscr, LINES, COLS, dlg.screen.atr); + /* Display background title if it exists ... - SLH */ + if (dlg.backtitle != NULL) { + int i; + + wattrset(stdscr, dlg.screen.atr); + mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle); + wmove(stdscr, 1, 1); + for (i = 1; i < COLS - 1; i++) + waddch(stdscr, ACS_HLINE); + } + wnoutrefresh(stdscr); +} + +/* + * Do some initialization for dialog + */ +int init_dialog(const char *backtitle) +{ + int height, width; + + initscr(); /* Init curses */ + getmaxyx(stdscr, height, width); + if (height < 19 || width < 80) { + endwin(); + return -ERRDISPLAYTOOSMALL; + } + + dlg.backtitle = backtitle; + color_setup(getenv("MENUCONFIG_COLOR")); + + keypad(stdscr, TRUE); + cbreak(); + noecho(); + dialog_clear(); + + return 0; +} + +void set_dialog_backtitle(const char *backtitle) +{ + dlg.backtitle = backtitle; +} + +/* + * End using dialog functions. + */ +void end_dialog(int x, int y) +{ + /* move cursor back to original position */ + move(y, x); + refresh(); + endwin(); +} + +/* Print the title of the dialog. Center the title and truncate + * tile if wider than dialog (- 2 chars). + **/ +void print_title(WINDOW *dialog, const char *title, int width) +{ + if (title) { + int tlen = MIN(width - 2, strlen(title)); + wattrset(dialog, dlg.title.atr); + mvwaddch(dialog, 0, (width - tlen) / 2 - 1, ' '); + mvwaddnstr(dialog, 0, (width - tlen)/2, title, tlen); + waddch(dialog, ' '); + } +} + +/* + * Print a string of text in a window, automatically wrap around to the + * next line if the string is too long to fit on one line. Newline + * characters '\n' are replaced by spaces. We start on a new line + * if there is no room for at least 4 nonblanks following a double-space. + */ +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) +{ + int newl, cur_x, cur_y; + int i, prompt_len, room, wlen; + char tempstr[MAX_LEN + 1], *word, *sp, *sp2; + + strcpy(tempstr, prompt); + + prompt_len = strlen(tempstr); + + /* + * Remove newlines + */ + for (i = 0; i < prompt_len; i++) { + if (tempstr[i] == '\n') + tempstr[i] = ' '; + } + + if (prompt_len <= width - x * 2) { /* If prompt is short */ + wmove(win, y, (width - prompt_len) / 2); + waddstr(win, tempstr); + } else { + cur_x = x; + cur_y = y; + newl = 1; + word = tempstr; + while (word && *word) { + sp = strchr(word, ' '); + if (sp) + *sp++ = 0; + + /* Wrap to next line if either the word does not fit, + or it is the first word of a new sentence, and it is + short, and the next word does not fit. */ + room = width - cur_x; + wlen = strlen(word); + if (wlen > room || + (newl && wlen < 4 && sp + && wlen + 1 + strlen(sp) > room + && (!(sp2 = strchr(sp, ' ')) + || wlen + 1 + (sp2 - sp) > room))) { + cur_y++; + cur_x = x; + } + wmove(win, cur_y, cur_x); + waddstr(win, word); + getyx(win, cur_y, cur_x); + cur_x++; + if (sp && *sp == ' ') { + cur_x++; /* double space */ + while (*++sp == ' ') ; + newl = 1; + } else + newl = 0; + word = sp; + } + } +} + +/* + * Print a button + */ +void print_button(WINDOW * win, const char *label, int y, int x, int selected) +{ + int i, temp; + + wmove(win, y, x); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, "<"); + temp = strspn(label, " "); + label += temp; + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + for (i = 0; i < temp; i++) + waddch(win, ' '); + wattrset(win, selected ? dlg.button_key_active.atr + : dlg.button_key_inactive.atr); + waddch(win, label[0]); + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + waddstr(win, (char *)label + 1); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, ">"); + wmove(win, y, x + temp + 1); +} + +/* + * Draw a rectangular box with line drawing characters + */ +void +draw_box(WINDOW * win, int y, int x, int height, int width, + chtype box, chtype border) +{ + int i, j; + + wattrset(win, 0); + for (i = 0; i < height; i++) { + wmove(win, y + i, x); + for (j = 0; j < width; j++) + if (!i && !j) + waddch(win, border | ACS_ULCORNER); + else if (i == height - 1 && !j) + waddch(win, border | ACS_LLCORNER); + else if (!i && j == width - 1) + waddch(win, box | ACS_URCORNER); + else if (i == height - 1 && j == width - 1) + waddch(win, box | ACS_LRCORNER); + else if (!i) + waddch(win, border | ACS_HLINE); + else if (i == height - 1) + waddch(win, box | ACS_HLINE); + else if (!j) + waddch(win, border | ACS_VLINE); + else if (j == width - 1) + waddch(win, box | ACS_VLINE); + else + waddch(win, box | ' '); + } +} + +/* + * Draw shadows along the right and bottom edge to give a more 3D look + * to the boxes + */ +void draw_shadow(WINDOW * win, int y, int x, int height, int width) +{ + int i; + + if (has_colors()) { /* Whether terminal supports color? */ + wattrset(win, dlg.shadow.atr); + wmove(win, y + height, x + 2); + for (i = 0; i < width; i++) + waddch(win, winch(win) & A_CHARTEXT); + for (i = y + 1; i < y + height + 1; i++) { + wmove(win, i, x + width); + waddch(win, winch(win) & A_CHARTEXT); + waddch(win, winch(win) & A_CHARTEXT); + } + wnoutrefresh(win); + } +} + +/* + * Return the position of the first alphabetic character in a string. + */ +int first_alpha(const char *string, const char *exempt) +{ + int i, in_paren = 0, c; + + for (i = 0; i < strlen(string); i++) { + c = tolower(string[i]); + + if (strchr("<[(", c)) + ++in_paren; + if (strchr(">])", c) && in_paren > 0) + --in_paren; + + if ((!in_paren) && isalpha(c) && strchr(exempt, c) == 0) + return i; + } + + return 0; +} + +/* + * ncurses uses ESC to detect escaped char sequences. This resutl in + * a small timeout before ESC is actually delivered to the application. + * lxdialog suggest which is correctly translated to two + * times esc. But then we need to ignore the second esc to avoid stepping + * out one menu too much. Filter away all escaped key sequences since + * keypad(FALSE) turn off ncurses support for escape sequences - and thats + * needed to make notimeout() do as expected. + */ +int on_key_esc(WINDOW *win) +{ + int key; + int key2; + int key3; + + nodelay(win, TRUE); + keypad(win, FALSE); + key = wgetch(win); + key2 = wgetch(win); + do { + key3 = wgetch(win); + } while (key3 != ERR); + nodelay(win, FALSE); + keypad(win, TRUE); + if (key == KEY_ESC && key2 == ERR) + return KEY_ESC; + else if (key != ERR && key != KEY_ESC && key2 == ERR) + ungetch(key); + + return -1; +} + +/* redraw screen in new size */ +int on_key_resize(void) +{ + dialog_clear(); + return KEY_RESIZE; +} + +struct dialog_list *item_cur; +struct dialog_list item_nil; +struct dialog_list *item_head; + +void item_reset(void) +{ + struct dialog_list *p, *next; + + for (p = item_head; p; p = next) { + next = p->next; + free(p); + } + item_head = NULL; + item_cur = &item_nil; +} + +void item_make(const char *fmt, ...) +{ + va_list ap; + struct dialog_list *p = malloc(sizeof(*p)); + + if (item_head) + item_cur->next = p; + else + item_head = p; + item_cur = p; + memset(p, 0, sizeof(*p)); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str, sizeof(item_cur->node.str), fmt, ap); + va_end(ap); +} + +void item_add_str(const char *fmt, ...) +{ + va_list ap; + size_t avail; + + avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str + strlen(item_cur->node.str), + avail, fmt, ap); + item_cur->node.str[sizeof(item_cur->node.str) - 1] = '\0'; + va_end(ap); +} + +void item_set_tag(char tag) +{ + item_cur->node.tag = tag; +} +void item_set_data(void *ptr) +{ + item_cur->node.data = ptr; +} + +void item_set_selected(int val) +{ + item_cur->node.selected = val; +} + +int item_activate_selected(void) +{ + item_foreach() + if (item_is_selected()) + return 1; + return 0; +} + +void *item_data(void) +{ + return item_cur->node.data; +} + +char item_tag(void) +{ + return item_cur->node.tag; +} + +int item_count(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) + n++; + return n; +} + +void item_set(int n) +{ + int i = 0; + item_foreach() + if (i++ == n) + return; +} + +int item_n(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) { + if (p == item_cur) + return n; + n++; + } + return 0; +} + +const char *item_str(void) +{ + return item_cur->node.str; +} + +int item_is_selected(void) +{ + return (item_cur->node.selected != 0); +} + +int item_is_tag(char tag) +{ + return (item_cur->node.tag == tag); +} + +/* + * Copyright (C) 2002-2005 Roman Zippel + * Copyright (C) 2002-2005 Sam Ravnborg + * + * Released under the terms of the GNU GPL v2.0. + */ + +//#include +//#include "lkc.h" + +/* file already present in list? If not add it */ +struct file *file_lookup(const char *name) +{ + struct file *file; + const char *file_name = sym_expand_string_value(name); + + for (file = file_list; file; file = file->next) { + if (!strcmp(name, file->name)) { + free((void *)file_name); + return file; + } + } + + file = malloc(sizeof(*file)); + memset(file, 0, sizeof(*file)); + file->name = file_name; + file->next = file_list; + file_list = file; + return file; +} + +/* write a dependency file as used by kbuild to track dependencies */ +int file_write_dep(const char *name) +{ + struct symbol *sym, *env_sym; + struct expr *e; + struct file *file; + FILE *out; + + if (!name) + name = ".kconfig.d"; + out = fopen("..config.tmp", "w"); + if (!out) + return 1; + fprintf(out, "deps_config := \\\n"); + for (file = file_list; file; file = file->next) { + if (file->next) + fprintf(out, "\t%s \\\n", file->name); + else + fprintf(out, "\t%s\n", file->name); + } + fprintf(out, "\n%s: \\\n" + "\t$(deps_config)\n\n", conf_get_autoconfig_name()); + + expr_list_for_each_sym(sym_env_list, e, sym) { + struct property *prop; + const char *value; + + prop = sym_get_env_prop(sym); + env_sym = prop_get_symbol(prop); + if (!env_sym) + continue; + value = getenv(env_sym->name); + if (!value) + value = ""; + fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); + fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name()); + fprintf(out, "endif\n"); + } + + fprintf(out, "\n$(deps_config): ;\n"); + fclose(out); + rename("..config.tmp", name); + return 0; +} + + +/* Allocate initial growable string */ +struct gstr str_new(void) +{ + struct gstr gs; + gs.s = malloc(sizeof(char) * 64); + gs.len = 64; + gs.max_width = 0; + strcpy(gs.s, "\0"); + return gs; +} + +/* Allocate and assign growable string */ +struct gstr str_assign(const char *s) +{ + struct gstr gs; + gs.s = strdup(s); + gs.len = strlen(s) + 1; + gs.max_width = 0; + return gs; +} + +/* Free storage for growable string */ +void str_free(struct gstr *gs) +{ + if (gs->s) + free(gs->s); + gs->s = NULL; + gs->len = 0; +} + +/* Append to growable string */ +void str_append(struct gstr *gs, const char *s) +{ + size_t l; + if (s) { + l = strlen(gs->s) + strlen(s) + 1; + if (l > gs->len) { + gs->s = realloc(gs->s, l); + gs->len = l; + } + strcat(gs->s, s); + } +} + +/* Append printf formatted string to growable string */ +void str_printf(struct gstr *gs, const char *fmt, ...) +{ + va_list ap; + char s[10000]; /* big enough... */ + va_start(ap, fmt); + vsnprintf(s, sizeof(s), fmt, ap); + str_append(gs, s); + va_end(ap); +} + +/* Retrieve value of growable string */ +const char *str_get(struct gstr *gs) +{ + return gs->s; +} + diff --git a/i386/config/.svn/text-base/yesno.c.svn-base b/i386/config/.svn/text-base/yesno.c.svn-base new file mode 100644 index 0000000..4e6e809 --- /dev/null +++ b/i386/config/.svn/text-base/yesno.c.svn-base @@ -0,0 +1,114 @@ +/* + * yesno.c -- implements the yes/no box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +/* + * Display termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 10; + int y = height - 2; + + print_button(dialog, gettext(" Yes "), y, x, selected == 0); + print_button(dialog, gettext(" No "), y, x + 13, selected == 1); + + wmove(dialog, y, x + 1 + 13 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with two buttons - Yes and No + */ +int dialog_yesno(const char *title, const char *prompt, int height, int width) +{ + int i, x, y, key = 0, button = 0; + WINDOW *dialog; + +do_resize: + if (getmaxy(stdscr) < (height + 4)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 4)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + print_buttons(dialog, height, width, 0); + + while (key != KEY_ESC) { + key = wgetch(dialog); + switch (key) { + case 'Y': + case 'y': + delwin(dialog); + return 0; + case 'N': + case 'n': + delwin(dialog); + return 1; + + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case ' ': + case '\n': + delwin(dialog); + return button; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/.svn/text-base/zconf.hash.c.svn-base b/i386/config/.svn/text-base/zconf.hash.c.svn-base new file mode 100644 index 0000000..4055d5d --- /dev/null +++ b/i386/config/.svn/text-base/zconf.hash.c.svn-base @@ -0,0 +1,245 @@ +/* ANSI-C code produced by gperf version 3.0.3 */ +/* Command-line: gperf */ +/* Computed positions: -k'1,3' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +struct kconf_id; + +static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); +/* maximum key range = 50, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +kconf_id_hash (register const char *str, register unsigned int len) +{ + static unsigned char asso_values[] = + { + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 40, 5, + 0, 0, 5, 52, 0, 20, 52, 52, 10, 20, + 5, 0, 35, 52, 0, 30, 0, 15, 0, 52, + 15, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52 + }; + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[2]]; + /*FALLTHROUGH*/ + case 2: + case 1: + hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval; +} + +struct kconf_id_strings_t + { + char kconf_id_strings_str2[sizeof("on")]; + char kconf_id_strings_str3[sizeof("env")]; + char kconf_id_strings_str5[sizeof("endif")]; + char kconf_id_strings_str6[sizeof("option")]; + char kconf_id_strings_str7[sizeof("endmenu")]; + char kconf_id_strings_str8[sizeof("optional")]; + char kconf_id_strings_str9[sizeof("endchoice")]; + char kconf_id_strings_str10[sizeof("range")]; + char kconf_id_strings_str11[sizeof("choice")]; + char kconf_id_strings_str12[sizeof("default")]; + char kconf_id_strings_str13[sizeof("def_bool")]; + char kconf_id_strings_str14[sizeof("help")]; + char kconf_id_strings_str16[sizeof("config")]; + char kconf_id_strings_str17[sizeof("def_tristate")]; + char kconf_id_strings_str18[sizeof("hex")]; + char kconf_id_strings_str19[sizeof("defconfig_list")]; + char kconf_id_strings_str22[sizeof("if")]; + char kconf_id_strings_str23[sizeof("int")]; + char kconf_id_strings_str27[sizeof("modules")]; + char kconf_id_strings_str28[sizeof("tristate")]; + char kconf_id_strings_str29[sizeof("menu")]; + char kconf_id_strings_str32[sizeof("comment")]; + char kconf_id_strings_str35[sizeof("menuconfig")]; + char kconf_id_strings_str36[sizeof("string")]; + char kconf_id_strings_str37[sizeof("visible")]; + char kconf_id_strings_str41[sizeof("prompt")]; + char kconf_id_strings_str42[sizeof("depends")]; + char kconf_id_strings_str44[sizeof("bool")]; + char kconf_id_strings_str46[sizeof("select")]; + char kconf_id_strings_str47[sizeof("boolean")]; + char kconf_id_strings_str48[sizeof("mainmenu")]; + char kconf_id_strings_str51[sizeof("source")]; + }; +static struct kconf_id_strings_t kconf_id_strings_contents = + { + "on", + "env", + "endif", + "option", + "endmenu", + "optional", + "endchoice", + "range", + "choice", + "default", + "def_bool", + "help", + "config", + "def_tristate", + "hex", + "defconfig_list", + "if", + "int", + "modules", + "tristate", + "menu", + "comment", + "menuconfig", + "string", + "visible", + "prompt", + "depends", + "bool", + "select", + "boolean", + "mainmenu", + "source" + }; +#define kconf_id_strings ((const char *) &kconf_id_strings_contents) +#ifdef __GNUC__ +__inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +struct kconf_id * +kconf_id_lookup (register const char *str, register unsigned int len) +{ + enum + { + TOTAL_KEYWORDS = 32, + MIN_WORD_LENGTH = 2, + MAX_WORD_LENGTH = 14, + MIN_HASH_VALUE = 2, + MAX_HASH_VALUE = 51 + }; + + static struct kconf_id wordlist[] = + { + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_OPT_ENV, TF_OPTION}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_OPTION, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_OPTIONAL, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_CHOICE, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_HEX}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT}, + {-1}, {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_TYPE, TF_COMMAND, S_STRING}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_VISIBLE, TF_COMMAND}, + {-1}, {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_PROMPT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_DEPENDS, TF_COMMAND}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str44, T_TYPE, TF_COMMAND, S_BOOLEAN}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_SOURCE, TF_COMMAND} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = kconf_id_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + kconf_id_strings; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') + return &wordlist[key]; + } + } + } + return 0; +} + diff --git a/i386/config/.svn/text-base/zconf.tab.c.svn-base b/i386/config/.svn/text-base/zconf.tab.c.svn-base new file mode 100644 index 0000000..6b596ab --- /dev/null +++ b/i386/config/.svn/text-base/zconf.tab.c.svn-base @@ -0,0 +1,2506 @@ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ +#define yyparse zconfparse +#define yylex zconflex +#define yyerror zconferror +#define yylval zconflval +#define yychar zconfchar +#define yydebug zconfdebug +#define yynerrs zconfnerrs + + +/* Copy the first part of user declarations. */ + + +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) + +#define PRINTD 0x0001 +#define DEBUG_PARSE 0x0002 + +int cdebug = PRINTD; + +extern int zconflex(void); +static void zconfprint(const char *err, ...); +static void zconf_error(const char *err, ...); +static void zconferror(const char *err); +static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); + +struct symbol *symbol_hash[SYMBOL_HASHSIZE]; + +static struct menu *current_menu, *current_entry; + +#define YYDEBUG 0 +#if YYDEBUG +#define YYERROR_VERBOSE +#endif + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_MAINMENU = 258, + T_MENU = 259, + T_ENDMENU = 260, + T_SOURCE = 261, + T_CHOICE = 262, + T_ENDCHOICE = 263, + T_COMMENT = 264, + T_CONFIG = 265, + T_MENUCONFIG = 266, + T_HELP = 267, + T_HELPTEXT = 268, + T_IF = 269, + T_ENDIF = 270, + T_DEPENDS = 271, + T_OPTIONAL = 272, + T_PROMPT = 273, + T_TYPE = 274, + T_DEFAULT = 275, + T_SELECT = 276, + T_RANGE = 277, + T_VISIBLE = 278, + T_OPTION = 279, + T_ON = 280, + T_WORD = 281, + T_WORD_QUOTE = 282, + T_UNEQUAL = 283, + T_CLOSE_PAREN = 284, + T_OPEN_PAREN = 285, + T_EOL = 286, + T_OR = 287, + T_AND = 288, + T_EQUAL = 289, + T_NOT = 290 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + + + char *string; + struct file *file; + struct symbol *symbol; + struct expr *expr; + struct menu *menu; + struct kconf_id *id; + + + +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Include zconf.hash.c here so it can see the token constants. */ +#include "zconf.hash.c" + + + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 11 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 290 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 36 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 50 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 118 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 191 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 290 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 13, 14, 17, 20, + 23, 26, 31, 36, 40, 42, 44, 46, 48, 50, + 52, 54, 56, 58, 60, 62, 64, 66, 68, 72, + 75, 79, 82, 86, 89, 90, 93, 96, 99, 102, + 105, 108, 112, 117, 122, 127, 133, 137, 138, 142, + 143, 146, 150, 153, 155, 159, 160, 163, 166, 169, + 172, 175, 180, 184, 187, 192, 193, 196, 200, 202, + 206, 207, 210, 213, 216, 220, 224, 228, 230, 234, + 235, 238, 241, 244, 248, 252, 255, 258, 261, 262, + 265, 268, 271, 276, 277, 280, 283, 286, 287, 290, + 292, 294, 297, 300, 303, 305, 308, 309, 312, 314, + 318, 322, 326, 329, 333, 337, 339, 341, 342 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 37, 0, -1, 81, 38, -1, 38, -1, 63, 39, + -1, 39, -1, -1, 39, 41, -1, 39, 55, -1, + 39, 67, -1, 39, 80, -1, 39, 26, 1, 31, + -1, 39, 40, 1, 31, -1, 39, 1, 31, -1, + 16, -1, 18, -1, 19, -1, 21, -1, 17, -1, + 22, -1, 20, -1, 23, -1, 31, -1, 61, -1, + 71, -1, 44, -1, 46, -1, 69, -1, 26, 1, + 31, -1, 1, 31, -1, 10, 26, 31, -1, 43, + 47, -1, 11, 26, 31, -1, 45, 47, -1, -1, + 47, 48, -1, 47, 49, -1, 47, 75, -1, 47, + 73, -1, 47, 42, -1, 47, 31, -1, 19, 78, + 31, -1, 18, 79, 82, 31, -1, 20, 83, 82, + 31, -1, 21, 26, 82, 31, -1, 22, 84, 84, + 82, 31, -1, 24, 50, 31, -1, -1, 50, 26, + 51, -1, -1, 34, 79, -1, 7, 85, 31, -1, + 52, 56, -1, 80, -1, 53, 58, 54, -1, -1, + 56, 57, -1, 56, 75, -1, 56, 73, -1, 56, + 31, -1, 56, 42, -1, 18, 79, 82, 31, -1, + 19, 78, 31, -1, 17, 31, -1, 20, 26, 82, + 31, -1, -1, 58, 41, -1, 14, 83, 81, -1, + 80, -1, 59, 62, 60, -1, -1, 62, 41, -1, + 62, 67, -1, 62, 55, -1, 3, 79, 81, -1, + 4, 79, 31, -1, 64, 76, 74, -1, 80, -1, + 65, 68, 66, -1, -1, 68, 41, -1, 68, 67, + -1, 68, 55, -1, 6, 79, 31, -1, 9, 79, + 31, -1, 70, 74, -1, 12, 31, -1, 72, 13, + -1, -1, 74, 75, -1, 74, 31, -1, 74, 42, + -1, 16, 25, 83, 31, -1, -1, 76, 77, -1, + 76, 31, -1, 23, 82, -1, -1, 79, 82, -1, + 26, -1, 27, -1, 5, 31, -1, 8, 31, -1, + 15, 31, -1, 31, -1, 81, 31, -1, -1, 14, + 83, -1, 84, -1, 84, 34, 84, -1, 84, 28, + 84, -1, 30, 83, 29, -1, 35, 83, -1, 83, + 32, 83, -1, 83, 33, 83, -1, 26, -1, 27, + -1, -1, 26, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 108, 108, 108, 110, 110, 112, 114, 115, 116, + 117, 118, 119, 123, 127, 127, 127, 127, 127, 127, + 127, 127, 131, 132, 133, 134, 135, 136, 140, 141, + 147, 155, 161, 169, 179, 181, 182, 183, 184, 185, + 186, 189, 197, 203, 213, 219, 225, 228, 230, 241, + 242, 247, 256, 261, 269, 272, 274, 275, 276, 277, + 278, 281, 287, 298, 304, 314, 316, 321, 329, 337, + 340, 342, 343, 344, 349, 356, 363, 368, 376, 379, + 381, 382, 383, 386, 394, 401, 408, 414, 421, 423, + 424, 425, 428, 436, 438, 439, 442, 449, 451, 456, + 457, 460, 461, 462, 466, 467, 470, 471, 474, 475, + 476, 477, 478, 479, 480, 483, 484, 487, 488 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", + "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", + "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", + "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", + "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", + "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", + "T_NOT", "$accept", "input", "start", "stmt_list", "option_name", + "common_stmt", "option_error", "config_entry_start", "config_stmt", + "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", + "config_option", "symbol_option", "symbol_option_list", + "symbol_option_arg", "choice", "choice_entry", "choice_end", + "choice_stmt", "choice_option_list", "choice_option", "choice_block", + "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu", + "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt", + "comment", "comment_stmt", "help_start", "help", "depends_list", + "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt", + "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 36, 37, 37, 38, 38, 39, 39, 39, 39, + 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, + 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, + 43, 44, 45, 46, 47, 47, 47, 47, 47, 47, + 47, 48, 48, 48, 48, 48, 49, 50, 50, 51, + 51, 52, 53, 54, 55, 56, 56, 56, 56, 56, + 56, 57, 57, 57, 57, 58, 58, 59, 60, 61, + 62, 62, 62, 62, 63, 64, 65, 66, 67, 68, + 68, 68, 68, 69, 70, 71, 72, 73, 74, 74, + 74, 74, 75, 76, 76, 76, 77, 78, 78, 79, + 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, + 83, 83, 83, 83, 83, 84, 84, 85, 85 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 1, 0, 2, 2, 2, + 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, + 3, 2, 3, 2, 0, 2, 2, 2, 2, 2, + 2, 3, 4, 4, 4, 5, 3, 0, 3, 0, + 2, 3, 2, 1, 3, 0, 2, 2, 2, 2, + 2, 4, 3, 2, 4, 0, 2, 3, 1, 3, + 0, 2, 2, 2, 3, 3, 3, 1, 3, 0, + 2, 2, 2, 3, 3, 2, 2, 2, 0, 2, + 2, 2, 4, 0, 2, 2, 2, 0, 2, 1, + 1, 2, 2, 2, 1, 2, 0, 2, 1, 3, + 3, 3, 2, 3, 3, 1, 1, 0, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 6, 0, 104, 0, 3, 0, 6, 6, 99, 100, + 0, 1, 0, 0, 0, 0, 117, 0, 0, 0, + 0, 0, 0, 14, 18, 15, 16, 20, 17, 19, + 21, 0, 22, 0, 7, 34, 25, 34, 26, 55, + 65, 8, 70, 23, 93, 79, 9, 27, 88, 24, + 10, 0, 105, 2, 74, 13, 0, 101, 0, 118, + 0, 102, 0, 0, 0, 115, 116, 0, 0, 0, + 108, 103, 0, 0, 0, 0, 0, 0, 0, 88, + 0, 0, 75, 83, 51, 84, 30, 32, 0, 112, + 0, 0, 67, 0, 0, 11, 12, 0, 0, 0, + 0, 97, 0, 0, 0, 47, 0, 40, 39, 35, + 36, 0, 38, 37, 0, 0, 97, 0, 59, 60, + 56, 58, 57, 66, 54, 53, 71, 73, 69, 72, + 68, 106, 95, 0, 94, 80, 82, 78, 81, 77, + 90, 91, 89, 111, 113, 114, 110, 109, 29, 86, + 0, 106, 0, 106, 106, 106, 0, 0, 0, 87, + 63, 106, 0, 106, 0, 96, 0, 0, 41, 98, + 0, 0, 106, 49, 46, 28, 0, 62, 0, 107, + 92, 42, 43, 44, 0, 0, 48, 61, 64, 45, + 50 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 33, 34, 108, 35, 36, 37, + 38, 74, 109, 110, 157, 186, 39, 40, 124, 41, + 76, 120, 77, 42, 128, 43, 78, 6, 44, 45, + 137, 46, 80, 47, 48, 49, 111, 112, 81, 113, + 79, 134, 152, 153, 50, 7, 165, 69, 70, 60 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -90 +static const yytype_int16 yypact[] = +{ + 4, 42, -90, 96, -90, 111, -90, 15, -90, -90, + 75, -90, 82, 42, 104, 42, 110, 107, 42, 115, + 125, -4, 121, -90, -90, -90, -90, -90, -90, -90, + -90, 162, -90, 163, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, 139, -90, -90, 138, -90, 142, -90, 143, -90, + 152, -90, 164, 167, 168, -90, -90, -4, -4, 77, + -18, -90, 177, 185, 33, 71, 195, 247, 236, -2, + 236, 171, -90, -90, -90, -90, -90, -90, 41, -90, + -4, -4, 138, 97, 97, -90, -90, 186, 187, 194, + 42, 42, -4, 196, 97, -90, 219, -90, -90, -90, + -90, 210, -90, -90, 204, 42, 42, 199, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, 222, -90, 223, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, 215, -90, -90, -90, -90, -90, + -4, 222, 228, 222, -5, 222, 97, 35, 229, -90, + -90, 222, 232, 222, -4, -90, 135, 233, -90, -90, + 234, 235, 222, 240, -90, -90, 237, -90, 239, -13, + -90, -90, -90, -90, 244, 42, -90, -90, -90, -90, + -90 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -90, -90, 269, 271, -90, 23, -70, -90, -90, -90, + -90, 243, -90, -90, -90, -90, -90, -90, -90, -48, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -20, -90, -90, -90, -90, -90, 206, 205, -68, + -90, -90, 169, -1, 27, -7, 118, -66, -89, -90 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -86 +static const yytype_int16 yytable[] = +{ + 10, 88, 89, 54, 146, 147, 119, 1, 122, 164, + 93, 141, 56, 142, 58, 156, 94, 62, 1, 90, + 91, 131, 65, 66, 144, 145, 67, 90, 91, 132, + 127, 68, 136, -31, 97, 2, 154, -31, -31, -31, + -31, -31, -31, -31, -31, 98, 52, -31, -31, 99, + -31, 100, 101, 102, 103, 104, -31, 105, 129, 106, + 138, 173, 92, 141, 107, 142, 174, 172, 8, 9, + 143, -33, 97, 90, 91, -33, -33, -33, -33, -33, + -33, -33, -33, 98, 166, -33, -33, 99, -33, 100, + 101, 102, 103, 104, -33, 105, 11, 106, 179, 151, + 123, 126, 107, 135, 125, 130, 2, 139, 2, 90, + 91, -5, 12, 55, 161, 13, 14, 15, 16, 17, + 18, 19, 20, 65, 66, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 57, 59, 31, 61, -4, + 12, 63, 32, 13, 14, 15, 16, 17, 18, 19, + 20, 64, 71, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 72, 73, 31, 180, 90, 91, 52, + 32, -85, 97, 82, 83, -85, -85, -85, -85, -85, + -85, -85, -85, 84, 190, -85, -85, 99, -85, -85, + -85, -85, -85, -85, -85, 85, 97, 106, 86, 87, + -52, -52, 140, -52, -52, -52, -52, 98, 95, -52, + -52, 99, 114, 115, 116, 117, 96, 148, 149, 150, + 158, 106, 155, 159, 97, 163, 118, -76, -76, -76, + -76, -76, -76, -76, -76, 160, 164, -76, -76, 99, + 13, 14, 15, 16, 17, 18, 19, 20, 91, 106, + 21, 22, 14, 15, 140, 17, 18, 19, 20, 168, + 175, 21, 22, 177, 181, 182, 183, 32, 187, 167, + 188, 169, 170, 171, 185, 189, 53, 51, 32, 176, + 75, 178, 121, 0, 133, 162, 0, 0, 0, 0, + 184 +}; + +static const yytype_int16 yycheck[] = +{ + 1, 67, 68, 10, 93, 94, 76, 3, 76, 14, + 28, 81, 13, 81, 15, 104, 34, 18, 3, 32, + 33, 23, 26, 27, 90, 91, 30, 32, 33, 31, + 78, 35, 80, 0, 1, 31, 102, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 31, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 78, 26, + 80, 26, 69, 133, 31, 133, 31, 156, 26, 27, + 29, 0, 1, 32, 33, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 150, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 0, 26, 164, 100, + 77, 78, 31, 80, 77, 78, 31, 80, 31, 32, + 33, 0, 1, 31, 115, 4, 5, 6, 7, 8, + 9, 10, 11, 26, 27, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 31, 26, 26, 31, 0, + 1, 26, 31, 4, 5, 6, 7, 8, 9, 10, + 11, 26, 31, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 1, 1, 26, 31, 32, 33, 31, + 31, 0, 1, 31, 31, 4, 5, 6, 7, 8, + 9, 10, 11, 31, 185, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 31, 1, 26, 31, 31, + 5, 6, 31, 8, 9, 10, 11, 12, 31, 14, + 15, 16, 17, 18, 19, 20, 31, 31, 31, 25, + 1, 26, 26, 13, 1, 26, 31, 4, 5, 6, + 7, 8, 9, 10, 11, 31, 14, 14, 15, 16, + 4, 5, 6, 7, 8, 9, 10, 11, 33, 26, + 14, 15, 5, 6, 31, 8, 9, 10, 11, 31, + 31, 14, 15, 31, 31, 31, 31, 31, 31, 151, + 31, 153, 154, 155, 34, 31, 7, 6, 31, 161, + 37, 163, 76, -1, 79, 116, -1, -1, -1, -1, + 172 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 31, 37, 38, 39, 63, 81, 26, 27, + 79, 0, 1, 4, 5, 6, 7, 8, 9, 10, + 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 26, 31, 40, 41, 43, 44, 45, 46, 52, + 53, 55, 59, 61, 64, 65, 67, 69, 70, 71, + 80, 39, 31, 38, 81, 31, 79, 31, 79, 26, + 85, 31, 79, 26, 26, 26, 27, 30, 35, 83, + 84, 31, 1, 1, 47, 47, 56, 58, 62, 76, + 68, 74, 31, 31, 31, 31, 31, 31, 83, 83, + 32, 33, 81, 28, 34, 31, 31, 1, 12, 16, + 18, 19, 20, 21, 22, 24, 26, 31, 42, 48, + 49, 72, 73, 75, 17, 18, 19, 20, 31, 42, + 57, 73, 75, 41, 54, 80, 41, 55, 60, 67, + 80, 23, 31, 74, 77, 41, 55, 66, 67, 80, + 31, 42, 75, 29, 83, 83, 84, 84, 31, 31, + 25, 79, 78, 79, 83, 26, 84, 50, 1, 13, + 31, 79, 78, 26, 14, 82, 83, 82, 31, 82, + 82, 82, 84, 26, 31, 31, 82, 31, 82, 83, + 31, 31, 31, 31, 82, 34, 51, 31, 31, 31, + 79 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + case 53: /* "choice_entry" */ + + { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); + if (current_menu == (yyvaluep->menu)) + menu_end_menu(); +}; + + break; + case 59: /* "if_entry" */ + + { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); + if (current_menu == (yyvaluep->menu)) + menu_end_menu(); +}; + + break; + case 65: /* "menu_entry" */ + + { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); + if (current_menu == (yyvaluep->menu)) + menu_end_menu(); +}; + + break; + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 10: + + { zconf_error("unexpected end statement"); ;} + break; + + case 11: + + { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;} + break; + + case 12: + + { + zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); +;} + break; + + case 13: + + { zconf_error("invalid statement"); ;} + break; + + case 28: + + { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} + break; + + case 29: + + { zconf_error("invalid option"); ;} + break; + + case 30: + + { + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); +;} + break; + + case 31: + + { + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 32: + + { + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); +;} + break; + + case 33: + + { + if (current_entry->prompt) + current_entry->prompt->type = P_MENU; + else + zconfprint("warning: menuconfig statement without prompt"); + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 41: + + { + menu_set_type((yyvsp[(1) - (3)].id)->stype); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), + (yyvsp[(1) - (3)].id)->stype); +;} + break; + + case 42: + + { + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 43: + + { + menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); + if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN) + menu_set_type((yyvsp[(1) - (4)].id)->stype); + printd(DEBUG_PARSE, "%s:%d:default(%u)\n", + zconf_curname(), zconf_lineno(), + (yyvsp[(1) - (4)].id)->stype); +;} + break; + + case 44: + + { + menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 45: + + { + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); + printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 48: + + { + struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); + if (id && id->flags & TF_OPTION) + menu_add_option(id->token, (yyvsp[(3) - (3)].string)); + else + zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string)); + free((yyvsp[(2) - (3)].string)); +;} + break; + + case 49: + + { (yyval.string) = NULL; ;} + break; + + case 50: + + { (yyval.string) = (yyvsp[(2) - (2)].string); ;} + break; + + case 51: + + { + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); + sym->flags |= SYMBOL_AUTO; + menu_add_entry(sym); + menu_add_expr(P_CHOICE, NULL, NULL); + printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 52: + + { + (yyval.menu) = menu_add_menu(); +;} + break; + + case 53: + + { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); + } +;} + break; + + case 61: + + { + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 62: + + { + if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { + menu_set_type((yyvsp[(1) - (3)].id)->stype); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), + (yyvsp[(1) - (3)].id)->stype); + } else + YYERROR; +;} + break; + + case 63: + + { + current_entry->sym->flags |= SYMBOL_OPTIONAL; + printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 64: + + { + if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { + menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:default\n", + zconf_curname(), zconf_lineno()); + } else + YYERROR; +;} + break; + + case 67: + + { + printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); + menu_add_entry(NULL); + menu_add_dep((yyvsp[(2) - (3)].expr)); + (yyval.menu) = menu_add_menu(); +;} + break; + + case 68: + + { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); + } +;} + break; + + case 74: + + { + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); +;} + break; + + case 75: + + { + menu_add_entry(NULL); + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); + printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 76: + + { + (yyval.menu) = menu_add_menu(); +;} + break; + + case 77: + + { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); + } +;} + break; + + case 83: + + { + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); + zconf_nextfile((yyvsp[(2) - (3)].string)); +;} + break; + + case 84: + + { + menu_add_entry(NULL); + menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL); + printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 85: + + { + menu_end_entry(); +;} + break; + + case 86: + + { + printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); + zconf_starthelp(); +;} + break; + + case 87: + + { + current_entry->help = (yyvsp[(2) - (2)].string); +;} + break; + + case 92: + + { + menu_add_dep((yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 96: + + { + menu_add_visibility((yyvsp[(2) - (2)].expr)); +;} + break; + + case 98: + + { + menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); +;} + break; + + case 101: + + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} + break; + + case 102: + + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} + break; + + case 103: + + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} + break; + + case 106: + + { (yyval.expr) = NULL; ;} + break; + + case 107: + + { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} + break; + + case 108: + + { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} + break; + + case 109: + + { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} + break; + + case 110: + + { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} + break; + + case 111: + + { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} + break; + + case 112: + + { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} + break; + + case 113: + + { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} + break; + + case 114: + + { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} + break; + + case 115: + + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} + break; + + case 116: + + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} + break; + + case 117: + + { (yyval.string) = NULL; ;} + break; + + + + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + + + +void conf_parse(const char *name) +{ + struct symbol *sym; + int i; + + zconf_initscan(name); + + sym_init(); + _menu_init(); + modules_sym = sym_lookup(NULL, 0); + modules_sym->type = S_BOOLEAN; + modules_sym->flags |= SYMBOL_AUTO; + rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + +#if YYDEBUG + if (getenv("ZCONF_DEBUG")) + zconfdebug = 1; +#endif + zconfparse(); + if (zconfnerrs) + exit(1); + if (!modules_sym->prop) { + struct property *prop; + + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); + } + + rootmenu.prompt->text = _(rootmenu.prompt->text); + rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); + + menu_finalize(&rootmenu); + for_all_symbols(i, sym) { + if (sym_check_deps(sym)) + zconfnerrs++; + } + if (zconfnerrs) + exit(1); + sym_set_change_count(1); +} + +static const char *zconf_tokenname(int token) +{ + switch (token) { + case T_MENU: return "menu"; + case T_ENDMENU: return "endmenu"; + case T_CHOICE: return "choice"; + case T_ENDCHOICE: return "endchoice"; + case T_IF: return "if"; + case T_ENDIF: return "endif"; + case T_DEPENDS: return "depends"; + case T_VISIBLE: return "visible"; + } + return ""; +} + +static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) +{ + if (id->token != endtoken) { + zconf_error("unexpected '%s' within %s block", + kconf_id_strings + id->name, zconf_tokenname(starttoken)); + zconfnerrs++; + return false; + } + if(0) { + //if (current_menu->file != current_file) { + zconf_error("'%s' in different file than '%s'", + kconf_id_strings + id->name, zconf_tokenname(starttoken)); + fprintf(stderr, "%s:%d: location of the '%s'\n", + current_menu->file->name, current_menu->lineno, + zconf_tokenname(starttoken)); + zconfnerrs++; + return false; + } + return true; +} + +static void zconfprint(const char *err, ...) +{ + va_list ap; + + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + va_start(ap, err); + vfprintf(stderr, err, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void zconf_error(const char *err, ...) +{ + va_list ap; + + zconfnerrs++; + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + va_start(ap, err); + vfprintf(stderr, err, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void zconferror(const char *err) +{ +#if YYDEBUG + fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); +#endif +} + +static void print_quoted_string(FILE *out, const char *str) +{ + const char *p; + int len; + + putc('"', out); + while ((p = strchr(str, '"'))) { + len = p - str; + if (len) + fprintf(out, "%.*s", len, str); + fputs("\\\"", out); + str = p + 1; + } + fputs(str, out); + putc('"', out); +} + +static void print_symbol(FILE *out, struct menu *menu) +{ + struct symbol *sym = menu->sym; + struct property *prop; + + if (sym_is_choice(sym)) + fprintf(out, "\nchoice\n"); + else + fprintf(out, "\nconfig %s\n", sym->name); + switch (sym->type) { + case S_BOOLEAN: + fputs(" boolean\n", out); + break; + case S_TRISTATE: + fputs(" tristate\n", out); + break; + case S_STRING: + fputs(" string\n", out); + break; + case S_INT: + fputs(" integer\n", out); + break; + case S_HEX: + fputs(" hex\n", out); + break; + default: + fputs(" ???\n", out); + break; + } + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + switch (prop->type) { + case P_PROMPT: + fputs(" prompt ", out); + print_quoted_string(out, prop->text); + if (!expr_is_yes(prop->visible.expr)) { + fputs(" if ", out); + expr_fprint(prop->visible.expr, out); + } + fputc('\n', out); + break; + case P_DEFAULT: + fputs( " default ", out); + expr_fprint(prop->expr, out); + if (!expr_is_yes(prop->visible.expr)) { + fputs(" if ", out); + expr_fprint(prop->visible.expr, out); + } + fputc('\n', out); + break; + case P_CHOICE: + fputs(" #choice value\n", out); + break; + case P_SELECT: + fputs( " select ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_RANGE: + fputs( " range ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_MENU: + fputs( " menu ", out); + print_quoted_string(out, prop->text); + fputc('\n', out); + break; + default: + fprintf(out, " unknown prop %d!\n", prop->type); + break; + } + } + if (menu->help) { + int len = strlen(menu->help); + while (menu->help[--len] == '\n') + menu->help[len] = 0; + fprintf(out, " help\n%s\n", menu->help); + } +} + +void zconfdump(FILE *out) +{ + struct property *prop; + struct symbol *sym; + struct menu *menu; + + menu = rootmenu.list; + while (menu) { + if ((sym = menu->sym)) + print_symbol(out, menu); + else if ((prop = menu->prompt)) { + switch (prop->type) { + case P_COMMENT: + fputs("\ncomment ", out); + print_quoted_string(out, prop->text); + fputs("\n", out); + break; + case P_MENU: + fputs("\nmenu ", out); + print_quoted_string(out, prop->text); + fputs("\n", out); + break; + default: + ; + } + if (!expr_is_yes(prop->visible.expr)) { + fputs(" depends ", out); + expr_fprint(prop->visible.expr, out); + fputc('\n', out); + } + } + + if (menu->list) + menu = menu->list; + else if (menu->next) + menu = menu->next; + else while ((menu = menu->parent)) { + if (menu->prompt && menu->prompt->type == P_MENU) + fputs("\nendmenu\n", out); + if (menu->next) { + menu = menu->next; + break; + } + } + } +} + +#include "lex.zconf.c" +#include "util.c" +#include "confdata.c" +#include "expr.c" +#include "symbol.c" +#include "menu.c" + diff --git a/i386/config/Makefile b/i386/config/Makefile new file mode 100644 index 0000000..e02aa41 --- /dev/null +++ b/i386/config/Makefile @@ -0,0 +1,57 @@ +# +# Until I can remove the dependency on the appkit, +# we'll just keep the generated files in this directory +# and install them directly, rather than generating them again. +# +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/config +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = util +include ${SRCROOT}/Make.rules + +OBJS = cconfig.o32 cconfig.o64 zconf.tab.o32 zconf.tab.o64 \ + yesno.o32 yesno.o64 textbox.o32 textbox.o64 menubox.o32 \ + menubox.o64 checklist.o32 checklist.o64 inputbox.o32 inputbox.o64 + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +DEFINES = -DKBUILD_NO_NLS -DCURSES_LOC=\ -DPATH_MAX=256 -DPACKAGE=\"chameleon\" +LDFLAGS = -lncurses -lmenu + +PROGRAMS = cconfig + +SYMPROG = $(addprefix $(SYMROOT)/, $(PROGRAMS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +all: $(DIRS_NEEDED) $(SYMPROG) + +$(SYMPROG): $(OBJS) + @echo "\t[LD32] $(@F)_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/*.o32 + @echo "\t[LD64] $(@F)_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/*.o64 + @echo "\t[LIPO] $(@F)" + @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 -output $(SYMROOT)/$(@F) + @$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64 + +config: $(DIRS_NEEDED) $(SYMPROG) + @cd ${SRCROOT} && $(SYMPROG) $(SRCROOT)/Cconfig + +rebuild_config: $(DIRS_NEEDED) $(SYMPROG) + @cd ${SRCROOT} && $(SYMPROG) $(SRCROOT)/Cconfig rebuild + + +.PHONY: config rebuild_config + +#dependencies +-include $(OBJROOT)/Makedep + +distclean-local: + @rm -f $(SYMPROG) $(OBJS) $(OBJROOT)/Makedep diff --git a/i386/config/cconfig.c b/i386/config/cconfig.c new file mode 100644 index 0000000..5f86c88 --- /dev/null +++ b/i386/config/cconfig.c @@ -0,0 +1,883 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + * + * Introduced single menu mode (show all sub-menus in one large tree). + * 2002-11-06 Petr Baudis + * + * i18n, 2005, Arnaldo Carvalho de Melo + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" +#include "lxdialog/dialog.h" + +static const char mconf_readme[] = N_( + "Overview\n" + "--------\n" + "This interface let you select features and parameters for the build.\n" + "Features can either be built-in, modularized, or ignored. Parameters\n" + "must be entered in as decimal or hexadecimal numbers or text.\n" + "\n" + "Menu items beginning with following braces represent features that\n" + " [ ] can be built in or removed\n" + " < > can be built in, modularized or removed\n" + " { } can be built in or modularized (selected by other feature)\n" + " - - are selected by other feature,\n" + "while *, M or whitespace inside braces means to build in, build as\n" + "a module or to exclude the feature respectively.\n" + "\n" + "To change any of these features, highlight it with the cursor\n" + "keys and press to build it in, to make it a module or\n" + " to removed it. You may also press the to cycle\n" + "through the available options (ie. Y->N->M->Y).\n" + "\n" + "Some additional keyboard hints:\n" + "\n" + "Menus\n" + "----------\n" + "o Use the Up/Down arrow keys (cursor keys) to highlight the item\n" + " you wish to change or submenu wish to select and press .\n" + " Submenus are designated by \"--->\".\n" + "\n" + " Shortcut: Press the option's highlighted letter (hotkey).\n" + " Pressing a hotkey more than once will sequence\n" + " through all visible items which use that hotkey.\n" + "\n" + " You may also use the and keys to scroll\n" + " unseen options into view.\n" + "\n" + "o To exit a menu use the cursor keys to highlight the button\n" + " and press .\n" + "\n" + " Shortcut: Press or or if there is no hotkey\n" + " using those letters. You may press a single , but\n" + " there is a delayed response which you may find annoying.\n" + "\n" + " Also, the and cursor keys will cycle between and\n" + " \n" + "\n" + "\n" + "Data Entry\n" + "-----------\n" + "o Enter the requested information and press \n" + " If you are entering hexadecimal values, it is not necessary to\n" + " add the '0x' prefix to the entry.\n" + "\n" + "o For help, use the or cursor keys to highlight the help option\n" + " and press . You can try as well.\n" + "\n" + "\n" + "Text Box (Help Window)\n" + "--------\n" + "o Use the cursor keys to scroll up/down/left/right. The VI editor\n" + " keys h,j,k,l function here as do and for those\n" + " who are familiar with less and lynx.\n" + "\n" + "o Press , , or to exit.\n" + "\n" + "\n" + "Alternate Configuration Files\n" + "-----------------------------\n" + "Menuconfig supports the use of alternate configuration files for\n" + "those who, for various reasons, find it necessary to switch\n" + "between different configurations.\n" + "\n" + "At the end of the main menu you will find two options. One is\n" + "for saving the current configuration to a file of your choosing.\n" + "The other option is for loading a previously saved alternate\n" + "configuration.\n" + "\n" + "Even if you don't use alternate configuration files, but you\n" + "find during a Menuconfig session that you have completely messed\n" + "up your settings, you may use the \"Load Alternate...\" option to\n" + "restore your previously saved settings from \".config\" without\n" + "restarting Menuconfig.\n" + "\n" + "Other information\n" + "-----------------\n" + "If you use Menuconfig in an XTERM window make sure you have your\n" + "$TERM variable set to point to a xterm definition which supports color.\n" + "Otherwise, Menuconfig will look rather bad. Menuconfig will not\n" + "display correctly in a RXVT window because rxvt displays only one\n" + "intensity of color, bright.\n" + "\n" + "Menuconfig will display larger menus on screens or xterms which are\n" + "set to display more than the standard 25 row by 80 column geometry.\n" + "In order for this to work, the \"stty size\" command must be able to\n" + "display the screen's current row and column geometry. I STRONGLY\n" + "RECOMMEND that you make sure you do NOT have the shell variables\n" + "LINES and COLUMNS exported into your environment. Some distributions\n" + "export those variables via /etc/profile. Some ncurses programs can\n" + "become confused when those variables (LINES & COLUMNS) don't reflect\n" + "the true screen size.\n" + "\n" + "Optional personality available\n" + "------------------------------\n" + "If you prefer to have all of the options listed in a single menu, rather\n" + "than the default multimenu hierarchy, run the menuconfig with\n" + "MENUCONFIG_MODE environment variable set to single_menu. Example:\n" + "\n" + "make MENUCONFIG_MODE=single_menu menuconfig\n" + "\n" + " will then unroll the appropriate category, or enfold it if it\n" + "is already unrolled.\n" + "\n" + "Note that this mode can eventually be a little more CPU expensive\n" + "(especially with a larger number of unrolled categories) than the\n" + "default mode.\n" + "\n" + "Different color themes available\n" + "--------------------------------\n" + "It is possible to select different color themes using the variable\n" + "MENUCONFIG_COLOR. To select a theme use:\n" + "\n" + "make MENUCONFIG_COLOR= menuconfig\n" + "\n" + "Available themes are\n" + " mono => selects colors suitable for monochrome displays\n" + " blackbg => selects a color scheme with black background\n" + " classic => theme with blue background. The classic look\n" + " bluetitle => a LCD friendly version of classic. (default)\n" + "\n"), +menu_instructions[] = N_( + "Arrow keys navigate the menu. " + " selects submenus --->. " + "Highlighted letters are hotkeys. " + "Pressing includes, excludes, modularizes features. " + "Press to exit, for Help, for Search. " + "Legend: [*] built-in [ ] excluded module < > module capable"), +radiolist_instructions[] = N_( + "Use the arrow keys to navigate this window or " + "press the hotkey of the item you wish to select " + "followed by the . " + "Press for additional information about this option."), +inputbox_instructions_int[] = N_( + "Please enter a decimal value. " + "Fractions will not be accepted. " + "Use the key to move from the input field to the buttons below it."), +inputbox_instructions_hex[] = N_( + "Please enter a hexadecimal value. " + "Use the key to move from the input field to the buttons below it."), +inputbox_instructions_string[] = N_( + "Please enter a string value. " + "Use the key to move from the input field to the buttons below it."), +setmod_text[] = N_( + "This feature depends on another which has been configured as a module.\n" + "As a result, this feature will be built as a module."), +load_config_text[] = N_( + "Enter the name of the configuration file you wish to load. " + "Accept the name shown to restore the configuration you " + "last retrieved. Leave blank to abort."), +load_config_help[] = N_( + "\n" + "For various reasons, one may wish to keep several different\n" + "configurations available on a single machine.\n" + "\n" + "If you have saved a previous configuration in a file other than the\n" + "default one, entering its name here will allow you to modify that\n" + "configuration.\n" + "\n" + "If you are uncertain, then you have probably never used alternate\n" + "configuration files. You should therefore leave this blank to abort.\n"), +save_config_text[] = N_( + "Enter a filename to which this configuration should be saved " + "as an alternate. Leave blank to abort."), +save_config_help[] = N_( + "\n" + "For various reasons, one may wish to keep different configurations\n" + "available on a single machine.\n" + "\n" + "Entering a file name here will allow you to later retrieve, modify\n" + "and use the current configuration as an alternate to whatever\n" + "configuration options you have selected at that time.\n" + "\n" + "If you are uncertain what all this means then you should probably\n" + "leave this blank.\n"), +search_help[] = N_( + "\n" + "Search for symbols and display their relations.\n" + "Regular expressions are allowed.\n" + "Example: search for \"^FOO\"\n" + "Result:\n" + "-----------------------------------------------------------------\n" + "Symbol: FOO [=m]\n" + "Prompt: Foo bus is used to drive the bar HW\n" + "Defined at drivers/pci/Kconfig:47\n" + "Depends on: X86_LOCAL_APIC && X86_IO_APIC || IA64\n" + "Location:\n" + " -> Bus options (PCI, PCMCIA, EISA, MCA, ISA)\n" + " -> PCI support (PCI [=y])\n" + " -> PCI access mode ( [=y])\n" + "Selects: LIBCRC32\n" + "Selected by: BAR\n" + "-----------------------------------------------------------------\n" + "o The line 'Prompt:' shows the text used in the menu structure for\n" + " this symbol\n" + "o The 'Defined at' line tell at what file / line number the symbol\n" + " is defined\n" + "o The 'Depends on:' line tell what symbols needs to be defined for\n" + " this symbol to be visible in the menu (selectable)\n" + "o The 'Location:' lines tell where in the menu structure this symbol\n" + " is located\n" + " A location followed by a [=y] indicate that this is a selectable\n" + " menu item - and current value is displayed inside brackets.\n" + "o The 'Selects:' line tell what symbol will be automatically\n" + " selected if this symbol is selected (y or m)\n" + "o The 'Selected by' line tell what symbol has selected this symbol\n" + "\n" + "Only relevant lines are shown.\n" + "\n\n" + "Search examples:\n" + "Examples: USB => find all symbols containing USB\n" + " ^USB => find all symbols starting with USB\n" + " USB$ => find all symbols ending with USB\n" + "\n"); + +static int indent; +static struct menu *current_menu; +static int child_count; +static int single_menu_mode; +static int show_all_options; + +static void conf(struct menu *menu); +static void conf_choice(struct menu *menu); +static void conf_string(struct menu *menu); +static void conf_load(void); +static void conf_save(void); +static void show_textbox(const char *title, const char *text, int r, int c); +static void show_helptext(const char *title, const char *text); +static void show_help(struct menu *menu); + +static char filename[PATH_MAX+1]; +static void set_config_filename(const char *config_filename) +{ + static char menu_backtitle[PATH_MAX+128]; + int size; + + size = snprintf(menu_backtitle, sizeof(menu_backtitle), + "%s - %s", config_filename, rootmenu.prompt->text); + if (size >= sizeof(menu_backtitle)) + menu_backtitle[sizeof(menu_backtitle)-1] = '\0'; + set_dialog_backtitle(menu_backtitle); + + size = snprintf(filename, sizeof(filename), "%s", config_filename); + if (size >= sizeof(filename)) + filename[sizeof(filename)-1] = '\0'; +} + + +static void search_conf(void) +{ + struct symbol **sym_arr; + struct gstr res; + char *dialog_input; + int dres; +again: + dialog_clear(); + dres = dialog_inputbox(_("Search Configuration Parameter"), + _("Enter " CONFIG_ " (sub)string to search for " + "(with or without \"" CONFIG_ "\")"), + 10, 75, ""); + switch (dres) { + case 0: + break; + case 1: + show_helptext(_("Search Configuration"), search_help); + goto again; + default: + return; + } + + /* strip the prefix if necessary */ + dialog_input = dialog_input_result; + if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) + dialog_input += strlen(CONFIG_); + + sym_arr = sym_re_search(dialog_input); + res = get_relations_str(sym_arr); + free(sym_arr); + show_textbox(_("Search Results"), str_get(&res), 0, 0); + str_free(&res); +} + +static void build_conf(struct menu *menu) +{ + struct symbol *sym; + struct property *prop; + struct menu *child; + int type, tmp, doint = 2; + tristate val; + char ch; + bool visible; + + /* + * note: menu_is_visible() has side effect that it will + * recalc the value of the symbol. + */ + visible = menu_is_visible(menu); + if (show_all_options && !menu_has_prompt(menu)) + return; + else if (!show_all_options && !visible) + return; + + sym = menu->sym; + prop = menu->prompt; + if (!sym) { + if (prop && menu != current_menu) { + const char *prompt = menu_get_prompt(menu); + switch (prop->type) { + case P_MENU: + child_count++; + prompt = _(prompt); + if (single_menu_mode) { + item_make("%s%*c%s", + menu->data ? "-->" : "++>", + indent + 1, ' ', prompt); + } else + item_make(" %*c%s --->", indent + 1, ' ', prompt); + + item_set_tag('m'); + item_set_data(menu); + if (single_menu_mode && menu->data) + goto conf_childs; + return; + case P_COMMENT: + if (prompt) { + child_count++; + item_make(" %*c*** %s ***", indent + 1, ' ', _(prompt)); + item_set_tag(':'); + item_set_data(menu); + } + break; + default: + if (prompt) { + child_count++; + item_make("---%*c%s", indent + 1, ' ', _(prompt)); + item_set_tag(':'); + item_set_data(menu); + } + } + } else + doint = 0; + goto conf_childs; + } + + type = sym_get_type(sym); + if (sym_is_choice(sym)) { + struct symbol *def_sym = sym_get_choice_value(sym); + struct menu *def_menu = NULL; + + child_count++; + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child) && child->sym == def_sym) + def_menu = child; + } + + val = sym_get_tristate_value(sym); + if (sym_is_changable(sym)) { + switch (type) { + case S_BOOLEAN: + item_make("[%c]", val == no ? ' ' : '*'); + break; + case S_TRISTATE: + switch (val) { + case yes: ch = '*'; break; + case mod: ch = 'M'; break; + default: ch = ' '; break; + } + item_make("<%c>", ch); + break; + } + item_set_tag('t'); + item_set_data(menu); + } else { + item_make(" "); + item_set_tag(def_menu ? 't' : ':'); + item_set_data(menu); + } + + item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); + if (val == yes) { + if (def_menu) { + item_add_str(" (%s)", _(menu_get_prompt(def_menu))); + item_add_str(" --->"); + if (def_menu->list) { + indent += 2; + build_conf(def_menu); + indent -= 2; + } + } + return; + } + } else { + if (menu == current_menu) { + item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); + item_set_tag(':'); + item_set_data(menu); + goto conf_childs; + } + child_count++; + val = sym_get_tristate_value(sym); + if (sym_is_choice_value(sym) && val == yes) { + item_make(" "); + item_set_tag(':'); + item_set_data(menu); + } else { + switch (type) { + case S_BOOLEAN: + if (sym_is_changable(sym)) + item_make("[%c]", val == no ? ' ' : '*'); + else + item_make("-%c-", val == no ? ' ' : '*'); + item_set_tag('t'); + item_set_data(menu); + break; + case S_TRISTATE: + switch (val) { + case yes: ch = '*'; break; + case mod: ch = 'M'; break; + default: ch = ' '; break; + } + if (sym_is_changable(sym)) { + if (sym->rev_dep.tri == mod) + item_make("{%c}", ch); + else + item_make("<%c>", ch); + } else + item_make("-%c-", ch); + item_set_tag('t'); + item_set_data(menu); + break; + default: + tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */ + item_make("(%s)", sym_get_string_value(sym)); + tmp = indent - tmp + 4; + if (tmp < 0) + tmp = 0; + item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)), + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : _(" (NEW)")); + item_set_tag('s'); + item_set_data(menu); + goto conf_childs; + } + } + item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)), + (sym_has_value(sym) || !sym_is_changable(sym)) ? + "" : _(" (NEW)")); + if (menu->prompt->type == P_MENU) { + item_add_str(" --->"); + return; + } + } + +conf_childs: + indent += doint; + for (child = menu->list; child; child = child->next) + build_conf(child); + indent -= doint; +} + +static void conf(struct menu *menu) +{ + struct menu *submenu; + const char *prompt = menu_get_prompt(menu); + struct symbol *sym; + struct menu *active_menu = NULL; + int res; + int s_scroll = 0; + + while (1) { + + item_reset(); + current_menu = menu; + build_conf(menu); + if (!child_count) + break; + if (menu == &rootmenu) { + item_make("--- "); + item_set_tag(':'); + item_make(_(" Load an Alternate Configuration File")); + item_set_tag('L'); + item_make(_(" Save an Alternate Configuration File")); + item_set_tag('S'); + } + dialog_clear(); + res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), + _(menu_instructions), + active_menu, &s_scroll); + if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) + break; + if (!item_activate_selected()) + continue; + if (!item_tag()) + continue; + + submenu = item_data(); + active_menu = item_data(); + if (submenu) + sym = submenu->sym; + else + sym = NULL; + + switch (res) { + case 0: + switch (item_tag()) { + case 'm': + if (single_menu_mode) + submenu->data = (void *) (long) !submenu->data; + else + conf(submenu); + break; + case 't': + if (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes) + conf_choice(submenu); + else if (submenu->prompt->type == P_MENU) + conf(submenu); + break; + case 's': + conf_string(submenu); + break; + case 'L': + conf_load(); + break; + case 'S': + conf_save(); + break; + } + break; + case 2: + if (sym) + show_help(submenu); + else + show_helptext(_("README"), _(mconf_readme)); + break; + case 3: + if (item_is_tag('t')) { + if (sym_set_tristate_value(sym, yes)) + break; + if (sym_set_tristate_value(sym, mod)) + show_textbox(NULL, setmod_text, 6, 74); + } + break; + case 4: + if (item_is_tag('t')) + sym_set_tristate_value(sym, no); + break; + case 5: + if (item_is_tag('t')) + sym_set_tristate_value(sym, mod); + break; + case 6: + if (item_is_tag('t')) + sym_toggle_tristate_value(sym); + else if (item_is_tag('m')) + conf(submenu); + break; + case 7: + search_conf(); + break; + case 8: + show_all_options = !show_all_options; + break; + } + } +} + +static void show_textbox(const char *title, const char *text, int r, int c) +{ + dialog_clear(); + dialog_textbox(title, text, r, c); +} + +static void show_helptext(const char *title, const char *text) +{ + show_textbox(title, text, 0, 0); +} + +static void show_help(struct menu *menu) +{ + struct gstr help = str_new(); + + help.max_width = getmaxx(stdscr) - 10; + menu_get_ext_help(menu, &help); + + show_helptext(_(menu_get_prompt(menu)), str_get(&help)); + str_free(&help); +} + +static void conf_choice(struct menu *menu) +{ + const char *prompt = _(menu_get_prompt(menu)); + struct menu *child; + struct symbol *active; + + active = sym_get_choice_value(menu->sym); + while (1) { + int res; + int selected; + item_reset(); + + current_menu = menu; + for (child = menu->list; child; child = child->next) { + if (!menu_is_visible(child)) + continue; + if (child->sym) + item_make("%s", _(menu_get_prompt(child))); + else { + item_make("*** %s ***", _(menu_get_prompt(child))); + item_set_tag(':'); + } + item_set_data(child); + if (child->sym == active) + item_set_selected(1); + if (child->sym == sym_get_choice_value(menu->sym)) + item_set_tag('X'); + } + dialog_clear(); + res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"), + _(radiolist_instructions), + 15, 70, 6); + selected = item_activate_selected(); + switch (res) { + case 0: + if (selected) { + child = item_data(); + if (!child->sym) + break; + + sym_set_tristate_value(child->sym, yes); + } + return; + case 1: + if (selected) { + child = item_data(); + show_help(child); + active = child->sym; + } else + show_help(menu); + break; + case KEY_ESC: + return; + case -ERRDISPLAYTOOSMALL: + return; + } + } +} + +static void conf_string(struct menu *menu) +{ + const char *prompt = menu_get_prompt(menu); + + while (1) { + int res; + const char *heading; + + switch (sym_get_type(menu->sym)) { + case S_INT: + heading = _(inputbox_instructions_int); + break; + case S_HEX: + heading = _(inputbox_instructions_hex); + break; + case S_STRING: + heading = _(inputbox_instructions_string); + break; + default: + heading = _("Internal mconf error!"); + } + dialog_clear(); + res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"), + heading, 10, 75, + sym_get_string_value(menu->sym)); + switch (res) { + case 0: + if (sym_set_string_value(menu->sym, dialog_input_result)) + return; + show_textbox(NULL, _("You have made an invalid entry."), 5, 43); + break; + case 1: + show_help(menu); + break; + case KEY_ESC: + return; + } + } +} + +static void conf_load(void) +{ + + while (1) { + int res; + dialog_clear(); + res = dialog_inputbox(NULL, load_config_text, + 11, 55, filename); + switch(res) { + case 0: + if (!dialog_input_result[0]) + return; + if (!conf_read(dialog_input_result)) { + set_config_filename(dialog_input_result); + sym_set_change_count(1); + return; + } + show_textbox(NULL, _("File does not exist!"), 5, 38); + break; + case 1: + show_helptext(_("Load Alternate Configuration"), load_config_help); + break; + case KEY_ESC: + return; + } + } +} + +static void conf_save(void) +{ + while (1) { + int res; + dialog_clear(); + res = dialog_inputbox(NULL, save_config_text, + 11, 55, filename); + switch(res) { + case 0: + if (!dialog_input_result[0]) + return; + if (!conf_write(dialog_input_result)) { + set_config_filename(dialog_input_result); + return; + } + show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); + break; + case 1: + show_helptext(_("Save Alternate Configuration"), save_config_help); + break; + case KEY_ESC: + return; + } + } + +} + +int main(int ac, char **av) +{ + int saved_x = 0, saved_y = 0; + char *mode; + int res; + int rebuild = 0; + + if(ac > 2 && (strcmp(av[2], "rebuild") == 0)) rebuild = 1; + + + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + + textdomain(PACKAGE); + + conf_parse(av[1]); + conf_read(NULL); + + mode = getenv("MENUCONFIG_MODE"); + if (mode) { + if (!strcasecmp(mode, "single_menu")) + single_menu_mode = 1; + } + + if(!rebuild) + { + initscr(); + + getyx(stdscr, saved_y, saved_x); + if (init_dialog(NULL)) { + fprintf(stderr, N_("Your display is too small to run Menuconfig!\n")); + fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n")); + return 1; + } + } + set_config_filename(conf_get_configname()); + if(rebuild) + { + res = 0; + } + else + { + do { + conf(&rootmenu); + dialog_clear(); + if (conf_get_changed()) + res = dialog_yesno(NULL, + _("Do you wish to save your " + "new configuration?\n" + " to continue."), + 6, 60); + else + res = -1; + } while (res == KEY_ESC); + end_dialog(saved_x, saved_y); + } + + + switch (res) { + case 0: + if (conf_write(filename)) { + fprintf(stderr, _("\n\n" + "Error while writing of the configuration.\n" + "Your configuration changes were NOT saved." + "\n\n")); + return 1; + } + case -1: + if(!rebuild) + printf(_("\n\n" + "*** End of the configuration.\n" + "*** Execute 'make' to start the build or try 'make help'." + "\n\n")); + break; + default: + fprintf(stderr, _("\n\n" + "Your configuration changes were NOT saved." + "\n\n")); + } + + // Output headers + files needed by the make system + conf_write_autoconf(); + + return 0; +} + diff --git a/i386/config/checklist.c b/i386/config/checklist.c new file mode 100644 index 0000000..a2eb80f --- /dev/null +++ b/i386/config/checklist.c @@ -0,0 +1,332 @@ +/* + * checklist.c -- implements the checklist box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension + * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static int list_width, check_x, item_x; + +/* + * Print list item + */ +static void print_item(WINDOW * win, int choice, int selected) +{ + int i; + char *list_item = malloc(list_width + 1); + + strncpy(list_item, item_str(), list_width - item_x); + list_item[list_width - item_x] = '\0'; + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, choice, 0); + for (i = 0; i < list_width; i++) + waddch(win, ' '); + + wmove(win, choice, check_x); + wattrset(win, selected ? dlg.check_selected.atr + : dlg.check.atr); + if (!item_is_tag(':')) + wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); + + wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); + mvwaddch(win, choice, item_x, list_item[0]); + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + waddstr(win, list_item + 1); + if (selected) { + wmove(win, choice, check_x + 1); + wrefresh(win); + } + free(list_item); +} + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int choice, int item_no, int scroll, + int y, int x, int height) +{ + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + + if ((height < item_no) && (scroll + choice < item_no - 1)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } +} + +/* + * Display the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext("Select"), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with a list of options that can be turned on or off + * in the style of radiolist (only one option turned on at a time). + */ +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height) +{ + int i, x, y, box_x, box_y; + int key = 0, button = 0, choice = 0, scroll = 0, max_choice; + WINDOW *dialog, *list; + + /* which item to highlight */ + item_foreach() { + if (item_is_tag('X')) + choice = item_n(); + if (item_is_selected()) { + choice = item_n(); + break; + } + } + +do_resize: + if (getmaxy(stdscr) < (height + 6)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 6)) + return -ERRDISPLAYTOOSMALL; + + max_choice = MIN(list_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + list_width = width - 6; + box_y = height - list_height - 5; + box_x = (width - list_width) / 2 - 1; + + /* create new window for the list */ + list = subwin(dialog, list_height, list_width, y + box_y + 1, + x + box_x + 1); + + keypad(list, TRUE); + + /* draw a box around the list items */ + draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + /* Find length of longest item in order to center checklist */ + check_x = 0; + item_foreach() + check_x = MAX(check_x, strlen(item_str()) + 4); + check_x = MIN(check_x, list_width); + + check_x = (list_width - check_x) / 2; + item_x = check_x + 4; + + if (choice >= list_height) { + scroll = choice - list_height + 1; + choice -= scroll; + } + + /* Print the list */ + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + print_item(list, i, i == choice); + } + + print_arrows(dialog, choice, item_count(), scroll, + box_y, box_x + check_x + 5, list_height); + + print_buttons(dialog, height, width, 0); + + wnoutrefresh(dialog); + wnoutrefresh(list); + doupdate(); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + for (i = 0; i < max_choice; i++) { + item_set(i + scroll); + if (toupper(key) == toupper(item_str()[0])) + break; + } + + if (i < max_choice || key == KEY_UP || key == KEY_DOWN || + key == '+' || key == '-') { + if (key == KEY_UP || key == '-') { + if (!choice) { + if (!scroll) + continue; + /* Scroll list down */ + if (list_height > 1) { + /* De-highlight current first item */ + item_set(scroll); + print_item(list, 0, FALSE); + scrollok(list, TRUE); + wscrl(list, -1); + scrollok(list, FALSE); + } + scroll--; + item_set(scroll); + print_item(list, 0, TRUE); + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice - 1; + } else if (key == KEY_DOWN || key == '+') { + if (choice == max_choice - 1) { + if (scroll + choice >= item_count() - 1) + continue; + /* Scroll list up */ + if (list_height > 1) { + /* De-highlight current last item before scrolling up */ + item_set(scroll + max_choice - 1); + print_item(list, + max_choice - 1, + FALSE); + scrollok(list, TRUE); + wscrl(list, 1); + scrollok(list, FALSE); + } + scroll++; + item_set(scroll + max_choice - 1); + print_item(list, max_choice - 1, TRUE); + + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice + 1; + } + if (i != choice) { + /* De-highlight current item */ + item_set(scroll + choice); + print_item(list, choice, FALSE); + /* Highlight new item */ + choice = i; + item_set(scroll + choice); + print_item(list, choice, TRUE); + wnoutrefresh(dialog); + wrefresh(list); + } + continue; /* wait for another key press */ + } + switch (key) { + case 'H': + case 'h': + case '?': + button = 1; + /* fall-through */ + case 'S': + case 's': + case ' ': + case '\n': + item_foreach() + item_set_selected(0); + item_set(scroll + choice); + item_set_selected(1); + delwin(list); + delwin(dialog); + return button; + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(list); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + + /* Now, update everything... */ + doupdate(); + } + delwin(list); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/confdata.c b/i386/config/confdata.c new file mode 100644 index 0000000..b10bd8c --- /dev/null +++ b/i386/config/confdata.c @@ -0,0 +1,1078 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +static void conf_warning(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); + +static void conf_message(const char *fmt, ...) + __attribute__ ((format (printf, 1, 2))); + +static const char *conf_filename; +static int conf_lineno, conf_warnings, conf_unsaved; + +const char conf_defname[] = "config/defconfig"; + +static void conf_warning(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "%s:%d:warning: ", conf_filename, conf_lineno); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + conf_warnings++; +} + +static void conf_default_message_callback(const char *fmt, va_list ap) +{ + printf("#\n# "); + vprintf(fmt, ap); + printf("\n#\n"); +} + +static void (*conf_message_callback) (const char *fmt, va_list ap) = + conf_default_message_callback; +void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap)) +{ + conf_message_callback = fn; +} + +static void conf_message(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (conf_message_callback) + conf_message_callback(fmt, ap); +} + +const char *conf_get_configname(void) +{ + char *name = getenv("KCONFIG_CONFIG"); + + return name ? name : ".config"; +} + +const char *conf_get_autoconfig_name(void) +{ + char *name = getenv("KCONFIG_AUTOCONFIG"); + + return name ? name : "auto.conf"; +} + +static char *conf_expand_value(const char *in) +{ + struct symbol *sym; + const char *src; + static char res_value[SYMBOL_MAXLENGTH]; + char *dst, name[SYMBOL_MAXLENGTH]; + + res_value[0] = 0; + dst = name; + while ((src = strchr(in, '$'))) { + strncat(res_value, in, src - in); + src++; + dst = name; + while (isalnum(*src) || *src == '_') + *dst++ = *src++; + *dst = 0; + sym = sym_lookup(name, 0); + sym_calc_value(sym); + strcat(res_value, sym_get_string_value(sym)); + in = src; + } + strcat(res_value, in); + + return res_value; +} + +char *conf_get_default_confname(void) +{ + struct stat buf; + static char fullname[PATH_MAX+1]; + char *env, *name; + + name = conf_expand_value(conf_defname); + env = getenv(SRCTREE); + if (env) { + sprintf(fullname, "%s/%s", env, name); + if (!stat(fullname, &buf)) + return fullname; + } + return name; +} + +static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) +{ + char *p2; + + switch (sym->type) { + case S_TRISTATE: + if (p[0] == 'm') { + sym->def[def].tri = mod; + sym->flags |= def_flags; + break; + } + case S_BOOLEAN: + if (p[0] == 'y') { + sym->def[def].tri = yes; + sym->flags |= def_flags; + break; + } + if (p[0] == 'n') { + sym->def[def].tri = no; + sym->flags |= def_flags; + break; + } + conf_warning("symbol value '%s' invalid for %s", p, sym->name); + break; + case S_OTHER: + if (*p != '"') { + for (p2 = p; *p2 && !isspace(*p2); p2++) + ; + sym->type = S_STRING; + goto done; + } + case S_STRING: + if (*p++ != '"') + break; + for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { + if (*p2 == '"') { + *p2 = 0; + break; + } + memmove(p2, p2 + 1, strlen(p2)); + } + if (!p2) { + conf_warning("invalid string found"); + return 1; + } + case S_INT: + case S_HEX: + done: + if (sym_string_valid(sym, p)) { + sym->def[def].val = strdup(p); + sym->flags |= def_flags; + } else { + conf_warning("symbol value '%s' invalid for %s", p, sym->name); + return 1; + } + break; + default: + ; + } + return 0; +} + +int conf_read_simple(const char *name, int def) +{ + FILE *in = NULL; + char line[1024]; + char *p, *p2; + struct symbol *sym; + int i, def_flags; + + if (name) { + in = zconf_fopen(name); + } else { + struct property *prop; + + name = conf_get_configname(); + in = zconf_fopen(name); + if (in) + goto load; + sym_add_change_count(1); + if (!sym_defconfig_list) { + if (modules_sym) + sym_calc_value(modules_sym); + return 1; + } + + for_all_defaults(sym_defconfig_list, prop) { + if (expr_calc_value(prop->visible.expr) == no || + prop->expr->type != E_SYMBOL) + continue; + name = conf_expand_value(prop->expr->left.sym->name); + in = zconf_fopen(name); + if (in) { + conf_message(_("using defaults found in %s"), + name); + goto load; + } + } + } + if (!in) + return 1; + +load: + conf_filename = name; + conf_lineno = 0; + conf_warnings = 0; + conf_unsaved = 0; + + def_flags = SYMBOL_DEF << def; + for_all_symbols(i, sym) { + sym->flags |= SYMBOL_CHANGED; + sym->flags &= ~(def_flags|SYMBOL_VALID); + if (sym_is_choice(sym)) + sym->flags |= def_flags; + switch (sym->type) { + case S_INT: + case S_HEX: + case S_STRING: + if (sym->def[def].val) + free(sym->def[def].val); + default: + sym->def[def].val = NULL; + sym->def[def].tri = no; + } + } + + while (fgets(line, sizeof(line), in)) { + conf_lineno++; + sym = NULL; + if (line[0] == '#') { + if (memcmp(line + 2, CONFIG_, strlen(CONFIG_))) + continue; + p = strchr(line + 2 + strlen(CONFIG_), ' '); + if (!p) + continue; + *p++ = 0; + if (strncmp(p, "is not set", 10)) + continue; + if (def == S_DEF_USER) { + sym = sym_find(line + 2 + strlen(CONFIG_)); + if (!sym) { + sym_add_change_count(1); + goto setsym; + } + } else { + sym = sym_lookup(line + 2 + strlen(CONFIG_), 0); + if (sym->type == S_UNKNOWN) + sym->type = S_BOOLEAN; + } + if (sym->flags & def_flags) { + conf_warning("override: reassigning to symbol %s", sym->name); + } + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + sym->def[def].tri = no; + sym->flags |= def_flags; + break; + default: + ; + } + } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) { + p = strchr(line + strlen(CONFIG_), '='); + if (!p) + continue; + *p++ = 0; + p2 = strchr(p, '\n'); + if (p2) { + *p2-- = 0; + if (*p2 == '\r') + *p2 = 0; + } + if (def == S_DEF_USER) { + sym = sym_find(line + strlen(CONFIG_)); + if (!sym) { + sym_add_change_count(1); + goto setsym; + } + } else { + sym = sym_lookup(line + strlen(CONFIG_), 0); + if (sym->type == S_UNKNOWN) + sym->type = S_OTHER; + } + if (sym->flags & def_flags) { + conf_warning("override: reassigning to symbol %s", sym->name); + } + if (conf_set_sym_val(sym, def, def_flags, p)) + continue; + } else { + if (line[0] != '\r' && line[0] != '\n') + conf_warning("unexpected data"); + continue; + } +setsym: + if (sym && sym_is_choice_value(sym)) { + struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); + switch (sym->def[def].tri) { + case no: + break; + case mod: + if (cs->def[def].tri == yes) { + conf_warning("%s creates inconsistent choice state", sym->name); + cs->flags &= ~def_flags; + } + break; + case yes: + if (cs->def[def].tri != no) + conf_warning("override: %s changes choice state", sym->name); + cs->def[def].val = sym; + break; + } + cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); + } + } + fclose(in); + + if (modules_sym) + sym_calc_value(modules_sym); + return 0; +} + +int conf_read(const char *name) +{ + struct symbol *sym, *choice_sym; + struct property *prop; + struct expr *e; + int i, flags; + + sym_set_change_count(0); + + if (conf_read_simple(name, S_DEF_USER)) + return 1; + + for_all_symbols(i, sym) { + sym_calc_value(sym); + if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) + goto sym_ok; + if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { + /* check that calculated value agrees with saved value */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) + break; + if (!sym_is_choice(sym)) + goto sym_ok; + default: + if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) + goto sym_ok; + break; + } + } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) + /* no previous value and not saved */ + goto sym_ok; + conf_unsaved++; + /* maybe print value in verbose mode... */ + sym_ok: + if (!sym_is_choice(sym)) + continue; + /* The choice symbol only has a set value (and thus is not new) + * if all its visible childs have values. + */ + prop = sym_get_choice_prop(sym); + flags = sym->flags; + expr_list_for_each_sym(prop->expr, e, choice_sym) + if (choice_sym->visible != no) + flags &= choice_sym->flags; + sym->flags &= flags | ~SYMBOL_DEF_USER; + } + + for_all_symbols(i, sym) { + if (sym_has_value(sym) && !sym_is_choice_value(sym)) { + /* Reset values of generates values, so they'll appear + * as new, if they should become visible, but that + * doesn't quite work if the Kconfig and the saved + * configuration disagree. + */ + if (sym->visible == no && !conf_unsaved) + sym->flags &= ~SYMBOL_DEF_USER; + switch (sym->type) { + case S_STRING: + case S_INT: + case S_HEX: + /* Reset a string value if it's out of range */ + if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) + break; + sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); + conf_unsaved++; + break; + default: + break; + } + } + } + + sym_add_change_count(conf_warnings || conf_unsaved); + + return 0; +} + +/* Write a S_STRING */ +static void conf_write_string(bool headerfile, const char *name, + const char *str, FILE *out) +{ + int l; + if (headerfile) + fprintf(out, "#define %s%s \"", CONFIG_, name); + else + fprintf(out, "%s%s=\"", CONFIG_, name); + + while (1) { + l = strcspn(str, "\"\\"); + if (l) { + xfwrite(str, l, 1, out); + str += l; + } + if (!*str) + break; + fprintf(out, "\\%c", *str++); + } + fputs("\"\n", out); +} + +static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no) +{ + const char *str; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (sym_get_tristate_value(sym)) { + case no: + if (write_no) + fprintf(out, "# %s%s is not set\n", + CONFIG_, sym->name); + break; + case mod: + fprintf(out, "%s%s=m\n", CONFIG_, sym->name); + break; + case yes: + fprintf(out, "%s%s=y\n", CONFIG_, sym->name); + break; + } + break; + case S_STRING: + conf_write_string(false, sym->name, sym_get_string_value(sym), out); + break; + case S_HEX: + case S_INT: + str = sym_get_string_value(sym); + fprintf(out, "%s%s=%s\n", CONFIG_, sym->name, str); + break; + case S_OTHER: + case S_UNKNOWN: + break; + } +} + +/* + * Write out a minimal config. + * All values that has default values are skipped as this is redundant. + */ +int conf_write_defconfig(const char *filename) +{ + struct symbol *sym; + struct menu *menu; + FILE *out; + + out = fopen(filename, "w"); + if (!out) + return 1; + + sym_clear_all_valid(); + + /* Traverse all menus to find all relevant symbols */ + menu = rootmenu.list; + + while (menu != NULL) + { + sym = menu->sym; + if (sym == NULL) { + if (!menu_is_visible(menu)) + goto next_menu; + } else if (!sym_is_choice(sym)) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE)) + goto next_menu; + sym->flags &= ~SYMBOL_WRITE; + /* If we cannot change the symbol - skip */ + if (!sym_is_changable(sym)) + goto next_menu; + /* If symbol equals to default value - skip */ + if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0) + goto next_menu; + + /* + * If symbol is a choice value and equals to the + * default for a choice - skip. + * But only if value is bool and equal to "y" and + * choice is not "optional". + * (If choice is "optional" then all values can be "n") + */ + if (sym_is_choice_value(sym)) { + struct symbol *cs; + struct symbol *ds; + + cs = prop_get_symbol(sym_get_choice_prop(sym)); + ds = sym_choice_default(cs); + if (!sym_is_optional(cs) && sym == ds) { + if ((sym->type == S_BOOLEAN) && + sym_get_tristate_value(sym) == yes) + goto next_menu; + } + } + conf_write_symbol(sym, out, true); + } +next_menu: + if (menu->list != NULL) { + menu = menu->list; + } + else if (menu->next != NULL) { + menu = menu->next; + } else { + while ((menu = menu->parent)) { + if (menu->next != NULL) { + menu = menu->next; + break; + } + } + } + } + fclose(out); + return 0; +} + +int conf_write(const char *name) +{ + FILE *out; + struct symbol *sym; + struct menu *menu; + const char *basename; + const char *str; + char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; + time_t now; + int use_timestamp = 1; + char *env; + + dirname[0] = 0; + if (name && name[0]) { + struct stat st; + char *slash; + + if (!stat(name, &st) && S_ISDIR(st.st_mode)) { + strcpy(dirname, name); + strcat(dirname, "/"); + basename = conf_get_configname(); + } else if ((slash = strrchr(name, '/'))) { + int size = slash - name + 1; + memcpy(dirname, name, size); + dirname[size] = 0; + if (slash[1]) + basename = slash + 1; + else + basename = conf_get_configname(); + } else + basename = name; + } else + basename = conf_get_configname(); + + sprintf(newname, "%s%s", dirname, basename); + env = getenv("KCONFIG_OVERWRITECONFIG"); + if (!env || !*env) { + sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); + out = fopen(tmpname, "w"); + } else { + *tmpname = 0; + out = fopen(newname, "w"); + } + if (!out) + return 1; + + time(&now); + env = getenv("KCONFIG_NOTIMESTAMP"); + if (env && *env) + use_timestamp = 0; + + fprintf(out, _("#\n" + "# Automatically generated make config: don't edit\n" + "# %s\n" + "%s%s" + "#\n"), + rootmenu.prompt->text, + use_timestamp ? "# " : "", + use_timestamp ? ctime(&now) : ""); + + if (!conf_get_changed()) + sym_clear_all_valid(); + + menu = rootmenu.list; + while (menu) { + sym = menu->sym; + if (!sym) { + if (!menu_is_visible(menu)) + goto next; + str = menu_get_prompt(menu); + fprintf(out, "\n" + "#\n" + "# %s\n" + "#\n", str); + } else if (!(sym->flags & SYMBOL_CHOICE)) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE)) + goto next; + sym->flags &= ~SYMBOL_WRITE; + /* Write config symbol to file */ + conf_write_symbol(sym, out, true); + } + +next: + if (menu->list) { + menu = menu->list; + continue; + } + if (menu->next) + menu = menu->next; + else while ((menu = menu->parent)) { + if (menu->next) { + menu = menu->next; + break; + } + } + } + fclose(out); + + if (*tmpname) { + strcat(dirname, basename); + strcat(dirname, ".old"); + rename(newname, dirname); + if (rename(tmpname, newname)) + return 1; + } + +// conf_message(_("configuration written to %s"), newname); + + sym_set_change_count(0); + + return 0; +} +#if 0 + +static int conf_split_config(void) +{ + const char *name; + char path[PATH_MAX+1]; + char *s, *d, c; + struct symbol *sym; + struct stat sb; + int res, i, fd; + + name = conf_get_autoconfig_name(); + conf_read_simple(name, S_DEF_AUTO); + + //if (chdir("include/config")) + // return 1; + + res = 0; + for_all_symbols(i, sym) { + sym_calc_value(sym); + if ((sym->flags & SYMBOL_AUTO) || !sym->name) + continue; + if (sym->flags & SYMBOL_WRITE) { + if (sym->flags & SYMBOL_DEF_AUTO) { + /* + * symbol has old and new value, + * so compare them... + */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_get_tristate_value(sym) == + sym->def[S_DEF_AUTO].tri) + continue; + break; + case S_STRING: + case S_HEX: + case S_INT: + if (!strcmp(sym_get_string_value(sym), + sym->def[S_DEF_AUTO].val)) + continue; + break; + default: + break; + } + } else { + /* + * If there is no old value, only 'no' (unset) + * is allowed as new value. + */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_get_tristate_value(sym) == no) + continue; + break; + default: + break; + } + } + } else if (!(sym->flags & SYMBOL_DEF_AUTO)) + /* There is neither an old nor a new value. */ + continue; + /* else + * There is an old value, but no new value ('no' (unset) + * isn't saved in auto.conf, so the old value is always + * different from 'no'). + */ + + /* Replace all '_' and append ".h" */ + s = sym->name; + d = path; + while ((c = *s++)) { + c = tolower(c); + *d++ = (c == '_') ? '/' : c; + } + strcpy(d, ".h"); + + /* Assume directory path already exists. */ + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == -1) { + if (errno != ENOENT) { + res = 1; + break; + } + /* + * Create directory components, + * unless they exist already. + */ + d = path; + while ((d = strchr(d, '/'))) { + *d = 0; + if (stat(path, &sb) && mkdir(path, 0755)) { + res = 1; + goto out; + } + *d++ = '/'; + } + /* Try it again. */ + fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd == -1) { + res = 1; + break; + } + } + close(fd); + } +out: + if (chdir("../..")) + return 1; + + return res; +} +#endif +int conf_write_autoconf(void) +{ + struct symbol *sym; + const char *str; + const char *name; + FILE *out, *out_h, *out_inc; + time_t now; + int i; + + sym_clear_all_valid(); + + /*if (conf_split_config()) + { + printf("ERR: conf_split_config"); + return 1; + }*/ + + out = fopen(".tmpconfig", "w"); + if (!out) + { + printf("ERR: .tmpconfig"); + return 1; + } + + out_h = fopen(".tmpconfig.h", "w"); + if (!out_h) { + fclose(out); + return 1; + } + + out_inc = fopen(".tmpconfig.inc", "w"); + if (!out_h) { + fclose(out); + fclose(out_h); + return 1; + } + + + time(&now); + fprintf(out, "#\n" + "# Automatically generated make config: don't edit\n" + "# %s\n" + "# %s" + "#\n", + rootmenu.prompt->text, ctime(&now)); + + fprintf(out_h, "//\n" + "// Automatically generated make config: don't edit\n" + "// %s\n" + "// %s" + "// \n", + rootmenu.prompt->text, ctime(&now)); + + fprintf(out_inc, ";\n" + "; Automatically generated make config: don't edit\n" + "; %s\n" + "; %s" + ";\n", + rootmenu.prompt->text, ctime(&now)); + + + fprintf(out_h, "#define CONFIG_IS_BUILTIN 1\n"); + fprintf(out_h, "#define CONFIG_IS_MODULE 2\n"); + + + for_all_symbols(i, sym) { + sym_calc_value(sym); + if (!(sym->flags & SYMBOL_WRITE) || !sym->name) + continue; + + /* write symbol to config file */ + conf_write_symbol(sym, out, false); + + /* update autoconf and tristate files */ + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (sym_get_tristate_value(sym)) { + case no: + fprintf(out_inc, "%s%s EQU 0\n", + CONFIG_, sym->name); + + break; + case mod: + fprintf(out_inc, "%s%s EQU 1\n", + CONFIG_, sym->name); + fprintf(out_h, "#define %s%s CONFIG_IS_MODULE\n", + CONFIG_, sym->name); + + break; + case yes: + fprintf(out_inc, "%s%s EQU 1\n", + CONFIG_, sym->name); + fprintf(out_h, "#define %s%s CONFIG_IS_BUILTIN\n", + CONFIG_, sym->name); + break; + } + break; + case S_STRING: + conf_write_string(true, sym->name, sym_get_string_value(sym), out_h); + break; + case S_HEX: + str = sym_get_string_value(sym); + if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { + fprintf(out_inc, "%s%s EQU 0x%s\n", + CONFIG_, sym->name, str); + fprintf(out_h, "#define %s%s 0x%s\n", + CONFIG_, sym->name, str); + break; + } + case S_INT: + str = sym_get_string_value(sym); + fprintf(out_inc, "%s%s EQU %s\n", + CONFIG_, sym->name, str); + fprintf(out_h, "#define %s%s %s\n", + CONFIG_, sym->name, str); + break; + default: + break; + } + } + fclose(out); + fclose(out_h); + + name = getenv("CCONFIG_AUTOHEADER"); + if (!name) name = "autoconf.h"; + if (rename(".tmpconfig.h", name)) + return 1; + + name = getenv("CCONFIG_AUTOINC"); + if (!name) name = "autoconf.inc"; + if (rename(".tmpconfig.inc", name)) + return 1; + + + name = conf_get_autoconfig_name(); + /* + * This must be the last step, kbuild has a dependency on auto.conf + * and this marks the successful completion of the previous steps. + */ + if (rename(".tmpconfig", name)) + { + printf("rename"); + return 1; + } + return 0; +} + +static int sym_change_count; +static void (*conf_changed_callback)(void); + +void sym_set_change_count(int count) +{ + int _sym_change_count = sym_change_count; + sym_change_count = count; + if (conf_changed_callback && + (bool)_sym_change_count != (bool)count) + conf_changed_callback(); +} + +void sym_add_change_count(int count) +{ + sym_set_change_count(count + sym_change_count); +} + +bool conf_get_changed(void) +{ + return sym_change_count; +} + +void conf_set_changed_callback(void (*fn)(void)) +{ + conf_changed_callback = fn; +} + +static void randomize_choice_values(struct symbol *csym) +{ + struct property *prop; + struct symbol *sym; + struct expr *e; + int cnt, def; + + /* + * If choice is mod then we may have more items selected + * and if no then no-one. + * In both cases stop. + */ + if (csym->curr.tri != yes) + return; + + prop = sym_get_choice_prop(csym); + + /* count entries in choice block */ + cnt = 0; + expr_list_for_each_sym(prop->expr, e, sym) + cnt++; + + /* + * find a random value and set it to yes, + * set the rest to no so we have only one set + */ + def = (rand() % cnt); + + cnt = 0; + expr_list_for_each_sym(prop->expr, e, sym) { + if (def == cnt++) { + sym->def[S_DEF_USER].tri = yes; + csym->def[S_DEF_USER].val = sym; + } + else { + sym->def[S_DEF_USER].tri = no; + } + } + csym->flags |= SYMBOL_DEF_USER; + /* clear VALID to get value calculated */ + csym->flags &= ~(SYMBOL_VALID); +} + +static void set_all_choice_values(struct symbol *csym) +{ + struct property *prop; + struct symbol *sym; + struct expr *e; + + prop = sym_get_choice_prop(csym); + + /* + * Set all non-assinged choice values to no + */ + expr_list_for_each_sym(prop->expr, e, sym) { + if (!sym_has_value(sym)) + sym->def[S_DEF_USER].tri = no; + } + csym->flags |= SYMBOL_DEF_USER; + /* clear VALID to get value calculated */ + csym->flags &= ~(SYMBOL_VALID); +} + +void conf_set_all_new_symbols(enum conf_def_mode mode) +{ + struct symbol *sym, *csym; + int i, cnt; + + for_all_symbols(i, sym) { + if (sym_has_value(sym)) + continue; + switch (sym_get_type(sym)) { + case S_BOOLEAN: + case S_TRISTATE: + switch (mode) { + case def_yes: + sym->def[S_DEF_USER].tri = yes; + break; + case def_mod: + sym->def[S_DEF_USER].tri = mod; + break; + case def_no: + sym->def[S_DEF_USER].tri = no; + break; + case def_random: + cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2; + sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt); + break; + default: + continue; + } + if (!(sym_is_choice(sym) && mode == def_random)) + sym->flags |= SYMBOL_DEF_USER; + break; + default: + break; + } + + } + + sym_clear_all_valid(); + + /* + * We have different type of choice blocks. + * If curr.tri equals to mod then we can select several + * choice symbols in one block. + * In this case we do nothing. + * If curr.tri equals yes then only one symbol can be + * selected in a choice block and we set it to yes, + * and the rest to no. + */ + for_all_symbols(i, csym) { + if (sym_has_value(csym) || !sym_is_choice(csym)) + continue; + + sym_calc_value(csym); + if (mode == def_random) + randomize_choice_values(csym); + else + set_all_choice_values(csym); + } +} diff --git a/i386/config/dialog.h b/i386/config/dialog.h new file mode 100644 index 0000000..b5211fc --- /dev/null +++ b/i386/config/dialog.h @@ -0,0 +1,230 @@ +/* + * dialog.h -- common declarations for all dialog modules + * + * AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef KBUILD_NO_NLS +# include +#else +# define gettext(Msgid) ((const char *) (Msgid)) +#endif + +#ifdef __sun__ +#define CURS_MACROS +#endif +#include CURSES_LOC + +/* + * Colors in ncurses 1.9.9e do not work properly since foreground and + * background colors are OR'd rather than separately masked. This version + * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible + * with standard curses. The simplest fix (to make this work with standard + * curses) uses the wbkgdset() function, not used in the original hack. + * Turn it off if we're building with 1.9.9e, since it just confuses things. + */ +#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE) +#define OLD_NCURSES 1 +#undef wbkgdset +#define wbkgdset(w,p) /*nothing */ +#else +#define OLD_NCURSES 0 +#endif + +#define TR(params) _tracef params + +#define KEY_ESC 27 +#define TAB 9 +#define MAX_LEN 2048 +#define BUF_SIZE (10*1024) +#define MIN(x,y) (x < y ? x : y) +#define MAX(x,y) (x > y ? x : y) + +#ifndef ACS_ULCORNER +#define ACS_ULCORNER '+' +#endif +#ifndef ACS_LLCORNER +#define ACS_LLCORNER '+' +#endif +#ifndef ACS_URCORNER +#define ACS_URCORNER '+' +#endif +#ifndef ACS_LRCORNER +#define ACS_LRCORNER '+' +#endif +#ifndef ACS_HLINE +#define ACS_HLINE '-' +#endif +#ifndef ACS_VLINE +#define ACS_VLINE '|' +#endif +#ifndef ACS_LTEE +#define ACS_LTEE '+' +#endif +#ifndef ACS_RTEE +#define ACS_RTEE '+' +#endif +#ifndef ACS_UARROW +#define ACS_UARROW '^' +#endif +#ifndef ACS_DARROW +#define ACS_DARROW 'v' +#endif + +/* error return codes */ +#define ERRDISPLAYTOOSMALL (KEY_MAX + 1) + +/* + * Color definitions + */ +struct dialog_color { + chtype atr; /* Color attribute */ + int fg; /* foreground */ + int bg; /* background */ + int hl; /* highlight this item */ +}; + +struct dialog_info { + const char *backtitle; + struct dialog_color screen; + struct dialog_color shadow; + struct dialog_color dialog; + struct dialog_color title; + struct dialog_color border; + struct dialog_color button_active; + struct dialog_color button_inactive; + struct dialog_color button_key_active; + struct dialog_color button_key_inactive; + struct dialog_color button_label_active; + struct dialog_color button_label_inactive; + struct dialog_color inputbox; + struct dialog_color inputbox_border; + struct dialog_color searchbox; + struct dialog_color searchbox_title; + struct dialog_color searchbox_border; + struct dialog_color position_indicator; + struct dialog_color menubox; + struct dialog_color menubox_border; + struct dialog_color item; + struct dialog_color item_selected; + struct dialog_color tag; + struct dialog_color tag_selected; + struct dialog_color tag_key; + struct dialog_color tag_key_selected; + struct dialog_color check; + struct dialog_color check_selected; + struct dialog_color uarrow; + struct dialog_color darrow; +}; + +/* + * Global variables + */ +extern struct dialog_info dlg; +extern char dialog_input_result[]; + +/* + * Function prototypes + */ + +/* item list as used by checklist and menubox */ +void item_reset(void); +void item_make(const char *fmt, ...); +void item_add_str(const char *fmt, ...); +void item_set_tag(char tag); +void item_set_data(void *p); +void item_set_selected(int val); +int item_activate_selected(void); +void *item_data(void); +char item_tag(void); + +/* item list manipulation for lxdialog use */ +#define MAXITEMSTR 200 +struct dialog_item { + char str[MAXITEMSTR]; /* promtp displayed */ + char tag; + void *data; /* pointer to menu item - used by menubox+checklist */ + int selected; /* Set to 1 by dialog_*() function if selected. */ +}; + +/* list of lialog_items */ +struct dialog_list { + struct dialog_item node; + struct dialog_list *next; +}; + +extern struct dialog_list *item_cur; +extern struct dialog_list item_nil; +extern struct dialog_list *item_head; + +int item_count(void); +void item_set(int n); +int item_n(void); +const char *item_str(void); +int item_is_selected(void); +int item_is_tag(char tag); +#define item_foreach() \ + for (item_cur = item_head ? item_head: item_cur; \ + item_cur && (item_cur != &item_nil); item_cur = item_cur->next) + +/* generic key handlers */ +int on_key_esc(WINDOW *win); +int on_key_resize(void); + +int init_dialog(const char *backtitle); +void set_dialog_backtitle(const char *backtitle); +void end_dialog(int x, int y); +void attr_clear(WINDOW * win, int height, int width, chtype attr); +void dialog_clear(void); +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x); +void print_button(WINDOW * win, const char *label, int y, int x, int selected); +void print_title(WINDOW *dialog, const char *title, int width); +void draw_box(WINDOW * win, int y, int x, int height, int width, chtype box, + chtype border); +void draw_shadow(WINDOW * win, int y, int x, int height, int width); + +int first_alpha(const char *string, const char *exempt); +int dialog_yesno(const char *title, const char *prompt, int height, int width); +int dialog_msgbox(const char *title, const char *prompt, int height, + int width, int pause); +int dialog_textbox(const char *title, const char *file, int height, int width); +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll); +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height); +extern char dialog_input_result[]; +int dialog_inputbox(const char *title, const char *prompt, int height, + int width, const char *init); + +/* + * This is the base for fictitious keys, which activate + * the buttons. + * + * Mouse-generated keys are the following: + * -- the first 32 are used as numbers, in addition to '0'-'9' + * -- the lowercase are used to signal mouse-enter events (M_EVENT + 'o') + * -- uppercase chars are used to invoke the button (M_EVENT + 'O') + */ +#define M_EVENT (KEY_MAX+1) diff --git a/i386/config/expr.c b/i386/config/expr.c new file mode 100644 index 0000000..0010034 --- /dev/null +++ b/i386/config/expr.c @@ -0,0 +1,1173 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#define DEBUG_EXPR 0 + +struct expr *expr_alloc_symbol(struct symbol *sym) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = E_SYMBOL; + e->left.sym = sym; + return e; +} + +struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = type; + e->left.expr = ce; + return e; +} + +struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = type; + e->left.expr = e1; + e->right.expr = e2; + return e; +} + +struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) +{ + struct expr *e = malloc(sizeof(*e)); + memset(e, 0, sizeof(*e)); + e->type = type; + e->left.sym = s1; + e->right.sym = s2; + return e; +} + +struct expr *expr_alloc_and(struct expr *e1, struct expr *e2) +{ + if (!e1) + return e2; + return e2 ? expr_alloc_two(E_AND, e1, e2) : e1; +} + +struct expr *expr_alloc_or(struct expr *e1, struct expr *e2) +{ + if (!e1) + return e2; + return e2 ? expr_alloc_two(E_OR, e1, e2) : e1; +} + +struct expr *expr_copy(const struct expr *org) +{ + struct expr *e; + + if (!org) + return NULL; + + e = malloc(sizeof(*org)); + memcpy(e, org, sizeof(*org)); + switch (org->type) { + case E_SYMBOL: + e->left = org->left; + break; + case E_NOT: + e->left.expr = expr_copy(org->left.expr); + break; + case E_EQUAL: + case E_UNEQUAL: + e->left.sym = org->left.sym; + e->right.sym = org->right.sym; + break; + case E_AND: + case E_OR: + case E_LIST: + e->left.expr = expr_copy(org->left.expr); + e->right.expr = expr_copy(org->right.expr); + break; + default: + printf("can't copy type %d\n", e->type); + free(e); + e = NULL; + break; + } + + return e; +} + +void expr_free(struct expr *e) +{ + if (!e) + return; + + switch (e->type) { + case E_SYMBOL: + break; + case E_NOT: + expr_free(e->left.expr); + return; + case E_EQUAL: + case E_UNEQUAL: + break; + case E_OR: + case E_AND: + expr_free(e->left.expr); + expr_free(e->right.expr); + break; + default: + printf("how to free type %d?\n", e->type); + break; + } + free(e); +} + +static int trans_count; + +#define e1 (*ep1) +#define e2 (*ep2) + +static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2) +{ + if (e1->type == type) { + __expr_eliminate_eq(type, &e1->left.expr, &e2); + __expr_eliminate_eq(type, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + __expr_eliminate_eq(type, &e1, &e2->left.expr); + __expr_eliminate_eq(type, &e1, &e2->right.expr); + return; + } + if (e1->type == E_SYMBOL && e2->type == E_SYMBOL && + e1->left.sym == e2->left.sym && + (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no)) + return; + if (!expr_eq(e1, e2)) + return; + trans_count++; + expr_free(e1); expr_free(e2); + switch (type) { + case E_OR: + e1 = expr_alloc_symbol(&symbol_no); + e2 = expr_alloc_symbol(&symbol_no); + break; + case E_AND: + e1 = expr_alloc_symbol(&symbol_yes); + e2 = expr_alloc_symbol(&symbol_yes); + break; + default: + ; + } +} + +void expr_eliminate_eq(struct expr **ep1, struct expr **ep2) +{ + if (!e1 || !e2) + return; + switch (e1->type) { + case E_OR: + case E_AND: + __expr_eliminate_eq(e1->type, ep1, ep2); + default: + ; + } + if (e1->type != e2->type) switch (e2->type) { + case E_OR: + case E_AND: + __expr_eliminate_eq(e2->type, ep1, ep2); + default: + ; + } + e1 = expr_eliminate_yn(e1); + e2 = expr_eliminate_yn(e2); +} + +#undef e1 +#undef e2 + +int expr_eq(struct expr *e1, struct expr *e2) +{ + int res, old_count; + + if (e1->type != e2->type) + return 0; + switch (e1->type) { + case E_EQUAL: + case E_UNEQUAL: + return e1->left.sym == e2->left.sym && e1->right.sym == e2->right.sym; + case E_SYMBOL: + return e1->left.sym == e2->left.sym; + case E_NOT: + return expr_eq(e1->left.expr, e2->left.expr); + case E_AND: + case E_OR: + e1 = expr_copy(e1); + e2 = expr_copy(e2); + old_count = trans_count; + expr_eliminate_eq(&e1, &e2); + res = (e1->type == E_SYMBOL && e2->type == E_SYMBOL && + e1->left.sym == e2->left.sym); + expr_free(e1); + expr_free(e2); + trans_count = old_count; + return res; + case E_LIST: + case E_RANGE: + case E_NONE: + /* panic */; + } + + if (DEBUG_EXPR) { + expr_fprint(e1, stdout); + printf(" = "); + expr_fprint(e2, stdout); + printf(" ?\n"); + } + + return 0; +} + +struct expr *expr_eliminate_yn(struct expr *e) +{ + struct expr *tmp; + + if (e) switch (e->type) { + case E_AND: + e->left.expr = expr_eliminate_yn(e->left.expr); + e->right.expr = expr_eliminate_yn(e->right.expr); + if (e->left.expr->type == E_SYMBOL) { + if (e->left.expr->left.sym == &symbol_no) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + e->right.expr = NULL; + return e; + } else if (e->left.expr->left.sym == &symbol_yes) { + free(e->left.expr); + tmp = e->right.expr; + *e = *(e->right.expr); + free(tmp); + return e; + } + } + if (e->right.expr->type == E_SYMBOL) { + if (e->right.expr->left.sym == &symbol_no) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + e->right.expr = NULL; + return e; + } else if (e->right.expr->left.sym == &symbol_yes) { + free(e->right.expr); + tmp = e->left.expr; + *e = *(e->left.expr); + free(tmp); + return e; + } + } + break; + case E_OR: + e->left.expr = expr_eliminate_yn(e->left.expr); + e->right.expr = expr_eliminate_yn(e->right.expr); + if (e->left.expr->type == E_SYMBOL) { + if (e->left.expr->left.sym == &symbol_no) { + free(e->left.expr); + tmp = e->right.expr; + *e = *(e->right.expr); + free(tmp); + return e; + } else if (e->left.expr->left.sym == &symbol_yes) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + e->right.expr = NULL; + return e; + } + } + if (e->right.expr->type == E_SYMBOL) { + if (e->right.expr->left.sym == &symbol_no) { + free(e->right.expr); + tmp = e->left.expr; + *e = *(e->left.expr); + free(tmp); + return e; + } else if (e->right.expr->left.sym == &symbol_yes) { + expr_free(e->left.expr); + expr_free(e->right.expr); + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + e->right.expr = NULL; + return e; + } + } + break; + default: + ; + } + return e; +} + +/* + * bool FOO!=n => FOO + */ +struct expr *expr_trans_bool(struct expr *e) +{ + if (!e) + return NULL; + switch (e->type) { + case E_AND: + case E_OR: + case E_NOT: + e->left.expr = expr_trans_bool(e->left.expr); + e->right.expr = expr_trans_bool(e->right.expr); + break; + case E_UNEQUAL: + // FOO!=n -> FOO + if (e->left.sym->type == S_TRISTATE) { + if (e->right.sym == &symbol_no) { + e->type = E_SYMBOL; + e->right.sym = NULL; + } + } + break; + default: + ; + } + return e; +} + +/* + * e1 || e2 -> ? + */ +static struct expr *expr_join_or(struct expr *e1, struct expr *e2) +{ + struct expr *tmp; + struct symbol *sym1, *sym2; + + if (expr_eq(e1, e2)) + return expr_copy(e1); + if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT) + return NULL; + if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT) + return NULL; + if (e1->type == E_NOT) { + tmp = e1->left.expr; + if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL) + return NULL; + sym1 = tmp->left.sym; + } else + sym1 = e1->left.sym; + if (e2->type == E_NOT) { + if (e2->left.expr->type != E_SYMBOL) + return NULL; + sym2 = e2->left.expr->left.sym; + } else + sym2 = e2->left.sym; + if (sym1 != sym2) + return NULL; + if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE) + return NULL; + if (sym1->type == S_TRISTATE) { + if (e1->type == E_EQUAL && e2->type == E_EQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || + (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) { + // (a='y') || (a='m') -> (a!='n') + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no); + } + if (e1->type == E_EQUAL && e2->type == E_EQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) { + // (a='y') || (a='n') -> (a!='m') + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod); + } + if (e1->type == E_EQUAL && e2->type == E_EQUAL && + ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) { + // (a='m') || (a='n') -> (a!='y') + return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes); + } + } + if (sym1->type == S_BOOLEAN && sym1 == sym2) { + if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) || + (e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL)) + return expr_alloc_symbol(&symbol_yes); + } + + if (DEBUG_EXPR) { + printf("optimize ("); + expr_fprint(e1, stdout); + printf(") || ("); + expr_fprint(e2, stdout); + printf(")?\n"); + } + return NULL; +} + +static struct expr *expr_join_and(struct expr *e1, struct expr *e2) +{ + struct expr *tmp; + struct symbol *sym1, *sym2; + + if (expr_eq(e1, e2)) + return expr_copy(e1); + if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT) + return NULL; + if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT) + return NULL; + if (e1->type == E_NOT) { + tmp = e1->left.expr; + if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL) + return NULL; + sym1 = tmp->left.sym; + } else + sym1 = e1->left.sym; + if (e2->type == E_NOT) { + if (e2->left.expr->type != E_SYMBOL) + return NULL; + sym2 = e2->left.expr->left.sym; + } else + sym2 = e2->left.sym; + if (sym1 != sym2) + return NULL; + if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE) + return NULL; + + if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) || + (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes)) + // (a) && (a='y') -> (a='y') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); + + if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) || + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no)) + // (a) && (a!='n') -> (a) + return expr_alloc_symbol(sym1); + + if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_mod) || + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_mod)) + // (a) && (a!='m') -> (a='y') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); + + if (sym1->type == S_TRISTATE) { + if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) { + // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' + sym2 = e1->right.sym; + if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) + return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) + : expr_alloc_symbol(&symbol_no); + } + if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) { + // (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b' + sym2 = e2->right.sym; + if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST)) + return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2) + : expr_alloc_symbol(&symbol_no); + } + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) + // (a!='y') && (a!='n') -> (a='m') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_mod); + + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && + ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) || + (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) + // (a!='y') && (a!='m') -> (a='n') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_no); + + if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL && + ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) || + (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) + // (a!='m') && (a!='n') -> (a='m') + return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes); + + if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) || + (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) || + (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) || + (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes)) + return NULL; + } + + if (DEBUG_EXPR) { + printf("optimize ("); + expr_fprint(e1, stdout); + printf(") && ("); + expr_fprint(e2, stdout); + printf(")?\n"); + } + return NULL; +} + +static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2) +{ +#define e1 (*ep1) +#define e2 (*ep2) + struct expr *tmp; + + if (e1->type == type) { + expr_eliminate_dups1(type, &e1->left.expr, &e2); + expr_eliminate_dups1(type, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + expr_eliminate_dups1(type, &e1, &e2->left.expr); + expr_eliminate_dups1(type, &e1, &e2->right.expr); + return; + } + if (e1 == e2) + return; + + switch (e1->type) { + case E_OR: case E_AND: + expr_eliminate_dups1(e1->type, &e1, &e1); + default: + ; + } + + switch (type) { + case E_OR: + tmp = expr_join_or(e1, e2); + if (tmp) { + expr_free(e1); expr_free(e2); + e1 = expr_alloc_symbol(&symbol_no); + e2 = tmp; + trans_count++; + } + break; + case E_AND: + tmp = expr_join_and(e1, e2); + if (tmp) { + expr_free(e1); expr_free(e2); + e1 = expr_alloc_symbol(&symbol_yes); + e2 = tmp; + trans_count++; + } + break; + default: + ; + } +#undef e1 +#undef e2 +} + +static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct expr **ep2) +{ +#define e1 (*ep1) +#define e2 (*ep2) + struct expr *tmp, *tmp1, *tmp2; + + if (e1->type == type) { + expr_eliminate_dups2(type, &e1->left.expr, &e2); + expr_eliminate_dups2(type, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + expr_eliminate_dups2(type, &e1, &e2->left.expr); + expr_eliminate_dups2(type, &e1, &e2->right.expr); + } + if (e1 == e2) + return; + + switch (e1->type) { + case E_OR: + expr_eliminate_dups2(e1->type, &e1, &e1); + // (FOO || BAR) && (!FOO && !BAR) -> n + tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1))); + tmp2 = expr_copy(e2); + tmp = expr_extract_eq_and(&tmp1, &tmp2); + if (expr_is_yes(tmp1)) { + expr_free(e1); + e1 = expr_alloc_symbol(&symbol_no); + trans_count++; + } + expr_free(tmp2); + expr_free(tmp1); + expr_free(tmp); + break; + case E_AND: + expr_eliminate_dups2(e1->type, &e1, &e1); + // (FOO && BAR) || (!FOO || !BAR) -> y + tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1))); + tmp2 = expr_copy(e2); + tmp = expr_extract_eq_or(&tmp1, &tmp2); + if (expr_is_no(tmp1)) { + expr_free(e1); + e1 = expr_alloc_symbol(&symbol_yes); + trans_count++; + } + expr_free(tmp2); + expr_free(tmp1); + expr_free(tmp); + break; + default: + ; + } +#undef e1 +#undef e2 +} + +struct expr *expr_eliminate_dups(struct expr *e) +{ + int oldcount; + if (!e) + return e; + + oldcount = trans_count; + while (1) { + trans_count = 0; + switch (e->type) { + case E_OR: case E_AND: + expr_eliminate_dups1(e->type, &e, &e); + expr_eliminate_dups2(e->type, &e, &e); + default: + ; + } + if (!trans_count) + break; + e = expr_eliminate_yn(e); + } + trans_count = oldcount; + return e; +} + +struct expr *expr_transform(struct expr *e) +{ + struct expr *tmp; + + if (!e) + return NULL; + switch (e->type) { + case E_EQUAL: + case E_UNEQUAL: + case E_SYMBOL: + case E_LIST: + break; + default: + e->left.expr = expr_transform(e->left.expr); + e->right.expr = expr_transform(e->right.expr); + } + + switch (e->type) { + case E_EQUAL: + if (e->left.sym->type != S_BOOLEAN) + break; + if (e->right.sym == &symbol_no) { + e->type = E_NOT; + e->left.expr = expr_alloc_symbol(e->left.sym); + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_mod) { + printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name); + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_yes) { + e->type = E_SYMBOL; + e->right.sym = NULL; + break; + } + break; + case E_UNEQUAL: + if (e->left.sym->type != S_BOOLEAN) + break; + if (e->right.sym == &symbol_no) { + e->type = E_SYMBOL; + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_mod) { + printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name); + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + e->right.sym = NULL; + break; + } + if (e->right.sym == &symbol_yes) { + e->type = E_NOT; + e->left.expr = expr_alloc_symbol(e->left.sym); + e->right.sym = NULL; + break; + } + break; + case E_NOT: + switch (e->left.expr->type) { + case E_NOT: + // !!a -> a + tmp = e->left.expr->left.expr; + free(e->left.expr); + free(e); + e = tmp; + e = expr_transform(e); + break; + case E_EQUAL: + case E_UNEQUAL: + // !a='x' -> a!='x' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL; + break; + case E_OR: + // !(a || b) -> !a && !b + tmp = e->left.expr; + e->type = E_AND; + e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr); + tmp->type = E_NOT; + tmp->right.expr = NULL; + e = expr_transform(e); + break; + case E_AND: + // !(a && b) -> !a || !b + tmp = e->left.expr; + e->type = E_OR; + e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr); + tmp->type = E_NOT; + tmp->right.expr = NULL; + e = expr_transform(e); + break; + case E_SYMBOL: + if (e->left.expr->left.sym == &symbol_yes) { + // !'y' -> 'n' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = E_SYMBOL; + e->left.sym = &symbol_no; + break; + } + if (e->left.expr->left.sym == &symbol_mod) { + // !'m' -> 'm' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = E_SYMBOL; + e->left.sym = &symbol_mod; + break; + } + if (e->left.expr->left.sym == &symbol_no) { + // !'n' -> 'y' + tmp = e->left.expr; + free(e); + e = tmp; + e->type = E_SYMBOL; + e->left.sym = &symbol_yes; + break; + } + break; + default: + ; + } + break; + default: + ; + } + return e; +} + +int expr_contains_symbol(struct expr *dep, struct symbol *sym) +{ + if (!dep) + return 0; + + switch (dep->type) { + case E_AND: + case E_OR: + return expr_contains_symbol(dep->left.expr, sym) || + expr_contains_symbol(dep->right.expr, sym); + case E_SYMBOL: + return dep->left.sym == sym; + case E_EQUAL: + case E_UNEQUAL: + return dep->left.sym == sym || + dep->right.sym == sym; + case E_NOT: + return expr_contains_symbol(dep->left.expr, sym); + default: + ; + } + return 0; +} + +bool expr_depends_symbol(struct expr *dep, struct symbol *sym) +{ + if (!dep) + return false; + + switch (dep->type) { + case E_AND: + return expr_depends_symbol(dep->left.expr, sym) || + expr_depends_symbol(dep->right.expr, sym); + case E_SYMBOL: + return dep->left.sym == sym; + case E_EQUAL: + if (dep->left.sym == sym) { + if (dep->right.sym == &symbol_yes || dep->right.sym == &symbol_mod) + return true; + } + break; + case E_UNEQUAL: + if (dep->left.sym == sym) { + if (dep->right.sym == &symbol_no) + return true; + } + break; + default: + ; + } + return false; +} + +struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2) +{ + struct expr *tmp = NULL; + expr_extract_eq(E_AND, &tmp, ep1, ep2); + if (tmp) { + *ep1 = expr_eliminate_yn(*ep1); + *ep2 = expr_eliminate_yn(*ep2); + } + return tmp; +} + +struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2) +{ + struct expr *tmp = NULL; + expr_extract_eq(E_OR, &tmp, ep1, ep2); + if (tmp) { + *ep1 = expr_eliminate_yn(*ep1); + *ep2 = expr_eliminate_yn(*ep2); + } + return tmp; +} + +void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2) +{ +#define e1 (*ep1) +#define e2 (*ep2) + if (e1->type == type) { + expr_extract_eq(type, ep, &e1->left.expr, &e2); + expr_extract_eq(type, ep, &e1->right.expr, &e2); + return; + } + if (e2->type == type) { + expr_extract_eq(type, ep, ep1, &e2->left.expr); + expr_extract_eq(type, ep, ep1, &e2->right.expr); + return; + } + if (expr_eq(e1, e2)) { + *ep = *ep ? expr_alloc_two(type, *ep, e1) : e1; + expr_free(e2); + if (type == E_AND) { + e1 = expr_alloc_symbol(&symbol_yes); + e2 = expr_alloc_symbol(&symbol_yes); + } else if (type == E_OR) { + e1 = expr_alloc_symbol(&symbol_no); + e2 = expr_alloc_symbol(&symbol_no); + } + } +#undef e1 +#undef e2 +} + +struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym) +{ + struct expr *e1, *e2; + + if (!e) { + e = expr_alloc_symbol(sym); + if (type == E_UNEQUAL) + e = expr_alloc_one(E_NOT, e); + return e; + } + switch (e->type) { + case E_AND: + e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); + e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); + if (sym == &symbol_yes) + e = expr_alloc_two(E_AND, e1, e2); + if (sym == &symbol_no) + e = expr_alloc_two(E_OR, e1, e2); + if (type == E_UNEQUAL) + e = expr_alloc_one(E_NOT, e); + return e; + case E_OR: + e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym); + e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym); + if (sym == &symbol_yes) + e = expr_alloc_two(E_OR, e1, e2); + if (sym == &symbol_no) + e = expr_alloc_two(E_AND, e1, e2); + if (type == E_UNEQUAL) + e = expr_alloc_one(E_NOT, e); + return e; + case E_NOT: + return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym); + case E_UNEQUAL: + case E_EQUAL: + if (type == E_EQUAL) { + if (sym == &symbol_yes) + return expr_copy(e); + if (sym == &symbol_mod) + return expr_alloc_symbol(&symbol_no); + if (sym == &symbol_no) + return expr_alloc_one(E_NOT, expr_copy(e)); + } else { + if (sym == &symbol_yes) + return expr_alloc_one(E_NOT, expr_copy(e)); + if (sym == &symbol_mod) + return expr_alloc_symbol(&symbol_yes); + if (sym == &symbol_no) + return expr_copy(e); + } + break; + case E_SYMBOL: + return expr_alloc_comp(type, e->left.sym, sym); + case E_LIST: + case E_RANGE: + case E_NONE: + /* panic */; + } + return NULL; +} + +tristate expr_calc_value(struct expr *e) +{ + tristate val1, val2; + const char *str1, *str2; + + if (!e) + return yes; + + switch (e->type) { + case E_SYMBOL: + sym_calc_value(e->left.sym); + return e->left.sym->curr.tri; + case E_AND: + val1 = expr_calc_value(e->left.expr); + val2 = expr_calc_value(e->right.expr); + return EXPR_AND(val1, val2); + case E_OR: + val1 = expr_calc_value(e->left.expr); + val2 = expr_calc_value(e->right.expr); + return EXPR_OR(val1, val2); + case E_NOT: + val1 = expr_calc_value(e->left.expr); + return EXPR_NOT(val1); + case E_EQUAL: + sym_calc_value(e->left.sym); + sym_calc_value(e->right.sym); + str1 = sym_get_string_value(e->left.sym); + str2 = sym_get_string_value(e->right.sym); + return !strcmp(str1, str2) ? yes : no; + case E_UNEQUAL: + sym_calc_value(e->left.sym); + sym_calc_value(e->right.sym); + str1 = sym_get_string_value(e->left.sym); + str2 = sym_get_string_value(e->right.sym); + return !strcmp(str1, str2) ? no : yes; + default: + printf("expr_calc_value: %d?\n", e->type); + return no; + } +} + +int expr_compare_type(enum expr_type t1, enum expr_type t2) +{ +#if 0 + return 1; +#else + if (t1 == t2) + return 0; + switch (t1) { + case E_EQUAL: + case E_UNEQUAL: + if (t2 == E_NOT) + return 1; + case E_NOT: + if (t2 == E_AND) + return 1; + case E_AND: + if (t2 == E_OR) + return 1; + case E_OR: + if (t2 == E_LIST) + return 1; + case E_LIST: + if (t2 == 0) + return 1; + default: + return -1; + } + printf("[%dgt%d?]", t1, t2); + return 0; +#endif +} + +static inline struct expr * +expr_get_leftmost_symbol(const struct expr *e) +{ + + if (e == NULL) + return NULL; + + while (e->type != E_SYMBOL) + e = e->left.expr; + + return expr_copy(e); +} + +/* + * Given expression `e1' and `e2', returns the leaf of the longest + * sub-expression of `e1' not containing 'e2. + */ +struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2) +{ + struct expr *ret; + + switch (e1->type) { + case E_OR: + return expr_alloc_and( + expr_simplify_unmet_dep(e1->left.expr, e2), + expr_simplify_unmet_dep(e1->right.expr, e2)); + case E_AND: { + struct expr *e; + e = expr_alloc_and(expr_copy(e1), expr_copy(e2)); + e = expr_eliminate_dups(e); + ret = (!expr_eq(e, e1)) ? e1 : NULL; + expr_free(e); + break; + } + default: + ret = e1; + break; + } + + return expr_get_leftmost_symbol(ret); +} + +void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken) +{ + if (!e) { + fn(data, NULL, "y"); + return; + } + + if (expr_compare_type(prevtoken, e->type) > 0) + fn(data, NULL, "("); + switch (e->type) { + case E_SYMBOL: + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + break; + case E_NOT: + fn(data, NULL, "!"); + expr_print(e->left.expr, fn, data, E_NOT); + break; + case E_EQUAL: + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + fn(data, NULL, "="); + fn(data, e->right.sym, e->right.sym->name); + break; + case E_UNEQUAL: + if (e->left.sym->name) + fn(data, e->left.sym, e->left.sym->name); + else + fn(data, NULL, ""); + fn(data, NULL, "!="); + fn(data, e->right.sym, e->right.sym->name); + break; + case E_OR: + expr_print(e->left.expr, fn, data, E_OR); + fn(data, NULL, " || "); + expr_print(e->right.expr, fn, data, E_OR); + break; + case E_AND: + expr_print(e->left.expr, fn, data, E_AND); + fn(data, NULL, " && "); + expr_print(e->right.expr, fn, data, E_AND); + break; + case E_LIST: + fn(data, e->right.sym, e->right.sym->name); + if (e->left.expr) { + fn(data, NULL, " ^ "); + expr_print(e->left.expr, fn, data, E_LIST); + } + break; + case E_RANGE: + fn(data, NULL, "["); + fn(data, e->left.sym, e->left.sym->name); + fn(data, NULL, " "); + fn(data, e->right.sym, e->right.sym->name); + fn(data, NULL, "]"); + break; + default: + { + char buf[32]; + sprintf(buf, "", e->type); + fn(data, NULL, buf); + break; + } + } + if (expr_compare_type(prevtoken, e->type) > 0) + fn(data, NULL, ")"); +} + +static void expr_print_file_helper(void *data, struct symbol *sym, const char *str) +{ + xfwrite(str, strlen(str), 1, data); +} + +void expr_fprint(struct expr *e, FILE *out) +{ + expr_print(e, expr_print_file_helper, out, E_NONE); +} + +static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) +{ + struct gstr *gs = (struct gstr*)data; + const char *sym_str = NULL; + + if (sym) + sym_str = sym_get_string_value(sym); + + if (gs->max_width) { + unsigned extra_length = strlen(str); + const char *last_cr = strrchr(gs->s, '\n'); + unsigned last_line_length; + + if (sym_str) + extra_length += 4 + strlen(sym_str); + + if (!last_cr) + last_cr = gs->s; + + last_line_length = strlen(gs->s) - (last_cr - gs->s); + + if ((last_line_length + extra_length) > gs->max_width) + str_append(gs, "\\\n"); + } + + str_append(gs, str); + if (sym && sym->type != S_UNKNOWN) + str_printf(gs, " [=%s]", sym_str); +} + +void expr_gstr_print(struct expr *e, struct gstr *gs) +{ + expr_print(e, expr_print_gstr_helper, gs, E_NONE); +} diff --git a/i386/config/expr.h b/i386/config/expr.h new file mode 100644 index 0000000..3d238db --- /dev/null +++ b/i386/config/expr.h @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#ifndef EXPR_H +#define EXPR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#ifndef __cplusplus +#include +#endif + +struct file { + struct file *next; + struct file *parent; + const char *name; + int lineno; + int flags; +}; + +#define FILE_BUSY 0x0001 +#define FILE_SCANNED 0x0002 + +typedef enum tristate { + no, mod, yes +} tristate; + +enum expr_type { + E_NONE, E_OR, E_AND, E_NOT, E_EQUAL, E_UNEQUAL, E_LIST, E_SYMBOL, E_RANGE +}; + +union expr_data { + struct expr *expr; + struct symbol *sym; +}; + +struct expr { + enum expr_type type; + union expr_data left, right; +}; + +#define EXPR_OR(dep1, dep2) (((dep1)>(dep2))?(dep1):(dep2)) +#define EXPR_AND(dep1, dep2) (((dep1)<(dep2))?(dep1):(dep2)) +#define EXPR_NOT(dep) (2-(dep)) + +#define expr_list_for_each_sym(l, e, s) \ + for (e = (l); e && (s = e->right.sym); e = e->left.expr) + +struct expr_value { + struct expr *expr; + tristate tri; +}; + +struct symbol_value { + void *val; + tristate tri; +}; + +enum symbol_type { + S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT, S_HEX, S_STRING, S_OTHER +}; + +/* enum values are used as index to symbol.def[] */ +enum { + S_DEF_USER, /* main user value */ + S_DEF_AUTO, /* values read from auto.conf */ + S_DEF_DEF3, /* Reserved for UI usage */ + S_DEF_DEF4, /* Reserved for UI usage */ + S_DEF_COUNT +}; + +struct symbol { + struct symbol *next; + char *name; + enum symbol_type type; + struct symbol_value curr; + struct symbol_value def[S_DEF_COUNT]; + tristate visible; + int flags; + struct property *prop; + struct expr_value dir_dep; + struct expr_value rev_dep; +}; + +#define for_all_symbols(i, sym) for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER) + +#define SYMBOL_CONST 0x0001 /* symbol is const */ +#define SYMBOL_CHECK 0x0008 /* used during dependency checking */ +#define SYMBOL_CHOICE 0x0010 /* start of a choice block (null name) */ +#define SYMBOL_CHOICEVAL 0x0020 /* used as a value in a choice block */ +#define SYMBOL_VALID 0x0080 /* set when symbol.curr is calculated */ +#define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ +#define SYMBOL_WRITE 0x0200 /* ? */ +#define SYMBOL_CHANGED 0x0400 /* ? */ +#define SYMBOL_AUTO 0x1000 /* value from environment variable */ +#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ +#define SYMBOL_WARNED 0x8000 /* warning has been issued */ + +/* Set when symbol.def[] is used */ +#define SYMBOL_DEF 0x10000 /* First bit of SYMBOL_DEF */ +#define SYMBOL_DEF_USER 0x10000 /* symbol.def[S_DEF_USER] is valid */ +#define SYMBOL_DEF_AUTO 0x20000 /* symbol.def[S_DEF_AUTO] is valid */ +#define SYMBOL_DEF3 0x40000 /* symbol.def[S_DEF_3] is valid */ +#define SYMBOL_DEF4 0x80000 /* symbol.def[S_DEF_4] is valid */ + +#define SYMBOL_MAXLENGTH 256 +#define SYMBOL_HASHSIZE 9973 + +/* A property represent the config options that can be associated + * with a config "symbol". + * Sample: + * config FOO + * default y + * prompt "foo prompt" + * select BAR + * config BAZ + * int "BAZ Value" + * range 1..255 + */ +enum prop_type { + P_UNKNOWN, + P_PROMPT, /* prompt "foo prompt" or "BAZ Value" */ + P_COMMENT, /* text associated with a comment */ + P_MENU, /* prompt associated with a menuconfig option */ + P_DEFAULT, /* default y */ + P_CHOICE, /* choice value */ + P_SELECT, /* select BAR */ + P_RANGE, /* range 7..100 (for a symbol) */ + P_ENV, /* value from environment variable */ + P_SYMBOL, /* where a symbol is defined */ +}; + +struct property { + struct property *next; /* next property - null if last */ + struct symbol *sym; /* the symbol for which the property is associated */ + enum prop_type type; /* type of property */ + const char *text; /* the prompt value - P_PROMPT, P_MENU, P_COMMENT */ + struct expr_value visible; + struct expr *expr; /* the optional conditional part of the property */ + struct menu *menu; /* the menu the property are associated with + * valid for: P_SELECT, P_RANGE, P_CHOICE, + * P_PROMPT, P_DEFAULT, P_MENU, P_COMMENT */ + struct file *file; /* what file was this property defined */ + int lineno; /* what lineno was this property defined */ +}; + +#define for_all_properties(sym, st, tok) \ + for (st = sym->prop; st; st = st->next) \ + if (st->type == (tok)) +#define for_all_defaults(sym, st) for_all_properties(sym, st, P_DEFAULT) +#define for_all_choices(sym, st) for_all_properties(sym, st, P_CHOICE) +#define for_all_prompts(sym, st) \ + for (st = sym->prop; st; st = st->next) \ + if (st->text) + +struct menu { + struct menu *next; + struct menu *parent; + struct menu *list; + struct symbol *sym; + struct property *prompt; + struct expr *visibility; + struct expr *dep; + unsigned int flags; + char *help; + struct file *file; + int lineno; + void *data; +}; + +#define MENU_CHANGED 0x0001 +#define MENU_ROOT 0x0002 + +#ifndef SWIG + +extern struct file *file_list; +extern struct file *current_file; +struct file *lookup_file(const char *name); + +extern struct symbol symbol_yes, symbol_no, symbol_mod; +extern struct symbol *modules_sym; +extern struct symbol *sym_defconfig_list; +extern int cdebug; +struct expr *expr_alloc_symbol(struct symbol *sym); +struct expr *expr_alloc_one(enum expr_type type, struct expr *ce); +struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2); +struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2); +struct expr *expr_alloc_and(struct expr *e1, struct expr *e2); +struct expr *expr_alloc_or(struct expr *e1, struct expr *e2); +struct expr *expr_copy(const struct expr *org); +void expr_free(struct expr *e); +int expr_eq(struct expr *e1, struct expr *e2); +void expr_eliminate_eq(struct expr **ep1, struct expr **ep2); +tristate expr_calc_value(struct expr *e); +struct expr *expr_eliminate_yn(struct expr *e); +struct expr *expr_trans_bool(struct expr *e); +struct expr *expr_eliminate_dups(struct expr *e); +struct expr *expr_transform(struct expr *e); +int expr_contains_symbol(struct expr *dep, struct symbol *sym); +bool expr_depends_symbol(struct expr *dep, struct symbol *sym); +struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2); +struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2); +void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2); +struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym); +struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2); + +void expr_fprint(struct expr *e, FILE *out); +struct gstr; /* forward */ +void expr_gstr_print(struct expr *e, struct gstr *gs); + +static inline int expr_is_yes(struct expr *e) +{ + return !e || (e->type == E_SYMBOL && e->left.sym == &symbol_yes); +} + +static inline int expr_is_no(struct expr *e) +{ + return e && (e->type == E_SYMBOL && e->left.sym == &symbol_no); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* EXPR_H */ diff --git a/i386/config/inputbox.c b/i386/config/inputbox.c new file mode 100644 index 0000000..dd8e587 --- /dev/null +++ b/i386/config/inputbox.c @@ -0,0 +1,238 @@ +/* + * inputbox.c -- implements the input box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +char dialog_input_result[MAX_LEN + 1]; + +/* + * Print the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext(" Ok "), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box for inputing a string + */ +int dialog_inputbox(const char *title, const char *prompt, int height, int width, + const char *init) +{ + int i, x, y, box_y, box_x, box_width; + int input_x = 0, scroll = 0, key = 0, button = -1; + char *instr = dialog_input_result; + WINDOW *dialog; + + if (!init) + instr[0] = '\0'; + else + strcpy(instr, init); + +do_resize: + if (getmaxy(stdscr) <= (height - 2)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) <= (width - 2)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + /* Draw the input field box */ + box_width = width - 6; + getyx(dialog, y, x); + box_y = y + 2; + box_x = (width - box_width) / 2; + draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, + dlg.dialog.atr, dlg.border.atr); + + print_buttons(dialog, height, width, 0); + + /* Set up the initial value */ + wmove(dialog, box_y, box_x); + wattrset(dialog, dlg.inputbox.atr); + + input_x = strlen(instr); + + if (input_x >= box_width) { + scroll = input_x - box_width + 1; + input_x = box_width - 1; + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr[scroll + i]); + } else { + waddstr(dialog, instr); + } + + wmove(dialog, box_y, box_x + input_x); + + wrefresh(dialog); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + if (button == -1) { /* Input box selected */ + switch (key) { + case TAB: + case KEY_UP: + case KEY_DOWN: + break; + case KEY_LEFT: + continue; + case KEY_RIGHT: + continue; + case KEY_BACKSPACE: + case 127: + if (input_x || scroll) { + wattrset(dialog, dlg.inputbox.atr); + if (!input_x) { + scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, + instr[scroll + input_x + i] ? + instr[scroll + input_x + i] : ' '); + input_x = strlen(instr) - scroll; + } else + input_x--; + instr[scroll + input_x] = '\0'; + mvwaddch(dialog, box_y, input_x + box_x, ' '); + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + continue; + default: + if (key < 0x100 && isprint(key)) { + if (scroll + input_x < MAX_LEN) { + wattrset(dialog, dlg.inputbox.atr); + instr[scroll + input_x] = key; + instr[scroll + input_x + 1] = '\0'; + if (input_x == box_width - 1) { + scroll++; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr [scroll + i]); + } else { + wmove(dialog, box_y, input_x++ + box_x); + waddch(dialog, key); + } + wrefresh(dialog); + } else + flash(); /* Alarm user about overflow */ + continue; + } + } + } + switch (key) { + case 'O': + case 'o': + delwin(dialog); + return 0; + case 'H': + case 'h': + delwin(dialog); + return 1; + case KEY_UP: + case KEY_LEFT: + switch (button) { + case -1: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 0: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + case 1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + } + break; + case TAB: + case KEY_DOWN: + case KEY_RIGHT: + switch (button) { + case -1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + case 0: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 1: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + } + break; + case ' ': + case '\n': + delwin(dialog); + return (button == -1 ? 0 : button); + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return KEY_ESC; /* ESC pressed */ +} diff --git a/i386/config/lex.zconf.c b/i386/config/lex.zconf.c new file mode 100644 index 0000000..6eb0397 --- /dev/null +++ b/i386/config/lex.zconf.c @@ -0,0 +1,2430 @@ + +#line 3 "scripts/kconfig/lex.zconf.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer zconf_create_buffer +#define yy_delete_buffer zconf_delete_buffer +#define yy_flex_debug zconf_flex_debug +#define yy_init_buffer zconf_init_buffer +#define yy_flush_buffer zconf_flush_buffer +#define yy_load_buffer_state zconf_load_buffer_state +#define yy_switch_to_buffer zconf_switch_to_buffer +#define yyin zconfin +#define yyleng zconfleng +#define yylex zconflex +#define yylineno zconflineno +#define yyout zconfout +#define yyrestart zconfrestart +#define yytext zconftext +#define yywrap zconfwrap +#define yyalloc zconfalloc +#define yyrealloc zconfrealloc +#define yyfree zconffree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE zconfrestart(zconfin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int zconfleng; + +extern FILE *zconfin, *zconfout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up zconftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up zconftext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via zconfrestart()), so that the user can continue scanning by + * just pointing zconfin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when zconftext is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int zconfleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow zconfwrap()'s to do buffer switches + * instead of setting up a fresh zconfin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void zconfrestart (FILE *input_file ); +void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size ); +void zconf_delete_buffer (YY_BUFFER_STATE b ); +void zconf_flush_buffer (YY_BUFFER_STATE b ); +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void zconfpop_buffer_state (void ); + +static void zconfensure_buffer_stack (void ); +static void zconf_load_buffer_state (void ); +static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len ); + +void *zconfalloc (yy_size_t ); +void *zconfrealloc (void *,yy_size_t ); +void zconffree (void * ); + +#define yy_new_buffer zconf_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + zconfensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + zconfensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + zconf_create_buffer(zconfin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define zconfwrap(n) 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0; + +typedef int yy_state_type; + +extern int zconflineno; + +int zconflineno = 1; + +extern char *zconftext; +#define yytext_ptr zconftext +static yyconst flex_int16_t yy_nxt[][17] = + { + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 + }, + + { + 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12 + }, + + { + 11, 12, 13, 14, 12, 12, 15, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12 + }, + + { + 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 18, 16, 16, 16 + }, + + { + 11, 16, 16, 17, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 18, 16, 16, 16 + + }, + + { + 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19 + }, + + { + 11, 19, 20, 21, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19 + }, + + { + 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, + 22, 22, 22, 22, 22, 25, 22 + }, + + { + 11, 22, 22, 23, 22, 24, 22, 22, 24, 22, + 22, 22, 22, 22, 22, 25, 22 + }, + + { + 11, 26, 26, 27, 28, 29, 30, 31, 29, 32, + 33, 34, 35, 35, 36, 37, 38 + + }, + + { + 11, 26, 26, 27, 28, 29, 30, 31, 29, 32, + 33, 34, 35, 35, 36, 37, 38 + }, + + { + -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, + -11, -11, -11, -11, -11, -11, -11 + }, + + { + 11, -12, -12, -12, -12, -12, -12, -12, -12, -12, + -12, -12, -12, -12, -12, -12, -12 + }, + + { + 11, -13, 39, 40, -13, -13, 41, -13, -13, -13, + -13, -13, -13, -13, -13, -13, -13 + }, + + { + 11, -14, -14, -14, -14, -14, -14, -14, -14, -14, + -14, -14, -14, -14, -14, -14, -14 + + }, + + { + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42 + }, + + { + 11, -16, -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16 + }, + + { + 11, -17, -17, -17, -17, -17, -17, -17, -17, -17, + -17, -17, -17, -17, -17, -17, -17 + }, + + { + 11, -18, -18, -18, -18, -18, -18, -18, -18, -18, + -18, -18, -18, 44, -18, -18, -18 + }, + + { + 11, 45, 45, -19, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45 + + }, + + { + 11, -20, 46, 47, -20, -20, -20, -20, -20, -20, + -20, -20, -20, -20, -20, -20, -20 + }, + + { + 11, 48, -21, -21, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48 + }, + + { + 11, 49, 49, 50, 49, -22, 49, 49, -22, 49, + 49, 49, 49, 49, 49, -22, 49 + }, + + { + 11, -23, -23, -23, -23, -23, -23, -23, -23, -23, + -23, -23, -23, -23, -23, -23, -23 + }, + + { + 11, -24, -24, -24, -24, -24, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24 + + }, + + { + 11, 51, 51, 52, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51 + }, + + { + 11, -26, -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26 + }, + + { + 11, -27, -27, -27, -27, -27, -27, -27, -27, -27, + -27, -27, -27, -27, -27, -27, -27 + }, + + { + 11, -28, -28, -28, -28, -28, -28, -28, -28, -28, + -28, -28, -28, -28, 53, -28, -28 + }, + + { + 11, -29, -29, -29, -29, -29, -29, -29, -29, -29, + -29, -29, -29, -29, -29, -29, -29 + + }, + + { + 11, 54, 54, -30, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54 + }, + + { + 11, -31, -31, -31, -31, -31, -31, 55, -31, -31, + -31, -31, -31, -31, -31, -31, -31 + }, + + { + 11, -32, -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32 + }, + + { + 11, -33, -33, -33, -33, -33, -33, -33, -33, -33, + -33, -33, -33, -33, -33, -33, -33 + }, + + { + 11, -34, -34, -34, -34, -34, -34, -34, -34, -34, + -34, 56, 57, 57, -34, -34, -34 + + }, + + { + 11, -35, -35, -35, -35, -35, -35, -35, -35, -35, + -35, 57, 57, 57, -35, -35, -35 + }, + + { + 11, -36, -36, -36, -36, -36, -36, -36, -36, -36, + -36, -36, -36, -36, -36, -36, -36 + }, + + { + 11, -37, -37, 58, -37, -37, -37, -37, -37, -37, + -37, -37, -37, -37, -37, -37, -37 + }, + + { + 11, -38, -38, -38, -38, -38, -38, -38, -38, -38, + -38, -38, -38, -38, -38, -38, 59 + }, + + { + 11, -39, 39, 40, -39, -39, 41, -39, -39, -39, + -39, -39, -39, -39, -39, -39, -39 + + }, + + { + 11, -40, -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40 + }, + + { + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42 + }, + + { + 11, 42, 42, 43, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42 + }, + + { + 11, -43, -43, -43, -43, -43, -43, -43, -43, -43, + -43, -43, -43, -43, -43, -43, -43 + }, + + { + 11, -44, -44, -44, -44, -44, -44, -44, -44, -44, + -44, -44, -44, 44, -44, -44, -44 + + }, + + { + 11, 45, 45, -45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45 + }, + + { + 11, -46, 46, 47, -46, -46, -46, -46, -46, -46, + -46, -46, -46, -46, -46, -46, -46 + }, + + { + 11, 48, -47, -47, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48 + }, + + { + 11, -48, -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48 + }, + + { + 11, 49, 49, 50, 49, -49, 49, 49, -49, 49, + 49, 49, 49, 49, 49, -49, 49 + + }, + + { + 11, -50, -50, -50, -50, -50, -50, -50, -50, -50, + -50, -50, -50, -50, -50, -50, -50 + }, + + { + 11, -51, -51, 52, -51, -51, -51, -51, -51, -51, + -51, -51, -51, -51, -51, -51, -51 + }, + + { + 11, -52, -52, -52, -52, -52, -52, -52, -52, -52, + -52, -52, -52, -52, -52, -52, -52 + }, + + { + 11, -53, -53, -53, -53, -53, -53, -53, -53, -53, + -53, -53, -53, -53, -53, -53, -53 + }, + + { + 11, 54, 54, -54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54 + + }, + + { + 11, -55, -55, -55, -55, -55, -55, -55, -55, -55, + -55, -55, -55, -55, -55, -55, -55 + }, + + { + 11, -56, -56, -56, -56, -56, -56, -56, -56, -56, + -56, 60, 57, 57, -56, -56, -56 + }, + + { + 11, -57, -57, -57, -57, -57, -57, -57, -57, -57, + -57, 57, 57, 57, -57, -57, -57 + }, + + { + 11, -58, -58, -58, -58, -58, -58, -58, -58, -58, + -58, -58, -58, -58, -58, -58, -58 + }, + + { + 11, -59, -59, -59, -59, -59, -59, -59, -59, -59, + -59, -59, -59, -59, -59, -59, -59 + + }, + + { + 11, -60, -60, -60, -60, -60, -60, -60, -60, -60, + -60, 57, 57, 57, -60, -60, -60 + }, + + } ; + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up zconftext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + zconfleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 33 +#define YY_END_OF_BUFFER 34 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[61] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 34, 5, 4, 2, 3, 7, 8, 6, 32, 29, + 31, 24, 28, 27, 26, 22, 17, 13, 16, 20, + 22, 11, 12, 19, 19, 14, 22, 22, 4, 2, + 3, 3, 1, 6, 32, 29, 31, 30, 24, 23, + 26, 25, 15, 20, 9, 19, 19, 21, 10, 18 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, + 10, 1, 1, 1, 11, 12, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 1, 1, 1, + 14, 1, 1, 1, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 1, 15, 1, 1, 13, 1, 13, 13, 13, 13, + + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 1, 16, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +extern int zconf_flex_debug; +int zconf_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *zconftext; +#define YY_NO_INPUT 1 + +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#define START_STRSIZE 16 + +static struct { + struct file *file; + int lineno; +} current_pos; + +static char *text; +static int text_size, text_asize; + +struct buffer { + struct buffer *parent; + YY_BUFFER_STATE state; +}; + +struct buffer *current_buf; + +static int last_ts, first_ts; + +static void zconf_endhelp(void); +static void zconf_endfile(void); + +static void new_string(void) +{ + text = malloc(START_STRSIZE); + text_asize = START_STRSIZE; + text_size = 0; + *text = 0; +} + +static void append_string(const char *str, int size) +{ + int new_size = text_size + size + 1; + if (new_size > text_asize) { + new_size += START_STRSIZE - 1; + new_size &= -START_STRSIZE; + text = realloc(text, new_size); + text_asize = new_size; + } + memcpy(text + text_size, str, size); + text_size += size; + text[text_size] = 0; +} + +static void alloc_string(const char *str, int size) +{ + text = malloc(size + 1); + memcpy(text, str, size); + text[size] = 0; +} + +#define INITIAL 0 +#define COMMAND 1 +#define HELP 2 +#define STRING 3 +#define PARAM 4 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int zconflex_destroy (void ); + +int zconfget_debug (void ); + +void zconfset_debug (int debug_flag ); + +YY_EXTRA_TYPE zconfget_extra (void ); + +void zconfset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *zconfget_in (void ); + +void zconfset_in (FILE * in_str ); + +FILE *zconfget_out (void ); + +void zconfset_out (FILE * out_str ); + +int zconfget_leng (void ); + +char *zconfget_text (void ); + +int zconfget_lineno (void ); + +void zconfset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int zconfwrap (void ); +#else +extern int zconfwrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + errno=0; \ + while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(zconfin); \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int zconflex (void); + +#define YY_DECL int zconflex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after zconftext and zconfleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + int str = 0; + int ts, i; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! zconfin ) + zconfin = stdin; + + if ( ! zconfout ) + zconfout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + zconfensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + zconf_create_buffer(zconfin,YY_BUF_SIZE ); + } + + zconf_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of zconftext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) + ++yy_cp; + + yy_current_state = -yy_current_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +/* rule 1 can match eol */ +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +{ + current_file->lineno++; + return T_EOL; +} + YY_BREAK +case 3: +YY_RULE_SETUP + + YY_BREAK +case 4: +YY_RULE_SETUP +{ + BEGIN(COMMAND); +} + YY_BREAK +case 5: +YY_RULE_SETUP +{ + unput(zconftext[0]); + BEGIN(COMMAND); +} + YY_BREAK + +case 6: +YY_RULE_SETUP +{ + struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); + BEGIN(PARAM); + current_pos.file = current_file; + current_pos.lineno = current_file->lineno; + if (id && id->flags & TF_COMMAND) { + zconflval.id = id; + return id->token; + } + alloc_string(zconftext, zconfleng); + zconflval.string = text; + return T_WORD; + } + YY_BREAK +case 7: +YY_RULE_SETUP + + YY_BREAK +case 8: +/* rule 8 can match eol */ +YY_RULE_SETUP +{ + BEGIN(INITIAL); + current_file->lineno++; + return T_EOL; + } + YY_BREAK + +case 9: +YY_RULE_SETUP +return T_AND; + YY_BREAK +case 10: +YY_RULE_SETUP +return T_OR; + YY_BREAK +case 11: +YY_RULE_SETUP +return T_OPEN_PAREN; + YY_BREAK +case 12: +YY_RULE_SETUP +return T_CLOSE_PAREN; + YY_BREAK +case 13: +YY_RULE_SETUP +return T_NOT; + YY_BREAK +case 14: +YY_RULE_SETUP +return T_EQUAL; + YY_BREAK +case 15: +YY_RULE_SETUP +return T_UNEQUAL; + YY_BREAK +case 16: +YY_RULE_SETUP +{ + str = zconftext[0]; + new_string(); + BEGIN(STRING); + } + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP +BEGIN(INITIAL); current_file->lineno++; return T_EOL; + YY_BREAK +case 18: +YY_RULE_SETUP +/* ignore */ + YY_BREAK +case 19: +YY_RULE_SETUP +{ + struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); + if (id && id->flags & TF_PARAM) { + zconflval.id = id; + return id->token; + } + alloc_string(zconftext, zconfleng); + zconflval.string = text; + return T_WORD; + } + YY_BREAK +case 20: +YY_RULE_SETUP +/* comment */ + YY_BREAK +case 21: +/* rule 21 can match eol */ +YY_RULE_SETUP +current_file->lineno++; + YY_BREAK +case 22: +YY_RULE_SETUP + + YY_BREAK +case YY_STATE_EOF(PARAM): +{ + BEGIN(INITIAL); + } + YY_BREAK + +case 23: +/* rule 23 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ +YY_RULE_SETUP +{ + append_string(zconftext, zconfleng); + zconflval.string = text; + return T_WORD_QUOTE; + } + YY_BREAK +case 24: +YY_RULE_SETUP +{ + append_string(zconftext, zconfleng); + } + YY_BREAK +case 25: +/* rule 25 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ +YY_RULE_SETUP +{ + append_string(zconftext + 1, zconfleng - 1); + zconflval.string = text; + return T_WORD_QUOTE; + } + YY_BREAK +case 26: +YY_RULE_SETUP +{ + append_string(zconftext + 1, zconfleng - 1); + } + YY_BREAK +case 27: +YY_RULE_SETUP +{ + if (str == zconftext[0]) { + BEGIN(PARAM); + zconflval.string = text; + return T_WORD_QUOTE; + } else + append_string(zconftext, 1); + } + YY_BREAK +case 28: +/* rule 28 can match eol */ +YY_RULE_SETUP +{ + printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); + current_file->lineno++; + BEGIN(INITIAL); + return T_EOL; + } + YY_BREAK +case YY_STATE_EOF(STRING): +{ + BEGIN(INITIAL); + } + YY_BREAK + +case 29: +YY_RULE_SETUP +{ + ts = 0; + for (i = 0; i < zconfleng; i++) { + if (zconftext[i] == '\t') + ts = (ts & ~7) + 8; + else + ts++; + } + last_ts = ts; + if (first_ts) { + if (ts < first_ts) { + zconf_endhelp(); + return T_HELPTEXT; + } + ts -= first_ts; + while (ts > 8) { + append_string(" ", 8); + ts -= 8; + } + append_string(" ", ts); + } + } + YY_BREAK +case 30: +/* rule 30 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up zconftext again */ +YY_RULE_SETUP +{ + current_file->lineno++; + zconf_endhelp(); + return T_HELPTEXT; + } + YY_BREAK +case 31: +/* rule 31 can match eol */ +YY_RULE_SETUP +{ + current_file->lineno++; + append_string("\n", 1); + } + YY_BREAK +case 32: +YY_RULE_SETUP +{ + while (zconfleng) { + if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t')) + break; + zconfleng--; + } + append_string(zconftext, zconfleng); + if (!first_ts) + first_ts = last_ts; + } + YY_BREAK +case YY_STATE_EOF(HELP): +{ + zconf_endhelp(); + return T_HELPTEXT; + } + YY_BREAK + +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(COMMAND): +{ + if (current_file) { + zconf_endfile(); + return T_EOL; + } + fclose(zconfin); + yyterminate(); +} + YY_BREAK +case 33: +YY_RULE_SETUP +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed zconfin at a new source and called + * zconflex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( zconfwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * zconftext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of zconflex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + zconfrestart(zconfin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + + yy_current_state = yy_nxt[yy_current_state][1]; + yy_is_jam = (yy_current_state <= 0); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up zconftext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + zconfrestart(zconfin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( zconfwrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve zconftext */ + (yy_hold_char) = *++(yy_c_buf_p); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void zconfrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + zconfensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + zconf_create_buffer(zconfin,YY_BUF_SIZE ); + } + + zconf_init_buffer(YY_CURRENT_BUFFER,input_file ); + zconf_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * zconfpop_buffer_state(); + * zconfpush_buffer_state(new_buffer); + */ + zconfensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + zconf_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (zconfwrap()) processing, but the only time this flag + * is looked at is after zconfwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void zconf_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + zconf_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with zconf_create_buffer() + * + */ + void zconf_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + zconffree((void *) b->yy_ch_buf ); + + zconffree((void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a zconfrestart() or at EOF. + */ + static void zconf_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + zconf_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then zconf_init_buffer was _probably_ + * called from zconfrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void zconf_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + zconf_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + zconfensure_buffer_stack(); + + /* This block is copied from zconf_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from zconf_switch_to_buffer. */ + zconf_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void zconfpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + zconf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + zconf_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void zconfensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + zconf_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to zconflex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * zconf_scan_bytes() instead. + */ +YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr ) +{ + + return zconf_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) zconfalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = zconf_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up zconftext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + zconftext[zconfleng] = (yy_hold_char); \ + (yy_c_buf_p) = zconftext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + zconfleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int zconfget_lineno (void) +{ + + return zconflineno; +} + +/** Get the input stream. + * + */ +FILE *zconfget_in (void) +{ + return zconfin; +} + +/** Get the output stream. + * + */ +FILE *zconfget_out (void) +{ + return zconfout; +} + +/** Get the length of the current token. + * + */ +int zconfget_leng (void) +{ + return zconfleng; +} + +/** Get the current token. + * + */ + +char *zconfget_text (void) +{ + return zconftext; +} + +/** Set the current line number. + * @param line_number + * + */ +void zconfset_lineno (int line_number ) +{ + + zconflineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see zconf_switch_to_buffer + */ +void zconfset_in (FILE * in_str ) +{ + zconfin = in_str ; +} + +void zconfset_out (FILE * out_str ) +{ + zconfout = out_str ; +} + +int zconfget_debug (void) +{ + return zconf_flex_debug; +} + +void zconfset_debug (int bdebug ) +{ + zconf_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from zconflex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + zconfin = stdin; + zconfout = stdout; +#else + zconfin = (FILE *) 0; + zconfout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * zconflex_init() + */ + return 0; +} + +/* zconflex_destroy is for both reentrant and non-reentrant scanners. */ +int zconflex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + zconf_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + zconfpop_buffer_state(); + } + + /* Destroy the stack itself. */ + zconffree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * zconflex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *zconfalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *zconfrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void zconffree (void * ptr ) +{ + free( (char *) ptr ); /* see zconfrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +void zconf_starthelp(void) +{ + new_string(); + last_ts = first_ts = 0; + BEGIN(HELP); +} + +static void zconf_endhelp(void) +{ + zconflval.string = text; + BEGIN(INITIAL); +} + +/* + * Try to open specified file with following names: + * ./name + * $(srctree)/name + * The latter is used when srctree is separate from objtree + * when compiling the kernel. + * Return NULL if file is not found. + */ +FILE *zconf_fopen(const char *name) +{ + char *env, fullname[PATH_MAX+1]; + FILE *f; + + f = fopen(name, "r"); + if (!f && name != NULL && name[0] != '/') { + env = getenv(SRCTREE); + if (env) { + sprintf(fullname, "%s/%s", env, name); + f = fopen(fullname, "r"); + } + } + return f; +} + +void zconf_initscan(const char *name) +{ + zconfin = zconf_fopen(name); + if (!zconfin) { + printf("can't find file %s\n", name); + exit(1); + } + + current_buf = malloc(sizeof(*current_buf)); + memset(current_buf, 0, sizeof(*current_buf)); + + current_file = file_lookup(name); + current_file->lineno = 1; + current_file->flags = FILE_BUSY; +} + +void zconf_nextfile(const char *name) +{ + struct file *file = file_lookup(name); + struct buffer *buf = malloc(sizeof(*buf)); + memset(buf, 0, sizeof(*buf)); + + current_buf->state = YY_CURRENT_BUFFER; + zconfin = zconf_fopen(file->name); + if (!zconfin) { + printf("%s:%d: can't open file \"%s\"\n", + zconf_curname(), zconf_lineno(), file->name); + exit(1); + } + zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE)); + buf->parent = current_buf; + current_buf = buf; + + if (file->flags & FILE_BUSY) { + printf("%s:%d: do not source '%s' from itself\n", + zconf_curname(), zconf_lineno(), name); + exit(1); + } + if (file->flags & FILE_SCANNED) { + printf("%s:%d: file '%s' is already sourced from '%s'\n", + zconf_curname(), zconf_lineno(), name, + file->parent->name); + exit(1); + } + file->flags |= FILE_BUSY; + file->lineno = 1; + file->parent = current_file; + current_file = file; +} + +static void zconf_endfile(void) +{ + struct buffer *parent; + + current_file->flags |= FILE_SCANNED; + current_file->flags &= ~FILE_BUSY; + current_file = current_file->parent; + + parent = current_buf->parent; + if (parent) { + fclose(zconfin); + zconf_delete_buffer(YY_CURRENT_BUFFER); + zconf_switch_to_buffer(parent->state); + } + free(current_buf); + current_buf = parent; +} + +int zconf_lineno(void) +{ + return current_pos.lineno; +} + +const char *zconf_curname(void) +{ + return current_pos.file ? current_pos.file->name : ""; +} + diff --git a/i386/config/lkc.h b/i386/config/lkc.h new file mode 100644 index 0000000..febf0c9 --- /dev/null +++ b/i386/config/lkc.h @@ -0,0 +1,196 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#ifndef LKC_H +#define LKC_H + +#include "expr.h" + +#ifndef KBUILD_NO_NLS +# include +#else +static inline const char *gettext(const char *txt) { return txt; } +static inline void textdomain(const char *domainname) {} +static inline void bindtextdomain(const char *name, const char *dir) {} +static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; } +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef LKC_DIRECT_LINK +#define P(name,type,arg) extern type name arg +#else +#include "lkc_defs.h" +#define P(name,type,arg) extern type (*name ## _p) arg +#endif +#include "lkc_proto.h" +#undef P + +#define SRCTREE "srctree" + +#ifndef PACKAGE +#define PACKAGE "linux" +#endif + +#define LOCALEDIR "/usr/share/locale" + +#define _(text) gettext(text) +#define N_(text) (text) + +#ifndef CONFIG_ +#define CONFIG_ "CONFIG_" +#endif + +#define TF_COMMAND 0x0001 +#define TF_PARAM 0x0002 +#define TF_OPTION 0x0004 + +enum conf_def_mode { + def_default, + def_yes, + def_mod, + def_no, + def_random +}; + +#define T_OPT_MODULES 1 +#define T_OPT_DEFCONFIG_LIST 2 +#define T_OPT_ENV 3 + +struct kconf_id { + int name; + int token; + unsigned int flags; + enum symbol_type stype; +}; + +#ifdef YYDEBUG +extern int zconfdebug; +#endif + +int zconfparse(void); +void zconfdump(FILE *out); +void zconf_starthelp(void); +FILE *zconf_fopen(const char *name); +void zconf_initscan(const char *name); +void zconf_nextfile(const char *name); +int zconf_lineno(void); +const char *zconf_curname(void); + +/* conf.c */ +void xfgets(char *str, int size, FILE *in); + +/* confdata.c */ +const char *conf_get_configname(void); +const char *conf_get_autoconfig_name(void); +char *conf_get_default_confname(void); +void sym_set_change_count(int count); +void sym_add_change_count(int count); +void conf_set_all_new_symbols(enum conf_def_mode mode); + +/* confdata.c and expr.c */ +static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out) +{ + if (fwrite(str, len, count, out) < count) + fprintf(stderr, "\nError in writing or end of file.\n"); +} + +/* kconfig_load.c */ +void kconfig_load(void); + +/* menu.c */ +void _menu_init(void); +void menu_warn(struct menu *menu, const char *fmt, ...); +struct menu *menu_add_menu(void); +void menu_end_menu(void); +void menu_add_entry(struct symbol *sym); +void menu_end_entry(void); +void menu_add_dep(struct expr *dep); +void menu_add_visibility(struct expr *dep); +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); +struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); +void menu_add_option(int token, char *arg); +void menu_finalize(struct menu *parent); +void menu_set_type(int type); + +/* util.c */ +struct file *file_lookup(const char *name); +int file_write_dep(const char *name); + +struct gstr { + size_t len; + char *s; + /* + * when max_width is not zero long lines in string s (if any) get + * wrapped not to exceed the max_width value + */ + int max_width; +}; +struct gstr str_new(void); +struct gstr str_assign(const char *s); +void str_free(struct gstr *gs); +void str_append(struct gstr *gs, const char *s); +void str_printf(struct gstr *gs, const char *fmt, ...); +const char *str_get(struct gstr *gs); + +/* symbol.c */ +extern struct expr *sym_env_list; + +void sym_init(void); +void sym_clear_all_valid(void); +void sym_set_all_changed(void); +void sym_set_changed(struct symbol *sym); +struct symbol *sym_choice_default(struct symbol *sym); +const char *sym_get_string_default(struct symbol *sym); +struct symbol *sym_check_deps(struct symbol *sym); +struct property *prop_alloc(enum prop_type type, struct symbol *sym); +struct symbol *prop_get_symbol(struct property *prop); +struct property *sym_get_env_prop(struct symbol *sym); + +static inline tristate sym_get_tristate_value(struct symbol *sym) +{ + return sym->curr.tri; +} + + +static inline struct symbol *sym_get_choice_value(struct symbol *sym) +{ + return (struct symbol *)sym->curr.val; +} + +static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval) +{ + return sym_set_tristate_value(chval, yes); +} + +static inline bool sym_is_choice(struct symbol *sym) +{ + return sym->flags & SYMBOL_CHOICE ? true : false; +} + +static inline bool sym_is_choice_value(struct symbol *sym) +{ + return sym->flags & SYMBOL_CHOICEVAL ? true : false; +} + +static inline bool sym_is_optional(struct symbol *sym) +{ + return sym->flags & SYMBOL_OPTIONAL ? true : false; +} + +static inline bool sym_has_value(struct symbol *sym) +{ + return sym->flags & SYMBOL_DEF_USER ? true : false; +} + +#ifdef __cplusplus +} +#endif + +#endif /* LKC_H */ diff --git a/i386/config/lkc_proto.h b/i386/config/lkc_proto.h new file mode 100644 index 0000000..17342fe --- /dev/null +++ b/i386/config/lkc_proto.h @@ -0,0 +1,53 @@ +#include + +/* confdata.c */ +P(conf_parse,void,(const char *name)); +P(conf_read,int,(const char *name)); +P(conf_read_simple,int,(const char *name, int)); +P(conf_write_defconfig,int,(const char *name)); +P(conf_write,int,(const char *name)); +P(conf_write_autoconf,int,(void)); +P(conf_get_changed,bool,(void)); +P(conf_set_changed_callback, void,(void (*fn)(void))); +P(conf_set_message_callback, void,(void (*fn)(const char *fmt, va_list ap))); + +/* menu.c */ +P(rootmenu,struct menu,); + +P(menu_is_visible, bool, (struct menu *menu)); +P(menu_has_prompt, bool, (struct menu *menu)); +P(menu_get_prompt,const char *,(struct menu *menu)); +P(menu_get_root_menu,struct menu *,(struct menu *menu)); +P(menu_get_parent_menu,struct menu *,(struct menu *menu)); +P(menu_has_help,bool,(struct menu *menu)); +P(menu_get_help,const char *,(struct menu *menu)); +P(get_symbol_str, void, (struct gstr *r, struct symbol *sym)); +P(get_relations_str, struct gstr, (struct symbol **sym_arr)); +P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); + +/* symbol.c */ +P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); + +P(sym_lookup,struct symbol *,(const char *name, int flags)); +P(sym_find,struct symbol *,(const char *name)); +P(sym_expand_string_value,const char *,(const char *in)); +P(sym_re_search,struct symbol **,(const char *pattern)); +P(sym_type_name,const char *,(enum symbol_type type)); +P(sym_calc_value,void,(struct symbol *sym)); +P(sym_get_type,enum symbol_type,(struct symbol *sym)); +P(sym_tristate_within_range,bool,(struct symbol *sym,tristate tri)); +P(sym_set_tristate_value,bool,(struct symbol *sym,tristate tri)); +P(sym_toggle_tristate_value,tristate,(struct symbol *sym)); +P(sym_string_valid,bool,(struct symbol *sym, const char *newval)); +P(sym_string_within_range,bool,(struct symbol *sym, const char *str)); +P(sym_set_string_value,bool,(struct symbol *sym, const char *newval)); +P(sym_is_changable,bool,(struct symbol *sym)); +P(sym_get_choice_prop,struct property *,(struct symbol *sym)); +P(sym_get_default_prop,struct property *,(struct symbol *sym)); +P(sym_get_string_value,const char *,(struct symbol *sym)); + +P(prop_get_type_name,const char *,(enum prop_type type)); + +/* expr.c */ +P(expr_compare_type,int,(enum expr_type t1, enum expr_type t2)); +P(expr_print,void,(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)); diff --git a/i386/config/lxdialog/.gitignore b/i386/config/lxdialog/.gitignore new file mode 100644 index 0000000..90b08ff --- /dev/null +++ b/i386/config/lxdialog/.gitignore @@ -0,0 +1,4 @@ +# +# Generated files +# +lxdialog diff --git a/i386/config/lxdialog/.svn/all-wcprops b/i386/config/lxdialog/.svn/all-wcprops new file mode 100644 index 0000000..73dcfdd --- /dev/null +++ b/i386/config/lxdialog/.svn/all-wcprops @@ -0,0 +1,65 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog +END +.gitignore +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/.gitignore +END +dialog.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/dialog.h +END +check-lxdialog.sh +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/check-lxdialog.sh +END +inputbox.c +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/inputbox.c +END +checklist.c +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/checklist.c +END +BIG.FAT.WARNING +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/BIG.FAT.WARNING +END +menubox.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/menubox.c +END +textbox.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/textbox.c +END +util.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/util.c +END +yesno.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/config/lxdialog/yesno.c +END diff --git a/i386/config/lxdialog/.svn/entries b/i386/config/lxdialog/.svn/entries new file mode 100644 index 0000000..23691ce --- /dev/null +++ b/i386/config/lxdialog/.svn/entries @@ -0,0 +1,368 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/config/lxdialog +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +.gitignore +file + + + + +2013-08-27T23:54:56.000000Z +f1b186abc7a482548c4e0cdd9d362588 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +31 + +dialog.h +file + + + + +2013-08-27T23:54:56.000000Z +6ab37e536b723f6cbe07fca073daef03 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6696 + +check-lxdialog.sh +file + + + + +2013-08-27T23:54:56.000000Z +831f9d2b82fff2a0ac6cee4ca0ef64f2 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1771 + +inputbox.c +file + + + + +2013-08-27T23:54:56.000000Z +836070cf260aa9285ff69828124b37c7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6054 + +checklist.c +file + + + + +2013-08-27T23:54:56.000000Z +4b6cdf8fca5338adc5a995bb5f070d0e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8394 + +BIG.FAT.WARNING +file + + + + +2013-08-27T23:54:56.000000Z +2e0bfdc0eb78ca744114b42489f077d3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +234 + +menubox.c +file + + + + +2013-08-27T23:54:56.000000Z +d3e9d71d6cfc6b8c1219678ea146e904 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11062 + +textbox.c +file + + + + +2013-08-27T23:54:56.000000Z +e74891ce550d233ae0da469c1cfed13b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9150 + +util.c +file + + + + +2013-08-27T23:54:56.000000Z +72a2f3dbdf1d9fa96ff61da28269b52f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17095 + +yesno.c +file + + + + +2013-08-27T23:54:56.000000Z +9769589490ac420463d64a8b2221ab25 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2904 + diff --git a/i386/config/lxdialog/.svn/prop-base/check-lxdialog.sh.svn-base b/i386/config/lxdialog/.svn/prop-base/check-lxdialog.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/config/lxdialog/.svn/prop-base/check-lxdialog.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/config/lxdialog/.svn/text-base/.gitignore.svn-base b/i386/config/lxdialog/.svn/text-base/.gitignore.svn-base new file mode 100644 index 0000000..90b08ff --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/.gitignore.svn-base @@ -0,0 +1,4 @@ +# +# Generated files +# +lxdialog diff --git a/i386/config/lxdialog/.svn/text-base/BIG.FAT.WARNING.svn-base b/i386/config/lxdialog/.svn/text-base/BIG.FAT.WARNING.svn-base new file mode 100644 index 0000000..a8999d8 --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/BIG.FAT.WARNING.svn-base @@ -0,0 +1,4 @@ +This is NOT the official version of dialog. This version has been +significantly modified from the original. It is for use by the Linux +kernel configuration script. Please do not bother Savio Lam with +questions about this program. diff --git a/i386/config/lxdialog/.svn/text-base/check-lxdialog.sh.svn-base b/i386/config/lxdialog/.svn/text-base/check-lxdialog.sh.svn-base new file mode 100644 index 0000000..82cc3a8 --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/check-lxdialog.sh.svn-base @@ -0,0 +1,84 @@ +#!/bin/sh +# Check ncurses compatibility + +# What library to link +ldflags() +{ + for ext in so a dylib ; do + for lib in ncursesw ncurses curses ; do + $cc -print-file-name=lib${lib}.${ext} | grep -q / + if [ $? -eq 0 ]; then + echo "-l${lib}" + exit + fi + done + done + exit 1 +} + +# Where is ncurses.h? +ccflags() +{ + if [ -f /usr/include/ncurses/ncurses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses/curses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses.h ]; then + echo '-DCURSES_LOC=""' + else + echo '-DCURSES_LOC=""' + fi +} + +# Temp file, try to clean up after us +tmp=.lxdialog.tmp +trap "rm -f $tmp" 0 1 2 3 15 + +# Check if we can link to ncurses +check() { + $cc -xc - -o $tmp 2>/dev/null <<'EOF' +#include CURSES_LOC +main() {} +EOF + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries or the" 1>&2 + echo " *** required header files." 1>&2 + echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 + echo " *** " 1>&2 + exit 1 + fi +} + +usage() { + printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n" +} + +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +cc="" +case "$1" in + "-check") + shift + cc="$@" + check + ;; + "-ccflags") + ccflags + ;; + "-ldflags") + shift + cc="$@" + ldflags + ;; + "*") + usage + exit 1 + ;; +esac diff --git a/i386/config/lxdialog/.svn/text-base/checklist.c.svn-base b/i386/config/lxdialog/.svn/text-base/checklist.c.svn-base new file mode 100644 index 0000000..a2eb80f --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/checklist.c.svn-base @@ -0,0 +1,332 @@ +/* + * checklist.c -- implements the checklist box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension + * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static int list_width, check_x, item_x; + +/* + * Print list item + */ +static void print_item(WINDOW * win, int choice, int selected) +{ + int i; + char *list_item = malloc(list_width + 1); + + strncpy(list_item, item_str(), list_width - item_x); + list_item[list_width - item_x] = '\0'; + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, choice, 0); + for (i = 0; i < list_width; i++) + waddch(win, ' '); + + wmove(win, choice, check_x); + wattrset(win, selected ? dlg.check_selected.atr + : dlg.check.atr); + if (!item_is_tag(':')) + wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); + + wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); + mvwaddch(win, choice, item_x, list_item[0]); + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + waddstr(win, list_item + 1); + if (selected) { + wmove(win, choice, check_x + 1); + wrefresh(win); + } + free(list_item); +} + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int choice, int item_no, int scroll, + int y, int x, int height) +{ + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + + if ((height < item_no) && (scroll + choice < item_no - 1)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } +} + +/* + * Display the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext("Select"), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with a list of options that can be turned on or off + * in the style of radiolist (only one option turned on at a time). + */ +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height) +{ + int i, x, y, box_x, box_y; + int key = 0, button = 0, choice = 0, scroll = 0, max_choice; + WINDOW *dialog, *list; + + /* which item to highlight */ + item_foreach() { + if (item_is_tag('X')) + choice = item_n(); + if (item_is_selected()) { + choice = item_n(); + break; + } + } + +do_resize: + if (getmaxy(stdscr) < (height + 6)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 6)) + return -ERRDISPLAYTOOSMALL; + + max_choice = MIN(list_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + list_width = width - 6; + box_y = height - list_height - 5; + box_x = (width - list_width) / 2 - 1; + + /* create new window for the list */ + list = subwin(dialog, list_height, list_width, y + box_y + 1, + x + box_x + 1); + + keypad(list, TRUE); + + /* draw a box around the list items */ + draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + /* Find length of longest item in order to center checklist */ + check_x = 0; + item_foreach() + check_x = MAX(check_x, strlen(item_str()) + 4); + check_x = MIN(check_x, list_width); + + check_x = (list_width - check_x) / 2; + item_x = check_x + 4; + + if (choice >= list_height) { + scroll = choice - list_height + 1; + choice -= scroll; + } + + /* Print the list */ + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + print_item(list, i, i == choice); + } + + print_arrows(dialog, choice, item_count(), scroll, + box_y, box_x + check_x + 5, list_height); + + print_buttons(dialog, height, width, 0); + + wnoutrefresh(dialog); + wnoutrefresh(list); + doupdate(); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + for (i = 0; i < max_choice; i++) { + item_set(i + scroll); + if (toupper(key) == toupper(item_str()[0])) + break; + } + + if (i < max_choice || key == KEY_UP || key == KEY_DOWN || + key == '+' || key == '-') { + if (key == KEY_UP || key == '-') { + if (!choice) { + if (!scroll) + continue; + /* Scroll list down */ + if (list_height > 1) { + /* De-highlight current first item */ + item_set(scroll); + print_item(list, 0, FALSE); + scrollok(list, TRUE); + wscrl(list, -1); + scrollok(list, FALSE); + } + scroll--; + item_set(scroll); + print_item(list, 0, TRUE); + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice - 1; + } else if (key == KEY_DOWN || key == '+') { + if (choice == max_choice - 1) { + if (scroll + choice >= item_count() - 1) + continue; + /* Scroll list up */ + if (list_height > 1) { + /* De-highlight current last item before scrolling up */ + item_set(scroll + max_choice - 1); + print_item(list, + max_choice - 1, + FALSE); + scrollok(list, TRUE); + wscrl(list, 1); + scrollok(list, FALSE); + } + scroll++; + item_set(scroll + max_choice - 1); + print_item(list, max_choice - 1, TRUE); + + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice + 1; + } + if (i != choice) { + /* De-highlight current item */ + item_set(scroll + choice); + print_item(list, choice, FALSE); + /* Highlight new item */ + choice = i; + item_set(scroll + choice); + print_item(list, choice, TRUE); + wnoutrefresh(dialog); + wrefresh(list); + } + continue; /* wait for another key press */ + } + switch (key) { + case 'H': + case 'h': + case '?': + button = 1; + /* fall-through */ + case 'S': + case 's': + case ' ': + case '\n': + item_foreach() + item_set_selected(0); + item_set(scroll + choice); + item_set_selected(1); + delwin(list); + delwin(dialog); + return button; + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(list); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + + /* Now, update everything... */ + doupdate(); + } + delwin(list); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/.svn/text-base/dialog.h.svn-base b/i386/config/lxdialog/.svn/text-base/dialog.h.svn-base new file mode 100644 index 0000000..b5211fc --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/dialog.h.svn-base @@ -0,0 +1,230 @@ +/* + * dialog.h -- common declarations for all dialog modules + * + * AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef KBUILD_NO_NLS +# include +#else +# define gettext(Msgid) ((const char *) (Msgid)) +#endif + +#ifdef __sun__ +#define CURS_MACROS +#endif +#include CURSES_LOC + +/* + * Colors in ncurses 1.9.9e do not work properly since foreground and + * background colors are OR'd rather than separately masked. This version + * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible + * with standard curses. The simplest fix (to make this work with standard + * curses) uses the wbkgdset() function, not used in the original hack. + * Turn it off if we're building with 1.9.9e, since it just confuses things. + */ +#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE) +#define OLD_NCURSES 1 +#undef wbkgdset +#define wbkgdset(w,p) /*nothing */ +#else +#define OLD_NCURSES 0 +#endif + +#define TR(params) _tracef params + +#define KEY_ESC 27 +#define TAB 9 +#define MAX_LEN 2048 +#define BUF_SIZE (10*1024) +#define MIN(x,y) (x < y ? x : y) +#define MAX(x,y) (x > y ? x : y) + +#ifndef ACS_ULCORNER +#define ACS_ULCORNER '+' +#endif +#ifndef ACS_LLCORNER +#define ACS_LLCORNER '+' +#endif +#ifndef ACS_URCORNER +#define ACS_URCORNER '+' +#endif +#ifndef ACS_LRCORNER +#define ACS_LRCORNER '+' +#endif +#ifndef ACS_HLINE +#define ACS_HLINE '-' +#endif +#ifndef ACS_VLINE +#define ACS_VLINE '|' +#endif +#ifndef ACS_LTEE +#define ACS_LTEE '+' +#endif +#ifndef ACS_RTEE +#define ACS_RTEE '+' +#endif +#ifndef ACS_UARROW +#define ACS_UARROW '^' +#endif +#ifndef ACS_DARROW +#define ACS_DARROW 'v' +#endif + +/* error return codes */ +#define ERRDISPLAYTOOSMALL (KEY_MAX + 1) + +/* + * Color definitions + */ +struct dialog_color { + chtype atr; /* Color attribute */ + int fg; /* foreground */ + int bg; /* background */ + int hl; /* highlight this item */ +}; + +struct dialog_info { + const char *backtitle; + struct dialog_color screen; + struct dialog_color shadow; + struct dialog_color dialog; + struct dialog_color title; + struct dialog_color border; + struct dialog_color button_active; + struct dialog_color button_inactive; + struct dialog_color button_key_active; + struct dialog_color button_key_inactive; + struct dialog_color button_label_active; + struct dialog_color button_label_inactive; + struct dialog_color inputbox; + struct dialog_color inputbox_border; + struct dialog_color searchbox; + struct dialog_color searchbox_title; + struct dialog_color searchbox_border; + struct dialog_color position_indicator; + struct dialog_color menubox; + struct dialog_color menubox_border; + struct dialog_color item; + struct dialog_color item_selected; + struct dialog_color tag; + struct dialog_color tag_selected; + struct dialog_color tag_key; + struct dialog_color tag_key_selected; + struct dialog_color check; + struct dialog_color check_selected; + struct dialog_color uarrow; + struct dialog_color darrow; +}; + +/* + * Global variables + */ +extern struct dialog_info dlg; +extern char dialog_input_result[]; + +/* + * Function prototypes + */ + +/* item list as used by checklist and menubox */ +void item_reset(void); +void item_make(const char *fmt, ...); +void item_add_str(const char *fmt, ...); +void item_set_tag(char tag); +void item_set_data(void *p); +void item_set_selected(int val); +int item_activate_selected(void); +void *item_data(void); +char item_tag(void); + +/* item list manipulation for lxdialog use */ +#define MAXITEMSTR 200 +struct dialog_item { + char str[MAXITEMSTR]; /* promtp displayed */ + char tag; + void *data; /* pointer to menu item - used by menubox+checklist */ + int selected; /* Set to 1 by dialog_*() function if selected. */ +}; + +/* list of lialog_items */ +struct dialog_list { + struct dialog_item node; + struct dialog_list *next; +}; + +extern struct dialog_list *item_cur; +extern struct dialog_list item_nil; +extern struct dialog_list *item_head; + +int item_count(void); +void item_set(int n); +int item_n(void); +const char *item_str(void); +int item_is_selected(void); +int item_is_tag(char tag); +#define item_foreach() \ + for (item_cur = item_head ? item_head: item_cur; \ + item_cur && (item_cur != &item_nil); item_cur = item_cur->next) + +/* generic key handlers */ +int on_key_esc(WINDOW *win); +int on_key_resize(void); + +int init_dialog(const char *backtitle); +void set_dialog_backtitle(const char *backtitle); +void end_dialog(int x, int y); +void attr_clear(WINDOW * win, int height, int width, chtype attr); +void dialog_clear(void); +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x); +void print_button(WINDOW * win, const char *label, int y, int x, int selected); +void print_title(WINDOW *dialog, const char *title, int width); +void draw_box(WINDOW * win, int y, int x, int height, int width, chtype box, + chtype border); +void draw_shadow(WINDOW * win, int y, int x, int height, int width); + +int first_alpha(const char *string, const char *exempt); +int dialog_yesno(const char *title, const char *prompt, int height, int width); +int dialog_msgbox(const char *title, const char *prompt, int height, + int width, int pause); +int dialog_textbox(const char *title, const char *file, int height, int width); +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll); +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height); +extern char dialog_input_result[]; +int dialog_inputbox(const char *title, const char *prompt, int height, + int width, const char *init); + +/* + * This is the base for fictitious keys, which activate + * the buttons. + * + * Mouse-generated keys are the following: + * -- the first 32 are used as numbers, in addition to '0'-'9' + * -- the lowercase are used to signal mouse-enter events (M_EVENT + 'o') + * -- uppercase chars are used to invoke the button (M_EVENT + 'O') + */ +#define M_EVENT (KEY_MAX+1) diff --git a/i386/config/lxdialog/.svn/text-base/inputbox.c.svn-base b/i386/config/lxdialog/.svn/text-base/inputbox.c.svn-base new file mode 100644 index 0000000..dd8e587 --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/inputbox.c.svn-base @@ -0,0 +1,238 @@ +/* + * inputbox.c -- implements the input box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +char dialog_input_result[MAX_LEN + 1]; + +/* + * Print the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext(" Ok "), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box for inputing a string + */ +int dialog_inputbox(const char *title, const char *prompt, int height, int width, + const char *init) +{ + int i, x, y, box_y, box_x, box_width; + int input_x = 0, scroll = 0, key = 0, button = -1; + char *instr = dialog_input_result; + WINDOW *dialog; + + if (!init) + instr[0] = '\0'; + else + strcpy(instr, init); + +do_resize: + if (getmaxy(stdscr) <= (height - 2)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) <= (width - 2)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + /* Draw the input field box */ + box_width = width - 6; + getyx(dialog, y, x); + box_y = y + 2; + box_x = (width - box_width) / 2; + draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, + dlg.dialog.atr, dlg.border.atr); + + print_buttons(dialog, height, width, 0); + + /* Set up the initial value */ + wmove(dialog, box_y, box_x); + wattrset(dialog, dlg.inputbox.atr); + + input_x = strlen(instr); + + if (input_x >= box_width) { + scroll = input_x - box_width + 1; + input_x = box_width - 1; + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr[scroll + i]); + } else { + waddstr(dialog, instr); + } + + wmove(dialog, box_y, box_x + input_x); + + wrefresh(dialog); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + if (button == -1) { /* Input box selected */ + switch (key) { + case TAB: + case KEY_UP: + case KEY_DOWN: + break; + case KEY_LEFT: + continue; + case KEY_RIGHT: + continue; + case KEY_BACKSPACE: + case 127: + if (input_x || scroll) { + wattrset(dialog, dlg.inputbox.atr); + if (!input_x) { + scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, + instr[scroll + input_x + i] ? + instr[scroll + input_x + i] : ' '); + input_x = strlen(instr) - scroll; + } else + input_x--; + instr[scroll + input_x] = '\0'; + mvwaddch(dialog, box_y, input_x + box_x, ' '); + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + continue; + default: + if (key < 0x100 && isprint(key)) { + if (scroll + input_x < MAX_LEN) { + wattrset(dialog, dlg.inputbox.atr); + instr[scroll + input_x] = key; + instr[scroll + input_x + 1] = '\0'; + if (input_x == box_width - 1) { + scroll++; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr [scroll + i]); + } else { + wmove(dialog, box_y, input_x++ + box_x); + waddch(dialog, key); + } + wrefresh(dialog); + } else + flash(); /* Alarm user about overflow */ + continue; + } + } + } + switch (key) { + case 'O': + case 'o': + delwin(dialog); + return 0; + case 'H': + case 'h': + delwin(dialog); + return 1; + case KEY_UP: + case KEY_LEFT: + switch (button) { + case -1: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 0: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + case 1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + } + break; + case TAB: + case KEY_DOWN: + case KEY_RIGHT: + switch (button) { + case -1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + case 0: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 1: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + } + break; + case ' ': + case '\n': + delwin(dialog); + return (button == -1 ? 0 : button); + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return KEY_ESC; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/.svn/text-base/menubox.c.svn-base b/i386/config/lxdialog/.svn/text-base/menubox.c.svn-base new file mode 100644 index 0000000..1d60473 --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/menubox.c.svn-base @@ -0,0 +1,434 @@ +/* + * menubox.c -- implements the menu box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Changes by Clifford Wolf (god@clifford.at) + * + * [ 1998-06-13 ] + * + * *) A bugfix for the Page-Down problem + * + * *) Formerly when I used Page Down and Page Up, the cursor would be set + * to the first position in the menu box. Now lxdialog is a bit + * smarter and works more like other menu systems (just have a look at + * it). + * + * *) Formerly if I selected something my scrolling would be broken because + * lxdialog is re-invoked by the Menuconfig shell script, can't + * remember the last scrolling position, and just sets it so that the + * cursor is at the bottom of the box. Now it writes the temporary file + * lxdialog.scrltmp which contains this information. The file is + * deleted by lxdialog if the user leaves a submenu or enters a new + * one, but it would be nice if Menuconfig could make another "rm -f" + * just to be sure. Just try it out - you will recognise a difference! + * + * [ 1998-06-14 ] + * + * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files + * and menus change their size on the fly. + * + * *) If for some reason the last scrolling position is not saved by + * lxdialog, it sets the scrolling so that the selected item is in the + * middle of the menu box, not at the bottom. + * + * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) + * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus. + * This fixes a bug in Menuconfig where using ' ' to descend into menus + * would leave mis-synchronized lxdialog.scrltmp files lying around, + * fscanf would read in 'scroll', and eventually that value would get used. + */ + +#include "dialog.h" + +static int menu_width, item_x; + +/* + * Print menu item + */ +static void do_print_item(WINDOW * win, const char *item, int line_y, + int selected, int hotkey) +{ + int j; + char *menu_item = malloc(menu_width + 1); + + strncpy(menu_item, item, menu_width - item_x); + menu_item[menu_width - item_x] = '\0'; + j = first_alpha(menu_item, "YyNnMmHh"); + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, line_y, 0); +#if OLD_NCURSES + { + int i; + for (i = 0; i < menu_width; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + mvwaddstr(win, line_y, item_x, menu_item); + if (hotkey) { + wattrset(win, selected ? dlg.tag_key_selected.atr + : dlg.tag_key.atr); + mvwaddch(win, line_y, item_x + j, menu_item[j]); + } + if (selected) { + wmove(win, line_y, item_x + 1); + } + free(menu_item); + wrefresh(win); +} + +#define print_item(index, choice, selected) \ +do { \ + item_set(index); \ + do_print_item(menu, item_str(), choice, selected, !item_is_tag(':')); \ +} while (0) + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x, + int height) +{ + int cur_y, cur_x; + + getyx(win, cur_y, cur_x); + + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + wrefresh(win); + + if ((height < item_no) && (scroll + height < item_no)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + wmove(win, cur_y, cur_x); + wrefresh(win); +} + +/* + * Display the termination buttons. + */ +static void print_buttons(WINDOW * win, int height, int width, int selected) +{ + int x = width / 2 - 16; + int y = height - 2; + + print_button(win, gettext("Select"), y, x, selected == 0); + print_button(win, gettext(" Exit "), y, x + 12, selected == 1); + print_button(win, gettext(" Help "), y, x + 24, selected == 2); + + wmove(win, y, x + 1 + 12 * selected); + wrefresh(win); +} + +/* scroll up n lines (n may be negative) */ +static void do_scroll(WINDOW *win, int *scroll, int n) +{ + /* Scroll menu up */ + scrollok(win, TRUE); + wscrl(win, n); + scrollok(win, FALSE); + *scroll = *scroll + n; + wrefresh(win); +} + +/* + * Display a menu for choosing among a number of options + */ +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll) +{ + int i, j, x, y, box_x, box_y; + int height, width, menu_height; + int key = 0, button = 0, scroll = 0, choice = 0; + int first_item = 0, max_choice; + WINDOW *dialog, *menu; + +do_resize: + height = getmaxy(stdscr); + width = getmaxx(stdscr); + if (height < 15 || width < 65) + return -ERRDISPLAYTOOSMALL; + + height -= 4; + width -= 5; + menu_height = height - 10; + + max_choice = MIN(menu_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + menu_width = width - 6; + box_y = height - menu_height - 5; + box_x = (width - menu_width) / 2 - 1; + + /* create new window for the menu */ + menu = subwin(dialog, menu_height, menu_width, + y + box_y + 1, x + box_x + 1); + keypad(menu, TRUE); + + /* draw a box around the menu items */ + draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + if (menu_width >= 80) + item_x = (menu_width - 70) / 2; + else + item_x = 4; + + /* Set choice to default item */ + item_foreach() + if (selected && (selected == item_data())) + choice = item_n(); + /* get the saved scroll info */ + scroll = *s_scroll; + if ((scroll <= choice) && (scroll + max_choice > choice) && + (scroll >= 0) && (scroll + max_choice <= item_count())) { + first_item = scroll; + choice = choice - scroll; + } else { + scroll = 0; + } + if ((choice >= max_choice)) { + if (choice >= item_count() - max_choice / 2) + scroll = first_item = item_count() - max_choice; + else + scroll = first_item = choice - max_choice / 2; + choice = choice - scroll; + } + + /* Print the menu */ + for (i = 0; i < max_choice; i++) { + print_item(first_item + i, i, i == choice); + } + + wnoutrefresh(menu); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + print_buttons(dialog, height, width, 0); + wmove(menu, choice, item_x + 1); + wrefresh(menu); + + while (key != KEY_ESC) { + key = wgetch(menu); + + if (key < 256 && isalpha(key)) + key = tolower(key); + + if (strchr("ynmh", key)) + i = max_choice; + else { + for (i = choice + 1; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + if (i == max_choice) + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + } + + if (i < max_choice || + key == KEY_UP || key == KEY_DOWN || + key == '-' || key == '+' || + key == KEY_PPAGE || key == KEY_NPAGE) { + /* Remove highligt of current item */ + print_item(scroll + choice, choice, FALSE); + + if (key == KEY_UP || key == '-') { + if (choice < 2 && scroll) { + /* Scroll menu down */ + do_scroll(menu, &scroll, -1); + + print_item(scroll, 0, FALSE); + } else + choice = MAX(choice - 1, 0); + + } else if (key == KEY_DOWN || key == '+') { + print_item(scroll+choice, choice, FALSE); + + if ((choice > max_choice - 3) && + (scroll + max_choice < item_count())) { + /* Scroll menu up */ + do_scroll(menu, &scroll, 1); + + print_item(scroll+max_choice - 1, + max_choice - 1, FALSE); + } else + choice = MIN(choice + 1, max_choice - 1); + + } else if (key == KEY_PPAGE) { + scrollok(menu, TRUE); + for (i = 0; (i < max_choice); i++) { + if (scroll > 0) { + do_scroll(menu, &scroll, -1); + print_item(scroll, 0, FALSE); + } else { + if (choice > 0) + choice--; + } + } + + } else if (key == KEY_NPAGE) { + for (i = 0; (i < max_choice); i++) { + if (scroll + max_choice < item_count()) { + do_scroll(menu, &scroll, 1); + print_item(scroll+max_choice-1, + max_choice - 1, FALSE); + } else { + if (choice + 1 < max_choice) + choice++; + } + } + } else + choice = i; + + print_item(scroll + choice, choice, TRUE); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + wnoutrefresh(dialog); + wrefresh(menu); + + continue; /* wait for another key press */ + } + + switch (key) { + case KEY_LEFT: + case TAB: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 2 : (button > 2 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(menu); + break; + case ' ': + case 's': + case 'y': + case 'n': + case 'm': + case '/': + case 'h': + case '?': + case 'z': + case '\n': + /* save scroll info */ + *s_scroll = scroll; + delwin(menu); + delwin(dialog); + item_set(scroll + choice); + item_set_selected(1); + switch (key) { + case 'h': + case '?': + return 2; + case 's': + case 'y': + return 3; + case 'n': + return 4; + case 'm': + return 5; + case ' ': + return 6; + case '/': + return 7; + case 'z': + return 8; + case '\n': + return button; + } + return 0; + case 'e': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(menu); + break; + case KEY_RESIZE: + on_key_resize(); + delwin(menu); + delwin(dialog); + goto do_resize; + } + } + delwin(menu); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/.svn/text-base/textbox.c.svn-base b/i386/config/lxdialog/.svn/text-base/textbox.c.svn-base new file mode 100644 index 0000000..c704712 --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/textbox.c.svn-base @@ -0,0 +1,391 @@ +/* + * textbox.c -- implements the text box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static void back_lines(int n); +static void print_page(WINDOW * win, int height, int width); +static void print_line(WINDOW * win, int row, int width); +static char *get_line(void); +static void print_position(WINDOW * win); + +static int hscroll; +static int begin_reached, end_reached, page_length; +static const char *buf; +static const char *page; + +/* + * refresh window content + */ +static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, + int cur_y, int cur_x) +{ + print_page(box, boxh, boxw); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); +} + + +/* + * Display text from a file in a dialog box. + */ +int dialog_textbox(const char *title, const char *tbuf, + int initial_height, int initial_width) +{ + int i, x, y, cur_x, cur_y, key = 0; + int height, width, boxh, boxw; + int passed_end; + WINDOW *dialog, *box; + + begin_reached = 1; + end_reached = 0; + page_length = 0; + hscroll = 0; + buf = tbuf; + page = buf; /* page is pointer to start of page to be displayed */ + +do_resize: + getmaxyx(stdscr, height, width); + if (height < 8 || width < 8) + return -ERRDISPLAYTOOSMALL; + if (initial_height != 0) + height = initial_height; + else + if (height > 4) + height -= 4; + else + height = 0; + if (initial_width != 0) + width = initial_width; + else + if (width > 5) + width -= 5; + else + width = 0; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + /* Create window for box region, used for scrolling text */ + boxh = height - 4; + boxw = width - 2; + box = subwin(dialog, boxh, boxw, y + 1, x + 1); + wattrset(box, dlg.dialog.atr); + wbkgdset(box, dlg.dialog.atr & A_COLOR); + + keypad(box, TRUE); + + /* register the new window, along with its borders */ + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE); + wnoutrefresh(dialog); + getyx(dialog, cur_y, cur_x); /* Save cursor position */ + + /* Print first page of text */ + attr_clear(box, boxh, boxw, dlg.dialog.atr); + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); + + while ((key != KEY_ESC) && (key != '\n')) { + key = wgetch(dialog); + switch (key) { + case 'E': /* Exit */ + case 'e': + case 'X': + case 'x': + delwin(box); + delwin(dialog); + return 0; + case 'g': /* First page */ + case KEY_HOME: + if (!begin_reached) { + begin_reached = 1; + page = buf; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + } + break; + case 'G': /* Last page */ + case KEY_END: + + end_reached = 1; + /* point to last char in buf */ + page = buf + strlen(buf); + back_lines(boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'K': /* Previous line */ + case 'k': + case KEY_UP: + if (!begin_reached) { + back_lines(page_length + 1); + + /* We don't call print_page() here but use + * scrolling to ensure faster screen update. + * However, 'end_reached' and 'page_length' + * should still be updated, and 'page' should + * point to start of next page. This is done + * by calling get_line() in the following + * 'for' loop. */ + scrollok(box, TRUE); + wscrl(box, -1); /* Scroll box region down one line */ + scrollok(box, FALSE); + page_length = 0; + passed_end = 0; + for (i = 0; i < boxh; i++) { + if (!i) { + /* print first line of page */ + print_line(box, 0, boxw); + wnoutrefresh(box); + } else + /* Called to update 'end_reached' and 'page' */ + get_line(); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case 'B': /* Previous page */ + case 'b': + case KEY_PPAGE: + if (begin_reached) + break; + back_lines(page_length + boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'J': /* Next line */ + case 'j': + case KEY_DOWN: + if (!end_reached) { + begin_reached = 0; + scrollok(box, TRUE); + scroll(box); /* Scroll box region up one line */ + scrollok(box, FALSE); + print_line(box, boxh - 1, boxw); + wnoutrefresh(box); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case KEY_NPAGE: /* Next page */ + case ' ': + if (end_reached) + break; + + begin_reached = 0; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case '0': /* Beginning of line */ + case 'H': /* Scroll left */ + case 'h': + case KEY_LEFT: + if (hscroll <= 0) + break; + + if (key == '0') + hscroll = 0; + else + hscroll--; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'L': /* Scroll right */ + case 'l': + case KEY_RIGHT: + if (hscroll >= MAX_LEN) + break; + hscroll++; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + back_lines(height); + delwin(box); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + delwin(box); + delwin(dialog); + return key; /* ESC pressed */ +} + +/* + * Go back 'n' lines in text. Called by dialog_textbox(). + * 'page' will be updated to point to the desired line in 'buf'. + */ +static void back_lines(int n) +{ + int i; + + begin_reached = 0; + /* Go back 'n' lines */ + for (i = 0; i < n; i++) { + if (*page == '\0') { + if (end_reached) { + end_reached = 0; + continue; + } + } + if (page == buf) { + begin_reached = 1; + return; + } + page--; + do { + if (page == buf) { + begin_reached = 1; + return; + } + page--; + } while (*page != '\n'); + page++; + } +} + +/* + * Print a new page of text. Called by dialog_textbox(). + */ +static void print_page(WINDOW * win, int height, int width) +{ + int i, passed_end = 0; + + page_length = 0; + for (i = 0; i < height; i++) { + print_line(win, i, width); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + wnoutrefresh(win); +} + +/* + * Print a new line of text. Called by dialog_textbox() and print_page(). + */ +static void print_line(WINDOW * win, int row, int width) +{ + int y, x; + char *line; + + line = get_line(); + line += MIN(strlen(line), hscroll); /* Scroll horizontally */ + wmove(win, row, 0); /* move cursor to correct line */ + waddch(win, ' '); + waddnstr(win, line, MIN(strlen(line), width - 2)); + + getyx(win, y, x); + /* Clear 'residue' of previous line */ +#if OLD_NCURSES + { + int i; + for (i = 0; i < width - x; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif +} + +/* + * Return current line of text. Called by dialog_textbox() and print_line(). + * 'page' should point to start of current line before calling, and will be + * updated to point to start of next line. + */ +static char *get_line(void) +{ + int i = 0; + static char line[MAX_LEN + 1]; + + end_reached = 0; + while (*page != '\n') { + if (*page == '\0') { + if (!end_reached) { + end_reached = 1; + break; + } + } else if (i < MAX_LEN) + line[i++] = *(page++); + else { + /* Truncate lines longer than MAX_LEN characters */ + if (i == MAX_LEN) + line[i++] = '\0'; + page++; + } + } + if (i <= MAX_LEN) + line[i] = '\0'; + if (!end_reached) + page++; /* move pass '\n' */ + + return line; +} + +/* + * Print current position + */ +static void print_position(WINDOW * win) +{ + int percent; + + wattrset(win, dlg.position_indicator.atr); + wbkgdset(win, dlg.position_indicator.atr & A_COLOR); + percent = (page - buf) * 100 / strlen(buf); + wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); + wprintw(win, "(%3d%%)", percent); +} diff --git a/i386/config/lxdialog/.svn/text-base/util.c.svn-base b/i386/config/lxdialog/.svn/text-base/util.c.svn-base new file mode 100644 index 0000000..f2375ad --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/util.c.svn-base @@ -0,0 +1,657 @@ +/* + * util.c + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#include "dialog.h" + +struct dialog_info dlg; + +static void set_mono_theme(void) +{ + dlg.screen.atr = A_NORMAL; + dlg.shadow.atr = A_NORMAL; + dlg.dialog.atr = A_NORMAL; + dlg.title.atr = A_BOLD; + dlg.border.atr = A_NORMAL; + dlg.button_active.atr = A_REVERSE; + dlg.button_inactive.atr = A_DIM; + dlg.button_key_active.atr = A_REVERSE; + dlg.button_key_inactive.atr = A_BOLD; + dlg.button_label_active.atr = A_REVERSE; + dlg.button_label_inactive.atr = A_NORMAL; + dlg.inputbox.atr = A_NORMAL; + dlg.inputbox_border.atr = A_NORMAL; + dlg.searchbox.atr = A_NORMAL; + dlg.searchbox_title.atr = A_BOLD; + dlg.searchbox_border.atr = A_NORMAL; + dlg.position_indicator.atr = A_BOLD; + dlg.menubox.atr = A_NORMAL; + dlg.menubox_border.atr = A_NORMAL; + dlg.item.atr = A_NORMAL; + dlg.item_selected.atr = A_REVERSE; + dlg.tag.atr = A_BOLD; + dlg.tag_selected.atr = A_REVERSE; + dlg.tag_key.atr = A_BOLD; + dlg.tag_key_selected.atr = A_REVERSE; + dlg.check.atr = A_BOLD; + dlg.check_selected.atr = A_REVERSE; + dlg.uarrow.atr = A_BOLD; + dlg.darrow.atr = A_BOLD; +} + +#define DLG_COLOR(dialog, f, b, h) \ +do { \ + dlg.dialog.fg = (f); \ + dlg.dialog.bg = (b); \ + dlg.dialog.hl = (h); \ +} while (0) + +static void set_classic_theme(void) +{ + DLG_COLOR(screen, COLOR_CYAN, COLOR_BLUE, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, true); + DLG_COLOR(dialog, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(button_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_inactive, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(button_key_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_WHITE, false); + DLG_COLOR(button_label_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_WHITE, true); + DLG_COLOR(inputbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(inputbox_border, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(searchbox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(menubox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(menubox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(item, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(tag, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(tag_key, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(check, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(check_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(uarrow, COLOR_GREEN, COLOR_WHITE, true); + DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true); +} + +static void set_blackbg_theme(void) +{ + DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false); + DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(button_active, COLOR_YELLOW, COLOR_RED, false); + DLG_COLOR(button_inactive, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_RED, false); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(inputbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(inputbox_border, COLOR_YELLOW, COLOR_BLACK, false); + + DLG_COLOR(searchbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_BLACK, true); + DLG_COLOR(searchbox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(position_indicator, COLOR_RED, COLOR_BLACK, false); + + DLG_COLOR(menubox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(menubox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(item, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_RED, false); + + DLG_COLOR(tag, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(tag_key, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(check, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(check_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(uarrow, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(darrow, COLOR_RED, COLOR_BLACK, false); +} + +static void set_bluetitle_theme(void) +{ + set_classic_theme(); + DLG_COLOR(title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(searchbox_title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag_key, COLOR_BLUE, COLOR_WHITE, true); + +} + +/* + * Select color theme + */ +static int set_theme(const char *theme) +{ + int use_color = 1; + if (!theme) + set_bluetitle_theme(); + else if (strcmp(theme, "classic") == 0) + set_classic_theme(); + else if (strcmp(theme, "bluetitle") == 0) + set_bluetitle_theme(); + else if (strcmp(theme, "blackbg") == 0) + set_blackbg_theme(); + else if (strcmp(theme, "mono") == 0) + use_color = 0; + + return use_color; +} + +static void init_one_color(struct dialog_color *color) +{ + static int pair = 0; + + pair++; + init_pair(pair, color->fg, color->bg); + if (color->hl) + color->atr = A_BOLD | COLOR_PAIR(pair); + else + color->atr = COLOR_PAIR(pair); +} + +static void init_dialog_colors(void) +{ + init_one_color(&dlg.screen); + init_one_color(&dlg.shadow); + init_one_color(&dlg.dialog); + init_one_color(&dlg.title); + init_one_color(&dlg.border); + init_one_color(&dlg.button_active); + init_one_color(&dlg.button_inactive); + init_one_color(&dlg.button_key_active); + init_one_color(&dlg.button_key_inactive); + init_one_color(&dlg.button_label_active); + init_one_color(&dlg.button_label_inactive); + init_one_color(&dlg.inputbox); + init_one_color(&dlg.inputbox_border); + init_one_color(&dlg.searchbox); + init_one_color(&dlg.searchbox_title); + init_one_color(&dlg.searchbox_border); + init_one_color(&dlg.position_indicator); + init_one_color(&dlg.menubox); + init_one_color(&dlg.menubox_border); + init_one_color(&dlg.item); + init_one_color(&dlg.item_selected); + init_one_color(&dlg.tag); + init_one_color(&dlg.tag_selected); + init_one_color(&dlg.tag_key); + init_one_color(&dlg.tag_key_selected); + init_one_color(&dlg.check); + init_one_color(&dlg.check_selected); + init_one_color(&dlg.uarrow); + init_one_color(&dlg.darrow); +} + +/* + * Setup for color display + */ +static void color_setup(const char *theme) +{ + int use_color; + + use_color = set_theme(theme); + if (use_color && has_colors()) { + start_color(); + init_dialog_colors(); + } else + set_mono_theme(); +} + +/* + * Set window to attribute 'attr' + */ +void attr_clear(WINDOW * win, int height, int width, chtype attr) +{ + int i, j; + + wattrset(win, attr); + for (i = 0; i < height; i++) { + wmove(win, i, 0); + for (j = 0; j < width; j++) + waddch(win, ' '); + } + touchwin(win); +} + +void dialog_clear(void) +{ + attr_clear(stdscr, LINES, COLS, dlg.screen.atr); + /* Display background title if it exists ... - SLH */ + if (dlg.backtitle != NULL) { + int i; + + wattrset(stdscr, dlg.screen.atr); + mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle); + wmove(stdscr, 1, 1); + for (i = 1; i < COLS - 1; i++) + waddch(stdscr, ACS_HLINE); + } + wnoutrefresh(stdscr); +} + +/* + * Do some initialization for dialog + */ +int init_dialog(const char *backtitle) +{ + int height, width; + + initscr(); /* Init curses */ + getmaxyx(stdscr, height, width); + if (height < 19 || width < 80) { + endwin(); + return -ERRDISPLAYTOOSMALL; + } + + dlg.backtitle = backtitle; + color_setup(getenv("MENUCONFIG_COLOR")); + + keypad(stdscr, TRUE); + cbreak(); + noecho(); + dialog_clear(); + + return 0; +} + +void set_dialog_backtitle(const char *backtitle) +{ + dlg.backtitle = backtitle; +} + +/* + * End using dialog functions. + */ +void end_dialog(int x, int y) +{ + /* move cursor back to original position */ + move(y, x); + refresh(); + endwin(); +} + +/* Print the title of the dialog. Center the title and truncate + * tile if wider than dialog (- 2 chars). + **/ +void print_title(WINDOW *dialog, const char *title, int width) +{ + if (title) { + int tlen = MIN(width - 2, strlen(title)); + wattrset(dialog, dlg.title.atr); + mvwaddch(dialog, 0, (width - tlen) / 2 - 1, ' '); + mvwaddnstr(dialog, 0, (width - tlen)/2, title, tlen); + waddch(dialog, ' '); + } +} + +/* + * Print a string of text in a window, automatically wrap around to the + * next line if the string is too long to fit on one line. Newline + * characters '\n' are replaced by spaces. We start on a new line + * if there is no room for at least 4 nonblanks following a double-space. + */ +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) +{ + int newl, cur_x, cur_y; + int i, prompt_len, room, wlen; + char tempstr[MAX_LEN + 1], *word, *sp, *sp2; + + strcpy(tempstr, prompt); + + prompt_len = strlen(tempstr); + + /* + * Remove newlines + */ + for (i = 0; i < prompt_len; i++) { + if (tempstr[i] == '\n') + tempstr[i] = ' '; + } + + if (prompt_len <= width - x * 2) { /* If prompt is short */ + wmove(win, y, (width - prompt_len) / 2); + waddstr(win, tempstr); + } else { + cur_x = x; + cur_y = y; + newl = 1; + word = tempstr; + while (word && *word) { + sp = strchr(word, ' '); + if (sp) + *sp++ = 0; + + /* Wrap to next line if either the word does not fit, + or it is the first word of a new sentence, and it is + short, and the next word does not fit. */ + room = width - cur_x; + wlen = strlen(word); + if (wlen > room || + (newl && wlen < 4 && sp + && wlen + 1 + strlen(sp) > room + && (!(sp2 = strchr(sp, ' ')) + || wlen + 1 + (sp2 - sp) > room))) { + cur_y++; + cur_x = x; + } + wmove(win, cur_y, cur_x); + waddstr(win, word); + getyx(win, cur_y, cur_x); + cur_x++; + if (sp && *sp == ' ') { + cur_x++; /* double space */ + while (*++sp == ' ') ; + newl = 1; + } else + newl = 0; + word = sp; + } + } +} + +/* + * Print a button + */ +void print_button(WINDOW * win, const char *label, int y, int x, int selected) +{ + int i, temp; + + wmove(win, y, x); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, "<"); + temp = strspn(label, " "); + label += temp; + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + for (i = 0; i < temp; i++) + waddch(win, ' '); + wattrset(win, selected ? dlg.button_key_active.atr + : dlg.button_key_inactive.atr); + waddch(win, label[0]); + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + waddstr(win, (char *)label + 1); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, ">"); + wmove(win, y, x + temp + 1); +} + +/* + * Draw a rectangular box with line drawing characters + */ +void +draw_box(WINDOW * win, int y, int x, int height, int width, + chtype box, chtype border) +{ + int i, j; + + wattrset(win, 0); + for (i = 0; i < height; i++) { + wmove(win, y + i, x); + for (j = 0; j < width; j++) + if (!i && !j) + waddch(win, border | ACS_ULCORNER); + else if (i == height - 1 && !j) + waddch(win, border | ACS_LLCORNER); + else if (!i && j == width - 1) + waddch(win, box | ACS_URCORNER); + else if (i == height - 1 && j == width - 1) + waddch(win, box | ACS_LRCORNER); + else if (!i) + waddch(win, border | ACS_HLINE); + else if (i == height - 1) + waddch(win, box | ACS_HLINE); + else if (!j) + waddch(win, border | ACS_VLINE); + else if (j == width - 1) + waddch(win, box | ACS_VLINE); + else + waddch(win, box | ' '); + } +} + +/* + * Draw shadows along the right and bottom edge to give a more 3D look + * to the boxes + */ +void draw_shadow(WINDOW * win, int y, int x, int height, int width) +{ + int i; + + if (has_colors()) { /* Whether terminal supports color? */ + wattrset(win, dlg.shadow.atr); + wmove(win, y + height, x + 2); + for (i = 0; i < width; i++) + waddch(win, winch(win) & A_CHARTEXT); + for (i = y + 1; i < y + height + 1; i++) { + wmove(win, i, x + width); + waddch(win, winch(win) & A_CHARTEXT); + waddch(win, winch(win) & A_CHARTEXT); + } + wnoutrefresh(win); + } +} + +/* + * Return the position of the first alphabetic character in a string. + */ +int first_alpha(const char *string, const char *exempt) +{ + int i, in_paren = 0, c; + + for (i = 0; i < strlen(string); i++) { + c = tolower(string[i]); + + if (strchr("<[(", c)) + ++in_paren; + if (strchr(">])", c) && in_paren > 0) + --in_paren; + + if ((!in_paren) && isalpha(c) && strchr(exempt, c) == 0) + return i; + } + + return 0; +} + +/* + * ncurses uses ESC to detect escaped char sequences. This resutl in + * a small timeout before ESC is actually delivered to the application. + * lxdialog suggest which is correctly translated to two + * times esc. But then we need to ignore the second esc to avoid stepping + * out one menu too much. Filter away all escaped key sequences since + * keypad(FALSE) turn off ncurses support for escape sequences - and thats + * needed to make notimeout() do as expected. + */ +int on_key_esc(WINDOW *win) +{ + int key; + int key2; + int key3; + + nodelay(win, TRUE); + keypad(win, FALSE); + key = wgetch(win); + key2 = wgetch(win); + do { + key3 = wgetch(win); + } while (key3 != ERR); + nodelay(win, FALSE); + keypad(win, TRUE); + if (key == KEY_ESC && key2 == ERR) + return KEY_ESC; + else if (key != ERR && key != KEY_ESC && key2 == ERR) + ungetch(key); + + return -1; +} + +/* redraw screen in new size */ +int on_key_resize(void) +{ + dialog_clear(); + return KEY_RESIZE; +} + +struct dialog_list *item_cur; +struct dialog_list item_nil; +struct dialog_list *item_head; + +void item_reset(void) +{ + struct dialog_list *p, *next; + + for (p = item_head; p; p = next) { + next = p->next; + free(p); + } + item_head = NULL; + item_cur = &item_nil; +} + +void item_make(const char *fmt, ...) +{ + va_list ap; + struct dialog_list *p = malloc(sizeof(*p)); + + if (item_head) + item_cur->next = p; + else + item_head = p; + item_cur = p; + memset(p, 0, sizeof(*p)); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str, sizeof(item_cur->node.str), fmt, ap); + va_end(ap); +} + +void item_add_str(const char *fmt, ...) +{ + va_list ap; + size_t avail; + + avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str + strlen(item_cur->node.str), + avail, fmt, ap); + item_cur->node.str[sizeof(item_cur->node.str) - 1] = '\0'; + va_end(ap); +} + +void item_set_tag(char tag) +{ + item_cur->node.tag = tag; +} +void item_set_data(void *ptr) +{ + item_cur->node.data = ptr; +} + +void item_set_selected(int val) +{ + item_cur->node.selected = val; +} + +int item_activate_selected(void) +{ + item_foreach() + if (item_is_selected()) + return 1; + return 0; +} + +void *item_data(void) +{ + return item_cur->node.data; +} + +char item_tag(void) +{ + return item_cur->node.tag; +} + +int item_count(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) + n++; + return n; +} + +void item_set(int n) +{ + int i = 0; + item_foreach() + if (i++ == n) + return; +} + +int item_n(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) { + if (p == item_cur) + return n; + n++; + } + return 0; +} + +const char *item_str(void) +{ + return item_cur->node.str; +} + +int item_is_selected(void) +{ + return (item_cur->node.selected != 0); +} + +int item_is_tag(char tag) +{ + return (item_cur->node.tag == tag); +} diff --git a/i386/config/lxdialog/.svn/text-base/yesno.c.svn-base b/i386/config/lxdialog/.svn/text-base/yesno.c.svn-base new file mode 100644 index 0000000..4e6e809 --- /dev/null +++ b/i386/config/lxdialog/.svn/text-base/yesno.c.svn-base @@ -0,0 +1,114 @@ +/* + * yesno.c -- implements the yes/no box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +/* + * Display termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 10; + int y = height - 2; + + print_button(dialog, gettext(" Yes "), y, x, selected == 0); + print_button(dialog, gettext(" No "), y, x + 13, selected == 1); + + wmove(dialog, y, x + 1 + 13 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with two buttons - Yes and No + */ +int dialog_yesno(const char *title, const char *prompt, int height, int width) +{ + int i, x, y, key = 0, button = 0; + WINDOW *dialog; + +do_resize: + if (getmaxy(stdscr) < (height + 4)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 4)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + print_buttons(dialog, height, width, 0); + + while (key != KEY_ESC) { + key = wgetch(dialog); + switch (key) { + case 'Y': + case 'y': + delwin(dialog); + return 0; + case 'N': + case 'n': + delwin(dialog); + return 1; + + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case ' ': + case '\n': + delwin(dialog); + return button; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/BIG.FAT.WARNING b/i386/config/lxdialog/BIG.FAT.WARNING new file mode 100644 index 0000000..a8999d8 --- /dev/null +++ b/i386/config/lxdialog/BIG.FAT.WARNING @@ -0,0 +1,4 @@ +This is NOT the official version of dialog. This version has been +significantly modified from the original. It is for use by the Linux +kernel configuration script. Please do not bother Savio Lam with +questions about this program. diff --git a/i386/config/lxdialog/check-lxdialog.sh b/i386/config/lxdialog/check-lxdialog.sh new file mode 100755 index 0000000..82cc3a8 --- /dev/null +++ b/i386/config/lxdialog/check-lxdialog.sh @@ -0,0 +1,84 @@ +#!/bin/sh +# Check ncurses compatibility + +# What library to link +ldflags() +{ + for ext in so a dylib ; do + for lib in ncursesw ncurses curses ; do + $cc -print-file-name=lib${lib}.${ext} | grep -q / + if [ $? -eq 0 ]; then + echo "-l${lib}" + exit + fi + done + done + exit 1 +} + +# Where is ncurses.h? +ccflags() +{ + if [ -f /usr/include/ncurses/ncurses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses/curses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses.h ]; then + echo '-DCURSES_LOC=""' + else + echo '-DCURSES_LOC=""' + fi +} + +# Temp file, try to clean up after us +tmp=.lxdialog.tmp +trap "rm -f $tmp" 0 1 2 3 15 + +# Check if we can link to ncurses +check() { + $cc -xc - -o $tmp 2>/dev/null <<'EOF' +#include CURSES_LOC +main() {} +EOF + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries or the" 1>&2 + echo " *** required header files." 1>&2 + echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 + echo " *** " 1>&2 + exit 1 + fi +} + +usage() { + printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n" +} + +if [ $# -eq 0 ]; then + usage + exit 1 +fi + +cc="" +case "$1" in + "-check") + shift + cc="$@" + check + ;; + "-ccflags") + ccflags + ;; + "-ldflags") + shift + cc="$@" + ldflags + ;; + "*") + usage + exit 1 + ;; +esac diff --git a/i386/config/lxdialog/checklist.c b/i386/config/lxdialog/checklist.c new file mode 100644 index 0000000..a2eb80f --- /dev/null +++ b/i386/config/lxdialog/checklist.c @@ -0,0 +1,332 @@ +/* + * checklist.c -- implements the checklist box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension + * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static int list_width, check_x, item_x; + +/* + * Print list item + */ +static void print_item(WINDOW * win, int choice, int selected) +{ + int i; + char *list_item = malloc(list_width + 1); + + strncpy(list_item, item_str(), list_width - item_x); + list_item[list_width - item_x] = '\0'; + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, choice, 0); + for (i = 0; i < list_width; i++) + waddch(win, ' '); + + wmove(win, choice, check_x); + wattrset(win, selected ? dlg.check_selected.atr + : dlg.check.atr); + if (!item_is_tag(':')) + wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' '); + + wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr); + mvwaddch(win, choice, item_x, list_item[0]); + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + waddstr(win, list_item + 1); + if (selected) { + wmove(win, choice, check_x + 1); + wrefresh(win); + } + free(list_item); +} + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int choice, int item_no, int scroll, + int y, int x, int height) +{ + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + + if ((height < item_no) && (scroll + choice < item_no - 1)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } +} + +/* + * Display the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext("Select"), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with a list of options that can be turned on or off + * in the style of radiolist (only one option turned on at a time). + */ +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height) +{ + int i, x, y, box_x, box_y; + int key = 0, button = 0, choice = 0, scroll = 0, max_choice; + WINDOW *dialog, *list; + + /* which item to highlight */ + item_foreach() { + if (item_is_tag('X')) + choice = item_n(); + if (item_is_selected()) { + choice = item_n(); + break; + } + } + +do_resize: + if (getmaxy(stdscr) < (height + 6)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 6)) + return -ERRDISPLAYTOOSMALL; + + max_choice = MIN(list_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + list_width = width - 6; + box_y = height - list_height - 5; + box_x = (width - list_width) / 2 - 1; + + /* create new window for the list */ + list = subwin(dialog, list_height, list_width, y + box_y + 1, + x + box_x + 1); + + keypad(list, TRUE); + + /* draw a box around the list items */ + draw_box(dialog, box_y, box_x, list_height + 2, list_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + /* Find length of longest item in order to center checklist */ + check_x = 0; + item_foreach() + check_x = MAX(check_x, strlen(item_str()) + 4); + check_x = MIN(check_x, list_width); + + check_x = (list_width - check_x) / 2; + item_x = check_x + 4; + + if (choice >= list_height) { + scroll = choice - list_height + 1; + choice -= scroll; + } + + /* Print the list */ + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + print_item(list, i, i == choice); + } + + print_arrows(dialog, choice, item_count(), scroll, + box_y, box_x + check_x + 5, list_height); + + print_buttons(dialog, height, width, 0); + + wnoutrefresh(dialog); + wnoutrefresh(list); + doupdate(); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + for (i = 0; i < max_choice; i++) { + item_set(i + scroll); + if (toupper(key) == toupper(item_str()[0])) + break; + } + + if (i < max_choice || key == KEY_UP || key == KEY_DOWN || + key == '+' || key == '-') { + if (key == KEY_UP || key == '-') { + if (!choice) { + if (!scroll) + continue; + /* Scroll list down */ + if (list_height > 1) { + /* De-highlight current first item */ + item_set(scroll); + print_item(list, 0, FALSE); + scrollok(list, TRUE); + wscrl(list, -1); + scrollok(list, FALSE); + } + scroll--; + item_set(scroll); + print_item(list, 0, TRUE); + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice - 1; + } else if (key == KEY_DOWN || key == '+') { + if (choice == max_choice - 1) { + if (scroll + choice >= item_count() - 1) + continue; + /* Scroll list up */ + if (list_height > 1) { + /* De-highlight current last item before scrolling up */ + item_set(scroll + max_choice - 1); + print_item(list, + max_choice - 1, + FALSE); + scrollok(list, TRUE); + wscrl(list, 1); + scrollok(list, FALSE); + } + scroll++; + item_set(scroll + max_choice - 1); + print_item(list, max_choice - 1, TRUE); + + print_arrows(dialog, choice, item_count(), + scroll, box_y, box_x + check_x + 5, list_height); + + wnoutrefresh(dialog); + wrefresh(list); + + continue; /* wait for another key press */ + } else + i = choice + 1; + } + if (i != choice) { + /* De-highlight current item */ + item_set(scroll + choice); + print_item(list, choice, FALSE); + /* Highlight new item */ + choice = i; + item_set(scroll + choice); + print_item(list, choice, TRUE); + wnoutrefresh(dialog); + wrefresh(list); + } + continue; /* wait for another key press */ + } + switch (key) { + case 'H': + case 'h': + case '?': + button = 1; + /* fall-through */ + case 'S': + case 's': + case ' ': + case '\n': + item_foreach() + item_set_selected(0); + item_set(scroll + choice); + item_set_selected(1); + delwin(list); + delwin(dialog); + return button; + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(list); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + + /* Now, update everything... */ + doupdate(); + } + delwin(list); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/dialog.h b/i386/config/lxdialog/dialog.h new file mode 100644 index 0000000..b5211fc --- /dev/null +++ b/i386/config/lxdialog/dialog.h @@ -0,0 +1,230 @@ +/* + * dialog.h -- common declarations for all dialog modules + * + * AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef KBUILD_NO_NLS +# include +#else +# define gettext(Msgid) ((const char *) (Msgid)) +#endif + +#ifdef __sun__ +#define CURS_MACROS +#endif +#include CURSES_LOC + +/* + * Colors in ncurses 1.9.9e do not work properly since foreground and + * background colors are OR'd rather than separately masked. This version + * of dialog was hacked to work with ncurses 1.9.9e, making it incompatible + * with standard curses. The simplest fix (to make this work with standard + * curses) uses the wbkgdset() function, not used in the original hack. + * Turn it off if we're building with 1.9.9e, since it just confuses things. + */ +#if defined(NCURSES_VERSION) && defined(_NEED_WRAP) && !defined(GCC_PRINTFLIKE) +#define OLD_NCURSES 1 +#undef wbkgdset +#define wbkgdset(w,p) /*nothing */ +#else +#define OLD_NCURSES 0 +#endif + +#define TR(params) _tracef params + +#define KEY_ESC 27 +#define TAB 9 +#define MAX_LEN 2048 +#define BUF_SIZE (10*1024) +#define MIN(x,y) (x < y ? x : y) +#define MAX(x,y) (x > y ? x : y) + +#ifndef ACS_ULCORNER +#define ACS_ULCORNER '+' +#endif +#ifndef ACS_LLCORNER +#define ACS_LLCORNER '+' +#endif +#ifndef ACS_URCORNER +#define ACS_URCORNER '+' +#endif +#ifndef ACS_LRCORNER +#define ACS_LRCORNER '+' +#endif +#ifndef ACS_HLINE +#define ACS_HLINE '-' +#endif +#ifndef ACS_VLINE +#define ACS_VLINE '|' +#endif +#ifndef ACS_LTEE +#define ACS_LTEE '+' +#endif +#ifndef ACS_RTEE +#define ACS_RTEE '+' +#endif +#ifndef ACS_UARROW +#define ACS_UARROW '^' +#endif +#ifndef ACS_DARROW +#define ACS_DARROW 'v' +#endif + +/* error return codes */ +#define ERRDISPLAYTOOSMALL (KEY_MAX + 1) + +/* + * Color definitions + */ +struct dialog_color { + chtype atr; /* Color attribute */ + int fg; /* foreground */ + int bg; /* background */ + int hl; /* highlight this item */ +}; + +struct dialog_info { + const char *backtitle; + struct dialog_color screen; + struct dialog_color shadow; + struct dialog_color dialog; + struct dialog_color title; + struct dialog_color border; + struct dialog_color button_active; + struct dialog_color button_inactive; + struct dialog_color button_key_active; + struct dialog_color button_key_inactive; + struct dialog_color button_label_active; + struct dialog_color button_label_inactive; + struct dialog_color inputbox; + struct dialog_color inputbox_border; + struct dialog_color searchbox; + struct dialog_color searchbox_title; + struct dialog_color searchbox_border; + struct dialog_color position_indicator; + struct dialog_color menubox; + struct dialog_color menubox_border; + struct dialog_color item; + struct dialog_color item_selected; + struct dialog_color tag; + struct dialog_color tag_selected; + struct dialog_color tag_key; + struct dialog_color tag_key_selected; + struct dialog_color check; + struct dialog_color check_selected; + struct dialog_color uarrow; + struct dialog_color darrow; +}; + +/* + * Global variables + */ +extern struct dialog_info dlg; +extern char dialog_input_result[]; + +/* + * Function prototypes + */ + +/* item list as used by checklist and menubox */ +void item_reset(void); +void item_make(const char *fmt, ...); +void item_add_str(const char *fmt, ...); +void item_set_tag(char tag); +void item_set_data(void *p); +void item_set_selected(int val); +int item_activate_selected(void); +void *item_data(void); +char item_tag(void); + +/* item list manipulation for lxdialog use */ +#define MAXITEMSTR 200 +struct dialog_item { + char str[MAXITEMSTR]; /* promtp displayed */ + char tag; + void *data; /* pointer to menu item - used by menubox+checklist */ + int selected; /* Set to 1 by dialog_*() function if selected. */ +}; + +/* list of lialog_items */ +struct dialog_list { + struct dialog_item node; + struct dialog_list *next; +}; + +extern struct dialog_list *item_cur; +extern struct dialog_list item_nil; +extern struct dialog_list *item_head; + +int item_count(void); +void item_set(int n); +int item_n(void); +const char *item_str(void); +int item_is_selected(void); +int item_is_tag(char tag); +#define item_foreach() \ + for (item_cur = item_head ? item_head: item_cur; \ + item_cur && (item_cur != &item_nil); item_cur = item_cur->next) + +/* generic key handlers */ +int on_key_esc(WINDOW *win); +int on_key_resize(void); + +int init_dialog(const char *backtitle); +void set_dialog_backtitle(const char *backtitle); +void end_dialog(int x, int y); +void attr_clear(WINDOW * win, int height, int width, chtype attr); +void dialog_clear(void); +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x); +void print_button(WINDOW * win, const char *label, int y, int x, int selected); +void print_title(WINDOW *dialog, const char *title, int width); +void draw_box(WINDOW * win, int y, int x, int height, int width, chtype box, + chtype border); +void draw_shadow(WINDOW * win, int y, int x, int height, int width); + +int first_alpha(const char *string, const char *exempt); +int dialog_yesno(const char *title, const char *prompt, int height, int width); +int dialog_msgbox(const char *title, const char *prompt, int height, + int width, int pause); +int dialog_textbox(const char *title, const char *file, int height, int width); +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll); +int dialog_checklist(const char *title, const char *prompt, int height, + int width, int list_height); +extern char dialog_input_result[]; +int dialog_inputbox(const char *title, const char *prompt, int height, + int width, const char *init); + +/* + * This is the base for fictitious keys, which activate + * the buttons. + * + * Mouse-generated keys are the following: + * -- the first 32 are used as numbers, in addition to '0'-'9' + * -- the lowercase are used to signal mouse-enter events (M_EVENT + 'o') + * -- uppercase chars are used to invoke the button (M_EVENT + 'O') + */ +#define M_EVENT (KEY_MAX+1) diff --git a/i386/config/lxdialog/inputbox.c b/i386/config/lxdialog/inputbox.c new file mode 100644 index 0000000..dd8e587 --- /dev/null +++ b/i386/config/lxdialog/inputbox.c @@ -0,0 +1,238 @@ +/* + * inputbox.c -- implements the input box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +char dialog_input_result[MAX_LEN + 1]; + +/* + * Print the termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 11; + int y = height - 2; + + print_button(dialog, gettext(" Ok "), y, x, selected == 0); + print_button(dialog, gettext(" Help "), y, x + 14, selected == 1); + + wmove(dialog, y, x + 1 + 14 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box for inputing a string + */ +int dialog_inputbox(const char *title, const char *prompt, int height, int width, + const char *init) +{ + int i, x, y, box_y, box_x, box_width; + int input_x = 0, scroll = 0, key = 0, button = -1; + char *instr = dialog_input_result; + WINDOW *dialog; + + if (!init) + instr[0] = '\0'; + else + strcpy(instr, init); + +do_resize: + if (getmaxy(stdscr) <= (height - 2)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) <= (width - 2)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + /* Draw the input field box */ + box_width = width - 6; + getyx(dialog, y, x); + box_y = y + 2; + box_x = (width - box_width) / 2; + draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2, + dlg.dialog.atr, dlg.border.atr); + + print_buttons(dialog, height, width, 0); + + /* Set up the initial value */ + wmove(dialog, box_y, box_x); + wattrset(dialog, dlg.inputbox.atr); + + input_x = strlen(instr); + + if (input_x >= box_width) { + scroll = input_x - box_width + 1; + input_x = box_width - 1; + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr[scroll + i]); + } else { + waddstr(dialog, instr); + } + + wmove(dialog, box_y, box_x + input_x); + + wrefresh(dialog); + + while (key != KEY_ESC) { + key = wgetch(dialog); + + if (button == -1) { /* Input box selected */ + switch (key) { + case TAB: + case KEY_UP: + case KEY_DOWN: + break; + case KEY_LEFT: + continue; + case KEY_RIGHT: + continue; + case KEY_BACKSPACE: + case 127: + if (input_x || scroll) { + wattrset(dialog, dlg.inputbox.atr); + if (!input_x) { + scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, + instr[scroll + input_x + i] ? + instr[scroll + input_x + i] : ' '); + input_x = strlen(instr) - scroll; + } else + input_x--; + instr[scroll + input_x] = '\0'; + mvwaddch(dialog, box_y, input_x + box_x, ' '); + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + continue; + default: + if (key < 0x100 && isprint(key)) { + if (scroll + input_x < MAX_LEN) { + wattrset(dialog, dlg.inputbox.atr); + instr[scroll + input_x] = key; + instr[scroll + input_x + 1] = '\0'; + if (input_x == box_width - 1) { + scroll++; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr [scroll + i]); + } else { + wmove(dialog, box_y, input_x++ + box_x); + waddch(dialog, key); + } + wrefresh(dialog); + } else + flash(); /* Alarm user about overflow */ + continue; + } + } + } + switch (key) { + case 'O': + case 'o': + delwin(dialog); + return 0; + case 'H': + case 'h': + delwin(dialog); + return 1; + case KEY_UP: + case KEY_LEFT: + switch (button) { + case -1: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 0: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + case 1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + } + break; + case TAB: + case KEY_DOWN: + case KEY_RIGHT: + switch (button) { + case -1: + button = 0; /* Indicates "OK" button is selected */ + print_buttons(dialog, height, width, 0); + break; + case 0: + button = 1; /* Indicates "Help" button is selected */ + print_buttons(dialog, height, width, 1); + break; + case 1: + button = -1; /* Indicates input box is selected */ + print_buttons(dialog, height, width, 0); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + } + break; + case ' ': + case '\n': + delwin(dialog); + return (button == -1 ? 0 : button); + case 'X': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return KEY_ESC; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/menubox.c b/i386/config/lxdialog/menubox.c new file mode 100644 index 0000000..1d60473 --- /dev/null +++ b/i386/config/lxdialog/menubox.c @@ -0,0 +1,434 @@ +/* + * menubox.c -- implements the menu box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Changes by Clifford Wolf (god@clifford.at) + * + * [ 1998-06-13 ] + * + * *) A bugfix for the Page-Down problem + * + * *) Formerly when I used Page Down and Page Up, the cursor would be set + * to the first position in the menu box. Now lxdialog is a bit + * smarter and works more like other menu systems (just have a look at + * it). + * + * *) Formerly if I selected something my scrolling would be broken because + * lxdialog is re-invoked by the Menuconfig shell script, can't + * remember the last scrolling position, and just sets it so that the + * cursor is at the bottom of the box. Now it writes the temporary file + * lxdialog.scrltmp which contains this information. The file is + * deleted by lxdialog if the user leaves a submenu or enters a new + * one, but it would be nice if Menuconfig could make another "rm -f" + * just to be sure. Just try it out - you will recognise a difference! + * + * [ 1998-06-14 ] + * + * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files + * and menus change their size on the fly. + * + * *) If for some reason the last scrolling position is not saved by + * lxdialog, it sets the scrolling so that the selected item is in the + * middle of the menu box, not at the bottom. + * + * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) + * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus. + * This fixes a bug in Menuconfig where using ' ' to descend into menus + * would leave mis-synchronized lxdialog.scrltmp files lying around, + * fscanf would read in 'scroll', and eventually that value would get used. + */ + +#include "dialog.h" + +static int menu_width, item_x; + +/* + * Print menu item + */ +static void do_print_item(WINDOW * win, const char *item, int line_y, + int selected, int hotkey) +{ + int j; + char *menu_item = malloc(menu_width + 1); + + strncpy(menu_item, item, menu_width - item_x); + menu_item[menu_width - item_x] = '\0'; + j = first_alpha(menu_item, "YyNnMmHh"); + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, line_y, 0); +#if OLD_NCURSES + { + int i; + for (i = 0; i < menu_width; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + mvwaddstr(win, line_y, item_x, menu_item); + if (hotkey) { + wattrset(win, selected ? dlg.tag_key_selected.atr + : dlg.tag_key.atr); + mvwaddch(win, line_y, item_x + j, menu_item[j]); + } + if (selected) { + wmove(win, line_y, item_x + 1); + } + free(menu_item); + wrefresh(win); +} + +#define print_item(index, choice, selected) \ +do { \ + item_set(index); \ + do_print_item(menu, item_str(), choice, selected, !item_is_tag(':')); \ +} while (0) + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x, + int height) +{ + int cur_y, cur_x; + + getyx(win, cur_y, cur_x); + + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + wrefresh(win); + + if ((height < item_no) && (scroll + height < item_no)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + wmove(win, cur_y, cur_x); + wrefresh(win); +} + +/* + * Display the termination buttons. + */ +static void print_buttons(WINDOW * win, int height, int width, int selected) +{ + int x = width / 2 - 16; + int y = height - 2; + + print_button(win, gettext("Select"), y, x, selected == 0); + print_button(win, gettext(" Exit "), y, x + 12, selected == 1); + print_button(win, gettext(" Help "), y, x + 24, selected == 2); + + wmove(win, y, x + 1 + 12 * selected); + wrefresh(win); +} + +/* scroll up n lines (n may be negative) */ +static void do_scroll(WINDOW *win, int *scroll, int n) +{ + /* Scroll menu up */ + scrollok(win, TRUE); + wscrl(win, n); + scrollok(win, FALSE); + *scroll = *scroll + n; + wrefresh(win); +} + +/* + * Display a menu for choosing among a number of options + */ +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll) +{ + int i, j, x, y, box_x, box_y; + int height, width, menu_height; + int key = 0, button = 0, scroll = 0, choice = 0; + int first_item = 0, max_choice; + WINDOW *dialog, *menu; + +do_resize: + height = getmaxy(stdscr); + width = getmaxx(stdscr); + if (height < 15 || width < 65) + return -ERRDISPLAYTOOSMALL; + + height -= 4; + width -= 5; + menu_height = height - 10; + + max_choice = MIN(menu_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + menu_width = width - 6; + box_y = height - menu_height - 5; + box_x = (width - menu_width) / 2 - 1; + + /* create new window for the menu */ + menu = subwin(dialog, menu_height, menu_width, + y + box_y + 1, x + box_x + 1); + keypad(menu, TRUE); + + /* draw a box around the menu items */ + draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + if (menu_width >= 80) + item_x = (menu_width - 70) / 2; + else + item_x = 4; + + /* Set choice to default item */ + item_foreach() + if (selected && (selected == item_data())) + choice = item_n(); + /* get the saved scroll info */ + scroll = *s_scroll; + if ((scroll <= choice) && (scroll + max_choice > choice) && + (scroll >= 0) && (scroll + max_choice <= item_count())) { + first_item = scroll; + choice = choice - scroll; + } else { + scroll = 0; + } + if ((choice >= max_choice)) { + if (choice >= item_count() - max_choice / 2) + scroll = first_item = item_count() - max_choice; + else + scroll = first_item = choice - max_choice / 2; + choice = choice - scroll; + } + + /* Print the menu */ + for (i = 0; i < max_choice; i++) { + print_item(first_item + i, i, i == choice); + } + + wnoutrefresh(menu); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + print_buttons(dialog, height, width, 0); + wmove(menu, choice, item_x + 1); + wrefresh(menu); + + while (key != KEY_ESC) { + key = wgetch(menu); + + if (key < 256 && isalpha(key)) + key = tolower(key); + + if (strchr("ynmh", key)) + i = max_choice; + else { + for (i = choice + 1; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + if (i == max_choice) + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + } + + if (i < max_choice || + key == KEY_UP || key == KEY_DOWN || + key == '-' || key == '+' || + key == KEY_PPAGE || key == KEY_NPAGE) { + /* Remove highligt of current item */ + print_item(scroll + choice, choice, FALSE); + + if (key == KEY_UP || key == '-') { + if (choice < 2 && scroll) { + /* Scroll menu down */ + do_scroll(menu, &scroll, -1); + + print_item(scroll, 0, FALSE); + } else + choice = MAX(choice - 1, 0); + + } else if (key == KEY_DOWN || key == '+') { + print_item(scroll+choice, choice, FALSE); + + if ((choice > max_choice - 3) && + (scroll + max_choice < item_count())) { + /* Scroll menu up */ + do_scroll(menu, &scroll, 1); + + print_item(scroll+max_choice - 1, + max_choice - 1, FALSE); + } else + choice = MIN(choice + 1, max_choice - 1); + + } else if (key == KEY_PPAGE) { + scrollok(menu, TRUE); + for (i = 0; (i < max_choice); i++) { + if (scroll > 0) { + do_scroll(menu, &scroll, -1); + print_item(scroll, 0, FALSE); + } else { + if (choice > 0) + choice--; + } + } + + } else if (key == KEY_NPAGE) { + for (i = 0; (i < max_choice); i++) { + if (scroll + max_choice < item_count()) { + do_scroll(menu, &scroll, 1); + print_item(scroll+max_choice-1, + max_choice - 1, FALSE); + } else { + if (choice + 1 < max_choice) + choice++; + } + } + } else + choice = i; + + print_item(scroll + choice, choice, TRUE); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + wnoutrefresh(dialog); + wrefresh(menu); + + continue; /* wait for another key press */ + } + + switch (key) { + case KEY_LEFT: + case TAB: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 2 : (button > 2 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(menu); + break; + case ' ': + case 's': + case 'y': + case 'n': + case 'm': + case '/': + case 'h': + case '?': + case 'z': + case '\n': + /* save scroll info */ + *s_scroll = scroll; + delwin(menu); + delwin(dialog); + item_set(scroll + choice); + item_set_selected(1); + switch (key) { + case 'h': + case '?': + return 2; + case 's': + case 'y': + return 3; + case 'n': + return 4; + case 'm': + return 5; + case ' ': + return 6; + case '/': + return 7; + case 'z': + return 8; + case '\n': + return button; + } + return 0; + case 'e': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(menu); + break; + case KEY_RESIZE: + on_key_resize(); + delwin(menu); + delwin(dialog); + goto do_resize; + } + } + delwin(menu); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/lxdialog/textbox.c b/i386/config/lxdialog/textbox.c new file mode 100644 index 0000000..c704712 --- /dev/null +++ b/i386/config/lxdialog/textbox.c @@ -0,0 +1,391 @@ +/* + * textbox.c -- implements the text box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static void back_lines(int n); +static void print_page(WINDOW * win, int height, int width); +static void print_line(WINDOW * win, int row, int width); +static char *get_line(void); +static void print_position(WINDOW * win); + +static int hscroll; +static int begin_reached, end_reached, page_length; +static const char *buf; +static const char *page; + +/* + * refresh window content + */ +static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, + int cur_y, int cur_x) +{ + print_page(box, boxh, boxw); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); +} + + +/* + * Display text from a file in a dialog box. + */ +int dialog_textbox(const char *title, const char *tbuf, + int initial_height, int initial_width) +{ + int i, x, y, cur_x, cur_y, key = 0; + int height, width, boxh, boxw; + int passed_end; + WINDOW *dialog, *box; + + begin_reached = 1; + end_reached = 0; + page_length = 0; + hscroll = 0; + buf = tbuf; + page = buf; /* page is pointer to start of page to be displayed */ + +do_resize: + getmaxyx(stdscr, height, width); + if (height < 8 || width < 8) + return -ERRDISPLAYTOOSMALL; + if (initial_height != 0) + height = initial_height; + else + if (height > 4) + height -= 4; + else + height = 0; + if (initial_width != 0) + width = initial_width; + else + if (width > 5) + width -= 5; + else + width = 0; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + /* Create window for box region, used for scrolling text */ + boxh = height - 4; + boxw = width - 2; + box = subwin(dialog, boxh, boxw, y + 1, x + 1); + wattrset(box, dlg.dialog.atr); + wbkgdset(box, dlg.dialog.atr & A_COLOR); + + keypad(box, TRUE); + + /* register the new window, along with its borders */ + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE); + wnoutrefresh(dialog); + getyx(dialog, cur_y, cur_x); /* Save cursor position */ + + /* Print first page of text */ + attr_clear(box, boxh, boxw, dlg.dialog.atr); + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); + + while ((key != KEY_ESC) && (key != '\n')) { + key = wgetch(dialog); + switch (key) { + case 'E': /* Exit */ + case 'e': + case 'X': + case 'x': + delwin(box); + delwin(dialog); + return 0; + case 'g': /* First page */ + case KEY_HOME: + if (!begin_reached) { + begin_reached = 1; + page = buf; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + } + break; + case 'G': /* Last page */ + case KEY_END: + + end_reached = 1; + /* point to last char in buf */ + page = buf + strlen(buf); + back_lines(boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'K': /* Previous line */ + case 'k': + case KEY_UP: + if (!begin_reached) { + back_lines(page_length + 1); + + /* We don't call print_page() here but use + * scrolling to ensure faster screen update. + * However, 'end_reached' and 'page_length' + * should still be updated, and 'page' should + * point to start of next page. This is done + * by calling get_line() in the following + * 'for' loop. */ + scrollok(box, TRUE); + wscrl(box, -1); /* Scroll box region down one line */ + scrollok(box, FALSE); + page_length = 0; + passed_end = 0; + for (i = 0; i < boxh; i++) { + if (!i) { + /* print first line of page */ + print_line(box, 0, boxw); + wnoutrefresh(box); + } else + /* Called to update 'end_reached' and 'page' */ + get_line(); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case 'B': /* Previous page */ + case 'b': + case KEY_PPAGE: + if (begin_reached) + break; + back_lines(page_length + boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'J': /* Next line */ + case 'j': + case KEY_DOWN: + if (!end_reached) { + begin_reached = 0; + scrollok(box, TRUE); + scroll(box); /* Scroll box region up one line */ + scrollok(box, FALSE); + print_line(box, boxh - 1, boxw); + wnoutrefresh(box); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case KEY_NPAGE: /* Next page */ + case ' ': + if (end_reached) + break; + + begin_reached = 0; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case '0': /* Beginning of line */ + case 'H': /* Scroll left */ + case 'h': + case KEY_LEFT: + if (hscroll <= 0) + break; + + if (key == '0') + hscroll = 0; + else + hscroll--; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'L': /* Scroll right */ + case 'l': + case KEY_RIGHT: + if (hscroll >= MAX_LEN) + break; + hscroll++; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + back_lines(height); + delwin(box); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + delwin(box); + delwin(dialog); + return key; /* ESC pressed */ +} + +/* + * Go back 'n' lines in text. Called by dialog_textbox(). + * 'page' will be updated to point to the desired line in 'buf'. + */ +static void back_lines(int n) +{ + int i; + + begin_reached = 0; + /* Go back 'n' lines */ + for (i = 0; i < n; i++) { + if (*page == '\0') { + if (end_reached) { + end_reached = 0; + continue; + } + } + if (page == buf) { + begin_reached = 1; + return; + } + page--; + do { + if (page == buf) { + begin_reached = 1; + return; + } + page--; + } while (*page != '\n'); + page++; + } +} + +/* + * Print a new page of text. Called by dialog_textbox(). + */ +static void print_page(WINDOW * win, int height, int width) +{ + int i, passed_end = 0; + + page_length = 0; + for (i = 0; i < height; i++) { + print_line(win, i, width); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + wnoutrefresh(win); +} + +/* + * Print a new line of text. Called by dialog_textbox() and print_page(). + */ +static void print_line(WINDOW * win, int row, int width) +{ + int y, x; + char *line; + + line = get_line(); + line += MIN(strlen(line), hscroll); /* Scroll horizontally */ + wmove(win, row, 0); /* move cursor to correct line */ + waddch(win, ' '); + waddnstr(win, line, MIN(strlen(line), width - 2)); + + getyx(win, y, x); + /* Clear 'residue' of previous line */ +#if OLD_NCURSES + { + int i; + for (i = 0; i < width - x; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif +} + +/* + * Return current line of text. Called by dialog_textbox() and print_line(). + * 'page' should point to start of current line before calling, and will be + * updated to point to start of next line. + */ +static char *get_line(void) +{ + int i = 0; + static char line[MAX_LEN + 1]; + + end_reached = 0; + while (*page != '\n') { + if (*page == '\0') { + if (!end_reached) { + end_reached = 1; + break; + } + } else if (i < MAX_LEN) + line[i++] = *(page++); + else { + /* Truncate lines longer than MAX_LEN characters */ + if (i == MAX_LEN) + line[i++] = '\0'; + page++; + } + } + if (i <= MAX_LEN) + line[i] = '\0'; + if (!end_reached) + page++; /* move pass '\n' */ + + return line; +} + +/* + * Print current position + */ +static void print_position(WINDOW * win) +{ + int percent; + + wattrset(win, dlg.position_indicator.atr); + wbkgdset(win, dlg.position_indicator.atr & A_COLOR); + percent = (page - buf) * 100 / strlen(buf); + wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); + wprintw(win, "(%3d%%)", percent); +} diff --git a/i386/config/lxdialog/util.c b/i386/config/lxdialog/util.c new file mode 100644 index 0000000..f2375ad --- /dev/null +++ b/i386/config/lxdialog/util.c @@ -0,0 +1,657 @@ +/* + * util.c + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#include "dialog.h" + +struct dialog_info dlg; + +static void set_mono_theme(void) +{ + dlg.screen.atr = A_NORMAL; + dlg.shadow.atr = A_NORMAL; + dlg.dialog.atr = A_NORMAL; + dlg.title.atr = A_BOLD; + dlg.border.atr = A_NORMAL; + dlg.button_active.atr = A_REVERSE; + dlg.button_inactive.atr = A_DIM; + dlg.button_key_active.atr = A_REVERSE; + dlg.button_key_inactive.atr = A_BOLD; + dlg.button_label_active.atr = A_REVERSE; + dlg.button_label_inactive.atr = A_NORMAL; + dlg.inputbox.atr = A_NORMAL; + dlg.inputbox_border.atr = A_NORMAL; + dlg.searchbox.atr = A_NORMAL; + dlg.searchbox_title.atr = A_BOLD; + dlg.searchbox_border.atr = A_NORMAL; + dlg.position_indicator.atr = A_BOLD; + dlg.menubox.atr = A_NORMAL; + dlg.menubox_border.atr = A_NORMAL; + dlg.item.atr = A_NORMAL; + dlg.item_selected.atr = A_REVERSE; + dlg.tag.atr = A_BOLD; + dlg.tag_selected.atr = A_REVERSE; + dlg.tag_key.atr = A_BOLD; + dlg.tag_key_selected.atr = A_REVERSE; + dlg.check.atr = A_BOLD; + dlg.check_selected.atr = A_REVERSE; + dlg.uarrow.atr = A_BOLD; + dlg.darrow.atr = A_BOLD; +} + +#define DLG_COLOR(dialog, f, b, h) \ +do { \ + dlg.dialog.fg = (f); \ + dlg.dialog.bg = (b); \ + dlg.dialog.hl = (h); \ +} while (0) + +static void set_classic_theme(void) +{ + DLG_COLOR(screen, COLOR_CYAN, COLOR_BLUE, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, true); + DLG_COLOR(dialog, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(button_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_inactive, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(button_key_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_WHITE, false); + DLG_COLOR(button_label_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_WHITE, true); + DLG_COLOR(inputbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(inputbox_border, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(searchbox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(menubox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(menubox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(item, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(tag, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(tag_key, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(check, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(check_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(uarrow, COLOR_GREEN, COLOR_WHITE, true); + DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true); +} + +static void set_blackbg_theme(void) +{ + DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false); + DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(button_active, COLOR_YELLOW, COLOR_RED, false); + DLG_COLOR(button_inactive, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_RED, false); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(inputbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(inputbox_border, COLOR_YELLOW, COLOR_BLACK, false); + + DLG_COLOR(searchbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_BLACK, true); + DLG_COLOR(searchbox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(position_indicator, COLOR_RED, COLOR_BLACK, false); + + DLG_COLOR(menubox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(menubox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(item, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_RED, false); + + DLG_COLOR(tag, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(tag_key, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(check, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(check_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(uarrow, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(darrow, COLOR_RED, COLOR_BLACK, false); +} + +static void set_bluetitle_theme(void) +{ + set_classic_theme(); + DLG_COLOR(title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(searchbox_title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag_key, COLOR_BLUE, COLOR_WHITE, true); + +} + +/* + * Select color theme + */ +static int set_theme(const char *theme) +{ + int use_color = 1; + if (!theme) + set_bluetitle_theme(); + else if (strcmp(theme, "classic") == 0) + set_classic_theme(); + else if (strcmp(theme, "bluetitle") == 0) + set_bluetitle_theme(); + else if (strcmp(theme, "blackbg") == 0) + set_blackbg_theme(); + else if (strcmp(theme, "mono") == 0) + use_color = 0; + + return use_color; +} + +static void init_one_color(struct dialog_color *color) +{ + static int pair = 0; + + pair++; + init_pair(pair, color->fg, color->bg); + if (color->hl) + color->atr = A_BOLD | COLOR_PAIR(pair); + else + color->atr = COLOR_PAIR(pair); +} + +static void init_dialog_colors(void) +{ + init_one_color(&dlg.screen); + init_one_color(&dlg.shadow); + init_one_color(&dlg.dialog); + init_one_color(&dlg.title); + init_one_color(&dlg.border); + init_one_color(&dlg.button_active); + init_one_color(&dlg.button_inactive); + init_one_color(&dlg.button_key_active); + init_one_color(&dlg.button_key_inactive); + init_one_color(&dlg.button_label_active); + init_one_color(&dlg.button_label_inactive); + init_one_color(&dlg.inputbox); + init_one_color(&dlg.inputbox_border); + init_one_color(&dlg.searchbox); + init_one_color(&dlg.searchbox_title); + init_one_color(&dlg.searchbox_border); + init_one_color(&dlg.position_indicator); + init_one_color(&dlg.menubox); + init_one_color(&dlg.menubox_border); + init_one_color(&dlg.item); + init_one_color(&dlg.item_selected); + init_one_color(&dlg.tag); + init_one_color(&dlg.tag_selected); + init_one_color(&dlg.tag_key); + init_one_color(&dlg.tag_key_selected); + init_one_color(&dlg.check); + init_one_color(&dlg.check_selected); + init_one_color(&dlg.uarrow); + init_one_color(&dlg.darrow); +} + +/* + * Setup for color display + */ +static void color_setup(const char *theme) +{ + int use_color; + + use_color = set_theme(theme); + if (use_color && has_colors()) { + start_color(); + init_dialog_colors(); + } else + set_mono_theme(); +} + +/* + * Set window to attribute 'attr' + */ +void attr_clear(WINDOW * win, int height, int width, chtype attr) +{ + int i, j; + + wattrset(win, attr); + for (i = 0; i < height; i++) { + wmove(win, i, 0); + for (j = 0; j < width; j++) + waddch(win, ' '); + } + touchwin(win); +} + +void dialog_clear(void) +{ + attr_clear(stdscr, LINES, COLS, dlg.screen.atr); + /* Display background title if it exists ... - SLH */ + if (dlg.backtitle != NULL) { + int i; + + wattrset(stdscr, dlg.screen.atr); + mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle); + wmove(stdscr, 1, 1); + for (i = 1; i < COLS - 1; i++) + waddch(stdscr, ACS_HLINE); + } + wnoutrefresh(stdscr); +} + +/* + * Do some initialization for dialog + */ +int init_dialog(const char *backtitle) +{ + int height, width; + + initscr(); /* Init curses */ + getmaxyx(stdscr, height, width); + if (height < 19 || width < 80) { + endwin(); + return -ERRDISPLAYTOOSMALL; + } + + dlg.backtitle = backtitle; + color_setup(getenv("MENUCONFIG_COLOR")); + + keypad(stdscr, TRUE); + cbreak(); + noecho(); + dialog_clear(); + + return 0; +} + +void set_dialog_backtitle(const char *backtitle) +{ + dlg.backtitle = backtitle; +} + +/* + * End using dialog functions. + */ +void end_dialog(int x, int y) +{ + /* move cursor back to original position */ + move(y, x); + refresh(); + endwin(); +} + +/* Print the title of the dialog. Center the title and truncate + * tile if wider than dialog (- 2 chars). + **/ +void print_title(WINDOW *dialog, const char *title, int width) +{ + if (title) { + int tlen = MIN(width - 2, strlen(title)); + wattrset(dialog, dlg.title.atr); + mvwaddch(dialog, 0, (width - tlen) / 2 - 1, ' '); + mvwaddnstr(dialog, 0, (width - tlen)/2, title, tlen); + waddch(dialog, ' '); + } +} + +/* + * Print a string of text in a window, automatically wrap around to the + * next line if the string is too long to fit on one line. Newline + * characters '\n' are replaced by spaces. We start on a new line + * if there is no room for at least 4 nonblanks following a double-space. + */ +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) +{ + int newl, cur_x, cur_y; + int i, prompt_len, room, wlen; + char tempstr[MAX_LEN + 1], *word, *sp, *sp2; + + strcpy(tempstr, prompt); + + prompt_len = strlen(tempstr); + + /* + * Remove newlines + */ + for (i = 0; i < prompt_len; i++) { + if (tempstr[i] == '\n') + tempstr[i] = ' '; + } + + if (prompt_len <= width - x * 2) { /* If prompt is short */ + wmove(win, y, (width - prompt_len) / 2); + waddstr(win, tempstr); + } else { + cur_x = x; + cur_y = y; + newl = 1; + word = tempstr; + while (word && *word) { + sp = strchr(word, ' '); + if (sp) + *sp++ = 0; + + /* Wrap to next line if either the word does not fit, + or it is the first word of a new sentence, and it is + short, and the next word does not fit. */ + room = width - cur_x; + wlen = strlen(word); + if (wlen > room || + (newl && wlen < 4 && sp + && wlen + 1 + strlen(sp) > room + && (!(sp2 = strchr(sp, ' ')) + || wlen + 1 + (sp2 - sp) > room))) { + cur_y++; + cur_x = x; + } + wmove(win, cur_y, cur_x); + waddstr(win, word); + getyx(win, cur_y, cur_x); + cur_x++; + if (sp && *sp == ' ') { + cur_x++; /* double space */ + while (*++sp == ' ') ; + newl = 1; + } else + newl = 0; + word = sp; + } + } +} + +/* + * Print a button + */ +void print_button(WINDOW * win, const char *label, int y, int x, int selected) +{ + int i, temp; + + wmove(win, y, x); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, "<"); + temp = strspn(label, " "); + label += temp; + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + for (i = 0; i < temp; i++) + waddch(win, ' '); + wattrset(win, selected ? dlg.button_key_active.atr + : dlg.button_key_inactive.atr); + waddch(win, label[0]); + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + waddstr(win, (char *)label + 1); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, ">"); + wmove(win, y, x + temp + 1); +} + +/* + * Draw a rectangular box with line drawing characters + */ +void +draw_box(WINDOW * win, int y, int x, int height, int width, + chtype box, chtype border) +{ + int i, j; + + wattrset(win, 0); + for (i = 0; i < height; i++) { + wmove(win, y + i, x); + for (j = 0; j < width; j++) + if (!i && !j) + waddch(win, border | ACS_ULCORNER); + else if (i == height - 1 && !j) + waddch(win, border | ACS_LLCORNER); + else if (!i && j == width - 1) + waddch(win, box | ACS_URCORNER); + else if (i == height - 1 && j == width - 1) + waddch(win, box | ACS_LRCORNER); + else if (!i) + waddch(win, border | ACS_HLINE); + else if (i == height - 1) + waddch(win, box | ACS_HLINE); + else if (!j) + waddch(win, border | ACS_VLINE); + else if (j == width - 1) + waddch(win, box | ACS_VLINE); + else + waddch(win, box | ' '); + } +} + +/* + * Draw shadows along the right and bottom edge to give a more 3D look + * to the boxes + */ +void draw_shadow(WINDOW * win, int y, int x, int height, int width) +{ + int i; + + if (has_colors()) { /* Whether terminal supports color? */ + wattrset(win, dlg.shadow.atr); + wmove(win, y + height, x + 2); + for (i = 0; i < width; i++) + waddch(win, winch(win) & A_CHARTEXT); + for (i = y + 1; i < y + height + 1; i++) { + wmove(win, i, x + width); + waddch(win, winch(win) & A_CHARTEXT); + waddch(win, winch(win) & A_CHARTEXT); + } + wnoutrefresh(win); + } +} + +/* + * Return the position of the first alphabetic character in a string. + */ +int first_alpha(const char *string, const char *exempt) +{ + int i, in_paren = 0, c; + + for (i = 0; i < strlen(string); i++) { + c = tolower(string[i]); + + if (strchr("<[(", c)) + ++in_paren; + if (strchr(">])", c) && in_paren > 0) + --in_paren; + + if ((!in_paren) && isalpha(c) && strchr(exempt, c) == 0) + return i; + } + + return 0; +} + +/* + * ncurses uses ESC to detect escaped char sequences. This resutl in + * a small timeout before ESC is actually delivered to the application. + * lxdialog suggest which is correctly translated to two + * times esc. But then we need to ignore the second esc to avoid stepping + * out one menu too much. Filter away all escaped key sequences since + * keypad(FALSE) turn off ncurses support for escape sequences - and thats + * needed to make notimeout() do as expected. + */ +int on_key_esc(WINDOW *win) +{ + int key; + int key2; + int key3; + + nodelay(win, TRUE); + keypad(win, FALSE); + key = wgetch(win); + key2 = wgetch(win); + do { + key3 = wgetch(win); + } while (key3 != ERR); + nodelay(win, FALSE); + keypad(win, TRUE); + if (key == KEY_ESC && key2 == ERR) + return KEY_ESC; + else if (key != ERR && key != KEY_ESC && key2 == ERR) + ungetch(key); + + return -1; +} + +/* redraw screen in new size */ +int on_key_resize(void) +{ + dialog_clear(); + return KEY_RESIZE; +} + +struct dialog_list *item_cur; +struct dialog_list item_nil; +struct dialog_list *item_head; + +void item_reset(void) +{ + struct dialog_list *p, *next; + + for (p = item_head; p; p = next) { + next = p->next; + free(p); + } + item_head = NULL; + item_cur = &item_nil; +} + +void item_make(const char *fmt, ...) +{ + va_list ap; + struct dialog_list *p = malloc(sizeof(*p)); + + if (item_head) + item_cur->next = p; + else + item_head = p; + item_cur = p; + memset(p, 0, sizeof(*p)); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str, sizeof(item_cur->node.str), fmt, ap); + va_end(ap); +} + +void item_add_str(const char *fmt, ...) +{ + va_list ap; + size_t avail; + + avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str + strlen(item_cur->node.str), + avail, fmt, ap); + item_cur->node.str[sizeof(item_cur->node.str) - 1] = '\0'; + va_end(ap); +} + +void item_set_tag(char tag) +{ + item_cur->node.tag = tag; +} +void item_set_data(void *ptr) +{ + item_cur->node.data = ptr; +} + +void item_set_selected(int val) +{ + item_cur->node.selected = val; +} + +int item_activate_selected(void) +{ + item_foreach() + if (item_is_selected()) + return 1; + return 0; +} + +void *item_data(void) +{ + return item_cur->node.data; +} + +char item_tag(void) +{ + return item_cur->node.tag; +} + +int item_count(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) + n++; + return n; +} + +void item_set(int n) +{ + int i = 0; + item_foreach() + if (i++ == n) + return; +} + +int item_n(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) { + if (p == item_cur) + return n; + n++; + } + return 0; +} + +const char *item_str(void) +{ + return item_cur->node.str; +} + +int item_is_selected(void) +{ + return (item_cur->node.selected != 0); +} + +int item_is_tag(char tag) +{ + return (item_cur->node.tag == tag); +} diff --git a/i386/config/lxdialog/yesno.c b/i386/config/lxdialog/yesno.c new file mode 100644 index 0000000..4e6e809 --- /dev/null +++ b/i386/config/lxdialog/yesno.c @@ -0,0 +1,114 @@ +/* + * yesno.c -- implements the yes/no box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +/* + * Display termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 10; + int y = height - 2; + + print_button(dialog, gettext(" Yes "), y, x, selected == 0); + print_button(dialog, gettext(" No "), y, x + 13, selected == 1); + + wmove(dialog, y, x + 1 + 13 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with two buttons - Yes and No + */ +int dialog_yesno(const char *title, const char *prompt, int height, int width) +{ + int i, x, y, key = 0, button = 0; + WINDOW *dialog; + +do_resize: + if (getmaxy(stdscr) < (height + 4)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 4)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + print_buttons(dialog, height, width, 0); + + while (key != KEY_ESC) { + key = wgetch(dialog); + switch (key) { + case 'Y': + case 'y': + delwin(dialog); + return 0; + case 'N': + case 'n': + delwin(dialog); + return 1; + + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case ' ': + case '\n': + delwin(dialog); + return button; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/menu.c b/i386/config/menu.c new file mode 100644 index 0000000..48d9f20 --- /dev/null +++ b/i386/config/menu.c @@ -0,0 +1,608 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +static const char nohelp_text[] = N_( + "There is no help available for this option.\n"); + +struct menu rootmenu; +static struct menu **last_entry_ptr; + +struct file *file_list; +struct file *current_file; + +void menu_warn(struct menu *menu, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +static void prop_warn(struct property *prop, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "%s:%d:warning: ", prop->file->name, prop->lineno); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); +} + +void _menu_init(void) +{ + current_entry = current_menu = &rootmenu; + last_entry_ptr = &rootmenu.list; +} + +void menu_add_entry(struct symbol *sym) +{ + struct menu *menu; + + menu = malloc(sizeof(*menu)); + memset(menu, 0, sizeof(*menu)); + menu->sym = sym; + menu->parent = current_menu; + menu->file = current_file; + menu->lineno = zconf_lineno(); + + *last_entry_ptr = menu; + last_entry_ptr = &menu->next; + current_entry = menu; + if (sym) + menu_add_symbol(P_SYMBOL, sym, NULL); +} + +void menu_end_entry(void) +{ +} + +struct menu *menu_add_menu(void) +{ + menu_end_entry(); + last_entry_ptr = ¤t_entry->list; + return current_menu = current_entry; +} + +void menu_end_menu(void) +{ + last_entry_ptr = ¤t_menu->next; + current_menu = current_menu->parent; +} + +static struct expr *menu_check_dep(struct expr *e) +{ + if (!e) + return e; + + switch (e->type) { + case E_NOT: + e->left.expr = menu_check_dep(e->left.expr); + break; + case E_OR: + case E_AND: + e->left.expr = menu_check_dep(e->left.expr); + e->right.expr = menu_check_dep(e->right.expr); + break; + case E_SYMBOL: + /* change 'm' into 'm' && MODULES */ + if (e->left.sym == &symbol_mod) + return expr_alloc_and(e, expr_alloc_symbol(modules_sym)); + break; + default: + break; + } + return e; +} + +void menu_add_dep(struct expr *dep) +{ + current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); +} + +void menu_set_type(int type) +{ + struct symbol *sym = current_entry->sym; + + if (sym->type == type) + return; + if (sym->type == S_UNKNOWN) { + sym->type = type; + return; + } + menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'", + sym->name ? sym->name : "", + sym_type_name(sym->type), sym_type_name(type)); +} + +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep) +{ + struct property *prop = prop_alloc(type, current_entry->sym); + + prop->menu = current_entry; + prop->expr = expr; + prop->visible.expr = menu_check_dep(dep); + + if (prompt) { + if (isspace(*prompt)) { + prop_warn(prop, "leading whitespace ignored"); + while (isspace(*prompt)) + prompt++; + } + if (current_entry->prompt && current_entry != &rootmenu) + prop_warn(prop, "prompt redefined"); + + /* Apply all upper menus' visibilities to actual prompts. */ + if(type == P_PROMPT) { + struct menu *menu = current_entry; + + while ((menu = menu->parent) != NULL) { + if (!menu->visibility) + continue; + prop->visible.expr + = expr_alloc_and(prop->visible.expr, + menu->visibility); + } + } + + current_entry->prompt = prop; + } + prop->text = prompt; + + return prop; +} + +struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep) +{ + return menu_add_prop(type, prompt, NULL, dep); +} + +void menu_add_visibility(struct expr *expr) +{ + current_entry->visibility = expr_alloc_and(current_entry->visibility, + expr); +} + +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep) +{ + menu_add_prop(type, NULL, expr, dep); +} + +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) +{ + menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); +} + +void menu_add_option(int token, char *arg) +{ + struct property *prop; + + switch (token) { + case T_OPT_MODULES: + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(current_entry->sym); + break; + case T_OPT_DEFCONFIG_LIST: + if (!sym_defconfig_list) + sym_defconfig_list = current_entry->sym; + else if (sym_defconfig_list != current_entry->sym) + zconf_error("trying to redefine defconfig symbol"); + break; + case T_OPT_ENV: + //prop_add_env(arg); + break; + } +} + +static int menu_validate_number(struct symbol *sym, struct symbol *sym2) +{ + return sym2->type == S_INT || sym2->type == S_HEX || + (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); +} + +static void sym_check_prop(struct symbol *sym) +{ + struct property *prop; + struct symbol *sym2; + for (prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_DEFAULT: + if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && + prop->expr->type != E_SYMBOL) + prop_warn(prop, + "default for config symbol '%s'" + " must be a single symbol", sym->name); + if (prop->expr->type != E_SYMBOL) + break; + sym2 = prop_get_symbol(prop); + if (sym->type == S_HEX || sym->type == S_INT) { + if (!menu_validate_number(sym, sym2)) + prop_warn(prop, + "'%s': number is invalid", + sym->name); + } + break; + case P_SELECT: + sym2 = prop_get_symbol(prop); + if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE) + prop_warn(prop, + "config symbol '%s' uses select, but is " + "not boolean or tristate", sym->name); + else if (sym2->type != S_UNKNOWN && + sym2->type != S_BOOLEAN && + sym2->type != S_TRISTATE) + prop_warn(prop, + "'%s' has wrong type. 'select' only " + "accept arguments of boolean and " + "tristate type", sym2->name); + break; + case P_RANGE: + if (sym->type != S_INT && sym->type != S_HEX) + prop_warn(prop, "range is only allowed " + "for int or hex symbols"); + if (!menu_validate_number(sym, prop->expr->left.sym) || + !menu_validate_number(sym, prop->expr->right.sym)) + prop_warn(prop, "range is invalid"); + break; + default: + ; + } + } +} + +void menu_finalize(struct menu *parent) +{ + struct menu *menu, *last_menu; + struct symbol *sym; + struct property *prop; + struct expr *parentdep, *basedep, *dep, *dep2, **ep; + + sym = parent->sym; + if (parent->list) { + if (sym && sym_is_choice(sym)) { + if (sym->type == S_UNKNOWN) { + /* find the first choice value to find out choice type */ + current_entry = parent; + for (menu = parent->list; menu; menu = menu->next) { + if (menu->sym && menu->sym->type != S_UNKNOWN) { + menu_set_type(menu->sym->type); + break; + } + } + } + /* set the type of the remaining choice values */ + for (menu = parent->list; menu; menu = menu->next) { + current_entry = menu; + if (menu->sym && menu->sym->type == S_UNKNOWN) + menu_set_type(sym->type); + } + parentdep = expr_alloc_symbol(sym); + } else if (parent->prompt) + parentdep = parent->prompt->visible.expr; + else + parentdep = parent->dep; + + for (menu = parent->list; menu; menu = menu->next) { + basedep = expr_transform(menu->dep); + basedep = expr_alloc_and(expr_copy(parentdep), basedep); + basedep = expr_eliminate_dups(basedep); + menu->dep = basedep; + if (menu->sym) + prop = menu->sym->prop; + else + prop = menu->prompt; + for (; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + dep = expr_transform(prop->visible.expr); + dep = expr_alloc_and(expr_copy(basedep), dep); + dep = expr_eliminate_dups(dep); + if (menu->sym && menu->sym->type != S_TRISTATE) + dep = expr_trans_bool(dep); + prop->visible.expr = dep; + if (prop->type == P_SELECT) { + struct symbol *es = prop_get_symbol(prop); + es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr, + expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); + } + } + } + for (menu = parent->list; menu; menu = menu->next) + menu_finalize(menu); + } else if (sym) { + basedep = parent->prompt ? parent->prompt->visible.expr : NULL; + basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); + basedep = expr_eliminate_dups(expr_transform(basedep)); + last_menu = NULL; + for (menu = parent->next; menu; menu = menu->next) { + dep = menu->prompt ? menu->prompt->visible.expr : menu->dep; + if (!expr_contains_symbol(dep, sym)) + break; + if (expr_depends_symbol(dep, sym)) + goto next; + dep = expr_trans_compare(dep, E_UNEQUAL, &symbol_no); + dep = expr_eliminate_dups(expr_transform(dep)); + dep2 = expr_copy(basedep); + expr_eliminate_eq(&dep, &dep2); + expr_free(dep); + if (!expr_is_yes(dep2)) { + expr_free(dep2); + break; + } + expr_free(dep2); + next: + menu_finalize(menu); + menu->parent = parent; + last_menu = menu; + } + if (last_menu) { + parent->list = parent->next; + parent->next = last_menu->next; + last_menu->next = NULL; + } + + sym->dir_dep.expr = parent->dep; + } + for (menu = parent->list; menu; menu = menu->next) { + if (sym && sym_is_choice(sym) && + menu->sym && !sym_is_choice_value(menu->sym)) { + current_entry = menu; + menu->sym->flags |= SYMBOL_CHOICEVAL; + if (!menu->prompt) + menu_warn(menu, "choice value must have a prompt"); + for (prop = menu->sym->prop; prop; prop = prop->next) { + if (prop->type == P_DEFAULT) + prop_warn(prop, "defaults for choice " + "values not supported"); + if (prop->menu == menu) + continue; + if (prop->type == P_PROMPT && + prop->menu->parent->sym != sym) + prop_warn(prop, "choice value used outside its choice group"); + } + /* Non-tristate choice values of tristate choices must + * depend on the choice being set to Y. The choice + * values' dependencies were propagated to their + * properties above, so the change here must be re- + * propagated. + */ + if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { + basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); + menu->dep = expr_alloc_and(basedep, menu->dep); + for (prop = menu->sym->prop; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + prop->visible.expr = expr_alloc_and(expr_copy(basedep), + prop->visible.expr); + } + } + menu_add_symbol(P_CHOICE, sym, NULL); + prop = sym_get_choice_prop(sym); + for (ep = &prop->expr; *ep; ep = &(*ep)->left.expr) + ; + *ep = expr_alloc_one(E_LIST, NULL); + (*ep)->right.sym = menu->sym; + } + if (menu->list && (!menu->prompt || !menu->prompt->text)) { + for (last_menu = menu->list; ; last_menu = last_menu->next) { + last_menu->parent = parent; + if (!last_menu->next) + break; + } + last_menu->next = menu->next; + menu->next = menu->list; + menu->list = NULL; + } + } + + if (sym && !(sym->flags & SYMBOL_WARNED)) { + if (sym->type == S_UNKNOWN) + menu_warn(parent, "config symbol defined without type"); + + if (sym_is_choice(sym) && !parent->prompt) + menu_warn(parent, "choice must have a prompt"); + + /* Check properties connected to this symbol */ + sym_check_prop(sym); + sym->flags |= SYMBOL_WARNED; + } + + if (sym && !sym_is_optional(sym) && parent->prompt) { + sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, + expr_alloc_and(parent->prompt->visible.expr, + expr_alloc_symbol(&symbol_mod))); + } +} + +bool menu_has_prompt(struct menu *menu) +{ + if (!menu->prompt) + return false; + return true; +} + +bool menu_is_visible(struct menu *menu) +{ + struct menu *child; + struct symbol *sym; + tristate visible; + + if (!menu->prompt) + return false; + + if (menu->visibility) { + if (expr_calc_value(menu->visibility) == no) + return no; + } + + sym = menu->sym; + if (sym) { + sym_calc_value(sym); + visible = menu->prompt->visible.tri; + } else + visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr); + + if (visible != no) + return true; + + if (!sym || sym_get_tristate_value(menu->sym) == no) + return false; + + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child)) { + if (sym) + sym->flags |= SYMBOL_DEF_USER; + return true; + } + } + + return false; +} + +const char *menu_get_prompt(struct menu *menu) +{ + if (menu->prompt) + return menu->prompt->text; + else if (menu->sym) + return menu->sym->name; + return NULL; +} + +struct menu *menu_get_root_menu(struct menu *menu) +{ + return &rootmenu; +} + +struct menu *menu_get_parent_menu(struct menu *menu) +{ + enum prop_type type; + + for (; menu != &rootmenu; menu = menu->parent) { + type = menu->prompt ? menu->prompt->type : 0; + if (type == P_MENU) + break; + } + return menu; +} + +bool menu_has_help(struct menu *menu) +{ + return menu->help != NULL; +} + +const char *menu_get_help(struct menu *menu) +{ + if (menu->help) + return menu->help; + else + return ""; +} + +static void get_prompt_str(struct gstr *r, struct property *prop) +{ + int i, j; + struct menu *submenu[8], *menu; + + str_printf(r, _("Prompt: %s\n"), _(prop->text)); + str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, + prop->menu->lineno); + if (!expr_is_yes(prop->visible.expr)) { + str_append(r, _(" Depends on: ")); + expr_gstr_print(prop->visible.expr, r); + str_append(r, "\n"); + } + menu = prop->menu->parent; + for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) + submenu[i++] = menu; + if (i > 0) { + str_printf(r, _(" Location:\n")); + for (j = 4; --i >= 0; j += 2) { + menu = submenu[i]; + str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); + if (menu->sym) { + str_printf(r, " (%s [=%s])", menu->sym->name ? + menu->sym->name : _(""), + sym_get_string_value(menu->sym)); + } + str_append(r, "\n"); + } + } +} + +void get_symbol_str(struct gstr *r, struct symbol *sym) +{ + bool hit; + struct property *prop; + + if (sym && sym->name) { + str_printf(r, "Symbol: %s [=%s]\n", sym->name, + sym_get_string_value(sym)); + str_printf(r, "Type : %s\n", sym_type_name(sym->type)); + if (sym->type == S_INT || sym->type == S_HEX) { + prop = sym_get_range_prop(sym); + if (prop) { + str_printf(r, "Range : "); + expr_gstr_print(prop->expr, r); + str_append(r, "\n"); + } + } + } + for_all_prompts(sym, prop) + get_prompt_str(r, prop); + hit = false; + for_all_properties(sym, prop, P_SELECT) { + if (!hit) { + str_append(r, " Selects: "); + hit = true; + } else + str_printf(r, " && "); + expr_gstr_print(prop->expr, r); + } + if (hit) + str_append(r, "\n"); + if (sym->rev_dep.expr) { + str_append(r, _(" Selected by: ")); + expr_gstr_print(sym->rev_dep.expr, r); + str_append(r, "\n"); + } + str_append(r, "\n\n"); +} + +struct gstr get_relations_str(struct symbol **sym_arr) +{ + struct symbol *sym; + struct gstr res = str_new(); + int i; + + for (i = 0; sym_arr && (sym = sym_arr[i]); i++) + get_symbol_str(&res, sym); + if (!i) + str_append(&res, _("No matches found.\n")); + return res; +} + + +void menu_get_ext_help(struct menu *menu, struct gstr *help) +{ + struct symbol *sym = menu->sym; + + if (menu_has_help(menu)) { + if (sym->name) { + str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); + str_append(help, _(menu_get_help(menu))); + str_append(help, "\n"); + } + } else { + str_append(help, nohelp_text); + } + if (sym) + get_symbol_str(help, sym); +} diff --git a/i386/config/menubox.c b/i386/config/menubox.c new file mode 100644 index 0000000..1d60473 --- /dev/null +++ b/i386/config/menubox.c @@ -0,0 +1,434 @@ +/* + * menubox.c -- implements the menu box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcapw@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Changes by Clifford Wolf (god@clifford.at) + * + * [ 1998-06-13 ] + * + * *) A bugfix for the Page-Down problem + * + * *) Formerly when I used Page Down and Page Up, the cursor would be set + * to the first position in the menu box. Now lxdialog is a bit + * smarter and works more like other menu systems (just have a look at + * it). + * + * *) Formerly if I selected something my scrolling would be broken because + * lxdialog is re-invoked by the Menuconfig shell script, can't + * remember the last scrolling position, and just sets it so that the + * cursor is at the bottom of the box. Now it writes the temporary file + * lxdialog.scrltmp which contains this information. The file is + * deleted by lxdialog if the user leaves a submenu or enters a new + * one, but it would be nice if Menuconfig could make another "rm -f" + * just to be sure. Just try it out - you will recognise a difference! + * + * [ 1998-06-14 ] + * + * *) Now lxdialog is crash-safe against broken "lxdialog.scrltmp" files + * and menus change their size on the fly. + * + * *) If for some reason the last scrolling position is not saved by + * lxdialog, it sets the scrolling so that the selected item is in the + * middle of the menu box, not at the bottom. + * + * 02 January 1999, Michael Elizabeth Chastain (mec@shout.net) + * Reset 'scroll' to 0 if the value from lxdialog.scrltmp is bogus. + * This fixes a bug in Menuconfig where using ' ' to descend into menus + * would leave mis-synchronized lxdialog.scrltmp files lying around, + * fscanf would read in 'scroll', and eventually that value would get used. + */ + +#include "dialog.h" + +static int menu_width, item_x; + +/* + * Print menu item + */ +static void do_print_item(WINDOW * win, const char *item, int line_y, + int selected, int hotkey) +{ + int j; + char *menu_item = malloc(menu_width + 1); + + strncpy(menu_item, item, menu_width - item_x); + menu_item[menu_width - item_x] = '\0'; + j = first_alpha(menu_item, "YyNnMmHh"); + + /* Clear 'residue' of last item */ + wattrset(win, dlg.menubox.atr); + wmove(win, line_y, 0); +#if OLD_NCURSES + { + int i; + for (i = 0; i < menu_width; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif + wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr); + mvwaddstr(win, line_y, item_x, menu_item); + if (hotkey) { + wattrset(win, selected ? dlg.tag_key_selected.atr + : dlg.tag_key.atr); + mvwaddch(win, line_y, item_x + j, menu_item[j]); + } + if (selected) { + wmove(win, line_y, item_x + 1); + } + free(menu_item); + wrefresh(win); +} + +#define print_item(index, choice, selected) \ +do { \ + item_set(index); \ + do_print_item(menu, item_str(), choice, selected, !item_is_tag(':')); \ +} while (0) + +/* + * Print the scroll indicators. + */ +static void print_arrows(WINDOW * win, int item_no, int scroll, int y, int x, + int height) +{ + int cur_y, cur_x; + + getyx(win, cur_y, cur_x); + + wmove(win, y, x); + + if (scroll > 0) { + wattrset(win, dlg.uarrow.atr); + waddch(win, ACS_UARROW); + waddstr(win, "(-)"); + } else { + wattrset(win, dlg.menubox.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + y = y + height + 1; + wmove(win, y, x); + wrefresh(win); + + if ((height < item_no) && (scroll + height < item_no)) { + wattrset(win, dlg.darrow.atr); + waddch(win, ACS_DARROW); + waddstr(win, "(+)"); + } else { + wattrset(win, dlg.menubox_border.atr); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + waddch(win, ACS_HLINE); + } + + wmove(win, cur_y, cur_x); + wrefresh(win); +} + +/* + * Display the termination buttons. + */ +static void print_buttons(WINDOW * win, int height, int width, int selected) +{ + int x = width / 2 - 16; + int y = height - 2; + + print_button(win, gettext("Select"), y, x, selected == 0); + print_button(win, gettext(" Exit "), y, x + 12, selected == 1); + print_button(win, gettext(" Help "), y, x + 24, selected == 2); + + wmove(win, y, x + 1 + 12 * selected); + wrefresh(win); +} + +/* scroll up n lines (n may be negative) */ +static void do_scroll(WINDOW *win, int *scroll, int n) +{ + /* Scroll menu up */ + scrollok(win, TRUE); + wscrl(win, n); + scrollok(win, FALSE); + *scroll = *scroll + n; + wrefresh(win); +} + +/* + * Display a menu for choosing among a number of options + */ +int dialog_menu(const char *title, const char *prompt, + const void *selected, int *s_scroll) +{ + int i, j, x, y, box_x, box_y; + int height, width, menu_height; + int key = 0, button = 0, scroll = 0, choice = 0; + int first_item = 0, max_choice; + WINDOW *dialog, *menu; + +do_resize: + height = getmaxy(stdscr); + width = getmaxx(stdscr); + if (height < 15 || width < 65) + return -ERRDISPLAYTOOSMALL; + + height -= 4; + width -= 5; + menu_height = height - 10; + + max_choice = MIN(menu_height, item_count()); + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + menu_width = width - 6; + box_y = height - menu_height - 5; + box_x = (width - menu_width) / 2 - 1; + + /* create new window for the menu */ + menu = subwin(dialog, menu_height, menu_width, + y + box_y + 1, x + box_x + 1); + keypad(menu, TRUE); + + /* draw a box around the menu items */ + draw_box(dialog, box_y, box_x, menu_height + 2, menu_width + 2, + dlg.menubox_border.atr, dlg.menubox.atr); + + if (menu_width >= 80) + item_x = (menu_width - 70) / 2; + else + item_x = 4; + + /* Set choice to default item */ + item_foreach() + if (selected && (selected == item_data())) + choice = item_n(); + /* get the saved scroll info */ + scroll = *s_scroll; + if ((scroll <= choice) && (scroll + max_choice > choice) && + (scroll >= 0) && (scroll + max_choice <= item_count())) { + first_item = scroll; + choice = choice - scroll; + } else { + scroll = 0; + } + if ((choice >= max_choice)) { + if (choice >= item_count() - max_choice / 2) + scroll = first_item = item_count() - max_choice; + else + scroll = first_item = choice - max_choice / 2; + choice = choice - scroll; + } + + /* Print the menu */ + for (i = 0; i < max_choice; i++) { + print_item(first_item + i, i, i == choice); + } + + wnoutrefresh(menu); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + print_buttons(dialog, height, width, 0); + wmove(menu, choice, item_x + 1); + wrefresh(menu); + + while (key != KEY_ESC) { + key = wgetch(menu); + + if (key < 256 && isalpha(key)) + key = tolower(key); + + if (strchr("ynmh", key)) + i = max_choice; + else { + for (i = choice + 1; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + if (i == max_choice) + for (i = 0; i < max_choice; i++) { + item_set(scroll + i); + j = first_alpha(item_str(), "YyNnMmHh"); + if (key == tolower(item_str()[j])) + break; + } + } + + if (i < max_choice || + key == KEY_UP || key == KEY_DOWN || + key == '-' || key == '+' || + key == KEY_PPAGE || key == KEY_NPAGE) { + /* Remove highligt of current item */ + print_item(scroll + choice, choice, FALSE); + + if (key == KEY_UP || key == '-') { + if (choice < 2 && scroll) { + /* Scroll menu down */ + do_scroll(menu, &scroll, -1); + + print_item(scroll, 0, FALSE); + } else + choice = MAX(choice - 1, 0); + + } else if (key == KEY_DOWN || key == '+') { + print_item(scroll+choice, choice, FALSE); + + if ((choice > max_choice - 3) && + (scroll + max_choice < item_count())) { + /* Scroll menu up */ + do_scroll(menu, &scroll, 1); + + print_item(scroll+max_choice - 1, + max_choice - 1, FALSE); + } else + choice = MIN(choice + 1, max_choice - 1); + + } else if (key == KEY_PPAGE) { + scrollok(menu, TRUE); + for (i = 0; (i < max_choice); i++) { + if (scroll > 0) { + do_scroll(menu, &scroll, -1); + print_item(scroll, 0, FALSE); + } else { + if (choice > 0) + choice--; + } + } + + } else if (key == KEY_NPAGE) { + for (i = 0; (i < max_choice); i++) { + if (scroll + max_choice < item_count()) { + do_scroll(menu, &scroll, 1); + print_item(scroll+max_choice-1, + max_choice - 1, FALSE); + } else { + if (choice + 1 < max_choice) + choice++; + } + } + } else + choice = i; + + print_item(scroll + choice, choice, TRUE); + + print_arrows(dialog, item_count(), scroll, + box_y, box_x + item_x + 1, menu_height); + + wnoutrefresh(dialog); + wrefresh(menu); + + continue; /* wait for another key press */ + } + + switch (key) { + case KEY_LEFT: + case TAB: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) + ? 2 : (button > 2 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(menu); + break; + case ' ': + case 's': + case 'y': + case 'n': + case 'm': + case '/': + case 'h': + case '?': + case 'z': + case '\n': + /* save scroll info */ + *s_scroll = scroll; + delwin(menu); + delwin(dialog); + item_set(scroll + choice); + item_set_selected(1); + switch (key) { + case 'h': + case '?': + return 2; + case 's': + case 'y': + return 3; + case 'n': + return 4; + case 'm': + return 5; + case ' ': + return 6; + case '/': + return 7; + case 'z': + return 8; + case '\n': + return button; + } + return 0; + case 'e': + case 'x': + key = KEY_ESC; + break; + case KEY_ESC: + key = on_key_esc(menu); + break; + case KEY_RESIZE: + on_key_resize(); + delwin(menu); + delwin(dialog); + goto do_resize; + } + } + delwin(menu); + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/nconf.h b/i386/config/nconf.h new file mode 100644 index 0000000..58fbda8 --- /dev/null +++ b/i386/config/nconf.h @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2008 Nir Tzachar +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ncurses.h" + +#define max(a, b) ({\ + typeof(a) _a = a;\ + typeof(b) _b = b;\ + _a > _b ? _a : _b; }) + +#define min(a, b) ({\ + typeof(a) _a = a;\ + typeof(b) _b = b;\ + _a < _b ? _a : _b; }) + +typedef enum { + NORMAL = 1, + MAIN_HEADING, + MAIN_MENU_BOX, + MAIN_MENU_FORE, + MAIN_MENU_BACK, + MAIN_MENU_GREY, + MAIN_MENU_HEADING, + SCROLLWIN_TEXT, + SCROLLWIN_HEADING, + SCROLLWIN_BOX, + DIALOG_TEXT, + DIALOG_MENU_FORE, + DIALOG_MENU_BACK, + DIALOG_BOX, + INPUT_BOX, + INPUT_HEADING, + INPUT_TEXT, + INPUT_FIELD, + FUNCTION_TEXT, + FUNCTION_HIGHLIGHT, + ATTR_MAX +} attributes_t; +extern attributes_t attributes[]; + +typedef enum { + F_HELP = 1, + F_SYMBOL = 2, + F_INSTS = 3, + F_CONF = 4, + F_BACK = 5, + F_SAVE = 6, + F_LOAD = 7, + F_SEARCH = 8, + F_EXIT = 9, +} function_key; + +void set_colors(void); + +/* this changes the windows attributes !!! */ +void print_in_middle(WINDOW *win, + int starty, + int startx, + int width, + const char *string, + chtype color); +int get_line_length(const char *line); +int get_line_no(const char *text); +const char *get_line(const char *text, int line_no); +void fill_window(WINDOW *win, const char *text); +int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...); +int dialog_inputbox(WINDOW *main_window, + const char *title, const char *prompt, + const char *init, char *result, int result_len); +void refresh_all_windows(WINDOW *main_window); +void show_scroll_win(WINDOW *main_window, + const char *title, + const char *text); diff --git a/i386/config/symbol.c b/i386/config/symbol.c new file mode 100644 index 0000000..91978a3 --- /dev/null +++ b/i386/config/symbol.c @@ -0,0 +1,1231 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +struct symbol symbol_yes = { + .name = "y", + .curr = { "y", yes }, + .flags = SYMBOL_CONST|SYMBOL_VALID, +}, symbol_mod = { + .name = "m", + .curr = { "m", mod }, + .flags = SYMBOL_CONST|SYMBOL_VALID, +}, symbol_no = { + .name = "n", + .curr = { "n", no }, + .flags = SYMBOL_CONST|SYMBOL_VALID, +}, symbol_empty = { + .name = "", + .curr = { "", no }, + .flags = SYMBOL_VALID, +}; + +struct symbol *sym_defconfig_list; +struct symbol *modules_sym; +tristate modules_val; + +struct expr *sym_env_list; + +static void sym_add_default(struct symbol *sym, const char *def) +{ + struct property *prop = prop_alloc(P_DEFAULT, sym); + + prop->expr = expr_alloc_symbol(sym_lookup(def, SYMBOL_CONST)); +} + +void sym_init(void) +{ + struct symbol *sym; + struct utsname uts; + static bool inited = false; + + if (inited) + return; + inited = true; + + uname(&uts); + + sym = sym_lookup("UNAME_RELEASE", 0); + sym->type = S_STRING; + sym->flags |= SYMBOL_AUTO; + sym_add_default(sym, uts.release); +} + +enum symbol_type sym_get_type(struct symbol *sym) +{ + enum symbol_type type = sym->type; + + if (type == S_TRISTATE) { + if (sym_is_choice_value(sym) && sym->visible == yes) + type = S_BOOLEAN; + else if (modules_val == no) + type = S_BOOLEAN; + } + return type; +} + +const char *sym_type_name(enum symbol_type type) +{ + switch (type) { + case S_BOOLEAN: + return "boolean"; + case S_TRISTATE: + return "tristate"; + case S_INT: + return "integer"; + case S_HEX: + return "hex"; + case S_STRING: + return "string"; + case S_UNKNOWN: + return "unknown"; + case S_OTHER: + break; + } + return "???"; +} + +struct property *sym_get_choice_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_choices(sym, prop) + return prop; + return NULL; +} + +struct property *sym_get_env_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_properties(sym, prop, P_ENV) + return prop; + return NULL; +} + +struct property *sym_get_default_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_defaults(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri != no) + return prop; + } + return NULL; +} + +static struct property *sym_get_range_prop(struct symbol *sym) +{ + struct property *prop; + + for_all_properties(sym, prop, P_RANGE) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri != no) + return prop; + } + return NULL; +} + +static int sym_get_range_val(struct symbol *sym, int base) +{ + sym_calc_value(sym); + switch (sym->type) { + case S_INT: + base = 10; + break; + case S_HEX: + base = 16; + break; + default: + break; + } + return strtol(sym->curr.val, NULL, base); +} + +static void sym_validate_range(struct symbol *sym) +{ + struct property *prop; + int base, val, val2; + char str[64]; + + switch (sym->type) { + case S_INT: + base = 10; + break; + case S_HEX: + base = 16; + break; + default: + return; + } + prop = sym_get_range_prop(sym); + if (!prop) + return; + val = strtol(sym->curr.val, NULL, base); + val2 = sym_get_range_val(prop->expr->left.sym, base); + if (val >= val2) { + val2 = sym_get_range_val(prop->expr->right.sym, base); + if (val <= val2) + return; + } + if (sym->type == S_INT) + sprintf(str, "%d", val2); + else + sprintf(str, "0x%x", val2); + sym->curr.val = strdup(str); +} + +static void sym_calc_visibility(struct symbol *sym) +{ + struct property *prop; + tristate tri; + + /* any prompt visible? */ + tri = no; + for_all_prompts(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + tri = EXPR_OR(tri, prop->visible.tri); + } + if (tri == mod && (sym->type != S_TRISTATE || modules_val == no)) + tri = yes; + if (sym->visible != tri) { + sym->visible = tri; + sym_set_changed(sym); + } + if (sym_is_choice_value(sym)) + return; + /* defaulting to "yes" if no explicit "depends on" are given */ + tri = yes; + if (sym->dir_dep.expr) + tri = expr_calc_value(sym->dir_dep.expr); + if (tri == mod) + tri = yes; + if (sym->dir_dep.tri != tri) { + sym->dir_dep.tri = tri; + sym_set_changed(sym); + } + tri = no; + if (sym->rev_dep.expr) + tri = expr_calc_value(sym->rev_dep.expr); + if (tri == mod && sym_get_type(sym) == S_BOOLEAN) + tri = yes; + if (sym->rev_dep.tri != tri) { + sym->rev_dep.tri = tri; + sym_set_changed(sym); + } +} + +/* + * Find the default symbol for a choice. + * First try the default values for the choice symbol + * Next locate the first visible choice value + * Return NULL if none was found + */ +struct symbol *sym_choice_default(struct symbol *sym) +{ + struct symbol *def_sym; + struct property *prop; + struct expr *e; + + /* any of the defaults visible? */ + for_all_defaults(sym, prop) { + prop->visible.tri = expr_calc_value(prop->visible.expr); + if (prop->visible.tri == no) + continue; + def_sym = prop_get_symbol(prop); + if (def_sym->visible != no) + return def_sym; + } + + /* just get the first visible value */ + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, def_sym) + if (def_sym->visible != no) + return def_sym; + + /* failed to locate any defaults */ + return NULL; +} + +static struct symbol *sym_calc_choice(struct symbol *sym) +{ + struct symbol *def_sym; + struct property *prop; + struct expr *e; + + /* first calculate all choice values' visibilities */ + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, def_sym) + sym_calc_visibility(def_sym); + + /* is the user choice visible? */ + def_sym = sym->def[S_DEF_USER].val; + if (def_sym && def_sym->visible != no) + return def_sym; + + def_sym = sym_choice_default(sym); + + if (def_sym == NULL) + /* no choice? reset tristate value */ + sym->curr.tri = no; + + return def_sym; +} + +void sym_calc_value(struct symbol *sym) +{ + struct symbol_value newval, oldval; + struct property *prop; + struct expr *e; + + if (!sym) + return; + + if (sym->flags & SYMBOL_VALID) + return; + sym->flags |= SYMBOL_VALID; + + oldval = sym->curr; + + switch (sym->type) { + case S_INT: + case S_HEX: + case S_STRING: + newval = symbol_empty.curr; + break; + case S_BOOLEAN: + case S_TRISTATE: + newval = symbol_no.curr; + break; + default: + sym->curr.val = sym->name; + sym->curr.tri = no; + return; + } + if (!sym_is_choice_value(sym)) + sym->flags &= ~SYMBOL_WRITE; + + sym_calc_visibility(sym); + + /* set default if recursively called */ + sym->curr = newval; + + switch (sym_get_type(sym)) { + case S_BOOLEAN: + case S_TRISTATE: + if (sym_is_choice_value(sym) && sym->visible == yes) { + prop = sym_get_choice_prop(sym); + newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no; + } else { + if (sym->visible != no) { + /* if the symbol is visible use the user value + * if available, otherwise try the default value + */ + sym->flags |= SYMBOL_WRITE; + if (sym_has_value(sym)) { + newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri, + sym->visible); + goto calc_newval; + } + } + if (sym->rev_dep.tri != no) + sym->flags |= SYMBOL_WRITE; + if (!sym_is_choice(sym)) { + prop = sym_get_default_prop(sym); + if (prop) { + sym->flags |= SYMBOL_WRITE; + newval.tri = EXPR_AND(expr_calc_value(prop->expr), + prop->visible.tri); + } + } + calc_newval: + if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) { + struct expr *e; + e = expr_simplify_unmet_dep(sym->rev_dep.expr, + sym->dir_dep.expr); + fprintf(stderr, "warning: ("); + expr_fprint(e, stderr); + fprintf(stderr, ") selects %s which has unmet direct dependencies (", + sym->name); + expr_fprint(sym->dir_dep.expr, stderr); + fprintf(stderr, ")\n"); + expr_free(e); + } + newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); + } + if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) + newval.tri = yes; + break; + case S_STRING: + case S_HEX: + case S_INT: + if (sym->visible != no) { + sym->flags |= SYMBOL_WRITE; + if (sym_has_value(sym)) { + newval.val = sym->def[S_DEF_USER].val; + break; + } + } + prop = sym_get_default_prop(sym); + if (prop) { + struct symbol *ds = prop_get_symbol(prop); + if (ds) { + sym->flags |= SYMBOL_WRITE; + sym_calc_value(ds); + newval.val = ds->curr.val; + } + } + break; + default: + ; + } + + sym->curr = newval; + if (sym_is_choice(sym) && newval.tri == yes) + sym->curr.val = sym_calc_choice(sym); + sym_validate_range(sym); + + if (memcmp(&oldval, &sym->curr, sizeof(oldval))) { + sym_set_changed(sym); + if (modules_sym == sym) { + sym_set_all_changed(); + modules_val = modules_sym->curr.tri; + } + } + + if (sym_is_choice(sym)) { + struct symbol *choice_sym; + + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, choice_sym) { + if ((sym->flags & SYMBOL_WRITE) && + choice_sym->visible != no) + choice_sym->flags |= SYMBOL_WRITE; + if (sym->flags & SYMBOL_CHANGED) + sym_set_changed(choice_sym); + } + } + + if (sym->flags & SYMBOL_AUTO) + sym->flags &= ~SYMBOL_WRITE; +} + +void sym_clear_all_valid(void) +{ + struct symbol *sym; + int i; + + for_all_symbols(i, sym) + sym->flags &= ~SYMBOL_VALID; + sym_add_change_count(1); + if (modules_sym) + sym_calc_value(modules_sym); +} + +void sym_set_changed(struct symbol *sym) +{ + struct property *prop; + + sym->flags |= SYMBOL_CHANGED; + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->menu) + prop->menu->flags |= MENU_CHANGED; + } +} + +void sym_set_all_changed(void) +{ + struct symbol *sym; + int i; + + for_all_symbols(i, sym) + sym_set_changed(sym); +} + +bool sym_tristate_within_range(struct symbol *sym, tristate val) +{ + int type = sym_get_type(sym); + + if (sym->visible == no) + return false; + + if (type != S_BOOLEAN && type != S_TRISTATE) + return false; + + if (type == S_BOOLEAN && val == mod) + return false; + if (sym->visible <= sym->rev_dep.tri) + return false; + if (sym_is_choice_value(sym) && sym->visible == yes) + return val == yes; + return val >= sym->rev_dep.tri && val <= sym->visible; +} + +bool sym_set_tristate_value(struct symbol *sym, tristate val) +{ + tristate oldval = sym_get_tristate_value(sym); + + if (oldval != val && !sym_tristate_within_range(sym, val)) + return false; + + if (!(sym->flags & SYMBOL_DEF_USER)) { + sym->flags |= SYMBOL_DEF_USER; + sym_set_changed(sym); + } + /* + * setting a choice value also resets the new flag of the choice + * symbol and all other choice values. + */ + if (sym_is_choice_value(sym) && val == yes) { + struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); + struct property *prop; + struct expr *e; + + cs->def[S_DEF_USER].val = sym; + cs->flags |= SYMBOL_DEF_USER; + prop = sym_get_choice_prop(cs); + for (e = prop->expr; e; e = e->left.expr) { + if (e->right.sym->visible != no) + e->right.sym->flags |= SYMBOL_DEF_USER; + } + } + + sym->def[S_DEF_USER].tri = val; + if (oldval != val) + sym_clear_all_valid(); + + return true; +} + +tristate sym_toggle_tristate_value(struct symbol *sym) +{ + tristate oldval, newval; + + oldval = newval = sym_get_tristate_value(sym); + do { + switch (newval) { + case no: + newval = mod; + break; + case mod: + newval = yes; + break; + case yes: + newval = no; + break; + } + if (sym_set_tristate_value(sym, newval)) + break; + } while (oldval != newval); + return newval; +} + +bool sym_string_valid(struct symbol *sym, const char *str) +{ + signed char ch; + + switch (sym->type) { + case S_STRING: + return true; + case S_INT: + ch = *str++; + if (ch == '-') + ch = *str++; + if (!isdigit(ch)) + return false; + if (ch == '0' && *str != 0) + return false; + while ((ch = *str++)) { + if (!isdigit(ch)) + return false; + } + return true; + case S_HEX: + if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) + str += 2; + ch = *str++; + do { + if (!isxdigit(ch)) + return false; + } while ((ch = *str++)); + return true; + case S_BOOLEAN: + case S_TRISTATE: + switch (str[0]) { + case 'y': case 'Y': + case 'm': case 'M': + case 'n': case 'N': + return true; + } + return false; + default: + return false; + } +} + +bool sym_string_within_range(struct symbol *sym, const char *str) +{ + struct property *prop; + int val; + + switch (sym->type) { + case S_STRING: + return sym_string_valid(sym, str); + case S_INT: + if (!sym_string_valid(sym, str)) + return false; + prop = sym_get_range_prop(sym); + if (!prop) + return true; + val = strtol(str, NULL, 10); + return val >= sym_get_range_val(prop->expr->left.sym, 10) && + val <= sym_get_range_val(prop->expr->right.sym, 10); + case S_HEX: + if (!sym_string_valid(sym, str)) + return false; + prop = sym_get_range_prop(sym); + if (!prop) + return true; + val = strtol(str, NULL, 16); + return val >= sym_get_range_val(prop->expr->left.sym, 16) && + val <= sym_get_range_val(prop->expr->right.sym, 16); + case S_BOOLEAN: + case S_TRISTATE: + switch (str[0]) { + case 'y': case 'Y': + return sym_tristate_within_range(sym, yes); + case 'm': case 'M': + return sym_tristate_within_range(sym, mod); + case 'n': case 'N': + return sym_tristate_within_range(sym, no); + } + return false; + default: + return false; + } +} + +bool sym_set_string_value(struct symbol *sym, const char *newval) +{ + const char *oldval; + char *val; + int size; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (newval[0]) { + case 'y': case 'Y': + return sym_set_tristate_value(sym, yes); + case 'm': case 'M': + return sym_set_tristate_value(sym, mod); + case 'n': case 'N': + return sym_set_tristate_value(sym, no); + } + return false; + default: + ; + } + + if (!sym_string_within_range(sym, newval)) + return false; + + if (!(sym->flags & SYMBOL_DEF_USER)) { + sym->flags |= SYMBOL_DEF_USER; + sym_set_changed(sym); + } + + oldval = sym->def[S_DEF_USER].val; + size = strlen(newval) + 1; + if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) { + size += 2; + sym->def[S_DEF_USER].val = val = malloc(size); + *val++ = '0'; + *val++ = 'x'; + } else if (!oldval || strcmp(oldval, newval)) + sym->def[S_DEF_USER].val = val = malloc(size); + else + return true; + + strcpy(val, newval); + free((void *)oldval); + sym_clear_all_valid(); + + return true; +} + +/* + * Find the default value associated to a symbol. + * For tristate symbol handle the modules=n case + * in which case "m" becomes "y". + * If the symbol does not have any default then fallback + * to the fixed default values. + */ +const char *sym_get_string_default(struct symbol *sym) +{ + struct property *prop; + struct symbol *ds; + const char *str; + tristate val; + + sym_calc_visibility(sym); + sym_calc_value(modules_sym); + val = symbol_no.curr.tri; + str = symbol_empty.curr.val; + + /* If symbol has a default value look it up */ + prop = sym_get_default_prop(sym); + if (prop != NULL) { + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + /* The visibility may limit the value from yes => mod */ + val = EXPR_AND(expr_calc_value(prop->expr), prop->visible.tri); + break; + default: + /* + * The following fails to handle the situation + * where a default value is further limited by + * the valid range. + */ + ds = prop_get_symbol(prop); + if (ds != NULL) { + sym_calc_value(ds); + str = (const char *)ds->curr.val; + } + } + } + + /* Handle select statements */ + val = EXPR_OR(val, sym->rev_dep.tri); + + /* transpose mod to yes if modules are not enabled */ + if (val == mod) + if (!sym_is_choice_value(sym) && modules_sym->curr.tri == no) + val = yes; + + /* transpose mod to yes if type is bool */ + if (sym->type == S_BOOLEAN && val == mod) + val = yes; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + switch (val) { + case no: return "n"; + case mod: return "m"; + case yes: return "y"; + } + case S_INT: + case S_HEX: + return str; + case S_STRING: + return str; + case S_OTHER: + case S_UNKNOWN: + break; + } + return ""; +} + +const char *sym_get_string_value(struct symbol *sym) +{ + tristate val; + + switch (sym->type) { + case S_BOOLEAN: + case S_TRISTATE: + val = sym_get_tristate_value(sym); + switch (val) { + case no: + return "n"; + case mod: + return "m"; + case yes: + return "y"; + } + break; + default: + ; + } + return (const char *)sym->curr.val; +} + +bool sym_is_changable(struct symbol *sym) +{ + return sym->visible > sym->rev_dep.tri; +} + +static unsigned strhash(const char *s) +{ + /* fnv32 hash */ + unsigned hash = 2166136261U; + for (; *s; s++) + hash = (hash ^ *s) * 0x01000193; + return hash; +} + +struct symbol *sym_lookup(const char *name, int flags) +{ + struct symbol *symbol; + char *new_name; + int hash; + + if (name) { + if (name[0] && !name[1]) { + switch (name[0]) { + case 'y': return &symbol_yes; + case 'm': return &symbol_mod; + case 'n': return &symbol_no; + } + } + hash = strhash(name) % SYMBOL_HASHSIZE; + + for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { + if (symbol->name && + !strcmp(symbol->name, name) && + (flags ? symbol->flags & flags + : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE)))) + return symbol; + } + new_name = strdup(name); + } else { + new_name = NULL; + hash = 0; + } + + symbol = malloc(sizeof(*symbol)); + memset(symbol, 0, sizeof(*symbol)); + symbol->name = new_name; + symbol->type = S_UNKNOWN; + symbol->flags |= flags; + + symbol->next = symbol_hash[hash]; + symbol_hash[hash] = symbol; + + return symbol; +} + +struct symbol *sym_find(const char *name) +{ + struct symbol *symbol = NULL; + int hash = 0; + + if (!name) + return NULL; + + if (name[0] && !name[1]) { + switch (name[0]) { + case 'y': return &symbol_yes; + case 'm': return &symbol_mod; + case 'n': return &symbol_no; + } + } + hash = strhash(name) % SYMBOL_HASHSIZE; + + for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) { + if (symbol->name && + !strcmp(symbol->name, name) && + !(symbol->flags & SYMBOL_CONST)) + break; + } + + return symbol; +} + +/* + * Expand symbol's names embedded in the string given in argument. Symbols' + * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to + * the empty string. + */ +const char *sym_expand_string_value(const char *in) +{ + const char *src; + char *res; + size_t reslen; + + reslen = strlen(in) + 1; + res = malloc(reslen); + res[0] = '\0'; + + while ((src = strchr(in, '$'))) { + char *p, name[SYMBOL_MAXLENGTH]; + const char *symval = ""; + struct symbol *sym; + size_t newlen; + + strncat(res, in, src - in); + src++; + + p = name; + while (isalnum(*src) || *src == '_') + *p++ = *src++; + *p = '\0'; + + sym = sym_find(name); + if (sym != NULL) { + sym_calc_value(sym); + symval = sym_get_string_value(sym); + } + + newlen = strlen(res) + strlen(symval) + strlen(src) + 1; + if (newlen > reslen) { + reslen = newlen; + res = realloc(res, reslen); + } + + strcat(res, symval); + in = src; + } + strcat(res, in); + + return res; +} + +struct symbol **sym_re_search(const char *pattern) +{ + struct symbol *sym, **sym_arr = NULL; + int i, cnt, size; + regex_t re; + + cnt = size = 0; + /* Skip if empty */ + if (strlen(pattern) == 0) + return NULL; + if (regcomp(&re, pattern, REG_EXTENDED|REG_NOSUB|REG_ICASE)) + return NULL; + + for_all_symbols(i, sym) { + if (sym->flags & SYMBOL_CONST || !sym->name) + continue; + if (regexec(&re, sym->name, 0, NULL, 0)) + continue; + if (cnt + 1 >= size) { + void *tmp = sym_arr; + size += 16; + sym_arr = realloc(sym_arr, size * sizeof(struct symbol *)); + if (!sym_arr) { + free(tmp); + return NULL; + } + } + sym_calc_value(sym); + sym_arr[cnt++] = sym; + } + if (sym_arr) + sym_arr[cnt] = NULL; + regfree(&re); + + return sym_arr; +} + +/* + * When we check for recursive dependencies we use a stack to save + * current state so we can print out relevant info to user. + * The entries are located on the call stack so no need to free memory. + * Note inser() remove() must always match to properly clear the stack. + */ +static struct dep_stack { + struct dep_stack *prev, *next; + struct symbol *sym; + struct property *prop; + struct expr *expr; +} *check_top; + +static void dep_stack_insert(struct dep_stack *stack, struct symbol *sym) +{ + memset(stack, 0, sizeof(*stack)); + if (check_top) + check_top->next = stack; + stack->prev = check_top; + stack->sym = sym; + check_top = stack; +} + +static void dep_stack_remove(void) +{ + check_top = check_top->prev; + if (check_top) + check_top->next = NULL; +} + +/* + * Called when we have detected a recursive dependency. + * check_top point to the top of the stact so we use + * the ->prev pointer to locate the bottom of the stack. + */ +static void sym_check_print_recursive(struct symbol *last_sym) +{ + struct dep_stack *stack; + struct symbol *sym, *next_sym; + struct menu *menu = NULL; + struct property *prop; + struct dep_stack cv_stack; + + if (sym_is_choice_value(last_sym)) { + dep_stack_insert(&cv_stack, last_sym); + last_sym = prop_get_symbol(sym_get_choice_prop(last_sym)); + } + + for (stack = check_top; stack != NULL; stack = stack->prev) + if (stack->sym == last_sym) + break; + if (!stack) { + fprintf(stderr, "unexpected recursive dependency error\n"); + return; + } + + for (; stack; stack = stack->next) { + sym = stack->sym; + next_sym = stack->next ? stack->next->sym : last_sym; + prop = stack->prop; + if (prop == NULL) + prop = stack->sym->prop; + + /* for choice values find the menu entry (used below) */ + if (sym_is_choice(sym) || sym_is_choice_value(sym)) { + for (prop = sym->prop; prop; prop = prop->next) { + menu = prop->menu; + if (prop->menu) + break; + } + } + if (stack->sym == last_sym) + fprintf(stderr, "%s:%d:error: recursive dependency detected!\n", + prop->file->name, prop->lineno); + if (stack->expr) { + fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n", + prop->file->name, prop->lineno, + sym->name ? sym->name : "", + prop_get_type_name(prop->type), + next_sym->name ? next_sym->name : ""); + } else if (stack->prop) { + fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n", + prop->file->name, prop->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } else if (sym_is_choice(sym)) { + fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n", + menu->file->name, menu->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } else if (sym_is_choice_value(sym)) { + fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n", + menu->file->name, menu->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } else { + fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n", + prop->file->name, prop->lineno, + sym->name ? sym->name : "", + next_sym->name ? next_sym->name : ""); + } + } + + if (check_top == &cv_stack) + dep_stack_remove(); +} + +static struct symbol *sym_check_expr_deps(struct expr *e) +{ + struct symbol *sym; + + if (!e) + return NULL; + switch (e->type) { + case E_OR: + case E_AND: + sym = sym_check_expr_deps(e->left.expr); + if (sym) + return sym; + return sym_check_expr_deps(e->right.expr); + case E_NOT: + return sym_check_expr_deps(e->left.expr); + case E_EQUAL: + case E_UNEQUAL: + sym = sym_check_deps(e->left.sym); + if (sym) + return sym; + return sym_check_deps(e->right.sym); + case E_SYMBOL: + return sym_check_deps(e->left.sym); + default: + break; + } + printf("Oops! How to check %d?\n", e->type); + return NULL; +} + +/* return NULL when dependencies are OK */ +static struct symbol *sym_check_sym_deps(struct symbol *sym) +{ + struct symbol *sym2; + struct property *prop; + struct dep_stack stack; + + dep_stack_insert(&stack, sym); + + sym2 = sym_check_expr_deps(sym->rev_dep.expr); + if (sym2) + goto out; + + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->type == P_CHOICE || prop->type == P_SELECT) + continue; + stack.prop = prop; + sym2 = sym_check_expr_deps(prop->visible.expr); + if (sym2) + break; + if (prop->type != P_DEFAULT || sym_is_choice(sym)) + continue; + stack.expr = prop->expr; + sym2 = sym_check_expr_deps(prop->expr); + if (sym2) + break; + stack.expr = NULL; + } + +out: + dep_stack_remove(); + + return sym2; +} + +static struct symbol *sym_check_choice_deps(struct symbol *choice) +{ + struct symbol *sym, *sym2; + struct property *prop; + struct expr *e; + struct dep_stack stack; + + dep_stack_insert(&stack, choice); + + prop = sym_get_choice_prop(choice); + expr_list_for_each_sym(prop->expr, e, sym) + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + + choice->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + sym2 = sym_check_sym_deps(choice); + choice->flags &= ~SYMBOL_CHECK; + if (sym2) + goto out; + + expr_list_for_each_sym(prop->expr, e, sym) { + sym2 = sym_check_sym_deps(sym); + if (sym2) + break; + } +out: + expr_list_for_each_sym(prop->expr, e, sym) + sym->flags &= ~SYMBOL_CHECK; + + if (sym2 && sym_is_choice_value(sym2) && + prop_get_symbol(sym_get_choice_prop(sym2)) == choice) + sym2 = choice; + + dep_stack_remove(); + + return sym2; +} + +struct symbol *sym_check_deps(struct symbol *sym) +{ + struct symbol *sym2; + struct property *prop; + + if (sym->flags & SYMBOL_CHECK) { + sym_check_print_recursive(sym); + return sym; + } + if (sym->flags & SYMBOL_CHECKED) + return NULL; + + if (sym_is_choice_value(sym)) { + struct dep_stack stack; + + /* for choice groups start the check with main choice symbol */ + dep_stack_insert(&stack, sym); + prop = sym_get_choice_prop(sym); + sym2 = sym_check_deps(prop_get_symbol(prop)); + dep_stack_remove(); + } else if (sym_is_choice(sym)) { + sym2 = sym_check_choice_deps(sym); + } else { + sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); + sym2 = sym_check_sym_deps(sym); + sym->flags &= ~SYMBOL_CHECK; + } + + if (sym2 && sym2 == sym) + sym2 = NULL; + + return sym2; +} + +struct property *prop_alloc(enum prop_type type, struct symbol *sym) +{ + struct property *prop; + struct property **propp; + + prop = malloc(sizeof(*prop)); + memset(prop, 0, sizeof(*prop)); + prop->type = type; + prop->sym = sym; + prop->file = current_file; + prop->lineno = zconf_lineno(); + + /* append property to the prop list of symbol */ + if (sym) { + for (propp = &sym->prop; *propp; propp = &(*propp)->next) + ; + *propp = prop; + } + + return prop; +} + +struct symbol *prop_get_symbol(struct property *prop) +{ + if (prop->expr && (prop->expr->type == E_SYMBOL || + prop->expr->type == E_LIST)) + return prop->expr->left.sym; + return NULL; +} + +const char *prop_get_type_name(enum prop_type type) +{ + switch (type) { + case P_PROMPT: + return "prompt"; + case P_ENV: + return "env"; + case P_COMMENT: + return "comment"; + case P_MENU: + return "menu"; + case P_DEFAULT: + return "default"; + case P_CHOICE: + return "choice"; + case P_SELECT: + return "select"; + case P_RANGE: + return "range"; + case P_SYMBOL: + return "symbol"; + case P_UNKNOWN: + break; + } + return "unknown"; +} diff --git a/i386/config/textbox.c b/i386/config/textbox.c new file mode 100644 index 0000000..c704712 --- /dev/null +++ b/i386/config/textbox.c @@ -0,0 +1,391 @@ +/* + * textbox.c -- implements the text box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +static void back_lines(int n); +static void print_page(WINDOW * win, int height, int width); +static void print_line(WINDOW * win, int row, int width); +static char *get_line(void); +static void print_position(WINDOW * win); + +static int hscroll; +static int begin_reached, end_reached, page_length; +static const char *buf; +static const char *page; + +/* + * refresh window content + */ +static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, + int cur_y, int cur_x) +{ + print_page(box, boxh, boxw); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); +} + + +/* + * Display text from a file in a dialog box. + */ +int dialog_textbox(const char *title, const char *tbuf, + int initial_height, int initial_width) +{ + int i, x, y, cur_x, cur_y, key = 0; + int height, width, boxh, boxw; + int passed_end; + WINDOW *dialog, *box; + + begin_reached = 1; + end_reached = 0; + page_length = 0; + hscroll = 0; + buf = tbuf; + page = buf; /* page is pointer to start of page to be displayed */ + +do_resize: + getmaxyx(stdscr, height, width); + if (height < 8 || width < 8) + return -ERRDISPLAYTOOSMALL; + if (initial_height != 0) + height = initial_height; + else + if (height > 4) + height -= 4; + else + height = 0; + if (initial_width != 0) + width = initial_width; + else + if (width > 5) + width -= 5; + else + width = 0; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + /* Create window for box region, used for scrolling text */ + boxh = height - 4; + boxw = width - 2; + box = subwin(dialog, boxh, boxw, y + 1, x + 1); + wattrset(box, dlg.dialog.atr); + wbkgdset(box, dlg.dialog.atr & A_COLOR); + + keypad(box, TRUE); + + /* register the new window, along with its borders */ + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + wbkgdset(dialog, dlg.dialog.atr & A_COLOR); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE); + wnoutrefresh(dialog); + getyx(dialog, cur_y, cur_x); /* Save cursor position */ + + /* Print first page of text */ + attr_clear(box, boxh, boxw, dlg.dialog.atr); + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); + + while ((key != KEY_ESC) && (key != '\n')) { + key = wgetch(dialog); + switch (key) { + case 'E': /* Exit */ + case 'e': + case 'X': + case 'x': + delwin(box); + delwin(dialog); + return 0; + case 'g': /* First page */ + case KEY_HOME: + if (!begin_reached) { + begin_reached = 1; + page = buf; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + } + break; + case 'G': /* Last page */ + case KEY_END: + + end_reached = 1; + /* point to last char in buf */ + page = buf + strlen(buf); + back_lines(boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'K': /* Previous line */ + case 'k': + case KEY_UP: + if (!begin_reached) { + back_lines(page_length + 1); + + /* We don't call print_page() here but use + * scrolling to ensure faster screen update. + * However, 'end_reached' and 'page_length' + * should still be updated, and 'page' should + * point to start of next page. This is done + * by calling get_line() in the following + * 'for' loop. */ + scrollok(box, TRUE); + wscrl(box, -1); /* Scroll box region down one line */ + scrollok(box, FALSE); + page_length = 0; + passed_end = 0; + for (i = 0; i < boxh; i++) { + if (!i) { + /* print first line of page */ + print_line(box, 0, boxw); + wnoutrefresh(box); + } else + /* Called to update 'end_reached' and 'page' */ + get_line(); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case 'B': /* Previous page */ + case 'b': + case KEY_PPAGE: + if (begin_reached) + break; + back_lines(page_length + boxh); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'J': /* Next line */ + case 'j': + case KEY_DOWN: + if (!end_reached) { + begin_reached = 0; + scrollok(box, TRUE); + scroll(box); /* Scroll box region up one line */ + scrollok(box, FALSE); + print_line(box, boxh - 1, boxw); + wnoutrefresh(box); + print_position(dialog); + wmove(dialog, cur_y, cur_x); /* Restore cursor position */ + wrefresh(dialog); + } + break; + case KEY_NPAGE: /* Next page */ + case ' ': + if (end_reached) + break; + + begin_reached = 0; + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case '0': /* Beginning of line */ + case 'H': /* Scroll left */ + case 'h': + case KEY_LEFT: + if (hscroll <= 0) + break; + + if (key == '0') + hscroll = 0; + else + hscroll--; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case 'L': /* Scroll right */ + case 'l': + case KEY_RIGHT: + if (hscroll >= MAX_LEN) + break; + hscroll++; + /* Reprint current page to scroll horizontally */ + back_lines(page_length); + refresh_text_box(dialog, box, boxh, boxw, + cur_y, cur_x); + break; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + back_lines(height); + delwin(box); + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + delwin(box); + delwin(dialog); + return key; /* ESC pressed */ +} + +/* + * Go back 'n' lines in text. Called by dialog_textbox(). + * 'page' will be updated to point to the desired line in 'buf'. + */ +static void back_lines(int n) +{ + int i; + + begin_reached = 0; + /* Go back 'n' lines */ + for (i = 0; i < n; i++) { + if (*page == '\0') { + if (end_reached) { + end_reached = 0; + continue; + } + } + if (page == buf) { + begin_reached = 1; + return; + } + page--; + do { + if (page == buf) { + begin_reached = 1; + return; + } + page--; + } while (*page != '\n'); + page++; + } +} + +/* + * Print a new page of text. Called by dialog_textbox(). + */ +static void print_page(WINDOW * win, int height, int width) +{ + int i, passed_end = 0; + + page_length = 0; + for (i = 0; i < height; i++) { + print_line(win, i, width); + if (!passed_end) + page_length++; + if (end_reached && !passed_end) + passed_end = 1; + } + wnoutrefresh(win); +} + +/* + * Print a new line of text. Called by dialog_textbox() and print_page(). + */ +static void print_line(WINDOW * win, int row, int width) +{ + int y, x; + char *line; + + line = get_line(); + line += MIN(strlen(line), hscroll); /* Scroll horizontally */ + wmove(win, row, 0); /* move cursor to correct line */ + waddch(win, ' '); + waddnstr(win, line, MIN(strlen(line), width - 2)); + + getyx(win, y, x); + /* Clear 'residue' of previous line */ +#if OLD_NCURSES + { + int i; + for (i = 0; i < width - x; i++) + waddch(win, ' '); + } +#else + wclrtoeol(win); +#endif +} + +/* + * Return current line of text. Called by dialog_textbox() and print_line(). + * 'page' should point to start of current line before calling, and will be + * updated to point to start of next line. + */ +static char *get_line(void) +{ + int i = 0; + static char line[MAX_LEN + 1]; + + end_reached = 0; + while (*page != '\n') { + if (*page == '\0') { + if (!end_reached) { + end_reached = 1; + break; + } + } else if (i < MAX_LEN) + line[i++] = *(page++); + else { + /* Truncate lines longer than MAX_LEN characters */ + if (i == MAX_LEN) + line[i++] = '\0'; + page++; + } + } + if (i <= MAX_LEN) + line[i] = '\0'; + if (!end_reached) + page++; /* move pass '\n' */ + + return line; +} + +/* + * Print current position + */ +static void print_position(WINDOW * win) +{ + int percent; + + wattrset(win, dlg.position_indicator.atr); + wbkgdset(win, dlg.position_indicator.atr & A_COLOR); + percent = (page - buf) * 100 / strlen(buf); + wmove(win, getmaxy(win) - 3, getmaxx(win) - 9); + wprintw(win, "(%3d%%)", percent); +} diff --git a/i386/config/util.c b/i386/config/util.c new file mode 100644 index 0000000..d4b4525 --- /dev/null +++ b/i386/config/util.c @@ -0,0 +1,796 @@ +/* + * util.c + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#include "dialog.h" + +struct dialog_info dlg; + +static void set_mono_theme(void) +{ + dlg.screen.atr = A_NORMAL; + dlg.shadow.atr = A_NORMAL; + dlg.dialog.atr = A_NORMAL; + dlg.title.atr = A_BOLD; + dlg.border.atr = A_NORMAL; + dlg.button_active.atr = A_REVERSE; + dlg.button_inactive.atr = A_DIM; + dlg.button_key_active.atr = A_REVERSE; + dlg.button_key_inactive.atr = A_BOLD; + dlg.button_label_active.atr = A_REVERSE; + dlg.button_label_inactive.atr = A_NORMAL; + dlg.inputbox.atr = A_NORMAL; + dlg.inputbox_border.atr = A_NORMAL; + dlg.searchbox.atr = A_NORMAL; + dlg.searchbox_title.atr = A_BOLD; + dlg.searchbox_border.atr = A_NORMAL; + dlg.position_indicator.atr = A_BOLD; + dlg.menubox.atr = A_NORMAL; + dlg.menubox_border.atr = A_NORMAL; + dlg.item.atr = A_NORMAL; + dlg.item_selected.atr = A_REVERSE; + dlg.tag.atr = A_BOLD; + dlg.tag_selected.atr = A_REVERSE; + dlg.tag_key.atr = A_BOLD; + dlg.tag_key_selected.atr = A_REVERSE; + dlg.check.atr = A_BOLD; + dlg.check_selected.atr = A_REVERSE; + dlg.uarrow.atr = A_BOLD; + dlg.darrow.atr = A_BOLD; +} + +#define DLG_COLOR(dialog, f, b, h) \ +do { \ + dlg.dialog.fg = (f); \ + dlg.dialog.bg = (b); \ + dlg.dialog.hl = (h); \ +} while (0) + +static void set_classic_theme(void) +{ + DLG_COLOR(screen, COLOR_CYAN, COLOR_BLUE, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, true); + DLG_COLOR(dialog, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(button_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_inactive, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(button_key_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_WHITE, false); + DLG_COLOR(button_label_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_WHITE, true); + DLG_COLOR(inputbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(inputbox_border, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(searchbox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(menubox, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(menubox_border, COLOR_WHITE, COLOR_WHITE, true); + DLG_COLOR(item, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(tag, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(tag_key, COLOR_YELLOW, COLOR_WHITE, true); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(check, COLOR_BLACK, COLOR_WHITE, false); + DLG_COLOR(check_selected, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(uarrow, COLOR_GREEN, COLOR_WHITE, true); + DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true); +} + +static void set_blackbg_theme(void) +{ + DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true); + DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false); + DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(button_active, COLOR_YELLOW, COLOR_RED, false); + DLG_COLOR(button_inactive, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_RED, false); + DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(inputbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(inputbox_border, COLOR_YELLOW, COLOR_BLACK, false); + + DLG_COLOR(searchbox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_BLACK, true); + DLG_COLOR(searchbox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(position_indicator, COLOR_RED, COLOR_BLACK, false); + + DLG_COLOR(menubox, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(menubox_border, COLOR_BLACK, COLOR_BLACK, true); + + DLG_COLOR(item, COLOR_WHITE, COLOR_BLACK, false); + DLG_COLOR(item_selected, COLOR_WHITE, COLOR_RED, false); + + DLG_COLOR(tag, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_RED, true); + DLG_COLOR(tag_key, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(check, COLOR_YELLOW, COLOR_BLACK, false); + DLG_COLOR(check_selected, COLOR_YELLOW, COLOR_RED, true); + + DLG_COLOR(uarrow, COLOR_RED, COLOR_BLACK, false); + DLG_COLOR(darrow, COLOR_RED, COLOR_BLACK, false); +} + +static void set_bluetitle_theme(void) +{ + set_classic_theme(); + DLG_COLOR(title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_BLUE, true); + DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_BLUE, true); + DLG_COLOR(searchbox_title, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(position_indicator, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag, COLOR_BLUE, COLOR_WHITE, true); + DLG_COLOR(tag_key, COLOR_BLUE, COLOR_WHITE, true); + +} + +/* + * Select color theme + */ +static int set_theme(const char *theme) +{ + int use_color = 1; + if (!theme) + set_bluetitle_theme(); + else if (strcmp(theme, "classic") == 0) + set_classic_theme(); + else if (strcmp(theme, "bluetitle") == 0) + set_bluetitle_theme(); + else if (strcmp(theme, "blackbg") == 0) + set_blackbg_theme(); + else if (strcmp(theme, "mono") == 0) + use_color = 0; + + return use_color; +} + +static void init_one_color(struct dialog_color *color) +{ + static int pair = 0; + + pair++; + init_pair(pair, color->fg, color->bg); + if (color->hl) + color->atr = A_BOLD | COLOR_PAIR(pair); + else + color->atr = COLOR_PAIR(pair); +} + +static void init_dialog_colors(void) +{ + init_one_color(&dlg.screen); + init_one_color(&dlg.shadow); + init_one_color(&dlg.dialog); + init_one_color(&dlg.title); + init_one_color(&dlg.border); + init_one_color(&dlg.button_active); + init_one_color(&dlg.button_inactive); + init_one_color(&dlg.button_key_active); + init_one_color(&dlg.button_key_inactive); + init_one_color(&dlg.button_label_active); + init_one_color(&dlg.button_label_inactive); + init_one_color(&dlg.inputbox); + init_one_color(&dlg.inputbox_border); + init_one_color(&dlg.searchbox); + init_one_color(&dlg.searchbox_title); + init_one_color(&dlg.searchbox_border); + init_one_color(&dlg.position_indicator); + init_one_color(&dlg.menubox); + init_one_color(&dlg.menubox_border); + init_one_color(&dlg.item); + init_one_color(&dlg.item_selected); + init_one_color(&dlg.tag); + init_one_color(&dlg.tag_selected); + init_one_color(&dlg.tag_key); + init_one_color(&dlg.tag_key_selected); + init_one_color(&dlg.check); + init_one_color(&dlg.check_selected); + init_one_color(&dlg.uarrow); + init_one_color(&dlg.darrow); +} + +/* + * Setup for color display + */ +static void color_setup(const char *theme) +{ + int use_color; + + use_color = set_theme(theme); + if (use_color && has_colors()) { + start_color(); + init_dialog_colors(); + } else + set_mono_theme(); +} + +/* + * Set window to attribute 'attr' + */ +void attr_clear(WINDOW * win, int height, int width, chtype attr) +{ + int i, j; + + wattrset(win, attr); + for (i = 0; i < height; i++) { + wmove(win, i, 0); + for (j = 0; j < width; j++) + waddch(win, ' '); + } + touchwin(win); +} + +void dialog_clear(void) +{ + attr_clear(stdscr, LINES, COLS, dlg.screen.atr); + /* Display background title if it exists ... - SLH */ + if (dlg.backtitle != NULL) { + int i; + + wattrset(stdscr, dlg.screen.atr); + mvwaddstr(stdscr, 0, 1, (char *)dlg.backtitle); + wmove(stdscr, 1, 1); + for (i = 1; i < COLS - 1; i++) + waddch(stdscr, ACS_HLINE); + } + wnoutrefresh(stdscr); +} + +/* + * Do some initialization for dialog + */ +int init_dialog(const char *backtitle) +{ + int height, width; + + initscr(); /* Init curses */ + getmaxyx(stdscr, height, width); + if (height < 19 || width < 80) { + endwin(); + return -ERRDISPLAYTOOSMALL; + } + + dlg.backtitle = backtitle; + color_setup(getenv("MENUCONFIG_COLOR")); + + keypad(stdscr, TRUE); + cbreak(); + noecho(); + dialog_clear(); + + return 0; +} + +void set_dialog_backtitle(const char *backtitle) +{ + dlg.backtitle = backtitle; +} + +/* + * End using dialog functions. + */ +void end_dialog(int x, int y) +{ + /* move cursor back to original position */ + move(y, x); + refresh(); + endwin(); +} + +/* Print the title of the dialog. Center the title and truncate + * tile if wider than dialog (- 2 chars). + **/ +void print_title(WINDOW *dialog, const char *title, int width) +{ + if (title) { + int tlen = MIN(width - 2, strlen(title)); + wattrset(dialog, dlg.title.atr); + mvwaddch(dialog, 0, (width - tlen) / 2 - 1, ' '); + mvwaddnstr(dialog, 0, (width - tlen)/2, title, tlen); + waddch(dialog, ' '); + } +} + +/* + * Print a string of text in a window, automatically wrap around to the + * next line if the string is too long to fit on one line. Newline + * characters '\n' are replaced by spaces. We start on a new line + * if there is no room for at least 4 nonblanks following a double-space. + */ +void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x) +{ + int newl, cur_x, cur_y; + int i, prompt_len, room, wlen; + char tempstr[MAX_LEN + 1], *word, *sp, *sp2; + + strcpy(tempstr, prompt); + + prompt_len = strlen(tempstr); + + /* + * Remove newlines + */ + for (i = 0; i < prompt_len; i++) { + if (tempstr[i] == '\n') + tempstr[i] = ' '; + } + + if (prompt_len <= width - x * 2) { /* If prompt is short */ + wmove(win, y, (width - prompt_len) / 2); + waddstr(win, tempstr); + } else { + cur_x = x; + cur_y = y; + newl = 1; + word = tempstr; + while (word && *word) { + sp = strchr(word, ' '); + if (sp) + *sp++ = 0; + + /* Wrap to next line if either the word does not fit, + or it is the first word of a new sentence, and it is + short, and the next word does not fit. */ + room = width - cur_x; + wlen = strlen(word); + if (wlen > room || + (newl && wlen < 4 && sp + && wlen + 1 + strlen(sp) > room + && (!(sp2 = strchr(sp, ' ')) + || wlen + 1 + (sp2 - sp) > room))) { + cur_y++; + cur_x = x; + } + wmove(win, cur_y, cur_x); + waddstr(win, word); + getyx(win, cur_y, cur_x); + cur_x++; + if (sp && *sp == ' ') { + cur_x++; /* double space */ + while (*++sp == ' ') ; + newl = 1; + } else + newl = 0; + word = sp; + } + } +} + +/* + * Print a button + */ +void print_button(WINDOW * win, const char *label, int y, int x, int selected) +{ + int i, temp; + + wmove(win, y, x); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, "<"); + temp = strspn(label, " "); + label += temp; + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + for (i = 0; i < temp; i++) + waddch(win, ' '); + wattrset(win, selected ? dlg.button_key_active.atr + : dlg.button_key_inactive.atr); + waddch(win, label[0]); + wattrset(win, selected ? dlg.button_label_active.atr + : dlg.button_label_inactive.atr); + waddstr(win, (char *)label + 1); + wattrset(win, selected ? dlg.button_active.atr + : dlg.button_inactive.atr); + waddstr(win, ">"); + wmove(win, y, x + temp + 1); +} + +/* + * Draw a rectangular box with line drawing characters + */ +void +draw_box(WINDOW * win, int y, int x, int height, int width, + chtype box, chtype border) +{ + int i, j; + + wattrset(win, 0); + for (i = 0; i < height; i++) { + wmove(win, y + i, x); + for (j = 0; j < width; j++) + if (!i && !j) + waddch(win, border | ACS_ULCORNER); + else if (i == height - 1 && !j) + waddch(win, border | ACS_LLCORNER); + else if (!i && j == width - 1) + waddch(win, box | ACS_URCORNER); + else if (i == height - 1 && j == width - 1) + waddch(win, box | ACS_LRCORNER); + else if (!i) + waddch(win, border | ACS_HLINE); + else if (i == height - 1) + waddch(win, box | ACS_HLINE); + else if (!j) + waddch(win, border | ACS_VLINE); + else if (j == width - 1) + waddch(win, box | ACS_VLINE); + else + waddch(win, box | ' '); + } +} + +/* + * Draw shadows along the right and bottom edge to give a more 3D look + * to the boxes + */ +void draw_shadow(WINDOW * win, int y, int x, int height, int width) +{ + int i; + + if (has_colors()) { /* Whether terminal supports color? */ + wattrset(win, dlg.shadow.atr); + wmove(win, y + height, x + 2); + for (i = 0; i < width; i++) + waddch(win, winch(win) & A_CHARTEXT); + for (i = y + 1; i < y + height + 1; i++) { + wmove(win, i, x + width); + waddch(win, winch(win) & A_CHARTEXT); + waddch(win, winch(win) & A_CHARTEXT); + } + wnoutrefresh(win); + } +} + +/* + * Return the position of the first alphabetic character in a string. + */ +int first_alpha(const char *string, const char *exempt) +{ + int i, in_paren = 0, c; + + for (i = 0; i < strlen(string); i++) { + c = tolower(string[i]); + + if (strchr("<[(", c)) + ++in_paren; + if (strchr(">])", c) && in_paren > 0) + --in_paren; + + if ((!in_paren) && isalpha(c) && strchr(exempt, c) == 0) + return i; + } + + return 0; +} + +/* + * ncurses uses ESC to detect escaped char sequences. This resutl in + * a small timeout before ESC is actually delivered to the application. + * lxdialog suggest which is correctly translated to two + * times esc. But then we need to ignore the second esc to avoid stepping + * out one menu too much. Filter away all escaped key sequences since + * keypad(FALSE) turn off ncurses support for escape sequences - and thats + * needed to make notimeout() do as expected. + */ +int on_key_esc(WINDOW *win) +{ + int key; + int key2; + int key3; + + nodelay(win, TRUE); + keypad(win, FALSE); + key = wgetch(win); + key2 = wgetch(win); + do { + key3 = wgetch(win); + } while (key3 != ERR); + nodelay(win, FALSE); + keypad(win, TRUE); + if (key == KEY_ESC && key2 == ERR) + return KEY_ESC; + else if (key != ERR && key != KEY_ESC && key2 == ERR) + ungetch(key); + + return -1; +} + +/* redraw screen in new size */ +int on_key_resize(void) +{ + dialog_clear(); + return KEY_RESIZE; +} + +struct dialog_list *item_cur; +struct dialog_list item_nil; +struct dialog_list *item_head; + +void item_reset(void) +{ + struct dialog_list *p, *next; + + for (p = item_head; p; p = next) { + next = p->next; + free(p); + } + item_head = NULL; + item_cur = &item_nil; +} + +void item_make(const char *fmt, ...) +{ + va_list ap; + struct dialog_list *p = malloc(sizeof(*p)); + + if (item_head) + item_cur->next = p; + else + item_head = p; + item_cur = p; + memset(p, 0, sizeof(*p)); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str, sizeof(item_cur->node.str), fmt, ap); + va_end(ap); +} + +void item_add_str(const char *fmt, ...) +{ + va_list ap; + size_t avail; + + avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); + + va_start(ap, fmt); + vsnprintf(item_cur->node.str + strlen(item_cur->node.str), + avail, fmt, ap); + item_cur->node.str[sizeof(item_cur->node.str) - 1] = '\0'; + va_end(ap); +} + +void item_set_tag(char tag) +{ + item_cur->node.tag = tag; +} +void item_set_data(void *ptr) +{ + item_cur->node.data = ptr; +} + +void item_set_selected(int val) +{ + item_cur->node.selected = val; +} + +int item_activate_selected(void) +{ + item_foreach() + if (item_is_selected()) + return 1; + return 0; +} + +void *item_data(void) +{ + return item_cur->node.data; +} + +char item_tag(void) +{ + return item_cur->node.tag; +} + +int item_count(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) + n++; + return n; +} + +void item_set(int n) +{ + int i = 0; + item_foreach() + if (i++ == n) + return; +} + +int item_n(void) +{ + int n = 0; + struct dialog_list *p; + + for (p = item_head; p; p = p->next) { + if (p == item_cur) + return n; + n++; + } + return 0; +} + +const char *item_str(void) +{ + return item_cur->node.str; +} + +int item_is_selected(void) +{ + return (item_cur->node.selected != 0); +} + +int item_is_tag(char tag) +{ + return (item_cur->node.tag == tag); +} + +/* + * Copyright (C) 2002-2005 Roman Zippel + * Copyright (C) 2002-2005 Sam Ravnborg + * + * Released under the terms of the GNU GPL v2.0. + */ + +//#include +//#include "lkc.h" + +/* file already present in list? If not add it */ +struct file *file_lookup(const char *name) +{ + struct file *file; + const char *file_name = sym_expand_string_value(name); + + for (file = file_list; file; file = file->next) { + if (!strcmp(name, file->name)) { + free((void *)file_name); + return file; + } + } + + file = malloc(sizeof(*file)); + memset(file, 0, sizeof(*file)); + file->name = file_name; + file->next = file_list; + file_list = file; + return file; +} + +/* write a dependency file as used by kbuild to track dependencies */ +int file_write_dep(const char *name) +{ + struct symbol *sym, *env_sym; + struct expr *e; + struct file *file; + FILE *out; + + if (!name) + name = ".kconfig.d"; + out = fopen("..config.tmp", "w"); + if (!out) + return 1; + fprintf(out, "deps_config := \\\n"); + for (file = file_list; file; file = file->next) { + if (file->next) + fprintf(out, "\t%s \\\n", file->name); + else + fprintf(out, "\t%s\n", file->name); + } + fprintf(out, "\n%s: \\\n" + "\t$(deps_config)\n\n", conf_get_autoconfig_name()); + + expr_list_for_each_sym(sym_env_list, e, sym) { + struct property *prop; + const char *value; + + prop = sym_get_env_prop(sym); + env_sym = prop_get_symbol(prop); + if (!env_sym) + continue; + value = getenv(env_sym->name); + if (!value) + value = ""; + fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); + fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name()); + fprintf(out, "endif\n"); + } + + fprintf(out, "\n$(deps_config): ;\n"); + fclose(out); + rename("..config.tmp", name); + return 0; +} + + +/* Allocate initial growable string */ +struct gstr str_new(void) +{ + struct gstr gs; + gs.s = malloc(sizeof(char) * 64); + gs.len = 64; + gs.max_width = 0; + strcpy(gs.s, "\0"); + return gs; +} + +/* Allocate and assign growable string */ +struct gstr str_assign(const char *s) +{ + struct gstr gs; + gs.s = strdup(s); + gs.len = strlen(s) + 1; + gs.max_width = 0; + return gs; +} + +/* Free storage for growable string */ +void str_free(struct gstr *gs) +{ + if (gs->s) + free(gs->s); + gs->s = NULL; + gs->len = 0; +} + +/* Append to growable string */ +void str_append(struct gstr *gs, const char *s) +{ + size_t l; + if (s) { + l = strlen(gs->s) + strlen(s) + 1; + if (l > gs->len) { + gs->s = realloc(gs->s, l); + gs->len = l; + } + strcat(gs->s, s); + } +} + +/* Append printf formatted string to growable string */ +void str_printf(struct gstr *gs, const char *fmt, ...) +{ + va_list ap; + char s[10000]; /* big enough... */ + va_start(ap, fmt); + vsnprintf(s, sizeof(s), fmt, ap); + str_append(gs, s); + va_end(ap); +} + +/* Retrieve value of growable string */ +const char *str_get(struct gstr *gs) +{ + return gs->s; +} + diff --git a/i386/config/yesno.c b/i386/config/yesno.c new file mode 100644 index 0000000..4e6e809 --- /dev/null +++ b/i386/config/yesno.c @@ -0,0 +1,114 @@ +/* + * yesno.c -- implements the yes/no box + * + * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) + * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "dialog.h" + +/* + * Display termination buttons + */ +static void print_buttons(WINDOW * dialog, int height, int width, int selected) +{ + int x = width / 2 - 10; + int y = height - 2; + + print_button(dialog, gettext(" Yes "), y, x, selected == 0); + print_button(dialog, gettext(" No "), y, x + 13, selected == 1); + + wmove(dialog, y, x + 1 + 13 * selected); + wrefresh(dialog); +} + +/* + * Display a dialog box with two buttons - Yes and No + */ +int dialog_yesno(const char *title, const char *prompt, int height, int width) +{ + int i, x, y, key = 0, button = 0; + WINDOW *dialog; + +do_resize: + if (getmaxy(stdscr) < (height + 4)) + return -ERRDISPLAYTOOSMALL; + if (getmaxx(stdscr) < (width + 4)) + return -ERRDISPLAYTOOSMALL; + + /* center dialog box on screen */ + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + draw_shadow(stdscr, y, x, height, width); + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + draw_box(dialog, 0, 0, height, width, + dlg.dialog.atr, dlg.border.atr); + wattrset(dialog, dlg.border.atr); + mvwaddch(dialog, height - 3, 0, ACS_LTEE); + for (i = 0; i < width - 2; i++) + waddch(dialog, ACS_HLINE); + wattrset(dialog, dlg.dialog.atr); + waddch(dialog, ACS_RTEE); + + print_title(dialog, title, width); + + wattrset(dialog, dlg.dialog.atr); + print_autowrap(dialog, prompt, width - 2, 1, 3); + + print_buttons(dialog, height, width, 0); + + while (key != KEY_ESC) { + key = wgetch(dialog); + switch (key) { + case 'Y': + case 'y': + delwin(dialog); + return 0; + case 'N': + case 'n': + delwin(dialog); + return 1; + + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + button = ((key == KEY_LEFT ? --button : ++button) < 0) ? 1 : (button > 1 ? 0 : button); + + print_buttons(dialog, height, width, button); + wrefresh(dialog); + break; + case ' ': + case '\n': + delwin(dialog); + return button; + case KEY_ESC: + key = on_key_esc(dialog); + break; + case KEY_RESIZE: + delwin(dialog); + on_key_resize(); + goto do_resize; + } + } + + delwin(dialog); + return key; /* ESC pressed */ +} diff --git a/i386/config/zconf.hash.c b/i386/config/zconf.hash.c new file mode 100644 index 0000000..4055d5d --- /dev/null +++ b/i386/config/zconf.hash.c @@ -0,0 +1,245 @@ +/* ANSI-C code produced by gperf version 3.0.3 */ +/* Command-line: gperf */ +/* Computed positions: -k'1,3' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + +struct kconf_id; + +static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); +/* maximum key range = 50, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +kconf_id_hash (register const char *str, register unsigned int len) +{ + static unsigned char asso_values[] = + { + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 40, 5, + 0, 0, 5, 52, 0, 20, 52, 52, 10, 20, + 5, 0, 35, 52, 0, 30, 0, 15, 0, 52, + 15, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52 + }; + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[2]]; + /*FALLTHROUGH*/ + case 2: + case 1: + hval += asso_values[(unsigned char)str[0]]; + break; + } + return hval; +} + +struct kconf_id_strings_t + { + char kconf_id_strings_str2[sizeof("on")]; + char kconf_id_strings_str3[sizeof("env")]; + char kconf_id_strings_str5[sizeof("endif")]; + char kconf_id_strings_str6[sizeof("option")]; + char kconf_id_strings_str7[sizeof("endmenu")]; + char kconf_id_strings_str8[sizeof("optional")]; + char kconf_id_strings_str9[sizeof("endchoice")]; + char kconf_id_strings_str10[sizeof("range")]; + char kconf_id_strings_str11[sizeof("choice")]; + char kconf_id_strings_str12[sizeof("default")]; + char kconf_id_strings_str13[sizeof("def_bool")]; + char kconf_id_strings_str14[sizeof("help")]; + char kconf_id_strings_str16[sizeof("config")]; + char kconf_id_strings_str17[sizeof("def_tristate")]; + char kconf_id_strings_str18[sizeof("hex")]; + char kconf_id_strings_str19[sizeof("defconfig_list")]; + char kconf_id_strings_str22[sizeof("if")]; + char kconf_id_strings_str23[sizeof("int")]; + char kconf_id_strings_str27[sizeof("modules")]; + char kconf_id_strings_str28[sizeof("tristate")]; + char kconf_id_strings_str29[sizeof("menu")]; + char kconf_id_strings_str32[sizeof("comment")]; + char kconf_id_strings_str35[sizeof("menuconfig")]; + char kconf_id_strings_str36[sizeof("string")]; + char kconf_id_strings_str37[sizeof("visible")]; + char kconf_id_strings_str41[sizeof("prompt")]; + char kconf_id_strings_str42[sizeof("depends")]; + char kconf_id_strings_str44[sizeof("bool")]; + char kconf_id_strings_str46[sizeof("select")]; + char kconf_id_strings_str47[sizeof("boolean")]; + char kconf_id_strings_str48[sizeof("mainmenu")]; + char kconf_id_strings_str51[sizeof("source")]; + }; +static struct kconf_id_strings_t kconf_id_strings_contents = + { + "on", + "env", + "endif", + "option", + "endmenu", + "optional", + "endchoice", + "range", + "choice", + "default", + "def_bool", + "help", + "config", + "def_tristate", + "hex", + "defconfig_list", + "if", + "int", + "modules", + "tristate", + "menu", + "comment", + "menuconfig", + "string", + "visible", + "prompt", + "depends", + "bool", + "select", + "boolean", + "mainmenu", + "source" + }; +#define kconf_id_strings ((const char *) &kconf_id_strings_contents) +#ifdef __GNUC__ +__inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +struct kconf_id * +kconf_id_lookup (register const char *str, register unsigned int len) +{ + enum + { + TOTAL_KEYWORDS = 32, + MIN_WORD_LENGTH = 2, + MAX_WORD_LENGTH = 14, + MIN_HASH_VALUE = 2, + MAX_HASH_VALUE = 51 + }; + + static struct kconf_id wordlist[] = + { + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2, T_ON, TF_PARAM}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3, T_OPT_ENV, TF_OPTION}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5, T_ENDIF, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str6, T_OPTION, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7, T_ENDMENU, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8, T_OPTIONAL, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9, T_ENDCHOICE, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10, T_RANGE, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str11, T_CHOICE, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_HEX}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT}, + {-1}, {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_TYPE, TF_COMMAND, S_STRING}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_VISIBLE, TF_COMMAND}, + {-1}, {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_PROMPT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_DEPENDS, TF_COMMAND}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str44, T_TYPE, TF_COMMAND, S_BOOLEAN}, + {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND}, + {-1}, {-1}, + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_SOURCE, TF_COMMAND} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = kconf_id_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + { + register int o = wordlist[key].name; + if (o >= 0) + { + register const char *s = o + kconf_id_strings; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') + return &wordlist[key]; + } + } + } + return 0; +} + diff --git a/i386/config/zconf.tab.c b/i386/config/zconf.tab.c new file mode 100644 index 0000000..6b596ab --- /dev/null +++ b/i386/config/zconf.tab.c @@ -0,0 +1,2506 @@ + +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ +#define yyparse zconfparse +#define yylex zconflex +#define yyerror zconferror +#define yylval zconflval +#define yychar zconfchar +#define yydebug zconfdebug +#define yynerrs zconfnerrs + + +/* Copy the first part of user declarations. */ + + +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include + +#define LKC_DIRECT_LINK +#include "lkc.h" + +#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) + +#define PRINTD 0x0001 +#define DEBUG_PARSE 0x0002 + +int cdebug = PRINTD; + +extern int zconflex(void); +static void zconfprint(const char *err, ...); +static void zconf_error(const char *err, ...); +static void zconferror(const char *err); +static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken); + +struct symbol *symbol_hash[SYMBOL_HASHSIZE]; + +static struct menu *current_menu, *current_entry; + +#define YYDEBUG 0 +#if YYDEBUG +#define YYERROR_VERBOSE +#endif + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + T_MAINMENU = 258, + T_MENU = 259, + T_ENDMENU = 260, + T_SOURCE = 261, + T_CHOICE = 262, + T_ENDCHOICE = 263, + T_COMMENT = 264, + T_CONFIG = 265, + T_MENUCONFIG = 266, + T_HELP = 267, + T_HELPTEXT = 268, + T_IF = 269, + T_ENDIF = 270, + T_DEPENDS = 271, + T_OPTIONAL = 272, + T_PROMPT = 273, + T_TYPE = 274, + T_DEFAULT = 275, + T_SELECT = 276, + T_RANGE = 277, + T_VISIBLE = 278, + T_OPTION = 279, + T_ON = 280, + T_WORD = 281, + T_WORD_QUOTE = 282, + T_UNEQUAL = 283, + T_CLOSE_PAREN = 284, + T_OPEN_PAREN = 285, + T_EOL = 286, + T_OR = 287, + T_AND = 288, + T_EQUAL = 289, + T_NOT = 290 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + + + char *string; + struct file *file; + struct symbol *symbol; + struct expr *expr; + struct menu *menu; + struct kconf_id *id; + + + +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Include zconf.hash.c here so it can see the token constants. */ +#include "zconf.hash.c" + + + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 11 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 290 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 36 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 50 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 118 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 191 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 290 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 6, 8, 11, 13, 14, 17, 20, + 23, 26, 31, 36, 40, 42, 44, 46, 48, 50, + 52, 54, 56, 58, 60, 62, 64, 66, 68, 72, + 75, 79, 82, 86, 89, 90, 93, 96, 99, 102, + 105, 108, 112, 117, 122, 127, 133, 137, 138, 142, + 143, 146, 150, 153, 155, 159, 160, 163, 166, 169, + 172, 175, 180, 184, 187, 192, 193, 196, 200, 202, + 206, 207, 210, 213, 216, 220, 224, 228, 230, 234, + 235, 238, 241, 244, 248, 252, 255, 258, 261, 262, + 265, 268, 271, 276, 277, 280, 283, 286, 287, 290, + 292, 294, 297, 300, 303, 305, 308, 309, 312, 314, + 318, 322, 326, 329, 333, 337, 339, 341, 342 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 37, 0, -1, 81, 38, -1, 38, -1, 63, 39, + -1, 39, -1, -1, 39, 41, -1, 39, 55, -1, + 39, 67, -1, 39, 80, -1, 39, 26, 1, 31, + -1, 39, 40, 1, 31, -1, 39, 1, 31, -1, + 16, -1, 18, -1, 19, -1, 21, -1, 17, -1, + 22, -1, 20, -1, 23, -1, 31, -1, 61, -1, + 71, -1, 44, -1, 46, -1, 69, -1, 26, 1, + 31, -1, 1, 31, -1, 10, 26, 31, -1, 43, + 47, -1, 11, 26, 31, -1, 45, 47, -1, -1, + 47, 48, -1, 47, 49, -1, 47, 75, -1, 47, + 73, -1, 47, 42, -1, 47, 31, -1, 19, 78, + 31, -1, 18, 79, 82, 31, -1, 20, 83, 82, + 31, -1, 21, 26, 82, 31, -1, 22, 84, 84, + 82, 31, -1, 24, 50, 31, -1, -1, 50, 26, + 51, -1, -1, 34, 79, -1, 7, 85, 31, -1, + 52, 56, -1, 80, -1, 53, 58, 54, -1, -1, + 56, 57, -1, 56, 75, -1, 56, 73, -1, 56, + 31, -1, 56, 42, -1, 18, 79, 82, 31, -1, + 19, 78, 31, -1, 17, 31, -1, 20, 26, 82, + 31, -1, -1, 58, 41, -1, 14, 83, 81, -1, + 80, -1, 59, 62, 60, -1, -1, 62, 41, -1, + 62, 67, -1, 62, 55, -1, 3, 79, 81, -1, + 4, 79, 31, -1, 64, 76, 74, -1, 80, -1, + 65, 68, 66, -1, -1, 68, 41, -1, 68, 67, + -1, 68, 55, -1, 6, 79, 31, -1, 9, 79, + 31, -1, 70, 74, -1, 12, 31, -1, 72, 13, + -1, -1, 74, 75, -1, 74, 31, -1, 74, 42, + -1, 16, 25, 83, 31, -1, -1, 76, 77, -1, + 76, 31, -1, 23, 82, -1, -1, 79, 82, -1, + 26, -1, 27, -1, 5, 31, -1, 8, 31, -1, + 15, 31, -1, 31, -1, 81, 31, -1, -1, 14, + 83, -1, 84, -1, 84, 34, 84, -1, 84, 28, + 84, -1, 30, 83, 29, -1, 35, 83, -1, 83, + 32, 83, -1, 83, 33, 83, -1, 26, -1, 27, + -1, -1, 26, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 108, 108, 108, 110, 110, 112, 114, 115, 116, + 117, 118, 119, 123, 127, 127, 127, 127, 127, 127, + 127, 127, 131, 132, 133, 134, 135, 136, 140, 141, + 147, 155, 161, 169, 179, 181, 182, 183, 184, 185, + 186, 189, 197, 203, 213, 219, 225, 228, 230, 241, + 242, 247, 256, 261, 269, 272, 274, 275, 276, 277, + 278, 281, 287, 298, 304, 314, 316, 321, 329, 337, + 340, 342, 343, 344, 349, 356, 363, 368, 376, 379, + 381, 382, 383, 386, 394, 401, 408, 414, 421, 423, + 424, 425, 428, 436, 438, 439, 442, 449, 451, 456, + 457, 460, 461, 462, 466, 467, 470, 471, 474, 475, + 476, 477, 478, 479, 480, 483, 484, 487, 488 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", + "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", + "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", + "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", + "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", + "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", + "T_NOT", "$accept", "input", "start", "stmt_list", "option_name", + "common_stmt", "option_error", "config_entry_start", "config_stmt", + "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", + "config_option", "symbol_option", "symbol_option_list", + "symbol_option_arg", "choice", "choice_entry", "choice_end", + "choice_stmt", "choice_option_list", "choice_option", "choice_block", + "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu", + "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt", + "comment", "comment_stmt", "help_start", "help", "depends_list", + "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt", + "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 36, 37, 37, 38, 38, 39, 39, 39, 39, + 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, + 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, + 43, 44, 45, 46, 47, 47, 47, 47, 47, 47, + 47, 48, 48, 48, 48, 48, 49, 50, 50, 51, + 51, 52, 53, 54, 55, 56, 56, 56, 56, 56, + 56, 57, 57, 57, 57, 58, 58, 59, 60, 61, + 62, 62, 62, 62, 63, 64, 65, 66, 67, 68, + 68, 68, 68, 69, 70, 71, 72, 73, 74, 74, + 74, 74, 75, 76, 76, 76, 77, 78, 78, 79, + 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, + 83, 83, 83, 83, 83, 84, 84, 85, 85 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 2, 1, 2, 1, 0, 2, 2, 2, + 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, + 3, 2, 3, 2, 0, 2, 2, 2, 2, 2, + 2, 3, 4, 4, 4, 5, 3, 0, 3, 0, + 2, 3, 2, 1, 3, 0, 2, 2, 2, 2, + 2, 4, 3, 2, 4, 0, 2, 3, 1, 3, + 0, 2, 2, 2, 3, 3, 3, 1, 3, 0, + 2, 2, 2, 3, 3, 2, 2, 2, 0, 2, + 2, 2, 4, 0, 2, 2, 2, 0, 2, 1, + 1, 2, 2, 2, 1, 2, 0, 2, 1, 3, + 3, 3, 2, 3, 3, 1, 1, 0, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 6, 0, 104, 0, 3, 0, 6, 6, 99, 100, + 0, 1, 0, 0, 0, 0, 117, 0, 0, 0, + 0, 0, 0, 14, 18, 15, 16, 20, 17, 19, + 21, 0, 22, 0, 7, 34, 25, 34, 26, 55, + 65, 8, 70, 23, 93, 79, 9, 27, 88, 24, + 10, 0, 105, 2, 74, 13, 0, 101, 0, 118, + 0, 102, 0, 0, 0, 115, 116, 0, 0, 0, + 108, 103, 0, 0, 0, 0, 0, 0, 0, 88, + 0, 0, 75, 83, 51, 84, 30, 32, 0, 112, + 0, 0, 67, 0, 0, 11, 12, 0, 0, 0, + 0, 97, 0, 0, 0, 47, 0, 40, 39, 35, + 36, 0, 38, 37, 0, 0, 97, 0, 59, 60, + 56, 58, 57, 66, 54, 53, 71, 73, 69, 72, + 68, 106, 95, 0, 94, 80, 82, 78, 81, 77, + 90, 91, 89, 111, 113, 114, 110, 109, 29, 86, + 0, 106, 0, 106, 106, 106, 0, 0, 0, 87, + 63, 106, 0, 106, 0, 96, 0, 0, 41, 98, + 0, 0, 106, 49, 46, 28, 0, 62, 0, 107, + 92, 42, 43, 44, 0, 0, 48, 61, 64, 45, + 50 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 5, 33, 34, 108, 35, 36, 37, + 38, 74, 109, 110, 157, 186, 39, 40, 124, 41, + 76, 120, 77, 42, 128, 43, 78, 6, 44, 45, + 137, 46, 80, 47, 48, 49, 111, 112, 81, 113, + 79, 134, 152, 153, 50, 7, 165, 69, 70, 60 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -90 +static const yytype_int16 yypact[] = +{ + 4, 42, -90, 96, -90, 111, -90, 15, -90, -90, + 75, -90, 82, 42, 104, 42, 110, 107, 42, 115, + 125, -4, 121, -90, -90, -90, -90, -90, -90, -90, + -90, 162, -90, 163, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, 139, -90, -90, 138, -90, 142, -90, 143, -90, + 152, -90, 164, 167, 168, -90, -90, -4, -4, 77, + -18, -90, 177, 185, 33, 71, 195, 247, 236, -2, + 236, 171, -90, -90, -90, -90, -90, -90, 41, -90, + -4, -4, 138, 97, 97, -90, -90, 186, 187, 194, + 42, 42, -4, 196, 97, -90, 219, -90, -90, -90, + -90, 210, -90, -90, 204, 42, 42, 199, -90, -90, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, 222, -90, 223, -90, -90, -90, -90, -90, -90, + -90, -90, -90, -90, 215, -90, -90, -90, -90, -90, + -4, 222, 228, 222, -5, 222, 97, 35, 229, -90, + -90, 222, 232, 222, -4, -90, 135, 233, -90, -90, + 234, 235, 222, 240, -90, -90, 237, -90, 239, -13, + -90, -90, -90, -90, 244, 42, -90, -90, -90, -90, + -90 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -90, -90, 269, 271, -90, 23, -70, -90, -90, -90, + -90, 243, -90, -90, -90, -90, -90, -90, -90, -48, + -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, + -90, -20, -90, -90, -90, -90, -90, 206, 205, -68, + -90, -90, 169, -1, 27, -7, 118, -66, -89, -90 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -86 +static const yytype_int16 yytable[] = +{ + 10, 88, 89, 54, 146, 147, 119, 1, 122, 164, + 93, 141, 56, 142, 58, 156, 94, 62, 1, 90, + 91, 131, 65, 66, 144, 145, 67, 90, 91, 132, + 127, 68, 136, -31, 97, 2, 154, -31, -31, -31, + -31, -31, -31, -31, -31, 98, 52, -31, -31, 99, + -31, 100, 101, 102, 103, 104, -31, 105, 129, 106, + 138, 173, 92, 141, 107, 142, 174, 172, 8, 9, + 143, -33, 97, 90, 91, -33, -33, -33, -33, -33, + -33, -33, -33, 98, 166, -33, -33, 99, -33, 100, + 101, 102, 103, 104, -33, 105, 11, 106, 179, 151, + 123, 126, 107, 135, 125, 130, 2, 139, 2, 90, + 91, -5, 12, 55, 161, 13, 14, 15, 16, 17, + 18, 19, 20, 65, 66, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 57, 59, 31, 61, -4, + 12, 63, 32, 13, 14, 15, 16, 17, 18, 19, + 20, 64, 71, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 72, 73, 31, 180, 90, 91, 52, + 32, -85, 97, 82, 83, -85, -85, -85, -85, -85, + -85, -85, -85, 84, 190, -85, -85, 99, -85, -85, + -85, -85, -85, -85, -85, 85, 97, 106, 86, 87, + -52, -52, 140, -52, -52, -52, -52, 98, 95, -52, + -52, 99, 114, 115, 116, 117, 96, 148, 149, 150, + 158, 106, 155, 159, 97, 163, 118, -76, -76, -76, + -76, -76, -76, -76, -76, 160, 164, -76, -76, 99, + 13, 14, 15, 16, 17, 18, 19, 20, 91, 106, + 21, 22, 14, 15, 140, 17, 18, 19, 20, 168, + 175, 21, 22, 177, 181, 182, 183, 32, 187, 167, + 188, 169, 170, 171, 185, 189, 53, 51, 32, 176, + 75, 178, 121, 0, 133, 162, 0, 0, 0, 0, + 184 +}; + +static const yytype_int16 yycheck[] = +{ + 1, 67, 68, 10, 93, 94, 76, 3, 76, 14, + 28, 81, 13, 81, 15, 104, 34, 18, 3, 32, + 33, 23, 26, 27, 90, 91, 30, 32, 33, 31, + 78, 35, 80, 0, 1, 31, 102, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 31, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 78, 26, + 80, 26, 69, 133, 31, 133, 31, 156, 26, 27, + 29, 0, 1, 32, 33, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 150, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 0, 26, 164, 100, + 77, 78, 31, 80, 77, 78, 31, 80, 31, 32, + 33, 0, 1, 31, 115, 4, 5, 6, 7, 8, + 9, 10, 11, 26, 27, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 31, 26, 26, 31, 0, + 1, 26, 31, 4, 5, 6, 7, 8, 9, 10, + 11, 26, 31, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 1, 1, 26, 31, 32, 33, 31, + 31, 0, 1, 31, 31, 4, 5, 6, 7, 8, + 9, 10, 11, 31, 185, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 31, 1, 26, 31, 31, + 5, 6, 31, 8, 9, 10, 11, 12, 31, 14, + 15, 16, 17, 18, 19, 20, 31, 31, 31, 25, + 1, 26, 26, 13, 1, 26, 31, 4, 5, 6, + 7, 8, 9, 10, 11, 31, 14, 14, 15, 16, + 4, 5, 6, 7, 8, 9, 10, 11, 33, 26, + 14, 15, 5, 6, 31, 8, 9, 10, 11, 31, + 31, 14, 15, 31, 31, 31, 31, 31, 31, 151, + 31, 153, 154, 155, 34, 31, 7, 6, 31, 161, + 37, 163, 76, -1, 79, 116, -1, -1, -1, -1, + 172 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 31, 37, 38, 39, 63, 81, 26, 27, + 79, 0, 1, 4, 5, 6, 7, 8, 9, 10, + 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 26, 31, 40, 41, 43, 44, 45, 46, 52, + 53, 55, 59, 61, 64, 65, 67, 69, 70, 71, + 80, 39, 31, 38, 81, 31, 79, 31, 79, 26, + 85, 31, 79, 26, 26, 26, 27, 30, 35, 83, + 84, 31, 1, 1, 47, 47, 56, 58, 62, 76, + 68, 74, 31, 31, 31, 31, 31, 31, 83, 83, + 32, 33, 81, 28, 34, 31, 31, 1, 12, 16, + 18, 19, 20, 21, 22, 24, 26, 31, 42, 48, + 49, 72, 73, 75, 17, 18, 19, 20, 31, 42, + 57, 73, 75, 41, 54, 80, 41, 55, 60, 67, + 80, 23, 31, 74, 77, 41, 55, 66, 67, 80, + 31, 42, 75, 29, 83, 83, 84, 84, 31, 31, + 25, 79, 78, 79, 83, 26, 84, 50, 1, 13, + 31, 79, 78, 26, 14, 82, 83, 82, 31, 82, + 82, 82, 84, 26, 31, 31, 82, 31, 82, 83, + 31, 31, 31, 31, 82, 34, 51, 31, 31, 31, + 79 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + case 53: /* "choice_entry" */ + + { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); + if (current_menu == (yyvaluep->menu)) + menu_end_menu(); +}; + + break; + case 59: /* "if_entry" */ + + { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); + if (current_menu == (yyvaluep->menu)) + menu_end_menu(); +}; + + break; + case 65: /* "menu_entry" */ + + { + fprintf(stderr, "%s:%d: missing end statement for this entry\n", + (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno); + if (current_menu == (yyvaluep->menu)) + menu_end_menu(); +}; + + break; + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 10: + + { zconf_error("unexpected end statement"); ;} + break; + + case 11: + + { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;} + break; + + case 12: + + { + zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name); +;} + break; + + case 13: + + { zconf_error("invalid statement"); ;} + break; + + case 28: + + { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} + break; + + case 29: + + { zconf_error("invalid option"); ;} + break; + + case 30: + + { + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); +;} + break; + + case 31: + + { + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 32: + + { + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); + sym->flags |= SYMBOL_OPTIONAL; + menu_add_entry(sym); + printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); +;} + break; + + case 33: + + { + if (current_entry->prompt) + current_entry->prompt->type = P_MENU; + else + zconfprint("warning: menuconfig statement without prompt"); + menu_end_entry(); + printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 41: + + { + menu_set_type((yyvsp[(1) - (3)].id)->stype); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), + (yyvsp[(1) - (3)].id)->stype); +;} + break; + + case 42: + + { + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 43: + + { + menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); + if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN) + menu_set_type((yyvsp[(1) - (4)].id)->stype); + printd(DEBUG_PARSE, "%s:%d:default(%u)\n", + zconf_curname(), zconf_lineno(), + (yyvsp[(1) - (4)].id)->stype); +;} + break; + + case 44: + + { + menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 45: + + { + menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); + printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 48: + + { + struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); + if (id && id->flags & TF_OPTION) + menu_add_option(id->token, (yyvsp[(3) - (3)].string)); + else + zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string)); + free((yyvsp[(2) - (3)].string)); +;} + break; + + case 49: + + { (yyval.string) = NULL; ;} + break; + + case 50: + + { (yyval.string) = (yyvsp[(2) - (2)].string); ;} + break; + + case 51: + + { + struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); + sym->flags |= SYMBOL_AUTO; + menu_add_entry(sym); + menu_add_expr(P_CHOICE, NULL, NULL); + printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 52: + + { + (yyval.menu) = menu_add_menu(); +;} + break; + + case 53: + + { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); + } +;} + break; + + case 61: + + { + menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 62: + + { + if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { + menu_set_type((yyvsp[(1) - (3)].id)->stype); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), + (yyvsp[(1) - (3)].id)->stype); + } else + YYERROR; +;} + break; + + case 63: + + { + current_entry->sym->flags |= SYMBOL_OPTIONAL; + printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 64: + + { + if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { + menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:default\n", + zconf_curname(), zconf_lineno()); + } else + YYERROR; +;} + break; + + case 67: + + { + printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); + menu_add_entry(NULL); + menu_add_dep((yyvsp[(2) - (3)].expr)); + (yyval.menu) = menu_add_menu(); +;} + break; + + case 68: + + { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); + } +;} + break; + + case 74: + + { + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); +;} + break; + + case 75: + + { + menu_add_entry(NULL); + menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); + printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 76: + + { + (yyval.menu) = menu_add_menu(); +;} + break; + + case 77: + + { + if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { + menu_end_menu(); + printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); + } +;} + break; + + case 83: + + { + printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); + zconf_nextfile((yyvsp[(2) - (3)].string)); +;} + break; + + case 84: + + { + menu_add_entry(NULL); + menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL); + printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 85: + + { + menu_end_entry(); +;} + break; + + case 86: + + { + printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); + zconf_starthelp(); +;} + break; + + case 87: + + { + current_entry->help = (yyvsp[(2) - (2)].string); +;} + break; + + case 92: + + { + menu_add_dep((yyvsp[(3) - (4)].expr)); + printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); +;} + break; + + case 96: + + { + menu_add_visibility((yyvsp[(2) - (2)].expr)); +;} + break; + + case 98: + + { + menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); +;} + break; + + case 101: + + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} + break; + + case 102: + + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} + break; + + case 103: + + { (yyval.id) = (yyvsp[(1) - (2)].id); ;} + break; + + case 106: + + { (yyval.expr) = NULL; ;} + break; + + case 107: + + { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} + break; + + case 108: + + { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} + break; + + case 109: + + { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} + break; + + case 110: + + { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} + break; + + case 111: + + { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} + break; + + case 112: + + { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} + break; + + case 113: + + { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} + break; + + case 114: + + { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} + break; + + case 115: + + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} + break; + + case 116: + + { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} + break; + + case 117: + + { (yyval.string) = NULL; ;} + break; + + + + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + + + + +void conf_parse(const char *name) +{ + struct symbol *sym; + int i; + + zconf_initscan(name); + + sym_init(); + _menu_init(); + modules_sym = sym_lookup(NULL, 0); + modules_sym->type = S_BOOLEAN; + modules_sym->flags |= SYMBOL_AUTO; + rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); + +#if YYDEBUG + if (getenv("ZCONF_DEBUG")) + zconfdebug = 1; +#endif + zconfparse(); + if (zconfnerrs) + exit(1); + if (!modules_sym->prop) { + struct property *prop; + + prop = prop_alloc(P_DEFAULT, modules_sym); + prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0)); + } + + rootmenu.prompt->text = _(rootmenu.prompt->text); + rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text); + + menu_finalize(&rootmenu); + for_all_symbols(i, sym) { + if (sym_check_deps(sym)) + zconfnerrs++; + } + if (zconfnerrs) + exit(1); + sym_set_change_count(1); +} + +static const char *zconf_tokenname(int token) +{ + switch (token) { + case T_MENU: return "menu"; + case T_ENDMENU: return "endmenu"; + case T_CHOICE: return "choice"; + case T_ENDCHOICE: return "endchoice"; + case T_IF: return "if"; + case T_ENDIF: return "endif"; + case T_DEPENDS: return "depends"; + case T_VISIBLE: return "visible"; + } + return ""; +} + +static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken) +{ + if (id->token != endtoken) { + zconf_error("unexpected '%s' within %s block", + kconf_id_strings + id->name, zconf_tokenname(starttoken)); + zconfnerrs++; + return false; + } + if(0) { + //if (current_menu->file != current_file) { + zconf_error("'%s' in different file than '%s'", + kconf_id_strings + id->name, zconf_tokenname(starttoken)); + fprintf(stderr, "%s:%d: location of the '%s'\n", + current_menu->file->name, current_menu->lineno, + zconf_tokenname(starttoken)); + zconfnerrs++; + return false; + } + return true; +} + +static void zconfprint(const char *err, ...) +{ + va_list ap; + + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + va_start(ap, err); + vfprintf(stderr, err, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void zconf_error(const char *err, ...) +{ + va_list ap; + + zconfnerrs++; + fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno()); + va_start(ap, err); + vfprintf(stderr, err, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void zconferror(const char *err) +{ +#if YYDEBUG + fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err); +#endif +} + +static void print_quoted_string(FILE *out, const char *str) +{ + const char *p; + int len; + + putc('"', out); + while ((p = strchr(str, '"'))) { + len = p - str; + if (len) + fprintf(out, "%.*s", len, str); + fputs("\\\"", out); + str = p + 1; + } + fputs(str, out); + putc('"', out); +} + +static void print_symbol(FILE *out, struct menu *menu) +{ + struct symbol *sym = menu->sym; + struct property *prop; + + if (sym_is_choice(sym)) + fprintf(out, "\nchoice\n"); + else + fprintf(out, "\nconfig %s\n", sym->name); + switch (sym->type) { + case S_BOOLEAN: + fputs(" boolean\n", out); + break; + case S_TRISTATE: + fputs(" tristate\n", out); + break; + case S_STRING: + fputs(" string\n", out); + break; + case S_INT: + fputs(" integer\n", out); + break; + case S_HEX: + fputs(" hex\n", out); + break; + default: + fputs(" ???\n", out); + break; + } + for (prop = sym->prop; prop; prop = prop->next) { + if (prop->menu != menu) + continue; + switch (prop->type) { + case P_PROMPT: + fputs(" prompt ", out); + print_quoted_string(out, prop->text); + if (!expr_is_yes(prop->visible.expr)) { + fputs(" if ", out); + expr_fprint(prop->visible.expr, out); + } + fputc('\n', out); + break; + case P_DEFAULT: + fputs( " default ", out); + expr_fprint(prop->expr, out); + if (!expr_is_yes(prop->visible.expr)) { + fputs(" if ", out); + expr_fprint(prop->visible.expr, out); + } + fputc('\n', out); + break; + case P_CHOICE: + fputs(" #choice value\n", out); + break; + case P_SELECT: + fputs( " select ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_RANGE: + fputs( " range ", out); + expr_fprint(prop->expr, out); + fputc('\n', out); + break; + case P_MENU: + fputs( " menu ", out); + print_quoted_string(out, prop->text); + fputc('\n', out); + break; + default: + fprintf(out, " unknown prop %d!\n", prop->type); + break; + } + } + if (menu->help) { + int len = strlen(menu->help); + while (menu->help[--len] == '\n') + menu->help[len] = 0; + fprintf(out, " help\n%s\n", menu->help); + } +} + +void zconfdump(FILE *out) +{ + struct property *prop; + struct symbol *sym; + struct menu *menu; + + menu = rootmenu.list; + while (menu) { + if ((sym = menu->sym)) + print_symbol(out, menu); + else if ((prop = menu->prompt)) { + switch (prop->type) { + case P_COMMENT: + fputs("\ncomment ", out); + print_quoted_string(out, prop->text); + fputs("\n", out); + break; + case P_MENU: + fputs("\nmenu ", out); + print_quoted_string(out, prop->text); + fputs("\n", out); + break; + default: + ; + } + if (!expr_is_yes(prop->visible.expr)) { + fputs(" depends ", out); + expr_fprint(prop->visible.expr, out); + fputc('\n', out); + } + } + + if (menu->list) + menu = menu->list; + else if (menu->next) + menu = menu->next; + else while ((menu = menu->parent)) { + if (menu->prompt && menu->prompt->type == P_MENU) + fputs("\nendmenu\n", out); + if (menu->next) { + menu = menu->next; + break; + } + } + } +} + +#include "lex.zconf.c" +#include "util.c" +#include "confdata.c" +#include "expr.c" +#include "symbol.c" +#include "menu.c" + diff --git a/i386/doc/.svn/all-wcprops b/i386/doc/.svn/all-wcprops new file mode 100644 index 0000000..ad696ce --- /dev/null +++ b/i386/doc/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 54 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/doc +END +Limits +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/doc/Limits +END +README +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/doc/README +END diff --git a/i386/doc/.svn/entries b/i386/doc/.svn/entries new file mode 100644 index 0000000..22d6b1c --- /dev/null +++ b/i386/doc/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/doc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Limits +file + + + + +2013-08-27T23:54:58.000000Z +03c196e10e407060ccc8a7dbc02e2eb9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +67 + +README +file + + + + +2013-08-27T23:54:58.000000Z +362558f4b22af3c89415c74d577351fa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7760 + diff --git a/i386/doc/.svn/text-base/Limits.svn-base b/i386/doc/.svn/text-base/Limits.svn-base new file mode 100644 index 0000000..8f649de --- /dev/null +++ b/i386/doc/.svn/text-base/Limits.svn-base @@ -0,0 +1,2 @@ +The memory map and sizes of various things are in libsa/memory.h. + diff --git a/i386/doc/.svn/text-base/README.svn-base b/i386/doc/.svn/text-base/README.svn-base new file mode 100644 index 0000000..9dd5b8d --- /dev/null +++ b/i386/doc/.svn/text-base/README.svn-base @@ -0,0 +1,173 @@ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + + AT386 Protected Mode Bootstrap Loader + ===================================== + +1. Overview of Startup + ------------------- + + After the system is rebooted, the BIOS bootstrap routine reads Sector + 1, Track 0 into memory at location 0000:7C00H. If location 0000:7DFEH + (last two bytes of that sector) contains the value AA55H, the BIOS + bootstrap routine will transfer control to 0000:7C00H. Otherwise, the + boot code in that sector is bad and the boot routine stops. + + For DOS compatibility reason, one extra stage of boot is required if + the boot device is a hard disk. The first sector of the hard disk will + contain the MS-DOS boot code and a boot record partition table. + When this sector is loaded into 0000:7C00H, it will relocate itself + to somewhere else and then load the first sector of the active + partition into 0000:7C00H. Both UNIX and DOS use the command "fdisk" + to install this first sector into the hard disk and to manipulate + the hard disk partitions. + + + +2. The First Stage Bootstrap Loader + -------------------------------- + + After startup, the first stage boot is loaded at 0000:7C00H. This + first stage boot will load itself and the second stage boot into + memory at location 0000:1000H. For floppy disks, the first cylinder + is reserved as the boot cylinder, and the boot code (first and second) + will be loaded from there. Currently, only double sided, high density + (15 sectors per track) floppies are supported. For hard disks, the + first 29 sectors of the active partition is reserved for boot code + which will be loaded by the first stage boot. All the disk types + recognized by BIOS are supported by this bootstrap loader. + + + +3. The Second Stage Bootstrap Loader + -------------------------------- + + After the boot code is loaded, the control is passed to the second + stage bootstrap loader "boot2()". In order to be able to load the + big kernel image (bigger than 512K or 640K, depends on the memory + configuration), the second stage boot loader will run on the protected + mode. This bootstrap loader does not have any stand alone device + drivers, all the I/O's are through the BIOS calls. Since the first + stage boot code will no longer be used at this moment, the memory + location of the first stage boot code (0000:1000H to 0000:1200H) will + be used as an internal buffer for BIOS calls. Immediately after this + internal buffer is the GDT table for the second stage boot loader. + Since this boot loader needs to switch back and forth between protected + and real mode in order to use BIOS calls, the limit of the boot code + and boot data segments must not be greater than 64K. + + The boot loader loads the kernel image at memory location above 1 MB + to skip the memory hole between 512K/640K and 1MB. After the kernel + is loaded, the boot loader stores the information in the stack and + then passes control to kernel. Currently, the three information passed + from the boot loader to the kernel are type of the boot device, size + of the base memory and size of the extended memory. + + +4. The UNIX Startup + ---------------- + + Since the boot loader loads the kernel image at memory location above + 1MB, the kernel has to start as protected mode. In addition, the + link editor description file (vuifile) has to indicate that + the text and data segments start above 1MB. Also, the boot loader + passes the information to the kernel through the stack. + + +5. Disk Layout and Bad Block Handling + --------------------------------- + + The System V/386 Release 3.2 (AT) disk layout will be used as the disk + layout for the MACH System on the AT platform. + + This disk layout is as follows: + + * Reserve the first sector of cylinder 0 for the DOS boot record which + contains the master boot code (446 bytes) and the partition table. + (Refer to DOS Technical Reference Manual page 9-6 to 9-10). + + * Reserve the first 29 sectors of the UNIX partition for the first + and the second stage bootstrap. + + * Reserve the 30th sector of the UNIX partition for the pdinfo and + the vtoc tables. + + * Reserve the 31st to the 34th sectors of the UNIX partition for the + bad track and the bad block mapping tables. + + * Reserve up to 253 consecutive tracks when required, beginning with + the 35th sector of the UNIX partition, for alternate tracks. + + * Reserve up to 253 consecutive blocks, beginning with the first + sector after the alternate tracks area, for alternate blocks. + + SEC + 1 + ---------------------------------------------------- + | X | | CYL 0, TRK 0 + ---------------- .......... -------------------- + | .......... | + ---------------- .......... -------------------- + | .......... | + =============================================================== + ^ | BOOTSTRAP | CYL N, TRK M + | ---------------------------------------------------- + | | |30 |31 |32 |33 |34 | + ---------------------------------------------------- --- + U | .......... | ^ + N ---------------- .......... --------------------- | + I | .......... | Alternate Tracks + X ---------------- .......... --------------------- | + | .......... | V + P ---------------------------------------------------- --- + A | .......... | ^ + R ---------------- .......... --------------------- | + T | .......... | Alternate Blocks + I ---------------- .......... -------------------- | + T | .......... | V + I ---------------------------------------------------- --- + O | Unix root partition starts from here | + N ---------------- ----------------- + | | + ---------------------------------------------------- + | | + ---------------------------------------------------- + | | + | --------------------------------------------------- + | | | + | ---------------------------------------------------- + V | | + =============================================================== + | ........ | + --------------- ........ -------------- + | ........ | + ---------------------------------------------------- + + + The bad block handling mechanism is as follows: + + * Use the alternate track in the alternate tracks area if the + track containing the target sector is bad. + + * Use the alternate block in the alternate blocks area if the + target sector is bad. + + + + +6. How to make: + ----------- + + Since the kernel image is loaded above 1 MB, the kernel must start + as protected mode. This means that this bootstrap loader will work + only when the corresponding changes on the kernel startup code are done. + + The make command to generate this bootstrap loader is: + + make -f boot.mk fdboot (floppy boot loader) + make -f boot.mk hdboot (wini boot loader) diff --git a/i386/doc/Limits b/i386/doc/Limits new file mode 100644 index 0000000..8f649de --- /dev/null +++ b/i386/doc/Limits @@ -0,0 +1,2 @@ +The memory map and sizes of various things are in libsa/memory.h. + diff --git a/i386/doc/README b/i386/doc/README new file mode 100644 index 0000000..9dd5b8d --- /dev/null +++ b/i386/doc/README @@ -0,0 +1,173 @@ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + + AT386 Protected Mode Bootstrap Loader + ===================================== + +1. Overview of Startup + ------------------- + + After the system is rebooted, the BIOS bootstrap routine reads Sector + 1, Track 0 into memory at location 0000:7C00H. If location 0000:7DFEH + (last two bytes of that sector) contains the value AA55H, the BIOS + bootstrap routine will transfer control to 0000:7C00H. Otherwise, the + boot code in that sector is bad and the boot routine stops. + + For DOS compatibility reason, one extra stage of boot is required if + the boot device is a hard disk. The first sector of the hard disk will + contain the MS-DOS boot code and a boot record partition table. + When this sector is loaded into 0000:7C00H, it will relocate itself + to somewhere else and then load the first sector of the active + partition into 0000:7C00H. Both UNIX and DOS use the command "fdisk" + to install this first sector into the hard disk and to manipulate + the hard disk partitions. + + + +2. The First Stage Bootstrap Loader + -------------------------------- + + After startup, the first stage boot is loaded at 0000:7C00H. This + first stage boot will load itself and the second stage boot into + memory at location 0000:1000H. For floppy disks, the first cylinder + is reserved as the boot cylinder, and the boot code (first and second) + will be loaded from there. Currently, only double sided, high density + (15 sectors per track) floppies are supported. For hard disks, the + first 29 sectors of the active partition is reserved for boot code + which will be loaded by the first stage boot. All the disk types + recognized by BIOS are supported by this bootstrap loader. + + + +3. The Second Stage Bootstrap Loader + -------------------------------- + + After the boot code is loaded, the control is passed to the second + stage bootstrap loader "boot2()". In order to be able to load the + big kernel image (bigger than 512K or 640K, depends on the memory + configuration), the second stage boot loader will run on the protected + mode. This bootstrap loader does not have any stand alone device + drivers, all the I/O's are through the BIOS calls. Since the first + stage boot code will no longer be used at this moment, the memory + location of the first stage boot code (0000:1000H to 0000:1200H) will + be used as an internal buffer for BIOS calls. Immediately after this + internal buffer is the GDT table for the second stage boot loader. + Since this boot loader needs to switch back and forth between protected + and real mode in order to use BIOS calls, the limit of the boot code + and boot data segments must not be greater than 64K. + + The boot loader loads the kernel image at memory location above 1 MB + to skip the memory hole between 512K/640K and 1MB. After the kernel + is loaded, the boot loader stores the information in the stack and + then passes control to kernel. Currently, the three information passed + from the boot loader to the kernel are type of the boot device, size + of the base memory and size of the extended memory. + + +4. The UNIX Startup + ---------------- + + Since the boot loader loads the kernel image at memory location above + 1MB, the kernel has to start as protected mode. In addition, the + link editor description file (vuifile) has to indicate that + the text and data segments start above 1MB. Also, the boot loader + passes the information to the kernel through the stack. + + +5. Disk Layout and Bad Block Handling + --------------------------------- + + The System V/386 Release 3.2 (AT) disk layout will be used as the disk + layout for the MACH System on the AT platform. + + This disk layout is as follows: + + * Reserve the first sector of cylinder 0 for the DOS boot record which + contains the master boot code (446 bytes) and the partition table. + (Refer to DOS Technical Reference Manual page 9-6 to 9-10). + + * Reserve the first 29 sectors of the UNIX partition for the first + and the second stage bootstrap. + + * Reserve the 30th sector of the UNIX partition for the pdinfo and + the vtoc tables. + + * Reserve the 31st to the 34th sectors of the UNIX partition for the + bad track and the bad block mapping tables. + + * Reserve up to 253 consecutive tracks when required, beginning with + the 35th sector of the UNIX partition, for alternate tracks. + + * Reserve up to 253 consecutive blocks, beginning with the first + sector after the alternate tracks area, for alternate blocks. + + SEC + 1 + ---------------------------------------------------- + | X | | CYL 0, TRK 0 + ---------------- .......... -------------------- + | .......... | + ---------------- .......... -------------------- + | .......... | + =============================================================== + ^ | BOOTSTRAP | CYL N, TRK M + | ---------------------------------------------------- + | | |30 |31 |32 |33 |34 | + ---------------------------------------------------- --- + U | .......... | ^ + N ---------------- .......... --------------------- | + I | .......... | Alternate Tracks + X ---------------- .......... --------------------- | + | .......... | V + P ---------------------------------------------------- --- + A | .......... | ^ + R ---------------- .......... --------------------- | + T | .......... | Alternate Blocks + I ---------------- .......... -------------------- | + T | .......... | V + I ---------------------------------------------------- --- + O | Unix root partition starts from here | + N ---------------- ----------------- + | | + ---------------------------------------------------- + | | + ---------------------------------------------------- + | | + | --------------------------------------------------- + | | | + | ---------------------------------------------------- + V | | + =============================================================== + | ........ | + --------------- ........ -------------- + | ........ | + ---------------------------------------------------- + + + The bad block handling mechanism is as follows: + + * Use the alternate track in the alternate tracks area if the + track containing the target sector is bad. + + * Use the alternate block in the alternate blocks area if the + target sector is bad. + + + + +6. How to make: + ----------- + + Since the kernel image is loaded above 1 MB, the kernel must start + as protected mode. This means that this bootstrap loader will work + only when the corresponding changes on the kernel startup code are done. + + The make command to generate this bootstrap loader is: + + make -f boot.mk fdboot (floppy boot loader) + make -f boot.mk hdboot (wini boot loader) diff --git a/i386/include/.svn/all-wcprops b/i386/include/.svn/all-wcprops new file mode 100644 index 0000000..a8cd5f2 --- /dev/null +++ b/i386/include/.svn/all-wcprops @@ -0,0 +1,143 @@ +K 25 +svn:wc:ra_dav:version-url +V 58 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include +END +math.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/math.h +END +time.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/time.h +END +locale.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/locale.h +END +assert.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/assert.h +END +limits.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/limits.h +END +setjmp.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/setjmp.h +END +_types.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/_types.h +END +unwind.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/unwind.h +END +float.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/float.h +END +stdint.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/stdint.h +END +string.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/string.h +END +_structs.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/_structs.h +END +unistd.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/unistd.h +END +stdbool.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/stdbool.h +END +stddef.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/stddef.h +END +runetype.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/runetype.h +END +signal.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/signal.h +END +inttypes.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/inttypes.h +END +stdlib.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/stdlib.h +END +stdio.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/stdio.h +END +stdarg.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/stdarg.h +END +ctype.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ctype.h +END +errno.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/errno.h +END diff --git a/i386/include/.svn/entries b/i386/include/.svn/entries new file mode 100644 index 0000000..8c13cb0 --- /dev/null +++ b/i386/include/.svn/entries @@ -0,0 +1,855 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOKit +dir + +hfs +dir + +architecture +dir + +klibc +dir + +secure +dir + +limits.h +file + + + + +2013-08-27T23:54:50.000000Z +0b1d06204e67d027b02aa7f8097f5dc4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5207 + +_types.h +file + + + + +2013-08-27T23:54:50.000000Z +e6bc97c12da09f52906e2d102c0cbbc1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2192 + +float.h +file + + + + +2013-08-27T23:54:50.000000Z +95045c6185393b4510848e4950f73419 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7980 + +stdint.h +file + + + + +2013-08-27T23:54:50.000000Z +b01c7bf9d29d356f8a799e06ed621bd8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6412 + +string.h +file + + + + +2013-08-27T23:54:50.000000Z +7142d58ad4852880c12c0a6cf6fe2a70 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5977 + +_structs.h +file + + + + +2013-08-27T23:54:50.000000Z +dba114feaa3253e5641c778708751813 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1007 + +ufs +dir + +stddef.h +file + + + + +2013-08-27T23:54:50.000000Z +79969d688241e9efba508e9f38a55017 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5128 + +device +dir + +runetype.h +file + + + + +2013-08-27T23:54:50.000000Z +b08141dc11352fb6af2211b868877112 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4472 + +mach-o +dir + +netinet +dir + +stdlib.h +file + + + + +2013-08-27T23:54:50.000000Z +91dbf4d01dbea46183f0d46bfad90801 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10505 + +stdio.h +file + + + + +2013-08-27T23:54:50.000000Z +74c94da00de683ab332d704cca0b2680 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18238 + +mach +dir + +math.h +file + + + + +2013-08-27T23:54:50.000000Z +250140bb1edfac6ddba3ad1dae444a7f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1265 + +time.h +file + + + + +2013-08-27T23:54:50.000000Z +c6cd4bccc402bf90c400c6ce64c3660d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7313 + +locale.h +file + + + + +2013-08-27T23:54:50.000000Z +987a59a9b1eccf2fb39a1d1020020b90 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2288 + +libkern +dir + +assert.h +file + + + + +2013-08-27T23:54:50.000000Z +51cb1375da711997a90106c61293083c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3531 + +setjmp.h +file + + + + +2013-08-27T23:54:50.000000Z +68667b7b567446dc19be7a3f7bf27105 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1080 + +i386 +dir + +unwind.h +file + + + + +2013-08-27T23:54:50.000000Z +884814dbc9366e7118905e19b738287c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9140 + +netinet6 +dir + +unistd.h +file + + + + +2013-08-27T23:54:50.000000Z +2d6d6bfd5f4c40def01ad486266b35c2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22078 + +stdbool.h +file + + + + +2013-08-27T23:54:50.000000Z +6f72fbba90d3daa81cc3e8c1698a4d70 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1764 + +signal.h +file + + + + +2013-08-27T23:54:50.000000Z +c1fa19604465957f331fa8df13dd988b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6810 + +machine +dir + +inttypes.h +file + + + + +2013-08-27T23:54:50.000000Z +01a16a03811113841b86fc58f5893037 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10193 + +stdarg.h +file + + + + +2013-08-27T23:54:50.000000Z +299844076354e3c2cbe9aaf2fe47fe3d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4298 + +ctype.h +file + + + + +2013-08-27T23:54:50.000000Z +9f3adc131f17cea74989c4dd4599bce7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12389 + +errno.h +file + + + + +2013-08-27T23:54:50.000000Z +05105be977f74d8c1ab839c91b5e3edc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1003 + +sys +dir + diff --git a/i386/include/.svn/text-base/_structs.h.svn-base b/i386/include/.svn/text-base/_structs.h.svn-base new file mode 100644 index 0000000..44443b2 --- /dev/null +++ b/i386/include/.svn/text-base/_structs.h.svn-base @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include + diff --git a/i386/include/.svn/text-base/_types.h.svn-base b/i386/include/.svn/text-base/_types.h.svn-base new file mode 100644 index 0000000..6340283 --- /dev/null +++ b/i386/include/.svn/text-base/_types.h.svn-base @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2004, 2008, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __TYPES_H_ +#define __TYPES_H_ + +#include + +#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +#define __strfmonlike(fmtarg, firstvararg) \ + __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) +#define __strftimelike(fmtarg) \ + __attribute__((__format__ (__strftime__, fmtarg, 0))) +#else +#define __strfmonlike(fmtarg, firstvararg) +#define __strftimelike(fmtarg) +#endif + +typedef int __darwin_nl_item; +typedef int __darwin_wctrans_t; +#ifdef __LP64__ +typedef __uint32_t __darwin_wctype_t; +#else /* !__LP64__ */ +typedef unsigned long __darwin_wctype_t; +#endif /* __LP64__ */ + +#ifdef __WCHAR_MAX__ +#define __DARWIN_WCHAR_MAX __WCHAR_MAX__ +#else /* ! __WCHAR_MAX__ */ +#define __DARWIN_WCHAR_MAX 0x7fffffff +#endif /* __WCHAR_MAX__ */ + +#if __DARWIN_WCHAR_MAX > 0xffffU +#define __DARWIN_WCHAR_MIN (-0x7fffffff - 1) +#else +#define __DARWIN_WCHAR_MIN 0 +#endif +#define __DARWIN_WEOF ((__darwin_wint_t)-1) + +#ifndef _FORTIFY_SOURCE +# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) +# define _FORTIFY_SOURCE 0 +# else +# define _FORTIFY_SOURCE 2 /* on by default */ +# endif +#endif + +#endif /* __TYPES_H_ */ diff --git a/i386/include/.svn/text-base/assert.h.svn-base b/i386/include/.svn/text-base/assert.h.svn-base new file mode 100644 index 0000000..1bfea51 --- /dev/null +++ b/i386/include/.svn/text-base/assert.h.svn-base @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)assert.h 8.2 (Berkeley) 1/21/94 + * $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $ + */ + +#include +#ifdef __cplusplus +#include +#endif /* __cplusplus */ + +/* + * Unlike other ANSI header files, may usefully be included + * multiple times, with and without NDEBUG defined. + */ + +#undef assert +#undef __assert + +#ifdef NDEBUG +#define assert(e) ((void)0) +#else + +#ifndef __GNUC__ + +__BEGIN_DECLS +#ifndef __cplusplus +void abort(void) __dead2; +#endif /* !__cplusplus */ +int printf(const char * __restrict, ...); +__END_DECLS + +#define assert(e) \ + ((void) ((e) ? 0 : __assert (#e, __FILE__, __LINE__))) +#define __assert(e, file, line) \ + ((void)printf ("%s:%u: failed assertion `%s'\n", file, line, e), abort()) + +#else /* __GNUC__ */ + +__BEGIN_DECLS +void __assert_rtn(const char *, const char *, int, const char *) __dead2; +void __eprintf(const char *, const char *, unsigned, const char *) __dead2; +__END_DECLS + +#define __assert(e, file, line) \ + __eprintf ("%s:%u: failed assertion `%s'\n", file, line, e) + +#if __DARWIN_UNIX03 +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) +#else /* !__DARWIN_UNIX03 */ +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0) +#endif /* __DARWIN_UNIX03 */ + +#endif /* __GNUC__ */ +#endif /* NDEBUG */ diff --git a/i386/include/.svn/text-base/ctype.h.svn-base b/i386/include/.svn/text-base/ctype.h.svn-base new file mode 100644 index 0000000..58dca3d --- /dev/null +++ b/i386/include/.svn/text-base/ctype.h.svn-base @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ctype.h 8.4 (Berkeley) 1/21/94 + */ + +//Begin-Libc +//#include "xlocale_private.h" +//End-Libc +#ifndef _CTYPE_H_ +#define _CTYPE_H_ + +#include + +#define _CTYPE_A 0x00000100L /* Alpha */ +#define _CTYPE_C 0x00000200L /* Control */ +#define _CTYPE_D 0x00000400L /* Digit */ +#define _CTYPE_G 0x00000800L /* Graph */ +#define _CTYPE_L 0x00001000L /* Lower */ +#define _CTYPE_P 0x00002000L /* Punct */ +#define _CTYPE_S 0x00004000L /* Space */ +#define _CTYPE_U 0x00008000L /* Upper */ +#define _CTYPE_X 0x00010000L /* X digit */ +#define _CTYPE_B 0x00020000L /* Blank */ +#define _CTYPE_R 0x00040000L /* Print */ +#define _CTYPE_I 0x00080000L /* Ideogram */ +#define _CTYPE_T 0x00100000L /* Special */ +#define _CTYPE_Q 0x00200000L /* Phonogram */ +#define _CTYPE_SW0 0x20000000L /* 0 width character */ +#define _CTYPE_SW1 0x40000000L /* 1 width character */ +#define _CTYPE_SW2 0x80000000L /* 2 width character */ +#define _CTYPE_SW3 0xc0000000L /* 3 width character */ +#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */ +#define _CTYPE_SWS 30 /* Bits to shift to get width */ + +#ifdef _NONSTD_SOURCE +/* + * Backward compatibility + */ +#define _A _CTYPE_A /* Alpha */ +#define _C _CTYPE_C /* Control */ +#define _D _CTYPE_D /* Digit */ +#define _G _CTYPE_G /* Graph */ +#define _L _CTYPE_L /* Lower */ +#define _P _CTYPE_P /* Punct */ +#define _S _CTYPE_S /* Space */ +#define _U _CTYPE_U /* Upper */ +#define _X _CTYPE_X /* X digit */ +#define _B _CTYPE_B /* Blank */ +#define _R _CTYPE_R /* Print */ +#define _I _CTYPE_I /* Ideogram */ +#define _T _CTYPE_T /* Special */ +#define _Q _CTYPE_Q /* Phonogram */ +#define _SW0 _CTYPE_SW0 /* 0 width character */ +#define _SW1 _CTYPE_SW1 /* 1 width character */ +#define _SW2 _CTYPE_SW2 /* 2 width character */ +#define _SW3 _CTYPE_SW3 /* 3 width character */ +#endif /* _NONSTD_SOURCE */ + +/* + * _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us + * to generate code for extern versions of all intermediate inline functions. + */ +#ifdef _EXTERNALIZE_CTYPE_INLINES_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_CTYPE_static_inline +#else /* !_EXTERNALIZE_CTYPE_INLINES_ */ +#define __DARWIN_CTYPE_static_inline static __inline +#endif /* !_EXTERNALIZE_CTYPE_INLINES_ */ + +/* + * _EXTERNALIZE_CTYPE_INLINES_TOP_ is defined in locale/isctype.c to tell us + * to generate code for extern versions of all top-level inline functions. + */ +#ifdef _EXTERNALIZE_CTYPE_INLINES_TOP_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_CTYPE_TOP_static_inline +#else /* !_EXTERNALIZE_CTYPE_INLINES_TOP_ */ +#define __DARWIN_CTYPE_TOP_static_inline static __inline +#endif /* _EXTERNALIZE_CTYPE_INLINES_TOP_ */ + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +/* See comments in about __darwin_ct_rune_t. */ +__BEGIN_DECLS +unsigned long ___runetype(__darwin_ct_rune_t); +__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t); +__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t); +__END_DECLS + +__DARWIN_CTYPE_TOP_static_inline int +isascii(int _c) +{ + return ((_c & ~0x7F) == 0); +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_static_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + return _DefaultRuneLocale.__runetype[_c & 0xff] & _f; +} +//Begin-Libc +#elif defined(__LIBC__) +__DARWIN_CTYPE_static_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & _f; +} +//End-Libc +#else /* !USE_ASCII */ +__BEGIN_DECLS +int __maskrune(__darwin_ct_rune_t, unsigned long); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_static_inline int +__istype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f) + : !!__maskrune(_c, _f)); +#endif /* USE_ASCII */ +} + +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__isctype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : + !!(_DefaultRuneLocale.__runetype[_c] & _f); +#endif /* USE_ASCII */ +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__mapupper[_c & 0xff]; +} + +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__maplower[_c & 0xff]; +} +//Begin-Libc +#elif defined(__LIBC__) +/* + * We can't do what we do for __toupper_l() (check for ASCII first, then call + * ___toupper_l() otherwise) because versions of ___toupper() before Tiger + * assume c >= _CACHED_RUNES. So we are stuck making __toupper() a routine + * to hide the extended locale details, outside of Libc. + */ +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__mapupper[_c]; +} + +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__maplower[_c]; +} +//End-Libc +#else /* !USE_ASCII */ +__BEGIN_DECLS +__darwin_ct_rune_t __toupper(__darwin_ct_rune_t); +__darwin_ct_rune_t __tolower(__darwin_ct_rune_t); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_static_inline int +__wcwidth(__darwin_ct_rune_t _c) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} + +#ifndef _EXTERNALIZE_CTYPE_INLINES_ + +#define _tolower(c) __tolower(c) +#define _toupper(c) __toupper(c) + +__DARWIN_CTYPE_TOP_static_inline int +isalnum(int _c) +{ + return (__istype(_c, _CTYPE_A|_CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isalpha(int _c) +{ + return (__istype(_c, _CTYPE_A)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isblank(int _c) +{ + return (__istype(_c, _CTYPE_B)); +} + +__DARWIN_CTYPE_TOP_static_inline int +iscntrl(int _c) +{ + return (__istype(_c, _CTYPE_C)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_static_inline int +isdigit(int _c) +{ + return (__isctype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isgraph(int _c) +{ + return (__istype(_c, _CTYPE_G)); +} + +__DARWIN_CTYPE_TOP_static_inline int +islower(int _c) +{ + return (__istype(_c, _CTYPE_L)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isprint(int _c) +{ + return (__istype(_c, _CTYPE_R)); +} + +__DARWIN_CTYPE_TOP_static_inline int +ispunct(int _c) +{ + return (__istype(_c, _CTYPE_P)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isspace(int _c) +{ + return (__istype(_c, _CTYPE_S)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isupper(int _c) +{ + return (__istype(_c, _CTYPE_U)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_static_inline int +isxdigit(int _c) +{ + return (__isctype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_static_inline int +toascii(int _c) +{ + return (_c & 0x7F); +} + +__DARWIN_CTYPE_TOP_static_inline int +tolower(int _c) +{ + return (__tolower(_c)); +} + +__DARWIN_CTYPE_TOP_static_inline int +toupper(int _c) +{ + return (__toupper(_c)); +} + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +__DARWIN_CTYPE_TOP_static_inline int +digittoint(int _c) +{ + return (__maskrune(_c, 0x0F)); +} + +__DARWIN_CTYPE_TOP_static_inline int +ishexnumber(int _c) +{ + return (__istype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isideogram(int _c) +{ + return (__istype(_c, _CTYPE_I)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isnumber(int _c) +{ + return (__istype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isphonogram(int _c) +{ + return (__istype(_c, _CTYPE_Q)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isrune(int _c) +{ + return (__istype(_c, 0xFFFFFFF0L)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isspecial(int _c) +{ + return (__istype(_c, _CTYPE_T)); +} +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* _EXTERNALIZE_CTYPE_INLINES_ */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int isalnum(int); +int isalpha(int); +int isblank(int); +int iscntrl(int); +int isdigit(int); +int isgraph(int); +int islower(int); +int isprint(int); +int ispunct(int); +int isspace(int); +int isupper(int); +int isxdigit(int); +int tolower(int); +int toupper(int); +int isascii(int); +int toascii(int); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int _tolower(int); +int _toupper(int); +int digittoint(int); +int ishexnumber(int); +int isideogram(int); +int isnumber(int); +int isphonogram(int); +int isrune(int); +int isspecial(int); +#endif +__END_DECLS + +#endif /* using inlines */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_CTYPE_H_ */ diff --git a/i386/include/.svn/text-base/errno.h.svn-base b/i386/include/.svn/text-base/errno.h.svn-base new file mode 100644 index 0000000..9879cc4 --- /dev/null +++ b/i386/include/.svn/text-base/errno.h.svn-base @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include + diff --git a/i386/include/.svn/text-base/float.h.svn-base b/i386/include/.svn/text-base/float.h.svn-base new file mode 100644 index 0000000..84fd005 --- /dev/null +++ b/i386/include/.svn/text-base/float.h.svn-base @@ -0,0 +1,281 @@ +/* This file exists soley to keep Metrowerks' compilers happy. The version + used by GCC can be found in /usr/lib/gcc, although it's + not very informative. */ + +#ifndef _FLOAT_H_ + +#if defined(__GNUC__) +#include_next + +#elif defined(__MWERKS__) +#define _FLOAT_H_ + +/* APPLE LOCAL begin MW compatibility */ +/* Define various characteristics of floating-point types, if needed. */ +#ifndef __FLT_RADIX__ +#define __FLT_RADIX__ 2 +#endif +#ifndef __FLT_MANT_DIG__ +#define __FLT_MANT_DIG__ 24 +#endif +#ifndef __FLT_DIG__ +#define __FLT_DIG__ 6 +#endif +#ifndef __FLT_EPSILON__ +#define __FLT_EPSILON__ 1.19209290e-07F +#endif +#ifndef __FLT_MIN__ +#define __FLT_MIN__ 1.17549435e-38F +#endif +#ifndef __FLT_MAX__ +#define __FLT_MAX__ 3.40282347e+38F +#endif +#ifndef __FLT_MIN_EXP__ +#define __FLT_MIN_EXP__ (-125) +#endif +#ifndef __FLT_MIN_10_EXP__ +#define __FLT_MIN_10_EXP__ (-37) +#endif +#ifndef __FLT_MAX_EXP__ +#define __FLT_MAX_EXP__ 128 +#endif +#ifndef __FLT_MAX_10_EXP__ +#define __FLT_MAX_10_EXP__ 38 +#endif +#ifndef __DBL_MANT_DIG__ +#define __DBL_MANT_DIG__ 53 +#endif +#ifndef __DBL_DIG__ +#define __DBL_DIG__ 15 +#endif +#ifndef __DBL_EPSILON__ +#define __DBL_EPSILON__ 2.2204460492503131e-16 +#endif +#ifndef __DBL_MIN__ +#define __DBL_MIN__ 2.2250738585072014e-308 +#endif +#ifndef __DBL_MAX__ +#define __DBL_MAX__ 1.7976931348623157e+308 +#endif +#ifndef __DBL_MIN_EXP__ +#define __DBL_MIN_EXP__ (-1021) +#endif +#ifndef __DBL_MIN_10_EXP__ +#define __DBL_MIN_10_EXP__ (-307) +#endif +#ifndef __DBL_MAX_EXP__ +#define __DBL_MAX_EXP__ 1024 +#endif +#ifndef __DBL_MAX_10_EXP__ +#define __DBL_MAX_10_EXP__ 308 +#endif +#ifndef __LDBL_MANT_DIG__ +#define __LDBL_MANT_DIG__ 53 +#endif +#ifndef __LDBL_DIG__ +#define __LDBL_DIG__ 15 +#endif +#ifndef __LDBL_EPSILON__ +#define __LDBL_EPSILON__ 2.2204460492503131e-16 +#endif +#ifndef __LDBL_MIN__ +#define __LDBL_MIN__ 2.2250738585072014e-308 +#endif +#ifndef __LDBL_MAX__ +#define __LDBL_MAX__ 1.7976931348623157e+308 +#endif +#ifndef __LDBL_MIN_EXP__ +#define __LDBL_MIN_EXP__ (-1021) +#endif +#ifndef __LDBL_MIN_10_EXP__ +#define __LDBL_MIN_10_EXP__ (-307) +#endif +#ifndef __LDBL_MAX_EXP__ +#define __LDBL_MAX_EXP__ 1024 +#endif +#ifndef __LDBL_MAX_10_EXP__ +#define __LDBL_MAX_10_EXP__ 308 +#endif +/* APPLE LOCAl end MW compatibility */ + +/* Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* + * ISO C Standard: 5.2.4.2.2 Characteristics of floating types + */ + + +/* Radix of exponent representation, b. */ +#undef FLT_RADIX +#define FLT_RADIX __FLT_RADIX__ + +/* Number of base-FLT_RADIX digits in the significand, p. */ +#undef FLT_MANT_DIG +#undef DBL_MANT_DIG +#undef LDBL_MANT_DIG +#define FLT_MANT_DIG __FLT_MANT_DIG__ +#define DBL_MANT_DIG __DBL_MANT_DIG__ +#define LDBL_MANT_DIG __LDBL_MANT_DIG__ + +/* Number of decimal digits, q, such that any floating-point number with q + decimal digits can be rounded into a floating-point number with p radix b + digits and back again without change to the q decimal digits, + + p * log10(b) if b is a power of 10 + floor((p - 1) * log10(b)) otherwise +*/ +#undef FLT_DIG +#undef DBL_DIG +#undef LDBL_DIG +#define FLT_DIG __FLT_DIG__ +#define DBL_DIG __DBL_DIG__ +#define LDBL_DIG __LDBL_DIG__ + +/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ +#undef FLT_MIN_EXP +#undef DBL_MIN_EXP +#undef LDBL_MIN_EXP +#define FLT_MIN_EXP __FLT_MIN_EXP__ +#define DBL_MIN_EXP __DBL_MIN_EXP__ +#define LDBL_MIN_EXP __LDBL_MIN_EXP__ + +/* Minimum negative integer such that 10 raised to that power is in the + range of normalized floating-point numbers, + + ceil(log10(b) * (emin - 1)) +*/ +#undef FLT_MIN_10_EXP +#undef DBL_MIN_10_EXP +#undef LDBL_MIN_10_EXP +#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ +#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ +#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ + +/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ +#undef FLT_MAX_EXP +#undef DBL_MAX_EXP +#undef LDBL_MAX_EXP +#define FLT_MAX_EXP __FLT_MAX_EXP__ +#define DBL_MAX_EXP __DBL_MAX_EXP__ +#define LDBL_MAX_EXP __LDBL_MAX_EXP__ + +/* Maximum integer such that 10 raised to that power is in the range of + representable finite floating-point numbers, + + floor(log10((1 - b**-p) * b**emax)) +*/ +#undef FLT_MAX_10_EXP +#undef DBL_MAX_10_EXP +#undef LDBL_MAX_10_EXP +#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ +#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ +#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ + +/* Maximum representable finite floating-point number, + + (1 - b**-p) * b**emax +*/ +#undef FLT_MAX +#undef DBL_MAX +#undef LDBL_MAX +#define FLT_MAX __FLT_MAX__ +#define DBL_MAX __DBL_MAX__ +#define LDBL_MAX __LDBL_MAX__ + +/* The difference between 1 and the least value greater than 1 that is + representable in the given floating point type, b**1-p. */ +#undef FLT_EPSILON +#undef DBL_EPSILON +#undef LDBL_EPSILON +#define FLT_EPSILON __FLT_EPSILON__ +#define DBL_EPSILON __DBL_EPSILON__ +#define LDBL_EPSILON __LDBL_EPSILON__ + +/* Minimum normalized positive floating-point number, b**(emin - 1). */ +#undef FLT_MIN +#undef DBL_MIN +#undef LDBL_MIN +#define FLT_MIN __FLT_MIN__ +#define DBL_MIN __DBL_MIN__ +#define LDBL_MIN __LDBL_MIN__ + +/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ +/* ??? This is supposed to change with calls to fesetround in . */ +#undef FLT_ROUNDS +#define FLT_ROUNDS 1 + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* The floating-point expression evaluation method. + -1 indeterminate + 0 evaluate all operations and constants just to the range and + precision of the type + 1 evaluate operations and constants of type float and double + to the range and precision of the double type, evaluate + long double operations and constants to the range and + precision of the long double type + 2 evaluate all operations and constants to the range and + precision of the long double type + + ??? This ought to change with the setting of the fp control word; + the value provided by the compiler assumes the widest setting. */ +#undef FLT_EVAL_METHOD +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ + +/* Number of decimal digits, n, such that any floating-point number in the + widest supported floating type with pmax radix b digits can be rounded + to a floating-point number with n decimal digits and back again without + change to the value, + + pmax * log10(b) if b is a power of 10 + ceil(1 + pmax * log10(b)) otherwise +*/ +#undef DECIMAL_DIG +#define DECIMAL_DIG __DECIMAL_DIG__ + +#endif /* C99 */ + +#ifdef __cplusplus +extern "C" { +#endif +extern int __fegetfltrounds( void ); +#ifdef __cplusplus +} +#endif +#undef FLT_ROUNDS +#define FLT_ROUNDS (__fegetfltrounds ()) +/* End of GNU CC file */ + +/* APPLE LOCAL begin CW compatibility */ +/* CodeWarrior defines the following on its own. */ +#undef DECIMAL_DIG +/* APPLE LOCAL end CW compatibility */ + +#else +#error This file is only for Metrowerks compatibilty. +#endif + +#endif /* _FLOAT_H_ */ diff --git a/i386/include/.svn/text-base/inttypes.h.svn-base b/i386/include/.svn/text-base/inttypes.h.svn-base new file mode 100644 index 0000000..4f9dd8d --- /dev/null +++ b/i386/include/.svn/text-base/inttypes.h.svn-base @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2000, 2001, 2002, 2003, 2004 Apple Computer, Inc. + * All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * -- Standard C header, defined in ISO/IEC 9899:1999 + * (aka "C99"), section 7.8. This defines format string conversion + * specifiers suitable for use within arguments to fprintf and fscanf + * and their ilk. + */ + +/* "C++ implementations should define these macros only when + * __STDC_FORMAT_MACROS is defined before is included." + */ +#if (!defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)) && !defined(__STDC_FORMAT_MACROS_DEFINED) +#define __STDC_FORMAT_MACROS_DEFINED + +# undef __PRI_8_LENGTH_MODIFIER__ +# undef __PRI_64_LENGTH_MODIFIER__ +# undef __SCN_64_LENGTH_MODIFIER__ + +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 > 1020 +# define __PRI_8_LENGTH_MODIFIER__ "hh" +# define __PRI_64_LENGTH_MODIFIER__ "ll" +# define __SCN_64_LENGTH_MODIFIER__ "ll" +# else +/* These could be "hh", "ll", and "ll" respectively, but that doesn't work on + 10.2, and these do. Note that there's no way to use scanf to scan a + decimal into a 'char' argument on 10.2, so "hh" is used unconditionally + and programs that use it won't work on Jaguar. */ +# define __PRI_8_LENGTH_MODIFIER__ "" /* none */ +# define __PRI_64_LENGTH_MODIFIER__ "q" +# define __SCN_64_LENGTH_MODIFIER__ "q" +# endif +# define __PRI_MAX_LENGTH_MODIFIER__ "j" +# define __SCN_MAX_LENGTH_MODIFIER__ "j" + +# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d" +# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x" +# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X" + +# define PRId16 "hd" +# define PRIi16 "hi" +# define PRIo16 "ho" +# define PRIu16 "hu" +# define PRIx16 "hx" +# define PRIX16 "hX" + +# define PRId32 "d" +# define PRIi32 "i" +# define PRIo32 "o" +# define PRIu32 "u" +# define PRIx32 "x" +# define PRIX32 "X" + +# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d" +# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i" +# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o" +# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u" +# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x" +# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X" + +# define PRIdLEAST8 PRId8 +# define PRIiLEAST8 PRIi8 +# define PRIoLEAST8 PRIo8 +# define PRIuLEAST8 PRIu8 +# define PRIxLEAST8 PRIx8 +# define PRIXLEAST8 PRIX8 + +# define PRIdLEAST16 PRId16 +# define PRIiLEAST16 PRIi16 +# define PRIoLEAST16 PRIo16 +# define PRIuLEAST16 PRIu16 +# define PRIxLEAST16 PRIx16 +# define PRIXLEAST16 PRIX16 + +# define PRIdLEAST32 PRId32 +# define PRIiLEAST32 PRIi32 +# define PRIoLEAST32 PRIo32 +# define PRIuLEAST32 PRIu32 +# define PRIxLEAST32 PRIx32 +# define PRIXLEAST32 PRIX32 + +# define PRIdLEAST64 PRId64 +# define PRIiLEAST64 PRIi64 +# define PRIoLEAST64 PRIo64 +# define PRIuLEAST64 PRIu64 +# define PRIxLEAST64 PRIx64 +# define PRIXLEAST64 PRIX64 + +# define PRIdFAST8 PRId8 +# define PRIiFAST8 PRIi8 +# define PRIoFAST8 PRIo8 +# define PRIuFAST8 PRIu8 +# define PRIxFAST8 PRIx8 +# define PRIXFAST8 PRIX8 + +# define PRIdFAST16 PRId16 +# define PRIiFAST16 PRIi16 +# define PRIoFAST16 PRIo16 +# define PRIuFAST16 PRIu16 +# define PRIxFAST16 PRIx16 +# define PRIXFAST16 PRIX16 + +# define PRIdFAST32 PRId32 +# define PRIiFAST32 PRIi32 +# define PRIoFAST32 PRIo32 +# define PRIuFAST32 PRIu32 +# define PRIxFAST32 PRIx32 +# define PRIXFAST32 PRIX32 + +# define PRIdFAST64 PRId64 +# define PRIiFAST64 PRIi64 +# define PRIoFAST64 PRIo64 +# define PRIuFAST64 PRIu64 +# define PRIxFAST64 PRIx64 +# define PRIXFAST64 PRIX64 + +/* int32_t is 'int', but intptr_t is 'long'. */ +# define PRIdPTR "ld" +# define PRIiPTR "li" +# define PRIoPTR "lo" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +# define PRIXPTR "lX" + +# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d" +# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i" +# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o" +# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u" +# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x" +# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X" + +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 > 1020 +# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d" +# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x" +# else +# define SCNd8 "hhd" +# define SCNi8 "hhi" +# define SCNo8 "hho" +# define SCNu8 "hhu" +# define SCNx8 "hhx" +# endif + +# define SCNd16 "hd" +# define SCNi16 "hi" +# define SCNo16 "ho" +# define SCNu16 "hu" +# define SCNx16 "hx" + +# define SCNd32 "d" +# define SCNi32 "i" +# define SCNo32 "o" +# define SCNu32 "u" +# define SCNx32 "x" + +# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d" +# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i" +# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o" +# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u" +# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x" + +# define SCNdLEAST8 SCNd8 +# define SCNiLEAST8 SCNi8 +# define SCNoLEAST8 SCNo8 +# define SCNuLEAST8 SCNu8 +# define SCNxLEAST8 SCNx8 + +# define SCNdLEAST16 SCNd16 +# define SCNiLEAST16 SCNi16 +# define SCNoLEAST16 SCNo16 +# define SCNuLEAST16 SCNu16 +# define SCNxLEAST16 SCNx16 + +# define SCNdLEAST32 SCNd32 +# define SCNiLEAST32 SCNi32 +# define SCNoLEAST32 SCNo32 +# define SCNuLEAST32 SCNu32 +# define SCNxLEAST32 SCNx32 + +# define SCNdLEAST64 SCNd64 +# define SCNiLEAST64 SCNi64 +# define SCNoLEAST64 SCNo64 +# define SCNuLEAST64 SCNu64 +# define SCNxLEAST64 SCNx64 + +# define SCNdFAST8 SCNd8 +# define SCNiFAST8 SCNi8 +# define SCNoFAST8 SCNo8 +# define SCNuFAST8 SCNu8 +# define SCNxFAST8 SCNx8 + +# define SCNdFAST16 SCNd16 +# define SCNiFAST16 SCNi16 +# define SCNoFAST16 SCNo16 +# define SCNuFAST16 SCNu16 +# define SCNxFAST16 SCNx16 + +# define SCNdFAST32 SCNd32 +# define SCNiFAST32 SCNi32 +# define SCNoFAST32 SCNo32 +# define SCNuFAST32 SCNu32 +# define SCNxFAST32 SCNx32 + +# define SCNdFAST64 SCNd64 +# define SCNiFAST64 SCNi64 +# define SCNoFAST64 SCNo64 +# define SCNuFAST64 SCNu64 +# define SCNxFAST64 SCNx64 + +# define SCNdPTR "ld" +# define SCNiPTR "li" +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" + +# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d" +# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i" +# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o" +# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u" +# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x" + +#endif /* if C++, then __STDC_FORMAT_MACROS enables the above macros */ + +#if !defined(_INTTYPES_H_) +#define _INTTYPES_H_ + +#include /* For __BEGIN_DECLS and __END_DECLS */ +#include <_types.h> /* For __darwin_wchar_t */ +#include + +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) + /* Translator is not ISO/IEC 9899:1999-compliant. */ +# if !defined(restrict) +# define restrict +# define __RESTRICT_KEYWORD_DEFINED__ +# endif +#endif + +__BEGIN_DECLS + + /* 7.8.2.1 */ + extern intmax_t imaxabs(intmax_t j); + + /* 7.8.2.2 */ + typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + + extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); + + /* 7.8.2.3 */ + extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base); + extern uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base); + +#ifndef __cplusplus /* wchar_t is a built-in type in C++ */ +# ifndef _WCHAR_T +# define _WCHAR_T + typedef __darwin_wchar_t wchar_t; +# endif /* _WCHAR_T */ +#endif /* __cplusplus */ + + /* 7.8.2.4 */ + extern intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); + extern uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison wcstoimax wcstoumax +#endif + +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +/* + No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros; + in fact, you can't #undef them, because later uses of any of + their dependents will *not* then do the intended substitution. + Expansion of a #define like this one: + + #define x IDENT y + + uses the cpp value of IDENT at the location where x is *expanded*, + not where it is #defined. +*/ + +#if defined(__RESTRICT_KEYWORD_DEFINED__) +# undef restrict +# undef __RESTRICT_KEYWORD_DEFINED__ +#endif + +#endif /* !_INTTYPES_H_ */ diff --git a/i386/include/.svn/text-base/limits.h.svn-base b/i386/include/.svn/text-base/limits.h.svn-base new file mode 100644 index 0000000..a117167 --- /dev/null +++ b/i386/include/.svn/text-base/limits.h.svn-base @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: limits.h,v 1.8 1996/10/21 05:10:50 jtc Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _LIMITS_H_ +#define _LIMITS_H_ + +#include +#include +#include + +#if !defined(_ANSI_SOURCE) +#define _POSIX_AIO_LISTIO_MAX 2 +#define _POSIX_AIO_MAX 1 +#define _POSIX_DELAYTIMER_MAX 32 +#define _POSIX_HOST_NAME_MAX 255 +#define _POSIX_LOGIN_NAME_MAX 9 +#define _POSIX_MQ_OPEN_MAX 8 +#define _POSIX_MQ_PRIO_MAX 32 + +#define _POSIX_ARG_MAX 4096 +#define _POSIX_CHILD_MAX 25 +#define _POSIX_LINK_MAX 8 +#define _POSIX_MAX_CANON 255 +#define _POSIX_MAX_INPUT 255 +#define _POSIX_NAME_MAX 14 +#define _POSIX_NGROUPS_MAX 8 +#define _POSIX_OPEN_MAX 20 +#define _POSIX_PATH_MAX 256 +#define _POSIX_PIPE_BUF 512 +#define _POSIX_SSIZE_MAX 32767 +#define _POSIX_STREAM_MAX 8 +#define _POSIX_TZNAME_MAX 6 + +#define _POSIX_RE_DUP_MAX 255 +#define _POSIX_RTSIG_MAX 8 +#define _POSIX_SEM_NSEMS_MAX 256 +#define _POSIX_SEM_VALUE_MAX 32767 +#define _POSIX_SIGQUEUE_MAX 32 +#define _POSIX_SS_REPL_MAX 4 +#define _POSIX_SYMLINK_MAX 255 +#define _POSIX_SYMLOOP_MAX 8 +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +#define _POSIX_THREAD_KEYS_MAX 128 +#define _POSIX_THREAD_THREADS_MAX 64 +#define _POSIX_TIMER_MAX 32 +#define _POSIX_TRACE_EVENT_NAME_MAX 30 +#define _POSIX_TRACE_NAME_MAX 8 +#define _POSIX_TRACE_SYS_MAX 8 +#define _POSIX_TRACE_USER_EVENT_MAX 32 +#define _POSIX_TTY_NAME_MAX 9 + +#define _POSIX2_BC_BASE_MAX 99 +#define _POSIX2_BC_DIM_MAX 2048 +#define _POSIX2_BC_SCALE_MAX 99 +#define _POSIX2_BC_STRING_MAX 1000 +#define _POSIX2_CHARCLASS_NAME_MAX 14 +#define _POSIX2_COLL_WEIGHTS_MAX 2 +#define _POSIX2_EQUIV_CLASS_MAX 2 +#define _POSIX2_EXPR_NEST_MAX 32 +#define _POSIX2_LINE_MAX 2048 +#define _POSIX2_RE_DUP_MAX 255 + +#define PTHREAD_STACK_MIN 8192 +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 +#define PTHREAD_KEYS_MAX 512 + +#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define PASS_MAX 128 +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#define NL_ARGMAX 9 +#define NL_LANGMAX 14 +#define NL_MSGMAX 32767 +#define NL_NMAX 1 +#define NL_SETMAX 255 +#define NL_TEXTMAX 2048 + +#define _XOPEN_IOV_MAX 16 +#define IOV_MAX 1024 +#define _XOPEN_NAME_MAX 255 +#define _XOPEN_PATH_MAX 1024 + +#endif /* _ANSI_SOURCE */ + +/* NZERO to be defined here. TBD. See also sys/param.h */ + +#endif /* !_LIMITS_H_ */ + diff --git a/i386/include/.svn/text-base/locale.h.svn-base b/i386/include/.svn/text-base/locale.h.svn-base new file mode 100644 index 0000000..ab28ceb --- /dev/null +++ b/i386/include/.svn/text-base/locale.h.svn-base @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)locale.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $ + */ + +#ifndef _LOCALE_H_ +#define _LOCALE_H_ + +#include <_locale.h> + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 +#define LC_MESSAGES 6 + +#define _LC_LAST 7 /* marks end */ + +__BEGIN_DECLS +char *setlocale(int, const char *); +__END_DECLS + +#endif /* _LOCALE_H_ */ diff --git a/i386/include/.svn/text-base/math.h.svn-base b/i386/include/.svn/text-base/math.h.svn-base new file mode 100644 index 0000000..6b2172f --- /dev/null +++ b/i386/include/.svn/text-base/math.h.svn-base @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __MATH_H__ +#define __MATH_H__ + +#if (defined(__ppc__) || defined(__ppc64__)) +#include "architecture/ppc/math.h" +#elif (defined (__i386__) || defined( __x86_64__ )) +#include "architecture/i386/math.h" +#elif defined(__arm__) +#include "architecture/arm/math.h" +#else +#error Unknown architecture +#endif + +#endif /* __MATH_H__ */ diff --git a/i386/include/.svn/text-base/runetype.h.svn-base b/i386/include/.svn/text-base/runetype.h.svn-base new file mode 100644 index 0000000..fd16b82 --- /dev/null +++ b/i386/include/.svn/text-base/runetype.h.svn-base @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)runetype.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _RUNETYPE_H_ +#define _RUNETYPE_H_ + +#include <_types.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#ifndef _CT_RUNE_T +#define _CT_RUNE_T +typedef __darwin_ct_rune_t ct_rune_t; +#endif + +#ifndef _RUNE_T +#define _RUNE_T +typedef __darwin_rune_t rune_t; +#endif + +#ifndef __cplusplus +#ifndef _WCHAR_T +#define _WCHAR_T +typedef __darwin_wchar_t wchar_t; +#endif /* _WCHAR_T */ +#endif /* __cplusplus */ + +#ifndef _WINT_T +#define _WINT_T +typedef __darwin_wint_t wint_t; +#endif + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */ +#define _CRMASK (~(_CACHED_RUNES - 1)) + +/* + * The lower 8 bits of runetype[] contain the digit value of the rune. + */ +typedef struct { + __darwin_rune_t __min; /* First rune of the range */ + __darwin_rune_t __max; /* Last rune (inclusive) of the range */ + __darwin_rune_t __map; /* What first maps to in maps */ + __uint32_t *__types; /* Array of types in range */ +} _RuneEntry; + +typedef struct { + int __nranges; /* Number of ranges stored */ + _RuneEntry *__ranges; /* Pointer to the ranges */ +} _RuneRange; + +typedef struct { + char __name[14]; /* CHARCLASS_NAME_MAX = 14 */ + __uint32_t __mask; /* charclass mask */ +} _RuneCharClass; + +typedef struct { + char __magic[8]; /* Magic saying what version we are */ + char __encoding[32]; /* ASCII name of this encoding */ + + __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **); + int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **); + __darwin_rune_t __invalid_rune; + + __uint32_t __runetype[_CACHED_RUNES]; + __darwin_rune_t __maplower[_CACHED_RUNES]; + __darwin_rune_t __mapupper[_CACHED_RUNES]; + + /* + * The following are to deal with Runes larger than _CACHED_RUNES - 1. + * Their data is actually contiguous with this structure so as to make + * it easier to read/write from/to disk. + */ + _RuneRange __runetype_ext; + _RuneRange __maplower_ext; + _RuneRange __mapupper_ext; + + void *__variable; /* Data which depends on the encoding */ + int __variable_len; /* how long that data is */ + + /* + * extra fields to deal with arbitrary character classes + */ + int __ncharclasses; + _RuneCharClass *__charclasses; +} _RuneLocale; + +#define _RUNE_MAGIC_A "RuneMagA" /* Indicates version A of RuneLocale */ + +__BEGIN_DECLS +extern _RuneLocale _DefaultRuneLocale; +extern _RuneLocale *_CurrentRuneLocale; +__END_DECLS + +#endif /* !_RUNETYPE_H_ */ diff --git a/i386/include/.svn/text-base/setjmp.h.svn-base b/i386/include/.svn/text-base/setjmp.h.svn-base new file mode 100644 index 0000000..4fced23 --- /dev/null +++ b/i386/include/.svn/text-base/setjmp.h.svn-base @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_SETJMP_H +#define _BSD_SETJMP_H + +#include + +#endif /* _BSD_SETJMP_H */ diff --git a/i386/include/.svn/text-base/signal.h.svn-base b/i386/include/.svn/text-base/signal.h.svn-base new file mode 100644 index 0000000..08ad77e --- /dev/null +++ b/i386/include/.svn/text-base/signal.h.svn-base @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signal.h 8.3 (Berkeley) 3/30/94 + */ + +#ifndef _USER_SIGNAL_H +#define _USER_SIGNAL_H + +#include +#include <_types.h> +#include + +#ifndef _PTHREAD_T +typedef __darwin_pthread_t pthread_t; +#define _PTHREAD_T +#endif + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern __const char *__const sys_signame[NSIG]; +extern __const char *__const sys_siglist[NSIG]; +#endif + +__BEGIN_DECLS +int raise(int); +__END_DECLS + +#ifndef _ANSI_SOURCE +__BEGIN_DECLS +void (*bsd_signal(int, void (*)(int)))(int); +//Begin-Libc +#ifndef LIBC_ALIAS_KILL +//End-Libc +int kill(pid_t, int) __DARWIN_ALIAS(kill); +//Begin-Libc +#else /* LIBC_ALIAS_KILL */ +int kill(pid_t, int) LIBC_ALIAS(kill); +#endif /* !LIBC_ALIAS_KILL */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_KILLPG +//End-Libc +int killpg(pid_t, int) __DARWIN_ALIAS(killpg); +//Begin-Libc +#else /* LIBC_ALIAS_KILLPG */ +int killpg(pid_t, int) LIBC_ALIAS(killpg); +#endif /* !LIBC_ALIAS_KILLPG */ +//End-Libc +int pthread_kill(pthread_t, int); +//Begin-Libc +#ifndef LIBC_ALIAS_PTHREAD_SIGMASK +//End-Libc +int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask); +//Begin-Libc +#else /* LIBC_ALIAS_PTHREAD_SIGMASK */ +int pthread_sigmask(int, const sigset_t *, sigset_t *) LIBC_ALIAS(pthread_sigmask); +#endif /* !LIBC_ALIAS_PTHREAD_SIGMASK */ +//End-Libc +int sigaction(int, const struct sigaction * __restrict, + struct sigaction * __restrict); +int sigaddset(sigset_t *, int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGALTSTACK +//End-Libc +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack); +//Begin-Libc +#else /* LIBC_ALIAS_SIGALTSTACK */ +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) LIBC_ALIAS(sigaltstack); +#endif /* !LIBC_ALIAS_SIGALTSTACK */ +//End-Libc +int sigdelset(sigset_t *, int); +int sigemptyset(sigset_t *); +int sigfillset(sigset_t *); +int sighold(int); +int sigignore(int); +int siginterrupt(int, int); +int sigismember(const sigset_t *, int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGPAUSE +//End-Libc +int sigpause(int) __DARWIN_ALIAS_C(sigpause); +//Begin-Libc +#else /* LIBC_ALIAS_SIGPAUSE */ +int sigpause(int) LIBC_ALIAS_C(sigpause); +#endif /* !LIBC_ALIAS_SIGPAUSE */ +//End-Libc +int sigpending(sigset_t *); +int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); +int sigrelse(int); +void (*sigset(int, void (*)(int)))(int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGSUSPEND +//End-Libc +int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend); +//Begin-Libc +#else /* LIBC_ALIAS_SIGSUSPEND */ +int sigsuspend(const sigset_t *) LIBC_ALIAS_C(sigsuspend); +#endif /* !LIBC_ALIAS_SIGSUSPEND */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_SIGWAIT +//End-Libc +int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait); +//Begin-Libc +#else /* LIBC_ALIAS_SIGWAIT */ +int sigwait(const sigset_t * __restrict, int * __restrict) LIBC_ALIAS_C(sigwait); +#endif /* !LIBC_ALIAS_SIGWAIT */ +//End-Libc +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void psignal(unsigned int, const char *); +int sigblock(int); +int sigsetmask(int); +int sigvec(int, struct sigvec *, struct sigvec *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + +/* List definitions after function declarations, or Reiser cpp gets upset. */ +#if defined(__i386__) || defined(__x86_64__) +/* The left shift operator on intel is modulo 32 */ +static __inline int +__sigbits(int __signo) +{ + return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); +} +#else /* !__i386__ && !__x86_64__ */ +#define __sigbits(signo) (1 << ((signo) - 1)) +#endif /* __i386__ || __x86_64__ */ + +#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0) +#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0) +#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0) +#define sigemptyset(set) (*(set) = 0, 0) +#define sigfillset(set) (*(set) = ~(sigset_t)0, 0) +#endif /* !_ANSI_SOURCE */ + +#endif /* !_USER_SIGNAL_H */ diff --git a/i386/include/.svn/text-base/stdarg.h.svn-base b/i386/include/.svn/text-base/stdarg.h.svn-base new file mode 100644 index 0000000..ede00f0 --- /dev/null +++ b/i386/include/.svn/text-base/stdarg.h.svn-base @@ -0,0 +1,133 @@ +/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* + * ISO C Standard: 7.15 Variable arguments + */ + +#ifndef _STDARG_H +#ifndef _ANSI_STDARG_H_ +#ifndef __need___va_list +#define _STDARG_H +#define _ANSI_STDARG_H_ +#endif /* not __need___va_list */ +#undef __need___va_list + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +typedef __builtin_va_list __gnuc_va_list; +#endif + +/* Define the standard macros for the user, + if this invocation was from the user program. */ +#ifdef _STDARG_H + +#define va_start(v,l) __builtin_va_start(v,l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v,l) __builtin_va_arg(v,l) +#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L +#define va_copy(d,s) __builtin_va_copy(d,s) +#endif +#define __va_copy(d,s) __builtin_va_copy(d,s) + +/* Define va_list, if desired, from __gnuc_va_list. */ +/* We deliberately do not define va_list when called from + stdio.h, because ANSI C says that stdio.h is not supposed to define + va_list. stdio.h needs to have access to that data type, + but must not use that name. It should use the name __gnuc_va_list, + which is safe because it is reserved for the implementation. */ + +#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ +#undef _VA_LIST +#endif + +#ifdef _BSD_VA_LIST +#undef _BSD_VA_LIST +#endif + +#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) +/* SVR4.2 uses _VA_LIST for an internal alias for va_list, + so we must avoid testing it and setting it here. + SVR4 uses _VA_LIST as a flag in stdarg.h, but we should + have no conflict with that. */ +#ifndef _VA_LIST_ +#define _VA_LIST_ +#ifdef __i860__ +#ifndef _VA_LIST +#define _VA_LIST va_list +#endif +#endif /* __i860__ */ +typedef __gnuc_va_list va_list; +#ifdef _SCO_DS +#define __VA_LIST +#endif +#endif /* _VA_LIST_ */ +#else /* not __svr4__ || _SCO_DS */ + +/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. + But on BSD NET2 we must not test or define or undef it. + (Note that the comments in NET 2's ansi.h + are incorrect for _VA_LIST_--see stdio.h!) */ +#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) +/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ +#ifndef _VA_LIST_DEFINED +/* The macro _VA_LIST is used in SCO Unix 3.2. */ +#ifndef _VA_LIST +/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ +#ifndef _VA_LIST_T_H +/* The macro __va_list__ is used by BeOS. */ +#ifndef __va_list__ +typedef __gnuc_va_list va_list; +#endif /* not __va_list__ */ +#endif /* not _VA_LIST_T_H */ +#endif /* not _VA_LIST */ +#endif /* not _VA_LIST_DEFINED */ +#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) +#define _VA_LIST_ +#endif +#ifndef _VA_LIST +#define _VA_LIST +#endif +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#endif +#ifndef _VA_LIST_T_H +#define _VA_LIST_T_H +#endif +#ifndef __va_list__ +#define __va_list__ +#endif + +#endif /* not _VA_LIST_, except on certain systems */ + +#endif /* not __svr4__ */ + +#endif /* _STDARG_H */ + +#endif /* not _ANSI_STDARG_H_ */ +#endif /* not _STDARG_H */ diff --git a/i386/include/.svn/text-base/stdbool.h.svn-base b/i386/include/.svn/text-base/stdbool.h.svn-base new file mode 100644 index 0000000..994cee8 --- /dev/null +++ b/i386/include/.svn/text-base/stdbool.h.svn-base @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2000 Jeroen Ruigrok van der Werven + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/stdbool.h,v 1.6 2002/08/16 07:33:14 alfred Exp $ + */ + +#ifndef _STDBOOL_H_ +#define _STDBOOL_H_ + +#define __bool_true_false_are_defined 1 + +#ifndef __cplusplus + +#define bool _Bool +#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 +typedef int _Bool; +#endif + +#define false (bool)0 +#define true (bool)1 + +#endif /* !__cplusplus */ + +#endif /* !_STDBOOL_H_ */ diff --git a/i386/include/.svn/text-base/stddef.h.svn-base b/i386/include/.svn/text-base/stddef.h.svn-base new file mode 100644 index 0000000..9fc87ee --- /dev/null +++ b/i386/include/.svn/text-base/stddef.h.svn-base @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $OpenBSD: stddef.h,v 1.2 1997/09/21 10:45:52 niklas Exp $ */ +/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stddef.h 5.5 (Berkeley) 4/3/91 + */ + +#if !defined(__STDDEF_H__) + +#if !defined(__need_wchar_t) && !defined(__need_size_t) \ + && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ + && !defined(__need_wint_t) +#define __STDDEF_H__ +#endif /* none of __need_* defined */ + +#include + +#if defined(__STDDEF_H__) || defined(__need_ptrdiff_t) +#ifndef _PTRDIFF_T +#define _PTRDIFF_T +typedef __darwin_ptrdiff_t ptrdiff_t; +#endif /* _PTRDIFF_T */ +#endif /* __STDDEF_H__ || __need_ptrdiff_t */ + +#if defined(__STDDEF_H__) || defined(__need_size_t) +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif /* _SIZE_T */ +#endif /* __STDDEF_H__ || __need_size_t */ + +#if defined(__STDDEF_H__) || defined(__need_wchar_t) +#ifndef __cplusplus +#ifndef _WCHAR_T +#define _WCHAR_T +typedef __darwin_wchar_t wchar_t; +#endif /* _WCHAR_T */ +#endif /* __cplusplus */ +#endif /* __STDDEF_H__ || __need_wchar_t */ + +#if (defined(__STDDEF_H__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))) \ + || defined(__need_wint_t) +#ifndef _WINT_T +#define _WINT_T +typedef __darwin_wint_t wint_t; +#endif /* _WINT_T */ +#endif /* __STDDEF_H__ && !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) || __need_wchar_t */ + +#if defined(__STDDEF_H__) || defined(__need_NULL) +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ +#endif /* __STDDEF_H__ || __need_NULL */ + +#ifdef __STDDEF_H__ +#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3) +#ifndef __offsetof /* Deprecated: for source compatability only */ +#define __offsetof(type, field) __builtin_offsetof(type, field) +#endif +#define offsetof(type, field) __builtin_offsetof(type, field) +#else /* ! (gcc >= 3.5) */ +#ifndef __offsetof /* Deprecated: for source compatability only */ +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif +#define offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif /* (gcc >= 3.5) */ +#endif /* __STDDEF_H__ */ + +#endif /* __STDDEF_H__ */ + +#undef __need_ptrdiff_t +#undef __need_size_t +#undef __need_wchar_t +#undef __need_wint_t +#undef __need_NULL diff --git a/i386/include/.svn/text-base/stdint.h.svn-base b/i386/include/.svn/text-base/stdint.h.svn-base new file mode 100644 index 0000000..1126b56 --- /dev/null +++ b/i386/include/.svn/text-base/stdint.h.svn-base @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2000, 2001, 2003, 2004, 2008 Apple Computer, Inc. + * All rights reserved. + */ + +#ifndef _STDINT_H_ +#define _STDINT_H_ + +#if __LP64__ +#define __WORDSIZE 64 +#else +#define __WORDSIZE 32 +#endif + +/* from ISO/IEC 988:1999 spec */ + +/* 7.18.1.1 Exact-width integer types */ +#ifndef _INT8_T +#define _INT8_T +typedef signed char int8_t; +#endif /*_INT8_T */ + +#ifndef _INT16_T +#define _INT16_T +typedef short int16_t; +#endif /* _INT16_T */ + +#ifndef _INT32_T +#define _INT32_T +typedef int int32_t; +#endif /* _INT32_T */ + +#ifndef _INT64_T +#define _INT64_T +typedef long long int64_t; +#endif /* _INT64_T */ + +#ifndef _UINT8_T +#define _UINT8_T +typedef unsigned char uint8_t; +#endif /*_UINT8_T */ + +#ifndef _UINT16_T +#define _UINT16_T +typedef unsigned short uint16_t; +#endif /* _UINT16_T */ + +#ifndef _UINT32_T +#define _UINT32_T +typedef unsigned int uint32_t; +#endif /* _UINT32_T */ + +#ifndef _UINT64_T +#define _UINT64_T +typedef unsigned long long uint64_t; +#endif /* _UINT64_T */ + +/* 7.18.1.2 Minimum-width integer types */ +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + + +/* 7.18.1.3 Fastest-width integer types */ +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + + +/* 7.18.1.4 Integer types capable of holding object pointers */ + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef long intptr_t; +#endif /* _INTPTR_T */ + +#ifndef _UINTPTR_T +#define _UINTPTR_T +typedef unsigned long uintptr_t; +#endif /* _UINTPTR_T */ + + +/* 7.18.1.5 Greatest-width integer types */ +#ifndef _INTMAX_T +#define _INTMAX_T +#ifdef __INTMAX_TYPE__ +typedef __INTMAX_TYPE__ intmax_t; +#else /* __INTMAX_TYPE__ */ +typedef long long intmax_t; +#endif /* __INTMAX_TYPE__ */ +#endif /* _INTMAX_T */ + +#ifndef _UINTMAX_T +#define _UINTMAX_T +#ifdef __UINTMAX_TYPE__ +typedef __UINTMAX_TYPE__ uintmax_t; +#else /* __UINTMAX_TYPE__ */ +typedef unsigned long long uintmax_t; +#endif /* __UINTMAX_TYPE__ */ +#endif /* _UINTMAX_T */ + +/* 7.18.2 Limits of specified-width integer types: + * These #defines specify the minimum and maximum limits + * of each of the types declared above. + */ + + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define INT8_MIN -128 +#define INT16_MIN -32768 + /* + Note: the literal "most negative int" cannot be written in C -- + the rules in the standard (section 6.4.4.1 in C99) will give it + an unsigned type, so INT32_MIN (and the most negative member of + any larger signed type) must be written via a constant expression. + */ +#define INT32_MIN (-INT32_MAX-1) +#define INT64_MIN (-INT64_MAX-1) + +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 4294967295U +#define UINT64_MAX 18446744073709551615ULL + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding object pointers */ + +#if __WORDSIZE == 64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#endif + +#if __WORDSIZE == 64 +#define UINTPTR_MAX UINT64_MAX +#else +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX + +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 "Other" */ +#if __WORDSIZE == 64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif + +/* We have no sig_atomic_t yet, so no SIG_ATOMIC_{MIN,MAX}. + Should end up being {-127,127} or {0,255} ... or bigger. + My bet would be on one of {U}INT32_{MIN,MAX}. */ + +#if __WORDSIZE == 64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif + +#ifndef WCHAR_MAX +# ifdef __WCHAR_MAX__ +# define WCHAR_MAX __WCHAR_MAX__ +# else +# define WCHAR_MAX 0x7fffffff +# endif +#endif + +/* WCHAR_MIN should be 0 if wchar_t is an unsigned type and + (-WCHAR_MAX-1) if wchar_t is a signed type. Unfortunately, + it turns out that -fshort-wchar changes the signedness of + the type. */ +#ifndef WCHAR_MIN +# if WCHAR_MAX == 0xffff +# define WCHAR_MIN 0 +# else +# define WCHAR_MIN (-WCHAR_MAX-1) +# endif +#endif + +#define WINT_MIN INT32_MIN +#define WINT_MAX INT32_MAX + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +/* 7.18.4 Macros for integer constants */ +#define INT8_C(v) (v) +#define INT16_C(v) (v) +#define INT32_C(v) (v) +#define INT64_C(v) (v ## LL) + +#define UINT8_C(v) (v ## U) +#define UINT16_C(v) (v ## U) +#define UINT32_C(v) (v ## U) +#define UINT64_C(v) (v ## ULL) + +#define INTMAX_C(v) (v ## LL) +#define UINTMAX_C(v) (v ## ULL) + +#endif /* _STDINT_H_ */ diff --git a/i386/include/.svn/text-base/stdio.h.svn-base b/i386/include/.svn/text-base/stdio.h.svn-base new file mode 100644 index 0000000..455960c --- /dev/null +++ b/i386/include/.svn/text-base/stdio.h.svn-base @@ -0,0 +1,503 @@ +/* + * Copyright (c) 2000, 2005, 2007, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdio.h 8.5 (Berkeley) 4/29/95 + */ + +#ifndef _STDIO_H_ +#define _STDIO_H_ + +#include <_types.h> + +#ifndef _VA_LIST +#define _VA_LIST +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * __gnuc_va_list and include */ +typedef __darwin_va_list va_list; +#endif + +#ifndef _OFF_T +#define _OFF_T +typedef __darwin_off_t off_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +typedef __darwin_off_t fpos_t; + +#define _FSTDIO /* Define for new stdio with functions. */ + +/* + * NB: to fit things in six character monocase externals, the stdio + * code uses the prefix `__s' for stdio objects, typically followed + * by a three-character attempt at a mnemonic. + */ + +/* stdio buffers */ +struct __sbuf { + unsigned char *_base; + int _size; +}; + +/* hold a buncha junk that would grow the ABI */ +struct __sFILEX; + +/* + * stdio state variables. + * + * The following always hold: + * + * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), + * _lbfsize is -_bf._size, else _lbfsize is 0 + * if _flags&__SRD, _w is 0 + * if _flags&__SWR, _r is 0 + * + * This ensures that the getc and putc macros (or inline functions) never + * try to write or read from a file that is in `read' or `write' mode. + * (Moreover, they can, and do, automatically switch from read mode to + * write mode, and back, on "r+" and "w+" files.) + * + * _lbfsize is used only to make the inline line-buffered output stream + * code as compact as possible. + * + * _ub, _up, and _ur are used when ungetc() pushes back more characters + * than fit in the current _bf, or when ungetc() pushes back a character + * that does not match the previous one in _bf. When this happens, + * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff + * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NB: see WARNING above before changing the layout of this structure! + */ +typedef struct __sFILE { + unsigned char *_p; /* current position in (some) buffer */ + int _r; /* read space left for getc() */ + int _w; /* write space left for putc() */ + short _flags; /* flags, below; this FILE is free if 0 */ + short _file; /* fileno, if Unix descriptor, else -1 */ + struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ + int _lbfsize; /* 0 or -_bf._size, for inline putc */ + + /* operations */ + void *_cookie; /* cookie passed to io functions */ + int (*_close)(void *); + int (*_read) (void *, char *, int); + fpos_t (*_seek) (void *, fpos_t, int); + int (*_write)(void *, const char *, int); + + /* separate buffer for long sequences of ungetc() */ + struct __sbuf _ub; /* ungetc buffer */ + struct __sFILEX *_extra; /* additions to FILE to not break ABI */ + int _ur; /* saved _r when _r is counting ungetc data */ + + /* tricks to meet minimum requirements even when malloc() fails */ + unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ + unsigned char _nbuf[1]; /* guarantee a getc() buffer */ + + /* separate buffer for fgetln() when line crosses buffer boundary */ + struct __sbuf _lb; /* buffer for fgetln() */ + + /* Unix stdio files get aligned to block boundaries on fseek() */ + int _blksize; /* stat.st_blksize (may be != _bf._size) */ + fpos_t _offset; /* current lseek offset (see WARNING) */ +} FILE; + +__BEGIN_DECLS +#if __DARWIN_UNIX03 +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; +#else /* !__DARWIN_UNIX03 */ +extern FILE __sF[]; +#endif /* __DARWIN_UNIX03 */ +__END_DECLS + +#define __SLBF 0x0001 /* line buffered */ +#define __SNBF 0x0002 /* unbuffered */ +#define __SRD 0x0004 /* OK to read */ +#define __SWR 0x0008 /* OK to write */ + /* RD and WR are never simultaneously asserted */ +#define __SRW 0x0010 /* open for reading & writing */ +#define __SEOF 0x0020 /* found EOF */ +#define __SERR 0x0040 /* found error */ +#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SAPP 0x0100 /* fdopen()ed in append mode */ +#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ +#define __SOPT 0x0400 /* do fseek() optimisation */ +#define __SNPT 0x0800 /* do not do fseek() optimisation */ +#define __SOFF 0x1000 /* set iff _offset is in fact correct */ +#define __SMOD 0x2000 /* true => fgetln modified _p text */ +#define __SALC 0x4000 /* allocate string space dynamically */ +#define __SIGN 0x8000 /* ignore this file in _fwalk */ + +/* + * The following three definitions are for ANSI C, which took them + * from System V, which brilliantly took internal interface macros and + * made them official arguments to setvbuf(), without renaming them. + * Hence, these ugly _IOxxx names are *supposed* to appear in user code. + * + * Although numbered as their counterparts above, the implementation + * does not rely on this. + */ +#define _IOFBF 0 /* setvbuf should set fully buffered */ +#define _IOLBF 1 /* setvbuf should set line buffered */ +#define _IONBF 2 /* setvbuf should set unbuffered */ + +#define BUFSIZ 1024 /* size of buffer used by setbuf */ +#define EOF (-1) + +/* + * FOPEN_MAX is a minimum maximum, and is the number of streams that + * stdio can provide without attempting to allocate further resources + * (which could fail). Do not use this for anything. + */ + /* must be == _POSIX_STREAM_MAX */ +#define FOPEN_MAX 20 /* must be <= OPEN_MAX */ +#define FILENAME_MAX 1024 /* must be <= PATH_MAX */ + +/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ +#ifndef _ANSI_SOURCE +#define P_tmpdir "/var/tmp/" +#endif +#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#define TMP_MAX 308915776 + +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + +#if __DARWIN_UNIX03 +#define stdin __stdinp +#define stdout __stdoutp +#define stderr __stderrp +#else /* !__DARWIN_UNIX03 */ +#define stdin (&__sF[0]) +#define stdout (&__sF[1]) +#define stderr (&__sF[2]) +#endif /* __DARWIN_UNIX03 */ + +/* + * Functions defined in ANSI C standard. + */ +__BEGIN_DECLS +void clearerr(FILE *); +int fclose(FILE *); +int feof(FILE *); +int ferror(FILE *); +int fflush(FILE *); +int fgetc(FILE *); +int fgetpos(FILE * __restrict, fpos_t *); +char *fgets(char * __restrict, int, FILE *); +#if defined(__DARWIN_10_6_AND_LATER) && (defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)) +FILE *fopen(const char * __restrict, const char * __restrict) __DARWIN_EXTSN(fopen); +#else /* < 10.6 || !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_FOPEN +//End-Libc +FILE *fopen(const char * __restrict, const char * __restrict) __DARWIN_10_6_AND_LATER_ALIAS(__DARWIN_ALIAS(fopen)); +//Begin-Libc +#else /* LIBC_ALIAS_FOPEN */ +FILE *fopen(const char * __restrict, const char * __restrict) LIBC_ALIAS(fopen); +#endif /* !LIBC_ALIAS_FOPEN */ +//End-Libc +#endif /* >= 10.6 &&_(DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int fprintf(FILE * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(fprintf); +int fputc(int, FILE *); +//Begin-Libc +#ifndef LIBC_ALIAS_FPUTS +//End-Libc +int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs); +//Begin-Libc +#else /* LIBC_ALIAS_FPUTS */ +int fputs(const char * __restrict, FILE * __restrict) LIBC_ALIAS(fputs); +#endif /* !LIBC_ALIAS_FPUTS */ +//End-Libc +size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); +//Begin-Libc +#ifndef LIBC_ALIAS_FREOPEN +//End-Libc +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) __DARWIN_ALIAS(freopen); +//Begin-Libc +#else /* LIBC_ALIAS_FREOPEN */ +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) LIBC_ALIAS(freopen); +#endif /* !LIBC_ALIAS_FREOPEN */ +//End-Libc +int fscanf(FILE * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(fscanf); +int fseek(FILE *, long, int); +int fsetpos(FILE *, const fpos_t *); +long ftell(FILE *); +//Begin-Libc +#ifndef LIBC_ALIAS_FWRITE +//End-Libc +size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) __DARWIN_ALIAS(fwrite); +//Begin-Libc +#else /* LIBC_ALIAS_FWRITE */ +size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) LIBC_ALIAS(fwrite); +#endif /* !LIBC_ALIAS_FWRITE */ +//End-Libc +int getc(FILE *); +int getchar(void); +char *gets(char *); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern __const int sys_nerr; /* perror(3) external variables */ +extern __const char *__const sys_errlist[]; +#endif +void perror(const char *); +int printf(const char * __restrict, ...) __DARWIN_LDBL_COMPAT(printf); +int putc(int, FILE *); +int putchar(int); +int puts(const char *); +int remove(const char *); +int rename (const char *, const char *); +void rewind(FILE *); +int scanf(const char * __restrict, ...) __DARWIN_LDBL_COMPAT(scanf); +void setbuf(FILE * __restrict, char * __restrict); +int setvbuf(FILE * __restrict, char * __restrict, int, size_t); +int sprintf(char * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(sprintf); +int sscanf(const char * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(sscanf); +FILE *tmpfile(void); +char *tmpnam(char *); +int ungetc(int, FILE *); +int vfprintf(FILE * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vfprintf); +int vprintf(const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vprintf); +int vsprintf(char * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vsprintf); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int asprintf(char **, const char *, ...) __DARWIN_LDBL_COMPAT(asprintf); +int vasprintf(char **, const char *, va_list) __DARWIN_LDBL_COMPAT(vasprintf); +#endif +__END_DECLS + +/* + * Functions defined in POSIX 1003.1. + */ +#ifndef _ANSI_SOURCE +#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */ + +__BEGIN_DECLS +char *ctermid(char *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *ctermid_r(char *); +#endif /* not POSIX */ +#if defined(__DARWIN_10_6_AND_LATER) && (defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)) +FILE *fdopen(int, const char *) __DARWIN_EXTSN(fdopen); +#else /* < 10.6 || !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_FDOPEN +//End-Libc +FILE *fdopen(int, const char *) __DARWIN_10_6_AND_LATER_ALIAS(__DARWIN_ALIAS(fdopen)); +//Begin-Libc +#else /* LIBC_ALIAS_FDOPEN */ +FILE *fdopen(int, const char *) LIBC_ALIAS(fdopen); +#endif /* !LIBC_ALIAS_FDOPEN */ +//End-Libc +#endif /* >= 10.6 &&_(DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *fgetln(FILE *, size_t *); +#endif /* not POSIX */ +int fileno(FILE *); +void flockfile(FILE *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__const char + *fmtcheck(const char *, const char *); +int fpurge(FILE *); +#endif /* not POSIX */ +int fseeko(FILE *, off_t, int); +off_t ftello(FILE *); +int ftrylockfile(FILE *); +void funlockfile(FILE *); +int getc_unlocked(FILE *); +int getchar_unlocked(void); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int getw(FILE *); +#endif /* not POSIX */ +int pclose(FILE *); +#if defined(__DARWIN_10_6_AND_LATER) && (defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)) +FILE *popen(const char *, const char *) __DARWIN_EXTSN(popen); +#else /* < 10.6 || !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_POPEN +//End-Libc +FILE *popen(const char *, const char *) __DARWIN_10_6_AND_LATER_ALIAS(__DARWIN_ALIAS(popen)); +//Begin-Libc +#else /* LIBC_ALIAS_POPEN */ +FILE *popen(const char *, const char *) LIBC_ALIAS(popen); +#endif /* !LIBC_ALIAS_POPEN */ +//End-Libc +#endif /* >= 10.6 &&_(DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int putc_unlocked(int, FILE *); +int putchar_unlocked(int); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int putw(int, FILE *); +void setbuffer(FILE *, char *, int); +int setlinebuf(FILE *); +#endif /* not POSIX */ +int snprintf(char * __restrict, size_t, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(snprintf); +//Begin-Libc +#ifndef LIBC_ALIAS_TEMPNAM +//End-Libc +char *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam); +//Begin-Libc +#else /* LIBC_ALIAS_TEMPNAM */ +char *tempnam(const char *, const char *) LIBC_ALIAS(tempnam); +#endif /* !LIBC_ALIAS_TEMPNAM */ +//End-Libc +int vfscanf(FILE * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vfscanf); +int vscanf(const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vscanf); +int vsnprintf(char * __restrict, size_t, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vsnprintf); +int vsscanf(const char * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vsscanf); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +FILE *zopen(const char *, const char *, int); +#endif /* not POSIX */ +__END_DECLS + +/* + * Stdio function-access interface. + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__BEGIN_DECLS +FILE *funopen(const void *, + int (*)(void *, char *, int), + int (*)(void *, const char *, int), + fpos_t (*)(void *, fpos_t, int), + int (*)(void *)); +__END_DECLS +#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) +#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) +#endif /* not POSIX */ +#endif /* not ANSI */ + +/* + * Functions internal to the implementation. + */ +__BEGIN_DECLS +int __srget(FILE *); +int __svfscanf(FILE *, const char *, va_list) __DARWIN_LDBL_COMPAT(__svfscanf); +int __swbuf(int, FILE *); +__END_DECLS + +/* + * The __sfoo macros are here so that we can + * define function versions in the C library. + */ +#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) +#if defined(__GNUC__) && defined(__STDC__) +static __inline int __sputc(int _c, FILE *_p) { + if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) + return (*_p->_p++ = _c); + else + return (__swbuf(_c, _p)); +} +#else +/* + * This has been tuned to generate reasonable code on the vax using pcc. + */ +#define __sputc(c, p) \ + (--(p)->_w < 0 ? \ + (p)->_w >= (p)->_lbfsize ? \ + (*(p)->_p = (c)), *(p)->_p != '\n' ? \ + (int)*(p)->_p++ : \ + __swbuf('\n', p) : \ + __swbuf((int)(c), p) : \ + (*(p)->_p = (c), (int)*(p)->_p++)) +#endif + +#define __sfeof(p) (((p)->_flags & __SEOF) != 0) +#define __sferror(p) (((p)->_flags & __SERR) != 0) +#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) +#define __sfileno(p) ((p)->_file) + +#ifndef _ANSI_SOURCE +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define feof_unlocked(p) __sfeof(p) +#define ferror_unlocked(p) __sferror(p) +#define clearerr_unlocked(p) __sclearerr(p) +#define fileno_unlocked(p) __sfileno(p) +#endif /* not POSIX */ + +#ifndef lint +#define getc_unlocked(fp) __sgetc(fp) +#define putc_unlocked(x, fp) __sputc(x, fp) +#endif /* lint */ + +#define getchar_unlocked() getc_unlocked(stdin) +#define putchar_unlocked(x) putc_unlocked(x, stdout) +#endif /* not ANSI */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include +#endif + +#endif /* _STDIO_H_ */ diff --git a/i386/include/.svn/text-base/stdlib.h.svn-base b/i386/include/.svn/text-base/stdlib.h.svn-base new file mode 100644 index 0000000..a177dbb --- /dev/null +++ b/i386/include/.svn/text-base/stdlib.h.svn-base @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdlib.h 8.5 (Berkeley) 5/19/95 + */ + +#ifndef _STDLIB_H_ +#define _STDLIB_H_ + +#include + +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#ifndef _CT_RUNE_T +#define _CT_RUNE_T +typedef __darwin_ct_rune_t ct_rune_t; +#endif + +#ifndef _RUNE_T +#define _RUNE_T +typedef __darwin_rune_t rune_t; +#endif +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#ifndef __cplusplus +#ifndef _WCHAR_T +#define _WCHAR_T +typedef __darwin_wchar_t wchar_t; +#endif /* _WCHAR_T */ +#endif /* __cplusplus */ + +typedef struct { + int quot; /* quotient */ + int rem; /* remainder */ +} div_t; + +typedef struct { + long quot; /* quotient */ + long rem; /* remainder */ +} ldiv_t; + +#if !__DARWIN_NO_LONG_LONG +typedef struct { + long long quot; + long long rem; +} lldiv_t; +#endif /* !__DARWIN_NO_LONG_LONG */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 + +#define RAND_MAX 0x7fffffff + +#ifdef _USE_EXTENDED_LOCALES_ +#include <_xlocale.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#ifndef MB_CUR_MAX +#ifdef _USE_EXTENDED_LOCALES_ +#define MB_CUR_MAX (___mb_cur_max()) +#ifndef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif /* !MB_CUR_MAX_L */ +#else /* !_USE_EXTENDED_LOCALES_ */ +extern int __mb_cur_max; +#define MB_CUR_MAX __mb_cur_max +#endif /* _USE_EXTENDED_LOCALES_ */ +#endif /* MB_CUR_MAX */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \ + && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L) +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif +//Begin-Libc +/* f must be a literal string */ +#define LIBC_ABORT(f,...) abort_report_np("%s:%s:%u: " f, __FILE__, __func__, __LINE__, ## __VA_ARGS__) +//End-Libc + +__BEGIN_DECLS +void abort(void) __dead2; +//Begin-Libc +__private_extern__ +void abort_report_np(const char *, ...) __dead2 __printflike(1, 2); +//End-Libc +int abs(int) __pure2; +int atexit(void (*)(void)); +double atof(const char *); +int atoi(const char *); +long atol(const char *); +#if !__DARWIN_NO_LONG_LONG +long long + atoll(const char *); +#endif /* !__DARWIN_NO_LONG_LONG */ +void *bsearch(const void *, const void *, size_t, + size_t, int (*)(const void *, const void *)); +void *calloc(size_t, size_t); +div_t div(int, int) __pure2; +void exit(int) __dead2; +void free(void *); +char *getenv(const char *); +long labs(long) __pure2; +ldiv_t ldiv(long, long) __pure2; +#if !__DARWIN_NO_LONG_LONG +long long + llabs(long long); +lldiv_t lldiv(long long, long long); +#endif /* !__DARWIN_NO_LONG_LONG */ +void *malloc(size_t); +int mblen(const char *, size_t); +size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); +int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); +int posix_memalign(void **, size_t, size_t); +void qsort(void *, size_t, size_t, + int (*)(const void *, const void *)); +int rand(void); +void *realloc(void *, size_t); +void srand(unsigned); +double strtod(const char *, char **) __DARWIN_ALIAS(strtod); +float strtof(const char *, char **) __DARWIN_ALIAS(strtof); +long strtol(const char *, char **, int); +long double + strtold(const char *, char **) __DARWIN_LDBL_COMPAT(strtold); +#if !__DARWIN_NO_LONG_LONG +long long + strtoll(const char *, char **, int); +#endif /* !__DARWIN_NO_LONG_LONG */ +unsigned long + strtoul(const char *, char **, int); +#if !__DARWIN_NO_LONG_LONG +unsigned long long + strtoull(const char *, char **, int); +#endif /* !__DARWIN_NO_LONG_LONG */ +//Begin-Libc +#ifndef LIBC_ALIAS_SYSTEM +//End-Libc +int system(const char *) __DARWIN_ALIAS_C(system); +//Begin-Libc +#else /* LIBC_ALIAS_SYSTEM */ +int system(const char *) LIBC_ALIAS_C(system); +#endif /* !LIBC_ALIAS_SYSTEM */ +//End-Libc +size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); +int wctomb(char *, wchar_t); + +#ifndef _ANSI_SOURCE +void _Exit(int) __dead2; +long a64l(const char *); +double drand48(void); +char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +double erand48(unsigned short[3]); +char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +char *gcvt(double, int, char *); /* LEGACY */ +int getsubopt(char **, char * const *, char **); +int grantpt(int); +#if __DARWIN_UNIX03 +char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */ +#else /* !__DARWIN_UNIX03 */ +char *initstate(unsigned long, char *, long); +#endif /* __DARWIN_UNIX03 */ +long jrand48(unsigned short[3]); +char *l64a(long); +void lcong48(unsigned short[7]); +long lrand48(void); +char *mktemp(char *); +int mkstemp(char *); +long mrand48(void); +long nrand48(unsigned short[3]); +int posix_openpt(int); +char *ptsname(int); +//Begin-Libc +#ifndef LIBC_ALIAS_PUTENV +//End-Libc +int putenv(char *) __DARWIN_ALIAS(putenv); +//Begin-Libc +#else /* LIBC_ALIAS_PUTENV */ +int putenv(char *) LIBC_ALIAS(putenv); +#endif /* !LIBC_ALIAS_PUTENV */ +//End-Libc +long random(void); +int rand_r(unsigned *); +//Begin-Libc +#ifdef __LIBC__ +#ifndef LIBC_ALIAS_REALPATH +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* LIBC_ALIAS_REALPATH */ +#ifdef VARIANT_DARWINEXTSN +char *realpath(const char * __restrict, char * __restrict) LIBC_EXTSN(realpath); +#else /* !VARIANT_DARWINEXTSN */ +char *realpath(const char * __restrict, char * __restrict) LIBC_ALIAS(realpath); +#endif /* VARIANT_DARWINEXTSN */ +#endif /* !LIBC_ALIAS_REALPATH */ +#else /* !__LIBC__ */ +//End-Libc +#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH) +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */ +char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath); +#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */ +//Begin-Libc +#endif /* __LIBC__ */ +//End-Libc +unsigned short + *seed48(unsigned short[3]); +//Begin-Libc +#ifndef LIBC_ALIAS_SETENV +//End-Libc +int setenv(const char *, const char *, int) __DARWIN_ALIAS(setenv); +//Begin-Libc +#else /* LIBC_ALIAS_SETENV */ +int setenv(const char *, const char *, int) LIBC_ALIAS(setenv); +#endif /* !LIBC_ALIAS_SETENV */ +//End-Libc +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_SETKEY +//End-Libc +void setkey(const char *) __DARWIN_ALIAS(setkey); +//Begin-Libc +#else /* LIBC_ALIAS_SETKEY */ +void setkey(const char *) LIBC_ALIAS(setkey); +#endif /* !LIBC_ALIAS_SETKEY */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +char *setstate(const char *); +void srand48(long); +#if __DARWIN_UNIX03 +void srandom(unsigned); +#else /* !__DARWIN_UNIX03 */ +void srandom(unsigned long); +#endif /* __DARWIN_UNIX03 */ +int unlockpt(int); +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_UNSETENV +//End-Libc +int unsetenv(const char *) __DARWIN_ALIAS(unsetenv); +//Begin-Libc +#else /* LIBC_ALIAS_UNSETENV */ +int unsetenv(const char *) LIBC_ALIAS(unsetenv); +#endif /* !LIBC_ALIAS_UNSETENV */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +void unsetenv(const char *); +#endif /* __DARWIN_UNIX03 */ +#endif /* !_ANSI_SOURCE */ + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison mbstowcs mbtowc wcstombs wctomb +#endif +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _STDLIB_H_ */ diff --git a/i386/include/.svn/text-base/string.h.svn-base b/i386/include/.svn/text-base/string.h.svn-base new file mode 100644 index 0000000..6c16441 --- /dev/null +++ b/i386/include/.svn/text-base/string.h.svn-base @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2000, 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)string.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _STRING_H_ +#define _STRING_H_ +#include <_types.h> + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* For swab */ +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#include + +__BEGIN_DECLS +void *memchr(const void *, int, size_t); +int memcmp(const void *, const void *, size_t); +void *memcpy(void *, const void *, size_t); +void *memmove(void *, const void *, size_t); +void *memset(void *, int, size_t); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *stpcpy(char *, const char *); +char *strcasestr(const char *, const char *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +char *strcat(char *, const char *); +char *strchr(const char *, int); +int strcmp(const char *, const char *); +int strcoll(const char *, const char *); +char *strcpy(char *, const char *); +size_t strcspn(const char *, const char *); +//Begin-Libc +#ifndef LIBC_ALIAS_STRERROR +//End-Libc +char *strerror(int) __DARWIN_ALIAS(strerror); +//Begin-Libc +#else /* LIBC_ALIAS_STRERROR */ +char *strerror(int) LIBC_ALIAS(strerror); +#endif /* !LIBC_ALIAS_STRERROR */ +//End-Libc +int strerror_r(int, char *, size_t); +size_t strlen(const char *); +char *strncat(char *, const char *, size_t); +int strncmp(const char *, const char *, size_t); +char *strncpy(char *, const char *, size_t); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *strnstr(const char *, const char *, size_t); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +char *strpbrk(const char *, const char *); +char *strrchr(const char *, int); +size_t strspn(const char *, const char *); +char *strstr(const char *, const char *); +char *strtok(char *, const char *); +size_t strxfrm(char *, const char *, size_t); + +/* Nonstandard routines */ +#ifndef _ANSI_SOURCE +void *memccpy(void *, const void *, int, size_t); +char *strtok_r(char *, const char *, char **); +char *strdup(const char *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int bcmp(const void *, const void *, size_t); +void bcopy(const void *, void *, size_t); +void bzero(void *, size_t); +int ffs(int); +int ffsl(long); +int fls(int); +int flsl(long); +char *index(const char *, int); +void memset_pattern4(void *, const void *, size_t); +void memset_pattern8(void *, const void *, size_t); +void memset_pattern16(void *, const void *, size_t); +char *rindex(const char *, int); +int strcasecmp(const char *, const char *); +size_t strlcat(char *, const char *, size_t); +size_t strlcpy(char *, const char *, size_t); +void strmode(int, char *); +int strncasecmp(const char *, const char *, size_t); +char *strsep(char **, const char *); +char *strsignal(int sig); +void swab(const void * __restrict, void * __restrict, ssize_t); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE */ +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _STRING_H_ */ diff --git a/i386/include/.svn/text-base/time.h.svn-base b/i386/include/.svn/text-base/time.h.svn-base new file mode 100644 index 0000000..2914d40 --- /dev/null +++ b/i386/include/.svn/text-base/time.h.svn-base @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.3 (Berkeley) 1/21/94 + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + +#include <_types.h> + +#define __need_struct_timespec +#include <_structs.h> + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#ifndef _CLOCK_T +#define _CLOCK_T +typedef __darwin_clock_t clock_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + +struct tm { + int tm_sec; /* seconds after the minute [0-60] */ + int tm_min; /* minutes after the hour [0-59] */ + int tm_hour; /* hours since midnight [0-23] */ + int tm_mday; /* day of the month [1-31] */ + int tm_mon; /* months since January [0-11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday [0-6] */ + int tm_yday; /* days since January 1 [0-365] */ + int tm_isdst; /* Daylight Savings Time flag */ + long tm_gmtoff; /* offset from CUT in seconds */ + char *tm_zone; /* timezone abbreviation */ +}; + +#if __DARWIN_UNIX03 +#define CLOCKS_PER_SEC 1000000 /* [XSI] */ +#else /* !__DARWIN_UNIX03 */ +#include /* Include file containing CLK_TCK. */ + +#define CLOCKS_PER_SEC (__DARWIN_CLK_TCK) +#endif /* __DARWIN_UNIX03 */ + +#ifndef _ANSI_SOURCE +extern char *tzname[]; +#endif + +extern int getdate_err; +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_TIMEZONE +//End-Libc +extern long timezone __DARWIN_ALIAS(timezone); +//Begin-Libc +#else /* LIBC_ALIAS_TIMEZONE */ +extern long timezone LIBC_ALIAS(timezone); +#endif /* !LIBC_ALIAS_TIMEZONE */ +//End-Libc +#endif /* __DARWIN_UNIX03 */ +extern int daylight; + +__BEGIN_DECLS +char *asctime(const struct tm *); +//Begin-Libc +#ifndef LIBC_ALIAS_CLOCK +//End-Libc +clock_t clock(void) __DARWIN_ALIAS(clock); +//Begin-Libc +#else /* LIBC_ALIAS_CLOCK */ +clock_t clock(void) LIBC_ALIAS(clock); +#endif /* !LIBC_ALIAS_CLOCK */ +//End-Libc +char *ctime(const time_t *); +double difftime(time_t, time_t); +struct tm *getdate(const char *); +struct tm *gmtime(const time_t *); +struct tm *localtime(const time_t *); +//Begin-Libc +#ifndef LIBC_ALIAS_MKTIME +//End-Libc +time_t mktime(struct tm *) __DARWIN_ALIAS(mktime); +//Begin-Libc +#else /* LIBC_ALIAS_MKTIME */ +time_t mktime(struct tm *) LIBC_ALIAS(mktime); +#endif /* !LIBC_ALIAS_MKTIME */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRFTIME +//End-Libc +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime); +//Begin-Libc +#else /* LIBC_ALIAS_STRFTIME */ +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) LIBC_ALIAS(strftime); +#endif /* !LIBC_ALIAS_STRFTIME */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRPTIME +//End-Libc +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime); +//Begin-Libc +#else /* LIBC_ALIAS_STRPTIME */ +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) LIBC_ALIAS(strptime); +#endif /* !LIBC_ALIAS_STRPTIME */ +//End-Libc +time_t time(time_t *); + +#ifndef _ANSI_SOURCE +void tzset(void); +#endif /* not ANSI */ + +/* [TSF] Thread safe functions */ +char *asctime_r(const struct tm * __restrict, char * __restrict); +char *ctime_r(const time_t *, char *); +struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict); +struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +time_t posix2time(time_t); +#if !__DARWIN_UNIX03 +char *timezone(int, int); +#endif /* !__DARWIN_UNIX03 */ +void tzsetwall(void); +time_t time2posix(time_t); +time_t timelocal(struct tm * const); +time_t timegm(struct tm * const); +#endif /* neither ANSI nor POSIX */ + +#if !defined(_ANSI_SOURCE) +//Begin-Libc +#ifndef LIBC_ALIAS_NANOSLEEP +//End-Libc +int nanosleep(const struct timespec *, struct timespec *) __DARWIN_ALIAS_C(nanosleep); +//Begin-Libc +#else /* LIBC_ALIAS_NANOSLEEP */ +int nanosleep(const struct timespec *, struct timespec *) LIBC_ALIAS_C(nanosleep); +#endif /* !LIBC_ALIAS_NANOSLEEP */ +//End-Libc +#endif +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_TIME_H_ */ diff --git a/i386/include/.svn/text-base/unistd.h.svn-base b/i386/include/.svn/text-base/unistd.h.svn-base new file mode 100644 index 0000000..a15eee6 --- /dev/null +++ b/i386/include/.svn/text-base/unistd.h.svn-base @@ -0,0 +1,623 @@ +/* + * Copyright (c) 2000, 2002-2006, 2008, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 8.12 (Berkeley) 4/27/95 + * + * Copyright (c) 1998 Apple Compter, Inc. + * All Rights Reserved + */ + +/* History: + 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr + 3/26/98 CHW at Apple added real interface to searchfs call + 3/5/98 CHW at Apple added hfs semantic system calls headers +*/ + +#ifndef _UNISTD_H_ +#define _UNISTD_H_ + +#include <_types.h> +#include + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef _DEV_T +#define _DEV_T +typedef __darwin_dev_t dev_t; +#endif +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#ifndef _GID_T +#define _GID_T +typedef __darwin_gid_t gid_t; +#endif + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef __darwin_intptr_t intptr_t; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef _MODE_T +#define _MODE_T +typedef __darwin_mode_t mode_t; +#endif +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#ifndef _OFF_T +#define _OFF_T +typedef __darwin_off_t off_t; +#endif + +#ifndef _PID_T +#define _PID_T +typedef __darwin_pid_t pid_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif + +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif + +#ifndef _UID_T +#define _UID_T +typedef __darwin_uid_t uid_t; /* user id */ +#endif + +#ifndef _USECONDS_T +#define _USECONDS_T +typedef __darwin_useconds_t useconds_t; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef _UUID_T +#define _UUID_T +typedef __darwin_uuid_t uuid_t; +#endif /* _UUID_T */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +/* Version test macros */ +/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ +#define _XOPEN_VERSION 600 /* [XSI] */ +#define _XOPEN_XCU_VERSION 4 /* Older standard */ + + +/* Please keep this list in the same order as the applicable standard */ +#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */ +#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */ +#define _POSIX_BARRIERS (-1) /* [BAR] */ +#define _POSIX_CHOWN_RESTRICTED 200112L +#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */ +#define _POSIX_CPUTIME (-1) /* [CPT] */ +#define _POSIX_FSYNC 200112L /* [FSC] */ +#define _POSIX_IPV6 200112L +#define _POSIX_JOB_CONTROL 200112L +#define _POSIX_MAPPED_FILES 200112L /* [MF] */ +#define _POSIX_MEMLOCK (-1) /* [ML] */ +#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */ +#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */ +#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */ +#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */ +#define _POSIX_NO_TRUNC 200112L +#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */ +#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */ +#define _POSIX_RAW_SOCKETS (-1) /* [RS] */ +#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */ +#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */ +#define _POSIX_REGEXP 200112L +#define _POSIX_SAVED_IDS 200112L /* XXX required */ +#define _POSIX_SEMAPHORES (-1) /* [SEM] */ +#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */ +#define _POSIX_SHELL 200112L +#define _POSIX_SPAWN (-1) /* [SPN] */ +#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */ +#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */ +#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */ +#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */ +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */ +#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */ +#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */ +#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */ +#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */ +#define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */ +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */ +#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */ +#define _POSIX_THREADS 200112L /* [THR] */ +#define _POSIX_TIMEOUTS (-1) /* [TMO] */ +#define _POSIX_TIMERS (-1) /* [TMR] */ +#define _POSIX_TRACE (-1) /* [TRC] */ +#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */ +#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */ +#define _POSIX_TRACE_LOG (-1) /* [TRL] */ +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */ +#ifndef _POSIX_VDISABLE +#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */ +#endif /* _POSIX_VDISABLE */ + +#define _POSIX2_C_BIND 200112L +#define _POSIX2_C_DEV 200112L /* c99 command */ +#define _POSIX2_CHAR_TERM 200112L +#define _POSIX2_FORT_DEV (-1) /* fort77 command */ +#define _POSIX2_FORT_RUN 200112L +#define _POSIX2_LOCALEDEF 200112L /* localedef command */ +#define _POSIX2_PBS (-1) +#define _POSIX2_PBS_ACCOUNTING (-1) +#define _POSIX2_PBS_CHECKPOINT (-1) +#define _POSIX2_PBS_LOCATE (-1) +#define _POSIX2_PBS_MESSAGE (-1) +#define _POSIX2_PBS_TRACK (-1) +#define _POSIX2_SW_DEV 200112L +#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */ + +#define _V6_ILP32_OFF32 (-1) +#define _V6_ILP32_OFFBIG (1) +#define _V6_LP64_OFF64 (-1) +#define _V6_LPBIG_OFFBIG (-1) + +#define _XBS5_ILP32_OFF32 _V6_ILP32_OFF32 /* legacy */ +#define _XBS5_ILP32_OFFBIG _V6_ILP32_OFFBIG /* legacy */ +#define _XBS5_LP64_OFF64 _V6_LP64_OFF64 /* legacy */ +#define _XBS5_LPBIG_OFFBIG _V6_LPBIG_OFFBIG /* legacy */ + +#define _XOPEN_CRYPT (1) +#define _XOPEN_ENH_I18N (1) /* XXX required */ +#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */ +#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */ +#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */ +#define _XOPEN_SHM (1) +#define _XOPEN_STREAMS (-1) +#define _XOPEN_UNIX (1) + + +#define F_ULOCK 0 /* unlock locked section */ +#define F_LOCK 1 /* lock a section for exclusive use */ +#define F_TLOCK 2 /* test and lock a section for exclusive use */ +#define F_TEST 3 /* test a section for locks by other procs */ + +/* configurable system variables */ +#define _SC_ARG_MAX 1 +#define _SC_CHILD_MAX 2 +#define _SC_CLK_TCK 3 +#define _SC_NGROUPS_MAX 4 +#define _SC_OPEN_MAX 5 +#define _SC_JOB_CONTROL 6 +#define _SC_SAVED_IDS 7 +#define _SC_VERSION 8 +#define _SC_BC_BASE_MAX 9 +#define _SC_BC_DIM_MAX 10 +#define _SC_BC_SCALE_MAX 11 +#define _SC_BC_STRING_MAX 12 +#define _SC_COLL_WEIGHTS_MAX 13 +#define _SC_EXPR_NEST_MAX 14 +#define _SC_LINE_MAX 15 +#define _SC_RE_DUP_MAX 16 +#define _SC_2_VERSION 17 +#define _SC_2_C_BIND 18 +#define _SC_2_C_DEV 19 +#define _SC_2_CHAR_TERM 20 +#define _SC_2_FORT_DEV 21 +#define _SC_2_FORT_RUN 22 +#define _SC_2_LOCALEDEF 23 +#define _SC_2_SW_DEV 24 +#define _SC_2_UPE 25 +#define _SC_STREAM_MAX 26 +#define _SC_TZNAME_MAX 27 +#define _SC_ASYNCHRONOUS_IO 28 +#define _SC_PAGESIZE 29 +#define _SC_MEMLOCK 30 +#define _SC_MEMLOCK_RANGE 31 +#define _SC_MEMORY_PROTECTION 32 +#define _SC_MESSAGE_PASSING 33 +#define _SC_PRIORITIZED_IO 34 +#define _SC_PRIORITY_SCHEDULING 35 +#define _SC_REALTIME_SIGNALS 36 +#define _SC_SEMAPHORES 37 +#define _SC_FSYNC 38 +#define _SC_SHARED_MEMORY_OBJECTS 39 +#define _SC_SYNCHRONIZED_IO 40 +#define _SC_TIMERS 41 +#define _SC_AIO_LISTIO_MAX 42 +#define _SC_AIO_MAX 43 +#define _SC_AIO_PRIO_DELTA_MAX 44 +#define _SC_DELAYTIMER_MAX 45 +#define _SC_MQ_OPEN_MAX 46 +#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */ +#define _SC_RTSIG_MAX 48 +#define _SC_SEM_NSEMS_MAX 49 +#define _SC_SEM_VALUE_MAX 50 +#define _SC_SIGQUEUE_MAX 51 +#define _SC_TIMER_MAX 52 +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define _SC_NPROCESSORS_CONF 57 +#define _SC_NPROCESSORS_ONLN 58 +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ +#define _SC_2_PBS 59 +#define _SC_2_PBS_ACCOUNTING 60 +#define _SC_2_PBS_CHECKPOINT 61 +#define _SC_2_PBS_LOCATE 62 +#define _SC_2_PBS_MESSAGE 63 +#define _SC_2_PBS_TRACK 64 +#define _SC_ADVISORY_INFO 65 +#define _SC_BARRIERS 66 +#define _SC_CLOCK_SELECTION 67 +#define _SC_CPUTIME 68 +#define _SC_FILE_LOCKING 69 +#define _SC_GETGR_R_SIZE_MAX 70 +#define _SC_GETPW_R_SIZE_MAX 71 +#define _SC_HOST_NAME_MAX 72 +#define _SC_LOGIN_NAME_MAX 73 +#define _SC_MONOTONIC_CLOCK 74 +#define _SC_MQ_PRIO_MAX 75 +#define _SC_READER_WRITER_LOCKS 76 +#define _SC_REGEXP 77 +#define _SC_SHELL 78 +#define _SC_SPAWN 79 +#define _SC_SPIN_LOCKS 80 +#define _SC_SPORADIC_SERVER 81 +#define _SC_THREAD_ATTR_STACKADDR 82 +#define _SC_THREAD_ATTR_STACKSIZE 83 +#define _SC_THREAD_CPUTIME 84 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 +#define _SC_THREAD_KEYS_MAX 86 +#define _SC_THREAD_PRIO_INHERIT 87 +#define _SC_THREAD_PRIO_PROTECT 88 +#define _SC_THREAD_PRIORITY_SCHEDULING 89 +#define _SC_THREAD_PROCESS_SHARED 90 +#define _SC_THREAD_SAFE_FUNCTIONS 91 +#define _SC_THREAD_SPORADIC_SERVER 92 +#define _SC_THREAD_STACK_MIN 93 +#define _SC_THREAD_THREADS_MAX 94 +#define _SC_TIMEOUTS 95 +#define _SC_THREADS 96 +#define _SC_TRACE 97 +#define _SC_TRACE_EVENT_FILTER 98 +#define _SC_TRACE_INHERIT 99 +#define _SC_TRACE_LOG 100 +#define _SC_TTY_NAME_MAX 101 +#define _SC_TYPED_MEMORY_OBJECTS 102 +#define _SC_V6_ILP32_OFF32 103 +#define _SC_V6_ILP32_OFFBIG 104 +#define _SC_V6_LP64_OFF64 105 +#define _SC_V6_LPBIG_OFFBIG 106 +#define _SC_IPV6 118 +#define _SC_RAW_SOCKETS 119 +#define _SC_SYMLOOP_MAX 120 +#define _SC_ATEXIT_MAX 107 +#define _SC_IOV_MAX 56 +#define _SC_PAGE_SIZE _SC_PAGESIZE +#define _SC_XOPEN_CRYPT 108 +#define _SC_XOPEN_ENH_I18N 109 +#define _SC_XOPEN_LEGACY 110 +#define _SC_XOPEN_REALTIME 111 +#define _SC_XOPEN_REALTIME_THREADS 112 +#define _SC_XOPEN_SHM 113 +#define _SC_XOPEN_STREAMS 114 +#define _SC_XOPEN_UNIX 115 +#define _SC_XOPEN_VERSION 116 +#define _SC_XOPEN_XCU_VERSION 121 +#define _SC_XBS5_ILP32_OFF32 122 +#define _SC_XBS5_ILP32_OFFBIG 123 +#define _SC_XBS5_LP64_OFF64 124 +#define _SC_XBS5_LPBIG_OFFBIG 125 +#define _SC_SS_REPL_MAX 126 +#define _SC_TRACE_EVENT_NAME_MAX 127 +#define _SC_TRACE_NAME_MAX 128 +#define _SC_TRACE_SYS_MAX 129 +#define _SC_TRACE_USER_EVENT_MAX 130 +#define _SC_PASS_MAX 131 + +#ifndef _CS_PATH /* XXX temporary #ifdef'ed for */ +#define _CS_PATH 1 +#endif +#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 +#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 +#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 +#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 +#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 +#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 +#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 +#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 +#define _CS_POSIX_V6_LP64_OFF64_LIBS 10 +#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 +#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 + +/* reserved for compatibility with Issue 5 */ +#define _CS_XBS5_ILP32_OFF32_CFLAGS 20 +#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21 +#define _CS_XBS5_ILP32_OFF32_LIBS 22 +#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23 +#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24 +#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25 +#define _CS_XBS5_ILP32_OFFBIG_LIBS 26 +#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27 +#define _CS_XBS5_LP64_OFF64_CFLAGS 28 +#define _CS_XBS5_LP64_OFF64_LDFLAGS 29 +#define _CS_XBS5_LP64_OFF64_LIBS 30 +#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31 +#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32 +#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33 +#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34 +#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35 + +#define _CS_DARWIN_USER_DIR 65536 +#define _CS_DARWIN_USER_TEMP_DIR 65537 +#define _CS_DARWIN_USER_CACHE_DIR 65538 + +__BEGIN_DECLS + +void _exit(int) __dead2; +int access(const char *, int); +unsigned int + alarm(unsigned int); +int chdir(const char *); +int chown(const char *, uid_t, gid_t); +int close(int) __DARWIN_ALIAS_C(close); +size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); +char *crypt(const char *, const char *); +char *ctermid(char *); +int dup(int); +int dup2(int, int); +#if __DARWIN_UNIX03 +void encrypt(char *, int) __DARWIN_ALIAS(encrypt); +#else /* !__DARWIN_UNIX03 */ +int encrypt(char *, int); +#endif /* __DARWIN_UNIX03 */ +int execl(const char *, const char *, ...); +int execle(const char *, const char *, ...); +int execlp(const char *, const char *, ...); +int execv(const char *, char * const *); +int execve(const char *, char * const *, char * const *); +int execvp(const char *, char * const *); +int fchown(int, uid_t, gid_t); +int fchdir(int); +pid_t fork(void); +long fpathconf(int, int); +int fsync(int) __DARWIN_ALIAS_C(fsync); +int ftruncate(int, off_t); +char *getcwd(char *, size_t); +gid_t getegid(void); +uid_t geteuid(void); +gid_t getgid(void); +#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) +int getgroups(int, gid_t []) __DARWIN_EXTSN(getgroups); +#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ +int getgroups(int, gid_t []); +#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ +long gethostid(void); +int gethostname(char *, size_t); +char *getlogin(void); +int getlogin_r(char *, size_t); +int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); +pid_t getpgid(pid_t); +pid_t getpgrp(void); +pid_t getpid(void); +pid_t getppid(void); +pid_t getsid(pid_t); +uid_t getuid(void); +char *getwd(char *); /* obsoleted by getcwd() */ +int isatty(int); +int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); +int link(const char *, const char *); +int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); +off_t lseek(int, off_t, int); +int nice(int) __DARWIN_ALIAS(nice); +long pathconf(const char *, int); +int pause(void) __DARWIN_ALIAS_C(pause); +int pipe(int [2]); +ssize_t pread(int, void *, size_t, off_t) __DARWIN_ALIAS_C(pread); +ssize_t pwrite(int, const void *, size_t, off_t) __DARWIN_ALIAS_C(pwrite); +ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read); +ssize_t readlink(const char * __restrict, char * __restrict, size_t); +int rmdir(const char *); +int setegid(gid_t); +int seteuid(uid_t); +int setgid(gid_t); +int setpgid(pid_t, pid_t); +#if __DARWIN_UNIX03 +pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp); +#else /* !__DARWIN_UNIX03 */ +int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */ +#endif /* __DARWIN_UNIX03 */ +int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); +int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); +pid_t setsid(void); +int setuid(uid_t); +unsigned int + sleep(unsigned int) __DARWIN_ALIAS_C(sleep); +void swab(const void * __restrict, void * __restrict, ssize_t); +int symlink(const char *, const char *); +void sync(void); +long sysconf(int); +pid_t tcgetpgrp(int); +int tcsetpgrp(int, pid_t); +int truncate(const char *, off_t); +char *ttyname(int); +#if __DARWIN_UNIX03 +int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); +#else /* !__DARWIN_UNIX03 */ +char *ttyname_r(int, char *, size_t); +#endif /* __DARWIN_UNIX03 */ +useconds_t + ualarm(useconds_t, useconds_t); +int unlink(const char *); +int usleep(useconds_t) __DARWIN_ALIAS_C(usleep); +pid_t vfork(void); +ssize_t write(int, const void *, size_t) __DARWIN_ALIAS_C(write); + +extern char *optarg; /* getopt(3) external variables */ +extern int optind, opterr, optopt; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#include + +void _Exit(int) __dead2; +int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); +int acct(const char *); +int add_profil(char *, size_t, unsigned long, unsigned int); +void *brk(const void *); +int chroot(const char *); +void endusershell(void); +int execvP(const char *, const char *, char * const *); +char *fflagstostr(unsigned long); +int getdtablesize(void); +int getdomainname(char *, int); +int getgrouplist(const char *, int, int *, int *); +int gethostuuid(uuid_t, const struct timespec *); +mode_t getmode(const void *, mode_t); +int getpagesize(void) __pure2; +char *getpass(const char *); +int getpeereid(int, uid_t *, gid_t *); +int getpgid(pid_t _pid); +int getsgroups_np(int *, uuid_t); +int getsid(pid_t _pid); +char *getusershell(void); +int getwgroups_np(int *, uuid_t); +int initgroups(const char *, int); +int iruserok(unsigned long, int, const char *, const char *); +int iruserok_sa(const void *, int, int, const char *, const char *); +int issetugid(void); +char *mkdtemp(char *); +int mknod(const char *, mode_t, dev_t); +int mkstemp(char *); +int mkstemps(char *, int); +char *mktemp(char *); +int nfssvc(int, void *); +int profil(char *, size_t, unsigned long, unsigned int); +int pthread_setugid_np(uid_t, gid_t); +int pthread_getugid_np( uid_t *, gid_t *); +int rcmd(char **, int, const char *, const char *, const char *, int *); +int rcmd_af(char **, int, const char *, const char *, const char *, int *, + int); +int reboot(int); +int revoke(const char *); +int rresvport(int *); +int rresvport_af(int *, int); +int ruserok(const char *, int, const char *, const char *); +void *sbrk(int); +int setdomainname(const char *, int); +int setgroups(int, const gid_t *); +void sethostid(long); +int sethostname(const char *, int); +#if __DARWIN_UNIX03 +void setkey(const char *) __DARWIN_ALIAS(setkey); +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +int setlogin(const char *); +void *setmode(const char *) __DARWIN_ALIAS(setmode); +int setrgid(gid_t); +int setruid(uid_t); +int setsgroups_np(int, const uuid_t); +void setusershell(void); +int setwgroups_np(int, const uuid_t); +int strtofflags(char **, unsigned long *, unsigned long *); +int swapon(const char *); +int syscall(int, ...); +int ttyslot(void); +int undelete(const char *); +int unwhiteout(const char *); +void *valloc(size_t); + +extern char *suboptarg; /* getsubopt(3) external variable */ +int getsubopt(char **, char * const *, char **); + +/* HFS & HFS Plus semantics system calls go here */ +#ifdef __LP64__ +int fgetattrlist(int,void*,void*,size_t,unsigned int); +int fsetattrlist(int,void*,void*,size_t,unsigned int); +int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); +int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); +int exchangedata(const char*,const char*,unsigned int); +int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int); + +#else /* __LP64__ */ +int fgetattrlist(int,void*,void*,size_t,unsigned long); +int fsetattrlist(int,void*,void*,size_t,unsigned long); +int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); +int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); +int exchangedata(const char*,const char*,unsigned long); +int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long); + +#endif /* __LP64__ */ + +struct fssearchblock; +struct searchstate; + +int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *); +int fsctl(const char *,unsigned long,void*,unsigned int); +int ffsctl(int,unsigned long,void*,unsigned int); + +extern int optreset; + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + +#endif /* !_UNISTD_H_ */ diff --git a/i386/include/.svn/text-base/unwind.h.svn-base b/i386/include/.svn/text-base/unwind.h.svn-base new file mode 100644 index 0000000..24cb87e --- /dev/null +++ b/i386/include/.svn/text-base/unwind.h.svn-base @@ -0,0 +1,245 @@ +/* Exception handling and frame unwind runtime interface routines. + Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* This is derived from the C++ ABI for IA-64. Where we diverge + for cross-architecture compatibility are noted with "@@@". */ + +#ifndef _UNWIND_H +#define _UNWIND_H + +#ifndef HIDE_EXPORTS +#ifdef __GCC__ +#pragma GCC visibility push(default) +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Level 1: Base ABI */ + +/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is + inefficient for 32-bit and smaller machines. */ +typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); +typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); +#if defined(__ia64__) && defined(__hpux__) +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); +#else +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); +#endif +typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); + +/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and + consumer of an exception. We'll go along with this for now even on + 32-bit machines. We'll need to provide some other option for + 16-bit machines and for machines with > 8 bits per byte. */ +typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); + +/* The unwind interface uses reason codes in several contexts to + identify the reasons for failures or other actions. */ +typedef enum +{ + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 +} _Unwind_Reason_Code; + + +/* The unwind interface uses a pointer to an exception header object + as its representation of an exception being thrown. In general, the + full representation of an exception object is language- and + implementation-specific, but it will be prefixed by a header + understood by the unwind interface. */ + +struct _Unwind_Exception; + +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, + struct _Unwind_Exception *); + +struct _Unwind_Exception +{ + _Unwind_Exception_Class exception_class; + _Unwind_Exception_Cleanup_Fn exception_cleanup; + _Unwind_Word private_1; + _Unwind_Word private_2; + + /* @@@ The IA-64 ABI says that this structure must be double-word aligned. + Taking that literally does not make much sense generically. Instead we + provide the maximum alignment required by any type for the machine. */ +} __attribute__((__aligned__)); + + +/* The ACTIONS argument to the personality routine is a bitwise OR of one + or more of the following constants. */ +typedef int _Unwind_Action; + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 + +/* This is an opaque type used to refer to a system-specific data + structure used by the system unwinder. This context is created and + destroyed by the system, and passed to the personality routine + during unwinding. */ +struct _Unwind_Context; + +/* Raise an exception, passing along the given exception object. */ +extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); + +/* Raise an exception for forced unwinding. */ + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, + _Unwind_Stop_Fn, + void *); + +/* Helper to invoke the exception_cleanup routine. */ +extern void _Unwind_DeleteException (struct _Unwind_Exception *); + +/* Resume propagation of an existing exception. This is used after + e.g. executing cleanup code, and not to implement rethrowing. */ +extern void _Unwind_Resume (struct _Unwind_Exception *); + +/* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow + a normal exception that was handled. */ +extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); + +/* @@@ Use unwind data to perform a stack backtrace. The trace callback + is called for every stack frame in the call chain, but no cleanup + actions are performed. */ +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) + (struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +/* These functions are used for communicating information about the unwind + context (i.e. the unwind descriptors and the user register state) between + the unwind library and the personality routine and landing pad. Only + selected registers maybe manipulated. */ + +extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); +extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); + +extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); +extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *); +extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); + +/* @@@ Retrieve the CFA of the given context. */ +extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); + +extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); + +extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); + + +/* The personality routine is the function in the C++ (or other language) + runtime library which serves as an interface between the system unwind + library and language-specific exception handling semantics. It is + specific to the code fragment described by an unwind info block, and + it is always referenced via the pointer in the unwind info block, and + hence it has no ABI-specified name. + + Note that this implies that two different C++ implementations can + use different names, and have different contents in the language + specific data area. Moreover, that the language specific data + area contains no version info because name of the function invoked + provides more effective versioning by detecting at link time the + lack of code to handle the different data format. */ + +typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *); + +/* @@@ The following alternate entry points are for setjmp/longjmp + based unwinding. */ + +struct SjLj_Function_Context; +extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); +extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); + +extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException + (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); +extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *); + +/* @@@ The following provide access to the base addresses for text + and data-relative addressing in the LDSA. In order to stay link + compatible with the standard ABI for IA-64, we inline these. */ + +#ifdef __ia64__ +#include + +static inline _Unwind_Ptr +_Unwind_GetDataRelBase (struct _Unwind_Context *_C) +{ + /* The GP is stored in R1. */ + return _Unwind_GetGR (_C, 1); +} + +static inline _Unwind_Ptr +_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__))) +{ + abort (); + return 0; +} + +/* @@@ Retrieve the Backing Store Pointer of the given context. */ +extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *); +#else +extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); +extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); +#endif + +/* @@@ Given an address, return the entry point of the function that + contains it. */ +extern void * _Unwind_FindEnclosingFunction (void *pc); + +#ifdef __cplusplus +} +#endif + +#ifndef HIDE_EXPORTS +#ifdef __GCC__ +#pragma GCC visibility pop +#endif +#endif + +#endif /* unwind.h */ diff --git a/i386/include/IOKit/.svn/all-wcprops b/i386/include/IOKit/.svn/all-wcprops new file mode 100644 index 0000000..6a5806f --- /dev/null +++ b/i386/include/IOKit/.svn/all-wcprops @@ -0,0 +1,305 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit +END +IOTimeStamp.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOTimeStamp.h +END +IOSyncer.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOSyncer.h +END +IOTimerEventSource.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOTimerEventSource.h +END +IODataQueueShared.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODataQueueShared.h +END +IOMemoryCursor.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOMemoryCursor.h +END +IOLib.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOLib.h +END +IOCommandPool.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOCommandPool.h +END +IOBSD.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOBSD.h +END +IOLocks.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOLocks.h +END +IOWorkLoop.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOWorkLoop.h +END +IOPlatformExpert.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOPlatformExpert.h +END +IODeviceTreeSupport.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODeviceTreeSupport.h +END +IOUserClient.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOUserClient.h +END +IOKitServer.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOKitServer.h +END +IOCommand.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOCommand.h +END +IODataQueue.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODataQueue.h +END +IOReturn.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOReturn.h +END +IOInterrupts.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOInterrupts.h +END +IOMultiMemoryDescriptor.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOMultiMemoryDescriptor.h +END +IODMAEventSource.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODMAEventSource.h +END +IORegistryEntry.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IORegistryEntry.h +END +system.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/system.h +END +IORangeAllocator.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IORangeAllocator.h +END +IOConditionLock.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOConditionLock.h +END +IOInterruptController.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOInterruptController.h +END +IOService.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOService.h +END +IOBufferMemoryDescriptor.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOBufferMemoryDescriptor.h +END +IOEventSource.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOEventSource.h +END +IOCatalogue.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOCatalogue.h +END +IOTypes.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOTypes.h +END +IODMAController.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODMAController.h +END +IOSharedDataQueue.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOSharedDataQueue.h +END +OSMessageNotification.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/OSMessageNotification.h +END +IOMemoryDescriptor.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOMemoryDescriptor.h +END +assert.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/assert.h +END +IOCommandGate.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOCommandGate.h +END +IOSharedLock.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOSharedLock.h +END +IOInterruptEventSource.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOInterruptEventSource.h +END +IONotifier.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IONotifier.h +END +IOSubMemoryDescriptor.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOSubMemoryDescriptor.h +END +IOKitKeys.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOKitKeys.h +END +IONVRAM.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IONVRAM.h +END +IOMessage.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOMessage.h +END +IOMapper.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOMapper.h +END +IOFilterInterruptEventSource.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOFilterInterruptEventSource.h +END +IODeviceMemory.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODeviceMemory.h +END +IOInterleavedMemoryDescriptor.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOInterleavedMemoryDescriptor.h +END +IOServicePM.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOServicePM.h +END +IOKitDebug.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IOKitDebug.h +END +IODMACommand.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/IODMACommand.h +END diff --git a/i386/include/IOKit/.svn/entries b/i386/include/IOKit/.svn/entries new file mode 100644 index 0000000..7f98f54 --- /dev/null +++ b/i386/include/IOKit/.svn/entries @@ -0,0 +1,1809 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +serial +dir + +IOSyncer.h +file + + + + +2013-08-27T23:54:32.000000Z +23bcb045e48770d3c1077d1ed61acbdf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2189 + +IOTimerEventSource.h +file + + + + +2013-08-27T23:54:32.000000Z +a9d09d30c8e07c8912936ba8bd6e3195 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11037 + +nvram +dir + +IOLib.h +file + + + + +2013-08-27T23:54:32.000000Z +e9902ff62707b00ce4e60937cdaad949 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2325 + +IOBSD.h +file + + + + +2013-08-27T23:54:32.000000Z +7d96569aa6467f22fa3bb6c707f7dd0b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1730 + +IODeviceTreeSupport.h +file + + + + +2013-08-27T23:54:32.000000Z +bd87840b09c6578528d39b9e82e189d4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4006 + +stream +dir + +IODataQueue.h +file + + + + +2013-08-27T23:54:32.000000Z +849563345d2660f26689d5794483b717 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9513 + +IOCommand.h +file + + + + +2013-08-27T23:54:32.000000Z +2b0c6aa9eccdf6786a568f278298f277 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2851 + +IOKitServer.h +file + + + + +2013-08-27T23:54:32.000000Z +84a73c92514ae189c23050b0f5e6f0f7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4059 + +IOMultiMemoryDescriptor.h +file + + + + +2013-08-27T23:54:32.000000Z +fb3c58f2a3d7ee90f7cf9ec2e52b19a2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7028 + +audio +dir + +storage +dir + +bluetooth +dir + +sbp2 +dir + +IORegistryEntry.h +file + + + + +2013-08-27T23:54:32.000000Z +0575497c301ed8edf1516e1998eb4250 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +67074 + +IORangeAllocator.h +file + + + + +2013-08-27T23:54:32.000000Z +0fbb1d7c54870e8804a54e4a4e0600ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8433 + +pci +dir + +IOConditionLock.h +file + + + + +2013-08-27T23:54:32.000000Z +fd9ec184a04c74997a7b7ea10188d872 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2689 + +pwr_mgt +dir + +IOEventSource.h +file + + + + +2013-08-27T23:54:32.000000Z +282a9d2f13c3c716591da395ebd8f26f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10034 + +IODMAController.h +file + + + + +2013-08-27T23:54:32.000000Z +a737e5194686fb3c25caf6bf4c1a48ee +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2868 + +assert.h +file + + + + +2013-08-27T23:54:32.000000Z +4eb4ae907d1143c9d014ca340b468a29 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1740 + +power +dir + +IOCommandGate.h +file + + + + +2013-08-27T23:54:32.000000Z +5fd074ae4b02ef02cb7adafe6d5497f4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13583 + +graphics +dir + +IOKitKeys.h +file + + + + +2013-08-27T23:54:32.000000Z +83c302e1c1441f782ba67f7cc792bb90 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6749 + +IOMessage.h +file + + + + +2013-08-27T23:54:32.000000Z +e2a28336f9358ec30bb900264417afa4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3552 + +IOFilterInterruptEventSource.h +file + + + + +2013-08-27T23:54:32.000000Z +74e18ede61eb577aad0b84b5692cf6c3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8102 + +avc +dir + +IOKitDebug.h +file + + + + +2013-08-27T23:54:32.000000Z +47300d8c414cdbed165ff647855bf07c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3811 + +firewire +dir + +acpi +dir + +IODMACommand.h +file + + + + +2013-08-27T23:54:32.000000Z +938d5287271d4585ef8048be8b46b217 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34698 + +system_management +dir + +IOTimeStamp.h +file + + + + +2013-08-27T23:54:32.000000Z +413814ae8a34df55334c0ff3ff9520a9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7059 + +ppc +dir + +IODataQueueShared.h +file + + + + +2013-08-27T23:54:32.000000Z +ae37dc46000e010324f218c3adbde822 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5029 + +IOMemoryCursor.h +file + + + + +2013-08-27T23:54:32.000000Z +5e854ff988785fa95f866d93a79a2575 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25922 + +platform +dir + +IOCommandPool.h +file + + + + +2013-08-27T23:54:32.000000Z +36a1a44a133cbcc29a777388443dc294 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8130 + +rtc +dir + +IOLocks.h +file + + + + +2013-08-27T23:54:32.000000Z +c98b88f70884c5a732d70c11031fa531 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17862 + +network +dir + +IOWorkLoop.h +file + + + + +2013-08-27T23:54:32.000000Z +c9bfc8844908c1d1d29dab72ece5d337 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14720 + +IOPlatformExpert.h +file + + + + +2013-08-27T23:54:32.000000Z +eb5e94f1a2607d42015d00be17fdb3ad +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11036 + +IOUserClient.h +file + + + + +2013-08-27T23:54:32.000000Z +39835ea007739fa64221de28412a30b9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12273 + +IOReturn.h +file + + + + +2013-08-27T23:54:32.000000Z +23db18764e454fcfde8f8391faef9a32 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7526 + +IOInterrupts.h +file + + + + +2013-08-27T23:54:32.000000Z +b577cfdf7d30c28a106585fa17f6f024 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1962 + +IODMAEventSource.h +file + + + + +2013-08-27T23:54:32.000000Z +01138bab31573e767b84a036d53beb3a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3184 + +hid +dir + +hidevent +dir + +hidsystem +dir + +system.h +file + + + + +2013-08-27T23:54:32.000000Z +29dfe100181b6b96784ddae4146f1579 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2139 + +IOService.h +file + + + + +2013-08-27T23:54:32.000000Z +0517d84c975646c0b8c05862504494cf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +128157 + +IOInterruptController.h +file + + + + +2013-08-27T23:54:32.000000Z +50bb9e48e0fadabe6cc8bfdc297684a5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5784 + +IOBufferMemoryDescriptor.h +file + + + + +2013-08-27T23:54:32.000000Z +ea23c58a6e4b2e86a2dd887879858c5c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12870 + +IOCatalogue.h +file + + + + +2013-08-27T23:54:32.000000Z +6070ddc5494a45e85c9b13872845a255 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12392 + +IOTypes.h +file + + + + +2013-08-27T23:54:32.000000Z +4bcd1a7cdb685a82af91801b24ae8890 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5832 + +IOSharedDataQueue.h +file + + + + +2013-08-27T23:54:32.000000Z +858eb312da0b7ea071a728b97bf92145 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8880 + +OSMessageNotification.h +file + + + + +2013-08-27T23:54:32.000000Z +173249f91610f5642714931b6b1730ab +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4258 + +IOMemoryDescriptor.h +file + + + + +2013-08-27T23:54:32.000000Z +5a80f6dc1c5a75261d64fd633c93a01b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +47552 + +usb +dir + +IOSharedLock.h +file + + + + +2013-08-27T23:54:32.000000Z +3e399e44477da82796a00b9fae673742 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2980 + +IOInterruptEventSource.h +file + + + + +2013-08-27T23:54:32.000000Z +a8473a5104254140fa0f99ae38e3702d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10868 + +IONotifier.h +file + + + + +2013-08-27T23:54:32.000000Z +d49af8aff3ea577edc127cb215617cbc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3265 + +IOSubMemoryDescriptor.h +file + + + + +2013-08-27T23:54:32.000000Z +c71844f20f336cc03390ace865fb82ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4585 + +scsi +dir + +IONVRAM.h +file + + + + +2013-08-27T23:54:32.000000Z +91fc6c051511ad19a83e074a77755885 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6059 + +IOMapper.h +file + + + + +2013-08-27T23:54:32.000000Z +fbafa86613f8b31bfa6843e13a76747c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5491 + +ata +dir + +ndrvsupport +dir + +IODeviceMemory.h +file + + + + +2013-08-27T23:54:32.000000Z +893228a8cf61afbdc60632fafb8f304d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4743 + +IOInterleavedMemoryDescriptor.h +file + + + + +2013-08-27T23:54:32.000000Z +51564423d5a1e55bd6a2f4af6081c376 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8112 + +IOServicePM.h +file + + + + +2013-08-27T23:54:32.000000Z +57d1e42d83b95f4569282346b378e5ef +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1618 + +i2c +dir + diff --git a/i386/include/IOKit/.svn/text-base/IOBSD.h.svn-base b/i386/include/IOKit/.svn/text-base/IOBSD.h.svn-base new file mode 100644 index 0000000..8938656 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOBSD.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBSD_H +#define _IOBSD_H + +/* + * bsd-related registry properties + */ + +#define kIOBSDNameKey "BSD Name" // (an OSString) +#define kIOBSDNamesKey "BSD Names" // (an OSDictionary of OSString's, for links) +#define kIOBSDMajorKey "BSD Major" // (an OSNumber) +#define kIOBSDMinorKey "BSD Minor" // (an OSNumber) +#define kIOBSDUnitKey "BSD Unit" // (an OSNumber) + +#endif /* !_IOBSD_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOBufferMemoryDescriptor.h.svn-base b/i386/include/IOKit/.svn/text-base/IOBufferMemoryDescriptor.h.svn-base new file mode 100644 index 0000000..0926e5b --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOBufferMemoryDescriptor.h.svn-base @@ -0,0 +1,261 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBUFFERMEMORYDESCRIPTOR_H +#define _IOBUFFERMEMORYDESCRIPTOR_H + +#include + +enum { + kIOMemoryPhysicallyContiguous = 0x00000010, + kIOMemoryPageable = 0x00000020, + kIOMemoryPurgeable = 0x00000040, + kIOMemorySharingTypeMask = 0x000f0000, + kIOMemoryUnshared = 0x00000000, + kIOMemoryKernelUserShared = 0x00010000, + // shared IOMemoryDescriptor options for IOBufferMemoryDescriptor: + kIOBufferDescriptorMemoryFlags = kIOMemoryDirectionMask + | kIOMemoryThreadSafe +}; + +#define _IOBUFFERMEMORYDESCRIPTOR_INTASKWITHOPTIONS_ 1 +/*! + @class IOBufferMemoryDescriptor + @abstract Provides a simple memory descriptor that allocates its own buffer memory. +*/ + +class IOBufferMemoryDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructors(IOBufferMemoryDescriptor); + +private: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { + IOMemoryMap * map; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +protected: + void * _buffer; + vm_size_t _capacity; + vm_offset_t _alignment; + IOOptionBits _options; +private: + uintptr_t _internalReserved; + unsigned _internalFlags; + +private: +#ifndef __LP64__ + virtual bool initWithOptions( + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment, + task_t inTask) APPLE_KEXT_DEPRECATED; /* use withOptions() instead */ +#endif /* !__LP64__ */ + + virtual bool initWithPhysicalMask( + task_t inTask, + IOOptionBits options, + mach_vm_size_t capacity, + mach_vm_address_t alignment, + mach_vm_address_t physicalMask); + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 0); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 1); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOBufferMemoryDescriptor, 0); + OSMetaClassDeclareReservedUsed(IOBufferMemoryDescriptor, 1); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 7); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 8); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 9); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 10); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 11); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 12); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 13); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 14); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 15); + +protected: + virtual void free(); + +public: + + /* + * withOptions: + * + * Returns a new IOBufferMemoryDescriptor with a buffer large enough to + * hold capacity bytes. The descriptor's length is initially set to the + * capacity. + */ +#ifndef __LP64__ + virtual bool initWithOptions( IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment) APPLE_KEXT_DEPRECATED; /* use withOptions() instead */ +#endif /* !__LP64__ */ + + static IOBufferMemoryDescriptor * withOptions( IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment = 1); + +/*! @function inTaskWithOptions + @abstract Creates a memory buffer with memory descriptor for that buffer. + @discussion Added in Mac OS X 10.2, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + @param inTask The task the buffer will be allocated in. + @param options Options for the allocation:
+ kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ kIOMemoryPageable - pass to request memory be non-wired - the default for kernel allocated memory is wired.
+ kIOMemoryPurgeable - pass to request memory that may later have its purgeable state set with IOMemoryDescriptor::setPurgeable. Only supported for kIOMemoryPageable allocations.
+ kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications. + @param capacity The number of bytes to allocate. + @param alignment The minimum required alignment of the buffer in bytes - 1 is the default for no required alignment. For example, pass 256 to get memory allocated at an address with bits 0-7 zero. + @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithOptions( + task_t inTask, + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment = 1); + +/*! @function inTaskWithPhysicalMask + @abstract Creates a memory buffer with memory descriptor for that buffer. + @discussion Added in Mac OS X 10.5, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + @param inTask The task the buffer will be mapped in. Pass NULL to create memory unmapped in any task (eg. for use as a DMA buffer). + @param options Options for the allocation:
+ kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications. + @param capacity The number of bytes to allocate. + @param mask The buffer will be allocated with pages such that physical addresses will only have bits set present in physicalMask. For example, pass 0x00000000FFFFFFFFULL for a buffer to be accessed by hardware that has 32 address bits. + @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithPhysicalMask( + task_t inTask, + IOOptionBits options, + mach_vm_size_t capacity, + mach_vm_address_t physicalMask); + + /* + * withCapacity: + * + * Returns a new IOBufferMemoryDescriptor with a buffer large enough to + * hold capacity bytes. The descriptor's length is initially set to the + * capacity. + */ + static IOBufferMemoryDescriptor * withCapacity( + vm_size_t capacity, + IODirection withDirection, + bool withContiguousMemory = false); +#ifndef __LP64__ + virtual bool initWithBytes(const void * bytes, + vm_size_t withLength, + IODirection withDirection, + bool withContiguousMemory = false) APPLE_KEXT_DEPRECATED; /* use withBytes() instead */ +#endif /* !__LP64__ */ + + /* + * withBytes: + * + * Returns a new IOBufferMemoryDescriptor preloaded with bytes (copied). + * The descriptor's length and capacity are set to the input buffer's size. + */ + static IOBufferMemoryDescriptor * withBytes( + const void * bytes, + vm_size_t withLength, + IODirection withDirection, + bool withContiguousMemory = false); + + /* + * setLength: + * + * Change the buffer length of the memory descriptor. When a new buffer + * is created, the initial length of the buffer is set to be the same as + * the capacity. The length can be adjusted via setLength for a shorter + * transfer (there is no need to create more buffer descriptors when you + * can reuse an existing one, even for different transfer sizes). Note + * that the specified length must not exceed the capacity of the buffer. + */ + virtual void setLength(vm_size_t length); + + /* + * setDirection: + * + * Change the direction of the transfer. This method allows one to redirect + * the descriptor's transfer direction. This eliminates the need to destroy + * and create new buffers when different transfer directions are needed. + */ + virtual void setDirection(IODirection direction); + + /* + * getCapacity: + * + * Get the buffer capacity + */ + virtual vm_size_t getCapacity() const; + + /* + * getBytesNoCopy: + * + * Return the virtual address of the beginning of the buffer + */ + virtual void *getBytesNoCopy(); + + /* + * getBytesNoCopy: + * + * Return the virtual address of an offset from the beginning of the buffer + */ + virtual void *getBytesNoCopy(vm_size_t start, vm_size_t withLength); + + /* + * appendBytes: + * + * Add some data to the end of the buffer. This method automatically + * maintains the memory descriptor buffer length. Note that appendBytes + * will not copy past the end of the memory descriptor's current capacity. + */ + virtual bool appendBytes(const void *bytes, vm_size_t withLength); + +#ifndef __LP64__ + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; /* use getBytesNoCopy() instead */ +#endif /* !__LP64__ */ +}; + +#endif /* !_IOBUFFERMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOCatalogue.h.svn-base b/i386/include/IOKit/.svn/text-base/IOCatalogue.h.svn-base new file mode 100644 index 0000000..f087396 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOCatalogue.h.svn-base @@ -0,0 +1,272 @@ +/* + * Copyright (c) 1998-2000 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOCATALOGUE_H +#define _IOKIT_IOCATALOGUE_H + +#include +#include +#include +#include +#include +#include + +#include + +class IOService; + +/*! + @class IOCatalogue + @abstract In-kernel database for IOKit driver personalities. + @discussion The IOCatalogue is a database which contains all IOKit driver personalities. IOService uses this resource when matching devices to their associated drivers. +*/ +class IOCatalogue : public OSObject +{ + OSDeclareDefaultStructors(IOCatalogue) + +private: + OSCollectionIterator * kernelTables; + OSArray * array; + IOLock * lock; + SInt32 generation; + +/* This stuff is no longer used at all but was exported in prior + * releases, so we keep it around for PPC/i386 only. + */ +#if __ppc__ || __i386__ + IOLock * kld_lock; +#endif /* __ppc__ || __i386__ */ + +public: + /*! + @function initialize + @abstract Creates and initializes the database object and poputates it with in-kernel driver personalities. + */ + static void initialize( void ); + + /*! + @function init + @abstract Initializes the database object. + @param initArray The initial array of driver personalities to populate the database. + */ + bool init( OSArray * initArray ); + + /*! + @function free + @abstract Cleans up the database and deallocates memory allocated at initialization. This is never called in normal operation of the system. + */ + void free( void ); + + /*! + @function findDrivers + @abstract This is the primary entry point for IOService. + @param service + @param generationCount Returns a reference to the generation count of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated. + @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver. + */ + OSOrderedSet * findDrivers( IOService * service, SInt32 * generationCount ); + + /*! + @function findDrivers + @abstract A more general purpose interface which allows one to retreive driver personalities based the intersection of the 'matching' dictionary and the personality's own property list. + @param matching A dictionary containing only keys and values which are to be used for matching. For example, a matching dictionary containing 'IOProviderClass'='IOPCIDevice' will return all personalities with an IOProviderClass key and a value of IOPCIDevice. + @param generationCount Returns a reference to the current generation of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated. + @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver. + */ + OSOrderedSet * findDrivers( OSDictionary * matching, SInt32 * generationCount ); + + /*! + @function addDrivers + @abstract Adds an array of driver personalities to the database. + @param array Array of driver personalities to be added to the database. + @param doNubMatchng Start matching process after personalities have been added. + @result Returns true if driver personality was added to the database successfully. Failure is due to a memory allocation failure. + */ + bool addDrivers( OSArray * array, bool doNubMatching = true ); + + /*! + @function removeDrivers + @abstract Remove driver personalities from the database based on matching information provided. + @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will remove all personalities which have the key 'IOProviderClass' equal to 'IOPCIDevice'. + @param doNubMatchng Start matching process after personalities have been removed. Matching criteria is based on IOProviderClass of those personalities which were removed. This is to allow drivers which haven't been matched to match against NUB's which were blocked by the previous personalities. + @result Returns true if personality was removed successfully. Failure is due to a memory allocation failure. + */ + bool removeDrivers( OSDictionary * matching, bool doNubMatching = true ); + + /*! + @function getGenerationCount + @abstract Get the current generation count of the database. + */ + SInt32 getGenerationCount( void ) const; + + /*! + @function isModuleLoaded + @abstract Reports if a kernel module has been loaded. + @param moduleName Name of the module. + @result Returns true if the associated kernel module has been loaded into the kernel. + */ + bool isModuleLoaded( OSString * moduleName ) const; + + /*! + @function isModuleLoaded + @abstract Reports if a kernel module has been loaded. + @param moduleName Name of the module. + @result Returns true if the associated kernel module has been loaded into the kernel. + */ + bool isModuleLoaded( const char * moduleName ) const; + + /*! + @function isModuleLoaded + @abstract Reports if a kernel module has been loaded for a particular personality. + @param driver A driver personality's property list. + @result Returns true if the associated kernel module has been loaded into the kernel for a particular driver personality on which it depends. + */ + bool isModuleLoaded( OSDictionary * driver ) const; + + /*! + @function moduleHasLoaded + @abstract Callback function called after a IOKit dependent kernel module is loaded. + @param name Name of the kernel module. + */ + void moduleHasLoaded( OSString * name ); + + /*! + @function moduleHasLoaded + @abstract Callback function called after a IOKit dependent kernel module is loaded. + @param name Name of the kernel module. + */ + void moduleHasLoaded( const char * name ); + + /*! + @function terminateDrivers + @abstract Terminates all instances of a driver which match the contents of the matching dictionary. Does not unload module. + @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will cause termination for all instances whose personalities have the key 'IOProviderClass' equal to 'IOPCIDevice'. + */ + IOReturn terminateDrivers( OSDictionary * matching ); + + /*! + @function terminateDriversForModule + @abstract Terminates all instances of a driver which depends on a particular module and unloads the module. + @param moduleName Name of the module which is used to determine which driver instances to terminate and unload. + @param unload Flag to cause the actual unloading of the module. + */ + IOReturn terminateDriversForModule( OSString * moduleName, bool unload = true); + + /*! + @function terminateDriversForModule + @abstract Terminates all instances of a driver which depends on a particular module and unloads the module. + @param moduleName Name of the module which is used to determine which driver instances to terminate and unload. + @param unload Flag to cause the actual unloading of the module. + */ + IOReturn terminateDriversForModule( const char * moduleName, bool unload = true); + + /*! + @function startMatching + @abstract Starts an IOService matching thread where matching keys and values are provided by the matching dictionary. + @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will start matching for all personalities which have the key 'IOProviderClass' equal to 'IOPCIDevice'. + */ + bool startMatching( OSDictionary * matching ); + + /*! + @function reset + @abstract Return the Catalogue to its initial state. + */ + void reset(void); + + /*! + @function serialize + @abstract Serializes the catalog for transport to the user. + @param s The serializer object. + @result Returns false if unable to serialize database, most likely due to memory shortage. + */ + virtual bool serialize(OSSerialize * s) const; + + bool serializeData(IOOptionBits kind, OSSerialize * s) const; + +/* This stuff is no longer used at all we keep it around for PPC/i386 + * binary compatibility only. Symbols are no longer exported. + */ +#if __ppc__ || __i386__ + /*! + @function recordStartupExtensions + @abstract Records extensions made available by the primary booter. +

+ This function is for internal use by the kernel startup linker. + Kernel extensions should never call it. + @result Returns true if startup extensions were successfully recorded, + false if not. + */ + virtual bool recordStartupExtensions(void); + + /*! + @function addExtensionsFromArchive() + @abstract Records an archive of extensions, as from device ROM. +

+ This function is currently for internal use. + Kernel extensions should never call it. + @param mkext An OSData object containing a multikext archive. + @result Returns true if mkext was properly unserialized and its + contents recorded, false if not. + */ + virtual bool addExtensionsFromArchive(OSData * mkext); + + + /*! + @function removeKernelLinker + @abstract Removes from memory all code and data related to + boot-time loading of kernel extensions. kextd triggers + this when it first starts in order to pass responsibility + for loading extensions from the kernel itself to kextd. + @result Returns KERN_SUCCESS if the kernel linker is successfully + removed or wasn't present, KERN_FAILURE otherwise. + */ + virtual kern_return_t removeKernelLinker(void); +#endif /* __ppc__ || __i386__ */ + +private: + + /*! + @function unloadModule + @abstract Unloads the reqested module if no driver instances are currently depending on it. + @param moduleName An OSString containing the name of the module to unload. + */ + IOReturn unloadModule( OSString * moduleName ) const; +}; + +extern const OSSymbol * gIOClassKey; +extern const OSSymbol * gIOProbeScoreKey; +extern IOCatalogue * gIOCatalogue; + +#endif /* ! _IOKIT_IOCATALOGUE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOCommand.h.svn-base b/i386/include/IOKit/.svn/text-base/IOCommand.h.svn-base new file mode 100644 index 0000000..136c41b --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOCommand.h.svn-base @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 2001-01-18 gvdl Made the primary queue pointer public, to be used when + * Ownership is clear. + * 11/13/2000 CJS Created IOCommand class and implementation + * + */ + +/*! + * @header IOCommand + * @abstract + * This header contains the IOCommand class definition. + */ + +#ifndef _IOKIT_IO_COMMAND_H_ +#define _IOKIT_IO_COMMAND_H_ + +/* + * Kernel + */ + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include + +/*! + * @class IOCommand + * @abstract + * This class is an abstract class which represents an I/O command. + * @discussion + * This class is an abstract class which represents an I/O command passed + * from a device driver to a controller. All controller commands (e.g. IOATACommand) + * should inherit from this class. + */ + +class IOCommand : public OSObject +{ + OSDeclareDefaultStructors(IOCommand) + +public: + virtual bool init(void); + +/*! @var fCommandChain + This variable is used by the current 'owner' to queue the command. During the life cycle of a command it moves through a series of queues. This is the queue pointer for it. Only valid while 'ownership' is clear. For instance a IOCommandPool uses this pointer to maintain its list of free commands. May be manipulated using the kern/queue.h macros */ + queue_chain_t fCommandChain; /* used to queue commands */ +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMMAND_H_ */ diff --git a/i386/include/IOKit/.svn/text-base/IOCommandGate.h.svn-base b/i386/include/IOKit/.svn/text-base/IOCommandGate.h.svn-base new file mode 100644 index 0000000..1b17b79 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOCommandGate.h.svn-base @@ -0,0 +1,241 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*[ + 1999-8-10 Godfrey van der Linden(gvdl) + Created. +]*/ +/*! @language embedded-c++ */ + +#ifndef _IOKIT_IOCOMMANDGATE_H +#define _IOKIT_IOCOMMANDGATE_H + +#include + +/*! + @class IOCommandGate : public IOEventSource + @abstract Single-threaded work-loop client request mechanism. + @discussion An IOCommandGate instance is an extremely light way mechanism +that executes an action on the driver's work-loop. 'On the work-loop' is +actually a lie but the work-loop single threaded semantic is maintained for this +event source. Using the work-loop gate rather than execution by the workloop. +The command gate tests for a potential self dead lock by checking if the +runCommand request is made from the work-loop's thread, it doesn't check for a +mutual dead lock though where a pair of work loop's dead lock each other. +

+ The IOCommandGate is a lighter weight version of the IOCommandQueue and +should be used in preference. Generally use a command queue whenever you need a +client to submit a request to a work loop. A typical command gate action would +check if the hardware is active, if so it will add the request to a pending +queue internal to the device or the device's family. Otherwise if the hardware +is inactive then this request can be acted upon immediately. +

+ CAUTION: The runAction, runCommand, and attemptCommand functions cannot be called from an interrupt context. + +*/ +class IOCommandGate : public IOEventSource +{ + OSDeclareDefaultStructors(IOCommandGate) + +public: +/*! + @typedef Action + @discussion Type and arguments of callout C function that is used when +a runCommand is executed by a client. Cast to this type when you want a C++ +member function to be used. Note the arg1 - arg3 parameters are straight pass +through from the runCommand to the action callout. + @param owner + Target of the function, can be used as a refcon. The owner is set +during initialisation of the IOCommandGate instance. Note if a C++ function +was specified this parameter is implicitly the first paramter in the target +member function's parameter list. + @param arg0 Argument to action from run operation. + @param arg1 Argument to action from run operation. + @param arg2 Argument to action from run operation. + @param arg3 Argument to action from run operation. +*/ + typedef IOReturn (*Action)(OSObject *owner, + void *arg0, void *arg1, + void *arg2, void *arg3); + +protected: +/*! + @function checkForWork + @abstract Not used, $link IOEventSource::checkForWork(). */ + virtual bool checkForWork(); + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: +/*! @function commandGate + @abstract Factory method to create and initialise an IOCommandGate, See $link init. + @result Returns a pointer to the new command gate if sucessful, 0 otherwise. */ + static IOCommandGate *commandGate(OSObject *owner, Action action = 0); + +/*! @function init + @abstract Class initialiser. + @discussion Initialiser for IOCommandGate operates only on newly 'newed' +objects. Shouldn't be used to re-init an existing instance. + @param owner Owner of this, newly created, instance of the IOCommandGate. This argument will be used as the first parameter in the action callout. + @param action + Pointer to a C function that is called whenever a client of the +IOCommandGate calls runCommand. NB Can be a C++ member function but caller +must cast the member function to $link IOCommandGate::Action and they will get a +compiler warning. Defaults to zero, see $link IOEventSource::setAction. + @result True if inherited classes initialise successfully. */ + virtual bool init(OSObject *owner, Action action = 0); + + // Superclass overrides + virtual void free(); + virtual void setWorkLoop(IOWorkLoop *inWorkLoop); + +/*! @function runCommand + @abstract Single thread a command with the target work-loop. + @discussion Client function that causes the current action to be called in +a single threaded manner. Beware the work-loop's gate is recursive and command +gates can cause direct or indirect re-entrancy. When the executing on a +client's thread runCommand will sleep until the work-loop's gate opens for +execution of client actions, the action is single threaded against all other +work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + @param arg0 Parameter for action of command gate, defaults to 0. + @param arg1 Parameter for action of command gate, defaults to 0. + @param arg2 Parameter for action of command gate, defaults to 0. + @param arg3 Parameter for action of command gate, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnAborted if a disabled command gate is free()ed before being reenabled, kIOReturnNoResources if no action available. +*/ + virtual IOReturn runCommand(void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function runAction + @abstract Single thread a call to an action with the target work-loop. + @discussion Client function that causes the given action to be called in +a single threaded manner. Beware the work-loop's gate is recursive and command +gates can cause direct or indirect re-entrancy. When the executing on a +client's thread runAction will sleep until the work-loop's gate opens for +execution of client actions, the action is single threaded against all other +work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled. +*/ + virtual IOReturn runAction(Action action, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function attemptCommand + @abstract Single thread a command with the target work-loop. + @discussion Client function that causes the current action to be called in +a single threaded manner. When the executing on a client's thread attemptCommand will fail if the work-loop's gate is closed. + @param arg0 Parameter for action of command gate, defaults to 0. + @param arg1 Parameter for action of command gate, defaults to 0. + @param arg2 Parameter for action of command gate, defaults to 0. + @param arg3 Parameter for action of command gate, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available, kIOReturnCannotLock if lock attempt fails. +*/ + virtual IOReturn attemptCommand(void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function attemptAction + @abstract Single thread a call to an action with the target work-loop. + @discussion Client function that causes the given action to be called in +a single threaded manner. Beware the work-loop's gate is recursive and command +gates can cause direct or indirect re-entrancy. When the executing on a +client's thread attemptCommand will fail if the work-loop's gate is closed. + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled, kIOReturnCannotLock if lock attempt fails. + +*/ + virtual IOReturn attemptAction(Action action, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function commandSleep + @abstract Put a thread that is currently holding the command gate to sleep. + @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs then the commandGate is closed before the function returns. + @param event Pointer to an address. + @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE (the default value) specifies that the sleep may be interrupted by any user signal. + @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate. */ + virtual IOReturn commandSleep(void *event, + UInt32 interruptible = THREAD_ABORTSAFE); + +/*! @function commandWakeup + @abstract Wakeup one or more threads that are asleep on an event. + @param event Pointer to an address. + @param onlyOneThread true to only wake up at most one thread, false otherwise. */ + virtual void commandWakeup(void *event, bool oneThread = false); + +/*! @function disable + @abstract Disable the command gate + @discussion When a command gate is disabled all future calls to runAction and runCommand will stall until the gate is enable()d later. This can be used to block client threads when a system sleep is requested. The IOWorkLoop thread itself will never stall, even when making runAction/runCommand calls. This call must be made from a gated context, to clear potential race conditions. */ + virtual void disable(); + +/*! @function enable + @abstract Enable command gate, this will unblock any blocked Commands and Actions. + @discussion Enable the command gate. The attemptAction/attemptCommand calls will now be enabled and can succeeed. Stalled runCommand/runAction calls will be woken up. */ + virtual void enable(); + +/*! @function commandSleep + @abstract Put a thread that is currently holding the command gate to sleep. + @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs or timeout occurs then the commandGate is closed before the function returns. + @param event Pointer to an address. + @param deadline Clock deadline to timeout the sleep. + @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE specifies that the sleep may be interrupted by any user signal. + @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate. */ + virtual IOReturn commandSleep(void *event, + AbsoluteTime deadline, + UInt32 interruptible); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOCommandGate, 0); +#else + OSMetaClassDeclareReservedUsed(IOCommandGate, 0); +#endif + OSMetaClassDeclareReservedUnused(IOCommandGate, 1); + OSMetaClassDeclareReservedUnused(IOCommandGate, 2); + OSMetaClassDeclareReservedUnused(IOCommandGate, 3); + OSMetaClassDeclareReservedUnused(IOCommandGate, 4); + OSMetaClassDeclareReservedUnused(IOCommandGate, 5); + OSMetaClassDeclareReservedUnused(IOCommandGate, 6); + OSMetaClassDeclareReservedUnused(IOCommandGate, 7); +}; + +#endif /* !_IOKIT_IOCOMMANDGATE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOCommandPool.h.svn-base b/i386/include/IOKit/.svn/text-base/IOCommandPool.h.svn-base new file mode 100644 index 0000000..91069f3 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOCommandPool.h.svn-base @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 2001-01-17 gvdl Re-implement on IOCommandGate::commandSleep + * 11/13/2000 CJS Created IOCommandPool class and implementation + * + */ + +/*! + * @header IOCommandPool + * @abstract + * This header contains the IOCommandPool class definition. + */ + +#ifndef _IOKIT_IO_COMMAND_POOL_H_ +#define _IOKIT_IO_COMMAND_POOL_H_ + +/* + * Kernel + */ + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include +#include +#include + +/*! + * @class IOCommandPool + * @abstract Manipulates a pool of commands which inherit from IOCommand. + * @discussion + * The IOCommandPool class is used to manipulate a pool of commands which + * inherit from IOCommand. It includes a factory method to create a pool + * of a certain size. Once the factory method is invoked, the semaphore + * is set to zero. The caller must then put commands in the pool by creating + * the command (via the controller's factory method or a memory allocation) + * and calling the returnCommand method with the newly created command as its + * argument. + */ + +class IOCommandPool : public OSObject +{ + + OSDeclareDefaultStructors(IOCommandPool) + + +protected: + + queue_head_t fQueueHead; /* head of the queue of elements available */ + UInt32 fSleepers; /* Count of threads sleeping on this pool */ + IOCommandGate *fSerializer; /* command gate used for serializing pool access */ + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOEventSource in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + /*! + * @const kIOCommandPoolDefaultSize + * @abstract The default size of any command pool. + * @discussion + * kIOCommandPoolDefaultSize is the default size of any command pool. + * The default size was determined to be the smallest size for which + * a pool makes sense. + */ + + static const UInt32 kIOCommandPoolDefaultSize = 2; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + +public: + + /*! + * @function initWithWorkLoop + * @abstract Primary initializer for an IOCommandPool object. + * @discussion Primary initializer for an IOCommandPool. + * Should probably use IOCommandPool::withWorkLoop() as it is easier to use. + * @param inWorkLoop + * The workloop that this command pool should synchronize with. + * @result Returns true if command pool was successfully initialized. + */ + virtual bool initWithWorkLoop(IOWorkLoop *workLoop); + + /*! + * @function withWorkLoop + * @abstract Primary factory method for the IOCommandPool class + * @discussion + * The withWorkLoop method is what is known as a factory method. It creates + * a new instance of an IOCommandPool and returns a pointer to that object. + * @param inWorkLoop + * The workloop that this command pool should synchronize with. + * @result + * Returns a pointer to an instance of IOCommandPool if successful, + * otherwise NULL. + */ + + static IOCommandPool *withWorkLoop(IOWorkLoop *inWorkLoop); + + /*! + * @function init + * @abstract Should never be used, obsolete. See initWithWorkLoop. + */ + virtual bool init(IOService *inOwner, + IOWorkLoop *inWorkLoop, + UInt32 inSize = kIOCommandPoolDefaultSize); + + /*! + * @function withWorkLoop + * @abstract Should never be used, obsolete. See IOCommandPool::withWorkLoop. + */ + static IOCommandPool *commandPool(IOService *inOwner, + IOWorkLoop *inWorkLoop, + UInt32 inSize = kIOCommandPoolDefaultSize); + + + /*! + * @function getCommand + * @discussion The getCommand method is used to get a pointer to an object of type IOCommand from the pool. + * @param blockForCommand + * If the caller would like to have its thread slept until a command is + * available, it should pass true, else false. + * @result + * If the caller passes true in blockForCommand, getCommand guarantees that + * the result will be a pointer to an IOCommand object from the pool. If + * the caller passes false, s/he is responsible for checking whether a non-NULL + * pointer was returned. + */ + + virtual IOCommand *getCommand(bool blockForCommand = true); + + /*! + * @function returnCommand + * @discussion + * The returnCommand method is used to place an object of type IOCommand + * into the pool, whether it be the first time, or the 1000th time. + * @param commmand + * The command to place in the pool. + */ + + virtual void returnCommand(IOCommand *command); + +protected: + + /*! + * @function gatedGetCommand + * @discussion + * The gatedGetCommand method is used to serialize the extraction of a + * command from the pool behind a command gate, runAction-ed by getCommand. + * @param vCommand + * A pointer to a pointer to an IOCommand object where the returned + * command will be stored. + * @param vBlock + * A bool that indicates whether to block the request until a command + * becomes available. + * @result + * Returns kIOReturnNoResources if no command is available and the client + * doesn't wish to block until one does become available. + * kIOReturnSuccess if the vCommand argument is valid. + */ + virtual IOReturn gatedGetCommand(IOCommand **command, bool blockForCommand); + + /*! + * @function gatedReturnCommand + * @discussion + * The gatedReturnCommand method is used to serialize the return of a + * command to the pool behind a command gate, runAction-ed by returnCommand. + * @param vCommand + * A pointer to the IOCommand object to be returned to the pool. + * @result + * Always returns kIOReturnSuccess if the vCommand argument is valid. + */ + virtual IOReturn gatedReturnCommand(IOCommand *command); + +private: + OSMetaClassDeclareReservedUnused(IOCommandPool, 0); + OSMetaClassDeclareReservedUnused(IOCommandPool, 1); + OSMetaClassDeclareReservedUnused(IOCommandPool, 2); + OSMetaClassDeclareReservedUnused(IOCommandPool, 3); + OSMetaClassDeclareReservedUnused(IOCommandPool, 4); + OSMetaClassDeclareReservedUnused(IOCommandPool, 5); + OSMetaClassDeclareReservedUnused(IOCommandPool, 6); + OSMetaClassDeclareReservedUnused(IOCommandPool, 7); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMMAND_POOL_H_ */ diff --git a/i386/include/IOKit/.svn/text-base/IOConditionLock.h.svn-base b/i386/include/IOKit/.svn/text-base/IOConditionLock.h.svn-base new file mode 100644 index 0000000..f628fee --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOConditionLock.h.svn-base @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * Copyright (c) 1994-1996 NeXT Software, Inc. All rights reserved. + */ + +#ifndef _IOKIT_IOCONDITIONLOCK_H +#define _IOKIT_IOCONDITIONLOCK_H + +#include +#include +#include + +#include + +class IOConditionLock : public OSObject +{ + OSDeclareDefaultStructors(IOConditionLock) + +private: + IOLock * cond_interlock; // condition var Simple lock + volatile int condition; + + IOLock * sleep_interlock; // sleep lock Simple lock + unsigned char interruptible; + volatile bool want_lock; + volatile bool waiting; + +public: + static IOConditionLock *withCondition(int condition, bool inIntr = true); + virtual bool initWithCondition(int condition, bool inIntr = true); + virtual void free(); + + virtual bool tryLock(); // acquire lock, no waiting + virtual int lock(); // acquire lock (enter critical section) + virtual void unlock(); // release lock (leave critical section) + + virtual bool getInterruptible() const; + virtual int getCondition() const; + virtual int setCondition(int condition); + + virtual int lockWhen(int condition); // acquire lock when condition + virtual void unlockWith(int condition); // set condition & release lock +}; + +#endif /* _IOKIT_IOCONDITIONLOCK_H */ diff --git a/i386/include/IOKit/.svn/text-base/IODMACommand.h.svn-base b/i386/include/IOKit/.svn/text-base/IODMACommand.h.svn-base new file mode 100644 index 0000000..a2a2852 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODMACommand.h.svn-base @@ -0,0 +1,557 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IODMACOMMAND_H +#define _IODMACOMMAND_H + +#include +#include +class IOMapper; + +/**************************** class IODMACommand ***************************/ + +/*! + @class IODMACommand + @abstract A mechanism to convert memory references to I/O bus addresses. + @discussion The IODMACommand is supersedes the IOMemoryCursor and greatly enhances the functionality and power of it. The command can be specified to output 64 bit physical addresses and also allows driver writers bypass mapping hardware or get addresses suitable for non-snooped DMA. +

+ The command is designed to be very easily subclassable. Most driver writers need to associate some DMA operations with their memory descriptor and usually use a C structure for that purpose. This structure is often kept in a linked list. This IODMACommand has built it linkage and can be derived and 'public:' variables added, giving the developer a structure that can associate a memory descriptor with a particular dma command but will also allow the developer to generate that command and keep the state necessary for tracking it. +

+ It is envisaged that a pool of IODMACommands will be created at driver initialisation and each command will be kept in an IOCommandPool while not in use. However if developers wishes to maintain their own free lists that is certainly possible. See the and for sample code on manipulating the command's doubly linked list entries. +

+ The IODMACommand can be used in a 'weak-linked' manner. To do this you must avoid using any static member functions. Use the, much slower but safe, weakWithSpecification function. On success a dma command instance will be returned. This instance can then be used to clone as many commands as is needed. Remember deriving from this class can not be done weakly, that is no weak subclassing! +*/ + +class IODMACommand : public IOCommand +{ + OSDeclareDefaultStructors(IODMACommand); + +friend class IODMAEventSource; + +public: + +/*! + @typedef Segment32 + @discussion A 32 bit I/O bus address/length pair +*/ + struct Segment32 { + UInt32 fIOVMAddr, fLength; + }; + +/*! + @typedef Segment64 + @discussion A 64 bit I/O bus address/length pair +*/ + struct Segment64 { + UInt64 fIOVMAddr, fLength; + }; + +/*! @enum MappingOptions + @abstract Mapping types to indicate the desired mapper type for translating memory descriptors into I/O DMA Bus addresses. + @constant kNonCoherent Used by drivers for non-coherent transfers, implies unmapped memmory + @constant kMapped Allow a driver to define addressing size + @constant kBypassed Allow drivers to bypass any mapper + @constant kMaxMappingOptions Internal use only +*/ + enum MappingOptions { + kMapped = 0x00000000, + kBypassed = 0x00000001, + kNonCoherent = 0x00000002, + kTypeMask = 0x0000000f, + + kNoCacheStore = 0x00000010, // Memory in descriptor + kOnChip = 0x00000020, // Indicates DMA is on South Bridge + kIterateOnly = 0x00000040 // DMACommand will be used as a cursor only + }; + +/*! @enum SynchronizeOptions + @abstract Options for the synchronize method. + @constant kForceDoubleBuffer Copy the entire prepared range to a new page aligned buffer. +*/ + enum SynchronizeOptions { + kForceDoubleBuffer = 0x01000000 + }; + +/*! + @typedef SegmentFunction + @discussion Pointer to a C function that translates a 64 segment and outputs a single desired segment to the array at the requested index. There are a group of pre-implemented SegmentFunctions that may be usefull to the developer below. + @param segment The 64Bit I/O bus address and length. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. + @result Returns true if segment encoding succeeded. false may be returned if the current segment does not fit in an output segment, i.e. a 38bit address wont fit into a 32 encoding. +*/ + typedef bool (*SegmentFunction)(IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + + // -------------- Preimplemented output functions ---------------- + +/*! @function OutputHost32 + @abstract Output host natural Segment32 output segment function. +*/ + static bool OutputHost32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputHost32 + @abstract Output host natural Segment32 output segment function. + */ +#define kIODMACommandOutputHost32 (IODMACommand::OutputHost32) + +/*! @function OutputBig32 + @abstract Output big-endian Segment32 output segment function. +*/ + static bool OutputBig32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputBig32 + @abstract Output big-endian Segment32 output segment function. + */ +#define kIODMACommandOutputBig32 (IODMACommand::OutputBig32) + +/*! @function OutputLittle32 + @abstract Output little-endian Segment32 output segment function. +*/ + static bool OutputLittle32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputLittle32 + @abstract Output little-endian Segment32 output segment function. +*/ +#define kIODMACommandOutputLittle32 (IODMACommand::OutputLittle32) + +/*! @function OutputHost64 + @abstract Output host natural Segment64 output segment function. +*/ + static bool OutputHost64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputHost64 + @abstract Output host natural Segment64 output segment function. +*/ +#define kIODMACommandOutputHost64 (IODMACommand::OutputHost64) + +/*! @function OutputBig64 + @abstract Output big-endian Segment64 output segment function. +*/ + static bool OutputBig64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputLittle64 + @abstract Output little-endian Segment64 output segment function. +*/ +#define kIODMACommandOutputBig64 (IODMACommand::OutputBig64) + +/*! @function OutputLittle64 + @abstract Output little-endian Segment64 output segment function. +*/ + static bool OutputLittle64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputBig64 + @abstract Output big-endian Segment64 output segment function. +*/ +#define kIODMACommandOutputLittle64 (IODMACommand::OutputLittle64) + +/*! @function withSpecification + @abstract Creates and initializes an IODMACommand in one operation. + @discussion Factory function to create and initialize an IODMACommand in one operation. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. If 0 is passed the maximum segment size is unlimited. + @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IODMACommand * + withSpecification(SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + void *refCon = 0); + +/*! @function weakWithSpecification + @abstract Creates and initialises an IODMACommand in one operation if this version of the operating system supports it. + @discussion Factory function to create and initialise an IODMACommand in one operation. The function allows a developer to 'weak' link with IODMACommand. This function will return kIOReturnUnsupported if the IODMACommand is unavailable. This function is actually fairly slow so it will be better to call it once then clone the successfully create command using cloneCommand (q.v.). + @param newCommand Output reference variable of the newly created IODMACommand. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. Zero is treated as an unlimited segment size. + @param mapType is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below. This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transfers are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @result kIOReturnSuccess if everything is OK, otherwise kIOReturnBadArgument if newCommand is NULL, kIOReturnUnsupported if the kernel doesn't export IODMACommand or IOReturnError if the new command fails to init, q.v. initWithSpecification. +*/ + // Note that the function has the attribute always_inline. + // The point of this function is to make a call into the kernel + // without generating an undefined symbol. If the client could call + // the code as a function then the goal of no undefined symbols + // would be lost thus defeating the purpose. + static inline IOReturn weakWithSpecification + (IODMACommand **newCommand, + SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mapType = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + void *refCon = 0) __attribute__((always_inline)); + +/*! + @function cloneCommand + @abstract Creates a new command based on the specification of the current one. + @discussion Factory function to create and initialise an IODMACommand in one operation. The current command's specification will be duplicated in the new object, but however none of its state will be duplicated. This means that it is safe to clone a command even if it is currently active and running, however you must be certain that the command to be duplicated does have a valid reference for the duration. + @result Returns a new memory cursor if successfully created and initialised, 0 otherwise. +*/ + virtual IODMACommand *cloneCommand(void *refCon = 0); + +/*! @function initWithSpecification + @abstract Primary initializer for the IODMACommand class. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0 which means any size. + @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @result Can fail if the mapping type is not recognised, if one of the 3 mandatory parameters are set to 0, if a 32 bit output function is selected when more than 32 bits of address is required or, if kBypassed is requested on a machine that doesn't support bypassing. Returns true otherwise. +*/ + virtual bool initWithSpecification( SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + void *refCon = 0); + +/*! @function setMemoryDescriptor + @abstract Sets and resets the DMACommand's current memory descriptor + @discussion The DMA command will configure itself based on the information that it finds in the memory descriptor. It looks for things like the direction of the memory descriptor and whether the current memory descriptor is already mapped into some IOMMU. As a programmer convenience it can also prepare the memory descriptor immediately. See prepare(). Note the IODMACommand is designed to used multiple times with a succession of memory descriptors, making the pooling of commands possible. It is an error though to attempt to reset a currently prepared() DMA command. Warning: This routine may block so never try to autoprepare an IODMACommand while in a gated context, i.e. one of the WorkLoops action call outs. + @param mem A pointer to the current I/Os memory descriptor. + @param autoPrepare An optional boolean variable that will call the prepare() function automatically after the memory descriptor is processed. Defaults to true. + @result Returns kIOReturnSuccess, kIOReturnBusy if currently prepared, kIOReturnNoSpace if the length(mem) >= Maximum Transfer Size or the error codes returned by prepare() (qv). +*/ + virtual IOReturn setMemoryDescriptor(const IOMemoryDescriptor *mem, + bool autoPrepare = true); + +/*! @function clearMemoryDescriptor + @abstract Clears the DMACommand's current memory descriptor + @discussion completes and invalidates the cache if the DMA command is currently active, copies all data from bounce buffers if necessary and releases all resources acquired during setMemoryDescriptor. + @param autoComplete An optional boolean variable that will call the complete() function automatically before the memory descriptor is processed. Defaults to true. +*/ + virtual IOReturn clearMemoryDescriptor(bool autoComplete = true); + +/*! @function getMemoryDescriptor + @abstract Get the current memory descriptor +*/ + virtual const IOMemoryDescriptor *getMemoryDescriptor() const; + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion Allocate the mapping resources neccessary for this transfer, specifying a sub range of the IOMemoryDescriptor that will be the target of the I/O. The complete() method frees these resources. Data may be copied to buffers for kIODirectionOut memory descriptors, depending on hardware mapping resource availabilty or alignment restrictions. It should be noted that the this function may block and should only be called on the clients context, i.e never call this routine while gated; also the call itself is not thread safe though this should be an issue as each IODMACommand is independant. + @param offset defines the starting offset in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param length defines the ending position in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param flushCache Flush the caches for the memory descriptor and make certain that the memory cycles are complete. Defaults to true for kNonCoherent and is ignored by the other types. + @param synchronize Copy any buffered data back from the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + @result An IOReturn code. */ + + virtual IOReturn prepare(UInt64 offset = 0, UInt64 length = 0, bool flushCache = true, bool synchronize = true); + +/*! @function complete + @abstract Complete processing of DMA mappings after an I/O transfer is finished. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer + @param invalidCache Invalidate the caches for the memory descriptor. Defaults to true for kNonCoherent and is ignored by the other types. + @param synchronize Copy any buffered data back to the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + @result kIOReturnNotReady if not prepared, kIOReturnSuccess otherwise. */ + + virtual IOReturn complete(bool invalidateCache = true, bool synchronize = true); + +/*! @function synchronize + @abstract Bring IOMemoryDescriptor and IODMACommand buffers into sync. + @discussion This method should not be called unless a prepare was previously issued. If needed a caller may synchronize any IODMACommand buffers with the original IOMemoryDescriptor buffers. + @param options Specifies the direction of the copy: + kIODirectionOut copy IOMemoryDesciptor memory to any IODMACommand buffers. By default this action takes place automatically at prepare(). + kIODirectionIn copy any IODMACommand buffers back to the IOMemoryDescriptor. By default this action takes place automatically at complete(). + kForceDoubleBuffer copy the entire prepared range to a new page aligned buffer. + @result kIOReturnNotReady if not prepared, kIOReturnBadArgument if invalid options are passed, kIOReturnSuccess otherwise. */ + + virtual IOReturn synchronize(IOOptionBits options); + +/*! @function genIOVMSegments + @abstract Generates a physical scatter/gather for the current DMA command + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. The constraints that are set during initialisation will be respected. This function maintains the state across multiple calls for efficiency. However the state is discarded if the new offset is not the expected one. + @param offset input/output parameter, defines the starting and ending offset in the memory descriptor, relative to any offset passed to the prepare() method. + @param segments Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction. + @param numSegments Input/output parameter Number of segments that can fit in the segment array and returns number of segments generated. + @result kIOReturnSuccess on success, kIOReturnOverrun if the memory descriptor is exhausted, kIOReturnMessageTooLarge if the output segment function's address bits has insufficient resolution for a segment, kIOReturnNotReady if the DMA command has not be prepared, kIOReturnBadArgument if the DMA command doesn't have a memory descriptor yet or some of the parameters are NULL and kIOReturnNotReady if the DMA command is not prepared. +*/ + virtual IOReturn genIOVMSegments(UInt64 *offset, + void *segments, + UInt32 *numSegments); + +private: + virtual UInt64 transfer( IOOptionBits transferOp, UInt64 offset, void * buffer, UInt64 length ); + +public: + +/*! @function writeBytes + @abstract Copy data to the IODMACommand's buffer from the specified buffer. + @discussion This method copies data to the IODMACommand's memory at the given offset, from the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset. + @param offset A byte offset into the IODMACommand's memory, relative to the prepared offset. + @param bytes The caller supplied buffer to copy the data from. + @param length The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand. */ + + UInt64 writeBytes(UInt64 offset, const void *bytes, UInt64 length); + +/*! @function readBytes + @abstract Copy data from the IODMACommand's buffer to the specified buffer. + @discussion This method copies data from the IODMACommand's memory at the given offset, to the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset. + @param offset A byte offset into the IODMACommand's memory, relative to the prepared offset. + @param bytes The caller supplied buffer to copy the data to. + @param length The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand. */ + + UInt64 readBytes(UInt64 offset, void *bytes, UInt64 length); + +/*! @function gen32IOVMSegments + @abstract Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost32, kIODMACommandOutputBig32, or kIODMACommandOutputLittle32. If the output function of the IODMACommand is not a 32 bit function, results will be incorrect. +*/ + inline IOReturn gen32IOVMSegments(UInt64 *offset, + Segment32 *segments, + UInt32 *numSegments) + { return genIOVMSegments(offset, segments, numSegments); }; + +/*! @function gen64IOVMSegments + @abstract Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost64, kIODMACommandOutputBig64, or kIODMACommandOutputLittle64. If the output function of the IODMACommand is not a 64 bit function, results will be incorrect. +*/ + inline IOReturn gen64IOVMSegments(UInt64 *offset, + Segment64 *segments, + UInt32 *numSegments) + { return genIOVMSegments(offset, segments, numSegments); }; + + IOReturn + genIOVMSegments(SegmentFunction segmentFunction, + UInt64 *offsetP, + void *segmentsP, + UInt32 *numSegmentsP); + + virtual void free(); + +private: + typedef IOReturn (*InternalSegmentFunction)( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + + IOReturn genIOVMSegments(uint32_t op, + InternalSegmentFunction outSegFunc, + void *reference, + UInt64 *offsetP, + void *segmentsP, + UInt32 *numSegmentsP); + + static IOReturn clientOutputSegment( + void *reference, IODMACommand *target, + Segment64 segment, void *vSegList, UInt32 outSegIndex); + + static IOReturn segmentOp( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + IOReturn walkAll(UInt8 op); + +public: + +/*! @function prepareWithSpecification + @abstract Prepare the memory for an I/O transfer with a new specification. + @discussion Allocate the mapping resources neccessary for this transfer, specifying a sub range of the IOMemoryDescriptor that will be the target of the I/O. The complete() method frees these resources. Data may be copied to buffers for kIODirectionOut memory descriptors, depending on hardware mapping resource availabilty or alignment restrictions. It should be noted that the this function may block and should only be called on the clients context, i.e never call this routine while gated; also the call itself is not thread safe though this should be an issue as each IODMACommand is independant. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0 which means any size. + @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @param offset defines the starting offset in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param length defines the ending position in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param flushCache Flush the caches for the memory descriptor and make certain that the memory cycles are complete. Defaults to true for kNonCoherent and is ignored by the other types. + @param synchronize Copy any buffered data back from the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + @result An IOReturn code. Can fail if the mapping type is not recognised, if one of the 3 mandatory parameters are set to 0, if a 32 bit output function is selected when more than 32 bits of address is required or, if kBypassed is requested on a machine that doesn't support bypassing. +*/ + + virtual IOReturn prepareWithSpecification(SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + UInt64 offset = 0, + UInt64 length = 0, + bool flushCache = true, + bool synchronize = true); + + static IOReturn transferSegment( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + +/*! @function getPreparedOffsetAndLength + @abstract Returns the offset and length into the target IOMemoryDescriptor of a prepared IODDMACommand. + @discussion If successfully prepared, returns the offset and length into the IOMemoryDescriptor. Will fail for an unprepared IODMACommand. + @param offset returns the starting offset in the memory descriptor the DMA command was prepared with. Pass NULL for don't care. + @param length returns the length in the memory descriptor the DMA command was prepared with. Pass NULL for don't care. + @result An IOReturn code. kIOReturnNotReady if the IODMACommand is not prepared. */ + + virtual IOReturn getPreparedOffsetAndLength(UInt64 * offset, UInt64 * length); + + UInt8 getNumAddressBits(void); + UInt32 getAlignment(void); + +private: + OSMetaClassDeclareReservedUsed(IODMACommand, 0); + OSMetaClassDeclareReservedUsed(IODMACommand, 1); + OSMetaClassDeclareReservedUsed(IODMACommand, 2); + OSMetaClassDeclareReservedUnused(IODMACommand, 3); + OSMetaClassDeclareReservedUnused(IODMACommand, 4); + OSMetaClassDeclareReservedUnused(IODMACommand, 5); + OSMetaClassDeclareReservedUnused(IODMACommand, 6); + OSMetaClassDeclareReservedUnused(IODMACommand, 7); + OSMetaClassDeclareReservedUnused(IODMACommand, 8); + OSMetaClassDeclareReservedUnused(IODMACommand, 9); + OSMetaClassDeclareReservedUnused(IODMACommand, 10); + OSMetaClassDeclareReservedUnused(IODMACommand, 11); + OSMetaClassDeclareReservedUnused(IODMACommand, 12); + OSMetaClassDeclareReservedUnused(IODMACommand, 13); + OSMetaClassDeclareReservedUnused(IODMACommand, 14); + OSMetaClassDeclareReservedUnused(IODMACommand, 15); + +public: +/*! @var fRefCon Reference Constant, client defined publicly avialable */ + void *fRefCon; + +protected: + +/*! @var fMaxSegmentSize Maximum size of one segment in a scatter/gather list */ + UInt64 fMaxSegmentSize; + +/*! @var fMaxTransferSize + Maximum size of a transfer that this memory cursor is allowed to generate */ + UInt64 fMaxTransferSize; + +/*! @var fBypassMask + Mask to be ored into the address to bypass the given iommu's mapping. */ + UInt64 fBypassMask; + +/*! @var fMapper + Client defined mapper. */ + IOMapper *fMapper; + +/*! @var fMemory + memory descriptor for current I/O. */ + const IOMemoryDescriptor *fMemory; + +/*! @var fOutSeg The action method called when an event has been delivered */ + SegmentFunction fOutSeg; + +/*! @var fAlignMask + Alignment restriction mask. */ + UInt32 fAlignMask; + +/*! @var fNumAddressBits + Number of bits that the hardware can address */ + UInt32 fNumAddressBits; + +/*! @var fNumSegments + Number of contiguous segments required for the current memory descriptor and desired mapping */ + UInt32 fNumSegments; + +/*! @var fMappingOptions + What type of I/O virtual address mapping is required for this command */ + MappingOptions fMappingOptions; + +/*! @var fActive + fActive indicates that this DMA command is currently prepared and ready to go */ + UInt32 fActive; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + struct IODMACommandInternal * reserved; +}; + +IOReturn IODMACommand:: +weakWithSpecification(IODMACommand **newCommand, + SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mapType, + UInt64 maxTransferSize, + UInt32 alignment, + IOMapper *mapper, + void *refCon) +{ + if (!newCommand) + return kIOReturnBadArgument; + + IODMACommand *self = (IODMACommand *) + OSMetaClass::allocClassWithName("IODMACommand"); + if (!self) + return kIOReturnUnsupported; + + IOReturn ret; + bool inited = self-> + initWithSpecification(outSegFunc, + numAddressBits, maxSegmentSize, mapType, + maxTransferSize, alignment, mapper, refCon); + if (inited) + ret = kIOReturnSuccess; + else { + self->release(); + self = 0; + ret = kIOReturnError; + } + + *newCommand = self; + return ret; +}; +#endif /* !_IODMACOMMAND_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IODMAController.h.svn-base b/i386/include/IOKit/.svn/text-base/IODMAController.h.svn-base new file mode 100644 index 0000000..a8c1aed --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODMAController.h.svn-base @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODMACONTROLLER_H +#define _IOKIT_IODMACONTROLLER_H + +#include +#include +#include + +class IODMAEventSource; + +class IODMAController : public IOService +{ + OSDeclareAbstractStructors(IODMAController); + + friend class IODMAEventSource; + + private: + IOService *_provider; + const OSSymbol *_dmaControllerName; + + protected: + virtual void registerDMAController(IOOptionBits options = 0); + virtual IOReturn initDMAChannel(IOService *provider, IODMAEventSource *dmaES, UInt32 *dmaIndex, UInt32 reqIndex) = 0; + virtual IOReturn startDMACommand(UInt32 dmaIndex, IODMACommand *dmaCommand, IODirection direction, + IOByteCount byteCount = 0, IOByteCount byteOffset = 0) = 0; + virtual IOReturn stopDMACommand(UInt32 dmaIndex, bool flush = false, uint64_t timeout = UINT64_MAX) = 0; + virtual void completeDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand); + virtual void notifyDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount); + virtual IOReturn queryDMACommand(UInt32 dmaIndex, IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false) = 0; + virtual IOByteCount getFIFODepth(UInt32 dmaIndex) = 0; + + public: + static const OSSymbol *createControllerName(UInt32 phandle); + static IODMAController *getController(IOService *provider, UInt32 dmaIndex); + + virtual bool start(IOService *provider); +}; + + +#endif /* _IOKIT_IODMACONTROLLER_H */ diff --git a/i386/include/IOKit/.svn/text-base/IODMAEventSource.h.svn-base b/i386/include/IOKit/.svn/text-base/IODMAEventSource.h.svn-base new file mode 100644 index 0000000..18a72de --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODMAEventSource.h.svn-base @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODMAEVENTSOURCE_H +#define _IOKIT_IODMAEVENTSOURCE_H + +#include +#include +#include +#include + +class IODMAController; + +class IODMAEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IODMAEventSource); + + friend class IODMAController; + + public: + typedef void (*Action)(OSObject *owner, IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount); +#define IODMAEventAction IODMAEventSource::Action + + protected: + virtual void completeDMACommand(IODMACommand *dmaCommand); + virtual void notifyDMACommand(IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount); + + public: + static IODMAEventSource *dmaEventSource(OSObject *owner, + IOService *provider, + Action completion = 0, + Action notification = 0, + UInt32 dmaIndex = 0); + + virtual IOReturn startDMACommand(IODMACommand *dmaCommand, IODirection direction, IOByteCount byteCount = 0, IOByteCount byteOffset = 0); + virtual IOReturn stopDMACommand(bool flush = false, uint64_t timeout = UINT64_MAX); + + virtual IOReturn queryDMACommand(IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false); + virtual IOByteCount getFIFODepth(); + + private: + IOService *dmaProvider; + IODMAController *dmaController; + UInt32 dmaIndex; + queue_head_t dmaCommandsCompleted; + IOSimpleLock *dmaCommandsCompletedLock; + Action dmaCompletionAction; + Action dmaNotificationAction; + bool dmaSynchBusy; + + virtual bool init(OSObject *owner, + IOService *provider, + Action completion = 0, + Action notification = 0, + UInt32 dmaIndex = 0); + virtual bool checkForWork(void); +}; + +#endif /* _IOKIT_IODMAEVENTSOURCE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IODataQueue.h.svn-base b/i386/include/IOKit/.svn/text-base/IODataQueue.h.svn-base new file mode 100644 index 0000000..458cb47 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODataQueue.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUE_H +#define _IOKIT_IODATAQUEUE_H + +#include +#include +#include +#include + +typedef struct _IODataQueueMemory IODataQueueMemory; +class IOMemoryDescriptor; + +struct _notifyMsg { + mach_msg_header_t h; +}; + +/*! + * @class IODataQueue : public OSObject + * @abstract A generic queue designed to pass data from the kernel to a user process. + * @discussion The IODataQueue class is designed to allow kernel code to queue data to a user process. IODataQueue objects are designed to be used in a single producer / single consumer situation. As such, there are no locks on the data itself. Because the kernel enqueue and user-space dequeue methods follow a strict set of guidelines, no locks are necessary to maintain the integrity of the data struct. + * + *
Each data entry can be variable sized, but the entire size of the queue data region (including overhead for each entry) must be specified up front. + * + *
In order for the IODataQueue instance to notify the user process that data is available, a notification mach port must be set. When the queue is empty and a new entry is added, a message is sent to the specified port. + * + *
User client code exists in the IOKit framework that facilitates the creation of the receive notification port as well as the listen process for new data available notifications. + * + *
In order to make the data queue memory available to a user process, the method getMemoryDescriptor() must be used to get an IOMemoryDescriptor instance that can be mapped into a user process. Typically, the clientMemoryForType() method on an IOUserClient instance will be used to request the IOMemoryDescriptor and then return it to be mapped into the user process. + */ +class IODataQueue : public OSObject +{ + OSDeclareDefaultStructors(IODataQueue) + +protected: + IODataQueueMemory * dataQueue; + + void * notifyMsg; + + virtual void free(); + + /*! + * @function sendDataAvailableNotification + * @abstract Sends a dataAvailableNotification message to the specified mach port. + * @discussion This method sends a message to the mach port passed to setNotificationPort(). It is used to indicate that data is available in the queue. + */ + virtual void sendDataAvailableNotification(); + +public: + /*! + * @function withCapacity + * @abstract Static method that creates a new IODataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in .
This method allocates a new IODataQueue instance and then calls initWithCapacity() with the given size parameter. If the initWithCapacity() fails, the new instance is released and zero is returned. + * @param size The size of the data queue memory region. + * @result Returns the newly allocated IODataQueue instance. Zero is returned on failure. + */ + static IODataQueue *withCapacity(UInt32 size); + + /*! + * @function withEntries + * @abstract Static method that creates a new IODataQueue instance with the specified number of entries of the given size. + * @discussion This method will create a new IODataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. If the initWithEntries() fails, the new instance is released and zero is returned. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns the newly allocated IODataQueue instance. Zero is returned on failure. + */ + static IODataQueue *withEntries(UInt32 numEntries, UInt32 entrySize); + + /*! + * @function initWithCapacity + * @abstract Initializes an IODataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in . + * @param size The size of the data queue memory region. + * @result Returns true on success and false on failure. + */ + virtual Boolean initWithCapacity(UInt32 size); + + /*! + * @function initWithEntries + * @abstract Initializes an IODataQueue instance with the specified number of entries of the given size. + * @discussion This method will initialize an IODataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns true on success and false on failure. + */ + virtual Boolean initWithEntries(UInt32 numEntries, UInt32 entrySize); + + /*! + * @function enqueue + * @abstract Enqueues a new entry on the queue. + * @discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the tail value and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the tail to the next available location. When attempting to add a new entry towards the end of the queue and there isn't enough space at the end, it wraps back to the beginning.
If the queue is empty when a new entry is added, sendDataAvailableNotification() is called to send a message to the user process that data is now available. + * @param data Pointer to the data to be added to the queue. + * @param dataSize Size of the data pointed to by data. + * @result Returns true on success and false on failure. Typically failure means that the queue is full. + */ + virtual Boolean enqueue(void *data, UInt32 dataSize); + + /*! + * @function setNotificationPort + * @abstract Creates a simple mach message targeting the mach port specified in port. + * @discussion This message is sent when data is added to an empty queue. It is to notify a user process that new data has become available. + * @param port The mach port to target with the notification message. + */ + virtual void setNotificationPort(mach_port_t port); + + /*! + * @function getMemoryDescriptor + * @abstract Returns a memory descriptor covering the IODataQueueMemory region. + * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on. + * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure. + */ + virtual IOMemoryDescriptor *getMemoryDescriptor(); +}; + +#endif /* _IOKIT_IODATAQUEUE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IODataQueueShared.h.svn-base b/i386/include/IOKit/.svn/text-base/IODataQueueShared.h.svn-base new file mode 100644 index 0000000..2fa0e9a --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODataQueueShared.h.svn-base @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUESHARED_H +#define _IOKIT_IODATAQUEUESHARED_H + +#include +#include +#include + +/*! + * @typedef IODataQueueEntry + * @abstract Represents an entry within the data queue + * @discussion This is a variable sized struct. The data field simply represents the start of the data region. The size of the data region is stored in the size field. The whole size of the specific entry is the size of a UInt32 plus the size of the data region. + * @field size The size of the following data region. + * @field data Represents the beginning of the data region. The address of the data field is a pointer to the start of the data region. + */ +typedef struct _IODataQueueEntry{ + UInt32 size; + UInt8 data[4]; +} IODataQueueEntry; + +/*! + * @typedef IODataQueueMemory + * @abstract A struct mapping to the header region of a data queue. + * @discussion This struct is variable sized. The struct represents the data queue header information plus a pointer to the actual data queue itself. The size of the struct is the combined size of the header fields (3 * sizeof(UInt32)) plus the actual size of the queue region. This size is stored in the queueSize field. + * @field queueSize The size of the queue region pointed to by the queue field. + * @field head The location of the queue head. This field is represented as a byte offset from the beginning of the queue memory region. + * @field tail The location of the queue tail. This field is represented as a byte offset from the beginning of the queue memory region. + * @field queue Represents the beginning of the queue memory region. The size of the region pointed to by queue is stored in the queueSize field. + */ +typedef struct _IODataQueueMemory { + UInt32 queueSize; + volatile UInt32 head; + volatile UInt32 tail; + IODataQueueEntry queue[1]; +} IODataQueueMemory; + +/*! + * @typedef IODataQueueAppendix + * @abstract A struct mapping to the appendix region of a data queue. + * @discussion This struct is variable sized dependent on the version. The struct represents the data queue appendix information. + * @field version The version of the queue appendix. + * @field port The notification port associated with this queue. + */ +typedef struct _IODataQueueAppendix { + UInt32 version; + mach_msg_header_t msgh; +} IODataQueueAppendix; + +/*! + * @defined DATA_QUEUE_ENTRY_HEADER_SIZE Represents the size of the data queue entry header independent of the actual size of the data in the entry. This is the overhead of each entry in the queue. The total size of an entry is equal to this value plus the size stored in the entry's size field (in IODataQueueEntry). + */ +#define DATA_QUEUE_ENTRY_HEADER_SIZE (sizeof(IODataQueueEntry) - 4) + +/*! + * @defined DATA_QUEUE_MEMORY_HEADER_SIZE Represents the size of the data queue memory header independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of the queue appendix and the size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_HEADER_SIZE (sizeof(IODataQueueMemory) - sizeof(IODataQueueEntry)) + +/*! + * @defined DATA_QUEUE_MEMORY_APPENDIX_SIZE Represents the size of the data queue memory appendix independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of queue header and size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_APPENDIX_SIZE (sizeof(IODataQueueAppendix)) + +#endif /* _IOKIT_IODATAQUEUESHARED_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IODeviceMemory.h.svn-base b/i386/include/IOKit/.svn/text-base/IODeviceMemory.h.svn-base new file mode 100644 index 0000000..0665efc --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODeviceMemory.h.svn-base @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IODEVICEMEMORY_H +#define _IOKIT_IODEVICEMEMORY_H + +#include + +/*! @class IODeviceMemory + @abstract An IOMemoryDescriptor used for device physical memory ranges. + @discussion The IODeviceMemory class is a simple subclass of IOMemoryDescriptor that uses its methods to describe a single range of physical memory on a device. IODeviceMemory objects are usually looked up with IOService or IOPCIDevice accessors, and are created by memory-mapped bus families. IODeviceMemory implements only some factory methods in addition to the methods of IOMemoryDescriptor. +*/ + +class IODeviceMemory : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IODeviceMemory) + +public: + +/*! @struct InitElement + @field start First physical address in the range. + @field length Length of the range. + @field tag 32-bit value not interpreted by IODeviceMemory or IOMemoryDescriptor, for use by the bus family. */ + + struct InitElement { + IOPhysicalAddress start; + IOPhysicalLength length; + IOOptionBits tag; + }; + +/*! @function arrayFromList + @abstract Constructs an OSArray of IODeviceMemory instances, each describing one physical range, and a tag value. + @discussion This method creates IODeviceMemory instances for each physical range passed in an IODeviceMemory::InitElement array. Each element consists of a physical address, length and tag value for the IODeviceMemory. The instances are returned as a created OSArray. + @param list An array of IODeviceMemory::InitElement structures. + @param count The number of elements in the list. + @result Returns a created OSArray of IODeviceMemory objects, to be released by the caller, or zero on failure. */ + + static OSArray * arrayFromList( + InitElement list[], + IOItemCount count ); + +/*! @function withRange + @abstract Constructs an IODeviceMemory instance, describing one physical range. + @discussion This method creates an IODeviceMemory instance for one physical range passed as a physical address and length. It just calls IOMemoryDescriptor::withPhysicalAddress. + @param address The physical address of the first byte in the memory. + @param withLength The length of memory. + @result Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure. */ + + static IODeviceMemory * withRange( + IOPhysicalAddress start, + IOPhysicalLength length ); + +/*! @function withSubRange + @abstract Constructs an IODeviceMemory instance, describing a subset of an existing IODeviceMemory range. + @discussion This method creates an IODeviceMemory instance for a subset of an existing IODeviceMemory range, passed as a physical address offset and length. It just calls IOMemoryDescriptor::withSubRange. + @param of The parent IODeviceMemory of which a subrange is to be used for the new descriptor, which will be retained by the subrange IODeviceMemory. + @param offset A byte offset into the parent's memory. + @param length The length of the subrange. + @result Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure. */ + + static IODeviceMemory * withSubRange( + IODeviceMemory * of, + IOPhysicalAddress offset, + IOPhysicalLength length ); +}; + +#endif /* ! _IOKIT_IODEVICEMEMORY_H */ diff --git a/i386/include/IOKit/.svn/text-base/IODeviceTreeSupport.h.svn-base b/i386/include/IOKit/.svn/text-base/IODeviceTreeSupport.h.svn-base new file mode 100644 index 0000000..15b5aa4 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IODeviceTreeSupport.h.svn-base @@ -0,0 +1,127 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IODEVICETREE_H +#define _IOKIT_IODEVICETREE_H + +#include +#include + +class IODeviceMemory; +class IOService; + +extern const IORegistryPlane * gIODTPlane; + +extern const OSSymbol * gIODTPHandleKey; + +extern const OSSymbol * gIODTCompatibleKey; +extern const OSSymbol * gIODTTypeKey; +extern const OSSymbol * gIODTModelKey; + +extern const OSSymbol * gIODTAAPLInterruptsKey; +extern const OSSymbol * gIODTDefaultInterruptController; +extern const OSSymbol * gIODTNWInterruptMappingKey; + +IORegistryEntry * IODeviceTreeAlloc( void * dtTop ); + + +bool IODTMatchNubWithKeys( IORegistryEntry * nub, + const char * keys ); + +bool IODTCompareNubName( const IORegistryEntry * regEntry, + OSString * name, OSString ** matchingName ); + +enum { + kIODTRecursive = 0x00000001, + kIODTExclusive = 0x00000002 +}; + +OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from, + IOOptionBits options, const char * keys ); + +typedef SInt32 (*IODTCompareAddressCellFunc) + (UInt32 cellCount, UInt32 left[], UInt32 right[]); +typedef void (*IODTNVLocationFunc) + (IORegistryEntry * entry, + UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum ); + +void IODTSetResolving( IORegistryEntry * regEntry, + IODTCompareAddressCellFunc compareFunc, + IODTNVLocationFunc locationFunc ); + +bool IODTResolveAddressCell( IORegistryEntry * regEntry, + UInt32 cellsIn[], + IOPhysicalAddress * phys, IOPhysicalLength * len ); + +OSArray * IODTResolveAddressing( IORegistryEntry * regEntry, + const char * addressPropertyName, + IODeviceMemory * parent ); + +struct IONVRAMDescriptor { + unsigned int format:4; + unsigned int marker:1; + unsigned int bridgeCount:3; + unsigned int busNum:2; + unsigned int bridgeDevices:6 * 5; + unsigned int functionNum:3; + unsigned int deviceNum:5; +} __attribute__((aligned(2), packed)); + +IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry, + IONVRAMDescriptor * hdr ); + +OSData * IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber ); + +const OSSymbol * IODTInterruptControllerName( + IORegistryEntry * regEntry ); + +bool IODTMapInterrupts( IORegistryEntry * regEntry ); + +enum { + kIODTInterruptShared = 0x00000001 +}; +IOReturn IODTGetInterruptOptions( IORegistryEntry * regEntry, int source, IOOptionBits * options ); + +#ifdef __cplusplus +extern "C" { +#endif + +IOReturn IONDRVLibrariesInitialize( IOService * provider ); + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IODEVICETREE_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IOEventSource.h.svn-base b/i386/include/IOKit/.svn/text-base/IOEventSource.h.svn-base new file mode 100644 index 0000000..4afc5aa --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOEventSource.h.svn-base @@ -0,0 +1,244 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1998 Apple Computer, Inc. All rights reserved. +HISTORY + 1998-7-13 Godfrey van der Linden(gvdl) + Created. + 1998-10-30 Godfrey van der Linden(gvdl) + Converted to C++ +*/ +#ifndef _IOKIT_IOEVENTSOURCE_H +#define _IOKIT_IOEVENTSOURCE_H + +#include + +#include + +#include +#include +#include + + +__BEGIN_DECLS +#include +#include +__END_DECLS + +/*! + @class IOEventSource : public OSObject + @abstract Abstract class for all work-loop event sources. + @discussion The IOEventSource declares the abstract super class that all +event sources must inherit from if an IOWorkLoop is to receive events from them. +

+ An event source can represent any event that should cause the work-loop of a +device to wake up and perform work. Two examples of event sources are the +IOInterruptEventSource which delivers interrupt notifications and IOCommandGate +which delivers command requests. +

+ A kernel module can always use the work-loop model for serialising access to +anything at all. The IOEventSource is used for communicating events to the +work-loop, and the chain of event sources should be used to walk the possible +event sources and demultipex them. Note a particular instance of an event +source may only be a member of 1 linked list chain. If you need to move it +between chains than make sure it is removed from the original chain before +attempting to move it. +

+ The IOEventSource makes no attempt to maintain the consitency of it's internal data across multi-threading. It is assumed that the user of these basic tools will protect the data that these objects represent in some sort of device wide instance lock. For example the IOWorkLoop maintains the event chain by handing off change request to its own thread and thus single threading access to its state. +

+ All subclasses of the IOEventSource are expected to implement the checkForWork() member function. + +

+ checkForWork() is the key method in this class. It is called by some work-loop when convienient and is expected to evaluate it's internal state and determine if an event has occurred since the last call. In the case of an event having occurred then the instance defined target(owner)/action will be called. The action is stored as an ordinary C function pointer but the first parameter is always the owner. This means that a C++ member function can be used as an action function though this depends on the ABI. +

+ Although the eventChainNext variable contains a reference to the next event source in the chain this reference is not retained. The list 'owner' i.e. the client that creates the event, not the work-loop, is expected to retain the source. +*/ +class IOEventSource : public OSObject +{ + OSDeclareAbstractStructors(IOEventSource) + friend class IOWorkLoop; + +public: +/*! + @typedef Action + @discussion Placeholder type for C++ function overloading discrimination. +As the all event sources require an action and it has to be stored somewhere +and be of some type, this is that type. + @param owner + Target of the function, can be used as a refcon. The owner is set +during initialisation. Note if a C++ function was specified this parameter +is implicitly the first paramter in the target member function's parameter list. +*/ + typedef void (*Action)(OSObject *owner, ...); + +/*! @defined IOEventSourceAction + @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOEventSource::Action */ + #define IOEventSourceAction IOEventSource::Action + +protected: +/*! @var eventChainNext + The next event source in the event chain. nil at end of chain. */ + IOEventSource *eventChainNext; + +/*! @var owner The owner object called when an event has been delivered. */ + OSObject *owner; + +/*! @var action + The action method called when an event has been delivered */ + Action action; + +/*! @var enabled + Is this event source enabled to deliver requests to the work-loop. */ + bool enabled; + +/*! @var workLoop What is the work-loop for this event source. */ + IOWorkLoop *workLoop; + +/*! @var refcon What ever the client wants to do, see $link setRefcon. */ + void *refcon; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOEventSource in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function init + @abstract Primary initialiser for the IOEventSource class. + @param owner + Owner of this instance of an event source. Used as the first parameter +of the action callout. Owner will generally be an OSObject it doesn't have to +be as no member functions will be called directly in it. It can just be a +refcon for a client routine. + @param action + Pointer to C call out function. Action is a pointer to a C function +that gets called when this event source has outstanding work. It will usually +be called by the checkForWork member function. The first parameter of the +action call out will always be the owner, this allows C++ member functions to +be used as actions. Defaults to 0. + @result true if the inherited classes and this instance initialise +successfully. +*/ + virtual bool init(OSObject *owner, IOEventSource::Action action = 0); + +/*! @function checkForWork + @abstract Pure Virtual member function used by IOWorkLoop for work +scheduling. + @discussion This function will be called to request a subclass to check +it's internal state for any work to do and then to call out the owner/action. + @result Return true if this function needs to be called again before all its outstanding events have been processed. + */ + virtual bool checkForWork() = 0; + +/*! @function setWorkLoop + @abstract Set'ter for $link workLoop variable. + @param workLoop + Target work-loop of this event source instance. A subclass of +IOWorkLoop that at least reacts to signalWorkAvailable() and onThread functions. +*/ + virtual void setWorkLoop(IOWorkLoop *workLoop); + +/*! @function setNext + @abstract Set'ter for $link eventChainNext variable. + @param next + Pointer to another IOEventSource instance. +*/ + virtual void setNext(IOEventSource *next); + +/*! @function getNext + @abstract Get'ter for $link eventChainNext variable. + @result value of eventChainNext. +*/ + virtual IOEventSource *getNext() const; + + +protected: + // Methods to access the IOWorkLoop exported fields + void signalWorkAvailable(); + void openGate(); + void closeGate(); + bool tryCloseGate(); + int sleepGate(void *event, UInt32 type); + int sleepGate(void *event, AbsoluteTime deadline, UInt32 type); + void wakeupGate(void *event, bool oneThread); + +public: +/*! @function setAction + @abstract Set'ter for $link action variable. + @param action Pointer to a C function of type IOEventSource::Action. */ + virtual void setAction(IOEventSource::Action action); + +/*! @function getAction + @abstract Get'ter for $link action variable. + @result value of action. */ + virtual IOEventSource::Action getAction() const; + +/*! @function enable + @abstract Enable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. Calling this function will cause the +work-loop to be signalled so that a checkForWork is performed. */ + virtual void enable(); + +/*! @function disable + @abstract Disable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. */ + virtual void disable(); + +/*! @function isEnabled + @abstract Get'ter for $link enable variable. + @result true if enabled. */ + virtual bool isEnabled() const; + +/*! @function getWorkLoop + @abstract Get'ter for $link workLoop variable. + @result value of workLoop. */ + virtual IOWorkLoop *getWorkLoop() const; + +/*! @function onThread + @abstract Convenience function for workLoop->onThread. + @result true if called on the work-loop thread. +*/ + virtual bool onThread() const; + +private: + OSMetaClassDeclareReservedUnused(IOEventSource, 0); + OSMetaClassDeclareReservedUnused(IOEventSource, 1); + OSMetaClassDeclareReservedUnused(IOEventSource, 2); + OSMetaClassDeclareReservedUnused(IOEventSource, 3); + OSMetaClassDeclareReservedUnused(IOEventSource, 4); + OSMetaClassDeclareReservedUnused(IOEventSource, 5); + OSMetaClassDeclareReservedUnused(IOEventSource, 6); + OSMetaClassDeclareReservedUnused(IOEventSource, 7); +}; + +#endif /* !_IOKIT_IOEVENTSOURCE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOFilterInterruptEventSource.h.svn-base b/i386/include/IOKit/.svn/text-base/IOFilterInterruptEventSource.h.svn-base new file mode 100644 index 0000000..de05c90 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOFilterInterruptEventSource.h.svn-base @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + +HISTORY + 1999-4-15 Godfrey van der Linden(gvdl) + Created. +*/ +#ifndef _IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H +#define _IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H + +#include + +class IOService; + +/*! @class IOFilterInterruptEventSource : public IOInterruptEventSource + @abstract Filtering varient of the $link IOInterruptEventSource. + @discussion An interrupt event source that calls the client to determine if a interrupt event needs to be scheduled on the work loop. A filter interrupt event source call's the client in the primary interrupt context, the client can then interrogate its hardware and determine if the interrupt needs to be processed yet. +

+ As the routine is called in the primary interrupt context great care must be taken in the writing of this routine. In general none of the generic IOKit environment is safe to call in this context. We intend this routine to be used by hardware that can interrogate its registers without destroying state. Primarily this variant of event sources will be used by drivers that share interrupts. The filter routine will determine if the interrupt is a real interrupt or a ghost and thus optimise the work thread context switch away. +

+If you are implementing 'SoftDMA' (or pseudo-DMA), you may not want the I/O Kit to automatically start your interrupt handler routine on your work loop when your filter routine returns true. In this case, you may choose to have your filter routine schedule the work on the work loop itself and then return false. If you do this, the interrupt will not be disabled in hardware and you could receive additional primary interrupts before your work loop–level service routine completes. Because this scheme has implications for synchronization between your filter routine and your interrupt service routine, you should avoid doing this unless your driver requires SoftDMA. +

+CAUTION: Called in primary interrupt context, if you need to disable interrupt to guard you registers against an unexpected call then it is better to use a straight IOInterruptEventSource and its secondary interrupt delivery mechanism. +*/ +class IOFilterInterruptEventSource : public IOInterruptEventSource +{ + OSDeclareDefaultStructors(IOFilterInterruptEventSource) + +public: +/*! + @typedef Filter + @discussion C Function pointer to a routine to call when an interrupt occurs. + @param owner Pointer to the owning/client instance. + @param sender Where is the interrupt comming from. + @result false if this interrupt can be ignored. */ + typedef bool (*Filter)(OSObject *, IOFilterInterruptEventSource *); + +/*! @defined IOFilterInterruptAction + @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOFilterInterruptSource::Filter */ +#define IOFilterInterruptAction IOFilterInterruptEventSource::Filter + +private: + // Hide the superclass initializers + virtual bool init(OSObject *inOwner, + IOInterruptEventSource::Action inAction = 0, + IOService *inProvider = 0, + int inIntIndex = 0); + + static IOInterruptEventSource * + interruptEventSource(OSObject *inOwner, + IOInterruptEventSource::Action inAction = 0, + IOService *inProvider = 0, + int inIntIndex = 0); + +protected: +/*! @var filterAction Filter callout */ + Filter filterAction; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: +/*! @function filterInterruptEventSource + @abstract Factor method to create and initialise an IOFilterInterruptEventSource. See $link init. + @param owner Owner/client of this event source. + @param action 'C' Function to call when something happens. + @param filter 'C' Function to call when interrupt occurs. + @param provider Service that provides interrupts. + @param intIndex Defaults to 0. + @result a new event source if succesful, 0 otherwise. */ + static IOFilterInterruptEventSource * + filterInterruptEventSource(OSObject *owner, + IOInterruptEventSource::Action action, + Filter filter, + IOService *provider, + int intIndex = 0); + +/*! @function init + @abstract Primary initialiser for the IOFilterInterruptEventSource class. + @param owner Owner/client of this event source. + @param action 'C' Function to call when something happens. + @param filter 'C' Function to call in primary interrupt context. + @param provider Service that provides interrupts. + @param intIndex Interrupt source within provider. Defaults to 0. + @result true if the inherited classes and this instance initialise +successfully. */ + virtual bool init(OSObject *owner, + IOInterruptEventSource::Action action, + Filter filter, + IOService *provider, + int intIndex = 0); + + +/*! @function signalInterrupt + @abstract Cause the work loop to schedule the action. + @discussion Cause the work loop to schedule the interrupt action even if the filter routine returns 'false'. Note well the interrupting condition MUST be cleared from the hardware otherwise an infinite process interrupt loop will occur. Use this function when SoftDMA is desired. See $link IOFilterInterruptSource::Filter */ + virtual void signalInterrupt(); + +/*! @function getFilterAction + @abstract Get'ter for filterAction variable. + @result value of filterAction. */ + virtual Filter getFilterAction() const; + +/*! @function normalInterruptOccurred + @abstract Override $link IOInterruptEventSource::normalInterruptOccured to make a filter callout. */ + virtual void normalInterruptOccurred(void *self, IOService *prov, int ind); + +/*! @function disableInterruptOccurred + @abstract Override $link IOInterruptEventSource::disableInterruptOccurred to make a filter callout. */ + virtual void disableInterruptOccurred(void *self, IOService *prov, int ind); + +private: + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 0); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 1); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 2); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 3); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 4); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 5); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 6); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 7); +}; + +#endif /* !_IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOInterleavedMemoryDescriptor.h.svn-base b/i386/include/IOKit/.svn/text-base/IOInterleavedMemoryDescriptor.h.svn-base new file mode 100644 index 0000000..e5c2a94 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOInterleavedMemoryDescriptor.h.svn-base @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOINTERLEAVEDMEMORYDESCRIPTOR_H +#define _IOINTERLEAVEDMEMORYDESCRIPTOR_H + +#include + +/*! @class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor + @abstract The IOInterleavedMemoryDescriptor object describes a memory area made up of portions of several other IOMemoryDescriptors. + @discussion The IOInterleavedMemoryDescriptor object represents interleaved ranges of memory, specified as an ordered list of portions of individual IOMemoryDescriptors. The portions are chained end-to-end to make up a single contiguous buffer. */ + +class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOInterleavedMemoryDescriptor); + +protected: + + IOByteCount _descriptorCapacity; + UInt32 _descriptorCount; + IOMemoryDescriptor ** _descriptors; + IOByteCount * _descriptorOffsets; + IOByteCount * _descriptorLengths; + bool _descriptorPrepared; + + virtual void free(); + +public: + +/*! @function withCapacity + @abstract Create an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method creates and initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. + @param capacity The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor. + @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOInterleavedMemoryDescriptor * withCapacity( IOByteCount capacity, + IODirection direction); + +/*! @function initWithCapacity + @abstract Initialize an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. + @param capacity The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor. + @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + virtual bool initWithCapacity( IOByteCount capacity, + IODirection direction ); + +/*! @function clearMemoryDescriptors + @abstract Clear all of the IOMemoryDescriptors currently contained in and reset the IOInterleavedMemoryDescriptor. + @discussion Clears each IOMemoryDescriptor by completing (if needed) and releasing. The IOInterleavedMemoryDescriptor is then reset and may accept new descriptors up to the capacity specified when it was created. + @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. */ + + virtual void clearMemoryDescriptors( IODirection direction = kIODirectionNone ); + +/*! @function setMemoryDescriptor + @abstract Add a portion of an IOMemoryDescriptor to the IOInterleavedMemoryDescriptor. + @discussion This method adds the portion of an IOMemoryDescriptor described by the offset and length parameters to the end of the IOInterleavedMemoryDescriptor. A single IOMemoryDescriptor may be added as many times as there is room for it. The offset and length must describe a portion entirely within the IOMemoryDescriptor. + @param descriptor An IOMemoryDescriptor to be added to the IOInterleavedMemoryDescriptor. Its direction must be compatible with that of the IOInterleavedMemoryDescriptor. + @param offset The offset into the IOMemoryDescriptor of the portion that will be added to the virtualized buffer. + @param length The length of the portion of the IOMemoryDescriptor to be added to the virtualized buffer. + @result Returns true the portion was successfully added. */ + + virtual bool setMemoryDescriptor( IOMemoryDescriptor * descriptor, + IOByteCount offset, + IOByteCount length ); + +/*! @function getPhysicalSegment + @abstract Break a memory descriptor into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + @param offset A byte offset into the memory whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the memory. */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ); + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method need not called for non-pageable memory. + @param forDirection The direction of the I/O to be performed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + +/*! @function complete + @abstract Complete processing of the memory after an I/O transfer finishes. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); +}; + +#endif /* !_IOINTERLEAVEDMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOInterruptController.h.svn-base b/i386/include/IOKit/.svn/text-base/IOInterruptController.h.svn-base new file mode 100644 index 0000000..71f55e5 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOInterruptController.h.svn-base @@ -0,0 +1,155 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + + +#ifndef _IOKIT_IOINTERRUPTCONTROLLER_H +#define _IOKIT_IOINTERRUPTCONTROLLER_H + +#include +#include +#include + + +class IOSharedInterruptController; + +struct IOInterruptVector { + volatile char interruptActive; + volatile char interruptDisabledSoft; + volatile char interruptDisabledHard; + volatile char interruptRegistered; + IOLock * interruptLock; + IOService * nub; + int source; + void * target; + IOInterruptHandler handler; + void * refCon; + IOSharedInterruptController *sharedController; +}; + +typedef struct IOInterruptVector IOInterruptVector; + +#if __LP64__ +typedef int32_t IOInterruptVectorNumber; +#else +typedef long IOInterruptVectorNumber; +#endif + +class IOInterruptController : public IOService +{ + OSDeclareAbstractStructors(IOInterruptController); + +protected: + IOInterruptVector *vectors; + IOSimpleLock *controllerLock; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual IOReturn registerInterrupt(IOService *nub, int source, + void *target, + IOInterruptHandler handler, + void *refCon); + virtual IOReturn unregisterInterrupt(IOService *nub, int source); + + virtual IOReturn getInterruptType(IOService *nub, int source, + int *interruptType); + + virtual IOReturn enableInterrupt(IOService *nub, int source); + virtual IOReturn disableInterrupt(IOService *nub, int source); + virtual IOReturn causeInterrupt(IOService *nub, int source); + + virtual IOInterruptAction getInterruptHandlerAddress(void); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, + int source); + + // Methods to be overridden for simplifed interrupt controller subclasses. + + virtual bool vectorCanBeShared(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void initVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual int getVectorType(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void disableVectorHard(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void enableVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void causeVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + + OSMetaClassDeclareReservedUnused(IOInterruptController, 0); + OSMetaClassDeclareReservedUnused(IOInterruptController, 1); + OSMetaClassDeclareReservedUnused(IOInterruptController, 2); + OSMetaClassDeclareReservedUnused(IOInterruptController, 3); + OSMetaClassDeclareReservedUnused(IOInterruptController, 4); + OSMetaClassDeclareReservedUnused(IOInterruptController, 5); +}; + + +class IOSharedInterruptController : public IOInterruptController +{ + OSDeclareDefaultStructors(IOSharedInterruptController); + +private: + IOService *provider; + int numVectors; + int vectorsRegistered; + int vectorsEnabled; + volatile int controllerDisabled; + bool sourceIsLevel; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual IOReturn initInterruptController(IOInterruptController *parentController, OSData *parentSource); + + virtual IOReturn registerInterrupt(IOService *nub, int source, + void *target, + IOInterruptHandler handler, + void *refCon); + virtual IOReturn unregisterInterrupt(IOService *nub, int source); + + virtual IOReturn getInterruptType(IOService *nub, int source, + int *interruptType); + + virtual IOReturn enableInterrupt(IOService *nub, int source); + virtual IOReturn disableInterrupt(IOService *nub, int source); + + virtual IOInterruptAction getInterruptHandlerAddress(void); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, int source); + + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 0); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 1); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 2); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 3); +}; + + +#endif /* ! _IOKIT_IOINTERRUPTCONTROLLER_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOInterruptEventSource.h.svn-base b/i386/include/IOKit/.svn/text-base/IOInterruptEventSource.h.svn-base new file mode 100644 index 0000000..0be7caf --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOInterruptEventSource.h.svn-base @@ -0,0 +1,200 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + +HISTORY + 1998-7-13 Godfrey van der Linden(gvdl) + Created. + 1998-10-30 Godfrey van der Linden(gvdl) + Converted to C++ +*/ + +#ifndef _IOKIT_IOINTERRUPTEVENTSOURCE_H +#define _IOKIT_IOINTERRUPTEVENTSOURCE_H + +#include + +class IOService; + +/*! @class IOInterruptEventSource : public IOEventSource + @abstract Event source for interrupt delivery to work-loop based drivers. + @discussion The IOInterruptEventSource is a generic object that delivers calls interrupt routines in it's client in a guaranteed single-threaded manner. IOInterruptEventSource is part of the IOKit $link IOWorkLoop infrastructure where the semantic that one and only one action method is executing within a work-loops event chain. +

+When the action method is called in the client member function will receive 2 arguments, (IOEventSource *) sender and (int) count, See $link IOInterruptEventSource::Action. Where sender will be reference to the interrupt that occurred and the count will be computed by the difference between the $link producerCount and $link consumerCount. This number may not be reliable as no attempt is made to adjust for around the world type problems but is provided for general information and statistic gathering. +

+In general a client will use the factory member function to create and initialise the event source and then add it to their work-loop. It is the work loop's responsiblity to maintain the new event source in it's event chain. See $link IOWorkLoop. +

+An interrupt event source attaches itself to the given provider's interrupt source at initialisation time. At this time it determines if it is connected to a level or edge triggered interrupt. If the interrupt is an level triggered interrupt the event source automatically disables the interrupt source at primary interrupt time and after it call's the client it automatically reenables the interrupt. This action is fairly expensive but it is 100% safe and defaults sensibly so that the driver writer does not have to implement type dependant interrupt routines. So to repeat, the driver writer does not have to be concerned by the actual underlying interrupt mechanism as the event source hides the complexity. +

+Saying this if the hardware is a multi-device card, for instance a 4 port NIC, where all of the devices are sharing one level triggered interrupt AND it is possible to determine each port's interrupt state non-destructively then the $link IOFilterInterruptEventSource would be a better choice. +

+Warning: All IOInterruptEventSources are created in the disabled state. If you want to actually schedule interrupt delivery do not forget to enable the source. +*/ +class IOInterruptEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOInterruptEventSource) + +public: +/*! @typedef Action + @discussion 'C' pointer prototype of functions that are called in a single threaded context when an interrupt occurs. + @param owner Pointer to client instance. + @param sender Pointer to generation interrupt event source. + @param count Number of interrupts seen before delivery. */ + typedef void (*Action)(OSObject *, IOInterruptEventSource *, int count); + +/*! @defined IOInterruptEventAction + @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOInterruptEventSource::Action */ +#define IOInterruptEventAction IOInterruptEventSource::Action + +protected: +/*! @var provider IOService that provides interrupts for delivery. */ + IOService *provider; + +/*! @var intIndex */ + int intIndex; + +/*! @var producerCount + Current count of produced interrupts that have been received. */ + volatile unsigned int producerCount; + +/*! @var consumerCount + Current count of produced interrupts that the owner has been informed of. */ + unsigned int consumerCount; + +/*! @var autoDisable Do we need to automatically disable the interrupt source when we take an interrupt, i.e. we are level triggered. */ + bool autoDisable; + +/*! @var explicitDisable Has the user expicitly disabled this event source, if so then do not overide their request when returning from the callout */ + bool explicitDisable; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function free + @abstract Sub-class implementation of free method, disconnects from the interrupt source. */ + virtual void free(); + +/*! @function checkForWork + @abstract Pure Virtual member function used by IOWorkLoop for issueing a client calls. + @discussion This function called when the work-loop is ready to check for any work to do and then to call out the owner/action. + @result Return true if this function needs to be called again before all its outstanding events have been processed. */ + virtual bool checkForWork(); + +public: + +/*! @function interruptEventSource + @abstract Factory function for IOInterruptEventSources creation and initialisation. + @param owner Owning client of the new event source. + @param action 'C' Function to call when something happens. + @param provider IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + @param intIndex The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider. + @result A new interrupt event source if successfully created and initialised, 0 otherwise. */ + static IOInterruptEventSource * + interruptEventSource(OSObject *owner, + Action action, + IOService *provider = 0, + int intIndex = 0); + +/*! @function init + @abstract Primary initialiser for the IOInterruptEventSource class. + @param owner Owning client of the new event source. + @param action 'C' Function to call when something happens. + @param provider IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + @param intIndex The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider. + @result true if the inherited classes and this instance initialise +successfully. */ + virtual bool init(OSObject *owner, + Action action, + IOService *provider = 0, + int intIndex = 0); + +/*! @function enable + @abstract Enable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. Calling this function will cause the +work-loop to be signalled so that a checkForWork is performed. */ + virtual void enable(); + +/*! @function disable + @abstract Disable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. */ + virtual void disable(); + +/*! @function getProvider + @abstract Get'ter for $link provider variable. + @result value of provider. */ + virtual const IOService *getProvider() const; + +/*! @function getIntIndex + @abstract Get'ter for $link intIndex interrupt index variable. + @result value of intIndex. */ + virtual int getIntIndex() const; + +/*! @function getAutoDisable + @abstract Get'ter for $link autoDisable variable. + @result value of autoDisable. */ + virtual bool getAutoDisable() const; + +/*! @function interruptOccurred + @abstract Functions that get called by the interrupt controller. See $link IOService::registerInterrupt + @param nub Where did the interrupt originate from + @param ind What is this interrupts index within 'nub'. */ + virtual void interruptOccurred(void *, IOService *nub, int ind); + +/*! @function normalInterruptOccurred + @abstract Functions that get called by the interrupt controller.See $link IOService::registerInterrupt + @param nub Where did the interrupt originate from + @param ind What is this interrupts index within 'nub'. */ + virtual void normalInterruptOccurred(void *, IOService *nub, int ind); + +/*! @function disableInterruptOccurred + @abstract Functions that get called by the interrupt controller.See $link IOService::registerInterrupt + @param nub Where did the interrupt originate from + @param ind What is this interrupts index within 'nub'. */ + virtual void disableInterruptOccurred(void *, IOService *nub, int ind); + +private: + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 0); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 1); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 2); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 3); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 4); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 5); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 6); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 7); +}; + +#endif /* !_IOKIT_IOINTERRUPTEVENTSOURCE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOInterrupts.h.svn-base b/i386/include/IOKit/.svn/text-base/IOInterrupts.h.svn-base new file mode 100644 index 0000000..fa8aa7b --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOInterrupts.h.svn-base @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + + +#ifndef _IOKIT_IOINTERRUPTS_H +#define _IOKIT_IOINTERRUPTS_H + +#define kIOInterruptTypeEdge (0) +#define kIOInterruptTypeLevel (1) + +#ifdef __cplusplus + +class OSData; +class IOInterruptController; + +struct IOInterruptSource { + IOInterruptController *interruptController; + OSData *vectorData; +}; +typedef struct IOInterruptSource IOInterruptSource; + +#endif /* __cplusplus */ + +typedef void (*IOInterruptHandler)(void *target, void *refCon, + void *nub, int source); + +#endif /* ! _IOKIT_IOINTERRUPTS_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOKitDebug.h.svn-base b/i386/include/IOKit/.svn/text-base/IOKitDebug.h.svn-base new file mode 100644 index 0000000..499faa3 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOKitDebug.h.svn-base @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOKITDEBUG_H +#define _IOKIT_IOKITDEBUG_H + +#include + + +#ifdef __cplusplus + +#include +#include +#include + +class IOKitDiagnostics : public OSObject +{ + OSDeclareDefaultStructors(IOKitDiagnostics) + +public: + static OSObject * diagnostics( void ); + virtual bool serialize(OSSerialize *s) const; +private: + static void updateOffset( OSDictionary * dict, + UInt32 value, const char * name ); +}; + +#endif /* __cplusplus */ + +enum { + // loggage + kIOLogAttach = 0x00000001ULL, + kIOLogProbe = 0x00000002ULL, + kIOLogStart = 0x00000004ULL, + kIOLogRegister = 0x00000008ULL, + kIOLogMatch = 0x00000010ULL, + kIOLogConfig = 0x00000020ULL, + kIOLogYield = 0x00000040ULL, + kIOLogPower = 0x00000080ULL, + kIOLogMapping = 0x00000100ULL, + kIOLogCatalogue = 0x00000200ULL, + kIOLogTracePower = 0x00000400ULL, + kIOLogDebugPower = 0x00000800ULL, + kIOLogServiceTree = 0x00001000ULL, + kIOLogDTree = 0x00002000ULL, + kIOLogMemory = 0x00004000ULL, + kIOLogKextMemory = 0x00008000ULL, + kOSLogRegistryMods = 0x00010000ULL, // Log attempts to modify registry collections + kIOLogPMRootDomain = 0x00020000ULL, + kOSRegistryModsMode = 0x00040000ULL, // Change default registry modification handling - panic vs. log + kIOTraceIOService = 0x00080000ULL, + kIOLogHibernate = 0x00100000ULL, + + // debug aids - change behaviour + kIONoFreeObjects = 0x00100000ULL, + kIOLogSynchronous = 0x00200000ULL, // IOLog completes synchronously + kOSTraceObjectAlloc = 0x00400000ULL, + + _kIODebugTopFlag = 0x8000000000000000ULL // force enum to be 64 bits +}; + +extern SInt64 gIOKitDebug; + +#ifdef __cplusplus +extern "C" { +#endif + +struct IORegistryPlane; +extern void IOPrintPlane( const struct IORegistryPlane * plane ); +#ifndef _OSCPPDEBUG_H +extern void OSPrintMemory( void ); +#endif +#define IOPrintMemory OSPrintMemory + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* ! _IOKIT_IOKITDEBUG_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOKitKeys.h.svn-base b/i386/include/IOKit/.svn/text-base/IOKitKeys.h.svn-base new file mode 100644 index 0000000..62395d5 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOKitKeys.h.svn-base @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * Common symbol definitions for IOKit. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOKITKEYS_H +#define _IOKIT_IOKITKEYS_H + +// properties found in the registry root +#define kIOKitBuildVersionKey "IOKitBuildVersion" +#define kIOKitDiagnosticsKey "IOKitDiagnostics" + // a dictionary keyed by plane name +#define kIORegistryPlanesKey "IORegistryPlanes" +#define kIOCatalogueKey "IOCatalogue" + +// registry plane names +#define kIOServicePlane "IOService" +#define kIOPowerPlane "IOPower" +#define kIODeviceTreePlane "IODeviceTree" +#define kIOAudioPlane "IOAudio" +#define kIOFireWirePlane "IOFireWire" +#define kIOUSBPlane "IOUSB" + +// registry ID number +#define kIORegistryEntryIDKey "IORegistryEntryID" + +// IOService class name +#define kIOServiceClass "IOService" + +// IOResources class name +#define kIOResourcesClass "IOResources" + +// IOService driver probing property names +#define kIOClassKey "IOClass" +#define kIOProbeScoreKey "IOProbeScore" +#define kIOKitDebugKey "IOKitDebug" + +// IOService matching property names +#define kIOProviderClassKey "IOProviderClass" +#define kIONameMatchKey "IONameMatch" +#define kIOPropertyMatchKey "IOPropertyMatch" +#define kIOPathMatchKey "IOPathMatch" +#define kIOLocationMatchKey "IOLocationMatch" +#define kIOParentMatchKey "IOParentMatch" +#define kIOResourceMatchKey "IOResourceMatch" +#define kIOMatchedServiceCountKey "IOMatchedServiceCountMatch" + +#define kIONameMatchedKey "IONameMatched" + +#define kIOMatchCategoryKey "IOMatchCategory" +#define kIODefaultMatchCategoryKey "IODefaultMatchCategory" + +// IOService default user client class, for loadable user clients +#define kIOUserClientClassKey "IOUserClientClass" + +// key to find IOMappers +#define kIOMapperIDKey "IOMapperID" + +#define kIOUserClientCrossEndianKey "IOUserClientCrossEndian" +#define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible" +#define kIOUserClientSharedInstanceKey "IOUserClientSharedInstance" +// diagnostic string describing the creating task +#define kIOUserClientCreatorKey "IOUserClientCreator" + +// IOService notification types +#define kIOPublishNotification "IOServicePublish" +#define kIOFirstPublishNotification "IOServiceFirstPublish" +#define kIOMatchedNotification "IOServiceMatched" +#define kIOFirstMatchNotification "IOServiceFirstMatch" +#define kIOTerminatedNotification "IOServiceTerminate" + +// IOService interest notification types +#define kIOGeneralInterest "IOGeneralInterest" +#define kIOBusyInterest "IOBusyInterest" +#define kIOAppPowerStateInterest "IOAppPowerStateInterest" +#define kIOPriorityPowerStateInterest "IOPriorityPowerStateInterest" + +#define kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" + +// IOService interest notification types +#define kIOCFPlugInTypesKey "IOCFPlugInTypes" + +// properties found in services that implement command pooling +#define kIOCommandPoolSizeKey "IOCommandPoolSize" // (OSNumber) + +// properties found in services that have transfer constraints +#define kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" // (OSNumber) +#define kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" // (OSNumber) +#define kIOMaximumByteCountReadKey "IOMaximumByteCountRead" // (OSNumber) +#define kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" // (OSNumber) +#define kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" // (OSNumber) +#define kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" // (OSNumber) +#define kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" // (OSNumber) +#define kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" // (OSNumber) +#define kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" // (OSNumber) +#define kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount" // (OSNumber) + +// properties found in services that wish to describe an icon +// +// IOIcon = +// { +// CFBundleIdentifier = "com.example.driver.example"; +// IOBundleResourceFile = "example.icns"; +// }; +// +// where IOBundleResourceFile is the filename of the resource + +#define kIOIconKey "IOIcon" // (OSDictionary) +#define kIOBundleResourceFileKey "IOBundleResourceFile" // (OSString) + +#define kIOBusBadgeKey "IOBusBadge" // (OSDictionary) +#define kIODeviceIconKey "IODeviceIcon" // (OSDictionary) + +// property of root that describes the machine's serial number as a string +#define kIOPlatformSerialNumberKey "IOPlatformSerialNumber" // (OSString) + +// property of root that describes the machine's UUID as a string +#define kIOPlatformUUIDKey "IOPlatformUUID" // (OSString) + +// IODTNVRAM property keys +#define kIONVRAMDeletePropertyKey "IONVRAM-DELETE-PROPERTY" +#define kIODTNVRAMPanicInfoKey "aapl,panic-info" + +// keys for complex boot information +#define kIOBootDeviceKey "IOBootDevice" // dict | array of dicts +#define kIOBootDevicePathKey "IOBootDevicePath" // arch-neutral OSString +#define kIOBootDeviceSizeKey "IOBootDeviceSize" // OSNumber of bytes + +// keys for OS Version information +#define kOSBuildVersionKey "OS Build Version" + +#endif /* ! _IOKIT_IOKITKEYS_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOKitServer.h.svn-base b/i386/include/IOKit/.svn/text-base/IOKitServer.h.svn-base new file mode 100644 index 0000000..a68c992 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOKitServer.h.svn-base @@ -0,0 +1,123 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Internal definitions used between the iokit user library and + * server routines. + */ + +#ifndef _IOKIT_IOKITSERVER_H +#define _IOKIT_IOKITSERVER_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + +// IOMakeMatching +/*! + @enum IOMakeMatching + @constant kIOServiceMatching + @constant kIOBSDNameMatching + @constant kIOOFPathMatching +*/ +enum { + kIOServiceMatching = 100, + kIOBSDNameMatching = 101, + kIOOFPathMatching = 102 +}; + +// IOCatalogueSendData +/*! + @enum IOCatalogueSendData user-client flags. + @constant kIOCatalogAddDrivers Signals a call to the addDrivers function in IOCatalogue. + @constant kIOCatalogAddDriversNoMatch Signals a call to the addDrivers function in IOCatalogue but does not start a matching thread. + @constant kIOCatalogRemoveDrivers Signals a call to the removeDrivers function in IOCatalogue. + @constant kIOCatalogRemoveDriversNoMatch Signals a call to the removedrivers function in IOCatalogue but does not start a matching thread. + @constant kIOCatalogStartMatching Signals the IOCatalogue to start an IOService matching thread. +*/ +enum { + kIOCatalogAddDrivers = 1, + kIOCatalogAddDriversNoMatch, + kIOCatalogRemoveDrivers, + kIOCatalogRemoveDriversNoMatch, + kIOCatalogStartMatching, + kIOCatalogRemoveKernelLinker, + kIOCatalogKextdActive, + kIOCatalogKextdFinishedLaunching +}; + +// IOCatalogueGetData +/*! + @enum IOCatalogueGetData user-client flags + @constant kIOCatalogGetContents Returns a snapshot of the database to the caller. +*/ +enum { + kIOCatalogGetContents = 1, + kIOCatalogGetModuleDemandList = 2, + kIOCatalogGetCacheMissList = 3, + kIOCatalogGetROMMkextList = 4 +}; + +// IOCatalogueReset +/*! + @enum IOCatalogueReset user-client flag + @constant kIOCatalogResetDefault Removes all entries from IOCatalogue except those used for booting the system. +*/ +enum { + kIOCatalogResetDefault = 1 +}; + +// IOCatalogueTerminate +/*! + @enum IOCatalogueTerminate user-client flags. + @constant kIOCatalogModuleUnload Terminates all services which depend on a particular module and unloads the module. + @constant kIOCatalogModuleTerminate Terminates all services which depend on a particular module but does not unload the module. + @constant kIOCatalogServiceTerminate Terminates a particular service by name. +*/ +enum { + kIOCatalogModuleUnload = 1, + kIOCatalogModuleTerminate, + kIOCatalogServiceTerminate +}; + +#endif /* ! _IOKIT_IOKITSERVER_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IOLib.h.svn-base b/i386/include/IOKit/.svn/text-base/IOLib.h.svn-base new file mode 100644 index 0000000..1eb5562 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOLib.h.svn-base @@ -0,0 +1,83 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __IOKIT_IOLIB_H +#define __IOKIT_IOLIB_H + + +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +__BEGIN_DECLS + +#include +#include + +/* + * min/max macros. + */ + +#define min(a,b) ((a) < (b) ? (a) : (b)) +#define max(a,b) ((a) > (b) ? (a) : (b)) + +/* + * These are opaque to the user. + */ +typedef thread_t IOThread; +typedef void (*IOThreadFunc)(void *argument); + + +/* + * IORound and IOTrunc convenience functions, in the spirit + * of vm's round_page() and trunc_page(). + */ +#define IORound(value,multiple) \ + ((((value) + (multiple) - 1) / (multiple)) * (multiple)) + +#define IOTrunc(value,multiple) \ + (((value) / (multiple)) * (multiple)); + +__END_DECLS + +#endif /* !__IOKIT_IOLIB_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOLocks.h.svn-base b/i386/include/IOKit/.svn/text-base/IOLocks.h.svn-base new file mode 100644 index 0000000..81701a0 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOLocks.h.svn-base @@ -0,0 +1,409 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * + */ + +#ifndef __IOKIT_IOLOCKS_H +#define __IOKIT_IOLOCKS_H + + +#include + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/*! @var IOLockGroup + Global lock group used by all IOKit locks. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. +*/ +extern lck_grp_t *IOLockGroup; + + +/* + * Mutex lock operations + */ + +#ifdef IOLOCKS_INLINE +typedef lck_mtx_t IOLock; +#else +typedef struct _IOLock IOLock; +#endif /* IOLOCKS_INLINE */ + + +/*! @function IOLockAlloc + @abstract Allocates and initializes a mutex. + @discussion Allocates a mutex in general purpose memory, and initializes it. Mutexes are general purpose blocking mutual exclusion locks, supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IOLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IOLock * IOLockAlloc( void ); + +/*! @function IOLockFree + @abstract Frees a mutex. + @discussion Frees a lock allocated with IOLockAlloc. Any blocked waiters will not be woken. + @param lock Pointer to the allocated lock. */ + +void IOLockFree( IOLock * lock); + +/*! @function IOLockGetMachLock + @abstract Accessor to a Mach mutex. + @discussion Accessor to the Mach mutex. + @param lock Pointer to the allocated lock. */ + +lck_mtx_t * IOLockGetMachLock( IOLock * lock); + +/*! @function IOLockLock + @abstract Lock a mutex. + @discussion Lock the mutex. If the lock is held by any thread, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the mutex recursively from one thread will result in deadlock. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IOLockLock(l) lck_mtx_lock(l) +#else +void IOLockLock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockTryLock + @abstract Attempt to lock a mutex. + @discussion Lock the mutex if it is currently unlocked, and return true. If the lock is held by any thread, return false. + @param lock Pointer to the allocated lock. + @result True if the mutex was unlocked and is now locked by the caller, otherwise false. */ + +#ifdef IOLOCKS_INLINE +#define IOLockTryLock(l) lck_mtx_try_lock(l) +#else +boolean_t IOLockTryLock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockUnlock + @abstract Unlock a mutex. +@discussion Unlock the mutex and wake any blocked waiters. Results are undefined if the caller has not locked the mutex. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IOLockUnlock(l) lck_mtx_unlock(l) +#else +#if defined(__i386__) +void IOLockUnlock( IOLock * lock) __DARWIN10_ALIAS(IOLockUnlock); +#else /* !__i386__ */ +void IOLockUnlock( IOLock * lock); +#endif /* __i386__ */ +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockSleep + @abstract Sleep with mutex unlock and relock +@discussion Prepare to sleep,unlock the mutex, and re-acquire it on wakeup. Results are undefined if the caller has not locked the mutex. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the locked lock. + @param event The event to sleep on. + @param interType How can the sleep be interrupted. + @result The wait-result value indicating how the thread was awakened.*/ +int IOLockSleep( IOLock * lock, void *event, UInt32 interType); + +int IOLockSleepDeadline( IOLock * lock, void *event, + AbsoluteTime deadline, UInt32 interType); + +void IOLockWakeup(IOLock * lock, void *event, bool oneThread); + +#ifdef __APPLE_API_OBSOLETE + +/* The following API is deprecated */ + +typedef enum { + kIOLockStateUnlocked = 0, + kIOLockStateLocked = 1 +} IOLockState; + +void IOLockInitWithState( IOLock * lock, IOLockState state); +#define IOLockInit( l ) IOLockInitWithState( l, kIOLockStateUnlocked); + +static __inline__ void IOTakeLock( IOLock * lock) { IOLockLock(lock); } +static __inline__ boolean_t IOTryLock( IOLock * lock) { return(IOLockTryLock(lock)); } +static __inline__ void IOUnlock( IOLock * lock) { IOLockUnlock(lock); } + +#endif /* __APPLE_API_OBSOLETE */ + +/* + * Recursive lock operations + */ + +typedef struct _IORecursiveLock IORecursiveLock; + +/*! @function IORecursiveLockAlloc + @abstract Allocates and initializes an recursive lock. + @discussion Allocates a recursive lock in general purpose memory, and initializes it. Recursive locks function identically to mutexes but allow one thread to lock more than once, with balanced unlocks. IORecursiveLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IORecursiveLock * IORecursiveLockAlloc( void ); + +/*! @function IORecursiveLockFree + @abstract Frees a recursive lock. + @discussion Frees a lock allocated with IORecursiveLockAlloc. Any blocked waiters will not be woken. + @param lock Pointer to the allocated lock. */ + +void IORecursiveLockFree( IORecursiveLock * lock); + +/*! @function IORecursiveLockGetMachLock + @abstract Accessor to a Mach mutex. + @discussion Accessor to the Mach mutex. + @param lock Pointer to the allocated lock. */ + +lck_mtx_t * IORecursiveLockGetMachLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockLock + @abstract Lock a recursive lock. + @discussion Lock the recursive lock. If the lock is held by another thread, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. The lock may be taken recursively by the same thread, with a balanced number of calls to IORecursiveLockUnlock. + @param lock Pointer to the allocated lock. */ + +void IORecursiveLockLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockTryLock + @abstract Attempt to lock a recursive lock. + @discussion Lock the lock if it is currently unlocked, or held by the calling thread, and return true. If the lock is held by another thread, return false. Successful calls to IORecursiveLockTryLock should be balanced with calls to IORecursiveLockUnlock. + @param lock Pointer to the allocated lock. + @result True if the lock is now locked by the caller, otherwise false. */ + +boolean_t IORecursiveLockTryLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockUnlock + @abstract Unlock a recursive lock. +@discussion Undo one call to IORecursiveLockLock, if the lock is now unlocked wake any blocked waiters. Results are undefined if the caller does not balance calls to IORecursiveLockLock with IORecursiveLockUnlock. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the allocated lock. */ + +void IORecursiveLockUnlock( IORecursiveLock * lock); + +/*! @function IORecursiveLockHaveLock + @abstract Check if a recursive lock is held by the calling thread. + @discussion If the lock is held by the calling thread, return true, otherwise the lock is unlocked, or held by another thread and false is returned. + @param lock Pointer to the allocated lock. + @result True if the calling thread holds the lock otherwise false. */ + +boolean_t IORecursiveLockHaveLock( const IORecursiveLock * lock); + +extern int IORecursiveLockSleep( IORecursiveLock *_lock, + void *event, UInt32 interType); +extern int IORecursiveLockSleepDeadline( IORecursiveLock * _lock, void *event, + AbsoluteTime deadline, UInt32 interType); +extern void IORecursiveLockWakeup( IORecursiveLock *_lock, + void *event, bool oneThread); + +/* + * Complex (read/write) lock operations + */ + +#ifdef IOLOCKS_INLINE +typedef lck_rw_t IORWLock; +#else +typedef struct _IORWLock IORWLock; +#endif /* IOLOCKS_INLINE */ + +/*! @function IORWLockAlloc + @abstract Allocates and initializes a read/write lock. + @discussion Allocates and initializes a read/write lock in general purpose memory. Read/write locks provide for multiple readers, one exclusive writer, and are supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IORWLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IORWLock * IORWLockAlloc( void ); + +/*! @function IORWLockFree + @abstract Frees a read/write lock. + @discussion Frees a lock allocated with IORWLockAlloc. Any blocked waiters will not be woken. + @param lock Pointer to the allocated lock. */ + +void IORWLockFree( IORWLock * lock); + +/*! @function IORWLockGetMachLock + @abstract Accessor to a Mach read/write lock. + @discussion Accessor to the Mach read/write lock. + @param lock Pointer to the allocated lock. */ + +lck_rw_t * IORWLockGetMachLock( IORWLock * lock); + +/*! @function IORWLockRead + @abstract Lock a read/write lock for read. +@discussion Lock the lock for read, allowing multiple readers when there are no writers. If the lock is held for write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockRead(l) lck_rw_lock_shared(l) +#else +void IORWLockRead(IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IORWLockWrite + @abstract Lock a read/write lock for write. + @discussion Lock the lock for write, allowing one writer exlusive access. If the lock is held for read or write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockWrite(l) lck_rw_lock_exclusive(l) +#else +void IORWLockWrite( IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IORWLockUnlock + @abstract Unlock a read/write lock. + @discussion Undo one call to IORWLockRead or IORWLockWrite. Results are undefined if the caller has not locked the lock. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockUnlock(l) lck_rw_done(l) +#else +void IORWLockUnlock( IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + + +#ifdef __APPLE_API_OBSOLETE + +/* The following API is deprecated */ + +static __inline__ void IOReadLock( IORWLock * lock) { IORWLockRead(lock); } +static __inline__ void IOWriteLock( IORWLock * lock) { IORWLockWrite(lock); } +static __inline__ void IORWUnlock( IORWLock * lock) { IORWLockUnlock(lock); } + +#endif /* __APPLE_API_OBSOLETE */ + + +/* + * Simple locks. Cannot block while holding a simple lock. + */ + +#ifdef IOLOCKS_INLINE +typedef lck_spin_t IOSimpleLock; +#else +typedef struct _IOSimpleLock IOSimpleLock; +#endif /* IOLOCKS_INLINE */ + +/*! @function IOSimpleLockAlloc + @abstract Allocates and initializes a spin lock. + @discussion Allocates and initializes a spin lock in general purpose memory. Spin locks provide non-blocking mutual exclusion for synchronization between thread context and interrupt context, or for multiprocessor synchronization, and are supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IOSimpleLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IOSimpleLock * IOSimpleLockAlloc( void ); + +/*! @function IOSimpleLockFree + @abstract Frees a spin lock. + @discussion Frees a lock allocated with IOSimpleLockAlloc. + @param lock Pointer to the lock. */ + +void IOSimpleLockFree( IOSimpleLock * lock ); + +/*! @function IOSimpleLockGetMachLock + @abstract Accessor to a Mach spin lock. + @discussion Accessor to the Mach spin lock. + @param lock Pointer to the allocated lock. */ + +lck_spin_t * IOSimpleLockGetMachLock( IOSimpleLock * lock); + +/*! @function IOSimpleLockInit + @abstract Initialize a spin lock. + @discussion Initialize an embedded spin lock, to the unlocked state. + @param lock Pointer to the lock. */ + +void IOSimpleLockInit( IOSimpleLock * lock ); + +/*! @function IOSimpleLockLock + @abstract Lock a spin lock. +@discussion Lock the spin lock. If the lock is held, spin waiting for its unlock. Spin locks disable preemption, cannot be held across any blocking operation, and should be held for very short periods. When used to synchronize between interrupt context and thread context they should be locked with interrupts disabled - IOSimpleLockLockDisableInterrupt() will do both. Locking the lock recursively from one thread will result in deadlock. + @param lock Pointer to the lock. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockLock(l) lck_spin_lock(l) +#else +void IOSimpleLockLock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + + +/*! @function IOSimpleLockTryLock + @abstract Attempt to lock a spin lock. +@discussion Lock the spin lock if it is currently unlocked, and return true. If the lock is held, return false. Successful calls to IOSimpleLockTryLock should be balanced with calls to IOSimpleLockUnlock. + @param lock Pointer to the lock. + @result True if the lock was unlocked and is now locked by the caller, otherwise false. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockTryLock(l) lck_spin_try_lock(l) +#else +boolean_t IOSimpleLockTryLock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOSimpleLockUnlock + @abstract Unlock a spin lock. + @discussion Unlock the lock, and restore preemption. Results are undefined if the caller has not locked the lock. + @param lock Pointer to the lock. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockUnlock(l) lck_spin_unlock(l) +#else +void IOSimpleLockUnlock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + +#if __LP64__ +typedef boolean_t IOInterruptState; +#else +typedef long int IOInterruptState; +#endif + +/*! @function IOSimpleLockLockDisableInterrupt + @abstract Lock a spin lock. + @discussion Lock the spin lock. If the lock is held, spin waiting for its unlock. Simple locks disable preemption, cannot be held across any blocking operation, and should be held for very short periods. When used to synchronize between interrupt context and thread context they should be locked with interrupts disabled - IOSimpleLockLockDisableInterrupt() will do both. Locking the lock recursively from one thread will result in deadlock. + @param lock Pointer to the lock. */ + +static __inline__ +IOInterruptState IOSimpleLockLockDisableInterrupt( IOSimpleLock * lock ) +{ + IOInterruptState state = ml_set_interrupts_enabled( false ); + IOSimpleLockLock( lock ); + return( state ); +} + +/*! @function IOSimpleLockUnlockEnableInterrupt + @abstract Unlock a spin lock, and restore interrupt state. + @discussion Unlock the lock, and restore preemption and interrupts to the state as they were when the lock was taken. Results are undefined if the caller has not locked the lock. + @param lock Pointer to the lock. + @param state The interrupt state returned by IOSimpleLockLockDisableInterrupt() */ + +static __inline__ +void IOSimpleLockUnlockEnableInterrupt( IOSimpleLock * lock, + IOInterruptState state ) +{ + IOSimpleLockUnlock( lock ); + ml_set_interrupts_enabled( state ); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__IOKIT_IOLOCKS_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IOMapper.h.svn-base b/i386/include/IOKit/.svn/text-base/IOMapper.h.svn-base new file mode 100644 index 0000000..d877974 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOMapper.h.svn-base @@ -0,0 +1,154 @@ +/* + * Copyright (c) 1998-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMAPPER_H +#define __IOKIT_IOMAPPER_H + +#include + +__BEGIN_DECLS +#include +#include + +// These are C accessors to the system mapper for non-IOKit clients +ppnum_t IOMapperIOVMAlloc(unsigned pages); +void IOMapperIOVMFree(ppnum_t addr, unsigned pages); + +ppnum_t IOMapperInsertPage(ppnum_t addr, unsigned offset, ppnum_t page); +void IOMapperInsertPPNPages(ppnum_t addr, unsigned offset, + ppnum_t *pageList, unsigned pageCount); +void IOMapperInsertUPLPages(ppnum_t addr, unsigned offset, + upl_page_info_t *pageList, unsigned pageCount); + +mach_vm_address_t IOMallocPhysical(mach_vm_size_t size, mach_vm_address_t mask); + +void IOFreePhysical(mach_vm_address_t address, mach_vm_size_t size); + +__END_DECLS + +#if __cplusplus + +#include +#include + +class OSData; +class IODMACommand; + +extern const OSSymbol * gIOMapperIDKey; + +class IOMapper : public IOService +{ + OSDeclareAbstractStructors(IOMapper); + + // Give the platform expert access to setMapperRequired(); + friend class IOPlatformExpert; + +private: + enum SystemMapperState { + kNoMapper = 0, + kUnknown = 1, + kHasMapper = 2, // Any other value is pointer to a live mapper + kWaitMask = 3, + }; +protected: + void *fTable; + ppnum_t fTablePhys; + IOItemCount fTableSize; + OSData *fTableHandle; + bool fIsSystem; + + + static void setMapperRequired(bool hasMapper); + static void waitForSystemMapper(); + + virtual bool initHardware(IOService *provider) = 0; + + virtual bool allocTable(IOByteCount size); + +public: + virtual bool start(IOService *provider); + virtual void free(); + + // Static routines capable of allocating tables that are physically + // contiguous in real memory space. + static OSData * NewARTTable(IOByteCount size, + void ** virtAddrP, ppnum_t *physAddrP); + static void FreeARTTable(OSData *handle, IOByteCount size); + + + // To get access to the system mapper IOMapper::gSystem + static IOMapper *gSystem; + + virtual ppnum_t iovmAlloc(IOItemCount pages) = 0; + virtual void iovmFree(ppnum_t addr, IOItemCount pages) = 0; + + virtual void iovmInsert(ppnum_t addr, IOItemCount offset, ppnum_t page) = 0; + virtual void iovmInsert(ppnum_t addr, IOItemCount offset, + ppnum_t *pageList, IOItemCount pageCount); + virtual void iovmInsert(ppnum_t addr, IOItemCount offset, + upl_page_info_t *pageList, IOItemCount pageCount); + + static void checkForSystemMapper() + { if ((uintptr_t) gSystem & kWaitMask) waitForSystemMapper(); }; + + static IOMapper * copyMapperForDevice(IOService * device); + + + // Function will panic if the given address is not found in a valid + // iovm mapping. + virtual addr64_t mapAddr(IOPhysicalAddress addr) = 0; + + // Get the address mask to or into an address to bypass this mapper + virtual bool getBypassMask(addr64_t *maskP) const; + + virtual ppnum_t iovmAllocDMACommand(IODMACommand * command, IOItemCount pageCount); + virtual void iovmFreeDMACommand(IODMACommand * command, ppnum_t addr, IOItemCount pageCount); + + OSMetaClassDeclareReservedUsed(IOMapper, 0); + OSMetaClassDeclareReservedUsed(IOMapper, 1); + OSMetaClassDeclareReservedUsed(IOMapper, 2); + +private: + OSMetaClassDeclareReservedUnused(IOMapper, 3); + OSMetaClassDeclareReservedUnused(IOMapper, 4); + OSMetaClassDeclareReservedUnused(IOMapper, 5); + OSMetaClassDeclareReservedUnused(IOMapper, 6); + OSMetaClassDeclareReservedUnused(IOMapper, 7); + OSMetaClassDeclareReservedUnused(IOMapper, 8); + OSMetaClassDeclareReservedUnused(IOMapper, 9); + OSMetaClassDeclareReservedUnused(IOMapper, 10); + OSMetaClassDeclareReservedUnused(IOMapper, 11); + OSMetaClassDeclareReservedUnused(IOMapper, 12); + OSMetaClassDeclareReservedUnused(IOMapper, 13); + OSMetaClassDeclareReservedUnused(IOMapper, 14); + OSMetaClassDeclareReservedUnused(IOMapper, 15); +}; + +#endif /* __cplusplus */ + +#endif /* !__IOKIT_IOMAPPER_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOMemoryCursor.h.svn-base b/i386/include/IOKit/.svn/text-base/IOMemoryCursor.h.svn-base new file mode 100644 index 0000000..dfe9eed --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOMemoryCursor.h.svn-base @@ -0,0 +1,462 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOMEMORYCURSOR_H +#define _IOMEMORYCURSOR_H + +#include +#include + +class IOMemoryDescriptor; + +/**************************** class IOMemoryCursor ***************************/ + +/*! + @class IOMemoryCursor + @abstract A mechanism to convert memory references to physical addresses. + @discussion The IOMemoryCursor declares the super class that all +specific memory cursors must inherit from, but a memory cursor can be created without a specific format subclass by just providing a segment function to the initializers. This class does the difficult stuff of dividing a memory descriptor into a physical scatter/gather list appropriate for the target hardware. +

+ A driver is expected to create a memory cursor and configure it to the limitations of its DMA hardware; for instance the memory cursor used by the FireWire SBP-2 protocol has a maximum physical segment size of 2^16 - 1 but the actual transfer size is unlimited. Thus it would create a cursor with a maxSegmentSize of 65535 and a maxTransfer size of UINT_MAX. It would also provide a SegmentFunction that can output a pagelist entry. +

+Below is the simplest example of a SegmentFunction:
+void IONaturalMemoryCursor::outputSegment(PhysicalSegment segment,
+ void * outSegments,
+ UInt32 outSegmentIndex)
+{
+ ((PhysicalSegment *) outSegments)[outSegmentIndex] = segment;
+} + +*/ +class IOMemoryCursor : public OSObject +{ + OSDeclareDefaultStructors(IOMemoryCursor) + +public: +/*! + @typedef PhysicalSegment + @discussion A physical address/length pair. +*/ + struct PhysicalSegment + { + IOPhysicalAddress location; + IOPhysicalLength length; + }; + +/*! @defined IOPhysicalSegment + @discussion Backward compatibility define for the old non-class scoped type definition. See IOMemoryCursor::PhysicalSegment +*/ +#define IOPhysicalSegment IOMemoryCursor::PhysicalSegment + +/*! + @typedef SegmentFunction + @discussion Pointer to a C function that outputs a single physical segment to an element in the array as defined by the segments and segmentIndex parameters. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + typedef void (*SegmentFunction)(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined OutputSegmentFunc + @discussion Backward compatibility define for the old non-class scoped type definition. See IOMemoryCursor::SegmentFunction */ +#define OutputSegmentFunc IOMemoryCursor::SegmentFunction + +protected: +/*! @var outSeg The action method called when an event has been delivered */ + SegmentFunction outSeg; + +/*! @var maxSegmentSize Maximum size of one segment in a scatter/gather list */ + IOPhysicalLength maxSegmentSize; + +/*! @var maxTransferSize + Maximum size of a transfer that this memory cursor is allowed to generate */ + IOPhysicalLength maxTransferSize; + +/*! @var alignMask + Currently unused. Reserved for automated aligment restriction code. */ + IOPhysicalLength alignMask; + +public: +/*! @function withSpecification + @abstract Creates and initializes an IOMemoryCursor in one operation. + @discussion Factory function to create and initialize an IOMemoryCursor in one operation. For more information, see IOMemoryCursor::initWithSpecification. + @param outSegFunc SegmentFunction to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IOMemoryCursor * + withSpecification(SegmentFunction outSegFunc, + IOPhysicalLength maxSegmentSize = 0, + IOPhysicalLength maxTransferSize = 0, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IOMemoryCursor class. + @param outSegFunc SegmentFunction to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize +successfully. +*/ + virtual bool initWithSpecification(SegmentFunction outSegFunc, + IOPhysicalLength maxSegmentSize = 0, + IOPhysicalLength maxTransferSize = 0, + IOPhysicalLength alignment = 1); + +/*! @function genPhysicalSegments + @abstract Generates a physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction without interpretation by the cursor. + @param maxSegments Maximum number of segments that can be written to segments array. + @param maxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 genPhysicalSegments( + IOMemoryDescriptor *descriptor, + IOByteCount fromPosition, + void * segments, + UInt32 maxSegments, + UInt32 maxTransferSize = 0, + IOByteCount *transferSize = 0); +}; + +/************************ class IONaturalMemoryCursor ************************/ + + +/*! + @class IONaturalMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the natural byte orientation for the CPU. + @discussion The IONaturalMemoryCursor would be used when it is too difficult to safely describe a SegmentFunction that is more appropriate for your hardware. This cursor just outputs an array of PhysicalSegments. +*/ +class IONaturalMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IONaturalMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outputs the given segment into the output segments array in natural byte order. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined naturalOutputSegment + @discussion Backward compatibility define for the old global function definition. See IONaturalMemoryCursor::outputSegment. +*/ +#define naturalOutputSegment IONaturalMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IONaturalMemoryCursor in one operation. + @discussion Factory function to create and initialize an IONaturalMemoryCursor in one operation. For more information, see IONaturalMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IONaturalMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IONaturalMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a CPU natural physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + @param maxSegments Maximum number of segments that can be written to segments array. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor *descriptor, + IOByteCount fromPosition, + PhysicalSegment *segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount *transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************** class IOBigMemoryCursor **************************/ + +/*! + @class IOBigMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the big endian byte order. + @discussion The IOBigMemoryCursor would be used when the DMA hardware requires a big endian address and length pair. This cursor outputs an array of PhysicalSegments that are encoded in big-endian format. +*/ +class IOBigMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOBigMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outputs the given segment into the output segments array in big endian byte order. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined bigOutputSegment + @discussion Backward compatibility define for the old global function definition. See IOBigMemoryCursor::outputSegment +*/ +#define bigOutputSegment IOBigMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IOBigMemoryCursor in one operation. + @discussion Factory function to create and initialize an IOBigMemoryCursor in one operation. See also IOBigMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IOBigMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IOBigMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize +successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a big endian physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + @param maxSegments Maximum number of segments that can be written to segments array. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + PhysicalSegment * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************* class IOLittleMemoryCursor ************************/ + +/*! + @class IOLittleMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the little endian byte order. + @discussion The IOLittleMemoryCursor would be used when the DMA hardware requires a little endian address and length pair. This cursor outputs an array of PhysicalSegments that are encoded in little endian format. +*/ +class IOLittleMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOLittleMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outputs the given segment into the output segments array in little endian byte order. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined littleOutputSegment + @discussion Backward compatibility define for the old global function definition. See also IOLittleMemoryCursor::outputSegment. */ +#define littleOutputSegment IOLittleMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IOLittleMemoryCursor in one operation. + @discussion Factory function to create and initialize an IOLittleMemoryCursor in one operation. See also IOLittleMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IOLittleMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IOLittleMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a little endian physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + @param maxSegments Maximum number of segments that can be written to segments array. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + PhysicalSegment * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************* class IODBDMAMemoryCursor *************************/ + +#if defined(__ppc__) + +struct IODBDMADescriptor; + +/*! + @class IODBDMAMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of DBDMA descriptors where the address and length are filled in. + @discussion The IODBDMAMemoryCursor would be used when the DBDMA hardware is available for the device for that will use an instance of this cursor. +*/ +class IODBDMAMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IODBDMAMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outpust the given segment into the output segments array in address and length fields of an DBDMA descriptor. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined dbdmaOutputSegment + @discussion Backward compatibility define for the old global function definition. See IODBDMAMemoryCursor::outputSegment. */ +#define dbdmaOutputSegment IODBDMAMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IODBDMAMemoryCursor in one operation. + @discussion Factory function to create and initialize an IODBDMAMemoryCursor in one operation. See also IODBDMAMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IODBDMAMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IODBDMAMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a DBDMA physical scatter/gather list given a memory descriptor. + @discussion Generates a list of DBDMA descriptors where the address and length fields are filled in appropriately. But the client is expected to fill in the rest of the DBDMA descriptor as is appropriate for their particular hardware. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of DBDMA descriptors for the output physical scatter/gather list. Be warned no room is left for a preamble in the output array. 'segments' should point to the first memory description slot in a DBDMA command. + @param maxSegments Maximum number of segments that can be written to the DBDMA descriptor table. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + IODBDMADescriptor * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +#endif /* defined(__ppc__) */ + +#endif /* !_IOMEMORYCURSOR_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IOMemoryDescriptor.h.svn-base b/i386/include/IOKit/.svn/text-base/IOMemoryDescriptor.h.svn-base new file mode 100644 index 0000000..d60d864 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOMemoryDescriptor.h.svn-base @@ -0,0 +1,898 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOMEMORYDESCRIPTOR_H +#define _IOMEMORYDESCRIPTOR_H + +#include + +#include +#include +#include + +#include + +class IOMemoryMap; +class IOMapper; + +/* + * Direction of transfer, with respect to the described memory. + */ +#ifdef __LP64__ +enum +#else /* !__LP64__ */ +enum IODirection +#endif /* !__LP64__ */ +{ + kIODirectionNone = 0x0, // same as VM_PROT_NONE + kIODirectionIn = 0x1, // User land 'read', same as VM_PROT_READ + kIODirectionOut = 0x2, // User land 'write', same as VM_PROT_WRITE + kIODirectionOutIn = kIODirectionOut | kIODirectionIn, + kIODirectionInOut = kIODirectionIn | kIODirectionOut +}; +#ifdef __LP64__ +typedef IOOptionBits IODirection; +#endif /* __LP64__ */ + +/* + * IOOptionBits used in the withOptions variant + */ +enum { + kIOMemoryDirectionMask = 0x00000007, + + kIOMemoryTypeVirtual = 0x00000010, + kIOMemoryTypePhysical = 0x00000020, + kIOMemoryTypeUPL = 0x00000030, + kIOMemoryTypePersistentMD = 0x00000040, // Persistent Memory Descriptor + kIOMemoryTypeUIO = 0x00000050, +#ifdef __LP64__ + kIOMemoryTypeVirtual64 = kIOMemoryTypeVirtual, + kIOMemoryTypePhysical64 = kIOMemoryTypePhysical, +#else /* !__LP64__ */ + kIOMemoryTypeVirtual64 = 0x00000060, + kIOMemoryTypePhysical64 = 0x00000070, +#endif /* !__LP64__ */ + kIOMemoryTypeMask = 0x000000f0, + + kIOMemoryAsReference = 0x00000100, + kIOMemoryBufferPageable = 0x00000400, + kIOMemoryMapperNone = 0x00000800, + kIOMemoryPersistent = 0x00010000, + kIOMemoryThreadSafe = 0x00100000, // Shared with Buffer MD +}; + +#define kIOMapperSystem ((IOMapper *) 0) + +enum +{ + kIOMemoryPurgeableKeepCurrent = 1, + kIOMemoryPurgeableNonVolatile = 2, + kIOMemoryPurgeableVolatile = 3, + kIOMemoryPurgeableEmpty = 4 +}; +enum +{ + kIOMemoryIncoherentIOFlush = 1, + kIOMemoryIncoherentIOStore = 2, +}; + +#define IOMEMORYDESCRIPTOR_SUPPORTS_DMACOMMAND 1 + +enum +{ + kIOPreparationIDUnprepared = 0, + kIOPreparationIDUnsupported = 1, + kIOPreparationIDAlwaysPrepared = 2, +}; + +/*! @class IOMemoryDescriptor : public OSObject + @abstract An abstract base class defining common methods for describing physical or virtual memory. + @discussion The IOMemoryDescriptor object represents a buffer or range of memory, specified as one or more physical or virtual address ranges. It contains methods to return the memory's physically contiguous segments (fragments), for use with the IOMemoryCursor, and methods to map the memory into any address space with caching and placed mapping options. */ + +class IOMemoryDescriptor : public OSObject +{ + friend class IOMemoryMap; + + OSDeclareDefaultStructors(IOMemoryDescriptor); + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { + void * devicePager; + unsigned int pagerContig:1; + unsigned int unused:31; + IOMemoryDescriptor * memory; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +protected: + OSSet * _mappings; + IOOptionBits _flags; + void * _memEntry; + +#ifdef __LP64__ + uint64_t __iomd_reserved1; + uint64_t __iomd_reserved2; + uint64_t __iomd_reserved3; + uint64_t __iomd_reserved4; +#else /* !__LP64__ */ + IODirection _direction; /* use _flags instead */ +#endif /* !__LP64__ */ + IOByteCount _length; /* length of all ranges */ + IOOptionBits _tag; + +public: +typedef IOOptionBits DMACommandOps; +#ifndef __LP64__ + virtual IOPhysicalAddress getSourceSegment( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + +/*! @function initWithOptions + @abstract Master initialiser for all variants of memory descriptors. For a more complete description see IOMemoryDescriptor::withOptions. + @discussion Note this function can be used to re-init a previously created memory descriptor. + @result true on success, false on failure. */ + virtual bool initWithOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + virtual addr64_t getPhysicalSegment64( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; /* use getPhysicalSegment() and kIOMemoryMapperNone instead */ +#endif /* !__LP64__ */ + +/*! @function setPurgeable + @abstract Control the purgeable status of a memory descriptors memory. + @discussion Buffers may be allocated with the ability to have their purgeable status changed - IOBufferMemoryDescriptor with the kIOMemoryPurgeable option, VM_FLAGS_PURGEABLE may be passed to vm_allocate() in user space to allocate such buffers. The purgeable status of such a buffer may be controlled with setPurgeable(). The process of making a purgeable memory descriptor non-volatile and determining its previous state is atomic - if a purgeable memory descriptor is made nonvolatile and the old state is returned as kIOMemoryPurgeableVolatile, then the memory's previous contents are completely intact and will remain so until the memory is made volatile again. If the old state is returned as kIOMemoryPurgeableEmpty then the memory was reclaimed while it was in a volatile state and its previous contents have been lost. + @param newState - the desired new purgeable state of the memory:
+ kIOMemoryPurgeableKeepCurrent - make no changes to the memory's purgeable state.
+ kIOMemoryPurgeableVolatile - make the memory volatile - the memory may be reclaimed by the VM system without saving its contents to backing store.
+ kIOMemoryPurgeableNonVolatile - make the memory nonvolatile - the memory is treated as with usual allocations and must be saved to backing store if paged.
+ kIOMemoryPurgeableEmpty - make the memory volatile, and discard any pages allocated to it. + @param oldState - if non-NULL, the previous purgeable state of the memory is returned here:
+ kIOMemoryPurgeableNonVolatile - the memory was nonvolatile.
+ kIOMemoryPurgeableVolatile - the memory was volatile but its content has not been discarded by the VM system.
+ kIOMemoryPurgeableEmpty - the memory was volatile and has been discarded by the VM system.
+ @result An IOReturn code. */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + +/*! @function performOperation + @abstract Perform an operation on the memory descriptor's memory. + @discussion This method performs some operation on a range of the memory descriptor's memory. When a memory descriptor's memory is not mapped, it should be more efficient to use this method than mapping the memory to perform the operation virtually. + @param options The operation to perform on the memory:
+ kIOMemoryIncoherentIOFlush - pass this option to store to memory and flush any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared.
+ kIOMemoryIncoherentIOStore - pass this option to store to memory any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared. + @param offset A byte offset into the memory descriptor's memory. + @param length The length of the data range. + @result An IOReturn code. */ + + virtual IOReturn performOperation( IOOptionBits options, + IOByteCount offset, IOByteCount length ); + + // Used for dedicated communications for IODMACommand + virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const; + +/*! @function getPhysicalSegment + @abstract Break a memory descriptor into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + @param offset A byte offset into the memory whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the memory. */ + +#ifdef __LP64__ + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ) = 0; +#else /* !__LP64__ */ + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options ); +#endif /* !__LP64__ */ + + virtual uint64_t getPreparationID( void ); + +private: + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 0); +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 1); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 7); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 1); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 2); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 3); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 4); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 5); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 6); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 7); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 8); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 9); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 10); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 11); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 12); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 13); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 14); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 15); + +protected: + virtual void free(); +public: + static void initialize( void ); + +public: +/*! @function withAddress + @abstract Create an IOMemoryDescriptor to describe one virtual range of the kernel task. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single virtual memory range mapped into the kernel map. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + @param address The virtual address of the first byte in the memory. + @param withLength The length of memory. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddress(void * address, + IOByteCount withLength, + IODirection withDirection); + +#ifndef __LP64__ + static IOMemoryDescriptor * withAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; /* use withAddressRange() and prepare() instead */ +#endif /* !__LP64__ */ + +/*! @function withPhysicalAddress + @abstract Create an IOMemoryDescriptor to describe one physical range. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single physical memory range. + @param address The physical address of the first byte in the memory. + @param withLength The length of memory. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ); + +#ifndef __LP64__ + static IOMemoryDescriptor * withRanges(IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use withAddressRanges() instead */ +#endif /* !__LP64__ */ + +/*! @function withAddressRange + @abstract Create an IOMemoryDescriptor to describe one virtual range of the specified map. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single virtual memory range mapped into the specified map. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + @param address The virtual address of the first byte in the memory. + @param withLength The length of memory. + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @param task The task the virtual ranges are mapped into. Note that unlike IOMemoryDescriptor::withAddress(), kernel_task memory must be explicitly prepared when passed to this api. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddressRange( + mach_vm_address_t address, + mach_vm_size_t length, + IOOptionBits options, + task_t task); + +/*! @function withAddressRanges + @abstract Create an IOMemoryDescriptor to describe one or more virtual ranges. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of an array of virtual memory ranges each mapped into a specified source task. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + @param ranges An array of IOAddressRange structures which specify the virtual ranges in the specified map which make up the memory to be described. IOAddressRange is the 64bit version of IOVirtualRange. + @param rangeCount The member count of the ranges array. + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + kIOMemoryAsReference For options:type = Virtual or Physical this indicate that the memory descriptor need not copy the ranges array into local memory. This is an optimisation to try to minimise unnecessary allocations. + @param task The task each of the virtual ranges are mapped into. Note that unlike IOMemoryDescriptor::withAddress(), kernel_task memory must be explicitly prepared when passed to this api. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddressRanges( + IOAddressRange * ranges, + UInt32 rangeCount, + IOOptionBits options, + task_t task); + +/*! @function withOptions + @abstract Master initialiser for all variants of memory descriptors. + @discussion This method creates and initializes an IOMemoryDescriptor for memory it has three main variants: Virtual, Physical & mach UPL. These variants are selected with the options parameter, see below. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + + + @param buffers A pointer to an array of IOAddressRange when options:type is kIOMemoryTypeVirtual64 or kIOMemoryTypePhysical64 or a 64bit kernel. For type UPL it is a upl_t returned by the mach/memory_object_types.h apis, primarily used internally by the UBC. IOVirtualRanges or IOPhysicalRanges are 32 bit only types for use when options:type is kIOMemoryTypeVirtual or kIOMemoryTypePhysical on 32bit kernels. + + @param count options:type = Virtual or Physical count contains a count of the number of entires in the buffers array. For options:type = UPL this field contains a total length. + + @param offset Only used when options:type = UPL, in which case this field contains an offset for the memory within the buffers upl. + + @param task Only used options:type = Virtual, The task each of the virtual ranges are mapped into. + + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + kIOMemoryTypeMask (options:type) kIOMemoryTypeVirtual64, kIOMemoryTypeVirtual, kIOMemoryTypePhysical64, kIOMemoryTypePhysical, kIOMemoryTypeUPL Indicates that what type of memory basic memory descriptor to use. This sub-field also controls the interpretation of the buffers, count, offset & task parameters. + kIOMemoryAsReference For options:type = Virtual or Physical this indicate that the memory descriptor need not copy the ranges array into local memory. This is an optimisation to try to minimise unnecessary allocations. + kIOMemoryBufferPageable Only used by the IOBufferMemoryDescriptor as an indication that the kernel virtual memory is in fact pageable and we need to use the kernel pageable submap rather than the default map. + + @param mapper Which IOMapper should be used to map the in-memory physical addresses into I/O space addresses. Defaults to 0 which indicates that the system mapper is to be used, if present. + + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor *withOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + static IOMemoryDescriptor * withPhysicalRanges( + IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use withOptions() and kIOMemoryTypePhysical instead */ +#endif /* !__LP64__ */ + +#ifndef __LP64__ + static IOMemoryDescriptor * withSubRange(IOMemoryDescriptor *of, + IOByteCount offset, + IOByteCount length, + IODirection withDirection) APPLE_KEXT_DEPRECATED; /* use IOSubMemoryDescriptor::withSubRange() and kIOMemoryThreadSafe instead */ +#endif /* !__LP64__ */ + +/*! @function withPersistentMemoryDescriptor + @abstract Copy constructor that generates a new memory descriptor if the backing memory for the same task's virtual address and length has changed. + @discussion If the original memory descriptor's address and length is still backed by the same real memory, i.e. the user hasn't deallocated and the reallocated memory at the same address then the original memory descriptor is returned with a additional reference. Otherwise we build a totally new memory descriptor with the same characteristics as the previous one but with a new view of the vm. Note not legal to call this function with anything except an IOGeneralMemoryDescriptor that was created with the kIOMemoryPersistent option. + @param originalMD The memory descriptor to be duplicated. + @result Either the original memory descriptor with an additional retain or a new memory descriptor, 0 for a bad original memory descriptor or some other resource shortage. */ + static IOMemoryDescriptor * + withPersistentMemoryDescriptor(IOMemoryDescriptor *originalMD); + +#ifndef __LP64__ + // obsolete initializers + // - initWithOptions is the designated initializer + virtual bool initWithAddress(void * address, + IOByteCount withLength, + IODirection withDirection) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithRanges(IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ +#endif /* __LP64__ */ + +/*! @function getDirection + @abstract Accessor to get the direction the memory descriptor was created with. + @discussion This method returns the direction the memory descriptor was created with. + @result The direction. */ + + virtual IODirection getDirection() const; + +/*! @function getLength + @abstract Accessor to get the length of the memory descriptor (over all its ranges). + @discussion This method returns the total length of the memory described by the descriptor, ie. the sum of its ranges' lengths. + @result The byte count. */ + + virtual IOByteCount getLength() const; + +/*! @function setTag + @abstract Set the tag for the memory descriptor. + @discussion This method sets the tag for the memory descriptor. Tag bits are not interpreted by IOMemoryDescriptor. + @param tag The tag. */ + + virtual void setTag( IOOptionBits tag ); + +/*! @function getTag + @abstract Accessor to the retrieve the tag for the memory descriptor. + @discussion This method returns the tag for the memory descriptor. Tag bits are not interpreted by IOMemoryDescriptor. + @result The tag. */ + + virtual IOOptionBits getTag( void ); + +/*! @function readBytes + @abstract Copy data from the memory descriptor's buffer to the specified buffer. + @discussion This method copies data from the memory descriptor's memory at the given offset, to the caller's buffer. The memory descriptor MUST have the kIODirectionOut direcction bit set and be prepared. kIODirectionOut means that this memory descriptor will be output to an external device, so readBytes is used to get memory into a local buffer for a PIO transfer to the device. + @param offset A byte offset into the memory descriptor's memory. + @param bytes The caller supplied buffer to copy the data to. + @param withLength The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the length of the descriptor. Development/debug kernel builds will assert if the offset is beyond the length of the descriptor. */ + + virtual IOByteCount readBytes(IOByteCount offset, + void * bytes, IOByteCount withLength); + +/*! @function writeBytes + @abstract Copy data to the memory descriptor's buffer from the specified buffer. + @discussion This method copies data to the memory descriptor's memory at the given offset, from the caller's buffer. The memory descriptor MUST have the kIODirectionIn direcction bit set and be prepared. kIODirectionIn means that this memory descriptor will be input from an external device, so writeBytes is used to write memory into the descriptor for PIO drivers. + @param offset A byte offset into the memory descriptor's memory. + @param bytes The caller supplied buffer to copy the data from. + @param withLength The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the length of the descriptor. Development/debug kernel builds will assert if the offset is beyond the length of the descriptor. */ + + virtual IOByteCount writeBytes(IOByteCount offset, + const void * bytes, IOByteCount withLength); + +#ifndef __LP64__ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); +#endif /* !__LP64__ */ + +/*! @function getPhysicalAddress + @abstract Return the physical address of the first byte in the memory. + @discussion This method returns the physical address of the first byte in the memory. It is most useful on memory known to be physically contiguous. + @result A physical address. */ + + IOPhysicalAddress getPhysicalAddress(); + +#ifndef __LP64__ + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; /* use map() and getVirtualAddress() instead */ +#endif /* !__LP64__ */ + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. Note that the prepare call is not thread safe and it is expected that the client will more easily be able to guarantee single threading a particular memory descriptor. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) = 0; + +/*! @function complete + @abstract Complete processing of the memory after an I/O transfer finishes. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. In 10.3 or greater systems the direction argument to complete is not longer respected. The direction is totally determined at prepare() time. + @param forDirection DEPRECATED The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) = 0; + + /* + * Mapping functions. + */ + +/*! @function createMappingInTask + @abstract Maps a IOMemoryDescriptor into a task. + @discussion This is the general purpose method to map all or part of the memory described by a memory descriptor into a task at any available address, or at a fixed address if possible. Caching & read-only options may be set for the mapping. The mapping is represented as a returned reference to a IOMemoryMap object, which may be shared if the mapping is compatible with an existing mapping of the IOMemoryDescriptor. The IOMemoryMap object returned should be released only when the caller has finished accessing the mapping, as freeing the object destroys the mapping. + @param intoTask Sets the target task for the mapping. Pass kernel_task for the kernel address space. + @param atAddress If a placed mapping is requested, atAddress specifies its address, and the kIOMapAnywhere should not be set. Otherwise, atAddress is ignored. + @param options Mapping options are defined in IOTypes.h,
+ kIOMapAnywhere should be passed if the mapping can be created anywhere. If not set, the atAddress parameter sets the location of the mapping, if it is available in the target map.
+ kIOMapDefaultCache to inhibit the cache in I/O areas, kIOMapCopybackCache in general purpose RAM.
+ kIOMapInhibitCache, kIOMapWriteThruCache, kIOMapCopybackCache to set the appropriate caching.
+ kIOMapReadOnly to allow only read only accesses to the memory - writes will cause and access fault.
+ kIOMapReference will only succeed if the mapping already exists, and the IOMemoryMap object is just an extra reference, ie. no new mapping will be created.
+ kIOMapUnique allows a special kind of mapping to be created that may be used with the IOMemoryMap::redirect() API. These mappings will not be shared as is the default - there will always be a unique mapping created for the caller, not an existing mapping with an extra reference.
+ @param offset Is a beginning offset into the IOMemoryDescriptor's memory where the mapping starts. Zero is the default to map all the memory. + @param length Is the length of the mapping requested for a subset of the IOMemoryDescriptor. Zero is the default to map all the memory. + @result A reference to an IOMemoryMap object representing the mapping, which can supply the virtual address of the mapping and other information. The mapping may be shared with multiple callers - multiple maps are avoided if a compatible one exists. The IOMemoryMap object returned should be released only when the caller has finished accessing the mapping, as freeing the object destroys the mapping. The IOMemoryMap instance also retains the IOMemoryDescriptor it maps while it exists. */ + + IOMemoryMap * createMappingInTask( + task_t intoTask, + mach_vm_address_t atAddress, + IOOptionBits options, + mach_vm_size_t offset = 0, + mach_vm_size_t length = 0 ); + +#ifndef __LP64__ + virtual IOMemoryMap * map( + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset = 0, + IOByteCount length = 0 ) APPLE_KEXT_DEPRECATED; /* use createMappingInTask() instead */ +#endif /* !__LP64__ */ + +/*! @function map + @abstract Maps a IOMemoryDescriptor into the kernel map. + @discussion This is a shortcut method to map all the memory described by a memory descriptor into the kernel map at any available address. See the full version of the createMappingInTask method for further details. + @param options Mapping options as in the full version of the createMappingInTask method, with kIOMapAnywhere assumed. + @result See the full version of the createMappingInTask method. */ + + virtual IOMemoryMap * map( + IOOptionBits options = 0 ); + +/*! @function setMapping + @abstract Establishes an already existing mapping. + @discussion This method tells the IOMemoryDescriptor about a mapping that exists, but was created elsewhere. It allows later callers of the map method to share this externally created mapping. The IOMemoryMap object returned is created to represent it. This method is not commonly needed. + @param task Address space in which the mapping exists. + @param mapAddress Virtual address of the mapping. + @param options Caching and read-only attributes of the mapping. + @result A IOMemoryMap object created to represent the mapping. */ + + virtual IOMemoryMap * setMapping( + task_t task, + IOVirtualAddress mapAddress, + IOOptionBits options = 0 ); + + // Following methods are private implementation + +#ifdef __LP64__ + virtual +#endif /* __LP64__ */ + IOReturn redirect( task_t safeTask, bool redirect ); + + IOReturn handleFault( + void * pager, + vm_map_t addressMap, + mach_vm_address_t address, + mach_vm_size_t sourceOffset, + mach_vm_size_t length, + IOOptionBits options ); + + virtual IOMemoryMap * makeMapping( + IOMemoryDescriptor * owner, + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset, + IOByteCount length ); + +protected: + virtual void addMapping( + IOMemoryMap * mapping ); + + virtual void removeMapping( + IOMemoryMap * mapping ); + + virtual IOReturn doMap( + vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ); + + virtual IOReturn doUnmap( + vm_map_t addressMap, + IOVirtualAddress logical, + IOByteCount length ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IOMemoryMap : public OSObject + @abstract A class defining common methods for describing a memory mapping. + @discussion The IOMemoryMap object represents a mapped range of memory, described by a IOMemoryDescriptor. The mapping may be in the kernel or a non-kernel task and has processor cache mode attributes. IOMemoryMap instances are created by IOMemoryDescriptor when it creates mappings in its map method, and returned to the caller. */ + +class IOMemoryMap : public OSObject +{ + OSDeclareDefaultStructors(IOMemoryMap) + +protected: + virtual void taggedRelease(const void *tag = 0) const; + virtual void free(); + +public: +/*! @function getVirtualAddress + @abstract Accessor to the virtual address of the first byte in the mapping. + @discussion This method returns the virtual address of the first byte in the mapping. + @result A virtual address. */ + + virtual IOVirtualAddress getVirtualAddress(); + +/*! @function getPhysicalSegment + @abstract Break a mapping into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the mapping, and optionally the length of the physically contiguous segment from that offset. It functions similarly to IOMemoryDescriptor::getPhysicalSegment. + @param offset A byte offset into the mapping whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the mapping. */ + +#ifdef __LP64__ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0); +#else /* !__LP64__ */ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); +#endif /* !__LP64__ */ + +/*! @function getPhysicalAddress + @abstract Return the physical address of the first byte in the mapping. + @discussion This method returns the physical address of the first byte in the mapping. It is most useful on mappings known to be physically contiguous. + @result A physical address. */ + + IOPhysicalAddress getPhysicalAddress(); + +/*! @function getLength + @abstract Accessor to the length of the mapping. + @discussion This method returns the length of the mapping. + @result A byte count. */ + + virtual IOByteCount getLength(); + +/*! @function getAddressTask + @abstract Accessor to the task of the mapping. + @discussion This method returns the mach task the mapping exists in. + @result A mach task_t. */ + + virtual task_t getAddressTask(); + +/*! @function getMemoryDescriptor + @abstract Accessor to the IOMemoryDescriptor the mapping was created from. + @discussion This method returns the IOMemoryDescriptor the mapping was created from. + @result An IOMemoryDescriptor reference, which is valid while the IOMemoryMap object is retained. It should not be released by the caller. */ + + virtual IOMemoryDescriptor * getMemoryDescriptor(); + +/*! @function getMapOptions + @abstract Accessor to the options the mapping was created with. + @discussion This method returns the options to IOMemoryDescriptor::map the mapping was created with. + @result Options for the mapping, including cache settings. */ + + virtual IOOptionBits getMapOptions(); + +/*! @function unmap + @abstract Force the IOMemoryMap to unmap, without destroying the object. + @discussion IOMemoryMap instances will unmap themselves upon free, ie. when the last client with a reference calls release. This method forces the IOMemoryMap to destroy the mapping it represents, regardless of the number of clients. It is not generally used. + @result An IOReturn code. */ + + virtual IOReturn unmap(); + + virtual void taskDied(); + +/*! @function redirect + @abstract Replace the memory mapped in a process with new backing memory. + @discussion An IOMemoryMap created with the kIOMapUnique option to IOMemoryDescriptor::map() can remapped to a new IOMemoryDescriptor backing object. If the new IOMemoryDescriptor is specified as NULL, client access to the memory map is blocked until a new backing object has been set. By blocking access and copying data, the caller can create atomic copies of the memory while the client is potentially reading or writing the memory. + @param newBackingMemory The IOMemoryDescriptor that represents the physical memory that is to be now mapped in the virtual range the IOMemoryMap represents. If newBackingMemory is NULL, any access to the mapping will hang (in vm_fault()) until access has been restored by a new call to redirect() with non-NULL newBackingMemory argument. + @param options Mapping options are defined in IOTypes.h, and are documented in IOMemoryDescriptor::map() + @param offset As with IOMemoryDescriptor::map(), a beginning offset into the IOMemoryDescriptor's memory where the mapping starts. Zero is the default. + @result An IOReturn code. */ + +#ifndef __LP64__ +// For 32 bit XNU, there is a 32 bit (IOByteCount) and a 64 bit (mach_vm_size_t) interface; +// for 64 bit, these fall together on the 64 bit one. + virtual IOReturn redirect(IOMemoryDescriptor * newBackingMemory, + IOOptionBits options, + IOByteCount offset = 0); +#endif + virtual IOReturn redirect(IOMemoryDescriptor * newBackingMemory, + IOOptionBits options, + mach_vm_size_t offset = 0); + +#ifdef __LP64__ + inline mach_vm_address_t getAddress() __attribute__((always_inline)); + inline mach_vm_size_t getSize() __attribute__((always_inline)); +#else /* !__LP64__ */ + virtual mach_vm_address_t getAddress(); + virtual mach_vm_size_t getSize(); +#endif /* !__LP64__ */ + + + OSMetaClassDeclareReservedUnused(IOMemoryMap, 0); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 1); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 2); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 3); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 4); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 5); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 6); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 7); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(__LP64) || defined(_IOMEMORYDESCRIPTOR_INTERNAL_) + +// The following classes are private implementation of IOMemoryDescriptor - they +// should not be referenced directly, just through the public API's in the +// IOMemoryDescriptor class. For example, an IOGeneralMemoryDescriptor instance +// might be created by IOMemoryDescriptor::withAddressRange(), but there should be +// no need to reference as anything but a generic IOMemoryDescriptor *. + +class IOGeneralMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOGeneralMemoryDescriptor); + +public: + union Ranges { + IOVirtualRange *v; + IOAddressRange *v64; + IOPhysicalRange *p; + void *uio; + }; +protected: + Ranges _ranges; + unsigned _rangesCount; /* number of address ranges in list */ +#ifndef __LP64__ + bool _rangesIsAllocated; /* is list allocated by us? */ +#endif /* !__LP64__ */ + + task_t _task; /* task where all ranges are mapped to */ + + union { + IOVirtualRange v; + IOPhysicalRange p; + } _singleRange; /* storage space for a single range */ + + unsigned _wireCount; /* number of outstanding wires */ + +#ifndef __LP64__ + uintptr_t _cachedVirtualAddress; + + IOPhysicalAddress _cachedPhysicalAddress; +#endif /* !__LP64__ */ + + bool _initialized; /* has superclass been initialized? */ + +public: + virtual void free(); + + virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const; + + virtual uint64_t getPreparationID( void ); + +private: + +#ifndef __LP64__ + virtual void setPosition(IOByteCount position); + virtual void mapIntoKernel(unsigned rangeIndex); + virtual void unmapFromKernel(); +#endif /* !__LP64__ */ + + // Internal APIs may be made virtual at some time in the future. + IOReturn wireVirtual(IODirection forDirection); + void *createNamedEntry(); + + // Internal + OSData * _memoryEntries; + unsigned int _pages; + ppnum_t _highestPage; + uint32_t __iomd_reservedA; + uint32_t __iomd_reservedB; + + IOLock * _prepareLock; + +public: + /* + * IOMemoryDescriptor required methods + */ + + // Master initaliser + virtual bool initWithOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + // Secondary initialisers + virtual bool initWithAddress(void * address, + IOByteCount withLength, + IODirection withDirection) APPLE_KEXT_DEPRECATED; + + virtual bool initWithAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; + + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ) APPLE_KEXT_DEPRECATED; + + virtual bool initWithRanges( IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; + + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; + + virtual addr64_t getPhysicalSegment64( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; + + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); + + virtual IOPhysicalAddress getSourceSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; + + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, +#ifdef __LP64__ + IOOptionBits options = 0 ); +#else /* !__LP64__ */ + IOOptionBits options ); +#endif /* !__LP64__ */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); + + virtual IOReturn doMap( + vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ); + + virtual IOReturn doUnmap( + vm_map_t addressMap, + IOVirtualAddress logical, + IOByteCount length ); + + virtual bool serialize(OSSerialize *s) const; + + // Factory method for cloning a persistent IOMD, see IOMemoryDescriptor + static IOMemoryDescriptor * + withPersistentMemoryDescriptor(IOGeneralMemoryDescriptor *originalMD); + +}; + +#endif /* !defined(__LP64) || defined(_IOMEMORYDESCRIPTOR_INTERNAL_) */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifdef __LP64__ +mach_vm_address_t IOMemoryMap::getAddress() +{ + return (getVirtualAddress()); +} + +mach_vm_size_t IOMemoryMap::getSize() +{ + return (getLength()); +} +#else /* !__LP64__ */ +#include +#endif /* !__LP64__ */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* !_IOMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOMessage.h.svn-base b/i386/include/IOKit/.svn/text-base/IOMessage.h.svn-base new file mode 100644 index 0000000..3ca9e1e --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOMessage.h.svn-base @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMESSAGE_H +#define __IOKIT_IOMESSAGE_H + +#include +#include + +typedef UInt32 IOMessage; + +#define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message) +#define iokit_family_msg(sub,message) (UInt32)(sys_iokit|sub|message) + +/*! @defined iokit_vendor_specific_msg + @discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific + subsystem. It can be used to be generate messages that are used for private + communication between vendor specific code with the IOService::message() etc. APIs. +*/ +#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message) + +#define kIOMessageServiceIsTerminated iokit_common_msg(0x010) +#define kIOMessageServiceIsSuspended iokit_common_msg(0x020) +#define kIOMessageServiceIsResumed iokit_common_msg(0x030) + +#define kIOMessageServiceIsRequestingClose iokit_common_msg(0x100) +#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) +#define kIOMessageServiceWasClosed iokit_common_msg(0x110) + +#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) + +#define kIOMessageServicePropertyChange iokit_common_msg(0x130) + +#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200) +#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) +#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) +#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) +#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240) +#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) +#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) +#define kIOMessageCanSystemSleep iokit_common_msg(0x270) +#define kIOMessageSystemWillSleep iokit_common_msg(0x280) +#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) +#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) +#define kIOMessageSystemWillRestart iokit_common_msg(0x310) +#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) + +#define kIOMessageCopyClientID iokit_common_msg(0x330) + +#endif /* ! __IOKIT_IOMESSAGE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOMultiMemoryDescriptor.h.svn-base b/i386/include/IOKit/.svn/text-base/IOMultiMemoryDescriptor.h.svn-base new file mode 100644 index 0000000..42b19a4 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOMultiMemoryDescriptor.h.svn-base @@ -0,0 +1,110 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOMULTIMEMORYDESCRIPTOR_H +#define _IOMULTIMEMORYDESCRIPTOR_H + +#include + +/*! @class IOMultiMemoryDescriptor : public IOMemoryDescriptor + @abstract The IOMultiMemoryDescriptor object describes a memory area made up of several other IOMemoryDescriptors. + @discussion The IOMultiMemoryDescriptor object represents multiple ranges of memory, specified as an ordered list of IOMemoryDescriptors. The descriptors are chained end-to-end to make up a single contiguous buffer. */ + +class IOMultiMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOMultiMemoryDescriptor); + +protected: + + IOMemoryDescriptor ** _descriptors; + UInt32 _descriptorsCount; + bool _descriptorsIsAllocated; + + virtual void free(); + +public: + +/*! @function withDescriptors + @abstract Create an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method creates and initializes an IOMultiMemoryDescriptor for memory consisting of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. Passing the descriptor array as a reference will avoid an extra allocation. + @param descriptors An array of IOMemoryDescriptors which make up the memory to be described. + @param withCount The object count for the descriptors array. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @param asReference If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation. + @result The created IOMultiMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMultiMemoryDescriptor * withDescriptors( + IOMemoryDescriptor ** descriptors, + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + +/*! @function withDescriptors + @abstract Initialize an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method initializes an IOMultiMemoryDescriptor for memory consisting of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. Passing the descriptor array as a reference will avoid an extra allocation. + @param descriptors An array of IOMemoryDescriptors which make up the memory to be described. + @param withCount The object count for the descriptors array. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @param asReference If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation. + @result The created IOMultiMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + virtual bool initWithDescriptors( + IOMemoryDescriptor ** descriptors, + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + +/*! @function getPhysicalSegment + @abstract Break a memory descriptor into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + @param offset A byte offset into the memory whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the memory. */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ); + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method needn't called for non-pageable memory. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + +/*! @function complete + @abstract Complete processing of the memory after an I/O transfer finishes. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); +}; + +#endif /* !_IOMULTIMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/.svn/text-base/IONVRAM.h.svn-base b/i386/include/IOKit/.svn/text-base/IONVRAM.h.svn-base new file mode 100644 index 0000000..a9337bd --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IONVRAM.h.svn-base @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IONVRAM_H +#define _IOKIT_IONVRAM_H + +#include +#include +#include +#include + + +#define kIODTNVRAMOFPartitionName "common" +#define kIODTNVRAMXPRAMPartitionName "APL,MacOS75" +#define kIODTNVRAMPanicInfoPartitonName "APL,OSXPanic" +#define kIODTNVRAMFreePartitionName "wwwwwwwwwwww" + +enum { + kIODTNVRAMImageSize = 0x2000, + kIODTNVRAMXPRAMSize = 0x0100, + kIODTNVRAMNameRegistrySize = 0x0400 +}; + +enum { + kOFVariableTypeBoolean = 1, + kOFVariableTypeNumber, + kOFVariableTypeString, + kOFVariableTypeData +}; + +enum { + kOFVariablePermRootOnly = 0, + kOFVariablePermUserRead, + kOFVariablePermUserWrite, + kOFVariablePermKernelOnly +}; + +class IODTNVRAM : public IOService +{ + OSDeclareDefaultStructors(IODTNVRAM); + +private: + IONVRAMController *_nvramController; + const OSSymbol *_registryPropertiesKey; + UInt8 *_nvramImage; + bool _nvramImageDirty; + UInt32 _ofPartitionOffset; + UInt32 _ofPartitionSize; + UInt8 *_ofImage; + bool _ofImageDirty; + OSDictionary *_ofDict; + OSDictionary *_nvramPartitionOffsets; + OSDictionary *_nvramPartitionLengths; + UInt32 _xpramPartitionOffset; + UInt32 _xpramPartitionSize; + UInt8 *_xpramImage; + UInt32 _nrPartitionOffset; + UInt32 _nrPartitionSize; + UInt8 *_nrImage; + UInt32 _piPartitionOffset; + UInt32 _piPartitionSize; + UInt8 *_piImage; + bool _systemPaniced; + + virtual UInt8 calculatePartitionChecksum(UInt8 *partitionHeader); + virtual IOReturn initOFVariables(void); +public: + virtual IOReturn syncOFVariables(void); +private: + virtual UInt32 getOFVariableType(const OSSymbol *propSymbol) const; + virtual UInt32 getOFVariablePerm(const OSSymbol *propSymbol) const; + virtual bool getOWVariableInfo(UInt32 variableNumber, const OSSymbol **propSymbol, + UInt32 *propType, UInt32 *propOffset); + virtual bool convertPropToObject(UInt8 *propName, UInt32 propNameLength, + UInt8 *propData, UInt32 propDataLength, + const OSSymbol **propSymbol, + OSObject **propObject); + virtual bool convertObjectToProp(UInt8 *buffer, UInt32 *length, + const OSSymbol *propSymbol, OSObject *propObject); + virtual UInt16 generateOWChecksum(UInt8 *buffer); + virtual bool validateOWChecksum(UInt8 *buffer); + virtual void updateOWBootArgs(const OSSymbol *key, OSObject *value); + virtual bool searchNVRAMProperty(struct IONVRAMDescriptor *hdr, + UInt32 *where); + + virtual IOReturn readNVRAMPropertyType0(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMPropertyType0(IORegistryEntry *entry, + const OSSymbol *name, + OSData * value); + + virtual OSData *unescapeBytesToData(const UInt8 *bytes, UInt32 length); + virtual OSData *escapeDataToData(OSData * value); + + virtual IOReturn readNVRAMPropertyType1(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMPropertyType1(IORegistryEntry *entry, + const OSSymbol *name, + OSData *value); + +public: + virtual bool init(IORegistryEntry *old, const IORegistryPlane *plane); + + virtual void registerNVRAMController(IONVRAMController *nvram); + + virtual void sync(void); + + virtual bool serializeProperties(OSSerialize *s) const; + virtual OSObject *getProperty(const OSSymbol *aKey) const; + virtual OSObject *getProperty(const char *aKey) const; + virtual bool setProperty(const OSSymbol *aKey, OSObject *anObject); + virtual void removeProperty(const OSSymbol *aKey); + virtual IOReturn setProperties(OSObject *properties); + + virtual IOReturn readXPRAM(IOByteCount offset, UInt8 *buffer, + IOByteCount length); + virtual IOReturn writeXPRAM(IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOReturn readNVRAMProperty(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMProperty(IORegistryEntry *entry, + const OSSymbol *name, + OSData *value); + + virtual OSDictionary *getNVRAMPartitions(void); + + virtual IOReturn readNVRAMPartition(const OSSymbol *partitionID, + IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOReturn writeNVRAMPartition(const OSSymbol *partitionID, + IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); +}; + +#endif /* !_IOKIT_IONVRAM_H */ diff --git a/i386/include/IOKit/.svn/text-base/IONotifier.h.svn-base b/i386/include/IOKit/.svn/text-base/IONotifier.h.svn-base new file mode 100644 index 0000000..8f4378a --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IONotifier.h.svn-base @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IONOTIFIER_H +#define _IOKIT_IONOTIFIER_H + +#include + +/*! @class IONotifier : public OSObject + @abstract An abstract base class defining common methods for controlling a notification request. + @discussion IOService notification requests are represented as implementations of the IONotifier object. It defines methods to enable, disable and remove notification requests. These actions are synchronized with invocations of the notification handler, so removing a notification request will guarantee the handler is not being executed. */ + +class IONotifier : public OSObject +{ + OSDeclareAbstractStructors(IONotifier) + +public: + +/*! @function remove + @abstract Removes the notification request and releases it. + @discussion Removes the notification request and release it. Since creating an IONotifier instance will leave it with a retain count of one, creating an IONotifier and then removing it will destroy it. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. */ + + virtual void remove() = 0; + +/*! @function disable + @abstract Disables the notification request. + @discussion Disables the notification request. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. + @result Returns the previous enable state of the IONotifier. */ + + virtual bool disable() = 0; + +/*! @function enable + @abstract Sets the enable state of the notification request. + @discussion Restores the enable state of the notification request, given the previous state passed in. + @param was The enable state of the notifier to restore. */ + + virtual void enable( bool was ) = 0; + +}; + +#endif /* ! _IOKIT_IONOTIFIER_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOPlatformExpert.h.svn-base b/i386/include/IOKit/.svn/text-base/IOPlatformExpert.h.svn-base new file mode 100644 index 0000000..f75a3e3 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOPlatformExpert.h.svn-base @@ -0,0 +1,318 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPLATFORMEXPERT_H +#define _IOKIT_IOPLATFORMEXPERT_H + +#ifdef __cplusplus +#include +#include +#include +#include + +extern "C" { +#endif + +#include + +extern boolean_t PEGetMachineName( char * name, int maxLength ); +extern boolean_t PEGetModelName( char * name, int maxLength ); +extern int PEGetPlatformEpoch( void ); + +enum { + kPEHaltCPU, + kPERestartCPU, + kPEHangCPU, + kPEUPSDelayHaltCPU, + kPEPanicRestartCPU, + kPEPanicSync +}; +extern int (*PE_halt_restart)(unsigned int type); +extern int PEHaltRestart(unsigned int type); + +// Save the Panic Info. Returns the number of bytes saved. +extern UInt32 PESavePanicInfo(UInt8 *buffer, UInt32 length); + +extern long PEGetGMTTimeOfDay( void ); +extern void PESetGMTTimeOfDay( long secs ); + +#ifdef __cplusplus +} /* extern "C" */ + +#define kIOPlatformMapperPresentKey "IOPlatformMapperPresent" + + +extern OSSymbol * gPlatformInterruptControllerName; + +extern const OSSymbol * gIOPlatformSleepActionKey; +extern const OSSymbol * gIOPlatformWakeActionKey; +extern const OSSymbol * gIOPlatformQuiesceActionKey; +extern const OSSymbol * gIOPlatformActiveActionKey; + +class IORangeAllocator; +class IONVRAMController; +class IOPMrootDomain; + +class IOPlatformExpert : public IOService +{ + OSDeclareDefaultStructors(IOPlatformExpert); + +private: + long _peBootROMType; + long _peChipSetType; + long _peMachineType; + +protected: + IOPMrootDomain * root; + int _pePMFeatures; + int _pePrivPMFeatures; + int _peNumBatteriesSupported; + OSArray * thePowerTree; + + bool searchingForAdditionalParents; + OSNumber * multipleParentKeyValue; + int numInstancesRegistered; + + struct ExpansionData { }; + ExpansionData *reserved; + + virtual void setBootROMType(long peBootROMType); + virtual void setChipSetType(long peChipSetType); + virtual void setMachineType(long peMachineType); + + virtual bool CheckSubTree (OSArray * inSubTree, IOService * theNub, IOService * theDevice, OSDictionary * theParent); + virtual bool RegisterServiceInTree (IOService * theService, OSDictionary * theTreeNode, OSDictionary * theTreeParentNode, IOService * theProvider); + + virtual void PMInstantiatePowerDomains ( void ); + +public: + virtual bool attach( IOService * provider ); + virtual bool start( IOService * provider ); + virtual bool configure( IOService * provider ); + virtual IOService * createNub( OSDictionary * from ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + virtual IOReturn getNubResources( IOService * nub ); + + virtual long getBootROMType(void); + virtual long getChipSetType(void); + virtual long getMachineType(void); + + virtual bool getModelName( char * name, int maxLength ); + virtual bool getMachineName( char * name, int maxLength ); + + virtual int haltRestart(unsigned int type); + virtual void sleepKernel(void); + + virtual long getGMTTimeOfDay( void ); + virtual void setGMTTimeOfDay( long secs ); + + virtual IOReturn getConsoleInfo( PE_Video * consoleInfo ); + virtual IOReturn setConsoleInfo( PE_Video * consoleInfo, unsigned int op ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual IOReturn registerInterruptController(OSSymbol *name, IOInterruptController *interruptController); + virtual IOInterruptController *lookUpInterruptController(OSSymbol *name); + virtual void setCPUInterruptProperties(IOService *service); + virtual bool atInterruptLevel(void); + + virtual IOReturn callPlatformFunction(const OSSymbol *functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4); + + virtual IORangeAllocator * getPhysicalRangeAllocator(void); + + virtual bool platformAdjustService(IOService *service); + + virtual void PMRegisterDevice(IOService * theNub, IOService * theDevice); + virtual void PMLog ( const char *,unsigned long, unsigned long, unsigned long ); + + virtual bool hasPMFeature (unsigned long featureMask); + virtual bool hasPrivPMFeature (unsigned long privFeatureMask); + virtual int numBatteriesSupported (void); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); + + virtual OSString* createSystemSerialNumberString(OSData* myProperty); + + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 0); + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 1); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 2); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 3); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 4); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 5); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 6); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 7); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 8); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 9); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 10); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 11); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IODTNVRAM; + +class IODTPlatformExpert : public IOPlatformExpert +{ + OSDeclareAbstractStructors(IODTPlatformExpert); + +private: + IODTNVRAM *dtNVRAM; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual IOService * probe( IOService * provider, + SInt32 * score ); + virtual bool configure( IOService * provider ); + + virtual void processTopLevel( IORegistryEntry * root ); + virtual const char * deleteList( void ) = 0; + virtual const char * excludeList( void ) = 0; + virtual IOService * createNub( IORegistryEntry * from ); + virtual bool createNubs( IOService * parent, OSIterator * iter ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual IOReturn getNubResources( IOService * nub ); + + virtual bool getModelName( char * name, int maxLength ); + virtual bool getMachineName( char * name, int maxLength ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual int haltRestart(unsigned int type); + + /* virtual */ IOReturn readXPRAM(IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + /* virtual */ IOReturn writeXPRAM(IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + virtual IOReturn readNVRAMProperty( + IORegistryEntry * entry, + const OSSymbol ** name, OSData ** value ); + + virtual IOReturn writeNVRAMProperty( + IORegistryEntry * entry, + const OSSymbol * name, OSData * value ); + + // This returns a dictionary describing all the NVRAM partitions. + // The keys will be the partitionIDs of the form "0x52,nvram". + // The values will be OSNumbers of the partition's byte count. + /* virtual */ OSDictionary *getNVRAMPartitions(void); + + /* virtual */ IOReturn readNVRAMPartition(const OSSymbol * partitionID, + IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + /* virtual */ IOReturn writeNVRAMPartition(const OSSymbol * partitionID, + IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); + virtual OSString* createSystemSerialNumberString(OSData* myProperty); + + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 0); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 1); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 2); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 3); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 4); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 5); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 6); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 7); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* generic root nub of service tree */ + +class IOPlatformExpertDevice : public IOService +{ + OSDeclareDefaultStructors(IOPlatformExpertDevice) + +private: + IOWorkLoop *workLoop; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool initWithArgs( void * p1, void * p2, + void * p3, void *p4 ); + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + + virtual IOWorkLoop *getWorkLoop() const; + virtual IOReturn setProperties( OSObject * properties ); + + virtual void free(); + + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 0); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 1); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 2); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 3); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* generic nub for motherboard devices */ + +class IOPlatformDevice : public IOService +{ + OSDeclareDefaultStructors(IOPlatformDevice) + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + virtual IOService * matchLocation( IOService * client ); + virtual IOReturn getResources( void ); + + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 0); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 1); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 2); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 3); +}; + +#endif /* __cplusplus */ + +#endif /* ! _IOKIT_IOPLATFORMEXPERT_H */ diff --git a/i386/include/IOKit/.svn/text-base/IORangeAllocator.h.svn-base b/i386/include/IOKit/.svn/text-base/IORangeAllocator.h.svn-base new file mode 100644 index 0000000..d81bbef --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IORangeAllocator.h.svn-base @@ -0,0 +1,171 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 05 Nov 99 - created. + */ + +#ifndef _IOKIT_IORANGEALLOCATOR_H +#define _IOKIT_IORANGEALLOCATOR_H + +#include +#include + +typedef IOByteCount IORangeScalar; + +/*! @class IORangeAllocator + @abstract A utility class to manage allocations from a range. + @discussion The IORangeAllocator class provides functions for allocating ranges, at a fixed or any offset, and freeing them back to a free list. It is useful for describing ranges of memory or address space without requiring storage in the memory - information describing the free elements is kept elsewhere. Ranges are described by a start offset and a size. IORangeAllocator is optionally protected against multithreaded access. +*/ + +class IORangeAllocator : public OSObject { + + OSDeclareDefaultStructors(IORangeAllocator) + +protected: + UInt32 numElements; + UInt32 capacity; + UInt32 capacityIncrement; + IORangeScalar defaultAlignmentMask; + IOOptionBits options; + + struct IORangeAllocatorElement * elements; + +private: + virtual bool allocElement( UInt32 index ); + + virtual void deallocElement( UInt32 index ); + +public: + enum { + kLocking = 0x00000001 + }; + +/*! @function init + @abstract Standard initializer for IORangeAllocator. + @discussion This method initializes an IORangeAllocator and optionally sets the free list to contain one fragment, from zero to an endOfRange parameter. The capacity in terms of free fragments and locking options are set for the instance. + @param endOfRange If the free list is to contain an initial fragment, set endOfRange to the last offset in the range, ie. size - 1, to create a free fragment for the range zero to endOfRange inclusive. If zero is passed, the free list will be initialized empty, and can be populated with calls to the deallocate method. + @param defaultAlignment If this parameter is non-zero it specifies a required alignment for all allocations, for example pass 256 to align allocations on 256 byte boundaries. Zero or one specify unaligned allocations. + @param capacity Sets the initial size of the free list in number of noncontiguous fragments. This value is also used for the capacityIncrement. + @param options Pass kLocking if the instance can be used by multiple threads. + @result Returns true if the instance is successfully initialized, false on failure. */ + + virtual bool init( IORangeScalar endOfRange, + IORangeScalar defaultAlignment, + UInt32 capacity, + IOOptionBits options ); + +/*! @function withRange + @abstract Standard factory method for IORangeAllocator. + @discussion This method allocates and initializes an IORangeAllocator and optionally sets the free list to contain one fragment, from zero to an endOfRange parameter. The capacity in terms of free fragments and locking options are set for the instance. + @param endOfRange If the free list is to contain an initial fragment, set endOfRange to the last offset in the range, ie. size - 1, to create a free fragment for the range zero to endOfRange inclusive. If zero is passed the free list will be initialized empty, and can be populated with calls to the deallocate method. + @param defaultAlignment If this parameter is non-zero it specifies a required alignment for all allocations, for example pass 256 to align allocations on 256 byte boundaries. Zero or one specify unaligned allocations. + @param capacity Sets the initial size of the free list in number of non-contiguous fragments. This value is also used for the capacityIncrement. + @param options Pass kLocking if the instance can be used by multiple threads. + @result Returns the new IORangeAllocator instance, to be released by the caller, or zero on failure. */ + + static IORangeAllocator * withRange( IORangeScalar endOfRange, + IORangeScalar defaultAlignment = 0, + UInt32 capacity = 0, + IOOptionBits options = 0 ); + + virtual void free(); + virtual bool serialize(OSSerialize *s) const; + +/*! @function getFragmentCount + @abstract Accessor to return the number of free fragments in the range. + @discussion This method returns a count of free fragments. Each fragment describes a non-contiguous free range - deallocations will merge contiguous fragments together. + @result Returns the count of free fragments. +*/ + + virtual UInt32 getFragmentCount( void ); + +/*! @function getFragmentCapacity + @abstract Accessor to return the number of free fragments in the range. + @discussion This method returns the current capacity of the free fragment list. + @result Returns the current capacity of free fragment list. +*/ + + virtual UInt32 getFragmentCapacity( void ); + +/*! @function setFragmentCapacityIncrement + @abstract Sets the count of fragments the free list will increase by when full. + @discussion This method sets the number of extra fragments the free list will expand to when full. It defaults to the initial capacity. + @param count The number of fragments to increment the capacity by when the free list is full. +*/ + + virtual void setFragmentCapacityIncrement( UInt32 count ); + +/*! @function getFreeCount + @abstract Totals the sizes of the free fragments. + @discussion This method returns the total of the sizes of the fragments on the free list. + @result Returns the total of the free fragments sizes. +*/ + + virtual IORangeScalar getFreeCount( void ); + +/*! @function allocate + @abstract Allocates from the free list, at any offset. + @discussion This method allocates a range from the free list. The alignment will default to the alignment set when the allocator was created or may be set here. + @param size The size of the range requested. + @param result The beginning of the range allocated is returned here on success. + @param alignment If zero is passed, default to the allocators alignment, otherwise pass an alignment required for the allocation, for example 4096 to page align. + @result Returns true if the allocation was successful, else false. +*/ + + virtual bool allocate( IORangeScalar size, + IORangeScalar * result, + IORangeScalar alignment = 0 ); + +/*! @function allocateRange + @abstract Allocates from the free list, at a set offset. + @discussion This method allocates a range from the free list, given a set offset passed in. + @param start The beginning of the range requested. + @param size The size of the range requested. + @result Returns true if the allocation was successful, else false. +*/ + + virtual bool allocateRange( IORangeScalar start, + IORangeScalar size ); + +/*! @function deallocate + @abstract Deallocates a range to the free list. + @discussion This method deallocates a range to the free list, given a the start offset and length passed in. + @param start The beginning of the range requested. + @param size Returns the size of the range requested. +*/ + + virtual void deallocate( IORangeScalar start, + IORangeScalar size ); +}; + +#endif /* _IOKIT_IORANGEALLOCATOR_H */ diff --git a/i386/include/IOKit/.svn/text-base/IORegistryEntry.h.svn-base b/i386/include/IOKit/.svn/text-base/IORegistryEntry.h.svn-base new file mode 100644 index 0000000..bbe4b18 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IORegistryEntry.h.svn-base @@ -0,0 +1,947 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOREGISTRYENTRY_H +#define _IOKIT_IOREGISTRYENTRY_H + +#include +#include + + +extern const OSSymbol * gIONameKey; +extern const OSSymbol * gIOLocationKey; +extern const OSSymbol * gIORegistryEntryIDKey; + +class IORegistryEntry; +class IORegistryPlane; +class IORegistryIterator; + +typedef void (*IORegistryEntryApplierFunction)(IORegistryEntry * entry, + void * context); + +enum { + kIORegistryIterateRecursively = 0x00000001, + kIORegistryIterateParents = 0x00000002 +}; + +/*! @class IORegistryEntry : public OSObject + @abstract The base class for all objects in the registry. + @discussion The IORegistryEntry base class provides functions for describing graphs of connected registry entries, each with a dictionary-based property table. Entries may be connected in different planes, with differing topologies. Access to the registry is protected against multiple threads. Inside the kernel planes are specified with plane objects and are published by the creator - IOService exports the gIOServicePlane plane object for example. Non kernel clients specify planes by their name. +*/ + +class IORegistryEntry : public OSObject +{ + friend class IORegistryIterator; + + OSDeclareDefaultStructors(IORegistryEntry) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData + { + uint64_t fRegistryEntryID; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + + OSDictionary * fRegistryTable; + OSDictionary * fPropertyTable; + +public: + /* methods available in Mac OS X 10.1 or later */ + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as a C-string. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const char * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSString. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const OSString * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSSymbol. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const OSSymbol * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyParentEntry + @abstract Returns an registry entry's first parent entry in a plane. Available in Mac OS X 10.1 or later. + @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification. + @param plane The plane object. + @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */ + + virtual IORegistryEntry * copyParentEntry( const IORegistryPlane * plane ) const; + +/*! @function copyChildEntry + @abstract Returns an registry entry's first child entry in a plane. Available in Mac OS X 10.1 or later. + @discussion This function will return the child which first attached to a registry entry. + @param plane The plane object. + @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */ + + virtual IORegistryEntry * copyChildEntry( const IORegistryPlane * plane ) const; + + /* method available in Mac OS X 10.4 or later */ +/*! + @typedef Action + @discussion Type and arguments of callout C function that is used when +a runCommand is executed by a client. Cast to this type when you want a C++ +member function to be used. Note the arg1 - arg3 parameters are passed straight pass through to the action callout. + @param target + Target of the function, can be used as a refcon. Note if a C++ function +was specified, this parameter is implicitly the first parameter in the target +member function's parameter list. + @param arg0 Argument to action from run operation. + @param arg1 Argument to action from run operation. + @param arg2 Argument to action from run operation. + @param arg3 Argument to action from run operation. +*/ + typedef IOReturn (*Action)(OSObject *target, + void *arg0, void *arg1, + void *arg2, void *arg3); + +/*! @function runPropertyAction + @abstract Single thread a call to an action w.r.t. the property lock + @discussion Client function that causes the given action to be called in a manner that syncrhonises with the registry iterators and serialisers. This functin can be used to synchronously manipulate the property table of this nub + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result Returns the value of the Action callout. +*/ + virtual IOReturn runPropertyAction(Action action, OSObject *target, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IORegistryEntry, 0); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 1); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 2); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 3); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 4); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 5); +#else + OSMetaClassDeclareReservedUsed(IORegistryEntry, 0); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 1); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 2); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 3); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 4); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 5); +#endif + OSMetaClassDeclareReservedUnused(IORegistryEntry, 6); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 7); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 8); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 9); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 10); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 11); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 12); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 13); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 14); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 15); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 16); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 17); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 18); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 19); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 20); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 21); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 22); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 23); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 24); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 25); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 26); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 27); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 28); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 29); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 30); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 31); + +public: + + /* Registry accessors */ + +/*! @function getRegistryRoot + @abstract Returns a pointer to the root instance of the registry. + @discussion This method provides an accessor to the root of the registry for the machine. The root may be passed to a registry iterator when iterating a plane, and contains properties that describe the available planes, and diagnostic information for IOKit. Keys for these properties are in IOKitKeys.h. + @result A pointer to the IORegistryEntry root instance. It should not be released by the caller. */ + + static IORegistryEntry * getRegistryRoot( void ); + +/*! @function getGenerationCount + @abstract Returns an generation count for all registry changing operations. + @discussion This method provides an accessor to the current generation count (or seed) of the registry which changes when any topology change occurs in the registry - this does not include property table changes. It may be used to invalidate any caching of the results from IORegistryEntry methods. + @result An integer generation count. */ + + static SInt32 getGenerationCount( void ); + +/*! @function getPlane + @abstract Looks up the plane object by a C-string name. + @discussion Planes are usually provided as globals by the creator, eg. gIOServicePlane, gIODeviceTreePlane, or gIOAudioPlane, however they may also be looked up by name with this method. + @result A pointer to the plane object, or zero if no such plane exists. The returned plane should not be released. */ + + static const IORegistryPlane * getPlane( const char * name ); + + /* Registry Entry allocation & init */ + +/*! @function init + @abstract Standard init method for all IORegistryEntry subclasses. + @discussion A registry entry must be initialized with this method before it can be used. A property dictionary may passed and will be retained by this method for use as the registry entry's property table, or an empty one will be created. + @param A dictionary that will become the registry entry's property table (retaining it), or zero which will cause an empty property table to be created. + @result true on success, or false on a resource failure. */ + + virtual bool init( OSDictionary * dictionary = 0 ); + +/*! @function free + @abstract Standard free method for all IORegistryEntry subclasses. + @discussion This method will release any resources of the entry, in particular its property table. Note that the registry entry must always be detached from the registry before free may be called, and subclasses (namely IOService) will have additional protocols for removing registry entries. free should never need be called directly. */ + + virtual void free( void ); + +/*! @function setPropertyTable + @abstract Replace a registry entry's property table. + @discussion This method will release the current property table of a the entry and replace it with another, retaining the new property table. + @param dict The new dictionary to be used as the entry's property table. */ + + virtual void setPropertyTable( OSDictionary * dict ); + + /* Synchronized property accessors; wrappers to OSDictionary + * plus property creation helpers */ + +/*! @function setProperty + @abstract Synchronized method to add a property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The properties name as an OSSymbol. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const OSSymbol * aKey, OSObject * anObject); + +/*! @function setProperty + @abstract Synchronized method to add a property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const OSString * aKey, OSObject * anObject); + +/*! @function setProperty + @abstract Synchronized method to add a property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, OSObject * anObject); + +/*! @function setProperty + @abstract Synchronized method to construct and add a OSString property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSString from the supplied C-string, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param aString The property value as a C-string. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, const char * aString); + +/*! @function setProperty + @abstract Synchronized method to construct and add an OSBoolean property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSBoolean from the supplied value, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param aBoolean The property's boolean value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, bool aBoolean); + +/*! @function setProperty + @abstract Synchronized method to construct and add an OSNumber property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSNumber from the supplied value and size, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param aValue The property's numeric value. + @param aNumberOfBits The property's size in bits, for OSNumber. + @result true on success or false on a resource failure. */ + + virtual bool setProperty( const char * aKey, + unsigned long long aValue, + unsigned int aNumberOfBits); + +/*! @function setProperty + @abstract Synchronized method to construct and add an OSData property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSData copied from the supplied data and length, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param bytes The property's value as a pointer. OSData will copy this data. + @param length The property's size in bytes, for OSData. + @result true on success or false on a resource failure. */ + + virtual bool setProperty( const char * aKey, + void * bytes, + unsigned int length); + +/*! @function removeProperty + @abstract Synchronized method to remove a property from a registry entry's property table. + @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSSymbol. */ + + virtual void removeProperty( const OSSymbol * aKey); + +/*! @function removeProperty + @abstract Synchronized method to remove a property from a registry entry's property table. + @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. */ + + virtual void removeProperty( const OSString * aKey); + +/*! @function removeProperty + @abstract Synchronized method to remove a property from a registry entry's property table. + @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. */ + + virtual void removeProperty( const char * aKey); + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSSymbol. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSSymbol * aKey) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSString * aKey) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const char * aKey) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSSymbol. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSSymbol * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSString. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSString * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as a C-string. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const char * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSSymbol. + @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const OSSymbol * aKey) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. + @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const OSString * aKey) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. + @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const char * aKey) const; + +/*! @function dictionaryWithProperties + @abstract Synchronized method to obtain copy a registry entry's property table. + @discussion This method will copy a registry entry's property table, using the OSDictionary::withDictionary semantics. This method is synchronized with other IORegistryEntry accesses to the property table. Since OSDictionary will only copy property values by reference, synchronization is not guaranteed to any collection values. + @result The created dictionary, or zero on a resource value. It should be released by the caller. */ + + virtual OSDictionary * dictionaryWithProperties( void ) const; + +/*! @function serializeProperties + @abstract Synchronized method to serialize a registry entry's property table. + @discussion This method will serialize a registry entry's property table, using the OSDictionary::serialize semantics. This method is synchronized with other IORegistryEntry accesses to the property table. Many non-kernel clients of IOKit read information from the registry via properties, and will invoke this method in a registry entry to create a serialization of all the entry's properties, which is then reconstructed in the client's task as a CFDictionary. This method may be intercepted by subclasses to update their properties or implement a different serialization method, though it is usually better to implement such functionality by creating objects in the property table and implementing their serialize methods, avoiding any need to implement serializeProperties. + @param serialize The OSSerialize instance representing the serialization request. + @result True on success, false otherwise. */ + + virtual bool serializeProperties( OSSerialize * serialize ) const; + + /* Unsynchronized(!) property table access */ + +/*! @function getPropertyTable + @abstract Unsynchronized accessor to a registry entry's property table. + @discussion This method will return a pointer to the live property table as an OSDictionery. Its use is not recommended in most cases, instead use the synchronized accessors and helper functions of IORegistryEntry to access properties. It can only safely be used by one thread, which usually means it can only be used before a registry entry is entered into the registry. + @result A pointer to the property table as an OSDictionary. The pointer is valid while the registry entry is retained, and should not be released by the caller. */ + + /* inline */ OSDictionary * getPropertyTable( void ) const; + /* { return(fPropertyTable); } */ + + /* Set properties from user level, to be overridden if supported */ + +/*! @function setProperties + @abstract Optionally supported external method to set properties in a registry entry. + @discussion This method is not implemented by IORegistryEntry, but is available to kernel and non-kernel clients to set properties in a registry entry. IOUserClient provides connection based, more controlled access to this functionality and may be more appropriate for many uses, since there is no differentiation between clients available to this method. + @param properties Any OSObject subclass, to be interpreted by the implementing method - for example an OSDictionary, OSData etc. may all be appropriate. + @result An IOReturn code to be returned to the caller. */ + + virtual IOReturn setProperties( OSObject * properties ); + + /* Topology */ + +/*! @function getParentIterator + @abstract Returns an iterator over an registry entry's parent entries in a specified plane. + @param plane The plane object. + @result Returns an iterator over the parents of the registry entry, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getParentIterator( const IORegistryPlane * plane ) + const; + virtual void applyToParents( IORegistryEntryApplierFunction applier, + void * context, + const IORegistryPlane * plane ) const; + +/*! @function getParentEntry + @abstract Returns an registry entry's first parent entry in a plane. + @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification. + @param plane The plane object. + @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. The parent is retained while the entry is attached, and should not be released by the caller. */ + + virtual IORegistryEntry * getParentEntry( const IORegistryPlane * plane ) const; + +/*! @function getChildIterator + @abstract Returns an iterator over an registry entry's child entries in a plane. + @discussion This method creates an iterator which will return each of a registry entry's child entries in a specified plane. + @param plane The plane object. + @result Returns an iterator over the children of the entry, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getChildIterator( const IORegistryPlane * plane ) + const; + + virtual void applyToChildren( IORegistryEntryApplierFunction applier, + void * context, + const IORegistryPlane * plane ) const; + +/*! @function getChildEntry + @abstract Returns an registry entry's first child entry in a plane. + @discussion This function will return the child which first attached to a registry entry. + @param plane The plane object. + @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. The child is retained while the entry is attached, and should not be released by the caller. */ + + virtual IORegistryEntry * getChildEntry( const IORegistryPlane * plane ) const; + +/*! @function isChild + @abstract Determines whether a registry entry is the child of another in a plane. + @discussion This method called in the parent entry determines if the specified entry is a child, in a plane. Additionally, it can check if the child is the only child of the parent entry. + @param child The possible child registry entry. + @param plane The plane object. + @param onlyChild If true, check also if the child is the only child. + @result If the child argument is not a child of the registry entry, false is returned. If onlyChild is true and the child is not the only child of the entry, false is returned, otherwise true is returned. */ + + virtual bool isChild( IORegistryEntry * child, + const IORegistryPlane * plane, + bool onlyChild = false ) const; + +/*! @function isParent + @abstract Determines whether a registry entry is the parent of another in a plane. + @discussion This method called in the child entry determines if the specified entry is a parent, in a plane. Additionally, it can check if the parent is the only parent of the child entry. + @param parent The possible parent registry entry. + @param plane The plane object. + @param onlyParent If true, check also if the parent is the only parent. + @result If the parent argument is not a parent of the registry entry, false is returned. If onlyParent is true and the parent is not the only parent of the entry, false is returned, otherwise true is returned. */ + + virtual bool isParent( IORegistryEntry * parent, + const IORegistryPlane * plane, + bool onlyParent = false ) const; + +/*! @function inPlane + @abstract Determines whether a registry entry is attached in a plane. + @discussion This method determines if the entry is attached in a plane to any other entry. It can also be used to determine if the entry is a member of any plane. + @param plane The plane object, 0 indicates any plane. + @result If the entry has a parent in the given plane or if plane = 0 then if entry has any parent; return true, otherwise false. */ + + virtual bool inPlane( const IORegistryPlane * plane = 0) const; + +/*! @function getDepth + @abstract Counts the maximum number of entries between an entry and the registry root, in a plane. + @discussion This method counts the number of entries between and entry and the registry root, in a plane, for each parent of the entry and returns the maximum value. + @param plane The plane object. + @result The maximum number of entries between the entry and the root. Zero is returned if the entry is not attached in the plane. */ + + virtual unsigned int getDepth( const IORegistryPlane * plane ) const; + + /* Attach / detach */ + +/*! @function attachToParent + @abstract Attaches a entry to a parent entry in a plane. + @discussion This is the usual method of entering an entry into the registry. It is a no-op and success if the entry is already attached to the parent. Attaching the entry into the registry retains both the child and parent while they are attached. This method will call attachToChild in the parent entry if it is not being called from attachToChild. + @param parent The registry entry to attach to. + @param plane The plane object. + @result true on success, or false on a resource failure, or if the parent is the same as the child. */ + + virtual bool attachToParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + +/*! @function detachFromParent + @abstract Detaches an entry from a parent entry in a plane. + @discussion This is the usual method of removing an entry from the registry. It is a no-op if the entry is not attached to the parent. Detaching the entry will release both the child and parent. This method will call detachFromChild in the parent entry if it is not being called from detachFromChild. + @param parent The registry entry to detach from. + @param plane The plane object. */ + + virtual void detachFromParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + +/*! @function attachToChild + @abstract Method called in the parent entry when a child attaches. + @discussion This method is called in the parent entry when a child attaches, to make overrides possible. This method will also call attachToParent in the child entry if it is not being called from attachToParent. It is a no-op and success if the entry is already a child. Attaching the entry into the registry retains both the child and parent while they are attached. + @param child The registry entry being attached. + @param plane The plane object. + @result true on success, or false on a resource failure, or if the parent is the same as the child. */ + + virtual bool attachToChild( IORegistryEntry * child, + const IORegistryPlane * plane ); + +/*! @function detachFromChild + @abstract Detaches a child entry from its parent in a plane. + @discussion This method is called in the parent entry when a child detaches, to make overrides possible. It is a no-op if the entry is not a child of the parent. Detaching the entry will release both the child and parent. This method will call detachFromParent in the child entry if it is not being called from detachFromParent. + @param parent The registry entry to detach. + @param plane The plane object. */ + + virtual void detachFromChild( IORegistryEntry * child, + const IORegistryPlane * plane ); + +/*! @function detachAbove + @abstract Detaches an entry from all its parent entries in a plane. + @discussion This method calls detachFromParent in the entry for each of its parent entries in the plane. + @param plane The plane object. */ + + virtual void detachAbove( const IORegistryPlane * plane ); + +/*! @function detachAll + @abstract Detaches an entry and all its children recursively in a plane. + @discussion This method breaks the registry connections for a subtree. detachAbove is called in the entry, and all child entries and their children in the plane. + @param plane The plane object. */ + + virtual void detachAll( const IORegistryPlane * plane ); + + /* Name, location and path accessors */ + +/*! @function getName + @abstract Returns the name assigned to the registry entry as a C-string. + @discussion Entries can be named in a particular plane, or globally. If the entry is named in plane and the plane is specified that name will be returned, otherwise the global name is returned. The global name defaults to the entry's meta class name if it has not been named. + @param plane The plane object, or zero for the global name. + @result A C-string name, valid while the entry is retained. */ + + virtual const char * getName( const IORegistryPlane * plane = 0 ) const; + +/*! @function copyName + @abstract Returns the name assigned to the registry entry as an OSSymbol. + @discussion Entries can be named in a particular plane, or globally. If the entry is named in plane and the plane is specified that name will be returned, otherwise the global name is returned. The global name defaults to the entry's meta class name if it has not been named. + @param plane The plane object, or zero for the global name. + @result A reference to an OSSymbol for the name, which should be released by the caller. */ + + virtual const OSSymbol * copyName( + const IORegistryPlane * plane = 0 ) const; + +/*! @function compareNames + @abstract Compares the name of the entry with one or more names, and optionally returns the matching name. + @discussion This method is called during IOService name matching and elsewhere to compare the entry's global name with a list of names, or a single name. A list of names may be passed as any OSCollection of OSStrings, while a single name may be passed an OSString, in the name parameter. compareNames will call the compareName method for each name, for overrides. + @param name The name or names to compare with as any OSCollection (eg. OSArray, OSSet, OSDictionary) of OSStrings, or a single name may be passed an OSString. + @param matched If the caller wants the successfully matched name returned, pass a non-zero pointer for the matched parameter and an OSString will be returned here. It should be released by the caller. + @result True if one of the names compared true with the entry's global name. */ + + virtual bool compareNames( OSObject * name, OSString ** matched = 0 ) const; + +/*! @function compareName + @abstract Compares the name of the entry with one name, and optionally returns the matching name. + @discussion This method is called during IOService name matching and elsewhere from the compareNames method. It should be overridden to provide non-standard name matching. + @param name The name to compare with as an OSString. + @param matched If the caller wants the successfully matched name returned, pass a non-zero pointer for the matched parameter and an OSString will be returned here. It should be released by the caller. Generally, this will be the same as the name parameter, but may not be if wildcards are used. + @result True if the name compared true with the entry's global name. */ + + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + +/*! @function setName + @abstract Sets a name for the registry entry, in a particular plane, or globally. + @discussion Entries can be named in a particular plane, or globally. If the plane is specified the name applies only to that plane, otherwise the global name is set. The global name defaults to the entry's meta class name if it has not been named. + @param name An OSSymbol which will be retained. + @param plane The plane object, or zero to set the global name. */ + + virtual void setName( const OSSymbol * name, + const IORegistryPlane * plane = 0 ); + +/*! @function setName + @abstract Sets a name for the registry entry, in a particular plane, or globally. + @discussion Entries can be named in a particular plane, or globally. If the plane is specified the name applies only to that plane, otherwise the global name is set. The global name defaults to the entry's meta class name if it has not been named. + @param name A const C-string name which will be copied. + @param plane The plane object, or zero to set the global name. */ + + virtual void setName( const char * name, + const IORegistryPlane * plane = 0 ); + +/*! @function getLocation + @abstract Returns the location string assigned to the registry entry as a C-string. + @discussion Entries can given a location string in a particular plane, or globally. If the entry has had a location set in a plane and the plane is specified that location string will be returned, otherwise the global location string is returned. If no global location string has been set, zero is returned. + @param plane The plane object, or zero for the global name. + @result A C-string location string, valid while the entry is retained, or zero. */ + + virtual const char * getLocation( const IORegistryPlane * plane = 0 ) const; + +/*! @function copyLocation + @abstract Returns the location string assigned to the registry entry as an OSSymbol. + @discussion Entries can given a location string in a particular plane, or globally. If the entry has had a location set in a plane and the plane is specified that location string will be returned, otherwise the global location string is returned. If no global location string has been set, zero is returned. + @param plane The plane object, or zero for the global name. + @result A reference to an OSSymbol for the location if one exists, which should be released by the caller, or zero. */ + + virtual const OSSymbol * copyLocation( + const IORegistryPlane * plane = 0 ) const; + +/*! @function setLocation + @abstract Sets a location string for the registry entry, in a particular plane, or globally. + @discussion Entries can be given a location string in a particular plane, or globally. If the plane is specified the location applies only to that plane, otherwise the global location is set. The location string may be used during path lookups of registry entries, to distinguish between sibling entries with the same name. The default IORegistryEntry parsing of location strings expects a list of hex numbers separated by commas, though subclasses of IORegistryEntry might do their own parsing. + @param location A C-string location string which will be copied, or an OSSymbol which will be retained. + @param plane The plane object, or zero to set the global location string. */ + + virtual void setLocation( const OSSymbol * location, + const IORegistryPlane * plane = 0 ); + virtual void setLocation( const char * location, + const IORegistryPlane * plane = 0 ); + +/*! @function getPath + @abstract Create a path for a registry entry. + @discussion The path for a registry entry is copied to the caller's buffer. The path describes the entry's attachment in a particular plane, which must be specified. The path begins with the plane name followed by a colon, and then followed by '/' separated path components for each of the entries between the root and the registry entry. Each component is constructed with the getPathComponent method called in each entry. An alias may also exist for the entry, which are described as properties in a registry entry found at /aliases in the plane. If a property value interpreted as a path in a call to IORegistryEntry::fromPath yields the entry, then the property name is used as the entry's path. + @param path A char buffer allocated by the caller. + @param length An in/out parameter - the caller sets the length of the buffer available, and getPath returns the total length of the path copied to the buffer. + @param plane The plane object. + @result getPath will fail if the entry is not attached in the plane, or if the buffer is not large enough to contain the path. */ + + virtual bool getPath( char * path, int * length, + const IORegistryPlane * plane) const; + +/*! @function getPathComponent + @abstract Create a path component for a registry entry. + @discussion Each component of a path created with getPath is created with getPathComponent. The default implementation concatenates the entry's name in the the plane, with the "at" symbol and the location string of the entry in the plane if it has been set. + @param path A char buffer allocated by the caller. + @param length An in/out parameter - the caller sets the length of the buffer available, and getPathComponent returns the total length of the path component copied to the buffer. + @param plane The plane object. + @result true if the path fits into the supplied buffer or false on a overflow. */ + + virtual bool getPathComponent( char * path, int * length, + const IORegistryPlane * plane ) const; + +/*! @function fromPath + @abstract Looks up a registry entry by path. + @discussion This function parses paths to lookup registry entries. The path may begin with the : created by getPath, or the plane may be set by the caller. If there are characters remaining unparsed after an entry has been looked up, this may be considered an invalid lookup, or those characters may be passed back to the caller and the lookup successful. + @param path A C-string path. + @param plane The plane to lookup up the path, or zero, in which case the path must begin with the plane name. + @param residualPath If the path may contain residual characters after the last path component, the residual will be copied back to the caller's residualPath buffer. If there are residual characters and no residual buffer is specified, fromPath will fail. + @param residualLength An in/out parameter - the caller sets the length of the residual buffer available, and fromPath returns the total length of the residual path copied to the buffer. If there is no residualBuffer (residualPath = 0) then residualLength may be zero also. + @param fromEntry The lookup will proceed rooted at this entry if non-zero, otherwise it proceeds from the root of the plane. + @result A retained registry entry is returned on success, or zero on failure. The caller should release the entry. */ + + static IORegistryEntry * fromPath( const char * path, + const IORegistryPlane * plane = 0, + char * residualPath = 0, + int * residualLength = 0, + IORegistryEntry * fromEntry = 0 ); + +/*! @function fromPath + @abstract Looks up a registry entry by relative path. + @discussion This function looks up a entry below the called entry by a relative path. It is just a convenience that calls IORegistryEntry::fromPath with this as the fromEntry parameter. + @param path See IORegistryEntry::fromPath. + @param plane See IORegistryEntry::fromPath. + @param residualPath See IORegistryEntry::fromPath. + @param residualLength See IORegistryEntry::fromPath. + @result See IORegistryEntry::fromPath. */ + + virtual IORegistryEntry * childFromPath( const char * path, + const IORegistryPlane * plane = 0, + char * residualPath = 0, + int * residualLength = 0 ); + +/*! @function dealiasPath + @abstract Strips any aliases from the head of path and returns the full path. + @discussion If the path specified begins with an alias found in the /aliases entry, the value of the alias is returned, and a pointer into the passed in path after the alias is passed back to the caller. If an alias is not found, zero is returned and the path parameter is unchanged. + @param opath An in/out paramter - the caller passes in a pointer to a C-string pointer to a path. If an alias is found, dealiasPath returns a pointer into the path just beyond the end of the alias. + @param plane A plane object must be specified. + @result A C-string pointer to the value of the alias if one is found, or zero if not. */ + + static const char * dealiasPath( const char ** opath, + const IORegistryPlane * plane ); + +/*! @function makePlane + @abstract Constructs an IORegistryPlane object. + @discussion Most planes in IOKit are created by the OS, although other planes may be created. + @param name A C-string name for the new plane, to be copied. + @result A new instance of an IORegistryPlane, or zero on failure. */ + + static const IORegistryPlane * makePlane( const char * name ); + +/*! @abstract Returns an ID for the registry entry that is global to all tasks. + @discussion The entry ID returned by getRegistryEntryID can be used to identify a registry entry across all tasks. A registry entry may be looked up by its entry ID by creating a matching dictionary with IORegistryEntryIDMatching() in user space, or IOService::registryEntryIDMatching() in the kernel, to be used with the IOKit matching functions. The ID is valid only until the machine reboots. + @result An ID for the registry entry, assigned when the entry is first attached in the registry. */ + + uint64_t getRegistryEntryID( void ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* * * * * * * * * * * * internals * * * * * * * * * * * */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ); + +private: + static IORegistryEntry * initialize( void ); + +private: + inline bool arrayMember( OSArray * set, + const IORegistryEntry * member, + unsigned int * index = 0 ) const; + + bool makeLink( IORegistryEntry * to, + unsigned int relation, + const IORegistryPlane * plane ) const; + void breakLink( IORegistryEntry * to, + unsigned int relation, + const IORegistryPlane * plane ) const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + OSArray * getParentSetReference( const IORegistryPlane * plane ) + const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + OSArray * getChildSetReference( const IORegistryPlane * plane ) + const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IORegistryEntry * getChildFromComponent( const char ** path, + const IORegistryPlane * plane ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + const OSSymbol * hasAlias( const IORegistryPlane * plane, + char * opath = 0, int * length = 0 ) const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + const char * matchPathLocation( const char * cmp, + const IORegistryPlane * plane ); + +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IORegistryIterator : public OSIterator + @abstract An iterator over the registry. + @discussion An iterator that can traverse the children or parents of a registry entry in a plane, and recurse. Access to the registry is protected against multiple threads, but an IORegistryIterator instance is for use by one thread only. */ + +class IORegistryIterator : public OSIterator +{ + OSDeclareAbstractStructors(IORegistryIterator) + +private: + struct IORegCursor { + IORegCursor * next; + IORegistryEntry * current; + OSIterator * iter; + }; + IORegCursor start; + IORegCursor * where; + IORegistryEntry * root; + OSOrderedSet * done; + const IORegistryPlane * plane; + IOOptionBits options; + + virtual void free( void ); + +public: +/*! @function iterateOver + @abstract Create an iterator rooted at a given registry entry. + @discussion This method creates an IORegistryIterator that is set up with options to iterate children or parents of a root entry, and to recurse automatically into entries as they are returned, or only when instructed. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + @param start The root entry to begin the iteration at. + @param plane A plane object must be specified. + @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned. This option affects the behaviour of the getNextObject method, which is defined in the OSIterator superclass. Other methods will override this behaviour. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + @result A created IORegistryIterator instance, to be released by the caller when it has finished with it. */ + + static IORegistryIterator * iterateOver( IORegistryEntry * start, + const IORegistryPlane * plane, + IOOptionBits options = 0 ); + +/*! @function iterateOver + @abstract Create an iterator rooted at the registry root. + @discussion This method creates an IORegistryIterator that is set up with options to iterate children of the registry root entry, and to recurse automatically into entries as they are returned, or only when instructed. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + @param plane A plane object must be specified. + @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned. This option affects the behaviour of the getNextObject method, which is defined in the OSIterator superclass. Other methods will override this behaviour. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + @result A created IORegistryIterator instance, to be released by the caller when it has finished with it. */ + + static IORegistryIterator * iterateOver( const IORegistryPlane * plane, + IOOptionBits options = 0 ); + +/*! @function getNextObject + @abstract Return the next object in the registry iteration. + @discussion This method calls either getNextObjectFlat or getNextObjectRecursive depending on the options the iterator was created with. This implements the OSIterator defined getNextObject method. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + @result The next registry entry in the iteration (the current entry), or zero if the iteration has finished at this level of recursion. The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObject( void ); + +/*! @function getNextObjectFlat + @abstract Return the next object in the registry iteration, ignoring the kIORegistryIterateRecursively option. + @discussion This method returns the next child, or parent if the kIORegistryIterateParents option was used to create the iterator, of the current root entry. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + @result The next registry entry in the iteration (the current entry), or zero if the iteration has finished at this level of recursion, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObjectFlat( void ); + +/*! @function getNextObjectRecursive + @abstract Return the next object in the registry iteration, and enter it. + @discussion If the iterator has a current entry, and the iterator has not already entered previously, enterEntry is called to recurse into it, ie. make it the new root, and the next child, or parent if the kIORegistryIterateParents option was used to create the iterator, at this new level of recursion is returned. If there is no current entry at this level of recursion, exitEntry is called and the process repeats, until the iteration returns to the entry the iterator was created with and zero is returned. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + @result The next registry entry in the iteration (the current entry), or zero if its finished, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObjectRecursive( void ); + +/*! @function getCurrentEntry + @abstract Return the current entry in the registry iteration. + @discussion This method returns the current entry, last returned by getNextObject et al. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. If the iteration is no longer valid (see isValid), the current entry is zero. + @result The current registry entry in the iteration, or zero if the last iteration returned zero, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getCurrentEntry( void ); + +/*! @function enterEntry + @abstract Recurse into the current entry in the registry iteration. + @discussion This method makes the current entry, ie. the last entry returned by getNextObject et al., the root in a new level of recursion. */ + + virtual void enterEntry( void ); + +/*! @function enterEntry + @abstract Recurse into the current entry in the registry iteration. + @discussion This method recurses into an entry as with enterEntry, but also switches from the current plane to a new one set by the caller. + @param plane The new plane to switch into. */ + + virtual void enterEntry( const IORegistryPlane * plane ); + +/*! @function exitEntry + @abstract Exits a level of recursion, restoring the current entry. + @discussion This method undoes an enterEntry, restoring the current entry. If there are no more levels of recursion to exit false is returned, otherwise true is returned. + @result true if a level of recursion was undone, false if no recursive levels are left in the iteration. */ + + virtual bool exitEntry( void ); + +/*! @function reset + @abstract Exits all levels of recursion, restoring the iterator to its state at creation. + @discussion This method exits all levels of recursion, and restores the iterator to its state at creation. */ + + virtual void reset( void ); + +/*! @function isValid + @abstract Checks that no registry changes have invalidated the iteration. + @discussion If a registry iteration is invalidated by changes to the registry, it will be made invalid, the currentEntry will be considered zero, and further calls to getNextObject et al. will return zero. The iterator should be reset to restart the iteration when this happens. + @result false if the iterator has been invalidated by changes to the registry, true otherwise. */ + + virtual bool isValid( void ); + +/*! @function iterateAll + @abstract Iterates all entries (with getNextObject) and returns a set of all returned entries. + @discussion This method will reset, then iterate all entries in the iteration (with getNextObject) until successful (ie. the iterator is valid at the end of the iteration). + @result A set of entries returned by the iteration. The caller should release the set when it has finished with it. Zero is returned on a resource failure. */ + + virtual OSOrderedSet * iterateAll( void ); +}; + +#endif /* _IOKIT_IOREGISTRYENTRY_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOReturn.h.svn-base b/i386/include/IOKit/.svn/text-base/IOReturn.h.svn-base new file mode 100644 index 0000000..38811b6 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOReturn.h.svn-base @@ -0,0 +1,137 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * HISTORY + */ + +/* + * Core IOReturn values. Others may be family defined. + */ + +#ifndef __IOKIT_IORETURN_H +#define __IOKIT_IORETURN_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef kern_return_t IOReturn; + +#ifndef sys_iokit +#define sys_iokit err_system(0x38) +#endif /* sys_iokit */ +#define sub_iokit_common err_sub(0) +#define sub_iokit_usb err_sub(1) +#define sub_iokit_firewire err_sub(2) +#define sub_iokit_block_storage err_sub(4) +#define sub_iokit_graphics err_sub(5) +#define sub_iokit_networking err_sub(6) +#define sub_iokit_bluetooth err_sub(8) +#define sub_iokit_pmu err_sub(9) +#define sub_iokit_acpi err_sub(10) +#define sub_iokit_smbus err_sub(11) +#define sub_iokit_ahci err_sub(12) +#define sub_iokit_powermanagement err_sub(13) +//#define sub_iokit_hidsystem err_sub(14) +#define sub_iokit_scsi err_sub(16) +//#define sub_iokit_pccard err_sub(21) + +#define sub_iokit_vendor_specific err_sub(-2) +#define sub_iokit_reserved err_sub(-1) + +#define iokit_common_err(return) (sys_iokit|sub_iokit_common|return) +#define iokit_family_err(sub,return) (sys_iokit|sub|return) +#define iokit_vendor_specific_err(return) (sys_iokit|sub_iokit_vendor_specific|return) + +#define kIOReturnSuccess KERN_SUCCESS // OK +#define kIOReturnError iokit_common_err(0x2bc) // general error +#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory +#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage +#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC +#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device +#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation +#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument +#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked +#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked +#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and + // device already open +#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages + // had different msg_id +#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function +#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure +#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error +#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error +//#define kIOReturn???Error iokit_common_err(0x2cb) // ??? +#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock +#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open +#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported +#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported +#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error +#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error +#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open +#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure +#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure +#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy +#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout +#define kIOReturnOffline iokit_common_err(0x2d7) // device offline +#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready +#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached +#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left +#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data +//#define kIOReturn???Error iokit_common_err(0x2dc) // ??? +#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists +#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down + // physical memory +#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached +#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued +#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received + // on interrupt port +#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted +#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device +#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present +#define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted +#define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode +#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun +#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun +#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly! +#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required +#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted +#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded +#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding +#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past! +#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future +#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found +#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IORETURN_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOService.h.svn-base b/i386/include/IOKit/.svn/text-base/IOService.h.svn-base new file mode 100644 index 0000000..a965ea1 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOService.h.svn-base @@ -0,0 +1,1690 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998,1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ +/*! + @header + This header contains the definition of the IOService class. IOService is the sole direct subclass of IORegistryEntry and is the base class of almost all I/O Kit family superclasses. IOService defines methods that support the life cycle of I/O Kit drivers. For more information on IOService, see {@linkdoc //apple_ref/doc/uid/TP0000011 I/O Kit Fundamentals}. + + @seealso //apple_ref/doc/header/IORegistryEntry.h IORegistryEntry +*/ + +#ifndef _IOKIT_IOSERVICE_H +#define _IOKIT_IOSERVICE_H + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +extern "C" { +#include +} + +#ifndef UINT64_MAX +#define UINT64_MAX 18446744073709551615ULL +#endif + +enum { + kIODefaultProbeScore = 0 +}; + +// masks for getState() +enum { + kIOServiceInactiveState = 0x00000001, + kIOServiceRegisteredState = 0x00000002, + kIOServiceMatchedState = 0x00000004, + kIOServiceFirstPublishState = 0x00000008, + kIOServiceFirstMatchState = 0x00000010 +}; + +enum { + // options for registerService() + kIOServiceExclusive = 0x00000001, + + // options for terminate() + kIOServiceRequired = 0x00000001, + kIOServiceTerminate = 0x00000004, + + // options for registerService() & terminate() + kIOServiceSynchronous = 0x00000002, + // options for registerService() + kIOServiceAsynchronous = 0x00000008 +}; + +// options for open() +enum { + kIOServiceSeize = 0x00000001, + kIOServiceFamilyOpenOptions = 0xffff0000 +}; + +// options for close() +enum { + kIOServiceFamilyCloseOptions = 0xffff0000 +}; + +typedef void * IONotificationRef; + +extern const IORegistryPlane * gIOServicePlane; +extern const IORegistryPlane * gIOPowerPlane; + +extern const OSSymbol * gIOResourcesKey; +extern const OSSymbol * gIOResourceMatchKey; +extern const OSSymbol * gIOProviderClassKey; +extern const OSSymbol * gIONameMatchKey; +extern const OSSymbol * gIONameMatchedKey; +extern const OSSymbol * gIOPropertyMatchKey; +extern const OSSymbol * gIOLocationMatchKey; +extern const OSSymbol * gIOParentMatchKey; +extern const OSSymbol * gIOPathMatchKey; +extern const OSSymbol * gIOMatchCategoryKey; +extern const OSSymbol * gIODefaultMatchCategoryKey; +extern const OSSymbol * gIOMatchedServiceCountKey; + +extern const OSSymbol * gIOUserClientClassKey; +extern const OSSymbol * gIOKitDebugKey; +extern const OSSymbol * gIOServiceKey; + +extern const OSSymbol * gIOCommandPoolSizeKey; + +extern const OSSymbol * gIOPublishNotification; +extern const OSSymbol * gIOFirstPublishNotification; +extern const OSSymbol * gIOMatchedNotification; +extern const OSSymbol * gIOFirstMatchNotification; +extern const OSSymbol * gIOTerminatedNotification; + +extern const OSSymbol * gIOGeneralInterest; +extern const OSSymbol * gIOBusyInterest; +extern const OSSymbol * gIOOpenInterest; +extern const OSSymbol * gIOAppPowerStateInterest; +extern const OSSymbol * gIOPriorityPowerStateInterest; + +extern const OSSymbol * gIODeviceMemoryKey; +extern const OSSymbol * gIOInterruptControllersKey; +extern const OSSymbol * gIOInterruptSpecifiersKey; + +extern SInt32 IOServiceOrdering( const OSMetaClassBase * inObj1, const OSMetaClassBase * inObj2, void * ref ); + +typedef void (*IOInterruptAction)( OSObject * target, void * refCon, + IOService * nub, int source ); + +/*! @typedef IOServiceNotificationHandler + @param target Reference supplied when the notification was registered. + @param refCon Reference constant supplied when the notification was registered. + @param newService The IOService object the notification is delivering. It is retained for the duration of the handler's invocation and doesn't need to be released by the handler. */ + +typedef bool (*IOServiceNotificationHandler)( void * target, void * refCon, + IOService * newService ); + +typedef bool (*IOServiceMatchingNotificationHandler)( void * target, void * refCon, + IOService * newService, + IONotifier * notifier ); + +/*! @typedef IOServiceInterestHandler + @param target Reference supplied when the notification was registered. + @param refCon Reference constant supplied when the notification was registered. + @param messageType Type of the message - IOKit defined in IOKit/IOMessage.h or family specific. + @param provider The IOService object who is delivering the notification. It is retained for the duration of the handler's invocation and doesn't need to be released by the handler. + @param messageArgument An argument for message, dependent on its type. + @param argSize Non zero if the argument represents a struct of that size, used when delivering messages outside the kernel. */ + +typedef IOReturn (*IOServiceInterestHandler)( void * target, void * refCon, + UInt32 messageType, IOService * provider, + void * messageArgument, vm_size_t argSize ); + +typedef void (*IOServiceApplierFunction)(IOService * service, void * context); +typedef void (*OSObjectApplierFunction)(OSObject * object, void * context); + +class IOUserClient; +class IOPlatformExpert; + +/*! @class IOService + @abstract The base class for most I/O Kit families, devices, and drivers. + @discussion The IOService base class defines APIs used to publish services, instantiate other services based on the existance of a providing service (ie. driver stacking), destroy a service and its dependent stack, notify interested parties of service state changes, and general utility functions useful across all families. + +Types of service are specified with a matching dictionary that describes properties of the service. For example, a matching dictionary might describe any IOUSBDevice (or subclass), an IOUSBDevice with a certain class code, or a IOPCIDevice with a set of OpenFirmware matching names or device & vendor IDs. Since the matching dictionary is interpreted by the family which created the service, as well as generically by IOService, the list of properties considered for matching depends on the familiy. + +Matching dictionaries are associated with IOService classes by the catalogue, as driver property tables, and also supplied by clients of the notification APIs. + +IOService provides matching based on C++ class (via OSMetaClass dynamic casting), registry entry name, a registry path to the service (which includes OpenFirmware paths), a name assigned by BSD, or by its location (its point of attachment). + +

Driver Instantiation by IOService

+ +Drivers are subclasses of IOService, and their availability is managed through the catalogue. They are instantiated based on the publication of an IOService they use (for example, an IOPCIDevice or IOUSBDevice), or when they are added to the catalogue and the IOService(s) they use are already available. + +When an IOService (the "provider") is published with the @link registerService registerService@/link method, the matching and probing process begins, which is always single threaded per provider. A list of matching dictionaries from the catalog and installed publish notification requests, that successfully match the IOService, is constructed, with ordering supplied by kIOProbeScoreKey ("IOProbeScore") property in the dictionary, or supplied with the notification. + +Each entry in the list is then processed in order - for notifications, the notification is delivered, for driver property tables a lot more happens. + +The driver class is instantiated and init() called with its property table. The new driver instance is then attached to the provider, and has its @link probe probe@/link method called with the provider as an argument. The default probe method does nothing but return success, but a driver may implement this method to interrogate the provider to make sure it can work with it. It may also modify its probe score at this time. After probe, the driver is detached and the next in the list is considered (ie. attached, probed, and detached). + +When the probing phase is complete, the list consists of successfully probed drivers, in order of their probe score (after adjustment during the @link probe probe@/link call). The list is then divided into categories based on the kIOMatchCategoryKey property ("IOMatchCategory"); drivers without a match category are all considered in one default category. Match categories allow multiple clients of a provider to be attached and started, though the provider may also enforce open/close semantics to gain active access to it. + +For each category, the highest scoring driver in that category is attached to the provider, and its @link start start@/link method called. If start is successful, the rest of the drivers in the same match category are discarded, otherwise the next highest scoring driver is started, and so on. + +The driver should only consider itself in action when the start method is called, meaning it has been selected for use on the provider, and consuming that particular match category. It should also be prepared to be allocated, probed and freed even if the probe was successful. + +After the drivers have all synchronously been started, the installed "matched" notifications that match the registered IOService are delivered. + +

Properties used by IOService

+ + kIOClassKey, extern const OSSymbol * gIOClassKey, "IOClass" +
+
+Class of the driver to instantiate on matching providers. +
+
+ kIOProviderClassKey, extern const OSSymbol * gIOProviderClassKey, "IOProviderClass" +
+
+Class of the provider(s) to be considered for matching, checked with OSDynamicCast so subclasses will also match. +
+
+ kIOProbeScoreKey, extern const OSSymbol * gIOProbeScoreKey, "IOProbeScore" +
+
+The probe score initially used to order multiple matching drivers. +
+
+ kIOMatchCategoryKey, extern const OSSymbol * gIOMatchCategoryKey, "IOMatchCategory" +
+
+A string defining the driver category for matching purposes. All drivers with no IOMatchCategory property are considered to be in the same default category. Only one driver in a category can be started on each provider. +
+
+ kIONameMatchKey, extern const OSSymbol * gIONameMatchKey, "IONameMatch" +
+A string or collection of strings that match the provider's name. The comparison is implemented with the @link //apple_ref/cpp/instm/IORegistryEntry/compareNames/virtualbool/(OSObject*,OSString**) IORegistryEntry::compareNames@/link method, which supports a single string, or any collection (OSArray, OSSet, OSDictionary etc.) of strings. IOService objects with OpenFirmware device tree properties (eg. IOPCIDevice) will also be matched based on that standard's "compatible", "name", "device_type" properties. The matching name will be left in the driver's property table in the kIONameMatchedKey property. +
+Examples +

+@textblock
+	IONameMatch
+	pci106b,7
+@/textblock
+
+ +For a list of possible matching names, a serialized array of strings should used, eg. +
+@textblock
+	IONameMatch
+	
+		APPL,happy16
+		pci106b,7
+	
+@/textblock
+
+ +
+ kIONameMatchedKey, extern const OSSymbol * gIONameMatchedKey, "IONameMatched" +
+The name successfully matched name from the kIONameMatchKey property will be left in the driver's property table as the kIONameMatchedKey property. +
+
+ kIOPropertyMatchKey, extern const OSSymbol * gIOPropertyMatchKey, "IOPropertyMatch" +
+A dictionary of properties that each must exist in the matching IOService and compare successfully with the isEqualTo method. + +
+@textblock
+	IOPropertyMatch
+	
+		APPL,happy16
+		APPL,meek8
+	
+@/textblock
+
+ +
+ kIOUserClientClassKey, extern const OSSymbol * gIOUserClientClassKey, "IOUserClientClass" +
+The class name that the service will attempt to allocate when a user client connection is requested. First the device nub is queried, then the nub's provider is queried by default. +
+
+ kIOKitDebugKey, extern const OSSymbol * gIOKitDebugKey, "IOKitDebug" +
+Set some debug flags for logging the driver loading process. Flags are defined in IOKit/IOKitDebug.h, but 65535 works well.*/ + +class IOService : public IORegistryEntry +{ + OSDeclareDefaultStructors(IOService) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + IOService * __provider; + SInt32 __providerGeneration; + IOService * __owner; + IOOptionBits __state[2]; + uint64_t __timeBusy; + uint64_t __accumBusy; + IOServicePM * pwrMgt; + +protected: + // TRUE once PMinit has been called + bool initialized; + +public: + // DEPRECATED + void * pm_vars; + +public: + /* methods available in Mac OS X 10.1 or later */ +/*! @function requestTerminate + @abstract Passes a termination up the stack. + @discussion When an IOService is made inactive the default behavior is to also make any of its clients that have it as their only provider also inactive, in this way recursing the termination up the driver stack. This method allows an IOService object to override this behavior. Returning true from this method when passed a just terminated provider will cause the client to also be terminated. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate, plus kIOServiceRecursing. + @result true if this object should be terminated now that its provider has been. */ + + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + +/*! @function willTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent before recursing up the stack, in root-to-leaf order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate. + @result true. */ + + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + +/*! @function didTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent after recursing up the stack, in leaf-to-root order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate. + @param defer If there is pending I/O that requires this object to persist, and the provider is not opened by this object set defer to true and call the IOService::didTerminate() implementation when the I/O completes. Otherwise, leave defer set to its default value of false. + @result true. */ + + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + +/*! @function nextIdleTimeout + @availability Mac OS X v10.4 and later + @abstract Allows subclasses to customize idle power management behavior. + @discussion Returns the next time that the device should idle into its next lower power state. Subclasses may override for custom idle behavior. + + A power managed driver might override this method to provide a more sophisticated idle power off algorithm than the one defined by power management. + @param currentTime The current time + @param lastActivity The time of last activity on this device + @param powerState The device's current power state. + @result Returns the next time the device should idle off (in seconds, relative to the current time). */ + + virtual SInt32 nextIdleTimeout(AbsoluteTime currentTime, + AbsoluteTime lastActivity, unsigned int powerState); + +/*! @function systemWillShutdown + @availability Mac OS X v10.5 and later + @abstract Notifies members of the power plane of system shutdown and restart. + @discussion This function is called for all members of the power plane in leaf-to-root order. If a subclass needs to wait for a pending I/O, then the call to systemWillShutdown should be postponed until the I/O completes. + + Any power managed driver (which has called @link joinPMtree joinPMtree@/link to join the power plane) interested in taking action at system shutdown or restart should override this method. + @param specifier kIOMessageSystemWillPowerOff or kIOMessageSystemWillRestart. */ + + virtual void systemWillShutdown( IOOptionBits specifier ); + +/*! @function copyClientWithCategory + @availability Mac OS X v10.6 and later + @param category An OSSymbol corresponding to an IOMatchCategory matching property. + @result Returns a reference to the IOService child with the given category. The result should be released by the caller. +*/ + + virtual IOService * copyClientWithCategory( const OSSymbol * category ); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOService, 0); + OSMetaClassDeclareReservedUnused(IOService, 1); + OSMetaClassDeclareReservedUnused(IOService, 2); + OSMetaClassDeclareReservedUnused(IOService, 3); + OSMetaClassDeclareReservedUnused(IOService, 4); + OSMetaClassDeclareReservedUnused(IOService, 5); +#else + OSMetaClassDeclareReservedUsed(IOService, 0); + OSMetaClassDeclareReservedUsed(IOService, 1); + OSMetaClassDeclareReservedUsed(IOService, 2); + OSMetaClassDeclareReservedUsed(IOService, 3); + OSMetaClassDeclareReservedUsed(IOService, 4); + OSMetaClassDeclareReservedUsed(IOService, 5); +#endif + + OSMetaClassDeclareReservedUnused(IOService, 6); + OSMetaClassDeclareReservedUnused(IOService, 7); + OSMetaClassDeclareReservedUnused(IOService, 8); + OSMetaClassDeclareReservedUnused(IOService, 9); + OSMetaClassDeclareReservedUnused(IOService, 10); + OSMetaClassDeclareReservedUnused(IOService, 11); + OSMetaClassDeclareReservedUnused(IOService, 12); + OSMetaClassDeclareReservedUnused(IOService, 13); + OSMetaClassDeclareReservedUnused(IOService, 14); + OSMetaClassDeclareReservedUnused(IOService, 15); + OSMetaClassDeclareReservedUnused(IOService, 16); + OSMetaClassDeclareReservedUnused(IOService, 17); + OSMetaClassDeclareReservedUnused(IOService, 18); + OSMetaClassDeclareReservedUnused(IOService, 19); + OSMetaClassDeclareReservedUnused(IOService, 20); + OSMetaClassDeclareReservedUnused(IOService, 21); + OSMetaClassDeclareReservedUnused(IOService, 22); + OSMetaClassDeclareReservedUnused(IOService, 23); + OSMetaClassDeclareReservedUnused(IOService, 24); + OSMetaClassDeclareReservedUnused(IOService, 25); + OSMetaClassDeclareReservedUnused(IOService, 26); + OSMetaClassDeclareReservedUnused(IOService, 27); + OSMetaClassDeclareReservedUnused(IOService, 28); + OSMetaClassDeclareReservedUnused(IOService, 29); + OSMetaClassDeclareReservedUnused(IOService, 30); + OSMetaClassDeclareReservedUnused(IOService, 31); + OSMetaClassDeclareReservedUnused(IOService, 32); + OSMetaClassDeclareReservedUnused(IOService, 33); + OSMetaClassDeclareReservedUnused(IOService, 34); + OSMetaClassDeclareReservedUnused(IOService, 35); + OSMetaClassDeclareReservedUnused(IOService, 36); + OSMetaClassDeclareReservedUnused(IOService, 37); + OSMetaClassDeclareReservedUnused(IOService, 38); + OSMetaClassDeclareReservedUnused(IOService, 39); + OSMetaClassDeclareReservedUnused(IOService, 40); + OSMetaClassDeclareReservedUnused(IOService, 41); + OSMetaClassDeclareReservedUnused(IOService, 42); + OSMetaClassDeclareReservedUnused(IOService, 43); + OSMetaClassDeclareReservedUnused(IOService, 44); + OSMetaClassDeclareReservedUnused(IOService, 45); + OSMetaClassDeclareReservedUnused(IOService, 46); + OSMetaClassDeclareReservedUnused(IOService, 47); + +#ifdef __ppc__ + OSMetaClassDeclareReservedUnused(IOService, 48); + OSMetaClassDeclareReservedUnused(IOService, 49); + OSMetaClassDeclareReservedUnused(IOService, 50); + OSMetaClassDeclareReservedUnused(IOService, 51); + OSMetaClassDeclareReservedUnused(IOService, 52); + OSMetaClassDeclareReservedUnused(IOService, 53); + OSMetaClassDeclareReservedUnused(IOService, 54); + OSMetaClassDeclareReservedUnused(IOService, 55); + OSMetaClassDeclareReservedUnused(IOService, 56); + OSMetaClassDeclareReservedUnused(IOService, 57); + OSMetaClassDeclareReservedUnused(IOService, 58); + OSMetaClassDeclareReservedUnused(IOService, 59); + OSMetaClassDeclareReservedUnused(IOService, 60); + OSMetaClassDeclareReservedUnused(IOService, 61); + OSMetaClassDeclareReservedUnused(IOService, 62); + OSMetaClassDeclareReservedUnused(IOService, 63); +#endif + +public: +/*! @function getState + @abstract Accessor for IOService state bits, not normally needed or used outside IOService. + @result State bits for the IOService, eg. kIOServiceInactiveState, kIOServiceRegisteredState. */ + + virtual IOOptionBits getState( void ) const; + +/*! @function isInactive + @abstract Checks if the IOService object has been terminated, and is in the process of being destroyed. + @discussion When an IOService object is successfully terminated, it is immediately made inactive, which blocks further attach()es, matching or notifications occuring on the object. It remains inactive until the last client closes, and is then finalized and destroyed. + @result true if the IOService object has been terminated. */ + + bool isInactive( void ) const; + + /* Stack creation */ + +/*! @function registerService + @abstract Starts the registration process for a newly discovered IOService object. + @discussion This function allows an IOService subclass to be published and made available to possible clients, by starting the registration process and delivering notifications to registered clients. The object should be completely setup and ready to field requests from clients before registerService is called. + @param options The default zero options mask is recommended and should be used in most cases. The registration process is usually asynchronous, with possible driver probing and notification occurring some time later. kIOServiceSynchronous may be passed to carry out the matching and notification process for currently registered clients before returning to the caller. */ + + virtual void registerService( IOOptionBits options = 0 ); + +/*! @function probe + @abstract During an IOService object's instantiation, probes a matched service to see if it can be used. + @discussion The registration process for an IOService object (the provider) includes instantiating possible driver clients. The probe method is called in the client instance to check the matched service can be used before the driver is considered to be started. Since matching screens many possible providers, in many cases the probe method can be left unimplemented by IOService subclasses. The client is already attached to the provider when probe is called. + @param provider The registered IOService object that matches a driver personality's matching dictionary. + @param score Pointer to the current driver's probe score, which is used to order multiple matching drivers in the same match category. It defaults to the value of the IOProbeScore property in the drivers property table, or kIODefaultProbeScore if none is specified. The probe method may alter the score to affect start order. + @result An IOService instance or zero when the probe is unsuccessful. In almost all cases the value of this is returned on success. If another IOService object is returned, the probed instance is detached and freed, and the returned instance is used in its stead for start. */ + + virtual IOService * probe( IOService * provider, + SInt32 * score ); + +/*! @function start + @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + @discussion The start method of an IOService instance is called by its provider when it has been selected (due to its probe score and match category) as the winning client. The client is already attached to the provider when start is called.
Implementations of start must call start on their superclass at an appropriate point. If an implementation of start has already called super::start but subsequently determines that it will fail, it must call super::stop to balance the prior call to super::start and prevent reference leaks. + @result true if the start was successful; false otherwise (which will cause the instance to be detached and usually freed). */ + + virtual bool start( IOService * provider ); + +/*! @function stop + @abstract During an IOService termination, the stop method is called in its clients before they are detached & it is destroyed. + @discussion The termination process for an IOService (the provider) will call stop in each of its clients, after they have closed the provider if they had it open, or immediately on termination. */ + + virtual void stop( IOService * provider ); + + /* Open / Close */ + +/*! @function open + @abstract Requests active access to a provider. + @discussion IOService provides generic open and close semantics to track clients of a provider that have established an active datapath. The use of open and @link close close@/link, and rules regarding ownership are family defined, and defined by the @link handleOpen handleOpen@/link and @link handleClose handleClose@/link methods in the provider. Some families will limit access to a provider based on its open state. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open. The provider family may implement options for open; IOService defines only kIOServiceSeize to request the device be withdrawn from its current owner. + @result true if the open was successful; false otherwise. */ + + virtual bool open( IOService * forClient, + IOOptionBits options = 0, + void * arg = 0 ); + +/*! @function close + @abstract Releases active access to a provider. + @discussion IOService provides generic open and close semantics to track clients of a provider that have established an active datapath. The use of @link open open@/link and close, and rules regarding ownership are family defined, and defined by the @link handleOpen handleOpen@/link and @link handleClose handleClose@/link methods in the provider. + @param forClient Designates the client of the provider requesting the close. + @param options Options available for the close. The provider family may implement options for close; IOService defines none. + @param arg Family specific arguments which are ignored by IOService. */ + + virtual void close( IOService * forClient, + IOOptionBits options = 0 ); + +/*! @function isOpen + @abstract Determines whether a specific, or any, client has an IOService object open. + @discussion Returns the open state of an IOService object with respect to the specified client, or when it is open by any client. + @param forClient If non-zero, open. The object is locked via @link lockForArbitration lockForArbitration@/link before handleOpen is called. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result trueif the open was successful; false otherwise. */ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + +/*! @function handleClose + @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + @discussion IOService calls this method in its subclasses in response to the @link close close@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via @link open open@/link. The object is locked via @link lockForArbitration lockForArbitration@/link before handleClose is called. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of @link handleOpen handleOpen@/link. */ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + +/*! @function handleIsOpen + @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + @discussion IOService calls this method in its subclasses in response to the @link open open@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via @link open open@/link. The object is locked via @link lockForArbitration lockForArbitration@/link before handleIsOpen is called. + @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + @result true if the specific, or any, client has the IOService object open. */ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + /* Stacking change */ + +/*! @function terminate + @abstract Makes an IOService object inactive and begins its destruction. + @discussion Registering an IOService object informs possible clients of its existance and instantiates drivers that may be used with it; terminate involves the opposite process of informing clients that an IOService object is no longer able to be used and will be destroyed. By default, if any client has the service open, terminate fails. If the kIOServiceRequired flag is passed however, terminate will be successful though further progress in the destruction of the IOService object will not proceed until the last client has closed it. The service will be made inactive immediately upon successful termination, and all its clients will be notified via their @link message message@/link method with a message of type kIOMessageServiceIsTerminated. Both these actions take place on the caller's thread. After the IOService object is made inactive, further matching or attach calls will fail on it. Each client has its @link stop stop@/link method called upon their close of an inactive IOService object , or on its termination if they do not have it open. After stop, @link detach detach@/link is called in each client. When all clients have been detached, the @link finalize finalize@/link method is called in the inactive service. The termination process is inherently asynchronous because it will be deferred until all clients have chosen to close. + @param options In most cases no options are needed. kIOServiceSynchronous may be passed to cause terminate to not return until the service is finalized. */ + + virtual bool terminate( IOOptionBits options = 0 ); + +/*! @function finalize + @abstract Finalizes the destruction of an IOService object. + @discussion The finalize method is called in an inactive (ie. terminated) IOService object after the last client has detached. IOService's implementation will call @link stop stop@/link, @link close close@/link, and @link detach detach@/link on each provider. When finalize returns, the object's retain count will have no references generated by IOService's registration process. + @param options The options passed to the @link terminate terminate@/link method of the IOService object are passed on to finalize. + @result true. */ + + virtual bool finalize( IOOptionBits options ); + +/*! @function free + @abstract Frees data structures that were allocated when power management was initialized on this service. */ + + virtual void free( void ); + +/*! @function lockForArbitration + @abstract Locks an IOService object against changes in state or ownership. + @discussion The registration, termination and open / close functions of IOService use lockForArbtration to single-thread access to an IOService object. lockForArbitration grants recursive access to the same thread. + @param isSuccessRequired If a request for access to an IOService object should be denied if it is terminated, pass false, otherwise pass true. */ + + virtual bool lockForArbitration( bool isSuccessRequired = true ); + +/*! @function unlockForArbitration + @abstract Unlocks an IOService obkect after a successful @link lockForArbitration lockForArbitration@/link. + @discussion A thread granted exclusive access to an IOService object should release it with unlockForArbitration. */ + + virtual void unlockForArbitration( void ); + +/*! @function terminateClient + @abstract Passes a termination up the stack. + @discussion When an IOService object is made inactive the default behavior is to also make any of its clients that have it as their only provider inactive, in this way recursing the termination up the driver stack. This method allows a terminated IOService object to override this behavior. Note the client may also override this behavior by overriding its @link terminate terminate@/link method. + @param client The client of the terminated provider. + @param options Options originally passed to @link terminate terminate@/link, plus kIOServiceRecursing. + @result result of the terminate request on the client. */ + + virtual bool terminateClient( IOService * client, IOOptionBits options ); + + /* Busy state indicates discovery, matching or termination is in progress */ + +/*! @function getBusyState + @abstract Returns the busyState of an IOService object. + @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService object, its busyState is increased by one. Change in busyState to or from zero also changes the IOService object's provider's busyState by one, which means that an IOService object is marked busy when any of the above activities is ocurring on it or any of its clients. + @result The busyState value. */ + + virtual UInt32 getBusyState( void ); + +/*! @function adjustBusy + @abstract Adjusts the busyState of an IOService object. + @discussion Applies a delta to an IOService object's busyState. A change in the busyState to or from zero will change the IOService object's provider's busyState by one (in the same direction). + @param delta The delta to be applied to the IOService object's busyState. */ + + virtual void adjustBusy( SInt32 delta ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn waitQuiet(mach_timespec_t * timeout) + APPLE_KEXT_DEPRECATED; + +/*! @function waitQuiet + @abstract Waits for an IOService object's busyState to be zero. + @discussion Blocks the caller until an IOService object is non busy. + @param timeout The maximum time to wait in nanoseconds. Default is to wait forever. + @result Returns an error code if Mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */ + + IOReturn waitQuiet(uint64_t timeout = UINT64_MAX); + + /* Matching */ + +/*! @function matchPropertyTable + @abstract Allows a registered IOService object to implement family specific matching. + @discussion All matching on an IOService object will call this method to allow a family writer to implement matching in addition to the generic methods provided by IOService. The implementer should examine the matching dictionary passed to see if it contains properties the family understands for matching, and use them to match with the IOService object if so. Note that since matching is also carried out by other parts of the I/O Kit, the matching dictionary may contain properties the family does not understand - these should not be considered matching failures. + @param table The dictionary of properties to be matched against. + @param score Pointer to the current driver's probe score, which is used to order multiple matching drivers in the same match category. It defaults to the value of the IOProbeScore property in the drivers property table, or kIODefaultProbeScore if none is specified. + @result false if the family considers the matching dictionary does not match in properties it understands; true otherwise. */ + + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + + virtual bool matchPropertyTable( OSDictionary * table ); + +/*! @function matchLocation + @abstract Allows a registered IOService object to direct location matching. + @discussion By default, a location matching property will be applied to an IOService object's provider. This method allows that behavior to be overridden by families. + @param client The IOService object at which matching is taking place. + @result Returns the IOService instance to be used for location matching. */ + + virtual IOService * matchLocation( IOService * client ); + + /* Resource service */ + +/*! @function publishResource + @abstract Uses the resource service to publish a property. + @discussion The resource service uses IOService's matching and notification to allow objects to be published and found by any I/O Kit client by a global name. publishResource makes an object available to anyone waiting for it or looking for it in the future. + @param key An OSSymbol key that globally identifies the object. + @param The object to be published. */ + + static void publishResource( const OSSymbol * key, OSObject * value = 0 ); + +/*! @function publishResource + @abstract Uses the resource service to publish a property. + @discussion The resource service uses IOService object's matching and notification to allow objects to be published and found by any I/O Kit client by a global name. publishResource makes an object available to anyone waiting for it or looking for it in the future. + @param key A C string key that globally identifies the object. + @param The object to be published. */ + + static void publishResource( const char * key, OSObject * value = 0 ); + virtual bool addNeededResource( const char * key ); + + /* Notifications */ + +/*! @function addNotification + @abstract Deprecated use addMatchingNotification(). Adds a persistant notification handler to be notified of IOService events. + @discussion IOService will deliver notifications of changes in state of an IOService object to registered clients. The type of notification is specified by a symbol, for example gIOMatchedNotification or gIOTerminatedNotification, and notifications will only include IOService objects that match the supplied matching dictionary. Notifications are ordered by a priority set with addNotification. When the notification is installed, its handler will be called with each of any currently existing IOService objects that are in the correct state (eg. registered) and match the supplied matching dictionary, avoiding races between finding preexisting and new IOService events. The notification request is identified by an instance of an IONotifier object, through which it can be enabled, disabled, or removed. addNotification consumes a retain count on the matching dictionary when the notification is removed. + @param type An OSSymbol identifying the type of notification and IOService state: +
gIOPublishNotification Delivered when an IOService object is registered. +
gIOFirstPublishNotification Delivered when an IOService object is registered, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOMatchedNotification Delivered when an IOService object has been matched with all client drivers, and they have been probed and started. +
gIOFirstMatchNotification Delivered when an IOService object has been matched with all client drivers, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOTerminatedNotification Delivered after an IOService object has been terminated, during its finalize stage. + @param matching A matching dictionary to restrict notifications to only matching IOService objects. The dictionary will be released when the notification is removed, consuming the passed-in reference. + @param handler A C function callback to deliver notifications. + @param target An instance reference for the callback's use. + @param ref A reference constant for the callback's use. + @param priority A constant ordering all notifications of a each type. + @result An instance of an IONotifier object that can be used to control or destroy the notification request. */ + + static IONotifier * addNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceNotificationHandler handler, + void * target, void * ref = 0, + SInt32 priority = 0 ) + APPLE_KEXT_DEPRECATED; + +/*! @function addMatchingNotification + @abstract Adds a persistant notification handler to be notified of IOService events. + @discussion IOService will deliver notifications of changes in state of an IOService object to registered clients. The type of notification is specified by a symbol, for example gIOMatchedNotification or gIOTerminatedNotification, and notifications will only include IOService objects that match the supplied matching dictionary. Notifications are ordered by a priority set with addNotification. When the notification is installed, its handler will be called with each of any currently existing IOService objects that are in the correct state (eg. registered) and match the supplied matching dictionary, avoiding races between finding preexisting and new IOService events. The notification request is identified by an instance of an IONotifier object, through which it can be enabled, disabled, or removed. addMatchingNotification does not consume a reference on the matching dictionary when the notification is removed, unlike addNotification. + @param type An OSSymbol identifying the type of notification and IOService state: +
gIOPublishNotification Delivered when an IOService object is registered. +
gIOFirstPublishNotification Delivered when an IOService object is registered, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOMatchedNotification Delivered when an IOService object has been matched with all client drivers, and they have been probed and started. +
gIOFirstMatchNotification Delivered when an IOService object has been matched with all client drivers, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOTerminatedNotification Delivered after an IOService object has been terminated, during its finalize stage. + @param matching A matching dictionary to restrict notifications to only matching IOService objects. The dictionary is retained while the notification is installed. (Differs from addNotification). + @param handler A C function callback to deliver notifications. + @param target An instance reference for the callback's use. + @param ref A reference constant for the callback's use. + @param priority A constant ordering all notifications of a each type. + @result An instance of an IONotifier object that can be used to control or destroy the notification request. */ + + static IONotifier * addMatchingNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref = 0, + SInt32 priority = 0 ); + +/*! @function waitForService + @abstract Deprecated use waitForMatchingService(). Waits for a matching to service to be published. + @discussion Provides a method of waiting for an IOService object matching the supplied matching dictionary to be registered and fully matched. + @param matching The matching dictionary describing the desired IOService object. waitForService consumes one reference of the matching dictionary. + @param timeout The maximum time to wait. + @result A published IOService object matching the supplied dictionary. */ + + static IOService * waitForService( OSDictionary * matching, + mach_timespec_t * timeout = 0); + +/*! @function waitForMatchingService + @abstract Waits for a matching to service to be published. + @discussion Provides a method of waiting for an IOService object matching the supplied matching dictionary to be registered and fully matched. + @param matching The matching dictionary describing the desired IOService object. (Does not consume a reference of the matching dictionary - differs from waitForService() which does consume a reference on the matching dictionary.) + @param timeout The maximum time to wait in nanoseconds. Default is to wait forever. + @result A published IOService object matching the supplied dictionary. waitForMatchingService returns a reference to the IOService which should be released by the caller. (Differs from waitForService() which does not retain the returned object.) */ + + static IOService * waitForMatchingService( OSDictionary * matching, + uint64_t timeout = UINT64_MAX); + +/*! @function getMatchingServices + @abstract Finds the set of current published IOService objects matching a matching dictionary. + @discussion Provides a method of finding the current set of published IOService objects matching the supplied matching dictionary. + @param matching The matching dictionary describing the desired IOService objects. + @result An instance of an iterator over a set of IOService objects. To be released by the caller. */ + + static OSIterator * getMatchingServices( OSDictionary * matching ); + +public: + /* Helpers to make matching dictionaries for simple cases, + * they add keys to an existing dictionary, or create one. */ + +/*! @function serviceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService class match. + @discussion A very common matching criteria for IOService object is based on its class. serviceMatching creates a matching dictionary that specifies any IOService object of a class, or its subclasses. The class is specified by name, and an existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param className The class name, as a const C string. Class matching is successful on IOService objects of this class or any subclass. + @param table If zero, serviceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * serviceMatching( const char * className, + OSDictionary * table = 0 ); + +/*! @function serviceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService class match. + @discussion A very common matching criteria for IOService object is based on its class. serviceMatching creates a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by name, and an existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param className The class name, as an OSString (which includes OSSymbol). Class matching is successful on IOService objects of this class or any subclass. + @param table If zero, serviceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * serviceMatching( const OSString * className, + OSDictionary * table = 0 ); + +/*! @function nameMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService name match. + @discussion A very common matching criteria for IOService object is based on its name. nameMatching creates a matching dictionary that specifies any IOService object which responds successfully to the @link //apple_ref/cpp/instm/IORegistryEntry/compareName/virtualbool/(OSString*,OSString**) IORegistryEntry::compareName@/link method. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param name The service's name, as a const C string. Name matching is successful on IOService objects that respond successfully to the IORegistryEntry::compareName method. + @param table If zero, nameMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * nameMatching( const char * name, + OSDictionary * table = 0 ); + +/*! @function nameMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService name match. + @discussion A very common matching criteria for IOService object is based on its name. nameMatching creates a matching dictionary that specifies any IOService object which responds successfully to the @link //apple_ref/cpp/instm/IORegistryEntry/compareName/virtualbool/(OSString*,OSString**) IORegistryEntry::compareName@/link method. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param name The service's name, as an OSString (which includes OSSymbol). Name matching is successful on IOService objects that respond successfully to the IORegistryEntry::compareName method. + @param table If zero, nameMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * nameMatching( const OSString* name, + OSDictionary * table = 0 ); + +/*! @function resourceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a resource service match. + @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + @param name The resource name, as a const C string. Resource matching is successful when an object by that name has been published with the publishResource method. + @param table If zero, resourceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * resourceMatching( const char * name, + OSDictionary * table = 0 ); + +/*! @function resourceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a resource service match. + @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + @param name The resource name, as an OSString (which includes OSSymbol). Resource matching is successful when an object by that name has been published with the publishResource method. + @param table If zero, resourceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * resourceMatching( const OSString * name, + OSDictionary * table = 0 ); + + +/*! @function propertyMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService phandle match. + @discussion TODO A very common matching criteria for IOService is based on its name. nameMatching will create a matching dictionary that specifies any IOService which respond successfully to the IORegistryEntry method compareName. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param key The service's phandle, as a const UInt32. PHandle matching is successful on IOService objects that respond successfully to the IORegistryEntry method compareName. + @param value The service's phandle, as a const UInt32. PHandle matching is successful on IOService's which respond successfully to the IORegistryEntry method compareName. + @param table If zero, nameMatching will create a matching dictionary and return a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * propertyMatching( const OSSymbol * key, const OSObject * value, + OSDictionary * table = 0 ); + +/*! @function registryEntryIDMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a IORegistryEntryID match. + @discussion registryEntryIDMatching creates a matching dictionary that specifies the IOService object with the assigned registry entry ID (returned by IORegistryEntry::getRegistryEntryID()). An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param name The service's ID. Matching is successful on the IOService object that return that ID from the IORegistryEntry::getRegistryEntryID() method. + @param table If zero, registryEntryIDMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * registryEntryIDMatching( uint64_t entryID, + OSDictionary * table = 0 ); + + +/*! @function addLocation + @abstract Adds a location matching property to an existing dictionary. + @discussion This function creates matching properties that specify the location of a IOService object, as an embedded matching dictionary. This matching will be successful on an IOService object that attached to an IOService object which matches this location matching dictionary. + @param table The matching properties are added to the specified dictionary, which must be non-zero. + @result The location matching dictionary created is returned on success, or zero on failure. */ + + static OSDictionary * addLocation( OSDictionary * table ); + + /* Helpers for matching dictionaries. */ + +/*! @function compareProperty + @abstract Compares a property in a matching dictionary with an IOService object's property table. + @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. If the property specified by key exists in the matching dictionary, it is compared with a property of the same name in the IOService object's property table. The comparison is performed with the isEqualTo method. If the property does not exist in the matching table, success is returned. If the property exists in the matching dictionary but not the IOService property table, failure is returned. + @param matching The matching dictionary, which must be non-zero. + @param key The dictionary key specifying the property to be compared, as a C string. + @result true if the property does not exist in the matching table. If the property exists in the matching dictionary but not the IOService property table, failure is returned. Otherwise the result of calling the property from the matching dictionary's isEqualTo method with the IOService property as an argument is returned. */ + + virtual bool compareProperty( OSDictionary * matching, + const char * key ); +/*! @function compareProperty + @abstract Compares a property in a matching dictionary with an IOService object's property table. + @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. If the property specified by key exists in the matching dictionary, it is compared with a property of the same name in the IOService object's property table. The comparison is performed with the isEqualTo method. If the property does not exist in the matching table, success is returned. If the property exists in the matching dictionary but not the IOService property table, failure is returned. + @param matching The matching dictionary, which must be non-zero. + @param key The dictionary key specifying the property to be compared, as an OSString (which includes OSSymbol). + @result true if the property does not exist in the matching table. If the property exists in the matching dictionary but not the IOService property table, failure is returned. Otherwise the result of calling the property from the matching dictionary's isEqualTo method with the IOService property as an argument is returned. */ + + virtual bool compareProperty( OSDictionary * matching, + const OSString * key ); + +/*! @function compareProperties + @abstract Compares a set of properties in a matching dictionary with an IOService object's property table. + @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. A collection of dictionary keys specifies properties in a matching dictionary to be compared, with compareProperty, with an IOService object's property table, if compareProperty returns true for each key, success is returned; otherwise failure. + @param matching The matching dictionary, which must be non-zero. + @param keys A collection (eg. OSSet, OSArray, OSDictionary) which should contain OSStrings (or OSSymbols) that specify the property keys to be compared. + @result Success if compareProperty returns true for each key in the collection; otherwise failure. */ + + virtual bool compareProperties( OSDictionary * matching, + OSCollection * keys ); + + /* Client / provider accessors */ + +/*! @function attach + @abstract Attaches an IOService client to a provider in the I/O Registry. + @discussion This function called in an IOService client enters the client into the I/O Registry as a child of the provider in the service plane. The provider must be active or the attach will fail. Multiple attach calls to the same provider are no-ops and return success. A client may be attached to multiple providers. Entering an object into the I/O Registry retains both the client and provider until they are detached. + @param provider The IOService object which will serve as this object's provider. + @result false if the provider is inactive or on a resource failure; otherwise true. */ + + virtual bool attach( IOService * provider ); + +/*! @function detach + @abstract Detaches an IOService client from a provider in the I/O Registry. + @discussion This function called in an IOService client removes the client as a child of the provider in the service plane of the I/O Registry. If the provider is not a parent of the client this is a no-op, otherwise the I/O Registry releases both the client and provider. + @param provider The IOService object to detach from. */ + + virtual void detach( IOService * provider ); + +/*! @function getProvider + @abstract Returns an IOService object's primary provider. + @discussion This function called in an IOService client will return the provider to which it was first attached. Because the majority of IOService objects have only one provider, this is a useful simplification and also supports caching of the provider when the I/O Registry is unchanged. + @result The first provider of the client, or zero if the IOService object is not attached into the I/O Registry. The provider is retained while the client is attached, and should not be released by the caller. */ + + virtual IOService * getProvider( void ) const; + +/*! @function getWorkLoop + @abstract Returns the current work loop or provider->getWorkLoop. + @discussion This function returns a valid work loop that a client can use to add an IOCommandGate to. The intention is that an IOService client has data that needs to be protected but doesn't want to pay the cost of a dedicated thread. This data has to be accessed from a provider's call-out context as well. So to achieve both of these goals the client creates an IOCommandGate to lock access to his data but he registers it with the provider's work loop, i.e. the work loop which will make the completion call-outs. This avoids a potential deadlock because the work loop gate uses a recursive lock, which allows the same lock to be held multiple times by a single thread. + @result A work loop, either the current work loop or it walks up the @link getProvider getProvider@/link chain calling getWorkLoop. Eventually it will reach a valid work loop-based driver or the root of the I/O tree, where it will return a system-wide work loop. Returns 0 if it fails to find (or create) a work loop.*/ + + virtual IOWorkLoop * getWorkLoop() const; + +/*! @function getProviderIterator + @abstract Returns an iterator over an IOService object's providers. + @discussion For those few IOService objects that obtain service from multiple providers, this method supplies an iterator over a client's providers. + @result An iterator over the providers of the client, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getProviderIterator( void ) const; + +/*! @function getOpenProviderIterator + @abstract Returns an iterator over an client's providers that are currently opened by the client. + @discussion For those few IOService objects that obtain service from multiple providers, this method supplies an iterator over a client's providers, locking each in turn with @link lockForArbitration lockForArbitration@/link and returning those that have been opened by the client. + @result An iterator over the providers the client has open, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, and the current entry in the iteration is locked with lockForArbitration, protecting it from state changes. */ + + virtual OSIterator * getOpenProviderIterator( void ) const; + +/*! @function getClient + @abstract Returns an IOService object's primary client. + @discussion This function called in an IOService provider will return the first client to attach to it. For IOService objects which have only only one client, this may be a useful simplification. + @result The first client of the provider, or zero if the IOService object is not attached into the I/O Registry. The client is retained while it is attached, and should not be released by the caller. */ + + virtual IOService * getClient( void ) const; + +/*! @function getClientIterator + @abstract Returns an iterator over an IOService object's clients. + @discussion For IOService objects that may have multiple clients, this method supplies an iterator over a provider's clients. + @result An iterator over the clients of the provider, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getClientIterator( void ) const; + +/*! @function getOpenClientIterator + @abstract Returns an iterator over a provider's clients that currently have opened the provider. + @discussion For IOService objects that may have multiple clients, this method supplies an iterator over a provider's clients, locking each in turn with @link lockForArbitration lockForArbitration@/link and returning those that have opened the provider. + @result An iterator over the clients that have opened the provider, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, and the current entry in the iteration is locked with lockForArbitration, protecting it from state changes. */ + + virtual OSIterator * getOpenClientIterator( void ) const; + +/*! @function callPlatformFunction + @abstract Calls the platform function with the given name. + @discussion The platform expert or other drivers may implement various functions to control hardware features. callPlatformFunction allows any IOService object to access these functions. Normally callPlatformFunction is called on a service's provider. The provider services the request or passes it to its provider. The system's IOPlatformExpert subclass catches functions it knows about and redirects them into other parts of the service plane. If the IOPlatformExpert subclass cannot execute the function, the base class is called. The IOPlatformExpert base class attempts to find a service to execute the function by looking up the function name in an IOResources name space. A service may publish a service using publishResource(functionName, this). If no service can be found to execute the function an error is returned. + @param functionName Name of the function to be called. When functionName is a C string, callPlatformFunction converts the C string to an OSSymbol and calls the OSSymbol version of callPlatformFunction. This process can block and should not be used from an interrupt context. + @param waitForFunction If true, callPlatformFunction will not return until the function has been called. + @result An IOReturn code; kIOReturnSuccess if the function was successfully executed, kIOReturnUnsupported if a service to execute the function could not be found. Other return codes may be returned by the function.*/ + + virtual IOReturn callPlatformFunction( const OSSymbol * functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + + virtual IOReturn callPlatformFunction( const char * functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + + + /* Some accessors */ + +/*! @function getPlatform + @abstract Returns a pointer to the platform expert instance for the computer. + @discussion This method provides an accessor to the platform expert instance for the computer. + @result A pointer to the IOPlatformExport instance. It should not be released by the caller. */ + + static IOPlatformExpert * getPlatform( void ); + +/*! @function getPMRootDomain + @abstract Returns a pointer to the power management root domain instance for the computer. + @discussion This method provides an accessor to the power management root domain instance for the computer. + @result A pointer to the power management root domain instance. It should not be released by the caller. */ + + static class IOPMrootDomain * getPMRootDomain( void ); + +/*! @function getServiceRoot + @abstract Returns a pointer to the root of the service plane. + @discussion This method provides an accessor to the root of the service plane for the computer. + @result A pointer to the IOService instance at the root of the service plane. It should not be released by the caller. */ + + static IOService * getServiceRoot( void ); + +/*! @function getResourceService + @abstract Returns a pointer to the IOResources service. + @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + @result A pointer to the IOResources instance. It should not be released by the caller. */ + + static IOService * getResourceService( void ); + + /* Allocate resources for a matched service */ + +/*! @function getResources + @abstract Allocates any needed resources for a published IOService object before clients attach. + @discussion This method is called during the registration process for an IOService object if there are successful driver matches, before any clients attach. It allows for lazy allocation of resources to an IOService object when a matching driver is found. + @result An IOReturn code; kIOReturnSuccess is necessary for the IOService object to be successfully used, otherwise the registration process for the object is halted. */ + + virtual IOReturn getResources( void ); + + /* Device memory accessors */ + +/*! @function getDeviceMemoryCount + @abstract Returns a count of the physical memory ranges available for a device. + @discussion This method returns the count of physical memory ranges, each represented by an IODeviceMemory instance, that have been allocated for a memory mapped device. + @result An integer count of the number of ranges available. */ + + virtual IOItemCount getDeviceMemoryCount( void ); + +/*! @function getDeviceMemoryWithIndex + @abstract Returns an instance of IODeviceMemory representing one of a device's memory mapped ranges. + @discussion This method returns a pointer to an instance of IODeviceMemory for the physical memory range at the given index for a memory mapped device. + @param index An index into the array of ranges assigned to the device. + @result A pointer to an instance of IODeviceMemory, or zero if the index is beyond the count available. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. See also @link mapDeviceMemoryWithIndex mapDeviceMemoryWithIndex@/link, which creates a device memory mapping. */ + + virtual IODeviceMemory * getDeviceMemoryWithIndex( unsigned int index ); + +/*! @function mapDeviceMemoryWithIndex + @abstract Maps a physical range of a device. + @discussion This method creates a mapping for the IODeviceMemory at the given index, with IODeviceMemory::map(options). The mapping is represented by the returned instance of IOMemoryMap, which should not be released until the mapping is no longer required. + @param index An index into the array of ranges assigned to the device. + @result An instance of IOMemoryMap, or zero if the index is beyond the count available. The mapping should be released only when access to it is no longer required. */ + + virtual IOMemoryMap * mapDeviceMemoryWithIndex( unsigned int index, + IOOptionBits options = 0 ); + +/*! @function getDeviceMemory + @abstract Returns the array of IODeviceMemory objects representing a device's memory mapped ranges. + @discussion This method returns an array of IODeviceMemory objects representing the physical memory ranges allocated to a memory mapped device. + @result An OSArray of IODeviceMemory objects, or zero if none are available. The array is retained by the provider, so is valid while attached. */ + + virtual OSArray * getDeviceMemory( void ); + +/*! @function setDeviceMemory + @abstract Sets the array of IODeviceMemory objects representing a device's memory mapped ranges. + @discussion This method sets an array of IODeviceMemory objects representing the physical memory ranges allocated to a memory mapped device. + @param array An OSArray of IODeviceMemory objects, or zero if none are available. The array will be retained by the object. */ + + virtual void setDeviceMemory( OSArray * array ); + + /* Interrupt accessors */ + +/*! @function registerInterrupt + @abstract Registers a C function interrupt handler for a device supplying interrupts. + @discussion This method installs a C function interrupt handler to be called at primary interrupt time for a device's interrupt. Only one handler may be installed per interrupt source. IOInterruptEventSource provides a work loop based abstraction for interrupt delivery that may be more appropriate for work loop based drivers. + @param source The index of the interrupt source in the device. + @param target An object instance to be passed to the interrupt handler. + @param handler The C function to be called at primary interrupt time when the interrupt occurs. The handler should process the interrupt by clearing the interrupt, or by disabling the source. + @param refCon A reference constant for the handler's use. + @result An IOReturn code.
kIOReturnNoInterrupt is returned if the source is not valid; kIOReturnNoResources is returned if the interrupt already has an installed handler. */ + + virtual IOReturn registerInterrupt(int source, OSObject *target, + IOInterruptAction handler, + void *refCon = 0); + +/*! @function unregisterInterrupt + @abstract Removes a C function interrupt handler for a device supplying hardware interrupts. + @discussion This method removes a C function interrupt handler previously installed with @link registerInterrupt registerInterrupt@/link. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn unregisterInterrupt(int source); + +/*! @function getInterruptType + @abstract Returns the type of interrupt used for a device supplying hardware interrupts. + @param source The index of the interrupt source in the device. + @param interruptType The interrupt type for the interrupt source will be stored here by getInterruptType.
kIOInterruptTypeEdge will be returned for edge-trigggered sources.
kIOInterruptTypeLevel will be returned for level-trigggered sources. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn getInterruptType(int source, int *interruptType); + +/*! @function enableInterrupt + @abstract Enables a device interrupt. + @discussion It is the caller's responsiblity to keep track of the enable state of the interrupt source. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn enableInterrupt(int source); + +/*! @function disableInterrupt + @abstract Synchronously disables a device interrupt. + @discussion If the interrupt routine is running, the call will block until the routine completes. It is the caller's responsiblity to keep track of the enable state of the interrupt source. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn disableInterrupt(int source); + +/*! @function causeInterrupt + @abstract Causes a device interrupt to occur. + @discussion Emulates a hardware interrupt, to be called from task level. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn causeInterrupt(int source); + +/*! @function requestProbe + @abstract Requests that hardware be re-scanned for devices. + @discussion For bus families that do not usually detect device addition or removal, this method represents an external request (eg. from a utility application) to rescan and publish or remove found devices. + @param options Family defined options, not interpreted by IOService. + @result An IOReturn code. */ + + virtual IOReturn requestProbe( IOOptionBits options ); + + /* Generic API for non-data-path upstream calls */ + +/*! @function message + @abstract Receives a generic message delivered from an attached provider. + @discussion A provider may deliver messages via the message method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method is implemented in the client to receive messages. + @param type A type defined in IOMessage.h or defined by the provider family. + @param provider The provider from which the message originates. + @param argument An argument defined by the provider family, not used by IOService. + @result An IOReturn code defined by the message type. */ + + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ); + +/*! @function messageClient + @abstract Sends a generic message to an attached client. + @discussion A provider may deliver messages via the @link message message@/link method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method may be called in the provider to send a message to the specified client, which may be useful for overrides. + @param messageType A type defined in IOMessage.h or defined by the provider family. + @param client A client of the IOService to send the message. + @param messageArgument An argument defined by the provider family, not used by IOService. + @param argSize Specifies the size of messageArgument, in bytes. If argSize is non-zero, messageArgument is treated as a pointer to argSize bytes of data. If argSize is 0 (the default), messageArgument is treated as an ordinal and passed by value. + @result The return code from the client message call. */ + + virtual IOReturn messageClient( UInt32 messageType, OSObject * client, + void * messageArgument = 0, vm_size_t argSize = 0 ); + +/*! @function messageClients + @abstract Sends a generic message to all attached clients. + @discussion A provider may deliver messages via the @link message message@/link method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method may be called in the provider to send a message to all the attached clients, via the @link messageClient messageClient@/link method. + @param type A type defined in IOMessage.h or defined by the provider family. + @param argument An argument defined by the provider family, not used by IOService. + @param argSize Specifies the size of argument, in bytes. If argSize is non-zero, argument is treated as a pointer to argSize bytes of data. If argSize is 0 (the default), argument is treated as an ordinal and passed by value. + @result Any non-kIOReturnSuccess return codes returned by the clients, or kIOReturnSuccess if all return kIOReturnSuccess. */ + + virtual IOReturn messageClients( UInt32 type, + void * argument = 0, vm_size_t argSize = 0 ); + + virtual IONotifier * registerInterest( const OSSymbol * typeOfInterest, + IOServiceInterestHandler handler, + void * target, void * ref = 0 ); + + virtual void applyToProviders( IOServiceApplierFunction applier, + void * context ); + + virtual void applyToClients( IOServiceApplierFunction applier, + void * context ); + + virtual void applyToInterested( const OSSymbol * typeOfInterest, + OSObjectApplierFunction applier, + void * context ); + + virtual IOReturn acknowledgeNotification( IONotificationRef notification, + IOOptionBits response ); + + /* User client create */ + +/*! @function newUserClient + @abstract Creates a connection for a non kernel client. + @discussion A non kernel client may request a connection be opened via the @link //apple_ref/c/func/IOServiceOpen IOServiceOpen@/link library function, which will call this method in an IOService object. The rules and capabilities of user level clients are family dependent, and use the functions of the IOUserClient class for support. IOService's implementation returns kIOReturnUnsupported, so any family supporting user clients must implement this method. + @param owningTask The Mach task of the client thread in the process of opening the user client. Note that in Mac OS X, each process is based on a Mach task and one or more Mach threads. For more information on the composition of a Mach task and its relationship with Mach threads, see {@linkdoc //apple_ref/doc/uid/TP30000905-CH209-TPXREF103 "Tasks and Threads"}. + @param securityID A token representing the access level for the task. + @param type A constant specifying the type of connection to be created, specified by the caller of @link //apple_ref/c/func/IOServiceOpen IOServiceOpen@/link and interpreted only by the family. + @param handler An instance of an IOUserClient object to represent the connection, which will be released when the connection is closed, or zero if the connection was not opened. + @param properties A dictionary of additional properties for the connection. + @result A return code to be passed back to the caller of IOServiceOpen. */ + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, IOUserClient ** handler ); + + /* Return code utilities */ + +/*! @function stringFromReturn + @abstract Supplies a programmer-friendly string from an IOReturn code. + @discussion Strings are available for the standard return codes in IOReturn.h in IOService, while subclasses may implement this method to interpret family dependent return codes. + @param rtn The IOReturn code. + @result A pointer to a constant string, or zero if the return code is unknown. */ + + virtual const char * stringFromReturn( IOReturn rtn ); + +/*! @function errnoFromReturn + @abstract Translates an IOReturn code to a BSD errno. + @discussion BSD defines its own return codes for its functions in sys/errno.h, and I/O Kit families may need to supply compliant results in BSD shims. Results are available for the standard return codes in IOReturn.h in IOService, while subclasses may implement this method to interpret family dependent return codes. + @param rtn The IOReturn code. + @result The BSD errno or EIO if unknown. */ + + virtual int errnoFromReturn( IOReturn rtn ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* * * * * * * * * * end of IOService API * * * * * * * */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /* for IOInterruptController implementors */ + + int _numInterruptSources; + IOInterruptSource *_interruptSources; + + /* overrides */ + virtual bool serializeProperties( OSSerialize * s ) const; + + void requireMaxBusStall(UInt32 ns); + void requireMaxInterruptDelay(uint32_t ns); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* * * * * * * * * * * * Internals * * * * * * * * * * * */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool checkResources( void ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool checkResource( OSObject * matching ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void probeCandidates( OSOrderedSet * matches ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool startCandidate( IOService * candidate ); + +public: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOService * getClientWithCategory( const OSSymbol * category ) + APPLE_KEXT_DEPRECATED; + // copyClientWithCategory is the public replacement + +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool passiveMatch( OSDictionary * matching, bool changesOK = false); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void startMatching( IOOptionBits options = 0 ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void doServiceMatch( IOOptionBits options ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void doServiceTerminate( IOOptionBits options ); + +private: + static OSObject * copyExistingServices( OSDictionary * matching, + IOOptionBits inState, IOOptionBits options = 0 ); + + static IONotifier * setNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref, + SInt32 priority = 0 ); + + static IONotifier * doInstallNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref, + SInt32 priority, OSIterator ** existing ); + + static bool syncNotificationHandler( void * target, void * ref, + IOService * newService, IONotifier * notifier ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void deliverNotification( const OSSymbol * type, + IOOptionBits orNewState, IOOptionBits andNewState ); + + bool invokeNotifer( class _IOServiceNotifier * notify ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void unregisterAllInterest( void ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn waitForState( UInt32 mask, UInt32 value, + mach_timespec_t * timeout = 0 ); + + IOReturn waitForState( UInt32 mask, UInt32 value, uint64_t timeout ); + + UInt32 _adjustBusy( SInt32 delta ); + + bool terminatePhase1( IOOptionBits options = 0 ); + void scheduleTerminatePhase2( IOOptionBits options = 0 ); + void scheduleStop( IOService * provider ); + void scheduleFinalize( void ); + static void terminateThread( void * arg, wait_result_t unused ); + static void terminateWorker( IOOptionBits options ); + static void actionWillTerminate( IOService * victim, IOOptionBits options, + OSArray * doPhase2List ); + static void actionDidTerminate( IOService * victim, IOOptionBits options ); + static void actionFinalize( IOService * victim, IOOptionBits options ); + static void actionStop( IOService * client, IOService * provider ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn resolveInterrupt(IOService *nub, int source); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn lookupInterrupt(int source, bool resolve, IOInterruptController **interruptController); + + + /* power management */ +public: + +/*! @function PMinit + @abstract Initializes power management for a driver. + @discussion PMinit allocates and initializes the power management instance variables, and it should be called before accessing those variables or calling the power management methods. This method should be called inside the driver's start routine and must be paired with a call to @link PMstop PMstop@/link. + Most calls to PMinit are followed by calls to @link joinPMtree joinPMtree@/link and @link registerPowerDriver registerPowerDriver@/link. */ + + virtual void PMinit( void ); + +/*! @function PMstop + @abstract Frees and removes the driver from power management. + @discussion The power managment variables don't exist after this call and the power managment methods in the caller shouldn't be called. + Calling PMstop cleans up for the three power management initialization calls: @link PMinit PMinit@/link, @link joinPMtree joinPMtree@/link, and @link registerPowerDriver registerPowerDriver@/link. */ + + virtual void PMstop( void ); + +/*! @function joinPMtree + @abstract Joins the driver into the power plane of the I/O Registry. + @discussion A driver uses this method to call its nub when initializing (usually in its start routine after calling @link PMinit PMinit@/link), to be attached into the power management hierarchy (i.e., the power plane). A driver usually calls this method on the driver for the device that provides it power (this is frequently the nub). + Before this call returns, the caller will probably be called at @link setPowerParent setPowerParent@/link and @link setAggressiveness setAggressiveness@/link and possibly at @link addPowerChild addPowerChild@/link as it is added to the hierarchy. This method may be overridden by a nub subclass. + @param driver The driver to be added to the power plane, usually this. */ + + virtual void joinPMtree( IOService * driver ); + +/*! @function registerPowerDriver + @abstract Registers a set of power states that the driver supports. + @discussion A driver defines its array of supported power states with power management in its power management initialization (its start routine). If successful, power management will call the driver to instruct it to change its power state through @link setPowerState setPowerState@/link. + Most drivers do not need to override registerPowerDriver. A nub may override registerPowerDriver if it needs to arrange its children in the power plane differently than the default placement, but this is uncommon. + @param controllingDriver A pointer to the calling driver, usually this. + @param powerStates A driver-defined array of power states that the driver and device support. Power states are defined in pwr_mgt/IOPMpowerState.h. + @param numberOfStates The number of power states in the array. + @result IOPMNoErr. All errors are logged via kprintf. */ + + virtual IOReturn registerPowerDriver( + IOService * controllingDriver, + IOPMPowerState * powerStates, + unsigned long numberOfStates ); + +/*! @function registerInterestedDriver + @abstract Allows an IOService object to register interest in the changing power state of a power-managed IOService object. + @discussion Call registerInterestedDriver on the IOService object you are interested in receiving power state messages from, and pass a pointer to the interested driver (this) as an argument. + The interested driver should override @link powerStateWillChangeTo powerStateWillChangeTo@/link and @link powerStateDidChangeTo powerStateDidChangeTo@/link to receive these power change messages. + Interested drivers must acknowledge power changes in powerStateWillChangeTo or powerStateDidChangeTo, either via return value or later calls to @link acknowledgePowerChange acknowledgePowerChange@/link. + @param theDriver The driver of interest adds this pointer to the list of interested drivers. It informs drivers on this list before and after the power change. + @result Flags describing the capability of the device in its current power state. If the current power state is not yet defined, zero is returned (this is the case when the driver is not yet in the power domain hierarchy or hasn't fully registered with power management yet). */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOPMPowerFlags registerInterestedDriver( IOService * theDriver ); + +/*! @function deRegisterInterestedDriver + @abstract De-registers power state interest from a previous call to registerInterestedDriver. + @discussion Most drivers do not need to override deRegisterInterestedDriver. + @param theDriver The interested driver previously passed into @link registerInterestedDriver registerInterestedDriver@/link. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn deRegisterInterestedDriver( IOService * theDriver ); + +/*! @function acknowledgePowerChange + @abstract Acknowledges an in-progress power state change. + @discussion When power management informs an interested object (via @link powerStateWillChangeTo powerStateWillChangeTo@/link or @link powerStateDidChangeTo powerStateDidChangeTo@/link), the object can return an immediate acknowledgement via a return code, or it may return an indication that it will acknowledge later by calling acknowledgePowerChange. + Interested objects are those that have registered as interested drivers, as well as power plane children of the power changing driver. A driver that calls @link registerInterestedDriver registerInterestedDriver@/link must call acknowledgePowerChange, or use an immediate acknowledgement return from powerStateWillChangeTo or powerStateDidChangeTo. + @param whichDriver A pointer to the calling driver. The called object tracks all interested parties to ensure that all have acknowledged the power state change. + @result IOPMNoErr. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn acknowledgePowerChange( IOService * whichDriver ); + +/*! @function acknowledgeSetPowerState + @abstract Acknowledges the belated completion of a driver's setPowerState power state change. + @discussion After power management instructs a driver to change its state via @link setPowerState setPowerState@/link, that driver must acknowledge the change when its device has completed its transition. The acknowledgement may be immediate, via a return code from setPowerState, or delayed, via this call to acknowledgeSetPowerState. + Any driver that does not return kIOPMAckImplied from its setPowerState implementation must later call acknowledgeSetPowerState. + @result IOPMNoErr. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn acknowledgeSetPowerState( void ); + +/*! @function requestPowerDomainState + @abstract Tells a driver to adjust its power state. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn requestPowerDomainState( + IOPMPowerFlags desiredState, + IOPowerConnection * whichChild, + unsigned long specificationFlags ); + +/*! @function makeUsable + @abstract Requests that a device become usable. + @discussion This method is called when some client of a device (or the device's own driver) is asking for the device to become usable. Power management responds by telling the object upon which this method is called to change to its highest power state. + makeUsable is implemented using @link changePowerStateToPriv changePowerStateToPriv@/link. Subsequent requests for lower power, such as from changePowerStateToPriv, will pre-empt this request. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn makeUsable( void ); + +/*! @function temporaryPowerClampOn + @abstract A driver calls this method to hold itself in the highest power state until it has children. + @discussion Use temporaryPowerClampOn to hold your driver in its highest power state while waiting for child devices to attach. After children have attached, the clamp is released and the device's power state is controlled by the children's requirements. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn temporaryPowerClampOn( void ); + +/*! @function changePowerStateTo + @abstract Sets a driver's power state. + @discussion This function is one of several that are used to set a driver's power state. In most circumstances, however, you should call @link changePowerStateToPriv changePowerStateToPriv@/link instead. + Calls to changePowerStateTo, changePowerStateToPriv, and a driver's power children all affect the power state of a driver. For legacy design reasons, they have overlapping functionality. Although you should call changePowerStateToPriv to change your device's power state, you might need to call changePowerStateTo in the following circumstances: +
  • If a driver will be using changePowerStateToPriv to change its power state, it should call changePowerStateTo(0) in its start routine to eliminate the influence changePowerStateTo has on power state calculations. +
  • Call changePowerStateTo in conjunction with @link setIdleTimerPeriod setIdleTimerPeriod@/link and @link activityTickle activityTickle@/link to idle a driver into a low power state. For a driver with 3 power states, for example, changePowerStateTo(1) sets a minimum level of power state 1, such that the idle timer period may not set your device's power any lower than state 1.
+ @param ordinal The number of the desired power state in the power state array. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn changePowerStateTo( unsigned long ordinal ); + +/*! @function currentCapability + @abstract Finds out the capability of a device's current power state. + @result A copy of the capabilityFlags field for the current power state in the power state array. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOPMPowerFlags currentCapability( void ); + +/*! @function currentPowerConsumption + @abstract Finds out the current power consumption of a device. + @discussion Most Mac OS X power managed drivers do not report their power consumption via the staticPower field. Thus this call will not accurately reflect power consumption for most drivers. + @result A copy of the staticPower field for the current power state in the power state array. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + unsigned long currentPowerConsumption( void ); + +/*! @function activityTickle + @abstract Informs power management when a power-managed device is in use, so that power management can track when it is idle and adjust its power state accordingly. + @discussion The activityTickle method is provided for objects in the system (or for the driver itself) to tell a driver that its device is being used. + The IOService superclass can manage idleness determination with a simple idle timer mechanism and this activityTickle call. To start this up, the driver calls its superclass's setIdleTimerPeriod. This starts a timer for the time interval specified in the call. When the timer expires, the superclass checks to see if there has been any activity since the last timer expiration. (It checks to see if activityTickle has been called). If there has been activity, it restarts the timer, and this process continues. When the timer expires, and there has been no device activity, the superclass lowers the device power state to the next lower state. This can continue until the device is in state zero. + After the device has been powered down by at least one power state, a subsequent call to activityTickle causes the device to be switched to a higher state required for the activity. + If the driver is managing the idleness determination totally on its own, the value of the type parameter should be kIOPMSubclassPolicy, and the driver should override the activityTickle method. The superclass IOService implementation of activityTickle does nothing with the kIOPMSubclassPolicy argument. + @param type When type is kIOPMSubclassPolicy, activityTickle is not handled in IOService and should be intercepted by the subclass. When type is kIOPMSuperclassPolicy1, an activity flag is set and the device state is checked. If the device has been powered down, it is powered up again. + @param stateNumber When type is kIOPMSuperclassPolicy1, stateNumber contains the desired power state ordinal for the activity. If the device is in a lower state, the superclass will switch it to this state. This is for devices that can handle some accesses in lower power states; the device is powered up only as far as it needs to be for the activity. + @result When type is kIOPMSuperclassPolicy1, the superclass returns true if the device is currently in the state specified by stateNumber. If the device is in a lower state and must be powered up, the superclass returns false; in this case the superclass will initiate a power change to power the device up. */ + + virtual bool activityTickle( + unsigned long type, + unsigned long stateNumber = 0 ); + +/*! @function setAggressiveness + @abstract Broadcasts an aggressiveness factor from the parent of a driver to the driver. + @discussion Implement setAggressiveness to receive a notification when an "aggressiveness Aggressiveness factors are a loose set of power management variables that contain values for system sleep timeout, display sleep timeout, whether the system is on battery or AC, and other power management features. There are several aggressiveness factors that can be broadcast and a driver may take action on whichever factors apply to it. + A driver that has joined the power plane via @link joinPMtree joinPMtree@/link will receive setAgressiveness calls when aggressiveness factors change. + A driver may override this call if it needs to do something with the new factor (such as change its idle timeout). If overridden, the driver must call its superclass's setAgressiveness method in its own setAgressiveness implementation. + Most drivers do not need to implement setAgressiveness. + @param type The aggressiveness factor type, such as kPMMinutesToDim, kPMMinutesToSpinDown, kPMMinutesToSleep, and kPMPowerSource. (Aggressiveness factors are defined in pwr_mgt/IOPM.h.) + @param newLevel The aggressiveness factor's new value. + @result IOPMNoErr. */ + + virtual IOReturn setAggressiveness( + unsigned long type, + unsigned long newLevel ); + +/*! @function getAggressiveness + @abstract Returns the current aggressiveness value for the given type. + @param type The aggressiveness factor to query. + @param currentLevel Upon successful return, contains the value of aggressiveness factor type. + @result kIOReturnSuccess upon success; an I/O Kit error code otherwise. */ + + virtual IOReturn getAggressiveness( + unsigned long type, + unsigned long * currentLevel ); + +#ifndef __LP64__ +/*! @function systemWake + @abstract Tells every driver in the power plane that the system is waking up. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn systemWake( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function temperatureCriticalForZone + @abstract Alerts a driver to a critical temperature in some thermal zone. + @discussion This call is unused by power management. It is not intended to be called or overridden. */ + + virtual IOReturn temperatureCriticalForZone( IOService * whichZone ) + APPLE_KEXT_DEPRECATED; + +/*! @function youAreRoot + @abstract Informs power management which IOService object is the power plane root. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn youAreRoot( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function setPowerParent + @abstract This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn setPowerParent( + IOPowerConnection * parent, + bool stateKnown, + IOPMPowerFlags currentState ) + APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + +/*! @function addPowerChild + @abstract Informs a driver that it has a new child. + @discussion The Platform Expert uses this method to call a driver and introduce it to a new child. This call is handled internally by power management. It is not intended to be overridden or called by drivers. + @param theChild A pointer to the child IOService object. */ + + virtual IOReturn addPowerChild( IOService * theChild ); + +/*! @function removePowerChild + @abstract Informs a power managed driver that one of its power plane childen is disappearing. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn removePowerChild( IOPowerConnection * theChild ); + +#ifndef __LP64__ +/*! @function command_received + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void command_received( void *, void * , void * , void * ); +#endif + +/*! @function start_PM_idle_timer + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void start_PM_idle_timer( void ); + +#ifndef __LP64__ +/*! @function PM_idle_timer_expiration + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void PM_idle_timer_expiration( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function PM_Clamp_Timer_Expired + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void PM_Clamp_Timer_Expired( void ) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function setIdleTimerPeriod + @abstract Sets or changes the idle timer period. + @discussion A driver using the idleness determination provided by IOService calls its superclass with this method to set or change the idle timer period. See @link activityTickle activityTickle@/link for a description of this type of idleness determination. + @param period The desired idle timer period in seconds. + @result kIOReturnSuccess upon success; an I/O Kit error code otherwise. */ + + virtual IOReturn setIdleTimerPeriod( unsigned long ); + +#ifndef __LP64__ +/*! @function getPMworkloop + @abstract Returns a pointer to the system-wide power management work loop. + @availability Deprecated in Mac OS X version 10.6. + @discussion Most drivers should create their own work loops to synchronize their code; drivers should not run arbitrary code on the power management work loop. */ + + virtual IOWorkLoop * getPMworkloop( void ) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function getPowerState + @abstract Determines a device's power state. + @discussion A device's "current power state" is updated at the end of each power state transition (e.g. transition from state 1 to state 0, or state 0 to state 2). This transition includes the time spent powering on or off any power plane children. Thus, if a child calls getPowerState on its power parent during system wake from sleep, the call will return the index to the device's off state rather than its on state. + @result The current power state's index into the device's power state array. */ + + UInt32 getPowerState( void ); + +/*! @function setPowerState + @abstract Requests a power managed driver to change the power state of its device. + @discussion A power managed driver must override setPowerState to take part in system power management. After a driver is registered with power management, the system uses setPowerState to power the device off and on for system sleep and wake. + Calls to @link PMinit PMinit@/link and @link registerPowerDriver registerPowerDriver@/link enable power management to change a device's power state using setPowerState. setPowerState is called in a clean and separate thread context. + @param powerStateOrdinal The number in the power state array of the state the driver is being instructed to switch to. + @param whatDevice A pointer to the power management object which registered to manage power for this device. In most cases, whatDevice will be equal to your driver's own this pointer. + @result The driver must return IOPMAckImplied if it has complied with the request when it returns. Otherwise if it has started the process of changing power state but not finished it, the driver should return a number of microseconds which is an upper limit of the time it will need to finish. Then, when it has completed the power switch, it should call @link acknowledgeSetPowerState acknowledgeSetPowerState@/link. */ + + virtual IOReturn setPowerState( + unsigned long powerStateOrdinal, + IOService * whatDevice ); + +#ifndef __LP64__ +/*! @function clampPowerOn + @abstract Deprecated. Do not use. */ + + virtual void clampPowerOn( unsigned long duration ); +#endif + +/*! @function maxCapabilityForDomainState + @abstract Determines a driver's highest power state possible for a given power domain state. + @discussion This happens when the power domain is changing state and power management needs to determine which state the device is capable of in the new domain state. + Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the driver itself should implement the method and override the superclass's implementation. + @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. */ + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + +/*! @function initialPowerStateForDomainState + @abstract Determines which power state a device is in, given the current power domain state. + @discussion Power management calls this method once, when the driver is initializing power management. + Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the power managed driver should implement the method and override the superclass's implementation. + @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. */ + + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags domainState ); + +/*! @function powerStateForDomainState + @abstract Determines what power state the device would be in for a given power domain state. + @discussion Power management calls a driver with this method to find out what power state the device would be in for a given power domain state. This happens when the power domain is changing state and power management needs to determine the effect of the change. + Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the power managed driver should implement the method and override the superclass's implementation. + @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. */ + + virtual unsigned long powerStateForDomainState( IOPMPowerFlags domainState ); + +/*! @function powerStateWillChangeTo + @abstract Informs interested parties that a device is about to change its power state. + @discussion Power management informs interested parties that a device is about to change to a different power state. Interested parties are those that have registered for this notification via @link registerInterestedDriver registerInterestedDriver@/link. If you have called registerInterestedDriver on a power managed driver, you must implement powerStateWillChangeTo and @link powerStateDidChangeTo powerStateDidChangeTo@/link to receive the notifications. + powerStateWillChangeTo is called in a clean and separate thread context. powerStateWillChangeTo is called before a power state transition takes place; powerStateDidChangeTo is called after the transition has completed. + @param capabilities Flags that describe the capability of the device in the new power state (they come from the capabilityFlags field of the new state in the power state array). + @param stateNumber The number of the state in the state array that the device is switching to. + @param whatDevice A pointer to the driver that is changing. It can be used by a driver that is receiving power state change notifications for multiple devices to distinguish between them. + @result The driver returns IOPMAckImplied if it has prepared for the power change when it returns. If it has started preparing but not finished, it should return a number of microseconds which is an upper limit of the time it will need to finish preparing. Then, when it has completed its preparations, it should call @link acknowledgePowerChange acknowledgePowerChange@/link. */ + + virtual IOReturn powerStateWillChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ); + +/*! @function powerStateDidChangeTo + @abstract Informs interested parties that a device has changed to a different power state. + @discussion Power management informs interested parties that a device has changed to a different power state. Interested parties are those that have registered for this notification via @link registerInterestedDriver registerInterestedDriver@/link. If you have called registerInterestedDriver on a power managed driver, you must implemnt @link powerStateWillChangeTo powerStateWillChangeTo@/link and powerStateDidChangeTo to receive the notifications. + powerStateDidChangeTo is called in a clean and separate thread context. powerStateWillChangeTo is called before a power state transition takes place; powerStateDidChangeTo is called after the transition has completed. + @param capabilities Flags that describe the capability of the device in the new power state (they come from the capabilityFlags field of the new state in the power state array). + @param stateNumber The number of the state in the state array that the device is switching to. + @param whatDevice A pointer to the driver that is changing. It can be used by a driver that is receiving power state change notifications for multiple devices to distinguish between them. + @result The driver returns IOPMAckImplied if it has prepared for the power change when it returns. If it has started preparing but not finished, it should return a number of microseconds which is an upper limit of the time it will need to finish preparing. Then, when it has completed its preparations, it should call @link acknowledgePowerChange acknowledgePowerChange@/link. */ + + virtual IOReturn powerStateDidChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ); + +#ifndef __LP64__ +/*! @function didYouWakeSystem + @abstract Asks a driver if its device is the one that just woke the system from sleep. + @availability Deprecated in Mac OS X version 10.6. + @discussion Power management calls a power managed driver with this method to ask if its device is the one that just woke the system from sleep. If a device is capable of waking the system from sleep, its driver should implement didYouWakeSystem and return true if its device was responsible for waking the system. + @result true if the driver's device woke the system and false otherwise. */ + + virtual bool didYouWakeSystem( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function newTemperature + @abstract Tells a power managed driver that the temperature in the thermal zone has changed. + @discussion This call is unused by power management. It is not intended to be called or overridden. */ + + virtual IOReturn newTemperature( long currentTemp, IOService * whichZone ) + APPLE_KEXT_DEPRECATED; +#endif + + virtual bool askChangeDown( unsigned long ); + virtual bool tellChangeDown( unsigned long ); + virtual void tellNoChangeDown ( unsigned long ); + virtual void tellChangeUp( unsigned long ); + virtual IOReturn allowPowerChange( unsigned long refcon ); + virtual IOReturn cancelPowerChange( unsigned long refcon ); + +protected: +/*! @function changePowerStateToPriv + @abstract Tells a driver's superclass to change the power state of its device. + @discussion A driver uses this method to tell its superclass to change the power state of the device. This is the recommended way to change the power state of a device. + Three things affect driver power state: @link changePowerStateTo changePowerStateTo@/link, changePowerStateToPriv, and the desires of the driver's power plane children. Power management puts the device into the maximum state governed by those three entities. + Drivers may eliminate the influence of the changePowerStateTo method on power state one of two ways. See @link powerOverrideOnPriv powerOverrideOnPriv@/link to ignore the method's influence, or call changePowerStateTo(0) in the driver's start routine to remove the changePowerStateTo method's power request. + @param ordinal The number of the desired power state in the power state array. + @result A return code that can be ignored by the caller. */ + + IOReturn changePowerStateToPriv( unsigned long ordinal ); + +/*! @function powerOverrideOnPriv + @abstract Allows a driver to ignore its children's power management requests and only use changePowerStateToPriv to define its own power state. + @discussion Power management normally keeps a device at the highest state required by its requests via @link changePowerStateTo changePowerStateTo@/link, @link changePowerStateToPriv changePowerStateToPriv@/link, and its children. However, a driver may ensure a lower power state than otherwise required by itself and its children using powerOverrideOnPriv. When the override is on, power management keeps the device's power state in the state specified by changePowerStateToPriv. Turning on the override will initiate a power change if the driver's changePowerStateToPriv desired power state is different from the maximum of the changePowerStateTo desired power state and the children's desires. + @result A return code that can be ignored by the caller. */ + + IOReturn powerOverrideOnPriv( void ); + +/*! @function powerOverrideOffPriv + @abstract Allows a driver to disable a power override. + @discussion When a driver has enabled an override via @link powerOverrideOnPriv powerOverrideOnPriv@/link, it can disable it again by calling this method in its superclass. Disabling the override reverts to the default algorithm for determining a device's power state. The superclass will now keep the device at the highest state required by changePowerStateTo, changePowerStateToPriv, and its children. Turning off the override will initiate a power change if the driver's desired power state is different from the maximum of the power managed driver's desire and the children's desires. + @result A return code that can be ignored by the caller. */ + + IOReturn powerOverrideOffPriv( void ); + +/*! @function powerChangeDone + @abstract Tells a driver when a power state change is complete. + @discussion Power management uses this method to inform a driver when a power change is completely done, when all interested parties have acknowledged the @link powerStateDidChangeTo powerStateDidChangeTo@/link call. The default implementation of this method is null; the method is meant to be overridden by subclassed power managed drivers. A driver should use this method to find out if a power change it initiated is complete. + @param stateNumber The number of the state in the state array that the device has switched from. */ + + virtual void powerChangeDone( unsigned long stateNumber ); +}; + +#endif /* ! _IOKIT_IOSERVICE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOServicePM.h.svn-base b/i386/include/IOKit/.svn/text-base/IOServicePM.h.svn-base new file mode 100644 index 0000000..9955e03 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOServicePM.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSERVICEPM_H +#define _IOKIT_IOSERVICEPM_H + +#include + +class IOService; +class IOServicePM; +class IOPowerConnection; +class IOWorkLoop; +class IOCommandGate; +class IOTimerEventSource; +class IOPlatformExpert; + +#endif /* !_IOKIT_IOSERVICEPM_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOSharedDataQueue.h.svn-base b/i386/include/IOKit/.svn/text-base/IOSharedDataQueue.h.svn-base new file mode 100644 index 0000000..fdfa1d6 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOSharedDataQueue.h.svn-base @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSHAREDDATAQUEUE_H +#define _IOKIT_IOSHAREDDATAQUEUE_H + +#ifdef dequeue +#undef dequeue +#endif + +#include + +typedef struct _IODataQueueEntry IODataQueueEntry; + +/*! + * @class IOSharedDataQueue : public IODataQueue + * @abstract A generic queue designed to pass data both from the kernel to a user process and from a user process to the kernel. + * @discussion The IOSharedDataQueue class is designed to also allow a user process to queue data to kernel code. IOSharedDataQueue objects are designed to be used in a single producer / single consumer situation. As such, there are no locks on the data itself. Because the kernel enqueue and user-space dequeue methods follow a strict set of guidelines, no locks are necessary to maintain the integrity of the data struct. + * + *
Each data entry can be variable sized, but the entire size of the queue data region (including overhead for each entry) must be specified up front. + * + *
In order for the IODataQueue instance to notify the user process that data is available, a notification mach port must be set. When the queue is empty and a new entry is added, a message is sent to the specified port. + * + *
In order to make the data queue memory available to a user process, the method getMemoryDescriptor() must be used to get an IOMemoryDescriptor instance that can be mapped into a user process. Typically, the clientMemoryForType() method on an IOUserClient instance will be used to request the IOMemoryDescriptor and then return it to be mapped into the user process. + */ +class IOSharedDataQueue : public IODataQueue +{ + OSDeclareDefaultStructors(IOSharedDataQueue) + + struct ExpansionData { + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +protected: + virtual void free(); + +public: + /*! + * @function withCapacity + * @abstract Static method that creates a new IOSharedDataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in .
This method allocates a new IODataQueue instance and then calls initWithCapacity() with the given size parameter. If the initWithCapacity() fails, the new instance is released and zero is returned. + * @param size The size of the data queue memory region. + * @result Returns the newly allocated IOSharedDataQueue instance. Zero is returned on failure. + */ + static IOSharedDataQueue *withCapacity(UInt32 size); + + /*! + * @function withEntries + * @abstract Static method that creates a new IOSharedDataQueue instance with the specified number of entries of the given size. + * @discussion This method will create a new IOSharedDataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. If the initWithEntries() fails, the new instance is released and zero is returned. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns the newly allocated IOSharedDataQueue instance. Zero is returned on failure. + */ + static IOSharedDataQueue *withEntries(UInt32 numEntries, UInt32 entrySize); + + /*! + * @function initWithCapacity + * @abstract Initializes an IOSharedDataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE and DATA_QUEUE_MEMORY_APPENDIX_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in . + * @param size The size of the data queue memory region. + * @result Returns true on success and false on failure. + */ + virtual Boolean initWithCapacity(UInt32 size); + + /*! + * @function getMemoryDescriptor + * @abstract Returns a memory descriptor covering the IODataQueueMemory region. + * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on. + * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure. + */ + virtual IOMemoryDescriptor *getMemoryDescriptor(); + + /*! + * @function peek + * @abstract Used to peek at the next entry on the queue. + * @discussion This function can be used to look at the next entry which allows the entry to be received without having to copy it with dequeue. In order to do this, call peek to get the entry. Then call dequeue with a NULL data pointer. That will cause the head to be moved to the next entry, but no memory to be copied. + * @result Returns a pointer to the next IODataQueueEntry if one is available. 0 (NULL) is returned if the queue is empty. + */ + virtual IODataQueueEntry * peek(); + + /*! + * @function dequeue + * @abstract Dequeues the next available entry on the queue and copies it into the given data pointer. + * @discussion This function will dequeue the next available entry on the queue. If a data pointer is provided, it will copy the data into the memory region if there is enough space available as specified in the dataSize parameter. If no data pointer is provided, it will simply move the head value past the current entry. + * @param data A pointer to the data memory region in which to copy the next entry data on the queue. If this parameter is 0 (NULL), it will simply move to the next entry. + * @param dataSize A pointer to the size of the data parameter. On return, this contains the size of the actual entry data - even if the original size was not large enough. + * @result Returns true on success and false on failure. Typically failure means that the queue is empty. + */ + virtual Boolean dequeue(void *data, UInt32 *dataSize); + + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 0); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 1); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 2); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 3); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 4); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 5); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 6); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 7); +}; + +#endif /* _IOKIT_IOSHAREDDATAQUEUE_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOSharedLock.h.svn-base b/i386/include/IOKit/.svn/text-base/IOSharedLock.h.svn-base new file mode 100644 index 0000000..59b47ec --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOSharedLock.h.svn-base @@ -0,0 +1,86 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Multiprocessor locks used within the shared memory area between the + * kernel and event system. These must work in both user and kernel mode. + * + * These routines are public, for the purpose of writing frame buffer device + * drivers which handle their own cursors. Certain architectures define a + * generic display class which handles cursor drawing and is subclassed by + * driver writers. These drivers need not be concerned with the following + * types and definitions. + * + * The ev_lock(), ev_unlock(), and ev_try_lock() functions are available only + * to drivers built in or dynamically loaded into the kernel, and to DPS + * drivers built in or dynamically loaded into the Window Server. They do not + * exist in any shared library. + * + * --> They're now in IOKit user lib. + */ + +#ifndef _IOKIT_IOSHAREDLOCK_H +#define _IOKIT_IOSHAREDLOCK_H + +#ifdef __cplusplus +extern "C" { +#endif + +// should be 32 bytes on PPC +typedef volatile int IOSharedLockData; +typedef IOSharedLockData * IOSharedLock; + +#define IOSpinLockInit(l) (*(l) = (IOSharedLockData)0) + + +extern void IOSpinUnlock(IOSharedLock l); +extern boolean_t IOTrySpinLock(IOSharedLock l); + +/* exact same stuff & implementation */ + +typedef IOSharedLockData ev_lock_data_t; +typedef ev_lock_data_t * ev_lock_t; + +#define ev_init_lock(l) (*(l) = (ev_lock_data_t)0) +// needs isync? +//#define ev_is_locked(l) (*(l) != (ev_lock_data_t)0) + + +extern void ev_unlock(ev_lock_t l); +extern boolean_t ev_try_lock(ev_lock_t l); + +#ifdef __cplusplus +} +#endif +#endif /* ! _IOKIT_IOSHAREDLOCK_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOSubMemoryDescriptor.h.svn-base b/i386/include/IOKit/.svn/text-base/IOSubMemoryDescriptor.h.svn-base new file mode 100644 index 0000000..0093ea3 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOSubMemoryDescriptor.h.svn-base @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOSUBMEMORYDESCRIPTOR_H +#define _IOSUBMEMORYDESCRIPTOR_H + +#include + +/*! @class IOSubMemoryDescriptor : public IOMemoryDescriptor + @abstract The IOSubMemoryDescriptor object describes a memory area made up of a portion of another IOMemoryDescriptor. + @discussion The IOSubMemoryDescriptor object represents a subrange of memory, specified as a portion of another IOMemoryDescriptor. */ + +class IOSubMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOSubMemoryDescriptor); + +protected: + IOMemoryDescriptor * _parent; + IOByteCount _start; + + virtual void free(); + +public: +/*! @function withSubRange + @abstract Create an IOMemoryDescriptor to describe a subrange of an existing descriptor. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a subrange of the specified memory descriptor. The parent memory descriptor is retained by the new descriptor. + @param of The parent IOMemoryDescriptor of which a subrange is to be used for the new descriptor, which will be retained by the subrange IOMemoryDescriptor. + @param offset A byte offset into the parent memory descriptor's memory. + @param length The length of the subrange. + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOSubMemoryDescriptor * withSubRange(IOMemoryDescriptor *of, + IOByteCount offset, + IOByteCount length, + IOOptionBits options); + + /* + * Initialize or reinitialize an IOSubMemoryDescriptor to describe + * a subrange of an existing descriptor. + * + * An IOSubMemoryDescriptor can be re-used by calling initSubRange + * again on an existing instance -- note that this behavior is not + * commonly supported in other IOKit classes, although it is here. + */ + virtual bool initSubRange( IOMemoryDescriptor * parent, + IOByteCount offset, IOByteCount length, + IODirection withDirection ); + + /* + * IOMemoryDescriptor required methods + */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ); + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); + +#ifdef __LP64__ + virtual +#endif /* __LP64__ */ + IOReturn redirect( task_t safeTask, bool redirect ); + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + + // support map() on kIOMemoryTypeVirtual without prepare() + virtual IOMemoryMap * makeMapping( + IOMemoryDescriptor * owner, + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset, + IOByteCount length ); + + virtual uint64_t getPreparationID( void ); + +}; + +#endif /* !_IOSUBMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOSyncer.h.svn-base b/i386/include/IOKit/.svn/text-base/IOSyncer.h.svn-base new file mode 100644 index 0000000..f6dfce3 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOSyncer.h.svn-base @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOSYNCER_H +#define _IOSYNCER_H + +#include +#include +#include + +class IOSyncer : public OSObject +{ + OSDeclareDefaultStructors(IOSyncer) + +private: + // The spin lock that is used to guard the 'threadMustStop' variable. + IOSimpleLock *guardLock; + volatile bool threadMustStop; + IOReturn fResult; + virtual void free(); + virtual void privateSignal(); + +public: + + static IOSyncer * create(bool twoRetains = true) + APPLE_KEXT_DEPRECATED; + + virtual bool init(bool twoRetains) + APPLE_KEXT_DEPRECATED; + virtual void reinit() + APPLE_KEXT_DEPRECATED; + virtual IOReturn wait(bool autoRelease = true) + APPLE_KEXT_DEPRECATED; + virtual void signal(IOReturn res = kIOReturnSuccess, + bool autoRelease = true) + APPLE_KEXT_DEPRECATED; +}; + +#endif /* !_IOSYNCER */ + diff --git a/i386/include/IOKit/.svn/text-base/IOTimeStamp.h.svn-base b/i386/include/IOKit/.svn/text-base/IOTimeStamp.h.svn-base new file mode 100644 index 0000000..b1b0905 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOTimeStamp.h.svn-base @@ -0,0 +1,189 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef IOKIT_IOTIMESTAMP_H +#define IOKIT_IOTIMESTAMP_H + +#include + +static inline void +IOTimeStampStartConstant(unsigned int csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_START, a, b, c, d, 0); +} + +static inline void +IOTimeStampEndConstant(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_END, a, b, c, d, 0); +} + +static inline void +IOTimeStampConstant(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_NONE, a, b, c, d, 0); +} + +#if KDEBUG + +static inline void +IOTimeStampStart(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(csc | DBG_FUNC_START, a, b, c, d, 0); +} + +static inline void +IOTimeStampEnd(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(csc | DBG_FUNC_END, a, b, c, d, 0); +} + +static inline void +IOTimeStamp(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(csc | DBG_FUNC_NONE, a, b, c, d, 0); +} + +#endif /* KDEBUG */ + +#define IODBG_STORAGE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSTORAGE, code)) +#define IODBG_NETWORK(code) (KDBG_CODE(DBG_IOKIT, DBG_IONETWORK, code)) +#define IODBG_KEYBOARD(code) (KDBG_CODE(DBG_IOKIT, DBG_IOKEYBOARD, code)) +#define IODBG_HID(code) (KDBG_CODE(DBG_IOKIT, DBG_IOHID, code)) +#define IODBG_AUDIO(code) (KDBG_CODE(DBG_IOKIT, DBG_IOAUDIO, code)) +#define IODBG_SERIAL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERIAL, code)) +#define IODBG_TTY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOTTY, code)) +#define IODBG_SAM(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAM, code)) +#define IODBG_PARALLELATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELATA, code)) +#define IODBG_PARALLELSCSI(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELSCSI, code)) +#define IODBG_SATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSATA, code)) +#define IODBG_SAS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAS, code)) +#define IODBG_FIBRECHANNEL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIBRECHANNEL, code)) +#define IODBG_USB(code) (KDBG_CODE(DBG_IOKIT, DBG_IOUSB, code)) +#define IODBG_BLUETOOTH(code) (KDBG_CODE(DBG_IOKIT, DBG_IOBLUETOOTH, code)) +#define IODBG_FIREWIRE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIREWIRE, code)) +#define IODBG_INFINIBAND(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINFINIBAND, code)) + + +/* Backwards compatibility */ +#define IODBG_DISK(code) IODBG_STORAGE(code) +#define IODBG_POINTING(code) IODBG_HID(code) + + +/* IOKit infrastructure subclasses */ +#define IODBG_WORKLOOP(code) (KDBG_CODE(DBG_IOKIT, DBG_IOWORKLOOP, code)) +#define IODBG_INTES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTES, code)) +#define IODBG_TIMES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCLKES, code)) +#define IODBG_CMDQ(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCMDQ, code)) +#define IODBG_MCURS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMCURS, code)) +#define IODBG_MDESC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMDESC, code)) +#define IODBG_POWER(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPOWER, code)) +#define IODBG_IOSERVICE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERVICE, code)) + +/* IOKit specific codes - within each subclass */ + +/* DBG_IOKIT/DBG_IODISK codes */ + +/* DBG_IOKIT/DBG_IONETWORK codes */ + +/* DBG_IOKIT/DBG_IOKEYBOARD codes */ + +/* DBG_IOKIT/DBG_IOHID codes */ + +/* DBG_IOKIT/DBG_IOAUDIO codes */ + +/* DBG_IOKIT/DBG_IOSERIAL codes */ + +/* DBG_IOKIT/DBG_IOTTY codes */ + +/* DBG_IOKIT/DBG_IOWORKLOOP codes */ +#define IOWL_CLIENT 1 /* 0x05010004 */ +#define IOWL_WORK 2 /* 0x05010008 */ + +/* DBG_IOKIT/DBG_IOINTES codes */ +#define IOINTES_CLIENT 1 /* 0x05020004 */ +#define IOINTES_LAT 2 /* 0x05020008 */ +#define IOINTES_SEMA 3 /* 0x0502000c */ +#define IOINTES_INTCTXT 4 /* 0x05020010 */ +#define IOINTES_INTFLTR 5 /* 0x05020014 */ +#define IOINTES_ACTION 6 /* 0x05020018 */ +#define IOINTES_FILTER 7 /* 0x0502001c */ + +/* DBG_IOKIT/DBG_IOTIMES codes */ +#define IOTIMES_CLIENT 1 /* 0x05030004 */ +#define IOTIMES_LAT 2 /* 0x05030008 */ +#define IOTIMES_SEMA 3 /* 0x0503000c */ +#define IOTIMES_ACTION 4 /* 0x05030010 */ + +/* DBG_IOKIT/DBG_IOCMDQ codes */ +#define IOCMDQ_CLIENT 1 /* 0x05040004 */ +#define IOCMDQ_LAT 2 /* 0x05040008 */ +#define IOCMDQ_SEMA 3 /* 0x0504000c */ +#define IOCMDQ_PSEMA 4 /* 0x05040010 */ +#define IOCMDQ_PLOCK 5 /* 0x05040014 */ +#define IOCMDQ_ACTION 6 /* 0x05040018 */ + +/* DBG_IOKIT/DBG_IOMCURS codes */ + +/* DBG_IOKIT/DBG_IOMDESC codes */ + +/* DBG_IOKIT/DBG_IOPOWER codes */ +// See IOKit/pwr_mgt/IOPMlog.h for the power management codes + +/* DBG_IOKIT/DBG_IOSERVICE codes */ +#define IOSERVICE_BUSY 1 /* 0x05080004 */ +#define IOSERVICE_NONBUSY 2 /* 0x05080008 */ +#define IOSERVICE_MODULESTALL 3 /* 0x0508000C */ +#define IOSERVICE_MODULEUNSTALL 4 /* 0x05080010 */ + +#define IOSERVICE_TERMINATE_PHASE1 5 /* 0x05080014 */ +#define IOSERVICE_TERMINATE_REQUEST_OK 6 /* 0x05080018 */ +#define IOSERVICE_TERMINATE_REQUEST_FAIL 7 /* 0x0508001C */ +#define IOSERVICE_TERMINATE_SCHEDULE_STOP 8 /* 0x05080020 */ +#define IOSERVICE_TERMINATE_SCHEDULE_FINALIZE 9 /* 0x05080024 */ +#define IOSERVICE_TERMINATE_WILL 10 /* 0x05080028 */ +#define IOSERVICE_TERMINATE_DID 11 /* 0x0508002C */ +#define IOSERVICE_TERMINATE_DID_DEFER 12 /* 0x05080030 */ +#define IOSERVICE_TERMINATE_FINALIZE 13 /* 0x05080034 */ +#define IOSERVICE_TERMINATE_STOP 14 /* 0x05080038 */ +#define IOSERVICE_TERMINATE_STOP_NOP 15 /* 0x0508003C */ +#define IOSERVICE_TERMINATE_STOP_DEFER 16 /* 0x05080040 */ +#define IOSERVICE_TERMINATE_DONE 17 /* 0x05080044 */ + +#endif /* ! IOKIT_IOTIMESTAMP_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOTimerEventSource.h.svn-base b/i386/include/IOKit/.svn/text-base/IOTimerEventSource.h.svn-base new file mode 100644 index 0000000..7cc0d38 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOTimerEventSource.h.svn-base @@ -0,0 +1,230 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * IOTimerEventSource.h + * + * HISTORY + * 2-Feb-1999 Joe Liu (jliu) created. + * + */ + +#ifndef _IOTIMEREVENTSOURCE +#define _IOTIMEREVENTSOURCE + +#include + +__BEGIN_DECLS +#include +__END_DECLS + +#include +#include + +/*! + @class IOTimerEventSource : public IOEventSource + @abstract Time based event source mechanism. + @discussion An event source that implements a simple timer. A timeout handler is called once the timeout period expires. This timeout handler will be called by the work-loop that this event source is attached to. +

+ Usually a timer event source will be used to implement a timeout. In general when a driver makes a request it will need to setup a call to keep track of when the I/O doesn't complete. This class is designed to make that somewhat easier. +

+ Remember the system doesn't guarantee the accuracy of the callout. It is possible that a higher priority thread is running which will delay the execution of the action routine. In fact the thread will be made runable at the exact requested time, within the accuracy of the CPU's decrementer based interrupt, but the scheduler will then control execution. +*/ +class IOTimerEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOTimerEventSource) + +protected: +/*! @var calloutEntry thread_call entry for preregistered thread callouts */ + void *calloutEntry; + +/*! @var abstime time to wake up next, see enable. */ + AbsoluteTime abstime; + +/*! @struct ExpansionData + @discussion This structure is private to the IOTimerEventSource implementation. + */ + struct ExpansionData + { + SInt32 calloutGeneration; + IOWorkLoop * workLoop; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function timeout + @abstract Function that routes the call from the OS' timeout mechanism into a work-loop context. + @discussion timeout will normally not be called nor overridden by a subclass. If the event source is enabled then close the work-loop's gate and call the action routine. + @param self This argument will be cast to an IOTimerEventSource. */ + static void timeout(void *self); + +/*! @function setTimeoutFunc + @abstract Set's timeout as the function of calloutEntry. + @discussion IOTimerEventSource is based upon the kern/thread_call.h APIs currently. This function allocates the calloutEntry member variable by using thread_call_allocate(timeout, this). If you need to write your own subclass of IOTimerEventSource you probably should override this method to allocate an entry that points to your own timeout routine. */ + virtual void setTimeoutFunc(); + +/*! @function free + @abstract Sub-class implementation of free method, frees calloutEntry */ + virtual void free(); + +/*! @function checkForWork + @abstract Have to implement it is mandatory in $link IOEventSource, but IOTimerEventSources don't actually use this work-loop mechanism. */ + virtual bool checkForWork(); + + virtual void setWorkLoop(IOWorkLoop *workLoop); + +public: + +/*! @typedef Action + @discussion 'C' Function pointer defining the callout routine of this event source. + @param owner Owning target object. Note by a startling coincidence the first parameter in a C callout is currently used to define the target of a C++ member function. + @param sender The object that timed out. */ + typedef void (*Action)(OSObject *owner, IOTimerEventSource *sender); + +/*! @function timerEventSource + @abstract Allocates and returns an initialized timer instance. + @param owner + @param action */ + static IOTimerEventSource * + timerEventSource(OSObject *owner, Action action = 0); + +/*! @function init + @abstract Initializes the timer with an owner, and a handler to call when the timeout expires. + @param owner + @param action */ + virtual bool init(OSObject *owner, Action action = 0); + +/*! @function enable + @abstract Enables a call to the action. + @discussion Allows the action function to be called. If the timer event source was disabled while a call was outstanding and the call wasn't cancelled then it will be rescheduled. So a disable/enable pair will disable calls from this event source. */ + virtual void enable(); + +/*! @function disable + @abstract Disable a timed callout. + @discussion When disable returns the action will not be called until the next time enable(qv) is called. */ + virtual void disable(); + + +/*! @function setTimeoutTicks + @abstract Setup a callback at after the delay in scheduler ticks. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up, in scheduler ticks, whatever that may be. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutTicks(UInt32 ticks); + +/*! @function setTimeoutMS + @abstract Setup a callback at after the delay in milliseconds. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up, time in milliseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutMS(UInt32 ms); + +/*! @function setTimeoutUS + @abstract Setup a callback at after the delay in microseconds. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up, time in microseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutUS(UInt32 us); + +/*! @function setTimeout + @abstract Setup a callback at after the delay in some unit. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up in some defined unit. + @param scale_factor Define the unit of interval, default to nanoseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(UInt32 interval, + UInt32 scale_factor = kNanosecondScale); + +#if !defined(__LP64__) + virtual IOReturn setTimeout(mach_timespec_t interval) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function setTimeout + @abstract Setup a callback at after the delay in decrementer ticks. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up in decrementer ticks. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(AbsoluteTime interval); + +/*! @function wakeAtTimeTicks + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in scheduler quantums, whatever that is? + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeTicks(UInt32 ticks); + +/*! @function wakeAtTimeMS + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in milliseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeMS(UInt32 ms); + +/*! @function wakeAtTimeUS + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in microseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeUS(UInt32 us); + +/*! @function wakeAtTime + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in some unit. + @param scale_factor Define the unit of abstime, default to nanoseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTime(UInt32 abstime, + UInt32 scale_factor = kNanosecondScale); + +#if !defined(__LP64__) + virtual IOReturn wakeAtTime(mach_timespec_t abstime) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function wakeAtTime + @abstract Setup a callback at this absolute time. + @discussion Starts the timer, which will expire at abstime. After it expires, the timer will call the 'action' registered in the init() function. This timer is not periodic, a further call is needed to reset and restart the timer after it expires. + @param abstime Absolute Time when to wake up, counted in 'decrementer' units and starts at zero when system boots. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared by init or IOEventSource::setAction (qqv). */ + virtual IOReturn wakeAtTime(AbsoluteTime abstime); + +/*! @function cancelTimeout + @abstract Disable any outstanding calls to this event source. + @discussion Clear down any oustanding calls. By the time this function completes it is guaranteed that the action will not be called again. */ + virtual void cancelTimeout(); + +private: + static void timeoutAndRelease(void *self, void *wl); + +private: + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 0); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 1); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 2); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 3); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 4); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 5); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 6); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 7); +}; + +#endif /* !_IOTIMEREVENTSOURCE */ diff --git a/i386/include/IOKit/.svn/text-base/IOTypes.h.svn-base b/i386/include/IOKit/.svn/text-base/IOTypes.h.svn-base new file mode 100644 index 0000000..5d20efb --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOTypes.h.svn-base @@ -0,0 +1,238 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_IOTYPES_H +#define __IOKIT_IOTYPES_H + +#ifndef IOKIT +#define IOKIT 1 +#endif /* !IOKIT */ + +#if KERNEL +#include +#else +#include +#include +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef NULL +#if defined (__cplusplus) +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* + * Simple data types. + */ +#ifndef __MACTYPES__ /* CF MacTypes.h */ +#ifndef __TYPES__ /* guess... Mac Types.h */ + +#include +#include + +#endif /* __TYPES__ */ +#endif /* __MACTYPES__ */ + +#if KERNEL +#include +#endif + +typedef UInt32 IOOptionBits; +typedef SInt32 IOFixed; +typedef UInt32 IOVersion; +typedef UInt32 IOItemCount; +typedef UInt32 IOCacheMode; + +typedef UInt32 IOByteCount32; +typedef UInt64 IOByteCount64; + +typedef UInt32 IOPhysicalAddress32; +typedef UInt64 IOPhysicalAddress64; +typedef UInt32 IOPhysicalLength32; +typedef UInt64 IOPhysicalLength64; + +#ifdef __LP64__ +typedef mach_vm_address_t IOVirtualAddress; +#else +typedef vm_address_t IOVirtualAddress; +#endif + +#if defined(__LP64__) && defined(KERNEL) +typedef IOByteCount64 IOByteCount; +#else +typedef IOByteCount32 IOByteCount; +#endif + +typedef IOVirtualAddress IOLogicalAddress; + +#if defined(__LP64__) && defined(KERNEL) + +typedef IOPhysicalAddress64 IOPhysicalAddress; +typedef IOPhysicalLength64 IOPhysicalLength; +#define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32)) +#define IOPhysSize 64 + +#else + +typedef IOPhysicalAddress32 IOPhysicalAddress; +typedef IOPhysicalLength32 IOPhysicalLength; +#define IOPhysical32( hi, lo ) (lo) +#define IOPhysSize 32 + +#endif + + +typedef struct +{ + IOPhysicalAddress address; + IOByteCount length; +} IOPhysicalRange; + +typedef struct +{ + IOVirtualAddress address; + IOByteCount length; +} IOVirtualRange; + +#ifdef __LP64__ +typedef IOVirtualRange IOAddressRange; +#else /* !__LP64__ */ +typedef struct +{ + mach_vm_address_t address; + mach_vm_size_t length; +} IOAddressRange; +#endif /* !__LP64__ */ + +/* + * Map between #defined or enum'd constants and text description. + */ +typedef struct { + int value; + const char *name; +} IONamedValue; + + +/* + * Memory alignment -- specified as a power of two. + */ +typedef unsigned int IOAlignment; + +#define IO_NULL_VM_TASK ((vm_task_t)0) + + +/* + * Pull in machine specific stuff. + */ + +//#include + +#ifndef MACH_KERNEL + +#ifndef __IOKIT_PORTS_DEFINED__ +#define __IOKIT_PORTS_DEFINED__ +typedef struct OSObject * io_object_t; +#endif /* __IOKIT_PORTS_DEFINED__ */ + +#include + +typedef io_object_t io_connect_t; +typedef io_object_t io_enumerator_t; +typedef io_object_t io_iterator_t; +typedef io_object_t io_registry_entry_t; +typedef io_object_t io_service_t; + +#define IO_OBJECT_NULL ((io_object_t) 0) + +#endif /* MACH_KERNEL */ + +// IOConnectMapMemory memoryTypes +enum { + kIODefaultMemoryType = 0 +}; + +enum { + kIODefaultCache = 0, + kIOInhibitCache = 1, + kIOWriteThruCache = 2, + kIOCopybackCache = 3, + kIOWriteCombineCache = 4 +}; + +// IOMemory mapping options +enum { + kIOMapAnywhere = 0x00000001, + + kIOMapCacheMask = 0x00000700, + kIOMapCacheShift = 8, + kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, + kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, + kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, + kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, + kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, + + kIOMapUserOptionsMask = 0x00000fff, + + kIOMapReadOnly = 0x00001000, + + kIOMapStatic = 0x01000000, + kIOMapReference = 0x02000000, + kIOMapUnique = 0x04000000 +}; + +/*! @enum Scale Factors + @discussion Used when a scale_factor parameter is required to define a unit of time. + @constant kNanosecondScale Scale factor for nanosecond based times. + @constant kMicrosecondScale Scale factor for microsecond based times. + @constant kMillisecondScale Scale factor for millisecond based times. + @constant kTickScale Scale factor for the standard (100Hz) tick. + @constant kSecondScale Scale factor for second based times. */ + +enum { + kNanosecondScale = 1, + kMicrosecondScale = 1000, + kMillisecondScale = 1000 * 1000, + kSecondScale = 1000 * 1000 * 1000, + kTickScale = (kSecondScale / 100) +}; + +/* compatibility types */ + + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IOTYPES_H */ diff --git a/i386/include/IOKit/.svn/text-base/IOUserClient.h.svn-base b/i386/include/IOKit/.svn/text-base/IOUserClient.h.svn-base new file mode 100644 index 0000000..c1d7fe5 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOUserClient.h.svn-base @@ -0,0 +1,333 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Changes to this API are expected. + */ + +#ifndef _IOKIT_IOUSERCLIENT_H +#define _IOKIT_IOUSERCLIENT_H + +#include +#include +#include + + +enum { + kIOUCTypeMask = 0x0000000f, + kIOUCScalarIScalarO = 0, + kIOUCScalarIStructO = 2, + kIOUCStructIStructO = 3, + kIOUCScalarIStructI = 4, + + kIOUCForegroundOnly = 0x00000010, +}; + +/*! @enum + @abstract Constant to denote a variable length structure argument to IOUserClient. + @constant kIOUCVariableStructureSize Use in the structures IOExternalMethod, IOExternalAsyncMethod, IOExternalMethodDispatch to specify the size of the structure is variable. +*/ +enum { + kIOUCVariableStructureSize = 0xffffffff +}; + + +typedef IOReturn (IOService::*IOMethod)(void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (IOService::*IOAsyncMethod)(OSAsyncReference asyncRef, + void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (IOService::*IOTrap)(void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +struct IOExternalMethod { + IOService * object; + IOMethod func; + IOOptionBits flags; + IOByteCount count0; + IOByteCount count1; +}; + +struct IOExternalAsyncMethod { + IOService * object; + IOAsyncMethod func; + IOOptionBits flags; + IOByteCount count0; + IOByteCount count1; +}; + +struct IOExternalTrap { + IOService * object; + IOTrap func; +}; + +enum { + kIOUserNotifyMaxMessageSize = 64 +}; + +// keys for clientHasPrivilege +#define kIOClientPrivilegeAdministrator "root" +#define kIOClientPrivilegeLocalUser "local" +#define kIOClientPrivilegeForeground "foreground" + +/*! @enum + @abstract Constants to specify the maximum number of scalar arguments in the IOExternalMethodArguments structure. These constants are documentary since the scalarInputCount, scalarOutputCount fields reflect the actual number passed. + @constant kIOExternalMethodScalarInputCountMax The maximum number of scalars able to passed on input. + @constant kIOExternalMethodScalarOutputCountMax The maximum number of scalars able to passed on output. +*/ +enum { + kIOExternalMethodScalarInputCountMax = 16, + kIOExternalMethodScalarOutputCountMax = 16, +}; + + +struct IOExternalMethodArguments +{ + uint32_t version; + + uint32_t selector; + + mach_port_t asyncWakePort; + io_user_reference_t * asyncReference; + uint32_t asyncReferenceCount; + + const uint64_t * scalarInput; + uint32_t scalarInputCount; + + const void * structureInput; + uint32_t structureInputSize; + + IOMemoryDescriptor * structureInputDescriptor; + + uint64_t * scalarOutput; + uint32_t scalarOutputCount; + + void * structureOutput; + uint32_t structureOutputSize; + + IOMemoryDescriptor * structureOutputDescriptor; + uint32_t structureOutputDescriptorSize; + + uint32_t __reserved[32]; +}; + +typedef IOReturn (*IOExternalMethodAction)(OSObject * target, void * reference, + IOExternalMethodArguments * arguments); +struct IOExternalMethodDispatch +{ + IOExternalMethodAction function; + uint32_t checkScalarInputCount; + uint32_t checkStructureInputSize; + uint32_t checkScalarOutputCount; + uint32_t checkStructureOutputSize; +}; + +enum { +#define IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION 1 + kIOExternalMethodArgumentsCurrentVersion = IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION +}; + + +/*! + @class IOUserClient + @abstract Provides a basis for communication between client applications and I/O Kit objects. +*/ + + +class IOUserClient : public IOService +{ + OSDeclareAbstractStructors(IOUserClient) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. +*/ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData * reserved; + +private: + OSSet * mappings; + UInt8 sharedInstance; + UInt8 __reservedA[3]; + void * __reserved[7]; + +public: + virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * arguments, + IOExternalMethodDispatch * dispatch = 0, OSObject * target = 0, void * reference = 0 ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, io_user_reference_t refCon); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOUserClient, 0); + OSMetaClassDeclareReservedUnused(IOUserClient, 1); +#else + OSMetaClassDeclareReservedUsed(IOUserClient, 0); + OSMetaClassDeclareReservedUsed(IOUserClient, 1); +#endif + OSMetaClassDeclareReservedUnused(IOUserClient, 2); + OSMetaClassDeclareReservedUnused(IOUserClient, 3); + OSMetaClassDeclareReservedUnused(IOUserClient, 4); + OSMetaClassDeclareReservedUnused(IOUserClient, 5); + OSMetaClassDeclareReservedUnused(IOUserClient, 6); + OSMetaClassDeclareReservedUnused(IOUserClient, 7); + OSMetaClassDeclareReservedUnused(IOUserClient, 8); + OSMetaClassDeclareReservedUnused(IOUserClient, 9); + OSMetaClassDeclareReservedUnused(IOUserClient, 10); + OSMetaClassDeclareReservedUnused(IOUserClient, 11); + OSMetaClassDeclareReservedUnused(IOUserClient, 12); + OSMetaClassDeclareReservedUnused(IOUserClient, 13); + OSMetaClassDeclareReservedUnused(IOUserClient, 14); + OSMetaClassDeclareReservedUnused(IOUserClient, 15); + + +protected: + static IOReturn sendAsyncResult(OSAsyncReference reference, + IOReturn result, void *args[], UInt32 numArgs); + static void setAsyncReference(OSAsyncReference asyncRef, + mach_port_t wakePort, + void *callback, void *refcon); + + static IOReturn sendAsyncResult64(OSAsyncReference64 reference, + IOReturn result, io_user_reference_t args[], UInt32 numArgs); + static void setAsyncReference64(OSAsyncReference64 asyncRef, + mach_port_t wakePort, + mach_vm_address_t callback, io_user_reference_t refcon); +public: + + static IOReturn clientHasPrivilege( void * securityToken, + const char * privilegeName ); + + /*! + @function releaseAsyncReference64 + @abstract Release the mach_port_t reference held within the OSAsyncReference64 structure. + @discussion The OSAsyncReference64 structure passed to async methods holds a reference to the wakeup mach port, which should be released to balance each async method call. Behavior is undefined if these calls are not correctly balanced. + @param reference The reference passed to the subclass IOAsyncMethod, or externalMethod() in the IOExternalMethodArguments.asyncReference field. + @result A return code. + */ + static IOReturn releaseAsyncReference64(OSAsyncReference64 reference); + /*! + @function releaseNotificationPort + @abstract Release the mach_port_t passed to registerNotificationPort(). + @discussion The mach_port_t passed to the registerNotificationPort() methods should be released to balance each call to registerNotificationPort(). Behavior is undefined if these calls are not correctly balanced. + @param reference The mach_port_t argument previously passed to the subclass implementation of registerNotificationPort(). + @result A return code. + */ + static IOReturn releaseNotificationPort(mach_port_t port); + + virtual bool init(); + virtual bool init( OSDictionary * dictionary ); + // Currently ignores the all args, just passes up to IOService::init() + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type, + OSDictionary * properties); + + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type); + + virtual void free(); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + virtual IOService * getService( void ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, UInt32 refCon ); + + virtual IOReturn getNotificationSemaphore( UInt32 notification_type, + semaphore_t * semaphore ); + + virtual IOReturn connectClient( IOUserClient * client ); + + // memory will be released by user client when last map is destroyed + virtual IOReturn clientMemoryForType( UInt32 type, + IOOptionBits * options, + IOMemoryDescriptor ** memory ); + +#if !__LP64__ +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOMemoryMap * mapClientMemory( IOOptionBits type, + task_t task, + IOOptionBits mapFlags = kIOMapAnywhere, + IOVirtualAddress atAddress = 0 ); +#endif + +public: + + /*! + @function removeMappingForDescriptor + Remove the first mapping created from the memory descriptor returned by clientMemoryForType() from IOUserClient's list of mappings. If such a mapping exists, it is retained and the reference currently held by IOUserClient is returned to the caller. + @param memory The memory descriptor instance previously returned by the implementation of clientMemoryForType(). + @result A reference to the first IOMemoryMap instance found in the list of mappings created by IOUserClient from that passed memory descriptor is returned, or zero if none exist. The caller should release this reference. + */ + IOMemoryMap * removeMappingForDescriptor(IOMemoryDescriptor * memory); + + /*! + @function exportObjectToClient + Make an arbitrary OSObject available to the client task. + @param task The task. + @param obj The object we want to export to the client. + @param clientObj Returned value is the client's port name. + */ + virtual IOReturn exportObjectToClient(task_t task, + OSObject *obj, io_object_t *clientObj); + + // Old methods for accessing method vector backward compatiblility only + virtual IOExternalMethod * + getExternalMethodForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + virtual IOExternalAsyncMethod * + getExternalAsyncMethodForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + + // Methods for accessing method vector. + virtual IOExternalMethod * + getTargetAndMethodForIndex( IOService ** targetP, UInt32 index ); + virtual IOExternalAsyncMethod * + getAsyncTargetAndMethodForIndex( IOService ** targetP, UInt32 index ); + + // Methods for accessing trap vector - old and new style + virtual IOExternalTrap * + getExternalTrapForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + + virtual IOExternalTrap * + getTargetAndTrapForIndex( IOService **targetP, UInt32 index ); +}; + +#endif /* ! _IOKIT_IOUSERCLIENT_H */ + diff --git a/i386/include/IOKit/.svn/text-base/IOWorkLoop.h.svn-base b/i386/include/IOKit/.svn/text-base/IOWorkLoop.h.svn-base new file mode 100644 index 0000000..808329a --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/IOWorkLoop.h.svn-base @@ -0,0 +1,321 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1998 Apple Computer, Inc. All rights reserved. +HISTORY + 1998-7-13 Godfrey van der Linden(gvdl) + Created. + 1998-10-30 Godfrey van der Linden(gvdl) + Converted to C++ +*/ + +#ifndef __IOKIT_IOWORKLOOP_H +#define __IOKIT_IOWORKLOOP_H + +#include +#include +#include +#include + +#include + +class IOEventSource; +class IOTimerEventSource; +class IOCommandGate; + +/*! @class IOWorkLoop + @discussion An IOWorkLoop is a thread of control that is intended to be used to provide single threaded access to hardware. This class has no knowledge of the nature and type of the events that it marshals and forwards. When a device driver successfully starts (see IOService::start), it is expected to create the event sources it will need to receive events. Then a work loop is initialized and the events are added to the work loop for monitoring. In general this set up will be automated by the family superclass of the specific device. +

+ The thread main method walks the event source linked list and messages each one requesting a work check. At this point each event source is expected to notify its registered owner that the event has occurred. After each event has been walked and each indicates that another loop isn't required (by setting the 'more' flag to false) the thread will go to sleep on a signaling semaphore. +

+ When an event source is registered with a work loop it is informed of the semaphore to use to wake up the loop. +*/ +class IOWorkLoop : public OSObject +{ + OSDeclareDefaultStructors(IOWorkLoop) + +public: +/*! + @typedef Action + @discussion Type and arguments of callout C function that is used when +a runCommand is executed by a client. Cast to this type when you want a C++ +member function to be used. Note the arg1 - arg3 parameters are straight pass +through from the runCommand to the action callout. + @param target + Target of the function, can be used as a refcon. Note if a C++ function +was specified, this parameter is implicitly the first parameter in the target +member function's parameter list. + @param arg0 Argument to action from run operation. + @param arg1 Argument to action from run operation. + @param arg2 Argument to action from run operation. + @param arg3 Argument to action from run operation. +*/ + typedef IOReturn (*Action)(OSObject *target, + void *arg0, void *arg1, + void *arg2, void *arg3); + enum { + kPreciousStack = 0x00000001 + }; + +private: +/*! @function threadMainContinuation + @abstract Static function that calls the threadMain function. +*/ + static void threadMainContinuation(IOWorkLoop *self); + +protected: + +/*! @typedef maintCommandEnum + @discussion Enumeration of commands that _maintCommand can deal with. + @constant mAddEvent Used to tag a Remove event source command. + @constant mRemoveEvent Used to tag a Remove event source command. +*/ + typedef enum { mAddEvent, mRemoveEvent } maintCommandEnum; + +/*! @var gateLock + Mutual exclusion lock that is used by close and open Gate functions. + This is a recursive lock, which allows multiple layers of code to share a single IOWorkLoop without deadlock. This is common in IOKit since threads of execution tend to follow the service plane in the IORegistry, and multiple objects along the call path may acquire the gate for the same (shared) workloop. +*/ + IORecursiveLock *gateLock; + +/*! @var eventChain + Pointer to first event source in linked list. +*/ + IOEventSource *eventChain; + +/*! @var controlG + Internal control gate to maintain event system. +*/ + IOCommandGate *controlG; + +/*! @var workToDoLock + The spin lock that is used to guard the 'workToDo' variable. +*/ + IOSimpleLock *workToDoLock; + +/*! @var workThread + Work loop thread. +*/ + IOThread workThread; + +/*! @var workToDo + Used to to indicate that an interrupt has fired and needs to be processed. +*/ + volatile bool workToDo; + +/*! @var loopRestart + Set if an event chain has been changed and the system has to be rechecked from start. (Internal use only) +*/ + bool loopRestart; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. +*/ + struct ExpansionData { + IOOptionBits options; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +/*! @function _maintRequest + @abstract Synchronous implementation of addEventSource and removeEventSource functions. + @discussion This function implements the commands as defined in the maintCommandEnum. It can be subclassed but it isn't an external API in the usual sense. A subclass implementation of _maintRequest would be called synchronously with respect to the work loop and it should be implemented in the usual way that an ioctl would be. + @return kIOReturnUnsupported if the command given is not implemented, kIOReturnSuccess otherwise. +*/ + virtual IOReturn _maintRequest(void *command, void *data, void *, void *); + +/*! @function free + @discussion Mandatory free of the object independent of the current retain count. If the work loop is running, this method will not return until the thread has successfully terminated. Each event source in the chain will be released and the working semaphore will be destroyed. +

+ If the client has some outstanding requests on an event they will never be informed of completion. If an external thread is blocked on any of the event sources they will be awakened with a KERN_INTERUPTED status. +*/ + virtual void free(); + +/*! @function threadMain + @discussion Work loop threads main function. This function consists of 3 + loops: the outermost loop is the semaphore clear and wait loop, the middle + loop terminates when there is no more work, and the inside loop walks the + event list calling the checkForWork method in each event source. If an + event source has more work to do, it can set the more flag and the middle + loop will repeat. When no more work is outstanding the outermost will + sleep until an event is signalled. +*/ + virtual void threadMain(); + +public: + +/*! @function workLoop + @abstract Factory member function to construct and intialize a work loop. + @result Returns a workLoop instance if constructed successfully, 0 otherwise. +*/ + static IOWorkLoop *workLoop(); + +/*! @function workLoopWithOptions(IOOptionBits options) + @abstract Factory member function to constuct and intialize a work loop. + @param options Options - kPreciousStack to avoid stack deallocation on paging path. + @result Returns a workLoop instance if constructed successfully, 0 otherwise. +*/ + static IOWorkLoop *workLoopWithOptions(IOOptionBits options); + +/*! @function init + @discussion Initializes an instance of the workloop. This method creates and initializes the signaling semaphore, the controller gate lock, and spawns the thread that will continue executing. + @result Returns true if initialized successfully, false otherwise. +*/ + virtual bool init(); + +/*! @function getThread + @abstract Gets the workThread. + @result Returns workThread. +*/ + virtual IOThread getThread() const; + +/*! @function onThread + @abstract Is the current execution context on the work thread? + @result Returns true if IOThreadSelf() == workThread. +*/ + virtual bool onThread() const; + +/*! @function inGate + @abstract Is the current execution context holding the work-loop's gate? + @result Returns true if IOThreadSelf() is gate holder. +*/ + virtual bool inGate() const; + +/*! @function addEventSource + @discussion Add an event source to be monitored by the work loop. This function does not return until the work loop has acknowledged the arrival of the new event source. When a new event has been added the threadMain will always restart its loop and check all outstanding events. The event source is retained by the work loop. + @param newEvent Pointer to IOEventSource subclass to add. + @result Always returns kIOReturnSuccess. +*/ + virtual IOReturn addEventSource(IOEventSource *newEvent); + +/*! @function removeEventSource + @discussion Remove an event source from the work loop. This function does not return until the work loop has acknowledged the removal of the event source. When an event has been removed the threadMain will always restart its loop and check all outstanding events. The event source will be released before return. + @param toRemove Pointer to IOEventSource subclass to remove. + @result Returns kIOReturnSuccess if successful, kIOReturnBadArgument if toRemove couldn't be found. +*/ + virtual IOReturn removeEventSource(IOEventSource *toRemove); + +/*! @function enableAllEventSources + @abstract Calls enable() in all event sources. + @discussion For all event sources in eventChain, call enable() function. See IOEventSource::enable(). +*/ + virtual void enableAllEventSources() const; + +/*! @function disableAllEventSources + @abstract Calls disable() in all event sources. + @discussion For all event sources in eventChain, call disable() function. See IOEventSource::disable(). +*/ + virtual void disableAllEventSources() const; + +/*! @function enableAllInterrupts + @abstract Calls enable() in all interrupt event sources. + @discussion For all event sources (ES) for which IODynamicCast(IOInterruptEventSource, ES) is valid, in eventChain call enable() function. See IOEventSource::enable(). +*/ + virtual void enableAllInterrupts() const; + +/*! @function disableAllInterrupts + @abstract Calls disable() in all interrupt event sources. + @discussion For all event sources (ES) for which IODynamicCast(IOInterruptEventSource, ES) is valid, in eventChain call disable() function. See IOEventSource::disable(). +*/ + virtual void disableAllInterrupts() const; + + +protected: + // Internal APIs used by event sources to control the thread + friend class IOEventSource; + friend class IOTimerEventSource; + virtual void signalWorkAvailable(); + virtual void openGate(); + virtual void closeGate(); + virtual bool tryCloseGate(); + virtual int sleepGate(void *event, UInt32 interuptibleType); + virtual void wakeupGate(void *event, bool oneThread); + +public: + /* methods available in Mac OS X 10.1 or later */ + +/*! @function runAction + @abstract Single thread a call to an action with the work-loop. + @discussion Client function that causes the given action to be called in a single threaded manner. Beware: the work-loop's gate is recursive and runAction can cause direct or indirect re-entrancy. When executing on a client's thread, runAction will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources. + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result Returns the value of the Action callout. +*/ + virtual IOReturn runAction(Action action, OSObject *target, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function runEventSources + @discussion Consists of the inner 2 loops of the threadMain function(qv). + The outer loop terminates when there is no more work, and the inside loop + walks the event list calling the checkForWork method in each event source. + If an event source has more work to do, it can set the more flag and the + outer loop will repeat. +

+ This function can be used to clear a priority inversion between the normal + workloop thread and multimedia's real time threads. The problem is that + the interrupt action routine is often held off by high priority threads. + So if they want to get their data now they will have to call us and ask if + any data is available. The multi-media user client will arrange for this + function to be called, which causes any pending interrupts to be processed + and the completion routines called. By the time the function returns all + outstanding work will have been completed at the real time threads + priority. + + @result Return false if the work loop is shutting down, true otherwise. +*/ + virtual bool runEventSources(); + +protected: + // Internal APIs used by event sources to control the thread + virtual int sleepGate(void *event, AbsoluteTime deadline, UInt32 interuptibleType); + +protected: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOWorkLoop, 0); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 1); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 2); +#else + OSMetaClassDeclareReservedUsed(IOWorkLoop, 0); + OSMetaClassDeclareReservedUsed(IOWorkLoop, 1); + OSMetaClassDeclareReservedUsed(IOWorkLoop, 2); +#endif + OSMetaClassDeclareReservedUnused(IOWorkLoop, 3); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 4); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 5); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 6); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 7); +}; + +#endif /* !__IOKIT_IOWORKLOOP_H */ diff --git a/i386/include/IOKit/.svn/text-base/OSMessageNotification.h.svn-base b/i386/include/IOKit/.svn/text-base/OSMessageNotification.h.svn-base new file mode 100644 index 0000000..7d7b5e5 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/OSMessageNotification.h.svn-base @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __OS_OSMESSAGENOTIFICATION_H +#define __OS_OSMESSAGENOTIFICATION_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +enum { + kFirstIOKitNotificationType = 100, + kIOServicePublishNotificationType = 100, + kIOServiceMatchedNotificationType = 101, + kIOServiceTerminatedNotificationType = 102, + kIOAsyncCompletionNotificationType = 150, + kIOServiceMessageNotificationType = 160, + kLastIOKitNotificationType = 199 +}; + +enum { + kOSNotificationMessageID = 53, + kOSAsyncCompleteMessageID = 57, + kMaxAsyncArgs = 16 +}; + +enum { + kIOAsyncReservedIndex = 0, + kIOAsyncReservedCount, + + kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, + kIOAsyncCalloutRefconIndex, + kIOAsyncCalloutCount, + + kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, + kIOMatchingCalloutRefconIndex, + kIOMatchingCalloutCount, + + kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, + kIOInterestCalloutRefconIndex, + kIOInterestCalloutServiceIndex, + kIOInterestCalloutCount +}; + + + +// -------------- +enum { + kOSAsyncRef64Count = 8, + kOSAsyncRef64Size = kOSAsyncRef64Count * ((int) sizeof(io_user_reference_t)) +}; +typedef io_user_reference_t OSAsyncReference64[kOSAsyncRef64Count]; + +struct OSNotificationHeader64 { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference64 reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent64 { + natural_t messageType; + io_user_reference_t messageArgument[1]; +}; +#pragma pack() +// -------------- + +#if !KERNEL_USER32 + +enum { + kOSAsyncRefCount = 8, + kOSAsyncRefSize = 32 +}; +typedef natural_t OSAsyncReference[kOSAsyncRefCount]; + +struct OSNotificationHeader { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent { + natural_t messageType; + void * messageArgument[1]; +}; +#pragma pack() + +#endif /* KERNEL_USER32 */ + +struct IOAsyncCompletionContent { + IOReturn result; +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + void * args[] __attribute__ ((packed)); +#else + void * args[0] __attribute__ ((packed)); +#endif +}; + +#ifndef __cplusplus +typedef struct OSNotificationHeader OSNotificationHeader; +typedef struct IOServiceInterestContent IOServiceInterestContent; +typedef struct IOAsyncCompletionContent IOAsyncCompletionContent; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __OS_OSMESSAGENOTIFICATION_H */ + diff --git a/i386/include/IOKit/.svn/text-base/assert.h.svn-base b/i386/include/IOKit/.svn/text-base/assert.h.svn-base new file mode 100644 index 0000000..4c56050 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/assert.h.svn-base @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IO_ASSERT_H_ +#define _IO_ASSERT_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if IOASSERT +#undef MACH_ASSERT +#define MACH_ASSERT 1 +#endif +#include + +#ifdef __cplusplus +} +#endif + + +#if( !defined( OSCompileAssert ) ) +# define OSCompileAssert( TEST ) \ + extern int OSCompileAssertFailed[ ( TEST ) ? 1 : -1 ] __unused; +#endif + +#endif /* _IO_ASSERT_H_ */ + diff --git a/i386/include/IOKit/.svn/text-base/system.h.svn-base b/i386/include/IOKit/.svn/text-base/system.h.svn-base new file mode 100644 index 0000000..7092d59 --- /dev/null +++ b/i386/include/IOKit/.svn/text-base/system.h.svn-base @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_SYSTEM_H +#define __IOKIT_SYSTEM_H + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif + +#include + +__BEGIN_DECLS + +#include +#include +#include + +#include +#include +#include + +#include /* Must be before other includes of kern/assert.h */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#ifndef _MISC_PROTOS_H_ +extern void _doprnt( const char *format, va_list *arg, + void (*lputc)(char), int radix ); +#endif + +__END_DECLS + +#endif /* !__IOKIT_SYSTEM_H */ diff --git a/i386/include/IOKit/IOBSD.h b/i386/include/IOKit/IOBSD.h new file mode 100644 index 0000000..8938656 --- /dev/null +++ b/i386/include/IOKit/IOBSD.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBSD_H +#define _IOBSD_H + +/* + * bsd-related registry properties + */ + +#define kIOBSDNameKey "BSD Name" // (an OSString) +#define kIOBSDNamesKey "BSD Names" // (an OSDictionary of OSString's, for links) +#define kIOBSDMajorKey "BSD Major" // (an OSNumber) +#define kIOBSDMinorKey "BSD Minor" // (an OSNumber) +#define kIOBSDUnitKey "BSD Unit" // (an OSNumber) + +#endif /* !_IOBSD_H */ diff --git a/i386/include/IOKit/IOBufferMemoryDescriptor.h b/i386/include/IOKit/IOBufferMemoryDescriptor.h new file mode 100644 index 0000000..0926e5b --- /dev/null +++ b/i386/include/IOKit/IOBufferMemoryDescriptor.h @@ -0,0 +1,261 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOBUFFERMEMORYDESCRIPTOR_H +#define _IOBUFFERMEMORYDESCRIPTOR_H + +#include + +enum { + kIOMemoryPhysicallyContiguous = 0x00000010, + kIOMemoryPageable = 0x00000020, + kIOMemoryPurgeable = 0x00000040, + kIOMemorySharingTypeMask = 0x000f0000, + kIOMemoryUnshared = 0x00000000, + kIOMemoryKernelUserShared = 0x00010000, + // shared IOMemoryDescriptor options for IOBufferMemoryDescriptor: + kIOBufferDescriptorMemoryFlags = kIOMemoryDirectionMask + | kIOMemoryThreadSafe +}; + +#define _IOBUFFERMEMORYDESCRIPTOR_INTASKWITHOPTIONS_ 1 +/*! + @class IOBufferMemoryDescriptor + @abstract Provides a simple memory descriptor that allocates its own buffer memory. +*/ + +class IOBufferMemoryDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructors(IOBufferMemoryDescriptor); + +private: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { + IOMemoryMap * map; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +protected: + void * _buffer; + vm_size_t _capacity; + vm_offset_t _alignment; + IOOptionBits _options; +private: + uintptr_t _internalReserved; + unsigned _internalFlags; + +private: +#ifndef __LP64__ + virtual bool initWithOptions( + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment, + task_t inTask) APPLE_KEXT_DEPRECATED; /* use withOptions() instead */ +#endif /* !__LP64__ */ + + virtual bool initWithPhysicalMask( + task_t inTask, + IOOptionBits options, + mach_vm_size_t capacity, + mach_vm_address_t alignment, + mach_vm_address_t physicalMask); + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 0); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 1); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOBufferMemoryDescriptor, 0); + OSMetaClassDeclareReservedUsed(IOBufferMemoryDescriptor, 1); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 7); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 8); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 9); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 10); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 11); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 12); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 13); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 14); + OSMetaClassDeclareReservedUnused(IOBufferMemoryDescriptor, 15); + +protected: + virtual void free(); + +public: + + /* + * withOptions: + * + * Returns a new IOBufferMemoryDescriptor with a buffer large enough to + * hold capacity bytes. The descriptor's length is initially set to the + * capacity. + */ +#ifndef __LP64__ + virtual bool initWithOptions( IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment) APPLE_KEXT_DEPRECATED; /* use withOptions() instead */ +#endif /* !__LP64__ */ + + static IOBufferMemoryDescriptor * withOptions( IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment = 1); + +/*! @function inTaskWithOptions + @abstract Creates a memory buffer with memory descriptor for that buffer. + @discussion Added in Mac OS X 10.2, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + @param inTask The task the buffer will be allocated in. + @param options Options for the allocation:
+ kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ kIOMemoryPageable - pass to request memory be non-wired - the default for kernel allocated memory is wired.
+ kIOMemoryPurgeable - pass to request memory that may later have its purgeable state set with IOMemoryDescriptor::setPurgeable. Only supported for kIOMemoryPageable allocations.
+ kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications. + @param capacity The number of bytes to allocate. + @param alignment The minimum required alignment of the buffer in bytes - 1 is the default for no required alignment. For example, pass 256 to get memory allocated at an address with bits 0-7 zero. + @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithOptions( + task_t inTask, + IOOptionBits options, + vm_size_t capacity, + vm_offset_t alignment = 1); + +/*! @function inTaskWithPhysicalMask + @abstract Creates a memory buffer with memory descriptor for that buffer. + @discussion Added in Mac OS X 10.5, this method allocates a memory buffer with a given size and alignment in the task's address space specified, and returns a memory descriptor instance representing the memory. It is recommended that memory allocated for I/O or sharing via mapping be created via IOBufferMemoryDescriptor. Options passed with the request specify the kind of memory to be allocated - pageablity and sharing are specified with option bits. This function may block and so should not be called from interrupt level or while a simple lock is held. + @param inTask The task the buffer will be mapped in. Pass NULL to create memory unmapped in any task (eg. for use as a DMA buffer). + @param options Options for the allocation:
+ kIODirectionOut, kIODirectionIn - set the direction of the I/O transfer.
+ kIOMemoryPhysicallyContiguous - pass to request memory be physically contiguous. This option is heavily discouraged. The request may fail if memory is fragmented, may cause large amounts of paging activity, and may take a very long time to execute.
+ kIOMemoryKernelUserShared - pass to request memory that will be mapped into both the kernel and client applications. + @param capacity The number of bytes to allocate. + @param mask The buffer will be allocated with pages such that physical addresses will only have bits set present in physicalMask. For example, pass 0x00000000FFFFFFFFULL for a buffer to be accessed by hardware that has 32 address bits. + @result Returns an instance of class IOBufferMemoryDescriptor to be released by the caller, which will free the memory desriptor and associated buffer. */ + + static IOBufferMemoryDescriptor * inTaskWithPhysicalMask( + task_t inTask, + IOOptionBits options, + mach_vm_size_t capacity, + mach_vm_address_t physicalMask); + + /* + * withCapacity: + * + * Returns a new IOBufferMemoryDescriptor with a buffer large enough to + * hold capacity bytes. The descriptor's length is initially set to the + * capacity. + */ + static IOBufferMemoryDescriptor * withCapacity( + vm_size_t capacity, + IODirection withDirection, + bool withContiguousMemory = false); +#ifndef __LP64__ + virtual bool initWithBytes(const void * bytes, + vm_size_t withLength, + IODirection withDirection, + bool withContiguousMemory = false) APPLE_KEXT_DEPRECATED; /* use withBytes() instead */ +#endif /* !__LP64__ */ + + /* + * withBytes: + * + * Returns a new IOBufferMemoryDescriptor preloaded with bytes (copied). + * The descriptor's length and capacity are set to the input buffer's size. + */ + static IOBufferMemoryDescriptor * withBytes( + const void * bytes, + vm_size_t withLength, + IODirection withDirection, + bool withContiguousMemory = false); + + /* + * setLength: + * + * Change the buffer length of the memory descriptor. When a new buffer + * is created, the initial length of the buffer is set to be the same as + * the capacity. The length can be adjusted via setLength for a shorter + * transfer (there is no need to create more buffer descriptors when you + * can reuse an existing one, even for different transfer sizes). Note + * that the specified length must not exceed the capacity of the buffer. + */ + virtual void setLength(vm_size_t length); + + /* + * setDirection: + * + * Change the direction of the transfer. This method allows one to redirect + * the descriptor's transfer direction. This eliminates the need to destroy + * and create new buffers when different transfer directions are needed. + */ + virtual void setDirection(IODirection direction); + + /* + * getCapacity: + * + * Get the buffer capacity + */ + virtual vm_size_t getCapacity() const; + + /* + * getBytesNoCopy: + * + * Return the virtual address of the beginning of the buffer + */ + virtual void *getBytesNoCopy(); + + /* + * getBytesNoCopy: + * + * Return the virtual address of an offset from the beginning of the buffer + */ + virtual void *getBytesNoCopy(vm_size_t start, vm_size_t withLength); + + /* + * appendBytes: + * + * Add some data to the end of the buffer. This method automatically + * maintains the memory descriptor buffer length. Note that appendBytes + * will not copy past the end of the memory descriptor's current capacity. + */ + virtual bool appendBytes(const void *bytes, vm_size_t withLength); + +#ifndef __LP64__ + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; /* use getBytesNoCopy() instead */ +#endif /* !__LP64__ */ +}; + +#endif /* !_IOBUFFERMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/IOCatalogue.h b/i386/include/IOKit/IOCatalogue.h new file mode 100644 index 0000000..f087396 --- /dev/null +++ b/i386/include/IOKit/IOCatalogue.h @@ -0,0 +1,272 @@ +/* + * Copyright (c) 1998-2000 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOCATALOGUE_H +#define _IOKIT_IOCATALOGUE_H + +#include +#include +#include +#include +#include +#include + +#include + +class IOService; + +/*! + @class IOCatalogue + @abstract In-kernel database for IOKit driver personalities. + @discussion The IOCatalogue is a database which contains all IOKit driver personalities. IOService uses this resource when matching devices to their associated drivers. +*/ +class IOCatalogue : public OSObject +{ + OSDeclareDefaultStructors(IOCatalogue) + +private: + OSCollectionIterator * kernelTables; + OSArray * array; + IOLock * lock; + SInt32 generation; + +/* This stuff is no longer used at all but was exported in prior + * releases, so we keep it around for PPC/i386 only. + */ +#if __ppc__ || __i386__ + IOLock * kld_lock; +#endif /* __ppc__ || __i386__ */ + +public: + /*! + @function initialize + @abstract Creates and initializes the database object and poputates it with in-kernel driver personalities. + */ + static void initialize( void ); + + /*! + @function init + @abstract Initializes the database object. + @param initArray The initial array of driver personalities to populate the database. + */ + bool init( OSArray * initArray ); + + /*! + @function free + @abstract Cleans up the database and deallocates memory allocated at initialization. This is never called in normal operation of the system. + */ + void free( void ); + + /*! + @function findDrivers + @abstract This is the primary entry point for IOService. + @param service + @param generationCount Returns a reference to the generation count of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated. + @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver. + */ + OSOrderedSet * findDrivers( IOService * service, SInt32 * generationCount ); + + /*! + @function findDrivers + @abstract A more general purpose interface which allows one to retreive driver personalities based the intersection of the 'matching' dictionary and the personality's own property list. + @param matching A dictionary containing only keys and values which are to be used for matching. For example, a matching dictionary containing 'IOProviderClass'='IOPCIDevice' will return all personalities with an IOProviderClass key and a value of IOPCIDevice. + @param generationCount Returns a reference to the current generation of the database. The generation count increases only when personalities are added to the database *and* IOService matching has been initiated. + @result Returns an ordered set of driver personalities ranked on probe-scores. The ordered set must be released by the receiver. + */ + OSOrderedSet * findDrivers( OSDictionary * matching, SInt32 * generationCount ); + + /*! + @function addDrivers + @abstract Adds an array of driver personalities to the database. + @param array Array of driver personalities to be added to the database. + @param doNubMatchng Start matching process after personalities have been added. + @result Returns true if driver personality was added to the database successfully. Failure is due to a memory allocation failure. + */ + bool addDrivers( OSArray * array, bool doNubMatching = true ); + + /*! + @function removeDrivers + @abstract Remove driver personalities from the database based on matching information provided. + @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will remove all personalities which have the key 'IOProviderClass' equal to 'IOPCIDevice'. + @param doNubMatchng Start matching process after personalities have been removed. Matching criteria is based on IOProviderClass of those personalities which were removed. This is to allow drivers which haven't been matched to match against NUB's which were blocked by the previous personalities. + @result Returns true if personality was removed successfully. Failure is due to a memory allocation failure. + */ + bool removeDrivers( OSDictionary * matching, bool doNubMatching = true ); + + /*! + @function getGenerationCount + @abstract Get the current generation count of the database. + */ + SInt32 getGenerationCount( void ) const; + + /*! + @function isModuleLoaded + @abstract Reports if a kernel module has been loaded. + @param moduleName Name of the module. + @result Returns true if the associated kernel module has been loaded into the kernel. + */ + bool isModuleLoaded( OSString * moduleName ) const; + + /*! + @function isModuleLoaded + @abstract Reports if a kernel module has been loaded. + @param moduleName Name of the module. + @result Returns true if the associated kernel module has been loaded into the kernel. + */ + bool isModuleLoaded( const char * moduleName ) const; + + /*! + @function isModuleLoaded + @abstract Reports if a kernel module has been loaded for a particular personality. + @param driver A driver personality's property list. + @result Returns true if the associated kernel module has been loaded into the kernel for a particular driver personality on which it depends. + */ + bool isModuleLoaded( OSDictionary * driver ) const; + + /*! + @function moduleHasLoaded + @abstract Callback function called after a IOKit dependent kernel module is loaded. + @param name Name of the kernel module. + */ + void moduleHasLoaded( OSString * name ); + + /*! + @function moduleHasLoaded + @abstract Callback function called after a IOKit dependent kernel module is loaded. + @param name Name of the kernel module. + */ + void moduleHasLoaded( const char * name ); + + /*! + @function terminateDrivers + @abstract Terminates all instances of a driver which match the contents of the matching dictionary. Does not unload module. + @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will cause termination for all instances whose personalities have the key 'IOProviderClass' equal to 'IOPCIDevice'. + */ + IOReturn terminateDrivers( OSDictionary * matching ); + + /*! + @function terminateDriversForModule + @abstract Terminates all instances of a driver which depends on a particular module and unloads the module. + @param moduleName Name of the module which is used to determine which driver instances to terminate and unload. + @param unload Flag to cause the actual unloading of the module. + */ + IOReturn terminateDriversForModule( OSString * moduleName, bool unload = true); + + /*! + @function terminateDriversForModule + @abstract Terminates all instances of a driver which depends on a particular module and unloads the module. + @param moduleName Name of the module which is used to determine which driver instances to terminate and unload. + @param unload Flag to cause the actual unloading of the module. + */ + IOReturn terminateDriversForModule( const char * moduleName, bool unload = true); + + /*! + @function startMatching + @abstract Starts an IOService matching thread where matching keys and values are provided by the matching dictionary. + @param matching A dictionary whose keys and values are used for matching personalities in the database. For example, a matching dictionary containing a 'IOProviderClass' key with the value 'IOPCIDevice' will start matching for all personalities which have the key 'IOProviderClass' equal to 'IOPCIDevice'. + */ + bool startMatching( OSDictionary * matching ); + + /*! + @function reset + @abstract Return the Catalogue to its initial state. + */ + void reset(void); + + /*! + @function serialize + @abstract Serializes the catalog for transport to the user. + @param s The serializer object. + @result Returns false if unable to serialize database, most likely due to memory shortage. + */ + virtual bool serialize(OSSerialize * s) const; + + bool serializeData(IOOptionBits kind, OSSerialize * s) const; + +/* This stuff is no longer used at all we keep it around for PPC/i386 + * binary compatibility only. Symbols are no longer exported. + */ +#if __ppc__ || __i386__ + /*! + @function recordStartupExtensions + @abstract Records extensions made available by the primary booter. +

+ This function is for internal use by the kernel startup linker. + Kernel extensions should never call it. + @result Returns true if startup extensions were successfully recorded, + false if not. + */ + virtual bool recordStartupExtensions(void); + + /*! + @function addExtensionsFromArchive() + @abstract Records an archive of extensions, as from device ROM. +

+ This function is currently for internal use. + Kernel extensions should never call it. + @param mkext An OSData object containing a multikext archive. + @result Returns true if mkext was properly unserialized and its + contents recorded, false if not. + */ + virtual bool addExtensionsFromArchive(OSData * mkext); + + + /*! + @function removeKernelLinker + @abstract Removes from memory all code and data related to + boot-time loading of kernel extensions. kextd triggers + this when it first starts in order to pass responsibility + for loading extensions from the kernel itself to kextd. + @result Returns KERN_SUCCESS if the kernel linker is successfully + removed or wasn't present, KERN_FAILURE otherwise. + */ + virtual kern_return_t removeKernelLinker(void); +#endif /* __ppc__ || __i386__ */ + +private: + + /*! + @function unloadModule + @abstract Unloads the reqested module if no driver instances are currently depending on it. + @param moduleName An OSString containing the name of the module to unload. + */ + IOReturn unloadModule( OSString * moduleName ) const; +}; + +extern const OSSymbol * gIOClassKey; +extern const OSSymbol * gIOProbeScoreKey; +extern IOCatalogue * gIOCatalogue; + +#endif /* ! _IOKIT_IOCATALOGUE_H */ diff --git a/i386/include/IOKit/IOCommand.h b/i386/include/IOKit/IOCommand.h new file mode 100644 index 0000000..136c41b --- /dev/null +++ b/i386/include/IOKit/IOCommand.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 2001-01-18 gvdl Made the primary queue pointer public, to be used when + * Ownership is clear. + * 11/13/2000 CJS Created IOCommand class and implementation + * + */ + +/*! + * @header IOCommand + * @abstract + * This header contains the IOCommand class definition. + */ + +#ifndef _IOKIT_IO_COMMAND_H_ +#define _IOKIT_IO_COMMAND_H_ + +/* + * Kernel + */ + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include + +/*! + * @class IOCommand + * @abstract + * This class is an abstract class which represents an I/O command. + * @discussion + * This class is an abstract class which represents an I/O command passed + * from a device driver to a controller. All controller commands (e.g. IOATACommand) + * should inherit from this class. + */ + +class IOCommand : public OSObject +{ + OSDeclareDefaultStructors(IOCommand) + +public: + virtual bool init(void); + +/*! @var fCommandChain + This variable is used by the current 'owner' to queue the command. During the life cycle of a command it moves through a series of queues. This is the queue pointer for it. Only valid while 'ownership' is clear. For instance a IOCommandPool uses this pointer to maintain its list of free commands. May be manipulated using the kern/queue.h macros */ + queue_chain_t fCommandChain; /* used to queue commands */ +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMMAND_H_ */ diff --git a/i386/include/IOKit/IOCommandGate.h b/i386/include/IOKit/IOCommandGate.h new file mode 100644 index 0000000..1b17b79 --- /dev/null +++ b/i386/include/IOKit/IOCommandGate.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*[ + 1999-8-10 Godfrey van der Linden(gvdl) + Created. +]*/ +/*! @language embedded-c++ */ + +#ifndef _IOKIT_IOCOMMANDGATE_H +#define _IOKIT_IOCOMMANDGATE_H + +#include + +/*! + @class IOCommandGate : public IOEventSource + @abstract Single-threaded work-loop client request mechanism. + @discussion An IOCommandGate instance is an extremely light way mechanism +that executes an action on the driver's work-loop. 'On the work-loop' is +actually a lie but the work-loop single threaded semantic is maintained for this +event source. Using the work-loop gate rather than execution by the workloop. +The command gate tests for a potential self dead lock by checking if the +runCommand request is made from the work-loop's thread, it doesn't check for a +mutual dead lock though where a pair of work loop's dead lock each other. +

+ The IOCommandGate is a lighter weight version of the IOCommandQueue and +should be used in preference. Generally use a command queue whenever you need a +client to submit a request to a work loop. A typical command gate action would +check if the hardware is active, if so it will add the request to a pending +queue internal to the device or the device's family. Otherwise if the hardware +is inactive then this request can be acted upon immediately. +

+ CAUTION: The runAction, runCommand, and attemptCommand functions cannot be called from an interrupt context. + +*/ +class IOCommandGate : public IOEventSource +{ + OSDeclareDefaultStructors(IOCommandGate) + +public: +/*! + @typedef Action + @discussion Type and arguments of callout C function that is used when +a runCommand is executed by a client. Cast to this type when you want a C++ +member function to be used. Note the arg1 - arg3 parameters are straight pass +through from the runCommand to the action callout. + @param owner + Target of the function, can be used as a refcon. The owner is set +during initialisation of the IOCommandGate instance. Note if a C++ function +was specified this parameter is implicitly the first paramter in the target +member function's parameter list. + @param arg0 Argument to action from run operation. + @param arg1 Argument to action from run operation. + @param arg2 Argument to action from run operation. + @param arg3 Argument to action from run operation. +*/ + typedef IOReturn (*Action)(OSObject *owner, + void *arg0, void *arg1, + void *arg2, void *arg3); + +protected: +/*! + @function checkForWork + @abstract Not used, $link IOEventSource::checkForWork(). */ + virtual bool checkForWork(); + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: +/*! @function commandGate + @abstract Factory method to create and initialise an IOCommandGate, See $link init. + @result Returns a pointer to the new command gate if sucessful, 0 otherwise. */ + static IOCommandGate *commandGate(OSObject *owner, Action action = 0); + +/*! @function init + @abstract Class initialiser. + @discussion Initialiser for IOCommandGate operates only on newly 'newed' +objects. Shouldn't be used to re-init an existing instance. + @param owner Owner of this, newly created, instance of the IOCommandGate. This argument will be used as the first parameter in the action callout. + @param action + Pointer to a C function that is called whenever a client of the +IOCommandGate calls runCommand. NB Can be a C++ member function but caller +must cast the member function to $link IOCommandGate::Action and they will get a +compiler warning. Defaults to zero, see $link IOEventSource::setAction. + @result True if inherited classes initialise successfully. */ + virtual bool init(OSObject *owner, Action action = 0); + + // Superclass overrides + virtual void free(); + virtual void setWorkLoop(IOWorkLoop *inWorkLoop); + +/*! @function runCommand + @abstract Single thread a command with the target work-loop. + @discussion Client function that causes the current action to be called in +a single threaded manner. Beware the work-loop's gate is recursive and command +gates can cause direct or indirect re-entrancy. When the executing on a +client's thread runCommand will sleep until the work-loop's gate opens for +execution of client actions, the action is single threaded against all other +work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + @param arg0 Parameter for action of command gate, defaults to 0. + @param arg1 Parameter for action of command gate, defaults to 0. + @param arg2 Parameter for action of command gate, defaults to 0. + @param arg3 Parameter for action of command gate, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnAborted if a disabled command gate is free()ed before being reenabled, kIOReturnNoResources if no action available. +*/ + virtual IOReturn runCommand(void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function runAction + @abstract Single thread a call to an action with the target work-loop. + @discussion Client function that causes the given action to be called in +a single threaded manner. Beware the work-loop's gate is recursive and command +gates can cause direct or indirect re-entrancy. When the executing on a +client's thread runAction will sleep until the work-loop's gate opens for +execution of client actions, the action is single threaded against all other +work-loop event sources. If the command is disabled the attempt to run a command will be stalled until enable is called. + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnAborted if a disabled command gate is free()ed before being reenabled. +*/ + virtual IOReturn runAction(Action action, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function attemptCommand + @abstract Single thread a command with the target work-loop. + @discussion Client function that causes the current action to be called in +a single threaded manner. When the executing on a client's thread attemptCommand will fail if the work-loop's gate is closed. + @param arg0 Parameter for action of command gate, defaults to 0. + @param arg1 Parameter for action of command gate, defaults to 0. + @param arg2 Parameter for action of command gate, defaults to 0. + @param arg3 Parameter for action of command gate, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available, kIOReturnCannotLock if lock attempt fails. +*/ + virtual IOReturn attemptCommand(void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function attemptAction + @abstract Single thread a call to an action with the target work-loop. + @discussion Client function that causes the given action to be called in +a single threaded manner. Beware the work-loop's gate is recursive and command +gates can cause direct or indirect re-entrancy. When the executing on a +client's thread attemptCommand will fail if the work-loop's gate is closed. + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNotPermitted if this event source is currently disabled, kIOReturnCannotLock if lock attempt fails. + +*/ + virtual IOReturn attemptAction(Action action, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function commandSleep + @abstract Put a thread that is currently holding the command gate to sleep. + @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs then the commandGate is closed before the function returns. + @param event Pointer to an address. + @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE (the default value) specifies that the sleep may be interrupted by any user signal. + @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate. */ + virtual IOReturn commandSleep(void *event, + UInt32 interruptible = THREAD_ABORTSAFE); + +/*! @function commandWakeup + @abstract Wakeup one or more threads that are asleep on an event. + @param event Pointer to an address. + @param onlyOneThread true to only wake up at most one thread, false otherwise. */ + virtual void commandWakeup(void *event, bool oneThread = false); + +/*! @function disable + @abstract Disable the command gate + @discussion When a command gate is disabled all future calls to runAction and runCommand will stall until the gate is enable()d later. This can be used to block client threads when a system sleep is requested. The IOWorkLoop thread itself will never stall, even when making runAction/runCommand calls. This call must be made from a gated context, to clear potential race conditions. */ + virtual void disable(); + +/*! @function enable + @abstract Enable command gate, this will unblock any blocked Commands and Actions. + @discussion Enable the command gate. The attemptAction/attemptCommand calls will now be enabled and can succeeed. Stalled runCommand/runAction calls will be woken up. */ + virtual void enable(); + +/*! @function commandSleep + @abstract Put a thread that is currently holding the command gate to sleep. + @discussion Put a thread to sleep waiting for an event but release the gate first. If the event occurs or timeout occurs then the commandGate is closed before the function returns. + @param event Pointer to an address. + @param deadline Clock deadline to timeout the sleep. + @param interruptible THREAD_UNINT, THREAD_INTERRUPTIBLE or THREAD_ABORTSAFE. THREAD_UNINT specifies that the sleep cannot be interrupted by a signal. THREAD_INTERRUPTIBLE specifies that the sleep may be interrupted by a "kill -9" signal. THREAD_ABORTSAFE specifies that the sleep may be interrupted by any user signal. + @result THREAD_AWAKENED - normal wakeup, THREAD_TIMED_OUT - timeout expired, THREAD_INTERRUPTED - interrupted, THREAD_RESTART - restart operation entirely, kIOReturnNotPermitted if the calling thread does not hold the command gate. */ + virtual IOReturn commandSleep(void *event, + AbsoluteTime deadline, + UInt32 interruptible); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOCommandGate, 0); +#else + OSMetaClassDeclareReservedUsed(IOCommandGate, 0); +#endif + OSMetaClassDeclareReservedUnused(IOCommandGate, 1); + OSMetaClassDeclareReservedUnused(IOCommandGate, 2); + OSMetaClassDeclareReservedUnused(IOCommandGate, 3); + OSMetaClassDeclareReservedUnused(IOCommandGate, 4); + OSMetaClassDeclareReservedUnused(IOCommandGate, 5); + OSMetaClassDeclareReservedUnused(IOCommandGate, 6); + OSMetaClassDeclareReservedUnused(IOCommandGate, 7); +}; + +#endif /* !_IOKIT_IOCOMMANDGATE_H */ diff --git a/i386/include/IOKit/IOCommandPool.h b/i386/include/IOKit/IOCommandPool.h new file mode 100644 index 0000000..91069f3 --- /dev/null +++ b/i386/include/IOKit/IOCommandPool.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 2001-01-17 gvdl Re-implement on IOCommandGate::commandSleep + * 11/13/2000 CJS Created IOCommandPool class and implementation + * + */ + +/*! + * @header IOCommandPool + * @abstract + * This header contains the IOCommandPool class definition. + */ + +#ifndef _IOKIT_IO_COMMAND_POOL_H_ +#define _IOKIT_IO_COMMAND_POOL_H_ + +/* + * Kernel + */ + +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include +#include +#include + +/*! + * @class IOCommandPool + * @abstract Manipulates a pool of commands which inherit from IOCommand. + * @discussion + * The IOCommandPool class is used to manipulate a pool of commands which + * inherit from IOCommand. It includes a factory method to create a pool + * of a certain size. Once the factory method is invoked, the semaphore + * is set to zero. The caller must then put commands in the pool by creating + * the command (via the controller's factory method or a memory allocation) + * and calling the returnCommand method with the newly created command as its + * argument. + */ + +class IOCommandPool : public OSObject +{ + + OSDeclareDefaultStructors(IOCommandPool) + + +protected: + + queue_head_t fQueueHead; /* head of the queue of elements available */ + UInt32 fSleepers; /* Count of threads sleeping on this pool */ + IOCommandGate *fSerializer; /* command gate used for serializing pool access */ + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOEventSource in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + /*! + * @const kIOCommandPoolDefaultSize + * @abstract The default size of any command pool. + * @discussion + * kIOCommandPoolDefaultSize is the default size of any command pool. + * The default size was determined to be the smallest size for which + * a pool makes sense. + */ + + static const UInt32 kIOCommandPoolDefaultSize = 2; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + +public: + + /*! + * @function initWithWorkLoop + * @abstract Primary initializer for an IOCommandPool object. + * @discussion Primary initializer for an IOCommandPool. + * Should probably use IOCommandPool::withWorkLoop() as it is easier to use. + * @param inWorkLoop + * The workloop that this command pool should synchronize with. + * @result Returns true if command pool was successfully initialized. + */ + virtual bool initWithWorkLoop(IOWorkLoop *workLoop); + + /*! + * @function withWorkLoop + * @abstract Primary factory method for the IOCommandPool class + * @discussion + * The withWorkLoop method is what is known as a factory method. It creates + * a new instance of an IOCommandPool and returns a pointer to that object. + * @param inWorkLoop + * The workloop that this command pool should synchronize with. + * @result + * Returns a pointer to an instance of IOCommandPool if successful, + * otherwise NULL. + */ + + static IOCommandPool *withWorkLoop(IOWorkLoop *inWorkLoop); + + /*! + * @function init + * @abstract Should never be used, obsolete. See initWithWorkLoop. + */ + virtual bool init(IOService *inOwner, + IOWorkLoop *inWorkLoop, + UInt32 inSize = kIOCommandPoolDefaultSize); + + /*! + * @function withWorkLoop + * @abstract Should never be used, obsolete. See IOCommandPool::withWorkLoop. + */ + static IOCommandPool *commandPool(IOService *inOwner, + IOWorkLoop *inWorkLoop, + UInt32 inSize = kIOCommandPoolDefaultSize); + + + /*! + * @function getCommand + * @discussion The getCommand method is used to get a pointer to an object of type IOCommand from the pool. + * @param blockForCommand + * If the caller would like to have its thread slept until a command is + * available, it should pass true, else false. + * @result + * If the caller passes true in blockForCommand, getCommand guarantees that + * the result will be a pointer to an IOCommand object from the pool. If + * the caller passes false, s/he is responsible for checking whether a non-NULL + * pointer was returned. + */ + + virtual IOCommand *getCommand(bool blockForCommand = true); + + /*! + * @function returnCommand + * @discussion + * The returnCommand method is used to place an object of type IOCommand + * into the pool, whether it be the first time, or the 1000th time. + * @param commmand + * The command to place in the pool. + */ + + virtual void returnCommand(IOCommand *command); + +protected: + + /*! + * @function gatedGetCommand + * @discussion + * The gatedGetCommand method is used to serialize the extraction of a + * command from the pool behind a command gate, runAction-ed by getCommand. + * @param vCommand + * A pointer to a pointer to an IOCommand object where the returned + * command will be stored. + * @param vBlock + * A bool that indicates whether to block the request until a command + * becomes available. + * @result + * Returns kIOReturnNoResources if no command is available and the client + * doesn't wish to block until one does become available. + * kIOReturnSuccess if the vCommand argument is valid. + */ + virtual IOReturn gatedGetCommand(IOCommand **command, bool blockForCommand); + + /*! + * @function gatedReturnCommand + * @discussion + * The gatedReturnCommand method is used to serialize the return of a + * command to the pool behind a command gate, runAction-ed by returnCommand. + * @param vCommand + * A pointer to the IOCommand object to be returned to the pool. + * @result + * Always returns kIOReturnSuccess if the vCommand argument is valid. + */ + virtual IOReturn gatedReturnCommand(IOCommand *command); + +private: + OSMetaClassDeclareReservedUnused(IOCommandPool, 0); + OSMetaClassDeclareReservedUnused(IOCommandPool, 1); + OSMetaClassDeclareReservedUnused(IOCommandPool, 2); + OSMetaClassDeclareReservedUnused(IOCommandPool, 3); + OSMetaClassDeclareReservedUnused(IOCommandPool, 4); + OSMetaClassDeclareReservedUnused(IOCommandPool, 5); + OSMetaClassDeclareReservedUnused(IOCommandPool, 6); + OSMetaClassDeclareReservedUnused(IOCommandPool, 7); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMMAND_POOL_H_ */ diff --git a/i386/include/IOKit/IOConditionLock.h b/i386/include/IOKit/IOConditionLock.h new file mode 100644 index 0000000..f628fee --- /dev/null +++ b/i386/include/IOKit/IOConditionLock.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * Copyright (c) 1994-1996 NeXT Software, Inc. All rights reserved. + */ + +#ifndef _IOKIT_IOCONDITIONLOCK_H +#define _IOKIT_IOCONDITIONLOCK_H + +#include +#include +#include + +#include + +class IOConditionLock : public OSObject +{ + OSDeclareDefaultStructors(IOConditionLock) + +private: + IOLock * cond_interlock; // condition var Simple lock + volatile int condition; + + IOLock * sleep_interlock; // sleep lock Simple lock + unsigned char interruptible; + volatile bool want_lock; + volatile bool waiting; + +public: + static IOConditionLock *withCondition(int condition, bool inIntr = true); + virtual bool initWithCondition(int condition, bool inIntr = true); + virtual void free(); + + virtual bool tryLock(); // acquire lock, no waiting + virtual int lock(); // acquire lock (enter critical section) + virtual void unlock(); // release lock (leave critical section) + + virtual bool getInterruptible() const; + virtual int getCondition() const; + virtual int setCondition(int condition); + + virtual int lockWhen(int condition); // acquire lock when condition + virtual void unlockWith(int condition); // set condition & release lock +}; + +#endif /* _IOKIT_IOCONDITIONLOCK_H */ diff --git a/i386/include/IOKit/IODMACommand.h b/i386/include/IOKit/IODMACommand.h new file mode 100644 index 0000000..a2a2852 --- /dev/null +++ b/i386/include/IOKit/IODMACommand.h @@ -0,0 +1,557 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IODMACOMMAND_H +#define _IODMACOMMAND_H + +#include +#include +class IOMapper; + +/**************************** class IODMACommand ***************************/ + +/*! + @class IODMACommand + @abstract A mechanism to convert memory references to I/O bus addresses. + @discussion The IODMACommand is supersedes the IOMemoryCursor and greatly enhances the functionality and power of it. The command can be specified to output 64 bit physical addresses and also allows driver writers bypass mapping hardware or get addresses suitable for non-snooped DMA. +

+ The command is designed to be very easily subclassable. Most driver writers need to associate some DMA operations with their memory descriptor and usually use a C structure for that purpose. This structure is often kept in a linked list. This IODMACommand has built it linkage and can be derived and 'public:' variables added, giving the developer a structure that can associate a memory descriptor with a particular dma command but will also allow the developer to generate that command and keep the state necessary for tracking it. +

+ It is envisaged that a pool of IODMACommands will be created at driver initialisation and each command will be kept in an IOCommandPool while not in use. However if developers wishes to maintain their own free lists that is certainly possible. See the and for sample code on manipulating the command's doubly linked list entries. +

+ The IODMACommand can be used in a 'weak-linked' manner. To do this you must avoid using any static member functions. Use the, much slower but safe, weakWithSpecification function. On success a dma command instance will be returned. This instance can then be used to clone as many commands as is needed. Remember deriving from this class can not be done weakly, that is no weak subclassing! +*/ + +class IODMACommand : public IOCommand +{ + OSDeclareDefaultStructors(IODMACommand); + +friend class IODMAEventSource; + +public: + +/*! + @typedef Segment32 + @discussion A 32 bit I/O bus address/length pair +*/ + struct Segment32 { + UInt32 fIOVMAddr, fLength; + }; + +/*! + @typedef Segment64 + @discussion A 64 bit I/O bus address/length pair +*/ + struct Segment64 { + UInt64 fIOVMAddr, fLength; + }; + +/*! @enum MappingOptions + @abstract Mapping types to indicate the desired mapper type for translating memory descriptors into I/O DMA Bus addresses. + @constant kNonCoherent Used by drivers for non-coherent transfers, implies unmapped memmory + @constant kMapped Allow a driver to define addressing size + @constant kBypassed Allow drivers to bypass any mapper + @constant kMaxMappingOptions Internal use only +*/ + enum MappingOptions { + kMapped = 0x00000000, + kBypassed = 0x00000001, + kNonCoherent = 0x00000002, + kTypeMask = 0x0000000f, + + kNoCacheStore = 0x00000010, // Memory in descriptor + kOnChip = 0x00000020, // Indicates DMA is on South Bridge + kIterateOnly = 0x00000040 // DMACommand will be used as a cursor only + }; + +/*! @enum SynchronizeOptions + @abstract Options for the synchronize method. + @constant kForceDoubleBuffer Copy the entire prepared range to a new page aligned buffer. +*/ + enum SynchronizeOptions { + kForceDoubleBuffer = 0x01000000 + }; + +/*! + @typedef SegmentFunction + @discussion Pointer to a C function that translates a 64 segment and outputs a single desired segment to the array at the requested index. There are a group of pre-implemented SegmentFunctions that may be usefull to the developer below. + @param segment The 64Bit I/O bus address and length. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. + @result Returns true if segment encoding succeeded. false may be returned if the current segment does not fit in an output segment, i.e. a 38bit address wont fit into a 32 encoding. +*/ + typedef bool (*SegmentFunction)(IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + + // -------------- Preimplemented output functions ---------------- + +/*! @function OutputHost32 + @abstract Output host natural Segment32 output segment function. +*/ + static bool OutputHost32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputHost32 + @abstract Output host natural Segment32 output segment function. + */ +#define kIODMACommandOutputHost32 (IODMACommand::OutputHost32) + +/*! @function OutputBig32 + @abstract Output big-endian Segment32 output segment function. +*/ + static bool OutputBig32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputBig32 + @abstract Output big-endian Segment32 output segment function. + */ +#define kIODMACommandOutputBig32 (IODMACommand::OutputBig32) + +/*! @function OutputLittle32 + @abstract Output little-endian Segment32 output segment function. +*/ + static bool OutputLittle32(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputLittle32 + @abstract Output little-endian Segment32 output segment function. +*/ +#define kIODMACommandOutputLittle32 (IODMACommand::OutputLittle32) + +/*! @function OutputHost64 + @abstract Output host natural Segment64 output segment function. +*/ + static bool OutputHost64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputHost64 + @abstract Output host natural Segment64 output segment function. +*/ +#define kIODMACommandOutputHost64 (IODMACommand::OutputHost64) + +/*! @function OutputBig64 + @abstract Output big-endian Segment64 output segment function. +*/ + static bool OutputBig64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputLittle64 + @abstract Output little-endian Segment64 output segment function. +*/ +#define kIODMACommandOutputBig64 (IODMACommand::OutputBig64) + +/*! @function OutputLittle64 + @abstract Output little-endian Segment64 output segment function. +*/ + static bool OutputLittle64(IODMACommand *target, + Segment64 seg, void *segs, UInt32 ind); + +/*! @defined kIODMACommandOutputBig64 + @abstract Output big-endian Segment64 output segment function. +*/ +#define kIODMACommandOutputLittle64 (IODMACommand::OutputLittle64) + +/*! @function withSpecification + @abstract Creates and initializes an IODMACommand in one operation. + @discussion Factory function to create and initialize an IODMACommand in one operation. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. If 0 is passed the maximum segment size is unlimited. + @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IODMACommand * + withSpecification(SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + void *refCon = 0); + +/*! @function weakWithSpecification + @abstract Creates and initialises an IODMACommand in one operation if this version of the operating system supports it. + @discussion Factory function to create and initialise an IODMACommand in one operation. The function allows a developer to 'weak' link with IODMACommand. This function will return kIOReturnUnsupported if the IODMACommand is unavailable. This function is actually fairly slow so it will be better to call it once then clone the successfully create command using cloneCommand (q.v.). + @param newCommand Output reference variable of the newly created IODMACommand. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. Zero is treated as an unlimited segment size. + @param mapType is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below. This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transfers are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @result kIOReturnSuccess if everything is OK, otherwise kIOReturnBadArgument if newCommand is NULL, kIOReturnUnsupported if the kernel doesn't export IODMACommand or IOReturnError if the new command fails to init, q.v. initWithSpecification. +*/ + // Note that the function has the attribute always_inline. + // The point of this function is to make a call into the kernel + // without generating an undefined symbol. If the client could call + // the code as a function then the goal of no undefined symbols + // would be lost thus defeating the purpose. + static inline IOReturn weakWithSpecification + (IODMACommand **newCommand, + SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mapType = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + void *refCon = 0) __attribute__((always_inline)); + +/*! + @function cloneCommand + @abstract Creates a new command based on the specification of the current one. + @discussion Factory function to create and initialise an IODMACommand in one operation. The current command's specification will be duplicated in the new object, but however none of its state will be duplicated. This means that it is safe to clone a command even if it is currently active and running, however you must be certain that the command to be duplicated does have a valid reference for the duration. + @result Returns a new memory cursor if successfully created and initialised, 0 otherwise. +*/ + virtual IODMACommand *cloneCommand(void *refCon = 0); + +/*! @function initWithSpecification + @abstract Primary initializer for the IODMACommand class. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0 which means any size. + @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @result Can fail if the mapping type is not recognised, if one of the 3 mandatory parameters are set to 0, if a 32 bit output function is selected when more than 32 bits of address is required or, if kBypassed is requested on a machine that doesn't support bypassing. Returns true otherwise. +*/ + virtual bool initWithSpecification( SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + void *refCon = 0); + +/*! @function setMemoryDescriptor + @abstract Sets and resets the DMACommand's current memory descriptor + @discussion The DMA command will configure itself based on the information that it finds in the memory descriptor. It looks for things like the direction of the memory descriptor and whether the current memory descriptor is already mapped into some IOMMU. As a programmer convenience it can also prepare the memory descriptor immediately. See prepare(). Note the IODMACommand is designed to used multiple times with a succession of memory descriptors, making the pooling of commands possible. It is an error though to attempt to reset a currently prepared() DMA command. Warning: This routine may block so never try to autoprepare an IODMACommand while in a gated context, i.e. one of the WorkLoops action call outs. + @param mem A pointer to the current I/Os memory descriptor. + @param autoPrepare An optional boolean variable that will call the prepare() function automatically after the memory descriptor is processed. Defaults to true. + @result Returns kIOReturnSuccess, kIOReturnBusy if currently prepared, kIOReturnNoSpace if the length(mem) >= Maximum Transfer Size or the error codes returned by prepare() (qv). +*/ + virtual IOReturn setMemoryDescriptor(const IOMemoryDescriptor *mem, + bool autoPrepare = true); + +/*! @function clearMemoryDescriptor + @abstract Clears the DMACommand's current memory descriptor + @discussion completes and invalidates the cache if the DMA command is currently active, copies all data from bounce buffers if necessary and releases all resources acquired during setMemoryDescriptor. + @param autoComplete An optional boolean variable that will call the complete() function automatically before the memory descriptor is processed. Defaults to true. +*/ + virtual IOReturn clearMemoryDescriptor(bool autoComplete = true); + +/*! @function getMemoryDescriptor + @abstract Get the current memory descriptor +*/ + virtual const IOMemoryDescriptor *getMemoryDescriptor() const; + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion Allocate the mapping resources neccessary for this transfer, specifying a sub range of the IOMemoryDescriptor that will be the target of the I/O. The complete() method frees these resources. Data may be copied to buffers for kIODirectionOut memory descriptors, depending on hardware mapping resource availabilty or alignment restrictions. It should be noted that the this function may block and should only be called on the clients context, i.e never call this routine while gated; also the call itself is not thread safe though this should be an issue as each IODMACommand is independant. + @param offset defines the starting offset in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param length defines the ending position in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param flushCache Flush the caches for the memory descriptor and make certain that the memory cycles are complete. Defaults to true for kNonCoherent and is ignored by the other types. + @param synchronize Copy any buffered data back from the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + @result An IOReturn code. */ + + virtual IOReturn prepare(UInt64 offset = 0, UInt64 length = 0, bool flushCache = true, bool synchronize = true); + +/*! @function complete + @abstract Complete processing of DMA mappings after an I/O transfer is finished. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer + @param invalidCache Invalidate the caches for the memory descriptor. Defaults to true for kNonCoherent and is ignored by the other types. + @param synchronize Copy any buffered data back to the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + @result kIOReturnNotReady if not prepared, kIOReturnSuccess otherwise. */ + + virtual IOReturn complete(bool invalidateCache = true, bool synchronize = true); + +/*! @function synchronize + @abstract Bring IOMemoryDescriptor and IODMACommand buffers into sync. + @discussion This method should not be called unless a prepare was previously issued. If needed a caller may synchronize any IODMACommand buffers with the original IOMemoryDescriptor buffers. + @param options Specifies the direction of the copy: + kIODirectionOut copy IOMemoryDesciptor memory to any IODMACommand buffers. By default this action takes place automatically at prepare(). + kIODirectionIn copy any IODMACommand buffers back to the IOMemoryDescriptor. By default this action takes place automatically at complete(). + kForceDoubleBuffer copy the entire prepared range to a new page aligned buffer. + @result kIOReturnNotReady if not prepared, kIOReturnBadArgument if invalid options are passed, kIOReturnSuccess otherwise. */ + + virtual IOReturn synchronize(IOOptionBits options); + +/*! @function genIOVMSegments + @abstract Generates a physical scatter/gather for the current DMA command + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. The constraints that are set during initialisation will be respected. This function maintains the state across multiple calls for efficiency. However the state is discarded if the new offset is not the expected one. + @param offset input/output parameter, defines the starting and ending offset in the memory descriptor, relative to any offset passed to the prepare() method. + @param segments Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction. + @param numSegments Input/output parameter Number of segments that can fit in the segment array and returns number of segments generated. + @result kIOReturnSuccess on success, kIOReturnOverrun if the memory descriptor is exhausted, kIOReturnMessageTooLarge if the output segment function's address bits has insufficient resolution for a segment, kIOReturnNotReady if the DMA command has not be prepared, kIOReturnBadArgument if the DMA command doesn't have a memory descriptor yet or some of the parameters are NULL and kIOReturnNotReady if the DMA command is not prepared. +*/ + virtual IOReturn genIOVMSegments(UInt64 *offset, + void *segments, + UInt32 *numSegments); + +private: + virtual UInt64 transfer( IOOptionBits transferOp, UInt64 offset, void * buffer, UInt64 length ); + +public: + +/*! @function writeBytes + @abstract Copy data to the IODMACommand's buffer from the specified buffer. + @discussion This method copies data to the IODMACommand's memory at the given offset, from the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset. + @param offset A byte offset into the IODMACommand's memory, relative to the prepared offset. + @param bytes The caller supplied buffer to copy the data from. + @param length The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand. */ + + UInt64 writeBytes(UInt64 offset, const void *bytes, UInt64 length); + +/*! @function readBytes + @abstract Copy data from the IODMACommand's buffer to the specified buffer. + @discussion This method copies data from the IODMACommand's memory at the given offset, to the caller's buffer. The IODMACommand must be prepared, and the offset is relative to the prepared offset. + @param offset A byte offset into the IODMACommand's memory, relative to the prepared offset. + @param bytes The caller supplied buffer to copy the data to. + @param length The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the prepared length of the IODMACommand. */ + + UInt64 readBytes(UInt64 offset, void *bytes, UInt64 length); + +/*! @function gen32IOVMSegments + @abstract Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost32, kIODMACommandOutputBig32, or kIODMACommandOutputLittle32. If the output function of the IODMACommand is not a 32 bit function, results will be incorrect. +*/ + inline IOReturn gen32IOVMSegments(UInt64 *offset, + Segment32 *segments, + UInt32 *numSegments) + { return genIOVMSegments(offset, segments, numSegments); }; + +/*! @function gen64IOVMSegments + @abstract Helper function for a type checked call to genIOVMSegments(qv), for use with an IODMACommand set up with the output function kIODMACommandOutputHost64, kIODMACommandOutputBig64, or kIODMACommandOutputLittle64. If the output function of the IODMACommand is not a 64 bit function, results will be incorrect. +*/ + inline IOReturn gen64IOVMSegments(UInt64 *offset, + Segment64 *segments, + UInt32 *numSegments) + { return genIOVMSegments(offset, segments, numSegments); }; + + IOReturn + genIOVMSegments(SegmentFunction segmentFunction, + UInt64 *offsetP, + void *segmentsP, + UInt32 *numSegmentsP); + + virtual void free(); + +private: + typedef IOReturn (*InternalSegmentFunction)( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + + IOReturn genIOVMSegments(uint32_t op, + InternalSegmentFunction outSegFunc, + void *reference, + UInt64 *offsetP, + void *segmentsP, + UInt32 *numSegmentsP); + + static IOReturn clientOutputSegment( + void *reference, IODMACommand *target, + Segment64 segment, void *vSegList, UInt32 outSegIndex); + + static IOReturn segmentOp( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + IOReturn walkAll(UInt8 op); + +public: + +/*! @function prepareWithSpecification + @abstract Prepare the memory for an I/O transfer with a new specification. + @discussion Allocate the mapping resources neccessary for this transfer, specifying a sub range of the IOMemoryDescriptor that will be the target of the I/O. The complete() method frees these resources. Data may be copied to buffers for kIODirectionOut memory descriptors, depending on hardware mapping resource availabilty or alignment restrictions. It should be noted that the this function may block and should only be called on the clients context, i.e never call this routine while gated; also the call itself is not thread safe though this should be an issue as each IODMACommand is independant. + @param outSegFunc SegmentFunction to call to output one physical segment. A set of nine commonly required segment functions are provided. + @param numAddressBits Number of bits that the hardware uses on its internal address bus. Typically 32 but may be more on modern hardware. A 0 implies no-restriction other than that implied by the output segment function. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0 which means any size. + @param mappingOptions is the type of mapping that is required to translate an IOMemoryDescriptor into the desired number of bits. For instance if your hardware only supports 32 bits but must run on machines with > 4G of RAM some mapping will be required. Number of bits will be specified in numAddressBits, see below.This parameter can take 3 values:- kNonCoherent - used for non-coherent hardware transfers, Mapped - Validate that all I/O bus generated addresses are within the number of addressing bits specified, Bypassed indicates that bypassed addressing is required, this is used when the hardware transferes are into coherent memory but no mapping is required. See also prepare() for failure cases. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restriction, in bytes, on I/O bus addresses. Defaults to single byte alignment. + @param mapper For mapping types kMapped & kBypassed mapper is used to define the hardware that will perform the mapping, defaults to the system mapper. + @param offset defines the starting offset in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param length defines the ending position in the memory descriptor the DMA command will operate on. genIOVMSegments will produce its results based on the offset and length passed to the prepare method. + @param flushCache Flush the caches for the memory descriptor and make certain that the memory cycles are complete. Defaults to true for kNonCoherent and is ignored by the other types. + @param synchronize Copy any buffered data back from the target IOMemoryDescriptor. Defaults to true, if synchronize() is being used to explicitly copy data, passing false may avoid an unneeded copy. + @result An IOReturn code. Can fail if the mapping type is not recognised, if one of the 3 mandatory parameters are set to 0, if a 32 bit output function is selected when more than 32 bits of address is required or, if kBypassed is requested on a machine that doesn't support bypassing. +*/ + + virtual IOReturn prepareWithSpecification(SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mappingOptions = kMapped, + UInt64 maxTransferSize = 0, + UInt32 alignment = 1, + IOMapper *mapper = 0, + UInt64 offset = 0, + UInt64 length = 0, + bool flushCache = true, + bool synchronize = true); + + static IOReturn transferSegment( + void *reference, + IODMACommand *target, + Segment64 segment, + void *segments, + UInt32 segmentIndex); + +/*! @function getPreparedOffsetAndLength + @abstract Returns the offset and length into the target IOMemoryDescriptor of a prepared IODDMACommand. + @discussion If successfully prepared, returns the offset and length into the IOMemoryDescriptor. Will fail for an unprepared IODMACommand. + @param offset returns the starting offset in the memory descriptor the DMA command was prepared with. Pass NULL for don't care. + @param length returns the length in the memory descriptor the DMA command was prepared with. Pass NULL for don't care. + @result An IOReturn code. kIOReturnNotReady if the IODMACommand is not prepared. */ + + virtual IOReturn getPreparedOffsetAndLength(UInt64 * offset, UInt64 * length); + + UInt8 getNumAddressBits(void); + UInt32 getAlignment(void); + +private: + OSMetaClassDeclareReservedUsed(IODMACommand, 0); + OSMetaClassDeclareReservedUsed(IODMACommand, 1); + OSMetaClassDeclareReservedUsed(IODMACommand, 2); + OSMetaClassDeclareReservedUnused(IODMACommand, 3); + OSMetaClassDeclareReservedUnused(IODMACommand, 4); + OSMetaClassDeclareReservedUnused(IODMACommand, 5); + OSMetaClassDeclareReservedUnused(IODMACommand, 6); + OSMetaClassDeclareReservedUnused(IODMACommand, 7); + OSMetaClassDeclareReservedUnused(IODMACommand, 8); + OSMetaClassDeclareReservedUnused(IODMACommand, 9); + OSMetaClassDeclareReservedUnused(IODMACommand, 10); + OSMetaClassDeclareReservedUnused(IODMACommand, 11); + OSMetaClassDeclareReservedUnused(IODMACommand, 12); + OSMetaClassDeclareReservedUnused(IODMACommand, 13); + OSMetaClassDeclareReservedUnused(IODMACommand, 14); + OSMetaClassDeclareReservedUnused(IODMACommand, 15); + +public: +/*! @var fRefCon Reference Constant, client defined publicly avialable */ + void *fRefCon; + +protected: + +/*! @var fMaxSegmentSize Maximum size of one segment in a scatter/gather list */ + UInt64 fMaxSegmentSize; + +/*! @var fMaxTransferSize + Maximum size of a transfer that this memory cursor is allowed to generate */ + UInt64 fMaxTransferSize; + +/*! @var fBypassMask + Mask to be ored into the address to bypass the given iommu's mapping. */ + UInt64 fBypassMask; + +/*! @var fMapper + Client defined mapper. */ + IOMapper *fMapper; + +/*! @var fMemory + memory descriptor for current I/O. */ + const IOMemoryDescriptor *fMemory; + +/*! @var fOutSeg The action method called when an event has been delivered */ + SegmentFunction fOutSeg; + +/*! @var fAlignMask + Alignment restriction mask. */ + UInt32 fAlignMask; + +/*! @var fNumAddressBits + Number of bits that the hardware can address */ + UInt32 fNumAddressBits; + +/*! @var fNumSegments + Number of contiguous segments required for the current memory descriptor and desired mapping */ + UInt32 fNumSegments; + +/*! @var fMappingOptions + What type of I/O virtual address mapping is required for this command */ + MappingOptions fMappingOptions; + +/*! @var fActive + fActive indicates that this DMA command is currently prepared and ready to go */ + UInt32 fActive; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + struct IODMACommandInternal * reserved; +}; + +IOReturn IODMACommand:: +weakWithSpecification(IODMACommand **newCommand, + SegmentFunction outSegFunc, + UInt8 numAddressBits, + UInt64 maxSegmentSize, + MappingOptions mapType, + UInt64 maxTransferSize, + UInt32 alignment, + IOMapper *mapper, + void *refCon) +{ + if (!newCommand) + return kIOReturnBadArgument; + + IODMACommand *self = (IODMACommand *) + OSMetaClass::allocClassWithName("IODMACommand"); + if (!self) + return kIOReturnUnsupported; + + IOReturn ret; + bool inited = self-> + initWithSpecification(outSegFunc, + numAddressBits, maxSegmentSize, mapType, + maxTransferSize, alignment, mapper, refCon); + if (inited) + ret = kIOReturnSuccess; + else { + self->release(); + self = 0; + ret = kIOReturnError; + } + + *newCommand = self; + return ret; +}; +#endif /* !_IODMACOMMAND_H */ + diff --git a/i386/include/IOKit/IODMAController.h b/i386/include/IOKit/IODMAController.h new file mode 100644 index 0000000..a8c1aed --- /dev/null +++ b/i386/include/IOKit/IODMAController.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODMACONTROLLER_H +#define _IOKIT_IODMACONTROLLER_H + +#include +#include +#include + +class IODMAEventSource; + +class IODMAController : public IOService +{ + OSDeclareAbstractStructors(IODMAController); + + friend class IODMAEventSource; + + private: + IOService *_provider; + const OSSymbol *_dmaControllerName; + + protected: + virtual void registerDMAController(IOOptionBits options = 0); + virtual IOReturn initDMAChannel(IOService *provider, IODMAEventSource *dmaES, UInt32 *dmaIndex, UInt32 reqIndex) = 0; + virtual IOReturn startDMACommand(UInt32 dmaIndex, IODMACommand *dmaCommand, IODirection direction, + IOByteCount byteCount = 0, IOByteCount byteOffset = 0) = 0; + virtual IOReturn stopDMACommand(UInt32 dmaIndex, bool flush = false, uint64_t timeout = UINT64_MAX) = 0; + virtual void completeDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand); + virtual void notifyDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount); + virtual IOReturn queryDMACommand(UInt32 dmaIndex, IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false) = 0; + virtual IOByteCount getFIFODepth(UInt32 dmaIndex) = 0; + + public: + static const OSSymbol *createControllerName(UInt32 phandle); + static IODMAController *getController(IOService *provider, UInt32 dmaIndex); + + virtual bool start(IOService *provider); +}; + + +#endif /* _IOKIT_IODMACONTROLLER_H */ diff --git a/i386/include/IOKit/IODMAEventSource.h b/i386/include/IOKit/IODMAEventSource.h new file mode 100644 index 0000000..18a72de --- /dev/null +++ b/i386/include/IOKit/IODMAEventSource.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODMAEVENTSOURCE_H +#define _IOKIT_IODMAEVENTSOURCE_H + +#include +#include +#include +#include + +class IODMAController; + +class IODMAEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IODMAEventSource); + + friend class IODMAController; + + public: + typedef void (*Action)(OSObject *owner, IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount); +#define IODMAEventAction IODMAEventSource::Action + + protected: + virtual void completeDMACommand(IODMACommand *dmaCommand); + virtual void notifyDMACommand(IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount); + + public: + static IODMAEventSource *dmaEventSource(OSObject *owner, + IOService *provider, + Action completion = 0, + Action notification = 0, + UInt32 dmaIndex = 0); + + virtual IOReturn startDMACommand(IODMACommand *dmaCommand, IODirection direction, IOByteCount byteCount = 0, IOByteCount byteOffset = 0); + virtual IOReturn stopDMACommand(bool flush = false, uint64_t timeout = UINT64_MAX); + + virtual IOReturn queryDMACommand(IODMACommand **dmaCommand, IOByteCount *transferCount, bool waitForIdle = false); + virtual IOByteCount getFIFODepth(); + + private: + IOService *dmaProvider; + IODMAController *dmaController; + UInt32 dmaIndex; + queue_head_t dmaCommandsCompleted; + IOSimpleLock *dmaCommandsCompletedLock; + Action dmaCompletionAction; + Action dmaNotificationAction; + bool dmaSynchBusy; + + virtual bool init(OSObject *owner, + IOService *provider, + Action completion = 0, + Action notification = 0, + UInt32 dmaIndex = 0); + virtual bool checkForWork(void); +}; + +#endif /* _IOKIT_IODMAEVENTSOURCE_H */ diff --git a/i386/include/IOKit/IODataQueue.h b/i386/include/IOKit/IODataQueue.h new file mode 100644 index 0000000..458cb47 --- /dev/null +++ b/i386/include/IOKit/IODataQueue.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUE_H +#define _IOKIT_IODATAQUEUE_H + +#include +#include +#include +#include + +typedef struct _IODataQueueMemory IODataQueueMemory; +class IOMemoryDescriptor; + +struct _notifyMsg { + mach_msg_header_t h; +}; + +/*! + * @class IODataQueue : public OSObject + * @abstract A generic queue designed to pass data from the kernel to a user process. + * @discussion The IODataQueue class is designed to allow kernel code to queue data to a user process. IODataQueue objects are designed to be used in a single producer / single consumer situation. As such, there are no locks on the data itself. Because the kernel enqueue and user-space dequeue methods follow a strict set of guidelines, no locks are necessary to maintain the integrity of the data struct. + * + *
Each data entry can be variable sized, but the entire size of the queue data region (including overhead for each entry) must be specified up front. + * + *
In order for the IODataQueue instance to notify the user process that data is available, a notification mach port must be set. When the queue is empty and a new entry is added, a message is sent to the specified port. + * + *
User client code exists in the IOKit framework that facilitates the creation of the receive notification port as well as the listen process for new data available notifications. + * + *
In order to make the data queue memory available to a user process, the method getMemoryDescriptor() must be used to get an IOMemoryDescriptor instance that can be mapped into a user process. Typically, the clientMemoryForType() method on an IOUserClient instance will be used to request the IOMemoryDescriptor and then return it to be mapped into the user process. + */ +class IODataQueue : public OSObject +{ + OSDeclareDefaultStructors(IODataQueue) + +protected: + IODataQueueMemory * dataQueue; + + void * notifyMsg; + + virtual void free(); + + /*! + * @function sendDataAvailableNotification + * @abstract Sends a dataAvailableNotification message to the specified mach port. + * @discussion This method sends a message to the mach port passed to setNotificationPort(). It is used to indicate that data is available in the queue. + */ + virtual void sendDataAvailableNotification(); + +public: + /*! + * @function withCapacity + * @abstract Static method that creates a new IODataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in .
This method allocates a new IODataQueue instance and then calls initWithCapacity() with the given size parameter. If the initWithCapacity() fails, the new instance is released and zero is returned. + * @param size The size of the data queue memory region. + * @result Returns the newly allocated IODataQueue instance. Zero is returned on failure. + */ + static IODataQueue *withCapacity(UInt32 size); + + /*! + * @function withEntries + * @abstract Static method that creates a new IODataQueue instance with the specified number of entries of the given size. + * @discussion This method will create a new IODataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. If the initWithEntries() fails, the new instance is released and zero is returned. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns the newly allocated IODataQueue instance. Zero is returned on failure. + */ + static IODataQueue *withEntries(UInt32 numEntries, UInt32 entrySize); + + /*! + * @function initWithCapacity + * @abstract Initializes an IODataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in . + * @param size The size of the data queue memory region. + * @result Returns true on success and false on failure. + */ + virtual Boolean initWithCapacity(UInt32 size); + + /*! + * @function initWithEntries + * @abstract Initializes an IODataQueue instance with the specified number of entries of the given size. + * @discussion This method will initialize an IODataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns true on success and false on failure. + */ + virtual Boolean initWithEntries(UInt32 numEntries, UInt32 entrySize); + + /*! + * @function enqueue + * @abstract Enqueues a new entry on the queue. + * @discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the tail value and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the tail to the next available location. When attempting to add a new entry towards the end of the queue and there isn't enough space at the end, it wraps back to the beginning.
If the queue is empty when a new entry is added, sendDataAvailableNotification() is called to send a message to the user process that data is now available. + * @param data Pointer to the data to be added to the queue. + * @param dataSize Size of the data pointed to by data. + * @result Returns true on success and false on failure. Typically failure means that the queue is full. + */ + virtual Boolean enqueue(void *data, UInt32 dataSize); + + /*! + * @function setNotificationPort + * @abstract Creates a simple mach message targeting the mach port specified in port. + * @discussion This message is sent when data is added to an empty queue. It is to notify a user process that new data has become available. + * @param port The mach port to target with the notification message. + */ + virtual void setNotificationPort(mach_port_t port); + + /*! + * @function getMemoryDescriptor + * @abstract Returns a memory descriptor covering the IODataQueueMemory region. + * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on. + * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure. + */ + virtual IOMemoryDescriptor *getMemoryDescriptor(); +}; + +#endif /* _IOKIT_IODATAQUEUE_H */ diff --git a/i386/include/IOKit/IODataQueueShared.h b/i386/include/IOKit/IODataQueueShared.h new file mode 100644 index 0000000..2fa0e9a --- /dev/null +++ b/i386/include/IOKit/IODataQueueShared.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODATAQUEUESHARED_H +#define _IOKIT_IODATAQUEUESHARED_H + +#include +#include +#include + +/*! + * @typedef IODataQueueEntry + * @abstract Represents an entry within the data queue + * @discussion This is a variable sized struct. The data field simply represents the start of the data region. The size of the data region is stored in the size field. The whole size of the specific entry is the size of a UInt32 plus the size of the data region. + * @field size The size of the following data region. + * @field data Represents the beginning of the data region. The address of the data field is a pointer to the start of the data region. + */ +typedef struct _IODataQueueEntry{ + UInt32 size; + UInt8 data[4]; +} IODataQueueEntry; + +/*! + * @typedef IODataQueueMemory + * @abstract A struct mapping to the header region of a data queue. + * @discussion This struct is variable sized. The struct represents the data queue header information plus a pointer to the actual data queue itself. The size of the struct is the combined size of the header fields (3 * sizeof(UInt32)) plus the actual size of the queue region. This size is stored in the queueSize field. + * @field queueSize The size of the queue region pointed to by the queue field. + * @field head The location of the queue head. This field is represented as a byte offset from the beginning of the queue memory region. + * @field tail The location of the queue tail. This field is represented as a byte offset from the beginning of the queue memory region. + * @field queue Represents the beginning of the queue memory region. The size of the region pointed to by queue is stored in the queueSize field. + */ +typedef struct _IODataQueueMemory { + UInt32 queueSize; + volatile UInt32 head; + volatile UInt32 tail; + IODataQueueEntry queue[1]; +} IODataQueueMemory; + +/*! + * @typedef IODataQueueAppendix + * @abstract A struct mapping to the appendix region of a data queue. + * @discussion This struct is variable sized dependent on the version. The struct represents the data queue appendix information. + * @field version The version of the queue appendix. + * @field port The notification port associated with this queue. + */ +typedef struct _IODataQueueAppendix { + UInt32 version; + mach_msg_header_t msgh; +} IODataQueueAppendix; + +/*! + * @defined DATA_QUEUE_ENTRY_HEADER_SIZE Represents the size of the data queue entry header independent of the actual size of the data in the entry. This is the overhead of each entry in the queue. The total size of an entry is equal to this value plus the size stored in the entry's size field (in IODataQueueEntry). + */ +#define DATA_QUEUE_ENTRY_HEADER_SIZE (sizeof(IODataQueueEntry) - 4) + +/*! + * @defined DATA_QUEUE_MEMORY_HEADER_SIZE Represents the size of the data queue memory header independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of the queue appendix and the size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_HEADER_SIZE (sizeof(IODataQueueMemory) - sizeof(IODataQueueEntry)) + +/*! + * @defined DATA_QUEUE_MEMORY_APPENDIX_SIZE Represents the size of the data queue memory appendix independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of queue header and size of the queue data region which is stored in the queueSize field of IODataQueueMeory. + */ +#define DATA_QUEUE_MEMORY_APPENDIX_SIZE (sizeof(IODataQueueAppendix)) + +#endif /* _IOKIT_IODATAQUEUESHARED_H */ + diff --git a/i386/include/IOKit/IODeviceMemory.h b/i386/include/IOKit/IODeviceMemory.h new file mode 100644 index 0000000..0665efc --- /dev/null +++ b/i386/include/IOKit/IODeviceMemory.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IODEVICEMEMORY_H +#define _IOKIT_IODEVICEMEMORY_H + +#include + +/*! @class IODeviceMemory + @abstract An IOMemoryDescriptor used for device physical memory ranges. + @discussion The IODeviceMemory class is a simple subclass of IOMemoryDescriptor that uses its methods to describe a single range of physical memory on a device. IODeviceMemory objects are usually looked up with IOService or IOPCIDevice accessors, and are created by memory-mapped bus families. IODeviceMemory implements only some factory methods in addition to the methods of IOMemoryDescriptor. +*/ + +class IODeviceMemory : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IODeviceMemory) + +public: + +/*! @struct InitElement + @field start First physical address in the range. + @field length Length of the range. + @field tag 32-bit value not interpreted by IODeviceMemory or IOMemoryDescriptor, for use by the bus family. */ + + struct InitElement { + IOPhysicalAddress start; + IOPhysicalLength length; + IOOptionBits tag; + }; + +/*! @function arrayFromList + @abstract Constructs an OSArray of IODeviceMemory instances, each describing one physical range, and a tag value. + @discussion This method creates IODeviceMemory instances for each physical range passed in an IODeviceMemory::InitElement array. Each element consists of a physical address, length and tag value for the IODeviceMemory. The instances are returned as a created OSArray. + @param list An array of IODeviceMemory::InitElement structures. + @param count The number of elements in the list. + @result Returns a created OSArray of IODeviceMemory objects, to be released by the caller, or zero on failure. */ + + static OSArray * arrayFromList( + InitElement list[], + IOItemCount count ); + +/*! @function withRange + @abstract Constructs an IODeviceMemory instance, describing one physical range. + @discussion This method creates an IODeviceMemory instance for one physical range passed as a physical address and length. It just calls IOMemoryDescriptor::withPhysicalAddress. + @param address The physical address of the first byte in the memory. + @param withLength The length of memory. + @result Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure. */ + + static IODeviceMemory * withRange( + IOPhysicalAddress start, + IOPhysicalLength length ); + +/*! @function withSubRange + @abstract Constructs an IODeviceMemory instance, describing a subset of an existing IODeviceMemory range. + @discussion This method creates an IODeviceMemory instance for a subset of an existing IODeviceMemory range, passed as a physical address offset and length. It just calls IOMemoryDescriptor::withSubRange. + @param of The parent IODeviceMemory of which a subrange is to be used for the new descriptor, which will be retained by the subrange IODeviceMemory. + @param offset A byte offset into the parent's memory. + @param length The length of the subrange. + @result Returns the created IODeviceMemory on success, to be released by the caller, or zero on failure. */ + + static IODeviceMemory * withSubRange( + IODeviceMemory * of, + IOPhysicalAddress offset, + IOPhysicalLength length ); +}; + +#endif /* ! _IOKIT_IODEVICEMEMORY_H */ diff --git a/i386/include/IOKit/IODeviceTreeSupport.h b/i386/include/IOKit/IODeviceTreeSupport.h new file mode 100644 index 0000000..15b5aa4 --- /dev/null +++ b/i386/include/IOKit/IODeviceTreeSupport.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IODEVICETREE_H +#define _IOKIT_IODEVICETREE_H + +#include +#include + +class IODeviceMemory; +class IOService; + +extern const IORegistryPlane * gIODTPlane; + +extern const OSSymbol * gIODTPHandleKey; + +extern const OSSymbol * gIODTCompatibleKey; +extern const OSSymbol * gIODTTypeKey; +extern const OSSymbol * gIODTModelKey; + +extern const OSSymbol * gIODTAAPLInterruptsKey; +extern const OSSymbol * gIODTDefaultInterruptController; +extern const OSSymbol * gIODTNWInterruptMappingKey; + +IORegistryEntry * IODeviceTreeAlloc( void * dtTop ); + + +bool IODTMatchNubWithKeys( IORegistryEntry * nub, + const char * keys ); + +bool IODTCompareNubName( const IORegistryEntry * regEntry, + OSString * name, OSString ** matchingName ); + +enum { + kIODTRecursive = 0x00000001, + kIODTExclusive = 0x00000002 +}; + +OSCollectionIterator * IODTFindMatchingEntries( IORegistryEntry * from, + IOOptionBits options, const char * keys ); + +typedef SInt32 (*IODTCompareAddressCellFunc) + (UInt32 cellCount, UInt32 left[], UInt32 right[]); +typedef void (*IODTNVLocationFunc) + (IORegistryEntry * entry, + UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum ); + +void IODTSetResolving( IORegistryEntry * regEntry, + IODTCompareAddressCellFunc compareFunc, + IODTNVLocationFunc locationFunc ); + +bool IODTResolveAddressCell( IORegistryEntry * regEntry, + UInt32 cellsIn[], + IOPhysicalAddress * phys, IOPhysicalLength * len ); + +OSArray * IODTResolveAddressing( IORegistryEntry * regEntry, + const char * addressPropertyName, + IODeviceMemory * parent ); + +struct IONVRAMDescriptor { + unsigned int format:4; + unsigned int marker:1; + unsigned int bridgeCount:3; + unsigned int busNum:2; + unsigned int bridgeDevices:6 * 5; + unsigned int functionNum:3; + unsigned int deviceNum:5; +} __attribute__((aligned(2), packed)); + +IOReturn IODTMakeNVDescriptor( IORegistryEntry * regEntry, + IONVRAMDescriptor * hdr ); + +OSData * IODTFindSlotName( IORegistryEntry * regEntry, UInt32 deviceNumber ); + +const OSSymbol * IODTInterruptControllerName( + IORegistryEntry * regEntry ); + +bool IODTMapInterrupts( IORegistryEntry * regEntry ); + +enum { + kIODTInterruptShared = 0x00000001 +}; +IOReturn IODTGetInterruptOptions( IORegistryEntry * regEntry, int source, IOOptionBits * options ); + +#ifdef __cplusplus +extern "C" { +#endif + +IOReturn IONDRVLibrariesInitialize( IOService * provider ); + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IODEVICETREE_H */ + diff --git a/i386/include/IOKit/IOEventSource.h b/i386/include/IOKit/IOEventSource.h new file mode 100644 index 0000000..4afc5aa --- /dev/null +++ b/i386/include/IOKit/IOEventSource.h @@ -0,0 +1,244 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1998 Apple Computer, Inc. All rights reserved. +HISTORY + 1998-7-13 Godfrey van der Linden(gvdl) + Created. + 1998-10-30 Godfrey van der Linden(gvdl) + Converted to C++ +*/ +#ifndef _IOKIT_IOEVENTSOURCE_H +#define _IOKIT_IOEVENTSOURCE_H + +#include + +#include + +#include +#include +#include + + +__BEGIN_DECLS +#include +#include +__END_DECLS + +/*! + @class IOEventSource : public OSObject + @abstract Abstract class for all work-loop event sources. + @discussion The IOEventSource declares the abstract super class that all +event sources must inherit from if an IOWorkLoop is to receive events from them. +

+ An event source can represent any event that should cause the work-loop of a +device to wake up and perform work. Two examples of event sources are the +IOInterruptEventSource which delivers interrupt notifications and IOCommandGate +which delivers command requests. +

+ A kernel module can always use the work-loop model for serialising access to +anything at all. The IOEventSource is used for communicating events to the +work-loop, and the chain of event sources should be used to walk the possible +event sources and demultipex them. Note a particular instance of an event +source may only be a member of 1 linked list chain. If you need to move it +between chains than make sure it is removed from the original chain before +attempting to move it. +

+ The IOEventSource makes no attempt to maintain the consitency of it's internal data across multi-threading. It is assumed that the user of these basic tools will protect the data that these objects represent in some sort of device wide instance lock. For example the IOWorkLoop maintains the event chain by handing off change request to its own thread and thus single threading access to its state. +

+ All subclasses of the IOEventSource are expected to implement the checkForWork() member function. + +

+ checkForWork() is the key method in this class. It is called by some work-loop when convienient and is expected to evaluate it's internal state and determine if an event has occurred since the last call. In the case of an event having occurred then the instance defined target(owner)/action will be called. The action is stored as an ordinary C function pointer but the first parameter is always the owner. This means that a C++ member function can be used as an action function though this depends on the ABI. +

+ Although the eventChainNext variable contains a reference to the next event source in the chain this reference is not retained. The list 'owner' i.e. the client that creates the event, not the work-loop, is expected to retain the source. +*/ +class IOEventSource : public OSObject +{ + OSDeclareAbstractStructors(IOEventSource) + friend class IOWorkLoop; + +public: +/*! + @typedef Action + @discussion Placeholder type for C++ function overloading discrimination. +As the all event sources require an action and it has to be stored somewhere +and be of some type, this is that type. + @param owner + Target of the function, can be used as a refcon. The owner is set +during initialisation. Note if a C++ function was specified this parameter +is implicitly the first paramter in the target member function's parameter list. +*/ + typedef void (*Action)(OSObject *owner, ...); + +/*! @defined IOEventSourceAction + @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOEventSource::Action */ + #define IOEventSourceAction IOEventSource::Action + +protected: +/*! @var eventChainNext + The next event source in the event chain. nil at end of chain. */ + IOEventSource *eventChainNext; + +/*! @var owner The owner object called when an event has been delivered. */ + OSObject *owner; + +/*! @var action + The action method called when an event has been delivered */ + Action action; + +/*! @var enabled + Is this event source enabled to deliver requests to the work-loop. */ + bool enabled; + +/*! @var workLoop What is the work-loop for this event source. */ + IOWorkLoop *workLoop; + +/*! @var refcon What ever the client wants to do, see $link setRefcon. */ + void *refcon; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOEventSource in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function init + @abstract Primary initialiser for the IOEventSource class. + @param owner + Owner of this instance of an event source. Used as the first parameter +of the action callout. Owner will generally be an OSObject it doesn't have to +be as no member functions will be called directly in it. It can just be a +refcon for a client routine. + @param action + Pointer to C call out function. Action is a pointer to a C function +that gets called when this event source has outstanding work. It will usually +be called by the checkForWork member function. The first parameter of the +action call out will always be the owner, this allows C++ member functions to +be used as actions. Defaults to 0. + @result true if the inherited classes and this instance initialise +successfully. +*/ + virtual bool init(OSObject *owner, IOEventSource::Action action = 0); + +/*! @function checkForWork + @abstract Pure Virtual member function used by IOWorkLoop for work +scheduling. + @discussion This function will be called to request a subclass to check +it's internal state for any work to do and then to call out the owner/action. + @result Return true if this function needs to be called again before all its outstanding events have been processed. + */ + virtual bool checkForWork() = 0; + +/*! @function setWorkLoop + @abstract Set'ter for $link workLoop variable. + @param workLoop + Target work-loop of this event source instance. A subclass of +IOWorkLoop that at least reacts to signalWorkAvailable() and onThread functions. +*/ + virtual void setWorkLoop(IOWorkLoop *workLoop); + +/*! @function setNext + @abstract Set'ter for $link eventChainNext variable. + @param next + Pointer to another IOEventSource instance. +*/ + virtual void setNext(IOEventSource *next); + +/*! @function getNext + @abstract Get'ter for $link eventChainNext variable. + @result value of eventChainNext. +*/ + virtual IOEventSource *getNext() const; + + +protected: + // Methods to access the IOWorkLoop exported fields + void signalWorkAvailable(); + void openGate(); + void closeGate(); + bool tryCloseGate(); + int sleepGate(void *event, UInt32 type); + int sleepGate(void *event, AbsoluteTime deadline, UInt32 type); + void wakeupGate(void *event, bool oneThread); + +public: +/*! @function setAction + @abstract Set'ter for $link action variable. + @param action Pointer to a C function of type IOEventSource::Action. */ + virtual void setAction(IOEventSource::Action action); + +/*! @function getAction + @abstract Get'ter for $link action variable. + @result value of action. */ + virtual IOEventSource::Action getAction() const; + +/*! @function enable + @abstract Enable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. Calling this function will cause the +work-loop to be signalled so that a checkForWork is performed. */ + virtual void enable(); + +/*! @function disable + @abstract Disable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. */ + virtual void disable(); + +/*! @function isEnabled + @abstract Get'ter for $link enable variable. + @result true if enabled. */ + virtual bool isEnabled() const; + +/*! @function getWorkLoop + @abstract Get'ter for $link workLoop variable. + @result value of workLoop. */ + virtual IOWorkLoop *getWorkLoop() const; + +/*! @function onThread + @abstract Convenience function for workLoop->onThread. + @result true if called on the work-loop thread. +*/ + virtual bool onThread() const; + +private: + OSMetaClassDeclareReservedUnused(IOEventSource, 0); + OSMetaClassDeclareReservedUnused(IOEventSource, 1); + OSMetaClassDeclareReservedUnused(IOEventSource, 2); + OSMetaClassDeclareReservedUnused(IOEventSource, 3); + OSMetaClassDeclareReservedUnused(IOEventSource, 4); + OSMetaClassDeclareReservedUnused(IOEventSource, 5); + OSMetaClassDeclareReservedUnused(IOEventSource, 6); + OSMetaClassDeclareReservedUnused(IOEventSource, 7); +}; + +#endif /* !_IOKIT_IOEVENTSOURCE_H */ diff --git a/i386/include/IOKit/IOFilterInterruptEventSource.h b/i386/include/IOKit/IOFilterInterruptEventSource.h new file mode 100644 index 0000000..de05c90 --- /dev/null +++ b/i386/include/IOKit/IOFilterInterruptEventSource.h @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + +HISTORY + 1999-4-15 Godfrey van der Linden(gvdl) + Created. +*/ +#ifndef _IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H +#define _IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H + +#include + +class IOService; + +/*! @class IOFilterInterruptEventSource : public IOInterruptEventSource + @abstract Filtering varient of the $link IOInterruptEventSource. + @discussion An interrupt event source that calls the client to determine if a interrupt event needs to be scheduled on the work loop. A filter interrupt event source call's the client in the primary interrupt context, the client can then interrogate its hardware and determine if the interrupt needs to be processed yet. +

+ As the routine is called in the primary interrupt context great care must be taken in the writing of this routine. In general none of the generic IOKit environment is safe to call in this context. We intend this routine to be used by hardware that can interrogate its registers without destroying state. Primarily this variant of event sources will be used by drivers that share interrupts. The filter routine will determine if the interrupt is a real interrupt or a ghost and thus optimise the work thread context switch away. +

+If you are implementing 'SoftDMA' (or pseudo-DMA), you may not want the I/O Kit to automatically start your interrupt handler routine on your work loop when your filter routine returns true. In this case, you may choose to have your filter routine schedule the work on the work loop itself and then return false. If you do this, the interrupt will not be disabled in hardware and you could receive additional primary interrupts before your work loop–level service routine completes. Because this scheme has implications for synchronization between your filter routine and your interrupt service routine, you should avoid doing this unless your driver requires SoftDMA. +

+CAUTION: Called in primary interrupt context, if you need to disable interrupt to guard you registers against an unexpected call then it is better to use a straight IOInterruptEventSource and its secondary interrupt delivery mechanism. +*/ +class IOFilterInterruptEventSource : public IOInterruptEventSource +{ + OSDeclareDefaultStructors(IOFilterInterruptEventSource) + +public: +/*! + @typedef Filter + @discussion C Function pointer to a routine to call when an interrupt occurs. + @param owner Pointer to the owning/client instance. + @param sender Where is the interrupt comming from. + @result false if this interrupt can be ignored. */ + typedef bool (*Filter)(OSObject *, IOFilterInterruptEventSource *); + +/*! @defined IOFilterInterruptAction + @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOFilterInterruptSource::Filter */ +#define IOFilterInterruptAction IOFilterInterruptEventSource::Filter + +private: + // Hide the superclass initializers + virtual bool init(OSObject *inOwner, + IOInterruptEventSource::Action inAction = 0, + IOService *inProvider = 0, + int inIntIndex = 0); + + static IOInterruptEventSource * + interruptEventSource(OSObject *inOwner, + IOInterruptEventSource::Action inAction = 0, + IOService *inProvider = 0, + int inIntIndex = 0); + +protected: +/*! @var filterAction Filter callout */ + Filter filterAction; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: +/*! @function filterInterruptEventSource + @abstract Factor method to create and initialise an IOFilterInterruptEventSource. See $link init. + @param owner Owner/client of this event source. + @param action 'C' Function to call when something happens. + @param filter 'C' Function to call when interrupt occurs. + @param provider Service that provides interrupts. + @param intIndex Defaults to 0. + @result a new event source if succesful, 0 otherwise. */ + static IOFilterInterruptEventSource * + filterInterruptEventSource(OSObject *owner, + IOInterruptEventSource::Action action, + Filter filter, + IOService *provider, + int intIndex = 0); + +/*! @function init + @abstract Primary initialiser for the IOFilterInterruptEventSource class. + @param owner Owner/client of this event source. + @param action 'C' Function to call when something happens. + @param filter 'C' Function to call in primary interrupt context. + @param provider Service that provides interrupts. + @param intIndex Interrupt source within provider. Defaults to 0. + @result true if the inherited classes and this instance initialise +successfully. */ + virtual bool init(OSObject *owner, + IOInterruptEventSource::Action action, + Filter filter, + IOService *provider, + int intIndex = 0); + + +/*! @function signalInterrupt + @abstract Cause the work loop to schedule the action. + @discussion Cause the work loop to schedule the interrupt action even if the filter routine returns 'false'. Note well the interrupting condition MUST be cleared from the hardware otherwise an infinite process interrupt loop will occur. Use this function when SoftDMA is desired. See $link IOFilterInterruptSource::Filter */ + virtual void signalInterrupt(); + +/*! @function getFilterAction + @abstract Get'ter for filterAction variable. + @result value of filterAction. */ + virtual Filter getFilterAction() const; + +/*! @function normalInterruptOccurred + @abstract Override $link IOInterruptEventSource::normalInterruptOccured to make a filter callout. */ + virtual void normalInterruptOccurred(void *self, IOService *prov, int ind); + +/*! @function disableInterruptOccurred + @abstract Override $link IOInterruptEventSource::disableInterruptOccurred to make a filter callout. */ + virtual void disableInterruptOccurred(void *self, IOService *prov, int ind); + +private: + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 0); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 1); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 2); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 3); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 4); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 5); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 6); + OSMetaClassDeclareReservedUnused(IOFilterInterruptEventSource, 7); +}; + +#endif /* !_IOKIT_IOFILTERINTERRUPTEVENTSOURCE_H */ diff --git a/i386/include/IOKit/IOInterleavedMemoryDescriptor.h b/i386/include/IOKit/IOInterleavedMemoryDescriptor.h new file mode 100644 index 0000000..e5c2a94 --- /dev/null +++ b/i386/include/IOKit/IOInterleavedMemoryDescriptor.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOINTERLEAVEDMEMORYDESCRIPTOR_H +#define _IOINTERLEAVEDMEMORYDESCRIPTOR_H + +#include + +/*! @class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor + @abstract The IOInterleavedMemoryDescriptor object describes a memory area made up of portions of several other IOMemoryDescriptors. + @discussion The IOInterleavedMemoryDescriptor object represents interleaved ranges of memory, specified as an ordered list of portions of individual IOMemoryDescriptors. The portions are chained end-to-end to make up a single contiguous buffer. */ + +class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOInterleavedMemoryDescriptor); + +protected: + + IOByteCount _descriptorCapacity; + UInt32 _descriptorCount; + IOMemoryDescriptor ** _descriptors; + IOByteCount * _descriptorOffsets; + IOByteCount * _descriptorLengths; + bool _descriptorPrepared; + + virtual void free(); + +public: + +/*! @function withCapacity + @abstract Create an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method creates and initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. + @param capacity The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor. + @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOInterleavedMemoryDescriptor * withCapacity( IOByteCount capacity, + IODirection direction); + +/*! @function initWithCapacity + @abstract Initialize an IOInterleavedMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method initializes an IOInterleavedMemoryDescriptor for memory consisting of portions of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. + @param capacity The maximum number of IOMemoryDescriptors that may be subsequently added to this IOInterleavedMemoryDescriptor. + @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOInterleavedMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + virtual bool initWithCapacity( IOByteCount capacity, + IODirection direction ); + +/*! @function clearMemoryDescriptors + @abstract Clear all of the IOMemoryDescriptors currently contained in and reset the IOInterleavedMemoryDescriptor. + @discussion Clears each IOMemoryDescriptor by completing (if needed) and releasing. The IOInterleavedMemoryDescriptor is then reset and may accept new descriptors up to the capacity specified when it was created. + @param direction An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. */ + + virtual void clearMemoryDescriptors( IODirection direction = kIODirectionNone ); + +/*! @function setMemoryDescriptor + @abstract Add a portion of an IOMemoryDescriptor to the IOInterleavedMemoryDescriptor. + @discussion This method adds the portion of an IOMemoryDescriptor described by the offset and length parameters to the end of the IOInterleavedMemoryDescriptor. A single IOMemoryDescriptor may be added as many times as there is room for it. The offset and length must describe a portion entirely within the IOMemoryDescriptor. + @param descriptor An IOMemoryDescriptor to be added to the IOInterleavedMemoryDescriptor. Its direction must be compatible with that of the IOInterleavedMemoryDescriptor. + @param offset The offset into the IOMemoryDescriptor of the portion that will be added to the virtualized buffer. + @param length The length of the portion of the IOMemoryDescriptor to be added to the virtualized buffer. + @result Returns true the portion was successfully added. */ + + virtual bool setMemoryDescriptor( IOMemoryDescriptor * descriptor, + IOByteCount offset, + IOByteCount length ); + +/*! @function getPhysicalSegment + @abstract Break a memory descriptor into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + @param offset A byte offset into the memory whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the memory. */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ); + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method need not called for non-pageable memory. + @param forDirection The direction of the I/O to be performed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + +/*! @function complete + @abstract Complete processing of the memory after an I/O transfer finishes. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); +}; + +#endif /* !_IOINTERLEAVEDMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/IOInterruptController.h b/i386/include/IOKit/IOInterruptController.h new file mode 100644 index 0000000..71f55e5 --- /dev/null +++ b/i386/include/IOKit/IOInterruptController.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + + +#ifndef _IOKIT_IOINTERRUPTCONTROLLER_H +#define _IOKIT_IOINTERRUPTCONTROLLER_H + +#include +#include +#include + + +class IOSharedInterruptController; + +struct IOInterruptVector { + volatile char interruptActive; + volatile char interruptDisabledSoft; + volatile char interruptDisabledHard; + volatile char interruptRegistered; + IOLock * interruptLock; + IOService * nub; + int source; + void * target; + IOInterruptHandler handler; + void * refCon; + IOSharedInterruptController *sharedController; +}; + +typedef struct IOInterruptVector IOInterruptVector; + +#if __LP64__ +typedef int32_t IOInterruptVectorNumber; +#else +typedef long IOInterruptVectorNumber; +#endif + +class IOInterruptController : public IOService +{ + OSDeclareAbstractStructors(IOInterruptController); + +protected: + IOInterruptVector *vectors; + IOSimpleLock *controllerLock; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual IOReturn registerInterrupt(IOService *nub, int source, + void *target, + IOInterruptHandler handler, + void *refCon); + virtual IOReturn unregisterInterrupt(IOService *nub, int source); + + virtual IOReturn getInterruptType(IOService *nub, int source, + int *interruptType); + + virtual IOReturn enableInterrupt(IOService *nub, int source); + virtual IOReturn disableInterrupt(IOService *nub, int source); + virtual IOReturn causeInterrupt(IOService *nub, int source); + + virtual IOInterruptAction getInterruptHandlerAddress(void); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, + int source); + + // Methods to be overridden for simplifed interrupt controller subclasses. + + virtual bool vectorCanBeShared(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void initVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual int getVectorType(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void disableVectorHard(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void enableVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + virtual void causeVector(IOInterruptVectorNumber vectorNumber, IOInterruptVector *vector); + + OSMetaClassDeclareReservedUnused(IOInterruptController, 0); + OSMetaClassDeclareReservedUnused(IOInterruptController, 1); + OSMetaClassDeclareReservedUnused(IOInterruptController, 2); + OSMetaClassDeclareReservedUnused(IOInterruptController, 3); + OSMetaClassDeclareReservedUnused(IOInterruptController, 4); + OSMetaClassDeclareReservedUnused(IOInterruptController, 5); +}; + + +class IOSharedInterruptController : public IOInterruptController +{ + OSDeclareDefaultStructors(IOSharedInterruptController); + +private: + IOService *provider; + int numVectors; + int vectorsRegistered; + int vectorsEnabled; + volatile int controllerDisabled; + bool sourceIsLevel; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual IOReturn initInterruptController(IOInterruptController *parentController, OSData *parentSource); + + virtual IOReturn registerInterrupt(IOService *nub, int source, + void *target, + IOInterruptHandler handler, + void *refCon); + virtual IOReturn unregisterInterrupt(IOService *nub, int source); + + virtual IOReturn getInterruptType(IOService *nub, int source, + int *interruptType); + + virtual IOReturn enableInterrupt(IOService *nub, int source); + virtual IOReturn disableInterrupt(IOService *nub, int source); + + virtual IOInterruptAction getInterruptHandlerAddress(void); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, int source); + + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 0); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 1); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 2); + OSMetaClassDeclareReservedUnused(IOSharedInterruptController, 3); +}; + + +#endif /* ! _IOKIT_IOINTERRUPTCONTROLLER_H */ diff --git a/i386/include/IOKit/IOInterruptEventSource.h b/i386/include/IOKit/IOInterruptEventSource.h new file mode 100644 index 0000000..0be7caf --- /dev/null +++ b/i386/include/IOKit/IOInterruptEventSource.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + +HISTORY + 1998-7-13 Godfrey van der Linden(gvdl) + Created. + 1998-10-30 Godfrey van der Linden(gvdl) + Converted to C++ +*/ + +#ifndef _IOKIT_IOINTERRUPTEVENTSOURCE_H +#define _IOKIT_IOINTERRUPTEVENTSOURCE_H + +#include + +class IOService; + +/*! @class IOInterruptEventSource : public IOEventSource + @abstract Event source for interrupt delivery to work-loop based drivers. + @discussion The IOInterruptEventSource is a generic object that delivers calls interrupt routines in it's client in a guaranteed single-threaded manner. IOInterruptEventSource is part of the IOKit $link IOWorkLoop infrastructure where the semantic that one and only one action method is executing within a work-loops event chain. +

+When the action method is called in the client member function will receive 2 arguments, (IOEventSource *) sender and (int) count, See $link IOInterruptEventSource::Action. Where sender will be reference to the interrupt that occurred and the count will be computed by the difference between the $link producerCount and $link consumerCount. This number may not be reliable as no attempt is made to adjust for around the world type problems but is provided for general information and statistic gathering. +

+In general a client will use the factory member function to create and initialise the event source and then add it to their work-loop. It is the work loop's responsiblity to maintain the new event source in it's event chain. See $link IOWorkLoop. +

+An interrupt event source attaches itself to the given provider's interrupt source at initialisation time. At this time it determines if it is connected to a level or edge triggered interrupt. If the interrupt is an level triggered interrupt the event source automatically disables the interrupt source at primary interrupt time and after it call's the client it automatically reenables the interrupt. This action is fairly expensive but it is 100% safe and defaults sensibly so that the driver writer does not have to implement type dependant interrupt routines. So to repeat, the driver writer does not have to be concerned by the actual underlying interrupt mechanism as the event source hides the complexity. +

+Saying this if the hardware is a multi-device card, for instance a 4 port NIC, where all of the devices are sharing one level triggered interrupt AND it is possible to determine each port's interrupt state non-destructively then the $link IOFilterInterruptEventSource would be a better choice. +

+Warning: All IOInterruptEventSources are created in the disabled state. If you want to actually schedule interrupt delivery do not forget to enable the source. +*/ +class IOInterruptEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOInterruptEventSource) + +public: +/*! @typedef Action + @discussion 'C' pointer prototype of functions that are called in a single threaded context when an interrupt occurs. + @param owner Pointer to client instance. + @param sender Pointer to generation interrupt event source. + @param count Number of interrupts seen before delivery. */ + typedef void (*Action)(OSObject *, IOInterruptEventSource *, int count); + +/*! @defined IOInterruptEventAction + @discussion Backward compatibilty define for the old non-class scoped type definition. See $link IOInterruptEventSource::Action */ +#define IOInterruptEventAction IOInterruptEventSource::Action + +protected: +/*! @var provider IOService that provides interrupts for delivery. */ + IOService *provider; + +/*! @var intIndex */ + int intIndex; + +/*! @var producerCount + Current count of produced interrupts that have been received. */ + volatile unsigned int producerCount; + +/*! @var consumerCount + Current count of produced interrupts that the owner has been informed of. */ + unsigned int consumerCount; + +/*! @var autoDisable Do we need to automatically disable the interrupt source when we take an interrupt, i.e. we are level triggered. */ + bool autoDisable; + +/*! @var explicitDisable Has the user expicitly disabled this event source, if so then do not overide their request when returning from the callout */ + bool explicitDisable; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function free + @abstract Sub-class implementation of free method, disconnects from the interrupt source. */ + virtual void free(); + +/*! @function checkForWork + @abstract Pure Virtual member function used by IOWorkLoop for issueing a client calls. + @discussion This function called when the work-loop is ready to check for any work to do and then to call out the owner/action. + @result Return true if this function needs to be called again before all its outstanding events have been processed. */ + virtual bool checkForWork(); + +public: + +/*! @function interruptEventSource + @abstract Factory function for IOInterruptEventSources creation and initialisation. + @param owner Owning client of the new event source. + @param action 'C' Function to call when something happens. + @param provider IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + @param intIndex The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider. + @result A new interrupt event source if successfully created and initialised, 0 otherwise. */ + static IOInterruptEventSource * + interruptEventSource(OSObject *owner, + Action action, + IOService *provider = 0, + int intIndex = 0); + +/*! @function init + @abstract Primary initialiser for the IOInterruptEventSource class. + @param owner Owning client of the new event source. + @param action 'C' Function to call when something happens. + @param provider IOService that represents the interrupt source. Defaults to 0. When no provider is defined the event source assumes that the client will in some manner call the interruptOccured method explicitly. This will start the ball rolling for safe delivery of asynchronous event's into the driver. + @param intIndex The index of the interrupt within the provider's interrupt sources. Defaults to 0, i.e. the first interrupt in the provider. + @result true if the inherited classes and this instance initialise +successfully. */ + virtual bool init(OSObject *owner, + Action action, + IOService *provider = 0, + int intIndex = 0); + +/*! @function enable + @abstract Enable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. Calling this function will cause the +work-loop to be signalled so that a checkForWork is performed. */ + virtual void enable(); + +/*! @function disable + @abstract Disable event source. + @discussion A subclass implementation is expected to respect the enabled +state when checkForWork is called. */ + virtual void disable(); + +/*! @function getProvider + @abstract Get'ter for $link provider variable. + @result value of provider. */ + virtual const IOService *getProvider() const; + +/*! @function getIntIndex + @abstract Get'ter for $link intIndex interrupt index variable. + @result value of intIndex. */ + virtual int getIntIndex() const; + +/*! @function getAutoDisable + @abstract Get'ter for $link autoDisable variable. + @result value of autoDisable. */ + virtual bool getAutoDisable() const; + +/*! @function interruptOccurred + @abstract Functions that get called by the interrupt controller. See $link IOService::registerInterrupt + @param nub Where did the interrupt originate from + @param ind What is this interrupts index within 'nub'. */ + virtual void interruptOccurred(void *, IOService *nub, int ind); + +/*! @function normalInterruptOccurred + @abstract Functions that get called by the interrupt controller.See $link IOService::registerInterrupt + @param nub Where did the interrupt originate from + @param ind What is this interrupts index within 'nub'. */ + virtual void normalInterruptOccurred(void *, IOService *nub, int ind); + +/*! @function disableInterruptOccurred + @abstract Functions that get called by the interrupt controller.See $link IOService::registerInterrupt + @param nub Where did the interrupt originate from + @param ind What is this interrupts index within 'nub'. */ + virtual void disableInterruptOccurred(void *, IOService *nub, int ind); + +private: + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 0); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 1); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 2); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 3); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 4); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 5); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 6); + OSMetaClassDeclareReservedUnused(IOInterruptEventSource, 7); +}; + +#endif /* !_IOKIT_IOINTERRUPTEVENTSOURCE_H */ diff --git a/i386/include/IOKit/IOInterrupts.h b/i386/include/IOKit/IOInterrupts.h new file mode 100644 index 0000000..fa8aa7b --- /dev/null +++ b/i386/include/IOKit/IOInterrupts.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + + +#ifndef _IOKIT_IOINTERRUPTS_H +#define _IOKIT_IOINTERRUPTS_H + +#define kIOInterruptTypeEdge (0) +#define kIOInterruptTypeLevel (1) + +#ifdef __cplusplus + +class OSData; +class IOInterruptController; + +struct IOInterruptSource { + IOInterruptController *interruptController; + OSData *vectorData; +}; +typedef struct IOInterruptSource IOInterruptSource; + +#endif /* __cplusplus */ + +typedef void (*IOInterruptHandler)(void *target, void *refCon, + void *nub, int source); + +#endif /* ! _IOKIT_IOINTERRUPTS_H */ diff --git a/i386/include/IOKit/IOKitDebug.h b/i386/include/IOKit/IOKitDebug.h new file mode 100644 index 0000000..499faa3 --- /dev/null +++ b/i386/include/IOKit/IOKitDebug.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOKITDEBUG_H +#define _IOKIT_IOKITDEBUG_H + +#include + + +#ifdef __cplusplus + +#include +#include +#include + +class IOKitDiagnostics : public OSObject +{ + OSDeclareDefaultStructors(IOKitDiagnostics) + +public: + static OSObject * diagnostics( void ); + virtual bool serialize(OSSerialize *s) const; +private: + static void updateOffset( OSDictionary * dict, + UInt32 value, const char * name ); +}; + +#endif /* __cplusplus */ + +enum { + // loggage + kIOLogAttach = 0x00000001ULL, + kIOLogProbe = 0x00000002ULL, + kIOLogStart = 0x00000004ULL, + kIOLogRegister = 0x00000008ULL, + kIOLogMatch = 0x00000010ULL, + kIOLogConfig = 0x00000020ULL, + kIOLogYield = 0x00000040ULL, + kIOLogPower = 0x00000080ULL, + kIOLogMapping = 0x00000100ULL, + kIOLogCatalogue = 0x00000200ULL, + kIOLogTracePower = 0x00000400ULL, + kIOLogDebugPower = 0x00000800ULL, + kIOLogServiceTree = 0x00001000ULL, + kIOLogDTree = 0x00002000ULL, + kIOLogMemory = 0x00004000ULL, + kIOLogKextMemory = 0x00008000ULL, + kOSLogRegistryMods = 0x00010000ULL, // Log attempts to modify registry collections + kIOLogPMRootDomain = 0x00020000ULL, + kOSRegistryModsMode = 0x00040000ULL, // Change default registry modification handling - panic vs. log + kIOTraceIOService = 0x00080000ULL, + kIOLogHibernate = 0x00100000ULL, + + // debug aids - change behaviour + kIONoFreeObjects = 0x00100000ULL, + kIOLogSynchronous = 0x00200000ULL, // IOLog completes synchronously + kOSTraceObjectAlloc = 0x00400000ULL, + + _kIODebugTopFlag = 0x8000000000000000ULL // force enum to be 64 bits +}; + +extern SInt64 gIOKitDebug; + +#ifdef __cplusplus +extern "C" { +#endif + +struct IORegistryPlane; +extern void IOPrintPlane( const struct IORegistryPlane * plane ); +#ifndef _OSCPPDEBUG_H +extern void OSPrintMemory( void ); +#endif +#define IOPrintMemory OSPrintMemory + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* ! _IOKIT_IOKITDEBUG_H */ diff --git a/i386/include/IOKit/IOKitKeys.h b/i386/include/IOKit/IOKitKeys.h new file mode 100644 index 0000000..62395d5 --- /dev/null +++ b/i386/include/IOKit/IOKitKeys.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * Common symbol definitions for IOKit. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOKITKEYS_H +#define _IOKIT_IOKITKEYS_H + +// properties found in the registry root +#define kIOKitBuildVersionKey "IOKitBuildVersion" +#define kIOKitDiagnosticsKey "IOKitDiagnostics" + // a dictionary keyed by plane name +#define kIORegistryPlanesKey "IORegistryPlanes" +#define kIOCatalogueKey "IOCatalogue" + +// registry plane names +#define kIOServicePlane "IOService" +#define kIOPowerPlane "IOPower" +#define kIODeviceTreePlane "IODeviceTree" +#define kIOAudioPlane "IOAudio" +#define kIOFireWirePlane "IOFireWire" +#define kIOUSBPlane "IOUSB" + +// registry ID number +#define kIORegistryEntryIDKey "IORegistryEntryID" + +// IOService class name +#define kIOServiceClass "IOService" + +// IOResources class name +#define kIOResourcesClass "IOResources" + +// IOService driver probing property names +#define kIOClassKey "IOClass" +#define kIOProbeScoreKey "IOProbeScore" +#define kIOKitDebugKey "IOKitDebug" + +// IOService matching property names +#define kIOProviderClassKey "IOProviderClass" +#define kIONameMatchKey "IONameMatch" +#define kIOPropertyMatchKey "IOPropertyMatch" +#define kIOPathMatchKey "IOPathMatch" +#define kIOLocationMatchKey "IOLocationMatch" +#define kIOParentMatchKey "IOParentMatch" +#define kIOResourceMatchKey "IOResourceMatch" +#define kIOMatchedServiceCountKey "IOMatchedServiceCountMatch" + +#define kIONameMatchedKey "IONameMatched" + +#define kIOMatchCategoryKey "IOMatchCategory" +#define kIODefaultMatchCategoryKey "IODefaultMatchCategory" + +// IOService default user client class, for loadable user clients +#define kIOUserClientClassKey "IOUserClientClass" + +// key to find IOMappers +#define kIOMapperIDKey "IOMapperID" + +#define kIOUserClientCrossEndianKey "IOUserClientCrossEndian" +#define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible" +#define kIOUserClientSharedInstanceKey "IOUserClientSharedInstance" +// diagnostic string describing the creating task +#define kIOUserClientCreatorKey "IOUserClientCreator" + +// IOService notification types +#define kIOPublishNotification "IOServicePublish" +#define kIOFirstPublishNotification "IOServiceFirstPublish" +#define kIOMatchedNotification "IOServiceMatched" +#define kIOFirstMatchNotification "IOServiceFirstMatch" +#define kIOTerminatedNotification "IOServiceTerminate" + +// IOService interest notification types +#define kIOGeneralInterest "IOGeneralInterest" +#define kIOBusyInterest "IOBusyInterest" +#define kIOAppPowerStateInterest "IOAppPowerStateInterest" +#define kIOPriorityPowerStateInterest "IOPriorityPowerStateInterest" + +#define kIOPlatformDeviceMessageKey "IOPlatformDeviceMessage" + +// IOService interest notification types +#define kIOCFPlugInTypesKey "IOCFPlugInTypes" + +// properties found in services that implement command pooling +#define kIOCommandPoolSizeKey "IOCommandPoolSize" // (OSNumber) + +// properties found in services that have transfer constraints +#define kIOMaximumBlockCountReadKey "IOMaximumBlockCountRead" // (OSNumber) +#define kIOMaximumBlockCountWriteKey "IOMaximumBlockCountWrite" // (OSNumber) +#define kIOMaximumByteCountReadKey "IOMaximumByteCountRead" // (OSNumber) +#define kIOMaximumByteCountWriteKey "IOMaximumByteCountWrite" // (OSNumber) +#define kIOMaximumSegmentCountReadKey "IOMaximumSegmentCountRead" // (OSNumber) +#define kIOMaximumSegmentCountWriteKey "IOMaximumSegmentCountWrite" // (OSNumber) +#define kIOMaximumSegmentByteCountReadKey "IOMaximumSegmentByteCountRead" // (OSNumber) +#define kIOMaximumSegmentByteCountWriteKey "IOMaximumSegmentByteCountWrite" // (OSNumber) +#define kIOMinimumSegmentAlignmentByteCountKey "IOMinimumSegmentAlignmentByteCount" // (OSNumber) +#define kIOMaximumSegmentAddressableBitCountKey "IOMaximumSegmentAddressableBitCount" // (OSNumber) + +// properties found in services that wish to describe an icon +// +// IOIcon = +// { +// CFBundleIdentifier = "com.example.driver.example"; +// IOBundleResourceFile = "example.icns"; +// }; +// +// where IOBundleResourceFile is the filename of the resource + +#define kIOIconKey "IOIcon" // (OSDictionary) +#define kIOBundleResourceFileKey "IOBundleResourceFile" // (OSString) + +#define kIOBusBadgeKey "IOBusBadge" // (OSDictionary) +#define kIODeviceIconKey "IODeviceIcon" // (OSDictionary) + +// property of root that describes the machine's serial number as a string +#define kIOPlatformSerialNumberKey "IOPlatformSerialNumber" // (OSString) + +// property of root that describes the machine's UUID as a string +#define kIOPlatformUUIDKey "IOPlatformUUID" // (OSString) + +// IODTNVRAM property keys +#define kIONVRAMDeletePropertyKey "IONVRAM-DELETE-PROPERTY" +#define kIODTNVRAMPanicInfoKey "aapl,panic-info" + +// keys for complex boot information +#define kIOBootDeviceKey "IOBootDevice" // dict | array of dicts +#define kIOBootDevicePathKey "IOBootDevicePath" // arch-neutral OSString +#define kIOBootDeviceSizeKey "IOBootDeviceSize" // OSNumber of bytes + +// keys for OS Version information +#define kOSBuildVersionKey "OS Build Version" + +#endif /* ! _IOKIT_IOKITKEYS_H */ diff --git a/i386/include/IOKit/IOKitServer.h b/i386/include/IOKit/IOKitServer.h new file mode 100644 index 0000000..a68c992 --- /dev/null +++ b/i386/include/IOKit/IOKitServer.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Internal definitions used between the iokit user library and + * server routines. + */ + +#ifndef _IOKIT_IOKITSERVER_H +#define _IOKIT_IOKITSERVER_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +#include +#ifdef __cplusplus +} +#endif + +// IOMakeMatching +/*! + @enum IOMakeMatching + @constant kIOServiceMatching + @constant kIOBSDNameMatching + @constant kIOOFPathMatching +*/ +enum { + kIOServiceMatching = 100, + kIOBSDNameMatching = 101, + kIOOFPathMatching = 102 +}; + +// IOCatalogueSendData +/*! + @enum IOCatalogueSendData user-client flags. + @constant kIOCatalogAddDrivers Signals a call to the addDrivers function in IOCatalogue. + @constant kIOCatalogAddDriversNoMatch Signals a call to the addDrivers function in IOCatalogue but does not start a matching thread. + @constant kIOCatalogRemoveDrivers Signals a call to the removeDrivers function in IOCatalogue. + @constant kIOCatalogRemoveDriversNoMatch Signals a call to the removedrivers function in IOCatalogue but does not start a matching thread. + @constant kIOCatalogStartMatching Signals the IOCatalogue to start an IOService matching thread. +*/ +enum { + kIOCatalogAddDrivers = 1, + kIOCatalogAddDriversNoMatch, + kIOCatalogRemoveDrivers, + kIOCatalogRemoveDriversNoMatch, + kIOCatalogStartMatching, + kIOCatalogRemoveKernelLinker, + kIOCatalogKextdActive, + kIOCatalogKextdFinishedLaunching +}; + +// IOCatalogueGetData +/*! + @enum IOCatalogueGetData user-client flags + @constant kIOCatalogGetContents Returns a snapshot of the database to the caller. +*/ +enum { + kIOCatalogGetContents = 1, + kIOCatalogGetModuleDemandList = 2, + kIOCatalogGetCacheMissList = 3, + kIOCatalogGetROMMkextList = 4 +}; + +// IOCatalogueReset +/*! + @enum IOCatalogueReset user-client flag + @constant kIOCatalogResetDefault Removes all entries from IOCatalogue except those used for booting the system. +*/ +enum { + kIOCatalogResetDefault = 1 +}; + +// IOCatalogueTerminate +/*! + @enum IOCatalogueTerminate user-client flags. + @constant kIOCatalogModuleUnload Terminates all services which depend on a particular module and unloads the module. + @constant kIOCatalogModuleTerminate Terminates all services which depend on a particular module but does not unload the module. + @constant kIOCatalogServiceTerminate Terminates a particular service by name. +*/ +enum { + kIOCatalogModuleUnload = 1, + kIOCatalogModuleTerminate, + kIOCatalogServiceTerminate +}; + +#endif /* ! _IOKIT_IOKITSERVER_H */ + diff --git a/i386/include/IOKit/IOLib.h b/i386/include/IOKit/IOLib.h new file mode 100644 index 0000000..1eb5562 --- /dev/null +++ b/i386/include/IOKit/IOLib.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __IOKIT_IOLIB_H +#define __IOKIT_IOLIB_H + + +#include +#include + +#include + +#include + +#include +#include +#include + +#include + +__BEGIN_DECLS + +#include +#include + +/* + * min/max macros. + */ + +#define min(a,b) ((a) < (b) ? (a) : (b)) +#define max(a,b) ((a) > (b) ? (a) : (b)) + +/* + * These are opaque to the user. + */ +typedef thread_t IOThread; +typedef void (*IOThreadFunc)(void *argument); + + +/* + * IORound and IOTrunc convenience functions, in the spirit + * of vm's round_page() and trunc_page(). + */ +#define IORound(value,multiple) \ + ((((value) + (multiple) - 1) / (multiple)) * (multiple)) + +#define IOTrunc(value,multiple) \ + (((value) / (multiple)) * (multiple)); + +__END_DECLS + +#endif /* !__IOKIT_IOLIB_H */ diff --git a/i386/include/IOKit/IOLocks.h b/i386/include/IOKit/IOLocks.h new file mode 100644 index 0000000..81701a0 --- /dev/null +++ b/i386/include/IOKit/IOLocks.h @@ -0,0 +1,409 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * + */ + +#ifndef __IOKIT_IOLOCKS_H +#define __IOKIT_IOLOCKS_H + + +#include + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/*! @var IOLockGroup + Global lock group used by all IOKit locks. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. +*/ +extern lck_grp_t *IOLockGroup; + + +/* + * Mutex lock operations + */ + +#ifdef IOLOCKS_INLINE +typedef lck_mtx_t IOLock; +#else +typedef struct _IOLock IOLock; +#endif /* IOLOCKS_INLINE */ + + +/*! @function IOLockAlloc + @abstract Allocates and initializes a mutex. + @discussion Allocates a mutex in general purpose memory, and initializes it. Mutexes are general purpose blocking mutual exclusion locks, supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IOLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IOLock * IOLockAlloc( void ); + +/*! @function IOLockFree + @abstract Frees a mutex. + @discussion Frees a lock allocated with IOLockAlloc. Any blocked waiters will not be woken. + @param lock Pointer to the allocated lock. */ + +void IOLockFree( IOLock * lock); + +/*! @function IOLockGetMachLock + @abstract Accessor to a Mach mutex. + @discussion Accessor to the Mach mutex. + @param lock Pointer to the allocated lock. */ + +lck_mtx_t * IOLockGetMachLock( IOLock * lock); + +/*! @function IOLockLock + @abstract Lock a mutex. + @discussion Lock the mutex. If the lock is held by any thread, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the mutex recursively from one thread will result in deadlock. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IOLockLock(l) lck_mtx_lock(l) +#else +void IOLockLock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockTryLock + @abstract Attempt to lock a mutex. + @discussion Lock the mutex if it is currently unlocked, and return true. If the lock is held by any thread, return false. + @param lock Pointer to the allocated lock. + @result True if the mutex was unlocked and is now locked by the caller, otherwise false. */ + +#ifdef IOLOCKS_INLINE +#define IOLockTryLock(l) lck_mtx_try_lock(l) +#else +boolean_t IOLockTryLock( IOLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockUnlock + @abstract Unlock a mutex. +@discussion Unlock the mutex and wake any blocked waiters. Results are undefined if the caller has not locked the mutex. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IOLockUnlock(l) lck_mtx_unlock(l) +#else +#if defined(__i386__) +void IOLockUnlock( IOLock * lock) __DARWIN10_ALIAS(IOLockUnlock); +#else /* !__i386__ */ +void IOLockUnlock( IOLock * lock); +#endif /* __i386__ */ +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOLockSleep + @abstract Sleep with mutex unlock and relock +@discussion Prepare to sleep,unlock the mutex, and re-acquire it on wakeup. Results are undefined if the caller has not locked the mutex. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the locked lock. + @param event The event to sleep on. + @param interType How can the sleep be interrupted. + @result The wait-result value indicating how the thread was awakened.*/ +int IOLockSleep( IOLock * lock, void *event, UInt32 interType); + +int IOLockSleepDeadline( IOLock * lock, void *event, + AbsoluteTime deadline, UInt32 interType); + +void IOLockWakeup(IOLock * lock, void *event, bool oneThread); + +#ifdef __APPLE_API_OBSOLETE + +/* The following API is deprecated */ + +typedef enum { + kIOLockStateUnlocked = 0, + kIOLockStateLocked = 1 +} IOLockState; + +void IOLockInitWithState( IOLock * lock, IOLockState state); +#define IOLockInit( l ) IOLockInitWithState( l, kIOLockStateUnlocked); + +static __inline__ void IOTakeLock( IOLock * lock) { IOLockLock(lock); } +static __inline__ boolean_t IOTryLock( IOLock * lock) { return(IOLockTryLock(lock)); } +static __inline__ void IOUnlock( IOLock * lock) { IOLockUnlock(lock); } + +#endif /* __APPLE_API_OBSOLETE */ + +/* + * Recursive lock operations + */ + +typedef struct _IORecursiveLock IORecursiveLock; + +/*! @function IORecursiveLockAlloc + @abstract Allocates and initializes an recursive lock. + @discussion Allocates a recursive lock in general purpose memory, and initializes it. Recursive locks function identically to mutexes but allow one thread to lock more than once, with balanced unlocks. IORecursiveLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IORecursiveLock * IORecursiveLockAlloc( void ); + +/*! @function IORecursiveLockFree + @abstract Frees a recursive lock. + @discussion Frees a lock allocated with IORecursiveLockAlloc. Any blocked waiters will not be woken. + @param lock Pointer to the allocated lock. */ + +void IORecursiveLockFree( IORecursiveLock * lock); + +/*! @function IORecursiveLockGetMachLock + @abstract Accessor to a Mach mutex. + @discussion Accessor to the Mach mutex. + @param lock Pointer to the allocated lock. */ + +lck_mtx_t * IORecursiveLockGetMachLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockLock + @abstract Lock a recursive lock. + @discussion Lock the recursive lock. If the lock is held by another thread, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. The lock may be taken recursively by the same thread, with a balanced number of calls to IORecursiveLockUnlock. + @param lock Pointer to the allocated lock. */ + +void IORecursiveLockLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockTryLock + @abstract Attempt to lock a recursive lock. + @discussion Lock the lock if it is currently unlocked, or held by the calling thread, and return true. If the lock is held by another thread, return false. Successful calls to IORecursiveLockTryLock should be balanced with calls to IORecursiveLockUnlock. + @param lock Pointer to the allocated lock. + @result True if the lock is now locked by the caller, otherwise false. */ + +boolean_t IORecursiveLockTryLock( IORecursiveLock * lock); + +/*! @function IORecursiveLockUnlock + @abstract Unlock a recursive lock. +@discussion Undo one call to IORecursiveLockLock, if the lock is now unlocked wake any blocked waiters. Results are undefined if the caller does not balance calls to IORecursiveLockLock with IORecursiveLockUnlock. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the allocated lock. */ + +void IORecursiveLockUnlock( IORecursiveLock * lock); + +/*! @function IORecursiveLockHaveLock + @abstract Check if a recursive lock is held by the calling thread. + @discussion If the lock is held by the calling thread, return true, otherwise the lock is unlocked, or held by another thread and false is returned. + @param lock Pointer to the allocated lock. + @result True if the calling thread holds the lock otherwise false. */ + +boolean_t IORecursiveLockHaveLock( const IORecursiveLock * lock); + +extern int IORecursiveLockSleep( IORecursiveLock *_lock, + void *event, UInt32 interType); +extern int IORecursiveLockSleepDeadline( IORecursiveLock * _lock, void *event, + AbsoluteTime deadline, UInt32 interType); +extern void IORecursiveLockWakeup( IORecursiveLock *_lock, + void *event, bool oneThread); + +/* + * Complex (read/write) lock operations + */ + +#ifdef IOLOCKS_INLINE +typedef lck_rw_t IORWLock; +#else +typedef struct _IORWLock IORWLock; +#endif /* IOLOCKS_INLINE */ + +/*! @function IORWLockAlloc + @abstract Allocates and initializes a read/write lock. + @discussion Allocates and initializes a read/write lock in general purpose memory. Read/write locks provide for multiple readers, one exclusive writer, and are supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IORWLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IORWLock * IORWLockAlloc( void ); + +/*! @function IORWLockFree + @abstract Frees a read/write lock. + @discussion Frees a lock allocated with IORWLockAlloc. Any blocked waiters will not be woken. + @param lock Pointer to the allocated lock. */ + +void IORWLockFree( IORWLock * lock); + +/*! @function IORWLockGetMachLock + @abstract Accessor to a Mach read/write lock. + @discussion Accessor to the Mach read/write lock. + @param lock Pointer to the allocated lock. */ + +lck_rw_t * IORWLockGetMachLock( IORWLock * lock); + +/*! @function IORWLockRead + @abstract Lock a read/write lock for read. +@discussion Lock the lock for read, allowing multiple readers when there are no writers. If the lock is held for write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockRead(l) lck_rw_lock_shared(l) +#else +void IORWLockRead(IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IORWLockWrite + @abstract Lock a read/write lock for write. + @discussion Lock the lock for write, allowing one writer exlusive access. If the lock is held for read or write, block waiting for its unlock. This function may block and so should not be called from interrupt level or while a spin lock is held. Locking the lock recursively from one thread, for read or write, can result in deadlock. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockWrite(l) lck_rw_lock_exclusive(l) +#else +void IORWLockWrite( IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IORWLockUnlock + @abstract Unlock a read/write lock. + @discussion Undo one call to IORWLockRead or IORWLockWrite. Results are undefined if the caller has not locked the lock. This function may block and so should not be called from interrupt level or while a spin lock is held. + @param lock Pointer to the allocated lock. */ + +#ifdef IOLOCKS_INLINE +#define IORWLockUnlock(l) lck_rw_done(l) +#else +void IORWLockUnlock( IORWLock * lock); +#endif /* !IOLOCKS_INLINE */ + + +#ifdef __APPLE_API_OBSOLETE + +/* The following API is deprecated */ + +static __inline__ void IOReadLock( IORWLock * lock) { IORWLockRead(lock); } +static __inline__ void IOWriteLock( IORWLock * lock) { IORWLockWrite(lock); } +static __inline__ void IORWUnlock( IORWLock * lock) { IORWLockUnlock(lock); } + +#endif /* __APPLE_API_OBSOLETE */ + + +/* + * Simple locks. Cannot block while holding a simple lock. + */ + +#ifdef IOLOCKS_INLINE +typedef lck_spin_t IOSimpleLock; +#else +typedef struct _IOSimpleLock IOSimpleLock; +#endif /* IOLOCKS_INLINE */ + +/*! @function IOSimpleLockAlloc + @abstract Allocates and initializes a spin lock. + @discussion Allocates and initializes a spin lock in general purpose memory. Spin locks provide non-blocking mutual exclusion for synchronization between thread context and interrupt context, or for multiprocessor synchronization, and are supplied by libkern/locks.h. This function may block and so should not be called from interrupt level or while a spin lock is held. IOSimpleLocks use the global IOKit lock group, IOLockGroup. To simplify kext debugging and lock-heat analysis, consider using lck_* locks with a per-driver lock group, as defined in kern/locks.h. + @result Pointer to the allocated lock, or zero on failure. */ + +IOSimpleLock * IOSimpleLockAlloc( void ); + +/*! @function IOSimpleLockFree + @abstract Frees a spin lock. + @discussion Frees a lock allocated with IOSimpleLockAlloc. + @param lock Pointer to the lock. */ + +void IOSimpleLockFree( IOSimpleLock * lock ); + +/*! @function IOSimpleLockGetMachLock + @abstract Accessor to a Mach spin lock. + @discussion Accessor to the Mach spin lock. + @param lock Pointer to the allocated lock. */ + +lck_spin_t * IOSimpleLockGetMachLock( IOSimpleLock * lock); + +/*! @function IOSimpleLockInit + @abstract Initialize a spin lock. + @discussion Initialize an embedded spin lock, to the unlocked state. + @param lock Pointer to the lock. */ + +void IOSimpleLockInit( IOSimpleLock * lock ); + +/*! @function IOSimpleLockLock + @abstract Lock a spin lock. +@discussion Lock the spin lock. If the lock is held, spin waiting for its unlock. Spin locks disable preemption, cannot be held across any blocking operation, and should be held for very short periods. When used to synchronize between interrupt context and thread context they should be locked with interrupts disabled - IOSimpleLockLockDisableInterrupt() will do both. Locking the lock recursively from one thread will result in deadlock. + @param lock Pointer to the lock. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockLock(l) lck_spin_lock(l) +#else +void IOSimpleLockLock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + + +/*! @function IOSimpleLockTryLock + @abstract Attempt to lock a spin lock. +@discussion Lock the spin lock if it is currently unlocked, and return true. If the lock is held, return false. Successful calls to IOSimpleLockTryLock should be balanced with calls to IOSimpleLockUnlock. + @param lock Pointer to the lock. + @result True if the lock was unlocked and is now locked by the caller, otherwise false. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockTryLock(l) lck_spin_try_lock(l) +#else +boolean_t IOSimpleLockTryLock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + +/*! @function IOSimpleLockUnlock + @abstract Unlock a spin lock. + @discussion Unlock the lock, and restore preemption. Results are undefined if the caller has not locked the lock. + @param lock Pointer to the lock. */ + +#ifdef IOLOCKS_INLINE +#define IOSimpleLockUnlock(l) lck_spin_unlock(l) +#else +void IOSimpleLockUnlock( IOSimpleLock * lock ); +#endif /* !IOLOCKS_INLINE */ + +#if __LP64__ +typedef boolean_t IOInterruptState; +#else +typedef long int IOInterruptState; +#endif + +/*! @function IOSimpleLockLockDisableInterrupt + @abstract Lock a spin lock. + @discussion Lock the spin lock. If the lock is held, spin waiting for its unlock. Simple locks disable preemption, cannot be held across any blocking operation, and should be held for very short periods. When used to synchronize between interrupt context and thread context they should be locked with interrupts disabled - IOSimpleLockLockDisableInterrupt() will do both. Locking the lock recursively from one thread will result in deadlock. + @param lock Pointer to the lock. */ + +static __inline__ +IOInterruptState IOSimpleLockLockDisableInterrupt( IOSimpleLock * lock ) +{ + IOInterruptState state = ml_set_interrupts_enabled( false ); + IOSimpleLockLock( lock ); + return( state ); +} + +/*! @function IOSimpleLockUnlockEnableInterrupt + @abstract Unlock a spin lock, and restore interrupt state. + @discussion Unlock the lock, and restore preemption and interrupts to the state as they were when the lock was taken. Results are undefined if the caller has not locked the lock. + @param lock Pointer to the lock. + @param state The interrupt state returned by IOSimpleLockLockDisableInterrupt() */ + +static __inline__ +void IOSimpleLockUnlockEnableInterrupt( IOSimpleLock * lock, + IOInterruptState state ) +{ + IOSimpleLockUnlock( lock ); + ml_set_interrupts_enabled( state ); +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* !__IOKIT_IOLOCKS_H */ + diff --git a/i386/include/IOKit/IOMapper.h b/i386/include/IOKit/IOMapper.h new file mode 100644 index 0000000..d877974 --- /dev/null +++ b/i386/include/IOKit/IOMapper.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 1998-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMAPPER_H +#define __IOKIT_IOMAPPER_H + +#include + +__BEGIN_DECLS +#include +#include + +// These are C accessors to the system mapper for non-IOKit clients +ppnum_t IOMapperIOVMAlloc(unsigned pages); +void IOMapperIOVMFree(ppnum_t addr, unsigned pages); + +ppnum_t IOMapperInsertPage(ppnum_t addr, unsigned offset, ppnum_t page); +void IOMapperInsertPPNPages(ppnum_t addr, unsigned offset, + ppnum_t *pageList, unsigned pageCount); +void IOMapperInsertUPLPages(ppnum_t addr, unsigned offset, + upl_page_info_t *pageList, unsigned pageCount); + +mach_vm_address_t IOMallocPhysical(mach_vm_size_t size, mach_vm_address_t mask); + +void IOFreePhysical(mach_vm_address_t address, mach_vm_size_t size); + +__END_DECLS + +#if __cplusplus + +#include +#include + +class OSData; +class IODMACommand; + +extern const OSSymbol * gIOMapperIDKey; + +class IOMapper : public IOService +{ + OSDeclareAbstractStructors(IOMapper); + + // Give the platform expert access to setMapperRequired(); + friend class IOPlatformExpert; + +private: + enum SystemMapperState { + kNoMapper = 0, + kUnknown = 1, + kHasMapper = 2, // Any other value is pointer to a live mapper + kWaitMask = 3, + }; +protected: + void *fTable; + ppnum_t fTablePhys; + IOItemCount fTableSize; + OSData *fTableHandle; + bool fIsSystem; + + + static void setMapperRequired(bool hasMapper); + static void waitForSystemMapper(); + + virtual bool initHardware(IOService *provider) = 0; + + virtual bool allocTable(IOByteCount size); + +public: + virtual bool start(IOService *provider); + virtual void free(); + + // Static routines capable of allocating tables that are physically + // contiguous in real memory space. + static OSData * NewARTTable(IOByteCount size, + void ** virtAddrP, ppnum_t *physAddrP); + static void FreeARTTable(OSData *handle, IOByteCount size); + + + // To get access to the system mapper IOMapper::gSystem + static IOMapper *gSystem; + + virtual ppnum_t iovmAlloc(IOItemCount pages) = 0; + virtual void iovmFree(ppnum_t addr, IOItemCount pages) = 0; + + virtual void iovmInsert(ppnum_t addr, IOItemCount offset, ppnum_t page) = 0; + virtual void iovmInsert(ppnum_t addr, IOItemCount offset, + ppnum_t *pageList, IOItemCount pageCount); + virtual void iovmInsert(ppnum_t addr, IOItemCount offset, + upl_page_info_t *pageList, IOItemCount pageCount); + + static void checkForSystemMapper() + { if ((uintptr_t) gSystem & kWaitMask) waitForSystemMapper(); }; + + static IOMapper * copyMapperForDevice(IOService * device); + + + // Function will panic if the given address is not found in a valid + // iovm mapping. + virtual addr64_t mapAddr(IOPhysicalAddress addr) = 0; + + // Get the address mask to or into an address to bypass this mapper + virtual bool getBypassMask(addr64_t *maskP) const; + + virtual ppnum_t iovmAllocDMACommand(IODMACommand * command, IOItemCount pageCount); + virtual void iovmFreeDMACommand(IODMACommand * command, ppnum_t addr, IOItemCount pageCount); + + OSMetaClassDeclareReservedUsed(IOMapper, 0); + OSMetaClassDeclareReservedUsed(IOMapper, 1); + OSMetaClassDeclareReservedUsed(IOMapper, 2); + +private: + OSMetaClassDeclareReservedUnused(IOMapper, 3); + OSMetaClassDeclareReservedUnused(IOMapper, 4); + OSMetaClassDeclareReservedUnused(IOMapper, 5); + OSMetaClassDeclareReservedUnused(IOMapper, 6); + OSMetaClassDeclareReservedUnused(IOMapper, 7); + OSMetaClassDeclareReservedUnused(IOMapper, 8); + OSMetaClassDeclareReservedUnused(IOMapper, 9); + OSMetaClassDeclareReservedUnused(IOMapper, 10); + OSMetaClassDeclareReservedUnused(IOMapper, 11); + OSMetaClassDeclareReservedUnused(IOMapper, 12); + OSMetaClassDeclareReservedUnused(IOMapper, 13); + OSMetaClassDeclareReservedUnused(IOMapper, 14); + OSMetaClassDeclareReservedUnused(IOMapper, 15); +}; + +#endif /* __cplusplus */ + +#endif /* !__IOKIT_IOMAPPER_H */ diff --git a/i386/include/IOKit/IOMemoryCursor.h b/i386/include/IOKit/IOMemoryCursor.h new file mode 100644 index 0000000..dfe9eed --- /dev/null +++ b/i386/include/IOKit/IOMemoryCursor.h @@ -0,0 +1,462 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOMEMORYCURSOR_H +#define _IOMEMORYCURSOR_H + +#include +#include + +class IOMemoryDescriptor; + +/**************************** class IOMemoryCursor ***************************/ + +/*! + @class IOMemoryCursor + @abstract A mechanism to convert memory references to physical addresses. + @discussion The IOMemoryCursor declares the super class that all +specific memory cursors must inherit from, but a memory cursor can be created without a specific format subclass by just providing a segment function to the initializers. This class does the difficult stuff of dividing a memory descriptor into a physical scatter/gather list appropriate for the target hardware. +

+ A driver is expected to create a memory cursor and configure it to the limitations of its DMA hardware; for instance the memory cursor used by the FireWire SBP-2 protocol has a maximum physical segment size of 2^16 - 1 but the actual transfer size is unlimited. Thus it would create a cursor with a maxSegmentSize of 65535 and a maxTransfer size of UINT_MAX. It would also provide a SegmentFunction that can output a pagelist entry. +

+Below is the simplest example of a SegmentFunction:
+void IONaturalMemoryCursor::outputSegment(PhysicalSegment segment,
+ void * outSegments,
+ UInt32 outSegmentIndex)
+{
+ ((PhysicalSegment *) outSegments)[outSegmentIndex] = segment;
+} + +*/ +class IOMemoryCursor : public OSObject +{ + OSDeclareDefaultStructors(IOMemoryCursor) + +public: +/*! + @typedef PhysicalSegment + @discussion A physical address/length pair. +*/ + struct PhysicalSegment + { + IOPhysicalAddress location; + IOPhysicalLength length; + }; + +/*! @defined IOPhysicalSegment + @discussion Backward compatibility define for the old non-class scoped type definition. See IOMemoryCursor::PhysicalSegment +*/ +#define IOPhysicalSegment IOMemoryCursor::PhysicalSegment + +/*! + @typedef SegmentFunction + @discussion Pointer to a C function that outputs a single physical segment to an element in the array as defined by the segments and segmentIndex parameters. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + typedef void (*SegmentFunction)(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined OutputSegmentFunc + @discussion Backward compatibility define for the old non-class scoped type definition. See IOMemoryCursor::SegmentFunction */ +#define OutputSegmentFunc IOMemoryCursor::SegmentFunction + +protected: +/*! @var outSeg The action method called when an event has been delivered */ + SegmentFunction outSeg; + +/*! @var maxSegmentSize Maximum size of one segment in a scatter/gather list */ + IOPhysicalLength maxSegmentSize; + +/*! @var maxTransferSize + Maximum size of a transfer that this memory cursor is allowed to generate */ + IOPhysicalLength maxTransferSize; + +/*! @var alignMask + Currently unused. Reserved for automated aligment restriction code. */ + IOPhysicalLength alignMask; + +public: +/*! @function withSpecification + @abstract Creates and initializes an IOMemoryCursor in one operation. + @discussion Factory function to create and initialize an IOMemoryCursor in one operation. For more information, see IOMemoryCursor::initWithSpecification. + @param outSegFunc SegmentFunction to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IOMemoryCursor * + withSpecification(SegmentFunction outSegFunc, + IOPhysicalLength maxSegmentSize = 0, + IOPhysicalLength maxTransferSize = 0, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IOMemoryCursor class. + @param outSegFunc SegmentFunction to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize +successfully. +*/ + virtual bool initWithSpecification(SegmentFunction outSegFunc, + IOPhysicalLength maxSegmentSize = 0, + IOPhysicalLength maxTransferSize = 0, + IOPhysicalLength alignment = 1); + +/*! @function genPhysicalSegments + @abstract Generates a physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Void pointer to base of output physical scatter/gather list. Always passed directly onto the SegmentFunction without interpretation by the cursor. + @param maxSegments Maximum number of segments that can be written to segments array. + @param maxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 genPhysicalSegments( + IOMemoryDescriptor *descriptor, + IOByteCount fromPosition, + void * segments, + UInt32 maxSegments, + UInt32 maxTransferSize = 0, + IOByteCount *transferSize = 0); +}; + +/************************ class IONaturalMemoryCursor ************************/ + + +/*! + @class IONaturalMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the natural byte orientation for the CPU. + @discussion The IONaturalMemoryCursor would be used when it is too difficult to safely describe a SegmentFunction that is more appropriate for your hardware. This cursor just outputs an array of PhysicalSegments. +*/ +class IONaturalMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IONaturalMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outputs the given segment into the output segments array in natural byte order. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined naturalOutputSegment + @discussion Backward compatibility define for the old global function definition. See IONaturalMemoryCursor::outputSegment. +*/ +#define naturalOutputSegment IONaturalMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IONaturalMemoryCursor in one operation. + @discussion Factory function to create and initialize an IONaturalMemoryCursor in one operation. For more information, see IONaturalMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IONaturalMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IONaturalMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a CPU natural physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + @param maxSegments Maximum number of segments that can be written to segments array. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor *descriptor, + IOByteCount fromPosition, + PhysicalSegment *segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount *transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************** class IOBigMemoryCursor **************************/ + +/*! + @class IOBigMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the big endian byte order. + @discussion The IOBigMemoryCursor would be used when the DMA hardware requires a big endian address and length pair. This cursor outputs an array of PhysicalSegments that are encoded in big-endian format. +*/ +class IOBigMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOBigMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outputs the given segment into the output segments array in big endian byte order. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined bigOutputSegment + @discussion Backward compatibility define for the old global function definition. See IOBigMemoryCursor::outputSegment +*/ +#define bigOutputSegment IOBigMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IOBigMemoryCursor in one operation. + @discussion Factory function to create and initialize an IOBigMemoryCursor in one operation. See also IOBigMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IOBigMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IOBigMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize +successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a big endian physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + @param maxSegments Maximum number of segments that can be written to segments array. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + PhysicalSegment * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************* class IOLittleMemoryCursor ************************/ + +/*! + @class IOLittleMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of PhysicalSegments in the little endian byte order. + @discussion The IOLittleMemoryCursor would be used when the DMA hardware requires a little endian address and length pair. This cursor outputs an array of PhysicalSegments that are encoded in little endian format. +*/ +class IOLittleMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOLittleMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outputs the given segment into the output segments array in little endian byte order. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined littleOutputSegment + @discussion Backward compatibility define for the old global function definition. See also IOLittleMemoryCursor::outputSegment. */ +#define littleOutputSegment IOLittleMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IOLittleMemoryCursor in one operation. + @discussion Factory function to create and initialize an IOLittleMemoryCursor in one operation. See also IOLittleMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IOLittleMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IOLittleMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a little endian physical scatter/gather list given a memory descriptor. + @discussion Generates a list of physical segments from the given memory descriptor, relative to the current position of the descriptor. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of IOMemoryCursor::PhysicalSegments for the output physical scatter/gather list. + @param maxSegments Maximum number of segments that can be written to segments array. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + PhysicalSegment * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +/************************* class IODBDMAMemoryCursor *************************/ + +#if defined(__ppc__) + +struct IODBDMADescriptor; + +/*! + @class IODBDMAMemoryCursor + @abstract An IOMemoryCursor subclass that outputs a vector of DBDMA descriptors where the address and length are filled in. + @discussion The IODBDMAMemoryCursor would be used when the DBDMA hardware is available for the device for that will use an instance of this cursor. +*/ +class IODBDMAMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IODBDMAMemoryCursor) + +public: +/*! @function outputSegment + @abstract Outpust the given segment into the output segments array in address and length fields of an DBDMA descriptor. + @param segment The physical address and length that is next to be output. + @param segments Base of the output vector of DMA address length pairs. + @param segmentIndex Index to output 'segment' in the 'segments' array. +*/ + static void outputSegment(PhysicalSegment segment, + void * segments, + UInt32 segmentIndex); + +/*! @defined dbdmaOutputSegment + @discussion Backward compatibility define for the old global function definition. See IODBDMAMemoryCursor::outputSegment. */ +#define dbdmaOutputSegment IODBDMAMemoryCursor::outputSegment + +/*! @function withSpecification + @abstract Creates and initializes an IODBDMAMemoryCursor in one operation. + @discussion Factory function to create and initialize an IODBDMAMemoryCursor in one operation. See also IODBDMAMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns a new memory cursor if successfully created and initialized, 0 otherwise. +*/ + static IODBDMAMemoryCursor * + withSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + +/*! @function initWithSpecification + @abstract Primary initializer for the IODBDMAMemoryCursor class. + @param maxSegmentSize Maximum allowable size for one segment. Defaults to 0. + @param maxTransferSize Maximum size of an entire transfer. Defaults to 0 indicating no maximum. + @param alignment Alignment restrictions on output physical addresses. Not currently implemented. Defaults to single byte alignment. + @result Returns true if the inherited classes and this instance initialize successfully. +*/ + virtual bool initWithSpecification(IOPhysicalLength maxSegmentSize, + IOPhysicalLength maxTransferSize, + IOPhysicalLength alignment = 1); + + +/*! @function getPhysicalSegments + @abstract Generates a DBDMA physical scatter/gather list given a memory descriptor. + @discussion Generates a list of DBDMA descriptors where the address and length fields are filled in appropriately. But the client is expected to fill in the rest of the DBDMA descriptor as is appropriate for their particular hardware. Wraps IOMemoryCursor::genPhysicalSegments. + @param descriptor IOMemoryDescriptor that describes the data associated with an I/O request. + @param fromPosition Starting location of the I/O within a memory descriptor. + @param segments Pointer to an array of DBDMA descriptors for the output physical scatter/gather list. Be warned no room is left for a preamble in the output array. 'segments' should point to the first memory description slot in a DBDMA command. + @param maxSegments Maximum number of segments that can be written to the DBDMA descriptor table. + @param inMaxTransferSize Maximum transfer size is limited to that many bytes, otherwise it defaults to the maximum transfer size specified when the memory cursor was initialized. + @param transferSize Pointer to an IOByteCount variable that can contain the total size of the transfer being described. Defaults to 0 indicating that no transfer size need be returned. + @result If the descriptor is exhausted of memory, a zero is returned, otherwise the number of segments that were filled in is returned. +*/ + virtual UInt32 getPhysicalSegments(IOMemoryDescriptor * descriptor, + IOByteCount fromPosition, + IODBDMADescriptor * segments, + UInt32 maxSegments, + UInt32 inMaxTransferSize = 0, + IOByteCount * transferSize = 0) + { + return genPhysicalSegments(descriptor, fromPosition, segments, + maxSegments, inMaxTransferSize, transferSize); + } +}; + +#endif /* defined(__ppc__) */ + +#endif /* !_IOMEMORYCURSOR_H */ + diff --git a/i386/include/IOKit/IOMemoryDescriptor.h b/i386/include/IOKit/IOMemoryDescriptor.h new file mode 100644 index 0000000..d60d864 --- /dev/null +++ b/i386/include/IOKit/IOMemoryDescriptor.h @@ -0,0 +1,898 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOMEMORYDESCRIPTOR_H +#define _IOMEMORYDESCRIPTOR_H + +#include + +#include +#include +#include + +#include + +class IOMemoryMap; +class IOMapper; + +/* + * Direction of transfer, with respect to the described memory. + */ +#ifdef __LP64__ +enum +#else /* !__LP64__ */ +enum IODirection +#endif /* !__LP64__ */ +{ + kIODirectionNone = 0x0, // same as VM_PROT_NONE + kIODirectionIn = 0x1, // User land 'read', same as VM_PROT_READ + kIODirectionOut = 0x2, // User land 'write', same as VM_PROT_WRITE + kIODirectionOutIn = kIODirectionOut | kIODirectionIn, + kIODirectionInOut = kIODirectionIn | kIODirectionOut +}; +#ifdef __LP64__ +typedef IOOptionBits IODirection; +#endif /* __LP64__ */ + +/* + * IOOptionBits used in the withOptions variant + */ +enum { + kIOMemoryDirectionMask = 0x00000007, + + kIOMemoryTypeVirtual = 0x00000010, + kIOMemoryTypePhysical = 0x00000020, + kIOMemoryTypeUPL = 0x00000030, + kIOMemoryTypePersistentMD = 0x00000040, // Persistent Memory Descriptor + kIOMemoryTypeUIO = 0x00000050, +#ifdef __LP64__ + kIOMemoryTypeVirtual64 = kIOMemoryTypeVirtual, + kIOMemoryTypePhysical64 = kIOMemoryTypePhysical, +#else /* !__LP64__ */ + kIOMemoryTypeVirtual64 = 0x00000060, + kIOMemoryTypePhysical64 = 0x00000070, +#endif /* !__LP64__ */ + kIOMemoryTypeMask = 0x000000f0, + + kIOMemoryAsReference = 0x00000100, + kIOMemoryBufferPageable = 0x00000400, + kIOMemoryMapperNone = 0x00000800, + kIOMemoryPersistent = 0x00010000, + kIOMemoryThreadSafe = 0x00100000, // Shared with Buffer MD +}; + +#define kIOMapperSystem ((IOMapper *) 0) + +enum +{ + kIOMemoryPurgeableKeepCurrent = 1, + kIOMemoryPurgeableNonVolatile = 2, + kIOMemoryPurgeableVolatile = 3, + kIOMemoryPurgeableEmpty = 4 +}; +enum +{ + kIOMemoryIncoherentIOFlush = 1, + kIOMemoryIncoherentIOStore = 2, +}; + +#define IOMEMORYDESCRIPTOR_SUPPORTS_DMACOMMAND 1 + +enum +{ + kIOPreparationIDUnprepared = 0, + kIOPreparationIDUnsupported = 1, + kIOPreparationIDAlwaysPrepared = 2, +}; + +/*! @class IOMemoryDescriptor : public OSObject + @abstract An abstract base class defining common methods for describing physical or virtual memory. + @discussion The IOMemoryDescriptor object represents a buffer or range of memory, specified as one or more physical or virtual address ranges. It contains methods to return the memory's physically contiguous segments (fragments), for use with the IOMemoryCursor, and methods to map the memory into any address space with caching and placed mapping options. */ + +class IOMemoryDescriptor : public OSObject +{ + friend class IOMemoryMap; + + OSDeclareDefaultStructors(IOMemoryDescriptor); + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { + void * devicePager; + unsigned int pagerContig:1; + unsigned int unused:31; + IOMemoryDescriptor * memory; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +protected: + OSSet * _mappings; + IOOptionBits _flags; + void * _memEntry; + +#ifdef __LP64__ + uint64_t __iomd_reserved1; + uint64_t __iomd_reserved2; + uint64_t __iomd_reserved3; + uint64_t __iomd_reserved4; +#else /* !__LP64__ */ + IODirection _direction; /* use _flags instead */ +#endif /* !__LP64__ */ + IOByteCount _length; /* length of all ranges */ + IOOptionBits _tag; + +public: +typedef IOOptionBits DMACommandOps; +#ifndef __LP64__ + virtual IOPhysicalAddress getSourceSegment( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + +/*! @function initWithOptions + @abstract Master initialiser for all variants of memory descriptors. For a more complete description see IOMemoryDescriptor::withOptions. + @discussion Note this function can be used to re-init a previously created memory descriptor. + @result true on success, false on failure. */ + virtual bool initWithOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + virtual addr64_t getPhysicalSegment64( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; /* use getPhysicalSegment() and kIOMemoryMapperNone instead */ +#endif /* !__LP64__ */ + +/*! @function setPurgeable + @abstract Control the purgeable status of a memory descriptors memory. + @discussion Buffers may be allocated with the ability to have their purgeable status changed - IOBufferMemoryDescriptor with the kIOMemoryPurgeable option, VM_FLAGS_PURGEABLE may be passed to vm_allocate() in user space to allocate such buffers. The purgeable status of such a buffer may be controlled with setPurgeable(). The process of making a purgeable memory descriptor non-volatile and determining its previous state is atomic - if a purgeable memory descriptor is made nonvolatile and the old state is returned as kIOMemoryPurgeableVolatile, then the memory's previous contents are completely intact and will remain so until the memory is made volatile again. If the old state is returned as kIOMemoryPurgeableEmpty then the memory was reclaimed while it was in a volatile state and its previous contents have been lost. + @param newState - the desired new purgeable state of the memory:
+ kIOMemoryPurgeableKeepCurrent - make no changes to the memory's purgeable state.
+ kIOMemoryPurgeableVolatile - make the memory volatile - the memory may be reclaimed by the VM system without saving its contents to backing store.
+ kIOMemoryPurgeableNonVolatile - make the memory nonvolatile - the memory is treated as with usual allocations and must be saved to backing store if paged.
+ kIOMemoryPurgeableEmpty - make the memory volatile, and discard any pages allocated to it. + @param oldState - if non-NULL, the previous purgeable state of the memory is returned here:
+ kIOMemoryPurgeableNonVolatile - the memory was nonvolatile.
+ kIOMemoryPurgeableVolatile - the memory was volatile but its content has not been discarded by the VM system.
+ kIOMemoryPurgeableEmpty - the memory was volatile and has been discarded by the VM system.
+ @result An IOReturn code. */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + +/*! @function performOperation + @abstract Perform an operation on the memory descriptor's memory. + @discussion This method performs some operation on a range of the memory descriptor's memory. When a memory descriptor's memory is not mapped, it should be more efficient to use this method than mapping the memory to perform the operation virtually. + @param options The operation to perform on the memory:
+ kIOMemoryIncoherentIOFlush - pass this option to store to memory and flush any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared.
+ kIOMemoryIncoherentIOStore - pass this option to store to memory any data in the processor cache for the memory range, with synchronization to ensure the data has passed through all levels of processor cache. It may not be supported on all architectures. This type of flush may be used for non-coherent I/O such as AGP - it is NOT required for PCI coherent operations. The memory descriptor must have been previously prepared. + @param offset A byte offset into the memory descriptor's memory. + @param length The length of the data range. + @result An IOReturn code. */ + + virtual IOReturn performOperation( IOOptionBits options, + IOByteCount offset, IOByteCount length ); + + // Used for dedicated communications for IODMACommand + virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const; + +/*! @function getPhysicalSegment + @abstract Break a memory descriptor into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + @param offset A byte offset into the memory whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the memory. */ + +#ifdef __LP64__ + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ) = 0; +#else /* !__LP64__ */ + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options ); +#endif /* !__LP64__ */ + + virtual uint64_t getPreparationID( void ); + +private: + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 0); +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 1); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 7); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 1); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 2); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 3); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 4); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 5); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 6); + OSMetaClassDeclareReservedUsed(IOMemoryDescriptor, 7); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 8); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 9); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 10); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 11); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 12); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 13); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 14); + OSMetaClassDeclareReservedUnused(IOMemoryDescriptor, 15); + +protected: + virtual void free(); +public: + static void initialize( void ); + +public: +/*! @function withAddress + @abstract Create an IOMemoryDescriptor to describe one virtual range of the kernel task. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single virtual memory range mapped into the kernel map. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + @param address The virtual address of the first byte in the memory. + @param withLength The length of memory. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddress(void * address, + IOByteCount withLength, + IODirection withDirection); + +#ifndef __LP64__ + static IOMemoryDescriptor * withAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; /* use withAddressRange() and prepare() instead */ +#endif /* !__LP64__ */ + +/*! @function withPhysicalAddress + @abstract Create an IOMemoryDescriptor to describe one physical range. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single physical memory range. + @param address The physical address of the first byte in the memory. + @param withLength The length of memory. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ); + +#ifndef __LP64__ + static IOMemoryDescriptor * withRanges(IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use withAddressRanges() instead */ +#endif /* !__LP64__ */ + +/*! @function withAddressRange + @abstract Create an IOMemoryDescriptor to describe one virtual range of the specified map. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a single virtual memory range mapped into the specified map. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + @param address The virtual address of the first byte in the memory. + @param withLength The length of memory. + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @param task The task the virtual ranges are mapped into. Note that unlike IOMemoryDescriptor::withAddress(), kernel_task memory must be explicitly prepared when passed to this api. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddressRange( + mach_vm_address_t address, + mach_vm_size_t length, + IOOptionBits options, + task_t task); + +/*! @function withAddressRanges + @abstract Create an IOMemoryDescriptor to describe one or more virtual ranges. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of an array of virtual memory ranges each mapped into a specified source task. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + @param ranges An array of IOAddressRange structures which specify the virtual ranges in the specified map which make up the memory to be described. IOAddressRange is the 64bit version of IOVirtualRange. + @param rangeCount The member count of the ranges array. + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + kIOMemoryAsReference For options:type = Virtual or Physical this indicate that the memory descriptor need not copy the ranges array into local memory. This is an optimisation to try to minimise unnecessary allocations. + @param task The task each of the virtual ranges are mapped into. Note that unlike IOMemoryDescriptor::withAddress(), kernel_task memory must be explicitly prepared when passed to this api. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor * withAddressRanges( + IOAddressRange * ranges, + UInt32 rangeCount, + IOOptionBits options, + task_t task); + +/*! @function withOptions + @abstract Master initialiser for all variants of memory descriptors. + @discussion This method creates and initializes an IOMemoryDescriptor for memory it has three main variants: Virtual, Physical & mach UPL. These variants are selected with the options parameter, see below. This memory descriptor needs to be prepared before it can be used to extract data from the memory described. + + + @param buffers A pointer to an array of IOAddressRange when options:type is kIOMemoryTypeVirtual64 or kIOMemoryTypePhysical64 or a 64bit kernel. For type UPL it is a upl_t returned by the mach/memory_object_types.h apis, primarily used internally by the UBC. IOVirtualRanges or IOPhysicalRanges are 32 bit only types for use when options:type is kIOMemoryTypeVirtual or kIOMemoryTypePhysical on 32bit kernels. + + @param count options:type = Virtual or Physical count contains a count of the number of entires in the buffers array. For options:type = UPL this field contains a total length. + + @param offset Only used when options:type = UPL, in which case this field contains an offset for the memory within the buffers upl. + + @param task Only used options:type = Virtual, The task each of the virtual ranges are mapped into. + + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + kIOMemoryTypeMask (options:type) kIOMemoryTypeVirtual64, kIOMemoryTypeVirtual, kIOMemoryTypePhysical64, kIOMemoryTypePhysical, kIOMemoryTypeUPL Indicates that what type of memory basic memory descriptor to use. This sub-field also controls the interpretation of the buffers, count, offset & task parameters. + kIOMemoryAsReference For options:type = Virtual or Physical this indicate that the memory descriptor need not copy the ranges array into local memory. This is an optimisation to try to minimise unnecessary allocations. + kIOMemoryBufferPageable Only used by the IOBufferMemoryDescriptor as an indication that the kernel virtual memory is in fact pageable and we need to use the kernel pageable submap rather than the default map. + + @param mapper Which IOMapper should be used to map the in-memory physical addresses into I/O space addresses. Defaults to 0 which indicates that the system mapper is to be used, if present. + + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMemoryDescriptor *withOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + static IOMemoryDescriptor * withPhysicalRanges( + IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use withOptions() and kIOMemoryTypePhysical instead */ +#endif /* !__LP64__ */ + +#ifndef __LP64__ + static IOMemoryDescriptor * withSubRange(IOMemoryDescriptor *of, + IOByteCount offset, + IOByteCount length, + IODirection withDirection) APPLE_KEXT_DEPRECATED; /* use IOSubMemoryDescriptor::withSubRange() and kIOMemoryThreadSafe instead */ +#endif /* !__LP64__ */ + +/*! @function withPersistentMemoryDescriptor + @abstract Copy constructor that generates a new memory descriptor if the backing memory for the same task's virtual address and length has changed. + @discussion If the original memory descriptor's address and length is still backed by the same real memory, i.e. the user hasn't deallocated and the reallocated memory at the same address then the original memory descriptor is returned with a additional reference. Otherwise we build a totally new memory descriptor with the same characteristics as the previous one but with a new view of the vm. Note not legal to call this function with anything except an IOGeneralMemoryDescriptor that was created with the kIOMemoryPersistent option. + @param originalMD The memory descriptor to be duplicated. + @result Either the original memory descriptor with an additional retain or a new memory descriptor, 0 for a bad original memory descriptor or some other resource shortage. */ + static IOMemoryDescriptor * + withPersistentMemoryDescriptor(IOMemoryDescriptor *originalMD); + +#ifndef __LP64__ + // obsolete initializers + // - initWithOptions is the designated initializer + virtual bool initWithAddress(void * address, + IOByteCount withLength, + IODirection withDirection) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithRanges(IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; /* use initWithOptions() instead */ +#endif /* __LP64__ */ + +/*! @function getDirection + @abstract Accessor to get the direction the memory descriptor was created with. + @discussion This method returns the direction the memory descriptor was created with. + @result The direction. */ + + virtual IODirection getDirection() const; + +/*! @function getLength + @abstract Accessor to get the length of the memory descriptor (over all its ranges). + @discussion This method returns the total length of the memory described by the descriptor, ie. the sum of its ranges' lengths. + @result The byte count. */ + + virtual IOByteCount getLength() const; + +/*! @function setTag + @abstract Set the tag for the memory descriptor. + @discussion This method sets the tag for the memory descriptor. Tag bits are not interpreted by IOMemoryDescriptor. + @param tag The tag. */ + + virtual void setTag( IOOptionBits tag ); + +/*! @function getTag + @abstract Accessor to the retrieve the tag for the memory descriptor. + @discussion This method returns the tag for the memory descriptor. Tag bits are not interpreted by IOMemoryDescriptor. + @result The tag. */ + + virtual IOOptionBits getTag( void ); + +/*! @function readBytes + @abstract Copy data from the memory descriptor's buffer to the specified buffer. + @discussion This method copies data from the memory descriptor's memory at the given offset, to the caller's buffer. The memory descriptor MUST have the kIODirectionOut direcction bit set and be prepared. kIODirectionOut means that this memory descriptor will be output to an external device, so readBytes is used to get memory into a local buffer for a PIO transfer to the device. + @param offset A byte offset into the memory descriptor's memory. + @param bytes The caller supplied buffer to copy the data to. + @param withLength The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the length of the descriptor. Development/debug kernel builds will assert if the offset is beyond the length of the descriptor. */ + + virtual IOByteCount readBytes(IOByteCount offset, + void * bytes, IOByteCount withLength); + +/*! @function writeBytes + @abstract Copy data to the memory descriptor's buffer from the specified buffer. + @discussion This method copies data to the memory descriptor's memory at the given offset, from the caller's buffer. The memory descriptor MUST have the kIODirectionIn direcction bit set and be prepared. kIODirectionIn means that this memory descriptor will be input from an external device, so writeBytes is used to write memory into the descriptor for PIO drivers. + @param offset A byte offset into the memory descriptor's memory. + @param bytes The caller supplied buffer to copy the data from. + @param withLength The length of the data to copy. + @result The number of bytes copied, zero will be returned if the specified offset is beyond the length of the descriptor. Development/debug kernel builds will assert if the offset is beyond the length of the descriptor. */ + + virtual IOByteCount writeBytes(IOByteCount offset, + const void * bytes, IOByteCount withLength); + +#ifndef __LP64__ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); +#endif /* !__LP64__ */ + +/*! @function getPhysicalAddress + @abstract Return the physical address of the first byte in the memory. + @discussion This method returns the physical address of the first byte in the memory. It is most useful on memory known to be physically contiguous. + @result A physical address. */ + + IOPhysicalAddress getPhysicalAddress(); + +#ifndef __LP64__ + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; /* use map() and getVirtualAddress() instead */ +#endif /* !__LP64__ */ + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. Note that the prepare call is not thread safe and it is expected that the client will more easily be able to guarantee single threading a particular memory descriptor. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone) = 0; + +/*! @function complete + @abstract Complete processing of the memory after an I/O transfer finishes. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. In 10.3 or greater systems the direction argument to complete is not longer respected. The direction is totally determined at prepare() time. + @param forDirection DEPRECATED The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone) = 0; + + /* + * Mapping functions. + */ + +/*! @function createMappingInTask + @abstract Maps a IOMemoryDescriptor into a task. + @discussion This is the general purpose method to map all or part of the memory described by a memory descriptor into a task at any available address, or at a fixed address if possible. Caching & read-only options may be set for the mapping. The mapping is represented as a returned reference to a IOMemoryMap object, which may be shared if the mapping is compatible with an existing mapping of the IOMemoryDescriptor. The IOMemoryMap object returned should be released only when the caller has finished accessing the mapping, as freeing the object destroys the mapping. + @param intoTask Sets the target task for the mapping. Pass kernel_task for the kernel address space. + @param atAddress If a placed mapping is requested, atAddress specifies its address, and the kIOMapAnywhere should not be set. Otherwise, atAddress is ignored. + @param options Mapping options are defined in IOTypes.h,
+ kIOMapAnywhere should be passed if the mapping can be created anywhere. If not set, the atAddress parameter sets the location of the mapping, if it is available in the target map.
+ kIOMapDefaultCache to inhibit the cache in I/O areas, kIOMapCopybackCache in general purpose RAM.
+ kIOMapInhibitCache, kIOMapWriteThruCache, kIOMapCopybackCache to set the appropriate caching.
+ kIOMapReadOnly to allow only read only accesses to the memory - writes will cause and access fault.
+ kIOMapReference will only succeed if the mapping already exists, and the IOMemoryMap object is just an extra reference, ie. no new mapping will be created.
+ kIOMapUnique allows a special kind of mapping to be created that may be used with the IOMemoryMap::redirect() API. These mappings will not be shared as is the default - there will always be a unique mapping created for the caller, not an existing mapping with an extra reference.
+ @param offset Is a beginning offset into the IOMemoryDescriptor's memory where the mapping starts. Zero is the default to map all the memory. + @param length Is the length of the mapping requested for a subset of the IOMemoryDescriptor. Zero is the default to map all the memory. + @result A reference to an IOMemoryMap object representing the mapping, which can supply the virtual address of the mapping and other information. The mapping may be shared with multiple callers - multiple maps are avoided if a compatible one exists. The IOMemoryMap object returned should be released only when the caller has finished accessing the mapping, as freeing the object destroys the mapping. The IOMemoryMap instance also retains the IOMemoryDescriptor it maps while it exists. */ + + IOMemoryMap * createMappingInTask( + task_t intoTask, + mach_vm_address_t atAddress, + IOOptionBits options, + mach_vm_size_t offset = 0, + mach_vm_size_t length = 0 ); + +#ifndef __LP64__ + virtual IOMemoryMap * map( + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset = 0, + IOByteCount length = 0 ) APPLE_KEXT_DEPRECATED; /* use createMappingInTask() instead */ +#endif /* !__LP64__ */ + +/*! @function map + @abstract Maps a IOMemoryDescriptor into the kernel map. + @discussion This is a shortcut method to map all the memory described by a memory descriptor into the kernel map at any available address. See the full version of the createMappingInTask method for further details. + @param options Mapping options as in the full version of the createMappingInTask method, with kIOMapAnywhere assumed. + @result See the full version of the createMappingInTask method. */ + + virtual IOMemoryMap * map( + IOOptionBits options = 0 ); + +/*! @function setMapping + @abstract Establishes an already existing mapping. + @discussion This method tells the IOMemoryDescriptor about a mapping that exists, but was created elsewhere. It allows later callers of the map method to share this externally created mapping. The IOMemoryMap object returned is created to represent it. This method is not commonly needed. + @param task Address space in which the mapping exists. + @param mapAddress Virtual address of the mapping. + @param options Caching and read-only attributes of the mapping. + @result A IOMemoryMap object created to represent the mapping. */ + + virtual IOMemoryMap * setMapping( + task_t task, + IOVirtualAddress mapAddress, + IOOptionBits options = 0 ); + + // Following methods are private implementation + +#ifdef __LP64__ + virtual +#endif /* __LP64__ */ + IOReturn redirect( task_t safeTask, bool redirect ); + + IOReturn handleFault( + void * pager, + vm_map_t addressMap, + mach_vm_address_t address, + mach_vm_size_t sourceOffset, + mach_vm_size_t length, + IOOptionBits options ); + + virtual IOMemoryMap * makeMapping( + IOMemoryDescriptor * owner, + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset, + IOByteCount length ); + +protected: + virtual void addMapping( + IOMemoryMap * mapping ); + + virtual void removeMapping( + IOMemoryMap * mapping ); + + virtual IOReturn doMap( + vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ); + + virtual IOReturn doUnmap( + vm_map_t addressMap, + IOVirtualAddress logical, + IOByteCount length ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IOMemoryMap : public OSObject + @abstract A class defining common methods for describing a memory mapping. + @discussion The IOMemoryMap object represents a mapped range of memory, described by a IOMemoryDescriptor. The mapping may be in the kernel or a non-kernel task and has processor cache mode attributes. IOMemoryMap instances are created by IOMemoryDescriptor when it creates mappings in its map method, and returned to the caller. */ + +class IOMemoryMap : public OSObject +{ + OSDeclareDefaultStructors(IOMemoryMap) + +protected: + virtual void taggedRelease(const void *tag = 0) const; + virtual void free(); + +public: +/*! @function getVirtualAddress + @abstract Accessor to the virtual address of the first byte in the mapping. + @discussion This method returns the virtual address of the first byte in the mapping. + @result A virtual address. */ + + virtual IOVirtualAddress getVirtualAddress(); + +/*! @function getPhysicalSegment + @abstract Break a mapping into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the mapping, and optionally the length of the physically contiguous segment from that offset. It functions similarly to IOMemoryDescriptor::getPhysicalSegment. + @param offset A byte offset into the mapping whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the mapping. */ + +#ifdef __LP64__ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0); +#else /* !__LP64__ */ + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); +#endif /* !__LP64__ */ + +/*! @function getPhysicalAddress + @abstract Return the physical address of the first byte in the mapping. + @discussion This method returns the physical address of the first byte in the mapping. It is most useful on mappings known to be physically contiguous. + @result A physical address. */ + + IOPhysicalAddress getPhysicalAddress(); + +/*! @function getLength + @abstract Accessor to the length of the mapping. + @discussion This method returns the length of the mapping. + @result A byte count. */ + + virtual IOByteCount getLength(); + +/*! @function getAddressTask + @abstract Accessor to the task of the mapping. + @discussion This method returns the mach task the mapping exists in. + @result A mach task_t. */ + + virtual task_t getAddressTask(); + +/*! @function getMemoryDescriptor + @abstract Accessor to the IOMemoryDescriptor the mapping was created from. + @discussion This method returns the IOMemoryDescriptor the mapping was created from. + @result An IOMemoryDescriptor reference, which is valid while the IOMemoryMap object is retained. It should not be released by the caller. */ + + virtual IOMemoryDescriptor * getMemoryDescriptor(); + +/*! @function getMapOptions + @abstract Accessor to the options the mapping was created with. + @discussion This method returns the options to IOMemoryDescriptor::map the mapping was created with. + @result Options for the mapping, including cache settings. */ + + virtual IOOptionBits getMapOptions(); + +/*! @function unmap + @abstract Force the IOMemoryMap to unmap, without destroying the object. + @discussion IOMemoryMap instances will unmap themselves upon free, ie. when the last client with a reference calls release. This method forces the IOMemoryMap to destroy the mapping it represents, regardless of the number of clients. It is not generally used. + @result An IOReturn code. */ + + virtual IOReturn unmap(); + + virtual void taskDied(); + +/*! @function redirect + @abstract Replace the memory mapped in a process with new backing memory. + @discussion An IOMemoryMap created with the kIOMapUnique option to IOMemoryDescriptor::map() can remapped to a new IOMemoryDescriptor backing object. If the new IOMemoryDescriptor is specified as NULL, client access to the memory map is blocked until a new backing object has been set. By blocking access and copying data, the caller can create atomic copies of the memory while the client is potentially reading or writing the memory. + @param newBackingMemory The IOMemoryDescriptor that represents the physical memory that is to be now mapped in the virtual range the IOMemoryMap represents. If newBackingMemory is NULL, any access to the mapping will hang (in vm_fault()) until access has been restored by a new call to redirect() with non-NULL newBackingMemory argument. + @param options Mapping options are defined in IOTypes.h, and are documented in IOMemoryDescriptor::map() + @param offset As with IOMemoryDescriptor::map(), a beginning offset into the IOMemoryDescriptor's memory where the mapping starts. Zero is the default. + @result An IOReturn code. */ + +#ifndef __LP64__ +// For 32 bit XNU, there is a 32 bit (IOByteCount) and a 64 bit (mach_vm_size_t) interface; +// for 64 bit, these fall together on the 64 bit one. + virtual IOReturn redirect(IOMemoryDescriptor * newBackingMemory, + IOOptionBits options, + IOByteCount offset = 0); +#endif + virtual IOReturn redirect(IOMemoryDescriptor * newBackingMemory, + IOOptionBits options, + mach_vm_size_t offset = 0); + +#ifdef __LP64__ + inline mach_vm_address_t getAddress() __attribute__((always_inline)); + inline mach_vm_size_t getSize() __attribute__((always_inline)); +#else /* !__LP64__ */ + virtual mach_vm_address_t getAddress(); + virtual mach_vm_size_t getSize(); +#endif /* !__LP64__ */ + + + OSMetaClassDeclareReservedUnused(IOMemoryMap, 0); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 1); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 2); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 3); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 4); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 5); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 6); + OSMetaClassDeclareReservedUnused(IOMemoryMap, 7); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !defined(__LP64) || defined(_IOMEMORYDESCRIPTOR_INTERNAL_) + +// The following classes are private implementation of IOMemoryDescriptor - they +// should not be referenced directly, just through the public API's in the +// IOMemoryDescriptor class. For example, an IOGeneralMemoryDescriptor instance +// might be created by IOMemoryDescriptor::withAddressRange(), but there should be +// no need to reference as anything but a generic IOMemoryDescriptor *. + +class IOGeneralMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOGeneralMemoryDescriptor); + +public: + union Ranges { + IOVirtualRange *v; + IOAddressRange *v64; + IOPhysicalRange *p; + void *uio; + }; +protected: + Ranges _ranges; + unsigned _rangesCount; /* number of address ranges in list */ +#ifndef __LP64__ + bool _rangesIsAllocated; /* is list allocated by us? */ +#endif /* !__LP64__ */ + + task_t _task; /* task where all ranges are mapped to */ + + union { + IOVirtualRange v; + IOPhysicalRange p; + } _singleRange; /* storage space for a single range */ + + unsigned _wireCount; /* number of outstanding wires */ + +#ifndef __LP64__ + uintptr_t _cachedVirtualAddress; + + IOPhysicalAddress _cachedPhysicalAddress; +#endif /* !__LP64__ */ + + bool _initialized; /* has superclass been initialized? */ + +public: + virtual void free(); + + virtual IOReturn dmaCommandOperation(DMACommandOps op, void *vData, UInt dataSize) const; + + virtual uint64_t getPreparationID( void ); + +private: + +#ifndef __LP64__ + virtual void setPosition(IOByteCount position); + virtual void mapIntoKernel(unsigned rangeIndex); + virtual void unmapFromKernel(); +#endif /* !__LP64__ */ + + // Internal APIs may be made virtual at some time in the future. + IOReturn wireVirtual(IODirection forDirection); + void *createNamedEntry(); + + // Internal + OSData * _memoryEntries; + unsigned int _pages; + ppnum_t _highestPage; + uint32_t __iomd_reservedA; + uint32_t __iomd_reservedB; + + IOLock * _prepareLock; + +public: + /* + * IOMemoryDescriptor required methods + */ + + // Master initaliser + virtual bool initWithOptions(void * buffers, + UInt32 count, + UInt32 offset, + task_t task, + IOOptionBits options, + IOMapper * mapper = kIOMapperSystem); + +#ifndef __LP64__ + // Secondary initialisers + virtual bool initWithAddress(void * address, + IOByteCount withLength, + IODirection withDirection) APPLE_KEXT_DEPRECATED; + + virtual bool initWithAddress(IOVirtualAddress address, + IOByteCount withLength, + IODirection withDirection, + task_t withTask) APPLE_KEXT_DEPRECATED; + + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, + IOByteCount withLength, + IODirection withDirection ) APPLE_KEXT_DEPRECATED; + + virtual bool initWithRanges( IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false) APPLE_KEXT_DEPRECATED; + + virtual bool initWithPhysicalRanges(IOPhysicalRange * ranges, + UInt32 withCount, + IODirection withDirection, + bool asReference = false) APPLE_KEXT_DEPRECATED; + + virtual addr64_t getPhysicalSegment64( IOByteCount offset, + IOByteCount * length ) APPLE_KEXT_DEPRECATED; + + virtual IOPhysicalAddress getPhysicalSegment(IOByteCount offset, + IOByteCount * length); + + virtual IOPhysicalAddress getSourceSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; + + virtual void * getVirtualSegment(IOByteCount offset, + IOByteCount * length) APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, +#ifdef __LP64__ + IOOptionBits options = 0 ); +#else /* !__LP64__ */ + IOOptionBits options ); +#endif /* !__LP64__ */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); + + virtual IOReturn doMap( + vm_map_t addressMap, + IOVirtualAddress * atAddress, + IOOptionBits options, + IOByteCount sourceOffset = 0, + IOByteCount length = 0 ); + + virtual IOReturn doUnmap( + vm_map_t addressMap, + IOVirtualAddress logical, + IOByteCount length ); + + virtual bool serialize(OSSerialize *s) const; + + // Factory method for cloning a persistent IOMD, see IOMemoryDescriptor + static IOMemoryDescriptor * + withPersistentMemoryDescriptor(IOGeneralMemoryDescriptor *originalMD); + +}; + +#endif /* !defined(__LP64) || defined(_IOMEMORYDESCRIPTOR_INTERNAL_) */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifdef __LP64__ +mach_vm_address_t IOMemoryMap::getAddress() +{ + return (getVirtualAddress()); +} + +mach_vm_size_t IOMemoryMap::getSize() +{ + return (getLength()); +} +#else /* !__LP64__ */ +#include +#endif /* !__LP64__ */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* !_IOMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/IOMessage.h b/i386/include/IOKit/IOMessage.h new file mode 100644 index 0000000..3ca9e1e --- /dev/null +++ b/i386/include/IOKit/IOMessage.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOMESSAGE_H +#define __IOKIT_IOMESSAGE_H + +#include +#include + +typedef UInt32 IOMessage; + +#define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message) +#define iokit_family_msg(sub,message) (UInt32)(sys_iokit|sub|message) + +/*! @defined iokit_vendor_specific_msg + @discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific + subsystem. It can be used to be generate messages that are used for private + communication between vendor specific code with the IOService::message() etc. APIs. +*/ +#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message) + +#define kIOMessageServiceIsTerminated iokit_common_msg(0x010) +#define kIOMessageServiceIsSuspended iokit_common_msg(0x020) +#define kIOMessageServiceIsResumed iokit_common_msg(0x030) + +#define kIOMessageServiceIsRequestingClose iokit_common_msg(0x100) +#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) +#define kIOMessageServiceWasClosed iokit_common_msg(0x110) + +#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) + +#define kIOMessageServicePropertyChange iokit_common_msg(0x130) + +#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200) +#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) +#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) +#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) +#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240) +#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) +#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) +#define kIOMessageCanSystemSleep iokit_common_msg(0x270) +#define kIOMessageSystemWillSleep iokit_common_msg(0x280) +#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) +#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) +#define kIOMessageSystemWillRestart iokit_common_msg(0x310) +#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) + +#define kIOMessageCopyClientID iokit_common_msg(0x330) + +#endif /* ! __IOKIT_IOMESSAGE_H */ diff --git a/i386/include/IOKit/IOMultiMemoryDescriptor.h b/i386/include/IOKit/IOMultiMemoryDescriptor.h new file mode 100644 index 0000000..42b19a4 --- /dev/null +++ b/i386/include/IOKit/IOMultiMemoryDescriptor.h @@ -0,0 +1,110 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOMULTIMEMORYDESCRIPTOR_H +#define _IOMULTIMEMORYDESCRIPTOR_H + +#include + +/*! @class IOMultiMemoryDescriptor : public IOMemoryDescriptor + @abstract The IOMultiMemoryDescriptor object describes a memory area made up of several other IOMemoryDescriptors. + @discussion The IOMultiMemoryDescriptor object represents multiple ranges of memory, specified as an ordered list of IOMemoryDescriptors. The descriptors are chained end-to-end to make up a single contiguous buffer. */ + +class IOMultiMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOMultiMemoryDescriptor); + +protected: + + IOMemoryDescriptor ** _descriptors; + UInt32 _descriptorsCount; + bool _descriptorsIsAllocated; + + virtual void free(); + +public: + +/*! @function withDescriptors + @abstract Create an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method creates and initializes an IOMultiMemoryDescriptor for memory consisting of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. Passing the descriptor array as a reference will avoid an extra allocation. + @param descriptors An array of IOMemoryDescriptors which make up the memory to be described. + @param withCount The object count for the descriptors array. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @param asReference If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation. + @result The created IOMultiMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOMultiMemoryDescriptor * withDescriptors( + IOMemoryDescriptor ** descriptors, + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + +/*! @function withDescriptors + @abstract Initialize an IOMultiMemoryDescriptor to describe a memory area made up of several other IOMemoryDescriptors. + @discussion This method initializes an IOMultiMemoryDescriptor for memory consisting of a number of other IOMemoryDescriptors, chained end-to-end (in the order they appear in the array) to represent a single contiguous memory buffer. Passing the descriptor array as a reference will avoid an extra allocation. + @param descriptors An array of IOMemoryDescriptors which make up the memory to be described. + @param withCount The object count for the descriptors array. + @param withDirection An I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @param asReference If false, the IOMultiMemoryDescriptor object will make a copy of the descriptors array, otherwise, the array will be used in situ, avoiding an extra allocation. + @result The created IOMultiMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + virtual bool initWithDescriptors( + IOMemoryDescriptor ** descriptors, + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + +/*! @function getPhysicalSegment + @abstract Break a memory descriptor into its physically contiguous segments. + @discussion This method returns the physical address of the byte at the given offset into the memory, and optionally the length of the physically contiguous segment from that offset. + @param offset A byte offset into the memory whose physical address to return. + @param length If non-zero, getPhysicalSegment will store here the length of the physically contiguous segement at the given offset. + @result A physical address, or zero if the offset is beyond the length of the memory. */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ); + +/*! @function prepare + @abstract Prepare the memory for an I/O transfer. + @discussion This involves paging in the memory, if necessary, and wiring it down for the duration of the transfer. The complete() method completes the processing of the memory after the I/O transfer finishes. This method needn't called for non-pageable memory. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + +/*! @function complete + @abstract Complete processing of the memory after an I/O transfer finishes. + @discussion This method should not be called unless a prepare was previously issued; the prepare() and complete() must occur in pairs, before and after an I/O transfer involving pageable memory. + @param forDirection The direction of the I/O just completed, or kIODirectionNone for the direction specified by the memory descriptor. + @result An IOReturn code. */ + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); +}; + +#endif /* !_IOMULTIMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/IONVRAM.h b/i386/include/IOKit/IONVRAM.h new file mode 100644 index 0000000..a9337bd --- /dev/null +++ b/i386/include/IOKit/IONVRAM.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IONVRAM_H +#define _IOKIT_IONVRAM_H + +#include +#include +#include +#include + + +#define kIODTNVRAMOFPartitionName "common" +#define kIODTNVRAMXPRAMPartitionName "APL,MacOS75" +#define kIODTNVRAMPanicInfoPartitonName "APL,OSXPanic" +#define kIODTNVRAMFreePartitionName "wwwwwwwwwwww" + +enum { + kIODTNVRAMImageSize = 0x2000, + kIODTNVRAMXPRAMSize = 0x0100, + kIODTNVRAMNameRegistrySize = 0x0400 +}; + +enum { + kOFVariableTypeBoolean = 1, + kOFVariableTypeNumber, + kOFVariableTypeString, + kOFVariableTypeData +}; + +enum { + kOFVariablePermRootOnly = 0, + kOFVariablePermUserRead, + kOFVariablePermUserWrite, + kOFVariablePermKernelOnly +}; + +class IODTNVRAM : public IOService +{ + OSDeclareDefaultStructors(IODTNVRAM); + +private: + IONVRAMController *_nvramController; + const OSSymbol *_registryPropertiesKey; + UInt8 *_nvramImage; + bool _nvramImageDirty; + UInt32 _ofPartitionOffset; + UInt32 _ofPartitionSize; + UInt8 *_ofImage; + bool _ofImageDirty; + OSDictionary *_ofDict; + OSDictionary *_nvramPartitionOffsets; + OSDictionary *_nvramPartitionLengths; + UInt32 _xpramPartitionOffset; + UInt32 _xpramPartitionSize; + UInt8 *_xpramImage; + UInt32 _nrPartitionOffset; + UInt32 _nrPartitionSize; + UInt8 *_nrImage; + UInt32 _piPartitionOffset; + UInt32 _piPartitionSize; + UInt8 *_piImage; + bool _systemPaniced; + + virtual UInt8 calculatePartitionChecksum(UInt8 *partitionHeader); + virtual IOReturn initOFVariables(void); +public: + virtual IOReturn syncOFVariables(void); +private: + virtual UInt32 getOFVariableType(const OSSymbol *propSymbol) const; + virtual UInt32 getOFVariablePerm(const OSSymbol *propSymbol) const; + virtual bool getOWVariableInfo(UInt32 variableNumber, const OSSymbol **propSymbol, + UInt32 *propType, UInt32 *propOffset); + virtual bool convertPropToObject(UInt8 *propName, UInt32 propNameLength, + UInt8 *propData, UInt32 propDataLength, + const OSSymbol **propSymbol, + OSObject **propObject); + virtual bool convertObjectToProp(UInt8 *buffer, UInt32 *length, + const OSSymbol *propSymbol, OSObject *propObject); + virtual UInt16 generateOWChecksum(UInt8 *buffer); + virtual bool validateOWChecksum(UInt8 *buffer); + virtual void updateOWBootArgs(const OSSymbol *key, OSObject *value); + virtual bool searchNVRAMProperty(struct IONVRAMDescriptor *hdr, + UInt32 *where); + + virtual IOReturn readNVRAMPropertyType0(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMPropertyType0(IORegistryEntry *entry, + const OSSymbol *name, + OSData * value); + + virtual OSData *unescapeBytesToData(const UInt8 *bytes, UInt32 length); + virtual OSData *escapeDataToData(OSData * value); + + virtual IOReturn readNVRAMPropertyType1(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMPropertyType1(IORegistryEntry *entry, + const OSSymbol *name, + OSData *value); + +public: + virtual bool init(IORegistryEntry *old, const IORegistryPlane *plane); + + virtual void registerNVRAMController(IONVRAMController *nvram); + + virtual void sync(void); + + virtual bool serializeProperties(OSSerialize *s) const; + virtual OSObject *getProperty(const OSSymbol *aKey) const; + virtual OSObject *getProperty(const char *aKey) const; + virtual bool setProperty(const OSSymbol *aKey, OSObject *anObject); + virtual void removeProperty(const OSSymbol *aKey); + virtual IOReturn setProperties(OSObject *properties); + + virtual IOReturn readXPRAM(IOByteCount offset, UInt8 *buffer, + IOByteCount length); + virtual IOReturn writeXPRAM(IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOReturn readNVRAMProperty(IORegistryEntry *entry, + const OSSymbol **name, + OSData **value); + virtual IOReturn writeNVRAMProperty(IORegistryEntry *entry, + const OSSymbol *name, + OSData *value); + + virtual OSDictionary *getNVRAMPartitions(void); + + virtual IOReturn readNVRAMPartition(const OSSymbol *partitionID, + IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOReturn writeNVRAMPartition(const OSSymbol *partitionID, + IOByteCount offset, UInt8 *buffer, + IOByteCount length); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); +}; + +#endif /* !_IOKIT_IONVRAM_H */ diff --git a/i386/include/IOKit/IONotifier.h b/i386/include/IOKit/IONotifier.h new file mode 100644 index 0000000..8f4378a --- /dev/null +++ b/i386/include/IOKit/IONotifier.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IONOTIFIER_H +#define _IOKIT_IONOTIFIER_H + +#include + +/*! @class IONotifier : public OSObject + @abstract An abstract base class defining common methods for controlling a notification request. + @discussion IOService notification requests are represented as implementations of the IONotifier object. It defines methods to enable, disable and remove notification requests. These actions are synchronized with invocations of the notification handler, so removing a notification request will guarantee the handler is not being executed. */ + +class IONotifier : public OSObject +{ + OSDeclareAbstractStructors(IONotifier) + +public: + +/*! @function remove + @abstract Removes the notification request and releases it. + @discussion Removes the notification request and release it. Since creating an IONotifier instance will leave it with a retain count of one, creating an IONotifier and then removing it will destroy it. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. */ + + virtual void remove() = 0; + +/*! @function disable + @abstract Disables the notification request. + @discussion Disables the notification request. This method is synchronous with any handler invocations, so when this method returns its guaranteed the handler will not be in entered. + @result Returns the previous enable state of the IONotifier. */ + + virtual bool disable() = 0; + +/*! @function enable + @abstract Sets the enable state of the notification request. + @discussion Restores the enable state of the notification request, given the previous state passed in. + @param was The enable state of the notifier to restore. */ + + virtual void enable( bool was ) = 0; + +}; + +#endif /* ! _IOKIT_IONOTIFIER_H */ diff --git a/i386/include/IOKit/IOPlatformExpert.h b/i386/include/IOKit/IOPlatformExpert.h new file mode 100644 index 0000000..f75a3e3 --- /dev/null +++ b/i386/include/IOKit/IOPlatformExpert.h @@ -0,0 +1,318 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPLATFORMEXPERT_H +#define _IOKIT_IOPLATFORMEXPERT_H + +#ifdef __cplusplus +#include +#include +#include +#include + +extern "C" { +#endif + +#include + +extern boolean_t PEGetMachineName( char * name, int maxLength ); +extern boolean_t PEGetModelName( char * name, int maxLength ); +extern int PEGetPlatformEpoch( void ); + +enum { + kPEHaltCPU, + kPERestartCPU, + kPEHangCPU, + kPEUPSDelayHaltCPU, + kPEPanicRestartCPU, + kPEPanicSync +}; +extern int (*PE_halt_restart)(unsigned int type); +extern int PEHaltRestart(unsigned int type); + +// Save the Panic Info. Returns the number of bytes saved. +extern UInt32 PESavePanicInfo(UInt8 *buffer, UInt32 length); + +extern long PEGetGMTTimeOfDay( void ); +extern void PESetGMTTimeOfDay( long secs ); + +#ifdef __cplusplus +} /* extern "C" */ + +#define kIOPlatformMapperPresentKey "IOPlatformMapperPresent" + + +extern OSSymbol * gPlatformInterruptControllerName; + +extern const OSSymbol * gIOPlatformSleepActionKey; +extern const OSSymbol * gIOPlatformWakeActionKey; +extern const OSSymbol * gIOPlatformQuiesceActionKey; +extern const OSSymbol * gIOPlatformActiveActionKey; + +class IORangeAllocator; +class IONVRAMController; +class IOPMrootDomain; + +class IOPlatformExpert : public IOService +{ + OSDeclareDefaultStructors(IOPlatformExpert); + +private: + long _peBootROMType; + long _peChipSetType; + long _peMachineType; + +protected: + IOPMrootDomain * root; + int _pePMFeatures; + int _pePrivPMFeatures; + int _peNumBatteriesSupported; + OSArray * thePowerTree; + + bool searchingForAdditionalParents; + OSNumber * multipleParentKeyValue; + int numInstancesRegistered; + + struct ExpansionData { }; + ExpansionData *reserved; + + virtual void setBootROMType(long peBootROMType); + virtual void setChipSetType(long peChipSetType); + virtual void setMachineType(long peMachineType); + + virtual bool CheckSubTree (OSArray * inSubTree, IOService * theNub, IOService * theDevice, OSDictionary * theParent); + virtual bool RegisterServiceInTree (IOService * theService, OSDictionary * theTreeNode, OSDictionary * theTreeParentNode, IOService * theProvider); + + virtual void PMInstantiatePowerDomains ( void ); + +public: + virtual bool attach( IOService * provider ); + virtual bool start( IOService * provider ); + virtual bool configure( IOService * provider ); + virtual IOService * createNub( OSDictionary * from ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + virtual IOReturn getNubResources( IOService * nub ); + + virtual long getBootROMType(void); + virtual long getChipSetType(void); + virtual long getMachineType(void); + + virtual bool getModelName( char * name, int maxLength ); + virtual bool getMachineName( char * name, int maxLength ); + + virtual int haltRestart(unsigned int type); + virtual void sleepKernel(void); + + virtual long getGMTTimeOfDay( void ); + virtual void setGMTTimeOfDay( long secs ); + + virtual IOReturn getConsoleInfo( PE_Video * consoleInfo ); + virtual IOReturn setConsoleInfo( PE_Video * consoleInfo, unsigned int op ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual IOReturn registerInterruptController(OSSymbol *name, IOInterruptController *interruptController); + virtual IOInterruptController *lookUpInterruptController(OSSymbol *name); + virtual void setCPUInterruptProperties(IOService *service); + virtual bool atInterruptLevel(void); + + virtual IOReturn callPlatformFunction(const OSSymbol *functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4); + + virtual IORangeAllocator * getPhysicalRangeAllocator(void); + + virtual bool platformAdjustService(IOService *service); + + virtual void PMRegisterDevice(IOService * theNub, IOService * theDevice); + virtual void PMLog ( const char *,unsigned long, unsigned long, unsigned long ); + + virtual bool hasPMFeature (unsigned long featureMask); + virtual bool hasPrivPMFeature (unsigned long privFeatureMask); + virtual int numBatteriesSupported (void); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); + + virtual OSString* createSystemSerialNumberString(OSData* myProperty); + + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 0); + OSMetaClassDeclareReservedUsed(IOPlatformExpert, 1); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 2); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 3); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 4); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 5); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 6); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 7); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 8); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 9); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 10); + OSMetaClassDeclareReservedUnused(IOPlatformExpert, 11); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IODTNVRAM; + +class IODTPlatformExpert : public IOPlatformExpert +{ + OSDeclareAbstractStructors(IODTPlatformExpert); + +private: + IODTNVRAM *dtNVRAM; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual IOService * probe( IOService * provider, + SInt32 * score ); + virtual bool configure( IOService * provider ); + + virtual void processTopLevel( IORegistryEntry * root ); + virtual const char * deleteList( void ) = 0; + virtual const char * excludeList( void ) = 0; + virtual IOService * createNub( IORegistryEntry * from ); + virtual bool createNubs( IOService * parent, OSIterator * iter ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual IOReturn getNubResources( IOService * nub ); + + virtual bool getModelName( char * name, int maxLength ); + virtual bool getMachineName( char * name, int maxLength ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual int haltRestart(unsigned int type); + + /* virtual */ IOReturn readXPRAM(IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + /* virtual */ IOReturn writeXPRAM(IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + virtual IOReturn readNVRAMProperty( + IORegistryEntry * entry, + const OSSymbol ** name, OSData ** value ); + + virtual IOReturn writeNVRAMProperty( + IORegistryEntry * entry, + const OSSymbol * name, OSData * value ); + + // This returns a dictionary describing all the NVRAM partitions. + // The keys will be the partitionIDs of the form "0x52,nvram". + // The values will be OSNumbers of the partition's byte count. + /* virtual */ OSDictionary *getNVRAMPartitions(void); + + /* virtual */ IOReturn readNVRAMPartition(const OSSymbol * partitionID, + IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + /* virtual */ IOReturn writeNVRAMPartition(const OSSymbol * partitionID, + IOByteCount offset, UInt8 * buffer, + IOByteCount length); + + virtual IOByteCount savePanicInfo(UInt8 *buffer, IOByteCount length); + virtual OSString* createSystemSerialNumberString(OSData* myProperty); + + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 0); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 1); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 2); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 3); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 4); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 5); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 6); + OSMetaClassDeclareReservedUnused(IODTPlatformExpert, 7); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* generic root nub of service tree */ + +class IOPlatformExpertDevice : public IOService +{ + OSDeclareDefaultStructors(IOPlatformExpertDevice) + +private: + IOWorkLoop *workLoop; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool initWithArgs( void * p1, void * p2, + void * p3, void *p4 ); + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + + virtual IOWorkLoop *getWorkLoop() const; + virtual IOReturn setProperties( OSObject * properties ); + + virtual void free(); + + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 0); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 1); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 2); + OSMetaClassDeclareReservedUnused(IOPlatformExpertDevice, 3); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* generic nub for motherboard devices */ + +class IOPlatformDevice : public IOService +{ + OSDeclareDefaultStructors(IOPlatformDevice) + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + virtual IOService * matchLocation( IOService * client ); + virtual IOReturn getResources( void ); + + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 0); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 1); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 2); + OSMetaClassDeclareReservedUnused(IOPlatformDevice, 3); +}; + +#endif /* __cplusplus */ + +#endif /* ! _IOKIT_IOPLATFORMEXPERT_H */ diff --git a/i386/include/IOKit/IORangeAllocator.h b/i386/include/IOKit/IORangeAllocator.h new file mode 100644 index 0000000..d81bbef --- /dev/null +++ b/i386/include/IOKit/IORangeAllocator.h @@ -0,0 +1,171 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 05 Nov 99 - created. + */ + +#ifndef _IOKIT_IORANGEALLOCATOR_H +#define _IOKIT_IORANGEALLOCATOR_H + +#include +#include + +typedef IOByteCount IORangeScalar; + +/*! @class IORangeAllocator + @abstract A utility class to manage allocations from a range. + @discussion The IORangeAllocator class provides functions for allocating ranges, at a fixed or any offset, and freeing them back to a free list. It is useful for describing ranges of memory or address space without requiring storage in the memory - information describing the free elements is kept elsewhere. Ranges are described by a start offset and a size. IORangeAllocator is optionally protected against multithreaded access. +*/ + +class IORangeAllocator : public OSObject { + + OSDeclareDefaultStructors(IORangeAllocator) + +protected: + UInt32 numElements; + UInt32 capacity; + UInt32 capacityIncrement; + IORangeScalar defaultAlignmentMask; + IOOptionBits options; + + struct IORangeAllocatorElement * elements; + +private: + virtual bool allocElement( UInt32 index ); + + virtual void deallocElement( UInt32 index ); + +public: + enum { + kLocking = 0x00000001 + }; + +/*! @function init + @abstract Standard initializer for IORangeAllocator. + @discussion This method initializes an IORangeAllocator and optionally sets the free list to contain one fragment, from zero to an endOfRange parameter. The capacity in terms of free fragments and locking options are set for the instance. + @param endOfRange If the free list is to contain an initial fragment, set endOfRange to the last offset in the range, ie. size - 1, to create a free fragment for the range zero to endOfRange inclusive. If zero is passed, the free list will be initialized empty, and can be populated with calls to the deallocate method. + @param defaultAlignment If this parameter is non-zero it specifies a required alignment for all allocations, for example pass 256 to align allocations on 256 byte boundaries. Zero or one specify unaligned allocations. + @param capacity Sets the initial size of the free list in number of noncontiguous fragments. This value is also used for the capacityIncrement. + @param options Pass kLocking if the instance can be used by multiple threads. + @result Returns true if the instance is successfully initialized, false on failure. */ + + virtual bool init( IORangeScalar endOfRange, + IORangeScalar defaultAlignment, + UInt32 capacity, + IOOptionBits options ); + +/*! @function withRange + @abstract Standard factory method for IORangeAllocator. + @discussion This method allocates and initializes an IORangeAllocator and optionally sets the free list to contain one fragment, from zero to an endOfRange parameter. The capacity in terms of free fragments and locking options are set for the instance. + @param endOfRange If the free list is to contain an initial fragment, set endOfRange to the last offset in the range, ie. size - 1, to create a free fragment for the range zero to endOfRange inclusive. If zero is passed the free list will be initialized empty, and can be populated with calls to the deallocate method. + @param defaultAlignment If this parameter is non-zero it specifies a required alignment for all allocations, for example pass 256 to align allocations on 256 byte boundaries. Zero or one specify unaligned allocations. + @param capacity Sets the initial size of the free list in number of non-contiguous fragments. This value is also used for the capacityIncrement. + @param options Pass kLocking if the instance can be used by multiple threads. + @result Returns the new IORangeAllocator instance, to be released by the caller, or zero on failure. */ + + static IORangeAllocator * withRange( IORangeScalar endOfRange, + IORangeScalar defaultAlignment = 0, + UInt32 capacity = 0, + IOOptionBits options = 0 ); + + virtual void free(); + virtual bool serialize(OSSerialize *s) const; + +/*! @function getFragmentCount + @abstract Accessor to return the number of free fragments in the range. + @discussion This method returns a count of free fragments. Each fragment describes a non-contiguous free range - deallocations will merge contiguous fragments together. + @result Returns the count of free fragments. +*/ + + virtual UInt32 getFragmentCount( void ); + +/*! @function getFragmentCapacity + @abstract Accessor to return the number of free fragments in the range. + @discussion This method returns the current capacity of the free fragment list. + @result Returns the current capacity of free fragment list. +*/ + + virtual UInt32 getFragmentCapacity( void ); + +/*! @function setFragmentCapacityIncrement + @abstract Sets the count of fragments the free list will increase by when full. + @discussion This method sets the number of extra fragments the free list will expand to when full. It defaults to the initial capacity. + @param count The number of fragments to increment the capacity by when the free list is full. +*/ + + virtual void setFragmentCapacityIncrement( UInt32 count ); + +/*! @function getFreeCount + @abstract Totals the sizes of the free fragments. + @discussion This method returns the total of the sizes of the fragments on the free list. + @result Returns the total of the free fragments sizes. +*/ + + virtual IORangeScalar getFreeCount( void ); + +/*! @function allocate + @abstract Allocates from the free list, at any offset. + @discussion This method allocates a range from the free list. The alignment will default to the alignment set when the allocator was created or may be set here. + @param size The size of the range requested. + @param result The beginning of the range allocated is returned here on success. + @param alignment If zero is passed, default to the allocators alignment, otherwise pass an alignment required for the allocation, for example 4096 to page align. + @result Returns true if the allocation was successful, else false. +*/ + + virtual bool allocate( IORangeScalar size, + IORangeScalar * result, + IORangeScalar alignment = 0 ); + +/*! @function allocateRange + @abstract Allocates from the free list, at a set offset. + @discussion This method allocates a range from the free list, given a set offset passed in. + @param start The beginning of the range requested. + @param size The size of the range requested. + @result Returns true if the allocation was successful, else false. +*/ + + virtual bool allocateRange( IORangeScalar start, + IORangeScalar size ); + +/*! @function deallocate + @abstract Deallocates a range to the free list. + @discussion This method deallocates a range to the free list, given a the start offset and length passed in. + @param start The beginning of the range requested. + @param size Returns the size of the range requested. +*/ + + virtual void deallocate( IORangeScalar start, + IORangeScalar size ); +}; + +#endif /* _IOKIT_IORANGEALLOCATOR_H */ diff --git a/i386/include/IOKit/IORegistryEntry.h b/i386/include/IOKit/IORegistryEntry.h new file mode 100644 index 0000000..bbe4b18 --- /dev/null +++ b/i386/include/IOKit/IORegistryEntry.h @@ -0,0 +1,947 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOREGISTRYENTRY_H +#define _IOKIT_IOREGISTRYENTRY_H + +#include +#include + + +extern const OSSymbol * gIONameKey; +extern const OSSymbol * gIOLocationKey; +extern const OSSymbol * gIORegistryEntryIDKey; + +class IORegistryEntry; +class IORegistryPlane; +class IORegistryIterator; + +typedef void (*IORegistryEntryApplierFunction)(IORegistryEntry * entry, + void * context); + +enum { + kIORegistryIterateRecursively = 0x00000001, + kIORegistryIterateParents = 0x00000002 +}; + +/*! @class IORegistryEntry : public OSObject + @abstract The base class for all objects in the registry. + @discussion The IORegistryEntry base class provides functions for describing graphs of connected registry entries, each with a dictionary-based property table. Entries may be connected in different planes, with differing topologies. Access to the registry is protected against multiple threads. Inside the kernel planes are specified with plane objects and are published by the creator - IOService exports the gIOServicePlane plane object for example. Non kernel clients specify planes by their name. +*/ + +class IORegistryEntry : public OSObject +{ + friend class IORegistryIterator; + + OSDeclareDefaultStructors(IORegistryEntry) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData + { + uint64_t fRegistryEntryID; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + + OSDictionary * fRegistryTable; + OSDictionary * fPropertyTable; + +public: + /* methods available in Mac OS X 10.1 or later */ + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as a C-string. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const char * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSString. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const OSString * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. Available in Mac OS X 10.1 or later. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSSymbol. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. A reference on any found property is returned to caller, which should be released. */ + + virtual OSObject * copyProperty( const OSSymbol * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyParentEntry + @abstract Returns an registry entry's first parent entry in a plane. Available in Mac OS X 10.1 or later. + @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification. + @param plane The plane object. + @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */ + + virtual IORegistryEntry * copyParentEntry( const IORegistryPlane * plane ) const; + +/*! @function copyChildEntry + @abstract Returns an registry entry's first child entry in a plane. Available in Mac OS X 10.1 or later. + @discussion This function will return the child which first attached to a registry entry. + @param plane The plane object. + @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. A reference on the entry is returned to caller, which should be released. */ + + virtual IORegistryEntry * copyChildEntry( const IORegistryPlane * plane ) const; + + /* method available in Mac OS X 10.4 or later */ +/*! + @typedef Action + @discussion Type and arguments of callout C function that is used when +a runCommand is executed by a client. Cast to this type when you want a C++ +member function to be used. Note the arg1 - arg3 parameters are passed straight pass through to the action callout. + @param target + Target of the function, can be used as a refcon. Note if a C++ function +was specified, this parameter is implicitly the first parameter in the target +member function's parameter list. + @param arg0 Argument to action from run operation. + @param arg1 Argument to action from run operation. + @param arg2 Argument to action from run operation. + @param arg3 Argument to action from run operation. +*/ + typedef IOReturn (*Action)(OSObject *target, + void *arg0, void *arg1, + void *arg2, void *arg3); + +/*! @function runPropertyAction + @abstract Single thread a call to an action w.r.t. the property lock + @discussion Client function that causes the given action to be called in a manner that syncrhonises with the registry iterators and serialisers. This functin can be used to synchronously manipulate the property table of this nub + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result Returns the value of the Action callout. +*/ + virtual IOReturn runPropertyAction(Action action, OSObject *target, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IORegistryEntry, 0); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 1); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 2); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 3); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 4); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 5); +#else + OSMetaClassDeclareReservedUsed(IORegistryEntry, 0); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 1); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 2); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 3); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 4); + OSMetaClassDeclareReservedUsed(IORegistryEntry, 5); +#endif + OSMetaClassDeclareReservedUnused(IORegistryEntry, 6); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 7); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 8); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 9); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 10); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 11); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 12); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 13); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 14); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 15); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 16); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 17); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 18); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 19); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 20); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 21); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 22); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 23); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 24); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 25); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 26); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 27); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 28); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 29); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 30); + OSMetaClassDeclareReservedUnused(IORegistryEntry, 31); + +public: + + /* Registry accessors */ + +/*! @function getRegistryRoot + @abstract Returns a pointer to the root instance of the registry. + @discussion This method provides an accessor to the root of the registry for the machine. The root may be passed to a registry iterator when iterating a plane, and contains properties that describe the available planes, and diagnostic information for IOKit. Keys for these properties are in IOKitKeys.h. + @result A pointer to the IORegistryEntry root instance. It should not be released by the caller. */ + + static IORegistryEntry * getRegistryRoot( void ); + +/*! @function getGenerationCount + @abstract Returns an generation count for all registry changing operations. + @discussion This method provides an accessor to the current generation count (or seed) of the registry which changes when any topology change occurs in the registry - this does not include property table changes. It may be used to invalidate any caching of the results from IORegistryEntry methods. + @result An integer generation count. */ + + static SInt32 getGenerationCount( void ); + +/*! @function getPlane + @abstract Looks up the plane object by a C-string name. + @discussion Planes are usually provided as globals by the creator, eg. gIOServicePlane, gIODeviceTreePlane, or gIOAudioPlane, however they may also be looked up by name with this method. + @result A pointer to the plane object, or zero if no such plane exists. The returned plane should not be released. */ + + static const IORegistryPlane * getPlane( const char * name ); + + /* Registry Entry allocation & init */ + +/*! @function init + @abstract Standard init method for all IORegistryEntry subclasses. + @discussion A registry entry must be initialized with this method before it can be used. A property dictionary may passed and will be retained by this method for use as the registry entry's property table, or an empty one will be created. + @param A dictionary that will become the registry entry's property table (retaining it), or zero which will cause an empty property table to be created. + @result true on success, or false on a resource failure. */ + + virtual bool init( OSDictionary * dictionary = 0 ); + +/*! @function free + @abstract Standard free method for all IORegistryEntry subclasses. + @discussion This method will release any resources of the entry, in particular its property table. Note that the registry entry must always be detached from the registry before free may be called, and subclasses (namely IOService) will have additional protocols for removing registry entries. free should never need be called directly. */ + + virtual void free( void ); + +/*! @function setPropertyTable + @abstract Replace a registry entry's property table. + @discussion This method will release the current property table of a the entry and replace it with another, retaining the new property table. + @param dict The new dictionary to be used as the entry's property table. */ + + virtual void setPropertyTable( OSDictionary * dict ); + + /* Synchronized property accessors; wrappers to OSDictionary + * plus property creation helpers */ + +/*! @function setProperty + @abstract Synchronized method to add a property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The properties name as an OSSymbol. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const OSSymbol * aKey, OSObject * anObject); + +/*! @function setProperty + @abstract Synchronized method to add a property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const OSString * aKey, OSObject * anObject); + +/*! @function setProperty + @abstract Synchronized method to add a property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. + @param anObject The property value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, OSObject * anObject); + +/*! @function setProperty + @abstract Synchronized method to construct and add a OSString property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSString from the supplied C-string, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param aString The property value as a C-string. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, const char * aString); + +/*! @function setProperty + @abstract Synchronized method to construct and add an OSBoolean property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSBoolean from the supplied value, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param aBoolean The property's boolean value. + @result true on success or false on a resource failure. */ + + virtual bool setProperty(const char * aKey, bool aBoolean); + +/*! @function setProperty + @abstract Synchronized method to construct and add an OSNumber property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSNumber from the supplied value and size, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param aValue The property's numeric value. + @param aNumberOfBits The property's size in bits, for OSNumber. + @result true on success or false on a resource failure. */ + + virtual bool setProperty( const char * aKey, + unsigned long long aValue, + unsigned int aNumberOfBits); + +/*! @function setProperty + @abstract Synchronized method to construct and add an OSData property to a registry entry's property table. + @discussion This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSData copied from the supplied data and length, set in the property table with the given name, and released. + @param aKey The property's name as a C-string. + @param bytes The property's value as a pointer. OSData will copy this data. + @param length The property's size in bytes, for OSData. + @result true on success or false on a resource failure. */ + + virtual bool setProperty( const char * aKey, + void * bytes, + unsigned int length); + +/*! @function removeProperty + @abstract Synchronized method to remove a property from a registry entry's property table. + @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSSymbol. */ + + virtual void removeProperty( const OSSymbol * aKey); + +/*! @function removeProperty + @abstract Synchronized method to remove a property from a registry entry's property table. + @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. */ + + virtual void removeProperty( const OSString * aKey); + +/*! @function removeProperty + @abstract Synchronized method to remove a property from a registry entry's property table. + @discussion This method will remove a property from a registry entry's property table, using the OSDictionary::removeObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. */ + + virtual void removeProperty( const char * aKey); + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSSymbol. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSSymbol * aKey) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSString * aKey) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const char * aKey) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSSymbol. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSSymbol * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as an OSString. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const OSString * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function getProperty + @abstract Synchronized method to obtain a property from a registry entry or one of its parents (or children) in the hierarchy. + @discussion This method will search for a property, starting first with this registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the OSDictionary::getObject semantics. The iteration keeps track of entries that have been recursed into previously to avoid loops. This method is synchronized with other IORegistryEntry accesses to the property table(s). + @param aKey The property's name as a C-string. + @param plane The plane to iterate over, eg. gIOServicePlane. + @param options kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard getProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. + @result The property value found, or zero. */ + + virtual OSObject * getProperty( const char * aKey, + const IORegistryPlane * plane, + IOOptionBits options = + kIORegistryIterateRecursively | + kIORegistryIterateParents) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSSymbol. + @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const OSSymbol * aKey) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as an OSString. + @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const OSString * aKey) const; + +/*! @function copyProperty + @abstract Synchronized method to obtain a property from a registry entry's property table. + @discussion This method will lookup a property in a registry entry's property table, using the OSDictionary::getObject semantics, and return a reference to the caller. This method is synchronized with other IORegistryEntry accesses to the property table. + @param aKey The property's name as a C-string. + @result The property value found, or zero. It should be released by the caller. */ + + virtual OSObject * copyProperty( const char * aKey) const; + +/*! @function dictionaryWithProperties + @abstract Synchronized method to obtain copy a registry entry's property table. + @discussion This method will copy a registry entry's property table, using the OSDictionary::withDictionary semantics. This method is synchronized with other IORegistryEntry accesses to the property table. Since OSDictionary will only copy property values by reference, synchronization is not guaranteed to any collection values. + @result The created dictionary, or zero on a resource value. It should be released by the caller. */ + + virtual OSDictionary * dictionaryWithProperties( void ) const; + +/*! @function serializeProperties + @abstract Synchronized method to serialize a registry entry's property table. + @discussion This method will serialize a registry entry's property table, using the OSDictionary::serialize semantics. This method is synchronized with other IORegistryEntry accesses to the property table. Many non-kernel clients of IOKit read information from the registry via properties, and will invoke this method in a registry entry to create a serialization of all the entry's properties, which is then reconstructed in the client's task as a CFDictionary. This method may be intercepted by subclasses to update their properties or implement a different serialization method, though it is usually better to implement such functionality by creating objects in the property table and implementing their serialize methods, avoiding any need to implement serializeProperties. + @param serialize The OSSerialize instance representing the serialization request. + @result True on success, false otherwise. */ + + virtual bool serializeProperties( OSSerialize * serialize ) const; + + /* Unsynchronized(!) property table access */ + +/*! @function getPropertyTable + @abstract Unsynchronized accessor to a registry entry's property table. + @discussion This method will return a pointer to the live property table as an OSDictionery. Its use is not recommended in most cases, instead use the synchronized accessors and helper functions of IORegistryEntry to access properties. It can only safely be used by one thread, which usually means it can only be used before a registry entry is entered into the registry. + @result A pointer to the property table as an OSDictionary. The pointer is valid while the registry entry is retained, and should not be released by the caller. */ + + /* inline */ OSDictionary * getPropertyTable( void ) const; + /* { return(fPropertyTable); } */ + + /* Set properties from user level, to be overridden if supported */ + +/*! @function setProperties + @abstract Optionally supported external method to set properties in a registry entry. + @discussion This method is not implemented by IORegistryEntry, but is available to kernel and non-kernel clients to set properties in a registry entry. IOUserClient provides connection based, more controlled access to this functionality and may be more appropriate for many uses, since there is no differentiation between clients available to this method. + @param properties Any OSObject subclass, to be interpreted by the implementing method - for example an OSDictionary, OSData etc. may all be appropriate. + @result An IOReturn code to be returned to the caller. */ + + virtual IOReturn setProperties( OSObject * properties ); + + /* Topology */ + +/*! @function getParentIterator + @abstract Returns an iterator over an registry entry's parent entries in a specified plane. + @param plane The plane object. + @result Returns an iterator over the parents of the registry entry, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getParentIterator( const IORegistryPlane * plane ) + const; + virtual void applyToParents( IORegistryEntryApplierFunction applier, + void * context, + const IORegistryPlane * plane ) const; + +/*! @function getParentEntry + @abstract Returns an registry entry's first parent entry in a plane. + @discussion This function will return the parent to which a registry entry was first attached. Since the majority of registry entrys have only one provider, this is a useful simplification. + @param plane The plane object. + @result Returns the first parent of the registry entry, or zero if the entry is not attached into the registry in that plane. The parent is retained while the entry is attached, and should not be released by the caller. */ + + virtual IORegistryEntry * getParentEntry( const IORegistryPlane * plane ) const; + +/*! @function getChildIterator + @abstract Returns an iterator over an registry entry's child entries in a plane. + @discussion This method creates an iterator which will return each of a registry entry's child entries in a specified plane. + @param plane The plane object. + @result Returns an iterator over the children of the entry, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getChildIterator( const IORegistryPlane * plane ) + const; + + virtual void applyToChildren( IORegistryEntryApplierFunction applier, + void * context, + const IORegistryPlane * plane ) const; + +/*! @function getChildEntry + @abstract Returns an registry entry's first child entry in a plane. + @discussion This function will return the child which first attached to a registry entry. + @param plane The plane object. + @result Returns the first child of the registry entry, or zero if the entry is not attached into the registry in that plane. The child is retained while the entry is attached, and should not be released by the caller. */ + + virtual IORegistryEntry * getChildEntry( const IORegistryPlane * plane ) const; + +/*! @function isChild + @abstract Determines whether a registry entry is the child of another in a plane. + @discussion This method called in the parent entry determines if the specified entry is a child, in a plane. Additionally, it can check if the child is the only child of the parent entry. + @param child The possible child registry entry. + @param plane The plane object. + @param onlyChild If true, check also if the child is the only child. + @result If the child argument is not a child of the registry entry, false is returned. If onlyChild is true and the child is not the only child of the entry, false is returned, otherwise true is returned. */ + + virtual bool isChild( IORegistryEntry * child, + const IORegistryPlane * plane, + bool onlyChild = false ) const; + +/*! @function isParent + @abstract Determines whether a registry entry is the parent of another in a plane. + @discussion This method called in the child entry determines if the specified entry is a parent, in a plane. Additionally, it can check if the parent is the only parent of the child entry. + @param parent The possible parent registry entry. + @param plane The plane object. + @param onlyParent If true, check also if the parent is the only parent. + @result If the parent argument is not a parent of the registry entry, false is returned. If onlyParent is true and the parent is not the only parent of the entry, false is returned, otherwise true is returned. */ + + virtual bool isParent( IORegistryEntry * parent, + const IORegistryPlane * plane, + bool onlyParent = false ) const; + +/*! @function inPlane + @abstract Determines whether a registry entry is attached in a plane. + @discussion This method determines if the entry is attached in a plane to any other entry. It can also be used to determine if the entry is a member of any plane. + @param plane The plane object, 0 indicates any plane. + @result If the entry has a parent in the given plane or if plane = 0 then if entry has any parent; return true, otherwise false. */ + + virtual bool inPlane( const IORegistryPlane * plane = 0) const; + +/*! @function getDepth + @abstract Counts the maximum number of entries between an entry and the registry root, in a plane. + @discussion This method counts the number of entries between and entry and the registry root, in a plane, for each parent of the entry and returns the maximum value. + @param plane The plane object. + @result The maximum number of entries between the entry and the root. Zero is returned if the entry is not attached in the plane. */ + + virtual unsigned int getDepth( const IORegistryPlane * plane ) const; + + /* Attach / detach */ + +/*! @function attachToParent + @abstract Attaches a entry to a parent entry in a plane. + @discussion This is the usual method of entering an entry into the registry. It is a no-op and success if the entry is already attached to the parent. Attaching the entry into the registry retains both the child and parent while they are attached. This method will call attachToChild in the parent entry if it is not being called from attachToChild. + @param parent The registry entry to attach to. + @param plane The plane object. + @result true on success, or false on a resource failure, or if the parent is the same as the child. */ + + virtual bool attachToParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + +/*! @function detachFromParent + @abstract Detaches an entry from a parent entry in a plane. + @discussion This is the usual method of removing an entry from the registry. It is a no-op if the entry is not attached to the parent. Detaching the entry will release both the child and parent. This method will call detachFromChild in the parent entry if it is not being called from detachFromChild. + @param parent The registry entry to detach from. + @param plane The plane object. */ + + virtual void detachFromParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + +/*! @function attachToChild + @abstract Method called in the parent entry when a child attaches. + @discussion This method is called in the parent entry when a child attaches, to make overrides possible. This method will also call attachToParent in the child entry if it is not being called from attachToParent. It is a no-op and success if the entry is already a child. Attaching the entry into the registry retains both the child and parent while they are attached. + @param child The registry entry being attached. + @param plane The plane object. + @result true on success, or false on a resource failure, or if the parent is the same as the child. */ + + virtual bool attachToChild( IORegistryEntry * child, + const IORegistryPlane * plane ); + +/*! @function detachFromChild + @abstract Detaches a child entry from its parent in a plane. + @discussion This method is called in the parent entry when a child detaches, to make overrides possible. It is a no-op if the entry is not a child of the parent. Detaching the entry will release both the child and parent. This method will call detachFromParent in the child entry if it is not being called from detachFromParent. + @param parent The registry entry to detach. + @param plane The plane object. */ + + virtual void detachFromChild( IORegistryEntry * child, + const IORegistryPlane * plane ); + +/*! @function detachAbove + @abstract Detaches an entry from all its parent entries in a plane. + @discussion This method calls detachFromParent in the entry for each of its parent entries in the plane. + @param plane The plane object. */ + + virtual void detachAbove( const IORegistryPlane * plane ); + +/*! @function detachAll + @abstract Detaches an entry and all its children recursively in a plane. + @discussion This method breaks the registry connections for a subtree. detachAbove is called in the entry, and all child entries and their children in the plane. + @param plane The plane object. */ + + virtual void detachAll( const IORegistryPlane * plane ); + + /* Name, location and path accessors */ + +/*! @function getName + @abstract Returns the name assigned to the registry entry as a C-string. + @discussion Entries can be named in a particular plane, or globally. If the entry is named in plane and the plane is specified that name will be returned, otherwise the global name is returned. The global name defaults to the entry's meta class name if it has not been named. + @param plane The plane object, or zero for the global name. + @result A C-string name, valid while the entry is retained. */ + + virtual const char * getName( const IORegistryPlane * plane = 0 ) const; + +/*! @function copyName + @abstract Returns the name assigned to the registry entry as an OSSymbol. + @discussion Entries can be named in a particular plane, or globally. If the entry is named in plane and the plane is specified that name will be returned, otherwise the global name is returned. The global name defaults to the entry's meta class name if it has not been named. + @param plane The plane object, or zero for the global name. + @result A reference to an OSSymbol for the name, which should be released by the caller. */ + + virtual const OSSymbol * copyName( + const IORegistryPlane * plane = 0 ) const; + +/*! @function compareNames + @abstract Compares the name of the entry with one or more names, and optionally returns the matching name. + @discussion This method is called during IOService name matching and elsewhere to compare the entry's global name with a list of names, or a single name. A list of names may be passed as any OSCollection of OSStrings, while a single name may be passed an OSString, in the name parameter. compareNames will call the compareName method for each name, for overrides. + @param name The name or names to compare with as any OSCollection (eg. OSArray, OSSet, OSDictionary) of OSStrings, or a single name may be passed an OSString. + @param matched If the caller wants the successfully matched name returned, pass a non-zero pointer for the matched parameter and an OSString will be returned here. It should be released by the caller. + @result True if one of the names compared true with the entry's global name. */ + + virtual bool compareNames( OSObject * name, OSString ** matched = 0 ) const; + +/*! @function compareName + @abstract Compares the name of the entry with one name, and optionally returns the matching name. + @discussion This method is called during IOService name matching and elsewhere from the compareNames method. It should be overridden to provide non-standard name matching. + @param name The name to compare with as an OSString. + @param matched If the caller wants the successfully matched name returned, pass a non-zero pointer for the matched parameter and an OSString will be returned here. It should be released by the caller. Generally, this will be the same as the name parameter, but may not be if wildcards are used. + @result True if the name compared true with the entry's global name. */ + + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + +/*! @function setName + @abstract Sets a name for the registry entry, in a particular plane, or globally. + @discussion Entries can be named in a particular plane, or globally. If the plane is specified the name applies only to that plane, otherwise the global name is set. The global name defaults to the entry's meta class name if it has not been named. + @param name An OSSymbol which will be retained. + @param plane The plane object, or zero to set the global name. */ + + virtual void setName( const OSSymbol * name, + const IORegistryPlane * plane = 0 ); + +/*! @function setName + @abstract Sets a name for the registry entry, in a particular plane, or globally. + @discussion Entries can be named in a particular plane, or globally. If the plane is specified the name applies only to that plane, otherwise the global name is set. The global name defaults to the entry's meta class name if it has not been named. + @param name A const C-string name which will be copied. + @param plane The plane object, or zero to set the global name. */ + + virtual void setName( const char * name, + const IORegistryPlane * plane = 0 ); + +/*! @function getLocation + @abstract Returns the location string assigned to the registry entry as a C-string. + @discussion Entries can given a location string in a particular plane, or globally. If the entry has had a location set in a plane and the plane is specified that location string will be returned, otherwise the global location string is returned. If no global location string has been set, zero is returned. + @param plane The plane object, or zero for the global name. + @result A C-string location string, valid while the entry is retained, or zero. */ + + virtual const char * getLocation( const IORegistryPlane * plane = 0 ) const; + +/*! @function copyLocation + @abstract Returns the location string assigned to the registry entry as an OSSymbol. + @discussion Entries can given a location string in a particular plane, or globally. If the entry has had a location set in a plane and the plane is specified that location string will be returned, otherwise the global location string is returned. If no global location string has been set, zero is returned. + @param plane The plane object, or zero for the global name. + @result A reference to an OSSymbol for the location if one exists, which should be released by the caller, or zero. */ + + virtual const OSSymbol * copyLocation( + const IORegistryPlane * plane = 0 ) const; + +/*! @function setLocation + @abstract Sets a location string for the registry entry, in a particular plane, or globally. + @discussion Entries can be given a location string in a particular plane, or globally. If the plane is specified the location applies only to that plane, otherwise the global location is set. The location string may be used during path lookups of registry entries, to distinguish between sibling entries with the same name. The default IORegistryEntry parsing of location strings expects a list of hex numbers separated by commas, though subclasses of IORegistryEntry might do their own parsing. + @param location A C-string location string which will be copied, or an OSSymbol which will be retained. + @param plane The plane object, or zero to set the global location string. */ + + virtual void setLocation( const OSSymbol * location, + const IORegistryPlane * plane = 0 ); + virtual void setLocation( const char * location, + const IORegistryPlane * plane = 0 ); + +/*! @function getPath + @abstract Create a path for a registry entry. + @discussion The path for a registry entry is copied to the caller's buffer. The path describes the entry's attachment in a particular plane, which must be specified. The path begins with the plane name followed by a colon, and then followed by '/' separated path components for each of the entries between the root and the registry entry. Each component is constructed with the getPathComponent method called in each entry. An alias may also exist for the entry, which are described as properties in a registry entry found at /aliases in the plane. If a property value interpreted as a path in a call to IORegistryEntry::fromPath yields the entry, then the property name is used as the entry's path. + @param path A char buffer allocated by the caller. + @param length An in/out parameter - the caller sets the length of the buffer available, and getPath returns the total length of the path copied to the buffer. + @param plane The plane object. + @result getPath will fail if the entry is not attached in the plane, or if the buffer is not large enough to contain the path. */ + + virtual bool getPath( char * path, int * length, + const IORegistryPlane * plane) const; + +/*! @function getPathComponent + @abstract Create a path component for a registry entry. + @discussion Each component of a path created with getPath is created with getPathComponent. The default implementation concatenates the entry's name in the the plane, with the "at" symbol and the location string of the entry in the plane if it has been set. + @param path A char buffer allocated by the caller. + @param length An in/out parameter - the caller sets the length of the buffer available, and getPathComponent returns the total length of the path component copied to the buffer. + @param plane The plane object. + @result true if the path fits into the supplied buffer or false on a overflow. */ + + virtual bool getPathComponent( char * path, int * length, + const IORegistryPlane * plane ) const; + +/*! @function fromPath + @abstract Looks up a registry entry by path. + @discussion This function parses paths to lookup registry entries. The path may begin with the : created by getPath, or the plane may be set by the caller. If there are characters remaining unparsed after an entry has been looked up, this may be considered an invalid lookup, or those characters may be passed back to the caller and the lookup successful. + @param path A C-string path. + @param plane The plane to lookup up the path, or zero, in which case the path must begin with the plane name. + @param residualPath If the path may contain residual characters after the last path component, the residual will be copied back to the caller's residualPath buffer. If there are residual characters and no residual buffer is specified, fromPath will fail. + @param residualLength An in/out parameter - the caller sets the length of the residual buffer available, and fromPath returns the total length of the residual path copied to the buffer. If there is no residualBuffer (residualPath = 0) then residualLength may be zero also. + @param fromEntry The lookup will proceed rooted at this entry if non-zero, otherwise it proceeds from the root of the plane. + @result A retained registry entry is returned on success, or zero on failure. The caller should release the entry. */ + + static IORegistryEntry * fromPath( const char * path, + const IORegistryPlane * plane = 0, + char * residualPath = 0, + int * residualLength = 0, + IORegistryEntry * fromEntry = 0 ); + +/*! @function fromPath + @abstract Looks up a registry entry by relative path. + @discussion This function looks up a entry below the called entry by a relative path. It is just a convenience that calls IORegistryEntry::fromPath with this as the fromEntry parameter. + @param path See IORegistryEntry::fromPath. + @param plane See IORegistryEntry::fromPath. + @param residualPath See IORegistryEntry::fromPath. + @param residualLength See IORegistryEntry::fromPath. + @result See IORegistryEntry::fromPath. */ + + virtual IORegistryEntry * childFromPath( const char * path, + const IORegistryPlane * plane = 0, + char * residualPath = 0, + int * residualLength = 0 ); + +/*! @function dealiasPath + @abstract Strips any aliases from the head of path and returns the full path. + @discussion If the path specified begins with an alias found in the /aliases entry, the value of the alias is returned, and a pointer into the passed in path after the alias is passed back to the caller. If an alias is not found, zero is returned and the path parameter is unchanged. + @param opath An in/out paramter - the caller passes in a pointer to a C-string pointer to a path. If an alias is found, dealiasPath returns a pointer into the path just beyond the end of the alias. + @param plane A plane object must be specified. + @result A C-string pointer to the value of the alias if one is found, or zero if not. */ + + static const char * dealiasPath( const char ** opath, + const IORegistryPlane * plane ); + +/*! @function makePlane + @abstract Constructs an IORegistryPlane object. + @discussion Most planes in IOKit are created by the OS, although other planes may be created. + @param name A C-string name for the new plane, to be copied. + @result A new instance of an IORegistryPlane, or zero on failure. */ + + static const IORegistryPlane * makePlane( const char * name ); + +/*! @abstract Returns an ID for the registry entry that is global to all tasks. + @discussion The entry ID returned by getRegistryEntryID can be used to identify a registry entry across all tasks. A registry entry may be looked up by its entry ID by creating a matching dictionary with IORegistryEntryIDMatching() in user space, or IOService::registryEntryIDMatching() in the kernel, to be used with the IOKit matching functions. The ID is valid only until the machine reboots. + @result An ID for the registry entry, assigned when the entry is first attached in the registry. */ + + uint64_t getRegistryEntryID( void ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* * * * * * * * * * * * internals * * * * * * * * * * * */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ); + +private: + static IORegistryEntry * initialize( void ); + +private: + inline bool arrayMember( OSArray * set, + const IORegistryEntry * member, + unsigned int * index = 0 ) const; + + bool makeLink( IORegistryEntry * to, + unsigned int relation, + const IORegistryPlane * plane ) const; + void breakLink( IORegistryEntry * to, + unsigned int relation, + const IORegistryPlane * plane ) const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + OSArray * getParentSetReference( const IORegistryPlane * plane ) + const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + OSArray * getChildSetReference( const IORegistryPlane * plane ) + const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IORegistryEntry * getChildFromComponent( const char ** path, + const IORegistryPlane * plane ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + const OSSymbol * hasAlias( const IORegistryPlane * plane, + char * opath = 0, int * length = 0 ) const; + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + const char * matchPathLocation( const char * cmp, + const IORegistryPlane * plane ); + +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IORegistryIterator : public OSIterator + @abstract An iterator over the registry. + @discussion An iterator that can traverse the children or parents of a registry entry in a plane, and recurse. Access to the registry is protected against multiple threads, but an IORegistryIterator instance is for use by one thread only. */ + +class IORegistryIterator : public OSIterator +{ + OSDeclareAbstractStructors(IORegistryIterator) + +private: + struct IORegCursor { + IORegCursor * next; + IORegistryEntry * current; + OSIterator * iter; + }; + IORegCursor start; + IORegCursor * where; + IORegistryEntry * root; + OSOrderedSet * done; + const IORegistryPlane * plane; + IOOptionBits options; + + virtual void free( void ); + +public: +/*! @function iterateOver + @abstract Create an iterator rooted at a given registry entry. + @discussion This method creates an IORegistryIterator that is set up with options to iterate children or parents of a root entry, and to recurse automatically into entries as they are returned, or only when instructed. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + @param start The root entry to begin the iteration at. + @param plane A plane object must be specified. + @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned. This option affects the behaviour of the getNextObject method, which is defined in the OSIterator superclass. Other methods will override this behaviour. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + @result A created IORegistryIterator instance, to be released by the caller when it has finished with it. */ + + static IORegistryIterator * iterateOver( IORegistryEntry * start, + const IORegistryPlane * plane, + IOOptionBits options = 0 ); + +/*! @function iterateOver + @abstract Create an iterator rooted at the registry root. + @discussion This method creates an IORegistryIterator that is set up with options to iterate children of the registry root entry, and to recurse automatically into entries as they are returned, or only when instructed. The iterator object keeps track of entries that have been recursed into previously to avoid loops. + @param plane A plane object must be specified. + @param options kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned. This option affects the behaviour of the getNextObject method, which is defined in the OSIterator superclass. Other methods will override this behaviour. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated. + @result A created IORegistryIterator instance, to be released by the caller when it has finished with it. */ + + static IORegistryIterator * iterateOver( const IORegistryPlane * plane, + IOOptionBits options = 0 ); + +/*! @function getNextObject + @abstract Return the next object in the registry iteration. + @discussion This method calls either getNextObjectFlat or getNextObjectRecursive depending on the options the iterator was created with. This implements the OSIterator defined getNextObject method. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + @result The next registry entry in the iteration (the current entry), or zero if the iteration has finished at this level of recursion. The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObject( void ); + +/*! @function getNextObjectFlat + @abstract Return the next object in the registry iteration, ignoring the kIORegistryIterateRecursively option. + @discussion This method returns the next child, or parent if the kIORegistryIterateParents option was used to create the iterator, of the current root entry. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + @result The next registry entry in the iteration (the current entry), or zero if the iteration has finished at this level of recursion, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObjectFlat( void ); + +/*! @function getNextObjectRecursive + @abstract Return the next object in the registry iteration, and enter it. + @discussion If the iterator has a current entry, and the iterator has not already entered previously, enterEntry is called to recurse into it, ie. make it the new root, and the next child, or parent if the kIORegistryIterateParents option was used to create the iterator, at this new level of recursion is returned. If there is no current entry at this level of recursion, exitEntry is called and the process repeats, until the iteration returns to the entry the iterator was created with and zero is returned. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. + @result The next registry entry in the iteration (the current entry), or zero if its finished, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getNextObjectRecursive( void ); + +/*! @function getCurrentEntry + @abstract Return the current entry in the registry iteration. + @discussion This method returns the current entry, last returned by getNextObject et al. The object returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. If the iteration is no longer valid (see isValid), the current entry is zero. + @result The current registry entry in the iteration, or zero if the last iteration returned zero, or the iteration is invalid (see isValid). The entry returned is retained while the iterator is pointing at it (its the current entry), or recursing into it. The caller should not release it. */ + + virtual IORegistryEntry * getCurrentEntry( void ); + +/*! @function enterEntry + @abstract Recurse into the current entry in the registry iteration. + @discussion This method makes the current entry, ie. the last entry returned by getNextObject et al., the root in a new level of recursion. */ + + virtual void enterEntry( void ); + +/*! @function enterEntry + @abstract Recurse into the current entry in the registry iteration. + @discussion This method recurses into an entry as with enterEntry, but also switches from the current plane to a new one set by the caller. + @param plane The new plane to switch into. */ + + virtual void enterEntry( const IORegistryPlane * plane ); + +/*! @function exitEntry + @abstract Exits a level of recursion, restoring the current entry. + @discussion This method undoes an enterEntry, restoring the current entry. If there are no more levels of recursion to exit false is returned, otherwise true is returned. + @result true if a level of recursion was undone, false if no recursive levels are left in the iteration. */ + + virtual bool exitEntry( void ); + +/*! @function reset + @abstract Exits all levels of recursion, restoring the iterator to its state at creation. + @discussion This method exits all levels of recursion, and restores the iterator to its state at creation. */ + + virtual void reset( void ); + +/*! @function isValid + @abstract Checks that no registry changes have invalidated the iteration. + @discussion If a registry iteration is invalidated by changes to the registry, it will be made invalid, the currentEntry will be considered zero, and further calls to getNextObject et al. will return zero. The iterator should be reset to restart the iteration when this happens. + @result false if the iterator has been invalidated by changes to the registry, true otherwise. */ + + virtual bool isValid( void ); + +/*! @function iterateAll + @abstract Iterates all entries (with getNextObject) and returns a set of all returned entries. + @discussion This method will reset, then iterate all entries in the iteration (with getNextObject) until successful (ie. the iterator is valid at the end of the iteration). + @result A set of entries returned by the iteration. The caller should release the set when it has finished with it. Zero is returned on a resource failure. */ + + virtual OSOrderedSet * iterateAll( void ); +}; + +#endif /* _IOKIT_IOREGISTRYENTRY_H */ diff --git a/i386/include/IOKit/IOReturn.h b/i386/include/IOKit/IOReturn.h new file mode 100644 index 0000000..38811b6 --- /dev/null +++ b/i386/include/IOKit/IOReturn.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * HISTORY + */ + +/* + * Core IOReturn values. Others may be family defined. + */ + +#ifndef __IOKIT_IORETURN_H +#define __IOKIT_IORETURN_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef kern_return_t IOReturn; + +#ifndef sys_iokit +#define sys_iokit err_system(0x38) +#endif /* sys_iokit */ +#define sub_iokit_common err_sub(0) +#define sub_iokit_usb err_sub(1) +#define sub_iokit_firewire err_sub(2) +#define sub_iokit_block_storage err_sub(4) +#define sub_iokit_graphics err_sub(5) +#define sub_iokit_networking err_sub(6) +#define sub_iokit_bluetooth err_sub(8) +#define sub_iokit_pmu err_sub(9) +#define sub_iokit_acpi err_sub(10) +#define sub_iokit_smbus err_sub(11) +#define sub_iokit_ahci err_sub(12) +#define sub_iokit_powermanagement err_sub(13) +//#define sub_iokit_hidsystem err_sub(14) +#define sub_iokit_scsi err_sub(16) +//#define sub_iokit_pccard err_sub(21) + +#define sub_iokit_vendor_specific err_sub(-2) +#define sub_iokit_reserved err_sub(-1) + +#define iokit_common_err(return) (sys_iokit|sub_iokit_common|return) +#define iokit_family_err(sub,return) (sys_iokit|sub|return) +#define iokit_vendor_specific_err(return) (sys_iokit|sub_iokit_vendor_specific|return) + +#define kIOReturnSuccess KERN_SUCCESS // OK +#define kIOReturnError iokit_common_err(0x2bc) // general error +#define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory +#define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage +#define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC +#define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device +#define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation +#define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument +#define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked +#define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked +#define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and + // device already open +#define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages + // had different msg_id +#define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function +#define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure +#define kIOReturnInternalError iokit_common_err(0x2c9) // internal error +#define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error +//#define kIOReturn???Error iokit_common_err(0x2cb) // ??? +#define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock +#define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open +#define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported +#define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported +#define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error +#define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error +#define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open +#define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure +#define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure +#define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy +#define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout +#define kIOReturnOffline iokit_common_err(0x2d7) // device offline +#define kIOReturnNotReady iokit_common_err(0x2d8) // not ready +#define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached +#define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left +#define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data +//#define kIOReturn???Error iokit_common_err(0x2dc) // ??? +#define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists +#define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down + // physical memory +#define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached +#define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued +#define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received + // on interrupt port +#define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted +#define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device +#define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present +#define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted +#define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode +#define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun +#define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun +#define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly! +#define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required +#define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted +#define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded +#define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding +#define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past! +#define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future +#define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found +#define kIOReturnInvalid iokit_common_err(0x1) // should never be seen + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IORETURN_H */ diff --git a/i386/include/IOKit/IOService.h b/i386/include/IOKit/IOService.h new file mode 100644 index 0000000..a965ea1 --- /dev/null +++ b/i386/include/IOKit/IOService.h @@ -0,0 +1,1690 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998,1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ +/*! + @header + This header contains the definition of the IOService class. IOService is the sole direct subclass of IORegistryEntry and is the base class of almost all I/O Kit family superclasses. IOService defines methods that support the life cycle of I/O Kit drivers. For more information on IOService, see {@linkdoc //apple_ref/doc/uid/TP0000011 I/O Kit Fundamentals}. + + @seealso //apple_ref/doc/header/IORegistryEntry.h IORegistryEntry +*/ + +#ifndef _IOKIT_IOSERVICE_H +#define _IOKIT_IOSERVICE_H + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +extern "C" { +#include +} + +#ifndef UINT64_MAX +#define UINT64_MAX 18446744073709551615ULL +#endif + +enum { + kIODefaultProbeScore = 0 +}; + +// masks for getState() +enum { + kIOServiceInactiveState = 0x00000001, + kIOServiceRegisteredState = 0x00000002, + kIOServiceMatchedState = 0x00000004, + kIOServiceFirstPublishState = 0x00000008, + kIOServiceFirstMatchState = 0x00000010 +}; + +enum { + // options for registerService() + kIOServiceExclusive = 0x00000001, + + // options for terminate() + kIOServiceRequired = 0x00000001, + kIOServiceTerminate = 0x00000004, + + // options for registerService() & terminate() + kIOServiceSynchronous = 0x00000002, + // options for registerService() + kIOServiceAsynchronous = 0x00000008 +}; + +// options for open() +enum { + kIOServiceSeize = 0x00000001, + kIOServiceFamilyOpenOptions = 0xffff0000 +}; + +// options for close() +enum { + kIOServiceFamilyCloseOptions = 0xffff0000 +}; + +typedef void * IONotificationRef; + +extern const IORegistryPlane * gIOServicePlane; +extern const IORegistryPlane * gIOPowerPlane; + +extern const OSSymbol * gIOResourcesKey; +extern const OSSymbol * gIOResourceMatchKey; +extern const OSSymbol * gIOProviderClassKey; +extern const OSSymbol * gIONameMatchKey; +extern const OSSymbol * gIONameMatchedKey; +extern const OSSymbol * gIOPropertyMatchKey; +extern const OSSymbol * gIOLocationMatchKey; +extern const OSSymbol * gIOParentMatchKey; +extern const OSSymbol * gIOPathMatchKey; +extern const OSSymbol * gIOMatchCategoryKey; +extern const OSSymbol * gIODefaultMatchCategoryKey; +extern const OSSymbol * gIOMatchedServiceCountKey; + +extern const OSSymbol * gIOUserClientClassKey; +extern const OSSymbol * gIOKitDebugKey; +extern const OSSymbol * gIOServiceKey; + +extern const OSSymbol * gIOCommandPoolSizeKey; + +extern const OSSymbol * gIOPublishNotification; +extern const OSSymbol * gIOFirstPublishNotification; +extern const OSSymbol * gIOMatchedNotification; +extern const OSSymbol * gIOFirstMatchNotification; +extern const OSSymbol * gIOTerminatedNotification; + +extern const OSSymbol * gIOGeneralInterest; +extern const OSSymbol * gIOBusyInterest; +extern const OSSymbol * gIOOpenInterest; +extern const OSSymbol * gIOAppPowerStateInterest; +extern const OSSymbol * gIOPriorityPowerStateInterest; + +extern const OSSymbol * gIODeviceMemoryKey; +extern const OSSymbol * gIOInterruptControllersKey; +extern const OSSymbol * gIOInterruptSpecifiersKey; + +extern SInt32 IOServiceOrdering( const OSMetaClassBase * inObj1, const OSMetaClassBase * inObj2, void * ref ); + +typedef void (*IOInterruptAction)( OSObject * target, void * refCon, + IOService * nub, int source ); + +/*! @typedef IOServiceNotificationHandler + @param target Reference supplied when the notification was registered. + @param refCon Reference constant supplied when the notification was registered. + @param newService The IOService object the notification is delivering. It is retained for the duration of the handler's invocation and doesn't need to be released by the handler. */ + +typedef bool (*IOServiceNotificationHandler)( void * target, void * refCon, + IOService * newService ); + +typedef bool (*IOServiceMatchingNotificationHandler)( void * target, void * refCon, + IOService * newService, + IONotifier * notifier ); + +/*! @typedef IOServiceInterestHandler + @param target Reference supplied when the notification was registered. + @param refCon Reference constant supplied when the notification was registered. + @param messageType Type of the message - IOKit defined in IOKit/IOMessage.h or family specific. + @param provider The IOService object who is delivering the notification. It is retained for the duration of the handler's invocation and doesn't need to be released by the handler. + @param messageArgument An argument for message, dependent on its type. + @param argSize Non zero if the argument represents a struct of that size, used when delivering messages outside the kernel. */ + +typedef IOReturn (*IOServiceInterestHandler)( void * target, void * refCon, + UInt32 messageType, IOService * provider, + void * messageArgument, vm_size_t argSize ); + +typedef void (*IOServiceApplierFunction)(IOService * service, void * context); +typedef void (*OSObjectApplierFunction)(OSObject * object, void * context); + +class IOUserClient; +class IOPlatformExpert; + +/*! @class IOService + @abstract The base class for most I/O Kit families, devices, and drivers. + @discussion The IOService base class defines APIs used to publish services, instantiate other services based on the existance of a providing service (ie. driver stacking), destroy a service and its dependent stack, notify interested parties of service state changes, and general utility functions useful across all families. + +Types of service are specified with a matching dictionary that describes properties of the service. For example, a matching dictionary might describe any IOUSBDevice (or subclass), an IOUSBDevice with a certain class code, or a IOPCIDevice with a set of OpenFirmware matching names or device & vendor IDs. Since the matching dictionary is interpreted by the family which created the service, as well as generically by IOService, the list of properties considered for matching depends on the familiy. + +Matching dictionaries are associated with IOService classes by the catalogue, as driver property tables, and also supplied by clients of the notification APIs. + +IOService provides matching based on C++ class (via OSMetaClass dynamic casting), registry entry name, a registry path to the service (which includes OpenFirmware paths), a name assigned by BSD, or by its location (its point of attachment). + +

Driver Instantiation by IOService

+ +Drivers are subclasses of IOService, and their availability is managed through the catalogue. They are instantiated based on the publication of an IOService they use (for example, an IOPCIDevice or IOUSBDevice), or when they are added to the catalogue and the IOService(s) they use are already available. + +When an IOService (the "provider") is published with the @link registerService registerService@/link method, the matching and probing process begins, which is always single threaded per provider. A list of matching dictionaries from the catalog and installed publish notification requests, that successfully match the IOService, is constructed, with ordering supplied by kIOProbeScoreKey ("IOProbeScore") property in the dictionary, or supplied with the notification. + +Each entry in the list is then processed in order - for notifications, the notification is delivered, for driver property tables a lot more happens. + +The driver class is instantiated and init() called with its property table. The new driver instance is then attached to the provider, and has its @link probe probe@/link method called with the provider as an argument. The default probe method does nothing but return success, but a driver may implement this method to interrogate the provider to make sure it can work with it. It may also modify its probe score at this time. After probe, the driver is detached and the next in the list is considered (ie. attached, probed, and detached). + +When the probing phase is complete, the list consists of successfully probed drivers, in order of their probe score (after adjustment during the @link probe probe@/link call). The list is then divided into categories based on the kIOMatchCategoryKey property ("IOMatchCategory"); drivers without a match category are all considered in one default category. Match categories allow multiple clients of a provider to be attached and started, though the provider may also enforce open/close semantics to gain active access to it. + +For each category, the highest scoring driver in that category is attached to the provider, and its @link start start@/link method called. If start is successful, the rest of the drivers in the same match category are discarded, otherwise the next highest scoring driver is started, and so on. + +The driver should only consider itself in action when the start method is called, meaning it has been selected for use on the provider, and consuming that particular match category. It should also be prepared to be allocated, probed and freed even if the probe was successful. + +After the drivers have all synchronously been started, the installed "matched" notifications that match the registered IOService are delivered. + +

Properties used by IOService

+ + kIOClassKey, extern const OSSymbol * gIOClassKey, "IOClass" +
+
+Class of the driver to instantiate on matching providers. +
+
+ kIOProviderClassKey, extern const OSSymbol * gIOProviderClassKey, "IOProviderClass" +
+
+Class of the provider(s) to be considered for matching, checked with OSDynamicCast so subclasses will also match. +
+
+ kIOProbeScoreKey, extern const OSSymbol * gIOProbeScoreKey, "IOProbeScore" +
+
+The probe score initially used to order multiple matching drivers. +
+
+ kIOMatchCategoryKey, extern const OSSymbol * gIOMatchCategoryKey, "IOMatchCategory" +
+
+A string defining the driver category for matching purposes. All drivers with no IOMatchCategory property are considered to be in the same default category. Only one driver in a category can be started on each provider. +
+
+ kIONameMatchKey, extern const OSSymbol * gIONameMatchKey, "IONameMatch" +
+A string or collection of strings that match the provider's name. The comparison is implemented with the @link //apple_ref/cpp/instm/IORegistryEntry/compareNames/virtualbool/(OSObject*,OSString**) IORegistryEntry::compareNames@/link method, which supports a single string, or any collection (OSArray, OSSet, OSDictionary etc.) of strings. IOService objects with OpenFirmware device tree properties (eg. IOPCIDevice) will also be matched based on that standard's "compatible", "name", "device_type" properties. The matching name will be left in the driver's property table in the kIONameMatchedKey property. +
+Examples +

+@textblock
+	IONameMatch
+	pci106b,7
+@/textblock
+
+ +For a list of possible matching names, a serialized array of strings should used, eg. +
+@textblock
+	IONameMatch
+	
+		APPL,happy16
+		pci106b,7
+	
+@/textblock
+
+ +
+ kIONameMatchedKey, extern const OSSymbol * gIONameMatchedKey, "IONameMatched" +
+The name successfully matched name from the kIONameMatchKey property will be left in the driver's property table as the kIONameMatchedKey property. +
+
+ kIOPropertyMatchKey, extern const OSSymbol * gIOPropertyMatchKey, "IOPropertyMatch" +
+A dictionary of properties that each must exist in the matching IOService and compare successfully with the isEqualTo method. + +
+@textblock
+	IOPropertyMatch
+	
+		APPL,happy16
+		APPL,meek8
+	
+@/textblock
+
+ +
+ kIOUserClientClassKey, extern const OSSymbol * gIOUserClientClassKey, "IOUserClientClass" +
+The class name that the service will attempt to allocate when a user client connection is requested. First the device nub is queried, then the nub's provider is queried by default. +
+
+ kIOKitDebugKey, extern const OSSymbol * gIOKitDebugKey, "IOKitDebug" +
+Set some debug flags for logging the driver loading process. Flags are defined in IOKit/IOKitDebug.h, but 65535 works well.*/ + +class IOService : public IORegistryEntry +{ + OSDeclareDefaultStructors(IOService) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + IOService * __provider; + SInt32 __providerGeneration; + IOService * __owner; + IOOptionBits __state[2]; + uint64_t __timeBusy; + uint64_t __accumBusy; + IOServicePM * pwrMgt; + +protected: + // TRUE once PMinit has been called + bool initialized; + +public: + // DEPRECATED + void * pm_vars; + +public: + /* methods available in Mac OS X 10.1 or later */ +/*! @function requestTerminate + @abstract Passes a termination up the stack. + @discussion When an IOService is made inactive the default behavior is to also make any of its clients that have it as their only provider also inactive, in this way recursing the termination up the driver stack. This method allows an IOService object to override this behavior. Returning true from this method when passed a just terminated provider will cause the client to also be terminated. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate, plus kIOServiceRecursing. + @result true if this object should be terminated now that its provider has been. */ + + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + +/*! @function willTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent before recursing up the stack, in root-to-leaf order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate. + @result true. */ + + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + +/*! @function didTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent after recursing up the stack, in leaf-to-root order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate. + @param defer If there is pending I/O that requires this object to persist, and the provider is not opened by this object set defer to true and call the IOService::didTerminate() implementation when the I/O completes. Otherwise, leave defer set to its default value of false. + @result true. */ + + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + +/*! @function nextIdleTimeout + @availability Mac OS X v10.4 and later + @abstract Allows subclasses to customize idle power management behavior. + @discussion Returns the next time that the device should idle into its next lower power state. Subclasses may override for custom idle behavior. + + A power managed driver might override this method to provide a more sophisticated idle power off algorithm than the one defined by power management. + @param currentTime The current time + @param lastActivity The time of last activity on this device + @param powerState The device's current power state. + @result Returns the next time the device should idle off (in seconds, relative to the current time). */ + + virtual SInt32 nextIdleTimeout(AbsoluteTime currentTime, + AbsoluteTime lastActivity, unsigned int powerState); + +/*! @function systemWillShutdown + @availability Mac OS X v10.5 and later + @abstract Notifies members of the power plane of system shutdown and restart. + @discussion This function is called for all members of the power plane in leaf-to-root order. If a subclass needs to wait for a pending I/O, then the call to systemWillShutdown should be postponed until the I/O completes. + + Any power managed driver (which has called @link joinPMtree joinPMtree@/link to join the power plane) interested in taking action at system shutdown or restart should override this method. + @param specifier kIOMessageSystemWillPowerOff or kIOMessageSystemWillRestart. */ + + virtual void systemWillShutdown( IOOptionBits specifier ); + +/*! @function copyClientWithCategory + @availability Mac OS X v10.6 and later + @param category An OSSymbol corresponding to an IOMatchCategory matching property. + @result Returns a reference to the IOService child with the given category. The result should be released by the caller. +*/ + + virtual IOService * copyClientWithCategory( const OSSymbol * category ); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOService, 0); + OSMetaClassDeclareReservedUnused(IOService, 1); + OSMetaClassDeclareReservedUnused(IOService, 2); + OSMetaClassDeclareReservedUnused(IOService, 3); + OSMetaClassDeclareReservedUnused(IOService, 4); + OSMetaClassDeclareReservedUnused(IOService, 5); +#else + OSMetaClassDeclareReservedUsed(IOService, 0); + OSMetaClassDeclareReservedUsed(IOService, 1); + OSMetaClassDeclareReservedUsed(IOService, 2); + OSMetaClassDeclareReservedUsed(IOService, 3); + OSMetaClassDeclareReservedUsed(IOService, 4); + OSMetaClassDeclareReservedUsed(IOService, 5); +#endif + + OSMetaClassDeclareReservedUnused(IOService, 6); + OSMetaClassDeclareReservedUnused(IOService, 7); + OSMetaClassDeclareReservedUnused(IOService, 8); + OSMetaClassDeclareReservedUnused(IOService, 9); + OSMetaClassDeclareReservedUnused(IOService, 10); + OSMetaClassDeclareReservedUnused(IOService, 11); + OSMetaClassDeclareReservedUnused(IOService, 12); + OSMetaClassDeclareReservedUnused(IOService, 13); + OSMetaClassDeclareReservedUnused(IOService, 14); + OSMetaClassDeclareReservedUnused(IOService, 15); + OSMetaClassDeclareReservedUnused(IOService, 16); + OSMetaClassDeclareReservedUnused(IOService, 17); + OSMetaClassDeclareReservedUnused(IOService, 18); + OSMetaClassDeclareReservedUnused(IOService, 19); + OSMetaClassDeclareReservedUnused(IOService, 20); + OSMetaClassDeclareReservedUnused(IOService, 21); + OSMetaClassDeclareReservedUnused(IOService, 22); + OSMetaClassDeclareReservedUnused(IOService, 23); + OSMetaClassDeclareReservedUnused(IOService, 24); + OSMetaClassDeclareReservedUnused(IOService, 25); + OSMetaClassDeclareReservedUnused(IOService, 26); + OSMetaClassDeclareReservedUnused(IOService, 27); + OSMetaClassDeclareReservedUnused(IOService, 28); + OSMetaClassDeclareReservedUnused(IOService, 29); + OSMetaClassDeclareReservedUnused(IOService, 30); + OSMetaClassDeclareReservedUnused(IOService, 31); + OSMetaClassDeclareReservedUnused(IOService, 32); + OSMetaClassDeclareReservedUnused(IOService, 33); + OSMetaClassDeclareReservedUnused(IOService, 34); + OSMetaClassDeclareReservedUnused(IOService, 35); + OSMetaClassDeclareReservedUnused(IOService, 36); + OSMetaClassDeclareReservedUnused(IOService, 37); + OSMetaClassDeclareReservedUnused(IOService, 38); + OSMetaClassDeclareReservedUnused(IOService, 39); + OSMetaClassDeclareReservedUnused(IOService, 40); + OSMetaClassDeclareReservedUnused(IOService, 41); + OSMetaClassDeclareReservedUnused(IOService, 42); + OSMetaClassDeclareReservedUnused(IOService, 43); + OSMetaClassDeclareReservedUnused(IOService, 44); + OSMetaClassDeclareReservedUnused(IOService, 45); + OSMetaClassDeclareReservedUnused(IOService, 46); + OSMetaClassDeclareReservedUnused(IOService, 47); + +#ifdef __ppc__ + OSMetaClassDeclareReservedUnused(IOService, 48); + OSMetaClassDeclareReservedUnused(IOService, 49); + OSMetaClassDeclareReservedUnused(IOService, 50); + OSMetaClassDeclareReservedUnused(IOService, 51); + OSMetaClassDeclareReservedUnused(IOService, 52); + OSMetaClassDeclareReservedUnused(IOService, 53); + OSMetaClassDeclareReservedUnused(IOService, 54); + OSMetaClassDeclareReservedUnused(IOService, 55); + OSMetaClassDeclareReservedUnused(IOService, 56); + OSMetaClassDeclareReservedUnused(IOService, 57); + OSMetaClassDeclareReservedUnused(IOService, 58); + OSMetaClassDeclareReservedUnused(IOService, 59); + OSMetaClassDeclareReservedUnused(IOService, 60); + OSMetaClassDeclareReservedUnused(IOService, 61); + OSMetaClassDeclareReservedUnused(IOService, 62); + OSMetaClassDeclareReservedUnused(IOService, 63); +#endif + +public: +/*! @function getState + @abstract Accessor for IOService state bits, not normally needed or used outside IOService. + @result State bits for the IOService, eg. kIOServiceInactiveState, kIOServiceRegisteredState. */ + + virtual IOOptionBits getState( void ) const; + +/*! @function isInactive + @abstract Checks if the IOService object has been terminated, and is in the process of being destroyed. + @discussion When an IOService object is successfully terminated, it is immediately made inactive, which blocks further attach()es, matching or notifications occuring on the object. It remains inactive until the last client closes, and is then finalized and destroyed. + @result true if the IOService object has been terminated. */ + + bool isInactive( void ) const; + + /* Stack creation */ + +/*! @function registerService + @abstract Starts the registration process for a newly discovered IOService object. + @discussion This function allows an IOService subclass to be published and made available to possible clients, by starting the registration process and delivering notifications to registered clients. The object should be completely setup and ready to field requests from clients before registerService is called. + @param options The default zero options mask is recommended and should be used in most cases. The registration process is usually asynchronous, with possible driver probing and notification occurring some time later. kIOServiceSynchronous may be passed to carry out the matching and notification process for currently registered clients before returning to the caller. */ + + virtual void registerService( IOOptionBits options = 0 ); + +/*! @function probe + @abstract During an IOService object's instantiation, probes a matched service to see if it can be used. + @discussion The registration process for an IOService object (the provider) includes instantiating possible driver clients. The probe method is called in the client instance to check the matched service can be used before the driver is considered to be started. Since matching screens many possible providers, in many cases the probe method can be left unimplemented by IOService subclasses. The client is already attached to the provider when probe is called. + @param provider The registered IOService object that matches a driver personality's matching dictionary. + @param score Pointer to the current driver's probe score, which is used to order multiple matching drivers in the same match category. It defaults to the value of the IOProbeScore property in the drivers property table, or kIODefaultProbeScore if none is specified. The probe method may alter the score to affect start order. + @result An IOService instance or zero when the probe is unsuccessful. In almost all cases the value of this is returned on success. If another IOService object is returned, the probed instance is detached and freed, and the returned instance is used in its stead for start. */ + + virtual IOService * probe( IOService * provider, + SInt32 * score ); + +/*! @function start + @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + @discussion The start method of an IOService instance is called by its provider when it has been selected (due to its probe score and match category) as the winning client. The client is already attached to the provider when start is called.
Implementations of start must call start on their superclass at an appropriate point. If an implementation of start has already called super::start but subsequently determines that it will fail, it must call super::stop to balance the prior call to super::start and prevent reference leaks. + @result true if the start was successful; false otherwise (which will cause the instance to be detached and usually freed). */ + + virtual bool start( IOService * provider ); + +/*! @function stop + @abstract During an IOService termination, the stop method is called in its clients before they are detached & it is destroyed. + @discussion The termination process for an IOService (the provider) will call stop in each of its clients, after they have closed the provider if they had it open, or immediately on termination. */ + + virtual void stop( IOService * provider ); + + /* Open / Close */ + +/*! @function open + @abstract Requests active access to a provider. + @discussion IOService provides generic open and close semantics to track clients of a provider that have established an active datapath. The use of open and @link close close@/link, and rules regarding ownership are family defined, and defined by the @link handleOpen handleOpen@/link and @link handleClose handleClose@/link methods in the provider. Some families will limit access to a provider based on its open state. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open. The provider family may implement options for open; IOService defines only kIOServiceSeize to request the device be withdrawn from its current owner. + @result true if the open was successful; false otherwise. */ + + virtual bool open( IOService * forClient, + IOOptionBits options = 0, + void * arg = 0 ); + +/*! @function close + @abstract Releases active access to a provider. + @discussion IOService provides generic open and close semantics to track clients of a provider that have established an active datapath. The use of @link open open@/link and close, and rules regarding ownership are family defined, and defined by the @link handleOpen handleOpen@/link and @link handleClose handleClose@/link methods in the provider. + @param forClient Designates the client of the provider requesting the close. + @param options Options available for the close. The provider family may implement options for close; IOService defines none. + @param arg Family specific arguments which are ignored by IOService. */ + + virtual void close( IOService * forClient, + IOOptionBits options = 0 ); + +/*! @function isOpen + @abstract Determines whether a specific, or any, client has an IOService object open. + @discussion Returns the open state of an IOService object with respect to the specified client, or when it is open by any client. + @param forClient If non-zero, open. The object is locked via @link lockForArbitration lockForArbitration@/link before handleOpen is called. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result trueif the open was successful; false otherwise. */ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + +/*! @function handleClose + @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + @discussion IOService calls this method in its subclasses in response to the @link close close@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via @link open open@/link. The object is locked via @link lockForArbitration lockForArbitration@/link before handleClose is called. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of @link handleOpen handleOpen@/link. */ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + +/*! @function handleIsOpen + @abstract Controls the open / close behavior of an IOService object (overrideable by subclasses). + @discussion IOService calls this method in its subclasses in response to the @link open open@/link method, so the subclass may implement the request. The default implementation provides single owner access to an IOService object via @link open open@/link. The object is locked via @link lockForArbitration lockForArbitration@/link before handleIsOpen is called. + @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + @result true if the specific, or any, client has the IOService object open. */ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + /* Stacking change */ + +/*! @function terminate + @abstract Makes an IOService object inactive and begins its destruction. + @discussion Registering an IOService object informs possible clients of its existance and instantiates drivers that may be used with it; terminate involves the opposite process of informing clients that an IOService object is no longer able to be used and will be destroyed. By default, if any client has the service open, terminate fails. If the kIOServiceRequired flag is passed however, terminate will be successful though further progress in the destruction of the IOService object will not proceed until the last client has closed it. The service will be made inactive immediately upon successful termination, and all its clients will be notified via their @link message message@/link method with a message of type kIOMessageServiceIsTerminated. Both these actions take place on the caller's thread. After the IOService object is made inactive, further matching or attach calls will fail on it. Each client has its @link stop stop@/link method called upon their close of an inactive IOService object , or on its termination if they do not have it open. After stop, @link detach detach@/link is called in each client. When all clients have been detached, the @link finalize finalize@/link method is called in the inactive service. The termination process is inherently asynchronous because it will be deferred until all clients have chosen to close. + @param options In most cases no options are needed. kIOServiceSynchronous may be passed to cause terminate to not return until the service is finalized. */ + + virtual bool terminate( IOOptionBits options = 0 ); + +/*! @function finalize + @abstract Finalizes the destruction of an IOService object. + @discussion The finalize method is called in an inactive (ie. terminated) IOService object after the last client has detached. IOService's implementation will call @link stop stop@/link, @link close close@/link, and @link detach detach@/link on each provider. When finalize returns, the object's retain count will have no references generated by IOService's registration process. + @param options The options passed to the @link terminate terminate@/link method of the IOService object are passed on to finalize. + @result true. */ + + virtual bool finalize( IOOptionBits options ); + +/*! @function free + @abstract Frees data structures that were allocated when power management was initialized on this service. */ + + virtual void free( void ); + +/*! @function lockForArbitration + @abstract Locks an IOService object against changes in state or ownership. + @discussion The registration, termination and open / close functions of IOService use lockForArbtration to single-thread access to an IOService object. lockForArbitration grants recursive access to the same thread. + @param isSuccessRequired If a request for access to an IOService object should be denied if it is terminated, pass false, otherwise pass true. */ + + virtual bool lockForArbitration( bool isSuccessRequired = true ); + +/*! @function unlockForArbitration + @abstract Unlocks an IOService obkect after a successful @link lockForArbitration lockForArbitration@/link. + @discussion A thread granted exclusive access to an IOService object should release it with unlockForArbitration. */ + + virtual void unlockForArbitration( void ); + +/*! @function terminateClient + @abstract Passes a termination up the stack. + @discussion When an IOService object is made inactive the default behavior is to also make any of its clients that have it as their only provider inactive, in this way recursing the termination up the driver stack. This method allows a terminated IOService object to override this behavior. Note the client may also override this behavior by overriding its @link terminate terminate@/link method. + @param client The client of the terminated provider. + @param options Options originally passed to @link terminate terminate@/link, plus kIOServiceRecursing. + @result result of the terminate request on the client. */ + + virtual bool terminateClient( IOService * client, IOOptionBits options ); + + /* Busy state indicates discovery, matching or termination is in progress */ + +/*! @function getBusyState + @abstract Returns the busyState of an IOService object. + @discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService object, its busyState is increased by one. Change in busyState to or from zero also changes the IOService object's provider's busyState by one, which means that an IOService object is marked busy when any of the above activities is ocurring on it or any of its clients. + @result The busyState value. */ + + virtual UInt32 getBusyState( void ); + +/*! @function adjustBusy + @abstract Adjusts the busyState of an IOService object. + @discussion Applies a delta to an IOService object's busyState. A change in the busyState to or from zero will change the IOService object's provider's busyState by one (in the same direction). + @param delta The delta to be applied to the IOService object's busyState. */ + + virtual void adjustBusy( SInt32 delta ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn waitQuiet(mach_timespec_t * timeout) + APPLE_KEXT_DEPRECATED; + +/*! @function waitQuiet + @abstract Waits for an IOService object's busyState to be zero. + @discussion Blocks the caller until an IOService object is non busy. + @param timeout The maximum time to wait in nanoseconds. Default is to wait forever. + @result Returns an error code if Mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. */ + + IOReturn waitQuiet(uint64_t timeout = UINT64_MAX); + + /* Matching */ + +/*! @function matchPropertyTable + @abstract Allows a registered IOService object to implement family specific matching. + @discussion All matching on an IOService object will call this method to allow a family writer to implement matching in addition to the generic methods provided by IOService. The implementer should examine the matching dictionary passed to see if it contains properties the family understands for matching, and use them to match with the IOService object if so. Note that since matching is also carried out by other parts of the I/O Kit, the matching dictionary may contain properties the family does not understand - these should not be considered matching failures. + @param table The dictionary of properties to be matched against. + @param score Pointer to the current driver's probe score, which is used to order multiple matching drivers in the same match category. It defaults to the value of the IOProbeScore property in the drivers property table, or kIODefaultProbeScore if none is specified. + @result false if the family considers the matching dictionary does not match in properties it understands; true otherwise. */ + + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + + virtual bool matchPropertyTable( OSDictionary * table ); + +/*! @function matchLocation + @abstract Allows a registered IOService object to direct location matching. + @discussion By default, a location matching property will be applied to an IOService object's provider. This method allows that behavior to be overridden by families. + @param client The IOService object at which matching is taking place. + @result Returns the IOService instance to be used for location matching. */ + + virtual IOService * matchLocation( IOService * client ); + + /* Resource service */ + +/*! @function publishResource + @abstract Uses the resource service to publish a property. + @discussion The resource service uses IOService's matching and notification to allow objects to be published and found by any I/O Kit client by a global name. publishResource makes an object available to anyone waiting for it or looking for it in the future. + @param key An OSSymbol key that globally identifies the object. + @param The object to be published. */ + + static void publishResource( const OSSymbol * key, OSObject * value = 0 ); + +/*! @function publishResource + @abstract Uses the resource service to publish a property. + @discussion The resource service uses IOService object's matching and notification to allow objects to be published and found by any I/O Kit client by a global name. publishResource makes an object available to anyone waiting for it or looking for it in the future. + @param key A C string key that globally identifies the object. + @param The object to be published. */ + + static void publishResource( const char * key, OSObject * value = 0 ); + virtual bool addNeededResource( const char * key ); + + /* Notifications */ + +/*! @function addNotification + @abstract Deprecated use addMatchingNotification(). Adds a persistant notification handler to be notified of IOService events. + @discussion IOService will deliver notifications of changes in state of an IOService object to registered clients. The type of notification is specified by a symbol, for example gIOMatchedNotification or gIOTerminatedNotification, and notifications will only include IOService objects that match the supplied matching dictionary. Notifications are ordered by a priority set with addNotification. When the notification is installed, its handler will be called with each of any currently existing IOService objects that are in the correct state (eg. registered) and match the supplied matching dictionary, avoiding races between finding preexisting and new IOService events. The notification request is identified by an instance of an IONotifier object, through which it can be enabled, disabled, or removed. addNotification consumes a retain count on the matching dictionary when the notification is removed. + @param type An OSSymbol identifying the type of notification and IOService state: +
gIOPublishNotification Delivered when an IOService object is registered. +
gIOFirstPublishNotification Delivered when an IOService object is registered, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOMatchedNotification Delivered when an IOService object has been matched with all client drivers, and they have been probed and started. +
gIOFirstMatchNotification Delivered when an IOService object has been matched with all client drivers, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOTerminatedNotification Delivered after an IOService object has been terminated, during its finalize stage. + @param matching A matching dictionary to restrict notifications to only matching IOService objects. The dictionary will be released when the notification is removed, consuming the passed-in reference. + @param handler A C function callback to deliver notifications. + @param target An instance reference for the callback's use. + @param ref A reference constant for the callback's use. + @param priority A constant ordering all notifications of a each type. + @result An instance of an IONotifier object that can be used to control or destroy the notification request. */ + + static IONotifier * addNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceNotificationHandler handler, + void * target, void * ref = 0, + SInt32 priority = 0 ) + APPLE_KEXT_DEPRECATED; + +/*! @function addMatchingNotification + @abstract Adds a persistant notification handler to be notified of IOService events. + @discussion IOService will deliver notifications of changes in state of an IOService object to registered clients. The type of notification is specified by a symbol, for example gIOMatchedNotification or gIOTerminatedNotification, and notifications will only include IOService objects that match the supplied matching dictionary. Notifications are ordered by a priority set with addNotification. When the notification is installed, its handler will be called with each of any currently existing IOService objects that are in the correct state (eg. registered) and match the supplied matching dictionary, avoiding races between finding preexisting and new IOService events. The notification request is identified by an instance of an IONotifier object, through which it can be enabled, disabled, or removed. addMatchingNotification does not consume a reference on the matching dictionary when the notification is removed, unlike addNotification. + @param type An OSSymbol identifying the type of notification and IOService state: +
gIOPublishNotification Delivered when an IOService object is registered. +
gIOFirstPublishNotification Delivered when an IOService object is registered, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOMatchedNotification Delivered when an IOService object has been matched with all client drivers, and they have been probed and started. +
gIOFirstMatchNotification Delivered when an IOService object has been matched with all client drivers, but only once per IOService instance. Some IOService objects may be reregistered when their state is changed. +
gIOTerminatedNotification Delivered after an IOService object has been terminated, during its finalize stage. + @param matching A matching dictionary to restrict notifications to only matching IOService objects. The dictionary is retained while the notification is installed. (Differs from addNotification). + @param handler A C function callback to deliver notifications. + @param target An instance reference for the callback's use. + @param ref A reference constant for the callback's use. + @param priority A constant ordering all notifications of a each type. + @result An instance of an IONotifier object that can be used to control or destroy the notification request. */ + + static IONotifier * addMatchingNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref = 0, + SInt32 priority = 0 ); + +/*! @function waitForService + @abstract Deprecated use waitForMatchingService(). Waits for a matching to service to be published. + @discussion Provides a method of waiting for an IOService object matching the supplied matching dictionary to be registered and fully matched. + @param matching The matching dictionary describing the desired IOService object. waitForService consumes one reference of the matching dictionary. + @param timeout The maximum time to wait. + @result A published IOService object matching the supplied dictionary. */ + + static IOService * waitForService( OSDictionary * matching, + mach_timespec_t * timeout = 0); + +/*! @function waitForMatchingService + @abstract Waits for a matching to service to be published. + @discussion Provides a method of waiting for an IOService object matching the supplied matching dictionary to be registered and fully matched. + @param matching The matching dictionary describing the desired IOService object. (Does not consume a reference of the matching dictionary - differs from waitForService() which does consume a reference on the matching dictionary.) + @param timeout The maximum time to wait in nanoseconds. Default is to wait forever. + @result A published IOService object matching the supplied dictionary. waitForMatchingService returns a reference to the IOService which should be released by the caller. (Differs from waitForService() which does not retain the returned object.) */ + + static IOService * waitForMatchingService( OSDictionary * matching, + uint64_t timeout = UINT64_MAX); + +/*! @function getMatchingServices + @abstract Finds the set of current published IOService objects matching a matching dictionary. + @discussion Provides a method of finding the current set of published IOService objects matching the supplied matching dictionary. + @param matching The matching dictionary describing the desired IOService objects. + @result An instance of an iterator over a set of IOService objects. To be released by the caller. */ + + static OSIterator * getMatchingServices( OSDictionary * matching ); + +public: + /* Helpers to make matching dictionaries for simple cases, + * they add keys to an existing dictionary, or create one. */ + +/*! @function serviceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService class match. + @discussion A very common matching criteria for IOService object is based on its class. serviceMatching creates a matching dictionary that specifies any IOService object of a class, or its subclasses. The class is specified by name, and an existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param className The class name, as a const C string. Class matching is successful on IOService objects of this class or any subclass. + @param table If zero, serviceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * serviceMatching( const char * className, + OSDictionary * table = 0 ); + +/*! @function serviceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService class match. + @discussion A very common matching criteria for IOService object is based on its class. serviceMatching creates a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by name, and an existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param className The class name, as an OSString (which includes OSSymbol). Class matching is successful on IOService objects of this class or any subclass. + @param table If zero, serviceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * serviceMatching( const OSString * className, + OSDictionary * table = 0 ); + +/*! @function nameMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService name match. + @discussion A very common matching criteria for IOService object is based on its name. nameMatching creates a matching dictionary that specifies any IOService object which responds successfully to the @link //apple_ref/cpp/instm/IORegistryEntry/compareName/virtualbool/(OSString*,OSString**) IORegistryEntry::compareName@/link method. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param name The service's name, as a const C string. Name matching is successful on IOService objects that respond successfully to the IORegistryEntry::compareName method. + @param table If zero, nameMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * nameMatching( const char * name, + OSDictionary * table = 0 ); + +/*! @function nameMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService name match. + @discussion A very common matching criteria for IOService object is based on its name. nameMatching creates a matching dictionary that specifies any IOService object which responds successfully to the @link //apple_ref/cpp/instm/IORegistryEntry/compareName/virtualbool/(OSString*,OSString**) IORegistryEntry::compareName@/link method. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param name The service's name, as an OSString (which includes OSSymbol). Name matching is successful on IOService objects that respond successfully to the IORegistryEntry::compareName method. + @param table If zero, nameMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * nameMatching( const OSString* name, + OSDictionary * table = 0 ); + +/*! @function resourceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a resource service match. + @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + @param name The resource name, as a const C string. Resource matching is successful when an object by that name has been published with the publishResource method. + @param table If zero, resourceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * resourceMatching( const char * name, + OSDictionary * table = 0 ); + +/*! @function resourceMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a resource service match. + @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + @param name The resource name, as an OSString (which includes OSSymbol). Resource matching is successful when an object by that name has been published with the publishResource method. + @param table If zero, resourceMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * resourceMatching( const OSString * name, + OSDictionary * table = 0 ); + + +/*! @function propertyMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify an IOService phandle match. + @discussion TODO A very common matching criteria for IOService is based on its name. nameMatching will create a matching dictionary that specifies any IOService which respond successfully to the IORegistryEntry method compareName. An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param key The service's phandle, as a const UInt32. PHandle matching is successful on IOService objects that respond successfully to the IORegistryEntry method compareName. + @param value The service's phandle, as a const UInt32. PHandle matching is successful on IOService's which respond successfully to the IORegistryEntry method compareName. + @param table If zero, nameMatching will create a matching dictionary and return a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * propertyMatching( const OSSymbol * key, const OSObject * value, + OSDictionary * table = 0 ); + +/*! @function registryEntryIDMatching + @abstract Creates a matching dictionary, or adds matching properties to an existing dictionary, that specify a IORegistryEntryID match. + @discussion registryEntryIDMatching creates a matching dictionary that specifies the IOService object with the assigned registry entry ID (returned by IORegistryEntry::getRegistryEntryID()). An existing dictionary may be passed in, in which case the matching properties will be added to that dictionary rather than creating a new one. + @param name The service's ID. Matching is successful on the IOService object that return that ID from the IORegistryEntry::getRegistryEntryID() method. + @param table If zero, registryEntryIDMatching creates a matching dictionary and returns a reference to it, otherwise the matching properties are added to the specified dictionary. + @result The matching dictionary created, or passed in, is returned on success, or zero on failure. */ + + static OSDictionary * registryEntryIDMatching( uint64_t entryID, + OSDictionary * table = 0 ); + + +/*! @function addLocation + @abstract Adds a location matching property to an existing dictionary. + @discussion This function creates matching properties that specify the location of a IOService object, as an embedded matching dictionary. This matching will be successful on an IOService object that attached to an IOService object which matches this location matching dictionary. + @param table The matching properties are added to the specified dictionary, which must be non-zero. + @result The location matching dictionary created is returned on success, or zero on failure. */ + + static OSDictionary * addLocation( OSDictionary * table ); + + /* Helpers for matching dictionaries. */ + +/*! @function compareProperty + @abstract Compares a property in a matching dictionary with an IOService object's property table. + @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. If the property specified by key exists in the matching dictionary, it is compared with a property of the same name in the IOService object's property table. The comparison is performed with the isEqualTo method. If the property does not exist in the matching table, success is returned. If the property exists in the matching dictionary but not the IOService property table, failure is returned. + @param matching The matching dictionary, which must be non-zero. + @param key The dictionary key specifying the property to be compared, as a C string. + @result true if the property does not exist in the matching table. If the property exists in the matching dictionary but not the IOService property table, failure is returned. Otherwise the result of calling the property from the matching dictionary's isEqualTo method with the IOService property as an argument is returned. */ + + virtual bool compareProperty( OSDictionary * matching, + const char * key ); +/*! @function compareProperty + @abstract Compares a property in a matching dictionary with an IOService object's property table. + @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. If the property specified by key exists in the matching dictionary, it is compared with a property of the same name in the IOService object's property table. The comparison is performed with the isEqualTo method. If the property does not exist in the matching table, success is returned. If the property exists in the matching dictionary but not the IOService property table, failure is returned. + @param matching The matching dictionary, which must be non-zero. + @param key The dictionary key specifying the property to be compared, as an OSString (which includes OSSymbol). + @result true if the property does not exist in the matching table. If the property exists in the matching dictionary but not the IOService property table, failure is returned. Otherwise the result of calling the property from the matching dictionary's isEqualTo method with the IOService property as an argument is returned. */ + + virtual bool compareProperty( OSDictionary * matching, + const OSString * key ); + +/*! @function compareProperties + @abstract Compares a set of properties in a matching dictionary with an IOService object's property table. + @discussion This is a helper function to aid in implementing @link matchPropertyTable matchPropertyTable@/link. A collection of dictionary keys specifies properties in a matching dictionary to be compared, with compareProperty, with an IOService object's property table, if compareProperty returns true for each key, success is returned; otherwise failure. + @param matching The matching dictionary, which must be non-zero. + @param keys A collection (eg. OSSet, OSArray, OSDictionary) which should contain OSStrings (or OSSymbols) that specify the property keys to be compared. + @result Success if compareProperty returns true for each key in the collection; otherwise failure. */ + + virtual bool compareProperties( OSDictionary * matching, + OSCollection * keys ); + + /* Client / provider accessors */ + +/*! @function attach + @abstract Attaches an IOService client to a provider in the I/O Registry. + @discussion This function called in an IOService client enters the client into the I/O Registry as a child of the provider in the service plane. The provider must be active or the attach will fail. Multiple attach calls to the same provider are no-ops and return success. A client may be attached to multiple providers. Entering an object into the I/O Registry retains both the client and provider until they are detached. + @param provider The IOService object which will serve as this object's provider. + @result false if the provider is inactive or on a resource failure; otherwise true. */ + + virtual bool attach( IOService * provider ); + +/*! @function detach + @abstract Detaches an IOService client from a provider in the I/O Registry. + @discussion This function called in an IOService client removes the client as a child of the provider in the service plane of the I/O Registry. If the provider is not a parent of the client this is a no-op, otherwise the I/O Registry releases both the client and provider. + @param provider The IOService object to detach from. */ + + virtual void detach( IOService * provider ); + +/*! @function getProvider + @abstract Returns an IOService object's primary provider. + @discussion This function called in an IOService client will return the provider to which it was first attached. Because the majority of IOService objects have only one provider, this is a useful simplification and also supports caching of the provider when the I/O Registry is unchanged. + @result The first provider of the client, or zero if the IOService object is not attached into the I/O Registry. The provider is retained while the client is attached, and should not be released by the caller. */ + + virtual IOService * getProvider( void ) const; + +/*! @function getWorkLoop + @abstract Returns the current work loop or provider->getWorkLoop. + @discussion This function returns a valid work loop that a client can use to add an IOCommandGate to. The intention is that an IOService client has data that needs to be protected but doesn't want to pay the cost of a dedicated thread. This data has to be accessed from a provider's call-out context as well. So to achieve both of these goals the client creates an IOCommandGate to lock access to his data but he registers it with the provider's work loop, i.e. the work loop which will make the completion call-outs. This avoids a potential deadlock because the work loop gate uses a recursive lock, which allows the same lock to be held multiple times by a single thread. + @result A work loop, either the current work loop or it walks up the @link getProvider getProvider@/link chain calling getWorkLoop. Eventually it will reach a valid work loop-based driver or the root of the I/O tree, where it will return a system-wide work loop. Returns 0 if it fails to find (or create) a work loop.*/ + + virtual IOWorkLoop * getWorkLoop() const; + +/*! @function getProviderIterator + @abstract Returns an iterator over an IOService object's providers. + @discussion For those few IOService objects that obtain service from multiple providers, this method supplies an iterator over a client's providers. + @result An iterator over the providers of the client, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getProviderIterator( void ) const; + +/*! @function getOpenProviderIterator + @abstract Returns an iterator over an client's providers that are currently opened by the client. + @discussion For those few IOService objects that obtain service from multiple providers, this method supplies an iterator over a client's providers, locking each in turn with @link lockForArbitration lockForArbitration@/link and returning those that have been opened by the client. + @result An iterator over the providers the client has open, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, and the current entry in the iteration is locked with lockForArbitration, protecting it from state changes. */ + + virtual OSIterator * getOpenProviderIterator( void ) const; + +/*! @function getClient + @abstract Returns an IOService object's primary client. + @discussion This function called in an IOService provider will return the first client to attach to it. For IOService objects which have only only one client, this may be a useful simplification. + @result The first client of the provider, or zero if the IOService object is not attached into the I/O Registry. The client is retained while it is attached, and should not be released by the caller. */ + + virtual IOService * getClient( void ) const; + +/*! @function getClientIterator + @abstract Returns an iterator over an IOService object's clients. + @discussion For IOService objects that may have multiple clients, this method supplies an iterator over a provider's clients. + @result An iterator over the clients of the provider, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, though they may no longer be attached during the iteration. */ + + virtual OSIterator * getClientIterator( void ) const; + +/*! @function getOpenClientIterator + @abstract Returns an iterator over a provider's clients that currently have opened the provider. + @discussion For IOService objects that may have multiple clients, this method supplies an iterator over a provider's clients, locking each in turn with @link lockForArbitration lockForArbitration@/link and returning those that have opened the provider. + @result An iterator over the clients that have opened the provider, or zero if there is a resource failure. The iterator must be released when the iteration is finished. All objects returned by the iteration are retained while the iterator is valid, and the current entry in the iteration is locked with lockForArbitration, protecting it from state changes. */ + + virtual OSIterator * getOpenClientIterator( void ) const; + +/*! @function callPlatformFunction + @abstract Calls the platform function with the given name. + @discussion The platform expert or other drivers may implement various functions to control hardware features. callPlatformFunction allows any IOService object to access these functions. Normally callPlatformFunction is called on a service's provider. The provider services the request or passes it to its provider. The system's IOPlatformExpert subclass catches functions it knows about and redirects them into other parts of the service plane. If the IOPlatformExpert subclass cannot execute the function, the base class is called. The IOPlatformExpert base class attempts to find a service to execute the function by looking up the function name in an IOResources name space. A service may publish a service using publishResource(functionName, this). If no service can be found to execute the function an error is returned. + @param functionName Name of the function to be called. When functionName is a C string, callPlatformFunction converts the C string to an OSSymbol and calls the OSSymbol version of callPlatformFunction. This process can block and should not be used from an interrupt context. + @param waitForFunction If true, callPlatformFunction will not return until the function has been called. + @result An IOReturn code; kIOReturnSuccess if the function was successfully executed, kIOReturnUnsupported if a service to execute the function could not be found. Other return codes may be returned by the function.*/ + + virtual IOReturn callPlatformFunction( const OSSymbol * functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + + virtual IOReturn callPlatformFunction( const char * functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + + + /* Some accessors */ + +/*! @function getPlatform + @abstract Returns a pointer to the platform expert instance for the computer. + @discussion This method provides an accessor to the platform expert instance for the computer. + @result A pointer to the IOPlatformExport instance. It should not be released by the caller. */ + + static IOPlatformExpert * getPlatform( void ); + +/*! @function getPMRootDomain + @abstract Returns a pointer to the power management root domain instance for the computer. + @discussion This method provides an accessor to the power management root domain instance for the computer. + @result A pointer to the power management root domain instance. It should not be released by the caller. */ + + static class IOPMrootDomain * getPMRootDomain( void ); + +/*! @function getServiceRoot + @abstract Returns a pointer to the root of the service plane. + @discussion This method provides an accessor to the root of the service plane for the computer. + @result A pointer to the IOService instance at the root of the service plane. It should not be released by the caller. */ + + static IOService * getServiceRoot( void ); + +/*! @function getResourceService + @abstract Returns a pointer to the IOResources service. + @discussion IOService maintains a resource service IOResources that allows objects to be published and found globally in the I/O Kit based on a name, using the standard IOService matching and notification calls. + @result A pointer to the IOResources instance. It should not be released by the caller. */ + + static IOService * getResourceService( void ); + + /* Allocate resources for a matched service */ + +/*! @function getResources + @abstract Allocates any needed resources for a published IOService object before clients attach. + @discussion This method is called during the registration process for an IOService object if there are successful driver matches, before any clients attach. It allows for lazy allocation of resources to an IOService object when a matching driver is found. + @result An IOReturn code; kIOReturnSuccess is necessary for the IOService object to be successfully used, otherwise the registration process for the object is halted. */ + + virtual IOReturn getResources( void ); + + /* Device memory accessors */ + +/*! @function getDeviceMemoryCount + @abstract Returns a count of the physical memory ranges available for a device. + @discussion This method returns the count of physical memory ranges, each represented by an IODeviceMemory instance, that have been allocated for a memory mapped device. + @result An integer count of the number of ranges available. */ + + virtual IOItemCount getDeviceMemoryCount( void ); + +/*! @function getDeviceMemoryWithIndex + @abstract Returns an instance of IODeviceMemory representing one of a device's memory mapped ranges. + @discussion This method returns a pointer to an instance of IODeviceMemory for the physical memory range at the given index for a memory mapped device. + @param index An index into the array of ranges assigned to the device. + @result A pointer to an instance of IODeviceMemory, or zero if the index is beyond the count available. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. See also @link mapDeviceMemoryWithIndex mapDeviceMemoryWithIndex@/link, which creates a device memory mapping. */ + + virtual IODeviceMemory * getDeviceMemoryWithIndex( unsigned int index ); + +/*! @function mapDeviceMemoryWithIndex + @abstract Maps a physical range of a device. + @discussion This method creates a mapping for the IODeviceMemory at the given index, with IODeviceMemory::map(options). The mapping is represented by the returned instance of IOMemoryMap, which should not be released until the mapping is no longer required. + @param index An index into the array of ranges assigned to the device. + @result An instance of IOMemoryMap, or zero if the index is beyond the count available. The mapping should be released only when access to it is no longer required. */ + + virtual IOMemoryMap * mapDeviceMemoryWithIndex( unsigned int index, + IOOptionBits options = 0 ); + +/*! @function getDeviceMemory + @abstract Returns the array of IODeviceMemory objects representing a device's memory mapped ranges. + @discussion This method returns an array of IODeviceMemory objects representing the physical memory ranges allocated to a memory mapped device. + @result An OSArray of IODeviceMemory objects, or zero if none are available. The array is retained by the provider, so is valid while attached. */ + + virtual OSArray * getDeviceMemory( void ); + +/*! @function setDeviceMemory + @abstract Sets the array of IODeviceMemory objects representing a device's memory mapped ranges. + @discussion This method sets an array of IODeviceMemory objects representing the physical memory ranges allocated to a memory mapped device. + @param array An OSArray of IODeviceMemory objects, or zero if none are available. The array will be retained by the object. */ + + virtual void setDeviceMemory( OSArray * array ); + + /* Interrupt accessors */ + +/*! @function registerInterrupt + @abstract Registers a C function interrupt handler for a device supplying interrupts. + @discussion This method installs a C function interrupt handler to be called at primary interrupt time for a device's interrupt. Only one handler may be installed per interrupt source. IOInterruptEventSource provides a work loop based abstraction for interrupt delivery that may be more appropriate for work loop based drivers. + @param source The index of the interrupt source in the device. + @param target An object instance to be passed to the interrupt handler. + @param handler The C function to be called at primary interrupt time when the interrupt occurs. The handler should process the interrupt by clearing the interrupt, or by disabling the source. + @param refCon A reference constant for the handler's use. + @result An IOReturn code.
kIOReturnNoInterrupt is returned if the source is not valid; kIOReturnNoResources is returned if the interrupt already has an installed handler. */ + + virtual IOReturn registerInterrupt(int source, OSObject *target, + IOInterruptAction handler, + void *refCon = 0); + +/*! @function unregisterInterrupt + @abstract Removes a C function interrupt handler for a device supplying hardware interrupts. + @discussion This method removes a C function interrupt handler previously installed with @link registerInterrupt registerInterrupt@/link. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn unregisterInterrupt(int source); + +/*! @function getInterruptType + @abstract Returns the type of interrupt used for a device supplying hardware interrupts. + @param source The index of the interrupt source in the device. + @param interruptType The interrupt type for the interrupt source will be stored here by getInterruptType.
kIOInterruptTypeEdge will be returned for edge-trigggered sources.
kIOInterruptTypeLevel will be returned for level-trigggered sources. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn getInterruptType(int source, int *interruptType); + +/*! @function enableInterrupt + @abstract Enables a device interrupt. + @discussion It is the caller's responsiblity to keep track of the enable state of the interrupt source. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn enableInterrupt(int source); + +/*! @function disableInterrupt + @abstract Synchronously disables a device interrupt. + @discussion If the interrupt routine is running, the call will block until the routine completes. It is the caller's responsiblity to keep track of the enable state of the interrupt source. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn disableInterrupt(int source); + +/*! @function causeInterrupt + @abstract Causes a device interrupt to occur. + @discussion Emulates a hardware interrupt, to be called from task level. + @param source The index of the interrupt source in the device. + @result An IOReturn code (kIOReturnNoInterrupt is returned if the source is not valid). */ + + virtual IOReturn causeInterrupt(int source); + +/*! @function requestProbe + @abstract Requests that hardware be re-scanned for devices. + @discussion For bus families that do not usually detect device addition or removal, this method represents an external request (eg. from a utility application) to rescan and publish or remove found devices. + @param options Family defined options, not interpreted by IOService. + @result An IOReturn code. */ + + virtual IOReturn requestProbe( IOOptionBits options ); + + /* Generic API for non-data-path upstream calls */ + +/*! @function message + @abstract Receives a generic message delivered from an attached provider. + @discussion A provider may deliver messages via the message method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method is implemented in the client to receive messages. + @param type A type defined in IOMessage.h or defined by the provider family. + @param provider The provider from which the message originates. + @param argument An argument defined by the provider family, not used by IOService. + @result An IOReturn code defined by the message type. */ + + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ); + +/*! @function messageClient + @abstract Sends a generic message to an attached client. + @discussion A provider may deliver messages via the @link message message@/link method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method may be called in the provider to send a message to the specified client, which may be useful for overrides. + @param messageType A type defined in IOMessage.h or defined by the provider family. + @param client A client of the IOService to send the message. + @param messageArgument An argument defined by the provider family, not used by IOService. + @param argSize Specifies the size of messageArgument, in bytes. If argSize is non-zero, messageArgument is treated as a pointer to argSize bytes of data. If argSize is 0 (the default), messageArgument is treated as an ordinal and passed by value. + @result The return code from the client message call. */ + + virtual IOReturn messageClient( UInt32 messageType, OSObject * client, + void * messageArgument = 0, vm_size_t argSize = 0 ); + +/*! @function messageClients + @abstract Sends a generic message to all attached clients. + @discussion A provider may deliver messages via the @link message message@/link method to its clients informing them of state changes, such as kIOMessageServiceIsTerminated or kIOMessageServiceIsSuspended. Certain messages are defined by the I/O Kit in IOMessage.h while others may be family dependent. This method may be called in the provider to send a message to all the attached clients, via the @link messageClient messageClient@/link method. + @param type A type defined in IOMessage.h or defined by the provider family. + @param argument An argument defined by the provider family, not used by IOService. + @param argSize Specifies the size of argument, in bytes. If argSize is non-zero, argument is treated as a pointer to argSize bytes of data. If argSize is 0 (the default), argument is treated as an ordinal and passed by value. + @result Any non-kIOReturnSuccess return codes returned by the clients, or kIOReturnSuccess if all return kIOReturnSuccess. */ + + virtual IOReturn messageClients( UInt32 type, + void * argument = 0, vm_size_t argSize = 0 ); + + virtual IONotifier * registerInterest( const OSSymbol * typeOfInterest, + IOServiceInterestHandler handler, + void * target, void * ref = 0 ); + + virtual void applyToProviders( IOServiceApplierFunction applier, + void * context ); + + virtual void applyToClients( IOServiceApplierFunction applier, + void * context ); + + virtual void applyToInterested( const OSSymbol * typeOfInterest, + OSObjectApplierFunction applier, + void * context ); + + virtual IOReturn acknowledgeNotification( IONotificationRef notification, + IOOptionBits response ); + + /* User client create */ + +/*! @function newUserClient + @abstract Creates a connection for a non kernel client. + @discussion A non kernel client may request a connection be opened via the @link //apple_ref/c/func/IOServiceOpen IOServiceOpen@/link library function, which will call this method in an IOService object. The rules and capabilities of user level clients are family dependent, and use the functions of the IOUserClient class for support. IOService's implementation returns kIOReturnUnsupported, so any family supporting user clients must implement this method. + @param owningTask The Mach task of the client thread in the process of opening the user client. Note that in Mac OS X, each process is based on a Mach task and one or more Mach threads. For more information on the composition of a Mach task and its relationship with Mach threads, see {@linkdoc //apple_ref/doc/uid/TP30000905-CH209-TPXREF103 "Tasks and Threads"}. + @param securityID A token representing the access level for the task. + @param type A constant specifying the type of connection to be created, specified by the caller of @link //apple_ref/c/func/IOServiceOpen IOServiceOpen@/link and interpreted only by the family. + @param handler An instance of an IOUserClient object to represent the connection, which will be released when the connection is closed, or zero if the connection was not opened. + @param properties A dictionary of additional properties for the connection. + @result A return code to be passed back to the caller of IOServiceOpen. */ + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, IOUserClient ** handler ); + + /* Return code utilities */ + +/*! @function stringFromReturn + @abstract Supplies a programmer-friendly string from an IOReturn code. + @discussion Strings are available for the standard return codes in IOReturn.h in IOService, while subclasses may implement this method to interpret family dependent return codes. + @param rtn The IOReturn code. + @result A pointer to a constant string, or zero if the return code is unknown. */ + + virtual const char * stringFromReturn( IOReturn rtn ); + +/*! @function errnoFromReturn + @abstract Translates an IOReturn code to a BSD errno. + @discussion BSD defines its own return codes for its functions in sys/errno.h, and I/O Kit families may need to supply compliant results in BSD shims. Results are available for the standard return codes in IOReturn.h in IOService, while subclasses may implement this method to interpret family dependent return codes. + @param rtn The IOReturn code. + @result The BSD errno or EIO if unknown. */ + + virtual int errnoFromReturn( IOReturn rtn ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* * * * * * * * * * end of IOService API * * * * * * * */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /* for IOInterruptController implementors */ + + int _numInterruptSources; + IOInterruptSource *_interruptSources; + + /* overrides */ + virtual bool serializeProperties( OSSerialize * s ) const; + + void requireMaxBusStall(UInt32 ns); + void requireMaxInterruptDelay(uint32_t ns); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + /* * * * * * * * * * * * Internals * * * * * * * * * * * */ + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool checkResources( void ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool checkResource( OSObject * matching ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void probeCandidates( OSOrderedSet * matches ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool startCandidate( IOService * candidate ); + +public: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOService * getClientWithCategory( const OSSymbol * category ) + APPLE_KEXT_DEPRECATED; + // copyClientWithCategory is the public replacement + +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + bool passiveMatch( OSDictionary * matching, bool changesOK = false); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void startMatching( IOOptionBits options = 0 ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void doServiceMatch( IOOptionBits options ); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void doServiceTerminate( IOOptionBits options ); + +private: + static OSObject * copyExistingServices( OSDictionary * matching, + IOOptionBits inState, IOOptionBits options = 0 ); + + static IONotifier * setNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref, + SInt32 priority = 0 ); + + static IONotifier * doInstallNotification( + const OSSymbol * type, OSDictionary * matching, + IOServiceMatchingNotificationHandler handler, + void * target, void * ref, + SInt32 priority, OSIterator ** existing ); + + static bool syncNotificationHandler( void * target, void * ref, + IOService * newService, IONotifier * notifier ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void deliverNotification( const OSSymbol * type, + IOOptionBits orNewState, IOOptionBits andNewState ); + + bool invokeNotifer( class _IOServiceNotifier * notify ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void unregisterAllInterest( void ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn waitForState( UInt32 mask, UInt32 value, + mach_timespec_t * timeout = 0 ); + + IOReturn waitForState( UInt32 mask, UInt32 value, uint64_t timeout ); + + UInt32 _adjustBusy( SInt32 delta ); + + bool terminatePhase1( IOOptionBits options = 0 ); + void scheduleTerminatePhase2( IOOptionBits options = 0 ); + void scheduleStop( IOService * provider ); + void scheduleFinalize( void ); + static void terminateThread( void * arg, wait_result_t unused ); + static void terminateWorker( IOOptionBits options ); + static void actionWillTerminate( IOService * victim, IOOptionBits options, + OSArray * doPhase2List ); + static void actionDidTerminate( IOService * victim, IOOptionBits options ); + static void actionFinalize( IOService * victim, IOOptionBits options ); + static void actionStop( IOService * client, IOService * provider ); + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn resolveInterrupt(IOService *nub, int source); + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn lookupInterrupt(int source, bool resolve, IOInterruptController **interruptController); + + + /* power management */ +public: + +/*! @function PMinit + @abstract Initializes power management for a driver. + @discussion PMinit allocates and initializes the power management instance variables, and it should be called before accessing those variables or calling the power management methods. This method should be called inside the driver's start routine and must be paired with a call to @link PMstop PMstop@/link. + Most calls to PMinit are followed by calls to @link joinPMtree joinPMtree@/link and @link registerPowerDriver registerPowerDriver@/link. */ + + virtual void PMinit( void ); + +/*! @function PMstop + @abstract Frees and removes the driver from power management. + @discussion The power managment variables don't exist after this call and the power managment methods in the caller shouldn't be called. + Calling PMstop cleans up for the three power management initialization calls: @link PMinit PMinit@/link, @link joinPMtree joinPMtree@/link, and @link registerPowerDriver registerPowerDriver@/link. */ + + virtual void PMstop( void ); + +/*! @function joinPMtree + @abstract Joins the driver into the power plane of the I/O Registry. + @discussion A driver uses this method to call its nub when initializing (usually in its start routine after calling @link PMinit PMinit@/link), to be attached into the power management hierarchy (i.e., the power plane). A driver usually calls this method on the driver for the device that provides it power (this is frequently the nub). + Before this call returns, the caller will probably be called at @link setPowerParent setPowerParent@/link and @link setAggressiveness setAggressiveness@/link and possibly at @link addPowerChild addPowerChild@/link as it is added to the hierarchy. This method may be overridden by a nub subclass. + @param driver The driver to be added to the power plane, usually this. */ + + virtual void joinPMtree( IOService * driver ); + +/*! @function registerPowerDriver + @abstract Registers a set of power states that the driver supports. + @discussion A driver defines its array of supported power states with power management in its power management initialization (its start routine). If successful, power management will call the driver to instruct it to change its power state through @link setPowerState setPowerState@/link. + Most drivers do not need to override registerPowerDriver. A nub may override registerPowerDriver if it needs to arrange its children in the power plane differently than the default placement, but this is uncommon. + @param controllingDriver A pointer to the calling driver, usually this. + @param powerStates A driver-defined array of power states that the driver and device support. Power states are defined in pwr_mgt/IOPMpowerState.h. + @param numberOfStates The number of power states in the array. + @result IOPMNoErr. All errors are logged via kprintf. */ + + virtual IOReturn registerPowerDriver( + IOService * controllingDriver, + IOPMPowerState * powerStates, + unsigned long numberOfStates ); + +/*! @function registerInterestedDriver + @abstract Allows an IOService object to register interest in the changing power state of a power-managed IOService object. + @discussion Call registerInterestedDriver on the IOService object you are interested in receiving power state messages from, and pass a pointer to the interested driver (this) as an argument. + The interested driver should override @link powerStateWillChangeTo powerStateWillChangeTo@/link and @link powerStateDidChangeTo powerStateDidChangeTo@/link to receive these power change messages. + Interested drivers must acknowledge power changes in powerStateWillChangeTo or powerStateDidChangeTo, either via return value or later calls to @link acknowledgePowerChange acknowledgePowerChange@/link. + @param theDriver The driver of interest adds this pointer to the list of interested drivers. It informs drivers on this list before and after the power change. + @result Flags describing the capability of the device in its current power state. If the current power state is not yet defined, zero is returned (this is the case when the driver is not yet in the power domain hierarchy or hasn't fully registered with power management yet). */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOPMPowerFlags registerInterestedDriver( IOService * theDriver ); + +/*! @function deRegisterInterestedDriver + @abstract De-registers power state interest from a previous call to registerInterestedDriver. + @discussion Most drivers do not need to override deRegisterInterestedDriver. + @param theDriver The interested driver previously passed into @link registerInterestedDriver registerInterestedDriver@/link. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn deRegisterInterestedDriver( IOService * theDriver ); + +/*! @function acknowledgePowerChange + @abstract Acknowledges an in-progress power state change. + @discussion When power management informs an interested object (via @link powerStateWillChangeTo powerStateWillChangeTo@/link or @link powerStateDidChangeTo powerStateDidChangeTo@/link), the object can return an immediate acknowledgement via a return code, or it may return an indication that it will acknowledge later by calling acknowledgePowerChange. + Interested objects are those that have registered as interested drivers, as well as power plane children of the power changing driver. A driver that calls @link registerInterestedDriver registerInterestedDriver@/link must call acknowledgePowerChange, or use an immediate acknowledgement return from powerStateWillChangeTo or powerStateDidChangeTo. + @param whichDriver A pointer to the calling driver. The called object tracks all interested parties to ensure that all have acknowledged the power state change. + @result IOPMNoErr. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn acknowledgePowerChange( IOService * whichDriver ); + +/*! @function acknowledgeSetPowerState + @abstract Acknowledges the belated completion of a driver's setPowerState power state change. + @discussion After power management instructs a driver to change its state via @link setPowerState setPowerState@/link, that driver must acknowledge the change when its device has completed its transition. The acknowledgement may be immediate, via a return code from setPowerState, or delayed, via this call to acknowledgeSetPowerState. + Any driver that does not return kIOPMAckImplied from its setPowerState implementation must later call acknowledgeSetPowerState. + @result IOPMNoErr. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn acknowledgeSetPowerState( void ); + +/*! @function requestPowerDomainState + @abstract Tells a driver to adjust its power state. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn requestPowerDomainState( + IOPMPowerFlags desiredState, + IOPowerConnection * whichChild, + unsigned long specificationFlags ); + +/*! @function makeUsable + @abstract Requests that a device become usable. + @discussion This method is called when some client of a device (or the device's own driver) is asking for the device to become usable. Power management responds by telling the object upon which this method is called to change to its highest power state. + makeUsable is implemented using @link changePowerStateToPriv changePowerStateToPriv@/link. Subsequent requests for lower power, such as from changePowerStateToPriv, will pre-empt this request. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn makeUsable( void ); + +/*! @function temporaryPowerClampOn + @abstract A driver calls this method to hold itself in the highest power state until it has children. + @discussion Use temporaryPowerClampOn to hold your driver in its highest power state while waiting for child devices to attach. After children have attached, the clamp is released and the device's power state is controlled by the children's requirements. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn temporaryPowerClampOn( void ); + +/*! @function changePowerStateTo + @abstract Sets a driver's power state. + @discussion This function is one of several that are used to set a driver's power state. In most circumstances, however, you should call @link changePowerStateToPriv changePowerStateToPriv@/link instead. + Calls to changePowerStateTo, changePowerStateToPriv, and a driver's power children all affect the power state of a driver. For legacy design reasons, they have overlapping functionality. Although you should call changePowerStateToPriv to change your device's power state, you might need to call changePowerStateTo in the following circumstances: +
  • If a driver will be using changePowerStateToPriv to change its power state, it should call changePowerStateTo(0) in its start routine to eliminate the influence changePowerStateTo has on power state calculations. +
  • Call changePowerStateTo in conjunction with @link setIdleTimerPeriod setIdleTimerPeriod@/link and @link activityTickle activityTickle@/link to idle a driver into a low power state. For a driver with 3 power states, for example, changePowerStateTo(1) sets a minimum level of power state 1, such that the idle timer period may not set your device's power any lower than state 1.
+ @param ordinal The number of the desired power state in the power state array. + @result A return code that can be ignored by the caller. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOReturn changePowerStateTo( unsigned long ordinal ); + +/*! @function currentCapability + @abstract Finds out the capability of a device's current power state. + @result A copy of the capabilityFlags field for the current power state in the power state array. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOPMPowerFlags currentCapability( void ); + +/*! @function currentPowerConsumption + @abstract Finds out the current power consumption of a device. + @discussion Most Mac OS X power managed drivers do not report their power consumption via the staticPower field. Thus this call will not accurately reflect power consumption for most drivers. + @result A copy of the staticPower field for the current power state in the power state array. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + unsigned long currentPowerConsumption( void ); + +/*! @function activityTickle + @abstract Informs power management when a power-managed device is in use, so that power management can track when it is idle and adjust its power state accordingly. + @discussion The activityTickle method is provided for objects in the system (or for the driver itself) to tell a driver that its device is being used. + The IOService superclass can manage idleness determination with a simple idle timer mechanism and this activityTickle call. To start this up, the driver calls its superclass's setIdleTimerPeriod. This starts a timer for the time interval specified in the call. When the timer expires, the superclass checks to see if there has been any activity since the last timer expiration. (It checks to see if activityTickle has been called). If there has been activity, it restarts the timer, and this process continues. When the timer expires, and there has been no device activity, the superclass lowers the device power state to the next lower state. This can continue until the device is in state zero. + After the device has been powered down by at least one power state, a subsequent call to activityTickle causes the device to be switched to a higher state required for the activity. + If the driver is managing the idleness determination totally on its own, the value of the type parameter should be kIOPMSubclassPolicy, and the driver should override the activityTickle method. The superclass IOService implementation of activityTickle does nothing with the kIOPMSubclassPolicy argument. + @param type When type is kIOPMSubclassPolicy, activityTickle is not handled in IOService and should be intercepted by the subclass. When type is kIOPMSuperclassPolicy1, an activity flag is set and the device state is checked. If the device has been powered down, it is powered up again. + @param stateNumber When type is kIOPMSuperclassPolicy1, stateNumber contains the desired power state ordinal for the activity. If the device is in a lower state, the superclass will switch it to this state. This is for devices that can handle some accesses in lower power states; the device is powered up only as far as it needs to be for the activity. + @result When type is kIOPMSuperclassPolicy1, the superclass returns true if the device is currently in the state specified by stateNumber. If the device is in a lower state and must be powered up, the superclass returns false; in this case the superclass will initiate a power change to power the device up. */ + + virtual bool activityTickle( + unsigned long type, + unsigned long stateNumber = 0 ); + +/*! @function setAggressiveness + @abstract Broadcasts an aggressiveness factor from the parent of a driver to the driver. + @discussion Implement setAggressiveness to receive a notification when an "aggressiveness Aggressiveness factors are a loose set of power management variables that contain values for system sleep timeout, display sleep timeout, whether the system is on battery or AC, and other power management features. There are several aggressiveness factors that can be broadcast and a driver may take action on whichever factors apply to it. + A driver that has joined the power plane via @link joinPMtree joinPMtree@/link will receive setAgressiveness calls when aggressiveness factors change. + A driver may override this call if it needs to do something with the new factor (such as change its idle timeout). If overridden, the driver must call its superclass's setAgressiveness method in its own setAgressiveness implementation. + Most drivers do not need to implement setAgressiveness. + @param type The aggressiveness factor type, such as kPMMinutesToDim, kPMMinutesToSpinDown, kPMMinutesToSleep, and kPMPowerSource. (Aggressiveness factors are defined in pwr_mgt/IOPM.h.) + @param newLevel The aggressiveness factor's new value. + @result IOPMNoErr. */ + + virtual IOReturn setAggressiveness( + unsigned long type, + unsigned long newLevel ); + +/*! @function getAggressiveness + @abstract Returns the current aggressiveness value for the given type. + @param type The aggressiveness factor to query. + @param currentLevel Upon successful return, contains the value of aggressiveness factor type. + @result kIOReturnSuccess upon success; an I/O Kit error code otherwise. */ + + virtual IOReturn getAggressiveness( + unsigned long type, + unsigned long * currentLevel ); + +#ifndef __LP64__ +/*! @function systemWake + @abstract Tells every driver in the power plane that the system is waking up. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn systemWake( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function temperatureCriticalForZone + @abstract Alerts a driver to a critical temperature in some thermal zone. + @discussion This call is unused by power management. It is not intended to be called or overridden. */ + + virtual IOReturn temperatureCriticalForZone( IOService * whichZone ) + APPLE_KEXT_DEPRECATED; + +/*! @function youAreRoot + @abstract Informs power management which IOService object is the power plane root. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn youAreRoot( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function setPowerParent + @abstract This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn setPowerParent( + IOPowerConnection * parent, + bool stateKnown, + IOPMPowerFlags currentState ) + APPLE_KEXT_DEPRECATED; +#endif /* !__LP64__ */ + +/*! @function addPowerChild + @abstract Informs a driver that it has a new child. + @discussion The Platform Expert uses this method to call a driver and introduce it to a new child. This call is handled internally by power management. It is not intended to be overridden or called by drivers. + @param theChild A pointer to the child IOService object. */ + + virtual IOReturn addPowerChild( IOService * theChild ); + +/*! @function removePowerChild + @abstract Informs a power managed driver that one of its power plane childen is disappearing. + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual IOReturn removePowerChild( IOPowerConnection * theChild ); + +#ifndef __LP64__ +/*! @function command_received + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void command_received( void *, void * , void * , void * ); +#endif + +/*! @function start_PM_idle_timer + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + APPLE_KEXT_COMPATIBILITY_VIRTUAL + void start_PM_idle_timer( void ); + +#ifndef __LP64__ +/*! @function PM_idle_timer_expiration + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void PM_idle_timer_expiration( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function PM_Clamp_Timer_Expired + @discussion This call is handled internally by power management. It is not intended to be overridden or called by drivers. */ + + virtual void PM_Clamp_Timer_Expired( void ) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function setIdleTimerPeriod + @abstract Sets or changes the idle timer period. + @discussion A driver using the idleness determination provided by IOService calls its superclass with this method to set or change the idle timer period. See @link activityTickle activityTickle@/link for a description of this type of idleness determination. + @param period The desired idle timer period in seconds. + @result kIOReturnSuccess upon success; an I/O Kit error code otherwise. */ + + virtual IOReturn setIdleTimerPeriod( unsigned long ); + +#ifndef __LP64__ +/*! @function getPMworkloop + @abstract Returns a pointer to the system-wide power management work loop. + @availability Deprecated in Mac OS X version 10.6. + @discussion Most drivers should create their own work loops to synchronize their code; drivers should not run arbitrary code on the power management work loop. */ + + virtual IOWorkLoop * getPMworkloop( void ) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function getPowerState + @abstract Determines a device's power state. + @discussion A device's "current power state" is updated at the end of each power state transition (e.g. transition from state 1 to state 0, or state 0 to state 2). This transition includes the time spent powering on or off any power plane children. Thus, if a child calls getPowerState on its power parent during system wake from sleep, the call will return the index to the device's off state rather than its on state. + @result The current power state's index into the device's power state array. */ + + UInt32 getPowerState( void ); + +/*! @function setPowerState + @abstract Requests a power managed driver to change the power state of its device. + @discussion A power managed driver must override setPowerState to take part in system power management. After a driver is registered with power management, the system uses setPowerState to power the device off and on for system sleep and wake. + Calls to @link PMinit PMinit@/link and @link registerPowerDriver registerPowerDriver@/link enable power management to change a device's power state using setPowerState. setPowerState is called in a clean and separate thread context. + @param powerStateOrdinal The number in the power state array of the state the driver is being instructed to switch to. + @param whatDevice A pointer to the power management object which registered to manage power for this device. In most cases, whatDevice will be equal to your driver's own this pointer. + @result The driver must return IOPMAckImplied if it has complied with the request when it returns. Otherwise if it has started the process of changing power state but not finished it, the driver should return a number of microseconds which is an upper limit of the time it will need to finish. Then, when it has completed the power switch, it should call @link acknowledgeSetPowerState acknowledgeSetPowerState@/link. */ + + virtual IOReturn setPowerState( + unsigned long powerStateOrdinal, + IOService * whatDevice ); + +#ifndef __LP64__ +/*! @function clampPowerOn + @abstract Deprecated. Do not use. */ + + virtual void clampPowerOn( unsigned long duration ); +#endif + +/*! @function maxCapabilityForDomainState + @abstract Determines a driver's highest power state possible for a given power domain state. + @discussion This happens when the power domain is changing state and power management needs to determine which state the device is capable of in the new domain state. + Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the driver itself should implement the method and override the superclass's implementation. + @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. */ + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + +/*! @function initialPowerStateForDomainState + @abstract Determines which power state a device is in, given the current power domain state. + @discussion Power management calls this method once, when the driver is initializing power management. + Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the power managed driver should implement the method and override the superclass's implementation. + @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. */ + + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags domainState ); + +/*! @function powerStateForDomainState + @abstract Determines what power state the device would be in for a given power domain state. + @discussion Power management calls a driver with this method to find out what power state the device would be in for a given power domain state. This happens when the power domain is changing state and power management needs to determine the effect of the change. + Most drivers do not need to implement this method, and can rely upon the default IOService implementation. The IOService implementation scans the power state array looking for the highest state whose inputPowerRequirement field exactly matches the value of the domainState parameter. If more intelligent determination is required, the power managed driver should implement the method and override the superclass's implementation. + @param domainState Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. */ + + virtual unsigned long powerStateForDomainState( IOPMPowerFlags domainState ); + +/*! @function powerStateWillChangeTo + @abstract Informs interested parties that a device is about to change its power state. + @discussion Power management informs interested parties that a device is about to change to a different power state. Interested parties are those that have registered for this notification via @link registerInterestedDriver registerInterestedDriver@/link. If you have called registerInterestedDriver on a power managed driver, you must implement powerStateWillChangeTo and @link powerStateDidChangeTo powerStateDidChangeTo@/link to receive the notifications. + powerStateWillChangeTo is called in a clean and separate thread context. powerStateWillChangeTo is called before a power state transition takes place; powerStateDidChangeTo is called after the transition has completed. + @param capabilities Flags that describe the capability of the device in the new power state (they come from the capabilityFlags field of the new state in the power state array). + @param stateNumber The number of the state in the state array that the device is switching to. + @param whatDevice A pointer to the driver that is changing. It can be used by a driver that is receiving power state change notifications for multiple devices to distinguish between them. + @result The driver returns IOPMAckImplied if it has prepared for the power change when it returns. If it has started preparing but not finished, it should return a number of microseconds which is an upper limit of the time it will need to finish preparing. Then, when it has completed its preparations, it should call @link acknowledgePowerChange acknowledgePowerChange@/link. */ + + virtual IOReturn powerStateWillChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ); + +/*! @function powerStateDidChangeTo + @abstract Informs interested parties that a device has changed to a different power state. + @discussion Power management informs interested parties that a device has changed to a different power state. Interested parties are those that have registered for this notification via @link registerInterestedDriver registerInterestedDriver@/link. If you have called registerInterestedDriver on a power managed driver, you must implemnt @link powerStateWillChangeTo powerStateWillChangeTo@/link and powerStateDidChangeTo to receive the notifications. + powerStateDidChangeTo is called in a clean and separate thread context. powerStateWillChangeTo is called before a power state transition takes place; powerStateDidChangeTo is called after the transition has completed. + @param capabilities Flags that describe the capability of the device in the new power state (they come from the capabilityFlags field of the new state in the power state array). + @param stateNumber The number of the state in the state array that the device is switching to. + @param whatDevice A pointer to the driver that is changing. It can be used by a driver that is receiving power state change notifications for multiple devices to distinguish between them. + @result The driver returns IOPMAckImplied if it has prepared for the power change when it returns. If it has started preparing but not finished, it should return a number of microseconds which is an upper limit of the time it will need to finish preparing. Then, when it has completed its preparations, it should call @link acknowledgePowerChange acknowledgePowerChange@/link. */ + + virtual IOReturn powerStateDidChangeTo( + IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService * whatDevice ); + +#ifndef __LP64__ +/*! @function didYouWakeSystem + @abstract Asks a driver if its device is the one that just woke the system from sleep. + @availability Deprecated in Mac OS X version 10.6. + @discussion Power management calls a power managed driver with this method to ask if its device is the one that just woke the system from sleep. If a device is capable of waking the system from sleep, its driver should implement didYouWakeSystem and return true if its device was responsible for waking the system. + @result true if the driver's device woke the system and false otherwise. */ + + virtual bool didYouWakeSystem( void ) + APPLE_KEXT_DEPRECATED; + +/*! @function newTemperature + @abstract Tells a power managed driver that the temperature in the thermal zone has changed. + @discussion This call is unused by power management. It is not intended to be called or overridden. */ + + virtual IOReturn newTemperature( long currentTemp, IOService * whichZone ) + APPLE_KEXT_DEPRECATED; +#endif + + virtual bool askChangeDown( unsigned long ); + virtual bool tellChangeDown( unsigned long ); + virtual void tellNoChangeDown ( unsigned long ); + virtual void tellChangeUp( unsigned long ); + virtual IOReturn allowPowerChange( unsigned long refcon ); + virtual IOReturn cancelPowerChange( unsigned long refcon ); + +protected: +/*! @function changePowerStateToPriv + @abstract Tells a driver's superclass to change the power state of its device. + @discussion A driver uses this method to tell its superclass to change the power state of the device. This is the recommended way to change the power state of a device. + Three things affect driver power state: @link changePowerStateTo changePowerStateTo@/link, changePowerStateToPriv, and the desires of the driver's power plane children. Power management puts the device into the maximum state governed by those three entities. + Drivers may eliminate the influence of the changePowerStateTo method on power state one of two ways. See @link powerOverrideOnPriv powerOverrideOnPriv@/link to ignore the method's influence, or call changePowerStateTo(0) in the driver's start routine to remove the changePowerStateTo method's power request. + @param ordinal The number of the desired power state in the power state array. + @result A return code that can be ignored by the caller. */ + + IOReturn changePowerStateToPriv( unsigned long ordinal ); + +/*! @function powerOverrideOnPriv + @abstract Allows a driver to ignore its children's power management requests and only use changePowerStateToPriv to define its own power state. + @discussion Power management normally keeps a device at the highest state required by its requests via @link changePowerStateTo changePowerStateTo@/link, @link changePowerStateToPriv changePowerStateToPriv@/link, and its children. However, a driver may ensure a lower power state than otherwise required by itself and its children using powerOverrideOnPriv. When the override is on, power management keeps the device's power state in the state specified by changePowerStateToPriv. Turning on the override will initiate a power change if the driver's changePowerStateToPriv desired power state is different from the maximum of the changePowerStateTo desired power state and the children's desires. + @result A return code that can be ignored by the caller. */ + + IOReturn powerOverrideOnPriv( void ); + +/*! @function powerOverrideOffPriv + @abstract Allows a driver to disable a power override. + @discussion When a driver has enabled an override via @link powerOverrideOnPriv powerOverrideOnPriv@/link, it can disable it again by calling this method in its superclass. Disabling the override reverts to the default algorithm for determining a device's power state. The superclass will now keep the device at the highest state required by changePowerStateTo, changePowerStateToPriv, and its children. Turning off the override will initiate a power change if the driver's desired power state is different from the maximum of the power managed driver's desire and the children's desires. + @result A return code that can be ignored by the caller. */ + + IOReturn powerOverrideOffPriv( void ); + +/*! @function powerChangeDone + @abstract Tells a driver when a power state change is complete. + @discussion Power management uses this method to inform a driver when a power change is completely done, when all interested parties have acknowledged the @link powerStateDidChangeTo powerStateDidChangeTo@/link call. The default implementation of this method is null; the method is meant to be overridden by subclassed power managed drivers. A driver should use this method to find out if a power change it initiated is complete. + @param stateNumber The number of the state in the state array that the device has switched from. */ + + virtual void powerChangeDone( unsigned long stateNumber ); +}; + +#endif /* ! _IOKIT_IOSERVICE_H */ diff --git a/i386/include/IOKit/IOServicePM.h b/i386/include/IOKit/IOServicePM.h new file mode 100644 index 0000000..9955e03 --- /dev/null +++ b/i386/include/IOKit/IOServicePM.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSERVICEPM_H +#define _IOKIT_IOSERVICEPM_H + +#include + +class IOService; +class IOServicePM; +class IOPowerConnection; +class IOWorkLoop; +class IOCommandGate; +class IOTimerEventSource; +class IOPlatformExpert; + +#endif /* !_IOKIT_IOSERVICEPM_H */ diff --git a/i386/include/IOKit/IOSharedDataQueue.h b/i386/include/IOKit/IOSharedDataQueue.h new file mode 100644 index 0000000..fdfa1d6 --- /dev/null +++ b/i386/include/IOKit/IOSharedDataQueue.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOSHAREDDATAQUEUE_H +#define _IOKIT_IOSHAREDDATAQUEUE_H + +#ifdef dequeue +#undef dequeue +#endif + +#include + +typedef struct _IODataQueueEntry IODataQueueEntry; + +/*! + * @class IOSharedDataQueue : public IODataQueue + * @abstract A generic queue designed to pass data both from the kernel to a user process and from a user process to the kernel. + * @discussion The IOSharedDataQueue class is designed to also allow a user process to queue data to kernel code. IOSharedDataQueue objects are designed to be used in a single producer / single consumer situation. As such, there are no locks on the data itself. Because the kernel enqueue and user-space dequeue methods follow a strict set of guidelines, no locks are necessary to maintain the integrity of the data struct. + * + *
Each data entry can be variable sized, but the entire size of the queue data region (including overhead for each entry) must be specified up front. + * + *
In order for the IODataQueue instance to notify the user process that data is available, a notification mach port must be set. When the queue is empty and a new entry is added, a message is sent to the specified port. + * + *
In order to make the data queue memory available to a user process, the method getMemoryDescriptor() must be used to get an IOMemoryDescriptor instance that can be mapped into a user process. Typically, the clientMemoryForType() method on an IOUserClient instance will be used to request the IOMemoryDescriptor and then return it to be mapped into the user process. + */ +class IOSharedDataQueue : public IODataQueue +{ + OSDeclareDefaultStructors(IOSharedDataQueue) + + struct ExpansionData { + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +protected: + virtual void free(); + +public: + /*! + * @function withCapacity + * @abstract Static method that creates a new IOSharedDataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in .
This method allocates a new IODataQueue instance and then calls initWithCapacity() with the given size parameter. If the initWithCapacity() fails, the new instance is released and zero is returned. + * @param size The size of the data queue memory region. + * @result Returns the newly allocated IOSharedDataQueue instance. Zero is returned on failure. + */ + static IOSharedDataQueue *withCapacity(UInt32 size); + + /*! + * @function withEntries + * @abstract Static method that creates a new IOSharedDataQueue instance with the specified number of entries of the given size. + * @discussion This method will create a new IOSharedDataQueue instance with enough capacity for numEntries of entrySize. It does account for the IODataQueueEntry overhead for each entry. Note that the numEntries and entrySize are simply used to determine the data region size. They do not actually restrict the size of number of entries that can be added to the queue.
This method allocates a new IODataQueue instance and then calls initWithEntries() with the given numEntries and entrySize parameters. If the initWithEntries() fails, the new instance is released and zero is returned. + * @param numEntries Number of entries to allocate space for. + * @param entrySize Size of each entry. + * @result Reeturns the newly allocated IOSharedDataQueue instance. Zero is returned on failure. + */ + static IOSharedDataQueue *withEntries(UInt32 numEntries, UInt32 entrySize); + + /*! + * @function initWithCapacity + * @abstract Initializes an IOSharedDataQueue instance with the capacity specified in the size parameter. + * @discussion The actual size of the entire data queue memory region (to be shared into a user process) is equal to the capacity plus the IODataQueueMemory overhead. This overhead value can be determined from the DATA_QUEUE_MEMORY_HEADER_SIZE and DATA_QUEUE_MEMORY_APPENDIX_SIZE macro in . The size of the data queue memory region must include space for the overhead of each IODataQueueEntry. This entry overhead can be determined from the DATA_QUEUE_ENTRY_HEADER_SIZE macro in . + * @param size The size of the data queue memory region. + * @result Returns true on success and false on failure. + */ + virtual Boolean initWithCapacity(UInt32 size); + + /*! + * @function getMemoryDescriptor + * @abstract Returns a memory descriptor covering the IODataQueueMemory region. + * @discussion The IOMemoryDescriptor instance returned by this method is intended to be mapped into a user process. This is the memory region that the IODataQueueClient code operates on. + * @result Returns a newly allocated IOMemoryDescriptor for the IODataQueueMemory region. Returns zero on failure. + */ + virtual IOMemoryDescriptor *getMemoryDescriptor(); + + /*! + * @function peek + * @abstract Used to peek at the next entry on the queue. + * @discussion This function can be used to look at the next entry which allows the entry to be received without having to copy it with dequeue. In order to do this, call peek to get the entry. Then call dequeue with a NULL data pointer. That will cause the head to be moved to the next entry, but no memory to be copied. + * @result Returns a pointer to the next IODataQueueEntry if one is available. 0 (NULL) is returned if the queue is empty. + */ + virtual IODataQueueEntry * peek(); + + /*! + * @function dequeue + * @abstract Dequeues the next available entry on the queue and copies it into the given data pointer. + * @discussion This function will dequeue the next available entry on the queue. If a data pointer is provided, it will copy the data into the memory region if there is enough space available as specified in the dataSize parameter. If no data pointer is provided, it will simply move the head value past the current entry. + * @param data A pointer to the data memory region in which to copy the next entry data on the queue. If this parameter is 0 (NULL), it will simply move to the next entry. + * @param dataSize A pointer to the size of the data parameter. On return, this contains the size of the actual entry data - even if the original size was not large enough. + * @result Returns true on success and false on failure. Typically failure means that the queue is empty. + */ + virtual Boolean dequeue(void *data, UInt32 *dataSize); + + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 0); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 1); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 2); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 3); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 4); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 5); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 6); + OSMetaClassDeclareReservedUnused(IOSharedDataQueue, 7); +}; + +#endif /* _IOKIT_IOSHAREDDATAQUEUE_H */ diff --git a/i386/include/IOKit/IOSharedLock.h b/i386/include/IOKit/IOSharedLock.h new file mode 100644 index 0000000..59b47ec --- /dev/null +++ b/i386/include/IOKit/IOSharedLock.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Multiprocessor locks used within the shared memory area between the + * kernel and event system. These must work in both user and kernel mode. + * + * These routines are public, for the purpose of writing frame buffer device + * drivers which handle their own cursors. Certain architectures define a + * generic display class which handles cursor drawing and is subclassed by + * driver writers. These drivers need not be concerned with the following + * types and definitions. + * + * The ev_lock(), ev_unlock(), and ev_try_lock() functions are available only + * to drivers built in or dynamically loaded into the kernel, and to DPS + * drivers built in or dynamically loaded into the Window Server. They do not + * exist in any shared library. + * + * --> They're now in IOKit user lib. + */ + +#ifndef _IOKIT_IOSHAREDLOCK_H +#define _IOKIT_IOSHAREDLOCK_H + +#ifdef __cplusplus +extern "C" { +#endif + +// should be 32 bytes on PPC +typedef volatile int IOSharedLockData; +typedef IOSharedLockData * IOSharedLock; + +#define IOSpinLockInit(l) (*(l) = (IOSharedLockData)0) + + +extern void IOSpinUnlock(IOSharedLock l); +extern boolean_t IOTrySpinLock(IOSharedLock l); + +/* exact same stuff & implementation */ + +typedef IOSharedLockData ev_lock_data_t; +typedef ev_lock_data_t * ev_lock_t; + +#define ev_init_lock(l) (*(l) = (ev_lock_data_t)0) +// needs isync? +//#define ev_is_locked(l) (*(l) != (ev_lock_data_t)0) + + +extern void ev_unlock(ev_lock_t l); +extern boolean_t ev_try_lock(ev_lock_t l); + +#ifdef __cplusplus +} +#endif +#endif /* ! _IOKIT_IOSHAREDLOCK_H */ diff --git a/i386/include/IOKit/IOSubMemoryDescriptor.h b/i386/include/IOKit/IOSubMemoryDescriptor.h new file mode 100644 index 0000000..0093ea3 --- /dev/null +++ b/i386/include/IOKit/IOSubMemoryDescriptor.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOSUBMEMORYDESCRIPTOR_H +#define _IOSUBMEMORYDESCRIPTOR_H + +#include + +/*! @class IOSubMemoryDescriptor : public IOMemoryDescriptor + @abstract The IOSubMemoryDescriptor object describes a memory area made up of a portion of another IOMemoryDescriptor. + @discussion The IOSubMemoryDescriptor object represents a subrange of memory, specified as a portion of another IOMemoryDescriptor. */ + +class IOSubMemoryDescriptor : public IOMemoryDescriptor +{ + OSDeclareDefaultStructors(IOSubMemoryDescriptor); + +protected: + IOMemoryDescriptor * _parent; + IOByteCount _start; + + virtual void free(); + +public: +/*! @function withSubRange + @abstract Create an IOMemoryDescriptor to describe a subrange of an existing descriptor. + @discussion This method creates and initializes an IOMemoryDescriptor for memory consisting of a subrange of the specified memory descriptor. The parent memory descriptor is retained by the new descriptor. + @param of The parent IOMemoryDescriptor of which a subrange is to be used for the new descriptor, which will be retained by the subrange IOMemoryDescriptor. + @param offset A byte offset into the parent memory descriptor's memory. + @param length The length of the subrange. + @param options + kIOMemoryDirectionMask (options:direction) This nibble indicates the I/O direction to be associated with the descriptor, which may affect the operation of the prepare and complete methods on some architectures. + @result The created IOMemoryDescriptor on success, to be released by the caller, or zero on failure. */ + + static IOSubMemoryDescriptor * withSubRange(IOMemoryDescriptor *of, + IOByteCount offset, + IOByteCount length, + IOOptionBits options); + + /* + * Initialize or reinitialize an IOSubMemoryDescriptor to describe + * a subrange of an existing descriptor. + * + * An IOSubMemoryDescriptor can be re-used by calling initSubRange + * again on an existing instance -- note that this behavior is not + * commonly supported in other IOKit classes, although it is here. + */ + virtual bool initSubRange( IOMemoryDescriptor * parent, + IOByteCount offset, IOByteCount length, + IODirection withDirection ); + + /* + * IOMemoryDescriptor required methods + */ + + virtual addr64_t getPhysicalSegment( IOByteCount offset, + IOByteCount * length, + IOOptionBits options = 0 ); + + virtual IOReturn prepare(IODirection forDirection = kIODirectionNone); + + virtual IOReturn complete(IODirection forDirection = kIODirectionNone); + +#ifdef __LP64__ + virtual +#endif /* __LP64__ */ + IOReturn redirect( task_t safeTask, bool redirect ); + + virtual IOReturn setPurgeable( IOOptionBits newState, + IOOptionBits * oldState ); + + // support map() on kIOMemoryTypeVirtual without prepare() + virtual IOMemoryMap * makeMapping( + IOMemoryDescriptor * owner, + task_t intoTask, + IOVirtualAddress atAddress, + IOOptionBits options, + IOByteCount offset, + IOByteCount length ); + + virtual uint64_t getPreparationID( void ); + +}; + +#endif /* !_IOSUBMEMORYDESCRIPTOR_H */ diff --git a/i386/include/IOKit/IOSyncer.h b/i386/include/IOKit/IOSyncer.h new file mode 100644 index 0000000..f6dfce3 --- /dev/null +++ b/i386/include/IOKit/IOSyncer.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOSYNCER_H +#define _IOSYNCER_H + +#include +#include +#include + +class IOSyncer : public OSObject +{ + OSDeclareDefaultStructors(IOSyncer) + +private: + // The spin lock that is used to guard the 'threadMustStop' variable. + IOSimpleLock *guardLock; + volatile bool threadMustStop; + IOReturn fResult; + virtual void free(); + virtual void privateSignal(); + +public: + + static IOSyncer * create(bool twoRetains = true) + APPLE_KEXT_DEPRECATED; + + virtual bool init(bool twoRetains) + APPLE_KEXT_DEPRECATED; + virtual void reinit() + APPLE_KEXT_DEPRECATED; + virtual IOReturn wait(bool autoRelease = true) + APPLE_KEXT_DEPRECATED; + virtual void signal(IOReturn res = kIOReturnSuccess, + bool autoRelease = true) + APPLE_KEXT_DEPRECATED; +}; + +#endif /* !_IOSYNCER */ + diff --git a/i386/include/IOKit/IOTimeStamp.h b/i386/include/IOKit/IOTimeStamp.h new file mode 100644 index 0000000..b1b0905 --- /dev/null +++ b/i386/include/IOKit/IOTimeStamp.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef IOKIT_IOTIMESTAMP_H +#define IOKIT_IOTIMESTAMP_H + +#include + +static inline void +IOTimeStampStartConstant(unsigned int csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_START, a, b, c, d, 0); +} + +static inline void +IOTimeStampEndConstant(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_END, a, b, c, d, 0); +} + +static inline void +IOTimeStampConstant(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG_CONSTANT(csc | DBG_FUNC_NONE, a, b, c, d, 0); +} + +#if KDEBUG + +static inline void +IOTimeStampStart(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(csc | DBG_FUNC_START, a, b, c, d, 0); +} + +static inline void +IOTimeStampEnd(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(csc | DBG_FUNC_END, a, b, c, d, 0); +} + +static inline void +IOTimeStamp(uintptr_t csc, + uintptr_t a = 0, uintptr_t b = 0, + uintptr_t c = 0, uintptr_t d = 0) +{ + KERNEL_DEBUG(csc | DBG_FUNC_NONE, a, b, c, d, 0); +} + +#endif /* KDEBUG */ + +#define IODBG_STORAGE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSTORAGE, code)) +#define IODBG_NETWORK(code) (KDBG_CODE(DBG_IOKIT, DBG_IONETWORK, code)) +#define IODBG_KEYBOARD(code) (KDBG_CODE(DBG_IOKIT, DBG_IOKEYBOARD, code)) +#define IODBG_HID(code) (KDBG_CODE(DBG_IOKIT, DBG_IOHID, code)) +#define IODBG_AUDIO(code) (KDBG_CODE(DBG_IOKIT, DBG_IOAUDIO, code)) +#define IODBG_SERIAL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERIAL, code)) +#define IODBG_TTY(code) (KDBG_CODE(DBG_IOKIT, DBG_IOTTY, code)) +#define IODBG_SAM(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAM, code)) +#define IODBG_PARALLELATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELATA, code)) +#define IODBG_PARALLELSCSI(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPARALLELSCSI, code)) +#define IODBG_SATA(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSATA, code)) +#define IODBG_SAS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSAS, code)) +#define IODBG_FIBRECHANNEL(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIBRECHANNEL, code)) +#define IODBG_USB(code) (KDBG_CODE(DBG_IOKIT, DBG_IOUSB, code)) +#define IODBG_BLUETOOTH(code) (KDBG_CODE(DBG_IOKIT, DBG_IOBLUETOOTH, code)) +#define IODBG_FIREWIRE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOFIREWIRE, code)) +#define IODBG_INFINIBAND(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINFINIBAND, code)) + + +/* Backwards compatibility */ +#define IODBG_DISK(code) IODBG_STORAGE(code) +#define IODBG_POINTING(code) IODBG_HID(code) + + +/* IOKit infrastructure subclasses */ +#define IODBG_WORKLOOP(code) (KDBG_CODE(DBG_IOKIT, DBG_IOWORKLOOP, code)) +#define IODBG_INTES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOINTES, code)) +#define IODBG_TIMES(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCLKES, code)) +#define IODBG_CMDQ(code) (KDBG_CODE(DBG_IOKIT, DBG_IOCMDQ, code)) +#define IODBG_MCURS(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMCURS, code)) +#define IODBG_MDESC(code) (KDBG_CODE(DBG_IOKIT, DBG_IOMDESC, code)) +#define IODBG_POWER(code) (KDBG_CODE(DBG_IOKIT, DBG_IOPOWER, code)) +#define IODBG_IOSERVICE(code) (KDBG_CODE(DBG_IOKIT, DBG_IOSERVICE, code)) + +/* IOKit specific codes - within each subclass */ + +/* DBG_IOKIT/DBG_IODISK codes */ + +/* DBG_IOKIT/DBG_IONETWORK codes */ + +/* DBG_IOKIT/DBG_IOKEYBOARD codes */ + +/* DBG_IOKIT/DBG_IOHID codes */ + +/* DBG_IOKIT/DBG_IOAUDIO codes */ + +/* DBG_IOKIT/DBG_IOSERIAL codes */ + +/* DBG_IOKIT/DBG_IOTTY codes */ + +/* DBG_IOKIT/DBG_IOWORKLOOP codes */ +#define IOWL_CLIENT 1 /* 0x05010004 */ +#define IOWL_WORK 2 /* 0x05010008 */ + +/* DBG_IOKIT/DBG_IOINTES codes */ +#define IOINTES_CLIENT 1 /* 0x05020004 */ +#define IOINTES_LAT 2 /* 0x05020008 */ +#define IOINTES_SEMA 3 /* 0x0502000c */ +#define IOINTES_INTCTXT 4 /* 0x05020010 */ +#define IOINTES_INTFLTR 5 /* 0x05020014 */ +#define IOINTES_ACTION 6 /* 0x05020018 */ +#define IOINTES_FILTER 7 /* 0x0502001c */ + +/* DBG_IOKIT/DBG_IOTIMES codes */ +#define IOTIMES_CLIENT 1 /* 0x05030004 */ +#define IOTIMES_LAT 2 /* 0x05030008 */ +#define IOTIMES_SEMA 3 /* 0x0503000c */ +#define IOTIMES_ACTION 4 /* 0x05030010 */ + +/* DBG_IOKIT/DBG_IOCMDQ codes */ +#define IOCMDQ_CLIENT 1 /* 0x05040004 */ +#define IOCMDQ_LAT 2 /* 0x05040008 */ +#define IOCMDQ_SEMA 3 /* 0x0504000c */ +#define IOCMDQ_PSEMA 4 /* 0x05040010 */ +#define IOCMDQ_PLOCK 5 /* 0x05040014 */ +#define IOCMDQ_ACTION 6 /* 0x05040018 */ + +/* DBG_IOKIT/DBG_IOMCURS codes */ + +/* DBG_IOKIT/DBG_IOMDESC codes */ + +/* DBG_IOKIT/DBG_IOPOWER codes */ +// See IOKit/pwr_mgt/IOPMlog.h for the power management codes + +/* DBG_IOKIT/DBG_IOSERVICE codes */ +#define IOSERVICE_BUSY 1 /* 0x05080004 */ +#define IOSERVICE_NONBUSY 2 /* 0x05080008 */ +#define IOSERVICE_MODULESTALL 3 /* 0x0508000C */ +#define IOSERVICE_MODULEUNSTALL 4 /* 0x05080010 */ + +#define IOSERVICE_TERMINATE_PHASE1 5 /* 0x05080014 */ +#define IOSERVICE_TERMINATE_REQUEST_OK 6 /* 0x05080018 */ +#define IOSERVICE_TERMINATE_REQUEST_FAIL 7 /* 0x0508001C */ +#define IOSERVICE_TERMINATE_SCHEDULE_STOP 8 /* 0x05080020 */ +#define IOSERVICE_TERMINATE_SCHEDULE_FINALIZE 9 /* 0x05080024 */ +#define IOSERVICE_TERMINATE_WILL 10 /* 0x05080028 */ +#define IOSERVICE_TERMINATE_DID 11 /* 0x0508002C */ +#define IOSERVICE_TERMINATE_DID_DEFER 12 /* 0x05080030 */ +#define IOSERVICE_TERMINATE_FINALIZE 13 /* 0x05080034 */ +#define IOSERVICE_TERMINATE_STOP 14 /* 0x05080038 */ +#define IOSERVICE_TERMINATE_STOP_NOP 15 /* 0x0508003C */ +#define IOSERVICE_TERMINATE_STOP_DEFER 16 /* 0x05080040 */ +#define IOSERVICE_TERMINATE_DONE 17 /* 0x05080044 */ + +#endif /* ! IOKIT_IOTIMESTAMP_H */ diff --git a/i386/include/IOKit/IOTimerEventSource.h b/i386/include/IOKit/IOTimerEventSource.h new file mode 100644 index 0000000..7cc0d38 --- /dev/null +++ b/i386/include/IOKit/IOTimerEventSource.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * IOTimerEventSource.h + * + * HISTORY + * 2-Feb-1999 Joe Liu (jliu) created. + * + */ + +#ifndef _IOTIMEREVENTSOURCE +#define _IOTIMEREVENTSOURCE + +#include + +__BEGIN_DECLS +#include +__END_DECLS + +#include +#include + +/*! + @class IOTimerEventSource : public IOEventSource + @abstract Time based event source mechanism. + @discussion An event source that implements a simple timer. A timeout handler is called once the timeout period expires. This timeout handler will be called by the work-loop that this event source is attached to. +

+ Usually a timer event source will be used to implement a timeout. In general when a driver makes a request it will need to setup a call to keep track of when the I/O doesn't complete. This class is designed to make that somewhat easier. +

+ Remember the system doesn't guarantee the accuracy of the callout. It is possible that a higher priority thread is running which will delay the execution of the action routine. In fact the thread will be made runable at the exact requested time, within the accuracy of the CPU's decrementer based interrupt, but the scheduler will then control execution. +*/ +class IOTimerEventSource : public IOEventSource +{ + OSDeclareDefaultStructors(IOTimerEventSource) + +protected: +/*! @var calloutEntry thread_call entry for preregistered thread callouts */ + void *calloutEntry; + +/*! @var abstime time to wake up next, see enable. */ + AbsoluteTime abstime; + +/*! @struct ExpansionData + @discussion This structure is private to the IOTimerEventSource implementation. + */ + struct ExpansionData + { + SInt32 calloutGeneration; + IOWorkLoop * workLoop; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*! @function timeout + @abstract Function that routes the call from the OS' timeout mechanism into a work-loop context. + @discussion timeout will normally not be called nor overridden by a subclass. If the event source is enabled then close the work-loop's gate and call the action routine. + @param self This argument will be cast to an IOTimerEventSource. */ + static void timeout(void *self); + +/*! @function setTimeoutFunc + @abstract Set's timeout as the function of calloutEntry. + @discussion IOTimerEventSource is based upon the kern/thread_call.h APIs currently. This function allocates the calloutEntry member variable by using thread_call_allocate(timeout, this). If you need to write your own subclass of IOTimerEventSource you probably should override this method to allocate an entry that points to your own timeout routine. */ + virtual void setTimeoutFunc(); + +/*! @function free + @abstract Sub-class implementation of free method, frees calloutEntry */ + virtual void free(); + +/*! @function checkForWork + @abstract Have to implement it is mandatory in $link IOEventSource, but IOTimerEventSources don't actually use this work-loop mechanism. */ + virtual bool checkForWork(); + + virtual void setWorkLoop(IOWorkLoop *workLoop); + +public: + +/*! @typedef Action + @discussion 'C' Function pointer defining the callout routine of this event source. + @param owner Owning target object. Note by a startling coincidence the first parameter in a C callout is currently used to define the target of a C++ member function. + @param sender The object that timed out. */ + typedef void (*Action)(OSObject *owner, IOTimerEventSource *sender); + +/*! @function timerEventSource + @abstract Allocates and returns an initialized timer instance. + @param owner + @param action */ + static IOTimerEventSource * + timerEventSource(OSObject *owner, Action action = 0); + +/*! @function init + @abstract Initializes the timer with an owner, and a handler to call when the timeout expires. + @param owner + @param action */ + virtual bool init(OSObject *owner, Action action = 0); + +/*! @function enable + @abstract Enables a call to the action. + @discussion Allows the action function to be called. If the timer event source was disabled while a call was outstanding and the call wasn't cancelled then it will be rescheduled. So a disable/enable pair will disable calls from this event source. */ + virtual void enable(); + +/*! @function disable + @abstract Disable a timed callout. + @discussion When disable returns the action will not be called until the next time enable(qv) is called. */ + virtual void disable(); + + +/*! @function setTimeoutTicks + @abstract Setup a callback at after the delay in scheduler ticks. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up, in scheduler ticks, whatever that may be. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutTicks(UInt32 ticks); + +/*! @function setTimeoutMS + @abstract Setup a callback at after the delay in milliseconds. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up, time in milliseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutMS(UInt32 ms); + +/*! @function setTimeoutUS + @abstract Setup a callback at after the delay in microseconds. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up, time in microseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeoutUS(UInt32 us); + +/*! @function setTimeout + @abstract Setup a callback at after the delay in some unit. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up in some defined unit. + @param scale_factor Define the unit of interval, default to nanoseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(UInt32 interval, + UInt32 scale_factor = kNanosecondScale); + +#if !defined(__LP64__) + virtual IOReturn setTimeout(mach_timespec_t interval) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function setTimeout + @abstract Setup a callback at after the delay in decrementer ticks. See wakeAtTime(AbsoluteTime). + @param interval Delay from now to wake up in decrementer ticks. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn setTimeout(AbsoluteTime interval); + +/*! @function wakeAtTimeTicks + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in scheduler quantums, whatever that is? + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeTicks(UInt32 ticks); + +/*! @function wakeAtTimeMS + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in milliseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeMS(UInt32 ms); + +/*! @function wakeAtTimeUS + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in microseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTimeUS(UInt32 us); + +/*! @function wakeAtTime + @abstract Setup a callback at this absolute time. See wakeAtTime(AbsoluteTime). + @param abstime Time to wake up in some unit. + @param scale_factor Define the unit of abstime, default to nanoseconds. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared. */ + virtual IOReturn wakeAtTime(UInt32 abstime, + UInt32 scale_factor = kNanosecondScale); + +#if !defined(__LP64__) + virtual IOReturn wakeAtTime(mach_timespec_t abstime) + APPLE_KEXT_DEPRECATED; +#endif + +/*! @function wakeAtTime + @abstract Setup a callback at this absolute time. + @discussion Starts the timer, which will expire at abstime. After it expires, the timer will call the 'action' registered in the init() function. This timer is not periodic, a further call is needed to reset and restart the timer after it expires. + @param abstime Absolute Time when to wake up, counted in 'decrementer' units and starts at zero when system boots. + @result kIOReturnSuccess if everything is fine, kIOReturnNoResources if action hasn't been declared by init or IOEventSource::setAction (qqv). */ + virtual IOReturn wakeAtTime(AbsoluteTime abstime); + +/*! @function cancelTimeout + @abstract Disable any outstanding calls to this event source. + @discussion Clear down any oustanding calls. By the time this function completes it is guaranteed that the action will not be called again. */ + virtual void cancelTimeout(); + +private: + static void timeoutAndRelease(void *self, void *wl); + +private: + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 0); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 1); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 2); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 3); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 4); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 5); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 6); + OSMetaClassDeclareReservedUnused(IOTimerEventSource, 7); +}; + +#endif /* !_IOTIMEREVENTSOURCE */ diff --git a/i386/include/IOKit/IOTypes.h b/i386/include/IOKit/IOTypes.h new file mode 100644 index 0000000..5d20efb --- /dev/null +++ b/i386/include/IOKit/IOTypes.h @@ -0,0 +1,238 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_IOTYPES_H +#define __IOKIT_IOTYPES_H + +#ifndef IOKIT +#define IOKIT 1 +#endif /* !IOKIT */ + +#if KERNEL +#include +#else +#include +#include +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef NULL +#if defined (__cplusplus) +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif + +/* + * Simple data types. + */ +#ifndef __MACTYPES__ /* CF MacTypes.h */ +#ifndef __TYPES__ /* guess... Mac Types.h */ + +#include +#include + +#endif /* __TYPES__ */ +#endif /* __MACTYPES__ */ + +#if KERNEL +#include +#endif + +typedef UInt32 IOOptionBits; +typedef SInt32 IOFixed; +typedef UInt32 IOVersion; +typedef UInt32 IOItemCount; +typedef UInt32 IOCacheMode; + +typedef UInt32 IOByteCount32; +typedef UInt64 IOByteCount64; + +typedef UInt32 IOPhysicalAddress32; +typedef UInt64 IOPhysicalAddress64; +typedef UInt32 IOPhysicalLength32; +typedef UInt64 IOPhysicalLength64; + +#ifdef __LP64__ +typedef mach_vm_address_t IOVirtualAddress; +#else +typedef vm_address_t IOVirtualAddress; +#endif + +#if defined(__LP64__) && defined(KERNEL) +typedef IOByteCount64 IOByteCount; +#else +typedef IOByteCount32 IOByteCount; +#endif + +typedef IOVirtualAddress IOLogicalAddress; + +#if defined(__LP64__) && defined(KERNEL) + +typedef IOPhysicalAddress64 IOPhysicalAddress; +typedef IOPhysicalLength64 IOPhysicalLength; +#define IOPhysical32( hi, lo ) ((UInt64) lo + ((UInt64)(hi) << 32)) +#define IOPhysSize 64 + +#else + +typedef IOPhysicalAddress32 IOPhysicalAddress; +typedef IOPhysicalLength32 IOPhysicalLength; +#define IOPhysical32( hi, lo ) (lo) +#define IOPhysSize 32 + +#endif + + +typedef struct +{ + IOPhysicalAddress address; + IOByteCount length; +} IOPhysicalRange; + +typedef struct +{ + IOVirtualAddress address; + IOByteCount length; +} IOVirtualRange; + +#ifdef __LP64__ +typedef IOVirtualRange IOAddressRange; +#else /* !__LP64__ */ +typedef struct +{ + mach_vm_address_t address; + mach_vm_size_t length; +} IOAddressRange; +#endif /* !__LP64__ */ + +/* + * Map between #defined or enum'd constants and text description. + */ +typedef struct { + int value; + const char *name; +} IONamedValue; + + +/* + * Memory alignment -- specified as a power of two. + */ +typedef unsigned int IOAlignment; + +#define IO_NULL_VM_TASK ((vm_task_t)0) + + +/* + * Pull in machine specific stuff. + */ + +//#include + +#ifndef MACH_KERNEL + +#ifndef __IOKIT_PORTS_DEFINED__ +#define __IOKIT_PORTS_DEFINED__ +typedef struct OSObject * io_object_t; +#endif /* __IOKIT_PORTS_DEFINED__ */ + +#include + +typedef io_object_t io_connect_t; +typedef io_object_t io_enumerator_t; +typedef io_object_t io_iterator_t; +typedef io_object_t io_registry_entry_t; +typedef io_object_t io_service_t; + +#define IO_OBJECT_NULL ((io_object_t) 0) + +#endif /* MACH_KERNEL */ + +// IOConnectMapMemory memoryTypes +enum { + kIODefaultMemoryType = 0 +}; + +enum { + kIODefaultCache = 0, + kIOInhibitCache = 1, + kIOWriteThruCache = 2, + kIOCopybackCache = 3, + kIOWriteCombineCache = 4 +}; + +// IOMemory mapping options +enum { + kIOMapAnywhere = 0x00000001, + + kIOMapCacheMask = 0x00000700, + kIOMapCacheShift = 8, + kIOMapDefaultCache = kIODefaultCache << kIOMapCacheShift, + kIOMapInhibitCache = kIOInhibitCache << kIOMapCacheShift, + kIOMapWriteThruCache = kIOWriteThruCache << kIOMapCacheShift, + kIOMapCopybackCache = kIOCopybackCache << kIOMapCacheShift, + kIOMapWriteCombineCache = kIOWriteCombineCache << kIOMapCacheShift, + + kIOMapUserOptionsMask = 0x00000fff, + + kIOMapReadOnly = 0x00001000, + + kIOMapStatic = 0x01000000, + kIOMapReference = 0x02000000, + kIOMapUnique = 0x04000000 +}; + +/*! @enum Scale Factors + @discussion Used when a scale_factor parameter is required to define a unit of time. + @constant kNanosecondScale Scale factor for nanosecond based times. + @constant kMicrosecondScale Scale factor for microsecond based times. + @constant kMillisecondScale Scale factor for millisecond based times. + @constant kTickScale Scale factor for the standard (100Hz) tick. + @constant kSecondScale Scale factor for second based times. */ + +enum { + kNanosecondScale = 1, + kMicrosecondScale = 1000, + kMillisecondScale = 1000 * 1000, + kSecondScale = 1000 * 1000 * 1000, + kTickScale = (kSecondScale / 100) +}; + +/* compatibility types */ + + +#ifdef __cplusplus +} +#endif + +#endif /* ! __IOKIT_IOTYPES_H */ diff --git a/i386/include/IOKit/IOUserClient.h b/i386/include/IOKit/IOUserClient.h new file mode 100644 index 0000000..c1d7fe5 --- /dev/null +++ b/i386/include/IOKit/IOUserClient.h @@ -0,0 +1,333 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Changes to this API are expected. + */ + +#ifndef _IOKIT_IOUSERCLIENT_H +#define _IOKIT_IOUSERCLIENT_H + +#include +#include +#include + + +enum { + kIOUCTypeMask = 0x0000000f, + kIOUCScalarIScalarO = 0, + kIOUCScalarIStructO = 2, + kIOUCStructIStructO = 3, + kIOUCScalarIStructI = 4, + + kIOUCForegroundOnly = 0x00000010, +}; + +/*! @enum + @abstract Constant to denote a variable length structure argument to IOUserClient. + @constant kIOUCVariableStructureSize Use in the structures IOExternalMethod, IOExternalAsyncMethod, IOExternalMethodDispatch to specify the size of the structure is variable. +*/ +enum { + kIOUCVariableStructureSize = 0xffffffff +}; + + +typedef IOReturn (IOService::*IOMethod)(void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (IOService::*IOAsyncMethod)(OSAsyncReference asyncRef, + void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +typedef IOReturn (IOService::*IOTrap)(void * p1, void * p2, void * p3, + void * p4, void * p5, void * p6 ); + +struct IOExternalMethod { + IOService * object; + IOMethod func; + IOOptionBits flags; + IOByteCount count0; + IOByteCount count1; +}; + +struct IOExternalAsyncMethod { + IOService * object; + IOAsyncMethod func; + IOOptionBits flags; + IOByteCount count0; + IOByteCount count1; +}; + +struct IOExternalTrap { + IOService * object; + IOTrap func; +}; + +enum { + kIOUserNotifyMaxMessageSize = 64 +}; + +// keys for clientHasPrivilege +#define kIOClientPrivilegeAdministrator "root" +#define kIOClientPrivilegeLocalUser "local" +#define kIOClientPrivilegeForeground "foreground" + +/*! @enum + @abstract Constants to specify the maximum number of scalar arguments in the IOExternalMethodArguments structure. These constants are documentary since the scalarInputCount, scalarOutputCount fields reflect the actual number passed. + @constant kIOExternalMethodScalarInputCountMax The maximum number of scalars able to passed on input. + @constant kIOExternalMethodScalarOutputCountMax The maximum number of scalars able to passed on output. +*/ +enum { + kIOExternalMethodScalarInputCountMax = 16, + kIOExternalMethodScalarOutputCountMax = 16, +}; + + +struct IOExternalMethodArguments +{ + uint32_t version; + + uint32_t selector; + + mach_port_t asyncWakePort; + io_user_reference_t * asyncReference; + uint32_t asyncReferenceCount; + + const uint64_t * scalarInput; + uint32_t scalarInputCount; + + const void * structureInput; + uint32_t structureInputSize; + + IOMemoryDescriptor * structureInputDescriptor; + + uint64_t * scalarOutput; + uint32_t scalarOutputCount; + + void * structureOutput; + uint32_t structureOutputSize; + + IOMemoryDescriptor * structureOutputDescriptor; + uint32_t structureOutputDescriptorSize; + + uint32_t __reserved[32]; +}; + +typedef IOReturn (*IOExternalMethodAction)(OSObject * target, void * reference, + IOExternalMethodArguments * arguments); +struct IOExternalMethodDispatch +{ + IOExternalMethodAction function; + uint32_t checkScalarInputCount; + uint32_t checkStructureInputSize; + uint32_t checkScalarOutputCount; + uint32_t checkStructureOutputSize; +}; + +enum { +#define IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION 1 + kIOExternalMethodArgumentsCurrentVersion = IO_EXTERNAL_METHOD_ARGUMENTS_CURRENT_VERSION +}; + + +/*! + @class IOUserClient + @abstract Provides a basis for communication between client applications and I/O Kit objects. +*/ + + +class IOUserClient : public IOService +{ + OSDeclareAbstractStructors(IOUserClient) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. +*/ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData * reserved; + +private: + OSSet * mappings; + UInt8 sharedInstance; + UInt8 __reservedA[3]; + void * __reserved[7]; + +public: + virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * arguments, + IOExternalMethodDispatch * dispatch = 0, OSObject * target = 0, void * reference = 0 ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, io_user_reference_t refCon); + +private: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOUserClient, 0); + OSMetaClassDeclareReservedUnused(IOUserClient, 1); +#else + OSMetaClassDeclareReservedUsed(IOUserClient, 0); + OSMetaClassDeclareReservedUsed(IOUserClient, 1); +#endif + OSMetaClassDeclareReservedUnused(IOUserClient, 2); + OSMetaClassDeclareReservedUnused(IOUserClient, 3); + OSMetaClassDeclareReservedUnused(IOUserClient, 4); + OSMetaClassDeclareReservedUnused(IOUserClient, 5); + OSMetaClassDeclareReservedUnused(IOUserClient, 6); + OSMetaClassDeclareReservedUnused(IOUserClient, 7); + OSMetaClassDeclareReservedUnused(IOUserClient, 8); + OSMetaClassDeclareReservedUnused(IOUserClient, 9); + OSMetaClassDeclareReservedUnused(IOUserClient, 10); + OSMetaClassDeclareReservedUnused(IOUserClient, 11); + OSMetaClassDeclareReservedUnused(IOUserClient, 12); + OSMetaClassDeclareReservedUnused(IOUserClient, 13); + OSMetaClassDeclareReservedUnused(IOUserClient, 14); + OSMetaClassDeclareReservedUnused(IOUserClient, 15); + + +protected: + static IOReturn sendAsyncResult(OSAsyncReference reference, + IOReturn result, void *args[], UInt32 numArgs); + static void setAsyncReference(OSAsyncReference asyncRef, + mach_port_t wakePort, + void *callback, void *refcon); + + static IOReturn sendAsyncResult64(OSAsyncReference64 reference, + IOReturn result, io_user_reference_t args[], UInt32 numArgs); + static void setAsyncReference64(OSAsyncReference64 asyncRef, + mach_port_t wakePort, + mach_vm_address_t callback, io_user_reference_t refcon); +public: + + static IOReturn clientHasPrivilege( void * securityToken, + const char * privilegeName ); + + /*! + @function releaseAsyncReference64 + @abstract Release the mach_port_t reference held within the OSAsyncReference64 structure. + @discussion The OSAsyncReference64 structure passed to async methods holds a reference to the wakeup mach port, which should be released to balance each async method call. Behavior is undefined if these calls are not correctly balanced. + @param reference The reference passed to the subclass IOAsyncMethod, or externalMethod() in the IOExternalMethodArguments.asyncReference field. + @result A return code. + */ + static IOReturn releaseAsyncReference64(OSAsyncReference64 reference); + /*! + @function releaseNotificationPort + @abstract Release the mach_port_t passed to registerNotificationPort(). + @discussion The mach_port_t passed to the registerNotificationPort() methods should be released to balance each call to registerNotificationPort(). Behavior is undefined if these calls are not correctly balanced. + @param reference The mach_port_t argument previously passed to the subclass implementation of registerNotificationPort(). + @result A return code. + */ + static IOReturn releaseNotificationPort(mach_port_t port); + + virtual bool init(); + virtual bool init( OSDictionary * dictionary ); + // Currently ignores the all args, just passes up to IOService::init() + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type, + OSDictionary * properties); + + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type); + + virtual void free(); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + virtual IOService * getService( void ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, UInt32 refCon ); + + virtual IOReturn getNotificationSemaphore( UInt32 notification_type, + semaphore_t * semaphore ); + + virtual IOReturn connectClient( IOUserClient * client ); + + // memory will be released by user client when last map is destroyed + virtual IOReturn clientMemoryForType( UInt32 type, + IOOptionBits * options, + IOMemoryDescriptor ** memory ); + +#if !__LP64__ +private: + APPLE_KEXT_COMPATIBILITY_VIRTUAL + IOMemoryMap * mapClientMemory( IOOptionBits type, + task_t task, + IOOptionBits mapFlags = kIOMapAnywhere, + IOVirtualAddress atAddress = 0 ); +#endif + +public: + + /*! + @function removeMappingForDescriptor + Remove the first mapping created from the memory descriptor returned by clientMemoryForType() from IOUserClient's list of mappings. If such a mapping exists, it is retained and the reference currently held by IOUserClient is returned to the caller. + @param memory The memory descriptor instance previously returned by the implementation of clientMemoryForType(). + @result A reference to the first IOMemoryMap instance found in the list of mappings created by IOUserClient from that passed memory descriptor is returned, or zero if none exist. The caller should release this reference. + */ + IOMemoryMap * removeMappingForDescriptor(IOMemoryDescriptor * memory); + + /*! + @function exportObjectToClient + Make an arbitrary OSObject available to the client task. + @param task The task. + @param obj The object we want to export to the client. + @param clientObj Returned value is the client's port name. + */ + virtual IOReturn exportObjectToClient(task_t task, + OSObject *obj, io_object_t *clientObj); + + // Old methods for accessing method vector backward compatiblility only + virtual IOExternalMethod * + getExternalMethodForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + virtual IOExternalAsyncMethod * + getExternalAsyncMethodForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + + // Methods for accessing method vector. + virtual IOExternalMethod * + getTargetAndMethodForIndex( IOService ** targetP, UInt32 index ); + virtual IOExternalAsyncMethod * + getAsyncTargetAndMethodForIndex( IOService ** targetP, UInt32 index ); + + // Methods for accessing trap vector - old and new style + virtual IOExternalTrap * + getExternalTrapForIndex( UInt32 index ) + APPLE_KEXT_DEPRECATED; + + virtual IOExternalTrap * + getTargetAndTrapForIndex( IOService **targetP, UInt32 index ); +}; + +#endif /* ! _IOKIT_IOUSERCLIENT_H */ + diff --git a/i386/include/IOKit/IOWorkLoop.h b/i386/include/IOKit/IOWorkLoop.h new file mode 100644 index 0000000..808329a --- /dev/null +++ b/i386/include/IOKit/IOWorkLoop.h @@ -0,0 +1,321 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +Copyright (c) 1998 Apple Computer, Inc. All rights reserved. +HISTORY + 1998-7-13 Godfrey van der Linden(gvdl) + Created. + 1998-10-30 Godfrey van der Linden(gvdl) + Converted to C++ +*/ + +#ifndef __IOKIT_IOWORKLOOP_H +#define __IOKIT_IOWORKLOOP_H + +#include +#include +#include +#include + +#include + +class IOEventSource; +class IOTimerEventSource; +class IOCommandGate; + +/*! @class IOWorkLoop + @discussion An IOWorkLoop is a thread of control that is intended to be used to provide single threaded access to hardware. This class has no knowledge of the nature and type of the events that it marshals and forwards. When a device driver successfully starts (see IOService::start), it is expected to create the event sources it will need to receive events. Then a work loop is initialized and the events are added to the work loop for monitoring. In general this set up will be automated by the family superclass of the specific device. +

+ The thread main method walks the event source linked list and messages each one requesting a work check. At this point each event source is expected to notify its registered owner that the event has occurred. After each event has been walked and each indicates that another loop isn't required (by setting the 'more' flag to false) the thread will go to sleep on a signaling semaphore. +

+ When an event source is registered with a work loop it is informed of the semaphore to use to wake up the loop. +*/ +class IOWorkLoop : public OSObject +{ + OSDeclareDefaultStructors(IOWorkLoop) + +public: +/*! + @typedef Action + @discussion Type and arguments of callout C function that is used when +a runCommand is executed by a client. Cast to this type when you want a C++ +member function to be used. Note the arg1 - arg3 parameters are straight pass +through from the runCommand to the action callout. + @param target + Target of the function, can be used as a refcon. Note if a C++ function +was specified, this parameter is implicitly the first parameter in the target +member function's parameter list. + @param arg0 Argument to action from run operation. + @param arg1 Argument to action from run operation. + @param arg2 Argument to action from run operation. + @param arg3 Argument to action from run operation. +*/ + typedef IOReturn (*Action)(OSObject *target, + void *arg0, void *arg1, + void *arg2, void *arg3); + enum { + kPreciousStack = 0x00000001 + }; + +private: +/*! @function threadMainContinuation + @abstract Static function that calls the threadMain function. +*/ + static void threadMainContinuation(IOWorkLoop *self); + +protected: + +/*! @typedef maintCommandEnum + @discussion Enumeration of commands that _maintCommand can deal with. + @constant mAddEvent Used to tag a Remove event source command. + @constant mRemoveEvent Used to tag a Remove event source command. +*/ + typedef enum { mAddEvent, mRemoveEvent } maintCommandEnum; + +/*! @var gateLock + Mutual exclusion lock that is used by close and open Gate functions. + This is a recursive lock, which allows multiple layers of code to share a single IOWorkLoop without deadlock. This is common in IOKit since threads of execution tend to follow the service plane in the IORegistry, and multiple objects along the call path may acquire the gate for the same (shared) workloop. +*/ + IORecursiveLock *gateLock; + +/*! @var eventChain + Pointer to first event source in linked list. +*/ + IOEventSource *eventChain; + +/*! @var controlG + Internal control gate to maintain event system. +*/ + IOCommandGate *controlG; + +/*! @var workToDoLock + The spin lock that is used to guard the 'workToDo' variable. +*/ + IOSimpleLock *workToDoLock; + +/*! @var workThread + Work loop thread. +*/ + IOThread workThread; + +/*! @var workToDo + Used to to indicate that an interrupt has fired and needs to be processed. +*/ + volatile bool workToDo; + +/*! @var loopRestart + Set if an event chain has been changed and the system has to be rechecked from start. (Internal use only) +*/ + bool loopRestart; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. +*/ + struct ExpansionData { + IOOptionBits options; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +/*! @function _maintRequest + @abstract Synchronous implementation of addEventSource and removeEventSource functions. + @discussion This function implements the commands as defined in the maintCommandEnum. It can be subclassed but it isn't an external API in the usual sense. A subclass implementation of _maintRequest would be called synchronously with respect to the work loop and it should be implemented in the usual way that an ioctl would be. + @return kIOReturnUnsupported if the command given is not implemented, kIOReturnSuccess otherwise. +*/ + virtual IOReturn _maintRequest(void *command, void *data, void *, void *); + +/*! @function free + @discussion Mandatory free of the object independent of the current retain count. If the work loop is running, this method will not return until the thread has successfully terminated. Each event source in the chain will be released and the working semaphore will be destroyed. +

+ If the client has some outstanding requests on an event they will never be informed of completion. If an external thread is blocked on any of the event sources they will be awakened with a KERN_INTERUPTED status. +*/ + virtual void free(); + +/*! @function threadMain + @discussion Work loop threads main function. This function consists of 3 + loops: the outermost loop is the semaphore clear and wait loop, the middle + loop terminates when there is no more work, and the inside loop walks the + event list calling the checkForWork method in each event source. If an + event source has more work to do, it can set the more flag and the middle + loop will repeat. When no more work is outstanding the outermost will + sleep until an event is signalled. +*/ + virtual void threadMain(); + +public: + +/*! @function workLoop + @abstract Factory member function to construct and intialize a work loop. + @result Returns a workLoop instance if constructed successfully, 0 otherwise. +*/ + static IOWorkLoop *workLoop(); + +/*! @function workLoopWithOptions(IOOptionBits options) + @abstract Factory member function to constuct and intialize a work loop. + @param options Options - kPreciousStack to avoid stack deallocation on paging path. + @result Returns a workLoop instance if constructed successfully, 0 otherwise. +*/ + static IOWorkLoop *workLoopWithOptions(IOOptionBits options); + +/*! @function init + @discussion Initializes an instance of the workloop. This method creates and initializes the signaling semaphore, the controller gate lock, and spawns the thread that will continue executing. + @result Returns true if initialized successfully, false otherwise. +*/ + virtual bool init(); + +/*! @function getThread + @abstract Gets the workThread. + @result Returns workThread. +*/ + virtual IOThread getThread() const; + +/*! @function onThread + @abstract Is the current execution context on the work thread? + @result Returns true if IOThreadSelf() == workThread. +*/ + virtual bool onThread() const; + +/*! @function inGate + @abstract Is the current execution context holding the work-loop's gate? + @result Returns true if IOThreadSelf() is gate holder. +*/ + virtual bool inGate() const; + +/*! @function addEventSource + @discussion Add an event source to be monitored by the work loop. This function does not return until the work loop has acknowledged the arrival of the new event source. When a new event has been added the threadMain will always restart its loop and check all outstanding events. The event source is retained by the work loop. + @param newEvent Pointer to IOEventSource subclass to add. + @result Always returns kIOReturnSuccess. +*/ + virtual IOReturn addEventSource(IOEventSource *newEvent); + +/*! @function removeEventSource + @discussion Remove an event source from the work loop. This function does not return until the work loop has acknowledged the removal of the event source. When an event has been removed the threadMain will always restart its loop and check all outstanding events. The event source will be released before return. + @param toRemove Pointer to IOEventSource subclass to remove. + @result Returns kIOReturnSuccess if successful, kIOReturnBadArgument if toRemove couldn't be found. +*/ + virtual IOReturn removeEventSource(IOEventSource *toRemove); + +/*! @function enableAllEventSources + @abstract Calls enable() in all event sources. + @discussion For all event sources in eventChain, call enable() function. See IOEventSource::enable(). +*/ + virtual void enableAllEventSources() const; + +/*! @function disableAllEventSources + @abstract Calls disable() in all event sources. + @discussion For all event sources in eventChain, call disable() function. See IOEventSource::disable(). +*/ + virtual void disableAllEventSources() const; + +/*! @function enableAllInterrupts + @abstract Calls enable() in all interrupt event sources. + @discussion For all event sources (ES) for which IODynamicCast(IOInterruptEventSource, ES) is valid, in eventChain call enable() function. See IOEventSource::enable(). +*/ + virtual void enableAllInterrupts() const; + +/*! @function disableAllInterrupts + @abstract Calls disable() in all interrupt event sources. + @discussion For all event sources (ES) for which IODynamicCast(IOInterruptEventSource, ES) is valid, in eventChain call disable() function. See IOEventSource::disable(). +*/ + virtual void disableAllInterrupts() const; + + +protected: + // Internal APIs used by event sources to control the thread + friend class IOEventSource; + friend class IOTimerEventSource; + virtual void signalWorkAvailable(); + virtual void openGate(); + virtual void closeGate(); + virtual bool tryCloseGate(); + virtual int sleepGate(void *event, UInt32 interuptibleType); + virtual void wakeupGate(void *event, bool oneThread); + +public: + /* methods available in Mac OS X 10.1 or later */ + +/*! @function runAction + @abstract Single thread a call to an action with the work-loop. + @discussion Client function that causes the given action to be called in a single threaded manner. Beware: the work-loop's gate is recursive and runAction can cause direct or indirect re-entrancy. When executing on a client's thread, runAction will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources. + @param action Pointer to function to be executed in work-loop context. + @param arg0 Parameter for action parameter, defaults to 0. + @param arg1 Parameter for action parameter, defaults to 0. + @param arg2 Parameter for action parameter, defaults to 0. + @param arg3 Parameter for action parameter, defaults to 0. + @result Returns the value of the Action callout. +*/ + virtual IOReturn runAction(Action action, OSObject *target, + void *arg0 = 0, void *arg1 = 0, + void *arg2 = 0, void *arg3 = 0); + +/*! @function runEventSources + @discussion Consists of the inner 2 loops of the threadMain function(qv). + The outer loop terminates when there is no more work, and the inside loop + walks the event list calling the checkForWork method in each event source. + If an event source has more work to do, it can set the more flag and the + outer loop will repeat. +

+ This function can be used to clear a priority inversion between the normal + workloop thread and multimedia's real time threads. The problem is that + the interrupt action routine is often held off by high priority threads. + So if they want to get their data now they will have to call us and ask if + any data is available. The multi-media user client will arrange for this + function to be called, which causes any pending interrupts to be processed + and the completion routines called. By the time the function returns all + outstanding work will have been completed at the real time threads + priority. + + @result Return false if the work loop is shutting down, true otherwise. +*/ + virtual bool runEventSources(); + +protected: + // Internal APIs used by event sources to control the thread + virtual int sleepGate(void *event, AbsoluteTime deadline, UInt32 interuptibleType); + +protected: +#if __LP64__ + OSMetaClassDeclareReservedUnused(IOWorkLoop, 0); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 1); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 2); +#else + OSMetaClassDeclareReservedUsed(IOWorkLoop, 0); + OSMetaClassDeclareReservedUsed(IOWorkLoop, 1); + OSMetaClassDeclareReservedUsed(IOWorkLoop, 2); +#endif + OSMetaClassDeclareReservedUnused(IOWorkLoop, 3); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 4); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 5); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 6); + OSMetaClassDeclareReservedUnused(IOWorkLoop, 7); +}; + +#endif /* !__IOKIT_IOWORKLOOP_H */ diff --git a/i386/include/IOKit/OSMessageNotification.h b/i386/include/IOKit/OSMessageNotification.h new file mode 100644 index 0000000..7d7b5e5 --- /dev/null +++ b/i386/include/IOKit/OSMessageNotification.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef __OS_OSMESSAGENOTIFICATION_H +#define __OS_OSMESSAGENOTIFICATION_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +enum { + kFirstIOKitNotificationType = 100, + kIOServicePublishNotificationType = 100, + kIOServiceMatchedNotificationType = 101, + kIOServiceTerminatedNotificationType = 102, + kIOAsyncCompletionNotificationType = 150, + kIOServiceMessageNotificationType = 160, + kLastIOKitNotificationType = 199 +}; + +enum { + kOSNotificationMessageID = 53, + kOSAsyncCompleteMessageID = 57, + kMaxAsyncArgs = 16 +}; + +enum { + kIOAsyncReservedIndex = 0, + kIOAsyncReservedCount, + + kIOAsyncCalloutFuncIndex = kIOAsyncReservedCount, + kIOAsyncCalloutRefconIndex, + kIOAsyncCalloutCount, + + kIOMatchingCalloutFuncIndex = kIOAsyncReservedCount, + kIOMatchingCalloutRefconIndex, + kIOMatchingCalloutCount, + + kIOInterestCalloutFuncIndex = kIOAsyncReservedCount, + kIOInterestCalloutRefconIndex, + kIOInterestCalloutServiceIndex, + kIOInterestCalloutCount +}; + + + +// -------------- +enum { + kOSAsyncRef64Count = 8, + kOSAsyncRef64Size = kOSAsyncRef64Count * ((int) sizeof(io_user_reference_t)) +}; +typedef io_user_reference_t OSAsyncReference64[kOSAsyncRef64Count]; + +struct OSNotificationHeader64 { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference64 reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent64 { + natural_t messageType; + io_user_reference_t messageArgument[1]; +}; +#pragma pack() +// -------------- + +#if !KERNEL_USER32 + +enum { + kOSAsyncRefCount = 8, + kOSAsyncRefSize = 32 +}; +typedef natural_t OSAsyncReference[kOSAsyncRefCount]; + +struct OSNotificationHeader { + mach_msg_size_t size; /* content size */ + natural_t type; + OSAsyncReference reference; + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + unsigned char content[]; +#else + unsigned char content[0]; +#endif +}; + +#pragma pack(4) +struct IOServiceInterestContent { + natural_t messageType; + void * messageArgument[1]; +}; +#pragma pack() + +#endif /* KERNEL_USER32 */ + +struct IOAsyncCompletionContent { + IOReturn result; +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) + void * args[] __attribute__ ((packed)); +#else + void * args[0] __attribute__ ((packed)); +#endif +}; + +#ifndef __cplusplus +typedef struct OSNotificationHeader OSNotificationHeader; +typedef struct IOServiceInterestContent IOServiceInterestContent; +typedef struct IOAsyncCompletionContent IOAsyncCompletionContent; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __OS_OSMESSAGENOTIFICATION_H */ + diff --git a/i386/include/IOKit/acpi/.svn/all-wcprops b/i386/include/IOKit/acpi/.svn/all-wcprops new file mode 100644 index 0000000..08ecfe0 --- /dev/null +++ b/i386/include/IOKit/acpi/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/acpi +END +IOACPIPlatformDevice.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/acpi/IOACPIPlatformDevice.h +END +IOACPITypes.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/acpi/IOACPITypes.h +END +IOACPIPlatformExpert.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/acpi/IOACPIPlatformExpert.h +END diff --git a/i386/include/IOKit/acpi/.svn/entries b/i386/include/IOKit/acpi/.svn/entries new file mode 100644 index 0000000..145a0d3 --- /dev/null +++ b/i386/include/IOKit/acpi/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/acpi +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOACPIPlatformDevice.h +file + + + + +2013-08-27T23:54:18.000000Z +64eb1d48dd45190c9f69769f7566453d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11125 + +IOACPITypes.h +file + + + + +2013-08-27T23:54:18.000000Z +44b2121bb13129f31039e82e36f75495 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3800 + +IOACPIPlatformExpert.h +file + + + + +2013-08-27T23:54:18.000000Z +a4a4f70ee4996b528606dbfd296ef4ac +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8283 + diff --git a/i386/include/IOKit/acpi/.svn/text-base/IOACPIPlatformDevice.h.svn-base b/i386/include/IOKit/acpi/.svn/text-base/IOACPIPlatformDevice.h.svn-base new file mode 100644 index 0000000..ebf0ccf --- /dev/null +++ b/i386/include/IOKit/acpi/.svn/text-base/IOACPIPlatformDevice.h.svn-base @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOACPIPLATFORMDEVICE_H +#define _IOKIT_IOACPIPLATFORMDEVICE_H + +#include +#include +#include + +class IOACPIPlatformExpert; + +class IOACPIPlatformDevice : public IOPlatformDevice +{ + OSDeclareDefaultStructors( IOACPIPlatformDevice ) + +protected: + void * _deviceHandle; + UInt32 _deviceType; + UInt32 _powerFlags; + UInt32 * _powerStateFlags; + UInt32 _sleepPowerState; + IOService * _acpiParent; + IOACPIPlatformExpert * _platform; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties + of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) + */ + ExpansionData * reserved; + + virtual bool initACPIPowerManagement( IOService * powerParent ); + virtual void stopACPIPowerManagement( IOService * powerParent ); + +public: + virtual bool init( IOService * platform, + void * handle, + OSDictionary * properties ); + + virtual void free( void ); + + virtual bool attachToParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + + virtual void detachFromParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + + virtual bool getPathComponent( char * path, int * length, + const IORegistryPlane * plane ) const; + + virtual bool compareName( OSString * name, + OSString ** matched ) const; + + virtual IOReturn getResources( void ); + + virtual void * getDeviceHandle( void ) const; + + virtual UInt32 getDeviceStatus( void ) const; + + enum { + kTypeDevice = 0, + kTypeProcessor = 1, + kTypePowerResource = 2 + }; + + virtual UInt32 getDeviceType( void ) const; + + virtual void setDeviceType( UInt32 deviceType ); + + // Method (object) evaluation + + virtual IOReturn validateObject( const OSSymbol * objectName ); + + virtual IOReturn validateObject( const char * objectName ); + + virtual IOReturn evaluateObject( const OSSymbol * objectName, + OSObject ** result = 0, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateObject( const char * objectName, + OSObject ** result = 0, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const OSSymbol * objectName, + UInt32 * resultInt32, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const char * objectName, + UInt32 * resultInt32, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const OSSymbol * objectName, + UInt64 * resultInt64, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const char * objectName, + UInt64 * resultInt64, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + // ACPI table access + + virtual const OSData * getACPITableData( const char * tableName, + UInt32 tableInstance = 0 ) const; + + // Map ACPI event to interrupt event source index + + virtual SInt32 installInterruptForFixedEvent( UInt32 fixedEvent ); + + virtual SInt32 installInterruptForGPE( UInt32 gpeNumber, + void * gpeBlockDevice = 0, + IOOptionBits options = 0 ); + + // ACPI global lock acquire/release + + virtual IOReturn acquireGlobalLock( UInt32 * lockToken, + const mach_timespec_t * timeout = 0 ); + + virtual void releaseGlobalLock( UInt32 lockToken ); + + // Address space handler registration + + virtual IOReturn registerAddressSpaceHandler( + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + void * context, + IOOptionBits options = 0 ); + + virtual void unregisterAddressSpaceHandler( + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + IOOptionBits options = 0 ); + + // Address space access + + virtual IOReturn readAddressSpace( UInt64 * value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset = 0, + IOOptionBits options = 0 ); + + virtual IOReturn writeAddressSpace( UInt64 value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset = 0, + IOOptionBits options = 0 ); + + // Power management + + virtual bool hasSystemWakeCapability( void ) const; + + virtual IOReturn setSystemWakeCapabilityEnable( bool enable ); + + virtual bool hasACPIPowerStateSupport( UInt32 powerState ) const; + + virtual IOReturn setACPIPowerManagementEnable( + bool enable, + UInt32 powerState = kIOACPIDevicePowerStateD3, + IOOptionBits options = 0 ); + + virtual IOReturn setPowerState( unsigned long powerState, + IOService * whatDevice ); + + // I/O space helpers + + virtual void ioWrite32( UInt16 offset, UInt32 value, + IOMemoryMap * map = 0 ); + + virtual void ioWrite16( UInt16 offset, UInt16 value, + IOMemoryMap * map = 0 ); + + virtual void ioWrite8( UInt16 offset, UInt8 value, + IOMemoryMap * map = 0 ); + + virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 ); + + virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 ); + + virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 ); + + // vtable padding + + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 0 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 1 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 2 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 3 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 4 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 5 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 6 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 7 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 8 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 9 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 10 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 11 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 12 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 13 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 14 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 15 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 16 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 17 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 18 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 19 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 20 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 21 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 22 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 23 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 24 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 25 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 26 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 27 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 28 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 29 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 30 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 31 ); +}; + +#endif /* !_IOKIT_IOACPIPLATFORMDEVICE_H */ diff --git a/i386/include/IOKit/acpi/.svn/text-base/IOACPIPlatformExpert.h.svn-base b/i386/include/IOKit/acpi/.svn/text-base/IOACPIPlatformExpert.h.svn-base new file mode 100644 index 0000000..413f396 --- /dev/null +++ b/i386/include/IOKit/acpi/.svn/text-base/IOACPIPlatformExpert.h.svn-base @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOACPIPLATFORMEXPERT_H +#define _IOKIT_IOACPIPLATFORMEXPERT_H + +#include // superclass +#include // children + +class IOACPIPlatformExpert : public IODTPlatformExpert +{ + OSDeclareAbstractStructors( IOACPIPlatformExpert ) + + friend class IOACPIPlatformDevice; + +protected: + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties + of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) + */ + ExpansionData * reserved; + +public: + virtual bool start( IOService * provider ); + +protected: + // Map ACPI event to interrupt event source index + + virtual SInt32 installDeviceInterruptForFixedEvent( + IOService * device, + UInt32 fixedEvent ) = 0; + + virtual SInt32 installDeviceInterruptForGPE( + IOService * device, + UInt32 gpeNumber, + void * gpeBlockDevice, + IOOptionBits options ) = 0; + + // ACPI global lock acquisition + + virtual IOReturn acquireGlobalLock( IOService * client, + UInt32 * lockToken, + const mach_timespec_t * timeout ) = 0; + + virtual void releaseGlobalLock( IOService * client, + UInt32 lockToken ) = 0; + + // ACPI method and object evaluation + + virtual IOReturn validateObject( IOACPIPlatformDevice * device, + const OSSymbol * objectName ) = 0; + + virtual IOReturn validateObject( IOACPIPlatformDevice * device, + const char * objectName ); + + virtual IOReturn evaluateObject( IOACPIPlatformDevice * device, + const OSSymbol * objectName, + OSObject ** result, + OSObject * params[], + IOItemCount paramCount, + IOOptionBits options ) = 0; + + virtual IOReturn evaluateObject( IOACPIPlatformDevice * device, + const char * objectName, + OSObject ** result, + OSObject * params[], + IOItemCount paramCount, + IOOptionBits options ); + + // ACPI table + + virtual const OSData * getACPITableData( + const char * tableName, + UInt32 tableInstance ) = 0; + + // Address space handler + + virtual IOReturn registerAddressSpaceHandler( + IOACPIPlatformDevice * device, + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + void * context, + IOOptionBits options ) = 0; + + virtual void unregisterAddressSpaceHandler( + IOACPIPlatformDevice * device, + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + IOOptionBits options ) = 0; + + // Address space read/write + + virtual IOReturn readAddressSpace( UInt64 * value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset, + IOOptionBits options ) = 0; + + virtual IOReturn writeAddressSpace( UInt64 value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset, + IOOptionBits options ) = 0; + + // Device power management + + virtual IOReturn setDevicePowerState( IOACPIPlatformDevice * device, + UInt32 powerState ) = 0; + + virtual IOReturn getDevicePowerState( IOACPIPlatformDevice * device, + UInt32 * powerState ) = 0; + + virtual IOReturn setDeviceWakeEnable( IOACPIPlatformDevice * device, + bool enable ) = 0; + + // vtable padding + + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 0 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 1 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 2 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 3 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 4 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 5 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 6 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 7 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 8 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 9 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 10 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 11 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 12 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 13 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 14 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 15 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 16 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 17 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 18 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 19 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 20 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 21 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 22 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 23 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 24 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 25 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 26 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 27 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 28 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 29 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 30 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 31 ); +}; + +#endif /* !_IOKIT_IOACPIPLATFORMEXPERT_H */ diff --git a/i386/include/IOKit/acpi/.svn/text-base/IOACPITypes.h.svn-base b/i386/include/IOKit/acpi/.svn/text-base/IOACPITypes.h.svn-base new file mode 100644 index 0000000..6215cd4 --- /dev/null +++ b/i386/include/IOKit/acpi/.svn/text-base/IOACPITypes.h.svn-base @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOACPITYPES_H +#define __IOKIT_IOACPITYPES_H + +#include + +extern const IORegistryPlane * gIOACPIPlane; +extern const OSSymbol * gIOACPIHardwareIDKey; +extern const OSSymbol * gIOACPIUniqueIDKey; +extern const OSSymbol * gIOACPIAddressKey; +extern const OSSymbol * gIOACPIDeviceStatusKey; + +#pragma pack(1) + +struct IOACPIAddressSpaceDescriptor { + UInt32 resourceType; + UInt32 generalFlags; + UInt32 typeSpecificFlags; + UInt32 reserved1; + UInt64 granularity; + UInt64 minAddressRange; + UInt64 maxAddressRange; + UInt64 translationOffset; + UInt64 addressLength; + UInt64 reserved2; + UInt64 reserved3; + UInt64 reserved4; +}; + +enum { + kIOACPIMemoryRange = 0, + kIOACPIIORange = 1, + kIOACPIBusNumberRange = 2 +}; + +typedef UInt32 IOACPIAddressSpaceID; + +enum { + kIOACPIAddressSpaceIDSystemMemory = 0, + kIOACPIAddressSpaceIDSystemIO = 1, + kIOACPIAddressSpaceIDPCIConfiguration = 2, + kIOACPIAddressSpaceIDEmbeddedController = 3, + kIOACPIAddressSpaceIDSMBus = 4 +}; + +/* + * Address space operation + */ +enum { + kIOACPIAddressSpaceOpRead = 0, + kIOACPIAddressSpaceOpWrite = 1 +}; + +/* + * 64-bit ACPI address + */ +union IOACPIAddress { + UInt64 addr64; + struct { + unsigned int offset :16; + unsigned int function :3; + unsigned int device :5; + unsigned int bus :8; + unsigned int segment :16; + unsigned int reserved :16; + } pci; +}; + +/* + * Address space handler + */ +typedef IOReturn (*IOACPIAddressSpaceHandler)( UInt32 operation, + IOACPIAddress address, + UInt64 * value, + UInt32 bitWidth, + UInt32 bitOffset, + void * context ); + +/* + * ACPI fixed event types + */ +enum { + kIOACPIFixedEventPMTimer = 0, + kIOACPIFixedEventPowerButton = 2, + kIOACPIFixedEventSleepButton = 3, + kIOACPIFixedEventRealTimeClock = 4 +}; + +#pragma pack() + +/* + * FIXME: Move to xnu/iokit to reserve the ACPI family code. + */ +#ifndef sub_iokit_acpi +#define sub_iokit_acpi err_sub(10) +#endif + +/* + * ACPI notify message sent to all clients and interested parties. + * The notify code can be read from the argument as an UInt32. + */ +#define kIOACPIMessageDeviceNotification iokit_family_msg(sub_iokit_acpi, 0x10) + +/* + * ACPI device power states + */ +enum { + kIOACPIDevicePowerStateD0 = 0, + kIOACPIDevicePowerStateD1 = 1, + kIOACPIDevicePowerStateD2 = 2, + kIOACPIDevicePowerStateD3 = 3, + kIOACPIDevicePowerStateCount = 4 +}; + +#endif /* !__IOKIT_IOACPITYPES_H */ diff --git a/i386/include/IOKit/acpi/IOACPIPlatformDevice.h b/i386/include/IOKit/acpi/IOACPIPlatformDevice.h new file mode 100644 index 0000000..ebf0ccf --- /dev/null +++ b/i386/include/IOKit/acpi/IOACPIPlatformDevice.h @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOACPIPLATFORMDEVICE_H +#define _IOKIT_IOACPIPLATFORMDEVICE_H + +#include +#include +#include + +class IOACPIPlatformExpert; + +class IOACPIPlatformDevice : public IOPlatformDevice +{ + OSDeclareDefaultStructors( IOACPIPlatformDevice ) + +protected: + void * _deviceHandle; + UInt32 _deviceType; + UInt32 _powerFlags; + UInt32 * _powerStateFlags; + UInt32 _sleepPowerState; + IOService * _acpiParent; + IOACPIPlatformExpert * _platform; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties + of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) + */ + ExpansionData * reserved; + + virtual bool initACPIPowerManagement( IOService * powerParent ); + virtual void stopACPIPowerManagement( IOService * powerParent ); + +public: + virtual bool init( IOService * platform, + void * handle, + OSDictionary * properties ); + + virtual void free( void ); + + virtual bool attachToParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + + virtual void detachFromParent( IORegistryEntry * parent, + const IORegistryPlane * plane ); + + virtual bool getPathComponent( char * path, int * length, + const IORegistryPlane * plane ) const; + + virtual bool compareName( OSString * name, + OSString ** matched ) const; + + virtual IOReturn getResources( void ); + + virtual void * getDeviceHandle( void ) const; + + virtual UInt32 getDeviceStatus( void ) const; + + enum { + kTypeDevice = 0, + kTypeProcessor = 1, + kTypePowerResource = 2 + }; + + virtual UInt32 getDeviceType( void ) const; + + virtual void setDeviceType( UInt32 deviceType ); + + // Method (object) evaluation + + virtual IOReturn validateObject( const OSSymbol * objectName ); + + virtual IOReturn validateObject( const char * objectName ); + + virtual IOReturn evaluateObject( const OSSymbol * objectName, + OSObject ** result = 0, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateObject( const char * objectName, + OSObject ** result = 0, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const OSSymbol * objectName, + UInt32 * resultInt32, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const char * objectName, + UInt32 * resultInt32, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const OSSymbol * objectName, + UInt64 * resultInt64, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + virtual IOReturn evaluateInteger( const char * objectName, + UInt64 * resultInt64, + OSObject * params[] = 0, + IOItemCount paramCount = 0, + IOOptionBits options = 0 ); + + // ACPI table access + + virtual const OSData * getACPITableData( const char * tableName, + UInt32 tableInstance = 0 ) const; + + // Map ACPI event to interrupt event source index + + virtual SInt32 installInterruptForFixedEvent( UInt32 fixedEvent ); + + virtual SInt32 installInterruptForGPE( UInt32 gpeNumber, + void * gpeBlockDevice = 0, + IOOptionBits options = 0 ); + + // ACPI global lock acquire/release + + virtual IOReturn acquireGlobalLock( UInt32 * lockToken, + const mach_timespec_t * timeout = 0 ); + + virtual void releaseGlobalLock( UInt32 lockToken ); + + // Address space handler registration + + virtual IOReturn registerAddressSpaceHandler( + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + void * context, + IOOptionBits options = 0 ); + + virtual void unregisterAddressSpaceHandler( + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + IOOptionBits options = 0 ); + + // Address space access + + virtual IOReturn readAddressSpace( UInt64 * value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset = 0, + IOOptionBits options = 0 ); + + virtual IOReturn writeAddressSpace( UInt64 value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset = 0, + IOOptionBits options = 0 ); + + // Power management + + virtual bool hasSystemWakeCapability( void ) const; + + virtual IOReturn setSystemWakeCapabilityEnable( bool enable ); + + virtual bool hasACPIPowerStateSupport( UInt32 powerState ) const; + + virtual IOReturn setACPIPowerManagementEnable( + bool enable, + UInt32 powerState = kIOACPIDevicePowerStateD3, + IOOptionBits options = 0 ); + + virtual IOReturn setPowerState( unsigned long powerState, + IOService * whatDevice ); + + // I/O space helpers + + virtual void ioWrite32( UInt16 offset, UInt32 value, + IOMemoryMap * map = 0 ); + + virtual void ioWrite16( UInt16 offset, UInt16 value, + IOMemoryMap * map = 0 ); + + virtual void ioWrite8( UInt16 offset, UInt8 value, + IOMemoryMap * map = 0 ); + + virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 ); + + virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 ); + + virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 ); + + // vtable padding + + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 0 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 1 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 2 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 3 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 4 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 5 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 6 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 7 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 8 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 9 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 10 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 11 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 12 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 13 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 14 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 15 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 16 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 17 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 18 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 19 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 20 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 21 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 22 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 23 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 24 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 25 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 26 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 27 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 28 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 29 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 30 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformDevice, 31 ); +}; + +#endif /* !_IOKIT_IOACPIPLATFORMDEVICE_H */ diff --git a/i386/include/IOKit/acpi/IOACPIPlatformExpert.h b/i386/include/IOKit/acpi/IOACPIPlatformExpert.h new file mode 100644 index 0000000..413f396 --- /dev/null +++ b/i386/include/IOKit/acpi/IOACPIPlatformExpert.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOACPIPLATFORMEXPERT_H +#define _IOKIT_IOACPIPLATFORMEXPERT_H + +#include // superclass +#include // children + +class IOACPIPlatformExpert : public IODTPlatformExpert +{ + OSDeclareAbstractStructors( IOACPIPlatformExpert ) + + friend class IOACPIPlatformDevice; + +protected: + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties + of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) + */ + ExpansionData * reserved; + +public: + virtual bool start( IOService * provider ); + +protected: + // Map ACPI event to interrupt event source index + + virtual SInt32 installDeviceInterruptForFixedEvent( + IOService * device, + UInt32 fixedEvent ) = 0; + + virtual SInt32 installDeviceInterruptForGPE( + IOService * device, + UInt32 gpeNumber, + void * gpeBlockDevice, + IOOptionBits options ) = 0; + + // ACPI global lock acquisition + + virtual IOReturn acquireGlobalLock( IOService * client, + UInt32 * lockToken, + const mach_timespec_t * timeout ) = 0; + + virtual void releaseGlobalLock( IOService * client, + UInt32 lockToken ) = 0; + + // ACPI method and object evaluation + + virtual IOReturn validateObject( IOACPIPlatformDevice * device, + const OSSymbol * objectName ) = 0; + + virtual IOReturn validateObject( IOACPIPlatformDevice * device, + const char * objectName ); + + virtual IOReturn evaluateObject( IOACPIPlatformDevice * device, + const OSSymbol * objectName, + OSObject ** result, + OSObject * params[], + IOItemCount paramCount, + IOOptionBits options ) = 0; + + virtual IOReturn evaluateObject( IOACPIPlatformDevice * device, + const char * objectName, + OSObject ** result, + OSObject * params[], + IOItemCount paramCount, + IOOptionBits options ); + + // ACPI table + + virtual const OSData * getACPITableData( + const char * tableName, + UInt32 tableInstance ) = 0; + + // Address space handler + + virtual IOReturn registerAddressSpaceHandler( + IOACPIPlatformDevice * device, + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + void * context, + IOOptionBits options ) = 0; + + virtual void unregisterAddressSpaceHandler( + IOACPIPlatformDevice * device, + IOACPIAddressSpaceID spaceID, + IOACPIAddressSpaceHandler handler, + IOOptionBits options ) = 0; + + // Address space read/write + + virtual IOReturn readAddressSpace( UInt64 * value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset, + IOOptionBits options ) = 0; + + virtual IOReturn writeAddressSpace( UInt64 value, + IOACPIAddressSpaceID spaceID, + IOACPIAddress address, + UInt32 bitWidth, + UInt32 bitOffset, + IOOptionBits options ) = 0; + + // Device power management + + virtual IOReturn setDevicePowerState( IOACPIPlatformDevice * device, + UInt32 powerState ) = 0; + + virtual IOReturn getDevicePowerState( IOACPIPlatformDevice * device, + UInt32 * powerState ) = 0; + + virtual IOReturn setDeviceWakeEnable( IOACPIPlatformDevice * device, + bool enable ) = 0; + + // vtable padding + + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 0 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 1 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 2 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 3 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 4 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 5 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 6 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 7 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 8 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 9 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 10 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 11 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 12 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 13 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 14 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 15 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 16 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 17 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 18 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 19 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 20 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 21 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 22 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 23 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 24 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 25 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 26 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 27 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 28 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 29 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 30 ); + OSMetaClassDeclareReservedUnused( IOACPIPlatformExpert, 31 ); +}; + +#endif /* !_IOKIT_IOACPIPLATFORMEXPERT_H */ diff --git a/i386/include/IOKit/acpi/IOACPITypes.h b/i386/include/IOKit/acpi/IOACPITypes.h new file mode 100644 index 0000000..6215cd4 --- /dev/null +++ b/i386/include/IOKit/acpi/IOACPITypes.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2003-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IOACPITYPES_H +#define __IOKIT_IOACPITYPES_H + +#include + +extern const IORegistryPlane * gIOACPIPlane; +extern const OSSymbol * gIOACPIHardwareIDKey; +extern const OSSymbol * gIOACPIUniqueIDKey; +extern const OSSymbol * gIOACPIAddressKey; +extern const OSSymbol * gIOACPIDeviceStatusKey; + +#pragma pack(1) + +struct IOACPIAddressSpaceDescriptor { + UInt32 resourceType; + UInt32 generalFlags; + UInt32 typeSpecificFlags; + UInt32 reserved1; + UInt64 granularity; + UInt64 minAddressRange; + UInt64 maxAddressRange; + UInt64 translationOffset; + UInt64 addressLength; + UInt64 reserved2; + UInt64 reserved3; + UInt64 reserved4; +}; + +enum { + kIOACPIMemoryRange = 0, + kIOACPIIORange = 1, + kIOACPIBusNumberRange = 2 +}; + +typedef UInt32 IOACPIAddressSpaceID; + +enum { + kIOACPIAddressSpaceIDSystemMemory = 0, + kIOACPIAddressSpaceIDSystemIO = 1, + kIOACPIAddressSpaceIDPCIConfiguration = 2, + kIOACPIAddressSpaceIDEmbeddedController = 3, + kIOACPIAddressSpaceIDSMBus = 4 +}; + +/* + * Address space operation + */ +enum { + kIOACPIAddressSpaceOpRead = 0, + kIOACPIAddressSpaceOpWrite = 1 +}; + +/* + * 64-bit ACPI address + */ +union IOACPIAddress { + UInt64 addr64; + struct { + unsigned int offset :16; + unsigned int function :3; + unsigned int device :5; + unsigned int bus :8; + unsigned int segment :16; + unsigned int reserved :16; + } pci; +}; + +/* + * Address space handler + */ +typedef IOReturn (*IOACPIAddressSpaceHandler)( UInt32 operation, + IOACPIAddress address, + UInt64 * value, + UInt32 bitWidth, + UInt32 bitOffset, + void * context ); + +/* + * ACPI fixed event types + */ +enum { + kIOACPIFixedEventPMTimer = 0, + kIOACPIFixedEventPowerButton = 2, + kIOACPIFixedEventSleepButton = 3, + kIOACPIFixedEventRealTimeClock = 4 +}; + +#pragma pack() + +/* + * FIXME: Move to xnu/iokit to reserve the ACPI family code. + */ +#ifndef sub_iokit_acpi +#define sub_iokit_acpi err_sub(10) +#endif + +/* + * ACPI notify message sent to all clients and interested parties. + * The notify code can be read from the argument as an UInt32. + */ +#define kIOACPIMessageDeviceNotification iokit_family_msg(sub_iokit_acpi, 0x10) + +/* + * ACPI device power states + */ +enum { + kIOACPIDevicePowerStateD0 = 0, + kIOACPIDevicePowerStateD1 = 1, + kIOACPIDevicePowerStateD2 = 2, + kIOACPIDevicePowerStateD3 = 3, + kIOACPIDevicePowerStateCount = 4 +}; + +#endif /* !__IOKIT_IOACPITYPES_H */ diff --git a/i386/include/IOKit/assert.h b/i386/include/IOKit/assert.h new file mode 100644 index 0000000..4c56050 --- /dev/null +++ b/i386/include/IOKit/assert.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IO_ASSERT_H_ +#define _IO_ASSERT_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if IOASSERT +#undef MACH_ASSERT +#define MACH_ASSERT 1 +#endif +#include + +#ifdef __cplusplus +} +#endif + + +#if( !defined( OSCompileAssert ) ) +# define OSCompileAssert( TEST ) \ + extern int OSCompileAssertFailed[ ( TEST ) ? 1 : -1 ] __unused; +#endif + +#endif /* _IO_ASSERT_H_ */ + diff --git a/i386/include/IOKit/ata/.svn/all-wcprops b/i386/include/IOKit/ata/.svn/all-wcprops new file mode 100644 index 0000000..007f1c1 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/all-wcprops @@ -0,0 +1,77 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata +END +ATATimerEventSource.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/ATATimerEventSource.h +END +IOPCIATA.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOPCIATA.h +END +ATADeviceNub.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/ATADeviceNub.h +END +IOATACommand.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATACommand.h +END +IOATADevice.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATADevice.h +END +MacIOATA.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/MacIOATA.h +END +IOATAController.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATAController.h +END +IOATADevConfig.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATADevConfig.h +END +IOATATypes.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATATypes.h +END +IOATABusInfo.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATABusInfo.h +END +IOATARegI386.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATARegI386.h +END +IOATABusCommand.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ata/IOATABusCommand.h +END diff --git a/i386/include/IOKit/ata/.svn/entries b/i386/include/IOKit/ata/.svn/entries new file mode 100644 index 0000000..95f85e9 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/entries @@ -0,0 +1,436 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/ata +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ATATimerEventSource.h +file + + + + +2013-08-27T23:54:32.000000Z +9c99b4d7ca69d4c9dab671e7780e64d2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3613 + +IOPCIATA.h +file + + + + +2013-08-27T23:54:32.000000Z +4def4fc2f9e7404aa712cf8a29913dd0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6306 + +ATADeviceNub.h +file + + + + +2013-08-27T23:54:32.000000Z +394601b89d0af70b7ebbcb244ddeb0b0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5078 + +IOATACommand.h +file + + + + +2013-08-27T23:54:32.000000Z +0d54bf34e6f64fb34da600388154ca34 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16721 + +IOATADevice.h +file + + + + +2013-08-27T23:54:32.000000Z +d1aa0a0208129342bc3ee8e75e2c6043 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6983 + +MacIOATA.h +file + + + + +2013-08-27T23:54:32.000000Z +3857c6e0bb6fe2ea7354fe79577d4f61 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7070 + +IOATAController.h +file + + + + +2013-08-27T23:54:32.000000Z +686cc9c875e8a9aabdbfbefe87ad9bd7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11231 + +IOATADevConfig.h +file + + + + +2013-08-27T23:54:32.000000Z +a52e79bf188edc6d4474c80e0773db8c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10275 + +IOATATypes.h +file + + + + +2013-08-27T23:54:32.000000Z +1d725684323d6569a9c2124c2d03b799 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16274 + +IOATABusInfo.h +file + + + + +2013-08-27T23:54:32.000000Z +dd7a9c8b57167c4d4e5829fd9099e159 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7681 + +IOATARegI386.h +file + + + + +2013-08-27T23:54:32.000000Z +dbf68c1a5ad1a6116dcb4e1f26d2a8fc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2919 + +IOATABusCommand.h +file + + + + +2013-08-27T23:54:32.000000Z +d34b2058483f3455571b6bf96d64e535 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7227 + diff --git a/i386/include/IOKit/ata/.svn/text-base/ATADeviceNub.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/ATADeviceNub.h.svn-base new file mode 100644 index 0000000..db14182 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/ATADeviceNub.h.svn-base @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header ATADeviceNub.h + @abstract A concrete implementation of IOATADevice. + */ + +#ifndef _ATADEVICENUB_H +#define _ATADEVICENUB_H + +#include +#include "IOATATypes.h" +#include "IOATADevice.h" +#include "IOATAController.h" + +#include "IOATABusCommand.h" + + +/*! +@class ATADeviceNub +@abstract ATADeviceNub is a concrete implementation of IOATADevice. +@discussion clients of IOATA (disk drivers) should use the interface presented +by IOATADevice. Concrete nubs are private to the IOATA family and +specific subclasses of IOATADevice are instantiated by controller +drivers to provide the abstract interface to clients. + +*/ +class ATADeviceNub : public IOATADevice +{ + OSDeclareDefaultStructors(ATADeviceNub); + +public: + + /*!@function ataDeviceNub + @abstract static creator function - used by IOATAControllers to create nubs. + */ + static ATADeviceNub* ataDeviceNub( IOATAController* provider, ataUnitID unit, ataDeviceType devType); + + /*!@function attach + @abstract override of IOService method. + */ + virtual bool attach(IOService* provider ); + + + // overrides from IOATADevice to provide actual client interface + + + /*!@function executeCommand + @abstract Submit IO requests + */ + virtual IOReturn executeCommand(IOATACommand* command); + + // create and destroy IOATACommands + /*!@function allocCommand + @abstract create command objects for clients. + */ + virtual IOATACommand* allocCommand( void ); + + /*!@function freeCommand + @abstract Clients use this method to dispose of command objects. + */ + virtual void freeCommand( IOATACommand* inCommand); + + +protected: + + /*!@function init + @abstract used after creating the nub. + */ + virtual bool init(IOATAController* provider, ataUnitID unit, ataDeviceType devType); + + /*!@function publishProperties + @abstract publish the nub's properties in the device tree. + */ + virtual void publishProperties( void ); + + /*!@function publishBusProperties + @abstract puts info about this device's bus capability in the device tree. + */ + virtual void publishBusProperties(void); + + /*!@function publishVendorProperties + @abstract will be deprecated. + */ + virtual void publishVendorProperties( void ); + + /*!@function getDeviceID + @abstract get the unit id of this drive (0 or 1) + */ + virtual IOReturn getDeviceID(void); + + /*!@function MyATACallback + @abstract to be deprecated. + */ + static void MyATACallback(IOATACommand* command ); + + /*!@function processCallback + @abstract to be deprecated. + */ + void processCallback(IOATACommand* command ); + + /*!@function swapBytes16 + @abstract to be deprecated. + */ + void swapBytes16( UInt8* dataBuffer, IOByteCount length); + + UInt8* buffer; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the ATADeviceNub in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(ATADeviceNub, 0); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 1); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 2); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 3); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 4); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 5); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 6); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 7); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 8); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 9); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 10); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 11); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 12); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 13); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 14); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 15); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 16); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 17); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 18); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 19); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 20); + +}; + +#endif /* !_IOATABUSNUB_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/ATATimerEventSource.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/ATATimerEventSource.h.svn-base new file mode 100644 index 0000000..864fa9e --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/ATATimerEventSource.h.svn-base @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2001-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ATATIMEREVENTSOURCE_H +#define _ATATIMEREVENTSOURCE_H + + +#include +#include +#include +#include +#include + + +/*! +@class ATATimerEventSource + +@discussion +Extend the timer event source to allow checking for timer expiration +from behind the workloop. +*/ + +class ATATimerEventSource : public IOTimerEventSource +{ + OSDeclareDefaultStructors(ATATimerEventSource); + + public: + + /*!@function ataTimerEventSource + @abstract allocate an instance of this type. + */ + static ATATimerEventSource * + ataTimerEventSource(OSObject *owner, Action action = 0); + + /*!@function hasTimedOut + @abstract returns true if the timer has expired since the last enable/disable or setTimeout() or wakeAtTime() call. + */ + virtual bool hasTimedOut( void ); + + // override to initialize the time out flag. + /*!@function + @abstract + */ + virtual bool init(OSObject *owner, Action action = 0); + + /*!@function enable + @abstract overrides in order to set/clear the timed out flag + */ + virtual void enable(); + + /*!@function disable + @abstract overrides in order to set/clear the timed out flag + */ + virtual void disable(); + + /*!@function wakeAtTime + @abstract overrides in order to set/clear the timed out flag + */ + virtual IOReturn wakeAtTime(UnsignedWide abstime); + + /*!@function cancelTimeout + @abstract overrides in order to set/clear the timed out flag + */ + virtual void cancelTimeout(); + +protected: + + enum{ kTimedOutTrue = 'true', + kTimedOutFalse = 'fals' + }; + + UInt32 hasExpired; + + + /*!@function myTimeout + @abstract my timeout function which sets the timedOut flag atomically. + */ + static void myTimeout(void *self); + + /*!@function setTimeoutFunc + @abstract override to install my timeout function instead of the super's. + */ + virtual void setTimeoutFunc(); + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 0); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 1); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 2); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 3); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 4); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 5); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 6); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 7); + +}; + + +#endif /*_ATATIMEREVENTSOURCE_H*/ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATABusCommand.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATABusCommand.h.svn-base new file mode 100644 index 0000000..94b3bca --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATABusCommand.h.svn-base @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOATABusCommand.h + * + */ + +#ifndef _IOATABUSCOMMAND_H +#define _IOATABUSCOMMAND_H + +#include +#include "IOATATypes.h" +#include "IOATACommand.h" + + +class IOSyncer; + + +/*! + +@class IOATABusCommand + +@discussion ATA Device (disk) drivers should use the superclass, IOATACommand +and may not derive or use any subclass of IOATACommand. + +IOATABusCommand is the subclass of IOATACommand used by +IOATAControllers. Controller classes may override this class to +provide additional fields as their needs dictate or may use this +as a concrete class if it is sufficient. + +IOATAControllers are always paired with specific IOATADevices +and each specific subclass of IOATADevice is in turn the factory method +for IOATACommands for use by disk drivers. + +In this manner, mass-storage device drivers (disk drivers, clients of +ATA bus controllers) see only the generalized interface of IOATADevice +and the generalized interface of IOATACommand. This provides isolation +from specific bus details for disk drivers and offers flexibility to +controllers to add per-command fields and state variables for their own +internal use. + +*/ + +class IOATABusCommand : public IOATACommand { + + OSDeclareDefaultStructors( IOATABusCommand ); + + public: + + // data items for use by IOATAController + + /*! @var queueChain queue header for use by IOATAController. */ + queue_chain_t queueChain; + + /*! @var state state-semaphore for use by IOATAController */ + UInt32 state; + + /*! @var syncer IOSyncer for use by IOATAController */ + IOSyncer* syncer; + + + + /*!@function allocateCmd + @abstract factory method to create an instance of this class used by subclasses of IOATADevice + */ + static IOATABusCommand* allocateCmd(void); + + /*!@function zeroCommand + @abstract set to blank state, call prior to re-use of this object + */ + virtual void zeroCommand(void); + + /*!@function getOpcode + @abstract return the command opcode + */ + virtual ataOpcode getOpcode( void ); + + /*!@function getFlags + @abstract return the flags for this command. + */ + virtual ataFlags getFlags ( void ); + + /*!@function getRegMask + @abstract get the register mask for desired regs + */ + virtual ataRegMask getRegMask( void ); + + /*!@function getUnit + @abstract return the unit id (0 master, 1 slave) + */ + virtual ataUnitID getUnit( void ); + + /*!@function getTimeoutMS + @abstract return the timeout value for this command + */ + virtual UInt32 getTimeoutMS (void ); + + /*!@function setResult + @abstract set the result code + */ + virtual void setResult( IOReturn ); + + /*!@function getCallbackPtr + @abstract return the callback pointer + */ + virtual IOATACompletionFunction* getCallbackPtr (void ); + + + /*!@function executeCallback + @abstract call the completion callback function + */ + virtual void executeCallback(void); + + /*!@function getTaskFilePtr + @abstract return the taskfile structure pointer. + */ + virtual ataTaskFile* getTaskFilePtr(void); + + /*!@function getPacketSize + @abstract return the size of atapi packet if any. + */ + virtual UInt16 getPacketSize(void); + + /*!@function getPacketData + @abstract return pointer to the array of packet data. + */ + virtual UInt16* getPacketData(void); + + /*!@function getTransferChunkSize + @abstract number of bytes between interrupts. + */ + virtual IOByteCount getTransferChunkSize(void); + + /*!@function setActualTransfer + @abstract set the byte count of bytes actually transferred. + */ + virtual void setActualTransfer ( IOByteCount bytesTransferred ); + + /*!@function getBuffer + @abstract get pointer to the memory descriptor for this transaction + */ + virtual IOMemoryDescriptor* getBuffer ( void); + + /*!@function getPosition + @abstract the position within the memory buffer for the transaction. + */ + virtual IOByteCount getPosition (void); + + /*!@function getByteCount + @abstract return the byte count for this transaction to transfer. + */ + virtual IOByteCount getByteCount (void); + + /*!@function setCommandInUse + @abstract mark the command as being in progress. + */ + virtual void setCommandInUse( bool inUse = true); + + + protected: + + // + /*!@function init + @abstract Zeroes all data, returns false if allocation fails. protected. + */ + virtual bool init(); + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATABusCommand, 0); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 1); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 2); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 3); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 4); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 5); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 6); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 7); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 8); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 9); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 10); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 11); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 12); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 13); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 14); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 15); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 16); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 17); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 18); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 19); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 20); +}; + +#include + +class IOATABusCommand64 : public IOATABusCommand +{ + + OSDeclareDefaultStructors( IOATABusCommand64 ); + + public: + + // new features + static IOATABusCommand64* allocateCmd32(void); + virtual IODMACommand* GetDMACommand( void ); + + + + // overrides for IODMACommand setup + virtual void zeroCommand(void); + virtual void setBuffer ( IOMemoryDescriptor* inDesc); + virtual void setCommandInUse( bool inUse = true); + virtual void executeCallback(void); + + + protected: + IODMACommand* _dmaCmd; + virtual bool init(); + virtual void free(); +}; + +#endif /*_IOATABUSCOMMAND_H*/ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATABusInfo.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATABusInfo.h.svn-base new file mode 100644 index 0000000..6faec4c --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATABusInfo.h.svn-base @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATABUSINFO_H +#define _IOATABUSINFO_H + +#include +#include +#include "IOATATypes.h" + +/*! +@class IOATABusInfo +@discussion used to indicate the capabilities of the bus the device is connected to, PIO and DMA modes supported, etc. +*/ + +class IOATABusInfo : public OSObject +{ + OSDeclareDefaultStructors( IOATABusInfo ); + + public: + + /*!@function atabusinfo + @abstract factory method + */ + static IOATABusInfo* atabusinfo(void); + + /*!@function zeroData + @abstract set this object to a blank state. + */ + virtual void zeroData(void); + + // Used by clients of ATAControllers to find out about the bus + // capability. + + /*!@function getSocketType + @abstract returns the socket type, internal fixed, media-bay, PC-Card + Used by clients of ATAControllers to find out about the bus + */ + ataSocketType getSocketType( void ); + + /*!@function getPIOModes + @abstract returns the bit-significant map of PIO mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getPIOModes( void ); + + /*!@function getDMAModes + @abstract bit-significant map of DMA mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getDMAModes( void ); + + /*!@function getUltraModes + @abstract bit-significant map of Ultra mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getUltraModes( void ); + + /*!@function getUnits + @abstract How many devices are present on bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getUnits( void ); + + /*!@function supportsDMA + @abstract True = DMA supported on bus - inferred by looking at the DMA mode bits. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsDMA( void ); + + /*!@function supportsExtendedLBA + @abstract Supports 48-bit LBA if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsExtendedLBA( void ); + + /*!@function maxBlocksExtended + @abstract The maximum number of 512-byte blocks this controller supports + in a single Extended LBA transfer. Some controllers may be limited to less than + the maximum sector count allowed under extended LBA protocol. + */ + UInt16 maxBlocksExtended(void); + + /*!@function supportsOverlapped + @abstract Supports overlapped packet feature set if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsOverlapped( void ); + + /*!@function supportsDMAQueued + @abstract Supports DMA Queued Feature set if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsDMAQueued( void ); + + + // Used by ATAControllers to generate an information object. + // Would not be used by disk device drivers normally. + // Bus controllers should set these items everytime. + + /*!@function setSocketType + @abstract internal fixed, media-bay, PC-Card. Set by ATAControllers. + */ + void setSocketType( ataSocketType inSocketType ); + + /*!@function setPIOModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setPIOModes( UInt8 inModeBitMap); + + /*!@function setDMAModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setDMAModes( UInt8 inModeBitMap ); + + /*!@function setUltraModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setUltraModes( UInt8 inModeBitMap ); + + /*!@function setUnits + @abstract set to indicate how many devices are on this bus. Set by ATAControllers. + */ + void setUnits( UInt8 inNumUnits ); + + // Optional bus protocols some busses may support + /*!@function setExtendedLBA + @abstract Set true for supports 48-bit LBA. Set by ATAControllers. + */ + void setExtendedLBA( bool inState ); + + /*!function setMaxBlocksExtended + @abstract value set by controllers to indicate the maximum number of blocks + allowed in a single transfer of data. Some dma engines may not be capable of supporting the full + 16-bit worth of sector count allowed under 48 bit extended LBA. Default is 256 blocks, same as + standard ATA. + */ + void setMaxBlocksExtended( UInt16 inMaxBlocks); + + /*!@function setOverlapped + @abstract Set true for supports overlapped packet feature set. Set by ATAControllers. + */ + void setOverlapped( bool inState); + + /*!@function setDMAQueued + @abstract Set true if supports DMA Queued Feature. Set by ATAControllers. + */ + void setDMAQueued( bool inState); // + + protected: + + UInt8 _PIOModes; /* PIO modes supported (bit-significant) */ + UInt8 _MultiDMAModes; /* <--: Multiword DMA modes supported (b-sig) */ + UInt8 _UltraDMAModes; /* <--: Ultra DMA modes supported (b-sig) */ + bool _ExtendedLBA; /* <--: Suppports 48-bit LBA protocol */ + bool _Overlapped; /* <--: Supports overlapped packet feature set */ + bool _DMAQueued; /* <--: Supports DMA Queued Feature set */ + ataSocketType _SocketType; /* <--: Indicates bus is fixed internal, removable media-bay, removable PC-Card or unknown type */ + UInt8 _numUnits; /* <--: How many devices on this bus */ + UInt16 _maxBlocksExtended; + + protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool init(); + +private: + OSMetaClassDeclareReservedUnused(IOATABusInfo, 0); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 1); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 2); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 3); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 4); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 5); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 6); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 7); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 8); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 9); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 10); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 11); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 12); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 13); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 14); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 15); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 16); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 17); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 18); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 19); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 20); +}; + + +#endif /* !_IOATABUSINFO_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATACommand.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATACommand.h.svn-base new file mode 100644 index 0000000..773f28a --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATACommand.h.svn-base @@ -0,0 +1,478 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOATACommand.h + * + */ + +#ifndef _IOATACOMMAND_H +#define _IOATACOMMAND_H + +#include +#include +#include +#include +#include "IOATATypes.h" + + +class IOExtendedLBA; +class IOATACommand; + + +/*! @typedef IOATACompletionFunction callback function for ATA disk devices. +*/ +typedef void (IOATACompletionFunction)(IOATACommand* command ); + + +/*! +@class IOATACommand + +@discussion +Command structure superclass, created and freed only by IOATADevice objects +populated by disk device drivers with command parameters +then submitted for operation to their IOATADevice provider for execution. + +IOATACommand is a virtual class, a concrete subclass contains the methods and fields needed +by IOATAControllers. Subclasses may be specific to particular controller hardware. +Disk device drivers will only have visibility to this interface and may not subclass this object. +Disk device drivers should instead make use of the void* refcon field which the controllers will not +touch +*/ + +class IOATACommand : public IOCommand { + + OSDeclareAbstractStructors( IOATACommand ); + + public: + + /*!@function zeroCommand + @abstract set to blank state, MUST call prior to re-use of this object + */ + virtual void zeroCommand(void); + + /*!@function setOpcode + @abstract command opcode as defined in IOATATypes. + */ + virtual void setOpcode( ataOpcode inCode); + + /*!@function setFlags + @abstract set the flags for this command, as defined in IOATATypes. + */ + virtual void setFlags( UInt32 inFlags); + + /*!@function setUnit + @abstract set the unit number for this command. + */ + virtual void setUnit( ataUnitID inUnit); + + /*!@function setTimeoutMS + @abstract how long to allow this command to complete, in milliseconds, once issued to + the hardware. if the time period expires, this command will return with a timeout error. + */ + virtual void setTimeoutMS( UInt32 inMs); + + /*!@function setCallbackPtr + @abstract set the function pointer to call when this command completes. + */ + virtual void setCallbackPtr (IOATACompletionFunction* inCompletion); + + /*!@function setRegMask + @abstract used when accessing registers or reading registers on an error result. Mask is defined + in IOATATypes.h + */ + virtual void setRegMask( ataRegMask mask); + + // memory information + // Since ATA hardware is limited in the amount of bytes + // that can be transfered in a command, the disk driver shall supply + // a seperate offset and byte count per transfer. + // the offset may be any amount. The byte count must be a multiple of the + // sector size of the device, ie, N * 512 bytes for ata hard drives. + /*!@function setBuffer + @abstract set the IIOMemoryDescriptor for this transaction. + */ + virtual void setBuffer ( IOMemoryDescriptor* inDesc); + + /*!@function setPosition + @abstract used to set an offset into the memory descriptor for this transfer. + */ + virtual void setPosition (IOByteCount fromPosition); + + /*!@function setByteCount + @abstract set the byte count for this transaction. Should agree with the device command and the + memory descriptor in use. + */ + virtual void setByteCount (IOByteCount numBytes); + + /*!@function setTransferChunkSize + @abstract set the size of transfer between intervening interrupts. necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers. + */ + virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize); + + /*!@function setFeatures + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setFeatures( UInt8 in); + + /*!@function getErrorReg + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getErrorReg (void ); + + /*!@function setSectorCount + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorCount( UInt8 in); + + /*!@function getSectorCount + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getSectorCount (void ); + + /*!@function setSectorNumber + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorNumber( UInt8 in); + + /*!@function getSectorNumber + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getSectorNumber (void ); + + /*!@function setCylLo + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCylLo ( UInt8 in); + + /*!@function getCylLo + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCylLo (void ); + + /*!@function setCylHi + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCylHi( UInt8 in); + + /*!@function getCylHi + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCylHi (void ); + + /*!@function setDevice_Head + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setDevice_Head( UInt8 in); + + /*!@function getDevice_Head + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getDevice_Head (void ); + + /*!@function setCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCommand ( UInt8 in); + + /*!@function getStatus + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getStatus (void ); + + /*!@function setLBA28 + @abstract convenience method that sets the taskfile registers into a 28-bit LBA address, with unit selected and LBA bit set. return err if param out of range, return kIOSuccess (kATANoErr) = 0 on return if successful + */ + virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit); + + /*!@function setPacketCommand + @abstract ATAPI command packet max size is 16 bytes. Makes deep copy of data. + */ + virtual IOReturn setPacketCommand( UInt16 packetSizeBytes, UInt8* command); + + // the following registers are only accessed by register access + // commands. Not by normal command dispatch where they are handled + // by the controller. + + // not part of task file params. not written to device when sending commands. + virtual void setDataReg ( UInt16 in); + virtual UInt16 getDataReg (void ); + + // not part of taskfile. Not usually used except by controller. + virtual void setControl ( UInt8 in); + virtual UInt8 getAltStatus (void ); + + // return values + /*!@function getResult + @abstract IOReturn value of the result of this command. ATA family errors are defined in IOATATypes.h + */ + virtual IOReturn getResult (void); + + /*!@function getBuffer + @abstract the IOMemoryDescriptor used in this transaction. + */ + virtual IOMemoryDescriptor* getBuffer ( void ); + + /*!@function getActualTransfer + @abstract The byte count on the ending result, as best as can be determined by the controller. May be zero, but partial transfer may have occurred on error in some cases. + */ + virtual IOByteCount getActualTransfer ( void ); + + /*!@function getEndStatusReg + @abstract the value of the status register on the end of the command. + */ + virtual UInt8 getEndStatusReg (void); // always returned + + /*!@function getEndErrorReg + @abstract If the error bit was set in the status register, the value of the error register is returned at the end of a command. + */ + virtual UInt8 getEndErrorReg( void ); + + /*!@function getCommandInUse + @abstract returns true if IOATAController is still in control of the command. + */ + virtual bool getCommandInUse( void ); // returns true if IOATAController is using the command. + + // for use by disk drivers, clients of IOATADevice only. + // IOATADevice and IOATAControllers shall not use this field in any manner + /*!@var refCon + @abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner. + */ + void* refCon; + + /*!@var refCon2 + @abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner. + */ + void* refCon2; + + protected: + // < return from ATA controllers to disk drivers + // > sent to ATA controllers from disk drivers + ataOpcode _opCode; // > Command code for the controller. + UInt32 _flags; // > Flags for this command + ataRegisterImage _taskFile; // <> Taskfile + data and control registers. + ATAPICmdPacket _packet; // > ATAPI packet + ataUnitID _unit; // > Unit number + UInt32 _timeoutMS; // > timeout command in ms. + IOMemoryDescriptor* _desc; // > Buffer for data may be nil if command transfer no data + IOByteCount _position; // > Position within the descriptor for this command + IOByteCount _byteCount; // > How many bytes to transfer. + IOByteCount _logicalChunkSize; // > How many bytes between intervening interrupts (R/W Multiple) + ataRegMask _regMask; // > Which registers to write or read for reg access commands + IOATACompletionFunction* _callback; // > if nil, command is synchronous + + IOReturn _result; // < result + IOByteCount _actualByteCount; // < actual bytes transfered. + UInt8 _status; // < Status register at end of command + UInt8 _errReg; // < Error register at end of command if error bit set. + bool _inUse; // < true while IOATAController has possesion of the command + + + virtual bool init(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData {IOExtendedLBA* extLBA; }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *fExpansionData; + + // overrides + virtual void free(); + + +private: + OSMetaClassDeclareReservedUsed(IOATACommand, 0); // set end result + OSMetaClassDeclareReservedUsed(IOATACommand, 1); // get extendedLBAPtr + OSMetaClassDeclareReservedUnused(IOATACommand, 2); + OSMetaClassDeclareReservedUnused(IOATACommand, 3); + OSMetaClassDeclareReservedUnused(IOATACommand, 4); + OSMetaClassDeclareReservedUnused(IOATACommand, 5); + OSMetaClassDeclareReservedUnused(IOATACommand, 6); + OSMetaClassDeclareReservedUnused(IOATACommand, 7); + OSMetaClassDeclareReservedUnused(IOATACommand, 8); + OSMetaClassDeclareReservedUnused(IOATACommand, 9); + OSMetaClassDeclareReservedUnused(IOATACommand, 10); + OSMetaClassDeclareReservedUnused(IOATACommand, 11); + OSMetaClassDeclareReservedUnused(IOATACommand, 12); + OSMetaClassDeclareReservedUnused(IOATACommand, 13); + OSMetaClassDeclareReservedUnused(IOATACommand, 14); + OSMetaClassDeclareReservedUnused(IOATACommand, 15); + OSMetaClassDeclareReservedUnused(IOATACommand, 16); + OSMetaClassDeclareReservedUnused(IOATACommand, 17); + OSMetaClassDeclareReservedUnused(IOATACommand, 18); + OSMetaClassDeclareReservedUnused(IOATACommand, 19); + OSMetaClassDeclareReservedUnused(IOATACommand, 20); + +public: + virtual void setEndResult(UInt8 inStatus, UInt8 endError ); + virtual IOExtendedLBA* getExtendedLBA(void); + + +}; + + +/*! +@class IOExtendedLBA + +@discussion +If 48-bit LBAs are supported, IOExtendedLBA is used to represent a 48-bit LBA. +The driver examines the ATA identify data to determine if 48-bit addressing is +supported. +*/ + +class IOExtendedLBA : public OSObject +{ + OSDeclareDefaultStructors( IOExtendedLBA ); + + public: + static IOExtendedLBA* createIOExtendedLBA(IOATACommand* owner); + + // terminology as established in ATA/ATAPI-6. + // for the extended LBA address + + /*!@function setLBALow16 + @abstract convenience method that sets the lower 16 bits of a 48-bit LBA + */ + virtual void setLBALow16( UInt16 lbaLow); + + /*!@function getLBALow16 + @abstract convenience method that gets the lower 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBALow16 (void); + + /*!@function setLBAMid16 + @abstract convenience method that sets the middle 16 bits of a 48-bit LBA + */ + virtual void setLBAMid16 (UInt16 lbaMid); + + /*!@function getLBAMid16 + @abstract convenience method that gets the middle 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBAMid16( void ); + + /*!@function setLBAHigh16 + @abstract convenience method that sets the high 16 bits of a 48-bit LBA + */ + virtual void setLBAHigh16( UInt16 lbaHigh ); + + /*!@function getLBAHigh16 + @abstract convenience method that gets the high 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBAHigh16( void ); + + /*!@function setSectorCount16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorCount16( UInt16 sectorCount ); + + /*!@function getSectorCount16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt16 getSectorCount16( void ); + + /*!@function setFeatures16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setFeatures16( UInt16 features ); + + /*!@function getFeatures16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt16 getFeatures16( void ); + + /*!@function setDevice + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setDevice( UInt8 inDevice ); + + /*!@function getDevice + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getDevice( void ); + + /*!@function setCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCommand( UInt8 inCommand ); + + /*!@function getCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCommand( void ); + + /*!@function setExtendedLBA + @abstract convenience method that sets the taskfile registers into a 48-bit LBA address, along with sector count, and unit selected and LBA bit set + */ + virtual void setExtendedLBA( UInt32 inLBAHi, UInt32 inLBALo, ataUnitID inUnit, UInt16 extendedCount, UInt8 extendedCommand); + + /*!@function getExtendedLBA + @abstract convenience method that gets a 48-bit LBA + */ + virtual void getExtendedLBA( UInt32* outLBAHi, UInt32* outLBALo ); + + /*!@function zeroData + @abstract convenience method that zeros out the lba, sector count, features, device, and command member variables + */ + virtual void zeroData(void); + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + + protected: + + IOATACommand* owner; + UInt16 lbaLow; + UInt16 lbaMid; + UInt16 lbaHigh; + UInt16 sectorCount; + UInt16 features; + UInt16 device; + UInt16 command; + + private: + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 0); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 1); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 2); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 3); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 4); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 5); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 6); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 7); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 8); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 9); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 10); + + +}; + +#endif diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATAController.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATAController.h.svn-base new file mode 100644 index 0000000..3758941 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATAController.h.svn-base @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATACONTROLLER_H +#define _IOATACONTROLLER_H + +#include +#include +#include +#include +#include +#include "ATATimerEventSource.h" + +class IOATADevice; +class IOATABusCommand; +class IOATABusInfo; +class IOATADevConfig; + +/*! @class IOATAController + @abstract The base class for ata controller family. Provides the interface common to all ata bus controllers. + @discussion Subclasses of IOATAController implement drivers for specific bus hardware. Disk devices are clients of + IOATAController and communicate via the IOATABusNub instantiated for each device discovered by the specific IOATAController + subclass when it probes hardware. Via the nub, the ATA Controller provides standard information about bus capability, accepts + requests for transfer mode configuration (timing), accepts requests for IO and bus operations, notifies the device driver about + bus events which may affect the device, such as soft-resets or device removal (ie, media-bay and PC-card) and removal of queued + IO requests which have not been dispatched into the hardware. + + @discussion The header doc for this class is incomplete. The source however is heavily commented and should be consulted until + such time as complete header doc is available. +*/ + + + +class IOATAController : public IOService +{ + OSDeclareDefaultStructors(IOATAController); + +public: + + + /*--- Common ATA Controller Interface ---*/ + // find out bus capability + virtual IOReturn provideBusInfo( IOATABusInfo* infoOut); + + // set and get bus timing configuration for a specific unit + virtual IOReturn selectConfig( IOATADevConfig* configRequest, UInt32 unitNumber); + virtual IOReturn getConfig( IOATADevConfig* configRequest, UInt32 unitNumber); + + // The main call puts something on the work loop + virtual IOReturn executeCommand( IOATADevice* nub, IOATABusCommand* cmd); + + + + /*-- Power Management ---*/ + + // TBD + + + /*--- Overrides from IOService ---*/ + virtual bool init(OSDictionary * properties); + + virtual IOService* probe( IOService* provider, SInt32* score ); + virtual bool start( IOService* provider ); + + +protected: + + enum { + kBusFree = 'free', // bus is available + kBusBusy = 'busy', // bus is busy with request + kQueueOpen = '!lck', // queue is not locked + kQueueLocked = 'LOCK', // queue is frozen and not + kImmediateLocked = '!Imd', // immediate commands may not be processed + kImmediateOK = 'Immd' // immediate commands allowed. + }; + + /* Transaction State indicator definition - indicates what action is next*/ + enum transState { + kATAInitial = 0x00, // in queue + kATAStarted = 0x01, // issue taskfile + kATAPICmd = 0x02, // issue packet + kATADataTx = 0x03, // data transfer phase + kATAStatus = 0x04, // read status + kATAComplete = 0x05, // io complete + kATADone = 0x06 // completion callout called + }; + + struct ataDevInfo { + ataDeviceType type; // ata, atapi, unknown + atapiConfig packetSend; // slow DRQ, IRQ, or fast DRQ for packet + }; + + + struct ataDoubleBuffer + { + IOPhysicalAddress physicalBuffer; + IOLogicalAddress logicalBuffer; + IOByteCount bufferSize; + + }; + + + IOService* _provider; + IOWorkLoop* _workLoop; + IOCommandGate* _cmdGate; + ATATimerEventSource* _timer; + queue_head_t _commandQueue; + IOATABusCommand* _currentCommand; + UInt32 _busState; + UInt32 _queueState; + UInt32 _immediateGate; + ataUnitID _selectedUnit; + ataDevInfo _devInfo[2]; + IOATADevice* _nub[2]; + ataDoubleBuffer _doubleBuffer; + + IOATARegPtr8 _tfFeatureReg; + IOATARegPtr8 _tfSCountReg; + IOATARegPtr8 _tfSectorNReg; + IOATARegPtr8 _tfCylLoReg; + IOATARegPtr8 _tfCylHiReg; + IOATARegPtr8 _tfSDHReg; + IOATARegPtr8 _tfStatusCmdReg; + IOATARegPtr16 _tfDataReg; + IOATARegPtr8 _tfAltSDevCReg; + + + // false if couldn't allocate the per-bus double buffer. + // controllers should provide implementation where needed + // for DMA hardware compatibility. The default method provides + // a 4K buffer for PIO since MemoryDescriptors do not by default have + // logical addresses in the kernel space. + virtual bool allocateDoubleBuffer( void ); + + // perform 2-byte endian swap. Only useful on PIO transfers and identify data + virtual void swapBytes16( UInt8* dataBuffer, IOByteCount length); + +/*! @function handleCommand + @abstract Called by executeCommand() to handle the client command + from the workloop context. + @param command The command code. + @param param1 Command parameter. + @param param2 Command parameter. + @param param3 Command parameter. + @result kIOReturnSuccess on success, or an error code otherwise. */ + + virtual IOReturn handleCommand( void * command, + void * param1 = 0, + void * param2 = 0, + void * param3 = 0); + + +/*! @function busCanDispatch + @abstract answers whether the bus is in state such that the next command + can be dispatched. + @result true - bus is free to issue commands. false - bus cannot issue + commands at this time. */ + virtual bool busCanDispatch( void ); + + +/*! @function dispatchNext + @abstract Causes the command at the front of the queue to dequeue, made the + current command and begin execution. + @result noErr indicates successful dispatch. */ + virtual IOReturn dispatchNext( void ); + + // sets the result code, free's the bus state, dispatch next command and execute completion + virtual void completeIO( IOReturn commandResult ); + + // Command queue handlers. + virtual IOReturn enqueueCommand( IOATABusCommand* command); + virtual IOATABusCommand* dequeueFirstCommand( void ); + + // event notifier for clients + virtual void executeEventCallouts( ataEventCode event, ataUnitID unit); + + // default handler for device interrupts. + virtual IOReturn handleDeviceInterrupt( void ); + + + // timer functions + // starts the timeout on the current command + virtual IOReturn startTimer( UInt32 inMS); + //disable and clear a running timer. + virtual void stopTimer( void ); + // called when a timeout occurs. + virtual void handleTimeout( void ); + // true if the timer has expired + virtual bool checkTimeout( void ); + + // handle IO opcodes + virtual IOReturn handleExecIO( void ); + virtual IOReturn handleRegAccess( void ); + virtual IOReturn handleBusReset(void); + virtual IOReturn handleQueueFlush( void ); + + // various protocol phases + virtual IOReturn asyncData(void); + virtual IOReturn asyncStatus(void); + virtual IOReturn asyncIO(void); + virtual IOReturn asyncCommand(void); + virtual IOReturn synchronousIO(void); + + // hardware access + virtual IOReturn selectDevice( ataUnitID unit ); + virtual IOReturn issueCommand( void ); + virtual IOReturn writePacket( void ); + virtual IOReturn softResetBus( bool doATAPI = false ); + + virtual IOReturn startDMA( void ); + virtual IOReturn stopDMA( void ); + + virtual bool ATAPISlaveExists( void ); + virtual UInt32 scanForDrives( void ); + + virtual bool waitForU8Status (UInt8 mask, UInt8 value); + + virtual IOByteCount readATAPIByteCount( void ); + virtual void handleOverrun( IOByteCount length); + virtual IOReturn registerAccess(bool isWrite); + + // PIO data transfers + virtual IOReturn txDataIn (IOLogicalAddress buf, IOByteCount length); + virtual IOReturn txDataOut (IOLogicalAddress buf, IOByteCount length); + + virtual IOATAController::transState determineATAPIState(void); + + // device should set the controller to the config for this device + virtual void selectIOTiming( ataUnitID unit ); + + // subclasses MUST implement this function in order to initialize + // the pointers to the ATA task file registers during start() time. + virtual bool configureTFPointers(void); + + // convert a bit-significant indicator to a numeric value. + virtual UInt16 bitSigToNumeric( UInt16 binary); + + // for 48 bit register reading and writing + UInt16 readExtRegister( IOATARegPtr8 inRegister ); + void writeExtRegister( IOATARegPtr8 inRegister, UInt16 inValue ); + + // overrides + virtual void free(); + +private: + + // used called by the commandgate in executeCommand. + static void executeCommandAction(OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3); + + // callout used by the timer to indicate the timeout failure. + static void timeoutOccured( OSObject *owner, + IOTimerEventSource *sender); + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOATAController in the future. + */ + typedef struct ExpansionData + { + IOBufferMemoryDescriptor* _doubleBufferDesc; + } ExpansionData; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATAController, 0); + OSMetaClassDeclareReservedUnused(IOATAController, 1); + OSMetaClassDeclareReservedUnused(IOATAController, 2); + OSMetaClassDeclareReservedUnused(IOATAController, 3); + OSMetaClassDeclareReservedUnused(IOATAController, 4); + OSMetaClassDeclareReservedUnused(IOATAController, 5); + OSMetaClassDeclareReservedUnused(IOATAController, 6); + OSMetaClassDeclareReservedUnused(IOATAController, 7); + OSMetaClassDeclareReservedUnused(IOATAController, 8); + OSMetaClassDeclareReservedUnused(IOATAController, 9); + OSMetaClassDeclareReservedUnused(IOATAController, 10); + OSMetaClassDeclareReservedUnused(IOATAController, 11); + OSMetaClassDeclareReservedUnused(IOATAController, 12); + OSMetaClassDeclareReservedUnused(IOATAController, 13); + OSMetaClassDeclareReservedUnused(IOATAController, 14); + OSMetaClassDeclareReservedUnused(IOATAController, 15); + OSMetaClassDeclareReservedUnused(IOATAController, 16); + OSMetaClassDeclareReservedUnused(IOATAController, 17); + OSMetaClassDeclareReservedUnused(IOATAController, 18); + OSMetaClassDeclareReservedUnused(IOATAController, 19); + OSMetaClassDeclareReservedUnused(IOATAController, 20); +}; +#endif /* !_IOATACONTROLLER_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATADevConfig.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATADevConfig.h.svn-base new file mode 100644 index 0000000..e5714c3 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATADevConfig.h.svn-base @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATADEVCONFIG_H +#define _IOATADEVCONFIG_H + +#include +#include +#include "IOATATypes.h" +#include "IOATABusInfo.h" + + +/*! + @class IOATADevConfig + @abstract used for configuring and communicating the desired transfer modes of a device. + A disk driver would typically use this object in conjunction with the 512-bytes of identification + data from the drive and the IOATABusInfo object for the bus it is connected to. + This object will determine the best matching transfer speeds available. + the device driver will then send a series of Set Features commands to configure the drive + and this object to the bus through the IOATADevice nub in order to configure the optimum transfer mode. + The driver for the disk drive may choose to populate this object with whatever transfer mode + desired, in the event that a different mode is required. + @discussion usually use the initWithBestSelection to make a best mode match. + The Mode accessors use bit significance to indicate a selected mode or supported modes(s) + ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. + Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. + ie, a bus will support multiple possible modes, but will only have one mode selected at that time. + +*/ + +class IOATADevConfig : public OSObject { + + OSDeclareDefaultStructors( IOATADevConfig ); + + public: + + /*!@function atadevconfig + @abstract static creator function. + */ + static IOATADevConfig* atadevconfig(void); + + /*!@function initWithBestSelection + @abstract Handy initializer: pass the 512-byte result of the Identify Device or + Identify Packet Device in endian-order for your platform (byte-swapped on PPC) + and the IOATABusInfo object for the bus. The object will initialize all fields + and select the best transfer modes that match on bus and device. + If the return value was 0 (success or noErr), then a matching mode is supported. + Examine the PIO and UDMA/DMA fields and to generate the apropriate SET FEATURES + parameters for your drive and send this initialised object to the IOATAController + when requesting a speed configuration. + failure means no supported transfer modes matched between bus and device info. + + @param identifyData 512 bytes of data obtained from the device via IDENTIFY DEVICE or IDENTIFY PACKET DEVICE command. + @param busInfo pointer to an IOATAbusInfo object obtained from a previous atanub->provideBusInfo() call. + @result kIOSuccess (0) when a matching transfer mode is available between the device and controller. + */ + IOReturn initWithBestSelection( const UInt16* identifyData, IOATABusInfo* busInfo); + + // intitialize with the 512 byte data from an ATA device identify command + IOReturn assignFromData( const UInt16* identifyData ); + + /*!@function setPacketConfig + @param packetConfig + @abstract For ATAPI devices, if the device asserts interrupt after the Packet Command when it is ready to accept the packet, set this value to true (mostly older devices). If the device accepts the packet only by asserting DRQ bit in status, then set this value false. Tells the bus controller whether to wait for packet acceptance or set pending interrupt. + */ + void setPacketConfig ( atapiConfig packetConfig); + + /*!@function getPacketConfig + @result atapiConfig as defined in IOATATypes.h + */ + atapiConfig getPacketConfig( void ); + + // The following Mode accessors use bit significance to indicate a selected mode or supported modes(s) + // ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. + // Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. + // ie, a bus will support multiple possible modes, but will only have one mode selected at that time. + + /*!@function setPIOMode + @param inModeBitMap bit-significant map of PIO mode + */ + void setPIOMode( UInt8 inModeBitMap); // bit-significant map of PIO mode(s) + + /*!@function getPIOMode + @result bit-significant map of PIO mode + */ + UInt8 getPIOMode( void ); + + /*!@function setDMAMode + @param inModeBitMap bit-significant map of DMA mode + */ + void setDMAMode( UInt8 inModeBitMap ); // bit-significant map of DMA mode(s) + + /*!@function getDMAMode + @result bit-significant map of DMA mode + */ + UInt8 getDMAMode( void ); + + /*!@function setUltraMode + @param inModeBitMap bit-significant map of Ultra mode + */ + void setUltraMode( UInt8 inModeBitMap ); // bit-significant map of Ultra mode(s) + + /*!@function getUltraMode + @result bit-significant map of Ultra mode + */ + UInt8 getUltraMode( void ); + + // The following cycle time accessors report cycle times in nanoseconds. + // A device requesting a mode should also request a cycle time as reported in the device's identification page. + // A bus controller will configure the bus not to exceed (go faster than) the minimum time requested. + // When a bus controller reports a mode configuration, the cycle time indicates the busses contract not to go + // faster than. However an actual cycle time may be slower than the indicated time. + /*!@function setPIOCycleTime + @param inNS PIO cycle time in nanoseconds. + */ + void setPIOCycleTime( UInt16 inNS ); + + /*!@function getPIOCycleTime + @result reported PIO CycleTime in nanoseconds. + */ + UInt16 getPIOCycleTime( void ); + + /*!@function setDMACycleTime + @param inNS reported multiword DMA Cycle time in nanoseconds. + */ + void setDMACycleTime( UInt16 inNS ); + + /*!@function getDMACycleTime + @result Reported multiword DMA cycle time in nanoseconds. + */ + UInt16 getDMACycleTime( void ); + + // Ultra ATA defines cycle times a device must meet to comply with standards. + // No cycle time field is needed. + + // convert bit-significant to numeric value + /*!@function bitSigToNumeric + @abstract converts a bit-significant field to a numerical value. Note that a bit field of 0x00 has no defined result. + @param binary the bit significant field. + @result the numerical value of the highest bit set in the field. + */ + virtual UInt8 bitSigToNumeric( UInt16 binary); + + + protected: + + atapiConfig _atapiIRQForPacket; // enum for bits 5 and 6 of word zero of + // the identify packet device info data for PACKET devices ONLY. + // shift word-0 5-bits left, mask 0x03 and these enums apply. + // values are: + + // kATAPIDRQSlow = 0x00 - wait up to 3MS for packet on DRQ + // kATAPIIRQPacket = 0x01, - device asserts IRQ for packet + // kATAPIDRQFast = 0x10, - packet on DRQ within 50us + // kATAPIUnknown = 0x11 - reserved as of ATA/ATAPI-5 + + + + + UInt8 _ataPIOMode; /* <->: PIO Mode Timing class bit-significant */ + UInt16 _ataPIOCycleTime; /* <->: Cycle time in ns for PIO mode */ + UInt8 _ataMultiDMAMode; /* <->: Multiple Word DMA Timing Class bit-significant*/ + UInt16 _ataMultiCycleTime; /* <->: Cycle time in ns for Multiword DMA mode */ + UInt8 _ataUltraDMAMode; /* <->: Ultra DMA timing class bit-significant */ + + IOReturn _AssignPIOData( const UInt16* identifyData); + IOReturn _AssignDMAData(const UInt16* identifyData); + IOReturn _AssignUltraData(const UInt16* identifyData); + UInt8 _MostSignificantBit( UInt8 inByte); + + + virtual bool init(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATADevConfig, 0); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 1); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 2); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 3); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 4); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 5); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 6); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 7); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 8); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 9); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 10); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 11); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 12); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 13); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 14); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 15); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 16); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 17); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 18); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 19); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 20); + +public: + +//some static utility functions to parse the identify data for feature support + + static bool sDriveSupports48BitLBA( const UInt16* identifyData ); + static UInt32 sDriveExtendedLBASize( UInt32* lbaHi, UInt32* lbaLo, const UInt16* identifyData); // result returned is same as lbaLo. + +}; + + +// header doc info goes here. I find putting it within the delcarations more confusing than putting it all in the bottom of the header. + + +#endif /* !_IOATADEVCONFIG_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATADevice.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATADevice.h.svn-base new file mode 100644 index 0000000..78be513 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATADevice.h.svn-base @@ -0,0 +1,179 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOATADevice.h + * + * This object implements a relay to an ATA Bus where a drive is attached. + */ + + +#ifndef _IOATADEVICE_H +#define _IOATADEVICE_H + +#include +#include +#include "IOATATypes.h" +#include "IOATACommand.h" +#include "IOATABusInfo.h" +#include "IOATADevConfig.h" + +class IOATAController; + + +/*! + @class IOATADevice + @abstract This object implements a relay to an ATA Bus where a drive is attached. + @discussion IOATADevice is the superclass which represents a particular device attached to a particular IOATAController (bus). IOATADevice is the provider for ATA mass-storage device drivers.IOATADevice is the factory for all IOATACommand objects and is responsible for creating and freeing IOATACommands. IOATAControllers will create an instance of IOATADevice for each device physically connected to the ata bus. IOATADevice is virtual and specific subclass should be implemented for particular types of IOATAController. In this manner, controller-specifc IOATACommands may be paired with the proper type of controller. +*/ + +class IOATADevice : public IOService +{ + OSDeclareDefaultStructors(IOATADevice); + +public: + + // + /*!@function getUnitID + @abstract Determine whether this device is number 0 or 1 (ie, master/slave) + @result ataUnitID - 0 or 1. + */ + virtual ataUnitID getUnitID( void ); + + // + /*!@function getDeviceType + @abstract Find out what kind of device this nub is (ata or atapi) + @result ataDeviceType as defined in IOATATypes.h + */ + virtual ataDeviceType getDeviceType( void ); + + // + /*!@function provideBusInfo + @abstract Find out the bus capability so the client can choose the features to set and commands to run. + @param getInfo a pointer to a valid IOATABusInfo object. + @result kIOSuccess (0) and the getInfo object will be filled out by the bus controller with information about the bus. + */ + virtual IOReturn provideBusInfo( IOATABusInfo* getInfo); + + // + /*!@function selectConfig + @abstract Tell the bus what speed to use for your device. + @param configRequest pointer to a valid and initialized IOATADevConfig object. + @result kIOSuccess (0) if the configuration was succesfully selected. + @discussion This should only be called once during a disk drivers start method before registering its availability, and must be called prior to issuing any data IO transactions. + */ + virtual IOReturn selectConfig( IOATADevConfig* configRequest); + + // + /*!@function provideConfig + @abstract Find out what speed the bus has configured for this unit. + @param configRequest pointer to a valid IOATADevConfig object. + @result kIOSuccess (0) on successful completion and configRequest will contain the configuration information. + */ + virtual IOReturn provideConfig( IOATADevConfig* configRequest); + + // Submit IO requests + /*! + @function executeCommand + @abstract Submit IO requests + @param command pointer to a valid IOATACommand with the command to be executed. + @result kIOSuccess (0) if the command was successfully queued in the controller. + */ + virtual IOReturn executeCommand(IOATACommand* command); + + // create and destroy IOATACommands + /*! + @function allocCommand + @abstract create IOATACommands. Device drivers should allocate command objects only through this method. + @result null if allocation failed. Retain count is one. + */ + virtual IOATACommand* allocCommand( void ); + + /*! + @function freeCommand + @abstract release a command object that is no longer needed. Do not free an object in use and do not release the object anymore times than you have retained it. + @param inCommand the command to be released. + */ + virtual void freeCommand( IOATACommand* inCommand); + + // matching stuff for IOBSDInit and so on. + /*!@function matchPropertyTable + @abstract matching stuff for IOBSDInit and so on. + */ + virtual bool matchPropertyTable(OSDictionary * table); + + /*!@function matchLocation + @abstract matching stuff for IOBSDInit and so on. + */ + virtual IOService* matchLocation(IOService * client); + + /*!@function matchPropertyTable + @abstract matching stuff for IOBSDInit and so on. + */ + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + // called by controllers when they need to send a message to client drivers. + /*! + @function notifyEvent + @abstract called by controllers when they need to send a message to client (disk) drivers. + */ + virtual void notifyEvent( UInt32 event ); + + +protected: + IOATAController* _provider; + ataUnitID _unitNumber; // 0 - master, 1 - slave, -1 = not Valid + ataDeviceType _deviceType; // ata, atapi, unknown +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATADevice, 0); + OSMetaClassDeclareReservedUnused(IOATADevice, 1); + OSMetaClassDeclareReservedUnused(IOATADevice, 2); + OSMetaClassDeclareReservedUnused(IOATADevice, 3); + OSMetaClassDeclareReservedUnused(IOATADevice, 4); + OSMetaClassDeclareReservedUnused(IOATADevice, 5); + OSMetaClassDeclareReservedUnused(IOATADevice, 6); + OSMetaClassDeclareReservedUnused(IOATADevice, 7); + OSMetaClassDeclareReservedUnused(IOATADevice, 8); + OSMetaClassDeclareReservedUnused(IOATADevice, 9); + OSMetaClassDeclareReservedUnused(IOATADevice, 10); + OSMetaClassDeclareReservedUnused(IOATADevice, 11); + OSMetaClassDeclareReservedUnused(IOATADevice, 12); + OSMetaClassDeclareReservedUnused(IOATADevice, 13); + OSMetaClassDeclareReservedUnused(IOATADevice, 14); + OSMetaClassDeclareReservedUnused(IOATADevice, 15); + OSMetaClassDeclareReservedUnused(IOATADevice, 16); + OSMetaClassDeclareReservedUnused(IOATADevice, 17); + OSMetaClassDeclareReservedUnused(IOATADevice, 18); + OSMetaClassDeclareReservedUnused(IOATADevice, 19); + OSMetaClassDeclareReservedUnused(IOATADevice, 20); +}; + +#endif /* !_IOATABUSNUB_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATARegI386.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATARegI386.h.svn-base new file mode 100644 index 0000000..73016ba --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATARegI386.h.svn-base @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOATAREGI386_H +#define _IOATAREGI386_H + +#include + +/* + * IOATAReg: ATA register abstract base class. + */ +#define DefineIOATAReg(w) \ +class IOATAReg##w : public OSObject \ +{ \ + OSDeclareAbstractStructors( IOATAReg##w ) \ + \ +public: \ + virtual void operator = (UInt##w rhs) = 0; \ + virtual operator UInt##w() const = 0; \ +} + +DefineIOATAReg( 8 ); +DefineIOATAReg( 16 ); +DefineIOATAReg( 32 ); + +typedef IOATAReg8 * IOATARegPtr8; +typedef IOATAReg16 * IOATARegPtr16; +typedef IOATAReg32 * IOATARegPtr32; + +#define IOATARegPtr8Cast(x) (x) + +/* + * IOATAIOReg: I/O mapped ATA registers. + */ +#define DefineIOATAIOReg(w) \ +class IOATAIOReg##w : public IOATAReg##w \ +{ \ + OSDeclareDefaultStructors( IOATAIOReg##w ) \ + \ +protected: \ + UInt16 _address; \ + \ +public: \ + static IOATAIOReg##w * withAddress( UInt16 address ); \ + \ + virtual bool initWithAddress( UInt16 address ); \ + virtual UInt16 getAddress() const; \ + \ + virtual void operator = (UInt##w rhs); \ + virtual operator UInt##w() const; \ +} + +DefineIOATAIOReg( 8 ); +DefineIOATAIOReg( 16 ); +DefineIOATAIOReg( 32 ); + +#endif /* !_IOATAREGI386_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOATATypes.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOATATypes.h.svn-base new file mode 100644 index 0000000..a3be9dc --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOATATypes.h.svn-base @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATATYPES_H +#define _IOATATYPES_H + +#include + + +/*! + +@header IOATAtypes.h +@discussion contains various definitions and constants for use in the IOATAFamily and clients. Header Doc is incomplete at this point, but file is heavily commented. + +*/ +// property strings +#define kATADevPropertyKey "ata device type" +#define kATATypeATAString "ata" +#define kATATypeATAPIString "atapi" +#define kATATypeUnknownString "unknown" + +#define kATAVendorPropertyKey "device model" +#define kATARevisionPropertyKey "device revision" +#define kATASerialNumPropertyKey "device serial" + +#define kATAUnitNumberKey "unit number" + +#define kATASocketKey "socket type" +#define kATAInternalSocketString "internal" +#define kATAMediaBaySocketString "media-bay" +#define kATAPCCardSocketString "pccard" +#define kATAInternalSATAString "serial-ata" +#define kATASATABayString "sata-bay" +#define kATAInternalSATA2 "serial-ata-2" +#define kATASATA2BayString "sata-2-bay" +#define kATAUnkownSocketString "unknown" + +#define kATANotifyOnChangeKey "media-notify" + +// allows for porting to non-memory-mapped IO systems, such as x86. +// for such a platform, create a class and overload the assignment operators +// so that the correct IO operation is performed and define the type for that architecture port. +#ifdef __ppc__ +#define IOATARegPtr8 volatile UInt8* +#define IOATARegPtr16 volatile UInt16* +#define IOATARegPtr32 volatile UInt32* +#define IOATARegPtr8Cast(x) ((IOATARegPtr8)(x)) +#elif defined( __i386__ ) || defined( __x86_64__ ) +#include +#else +#error Unknown machine architecture +#endif + +enum ataSocketType{ + + kUnknownSocket = 0, + kInternalATASocket, + kMediaBaySocket , + kPCCardSocket, + kInternalSATA, + kSATABay, + kInternalSATA2, + kSATA2Bay + +} ; + + +enum ataDeviceType { + + kUnknownATADeviceType = 0, + kATADeviceType, + kATAPIDeviceType + +} ; + +// enum for bits 5 and 6 of word zero of +// the identify packet device info data. +// shift word-0 5-bits left, mask 0x03 and these enums apply. +enum atapiConfig { + + kATAPIDRQSlow = 0x00, + kATAPIIRQPacket = 0x01, + kATAPIDRQFast = 0x10, + kATAPIUnknown = 0x11 + +}; + + +enum ataUnitID { + + kATAInvalidDeviceID = -1, + kATADevice0DeviceID = 0, /* aka, Master. Device 0 is the correct terminology */ + kATADevice1DeviceID = 1 /* aka, Slave. Device 1 is the correct terminology */ + +} ; + +enum { + + kATADefaultSectorSize = 512 +}; + +/* Task file definition *** Error Register *** */ +enum { + bATABadBlock = 7, /* bit number of bad block error bit*/ + bATAUncorrectable = 6, /* bit number of uncorrectable error bit*/ + bATAMediaChanged = 5, /* bit number of media changed indicator*/ + bATAIDNotFound = 4, /* bit number of ID not found error bit*/ + bATAMediaChangeReq = 3, /* bit number of media changed request*/ + bATACommandAborted = 2, /* bit number of command abort bit*/ + bATATrack0NotFound = 1, /* bit number of track not found*/ + bATAAddressNotFound = 0, /* bit number of address mark not found*/ + mATABadBlock = 1 << bATABadBlock, /* Bad Block Detected*/ + mATAUncorrectable = 1 << bATAUncorrectable, /* Uncorrectable Data Error*/ + mATAMediaChanged = 1 << bATAMediaChanged, /* Media Changed Indicator (for removable)*/ + mATAIDNotFound = 1 << bATAIDNotFound, /* ID Not Found*/ + mATAMediaChangeReq = 1 << bATAMediaChangeReq, /* Media Change Requested (NOT IMPLEMENTED)*/ + mATACommandAborted = 1 << bATACommandAborted, /* Aborted Command*/ + mATATrack0NotFound = 1 << bATATrack0NotFound, /* Track 0 Not Found*/ + mATAAddressNotFound = 1 << bATAAddressNotFound /* Address Mark Not Found*/ +}; + +/* Task file definition *** Features register *** */ +enum { + bATAPIuseDMA = 0, /* bit number of useDMA bit (ATAPI)*/ + mATAPIuseDMA = 1 << bATAPIuseDMA +}; + +/* Task file definition *** ataTFSDH Register *** */ +enum { + mATAHeadNumber = 0x0F, /* Head Number (bits 0-3) */ + mATASectorSize = 0xA0, /* bit 7=1; bit 5 = 01 (512 sector size) */ + mATADriveSelect = 0x10, /* Drive (0 = master, 1 = slave) */ + mATALBASelect = 0x40 /* LBA mode bit (0 = chs, 1 = LBA)*/ +}; + +/* Task file definition *** Status Register *** */ +enum { + bATABusy = 7, /* bit number of BSY bit*/ + bATADriveReady = 6, /* bit number of drive ready bit*/ + bATAWriteFault = 5, /* bit number of write fault bit*/ + bATASeekComplete = 4, /* bit number of seek complete bit*/ + bATADataRequest = 3, /* bit number of data request bit*/ + bATADataCorrected = 2, /* bit number of data corrected bit*/ + bATAIndex = 1, /* bit number of index mark*/ + bATAError = 0, /* bit number of error bit*/ + mATABusy = 1 << bATABusy, /* Unit is busy*/ + mATADriveReady = 1 << bATADriveReady, /* Unit is ready*/ + mATAWriteFault = 1 << bATAWriteFault, /* Unit has a write fault condition*/ + mATASeekComplete = 1 << bATASeekComplete, /* Unit seek complete*/ + mATADataRequest = 1 << bATADataRequest, /* Unit data request*/ + mATADataCorrected = 1 << bATADataCorrected, /* Data corrected*/ + mATAIndex = 1 << bATAIndex, /* Index mark - NOT USED*/ + mATAError = 1 << bATAError /* Error condition - see error register*/ +}; + +/* Task file definition *** Device Control Register *** */ +enum { + bATADCROne = 3, /* bit number of always one bit*/ + bATADCRReset = 2, /* bit number of reset bit*/ + bATADCRnIntEnable = 1, /* bit number of interrupt disable*/ + mATADCROne = 1 << bATADCROne, /* always one bit*/ + mATADCRReset = 1 << bATADCRReset, /* Reset (1 = reset)*/ + mATADCRnIntEnable = 1 << bATADCRnIntEnable /* Interrupt Disable(0 = enabled)*/ +}; + + +/* 'ataRegMask' field of the ataRegAccess definition*/ +enum ataRegMask{ + + bATAAltSDevCValid = 14, /* bit number of alternate status/device cntrl valid bit*/ + bATAStatusCmdValid = 7, /* bit number of status/command valid bit*/ + bATASDHValid = 6, /* bit number of ataTFSDH valid bit*/ + bATACylinderHiValid = 5, /* bit number of cylinder high valid bit*/ + bATACylinderLoValid = 4, /* bit number of cylinder low valid bit*/ + bATASectorNumValid = 3, /* bit number of sector number valid bit*/ + bATASectorCntValid = 2, /* bit number of sector count valid bit*/ + bATAErrFeaturesValid = 1, /* bit number of error/features valid bit*/ + bATADataValid = 0, /* bit number of data valid bit*/ + mATAAltSDevCValid = 1 << bATAAltSDevCValid, /* alternate status/device control valid*/ + mATAStatusCmdValid = 1 << bATAStatusCmdValid, /* status/command valid*/ + mATASDHValid = 1 << bATASDHValid, /* ataTFSDH valid*/ + mATACylinderHiValid = 1 << bATACylinderHiValid, /* cylinder high valid*/ + mATACylinderLoValid = 1 << bATACylinderLoValid, /* cylinder low valid*/ + mATASectorNumValid = 1 << bATASectorNumValid, /* sector number valid*/ + mATASectorCntValid = 1 << bATASectorCntValid, /* sector count valid*/ + mATAErrFeaturesValid = 1 << bATAErrFeaturesValid, /* error/features valid*/ + mATADataValid = 1 << bATADataValid /* data valid*/ + +} ; + + +enum ataFlags{ + bATAFlagQuiesce = 20, + bATAFlagNoIRQ = 19, /* bit Number of no IRQ protocol flag*/ + bATAFlag48BitLBA = 18, + bATAFlagDMAQueued = 17, + bATAFlagOverlapped = 16, + bATAFlagUseConfigSpeed = 15, /* bit number of use configured speed flag*/ + bATAFlagByteSwap = 14, /* bit number of byte swap flag*/ + bATAFlagIORead = 13, /* bit number of I/O read flag*/ + bATAFlagIOWrite = 12, /* bit number of I/O write flag*/ + bATAFlagTFAccessResult = 8, /* bit number of get register results on command completion.*/ + bATAFlagUseDMA = 7, /* bit number of use DMA flag*/ + bATAFlagProtocolATAPI = 5, /* bit number of ATAPI protocol*/ + bATAFlagImmediate = 1, /* bit number of immediate flag */ + bATAFlagTFAccess = 0, /* bit number of TF access */ + + mATAFlagQuiesce = 1 << bATAFlagQuiesce, + mATAFlagUseNoIRQ = 1 << bATAFlagNoIRQ, /* Special purpose! Avoid using! No-IRQ, polled synchronous protocol valid only for PIO commands*/ + mATAFlag48BitLBA = 1 << bATAFlag48BitLBA, /* Use 48 bit extended LBA protocol on this command. Requires support from the controller.*/ + mATAFlagDMAQueued = 1 << bATAFlagDMAQueued, /* Use tagged dma queuing protocol on this command. Requires support from the controller.*/ + mATAFlagOverlapped = 1 << bATAFlagOverlapped, /* Use overllaped protocol on this command. Requires support from the controller.*/ + mATAFlagUseConfigSpeed = 1 << bATAFlagUseConfigSpeed, /* Use the configured interface speed = true. False = use default PIO (slow) speed. valid only for PIO commands*/ + mATAFlagByteSwap = 1 << bATAFlagByteSwap, /* Swap data bytes (read - after; write - before)*/ + mATAFlagIORead = 1 << bATAFlagIORead, /* Read (in) operation*/ + mATAFlagIOWrite = 1 << bATAFlagIOWrite, /* Write (out) operation*/ + mATAFlagTFAccessResult = 1 << bATAFlagTFAccessResult, /* get contents of TaskFile registers indicated in TFMask on command completion, even if no error*/ + mATAFlagUseDMA = 1 << bATAFlagUseDMA, + mATAFlagProtocolATAPI = 1 << bATAFlagProtocolATAPI, /* ATAPI protocol indicator*/ + mATAFlagImmediate = 1 << bATAFlagImmediate, /* Put command at head of queue */ + mATAFlagTFAccess = 1 << bATAFlagTFAccess, /* Return Taskfile on error status*/ + +} ; + +/* The Function codes sent to controllers*/ +enum ataOpcode { + + kATANoOp = 0, + kATAFnExecIO , /* Execute ATA I/O */ + kATAPIFnExecIO, /* ATAPI I/O */ + kATAFnRegAccess , /* Register Access */ + + kATAFnQFlush , /* I/O Queue flush requests for your unit number */ + kATAFnBusReset /* Reset ATA bus */ + +} ; + + +/* The ATA Event codes */ +/* sent when calling the device driver's event handler*/ +enum ataEventCode { + kATANullEvent = 0x00, /* Just kidding -- nothing happened*/ + kATAOnlineEvent = 0x01, /* An ATA device has come online*/ + kATAOfflineEvent = 0x02, /* An ATA device has gone offline*/ + kATARemovedEvent = 0x03, /* An ATA device has been removed from the bus*/ + kATAResetEvent = 0x04, /* Someone gave a hard reset to the drive*/ + kATAOfflineRequest = 0x05, /* Someone requesting to offline the drive*/ + kATAEjectRequest = 0x06, /* Someone requesting to eject the drive*/ + kATAPIResetEvent = 0x07, /* Someone gave a ATAPI reset to the drive*/ + kATAReservedEvent = 0x80 /* RESERVED*/ +}; + + +// These need to be combined with a new enumeration of the current ATA/ATAPI command set. +// Some opcodes are of interest to ATA controllers, since they imply special protocols +// or handling. Device Reset, Execute Device Diagnostics have subtle side effects that +// controllers need to be aware of, so we snoop for those commands being issued. +// the rest are here for informational purposes. + +// BUG make new enum for all current ATA commands. + +enum { + kSOFTRESET = 0x008, // ATAPI Soft Reset command + kPACKET = 0x0A0, // ATAPI Packet command + kID_DRIVE = 0x0A1 // ATAPI Identify drive command +}; +/* ATA Command Opcode definition*/ +enum { + kATAcmdWORetry = 0x01, /* Without I/O retry option*/ + kATAcmdNOP = 0x0000, /* NOP operation - media detect*/ + kATAcmdRecal = 0x0010, /* Recalibrate command */ + kATAcmdRead = 0x0020, /* Read command */ + kATAcmdReadLong = 0x0022, /* Read Long command*/ + kATAcmdReadExtended = 0x0024, /* Read Extended (with retries)*/ + kATAcmdReadDMAExtended = 0x0025, /* Read DMA Extended (with retries)*/ + kATAcmdWrite = 0x0030, /* Write command */ + kATAcmdWriteLong = 0x0032, /* Write Long*/ + kATAcmdWriteExtended = 0x0034, /* Write Extended (with retries)*/ + kATAcmdWriteDMAExtended = 0x0035, /* Write DMA Extended (with retries)*/ + kATAcmdWriteVerify = 0x003C, /* Write verify*/ + kATAcmdReadVerify = 0x0040, /* Read Verify command */ + kATAcmdFormatTrack = 0x0050, /* Format Track command */ + kATAcmdSeek = 0x0070, /* Seek command */ + kATAcmdDiagnostic = 0x0090, /* Drive Diagnostic command */ + kATAcmdInitDrive = 0x0091, /* Init drive parameters command */ + kATAcmdReadMultiple = 0x00C4, /* Read multiple*/ + kATAcmdWriteMultiple = 0x00C5, /* Write multiple*/ + kATAcmdSetRWMultiple = 0x00C6, /* Set Multiple for Read/Write Multiple*/ + kATAcmdReadDMA = 0x00C8, /* Read DMA (with retries)*/ + kATAcmdWriteDMA = 0x00CA, /* Write DMA (with retries)*/ + kATAcmdMCAcknowledge = 0x00DB, /* Acknowledge media change - removable*/ + kATAcmdDoorLock = 0x00DE, /* Door lock*/ + kATAcmdDoorUnlock = 0x00DF, /* Door unlock*/ + kATAcmdStandbyImmed = 0x00E0, /* Standby Immediate*/ + kATAcmdIdleImmed = 0x00E1, /* Idle Immediate*/ + kATAcmdStandby = 0x00E2, /* Standby*/ + kATAcmdIdle = 0x00E3, /* Idle*/ + kATAcmdReadBuffer = 0x00E4, /* Read sector buffer command */ + kATAcmdCheckPowerMode = 0x00E5, /* Check power mode command <04/04/94>*/ + kATAcmdSleep = 0x00E6, /* Sleep*/ + kATAcmdFlushCache = 0x00E7, /* Flush Cache */ + kATAcmdWriteBuffer = 0x00E8, /* Write sector buffer command */ + kATAcmdWriteSame = 0x00E9, /* Write same data to multiple sectors*/ + kATAcmdFlushCacheExtended = 0x00EA, /* Flush Cache Extended */ + kATAcmdDriveIdentify = 0x00EC, /* Identify Drive command */ + kATAcmdMediaEject = 0x00ED, /* Media Eject*/ + kATAcmdSetFeatures = 0x00EF /* Set Features*/ +}; + +/* Set feature command opcodes*/ +enum { + kATAEnableWriteCache = 0x02, /* Enable write cache*/ + kATASetTransferMode = 0x03, /* Set transfer mode*/ + kATAEnableAPM = 0x05, /* Enable Advanced Power Management*/ + kATASetPIOMode = 0x08, /* PIO Flow Control Tx Mode bit*/ + kATADisableWriteCache = 0x82, /* disable write cache*/ + kATAEnableReadAhead = 0xAA /* Read look-ahead enable*/ +}; + +// revisit the opcode enumerations. + +////////////////////// + + +/* task file for ata */ +typedef struct ataTaskFile { + + UInt8 ataTFFeatures; /* <-> Error(R) or ataTFFeatures(W) register image */ + UInt8 ataTFCount; /* <-> Sector count/remaining */ + UInt8 ataTFSector; /* <-> Sector start/finish */ + UInt8 ataTFCylLo; /* <-> ataTFCylLo */ + UInt8 ataTFCylHigh; /* <-> ataTFCylHigh */ + UInt8 ataTFSDH; /* <-> ataTFSDH register image*/ + UInt8 ataTFCommand; /* <-> Status(R) or Command(W) register image */ + +} ataTaskFile; + + +typedef struct ataRegisterImage { + + ataTaskFile taskFile; + UInt16 ataDataRegister; /* <-> Data register. */ + UInt8 ataAltSDevCReg; /* <->: Alternate status(R) or Device Control(W) register image*/ + +} ataRegisterImage ; + + +typedef struct ATAPICmdPacket{ + + UInt16 atapiPacketSize; /* Size of command packet in bytes */ + UInt16 atapiCommandByte[8]; /* The command packet itself*/ + +}ATAPICmdPacket; + + + +// Error and result codes: TBD +enum { + kATAErrUnknownType = -1, + kATANoErr = 0, + kATAQueueEmpty = 1, + kATAUnknownOpcode, + kATATimeoutErr, + kATAInvalidDevID, + kATAErrDevBusy, + kATAModeNotSupported, + kATADevIntNoCmd, + kATADeviceError, + kATADMAErr +}; + + +#endif /* !_IOATATYPES_H */ diff --git a/i386/include/IOKit/ata/.svn/text-base/IOPCIATA.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/IOPCIATA.h.svn-base new file mode 100644 index 0000000..62067b2 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/IOPCIATA.h.svn-base @@ -0,0 +1,200 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _DRV_PCI_ATA_H +#define _DRV_PCI_ATA_H + +#include +#include +#include "IOATAController.h" +#include +#include + +#include + +/*! @class IOPCIATA + @abstract The base class for PCI-IDE ata controller family. + @discussion class defining the common elements of bus-mastering PCI ATA controllers which meet or at least loosely follow the pci bus mastering pci-ide controller spec. Header doc is incomplete, but source is heavily commented. + +*/ + + + +class IOPCIATA : public IOATAController +{ + OSDeclareDefaultStructors(IOPCIATA); + +public: + + /*--- Overrides from IOATAController ---*/ + virtual bool init(OSDictionary * properties); + virtual bool start( IOService* provider ); + +protected: + + // The DMA states: not in use, in use and running with additional passes needed, + // in use on final pass, transfer complete, and failure + enum ATADMAState + { + // DMA state flags + kATADMAInactive, + kATADMAStarting, + kATADMAActive, + kATADMAStatus, + kATADMAComplete, + kATADMAError, + + }; + + enum { + // PRD flags + kLast_PRD = 0x8000, + kContinue_PRD = 0, + + }; + + + enum { + mBMCmdStartOutput = 0x01, // start engine to transfer from memory to device. + mBMCmdStartInput = (1 << 3 ) | 0x01, // start engine to transfer from device to memory + mBMCmdStop = 0x00, // halt engine. + }; + + enum { + // bus master status register definitions. + bBMStatusSimplex = 7, // 0 = simultaneous transactions allowed. 1 = primary and secondary busses may not be active at same time. + bBMStatusDrv1 = 6, // 1 = device 1 and bus are already configured by some other software/firmware + bBMStatusDrv0 = 5, // 1 = device 0 and bus are already configured by some other software/firmware + bBMStatusInt = 2, // 1 = device has asserted INTRQ and all data is flushed to/from memory. + bBMStatusError = 1, // 1 = an error in the DMA has occured. Software clears by writing 1 to this bit. + bBMStatusActive = 0, // 1 = DMA engine is active. + }; + + enum{ + + mBMStatusSimplex = 1 << 7, + mBMStatusDrv1 = 1 << 6, + mBMStatusDrv0 = 1 << 5, + mBMStatusInt = 1 << 2, + mBMStatusError = 1 << 1, + mBMStatusActive = 1 + }; + + // the physical region descriptor used for the dma engine. + struct PRD + { + UInt32 bufferPtr; // address + UInt16 byteCount; // 16 bit byte count where 0x0000 = 64K + UInt16 flags; // 0 in flags means contine, 0x80 means stop + }; + + + // descendants of this class MUST initialize these values + // prior to activating any DMA command. + IOATARegPtr8 _bmCommandReg; + IOATARegPtr8 _bmStatusReg; + IOATARegPtr32 _bmPRDAddresReg; + + // semaphore for DMA state + UInt32 _dmaState; + + // table of PRD descriptors + PRD* _prdTable; + IOPhysicalAddress _prdTablePhysical; + + IONaturalMemoryCursor* _DMACursor; + + // override from IOATAController + // activate the DMA engine as per the current command + virtual IOReturn startDMA( void ); + + // override from IOATAController + // safely halt the DMA engine regardless of state + virtual IOReturn stopDMA( void ); + + // allocate memory for the PRD descriptors. + virtual bool allocDMAChannel(void); + + // fill CC with stop commands. + virtual void initATADMAChains (PRD* descPtr); + + // fill out a PRD, respecting endianess + virtual void setPRD(UInt8 *bffr, UInt16 count, PRD *tableElement, UInt16 end); + + // setup the CC with IO commands + virtual IOReturn createChannelCommands(void); + + // deallocate memory for the DMA engine + virtual bool freeDMAChannel(void); + + // clean up on device interrupt + virtual IOReturn handleDeviceInterrupt(void); + + // activate the DMA engine + virtual void activateDMAEngine(void); + + // shutdown the DMA engine + virtual void stopDMAEngine(void); + + // safely suspend the DMA engine + virtual void shutDownATADMA (void); + + // overrides + virtual void free(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOPCIATA class in the future. + */ + typedef struct ExpansionData + { + IOBufferMemoryDescriptor* _prdBuffer; + } ExpansionData; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOPCIATA, 0); + OSMetaClassDeclareReservedUnused(IOPCIATA, 1); + OSMetaClassDeclareReservedUnused(IOPCIATA, 2); + OSMetaClassDeclareReservedUnused(IOPCIATA, 3); + OSMetaClassDeclareReservedUnused(IOPCIATA, 4); + OSMetaClassDeclareReservedUnused(IOPCIATA, 5); + OSMetaClassDeclareReservedUnused(IOPCIATA, 6); + OSMetaClassDeclareReservedUnused(IOPCIATA, 7); + OSMetaClassDeclareReservedUnused(IOPCIATA, 8); + OSMetaClassDeclareReservedUnused(IOPCIATA, 9); + OSMetaClassDeclareReservedUnused(IOPCIATA, 10); + OSMetaClassDeclareReservedUnused(IOPCIATA, 11); + OSMetaClassDeclareReservedUnused(IOPCIATA, 12); + OSMetaClassDeclareReservedUnused(IOPCIATA, 13); + OSMetaClassDeclareReservedUnused(IOPCIATA, 14); + OSMetaClassDeclareReservedUnused(IOPCIATA, 15); + OSMetaClassDeclareReservedUnused(IOPCIATA, 16); + OSMetaClassDeclareReservedUnused(IOPCIATA, 17); + OSMetaClassDeclareReservedUnused(IOPCIATA, 18); + OSMetaClassDeclareReservedUnused(IOPCIATA, 19); + OSMetaClassDeclareReservedUnused(IOPCIATA, 20); +}; + +#endif // _DRV_PCI_ATA_H diff --git a/i386/include/IOKit/ata/.svn/text-base/MacIOATA.h.svn-base b/i386/include/IOKit/ata/.svn/text-base/MacIOATA.h.svn-base new file mode 100644 index 0000000..fad6c33 --- /dev/null +++ b/i386/include/IOKit/ata/.svn/text-base/MacIOATA.h.svn-base @@ -0,0 +1,225 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#if defined(__ppc__) + + +#ifndef _DRV_MACIO_ATA_H +#define _DRV_MACIO_ATA_H + +#include +#include +#include "IOATAController.h" +#include +#include + +#include + + +/*! @class MacIOATA + @abstract The base class for MAC-IO ata controller family. . + @discussion class defining the portions of MacIO ATA cells which are shared + in common between Heathrow and Key Largo ATA Cells. + These controllers share a common register file layout, interrupt + source format and all use DBDMA engines. These are different from + other ATA controllers, such as most PCI-IDE and PC-Card ATA ports. + Each cell type has some distinctive features that must be implemented + by a specific driver subclass. As much common code as possible is + presented in this superclass. + +*/ + +class MacIOATA : public IOATAController +{ + OSDeclareDefaultStructors(MacIOATA); + +public: + + /*--- Overrides from IOATAController ---*/ + virtual bool init(OSDictionary * properties); + virtual bool start( IOService* provider ); + virtual IOReturn message (UInt32 type, IOService* provider, void* argument = 0); + +protected: + + // The DMA states: not in use, in use and running with additional passes needed, + // in use on final pass, transfer complete, and failure + enum ATADMAState + { + kATADMAInactive, + kATADMAStarting, + kATADMAActive, + kATADMAStatus, + kATADMAComplete, + kATADMAError + }; + + + + // the address of the timing register in the controller + volatile UInt32* _timingConfigReg; + // the timing values to use for each device. + UInt32 _timingConfig[2]; + + // semaphore for DMA state + UInt32 _dmaState; + + // indicates whether a DMA interrupt is expected + UInt32 _dmaIntExpected; + + // pointer to the DMA control register address. + volatile IODBDMAChannelRegisters* _dmaControlReg; + + // mappings to the controller and DMA engine registers + // we have to free these when we go away. + IOMemoryMap* _baseAddressMap; + IOMemoryMap* _dmaBaseMap; + + // the DBDMA memory cursor + IODBDMAMemoryCursor* _DMACursor; + + // the DBDMA descriptor table + IODBDMADescriptor* _descriptors; + IOPhysicalAddress _descriptorsPhysical; + + // interrupt event sources + IOInterruptEventSource* _devIntSrc; + IOInterruptEventSource* _dmaIntSrc; + + // flag indicating device and dma engine interrupts need + // re-synchronization. + + bool _resyncInterrupts; +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // overriden to allow synchronization of DMA vs. device interrupts. + virtual IOReturn handleDeviceInterrupt(void); + // overriden here to allow for reporting of DMA errs + virtual IOReturn asyncStatus(void); + + // overriden here to allow for clean up of DMA resynch flag on timeout. + virtual void handleTimeout(void); + + + // called by the superclass::start method in order to + // find and enable access to the ATA task file. + virtual bool configureTFPointers(void); + + // allocate memory for the DMA descriptors. + virtual bool allocDMAChannel(void); + + // fill CC with stop commands. + virtual void initATADMAChains (IODBDMADescriptor* descPtr); + + // setup the CC with IO commands + virtual IOReturn createChannelCommands(void); + + // deallocate memory for the DMA engine + virtual bool freeDMAChannel(void); + + // connect the device (drive) interrupt to our workloop + virtual bool createDeviceInterrupt(void); + + // connect the DMA interrupt to our workloop. + virtual bool createDMAInterrupt(void); + + + // override from IOATAController + // activate the DMA engine as per the current command + virtual IOReturn startDMA( void ); + + // override from IOATAController + // safely halt the DMA engine regardless of state + virtual IOReturn stopDMA( void ); + + // handle the interrupt processing + virtual void processDMAInterrupt (void); + + // activate the DMA engine + virtual void activateDMAEngine(void); + + // shutdown the DMA engine + virtual void stopDMAEngine(void); + + // safely suspend the DMA engine + virtual void shutDownATADMA (void); + + // check the command chain after run to update byte counts + // and check for errors + virtual bool scanATADMAChain (IOByteCount* byteCount); + + + // c to c++ glue code. + static void deviceInterruptOccurred(OSObject*, IOInterruptEventSource *, int count); + static void dmaInterruptOccurred(OSObject*, IOInterruptEventSource *, int count); + + // overrides + virtual void free(); + + // media bay specific code + bool isMediaBay; + bool isBusOnline; + + virtual IOReturn executeCommand(IOATADevice* nub, IOATABusCommand* command); + virtual IOReturn handleQueueFlush( void ); + virtual bool checkTimeout( void ); + static void cleanUpAction(OSObject * owner, void*, void*, void*, void*); + virtual void cleanUpBus(void); + virtual IOReturn handleBusReset(void); + // end media bay specific. + +private: + OSMetaClassDeclareReservedUnused(MacIOATA, 0); + OSMetaClassDeclareReservedUnused(MacIOATA, 1); + OSMetaClassDeclareReservedUnused(MacIOATA, 2); + OSMetaClassDeclareReservedUnused(MacIOATA, 3); + OSMetaClassDeclareReservedUnused(MacIOATA, 4); + OSMetaClassDeclareReservedUnused(MacIOATA, 5); + OSMetaClassDeclareReservedUnused(MacIOATA, 6); + OSMetaClassDeclareReservedUnused(MacIOATA, 7); + OSMetaClassDeclareReservedUnused(MacIOATA, 8); + OSMetaClassDeclareReservedUnused(MacIOATA, 9); + OSMetaClassDeclareReservedUnused(MacIOATA, 10); + OSMetaClassDeclareReservedUnused(MacIOATA, 11); + OSMetaClassDeclareReservedUnused(MacIOATA, 12); + OSMetaClassDeclareReservedUnused(MacIOATA, 13); + OSMetaClassDeclareReservedUnused(MacIOATA, 14); + OSMetaClassDeclareReservedUnused(MacIOATA, 15); + OSMetaClassDeclareReservedUnused(MacIOATA, 16); + OSMetaClassDeclareReservedUnused(MacIOATA, 17); + OSMetaClassDeclareReservedUnused(MacIOATA, 18); + OSMetaClassDeclareReservedUnused(MacIOATA, 19); + OSMetaClassDeclareReservedUnused(MacIOATA, 20); + +}; + +#endif // _DRV_MACIO_ATA_H + + +#endif // defined(ppc) diff --git a/i386/include/IOKit/ata/ATADeviceNub.h b/i386/include/IOKit/ata/ATADeviceNub.h new file mode 100644 index 0000000..db14182 --- /dev/null +++ b/i386/include/IOKit/ata/ATADeviceNub.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header ATADeviceNub.h + @abstract A concrete implementation of IOATADevice. + */ + +#ifndef _ATADEVICENUB_H +#define _ATADEVICENUB_H + +#include +#include "IOATATypes.h" +#include "IOATADevice.h" +#include "IOATAController.h" + +#include "IOATABusCommand.h" + + +/*! +@class ATADeviceNub +@abstract ATADeviceNub is a concrete implementation of IOATADevice. +@discussion clients of IOATA (disk drivers) should use the interface presented +by IOATADevice. Concrete nubs are private to the IOATA family and +specific subclasses of IOATADevice are instantiated by controller +drivers to provide the abstract interface to clients. + +*/ +class ATADeviceNub : public IOATADevice +{ + OSDeclareDefaultStructors(ATADeviceNub); + +public: + + /*!@function ataDeviceNub + @abstract static creator function - used by IOATAControllers to create nubs. + */ + static ATADeviceNub* ataDeviceNub( IOATAController* provider, ataUnitID unit, ataDeviceType devType); + + /*!@function attach + @abstract override of IOService method. + */ + virtual bool attach(IOService* provider ); + + + // overrides from IOATADevice to provide actual client interface + + + /*!@function executeCommand + @abstract Submit IO requests + */ + virtual IOReturn executeCommand(IOATACommand* command); + + // create and destroy IOATACommands + /*!@function allocCommand + @abstract create command objects for clients. + */ + virtual IOATACommand* allocCommand( void ); + + /*!@function freeCommand + @abstract Clients use this method to dispose of command objects. + */ + virtual void freeCommand( IOATACommand* inCommand); + + +protected: + + /*!@function init + @abstract used after creating the nub. + */ + virtual bool init(IOATAController* provider, ataUnitID unit, ataDeviceType devType); + + /*!@function publishProperties + @abstract publish the nub's properties in the device tree. + */ + virtual void publishProperties( void ); + + /*!@function publishBusProperties + @abstract puts info about this device's bus capability in the device tree. + */ + virtual void publishBusProperties(void); + + /*!@function publishVendorProperties + @abstract will be deprecated. + */ + virtual void publishVendorProperties( void ); + + /*!@function getDeviceID + @abstract get the unit id of this drive (0 or 1) + */ + virtual IOReturn getDeviceID(void); + + /*!@function MyATACallback + @abstract to be deprecated. + */ + static void MyATACallback(IOATACommand* command ); + + /*!@function processCallback + @abstract to be deprecated. + */ + void processCallback(IOATACommand* command ); + + /*!@function swapBytes16 + @abstract to be deprecated. + */ + void swapBytes16( UInt8* dataBuffer, IOByteCount length); + + UInt8* buffer; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the ATADeviceNub in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(ATADeviceNub, 0); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 1); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 2); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 3); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 4); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 5); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 6); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 7); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 8); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 9); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 10); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 11); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 12); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 13); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 14); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 15); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 16); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 17); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 18); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 19); + OSMetaClassDeclareReservedUnused(ATADeviceNub, 20); + +}; + +#endif /* !_IOATABUSNUB_H */ diff --git a/i386/include/IOKit/ata/ATATimerEventSource.h b/i386/include/IOKit/ata/ATATimerEventSource.h new file mode 100644 index 0000000..864fa9e --- /dev/null +++ b/i386/include/IOKit/ata/ATATimerEventSource.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2001-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ATATIMEREVENTSOURCE_H +#define _ATATIMEREVENTSOURCE_H + + +#include +#include +#include +#include +#include + + +/*! +@class ATATimerEventSource + +@discussion +Extend the timer event source to allow checking for timer expiration +from behind the workloop. +*/ + +class ATATimerEventSource : public IOTimerEventSource +{ + OSDeclareDefaultStructors(ATATimerEventSource); + + public: + + /*!@function ataTimerEventSource + @abstract allocate an instance of this type. + */ + static ATATimerEventSource * + ataTimerEventSource(OSObject *owner, Action action = 0); + + /*!@function hasTimedOut + @abstract returns true if the timer has expired since the last enable/disable or setTimeout() or wakeAtTime() call. + */ + virtual bool hasTimedOut( void ); + + // override to initialize the time out flag. + /*!@function + @abstract + */ + virtual bool init(OSObject *owner, Action action = 0); + + /*!@function enable + @abstract overrides in order to set/clear the timed out flag + */ + virtual void enable(); + + /*!@function disable + @abstract overrides in order to set/clear the timed out flag + */ + virtual void disable(); + + /*!@function wakeAtTime + @abstract overrides in order to set/clear the timed out flag + */ + virtual IOReturn wakeAtTime(UnsignedWide abstime); + + /*!@function cancelTimeout + @abstract overrides in order to set/clear the timed out flag + */ + virtual void cancelTimeout(); + +protected: + + enum{ kTimedOutTrue = 'true', + kTimedOutFalse = 'fals' + }; + + UInt32 hasExpired; + + + /*!@function myTimeout + @abstract my timeout function which sets the timedOut flag atomically. + */ + static void myTimeout(void *self); + + /*!@function setTimeoutFunc + @abstract override to install my timeout function instead of the super's. + */ + virtual void setTimeoutFunc(); + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 0); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 1); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 2); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 3); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 4); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 5); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 6); + OSMetaClassDeclareReservedUnused(ATATimerEventSource, 7); + +}; + + +#endif /*_ATATIMEREVENTSOURCE_H*/ diff --git a/i386/include/IOKit/ata/IOATABusCommand.h b/i386/include/IOKit/ata/IOATABusCommand.h new file mode 100644 index 0000000..94b3bca --- /dev/null +++ b/i386/include/IOKit/ata/IOATABusCommand.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOATABusCommand.h + * + */ + +#ifndef _IOATABUSCOMMAND_H +#define _IOATABUSCOMMAND_H + +#include +#include "IOATATypes.h" +#include "IOATACommand.h" + + +class IOSyncer; + + +/*! + +@class IOATABusCommand + +@discussion ATA Device (disk) drivers should use the superclass, IOATACommand +and may not derive or use any subclass of IOATACommand. + +IOATABusCommand is the subclass of IOATACommand used by +IOATAControllers. Controller classes may override this class to +provide additional fields as their needs dictate or may use this +as a concrete class if it is sufficient. + +IOATAControllers are always paired with specific IOATADevices +and each specific subclass of IOATADevice is in turn the factory method +for IOATACommands for use by disk drivers. + +In this manner, mass-storage device drivers (disk drivers, clients of +ATA bus controllers) see only the generalized interface of IOATADevice +and the generalized interface of IOATACommand. This provides isolation +from specific bus details for disk drivers and offers flexibility to +controllers to add per-command fields and state variables for their own +internal use. + +*/ + +class IOATABusCommand : public IOATACommand { + + OSDeclareDefaultStructors( IOATABusCommand ); + + public: + + // data items for use by IOATAController + + /*! @var queueChain queue header for use by IOATAController. */ + queue_chain_t queueChain; + + /*! @var state state-semaphore for use by IOATAController */ + UInt32 state; + + /*! @var syncer IOSyncer for use by IOATAController */ + IOSyncer* syncer; + + + + /*!@function allocateCmd + @abstract factory method to create an instance of this class used by subclasses of IOATADevice + */ + static IOATABusCommand* allocateCmd(void); + + /*!@function zeroCommand + @abstract set to blank state, call prior to re-use of this object + */ + virtual void zeroCommand(void); + + /*!@function getOpcode + @abstract return the command opcode + */ + virtual ataOpcode getOpcode( void ); + + /*!@function getFlags + @abstract return the flags for this command. + */ + virtual ataFlags getFlags ( void ); + + /*!@function getRegMask + @abstract get the register mask for desired regs + */ + virtual ataRegMask getRegMask( void ); + + /*!@function getUnit + @abstract return the unit id (0 master, 1 slave) + */ + virtual ataUnitID getUnit( void ); + + /*!@function getTimeoutMS + @abstract return the timeout value for this command + */ + virtual UInt32 getTimeoutMS (void ); + + /*!@function setResult + @abstract set the result code + */ + virtual void setResult( IOReturn ); + + /*!@function getCallbackPtr + @abstract return the callback pointer + */ + virtual IOATACompletionFunction* getCallbackPtr (void ); + + + /*!@function executeCallback + @abstract call the completion callback function + */ + virtual void executeCallback(void); + + /*!@function getTaskFilePtr + @abstract return the taskfile structure pointer. + */ + virtual ataTaskFile* getTaskFilePtr(void); + + /*!@function getPacketSize + @abstract return the size of atapi packet if any. + */ + virtual UInt16 getPacketSize(void); + + /*!@function getPacketData + @abstract return pointer to the array of packet data. + */ + virtual UInt16* getPacketData(void); + + /*!@function getTransferChunkSize + @abstract number of bytes between interrupts. + */ + virtual IOByteCount getTransferChunkSize(void); + + /*!@function setActualTransfer + @abstract set the byte count of bytes actually transferred. + */ + virtual void setActualTransfer ( IOByteCount bytesTransferred ); + + /*!@function getBuffer + @abstract get pointer to the memory descriptor for this transaction + */ + virtual IOMemoryDescriptor* getBuffer ( void); + + /*!@function getPosition + @abstract the position within the memory buffer for the transaction. + */ + virtual IOByteCount getPosition (void); + + /*!@function getByteCount + @abstract return the byte count for this transaction to transfer. + */ + virtual IOByteCount getByteCount (void); + + /*!@function setCommandInUse + @abstract mark the command as being in progress. + */ + virtual void setCommandInUse( bool inUse = true); + + + protected: + + // + /*!@function init + @abstract Zeroes all data, returns false if allocation fails. protected. + */ + virtual bool init(); + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATABusCommand, 0); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 1); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 2); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 3); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 4); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 5); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 6); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 7); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 8); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 9); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 10); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 11); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 12); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 13); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 14); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 15); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 16); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 17); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 18); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 19); + OSMetaClassDeclareReservedUnused(IOATABusCommand, 20); +}; + +#include + +class IOATABusCommand64 : public IOATABusCommand +{ + + OSDeclareDefaultStructors( IOATABusCommand64 ); + + public: + + // new features + static IOATABusCommand64* allocateCmd32(void); + virtual IODMACommand* GetDMACommand( void ); + + + + // overrides for IODMACommand setup + virtual void zeroCommand(void); + virtual void setBuffer ( IOMemoryDescriptor* inDesc); + virtual void setCommandInUse( bool inUse = true); + virtual void executeCallback(void); + + + protected: + IODMACommand* _dmaCmd; + virtual bool init(); + virtual void free(); +}; + +#endif /*_IOATABUSCOMMAND_H*/ diff --git a/i386/include/IOKit/ata/IOATABusInfo.h b/i386/include/IOKit/ata/IOATABusInfo.h new file mode 100644 index 0000000..6faec4c --- /dev/null +++ b/i386/include/IOKit/ata/IOATABusInfo.h @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATABUSINFO_H +#define _IOATABUSINFO_H + +#include +#include +#include "IOATATypes.h" + +/*! +@class IOATABusInfo +@discussion used to indicate the capabilities of the bus the device is connected to, PIO and DMA modes supported, etc. +*/ + +class IOATABusInfo : public OSObject +{ + OSDeclareDefaultStructors( IOATABusInfo ); + + public: + + /*!@function atabusinfo + @abstract factory method + */ + static IOATABusInfo* atabusinfo(void); + + /*!@function zeroData + @abstract set this object to a blank state. + */ + virtual void zeroData(void); + + // Used by clients of ATAControllers to find out about the bus + // capability. + + /*!@function getSocketType + @abstract returns the socket type, internal fixed, media-bay, PC-Card + Used by clients of ATAControllers to find out about the bus + */ + ataSocketType getSocketType( void ); + + /*!@function getPIOModes + @abstract returns the bit-significant map of PIO mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getPIOModes( void ); + + /*!@function getDMAModes + @abstract bit-significant map of DMA mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getDMAModes( void ); + + /*!@function getUltraModes + @abstract bit-significant map of Ultra mode(s) supported on the bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getUltraModes( void ); + + /*!@function getUnits + @abstract How many devices are present on bus. + Used by clients of ATAControllers to find out about the bus. + */ + UInt8 getUnits( void ); + + /*!@function supportsDMA + @abstract True = DMA supported on bus - inferred by looking at the DMA mode bits. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsDMA( void ); + + /*!@function supportsExtendedLBA + @abstract Supports 48-bit LBA if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsExtendedLBA( void ); + + /*!@function maxBlocksExtended + @abstract The maximum number of 512-byte blocks this controller supports + in a single Extended LBA transfer. Some controllers may be limited to less than + the maximum sector count allowed under extended LBA protocol. + */ + UInt16 maxBlocksExtended(void); + + /*!@function supportsOverlapped + @abstract Supports overlapped packet feature set if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsOverlapped( void ); + + /*!@function supportsDMAQueued + @abstract Supports DMA Queued Feature set if true. + Used by clients of ATAControllers to find out about the bus. + */ + bool supportsDMAQueued( void ); + + + // Used by ATAControllers to generate an information object. + // Would not be used by disk device drivers normally. + // Bus controllers should set these items everytime. + + /*!@function setSocketType + @abstract internal fixed, media-bay, PC-Card. Set by ATAControllers. + */ + void setSocketType( ataSocketType inSocketType ); + + /*!@function setPIOModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setPIOModes( UInt8 inModeBitMap); + + /*!@function setDMAModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setDMAModes( UInt8 inModeBitMap ); + + /*!@function setUltraModes + @abstract Bit significant map of supported transfer modes. Set by ATAControllers. + */ + void setUltraModes( UInt8 inModeBitMap ); + + /*!@function setUnits + @abstract set to indicate how many devices are on this bus. Set by ATAControllers. + */ + void setUnits( UInt8 inNumUnits ); + + // Optional bus protocols some busses may support + /*!@function setExtendedLBA + @abstract Set true for supports 48-bit LBA. Set by ATAControllers. + */ + void setExtendedLBA( bool inState ); + + /*!function setMaxBlocksExtended + @abstract value set by controllers to indicate the maximum number of blocks + allowed in a single transfer of data. Some dma engines may not be capable of supporting the full + 16-bit worth of sector count allowed under 48 bit extended LBA. Default is 256 blocks, same as + standard ATA. + */ + void setMaxBlocksExtended( UInt16 inMaxBlocks); + + /*!@function setOverlapped + @abstract Set true for supports overlapped packet feature set. Set by ATAControllers. + */ + void setOverlapped( bool inState); + + /*!@function setDMAQueued + @abstract Set true if supports DMA Queued Feature. Set by ATAControllers. + */ + void setDMAQueued( bool inState); // + + protected: + + UInt8 _PIOModes; /* PIO modes supported (bit-significant) */ + UInt8 _MultiDMAModes; /* <--: Multiword DMA modes supported (b-sig) */ + UInt8 _UltraDMAModes; /* <--: Ultra DMA modes supported (b-sig) */ + bool _ExtendedLBA; /* <--: Suppports 48-bit LBA protocol */ + bool _Overlapped; /* <--: Supports overlapped packet feature set */ + bool _DMAQueued; /* <--: Supports DMA Queued Feature set */ + ataSocketType _SocketType; /* <--: Indicates bus is fixed internal, removable media-bay, removable PC-Card or unknown type */ + UInt8 _numUnits; /* <--: How many devices on this bus */ + UInt16 _maxBlocksExtended; + + protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool init(); + +private: + OSMetaClassDeclareReservedUnused(IOATABusInfo, 0); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 1); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 2); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 3); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 4); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 5); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 6); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 7); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 8); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 9); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 10); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 11); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 12); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 13); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 14); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 15); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 16); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 17); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 18); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 19); + OSMetaClassDeclareReservedUnused(IOATABusInfo, 20); +}; + + +#endif /* !_IOATABUSINFO_H */ diff --git a/i386/include/IOKit/ata/IOATACommand.h b/i386/include/IOKit/ata/IOATACommand.h new file mode 100644 index 0000000..773f28a --- /dev/null +++ b/i386/include/IOKit/ata/IOATACommand.h @@ -0,0 +1,478 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOATACommand.h + * + */ + +#ifndef _IOATACOMMAND_H +#define _IOATACOMMAND_H + +#include +#include +#include +#include +#include "IOATATypes.h" + + +class IOExtendedLBA; +class IOATACommand; + + +/*! @typedef IOATACompletionFunction callback function for ATA disk devices. +*/ +typedef void (IOATACompletionFunction)(IOATACommand* command ); + + +/*! +@class IOATACommand + +@discussion +Command structure superclass, created and freed only by IOATADevice objects +populated by disk device drivers with command parameters +then submitted for operation to their IOATADevice provider for execution. + +IOATACommand is a virtual class, a concrete subclass contains the methods and fields needed +by IOATAControllers. Subclasses may be specific to particular controller hardware. +Disk device drivers will only have visibility to this interface and may not subclass this object. +Disk device drivers should instead make use of the void* refcon field which the controllers will not +touch +*/ + +class IOATACommand : public IOCommand { + + OSDeclareAbstractStructors( IOATACommand ); + + public: + + /*!@function zeroCommand + @abstract set to blank state, MUST call prior to re-use of this object + */ + virtual void zeroCommand(void); + + /*!@function setOpcode + @abstract command opcode as defined in IOATATypes. + */ + virtual void setOpcode( ataOpcode inCode); + + /*!@function setFlags + @abstract set the flags for this command, as defined in IOATATypes. + */ + virtual void setFlags( UInt32 inFlags); + + /*!@function setUnit + @abstract set the unit number for this command. + */ + virtual void setUnit( ataUnitID inUnit); + + /*!@function setTimeoutMS + @abstract how long to allow this command to complete, in milliseconds, once issued to + the hardware. if the time period expires, this command will return with a timeout error. + */ + virtual void setTimeoutMS( UInt32 inMs); + + /*!@function setCallbackPtr + @abstract set the function pointer to call when this command completes. + */ + virtual void setCallbackPtr (IOATACompletionFunction* inCompletion); + + /*!@function setRegMask + @abstract used when accessing registers or reading registers on an error result. Mask is defined + in IOATATypes.h + */ + virtual void setRegMask( ataRegMask mask); + + // memory information + // Since ATA hardware is limited in the amount of bytes + // that can be transfered in a command, the disk driver shall supply + // a seperate offset and byte count per transfer. + // the offset may be any amount. The byte count must be a multiple of the + // sector size of the device, ie, N * 512 bytes for ata hard drives. + /*!@function setBuffer + @abstract set the IIOMemoryDescriptor for this transaction. + */ + virtual void setBuffer ( IOMemoryDescriptor* inDesc); + + /*!@function setPosition + @abstract used to set an offset into the memory descriptor for this transfer. + */ + virtual void setPosition (IOByteCount fromPosition); + + /*!@function setByteCount + @abstract set the byte count for this transaction. Should agree with the device command and the + memory descriptor in use. + */ + virtual void setByteCount (IOByteCount numBytes); + + /*!@function setTransferChunkSize + @abstract set the size of transfer between intervening interrupts. necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers. + */ + virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize); + + /*!@function setFeatures + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setFeatures( UInt8 in); + + /*!@function getErrorReg + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getErrorReg (void ); + + /*!@function setSectorCount + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorCount( UInt8 in); + + /*!@function getSectorCount + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getSectorCount (void ); + + /*!@function setSectorNumber + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorNumber( UInt8 in); + + /*!@function getSectorNumber + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getSectorNumber (void ); + + /*!@function setCylLo + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCylLo ( UInt8 in); + + /*!@function getCylLo + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCylLo (void ); + + /*!@function setCylHi + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCylHi( UInt8 in); + + /*!@function getCylHi + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCylHi (void ); + + /*!@function setDevice_Head + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setDevice_Head( UInt8 in); + + /*!@function getDevice_Head + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getDevice_Head (void ); + + /*!@function setCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCommand ( UInt8 in); + + /*!@function getStatus + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getStatus (void ); + + /*!@function setLBA28 + @abstract convenience method that sets the taskfile registers into a 28-bit LBA address, with unit selected and LBA bit set. return err if param out of range, return kIOSuccess (kATANoErr) = 0 on return if successful + */ + virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit); + + /*!@function setPacketCommand + @abstract ATAPI command packet max size is 16 bytes. Makes deep copy of data. + */ + virtual IOReturn setPacketCommand( UInt16 packetSizeBytes, UInt8* command); + + // the following registers are only accessed by register access + // commands. Not by normal command dispatch where they are handled + // by the controller. + + // not part of task file params. not written to device when sending commands. + virtual void setDataReg ( UInt16 in); + virtual UInt16 getDataReg (void ); + + // not part of taskfile. Not usually used except by controller. + virtual void setControl ( UInt8 in); + virtual UInt8 getAltStatus (void ); + + // return values + /*!@function getResult + @abstract IOReturn value of the result of this command. ATA family errors are defined in IOATATypes.h + */ + virtual IOReturn getResult (void); + + /*!@function getBuffer + @abstract the IOMemoryDescriptor used in this transaction. + */ + virtual IOMemoryDescriptor* getBuffer ( void ); + + /*!@function getActualTransfer + @abstract The byte count on the ending result, as best as can be determined by the controller. May be zero, but partial transfer may have occurred on error in some cases. + */ + virtual IOByteCount getActualTransfer ( void ); + + /*!@function getEndStatusReg + @abstract the value of the status register on the end of the command. + */ + virtual UInt8 getEndStatusReg (void); // always returned + + /*!@function getEndErrorReg + @abstract If the error bit was set in the status register, the value of the error register is returned at the end of a command. + */ + virtual UInt8 getEndErrorReg( void ); + + /*!@function getCommandInUse + @abstract returns true if IOATAController is still in control of the command. + */ + virtual bool getCommandInUse( void ); // returns true if IOATAController is using the command. + + // for use by disk drivers, clients of IOATADevice only. + // IOATADevice and IOATAControllers shall not use this field in any manner + /*!@var refCon + @abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner. + */ + void* refCon; + + /*!@var refCon2 + @abstract for use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner. + */ + void* refCon2; + + protected: + // < return from ATA controllers to disk drivers + // > sent to ATA controllers from disk drivers + ataOpcode _opCode; // > Command code for the controller. + UInt32 _flags; // > Flags for this command + ataRegisterImage _taskFile; // <> Taskfile + data and control registers. + ATAPICmdPacket _packet; // > ATAPI packet + ataUnitID _unit; // > Unit number + UInt32 _timeoutMS; // > timeout command in ms. + IOMemoryDescriptor* _desc; // > Buffer for data may be nil if command transfer no data + IOByteCount _position; // > Position within the descriptor for this command + IOByteCount _byteCount; // > How many bytes to transfer. + IOByteCount _logicalChunkSize; // > How many bytes between intervening interrupts (R/W Multiple) + ataRegMask _regMask; // > Which registers to write or read for reg access commands + IOATACompletionFunction* _callback; // > if nil, command is synchronous + + IOReturn _result; // < result + IOByteCount _actualByteCount; // < actual bytes transfered. + UInt8 _status; // < Status register at end of command + UInt8 _errReg; // < Error register at end of command if error bit set. + bool _inUse; // < true while IOATAController has possesion of the command + + + virtual bool init(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData {IOExtendedLBA* extLBA; }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *fExpansionData; + + // overrides + virtual void free(); + + +private: + OSMetaClassDeclareReservedUsed(IOATACommand, 0); // set end result + OSMetaClassDeclareReservedUsed(IOATACommand, 1); // get extendedLBAPtr + OSMetaClassDeclareReservedUnused(IOATACommand, 2); + OSMetaClassDeclareReservedUnused(IOATACommand, 3); + OSMetaClassDeclareReservedUnused(IOATACommand, 4); + OSMetaClassDeclareReservedUnused(IOATACommand, 5); + OSMetaClassDeclareReservedUnused(IOATACommand, 6); + OSMetaClassDeclareReservedUnused(IOATACommand, 7); + OSMetaClassDeclareReservedUnused(IOATACommand, 8); + OSMetaClassDeclareReservedUnused(IOATACommand, 9); + OSMetaClassDeclareReservedUnused(IOATACommand, 10); + OSMetaClassDeclareReservedUnused(IOATACommand, 11); + OSMetaClassDeclareReservedUnused(IOATACommand, 12); + OSMetaClassDeclareReservedUnused(IOATACommand, 13); + OSMetaClassDeclareReservedUnused(IOATACommand, 14); + OSMetaClassDeclareReservedUnused(IOATACommand, 15); + OSMetaClassDeclareReservedUnused(IOATACommand, 16); + OSMetaClassDeclareReservedUnused(IOATACommand, 17); + OSMetaClassDeclareReservedUnused(IOATACommand, 18); + OSMetaClassDeclareReservedUnused(IOATACommand, 19); + OSMetaClassDeclareReservedUnused(IOATACommand, 20); + +public: + virtual void setEndResult(UInt8 inStatus, UInt8 endError ); + virtual IOExtendedLBA* getExtendedLBA(void); + + +}; + + +/*! +@class IOExtendedLBA + +@discussion +If 48-bit LBAs are supported, IOExtendedLBA is used to represent a 48-bit LBA. +The driver examines the ATA identify data to determine if 48-bit addressing is +supported. +*/ + +class IOExtendedLBA : public OSObject +{ + OSDeclareDefaultStructors( IOExtendedLBA ); + + public: + static IOExtendedLBA* createIOExtendedLBA(IOATACommand* owner); + + // terminology as established in ATA/ATAPI-6. + // for the extended LBA address + + /*!@function setLBALow16 + @abstract convenience method that sets the lower 16 bits of a 48-bit LBA + */ + virtual void setLBALow16( UInt16 lbaLow); + + /*!@function getLBALow16 + @abstract convenience method that gets the lower 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBALow16 (void); + + /*!@function setLBAMid16 + @abstract convenience method that sets the middle 16 bits of a 48-bit LBA + */ + virtual void setLBAMid16 (UInt16 lbaMid); + + /*!@function getLBAMid16 + @abstract convenience method that gets the middle 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBAMid16( void ); + + /*!@function setLBAHigh16 + @abstract convenience method that sets the high 16 bits of a 48-bit LBA + */ + virtual void setLBAHigh16( UInt16 lbaHigh ); + + /*!@function getLBAHigh16 + @abstract convenience method that gets the high 16 bits of a 48-bit LBA + */ + virtual UInt16 getLBAHigh16( void ); + + /*!@function setSectorCount16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setSectorCount16( UInt16 sectorCount ); + + /*!@function getSectorCount16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt16 getSectorCount16( void ); + + /*!@function setFeatures16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setFeatures16( UInt16 features ); + + /*!@function getFeatures16 + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt16 getFeatures16( void ); + + /*!@function setDevice + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setDevice( UInt8 inDevice ); + + /*!@function getDevice + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getDevice( void ); + + /*!@function setCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual void setCommand( UInt8 inCommand ); + + /*!@function getCommand + @abstract Taskfile access. Registers are named in accordance with ATA Standards conventions + */ + virtual UInt8 getCommand( void ); + + /*!@function setExtendedLBA + @abstract convenience method that sets the taskfile registers into a 48-bit LBA address, along with sector count, and unit selected and LBA bit set + */ + virtual void setExtendedLBA( UInt32 inLBAHi, UInt32 inLBALo, ataUnitID inUnit, UInt16 extendedCount, UInt8 extendedCommand); + + /*!@function getExtendedLBA + @abstract convenience method that gets a 48-bit LBA + */ + virtual void getExtendedLBA( UInt32* outLBAHi, UInt32* outLBALo ); + + /*!@function zeroData + @abstract convenience method that zeros out the lba, sector count, features, device, and command member variables + */ + virtual void zeroData(void); + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + + protected: + + IOATACommand* owner; + UInt16 lbaLow; + UInt16 lbaMid; + UInt16 lbaHigh; + UInt16 sectorCount; + UInt16 features; + UInt16 device; + UInt16 command; + + private: + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 0); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 1); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 2); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 3); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 4); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 5); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 6); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 7); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 8); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 9); + OSMetaClassDeclareReservedUnused(IOExtendedLBA, 10); + + +}; + +#endif diff --git a/i386/include/IOKit/ata/IOATAController.h b/i386/include/IOKit/ata/IOATAController.h new file mode 100644 index 0000000..3758941 --- /dev/null +++ b/i386/include/IOKit/ata/IOATAController.h @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATACONTROLLER_H +#define _IOATACONTROLLER_H + +#include +#include +#include +#include +#include +#include "ATATimerEventSource.h" + +class IOATADevice; +class IOATABusCommand; +class IOATABusInfo; +class IOATADevConfig; + +/*! @class IOATAController + @abstract The base class for ata controller family. Provides the interface common to all ata bus controllers. + @discussion Subclasses of IOATAController implement drivers for specific bus hardware. Disk devices are clients of + IOATAController and communicate via the IOATABusNub instantiated for each device discovered by the specific IOATAController + subclass when it probes hardware. Via the nub, the ATA Controller provides standard information about bus capability, accepts + requests for transfer mode configuration (timing), accepts requests for IO and bus operations, notifies the device driver about + bus events which may affect the device, such as soft-resets or device removal (ie, media-bay and PC-card) and removal of queued + IO requests which have not been dispatched into the hardware. + + @discussion The header doc for this class is incomplete. The source however is heavily commented and should be consulted until + such time as complete header doc is available. +*/ + + + +class IOATAController : public IOService +{ + OSDeclareDefaultStructors(IOATAController); + +public: + + + /*--- Common ATA Controller Interface ---*/ + // find out bus capability + virtual IOReturn provideBusInfo( IOATABusInfo* infoOut); + + // set and get bus timing configuration for a specific unit + virtual IOReturn selectConfig( IOATADevConfig* configRequest, UInt32 unitNumber); + virtual IOReturn getConfig( IOATADevConfig* configRequest, UInt32 unitNumber); + + // The main call puts something on the work loop + virtual IOReturn executeCommand( IOATADevice* nub, IOATABusCommand* cmd); + + + + /*-- Power Management ---*/ + + // TBD + + + /*--- Overrides from IOService ---*/ + virtual bool init(OSDictionary * properties); + + virtual IOService* probe( IOService* provider, SInt32* score ); + virtual bool start( IOService* provider ); + + +protected: + + enum { + kBusFree = 'free', // bus is available + kBusBusy = 'busy', // bus is busy with request + kQueueOpen = '!lck', // queue is not locked + kQueueLocked = 'LOCK', // queue is frozen and not + kImmediateLocked = '!Imd', // immediate commands may not be processed + kImmediateOK = 'Immd' // immediate commands allowed. + }; + + /* Transaction State indicator definition - indicates what action is next*/ + enum transState { + kATAInitial = 0x00, // in queue + kATAStarted = 0x01, // issue taskfile + kATAPICmd = 0x02, // issue packet + kATADataTx = 0x03, // data transfer phase + kATAStatus = 0x04, // read status + kATAComplete = 0x05, // io complete + kATADone = 0x06 // completion callout called + }; + + struct ataDevInfo { + ataDeviceType type; // ata, atapi, unknown + atapiConfig packetSend; // slow DRQ, IRQ, or fast DRQ for packet + }; + + + struct ataDoubleBuffer + { + IOPhysicalAddress physicalBuffer; + IOLogicalAddress logicalBuffer; + IOByteCount bufferSize; + + }; + + + IOService* _provider; + IOWorkLoop* _workLoop; + IOCommandGate* _cmdGate; + ATATimerEventSource* _timer; + queue_head_t _commandQueue; + IOATABusCommand* _currentCommand; + UInt32 _busState; + UInt32 _queueState; + UInt32 _immediateGate; + ataUnitID _selectedUnit; + ataDevInfo _devInfo[2]; + IOATADevice* _nub[2]; + ataDoubleBuffer _doubleBuffer; + + IOATARegPtr8 _tfFeatureReg; + IOATARegPtr8 _tfSCountReg; + IOATARegPtr8 _tfSectorNReg; + IOATARegPtr8 _tfCylLoReg; + IOATARegPtr8 _tfCylHiReg; + IOATARegPtr8 _tfSDHReg; + IOATARegPtr8 _tfStatusCmdReg; + IOATARegPtr16 _tfDataReg; + IOATARegPtr8 _tfAltSDevCReg; + + + // false if couldn't allocate the per-bus double buffer. + // controllers should provide implementation where needed + // for DMA hardware compatibility. The default method provides + // a 4K buffer for PIO since MemoryDescriptors do not by default have + // logical addresses in the kernel space. + virtual bool allocateDoubleBuffer( void ); + + // perform 2-byte endian swap. Only useful on PIO transfers and identify data + virtual void swapBytes16( UInt8* dataBuffer, IOByteCount length); + +/*! @function handleCommand + @abstract Called by executeCommand() to handle the client command + from the workloop context. + @param command The command code. + @param param1 Command parameter. + @param param2 Command parameter. + @param param3 Command parameter. + @result kIOReturnSuccess on success, or an error code otherwise. */ + + virtual IOReturn handleCommand( void * command, + void * param1 = 0, + void * param2 = 0, + void * param3 = 0); + + +/*! @function busCanDispatch + @abstract answers whether the bus is in state such that the next command + can be dispatched. + @result true - bus is free to issue commands. false - bus cannot issue + commands at this time. */ + virtual bool busCanDispatch( void ); + + +/*! @function dispatchNext + @abstract Causes the command at the front of the queue to dequeue, made the + current command and begin execution. + @result noErr indicates successful dispatch. */ + virtual IOReturn dispatchNext( void ); + + // sets the result code, free's the bus state, dispatch next command and execute completion + virtual void completeIO( IOReturn commandResult ); + + // Command queue handlers. + virtual IOReturn enqueueCommand( IOATABusCommand* command); + virtual IOATABusCommand* dequeueFirstCommand( void ); + + // event notifier for clients + virtual void executeEventCallouts( ataEventCode event, ataUnitID unit); + + // default handler for device interrupts. + virtual IOReturn handleDeviceInterrupt( void ); + + + // timer functions + // starts the timeout on the current command + virtual IOReturn startTimer( UInt32 inMS); + //disable and clear a running timer. + virtual void stopTimer( void ); + // called when a timeout occurs. + virtual void handleTimeout( void ); + // true if the timer has expired + virtual bool checkTimeout( void ); + + // handle IO opcodes + virtual IOReturn handleExecIO( void ); + virtual IOReturn handleRegAccess( void ); + virtual IOReturn handleBusReset(void); + virtual IOReturn handleQueueFlush( void ); + + // various protocol phases + virtual IOReturn asyncData(void); + virtual IOReturn asyncStatus(void); + virtual IOReturn asyncIO(void); + virtual IOReturn asyncCommand(void); + virtual IOReturn synchronousIO(void); + + // hardware access + virtual IOReturn selectDevice( ataUnitID unit ); + virtual IOReturn issueCommand( void ); + virtual IOReturn writePacket( void ); + virtual IOReturn softResetBus( bool doATAPI = false ); + + virtual IOReturn startDMA( void ); + virtual IOReturn stopDMA( void ); + + virtual bool ATAPISlaveExists( void ); + virtual UInt32 scanForDrives( void ); + + virtual bool waitForU8Status (UInt8 mask, UInt8 value); + + virtual IOByteCount readATAPIByteCount( void ); + virtual void handleOverrun( IOByteCount length); + virtual IOReturn registerAccess(bool isWrite); + + // PIO data transfers + virtual IOReturn txDataIn (IOLogicalAddress buf, IOByteCount length); + virtual IOReturn txDataOut (IOLogicalAddress buf, IOByteCount length); + + virtual IOATAController::transState determineATAPIState(void); + + // device should set the controller to the config for this device + virtual void selectIOTiming( ataUnitID unit ); + + // subclasses MUST implement this function in order to initialize + // the pointers to the ATA task file registers during start() time. + virtual bool configureTFPointers(void); + + // convert a bit-significant indicator to a numeric value. + virtual UInt16 bitSigToNumeric( UInt16 binary); + + // for 48 bit register reading and writing + UInt16 readExtRegister( IOATARegPtr8 inRegister ); + void writeExtRegister( IOATARegPtr8 inRegister, UInt16 inValue ); + + // overrides + virtual void free(); + +private: + + // used called by the commandgate in executeCommand. + static void executeCommandAction(OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3); + + // callout used by the timer to indicate the timeout failure. + static void timeoutOccured( OSObject *owner, + IOTimerEventSource *sender); + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOATAController in the future. + */ + typedef struct ExpansionData + { + IOBufferMemoryDescriptor* _doubleBufferDesc; + } ExpansionData; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATAController, 0); + OSMetaClassDeclareReservedUnused(IOATAController, 1); + OSMetaClassDeclareReservedUnused(IOATAController, 2); + OSMetaClassDeclareReservedUnused(IOATAController, 3); + OSMetaClassDeclareReservedUnused(IOATAController, 4); + OSMetaClassDeclareReservedUnused(IOATAController, 5); + OSMetaClassDeclareReservedUnused(IOATAController, 6); + OSMetaClassDeclareReservedUnused(IOATAController, 7); + OSMetaClassDeclareReservedUnused(IOATAController, 8); + OSMetaClassDeclareReservedUnused(IOATAController, 9); + OSMetaClassDeclareReservedUnused(IOATAController, 10); + OSMetaClassDeclareReservedUnused(IOATAController, 11); + OSMetaClassDeclareReservedUnused(IOATAController, 12); + OSMetaClassDeclareReservedUnused(IOATAController, 13); + OSMetaClassDeclareReservedUnused(IOATAController, 14); + OSMetaClassDeclareReservedUnused(IOATAController, 15); + OSMetaClassDeclareReservedUnused(IOATAController, 16); + OSMetaClassDeclareReservedUnused(IOATAController, 17); + OSMetaClassDeclareReservedUnused(IOATAController, 18); + OSMetaClassDeclareReservedUnused(IOATAController, 19); + OSMetaClassDeclareReservedUnused(IOATAController, 20); +}; +#endif /* !_IOATACONTROLLER_H */ diff --git a/i386/include/IOKit/ata/IOATADevConfig.h b/i386/include/IOKit/ata/IOATADevConfig.h new file mode 100644 index 0000000..e5714c3 --- /dev/null +++ b/i386/include/IOKit/ata/IOATADevConfig.h @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATADEVCONFIG_H +#define _IOATADEVCONFIG_H + +#include +#include +#include "IOATATypes.h" +#include "IOATABusInfo.h" + + +/*! + @class IOATADevConfig + @abstract used for configuring and communicating the desired transfer modes of a device. + A disk driver would typically use this object in conjunction with the 512-bytes of identification + data from the drive and the IOATABusInfo object for the bus it is connected to. + This object will determine the best matching transfer speeds available. + the device driver will then send a series of Set Features commands to configure the drive + and this object to the bus through the IOATADevice nub in order to configure the optimum transfer mode. + The driver for the disk drive may choose to populate this object with whatever transfer mode + desired, in the event that a different mode is required. + @discussion usually use the initWithBestSelection to make a best mode match. + The Mode accessors use bit significance to indicate a selected mode or supported modes(s) + ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. + Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. + ie, a bus will support multiple possible modes, but will only have one mode selected at that time. + +*/ + +class IOATADevConfig : public OSObject { + + OSDeclareDefaultStructors( IOATADevConfig ); + + public: + + /*!@function atadevconfig + @abstract static creator function. + */ + static IOATADevConfig* atadevconfig(void); + + /*!@function initWithBestSelection + @abstract Handy initializer: pass the 512-byte result of the Identify Device or + Identify Packet Device in endian-order for your platform (byte-swapped on PPC) + and the IOATABusInfo object for the bus. The object will initialize all fields + and select the best transfer modes that match on bus and device. + If the return value was 0 (success or noErr), then a matching mode is supported. + Examine the PIO and UDMA/DMA fields and to generate the apropriate SET FEATURES + parameters for your drive and send this initialised object to the IOATAController + when requesting a speed configuration. + failure means no supported transfer modes matched between bus and device info. + + @param identifyData 512 bytes of data obtained from the device via IDENTIFY DEVICE or IDENTIFY PACKET DEVICE command. + @param busInfo pointer to an IOATAbusInfo object obtained from a previous atanub->provideBusInfo() call. + @result kIOSuccess (0) when a matching transfer mode is available between the device and controller. + */ + IOReturn initWithBestSelection( const UInt16* identifyData, IOATABusInfo* busInfo); + + // intitialize with the 512 byte data from an ATA device identify command + IOReturn assignFromData( const UInt16* identifyData ); + + /*!@function setPacketConfig + @param packetConfig + @abstract For ATAPI devices, if the device asserts interrupt after the Packet Command when it is ready to accept the packet, set this value to true (mostly older devices). If the device accepts the packet only by asserting DRQ bit in status, then set this value false. Tells the bus controller whether to wait for packet acceptance or set pending interrupt. + */ + void setPacketConfig ( atapiConfig packetConfig); + + /*!@function getPacketConfig + @result atapiConfig as defined in IOATATypes.h + */ + atapiConfig getPacketConfig( void ); + + // The following Mode accessors use bit significance to indicate a selected mode or supported modes(s) + // ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. + // Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. + // ie, a bus will support multiple possible modes, but will only have one mode selected at that time. + + /*!@function setPIOMode + @param inModeBitMap bit-significant map of PIO mode + */ + void setPIOMode( UInt8 inModeBitMap); // bit-significant map of PIO mode(s) + + /*!@function getPIOMode + @result bit-significant map of PIO mode + */ + UInt8 getPIOMode( void ); + + /*!@function setDMAMode + @param inModeBitMap bit-significant map of DMA mode + */ + void setDMAMode( UInt8 inModeBitMap ); // bit-significant map of DMA mode(s) + + /*!@function getDMAMode + @result bit-significant map of DMA mode + */ + UInt8 getDMAMode( void ); + + /*!@function setUltraMode + @param inModeBitMap bit-significant map of Ultra mode + */ + void setUltraMode( UInt8 inModeBitMap ); // bit-significant map of Ultra mode(s) + + /*!@function getUltraMode + @result bit-significant map of Ultra mode + */ + UInt8 getUltraMode( void ); + + // The following cycle time accessors report cycle times in nanoseconds. + // A device requesting a mode should also request a cycle time as reported in the device's identification page. + // A bus controller will configure the bus not to exceed (go faster than) the minimum time requested. + // When a bus controller reports a mode configuration, the cycle time indicates the busses contract not to go + // faster than. However an actual cycle time may be slower than the indicated time. + /*!@function setPIOCycleTime + @param inNS PIO cycle time in nanoseconds. + */ + void setPIOCycleTime( UInt16 inNS ); + + /*!@function getPIOCycleTime + @result reported PIO CycleTime in nanoseconds. + */ + UInt16 getPIOCycleTime( void ); + + /*!@function setDMACycleTime + @param inNS reported multiword DMA Cycle time in nanoseconds. + */ + void setDMACycleTime( UInt16 inNS ); + + /*!@function getDMACycleTime + @result Reported multiword DMA cycle time in nanoseconds. + */ + UInt16 getDMACycleTime( void ); + + // Ultra ATA defines cycle times a device must meet to comply with standards. + // No cycle time field is needed. + + // convert bit-significant to numeric value + /*!@function bitSigToNumeric + @abstract converts a bit-significant field to a numerical value. Note that a bit field of 0x00 has no defined result. + @param binary the bit significant field. + @result the numerical value of the highest bit set in the field. + */ + virtual UInt8 bitSigToNumeric( UInt16 binary); + + + protected: + + atapiConfig _atapiIRQForPacket; // enum for bits 5 and 6 of word zero of + // the identify packet device info data for PACKET devices ONLY. + // shift word-0 5-bits left, mask 0x03 and these enums apply. + // values are: + + // kATAPIDRQSlow = 0x00 - wait up to 3MS for packet on DRQ + // kATAPIIRQPacket = 0x01, - device asserts IRQ for packet + // kATAPIDRQFast = 0x10, - packet on DRQ within 50us + // kATAPIUnknown = 0x11 - reserved as of ATA/ATAPI-5 + + + + + UInt8 _ataPIOMode; /* <->: PIO Mode Timing class bit-significant */ + UInt16 _ataPIOCycleTime; /* <->: Cycle time in ns for PIO mode */ + UInt8 _ataMultiDMAMode; /* <->: Multiple Word DMA Timing Class bit-significant*/ + UInt16 _ataMultiCycleTime; /* <->: Cycle time in ns for Multiword DMA mode */ + UInt8 _ataUltraDMAMode; /* <->: Ultra DMA timing class bit-significant */ + + IOReturn _AssignPIOData( const UInt16* identifyData); + IOReturn _AssignDMAData(const UInt16* identifyData); + IOReturn _AssignUltraData(const UInt16* identifyData); + UInt8 _MostSignificantBit( UInt8 inByte); + + + virtual bool init(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATADevConfig, 0); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 1); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 2); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 3); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 4); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 5); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 6); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 7); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 8); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 9); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 10); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 11); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 12); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 13); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 14); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 15); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 16); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 17); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 18); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 19); + OSMetaClassDeclareReservedUnused(IOATADevConfig, 20); + +public: + +//some static utility functions to parse the identify data for feature support + + static bool sDriveSupports48BitLBA( const UInt16* identifyData ); + static UInt32 sDriveExtendedLBASize( UInt32* lbaHi, UInt32* lbaLo, const UInt16* identifyData); // result returned is same as lbaLo. + +}; + + +// header doc info goes here. I find putting it within the delcarations more confusing than putting it all in the bottom of the header. + + +#endif /* !_IOATADEVCONFIG_H */ diff --git a/i386/include/IOKit/ata/IOATADevice.h b/i386/include/IOKit/ata/IOATADevice.h new file mode 100644 index 0000000..78be513 --- /dev/null +++ b/i386/include/IOKit/ata/IOATADevice.h @@ -0,0 +1,179 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOATADevice.h + * + * This object implements a relay to an ATA Bus where a drive is attached. + */ + + +#ifndef _IOATADEVICE_H +#define _IOATADEVICE_H + +#include +#include +#include "IOATATypes.h" +#include "IOATACommand.h" +#include "IOATABusInfo.h" +#include "IOATADevConfig.h" + +class IOATAController; + + +/*! + @class IOATADevice + @abstract This object implements a relay to an ATA Bus where a drive is attached. + @discussion IOATADevice is the superclass which represents a particular device attached to a particular IOATAController (bus). IOATADevice is the provider for ATA mass-storage device drivers.IOATADevice is the factory for all IOATACommand objects and is responsible for creating and freeing IOATACommands. IOATAControllers will create an instance of IOATADevice for each device physically connected to the ata bus. IOATADevice is virtual and specific subclass should be implemented for particular types of IOATAController. In this manner, controller-specifc IOATACommands may be paired with the proper type of controller. +*/ + +class IOATADevice : public IOService +{ + OSDeclareDefaultStructors(IOATADevice); + +public: + + // + /*!@function getUnitID + @abstract Determine whether this device is number 0 or 1 (ie, master/slave) + @result ataUnitID - 0 or 1. + */ + virtual ataUnitID getUnitID( void ); + + // + /*!@function getDeviceType + @abstract Find out what kind of device this nub is (ata or atapi) + @result ataDeviceType as defined in IOATATypes.h + */ + virtual ataDeviceType getDeviceType( void ); + + // + /*!@function provideBusInfo + @abstract Find out the bus capability so the client can choose the features to set and commands to run. + @param getInfo a pointer to a valid IOATABusInfo object. + @result kIOSuccess (0) and the getInfo object will be filled out by the bus controller with information about the bus. + */ + virtual IOReturn provideBusInfo( IOATABusInfo* getInfo); + + // + /*!@function selectConfig + @abstract Tell the bus what speed to use for your device. + @param configRequest pointer to a valid and initialized IOATADevConfig object. + @result kIOSuccess (0) if the configuration was succesfully selected. + @discussion This should only be called once during a disk drivers start method before registering its availability, and must be called prior to issuing any data IO transactions. + */ + virtual IOReturn selectConfig( IOATADevConfig* configRequest); + + // + /*!@function provideConfig + @abstract Find out what speed the bus has configured for this unit. + @param configRequest pointer to a valid IOATADevConfig object. + @result kIOSuccess (0) on successful completion and configRequest will contain the configuration information. + */ + virtual IOReturn provideConfig( IOATADevConfig* configRequest); + + // Submit IO requests + /*! + @function executeCommand + @abstract Submit IO requests + @param command pointer to a valid IOATACommand with the command to be executed. + @result kIOSuccess (0) if the command was successfully queued in the controller. + */ + virtual IOReturn executeCommand(IOATACommand* command); + + // create and destroy IOATACommands + /*! + @function allocCommand + @abstract create IOATACommands. Device drivers should allocate command objects only through this method. + @result null if allocation failed. Retain count is one. + */ + virtual IOATACommand* allocCommand( void ); + + /*! + @function freeCommand + @abstract release a command object that is no longer needed. Do not free an object in use and do not release the object anymore times than you have retained it. + @param inCommand the command to be released. + */ + virtual void freeCommand( IOATACommand* inCommand); + + // matching stuff for IOBSDInit and so on. + /*!@function matchPropertyTable + @abstract matching stuff for IOBSDInit and so on. + */ + virtual bool matchPropertyTable(OSDictionary * table); + + /*!@function matchLocation + @abstract matching stuff for IOBSDInit and so on. + */ + virtual IOService* matchLocation(IOService * client); + + /*!@function matchPropertyTable + @abstract matching stuff for IOBSDInit and so on. + */ + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + // called by controllers when they need to send a message to client drivers. + /*! + @function notifyEvent + @abstract called by controllers when they need to send a message to client (disk) drivers. + */ + virtual void notifyEvent( UInt32 event ); + + +protected: + IOATAController* _provider; + ataUnitID _unitNumber; // 0 - master, 1 - slave, -1 = not Valid + ataDeviceType _deviceType; // ata, atapi, unknown +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOATADevice, 0); + OSMetaClassDeclareReservedUnused(IOATADevice, 1); + OSMetaClassDeclareReservedUnused(IOATADevice, 2); + OSMetaClassDeclareReservedUnused(IOATADevice, 3); + OSMetaClassDeclareReservedUnused(IOATADevice, 4); + OSMetaClassDeclareReservedUnused(IOATADevice, 5); + OSMetaClassDeclareReservedUnused(IOATADevice, 6); + OSMetaClassDeclareReservedUnused(IOATADevice, 7); + OSMetaClassDeclareReservedUnused(IOATADevice, 8); + OSMetaClassDeclareReservedUnused(IOATADevice, 9); + OSMetaClassDeclareReservedUnused(IOATADevice, 10); + OSMetaClassDeclareReservedUnused(IOATADevice, 11); + OSMetaClassDeclareReservedUnused(IOATADevice, 12); + OSMetaClassDeclareReservedUnused(IOATADevice, 13); + OSMetaClassDeclareReservedUnused(IOATADevice, 14); + OSMetaClassDeclareReservedUnused(IOATADevice, 15); + OSMetaClassDeclareReservedUnused(IOATADevice, 16); + OSMetaClassDeclareReservedUnused(IOATADevice, 17); + OSMetaClassDeclareReservedUnused(IOATADevice, 18); + OSMetaClassDeclareReservedUnused(IOATADevice, 19); + OSMetaClassDeclareReservedUnused(IOATADevice, 20); +}; + +#endif /* !_IOATABUSNUB_H */ diff --git a/i386/include/IOKit/ata/IOATARegI386.h b/i386/include/IOKit/ata/IOATARegI386.h new file mode 100644 index 0000000..73016ba --- /dev/null +++ b/i386/include/IOKit/ata/IOATARegI386.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOATAREGI386_H +#define _IOATAREGI386_H + +#include + +/* + * IOATAReg: ATA register abstract base class. + */ +#define DefineIOATAReg(w) \ +class IOATAReg##w : public OSObject \ +{ \ + OSDeclareAbstractStructors( IOATAReg##w ) \ + \ +public: \ + virtual void operator = (UInt##w rhs) = 0; \ + virtual operator UInt##w() const = 0; \ +} + +DefineIOATAReg( 8 ); +DefineIOATAReg( 16 ); +DefineIOATAReg( 32 ); + +typedef IOATAReg8 * IOATARegPtr8; +typedef IOATAReg16 * IOATARegPtr16; +typedef IOATAReg32 * IOATARegPtr32; + +#define IOATARegPtr8Cast(x) (x) + +/* + * IOATAIOReg: I/O mapped ATA registers. + */ +#define DefineIOATAIOReg(w) \ +class IOATAIOReg##w : public IOATAReg##w \ +{ \ + OSDeclareDefaultStructors( IOATAIOReg##w ) \ + \ +protected: \ + UInt16 _address; \ + \ +public: \ + static IOATAIOReg##w * withAddress( UInt16 address ); \ + \ + virtual bool initWithAddress( UInt16 address ); \ + virtual UInt16 getAddress() const; \ + \ + virtual void operator = (UInt##w rhs); \ + virtual operator UInt##w() const; \ +} + +DefineIOATAIOReg( 8 ); +DefineIOATAIOReg( 16 ); +DefineIOATAIOReg( 32 ); + +#endif /* !_IOATAREGI386_H */ diff --git a/i386/include/IOKit/ata/IOATATypes.h b/i386/include/IOKit/ata/IOATATypes.h new file mode 100644 index 0000000..a3be9dc --- /dev/null +++ b/i386/include/IOKit/ata/IOATATypes.h @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOATATYPES_H +#define _IOATATYPES_H + +#include + + +/*! + +@header IOATAtypes.h +@discussion contains various definitions and constants for use in the IOATAFamily and clients. Header Doc is incomplete at this point, but file is heavily commented. + +*/ +// property strings +#define kATADevPropertyKey "ata device type" +#define kATATypeATAString "ata" +#define kATATypeATAPIString "atapi" +#define kATATypeUnknownString "unknown" + +#define kATAVendorPropertyKey "device model" +#define kATARevisionPropertyKey "device revision" +#define kATASerialNumPropertyKey "device serial" + +#define kATAUnitNumberKey "unit number" + +#define kATASocketKey "socket type" +#define kATAInternalSocketString "internal" +#define kATAMediaBaySocketString "media-bay" +#define kATAPCCardSocketString "pccard" +#define kATAInternalSATAString "serial-ata" +#define kATASATABayString "sata-bay" +#define kATAInternalSATA2 "serial-ata-2" +#define kATASATA2BayString "sata-2-bay" +#define kATAUnkownSocketString "unknown" + +#define kATANotifyOnChangeKey "media-notify" + +// allows for porting to non-memory-mapped IO systems, such as x86. +// for such a platform, create a class and overload the assignment operators +// so that the correct IO operation is performed and define the type for that architecture port. +#ifdef __ppc__ +#define IOATARegPtr8 volatile UInt8* +#define IOATARegPtr16 volatile UInt16* +#define IOATARegPtr32 volatile UInt32* +#define IOATARegPtr8Cast(x) ((IOATARegPtr8)(x)) +#elif defined( __i386__ ) || defined( __x86_64__ ) +#include +#else +#error Unknown machine architecture +#endif + +enum ataSocketType{ + + kUnknownSocket = 0, + kInternalATASocket, + kMediaBaySocket , + kPCCardSocket, + kInternalSATA, + kSATABay, + kInternalSATA2, + kSATA2Bay + +} ; + + +enum ataDeviceType { + + kUnknownATADeviceType = 0, + kATADeviceType, + kATAPIDeviceType + +} ; + +// enum for bits 5 and 6 of word zero of +// the identify packet device info data. +// shift word-0 5-bits left, mask 0x03 and these enums apply. +enum atapiConfig { + + kATAPIDRQSlow = 0x00, + kATAPIIRQPacket = 0x01, + kATAPIDRQFast = 0x10, + kATAPIUnknown = 0x11 + +}; + + +enum ataUnitID { + + kATAInvalidDeviceID = -1, + kATADevice0DeviceID = 0, /* aka, Master. Device 0 is the correct terminology */ + kATADevice1DeviceID = 1 /* aka, Slave. Device 1 is the correct terminology */ + +} ; + +enum { + + kATADefaultSectorSize = 512 +}; + +/* Task file definition *** Error Register *** */ +enum { + bATABadBlock = 7, /* bit number of bad block error bit*/ + bATAUncorrectable = 6, /* bit number of uncorrectable error bit*/ + bATAMediaChanged = 5, /* bit number of media changed indicator*/ + bATAIDNotFound = 4, /* bit number of ID not found error bit*/ + bATAMediaChangeReq = 3, /* bit number of media changed request*/ + bATACommandAborted = 2, /* bit number of command abort bit*/ + bATATrack0NotFound = 1, /* bit number of track not found*/ + bATAAddressNotFound = 0, /* bit number of address mark not found*/ + mATABadBlock = 1 << bATABadBlock, /* Bad Block Detected*/ + mATAUncorrectable = 1 << bATAUncorrectable, /* Uncorrectable Data Error*/ + mATAMediaChanged = 1 << bATAMediaChanged, /* Media Changed Indicator (for removable)*/ + mATAIDNotFound = 1 << bATAIDNotFound, /* ID Not Found*/ + mATAMediaChangeReq = 1 << bATAMediaChangeReq, /* Media Change Requested (NOT IMPLEMENTED)*/ + mATACommandAborted = 1 << bATACommandAborted, /* Aborted Command*/ + mATATrack0NotFound = 1 << bATATrack0NotFound, /* Track 0 Not Found*/ + mATAAddressNotFound = 1 << bATAAddressNotFound /* Address Mark Not Found*/ +}; + +/* Task file definition *** Features register *** */ +enum { + bATAPIuseDMA = 0, /* bit number of useDMA bit (ATAPI)*/ + mATAPIuseDMA = 1 << bATAPIuseDMA +}; + +/* Task file definition *** ataTFSDH Register *** */ +enum { + mATAHeadNumber = 0x0F, /* Head Number (bits 0-3) */ + mATASectorSize = 0xA0, /* bit 7=1; bit 5 = 01 (512 sector size) */ + mATADriveSelect = 0x10, /* Drive (0 = master, 1 = slave) */ + mATALBASelect = 0x40 /* LBA mode bit (0 = chs, 1 = LBA)*/ +}; + +/* Task file definition *** Status Register *** */ +enum { + bATABusy = 7, /* bit number of BSY bit*/ + bATADriveReady = 6, /* bit number of drive ready bit*/ + bATAWriteFault = 5, /* bit number of write fault bit*/ + bATASeekComplete = 4, /* bit number of seek complete bit*/ + bATADataRequest = 3, /* bit number of data request bit*/ + bATADataCorrected = 2, /* bit number of data corrected bit*/ + bATAIndex = 1, /* bit number of index mark*/ + bATAError = 0, /* bit number of error bit*/ + mATABusy = 1 << bATABusy, /* Unit is busy*/ + mATADriveReady = 1 << bATADriveReady, /* Unit is ready*/ + mATAWriteFault = 1 << bATAWriteFault, /* Unit has a write fault condition*/ + mATASeekComplete = 1 << bATASeekComplete, /* Unit seek complete*/ + mATADataRequest = 1 << bATADataRequest, /* Unit data request*/ + mATADataCorrected = 1 << bATADataCorrected, /* Data corrected*/ + mATAIndex = 1 << bATAIndex, /* Index mark - NOT USED*/ + mATAError = 1 << bATAError /* Error condition - see error register*/ +}; + +/* Task file definition *** Device Control Register *** */ +enum { + bATADCROne = 3, /* bit number of always one bit*/ + bATADCRReset = 2, /* bit number of reset bit*/ + bATADCRnIntEnable = 1, /* bit number of interrupt disable*/ + mATADCROne = 1 << bATADCROne, /* always one bit*/ + mATADCRReset = 1 << bATADCRReset, /* Reset (1 = reset)*/ + mATADCRnIntEnable = 1 << bATADCRnIntEnable /* Interrupt Disable(0 = enabled)*/ +}; + + +/* 'ataRegMask' field of the ataRegAccess definition*/ +enum ataRegMask{ + + bATAAltSDevCValid = 14, /* bit number of alternate status/device cntrl valid bit*/ + bATAStatusCmdValid = 7, /* bit number of status/command valid bit*/ + bATASDHValid = 6, /* bit number of ataTFSDH valid bit*/ + bATACylinderHiValid = 5, /* bit number of cylinder high valid bit*/ + bATACylinderLoValid = 4, /* bit number of cylinder low valid bit*/ + bATASectorNumValid = 3, /* bit number of sector number valid bit*/ + bATASectorCntValid = 2, /* bit number of sector count valid bit*/ + bATAErrFeaturesValid = 1, /* bit number of error/features valid bit*/ + bATADataValid = 0, /* bit number of data valid bit*/ + mATAAltSDevCValid = 1 << bATAAltSDevCValid, /* alternate status/device control valid*/ + mATAStatusCmdValid = 1 << bATAStatusCmdValid, /* status/command valid*/ + mATASDHValid = 1 << bATASDHValid, /* ataTFSDH valid*/ + mATACylinderHiValid = 1 << bATACylinderHiValid, /* cylinder high valid*/ + mATACylinderLoValid = 1 << bATACylinderLoValid, /* cylinder low valid*/ + mATASectorNumValid = 1 << bATASectorNumValid, /* sector number valid*/ + mATASectorCntValid = 1 << bATASectorCntValid, /* sector count valid*/ + mATAErrFeaturesValid = 1 << bATAErrFeaturesValid, /* error/features valid*/ + mATADataValid = 1 << bATADataValid /* data valid*/ + +} ; + + +enum ataFlags{ + bATAFlagQuiesce = 20, + bATAFlagNoIRQ = 19, /* bit Number of no IRQ protocol flag*/ + bATAFlag48BitLBA = 18, + bATAFlagDMAQueued = 17, + bATAFlagOverlapped = 16, + bATAFlagUseConfigSpeed = 15, /* bit number of use configured speed flag*/ + bATAFlagByteSwap = 14, /* bit number of byte swap flag*/ + bATAFlagIORead = 13, /* bit number of I/O read flag*/ + bATAFlagIOWrite = 12, /* bit number of I/O write flag*/ + bATAFlagTFAccessResult = 8, /* bit number of get register results on command completion.*/ + bATAFlagUseDMA = 7, /* bit number of use DMA flag*/ + bATAFlagProtocolATAPI = 5, /* bit number of ATAPI protocol*/ + bATAFlagImmediate = 1, /* bit number of immediate flag */ + bATAFlagTFAccess = 0, /* bit number of TF access */ + + mATAFlagQuiesce = 1 << bATAFlagQuiesce, + mATAFlagUseNoIRQ = 1 << bATAFlagNoIRQ, /* Special purpose! Avoid using! No-IRQ, polled synchronous protocol valid only for PIO commands*/ + mATAFlag48BitLBA = 1 << bATAFlag48BitLBA, /* Use 48 bit extended LBA protocol on this command. Requires support from the controller.*/ + mATAFlagDMAQueued = 1 << bATAFlagDMAQueued, /* Use tagged dma queuing protocol on this command. Requires support from the controller.*/ + mATAFlagOverlapped = 1 << bATAFlagOverlapped, /* Use overllaped protocol on this command. Requires support from the controller.*/ + mATAFlagUseConfigSpeed = 1 << bATAFlagUseConfigSpeed, /* Use the configured interface speed = true. False = use default PIO (slow) speed. valid only for PIO commands*/ + mATAFlagByteSwap = 1 << bATAFlagByteSwap, /* Swap data bytes (read - after; write - before)*/ + mATAFlagIORead = 1 << bATAFlagIORead, /* Read (in) operation*/ + mATAFlagIOWrite = 1 << bATAFlagIOWrite, /* Write (out) operation*/ + mATAFlagTFAccessResult = 1 << bATAFlagTFAccessResult, /* get contents of TaskFile registers indicated in TFMask on command completion, even if no error*/ + mATAFlagUseDMA = 1 << bATAFlagUseDMA, + mATAFlagProtocolATAPI = 1 << bATAFlagProtocolATAPI, /* ATAPI protocol indicator*/ + mATAFlagImmediate = 1 << bATAFlagImmediate, /* Put command at head of queue */ + mATAFlagTFAccess = 1 << bATAFlagTFAccess, /* Return Taskfile on error status*/ + +} ; + +/* The Function codes sent to controllers*/ +enum ataOpcode { + + kATANoOp = 0, + kATAFnExecIO , /* Execute ATA I/O */ + kATAPIFnExecIO, /* ATAPI I/O */ + kATAFnRegAccess , /* Register Access */ + + kATAFnQFlush , /* I/O Queue flush requests for your unit number */ + kATAFnBusReset /* Reset ATA bus */ + +} ; + + +/* The ATA Event codes */ +/* sent when calling the device driver's event handler*/ +enum ataEventCode { + kATANullEvent = 0x00, /* Just kidding -- nothing happened*/ + kATAOnlineEvent = 0x01, /* An ATA device has come online*/ + kATAOfflineEvent = 0x02, /* An ATA device has gone offline*/ + kATARemovedEvent = 0x03, /* An ATA device has been removed from the bus*/ + kATAResetEvent = 0x04, /* Someone gave a hard reset to the drive*/ + kATAOfflineRequest = 0x05, /* Someone requesting to offline the drive*/ + kATAEjectRequest = 0x06, /* Someone requesting to eject the drive*/ + kATAPIResetEvent = 0x07, /* Someone gave a ATAPI reset to the drive*/ + kATAReservedEvent = 0x80 /* RESERVED*/ +}; + + +// These need to be combined with a new enumeration of the current ATA/ATAPI command set. +// Some opcodes are of interest to ATA controllers, since they imply special protocols +// or handling. Device Reset, Execute Device Diagnostics have subtle side effects that +// controllers need to be aware of, so we snoop for those commands being issued. +// the rest are here for informational purposes. + +// BUG make new enum for all current ATA commands. + +enum { + kSOFTRESET = 0x008, // ATAPI Soft Reset command + kPACKET = 0x0A0, // ATAPI Packet command + kID_DRIVE = 0x0A1 // ATAPI Identify drive command +}; +/* ATA Command Opcode definition*/ +enum { + kATAcmdWORetry = 0x01, /* Without I/O retry option*/ + kATAcmdNOP = 0x0000, /* NOP operation - media detect*/ + kATAcmdRecal = 0x0010, /* Recalibrate command */ + kATAcmdRead = 0x0020, /* Read command */ + kATAcmdReadLong = 0x0022, /* Read Long command*/ + kATAcmdReadExtended = 0x0024, /* Read Extended (with retries)*/ + kATAcmdReadDMAExtended = 0x0025, /* Read DMA Extended (with retries)*/ + kATAcmdWrite = 0x0030, /* Write command */ + kATAcmdWriteLong = 0x0032, /* Write Long*/ + kATAcmdWriteExtended = 0x0034, /* Write Extended (with retries)*/ + kATAcmdWriteDMAExtended = 0x0035, /* Write DMA Extended (with retries)*/ + kATAcmdWriteVerify = 0x003C, /* Write verify*/ + kATAcmdReadVerify = 0x0040, /* Read Verify command */ + kATAcmdFormatTrack = 0x0050, /* Format Track command */ + kATAcmdSeek = 0x0070, /* Seek command */ + kATAcmdDiagnostic = 0x0090, /* Drive Diagnostic command */ + kATAcmdInitDrive = 0x0091, /* Init drive parameters command */ + kATAcmdReadMultiple = 0x00C4, /* Read multiple*/ + kATAcmdWriteMultiple = 0x00C5, /* Write multiple*/ + kATAcmdSetRWMultiple = 0x00C6, /* Set Multiple for Read/Write Multiple*/ + kATAcmdReadDMA = 0x00C8, /* Read DMA (with retries)*/ + kATAcmdWriteDMA = 0x00CA, /* Write DMA (with retries)*/ + kATAcmdMCAcknowledge = 0x00DB, /* Acknowledge media change - removable*/ + kATAcmdDoorLock = 0x00DE, /* Door lock*/ + kATAcmdDoorUnlock = 0x00DF, /* Door unlock*/ + kATAcmdStandbyImmed = 0x00E0, /* Standby Immediate*/ + kATAcmdIdleImmed = 0x00E1, /* Idle Immediate*/ + kATAcmdStandby = 0x00E2, /* Standby*/ + kATAcmdIdle = 0x00E3, /* Idle*/ + kATAcmdReadBuffer = 0x00E4, /* Read sector buffer command */ + kATAcmdCheckPowerMode = 0x00E5, /* Check power mode command <04/04/94>*/ + kATAcmdSleep = 0x00E6, /* Sleep*/ + kATAcmdFlushCache = 0x00E7, /* Flush Cache */ + kATAcmdWriteBuffer = 0x00E8, /* Write sector buffer command */ + kATAcmdWriteSame = 0x00E9, /* Write same data to multiple sectors*/ + kATAcmdFlushCacheExtended = 0x00EA, /* Flush Cache Extended */ + kATAcmdDriveIdentify = 0x00EC, /* Identify Drive command */ + kATAcmdMediaEject = 0x00ED, /* Media Eject*/ + kATAcmdSetFeatures = 0x00EF /* Set Features*/ +}; + +/* Set feature command opcodes*/ +enum { + kATAEnableWriteCache = 0x02, /* Enable write cache*/ + kATASetTransferMode = 0x03, /* Set transfer mode*/ + kATAEnableAPM = 0x05, /* Enable Advanced Power Management*/ + kATASetPIOMode = 0x08, /* PIO Flow Control Tx Mode bit*/ + kATADisableWriteCache = 0x82, /* disable write cache*/ + kATAEnableReadAhead = 0xAA /* Read look-ahead enable*/ +}; + +// revisit the opcode enumerations. + +////////////////////// + + +/* task file for ata */ +typedef struct ataTaskFile { + + UInt8 ataTFFeatures; /* <-> Error(R) or ataTFFeatures(W) register image */ + UInt8 ataTFCount; /* <-> Sector count/remaining */ + UInt8 ataTFSector; /* <-> Sector start/finish */ + UInt8 ataTFCylLo; /* <-> ataTFCylLo */ + UInt8 ataTFCylHigh; /* <-> ataTFCylHigh */ + UInt8 ataTFSDH; /* <-> ataTFSDH register image*/ + UInt8 ataTFCommand; /* <-> Status(R) or Command(W) register image */ + +} ataTaskFile; + + +typedef struct ataRegisterImage { + + ataTaskFile taskFile; + UInt16 ataDataRegister; /* <-> Data register. */ + UInt8 ataAltSDevCReg; /* <->: Alternate status(R) or Device Control(W) register image*/ + +} ataRegisterImage ; + + +typedef struct ATAPICmdPacket{ + + UInt16 atapiPacketSize; /* Size of command packet in bytes */ + UInt16 atapiCommandByte[8]; /* The command packet itself*/ + +}ATAPICmdPacket; + + + +// Error and result codes: TBD +enum { + kATAErrUnknownType = -1, + kATANoErr = 0, + kATAQueueEmpty = 1, + kATAUnknownOpcode, + kATATimeoutErr, + kATAInvalidDevID, + kATAErrDevBusy, + kATAModeNotSupported, + kATADevIntNoCmd, + kATADeviceError, + kATADMAErr +}; + + +#endif /* !_IOATATYPES_H */ diff --git a/i386/include/IOKit/ata/IOPCIATA.h b/i386/include/IOKit/ata/IOPCIATA.h new file mode 100644 index 0000000..62067b2 --- /dev/null +++ b/i386/include/IOKit/ata/IOPCIATA.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _DRV_PCI_ATA_H +#define _DRV_PCI_ATA_H + +#include +#include +#include "IOATAController.h" +#include +#include + +#include + +/*! @class IOPCIATA + @abstract The base class for PCI-IDE ata controller family. + @discussion class defining the common elements of bus-mastering PCI ATA controllers which meet or at least loosely follow the pci bus mastering pci-ide controller spec. Header doc is incomplete, but source is heavily commented. + +*/ + + + +class IOPCIATA : public IOATAController +{ + OSDeclareDefaultStructors(IOPCIATA); + +public: + + /*--- Overrides from IOATAController ---*/ + virtual bool init(OSDictionary * properties); + virtual bool start( IOService* provider ); + +protected: + + // The DMA states: not in use, in use and running with additional passes needed, + // in use on final pass, transfer complete, and failure + enum ATADMAState + { + // DMA state flags + kATADMAInactive, + kATADMAStarting, + kATADMAActive, + kATADMAStatus, + kATADMAComplete, + kATADMAError, + + }; + + enum { + // PRD flags + kLast_PRD = 0x8000, + kContinue_PRD = 0, + + }; + + + enum { + mBMCmdStartOutput = 0x01, // start engine to transfer from memory to device. + mBMCmdStartInput = (1 << 3 ) | 0x01, // start engine to transfer from device to memory + mBMCmdStop = 0x00, // halt engine. + }; + + enum { + // bus master status register definitions. + bBMStatusSimplex = 7, // 0 = simultaneous transactions allowed. 1 = primary and secondary busses may not be active at same time. + bBMStatusDrv1 = 6, // 1 = device 1 and bus are already configured by some other software/firmware + bBMStatusDrv0 = 5, // 1 = device 0 and bus are already configured by some other software/firmware + bBMStatusInt = 2, // 1 = device has asserted INTRQ and all data is flushed to/from memory. + bBMStatusError = 1, // 1 = an error in the DMA has occured. Software clears by writing 1 to this bit. + bBMStatusActive = 0, // 1 = DMA engine is active. + }; + + enum{ + + mBMStatusSimplex = 1 << 7, + mBMStatusDrv1 = 1 << 6, + mBMStatusDrv0 = 1 << 5, + mBMStatusInt = 1 << 2, + mBMStatusError = 1 << 1, + mBMStatusActive = 1 + }; + + // the physical region descriptor used for the dma engine. + struct PRD + { + UInt32 bufferPtr; // address + UInt16 byteCount; // 16 bit byte count where 0x0000 = 64K + UInt16 flags; // 0 in flags means contine, 0x80 means stop + }; + + + // descendants of this class MUST initialize these values + // prior to activating any DMA command. + IOATARegPtr8 _bmCommandReg; + IOATARegPtr8 _bmStatusReg; + IOATARegPtr32 _bmPRDAddresReg; + + // semaphore for DMA state + UInt32 _dmaState; + + // table of PRD descriptors + PRD* _prdTable; + IOPhysicalAddress _prdTablePhysical; + + IONaturalMemoryCursor* _DMACursor; + + // override from IOATAController + // activate the DMA engine as per the current command + virtual IOReturn startDMA( void ); + + // override from IOATAController + // safely halt the DMA engine regardless of state + virtual IOReturn stopDMA( void ); + + // allocate memory for the PRD descriptors. + virtual bool allocDMAChannel(void); + + // fill CC with stop commands. + virtual void initATADMAChains (PRD* descPtr); + + // fill out a PRD, respecting endianess + virtual void setPRD(UInt8 *bffr, UInt16 count, PRD *tableElement, UInt16 end); + + // setup the CC with IO commands + virtual IOReturn createChannelCommands(void); + + // deallocate memory for the DMA engine + virtual bool freeDMAChannel(void); + + // clean up on device interrupt + virtual IOReturn handleDeviceInterrupt(void); + + // activate the DMA engine + virtual void activateDMAEngine(void); + + // shutdown the DMA engine + virtual void stopDMAEngine(void); + + // safely suspend the DMA engine + virtual void shutDownATADMA (void); + + // overrides + virtual void free(); +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOPCIATA class in the future. + */ + typedef struct ExpansionData + { + IOBufferMemoryDescriptor* _prdBuffer; + } ExpansionData; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOPCIATA, 0); + OSMetaClassDeclareReservedUnused(IOPCIATA, 1); + OSMetaClassDeclareReservedUnused(IOPCIATA, 2); + OSMetaClassDeclareReservedUnused(IOPCIATA, 3); + OSMetaClassDeclareReservedUnused(IOPCIATA, 4); + OSMetaClassDeclareReservedUnused(IOPCIATA, 5); + OSMetaClassDeclareReservedUnused(IOPCIATA, 6); + OSMetaClassDeclareReservedUnused(IOPCIATA, 7); + OSMetaClassDeclareReservedUnused(IOPCIATA, 8); + OSMetaClassDeclareReservedUnused(IOPCIATA, 9); + OSMetaClassDeclareReservedUnused(IOPCIATA, 10); + OSMetaClassDeclareReservedUnused(IOPCIATA, 11); + OSMetaClassDeclareReservedUnused(IOPCIATA, 12); + OSMetaClassDeclareReservedUnused(IOPCIATA, 13); + OSMetaClassDeclareReservedUnused(IOPCIATA, 14); + OSMetaClassDeclareReservedUnused(IOPCIATA, 15); + OSMetaClassDeclareReservedUnused(IOPCIATA, 16); + OSMetaClassDeclareReservedUnused(IOPCIATA, 17); + OSMetaClassDeclareReservedUnused(IOPCIATA, 18); + OSMetaClassDeclareReservedUnused(IOPCIATA, 19); + OSMetaClassDeclareReservedUnused(IOPCIATA, 20); +}; + +#endif // _DRV_PCI_ATA_H diff --git a/i386/include/IOKit/ata/MacIOATA.h b/i386/include/IOKit/ata/MacIOATA.h new file mode 100644 index 0000000..fad6c33 --- /dev/null +++ b/i386/include/IOKit/ata/MacIOATA.h @@ -0,0 +1,225 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#if defined(__ppc__) + + +#ifndef _DRV_MACIO_ATA_H +#define _DRV_MACIO_ATA_H + +#include +#include +#include "IOATAController.h" +#include +#include + +#include + + +/*! @class MacIOATA + @abstract The base class for MAC-IO ata controller family. . + @discussion class defining the portions of MacIO ATA cells which are shared + in common between Heathrow and Key Largo ATA Cells. + These controllers share a common register file layout, interrupt + source format and all use DBDMA engines. These are different from + other ATA controllers, such as most PCI-IDE and PC-Card ATA ports. + Each cell type has some distinctive features that must be implemented + by a specific driver subclass. As much common code as possible is + presented in this superclass. + +*/ + +class MacIOATA : public IOATAController +{ + OSDeclareDefaultStructors(MacIOATA); + +public: + + /*--- Overrides from IOATAController ---*/ + virtual bool init(OSDictionary * properties); + virtual bool start( IOService* provider ); + virtual IOReturn message (UInt32 type, IOService* provider, void* argument = 0); + +protected: + + // The DMA states: not in use, in use and running with additional passes needed, + // in use on final pass, transfer complete, and failure + enum ATADMAState + { + kATADMAInactive, + kATADMAStarting, + kATADMAActive, + kATADMAStatus, + kATADMAComplete, + kATADMAError + }; + + + + // the address of the timing register in the controller + volatile UInt32* _timingConfigReg; + // the timing values to use for each device. + UInt32 _timingConfig[2]; + + // semaphore for DMA state + UInt32 _dmaState; + + // indicates whether a DMA interrupt is expected + UInt32 _dmaIntExpected; + + // pointer to the DMA control register address. + volatile IODBDMAChannelRegisters* _dmaControlReg; + + // mappings to the controller and DMA engine registers + // we have to free these when we go away. + IOMemoryMap* _baseAddressMap; + IOMemoryMap* _dmaBaseMap; + + // the DBDMA memory cursor + IODBDMAMemoryCursor* _DMACursor; + + // the DBDMA descriptor table + IODBDMADescriptor* _descriptors; + IOPhysicalAddress _descriptorsPhysical; + + // interrupt event sources + IOInterruptEventSource* _devIntSrc; + IOInterruptEventSource* _dmaIntSrc; + + // flag indicating device and dma engine interrupts need + // re-synchronization. + + bool _resyncInterrupts; +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // overriden to allow synchronization of DMA vs. device interrupts. + virtual IOReturn handleDeviceInterrupt(void); + // overriden here to allow for reporting of DMA errs + virtual IOReturn asyncStatus(void); + + // overriden here to allow for clean up of DMA resynch flag on timeout. + virtual void handleTimeout(void); + + + // called by the superclass::start method in order to + // find and enable access to the ATA task file. + virtual bool configureTFPointers(void); + + // allocate memory for the DMA descriptors. + virtual bool allocDMAChannel(void); + + // fill CC with stop commands. + virtual void initATADMAChains (IODBDMADescriptor* descPtr); + + // setup the CC with IO commands + virtual IOReturn createChannelCommands(void); + + // deallocate memory for the DMA engine + virtual bool freeDMAChannel(void); + + // connect the device (drive) interrupt to our workloop + virtual bool createDeviceInterrupt(void); + + // connect the DMA interrupt to our workloop. + virtual bool createDMAInterrupt(void); + + + // override from IOATAController + // activate the DMA engine as per the current command + virtual IOReturn startDMA( void ); + + // override from IOATAController + // safely halt the DMA engine regardless of state + virtual IOReturn stopDMA( void ); + + // handle the interrupt processing + virtual void processDMAInterrupt (void); + + // activate the DMA engine + virtual void activateDMAEngine(void); + + // shutdown the DMA engine + virtual void stopDMAEngine(void); + + // safely suspend the DMA engine + virtual void shutDownATADMA (void); + + // check the command chain after run to update byte counts + // and check for errors + virtual bool scanATADMAChain (IOByteCount* byteCount); + + + // c to c++ glue code. + static void deviceInterruptOccurred(OSObject*, IOInterruptEventSource *, int count); + static void dmaInterruptOccurred(OSObject*, IOInterruptEventSource *, int count); + + // overrides + virtual void free(); + + // media bay specific code + bool isMediaBay; + bool isBusOnline; + + virtual IOReturn executeCommand(IOATADevice* nub, IOATABusCommand* command); + virtual IOReturn handleQueueFlush( void ); + virtual bool checkTimeout( void ); + static void cleanUpAction(OSObject * owner, void*, void*, void*, void*); + virtual void cleanUpBus(void); + virtual IOReturn handleBusReset(void); + // end media bay specific. + +private: + OSMetaClassDeclareReservedUnused(MacIOATA, 0); + OSMetaClassDeclareReservedUnused(MacIOATA, 1); + OSMetaClassDeclareReservedUnused(MacIOATA, 2); + OSMetaClassDeclareReservedUnused(MacIOATA, 3); + OSMetaClassDeclareReservedUnused(MacIOATA, 4); + OSMetaClassDeclareReservedUnused(MacIOATA, 5); + OSMetaClassDeclareReservedUnused(MacIOATA, 6); + OSMetaClassDeclareReservedUnused(MacIOATA, 7); + OSMetaClassDeclareReservedUnused(MacIOATA, 8); + OSMetaClassDeclareReservedUnused(MacIOATA, 9); + OSMetaClassDeclareReservedUnused(MacIOATA, 10); + OSMetaClassDeclareReservedUnused(MacIOATA, 11); + OSMetaClassDeclareReservedUnused(MacIOATA, 12); + OSMetaClassDeclareReservedUnused(MacIOATA, 13); + OSMetaClassDeclareReservedUnused(MacIOATA, 14); + OSMetaClassDeclareReservedUnused(MacIOATA, 15); + OSMetaClassDeclareReservedUnused(MacIOATA, 16); + OSMetaClassDeclareReservedUnused(MacIOATA, 17); + OSMetaClassDeclareReservedUnused(MacIOATA, 18); + OSMetaClassDeclareReservedUnused(MacIOATA, 19); + OSMetaClassDeclareReservedUnused(MacIOATA, 20); + +}; + +#endif // _DRV_MACIO_ATA_H + + +#endif // defined(ppc) diff --git a/i386/include/IOKit/audio/.svn/all-wcprops b/i386/include/IOKit/audio/.svn/all-wcprops new file mode 100644 index 0000000..e6ed2a1 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/all-wcprops @@ -0,0 +1,83 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio +END +IOAudioDevice.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioDevice.h +END +IOAudioControl.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioControl.h +END +IOAudioSelectorControl.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioSelectorControl.h +END +IOAudioToggleControl.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioToggleControl.h +END +IOAudioEngineUserClient.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioEngineUserClient.h +END +IOAudioPort.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioPort.h +END +IOAudioTypes.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioTypes.h +END +IOAudioEngine.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioEngine.h +END +IOAudioDebug.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioDebug.h +END +IOAudioLevelControl.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioLevelControl.h +END +IOAudioStream.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioStream.h +END +IOAudioDefines.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioDefines.h +END +IOAudioControlUserClient.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/audio/IOAudioControlUserClient.h +END diff --git a/i386/include/IOKit/audio/.svn/entries b/i386/include/IOKit/audio/.svn/entries new file mode 100644 index 0000000..090228a --- /dev/null +++ b/i386/include/IOKit/audio/.svn/entries @@ -0,0 +1,470 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/audio +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOAudioDevice.h +file + + + + +2013-08-27T23:54:15.000000Z +1ceb7e3dbef95a789a78c2e8fc52454d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +41464 + +IOAudioControl.h +file + + + + +2013-08-27T23:54:15.000000Z +757613aaaf066008c32943d437be531b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +28603 + +IOAudioSelectorControl.h +file + + + + +2013-08-27T23:54:15.000000Z +b94010baad8ae7cfdaf0248ea765cfa8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5401 + +IOAudioToggleControl.h +file + + + + +2013-08-27T23:54:15.000000Z +22c354c2b8bc44f790316a5696d9bffd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5469 + +IOAudioEngineUserClient.h +file + + + + +2013-08-27T23:54:15.000000Z +2f08a9e4b6bfd2935b03570e90b7d4b4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13212 + +IOAudioPort.h +file + + + + +2013-08-27T23:54:15.000000Z +773585899e023f4a486c93237dbe6921 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8721 + +IOAudioTypes.h +file + + + + +2013-08-27T23:54:15.000000Z +5385132807e2f6903a12e530df012233 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +24765 + +IOAudioEngine.h +file + + + + +2013-08-27T23:54:15.000000Z +dc9e4a4978bcdab6f2751534de8b61a3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +44092 + +IOAudioDebug.h +file + + + + +2013-08-27T23:54:15.000000Z +bda050ff97e2ac69023e8e0b4236c0c9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1820 + +IOAudioLevelControl.h +file + + + + +2013-08-27T23:54:15.000000Z +b334ed51abe642ab9a6bd7ac6ba2b14d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8954 + +IOAudioStream.h +file + + + + +2013-08-27T23:54:15.000000Z +9207a573b75fe6d1ae1e815eb826b73a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13090 + +IOAudioDefines.h +file + + + + +2013-08-27T23:54:15.000000Z +0dfbc3268fab8c87f2b5c96368449ceb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17704 + +IOAudioControlUserClient.h +file + + + + +2013-08-27T23:54:15.000000Z +ba436e7c0eaf4313a2844dd8b550e346 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3578 + diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioControl.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioControl.h.svn-base new file mode 100644 index 0000000..d1d9019 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioControl.h.svn-base @@ -0,0 +1,595 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOCONTROL_H +#define _IOKIT_IOAUDIOCONTROL_H + +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioEngine.h" +#endif + +class IOAudioPort; +class OSDictionary; +class OSSet; +class IOAudioUserClient; +class IOAudioControlUserClient; +class IOWorkLoop; +class IOCommandGate; + +/*! + * @class IOAudioControl + * @abstract Represents any controllable attribute of an IOAudioDevice. + * @discussion An IOAudioControl instance may belong to one IOAudioPort. Additionally, it may associated + * with an IOAudioEngine as a default control for that IOAudioEngine. + * + * When its value changes, it sends a notification to the CoreAudio.framework (HAL). It also makes a call + * to the ValueChangeHandler. + * + * The base IOAudioControl class contains a type, a value and a channel ID representing the channel(s) which + * the control acts on. It may also contain a readable format for the name of the channel as well as a + * control ID that can be used to identify unique controls. Additionally it may contain a subType and a usage. + * Each type has its own set of possible subTypes. There currently four different control types defined: + * kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * Each one is represented by a subclass of IOAudioControl: IOAudioLevelControl, IOAudioToggleControl, + * IOAudioSelectorControl. The level control defines a range of allowed values and has + * a defined subtype of kIOAudioLevelControlSubTypeVolume used to define a volume control. The toggle control + * allows for a boolean value and has a defined subtype kIOAudioToggleControlSubTypeMute for a mute control. The + * selector control has a list of allowed selections with a value and description for each allowed selection and + * has the following sub types: kIOAudioSelectorControlSubTypeOutput for an output selector and + * kIOAudioSelectorControlSubTypeInput for an input selector. See the subclass documentation for a more + * complete description of each + * + * There are enums for default channel ID values and common channel names in IOAudioTypes.h. The channel ID + * values are prefixed with 'kIOAudioControlChannelID' and the common channel names are prefixed with + * 'kIOAudioControlChannelName'. All of the attributes of the IOAudioControl are stored in the registry. + * The key used for each attribute is defined in IOAudioTypes.h with the define matching the following + * pattern: 'kIOAudioControlKey'. For example: kIOAudioControlChannelIDKey. + * + * In addition to the existing defined control types, drivers can define their own as well for other purposes. + * + * Changes to the IOAudioControl's value made by the CoreAudio.framework are done through the IORegistry. + * When the CoreAudio.framework initiates a value change, the control receives a setProperties() message. + * The setProperties() implementation looks for the property 'IOAudioControlValue' and if present, calls + * setValue() on the driver's IOWorkLoop with the new value. The setValue() function first checks to see + * if the new value is different. If so, it calls performValueChange() to call through to the driver + * to make the change in the hardware. If that call succeeds the value is changed and the new value is set + * in the registry. Additionally notifications are sent to all clients that have registered for them. + */ +class IOAudioControl : public IOService +{ + friend class IOAudioPort; + friend class IOAudioDevice; + friend class IOAudioEngine; + + OSDeclareDefaultStructors(IOAudioControl) + +public: + + /*! + * @typedef IntValueChangeHandler + * @abstract Handler function used to make a notification when a value is to be changed. + * @param target Reference supplied when the handler was registered. + * @param audioControl The IOAudioControl that is changing. + * @param oldValue The old value of the control. + * @param newValue The new value the control is being changed to. + * @result Must return kIOReturnSuccess when the hardware is successfully updated. + */ + typedef IOReturn (*IntValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, SInt32 oldValue, SInt32 newValue); + typedef IOReturn (*DataValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, const void *oldData, UInt32 oldDataSize, const void *newData, UInt32 newDataSize); + typedef IOReturn (*ObjectValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, OSObject *oldValue, OSObject *newValue); + +protected: + /*! @var workLoop + The IOWorkLoop for the audio driver - shared from the IOAudioDevice. + */ + IOWorkLoop *workLoop; + /*! @var commandGate + The IOCommandGate for this control - attached to the driver's IOWorkLoop. + */ + IOCommandGate *commandGate; + + /*! @var isStarted + Internal state keeping track of when the IOAudioControl has been started. + */ + bool isStarted; + + /*! @var controlID + An optional identifier that can be used to identify the control. + */ + UInt32 controlID; + /*! @var channelID + The ID of the channel this control affects - may be kIOAudioControlChannelIDAll if it represents all channels. + */ + UInt32 channelID; + + UInt32 type; + UInt32 subType; + UInt32 usage; + + OSObject *value; + + typedef enum { + kIntValueChangeHandler, + kDataValueChangeHandler, + kObjectValueChangeHandler + } ValueChangeHandlerType; + + ValueChangeHandlerType valueChangeHandlerType; + + union { + IntValueChangeHandler intHandler; + DataValueChangeHandler dataHandler; + ObjectValueChangeHandler objectHandler; + } valueChangeHandler; + + OSObject *valueChangeTarget; + + /*! @var clients + A list of user clients that have requested value change notifications. + */ + OSSet *userClients; + +protected: + struct ExpansionData { + IOAudioEngine * providerEngine; + OSArray * notificationQueue; + }; + + ExpansionData *reserved; + +public: + // OSMetaClassDeclareReservedUsed(IOAudioControl, 0); + virtual void sendChangeNotification(UInt32 notificationType); + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 1); + /*! + * @function setReadOnlyFlag + * @abstract Call this function to say that a control is read only. + * This call cannot be undone, so if a control is only temporarily unsetable, + * do not use this call but instead return an error from the control handler. + */ + virtual void setReadOnlyFlag(); + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 2); + virtual void sendQueuedNotifications(void); + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 3); + /*! + * @function createUserClient + * @abstract Creates a new IOAudioControlUserClient instance. + * @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality + * to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient + * and return a new, initialized instance of that subclass. + * A derived class that requires overriding of createUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client. + * @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful + * completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioControlUserClient **newUserClient, OSDictionary *properties); + +private: + OSMetaClassDeclareReservedUsed(IOAudioControl, 0); + OSMetaClassDeclareReservedUsed(IOAudioControl, 1); + OSMetaClassDeclareReservedUsed(IOAudioControl, 2); + OSMetaClassDeclareReservedUsed(IOAudioControl, 3); + + OSMetaClassDeclareReservedUnused(IOAudioControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioControl, 15); + OSMetaClassDeclareReservedUnused(IOAudioControl, 16); + OSMetaClassDeclareReservedUnused(IOAudioControl, 17); + OSMetaClassDeclareReservedUnused(IOAudioControl, 18); + OSMetaClassDeclareReservedUnused(IOAudioControl, 19); + OSMetaClassDeclareReservedUnused(IOAudioControl, 20); + OSMetaClassDeclareReservedUnused(IOAudioControl, 21); + OSMetaClassDeclareReservedUnused(IOAudioControl, 22); + OSMetaClassDeclareReservedUnused(IOAudioControl, 23); + +public: + + /*! + * @function withAttributes + * @abstract Static function that allocates a new IOAudioControl with the given attributes. + * @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently + * consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not + * defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @param subType An optional subType specific to the given type + * @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput, + * kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control + * on an IOAudioEngine. + * @result Returns a newly allocated and initialized IOAudioControl. + */ + static IOAudioControl *withAttributes(UInt32 type, + OSObject *initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioControl with the given attributes. + * @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently + * consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not + * defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @param subType An optional subType specific to the given type + * @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput, + * kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control + * on an IOAudioEngine. + * @param properties Standard property list passed to the init() function of any new IOService. This dictionary + * gets stored in the registry entry for this instance. + * @result Returns true on success. + */ + virtual bool init(UInt32 type, + OSObject *initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioControl. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + /*! + * @function start + * @abstract Starts a newly created IOAudioControl. + * @discussion This is called automatically by IOAudioPort when addAudioControl() is called or by IOAudioEngine + * when addDefaultAudioControl() is called. It will only be called by the first call to either addAudioControl() or + * addDefaultAudioControl(). + * @param provider The IOAudioPort or IOAudioEngine that owns this control. + * @result Returns true on success. + */ + virtual bool start(IOService *provider); + + virtual bool attachAndStart(IOService *provider); + + /*! + * @function getIsStarted + * @abstract Returns true after start() has been called. + * @discussion Used by IOAudioPort and IOAudioEngine to decide if the control needs to be started. + */ + virtual bool getIsStarted(); + + /*! + * @function stop + * @abstract Stops the control when the provider is going away. + * @param provider The IOAudioPort or IOAudioEngine that owns this control. + */ + virtual void stop(IOService *provider); + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the whole audio driver. + */ + virtual IOWorkLoop *getWorkLoop(); + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioControl. + */ + virtual IOCommandGate *getCommandGate(); + + /*! + * @function newUserClient + * @abstract Creates a new user client object for this IOAudioControl instance. + * @discussion This is called automatically by I/O Kit when a user process opens a connection to this + * IOAudioControl. This is typically done when the user process needs to register for value change + * notifications. This implementation allocates a new IOAudioControlUserClient object. There is no + * need to call this directly. + * A derived class that requires overriding of newUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client - 0 for the default user client type. + * @param handler The new IOUserClient * must be stored in this param on a successful completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory. + */ + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler); + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler); + + /*! + * @function createUserClient + * @abstract Creates a new IOAudioControlUserClient instance. + * @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality + * to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient + * and return a new, initialized instance of that subclass. + * A derived class that requires overriding of createUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client. + * @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful + * completion. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioControlUserClient **newUserClient); + + /*! + * @function clientClosed + * @abstract Called automatically by the IOAudioControlUserClient when a user client closes its + * connection to the control. + * @param client The user client object that has disconnected. + */ + virtual void clientClosed(IOAudioControlUserClient *client); + + /*! + * @function setProperties + * @abstract Changes a property of this IOService. + * @discussion This is called when the user client changes a property of this + * IOAudioControl. In this case it is used to change the value. This function + * looks for that property and then calls setValue() through the IOCommandGate and + * setValueAction(). + * @param properties An OSDictionary containing the properties to change. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn setProperties(OSObject *properties); + + virtual void setValueChangeHandler(IntValueChangeHandler intValueChangeHandler, OSObject *target); + virtual void setValueChangeHandler(DataValueChangeHandler dataValueChangeHandler, OSObject *target); + virtual void setValueChangeHandler(ObjectValueChangeHandler objectValueChangeHandler, OSObject *target); + + virtual void setValueChangeTarget(OSObject *target); + + /*! + * @function flushValue + * @abstract Forces the control to be flushed out to the hardware. + * @discussion This function calls performValueChange() directly with the current value of the IOAudioControl. + * @result Returns the result of performValueChange() - kIOReturnSuccess on success. + */ + virtual IOReturn flushValue(); + + /*! + * @function setValueAction + * @abstract IOCommandGate Action which calls setValue() while holding the IOCommandGate. + * @discussion This is needed to allow setValue() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The new value for the IOAudioControl. + * @result Returns the result of setValue() - kIOReturnSuccess on success. + */ + static IOReturn setValueAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + static IOReturn _setValueAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + + /*! + * @function setValue + * @abstract Sets the value for this control. + * @discussion When the control's value is changed, a call is made to performValueChange(). If that call + * succeeds, the value is set and sendValueChangeNotification() is called to send a notification to the + * user clients. This function must be called on the IOWorkLoop. + * @param newValue The new value for this control. + * @result Returns kIOReturnSuccess if the value is successfully set. + */ + virtual IOReturn setValue(OSObject *newValue); + + virtual IOReturn setValue(SInt32 intValue); + + /*! + * @function hardwareValueChanged + * @abstract Updates the value for this control and sends out the value changed notification. + * @discussion This is designed to be called by the driver when it detects that the hardware's value has + * changed without driver intervention (e.g. when an external event causes the change). The difference between + * hardwareValueChanged() and setValue() is that hardwareValueChanged() doesn't call performValueChange() which + * sends a message back to the driver to cause it to change the hardware with the new value. This function must + * be called on the IOWorkLoop. + * @param newValue The new value for this control. + * @result Returns kIOReturnSuccess if the value is successfully updated. + */ + virtual IOReturn hardwareValueChanged(OSObject *newValue); + + /*! + * @function getValue + * @abstract Returns the current value of the control. + */ + virtual OSObject *getValue(); + virtual SInt32 getIntValue(); + virtual const void *getDataBytes(); + virtual UInt32 getDataLength(); + + /*! + * @function getControlID + * @abstract Returns the control ID for the control. + */ + virtual UInt32 getControlID(); + + /*! + * @function getChannelID + * @abstract Returns the channel ID for the control. + */ + virtual UInt32 getChannelID(); + + virtual UInt32 getType(); + virtual UInt32 getSubType(); + virtual UInt32 getUsage(); + + virtual void setCoreAudioPropertyID(UInt32 propertyID); + + void setWorkLoop(IOWorkLoop *wl); + +protected: + /*! + * @function sendValueChangeNotification + * @abstract Called when the value has changed for the control. + * @discussion This function sends out the value change notification to the user clients. + */ + virtual void sendValueChangeNotification(); + + /*! + * @function setChannelName + * @abstract Called at init time to set the channel name for this IOAudioControl. + */ + virtual void setChannelName(const char *channelName); + + /*! + * @function setChannelID + * @abstract Called at init time to set the channel ID for this IOAudioControl. + */ + virtual void setChannelID(UInt32 newChannelID); + virtual void setChannelNumber(SInt32 channelNumber); + + /*! + * @function setSubType + * @abstract Called at init time to set the control subType. + */ + virtual void setType(UInt32 type); + + /*! + * @function setType + * @abstract Called at init time to set the control type. + */ + virtual void setSubType(UInt32 subType); + + /*! + * @function setUsage + * @abstract Called at init time to set the control usage. + */ + virtual void setUsage(UInt32 usage); + + /*! + * @function setControlID + * @abstract Sets the controlID for this control. + * @discussion The control ID is an optional attribute that can be used to track IOAudioControls. A typical + * use is for the IOAudioDevice to assign a unique controlID to each control that it creates and then + * do a switch statement on the id of the control when it gets an audioControlValueChanged() notification. + * Typically the control ID is set when the object is created and doesn't need to be called again. + * @param cntrlID The control ID for the control. + */ + virtual void setControlID(UInt32 cntrlID); + + /*! + * @function validateValue + * @abstract Called by setValue() to verify that the value is valid. + * @param newValue The new value to be verified. + * @result Returns kIOReturnSuccess if the value is valid. + */ + virtual IOReturn validateValue(OSObject *newValue); + + /*! + * @function updateValue + * @abstract Called by setValue() in order to update the value and the registry. + * @discussion It also calls + * sendValueChangedNotification() to send notifications to the user clients. + * @param newValue The new value to b updated. + * @result Returns kIOReturnSuccess if the value is successfully updated. + */ + virtual IOReturn updateValue(OSObject *newValue); + + virtual IOReturn _setValue(OSObject *newValue); + + /*! + * @function performValueChange + * @abstract Called by setValue() to make the call to the valueChangeHandler + * to update the hardware. + * @result Returns the result of the handler call (or kIOReturnError on an error). + */ + virtual IOReturn performValueChange(OSObject *newValue); + + /*! + * @function addUserClientAction + * @abstract IOCommandGate Action which calls addUserClient() while holding the IOCommandGate. + * @discussion This is needed to allow addUserClient() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The IOAudioControlUserClient to be added. + * @result Returns the result of addUserClient() - kIOReturnSuccess on success. + */ + static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + + /*! + * @function removeUserClientAction + * @abstract IOCommandGate Action which calls removeUserClient() while holding the IOCommandGate. + * @discussion This is needed to allow removeUserClient() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The IOAudioControlUserClient to be removed. + * @result Returns the result of removeUserClient() - kIOReturnSuccess on success. + */ + static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + + /*! + * @function detachUserClientsAction + */ + static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + /*! + * @function addUserClient + * @abstract Called on the IOWorkLoop to add a new IOAudioControlUserClient. + * @discussion There is no need to call this directly. It is called on the workLoop + * by newUserClient() through addUserClientAction(). + * @param newUserClient The IOAudioControlUserClientto be added. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn addUserClient(IOAudioControlUserClient *newUserClient); + + /*! + * @function removeUserClient + * @abstract Called on the IOWorkLoop to remove an IOAudioControlUserClient. + * @discussion This is called on the IOWorkLoop by clientClosed() through + * removeUserClientAction() when the user client is going away. It should + * not be called directly. + * @param userClient The IOAudioControlUserClient to be removed. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn removeUserClient(IOAudioControlUserClient *userClient); + + virtual IOReturn detachUserClients(); + +}; + +#endif /* _IOKIT_IOAUDIOCONTROL_H */ + diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioControlUserClient.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioControlUserClient.h.svn-base new file mode 100644 index 0000000..4ceb05f --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioControlUserClient.h.svn-base @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOCONTROLUSERCLIENT_H +#define _IOKIT_IOAUDIOCONTROLUSERCLIENT_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioTypes.h" +#endif + +class IOAudioControl; + +class IOAudioControlUserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOAudioControlUserClient) + +protected: + task_t clientTask; + IOAudioControl * audioControl; + IOAudioNotificationMessage * notificationMessage; + + virtual IOReturn clientClose(); + virtual IOReturn clientDied(); + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + virtual void sendChangeNotification(UInt32 notificationType); + // OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1); + virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type, OSDictionary *properties); + +private: + OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 0); + OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1); + + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 2); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 3); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 4); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 5); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 6); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 7); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 8); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 9); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 10); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 11); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 12); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 13); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 14); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 15); + +public: + static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type); + static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type, OSDictionary *properties); + + virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type); + + virtual void free(); + + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon); + + virtual void sendValueChangeNotification(); +}; + +#endif /* _IOKIT_IOAUDIOCONTROLUSERCLIENT_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioDebug.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioDebug.h.svn-base new file mode 100644 index 0000000..04b744e --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioDebug.h.svn-base @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIODEBUG_H +#define _IOAUDIODEBUG_H + +#ifdef DEBUG + #define DEBUG_LEVEL 1 + #define DEBUG_USE_FIRELOG 1 + + #ifdef DEBUG_USE_FIRELOG + #include + #define audioDebugIOLog( level, message... ) \ + do {FireLog( message ); FireLog("\n");} while (0) + + #else + #include + #define audioDebugIOLog( level, message... ) \ + do {USBLog( level, message );} while (0) + #endif + + + + #ifdef assert + #undef assert + + #define AssertionMessage( cond, file, line ) \ + "assert \"" #cond "\" failed in " #file " at line " #line + + #define AssertionFailed( cond, file, line ) \ + panic(AssertionMessage( cond, file, line )); + + #define assert( cond ) \ + if( !(cond) ) { \ + AssertionFailed( cond, __FILE__, __LINE__ ) \ + } + #endif +#else + #define audioDebugIOLog( level, message... ) ; +#endif + +#endif /* _IOAUDIODEBUG_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioDefines.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioDefines.h.svn-base new file mode 100644 index 0000000..068267a --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioDefines.h.svn-base @@ -0,0 +1,465 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIODEFINES_H +#define _IOAUDIODEFINES_H + +#define kIOAudioDeviceClassName "IOAudioDevice" +#define kIOAudioEngineClassName "IOAudioEngine" +#define kIOAudioStreamClassName "IOAudioStream" +#define kIOAudioPortClassName "IOAudioPort" +#define kIOAudioControlClassName "IOAudioControl" + +/*! + * @defined kIOAudioSampleRateKey + * @abstract The key in the IORegistry for the IOAudioEngine sample rate attribute + * @discussion This value is represented as an integer in samples per second. + */ +#define kIOAudioSampleRateKey "IOAudioSampleRate" + +#define kIOAudioSampleRateWholeNumberKey "IOAudioSampleRateWholeNumber" +#define kIOAudioSampleRateFractionKey "IOAudioSampleRateFraction" + + + +/****** + * + * IOAudioDevice defines + * + *****/ + + +/*! + * @defined kIOAudioDeviceNameKey + * @abstract The key in the IORegistry for the IOAudioDevice name attribute. + */ +#define kIOAudioDeviceNameKey "IOAudioDeviceName" + +#define kIOAudioDeviceShortNameKey "IOAudioDeviceShortName" + +/*! + * @defined kIOAudioDeviceManufacturerNameKey + * @abstract The key in the IORegistry for the IOAudioDevice manufacturer name attribute. + */ +#define kIOAudioDeviceManufacturerNameKey "IOAudioDeviceManufacturerName" + +#define kIOAudioDeviceLocalizedBundleKey "IOAudioDeviceLocalizedBundle" + +#define kIOAudioDeviceTransportTypeKey "IOAudioDeviceTransportType" + +#define kIOAudioDeviceConfigurationAppKey "IOAudioDeviceConfigurationApplication" + +#define kIOAudioDeviceCanBeDefaults "IOAudioDeviceCanBeDefaults" + +#define kIOAudioDeviceModelIDKey "IOAudioDeviceModelID" + + +/*! + * @defined kIOAudioDeviceIconName + * @abstract The key in the IORegistry for the IOAudioDevice icon name attribute. + */ +#define kIOAudioDeviceIconNameKey "IOAudioDeviceIconName" + +#define kIOAudioDeviceIconTypeKey "IOAudioDeviceIconType" + +#define kIOAudioDeviceIconSubDirKey "IOAudioDeviceIconSubDir" + +/***** + * + * IOAudioEngine defines + * + *****/ + + + /*! + * @defined kIOAudioEngineStateKey + * @abstract The key in the IORegistry for the IOAudioEngine state atrribute + * @discussion The value for this key may be one of: "Running", "Stopped" or "Paused". Currently the "Paused" + * state is unimplemented. + */ +#define kIOAudioEngineStateKey "IOAudioEngineState" + +/*! + * @defined kIOAudioEngineOutputSampleLatencyKey + * @abstract The key in the IORegistry for the IOAudioEngine output sample latency key + * @discussion + */ +#define kIOAudioEngineOutputSampleLatencyKey "IOAudioEngineOutputSampleLatency" + +/*! + * @defined kIOAudioStreamSampleLatencyKey + * @abstract The key in the IORegistry for the IOAudioStream output sample latency key + * @discussion Tells the HAL how much latency is on a particular stream. If two streams + * on the same engine have different latencies (e.g. one is analog, one is digital), then + * set this property on both streams to inform the HAL of the latency differences. Alternately, + * you can set the engine latency, and just include the latency additional to that for the particular + * stream. The HAL will add the engine and stream latency numbers together to get the total latency. + */ +#define kIOAudioStreamSampleLatencyKey "IOAudioStreamSampleLatency" + +#define kIOAudioEngineInputSampleLatencyKey "IOAudioEngineInputSampleLatency" + +#define kIOAudioEngineSampleOffsetKey "IOAudioEngineSampleOffset" + +#define kIOAudioEngineInputSampleOffsetKey "IOAudioEngineInputSampleOffset" + +#define kIOAudioEngineNumSampleFramesPerBufferKey "IOAudioEngineNumSampleFramesPerBuffer" + +#define kIOAudioEngineCoreAudioPlugInKey "IOAudioEngineCoreAudioPlugIn" + +#define kIOAudioEngineNumActiveUserClientsKey "IOAudioEngineNumActiveUserClients" + +#define kIOAudioEngineUserClientActiveKey "IOAudioEngineUserClientActive" + +#define kIOAudioEngineGlobalUniqueIDKey "IOAudioEngineGlobalUniqueID" + +#define kIOAudioEngineDescriptionKey "IOAudioEngineDescription" + +#define kIOAudioEngineClockIsStableKey "IOAudioEngineClockIsStable" + +#define kIOAudioEngineClockDomainKey "IOAudioEngineClockDomain" + +#define kIOAudioEngineIsHiddenKey "IOAudioEngineIsHidden" +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of fully constructed names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelNamesKey "IOAudioEngineChannelNames" + +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of category names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelCategoryNamesKey "IOAudioEngineChannelCategoryNames" + +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of number names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelNumberNamesKey "IOAudioEngineChannelNumberNames" + +#define kIOAudioEngineFullChannelNameKeyInputFormat "InputChannel%u" + +#define kIOAudioEngineFullChannelNameKeyOutputFormat "OutputChannel%u" + +#define kIOAudioEngineFlavorKey "IOAudioEngineFlavor" + +#define kIOAudioEngineAlwaysLoadCoreAudioPlugInKey "IOAudioEngineAlwaysLoadCoreAudioPlugIn" + +/*! + * @defined kIOAudioEngineInputChannelLayoutKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary describes an array of OSNumber data that describe the spatial position of each channel. See IOAudioTypes.h. + * @discussion + */ + +#ifndef __OPEN_SOURCE__ +// +#endif +#define kIOAudioEngineInputChannelLayoutKey "IOAudioEngineInputChannelLayout" + +/*! + * @defined kIOAudioEngineOutputChannelLayoutKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary describes an array of OSNumber data that describe the spatial position of each channel. See IOAudioTypes.h. + * @discussion + */ + +#ifndef __OPEN_SOURCE__ +// +#endif +#define kIOAudioEngineOutputChannelLayoutKey "IOAudioEngineOutputChannelLayout" + +/***** + * + * IOAudioStream defines + * + *****/ + + +#define kIOAudioStreamIDKey "IOAudioStreamID" +#define kIOAudioStreamDescriptionKey "IOAudioStreamDescription" +#define kIOAudioStreamNumClientsKey "IOAudioStreamNumClients" + +/*! + * @defined kIOAudioStreamDirectionKey + * @abstract The key in the IORegistry for the IOAudioStream direction attribute. + * @discussion The value for this key may be either "Output" or "Input". + */ +#define kIOAudioStreamDirectionKey "IOAudioStreamDirection" + +#define kIOAudioStreamStartingChannelIDKey "IOAudioStreamStartingChannelID" +#define kIOAudioStreamStartingChannelNumberKey "IOAudioStreamStartingChannelNumber" +#define kIOAudioStreamAvailableKey "IOAudioStreamAvailable" + +#define kIOAudioStreamFormatKey "IOAudioStreamFormat" +#define kIOAudioStreamAvailableFormatsKey "IOAudioStreamAvailableFormats" + +#define kIOAudioStreamNumChannelsKey "IOAudioStreamNumChannels" +#define kIOAudioStreamSampleFormatKey "IOAudioStreamSampleFormat" + +#define kIOAudioStreamNumericRepresentationKey "IOAudioStreamNumericRepresentation" + +#define kIOAudioStreamFormatFlagsKey "IOAudioStreamFormatFlags" +#define kIOAudioStreamFramesPerPacketKey "IOAudioStreamFramesPerPacket" +#define kIOAudioStreamBytesPerPacketKey "IOAudioStreamBytesPerPacket" + + +#define kIOAudioStreamBitDepthKey "IOAudioStreamBitDepth" +#define kIOAudioStreamBitWidthKey "IOAudioStreamBitWidth" + +#define kIOAudioStreamAlignmentKey "IOAudioStreamAlignment" + +#define kIOAudioStreamByteOrderKey "IOAudioStreamByteOrder" + +#define kIOAudioStreamIsMixableKey "IOAudioStreamIsMixable" + +#define kIOAudioStreamMinimumSampleRateKey "IOAudioStreamMinimumSampleRate" +#define kIOAudioStreamMaximumSampleRateKey "IOAudioStreamMaximumSampleRate" + +#define kIOAudioStreamDriverTagKey "IOAudioStreamDriverTag" + +#define kIOAudioStreamTerminalTypeKey "IOAudioStreamTerminalType" + +/***** + * + * IOAudioPort defines + * + *****/ + + + /*! + * @defined kIOAudioPortTypeKey + * @abstract The key in the IORegistry for the IOAudioPort type attribute. + * @discussion This is a driver-defined text attribute that may contain any type. + * Common types are defined as: "Speaker", "Headphones", "Microphone", "CD", "Line", "Digital", "Mixer", "PassThru". + */ +#define kIOAudioPortTypeKey "IOAudioPortType" + +/*! + * @defined kIOAudioPortSubTypeKey + * @abstract The key in the IORegistry for the IOAudioPort subtype attribute. + * @discussion The IOAudioPort subtype is a driver-defined text attribute designed to complement the type + * attribute. + */ +#define kIOAudioPortSubTypeKey "IOAudioPortSubType" + +/*! + * @defined kIOAudioPortNameKey + * @abstract The key in the IORegistry for the IOAudioPort name attribute. + */ +#define kIOAudioPortNameKey "IOAudioPortName" + + + +/***** + * + * IOAudioControl defines + * + *****/ + + + /*! + * @defined kIOAudioControlTypeKey + * @abstract The key in the IORegistry for the IOAudioCntrol type attribute. + * @discussion The value of this text attribute may be defined by the driver, however system-defined + * types recognized by the upper-level software are "Level", "Mute", "Selector". + */ +#define kIOAudioControlTypeKey "IOAudioControlType" + +#define kIOAudioControlSubTypeKey "IOAudioControlSubType" + +#define kIOAudioControlUsageKey "IOAudioControlUsage" + +#define kIOAudioControlIDKey "IOAudioControlID" + +/*! + * @defined kIOAudioControlChannelIDKey + * @abstract The key in the IORegistry for the IOAudioControl channel ID attribute + * @discussion The value for this key is an integer which may be driver defined. Default values for + * common channel types are provided in the following defines. + */ +#define kIOAudioControlChannelIDKey "IOAudioControlChannelID" + +#define kIOAudioControlChannelNumberKey "IOAudioControlChannelNumber" + +#define kIOAudioControlCoreAudioPropertyIDKey "IOAudioControlCoreAudioPropertyID" +/*! + * @defined kIOAudioControlChannelNameKey + * @abstract The key in the IORegistry for the IOAudioControl name attribute. + * @discussion This name should be a human-readable name for the channel(s) represented by the port. + * *** NOTE *** We really need to make all of the human-readable attributes that have potential to + * be used in a GUI localizable. There will need to be localized strings in the kext bundle matching + * the text. + */ +#define kIOAudioControlChannelNameKey "IOAudioControlChannelName" + +/*! + * @defined kIOAudioControlChannelNameAll + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for all channels. + */ +#define kIOAudioControlChannelNameAll "All Channels" + +/*! + * @defined kIOAudioControlChannelNameLeft + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the left channel. + */ +#define kIOAudioControlChannelNameLeft "Left" + +/*! + * @defined kIOAudioControlChannelNameRight + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the right channel. + */ +#define kIOAudioControlChannelNameRight "Right" + +/*! + * @defined kIOAudioControlChannelNameCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the center channel. + */ +#define kIOAudioControlChannelNameCenter "Center" + +/*! + * @defined kIOAudioControlChannelNameLeftRear + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the left rear channel. + */ +#define kIOAudioControlChannelNameLeftRear "LeftRear" + +/*! + * @defined kIOAudioControlChannelNameRightRear + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the right rear channel. + */ +#define kIOAudioControlChannelNameRightRear "RightRear" + +/*! + * @defined kIOAudioControlChannelNameSub + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the sub/LFE channel. + */ +#define kIOAudioControlChannelNameSub "Sub" + +/*! + * @defined kIOAudioControlChannelNameFrontLeftCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the FrontLeftCenter channel. + */ +#define kIOAudioControlChannelNameFrontLeftCenter "FrontLeftCenter" + +/*! + * @defined kIOAudioControlChannelNameFrontRightCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the FrontRightCenter channel. + */ +#define kIOAudioControlChannelNameFrontRightCenter "FrontRightCenter" + +/*! + * @defined kIOAudioControlChannelNameRearCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the RearCenter channel. + */ +#define kIOAudioControlChannelNameRearCenter "RearCenter" + +/*! + * @defined kIOAudioControlChannelNameSurroundLeft + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the SurroundLeft channel. + */ +#define kIOAudioControlChannelNameSurroundLeft "SurroundLeft" + +/*! + * @defined kIOAudioControlChannelNameSurroundRight + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the SurroundRight channel. + */ +#define kIOAudioControlChannelNameSurroundRight "SurroundRight" + + +/*! + * @defined kIOAudioControlValueKey + * @abstract The key in the IORegistry for the IOAudioControl value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the current value of the IOAudioControl. + */ +#define kIOAudioControlValueKey "IOAudioControlValue" + +/*! + * @defined kIOAudioControlValueIsReadOnlyKey + * @abstract The key in the IORegistry for the IOAudioControl value-is-read-only attribute. + * @discussion The value returned by this key is a 32-bit integer but the value doesn't have any direct meaning. + * Instead, the presence of this key indicates that the value for the control is read-only + */ +#define kIOAudioControlValueIsReadOnlyKey "IOAudioControlValueIsReadOnly" + +/*! + * @defined kIOAudioLevelControlMinValueKey + * @abstract The key in the IORegistry for the IOAudioControl minimum value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the minimum value for the IOAudioControl. + * This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum + * value. + */ +#define kIOAudioLevelControlMinValueKey "IOAudioLevelControlMinValue" + +/*! + * @defined kIOAudioLevelControlMaxValueKey + * @abstract The key in the IORegistry for the IOAudioControl maximum value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the maximum value for the IOAudioControl. + * This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum + * value. + */ +#define kIOAudioLevelControlMaxValueKey "IOAudioLevelControlMaxValue" + +/*! + * @defined kIOAudioLevelControlMinDBKey + * @abstract The key in the IORgistry for the IOAudioControl minimum db value attribute. + * @discussion The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit + * integer. It represents the minimum value in db for the IOAudioControl. This value matches the minimum + * value attribute. This is currently valid for Level controls or other driver-defined controls that have a + * minimum and maximum db value. + */ +#define kIOAudioLevelControlMinDBKey "IOAudioLevelControlMinDB" + +/*! + * @defined kIOAudioLevelControlMaxDBKey + * @abstract The key in the IORgistry for the IOAudioControl maximum db value attribute. + * @discussion The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit + * integer. It represents the maximum value in db for the IOAudioControl. This value matches the maximum + * value attribute. This is currently valid for Level controls or other driver-defined controls that have a + * minimum and maximum db value. + */ +#define kIOAudioLevelControlMaxDBKey "IOAudioLevelControlMaxDB" + +#define kIOAudioLevelControlRangesKey "IOAudioLevelControlRanges" + +#define kIOAudioLevelControlUseLinearScale "IOAudioLevelControlUseLinearScale" + +#define kIOAudioSelectorControlAvailableSelectionsKey "IOAudioSelectorControlAvailableSelections" +#define kIOAudioSelectorControlSelectionValueKey "IOAudioSelectorControlSelectionValue" +#define kIOAudioSelectorControlSelectionDescriptionKey "IOAudioSelectorControlSelectionDescriptionKey" + +#define kIOAudioSelectorControlClockSourceKey "IOAudioSelectorControlClockSourceKey" + +#endif /* _IOAUDIODEFINES_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioDevice.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioDevice.h.svn-base new file mode 100644 index 0000000..6d55147 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioDevice.h.svn-base @@ -0,0 +1,749 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOAudioDevice + */ + +#ifndef _IOKIT_IOAUDIODEVICE_H +#define _IOKIT_IOAUDIODEVICE_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioTypes.h" +#include "IOAudioStream.h" +#endif + +class IOAudioEngine; +class IOAudioStream; +class IOAudioPort; +class IOAudioControl; +class OSDictionary; +class OSSet; +class OSArray; +class IOTimerEventSource; +class IOCommandGate; + +/*! + * enum IOAudioDevicePowerState + * @abstract Identifies the power state of the audio device + * @discussion A newly created IOAudioDevices defaults to the idle state. + * @constant kIOAudioDeviceSleep State set when the system is going to sleep + * @constant kIOAudioDeviceIdle State when the system is awake but none of the IOAudioEngines are in use + * @constant kIOAudioDeviceActive State when one ore more IOAudioEngines are in use. This state transition must complete before the system will begin playing audio. + */ +typedef enum _IOAudioDevicePowerState { + kIOAudioDeviceSleep = 0, // When sleeping + kIOAudioDeviceIdle = 1, // When no audio engines running + kIOAudioDeviceActive = 2 // audio engines running +} IOAudioDevicePowerState; + +/*! + * @class IOAudioDevice + * @abstract Abstract base class for a single piece of audio hardware. The IOAudioDevice provides + * the central coordination point for an audio driver. + * @discussion An audio driver is required to subclass IOAudioDevice in order to provide + * working audio to the system. A single driver instance will contain a single instance of the + * driver's IOAudioDevice subclass. The subclass is responsible for mapping all hardware device + * resources from the service provider nub. It must control access to the hardware so that the + * hardware doesn't get into an inconsistent state. It is possible that different threads may make + * requests of the hardware at the same time. The IOAudioDevice superclass provides an IOWorkLoop + * and IOCommandGate on the IOWorkLoop through which all hardware accesses may be synchronized. + * All entry points to all parts of the driver controlled by the IOAudioFamily will be synchronized + * through this one IOWorkLoop. + * + * The IOAudioDevice subclass is responsible for creating the rest of the pieces of the driver. + * It must identify and create all IOAudioEngines that are not automatically created by the system + * (i.e. those that are not matched and instantiated by IOKit directly). + * + * The IOAudioDevice subclass must enumerate and create all IOAudioControls to match + * the device capabilities. + * + * It must also execute control value chages when requested by the system (i.e. volume adjustments). + * + * In order to allow sleep and wake to work on the system, the IOAudioDevice subclass is responsible + * for performing the necessary actions to sleep and wake its hardware (and restore necessary state + * on wake). + * + * The IOAudioDevice class provides timer services that allow different elements in the audio driver + * to receive timer notifications as needed. These services were designed with the idea that most + * timed events in a typical audio driver need to be done at least as often as a certain interval. + * Further, it is designed with the idea that being called more often than the specified interval + * doesn't hurt anything - and in fact may help. With this in mind, the timer services provided + * by the IOAudioDevice class allow different targets to register for timer callbacks at least as + * often as the specified interval. The actual interval will be the smallest of the intervals of + * all of the callbacks. This way, we avoid the overhead of having many timers in a single audio + * device. As an example, each output IOAudioEngine has a timer to run the erase head. It doesn't hurt + * to have the erase head run more often. Also, a typical IOAudioDevice subclass may need to run a timer + * to check for device state changes (e.g. jack insertions). + * + * There are a number of strings passed from the driver to the CoreAudio.framework and then into + * applications. All of those strings should be localized by the driver. In order to do that + * the kext bundle should have localized string files following the Mac OS X localization + * instructions. The IOAudioDevice should contain a property with the name of the bundle/kext + * that contains the localized string resources. To do that, the driver's personality in + * the bundle resources could have a property named 'IOAudioDeviceLocalizedBundle' with the path + * of the bundle/kext relative to '/System/Library/Extensions'. It could also be set by the + * IOAudioDevice subclass in its initHardware() function. To do so, call + * setProperty(kIOAudioDeviceLocalizedBundleKey, "Driver.kext"). + * + * In a typical driver, the IOAudioDevice subclass will implement initHardware() to perform the + * hardware initialization and driver construction. Within that initialization it must create at + * least one IOAudioEngine instance and activate it. In order to activate a new IOAudioEngine + * activateAudioEngine() should be called for each one. It must create the IOAudioControls + * matching the hardware capabilities to allow the system to set volume, mute and input selection. + * To add those controls to the driver, each control should be attached to the IOAudioEngine to + * which it applies by calling addDefaultAudioControl() on the IOAudioEngine. + * During initialization it should also call setDeviceName(), setDeviceShortName() and + * setManufacturerName() with localized strings representing each of the attributes. + * + * If the driver is to work properly after sleep/wake, it must implement performPowerStateChange() + * and deal with the sleep and wake transitions. It may also deal with the idle state transitions + * to turn off device power when it isn't in use (especially useful for devices attached to a + * portable running on battery power). + */ + +class IOAudioDevice : public IOService +{ + friend class IOAudioEngine; + + OSDeclareDefaultStructors(IOAudioDevice) + +protected: + /*! @var workLoop The IOWorkLoop for the driver - this is shared with the other objects in the driver */ + IOWorkLoop *workLoop; + /*! @var commandGate The IOCommandGate for this IOAudioDevice. It is attached to workLoop */ + IOCommandGate *commandGate; + /*! @var timerEventSource An IOTimerEventSource attached to workLoop used for the timer services */ + IOTimerEventSource *timerEventSource; + + /*! @var duringStartup State variable set to true while the driver is starting up and false all other times */ + bool duringStartup; + /*! @var familyManagePower Set to true if the family is supposed to manage power - this is the default state. It can be changed early in the initialization process with a call to setFamilyManagePower(). */ + bool familyManagePower; + /*! @var asyncPowerStateChangeInProgress Set to true while an asynchronous power change is pending and false all other times. */ + bool asyncPowerStateChangeInProgress; + + /*! @var numRunningAudioEngines The number of running IOAudioEngines. This is used to maintain idle vs active power state. */ + UInt32 numRunningAudioEngines; + + /*! @var currentPowerState Used to track the existing power state - can be fetched by calling getPowerState() */ + IOAudioDevicePowerState currentPowerState; + /*! @var pendingPowerState If a power state change is in progress, this represents the pending power state. All other times this is the same as the currentPowerState. */ + IOAudioDevicePowerState pendingPowerState; + + /*! @var audioEngines The set of IOAudioEngine objects vended by the IOAudioDevice. */ + OSArray * audioEngines; + /*! @var timerEvents The set of timer events in use by the device. + * @discussion The key for the dictionary is the target of the event. This means that a single target may + * have only a single event associated with it. + */ + OSDictionary * timerEvents; + /*! @var audioPorts The set of IOAudioPort objects associated with the IOAudioDevice */ + OSSet * audioPorts; + + /*! @var minimumInterval The smallest timer interval requested by all timer event targets. */ + AbsoluteTime minimumInterval; + /*! @var previousTimerFire The time of the last timer event. + * @discussion This is used to schedule the next timer event. + */ + AbsoluteTime previousTimerFire; + +public: + /*! @var gIOAudioPlane A static IORegistryPlane representing the new IOAudioPlane that the IOAudioFamily uses + * to represent the signal chain of the device. + */ + static const IORegistryPlane *gIOAudioPlane; + +protected: + struct ExpansionData { + unsigned long long idleSleepDelayTime; + IOTimerEventSource * idleTimer; + }; + + ExpansionData *reserved; + +public: + static void idleAudioSleepHandlerTimer(OSObject *owner, IOTimerEventSource *sender); + virtual IOReturn setAggressiveness(unsigned long type, unsigned long newLevel); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 0); + virtual void setDeviceTransportType(const UInt32 transportType); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 1); + /*! + * @function setIdleAudioSleepTime + * @abstract This function is to be called by a driver that doesn't want to be told about the audio + * going idle immediately, but at some point in the future. + * @discussion This is useful if the device will want to power down its hardware into an idle sleep + * state, but doesn't want to do that unless audio hasn't been used for a while. Calling this function + * immediately changes the idle sleep timer and queues it up if the idle is different from the previous + * idle time. The idle time defaults to 0, which means be called immediately (backwards compatible with + * previous versions of IOAudioFamily). A value of 0xffffffffffffffffULL means don't ever tell the + * driver about going idle. + * @param sleepDelay The amount of time, in nanoseconds, before the hardware should be told to go idle. + */ + virtual void setIdleAudioSleepTime(unsigned long long sleepDelay); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 2); + virtual void scheduleIdleAudioSleep(void); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 3); + /*! + * @function setConfigurationApplicationBundle + * @abstract This function is to be called if an external configuration application is available to set + * which application to launch. + * @discussion This is useful for device drivers that are too complex to be represented by the Sound Preferences + * panel. The bundle ID is a more flexible way of specifying where the application is than a hard coded path. + * @param bundleID The bundle ID of the application to be launched by the HAL for configuration of the device and its engine(s). + */ + virtual void setConfigurationApplicationBundle(const char *bundleID); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 4); + /*! + * @function setDeviceCanBeDefault + * @abstract This function is to be called to tell CoreAudio if this device shouldn't be a default device. + * @discussion This is useful for device drivers that don't want to be a default device. Can be called with + * kIOAudioDeviceCanBeDefaultNothing to prevent CoreAudio from allowing this device to be any default device, or it + * can be called with any combination of kIOAudioDeviceCanBeDefaultInput, kIOAudioDeviceCanBeDefaultOutput, or + * kIOAudioDeviceCanBeSystemOutput. The default is + * (kIOAudioDeviceCanBeDefaultInput | kIOAudioDeviceCanBeDefaultOutput | kIOAudioDeviceCanBeSystemOutput). + * @param defaultsFlags The flags to instruct CoreAudio to allow this device to be only the indicated default devices. + */ + virtual void setDeviceCanBeDefault(UInt32 defaultsFlags); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 5); + virtual void setDeviceModelName(const char * modelName); + +private: + OSMetaClassDeclareReservedUsed(IOAudioDevice, 0); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 1); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 2); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 3); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 4); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 5); + + OSMetaClassDeclareReservedUnused(IOAudioDevice, 6); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 7); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 8); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 9); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 10); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 11); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 12); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 13); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 14); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 15); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 16); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 17); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 18); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 19); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 20); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 21); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 22); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 23); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 24); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 25); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 26); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 27); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 28); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 29); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 30); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 31); + + +public: + // Initialization + + /*! + * @function init + * @abstract Initialize a newly created instance of IOAudioDevice. + * @discussion This implementation initializes all of the data structures and variables used by the + * IOAudioDevice. The currentPowerState and pendingPowerState variables are set to kIOAudioDeviceIdle. + * A subclass that overrides this method must call the superclass' implementation. + * @param properties An OSDictionary of the device properties that gets passed to super::init and set + * in the IORegistry. + * @result true if initialization was successful + */ + virtual bool init(OSDictionary *properties); + + /*! + * @function free + * @abstract Frees resources used by the IOAudioDevice instance + * @discussion This method will deactivate all audio audio engines and release the audioEngines OSSet. + * It will also deactivate all of the audio ports and release the audioPorts OSSet. It will release + * the timerEvents OSDictionary as well as cancel any outstanding timer callbacks. It will clean up + * all of the event sources and the workLoop. + * + * Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + + virtual void free(); + + /*! + * @function start + * @abstract This function is called automatically by the system to tell the driver to start vending + * services to the rest of the system. + * @discussion The start() implementation in IOAudioDevice starts by calling start() on its superclass. + * It then calls initHardware() which the subclass should override to properly initialize itself and + * the hardware. If that call succeeds, it sets up power management if the family is supposed to + * manage power (checking the familyManagePower variable). Then finally it calls registerService() + * to make the IOAudioDevice visible in the IORegistry. + * @param provider This is the service provider nub that provides access to the hardware resources. + * @result Returns true on success + */ + virtual bool start(IOService *provider); + + /*! + * @function stop + * @abstract This is responsible for stopping the device after the system is done with it (or + * if the device is removed from the system). + * @discussion The IOAudioDevice implentation of stop() disables the timer services, deactivates + * all of the audio audio engines and audio ports and stops power management of the device. + * The audio engine and port deactivation causes all of the audio engines to get stopped and + * all of the audio engine and port resources and objects to be released. A subclass' implementation + * may could shut down hardware here if necessary. If this function is overridden by a subclass, + * the superclass' implementation must be called. + * @param The service provider nub for the device. + */ + virtual void stop(IOService *provider); + virtual bool willTerminate(IOService *provider, IOOptionBits options); + + /*! + * @function initHardware + * @abstract This function is called by start() to provide a convenient place for the subclass to + * perform its initialization. + * @discussion In a typical implementation, a driver would implementation this function and perform + * a number of tasks. Those include mapping hardware resources, initializing the hardware to a known + * state, creating the IOAudioEngines, IOAudioControls and IOAudioStreams. Additionally it + * should also call setDeviceName(), setDeviceShortName(), setManufacturerName(). Upon return of + * this function, the device should be ready to begin vending services to the system. + * @param provider The service provider nub for the device. + * @result This function should return true on a successful initialization. + */ + virtual bool initHardware(IOService *provider); + + /*! + * @function setDeviceName + * @abstract Sets the name of the device + * @discussion This method should be called during initialization or startup. It should + * be set by the time initHardware() completes. The device name is used by the + * CoreAudio.framework to identify the particular piece of hardware. This string should + * should be localized by the driver. + */ + virtual void setDeviceName(const char *deviceName); + + /*! + * @function setDeviceShortName + * @abstract Sets the short name of the device + * @discussion The short name is a shorter representation of the device name. It may be used + * by applications when the device name is too long. It should be set by the time initHardware() + * completes. The string should be localized by the driver. + */ + virtual void setDeviceShortName(const char *shortName); + + /*! + * @function setManufacturerName + * @abstract Sets the manufacturer name of the device + * @discussion This method should be called during initialization or startup. This should be + * called by the time initHardware() completes. The string should be localized by the driver. + */ + virtual void setManufacturerName(const char *manufacturerName); + + + // IOWorkLoop, IOCommandGate management + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the driver + * @discussion The IOWorkLoop is used to synchronized all critical aspects of the driver. This + * includes all entry points to the driver as well as power management. + */ + virtual IOWorkLoop *getWorkLoop() const; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioDevice + * @discussion This IOCommandGate allows calls into this IOAudioDevice to be synchronized on + * the IOWorkLoop. + */ + virtual IOCommandGate *getCommandGate() const; + + + // IOAudioEngine management + + /*! + * @function activateAudioEngine + * @abstract This simply calls activateAudioEngine(IOAudioEngine *audioEngine, + * bool shouldStartAudioEngine) with a value of true for shouldStartAudioEngine. + * @param audioEngine The IOAudioEngine instance to be activated. It is treated as a newly + * allocated instance. + * @result Returns true if the audio engine was successfully activated. + */ + virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine); + + /*! + * @function activateAudioEngine + * @abstract This is called to add a new IOAudioEngine object to the IOAudioDevice. + * @discussion Once the IOAudioEngine has been activated by this function, it is ready + * to begin moving audio data. This should be called either during the subclass' initHardware() + * implementation for each IOAudioEngine the device creates. Or it should be called by + * the IOAudioEngine itself if the audio engine was automatically created by IOKit's matching + * process. The system won't be able to properly track and control IOAudioEngines if + * they are not activated though this function. + * This implementation will retain the IOAudioEngine while it maintains control of it. + * When the audio engine is deactivated, the IOAudioEngine will be released. If the + * IOAudioDevice subclass is passing a newly instantiated IOAudioEngine, it will need to release + * the audio engine after it has been activated. This will insure that the refCount on the audio engine + * is correct when it gets deactivated when the driver is stopped. That allows the audio engine to be + * freed when it is no longer needed. + * @param audioEngine The IOAudioEngine instance to be activated. + * @param shouldStartAudioEngine If true, the audio engine is treated as a newly allocated IOAudioEngine + * instance and is appropriately attached and started according to IOKit convention. If it is false + * it is assumed that some other process (possibly the IOKit matching process) has started the + * IOAudioEngine and will skip that step. + * @result Returns true if the audio engine was successfully activated. + */ + virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine, bool shouldStartAudioEngine); + + /*! + * @function deactivateAllAudioEngines + * @abstract Deactivates all of the audio engines in the device. + * @discussion This is called by the stop() and free() methods in IOAudioDevice to completely + * shut down all audio engines as the driver is being shut down. + */ + virtual void deactivateAllAudioEngines(); + + + // Power management + + /*! + * @function setFamilyManagePower + * @abstract Called set whether or not the family should manage the device power throught the + * IOService power management APIs. + * @discussion The default behavior is for the family to manage power. It is only necessary to + * call this function if the driver does not want the family to manage power. It is not + * recommended that this function be called because it makes power management much more + * difficult for the driver. If this function is to be called, it must be called before + * initHardware() completes. Immediately after initHardware() is called by start(), + * the power management system is initialized if the family is to manage power. + * @param manage Set to false if it is not desired that the family does the power management + */ + virtual void setFamilyManagePower(bool manage); + + /*! + * @function setPowerState + * @abstract Called by the power management system in IOService when the power state of this + * service needs to change. + * @discussion The default implementation of IOAudioDevice sets up two power states for IOService + * to use. State 0 is sleep and state 1 is wake. This function should not be called directly. + * It is only supposed to be used by the IOService power management services. + * @param powerStateOrdinal The number of the power state as defined by the IOAudioDevice - + * 0 for sleep, 1 for wake. + * @param device The power management policy maker. + * @result Returns kIOPMAckImplied (0) when the power state change is complete. Otherwise the an + * upper bound on the number of microseconds until the state change is complete is returned. + */ + virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *device); + + /*! + * @function setPowerStateAction + * @abstract IOCommandGate Action which calls protectedSetPowerState() while holding the IOCommandGate + * @discussion This is needed to allow protectedSetPowerState() to be called on the IOWorkLoop + * @param owner The owner of the IOCommandGate (the IOAudioDevice in this case) + * @param arg1 The powerStateOrdinal to be passed to protectedSetPowerState() + * @param arg2 The device to be passed to protectedSetPowerState() + * @result Returns the result of protectedSetPowerState() + */ + static IOReturn setPowerStateAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + /*! + * @function protectedSetPowerState + * @abstract Called by setPowerStateAction() to deal with a power state change from the IOService + * power management facility. + * @discussion This function is responsible for performing the necessary sleep and wake tasks + * when the system is sleeping or waking. If an outstanding power state change is in progress, + * it will wait until the state changes has completed. While sleeping, all audio engines are + * stopped before calling initiatePowerStateChange() to call performPowerStateChange() to let + * the driver deal with the sleep request. When waking, it determines if the device should be + * idle or active and continues to call initiatePowerStateChange(). If initiatePowerStateChange() + * indicates that the power state change is occuring asynchronously, it returns the number of + * microseconds. This function must be called on the IOWorkLoop, but should not be called + * directly. + * @param powerStateOrdinal Param passed to setPowerState() - 0 for sleep, 1 for wake + * @param device Param passed to setPowerState - the device initiating the power state change + * @result Returns 0 if the power state change is complete - the number of microseconds until + * complete if its asynchronous. + */ + virtual IOReturn protectedSetPowerState(unsigned long powerStateOrdinal, IOService *device); + + /*! + * @function performPowerStateChange + * @abstract This function is called by the IOAudioDevice when a power state change is needed. + * @discussion In order to deal with power state changes, a subclass must override this function. + * Any combination of old and new power states may be passed to this function. If work is to + * be performed while transitioning to sleep, check for a newPowerState of kIOAudioDeviceSleep. + * If work is to be performed while transitioning from sleep, check for an oldPowerState of + * kIOAudioDeviceSleep. A power state of kIOAudioDeviceIdle means the system is awake, but + * no clients are currently playing or recording audio (i.e. no IOAudioEngines are active). + * A power state of kIOAudioDeviceActive means that at least one IOAudioEngine is active. + * It is possible for a power state change to be performed synchronously or asynchronously. + * In the case of a synchronous power state change, simple leave microsecondsUntilComplete + * alone and return kIOReturnSuccess. If an asynchronous power state change is needed the + * driver should do whatever needed to schedule another thread to finish the state change + * and set the microsecondsUntilComplete to an upper bound on the amount of time it will + * take to complete the power state change. Then when the power state change is complete, + * a call must be made to completePowerStateChange(). During an asynchronous power state + * change, the current power state will remain the same as before the transition began, + * and the pendingPowerState is set to the new power state that will be set when the + * change is complete. + * @param oldPowerState The power state before the power state change + * @param newPowerState The power state being transitioned to + * @param microsecondsUntilComplete A pointer to a value representing an upper bound on + * the number of microseconds to complete an asynchronous power state change. It points + * to a value of zero at the start and if it remains zero, the state change is complete + * upon a successful return from the function. + * @result Returns kIOReturnSuccess on a successful completion + */ + virtual IOReturn performPowerStateChange(IOAudioDevicePowerState oldPowerState, + IOAudioDevicePowerState newPowerState, + UInt32 *microsecondsUntilComplete); + + /*! + * @function completePowerStateChange + * @abstract Called when a power state change is complete + * @discussion In the case of an asynchronous power state change, a subclass is responsible + * for calling this function. It is safe to call this function if not on the IOWorkLoop. + * This function calls protectedCompletePowerStateChange() through the IOCommandGate and + * completePowerStateChangeAction(). If the call is already on the IOWorkLoop, it is safe + * to call protectedCompletePowerStateChange() directly. + * @result Returns kIOReturnSuccess on a successful completion + */ + virtual IOReturn completePowerStateChange(); + + /*! + * @function completePowerStateChangeAction + * @abstract IOCommandGate Action which calls protectedCompletePowerStateChange() while holding the + * IOCommandGate. + * @discussion This is needed to allow protectedCompletePowerStateChange() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioDevice in this case) + * @result Returns the result of protectedCompletePowerStateChange() + */ + static IOReturn completePowerStateChangeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + /*! + * @function protectedCompletePowerStateChange() + * @abstract Called on the IOWorkLoop when a power state change is complete. + * @discussion This function does the work to complete a power state change (both synchronous and + * asynchronous). If the system is waking from sleep, the timer system is restarted and the + * audio engines are resumed. If this was called as a result of an asynchronous power state changed + * it makes the IOService power management call acknowledgePowerChange() and resets the + * asyncPowerStateChangeInProgress variable. Finally it sets the currentPowerState to the + * pendingPowerState. This function must be called on the IOWorkLoop. If a subclass is not + * on the IOWorkLoop (e.g. holding the IOCommandGate), call completePowerStateChange() instead. + * @result Returns kIOReturnSuccess on success + */ + virtual IOReturn protectedCompletePowerStateChange(); + + /*! + * @function getPowerState + * @abstract Returns the current power state (the old power state if a change is in progress). + * @result The current power state + */ + virtual IOAudioDevicePowerState getPowerState(); + + /*! + * @function getPendingPowerState + * @abstract Returns the pending power state if a state change is in progress. Otherwise it + * returns the current power state change. + * @result The pending power state + */ + virtual IOAudioDevicePowerState getPendingPowerState(); + + /*! + * @function waitForPendingPowerStateChange + * @abstract Called internally to wait until a pending power state change is complete. + * @discussion This is only used by internal functions to wait during pending power + * state changes. It is used to prevent multiple power state changes at the same time. + * This function must be called while holding the IOCommandGate. If an asynchronous + * power state change is in progress this function will block until the state change + * if complete. Once complete, it will return while still holding the IOCommandGate. + */ + virtual void waitForPendingPowerStateChange(); + + /*! + * @function initiatePowerStateChange + * @abstract Called internally to execute a power state change + * @discussion This function must be called on the IOWorkLoop. It calls performPowerStateChange() + * to let the driver process the state change. If the state change is completed synchronously + * by the driver (subclass) it calls protectedCompletePowerStateChange(). If done asynchronously + * it returns the microsecondsUntilComplete that was set by performPowerStateChange(). This + * function should not be called directly. + * @param microsecondsUntilComplete Pointer to the microsecondsUntilComplete that should be set + * by performPowerStateChange if an asynchronous power state change was started. + * @result Returns kIOReturnSuccess on success + */ + virtual IOReturn initiatePowerStateChange(UInt32 *microsecondsUntilComplete = NULL); + + + // IOAudioControl management + + /*! + * @function flushAudioControls + * @abstract Forces each IOAudioControl in the driver to have its value flushed out to the hardware. + * That will cause either the IOAudioControl's ValueChangeHandler to be called. + * @discussion This can be used to force the hardware to get updated with the current value + * of each control. It may be useful during wake for example. + */ + virtual void flushAudioControls(); + + + // Timer services + + /*! + * @typedef TimerEvent + * @abstract Generic timer event callback for IOAudioDevice timer targets + * @discussion TimerEvent callback function takes two arguments; the target of + * the timer event and the IOAudioDevice sending the event. + * @param target The target of the timer event - passed in when the timer event was registered + * @param audioDevice The IOAudioDevice sending the event + */ + typedef void (*TimerEvent)(OSObject *target, IOAudioDevice *audioDevice); + + /*! + * @function addTimerEvent + * @abstract Adds a TimerEvent callback for the given target called at least as often + * as specified in interval. + * @discussion The frequency of the timer event callbacks will be the smallest interval + * specified by all targets. Only one interval and callback may be specified per target. + * If a addTimerEvent is called twice with the same target, the second one overrides the + * first. There is currently a bug triggered if the first call had the smallest interval. + * In that case, that smallest interval would still be used. + * @param target This parameter is the target object of the TimerEvent. + * @param event The callback function called each time the timer fires. + * @param interval The callback will be called at least this often. + * @result Returns kIOReturnSuccess if the timer event was successfully added. + */ + virtual IOReturn addTimerEvent(OSObject *target, TimerEvent event, AbsoluteTime interval); + + /*! + * @function removeTimerEvent + * @abstract Removes the timer event for the given target. + * @discussion If the interval for the target to be removed is the smallest interval, + * the timer interval is recalculated based on the remaining targets. The next fire + * time is readjusted based on the new interval compared to the last fire time. + * @param target The target whose timer event will be removed. + */ + virtual void removeTimerEvent(OSObject *target); + + /*! + * @function removeAllTimerEvents + * @abstract Removes all timer events and stops the timer + * @discussion Called during teardown of the driver + */ + virtual void removeAllTimerEvents(); + + + // IOAudioPort management + + /*! + * @function attachAudioPort + * @abstract Adds the port to the IOAudioDevice's list of ports and attaches the port to its parent + * and attaches the child to the port. + * @discussion This function provides the functionality to represent the device's signal chain in the + * IOAudioPlane in the IORegistry. An IOAudioPort's parent(s) are before it in the signal chain + * and its children are after it. This method may be called multiple times for a single IOAudioPort. + * This is necessary when there are many children or parents. Once a relationship is made, it is not + * necessary to make the reverse relationship. A NULL value may be passed in for either the parent + * or child or both. + * The IOAudioPort passed in should be a newly allocated IOAudioPort instance. This function will + * appropriately attach and start the port object. NOTE: It is not necessary to use IOAudioPorts + * in a fully functional audio driver. + * @param port The newly created IOAudioPort instance to be activated. + * @param parent A parent IOAudioPort or IOAudioEngine of the given port. + * @param child A child IOAudioPort or IOAudioEngine of the given port. + * @result Returns true when the port has been successfully added and attached. + */ + virtual IOReturn attachAudioPort(IOAudioPort *port, IORegistryEntry *parent, IORegistryEntry *child); + + /*! + * @function detachAllAudioPorts + * @abstract Deactivates all of the ports in the device. + * @discussion This is called by the stop() and free() methods in IOAudioDevice to completely + * shut down all ports as the driver is being shut down. + */ + virtual void detachAllAudioPorts(); + +protected: + /*! + * @function timerFired + * @abstract Internal static function called when the timer fires. + * @discussion This function simply calls dispatchTimerEvents() on the IOAudioDevice to do just that. + * @param target The IOAudioDevice instance that initiated the timer callback. + * @param sender The IOTimerEventSources calling this callback + */ + static void timerFired(OSObject *target, IOTimerEventSource *sender); + + /*! + * @function dispatchTimerEvents + * @abstract Called by timerFired() to cause the timer event callbacks to be called. + * @discussion This method iterates through all of the timer event targets and calls + * the callback on each. Unless the force flag is set to true, the timer events will + * only be dispatched if the power state is not kIOAudioDeviceSleep. This prevents + * unexpected timer firings while making wake->sleep->wake transitions. This function must + * be called on the IOWorkLoop. + * @function force A bool param to allow the timer events to be dispatched even if the + * device is in the kIOAudioDeviceSleep power state. + */ + virtual void dispatchTimerEvents(bool force); + + /*! + * @function audioEngineStarting + * @abstract Called by IOAudioEngine when it is starting up + * @discussion This should only be called while on the IOWorkLoop. It is not intended to be called + * directly. It is called when an IOAudioEngine is starting up to allow the IOAudioDevice + * to keep track of running audio engines and change the power state from kIOAudioDeviceIdle to + * kIOAudioDeviceActive when the first audio engine starts up. If the state change is done + * asynchronously, it waits for the state change to complete. This is to ensure that the + * system doesn't start playing audio until the IOAudioDevice has completed its transition + * to kIOAudioDeviceActive. + */ + virtual void audioEngineStarting(); + + /*! + * @function audioEngineStopped + * @abstract Called by IOAudioEngine when it has stopped + * @discussion This should only be called while on the IOWorkLoop. It is not intended to be called + * directly. It is called when an IOAudioEngine has stopped to allow the IOAudioDevice + * to keep track of running audio engines and change the power state from kIOAudioDeviceActive + * to kIOAudioDeviceIdle when the last audio engine stops. If the state change is done + * asynchronously, it waits for the state change to complete. + */ + virtual void audioEngineStopped(); + +}; + +#endif /* _IOKIT_IOAUDIODEVICE_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioEngine.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioEngine.h.svn-base new file mode 100644 index 0000000..19477b5 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioEngine.h.svn-base @@ -0,0 +1,865 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOAudioEngine + */ + +#ifndef _IOKIT_IOAUDIOENGINE_H +#define _IOKIT_IOAUDIOENGINE_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioTypes.h" +#endif +#include + +class OSDictionary; +class OSCollection; +class OSOrderedSet; +class IOAudioEngineUserClient; +class IOAudioDevice; +class IOAudioStream; +class IOAudioControl; +class IOCommandGate; + +#define IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER 4 + +/*! + * @typedef IOAudioEnginePosition + * @abstract Represents a position in an audio audio engine. + * @discussion This position is based on the sample frame within a + * loop around the sample buffer, and the loop count which starts at 0 when the audio engine + * begins playback. + * @field fSampleFrame The sample frame within the buffer - starts at 0. + * @field fLoopCount The number of times the ring buffer has looped. + */ +typedef struct { + UInt32 fSampleFrame; + UInt32 fLoopCount; +} IOAudioEnginePosition; + +#define CMP_IOAUDIOENGINEPOSITION(p1, p2) \ + (((p1)->fLoopCount > (p2)->fLoopCount) ? 1 : \ + ((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame > (p2)->fSampleFrame) ? 1 : \ + ((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame == (p2)->fSampleFrame) ? 0 : -1) + +#define IOAUDIOENGINEPOSITION_IS_ZERO(p1) (((p1)->fLoopCount == 0) && ((p1)->fSampleFrame == 0)) + +/*! + * @class IOAudioEngine + * @abstract Abstract base class for a single audio audio / I/O engine. + * @discussion An IOAudioEngine is defined by a single I/O engine to transfer data to + * or from one or more sample buffers. Each sample buffer is represented by a single IOAudioStream + * instance. A single IOAudioEngine must contain at least one IOAudioStream, but has no upper + * limit on the number of IOAudioStreams it may contain. An IOAudioEngine instance may contain + * both input and output IOAudioStreams. + * + * An audio driver must subclass IOAudioEngine in order to provide certain services. An + * IOAudioEngine subclass must start and stop the I/O engine when requested. The I/O + * engine should be continuously running and loop around from end to beginning. While the audio + * engine is running, it must take a timestamp as the sample buffer(s) wrap around and start at + * the beginning. The CoreAudio.framework uses the timestamp to calculate the exact position of + * the audio engine. An IOAudioEngine subclass must implement getCurrentSampleFrame() to provide + * a sample position on demand. Finally, an IOAudioEngine subclass must provide clipping and + * format conversion routines to go to/from the CoreAudio.framework's native float format. + * + * If multiple stream formats or sample rates are allowed, the IOAudioEngine + * subclass must provide support for changing the hardware when a format or sample rate is + * changed. + * + * There are several attributes associated with a single IOAudioEngine: + * + * The IOAudioEngine superclass provides a shared status buffer that contains all of the dynamic pieces + * of information about the audio engine (type IOAudioEngineStatus). It runs an erase process on + * all of the output streams. The erase head is used to zero out the mix and sample buffers after + * the samples have been played. Additionally, the IOAudioEngine superclass handles the + * communication with the CoreAudio.framework and makes the decision to start and stop the + * audio engine when it detects it is in use. + * + * In order for an audio device to play back or record sound, an IOAudioEngine subclass must be created. + * The subclass must initialize all of the necessary hardware resources to prepare for starting the + * audio I/O engine. It typically will perform these tasks in the initHardware() method. A subclass + * may also implement a stop() method which is called as the driver is being torn down. This is + * typically called in preparation of removing the device from the system for removable devices. + * + * In addition to initializing the necessary hardware, there are a number of other tasks an + * IOAudioEngine must do during initHardware(). It must create the necessary IOAudioStream objects + * to match the device capabilities. Each IOAudioStream must be added using addAudioStream(). It + * also should create the IOAudioControls needed to control the various attributes of the audio engine: + * output volume, mute, input gain, input selection, analog passthru. To do that, addDefaultAudioControl() + * should be called with each IOAudioControl to be attached to the IOAudioEngine. In order to provide + * for proper synchronization, the latency of the audio engine should be specified with setSampleLatency(). + * This value represents the latency between the timestamp taken at the beginning of the buffer and + * when the audio is actually played (or recorded) by the device. If a device is block based or if + * there is a need to keep the CoreAudio.framework a certain number of samples ahead of (or behind for + * input) the I/O head, that value should be specified using setSampleOffset(). If this is not specified + * the CoreAudio.framework may attempt to get as close to the I/O head as possible. + * + * The following fields in the shared IOAudioEngineStatus struct must be maintained by the subclass + * implementation: + *
+ *    fCurrentLoopCount - the number of times the sample buffer has wrapped around to the beginning
+ *    fLastLoopTime - timestamp of the most recent time that the I/O engine looped back to the 
+ *  beginning of the sample buffer
+ *  
+ * It is critically important that the fLastLoopTime field be as accurate as possible. It is + * the basis for the entire timer and synchronization mechanism used by the audio system. + * + * At init time, the IOAudioEngine subclass must call setNumSampleFramesPerBuffer() to indicate how large + * each of the sample buffers are (measured in sample frames). Within a single IOAudioEngine, all sample + * buffers must be the same size and be running at the same sample rate. If different buffers/streams can + * be run at different rates, separate IOAudioEngines should be used. The IOAudioEngine subclass must + * also call setSampleRate() at init time to indicate the starting sample rate of the device. + * + */ + +class IOAudioEngine : public IOService +{ + OSDeclareAbstractStructors(IOAudioEngine) + + friend class IOAudioEngineUserClient; + friend class IOAudioDevice; + friend class IOAudioStream; + +public: + /*! @var gSampleRateWholeNumberKey */ + static const OSSymbol *gSampleRateWholeNumberKey; + /*! @var gSampleRateFractionKey */ + static const OSSymbol *gSampleRateFractionKey; + + /*! @var numSampleFramesPerBuffer */ + UInt32 numSampleFramesPerBuffer; + + /*! @var sampleRate + * The current sample rate of the audio engine in samples per second. */ + IOAudioSampleRate sampleRate; + + /*! @var numErasesPerBuffer + * The number of times the erase head get scheduled to run for each + * cycle of the audio engine. */ + UInt32 numErasesPerBuffer; + /*! @var runEraseHead + * Set to true if the erase head is to run when the audio engine is running. This is the case if there are any output streams. */ + bool runEraseHead; + + /*! @var audioEngineStopPosition + * When all clients have disconnected, this is set to one buffer length past the + * current audio engine position at the time. Then when the stop position is reached, the audio engine + * is stopped */ + IOAudioEnginePosition audioEngineStopPosition; + + /*! @var isRegistered + * Internal state variable to keep track or whether registerService() has been called. */ + bool isRegistered; + /*! @var configurationChangeInProgress + * Set to true after beginConfigurationChange() and false upon a + * subsequent call to completeConfigurationChange() or cancelConfigurationChange(). */ + bool configurationChangeInProgress; + + /*! @var state + * The current state of the IOAudioEngine - running, stopped, paused. */ + IOAudioEngineState state; + + /*! @var status + * Status struct shared with the CoreAudio.framework. */ + IOAudioEngineStatus * status; + + /*! @var audioDevice + * The IOAudioDevice instance to which the IOAudioEngine belongs. */ + IOAudioDevice * audioDevice; + + /*! @var workLoop + * The IOWorkLoop for the audio driver - shared with the IOAudioDevice. */ + IOWorkLoop *workLoop; + /*! @var commandGate + * The IOCommandGate for this audio engine - attached to the driver's IOWorkLoop. */ + IOCommandGate *commandGate; + + /*! @var inputStreams + * An OSSet of all of the input IOAudioStreams attached to this IOAudioEngine. */ + OSOrderedSet *inputStreams; + UInt32 maxNumInputChannels; + /*! @var outputStreams + * An OSSet of all of the output IOAudioStreams attached to this IOAudioEngine. */ + OSOrderedSet *outputStreams; + UInt32 maxNumOutputChannels; + /*! @var userClients + * An OSSet of all of the currently connected user clients. */ + OSSet *userClients; + /*! @var defaultAudioControls + * All of the IOAudioControls that affect this audio engine. */ + OSSet *defaultAudioControls; + + /*! @var numActiveUserClients + * A total of the active user clients - those that are currently playing or + * recording audio. */ + UInt32 numActiveUserClients; + UInt32 sampleOffset; // used for input and output if inputSampleOffset is not set, if inputSampleOffset is set used as output only + + UInt32 index; + bool duringStartup; + +protected: + + /*! + * @var deviceStartedAudioEngine + * Used by the IOAudioDevice to determine responsibility for shutting + * the audio engine down when it is no longer needed. + */ + bool deviceStartedAudioEngine; + +protected: + struct ExpansionData { + UInt32 pauseCount; + IOBufferMemoryDescriptor *statusDescriptor; + IOBufferMemoryDescriptor *bytesInInputBufferArrayDescriptor; + IOBufferMemoryDescriptor *bytesInOutputBufferArrayDescriptor; + UInt32 mixClipOverhead; + OSArray *streams; + UInt32 inputSampleOffset; + }; + + ExpansionData *reserved; + +// static UInt32 sInstanceCount; + +public: + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 0); + virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *newSampleRate); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 1); + virtual IOBufferMemoryDescriptor * getStatusDescriptor(); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 2); + virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, bool isInput); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 3); + virtual IOBufferMemoryDescriptor * getBytesInInputBufferArrayDescriptor(); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 4); + virtual IOBufferMemoryDescriptor * getBytesInOutputBufferArrayDescriptor(); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 5); + /*! + * @function eraseOutputSamples + * @abstract This function allows for the actual erasing of the mix and sample buffer to be overridden by + * a child class. + * @param mixBuf Pointer to the IOAudioFamily allocated mix buffer. + * @param sampleBuf Pointer to the child class' sample buffer. + * @param firstSampleFrame Index to the first sample frame to erase. + * @param numSampleFrames Number of sample frames to erase. + * @param streamFormat Format of the data to be erased. + * @param audioStream Pointer to stream object that corresponds to the sample buffer being erased. + * @result Must return kIOReturnSuccess if the samples have been erased. + */ + virtual IOReturn eraseOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 6); + /*! + * @function setClockIsStable + * @abstract This function sets a flag that CoreAudio uses to select its sample rate tracking algorithm. Set + * this to TRUE unless that results in dropped audio. If the driver is experiencing unexplained dropouts + * setting this FALSE might help. + * @param clockIsStable TRUE tells CoreAudio to use an agressive PLL to quickly lock to the engine's sample rate + * while FALSE tells CoreAudio to adjust more slowly to perceived sample rate changes that might just be the + * result of an unstable clock. + */ + virtual void setClockIsStable(bool clockIsStable); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 7); + /*! + * @function setMixClipOverhead + * @abstract Used to tell IOAudioFamily when the watchdog timer must fire by. + * @discussion setMixClipOverhead allows an audio engine to tell IOAudioFamily how much time + * an engine will take to mix and clip its samples, in percent. + * The default value is 10, meaning 10%. This will cause IOAudioFamily to make + * the watchdog timer fire when there is just over 10% of the time to complete + * a buffer set left (e.g. 51 samples when the HAL is using a buffer size of 512 + * samples). + * @param newMixClipOverhead How much time per buffer should be made available for the + * mix and clip routines to run. Valid values are 1 through 99, inclusive. + * @result return no error + */ + virtual void setMixClipOverhead(UInt32 newMixClipOverhead); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 8); + /*! + * @function setClockDomain + * @abstract Sets a property that CoreAudio uses to determine how devices are synchronized. If an audio device can tell that it is + * synchronized to another engine, it should set this value to that engine's clock domain. If an audio device can be a clock master, it may publish + * its own clock domain for other devices to use. + * @param clockDomain is the unique ID of another engine that this engine realizes it is synchronized to, use the default value kIOAudioNewClockDomain + * to have IOAudioEngine create a unique clock domain. + */ + virtual void setClockDomain(UInt32 clockDomain = kIOAudioNewClockDomain); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 9); + /*! + * @function convertInputSamplesVBR + * @abstract Override this method if you want to return a different number of sample frames than was requested. + */ + virtual IOReturn convertInputSamplesVBR(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 &numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 10); + /*! + * @function setInputSampleOffset + * @abstract set the offset CoreAudio will read from off the current read pointer + * @param numSamples size of offset in sample + */ + virtual void setInputSampleOffset(UInt32 numSamples); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 11); + /*! + * @function setOutputSampleOffset + * @abstract set the offset CoreAudio will write at off the current write pointer + * @param numSamples size of offset in sample + */ + virtual void setOutputSampleOffset(UInt32 numSamples); + +protected: + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 12); + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient, OSDictionary *properties); + +public: + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 13); + /*! + * @function setAttributeForConnection + * @abstract Generic method to set some attribute of the audio engine, specific to one connection. + * @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one connection. + * @param attribute Defines the attribute to be set. + * @param value The new value for the attribute. + * @result an IOReturn code. + */ + + virtual IOReturn setAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t value ); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 14); + /*! @function getAttributeForConnection + * @abstract Generic method to retrieve some attribute of the audio engine, specific to one connection. + * @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one connection. + * @param attribute Defines the attribute to be returned. Some defined attributes are:
+ * @param value Returns the value for the attribute. + * @result an IOReturn code. + */ + + virtual IOReturn getAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t * value ); + +private: + OSMetaClassDeclareReservedUsed(IOAudioEngine, 0); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 1); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 2); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 3); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 4); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 5); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 6); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 7); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 8); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 9); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 10); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 11); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 12); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 13); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 14); + + OSMetaClassDeclareReservedUnused(IOAudioEngine, 15); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 16); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 17); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 18); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 19); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 20); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 21); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 22); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 23); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 24); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 25); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 26); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 27); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 28); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 29); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 30); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 31); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 32); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 33); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 34); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 35); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 36); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 37); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 38); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 39); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 40); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 41); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 42); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 43); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 44); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 45); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 46); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 47); + +public: + /*! + * @function createDictionaryFromSampleRate + * @abstract Generates a dictionary matching the given sample rate. + * @discussion This is an internal routine used to generate a dictionary matching the given sample rate. It is used to generate a sample rate dictionary for the I/O Registry - used by the + * CoreAudio.framework. + * @result Returns the newly create OSDictionary. + */ + static OSDictionary *createDictionaryFromSampleRate(const IOAudioSampleRate *sampleRate, OSDictionary *rateDict = 0); + + /*! + * @function createSampleRateFromDictionary + * @abstract Generates a sample rate from an OSDictionary. + * @discussion This is an internal routine used to generate a sample rate from an OSDictionary. It is used to generate a sample rate give a new OSDictionary from the IORegistry - coming + * from the CoreAudio.framework. + * @result Returns the sample rate. + */ + static IOAudioSampleRate *createSampleRateFromDictionary(const OSDictionary *rateDict, IOAudioSampleRate *sampleRate = 0); + + /*! + * @function init + * @abstract Performs initialization of a newly allocated IOAudioEngine. + * @discussion This function is responsible for initialization of all of the general attributes of + * a new IOAudioEngine. It initializes instance variables to their default + * values and allocates the shared status buffer. Subclasses will likely want to override this method + * and do all of their common initialization in their implementation. They do need to be sure to call + * IOAudioEngine's implementation of init and pay attention to the return value. + * @param properties The default properties for the IOAudioEngine. + * @result Returns true if initialization was successful. + */ + virtual bool init(OSDictionary *properties); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioEngine. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the driver. + */ + virtual IOWorkLoop *getWorkLoop() const; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioEngine. + */ + virtual IOCommandGate *getCommandGate() const; + + /*! + * @function start + * @abstract A simple cover function for start(IOService *, IOAudioDevice *) that assumes the provider + * is the IOAudioDevice. + * @discussion Subclasses will want to override start(IOService *, IOAudioDevice *) rather than this + * one. + * @param provider The service provider for the IOAudioEngine (the IOAudioDevice in this case). + * @result Returns true if the IOAudioEngine was successfully started. + */ + virtual bool start(IOService *provider); + + /*! + * @function start + * @abstract Standard IOKit start() routine called to start an IOService. + * @discussion This function is called in order to prepare the IOAudioEngine for use. It does NOT + * mean that the audio I/O engine itself should be started. This implementation gets the IOWorkLoop + * from the IOAudioDevice and allocates an IOCommandGate. Finally it calls initHardware() in which + * all of the subclass-specific device initialization should be done. Upon return from initHardware() + * all IOAudioStreams should be created and added to the audio engine. Also, all IOAudioControls + * for this IOAudioEngine should be created and attached. + * @param provider The service provider for the IOAudioEngine. + * @param device The IOAudioDevice to which this IOAudioEngine belongs. + * @result Returns true if the service was successfully started. + */ + virtual bool start(IOService *provider, IOAudioDevice *device); + + /*! + * @function initHardware + * @abstract This function is called by start() to provide a convenient place for the subclass to + * perform its hardware initialization. + * @discussion Upon return from this function, all IOAudioStreams and IOAudioControls should be created + * and the audio engine should be ready to be started when a client requests that playback begin. + * @function provider The service provider numb for this audio engine - typically the IOAudioDevice. + * @result Returns true if the hardware was successfully initialized. + */ + virtual bool initHardware(IOService *provider); + + /*! + * @function stop + * @abstract Stops the service and prepares for the driver to be terminated. + * @discussion This function is called before the driver is terminated and usually means that the device + * has been removed from the system. + * @param provider The service provider for the IOAudioEngine. + */ + virtual void stop(IOService *provider); + + /*! + * @function registerService + * @abstract Called when this audio engine is ready to begin vending services. + * @discussion This function is called by IOAudioDevice::activateAudioEngine() once the audio engine + * has been fully initialized and is ready to begin audio playback. + * @param options + */ + virtual void registerService(IOOptionBits options = 0); + + virtual void setAudioDevice(IOAudioDevice *device); + virtual void setIndex(UInt32 index); + + virtual void setDescription(const char *description); + + /*! + * @function newUserClient + * @abstract Requests a new user client object for this service. + * @discussion This function is called automatically by I/O Kit when a user process attempts + * to connect to this service. It allocates a new IOAudioEngineUserClient object and increments + * the number of connections for this audio engine. If this is the first user client for this IOAudioEngine, + * it calls startAudioEngine(). There is no need to call this function directly. + * A derived class that requires overriding of newUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client - ignored. + * @param handler The new IOUserClient * must be stored in this param on a successful completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory. + */ + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler); + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler); + + /*! + * @function addAudioStream + * @abstract Adds an IOAudioStream to the audio engine. + * @discussion This function is called by the driver to add an IOAudioStream to the audio engine. This must be called at least once to make sure the audio engine has at least one IOAudioStream. + * @param stream The IOAudioStream to be added. + * @result Returns kIOReturnSuccess if the stream was successfully added. + */ + virtual IOReturn addAudioStream(IOAudioStream *stream); + + virtual IOAudioStream *getAudioStream(IOAudioStreamDirection direction, UInt32 channelID); + + virtual void lockAllStreams(); + virtual void unlockAllStreams(); + + virtual void updateChannelNumbers(); + + /*! + * @function resetStatusBuffer + * @abstract Resets the status buffer to its default values. + * @discussion This is called during startAudioEngine() and resumeAudioEngine() to clear out the status buffer + * in preparation of starting up the I/O engine. There is no need to call this directly. + */ + virtual void resetStatusBuffer(); + + /*! + * @function clearAllSampleBuffers + * @abstract Zeros out all of the sample and mix buffers associated with the IOAudioEngine + * @discussion This is called during resumeAudioEngine() since the audio engine gets started back at the + * beginning of the sample buffer. + */ + virtual void clearAllSampleBuffers(); + + /*! + * @function getCurrentSampleFrame + * @abstract Gets the current sample frame from the IOAudioEngine subclass. + * @result + */ + virtual UInt32 getCurrentSampleFrame() = 0; + + /*! + * @function startAudioEngine + * @abstract Starts the audio I/O engine. + * @discussion This method is called automatically when the audio engine is placed into use the first time. + * This must be overridden by the subclass. No call to the superclass's implementation is + * necessary. The subclass's implementation must start up the audio I/O engine. This includes any audio + * engine that needs to be started as well as any interrupts that need to be enabled. Upon successfully + * starting the engine, the subclass's implementation must call setState(kIOAudioEngineRunning). If + * it has also checked the state using getState() earlier in the implementation, the stateLock must be + * acquired for the entire initialization process (using IORecursiveLockLock(stateLock) and + * IORecursiveLockUnlock(stateLock)) to ensure that the state remains consistent. See the general class + * comments for an example. + * @result Must return kIOReturnSuccess on a successful start of the engine. + */ + virtual IOReturn startAudioEngine(); + + /*! + * @function stopAudioEngine + * @abstract Stops the audio I/O engine. + * @discussion This method is called automatically when the last client disconnects from this audio engine. + * It must be overridden by the subclass. No call to the superclass's implementation is necessary. + * The subclass's implementation must stop the audio I/O engine. The audio engine (if it exists) should + * be stopped and any interrupts disabled. Upon successfully stopping the engine, the subclass must call + * setState(kAudioEngineStopped). If it has also checked the state using getState() earlier in the + * implementation, the stateLock must be acquired for the entire initialization process (using + * IORecursiveLockLock(stateLock) and IORecursiveLockUnlock(stateLock)) to ensure that the state remains + * consistent. + * @result Must return kIOReturnSuccess on a successful stop of the engine. + */ + virtual IOReturn stopAudioEngine(); + virtual IOReturn pauseAudioEngine(); + virtual IOReturn resumeAudioEngine(); + + /*! + * @function performAudioEngineStart + * @abstract Called to start the audio I/O engine + * @discussion This method is called by startAudioEngine(). This must be overridden by the subclass. + * No call to the superclass' implementation is necessary. The subclass' implementation must start up the + * audio I/O engine. This includes any audio engine that needs to be started as well as any interrupts + * that need to be enabled. + * @result Must return kIOReturnSuccess on a successful start of the engine. + */ + virtual IOReturn performAudioEngineStart(); + + /*! + * @function performAudioEngineStop + * @abstract Called to stop the audio I/O engine + * @discussion This method is called by stopAudioEngine() and pauseAudioEngine. + * This must be overridden by the subclass. No call to the superclass' implementation is + * necessary. The subclass' implementation must stop the audio I/O engine. This includes any audio + * engine that needs to be stopped as well as any interrupts that need to be disabled. + * @result Must return kIOReturnSuccess on a successful stop of the engine. + */ + virtual IOReturn performAudioEngineStop(); + + /*! + * @function getState + * @abstract Returns the current state of the IOAudioEngine. + * @discussion If this method is called in preparation for calling setState(), the stateLock must + * be acquired before the first call to getState() and held until after the last call to setState(). + * Be careful not to return from the code acquiring the lock while the lock is being held. That + * will cause a deadlock situation. + * @result The current state of the IOAudioEngine: kIOAudioEngineRunning, kIOAudioEngineStopped. + */ + virtual IOAudioEngineState getState(); + + /*! + * @function getSampleRate + * @abstract Returns the sample rate of the IOAudioEngine in samples per second. + */ + virtual const IOAudioSampleRate *getSampleRate(); + + virtual IOReturn hardwareSampleRateChanged(const IOAudioSampleRate *sampleRate); + + /*! + * @function getRunEraseHead + * @abstract Returns true if the audio engine will run the erase head when the audio engine is running. + */ + virtual bool getRunEraseHead(); + + /*! + * @function getStatus + * @abstract Returns a pointer to the shared status buffer. + */ + virtual const IOAudioEngineStatus *getStatus(); + + /*! + * @function timerCallback + * @abstract A static method used as a callback for the IOAudioDevice timer services. + * @discussion This method implements the IOAudioDevice::TimerEvent type. + * @param arg1 The IOAudioEngine that is the target of the event. + * @param device The IOAudioDevice that sent the timer event. + */ + static void timerCallback(OSObject *arg1, IOAudioDevice *device); + + /*! + * @function timerFired + * @abstract Indicates the timer has fired. + * @discussion This method is called by timerCallback to indicate the timer has fired. This method calls performErase() and performFlush() to do erase head processing and + * audio engine flushing each time the timer event fires. + */ + virtual void timerFired(); + + /*! + * @function getTimerInterval + * @abstract Gets the timer interval for use by the timer event. + * @discussion This method is called each time the timer event is enabled through addTimer(). The default + * implementation is set to return a value such that the timer event runs n times each cycle of the audio + * engine through the sample buffer. The value n is stored as the instance variable: numErasesPerBuffer. + * The default value of numErasesPerBuffer is set to IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER which is 4. + * A subclass may change the value of numErasesPerBuffer or override getTimerInterval. If it is overridden, + * the subclass should call the superclass's implementation, compare its interval with the superclass's and + * return the smaller of the two. + * @result Returns the interval for the timer event. + */ + virtual AbsoluteTime getTimerInterval(); + + /*! + * @function performErase + * @abstract Performs erase head processing. + * @discussion This method is called automatically each time the timer event fires and erases the sample + * buffer and mix buffer from the previous location up to the current location of the audio engine. + */ + virtual void performErase(); + + /*! + * @function performFlush + * @abstract Performs the flush operation. + * @discussion This method is called automatically each time the timer event fires. It stops the audio engine + * if there are no more clients and the audio engine is passed the latest flush ending position. + */ + virtual void performFlush(); + + virtual void stopEngineAtPosition(IOAudioEnginePosition *endingPosition); + + virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + virtual IOReturn clipOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + virtual void resetClipPosition(IOAudioStream *audioStream, UInt32 clipSampleFrame); + virtual IOReturn convertInputSamples(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + + virtual void takeTimeStamp(bool incrementLoopCount = true, AbsoluteTime *timestamp = NULL); + virtual IOReturn getLoopCountAndTimeStamp(UInt32 *loopCount, AbsoluteTime *timestamp); + + virtual IOReturn calculateSampleTimeout(AbsoluteTime *sampleInterval, UInt32 numSampleFrames, IOAudioEnginePosition *startingPosition, AbsoluteTime *wakeupTime); + + virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioSampleRate *newSampleRate); + + virtual void beginConfigurationChange(); + virtual void completeConfigurationChange(); + virtual void cancelConfigurationChange(); + + virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl); + virtual IOReturn removeDefaultAudioControl(IOAudioControl *defaultAudioControl); + virtual void removeAllDefaultAudioControls(); + + virtual OSString *getGlobalUniqueID(); + virtual OSString *getLocalUniqueID(); + +protected: + + /*! + * @function initKeys + * @abstract Generates the OSSymbols with the keys. + * @discussion Do not call this directly. This is an internal initialization routine. + */ + static void initKeys(); + + virtual void setNumSampleFramesPerBuffer(UInt32 numSampleFrames); + virtual UInt32 getNumSampleFramesPerBuffer(); + + /*! + * @function setState + * @abstract Indicates that the audio engine is in the specified state. + * @discussion This method simply sets the internal state of the audio engine to the specified state. It does not + * affect a change to the state. It does however keep other internal state-related attributes consistent. + * For example, it enables or disables the timer as needed when the state changes to running or stopped. + * @param newState The state the audio engine is in. + * @result Returns the old state. + */ + virtual IOAudioEngineState setState(IOAudioEngineState newState); + + /*! + * @function setSampleRate + * @abstract Records the sample rate of the audio engine. + * @discussion This method must be called during initialization of a new audio engine to record the audio engine's + * initial sample rate. It also is intended to be used to record changes to the sample rate during use. + * Currently changing sample rates after the audio engine has been started is not supported. + * It may require that the sample buffers be re-sized. This will be available in an upcoming release. + * @param newSampleRate The sample rate of the audio engine in samples per second. + */ + virtual void setSampleRate(const IOAudioSampleRate *newSampleRate); + + /*! + * @function setSampleLatency + * @abstract Sets the sample latency for the audio engine. + * @discussion The sample latency represents the number of samples ahead of the playback head + * that it is safe to write into the sample buffer. The audio device API will never write + * closer to the playback head than the number of samples specified. For input audio engines + * the number of samples is behind the record head. + */ + virtual void setSampleLatency(UInt32 numSamples); + virtual void setOutputSampleLatency(UInt32 numSamples); + virtual void setInputSampleLatency(UInt32 numSamples); + virtual void setSampleOffset(UInt32 numSamples); + + /*! + * @function setRunEraseHead + * @abstract Tells the audio engine whether or not to run the erase head. + * @discussion By default, output audio engines run the erase head and input audio engines do not. This method can + * be called after setDirection() is called in order to change the default behavior. + * @param runEraseHead The audio engine will run the erase head if this value is true. + */ + virtual void setRunEraseHead(bool runEraseHead); + + /*! + * @function clientClosed + * @abstract Called automatically when a user client closes its connection to the audio engine. + * @discussion This method decrements the number of connections to the audio engine and if they reach + * zero, the audio engine is called with a call to stopAudioEngine(). This method should not be called directly. + * @param client The user client that has disconnected. + */ + virtual void clientClosed(IOAudioEngineUserClient *client); + + /*! + * @function addTimer + * @abstract Enables the timer event for the audio engine. + * @discussion There is a timer event needed by the IOAudioEngine for processing the erase head + * and performing flushing operations. When the timer fires, the method timerFired() is ultimately + * called which in turn calls performErase() and performFlush(). This is called automatically + * to enable the timer event for this audio engine. It is called by setState() when the audio engine state + * is set to kIOAudioEngineRunning. When the timer is no longer needed, removeTimer() is called. + * There is no need to call this directly. + */ + virtual void addTimer(); + + /*! + * @function removeTimer + * @abstract Disables the timer event for the audio engine. + * @discussion This method is called automatically to disable the timer event for this audio engine. + * There is need to call it directly. This method is called by setState() when the audio engine state + * is changed from kIOAudioEngineRunning to one of the stopped states. + */ + virtual void removeTimer(); + + virtual void sendFormatChangeNotification(IOAudioStream *audioStream); + virtual void sendNotification(UInt32 notificationType); + + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient); + + static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOReturn addUserClient(IOAudioEngineUserClient *newUserClient); + virtual IOReturn removeUserClient(IOAudioEngineUserClient *userClient); + virtual IOReturn detachUserClients(); + + virtual IOReturn startClient(IOAudioEngineUserClient *userClient); + virtual IOReturn stopClient(IOAudioEngineUserClient *userClient); + + virtual IOReturn incrementActiveUserClients(); + virtual IOReturn decrementActiveUserClients(); + + virtual void detachAudioStreams(); + void setWorkLoopOnAllAudioControls(IOWorkLoop *wl); + + static inline void lockStreamForIO(IOAudioStream *stream); + static inline void unlockStreamForIO(IOAudioStream *stream); + + // These aren't virtual by design + UInt32 getNextStreamID(IOAudioStream * newStream); + IOAudioStream * getStreamForID(UInt32 streamID); + +}; + +#endif /* _IOKIT_IOAUDIOENGINE_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioEngineUserClient.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioEngineUserClient.h.svn-base new file mode 100644 index 0000000..cc51a83 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioEngineUserClient.h.svn-base @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOENGINEUSERCLIENT_H +#define _IOKIT_IOAUDIOENGINEUSERCLIENT_H + +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioEngine.h" +#include "IOAudioTypes.h" +#endif +#include + +class IOAudioEngine; +class IOAudioStream; +class IOMemoryDescriptor; +class IOCommandGate; +class IOWorkLoop; + +class IOAudioEngineUserClient; +class IOAudioClientBufferSet; +typedef struct IOAudioFormatNotification; +typedef struct IOAudioClientBuffer { + IOAudioEngineUserClient *userClient; + IOAudioStream *audioStream; + void *sourceBuffer; + IOMemoryDescriptor *sourceBufferDescriptor; + IOMemoryMap *sourceBufferMap; + void *unmappedSourceBuffer; + UInt32 numSampleFrames; + UInt32 numChannels; + IOAudioEnginePosition mixedPosition; + struct IOAudioClientBuffer *mNextBuffer32; + struct IOAudioClientBuffer *nextClip; + struct IOAudioClientBuffer *previousClip; + struct IOAudioClientBuffer *nextClient; + IOAudioBufferDataDescriptor *bufferDataDescriptor; +} IOAudioClientBuffer; + +/* IOAudioClientBuffer64 added for binary compatibility with old PPC drivers covered by */ +typedef struct IOAudioClientBuffer64 +{ + IOAudioClientBuffer mAudioClientBuffer32; + mach_vm_address_t mUnmappedSourceBuffer64; + struct IOAudioClientBuffer64 *mNextBuffer64; +} IOAudioClientBuffer64; + +typedef struct IOAudioClientBufferExtendedInfo { + // Added stuff for registerClientParameterBuffer + UInt32 bufferSetID; + void *paramBuffer; + IOMemoryDescriptor *paramBufferDescriptor; + IOMemoryMap *paramBufferMap; + void *unmappedParamBuffer; + struct IOAudioClientBufferExtendedInfo *mNextExtended; +} IOAudioClientBufferExtendedInfo; +/* IOAudioClientBufferExtendedInfo64 added for binary compatibility with old PPC drivers covered by */ +typedef struct IOAudioClientBufferExtendedInfo64 +{ + IOAudioClientBufferExtendedInfo mAudioClientBufferExtended32; + mach_vm_address_t mUnmappedParamBuffer64; + struct IOAudioClientBufferExtendedInfo64 *mNextExtended64; +} IOAudioClientBufferExtendedInfo64; + + +class IOAudioEngineUserClient : public IOUserClient + { + OSDeclareDefaultStructors(IOAudioEngineUserClient) + + friend class IOAudioEngine; + friend class IOAudioClientBufferSet; + friend class IOAudioStream; + + protected: + IOAudioEngine *audioEngine; + + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + + IOExternalMethod old_methods[5]; // It's size can't be changed for binary compatibility reasons, no longer used. + IOExternalTrap trap; + + task_t clientTask; + UInt32 numSampleFrames; // Never used... + + IOAudioClientBufferSet *clientBufferSetList; + IORecursiveLock *clientBufferLock; + + IOAudioNotificationMessage *notificationMessage; + + bool online; + + protected: + struct ExpansionData { + IOAudioClientBufferExtendedInfo64 *extendedInfo; + IOExternalMethod methods[kIOAudioEngineNumCalls]; // This size can be changed, this is the new methods pointer + UInt32 classicMode; + }; + + ExpansionData *reserved; + + public: + virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * arguments, IOExternalMethodDispatch * dispatch, + OSObject * target, void * reference); + // New code added here... + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0); + virtual IOReturn registerClientParameterBuffer (void * parameterBuffer, UInt32 bufferSetID); // unused function + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1); + virtual IOAudioClientBufferExtendedInfo * findExtendedInfo(UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2); + virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3); + virtual IOReturn getClientNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4); + virtual IOReturn safeRegisterClientBuffer(UInt32 audioStreamIndex, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5); + virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type, OSDictionary *properties); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); + virtual IOReturn safeRegisterClientBuffer64(UInt32 audioStreamIndex, mach_vm_address_t * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); + virtual IOReturn registerClientBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); + virtual IOReturn registerBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); + virtual IOReturn unregisterBuffer64(mach_vm_address_t sourceBuffer, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); + virtual IOReturn unregisterClientBuffer64(mach_vm_address_t * sourceBuffer, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); + virtual IOAudioClientBufferExtendedInfo64 * findExtendedInfo64(UInt32 bufferSetID); + + + + private: + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); + + + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 12); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 13); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 14); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 15); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 16); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 17); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 18); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 19); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 20); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 21); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 22); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 23); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 24); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 25); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 26); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 27); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 28); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 29); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 30); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 31); + + protected: + virtual IOReturn clientClose(); + virtual IOReturn clientDied(); + + static IOReturn _closeClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn closeClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + virtual IOReturn closeClient(); + + + virtual IOReturn clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory); + virtual IOExternalMethod *getExternalMethodForIndex(UInt32 index); + virtual IOExternalTrap *getExternalTrapForIndex(UInt32 index); + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon); + + static IOReturn _registerNotificationAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn registerNotificationAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + virtual IOReturn registerNotification(mach_port_t port, UInt32 refCon); + + virtual void setOnline(bool newOnline); + + virtual IOReturn performClientOutput(UInt32 firstSampleFrame, UInt32 loopCount, IOAudioClientBufferSet *bufferSet, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo); + virtual IOReturn performClientInput(UInt32 firstSampleFrame, IOAudioClientBufferSet *bufferSet); + virtual void performWatchdogOutput(IOAudioClientBufferSet *clientBufferSet, UInt32 generationCount); + + virtual void lockBuffers(); + virtual void unlockBuffers(); + + public: + + static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type); + static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type, OSDictionary *properties); + + virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type); + + virtual void free(); + virtual void freeClientBufferSetList(); + virtual void freeClientBuffer(IOAudioClientBuffer64 *clientBuffer); + + virtual void stop(IOService *provider); + + virtual bool isOnline(); + + virtual IOReturn registerBuffer(IOAudioStream *audioStream, void* sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + virtual IOReturn unregisterBuffer( void * sourceBuffer, UInt32 bufferSetID); + + static IOReturn _registerBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn registerBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn _unregisterBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn unregisterBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOReturn registerClientBuffer(IOAudioStream *audioStream, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + virtual IOReturn unregisterClientBuffer(void * sourceBuffer, UInt32 bufferSetID); + + static IOReturn _getNearestStartTimeAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn getNearestStartTimeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOAudioClientBufferSet *findBufferSet(UInt32 bufferSetID); + virtual void removeBufferSet(IOAudioClientBufferSet *bufferSet); + + virtual IOReturn getConnectionID(UInt32 *connectionID); + + virtual IOReturn clientStart(); + virtual IOReturn clientStop(); + + static IOReturn _startClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn startClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn _stopClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn stopClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOReturn startClient(); + virtual IOReturn stopClient(); + + virtual IOReturn performClientIO(UInt32 firstSampleFrame, UInt32 loopCount, bool inputIO, UInt32 bufferSetID, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo); + + virtual void sendFormatChangeNotification(IOAudioStream *audioStream); + virtual IOReturn sendNotification(UInt32 notificationType); + + }; + +#endif /* _IOKIT_IOAUDIOENGINEUSERCLIENT_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioLevelControl.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioLevelControl.h.svn-base new file mode 100644 index 0000000..d76786d --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioLevelControl.h.svn-base @@ -0,0 +1,205 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOLEVELCONTROL_H +#define _IOKIT_IOAUDIOLEVELCONTROL_H + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +class OSArray; + +/*! + * @class IOAudioLevelControl + * @abstract + * @discussion + */ + +class IOAudioLevelControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioLevelControl) + +protected: + SInt32 minValue; + SInt32 maxValue; + IOFixed minDB; + IOFixed maxDB; + + OSArray *ranges; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + static IOAudioLevelControl *createPassThruVolumeControl (SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName, + UInt32 cntrlID); + + // OSMetaClassDefineReservedUnused(IOAudioLevelControl, 0); + /*! + * @function setLinearScale + * @abstract This function tells CoreAudio if it should apply a curve to the scaler representation of the volume. + * @param useLinearScale TRUE instructs CoreAudio to not apply a curve to the scaler representation of the volume, + * FALSE instructs CoreAudio to apply a curve, which is CoreAudio's default behavior. + */ + virtual void setLinearScale(bool useLinearScale); + +private: + OSMetaClassDeclareReservedUsed(IOAudioLevelControl, 0); + + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 1); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 2); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 15); + +public: + /*! + * @function create + * @abstract Allocates a new level control with the given attributes + * @param initialValue The initial value of the control + * @param minValue The lowest possible value the control may have + * @param maxValue The highest possible value the control may have + * @param minDB A fixed point representation of the db value matching minValue + * @param maxDB A fixed point representation of the db value matching maxValue + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls. + * @result Returns a newly allocted and initialized level IOAudioControl + */ + static IOAudioLevelControl *create(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + static IOAudioLevelControl *createVolumeControl(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 usage = 0); + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioLevelControl with the given attributes + * @param initialValue The initial value of the control + * @param minValue The lowest possible value the control may have + * @param maxValue The highest possible value the control may have + * @param minDB A fixed point representation of the db value matching minValue + * @param maxDB A fixed point representation of the db value matching maxValue + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls. + * @param properties Standard property list passed to the init() function of any new IOService. This dictionary + * gets stored in the registry entry for this service. + * @result Returns true on success + */ + virtual bool init(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + + virtual void free(); + + /*! + * @function setMinValue + * @abstract Sets the minimum value the control may have + * @param minValue The minimum value for the control + */ + virtual void setMinValue(SInt32 minValue); + + virtual SInt32 getMinValue(); + + /*! + * @function setMaxValue + * @abstract Sets the maximum value the control may have + * @param maxValue The maximum value for the control + */ + virtual void setMaxValue(SInt32 maxValue); + + virtual SInt32 getMaxValue(); + + /*! + * @function setMinDB + * @abstract Sets the minimum value in db that the control may have + * @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed + * type is a 16.16 fixed point value. + * @param minDB The minimum value in db for the control + */ + virtual void setMinDB(IOFixed minDB); + + virtual IOFixed getMinDB(); + + /*! + * @function setMaxDB + * @abstract Sets the maximum value in db that the control may have + * @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed + * type is a 16.16 fixed point value. + * @param maxDB The maximum value in db for the control + */ + virtual void setMaxDB(IOFixed maxDB); + + virtual IOFixed getMaxDB(); + + virtual IOReturn addRange(SInt32 minValue, SInt32 maxValue, IOFixed minDB, IOFixed maxDB); + virtual IOReturn addNegativeInfinity(SInt32 negativeInfinityValue); + + virtual IOReturn validateValue(OSObject *newValue); +}; + +#endif /* _IOKIT_IOAUDIOLEVELCONTROL_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioPort.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioPort.h.svn-base new file mode 100644 index 0000000..728c65e --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioPort.h.svn-base @@ -0,0 +1,184 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOPORT_H +#define _IOKIT_IOAUDIOPORT_H + +#include + +class IOAudioDevice; +class IOAudioControl; +class OSDictionary; + +/*! + * @class IOAudioPort + * @abstract Represents a logical or physical port or functional unit in an audio device. + * @discussion An IOAudioPort represents an element in the signal chain in the audio device. It may contain + * one or more controls (represented by IOAudioControl) by which different attributes of the port may be + * represented and adjusted. + * + * IOAudioPort objects are connected up in the IORegistry in the IOAudioPlane to represent the signal chain of + * the device. They may be connected to other IOAudioPorts as well as IOAudioEngines to indicate they either + * feed into or are fed by one of the audio engines (i.e. they provide input to or take output from the computer). + */ +class IOAudioPort : public IOService +{ + friend class IOAudioDevice; + + OSDeclareDefaultStructors(IOAudioPort) + +public: + /* @var audioDevice The IOAudioDevice that this IOAudioPort belongs to. */ + IOAudioDevice * audioDevice; + /* @var audioControls A set containg all of the IOAudioControl instances that belong to the port. */ + OSSet * audioControls; + bool isRegistered; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOAudioPort, 0); + OSMetaClassDeclareReservedUnused(IOAudioPort, 1); + OSMetaClassDeclareReservedUnused(IOAudioPort, 2); + OSMetaClassDeclareReservedUnused(IOAudioPort, 3); + OSMetaClassDeclareReservedUnused(IOAudioPort, 4); + OSMetaClassDeclareReservedUnused(IOAudioPort, 5); + OSMetaClassDeclareReservedUnused(IOAudioPort, 6); + OSMetaClassDeclareReservedUnused(IOAudioPort, 7); + OSMetaClassDeclareReservedUnused(IOAudioPort, 8); + OSMetaClassDeclareReservedUnused(IOAudioPort, 9); + OSMetaClassDeclareReservedUnused(IOAudioPort, 10); + OSMetaClassDeclareReservedUnused(IOAudioPort, 11); + OSMetaClassDeclareReservedUnused(IOAudioPort, 12); + OSMetaClassDeclareReservedUnused(IOAudioPort, 13); + OSMetaClassDeclareReservedUnused(IOAudioPort, 14); + OSMetaClassDeclareReservedUnused(IOAudioPort, 15); + OSMetaClassDeclareReservedUnused(IOAudioPort, 16); + OSMetaClassDeclareReservedUnused(IOAudioPort, 17); + OSMetaClassDeclareReservedUnused(IOAudioPort, 18); + OSMetaClassDeclareReservedUnused(IOAudioPort, 19); + OSMetaClassDeclareReservedUnused(IOAudioPort, 20); + OSMetaClassDeclareReservedUnused(IOAudioPort, 21); + OSMetaClassDeclareReservedUnused(IOAudioPort, 22); + OSMetaClassDeclareReservedUnused(IOAudioPort, 23); + OSMetaClassDeclareReservedUnused(IOAudioPort, 24); + OSMetaClassDeclareReservedUnused(IOAudioPort, 25); + OSMetaClassDeclareReservedUnused(IOAudioPort, 26); + OSMetaClassDeclareReservedUnused(IOAudioPort, 27); + OSMetaClassDeclareReservedUnused(IOAudioPort, 28); + OSMetaClassDeclareReservedUnused(IOAudioPort, 29); + OSMetaClassDeclareReservedUnused(IOAudioPort, 30); + OSMetaClassDeclareReservedUnused(IOAudioPort, 31); + +public: + /*! + * @function withAttributes + * @abstract Allocates a new IOAudioPort instance with the given attributes + * @discussion This static method allocates a new IOAudioPort and calls initWithAttributes() on it with + * the parameters passed in to it. + * @param portType A readable string representing the type of port. Common port types are defined in + * IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are + * other common port types that should be included. + * @param portName A readable string representing the name of the port. For example: 'Internal Speaker', + * 'Line Out'. This field is optional, but useful for providing information to the application/user. + * @param subType Developer defined readable string representing a subtype for the port. (optional) + * @param properties Standard property list passed to the init of any new IOService. This dictionary + * gets stored in the registry for this instance. (optional) + * @result Returns the newly allocated and initialized IOAudioPort instance. + */ + static IOAudioPort *withAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0); + + /*! + * @function initWithAttributes + * @abstract Initializes a newly allocated IOAudioPort instance with the given attributes + * @discussion The properties parameter is passed on the superclass' init(). The portType, subType + * and properties parameters are optional, however portType is recommended. + * @param portType A readable string representing the type of port. Common port types are defined in + * IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are + * other common port types that should be included. + * @param portName A readable string representing the name of the port. For example: 'Internal Speaker', + * 'Line Out'. This field is optional, but useful for providing information to the application/user. + * @param subType Developer defined readable string representing a subtype for the port. (optional) + * @param properties Standard property list passed to the init of any new IOService. This dictionary + * gets stored in the registry for this instance. (optional) + * @result Returns true on success. + */ + virtual bool initWithAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioPort. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + /*! + * @function start + * @abstract Called to start a newly created IOAudioPort. + * @discussion This is called automatically by IOAudioDevice when attachAudioPort() is called. + * @param provider The IOAudioDevice that owns this port + * @result Returns true on success + */ + virtual bool start(IOService *provider); + + /*! + * @function stop + * @abstract Called when the IOAudioDevice is stopping when it is no longer available. + * @discussion This method calls deactivateAudioControls() to shut down all of the controls associated with + * this port. + * @param provider The IOAudioDevice that owns this port + */ + virtual void stop(IOService *provider); + + virtual void registerService(IOOptionBits options = 0); + + virtual IOAudioDevice *getAudioDevice(); + + /*! + * @function addAudioControl + * @abstract Adds a newly created IOAudioControl instance to the port. + * @discussion This method is responsible for starting the new IOAudioControl and adding it to the internal + * audioControls array. + * @param control A newly created IOAudioControl instance that should belong to this port. + * @result Returns true on successfully staring the IOAudioControl. + */ + virtual IOReturn addAudioControl(IOAudioControl *control); + + /*! + * @function deactivateAudioControls + * @abstract Called to shut down all of the audio controls for this port. + * @discussion This will stop all of the audio controls and release them so that the instances may be + * freed. This is called from the free() method. + */ + virtual void deactivateAudioControls(); + +protected: + virtual void setType(UInt32 portType); + virtual void setSubType(UInt32 subType); + virtual void setName(const char *name); +}; + +#endif /* _IOKIT_IOAUDIOPORT_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioSelectorControl.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioSelectorControl.h.svn-base new file mode 100644 index 0000000..8687810 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioSelectorControl.h.svn-base @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOSELECTORCONTROL_H +#define _IOKIT_IOAUDIOSELECTORCONTROL_H + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +class OSString; +class OSArray; + +class IOAudioSelectorControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioSelectorControl) + +protected: + + OSArray *availableSelections; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + static IOAudioSelectorControl *createOutputSelector(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0); + static IOAudioSelectorControl *createOutputClockSelector(SInt32 initialValue, + UInt32 channelID, + UInt32 clockSource, + const char *channelName = 0, + UInt32 cntrlID = 0); + static IOAudioSelectorControl *createInputClockSelector(SInt32 initialValue, + UInt32 channelID, + UInt32 clockSource, + const char *channelName = 0, + UInt32 cntrlID = 0); + + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0); + virtual IOReturn removeAvailableSelection(SInt32 selectionValue); + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1); + virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, const char *selectionDescription); + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2); + virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, OSString *selectionDescription); + +private: + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2); + + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 15); + +public: + static IOAudioSelectorControl *create(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + static IOAudioSelectorControl *createInputSelector(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0); + + virtual bool init(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + + virtual void free(); + + virtual IOReturn addAvailableSelection(SInt32 selectionValue, const char *selectionDescription); + virtual IOReturn addAvailableSelection(SInt32 selectionValue, OSString *selectionDescription); + + virtual bool valueExists(SInt32 selectorValue); + + virtual IOReturn validateValue(OSObject *newValue); + +}; + +#endif /* _IOKIT_IOAUDIOSELECTORCONTROL_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioStream.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioStream.h.svn-base new file mode 100644 index 0000000..07f40be --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioStream.h.svn-base @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOSTREAM_H +#define _IOKIT_IOAUDIOSTREAM_H + +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioEngine.h" +#include "IOAudioTypes.h" +#endif + +class OSSymbol; +class OSArray; +class OSDictionary; +class OSSet; + +class IOCommandGate; +class IOAudioControl; + +typedef struct IOAudioClientBuffer; +typedef struct IOAudioStreamFormatDesc; + +/*! + * @class IOAudioStream + * @abstract This class wraps a single sample buffer in an audio driver. + * @discussion An IOAudioStream represents one hardware sample buffer as well as the direction + * of that buffer, the mix buffer that multiple clients mix into as well as a list of + * all of the formats to which this buffer can be set. + * + * When an IOAudioEngine is created during init time in the driver, an IOAudioStream must be + * created for each sample buffer in the device. Typically, the sample buffer will be interleaved + * (or single channel), as a non-interleaved buffer should be divided into multiple single-channel + * buffers (and multiple IOAudioStreams). + * + * Additionally, when an IOAudioStream is created it must have all of the possible formats (and + * allowed sample rates for each format) set and must have the currently set format specified + * (addAvailableFormat() and setFormat()). + */ + +class IOAudioStream : public IOService +{ + OSDeclareDefaultStructors(IOAudioStream) + + friend class IOAudioEngine; + friend class IOAudioEngineUserClient; + +public: + + typedef IOReturn (*AudioIOFunction)(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + + static const OSSymbol *gDirectionKey; + static const OSSymbol *gNumChannelsKey; + static const OSSymbol *gSampleFormatKey; + static const OSSymbol *gNumericRepresentationKey; + static const OSSymbol *gBitDepthKey; + static const OSSymbol *gBitWidthKey; + static const OSSymbol *gAlignmentKey; + static const OSSymbol *gByteOrderKey; + static const OSSymbol *gIsMixableKey; + static const OSSymbol *gDriverTagKey; + static const OSSymbol *gMinimumSampleRateKey; + static const OSSymbol *gMaximumSampleRateKey; + + static void initKeys(); + + static OSDictionary *createDictionaryFromFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict = 0); + static IOAudioStreamFormat *createFormatFromDictionary(const OSDictionary *formatDict, IOAudioStreamFormat *streamFormat = 0, IOAudioStreamFormatExtension *formatExtension = 0); + + IOAudioEngine *audioEngine; + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + IORecursiveLock *streamIOLock; + + UInt32 numClients; + + IOAudioStreamDirection direction; + + IOAudioStreamFormat format; + IOAudioStreamFormatDesc *availableFormats; + OSArray *availableFormatDictionaries; + UInt32 numAvailableFormats; + + UInt32 startingChannelID; + UInt32 maxNumChannels; + + void *sampleBuffer; + UInt32 sampleBufferSize; + + void *mixBuffer; + UInt32 mixBufferSize; + bool streamAllocatedMixBuffer; + + AudioIOFunction *audioIOFunctions; + UInt32 numIOFunctions; + + bool streamAvailable; + + OSSet *defaultAudioControls; + + IOAudioEnginePosition startingPosition; + IOAudioEnginePosition clippedPosition; + + IOAudioClientBuffer *clientBufferListStart; + IOAudioClientBuffer *clientBufferListEnd; + + IOAudioClientBuffer *userClientList; + +protected: + + struct ExpansionData { + IOAudioStreamFormatExtension streamFormatExtension; + UInt32 mSampleFramesReadByEngine; + IOReturn mClipOutputStatus; + }; + + ExpansionData *reserved; + +public: +// New code added here: + // OSMetaClassDeclareReservedUsed(IOAudioStream, 0); + virtual const IOAudioStreamFormatExtension *getFormatExtension(); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 1); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, bool callDriver = true); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 2); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict, bool callDriver = true); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 3); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 4); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 5); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 6); + virtual void setTerminalType(const UInt32 terminalType); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 7); + virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 8); + virtual void setSampleLatency(UInt32 numSamples); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 9); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc, const IOAudioSampleRate *sampleRate); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 10); + virtual UInt32 getNumSampleFramesRead(); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 11); + virtual void setDefaultNumSampleFramesRead(UInt32); + +private: + OSMetaClassDeclareReservedUsed(IOAudioStream, 0); + OSMetaClassDeclareReservedUsed(IOAudioStream, 1); + OSMetaClassDeclareReservedUsed(IOAudioStream, 2); + OSMetaClassDeclareReservedUsed(IOAudioStream, 3); + OSMetaClassDeclareReservedUsed(IOAudioStream, 4); + OSMetaClassDeclareReservedUsed(IOAudioStream, 5); + OSMetaClassDeclareReservedUsed(IOAudioStream, 6); + OSMetaClassDeclareReservedUsed(IOAudioStream, 7); + OSMetaClassDeclareReservedUsed(IOAudioStream, 8); + OSMetaClassDeclareReservedUsed(IOAudioStream, 9); + OSMetaClassDeclareReservedUsed(IOAudioStream, 10); + OSMetaClassDeclareReservedUsed(IOAudioStream, 11); + + OSMetaClassDeclareReservedUnused(IOAudioStream, 12); + OSMetaClassDeclareReservedUnused(IOAudioStream, 13); + OSMetaClassDeclareReservedUnused(IOAudioStream, 14); + OSMetaClassDeclareReservedUnused(IOAudioStream, 15); + OSMetaClassDeclareReservedUnused(IOAudioStream, 16); + OSMetaClassDeclareReservedUnused(IOAudioStream, 17); + OSMetaClassDeclareReservedUnused(IOAudioStream, 18); + OSMetaClassDeclareReservedUnused(IOAudioStream, 19); + OSMetaClassDeclareReservedUnused(IOAudioStream, 20); + OSMetaClassDeclareReservedUnused(IOAudioStream, 21); + OSMetaClassDeclareReservedUnused(IOAudioStream, 22); + OSMetaClassDeclareReservedUnused(IOAudioStream, 23); + OSMetaClassDeclareReservedUnused(IOAudioStream, 24); + OSMetaClassDeclareReservedUnused(IOAudioStream, 25); + OSMetaClassDeclareReservedUnused(IOAudioStream, 26); + OSMetaClassDeclareReservedUnused(IOAudioStream, 27); + OSMetaClassDeclareReservedUnused(IOAudioStream, 28); + OSMetaClassDeclareReservedUnused(IOAudioStream, 29); + OSMetaClassDeclareReservedUnused(IOAudioStream, 30); + OSMetaClassDeclareReservedUnused(IOAudioStream, 31); + OSMetaClassDeclareReservedUnused(IOAudioStream, 32); + OSMetaClassDeclareReservedUnused(IOAudioStream, 33); + OSMetaClassDeclareReservedUnused(IOAudioStream, 34); + OSMetaClassDeclareReservedUnused(IOAudioStream, 35); + OSMetaClassDeclareReservedUnused(IOAudioStream, 36); + OSMetaClassDeclareReservedUnused(IOAudioStream, 37); + OSMetaClassDeclareReservedUnused(IOAudioStream, 38); + OSMetaClassDeclareReservedUnused(IOAudioStream, 39); + OSMetaClassDeclareReservedUnused(IOAudioStream, 40); + OSMetaClassDeclareReservedUnused(IOAudioStream, 41); + OSMetaClassDeclareReservedUnused(IOAudioStream, 42); + OSMetaClassDeclareReservedUnused(IOAudioStream, 43); + OSMetaClassDeclareReservedUnused(IOAudioStream, 44); + OSMetaClassDeclareReservedUnused(IOAudioStream, 45); + OSMetaClassDeclareReservedUnused(IOAudioStream, 46); + OSMetaClassDeclareReservedUnused(IOAudioStream, 47); + +public: + virtual bool initWithAudioEngine(IOAudioEngine *engine, IOAudioStreamDirection dir, UInt32 startChannelID, const char *streamDescription = NULL, OSDictionary *properties = 0); + virtual void free(); + + virtual void stop(IOService *provider); + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOReturn setProperties(OSObject *properties); + + virtual IOAudioStreamDirection getDirection(); + + virtual void setSampleBuffer(void *buffer, UInt32 size); + virtual void *getSampleBuffer(); + virtual UInt32 getSampleBufferSize(); + + virtual void setMixBuffer(void *buffer, UInt32 size); + virtual void *getMixBuffer(); + virtual UInt32 getMixBufferSize(); + + virtual void numSampleFramesPerBufferChanged(); + + virtual void clearSampleBuffer(); + + virtual void setIOFunction(AudioIOFunction ioFunction); + virtual void setIOFunctionList(const AudioIOFunction *ioFunctionList, UInt32 numFunctions); + + virtual const IOAudioStreamFormat *getFormat(); + static IOReturn setFormatAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, bool callDriver = true); + virtual IOReturn setFormat(OSDictionary *formatDict); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, OSDictionary *formatDict, bool callDriver = true); + virtual IOReturn hardwareFormatChanged(const IOAudioStreamFormat *streamFormat); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction); + virtual void clearAvailableFormats(); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatDesc *formatDesc); + + virtual UInt32 getStartingChannelID(); + virtual UInt32 getMaxNumChannels(); + + virtual void setStreamAvailable(bool available); + virtual bool getStreamAvailable(); + + virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl); + virtual void removeDefaultAudioControls(); + +protected: + virtual void lockStreamForIO(); + virtual void unlockStreamForIO(); + + virtual void updateNumClients(); + virtual IOReturn addClient(IOAudioClientBuffer *clientBuffer); + virtual void removeClient(IOAudioClientBuffer *clientBuffer); + virtual UInt32 getNumClients(); + + virtual IOReturn processOutputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame, UInt32 loopCount, bool samplesAvailable); + virtual IOReturn readInputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame); + + virtual void resetClipInfo(); + virtual void clipIfNecessary(); + virtual void clipOutputSamples(UInt32 startingSampleFrame, UInt32 numSampleFrames); + + virtual void setStartingChannelNumber(UInt32 channelNumber); + +private: + virtual void setDirection(IOAudioStreamDirection dir); + +}; + +#endif /* _IOKIT_IOAUDIOSTREAM_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioToggleControl.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioToggleControl.h.svn-base new file mode 100644 index 0000000..95bfb4a --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioToggleControl.h.svn-base @@ -0,0 +1,121 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOTOGGLECONTROL_H +#define _IOKIT_IOAUDIOTOGGLECONTROL_H + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +/*! + * @class IOAudioToggleControl + */ + +class IOAudioToggleControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioToggleControl) + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +// New code added here +public: + /*! + * @function createPassThruMuteControl + * @abstract Allocates a new pass through mute control with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns a newly allocated and initialized mute IOAudioControl + */ + static IOAudioToggleControl *createPassThruMuteControl (bool initialValue, + UInt32 channelID, + const char *channelName, + UInt32 cntrlID); + +private: + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 0); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 1); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 2); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 15); + +public: + /*! + * @function create + * @abstract Allocates a new mute control with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns a newly allocated and initialized mute IOAudioControl + */ + static IOAudioToggleControl *create(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + static IOAudioToggleControl *createMuteControl(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 usage = 0); + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioToggleControl with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns truen on success + */ + virtual bool init(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + +}; + +#endif /* _IOKIT_IOAUDIOTOGGLECONTROL_H */ diff --git a/i386/include/IOKit/audio/.svn/text-base/IOAudioTypes.h.svn-base b/i386/include/IOKit/audio/.svn/text-base/IOAudioTypes.h.svn-base new file mode 100644 index 0000000..0526575 --- /dev/null +++ b/i386/include/IOKit/audio/.svn/text-base/IOAudioTypes.h.svn-base @@ -0,0 +1,661 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOTYPES_H +#define _IOKIT_IOAUDIOTYPES_H + +#include +#include +#include + + +/*! + * @enum IOAudioEngineMemory + * @abstract Used to identify the type of memory requested by a client process to be mapped into its process space + * @discussion This is the parameter to the type field of IOMapMemory when called on an IOAudioEngine. This is + * only intended for use by the Audio Device API library. + * @constant kIOAudioSampleBuffer This requests the IOAudioEngine's sample buffer + * @constant kIOAudioStatusBuffer This requests the IOAudioEngine's status buffer. It's type is IOAudioEngineStatus. + * @constant kIOAudioMixBuffer This requests the IOAudioEngine's mix buffer +*/ +typedef enum _IOAudioEngineMemory { + kIOAudioStatusBuffer = 0, + kIOAudioSampleBuffer = 1, + kIOAudioMixBuffer = 2, + kIOAudioBytesInInputBuffer = 3, + kIOAudioBytesInOutputBuffer = 4 +} IOAudioEngineMemory; + +/*! + * @enum IOAudioEngineCalls + * @abstract The set of constants passed to IOAudioEngineUserClient::getExternalMethodForIndex() when making calls + * from the IOAudioFamily user client code. + */ +typedef enum _IOAudioEngineCalls { + kIOAudioEngineCallRegisterClientBuffer = 0, + kIOAudioEngineCallUnregisterClientBuffer = 1, + kIOAudioEngineCallGetConnectionID = 2, + kIOAudioEngineCallStart = 3, + kIOAudioEngineCallStop = 4, + kIOAudioEngineCallGetNearestStartTime = 5 +} IOAudioEngineCalls; + +/*! @defined kIOAudioEngineNumCalls The number of elements in the IOAudioEngineCalls enum. */ +#define kIOAudioEngineNumCalls 6 + +typedef enum _IOAudioEngineTraps { + kIOAudioEngineTrapPerformClientIO = 0 +} IOAudioEngineTraps; + +typedef enum _IOAudioEngineNotifications { + kIOAudioEngineAllNotifications = 0, + kIOAudioEngineStreamFormatChangeNotification = 1, + kIOAudioEngineChangeNotification = 2, + kIOAudioEngineStartedNotification = 3, + kIOAudioEngineStoppedNotification = 4, + kIOAudioEnginePausedNotification = 5, + kIOAudioEngineResumedNotification = 6 +} IOAudioEngineNotifications; + +/*! + * @enum IOAudioEngineState + * @abstract Represents the state of an IOAudioEngine + * @constant kIOAudioEngineRunning The IOAudioEngine is currently running - it is transferring data to or + * from the device. + * @constant kIOAudioEngineStopped The IOAudioEngine is currently stopped - no activity is occurring. + */ + +typedef enum _IOAudioEngineState { + kIOAudioEngineStopped = 0, + kIOAudioEngineRunning = 1, + kIOAudioEnginePaused = 2, + kIOAudioEngineResumed = 3 +} IOAudioEngineState; + + +/*! + * @typedef IOAudioEngineStatus + * @abstract Shared-memory structure giving audio engine status + * @discussion + * @field fVersion Indicates version of this structure + * @field fCurrentLoopCount Number of times around the ring buffer since the audio engine started + * @field fLastLoopTime Timestamp of the last time the ring buffer wrapped + * @field fEraseHeadSampleFrame Location of the erase head in sample frames - erased up to but not + * including the given sample frame + */ + +typedef struct _IOAudioEngineStatus { + UInt32 fVersion; + volatile UInt32 fCurrentLoopCount; + volatile AbsoluteTime fLastLoopTime; + volatile UInt32 fEraseHeadSampleFrame; +} IOAudioEngineStatus; + +#define kIOAudioEngineCurrentStatusStructVersion 2 + +typedef struct _IOAudioStreamFormat { + UInt32 fNumChannels; + UInt32 fSampleFormat; + UInt32 fNumericRepresentation; + UInt8 fBitDepth; + UInt8 fBitWidth; + UInt8 fAlignment; + UInt8 fByteOrder; + UInt8 fIsMixable; + UInt32 fDriverTag; +} IOAudioStreamFormat; + +#define kFormatExtensionInvalidVersion 0 +#define kFormatExtensionCurrentVersion 1 + +typedef struct _IOAudioStreamFormatExtension { + UInt32 fVersion; + UInt32 fFlags; + UInt32 fFramesPerPacket; + UInt32 fBytesPerPacket; +} IOAudioStreamFormatExtension; + +typedef struct _IOAudioBufferDataDescriptor { + UInt32 fActualDataByteSize; + UInt32 fActualNumSampleFrames; + UInt32 fTotalDataByteSize; + UInt32 fNominalDataByteSize; + UInt8 fData[1]; +} IOAudioBufferDataDescriptor; + +#define kStreamDataDescriptorInvalidVersion 0 +#define kStreamDataDescriptorCurrentVersion 1 + +typedef struct _IOAudioStreamDataDescriptor { + UInt32 fVersion; + UInt32 fNumberOfStreams; + UInt32 fStreamLength[1]; // Array with fNumberOfStreams number of entries +} IOAudioStreamDataDescriptor; + +typedef struct _IOAudioSampleIntervalDescriptor { + UInt32 sampleIntervalHi; + UInt32 sampleIntervalLo; +} IOAudioSampleIntervalDescriptor; + +/*! + @struct SMPTETime + @abstract A structure for holding a SMPTE time. + @field fSubframes + The number of subframes in the full message. + @field fSubframeDivisor + The number of subframes per frame (typically 80). + @field fCounter + The total number of messages received. + @field fType + The kind of SMPTE time using the SMPTE time type constants. + @field fFlags + A set of flags that indicate the SMPTE state. + @field fHours + The number of hourse in the full message. + @field fMinutes + The number of minutes in the full message. + @field fSeconds + The number of seconds in the full message. + @field fFrames + The number of frames in the full message. +*/ +typedef struct _IOAudioSMPTETime +{ + SInt16 fSubframes; + SInt16 fSubframeDivisor; + UInt32 fCounter; + UInt32 fType; + UInt32 fFlags; + SInt16 fHours; + SInt16 fMinutes; + SInt16 fSeconds; + SInt16 fFrames; + +} IOAudioSMPTETime; + +// constants describing SMPTE types (taken from the MTC spec) +enum +{ + kIOAudioSMPTETimeType24 = 0, + kIOAudioSMPTETimeType25 = 1, + kIOAudioSMPTETimeType30Drop = 2, + kIOAudioSMPTETimeType30 = 3, + kIOAudioSMPTETimeType2997 = 4, + kIOAudioSMPTETimeType2997Drop = 5 +}; + +// flags describing a SMPTE time stamp +enum +{ + kIOAudioSMPTETimeValid = (1L << 0), // the full time is valid + kIOAudioSMPTETimeRunning = (1L << 1) // time is running +}; + +// A struct for encapsulating the parts of a time stamp. The flags +// say which fields are valid. +typedef struct _IOAudioTimeStamp +{ + UInt64 fSampleTime; // the absolute sample time, was a Float64 + UInt64 fHostTime; // the host's root timebase's time + UInt64 fRateScalar; // the system rate scalar, was a Float64 + UInt64 fWordClockTime; // the word clock time + IOAudioSMPTETime fSMPTETime; // the SMPTE time + UInt32 fFlags; // the flags indicate which fields are valid + UInt32 fReserved; // reserved, pads the structure out to force 8 byte alignment +} IOAudioTimeStamp; + +// flags for the AudioTimeStamp sturcture +enum +{ + kIOAudioTimeStampSampleTimeValid = (1L << 0), + kIOAudioTimeStampHostTimeValid = (1L << 1), + kIOAudioTimeStampRateScalarValid = (1L << 2), + kIOAudioTimeStampWordClockTimeValid = (1L << 3), + kIOAudioTimeStampSMPTETimeValid = (1L << 4) +}; + +// Some commonly used combinations of timestamp flags +enum +{ + kIOAudioTimeStampSampleHostTimeValid = (kIOAudioTimeStampSampleTimeValid | kIOAudioTimeStampHostTimeValid) +}; + +/*! +* @enum IOAudioStreamDirection + * @abstract Represents the direction of an IOAudioStream + * @constant kIOAudioStreamDirectionOutput Output buffer + * @constant kIOAudioStreamDirectionInput Input buffer + */ + +typedef enum _IOAudioStreamDirection { + kIOAudioStreamDirectionOutput = 0, + kIOAudioStreamDirectionInput = 1 +} IOAudioStreamDirection; + +enum { + kIOAudioDeviceCanBeDefaultNothing = 0, + kIOAudioDeviceCanBeDefaultInput = (1L << 0), + kIOAudioDeviceCanBeDefaultOutput = (1L << 1), + kIOAudioDeviceCanBeSystemOutput = (1L << 2) +}; + +/*! + * @defined kIOAudioEngineDefaultMixBufferSampleSize + */ + +#define kIOAudioEngineDefaultMixBufferSampleSize sizeof(float) + +/* The following are for use only by the IOKit.framework audio family code */ + +/*! + * @enum IOAudioControlCalls + * @abstract The set of constants passed to IOAudioControlUserClient::getExternalMethodForIndex() when making calls + * from the IOAudioFamily user client code. + * @constant kIOAudioControlCallSetValue Used to set the value of an IOAudioControl. + * @constant kIOAudioControlCallGetValue Used to get the value of an IOAudioControl. + */ +typedef enum _IOAudioControlCalls { + kIOAudioControlCallSetValue = 0, + kIOAudioControlCallGetValue = 1 +} IOAudioControlCalls; + +/*! @defined kIOAudioControlNumCalls The number of elements in the IOAudioControlCalls enum. */ +#define kIOAudioControlNumCalls 2 + +/*! + * @enum IOAudioControlNotifications + * @abstract The set of constants passed in the type field of IOAudioControlUserClient::registerNotificaitonPort(). + * @constant kIOAudioControlValueChangeNotification Used to request value change notifications. + * @constant kIOAudioControlRangeChangeNotification Used to request range change notifications. + */ +typedef enum _IOAudioControlNotifications { + kIOAudioControlValueChangeNotification = 0, + kIOAudioControlRangeChangeNotification = 1 +} IOAudioControlNotifications; + +/*! + * @struct IOAudioNotificationMessage + * @abstract Used in the mach message for IOAudio notifications. + * @field messageHeader Standard mach message header + * @field ref The param passed to registerNotificationPort() in refCon. + */ +typedef struct _IOAudioNotificationMessage { + mach_msg_header_t messageHeader; + UInt32 type; + UInt32 ref; + void * sender; +} IOAudioNotificationMessage; + +typedef struct _IOAudioSampleRate { + UInt32 whole; + UInt32 fraction; +} IOAudioSampleRate; + +#define kNoIdleAudioPowerDown 0xffffffffffffffffULL + +enum { + kIOAudioPortTypeOutput = 'outp', + kIOAudioPortTypeInput = 'inpt', + kIOAudioPortTypeMixer = 'mixr', + kIOAudioPortTypePassThru = 'pass', + kIOAudioPortTypeProcessing = 'proc' +}; + +enum { + kIOAudioOutputPortSubTypeInternalSpeaker = 'ispk', + kIOAudioOutputPortSubTypeExternalSpeaker = 'espk', + kIOAudioOutputPortSubTypeHeadphones = 'hdpn', + kIOAudioOutputPortSubTypeLine = 'line', + kIOAudioOutputPortSubTypeSPDIF = 'spdf', + + kIOAudioInputPortSubTypeInternalMicrophone = 'imic', + kIOAudioInputPortSubTypeExternalMicrophone = 'emic', + kIOAudioInputPortSubTypeCD = 'cd ', + kIOAudioInputPortSubTypeLine = 'line', + kIOAudioInputPortSubTypeSPDIF = 'spdf' +}; + +enum { + kIOAudioControlTypeLevel = 'levl', + kIOAudioControlTypeToggle = 'togl', + kIOAudioControlTypeJack = 'jack', + kIOAudioControlTypeSelector = 'slct' +}; + +enum { + kIOAudioLevelControlSubTypeVolume = 'vlme', + kIOAudioLevelControlSubTypeLFEVolume = 'subv', + kIOAudioLevelControlSubTypePRAMVolume = 'pram', + kIOAudioToggleControlSubTypeMute = 'mute', + kIOAudioToggleControlSubTypeSolo = 'solo', + kIOAudioToggleControlSubTypeLFEMute = 'subm', + kIOAudioToggleControlSubTypeiSubAttach = 'atch', + kIOAudioSelectorControlSubTypeOutput = 'outp', + kIOAudioSelectorControlSubTypeInput = 'inpt', + kIOAudioSelectorControlSubTypeClockSource = 'clck', + kIOAudioSelectorControlSubTypeDestination = 'dest', + kIOAudioSelectorControlSubTypeChannelNominalLineLevel = 'nlev', + kIOAudioSelectorControlSubTypeChannelLevelPlus4dBu = '4dbu', + kIOAudioSelectorControlSubTypeChannelLevelMinus10dBV = '10db', + kIOAudioSelectorControlSubTypeChannelLevelMinus20dBV = '20db', + kIOAudioSelectorControlSubTypeChannelLevelMicLevel = 'micl', + kIOAudioSelectorControlSubTypeChannelLevelInstrumentLevel = 'istl' +}; + +enum { + kIOAudioControlUsageOutput = 'outp', + kIOAudioControlUsageInput = 'inpt', + kIOAudioControlUsagePassThru = 'pass', + kIOAudioControlUsageCoreAudioProperty = 'prop' +}; + +enum { + kIOAudioControlChannelNumberInactive = -1, + kIOAudioControlChannelIDAll = 0, + kIOAudioControlChannelIDDefaultLeft = 1, + kIOAudioControlChannelIDDefaultRight = 2, + kIOAudioControlChannelIDDefaultCenter = 3, + kIOAudioControlChannelIDDefaultLeftRear = 4, + kIOAudioControlChannelIDDefaultRightRear = 5, + kIOAudioControlChannelIDDefaultSub = 6, + kIOAudioControlChannelIDDefaultFrontLeftCenter = 7, + kIOAudioControlChannelIDDefaultFrontRightCenter = 8, + kIOAudioControlChannelIDDefaultRearCenter = 9, + kIOAudioControlChannelIDDefaultSurroundLeft = 10, + kIOAudioControlChannelIDDefaultSurroundRight = 11 +}; + +enum { + kIOAudioSelectorControlSelectionValueNone = 'none', + + // Output-specific selection IDs + kIOAudioSelectorControlSelectionValueInternalSpeaker = 'ispk', + kIOAudioSelectorControlSelectionValueExternalSpeaker = 'espk', + kIOAudioSelectorControlSelectionValueHeadphones = 'hdpn', + + // Input-specific selection IDs + kIOAudioSelectorControlSelectionValueInternalMicrophone = 'imic', + kIOAudioSelectorControlSelectionValueExternalMicrophone = 'emic', + kIOAudioSelectorControlSelectionValueCD = 'cd ', + + // Common selection IDs + kIOAudioSelectorControlSelectionValueLine = 'line', + kIOAudioSelectorControlSelectionValueSPDIF = 'spdf' +}; + +enum { + kIOAudioStreamSampleFormatLinearPCM = 'lpcm', + kIOAudioStreamSampleFormatIEEEFloat = 'ieee', + kIOAudioStreamSampleFormatALaw = 'alaw', + kIOAudioStreamSampleFormatMuLaw = 'ulaw', + kIOAudioStreamSampleFormatMPEG = 'mpeg', + kIOAudioStreamSampleFormatAC3 = 'ac-3', + kIOAudioStreamSampleFormat1937AC3 = 'cac3', + kIOAudioStreamSampleFormat1937MPEG1 = 'mpg1', + kIOAudioStreamSampleFormat1937MPEG2 = 'mpg2', + kIOAudioStreamSampleFormatTimeCode = 'time' // a stream of IOAudioTimeStamp structures that capture any incoming time code information +}; + +enum { + kIOAudioStreamNumericRepresentationSignedInt = 'sint', + kIOAudioStreamNumericRepresentationUnsignedInt = 'uint', + kIOAudioStreamNumericRepresentationIEEE754Float = 'flot' +}; + +enum { + kIOAudioClockSelectorTypeInternal = 'int ', + kIOAudioClockSelectorTypeExternal = 'ext ', + kIOAudioClockSelectorTypeAESEBU = 'asbu', + kIOAudioClockSelectorTypeTOSLink = 'tosl', + kIOAudioClockSelectorTypeSPDIF = 'spdf', + kIOAudioClockSelectorTypeADATOptical = 'adto', + kIOAudioClockSelectorTypeADAT9Pin = 'adt9', + kIOAudioClockSelectorTypeSMPTE = 'smpt', + kIOAudioClockSelectorTypeVideo = 'vdeo', + kIOAudioClockSelectorTypeControl = 'cnrl', + kIOAudioClockSelectorTypeOther = 'othr', +}; + +enum { + kIOAudioStreamAlignmentLowByte = 0, + kIOAudioStreamAlignmentHighByte = 1 +}; + +enum { + kIOAudioStreamByteOrderBigEndian = 0, + kIOAudioStreamByteOrderLittleEndian = 1 +}; + +enum { + kIOAudioLevelControlNegativeInfinity = 0xffffffff +}; + +enum { + kIOAudioNewClockDomain = 0xffffffff +}; + +// Device connection types +#ifndef __OPEN_SOURCE__ +// Added kIOAudioDeviceTransportTypeDisplayPort +#endif +enum { + kIOAudioDeviceTransportTypeBuiltIn = 'bltn', + kIOAudioDeviceTransportTypePCI = 'pci ', + kIOAudioDeviceTransportTypeUSB = 'usb ', + kIOAudioDeviceTransportTypeFireWire = '1394', + kIOAudioDeviceTransportTypeNetwork = 'ntwk', + kIOAudioDeviceTransportTypeWireless = 'wrls', + kIOAudioDeviceTransportTypeOther = 'othr', + kIOAudioDeviceTransportTypeBluetooth = 'blue', + kIOAudioDeviceTransportTypeVirtual = 'virt', + kIOAudioDeviceTransportTypeDisplayPort = 'dprt', + kIOAudioDeviceTransportTypeHdmi = 'hdmi' + +}; + +// types that go nowhere +enum { + OUTPUT_NULL = 0x0100, + INPUT_NULL = 0x0101 +}; + +// Input terminal types +enum { + INPUT_UNDEFINED = 0x0200, + INPUT_MICROPHONE = 0x0201, + INPUT_DESKTOP_MICROPHONE = 0x0202, + INPUT_PERSONAL_MICROPHONE = 0x0203, + INPUT_OMNIDIRECTIONAL_MICROPHONE = 0x0204, + INPUT_MICROPHONE_ARRAY = 0x0205, + INPUT_PROCESSING_MICROPHONE_ARRAY = 0x0206, + INPUT_MODEM_AUDIO = 0x207 +}; + +// Output terminal types +enum { + OUTPUT_UNDEFINED = 0x0300, + OUTPUT_SPEAKER = 0x0301, + OUTPUT_HEADPHONES = 0x0302, + OUTPUT_HEAD_MOUNTED_DISPLAY_AUDIO = 0x0303, + OUTPUT_DESKTOP_SPEAKER = 0x0304, + OUTPUT_ROOM_SPEAKER = 0x0305, + OUTPUT_COMMUNICATION_SPEAKER = 0x0306, + OUTPUT_LOW_FREQUENCY_EFFECTS_SPEAKER = 0x0307 +}; + +// Bi-directional terminal types +enum { + BIDIRECTIONAL_UNDEFINED = 0x0400, + BIDIRECTIONAL_HANDSET = 0x0401, + BIDIRECTIONAL_HEADSET = 0x0402, + BIDIRECTIONAL_SPEAKERPHONE_NO_ECHO_REDX = 0x0403, + BIDIRECTIONAL_ECHO_SUPPRESSING_SPEAKERPHONE = 0x0404, + BIDIRECTIONAL_ECHO_CANCELING_SPEAKERPHONE = 0x0405 +}; + +// Telephony terminal types +enum { + TELEPHONY_UNDEFINED = 0x0500, + TELEPHONY_PHONE_LINE = 0x0501, + TELEPHONY_TELEPHONE = 0x0502, + TELEPHONY_DOWN_LINE_PHONE = 0x0503 +}; + +// External terminal types +enum { + EXTERNAL_UNDEFINED = 0x0600, + EXTERNAL_ANALOG_CONNECTOR = 0x0601, + EXTERNAL_DIGITAL_AUDIO_INTERFACE = 0x0602, + EXTERNAL_LINE_CONNECTOR = 0x0603, + EXTERNAL_LEGACY_AUDIO_CONNECTOR = 0x0604, + EXTERNAL_SPDIF_INTERFACE = 0x0605, + EXTERNAL_1394_DA_STREAM = 0x0606, + EXTERNAL_1394_DV_STREAM_SOUNDTRACK = 0x0607, + EXTERNAL_ADAT = 0x0608, + EXTERNAL_TDIF = 0x0609, + EXTERNAL_MADI = 0x060A +}; + +// Embedded terminal types +enum { + EMBEDDED_UNDEFINED = 0x0700, + EMBEDDED_LEVEL_CALIBRATION_NOISE_SOURCE = 0x0701, + EMBEDDED_EQUALIZATION_NOISE = 0x0702, + EMBEDDED_CD_PLAYER = 0x0703, + EMBEDDED_DAT = 0x0704, + EMBEDDED_DCC = 0x0705, + EMBEDDED_MINIDISK = 0x0706, + EMBEDDED_ANALOG_TAPE = 0x0707, + EMBEDDED_PHONOGRAPH = 0x0708, + EMBEDDED_VCR_AUDIO = 0x0709, + EMBEDDED_VIDEO_DISC_AUDIO = 0x070A, + EMBEDDED_DVD_AUDIO = 0x070B, + EMBEDDED_TV_TUNER_AUDIO = 0x070C, + EMBEDDED_SATELLITE_RECEIVER_AUDIO = 0x070D, + EMBEDDED_CABLE_TUNER_AUDIO = 0x070E, + EMBEDDED_DSS_AUDIO = 0x070F, + EMBEDDED_RADIO_RECEIVER = 0x0710, + EMBEDDED_RADIO_TRANSMITTER = 0x0711, + EMBEDDED_MULTITRACK_RECORDER = 0x0712, + EMBEDDED_SYNTHESIZER = 0x0713 +}; + +// Processing terminal types +enum { + PROCESSOR_UNDEFINED = 0x0800, + PROCESSOR_GENERAL = 0x0801 +}; + +// Channel spatial position types + +#ifndef __OPEN_SOURCE__ +// NOTE: the following are derived from CoreAudioTypes.h +#endif + +#define kIOAudioChannelLabel_Discrete_field_ba 16 +enum { + kIOAudioChannelLabel_Unknown = 0xFFFFFFFF, // unknown or unspecified other use + kIOAudioChannelLabel_Unused = 0, // channel is present, but has no intended use or destination + kIOAudioChannelLabel_UseCoordinates = 100, // channel is described by the mCoordinates fields. + + kIOAudioChannelLabel_Left = 1, + kIOAudioChannelLabel_Right = 2, + kIOAudioChannelLabel_Center = 3, + kIOAudioChannelLabel_LFEScreen = 4, + kIOAudioChannelLabel_LeftSurround = 5, // WAVE: "Back Left" + kIOAudioChannelLabel_RightSurround = 6, // WAVE: "Back Right" + kIOAudioChannelLabel_LeftCenter = 7, + kIOAudioChannelLabel_RightCenter = 8, + kIOAudioChannelLabel_CenterSurround = 9, // WAVE: "Back Center" or plain "Rear Surround" + kIOAudioChannelLabel_LeftSurroundDirect = 10, // WAVE: "Side Left" + kIOAudioChannelLabel_RightSurroundDirect = 11, // WAVE: "Side Right" + kIOAudioChannelLabel_TopCenterSurround = 12, + kIOAudioChannelLabel_VerticalHeightLeft = 13, // WAVE: "Top Front Left" + kIOAudioChannelLabel_VerticalHeightCenter = 14, // WAVE: "Top Front Center" + kIOAudioChannelLabel_VerticalHeightRight = 15, // WAVE: "Top Front Right" + + kIOAudioChannelLabel_TopBackLeft = 16, + kIOAudioChannelLabel_TopBackCenter = 17, + kIOAudioChannelLabel_TopBackRight = 18, + + kIOAudioChannelLabel_RearSurroundLeft = 33, + kIOAudioChannelLabel_RearSurroundRight = 34, + kIOAudioChannelLabel_LeftWide = 35, + kIOAudioChannelLabel_RightWide = 36, + kIOAudioChannelLabel_LFE2 = 37, + kIOAudioChannelLabel_LeftTotal = 38, // matrix encoded 4 channels + kIOAudioChannelLabel_RightTotal = 39, // matrix encoded 4 channels + kIOAudioChannelLabel_HearingImpaired = 40, + kIOAudioChannelLabel_Narration = 41, + kIOAudioChannelLabel_Mono = 42, + kIOAudioChannelLabel_DialogCentricMix = 43, + + kIOAudioChannelLabel_CenterSurroundDirect = 44, // back center, non diffuse + + kIOAudioChannelLabel_Haptic = 45, + + // first order ambisonic channels + kIOAudioChannelLabel_Ambisonic_W = 200, + kIOAudioChannelLabel_Ambisonic_X = 201, + kIOAudioChannelLabel_Ambisonic_Y = 202, + kIOAudioChannelLabel_Ambisonic_Z = 203, + + // Mid/Side Recording + kIOAudioChannelLabel_MS_Mid = 204, + kIOAudioChannelLabel_MS_Side = 205, + + // X-Y Recording + kIOAudioChannelLabel_XY_X = 206, + kIOAudioChannelLabel_XY_Y = 207, + + // other + kIOAudioChannelLabel_HeadphonesLeft = 301, + kIOAudioChannelLabel_HeadphonesRight = 302, + kIOAudioChannelLabel_ClickTrack = 304, + kIOAudioChannelLabel_ForeignLanguage = 305, + + // generic discrete channel + kIOAudioChannelLabel_Discrete = 400, + + // numbered discrete channel + kIOAudioChannelLabel_Discrete_0 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 0, + kIOAudioChannelLabel_Discrete_1 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 1, + kIOAudioChannelLabel_Discrete_2 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 2, + kIOAudioChannelLabel_Discrete_3 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 3, + kIOAudioChannelLabel_Discrete_4 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 4, + kIOAudioChannelLabel_Discrete_5 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 5, + kIOAudioChannelLabel_Discrete_6 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 6, + kIOAudioChannelLabel_Discrete_7 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 7, + kIOAudioChannelLabel_Discrete_8 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 8, + kIOAudioChannelLabel_Discrete_9 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 9, + kIOAudioChannelLabel_Discrete_10 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 10, + kIOAudioChannelLabel_Discrete_11 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 11, + kIOAudioChannelLabel_Discrete_12 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 12, + kIOAudioChannelLabel_Discrete_13 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 13, + kIOAudioChannelLabel_Discrete_14 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 14, + kIOAudioChannelLabel_Discrete_15 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 15, + kIOAudioChannelLabel_Discrete_65535 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 65535 +}; + + + +#endif /* _IOKIT_IOAUDIOTYPES_H */ diff --git a/i386/include/IOKit/audio/IOAudioControl.h b/i386/include/IOKit/audio/IOAudioControl.h new file mode 100644 index 0000000..d1d9019 --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioControl.h @@ -0,0 +1,595 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOCONTROL_H +#define _IOKIT_IOAUDIOCONTROL_H + +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioEngine.h" +#endif + +class IOAudioPort; +class OSDictionary; +class OSSet; +class IOAudioUserClient; +class IOAudioControlUserClient; +class IOWorkLoop; +class IOCommandGate; + +/*! + * @class IOAudioControl + * @abstract Represents any controllable attribute of an IOAudioDevice. + * @discussion An IOAudioControl instance may belong to one IOAudioPort. Additionally, it may associated + * with an IOAudioEngine as a default control for that IOAudioEngine. + * + * When its value changes, it sends a notification to the CoreAudio.framework (HAL). It also makes a call + * to the ValueChangeHandler. + * + * The base IOAudioControl class contains a type, a value and a channel ID representing the channel(s) which + * the control acts on. It may also contain a readable format for the name of the channel as well as a + * control ID that can be used to identify unique controls. Additionally it may contain a subType and a usage. + * Each type has its own set of possible subTypes. There currently four different control types defined: + * kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * Each one is represented by a subclass of IOAudioControl: IOAudioLevelControl, IOAudioToggleControl, + * IOAudioSelectorControl. The level control defines a range of allowed values and has + * a defined subtype of kIOAudioLevelControlSubTypeVolume used to define a volume control. The toggle control + * allows for a boolean value and has a defined subtype kIOAudioToggleControlSubTypeMute for a mute control. The + * selector control has a list of allowed selections with a value and description for each allowed selection and + * has the following sub types: kIOAudioSelectorControlSubTypeOutput for an output selector and + * kIOAudioSelectorControlSubTypeInput for an input selector. See the subclass documentation for a more + * complete description of each + * + * There are enums for default channel ID values and common channel names in IOAudioTypes.h. The channel ID + * values are prefixed with 'kIOAudioControlChannelID' and the common channel names are prefixed with + * 'kIOAudioControlChannelName'. All of the attributes of the IOAudioControl are stored in the registry. + * The key used for each attribute is defined in IOAudioTypes.h with the define matching the following + * pattern: 'kIOAudioControlKey'. For example: kIOAudioControlChannelIDKey. + * + * In addition to the existing defined control types, drivers can define their own as well for other purposes. + * + * Changes to the IOAudioControl's value made by the CoreAudio.framework are done through the IORegistry. + * When the CoreAudio.framework initiates a value change, the control receives a setProperties() message. + * The setProperties() implementation looks for the property 'IOAudioControlValue' and if present, calls + * setValue() on the driver's IOWorkLoop with the new value. The setValue() function first checks to see + * if the new value is different. If so, it calls performValueChange() to call through to the driver + * to make the change in the hardware. If that call succeeds the value is changed and the new value is set + * in the registry. Additionally notifications are sent to all clients that have registered for them. + */ +class IOAudioControl : public IOService +{ + friend class IOAudioPort; + friend class IOAudioDevice; + friend class IOAudioEngine; + + OSDeclareDefaultStructors(IOAudioControl) + +public: + + /*! + * @typedef IntValueChangeHandler + * @abstract Handler function used to make a notification when a value is to be changed. + * @param target Reference supplied when the handler was registered. + * @param audioControl The IOAudioControl that is changing. + * @param oldValue The old value of the control. + * @param newValue The new value the control is being changed to. + * @result Must return kIOReturnSuccess when the hardware is successfully updated. + */ + typedef IOReturn (*IntValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, SInt32 oldValue, SInt32 newValue); + typedef IOReturn (*DataValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, const void *oldData, UInt32 oldDataSize, const void *newData, UInt32 newDataSize); + typedef IOReturn (*ObjectValueChangeHandler)(OSObject *target, IOAudioControl *audioControl, OSObject *oldValue, OSObject *newValue); + +protected: + /*! @var workLoop + The IOWorkLoop for the audio driver - shared from the IOAudioDevice. + */ + IOWorkLoop *workLoop; + /*! @var commandGate + The IOCommandGate for this control - attached to the driver's IOWorkLoop. + */ + IOCommandGate *commandGate; + + /*! @var isStarted + Internal state keeping track of when the IOAudioControl has been started. + */ + bool isStarted; + + /*! @var controlID + An optional identifier that can be used to identify the control. + */ + UInt32 controlID; + /*! @var channelID + The ID of the channel this control affects - may be kIOAudioControlChannelIDAll if it represents all channels. + */ + UInt32 channelID; + + UInt32 type; + UInt32 subType; + UInt32 usage; + + OSObject *value; + + typedef enum { + kIntValueChangeHandler, + kDataValueChangeHandler, + kObjectValueChangeHandler + } ValueChangeHandlerType; + + ValueChangeHandlerType valueChangeHandlerType; + + union { + IntValueChangeHandler intHandler; + DataValueChangeHandler dataHandler; + ObjectValueChangeHandler objectHandler; + } valueChangeHandler; + + OSObject *valueChangeTarget; + + /*! @var clients + A list of user clients that have requested value change notifications. + */ + OSSet *userClients; + +protected: + struct ExpansionData { + IOAudioEngine * providerEngine; + OSArray * notificationQueue; + }; + + ExpansionData *reserved; + +public: + // OSMetaClassDeclareReservedUsed(IOAudioControl, 0); + virtual void sendChangeNotification(UInt32 notificationType); + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 1); + /*! + * @function setReadOnlyFlag + * @abstract Call this function to say that a control is read only. + * This call cannot be undone, so if a control is only temporarily unsetable, + * do not use this call but instead return an error from the control handler. + */ + virtual void setReadOnlyFlag(); + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 2); + virtual void sendQueuedNotifications(void); + + // OSMetaClassDeclareReservedUsed(IOAudioControl, 3); + /*! + * @function createUserClient + * @abstract Creates a new IOAudioControlUserClient instance. + * @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality + * to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient + * and return a new, initialized instance of that subclass. + * A derived class that requires overriding of createUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client. + * @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful + * completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioControlUserClient **newUserClient, OSDictionary *properties); + +private: + OSMetaClassDeclareReservedUsed(IOAudioControl, 0); + OSMetaClassDeclareReservedUsed(IOAudioControl, 1); + OSMetaClassDeclareReservedUsed(IOAudioControl, 2); + OSMetaClassDeclareReservedUsed(IOAudioControl, 3); + + OSMetaClassDeclareReservedUnused(IOAudioControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioControl, 15); + OSMetaClassDeclareReservedUnused(IOAudioControl, 16); + OSMetaClassDeclareReservedUnused(IOAudioControl, 17); + OSMetaClassDeclareReservedUnused(IOAudioControl, 18); + OSMetaClassDeclareReservedUnused(IOAudioControl, 19); + OSMetaClassDeclareReservedUnused(IOAudioControl, 20); + OSMetaClassDeclareReservedUnused(IOAudioControl, 21); + OSMetaClassDeclareReservedUnused(IOAudioControl, 22); + OSMetaClassDeclareReservedUnused(IOAudioControl, 23); + +public: + + /*! + * @function withAttributes + * @abstract Static function that allocates a new IOAudioControl with the given attributes. + * @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently + * consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not + * defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @param subType An optional subType specific to the given type + * @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput, + * kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control + * on an IOAudioEngine. + * @result Returns a newly allocated and initialized IOAudioControl. + */ + static IOAudioControl *withAttributes(UInt32 type, + OSObject *initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioControl with the given attributes. + * @param type The type of the control. Common, known types are defined in IOAudioTypes.h. They currently + * consist of kIOAudioControlTypeLevel, kIOAudioControlTypeToggle, kIOAudioControlTypeSelector. + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioDefines.h. Any name not + * defined in IOAudioDefines.h must be localized in order to be properly displayed in multiple languages. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @param subType An optional subType specific to the given type + * @param usage An optional value specifying how the control will be used. Currently defined usages are kIOAudioControlUsageInput, + * kIOAudioControlUsageOutput and kIOAudioControlUsagePassThru. This value is used when a control is set as a default control + * on an IOAudioEngine. + * @param properties Standard property list passed to the init() function of any new IOService. This dictionary + * gets stored in the registry entry for this instance. + * @result Returns true on success. + */ + virtual bool init(UInt32 type, + OSObject *initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioControl. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + /*! + * @function start + * @abstract Starts a newly created IOAudioControl. + * @discussion This is called automatically by IOAudioPort when addAudioControl() is called or by IOAudioEngine + * when addDefaultAudioControl() is called. It will only be called by the first call to either addAudioControl() or + * addDefaultAudioControl(). + * @param provider The IOAudioPort or IOAudioEngine that owns this control. + * @result Returns true on success. + */ + virtual bool start(IOService *provider); + + virtual bool attachAndStart(IOService *provider); + + /*! + * @function getIsStarted + * @abstract Returns true after start() has been called. + * @discussion Used by IOAudioPort and IOAudioEngine to decide if the control needs to be started. + */ + virtual bool getIsStarted(); + + /*! + * @function stop + * @abstract Stops the control when the provider is going away. + * @param provider The IOAudioPort or IOAudioEngine that owns this control. + */ + virtual void stop(IOService *provider); + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the whole audio driver. + */ + virtual IOWorkLoop *getWorkLoop(); + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioControl. + */ + virtual IOCommandGate *getCommandGate(); + + /*! + * @function newUserClient + * @abstract Creates a new user client object for this IOAudioControl instance. + * @discussion This is called automatically by I/O Kit when a user process opens a connection to this + * IOAudioControl. This is typically done when the user process needs to register for value change + * notifications. This implementation allocates a new IOAudioControlUserClient object. There is no + * need to call this directly. + * A derived class that requires overriding of newUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client - 0 for the default user client type. + * @param handler The new IOUserClient * must be stored in this param on a successful completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory. + */ + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler); + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler); + + /*! + * @function createUserClient + * @abstract Creates a new IOAudioControlUserClient instance. + * @discussion This function is called by newUserClient() to create a new IOAudioControlUserClient instance. This function may be overridden by subclasses that need to add functionality + * to the IOAudioControlUserClient. In that case, they must subclass IOAudioControlUserClient + * and return a new, initialized instance of that subclass. + * A derived class that requires overriding of createUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client. + * @param newUserClient The IOAudioControlUserClient * must be stored in this param on a successful + * completion. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioControlUserClient **newUserClient); + + /*! + * @function clientClosed + * @abstract Called automatically by the IOAudioControlUserClient when a user client closes its + * connection to the control. + * @param client The user client object that has disconnected. + */ + virtual void clientClosed(IOAudioControlUserClient *client); + + /*! + * @function setProperties + * @abstract Changes a property of this IOService. + * @discussion This is called when the user client changes a property of this + * IOAudioControl. In this case it is used to change the value. This function + * looks for that property and then calls setValue() through the IOCommandGate and + * setValueAction(). + * @param properties An OSDictionary containing the properties to change. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn setProperties(OSObject *properties); + + virtual void setValueChangeHandler(IntValueChangeHandler intValueChangeHandler, OSObject *target); + virtual void setValueChangeHandler(DataValueChangeHandler dataValueChangeHandler, OSObject *target); + virtual void setValueChangeHandler(ObjectValueChangeHandler objectValueChangeHandler, OSObject *target); + + virtual void setValueChangeTarget(OSObject *target); + + /*! + * @function flushValue + * @abstract Forces the control to be flushed out to the hardware. + * @discussion This function calls performValueChange() directly with the current value of the IOAudioControl. + * @result Returns the result of performValueChange() - kIOReturnSuccess on success. + */ + virtual IOReturn flushValue(); + + /*! + * @function setValueAction + * @abstract IOCommandGate Action which calls setValue() while holding the IOCommandGate. + * @discussion This is needed to allow setValue() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The new value for the IOAudioControl. + * @result Returns the result of setValue() - kIOReturnSuccess on success. + */ + static IOReturn setValueAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + static IOReturn _setValueAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + + /*! + * @function setValue + * @abstract Sets the value for this control. + * @discussion When the control's value is changed, a call is made to performValueChange(). If that call + * succeeds, the value is set and sendValueChangeNotification() is called to send a notification to the + * user clients. This function must be called on the IOWorkLoop. + * @param newValue The new value for this control. + * @result Returns kIOReturnSuccess if the value is successfully set. + */ + virtual IOReturn setValue(OSObject *newValue); + + virtual IOReturn setValue(SInt32 intValue); + + /*! + * @function hardwareValueChanged + * @abstract Updates the value for this control and sends out the value changed notification. + * @discussion This is designed to be called by the driver when it detects that the hardware's value has + * changed without driver intervention (e.g. when an external event causes the change). The difference between + * hardwareValueChanged() and setValue() is that hardwareValueChanged() doesn't call performValueChange() which + * sends a message back to the driver to cause it to change the hardware with the new value. This function must + * be called on the IOWorkLoop. + * @param newValue The new value for this control. + * @result Returns kIOReturnSuccess if the value is successfully updated. + */ + virtual IOReturn hardwareValueChanged(OSObject *newValue); + + /*! + * @function getValue + * @abstract Returns the current value of the control. + */ + virtual OSObject *getValue(); + virtual SInt32 getIntValue(); + virtual const void *getDataBytes(); + virtual UInt32 getDataLength(); + + /*! + * @function getControlID + * @abstract Returns the control ID for the control. + */ + virtual UInt32 getControlID(); + + /*! + * @function getChannelID + * @abstract Returns the channel ID for the control. + */ + virtual UInt32 getChannelID(); + + virtual UInt32 getType(); + virtual UInt32 getSubType(); + virtual UInt32 getUsage(); + + virtual void setCoreAudioPropertyID(UInt32 propertyID); + + void setWorkLoop(IOWorkLoop *wl); + +protected: + /*! + * @function sendValueChangeNotification + * @abstract Called when the value has changed for the control. + * @discussion This function sends out the value change notification to the user clients. + */ + virtual void sendValueChangeNotification(); + + /*! + * @function setChannelName + * @abstract Called at init time to set the channel name for this IOAudioControl. + */ + virtual void setChannelName(const char *channelName); + + /*! + * @function setChannelID + * @abstract Called at init time to set the channel ID for this IOAudioControl. + */ + virtual void setChannelID(UInt32 newChannelID); + virtual void setChannelNumber(SInt32 channelNumber); + + /*! + * @function setSubType + * @abstract Called at init time to set the control subType. + */ + virtual void setType(UInt32 type); + + /*! + * @function setType + * @abstract Called at init time to set the control type. + */ + virtual void setSubType(UInt32 subType); + + /*! + * @function setUsage + * @abstract Called at init time to set the control usage. + */ + virtual void setUsage(UInt32 usage); + + /*! + * @function setControlID + * @abstract Sets the controlID for this control. + * @discussion The control ID is an optional attribute that can be used to track IOAudioControls. A typical + * use is for the IOAudioDevice to assign a unique controlID to each control that it creates and then + * do a switch statement on the id of the control when it gets an audioControlValueChanged() notification. + * Typically the control ID is set when the object is created and doesn't need to be called again. + * @param cntrlID The control ID for the control. + */ + virtual void setControlID(UInt32 cntrlID); + + /*! + * @function validateValue + * @abstract Called by setValue() to verify that the value is valid. + * @param newValue The new value to be verified. + * @result Returns kIOReturnSuccess if the value is valid. + */ + virtual IOReturn validateValue(OSObject *newValue); + + /*! + * @function updateValue + * @abstract Called by setValue() in order to update the value and the registry. + * @discussion It also calls + * sendValueChangedNotification() to send notifications to the user clients. + * @param newValue The new value to b updated. + * @result Returns kIOReturnSuccess if the value is successfully updated. + */ + virtual IOReturn updateValue(OSObject *newValue); + + virtual IOReturn _setValue(OSObject *newValue); + + /*! + * @function performValueChange + * @abstract Called by setValue() to make the call to the valueChangeHandler + * to update the hardware. + * @result Returns the result of the handler call (or kIOReturnError on an error). + */ + virtual IOReturn performValueChange(OSObject *newValue); + + /*! + * @function addUserClientAction + * @abstract IOCommandGate Action which calls addUserClient() while holding the IOCommandGate. + * @discussion This is needed to allow addUserClient() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The IOAudioControlUserClient to be added. + * @result Returns the result of addUserClient() - kIOReturnSuccess on success. + */ + static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + + /*! + * @function removeUserClientAction + * @abstract IOCommandGate Action which calls removeUserClient() while holding the IOCommandGate. + * @discussion This is needed to allow removeUserClient() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioControl in this case). + * @param arg1 The IOAudioControlUserClient to be removed. + * @result Returns the result of removeUserClient() - kIOReturnSuccess on success. + */ + static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + + /*! + * @function detachUserClientsAction + */ + static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + /*! + * @function addUserClient + * @abstract Called on the IOWorkLoop to add a new IOAudioControlUserClient. + * @discussion There is no need to call this directly. It is called on the workLoop + * by newUserClient() through addUserClientAction(). + * @param newUserClient The IOAudioControlUserClientto be added. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn addUserClient(IOAudioControlUserClient *newUserClient); + + /*! + * @function removeUserClient + * @abstract Called on the IOWorkLoop to remove an IOAudioControlUserClient. + * @discussion This is called on the IOWorkLoop by clientClosed() through + * removeUserClientAction() when the user client is going away. It should + * not be called directly. + * @param userClient The IOAudioControlUserClient to be removed. + * @result Returns kIOReturnSuccess on success. + */ + virtual IOReturn removeUserClient(IOAudioControlUserClient *userClient); + + virtual IOReturn detachUserClients(); + +}; + +#endif /* _IOKIT_IOAUDIOCONTROL_H */ + diff --git a/i386/include/IOKit/audio/IOAudioControlUserClient.h b/i386/include/IOKit/audio/IOAudioControlUserClient.h new file mode 100644 index 0000000..4ceb05f --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioControlUserClient.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOCONTROLUSERCLIENT_H +#define _IOKIT_IOAUDIOCONTROLUSERCLIENT_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioTypes.h" +#endif + +class IOAudioControl; + +class IOAudioControlUserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOAudioControlUserClient) + +protected: + task_t clientTask; + IOAudioControl * audioControl; + IOAudioNotificationMessage * notificationMessage; + + virtual IOReturn clientClose(); + virtual IOReturn clientDied(); + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + virtual void sendChangeNotification(UInt32 notificationType); + // OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1); + virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type, OSDictionary *properties); + +private: + OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 0); + OSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1); + + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 2); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 3); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 4); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 5); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 6); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 7); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 8); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 9); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 10); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 11); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 12); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 13); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 14); + OSMetaClassDeclareReservedUnused(IOAudioControlUserClient, 15); + +public: + static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type); + static IOAudioControlUserClient *withAudioControl(IOAudioControl *control, task_t clientTask, void *securityID, UInt32 type, OSDictionary *properties); + + virtual bool initWithAudioControl(IOAudioControl *control, task_t owningTask, void *securityID, UInt32 type); + + virtual void free(); + + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon); + + virtual void sendValueChangeNotification(); +}; + +#endif /* _IOKIT_IOAUDIOCONTROLUSERCLIENT_H */ diff --git a/i386/include/IOKit/audio/IOAudioDebug.h b/i386/include/IOKit/audio/IOAudioDebug.h new file mode 100644 index 0000000..04b744e --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioDebug.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIODEBUG_H +#define _IOAUDIODEBUG_H + +#ifdef DEBUG + #define DEBUG_LEVEL 1 + #define DEBUG_USE_FIRELOG 1 + + #ifdef DEBUG_USE_FIRELOG + #include + #define audioDebugIOLog( level, message... ) \ + do {FireLog( message ); FireLog("\n");} while (0) + + #else + #include + #define audioDebugIOLog( level, message... ) \ + do {USBLog( level, message );} while (0) + #endif + + + + #ifdef assert + #undef assert + + #define AssertionMessage( cond, file, line ) \ + "assert \"" #cond "\" failed in " #file " at line " #line + + #define AssertionFailed( cond, file, line ) \ + panic(AssertionMessage( cond, file, line )); + + #define assert( cond ) \ + if( !(cond) ) { \ + AssertionFailed( cond, __FILE__, __LINE__ ) \ + } + #endif +#else + #define audioDebugIOLog( level, message... ) ; +#endif + +#endif /* _IOAUDIODEBUG_H */ diff --git a/i386/include/IOKit/audio/IOAudioDefines.h b/i386/include/IOKit/audio/IOAudioDefines.h new file mode 100644 index 0000000..068267a --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioDefines.h @@ -0,0 +1,465 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOAUDIODEFINES_H +#define _IOAUDIODEFINES_H + +#define kIOAudioDeviceClassName "IOAudioDevice" +#define kIOAudioEngineClassName "IOAudioEngine" +#define kIOAudioStreamClassName "IOAudioStream" +#define kIOAudioPortClassName "IOAudioPort" +#define kIOAudioControlClassName "IOAudioControl" + +/*! + * @defined kIOAudioSampleRateKey + * @abstract The key in the IORegistry for the IOAudioEngine sample rate attribute + * @discussion This value is represented as an integer in samples per second. + */ +#define kIOAudioSampleRateKey "IOAudioSampleRate" + +#define kIOAudioSampleRateWholeNumberKey "IOAudioSampleRateWholeNumber" +#define kIOAudioSampleRateFractionKey "IOAudioSampleRateFraction" + + + +/****** + * + * IOAudioDevice defines + * + *****/ + + +/*! + * @defined kIOAudioDeviceNameKey + * @abstract The key in the IORegistry for the IOAudioDevice name attribute. + */ +#define kIOAudioDeviceNameKey "IOAudioDeviceName" + +#define kIOAudioDeviceShortNameKey "IOAudioDeviceShortName" + +/*! + * @defined kIOAudioDeviceManufacturerNameKey + * @abstract The key in the IORegistry for the IOAudioDevice manufacturer name attribute. + */ +#define kIOAudioDeviceManufacturerNameKey "IOAudioDeviceManufacturerName" + +#define kIOAudioDeviceLocalizedBundleKey "IOAudioDeviceLocalizedBundle" + +#define kIOAudioDeviceTransportTypeKey "IOAudioDeviceTransportType" + +#define kIOAudioDeviceConfigurationAppKey "IOAudioDeviceConfigurationApplication" + +#define kIOAudioDeviceCanBeDefaults "IOAudioDeviceCanBeDefaults" + +#define kIOAudioDeviceModelIDKey "IOAudioDeviceModelID" + + +/*! + * @defined kIOAudioDeviceIconName + * @abstract The key in the IORegistry for the IOAudioDevice icon name attribute. + */ +#define kIOAudioDeviceIconNameKey "IOAudioDeviceIconName" + +#define kIOAudioDeviceIconTypeKey "IOAudioDeviceIconType" + +#define kIOAudioDeviceIconSubDirKey "IOAudioDeviceIconSubDir" + +/***** + * + * IOAudioEngine defines + * + *****/ + + + /*! + * @defined kIOAudioEngineStateKey + * @abstract The key in the IORegistry for the IOAudioEngine state atrribute + * @discussion The value for this key may be one of: "Running", "Stopped" or "Paused". Currently the "Paused" + * state is unimplemented. + */ +#define kIOAudioEngineStateKey "IOAudioEngineState" + +/*! + * @defined kIOAudioEngineOutputSampleLatencyKey + * @abstract The key in the IORegistry for the IOAudioEngine output sample latency key + * @discussion + */ +#define kIOAudioEngineOutputSampleLatencyKey "IOAudioEngineOutputSampleLatency" + +/*! + * @defined kIOAudioStreamSampleLatencyKey + * @abstract The key in the IORegistry for the IOAudioStream output sample latency key + * @discussion Tells the HAL how much latency is on a particular stream. If two streams + * on the same engine have different latencies (e.g. one is analog, one is digital), then + * set this property on both streams to inform the HAL of the latency differences. Alternately, + * you can set the engine latency, and just include the latency additional to that for the particular + * stream. The HAL will add the engine and stream latency numbers together to get the total latency. + */ +#define kIOAudioStreamSampleLatencyKey "IOAudioStreamSampleLatency" + +#define kIOAudioEngineInputSampleLatencyKey "IOAudioEngineInputSampleLatency" + +#define kIOAudioEngineSampleOffsetKey "IOAudioEngineSampleOffset" + +#define kIOAudioEngineInputSampleOffsetKey "IOAudioEngineInputSampleOffset" + +#define kIOAudioEngineNumSampleFramesPerBufferKey "IOAudioEngineNumSampleFramesPerBuffer" + +#define kIOAudioEngineCoreAudioPlugInKey "IOAudioEngineCoreAudioPlugIn" + +#define kIOAudioEngineNumActiveUserClientsKey "IOAudioEngineNumActiveUserClients" + +#define kIOAudioEngineUserClientActiveKey "IOAudioEngineUserClientActive" + +#define kIOAudioEngineGlobalUniqueIDKey "IOAudioEngineGlobalUniqueID" + +#define kIOAudioEngineDescriptionKey "IOAudioEngineDescription" + +#define kIOAudioEngineClockIsStableKey "IOAudioEngineClockIsStable" + +#define kIOAudioEngineClockDomainKey "IOAudioEngineClockDomain" + +#define kIOAudioEngineIsHiddenKey "IOAudioEngineIsHidden" +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of fully constructed names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelNamesKey "IOAudioEngineChannelNames" + +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of category names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelCategoryNamesKey "IOAudioEngineChannelCategoryNames" + +/*! + * @defined kIOAudioEngineFullChannelNamesKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary of number names for each channel keyed by the device channel + * @discussion + */ +#define kIOAudioEngineFullChannelNumberNamesKey "IOAudioEngineChannelNumberNames" + +#define kIOAudioEngineFullChannelNameKeyInputFormat "InputChannel%u" + +#define kIOAudioEngineFullChannelNameKeyOutputFormat "OutputChannel%u" + +#define kIOAudioEngineFlavorKey "IOAudioEngineFlavor" + +#define kIOAudioEngineAlwaysLoadCoreAudioPlugInKey "IOAudioEngineAlwaysLoadCoreAudioPlugIn" + +/*! + * @defined kIOAudioEngineInputChannelLayoutKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary describes an array of OSNumber data that describe the spatial position of each channel. See IOAudioTypes.h. + * @discussion + */ + +#ifndef __OPEN_SOURCE__ +// +#endif +#define kIOAudioEngineInputChannelLayoutKey "IOAudioEngineInputChannelLayout" + +/*! + * @defined kIOAudioEngineOutputChannelLayoutKey + * @abstract The key in the IORegistry for the IOAudioEngine's dictionary describes an array of OSNumber data that describe the spatial position of each channel. See IOAudioTypes.h. + * @discussion + */ + +#ifndef __OPEN_SOURCE__ +// +#endif +#define kIOAudioEngineOutputChannelLayoutKey "IOAudioEngineOutputChannelLayout" + +/***** + * + * IOAudioStream defines + * + *****/ + + +#define kIOAudioStreamIDKey "IOAudioStreamID" +#define kIOAudioStreamDescriptionKey "IOAudioStreamDescription" +#define kIOAudioStreamNumClientsKey "IOAudioStreamNumClients" + +/*! + * @defined kIOAudioStreamDirectionKey + * @abstract The key in the IORegistry for the IOAudioStream direction attribute. + * @discussion The value for this key may be either "Output" or "Input". + */ +#define kIOAudioStreamDirectionKey "IOAudioStreamDirection" + +#define kIOAudioStreamStartingChannelIDKey "IOAudioStreamStartingChannelID" +#define kIOAudioStreamStartingChannelNumberKey "IOAudioStreamStartingChannelNumber" +#define kIOAudioStreamAvailableKey "IOAudioStreamAvailable" + +#define kIOAudioStreamFormatKey "IOAudioStreamFormat" +#define kIOAudioStreamAvailableFormatsKey "IOAudioStreamAvailableFormats" + +#define kIOAudioStreamNumChannelsKey "IOAudioStreamNumChannels" +#define kIOAudioStreamSampleFormatKey "IOAudioStreamSampleFormat" + +#define kIOAudioStreamNumericRepresentationKey "IOAudioStreamNumericRepresentation" + +#define kIOAudioStreamFormatFlagsKey "IOAudioStreamFormatFlags" +#define kIOAudioStreamFramesPerPacketKey "IOAudioStreamFramesPerPacket" +#define kIOAudioStreamBytesPerPacketKey "IOAudioStreamBytesPerPacket" + + +#define kIOAudioStreamBitDepthKey "IOAudioStreamBitDepth" +#define kIOAudioStreamBitWidthKey "IOAudioStreamBitWidth" + +#define kIOAudioStreamAlignmentKey "IOAudioStreamAlignment" + +#define kIOAudioStreamByteOrderKey "IOAudioStreamByteOrder" + +#define kIOAudioStreamIsMixableKey "IOAudioStreamIsMixable" + +#define kIOAudioStreamMinimumSampleRateKey "IOAudioStreamMinimumSampleRate" +#define kIOAudioStreamMaximumSampleRateKey "IOAudioStreamMaximumSampleRate" + +#define kIOAudioStreamDriverTagKey "IOAudioStreamDriverTag" + +#define kIOAudioStreamTerminalTypeKey "IOAudioStreamTerminalType" + +/***** + * + * IOAudioPort defines + * + *****/ + + + /*! + * @defined kIOAudioPortTypeKey + * @abstract The key in the IORegistry for the IOAudioPort type attribute. + * @discussion This is a driver-defined text attribute that may contain any type. + * Common types are defined as: "Speaker", "Headphones", "Microphone", "CD", "Line", "Digital", "Mixer", "PassThru". + */ +#define kIOAudioPortTypeKey "IOAudioPortType" + +/*! + * @defined kIOAudioPortSubTypeKey + * @abstract The key in the IORegistry for the IOAudioPort subtype attribute. + * @discussion The IOAudioPort subtype is a driver-defined text attribute designed to complement the type + * attribute. + */ +#define kIOAudioPortSubTypeKey "IOAudioPortSubType" + +/*! + * @defined kIOAudioPortNameKey + * @abstract The key in the IORegistry for the IOAudioPort name attribute. + */ +#define kIOAudioPortNameKey "IOAudioPortName" + + + +/***** + * + * IOAudioControl defines + * + *****/ + + + /*! + * @defined kIOAudioControlTypeKey + * @abstract The key in the IORegistry for the IOAudioCntrol type attribute. + * @discussion The value of this text attribute may be defined by the driver, however system-defined + * types recognized by the upper-level software are "Level", "Mute", "Selector". + */ +#define kIOAudioControlTypeKey "IOAudioControlType" + +#define kIOAudioControlSubTypeKey "IOAudioControlSubType" + +#define kIOAudioControlUsageKey "IOAudioControlUsage" + +#define kIOAudioControlIDKey "IOAudioControlID" + +/*! + * @defined kIOAudioControlChannelIDKey + * @abstract The key in the IORegistry for the IOAudioControl channel ID attribute + * @discussion The value for this key is an integer which may be driver defined. Default values for + * common channel types are provided in the following defines. + */ +#define kIOAudioControlChannelIDKey "IOAudioControlChannelID" + +#define kIOAudioControlChannelNumberKey "IOAudioControlChannelNumber" + +#define kIOAudioControlCoreAudioPropertyIDKey "IOAudioControlCoreAudioPropertyID" +/*! + * @defined kIOAudioControlChannelNameKey + * @abstract The key in the IORegistry for the IOAudioControl name attribute. + * @discussion This name should be a human-readable name for the channel(s) represented by the port. + * *** NOTE *** We really need to make all of the human-readable attributes that have potential to + * be used in a GUI localizable. There will need to be localized strings in the kext bundle matching + * the text. + */ +#define kIOAudioControlChannelNameKey "IOAudioControlChannelName" + +/*! + * @defined kIOAudioControlChannelNameAll + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for all channels. + */ +#define kIOAudioControlChannelNameAll "All Channels" + +/*! + * @defined kIOAudioControlChannelNameLeft + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the left channel. + */ +#define kIOAudioControlChannelNameLeft "Left" + +/*! + * @defined kIOAudioControlChannelNameRight + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the right channel. + */ +#define kIOAudioControlChannelNameRight "Right" + +/*! + * @defined kIOAudioControlChannelNameCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the center channel. + */ +#define kIOAudioControlChannelNameCenter "Center" + +/*! + * @defined kIOAudioControlChannelNameLeftRear + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the left rear channel. + */ +#define kIOAudioControlChannelNameLeftRear "LeftRear" + +/*! + * @defined kIOAudioControlChannelNameRightRear + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the right rear channel. + */ +#define kIOAudioControlChannelNameRightRear "RightRear" + +/*! + * @defined kIOAudioControlChannelNameSub + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the sub/LFE channel. + */ +#define kIOAudioControlChannelNameSub "Sub" + +/*! + * @defined kIOAudioControlChannelNameFrontLeftCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the FrontLeftCenter channel. + */ +#define kIOAudioControlChannelNameFrontLeftCenter "FrontLeftCenter" + +/*! + * @defined kIOAudioControlChannelNameFrontRightCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the FrontRightCenter channel. + */ +#define kIOAudioControlChannelNameFrontRightCenter "FrontRightCenter" + +/*! + * @defined kIOAudioControlChannelNameRearCenter + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the RearCenter channel. + */ +#define kIOAudioControlChannelNameRearCenter "RearCenter" + +/*! + * @defined kIOAudioControlChannelNameSurroundLeft + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the SurroundLeft channel. + */ +#define kIOAudioControlChannelNameSurroundLeft "SurroundLeft" + +/*! + * @defined kIOAudioControlChannelNameSurroundRight + * @abstract The value for the kIOAudioControlChannelNameKey in the IORegistry representing + * the channel name for the SurroundRight channel. + */ +#define kIOAudioControlChannelNameSurroundRight "SurroundRight" + + +/*! + * @defined kIOAudioControlValueKey + * @abstract The key in the IORegistry for the IOAudioControl value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the current value of the IOAudioControl. + */ +#define kIOAudioControlValueKey "IOAudioControlValue" + +/*! + * @defined kIOAudioControlValueIsReadOnlyKey + * @abstract The key in the IORegistry for the IOAudioControl value-is-read-only attribute. + * @discussion The value returned by this key is a 32-bit integer but the value doesn't have any direct meaning. + * Instead, the presence of this key indicates that the value for the control is read-only + */ +#define kIOAudioControlValueIsReadOnlyKey "IOAudioControlValueIsReadOnly" + +/*! + * @defined kIOAudioLevelControlMinValueKey + * @abstract The key in the IORegistry for the IOAudioControl minimum value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the minimum value for the IOAudioControl. + * This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum + * value. + */ +#define kIOAudioLevelControlMinValueKey "IOAudioLevelControlMinValue" + +/*! + * @defined kIOAudioLevelControlMaxValueKey + * @abstract The key in the IORegistry for the IOAudioControl maximum value attribute. + * @discussion The value returned by this key is a 32-bit integer representing the maximum value for the IOAudioControl. + * This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum + * value. + */ +#define kIOAudioLevelControlMaxValueKey "IOAudioLevelControlMaxValue" + +/*! + * @defined kIOAudioLevelControlMinDBKey + * @abstract The key in the IORgistry for the IOAudioControl minimum db value attribute. + * @discussion The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit + * integer. It represents the minimum value in db for the IOAudioControl. This value matches the minimum + * value attribute. This is currently valid for Level controls or other driver-defined controls that have a + * minimum and maximum db value. + */ +#define kIOAudioLevelControlMinDBKey "IOAudioLevelControlMinDB" + +/*! + * @defined kIOAudioLevelControlMaxDBKey + * @abstract The key in the IORgistry for the IOAudioControl maximum db value attribute. + * @discussion The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit + * integer. It represents the maximum value in db for the IOAudioControl. This value matches the maximum + * value attribute. This is currently valid for Level controls or other driver-defined controls that have a + * minimum and maximum db value. + */ +#define kIOAudioLevelControlMaxDBKey "IOAudioLevelControlMaxDB" + +#define kIOAudioLevelControlRangesKey "IOAudioLevelControlRanges" + +#define kIOAudioLevelControlUseLinearScale "IOAudioLevelControlUseLinearScale" + +#define kIOAudioSelectorControlAvailableSelectionsKey "IOAudioSelectorControlAvailableSelections" +#define kIOAudioSelectorControlSelectionValueKey "IOAudioSelectorControlSelectionValue" +#define kIOAudioSelectorControlSelectionDescriptionKey "IOAudioSelectorControlSelectionDescriptionKey" + +#define kIOAudioSelectorControlClockSourceKey "IOAudioSelectorControlClockSourceKey" + +#endif /* _IOAUDIODEFINES_H */ diff --git a/i386/include/IOKit/audio/IOAudioDevice.h b/i386/include/IOKit/audio/IOAudioDevice.h new file mode 100644 index 0000000..6d55147 --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioDevice.h @@ -0,0 +1,749 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOAudioDevice + */ + +#ifndef _IOKIT_IOAUDIODEVICE_H +#define _IOKIT_IOAUDIODEVICE_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioTypes.h" +#include "IOAudioStream.h" +#endif + +class IOAudioEngine; +class IOAudioStream; +class IOAudioPort; +class IOAudioControl; +class OSDictionary; +class OSSet; +class OSArray; +class IOTimerEventSource; +class IOCommandGate; + +/*! + * enum IOAudioDevicePowerState + * @abstract Identifies the power state of the audio device + * @discussion A newly created IOAudioDevices defaults to the idle state. + * @constant kIOAudioDeviceSleep State set when the system is going to sleep + * @constant kIOAudioDeviceIdle State when the system is awake but none of the IOAudioEngines are in use + * @constant kIOAudioDeviceActive State when one ore more IOAudioEngines are in use. This state transition must complete before the system will begin playing audio. + */ +typedef enum _IOAudioDevicePowerState { + kIOAudioDeviceSleep = 0, // When sleeping + kIOAudioDeviceIdle = 1, // When no audio engines running + kIOAudioDeviceActive = 2 // audio engines running +} IOAudioDevicePowerState; + +/*! + * @class IOAudioDevice + * @abstract Abstract base class for a single piece of audio hardware. The IOAudioDevice provides + * the central coordination point for an audio driver. + * @discussion An audio driver is required to subclass IOAudioDevice in order to provide + * working audio to the system. A single driver instance will contain a single instance of the + * driver's IOAudioDevice subclass. The subclass is responsible for mapping all hardware device + * resources from the service provider nub. It must control access to the hardware so that the + * hardware doesn't get into an inconsistent state. It is possible that different threads may make + * requests of the hardware at the same time. The IOAudioDevice superclass provides an IOWorkLoop + * and IOCommandGate on the IOWorkLoop through which all hardware accesses may be synchronized. + * All entry points to all parts of the driver controlled by the IOAudioFamily will be synchronized + * through this one IOWorkLoop. + * + * The IOAudioDevice subclass is responsible for creating the rest of the pieces of the driver. + * It must identify and create all IOAudioEngines that are not automatically created by the system + * (i.e. those that are not matched and instantiated by IOKit directly). + * + * The IOAudioDevice subclass must enumerate and create all IOAudioControls to match + * the device capabilities. + * + * It must also execute control value chages when requested by the system (i.e. volume adjustments). + * + * In order to allow sleep and wake to work on the system, the IOAudioDevice subclass is responsible + * for performing the necessary actions to sleep and wake its hardware (and restore necessary state + * on wake). + * + * The IOAudioDevice class provides timer services that allow different elements in the audio driver + * to receive timer notifications as needed. These services were designed with the idea that most + * timed events in a typical audio driver need to be done at least as often as a certain interval. + * Further, it is designed with the idea that being called more often than the specified interval + * doesn't hurt anything - and in fact may help. With this in mind, the timer services provided + * by the IOAudioDevice class allow different targets to register for timer callbacks at least as + * often as the specified interval. The actual interval will be the smallest of the intervals of + * all of the callbacks. This way, we avoid the overhead of having many timers in a single audio + * device. As an example, each output IOAudioEngine has a timer to run the erase head. It doesn't hurt + * to have the erase head run more often. Also, a typical IOAudioDevice subclass may need to run a timer + * to check for device state changes (e.g. jack insertions). + * + * There are a number of strings passed from the driver to the CoreAudio.framework and then into + * applications. All of those strings should be localized by the driver. In order to do that + * the kext bundle should have localized string files following the Mac OS X localization + * instructions. The IOAudioDevice should contain a property with the name of the bundle/kext + * that contains the localized string resources. To do that, the driver's personality in + * the bundle resources could have a property named 'IOAudioDeviceLocalizedBundle' with the path + * of the bundle/kext relative to '/System/Library/Extensions'. It could also be set by the + * IOAudioDevice subclass in its initHardware() function. To do so, call + * setProperty(kIOAudioDeviceLocalizedBundleKey, "Driver.kext"). + * + * In a typical driver, the IOAudioDevice subclass will implement initHardware() to perform the + * hardware initialization and driver construction. Within that initialization it must create at + * least one IOAudioEngine instance and activate it. In order to activate a new IOAudioEngine + * activateAudioEngine() should be called for each one. It must create the IOAudioControls + * matching the hardware capabilities to allow the system to set volume, mute and input selection. + * To add those controls to the driver, each control should be attached to the IOAudioEngine to + * which it applies by calling addDefaultAudioControl() on the IOAudioEngine. + * During initialization it should also call setDeviceName(), setDeviceShortName() and + * setManufacturerName() with localized strings representing each of the attributes. + * + * If the driver is to work properly after sleep/wake, it must implement performPowerStateChange() + * and deal with the sleep and wake transitions. It may also deal with the idle state transitions + * to turn off device power when it isn't in use (especially useful for devices attached to a + * portable running on battery power). + */ + +class IOAudioDevice : public IOService +{ + friend class IOAudioEngine; + + OSDeclareDefaultStructors(IOAudioDevice) + +protected: + /*! @var workLoop The IOWorkLoop for the driver - this is shared with the other objects in the driver */ + IOWorkLoop *workLoop; + /*! @var commandGate The IOCommandGate for this IOAudioDevice. It is attached to workLoop */ + IOCommandGate *commandGate; + /*! @var timerEventSource An IOTimerEventSource attached to workLoop used for the timer services */ + IOTimerEventSource *timerEventSource; + + /*! @var duringStartup State variable set to true while the driver is starting up and false all other times */ + bool duringStartup; + /*! @var familyManagePower Set to true if the family is supposed to manage power - this is the default state. It can be changed early in the initialization process with a call to setFamilyManagePower(). */ + bool familyManagePower; + /*! @var asyncPowerStateChangeInProgress Set to true while an asynchronous power change is pending and false all other times. */ + bool asyncPowerStateChangeInProgress; + + /*! @var numRunningAudioEngines The number of running IOAudioEngines. This is used to maintain idle vs active power state. */ + UInt32 numRunningAudioEngines; + + /*! @var currentPowerState Used to track the existing power state - can be fetched by calling getPowerState() */ + IOAudioDevicePowerState currentPowerState; + /*! @var pendingPowerState If a power state change is in progress, this represents the pending power state. All other times this is the same as the currentPowerState. */ + IOAudioDevicePowerState pendingPowerState; + + /*! @var audioEngines The set of IOAudioEngine objects vended by the IOAudioDevice. */ + OSArray * audioEngines; + /*! @var timerEvents The set of timer events in use by the device. + * @discussion The key for the dictionary is the target of the event. This means that a single target may + * have only a single event associated with it. + */ + OSDictionary * timerEvents; + /*! @var audioPorts The set of IOAudioPort objects associated with the IOAudioDevice */ + OSSet * audioPorts; + + /*! @var minimumInterval The smallest timer interval requested by all timer event targets. */ + AbsoluteTime minimumInterval; + /*! @var previousTimerFire The time of the last timer event. + * @discussion This is used to schedule the next timer event. + */ + AbsoluteTime previousTimerFire; + +public: + /*! @var gIOAudioPlane A static IORegistryPlane representing the new IOAudioPlane that the IOAudioFamily uses + * to represent the signal chain of the device. + */ + static const IORegistryPlane *gIOAudioPlane; + +protected: + struct ExpansionData { + unsigned long long idleSleepDelayTime; + IOTimerEventSource * idleTimer; + }; + + ExpansionData *reserved; + +public: + static void idleAudioSleepHandlerTimer(OSObject *owner, IOTimerEventSource *sender); + virtual IOReturn setAggressiveness(unsigned long type, unsigned long newLevel); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 0); + virtual void setDeviceTransportType(const UInt32 transportType); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 1); + /*! + * @function setIdleAudioSleepTime + * @abstract This function is to be called by a driver that doesn't want to be told about the audio + * going idle immediately, but at some point in the future. + * @discussion This is useful if the device will want to power down its hardware into an idle sleep + * state, but doesn't want to do that unless audio hasn't been used for a while. Calling this function + * immediately changes the idle sleep timer and queues it up if the idle is different from the previous + * idle time. The idle time defaults to 0, which means be called immediately (backwards compatible with + * previous versions of IOAudioFamily). A value of 0xffffffffffffffffULL means don't ever tell the + * driver about going idle. + * @param sleepDelay The amount of time, in nanoseconds, before the hardware should be told to go idle. + */ + virtual void setIdleAudioSleepTime(unsigned long long sleepDelay); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 2); + virtual void scheduleIdleAudioSleep(void); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 3); + /*! + * @function setConfigurationApplicationBundle + * @abstract This function is to be called if an external configuration application is available to set + * which application to launch. + * @discussion This is useful for device drivers that are too complex to be represented by the Sound Preferences + * panel. The bundle ID is a more flexible way of specifying where the application is than a hard coded path. + * @param bundleID The bundle ID of the application to be launched by the HAL for configuration of the device and its engine(s). + */ + virtual void setConfigurationApplicationBundle(const char *bundleID); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 4); + /*! + * @function setDeviceCanBeDefault + * @abstract This function is to be called to tell CoreAudio if this device shouldn't be a default device. + * @discussion This is useful for device drivers that don't want to be a default device. Can be called with + * kIOAudioDeviceCanBeDefaultNothing to prevent CoreAudio from allowing this device to be any default device, or it + * can be called with any combination of kIOAudioDeviceCanBeDefaultInput, kIOAudioDeviceCanBeDefaultOutput, or + * kIOAudioDeviceCanBeSystemOutput. The default is + * (kIOAudioDeviceCanBeDefaultInput | kIOAudioDeviceCanBeDefaultOutput | kIOAudioDeviceCanBeSystemOutput). + * @param defaultsFlags The flags to instruct CoreAudio to allow this device to be only the indicated default devices. + */ + virtual void setDeviceCanBeDefault(UInt32 defaultsFlags); + + // OSMetaClassDeclareReservedUsed(IOAudioDevice, 5); + virtual void setDeviceModelName(const char * modelName); + +private: + OSMetaClassDeclareReservedUsed(IOAudioDevice, 0); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 1); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 2); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 3); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 4); + OSMetaClassDeclareReservedUsed(IOAudioDevice, 5); + + OSMetaClassDeclareReservedUnused(IOAudioDevice, 6); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 7); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 8); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 9); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 10); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 11); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 12); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 13); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 14); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 15); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 16); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 17); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 18); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 19); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 20); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 21); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 22); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 23); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 24); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 25); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 26); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 27); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 28); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 29); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 30); + OSMetaClassDeclareReservedUnused(IOAudioDevice, 31); + + +public: + // Initialization + + /*! + * @function init + * @abstract Initialize a newly created instance of IOAudioDevice. + * @discussion This implementation initializes all of the data structures and variables used by the + * IOAudioDevice. The currentPowerState and pendingPowerState variables are set to kIOAudioDeviceIdle. + * A subclass that overrides this method must call the superclass' implementation. + * @param properties An OSDictionary of the device properties that gets passed to super::init and set + * in the IORegistry. + * @result true if initialization was successful + */ + virtual bool init(OSDictionary *properties); + + /*! + * @function free + * @abstract Frees resources used by the IOAudioDevice instance + * @discussion This method will deactivate all audio audio engines and release the audioEngines OSSet. + * It will also deactivate all of the audio ports and release the audioPorts OSSet. It will release + * the timerEvents OSDictionary as well as cancel any outstanding timer callbacks. It will clean up + * all of the event sources and the workLoop. + * + * Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + + virtual void free(); + + /*! + * @function start + * @abstract This function is called automatically by the system to tell the driver to start vending + * services to the rest of the system. + * @discussion The start() implementation in IOAudioDevice starts by calling start() on its superclass. + * It then calls initHardware() which the subclass should override to properly initialize itself and + * the hardware. If that call succeeds, it sets up power management if the family is supposed to + * manage power (checking the familyManagePower variable). Then finally it calls registerService() + * to make the IOAudioDevice visible in the IORegistry. + * @param provider This is the service provider nub that provides access to the hardware resources. + * @result Returns true on success + */ + virtual bool start(IOService *provider); + + /*! + * @function stop + * @abstract This is responsible for stopping the device after the system is done with it (or + * if the device is removed from the system). + * @discussion The IOAudioDevice implentation of stop() disables the timer services, deactivates + * all of the audio audio engines and audio ports and stops power management of the device. + * The audio engine and port deactivation causes all of the audio engines to get stopped and + * all of the audio engine and port resources and objects to be released. A subclass' implementation + * may could shut down hardware here if necessary. If this function is overridden by a subclass, + * the superclass' implementation must be called. + * @param The service provider nub for the device. + */ + virtual void stop(IOService *provider); + virtual bool willTerminate(IOService *provider, IOOptionBits options); + + /*! + * @function initHardware + * @abstract This function is called by start() to provide a convenient place for the subclass to + * perform its initialization. + * @discussion In a typical implementation, a driver would implementation this function and perform + * a number of tasks. Those include mapping hardware resources, initializing the hardware to a known + * state, creating the IOAudioEngines, IOAudioControls and IOAudioStreams. Additionally it + * should also call setDeviceName(), setDeviceShortName(), setManufacturerName(). Upon return of + * this function, the device should be ready to begin vending services to the system. + * @param provider The service provider nub for the device. + * @result This function should return true on a successful initialization. + */ + virtual bool initHardware(IOService *provider); + + /*! + * @function setDeviceName + * @abstract Sets the name of the device + * @discussion This method should be called during initialization or startup. It should + * be set by the time initHardware() completes. The device name is used by the + * CoreAudio.framework to identify the particular piece of hardware. This string should + * should be localized by the driver. + */ + virtual void setDeviceName(const char *deviceName); + + /*! + * @function setDeviceShortName + * @abstract Sets the short name of the device + * @discussion The short name is a shorter representation of the device name. It may be used + * by applications when the device name is too long. It should be set by the time initHardware() + * completes. The string should be localized by the driver. + */ + virtual void setDeviceShortName(const char *shortName); + + /*! + * @function setManufacturerName + * @abstract Sets the manufacturer name of the device + * @discussion This method should be called during initialization or startup. This should be + * called by the time initHardware() completes. The string should be localized by the driver. + */ + virtual void setManufacturerName(const char *manufacturerName); + + + // IOWorkLoop, IOCommandGate management + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the driver + * @discussion The IOWorkLoop is used to synchronized all critical aspects of the driver. This + * includes all entry points to the driver as well as power management. + */ + virtual IOWorkLoop *getWorkLoop() const; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioDevice + * @discussion This IOCommandGate allows calls into this IOAudioDevice to be synchronized on + * the IOWorkLoop. + */ + virtual IOCommandGate *getCommandGate() const; + + + // IOAudioEngine management + + /*! + * @function activateAudioEngine + * @abstract This simply calls activateAudioEngine(IOAudioEngine *audioEngine, + * bool shouldStartAudioEngine) with a value of true for shouldStartAudioEngine. + * @param audioEngine The IOAudioEngine instance to be activated. It is treated as a newly + * allocated instance. + * @result Returns true if the audio engine was successfully activated. + */ + virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine); + + /*! + * @function activateAudioEngine + * @abstract This is called to add a new IOAudioEngine object to the IOAudioDevice. + * @discussion Once the IOAudioEngine has been activated by this function, it is ready + * to begin moving audio data. This should be called either during the subclass' initHardware() + * implementation for each IOAudioEngine the device creates. Or it should be called by + * the IOAudioEngine itself if the audio engine was automatically created by IOKit's matching + * process. The system won't be able to properly track and control IOAudioEngines if + * they are not activated though this function. + * This implementation will retain the IOAudioEngine while it maintains control of it. + * When the audio engine is deactivated, the IOAudioEngine will be released. If the + * IOAudioDevice subclass is passing a newly instantiated IOAudioEngine, it will need to release + * the audio engine after it has been activated. This will insure that the refCount on the audio engine + * is correct when it gets deactivated when the driver is stopped. That allows the audio engine to be + * freed when it is no longer needed. + * @param audioEngine The IOAudioEngine instance to be activated. + * @param shouldStartAudioEngine If true, the audio engine is treated as a newly allocated IOAudioEngine + * instance and is appropriately attached and started according to IOKit convention. If it is false + * it is assumed that some other process (possibly the IOKit matching process) has started the + * IOAudioEngine and will skip that step. + * @result Returns true if the audio engine was successfully activated. + */ + virtual IOReturn activateAudioEngine(IOAudioEngine *audioEngine, bool shouldStartAudioEngine); + + /*! + * @function deactivateAllAudioEngines + * @abstract Deactivates all of the audio engines in the device. + * @discussion This is called by the stop() and free() methods in IOAudioDevice to completely + * shut down all audio engines as the driver is being shut down. + */ + virtual void deactivateAllAudioEngines(); + + + // Power management + + /*! + * @function setFamilyManagePower + * @abstract Called set whether or not the family should manage the device power throught the + * IOService power management APIs. + * @discussion The default behavior is for the family to manage power. It is only necessary to + * call this function if the driver does not want the family to manage power. It is not + * recommended that this function be called because it makes power management much more + * difficult for the driver. If this function is to be called, it must be called before + * initHardware() completes. Immediately after initHardware() is called by start(), + * the power management system is initialized if the family is to manage power. + * @param manage Set to false if it is not desired that the family does the power management + */ + virtual void setFamilyManagePower(bool manage); + + /*! + * @function setPowerState + * @abstract Called by the power management system in IOService when the power state of this + * service needs to change. + * @discussion The default implementation of IOAudioDevice sets up two power states for IOService + * to use. State 0 is sleep and state 1 is wake. This function should not be called directly. + * It is only supposed to be used by the IOService power management services. + * @param powerStateOrdinal The number of the power state as defined by the IOAudioDevice - + * 0 for sleep, 1 for wake. + * @param device The power management policy maker. + * @result Returns kIOPMAckImplied (0) when the power state change is complete. Otherwise the an + * upper bound on the number of microseconds until the state change is complete is returned. + */ + virtual IOReturn setPowerState(unsigned long powerStateOrdinal, IOService *device); + + /*! + * @function setPowerStateAction + * @abstract IOCommandGate Action which calls protectedSetPowerState() while holding the IOCommandGate + * @discussion This is needed to allow protectedSetPowerState() to be called on the IOWorkLoop + * @param owner The owner of the IOCommandGate (the IOAudioDevice in this case) + * @param arg1 The powerStateOrdinal to be passed to protectedSetPowerState() + * @param arg2 The device to be passed to protectedSetPowerState() + * @result Returns the result of protectedSetPowerState() + */ + static IOReturn setPowerStateAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + /*! + * @function protectedSetPowerState + * @abstract Called by setPowerStateAction() to deal with a power state change from the IOService + * power management facility. + * @discussion This function is responsible for performing the necessary sleep and wake tasks + * when the system is sleeping or waking. If an outstanding power state change is in progress, + * it will wait until the state changes has completed. While sleeping, all audio engines are + * stopped before calling initiatePowerStateChange() to call performPowerStateChange() to let + * the driver deal with the sleep request. When waking, it determines if the device should be + * idle or active and continues to call initiatePowerStateChange(). If initiatePowerStateChange() + * indicates that the power state change is occuring asynchronously, it returns the number of + * microseconds. This function must be called on the IOWorkLoop, but should not be called + * directly. + * @param powerStateOrdinal Param passed to setPowerState() - 0 for sleep, 1 for wake + * @param device Param passed to setPowerState - the device initiating the power state change + * @result Returns 0 if the power state change is complete - the number of microseconds until + * complete if its asynchronous. + */ + virtual IOReturn protectedSetPowerState(unsigned long powerStateOrdinal, IOService *device); + + /*! + * @function performPowerStateChange + * @abstract This function is called by the IOAudioDevice when a power state change is needed. + * @discussion In order to deal with power state changes, a subclass must override this function. + * Any combination of old and new power states may be passed to this function. If work is to + * be performed while transitioning to sleep, check for a newPowerState of kIOAudioDeviceSleep. + * If work is to be performed while transitioning from sleep, check for an oldPowerState of + * kIOAudioDeviceSleep. A power state of kIOAudioDeviceIdle means the system is awake, but + * no clients are currently playing or recording audio (i.e. no IOAudioEngines are active). + * A power state of kIOAudioDeviceActive means that at least one IOAudioEngine is active. + * It is possible for a power state change to be performed synchronously or asynchronously. + * In the case of a synchronous power state change, simple leave microsecondsUntilComplete + * alone and return kIOReturnSuccess. If an asynchronous power state change is needed the + * driver should do whatever needed to schedule another thread to finish the state change + * and set the microsecondsUntilComplete to an upper bound on the amount of time it will + * take to complete the power state change. Then when the power state change is complete, + * a call must be made to completePowerStateChange(). During an asynchronous power state + * change, the current power state will remain the same as before the transition began, + * and the pendingPowerState is set to the new power state that will be set when the + * change is complete. + * @param oldPowerState The power state before the power state change + * @param newPowerState The power state being transitioned to + * @param microsecondsUntilComplete A pointer to a value representing an upper bound on + * the number of microseconds to complete an asynchronous power state change. It points + * to a value of zero at the start and if it remains zero, the state change is complete + * upon a successful return from the function. + * @result Returns kIOReturnSuccess on a successful completion + */ + virtual IOReturn performPowerStateChange(IOAudioDevicePowerState oldPowerState, + IOAudioDevicePowerState newPowerState, + UInt32 *microsecondsUntilComplete); + + /*! + * @function completePowerStateChange + * @abstract Called when a power state change is complete + * @discussion In the case of an asynchronous power state change, a subclass is responsible + * for calling this function. It is safe to call this function if not on the IOWorkLoop. + * This function calls protectedCompletePowerStateChange() through the IOCommandGate and + * completePowerStateChangeAction(). If the call is already on the IOWorkLoop, it is safe + * to call protectedCompletePowerStateChange() directly. + * @result Returns kIOReturnSuccess on a successful completion + */ + virtual IOReturn completePowerStateChange(); + + /*! + * @function completePowerStateChangeAction + * @abstract IOCommandGate Action which calls protectedCompletePowerStateChange() while holding the + * IOCommandGate. + * @discussion This is needed to allow protectedCompletePowerStateChange() to be called on the IOWorkLoop. + * @param owner The owner of the IOCommandGate (the IOAudioDevice in this case) + * @result Returns the result of protectedCompletePowerStateChange() + */ + static IOReturn completePowerStateChangeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + /*! + * @function protectedCompletePowerStateChange() + * @abstract Called on the IOWorkLoop when a power state change is complete. + * @discussion This function does the work to complete a power state change (both synchronous and + * asynchronous). If the system is waking from sleep, the timer system is restarted and the + * audio engines are resumed. If this was called as a result of an asynchronous power state changed + * it makes the IOService power management call acknowledgePowerChange() and resets the + * asyncPowerStateChangeInProgress variable. Finally it sets the currentPowerState to the + * pendingPowerState. This function must be called on the IOWorkLoop. If a subclass is not + * on the IOWorkLoop (e.g. holding the IOCommandGate), call completePowerStateChange() instead. + * @result Returns kIOReturnSuccess on success + */ + virtual IOReturn protectedCompletePowerStateChange(); + + /*! + * @function getPowerState + * @abstract Returns the current power state (the old power state if a change is in progress). + * @result The current power state + */ + virtual IOAudioDevicePowerState getPowerState(); + + /*! + * @function getPendingPowerState + * @abstract Returns the pending power state if a state change is in progress. Otherwise it + * returns the current power state change. + * @result The pending power state + */ + virtual IOAudioDevicePowerState getPendingPowerState(); + + /*! + * @function waitForPendingPowerStateChange + * @abstract Called internally to wait until a pending power state change is complete. + * @discussion This is only used by internal functions to wait during pending power + * state changes. It is used to prevent multiple power state changes at the same time. + * This function must be called while holding the IOCommandGate. If an asynchronous + * power state change is in progress this function will block until the state change + * if complete. Once complete, it will return while still holding the IOCommandGate. + */ + virtual void waitForPendingPowerStateChange(); + + /*! + * @function initiatePowerStateChange + * @abstract Called internally to execute a power state change + * @discussion This function must be called on the IOWorkLoop. It calls performPowerStateChange() + * to let the driver process the state change. If the state change is completed synchronously + * by the driver (subclass) it calls protectedCompletePowerStateChange(). If done asynchronously + * it returns the microsecondsUntilComplete that was set by performPowerStateChange(). This + * function should not be called directly. + * @param microsecondsUntilComplete Pointer to the microsecondsUntilComplete that should be set + * by performPowerStateChange if an asynchronous power state change was started. + * @result Returns kIOReturnSuccess on success + */ + virtual IOReturn initiatePowerStateChange(UInt32 *microsecondsUntilComplete = NULL); + + + // IOAudioControl management + + /*! + * @function flushAudioControls + * @abstract Forces each IOAudioControl in the driver to have its value flushed out to the hardware. + * That will cause either the IOAudioControl's ValueChangeHandler to be called. + * @discussion This can be used to force the hardware to get updated with the current value + * of each control. It may be useful during wake for example. + */ + virtual void flushAudioControls(); + + + // Timer services + + /*! + * @typedef TimerEvent + * @abstract Generic timer event callback for IOAudioDevice timer targets + * @discussion TimerEvent callback function takes two arguments; the target of + * the timer event and the IOAudioDevice sending the event. + * @param target The target of the timer event - passed in when the timer event was registered + * @param audioDevice The IOAudioDevice sending the event + */ + typedef void (*TimerEvent)(OSObject *target, IOAudioDevice *audioDevice); + + /*! + * @function addTimerEvent + * @abstract Adds a TimerEvent callback for the given target called at least as often + * as specified in interval. + * @discussion The frequency of the timer event callbacks will be the smallest interval + * specified by all targets. Only one interval and callback may be specified per target. + * If a addTimerEvent is called twice with the same target, the second one overrides the + * first. There is currently a bug triggered if the first call had the smallest interval. + * In that case, that smallest interval would still be used. + * @param target This parameter is the target object of the TimerEvent. + * @param event The callback function called each time the timer fires. + * @param interval The callback will be called at least this often. + * @result Returns kIOReturnSuccess if the timer event was successfully added. + */ + virtual IOReturn addTimerEvent(OSObject *target, TimerEvent event, AbsoluteTime interval); + + /*! + * @function removeTimerEvent + * @abstract Removes the timer event for the given target. + * @discussion If the interval for the target to be removed is the smallest interval, + * the timer interval is recalculated based on the remaining targets. The next fire + * time is readjusted based on the new interval compared to the last fire time. + * @param target The target whose timer event will be removed. + */ + virtual void removeTimerEvent(OSObject *target); + + /*! + * @function removeAllTimerEvents + * @abstract Removes all timer events and stops the timer + * @discussion Called during teardown of the driver + */ + virtual void removeAllTimerEvents(); + + + // IOAudioPort management + + /*! + * @function attachAudioPort + * @abstract Adds the port to the IOAudioDevice's list of ports and attaches the port to its parent + * and attaches the child to the port. + * @discussion This function provides the functionality to represent the device's signal chain in the + * IOAudioPlane in the IORegistry. An IOAudioPort's parent(s) are before it in the signal chain + * and its children are after it. This method may be called multiple times for a single IOAudioPort. + * This is necessary when there are many children or parents. Once a relationship is made, it is not + * necessary to make the reverse relationship. A NULL value may be passed in for either the parent + * or child or both. + * The IOAudioPort passed in should be a newly allocated IOAudioPort instance. This function will + * appropriately attach and start the port object. NOTE: It is not necessary to use IOAudioPorts + * in a fully functional audio driver. + * @param port The newly created IOAudioPort instance to be activated. + * @param parent A parent IOAudioPort or IOAudioEngine of the given port. + * @param child A child IOAudioPort or IOAudioEngine of the given port. + * @result Returns true when the port has been successfully added and attached. + */ + virtual IOReturn attachAudioPort(IOAudioPort *port, IORegistryEntry *parent, IORegistryEntry *child); + + /*! + * @function detachAllAudioPorts + * @abstract Deactivates all of the ports in the device. + * @discussion This is called by the stop() and free() methods in IOAudioDevice to completely + * shut down all ports as the driver is being shut down. + */ + virtual void detachAllAudioPorts(); + +protected: + /*! + * @function timerFired + * @abstract Internal static function called when the timer fires. + * @discussion This function simply calls dispatchTimerEvents() on the IOAudioDevice to do just that. + * @param target The IOAudioDevice instance that initiated the timer callback. + * @param sender The IOTimerEventSources calling this callback + */ + static void timerFired(OSObject *target, IOTimerEventSource *sender); + + /*! + * @function dispatchTimerEvents + * @abstract Called by timerFired() to cause the timer event callbacks to be called. + * @discussion This method iterates through all of the timer event targets and calls + * the callback on each. Unless the force flag is set to true, the timer events will + * only be dispatched if the power state is not kIOAudioDeviceSleep. This prevents + * unexpected timer firings while making wake->sleep->wake transitions. This function must + * be called on the IOWorkLoop. + * @function force A bool param to allow the timer events to be dispatched even if the + * device is in the kIOAudioDeviceSleep power state. + */ + virtual void dispatchTimerEvents(bool force); + + /*! + * @function audioEngineStarting + * @abstract Called by IOAudioEngine when it is starting up + * @discussion This should only be called while on the IOWorkLoop. It is not intended to be called + * directly. It is called when an IOAudioEngine is starting up to allow the IOAudioDevice + * to keep track of running audio engines and change the power state from kIOAudioDeviceIdle to + * kIOAudioDeviceActive when the first audio engine starts up. If the state change is done + * asynchronously, it waits for the state change to complete. This is to ensure that the + * system doesn't start playing audio until the IOAudioDevice has completed its transition + * to kIOAudioDeviceActive. + */ + virtual void audioEngineStarting(); + + /*! + * @function audioEngineStopped + * @abstract Called by IOAudioEngine when it has stopped + * @discussion This should only be called while on the IOWorkLoop. It is not intended to be called + * directly. It is called when an IOAudioEngine has stopped to allow the IOAudioDevice + * to keep track of running audio engines and change the power state from kIOAudioDeviceActive + * to kIOAudioDeviceIdle when the last audio engine stops. If the state change is done + * asynchronously, it waits for the state change to complete. + */ + virtual void audioEngineStopped(); + +}; + +#endif /* _IOKIT_IOAUDIODEVICE_H */ diff --git a/i386/include/IOKit/audio/IOAudioEngine.h b/i386/include/IOKit/audio/IOAudioEngine.h new file mode 100644 index 0000000..19477b5 --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioEngine.h @@ -0,0 +1,865 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOAudioEngine + */ + +#ifndef _IOKIT_IOAUDIOENGINE_H +#define _IOKIT_IOAUDIOENGINE_H + +#include + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioTypes.h" +#endif +#include + +class OSDictionary; +class OSCollection; +class OSOrderedSet; +class IOAudioEngineUserClient; +class IOAudioDevice; +class IOAudioStream; +class IOAudioControl; +class IOCommandGate; + +#define IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER 4 + +/*! + * @typedef IOAudioEnginePosition + * @abstract Represents a position in an audio audio engine. + * @discussion This position is based on the sample frame within a + * loop around the sample buffer, and the loop count which starts at 0 when the audio engine + * begins playback. + * @field fSampleFrame The sample frame within the buffer - starts at 0. + * @field fLoopCount The number of times the ring buffer has looped. + */ +typedef struct { + UInt32 fSampleFrame; + UInt32 fLoopCount; +} IOAudioEnginePosition; + +#define CMP_IOAUDIOENGINEPOSITION(p1, p2) \ + (((p1)->fLoopCount > (p2)->fLoopCount) ? 1 : \ + ((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame > (p2)->fSampleFrame) ? 1 : \ + ((p1)->fLoopCount == (p2)->fLoopCount) && ((p1)->fSampleFrame == (p2)->fSampleFrame) ? 0 : -1) + +#define IOAUDIOENGINEPOSITION_IS_ZERO(p1) (((p1)->fLoopCount == 0) && ((p1)->fSampleFrame == 0)) + +/*! + * @class IOAudioEngine + * @abstract Abstract base class for a single audio audio / I/O engine. + * @discussion An IOAudioEngine is defined by a single I/O engine to transfer data to + * or from one or more sample buffers. Each sample buffer is represented by a single IOAudioStream + * instance. A single IOAudioEngine must contain at least one IOAudioStream, but has no upper + * limit on the number of IOAudioStreams it may contain. An IOAudioEngine instance may contain + * both input and output IOAudioStreams. + * + * An audio driver must subclass IOAudioEngine in order to provide certain services. An + * IOAudioEngine subclass must start and stop the I/O engine when requested. The I/O + * engine should be continuously running and loop around from end to beginning. While the audio + * engine is running, it must take a timestamp as the sample buffer(s) wrap around and start at + * the beginning. The CoreAudio.framework uses the timestamp to calculate the exact position of + * the audio engine. An IOAudioEngine subclass must implement getCurrentSampleFrame() to provide + * a sample position on demand. Finally, an IOAudioEngine subclass must provide clipping and + * format conversion routines to go to/from the CoreAudio.framework's native float format. + * + * If multiple stream formats or sample rates are allowed, the IOAudioEngine + * subclass must provide support for changing the hardware when a format or sample rate is + * changed. + * + * There are several attributes associated with a single IOAudioEngine: + * + * The IOAudioEngine superclass provides a shared status buffer that contains all of the dynamic pieces + * of information about the audio engine (type IOAudioEngineStatus). It runs an erase process on + * all of the output streams. The erase head is used to zero out the mix and sample buffers after + * the samples have been played. Additionally, the IOAudioEngine superclass handles the + * communication with the CoreAudio.framework and makes the decision to start and stop the + * audio engine when it detects it is in use. + * + * In order for an audio device to play back or record sound, an IOAudioEngine subclass must be created. + * The subclass must initialize all of the necessary hardware resources to prepare for starting the + * audio I/O engine. It typically will perform these tasks in the initHardware() method. A subclass + * may also implement a stop() method which is called as the driver is being torn down. This is + * typically called in preparation of removing the device from the system for removable devices. + * + * In addition to initializing the necessary hardware, there are a number of other tasks an + * IOAudioEngine must do during initHardware(). It must create the necessary IOAudioStream objects + * to match the device capabilities. Each IOAudioStream must be added using addAudioStream(). It + * also should create the IOAudioControls needed to control the various attributes of the audio engine: + * output volume, mute, input gain, input selection, analog passthru. To do that, addDefaultAudioControl() + * should be called with each IOAudioControl to be attached to the IOAudioEngine. In order to provide + * for proper synchronization, the latency of the audio engine should be specified with setSampleLatency(). + * This value represents the latency between the timestamp taken at the beginning of the buffer and + * when the audio is actually played (or recorded) by the device. If a device is block based or if + * there is a need to keep the CoreAudio.framework a certain number of samples ahead of (or behind for + * input) the I/O head, that value should be specified using setSampleOffset(). If this is not specified + * the CoreAudio.framework may attempt to get as close to the I/O head as possible. + * + * The following fields in the shared IOAudioEngineStatus struct must be maintained by the subclass + * implementation: + *
+ *    fCurrentLoopCount - the number of times the sample buffer has wrapped around to the beginning
+ *    fLastLoopTime - timestamp of the most recent time that the I/O engine looped back to the 
+ *  beginning of the sample buffer
+ *  
+ * It is critically important that the fLastLoopTime field be as accurate as possible. It is + * the basis for the entire timer and synchronization mechanism used by the audio system. + * + * At init time, the IOAudioEngine subclass must call setNumSampleFramesPerBuffer() to indicate how large + * each of the sample buffers are (measured in sample frames). Within a single IOAudioEngine, all sample + * buffers must be the same size and be running at the same sample rate. If different buffers/streams can + * be run at different rates, separate IOAudioEngines should be used. The IOAudioEngine subclass must + * also call setSampleRate() at init time to indicate the starting sample rate of the device. + * + */ + +class IOAudioEngine : public IOService +{ + OSDeclareAbstractStructors(IOAudioEngine) + + friend class IOAudioEngineUserClient; + friend class IOAudioDevice; + friend class IOAudioStream; + +public: + /*! @var gSampleRateWholeNumberKey */ + static const OSSymbol *gSampleRateWholeNumberKey; + /*! @var gSampleRateFractionKey */ + static const OSSymbol *gSampleRateFractionKey; + + /*! @var numSampleFramesPerBuffer */ + UInt32 numSampleFramesPerBuffer; + + /*! @var sampleRate + * The current sample rate of the audio engine in samples per second. */ + IOAudioSampleRate sampleRate; + + /*! @var numErasesPerBuffer + * The number of times the erase head get scheduled to run for each + * cycle of the audio engine. */ + UInt32 numErasesPerBuffer; + /*! @var runEraseHead + * Set to true if the erase head is to run when the audio engine is running. This is the case if there are any output streams. */ + bool runEraseHead; + + /*! @var audioEngineStopPosition + * When all clients have disconnected, this is set to one buffer length past the + * current audio engine position at the time. Then when the stop position is reached, the audio engine + * is stopped */ + IOAudioEnginePosition audioEngineStopPosition; + + /*! @var isRegistered + * Internal state variable to keep track or whether registerService() has been called. */ + bool isRegistered; + /*! @var configurationChangeInProgress + * Set to true after beginConfigurationChange() and false upon a + * subsequent call to completeConfigurationChange() or cancelConfigurationChange(). */ + bool configurationChangeInProgress; + + /*! @var state + * The current state of the IOAudioEngine - running, stopped, paused. */ + IOAudioEngineState state; + + /*! @var status + * Status struct shared with the CoreAudio.framework. */ + IOAudioEngineStatus * status; + + /*! @var audioDevice + * The IOAudioDevice instance to which the IOAudioEngine belongs. */ + IOAudioDevice * audioDevice; + + /*! @var workLoop + * The IOWorkLoop for the audio driver - shared with the IOAudioDevice. */ + IOWorkLoop *workLoop; + /*! @var commandGate + * The IOCommandGate for this audio engine - attached to the driver's IOWorkLoop. */ + IOCommandGate *commandGate; + + /*! @var inputStreams + * An OSSet of all of the input IOAudioStreams attached to this IOAudioEngine. */ + OSOrderedSet *inputStreams; + UInt32 maxNumInputChannels; + /*! @var outputStreams + * An OSSet of all of the output IOAudioStreams attached to this IOAudioEngine. */ + OSOrderedSet *outputStreams; + UInt32 maxNumOutputChannels; + /*! @var userClients + * An OSSet of all of the currently connected user clients. */ + OSSet *userClients; + /*! @var defaultAudioControls + * All of the IOAudioControls that affect this audio engine. */ + OSSet *defaultAudioControls; + + /*! @var numActiveUserClients + * A total of the active user clients - those that are currently playing or + * recording audio. */ + UInt32 numActiveUserClients; + UInt32 sampleOffset; // used for input and output if inputSampleOffset is not set, if inputSampleOffset is set used as output only + + UInt32 index; + bool duringStartup; + +protected: + + /*! + * @var deviceStartedAudioEngine + * Used by the IOAudioDevice to determine responsibility for shutting + * the audio engine down when it is no longer needed. + */ + bool deviceStartedAudioEngine; + +protected: + struct ExpansionData { + UInt32 pauseCount; + IOBufferMemoryDescriptor *statusDescriptor; + IOBufferMemoryDescriptor *bytesInInputBufferArrayDescriptor; + IOBufferMemoryDescriptor *bytesInOutputBufferArrayDescriptor; + UInt32 mixClipOverhead; + OSArray *streams; + UInt32 inputSampleOffset; + }; + + ExpansionData *reserved; + +// static UInt32 sInstanceCount; + +public: + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 0); + virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *newSampleRate); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 1); + virtual IOBufferMemoryDescriptor * getStatusDescriptor(); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 2); + virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, bool isInput); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 3); + virtual IOBufferMemoryDescriptor * getBytesInInputBufferArrayDescriptor(); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 4); + virtual IOBufferMemoryDescriptor * getBytesInOutputBufferArrayDescriptor(); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 5); + /*! + * @function eraseOutputSamples + * @abstract This function allows for the actual erasing of the mix and sample buffer to be overridden by + * a child class. + * @param mixBuf Pointer to the IOAudioFamily allocated mix buffer. + * @param sampleBuf Pointer to the child class' sample buffer. + * @param firstSampleFrame Index to the first sample frame to erase. + * @param numSampleFrames Number of sample frames to erase. + * @param streamFormat Format of the data to be erased. + * @param audioStream Pointer to stream object that corresponds to the sample buffer being erased. + * @result Must return kIOReturnSuccess if the samples have been erased. + */ + virtual IOReturn eraseOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 6); + /*! + * @function setClockIsStable + * @abstract This function sets a flag that CoreAudio uses to select its sample rate tracking algorithm. Set + * this to TRUE unless that results in dropped audio. If the driver is experiencing unexplained dropouts + * setting this FALSE might help. + * @param clockIsStable TRUE tells CoreAudio to use an agressive PLL to quickly lock to the engine's sample rate + * while FALSE tells CoreAudio to adjust more slowly to perceived sample rate changes that might just be the + * result of an unstable clock. + */ + virtual void setClockIsStable(bool clockIsStable); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 7); + /*! + * @function setMixClipOverhead + * @abstract Used to tell IOAudioFamily when the watchdog timer must fire by. + * @discussion setMixClipOverhead allows an audio engine to tell IOAudioFamily how much time + * an engine will take to mix and clip its samples, in percent. + * The default value is 10, meaning 10%. This will cause IOAudioFamily to make + * the watchdog timer fire when there is just over 10% of the time to complete + * a buffer set left (e.g. 51 samples when the HAL is using a buffer size of 512 + * samples). + * @param newMixClipOverhead How much time per buffer should be made available for the + * mix and clip routines to run. Valid values are 1 through 99, inclusive. + * @result return no error + */ + virtual void setMixClipOverhead(UInt32 newMixClipOverhead); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 8); + /*! + * @function setClockDomain + * @abstract Sets a property that CoreAudio uses to determine how devices are synchronized. If an audio device can tell that it is + * synchronized to another engine, it should set this value to that engine's clock domain. If an audio device can be a clock master, it may publish + * its own clock domain for other devices to use. + * @param clockDomain is the unique ID of another engine that this engine realizes it is synchronized to, use the default value kIOAudioNewClockDomain + * to have IOAudioEngine create a unique clock domain. + */ + virtual void setClockDomain(UInt32 clockDomain = kIOAudioNewClockDomain); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 9); + /*! + * @function convertInputSamplesVBR + * @abstract Override this method if you want to return a different number of sample frames than was requested. + */ + virtual IOReturn convertInputSamplesVBR(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 &numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 10); + /*! + * @function setInputSampleOffset + * @abstract set the offset CoreAudio will read from off the current read pointer + * @param numSamples size of offset in sample + */ + virtual void setInputSampleOffset(UInt32 numSamples); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 11); + /*! + * @function setOutputSampleOffset + * @abstract set the offset CoreAudio will write at off the current write pointer + * @param numSamples size of offset in sample + */ + virtual void setOutputSampleOffset(UInt32 numSamples); + +protected: + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 12); + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient, OSDictionary *properties); + +public: + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 13); + /*! + * @function setAttributeForConnection + * @abstract Generic method to set some attribute of the audio engine, specific to one connection. + * @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one connection. + * @param attribute Defines the attribute to be set. + * @param value The new value for the attribute. + * @result an IOReturn code. + */ + + virtual IOReturn setAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t value ); + + // OSMetaClassDeclareReservedUsed(IOAudioEngine, 14); + /*! @function getAttributeForConnection + * @abstract Generic method to retrieve some attribute of the audio engine, specific to one connection. + * @discussion IOAudioEngine subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one connection. + * @param attribute Defines the attribute to be returned. Some defined attributes are:
+ * @param value Returns the value for the attribute. + * @result an IOReturn code. + */ + + virtual IOReturn getAttributeForConnection( SInt32 connectIndex, UInt32 attribute, uintptr_t * value ); + +private: + OSMetaClassDeclareReservedUsed(IOAudioEngine, 0); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 1); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 2); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 3); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 4); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 5); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 6); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 7); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 8); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 9); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 10); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 11); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 12); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 13); + OSMetaClassDeclareReservedUsed(IOAudioEngine, 14); + + OSMetaClassDeclareReservedUnused(IOAudioEngine, 15); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 16); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 17); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 18); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 19); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 20); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 21); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 22); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 23); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 24); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 25); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 26); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 27); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 28); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 29); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 30); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 31); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 32); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 33); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 34); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 35); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 36); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 37); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 38); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 39); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 40); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 41); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 42); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 43); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 44); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 45); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 46); + OSMetaClassDeclareReservedUnused(IOAudioEngine, 47); + +public: + /*! + * @function createDictionaryFromSampleRate + * @abstract Generates a dictionary matching the given sample rate. + * @discussion This is an internal routine used to generate a dictionary matching the given sample rate. It is used to generate a sample rate dictionary for the I/O Registry - used by the + * CoreAudio.framework. + * @result Returns the newly create OSDictionary. + */ + static OSDictionary *createDictionaryFromSampleRate(const IOAudioSampleRate *sampleRate, OSDictionary *rateDict = 0); + + /*! + * @function createSampleRateFromDictionary + * @abstract Generates a sample rate from an OSDictionary. + * @discussion This is an internal routine used to generate a sample rate from an OSDictionary. It is used to generate a sample rate give a new OSDictionary from the IORegistry - coming + * from the CoreAudio.framework. + * @result Returns the sample rate. + */ + static IOAudioSampleRate *createSampleRateFromDictionary(const OSDictionary *rateDict, IOAudioSampleRate *sampleRate = 0); + + /*! + * @function init + * @abstract Performs initialization of a newly allocated IOAudioEngine. + * @discussion This function is responsible for initialization of all of the general attributes of + * a new IOAudioEngine. It initializes instance variables to their default + * values and allocates the shared status buffer. Subclasses will likely want to override this method + * and do all of their common initialization in their implementation. They do need to be sure to call + * IOAudioEngine's implementation of init and pay attention to the return value. + * @param properties The default properties for the IOAudioEngine. + * @result Returns true if initialization was successful. + */ + virtual bool init(OSDictionary *properties); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioEngine. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + /*! + * @function getWorkLoop + * @abstract Returns the IOWorkLoop for the driver. + */ + virtual IOWorkLoop *getWorkLoop() const; + + /*! + * @function getCommandGate + * @abstract Returns the IOCommandGate for this IOAudioEngine. + */ + virtual IOCommandGate *getCommandGate() const; + + /*! + * @function start + * @abstract A simple cover function for start(IOService *, IOAudioDevice *) that assumes the provider + * is the IOAudioDevice. + * @discussion Subclasses will want to override start(IOService *, IOAudioDevice *) rather than this + * one. + * @param provider The service provider for the IOAudioEngine (the IOAudioDevice in this case). + * @result Returns true if the IOAudioEngine was successfully started. + */ + virtual bool start(IOService *provider); + + /*! + * @function start + * @abstract Standard IOKit start() routine called to start an IOService. + * @discussion This function is called in order to prepare the IOAudioEngine for use. It does NOT + * mean that the audio I/O engine itself should be started. This implementation gets the IOWorkLoop + * from the IOAudioDevice and allocates an IOCommandGate. Finally it calls initHardware() in which + * all of the subclass-specific device initialization should be done. Upon return from initHardware() + * all IOAudioStreams should be created and added to the audio engine. Also, all IOAudioControls + * for this IOAudioEngine should be created and attached. + * @param provider The service provider for the IOAudioEngine. + * @param device The IOAudioDevice to which this IOAudioEngine belongs. + * @result Returns true if the service was successfully started. + */ + virtual bool start(IOService *provider, IOAudioDevice *device); + + /*! + * @function initHardware + * @abstract This function is called by start() to provide a convenient place for the subclass to + * perform its hardware initialization. + * @discussion Upon return from this function, all IOAudioStreams and IOAudioControls should be created + * and the audio engine should be ready to be started when a client requests that playback begin. + * @function provider The service provider numb for this audio engine - typically the IOAudioDevice. + * @result Returns true if the hardware was successfully initialized. + */ + virtual bool initHardware(IOService *provider); + + /*! + * @function stop + * @abstract Stops the service and prepares for the driver to be terminated. + * @discussion This function is called before the driver is terminated and usually means that the device + * has been removed from the system. + * @param provider The service provider for the IOAudioEngine. + */ + virtual void stop(IOService *provider); + + /*! + * @function registerService + * @abstract Called when this audio engine is ready to begin vending services. + * @discussion This function is called by IOAudioDevice::activateAudioEngine() once the audio engine + * has been fully initialized and is ready to begin audio playback. + * @param options + */ + virtual void registerService(IOOptionBits options = 0); + + virtual void setAudioDevice(IOAudioDevice *device); + virtual void setIndex(UInt32 index); + + virtual void setDescription(const char *description); + + /*! + * @function newUserClient + * @abstract Requests a new user client object for this service. + * @discussion This function is called automatically by I/O Kit when a user process attempts + * to connect to this service. It allocates a new IOAudioEngineUserClient object and increments + * the number of connections for this audio engine. If this is the first user client for this IOAudioEngine, + * it calls startAudioEngine(). There is no need to call this function directly. + * A derived class that requires overriding of newUserClient should override the version with the properties + * parameter for Intel targets, and without the properties parameter for PPC targets. The #if __i386__ directive + * can be used to select between the two behaviors. + * @param task The task requesting the new user client. + * @param securityID Optional security paramater passed in by the client - ignored. + * @param type Optional user client type passed in by the client - ignored. + * @param handler The new IOUserClient * must be stored in this param on a successful completion. + * @param properties A dictionary of additional properties for the connection. + * @result Returns kIOReturnSuccess on success. May also result kIOReturnError or kIOReturnNoMemory. + */ + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, IOUserClient **handler); + virtual IOReturn newUserClient(task_t task, void *securityID, UInt32 type, OSDictionary *properties, IOUserClient **handler); + + /*! + * @function addAudioStream + * @abstract Adds an IOAudioStream to the audio engine. + * @discussion This function is called by the driver to add an IOAudioStream to the audio engine. This must be called at least once to make sure the audio engine has at least one IOAudioStream. + * @param stream The IOAudioStream to be added. + * @result Returns kIOReturnSuccess if the stream was successfully added. + */ + virtual IOReturn addAudioStream(IOAudioStream *stream); + + virtual IOAudioStream *getAudioStream(IOAudioStreamDirection direction, UInt32 channelID); + + virtual void lockAllStreams(); + virtual void unlockAllStreams(); + + virtual void updateChannelNumbers(); + + /*! + * @function resetStatusBuffer + * @abstract Resets the status buffer to its default values. + * @discussion This is called during startAudioEngine() and resumeAudioEngine() to clear out the status buffer + * in preparation of starting up the I/O engine. There is no need to call this directly. + */ + virtual void resetStatusBuffer(); + + /*! + * @function clearAllSampleBuffers + * @abstract Zeros out all of the sample and mix buffers associated with the IOAudioEngine + * @discussion This is called during resumeAudioEngine() since the audio engine gets started back at the + * beginning of the sample buffer. + */ + virtual void clearAllSampleBuffers(); + + /*! + * @function getCurrentSampleFrame + * @abstract Gets the current sample frame from the IOAudioEngine subclass. + * @result + */ + virtual UInt32 getCurrentSampleFrame() = 0; + + /*! + * @function startAudioEngine + * @abstract Starts the audio I/O engine. + * @discussion This method is called automatically when the audio engine is placed into use the first time. + * This must be overridden by the subclass. No call to the superclass's implementation is + * necessary. The subclass's implementation must start up the audio I/O engine. This includes any audio + * engine that needs to be started as well as any interrupts that need to be enabled. Upon successfully + * starting the engine, the subclass's implementation must call setState(kIOAudioEngineRunning). If + * it has also checked the state using getState() earlier in the implementation, the stateLock must be + * acquired for the entire initialization process (using IORecursiveLockLock(stateLock) and + * IORecursiveLockUnlock(stateLock)) to ensure that the state remains consistent. See the general class + * comments for an example. + * @result Must return kIOReturnSuccess on a successful start of the engine. + */ + virtual IOReturn startAudioEngine(); + + /*! + * @function stopAudioEngine + * @abstract Stops the audio I/O engine. + * @discussion This method is called automatically when the last client disconnects from this audio engine. + * It must be overridden by the subclass. No call to the superclass's implementation is necessary. + * The subclass's implementation must stop the audio I/O engine. The audio engine (if it exists) should + * be stopped and any interrupts disabled. Upon successfully stopping the engine, the subclass must call + * setState(kAudioEngineStopped). If it has also checked the state using getState() earlier in the + * implementation, the stateLock must be acquired for the entire initialization process (using + * IORecursiveLockLock(stateLock) and IORecursiveLockUnlock(stateLock)) to ensure that the state remains + * consistent. + * @result Must return kIOReturnSuccess on a successful stop of the engine. + */ + virtual IOReturn stopAudioEngine(); + virtual IOReturn pauseAudioEngine(); + virtual IOReturn resumeAudioEngine(); + + /*! + * @function performAudioEngineStart + * @abstract Called to start the audio I/O engine + * @discussion This method is called by startAudioEngine(). This must be overridden by the subclass. + * No call to the superclass' implementation is necessary. The subclass' implementation must start up the + * audio I/O engine. This includes any audio engine that needs to be started as well as any interrupts + * that need to be enabled. + * @result Must return kIOReturnSuccess on a successful start of the engine. + */ + virtual IOReturn performAudioEngineStart(); + + /*! + * @function performAudioEngineStop + * @abstract Called to stop the audio I/O engine + * @discussion This method is called by stopAudioEngine() and pauseAudioEngine. + * This must be overridden by the subclass. No call to the superclass' implementation is + * necessary. The subclass' implementation must stop the audio I/O engine. This includes any audio + * engine that needs to be stopped as well as any interrupts that need to be disabled. + * @result Must return kIOReturnSuccess on a successful stop of the engine. + */ + virtual IOReturn performAudioEngineStop(); + + /*! + * @function getState + * @abstract Returns the current state of the IOAudioEngine. + * @discussion If this method is called in preparation for calling setState(), the stateLock must + * be acquired before the first call to getState() and held until after the last call to setState(). + * Be careful not to return from the code acquiring the lock while the lock is being held. That + * will cause a deadlock situation. + * @result The current state of the IOAudioEngine: kIOAudioEngineRunning, kIOAudioEngineStopped. + */ + virtual IOAudioEngineState getState(); + + /*! + * @function getSampleRate + * @abstract Returns the sample rate of the IOAudioEngine in samples per second. + */ + virtual const IOAudioSampleRate *getSampleRate(); + + virtual IOReturn hardwareSampleRateChanged(const IOAudioSampleRate *sampleRate); + + /*! + * @function getRunEraseHead + * @abstract Returns true if the audio engine will run the erase head when the audio engine is running. + */ + virtual bool getRunEraseHead(); + + /*! + * @function getStatus + * @abstract Returns a pointer to the shared status buffer. + */ + virtual const IOAudioEngineStatus *getStatus(); + + /*! + * @function timerCallback + * @abstract A static method used as a callback for the IOAudioDevice timer services. + * @discussion This method implements the IOAudioDevice::TimerEvent type. + * @param arg1 The IOAudioEngine that is the target of the event. + * @param device The IOAudioDevice that sent the timer event. + */ + static void timerCallback(OSObject *arg1, IOAudioDevice *device); + + /*! + * @function timerFired + * @abstract Indicates the timer has fired. + * @discussion This method is called by timerCallback to indicate the timer has fired. This method calls performErase() and performFlush() to do erase head processing and + * audio engine flushing each time the timer event fires. + */ + virtual void timerFired(); + + /*! + * @function getTimerInterval + * @abstract Gets the timer interval for use by the timer event. + * @discussion This method is called each time the timer event is enabled through addTimer(). The default + * implementation is set to return a value such that the timer event runs n times each cycle of the audio + * engine through the sample buffer. The value n is stored as the instance variable: numErasesPerBuffer. + * The default value of numErasesPerBuffer is set to IOAUDIOENGINE_DEFAULT_NUM_ERASES_PER_BUFFER which is 4. + * A subclass may change the value of numErasesPerBuffer or override getTimerInterval. If it is overridden, + * the subclass should call the superclass's implementation, compare its interval with the superclass's and + * return the smaller of the two. + * @result Returns the interval for the timer event. + */ + virtual AbsoluteTime getTimerInterval(); + + /*! + * @function performErase + * @abstract Performs erase head processing. + * @discussion This method is called automatically each time the timer event fires and erases the sample + * buffer and mix buffer from the previous location up to the current location of the audio engine. + */ + virtual void performErase(); + + /*! + * @function performFlush + * @abstract Performs the flush operation. + * @discussion This method is called automatically each time the timer event fires. It stops the audio engine + * if there are no more clients and the audio engine is passed the latest flush ending position. + */ + virtual void performFlush(); + + virtual void stopEngineAtPosition(IOAudioEnginePosition *endingPosition); + + virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + virtual IOReturn clipOutputSamples(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + virtual void resetClipPosition(IOAudioStream *audioStream, UInt32 clipSampleFrame); + virtual IOReturn convertInputSamples(const void *sampleBuf, void *destBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + + virtual void takeTimeStamp(bool incrementLoopCount = true, AbsoluteTime *timestamp = NULL); + virtual IOReturn getLoopCountAndTimeStamp(UInt32 *loopCount, AbsoluteTime *timestamp); + + virtual IOReturn calculateSampleTimeout(AbsoluteTime *sampleInterval, UInt32 numSampleFrames, IOAudioEnginePosition *startingPosition, AbsoluteTime *wakeupTime); + + virtual IOReturn performFormatChange(IOAudioStream *audioStream, const IOAudioStreamFormat *newFormat, const IOAudioSampleRate *newSampleRate); + + virtual void beginConfigurationChange(); + virtual void completeConfigurationChange(); + virtual void cancelConfigurationChange(); + + virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl); + virtual IOReturn removeDefaultAudioControl(IOAudioControl *defaultAudioControl); + virtual void removeAllDefaultAudioControls(); + + virtual OSString *getGlobalUniqueID(); + virtual OSString *getLocalUniqueID(); + +protected: + + /*! + * @function initKeys + * @abstract Generates the OSSymbols with the keys. + * @discussion Do not call this directly. This is an internal initialization routine. + */ + static void initKeys(); + + virtual void setNumSampleFramesPerBuffer(UInt32 numSampleFrames); + virtual UInt32 getNumSampleFramesPerBuffer(); + + /*! + * @function setState + * @abstract Indicates that the audio engine is in the specified state. + * @discussion This method simply sets the internal state of the audio engine to the specified state. It does not + * affect a change to the state. It does however keep other internal state-related attributes consistent. + * For example, it enables or disables the timer as needed when the state changes to running or stopped. + * @param newState The state the audio engine is in. + * @result Returns the old state. + */ + virtual IOAudioEngineState setState(IOAudioEngineState newState); + + /*! + * @function setSampleRate + * @abstract Records the sample rate of the audio engine. + * @discussion This method must be called during initialization of a new audio engine to record the audio engine's + * initial sample rate. It also is intended to be used to record changes to the sample rate during use. + * Currently changing sample rates after the audio engine has been started is not supported. + * It may require that the sample buffers be re-sized. This will be available in an upcoming release. + * @param newSampleRate The sample rate of the audio engine in samples per second. + */ + virtual void setSampleRate(const IOAudioSampleRate *newSampleRate); + + /*! + * @function setSampleLatency + * @abstract Sets the sample latency for the audio engine. + * @discussion The sample latency represents the number of samples ahead of the playback head + * that it is safe to write into the sample buffer. The audio device API will never write + * closer to the playback head than the number of samples specified. For input audio engines + * the number of samples is behind the record head. + */ + virtual void setSampleLatency(UInt32 numSamples); + virtual void setOutputSampleLatency(UInt32 numSamples); + virtual void setInputSampleLatency(UInt32 numSamples); + virtual void setSampleOffset(UInt32 numSamples); + + /*! + * @function setRunEraseHead + * @abstract Tells the audio engine whether or not to run the erase head. + * @discussion By default, output audio engines run the erase head and input audio engines do not. This method can + * be called after setDirection() is called in order to change the default behavior. + * @param runEraseHead The audio engine will run the erase head if this value is true. + */ + virtual void setRunEraseHead(bool runEraseHead); + + /*! + * @function clientClosed + * @abstract Called automatically when a user client closes its connection to the audio engine. + * @discussion This method decrements the number of connections to the audio engine and if they reach + * zero, the audio engine is called with a call to stopAudioEngine(). This method should not be called directly. + * @param client The user client that has disconnected. + */ + virtual void clientClosed(IOAudioEngineUserClient *client); + + /*! + * @function addTimer + * @abstract Enables the timer event for the audio engine. + * @discussion There is a timer event needed by the IOAudioEngine for processing the erase head + * and performing flushing operations. When the timer fires, the method timerFired() is ultimately + * called which in turn calls performErase() and performFlush(). This is called automatically + * to enable the timer event for this audio engine. It is called by setState() when the audio engine state + * is set to kIOAudioEngineRunning. When the timer is no longer needed, removeTimer() is called. + * There is no need to call this directly. + */ + virtual void addTimer(); + + /*! + * @function removeTimer + * @abstract Disables the timer event for the audio engine. + * @discussion This method is called automatically to disable the timer event for this audio engine. + * There is need to call it directly. This method is called by setState() when the audio engine state + * is changed from kIOAudioEngineRunning to one of the stopped states. + */ + virtual void removeTimer(); + + virtual void sendFormatChangeNotification(IOAudioStream *audioStream); + virtual void sendNotification(UInt32 notificationType); + + virtual IOReturn createUserClient(task_t task, void *securityID, UInt32 type, IOAudioEngineUserClient **newUserClient); + + static IOReturn _addUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn addUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn _removeUserClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn removeUserClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn detachUserClientsAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOReturn addUserClient(IOAudioEngineUserClient *newUserClient); + virtual IOReturn removeUserClient(IOAudioEngineUserClient *userClient); + virtual IOReturn detachUserClients(); + + virtual IOReturn startClient(IOAudioEngineUserClient *userClient); + virtual IOReturn stopClient(IOAudioEngineUserClient *userClient); + + virtual IOReturn incrementActiveUserClients(); + virtual IOReturn decrementActiveUserClients(); + + virtual void detachAudioStreams(); + void setWorkLoopOnAllAudioControls(IOWorkLoop *wl); + + static inline void lockStreamForIO(IOAudioStream *stream); + static inline void unlockStreamForIO(IOAudioStream *stream); + + // These aren't virtual by design + UInt32 getNextStreamID(IOAudioStream * newStream); + IOAudioStream * getStreamForID(UInt32 streamID); + +}; + +#endif /* _IOKIT_IOAUDIOENGINE_H */ diff --git a/i386/include/IOKit/audio/IOAudioEngineUserClient.h b/i386/include/IOKit/audio/IOAudioEngineUserClient.h new file mode 100644 index 0000000..cc51a83 --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioEngineUserClient.h @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOENGINEUSERCLIENT_H +#define _IOKIT_IOAUDIOENGINEUSERCLIENT_H + +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioEngine.h" +#include "IOAudioTypes.h" +#endif +#include + +class IOAudioEngine; +class IOAudioStream; +class IOMemoryDescriptor; +class IOCommandGate; +class IOWorkLoop; + +class IOAudioEngineUserClient; +class IOAudioClientBufferSet; +typedef struct IOAudioFormatNotification; +typedef struct IOAudioClientBuffer { + IOAudioEngineUserClient *userClient; + IOAudioStream *audioStream; + void *sourceBuffer; + IOMemoryDescriptor *sourceBufferDescriptor; + IOMemoryMap *sourceBufferMap; + void *unmappedSourceBuffer; + UInt32 numSampleFrames; + UInt32 numChannels; + IOAudioEnginePosition mixedPosition; + struct IOAudioClientBuffer *mNextBuffer32; + struct IOAudioClientBuffer *nextClip; + struct IOAudioClientBuffer *previousClip; + struct IOAudioClientBuffer *nextClient; + IOAudioBufferDataDescriptor *bufferDataDescriptor; +} IOAudioClientBuffer; + +/* IOAudioClientBuffer64 added for binary compatibility with old PPC drivers covered by */ +typedef struct IOAudioClientBuffer64 +{ + IOAudioClientBuffer mAudioClientBuffer32; + mach_vm_address_t mUnmappedSourceBuffer64; + struct IOAudioClientBuffer64 *mNextBuffer64; +} IOAudioClientBuffer64; + +typedef struct IOAudioClientBufferExtendedInfo { + // Added stuff for registerClientParameterBuffer + UInt32 bufferSetID; + void *paramBuffer; + IOMemoryDescriptor *paramBufferDescriptor; + IOMemoryMap *paramBufferMap; + void *unmappedParamBuffer; + struct IOAudioClientBufferExtendedInfo *mNextExtended; +} IOAudioClientBufferExtendedInfo; +/* IOAudioClientBufferExtendedInfo64 added for binary compatibility with old PPC drivers covered by */ +typedef struct IOAudioClientBufferExtendedInfo64 +{ + IOAudioClientBufferExtendedInfo mAudioClientBufferExtended32; + mach_vm_address_t mUnmappedParamBuffer64; + struct IOAudioClientBufferExtendedInfo64 *mNextExtended64; +} IOAudioClientBufferExtendedInfo64; + + +class IOAudioEngineUserClient : public IOUserClient + { + OSDeclareDefaultStructors(IOAudioEngineUserClient) + + friend class IOAudioEngine; + friend class IOAudioClientBufferSet; + friend class IOAudioStream; + + protected: + IOAudioEngine *audioEngine; + + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + + IOExternalMethod old_methods[5]; // It's size can't be changed for binary compatibility reasons, no longer used. + IOExternalTrap trap; + + task_t clientTask; + UInt32 numSampleFrames; // Never used... + + IOAudioClientBufferSet *clientBufferSetList; + IORecursiveLock *clientBufferLock; + + IOAudioNotificationMessage *notificationMessage; + + bool online; + + protected: + struct ExpansionData { + IOAudioClientBufferExtendedInfo64 *extendedInfo; + IOExternalMethod methods[kIOAudioEngineNumCalls]; // This size can be changed, this is the new methods pointer + UInt32 classicMode; + }; + + ExpansionData *reserved; + + public: + virtual IOReturn externalMethod( uint32_t selector, IOExternalMethodArguments * arguments, IOExternalMethodDispatch * dispatch, + OSObject * target, void * reference); + // New code added here... + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0); + virtual IOReturn registerClientParameterBuffer (void * parameterBuffer, UInt32 bufferSetID); // unused function + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1); + virtual IOAudioClientBufferExtendedInfo * findExtendedInfo(UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2); + virtual IOReturn getNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3); + virtual IOReturn getClientNearestStartTime(IOAudioStream *audioStream, IOAudioTimeStamp *ioTimeStamp, UInt32 isInput); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4); + virtual IOReturn safeRegisterClientBuffer(UInt32 audioStreamIndex, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5); + virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type, OSDictionary *properties); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); + virtual IOReturn safeRegisterClientBuffer64(UInt32 audioStreamIndex, mach_vm_address_t * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); + virtual IOReturn registerClientBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); + virtual IOReturn registerBuffer64(IOAudioStream *audioStream, mach_vm_address_t sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); + virtual IOReturn unregisterBuffer64(mach_vm_address_t sourceBuffer, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); + virtual IOReturn unregisterClientBuffer64(mach_vm_address_t * sourceBuffer, UInt32 bufferSetID); + // OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); + virtual IOAudioClientBufferExtendedInfo64 * findExtendedInfo64(UInt32 bufferSetID); + + + + private: + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 0); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 1); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 2); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 3); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 4); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 5); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 6); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 7); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 8); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 9); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 10); + OSMetaClassDeclareReservedUsed(IOAudioEngineUserClient, 11); + + + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 12); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 13); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 14); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 15); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 16); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 17); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 18); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 19); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 20); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 21); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 22); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 23); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 24); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 25); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 26); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 27); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 28); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 29); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 30); + OSMetaClassDeclareReservedUnused(IOAudioEngineUserClient, 31); + + protected: + virtual IOReturn clientClose(); + virtual IOReturn clientDied(); + + static IOReturn _closeClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn closeClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + virtual IOReturn closeClient(); + + + virtual IOReturn clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory); + virtual IOExternalMethod *getExternalMethodForIndex(UInt32 index); + virtual IOExternalTrap *getExternalTrapForIndex(UInt32 index); + virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 type, UInt32 refCon); + + static IOReturn _registerNotificationAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn registerNotificationAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + virtual IOReturn registerNotification(mach_port_t port, UInt32 refCon); + + virtual void setOnline(bool newOnline); + + virtual IOReturn performClientOutput(UInt32 firstSampleFrame, UInt32 loopCount, IOAudioClientBufferSet *bufferSet, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo); + virtual IOReturn performClientInput(UInt32 firstSampleFrame, IOAudioClientBufferSet *bufferSet); + virtual void performWatchdogOutput(IOAudioClientBufferSet *clientBufferSet, UInt32 generationCount); + + virtual void lockBuffers(); + virtual void unlockBuffers(); + + public: + + static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type); + static IOAudioEngineUserClient *withAudioEngine(IOAudioEngine *engine, task_t clientTask, void *securityToken, UInt32 type, OSDictionary *properties); + + virtual bool initWithAudioEngine(IOAudioEngine *engine, task_t task, void *securityToken, UInt32 type); + + virtual void free(); + virtual void freeClientBufferSetList(); + virtual void freeClientBuffer(IOAudioClientBuffer64 *clientBuffer); + + virtual void stop(IOService *provider); + + virtual bool isOnline(); + + virtual IOReturn registerBuffer(IOAudioStream *audioStream, void* sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + virtual IOReturn unregisterBuffer( void * sourceBuffer, UInt32 bufferSetID); + + static IOReturn _registerBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn registerBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn _unregisterBufferAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn unregisterBufferAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOReturn registerClientBuffer(IOAudioStream *audioStream, void * sourceBuffer, UInt32 bufSizeInBytes, UInt32 bufferSetID); + virtual IOReturn unregisterClientBuffer(void * sourceBuffer, UInt32 bufferSetID); + + static IOReturn _getNearestStartTimeAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn getNearestStartTimeAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOAudioClientBufferSet *findBufferSet(UInt32 bufferSetID); + virtual void removeBufferSet(IOAudioClientBufferSet *bufferSet); + + virtual IOReturn getConnectionID(UInt32 *connectionID); + + virtual IOReturn clientStart(); + virtual IOReturn clientStop(); + + static IOReturn _startClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn startClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + static IOReturn _stopClientAction(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); // + static IOReturn stopClientAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + + virtual IOReturn startClient(); + virtual IOReturn stopClient(); + + virtual IOReturn performClientIO(UInt32 firstSampleFrame, UInt32 loopCount, bool inputIO, UInt32 bufferSetID, UInt32 sampleIntervalHi, UInt32 sampleIntervalLo); + + virtual void sendFormatChangeNotification(IOAudioStream *audioStream); + virtual IOReturn sendNotification(UInt32 notificationType); + + }; + +#endif /* _IOKIT_IOAUDIOENGINEUSERCLIENT_H */ diff --git a/i386/include/IOKit/audio/IOAudioLevelControl.h b/i386/include/IOKit/audio/IOAudioLevelControl.h new file mode 100644 index 0000000..d76786d --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioLevelControl.h @@ -0,0 +1,205 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOLEVELCONTROL_H +#define _IOKIT_IOAUDIOLEVELCONTROL_H + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +class OSArray; + +/*! + * @class IOAudioLevelControl + * @abstract + * @discussion + */ + +class IOAudioLevelControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioLevelControl) + +protected: + SInt32 minValue; + SInt32 maxValue; + IOFixed minDB; + IOFixed maxDB; + + OSArray *ranges; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + static IOAudioLevelControl *createPassThruVolumeControl (SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName, + UInt32 cntrlID); + + // OSMetaClassDefineReservedUnused(IOAudioLevelControl, 0); + /*! + * @function setLinearScale + * @abstract This function tells CoreAudio if it should apply a curve to the scaler representation of the volume. + * @param useLinearScale TRUE instructs CoreAudio to not apply a curve to the scaler representation of the volume, + * FALSE instructs CoreAudio to apply a curve, which is CoreAudio's default behavior. + */ + virtual void setLinearScale(bool useLinearScale); + +private: + OSMetaClassDeclareReservedUsed(IOAudioLevelControl, 0); + + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 1); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 2); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioLevelControl, 15); + +public: + /*! + * @function create + * @abstract Allocates a new level control with the given attributes + * @param initialValue The initial value of the control + * @param minValue The lowest possible value the control may have + * @param maxValue The highest possible value the control may have + * @param minDB A fixed point representation of the db value matching minValue + * @param maxDB A fixed point representation of the db value matching maxValue + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls. + * @result Returns a newly allocted and initialized level IOAudioControl + */ + static IOAudioLevelControl *create(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + static IOAudioLevelControl *createVolumeControl(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 usage = 0); + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioLevelControl with the given attributes + * @param initialValue The initial value of the control + * @param minValue The lowest possible value the control may have + * @param maxValue The highest possible value the control may have + * @param minDB A fixed point representation of the db value matching minValue + * @param maxDB A fixed point representation of the db value matching maxValue + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioTypes.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls. + * @param properties Standard property list passed to the init() function of any new IOService. This dictionary + * gets stored in the registry entry for this service. + * @result Returns true on success + */ + virtual bool init(SInt32 initialValue, + SInt32 minValue, + SInt32 maxValue, + IOFixed minDB, + IOFixed maxDB, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + + virtual void free(); + + /*! + * @function setMinValue + * @abstract Sets the minimum value the control may have + * @param minValue The minimum value for the control + */ + virtual void setMinValue(SInt32 minValue); + + virtual SInt32 getMinValue(); + + /*! + * @function setMaxValue + * @abstract Sets the maximum value the control may have + * @param maxValue The maximum value for the control + */ + virtual void setMaxValue(SInt32 maxValue); + + virtual SInt32 getMaxValue(); + + /*! + * @function setMinDB + * @abstract Sets the minimum value in db that the control may have + * @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed + * type is a 16.16 fixed point value. + * @param minDB The minimum value in db for the control + */ + virtual void setMinDB(IOFixed minDB); + + virtual IOFixed getMinDB(); + + /*! + * @function setMaxDB + * @abstract Sets the maximum value in db that the control may have + * @discussion This value is represented as an IOFixed value which is a fixed point number. The IOFixed + * type is a 16.16 fixed point value. + * @param maxDB The maximum value in db for the control + */ + virtual void setMaxDB(IOFixed maxDB); + + virtual IOFixed getMaxDB(); + + virtual IOReturn addRange(SInt32 minValue, SInt32 maxValue, IOFixed minDB, IOFixed maxDB); + virtual IOReturn addNegativeInfinity(SInt32 negativeInfinityValue); + + virtual IOReturn validateValue(OSObject *newValue); +}; + +#endif /* _IOKIT_IOAUDIOLEVELCONTROL_H */ diff --git a/i386/include/IOKit/audio/IOAudioPort.h b/i386/include/IOKit/audio/IOAudioPort.h new file mode 100644 index 0000000..728c65e --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioPort.h @@ -0,0 +1,184 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOPORT_H +#define _IOKIT_IOAUDIOPORT_H + +#include + +class IOAudioDevice; +class IOAudioControl; +class OSDictionary; + +/*! + * @class IOAudioPort + * @abstract Represents a logical or physical port or functional unit in an audio device. + * @discussion An IOAudioPort represents an element in the signal chain in the audio device. It may contain + * one or more controls (represented by IOAudioControl) by which different attributes of the port may be + * represented and adjusted. + * + * IOAudioPort objects are connected up in the IORegistry in the IOAudioPlane to represent the signal chain of + * the device. They may be connected to other IOAudioPorts as well as IOAudioEngines to indicate they either + * feed into or are fed by one of the audio engines (i.e. they provide input to or take output from the computer). + */ +class IOAudioPort : public IOService +{ + friend class IOAudioDevice; + + OSDeclareDefaultStructors(IOAudioPort) + +public: + /* @var audioDevice The IOAudioDevice that this IOAudioPort belongs to. */ + IOAudioDevice * audioDevice; + /* @var audioControls A set containg all of the IOAudioControl instances that belong to the port. */ + OSSet * audioControls; + bool isRegistered; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +private: + OSMetaClassDeclareReservedUnused(IOAudioPort, 0); + OSMetaClassDeclareReservedUnused(IOAudioPort, 1); + OSMetaClassDeclareReservedUnused(IOAudioPort, 2); + OSMetaClassDeclareReservedUnused(IOAudioPort, 3); + OSMetaClassDeclareReservedUnused(IOAudioPort, 4); + OSMetaClassDeclareReservedUnused(IOAudioPort, 5); + OSMetaClassDeclareReservedUnused(IOAudioPort, 6); + OSMetaClassDeclareReservedUnused(IOAudioPort, 7); + OSMetaClassDeclareReservedUnused(IOAudioPort, 8); + OSMetaClassDeclareReservedUnused(IOAudioPort, 9); + OSMetaClassDeclareReservedUnused(IOAudioPort, 10); + OSMetaClassDeclareReservedUnused(IOAudioPort, 11); + OSMetaClassDeclareReservedUnused(IOAudioPort, 12); + OSMetaClassDeclareReservedUnused(IOAudioPort, 13); + OSMetaClassDeclareReservedUnused(IOAudioPort, 14); + OSMetaClassDeclareReservedUnused(IOAudioPort, 15); + OSMetaClassDeclareReservedUnused(IOAudioPort, 16); + OSMetaClassDeclareReservedUnused(IOAudioPort, 17); + OSMetaClassDeclareReservedUnused(IOAudioPort, 18); + OSMetaClassDeclareReservedUnused(IOAudioPort, 19); + OSMetaClassDeclareReservedUnused(IOAudioPort, 20); + OSMetaClassDeclareReservedUnused(IOAudioPort, 21); + OSMetaClassDeclareReservedUnused(IOAudioPort, 22); + OSMetaClassDeclareReservedUnused(IOAudioPort, 23); + OSMetaClassDeclareReservedUnused(IOAudioPort, 24); + OSMetaClassDeclareReservedUnused(IOAudioPort, 25); + OSMetaClassDeclareReservedUnused(IOAudioPort, 26); + OSMetaClassDeclareReservedUnused(IOAudioPort, 27); + OSMetaClassDeclareReservedUnused(IOAudioPort, 28); + OSMetaClassDeclareReservedUnused(IOAudioPort, 29); + OSMetaClassDeclareReservedUnused(IOAudioPort, 30); + OSMetaClassDeclareReservedUnused(IOAudioPort, 31); + +public: + /*! + * @function withAttributes + * @abstract Allocates a new IOAudioPort instance with the given attributes + * @discussion This static method allocates a new IOAudioPort and calls initWithAttributes() on it with + * the parameters passed in to it. + * @param portType A readable string representing the type of port. Common port types are defined in + * IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are + * other common port types that should be included. + * @param portName A readable string representing the name of the port. For example: 'Internal Speaker', + * 'Line Out'. This field is optional, but useful for providing information to the application/user. + * @param subType Developer defined readable string representing a subtype for the port. (optional) + * @param properties Standard property list passed to the init of any new IOService. This dictionary + * gets stored in the registry for this instance. (optional) + * @result Returns the newly allocated and initialized IOAudioPort instance. + */ + static IOAudioPort *withAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0); + + /*! + * @function initWithAttributes + * @abstract Initializes a newly allocated IOAudioPort instance with the given attributes + * @discussion The properties parameter is passed on the superclass' init(). The portType, subType + * and properties parameters are optional, however portType is recommended. + * @param portType A readable string representing the type of port. Common port types are defined in + * IOAudioTypes.h and are prefixed with 'kIOAudioPortType'. Please provide feedback if there are + * other common port types that should be included. + * @param portName A readable string representing the name of the port. For example: 'Internal Speaker', + * 'Line Out'. This field is optional, but useful for providing information to the application/user. + * @param subType Developer defined readable string representing a subtype for the port. (optional) + * @param properties Standard property list passed to the init of any new IOService. This dictionary + * gets stored in the registry for this instance. (optional) + * @result Returns true on success. + */ + virtual bool initWithAttributes(UInt32 portType, const char *portName = 0, UInt32 subType = 0, OSDictionary *properties = 0); + + /*! + * @function free + * @abstract Frees all of the resources allocated by the IOAudioPort. + * @discussion Do not call this directly. This is called automatically by the system when the instance's + * refcount goes to 0. To decrement the refcount, call release() on the object. + */ + virtual void free(); + + /*! + * @function start + * @abstract Called to start a newly created IOAudioPort. + * @discussion This is called automatically by IOAudioDevice when attachAudioPort() is called. + * @param provider The IOAudioDevice that owns this port + * @result Returns true on success + */ + virtual bool start(IOService *provider); + + /*! + * @function stop + * @abstract Called when the IOAudioDevice is stopping when it is no longer available. + * @discussion This method calls deactivateAudioControls() to shut down all of the controls associated with + * this port. + * @param provider The IOAudioDevice that owns this port + */ + virtual void stop(IOService *provider); + + virtual void registerService(IOOptionBits options = 0); + + virtual IOAudioDevice *getAudioDevice(); + + /*! + * @function addAudioControl + * @abstract Adds a newly created IOAudioControl instance to the port. + * @discussion This method is responsible for starting the new IOAudioControl and adding it to the internal + * audioControls array. + * @param control A newly created IOAudioControl instance that should belong to this port. + * @result Returns true on successfully staring the IOAudioControl. + */ + virtual IOReturn addAudioControl(IOAudioControl *control); + + /*! + * @function deactivateAudioControls + * @abstract Called to shut down all of the audio controls for this port. + * @discussion This will stop all of the audio controls and release them so that the instances may be + * freed. This is called from the free() method. + */ + virtual void deactivateAudioControls(); + +protected: + virtual void setType(UInt32 portType); + virtual void setSubType(UInt32 subType); + virtual void setName(const char *name); +}; + +#endif /* _IOKIT_IOAUDIOPORT_H */ diff --git a/i386/include/IOKit/audio/IOAudioSelectorControl.h b/i386/include/IOKit/audio/IOAudioSelectorControl.h new file mode 100644 index 0000000..8687810 --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioSelectorControl.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOSELECTORCONTROL_H +#define _IOKIT_IOAUDIOSELECTORCONTROL_H + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +class OSString; +class OSArray; + +class IOAudioSelectorControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioSelectorControl) + +protected: + + OSArray *availableSelections; + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +public: + static IOAudioSelectorControl *createOutputSelector(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0); + static IOAudioSelectorControl *createOutputClockSelector(SInt32 initialValue, + UInt32 channelID, + UInt32 clockSource, + const char *channelName = 0, + UInt32 cntrlID = 0); + static IOAudioSelectorControl *createInputClockSelector(SInt32 initialValue, + UInt32 channelID, + UInt32 clockSource, + const char *channelName = 0, + UInt32 cntrlID = 0); + + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0); + virtual IOReturn removeAvailableSelection(SInt32 selectionValue); + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1); + virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, const char *selectionDescription); + // OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2); + virtual IOReturn replaceAvailableSelection(SInt32 selectionValue, OSString *selectionDescription); + +private: + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 0); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 1); + OSMetaClassDeclareReservedUsed(IOAudioSelectorControl, 2); + + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioSelectorControl, 15); + +public: + static IOAudioSelectorControl *create(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + static IOAudioSelectorControl *createInputSelector(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0); + + virtual bool init(SInt32 initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + + virtual void free(); + + virtual IOReturn addAvailableSelection(SInt32 selectionValue, const char *selectionDescription); + virtual IOReturn addAvailableSelection(SInt32 selectionValue, OSString *selectionDescription); + + virtual bool valueExists(SInt32 selectorValue); + + virtual IOReturn validateValue(OSObject *newValue); + +}; + +#endif /* _IOKIT_IOAUDIOSELECTORCONTROL_H */ diff --git a/i386/include/IOKit/audio/IOAudioStream.h b/i386/include/IOKit/audio/IOAudioStream.h new file mode 100644 index 0000000..07f40be --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioStream.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOSTREAM_H +#define _IOKIT_IOAUDIOSTREAM_H + +#include +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#include +#else +#include "IOAudioEngine.h" +#include "IOAudioTypes.h" +#endif + +class OSSymbol; +class OSArray; +class OSDictionary; +class OSSet; + +class IOCommandGate; +class IOAudioControl; + +typedef struct IOAudioClientBuffer; +typedef struct IOAudioStreamFormatDesc; + +/*! + * @class IOAudioStream + * @abstract This class wraps a single sample buffer in an audio driver. + * @discussion An IOAudioStream represents one hardware sample buffer as well as the direction + * of that buffer, the mix buffer that multiple clients mix into as well as a list of + * all of the formats to which this buffer can be set. + * + * When an IOAudioEngine is created during init time in the driver, an IOAudioStream must be + * created for each sample buffer in the device. Typically, the sample buffer will be interleaved + * (or single channel), as a non-interleaved buffer should be divided into multiple single-channel + * buffers (and multiple IOAudioStreams). + * + * Additionally, when an IOAudioStream is created it must have all of the possible formats (and + * allowed sample rates for each format) set and must have the currently set format specified + * (addAvailableFormat() and setFormat()). + */ + +class IOAudioStream : public IOService +{ + OSDeclareDefaultStructors(IOAudioStream) + + friend class IOAudioEngine; + friend class IOAudioEngineUserClient; + +public: + + typedef IOReturn (*AudioIOFunction)(const void *mixBuf, void *sampleBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + + static const OSSymbol *gDirectionKey; + static const OSSymbol *gNumChannelsKey; + static const OSSymbol *gSampleFormatKey; + static const OSSymbol *gNumericRepresentationKey; + static const OSSymbol *gBitDepthKey; + static const OSSymbol *gBitWidthKey; + static const OSSymbol *gAlignmentKey; + static const OSSymbol *gByteOrderKey; + static const OSSymbol *gIsMixableKey; + static const OSSymbol *gDriverTagKey; + static const OSSymbol *gMinimumSampleRateKey; + static const OSSymbol *gMaximumSampleRateKey; + + static void initKeys(); + + static OSDictionary *createDictionaryFromFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict = 0); + static IOAudioStreamFormat *createFormatFromDictionary(const OSDictionary *formatDict, IOAudioStreamFormat *streamFormat = 0, IOAudioStreamFormatExtension *formatExtension = 0); + + IOAudioEngine *audioEngine; + IOWorkLoop *workLoop; + IOCommandGate *commandGate; + IORecursiveLock *streamIOLock; + + UInt32 numClients; + + IOAudioStreamDirection direction; + + IOAudioStreamFormat format; + IOAudioStreamFormatDesc *availableFormats; + OSArray *availableFormatDictionaries; + UInt32 numAvailableFormats; + + UInt32 startingChannelID; + UInt32 maxNumChannels; + + void *sampleBuffer; + UInt32 sampleBufferSize; + + void *mixBuffer; + UInt32 mixBufferSize; + bool streamAllocatedMixBuffer; + + AudioIOFunction *audioIOFunctions; + UInt32 numIOFunctions; + + bool streamAvailable; + + OSSet *defaultAudioControls; + + IOAudioEnginePosition startingPosition; + IOAudioEnginePosition clippedPosition; + + IOAudioClientBuffer *clientBufferListStart; + IOAudioClientBuffer *clientBufferListEnd; + + IOAudioClientBuffer *userClientList; + +protected: + + struct ExpansionData { + IOAudioStreamFormatExtension streamFormatExtension; + UInt32 mSampleFramesReadByEngine; + IOReturn mClipOutputStatus; + }; + + ExpansionData *reserved; + +public: +// New code added here: + // OSMetaClassDeclareReservedUsed(IOAudioStream, 0); + virtual const IOAudioStreamFormatExtension *getFormatExtension(); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 1); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, bool callDriver = true); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 2); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, OSDictionary *formatDict, bool callDriver = true); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 3); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 4); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioStreamFormatExtension *formatExtension, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 5); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 6); + virtual void setTerminalType(const UInt32 terminalType); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 7); + virtual IOReturn mixOutputSamples(const void *sourceBuf, void *mixBuf, UInt32 firstSampleFrame, UInt32 numSampleFrames, const IOAudioStreamFormat *streamFormat, IOAudioStream *audioStream); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 8); + virtual void setSampleLatency(UInt32 numSamples); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 9); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatExtension *formatExtension, IOAudioStreamFormatDesc *formatDesc, const IOAudioSampleRate *sampleRate); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 10); + virtual UInt32 getNumSampleFramesRead(); + // OSMetaClassDeclareReservedUsed(IOAudioStream, 11); + virtual void setDefaultNumSampleFramesRead(UInt32); + +private: + OSMetaClassDeclareReservedUsed(IOAudioStream, 0); + OSMetaClassDeclareReservedUsed(IOAudioStream, 1); + OSMetaClassDeclareReservedUsed(IOAudioStream, 2); + OSMetaClassDeclareReservedUsed(IOAudioStream, 3); + OSMetaClassDeclareReservedUsed(IOAudioStream, 4); + OSMetaClassDeclareReservedUsed(IOAudioStream, 5); + OSMetaClassDeclareReservedUsed(IOAudioStream, 6); + OSMetaClassDeclareReservedUsed(IOAudioStream, 7); + OSMetaClassDeclareReservedUsed(IOAudioStream, 8); + OSMetaClassDeclareReservedUsed(IOAudioStream, 9); + OSMetaClassDeclareReservedUsed(IOAudioStream, 10); + OSMetaClassDeclareReservedUsed(IOAudioStream, 11); + + OSMetaClassDeclareReservedUnused(IOAudioStream, 12); + OSMetaClassDeclareReservedUnused(IOAudioStream, 13); + OSMetaClassDeclareReservedUnused(IOAudioStream, 14); + OSMetaClassDeclareReservedUnused(IOAudioStream, 15); + OSMetaClassDeclareReservedUnused(IOAudioStream, 16); + OSMetaClassDeclareReservedUnused(IOAudioStream, 17); + OSMetaClassDeclareReservedUnused(IOAudioStream, 18); + OSMetaClassDeclareReservedUnused(IOAudioStream, 19); + OSMetaClassDeclareReservedUnused(IOAudioStream, 20); + OSMetaClassDeclareReservedUnused(IOAudioStream, 21); + OSMetaClassDeclareReservedUnused(IOAudioStream, 22); + OSMetaClassDeclareReservedUnused(IOAudioStream, 23); + OSMetaClassDeclareReservedUnused(IOAudioStream, 24); + OSMetaClassDeclareReservedUnused(IOAudioStream, 25); + OSMetaClassDeclareReservedUnused(IOAudioStream, 26); + OSMetaClassDeclareReservedUnused(IOAudioStream, 27); + OSMetaClassDeclareReservedUnused(IOAudioStream, 28); + OSMetaClassDeclareReservedUnused(IOAudioStream, 29); + OSMetaClassDeclareReservedUnused(IOAudioStream, 30); + OSMetaClassDeclareReservedUnused(IOAudioStream, 31); + OSMetaClassDeclareReservedUnused(IOAudioStream, 32); + OSMetaClassDeclareReservedUnused(IOAudioStream, 33); + OSMetaClassDeclareReservedUnused(IOAudioStream, 34); + OSMetaClassDeclareReservedUnused(IOAudioStream, 35); + OSMetaClassDeclareReservedUnused(IOAudioStream, 36); + OSMetaClassDeclareReservedUnused(IOAudioStream, 37); + OSMetaClassDeclareReservedUnused(IOAudioStream, 38); + OSMetaClassDeclareReservedUnused(IOAudioStream, 39); + OSMetaClassDeclareReservedUnused(IOAudioStream, 40); + OSMetaClassDeclareReservedUnused(IOAudioStream, 41); + OSMetaClassDeclareReservedUnused(IOAudioStream, 42); + OSMetaClassDeclareReservedUnused(IOAudioStream, 43); + OSMetaClassDeclareReservedUnused(IOAudioStream, 44); + OSMetaClassDeclareReservedUnused(IOAudioStream, 45); + OSMetaClassDeclareReservedUnused(IOAudioStream, 46); + OSMetaClassDeclareReservedUnused(IOAudioStream, 47); + +public: + virtual bool initWithAudioEngine(IOAudioEngine *engine, IOAudioStreamDirection dir, UInt32 startChannelID, const char *streamDescription = NULL, OSDictionary *properties = 0); + virtual void free(); + + virtual void stop(IOService *provider); + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOReturn setProperties(OSObject *properties); + + virtual IOAudioStreamDirection getDirection(); + + virtual void setSampleBuffer(void *buffer, UInt32 size); + virtual void *getSampleBuffer(); + virtual UInt32 getSampleBufferSize(); + + virtual void setMixBuffer(void *buffer, UInt32 size); + virtual void *getMixBuffer(); + virtual UInt32 getMixBufferSize(); + + virtual void numSampleFramesPerBufferChanged(); + + virtual void clearSampleBuffer(); + + virtual void setIOFunction(AudioIOFunction ioFunction); + virtual void setIOFunctionList(const AudioIOFunction *ioFunctionList, UInt32 numFunctions); + + virtual const IOAudioStreamFormat *getFormat(); + static IOReturn setFormatAction(OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, bool callDriver = true); + virtual IOReturn setFormat(OSDictionary *formatDict); + virtual IOReturn setFormat(const IOAudioStreamFormat *streamFormat, OSDictionary *formatDict, bool callDriver = true); + virtual IOReturn hardwareFormatChanged(const IOAudioStreamFormat *streamFormat); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, const AudioIOFunction *ioFunctionList = NULL, UInt32 numFunctions = 0); + virtual void addAvailableFormat(const IOAudioStreamFormat *streamFormat, const IOAudioSampleRate *minRate, const IOAudioSampleRate *maxRate, AudioIOFunction ioFunction); + virtual void clearAvailableFormats(); + virtual bool validateFormat(IOAudioStreamFormat *streamFormat, IOAudioStreamFormatDesc *formatDesc); + + virtual UInt32 getStartingChannelID(); + virtual UInt32 getMaxNumChannels(); + + virtual void setStreamAvailable(bool available); + virtual bool getStreamAvailable(); + + virtual IOReturn addDefaultAudioControl(IOAudioControl *defaultAudioControl); + virtual void removeDefaultAudioControls(); + +protected: + virtual void lockStreamForIO(); + virtual void unlockStreamForIO(); + + virtual void updateNumClients(); + virtual IOReturn addClient(IOAudioClientBuffer *clientBuffer); + virtual void removeClient(IOAudioClientBuffer *clientBuffer); + virtual UInt32 getNumClients(); + + virtual IOReturn processOutputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame, UInt32 loopCount, bool samplesAvailable); + virtual IOReturn readInputSamples(IOAudioClientBuffer *clientBuffer, UInt32 firstSampleFrame); + + virtual void resetClipInfo(); + virtual void clipIfNecessary(); + virtual void clipOutputSamples(UInt32 startingSampleFrame, UInt32 numSampleFrames); + + virtual void setStartingChannelNumber(UInt32 channelNumber); + +private: + virtual void setDirection(IOAudioStreamDirection dir); + +}; + +#endif /* _IOKIT_IOAUDIOSTREAM_H */ diff --git a/i386/include/IOKit/audio/IOAudioToggleControl.h b/i386/include/IOKit/audio/IOAudioToggleControl.h new file mode 100644 index 0000000..95bfb4a --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioToggleControl.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOTOGGLECONTROL_H +#define _IOKIT_IOAUDIOTOGGLECONTROL_H + +#ifndef IOAUDIOFAMILY_SELF_BUILD +#include +#else +#include "IOAudioControl.h" +#endif + +/*! + * @class IOAudioToggleControl + */ + +class IOAudioToggleControl : public IOAudioControl +{ + OSDeclareDefaultStructors(IOAudioToggleControl) + +protected: + struct ExpansionData { }; + + ExpansionData *reserved; + +// New code added here +public: + /*! + * @function createPassThruMuteControl + * @abstract Allocates a new pass through mute control with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns a newly allocated and initialized mute IOAudioControl + */ + static IOAudioToggleControl *createPassThruMuteControl (bool initialValue, + UInt32 channelID, + const char *channelName, + UInt32 cntrlID); + +private: + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 0); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 1); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 2); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 3); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 4); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 5); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 6); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 7); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 8); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 9); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 10); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 11); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 12); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 13); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 14); + OSMetaClassDeclareReservedUnused(IOAudioToggleControl, 15); + +public: + /*! + * @function create + * @abstract Allocates a new mute control with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns a newly allocated and initialized mute IOAudioControl + */ + static IOAudioToggleControl *create(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0); + + static IOAudioToggleControl *createMuteControl(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 usage = 0); + + /*! + * @function init + * @abstract Initializes a newly allocated IOAudioToggleControl with the given attributes + * @param initialValue The initial value of the control + * @param channelID The ID of the channel(s) that the control acts on. Common IDs are located in IOAudioTypes.h. + * @param channelName An optional name for the channel. Common names are located in IOAudioPort.h. + * @param cntrlID An optional ID for the control that can be used to uniquely identify controls + * @result Returns truen on success + */ + virtual bool init(bool initialValue, + UInt32 channelID, + const char *channelName = 0, + UInt32 cntrlID = 0, + UInt32 subType = 0, + UInt32 usage = 0, + OSDictionary *properties = 0); + +}; + +#endif /* _IOKIT_IOAUDIOTOGGLECONTROL_H */ diff --git a/i386/include/IOKit/audio/IOAudioTypes.h b/i386/include/IOKit/audio/IOAudioTypes.h new file mode 100644 index 0000000..0526575 --- /dev/null +++ b/i386/include/IOKit/audio/IOAudioTypes.h @@ -0,0 +1,661 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOAUDIOTYPES_H +#define _IOKIT_IOAUDIOTYPES_H + +#include +#include +#include + + +/*! + * @enum IOAudioEngineMemory + * @abstract Used to identify the type of memory requested by a client process to be mapped into its process space + * @discussion This is the parameter to the type field of IOMapMemory when called on an IOAudioEngine. This is + * only intended for use by the Audio Device API library. + * @constant kIOAudioSampleBuffer This requests the IOAudioEngine's sample buffer + * @constant kIOAudioStatusBuffer This requests the IOAudioEngine's status buffer. It's type is IOAudioEngineStatus. + * @constant kIOAudioMixBuffer This requests the IOAudioEngine's mix buffer +*/ +typedef enum _IOAudioEngineMemory { + kIOAudioStatusBuffer = 0, + kIOAudioSampleBuffer = 1, + kIOAudioMixBuffer = 2, + kIOAudioBytesInInputBuffer = 3, + kIOAudioBytesInOutputBuffer = 4 +} IOAudioEngineMemory; + +/*! + * @enum IOAudioEngineCalls + * @abstract The set of constants passed to IOAudioEngineUserClient::getExternalMethodForIndex() when making calls + * from the IOAudioFamily user client code. + */ +typedef enum _IOAudioEngineCalls { + kIOAudioEngineCallRegisterClientBuffer = 0, + kIOAudioEngineCallUnregisterClientBuffer = 1, + kIOAudioEngineCallGetConnectionID = 2, + kIOAudioEngineCallStart = 3, + kIOAudioEngineCallStop = 4, + kIOAudioEngineCallGetNearestStartTime = 5 +} IOAudioEngineCalls; + +/*! @defined kIOAudioEngineNumCalls The number of elements in the IOAudioEngineCalls enum. */ +#define kIOAudioEngineNumCalls 6 + +typedef enum _IOAudioEngineTraps { + kIOAudioEngineTrapPerformClientIO = 0 +} IOAudioEngineTraps; + +typedef enum _IOAudioEngineNotifications { + kIOAudioEngineAllNotifications = 0, + kIOAudioEngineStreamFormatChangeNotification = 1, + kIOAudioEngineChangeNotification = 2, + kIOAudioEngineStartedNotification = 3, + kIOAudioEngineStoppedNotification = 4, + kIOAudioEnginePausedNotification = 5, + kIOAudioEngineResumedNotification = 6 +} IOAudioEngineNotifications; + +/*! + * @enum IOAudioEngineState + * @abstract Represents the state of an IOAudioEngine + * @constant kIOAudioEngineRunning The IOAudioEngine is currently running - it is transferring data to or + * from the device. + * @constant kIOAudioEngineStopped The IOAudioEngine is currently stopped - no activity is occurring. + */ + +typedef enum _IOAudioEngineState { + kIOAudioEngineStopped = 0, + kIOAudioEngineRunning = 1, + kIOAudioEnginePaused = 2, + kIOAudioEngineResumed = 3 +} IOAudioEngineState; + + +/*! + * @typedef IOAudioEngineStatus + * @abstract Shared-memory structure giving audio engine status + * @discussion + * @field fVersion Indicates version of this structure + * @field fCurrentLoopCount Number of times around the ring buffer since the audio engine started + * @field fLastLoopTime Timestamp of the last time the ring buffer wrapped + * @field fEraseHeadSampleFrame Location of the erase head in sample frames - erased up to but not + * including the given sample frame + */ + +typedef struct _IOAudioEngineStatus { + UInt32 fVersion; + volatile UInt32 fCurrentLoopCount; + volatile AbsoluteTime fLastLoopTime; + volatile UInt32 fEraseHeadSampleFrame; +} IOAudioEngineStatus; + +#define kIOAudioEngineCurrentStatusStructVersion 2 + +typedef struct _IOAudioStreamFormat { + UInt32 fNumChannels; + UInt32 fSampleFormat; + UInt32 fNumericRepresentation; + UInt8 fBitDepth; + UInt8 fBitWidth; + UInt8 fAlignment; + UInt8 fByteOrder; + UInt8 fIsMixable; + UInt32 fDriverTag; +} IOAudioStreamFormat; + +#define kFormatExtensionInvalidVersion 0 +#define kFormatExtensionCurrentVersion 1 + +typedef struct _IOAudioStreamFormatExtension { + UInt32 fVersion; + UInt32 fFlags; + UInt32 fFramesPerPacket; + UInt32 fBytesPerPacket; +} IOAudioStreamFormatExtension; + +typedef struct _IOAudioBufferDataDescriptor { + UInt32 fActualDataByteSize; + UInt32 fActualNumSampleFrames; + UInt32 fTotalDataByteSize; + UInt32 fNominalDataByteSize; + UInt8 fData[1]; +} IOAudioBufferDataDescriptor; + +#define kStreamDataDescriptorInvalidVersion 0 +#define kStreamDataDescriptorCurrentVersion 1 + +typedef struct _IOAudioStreamDataDescriptor { + UInt32 fVersion; + UInt32 fNumberOfStreams; + UInt32 fStreamLength[1]; // Array with fNumberOfStreams number of entries +} IOAudioStreamDataDescriptor; + +typedef struct _IOAudioSampleIntervalDescriptor { + UInt32 sampleIntervalHi; + UInt32 sampleIntervalLo; +} IOAudioSampleIntervalDescriptor; + +/*! + @struct SMPTETime + @abstract A structure for holding a SMPTE time. + @field fSubframes + The number of subframes in the full message. + @field fSubframeDivisor + The number of subframes per frame (typically 80). + @field fCounter + The total number of messages received. + @field fType + The kind of SMPTE time using the SMPTE time type constants. + @field fFlags + A set of flags that indicate the SMPTE state. + @field fHours + The number of hourse in the full message. + @field fMinutes + The number of minutes in the full message. + @field fSeconds + The number of seconds in the full message. + @field fFrames + The number of frames in the full message. +*/ +typedef struct _IOAudioSMPTETime +{ + SInt16 fSubframes; + SInt16 fSubframeDivisor; + UInt32 fCounter; + UInt32 fType; + UInt32 fFlags; + SInt16 fHours; + SInt16 fMinutes; + SInt16 fSeconds; + SInt16 fFrames; + +} IOAudioSMPTETime; + +// constants describing SMPTE types (taken from the MTC spec) +enum +{ + kIOAudioSMPTETimeType24 = 0, + kIOAudioSMPTETimeType25 = 1, + kIOAudioSMPTETimeType30Drop = 2, + kIOAudioSMPTETimeType30 = 3, + kIOAudioSMPTETimeType2997 = 4, + kIOAudioSMPTETimeType2997Drop = 5 +}; + +// flags describing a SMPTE time stamp +enum +{ + kIOAudioSMPTETimeValid = (1L << 0), // the full time is valid + kIOAudioSMPTETimeRunning = (1L << 1) // time is running +}; + +// A struct for encapsulating the parts of a time stamp. The flags +// say which fields are valid. +typedef struct _IOAudioTimeStamp +{ + UInt64 fSampleTime; // the absolute sample time, was a Float64 + UInt64 fHostTime; // the host's root timebase's time + UInt64 fRateScalar; // the system rate scalar, was a Float64 + UInt64 fWordClockTime; // the word clock time + IOAudioSMPTETime fSMPTETime; // the SMPTE time + UInt32 fFlags; // the flags indicate which fields are valid + UInt32 fReserved; // reserved, pads the structure out to force 8 byte alignment +} IOAudioTimeStamp; + +// flags for the AudioTimeStamp sturcture +enum +{ + kIOAudioTimeStampSampleTimeValid = (1L << 0), + kIOAudioTimeStampHostTimeValid = (1L << 1), + kIOAudioTimeStampRateScalarValid = (1L << 2), + kIOAudioTimeStampWordClockTimeValid = (1L << 3), + kIOAudioTimeStampSMPTETimeValid = (1L << 4) +}; + +// Some commonly used combinations of timestamp flags +enum +{ + kIOAudioTimeStampSampleHostTimeValid = (kIOAudioTimeStampSampleTimeValid | kIOAudioTimeStampHostTimeValid) +}; + +/*! +* @enum IOAudioStreamDirection + * @abstract Represents the direction of an IOAudioStream + * @constant kIOAudioStreamDirectionOutput Output buffer + * @constant kIOAudioStreamDirectionInput Input buffer + */ + +typedef enum _IOAudioStreamDirection { + kIOAudioStreamDirectionOutput = 0, + kIOAudioStreamDirectionInput = 1 +} IOAudioStreamDirection; + +enum { + kIOAudioDeviceCanBeDefaultNothing = 0, + kIOAudioDeviceCanBeDefaultInput = (1L << 0), + kIOAudioDeviceCanBeDefaultOutput = (1L << 1), + kIOAudioDeviceCanBeSystemOutput = (1L << 2) +}; + +/*! + * @defined kIOAudioEngineDefaultMixBufferSampleSize + */ + +#define kIOAudioEngineDefaultMixBufferSampleSize sizeof(float) + +/* The following are for use only by the IOKit.framework audio family code */ + +/*! + * @enum IOAudioControlCalls + * @abstract The set of constants passed to IOAudioControlUserClient::getExternalMethodForIndex() when making calls + * from the IOAudioFamily user client code. + * @constant kIOAudioControlCallSetValue Used to set the value of an IOAudioControl. + * @constant kIOAudioControlCallGetValue Used to get the value of an IOAudioControl. + */ +typedef enum _IOAudioControlCalls { + kIOAudioControlCallSetValue = 0, + kIOAudioControlCallGetValue = 1 +} IOAudioControlCalls; + +/*! @defined kIOAudioControlNumCalls The number of elements in the IOAudioControlCalls enum. */ +#define kIOAudioControlNumCalls 2 + +/*! + * @enum IOAudioControlNotifications + * @abstract The set of constants passed in the type field of IOAudioControlUserClient::registerNotificaitonPort(). + * @constant kIOAudioControlValueChangeNotification Used to request value change notifications. + * @constant kIOAudioControlRangeChangeNotification Used to request range change notifications. + */ +typedef enum _IOAudioControlNotifications { + kIOAudioControlValueChangeNotification = 0, + kIOAudioControlRangeChangeNotification = 1 +} IOAudioControlNotifications; + +/*! + * @struct IOAudioNotificationMessage + * @abstract Used in the mach message for IOAudio notifications. + * @field messageHeader Standard mach message header + * @field ref The param passed to registerNotificationPort() in refCon. + */ +typedef struct _IOAudioNotificationMessage { + mach_msg_header_t messageHeader; + UInt32 type; + UInt32 ref; + void * sender; +} IOAudioNotificationMessage; + +typedef struct _IOAudioSampleRate { + UInt32 whole; + UInt32 fraction; +} IOAudioSampleRate; + +#define kNoIdleAudioPowerDown 0xffffffffffffffffULL + +enum { + kIOAudioPortTypeOutput = 'outp', + kIOAudioPortTypeInput = 'inpt', + kIOAudioPortTypeMixer = 'mixr', + kIOAudioPortTypePassThru = 'pass', + kIOAudioPortTypeProcessing = 'proc' +}; + +enum { + kIOAudioOutputPortSubTypeInternalSpeaker = 'ispk', + kIOAudioOutputPortSubTypeExternalSpeaker = 'espk', + kIOAudioOutputPortSubTypeHeadphones = 'hdpn', + kIOAudioOutputPortSubTypeLine = 'line', + kIOAudioOutputPortSubTypeSPDIF = 'spdf', + + kIOAudioInputPortSubTypeInternalMicrophone = 'imic', + kIOAudioInputPortSubTypeExternalMicrophone = 'emic', + kIOAudioInputPortSubTypeCD = 'cd ', + kIOAudioInputPortSubTypeLine = 'line', + kIOAudioInputPortSubTypeSPDIF = 'spdf' +}; + +enum { + kIOAudioControlTypeLevel = 'levl', + kIOAudioControlTypeToggle = 'togl', + kIOAudioControlTypeJack = 'jack', + kIOAudioControlTypeSelector = 'slct' +}; + +enum { + kIOAudioLevelControlSubTypeVolume = 'vlme', + kIOAudioLevelControlSubTypeLFEVolume = 'subv', + kIOAudioLevelControlSubTypePRAMVolume = 'pram', + kIOAudioToggleControlSubTypeMute = 'mute', + kIOAudioToggleControlSubTypeSolo = 'solo', + kIOAudioToggleControlSubTypeLFEMute = 'subm', + kIOAudioToggleControlSubTypeiSubAttach = 'atch', + kIOAudioSelectorControlSubTypeOutput = 'outp', + kIOAudioSelectorControlSubTypeInput = 'inpt', + kIOAudioSelectorControlSubTypeClockSource = 'clck', + kIOAudioSelectorControlSubTypeDestination = 'dest', + kIOAudioSelectorControlSubTypeChannelNominalLineLevel = 'nlev', + kIOAudioSelectorControlSubTypeChannelLevelPlus4dBu = '4dbu', + kIOAudioSelectorControlSubTypeChannelLevelMinus10dBV = '10db', + kIOAudioSelectorControlSubTypeChannelLevelMinus20dBV = '20db', + kIOAudioSelectorControlSubTypeChannelLevelMicLevel = 'micl', + kIOAudioSelectorControlSubTypeChannelLevelInstrumentLevel = 'istl' +}; + +enum { + kIOAudioControlUsageOutput = 'outp', + kIOAudioControlUsageInput = 'inpt', + kIOAudioControlUsagePassThru = 'pass', + kIOAudioControlUsageCoreAudioProperty = 'prop' +}; + +enum { + kIOAudioControlChannelNumberInactive = -1, + kIOAudioControlChannelIDAll = 0, + kIOAudioControlChannelIDDefaultLeft = 1, + kIOAudioControlChannelIDDefaultRight = 2, + kIOAudioControlChannelIDDefaultCenter = 3, + kIOAudioControlChannelIDDefaultLeftRear = 4, + kIOAudioControlChannelIDDefaultRightRear = 5, + kIOAudioControlChannelIDDefaultSub = 6, + kIOAudioControlChannelIDDefaultFrontLeftCenter = 7, + kIOAudioControlChannelIDDefaultFrontRightCenter = 8, + kIOAudioControlChannelIDDefaultRearCenter = 9, + kIOAudioControlChannelIDDefaultSurroundLeft = 10, + kIOAudioControlChannelIDDefaultSurroundRight = 11 +}; + +enum { + kIOAudioSelectorControlSelectionValueNone = 'none', + + // Output-specific selection IDs + kIOAudioSelectorControlSelectionValueInternalSpeaker = 'ispk', + kIOAudioSelectorControlSelectionValueExternalSpeaker = 'espk', + kIOAudioSelectorControlSelectionValueHeadphones = 'hdpn', + + // Input-specific selection IDs + kIOAudioSelectorControlSelectionValueInternalMicrophone = 'imic', + kIOAudioSelectorControlSelectionValueExternalMicrophone = 'emic', + kIOAudioSelectorControlSelectionValueCD = 'cd ', + + // Common selection IDs + kIOAudioSelectorControlSelectionValueLine = 'line', + kIOAudioSelectorControlSelectionValueSPDIF = 'spdf' +}; + +enum { + kIOAudioStreamSampleFormatLinearPCM = 'lpcm', + kIOAudioStreamSampleFormatIEEEFloat = 'ieee', + kIOAudioStreamSampleFormatALaw = 'alaw', + kIOAudioStreamSampleFormatMuLaw = 'ulaw', + kIOAudioStreamSampleFormatMPEG = 'mpeg', + kIOAudioStreamSampleFormatAC3 = 'ac-3', + kIOAudioStreamSampleFormat1937AC3 = 'cac3', + kIOAudioStreamSampleFormat1937MPEG1 = 'mpg1', + kIOAudioStreamSampleFormat1937MPEG2 = 'mpg2', + kIOAudioStreamSampleFormatTimeCode = 'time' // a stream of IOAudioTimeStamp structures that capture any incoming time code information +}; + +enum { + kIOAudioStreamNumericRepresentationSignedInt = 'sint', + kIOAudioStreamNumericRepresentationUnsignedInt = 'uint', + kIOAudioStreamNumericRepresentationIEEE754Float = 'flot' +}; + +enum { + kIOAudioClockSelectorTypeInternal = 'int ', + kIOAudioClockSelectorTypeExternal = 'ext ', + kIOAudioClockSelectorTypeAESEBU = 'asbu', + kIOAudioClockSelectorTypeTOSLink = 'tosl', + kIOAudioClockSelectorTypeSPDIF = 'spdf', + kIOAudioClockSelectorTypeADATOptical = 'adto', + kIOAudioClockSelectorTypeADAT9Pin = 'adt9', + kIOAudioClockSelectorTypeSMPTE = 'smpt', + kIOAudioClockSelectorTypeVideo = 'vdeo', + kIOAudioClockSelectorTypeControl = 'cnrl', + kIOAudioClockSelectorTypeOther = 'othr', +}; + +enum { + kIOAudioStreamAlignmentLowByte = 0, + kIOAudioStreamAlignmentHighByte = 1 +}; + +enum { + kIOAudioStreamByteOrderBigEndian = 0, + kIOAudioStreamByteOrderLittleEndian = 1 +}; + +enum { + kIOAudioLevelControlNegativeInfinity = 0xffffffff +}; + +enum { + kIOAudioNewClockDomain = 0xffffffff +}; + +// Device connection types +#ifndef __OPEN_SOURCE__ +// Added kIOAudioDeviceTransportTypeDisplayPort +#endif +enum { + kIOAudioDeviceTransportTypeBuiltIn = 'bltn', + kIOAudioDeviceTransportTypePCI = 'pci ', + kIOAudioDeviceTransportTypeUSB = 'usb ', + kIOAudioDeviceTransportTypeFireWire = '1394', + kIOAudioDeviceTransportTypeNetwork = 'ntwk', + kIOAudioDeviceTransportTypeWireless = 'wrls', + kIOAudioDeviceTransportTypeOther = 'othr', + kIOAudioDeviceTransportTypeBluetooth = 'blue', + kIOAudioDeviceTransportTypeVirtual = 'virt', + kIOAudioDeviceTransportTypeDisplayPort = 'dprt', + kIOAudioDeviceTransportTypeHdmi = 'hdmi' + +}; + +// types that go nowhere +enum { + OUTPUT_NULL = 0x0100, + INPUT_NULL = 0x0101 +}; + +// Input terminal types +enum { + INPUT_UNDEFINED = 0x0200, + INPUT_MICROPHONE = 0x0201, + INPUT_DESKTOP_MICROPHONE = 0x0202, + INPUT_PERSONAL_MICROPHONE = 0x0203, + INPUT_OMNIDIRECTIONAL_MICROPHONE = 0x0204, + INPUT_MICROPHONE_ARRAY = 0x0205, + INPUT_PROCESSING_MICROPHONE_ARRAY = 0x0206, + INPUT_MODEM_AUDIO = 0x207 +}; + +// Output terminal types +enum { + OUTPUT_UNDEFINED = 0x0300, + OUTPUT_SPEAKER = 0x0301, + OUTPUT_HEADPHONES = 0x0302, + OUTPUT_HEAD_MOUNTED_DISPLAY_AUDIO = 0x0303, + OUTPUT_DESKTOP_SPEAKER = 0x0304, + OUTPUT_ROOM_SPEAKER = 0x0305, + OUTPUT_COMMUNICATION_SPEAKER = 0x0306, + OUTPUT_LOW_FREQUENCY_EFFECTS_SPEAKER = 0x0307 +}; + +// Bi-directional terminal types +enum { + BIDIRECTIONAL_UNDEFINED = 0x0400, + BIDIRECTIONAL_HANDSET = 0x0401, + BIDIRECTIONAL_HEADSET = 0x0402, + BIDIRECTIONAL_SPEAKERPHONE_NO_ECHO_REDX = 0x0403, + BIDIRECTIONAL_ECHO_SUPPRESSING_SPEAKERPHONE = 0x0404, + BIDIRECTIONAL_ECHO_CANCELING_SPEAKERPHONE = 0x0405 +}; + +// Telephony terminal types +enum { + TELEPHONY_UNDEFINED = 0x0500, + TELEPHONY_PHONE_LINE = 0x0501, + TELEPHONY_TELEPHONE = 0x0502, + TELEPHONY_DOWN_LINE_PHONE = 0x0503 +}; + +// External terminal types +enum { + EXTERNAL_UNDEFINED = 0x0600, + EXTERNAL_ANALOG_CONNECTOR = 0x0601, + EXTERNAL_DIGITAL_AUDIO_INTERFACE = 0x0602, + EXTERNAL_LINE_CONNECTOR = 0x0603, + EXTERNAL_LEGACY_AUDIO_CONNECTOR = 0x0604, + EXTERNAL_SPDIF_INTERFACE = 0x0605, + EXTERNAL_1394_DA_STREAM = 0x0606, + EXTERNAL_1394_DV_STREAM_SOUNDTRACK = 0x0607, + EXTERNAL_ADAT = 0x0608, + EXTERNAL_TDIF = 0x0609, + EXTERNAL_MADI = 0x060A +}; + +// Embedded terminal types +enum { + EMBEDDED_UNDEFINED = 0x0700, + EMBEDDED_LEVEL_CALIBRATION_NOISE_SOURCE = 0x0701, + EMBEDDED_EQUALIZATION_NOISE = 0x0702, + EMBEDDED_CD_PLAYER = 0x0703, + EMBEDDED_DAT = 0x0704, + EMBEDDED_DCC = 0x0705, + EMBEDDED_MINIDISK = 0x0706, + EMBEDDED_ANALOG_TAPE = 0x0707, + EMBEDDED_PHONOGRAPH = 0x0708, + EMBEDDED_VCR_AUDIO = 0x0709, + EMBEDDED_VIDEO_DISC_AUDIO = 0x070A, + EMBEDDED_DVD_AUDIO = 0x070B, + EMBEDDED_TV_TUNER_AUDIO = 0x070C, + EMBEDDED_SATELLITE_RECEIVER_AUDIO = 0x070D, + EMBEDDED_CABLE_TUNER_AUDIO = 0x070E, + EMBEDDED_DSS_AUDIO = 0x070F, + EMBEDDED_RADIO_RECEIVER = 0x0710, + EMBEDDED_RADIO_TRANSMITTER = 0x0711, + EMBEDDED_MULTITRACK_RECORDER = 0x0712, + EMBEDDED_SYNTHESIZER = 0x0713 +}; + +// Processing terminal types +enum { + PROCESSOR_UNDEFINED = 0x0800, + PROCESSOR_GENERAL = 0x0801 +}; + +// Channel spatial position types + +#ifndef __OPEN_SOURCE__ +// NOTE: the following are derived from CoreAudioTypes.h +#endif + +#define kIOAudioChannelLabel_Discrete_field_ba 16 +enum { + kIOAudioChannelLabel_Unknown = 0xFFFFFFFF, // unknown or unspecified other use + kIOAudioChannelLabel_Unused = 0, // channel is present, but has no intended use or destination + kIOAudioChannelLabel_UseCoordinates = 100, // channel is described by the mCoordinates fields. + + kIOAudioChannelLabel_Left = 1, + kIOAudioChannelLabel_Right = 2, + kIOAudioChannelLabel_Center = 3, + kIOAudioChannelLabel_LFEScreen = 4, + kIOAudioChannelLabel_LeftSurround = 5, // WAVE: "Back Left" + kIOAudioChannelLabel_RightSurround = 6, // WAVE: "Back Right" + kIOAudioChannelLabel_LeftCenter = 7, + kIOAudioChannelLabel_RightCenter = 8, + kIOAudioChannelLabel_CenterSurround = 9, // WAVE: "Back Center" or plain "Rear Surround" + kIOAudioChannelLabel_LeftSurroundDirect = 10, // WAVE: "Side Left" + kIOAudioChannelLabel_RightSurroundDirect = 11, // WAVE: "Side Right" + kIOAudioChannelLabel_TopCenterSurround = 12, + kIOAudioChannelLabel_VerticalHeightLeft = 13, // WAVE: "Top Front Left" + kIOAudioChannelLabel_VerticalHeightCenter = 14, // WAVE: "Top Front Center" + kIOAudioChannelLabel_VerticalHeightRight = 15, // WAVE: "Top Front Right" + + kIOAudioChannelLabel_TopBackLeft = 16, + kIOAudioChannelLabel_TopBackCenter = 17, + kIOAudioChannelLabel_TopBackRight = 18, + + kIOAudioChannelLabel_RearSurroundLeft = 33, + kIOAudioChannelLabel_RearSurroundRight = 34, + kIOAudioChannelLabel_LeftWide = 35, + kIOAudioChannelLabel_RightWide = 36, + kIOAudioChannelLabel_LFE2 = 37, + kIOAudioChannelLabel_LeftTotal = 38, // matrix encoded 4 channels + kIOAudioChannelLabel_RightTotal = 39, // matrix encoded 4 channels + kIOAudioChannelLabel_HearingImpaired = 40, + kIOAudioChannelLabel_Narration = 41, + kIOAudioChannelLabel_Mono = 42, + kIOAudioChannelLabel_DialogCentricMix = 43, + + kIOAudioChannelLabel_CenterSurroundDirect = 44, // back center, non diffuse + + kIOAudioChannelLabel_Haptic = 45, + + // first order ambisonic channels + kIOAudioChannelLabel_Ambisonic_W = 200, + kIOAudioChannelLabel_Ambisonic_X = 201, + kIOAudioChannelLabel_Ambisonic_Y = 202, + kIOAudioChannelLabel_Ambisonic_Z = 203, + + // Mid/Side Recording + kIOAudioChannelLabel_MS_Mid = 204, + kIOAudioChannelLabel_MS_Side = 205, + + // X-Y Recording + kIOAudioChannelLabel_XY_X = 206, + kIOAudioChannelLabel_XY_Y = 207, + + // other + kIOAudioChannelLabel_HeadphonesLeft = 301, + kIOAudioChannelLabel_HeadphonesRight = 302, + kIOAudioChannelLabel_ClickTrack = 304, + kIOAudioChannelLabel_ForeignLanguage = 305, + + // generic discrete channel + kIOAudioChannelLabel_Discrete = 400, + + // numbered discrete channel + kIOAudioChannelLabel_Discrete_0 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 0, + kIOAudioChannelLabel_Discrete_1 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 1, + kIOAudioChannelLabel_Discrete_2 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 2, + kIOAudioChannelLabel_Discrete_3 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 3, + kIOAudioChannelLabel_Discrete_4 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 4, + kIOAudioChannelLabel_Discrete_5 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 5, + kIOAudioChannelLabel_Discrete_6 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 6, + kIOAudioChannelLabel_Discrete_7 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 7, + kIOAudioChannelLabel_Discrete_8 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 8, + kIOAudioChannelLabel_Discrete_9 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 9, + kIOAudioChannelLabel_Discrete_10 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 10, + kIOAudioChannelLabel_Discrete_11 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 11, + kIOAudioChannelLabel_Discrete_12 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 12, + kIOAudioChannelLabel_Discrete_13 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 13, + kIOAudioChannelLabel_Discrete_14 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 14, + kIOAudioChannelLabel_Discrete_15 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 15, + kIOAudioChannelLabel_Discrete_65535 = ( 1 << kIOAudioChannelLabel_Discrete_field_ba ) | 65535 +}; + + + +#endif /* _IOKIT_IOAUDIOTYPES_H */ diff --git a/i386/include/IOKit/avc/.svn/all-wcprops b/i386/include/IOKit/avc/.svn/all-wcprops new file mode 100644 index 0000000..75efcf9 --- /dev/null +++ b/i386/include/IOKit/avc/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc +END +IOFireWireAVCCommand.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWireAVCCommand.h +END +IOFireWireAVCUnit.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWireAVCUnit.h +END +IOFireWireAVCTargetSpace.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWireAVCTargetSpace.h +END +IOFireWireAVCRequestSpace.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWireAVCRequestSpace.h +END +IOFireWireAVCUserClientCommon.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWireAVCUserClientCommon.h +END +IOFireWirePCRSpace.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWirePCRSpace.h +END +IOFireWireAVCConsts.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/avc/IOFireWireAVCConsts.h +END diff --git a/i386/include/IOKit/avc/.svn/entries b/i386/include/IOKit/avc/.svn/entries new file mode 100644 index 0000000..85a5a25 --- /dev/null +++ b/i386/include/IOKit/avc/.svn/entries @@ -0,0 +1,266 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/avc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOFireWireAVCCommand.h +file + + + + +2013-08-27T23:54:18.000000Z +f699ca3830990f2eee520eeb1ebdf909 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3554 + +IOFireWireAVCUnit.h +file + + + + +2013-08-27T23:54:18.000000Z +b865a2bbc19d3f6d7b776b9db9627055 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15014 + +IOFireWireAVCTargetSpace.h +file + + + + +2013-08-27T23:54:18.000000Z +6c3ea5db622fee943b087cc41f61cba2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9970 + +IOFireWireAVCRequestSpace.h +file + + + + +2013-08-27T23:54:18.000000Z +43e9b717ef7799e42fefc3988f2a8c08 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1163 + +IOFireWireAVCUserClientCommon.h +file + + + + +2013-08-27T23:54:18.000000Z +b9816433c7b0e21d80aeb0ef57ee61a1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5535 + +IOFireWirePCRSpace.h +file + + + + +2013-08-27T23:54:18.000000Z +b90dd9a75029f4aa97d629573028aa51 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7349 + +IOFireWireAVCConsts.h +file + + + + +2013-08-27T23:54:18.000000Z +bf25ce265723702ee537153385bf47c0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7791 + diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCCommand.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCCommand.h.svn-base new file mode 100644 index 0000000..ff9850d --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCCommand.h.svn-base @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFireWireAVCCommand_H +#define _IOKIT_IOFireWireAVCCommand_H + +#include + +/*! @class IOFireWireAVCCommand +*/ +class IOFireWireAVCCommand : public IOFWCommand +{ + OSDeclareDefaultStructors(IOFireWireAVCCommand) + +protected: + IOFWCommand *fWriteCmd; + IOMemoryDescriptor *fMem; + const UInt8 *fCommand; + + UInt32 fCmdLen; + UInt8 *fResponse; + UInt32 *fResponseLen; + int fCurRetries; + int fMaxRetries; + + UInt32 fWriteGen; + UInt16 fWriteNodeID; + bool bypassRobustCommandResponseMatching; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { + bool fStarted; + bool fSyncWakeupSignaled; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *fIOFireWireAVCCommandExpansion; + + static void writeDone(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + + virtual IOReturn complete(IOReturn status); + virtual IOReturn execute(); + virtual void free(); + +public: + virtual bool init(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + virtual IOReturn reinit(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + + static IOFireWireAVCCommand *withNub(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + + static IOFireWireAVCCommand *withNub(IOFireWireNub *device, UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 * responseLen); + + virtual UInt32 handleResponse(UInt16 nodeID, UInt32 len, const void *buf); + + virtual IOReturn resetInterimTimeout(); + + virtual UInt32 handleResponseWithSimpleMatching(UInt16 nodeID, UInt32 len, const void *buf); + + virtual IOReturn submit(bool queue = false); + +private: + OSMetaClassDeclareReservedUsed(IOFireWireAVCCommand, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 3); +}; + +#endif // _IOKIT_IOFireWireAVCCommand_H + diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCConsts.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCConsts.h.svn-base new file mode 100644 index 0000000..ae7a12c --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCConsts.h.svn-base @@ -0,0 +1,259 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFIREWIREAVCCONSTS_H +#define _IOKIT_IOFIREWIREAVCCONSTS_H + +// Fields of AVC frame +typedef enum { + kAVCCommandResponse = 0, + kAVCAddress = 1, + kAVCOpcode = 2, + kAVCOperand0 = 3, + kAVCOperand1 = 4, + kAVCOperand2 = 5, + kAVCOperand3 = 6, + kAVCOperand4 = 7, + kAVCOperand5 = 8, + kAVCOperand6 = 9, + kAVCOperand7 = 10, + kAVCOperand8 = 11 +} IOAVCFrameFields; + +// Command/Response values +typedef enum { + kAVCControlCommand = 0x00, + kAVCStatusInquiryCommand = 0x01, + kAVCSpecificInquiryCommand = 0x02, + kAVCNotifyCommand = 0x03, + kAVCGeneralInquiryCommand = 0x04, + kAVCNotImplementedStatus = 0x08, + kAVCAcceptedStatus = 0x09, + kAVCRejectedStatus = 0x0a, + kAVCInTransitionStatus = 0x0b, + kAVCImplementedStatus = 0x0c, + kAVCChangedStatus = 0x0d, + kAVCInterimStatus = 0x0f +} IOAVCCommandResponse; + +// Opcodes +typedef enum { + + // Unit commands + kAVCPlugInfoOpcode = 0x02, + kAVCOutputPlugSignalFormatOpcode = 0x18, + kAVCInputPlugSignalFormatOpcode = 0x19, + kAVCUnitInfoOpcode = 0x30, + kAVCSubunitInfoOpcode = 0x31, + kAVCConnectionsOpcode = 0x22, + kAVCConnectOpcode = 0x24, + kAVCDisconnectOpcode = 0x25, + kAVCPowerOpcode = 0xB2, + kAVCSignalSourceOpcode = 0x1A, + + // Vendor dependent commands + kAVCVendorDependentOpcode = 0x00, + + // Subunit commands + kAVCOutputSignalModeOpcode = 0x78, + kAVCInputSignalModeOpcode = 0x79, + kAVCSignalModeSD525_60 = 0x00, + kAVCSignalModeSDL525_60 = 0x04, + kAVCSignalModeHD1125_60 = 0x08, + kAVCSignalModeSD625_50 = 0x80, + kAVCSignalModeSDL625_50 = 0x84, + kAVCSignalModeHD1250_50 = 0x88, + kAVCSignalModeDVCPro525_60 = 0x78, + kAVCSignalModeDVCPro625_50 = 0xf8, + + kAVCSignalModeDummyOperand = 0xff, + kAVCSignalModeMask_50 = 0x80, + kAVCSignalModeMask_STYPE = 0x7c, + kAVCSignalModeMask_SDL = 0x04, + kAVCSignalModeMask_DVCPro25 = 0x78 + +} IOAVCOpcodes; + +// Unit/Subunit types +typedef enum { + kAVCVideoMonitor = 0x00, + kAVCAudio = 0x01, + kAVCPrinter = 0x02, + kAVCDiskRecorder = 0x03, + kAVCTapeRecorder = 0x04, + kAVCTuner = 0x05, + kAVCVideoCamera = 0x07, + kAVCCameraStorage = 0x0b, + kAVCVendorUnique = 0x1c, + kAVCNumSubUnitTypes = 0x20 +} IOAVCUnitTypes; + +#define kAVCAllOpcodes 0xFF +#define kAVCAllSubunitsAndUnit 0xEE +#define kAVCMaxNumPlugs 31 +#define kAVCAnyAvailableIsochPlug 0x7F +#define kAVCAnyAvailableExternalPlug 0xFF +#define kAVCAnyAvailableSubunitPlug 0xFF +#define kAVCMultiplePlugs 0xFD +#define kAVCInvalidPlug 0xFE + + +#define IOAVCAddress(type, id) (((type) << 3) | (id)) +#define kAVCUnitAddress 0xff +#define IOAVCType(address) ((address) >> 3) +#define IOAVCId(address) ((address) & 0x7) + +// Macros for Plug Control Register field manipulation + +// Master control registers +#define kIOFWPCRDataRate FWBitRange(0,1) +#define kIOFWPCRDataRatePhase FWBitRangePhase(0,1) +#define kIOFWPCRExtension FWBitRange(8,15) +#define kIOFWPCRExtensionPhase FWBitRangePhase(8,15) +#define kIOFWPCRNumPlugs FWBitRange(27,31) +#define kIOFWPCRNumPlugsPhase FWBitRangePhase(27,31) + +// master output register +#define kIOFWPCRBroadcastBase FWBitRange(2,7) +#define kIOFWPCRBroadcastBasePhase FWBitRangePhase(2,7) + +// plug registers +#define kIOFWPCROnline FWBitRange(0,0) +#define kIOFWPCROnlinePhase FWBitRangePhase(0,0) +#define kIOFWPCRBroadcast FWBitRange(1,1) +#define kIOFWPCRBroadcastPhase FWBitRangePhase(1,1) +#define kIOFWPCRP2PCount FWBitRange(2,7) +#define kIOFWPCRP2PCountPhase FWBitRangePhase(2,7) +#define kIOFWPCRChannel FWBitRange(10,15) +#define kIOFWPCRChannelPhase FWBitRangePhase(10,15) + +// Extra fields for output plug registers +#define kIOFWPCROutputDataRate FWBitRange(16,17) +#define kIOFWPCROutputDataRatePhase FWBitRangePhase(16,17) +#define kIOFWPCROutputOverhead FWBitRange(18,21) +#define kIOFWPCROutputOverheadPhase FWBitRangePhase(18,21) +#define kIOFWPCROutputPayload FWBitRange(22,31) +#define kIOFWPCROutputPayloadPhase FWBitRangePhase(22,31) + +// async plug numbers + +enum +{ + kFWAVCAsyncPlug0 = 0xa0, + kFWAVCAsyncPlug1 = 0xa1, + kFWAVCAsyncPlug2 = 0xa2, + kFWAVCAsyncPlug3 = 0xa3, + kFWAVCAsyncPlug4 = 0xa4, + kFWAVCAsyncPlug5 = 0xa5, + kFWAVCAsyncPlug6 = 0xa6, + kFWAVCAsyncPlug7 = 0xa7, + kFWAVCAsyncPlug8 = 0xa8, + kFWAVCAsyncPlug9 = 0xa9, + kFWAVCAsyncPlug10 = 0xa1, + kFWAVCAsyncPlug11 = 0xab, + kFWAVCAsyncPlug12 = 0xac, + kFWAVCAsyncPlug13 = 0xad, + kFWAVCAsyncPlug14 = 0xae, + kFWAVCAsyncPlug15 = 0xaf, + kFWAVCAsyncPlug16 = 0xb0, + kFWAVCAsyncPlug17 = 0xb1, + kFWAVCAsyncPlug18 = 0xb2, + kFWAVCAsyncPlug19 = 0xb3, + kFWAVCAsyncPlug20 = 0xb4, + kFWAVCAsyncPlug21 = 0xb5, + kFWAVCAsyncPlug22 = 0xb6, + kFWAVCAsyncPlug23 = 0xb7, + kFWAVCAsyncPlug24 = 0xb8, + kFWAVCAsyncPlug25 = 0xb9, + kFWAVCAsyncPlug26 = 0xba, + kFWAVCAsyncPlug27 = 0xbb, + kFWAVCAsyncPlug28 = 0xbc, + kFWAVCAsyncPlug29 = 0xbd, + kFWAVCAsyncPlug30 = 0xbe, + kFWAVCAsyncPlugAny = 0xbf +}; + +enum +{ + kFWAVCStateBusSuspended = 0, + kFWAVCStateBusResumed = 1, + kFWAVCStatePlugReconnected = 2, + kFWAVCStatePlugDisconnected = 3, + kFWAVCStateDeviceRemoved = 4 +}; + +enum +{ + kFWAVCConsumerMode_MORE = 1, + kFWAVCConsumerMode_LAST = 4, + kFWAVCConsumerMode_LESS = 5, + kFWAVCConsumerMode_JUNK = 6, + kFWAVCConsumerMode_LOST = 7 +}; + +enum +{ + kFWAVCProducerMode_SEND = 5, + kFWAVCProducerMode_TOSS = 7 +}; + + +typedef enum +{ + IOFWAVCPlugSubunitSourceType, + IOFWAVCPlugSubunitDestType, + IOFWAVCPlugIsochInputType, + IOFWAVCPlugIsochOutputType, + IOFWAVCPlugAsynchInputType, + IOFWAVCPlugAsynchOutputType, + IOFWAVCPlugExternalInputType, + IOFWAVCPlugExternalOutputType +} IOFWAVCPlugTypes; + +typedef enum +{ + kIOFWAVCSubunitPlugMsgConnected, + kIOFWAVCSubunitPlugMsgDisconnected, + kIOFWAVCSubunitPlugMsgConnectedPlugModified, + kIOFWAVCSubunitPlugMsgSignalFormatModified +} IOFWAVCSubunitPlugMessages; + +// Some plug signal formats +#define kAVCPlugSignalFormatNTSCDV 0x80000000 +#define kAVCPlugSignalFormatPalDV 0x80800000 +#define kAVCPlugSignalFormatMPEGTS 0xA0000000 + +// Possible states of an AVCAsynchronousCommand +typedef enum +{ + kAVCAsyncCommandStatePendingRequest, + kAVCAsyncCommandStateRequestSent, + kAVCAsyncCommandStateRequestFailed, + kAVCAsyncCommandStateWaitingForResponse, + kAVCAsyncCommandStateReceivedInterimResponse, + kAVCAsyncCommandStateReceivedFinalResponse, + kAVCAsyncCommandStateTimeOutBeforeResponse, + kAVCAsyncCommandStateBusReset, + kAVCAsyncCommandStateOutOfMemory, + kAVCAsyncCommandStateCanceled +} IOFWAVCAsyncCommandState; + +#endif // _IOKIT_IOFIREWIREAVCCONSTS_H diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCRequestSpace.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCRequestSpace.h.svn-base new file mode 100644 index 0000000..c02797f --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCRequestSpace.h.svn-base @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWirePCRSpace.h + * + * Class to multiplex access to the FCP request address. + */ +#ifndef _IOKIT_IOFIREWIREAVCREQUESTSPACE_H +#define _IOKIT_IOFIREWIREAVCREQUESTSPACE_H + +#endif /* _IOKIT_IOFIREWIREAVCREQUESTSPACE_H */ diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCTargetSpace.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCTargetSpace.h.svn-base new file mode 100644 index 0000000..4f3cdb0 --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCTargetSpace.h.svn-base @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOFireWireAVCTargetSpace.h + * + * Class to centralize the AVC Target mode support + * + */ + +#ifndef _IOKIT_IOFIREWIREAVCTARGETSPACE_H +#define _IOKIT_IOFIREWIREAVCTARGETSPACE_H + +#include +#include + +#include +#include +#include +#include + +class IOFireWireAVCProtocolUserClient; +class AVCCommandHandlerInfo; +class AVCSubunitInfo; + +typedef void (*IOFireWireAVCTargetCommandHandlerCallback)(const AVCCommandHandlerInfo *pCmdInfo, + UInt32 generation, + UInt16 nodeID, + const void *command, + UInt32 cmdLen, + IOFWSpeed &speed, + UInt32 handlerSearchIndex); + +typedef void (*IOFireWireAVCSubunitPlugHandlerCallback)(const AVCSubunitInfo *pSubunitInfo, + IOFWAVCSubunitPlugMessages plugMessage, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 messageParams, + UInt32 generation, + UInt16 nodeID); + +/*! +@class AVCCommandHandlerInfo +@abstract internal class to manage installed command handlers +*/ +class AVCCommandHandlerInfo : public OSObject +{ + OSDeclareDefaultStructors(AVCCommandHandlerInfo) +public: + IOFireWireAVCProtocolUserClient * userClient; + IOFireWireAVCTargetCommandHandlerCallback callBack; + OSAsyncReference64 asyncRef; + UInt32 subUnitTypeAndID; + UInt32 opCode; + uint64_t userCallBack; + uint64_t userRefCon; +}; + +typedef struct _AVCSubunitPlugRecord +{ + UInt32 plugSignalFormat; + UInt32 connectionCount; +}AVCSubunitPlugRecord; + +/*! +@class AVCSubunitInfo +@abstract internal class to manage installed subunits +*/ +class AVCSubunitInfo : public OSObject +{ + OSDeclareDefaultStructors(AVCSubunitInfo) + bool init(); + void free(); +public: + static AVCSubunitInfo *create(); + IOFireWireAVCProtocolUserClient * userClient; + IOFireWireAVCSubunitPlugHandlerCallback callBack; + OSAsyncReference64 asyncRef; + UInt32 subunitTypeAndID; + UInt32 numSourcePlugs; + UInt32 numDestPlugs; + uint64_t userCallBack; + uint64_t userRefCon; + AVCSubunitPlugRecord *sourcePlugRecords; + AVCSubunitPlugRecord *destPlugRecords; +}; + +typedef struct _AVCUnitPlugRecord +{ + UInt32 connectionCount; +}AVCUnitPlugRecord; + +typedef struct _AVCUnitPlugs +{ + UInt32 numIsochInPlugs; + UInt32 numIsochOutPlugs; + UInt32 numExternalInPlugs; + UInt32 numExternalOutPlugs; + AVCUnitPlugRecord isochInPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord isochOutPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord externalInPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord externalOutPlugRecord[kAVCMaxNumPlugs]; +}AVCUnitPlugs; + +/*! +@class UCInfo +@abstract internal class to manage multiple protocol user clients +*/ +class UCInfo : public OSObject +{ + OSDeclareDefaultStructors(UCInfo) +public: + IOFireWireAVCProtocolUserClient *fUserClient; +}; + +/*! +@class AVCConnectionRecord +@abstract internal class to manage AVC connections +*/ +class AVCConnectionRecord : public OSObject +{ + OSDeclareDefaultStructors(AVCConnectionRecord) +public: + UInt32 sourceSubunitTypeAndID; + IOFWAVCPlugTypes sourcePlugType; + UInt32 sourcePlugNum; + UInt32 destSubunitTypeAndID; + IOFWAVCPlugTypes destPlugType; + UInt32 destPlugNum; + bool lockConnection; + bool permConnection; +}; + +/*! +@class IOFireWireAVCTargetSpace +@abstract object to centralize the AVC Target mode support +*/ +class IOFireWireAVCTargetSpace : public IOFWPseudoAddressSpace +{ + OSDeclareDefaultStructors(IOFireWireAVCTargetSpace) + +protected: + UInt32 fBuf[512]; + UInt32 fActivations; + IOFireWireController *fController; + IOLocalConfigDirectory * fAVCLocalConfigDirectory; + OSArray * fUserClients; + OSArray * fCommandHandlers; + OSArray * fSubunits; + OSArray * fConnectionRecords; + AVCUnitPlugs fUnitPlugs; + IORecursiveLock * fLock; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + + IOReturn targetSendAVCResponse(UInt32 generation, UInt16 nodeID, IOBufferMemoryDescriptor *pBufMemDesc, UInt32 size); + + // Internal AVC Target Command Handlers + IOReturn handleUnitInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleSubUnitInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handlePlugInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handlePowerCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleConnectCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleDisconnectCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleInputPlugSignalFormatCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleOutputPlugSignalFormatCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleConnectionsCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleSignalSourceCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + + UInt32 subUnitOfTypeCount(UInt32 type); + AVCSubunitInfo *getSubunitInfo(UInt32 subunitTypeAndID); + bool canConnectDestPlug(UInt32 destSubunitTypeAndID, + IOFWAVCPlugTypes destPlugType, + UInt32 *destPlugNum); + +public: + + // Activate/Deactivate Functions + virtual IOReturn activateWithUserClient(IOFireWireAVCProtocolUserClient *userClient); + virtual void deactivateWithUserClient(IOFireWireAVCProtocolUserClient *userClient); + + /*! + @function init + @abstract initializes the IOFireWireAVCTargetSpace object + */ + virtual bool init(IOFireWireController *controller); + + /*! + @function getAVCTargetSpace + @abstract returns the IOFireWireAVCTargetSpace object for the given FireWire bus + @param bus The FireWire bus + */ + static IOFireWireAVCTargetSpace *getAVCTargetSpace(IOFireWireController *controller); + + /*! + @function publishAVCUnitDirectory + @abstract Creates a local AVC Unit directory if it doesn't already exist + */ + virtual IOReturn publishAVCUnitDirectory(void); + + virtual IOReturn installAVCCommandHandler(IOFireWireAVCProtocolUserClient *userClient, + IOFireWireAVCTargetCommandHandlerCallback callBack, + OSAsyncReference64 asyncRef, + UInt32 subUnitTypeAndID, + UInt32 opCode, + uint64_t userCallBack, + uint64_t userRefCon); + + virtual IOReturn addSubunit(IOFireWireAVCProtocolUserClient *userClient, + IOFireWireAVCSubunitPlugHandlerCallback callBack, + OSAsyncReference64 asyncRef, + UInt32 subunitType, + UInt32 numSourcePlugs, + UInt32 numDestPlugs, + uint64_t userCallBack, + uint64_t userRefCon, + UInt32 *subUnitID); + + virtual IOReturn setSubunitPlugSignalFormat(IOFireWireAVCProtocolUserClient *userClient, + UInt32 subunitTypeAndID, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 signalFormat); + + virtual IOReturn getSubunitPlugSignalFormat(IOFireWireAVCProtocolUserClient *userClient, + UInt32 subunitTypeAndID, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 *pSignalFormat); + + virtual IOReturn connectTargetPlugs(IOFireWireAVCProtocolUserClient *userClient, + AVCConnectTargetPlugsInParams *inParams, + AVCConnectTargetPlugsOutParams *outParams); + + virtual IOReturn disconnectTargetPlugs(IOFireWireAVCProtocolUserClient *userClient, + UInt32 sourceSubunitTypeAndID, + IOFWAVCPlugTypes sourcePlugType, + UInt32 sourcePlugNum, + UInt32 destSubunitTypeAndID, + IOFWAVCPlugTypes destPlugType, + UInt32 destPlugNum); + + virtual IOReturn getTargetPlugConnection(IOFireWireAVCProtocolUserClient *userClient, + AVCGetTargetPlugConnectionInParams *inParams, + AVCGetTargetPlugConnectionOutParams *outParams); + + virtual IOReturn findAVCRequestHandler(IOFireWireAVCProtocolUserClient *userClient, + UInt32 generation, + UInt16 nodeID, + IOFWSpeed speed, + UInt32 handlerSearchIndex, + const char *pCmdBuf, + UInt32 cmdLen); + + virtual void pcrModified(IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 newValue); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 3); +}; + +#endif /*_IOKIT_IOFIREWIREAVCTARGETSPACE_H */ \ No newline at end of file diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCUnit.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCUnit.h.svn-base new file mode 100644 index 0000000..0abf1cd --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCUnit.h.svn-base @@ -0,0 +1,408 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREAVCUNIT_H +#define _IOKIT_IOFIREWIREAVCUNIT_H + +#include +#include +#include +#include +#include + +extern const OSSymbol *gIOAVCUnitType; + +class IOFireWireNub; +class IOFireWireAVCCommand; +class IOFireWirePCRSpace; +class IOFireWireAVCUnit; +class IOFireWireAVCSubUnit; +class IOFireWireAVCAsynchronousCommand; +class IOFireWireAVCNub; + +// The callback prototype for AVC Asynchronous Commands +typedef void (*IOFireWireAVCAsynchronousCommandCallback)(void *pRefCon, IOFireWireAVCAsynchronousCommand *pCommandObject); + +const UInt16 kIOFWAVCAsyncCmdFreed = 0xdead; + +/*! +@class IOFireWireAVCAsynchronousCommand +*/ +class IOFireWireAVCAsynchronousCommand : public IOCommand +{ + OSDeclareDefaultStructors(IOFireWireAVCAsynchronousCommand) + void free(void); + + friend class IOFireWireAVCUnit; + +protected: + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + IOReturn init(const UInt8 * command, UInt32 len, IOFireWireAVCAsynchronousCommandCallback completionCallback, void *pClientRefCon); + IOReturn submit(IOFireWireAVCNub *pAVCNub); + IOReturn cancel(void); + IOReturn reinit(const UInt8 * command, UInt32 cmdLen); + + // This function returns true if this command is currently waiting for a response + bool isPending(void); + + IOFWAVCAsyncCommandState cmdState; + void *pRefCon; + UInt8 *pCommandBuf; + UInt32 cmdLen; + UInt8 *pInterimResponseBuf; + UInt32 interimResponseLen; + UInt8 *pFinalResponseBuf; + UInt32 finalResponseLen; + +protected: + IOFireWireAVCAsynchronousCommandCallback fCallback; + IOFireWireAVCUnit *fAVCUnit; + IOMemoryDescriptor *fMem; + IOFWCommand *fWriteCmd; + IOFWDelayCommand *fDelayCmd; + UInt16 fWriteNodeID; + UInt32 fWriteGen; + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 3); +}; + +/*! + @class IOFireWireAVCNub + @abstract nub for AVC devices +*/ +class IOFireWireAVCNub : public IOService +{ + OSDeclareDefaultStructors(IOFireWireAVCNub) + +protected: + IOFireWireNub * fDevice; + +public: + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen) = 0; + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen) = 0; + +/*! + @function getDevice + @abstract Returns the FireWire device nub that is this object's provider . +*/ + IOFireWireNub* getDevice() const + {return fDevice;}; + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout() = 0; + +private: + OSMetaClassDeclareReservedUsed(IOFireWireAVCNub, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 3); +}; + +/*! + @class IOFireWireAVCUnit + @abstract nub for AVC devices +*/ +class IOFireWireAVCUnit : public IOFireWireAVCNub +{ + OSDeclareDefaultStructors(IOFireWireAVCUnit) + + friend class IOFireWireAVCAsynchronousCommand; + +protected: + IOFWPseudoAddressSpace *fFCPResponseSpace; + IOLock *avcLock; + IOFireWireAVCCommand *fCommand; + + UInt8 fSubUnitCount[kAVCNumSubUnitTypes]; + + bool fStarted; + IOLock *cmdLock; + +/*! @struct ExpansionData + @discussion This structure is used to expand the capablilties of the class in a binary compatible way + */ + struct ExpansionData + { + OSArray * fAVCAsyncCommands; + IOFireWireController *fControl; + bool enableRobustAVCCommandResponseMatching; + }; + +/*! @var fIOFireWireAVCUnitExpansion + */ + ExpansionData *fIOFireWireAVCUnitExpansion; + + static UInt32 AVCResponse(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon requestRefcon); + + static void rescanSubUnits(void *arg); + + virtual void free(void); + + virtual void updateSubUnits(bool firstTime); + + static void AVCAsynchRequestWriteDone(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + static void AVCAsynchDelayDone(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +public: + // IOService overrides + virtual bool start(IOService *provider); + virtual IOReturn message(UInt32 type, IOService *provider, void *argument); + virtual IOReturn setProperties (OSObject * properties ); + +/*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); +/*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + +/*! + @function matchPropertyTable + @abstract Matching language support + Match on the following properties of the unit: + Vendor_ID + GUID + Unit_Type + and available sub-units, match if the device has at least the requested number of a sub-unit type: + AVCSubUnit_0 -> AVCSubUnit_1f +*/ + virtual bool matchPropertyTable(OSDictionary * table); + + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout(); + +protected: + UInt32 indexOfAVCAsynchronousCommandObject(IOFireWireAVCAsynchronousCommand *pCommandObject); + void removeAVCAsynchronousCommandObjectAtIndex(UInt32 index); + + void lockAVCAsynchronousCommandLock(); + + void unlockAVCAsynchronousCommandLock(); + + bool available(); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 3); + +}; + +/*! + @class IOFireWireAVCSubUnit + @abstract nub for sub unit of AVC devices. Just for matching, calls the AVC unit for all functions. +*/ +class IOFireWireAVCSubUnit : public IOFireWireAVCNub +{ + OSDeclareDefaultStructors(IOFireWireAVCSubUnit) + + friend class IOFireWireAVCAsynchronousCommand; + +protected: + IOFireWireAVCUnit *fAVCUnit; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + virtual bool init(OSDictionary *propTable, IOFireWireAVCUnit *provider); + + // IOService overrides + virtual IOReturn message(UInt32 type, IOService *provider, void *argument); + +/*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); +/*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + +/*! + @function matchPropertyTable + @abstract Matching language support + Match on the following properties of the sub unit: + Vendor_ID + GUID + SubUnit_Type +*/ + virtual bool matchPropertyTable(OSDictionary * table); + + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout(); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 3); + +}; + +#endif // _IOKIT_IOFIREWIREAVCUNIT_H + diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCUserClientCommon.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCUserClientCommon.h.svn-base new file mode 100644 index 0000000..cecf812 --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWireAVCUserClientCommon.h.svn-base @@ -0,0 +1,124 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ +#define _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ + +#include + +#define kIOFireWireAVCLibConnection 13 + +enum IOFWAVCUserClientCommandCodes { + kIOFWAVCUserClientOpen, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientClose, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientOpenWithSessionRef, // kIOUCScalarIScalarO 1,0 + kIOFWAVCUserClientGetSessionRef, // kIOUCScalarIScalarO 0,1 + kIOFWAVCUserClientAVCCommand, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientAVCCommandInGen, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientUpdateAVCCommandTimeout, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientMakeP2PInputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientBreakP2PInputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientMakeP2POutputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientBreakP2POutputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientCreateAsyncAVCCommand, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientSubmitAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientCancelAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientReleaseAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientReinitAsyncAVCCommand, // // kIOUCScalarIStructI 1, -1 + kIOFWAVCUserClientNumCommands +}; + +enum IOFWAVCUserClientAsyncCommandCodes { + kIOFWAVCUserClientInstallAsyncAVCCommandCallback = kIOFWAVCUserClientNumCommands, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCUserClientNumAsyncCommands +}; + + +enum IOFWAVCProtocolUserClientCommandCodes { + kIOFWAVCProtocolUserClientSendAVCResponse, // kIOUCScalarIStructI 2, -1 + kIOFWAVCProtocolUserClientFreeInputPlug, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCProtocolUserClientReadInputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientUpdateInputPlug, // kIOUCScalarIScalarO 3, 0 + kIOFWAVCProtocolUserClientFreeOutputPlug, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCProtocolUserClientReadOutputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientUpdateOutputPlug, // kIOUCScalarIScalarO 3, 0 + kIOFWAVCProtocolUserClientReadOutputMasterPlug, // kIOUCScalarIScalarO 0, 1 + kIOFWAVCProtocolUserClientUpdateOutputMasterPlug, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientReadInputMasterPlug, // kIOUCScalarIScalarO 0, 1 + kIOFWAVCProtocolUserClientUpdateInputMasterPlug, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientPublishAVCUnitDirectory, // kIOUCScalarIScalarO 0, 0 + kIOFWAVCProtocolUserClientSetSubunitPlugSignalFormat, // kIOUCScalarIScalarO 4, 0 + kIOFWAVCProtocolUserClientGetSubunitPlugSignalFormat, // kIOUCScalarIScalarO 3, 1 + kIOFWAVCProtocolUserClientConnectTargetPlugs, // kIOUCStructIStructO + kIOFWAVCProtocolUserClientDisconnectTargetPlugs, // kIOUCScalarIScalarO 6, 0 + kIOFWAVCProtocolUserClientGetTargetPlugConnection, // kIOUCStructIStructO + kIOFWAVCProtocolUserClientAVCRequestNotHandled, // kIOUCScalarIStructI 4, -1 + kIOFWAVCProtocolUserClientNumCommands +}; + +enum IOFWAVCProtocolUserClientAsyncCommandCodes { + kIOFWAVCProtocolUserClientSetAVCRequestCallback = kIOFWAVCProtocolUserClientNumCommands, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientAllocateInputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientAllocateOutputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientInstallAVCCommandHandler, // kIOUCScalarIScalarO 4, 0 + kIOFWAVCProtocolUserClientAddSubunit, // kIOUCScalarIScalarO 5, 1 + kIOFWAVCProtocolUserClientNumAsyncCommands +}; + +typedef struct _AVCConnectTargetPlugsInParams +{ + UInt32 sourceSubunitTypeAndID; + IOFWAVCPlugTypes sourcePlugType; + UInt32 sourcePlugNum; + UInt32 destSubunitTypeAndID; + IOFWAVCPlugTypes destPlugType; + UInt32 destPlugNum; + Boolean lockConnection; + Boolean permConnection; +}AVCConnectTargetPlugsInParams; + +typedef struct _AVCConnectTargetPlugsOutParams +{ + UInt32 sourcePlugNum; + UInt32 destPlugNum; +}AVCConnectTargetPlugsOutParams; + +typedef struct _AVCGetTargetPlugConnectionInParams +{ + UInt32 subunitTypeAndID; + IOFWAVCPlugTypes plugType; + UInt32 plugNum; +}AVCGetTargetPlugConnectionInParams; + +typedef struct _AVCGetTargetPlugConnectionOutParams +{ + UInt32 connectedSubunitTypeAndID; + IOFWAVCPlugTypes connectedPlugType; + UInt32 connectedPlugNum; + Boolean lockConnection; + Boolean permConnection; +}AVCGetTargetPlugConnectionOutParams; + +#define kAsyncCmdSharedBufInterimRespOffset 0 +#define kAsyncCmdSharedBufFinalRespOffset 512 + +#endif // _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ \ No newline at end of file diff --git a/i386/include/IOKit/avc/.svn/text-base/IOFireWirePCRSpace.h.svn-base b/i386/include/IOKit/avc/.svn/text-base/IOFireWirePCRSpace.h.svn-base new file mode 100644 index 0000000..9f31176 --- /dev/null +++ b/i386/include/IOKit/avc/.svn/text-base/IOFireWirePCRSpace.h.svn-base @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWirePCRSpace.h + * + * Class to multiplex access to the PCR addresses. + */ +#ifndef _IOKIT_IOFIREWIREPCRSPACE_H +#define _IOKIT_IOFIREWIREPCRSPACE_H + +#include +#include + +/*! + @typedef IOFireWirePCRCallback + @abstract Callback called after a successful lock transaction to a plug. + @param refcon refcon supplied to the IOFireWireFCPSpace when a client is registered + @param nodeID is the node originating the request + @param plugNo is the plug number + @param oldVal is the value the plug used to contain + @param newVal is the quad written into the plug + + */ +typedef void (*IOFireWirePCRCallback)(void *refcon, UInt16 nodeID, UInt32 plug, UInt32 oldVal, UInt32 newVal); + +class IOFireWireBus; + +/*! + @class IOFireWirePCRSpace + @abstract object to multiplex users of the PCR plug registers +*/ +class IOFireWirePCRSpace : public IOFWPseudoAddressSpace +{ + OSDeclareDefaultStructors(IOFireWirePCRSpace) + +protected: + struct Client { + IOFireWirePCRCallback func; + void * refcon; + }; + UInt32 fBuf[64]; + + Client fClients[64]; + UInt32 fActivations; + IOFireWireAVCTargetSpace * fAVCTargetSpace; + IONotifier *fNotifier; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // Override to notify client of each plug seperately + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + virtual IOReturn allocatePlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug, Client* head); + virtual void freePlug(UInt32 plug, Client* head); + virtual UInt32 readPlug(UInt32 plug); + virtual IOReturn updatePlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); + +public: + + // Override to handle multiple activations (one per client) + virtual IOReturn activate(); + virtual void deactivate(); + +/*! + @function init + @abstract initializes the IOFireWirePCRSpace object +*/ + virtual bool init(IOFireWireBus *bus); +/*! + @function getPCRAddressSpace + @abstract returns the IOFireWirePCRSpace object for the given FireWire bus + @param bus The FireWire bus +*/ + static IOFireWirePCRSpace *getPCRAddressSpace(IOFireWireBus *bus); +/*! + @function allocateInputPlug + @abstract allocates an input plug. + @param refcon arbitrary value passed back as first argument of callback. + @param func callback function when a successful lock transaction to the plug has been performed + @param plug set to the plug number if a plug is successfully allocated +*/ + virtual IOReturn allocateInputPlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug); +/*! + @function freeInputPlug + @abstract deallocates an input plug. + @param plug value returned by allocateInputPlug. +*/ + virtual void freeInputPlug(UInt32 plug); +/*! + @function readInputPlug + @abstract returns the current value of an input plug. + @param plug value returned by allocateInputPlug. +*/ + virtual UInt32 readInputPlug(UInt32 plug); +/*! + @function updateInputPlug + @abstract updates the value of an input plug (simulating a lock transaction). + @param plug value returned by allocateInputPlug. + @param oldVal value returned by readInputPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateInputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); +/*! + @function allocateOutputPlug + @abstract allocates an output plug. + @param refcon arbitrary value passed back as first argument of callback. + @param func callback function when a successful lock transaction to the plug has been performed + @param plug set to the plug number if a plug is successfully allocated +*/ + virtual IOReturn allocateOutputPlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug); +/*! + @function freeOutputPlug + @abstract deallocates an output plug. + @param plug value returned by allocateOutputPlug. +*/ + virtual void freeOutputPlug(UInt32 plug); +/*! + @function readOutputPlug + @abstract returns the current value of an output plug. + @param plug value returned by allocateOutputPlug. +*/ + virtual UInt32 readOutputPlug(UInt32 plug); +/*! + @function updateOutputPlug + @abstract updates the value of an output plug (simulating a lock transaction). + @param plug value returned by allocateOutputPlug. + @param oldVal value returned by readOutputPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateOutputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); +/*! + @function readOutputMasterPlug + @abstract returns the current value of the output master plug. +*/ + virtual UInt32 readOutputMasterPlug(); +/*! + @function updateOutputMasterPlug + @abstract updates the value of the master output plug (simulating a lock transaction). + @param oldVal value returned by readOutputMasterPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateOutputMasterPlug(UInt32 oldVal, UInt32 newVal); +/*! + @function readInputMasterPlug + @abstract returns the current value of the input master plug. +*/ + virtual UInt32 readInputMasterPlug(); +/*! + @function updateInputMasterPlug + @abstract updates the value of the master input plug (simulating a lock transaction). + @param oldVal value returned by readInputMasterPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateInputMasterPlug(UInt32 oldVal, UInt32 newVal); + + /*! + @function setAVCTargetSpacePointer + */ + virtual void setAVCTargetSpacePointer(IOFireWireAVCTargetSpace *pAVCTargetSpace); + + /*! + @function clearAllP2PConnections + */ + virtual void clearAllP2PConnections(void); + +private: + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 0); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 1); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 2); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 3); + +}; + +#endif /* _IOKIT_IOFIREWIREPCRSPACE_H */ diff --git a/i386/include/IOKit/avc/IOFireWireAVCCommand.h b/i386/include/IOKit/avc/IOFireWireAVCCommand.h new file mode 100644 index 0000000..ff9850d --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWireAVCCommand.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFireWireAVCCommand_H +#define _IOKIT_IOFireWireAVCCommand_H + +#include + +/*! @class IOFireWireAVCCommand +*/ +class IOFireWireAVCCommand : public IOFWCommand +{ + OSDeclareDefaultStructors(IOFireWireAVCCommand) + +protected: + IOFWCommand *fWriteCmd; + IOMemoryDescriptor *fMem; + const UInt8 *fCommand; + + UInt32 fCmdLen; + UInt8 *fResponse; + UInt32 *fResponseLen; + int fCurRetries; + int fMaxRetries; + + UInt32 fWriteGen; + UInt16 fWriteNodeID; + bool bypassRobustCommandResponseMatching; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { + bool fStarted; + bool fSyncWakeupSignaled; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *fIOFireWireAVCCommandExpansion; + + static void writeDone(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + + virtual IOReturn complete(IOReturn status); + virtual IOReturn execute(); + virtual void free(); + +public: + virtual bool init(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + virtual IOReturn reinit(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + + static IOFireWireAVCCommand *withNub(IOFireWireNub *device, const UInt8 * command, UInt32 cmdLen, + UInt8 * response, UInt32 * responseLen); + + static IOFireWireAVCCommand *withNub(IOFireWireNub *device, UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 * responseLen); + + virtual UInt32 handleResponse(UInt16 nodeID, UInt32 len, const void *buf); + + virtual IOReturn resetInterimTimeout(); + + virtual UInt32 handleResponseWithSimpleMatching(UInt16 nodeID, UInt32 len, const void *buf); + + virtual IOReturn submit(bool queue = false); + +private: + OSMetaClassDeclareReservedUsed(IOFireWireAVCCommand, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCCommand, 3); +}; + +#endif // _IOKIT_IOFireWireAVCCommand_H + diff --git a/i386/include/IOKit/avc/IOFireWireAVCConsts.h b/i386/include/IOKit/avc/IOFireWireAVCConsts.h new file mode 100644 index 0000000..ae7a12c --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWireAVCConsts.h @@ -0,0 +1,259 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFIREWIREAVCCONSTS_H +#define _IOKIT_IOFIREWIREAVCCONSTS_H + +// Fields of AVC frame +typedef enum { + kAVCCommandResponse = 0, + kAVCAddress = 1, + kAVCOpcode = 2, + kAVCOperand0 = 3, + kAVCOperand1 = 4, + kAVCOperand2 = 5, + kAVCOperand3 = 6, + kAVCOperand4 = 7, + kAVCOperand5 = 8, + kAVCOperand6 = 9, + kAVCOperand7 = 10, + kAVCOperand8 = 11 +} IOAVCFrameFields; + +// Command/Response values +typedef enum { + kAVCControlCommand = 0x00, + kAVCStatusInquiryCommand = 0x01, + kAVCSpecificInquiryCommand = 0x02, + kAVCNotifyCommand = 0x03, + kAVCGeneralInquiryCommand = 0x04, + kAVCNotImplementedStatus = 0x08, + kAVCAcceptedStatus = 0x09, + kAVCRejectedStatus = 0x0a, + kAVCInTransitionStatus = 0x0b, + kAVCImplementedStatus = 0x0c, + kAVCChangedStatus = 0x0d, + kAVCInterimStatus = 0x0f +} IOAVCCommandResponse; + +// Opcodes +typedef enum { + + // Unit commands + kAVCPlugInfoOpcode = 0x02, + kAVCOutputPlugSignalFormatOpcode = 0x18, + kAVCInputPlugSignalFormatOpcode = 0x19, + kAVCUnitInfoOpcode = 0x30, + kAVCSubunitInfoOpcode = 0x31, + kAVCConnectionsOpcode = 0x22, + kAVCConnectOpcode = 0x24, + kAVCDisconnectOpcode = 0x25, + kAVCPowerOpcode = 0xB2, + kAVCSignalSourceOpcode = 0x1A, + + // Vendor dependent commands + kAVCVendorDependentOpcode = 0x00, + + // Subunit commands + kAVCOutputSignalModeOpcode = 0x78, + kAVCInputSignalModeOpcode = 0x79, + kAVCSignalModeSD525_60 = 0x00, + kAVCSignalModeSDL525_60 = 0x04, + kAVCSignalModeHD1125_60 = 0x08, + kAVCSignalModeSD625_50 = 0x80, + kAVCSignalModeSDL625_50 = 0x84, + kAVCSignalModeHD1250_50 = 0x88, + kAVCSignalModeDVCPro525_60 = 0x78, + kAVCSignalModeDVCPro625_50 = 0xf8, + + kAVCSignalModeDummyOperand = 0xff, + kAVCSignalModeMask_50 = 0x80, + kAVCSignalModeMask_STYPE = 0x7c, + kAVCSignalModeMask_SDL = 0x04, + kAVCSignalModeMask_DVCPro25 = 0x78 + +} IOAVCOpcodes; + +// Unit/Subunit types +typedef enum { + kAVCVideoMonitor = 0x00, + kAVCAudio = 0x01, + kAVCPrinter = 0x02, + kAVCDiskRecorder = 0x03, + kAVCTapeRecorder = 0x04, + kAVCTuner = 0x05, + kAVCVideoCamera = 0x07, + kAVCCameraStorage = 0x0b, + kAVCVendorUnique = 0x1c, + kAVCNumSubUnitTypes = 0x20 +} IOAVCUnitTypes; + +#define kAVCAllOpcodes 0xFF +#define kAVCAllSubunitsAndUnit 0xEE +#define kAVCMaxNumPlugs 31 +#define kAVCAnyAvailableIsochPlug 0x7F +#define kAVCAnyAvailableExternalPlug 0xFF +#define kAVCAnyAvailableSubunitPlug 0xFF +#define kAVCMultiplePlugs 0xFD +#define kAVCInvalidPlug 0xFE + + +#define IOAVCAddress(type, id) (((type) << 3) | (id)) +#define kAVCUnitAddress 0xff +#define IOAVCType(address) ((address) >> 3) +#define IOAVCId(address) ((address) & 0x7) + +// Macros for Plug Control Register field manipulation + +// Master control registers +#define kIOFWPCRDataRate FWBitRange(0,1) +#define kIOFWPCRDataRatePhase FWBitRangePhase(0,1) +#define kIOFWPCRExtension FWBitRange(8,15) +#define kIOFWPCRExtensionPhase FWBitRangePhase(8,15) +#define kIOFWPCRNumPlugs FWBitRange(27,31) +#define kIOFWPCRNumPlugsPhase FWBitRangePhase(27,31) + +// master output register +#define kIOFWPCRBroadcastBase FWBitRange(2,7) +#define kIOFWPCRBroadcastBasePhase FWBitRangePhase(2,7) + +// plug registers +#define kIOFWPCROnline FWBitRange(0,0) +#define kIOFWPCROnlinePhase FWBitRangePhase(0,0) +#define kIOFWPCRBroadcast FWBitRange(1,1) +#define kIOFWPCRBroadcastPhase FWBitRangePhase(1,1) +#define kIOFWPCRP2PCount FWBitRange(2,7) +#define kIOFWPCRP2PCountPhase FWBitRangePhase(2,7) +#define kIOFWPCRChannel FWBitRange(10,15) +#define kIOFWPCRChannelPhase FWBitRangePhase(10,15) + +// Extra fields for output plug registers +#define kIOFWPCROutputDataRate FWBitRange(16,17) +#define kIOFWPCROutputDataRatePhase FWBitRangePhase(16,17) +#define kIOFWPCROutputOverhead FWBitRange(18,21) +#define kIOFWPCROutputOverheadPhase FWBitRangePhase(18,21) +#define kIOFWPCROutputPayload FWBitRange(22,31) +#define kIOFWPCROutputPayloadPhase FWBitRangePhase(22,31) + +// async plug numbers + +enum +{ + kFWAVCAsyncPlug0 = 0xa0, + kFWAVCAsyncPlug1 = 0xa1, + kFWAVCAsyncPlug2 = 0xa2, + kFWAVCAsyncPlug3 = 0xa3, + kFWAVCAsyncPlug4 = 0xa4, + kFWAVCAsyncPlug5 = 0xa5, + kFWAVCAsyncPlug6 = 0xa6, + kFWAVCAsyncPlug7 = 0xa7, + kFWAVCAsyncPlug8 = 0xa8, + kFWAVCAsyncPlug9 = 0xa9, + kFWAVCAsyncPlug10 = 0xa1, + kFWAVCAsyncPlug11 = 0xab, + kFWAVCAsyncPlug12 = 0xac, + kFWAVCAsyncPlug13 = 0xad, + kFWAVCAsyncPlug14 = 0xae, + kFWAVCAsyncPlug15 = 0xaf, + kFWAVCAsyncPlug16 = 0xb0, + kFWAVCAsyncPlug17 = 0xb1, + kFWAVCAsyncPlug18 = 0xb2, + kFWAVCAsyncPlug19 = 0xb3, + kFWAVCAsyncPlug20 = 0xb4, + kFWAVCAsyncPlug21 = 0xb5, + kFWAVCAsyncPlug22 = 0xb6, + kFWAVCAsyncPlug23 = 0xb7, + kFWAVCAsyncPlug24 = 0xb8, + kFWAVCAsyncPlug25 = 0xb9, + kFWAVCAsyncPlug26 = 0xba, + kFWAVCAsyncPlug27 = 0xbb, + kFWAVCAsyncPlug28 = 0xbc, + kFWAVCAsyncPlug29 = 0xbd, + kFWAVCAsyncPlug30 = 0xbe, + kFWAVCAsyncPlugAny = 0xbf +}; + +enum +{ + kFWAVCStateBusSuspended = 0, + kFWAVCStateBusResumed = 1, + kFWAVCStatePlugReconnected = 2, + kFWAVCStatePlugDisconnected = 3, + kFWAVCStateDeviceRemoved = 4 +}; + +enum +{ + kFWAVCConsumerMode_MORE = 1, + kFWAVCConsumerMode_LAST = 4, + kFWAVCConsumerMode_LESS = 5, + kFWAVCConsumerMode_JUNK = 6, + kFWAVCConsumerMode_LOST = 7 +}; + +enum +{ + kFWAVCProducerMode_SEND = 5, + kFWAVCProducerMode_TOSS = 7 +}; + + +typedef enum +{ + IOFWAVCPlugSubunitSourceType, + IOFWAVCPlugSubunitDestType, + IOFWAVCPlugIsochInputType, + IOFWAVCPlugIsochOutputType, + IOFWAVCPlugAsynchInputType, + IOFWAVCPlugAsynchOutputType, + IOFWAVCPlugExternalInputType, + IOFWAVCPlugExternalOutputType +} IOFWAVCPlugTypes; + +typedef enum +{ + kIOFWAVCSubunitPlugMsgConnected, + kIOFWAVCSubunitPlugMsgDisconnected, + kIOFWAVCSubunitPlugMsgConnectedPlugModified, + kIOFWAVCSubunitPlugMsgSignalFormatModified +} IOFWAVCSubunitPlugMessages; + +// Some plug signal formats +#define kAVCPlugSignalFormatNTSCDV 0x80000000 +#define kAVCPlugSignalFormatPalDV 0x80800000 +#define kAVCPlugSignalFormatMPEGTS 0xA0000000 + +// Possible states of an AVCAsynchronousCommand +typedef enum +{ + kAVCAsyncCommandStatePendingRequest, + kAVCAsyncCommandStateRequestSent, + kAVCAsyncCommandStateRequestFailed, + kAVCAsyncCommandStateWaitingForResponse, + kAVCAsyncCommandStateReceivedInterimResponse, + kAVCAsyncCommandStateReceivedFinalResponse, + kAVCAsyncCommandStateTimeOutBeforeResponse, + kAVCAsyncCommandStateBusReset, + kAVCAsyncCommandStateOutOfMemory, + kAVCAsyncCommandStateCanceled +} IOFWAVCAsyncCommandState; + +#endif // _IOKIT_IOFIREWIREAVCCONSTS_H diff --git a/i386/include/IOKit/avc/IOFireWireAVCRequestSpace.h b/i386/include/IOKit/avc/IOFireWireAVCRequestSpace.h new file mode 100644 index 0000000..c02797f --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWireAVCRequestSpace.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWirePCRSpace.h + * + * Class to multiplex access to the FCP request address. + */ +#ifndef _IOKIT_IOFIREWIREAVCREQUESTSPACE_H +#define _IOKIT_IOFIREWIREAVCREQUESTSPACE_H + +#endif /* _IOKIT_IOFIREWIREAVCREQUESTSPACE_H */ diff --git a/i386/include/IOKit/avc/IOFireWireAVCTargetSpace.h b/i386/include/IOKit/avc/IOFireWireAVCTargetSpace.h new file mode 100644 index 0000000..4f3cdb0 --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWireAVCTargetSpace.h @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOFireWireAVCTargetSpace.h + * + * Class to centralize the AVC Target mode support + * + */ + +#ifndef _IOKIT_IOFIREWIREAVCTARGETSPACE_H +#define _IOKIT_IOFIREWIREAVCTARGETSPACE_H + +#include +#include + +#include +#include +#include +#include + +class IOFireWireAVCProtocolUserClient; +class AVCCommandHandlerInfo; +class AVCSubunitInfo; + +typedef void (*IOFireWireAVCTargetCommandHandlerCallback)(const AVCCommandHandlerInfo *pCmdInfo, + UInt32 generation, + UInt16 nodeID, + const void *command, + UInt32 cmdLen, + IOFWSpeed &speed, + UInt32 handlerSearchIndex); + +typedef void (*IOFireWireAVCSubunitPlugHandlerCallback)(const AVCSubunitInfo *pSubunitInfo, + IOFWAVCSubunitPlugMessages plugMessage, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 messageParams, + UInt32 generation, + UInt16 nodeID); + +/*! +@class AVCCommandHandlerInfo +@abstract internal class to manage installed command handlers +*/ +class AVCCommandHandlerInfo : public OSObject +{ + OSDeclareDefaultStructors(AVCCommandHandlerInfo) +public: + IOFireWireAVCProtocolUserClient * userClient; + IOFireWireAVCTargetCommandHandlerCallback callBack; + OSAsyncReference64 asyncRef; + UInt32 subUnitTypeAndID; + UInt32 opCode; + uint64_t userCallBack; + uint64_t userRefCon; +}; + +typedef struct _AVCSubunitPlugRecord +{ + UInt32 plugSignalFormat; + UInt32 connectionCount; +}AVCSubunitPlugRecord; + +/*! +@class AVCSubunitInfo +@abstract internal class to manage installed subunits +*/ +class AVCSubunitInfo : public OSObject +{ + OSDeclareDefaultStructors(AVCSubunitInfo) + bool init(); + void free(); +public: + static AVCSubunitInfo *create(); + IOFireWireAVCProtocolUserClient * userClient; + IOFireWireAVCSubunitPlugHandlerCallback callBack; + OSAsyncReference64 asyncRef; + UInt32 subunitTypeAndID; + UInt32 numSourcePlugs; + UInt32 numDestPlugs; + uint64_t userCallBack; + uint64_t userRefCon; + AVCSubunitPlugRecord *sourcePlugRecords; + AVCSubunitPlugRecord *destPlugRecords; +}; + +typedef struct _AVCUnitPlugRecord +{ + UInt32 connectionCount; +}AVCUnitPlugRecord; + +typedef struct _AVCUnitPlugs +{ + UInt32 numIsochInPlugs; + UInt32 numIsochOutPlugs; + UInt32 numExternalInPlugs; + UInt32 numExternalOutPlugs; + AVCUnitPlugRecord isochInPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord isochOutPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord externalInPlugRecord[kAVCMaxNumPlugs]; + AVCUnitPlugRecord externalOutPlugRecord[kAVCMaxNumPlugs]; +}AVCUnitPlugs; + +/*! +@class UCInfo +@abstract internal class to manage multiple protocol user clients +*/ +class UCInfo : public OSObject +{ + OSDeclareDefaultStructors(UCInfo) +public: + IOFireWireAVCProtocolUserClient *fUserClient; +}; + +/*! +@class AVCConnectionRecord +@abstract internal class to manage AVC connections +*/ +class AVCConnectionRecord : public OSObject +{ + OSDeclareDefaultStructors(AVCConnectionRecord) +public: + UInt32 sourceSubunitTypeAndID; + IOFWAVCPlugTypes sourcePlugType; + UInt32 sourcePlugNum; + UInt32 destSubunitTypeAndID; + IOFWAVCPlugTypes destPlugType; + UInt32 destPlugNum; + bool lockConnection; + bool permConnection; +}; + +/*! +@class IOFireWireAVCTargetSpace +@abstract object to centralize the AVC Target mode support +*/ +class IOFireWireAVCTargetSpace : public IOFWPseudoAddressSpace +{ + OSDeclareDefaultStructors(IOFireWireAVCTargetSpace) + +protected: + UInt32 fBuf[512]; + UInt32 fActivations; + IOFireWireController *fController; + IOLocalConfigDirectory * fAVCLocalConfigDirectory; + OSArray * fUserClients; + OSArray * fCommandHandlers; + OSArray * fSubunits; + OSArray * fConnectionRecords; + AVCUnitPlugs fUnitPlugs; + IORecursiveLock * fLock; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + + IOReturn targetSendAVCResponse(UInt32 generation, UInt16 nodeID, IOBufferMemoryDescriptor *pBufMemDesc, UInt32 size); + + // Internal AVC Target Command Handlers + IOReturn handleUnitInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleSubUnitInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handlePlugInfoCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handlePowerCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleConnectCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleDisconnectCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleInputPlugSignalFormatCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleOutputPlugSignalFormatCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleConnectionsCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + IOReturn handleSignalSourceCommand(UInt16 nodeID, UInt32 generation, const char *buf, UInt32 len); + + UInt32 subUnitOfTypeCount(UInt32 type); + AVCSubunitInfo *getSubunitInfo(UInt32 subunitTypeAndID); + bool canConnectDestPlug(UInt32 destSubunitTypeAndID, + IOFWAVCPlugTypes destPlugType, + UInt32 *destPlugNum); + +public: + + // Activate/Deactivate Functions + virtual IOReturn activateWithUserClient(IOFireWireAVCProtocolUserClient *userClient); + virtual void deactivateWithUserClient(IOFireWireAVCProtocolUserClient *userClient); + + /*! + @function init + @abstract initializes the IOFireWireAVCTargetSpace object + */ + virtual bool init(IOFireWireController *controller); + + /*! + @function getAVCTargetSpace + @abstract returns the IOFireWireAVCTargetSpace object for the given FireWire bus + @param bus The FireWire bus + */ + static IOFireWireAVCTargetSpace *getAVCTargetSpace(IOFireWireController *controller); + + /*! + @function publishAVCUnitDirectory + @abstract Creates a local AVC Unit directory if it doesn't already exist + */ + virtual IOReturn publishAVCUnitDirectory(void); + + virtual IOReturn installAVCCommandHandler(IOFireWireAVCProtocolUserClient *userClient, + IOFireWireAVCTargetCommandHandlerCallback callBack, + OSAsyncReference64 asyncRef, + UInt32 subUnitTypeAndID, + UInt32 opCode, + uint64_t userCallBack, + uint64_t userRefCon); + + virtual IOReturn addSubunit(IOFireWireAVCProtocolUserClient *userClient, + IOFireWireAVCSubunitPlugHandlerCallback callBack, + OSAsyncReference64 asyncRef, + UInt32 subunitType, + UInt32 numSourcePlugs, + UInt32 numDestPlugs, + uint64_t userCallBack, + uint64_t userRefCon, + UInt32 *subUnitID); + + virtual IOReturn setSubunitPlugSignalFormat(IOFireWireAVCProtocolUserClient *userClient, + UInt32 subunitTypeAndID, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 signalFormat); + + virtual IOReturn getSubunitPlugSignalFormat(IOFireWireAVCProtocolUserClient *userClient, + UInt32 subunitTypeAndID, + IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 *pSignalFormat); + + virtual IOReturn connectTargetPlugs(IOFireWireAVCProtocolUserClient *userClient, + AVCConnectTargetPlugsInParams *inParams, + AVCConnectTargetPlugsOutParams *outParams); + + virtual IOReturn disconnectTargetPlugs(IOFireWireAVCProtocolUserClient *userClient, + UInt32 sourceSubunitTypeAndID, + IOFWAVCPlugTypes sourcePlugType, + UInt32 sourcePlugNum, + UInt32 destSubunitTypeAndID, + IOFWAVCPlugTypes destPlugType, + UInt32 destPlugNum); + + virtual IOReturn getTargetPlugConnection(IOFireWireAVCProtocolUserClient *userClient, + AVCGetTargetPlugConnectionInParams *inParams, + AVCGetTargetPlugConnectionOutParams *outParams); + + virtual IOReturn findAVCRequestHandler(IOFireWireAVCProtocolUserClient *userClient, + UInt32 generation, + UInt16 nodeID, + IOFWSpeed speed, + UInt32 handlerSearchIndex, + const char *pCmdBuf, + UInt32 cmdLen); + + virtual void pcrModified(IOFWAVCPlugTypes plugType, + UInt32 plugNum, + UInt32 newValue); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCTargetSpace, 3); +}; + +#endif /*_IOKIT_IOFIREWIREAVCTARGETSPACE_H */ \ No newline at end of file diff --git a/i386/include/IOKit/avc/IOFireWireAVCUnit.h b/i386/include/IOKit/avc/IOFireWireAVCUnit.h new file mode 100644 index 0000000..0abf1cd --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWireAVCUnit.h @@ -0,0 +1,408 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREAVCUNIT_H +#define _IOKIT_IOFIREWIREAVCUNIT_H + +#include +#include +#include +#include +#include + +extern const OSSymbol *gIOAVCUnitType; + +class IOFireWireNub; +class IOFireWireAVCCommand; +class IOFireWirePCRSpace; +class IOFireWireAVCUnit; +class IOFireWireAVCSubUnit; +class IOFireWireAVCAsynchronousCommand; +class IOFireWireAVCNub; + +// The callback prototype for AVC Asynchronous Commands +typedef void (*IOFireWireAVCAsynchronousCommandCallback)(void *pRefCon, IOFireWireAVCAsynchronousCommand *pCommandObject); + +const UInt16 kIOFWAVCAsyncCmdFreed = 0xdead; + +/*! +@class IOFireWireAVCAsynchronousCommand +*/ +class IOFireWireAVCAsynchronousCommand : public IOCommand +{ + OSDeclareDefaultStructors(IOFireWireAVCAsynchronousCommand) + void free(void); + + friend class IOFireWireAVCUnit; + +protected: + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + IOReturn init(const UInt8 * command, UInt32 len, IOFireWireAVCAsynchronousCommandCallback completionCallback, void *pClientRefCon); + IOReturn submit(IOFireWireAVCNub *pAVCNub); + IOReturn cancel(void); + IOReturn reinit(const UInt8 * command, UInt32 cmdLen); + + // This function returns true if this command is currently waiting for a response + bool isPending(void); + + IOFWAVCAsyncCommandState cmdState; + void *pRefCon; + UInt8 *pCommandBuf; + UInt32 cmdLen; + UInt8 *pInterimResponseBuf; + UInt32 interimResponseLen; + UInt8 *pFinalResponseBuf; + UInt32 finalResponseLen; + +protected: + IOFireWireAVCAsynchronousCommandCallback fCallback; + IOFireWireAVCUnit *fAVCUnit; + IOMemoryDescriptor *fMem; + IOFWCommand *fWriteCmd; + IOFWDelayCommand *fDelayCmd; + UInt16 fWriteNodeID; + UInt32 fWriteGen; + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCAsynchronousCommand, 3); +}; + +/*! + @class IOFireWireAVCNub + @abstract nub for AVC devices +*/ +class IOFireWireAVCNub : public IOService +{ + OSDeclareDefaultStructors(IOFireWireAVCNub) + +protected: + IOFireWireNub * fDevice; + +public: + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen) = 0; + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen) = 0; + +/*! + @function getDevice + @abstract Returns the FireWire device nub that is this object's provider . +*/ + IOFireWireNub* getDevice() const + {return fDevice;}; + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout() = 0; + +private: + OSMetaClassDeclareReservedUsed(IOFireWireAVCNub, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCNub, 3); +}; + +/*! + @class IOFireWireAVCUnit + @abstract nub for AVC devices +*/ +class IOFireWireAVCUnit : public IOFireWireAVCNub +{ + OSDeclareDefaultStructors(IOFireWireAVCUnit) + + friend class IOFireWireAVCAsynchronousCommand; + +protected: + IOFWPseudoAddressSpace *fFCPResponseSpace; + IOLock *avcLock; + IOFireWireAVCCommand *fCommand; + + UInt8 fSubUnitCount[kAVCNumSubUnitTypes]; + + bool fStarted; + IOLock *cmdLock; + +/*! @struct ExpansionData + @discussion This structure is used to expand the capablilties of the class in a binary compatible way + */ + struct ExpansionData + { + OSArray * fAVCAsyncCommands; + IOFireWireController *fControl; + bool enableRobustAVCCommandResponseMatching; + }; + +/*! @var fIOFireWireAVCUnitExpansion + */ + ExpansionData *fIOFireWireAVCUnitExpansion; + + static UInt32 AVCResponse(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon requestRefcon); + + static void rescanSubUnits(void *arg); + + virtual void free(void); + + virtual void updateSubUnits(bool firstTime); + + static void AVCAsynchRequestWriteDone(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + static void AVCAsynchDelayDone(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +public: + // IOService overrides + virtual bool start(IOService *provider); + virtual IOReturn message(UInt32 type, IOService *provider, void *argument); + virtual IOReturn setProperties (OSObject * properties ); + +/*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); +/*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + +/*! + @function matchPropertyTable + @abstract Matching language support + Match on the following properties of the unit: + Vendor_ID + GUID + Unit_Type + and available sub-units, match if the device has at least the requested number of a sub-unit type: + AVCSubUnit_0 -> AVCSubUnit_1f +*/ + virtual bool matchPropertyTable(OSDictionary * table); + + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout(); + +protected: + UInt32 indexOfAVCAsynchronousCommandObject(IOFireWireAVCAsynchronousCommand *pCommandObject); + void removeAVCAsynchronousCommandObjectAtIndex(UInt32 index); + + void lockAVCAsynchronousCommandLock(); + + void unlockAVCAsynchronousCommandLock(); + + bool available(); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCUnit, 3); + +}; + +/*! + @class IOFireWireAVCSubUnit + @abstract nub for sub unit of AVC devices. Just for matching, calls the AVC unit for all functions. +*/ +class IOFireWireAVCSubUnit : public IOFireWireAVCNub +{ + OSDeclareDefaultStructors(IOFireWireAVCSubUnit) + + friend class IOFireWireAVCAsynchronousCommand; + +protected: + IOFireWireAVCUnit *fAVCUnit; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +public: + virtual bool init(OSDictionary *propTable, IOFireWireAVCUnit *provider); + + // IOService overrides + virtual IOReturn message(UInt32 type, IOService *provider, void *argument); + +/*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); +/*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + +/*! + @function matchPropertyTable + @abstract Matching language support + Match on the following properties of the sub unit: + Vendor_ID + GUID + SubUnit_Type +*/ + virtual bool matchPropertyTable(OSDictionary * table); + + // execute AVC command +/*! + @function AVCCommand + @abstract Sends an AVC command to the device and stores the response. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommand(const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function AVCCommandInGeneration + @abstract Sends an AVC command to the device and stores the response. The command must complete in the specified + FireWire bus generation otherwise kIOFireWireBusReset is returned. + @param generation The bus generation that the command must execute in. + @param command Pointer to command to send. + @param cmdLen Length of the command. + @param response Pointer to place to store the response. + @param responseLen Pointer to response length - initialize to the size of the buffer pointed to by response, + updated to the number of bytes returned by the device. +*/ + virtual IOReturn AVCCommandInGeneration(UInt32 generation, + const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen); + +/*! + @function updateAVCCommandTimeout + @abstract By default, AVCCommands timeout 10 seconds after receiving an Interim response. + This function resets the timeout of the current command to 10 seconds from the current time. + Call this repeatedly for AVC commands that take a very long time to execute to prevent premature + timeout. +*/ + virtual IOReturn updateAVCCommandTimeout(); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 1); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 2); + OSMetaClassDeclareReservedUnused(IOFireWireAVCSubUnit, 3); + +}; + +#endif // _IOKIT_IOFIREWIREAVCUNIT_H + diff --git a/i386/include/IOKit/avc/IOFireWireAVCUserClientCommon.h b/i386/include/IOKit/avc/IOFireWireAVCUserClientCommon.h new file mode 100644 index 0000000..cecf812 --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWireAVCUserClientCommon.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ +#define _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ + +#include + +#define kIOFireWireAVCLibConnection 13 + +enum IOFWAVCUserClientCommandCodes { + kIOFWAVCUserClientOpen, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientClose, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientOpenWithSessionRef, // kIOUCScalarIScalarO 1,0 + kIOFWAVCUserClientGetSessionRef, // kIOUCScalarIScalarO 0,1 + kIOFWAVCUserClientAVCCommand, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientAVCCommandInGen, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientUpdateAVCCommandTimeout, // kIOUCScalarIScalarO 0,0 + kIOFWAVCUserClientMakeP2PInputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientBreakP2PInputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientMakeP2POutputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientBreakP2POutputConnection, // KIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientCreateAsyncAVCCommand, // kIOUCStructIStructO -1,-1 + kIOFWAVCUserClientSubmitAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientCancelAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientReleaseAsyncAVCCommand, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCUserClientReinitAsyncAVCCommand, // // kIOUCScalarIStructI 1, -1 + kIOFWAVCUserClientNumCommands +}; + +enum IOFWAVCUserClientAsyncCommandCodes { + kIOFWAVCUserClientInstallAsyncAVCCommandCallback = kIOFWAVCUserClientNumCommands, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCUserClientNumAsyncCommands +}; + + +enum IOFWAVCProtocolUserClientCommandCodes { + kIOFWAVCProtocolUserClientSendAVCResponse, // kIOUCScalarIStructI 2, -1 + kIOFWAVCProtocolUserClientFreeInputPlug, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCProtocolUserClientReadInputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientUpdateInputPlug, // kIOUCScalarIScalarO 3, 0 + kIOFWAVCProtocolUserClientFreeOutputPlug, // kIOUCScalarIScalarO 1, 0 + kIOFWAVCProtocolUserClientReadOutputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientUpdateOutputPlug, // kIOUCScalarIScalarO 3, 0 + kIOFWAVCProtocolUserClientReadOutputMasterPlug, // kIOUCScalarIScalarO 0, 1 + kIOFWAVCProtocolUserClientUpdateOutputMasterPlug, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientReadInputMasterPlug, // kIOUCScalarIScalarO 0, 1 + kIOFWAVCProtocolUserClientUpdateInputMasterPlug, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientPublishAVCUnitDirectory, // kIOUCScalarIScalarO 0, 0 + kIOFWAVCProtocolUserClientSetSubunitPlugSignalFormat, // kIOUCScalarIScalarO 4, 0 + kIOFWAVCProtocolUserClientGetSubunitPlugSignalFormat, // kIOUCScalarIScalarO 3, 1 + kIOFWAVCProtocolUserClientConnectTargetPlugs, // kIOUCStructIStructO + kIOFWAVCProtocolUserClientDisconnectTargetPlugs, // kIOUCScalarIScalarO 6, 0 + kIOFWAVCProtocolUserClientGetTargetPlugConnection, // kIOUCStructIStructO + kIOFWAVCProtocolUserClientAVCRequestNotHandled, // kIOUCScalarIStructI 4, -1 + kIOFWAVCProtocolUserClientNumCommands +}; + +enum IOFWAVCProtocolUserClientAsyncCommandCodes { + kIOFWAVCProtocolUserClientSetAVCRequestCallback = kIOFWAVCProtocolUserClientNumCommands, // kIOUCScalarIScalarO 2, 0 + kIOFWAVCProtocolUserClientAllocateInputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientAllocateOutputPlug, // kIOUCScalarIScalarO 1, 1 + kIOFWAVCProtocolUserClientInstallAVCCommandHandler, // kIOUCScalarIScalarO 4, 0 + kIOFWAVCProtocolUserClientAddSubunit, // kIOUCScalarIScalarO 5, 1 + kIOFWAVCProtocolUserClientNumAsyncCommands +}; + +typedef struct _AVCConnectTargetPlugsInParams +{ + UInt32 sourceSubunitTypeAndID; + IOFWAVCPlugTypes sourcePlugType; + UInt32 sourcePlugNum; + UInt32 destSubunitTypeAndID; + IOFWAVCPlugTypes destPlugType; + UInt32 destPlugNum; + Boolean lockConnection; + Boolean permConnection; +}AVCConnectTargetPlugsInParams; + +typedef struct _AVCConnectTargetPlugsOutParams +{ + UInt32 sourcePlugNum; + UInt32 destPlugNum; +}AVCConnectTargetPlugsOutParams; + +typedef struct _AVCGetTargetPlugConnectionInParams +{ + UInt32 subunitTypeAndID; + IOFWAVCPlugTypes plugType; + UInt32 plugNum; +}AVCGetTargetPlugConnectionInParams; + +typedef struct _AVCGetTargetPlugConnectionOutParams +{ + UInt32 connectedSubunitTypeAndID; + IOFWAVCPlugTypes connectedPlugType; + UInt32 connectedPlugNum; + Boolean lockConnection; + Boolean permConnection; +}AVCGetTargetPlugConnectionOutParams; + +#define kAsyncCmdSharedBufInterimRespOffset 0 +#define kAsyncCmdSharedBufFinalRespOffset 512 + +#endif // _IOKIT_IOFIREWIREAVCUSERCLIENTCOMMON_H_ \ No newline at end of file diff --git a/i386/include/IOKit/avc/IOFireWirePCRSpace.h b/i386/include/IOKit/avc/IOFireWirePCRSpace.h new file mode 100644 index 0000000..9f31176 --- /dev/null +++ b/i386/include/IOKit/avc/IOFireWirePCRSpace.h @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWirePCRSpace.h + * + * Class to multiplex access to the PCR addresses. + */ +#ifndef _IOKIT_IOFIREWIREPCRSPACE_H +#define _IOKIT_IOFIREWIREPCRSPACE_H + +#include +#include + +/*! + @typedef IOFireWirePCRCallback + @abstract Callback called after a successful lock transaction to a plug. + @param refcon refcon supplied to the IOFireWireFCPSpace when a client is registered + @param nodeID is the node originating the request + @param plugNo is the plug number + @param oldVal is the value the plug used to contain + @param newVal is the quad written into the plug + + */ +typedef void (*IOFireWirePCRCallback)(void *refcon, UInt16 nodeID, UInt32 plug, UInt32 oldVal, UInt32 newVal); + +class IOFireWireBus; + +/*! + @class IOFireWirePCRSpace + @abstract object to multiplex users of the PCR plug registers +*/ +class IOFireWirePCRSpace : public IOFWPseudoAddressSpace +{ + OSDeclareDefaultStructors(IOFireWirePCRSpace) + +protected: + struct Client { + IOFireWirePCRCallback func; + void * refcon; + }; + UInt32 fBuf[64]; + + Client fClients[64]; + UInt32 fActivations; + IOFireWireAVCTargetSpace * fAVCTargetSpace; + IONotifier *fNotifier; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // Override to notify client of each plug seperately + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + virtual IOReturn allocatePlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug, Client* head); + virtual void freePlug(UInt32 plug, Client* head); + virtual UInt32 readPlug(UInt32 plug); + virtual IOReturn updatePlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); + +public: + + // Override to handle multiple activations (one per client) + virtual IOReturn activate(); + virtual void deactivate(); + +/*! + @function init + @abstract initializes the IOFireWirePCRSpace object +*/ + virtual bool init(IOFireWireBus *bus); +/*! + @function getPCRAddressSpace + @abstract returns the IOFireWirePCRSpace object for the given FireWire bus + @param bus The FireWire bus +*/ + static IOFireWirePCRSpace *getPCRAddressSpace(IOFireWireBus *bus); +/*! + @function allocateInputPlug + @abstract allocates an input plug. + @param refcon arbitrary value passed back as first argument of callback. + @param func callback function when a successful lock transaction to the plug has been performed + @param plug set to the plug number if a plug is successfully allocated +*/ + virtual IOReturn allocateInputPlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug); +/*! + @function freeInputPlug + @abstract deallocates an input plug. + @param plug value returned by allocateInputPlug. +*/ + virtual void freeInputPlug(UInt32 plug); +/*! + @function readInputPlug + @abstract returns the current value of an input plug. + @param plug value returned by allocateInputPlug. +*/ + virtual UInt32 readInputPlug(UInt32 plug); +/*! + @function updateInputPlug + @abstract updates the value of an input plug (simulating a lock transaction). + @param plug value returned by allocateInputPlug. + @param oldVal value returned by readInputPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateInputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); +/*! + @function allocateOutputPlug + @abstract allocates an output plug. + @param refcon arbitrary value passed back as first argument of callback. + @param func callback function when a successful lock transaction to the plug has been performed + @param plug set to the plug number if a plug is successfully allocated +*/ + virtual IOReturn allocateOutputPlug(void *refcon, IOFireWirePCRCallback func, UInt32 &plug); +/*! + @function freeOutputPlug + @abstract deallocates an output plug. + @param plug value returned by allocateOutputPlug. +*/ + virtual void freeOutputPlug(UInt32 plug); +/*! + @function readOutputPlug + @abstract returns the current value of an output plug. + @param plug value returned by allocateOutputPlug. +*/ + virtual UInt32 readOutputPlug(UInt32 plug); +/*! + @function updateOutputPlug + @abstract updates the value of an output plug (simulating a lock transaction). + @param plug value returned by allocateOutputPlug. + @param oldVal value returned by readOutputPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateOutputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal); +/*! + @function readOutputMasterPlug + @abstract returns the current value of the output master plug. +*/ + virtual UInt32 readOutputMasterPlug(); +/*! + @function updateOutputMasterPlug + @abstract updates the value of the master output plug (simulating a lock transaction). + @param oldVal value returned by readOutputMasterPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateOutputMasterPlug(UInt32 oldVal, UInt32 newVal); +/*! + @function readInputMasterPlug + @abstract returns the current value of the input master plug. +*/ + virtual UInt32 readInputMasterPlug(); +/*! + @function updateInputMasterPlug + @abstract updates the value of the master input plug (simulating a lock transaction). + @param oldVal value returned by readInputMasterPlug. + @param newVal new value to store in plug if it's current value is oldVal. +*/ + virtual IOReturn updateInputMasterPlug(UInt32 oldVal, UInt32 newVal); + + /*! + @function setAVCTargetSpacePointer + */ + virtual void setAVCTargetSpacePointer(IOFireWireAVCTargetSpace *pAVCTargetSpace); + + /*! + @function clearAllP2PConnections + */ + virtual void clearAllP2PConnections(void); + +private: + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 0); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 1); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 2); + OSMetaClassDeclareReservedUnused(IOFireWirePCRSpace, 3); + +}; + +#endif /* _IOKIT_IOFIREWIREPCRSPACE_H */ diff --git a/i386/include/IOKit/bluetooth/.svn/all-wcprops b/i386/include/IOKit/bluetooth/.svn/all-wcprops new file mode 100644 index 0000000..66ba2b1 --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/all-wcprops @@ -0,0 +1,53 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth +END +IOBluetoothHCIRequest.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/IOBluetoothHCIRequest.h +END +IOBluetoothInternal.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/IOBluetoothInternal.h +END +IOBluetoothHIDDriver.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/IOBluetoothHIDDriver.h +END +BluetoothAssignedNumbers.h +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/BluetoothAssignedNumbers.h +END +IOBluetoothTypes.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/IOBluetoothTypes.h +END +IOBluetoothHIDDriverTypes.h +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h +END +Bluetooth.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/Bluetooth.h +END +IOBluetoothHCIController.h +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/bluetooth/IOBluetoothHCIController.h +END diff --git a/i386/include/IOKit/bluetooth/.svn/entries b/i386/include/IOKit/bluetooth/.svn/entries new file mode 100644 index 0000000..40cdf90 --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/entries @@ -0,0 +1,300 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/bluetooth +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOBluetoothHCIRequest.h +file + + + + +2013-08-27T23:54:15.000000Z +e1a25f51bd3f36a958e5c26e819ef24a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6682 + +IOBluetoothInternal.h +file + + + + +2013-08-27T23:54:15.000000Z +a234f483168a05063ba7ed7f0bc9dcc3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4633 + +IOBluetoothHIDDriver.h +file + + + + +2013-08-27T23:54:15.000000Z +940e1316bdb74463db763650591df0ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9253 + +BluetoothAssignedNumbers.h +file + + + + +2013-08-27T23:54:15.000000Z +acbe857c3832758ac6d77e3bd78b4e63 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +28776 + +IOBluetoothTypes.h +file + + + + +2013-08-27T23:54:15.000000Z +f0f806bf0c41e50be2337b6b3eade713 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +846 + +IOBluetoothHIDDriverTypes.h +file + + + + +2013-08-27T23:54:15.000000Z +aa3f689a676e256e6a92258a11ae4159 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1867 + +Bluetooth.h +file + + + + +2013-08-27T23:54:15.000000Z +5cfa5d15f03115fb41f703536dd36550 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +80595 + +IOBluetoothHCIController.h +file + + + + +2013-08-27T23:54:15.000000Z +b99728bb051d3a61b8b3a7770c2adba6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +63281 + diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/Bluetooth.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/Bluetooth.h.svn-base new file mode 100644 index 0000000..6692b90 --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/Bluetooth.h.svn-base @@ -0,0 +1,2158 @@ +/* + File: Bluetooth.h + Contains: Public interfaces for Bluetooth technology. + Copyright: (c) 2002-2007 by Apple Inc. All rights reserved. +*/ + +#pragma once + +#ifdef KERNEL +#include +#else +#include +#include +#endif + +#include +#include + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @header Bluetooth + Bluetooth wireless technology +*/ + +#ifdef __cplusplus + extern "C" { +#endif + + +#if 0 + +#pragma mark === Baseband === +#endif + +//=========================================================================================================================== +// Baseband +//=========================================================================================================================== + +typedef UInt16 BluetoothConnectionHandle; // Upper 4 bits are reserved. +typedef uint8_t BluetoothLMPHandle; +enum +{ + kBluetoothConnectionHandleNone = 0xffff +}; + +typedef UInt8 BluetoothReasonCode; +typedef UInt8 BluetoothEncryptionEnable; +enum +{ + kBluetoothEncryptionEnableOff = 0x00, + kBluetoothEncryptionEnableOn = 0x01 +}; + +typedef UInt8 BluetoothKeyFlag; +enum +{ + kBluetoothKeyFlagSemiPermanent = 0x00, + kBluetoothKeyFlagTemporary = 0x01 +}; + +typedef UInt8 BluetoothKeyType; +enum +{ + kBluetoothKeyTypeCombination = 0x00, + kBluetoothKeyTypeLocalUnit = 0x01, + kBluetoothKeyTypeRemoteUnit = 0x02, + kBluetoothKeyTypeDebugCombination = 0x03, + kBluetoothKeyTypeUnauthenticatedCombination = 0x04, + kBluetoothKeyTypeAuthenticatedCombination = 0x05, + kBluetoothKeyTypeChangedCombination = 0x06, +}; + +// Packet types (Bluetooth spec section 7.1.5 - Create Connection) + +typedef UInt16 BluetoothPacketType; +enum +{ + kBluetoothPacketTypeReserved1 = 0x0001, + kBluetoothPacketType2DH1Omit = 0x0002, // Masks OUT this packet type + kBluetoothPacketType3DH1Omit = 0x0004, // Masks OUT this packet type + + kBluetoothPacketTypeDM1 = 0x0008, + kBluetoothPacketTypeDH1 = 0x0010, + kBluetoothPacketTypeHV1 = 0x0020, // Reserved + kBluetoothPacketTypeHV2 = 0x0040, // Reserved + kBluetoothPacketTypeHV3 = 0x0080, // Reserved + kBluetoothPacketTypeDV = 0x0100, // Reserved + kBluetoothPacketType2DH3Omit = 0x0100, // Masks OUT this packet type + kBluetoothPacketType3DH3Omit = 0x0200, // Masks OUT this packet type + kBluetoothPacketTypeAUX = 0x0200, // Deprecated + + kBluetoothPacketTypeDM3 = 0x0400, + kBluetoothPacketTypeDH3 = 0x0800, + + kBluetoothPacketType2DH5Omit = 0x1000, // Masks OUT this packet type + kBluetoothPacketType3DM5Omit = 0x2000, // Masks OUT this packet type + + kBluetoothPacketTypeDM5 = 0x4000, + kBluetoothPacketTypeDH5 = 0x8000, + + kBluetoothPacketTypeEnd +}; + +// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.1.26 - Setup Synchronous Command) + +enum +{ + kBluetoothSynchronousConnectionPacketTypeHV1 = 0x0001, + kBluetoothSynchronousConnectionPacketTypeHV2 = 0x0002, + kBluetoothSynchronousConnectionPacketTypeHV3 = 0x0004, + kBluetoothSynchronousConnectionPacketTypeEV3 = 0x0008, + kBluetoothSynchronousConnectionPacketTypeEV4 = 0x0010, + kBluetoothSynchronousConnectionPacketTypeEV5 = 0x0020, + + // masking out certain types: + + kBluetoothSynchronousConnectionPacketType2EV3Omit = 0x0040, + kBluetoothSynchronousConnectionPacketType3EV3Omit = 0x0080, + kBluetoothSynchronousConnectionPacketType2EV5Omit = 0x0100, + kBluetoothSynchronousConnectionPacketType3EV5Omit = 0x0200, + + kBluetoothSynchronousConnectionPacketTypeAll = 0xFFFF, + + kBluetoothSynchronousConnectionPacketTypeEnd +}; + + +// LAP/Inquiry Access Codes + +typedef UInt32 BluetoothLAP; +enum +{ + kBluetoothGeneralInquiryAccessCodeIndex = 0, // General/Unlimited Inquiry Access Code (GIAC) + kBluetoothGeneralInquiryAccessCodeLAPValue = 0x9E8B33, // General/Unlimited Inquiry Access Code (GIAC) + + kBluetoothLimitedInquiryAccessCodeIndex = 1, // Limited Dedicated Inquiry Access Code (LIAC) + kBluetoothLimitedInquiryAccessCodeLAPValue = 0x9E8B00, // Limited Dedicated Inquiry Access Code (LIAC) + + // All other access codes are reserved for future use (indices 2-63, LAP values 0x9E8B01-0x9E8B32 and 0x9E8B34-0x9E8B3F). + + kBluetoothLimitedInquiryAccessCodeEnd +}; + +// PageScanRepetitionMode + +typedef UInt8 BluetoothPageScanRepetitionMode; +enum +{ + kBluetoothPageScanRepetitionModeR0 = 0x00, + kBluetoothPageScanRepetitionModeR1 = 0x01, + kBluetoothPageScanRepetitionModeR2 = 0x02 + + // All other values are reserved for future use. +}; + +// PageScanPeriodMode + +typedef UInt8 BluetoothPageScanPeriodMode; +enum +{ + kBluetoothPageScanPeriodModeP0 = 0x00, + kBluetoothPageScanPeriodModeP1 = 0x01, + kBluetoothPageScanPeriodModeP2 = 0x02 + + // All other values are reserved for future use. +}; + +// PageScanMode + +typedef UInt8 BluetoothPageScanMode; +enum +{ + kBluetoothPageScanModeMandatory = 0x00, + kBluetoothPageScanModeOptional1 = 0x01, + kBluetoothPageScanModeOptional2 = 0x02, + kBluetoothPageScanModeOptional3 = 0x03 + + // All other values are reserved for future use. +}; + +#if 0 +#pragma mark - +#pragma mark === Devices === +#endif + +typedef struct BluetoothDeviceAddress BluetoothDeviceAddress; +struct BluetoothDeviceAddress +{ + UInt8 data[ 6 ]; +}; + +typedef struct BluetoothKey BluetoothKey; +struct BluetoothKey +{ + UInt8 data[ 16 ]; +}; + +typedef struct BluetoothPINCode BluetoothPINCode; +struct BluetoothPINCode +{ + UInt8 data[ 16 ]; // PIN codes may be up to 128 bits. +}; + + +// Physical layout of the "class of device/service" field (see Bluetooth Assigned Numbers section 1.2): +// +// 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 <- Bit Transmission Order +// +---------------+---------------+---------------+ +// | octet 3 | octet 2 | octet 1 | <- Octet Transmission Order +// +---------------+---------------+---------------+ +// <------ 11 bits ----->< 5 bits ><- 6 bits -> +// +---------------------+---------+-----------+-+-+ +// | Service Classes | Major | Minor | | | +// +-+-+-+-+-+-+-+-+-+-+-+ Device | Device |0|0| +// | | | | | | | |*|*|*| | Class | Class | | | +// +-+-+-+-+-+-+-+-+-+-+-+---------+-----------+-+-+ +// | | | | | | | | | +// | | | | | | | + Limited Discoverable +- Format Type +// | | | | | | +- Networking +// | | | | | +- Rendering +// | | | | +- Capturing +// | | | +- Object Transfer +// | | +- Audio +// | +- Telephony +// +- Information + +typedef UInt32 BluetoothClassOfDevice; + +#define BluetoothGetDeviceClassMajor( inCOD ) ( (inCOD & 0x00001F00) >> 8 ) +#define BluetoothGetDeviceClassMinor( inCOD ) ( (inCOD & 0x000000FC) >> 2 ) +#define BluetoothGetServiceClassMajor( inCOD ) ( (inCOD & 0x00FFE000) >> 13 ) +#define BluetoothMakeClassOfDevice( inServiceClassMajor, inDeviceClassMajor, inDeviceClassMinor ) \ + (((inServiceClassMajor << 13) & 0x00FFE000) | ((inDeviceClassMajor << 8) & 0x00001F00) | ((inDeviceClassMinor << 2) & 0x000000FC)) + +/// +/// Major Service Classes (11-bit value - bits 13-23 of Device/Service field) +/// + +typedef UInt32 BluetoothServiceClassMajor; +// Service Class Major enum in BluetoothAssignedNumbers.h + +/// +/// Major Device Classes (5-bit value - bits 8-12 of Device/Service field) +/// + +typedef UInt32 BluetoothDeviceClassMajor; +// Device Class Major enum in BluetoothAssignedNumbers.h + +/// +/// Minor Device Classes (6-bit value - bits 2-7 of Device/Service field) +/// + +typedef UInt32 BluetoothDeviceClassMinor; +// Device Class Minor enum in BluetoothAssignedNumbers.h + +// Misc Device Types + +enum +{ + kBluetoothDeviceNameMaxLength = 248 +}; +typedef UInt8 BluetoothDeviceName[ 256 ]; // Max 248 bytes of UTF-8 encoded Unicode. +typedef UInt16 BluetoothClockOffset; // Bits 14-0 come from bits 16-2 of CLKslav-CLKmaster. +typedef UInt8 BluetoothRole; // +typedef UInt8 BluetoothAllowRoleSwitch; // 0x00-0x01 valid, 0x02-0xFF reserved. +enum +{ + kBluetoothDontAllowRoleSwitch = 0x00, + kBluetoothAllowRoleSwitch = 0x01 +}; + +enum +{ + kBluetoothRoleBecomeMaster = 0x00, + kBluetoothRoleRemainSlave = 0x01 +}; + +typedef struct BluetoothSetEventMask BluetoothSetEventMask; +struct BluetoothSetEventMask +{ + UInt8 data[ 8 ]; +}; + +typedef UInt8 BluetoothPINType; + + +#if 0 +#pragma mark - +#pragma mark === L2CAP === +#endif + +//=========================================================================================================================== +// Logical Link Control and Adaptation Protocol (L2CAP) +//=========================================================================================================================== + + +// ACL Packet values (Bluetooth L2CAP spec section 1). + +enum +{ + kBluetoothL2CAPMaxPacketSize = 65535, // Max number of data bytes in an L2CAP packet. + + kBluetoothACLLogicalChannelReserved = 0, // [00] Reserved for future use + kBluetoothACLLogicalChannelL2CAPContinue = 1, // [01] Continuation of L2CAP packet. + kBluetoothACLLogicalChannelL2CAPStart = 2, // [10] Start of L2CAP packet. + kBluetoothACLLogicalChannelLMP = 3 // [11] Link Manager Protocol packet. +}; + +// Channel Identifiers (Bluetooth L2CAP spec section 2.1). + +typedef UInt16 BluetoothL2CAPChannelID; +enum +{ + kBluetoothL2CAPChannelNull = 0x0000, // Illegal, should not be used + kBluetoothL2CAPChannelSignalling = 0x0001, // L2CAP signalling channel + kBluetoothL2CAPChannelConnectionLessData = 0x0002, // L2CAP connection less data + kBluetoothL2CAPChannelAMPManagerProtocol = 0x0003, // AMP Manager Protocol + + // Range 0x0003 to 0x003F reserved for future use. + kBluetoothL2CAPChannelReservedStart = 0x0004, + kBluetoothL2CAPChannelReservedEnd = 0x003F, + + // Range 0x0040 to 0xFFFF are dynamically allocated. + kBluetoothL2CAPChannelDynamicStart = 0x0040, + kBluetoothL2CAPChannelDynamicEnd = 0xffff, + kBluetoothL2CAPChannelEnd = 0xffff +}; + +typedef BluetoothL2CAPChannelID BluetoothL2CAPGroupID; + +// Protocol/Service Multiplexor (PSM) values (Bluetooth L2CAP spec section 5.2). + +typedef UInt16 BluetoothL2CAPPSM; +// PSM enum in BluetoothAssignedNumbers.h + +// Command Codes + +typedef enum +{ + kBluetoothL2CAPCommandCodeReserved = 0x00, + kBluetoothL2CAPCommandCodeCommandReject = 0x01, + kBluetoothL2CAPCommandCodeConnectionRequest = 0x02, + kBluetoothL2CAPCommandCodeConnectionResponse = 0x03, + kBluetoothL2CAPCommandCodeConfigureRequest = 0x04, + kBluetoothL2CAPCommandCodeConfigureResponse = 0x05, + kBluetoothL2CAPCommandCodeDisconnectionRequest = 0x06, + kBluetoothL2CAPCommandCodeDisconnectionResponse = 0x07, + kBluetoothL2CAPCommandCodeEchoRequest = 0x08, + kBluetoothL2CAPCommandCodeEchoResponse = 0x09, + kBluetoothL2CAPCommandCodeInformationRequest = 0x0A, + kBluetoothL2CAPCommandCodeInformationResponse = 0x0B, + kBluetoothL2CAPCommandCodeCreateChannelRequest = 0x0C, + kBluetoothL2CAPCommandCodeCreateChannelResponse = 0x0D, + kBluetoothL2CAPCommandCodeMoveChannelRequest = 0x0E, + kBluetoothL2CAPCommandCodeMoveChannelResponse = 0x0F, + kBluetoothL2CAPCommandCodeMoveChannelConfirmation = 0x10, + kBluetoothL2CAPCommandCodeMoveChannelConfirmationResponse = 0x11, +} BluetoothL2CAPCommandCode; + +// Command Reject + +typedef enum +{ + kBluetoothL2CAPCommandRejectReasonCommandNotUnderstood = 0x0000, + kBluetoothL2CAPCommandRejectReasonSignallingMTUExceeded = 0x0001, + kBluetoothL2CAPCommandRejectReasonInvalidCIDInRequest = 0x0002, +} BluetoothL2CAPCommandRejectReason; + +typedef UInt16 BluetoothL2CAPMTU; +typedef UInt16 BluetoothL2CAPLinkTimeout; +typedef UInt16 BluetoothL2CAPFlushTimeout; +enum +{ + kBluetoothL2CAPFlushTimeoutUseExisting = 0x0000, + kBluetoothL2CAPFlushTimeoutImmediate = 0x0001, + kBluetoothL2CAPFlushTimeoutForever = 0xFFFF, + + kBluetoothL2CAPFlushTimeoutEnd +}; + +typedef struct BluetoothL2CAPQualityOfServiceOptions BluetoothL2CAPQualityOfServiceOptions; +struct BluetoothL2CAPQualityOfServiceOptions +{ + UInt8 flags; + UInt8 serviceType; + UInt32 tokenRate; + UInt32 tokenBucketSize; + UInt32 peakBandwidth; + UInt32 latency; + UInt32 delayVariation; +}; + +typedef struct BluetoothL2CAPRetransmissionAndFlowControlOptions BluetoothL2CAPRetransmissionAndFlowControlOptions; +struct BluetoothL2CAPRetransmissionAndFlowControlOptions +{ + UInt8 flags; + UInt8 txWindowSize; + UInt8 maxTransmit; + UInt16 retransmissionTimeout; + UInt16 monitorTimeout; + UInt16 maxPDUPayloadSize; +}; + +enum +{ + kBluetoothL2CAPInfoTypeMaxConnectionlessMTUSize = 0x0001 +}; + +// Packets + +enum +{ + kBluetoothL2CAPPacketHeaderSize = 4 +}; + +typedef UInt16 BluetoothL2CAPByteCount; +typedef UInt8 BluetoothL2CAPCommandID; +typedef UInt16 BluetoothL2CAPCommandByteCount; + +typedef enum +{ + kBluetoothL2CAPConnectionResultSuccessful = 0x0000, + kBluetoothL2CAPConnectionResultPending = 0x0001, + kBluetoothL2CAPConnectionResultRefusedPSMNotSupported = 0x0002, + kBluetoothL2CAPConnectionResultRefusedSecurityBlock = 0x0003, + kBluetoothL2CAPConnectionResultRefusedNoResources = 0x0004, +} BluetoothL2CAPConnectionResult; + +typedef enum +{ + kBluetoothL2CAPConnectionStatusNoInfoAvailable = 0x0000, + kBluetoothL2CAPConnectionStatusAuthenticationPending = 0x0001, + kBluetoothL2CAPConnectionStatusAuthorizationPending = 0x0002, +} BluetoothL2CAPConnectionStatus; + +typedef enum +{ + kBluetoothL2CAPConfigurationResultSuccess = 0x0000, + kBluetoothL2CAPConfigurationResultUnacceptableParams = 0x0001, + kBluetoothL2CAPConfigurationResultRejected = 0x0002, + kBluetoothL2CAPConfigurationResultUnknownOptions = 0x0003, +} BluetoothL2CAPConfigurationResult; + +typedef enum +{ + kBluetoothL2CAPConfigurationOptionMTU = 0x01, + kBluetoothL2CAPConfigurationOptionFlushTimeout = 0x02, + kBluetoothL2CAPConfigurationOptionQoS = 0x03, + kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControl = 0x04 +} BluetoothL2CAPConfigurationOption; + +enum +{ + kBluetoothL2CAPConfigurationOptionMTULength = 2, + kBluetoothL2CAPConfigurationOptionFlushTimeoutLength = 2, + kBluetoothL2CAPConfigurationOptionQoSLength = 22, + kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControlLength = 9 +}; + +typedef enum +{ + kBluetoothL2CAPConfigurationRetransmissionModeFlag = 0x01, + kBluetoothL2CAPConfigurationFlowControlModeFlag = 0x02, + kBluetoothL2CAPConfigurationBasicL2CAPModeFlag = 0x00, +} BluetoothL2CAPConfigurationRetransmissionAndFlowControlFlags; + + +typedef enum +{ + kBluetoothL2CAPInformationTypeConnectionlessMTU = 0x0001, + kBluetoothL2CAPInformationTypeExtendedFeatures = 0x0002, + kBluetoothL2CAPInformationTypeFixedChannelsSupported = 0x0003, +} BluetoothL2CAPInformationType; + +typedef enum +{ + kBluetoothL2CAPInformationResultSuccess = 0x0000, + kBluetoothL2CAPInformationResultNotSupported = 0x0001, +} BluetoothL2CAPInformationResult; + +typedef enum +{ + kBluetoothL2CAPInformationNoExtendedFeatures = 0x00000000, + kBluetoothL2CAPInformationFlowControlMode = 0x00000001, + kBluetoothL2CAPInformationRetransmissionMode = 0x00000002, + kBluetoothL2CAPInformationBidirectionalQoS = 0x00000004, + kBluetoothL2CAPInformationEnhancedRetransmissionMode = 0x00000008, + kBluetoothL2CAPInformationStreamingMode = 0x00000010, + kBluetoothL2CAPInformationFCSOption = 0x00000020, + kBluetoothL2CAPInformationExtendedFlowSpecification = 0x00000040, + kBluetoothL2CAPInformationFixedChannels = 0x00000080, + kBluetoothL2CAPInformationExtendedWindowSize = 0x00000100, + kBluetoothL2CAPUnicastConnectionlessDataReception = 0x00000200, +} BluetoothL2CAPInformationExtendedFeaturesMask; + +typedef enum +{ + kBluetoothL2CAPQoSTypeNoTraffic = 0x00, + kBluetoothL2CAPQoSTypeBestEffort = 0x01, + kBluetoothL2CAPQoSTypeGuaranteed = 0x02, +} BluetoothL2CAPQoSType; + +enum +{ + kBluetoothL2CAPMTUMinimum = 0x0030, // 48 bytes + kBluetoothL2CAPMTUDefault = 0x03F9, // 11.10.08 - dropped back to 1017 from 1021 (don't aggravate the 3DH5 problem between CSR<->BRCM just yet) + kBluetoothL2CAPMTUMaximum = 0xffff, + kBluetoothL2CAPMTUStart = 0x7fff, + kBluetoothL2CAPMTUSIG = 0x0030, // 48 bytes + kBluetoothL2CAPFlushTimeoutDefault = kBluetoothL2CAPFlushTimeoutForever, // 0xffff + kBluetoothL2CAPQoSFlagsDefault = 0, + kBluetoothL2CAPQoSTypeDefault = kBluetoothL2CAPQoSTypeBestEffort, // 0x01 + kBluetoothL2CAPQoSTokenRateDefault = 0x00000000, + kBluetoothL2CAPQoSTokenBucketSizeDefault = 0x00000000, + kBluetoothL2CAPQoSPeakBandwidthDefault = 0x00000000, + kBluetoothL2CAPQoSLatencyDefault = 0xffffffff, + kBluetoothL2CAPQoSDelayVariationDefault = 0xffffffff +}; + +#pragma mark === AMP Manager === +typedef enum { + kBluetoothAMPManagerCodeReserved = 0x00, + kBluetoothAMPManagerCodeAMPCommandReject = 0x01, + kBluetoothAMPManagerCodeAMPDiscoverRequest = 0x02, + kBluetoothAMPManagerCodeAMPDiscoverResponse = 0x03, + kBluetoothAMPManagerCodeAMPChangeNotify = 0x04, + kBluetoothAMPManagerCodeAMPChangeResponse = 0x05, + kBluetoothAMPManagerCodeAMPGetInfoRequest = 0x06, + kBluetoothAMPManagerCodeAMPGetInfoResponse = 0x07, + kBluetoothAMPManagerCodeAMPGetAssocRequest = 0x08, + kBluetoothAMPManagerCodeAMPGetAssocResponse = 0x09, + kBluetoothAMPManagerCodeAMPCreatePhysicalLinkRequest = 0x0A, + kBluetoothAMPManagerCodeAMPCreatePhysicalLinkResponse = 0x0B, + kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkRequest = 0x0C, + kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkResponse = 0x0D, +} BluetoothAMPManagerCode; + +typedef enum { + kBluetoothAMPManagerCommandRejectReasonCommandNotRecognized = 0x0000, +} BluetoothAMPCommandRejectReason; + +typedef enum { + kBluetoothAMPManagerDiscoverResponseControllerStatusPoweredDown = 0x00, + kBluetoothAMPManagerDiscoverResponseControllerStatusBluetoothOnly = 0x01, + kBluetoothAMPManagerDiscoverResponseControllerStatusNoCapacity = 0x02, + kBluetoothAMPManagerDiscoverResponseControllerStatusLowCapacity = 0x03, + kBluetoothAMPManagerDiscoverResponseControllerStatusMediumCapacity = 0x04, + kBluetoothAMPManagerDiscoverResponseControllerStatusHighCapacity = 0x05, + kBluetoothAMPManagerDiscoverResponseControllerStatusFullCapacity = 0x06, +} BluetoothAMPDiscoverResponseControllerStatus; + +typedef enum { + kBluetoothAMPManagerGetInfoResponseSuccess = 0x00, + kBluetoothAMPManagerGetInfoResponseInvalidControllerID = 0x01, +} BluetoothAMPGetInfoResponseStatus; + +typedef enum { + kBluetoothAMPManagerGetAssocResponseSuccess = 0x00, + kBluetoothAMPManagerGetAssocResponseInvalidControllerID = 0x01, +} BluetoothAMPGetAssocResponseStatus; + +typedef enum { + kBluetoothAMPManagerCreatePhysicalLinkResponseSuccess = 0x00, + kBluetoothAMPManagerCreatePhysicalLinkResponseInvalidControllerID = 0x01, + kBluetoothAMPManagerCreatePhysicalLinkResponseUnableToStartLinkCreation = 0x02, + kBluetoothAMPManagerCreatePhysicalLinkResponseCollisionOccurred = 0x03, + kBluetoothAMPManagerCreatePhysicalLinkResponseAMPDisconnectedPhysicalLinkRequestReceived = 0x04, + kBluetoothAMPManagerCreatePhysicalLinkResponsePhysicalLinkAlreadyExists = 0x05, + kBluetoothAMPManagerCreatePhysicalLinkResponseSecurityViolation = 0x06, +} BluetoothAMPCreatePhysicalLinkResponseStatus; + +typedef enum { + kBluetoothAMPManagerDisconnectPhysicalLinkResponseSuccess = 0x00, + kBluetoothAMPManagerDisconnectPhysicalLinkResponseInvalidControllerID = 0x01, + kBluetoothAMPManagerDisconnectPhysicalLinkResponseNoPhysicalLink = 0x02, +} BluetoothAMPDisconnectPhysicalLinkResponseStatus; + +#if 0 +#pragma mark - +#pragma mark === HCI === +#endif + +//=========================================================================================================================== +// Host Controller Interface (HCI) +//=========================================================================================================================== + +// HCI Command Packet +// ------------------ +// +// 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 +// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +// +--------------------------------+---------------+--------------+ +// | OpCode | | | +// +--------------------+-----------| Param Length | Params... | +// | OCF | OGF | | | +// +--------------------+-----------+---------------+--------------+ +// | | +// | Params... | +// | | +// +---------------------------------------------------------------+ + +// Commands + +typedef UInt8 BluetoothHCICommandOpCodeGroup; +typedef UInt16 BluetoothHCICommandOpCodeCommand; +typedef UInt16 BluetoothHCICommandOpCode; +typedef UInt32 BluetoothHCIVendorCommandSelector; + +#define BluetoothHCIMakeCommandOpCode( GROUP, CMD ) ( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) ) +#define BluetoothHCIMakeCommandOpCodeEndianSwap( GROUP, CMD ) ( CFSwapInt16HostToLittle ( BluetoothHCIMakeCommandOpCode( GROUP, CMD ) ) ) +#define BluetoothHCIExtractCommandOpCodeGroup( OPCODE ) ( ( ( OPCODE ) >> 10 ) & 0x003F ) +#define BluetoothHCIExtractCommandOpCodeCommand( OPCODE ) ( ( OPCODE ) & 0x03FF ) + +#define BluetoothHCIMakeCommandOpCodeHostOrder(GROUP, CMD ) OSSwapLittleToHostConstInt16( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) ) + + +enum +{ + // Command Group: NoOp + + kBluetoothHCIOpCodeNoOp = 0, + kBluetoothHCICommandGroupNoOp = 0x00, + kBluetoothHCICommandNoOp = 0x0000, + + // Command Group: Link Control + + kBluetoothHCICommandGroupLinkControl = 0x01, + kBluetoothHCICommandInquiry = 0x0001, + kBluetoothHCICommandInquiryCancel = 0x0002, + kBluetoothHCICommandPeriodicInquiryMode = 0x0003, + kBluetoothHCICommandExitPeriodicInquiryMode = 0x0004, + kBluetoothHCICommandCreateConnection = 0x0005, + kBluetoothHCICommandDisconnect = 0x0006, + kBluetoothHCICommandAddSCOConnection = 0x0007, + kBluetoothHCICommandCreateConnectionCancel = 0x0008, + kBluetoothHCICommandAcceptConnectionRequest = 0x0009, + kBluetoothHCICommandRejectConnectionRequest = 0x000A, + kBluetoothHCICommandLinkKeyRequestReply = 0x000B, + kBluetoothHCICommandLinkKeyRequestNegativeReply = 0x000C, + kBluetoothHCICommandPINCodeRequestReply = 0x000D, + kBluetoothHCICommandPINCodeRequestNegativeReply = 0x000E, + kBluetoothHCICommandChangeConnectionPacketType = 0x000F, + kBluetoothHCICommandAuthenticationRequested = 0x0011, + kBluetoothHCICommandSetConnectionEncryption = 0x0013, + kBluetoothHCICommandChangeConnectionLinkKey = 0x0015, + kBluetoothHCICommandMasterLinkKey = 0x0017, + kBluetoothHCICommandRemoteNameRequest = 0x0019, + kBluetoothHCICommandReadRemoteSupportedFeatures = 0x001B, + kBluetoothHCICommandReadRemoteExtendedFeatures = 0x001C, + kBluetoothHCICommandReadRemoteVersionInformation = 0x001D, + kBluetoothHCICommandReadClockOffset = 0x001F, + kBluetoothHCICommandRemoteNameRequestCancel = 0x001A, + kBluetoothHCICommandReadLMPHandle = 0x0020, + kBluetoothHCICommandSetupSynchronousConnection = 0x0028, + kBluetoothHCICommandAcceptSynchronousConnectionRequest = 0x0029, + kBluetoothHCICommandRejectSynchronousConnectionRequest = 0x002A, + kBluetoothHCICommandIOCapabilityRequestReply = 0x002B, + kBluetoothHCICommandUserConfirmationRequestReply = 0x002C, + kBluetoothHCICommandUserConfirmationRequestNegativeReply = 0x002D, + kBluetoothHCICommandUserPasskeyRequestReply = 0x002E, + kBluetoothHCICommandUserPasskeyRequestNegativeReply = 0x002F, + kBluetoothHCICommandRemoteOOBDataRequestReply = 0x0030, + kBluetoothHCICommandRemoteOOBDataRequestNegativeReply = 0x0033, + + // Command Group: Link Policy + + kBluetoothHCICommandGroupLinkPolicy = 0x02, + kBluetoothHCICommandHoldMode = 0x0001, + kBluetoothHCICommandSniffMode = 0x0003, + kBluetoothHCICommandExitSniffMode = 0x0004, + kBluetoothHCICommandParkMode = 0x0005, + kBluetoothHCICommandExitParkMode = 0x0006, + kBluetoothHCICommandQoSSetup = 0x0007, + kBluetoothHCICommandRoleDiscovery = 0x0009, + kBluetoothHCICommandSwitchRole = 0x000B, + kBluetoothHCICommandReadLinkPolicySettings = 0x000C, + kBluetoothHCICommandWriteLinkPolicySettings = 0x000D, + kBluetoothHCICommandReadDefaultLinkPolicySettings = 0x000E, + kBluetoothHCICommandWriteDefaultLinkPolicySettings = 0x000F, + kBluetoothHCICommandFlowSpecification = 0x0010, + kBluetoothHCICommandSniffSubrating = 0x0011, + kBluetoothHCICommandAcceptSniffRequest = 0x0031, + kBluetoothHCICommandRejectSniffRequest = 0x0032, + + // Command Group: Host Controller & Baseband + + kBluetoothHCICommandGroupHostController = 0x03, + kBluetoothHCICommandSetEventMask = 0x0001, + kBluetoothHCICommandReset = 0x0003, + kBluetoothHCICommandSetEventFilter = 0x0005, + kBluetoothHCICommandFlush = 0x0008, + kBluetoothHCICommandReadPINType = 0x0009, + kBluetoothHCICommandWritePINType = 0x000A, + kBluetoothHCICommandCreateNewUnitKey = 0x000B, + kBluetoothHCICommandReadStoredLinkKey = 0x000D, + kBluetoothHCICommandWriteStoredLinkKey = 0x0011, + kBluetoothHCICommandDeleteStoredLinkKey = 0x0012, + kBluetoothHCICommandChangeLocalName = 0x0013, + kBluetoothHCICommandReadLocalName = 0x0014, + kBluetoothHCICommandReadConnectionAcceptTimeout = 0x0015, + kBluetoothHCICommandWriteConnectionAcceptTimeout = 0x0016, + kBluetoothHCICommandReadPageTimeout = 0x0017, + kBluetoothHCICommandWritePageTimeout = 0x0018, + kBluetoothHCICommandReadScanEnable = 0x0019, + kBluetoothHCICommandWriteScanEnable = 0x001A, + kBluetoothHCICommandReadPageScanActivity = 0x001B, + kBluetoothHCICommandWritePageScanActivity = 0x001C, + kBluetoothHCICommandReadInquiryScanActivity = 0x001D, + kBluetoothHCICommandWriteInquiryScanActivity = 0x001E, + kBluetoothHCICommandReadAuthenticationEnable = 0x001F, + kBluetoothHCICommandWriteAuthenticationEnable = 0x0020, + kBluetoothHCICommandReadEncryptionMode = 0x0021, + kBluetoothHCICommandWriteEncryptionMode = 0x0022, + kBluetoothHCICommandReadClassOfDevice = 0x0023, + kBluetoothHCICommandWriteClassOfDevice = 0x0024, + kBluetoothHCICommandReadVoiceSetting = 0x0025, + kBluetoothHCICommandWriteVoiceSetting = 0x0026, + kBluetoothHCICommandReadAutomaticFlushTimeout = 0x0027, + kBluetoothHCICommandWriteAutomaticFlushTimeout = 0x0028, + kBluetoothHCICommandReadNumberOfBroadcastRetransmissions = 0x0029, + kBluetoothHCICommandWriteNumberOfBroadcastRetransmissions = 0x002A, + kBluetoothHCICommandReadHoldModeActivity = 0x002B, + kBluetoothHCICommandWriteHoldModeActivity = 0x002C, + kBluetoothHCICommandReadTransmitPowerLevel = 0x002D, + kBluetoothHCICommandReadSCOFlowControlEnable = 0x002E, + kBluetoothHCICommandWriteSCOFlowControlEnable = 0x002F, + kBluetoothHCICommandSetHostControllerToHostFlowControl = 0x0031, + kBluetoothHCICommandHostBufferSize = 0x0033, + kBluetoothHCICommandHostNumberOfCompletedPackets = 0x0035, + kBluetoothHCICommandReadLinkSupervisionTimeout = 0x0036, + kBluetoothHCICommandWriteLinkSupervisionTimeout = 0x0037, + kBluetoothHCICommandReadNumberOfSupportedIAC = 0x0038, + kBluetoothHCICommandReadCurrentIACLAP = 0x0039, + kBluetoothHCICommandWriteCurrentIACLAP = 0x003A, + kBluetoothHCICommandReadPageScanPeriodMode = 0x003B, + kBluetoothHCICommandWritePageScanPeriodMode = 0x003C, + kBluetoothHCICommandReadPageScanMode = 0x003D, + kBluetoothHCICommandWritePageScanMode = 0x003E, + kBluetoothHCICommandSetAFHClassification = 0x003F, + kBluetoothHCICommandReadInquiryScanType = 0x0042, + kBluetoothHCICommandWriteInquiryScanType = 0x0043, + kBluetoothHCICommandReadInquiryMode = 0x0044, + kBluetoothHCICommandWriteInquiryMode = 0x0045, + kBluetoothHCICommandReadPageScanType = 0x0046, + kBluetoothHCICommandWritePageScanType = 0x0047, + kBluetoothHCICommandReadAFHChannelAssessmentMode = 0x0048, + kBluetoothHCICommandWriteAFHChannelAssessmentMode = 0x0049, + kBluetoothHCICommandReadExtendedInquiryResponse = 0x0051, + kBluetoothHCICommandWriteExtendedInquiryResponse = 0x0052, + kBluetoothHCICommandReadSimplePairingMode = 0x0055, + kBluetoothHCICommandWriteSimplePairingMode = 0x0056, + kBluetoothHCICommandReadLocalOOBData = 0x0057, + kBluetoothHCICommandReadInquiryResponseTransmitPower = 0x0058, + kBluetoothHCICommandWriteInquiryResponseTransmitPower = 0x0059, + kBluetoothHCICommandReadDefaultErroneousDataReporting = 0x005A, + kBluetoothHCICommandWriteDefaultErroneousDataReporting = 0x005B, + kBluetoothHCICommandReadPersistentSniffInterval = 0x005C, + kBluetoothHCICommandWritePersistentSniffInterval = 0x005D, + kBluetoothHCICommandDeletePersistentSniffInterval = 0x005E, + kBluetoothHCICommandEnhancedFlush = 0x005F, + kBluetoothHCICommandSendKeypressNotification = 0x0060, + + // Command Group: Informational + + kBluetoothHCICommandGroupInformational = 0x04, + kBluetoothHCICommandReadLocalVersionInformation = 0x0001, + kBluetoothHCICommandReadLocalSupportedCommands = 0x0002, + kBluetoothHCICommandReadLocalSupportedFeatures = 0x0003, + kBluetoothHCICommandReadLocalExtendedFeatures = 0x0004, + kBluetoothHCICommandReadBufferSize = 0x0005, + kBluetoothHCICommandReadCountryCode = 0x0007, + kBluetoothHCICommandReadDeviceAddress = 0x0009, + + // Command Group: Status + + kBluetoothHCICommandGroupStatus = 0x05, + kBluetoothHCICommandReadFailedContactCounter = 0x0001, + kBluetoothHCICommandResetFailedContactCounter = 0x0002, + kBluetoothHCICommandGetLinkQuality = 0x0003, + kBluetoothHCICommandReadRSSI = 0x0005, + kBluetoothHCICommandReadAFHMappings = 0x0006, + kBluetoothHCICommandReadClock = 0x0007, + + // Command Group: Testing + + kBluetoothHCICommandGroupTesting = 0x06, + kBluetoothHCICommandReadLoopbackMode = 0x0001, + kBluetoothHCICommandWriteLoopbackMode = 0x0002, + kBluetoothHCICommandEnableDeviceUnderTestMode = 0x0003, + kBluetoothHCICommandWriteSimplePairingDebugMode = 0x0004, + + // Command Group: Logo Testing (no commands yet) + + kBluetoothHCICommandGroupLogoTesting = 0x3E, + + // Command Group: Vendor Specific (from Broadcom HCI Programmer's Reference Guide) + + kBluetoothHCICommandGroupVendorSpecific = 0x3f, + kBluetoothHCICommandWriteDeviceAddress = 0x0001, + kBluetoothHCICommandWriteHoppingChannels = 0x0012, + kBluetoothHCICommandInvalidateFlashAndReboot = 0x0017, + kBluetoothHCICommandSetMaxPower = 0x0026, + kBluetoothHCICommandEnableHIDEmulation = 0x003B, + kBluetoothHCICommandEnableRadio = 0x0034, + kBluetoothHCIGetHIDDeviceList = 0x0036, + kBluetoothHCIAddHIDDevice = 0x0037, + kBluetoothHCIRemoveHIDDevice = 0x0039, + + kBluetoothHCICommandGroupMax = 0x40, + kBluetoothHCICommandMax = 0x03FF +}; + +// HCI Data Types + +typedef UInt8 BluetoothHCIQoSFlags; +typedef UInt8 BluetoothHCIParamByteCount; +typedef UInt16 BluetoothHCIACLDataByteCount; +typedef UInt8 BluetoothHCISCODataByteCount; +typedef UInt8 BluetoothHCIInquiryLength; +typedef UInt8 BluetoothHCIResponseCount; +typedef UInt8 BluetoothHCICountryCode; +typedef UInt16 BluetoothHCIModeInterval; +typedef UInt16 BluetoothHCISniffAttemptCount; +typedef UInt16 BluetoothHCISniffTimeout; +typedef UInt16 BluetoothHCIParkModeBeaconInterval; + +typedef UInt8 BluetoothMaxSlots; +typedef UInt16 BluetoothManufacturerName; +typedef UInt8 BluetoothLMPVersion; +typedef UInt16 BluetoothLMPSubversion; + +typedef UInt8 BluetoothHCIConnectionMode; +enum BluetoothHCIConnectionModes +{ + kConnectionActiveMode = 0, + kConnectionHoldMode = 1, + kConnectionSniffMode = 2, + kConnectionParkMode = 3, + kConnectionModeReservedForFutureUse = 4, +}; + +typedef struct BluetoothHCISupportedFeatures BluetoothHCISupportedFeatures; +struct BluetoothHCISupportedFeatures +{ + UInt8 data[8]; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 +typedef UInt8 BluetoothHCIPageNumber; +typedef struct BluetoothHCIExtendedFeaturesInfo BluetoothHCIExtendedFeaturesInfo; +struct BluetoothHCIExtendedFeaturesInfo +{ + BluetoothHCIPageNumber page; + BluetoothHCIPageNumber maxPage; + UInt8 data[8]; +}; +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + +enum BluetoothFeatureBits +{ + // Byte 0 of the support features data structure. + + kBluetoothFeatureThreeSlotPackets = (1 << 0L), + kBluetoothFeatureFiveSlotPackets = (1 << 1L), + kBluetoothFeatureEncryption = (1 << 2L), + kBluetoothFeatureSlotOffset = (1 << 3L), + kBluetoothFeatureTimingAccuracy = (1 << 4L), + kBluetoothFeatureSwitchRoles = (1 << 5L), + kBluetoothFeatureHoldMode = (1 << 6L), + kBluetoothFeatureSniffMode = (1 << 7L), + + // Byte 1 of the support features data structure. + + kBluetoothFeatureParkMode = (1 << 0L), + kBluetoothFeatureRSSI = (1 << 1L), + kBluetoothFeaturePowerControlRequests = (1 << 1L), + kBluetoothFeatureChannelQuality = (1 << 2L), + kBluetoothFeatureSCOLink = (1 << 3L), + kBluetoothFeatureHV2Packets = (1 << 4L), + kBluetoothFeatureHV3Packets = (1 << 5L), + kBluetoothFeatureULawLog = (1 << 6L), + kBluetoothFeatureALawLog = (1 << 7L), + + // Byte 2 of the support features data structure. + + kBluetoothFeatureCVSD = (1 << 0L), + kBluetoothFeaturePagingScheme = (1 << 1L), + kBluetoothFeaturePowerControl = (1 << 2L), + kBluetoothFeatureTransparentSCOData = (1 << 3L), + kBluetoothFeatureFlowControlLagBit0 = (1 << 4L), + kBluetoothFeatureFlowControlLagBit1 = (1 << 5L), + kBluetoothFeatureFlowControlLagBit2 = (1 << 6L), + kBluetoothFeatureBroadcastEncryption = (1 << 7L), + + // Byte 3 of the support features data structure. + + kBluetoothFeatureScatterMode = (1 << 0L), + kBluetoothFeatureEnhancedDataRateACL2MbpsMode = (1 << 1L), + kBluetoothFeatureEnhancedDataRateACL3MbpsMode = (1 << 2L), + kBluetoothFeatureEnhancedInquiryScan = (1 << 3L), + kBluetoothFeatureInterlacedInquiryScan = (1 << 4L), + kBluetoothFeatureInterlacedPageScan = (1 << 5L), + kBluetoothFeatureRSSIWithInquiryResult = (1 << 6L), + kBluetoothFeatureExtendedSCOLink = (1 << 7L), + + // Byte 4 of the support features data structure. + + kBluetoothFeatureEV4Packets = (1 << 0L), + kBluetoothFeatureEV5Packets = (1 << 1L), + kBluetoothFeatureAbsenceMasks = (1 << 2L), + kBluetoothFeatureAFHCapableSlave = (1 << 3L), + kBluetoothFeatureAFHClassificationSlave = (1 << 4L), + kBluetoothFeatureAliasAuhentication = (1 << 5L), + kBluetoothFeatureAnonymityMode = (1 << 6L), + kBluetoothFeature3SlotEnhancedDataRateACLPackets = (1 << 7L), + + // Byte 5 of the support features data structure. + + kBluetoothFeature5SlotEnhancedDataRateACLPackets = (1 << 0L), // 2.0 version of this header had this at the wrong bit location + kBluetoothFeatureSniffSubrating = (1 << 1L), + kBluetoothFeaturePauseEncryption = (1 << 2L), + kBluetoothFeatureAFHCapableMaster = (1 << 3L), + kBluetoothFeatureAFHClassificationMaster = (1 << 4L), + kBluetoothFeatureEnhancedDataRateeSCO2MbpsMode = (1 << 5L), + kBluetoothFeatureEnhancedDataRateeSCO3MbpsMode = (1 << 6L), + kBluetoothFeature3SlotEnhancedDataRateeSCOPackets = (1 << 7L), + + // Byte 6 of the support features data structure. + + kBluetoothFeatureExtendedInquiryResponse = (1 << 0L), + kBluetoothFeatureSecureSimplePairing = (1 << 3L), + kBluetoothFeatureEncapsulatedPDU = (1 << 4L), + kBluetoothFeatureErroneousDataReporting = (1 << 5L), + kBluetoothFeatureNonFlushablePacketBoundaryFlag = (1 << 6L), + + // Byte 7 of the support features data structure. + + kBluetoothFeatureLinkSupervisionTimeoutChangedEvent = (1 << 0L), + kBluetoothFeatureInquiryTransmissionPowerLevel = (1 << 1L), + kBluetoothFeatureExtendedFeatures = (1 << 7L), + + // Byte 8 of the support features data structure (extended) + + kBluetoothFeatureSimpleSecurePairingHostMode = (1 << 0L), + +}; + +typedef UInt16 BluetoothHCIFailedContactCount; +typedef struct BluetoothHCIFailedContactInfo BluetoothHCIFailedContactInfo; +struct BluetoothHCIFailedContactInfo +{ + BluetoothHCIFailedContactCount count; + BluetoothConnectionHandle handle; +}; + +typedef SInt8 BluetoothHCIRSSIValue; /* Valid Range: -127 to +20 */ +typedef struct BluetoothHCIRSSIInfo BluetoothHCIRSSIInfo; +struct BluetoothHCIRSSIInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIRSSIValue RSSIValue; +}; + +typedef UInt8 BluetoothHCILinkQuality; +typedef struct BluetoothHCILinkQualityInfo BluetoothHCILinkQualityInfo; +struct BluetoothHCILinkQualityInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCILinkQuality qualityValue; +}; + +typedef UInt8 BluetoothHCIRole; +typedef struct BluetoothHCIRoleInfo BluetoothHCIRoleInfo; +struct BluetoothHCIRoleInfo +{ + UInt8 role; + BluetoothConnectionHandle handle; +}; + +enum BluetoothHCIRoles +{ + kBluetoothHCIMasterRole = 0x00, + kBluetoothHCISlaveRole = 0x01 +}; + +typedef UInt16 BluetoothHCILinkPolicySettings; +enum BluetoothHCILinkPolicySettingsValues +{ + kDisableAllLMModes = 0x0000, + kEnableMasterSlaveSwitch = 0x0001, + kEnableHoldMode = 0x0002, + kEnableSniffMode = 0x0004, + kEnableParkMode = 0x0008, + kReservedForFutureUse = 0x0010 +}; + +typedef struct BluetoothHCILinkPolicySettingsInfo BluetoothHCILinkPolicySettingsInfo; +struct BluetoothHCILinkPolicySettingsInfo +{ + BluetoothHCILinkPolicySettings settings; + BluetoothConnectionHandle handle; +}; + + +typedef struct BluetoothHCIQualityOfServiceSetupParams BluetoothHCIQualityOfServiceSetupParams; +struct BluetoothHCIQualityOfServiceSetupParams +{ + UInt8 flags; + UInt8 serviceType; + UInt32 tokenRate; + UInt32 peakBandwidth; + UInt32 latency; + UInt32 delayVariation; +}; + +typedef UInt8 BluetoothHCILoopbackMode; +enum +{ + kBluetoothHCILoopbackModeOff = 0x00, + kBluetoothHCILoopbackModeLocal = 0x01, + kBluetoothHCILoopbackModeRemote = 0x02 +}; + +typedef UInt32 BluetoothHCIOperationID; +typedef UInt32 BluetoothHCIEventID; +typedef UInt32 BluetoothHCIDataID; +typedef UInt32 BluetoothHCISignalID; +typedef UInt32 BluetoothHCITransportID; +typedef UInt32 BluetoothHCITransportCommandID; +typedef UInt32 BluetoothHCIRequestID; + + +// Version Information + +typedef struct BluetoothHCIVersionInfo BluetoothHCIVersionInfo; +struct BluetoothHCIVersionInfo +{ + // Local & Remote information + + BluetoothManufacturerName manufacturerName; + BluetoothLMPVersion lmpVersion; + BluetoothLMPSubversion lmpSubVersion; + + // Local information only + + UInt8 hciVersion; + UInt16 hciRevision; +}; + +// HCI buffer sizes. + +typedef struct BluetoothHCIBufferSize BluetoothHCIBufferSize; +struct BluetoothHCIBufferSize +{ + UInt16 ACLDataPacketLength; + UInt8 SCODataPacketLength; + UInt16 totalNumACLDataPackets; + UInt16 totalNumSCODataPackets; +}; + +// Timeouts +typedef UInt16 BluetoothHCIConnectionAcceptTimeout; +typedef UInt16 BluetoothHCIPageTimeout; +enum BluetoothHCITimeoutValues +{ + kDefaultPageTimeout = 0x2000, +}; + +#define BluetoothGetSlotsFromSeconds( inSeconds ) ( (inSeconds/.000625 ) ) + + +// Link Keys +typedef UInt16 BluetoothHCINumLinkKeysDeleted; +typedef UInt8 BluetoothHCINumLinkKeysToWrite; +typedef UInt8 BluetoothHCIDeleteStoredLinkKeyFlag; +enum BluetoothHCIDeleteStoredLinkKeyFlags +{ + kDeleteKeyForSpecifiedDeviceOnly = 0x00, + kDeleteAllStoredLinkKeys = 0x01, +}; + +typedef UInt8 BluetoothHCIReadStoredLinkKeysFlag; +enum BluetoothHCIReadStoredLinkKeysFlags +{ + kReturnLinkKeyForSpecifiedDeviceOnly = 0x00, + kReadAllStoredLinkKeys = 0x01, +}; + +typedef struct BluetoothHCIStoredLinkKeysInfo BluetoothHCIStoredLinkKeysInfo; +struct BluetoothHCIStoredLinkKeysInfo +{ + UInt16 numLinkKeysRead; + UInt16 maxNumLinkKeysAllowedInDevice; +}; + + +// Page Scan + +typedef UInt8 BluetoothHCIPageScanMode; +enum BluetoothHCIPageScanModes +{ + kMandatoryPageScanMode = 0x00, + kOptionalPageScanMode1 = 0x01, + kOptionalPageScanMode2 = 0x02, + kOptionalPageScanMode3 = 0x03, +}; + +typedef UInt8 BluetoothHCIPageScanPeriodMode; +enum BluetoothHCIPageScanPeriodModes +{ + kP0Mode = 0x00, + kP1Mode = 0x01, + kP2Mode = 0x02, +}; + +typedef UInt8 BluetoothHCIPageScanEnableState; +enum BluetoothHCIPageScanEnableStates +{ + kNoScansEnabled = 0x00, + kInquiryScanEnabledPageScanDisabled = 0x01, + kInquiryScanDisabledPageScanEnabled = 0x02, + kInquiryScanEnabledPageScanEnabled = 0x03, +}; + +typedef struct BluetoothHCIScanActivity BluetoothHCIScanActivity; +struct BluetoothHCIScanActivity +{ + UInt16 scanInterval; + UInt16 scanWindow; +}; + +typedef struct BluetoothHCIInquiryAccessCode BluetoothHCIInquiryAccessCode; +struct BluetoothHCIInquiryAccessCode +{ + UInt8 data[3]; +}; + +typedef UInt8 BluetoothHCIInquiryAccessCodeCount; +typedef struct BluetoothHCICurrentInquiryAccessCodes BluetoothHCICurrentInquiryAccessCodes; +struct BluetoothHCICurrentInquiryAccessCodes +{ + BluetoothHCIInquiryAccessCodeCount count; // Number of codes in array. + BluetoothHCIInquiryAccessCode * codes; // Ptr to array of codes. +}; + +typedef struct BluetoothHCILinkSupervisionTimeout BluetoothHCILinkSupervisionTimeout; +struct BluetoothHCILinkSupervisionTimeout +{ + BluetoothConnectionHandle handle; + UInt16 timeout; +}; + +typedef UInt8 BluetoothHCIFlowControlState; +enum BluetoothHCISCOFlowControlStates +{ + kSCOFlowControlDisabled = 0x00, + kSCOFlowControlEnabled = 0x01 +}; + +enum BluetoothHCIGeneralFlowControlStates +{ + kHostControllerToHostFlowControlOff = 0x00, + kHCIACLDataPacketsOnHCISCODataPacketsOff = 0x01, + kHCIACLDataPacketsOffHCISCODataPacketsOn = 0x02, + kHCIACLDataPacketsOnHCISCODataPacketsOn = 0x03, +}; + +typedef SInt8 BluetoothHCITransmitPowerLevel; +typedef UInt8 BluetoothHCITransmitPowerLevelType; +enum BluetoothHCITransmitReadPowerLevelTypes +{ + kReadCurrentTransmitPowerLevel = 0x00, + kReadMaximumTransmitPowerLevel = 0x01, +}; + +typedef UInt8 BluetoothHCIAFHChannelAssessmentMode; +enum BluetoothHCIAFHChannelAssessmentModes +{ + kAFHChannelAssessmentModeDisabled = 0x00, + kAFHChannelAssessmentModeEnabled = 0x01 +}; + + +typedef struct BluetoothHCITransmitPowerLevelInfo BluetoothHCITransmitPowerLevelInfo; +struct BluetoothHCITransmitPowerLevelInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCITransmitPowerLevel level; // Range: -70 <= N <= 20 (units are dBm) +}; + +typedef UInt8 BluetoothHCINumBroadcastRetransmissions; +typedef UInt8 BluetoothHCIHoldModeActivity; +enum BluetoothHCIHoldModeActivityStates +{ + kMaintainCurrentPowerState = 0x00, + kSuspendPageScan = 0x01, + kSuspendInquiryScan = 0x02, + kSuspendPeriodicInquiries = 0x03, +}; + +typedef UInt8 BluetoothHCIAuthenticationEnable; +enum BluetoothHCIAuthentionEnableModes +{ + kAuthenticationDisabled = 0x00, + kAuthenticationEnabled = 0x01, +}; + +typedef UInt8 BluetoothHCIEncryptionMode; +enum BluetoothHCIEncryptionModes +{ + kEncryptionDisabled = 0x00, // Default. + kEncryptionOnlyForPointToPointPackets = 0x01, + kEncryptionForBothPointToPointAndBroadcastPackets = 0x02, +}; + +typedef UInt16 BluetoothHCIAutomaticFlushTimeout; +typedef struct BluetoothHCIAutomaticFlushTimeoutInfo BluetoothHCIAutomaticFlushTimeoutInfo; +struct BluetoothHCIAutomaticFlushTimeoutInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIAutomaticFlushTimeout timeout; +}; + +#define kInfoStringMaxLength 25 +typedef struct BluetoothTransportInfo BluetoothTransportInfo; +typedef BluetoothTransportInfo* BluetoothTransportInfoPtr; +struct BluetoothTransportInfo +{ + UInt32 productID; + UInt32 vendorID; + UInt32 type; + char productName[kInfoStringMaxLength]; + char vendorName[kInfoStringMaxLength]; +}; + +enum BluetoothTransportTypes +{ + kBluetoothTransportTypeUSB = 0x01, + kBluetoothTransportTypePCCard = 0x02, + kBluetoothTransportTypePCICard = 0x03 +}; + +// Inquiries + +typedef struct BluetoothHCIInquiryResult BluetoothHCIInquiryResult; +struct BluetoothHCIInquiryResult +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + BluetoothHCIPageScanPeriodMode pageScanPeriodMode; + BluetoothHCIPageScanMode pageScanMode; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; +}; + +#define kBluetoothHCIInquiryResultsMaxResults 50 +typedef struct BluetoothHCIInquiryResults BluetoothHCIInquiryResults; +struct BluetoothHCIInquiryResults +{ + BluetoothHCIInquiryResult results[kBluetoothHCIInquiryResultsMaxResults]; + IOItemCount count; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +//Inquiries with RSSI (v1.2 specification) + +typedef struct BluetoothHCIInquiryWithRSSIResult BluetoothHCIInquiryWithRSSIResult; +struct BluetoothHCIInquiryWithRSSIResult +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + UInt8 reserved; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; + BluetoothHCIRSSIValue RSSIValue; +}; + +typedef struct BluetoothHCIInquiryWithRSSIResults BluetoothHCIInquiryWithRSSIResults; +struct BluetoothHCIInquiryWithRSSIResults +{ + BluetoothHCIInquiryWithRSSIResult results[50]; + IOItemCount count; +}; + +//Inquiries with 'Extended Inquiry Response' (v2.1 specification) + +typedef UInt8 BluetoothHCIFECRequired; +enum BluetoothHCIFECRequiredValues +{ + kBluetoothHCIFECRequired = 0x00, + kBluetoothHCIFECNotRequired = 0x01 +}; + +typedef UInt8 BluetoothHCIInquiryMode; +enum BluetoothHCIInquiryModes +{ + kBluetoothHCIInquiryModeResultFormatStandard = 0x00, + kBluetoothHCIInquiryModeResultFormatWithRSSI = 0x01, + kBluetoothHCIInquiryModeResultFormatWithRSSIOrExtendedInquiryResultFormat = 0x02 +}; + +typedef UInt8 BluetoothHCIExtendedInquiryResponseDataType; + +typedef struct BluetoothHCIExtendedInquiryResponse BluetoothHCIExtendedInquiryResponse; /* Extended Inquiry Response [EIR] data, consisting of a sequence of data structures in this format: [length(1byte)][data type(1byte)][data(e.g. device name)] */ +struct BluetoothHCIExtendedInquiryResponse +{ + UInt8 data[ 240 ]; +}; + +typedef struct BluetoothHCIReadExtendedInquiryResponseResults BluetoothHCIReadExtendedInquiryResponseResults; +struct BluetoothHCIReadExtendedInquiryResponseResults +{ + BluetoothHCIFECRequired outFECRequired; + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; +}; + +typedef struct BluetoothHCIExtendedInquiryResult BluetoothHCIExtendedInquiryResult; +struct BluetoothHCIExtendedInquiryResult +{ + UInt8 numberOfReponses; /* always a value of 1 */ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + UInt8 reserved; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; + BluetoothHCIRSSIValue RSSIValue; + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; +}; + +// 'Simple Pairing' (v2.1 specification) + +typedef UInt8 BluetoothHCISimplePairingMode; +enum BluetoothHCISimplePairingModes +{ + kBluetoothHCISimplePairingModeNotSet = 0x00, + kBluetoothHCISimplePairingModeEnabled = 0x01 +}; + +typedef UInt8 BluetoothSimplePairingDebugMode; +enum BluetoothSimplePairingDebugModes +{ + kBluetoothHCISimplePairingDebugModeDisabled = 0x00, + kBluetoothHCISimplePairingDebugModeEnabled = 0x01 +}; + +typedef struct BluetoothHCISimplePairingOOBData BluetoothHCISimplePairingOOBData; +struct BluetoothHCISimplePairingOOBData +{ + UInt8 data[ 16 ]; +}; + +typedef struct BluetoothHCIReadLocalOOBDataResults BluetoothHCIReadLocalOOBDataResults; +struct BluetoothHCIReadLocalOOBDataResults +{ + BluetoothHCISimplePairingOOBData hash; + BluetoothHCISimplePairingOOBData randomizer; +}; + +typedef UInt8 BluetoothIOCapability; +enum BluetoothIOCapabilities +{ + kBluetoothCapabilityTypeDisplayOnly = 0x00, + kBluetoothCapabilityTypeDisplayYesNo = 0x01, + kBluetoothCapabilityTypeKeyboardOnly = 0x02, + kBluetoothCapabilityTypeNoInputNoOutput = 0x03 +}; + +typedef UInt8 BluetoothOOBDataPresence; +enum BluetoothOOBDataPresenceValues +{ + kBluetoothOOBAuthenticationDataNotPresent = 0x00, + kBluetoothOOBAuthenticationDataFromRemoteDevicePresent = 0x01 +}; + +typedef UInt8 BluetoothAuthenticationRequirements; +enum BluetoothAuthenticationRequirementsValues +{ + kBluetoothAuthenticationRequirementsMITMProtectionNotRequired = 0x00, /* Numeric comparison with automatic accept allowed */ + kBluetoothAuthenticationRequirementsMITMProtectionRequired = 0x01, /* Refer to BluetoothIOCapabilities to determine authentication procedure */ + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredNoBonding = 0x00, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredNoBonding = 0x01, + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredDedicatedBonding = 0x02, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredDedicatedBonding = 0x03, + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredGeneralBonding = 0x04, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredGeneralBonding = 0x05 +}; + +typedef struct BluetoothIOCapabilityResponse BluetoothIOCapabilityResponse; +struct BluetoothIOCapabilityResponse +{ + BluetoothDeviceAddress deviceAddress; + BluetoothIOCapability ioCapability; /* possible values from BluetoothIOCapabilities above */ + BluetoothOOBDataPresence OOBDataPresence; + BluetoothAuthenticationRequirements authenticationRequirements; +}; + +typedef UInt32 BluetoothPasskey; + +typedef struct BluetoothUserPasskeyNotification BluetoothUserPasskeyNotification; +struct BluetoothUserPasskeyNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPasskey passkey; /* passkey for display. valid values are 000000 - 999999 */ +}; + +typedef UInt8 BluetoothKeypressNotificationType; +enum BluetoothKeypressNotificationTypes +{ + kBluetoothKeypressNotificationTypePasskeyEntryStarted = 0, + kBluetoothKeypressNotificationTypePasskeyDigitEntered = 1, + kBluetoothKeypressNotificationTypePasskeyDigitErased = 2, + kBluetoothKeypressNotificationTypePasskeyCleared = 3, + kBluetoothKeypressNotificationTypePasskeyEntryCompleted = 4 +}; + +typedef struct BluetoothKeypressNotification BluetoothKeypressNotification; +struct BluetoothKeypressNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothKeypressNotificationType notificationType; +}; + +typedef SInt8 TransmissionPower; + +typedef UInt8 BluetoothAFHMode; +typedef struct BluetoothAFHResults BluetoothAFHResults; +struct BluetoothAFHResults +{ + BluetoothConnectionHandle handle; + BluetoothAFHMode mode; + UInt8 afhMap[10]; +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 + +typedef UInt32 BluetoothNumericValue; + +typedef struct BluetoothUserConfirmationRequest BluetoothUserConfirmationRequest; +struct BluetoothUserConfirmationRequest +{ + BluetoothDeviceAddress deviceAddress; + BluetoothNumericValue numericValue; /* numeric value for display. valid values are 000000 - 999999 */ +}; + +typedef struct BluetoothHCIEventSimplePairingCompleteResults BluetoothHCIEventSimplePairingCompleteResults; +struct BluetoothHCIEventSimplePairingCompleteResults +{ + BluetoothDeviceAddress deviceAddress; +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + + +// Packet Sizes + +enum +{ + kBluetoothHCICommandPacketHeaderSize = 3, + kBluetoothHCICommandPacketMaxDataSize = 255, + kBluetoothHCIMaxCommandPacketSize = kBluetoothHCICommandPacketHeaderSize + kBluetoothHCICommandPacketMaxDataSize, + + kBluetoothHCIEventPacketHeaderSize = 2, + kBluetoothHCIEventPacketMaxDataSize = 255, + kBluetoothHCIMaxEventPacketSize = kBluetoothHCIEventPacketHeaderSize + kBluetoothHCIEventPacketMaxDataSize, + + kBluetoothHCIDataPacketHeaderSize = 4, + kBluetoothHCIDataPacketMaxDataSize = 65535, + kBluetoothHCIMaxDataPacketSize = kBluetoothHCIDataPacketHeaderSize + kBluetoothHCIDataPacketMaxDataSize +}; + +typedef UInt8 BluetoothHCIEventCode; +typedef UInt8 BluetoothLinkType; +enum BluetoothLinkTypes +{ + kBluetoothSCOConnection = 0, + kBluetoothACLConnection = 1, + kBluetoothESCOConnection = 2, + kBluetoothLinkTypeNone = 0xff +}; + +typedef UInt16 BluetoothHCIVoiceSetting; // 10 bits meaningful +typedef UInt8 BluetoothHCISupportedIAC; + +typedef uint32_t BluetoothHCITransmitBandwidth; +typedef uint32_t BluetoothHCIReceiveBandwidth; +typedef uint16_t BluetoothHCIMaxLatency; +typedef uint8_t BluetoothHCIRetransmissionEffort; +enum BluetoothHCIRetransmissionEffortTypes +{ + kHCIRetransmissionEffortTypeNone = 0x00, + kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeForPower = 0x01, + kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeLinkQuality = 0x02, + kHCIRetransmissionEffortTypeDontCare = 0xFF, +}; + + +// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.7.35 - Setup Synchronous Command Complete Event) + +typedef uint8_t BluetoothAirMode; +enum +{ + kBluetoothAirModeULawLog = 0x00, + kBluetoothAirModeALawLog = 0x01, + kBluetoothAirModeCVSD = 0x02, + kBluetoothAirModeTransparentData = 0x03 +}; + +typedef struct BluetoothSynchronousConnectionInfo BluetoothSynchronousConnectionInfo; +struct BluetoothSynchronousConnectionInfo +{ + BluetoothHCITransmitBandwidth transmitBandWidth; + BluetoothHCIReceiveBandwidth receiveBandWidth; + BluetoothHCIMaxLatency maxLatency; + BluetoothHCIVoiceSetting voiceSetting; + BluetoothHCIRetransmissionEffort retransmissionEffort; + BluetoothPacketType packetType; +}; + +typedef struct BluetoothHCIEventSynchronousConnectionCompleteResults BluetoothHCIEventSynchronousConnectionCompleteResults; +struct BluetoothHCIEventSynchronousConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothLinkType linkType; + uint8_t transmissionInterval; + uint8_t retransmissionWindow; + uint16_t receivePacketLength; + uint16_t transmitPacketLength; + BluetoothAirMode airMode; +}; + + +typedef UInt8 BluetoothHCIStatus; +typedef UInt8 BluetoothHCIEventStatus; + +// Events. + +enum +{ + kBluetoothHCIEventInquiryComplete = 0x01, + kBluetoothHCIEventInquiryResult = 0x02, + kBluetoothHCIEventConnectionComplete = 0x03, + kBluetoothHCIEventConnectionRequest = 0x04, + kBluetoothHCIEventDisconnectionComplete = 0x05, + kBluetoothHCIEventAuthenticationComplete = 0x06, + kBluetoothHCIEventRemoteNameRequestComplete = 0x07, + kBluetoothHCIEventEncryptionChange = 0x08, + kBluetoothHCIEventChangeConnectionLinkKeyComplete = 0x09, + kBluetoothHCIEventMasterLinkKeyComplete = 0x0A, + kBluetoothHCIEventReadRemoteSupportedFeaturesComplete = 0x0B, + kBluetoothHCIEventReadRemoteVersionInformationComplete = 0x0C, + kBluetoothHCIEventQoSSetupComplete = 0x0D, + kBluetoothHCIEventCommandComplete = 0x0E, + kBluetoothHCIEventCommandStatus = 0x0F, + kBluetoothHCIEventHardwareError = 0x10, + kBluetoothHCIEventFlushOccurred = 0x11, + kBluetoothHCIEventRoleChange = 0x12, + kBluetoothHCIEventNumberOfCompletedPackets = 0x13, + kBluetoothHCIEventModeChange = 0x14, + kBluetoothHCIEventReturnLinkKeys = 0x15, + kBluetoothHCIEventPINCodeRequest = 0x16, + kBluetoothHCIEventLinkKeyRequest = 0x17, + kBluetoothHCIEventLinkKeyNotification = 0x18, + kBluetoothHCIEventLoopbackCommand = 0x19, + kBluetoothHCIEventDataBufferOverflow = 0x1A, + kBluetoothHCIEventMaxSlotsChange = 0x1B, + kBluetoothHCIEventReadClockOffsetComplete = 0x1C, + kBluetoothHCIEventConnectionPacketType = 0x1D, + kBluetoothHCIEventQoSViolation = 0x1E, + kBluetoothHCIEventPageScanModeChange = 0x1F, + kBluetoothHCIEventPageScanRepetitionModeChange = 0x20, + + // [v1.2] + + kBluetoothHCIEventFlowSpecificationComplete = 0x21, + kBluetoothHCIEventInquiryResultWithRSSI = 0x22, + kBluetoothHCIEventReadRemoteExtendedFeaturesComplete = 0x23, + kBluetoothHCIEventSynchronousConnectionComplete = 0x2C, + kBluetoothHCIEventSynchronousConnectionChanged = 0x2D, + + // [v2.1] + + kBluetoothHCIEventSniffSubstrate = 0x2E, + kBluetoothHCIEventExtendedInquiryResult = 0x2F, + kBluetoothHCIEventIOCapabilityRequest = 0x31, + kBluetoothHCIEventIOCapabilityResponse = 0x32, + kBluetoothHCIEventUserConfirmationRequest = 0x33, + kBluetoothHCIEventUserPasskeyRequest = 0x34, + kBluetoothHCIEventRemoteOOBDataRequest = 0x35, + kBluetoothHCIEventSimplePairingComplete = 0x36, + kBluetoothHCIEventLinkSupervisionTimeoutChanged = 0x38, + kBluetoothHCIEventEnhancedFlushComplete = 0x39, + kBluetoothHCIEventSniffRequest = 0x3A, + kBluetoothHCIEventUserPasskeyNotification = 0x3B, + kBluetoothHCIEventKeypressNotification = 0x3C, + + kBluetoothHCIEventLogoTesting = 0xFE, + kBluetoothHCIEventVendorSpecific = 0xFF +}; + +// HCI Event Masks + +// Event masks are 8 octets according to the spec. v2.1 introduces some event masks that +// actually exceed 32 bits so the 4 byte enum we had before Bluetooth 2.0 will still work for old +// the masks, but the new masks need to be defined as 64 bits. + +typedef uint64_t BluetoothHCIEventMask; + +#define kBluetoothHCIEventMaskDefault64Bit 0x00001FFFFFFFFFFFLL +#define kBluetoothHCIEventMaskAll64Bit 0xFFFFFFFFFFFFFFFFLL + + // [v1.2] + +#define kBluetoothHCIEventMaskFlowSpecificationCompleteEvent 0x0000000100000000LL +#define kBluetoothHCIEventMaskInquiryResultWithRSSIEvent 0x0000000200000000LL +#define kBluetoothHCIEventMaskReadRemoteExtendedFeaturesCompleteEvent 0x0000000400000000LL +#define kBluetoothHCIEventMaskSynchronousConnectionCompleteEvent 0x0000080000000000LL +#define kBluetoothHCIEventMaskSynchronousConnectionChangedEvent 0x0000100000000000LL + + // [v2.1] + +#define kBluetoothHCIEventMaskSniffSubstrateEvent 0x0000200000000000LL +#define kBluetoothHCIEventMaskExtendedInquiryResultEvent 0x0000400000000000LL +#define kBluetoothHCIEventMaskLinkSupervisionTimeoutChangedEvent 0x0080000000000000LL +#define kBluetoothHCIEventMaskEnhancedFlushCompleteEvent 0x0100000000000000LL + + // [v2.1 Secure Simple Pairing] + +#define kBluetoothHCIEventMaskIOCapabilityRequestEvent 0x0001000000000000LL +#define kBluetoothHCIEventMaskIOCapabilityRequestReplyEvent 0x0002000000000000LL +#define kBluetoothHCIEventMaskUserConfirmationRequestEvent 0x0004000000000000LL +#define kBluetoothHCIEventMaskUserPasskeyRequestEvent 0x0008000000000000LL +#define kBluetoothHCIEventMaskRemoteOOBDataRequestEvent 0x0010000000000000LL +#define kBluetoothHCIEventMaskSimplePairingCompleteEvent 0x0020000000000000LL +#define kBluetoothHCIEventMaskUserPasskeyNotificationEvent 0x0400000000000000LL +#define kBluetoothHCIEventMaskKeypressNotificationEvent 0x0800000000000000LL + +enum +{ + kBluetoothHCIEventMaskNone = 0x00000000, + kBluetoothHCIEventMaskInquiryComplete = 0x00000001, + kBluetoothHCIEventMaskInquiryResult = 0x00000002, + kBluetoothHCIEventMaskConnectionComplete = 0x00000004, + kBluetoothHCIEventMaskConnectionRequest = 0x00000008, + kBluetoothHCIEventMaskDisconnectionComplete = 0x00000010, + kBluetoothHCIEventMaskAuthenticationComplete = 0x00000020, + kBluetoothHCIEventMaskRemoteNameRequestComplete = 0x00000040, + kBluetoothHCIEventMaskEncryptionChange = 0x00000080, + kBluetoothHCIEventMaskChangeConnectionLinkKeyComplete = 0x00000100, + kBluetoothHCIEventMaskMasterLinkKeyComplete = 0x00000200, + kBluetoothHCIEventMaskReadRemoteSupportedFeaturesComplete = 0x00000400, + kBluetoothHCIEventMaskReadRemoteVersionInformationComplete = 0x00000800, + kBluetoothHCIEventMaskQoSSetupComplete = 0x00001000, + kBluetoothHCIEventMaskCommandComplete = 0x00002000, + kBluetoothHCIEventMaskCommandStatus = 0x00004000, + kBluetoothHCIEventMaskHardwareError = 0x00008000, + kBluetoothHCIEventMaskFlushOccurred = 0x00010000, + kBluetoothHCIEventMaskRoleChange = 0x00020000, + + kBluetoothHCIEventMaskNumberOfCompletedPackets = 0x00040000, + kBluetoothHCIEventMaskModeChange = 0x00080000, + kBluetoothHCIEventMaskReturnLinkKeys = 0x00100000, + kBluetoothHCIEventMaskPINCodeRequest = 0x00200000, + kBluetoothHCIEventMaskLinkKeyRequest = 0x00400000, + kBluetoothHCIEventMaskLinkKeyNotification = 0x00800000, + kBluetoothHCIEventMaskLoopbackCommand = 0x01000000, + kBluetoothHCIEventMaskDataBufferOverflow = 0x02000000, + kBluetoothHCIEventMaskMaxSlotsChange = 0x04000000, + kBluetoothHCIEventMaskReadClockOffsetComplete = 0x08000000, + kBluetoothHCIEventMaskConnectionPacketTypeChanged = 0x10000000, + kBluetoothHCIEventMaskQoSViolation = 0x20000000, + kBluetoothHCIEventMaskPageScanModeChange = 0x40000000, + kBluetoothHCIEventMaskPageScanRepetitionModeChange = 0x80000000, + + kBluetoothHCIEventMaskAll = 0xFFFFFFFF, + kBluetoothHCIEventMaskDefault = kBluetoothHCIEventMaskAll /* Use kBluetoothHCIEventMaskDefault64Bit above! */ +}; + +// Event results structures. + +typedef struct BluetoothHCIEventConnectionCompleteResults BluetoothHCIEventConnectionCompleteResults; +struct BluetoothHCIEventConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothLinkType linkType; + BluetoothHCIEncryptionMode encryptionMode; +}; + +typedef struct BluetoothHCIEventDisconnectionCompleteResults BluetoothHCIEventDisconnectionCompleteResults; +struct BluetoothHCIEventDisconnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothReasonCode reason; +}; + +typedef struct BluetoothHCIEventReadSupportedFeaturesResults BluetoothHCIEventReadSupportedFeaturesResults; +struct BluetoothHCIEventReadSupportedFeaturesResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures supportedFeatures; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 +typedef struct BluetoothHCIEventReadExtendedFeaturesResults BluetoothHCIEventReadExtendedFeaturesResults; +struct BluetoothHCIEventReadExtendedFeaturesResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIExtendedFeaturesInfo supportedFeaturesInfo; +}; +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + +typedef struct BluetoothHCIEventReadRemoteVersionInfoResults BluetoothHCIEventReadRemoteVersionInfoResults; +struct BluetoothHCIEventReadRemoteVersionInfoResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothLMPVersion lmpVersion; + BluetoothManufacturerName manufacturerName; + BluetoothLMPSubversion lmpSubversion; +}; + +typedef struct BluetoothHCIEventRemoteNameRequestResults BluetoothHCIEventRemoteNameRequestResults; +struct BluetoothHCIEventRemoteNameRequestResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothDeviceName deviceName; +}; + +typedef struct BluetoothHCIEventReadClockOffsetResults BluetoothHCIEventReadClockOffsetResults; +struct BluetoothHCIEventReadClockOffsetResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothClockOffset clockOffset; +}; + +typedef struct BluetoothHCIEventConnectionRequestResults BluetoothHCIEventConnectionRequestResults; +struct BluetoothHCIEventConnectionRequestResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothClassOfDevice classOfDevice; + BluetoothLinkType linkType; +}; + +typedef struct BluetoothHCIEventLinkKeyNotificationResults BluetoothHCIEventLinkKeyNotificationResults; +struct BluetoothHCIEventLinkKeyNotificationResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothKey linkKey; + BluetoothKeyType keyType; +}; + +typedef struct BluetoothHCIEventMaxSlotsChangeResults BluetoothHCIEventMaxSlotsChangeResults; +struct BluetoothHCIEventMaxSlotsChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothMaxSlots maxSlots; +}; + +typedef struct BluetoothHCIEventModeChangeResults BluetoothHCIEventModeChangeResults; +struct BluetoothHCIEventModeChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIConnectionMode mode; + BluetoothHCIModeInterval modeInterval; +}; + +typedef struct BluetoothHCIEventReturnLinkKeysResults BluetoothHCIEventReturnLinkKeysResults; +struct BluetoothHCIEventReturnLinkKeysResults +{ + UInt8 numLinkKeys; + struct { + BluetoothDeviceAddress deviceAddress; + BluetoothKey linkKey; + } linkKeys[1]; +}; + +typedef struct BluetoothHCIEventAuthenticationCompleteResults BluetoothHCIEventAuthenticationCompleteResults; +struct BluetoothHCIEventAuthenticationCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventEncryptionChangeResults BluetoothHCIEventEncryptionChangeResults; +struct BluetoothHCIEventEncryptionChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothEncryptionEnable enable; +}; + +typedef struct BluetoothHCIEventChangeConnectionLinkKeyCompleteResults BluetoothHCIEventChangeConnectionLinkKeyCompleteResults; +struct BluetoothHCIEventChangeConnectionLinkKeyCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventMasterLinkKeyCompleteResults BluetoothHCIEventMasterLinkKeyCompleteResults; +struct BluetoothHCIEventMasterLinkKeyCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothKeyFlag keyFlag; +}; + +typedef struct BluetoothHCIEventQoSSetupCompleteResults BluetoothHCIEventQoSSetupCompleteResults; +struct BluetoothHCIEventQoSSetupCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIQualityOfServiceSetupParams setupParams; +}; + +typedef struct BluetoothHCIEventHardwareErrorResults BluetoothHCIEventHardwareErrorResults; +struct BluetoothHCIEventHardwareErrorResults +{ + BluetoothHCIStatus error; +}; + +typedef struct BluetoothHCIEventFlushOccurredResults BluetoothHCIEventFlushOccurredResults; +struct BluetoothHCIEventFlushOccurredResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventRoleChangeResults BluetoothHCIEventRoleChangeResults; +struct BluetoothHCIEventRoleChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothRole role; +}; + +typedef struct BluetoothHCIEventDataBufferOverflowResults BluetoothHCIEventDataBufferOverflowResults; +struct BluetoothHCIEventDataBufferOverflowResults +{ + BluetoothLinkType linkType; +}; + +typedef struct BluetoothHCIEventConnectionPacketTypeResults BluetoothHCIEventConnectionPacketTypeResults; +struct BluetoothHCIEventConnectionPacketTypeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothPacketType packetType; +}; + +typedef struct BluetoothHCIEventReadRemoteSupportedFeaturesResults BluetoothHCIEventReadRemoteSupportedFeaturesResults; +struct BluetoothHCIEventReadRemoteSupportedFeaturesResults +{ + BluetoothHCIStatus error; + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures lmpFeatures; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 +typedef struct BluetoothHCIEventReadRemoteExtendedFeaturesResults BluetoothHCIEventReadRemoteExtendedFeaturesResults; +struct BluetoothHCIEventReadRemoteExtendedFeaturesResults +{ + BluetoothHCIStatus error; + BluetoothConnectionHandle connectionHandle; + BluetoothHCIPageNumber page; + BluetoothHCIPageNumber maxPage; + BluetoothHCISupportedFeatures lmpFeatures; +}; +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + +typedef struct BluetoothHCIEventQoSViolationResults BluetoothHCIEventQoSViolationResults; +struct BluetoothHCIEventQoSViolationResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventPageScanModeChangeResults BluetoothHCIEventPageScanModeChangeResults; +struct BluetoothHCIEventPageScanModeChangeResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanMode pageScanMode; +}; + +typedef struct BluetoothHCIEventPageScanRepetitionModeChangeResults BluetoothHCIEventPageScanRepetitionModeChangeResults; +struct BluetoothHCIEventPageScanRepetitionModeChangeResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; +}; + +typedef struct BluetoothHCIEventVendorSpecificResults BluetoothHCIEventVendorSpecificResults; +struct BluetoothHCIEventVendorSpecificResults +{ + UInt8 length; + UInt8 data[255]; +}; + +#define kNoNotifyProc NULL +#define kNoUserRefCon NULL + +typedef struct BluetoothHCIRequestCallbackInfo BluetoothHCIRequestCallbackInfo; +struct BluetoothHCIRequestCallbackInfo +{ + mach_vm_address_t userCallback; // Proc to call when async handler is called. + mach_vm_address_t userRefCon; // For user's info. + mach_vm_address_t internalRefCon; // For our purposes. + mach_vm_address_t asyncIDRefCon; // For our aync calls. + mach_vm_address_t reserved; // For the future. Currently Unused. +}; + +// Error codes + +enum +{ + kBluetoothHCIErrorSuccess = 0x00, + kBluetoothHCIErrorUnknownHCICommand = 0x01, + kBluetoothHCIErrorNoConnection = 0x02, + kBluetoothHCIErrorHardwareFailure = 0x03, + kBluetoothHCIErrorPageTimeout = 0x04, + kBluetoothHCIErrorAuthenticationFailure = 0x05, + kBluetoothHCIErrorKeyMissing = 0x06, + kBluetoothHCIErrorMemoryFull = 0x07, + kBluetoothHCIErrorConnectionTimeout = 0x08, + kBluetoothHCIErrorMaxNumberOfConnections = 0x09, + kBluetoothHCIErrorMaxNumberOfSCOConnectionsToADevice = 0x0A, + kBluetoothHCIErrorACLConnectionAlreadyExists = 0x0B, + kBluetoothHCIErrorCommandDisallowed = 0x0C, + kBluetoothHCIErrorHostRejectedLimitedResources = 0x0D, + kBluetoothHCIErrorHostRejectedSecurityReasons = 0x0E, + kBluetoothHCIErrorHostRejectedRemoteDeviceIsPersonal = 0x0F, + kBluetoothHCIErrorHostTimeout = 0x10, + kBluetoothHCIErrorUnsupportedFeatureOrParameterValue = 0x11, + kBluetoothHCIErrorInvalidHCICommandParameters = 0x12, + kBluetoothHCIErrorOtherEndTerminatedConnectionUserEnded = 0x13, + kBluetoothHCIErrorOtherEndTerminatedConnectionLowResources = 0x14, + kBluetoothHCIErrorOtherEndTerminatedConnectionAboutToPowerOff = 0x15, + kBluetoothHCIErrorConnectionTerminatedByLocalHost = 0x16, + kBluetoothHCIErrorRepeatedAttempts = 0x17, + kBluetoothHCIErrorPairingNotAllowed = 0x18, + kBluetoothHCIErrorUnknownLMPPDU = 0x19, + kBluetoothHCIErrorUnsupportedRemoteFeature = 0x1A, + kBluetoothHCIErrorSCOOffsetRejected = 0x1B, + kBluetoothHCIErrorSCOIntervalRejected = 0x1C, + kBluetoothHCIErrorSCOAirModeRejected = 0x1D, + kBluetoothHCIErrorInvalidLMPParameters = 0x1E, + kBluetoothHCIErrorUnspecifiedError = 0x1F, + kBluetoothHCIErrorUnsupportedLMPParameterValue = 0x20, + kBluetoothHCIErrorRoleChangeNotAllowed = 0x21, + kBluetoothHCIErrorLMPResponseTimeout = 0x22, + kBluetoothHCIErrorLMPErrorTransactionCollision = 0x23, + kBluetoothHCIErrorLMPPDUNotAllowed = 0x24, + kBluetoothHCIErrorEncryptionModeNotAcceptable = 0x25, // Added Core Spec, v1.1 + kBluetoothHCIErrorUnitKeyUsed = 0x26, // 1.1 + kBluetoothHCIErrorQoSNotSupported = 0x27, // 1.1 + kBluetoothHCIErrorInstantPassed = 0x28, // 1.1 + kBluetoothHCIErrorPairingWithUnitKeyNotSupported = 0x29, // 1.1 + kBluetoothHCIErrorHostRejectedUnacceptableDeviceAddress = 0x0F, // 2.0+ + kBluetoothHCIErrorDifferentTransactionCollision = 0x2A, // 1.2 + kBluetoothHCIErrorQoSUnacceptableParameter = 0x2C, // 1.2 + kBluetoothHCIErrorQoSRejected = 0x2D, // 1.2 + kBluetoothHCIErrorChannelClassificationNotSupported = 0x2E, // 1.2 + kBluetoothHCIErrorInsufficientSecurity = 0x2F, // 1.2 + kBluetoothHCIErrorParameterOutOfMandatoryRange = 0x30, // 1.2 + kBluetoothHCIErrorRoleSwitchPending = 0x31, // 1.2 + kBluetoothHCIErrorReservedSlotViolation = 0x34, // 1.2 + kBluetoothHCIErrorRoleSwitchFailed = 0x35, // 1.2 + kBluetoothHCIErrorExtendedInquiryResponseTooLarge = 0x36, // 2.1 + kBluetoothHCIErrorSecureSimplePairingNotSupportedByHost = 0x37, // 2.1 + + kBluetoothHCIErrorMax = 0x37 +}; + +#if 0 +#pragma mark === HCI Power Mode === +#endif + +//=========================================================================================================================== +// HCI Power Mode +//=========================================================================================================================== + +typedef enum +{ + kBluetoothHCIPowerStateON = 0x01, + kBluetoothHCIPowerStateOFF = 0x00, + kBluetoothHCIPowerStateUnintialized = 0xFF, +} BluetoothHCIPowerState; + +enum +{ + kBluetoothHCIErrorPowerIsOFF = (kBluetoothHCIErrorMax + 1) +}; + +#if 0 +#pragma mark === HCI USB Transport === +#endif + +//=========================================================================================================================== +// HCI USB Transport +//=========================================================================================================================== + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @enum BluetoothHCIUSBDeviceMatchingConstants + @abstract Bluetooth USB device matching constants + @constant kBluetoothHCITransportUSBClassCode Wireless Controller + @constant kBluetoothHCITransportUSBSubClassCode RF Controller + @constant kBluetoothHCITransportUSBProtocolCode Bluetooth Programming +*/ + +enum +{ + kBluetoothHCITransportUSBClassCode = 0xE0, + kBluetoothHCITransportUSBSubClassCode = 0x01, + kBluetoothHCITransportUSBProtocolCode = 0x01 +}; + +#if 0 +#pragma mark === TCI - L2CAP === +#endif + +//=========================================================================================================================== +// TCI - L2CAP +//=========================================================================================================================== + +enum +{ + kBluetoothL2CAPTCIEventIDReserved = 0x00, + kBluetoothL2CAPTCIEventIDL2CA_ConnectInd = 0x01, + kBluetoothL2CAPTCIEventIDL2CA_ConfigInd = 0x02, + kBluetoothL2CAPTCIEventIDL2CA_DisconnectInd = 0x03, + kBluetoothL2CAPTCIEventIDL2CA_QoSViolationInd = 0x04, + kBluetoothL2CAPTCIEventIDL2CA_TimeOutInd = 0x05 +}; + +enum +{ + kBluetoothL2CAPTCICommandReserved = 0x0000, + kBluetoothL2CAPTCICommandL2CA_ConnectReq = 0x0001, + kBluetoothL2CAPTCICommandL2CA_DisconnectReq = 0x0002, + kBluetoothL2CAPTCICommandL2CA_ConfigReq = 0x0003, + kBluetoothL2CAPTCICommandL2CA_DisableCLT = 0x0004, + kBluetoothL2CAPTCICommandL2CA_EnableCLT = 0x0005, + kBluetoothL2CAPTCICommandL2CA_GroupCreate = 0x0006, + kBluetoothL2CAPTCICommandL2CA_GroupClose = 0x0007, + kBluetoothL2CAPTCICommandL2CA_GroupAddMember = 0x0008, + kBluetoothL2CAPTCICommandL2CA_GroupRemoveMember = 0x0009, + kBluetoothL2CAPTCICommandL2CA_GroupMembership = 0x000A, + kBluetoothL2CAPTCICommandL2CA_WriteData = 0x000B, + kBluetoothL2CAPTCICommandL2CA_ReadData = 0x000C, + kBluetoothL2CAPTCICommandL2CA_Ping = 0x000D, + kBluetoothL2CAPTCICommandL2CA_GetInfo = 0x000E, + kBluetoothL2CAPTCICommandL2CA_Reserved1 = 0x000F, + kBluetoothL2CAPTCICommandL2CA_Reserved2 = 0x0010, + kBluetoothL2CAPTCICommandL2CA_ConnectResp = 0x0011, + kBluetoothL2CAPTCICommandL2CA_DisconnectResp = 0x0012, + kBluetoothL2CAPTCICommandL2CA_ConfigResp = 0x0013 +}; + +#if 0 +#pragma mark - +#pragma mark === RFCOMM === +#endif + +//=========================================================================================================================== +// RFCOMM +//=========================================================================================================================== +#define kMaxChannelIDPerSide 31 + +typedef UInt8 BluetoothRFCOMMChannelID; + +#define RFCOMM_CHANNEL_ID_IS_VALID( CHANNEL ) (( CHANNEL >= 1 ) && ( CHANNEL <= 30 )) + +typedef UInt16 BluetoothRFCOMMMTU; + +typedef enum BluetoothRFCOMMParityType +{ + kBluetoothRFCOMMParityTypeNoParity = 0, + kBluetoothRFCOMMParityTypeOddParity, + kBluetoothRFCOMMParityTypeEvenParity, + kBluetoothRFCOMMParityTypeMaxParity +} BluetoothRFCOMMParityType; + +typedef enum BluetoothRFCOMMLineStatus +{ + BluetoothRFCOMMLineStatusNoError = 0, + BluetoothRFCOMMLineStatusOverrunError, + BluetoothRFCOMMLineStatusParityError, + BluetoothRFCOMMLineStatusFramingError +} BluetoothRFCOMMLineStatus; + +#if 0 +#pragma mark - +#pragma mark === SDP === +#endif + +//=========================================================================================================================== +// SDP +//=========================================================================================================================== + +typedef UInt8 BluetoothSDPPDUID; +enum { + kBluetoothSDPPDUIDReserved = 0, + kBluetoothSDPPDUIDErrorResponse = 1, + kBluetoothSDPPDUIDServiceSearchRequest = 2, + kBluetoothSDPPDUIDServiceSearchResponse = 3, + kBluetoothSDPPDUIDServiceAttributeRequest = 4, + kBluetoothSDPPDUIDServiceAttributeResponse = 5, + kBluetoothSDPPDUIDServiceSearchAttributeRequest = 6, + kBluetoothSDPPDUIDServiceSearchAttributeResponse = 7 +}; + +#define IS_REQUEST_PDU( _pduID ) ( ( _pduID == kBluetoothSDPPDUIDServiceSearchRequest ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceAttributeRequest ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceSearchAttributeRequest ) ) + +#define IS_RESPONSE_PDU( _pduID ) ( ( _pduID == kBluetoothSDPPDUIDErrorResponse ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceSearchResponse ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceAttributeResponse ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceSearchAttributeResponse ) ) + +typedef UInt16 BluetoothSDPErrorCode; +enum { + kBluetoothSDPErrorCodeSuccess = 0x0000, + kBluetoothSDPErrorCodeReserved = 0x0000, + kBluetoothSDPErrorCodeInvalidSDPVersion = 0x0001, + kBluetoothSDPErrorCodeInvalidServiceRecordHandle = 0x0002, + kBluetoothSDPErrorCodeInvalidRequestSyntax = 0x0003, + kBluetoothSDPErrorCodeInvalidPDUSize = 0x0004, + kBluetoothSDPErrorCodeInvalidContinuationState = 0x0005, + kBluetoothSDPErrorCodeInsufficientResources = 0x0006, + + kBluetoothSDPErrorCodeReservedStart = 0x0007, + kBluetoothSDPErrorCodeReservedEnd = 0xFFFF +}; + +typedef UInt16 BluetoothSDPTransactionID; + +typedef UInt32 BluetoothSDPServiceRecordHandle; + +enum { + kBluetoothSDPDataElementTypeNil = 0, + kBluetoothSDPDataElementTypeUnsignedInt = 1, + kBluetoothSDPDataElementTypeSignedInt = 2, + kBluetoothSDPDataElementTypeUUID = 3, + kBluetoothSDPDataElementTypeString = 4, + kBluetoothSDPDataElementTypeBoolean = 5, + kBluetoothSDPDataElementTypeDataElementSequence = 6, + kBluetoothSDPDataElementTypeDataElementAlternative = 7, + kBluetoothSDPDataElementTypeURL = 8, + kBluetoothSDPDataElementTypeReservedStart = 9, + kBluetoothSDPDataElementTypeReservedEnd = 31 +}; + +typedef UInt16 BluetoothSDPUUID16; +typedef UInt32 BluetoothSDPUUID32; + +typedef UInt8 BluetoothSDPDataElementTypeDescriptor; +typedef UInt8 BluetoothSDPDataElementSizeDescriptor; + +typedef UInt16 BluetoothSDPServiceAttributeID; + +#ifdef __cplusplus + } +#endif diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/BluetoothAssignedNumbers.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/BluetoothAssignedNumbers.h.svn-base new file mode 100644 index 0000000..ea5db2e --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/BluetoothAssignedNumbers.h.svn-base @@ -0,0 +1,552 @@ +/* + File: BluetoothAssignedNumbers.h + Copyright: (c) 2002-2008 by Apple Computer, Inc. All rights reserved. +*/ + +#pragma once + +#ifdef __cplusplus + extern "C" { +#endif + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +#pragma mark - +#pragma mark === General === + +enum BluetoothCompanyIdentifers +{ + kBluetoothCompanyIdentiferEricssonTechnologyLicensing = 0, + kBluetoothCompanyIdentiferNokiaMobilePhones = 1, + kBluetoothCompanyIdentiferIntel = 2, + kBluetoothCompanyIdentiferIBM = 3, + kBluetoothCompanyIdentiferToshiba = 4, + kBluetoothCompanyIdentifer3Com = 5, + kBluetoothCompanyIdentiferMicrosoft = 6, + kBluetoothCompanyIdentiferLucent = 7, + kBluetoothCompanyIdentiferMotorola = 8, + kBluetoothCompanyIdentiferInfineonTechnologiesAG = 9, + kBluetoothCompanyIdentiferCambridgeSiliconRadio = 10, + kBluetoothCompanyIdentiferSiliconWave = 11, + kBluetoothCompanyIdentiferDigianswerAS = 12, + kBluetoothCompanyIdentiferTexasInstruments = 13, + kBluetoothCompanyIdentiferParthusTechnologies = 14, + kBluetoothCompanyIdentiferBroadcom = 15, + kBluetoothCompanyIdentiferMitelSemiconductor = 16, + kBluetoothCompanyIdentiferWidcomm = 17, + kBluetoothCompanyIdentiferZeevo = 18, + kBluetoothCompanyIdentiferAtmel = 19, + kBluetoothCompanyIdentiferMistubishiElectric = 20, + kBluetoothCompanyIdentiferRTXTelecom = 21, + kBluetoothCompanyIdentiferKCTechnology = 22, + kBluetoothCompanyIdentiferNewlogic = 23, + kBluetoothCompanyIdentiferTransilica = 24, + kBluetoothCompanyIdentiferRohdeandSchwarz = 25, + kBluetoothCompanyIdentiferTTPCom = 26, + kBluetoothCompanyIdentiferSigniaTechnologies = 27, + kBluetoothCompanyIdentiferConexantSystems = 28, + kBluetoothCompanyIdentiferQualcomm = 29, + kBluetoothCompanyIdentiferInventel = 30, + kBluetoothCompanyIdentiferAVMBerlin = 31, + kBluetoothCompanyIdentiferBandspeed = 32, + kBluetoothCompanyIdentiferMansella = 33, + kBluetoothCompanyIdentiferNEC = 34, + kBluetoothCompanyIdentiferWavePlusTechnology = 35, + kBluetoothCompanyIdentiferAlcatel = 36, + kBluetoothCompanyIdentiferPhilipsSemiconductor = 37, + kBluetoothCompanyIdentiferCTechnologies = 38, + kBluetoothCompanyIdentiferOpenInterface = 39, + kBluetoothCompanyIdentiferRFCMicroDevices = 40, + kBluetoothCompanyIdentiferHitachi = 41, + kBluetoothCompanyIdentiferSymbolTechnologies = 42, + kBluetoothCompanyIdentiferTenovis = 43, + kBluetoothCompanyIdentiferMacronixInternational = 44, + kBluetoothCompanyIdentiferGCTSemiconductor = 45, + kBluetoothCompanyIdentiferNorwoodSystems = 46, + kBluetoothCompanyIdentiferMewTelTechnology = 47, + kBluetoothCompanyIdentiferSTMicroelectronics = 48, + kBluetoothCompanyIdentiferSynopsys = 49, + kBluetoothCompanyIdentiferRedMCommunications = 50, + kBluetoothCompanyIdentiferCommil = 51, + kBluetoothCompanyIdentiferCATC = 52, + kBluetoothCompanyIdentiferEclipse = 53, + kBluetoothCompanyIdentiferRenesasTechnology = 54, + kBluetoothCompanyIdentiferMobilian = 55, + kBluetoothCompanyIdentiferTerax = 56, + kBluetoothCompanyIdentiferIntegratedSystemSolution = 57, + kBluetoothCompanyIdentiferMatsushitaElectricIndustrial = 58, + kBluetoothCompanyIdentiferGennum = 59, + kBluetoothCompanyIdentiferResearchInMotion = 60, + kBluetoothCompanyIdentiferIPextreme = 61, + kBluetoothCompanyIdentiferSystemsAndChips = 62, + kBluetoothCompanyIdentiferBluetoothSIG = 63, + kBluetoothCompanyIdentiferSeikoEpson = 64, + kBluetoothCompanyIdentiferIntegratedSiliconSolution = 65, + kBluetoothCompanyIdentiferCONWISETechnology = 66, + kBluetoothCompanyIdentiferParrotSA = 67, + kBluetoothCompanyIdentiferSocketCommunications = 68, + kBluetoothCompanyIdentiferAtherosCommunications = 69, + kBluetoothCompanyIdentiferMediaTek = 70, + kBluetoothCompanyIdentiferBluegiga = 71, + kBluetoothCompanyIdentiferMarvellTechnologyGroup = 72, + kBluetoothCompanyIdentifer3DSP = 73, + kBluetoothCompanyIdentiferAccelSemiconductor = 74, + kBluetoothCompanyIdentiferContinentialAutomotiveSystems = 75, + kBluetoothCompanyIdentiferApple = 76, + kBluetoothCompanyIdentiferStaccatoCommunications = 77, + kBluetoothCompanyIdentiferAvagoTechnologies = 78, + kBluetoothCompanyIdentiferAPT = 79, + + kBluetoothCompanyIdentiferInteropIdentifier = 65535 +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + +#pragma mark - +#pragma mark === Baseband === + +//================================================================================================================== +// Baseband +//================================================================================================================== + +// +// Service Class Major +// + +enum +{ + kBluetoothServiceClassMajorLimitedDiscoverableMode = 0x001, // Bit 13 - Limited Discoverable Mode + kBluetoothServiceClassMajorReserved1 = 0x002, // Bit 14 - Reserved for future use. + kBluetoothServiceClassMajorReserved2 = 0x004, // Bit 15 - Reserved for future use. + kBluetoothServiceClassMajorPositioning = 0x008, // Bit 16 - Positioning (Location ID) + kBluetoothServiceClassMajorNetworking = 0x010, // Bit 17 - LAN, Ad hoc, etc... + kBluetoothServiceClassMajorRendering = 0x020, // Bit 18 - Printing, Speaker, etc... + kBluetoothServiceClassMajorCapturing = 0x040, // Bit 19 - Scanner, Microphone, etc... + kBluetoothServiceClassMajorObjectTransfer = 0x080, // Bit 20 - v-Inbox, v-Folder, etc... + kBluetoothServiceClassMajorAudio = 0x100, // Bit 21 - Speaker, Microphone, Headset, etc... + kBluetoothServiceClassMajorTelephony = 0x200, // Bit 22 - Cordless telephony, Modem, Headset, etc... + kBluetoothServiceClassMajorInformation = 0x400, // Bit 23 - Web server, WAP server, etc... + + kBluetoothServiceClassMajorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothServiceClassMajorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothServiceClassMajorEnd +}; + +// +// Device Class Major +// + +enum +{ + kBluetoothDeviceClassMajorMiscellaneous = 0x00, // [00000] Miscellaneous + kBluetoothDeviceClassMajorComputer = 0x01, // [00001] Desktop, Notebook, PDA, Organizers, etc... + kBluetoothDeviceClassMajorPhone = 0x02, // [00010] Cellular, Cordless, Payphone, Modem, etc... + kBluetoothDeviceClassMajorLANAccessPoint = 0x03, // [00011] LAN Access Point + kBluetoothDeviceClassMajorAudio = 0x04, // [00100] Headset, Speaker, Stereo, etc... + kBluetoothDeviceClassMajorPeripheral = 0x05, // [00101] Mouse, Joystick, Keyboards, etc... + kBluetoothDeviceClassMajorImaging = 0x06, // [00110] Printing, scanner, camera, display, etc... + kBluetoothDeviceClassMajorUnclassified = 0x1F, // [11111] Specific device code not assigned + + // Range 0x06 to 0x1E Reserved for future use. + + kBluetoothDeviceClassMajorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothDeviceClassMajorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothDeviceClassMajorEnd +}; + +// +// Device Class Minor +// + +enum +{ + /// + /// Computer Major Class + /// + + kBluetoothDeviceClassMinorComputerUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorComputerDesktopWorkstation = 0x01, // [000001] Desktop workstation + kBluetoothDeviceClassMinorComputerServer = 0x02, // [000010] Server-class computer + kBluetoothDeviceClassMinorComputerLaptop = 0x03, // [000011] Laptop + kBluetoothDeviceClassMinorComputerHandheld = 0x04, // [000100] Handheld PC/PDA (clam shell) + kBluetoothDeviceClassMinorComputerPalmSized = 0x05, // [000101] Palm-sized PC/PDA + kBluetoothDeviceClassMinorComputerWearable = 0x06, // [000110] Wearable computer (watch sized) + + // Range 0x06 to 0x7F Reserved for future use. + + + /// + /// Phone Major Class + /// + + kBluetoothDeviceClassMinorPhoneUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorPhoneCellular = 0x01, // [000001] Cellular + kBluetoothDeviceClassMinorPhoneCordless = 0x02, // [000010] Cordless + kBluetoothDeviceClassMinorPhoneSmartPhone = 0x03, // [000011] Smart phone + kBluetoothDeviceClassMinorPhoneWiredModemOrVoiceGateway = 0x04, // [000100] Wired modem or voice gateway + kBluetoothDeviceClassMinorPhoneCommonISDNAccess = 0x05, // [000101] Common ISDN Access + + // Range 0x05 to 0x7F Reserved for future use. + + + /// + /// LAN Access Point Major Class + /// + + // $$$ TO DO: LAN Access Point minor classes are broken into bits 5-7 for utilization and bits 2-4 for class. + + + /// + /// Audio Major Class + /// + + kBluetoothDeviceClassMinorAudioUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorAudioHeadset = 0x01, // [000001] Device conforms to the Headset profile + kBluetoothDeviceClassMinorAudioHandsFree = 0x02, // [000010] Hands-free + kBluetoothDeviceClassMinorAudioReserved1 = 0x03, // [000011] Reserved + kBluetoothDeviceClassMinorAudioMicrophone = 0x04, // [000100] Microphone + kBluetoothDeviceClassMinorAudioLoudspeaker = 0x05, // [000101] Loudspeaker + kBluetoothDeviceClassMinorAudioHeadphones = 0x06, // [000110] Headphones + kBluetoothDeviceClassMinorAudioPortable = 0x07, // [000111] Portable Audio + kBluetoothDeviceClassMinorAudioCar = 0x08, // [001000] Car Audio + kBluetoothDeviceClassMinorAudioSetTopBox = 0x09, // [001001] Set-top box + kBluetoothDeviceClassMinorAudioHiFi = 0x0a, // [001010] HiFi Audio Device + kBluetoothDeviceClassMinorAudioVCR = 0x0b, // [001011] VCR + kBluetoothDeviceClassMinorAudioVideoCamera = 0x0c, // [001100] Video Camera + kBluetoothDeviceClassMinorAudioCamcorder = 0x0d, // [001101] Camcorder + kBluetoothDeviceClassMinorAudioVideoMonitor = 0x0e, // [001110] Video Monitor + kBluetoothDeviceClassMinorAudioVideoDisplayAndLoudspeaker = 0x0f, // [001111] Video Display and Loudspeaker + kBluetoothDeviceClassMinorAudioVideoConferencing = 0x10, // [010000] Video Conferencing + kBluetoothDeviceClassMinorAudioReserved2 = 0x11, // [010001] Reserved + kBluetoothDeviceClassMinorAudioGamingToy = 0x12, // [010010] Gaming/Toy + + + // Range 0x13 to 0x7F Reserved for future use. + + + /// + /// Peripheral Major Class + /// + + // Peripheral1 subclass is bits 7 & 6 + + kBluetoothDeviceClassMinorPeripheral1Keyboard = 0x10, // [01XXXX] Keyboard + kBluetoothDeviceClassMinorPeripheral1Pointing = 0x20, // [10XXXX] Pointing device + kBluetoothDeviceClassMinorPeripheral1Combo = 0x30, // [11XXXX] Combo keyboard/pointing device + + // Peripheral2 subclass is bits 5-2 + + kBluetoothDeviceClassMinorPeripheral2Unclassified = 0x00, // [XX0000] Uncategorized device + kBluetoothDeviceClassMinorPeripheral2Joystick = 0x01, // [XX0001] Joystick + kBluetoothDeviceClassMinorPeripheral2Gamepad = 0x02, // [XX0010] Gamepad + kBluetoothDeviceClassMinorPeripheral2RemoteControl = 0x03, // [XX0011] Remote control + kBluetoothDeviceClassMinorPeripheral2SensingDevice = 0x04, // [XX0100] Sensing device + kBluetoothDeviceClassMinorPeripheral2DigitizerTablet = 0x05, // [XX0101] Digitizer Tablet + kBluetoothDeviceClassMinorPeripheral2CardReader = 0x06, // [XX0110] Card Reader + + kBluetoothDeviceClassMinorPeripheral2AnyPointing = 'poin', // Anything under MinorPeripheral1Pointing + + // Range 0x05 to 0x0f reserved for future use + + + /// + /// Imaging Major Class + /// + + // Imaging1 subclass is bits 7 - 4 + + kBluetoothDeviceClassMinorImaging1Display = 0x04, // [XXX1XX] Display + kBluetoothDeviceClassMinorImaging1Camera = 0x08, // [XX1XXX] Camera + kBluetoothDeviceClassMinorImaging1Scanner = 0x10, // [X1XXXX] Scanner + kBluetoothDeviceClassMinorImaging1Printer = 0x20, // [1XXXXX] Printer + + // Imaging2 subclass is bits 3 - 2 + + kBluetoothDeviceClassMinorImaging2Unclassified = 0x00, // [XXXX00] Uncategorized, default + + // Range 0x01 - 0x03 reserved for future use + + + /// + /// Misc + /// + + kBluetoothDeviceClassMinorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothDeviceClassMinorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothDeviceClassMinorEnd +}; + + +// Peripheral devices bits 7 & 6 +#define BluetoothCoDMinorPeripheral1(minorClass) (minorClass & 0x30) + +// Peripheral devices bits 5 - 2 +#define BluetoothCoDMinorPeripheral2(minorClass) (minorClass & 0x0f) + +#pragma mark - +#pragma mark === L2CAP === + +//=========================================================================================================================== +// L2CAP +//=========================================================================================================================== + +enum +{ + kBluetoothL2CAPPSMSDP = 0x0001, + kBluetoothL2CAPPSMRFCOMM = 0x0003, + kBluetoothL2CAPPSMTCS_BIN = 0x0005, // Telephony Control Specifictation / TCS Binary + kBluetoothL2CAPPSMTCS_BIN_Cordless = 0x0007, // Telephony Control Specifictation / TCS Binary + kBluetoothL2CAPPSMBNEP = 0x000F, // Bluetooth Network Encapsulation Protocol + kBluetoothL2CAPPSMHIDControl = 0x0011, // HID profile - control interface + kBluetoothL2CAPPSMHIDInterrupt = 0x0013, // HID profile - interrupt interface + kBluetoothL2CAPPSMAVCTP = 0x0017, // Audio/Video Control Transport Protocol + kBluetoothL2CAPPSMAVDTP = 0x0019, // Audio/Video Distribution Transport Protocol + kBluetoothL2CAPPSMUID_C_Plane = 0x001D, // Unrestricted Digital Information Profile (UDI) + + // Range < 0x1000 reserved. + kBluetoothL2CAPPSMReservedStart = 0x0001, + kBluetoothL2CAPPSMReservedEnd = 0x1000, + + // Range 0x1001-0xFFFF dynamically assigned. + kBluetoothL2CAPPSMDynamicStart = 0x1001, + kBluetoothL2CAPPSMD2D = 0x100F, + kBluetoothL2CAPPSMDynamicEnd = 0xFFFF, + + kBluetoothL2CAPPSMNone = 0x0000 +}; + + +#pragma mark - +#pragma mark === SDP === + +//=========================================================================================================================== +// Service Discovery Protocol +//=========================================================================================================================== + +enum +{ + // General + + kBluetoothSDPUUID16Base = 0x0000, // 00000000-0000-1000-8000-00805f9b34fb + + // Protocols + + kBluetoothSDPUUID16SDP = 0x0001, // 00000001-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16UDP = 0x0002, // 00000002-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16RFCOMM = 0x0003, // 00000003-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCP = 0x0004, // 00000004-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCSBIN = 0x0005, // 00000005-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCSAT = 0x0006, // 00000006-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16OBEX = 0x0008, // 00000008-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16IP = 0x0009, // 00000009-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16FTP = 0x000A, // 0000000A-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16HTTP = 0x000C, // 0000000C-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16WSP = 0x000E, // 0000000E-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16BNEP = 0x000F, + kBluetoothSDPUUID16UPNP = 0x0010, + kBluetoothSDPUUID16HIDP = 0x0011, + kBluetoothSDPUUID16HardcopyControlChannel = 0x0012, + kBluetoothSDPUUID16HardcopyDataChannel = 0x0014, + kBluetoothSDPUUID16HardcopyNotification = 0x0016, + kBluetoothSDPUUID16AVCTP = 0x0017, + kBluetoothSDPUUID16AVDTP = 0x0019, + kBluetoothSDPUUID16CMPT = 0x001B, + kBluetoothSDPUUID16UDI_C_Plane = 0x001D, + kBluetoothSDPUUID16L2CAP = 0x0100, // 00000100-0000-1000-8000-00805f9b34fb +}; + +enum SDPServiceClasses +{ + kBluetoothSDPUUID16ServiceClassServiceDiscoveryServer = 0x1000, // 00001000-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassBrowseGroupDescriptor = 0x1001, // 00001001-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassPublicBrowseGroup = 0x1002, // 00001002-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassSerialPort = 0x1101, // 00001101-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassLANAccessUsingPPP = 0x1102, // 00001102-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassDialupNetworking = 0x1103, // 00001103-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassIrMCSync = 0x1104, // 00001104-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassOBEXObjectPush = 0x1105, // 00001105-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassOBEXFileTransfer = 0x1106, // 00001106-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassIrMCSyncCommand = 0x1107, // 00001107-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassHeadset = 0x1108, // 00001108-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassCordlessTelephony = 0x1109, // 00001109-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassAudioSource = 0x110A, + kBluetoothSDPUUID16ServiceClassAudioSink = 0x110B, + kBluetoothSDPUUID16ServiceClassAVRemoteControlTarget = 0x110C, + kBluetoothSDPUUID16ServiceClassAdvancedAudioDistribution = 0x110D, + kBluetoothSDPUUID16ServiceClassAVRemoteControl = 0x110E, + kBluetoothSDPUUID16ServiceClassVideoConferencing = 0x110F, + kBluetoothSDPUUID16ServiceClassIntercom = 0x1110, // 00001110-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassFax = 0x1111, // 00001111-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassHeadsetAudioGateway = 0x1112, // 00001112-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassWAP = 0x1113, + kBluetoothSDPUUID16ServiceClassWAPClient = 0x1114, + kBluetoothSDPUUID16ServiceClassPANU = 0x1115, + kBluetoothSDPUUID16ServiceClassNAP = 0x1116, + kBluetoothSDPUUID16ServiceClassGN = 0x1117, + kBluetoothSDPUUID16ServiceClassDirectPrinting = 0x1118, + kBluetoothSDPUUID16ServiceClassReferencePrinting = 0x1119, + kBluetoothSDPUUID16ServiceClassImaging = 0x111A, + kBluetoothSDPUUID16ServiceClassImagingResponder = 0x111B, + kBluetoothSDPUUID16ServiceClassImagingAutomaticArchive = 0x111C, + kBluetoothSDPUUID16ServiceClassImagingReferencedObjects = 0x111D, + kBluetoothSDPUUID16ServiceClassHandsFree = 0x111E, + kBluetoothSDPUUID16ServiceClassHandsFreeAudioGateway = 0x111F, + kBluetoothSDPUUID16ServiceClassDirectPrintingReferenceObjectsService = 0x1120, + kBluetoothSDPUUID16ServiceClassReflectedUI = 0x1121, + kBluetoothSDPUUID16ServiceClassBasicPrinting = 0x1122, + kBluetoothSDPUUID16ServiceClassPrintingStatus = 0x1123, + kBluetoothSDPUUID16ServiceClassHumanInterfaceDeviceService = 0x1124, + kBluetoothSDPUUID16ServiceClassHardcopyCableReplacement = 0x1125, + kBluetoothSDPUUID16ServiceClassHCR_Print = 0x1126, + kBluetoothSDPUUID16ServiceClassHCR_Scan = 0x1127, + kBluetoothSDPUUID16ServiceClassCommonISDNAccess = 0x1128, + kBluetoothSDPUUID16ServiceClassVideoConferencingGW = 0x1129, + kBluetoothSDPUUID16ServiceClassUDI_MT = 0x112A, + kBluetoothSDPUUID16ServiceClassUDI_TA = 0x112B, + kBluetoothSDPUUID16ServiceClassAudioVideo = 0x112C, + kBluetoothSDPUUID16ServiceClassSIM_Access = 0x112D, + kBluetoothSDPUUID16ServiceClassPhonebookAccess_PCE = 0x112E, + kBluetoothSDPUUID16ServiceClassPhonebookAccess_PSE = 0x112F, + kBluetoothSDPUUID16ServiceClassPhonebookAccess = 0x1130, + kBluetoothSDPUUID16ServiceClassHeadset_HS = 0x1131, + kBluetoothSDPUUID16ServiceClassMessageAccessServer = 0x1132, + kBluetoothSDPUUID16ServiceClassMessageNotificationServer = 0x1133, + kBluetoothSDPUUID16ServiceClassMessageAccessProfile = 0x1134, + kBluetoothSDPUUID16ServiceClassPnPInformation = 0x1200, // 00001200-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericNetworking = 0x1201, // 00001201-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericFileTransfer = 0x1202, // 00001202-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericAudio = 0x1203, // 00001203-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericTelephony = 0x1204 // 00001204-0000-1000-8000-00805f9b34fb +}; + +enum SDPAttributeIdentifierCodes +{ + kBluetoothSDPAttributeIdentifierServiceRecordHandle = 0x0000, + kBluetoothSDPAttributeIdentifierServiceClassIDList = 0x0001, + kBluetoothSDPAttributeIdentifierServiceRecordState = 0x0002, + kBluetoothSDPAttributeIdentifierServiceID = 0x0003, + kBluetoothSDPAttributeIdentifierProtocolDescriptorList = 0x0004, + kBluetoothSDPAttributeIdentifierBrowseGroupList = 0x0005, + kBluetoothSDPAttributeIdentifierLanguageBaseAttributeIDList = 0x0006, + kBluetoothSDPAttributeIdentifierServiceInfoTimeToLive = 0x0007, + kBluetoothSDPAttributeIdentifierServiceAvailability = 0x0008, + kBluetoothSDPAttributeIdentifierBluetoothProfileDescriptorList = 0x0009, + kBluetoothSDPAttributeIdentifierDocumentationURL = 0x000A, + kBluetoothSDPAttributeIdentifierClientExecutableURL = 0x000B, + kBluetoothSDPAttributeIdentifierIconURL = 0x000C, + kBluetoothSDPAttributeIdentifierAdditionalProtocolsDescriptorList = 0x000D, + + // Service Discovery Server + kBluetoothSDPAttributeIdentifierVersionNumberList = 0x0200, + kBluetoothSDPAttributeIdentifierServiceDatabaseState = 0x0201, + + // Browse Group Descriptor + kBluetoothSDPAttributeIdentifierGroupID = 0x0200, + + // PAN + kBluetoothSDPAttributeIdentifierIPSubnet = 0x0200, + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 + + // HID Required Type Section Notes + kBluetoothSDPAttributeIdentifierHIDReleaseNumber = 0x0200, // O uint16 7.11.1 + kBluetoothSDPAttributeIdentifierHIDParserVersion = 0x0201, // M uint16 - + kBluetoothSDPAttributeIdentifierHIDDeviceSubclass = 0x0202, // M uint8 7.11.2 Should match the low order 8 bits of CoD unless a combo device + kBluetoothSDPAttributeIdentifierHIDCountryCode = 0x0203, // M uint8 7.11.3 + kBluetoothSDPAttributeIdentifierHIDVirtualCable = 0x0204, // M bool 7.11.4 + kBluetoothSDPAttributeIdentifierHIDReconnectInitiate = 0x0205, // M bool 7.11.5 + kBluetoothSDPAttributeIdentifierHIDDescriptorList = 0x0206, // M sequence 7.11.6 Layout is defined in Section 6.2 of the HID Specification + kBluetoothSDPAttributeIdentifierHIDLangIDBaseList = 0x0207, // M sequence 7.11.7 + kBluetoothSDPAttributeIdentifierHIDSDPDisable = 0x0208, // O bool 7.11.8 + kBluetoothSDPAttributeIdentifierHIDBatteryPower = 0x0209, // O bool 7.11.9 + kBluetoothSDPAttributeIdentifierHIDRemoteWake = 0x020A, // O bool 7.11.10 + kBluetoothSDPAttributeIdentifierHIDProfileVersion = 0x020B, // M uint16 7.11.14 + kBluetoothSDPAttributeIdentifierHIDSupervisionTimeout = 0x020C, // O uint16 7.11.12 Default to 5 seconds or longer if not defined + kBluetoothSDPAttributeIdentifierHIDNormallyConnectable = 0x020D, // O bool 7.11.13 + kBluetoothSDPAttributeIdentifierHIDBootDevice = 0x020E, // M bool 7.11.11 Only defined for mice and keyboards as of HID 1.0 + +#endif + + kBluetoothSDPAttributeIdentifierServiceVersion = 0x0300, + kBluetoothSDPAttributeIdentifierExternalNetwork = 0x0301, // Cordless telephony + kBluetoothSDPAttributeIdentifierNetwork = 0x0301, // Handsfree Profile (HFP) + kBluetoothSDPAttributeIdentifierSupportedDataStoresList = 0x0301, // Sync Profile + kBluetoothSDPAttributeIdentifierFaxClass1Support = 0x0302, // Fax Profile + kBluetoothSDPAttributeIdentifierRemoteAudioVolumeControl = 0x0302, // GAP??? + kBluetoothSDPAttributeIdentifierFaxClass2_0Support = 0x0303, + kBluetoothSDPAttributeIdentifierSupporterFormatsList = 0x0303, + kBluetoothSDPAttributeIdentifierFaxClass2Support = 0x0304, + kBluetoothSDPAttributeIdentifierAudioFeedbackSupport = 0x0305, + kBluetoothSDPAttributeIdentifierNetworkAddress = 0x0306, // WAP + kBluetoothSDPAttributeIdentifierWAPGateway = 0x0307, // WAP + kBluetoothSDPAttributeIdentifierHomepageURL = 0x0308, // WAP + kBluetoothSDPAttributeIdentifierWAPStackType = 0x0309, // WAP + kBluetoothSDPAttributeIdentifierSecurityDescription = 0x030A, // PAN + kBluetoothSDPAttributeIdentifierNetAccessType = 0x030B, // PAN + kBluetoothSDPAttributeIdentifierMaxNetAccessRate = 0x030C, // PAN + kBluetoothSDPAttributeIdentifierSupportedCapabilities = 0x0310, // Imaging + kBluetoothSDPAttributeIdentifierSupportedFeatures = 0x0311, // Imaging & HFP + kBluetoothSDPAttributeIdentifierSupportedFunctions = 0x0312, // Imaging + kBluetoothSDPAttributeIdentifierTotalImagingDataCapacity = 0x0313, // Imaging + + kBluetoothSDPAttributeIdentifierServiceName = 0x0000, /* +language base offset*/ + kBluetoothSDPAttributeIdentifierServiceDescription = 0x0001, /* +language base offset*/ + kBluetoothSDPAttributeIdentifierProviderName = 0x0002 /* +language base offset*/ +}; + +enum SDPAttributeDeviceIdentificationRecord +{ + /* Values taken from the Bluetooth Device Identification specification, 1.0 draft, 1.16.2003 */ + + kBluetoothSDPAttributeDeviceIdentifierServiceDescription = 0x0001, /* String */ + kBluetoothSDPAttributeDeviceIdentifierDocumentationURL = 0x000A, /* URL */ + kBluetoothSDPAttributeDeviceIdentifierClientExecutableURL = 0x000B, /* URL */ + kBluetoothSDPAttributeDeviceIdentifierSpecificationID = 0x0200, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierVendorID = 0x0201, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierProductID = 0x0202, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierVersion = 0x0203, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierPrimaryRecord = 0x0204, /* Boolean */ + kBluetoothSDPAttributeDeviceIdentifierVendorIDSource = 0x0205, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierReservedRangeStart = 0x0206, + kBluetoothSDPAttributeDeviceIdentifierReservedRangeEnd = 0x02FF + +}; + +enum ProtocolParameters +{ + kBluetoothSDPProtocolParameterL2CAPPSM = 1, + kBluetoothSDPProtocolParameterRFCOMMChannel = 1, + kBluetoothSDPProtocolParameterTCPPort = 1, + kBluetoothSDPProtocolParameterUDPPort = 1, + kBluetoothSDPProtocolParameterBNEPVersion = 1, + kBluetoothSDPProtocolParameterBNEPSupportedNetworkPacketTypeList = 2 +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +//Inquiries with 'Extended Inquiry Response' (v2.1 specification) + +enum BluetoothHCIExtendedInquiryResponseDataTypes +{ + kBluetoothHCIExtendedInquiryResponseDataTypeFlags = 0x01, + kBluetoothHCIExtendedInquiryResponseDataType16BitServiceClassUUIDsWithMoreAvailable = 0x02, + kBluetoothHCIExtendedInquiryResponseDataType16BitServiceClassUUIDsCompleteList = 0x03, + kBluetoothHCIExtendedInquiryResponseDataType32BitServiceClassUUIDsWithMoreAvailable = 0x04, + kBluetoothHCIExtendedInquiryResponseDataType32BitServiceClassUUIDsCompleteList = 0x05, + kBluetoothHCIExtendedInquiryResponseDataType128BitServiceClassUUIDsWithMoreAvailable = 0x06, + kBluetoothHCIExtendedInquiryResponseDataType128BitServiceClassUUIDsCompleteList = 0x07, + kBluetoothHCIExtendedInquiryResponseDataTypeShortenedLocalName = 0x08, + kBluetoothHCIExtendedInquiryResponseDataTypeCompleteLocalName = 0x09, + kBluetoothHCIExtendedInquiryResponseDataTypeDeviceID = 0x10, + kBluetoothHCIExtendedInquiryResponseDataTypeManufacturerSpecificData = 0xFF +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + + +#ifdef __cplusplus + } +#endif diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHCIController.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHCIController.h.svn-base new file mode 100644 index 0000000..303795e --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHCIController.h.svn-base @@ -0,0 +1,1370 @@ +/* + File: IOBluetoothHCIController.h + Contains: Bluetooth Host Controller base class. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + + +#pragma once + +//==================================================================================================== +// Imports +//==================================================================================================== + +#import +#import +#import +#import + +#import + +#include + +#import + +#import +#import + +//==================================================================================================== +// Forward declarations +//==================================================================================================== + +class OSSet; +class IOWorkLoop; +class IOCommandGate; +class IOWorkQueue; +class IOBluetoothDevice; +class IOBluetoothHCIRequest; +class IOBluetoothHCIController; +class IOBluetoothACLMemoryDescriptor; +class IOTimerEventSource; +class IOBluetoothInactivityTimerEventSource; +class IOBluetoothHCIPacketLogUserClient; + +//==================================================================================================== +// defines, typdefs, etc. +//==================================================================================================== + +#define kNoReturnParam NULL + +typedef uint16_t DevicePublishNotificationStateType; +enum DevicePublishNotificationStateTypes +{ + kHasNotRegisteredForDevicePublishNotification = 0x0001, + kHasRegisteredForDevicePublishNotification = 0x0002, + kDevicePublishNotificationCalled = 0x0004, + kDevicePublishNotificationProcessed = 0x0008 +}; + +typedef UInt32 HCIDataHandlerType; +enum HCIDataHandlerTypes +{ + kTransportDataTypeHCIEvents, + kTransportDataTypeACL, + kTransportDataTypeSCO +}; + +typedef IOReturn (*IOBluetoothIncomingDataAction) ( IOBluetoothHCIController *hciController, UInt8 *inDataPtr, UInt32 inDataSize, UInt32 inSequenceNumber ); +typedef IOReturn (*IOBluetoothHCIControllerDataHandler) ( void * contextPtr, const UInt8 * data, UInt32 dataSize ); + +typedef struct HCIDataHandler HCIDataHandler; +struct HCIDataHandler +{ + IOBluetoothHCIControllerDataHandler procPtr; + void * contextPtr; +}; + +typedef struct HCIEventNotificationListener HCIEventNotificationListener; +struct HCIEventNotificationListener +{ + task_t owningTask; // Used to ID these things when adding/removing them from our listener pool. + mach_port_t port; // Mach port to send out the notificaton. + void * refCon; // RefCon for the port's use. +}; + +#define POWER_STATE_CHANGE_IN_PROGRESS() ( mCurrentInternalPowerState != mPendingInternalPowerState ) +#define IS_POWERING_DOWN() ( POWER_STATE_CHANGE_IN_PROGRESS() && ( mPendingInternalPowerState == kIOBluetoothHCIControllerInternalPowerStateOff ) ) + +//==================================================================================================== +// Callback structure for data: +//==================================================================================================== + +typedef struct SendDataContext +{ + // Data sent: + IOMemoryDescriptor *memoryDescriptorPointer; + + // Referece to the device that sent the data: + IOBluetoothDevice *devicePointer; + void *devicePointerContextInfo0; + void *devicePointerContextInfo1; + + // And the controller that received it: + IOBluetoothHCIController *hciController; + void *controllerPointerContextInfo0; + void *controllerPointerContextInfo1; + + // ReturnValue: + IOReturn sendingWasSuccessful; +} SendDataContext; + + +//==================================================================================================== +// Keep track of hearing devices +//==================================================================================================== +typedef struct HearingDeviceListType +{ + BluetoothDeviceAddress mDeviceAddress; + bool mRemoveDeviceCalled; + DevicePublishNotificationStateType mDevicePublishNotificationState; + HearingDeviceListType * mNextDevice; + HearingDeviceListType * mPreviousDevice; +} HearingDeviceListType; + +//==================================================================================================== +// IOBluetoothHCIController +//==================================================================================================== + +class IOBluetoothHCIController : public IOService +{ + // We don't make many friends, but at least we have a few... + + friend class IOBluetoothHCIPacketLogUserClient; + friend class IOBluetoothSerialManager; + friend class IOBluetoothHCIUserClient; + friend class IOBluetoothDevice; + friend class IOBluetoothHCIRequest; + + // IOKit stuff. + + OSDeclareDefaultStructors( IOBluetoothHCIController ) + +protected: + + IOWorkLoop * mWorkLoop; + IOCommandGate * mCommandGate; + IOWorkQueue * mWorkQueue; + IOTimerEventSource * mTimerEventSource; + Boolean mShouldRunInactivityTimer; + + // Data and request queue stuff. + + HCIEventNotificationListener* mHCIEventListenersList; + size_t mHCIEventListenersListSize; + HCIDataHandler* mHCIEventDataHandlerList; + size_t mHCIEventDataHandlerListSize; + HCIDataHandler* mACLDataHandlerList; + size_t mACLDataHandlerListSize; + HCIDataHandler* mSCODataHandlerList; + size_t mSCODataHandlerListSize; + + IOBluetoothHCIRequest * mBusyQueueHead; + IOBluetoothHCIRequest * mWaitQueueHead; + IOBluetoothHCIRequest ** mHCIRequestList; + + IOBluetoothDevice * mDeviceListHead; + + OSSet * mPacketLogClients; + UInt8 * mPacketLogBuffer; + UInt32 mPacketLogBufferSize; + + uint8_t * mEventDataBuffer; // Events without matching requests will use this. + size_t mEventDataBufferSize; + + // This keeps track of the ACL packets we actually sent: + BluetoothHCIBufferSize mHCIBufferSize; + UInt16 mNumOutstandingACLPackets; + + OSArray * mAllowedIncomingL2CAPChannels; + + UInt32 mNextAvailableSequenceNumber; + UInt32 mCurrentlyExecutingSequenceNumber; + UInt16 mActiveConnections; + + // Packet Queue description: + typedef struct QueuePacketHolder { + IOMemoryDescriptor *memDescriptor; // The data we need to send + SendDataContext * contextPtr; // Context pointer for the sent data. + IOBluetoothDevice * inTargetDevice; // The device that enqueued the data. + struct QueuePacketHolder *next; // The next block in the queue. + } QueuePacketHolder; + QueuePacketHolder *mACLQueueHead, *mACLQueueTail; + + // Counters to limit the number of packets in the queue (we do not want to go out of memory) + UInt32 mNumberOfPacketsInQueue; + + // The allowed RFCOMM channels + OSArray *mAllowedIncomingRFCOMMChannels; + + IOBluetoothHCIControllerInternalPowerState mCurrentInternalPowerState; + IOBluetoothHCIControllerInternalPowerState mPendingInternalPowerState; + Boolean mAsyncPowerStateChangeInProgress; + UInt32 mPendingPowerStateChangeOptions; + IOBluetoothHCIControllerPowerOptions mControllerPowerOptions; + Boolean mPowerStateChangeIsUserEnforced; + + Boolean mHardwareSetupComplete; + + IOBluetoothHCIControllerConfigState mControllerConfigState; + IOBluetoothHCIControllerConfigState mPreviousControllerConfigState; + + IOBluetoothHCIControllerFeatureFlags mControllerFeatureFlags; + + // Overrides. + + bool start( IOService * provider ); + + bool init( OSDictionary* dictionary ); + + virtual void free(); + +#if defined( MAC_OS_X_VERSION_10_5 ) + virtual void systemWillShutdown( IOOptionBits specifier ); +#endif + + static IOReturn initHardwareAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual bool initHardware( IOService * provider ); + + static IOReturn setupHardwareAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOReturn setupHardware( IOService* provider ); + + virtual void hardwareSetupComplete( IOReturn status ); + + virtual void setConfigState( IOBluetoothHCIControllerConfigState configState ); + virtual bool terminate( IOOptionBits options = 0 ); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + + void stop( IOService * provider ); + + IOReturn newUserClient( task_t owningTask, + void * securityID, + UInt32 type, + IOUserClient ** handler ); + + uint32_t CountExistingHCIControllers(); + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags, + unsigned long powerState, + IOService * from ); + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags powerFlags ); + + // Our protected custom stuff. + + static IOReturn DetachUserClientsAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual void DetachUserClients(); + + static IOReturn setPropertiesAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOReturn setPropertiesWL( OSObject * properties ); + + static IOReturn AddPacketLogUserClientAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOReturn AddPacketLogUserClient( IOBluetoothHCIPacketLogUserClient *newPacketLogUserClient ); + + virtual bool PacketLogFillBufferedData(); + + virtual void PacketLogClientClosed( IOBluetoothHCIPacketLogUserClient *packetLogClient ); + + virtual void LogPacket( UInt8 packetType, void *packetData, size_t packetSize ); + + static IOReturn LogPacketAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + + virtual void DesyncIncomingData( IOBluetoothIncomingDataAction action, UInt8 *inDataPtr, UInt32 inDataSize ); + + static void DesyncIncomingDataAction( IOBluetoothHCIController *hciController, IOBluetoothIncomingDataAction action, void *inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber ); + + virtual void SynchronizePacketSequence( UInt32 sequenceNumber ); + + virtual IOReturn AddDevice( IOBluetoothDevice *inDevice ); + + virtual IOReturn RemoveDevice( IOBluetoothDevice *inDevice ); + + virtual IOReturn CreateDeviceFromConnectionResults( BluetoothHCIEventConnectionCompleteResults *connectionResults ); + + virtual IOReturn DestroyDeviceWithDisconnectionResults( BluetoothHCIEventDisconnectionCompleteResults *disconnectionResults ); + + virtual IOReturn DestroyDevice( IOBluetoothDevice *inDevice ); + + virtual IOReturn DestroyAllDevices(); + + virtual void FlushDeviceACLPackets( IOBluetoothDevice *inDevice ); + + virtual void DecrementOutstandingACLPackets( UInt16 delta ); + + virtual void ProcessFlushOccurredEvent( BluetoothHCIEventFlushOccurredResults *inFlushResults ); + + virtual void ProcessNumCompletedPacketsEvent( UInt8 *inDataPtr ); + + virtual void ProcessHCIControllerResetEvent(); + + virtual IOReturn DispatchIncomingACLData( UInt8 *inDataPtr, UInt32 inDataSize ); + + // Common methods for L2CAP and RFCOMM channel managment: + virtual void MergeChannelDescription(OSDictionary *destination , OSDictionary *source); + virtual void RemoveChannelRestrictions(OSDictionary *toChange , OSDictionary *removeRule, const char *key); + virtual Boolean IsAllowedDevice(OSDictionary *description , IOBluetoothDevice *device); + virtual void RemoveAllRules(); + + // L2CAP channel managment methods: + virtual void RemoveAllowedIncomingL2CAPChannel( OSObject *channelID ); + virtual IOReturn AddAllowedIncomingL2CAPChannel( OSDictionary *channelDescription ); + virtual OSDictionary *GetIncomingL2CAPChannelDescription( OSNumber *psmNumber ); + + // L2CAP channel accessory methods: + virtual void AddAllowedIncomingL2CAPChannel( BluetoothL2CAPPSM incomingPSM ); + virtual void AddAllowedIncomingL2CAPChannel( OSNumber *psmNumber ); + virtual void RemoveAllowedIncomingL2CAPChannel( BluetoothL2CAPPSM incomingPSM ); + + // RFCOMM channel managment methods: + virtual OSDictionary *GetIncomingRFCOMMChannelDescription( OSNumber *channelIDNumber ); + virtual IOReturn AddAllowedIncomingRFCOMMChannel( OSDictionary *channelDescription ); + virtual void RemoveAllowedIncomingRFCOMMChannel( OSObject *channelID ); + + // RFCOMM channel accessory methods: + virtual void AddAllowedIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + virtual void AddAllowedIncomingRFCOMMChannel( OSNumber *channelIDNumber ); + virtual void AddSecureIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + virtual void AddSecureIncomingRFCOMMChannel( OSNumber *channelIDNumber ); + virtual void RemoveAllowedIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + + virtual IOReturn TransferACLPacketToHW(IOMemoryDescriptor *memDescriptor, + SendDataContext * contextPtr); + + // ACL Packet queue: + virtual IOReturn EnqueuePacket( IOMemoryDescriptor *memDescriptor, + SendDataContext *contextPtr, + IOBluetoothDevice *inTargetDevice); + + virtual IOReturn DequeuePacket(); + + virtual IOReturn RemoveAllPacketsBelongingTo(IOBluetoothDevice *inTargetDevice); + +public: + + // IOWorkLoop and IOCommandGate accessors + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOCommandGate *getCommandGate() const; + + virtual IOReturn setProperties( OSObject * properties ); + + // Subclasses must implement these for it to be a working transport + // in the Bluetooth Family world. + + virtual IOReturn SendHCIRequest( UInt8 * buffer, + IOByteCount bufferSize ); + + static IOReturn SendACLCompletedAction ( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + virtual void SendACLCompleted( SendDataContext *contextPtr); + + virtual IOReturn SendACLData( IOMemoryDescriptor *memDescriptor, + SendDataContext * contextPtr ); + + virtual IOReturn GetTransportInfo( BluetoothTransportInfo * infoStruct ); + + static IOReturn SendSCOCompletedAction ( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + // Override to do something custom with the data. Otherwise, the registered data handler + // will get a peek at it. + + // The ProcessXXXData() functions are safe to be called from anywhere. + // They call ProcessXXXDataWL() on the workloop using ProcessXXXDataAction() + + virtual void ProcessEventData( UInt8 * inDataPtr, UInt32 inDataSize ); + + virtual void ProcessACLData( UInt8 * data, UInt32 dataSize ); + + virtual void ProcessSCOData( UInt8 * data, UInt32 dataSize, UInt32 inMissingData, AbsoluteTime inTimestamp, Boolean copyData ); + + virtual void ProcessEventDataWL( UInt8 * inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber ); + + virtual void ProcessACLDataWL( UInt8 * data, UInt32 dataSize, UInt32 sequenceNumber ); + + virtual void ProcessSCODataWL( UInt8 * data, UInt32 dataSize, UInt32 inMissingData, AbsoluteTime inTimestamp, Boolean copyData ); + + static IOReturn ProcessEventDataAction( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inSequenceNumber ); + + static IOReturn ProcessACLDataAction( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inSequenceNumber ); + + // The following is only a "ghost" call and exists only to make the compiler happy, its implementation + // does not do anything. + static IOReturn ProcessSCODataAction( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inMissingData, + UInt32 inTimestampHi, + UInt32 inTimestampLo, + Boolean inCopyData ); + + static IOReturn ProcessSCODataActionAT( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inMissingData, + AbsoluteTime* inTimestamp, + Boolean inCopyData ); + + // Data processing helpers. + + virtual bool GetCompleteCodeForCommand( BluetoothHCICommandOpCode inOpCode, + BluetoothHCIEventCode *outEventCode ); + + virtual bool GetOpCodeAndEventCode( UInt8 * inDataPtr, + BluetoothHCICommandOpCode * outOpCode, + BluetoothHCIEventCode * eventCode, + BluetoothHCIEventStatus * outStatus, + BluetoothDeviceAddress * outDeviceAddress, + BluetoothConnectionHandle * outConnectionHandle ); + + virtual IOReturn FindConnectionCompleteType( BluetoothHCICommandOpCode * outOpCode ); + + virtual IOReturn HandleSpecialOpcodes( BluetoothHCICommandOpCode opCode ); + + // This is a hook for other interested parties to get HCI event notifications. When a user client is created, + // that mach_port_t will be passed on to us via these calls so that their port will get HCI events that aren't + // specifically tied to a requst object, but occur due to requests they make. + + virtual IOReturn AddHCIEventNotification( task_t inOwningTask, mach_port_t inPort, void * refCon ); + + virtual void BroadcastEventNotification( BluetoothHCIRequestID inID, + BluetoothHCIEventCode inEventCode, + IOReturn eventStatus, + UInt8 * inDataToSendPtr, + IOByteCount inDataSize, + BluetoothHCICommandOpCode inOpCode ); + + virtual void BroadcastConfigStateChangeNotification( IOBluetoothHCIControllerConfigState oldState, + IOBluetoothHCIControllerConfigState newState ); + + virtual IOReturn RemoveHCIEventNotification( task_t inOwningTask ); + + // This is a hook for other interested parties to get data from transports. They will register itself + // with these to receive the raw data from the transport, bypassing HCI code. + + virtual IOReturn AddDataClient( HCIDataHandlerType inType, + IOBluetoothHCIControllerDataHandler inProcPtr, + void * inContextPtr ); + + virtual IOReturn NotifyDataClients( HCIDataHandlerType inType, UInt8 * inDataPtr, UInt32 inDataSize ); + + virtual IOReturn RemoveDataClient( HCIDataHandlerType inType, IOBluetoothHCIControllerDataHandler inProcPtr ); + + // Request creation, deletion and other data processing stuff. + + virtual IOReturn HCIRequestCreate( BluetoothHCIRequestID * outRequestID, + bool inDoAsyncNotify = TRUE, + UInt32 inTimeout = 5, + BluetoothHCIRequestCallbackInfo * inCallbackInfo = NULL, + task_t inTaskID = 0, + UInt32 inControlFlags = 0 ); + + virtual IOReturn HCIRequestDelete( task_t inTask, BluetoothHCIRequestID inID ); + + virtual IOReturn LookupRequest( BluetoothHCIRequestID inID, IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn PrepareRequestForNewCommand( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inDeviceAddress, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn EnqueueRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn FindQueuedRequest( BluetoothHCICommandOpCode opCode, + BluetoothDeviceAddress * inDeviceAddress, + BluetoothConnectionHandle inConnectionHandle, + Boolean inUseAttributes, + IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn DequeueRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn EnqueueWaitRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn FindQueuedWaitRequest( BluetoothHCICommandOpCode opCode, IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn DequeueWaitRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn AbortRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn FindNextExpiringRequest( BluetoothHCICommandOpCode opCode, IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn ProcessWaitingRequests(); + + inline IOBluetoothHCIRequest* GetNextWaitRequest() { return( mWaitQueueHead ); } + + inline IOBluetoothHCIRequest* GetNextBusyRequest() { return( mBusyQueueHead ); } + + virtual void TakeAHexDump( const void *inData, UInt32 inDataSize ); + + virtual IOReturn DumpStats(); + + virtual IOBluetoothHCIControllerPowerOptions GetControllerPowerOptions(); + virtual IOBluetoothHCIControllerInternalPowerState GetControllerPowerState(); + virtual IOReturn WaitForControllerPowerState( IOBluetoothHCIControllerInternalPowerState powerState ); + + virtual IOReturn RequestPowerStateChange( IOBluetoothHCIControllerInternalPowerState newPowerState ); + + virtual IOReturn SendHCIRequestFormatted( BluetoothHCIRequestID inID, + BluetoothHCICommandOpCode inOpCode, + IOByteCount outResultsSize, + void * outResultsPtr, + const char * inFormat, + ... ); + + static void RequestExpired( OSObject *owner, IOTimerEventSource *sender ); + + // Misc stuff. + + IOReturn DisposeRequestsForTaskID( task_t inTaskID ); + + IOReturn KillAllPendingRequests( Boolean destroy, Boolean includeIdleRequests ); + void SendingRequest( IOBluetoothHCIRequest *requestPtr ); + void DecrementActiveConnections( ); + + virtual void ActiveConnectionsInProgress( ); + virtual void AllConnectionsGone( ); + + virtual IOReturn SendRawHCICommand( BluetoothHCIRequestID inID, + char * buffer, + UInt32 bufferSize ); + + // Vendor Specific stuff. + + virtual IOReturn VendorCommand( BluetoothHCIRequestID inID, + BluetoothHCIVendorCommandSelector inSelector, + UInt8 * inCommandData, + IOByteCount inCommandDataSize, + IOByteCount outBufferSize, + UInt8 * outBuffer ); + + // IOBluetoothDevice object management + + virtual IOBluetoothDevice * FindDeviceWithHandle( BluetoothConnectionHandle inConnectionHandle ); + + virtual IOBluetoothDevice * FindDeviceWithAddress( const BluetoothDeviceAddress *inDeviceAddress ); + + virtual IOReturn SendACLPacket( IOBluetoothACLMemoryDescriptor *memDescriptor, + SendDataContext * contextPtr, + IOBluetoothDevice * inTargetDevice = NULL ); + + + // API for the serial manager to open a new connection + + virtual IOBluetoothDevice *OpenDeviceConnection( const BluetoothDeviceAddress *inDeviceAddress ); + + static IOReturn OpenDeviceConnectionAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOBluetoothDevice *OpenDeviceConnectionWL( const BluetoothDeviceAddress *inDeviceAddress ); + + // API to track the secure state of RFCOMM channels + virtual Boolean IsSecureIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + virtual Boolean IsSecureIncomingRFCOMMChannel( OSNumber *channelIDNumber ); + + // API to track allowed incoming L2CAP and RFCOMM channels given a device: + virtual Boolean IsAllowedIncomingL2CAPChannelForDevice( BluetoothL2CAPPSM incomingPSM, IOBluetoothDevice *device ); + virtual Boolean IsAllowedIncomingRFCOMMChannelForDevice( BluetoothRFCOMMChannelID incomingChannelID, IOBluetoothDevice *device ); + + // Enabled state for RFCOMM channels: + virtual void SetEnabledIncomingRFCOMMChannel( OSNumber *channelIDNumber, bool ShouldBeEnabled); + virtual void SetEnabledIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID, bool ShouldBeEnabled); + + virtual Boolean ShouldRunInactivityTimer(); // NOT USED: See StartIdleTimer + virtual void SetRunInactivityTimer( Boolean shouldRun ); // NOT USED: See StopIdleTimer + + //============================ + + // From here on out, we implement each of the commands in the HCI spec. You can work around + // hardware bugs by overriding any of these functions if necessary. + + + // Link Control Commands. + + virtual IOReturn BluetoothHCIInquiry( BluetoothHCIRequestID inID, + BluetoothLAP inLAP, + BluetoothHCIInquiryLength inInquiryLength, + BluetoothHCIResponseCount inMaxResponseCount, + BluetoothHCIInquiryResults * outResults ); + + virtual IOReturn BluetoothHCIInquiryCancel( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIPeriodicInquiryMode( BluetoothHCIRequestID inID, + BluetoothHCIInquiryLength inMaxPeriodLength, + BluetoothHCIInquiryLength inMinPeriodLength, + BluetoothLAP inLAP, + BluetoothHCIInquiryLength inInquiryLength, + BluetoothHCIResponseCount inMaxResponses, + BluetoothHCIInquiryResults * outResults ); + + virtual IOReturn BluetoothHCIExitPeriodicInquiryMode( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCICreateConnection( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothPacketType inPacketType, + BluetoothPageScanRepetitionMode inPageScanRepetitionMode, + BluetoothPageScanMode inPageScanMode, + BluetoothClockOffset inClockOffset, + BluetoothAllowRoleSwitch inAllowRoleSwitch, + BluetoothHCIEventConnectionCompleteResults *outConnectionHandle ); + + virtual IOReturn BluetoothHCIDisconnect( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothReasonCode inReason, + BluetoothHCIEventDisconnectionCompleteResults * outResults ); + + virtual IOReturn BluetoothHCIAddSCOConnection( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inACLConnectionHandle, + BluetoothPacketType inPacketType ); + + virtual IOReturn BluetoothHCIAcceptConnectionRequest( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothRole inRole ); + + virtual IOReturn BluetoothHCIRejectConnectionRequest( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothReasonCode inReason ); + + virtual IOReturn BluetoothHCILinkKeyRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + const BluetoothKey * inKeyPtr, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCILinkKeyRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCIPINCodeRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + IOByteCount inPINCodeSize, + const BluetoothPINCode * inPINCode, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCIPINCodeRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCIChangeConnectionPacketType( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothPacketType inPacketType ); + + virtual IOReturn BluetoothHCIAuthenticationRequested( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCISetEncryptionEnable( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothEncryptionEnable inEncryptionEnable ); + + virtual IOReturn BluetoothHCIChangeConnectionLinkKey( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIMasterLinkKey( BluetoothHCIRequestID inID, + BluetoothKeyFlag inKeyFlag ); + + virtual IOReturn BluetoothHCIRemoteNameRequest( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothPageScanRepetitionMode inPageScanRepetitionMode, + BluetoothPageScanMode inPageScanMode, + BluetoothClockOffset inClockOffset, + BluetoothHCIEventRemoteNameRequestResults * outName ); + + virtual IOReturn BluetoothHCIReadRemoteSupportedFeatures( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIEventReadRemoteSupportedFeaturesResults * outFeatures ); + + virtual IOReturn BluetoothHCIReadRemoteVersionInformation( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIEventReadRemoteVersionInfoResults * outVersionInfo ); + + virtual IOReturn BluetoothHCIReadClockOffset( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothClockOffset * outClockOffset ); + + // Link Policy commands. + + virtual IOReturn BluetoothHCIHoldMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIModeInterval inHoldModeMaxInterval, + BluetoothHCIModeInterval inHoldModeMinInterval ); + + virtual IOReturn BluetoothHCISniffMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIModeInterval inSniffModeMaxInterval, + BluetoothHCIModeInterval inSniffModeMinInterval, + BluetoothHCISniffAttemptCount inSniffAttemptCount, + BluetoothHCISniffTimeout inSniffModeTimeout ); + + virtual IOReturn BluetoothHCIExitSniffMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIParkMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIParkModeBeaconInterval inMaxInterval, + BluetoothHCIParkModeBeaconInterval inMinInterval ); + + virtual IOReturn BluetoothHCIExitParkMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIQualityOfServiceSetup( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIQualityOfServiceSetupParams * inSetupPtr ); + + virtual IOReturn BluetoothHCIRoleDiscovery( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIRoleInfo * outRoleInfo ); + + virtual IOReturn BluetoothHCISwitchRole( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * inAddressPtr, + BluetoothHCIRole inNewRole ); + + virtual IOReturn BluetoothHCIReadLinkPolicySettings( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCILinkPolicySettingsInfo * outSettingsInfo ); + + virtual IOReturn BluetoothHCIWriteLinkPolicySettings( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCILinkPolicySettings inSettings, + BluetoothConnectionHandle * outConnectionHandle ); + + // Host controller and baseband commands. + + virtual IOReturn BluetoothHCISetEventMask( BluetoothHCIRequestID inID, + BluetoothSetEventMask * inMask ); + + virtual IOReturn BluetoothHCIReset( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCISetEventFilter( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIFlush( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inHandle ); + + virtual IOReturn BluetoothHCIReadPINType( BluetoothHCIRequestID inID, + BluetoothPINType * outType ); + + virtual IOReturn BluetoothHCIWritePINType( BluetoothHCIRequestID inID, + BluetoothPINType inType ); + + virtual IOReturn BluetoothHCICreateNewUnitKey( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIReadStoredLinkKey( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * targetDevice, + BluetoothHCIReadStoredLinkKeysFlag * inFlags, + BluetoothHCIStoredLinkKeysInfo * outKeysInfo ); + + virtual IOReturn BluetoothHCIWriteStoredLinkKey( BluetoothHCIRequestID inID, + IOItemCount inNumKeysToWrite, + BluetoothDeviceAddress inDeviceAddresses[], + BluetoothKey inLinkKeys[], + BluetoothHCINumLinkKeysToWrite * outNumKeysWritten ); + + virtual IOReturn BluetoothHCIDeleteStoredLinkKey( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * targetDevice, + BluetoothHCIDeleteStoredLinkKeyFlag * inFlag, + BluetoothHCINumLinkKeysDeleted * outNumDeleted ); + + virtual IOReturn BluetoothHCIReadLocalName( BluetoothHCIRequestID inID, + BluetoothDeviceName name ); + + virtual IOReturn BluetoothHCIChangeLocalName( BluetoothHCIRequestID inID, + BluetoothDeviceName newName ); + + virtual IOReturn BluetoothHCIReadConnectionAcceptTimeout( BluetoothHCIRequestID inID, + BluetoothHCIConnectionAcceptTimeout * outTimeout ); + + virtual IOReturn BluetoothHCIWriteConnectionAcceptTimeout( BluetoothHCIRequestID inID, + BluetoothHCIConnectionAcceptTimeout inTimeout ); + + virtual IOReturn BluetoothHCIReadPageTimeout( BluetoothHCIRequestID inID, + BluetoothHCIPageTimeout * outDataPtr ); + + virtual IOReturn BluetoothHCIWritePageTimeout( BluetoothHCIRequestID inID, + BluetoothHCIPageTimeout inTimeout ); + + virtual IOReturn BluetoothHCIReadScanEnable( BluetoothHCIRequestID inID, + BluetoothHCIPageScanEnableState * outState ); + + virtual IOReturn BluetoothHCIWriteScanEnable( BluetoothHCIRequestID inID, + BluetoothHCIPageScanEnableState inState ); + + virtual IOReturn BluetoothHCIReadPageScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * outActivityInfo ); + + virtual IOReturn BluetoothHCIWritePageScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * inActivityInfo ); + + virtual IOReturn BluetoothHCIReadInquiryScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * outActivityInfo ); + + virtual IOReturn BluetoothHCIWriteInquiryScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * inActivityInfo ); + + virtual IOReturn BluetoothHCIReadAuthenticationEnable( BluetoothHCIRequestID inID, + BluetoothHCIAuthenticationEnable * outAuthenticationState ); + + virtual IOReturn BluetoothHCIWriteAuthenticationEnable( BluetoothHCIRequestID inID, + BluetoothHCIAuthenticationEnable inAuthenticationState ); + + virtual IOReturn BluetoothHCIReadEncryptionMode( BluetoothHCIRequestID inID, + BluetoothHCIEncryptionMode * outEncryptionState ); + + virtual IOReturn BluetoothHCIWriteEncryptionMode( BluetoothHCIRequestID inID, + BluetoothHCIEncryptionMode inEncryptionMode ); + + virtual IOReturn BluetoothHCIReadClassOfDevice( BluetoothHCIRequestID inID, + BluetoothClassOfDevice * outClassOfDevice ); + + virtual IOReturn BluetoothHCIWriteClassOfDevice( BluetoothHCIRequestID inID, + BluetoothClassOfDevice inClassOfDevice ); + + virtual IOReturn BluetoothHCIReadVoiceSetting( BluetoothHCIRequestID inID, + BluetoothHCIVoiceSetting * outVoiceSetting ); + + virtual IOReturn BluetoothHCIWriteVoiceSetting( BluetoothHCIRequestID inID, + BluetoothHCIVoiceSetting inVoiceSetting ); + + virtual IOReturn BluetoothHCIReadAutomaticFlushTimeout( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIAutomaticFlushTimeoutInfo * outAutomaticFlushTimeoutInfo ); + + + virtual IOReturn BluetoothHCIWriteAutomaticFlushTimeout( BluetoothHCIRequestID inID, + BluetoothHCIAutomaticFlushTimeoutInfo * inAutomaticFlushTimeoutInfo, + BluetoothConnectionHandle * outConnectionHandle ); + + virtual IOReturn BluetoothHCIReadNumBroadcastRetransmissions( BluetoothHCIRequestID inID, + BluetoothHCINumBroadcastRetransmissions * outNumRetrans ); + + virtual IOReturn BluetoothHCIWriteNumBroadcastRetransmissions( BluetoothHCIRequestID inID, + BluetoothHCINumBroadcastRetransmissions inNumRetrans ); + + virtual IOReturn BluetoothHCIReadHoldModeActivity( BluetoothHCIRequestID inID, + BluetoothHCIHoldModeActivity * outState ); + + virtual IOReturn BluetoothHCIWriteHoldModeActivity( BluetoothHCIRequestID inID, + BluetoothHCIHoldModeActivity inState ); + + virtual IOReturn BluetoothHCIReadTransmitPowerLevel( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inHandle, + BluetoothHCITransmitPowerLevelType inType, + BluetoothHCITransmitPowerLevelInfo * outLevelInfo ); + + virtual IOReturn BluetoothHCIReadSCOFlowControlEnable( BluetoothHCIRequestID inID, + BluetoothHCIFlowControlState * outState ); + + virtual IOReturn BluetoothHCIWriteSCOFlowControlEnable( BluetoothHCIRequestID inID, + BluetoothHCIFlowControlState inState ); + + virtual IOReturn BluetoothHCISetHostControllerToHostFlowControl( BluetoothHCIRequestID inID, + BluetoothHCIFlowControlState inState ); + + virtual IOReturn BluetoothHCIHostBufferSize( BluetoothHCIRequestID inID, + BluetoothHCIBufferSize * inSize ); + + virtual IOReturn BluetoothHCIHostNumberOfCompletePackets( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIReadLinkSupervisionTimeout( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inHandle, + BluetoothHCILinkSupervisionTimeout * outInfo ); + + virtual IOReturn BluetoothHCIWriteLinkSupervisionTimeout( BluetoothHCIRequestID inID, + BluetoothHCILinkSupervisionTimeout * inInfo, + BluetoothConnectionHandle * outHandle ); + + virtual IOReturn BluetoothHCIReadNumberOfSupportedIAC( BluetoothHCIRequestID inID, + BluetoothHCISupportedIAC * outNumSupported ); + + virtual IOReturn BluetoothHCIReadCurrentIACLAP( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIWriteCurrentIACLAP( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIReadPageScanPeriodMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanPeriodMode * outMode ); + + virtual IOReturn BluetoothHCIWritePageScanPeriodMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanPeriodMode inMode ); + + virtual IOReturn BluetoothHCIReadPageScanMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanMode * outMode ); + + virtual IOReturn BluetoothHCIWritePageScanMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanMode inMode ); + + // Informational commands. + + virtual IOReturn BluetoothHCIReadLocalVersionInformation( BluetoothHCIRequestID inID, + BluetoothHCIVersionInfo * outVersionInfo ); + + virtual IOReturn BluetoothHCIReadLocalSupportedFeatures( BluetoothHCIRequestID inID, + BluetoothHCISupportedFeatures * outFeatures ); + + virtual IOReturn BluetoothHCIReadBufferSize( BluetoothHCIRequestID inID, + BluetoothHCIBufferSize * outSize ); + + virtual IOReturn BluetoothHCIReadCountryCode( BluetoothHCIRequestID inID, + BluetoothHCICountryCode * outCountryCode ); + + virtual IOReturn BluetoothHCIReadDeviceAddress( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * outAddress ); + + // Status commands. + + virtual IOReturn BluetoothHCIReadFailedContactCounter( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIFailedContactInfo * outFailedContactCount ); + + virtual IOReturn BluetoothHCIResetFailedContactCounter( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIGetLinkQuality( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCILinkQualityInfo * outLinkQualityInfo ); + + virtual IOReturn BluetoothHCIReadRSSI( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIRSSIInfo * outRSSIInfo ); + + // Testing Commands. + + virtual IOReturn BluetoothHCIReadLoopbackMode( BluetoothHCIRequestID inID, + BluetoothHCILoopbackMode * inLoopbackMode ); + + virtual IOReturn BluetoothHCIWriteLoopbackMode( BluetoothHCIRequestID inID, + BluetoothHCILoopbackMode inLoopbackMode ); + + virtual IOReturn BluetoothHCIEnableDeviceUnderTestMode( BluetoothHCIRequestID inID ); + + virtual IOBluetoothHCIControllerFeatureFlags GetControllerFeatureFlags(); + +protected: + + // Power managment functions: + + virtual bool configurePM(IOService *provider); + + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService* whatDevice ); + static IOReturn setPowerStateAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + virtual IOReturn setPowerStateWL( unsigned long powerStateOrdinal, IOService* whatDevice ); + + virtual void UpdatePowerStateProperty( IOBluetoothHCIControllerInternalPowerState powerState ); + + virtual void SetControllerPowerOptions( IOBluetoothHCIControllerPowerOptions controllerPowerOptions ); + virtual IOReturn PerformPowerStateChange( IOBluetoothHCIControllerInternalPowerState oldPowerState, + IOBluetoothHCIControllerInternalPowerState newPowerState, + UInt32 powerStateOptions, + UInt32 *microsecondsUntilComplete ); + virtual void CompletePowerStateChange(); + + virtual void SetControllerFeatureFlags( IOBluetoothHCIControllerFeatureFlags featureFlags ); + + virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ); + + // Enablers for future Changes. + + typedef struct ExpansionData + { + void *mUnsedPointer1, *mUnsedPointer2; + + // Max number of HCI command allowed; + UInt8 mNumberOfCommandsAllowedByHardware; + UInt8 mNumConfiguredHIDDevices; + UInt8 mControllerSleepFlags; + + // This pointer is depreacted and free for future uses. + void* mUnusedPointer; + + // AFH support: + // the mask for the channels to use: + UInt8 mMaskByte[10]; + + // AirPort changes notifications: + IONotifier *windowServerNotifier; + IONotifier *mAirPortPCI; + Boolean mProcessingConnectionRequest; + Boolean mWaitingForCompletedACLPacketsToSleep; + + // SCO Support + UInt8 mNumSCOConnections; + UInt8 *mSCOPacketBuffer; + UInt16 mNumBufferedSCOBytes; + AbsoluteTime mBufferedSCOPacketTimestamp; + + // Repository for the packets when logging at boot + OSArray *mRepositoryForBoot; + UInt16 mMaxNumberOfBootPackets; + + IOService *mOverriddenControllerProvider; + + size_t mHCIRequestListSize; + uint32_t mNewRequestIndex; + + IOBluetoothInactivityTimerEventSource *mIdleTimer; + Boolean mSystemOnTheWayToSleep; + + // New Airport notifications: + IONotifier *mIO80211Interface; + + UInt32 mNextAvailableSCOSequenceNumber; + UInt32 mCurrentlyExecutingSCOSequenceNumber; + + Boolean mNeedToCleanUpWaitForAckQueue; + Boolean mResettingDevice; + + HearingDeviceListType *mConnectedHearingDeviceListHead; + HearingDeviceListType *mConnectedHearingDeviceListTail; + + } ExpansionData; + + ExpansionData* mExpansionData; + +#define mConnectedHearingDeviceListTail IOBluetoothHCIController::mExpansionData->mConnectedHearingDeviceListTail +#define mConnectedHearingDeviceListHead IOBluetoothHCIController::mExpansionData->mConnectedHearingDeviceListHead +#define mResettingDevice IOBluetoothHCIController::mExpansionData->mResettingDevice +#define mNeedToCleanUpWaitForAckQueue IOBluetoothHCIController::mExpansionData->mNeedToCleanUpWaitForAckQueue +#define mNextAvailableSCOSequenceNumber IOBluetoothHCIController::mExpansionData->mNextAvailableSCOSequenceNumber +#define mCurrentlyExecutingSCOSequenceNumber IOBluetoothHCIController::mExpansionData->mCurrentlyExecutingSCOSequenceNumber + +#define mNumberOfCommandsAllowedByHardware IOBluetoothHCIController::mExpansionData->mNumberOfCommandsAllowedByHardware +#define mNumConfiguredHIDDevices IOBluetoothHCIController::mExpansionData->mNumConfiguredHIDDevices +#define mControllerSleepFlags IOBluetoothHCIController::mExpansionData->mControllerSleepFlags +#define mSleepWakeNotifier IOBluetoothHCIController::mExpansionData->mSleepWakeNotifier + +#define mMaskByte IOBluetoothHCIController::mExpansionData->mMaskByte +#define windowServerNotifier IOBluetoothHCIController::mExpansionData->windowServerNotifier +#define mAirPortPCI IOBluetoothHCIController::mExpansionData->mAirPortPCI +#define mProcessingConnectionRequest IOBluetoothHCIController::mExpansionData->mProcessingConnectionRequest +#define mWaitingForCompletedACLPacketsToSleep IOBluetoothHCIController::mExpansionData->mWaitingForCompletedACLPacketsToSleep + +#define mNumSCOConnections IOBluetoothHCIController::mExpansionData->mNumSCOConnections +#define mSCOPacketBuffer IOBluetoothHCIController::mExpansionData->mSCOPacketBuffer +#define mNumBufferedSCOBytes IOBluetoothHCIController::mExpansionData->mNumBufferedSCOBytes +#define mBufferedSCOPacketTimestamp IOBluetoothHCIController::mExpansionData->mBufferedSCOPacketTimestamp +#define mRepositoryForBoot IOBluetoothHCIController::mExpansionData->mRepositoryForBoot +#define mMaxNumberOfBootPackets IOBluetoothHCIController::mExpansionData->mMaxNumberOfBootPackets +#define mOverriddenControllerProvider IOBluetoothHCIController::mExpansionData->mOverriddenControllerProvider +#define mHCIRequestListSize IOBluetoothHCIController::mExpansionData->mHCIRequestListSize +#define mNewRequestIndex IOBluetoothHCIController::mExpansionData->mNewRequestIndex +#define mIdleTimer IOBluetoothHCIController::mExpansionData->mIdleTimer +#define mSystemOnTheWayToSleep IOBluetoothHCIController::mExpansionData->mSystemOnTheWayToSleep +#define mIO80211Interface IOBluetoothHCIController::mExpansionData->mIO80211Interface + + enum { + kIOBluetoothHCIControllerSleepFlagInquiryScanWasEnabled = 0x01 + }; + + +private: + + // Command Packet Queue: + virtual IOReturn EnqueueRequestForController( IOBluetoothHCIRequest *requestPtr ); // Was OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 0 ) + virtual IOReturn DequeueAndSendRequests(); // Was OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 1 ) + virtual IOReturn RemoveAllRequestsFromQueue(); // Was OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 2 ) + + // New Device creation upon connection: + IOReturn CreateDeviceFromConnectionResults( BluetoothHCIEventConnectionCompleteResults *connectionResults, bool isInitiator); + + // Expanded version of OpenDeviceConnection MUST BE CALLED IN THE WORKLOOP + virtual IOBluetoothDevice *OpenDeviceConnection( const BluetoothDeviceAddress *inDeviceAddress, BluetoothHCIPageTimeout pageTimeoutValue, bool authenticationRequired); + + // sleepWakeHandler DEPRECATED METHOD RETURNS kIOReturnUnsupported ALL THE TIME ! + static IOReturn sleepWakeHandler( void *target, void *refCon, UInt32 messageType, IOService *service, void *messageArgument, vm_size_t argSize ); + + static IOReturn restartShutdownAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + static IOReturn systemSleepWakeAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + +public: + virtual IOReturn restartShutdownWL( UInt32 messageType, void *reserved); + + // AFH support: + virtual UInt8 *rangeForChannel(UInt16 channel); + virtual IOReturn handleAirPortChangesChannelWL(IOService *serviceForAirport); + + // Version of stop in the workloop + virtual void stopWL( IOService * provider ); + +private: + static bool staticAirPortDriverNotification(void *us, void *unused, IOService * yourDevice); + static IOReturn handleAirPortChangesChannelAction( OSObject *owner, void *castMeToServiceForAirport, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + static bool windowServerDidAppear( void * target, void * refCon, IOService * newService, IONotifier * notifier ); + static IOReturn windowServerDidAppearAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + // Expansion slots: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 0 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 1 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 2 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 3 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 4 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 5 ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 6 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 7 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 8 ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 9 ); + virtual void SetNumSCOConnections( UInt8 numSCOConnections ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 10 ); + virtual void UpdateSCOConnections( UInt8 numSCOConnections ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 11 ); + virtual IOBluetoothDevice *FindDeviceWithSCOHandle( BluetoothConnectionHandle inConnectionHandle ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 12 ); + virtual IOReturn SendSCOData( IOMemoryDescriptor *scoDataDescriptor, + SendDataContext *scoDataContext ); + +protected: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 13 ); + virtual void SendSCOCompleted( SendDataContext *contextPtr, AbsoluteTime timestamp ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 14 ); + virtual IOReturn DispatchIncomingSCOData( UInt8 *inDataPtr, UInt32 inDataSize, UInt32 inMissingData, AbsoluteTime inTimestamp ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 15 ); + virtual bool willTerminateWL( IOService * provider, IOOptionBits options ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 16 ); + virtual bool shouldOverrideExistingController( IOBluetoothHCIController *controller ); + + static void idleTimerFired( OSObject *owner, IOTimerEventSource *timerEventSource ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 17 ); + virtual void handleIdleTimeout(); + + static IOReturn terminateAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 18 ); + virtual IOReturn terminateWL( IOOptionBits options ); + + // Support for dynamic channel width + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 19 ); + virtual UInt8 *rangeForChannel(UInt16 channel, SInt16 width); + +public: + + // v1.2 + v2.1 commands + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 20 ); + virtual IOReturn BluetoothHCIReadExtendedInquiryResponse( BluetoothHCIRequestID inID, + BluetoothHCIReadExtendedInquiryResponseResults * outData ); + + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 21 ); + virtual IOReturn BluetoothHCIWriteExtendedInquiryResponse( BluetoothHCIRequestID inID, + BluetoothHCIFECRequired inFECRequired, + BluetoothHCIExtendedInquiryResponse * inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 22 ); + virtual IOReturn BluetoothHCIReadInquiryMode( BluetoothHCIRequestID inID, + BluetoothHCIInquiryMode * outMode ); + + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 23 ); + virtual IOReturn BluetoothHCIWriteInquiryMode( BluetoothHCIRequestID inID, + BluetoothHCIInquiryMode inMode ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 24 ); + virtual IOReturn BluetoothHCIReadSimplePairingMode( BluetoothHCIRequestID inID, + BluetoothHCISimplePairingMode * outMode ); + + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 25 ); + virtual IOReturn BluetoothHCIWriteSimplePairingMode( BluetoothHCIRequestID inID, + BluetoothHCISimplePairingMode inMode ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 26 ); + virtual IOReturn BluetoothHCIIOCapabilityRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothIOCapability inIOCapability, + BluetoothOOBDataPresence inOOBDataPresence, + BluetoothAuthenticationRequirements inAuthenticationRequirements ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 27 ); + virtual IOReturn BluetoothHCIReadLocalOOBData( BluetoothHCIRequestID inID, + BluetoothHCIReadLocalOOBDataResults * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 28 ); + virtual IOReturn BluetoothHCIReadInquiryResponseTransmitPower( BluetoothHCIRequestID inID, + BluetoothHCITransmitPowerLevel * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 29 ); + virtual IOReturn BluetoothHCIWriteInquiryResponseTransmitPower( BluetoothHCIRequestID inID, + BluetoothHCITransmitPowerLevel inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 30 ); + virtual IOReturn BluetoothHCIUserConfirmationRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 31 ); + virtual IOReturn BluetoothHCIUserConfirmationRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 32 ); + virtual IOReturn BluetoothHCIUserPasskeyRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothPasskey inPasskey); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 33 ); + virtual IOReturn BluetoothHCIUserPasskeyRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 34 ); + virtual IOReturn BluetoothHCIRemoteOOBDataRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothHCISimplePairingOOBData * hash, + BluetoothHCISimplePairingOOBData * randomizer ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 35 ); + virtual IOReturn BluetoothHCIRemoteOOBDataRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 36 ); + virtual IOReturn BluetoothHCIWriteSimplePairingDebugMode( BluetoothHCIRequestID inID, + BluetoothSimplePairingDebugMode inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 37 ); + virtual IOReturn BluetoothHCISendKeypressNotification( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothKeypressNotificationType inData ); + +protected: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 38 ); + virtual IOReturn systemSleepWakeWL( UInt32 messageType, void *reserved); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 39 ); + virtual IOReturn BluetoothHCIReadLocalExtendedFeatures( BluetoothHCIRequestID inID, + BluetoothHCIPageNumber inPageNumber, + BluetoothHCIExtendedFeaturesInfo * outFeatures ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 40 ); + virtual IOReturn BluetoothHCIReadRemoteExtendedFeatures( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIPageNumber inPageNumber, + BluetoothHCIEventReadRemoteExtendedFeaturesResults * outFeatures ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 41 ); + virtual IOReturn BluetoothHCIReadAFHChannelAssessmentMode( BluetoothHCIRequestID inID, + BluetoothHCIAFHChannelAssessmentMode * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 42 ); + virtual IOReturn BluetoothHCIWriteAFHChannelAssessmentMode( BluetoothHCIRequestID inID, + BluetoothHCIAFHChannelAssessmentMode inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 43 ); + virtual IOReturn BluetoothHCISetAFHHostChannelClassification( BluetoothHCIRequestID inID, + uint8_t * inDataPtr, + uint8_t inDataLength ); + +private: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 44 ); + virtual IOReturn BluetoothHCIReadAFHChannelMap( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothAFHResults * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 45 ); + virtual void SynchronizeSCOPacketSequence( UInt32 sequenceNumber ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 46 ); + virtual IOReturn BluetoothHCICreateConnectionCancel( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 47 ); + virtual IOReturn BluetoothHCIRemoteNameRequestCancel( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 48 ); + void StartIdleTimer( uint32_t milliseconds ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 49 ); + void StopIdleTimer(); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 50 ); + virtual IOReturn setUnackQueueCompletionCalled(void * memoryDescriptor); + +protected: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 51 ); + virtual IOReturn RemovePacket(IOMemoryDescriptor *memDescriptor); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 52 ); + IOReturn exitHIDSniff(bool exitSniff); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 53 ); + virtual IOReturn WaitForControllerPowerStateWithTimeout( IOBluetoothHCIControllerInternalPowerState powerState, + UInt32 waitTimeInMicroSecond); +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 54 ); + void SetHCIDriverExistsVariableTo( bool isLoaded ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 55 ); + virtual IOReturn ToggleLMPLogging( ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 56 ); + virtual HearingDeviceListType * FindHearingDeviceWithAddress( const BluetoothDeviceAddress *inDeviceAddress ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 57 ); + virtual IOReturn AddHearingDevice( IOBluetoothDevice *inDevice ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 58 ); + virtual IOReturn RemoveHearingDevice( IOBluetoothDevice *inDevice, bool all ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 59 ); + virtual IOReturn SetDevicePublishNotificationState( const BluetoothDeviceAddress *inDeviceAddress, DevicePublishNotificationStateType state ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 60 ); + virtual DevicePublishNotificationStateType * GetDevicePublishNotificationState( const BluetoothDeviceAddress *inDeviceAddress ); + +private: + OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 61 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 62 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 63 ); +}; diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHCIRequest.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHCIRequest.h.svn-base new file mode 100644 index 0000000..c9d970e --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHCIRequest.h.svn-base @@ -0,0 +1,155 @@ +/* + File: IOBluetoothHCIRequest.h + Contains: Bluetooth Host Controller request object. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + +#pragma once + +#import +#import + +#import + + +class IOCommandGate; +class IOTimerEventSource; +class IOBluetoothHCIController; + +// Forward declaration to avoid the need to include IOBluetoothHCIUserLibShared.h +typedef struct BluetoothHCINotificationMessage; + +//=========================================================================================================================== +// enums, macros, etc. +//=========================================================================================================================== + +enum +{ + kMaxHCIBufferLength = 512 +}; + +typedef UInt8 BluetoothHCIRequestState; +enum BluetoothHCIRequestStates +{ + kHCIRequestStateIdle = 0, // Doing nothing - neither waiting nor busy. usually waiting for deletion. + kHCIRequestStateWaiting = 1, // On the wait queue - request has not been processed in any way. + kHCIRequestStateBusy = 2, // On the busy queue - request is sent and is currently processing +}; + + +//=========================================================================================================================== +// IOBluetoothHCIRequest +//=========================================================================================================================== + +class IOBluetoothHCIRequest : public OSObject +{ + OSDeclareDefaultStructors( IOBluetoothHCIRequest ) + + UInt8 mPrivateResultsBuffer[kMaxHCIBufferLength*4]; // Just in case they didn't give a results ptr. + IOByteCount mPrivateResultsSize; // Result size. + BluetoothHCITransportID mTransportID; // Transport ID to use for this request. + UInt8 mState; // Busy, waiting, idle. + bool mAsyncNotify; + task_t mOwningTaskID; + BluetoothHCIRequestCallbackInfo mCallbackInfo; // When this request is complete, call this. + BluetoothHCICommandOpCode mOpCode; + BluetoothDeviceAddress mDeviceAddress; + BluetoothConnectionHandle mConnectionHandle; + BluetoothHCINotificationMessage * mNotificationMessage; + IOByteCount mNotificationMessageSize; + + +public: + + IOBluetoothHCIRequest * mNextBusy; // Points to next request element on busy queue. + IOBluetoothHCIRequest * mNextWait; // Points to next request element on wait queue. + IOBluetoothHCIRequest * mNextAllocated; // Points to next allocated request element. + IOBluetoothHCIRequest * mPreviousAllocated; // Points to next allocated request element. + BluetoothHCIRequestID mID; // For internal identification. + UInt8 mCommandBuffer[kMaxHCIBufferLength]; // Built-up HCI Command to send to the transport. + IOByteCount mCommandBufferSize; // Size of command buffer. + + UInt8 * mResultsPtr; // Result ptr, provided by object creator. + IOByteCount mResultsSize; // Result size. + + IOCommandGate * mCommandGate; + IOTimerEventSource * mTimer; + IOBluetoothHCIController * mHCIController; + IOReturn mStatus; // Success/failure code of request. + UInt32 mTimeout; // Timeout for request to complete, in milliseconds. + UInt32 mControlFlags; + int mPID; // Creating Task + bool mHCIRequestDeleteWasCalled; // Fixed rdar://problem/7044168 + + +public: + + bool init( IOCommandGate *commandGate, IOBluetoothHCIController *hciController ); + void free(); + + static IOBluetoothHCIRequest * Create( IOCommandGate *commandGate, IOBluetoothHCIController *hciController, bool async = TRUE, UInt32 timeout = 5, UInt32 controlFlags = 0 ); + static IOReturn Dispose( IOBluetoothHCIRequest * inObject ); + + + // Called when a request is started on a transport, and completed. + + IOReturn Start(); + void Complete(); + + // Accessors for object members. + + void SetState( BluetoothHCIRequestState inState ); + BluetoothHCIRequestState GetState() { return( mState ); } + + void SetHCIStatus( BluetoothHCIStatus inStatus ) { mStatus = inStatus; } + BluetoothHCIStatus GetHCIStatus() { return( mStatus ); } + + void SetID( BluetoothHCIRequestID inID ) { mID = inID; } + BluetoothHCIRequestID GetID() { return( mID ); } + + void SetCallbackInfo( BluetoothHCIRequestCallbackInfo * inInfo ); + BluetoothHCIRequestCallbackInfo * GetCallbackInfo() { return( &mCallbackInfo ); } + + void SetOwningTaskID( task_t inTaskID ) { mOwningTaskID = inTaskID; } + task_t GetOwningTaskID() { return( mOwningTaskID ); } + + void * GetCommandBuffer(); + + BluetoothHCICommandOpCode GetCommandOpCode(); + void SetCommandOpCode( BluetoothHCICommandOpCode inOpCode ) { mOpCode = inOpCode; } + + BluetoothDeviceAddress * GetDeviceAddress() { return &mDeviceAddress; } + void SetDeviceAddress( const BluetoothDeviceAddress *inDeviceAddress ) { if ( inDeviceAddress != NULL ) memcpy( &mDeviceAddress, inDeviceAddress, sizeof( BluetoothDeviceAddress ) ); } + void ClearDeviceAddress() { bzero( &mDeviceAddress, sizeof( BluetoothDeviceAddress ) ); } + Boolean CompareDeviceAddress( const BluetoothDeviceAddress *inDeviceAddress ); + + BluetoothConnectionHandle GetConnectionHandle() { return mConnectionHandle; } + void SetConnectionHandle( BluetoothConnectionHandle inConnectionHandle ) { mConnectionHandle = inConnectionHandle; } + void ClearConnectionHandle() { mConnectionHandle = kBluetoothConnectionHandleNone; } + + void SetTimeout( UInt32 inTimeout ) { mTimeout = inTimeout; } // in milliseconds + UInt32 GetTimeout() { return( mTimeout ); } + + void StartTimer(); + + static void timerFired( OSObject *owner, IOTimerEventSource *sender ); + void handleTimeout(); + + void CopyDataIntoResultsPtr( UInt8 * inDataPtr, IOByteCount inSize ); + void SetParamPtrAndSize( UInt8 paramNumber, UInt8 * inParamPtr, IOByteCount inSize ); + + void SetResultsBufferPtrAndSize( UInt8 * resultsBuffer, IOByteCount inSize ); + void SetResultsDataSize( IOByteCount inCount ); + UInt8 * GetResultsBuffer(); + IOByteCount GetResultsBufferSize(); + + mach_vm_address_t GetNotificationRefCon() { return( mCallbackInfo.asyncIDRefCon ); } + + void SetDoAsyncNotify( bool inAsyncNotify ) { mAsyncNotify = inAsyncNotify; } + Boolean IsSynchronous() { return !mAsyncNotify; } + + void SetControlFlags( UInt32 controlFlags ) { mControlFlags = controlFlags; } + UInt32 GetControlFlags() { return mControlFlags; } + + const char * RequestDescription(); +}; diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHIDDriver.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHIDDriver.h.svn-base new file mode 100644 index 0000000..b3bb449 --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHIDDriver.h.svn-base @@ -0,0 +1,230 @@ +/* + File: IOBluetoothHIDDriver.h + Contains: Driver for generic Bluetooth HID devices. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + +#ifndef IOBLUETOOTHHIDDRIVER_H +#define IOBLUETOOTHHIDDRIVER_H + +#include +#include + +//=========================================================================================================================== +// Forwards +//=========================================================================================================================== + +class IOTimerEventSource; +class IOWorkLoop; + +class IOBluetoothL2CAPChannel; +class IOBluetoothDevice; +class IOWorkQueue; + +//=========================================================================================================================== +// IOBluetoothHIDDriver +//=========================================================================================================================== + +class IOBluetoothHIDDriver : public IOHIDDevice +{ + OSDeclareDefaultStructors( IOBluetoothHIDDriver ) + + IOWorkLoop* _workLoop; + IOCommandGate* _commandGate; + + IOWorkQueue *_desyncWorkQueue; + + IOBluetoothL2CAPChannel* _controlChannel; + IOBluetoothL2CAPChannel* _interruptChannel; + + IOBluetoothDevice* _device; + + IOMemoryDescriptor* _memDescriptor; + IOMemoryDescriptor* _getReportDescriptor; + IONotifier* _interruptOpenNotification; + IOTimerEventSource* _timer; + IONotifier* _sleepWakeNotifier; + + bool _deviceReady; + + UInt8 _expectedReportID; + UInt8 _expectedReportType; + UInt8 _handshake; + + OSDictionary* _deviceProperties; + + UInt16 _vendorIDSource; + UInt16 _vendorID; + UInt16 _productID; + UInt16 _deviceVersion; + uint32_t _classOfDevice; + UInt16 _countryCode; + + BluetoothDeviceAddress _deviceAddress; + char _deviceAddressString[20]; + + uint32_t _outstandingIO; + bool _sendOutstanding; + + // Debug / Behavior Modifiers + UInt8 _verboseLevel; + bool _logPackets; + bool _decodePackets; + bool _logOutstandingIO; + bool _suppressDisconnectNotifications; + bool _suppressSetProtocol; + bool _driverIsAwake; + bool _reservedFlag4; + UInt8 _reservedByte; + + struct ExpansionData + { + OSArray* _sendQueue; + + uint8_t *interruptBuffer; + uint32_t interruptBufferUsed; + + uint8_t *controlBuffer; + uint32_t controlBufferUsed; + + uint8_t deviceSupportsSuspend; + + uint32_t getReportTimeoutMS; + uint32_t setReportTimeoutMS; + + uint32_t outstandingMemoryBlockCount; + bool waitingForMemoryBlockCount; + }; + ExpansionData *_expansionData; + +public: + // Standard IOService Methods + virtual IOService* probe( IOService * provider, SInt32 * score ); + virtual bool init( OSDictionary *properties ); + virtual void free(); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + + // Starting & Stopping + virtual bool handleStart( IOService * provider ); + virtual void handleStop( IOService * provider ); + virtual void deviceReady(); + virtual void closeDownServices(); + + // Power Management + virtual void handleSleep(); + virtual void handleWake(); + virtual void handleShutdown(); // Does nothing + virtual void handleRestart(); // Does nothing + + // HID Properties + virtual OSString* newTransportString() const; + virtual OSString* newManufacturerString() const; + virtual OSString* newProductString() const; + virtual OSNumber* newVendorIDSourceNumber() const; + virtual OSNumber* newVendorIDNumber() const; + virtual OSNumber* newProductIDNumber() const; + virtual OSNumber* newVersionNumber() const; + virtual IOReturn newReportDescriptor( IOMemoryDescriptor ** descriptor ) const; + virtual OSString* newSerialNumberString() const; + virtual OSNumber* newLocationIDNumber() const; + virtual OSNumber* newCountryCodeNumber() const; + virtual OSNumber* newReportIntervalNumber() const; + + // Main UserLand Entry Points + virtual IOReturn getReport( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options = 0 ); + virtual IOReturn setReport( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options = 0 ); + virtual IOReturn setProperties( OSObject* properties ); + + // General IO + virtual IOReturn sendData( IOBluetoothL2CAPChannel* theChannel, void* theData, IOByteCount theSize ); + virtual void processControlData( UInt8 *buffer, UInt16 length ); + virtual void processInterruptData( UInt8 *buffer, UInt16 length ); + virtual IOReturn waitForData( IOMemoryDescriptor* report, UInt8 btReportType, UInt8 reportID ); + virtual IOReturn waitForHandshake(); + + // HID Transaction Methods + virtual IOReturn hidControl( UInt8 controlOperation ); + virtual int getProtocol(); + virtual IOReturn setProtocol( UInt8 protocol ); + virtual int getIdle(); + virtual IOReturn setIdle( UInt8 idleRate ); + + // Device Introspection + virtual bool isKeyboard(); + virtual bool isMouse(); + + // Misc + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn createCommandGate( IOService* provider ); + virtual IOReturn getDeviceProperties( IOService* provider ); + virtual bool readDeviceName(); + + // Command Gate Actions + static IOReturn staticCloseDownServicesAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticSendToAction( OSObject* owner, void* theChannel, void* theData, void *theSize, void* ); + static IOReturn staticPrepControlChannelAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticPrepInterruptChannelAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticGetReportAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticSetReportAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticProcessCommandAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticGetDevicePropertiesAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticInterruptChannelOpeningAction( OSObject* owner, void* newService, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticWillTerminateAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + + // Work Loop Methods + virtual void closeDownServicesWL(); + virtual IOReturn prepInterruptChannelWL(); + virtual IOReturn getReportWL( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options ); + virtual IOReturn setReportWL( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options ); + virtual IOReturn processCommandWL( OSString* command, OSNumber* commandParameter ); + virtual IOReturn getDevicePropertiesWL( IOService* provider ); + virtual IOReturn interruptChannelOpeningWL( IOBluetoothL2CAPChannel* theChannel ); + + // Timeout Handler + static void timerFired( OSObject* owner, IOTimerEventSource* sender ); + virtual void handleTimeout(); + + // IO Counting + virtual void incrementOutstandingIO(); + virtual void decrementOutstandingIO(); + +private: + // Lazy Interrupt Channel Methods + static bool interruptChannelOpeningCallback( void* me, void* ignoreMe, IOService* newService, IONotifier *notifier ); + static IOReturn powerStateHandler( void *target, void *refCon, UInt32 messageType, IOService *service, void *messageArgument, vm_size_t argSize ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 0 ); + virtual void sendDeviceDisconnectNotifications( void ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 1 ); + virtual IOReturn setPowerStateWL( unsigned long powerStateOrdinal, IOService* whatDevice ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 2 ); + virtual void sendDeviceConnectNotifications( void ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 3 ); + virtual void decrementOutstandingMemoryBlockCount( void ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 4 ); + virtual IOReturn willTerminateWL( void ); + +public: + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 5 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 6 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 7 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 8 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 9 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 10 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 11 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 12 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 13 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 14 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 15 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 16 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 17 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 18 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 19 ); +}; + +#endif // IOBLUETOOTHHIDDRIVER_H diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHIDDriverTypes.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHIDDriverTypes.h.svn-base new file mode 100644 index 0000000..8d722aa --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothHIDDriverTypes.h.svn-base @@ -0,0 +1,61 @@ +/* + File: IOBluetoothHIDDriverTypes.h + Contains: Type defined for the IOBluetoothHIDDriver.h. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + + +#ifndef IOBLUETOOTHHIDDRIVERTYPES_H +#define IOBLUETOOTHHIDDRIVERTYPES_H + +// Vendor ID Sources +//------------------ +#define kVendorIDSourceBluetoothSIG 0x1 +#define kVendorIDSourceUSBIF 0x2 + +// Bluetooth HID Transaction Headers +//---------------------------------- +#define IOBTHID_HANDSHAKE_HEADER 0x00 +#define IOBTHID_HID_CONTROL_HEADER 0x10 +#define IOBTHID_GET_REPORT_HEADER 0x40 +#define IOBTHID_SET_REPORT_HEADER 0x50 +#define IOBTHID_GET_PROTOCOL_HEADER 0x60 +#define IOBTHID_SET_PROTOCOL_HEADER 0x70 +#define IOBTHID_GET_IDLE_HEADER 0x80 +#define IOBTHID_SET_IDLE_HEADER 0x90 +#define IOBTHID_DATA_HEADER 0xA0 +#define IOBTHID_DATC_HEADER 0xB0 + +// Handshake Types +//---------------- +#define IOBTHID_HANDSHAKE_SUCCESSFUL 0x0 +#define IOBTHID_HANDSHAKE_NOT_READY 0x1 +#define IOBTHID_HANDSHAKE_INVALID_REPORT_ID 0x2 +#define IOBTHID_HANDSHAKE_UNSUPPORTED_REQUEST 0x3 +#define IOBTHID_HANDSHAKE_INVALID_PARAMETER 0x4 +#define IOBTHID_HANDSHAKE_ERR_UNKNOWN 0xE +#define IOBTHID_HANDSHAKE_ERR_FATAL 0xF + +// HID_Control Types +//------------------ +#define IOBTHID_CONTROL_NOP 0x0 +#define IOBTHID_CONTROL_HARD_RESET 0x1 +#define IOBTHID_CONTROL_SOFT_RESET 0x2 +#define IOBTHID_CONTROL_SUSPEND 0x3 +#define IOBTHID_CONTROL_EXIT_SUSPEND 0x4 +#define IOBTHID_CONTROL_VC_UNPLUG 0x5 + +// Protocol Types +//--------------- +#define IOBTHID_BOOT_PROTOCOL 0x0 +#define IOBTHID_REPORT_PROTOCOL 0x1 + +// Report Types +//------------- +#define IOBTHID_RESERVED_REPORT 0x0 +#define IOBTHID_OTHER_REPORT 0x0 +#define IOBTHID_INPUT_REPORT 0x1 +#define IOBTHID_OUTPUT_REPORT 0x2 +#define IOBTHID_FEATURE_REPORT 0x3 + +#endif // IOBLUETOOTHHIDDRIVERTYPES_H diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothInternal.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothInternal.h.svn-base new file mode 100644 index 0000000..ed40a76 --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothInternal.h.svn-base @@ -0,0 +1,103 @@ +/* + File: BluetoothInternal.h + Contains: Internal types and macros needed by public kernel APIs. + Copyright: 2003-2007 by Apple, Inc. All rights reserved. +*/ + +#pragma once + +typedef enum IOBluetoothHCIControllerConfigState +{ + kIOBluetoothHCIControllerConfigStateOnline = 0, // Controller is configured and ready for clients + kIOBluetoothHCIControllerConfigStateKernelSetupPending = 1, // New controller - kernel setup in progress + kIOBluetoothHCIControllerConfigStateDaemonSetupPending = 2, // New controller - daemon setup in progress + kIOBluetoothHCIControllerConfigStateDaemonSetupComplete = 3, // New controller - daemon setup complete + kIOBluetoothHCIControllerConfigStateResetPending = 4, // HCI reset has been issued + kIOBluetoothHCIControllerConfigStateKernelPostResetSetupPending = 5, // HCI reset complete - kernel setup in progress + kIOBluetoothHCIControllerConfigStateDaemonPostResetSetupPending = 6, // HCI reset complete - daemon setup in progress + kIOBluetoothHCIControllerConfigStateDaemonPostResetSetupComplete = 7, // HCI reset complete - daemon setup complete + kIOBluetoothHCIControllerConfigStateUninitialized = 8 +} IOBluetoothHCIControllerConfigState; + +typedef UInt32 IOBluetoothHCIControllerPowerOptions; +enum +{ + kIOBluetoothHCIControllerPowerOptionPowerOffSupported = 0x00000001, + kIOBluetoothHCIControllerPowerOptionWakeFromExistingConnectionSupported = 0x00000002, + kIOBluetoothHCIControllerPowerOptionWakeFromNewConnectionSupported = 0x00000004, + kIOBluetoothHCIControllerPowerOptionIdleWithConnectionSupported = 0x00000008, + kIOBluetoothHCIControllerPowerOptionIdleWhenInternalPower = 0x00000010 +}; + +enum IOBluetoothHCIControllerSleepOptions +{ + kIOBluetoothHCIControllerAllowWakeFromExistingConnection = 0x00000001, + kIOBluetoothHCIControllerAllowWakeFromNewConnection = 0x00000002, + kIOBluetoothHCIControllerTemporaryOnFromIdle = 0x00000004 +}; + +#define HCI_CONTROLLER_POWER_OFF_SUPPORTED( _controllerPowerOptions ) ( ( _controllerPowerOptions & kIOBluetoothHCIControllerPowerOptionPowerOffSupported ) == kIOBluetoothHCIControllerPowerOptionPowerOffSupported ) +#define HCI_CONTROLLER_SLEEP_SUPPORTED( _controllerPowerOptions ) \ + ( ( _controllerPowerOptions & \ + ( kIOBluetoothHCIControllerPowerOptionWakeFromExistingConnectionSupported | \ + kIOBluetoothHCIControllerPowerOptionWakeFromNewConnectionSupported ) ) != 0 ) + +typedef enum IOBluetoothHCIControllerInternalPowerState +{ + kIOBluetoothHCIControllerInternalPowerStateOff = 0, + kIOBluetoothHCIControllerInternalPowerStateOn = 1, + kIOBluetoothHCIControllerInternalPowerStateSleep = 2, + kIOBluetoothHCIControllerInternalPowerStateIdle = 3 +} IOBluetoothHCIControllerInternalPowerState; + +enum IOBluetoothHCIControllerPowerStateOrdinal +{ + kIOBluetoothHCIControllerPowerStateOrdinalOff = 0, + kIOBluetoothHCIControllerPowerStateOrdinalIdle = 1, + kIOBluetoothHCIControllerPowerStateOrdinalOn = 2 +}; + +typedef UInt32 IOBluetoothHCIControllerFeatureFlags; + +enum +{ + kIOBluetoothHCIControllerFeatureFlagVendorCommandFlowControl = 0x00000001, + kIOBluetoothHCIControllerFeatureFlagSCOSupported = 0x00000002, + kIOBluetoothHCIControllerFeatureFlagSerializeCommands = 0x10000000 +}; + +//=========================================================================================================================== +// Private_UnifiedInquiryResult +//=========================================================================================================================== + +typedef struct IOBluetoothHCIUnifiedInquiryResult IOBluetoothHCIUnifiedInquiryResult; +struct IOBluetoothHCIUnifiedInquiryResult +{ + BluetoothHCIInquiryResult originalInquiryResult; + + // event code will be either: + // kBluetoothHCIEventInquiryResult, kBluetoothHCIEventInquiryResultWithRSSI, or kBluetoothHCIEventExtendedInquiryResult + + BluetoothHCIEventCode eventCode; + + // kBluetoothHCIEventExtendedInquiryResult only + + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; + + // kBluetoothHCIEventExtendedInquiryResult or kBluetoothHCIEventInquiryResultWithRSSI only + + UInt8 reserved; + BluetoothHCIRSSIValue RSSIValue; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +enum BluetoothHCIExtendedInquiryResponseDataTypesAppleSpecificInfo +{ + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoReserved = 0x00, + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoModelIdentifier = 0x01, /* UTF8String char data */ + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoThirdPartyAdvertising = 0x02, +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + diff --git a/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothTypes.h.svn-base b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothTypes.h.svn-base new file mode 100644 index 0000000..07ee4c2 --- /dev/null +++ b/i386/include/IOKit/bluetooth/.svn/text-base/IOBluetoothTypes.h.svn-base @@ -0,0 +1,23 @@ +/* + File: IOBluetoothTypes.h + Contains: Family provided types and defines - shared between user and kernel code. + Copyright: 2002-2007 by Apple Inc. All rights reserved. +*/ + +#pragma once + +#include + +// Error returns +#ifndef sub_iokit_bluetooth +#define sub_iokit_bluetooth err_sub(8) +#endif + +#define iokit_bluetooth_err(return) (sys_iokit|sub_iokit_bluetooth|return) + +#define kIOBluetoothDeviceResetError iokit_bluetooth_err(1) // Device reset interrupted pending operation +#define kIOBluetoothConnectionAlreadyExists iokit_bluetooth_err(2) // Attempting to open a connection that already exists +#define kIOBluetoothNoHCIController iokit_bluetooth_err(3) // No HCI controller is present +#define kIOBluetoothHCIPowerStatesNotSupported iokit_bluetooth_err(4) // HCI controller does not support changing power states + + diff --git a/i386/include/IOKit/bluetooth/Bluetooth.h b/i386/include/IOKit/bluetooth/Bluetooth.h new file mode 100644 index 0000000..6692b90 --- /dev/null +++ b/i386/include/IOKit/bluetooth/Bluetooth.h @@ -0,0 +1,2158 @@ +/* + File: Bluetooth.h + Contains: Public interfaces for Bluetooth technology. + Copyright: (c) 2002-2007 by Apple Inc. All rights reserved. +*/ + +#pragma once + +#ifdef KERNEL +#include +#else +#include +#include +#endif + +#include +#include + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @header Bluetooth + Bluetooth wireless technology +*/ + +#ifdef __cplusplus + extern "C" { +#endif + + +#if 0 + +#pragma mark === Baseband === +#endif + +//=========================================================================================================================== +// Baseband +//=========================================================================================================================== + +typedef UInt16 BluetoothConnectionHandle; // Upper 4 bits are reserved. +typedef uint8_t BluetoothLMPHandle; +enum +{ + kBluetoothConnectionHandleNone = 0xffff +}; + +typedef UInt8 BluetoothReasonCode; +typedef UInt8 BluetoothEncryptionEnable; +enum +{ + kBluetoothEncryptionEnableOff = 0x00, + kBluetoothEncryptionEnableOn = 0x01 +}; + +typedef UInt8 BluetoothKeyFlag; +enum +{ + kBluetoothKeyFlagSemiPermanent = 0x00, + kBluetoothKeyFlagTemporary = 0x01 +}; + +typedef UInt8 BluetoothKeyType; +enum +{ + kBluetoothKeyTypeCombination = 0x00, + kBluetoothKeyTypeLocalUnit = 0x01, + kBluetoothKeyTypeRemoteUnit = 0x02, + kBluetoothKeyTypeDebugCombination = 0x03, + kBluetoothKeyTypeUnauthenticatedCombination = 0x04, + kBluetoothKeyTypeAuthenticatedCombination = 0x05, + kBluetoothKeyTypeChangedCombination = 0x06, +}; + +// Packet types (Bluetooth spec section 7.1.5 - Create Connection) + +typedef UInt16 BluetoothPacketType; +enum +{ + kBluetoothPacketTypeReserved1 = 0x0001, + kBluetoothPacketType2DH1Omit = 0x0002, // Masks OUT this packet type + kBluetoothPacketType3DH1Omit = 0x0004, // Masks OUT this packet type + + kBluetoothPacketTypeDM1 = 0x0008, + kBluetoothPacketTypeDH1 = 0x0010, + kBluetoothPacketTypeHV1 = 0x0020, // Reserved + kBluetoothPacketTypeHV2 = 0x0040, // Reserved + kBluetoothPacketTypeHV3 = 0x0080, // Reserved + kBluetoothPacketTypeDV = 0x0100, // Reserved + kBluetoothPacketType2DH3Omit = 0x0100, // Masks OUT this packet type + kBluetoothPacketType3DH3Omit = 0x0200, // Masks OUT this packet type + kBluetoothPacketTypeAUX = 0x0200, // Deprecated + + kBluetoothPacketTypeDM3 = 0x0400, + kBluetoothPacketTypeDH3 = 0x0800, + + kBluetoothPacketType2DH5Omit = 0x1000, // Masks OUT this packet type + kBluetoothPacketType3DM5Omit = 0x2000, // Masks OUT this packet type + + kBluetoothPacketTypeDM5 = 0x4000, + kBluetoothPacketTypeDH5 = 0x8000, + + kBluetoothPacketTypeEnd +}; + +// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.1.26 - Setup Synchronous Command) + +enum +{ + kBluetoothSynchronousConnectionPacketTypeHV1 = 0x0001, + kBluetoothSynchronousConnectionPacketTypeHV2 = 0x0002, + kBluetoothSynchronousConnectionPacketTypeHV3 = 0x0004, + kBluetoothSynchronousConnectionPacketTypeEV3 = 0x0008, + kBluetoothSynchronousConnectionPacketTypeEV4 = 0x0010, + kBluetoothSynchronousConnectionPacketTypeEV5 = 0x0020, + + // masking out certain types: + + kBluetoothSynchronousConnectionPacketType2EV3Omit = 0x0040, + kBluetoothSynchronousConnectionPacketType3EV3Omit = 0x0080, + kBluetoothSynchronousConnectionPacketType2EV5Omit = 0x0100, + kBluetoothSynchronousConnectionPacketType3EV5Omit = 0x0200, + + kBluetoothSynchronousConnectionPacketTypeAll = 0xFFFF, + + kBluetoothSynchronousConnectionPacketTypeEnd +}; + + +// LAP/Inquiry Access Codes + +typedef UInt32 BluetoothLAP; +enum +{ + kBluetoothGeneralInquiryAccessCodeIndex = 0, // General/Unlimited Inquiry Access Code (GIAC) + kBluetoothGeneralInquiryAccessCodeLAPValue = 0x9E8B33, // General/Unlimited Inquiry Access Code (GIAC) + + kBluetoothLimitedInquiryAccessCodeIndex = 1, // Limited Dedicated Inquiry Access Code (LIAC) + kBluetoothLimitedInquiryAccessCodeLAPValue = 0x9E8B00, // Limited Dedicated Inquiry Access Code (LIAC) + + // All other access codes are reserved for future use (indices 2-63, LAP values 0x9E8B01-0x9E8B32 and 0x9E8B34-0x9E8B3F). + + kBluetoothLimitedInquiryAccessCodeEnd +}; + +// PageScanRepetitionMode + +typedef UInt8 BluetoothPageScanRepetitionMode; +enum +{ + kBluetoothPageScanRepetitionModeR0 = 0x00, + kBluetoothPageScanRepetitionModeR1 = 0x01, + kBluetoothPageScanRepetitionModeR2 = 0x02 + + // All other values are reserved for future use. +}; + +// PageScanPeriodMode + +typedef UInt8 BluetoothPageScanPeriodMode; +enum +{ + kBluetoothPageScanPeriodModeP0 = 0x00, + kBluetoothPageScanPeriodModeP1 = 0x01, + kBluetoothPageScanPeriodModeP2 = 0x02 + + // All other values are reserved for future use. +}; + +// PageScanMode + +typedef UInt8 BluetoothPageScanMode; +enum +{ + kBluetoothPageScanModeMandatory = 0x00, + kBluetoothPageScanModeOptional1 = 0x01, + kBluetoothPageScanModeOptional2 = 0x02, + kBluetoothPageScanModeOptional3 = 0x03 + + // All other values are reserved for future use. +}; + +#if 0 +#pragma mark - +#pragma mark === Devices === +#endif + +typedef struct BluetoothDeviceAddress BluetoothDeviceAddress; +struct BluetoothDeviceAddress +{ + UInt8 data[ 6 ]; +}; + +typedef struct BluetoothKey BluetoothKey; +struct BluetoothKey +{ + UInt8 data[ 16 ]; +}; + +typedef struct BluetoothPINCode BluetoothPINCode; +struct BluetoothPINCode +{ + UInt8 data[ 16 ]; // PIN codes may be up to 128 bits. +}; + + +// Physical layout of the "class of device/service" field (see Bluetooth Assigned Numbers section 1.2): +// +// 2 2 2 2 1 1 1 1 1 1 1 1 1 1 +// 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 <- Bit Transmission Order +// +---------------+---------------+---------------+ +// | octet 3 | octet 2 | octet 1 | <- Octet Transmission Order +// +---------------+---------------+---------------+ +// <------ 11 bits ----->< 5 bits ><- 6 bits -> +// +---------------------+---------+-----------+-+-+ +// | Service Classes | Major | Minor | | | +// +-+-+-+-+-+-+-+-+-+-+-+ Device | Device |0|0| +// | | | | | | | |*|*|*| | Class | Class | | | +// +-+-+-+-+-+-+-+-+-+-+-+---------+-----------+-+-+ +// | | | | | | | | | +// | | | | | | | + Limited Discoverable +- Format Type +// | | | | | | +- Networking +// | | | | | +- Rendering +// | | | | +- Capturing +// | | | +- Object Transfer +// | | +- Audio +// | +- Telephony +// +- Information + +typedef UInt32 BluetoothClassOfDevice; + +#define BluetoothGetDeviceClassMajor( inCOD ) ( (inCOD & 0x00001F00) >> 8 ) +#define BluetoothGetDeviceClassMinor( inCOD ) ( (inCOD & 0x000000FC) >> 2 ) +#define BluetoothGetServiceClassMajor( inCOD ) ( (inCOD & 0x00FFE000) >> 13 ) +#define BluetoothMakeClassOfDevice( inServiceClassMajor, inDeviceClassMajor, inDeviceClassMinor ) \ + (((inServiceClassMajor << 13) & 0x00FFE000) | ((inDeviceClassMajor << 8) & 0x00001F00) | ((inDeviceClassMinor << 2) & 0x000000FC)) + +/// +/// Major Service Classes (11-bit value - bits 13-23 of Device/Service field) +/// + +typedef UInt32 BluetoothServiceClassMajor; +// Service Class Major enum in BluetoothAssignedNumbers.h + +/// +/// Major Device Classes (5-bit value - bits 8-12 of Device/Service field) +/// + +typedef UInt32 BluetoothDeviceClassMajor; +// Device Class Major enum in BluetoothAssignedNumbers.h + +/// +/// Minor Device Classes (6-bit value - bits 2-7 of Device/Service field) +/// + +typedef UInt32 BluetoothDeviceClassMinor; +// Device Class Minor enum in BluetoothAssignedNumbers.h + +// Misc Device Types + +enum +{ + kBluetoothDeviceNameMaxLength = 248 +}; +typedef UInt8 BluetoothDeviceName[ 256 ]; // Max 248 bytes of UTF-8 encoded Unicode. +typedef UInt16 BluetoothClockOffset; // Bits 14-0 come from bits 16-2 of CLKslav-CLKmaster. +typedef UInt8 BluetoothRole; // +typedef UInt8 BluetoothAllowRoleSwitch; // 0x00-0x01 valid, 0x02-0xFF reserved. +enum +{ + kBluetoothDontAllowRoleSwitch = 0x00, + kBluetoothAllowRoleSwitch = 0x01 +}; + +enum +{ + kBluetoothRoleBecomeMaster = 0x00, + kBluetoothRoleRemainSlave = 0x01 +}; + +typedef struct BluetoothSetEventMask BluetoothSetEventMask; +struct BluetoothSetEventMask +{ + UInt8 data[ 8 ]; +}; + +typedef UInt8 BluetoothPINType; + + +#if 0 +#pragma mark - +#pragma mark === L2CAP === +#endif + +//=========================================================================================================================== +// Logical Link Control and Adaptation Protocol (L2CAP) +//=========================================================================================================================== + + +// ACL Packet values (Bluetooth L2CAP spec section 1). + +enum +{ + kBluetoothL2CAPMaxPacketSize = 65535, // Max number of data bytes in an L2CAP packet. + + kBluetoothACLLogicalChannelReserved = 0, // [00] Reserved for future use + kBluetoothACLLogicalChannelL2CAPContinue = 1, // [01] Continuation of L2CAP packet. + kBluetoothACLLogicalChannelL2CAPStart = 2, // [10] Start of L2CAP packet. + kBluetoothACLLogicalChannelLMP = 3 // [11] Link Manager Protocol packet. +}; + +// Channel Identifiers (Bluetooth L2CAP spec section 2.1). + +typedef UInt16 BluetoothL2CAPChannelID; +enum +{ + kBluetoothL2CAPChannelNull = 0x0000, // Illegal, should not be used + kBluetoothL2CAPChannelSignalling = 0x0001, // L2CAP signalling channel + kBluetoothL2CAPChannelConnectionLessData = 0x0002, // L2CAP connection less data + kBluetoothL2CAPChannelAMPManagerProtocol = 0x0003, // AMP Manager Protocol + + // Range 0x0003 to 0x003F reserved for future use. + kBluetoothL2CAPChannelReservedStart = 0x0004, + kBluetoothL2CAPChannelReservedEnd = 0x003F, + + // Range 0x0040 to 0xFFFF are dynamically allocated. + kBluetoothL2CAPChannelDynamicStart = 0x0040, + kBluetoothL2CAPChannelDynamicEnd = 0xffff, + kBluetoothL2CAPChannelEnd = 0xffff +}; + +typedef BluetoothL2CAPChannelID BluetoothL2CAPGroupID; + +// Protocol/Service Multiplexor (PSM) values (Bluetooth L2CAP spec section 5.2). + +typedef UInt16 BluetoothL2CAPPSM; +// PSM enum in BluetoothAssignedNumbers.h + +// Command Codes + +typedef enum +{ + kBluetoothL2CAPCommandCodeReserved = 0x00, + kBluetoothL2CAPCommandCodeCommandReject = 0x01, + kBluetoothL2CAPCommandCodeConnectionRequest = 0x02, + kBluetoothL2CAPCommandCodeConnectionResponse = 0x03, + kBluetoothL2CAPCommandCodeConfigureRequest = 0x04, + kBluetoothL2CAPCommandCodeConfigureResponse = 0x05, + kBluetoothL2CAPCommandCodeDisconnectionRequest = 0x06, + kBluetoothL2CAPCommandCodeDisconnectionResponse = 0x07, + kBluetoothL2CAPCommandCodeEchoRequest = 0x08, + kBluetoothL2CAPCommandCodeEchoResponse = 0x09, + kBluetoothL2CAPCommandCodeInformationRequest = 0x0A, + kBluetoothL2CAPCommandCodeInformationResponse = 0x0B, + kBluetoothL2CAPCommandCodeCreateChannelRequest = 0x0C, + kBluetoothL2CAPCommandCodeCreateChannelResponse = 0x0D, + kBluetoothL2CAPCommandCodeMoveChannelRequest = 0x0E, + kBluetoothL2CAPCommandCodeMoveChannelResponse = 0x0F, + kBluetoothL2CAPCommandCodeMoveChannelConfirmation = 0x10, + kBluetoothL2CAPCommandCodeMoveChannelConfirmationResponse = 0x11, +} BluetoothL2CAPCommandCode; + +// Command Reject + +typedef enum +{ + kBluetoothL2CAPCommandRejectReasonCommandNotUnderstood = 0x0000, + kBluetoothL2CAPCommandRejectReasonSignallingMTUExceeded = 0x0001, + kBluetoothL2CAPCommandRejectReasonInvalidCIDInRequest = 0x0002, +} BluetoothL2CAPCommandRejectReason; + +typedef UInt16 BluetoothL2CAPMTU; +typedef UInt16 BluetoothL2CAPLinkTimeout; +typedef UInt16 BluetoothL2CAPFlushTimeout; +enum +{ + kBluetoothL2CAPFlushTimeoutUseExisting = 0x0000, + kBluetoothL2CAPFlushTimeoutImmediate = 0x0001, + kBluetoothL2CAPFlushTimeoutForever = 0xFFFF, + + kBluetoothL2CAPFlushTimeoutEnd +}; + +typedef struct BluetoothL2CAPQualityOfServiceOptions BluetoothL2CAPQualityOfServiceOptions; +struct BluetoothL2CAPQualityOfServiceOptions +{ + UInt8 flags; + UInt8 serviceType; + UInt32 tokenRate; + UInt32 tokenBucketSize; + UInt32 peakBandwidth; + UInt32 latency; + UInt32 delayVariation; +}; + +typedef struct BluetoothL2CAPRetransmissionAndFlowControlOptions BluetoothL2CAPRetransmissionAndFlowControlOptions; +struct BluetoothL2CAPRetransmissionAndFlowControlOptions +{ + UInt8 flags; + UInt8 txWindowSize; + UInt8 maxTransmit; + UInt16 retransmissionTimeout; + UInt16 monitorTimeout; + UInt16 maxPDUPayloadSize; +}; + +enum +{ + kBluetoothL2CAPInfoTypeMaxConnectionlessMTUSize = 0x0001 +}; + +// Packets + +enum +{ + kBluetoothL2CAPPacketHeaderSize = 4 +}; + +typedef UInt16 BluetoothL2CAPByteCount; +typedef UInt8 BluetoothL2CAPCommandID; +typedef UInt16 BluetoothL2CAPCommandByteCount; + +typedef enum +{ + kBluetoothL2CAPConnectionResultSuccessful = 0x0000, + kBluetoothL2CAPConnectionResultPending = 0x0001, + kBluetoothL2CAPConnectionResultRefusedPSMNotSupported = 0x0002, + kBluetoothL2CAPConnectionResultRefusedSecurityBlock = 0x0003, + kBluetoothL2CAPConnectionResultRefusedNoResources = 0x0004, +} BluetoothL2CAPConnectionResult; + +typedef enum +{ + kBluetoothL2CAPConnectionStatusNoInfoAvailable = 0x0000, + kBluetoothL2CAPConnectionStatusAuthenticationPending = 0x0001, + kBluetoothL2CAPConnectionStatusAuthorizationPending = 0x0002, +} BluetoothL2CAPConnectionStatus; + +typedef enum +{ + kBluetoothL2CAPConfigurationResultSuccess = 0x0000, + kBluetoothL2CAPConfigurationResultUnacceptableParams = 0x0001, + kBluetoothL2CAPConfigurationResultRejected = 0x0002, + kBluetoothL2CAPConfigurationResultUnknownOptions = 0x0003, +} BluetoothL2CAPConfigurationResult; + +typedef enum +{ + kBluetoothL2CAPConfigurationOptionMTU = 0x01, + kBluetoothL2CAPConfigurationOptionFlushTimeout = 0x02, + kBluetoothL2CAPConfigurationOptionQoS = 0x03, + kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControl = 0x04 +} BluetoothL2CAPConfigurationOption; + +enum +{ + kBluetoothL2CAPConfigurationOptionMTULength = 2, + kBluetoothL2CAPConfigurationOptionFlushTimeoutLength = 2, + kBluetoothL2CAPConfigurationOptionQoSLength = 22, + kBluetoothL2CAPConfigurationOptionRetransmissionAndFlowControlLength = 9 +}; + +typedef enum +{ + kBluetoothL2CAPConfigurationRetransmissionModeFlag = 0x01, + kBluetoothL2CAPConfigurationFlowControlModeFlag = 0x02, + kBluetoothL2CAPConfigurationBasicL2CAPModeFlag = 0x00, +} BluetoothL2CAPConfigurationRetransmissionAndFlowControlFlags; + + +typedef enum +{ + kBluetoothL2CAPInformationTypeConnectionlessMTU = 0x0001, + kBluetoothL2CAPInformationTypeExtendedFeatures = 0x0002, + kBluetoothL2CAPInformationTypeFixedChannelsSupported = 0x0003, +} BluetoothL2CAPInformationType; + +typedef enum +{ + kBluetoothL2CAPInformationResultSuccess = 0x0000, + kBluetoothL2CAPInformationResultNotSupported = 0x0001, +} BluetoothL2CAPInformationResult; + +typedef enum +{ + kBluetoothL2CAPInformationNoExtendedFeatures = 0x00000000, + kBluetoothL2CAPInformationFlowControlMode = 0x00000001, + kBluetoothL2CAPInformationRetransmissionMode = 0x00000002, + kBluetoothL2CAPInformationBidirectionalQoS = 0x00000004, + kBluetoothL2CAPInformationEnhancedRetransmissionMode = 0x00000008, + kBluetoothL2CAPInformationStreamingMode = 0x00000010, + kBluetoothL2CAPInformationFCSOption = 0x00000020, + kBluetoothL2CAPInformationExtendedFlowSpecification = 0x00000040, + kBluetoothL2CAPInformationFixedChannels = 0x00000080, + kBluetoothL2CAPInformationExtendedWindowSize = 0x00000100, + kBluetoothL2CAPUnicastConnectionlessDataReception = 0x00000200, +} BluetoothL2CAPInformationExtendedFeaturesMask; + +typedef enum +{ + kBluetoothL2CAPQoSTypeNoTraffic = 0x00, + kBluetoothL2CAPQoSTypeBestEffort = 0x01, + kBluetoothL2CAPQoSTypeGuaranteed = 0x02, +} BluetoothL2CAPQoSType; + +enum +{ + kBluetoothL2CAPMTUMinimum = 0x0030, // 48 bytes + kBluetoothL2CAPMTUDefault = 0x03F9, // 11.10.08 - dropped back to 1017 from 1021 (don't aggravate the 3DH5 problem between CSR<->BRCM just yet) + kBluetoothL2CAPMTUMaximum = 0xffff, + kBluetoothL2CAPMTUStart = 0x7fff, + kBluetoothL2CAPMTUSIG = 0x0030, // 48 bytes + kBluetoothL2CAPFlushTimeoutDefault = kBluetoothL2CAPFlushTimeoutForever, // 0xffff + kBluetoothL2CAPQoSFlagsDefault = 0, + kBluetoothL2CAPQoSTypeDefault = kBluetoothL2CAPQoSTypeBestEffort, // 0x01 + kBluetoothL2CAPQoSTokenRateDefault = 0x00000000, + kBluetoothL2CAPQoSTokenBucketSizeDefault = 0x00000000, + kBluetoothL2CAPQoSPeakBandwidthDefault = 0x00000000, + kBluetoothL2CAPQoSLatencyDefault = 0xffffffff, + kBluetoothL2CAPQoSDelayVariationDefault = 0xffffffff +}; + +#pragma mark === AMP Manager === +typedef enum { + kBluetoothAMPManagerCodeReserved = 0x00, + kBluetoothAMPManagerCodeAMPCommandReject = 0x01, + kBluetoothAMPManagerCodeAMPDiscoverRequest = 0x02, + kBluetoothAMPManagerCodeAMPDiscoverResponse = 0x03, + kBluetoothAMPManagerCodeAMPChangeNotify = 0x04, + kBluetoothAMPManagerCodeAMPChangeResponse = 0x05, + kBluetoothAMPManagerCodeAMPGetInfoRequest = 0x06, + kBluetoothAMPManagerCodeAMPGetInfoResponse = 0x07, + kBluetoothAMPManagerCodeAMPGetAssocRequest = 0x08, + kBluetoothAMPManagerCodeAMPGetAssocResponse = 0x09, + kBluetoothAMPManagerCodeAMPCreatePhysicalLinkRequest = 0x0A, + kBluetoothAMPManagerCodeAMPCreatePhysicalLinkResponse = 0x0B, + kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkRequest = 0x0C, + kBluetoothAMPManagerCodeAMPDisconnectPhysicalLinkResponse = 0x0D, +} BluetoothAMPManagerCode; + +typedef enum { + kBluetoothAMPManagerCommandRejectReasonCommandNotRecognized = 0x0000, +} BluetoothAMPCommandRejectReason; + +typedef enum { + kBluetoothAMPManagerDiscoverResponseControllerStatusPoweredDown = 0x00, + kBluetoothAMPManagerDiscoverResponseControllerStatusBluetoothOnly = 0x01, + kBluetoothAMPManagerDiscoverResponseControllerStatusNoCapacity = 0x02, + kBluetoothAMPManagerDiscoverResponseControllerStatusLowCapacity = 0x03, + kBluetoothAMPManagerDiscoverResponseControllerStatusMediumCapacity = 0x04, + kBluetoothAMPManagerDiscoverResponseControllerStatusHighCapacity = 0x05, + kBluetoothAMPManagerDiscoverResponseControllerStatusFullCapacity = 0x06, +} BluetoothAMPDiscoverResponseControllerStatus; + +typedef enum { + kBluetoothAMPManagerGetInfoResponseSuccess = 0x00, + kBluetoothAMPManagerGetInfoResponseInvalidControllerID = 0x01, +} BluetoothAMPGetInfoResponseStatus; + +typedef enum { + kBluetoothAMPManagerGetAssocResponseSuccess = 0x00, + kBluetoothAMPManagerGetAssocResponseInvalidControllerID = 0x01, +} BluetoothAMPGetAssocResponseStatus; + +typedef enum { + kBluetoothAMPManagerCreatePhysicalLinkResponseSuccess = 0x00, + kBluetoothAMPManagerCreatePhysicalLinkResponseInvalidControllerID = 0x01, + kBluetoothAMPManagerCreatePhysicalLinkResponseUnableToStartLinkCreation = 0x02, + kBluetoothAMPManagerCreatePhysicalLinkResponseCollisionOccurred = 0x03, + kBluetoothAMPManagerCreatePhysicalLinkResponseAMPDisconnectedPhysicalLinkRequestReceived = 0x04, + kBluetoothAMPManagerCreatePhysicalLinkResponsePhysicalLinkAlreadyExists = 0x05, + kBluetoothAMPManagerCreatePhysicalLinkResponseSecurityViolation = 0x06, +} BluetoothAMPCreatePhysicalLinkResponseStatus; + +typedef enum { + kBluetoothAMPManagerDisconnectPhysicalLinkResponseSuccess = 0x00, + kBluetoothAMPManagerDisconnectPhysicalLinkResponseInvalidControllerID = 0x01, + kBluetoothAMPManagerDisconnectPhysicalLinkResponseNoPhysicalLink = 0x02, +} BluetoothAMPDisconnectPhysicalLinkResponseStatus; + +#if 0 +#pragma mark - +#pragma mark === HCI === +#endif + +//=========================================================================================================================== +// Host Controller Interface (HCI) +//=========================================================================================================================== + +// HCI Command Packet +// ------------------ +// +// 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 +// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +// +--------------------------------+---------------+--------------+ +// | OpCode | | | +// +--------------------+-----------| Param Length | Params... | +// | OCF | OGF | | | +// +--------------------+-----------+---------------+--------------+ +// | | +// | Params... | +// | | +// +---------------------------------------------------------------+ + +// Commands + +typedef UInt8 BluetoothHCICommandOpCodeGroup; +typedef UInt16 BluetoothHCICommandOpCodeCommand; +typedef UInt16 BluetoothHCICommandOpCode; +typedef UInt32 BluetoothHCIVendorCommandSelector; + +#define BluetoothHCIMakeCommandOpCode( GROUP, CMD ) ( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) ) +#define BluetoothHCIMakeCommandOpCodeEndianSwap( GROUP, CMD ) ( CFSwapInt16HostToLittle ( BluetoothHCIMakeCommandOpCode( GROUP, CMD ) ) ) +#define BluetoothHCIExtractCommandOpCodeGroup( OPCODE ) ( ( ( OPCODE ) >> 10 ) & 0x003F ) +#define BluetoothHCIExtractCommandOpCodeCommand( OPCODE ) ( ( OPCODE ) & 0x03FF ) + +#define BluetoothHCIMakeCommandOpCodeHostOrder(GROUP, CMD ) OSSwapLittleToHostConstInt16( ( ( ( GROUP ) & 0x003F ) << 10 ) | ( ( CMD ) & 0x03FF ) ) + + +enum +{ + // Command Group: NoOp + + kBluetoothHCIOpCodeNoOp = 0, + kBluetoothHCICommandGroupNoOp = 0x00, + kBluetoothHCICommandNoOp = 0x0000, + + // Command Group: Link Control + + kBluetoothHCICommandGroupLinkControl = 0x01, + kBluetoothHCICommandInquiry = 0x0001, + kBluetoothHCICommandInquiryCancel = 0x0002, + kBluetoothHCICommandPeriodicInquiryMode = 0x0003, + kBluetoothHCICommandExitPeriodicInquiryMode = 0x0004, + kBluetoothHCICommandCreateConnection = 0x0005, + kBluetoothHCICommandDisconnect = 0x0006, + kBluetoothHCICommandAddSCOConnection = 0x0007, + kBluetoothHCICommandCreateConnectionCancel = 0x0008, + kBluetoothHCICommandAcceptConnectionRequest = 0x0009, + kBluetoothHCICommandRejectConnectionRequest = 0x000A, + kBluetoothHCICommandLinkKeyRequestReply = 0x000B, + kBluetoothHCICommandLinkKeyRequestNegativeReply = 0x000C, + kBluetoothHCICommandPINCodeRequestReply = 0x000D, + kBluetoothHCICommandPINCodeRequestNegativeReply = 0x000E, + kBluetoothHCICommandChangeConnectionPacketType = 0x000F, + kBluetoothHCICommandAuthenticationRequested = 0x0011, + kBluetoothHCICommandSetConnectionEncryption = 0x0013, + kBluetoothHCICommandChangeConnectionLinkKey = 0x0015, + kBluetoothHCICommandMasterLinkKey = 0x0017, + kBluetoothHCICommandRemoteNameRequest = 0x0019, + kBluetoothHCICommandReadRemoteSupportedFeatures = 0x001B, + kBluetoothHCICommandReadRemoteExtendedFeatures = 0x001C, + kBluetoothHCICommandReadRemoteVersionInformation = 0x001D, + kBluetoothHCICommandReadClockOffset = 0x001F, + kBluetoothHCICommandRemoteNameRequestCancel = 0x001A, + kBluetoothHCICommandReadLMPHandle = 0x0020, + kBluetoothHCICommandSetupSynchronousConnection = 0x0028, + kBluetoothHCICommandAcceptSynchronousConnectionRequest = 0x0029, + kBluetoothHCICommandRejectSynchronousConnectionRequest = 0x002A, + kBluetoothHCICommandIOCapabilityRequestReply = 0x002B, + kBluetoothHCICommandUserConfirmationRequestReply = 0x002C, + kBluetoothHCICommandUserConfirmationRequestNegativeReply = 0x002D, + kBluetoothHCICommandUserPasskeyRequestReply = 0x002E, + kBluetoothHCICommandUserPasskeyRequestNegativeReply = 0x002F, + kBluetoothHCICommandRemoteOOBDataRequestReply = 0x0030, + kBluetoothHCICommandRemoteOOBDataRequestNegativeReply = 0x0033, + + // Command Group: Link Policy + + kBluetoothHCICommandGroupLinkPolicy = 0x02, + kBluetoothHCICommandHoldMode = 0x0001, + kBluetoothHCICommandSniffMode = 0x0003, + kBluetoothHCICommandExitSniffMode = 0x0004, + kBluetoothHCICommandParkMode = 0x0005, + kBluetoothHCICommandExitParkMode = 0x0006, + kBluetoothHCICommandQoSSetup = 0x0007, + kBluetoothHCICommandRoleDiscovery = 0x0009, + kBluetoothHCICommandSwitchRole = 0x000B, + kBluetoothHCICommandReadLinkPolicySettings = 0x000C, + kBluetoothHCICommandWriteLinkPolicySettings = 0x000D, + kBluetoothHCICommandReadDefaultLinkPolicySettings = 0x000E, + kBluetoothHCICommandWriteDefaultLinkPolicySettings = 0x000F, + kBluetoothHCICommandFlowSpecification = 0x0010, + kBluetoothHCICommandSniffSubrating = 0x0011, + kBluetoothHCICommandAcceptSniffRequest = 0x0031, + kBluetoothHCICommandRejectSniffRequest = 0x0032, + + // Command Group: Host Controller & Baseband + + kBluetoothHCICommandGroupHostController = 0x03, + kBluetoothHCICommandSetEventMask = 0x0001, + kBluetoothHCICommandReset = 0x0003, + kBluetoothHCICommandSetEventFilter = 0x0005, + kBluetoothHCICommandFlush = 0x0008, + kBluetoothHCICommandReadPINType = 0x0009, + kBluetoothHCICommandWritePINType = 0x000A, + kBluetoothHCICommandCreateNewUnitKey = 0x000B, + kBluetoothHCICommandReadStoredLinkKey = 0x000D, + kBluetoothHCICommandWriteStoredLinkKey = 0x0011, + kBluetoothHCICommandDeleteStoredLinkKey = 0x0012, + kBluetoothHCICommandChangeLocalName = 0x0013, + kBluetoothHCICommandReadLocalName = 0x0014, + kBluetoothHCICommandReadConnectionAcceptTimeout = 0x0015, + kBluetoothHCICommandWriteConnectionAcceptTimeout = 0x0016, + kBluetoothHCICommandReadPageTimeout = 0x0017, + kBluetoothHCICommandWritePageTimeout = 0x0018, + kBluetoothHCICommandReadScanEnable = 0x0019, + kBluetoothHCICommandWriteScanEnable = 0x001A, + kBluetoothHCICommandReadPageScanActivity = 0x001B, + kBluetoothHCICommandWritePageScanActivity = 0x001C, + kBluetoothHCICommandReadInquiryScanActivity = 0x001D, + kBluetoothHCICommandWriteInquiryScanActivity = 0x001E, + kBluetoothHCICommandReadAuthenticationEnable = 0x001F, + kBluetoothHCICommandWriteAuthenticationEnable = 0x0020, + kBluetoothHCICommandReadEncryptionMode = 0x0021, + kBluetoothHCICommandWriteEncryptionMode = 0x0022, + kBluetoothHCICommandReadClassOfDevice = 0x0023, + kBluetoothHCICommandWriteClassOfDevice = 0x0024, + kBluetoothHCICommandReadVoiceSetting = 0x0025, + kBluetoothHCICommandWriteVoiceSetting = 0x0026, + kBluetoothHCICommandReadAutomaticFlushTimeout = 0x0027, + kBluetoothHCICommandWriteAutomaticFlushTimeout = 0x0028, + kBluetoothHCICommandReadNumberOfBroadcastRetransmissions = 0x0029, + kBluetoothHCICommandWriteNumberOfBroadcastRetransmissions = 0x002A, + kBluetoothHCICommandReadHoldModeActivity = 0x002B, + kBluetoothHCICommandWriteHoldModeActivity = 0x002C, + kBluetoothHCICommandReadTransmitPowerLevel = 0x002D, + kBluetoothHCICommandReadSCOFlowControlEnable = 0x002E, + kBluetoothHCICommandWriteSCOFlowControlEnable = 0x002F, + kBluetoothHCICommandSetHostControllerToHostFlowControl = 0x0031, + kBluetoothHCICommandHostBufferSize = 0x0033, + kBluetoothHCICommandHostNumberOfCompletedPackets = 0x0035, + kBluetoothHCICommandReadLinkSupervisionTimeout = 0x0036, + kBluetoothHCICommandWriteLinkSupervisionTimeout = 0x0037, + kBluetoothHCICommandReadNumberOfSupportedIAC = 0x0038, + kBluetoothHCICommandReadCurrentIACLAP = 0x0039, + kBluetoothHCICommandWriteCurrentIACLAP = 0x003A, + kBluetoothHCICommandReadPageScanPeriodMode = 0x003B, + kBluetoothHCICommandWritePageScanPeriodMode = 0x003C, + kBluetoothHCICommandReadPageScanMode = 0x003D, + kBluetoothHCICommandWritePageScanMode = 0x003E, + kBluetoothHCICommandSetAFHClassification = 0x003F, + kBluetoothHCICommandReadInquiryScanType = 0x0042, + kBluetoothHCICommandWriteInquiryScanType = 0x0043, + kBluetoothHCICommandReadInquiryMode = 0x0044, + kBluetoothHCICommandWriteInquiryMode = 0x0045, + kBluetoothHCICommandReadPageScanType = 0x0046, + kBluetoothHCICommandWritePageScanType = 0x0047, + kBluetoothHCICommandReadAFHChannelAssessmentMode = 0x0048, + kBluetoothHCICommandWriteAFHChannelAssessmentMode = 0x0049, + kBluetoothHCICommandReadExtendedInquiryResponse = 0x0051, + kBluetoothHCICommandWriteExtendedInquiryResponse = 0x0052, + kBluetoothHCICommandReadSimplePairingMode = 0x0055, + kBluetoothHCICommandWriteSimplePairingMode = 0x0056, + kBluetoothHCICommandReadLocalOOBData = 0x0057, + kBluetoothHCICommandReadInquiryResponseTransmitPower = 0x0058, + kBluetoothHCICommandWriteInquiryResponseTransmitPower = 0x0059, + kBluetoothHCICommandReadDefaultErroneousDataReporting = 0x005A, + kBluetoothHCICommandWriteDefaultErroneousDataReporting = 0x005B, + kBluetoothHCICommandReadPersistentSniffInterval = 0x005C, + kBluetoothHCICommandWritePersistentSniffInterval = 0x005D, + kBluetoothHCICommandDeletePersistentSniffInterval = 0x005E, + kBluetoothHCICommandEnhancedFlush = 0x005F, + kBluetoothHCICommandSendKeypressNotification = 0x0060, + + // Command Group: Informational + + kBluetoothHCICommandGroupInformational = 0x04, + kBluetoothHCICommandReadLocalVersionInformation = 0x0001, + kBluetoothHCICommandReadLocalSupportedCommands = 0x0002, + kBluetoothHCICommandReadLocalSupportedFeatures = 0x0003, + kBluetoothHCICommandReadLocalExtendedFeatures = 0x0004, + kBluetoothHCICommandReadBufferSize = 0x0005, + kBluetoothHCICommandReadCountryCode = 0x0007, + kBluetoothHCICommandReadDeviceAddress = 0x0009, + + // Command Group: Status + + kBluetoothHCICommandGroupStatus = 0x05, + kBluetoothHCICommandReadFailedContactCounter = 0x0001, + kBluetoothHCICommandResetFailedContactCounter = 0x0002, + kBluetoothHCICommandGetLinkQuality = 0x0003, + kBluetoothHCICommandReadRSSI = 0x0005, + kBluetoothHCICommandReadAFHMappings = 0x0006, + kBluetoothHCICommandReadClock = 0x0007, + + // Command Group: Testing + + kBluetoothHCICommandGroupTesting = 0x06, + kBluetoothHCICommandReadLoopbackMode = 0x0001, + kBluetoothHCICommandWriteLoopbackMode = 0x0002, + kBluetoothHCICommandEnableDeviceUnderTestMode = 0x0003, + kBluetoothHCICommandWriteSimplePairingDebugMode = 0x0004, + + // Command Group: Logo Testing (no commands yet) + + kBluetoothHCICommandGroupLogoTesting = 0x3E, + + // Command Group: Vendor Specific (from Broadcom HCI Programmer's Reference Guide) + + kBluetoothHCICommandGroupVendorSpecific = 0x3f, + kBluetoothHCICommandWriteDeviceAddress = 0x0001, + kBluetoothHCICommandWriteHoppingChannels = 0x0012, + kBluetoothHCICommandInvalidateFlashAndReboot = 0x0017, + kBluetoothHCICommandSetMaxPower = 0x0026, + kBluetoothHCICommandEnableHIDEmulation = 0x003B, + kBluetoothHCICommandEnableRadio = 0x0034, + kBluetoothHCIGetHIDDeviceList = 0x0036, + kBluetoothHCIAddHIDDevice = 0x0037, + kBluetoothHCIRemoveHIDDevice = 0x0039, + + kBluetoothHCICommandGroupMax = 0x40, + kBluetoothHCICommandMax = 0x03FF +}; + +// HCI Data Types + +typedef UInt8 BluetoothHCIQoSFlags; +typedef UInt8 BluetoothHCIParamByteCount; +typedef UInt16 BluetoothHCIACLDataByteCount; +typedef UInt8 BluetoothHCISCODataByteCount; +typedef UInt8 BluetoothHCIInquiryLength; +typedef UInt8 BluetoothHCIResponseCount; +typedef UInt8 BluetoothHCICountryCode; +typedef UInt16 BluetoothHCIModeInterval; +typedef UInt16 BluetoothHCISniffAttemptCount; +typedef UInt16 BluetoothHCISniffTimeout; +typedef UInt16 BluetoothHCIParkModeBeaconInterval; + +typedef UInt8 BluetoothMaxSlots; +typedef UInt16 BluetoothManufacturerName; +typedef UInt8 BluetoothLMPVersion; +typedef UInt16 BluetoothLMPSubversion; + +typedef UInt8 BluetoothHCIConnectionMode; +enum BluetoothHCIConnectionModes +{ + kConnectionActiveMode = 0, + kConnectionHoldMode = 1, + kConnectionSniffMode = 2, + kConnectionParkMode = 3, + kConnectionModeReservedForFutureUse = 4, +}; + +typedef struct BluetoothHCISupportedFeatures BluetoothHCISupportedFeatures; +struct BluetoothHCISupportedFeatures +{ + UInt8 data[8]; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 +typedef UInt8 BluetoothHCIPageNumber; +typedef struct BluetoothHCIExtendedFeaturesInfo BluetoothHCIExtendedFeaturesInfo; +struct BluetoothHCIExtendedFeaturesInfo +{ + BluetoothHCIPageNumber page; + BluetoothHCIPageNumber maxPage; + UInt8 data[8]; +}; +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + +enum BluetoothFeatureBits +{ + // Byte 0 of the support features data structure. + + kBluetoothFeatureThreeSlotPackets = (1 << 0L), + kBluetoothFeatureFiveSlotPackets = (1 << 1L), + kBluetoothFeatureEncryption = (1 << 2L), + kBluetoothFeatureSlotOffset = (1 << 3L), + kBluetoothFeatureTimingAccuracy = (1 << 4L), + kBluetoothFeatureSwitchRoles = (1 << 5L), + kBluetoothFeatureHoldMode = (1 << 6L), + kBluetoothFeatureSniffMode = (1 << 7L), + + // Byte 1 of the support features data structure. + + kBluetoothFeatureParkMode = (1 << 0L), + kBluetoothFeatureRSSI = (1 << 1L), + kBluetoothFeaturePowerControlRequests = (1 << 1L), + kBluetoothFeatureChannelQuality = (1 << 2L), + kBluetoothFeatureSCOLink = (1 << 3L), + kBluetoothFeatureHV2Packets = (1 << 4L), + kBluetoothFeatureHV3Packets = (1 << 5L), + kBluetoothFeatureULawLog = (1 << 6L), + kBluetoothFeatureALawLog = (1 << 7L), + + // Byte 2 of the support features data structure. + + kBluetoothFeatureCVSD = (1 << 0L), + kBluetoothFeaturePagingScheme = (1 << 1L), + kBluetoothFeaturePowerControl = (1 << 2L), + kBluetoothFeatureTransparentSCOData = (1 << 3L), + kBluetoothFeatureFlowControlLagBit0 = (1 << 4L), + kBluetoothFeatureFlowControlLagBit1 = (1 << 5L), + kBluetoothFeatureFlowControlLagBit2 = (1 << 6L), + kBluetoothFeatureBroadcastEncryption = (1 << 7L), + + // Byte 3 of the support features data structure. + + kBluetoothFeatureScatterMode = (1 << 0L), + kBluetoothFeatureEnhancedDataRateACL2MbpsMode = (1 << 1L), + kBluetoothFeatureEnhancedDataRateACL3MbpsMode = (1 << 2L), + kBluetoothFeatureEnhancedInquiryScan = (1 << 3L), + kBluetoothFeatureInterlacedInquiryScan = (1 << 4L), + kBluetoothFeatureInterlacedPageScan = (1 << 5L), + kBluetoothFeatureRSSIWithInquiryResult = (1 << 6L), + kBluetoothFeatureExtendedSCOLink = (1 << 7L), + + // Byte 4 of the support features data structure. + + kBluetoothFeatureEV4Packets = (1 << 0L), + kBluetoothFeatureEV5Packets = (1 << 1L), + kBluetoothFeatureAbsenceMasks = (1 << 2L), + kBluetoothFeatureAFHCapableSlave = (1 << 3L), + kBluetoothFeatureAFHClassificationSlave = (1 << 4L), + kBluetoothFeatureAliasAuhentication = (1 << 5L), + kBluetoothFeatureAnonymityMode = (1 << 6L), + kBluetoothFeature3SlotEnhancedDataRateACLPackets = (1 << 7L), + + // Byte 5 of the support features data structure. + + kBluetoothFeature5SlotEnhancedDataRateACLPackets = (1 << 0L), // 2.0 version of this header had this at the wrong bit location + kBluetoothFeatureSniffSubrating = (1 << 1L), + kBluetoothFeaturePauseEncryption = (1 << 2L), + kBluetoothFeatureAFHCapableMaster = (1 << 3L), + kBluetoothFeatureAFHClassificationMaster = (1 << 4L), + kBluetoothFeatureEnhancedDataRateeSCO2MbpsMode = (1 << 5L), + kBluetoothFeatureEnhancedDataRateeSCO3MbpsMode = (1 << 6L), + kBluetoothFeature3SlotEnhancedDataRateeSCOPackets = (1 << 7L), + + // Byte 6 of the support features data structure. + + kBluetoothFeatureExtendedInquiryResponse = (1 << 0L), + kBluetoothFeatureSecureSimplePairing = (1 << 3L), + kBluetoothFeatureEncapsulatedPDU = (1 << 4L), + kBluetoothFeatureErroneousDataReporting = (1 << 5L), + kBluetoothFeatureNonFlushablePacketBoundaryFlag = (1 << 6L), + + // Byte 7 of the support features data structure. + + kBluetoothFeatureLinkSupervisionTimeoutChangedEvent = (1 << 0L), + kBluetoothFeatureInquiryTransmissionPowerLevel = (1 << 1L), + kBluetoothFeatureExtendedFeatures = (1 << 7L), + + // Byte 8 of the support features data structure (extended) + + kBluetoothFeatureSimpleSecurePairingHostMode = (1 << 0L), + +}; + +typedef UInt16 BluetoothHCIFailedContactCount; +typedef struct BluetoothHCIFailedContactInfo BluetoothHCIFailedContactInfo; +struct BluetoothHCIFailedContactInfo +{ + BluetoothHCIFailedContactCount count; + BluetoothConnectionHandle handle; +}; + +typedef SInt8 BluetoothHCIRSSIValue; /* Valid Range: -127 to +20 */ +typedef struct BluetoothHCIRSSIInfo BluetoothHCIRSSIInfo; +struct BluetoothHCIRSSIInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIRSSIValue RSSIValue; +}; + +typedef UInt8 BluetoothHCILinkQuality; +typedef struct BluetoothHCILinkQualityInfo BluetoothHCILinkQualityInfo; +struct BluetoothHCILinkQualityInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCILinkQuality qualityValue; +}; + +typedef UInt8 BluetoothHCIRole; +typedef struct BluetoothHCIRoleInfo BluetoothHCIRoleInfo; +struct BluetoothHCIRoleInfo +{ + UInt8 role; + BluetoothConnectionHandle handle; +}; + +enum BluetoothHCIRoles +{ + kBluetoothHCIMasterRole = 0x00, + kBluetoothHCISlaveRole = 0x01 +}; + +typedef UInt16 BluetoothHCILinkPolicySettings; +enum BluetoothHCILinkPolicySettingsValues +{ + kDisableAllLMModes = 0x0000, + kEnableMasterSlaveSwitch = 0x0001, + kEnableHoldMode = 0x0002, + kEnableSniffMode = 0x0004, + kEnableParkMode = 0x0008, + kReservedForFutureUse = 0x0010 +}; + +typedef struct BluetoothHCILinkPolicySettingsInfo BluetoothHCILinkPolicySettingsInfo; +struct BluetoothHCILinkPolicySettingsInfo +{ + BluetoothHCILinkPolicySettings settings; + BluetoothConnectionHandle handle; +}; + + +typedef struct BluetoothHCIQualityOfServiceSetupParams BluetoothHCIQualityOfServiceSetupParams; +struct BluetoothHCIQualityOfServiceSetupParams +{ + UInt8 flags; + UInt8 serviceType; + UInt32 tokenRate; + UInt32 peakBandwidth; + UInt32 latency; + UInt32 delayVariation; +}; + +typedef UInt8 BluetoothHCILoopbackMode; +enum +{ + kBluetoothHCILoopbackModeOff = 0x00, + kBluetoothHCILoopbackModeLocal = 0x01, + kBluetoothHCILoopbackModeRemote = 0x02 +}; + +typedef UInt32 BluetoothHCIOperationID; +typedef UInt32 BluetoothHCIEventID; +typedef UInt32 BluetoothHCIDataID; +typedef UInt32 BluetoothHCISignalID; +typedef UInt32 BluetoothHCITransportID; +typedef UInt32 BluetoothHCITransportCommandID; +typedef UInt32 BluetoothHCIRequestID; + + +// Version Information + +typedef struct BluetoothHCIVersionInfo BluetoothHCIVersionInfo; +struct BluetoothHCIVersionInfo +{ + // Local & Remote information + + BluetoothManufacturerName manufacturerName; + BluetoothLMPVersion lmpVersion; + BluetoothLMPSubversion lmpSubVersion; + + // Local information only + + UInt8 hciVersion; + UInt16 hciRevision; +}; + +// HCI buffer sizes. + +typedef struct BluetoothHCIBufferSize BluetoothHCIBufferSize; +struct BluetoothHCIBufferSize +{ + UInt16 ACLDataPacketLength; + UInt8 SCODataPacketLength; + UInt16 totalNumACLDataPackets; + UInt16 totalNumSCODataPackets; +}; + +// Timeouts +typedef UInt16 BluetoothHCIConnectionAcceptTimeout; +typedef UInt16 BluetoothHCIPageTimeout; +enum BluetoothHCITimeoutValues +{ + kDefaultPageTimeout = 0x2000, +}; + +#define BluetoothGetSlotsFromSeconds( inSeconds ) ( (inSeconds/.000625 ) ) + + +// Link Keys +typedef UInt16 BluetoothHCINumLinkKeysDeleted; +typedef UInt8 BluetoothHCINumLinkKeysToWrite; +typedef UInt8 BluetoothHCIDeleteStoredLinkKeyFlag; +enum BluetoothHCIDeleteStoredLinkKeyFlags +{ + kDeleteKeyForSpecifiedDeviceOnly = 0x00, + kDeleteAllStoredLinkKeys = 0x01, +}; + +typedef UInt8 BluetoothHCIReadStoredLinkKeysFlag; +enum BluetoothHCIReadStoredLinkKeysFlags +{ + kReturnLinkKeyForSpecifiedDeviceOnly = 0x00, + kReadAllStoredLinkKeys = 0x01, +}; + +typedef struct BluetoothHCIStoredLinkKeysInfo BluetoothHCIStoredLinkKeysInfo; +struct BluetoothHCIStoredLinkKeysInfo +{ + UInt16 numLinkKeysRead; + UInt16 maxNumLinkKeysAllowedInDevice; +}; + + +// Page Scan + +typedef UInt8 BluetoothHCIPageScanMode; +enum BluetoothHCIPageScanModes +{ + kMandatoryPageScanMode = 0x00, + kOptionalPageScanMode1 = 0x01, + kOptionalPageScanMode2 = 0x02, + kOptionalPageScanMode3 = 0x03, +}; + +typedef UInt8 BluetoothHCIPageScanPeriodMode; +enum BluetoothHCIPageScanPeriodModes +{ + kP0Mode = 0x00, + kP1Mode = 0x01, + kP2Mode = 0x02, +}; + +typedef UInt8 BluetoothHCIPageScanEnableState; +enum BluetoothHCIPageScanEnableStates +{ + kNoScansEnabled = 0x00, + kInquiryScanEnabledPageScanDisabled = 0x01, + kInquiryScanDisabledPageScanEnabled = 0x02, + kInquiryScanEnabledPageScanEnabled = 0x03, +}; + +typedef struct BluetoothHCIScanActivity BluetoothHCIScanActivity; +struct BluetoothHCIScanActivity +{ + UInt16 scanInterval; + UInt16 scanWindow; +}; + +typedef struct BluetoothHCIInquiryAccessCode BluetoothHCIInquiryAccessCode; +struct BluetoothHCIInquiryAccessCode +{ + UInt8 data[3]; +}; + +typedef UInt8 BluetoothHCIInquiryAccessCodeCount; +typedef struct BluetoothHCICurrentInquiryAccessCodes BluetoothHCICurrentInquiryAccessCodes; +struct BluetoothHCICurrentInquiryAccessCodes +{ + BluetoothHCIInquiryAccessCodeCount count; // Number of codes in array. + BluetoothHCIInquiryAccessCode * codes; // Ptr to array of codes. +}; + +typedef struct BluetoothHCILinkSupervisionTimeout BluetoothHCILinkSupervisionTimeout; +struct BluetoothHCILinkSupervisionTimeout +{ + BluetoothConnectionHandle handle; + UInt16 timeout; +}; + +typedef UInt8 BluetoothHCIFlowControlState; +enum BluetoothHCISCOFlowControlStates +{ + kSCOFlowControlDisabled = 0x00, + kSCOFlowControlEnabled = 0x01 +}; + +enum BluetoothHCIGeneralFlowControlStates +{ + kHostControllerToHostFlowControlOff = 0x00, + kHCIACLDataPacketsOnHCISCODataPacketsOff = 0x01, + kHCIACLDataPacketsOffHCISCODataPacketsOn = 0x02, + kHCIACLDataPacketsOnHCISCODataPacketsOn = 0x03, +}; + +typedef SInt8 BluetoothHCITransmitPowerLevel; +typedef UInt8 BluetoothHCITransmitPowerLevelType; +enum BluetoothHCITransmitReadPowerLevelTypes +{ + kReadCurrentTransmitPowerLevel = 0x00, + kReadMaximumTransmitPowerLevel = 0x01, +}; + +typedef UInt8 BluetoothHCIAFHChannelAssessmentMode; +enum BluetoothHCIAFHChannelAssessmentModes +{ + kAFHChannelAssessmentModeDisabled = 0x00, + kAFHChannelAssessmentModeEnabled = 0x01 +}; + + +typedef struct BluetoothHCITransmitPowerLevelInfo BluetoothHCITransmitPowerLevelInfo; +struct BluetoothHCITransmitPowerLevelInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCITransmitPowerLevel level; // Range: -70 <= N <= 20 (units are dBm) +}; + +typedef UInt8 BluetoothHCINumBroadcastRetransmissions; +typedef UInt8 BluetoothHCIHoldModeActivity; +enum BluetoothHCIHoldModeActivityStates +{ + kMaintainCurrentPowerState = 0x00, + kSuspendPageScan = 0x01, + kSuspendInquiryScan = 0x02, + kSuspendPeriodicInquiries = 0x03, +}; + +typedef UInt8 BluetoothHCIAuthenticationEnable; +enum BluetoothHCIAuthentionEnableModes +{ + kAuthenticationDisabled = 0x00, + kAuthenticationEnabled = 0x01, +}; + +typedef UInt8 BluetoothHCIEncryptionMode; +enum BluetoothHCIEncryptionModes +{ + kEncryptionDisabled = 0x00, // Default. + kEncryptionOnlyForPointToPointPackets = 0x01, + kEncryptionForBothPointToPointAndBroadcastPackets = 0x02, +}; + +typedef UInt16 BluetoothHCIAutomaticFlushTimeout; +typedef struct BluetoothHCIAutomaticFlushTimeoutInfo BluetoothHCIAutomaticFlushTimeoutInfo; +struct BluetoothHCIAutomaticFlushTimeoutInfo +{ + BluetoothConnectionHandle handle; + BluetoothHCIAutomaticFlushTimeout timeout; +}; + +#define kInfoStringMaxLength 25 +typedef struct BluetoothTransportInfo BluetoothTransportInfo; +typedef BluetoothTransportInfo* BluetoothTransportInfoPtr; +struct BluetoothTransportInfo +{ + UInt32 productID; + UInt32 vendorID; + UInt32 type; + char productName[kInfoStringMaxLength]; + char vendorName[kInfoStringMaxLength]; +}; + +enum BluetoothTransportTypes +{ + kBluetoothTransportTypeUSB = 0x01, + kBluetoothTransportTypePCCard = 0x02, + kBluetoothTransportTypePCICard = 0x03 +}; + +// Inquiries + +typedef struct BluetoothHCIInquiryResult BluetoothHCIInquiryResult; +struct BluetoothHCIInquiryResult +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + BluetoothHCIPageScanPeriodMode pageScanPeriodMode; + BluetoothHCIPageScanMode pageScanMode; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; +}; + +#define kBluetoothHCIInquiryResultsMaxResults 50 +typedef struct BluetoothHCIInquiryResults BluetoothHCIInquiryResults; +struct BluetoothHCIInquiryResults +{ + BluetoothHCIInquiryResult results[kBluetoothHCIInquiryResultsMaxResults]; + IOItemCount count; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +//Inquiries with RSSI (v1.2 specification) + +typedef struct BluetoothHCIInquiryWithRSSIResult BluetoothHCIInquiryWithRSSIResult; +struct BluetoothHCIInquiryWithRSSIResult +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + UInt8 reserved; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; + BluetoothHCIRSSIValue RSSIValue; +}; + +typedef struct BluetoothHCIInquiryWithRSSIResults BluetoothHCIInquiryWithRSSIResults; +struct BluetoothHCIInquiryWithRSSIResults +{ + BluetoothHCIInquiryWithRSSIResult results[50]; + IOItemCount count; +}; + +//Inquiries with 'Extended Inquiry Response' (v2.1 specification) + +typedef UInt8 BluetoothHCIFECRequired; +enum BluetoothHCIFECRequiredValues +{ + kBluetoothHCIFECRequired = 0x00, + kBluetoothHCIFECNotRequired = 0x01 +}; + +typedef UInt8 BluetoothHCIInquiryMode; +enum BluetoothHCIInquiryModes +{ + kBluetoothHCIInquiryModeResultFormatStandard = 0x00, + kBluetoothHCIInquiryModeResultFormatWithRSSI = 0x01, + kBluetoothHCIInquiryModeResultFormatWithRSSIOrExtendedInquiryResultFormat = 0x02 +}; + +typedef UInt8 BluetoothHCIExtendedInquiryResponseDataType; + +typedef struct BluetoothHCIExtendedInquiryResponse BluetoothHCIExtendedInquiryResponse; /* Extended Inquiry Response [EIR] data, consisting of a sequence of data structures in this format: [length(1byte)][data type(1byte)][data(e.g. device name)] */ +struct BluetoothHCIExtendedInquiryResponse +{ + UInt8 data[ 240 ]; +}; + +typedef struct BluetoothHCIReadExtendedInquiryResponseResults BluetoothHCIReadExtendedInquiryResponseResults; +struct BluetoothHCIReadExtendedInquiryResponseResults +{ + BluetoothHCIFECRequired outFECRequired; + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; +}; + +typedef struct BluetoothHCIExtendedInquiryResult BluetoothHCIExtendedInquiryResult; +struct BluetoothHCIExtendedInquiryResult +{ + UInt8 numberOfReponses; /* always a value of 1 */ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; + UInt8 reserved; + BluetoothClassOfDevice classOfDevice; + BluetoothClockOffset clockOffset; + BluetoothHCIRSSIValue RSSIValue; + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; +}; + +// 'Simple Pairing' (v2.1 specification) + +typedef UInt8 BluetoothHCISimplePairingMode; +enum BluetoothHCISimplePairingModes +{ + kBluetoothHCISimplePairingModeNotSet = 0x00, + kBluetoothHCISimplePairingModeEnabled = 0x01 +}; + +typedef UInt8 BluetoothSimplePairingDebugMode; +enum BluetoothSimplePairingDebugModes +{ + kBluetoothHCISimplePairingDebugModeDisabled = 0x00, + kBluetoothHCISimplePairingDebugModeEnabled = 0x01 +}; + +typedef struct BluetoothHCISimplePairingOOBData BluetoothHCISimplePairingOOBData; +struct BluetoothHCISimplePairingOOBData +{ + UInt8 data[ 16 ]; +}; + +typedef struct BluetoothHCIReadLocalOOBDataResults BluetoothHCIReadLocalOOBDataResults; +struct BluetoothHCIReadLocalOOBDataResults +{ + BluetoothHCISimplePairingOOBData hash; + BluetoothHCISimplePairingOOBData randomizer; +}; + +typedef UInt8 BluetoothIOCapability; +enum BluetoothIOCapabilities +{ + kBluetoothCapabilityTypeDisplayOnly = 0x00, + kBluetoothCapabilityTypeDisplayYesNo = 0x01, + kBluetoothCapabilityTypeKeyboardOnly = 0x02, + kBluetoothCapabilityTypeNoInputNoOutput = 0x03 +}; + +typedef UInt8 BluetoothOOBDataPresence; +enum BluetoothOOBDataPresenceValues +{ + kBluetoothOOBAuthenticationDataNotPresent = 0x00, + kBluetoothOOBAuthenticationDataFromRemoteDevicePresent = 0x01 +}; + +typedef UInt8 BluetoothAuthenticationRequirements; +enum BluetoothAuthenticationRequirementsValues +{ + kBluetoothAuthenticationRequirementsMITMProtectionNotRequired = 0x00, /* Numeric comparison with automatic accept allowed */ + kBluetoothAuthenticationRequirementsMITMProtectionRequired = 0x01, /* Refer to BluetoothIOCapabilities to determine authentication procedure */ + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredNoBonding = 0x00, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredNoBonding = 0x01, + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredDedicatedBonding = 0x02, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredDedicatedBonding = 0x03, + kBluetoothAuthenticationRequirementsMITMProtectionNotRequiredGeneralBonding = 0x04, + kBluetoothAuthenticationRequirementsMITMProtectionRequiredGeneralBonding = 0x05 +}; + +typedef struct BluetoothIOCapabilityResponse BluetoothIOCapabilityResponse; +struct BluetoothIOCapabilityResponse +{ + BluetoothDeviceAddress deviceAddress; + BluetoothIOCapability ioCapability; /* possible values from BluetoothIOCapabilities above */ + BluetoothOOBDataPresence OOBDataPresence; + BluetoothAuthenticationRequirements authenticationRequirements; +}; + +typedef UInt32 BluetoothPasskey; + +typedef struct BluetoothUserPasskeyNotification BluetoothUserPasskeyNotification; +struct BluetoothUserPasskeyNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPasskey passkey; /* passkey for display. valid values are 000000 - 999999 */ +}; + +typedef UInt8 BluetoothKeypressNotificationType; +enum BluetoothKeypressNotificationTypes +{ + kBluetoothKeypressNotificationTypePasskeyEntryStarted = 0, + kBluetoothKeypressNotificationTypePasskeyDigitEntered = 1, + kBluetoothKeypressNotificationTypePasskeyDigitErased = 2, + kBluetoothKeypressNotificationTypePasskeyCleared = 3, + kBluetoothKeypressNotificationTypePasskeyEntryCompleted = 4 +}; + +typedef struct BluetoothKeypressNotification BluetoothKeypressNotification; +struct BluetoothKeypressNotification +{ + BluetoothDeviceAddress deviceAddress; + BluetoothKeypressNotificationType notificationType; +}; + +typedef SInt8 TransmissionPower; + +typedef UInt8 BluetoothAFHMode; +typedef struct BluetoothAFHResults BluetoothAFHResults; +struct BluetoothAFHResults +{ + BluetoothConnectionHandle handle; + BluetoothAFHMode mode; + UInt8 afhMap[10]; +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 + +typedef UInt32 BluetoothNumericValue; + +typedef struct BluetoothUserConfirmationRequest BluetoothUserConfirmationRequest; +struct BluetoothUserConfirmationRequest +{ + BluetoothDeviceAddress deviceAddress; + BluetoothNumericValue numericValue; /* numeric value for display. valid values are 000000 - 999999 */ +}; + +typedef struct BluetoothHCIEventSimplePairingCompleteResults BluetoothHCIEventSimplePairingCompleteResults; +struct BluetoothHCIEventSimplePairingCompleteResults +{ + BluetoothDeviceAddress deviceAddress; +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + + +// Packet Sizes + +enum +{ + kBluetoothHCICommandPacketHeaderSize = 3, + kBluetoothHCICommandPacketMaxDataSize = 255, + kBluetoothHCIMaxCommandPacketSize = kBluetoothHCICommandPacketHeaderSize + kBluetoothHCICommandPacketMaxDataSize, + + kBluetoothHCIEventPacketHeaderSize = 2, + kBluetoothHCIEventPacketMaxDataSize = 255, + kBluetoothHCIMaxEventPacketSize = kBluetoothHCIEventPacketHeaderSize + kBluetoothHCIEventPacketMaxDataSize, + + kBluetoothHCIDataPacketHeaderSize = 4, + kBluetoothHCIDataPacketMaxDataSize = 65535, + kBluetoothHCIMaxDataPacketSize = kBluetoothHCIDataPacketHeaderSize + kBluetoothHCIDataPacketMaxDataSize +}; + +typedef UInt8 BluetoothHCIEventCode; +typedef UInt8 BluetoothLinkType; +enum BluetoothLinkTypes +{ + kBluetoothSCOConnection = 0, + kBluetoothACLConnection = 1, + kBluetoothESCOConnection = 2, + kBluetoothLinkTypeNone = 0xff +}; + +typedef UInt16 BluetoothHCIVoiceSetting; // 10 bits meaningful +typedef UInt8 BluetoothHCISupportedIAC; + +typedef uint32_t BluetoothHCITransmitBandwidth; +typedef uint32_t BluetoothHCIReceiveBandwidth; +typedef uint16_t BluetoothHCIMaxLatency; +typedef uint8_t BluetoothHCIRetransmissionEffort; +enum BluetoothHCIRetransmissionEffortTypes +{ + kHCIRetransmissionEffortTypeNone = 0x00, + kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeForPower = 0x01, + kHCIRetransmissionEffortTypeAtLeastOneAndOptimizeLinkQuality = 0x02, + kHCIRetransmissionEffortTypeDontCare = 0xFF, +}; + + +// Setup Synchronous Packet types (Bluetooth 2.1 spec section 7.7.35 - Setup Synchronous Command Complete Event) + +typedef uint8_t BluetoothAirMode; +enum +{ + kBluetoothAirModeULawLog = 0x00, + kBluetoothAirModeALawLog = 0x01, + kBluetoothAirModeCVSD = 0x02, + kBluetoothAirModeTransparentData = 0x03 +}; + +typedef struct BluetoothSynchronousConnectionInfo BluetoothSynchronousConnectionInfo; +struct BluetoothSynchronousConnectionInfo +{ + BluetoothHCITransmitBandwidth transmitBandWidth; + BluetoothHCIReceiveBandwidth receiveBandWidth; + BluetoothHCIMaxLatency maxLatency; + BluetoothHCIVoiceSetting voiceSetting; + BluetoothHCIRetransmissionEffort retransmissionEffort; + BluetoothPacketType packetType; +}; + +typedef struct BluetoothHCIEventSynchronousConnectionCompleteResults BluetoothHCIEventSynchronousConnectionCompleteResults; +struct BluetoothHCIEventSynchronousConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothLinkType linkType; + uint8_t transmissionInterval; + uint8_t retransmissionWindow; + uint16_t receivePacketLength; + uint16_t transmitPacketLength; + BluetoothAirMode airMode; +}; + + +typedef UInt8 BluetoothHCIStatus; +typedef UInt8 BluetoothHCIEventStatus; + +// Events. + +enum +{ + kBluetoothHCIEventInquiryComplete = 0x01, + kBluetoothHCIEventInquiryResult = 0x02, + kBluetoothHCIEventConnectionComplete = 0x03, + kBluetoothHCIEventConnectionRequest = 0x04, + kBluetoothHCIEventDisconnectionComplete = 0x05, + kBluetoothHCIEventAuthenticationComplete = 0x06, + kBluetoothHCIEventRemoteNameRequestComplete = 0x07, + kBluetoothHCIEventEncryptionChange = 0x08, + kBluetoothHCIEventChangeConnectionLinkKeyComplete = 0x09, + kBluetoothHCIEventMasterLinkKeyComplete = 0x0A, + kBluetoothHCIEventReadRemoteSupportedFeaturesComplete = 0x0B, + kBluetoothHCIEventReadRemoteVersionInformationComplete = 0x0C, + kBluetoothHCIEventQoSSetupComplete = 0x0D, + kBluetoothHCIEventCommandComplete = 0x0E, + kBluetoothHCIEventCommandStatus = 0x0F, + kBluetoothHCIEventHardwareError = 0x10, + kBluetoothHCIEventFlushOccurred = 0x11, + kBluetoothHCIEventRoleChange = 0x12, + kBluetoothHCIEventNumberOfCompletedPackets = 0x13, + kBluetoothHCIEventModeChange = 0x14, + kBluetoothHCIEventReturnLinkKeys = 0x15, + kBluetoothHCIEventPINCodeRequest = 0x16, + kBluetoothHCIEventLinkKeyRequest = 0x17, + kBluetoothHCIEventLinkKeyNotification = 0x18, + kBluetoothHCIEventLoopbackCommand = 0x19, + kBluetoothHCIEventDataBufferOverflow = 0x1A, + kBluetoothHCIEventMaxSlotsChange = 0x1B, + kBluetoothHCIEventReadClockOffsetComplete = 0x1C, + kBluetoothHCIEventConnectionPacketType = 0x1D, + kBluetoothHCIEventQoSViolation = 0x1E, + kBluetoothHCIEventPageScanModeChange = 0x1F, + kBluetoothHCIEventPageScanRepetitionModeChange = 0x20, + + // [v1.2] + + kBluetoothHCIEventFlowSpecificationComplete = 0x21, + kBluetoothHCIEventInquiryResultWithRSSI = 0x22, + kBluetoothHCIEventReadRemoteExtendedFeaturesComplete = 0x23, + kBluetoothHCIEventSynchronousConnectionComplete = 0x2C, + kBluetoothHCIEventSynchronousConnectionChanged = 0x2D, + + // [v2.1] + + kBluetoothHCIEventSniffSubstrate = 0x2E, + kBluetoothHCIEventExtendedInquiryResult = 0x2F, + kBluetoothHCIEventIOCapabilityRequest = 0x31, + kBluetoothHCIEventIOCapabilityResponse = 0x32, + kBluetoothHCIEventUserConfirmationRequest = 0x33, + kBluetoothHCIEventUserPasskeyRequest = 0x34, + kBluetoothHCIEventRemoteOOBDataRequest = 0x35, + kBluetoothHCIEventSimplePairingComplete = 0x36, + kBluetoothHCIEventLinkSupervisionTimeoutChanged = 0x38, + kBluetoothHCIEventEnhancedFlushComplete = 0x39, + kBluetoothHCIEventSniffRequest = 0x3A, + kBluetoothHCIEventUserPasskeyNotification = 0x3B, + kBluetoothHCIEventKeypressNotification = 0x3C, + + kBluetoothHCIEventLogoTesting = 0xFE, + kBluetoothHCIEventVendorSpecific = 0xFF +}; + +// HCI Event Masks + +// Event masks are 8 octets according to the spec. v2.1 introduces some event masks that +// actually exceed 32 bits so the 4 byte enum we had before Bluetooth 2.0 will still work for old +// the masks, but the new masks need to be defined as 64 bits. + +typedef uint64_t BluetoothHCIEventMask; + +#define kBluetoothHCIEventMaskDefault64Bit 0x00001FFFFFFFFFFFLL +#define kBluetoothHCIEventMaskAll64Bit 0xFFFFFFFFFFFFFFFFLL + + // [v1.2] + +#define kBluetoothHCIEventMaskFlowSpecificationCompleteEvent 0x0000000100000000LL +#define kBluetoothHCIEventMaskInquiryResultWithRSSIEvent 0x0000000200000000LL +#define kBluetoothHCIEventMaskReadRemoteExtendedFeaturesCompleteEvent 0x0000000400000000LL +#define kBluetoothHCIEventMaskSynchronousConnectionCompleteEvent 0x0000080000000000LL +#define kBluetoothHCIEventMaskSynchronousConnectionChangedEvent 0x0000100000000000LL + + // [v2.1] + +#define kBluetoothHCIEventMaskSniffSubstrateEvent 0x0000200000000000LL +#define kBluetoothHCIEventMaskExtendedInquiryResultEvent 0x0000400000000000LL +#define kBluetoothHCIEventMaskLinkSupervisionTimeoutChangedEvent 0x0080000000000000LL +#define kBluetoothHCIEventMaskEnhancedFlushCompleteEvent 0x0100000000000000LL + + // [v2.1 Secure Simple Pairing] + +#define kBluetoothHCIEventMaskIOCapabilityRequestEvent 0x0001000000000000LL +#define kBluetoothHCIEventMaskIOCapabilityRequestReplyEvent 0x0002000000000000LL +#define kBluetoothHCIEventMaskUserConfirmationRequestEvent 0x0004000000000000LL +#define kBluetoothHCIEventMaskUserPasskeyRequestEvent 0x0008000000000000LL +#define kBluetoothHCIEventMaskRemoteOOBDataRequestEvent 0x0010000000000000LL +#define kBluetoothHCIEventMaskSimplePairingCompleteEvent 0x0020000000000000LL +#define kBluetoothHCIEventMaskUserPasskeyNotificationEvent 0x0400000000000000LL +#define kBluetoothHCIEventMaskKeypressNotificationEvent 0x0800000000000000LL + +enum +{ + kBluetoothHCIEventMaskNone = 0x00000000, + kBluetoothHCIEventMaskInquiryComplete = 0x00000001, + kBluetoothHCIEventMaskInquiryResult = 0x00000002, + kBluetoothHCIEventMaskConnectionComplete = 0x00000004, + kBluetoothHCIEventMaskConnectionRequest = 0x00000008, + kBluetoothHCIEventMaskDisconnectionComplete = 0x00000010, + kBluetoothHCIEventMaskAuthenticationComplete = 0x00000020, + kBluetoothHCIEventMaskRemoteNameRequestComplete = 0x00000040, + kBluetoothHCIEventMaskEncryptionChange = 0x00000080, + kBluetoothHCIEventMaskChangeConnectionLinkKeyComplete = 0x00000100, + kBluetoothHCIEventMaskMasterLinkKeyComplete = 0x00000200, + kBluetoothHCIEventMaskReadRemoteSupportedFeaturesComplete = 0x00000400, + kBluetoothHCIEventMaskReadRemoteVersionInformationComplete = 0x00000800, + kBluetoothHCIEventMaskQoSSetupComplete = 0x00001000, + kBluetoothHCIEventMaskCommandComplete = 0x00002000, + kBluetoothHCIEventMaskCommandStatus = 0x00004000, + kBluetoothHCIEventMaskHardwareError = 0x00008000, + kBluetoothHCIEventMaskFlushOccurred = 0x00010000, + kBluetoothHCIEventMaskRoleChange = 0x00020000, + + kBluetoothHCIEventMaskNumberOfCompletedPackets = 0x00040000, + kBluetoothHCIEventMaskModeChange = 0x00080000, + kBluetoothHCIEventMaskReturnLinkKeys = 0x00100000, + kBluetoothHCIEventMaskPINCodeRequest = 0x00200000, + kBluetoothHCIEventMaskLinkKeyRequest = 0x00400000, + kBluetoothHCIEventMaskLinkKeyNotification = 0x00800000, + kBluetoothHCIEventMaskLoopbackCommand = 0x01000000, + kBluetoothHCIEventMaskDataBufferOverflow = 0x02000000, + kBluetoothHCIEventMaskMaxSlotsChange = 0x04000000, + kBluetoothHCIEventMaskReadClockOffsetComplete = 0x08000000, + kBluetoothHCIEventMaskConnectionPacketTypeChanged = 0x10000000, + kBluetoothHCIEventMaskQoSViolation = 0x20000000, + kBluetoothHCIEventMaskPageScanModeChange = 0x40000000, + kBluetoothHCIEventMaskPageScanRepetitionModeChange = 0x80000000, + + kBluetoothHCIEventMaskAll = 0xFFFFFFFF, + kBluetoothHCIEventMaskDefault = kBluetoothHCIEventMaskAll /* Use kBluetoothHCIEventMaskDefault64Bit above! */ +}; + +// Event results structures. + +typedef struct BluetoothHCIEventConnectionCompleteResults BluetoothHCIEventConnectionCompleteResults; +struct BluetoothHCIEventConnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothLinkType linkType; + BluetoothHCIEncryptionMode encryptionMode; +}; + +typedef struct BluetoothHCIEventDisconnectionCompleteResults BluetoothHCIEventDisconnectionCompleteResults; +struct BluetoothHCIEventDisconnectionCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothReasonCode reason; +}; + +typedef struct BluetoothHCIEventReadSupportedFeaturesResults BluetoothHCIEventReadSupportedFeaturesResults; +struct BluetoothHCIEventReadSupportedFeaturesResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures supportedFeatures; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 +typedef struct BluetoothHCIEventReadExtendedFeaturesResults BluetoothHCIEventReadExtendedFeaturesResults; +struct BluetoothHCIEventReadExtendedFeaturesResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIExtendedFeaturesInfo supportedFeaturesInfo; +}; +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + +typedef struct BluetoothHCIEventReadRemoteVersionInfoResults BluetoothHCIEventReadRemoteVersionInfoResults; +struct BluetoothHCIEventReadRemoteVersionInfoResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothLMPVersion lmpVersion; + BluetoothManufacturerName manufacturerName; + BluetoothLMPSubversion lmpSubversion; +}; + +typedef struct BluetoothHCIEventRemoteNameRequestResults BluetoothHCIEventRemoteNameRequestResults; +struct BluetoothHCIEventRemoteNameRequestResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothDeviceName deviceName; +}; + +typedef struct BluetoothHCIEventReadClockOffsetResults BluetoothHCIEventReadClockOffsetResults; +struct BluetoothHCIEventReadClockOffsetResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothClockOffset clockOffset; +}; + +typedef struct BluetoothHCIEventConnectionRequestResults BluetoothHCIEventConnectionRequestResults; +struct BluetoothHCIEventConnectionRequestResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothClassOfDevice classOfDevice; + BluetoothLinkType linkType; +}; + +typedef struct BluetoothHCIEventLinkKeyNotificationResults BluetoothHCIEventLinkKeyNotificationResults; +struct BluetoothHCIEventLinkKeyNotificationResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothKey linkKey; + BluetoothKeyType keyType; +}; + +typedef struct BluetoothHCIEventMaxSlotsChangeResults BluetoothHCIEventMaxSlotsChangeResults; +struct BluetoothHCIEventMaxSlotsChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothMaxSlots maxSlots; +}; + +typedef struct BluetoothHCIEventModeChangeResults BluetoothHCIEventModeChangeResults; +struct BluetoothHCIEventModeChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIConnectionMode mode; + BluetoothHCIModeInterval modeInterval; +}; + +typedef struct BluetoothHCIEventReturnLinkKeysResults BluetoothHCIEventReturnLinkKeysResults; +struct BluetoothHCIEventReturnLinkKeysResults +{ + UInt8 numLinkKeys; + struct { + BluetoothDeviceAddress deviceAddress; + BluetoothKey linkKey; + } linkKeys[1]; +}; + +typedef struct BluetoothHCIEventAuthenticationCompleteResults BluetoothHCIEventAuthenticationCompleteResults; +struct BluetoothHCIEventAuthenticationCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventEncryptionChangeResults BluetoothHCIEventEncryptionChangeResults; +struct BluetoothHCIEventEncryptionChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothEncryptionEnable enable; +}; + +typedef struct BluetoothHCIEventChangeConnectionLinkKeyCompleteResults BluetoothHCIEventChangeConnectionLinkKeyCompleteResults; +struct BluetoothHCIEventChangeConnectionLinkKeyCompleteResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventMasterLinkKeyCompleteResults BluetoothHCIEventMasterLinkKeyCompleteResults; +struct BluetoothHCIEventMasterLinkKeyCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothKeyFlag keyFlag; +}; + +typedef struct BluetoothHCIEventQoSSetupCompleteResults BluetoothHCIEventQoSSetupCompleteResults; +struct BluetoothHCIEventQoSSetupCompleteResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothHCIQualityOfServiceSetupParams setupParams; +}; + +typedef struct BluetoothHCIEventHardwareErrorResults BluetoothHCIEventHardwareErrorResults; +struct BluetoothHCIEventHardwareErrorResults +{ + BluetoothHCIStatus error; +}; + +typedef struct BluetoothHCIEventFlushOccurredResults BluetoothHCIEventFlushOccurredResults; +struct BluetoothHCIEventFlushOccurredResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventRoleChangeResults BluetoothHCIEventRoleChangeResults; +struct BluetoothHCIEventRoleChangeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothDeviceAddress deviceAddress; + BluetoothRole role; +}; + +typedef struct BluetoothHCIEventDataBufferOverflowResults BluetoothHCIEventDataBufferOverflowResults; +struct BluetoothHCIEventDataBufferOverflowResults +{ + BluetoothLinkType linkType; +}; + +typedef struct BluetoothHCIEventConnectionPacketTypeResults BluetoothHCIEventConnectionPacketTypeResults; +struct BluetoothHCIEventConnectionPacketTypeResults +{ + BluetoothConnectionHandle connectionHandle; + BluetoothPacketType packetType; +}; + +typedef struct BluetoothHCIEventReadRemoteSupportedFeaturesResults BluetoothHCIEventReadRemoteSupportedFeaturesResults; +struct BluetoothHCIEventReadRemoteSupportedFeaturesResults +{ + BluetoothHCIStatus error; + BluetoothConnectionHandle connectionHandle; + BluetoothHCISupportedFeatures lmpFeatures; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 +typedef struct BluetoothHCIEventReadRemoteExtendedFeaturesResults BluetoothHCIEventReadRemoteExtendedFeaturesResults; +struct BluetoothHCIEventReadRemoteExtendedFeaturesResults +{ + BluetoothHCIStatus error; + BluetoothConnectionHandle connectionHandle; + BluetoothHCIPageNumber page; + BluetoothHCIPageNumber maxPage; + BluetoothHCISupportedFeatures lmpFeatures; +}; +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 */ + +typedef struct BluetoothHCIEventQoSViolationResults BluetoothHCIEventQoSViolationResults; +struct BluetoothHCIEventQoSViolationResults +{ + BluetoothConnectionHandle connectionHandle; +}; + +typedef struct BluetoothHCIEventPageScanModeChangeResults BluetoothHCIEventPageScanModeChangeResults; +struct BluetoothHCIEventPageScanModeChangeResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanMode pageScanMode; +}; + +typedef struct BluetoothHCIEventPageScanRepetitionModeChangeResults BluetoothHCIEventPageScanRepetitionModeChangeResults; +struct BluetoothHCIEventPageScanRepetitionModeChangeResults +{ + BluetoothDeviceAddress deviceAddress; + BluetoothPageScanRepetitionMode pageScanRepetitionMode; +}; + +typedef struct BluetoothHCIEventVendorSpecificResults BluetoothHCIEventVendorSpecificResults; +struct BluetoothHCIEventVendorSpecificResults +{ + UInt8 length; + UInt8 data[255]; +}; + +#define kNoNotifyProc NULL +#define kNoUserRefCon NULL + +typedef struct BluetoothHCIRequestCallbackInfo BluetoothHCIRequestCallbackInfo; +struct BluetoothHCIRequestCallbackInfo +{ + mach_vm_address_t userCallback; // Proc to call when async handler is called. + mach_vm_address_t userRefCon; // For user's info. + mach_vm_address_t internalRefCon; // For our purposes. + mach_vm_address_t asyncIDRefCon; // For our aync calls. + mach_vm_address_t reserved; // For the future. Currently Unused. +}; + +// Error codes + +enum +{ + kBluetoothHCIErrorSuccess = 0x00, + kBluetoothHCIErrorUnknownHCICommand = 0x01, + kBluetoothHCIErrorNoConnection = 0x02, + kBluetoothHCIErrorHardwareFailure = 0x03, + kBluetoothHCIErrorPageTimeout = 0x04, + kBluetoothHCIErrorAuthenticationFailure = 0x05, + kBluetoothHCIErrorKeyMissing = 0x06, + kBluetoothHCIErrorMemoryFull = 0x07, + kBluetoothHCIErrorConnectionTimeout = 0x08, + kBluetoothHCIErrorMaxNumberOfConnections = 0x09, + kBluetoothHCIErrorMaxNumberOfSCOConnectionsToADevice = 0x0A, + kBluetoothHCIErrorACLConnectionAlreadyExists = 0x0B, + kBluetoothHCIErrorCommandDisallowed = 0x0C, + kBluetoothHCIErrorHostRejectedLimitedResources = 0x0D, + kBluetoothHCIErrorHostRejectedSecurityReasons = 0x0E, + kBluetoothHCIErrorHostRejectedRemoteDeviceIsPersonal = 0x0F, + kBluetoothHCIErrorHostTimeout = 0x10, + kBluetoothHCIErrorUnsupportedFeatureOrParameterValue = 0x11, + kBluetoothHCIErrorInvalidHCICommandParameters = 0x12, + kBluetoothHCIErrorOtherEndTerminatedConnectionUserEnded = 0x13, + kBluetoothHCIErrorOtherEndTerminatedConnectionLowResources = 0x14, + kBluetoothHCIErrorOtherEndTerminatedConnectionAboutToPowerOff = 0x15, + kBluetoothHCIErrorConnectionTerminatedByLocalHost = 0x16, + kBluetoothHCIErrorRepeatedAttempts = 0x17, + kBluetoothHCIErrorPairingNotAllowed = 0x18, + kBluetoothHCIErrorUnknownLMPPDU = 0x19, + kBluetoothHCIErrorUnsupportedRemoteFeature = 0x1A, + kBluetoothHCIErrorSCOOffsetRejected = 0x1B, + kBluetoothHCIErrorSCOIntervalRejected = 0x1C, + kBluetoothHCIErrorSCOAirModeRejected = 0x1D, + kBluetoothHCIErrorInvalidLMPParameters = 0x1E, + kBluetoothHCIErrorUnspecifiedError = 0x1F, + kBluetoothHCIErrorUnsupportedLMPParameterValue = 0x20, + kBluetoothHCIErrorRoleChangeNotAllowed = 0x21, + kBluetoothHCIErrorLMPResponseTimeout = 0x22, + kBluetoothHCIErrorLMPErrorTransactionCollision = 0x23, + kBluetoothHCIErrorLMPPDUNotAllowed = 0x24, + kBluetoothHCIErrorEncryptionModeNotAcceptable = 0x25, // Added Core Spec, v1.1 + kBluetoothHCIErrorUnitKeyUsed = 0x26, // 1.1 + kBluetoothHCIErrorQoSNotSupported = 0x27, // 1.1 + kBluetoothHCIErrorInstantPassed = 0x28, // 1.1 + kBluetoothHCIErrorPairingWithUnitKeyNotSupported = 0x29, // 1.1 + kBluetoothHCIErrorHostRejectedUnacceptableDeviceAddress = 0x0F, // 2.0+ + kBluetoothHCIErrorDifferentTransactionCollision = 0x2A, // 1.2 + kBluetoothHCIErrorQoSUnacceptableParameter = 0x2C, // 1.2 + kBluetoothHCIErrorQoSRejected = 0x2D, // 1.2 + kBluetoothHCIErrorChannelClassificationNotSupported = 0x2E, // 1.2 + kBluetoothHCIErrorInsufficientSecurity = 0x2F, // 1.2 + kBluetoothHCIErrorParameterOutOfMandatoryRange = 0x30, // 1.2 + kBluetoothHCIErrorRoleSwitchPending = 0x31, // 1.2 + kBluetoothHCIErrorReservedSlotViolation = 0x34, // 1.2 + kBluetoothHCIErrorRoleSwitchFailed = 0x35, // 1.2 + kBluetoothHCIErrorExtendedInquiryResponseTooLarge = 0x36, // 2.1 + kBluetoothHCIErrorSecureSimplePairingNotSupportedByHost = 0x37, // 2.1 + + kBluetoothHCIErrorMax = 0x37 +}; + +#if 0 +#pragma mark === HCI Power Mode === +#endif + +//=========================================================================================================================== +// HCI Power Mode +//=========================================================================================================================== + +typedef enum +{ + kBluetoothHCIPowerStateON = 0x01, + kBluetoothHCIPowerStateOFF = 0x00, + kBluetoothHCIPowerStateUnintialized = 0xFF, +} BluetoothHCIPowerState; + +enum +{ + kBluetoothHCIErrorPowerIsOFF = (kBluetoothHCIErrorMax + 1) +}; + +#if 0 +#pragma mark === HCI USB Transport === +#endif + +//=========================================================================================================================== +// HCI USB Transport +//=========================================================================================================================== + +//--------------------------------------------------------------------------------------------------------------------------- +/*! @enum BluetoothHCIUSBDeviceMatchingConstants + @abstract Bluetooth USB device matching constants + @constant kBluetoothHCITransportUSBClassCode Wireless Controller + @constant kBluetoothHCITransportUSBSubClassCode RF Controller + @constant kBluetoothHCITransportUSBProtocolCode Bluetooth Programming +*/ + +enum +{ + kBluetoothHCITransportUSBClassCode = 0xE0, + kBluetoothHCITransportUSBSubClassCode = 0x01, + kBluetoothHCITransportUSBProtocolCode = 0x01 +}; + +#if 0 +#pragma mark === TCI - L2CAP === +#endif + +//=========================================================================================================================== +// TCI - L2CAP +//=========================================================================================================================== + +enum +{ + kBluetoothL2CAPTCIEventIDReserved = 0x00, + kBluetoothL2CAPTCIEventIDL2CA_ConnectInd = 0x01, + kBluetoothL2CAPTCIEventIDL2CA_ConfigInd = 0x02, + kBluetoothL2CAPTCIEventIDL2CA_DisconnectInd = 0x03, + kBluetoothL2CAPTCIEventIDL2CA_QoSViolationInd = 0x04, + kBluetoothL2CAPTCIEventIDL2CA_TimeOutInd = 0x05 +}; + +enum +{ + kBluetoothL2CAPTCICommandReserved = 0x0000, + kBluetoothL2CAPTCICommandL2CA_ConnectReq = 0x0001, + kBluetoothL2CAPTCICommandL2CA_DisconnectReq = 0x0002, + kBluetoothL2CAPTCICommandL2CA_ConfigReq = 0x0003, + kBluetoothL2CAPTCICommandL2CA_DisableCLT = 0x0004, + kBluetoothL2CAPTCICommandL2CA_EnableCLT = 0x0005, + kBluetoothL2CAPTCICommandL2CA_GroupCreate = 0x0006, + kBluetoothL2CAPTCICommandL2CA_GroupClose = 0x0007, + kBluetoothL2CAPTCICommandL2CA_GroupAddMember = 0x0008, + kBluetoothL2CAPTCICommandL2CA_GroupRemoveMember = 0x0009, + kBluetoothL2CAPTCICommandL2CA_GroupMembership = 0x000A, + kBluetoothL2CAPTCICommandL2CA_WriteData = 0x000B, + kBluetoothL2CAPTCICommandL2CA_ReadData = 0x000C, + kBluetoothL2CAPTCICommandL2CA_Ping = 0x000D, + kBluetoothL2CAPTCICommandL2CA_GetInfo = 0x000E, + kBluetoothL2CAPTCICommandL2CA_Reserved1 = 0x000F, + kBluetoothL2CAPTCICommandL2CA_Reserved2 = 0x0010, + kBluetoothL2CAPTCICommandL2CA_ConnectResp = 0x0011, + kBluetoothL2CAPTCICommandL2CA_DisconnectResp = 0x0012, + kBluetoothL2CAPTCICommandL2CA_ConfigResp = 0x0013 +}; + +#if 0 +#pragma mark - +#pragma mark === RFCOMM === +#endif + +//=========================================================================================================================== +// RFCOMM +//=========================================================================================================================== +#define kMaxChannelIDPerSide 31 + +typedef UInt8 BluetoothRFCOMMChannelID; + +#define RFCOMM_CHANNEL_ID_IS_VALID( CHANNEL ) (( CHANNEL >= 1 ) && ( CHANNEL <= 30 )) + +typedef UInt16 BluetoothRFCOMMMTU; + +typedef enum BluetoothRFCOMMParityType +{ + kBluetoothRFCOMMParityTypeNoParity = 0, + kBluetoothRFCOMMParityTypeOddParity, + kBluetoothRFCOMMParityTypeEvenParity, + kBluetoothRFCOMMParityTypeMaxParity +} BluetoothRFCOMMParityType; + +typedef enum BluetoothRFCOMMLineStatus +{ + BluetoothRFCOMMLineStatusNoError = 0, + BluetoothRFCOMMLineStatusOverrunError, + BluetoothRFCOMMLineStatusParityError, + BluetoothRFCOMMLineStatusFramingError +} BluetoothRFCOMMLineStatus; + +#if 0 +#pragma mark - +#pragma mark === SDP === +#endif + +//=========================================================================================================================== +// SDP +//=========================================================================================================================== + +typedef UInt8 BluetoothSDPPDUID; +enum { + kBluetoothSDPPDUIDReserved = 0, + kBluetoothSDPPDUIDErrorResponse = 1, + kBluetoothSDPPDUIDServiceSearchRequest = 2, + kBluetoothSDPPDUIDServiceSearchResponse = 3, + kBluetoothSDPPDUIDServiceAttributeRequest = 4, + kBluetoothSDPPDUIDServiceAttributeResponse = 5, + kBluetoothSDPPDUIDServiceSearchAttributeRequest = 6, + kBluetoothSDPPDUIDServiceSearchAttributeResponse = 7 +}; + +#define IS_REQUEST_PDU( _pduID ) ( ( _pduID == kBluetoothSDPPDUIDServiceSearchRequest ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceAttributeRequest ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceSearchAttributeRequest ) ) + +#define IS_RESPONSE_PDU( _pduID ) ( ( _pduID == kBluetoothSDPPDUIDErrorResponse ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceSearchResponse ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceAttributeResponse ) || \ + ( _pduID == kBluetoothSDPPDUIDServiceSearchAttributeResponse ) ) + +typedef UInt16 BluetoothSDPErrorCode; +enum { + kBluetoothSDPErrorCodeSuccess = 0x0000, + kBluetoothSDPErrorCodeReserved = 0x0000, + kBluetoothSDPErrorCodeInvalidSDPVersion = 0x0001, + kBluetoothSDPErrorCodeInvalidServiceRecordHandle = 0x0002, + kBluetoothSDPErrorCodeInvalidRequestSyntax = 0x0003, + kBluetoothSDPErrorCodeInvalidPDUSize = 0x0004, + kBluetoothSDPErrorCodeInvalidContinuationState = 0x0005, + kBluetoothSDPErrorCodeInsufficientResources = 0x0006, + + kBluetoothSDPErrorCodeReservedStart = 0x0007, + kBluetoothSDPErrorCodeReservedEnd = 0xFFFF +}; + +typedef UInt16 BluetoothSDPTransactionID; + +typedef UInt32 BluetoothSDPServiceRecordHandle; + +enum { + kBluetoothSDPDataElementTypeNil = 0, + kBluetoothSDPDataElementTypeUnsignedInt = 1, + kBluetoothSDPDataElementTypeSignedInt = 2, + kBluetoothSDPDataElementTypeUUID = 3, + kBluetoothSDPDataElementTypeString = 4, + kBluetoothSDPDataElementTypeBoolean = 5, + kBluetoothSDPDataElementTypeDataElementSequence = 6, + kBluetoothSDPDataElementTypeDataElementAlternative = 7, + kBluetoothSDPDataElementTypeURL = 8, + kBluetoothSDPDataElementTypeReservedStart = 9, + kBluetoothSDPDataElementTypeReservedEnd = 31 +}; + +typedef UInt16 BluetoothSDPUUID16; +typedef UInt32 BluetoothSDPUUID32; + +typedef UInt8 BluetoothSDPDataElementTypeDescriptor; +typedef UInt8 BluetoothSDPDataElementSizeDescriptor; + +typedef UInt16 BluetoothSDPServiceAttributeID; + +#ifdef __cplusplus + } +#endif diff --git a/i386/include/IOKit/bluetooth/BluetoothAssignedNumbers.h b/i386/include/IOKit/bluetooth/BluetoothAssignedNumbers.h new file mode 100644 index 0000000..ea5db2e --- /dev/null +++ b/i386/include/IOKit/bluetooth/BluetoothAssignedNumbers.h @@ -0,0 +1,552 @@ +/* + File: BluetoothAssignedNumbers.h + Copyright: (c) 2002-2008 by Apple Computer, Inc. All rights reserved. +*/ + +#pragma once + +#ifdef __cplusplus + extern "C" { +#endif + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +#pragma mark - +#pragma mark === General === + +enum BluetoothCompanyIdentifers +{ + kBluetoothCompanyIdentiferEricssonTechnologyLicensing = 0, + kBluetoothCompanyIdentiferNokiaMobilePhones = 1, + kBluetoothCompanyIdentiferIntel = 2, + kBluetoothCompanyIdentiferIBM = 3, + kBluetoothCompanyIdentiferToshiba = 4, + kBluetoothCompanyIdentifer3Com = 5, + kBluetoothCompanyIdentiferMicrosoft = 6, + kBluetoothCompanyIdentiferLucent = 7, + kBluetoothCompanyIdentiferMotorola = 8, + kBluetoothCompanyIdentiferInfineonTechnologiesAG = 9, + kBluetoothCompanyIdentiferCambridgeSiliconRadio = 10, + kBluetoothCompanyIdentiferSiliconWave = 11, + kBluetoothCompanyIdentiferDigianswerAS = 12, + kBluetoothCompanyIdentiferTexasInstruments = 13, + kBluetoothCompanyIdentiferParthusTechnologies = 14, + kBluetoothCompanyIdentiferBroadcom = 15, + kBluetoothCompanyIdentiferMitelSemiconductor = 16, + kBluetoothCompanyIdentiferWidcomm = 17, + kBluetoothCompanyIdentiferZeevo = 18, + kBluetoothCompanyIdentiferAtmel = 19, + kBluetoothCompanyIdentiferMistubishiElectric = 20, + kBluetoothCompanyIdentiferRTXTelecom = 21, + kBluetoothCompanyIdentiferKCTechnology = 22, + kBluetoothCompanyIdentiferNewlogic = 23, + kBluetoothCompanyIdentiferTransilica = 24, + kBluetoothCompanyIdentiferRohdeandSchwarz = 25, + kBluetoothCompanyIdentiferTTPCom = 26, + kBluetoothCompanyIdentiferSigniaTechnologies = 27, + kBluetoothCompanyIdentiferConexantSystems = 28, + kBluetoothCompanyIdentiferQualcomm = 29, + kBluetoothCompanyIdentiferInventel = 30, + kBluetoothCompanyIdentiferAVMBerlin = 31, + kBluetoothCompanyIdentiferBandspeed = 32, + kBluetoothCompanyIdentiferMansella = 33, + kBluetoothCompanyIdentiferNEC = 34, + kBluetoothCompanyIdentiferWavePlusTechnology = 35, + kBluetoothCompanyIdentiferAlcatel = 36, + kBluetoothCompanyIdentiferPhilipsSemiconductor = 37, + kBluetoothCompanyIdentiferCTechnologies = 38, + kBluetoothCompanyIdentiferOpenInterface = 39, + kBluetoothCompanyIdentiferRFCMicroDevices = 40, + kBluetoothCompanyIdentiferHitachi = 41, + kBluetoothCompanyIdentiferSymbolTechnologies = 42, + kBluetoothCompanyIdentiferTenovis = 43, + kBluetoothCompanyIdentiferMacronixInternational = 44, + kBluetoothCompanyIdentiferGCTSemiconductor = 45, + kBluetoothCompanyIdentiferNorwoodSystems = 46, + kBluetoothCompanyIdentiferMewTelTechnology = 47, + kBluetoothCompanyIdentiferSTMicroelectronics = 48, + kBluetoothCompanyIdentiferSynopsys = 49, + kBluetoothCompanyIdentiferRedMCommunications = 50, + kBluetoothCompanyIdentiferCommil = 51, + kBluetoothCompanyIdentiferCATC = 52, + kBluetoothCompanyIdentiferEclipse = 53, + kBluetoothCompanyIdentiferRenesasTechnology = 54, + kBluetoothCompanyIdentiferMobilian = 55, + kBluetoothCompanyIdentiferTerax = 56, + kBluetoothCompanyIdentiferIntegratedSystemSolution = 57, + kBluetoothCompanyIdentiferMatsushitaElectricIndustrial = 58, + kBluetoothCompanyIdentiferGennum = 59, + kBluetoothCompanyIdentiferResearchInMotion = 60, + kBluetoothCompanyIdentiferIPextreme = 61, + kBluetoothCompanyIdentiferSystemsAndChips = 62, + kBluetoothCompanyIdentiferBluetoothSIG = 63, + kBluetoothCompanyIdentiferSeikoEpson = 64, + kBluetoothCompanyIdentiferIntegratedSiliconSolution = 65, + kBluetoothCompanyIdentiferCONWISETechnology = 66, + kBluetoothCompanyIdentiferParrotSA = 67, + kBluetoothCompanyIdentiferSocketCommunications = 68, + kBluetoothCompanyIdentiferAtherosCommunications = 69, + kBluetoothCompanyIdentiferMediaTek = 70, + kBluetoothCompanyIdentiferBluegiga = 71, + kBluetoothCompanyIdentiferMarvellTechnologyGroup = 72, + kBluetoothCompanyIdentifer3DSP = 73, + kBluetoothCompanyIdentiferAccelSemiconductor = 74, + kBluetoothCompanyIdentiferContinentialAutomotiveSystems = 75, + kBluetoothCompanyIdentiferApple = 76, + kBluetoothCompanyIdentiferStaccatoCommunications = 77, + kBluetoothCompanyIdentiferAvagoTechnologies = 78, + kBluetoothCompanyIdentiferAPT = 79, + + kBluetoothCompanyIdentiferInteropIdentifier = 65535 +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + +#pragma mark - +#pragma mark === Baseband === + +//================================================================================================================== +// Baseband +//================================================================================================================== + +// +// Service Class Major +// + +enum +{ + kBluetoothServiceClassMajorLimitedDiscoverableMode = 0x001, // Bit 13 - Limited Discoverable Mode + kBluetoothServiceClassMajorReserved1 = 0x002, // Bit 14 - Reserved for future use. + kBluetoothServiceClassMajorReserved2 = 0x004, // Bit 15 - Reserved for future use. + kBluetoothServiceClassMajorPositioning = 0x008, // Bit 16 - Positioning (Location ID) + kBluetoothServiceClassMajorNetworking = 0x010, // Bit 17 - LAN, Ad hoc, etc... + kBluetoothServiceClassMajorRendering = 0x020, // Bit 18 - Printing, Speaker, etc... + kBluetoothServiceClassMajorCapturing = 0x040, // Bit 19 - Scanner, Microphone, etc... + kBluetoothServiceClassMajorObjectTransfer = 0x080, // Bit 20 - v-Inbox, v-Folder, etc... + kBluetoothServiceClassMajorAudio = 0x100, // Bit 21 - Speaker, Microphone, Headset, etc... + kBluetoothServiceClassMajorTelephony = 0x200, // Bit 22 - Cordless telephony, Modem, Headset, etc... + kBluetoothServiceClassMajorInformation = 0x400, // Bit 23 - Web server, WAP server, etc... + + kBluetoothServiceClassMajorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothServiceClassMajorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothServiceClassMajorEnd +}; + +// +// Device Class Major +// + +enum +{ + kBluetoothDeviceClassMajorMiscellaneous = 0x00, // [00000] Miscellaneous + kBluetoothDeviceClassMajorComputer = 0x01, // [00001] Desktop, Notebook, PDA, Organizers, etc... + kBluetoothDeviceClassMajorPhone = 0x02, // [00010] Cellular, Cordless, Payphone, Modem, etc... + kBluetoothDeviceClassMajorLANAccessPoint = 0x03, // [00011] LAN Access Point + kBluetoothDeviceClassMajorAudio = 0x04, // [00100] Headset, Speaker, Stereo, etc... + kBluetoothDeviceClassMajorPeripheral = 0x05, // [00101] Mouse, Joystick, Keyboards, etc... + kBluetoothDeviceClassMajorImaging = 0x06, // [00110] Printing, scanner, camera, display, etc... + kBluetoothDeviceClassMajorUnclassified = 0x1F, // [11111] Specific device code not assigned + + // Range 0x06 to 0x1E Reserved for future use. + + kBluetoothDeviceClassMajorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothDeviceClassMajorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothDeviceClassMajorEnd +}; + +// +// Device Class Minor +// + +enum +{ + /// + /// Computer Major Class + /// + + kBluetoothDeviceClassMinorComputerUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorComputerDesktopWorkstation = 0x01, // [000001] Desktop workstation + kBluetoothDeviceClassMinorComputerServer = 0x02, // [000010] Server-class computer + kBluetoothDeviceClassMinorComputerLaptop = 0x03, // [000011] Laptop + kBluetoothDeviceClassMinorComputerHandheld = 0x04, // [000100] Handheld PC/PDA (clam shell) + kBluetoothDeviceClassMinorComputerPalmSized = 0x05, // [000101] Palm-sized PC/PDA + kBluetoothDeviceClassMinorComputerWearable = 0x06, // [000110] Wearable computer (watch sized) + + // Range 0x06 to 0x7F Reserved for future use. + + + /// + /// Phone Major Class + /// + + kBluetoothDeviceClassMinorPhoneUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorPhoneCellular = 0x01, // [000001] Cellular + kBluetoothDeviceClassMinorPhoneCordless = 0x02, // [000010] Cordless + kBluetoothDeviceClassMinorPhoneSmartPhone = 0x03, // [000011] Smart phone + kBluetoothDeviceClassMinorPhoneWiredModemOrVoiceGateway = 0x04, // [000100] Wired modem or voice gateway + kBluetoothDeviceClassMinorPhoneCommonISDNAccess = 0x05, // [000101] Common ISDN Access + + // Range 0x05 to 0x7F Reserved for future use. + + + /// + /// LAN Access Point Major Class + /// + + // $$$ TO DO: LAN Access Point minor classes are broken into bits 5-7 for utilization and bits 2-4 for class. + + + /// + /// Audio Major Class + /// + + kBluetoothDeviceClassMinorAudioUnclassified = 0x00, // [000000] Specific device code not assigned + kBluetoothDeviceClassMinorAudioHeadset = 0x01, // [000001] Device conforms to the Headset profile + kBluetoothDeviceClassMinorAudioHandsFree = 0x02, // [000010] Hands-free + kBluetoothDeviceClassMinorAudioReserved1 = 0x03, // [000011] Reserved + kBluetoothDeviceClassMinorAudioMicrophone = 0x04, // [000100] Microphone + kBluetoothDeviceClassMinorAudioLoudspeaker = 0x05, // [000101] Loudspeaker + kBluetoothDeviceClassMinorAudioHeadphones = 0x06, // [000110] Headphones + kBluetoothDeviceClassMinorAudioPortable = 0x07, // [000111] Portable Audio + kBluetoothDeviceClassMinorAudioCar = 0x08, // [001000] Car Audio + kBluetoothDeviceClassMinorAudioSetTopBox = 0x09, // [001001] Set-top box + kBluetoothDeviceClassMinorAudioHiFi = 0x0a, // [001010] HiFi Audio Device + kBluetoothDeviceClassMinorAudioVCR = 0x0b, // [001011] VCR + kBluetoothDeviceClassMinorAudioVideoCamera = 0x0c, // [001100] Video Camera + kBluetoothDeviceClassMinorAudioCamcorder = 0x0d, // [001101] Camcorder + kBluetoothDeviceClassMinorAudioVideoMonitor = 0x0e, // [001110] Video Monitor + kBluetoothDeviceClassMinorAudioVideoDisplayAndLoudspeaker = 0x0f, // [001111] Video Display and Loudspeaker + kBluetoothDeviceClassMinorAudioVideoConferencing = 0x10, // [010000] Video Conferencing + kBluetoothDeviceClassMinorAudioReserved2 = 0x11, // [010001] Reserved + kBluetoothDeviceClassMinorAudioGamingToy = 0x12, // [010010] Gaming/Toy + + + // Range 0x13 to 0x7F Reserved for future use. + + + /// + /// Peripheral Major Class + /// + + // Peripheral1 subclass is bits 7 & 6 + + kBluetoothDeviceClassMinorPeripheral1Keyboard = 0x10, // [01XXXX] Keyboard + kBluetoothDeviceClassMinorPeripheral1Pointing = 0x20, // [10XXXX] Pointing device + kBluetoothDeviceClassMinorPeripheral1Combo = 0x30, // [11XXXX] Combo keyboard/pointing device + + // Peripheral2 subclass is bits 5-2 + + kBluetoothDeviceClassMinorPeripheral2Unclassified = 0x00, // [XX0000] Uncategorized device + kBluetoothDeviceClassMinorPeripheral2Joystick = 0x01, // [XX0001] Joystick + kBluetoothDeviceClassMinorPeripheral2Gamepad = 0x02, // [XX0010] Gamepad + kBluetoothDeviceClassMinorPeripheral2RemoteControl = 0x03, // [XX0011] Remote control + kBluetoothDeviceClassMinorPeripheral2SensingDevice = 0x04, // [XX0100] Sensing device + kBluetoothDeviceClassMinorPeripheral2DigitizerTablet = 0x05, // [XX0101] Digitizer Tablet + kBluetoothDeviceClassMinorPeripheral2CardReader = 0x06, // [XX0110] Card Reader + + kBluetoothDeviceClassMinorPeripheral2AnyPointing = 'poin', // Anything under MinorPeripheral1Pointing + + // Range 0x05 to 0x0f reserved for future use + + + /// + /// Imaging Major Class + /// + + // Imaging1 subclass is bits 7 - 4 + + kBluetoothDeviceClassMinorImaging1Display = 0x04, // [XXX1XX] Display + kBluetoothDeviceClassMinorImaging1Camera = 0x08, // [XX1XXX] Camera + kBluetoothDeviceClassMinorImaging1Scanner = 0x10, // [X1XXXX] Scanner + kBluetoothDeviceClassMinorImaging1Printer = 0x20, // [1XXXXX] Printer + + // Imaging2 subclass is bits 3 - 2 + + kBluetoothDeviceClassMinorImaging2Unclassified = 0x00, // [XXXX00] Uncategorized, default + + // Range 0x01 - 0x03 reserved for future use + + + /// + /// Misc + /// + + kBluetoothDeviceClassMinorAny = '****', // Pseudo-class - means anything acceptable. + kBluetoothDeviceClassMinorNone = 'none', // Pseudo-class - means no matching. + + kBluetoothDeviceClassMinorEnd +}; + + +// Peripheral devices bits 7 & 6 +#define BluetoothCoDMinorPeripheral1(minorClass) (minorClass & 0x30) + +// Peripheral devices bits 5 - 2 +#define BluetoothCoDMinorPeripheral2(minorClass) (minorClass & 0x0f) + +#pragma mark - +#pragma mark === L2CAP === + +//=========================================================================================================================== +// L2CAP +//=========================================================================================================================== + +enum +{ + kBluetoothL2CAPPSMSDP = 0x0001, + kBluetoothL2CAPPSMRFCOMM = 0x0003, + kBluetoothL2CAPPSMTCS_BIN = 0x0005, // Telephony Control Specifictation / TCS Binary + kBluetoothL2CAPPSMTCS_BIN_Cordless = 0x0007, // Telephony Control Specifictation / TCS Binary + kBluetoothL2CAPPSMBNEP = 0x000F, // Bluetooth Network Encapsulation Protocol + kBluetoothL2CAPPSMHIDControl = 0x0011, // HID profile - control interface + kBluetoothL2CAPPSMHIDInterrupt = 0x0013, // HID profile - interrupt interface + kBluetoothL2CAPPSMAVCTP = 0x0017, // Audio/Video Control Transport Protocol + kBluetoothL2CAPPSMAVDTP = 0x0019, // Audio/Video Distribution Transport Protocol + kBluetoothL2CAPPSMUID_C_Plane = 0x001D, // Unrestricted Digital Information Profile (UDI) + + // Range < 0x1000 reserved. + kBluetoothL2CAPPSMReservedStart = 0x0001, + kBluetoothL2CAPPSMReservedEnd = 0x1000, + + // Range 0x1001-0xFFFF dynamically assigned. + kBluetoothL2CAPPSMDynamicStart = 0x1001, + kBluetoothL2CAPPSMD2D = 0x100F, + kBluetoothL2CAPPSMDynamicEnd = 0xFFFF, + + kBluetoothL2CAPPSMNone = 0x0000 +}; + + +#pragma mark - +#pragma mark === SDP === + +//=========================================================================================================================== +// Service Discovery Protocol +//=========================================================================================================================== + +enum +{ + // General + + kBluetoothSDPUUID16Base = 0x0000, // 00000000-0000-1000-8000-00805f9b34fb + + // Protocols + + kBluetoothSDPUUID16SDP = 0x0001, // 00000001-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16UDP = 0x0002, // 00000002-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16RFCOMM = 0x0003, // 00000003-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCP = 0x0004, // 00000004-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCSBIN = 0x0005, // 00000005-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16TCSAT = 0x0006, // 00000006-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16OBEX = 0x0008, // 00000008-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16IP = 0x0009, // 00000009-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16FTP = 0x000A, // 0000000A-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16HTTP = 0x000C, // 0000000C-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16WSP = 0x000E, // 0000000E-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16BNEP = 0x000F, + kBluetoothSDPUUID16UPNP = 0x0010, + kBluetoothSDPUUID16HIDP = 0x0011, + kBluetoothSDPUUID16HardcopyControlChannel = 0x0012, + kBluetoothSDPUUID16HardcopyDataChannel = 0x0014, + kBluetoothSDPUUID16HardcopyNotification = 0x0016, + kBluetoothSDPUUID16AVCTP = 0x0017, + kBluetoothSDPUUID16AVDTP = 0x0019, + kBluetoothSDPUUID16CMPT = 0x001B, + kBluetoothSDPUUID16UDI_C_Plane = 0x001D, + kBluetoothSDPUUID16L2CAP = 0x0100, // 00000100-0000-1000-8000-00805f9b34fb +}; + +enum SDPServiceClasses +{ + kBluetoothSDPUUID16ServiceClassServiceDiscoveryServer = 0x1000, // 00001000-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassBrowseGroupDescriptor = 0x1001, // 00001001-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassPublicBrowseGroup = 0x1002, // 00001002-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassSerialPort = 0x1101, // 00001101-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassLANAccessUsingPPP = 0x1102, // 00001102-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassDialupNetworking = 0x1103, // 00001103-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassIrMCSync = 0x1104, // 00001104-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassOBEXObjectPush = 0x1105, // 00001105-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassOBEXFileTransfer = 0x1106, // 00001106-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassIrMCSyncCommand = 0x1107, // 00001107-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassHeadset = 0x1108, // 00001108-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassCordlessTelephony = 0x1109, // 00001109-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassAudioSource = 0x110A, + kBluetoothSDPUUID16ServiceClassAudioSink = 0x110B, + kBluetoothSDPUUID16ServiceClassAVRemoteControlTarget = 0x110C, + kBluetoothSDPUUID16ServiceClassAdvancedAudioDistribution = 0x110D, + kBluetoothSDPUUID16ServiceClassAVRemoteControl = 0x110E, + kBluetoothSDPUUID16ServiceClassVideoConferencing = 0x110F, + kBluetoothSDPUUID16ServiceClassIntercom = 0x1110, // 00001110-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassFax = 0x1111, // 00001111-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassHeadsetAudioGateway = 0x1112, // 00001112-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassWAP = 0x1113, + kBluetoothSDPUUID16ServiceClassWAPClient = 0x1114, + kBluetoothSDPUUID16ServiceClassPANU = 0x1115, + kBluetoothSDPUUID16ServiceClassNAP = 0x1116, + kBluetoothSDPUUID16ServiceClassGN = 0x1117, + kBluetoothSDPUUID16ServiceClassDirectPrinting = 0x1118, + kBluetoothSDPUUID16ServiceClassReferencePrinting = 0x1119, + kBluetoothSDPUUID16ServiceClassImaging = 0x111A, + kBluetoothSDPUUID16ServiceClassImagingResponder = 0x111B, + kBluetoothSDPUUID16ServiceClassImagingAutomaticArchive = 0x111C, + kBluetoothSDPUUID16ServiceClassImagingReferencedObjects = 0x111D, + kBluetoothSDPUUID16ServiceClassHandsFree = 0x111E, + kBluetoothSDPUUID16ServiceClassHandsFreeAudioGateway = 0x111F, + kBluetoothSDPUUID16ServiceClassDirectPrintingReferenceObjectsService = 0x1120, + kBluetoothSDPUUID16ServiceClassReflectedUI = 0x1121, + kBluetoothSDPUUID16ServiceClassBasicPrinting = 0x1122, + kBluetoothSDPUUID16ServiceClassPrintingStatus = 0x1123, + kBluetoothSDPUUID16ServiceClassHumanInterfaceDeviceService = 0x1124, + kBluetoothSDPUUID16ServiceClassHardcopyCableReplacement = 0x1125, + kBluetoothSDPUUID16ServiceClassHCR_Print = 0x1126, + kBluetoothSDPUUID16ServiceClassHCR_Scan = 0x1127, + kBluetoothSDPUUID16ServiceClassCommonISDNAccess = 0x1128, + kBluetoothSDPUUID16ServiceClassVideoConferencingGW = 0x1129, + kBluetoothSDPUUID16ServiceClassUDI_MT = 0x112A, + kBluetoothSDPUUID16ServiceClassUDI_TA = 0x112B, + kBluetoothSDPUUID16ServiceClassAudioVideo = 0x112C, + kBluetoothSDPUUID16ServiceClassSIM_Access = 0x112D, + kBluetoothSDPUUID16ServiceClassPhonebookAccess_PCE = 0x112E, + kBluetoothSDPUUID16ServiceClassPhonebookAccess_PSE = 0x112F, + kBluetoothSDPUUID16ServiceClassPhonebookAccess = 0x1130, + kBluetoothSDPUUID16ServiceClassHeadset_HS = 0x1131, + kBluetoothSDPUUID16ServiceClassMessageAccessServer = 0x1132, + kBluetoothSDPUUID16ServiceClassMessageNotificationServer = 0x1133, + kBluetoothSDPUUID16ServiceClassMessageAccessProfile = 0x1134, + kBluetoothSDPUUID16ServiceClassPnPInformation = 0x1200, // 00001200-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericNetworking = 0x1201, // 00001201-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericFileTransfer = 0x1202, // 00001202-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericAudio = 0x1203, // 00001203-0000-1000-8000-00805f9b34fb + kBluetoothSDPUUID16ServiceClassGenericTelephony = 0x1204 // 00001204-0000-1000-8000-00805f9b34fb +}; + +enum SDPAttributeIdentifierCodes +{ + kBluetoothSDPAttributeIdentifierServiceRecordHandle = 0x0000, + kBluetoothSDPAttributeIdentifierServiceClassIDList = 0x0001, + kBluetoothSDPAttributeIdentifierServiceRecordState = 0x0002, + kBluetoothSDPAttributeIdentifierServiceID = 0x0003, + kBluetoothSDPAttributeIdentifierProtocolDescriptorList = 0x0004, + kBluetoothSDPAttributeIdentifierBrowseGroupList = 0x0005, + kBluetoothSDPAttributeIdentifierLanguageBaseAttributeIDList = 0x0006, + kBluetoothSDPAttributeIdentifierServiceInfoTimeToLive = 0x0007, + kBluetoothSDPAttributeIdentifierServiceAvailability = 0x0008, + kBluetoothSDPAttributeIdentifierBluetoothProfileDescriptorList = 0x0009, + kBluetoothSDPAttributeIdentifierDocumentationURL = 0x000A, + kBluetoothSDPAttributeIdentifierClientExecutableURL = 0x000B, + kBluetoothSDPAttributeIdentifierIconURL = 0x000C, + kBluetoothSDPAttributeIdentifierAdditionalProtocolsDescriptorList = 0x000D, + + // Service Discovery Server + kBluetoothSDPAttributeIdentifierVersionNumberList = 0x0200, + kBluetoothSDPAttributeIdentifierServiceDatabaseState = 0x0201, + + // Browse Group Descriptor + kBluetoothSDPAttributeIdentifierGroupID = 0x0200, + + // PAN + kBluetoothSDPAttributeIdentifierIPSubnet = 0x0200, + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_1_1 + + // HID Required Type Section Notes + kBluetoothSDPAttributeIdentifierHIDReleaseNumber = 0x0200, // O uint16 7.11.1 + kBluetoothSDPAttributeIdentifierHIDParserVersion = 0x0201, // M uint16 - + kBluetoothSDPAttributeIdentifierHIDDeviceSubclass = 0x0202, // M uint8 7.11.2 Should match the low order 8 bits of CoD unless a combo device + kBluetoothSDPAttributeIdentifierHIDCountryCode = 0x0203, // M uint8 7.11.3 + kBluetoothSDPAttributeIdentifierHIDVirtualCable = 0x0204, // M bool 7.11.4 + kBluetoothSDPAttributeIdentifierHIDReconnectInitiate = 0x0205, // M bool 7.11.5 + kBluetoothSDPAttributeIdentifierHIDDescriptorList = 0x0206, // M sequence 7.11.6 Layout is defined in Section 6.2 of the HID Specification + kBluetoothSDPAttributeIdentifierHIDLangIDBaseList = 0x0207, // M sequence 7.11.7 + kBluetoothSDPAttributeIdentifierHIDSDPDisable = 0x0208, // O bool 7.11.8 + kBluetoothSDPAttributeIdentifierHIDBatteryPower = 0x0209, // O bool 7.11.9 + kBluetoothSDPAttributeIdentifierHIDRemoteWake = 0x020A, // O bool 7.11.10 + kBluetoothSDPAttributeIdentifierHIDProfileVersion = 0x020B, // M uint16 7.11.14 + kBluetoothSDPAttributeIdentifierHIDSupervisionTimeout = 0x020C, // O uint16 7.11.12 Default to 5 seconds or longer if not defined + kBluetoothSDPAttributeIdentifierHIDNormallyConnectable = 0x020D, // O bool 7.11.13 + kBluetoothSDPAttributeIdentifierHIDBootDevice = 0x020E, // M bool 7.11.11 Only defined for mice and keyboards as of HID 1.0 + +#endif + + kBluetoothSDPAttributeIdentifierServiceVersion = 0x0300, + kBluetoothSDPAttributeIdentifierExternalNetwork = 0x0301, // Cordless telephony + kBluetoothSDPAttributeIdentifierNetwork = 0x0301, // Handsfree Profile (HFP) + kBluetoothSDPAttributeIdentifierSupportedDataStoresList = 0x0301, // Sync Profile + kBluetoothSDPAttributeIdentifierFaxClass1Support = 0x0302, // Fax Profile + kBluetoothSDPAttributeIdentifierRemoteAudioVolumeControl = 0x0302, // GAP??? + kBluetoothSDPAttributeIdentifierFaxClass2_0Support = 0x0303, + kBluetoothSDPAttributeIdentifierSupporterFormatsList = 0x0303, + kBluetoothSDPAttributeIdentifierFaxClass2Support = 0x0304, + kBluetoothSDPAttributeIdentifierAudioFeedbackSupport = 0x0305, + kBluetoothSDPAttributeIdentifierNetworkAddress = 0x0306, // WAP + kBluetoothSDPAttributeIdentifierWAPGateway = 0x0307, // WAP + kBluetoothSDPAttributeIdentifierHomepageURL = 0x0308, // WAP + kBluetoothSDPAttributeIdentifierWAPStackType = 0x0309, // WAP + kBluetoothSDPAttributeIdentifierSecurityDescription = 0x030A, // PAN + kBluetoothSDPAttributeIdentifierNetAccessType = 0x030B, // PAN + kBluetoothSDPAttributeIdentifierMaxNetAccessRate = 0x030C, // PAN + kBluetoothSDPAttributeIdentifierSupportedCapabilities = 0x0310, // Imaging + kBluetoothSDPAttributeIdentifierSupportedFeatures = 0x0311, // Imaging & HFP + kBluetoothSDPAttributeIdentifierSupportedFunctions = 0x0312, // Imaging + kBluetoothSDPAttributeIdentifierTotalImagingDataCapacity = 0x0313, // Imaging + + kBluetoothSDPAttributeIdentifierServiceName = 0x0000, /* +language base offset*/ + kBluetoothSDPAttributeIdentifierServiceDescription = 0x0001, /* +language base offset*/ + kBluetoothSDPAttributeIdentifierProviderName = 0x0002 /* +language base offset*/ +}; + +enum SDPAttributeDeviceIdentificationRecord +{ + /* Values taken from the Bluetooth Device Identification specification, 1.0 draft, 1.16.2003 */ + + kBluetoothSDPAttributeDeviceIdentifierServiceDescription = 0x0001, /* String */ + kBluetoothSDPAttributeDeviceIdentifierDocumentationURL = 0x000A, /* URL */ + kBluetoothSDPAttributeDeviceIdentifierClientExecutableURL = 0x000B, /* URL */ + kBluetoothSDPAttributeDeviceIdentifierSpecificationID = 0x0200, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierVendorID = 0x0201, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierProductID = 0x0202, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierVersion = 0x0203, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierPrimaryRecord = 0x0204, /* Boolean */ + kBluetoothSDPAttributeDeviceIdentifierVendorIDSource = 0x0205, /* 2 byte unsigned integer */ + kBluetoothSDPAttributeDeviceIdentifierReservedRangeStart = 0x0206, + kBluetoothSDPAttributeDeviceIdentifierReservedRangeEnd = 0x02FF + +}; + +enum ProtocolParameters +{ + kBluetoothSDPProtocolParameterL2CAPPSM = 1, + kBluetoothSDPProtocolParameterRFCOMMChannel = 1, + kBluetoothSDPProtocolParameterTCPPort = 1, + kBluetoothSDPProtocolParameterUDPPort = 1, + kBluetoothSDPProtocolParameterBNEPVersion = 1, + kBluetoothSDPProtocolParameterBNEPSupportedNetworkPacketTypeList = 2 +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +//Inquiries with 'Extended Inquiry Response' (v2.1 specification) + +enum BluetoothHCIExtendedInquiryResponseDataTypes +{ + kBluetoothHCIExtendedInquiryResponseDataTypeFlags = 0x01, + kBluetoothHCIExtendedInquiryResponseDataType16BitServiceClassUUIDsWithMoreAvailable = 0x02, + kBluetoothHCIExtendedInquiryResponseDataType16BitServiceClassUUIDsCompleteList = 0x03, + kBluetoothHCIExtendedInquiryResponseDataType32BitServiceClassUUIDsWithMoreAvailable = 0x04, + kBluetoothHCIExtendedInquiryResponseDataType32BitServiceClassUUIDsCompleteList = 0x05, + kBluetoothHCIExtendedInquiryResponseDataType128BitServiceClassUUIDsWithMoreAvailable = 0x06, + kBluetoothHCIExtendedInquiryResponseDataType128BitServiceClassUUIDsCompleteList = 0x07, + kBluetoothHCIExtendedInquiryResponseDataTypeShortenedLocalName = 0x08, + kBluetoothHCIExtendedInquiryResponseDataTypeCompleteLocalName = 0x09, + kBluetoothHCIExtendedInquiryResponseDataTypeDeviceID = 0x10, + kBluetoothHCIExtendedInquiryResponseDataTypeManufacturerSpecificData = 0xFF +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + + +#ifdef __cplusplus + } +#endif diff --git a/i386/include/IOKit/bluetooth/IOBluetoothHCIController.h b/i386/include/IOKit/bluetooth/IOBluetoothHCIController.h new file mode 100644 index 0000000..303795e --- /dev/null +++ b/i386/include/IOKit/bluetooth/IOBluetoothHCIController.h @@ -0,0 +1,1370 @@ +/* + File: IOBluetoothHCIController.h + Contains: Bluetooth Host Controller base class. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + + +#pragma once + +//==================================================================================================== +// Imports +//==================================================================================================== + +#import +#import +#import +#import + +#import + +#include + +#import + +#import +#import + +//==================================================================================================== +// Forward declarations +//==================================================================================================== + +class OSSet; +class IOWorkLoop; +class IOCommandGate; +class IOWorkQueue; +class IOBluetoothDevice; +class IOBluetoothHCIRequest; +class IOBluetoothHCIController; +class IOBluetoothACLMemoryDescriptor; +class IOTimerEventSource; +class IOBluetoothInactivityTimerEventSource; +class IOBluetoothHCIPacketLogUserClient; + +//==================================================================================================== +// defines, typdefs, etc. +//==================================================================================================== + +#define kNoReturnParam NULL + +typedef uint16_t DevicePublishNotificationStateType; +enum DevicePublishNotificationStateTypes +{ + kHasNotRegisteredForDevicePublishNotification = 0x0001, + kHasRegisteredForDevicePublishNotification = 0x0002, + kDevicePublishNotificationCalled = 0x0004, + kDevicePublishNotificationProcessed = 0x0008 +}; + +typedef UInt32 HCIDataHandlerType; +enum HCIDataHandlerTypes +{ + kTransportDataTypeHCIEvents, + kTransportDataTypeACL, + kTransportDataTypeSCO +}; + +typedef IOReturn (*IOBluetoothIncomingDataAction) ( IOBluetoothHCIController *hciController, UInt8 *inDataPtr, UInt32 inDataSize, UInt32 inSequenceNumber ); +typedef IOReturn (*IOBluetoothHCIControllerDataHandler) ( void * contextPtr, const UInt8 * data, UInt32 dataSize ); + +typedef struct HCIDataHandler HCIDataHandler; +struct HCIDataHandler +{ + IOBluetoothHCIControllerDataHandler procPtr; + void * contextPtr; +}; + +typedef struct HCIEventNotificationListener HCIEventNotificationListener; +struct HCIEventNotificationListener +{ + task_t owningTask; // Used to ID these things when adding/removing them from our listener pool. + mach_port_t port; // Mach port to send out the notificaton. + void * refCon; // RefCon for the port's use. +}; + +#define POWER_STATE_CHANGE_IN_PROGRESS() ( mCurrentInternalPowerState != mPendingInternalPowerState ) +#define IS_POWERING_DOWN() ( POWER_STATE_CHANGE_IN_PROGRESS() && ( mPendingInternalPowerState == kIOBluetoothHCIControllerInternalPowerStateOff ) ) + +//==================================================================================================== +// Callback structure for data: +//==================================================================================================== + +typedef struct SendDataContext +{ + // Data sent: + IOMemoryDescriptor *memoryDescriptorPointer; + + // Referece to the device that sent the data: + IOBluetoothDevice *devicePointer; + void *devicePointerContextInfo0; + void *devicePointerContextInfo1; + + // And the controller that received it: + IOBluetoothHCIController *hciController; + void *controllerPointerContextInfo0; + void *controllerPointerContextInfo1; + + // ReturnValue: + IOReturn sendingWasSuccessful; +} SendDataContext; + + +//==================================================================================================== +// Keep track of hearing devices +//==================================================================================================== +typedef struct HearingDeviceListType +{ + BluetoothDeviceAddress mDeviceAddress; + bool mRemoveDeviceCalled; + DevicePublishNotificationStateType mDevicePublishNotificationState; + HearingDeviceListType * mNextDevice; + HearingDeviceListType * mPreviousDevice; +} HearingDeviceListType; + +//==================================================================================================== +// IOBluetoothHCIController +//==================================================================================================== + +class IOBluetoothHCIController : public IOService +{ + // We don't make many friends, but at least we have a few... + + friend class IOBluetoothHCIPacketLogUserClient; + friend class IOBluetoothSerialManager; + friend class IOBluetoothHCIUserClient; + friend class IOBluetoothDevice; + friend class IOBluetoothHCIRequest; + + // IOKit stuff. + + OSDeclareDefaultStructors( IOBluetoothHCIController ) + +protected: + + IOWorkLoop * mWorkLoop; + IOCommandGate * mCommandGate; + IOWorkQueue * mWorkQueue; + IOTimerEventSource * mTimerEventSource; + Boolean mShouldRunInactivityTimer; + + // Data and request queue stuff. + + HCIEventNotificationListener* mHCIEventListenersList; + size_t mHCIEventListenersListSize; + HCIDataHandler* mHCIEventDataHandlerList; + size_t mHCIEventDataHandlerListSize; + HCIDataHandler* mACLDataHandlerList; + size_t mACLDataHandlerListSize; + HCIDataHandler* mSCODataHandlerList; + size_t mSCODataHandlerListSize; + + IOBluetoothHCIRequest * mBusyQueueHead; + IOBluetoothHCIRequest * mWaitQueueHead; + IOBluetoothHCIRequest ** mHCIRequestList; + + IOBluetoothDevice * mDeviceListHead; + + OSSet * mPacketLogClients; + UInt8 * mPacketLogBuffer; + UInt32 mPacketLogBufferSize; + + uint8_t * mEventDataBuffer; // Events without matching requests will use this. + size_t mEventDataBufferSize; + + // This keeps track of the ACL packets we actually sent: + BluetoothHCIBufferSize mHCIBufferSize; + UInt16 mNumOutstandingACLPackets; + + OSArray * mAllowedIncomingL2CAPChannels; + + UInt32 mNextAvailableSequenceNumber; + UInt32 mCurrentlyExecutingSequenceNumber; + UInt16 mActiveConnections; + + // Packet Queue description: + typedef struct QueuePacketHolder { + IOMemoryDescriptor *memDescriptor; // The data we need to send + SendDataContext * contextPtr; // Context pointer for the sent data. + IOBluetoothDevice * inTargetDevice; // The device that enqueued the data. + struct QueuePacketHolder *next; // The next block in the queue. + } QueuePacketHolder; + QueuePacketHolder *mACLQueueHead, *mACLQueueTail; + + // Counters to limit the number of packets in the queue (we do not want to go out of memory) + UInt32 mNumberOfPacketsInQueue; + + // The allowed RFCOMM channels + OSArray *mAllowedIncomingRFCOMMChannels; + + IOBluetoothHCIControllerInternalPowerState mCurrentInternalPowerState; + IOBluetoothHCIControllerInternalPowerState mPendingInternalPowerState; + Boolean mAsyncPowerStateChangeInProgress; + UInt32 mPendingPowerStateChangeOptions; + IOBluetoothHCIControllerPowerOptions mControllerPowerOptions; + Boolean mPowerStateChangeIsUserEnforced; + + Boolean mHardwareSetupComplete; + + IOBluetoothHCIControllerConfigState mControllerConfigState; + IOBluetoothHCIControllerConfigState mPreviousControllerConfigState; + + IOBluetoothHCIControllerFeatureFlags mControllerFeatureFlags; + + // Overrides. + + bool start( IOService * provider ); + + bool init( OSDictionary* dictionary ); + + virtual void free(); + +#if defined( MAC_OS_X_VERSION_10_5 ) + virtual void systemWillShutdown( IOOptionBits specifier ); +#endif + + static IOReturn initHardwareAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual bool initHardware( IOService * provider ); + + static IOReturn setupHardwareAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOReturn setupHardware( IOService* provider ); + + virtual void hardwareSetupComplete( IOReturn status ); + + virtual void setConfigState( IOBluetoothHCIControllerConfigState configState ); + virtual bool terminate( IOOptionBits options = 0 ); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + + void stop( IOService * provider ); + + IOReturn newUserClient( task_t owningTask, + void * securityID, + UInt32 type, + IOUserClient ** handler ); + + uint32_t CountExistingHCIControllers(); + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags, + unsigned long powerState, + IOService * from ); + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags powerFlags ); + + // Our protected custom stuff. + + static IOReturn DetachUserClientsAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual void DetachUserClients(); + + static IOReturn setPropertiesAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOReturn setPropertiesWL( OSObject * properties ); + + static IOReturn AddPacketLogUserClientAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOReturn AddPacketLogUserClient( IOBluetoothHCIPacketLogUserClient *newPacketLogUserClient ); + + virtual bool PacketLogFillBufferedData(); + + virtual void PacketLogClientClosed( IOBluetoothHCIPacketLogUserClient *packetLogClient ); + + virtual void LogPacket( UInt8 packetType, void *packetData, size_t packetSize ); + + static IOReturn LogPacketAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + + virtual void DesyncIncomingData( IOBluetoothIncomingDataAction action, UInt8 *inDataPtr, UInt32 inDataSize ); + + static void DesyncIncomingDataAction( IOBluetoothHCIController *hciController, IOBluetoothIncomingDataAction action, void *inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber ); + + virtual void SynchronizePacketSequence( UInt32 sequenceNumber ); + + virtual IOReturn AddDevice( IOBluetoothDevice *inDevice ); + + virtual IOReturn RemoveDevice( IOBluetoothDevice *inDevice ); + + virtual IOReturn CreateDeviceFromConnectionResults( BluetoothHCIEventConnectionCompleteResults *connectionResults ); + + virtual IOReturn DestroyDeviceWithDisconnectionResults( BluetoothHCIEventDisconnectionCompleteResults *disconnectionResults ); + + virtual IOReturn DestroyDevice( IOBluetoothDevice *inDevice ); + + virtual IOReturn DestroyAllDevices(); + + virtual void FlushDeviceACLPackets( IOBluetoothDevice *inDevice ); + + virtual void DecrementOutstandingACLPackets( UInt16 delta ); + + virtual void ProcessFlushOccurredEvent( BluetoothHCIEventFlushOccurredResults *inFlushResults ); + + virtual void ProcessNumCompletedPacketsEvent( UInt8 *inDataPtr ); + + virtual void ProcessHCIControllerResetEvent(); + + virtual IOReturn DispatchIncomingACLData( UInt8 *inDataPtr, UInt32 inDataSize ); + + // Common methods for L2CAP and RFCOMM channel managment: + virtual void MergeChannelDescription(OSDictionary *destination , OSDictionary *source); + virtual void RemoveChannelRestrictions(OSDictionary *toChange , OSDictionary *removeRule, const char *key); + virtual Boolean IsAllowedDevice(OSDictionary *description , IOBluetoothDevice *device); + virtual void RemoveAllRules(); + + // L2CAP channel managment methods: + virtual void RemoveAllowedIncomingL2CAPChannel( OSObject *channelID ); + virtual IOReturn AddAllowedIncomingL2CAPChannel( OSDictionary *channelDescription ); + virtual OSDictionary *GetIncomingL2CAPChannelDescription( OSNumber *psmNumber ); + + // L2CAP channel accessory methods: + virtual void AddAllowedIncomingL2CAPChannel( BluetoothL2CAPPSM incomingPSM ); + virtual void AddAllowedIncomingL2CAPChannel( OSNumber *psmNumber ); + virtual void RemoveAllowedIncomingL2CAPChannel( BluetoothL2CAPPSM incomingPSM ); + + // RFCOMM channel managment methods: + virtual OSDictionary *GetIncomingRFCOMMChannelDescription( OSNumber *channelIDNumber ); + virtual IOReturn AddAllowedIncomingRFCOMMChannel( OSDictionary *channelDescription ); + virtual void RemoveAllowedIncomingRFCOMMChannel( OSObject *channelID ); + + // RFCOMM channel accessory methods: + virtual void AddAllowedIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + virtual void AddAllowedIncomingRFCOMMChannel( OSNumber *channelIDNumber ); + virtual void AddSecureIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + virtual void AddSecureIncomingRFCOMMChannel( OSNumber *channelIDNumber ); + virtual void RemoveAllowedIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + + virtual IOReturn TransferACLPacketToHW(IOMemoryDescriptor *memDescriptor, + SendDataContext * contextPtr); + + // ACL Packet queue: + virtual IOReturn EnqueuePacket( IOMemoryDescriptor *memDescriptor, + SendDataContext *contextPtr, + IOBluetoothDevice *inTargetDevice); + + virtual IOReturn DequeuePacket(); + + virtual IOReturn RemoveAllPacketsBelongingTo(IOBluetoothDevice *inTargetDevice); + +public: + + // IOWorkLoop and IOCommandGate accessors + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOCommandGate *getCommandGate() const; + + virtual IOReturn setProperties( OSObject * properties ); + + // Subclasses must implement these for it to be a working transport + // in the Bluetooth Family world. + + virtual IOReturn SendHCIRequest( UInt8 * buffer, + IOByteCount bufferSize ); + + static IOReturn SendACLCompletedAction ( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + virtual void SendACLCompleted( SendDataContext *contextPtr); + + virtual IOReturn SendACLData( IOMemoryDescriptor *memDescriptor, + SendDataContext * contextPtr ); + + virtual IOReturn GetTransportInfo( BluetoothTransportInfo * infoStruct ); + + static IOReturn SendSCOCompletedAction ( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + // Override to do something custom with the data. Otherwise, the registered data handler + // will get a peek at it. + + // The ProcessXXXData() functions are safe to be called from anywhere. + // They call ProcessXXXDataWL() on the workloop using ProcessXXXDataAction() + + virtual void ProcessEventData( UInt8 * inDataPtr, UInt32 inDataSize ); + + virtual void ProcessACLData( UInt8 * data, UInt32 dataSize ); + + virtual void ProcessSCOData( UInt8 * data, UInt32 dataSize, UInt32 inMissingData, AbsoluteTime inTimestamp, Boolean copyData ); + + virtual void ProcessEventDataWL( UInt8 * inDataPtr, UInt32 inDataSize, UInt32 sequenceNumber ); + + virtual void ProcessACLDataWL( UInt8 * data, UInt32 dataSize, UInt32 sequenceNumber ); + + virtual void ProcessSCODataWL( UInt8 * data, UInt32 dataSize, UInt32 inMissingData, AbsoluteTime inTimestamp, Boolean copyData ); + + static IOReturn ProcessEventDataAction( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inSequenceNumber ); + + static IOReturn ProcessACLDataAction( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inSequenceNumber ); + + // The following is only a "ghost" call and exists only to make the compiler happy, its implementation + // does not do anything. + static IOReturn ProcessSCODataAction( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inMissingData, + UInt32 inTimestampHi, + UInt32 inTimestampLo, + Boolean inCopyData ); + + static IOReturn ProcessSCODataActionAT( IOBluetoothHCIController * hciController, + UInt8 * incomingDataPtr, + UInt32 inDataSize, + UInt32 inMissingData, + AbsoluteTime* inTimestamp, + Boolean inCopyData ); + + // Data processing helpers. + + virtual bool GetCompleteCodeForCommand( BluetoothHCICommandOpCode inOpCode, + BluetoothHCIEventCode *outEventCode ); + + virtual bool GetOpCodeAndEventCode( UInt8 * inDataPtr, + BluetoothHCICommandOpCode * outOpCode, + BluetoothHCIEventCode * eventCode, + BluetoothHCIEventStatus * outStatus, + BluetoothDeviceAddress * outDeviceAddress, + BluetoothConnectionHandle * outConnectionHandle ); + + virtual IOReturn FindConnectionCompleteType( BluetoothHCICommandOpCode * outOpCode ); + + virtual IOReturn HandleSpecialOpcodes( BluetoothHCICommandOpCode opCode ); + + // This is a hook for other interested parties to get HCI event notifications. When a user client is created, + // that mach_port_t will be passed on to us via these calls so that their port will get HCI events that aren't + // specifically tied to a requst object, but occur due to requests they make. + + virtual IOReturn AddHCIEventNotification( task_t inOwningTask, mach_port_t inPort, void * refCon ); + + virtual void BroadcastEventNotification( BluetoothHCIRequestID inID, + BluetoothHCIEventCode inEventCode, + IOReturn eventStatus, + UInt8 * inDataToSendPtr, + IOByteCount inDataSize, + BluetoothHCICommandOpCode inOpCode ); + + virtual void BroadcastConfigStateChangeNotification( IOBluetoothHCIControllerConfigState oldState, + IOBluetoothHCIControllerConfigState newState ); + + virtual IOReturn RemoveHCIEventNotification( task_t inOwningTask ); + + // This is a hook for other interested parties to get data from transports. They will register itself + // with these to receive the raw data from the transport, bypassing HCI code. + + virtual IOReturn AddDataClient( HCIDataHandlerType inType, + IOBluetoothHCIControllerDataHandler inProcPtr, + void * inContextPtr ); + + virtual IOReturn NotifyDataClients( HCIDataHandlerType inType, UInt8 * inDataPtr, UInt32 inDataSize ); + + virtual IOReturn RemoveDataClient( HCIDataHandlerType inType, IOBluetoothHCIControllerDataHandler inProcPtr ); + + // Request creation, deletion and other data processing stuff. + + virtual IOReturn HCIRequestCreate( BluetoothHCIRequestID * outRequestID, + bool inDoAsyncNotify = TRUE, + UInt32 inTimeout = 5, + BluetoothHCIRequestCallbackInfo * inCallbackInfo = NULL, + task_t inTaskID = 0, + UInt32 inControlFlags = 0 ); + + virtual IOReturn HCIRequestDelete( task_t inTask, BluetoothHCIRequestID inID ); + + virtual IOReturn LookupRequest( BluetoothHCIRequestID inID, IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn PrepareRequestForNewCommand( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inDeviceAddress, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn EnqueueRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn FindQueuedRequest( BluetoothHCICommandOpCode opCode, + BluetoothDeviceAddress * inDeviceAddress, + BluetoothConnectionHandle inConnectionHandle, + Boolean inUseAttributes, + IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn DequeueRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn EnqueueWaitRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn FindQueuedWaitRequest( BluetoothHCICommandOpCode opCode, IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn DequeueWaitRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn AbortRequest( IOBluetoothHCIRequest * inRequestPtr ); + + virtual IOReturn FindNextExpiringRequest( BluetoothHCICommandOpCode opCode, IOBluetoothHCIRequest ** outRequestPtr ); + + virtual IOReturn ProcessWaitingRequests(); + + inline IOBluetoothHCIRequest* GetNextWaitRequest() { return( mWaitQueueHead ); } + + inline IOBluetoothHCIRequest* GetNextBusyRequest() { return( mBusyQueueHead ); } + + virtual void TakeAHexDump( const void *inData, UInt32 inDataSize ); + + virtual IOReturn DumpStats(); + + virtual IOBluetoothHCIControllerPowerOptions GetControllerPowerOptions(); + virtual IOBluetoothHCIControllerInternalPowerState GetControllerPowerState(); + virtual IOReturn WaitForControllerPowerState( IOBluetoothHCIControllerInternalPowerState powerState ); + + virtual IOReturn RequestPowerStateChange( IOBluetoothHCIControllerInternalPowerState newPowerState ); + + virtual IOReturn SendHCIRequestFormatted( BluetoothHCIRequestID inID, + BluetoothHCICommandOpCode inOpCode, + IOByteCount outResultsSize, + void * outResultsPtr, + const char * inFormat, + ... ); + + static void RequestExpired( OSObject *owner, IOTimerEventSource *sender ); + + // Misc stuff. + + IOReturn DisposeRequestsForTaskID( task_t inTaskID ); + + IOReturn KillAllPendingRequests( Boolean destroy, Boolean includeIdleRequests ); + void SendingRequest( IOBluetoothHCIRequest *requestPtr ); + void DecrementActiveConnections( ); + + virtual void ActiveConnectionsInProgress( ); + virtual void AllConnectionsGone( ); + + virtual IOReturn SendRawHCICommand( BluetoothHCIRequestID inID, + char * buffer, + UInt32 bufferSize ); + + // Vendor Specific stuff. + + virtual IOReturn VendorCommand( BluetoothHCIRequestID inID, + BluetoothHCIVendorCommandSelector inSelector, + UInt8 * inCommandData, + IOByteCount inCommandDataSize, + IOByteCount outBufferSize, + UInt8 * outBuffer ); + + // IOBluetoothDevice object management + + virtual IOBluetoothDevice * FindDeviceWithHandle( BluetoothConnectionHandle inConnectionHandle ); + + virtual IOBluetoothDevice * FindDeviceWithAddress( const BluetoothDeviceAddress *inDeviceAddress ); + + virtual IOReturn SendACLPacket( IOBluetoothACLMemoryDescriptor *memDescriptor, + SendDataContext * contextPtr, + IOBluetoothDevice * inTargetDevice = NULL ); + + + // API for the serial manager to open a new connection + + virtual IOBluetoothDevice *OpenDeviceConnection( const BluetoothDeviceAddress *inDeviceAddress ); + + static IOReturn OpenDeviceConnectionAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + virtual IOBluetoothDevice *OpenDeviceConnectionWL( const BluetoothDeviceAddress *inDeviceAddress ); + + // API to track the secure state of RFCOMM channels + virtual Boolean IsSecureIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID ); + virtual Boolean IsSecureIncomingRFCOMMChannel( OSNumber *channelIDNumber ); + + // API to track allowed incoming L2CAP and RFCOMM channels given a device: + virtual Boolean IsAllowedIncomingL2CAPChannelForDevice( BluetoothL2CAPPSM incomingPSM, IOBluetoothDevice *device ); + virtual Boolean IsAllowedIncomingRFCOMMChannelForDevice( BluetoothRFCOMMChannelID incomingChannelID, IOBluetoothDevice *device ); + + // Enabled state for RFCOMM channels: + virtual void SetEnabledIncomingRFCOMMChannel( OSNumber *channelIDNumber, bool ShouldBeEnabled); + virtual void SetEnabledIncomingRFCOMMChannel( BluetoothRFCOMMChannelID incomingChannelID, bool ShouldBeEnabled); + + virtual Boolean ShouldRunInactivityTimer(); // NOT USED: See StartIdleTimer + virtual void SetRunInactivityTimer( Boolean shouldRun ); // NOT USED: See StopIdleTimer + + //============================ + + // From here on out, we implement each of the commands in the HCI spec. You can work around + // hardware bugs by overriding any of these functions if necessary. + + + // Link Control Commands. + + virtual IOReturn BluetoothHCIInquiry( BluetoothHCIRequestID inID, + BluetoothLAP inLAP, + BluetoothHCIInquiryLength inInquiryLength, + BluetoothHCIResponseCount inMaxResponseCount, + BluetoothHCIInquiryResults * outResults ); + + virtual IOReturn BluetoothHCIInquiryCancel( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIPeriodicInquiryMode( BluetoothHCIRequestID inID, + BluetoothHCIInquiryLength inMaxPeriodLength, + BluetoothHCIInquiryLength inMinPeriodLength, + BluetoothLAP inLAP, + BluetoothHCIInquiryLength inInquiryLength, + BluetoothHCIResponseCount inMaxResponses, + BluetoothHCIInquiryResults * outResults ); + + virtual IOReturn BluetoothHCIExitPeriodicInquiryMode( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCICreateConnection( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothPacketType inPacketType, + BluetoothPageScanRepetitionMode inPageScanRepetitionMode, + BluetoothPageScanMode inPageScanMode, + BluetoothClockOffset inClockOffset, + BluetoothAllowRoleSwitch inAllowRoleSwitch, + BluetoothHCIEventConnectionCompleteResults *outConnectionHandle ); + + virtual IOReturn BluetoothHCIDisconnect( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothReasonCode inReason, + BluetoothHCIEventDisconnectionCompleteResults * outResults ); + + virtual IOReturn BluetoothHCIAddSCOConnection( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inACLConnectionHandle, + BluetoothPacketType inPacketType ); + + virtual IOReturn BluetoothHCIAcceptConnectionRequest( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothRole inRole ); + + virtual IOReturn BluetoothHCIRejectConnectionRequest( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothReasonCode inReason ); + + virtual IOReturn BluetoothHCILinkKeyRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + const BluetoothKey * inKeyPtr, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCILinkKeyRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCIPINCodeRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + IOByteCount inPINCodeSize, + const BluetoothPINCode * inPINCode, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCIPINCodeRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + virtual IOReturn BluetoothHCIChangeConnectionPacketType( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothPacketType inPacketType ); + + virtual IOReturn BluetoothHCIAuthenticationRequested( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCISetEncryptionEnable( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothEncryptionEnable inEncryptionEnable ); + + virtual IOReturn BluetoothHCIChangeConnectionLinkKey( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIMasterLinkKey( BluetoothHCIRequestID inID, + BluetoothKeyFlag inKeyFlag ); + + virtual IOReturn BluetoothHCIRemoteNameRequest( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothPageScanRepetitionMode inPageScanRepetitionMode, + BluetoothPageScanMode inPageScanMode, + BluetoothClockOffset inClockOffset, + BluetoothHCIEventRemoteNameRequestResults * outName ); + + virtual IOReturn BluetoothHCIReadRemoteSupportedFeatures( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIEventReadRemoteSupportedFeaturesResults * outFeatures ); + + virtual IOReturn BluetoothHCIReadRemoteVersionInformation( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIEventReadRemoteVersionInfoResults * outVersionInfo ); + + virtual IOReturn BluetoothHCIReadClockOffset( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothClockOffset * outClockOffset ); + + // Link Policy commands. + + virtual IOReturn BluetoothHCIHoldMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIModeInterval inHoldModeMaxInterval, + BluetoothHCIModeInterval inHoldModeMinInterval ); + + virtual IOReturn BluetoothHCISniffMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIModeInterval inSniffModeMaxInterval, + BluetoothHCIModeInterval inSniffModeMinInterval, + BluetoothHCISniffAttemptCount inSniffAttemptCount, + BluetoothHCISniffTimeout inSniffModeTimeout ); + + virtual IOReturn BluetoothHCIExitSniffMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIParkMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIParkModeBeaconInterval inMaxInterval, + BluetoothHCIParkModeBeaconInterval inMinInterval ); + + virtual IOReturn BluetoothHCIExitParkMode( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIQualityOfServiceSetup( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIQualityOfServiceSetupParams * inSetupPtr ); + + virtual IOReturn BluetoothHCIRoleDiscovery( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIRoleInfo * outRoleInfo ); + + virtual IOReturn BluetoothHCISwitchRole( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * inAddressPtr, + BluetoothHCIRole inNewRole ); + + virtual IOReturn BluetoothHCIReadLinkPolicySettings( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCILinkPolicySettingsInfo * outSettingsInfo ); + + virtual IOReturn BluetoothHCIWriteLinkPolicySettings( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCILinkPolicySettings inSettings, + BluetoothConnectionHandle * outConnectionHandle ); + + // Host controller and baseband commands. + + virtual IOReturn BluetoothHCISetEventMask( BluetoothHCIRequestID inID, + BluetoothSetEventMask * inMask ); + + virtual IOReturn BluetoothHCIReset( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCISetEventFilter( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIFlush( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inHandle ); + + virtual IOReturn BluetoothHCIReadPINType( BluetoothHCIRequestID inID, + BluetoothPINType * outType ); + + virtual IOReturn BluetoothHCIWritePINType( BluetoothHCIRequestID inID, + BluetoothPINType inType ); + + virtual IOReturn BluetoothHCICreateNewUnitKey( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIReadStoredLinkKey( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * targetDevice, + BluetoothHCIReadStoredLinkKeysFlag * inFlags, + BluetoothHCIStoredLinkKeysInfo * outKeysInfo ); + + virtual IOReturn BluetoothHCIWriteStoredLinkKey( BluetoothHCIRequestID inID, + IOItemCount inNumKeysToWrite, + BluetoothDeviceAddress inDeviceAddresses[], + BluetoothKey inLinkKeys[], + BluetoothHCINumLinkKeysToWrite * outNumKeysWritten ); + + virtual IOReturn BluetoothHCIDeleteStoredLinkKey( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * targetDevice, + BluetoothHCIDeleteStoredLinkKeyFlag * inFlag, + BluetoothHCINumLinkKeysDeleted * outNumDeleted ); + + virtual IOReturn BluetoothHCIReadLocalName( BluetoothHCIRequestID inID, + BluetoothDeviceName name ); + + virtual IOReturn BluetoothHCIChangeLocalName( BluetoothHCIRequestID inID, + BluetoothDeviceName newName ); + + virtual IOReturn BluetoothHCIReadConnectionAcceptTimeout( BluetoothHCIRequestID inID, + BluetoothHCIConnectionAcceptTimeout * outTimeout ); + + virtual IOReturn BluetoothHCIWriteConnectionAcceptTimeout( BluetoothHCIRequestID inID, + BluetoothHCIConnectionAcceptTimeout inTimeout ); + + virtual IOReturn BluetoothHCIReadPageTimeout( BluetoothHCIRequestID inID, + BluetoothHCIPageTimeout * outDataPtr ); + + virtual IOReturn BluetoothHCIWritePageTimeout( BluetoothHCIRequestID inID, + BluetoothHCIPageTimeout inTimeout ); + + virtual IOReturn BluetoothHCIReadScanEnable( BluetoothHCIRequestID inID, + BluetoothHCIPageScanEnableState * outState ); + + virtual IOReturn BluetoothHCIWriteScanEnable( BluetoothHCIRequestID inID, + BluetoothHCIPageScanEnableState inState ); + + virtual IOReturn BluetoothHCIReadPageScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * outActivityInfo ); + + virtual IOReturn BluetoothHCIWritePageScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * inActivityInfo ); + + virtual IOReturn BluetoothHCIReadInquiryScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * outActivityInfo ); + + virtual IOReturn BluetoothHCIWriteInquiryScanActivity( BluetoothHCIRequestID inID, + BluetoothHCIScanActivity * inActivityInfo ); + + virtual IOReturn BluetoothHCIReadAuthenticationEnable( BluetoothHCIRequestID inID, + BluetoothHCIAuthenticationEnable * outAuthenticationState ); + + virtual IOReturn BluetoothHCIWriteAuthenticationEnable( BluetoothHCIRequestID inID, + BluetoothHCIAuthenticationEnable inAuthenticationState ); + + virtual IOReturn BluetoothHCIReadEncryptionMode( BluetoothHCIRequestID inID, + BluetoothHCIEncryptionMode * outEncryptionState ); + + virtual IOReturn BluetoothHCIWriteEncryptionMode( BluetoothHCIRequestID inID, + BluetoothHCIEncryptionMode inEncryptionMode ); + + virtual IOReturn BluetoothHCIReadClassOfDevice( BluetoothHCIRequestID inID, + BluetoothClassOfDevice * outClassOfDevice ); + + virtual IOReturn BluetoothHCIWriteClassOfDevice( BluetoothHCIRequestID inID, + BluetoothClassOfDevice inClassOfDevice ); + + virtual IOReturn BluetoothHCIReadVoiceSetting( BluetoothHCIRequestID inID, + BluetoothHCIVoiceSetting * outVoiceSetting ); + + virtual IOReturn BluetoothHCIWriteVoiceSetting( BluetoothHCIRequestID inID, + BluetoothHCIVoiceSetting inVoiceSetting ); + + virtual IOReturn BluetoothHCIReadAutomaticFlushTimeout( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIAutomaticFlushTimeoutInfo * outAutomaticFlushTimeoutInfo ); + + + virtual IOReturn BluetoothHCIWriteAutomaticFlushTimeout( BluetoothHCIRequestID inID, + BluetoothHCIAutomaticFlushTimeoutInfo * inAutomaticFlushTimeoutInfo, + BluetoothConnectionHandle * outConnectionHandle ); + + virtual IOReturn BluetoothHCIReadNumBroadcastRetransmissions( BluetoothHCIRequestID inID, + BluetoothHCINumBroadcastRetransmissions * outNumRetrans ); + + virtual IOReturn BluetoothHCIWriteNumBroadcastRetransmissions( BluetoothHCIRequestID inID, + BluetoothHCINumBroadcastRetransmissions inNumRetrans ); + + virtual IOReturn BluetoothHCIReadHoldModeActivity( BluetoothHCIRequestID inID, + BluetoothHCIHoldModeActivity * outState ); + + virtual IOReturn BluetoothHCIWriteHoldModeActivity( BluetoothHCIRequestID inID, + BluetoothHCIHoldModeActivity inState ); + + virtual IOReturn BluetoothHCIReadTransmitPowerLevel( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inHandle, + BluetoothHCITransmitPowerLevelType inType, + BluetoothHCITransmitPowerLevelInfo * outLevelInfo ); + + virtual IOReturn BluetoothHCIReadSCOFlowControlEnable( BluetoothHCIRequestID inID, + BluetoothHCIFlowControlState * outState ); + + virtual IOReturn BluetoothHCIWriteSCOFlowControlEnable( BluetoothHCIRequestID inID, + BluetoothHCIFlowControlState inState ); + + virtual IOReturn BluetoothHCISetHostControllerToHostFlowControl( BluetoothHCIRequestID inID, + BluetoothHCIFlowControlState inState ); + + virtual IOReturn BluetoothHCIHostBufferSize( BluetoothHCIRequestID inID, + BluetoothHCIBufferSize * inSize ); + + virtual IOReturn BluetoothHCIHostNumberOfCompletePackets( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIReadLinkSupervisionTimeout( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inHandle, + BluetoothHCILinkSupervisionTimeout * outInfo ); + + virtual IOReturn BluetoothHCIWriteLinkSupervisionTimeout( BluetoothHCIRequestID inID, + BluetoothHCILinkSupervisionTimeout * inInfo, + BluetoothConnectionHandle * outHandle ); + + virtual IOReturn BluetoothHCIReadNumberOfSupportedIAC( BluetoothHCIRequestID inID, + BluetoothHCISupportedIAC * outNumSupported ); + + virtual IOReturn BluetoothHCIReadCurrentIACLAP( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIWriteCurrentIACLAP( BluetoothHCIRequestID inID ); + + virtual IOReturn BluetoothHCIReadPageScanPeriodMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanPeriodMode * outMode ); + + virtual IOReturn BluetoothHCIWritePageScanPeriodMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanPeriodMode inMode ); + + virtual IOReturn BluetoothHCIReadPageScanMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanMode * outMode ); + + virtual IOReturn BluetoothHCIWritePageScanMode( BluetoothHCIRequestID inID, + BluetoothHCIPageScanMode inMode ); + + // Informational commands. + + virtual IOReturn BluetoothHCIReadLocalVersionInformation( BluetoothHCIRequestID inID, + BluetoothHCIVersionInfo * outVersionInfo ); + + virtual IOReturn BluetoothHCIReadLocalSupportedFeatures( BluetoothHCIRequestID inID, + BluetoothHCISupportedFeatures * outFeatures ); + + virtual IOReturn BluetoothHCIReadBufferSize( BluetoothHCIRequestID inID, + BluetoothHCIBufferSize * outSize ); + + virtual IOReturn BluetoothHCIReadCountryCode( BluetoothHCIRequestID inID, + BluetoothHCICountryCode * outCountryCode ); + + virtual IOReturn BluetoothHCIReadDeviceAddress( BluetoothHCIRequestID inID, + BluetoothDeviceAddress * outAddress ); + + // Status commands. + + virtual IOReturn BluetoothHCIReadFailedContactCounter( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIFailedContactInfo * outFailedContactCount ); + + virtual IOReturn BluetoothHCIResetFailedContactCounter( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle ); + + virtual IOReturn BluetoothHCIGetLinkQuality( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCILinkQualityInfo * outLinkQualityInfo ); + + virtual IOReturn BluetoothHCIReadRSSI( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIRSSIInfo * outRSSIInfo ); + + // Testing Commands. + + virtual IOReturn BluetoothHCIReadLoopbackMode( BluetoothHCIRequestID inID, + BluetoothHCILoopbackMode * inLoopbackMode ); + + virtual IOReturn BluetoothHCIWriteLoopbackMode( BluetoothHCIRequestID inID, + BluetoothHCILoopbackMode inLoopbackMode ); + + virtual IOReturn BluetoothHCIEnableDeviceUnderTestMode( BluetoothHCIRequestID inID ); + + virtual IOBluetoothHCIControllerFeatureFlags GetControllerFeatureFlags(); + +protected: + + // Power managment functions: + + virtual bool configurePM(IOService *provider); + + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService* whatDevice ); + static IOReturn setPowerStateAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + virtual IOReturn setPowerStateWL( unsigned long powerStateOrdinal, IOService* whatDevice ); + + virtual void UpdatePowerStateProperty( IOBluetoothHCIControllerInternalPowerState powerState ); + + virtual void SetControllerPowerOptions( IOBluetoothHCIControllerPowerOptions controllerPowerOptions ); + virtual IOReturn PerformPowerStateChange( IOBluetoothHCIControllerInternalPowerState oldPowerState, + IOBluetoothHCIControllerInternalPowerState newPowerState, + UInt32 powerStateOptions, + UInt32 *microsecondsUntilComplete ); + virtual void CompletePowerStateChange(); + + virtual void SetControllerFeatureFlags( IOBluetoothHCIControllerFeatureFlags featureFlags ); + + virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ); + + // Enablers for future Changes. + + typedef struct ExpansionData + { + void *mUnsedPointer1, *mUnsedPointer2; + + // Max number of HCI command allowed; + UInt8 mNumberOfCommandsAllowedByHardware; + UInt8 mNumConfiguredHIDDevices; + UInt8 mControllerSleepFlags; + + // This pointer is depreacted and free for future uses. + void* mUnusedPointer; + + // AFH support: + // the mask for the channels to use: + UInt8 mMaskByte[10]; + + // AirPort changes notifications: + IONotifier *windowServerNotifier; + IONotifier *mAirPortPCI; + Boolean mProcessingConnectionRequest; + Boolean mWaitingForCompletedACLPacketsToSleep; + + // SCO Support + UInt8 mNumSCOConnections; + UInt8 *mSCOPacketBuffer; + UInt16 mNumBufferedSCOBytes; + AbsoluteTime mBufferedSCOPacketTimestamp; + + // Repository for the packets when logging at boot + OSArray *mRepositoryForBoot; + UInt16 mMaxNumberOfBootPackets; + + IOService *mOverriddenControllerProvider; + + size_t mHCIRequestListSize; + uint32_t mNewRequestIndex; + + IOBluetoothInactivityTimerEventSource *mIdleTimer; + Boolean mSystemOnTheWayToSleep; + + // New Airport notifications: + IONotifier *mIO80211Interface; + + UInt32 mNextAvailableSCOSequenceNumber; + UInt32 mCurrentlyExecutingSCOSequenceNumber; + + Boolean mNeedToCleanUpWaitForAckQueue; + Boolean mResettingDevice; + + HearingDeviceListType *mConnectedHearingDeviceListHead; + HearingDeviceListType *mConnectedHearingDeviceListTail; + + } ExpansionData; + + ExpansionData* mExpansionData; + +#define mConnectedHearingDeviceListTail IOBluetoothHCIController::mExpansionData->mConnectedHearingDeviceListTail +#define mConnectedHearingDeviceListHead IOBluetoothHCIController::mExpansionData->mConnectedHearingDeviceListHead +#define mResettingDevice IOBluetoothHCIController::mExpansionData->mResettingDevice +#define mNeedToCleanUpWaitForAckQueue IOBluetoothHCIController::mExpansionData->mNeedToCleanUpWaitForAckQueue +#define mNextAvailableSCOSequenceNumber IOBluetoothHCIController::mExpansionData->mNextAvailableSCOSequenceNumber +#define mCurrentlyExecutingSCOSequenceNumber IOBluetoothHCIController::mExpansionData->mCurrentlyExecutingSCOSequenceNumber + +#define mNumberOfCommandsAllowedByHardware IOBluetoothHCIController::mExpansionData->mNumberOfCommandsAllowedByHardware +#define mNumConfiguredHIDDevices IOBluetoothHCIController::mExpansionData->mNumConfiguredHIDDevices +#define mControllerSleepFlags IOBluetoothHCIController::mExpansionData->mControllerSleepFlags +#define mSleepWakeNotifier IOBluetoothHCIController::mExpansionData->mSleepWakeNotifier + +#define mMaskByte IOBluetoothHCIController::mExpansionData->mMaskByte +#define windowServerNotifier IOBluetoothHCIController::mExpansionData->windowServerNotifier +#define mAirPortPCI IOBluetoothHCIController::mExpansionData->mAirPortPCI +#define mProcessingConnectionRequest IOBluetoothHCIController::mExpansionData->mProcessingConnectionRequest +#define mWaitingForCompletedACLPacketsToSleep IOBluetoothHCIController::mExpansionData->mWaitingForCompletedACLPacketsToSleep + +#define mNumSCOConnections IOBluetoothHCIController::mExpansionData->mNumSCOConnections +#define mSCOPacketBuffer IOBluetoothHCIController::mExpansionData->mSCOPacketBuffer +#define mNumBufferedSCOBytes IOBluetoothHCIController::mExpansionData->mNumBufferedSCOBytes +#define mBufferedSCOPacketTimestamp IOBluetoothHCIController::mExpansionData->mBufferedSCOPacketTimestamp +#define mRepositoryForBoot IOBluetoothHCIController::mExpansionData->mRepositoryForBoot +#define mMaxNumberOfBootPackets IOBluetoothHCIController::mExpansionData->mMaxNumberOfBootPackets +#define mOverriddenControllerProvider IOBluetoothHCIController::mExpansionData->mOverriddenControllerProvider +#define mHCIRequestListSize IOBluetoothHCIController::mExpansionData->mHCIRequestListSize +#define mNewRequestIndex IOBluetoothHCIController::mExpansionData->mNewRequestIndex +#define mIdleTimer IOBluetoothHCIController::mExpansionData->mIdleTimer +#define mSystemOnTheWayToSleep IOBluetoothHCIController::mExpansionData->mSystemOnTheWayToSleep +#define mIO80211Interface IOBluetoothHCIController::mExpansionData->mIO80211Interface + + enum { + kIOBluetoothHCIControllerSleepFlagInquiryScanWasEnabled = 0x01 + }; + + +private: + + // Command Packet Queue: + virtual IOReturn EnqueueRequestForController( IOBluetoothHCIRequest *requestPtr ); // Was OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 0 ) + virtual IOReturn DequeueAndSendRequests(); // Was OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 1 ) + virtual IOReturn RemoveAllRequestsFromQueue(); // Was OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 2 ) + + // New Device creation upon connection: + IOReturn CreateDeviceFromConnectionResults( BluetoothHCIEventConnectionCompleteResults *connectionResults, bool isInitiator); + + // Expanded version of OpenDeviceConnection MUST BE CALLED IN THE WORKLOOP + virtual IOBluetoothDevice *OpenDeviceConnection( const BluetoothDeviceAddress *inDeviceAddress, BluetoothHCIPageTimeout pageTimeoutValue, bool authenticationRequired); + + // sleepWakeHandler DEPRECATED METHOD RETURNS kIOReturnUnsupported ALL THE TIME ! + static IOReturn sleepWakeHandler( void *target, void *refCon, UInt32 messageType, IOService *service, void *messageArgument, vm_size_t argSize ); + + static IOReturn restartShutdownAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + static IOReturn systemSleepWakeAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4 ); + +public: + virtual IOReturn restartShutdownWL( UInt32 messageType, void *reserved); + + // AFH support: + virtual UInt8 *rangeForChannel(UInt16 channel); + virtual IOReturn handleAirPortChangesChannelWL(IOService *serviceForAirport); + + // Version of stop in the workloop + virtual void stopWL( IOService * provider ); + +private: + static bool staticAirPortDriverNotification(void *us, void *unused, IOService * yourDevice); + static IOReturn handleAirPortChangesChannelAction( OSObject *owner, void *castMeToServiceForAirport, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + static bool windowServerDidAppear( void * target, void * refCon, IOService * newService, IONotifier * notifier ); + static IOReturn windowServerDidAppearAction( OSObject *owner, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6 ); + + // Expansion slots: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 0 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 1 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 2 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 3 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 4 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 5 ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 6 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 7 ); + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 8 ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 9 ); + virtual void SetNumSCOConnections( UInt8 numSCOConnections ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 10 ); + virtual void UpdateSCOConnections( UInt8 numSCOConnections ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 11 ); + virtual IOBluetoothDevice *FindDeviceWithSCOHandle( BluetoothConnectionHandle inConnectionHandle ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 12 ); + virtual IOReturn SendSCOData( IOMemoryDescriptor *scoDataDescriptor, + SendDataContext *scoDataContext ); + +protected: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 13 ); + virtual void SendSCOCompleted( SendDataContext *contextPtr, AbsoluteTime timestamp ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 14 ); + virtual IOReturn DispatchIncomingSCOData( UInt8 *inDataPtr, UInt32 inDataSize, UInt32 inMissingData, AbsoluteTime inTimestamp ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 15 ); + virtual bool willTerminateWL( IOService * provider, IOOptionBits options ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 16 ); + virtual bool shouldOverrideExistingController( IOBluetoothHCIController *controller ); + + static void idleTimerFired( OSObject *owner, IOTimerEventSource *timerEventSource ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 17 ); + virtual void handleIdleTimeout(); + + static IOReturn terminateAction( OSObject *owner, + void *arg1, + void *arg2, + void *arg3, + void *arg4 ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 18 ); + virtual IOReturn terminateWL( IOOptionBits options ); + + // Support for dynamic channel width + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 19 ); + virtual UInt8 *rangeForChannel(UInt16 channel, SInt16 width); + +public: + + // v1.2 + v2.1 commands + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 20 ); + virtual IOReturn BluetoothHCIReadExtendedInquiryResponse( BluetoothHCIRequestID inID, + BluetoothHCIReadExtendedInquiryResponseResults * outData ); + + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 21 ); + virtual IOReturn BluetoothHCIWriteExtendedInquiryResponse( BluetoothHCIRequestID inID, + BluetoothHCIFECRequired inFECRequired, + BluetoothHCIExtendedInquiryResponse * inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 22 ); + virtual IOReturn BluetoothHCIReadInquiryMode( BluetoothHCIRequestID inID, + BluetoothHCIInquiryMode * outMode ); + + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 23 ); + virtual IOReturn BluetoothHCIWriteInquiryMode( BluetoothHCIRequestID inID, + BluetoothHCIInquiryMode inMode ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 24 ); + virtual IOReturn BluetoothHCIReadSimplePairingMode( BluetoothHCIRequestID inID, + BluetoothHCISimplePairingMode * outMode ); + + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 25 ); + virtual IOReturn BluetoothHCIWriteSimplePairingMode( BluetoothHCIRequestID inID, + BluetoothHCISimplePairingMode inMode ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 26 ); + virtual IOReturn BluetoothHCIIOCapabilityRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothIOCapability inIOCapability, + BluetoothOOBDataPresence inOOBDataPresence, + BluetoothAuthenticationRequirements inAuthenticationRequirements ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 27 ); + virtual IOReturn BluetoothHCIReadLocalOOBData( BluetoothHCIRequestID inID, + BluetoothHCIReadLocalOOBDataResults * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 28 ); + virtual IOReturn BluetoothHCIReadInquiryResponseTransmitPower( BluetoothHCIRequestID inID, + BluetoothHCITransmitPowerLevel * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 29 ); + virtual IOReturn BluetoothHCIWriteInquiryResponseTransmitPower( BluetoothHCIRequestID inID, + BluetoothHCITransmitPowerLevel inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 30 ); + virtual IOReturn BluetoothHCIUserConfirmationRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 31 ); + virtual IOReturn BluetoothHCIUserConfirmationRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 32 ); + virtual IOReturn BluetoothHCIUserPasskeyRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothPasskey inPasskey); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 33 ); + virtual IOReturn BluetoothHCIUserPasskeyRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 34 ); + virtual IOReturn BluetoothHCIRemoteOOBDataRequestReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothHCISimplePairingOOBData * hash, + BluetoothHCISimplePairingOOBData * randomizer ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 35 ); + virtual IOReturn BluetoothHCIRemoteOOBDataRequestNegativeReply( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 36 ); + virtual IOReturn BluetoothHCIWriteSimplePairingDebugMode( BluetoothHCIRequestID inID, + BluetoothSimplePairingDebugMode inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 37 ); + virtual IOReturn BluetoothHCISendKeypressNotification( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddress, + BluetoothKeypressNotificationType inData ); + +protected: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 38 ); + virtual IOReturn systemSleepWakeWL( UInt32 messageType, void *reserved); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 39 ); + virtual IOReturn BluetoothHCIReadLocalExtendedFeatures( BluetoothHCIRequestID inID, + BluetoothHCIPageNumber inPageNumber, + BluetoothHCIExtendedFeaturesInfo * outFeatures ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 40 ); + virtual IOReturn BluetoothHCIReadRemoteExtendedFeatures( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothHCIPageNumber inPageNumber, + BluetoothHCIEventReadRemoteExtendedFeaturesResults * outFeatures ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 41 ); + virtual IOReturn BluetoothHCIReadAFHChannelAssessmentMode( BluetoothHCIRequestID inID, + BluetoothHCIAFHChannelAssessmentMode * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 42 ); + virtual IOReturn BluetoothHCIWriteAFHChannelAssessmentMode( BluetoothHCIRequestID inID, + BluetoothHCIAFHChannelAssessmentMode inData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 43 ); + virtual IOReturn BluetoothHCISetAFHHostChannelClassification( BluetoothHCIRequestID inID, + uint8_t * inDataPtr, + uint8_t inDataLength ); + +private: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 44 ); + virtual IOReturn BluetoothHCIReadAFHChannelMap( BluetoothHCIRequestID inID, + BluetoothConnectionHandle inConnectionHandle, + BluetoothAFHResults * outData ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 45 ); + virtual void SynchronizeSCOPacketSequence( UInt32 sequenceNumber ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 46 ); + virtual IOReturn BluetoothHCICreateConnectionCancel( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 47 ); + virtual IOReturn BluetoothHCIRemoteNameRequestCancel( BluetoothHCIRequestID inID, + const BluetoothDeviceAddress * inAddressPtr, + BluetoothDeviceAddress * outAddress ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 48 ); + void StartIdleTimer( uint32_t milliseconds ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 49 ); + void StopIdleTimer(); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 50 ); + virtual IOReturn setUnackQueueCompletionCalled(void * memoryDescriptor); + +protected: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 51 ); + virtual IOReturn RemovePacket(IOMemoryDescriptor *memDescriptor); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 52 ); + IOReturn exitHIDSniff(bool exitSniff); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 53 ); + virtual IOReturn WaitForControllerPowerStateWithTimeout( IOBluetoothHCIControllerInternalPowerState powerState, + UInt32 waitTimeInMicroSecond); +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 54 ); + void SetHCIDriverExistsVariableTo( bool isLoaded ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 55 ); + virtual IOReturn ToggleLMPLogging( ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 56 ); + virtual HearingDeviceListType * FindHearingDeviceWithAddress( const BluetoothDeviceAddress *inDeviceAddress ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 57 ); + virtual IOReturn AddHearingDevice( IOBluetoothDevice *inDevice ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 58 ); + virtual IOReturn RemoveHearingDevice( IOBluetoothDevice *inDevice, bool all ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 59 ); + virtual IOReturn SetDevicePublishNotificationState( const BluetoothDeviceAddress *inDeviceAddress, DevicePublishNotificationStateType state ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHCIController, 60 ); + virtual DevicePublishNotificationStateType * GetDevicePublishNotificationState( const BluetoothDeviceAddress *inDeviceAddress ); + +private: + OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 61 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 62 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHCIController, 63 ); +}; diff --git a/i386/include/IOKit/bluetooth/IOBluetoothHCIRequest.h b/i386/include/IOKit/bluetooth/IOBluetoothHCIRequest.h new file mode 100644 index 0000000..c9d970e --- /dev/null +++ b/i386/include/IOKit/bluetooth/IOBluetoothHCIRequest.h @@ -0,0 +1,155 @@ +/* + File: IOBluetoothHCIRequest.h + Contains: Bluetooth Host Controller request object. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + +#pragma once + +#import +#import + +#import + + +class IOCommandGate; +class IOTimerEventSource; +class IOBluetoothHCIController; + +// Forward declaration to avoid the need to include IOBluetoothHCIUserLibShared.h +typedef struct BluetoothHCINotificationMessage; + +//=========================================================================================================================== +// enums, macros, etc. +//=========================================================================================================================== + +enum +{ + kMaxHCIBufferLength = 512 +}; + +typedef UInt8 BluetoothHCIRequestState; +enum BluetoothHCIRequestStates +{ + kHCIRequestStateIdle = 0, // Doing nothing - neither waiting nor busy. usually waiting for deletion. + kHCIRequestStateWaiting = 1, // On the wait queue - request has not been processed in any way. + kHCIRequestStateBusy = 2, // On the busy queue - request is sent and is currently processing +}; + + +//=========================================================================================================================== +// IOBluetoothHCIRequest +//=========================================================================================================================== + +class IOBluetoothHCIRequest : public OSObject +{ + OSDeclareDefaultStructors( IOBluetoothHCIRequest ) + + UInt8 mPrivateResultsBuffer[kMaxHCIBufferLength*4]; // Just in case they didn't give a results ptr. + IOByteCount mPrivateResultsSize; // Result size. + BluetoothHCITransportID mTransportID; // Transport ID to use for this request. + UInt8 mState; // Busy, waiting, idle. + bool mAsyncNotify; + task_t mOwningTaskID; + BluetoothHCIRequestCallbackInfo mCallbackInfo; // When this request is complete, call this. + BluetoothHCICommandOpCode mOpCode; + BluetoothDeviceAddress mDeviceAddress; + BluetoothConnectionHandle mConnectionHandle; + BluetoothHCINotificationMessage * mNotificationMessage; + IOByteCount mNotificationMessageSize; + + +public: + + IOBluetoothHCIRequest * mNextBusy; // Points to next request element on busy queue. + IOBluetoothHCIRequest * mNextWait; // Points to next request element on wait queue. + IOBluetoothHCIRequest * mNextAllocated; // Points to next allocated request element. + IOBluetoothHCIRequest * mPreviousAllocated; // Points to next allocated request element. + BluetoothHCIRequestID mID; // For internal identification. + UInt8 mCommandBuffer[kMaxHCIBufferLength]; // Built-up HCI Command to send to the transport. + IOByteCount mCommandBufferSize; // Size of command buffer. + + UInt8 * mResultsPtr; // Result ptr, provided by object creator. + IOByteCount mResultsSize; // Result size. + + IOCommandGate * mCommandGate; + IOTimerEventSource * mTimer; + IOBluetoothHCIController * mHCIController; + IOReturn mStatus; // Success/failure code of request. + UInt32 mTimeout; // Timeout for request to complete, in milliseconds. + UInt32 mControlFlags; + int mPID; // Creating Task + bool mHCIRequestDeleteWasCalled; // Fixed rdar://problem/7044168 + + +public: + + bool init( IOCommandGate *commandGate, IOBluetoothHCIController *hciController ); + void free(); + + static IOBluetoothHCIRequest * Create( IOCommandGate *commandGate, IOBluetoothHCIController *hciController, bool async = TRUE, UInt32 timeout = 5, UInt32 controlFlags = 0 ); + static IOReturn Dispose( IOBluetoothHCIRequest * inObject ); + + + // Called when a request is started on a transport, and completed. + + IOReturn Start(); + void Complete(); + + // Accessors for object members. + + void SetState( BluetoothHCIRequestState inState ); + BluetoothHCIRequestState GetState() { return( mState ); } + + void SetHCIStatus( BluetoothHCIStatus inStatus ) { mStatus = inStatus; } + BluetoothHCIStatus GetHCIStatus() { return( mStatus ); } + + void SetID( BluetoothHCIRequestID inID ) { mID = inID; } + BluetoothHCIRequestID GetID() { return( mID ); } + + void SetCallbackInfo( BluetoothHCIRequestCallbackInfo * inInfo ); + BluetoothHCIRequestCallbackInfo * GetCallbackInfo() { return( &mCallbackInfo ); } + + void SetOwningTaskID( task_t inTaskID ) { mOwningTaskID = inTaskID; } + task_t GetOwningTaskID() { return( mOwningTaskID ); } + + void * GetCommandBuffer(); + + BluetoothHCICommandOpCode GetCommandOpCode(); + void SetCommandOpCode( BluetoothHCICommandOpCode inOpCode ) { mOpCode = inOpCode; } + + BluetoothDeviceAddress * GetDeviceAddress() { return &mDeviceAddress; } + void SetDeviceAddress( const BluetoothDeviceAddress *inDeviceAddress ) { if ( inDeviceAddress != NULL ) memcpy( &mDeviceAddress, inDeviceAddress, sizeof( BluetoothDeviceAddress ) ); } + void ClearDeviceAddress() { bzero( &mDeviceAddress, sizeof( BluetoothDeviceAddress ) ); } + Boolean CompareDeviceAddress( const BluetoothDeviceAddress *inDeviceAddress ); + + BluetoothConnectionHandle GetConnectionHandle() { return mConnectionHandle; } + void SetConnectionHandle( BluetoothConnectionHandle inConnectionHandle ) { mConnectionHandle = inConnectionHandle; } + void ClearConnectionHandle() { mConnectionHandle = kBluetoothConnectionHandleNone; } + + void SetTimeout( UInt32 inTimeout ) { mTimeout = inTimeout; } // in milliseconds + UInt32 GetTimeout() { return( mTimeout ); } + + void StartTimer(); + + static void timerFired( OSObject *owner, IOTimerEventSource *sender ); + void handleTimeout(); + + void CopyDataIntoResultsPtr( UInt8 * inDataPtr, IOByteCount inSize ); + void SetParamPtrAndSize( UInt8 paramNumber, UInt8 * inParamPtr, IOByteCount inSize ); + + void SetResultsBufferPtrAndSize( UInt8 * resultsBuffer, IOByteCount inSize ); + void SetResultsDataSize( IOByteCount inCount ); + UInt8 * GetResultsBuffer(); + IOByteCount GetResultsBufferSize(); + + mach_vm_address_t GetNotificationRefCon() { return( mCallbackInfo.asyncIDRefCon ); } + + void SetDoAsyncNotify( bool inAsyncNotify ) { mAsyncNotify = inAsyncNotify; } + Boolean IsSynchronous() { return !mAsyncNotify; } + + void SetControlFlags( UInt32 controlFlags ) { mControlFlags = controlFlags; } + UInt32 GetControlFlags() { return mControlFlags; } + + const char * RequestDescription(); +}; diff --git a/i386/include/IOKit/bluetooth/IOBluetoothHIDDriver.h b/i386/include/IOKit/bluetooth/IOBluetoothHIDDriver.h new file mode 100644 index 0000000..b3bb449 --- /dev/null +++ b/i386/include/IOKit/bluetooth/IOBluetoothHIDDriver.h @@ -0,0 +1,230 @@ +/* + File: IOBluetoothHIDDriver.h + Contains: Driver for generic Bluetooth HID devices. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + +#ifndef IOBLUETOOTHHIDDRIVER_H +#define IOBLUETOOTHHIDDRIVER_H + +#include +#include + +//=========================================================================================================================== +// Forwards +//=========================================================================================================================== + +class IOTimerEventSource; +class IOWorkLoop; + +class IOBluetoothL2CAPChannel; +class IOBluetoothDevice; +class IOWorkQueue; + +//=========================================================================================================================== +// IOBluetoothHIDDriver +//=========================================================================================================================== + +class IOBluetoothHIDDriver : public IOHIDDevice +{ + OSDeclareDefaultStructors( IOBluetoothHIDDriver ) + + IOWorkLoop* _workLoop; + IOCommandGate* _commandGate; + + IOWorkQueue *_desyncWorkQueue; + + IOBluetoothL2CAPChannel* _controlChannel; + IOBluetoothL2CAPChannel* _interruptChannel; + + IOBluetoothDevice* _device; + + IOMemoryDescriptor* _memDescriptor; + IOMemoryDescriptor* _getReportDescriptor; + IONotifier* _interruptOpenNotification; + IOTimerEventSource* _timer; + IONotifier* _sleepWakeNotifier; + + bool _deviceReady; + + UInt8 _expectedReportID; + UInt8 _expectedReportType; + UInt8 _handshake; + + OSDictionary* _deviceProperties; + + UInt16 _vendorIDSource; + UInt16 _vendorID; + UInt16 _productID; + UInt16 _deviceVersion; + uint32_t _classOfDevice; + UInt16 _countryCode; + + BluetoothDeviceAddress _deviceAddress; + char _deviceAddressString[20]; + + uint32_t _outstandingIO; + bool _sendOutstanding; + + // Debug / Behavior Modifiers + UInt8 _verboseLevel; + bool _logPackets; + bool _decodePackets; + bool _logOutstandingIO; + bool _suppressDisconnectNotifications; + bool _suppressSetProtocol; + bool _driverIsAwake; + bool _reservedFlag4; + UInt8 _reservedByte; + + struct ExpansionData + { + OSArray* _sendQueue; + + uint8_t *interruptBuffer; + uint32_t interruptBufferUsed; + + uint8_t *controlBuffer; + uint32_t controlBufferUsed; + + uint8_t deviceSupportsSuspend; + + uint32_t getReportTimeoutMS; + uint32_t setReportTimeoutMS; + + uint32_t outstandingMemoryBlockCount; + bool waitingForMemoryBlockCount; + }; + ExpansionData *_expansionData; + +public: + // Standard IOService Methods + virtual IOService* probe( IOService * provider, SInt32 * score ); + virtual bool init( OSDictionary *properties ); + virtual void free(); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + + // Starting & Stopping + virtual bool handleStart( IOService * provider ); + virtual void handleStop( IOService * provider ); + virtual void deviceReady(); + virtual void closeDownServices(); + + // Power Management + virtual void handleSleep(); + virtual void handleWake(); + virtual void handleShutdown(); // Does nothing + virtual void handleRestart(); // Does nothing + + // HID Properties + virtual OSString* newTransportString() const; + virtual OSString* newManufacturerString() const; + virtual OSString* newProductString() const; + virtual OSNumber* newVendorIDSourceNumber() const; + virtual OSNumber* newVendorIDNumber() const; + virtual OSNumber* newProductIDNumber() const; + virtual OSNumber* newVersionNumber() const; + virtual IOReturn newReportDescriptor( IOMemoryDescriptor ** descriptor ) const; + virtual OSString* newSerialNumberString() const; + virtual OSNumber* newLocationIDNumber() const; + virtual OSNumber* newCountryCodeNumber() const; + virtual OSNumber* newReportIntervalNumber() const; + + // Main UserLand Entry Points + virtual IOReturn getReport( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options = 0 ); + virtual IOReturn setReport( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options = 0 ); + virtual IOReturn setProperties( OSObject* properties ); + + // General IO + virtual IOReturn sendData( IOBluetoothL2CAPChannel* theChannel, void* theData, IOByteCount theSize ); + virtual void processControlData( UInt8 *buffer, UInt16 length ); + virtual void processInterruptData( UInt8 *buffer, UInt16 length ); + virtual IOReturn waitForData( IOMemoryDescriptor* report, UInt8 btReportType, UInt8 reportID ); + virtual IOReturn waitForHandshake(); + + // HID Transaction Methods + virtual IOReturn hidControl( UInt8 controlOperation ); + virtual int getProtocol(); + virtual IOReturn setProtocol( UInt8 protocol ); + virtual int getIdle(); + virtual IOReturn setIdle( UInt8 idleRate ); + + // Device Introspection + virtual bool isKeyboard(); + virtual bool isMouse(); + + // Misc + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn createCommandGate( IOService* provider ); + virtual IOReturn getDeviceProperties( IOService* provider ); + virtual bool readDeviceName(); + + // Command Gate Actions + static IOReturn staticCloseDownServicesAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticSendToAction( OSObject* owner, void* theChannel, void* theData, void *theSize, void* ); + static IOReturn staticPrepControlChannelAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticPrepInterruptChannelAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticGetReportAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticSetReportAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticProcessCommandAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticGetDevicePropertiesAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticInterruptChannelOpeningAction( OSObject* owner, void* newService, void* arg2, void* arg3, void* arg4 ); + static IOReturn staticWillTerminateAction( OSObject* owner, void* arg1, void* arg2, void* arg3, void* arg4 ); + + // Work Loop Methods + virtual void closeDownServicesWL(); + virtual IOReturn prepInterruptChannelWL(); + virtual IOReturn getReportWL( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options ); + virtual IOReturn setReportWL( IOMemoryDescriptor* report, IOHIDReportType reportType, IOOptionBits options ); + virtual IOReturn processCommandWL( OSString* command, OSNumber* commandParameter ); + virtual IOReturn getDevicePropertiesWL( IOService* provider ); + virtual IOReturn interruptChannelOpeningWL( IOBluetoothL2CAPChannel* theChannel ); + + // Timeout Handler + static void timerFired( OSObject* owner, IOTimerEventSource* sender ); + virtual void handleTimeout(); + + // IO Counting + virtual void incrementOutstandingIO(); + virtual void decrementOutstandingIO(); + +private: + // Lazy Interrupt Channel Methods + static bool interruptChannelOpeningCallback( void* me, void* ignoreMe, IOService* newService, IONotifier *notifier ); + static IOReturn powerStateHandler( void *target, void *refCon, UInt32 messageType, IOService *service, void *messageArgument, vm_size_t argSize ); + +public: + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 0 ); + virtual void sendDeviceDisconnectNotifications( void ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 1 ); + virtual IOReturn setPowerStateWL( unsigned long powerStateOrdinal, IOService* whatDevice ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 2 ); + virtual void sendDeviceConnectNotifications( void ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 3 ); + virtual void decrementOutstandingMemoryBlockCount( void ); + + OSMetaClassDeclareReservedUsed( IOBluetoothHIDDriver, 4 ); + virtual IOReturn willTerminateWL( void ); + +public: + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 5 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 6 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 7 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 8 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 9 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 10 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 11 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 12 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 13 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 14 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 15 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 16 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 17 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 18 ); + OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 19 ); +}; + +#endif // IOBLUETOOTHHIDDRIVER_H diff --git a/i386/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h b/i386/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h new file mode 100644 index 0000000..8d722aa --- /dev/null +++ b/i386/include/IOKit/bluetooth/IOBluetoothHIDDriverTypes.h @@ -0,0 +1,61 @@ +/* + File: IOBluetoothHIDDriverTypes.h + Contains: Type defined for the IOBluetoothHIDDriver.h. + Copyright: (c) 2001-2008 by Apple, all rights reserved. +*/ + + +#ifndef IOBLUETOOTHHIDDRIVERTYPES_H +#define IOBLUETOOTHHIDDRIVERTYPES_H + +// Vendor ID Sources +//------------------ +#define kVendorIDSourceBluetoothSIG 0x1 +#define kVendorIDSourceUSBIF 0x2 + +// Bluetooth HID Transaction Headers +//---------------------------------- +#define IOBTHID_HANDSHAKE_HEADER 0x00 +#define IOBTHID_HID_CONTROL_HEADER 0x10 +#define IOBTHID_GET_REPORT_HEADER 0x40 +#define IOBTHID_SET_REPORT_HEADER 0x50 +#define IOBTHID_GET_PROTOCOL_HEADER 0x60 +#define IOBTHID_SET_PROTOCOL_HEADER 0x70 +#define IOBTHID_GET_IDLE_HEADER 0x80 +#define IOBTHID_SET_IDLE_HEADER 0x90 +#define IOBTHID_DATA_HEADER 0xA0 +#define IOBTHID_DATC_HEADER 0xB0 + +// Handshake Types +//---------------- +#define IOBTHID_HANDSHAKE_SUCCESSFUL 0x0 +#define IOBTHID_HANDSHAKE_NOT_READY 0x1 +#define IOBTHID_HANDSHAKE_INVALID_REPORT_ID 0x2 +#define IOBTHID_HANDSHAKE_UNSUPPORTED_REQUEST 0x3 +#define IOBTHID_HANDSHAKE_INVALID_PARAMETER 0x4 +#define IOBTHID_HANDSHAKE_ERR_UNKNOWN 0xE +#define IOBTHID_HANDSHAKE_ERR_FATAL 0xF + +// HID_Control Types +//------------------ +#define IOBTHID_CONTROL_NOP 0x0 +#define IOBTHID_CONTROL_HARD_RESET 0x1 +#define IOBTHID_CONTROL_SOFT_RESET 0x2 +#define IOBTHID_CONTROL_SUSPEND 0x3 +#define IOBTHID_CONTROL_EXIT_SUSPEND 0x4 +#define IOBTHID_CONTROL_VC_UNPLUG 0x5 + +// Protocol Types +//--------------- +#define IOBTHID_BOOT_PROTOCOL 0x0 +#define IOBTHID_REPORT_PROTOCOL 0x1 + +// Report Types +//------------- +#define IOBTHID_RESERVED_REPORT 0x0 +#define IOBTHID_OTHER_REPORT 0x0 +#define IOBTHID_INPUT_REPORT 0x1 +#define IOBTHID_OUTPUT_REPORT 0x2 +#define IOBTHID_FEATURE_REPORT 0x3 + +#endif // IOBLUETOOTHHIDDRIVERTYPES_H diff --git a/i386/include/IOKit/bluetooth/IOBluetoothInternal.h b/i386/include/IOKit/bluetooth/IOBluetoothInternal.h new file mode 100644 index 0000000..ed40a76 --- /dev/null +++ b/i386/include/IOKit/bluetooth/IOBluetoothInternal.h @@ -0,0 +1,103 @@ +/* + File: BluetoothInternal.h + Contains: Internal types and macros needed by public kernel APIs. + Copyright: 2003-2007 by Apple, Inc. All rights reserved. +*/ + +#pragma once + +typedef enum IOBluetoothHCIControllerConfigState +{ + kIOBluetoothHCIControllerConfigStateOnline = 0, // Controller is configured and ready for clients + kIOBluetoothHCIControllerConfigStateKernelSetupPending = 1, // New controller - kernel setup in progress + kIOBluetoothHCIControllerConfigStateDaemonSetupPending = 2, // New controller - daemon setup in progress + kIOBluetoothHCIControllerConfigStateDaemonSetupComplete = 3, // New controller - daemon setup complete + kIOBluetoothHCIControllerConfigStateResetPending = 4, // HCI reset has been issued + kIOBluetoothHCIControllerConfigStateKernelPostResetSetupPending = 5, // HCI reset complete - kernel setup in progress + kIOBluetoothHCIControllerConfigStateDaemonPostResetSetupPending = 6, // HCI reset complete - daemon setup in progress + kIOBluetoothHCIControllerConfigStateDaemonPostResetSetupComplete = 7, // HCI reset complete - daemon setup complete + kIOBluetoothHCIControllerConfigStateUninitialized = 8 +} IOBluetoothHCIControllerConfigState; + +typedef UInt32 IOBluetoothHCIControllerPowerOptions; +enum +{ + kIOBluetoothHCIControllerPowerOptionPowerOffSupported = 0x00000001, + kIOBluetoothHCIControllerPowerOptionWakeFromExistingConnectionSupported = 0x00000002, + kIOBluetoothHCIControllerPowerOptionWakeFromNewConnectionSupported = 0x00000004, + kIOBluetoothHCIControllerPowerOptionIdleWithConnectionSupported = 0x00000008, + kIOBluetoothHCIControllerPowerOptionIdleWhenInternalPower = 0x00000010 +}; + +enum IOBluetoothHCIControllerSleepOptions +{ + kIOBluetoothHCIControllerAllowWakeFromExistingConnection = 0x00000001, + kIOBluetoothHCIControllerAllowWakeFromNewConnection = 0x00000002, + kIOBluetoothHCIControllerTemporaryOnFromIdle = 0x00000004 +}; + +#define HCI_CONTROLLER_POWER_OFF_SUPPORTED( _controllerPowerOptions ) ( ( _controllerPowerOptions & kIOBluetoothHCIControllerPowerOptionPowerOffSupported ) == kIOBluetoothHCIControllerPowerOptionPowerOffSupported ) +#define HCI_CONTROLLER_SLEEP_SUPPORTED( _controllerPowerOptions ) \ + ( ( _controllerPowerOptions & \ + ( kIOBluetoothHCIControllerPowerOptionWakeFromExistingConnectionSupported | \ + kIOBluetoothHCIControllerPowerOptionWakeFromNewConnectionSupported ) ) != 0 ) + +typedef enum IOBluetoothHCIControllerInternalPowerState +{ + kIOBluetoothHCIControllerInternalPowerStateOff = 0, + kIOBluetoothHCIControllerInternalPowerStateOn = 1, + kIOBluetoothHCIControllerInternalPowerStateSleep = 2, + kIOBluetoothHCIControllerInternalPowerStateIdle = 3 +} IOBluetoothHCIControllerInternalPowerState; + +enum IOBluetoothHCIControllerPowerStateOrdinal +{ + kIOBluetoothHCIControllerPowerStateOrdinalOff = 0, + kIOBluetoothHCIControllerPowerStateOrdinalIdle = 1, + kIOBluetoothHCIControllerPowerStateOrdinalOn = 2 +}; + +typedef UInt32 IOBluetoothHCIControllerFeatureFlags; + +enum +{ + kIOBluetoothHCIControllerFeatureFlagVendorCommandFlowControl = 0x00000001, + kIOBluetoothHCIControllerFeatureFlagSCOSupported = 0x00000002, + kIOBluetoothHCIControllerFeatureFlagSerializeCommands = 0x10000000 +}; + +//=========================================================================================================================== +// Private_UnifiedInquiryResult +//=========================================================================================================================== + +typedef struct IOBluetoothHCIUnifiedInquiryResult IOBluetoothHCIUnifiedInquiryResult; +struct IOBluetoothHCIUnifiedInquiryResult +{ + BluetoothHCIInquiryResult originalInquiryResult; + + // event code will be either: + // kBluetoothHCIEventInquiryResult, kBluetoothHCIEventInquiryResultWithRSSI, or kBluetoothHCIEventExtendedInquiryResult + + BluetoothHCIEventCode eventCode; + + // kBluetoothHCIEventExtendedInquiryResult only + + BluetoothHCIExtendedInquiryResponse extendedInquiryResponse; + + // kBluetoothHCIEventExtendedInquiryResult or kBluetoothHCIEventInquiryResultWithRSSI only + + UInt8 reserved; + BluetoothHCIRSSIValue RSSIValue; +}; + +#if BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 + +enum BluetoothHCIExtendedInquiryResponseDataTypesAppleSpecificInfo +{ + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoReserved = 0x00, + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoModelIdentifier = 0x01, /* UTF8String char data */ + kBluetoothHCIExtendedInquiryResponseDataTypeAppleSpecificInfoThirdPartyAdvertising = 0x02, +}; + +#endif /* BLUETOOTH_VERSION_MAX_ALLOWED >= BLUETOOTH_VERSION_2_0 */ + diff --git a/i386/include/IOKit/bluetooth/IOBluetoothTypes.h b/i386/include/IOKit/bluetooth/IOBluetoothTypes.h new file mode 100644 index 0000000..07ee4c2 --- /dev/null +++ b/i386/include/IOKit/bluetooth/IOBluetoothTypes.h @@ -0,0 +1,23 @@ +/* + File: IOBluetoothTypes.h + Contains: Family provided types and defines - shared between user and kernel code. + Copyright: 2002-2007 by Apple Inc. All rights reserved. +*/ + +#pragma once + +#include + +// Error returns +#ifndef sub_iokit_bluetooth +#define sub_iokit_bluetooth err_sub(8) +#endif + +#define iokit_bluetooth_err(return) (sys_iokit|sub_iokit_bluetooth|return) + +#define kIOBluetoothDeviceResetError iokit_bluetooth_err(1) // Device reset interrupted pending operation +#define kIOBluetoothConnectionAlreadyExists iokit_bluetooth_err(2) // Attempting to open a connection that already exists +#define kIOBluetoothNoHCIController iokit_bluetooth_err(3) // No HCI controller is present +#define kIOBluetoothHCIPowerStatesNotSupported iokit_bluetooth_err(4) // HCI controller does not support changing power states + + diff --git a/i386/include/IOKit/firewire/.svn/all-wcprops b/i386/include/IOKit/firewire/.svn/all-wcprops new file mode 100644 index 0000000..9f21640 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/all-wcprops @@ -0,0 +1,197 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire +END +IOFWCommand.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWCommand.h +END +IOFireWireMultiIsochReceive.h +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireMultiIsochReceive.h +END +IOFWLocalIsochPort.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWLocalIsochPort.h +END +IOFireWirePowerManager.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWirePowerManager.h +END +IOFWSimpleContiguousPhysicalAddressSpace.h +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h +END +IOFireWireFamilyCommon.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireFamilyCommon.h +END +IOFWDCLProgram.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWDCLProgram.h +END +IOConfigDirectory.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOConfigDirectory.h +END +IOFireWireLocalNode.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireLocalNode.h +END +IOFWUtils.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWUtils.h +END +IOFWRegs.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWRegs.h +END +IOFWAddressSpace.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWAddressSpace.h +END +IOFWSyncer.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWSyncer.h +END +IOLocalConfigDirectory.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOLocalConfigDirectory.h +END +IOFWSimplePhysicalAddressSpace.h +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h +END +IORemoteConfigDirectory.h +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IORemoteConfigDirectory.h +END +IOFWIsochPort.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWIsochPort.h +END +IOFWDCLTranslator.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWDCLTranslator.h +END +IOFireWireUnit.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireUnit.h +END +IOFWPseudoAddressSpace.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWPseudoAddressSpace.h +END +IOFireWireController.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireController.h +END +IOFireWireNub.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireNub.h +END +IOFireWireBus.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireBus.h +END +IOFWDCLPool.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWDCLPool.h +END +IOFireWireIRMAllocation.h +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireIRMAllocation.h +END +IOFWUserObjectExporter.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWUserObjectExporter.h +END +IOFWIsochChannel.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWIsochChannel.h +END +IOFWPHYPacketListener.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWPHYPacketListener.h +END +IOFWPhysicalAddressSpace.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWPhysicalAddressSpace.h +END +IOFireWireDevice.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFireWireDevice.h +END +IOFWAsyncStreamListener.h +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWAsyncStreamListener.h +END +IOFWDCL.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/firewire/IOFWDCL.h +END diff --git a/i386/include/IOKit/firewire/.svn/entries b/i386/include/IOKit/firewire/.svn/entries new file mode 100644 index 0000000..9cb0f52 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/entries @@ -0,0 +1,1116 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/firewire +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOFWCommand.h +file + + + + +2013-08-27T23:54:20.000000Z +4483edd24969d415bf710715f89d8c80 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +28828 + +IOFireWireMultiIsochReceive.h +file + + + + +2013-08-27T23:54:20.000000Z +2392f7a4f60a6a09aa17f3de6979b8b0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5103 + +IOFWLocalIsochPort.h +file + + + + +2013-08-27T23:54:20.000000Z +9d1b2a8324e43e4eca74c6762f453521 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4139 + +IOFireWirePowerManager.h +file + + + + +2013-08-27T23:54:20.000000Z +7fa58e3356b90305ece63b5320eeeb4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2703 + +IOFWSimpleContiguousPhysicalAddressSpace.h +file + + + + +2013-08-27T23:54:20.000000Z +e621b41926b52af6991b5cee88afa121 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2530 + +IOFireWireFamilyCommon.h +file + + + + +2013-08-27T23:54:20.000000Z +848a3897047f83a70ac881174eec9587 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +37929 + +IOFWDCLProgram.h +file + + + + +2013-08-27T23:54:20.000000Z +2d21950404468e9eea6973d283fef820 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3972 + +IOConfigDirectory.h +file + + + + +2013-08-27T23:54:20.000000Z +9553c945c7ed9dc9574a9f01fc0c0656 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6973 + +IOFireWireLocalNode.h +file + + + + +2013-08-27T23:54:20.000000Z +c0d280376d79c060f5ace8672843618a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3911 + +IOFWUtils.h +file + + + + +2013-08-27T23:54:20.000000Z +b91a897b6ffef1e74747072ebbe49841 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +703 + +IOFWRegs.h +file + + + + +2013-08-27T23:54:20.000000Z +013e1705be510c590a8a7e5093746043 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3048 + +IOFWAddressSpace.h +file + + + + +2013-08-27T23:54:20.000000Z +ba229178d3b2476aaa7319bd86df6862 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11914 + +IOFWSyncer.h +file + + + + +2013-08-27T23:54:20.000000Z +701bc3b863567fb8f0e700068a36d920 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1688 + +IOLocalConfigDirectory.h +file + + + + +2013-08-27T23:54:20.000000Z +f413aeb168f7c471d13aadfdf5b63088 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3634 + +IOFWSimplePhysicalAddressSpace.h +file + + + + +2013-08-27T23:54:20.000000Z +8e6bd89074eba7399d0fdb9f1cf2e97d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2539 + +IORemoteConfigDirectory.h +file + + + + +2013-08-27T23:54:20.000000Z +4f2737a1e69bd4235b9ea9a962a6ccf3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2985 + +IOFWIsochPort.h +file + + + + +2013-08-27T23:54:20.000000Z +0eed5ebd23d210a931569d9845868ba8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2223 + +IOFWDCLTranslator.h +file + + + + +2013-08-27T23:54:20.000000Z +1048a12326744832a54899fdba596d47 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3282 + +IOFireWireUnit.h +file + + + + +2013-08-27T23:54:20.000000Z +742b093442aa19fca0ad7549e0d9b1bd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4712 + +IOFWPseudoAddressSpace.h +file + + + + +2013-08-27T23:54:20.000000Z +bb12e0ad86db84c8d722f1516a220142 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14158 + +IOFireWireController.h +file + + + + +2013-08-27T23:54:20.000000Z +c0aef67251938183438f688525a473b0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +36957 + +IOFireWireNub.h +file + + + + +2013-08-27T23:54:20.000000Z +3c0485979ff7683ef45e67879019f8a0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10032 + +IOFireWireBus.h +file + + + + +2013-08-27T23:54:20.000000Z +d33e259a5c481b64a4146fe3a26320f9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16486 + +IOFWDCLPool.h +file + + + + +2013-08-27T23:54:20.000000Z +5f8436d004874a034fd9241fc78d05ff +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4261 + +IOFireWireIRMAllocation.h +file + + + + +2013-08-27T23:54:20.000000Z +566959bbdd12fd3632a35552d6349499 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4200 + +IOFWUserObjectExporter.h +file + + + + +2013-08-27T23:54:20.000000Z +d53a5037c8843a9a2757346a8bc7fdb0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3370 + +IOFWIsochChannel.h +file + + + + +2013-08-27T23:54:20.000000Z +018e3dce44d3ec86cedd89f777766c48 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4250 + +IOFWPHYPacketListener.h +file + + + + +2013-08-27T23:54:20.000000Z +cb800cb0d85b68bfb6cfb7af5a1de10e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2626 + +IOFWPhysicalAddressSpace.h +file + + + + +2013-08-27T23:54:20.000000Z +9629cfbe3955dbf83e9e1975c22dde94 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9555 + +IOFireWireDevice.h +file + + + + +2013-08-27T23:54:20.000000Z +ccf6815842e2d7fe05afdc4968fa4515 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9891 + +IOFWAsyncStreamListener.h +file + + + + +2013-08-27T23:54:20.000000Z +7af64f98b347955333b8e4b6ab51c277 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4430 + +IOFWDCL.h +file + + + + +2013-08-27T23:54:20.000000Z +97acbd21fdaf71e185e206a24cf9f234 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8242 + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOConfigDirectory.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOConfigDirectory.h.svn-base new file mode 100644 index 0000000..d72ed21 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOConfigDirectory.h.svn-base @@ -0,0 +1,182 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOCONFIGDIRECTORY_H__ +#define __IOCONFIGDIRECTORY_H__ + +#include +#include + +#include + +class OSData; +class OSString; +class OSIterator; +class IOFireWireDevice; + +/*! @class IOConfigDirectory +*/ +class IOConfigDirectory : public OSObject +{ + OSDeclareAbstractStructors(IOConfigDirectory); + +protected: + int fStart; // Offset into ROM of start of this dir + int fType; // Directory type + int fNumEntries; // In directory + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithOffset(int start, int type); + + virtual const UInt32 *getBase() = 0; + virtual IOReturn createIterator(UInt32 testVal, UInt32 testMask, + OSIterator *&iterator); + virtual IOConfigDirectory *getSubDir(int start, int type) = 0; + +public: + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase) = 0; + + /*! + @function getKeyType + Gets the data type for the specified key + @param type on return, set to the data type + @result kIOReturnSuccess if the key exists in the dictionary + */ + virtual IOReturn getKeyType(int key, IOConfigKeyType &type); + /*! + @function getKeyValue + Gets the value for the specified key, in a variety of forms. + @param value on return, set to the data type + @param text if non-zero, on return points to the + string description of the field, or NULL if no text found. + @result kIOReturnSuccess if the key exists in the dictionary + and is of a type appropriate for the value parameter + @param value reference to variable to store the entry's value + */ + virtual IOReturn getKeyValue(int key, UInt32 &value, OSString** text = NULL); + virtual IOReturn getKeyValue(int key, OSData *&value, + OSString** text = NULL); + virtual IOReturn getKeyValue(int key, IOConfigDirectory *&value, + OSString** text = NULL); + virtual IOReturn getKeyOffset(int key, FWAddress &value, + OSString** text = NULL); + + + /*! + @function getIndexType + Gets the data type for entry at the specified index + @param type on return, set to the data type + @result kIOReturnSuccess if the index exists in the dictionary + */ + virtual IOReturn getIndexType(int index, IOConfigKeyType &type); + /*! + @function getIndexKey + Gets the key for entry at the specified index + @param key on return, set to the key + @result kIOReturnSuccess if the index exists in the dictionary + */ + virtual IOReturn getIndexKey(int index, int &key); + + /*! + @function getIndexValue + Gets the value at the specified index of the directory, + in a variety of forms. + @param type on return, set to the data type + @result kIOReturnSuccess if the index exists in the dictionary + and is of a type appropriate for the value parameter + @param value reference to variable to store the entry's value + */ + virtual IOReturn getIndexValue(int index, UInt32 &value); + virtual IOReturn getIndexValue(int index, OSData *&value); + virtual IOReturn getIndexValue(int index, OSString *&value); + virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value); + virtual IOReturn getIndexOffset(int index, FWAddress &value); + virtual IOReturn getIndexOffset(int index, UInt32 &value); + + /*! + @function getIndexEntry + Gets the entry at the specified index of the directory, + as a raw UInt32. + @param entry on return, set to the entry value + @result kIOReturnSuccess if the index exists in the dictionary + @param value reference to variable to store the entry's value + */ + virtual IOReturn getIndexEntry(int index, UInt32 &value); + + /*! + @function getSubdirectories + Creates an iterator over the subdirectories of the directory. + @param iterator on return, set to point to an OSIterator + @result kIOReturnSuccess if the iterator could be created + */ + virtual IOReturn getSubdirectories(OSIterator *&iterator); + + /*! + @function getKeySubdirectories + Creates an iterator over subdirectories of a given type of the directory. + @param key type of subdirectory to iterate over + @param iterator on return, set to point to an OSIterator + @result kIOReturnSuccess if the iterator could be created + */ + virtual IOReturn getKeySubdirectories(int key, OSIterator *&iterator); + + int getType() const; + + int getNumEntries() const; + +protected: + + virtual const UInt32 * lockData( void ) = 0; + virtual void unlockData( void ) = 0; + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ) = 0; + virtual IOReturn checkROMState( void ) = 0; + +private: + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 2); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 3); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 4); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 5); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 6); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 7); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 8); + +}; + +#endif /* __IOCONFIGDIRECTORY_H__ */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWAddressSpace.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWAddressSpace.h.svn-base new file mode 100644 index 0000000..7ad6764 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWAddressSpace.h.svn-base @@ -0,0 +1,331 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOFWAddressSpace.h + * + * Classes which describe addresses in the local node which are accessable to other nodes + * via firewire asynchronous read/write/lock requests. + */ + +#ifndef _IOKIT_IOFWADDRESSSPACE_H +#define _IOKIT_IOFWADDRESSSPACE_H + +#include +#include + +class IOFireWireDevice; +class IOFireWireBus; +class IOFireWireController; + +typedef void * IOFWRequestRefCon; + +/*! @function FWWriteCallback + @abstract Callback called when a write request packet is received for + a 'virtual' firewire address. + @param device is the node originating the request + @param speed is the FireWire speed of the request, update it if you need to control + the speed of the reply, otherwise the response will be the same speed. + @param addr is the address the device is requesting to write to + @param len is the number of bytes to write + @param buf contains the packet data + @param requestRefcon refcon Can be queried for extra info about the request, + using IOFireWireController::isLockRequest(), isQuadRequest() + @result return: + kFWResponseComplete = 0, OK + kFWResponseConflictError = 4, Resource conflict, may retry + kFWResponseDataError = 5, Data not available + kFWResponseTypeError = 6, Operation not supported + kFWResponseAddressError = 7 Address not valid in target device */ +typedef UInt32 (*FWWriteCallback)(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon requestRefcon); + +/*! @function FWReadCallback + @abstract Callback called when a read request packet is received for + a 'virtual' firewire address. + @param nodeID is the node originating the request + @param speed is the FireWire speed of the request, update it if you need to control + the speed of the reply, otherwise the response will be the same speed. + @param addr is the address the device is requesting to read from + @param len is the number of bytes to read + @param buf contains the packet data + @param offset on return points to the offset into *buf of the packet data + @param requestRefcon refcon to pass back if sending a delayed response. Also can be queried + for extra info about the request + @result return: + kFWResponsePending = -1, Pseudo response, real response sent later. + kFWResponseComplete = 0, OK! + kFWResponseConflictError = 4, Resource conflict, may retry + kFWResponseDataError = 5, Data not available + kFWResponseTypeError = 6, Operation not supported + kFWResponseAddressError = 7 Address not valid in target device + + A return of kFWResponsePending should be followed at some later time by a call to + IOFireWireController::asyncReadResponse */ +typedef UInt32 (*FWReadCallback)(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, IOMemoryDescriptor **buf, + IOByteCount * offset, IOFWRequestRefCon requestRefcon); + +class IOFWAddressSpace; + +#pragma mark - + +/*! @class IOFWAddressSpaceAux + @discussion An IOFWAddressSpaceAux is for internal use only. You should never subclass IOFWAddressSpaceAux +*/ + +class IOFWAddressSpaceAux : public OSObject +{ + OSDeclareDefaultStructors(IOFWAddressSpaceAux) + + friend class IOFWAddressSpace; + +protected: + + IOFWAddressSpace * fPrimary; + IOFireWireController * fControl; + + OSSet * fTrustedNodeSet; + OSIterator * fTrustedNodeSetIterator; + + bool fExclusive; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + + virtual bool isTrustedNode( UInt16 nodeID ); + virtual void addTrustedNode( IOFireWireDevice * device ); + virtual void removeTrustedNode( IOFireWireDevice * device ); + virtual void removeAllTrustedNodes( void ); + + bool isExclusive( void ); + void setExclusive( bool exclusive ); + + virtual bool intersects( IOFWAddressSpace * space ); + +private: + OSMetaClassDeclareReservedUsed(IOFWAddressSpaceAux, 0); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 9); + +}; + +#pragma mark - + +/* + * Base class for FireWire address space objects + */ + +/*! + @class IOFWAddressSpace +*/ + +class IOFWAddressSpace : public OSObject +{ + OSDeclareAbstractStructors(IOFWAddressSpace) + + friend class IOFWAddressSpaceAux; + +protected: + + IOFireWireController *fControl; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData + { + IOFWAddressSpaceAux * fAuxiliary; + }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * fIOFWAddressSpaceExpansion; + + virtual bool init(IOFireWireBus *bus); + virtual void free(); + +public: + + /*! @function doRead + @abstract An abstract method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, + IOFWRequestRefCon refcon) = 0; + + /*! @function doWrite + @abstract An abstract method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon) = 0; + + /*! @function doLock + @abstract A method for processing a lock request. + @param nodeID FireWire Lock request for nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param inlen 'inlen' bytes to use. + @param newVal new value to write at 'addr' location . + @param outLen 'outLen' bytes for result. + @param oldVal old value read from 'addr' location. + @param extType Type like kFWExtendedTCodeCompareSwap. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doLock(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 inlen, + const UInt32 *newVal, UInt32 &outLen, UInt32 *oldVal, + UInt32 extType, IOFWRequestRefCon refcon); + + /*! @function activate + @abstract Address space is ready for handling requests. + @result IOReturn + */ + virtual IOReturn activate(); + + /*! @function deactivate + @abstract Address space request handler is disabled. + @result none + */ + virtual void deactivate(); + + /*! @function contains + @abstract returns number of bytes starting at addr in this space + @result 0 if it doesn't contain the address + */ + virtual UInt32 contains(FWAddress addr); + + /*! @function isTrustedNode + @abstract returns true if the node is added as a trusted node + @param nodeID is the nodeID to verify whether its trusted. + @result false if nodeID is not trusted + */ + inline bool isTrustedNode( UInt16 nodeID ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->isTrustedNode( nodeID ); } + + /*! @function addTrustedNode + @abstract Add a trusted node. + @param device object pointing to a FireWire node on the bus. + @result none + */ + inline void addTrustedNode( IOFireWireDevice * device ) + { fIOFWAddressSpaceExpansion->fAuxiliary->addTrustedNode( device ); } + + /*! @function removeTrustedNode + @abstract Remove a trusted node. + @param device object pointing to a FireWire node on the bus. + @result none + */ + inline void removeTrustedNode( IOFireWireDevice * device ) + { fIOFWAddressSpaceExpansion->fAuxiliary->removeTrustedNode( device ); } + + /*! @function removeAllTrustedNodes + @abstract Remove all trusted nodes. + @result none + */ + inline void removeAllTrustedNodes( void ) + { fIOFWAddressSpaceExpansion->fAuxiliary->removeAllTrustedNodes(); } + + /*! @function isExclusive + @abstract Checks if an address space wants exclusive control of its address range + @result True if the address space is marked exclusive false otherwise + */ + + inline bool isExclusive( void ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->isExclusive(); } + + /*! @function setExclusive + @abstract Sets if this address space requires exclusive control of its address range. Exclusivity should be set before an address space is activated. + @param exclusive True if address space should be exclusive, false otherwise + @result none + */ + + inline void setExclusive( bool exclusive ) + { fIOFWAddressSpaceExpansion->fAuxiliary->setExclusive( exclusive ); } + + /*! @function intersects + @abstract Checks this address space intersects with the given address range. Currently only supports IOFWPsuedoAddressSpaces. + @param space An address space to compare against + @result True if the address spaces intersect false otherwise + */ + + inline bool intersects( IOFWAddressSpace * space ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->intersects( space ); } + + +protected: + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +private: + OSMetaClassDeclareReservedUsed(IOFWAddressSpace, 0); + OSMetaClassDeclareReservedUsed(IOFWAddressSpace, 1); + +}; + +// the physical and psuedo address space classes used to be defined here +// for backwards compatibility, we pull them in now. the ifdefs surrounding +// the content of the header files ensures we do not multiply include a header. + +#include +#include + +#endif /* _IOKIT_IOFWADDRESSSPACE */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWAsyncStreamListener.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWAsyncStreamListener.h.svn-base new file mode 100644 index 0000000..cef64f8 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWAsyncStreamListener.h.svn-base @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFWASYNCSTREAMLISTENER_H +#define _IOKIT_IOFWASYNCSTREAMLISTENER_H + +#include +#include +#include +#include + +class IOFWAsyncStreamReceiver; +class IOFWAsyncStreamReceivePort; + +/*! @class IOFWAsyncStreamListener +*/ +class IOFWAsyncStreamListener : public OSObject +{ + OSDeclareDefaultStructors(IOFWAsyncStreamListener) + +friend class IOFWAsyncStreamReceiver; +friend class IOFireWireController; + +public: + +/*! @function initAll + @abstract Creates an AsyncStream client for an Isoch channel. + @param control Points to IOFireWireController. + @param channel Isoch channel for listening. + @param proc Callback on packet reception. + @param obj Client's callback object. + @result returns true on success, else false. */ + bool initAll( IOFireWireController *control, UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + +/*! @function setListenerHandler + @abstract Set the callback that should be called to handle incoming async stream packets + @param inReceiver The callback to set. + @result Returns the callback that was previously set or nil for none.*/ + const FWAsyncStreamReceiveCallback setListenerHandler( FWAsyncStreamReceiveCallback inReceiver ); + +/*! @function TurnOffNotification + @abstract Turns off client callback notification. + @result none. */ + inline void TurnOffNotification() { fNotify = false; }; + +/*! @function TurnOnNotification + @abstract Turns on client callback notification. + @result none. */ + inline void TurnOnNotification() { fNotify = true; }; + +/*! @function IsNotificationOn + @abstract checks the notification state. + @result true if ON, else false */ + inline bool IsNotificationOn() { return fNotify; }; + +/*! @function setFlags + @abstract set flags for the listener. + @param flags indicate performance metrics. + @result none. */ + void setFlags( UInt32 flags ); + +/*! @function getFlags + @abstract get the flags of listener. + @param none. + @result flags. */ + UInt32 getFlags(); + +/*! @function getRefCon + @abstract get the refcon specific to this listener. + @param none. + @result fRefCon refcon passed during initialization. */ + inline void* getRefCon() { return fRefCon; }; + +/*! @function getOverrunCounter + @abstract get overrun counter from the DCL program. + @param none. + @result returns the counter value. */ + UInt32 getOverrunCounter(); + +protected: + + FWAsyncStreamReceiveCallback fClientProc; + void *fRefCon; + IOFWAsyncStreamReceiver *fReceiver; + bool fNotify; + UInt32 fFlags; + IOFireWireController *fControl; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual void free(); + +private: +/*! function getReceiver + abstract Returns the Async Stream receiver object which tracks multiple + IOFWAsyncStreamListeners for the same Isoc channel. */ + inline IOFWAsyncStreamReceiver *getReceiver() { return fReceiver; }; + +/*! function invokeClients + abstract Invokes client's callback function with fRefCon. */ + void invokeClients( UInt8 *buffer ); + + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 1); +}; +#endif // _IOKIT_IOFWASYNCSTREAMLISTENER_H + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWCommand.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWCommand.h.svn-base new file mode 100644 index 0000000..fdf85b5 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWCommand.h.svn-base @@ -0,0 +1,977 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFWCommand.h + * + */ +#ifndef _IOKIT_IOFWCOMMAND_H +#define _IOKIT_IOFWCOMMAND_H + +#include +#include + +#include + +#include + +#define kFWCmdDefaultRetries 3 +#define kFWCmdZeroRetries 0 +#define kFWCmdReducedRetries 2 +#define kFWCmdIncreasedRetries 6 + +class IOMemoryDescriptor; +class IOSyncer; +class IOFireWireBus; +class IOFireWireController; +class IOFireWireNub; +class IOFWAddressSpace; // Description of chunk of local FW address space +class IOFWCommand; +class IOFWBusCommand; +class IOFWAsyncStreamCommand; +class IOCommandGate; +class IOFWAsyncPHYCommand; + +struct AsyncPendingTrans; + +// Struct for head of command queue +/*! + @struct IOFWCmdQ + @abstract Structure for head of a queue of IOFWCommands + @field fHead Points to the head of the queue, or NULL if queue is empty + @field fTail Points to the tail of the queue, or NULL if queue is empty + @function headChanged called when head command is changed, or the command + itself changes state. +*/ + +struct IOFWCmdQ +{ + IOFWCommand *fHead; + IOFWCommand *fTail; + bool executeQueue(bool all); + virtual void headChanged(IOFWCommand *oldHead); + + virtual ~IOFWCmdQ() {} + + void checkProgress( void ); +}; + +// Callback when device command completes asynchronously +typedef void (*FWDeviceCallback)(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + +// Callback when bus command completes asynchronously +typedef void (*FWBusCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +// Callback when async stream command completes asynchronously +typedef void (*FWAsyncStreamCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWAsyncStreamCommand *fwCmd); + +// Callback when async stream command completes asynchronously +typedef void (*FWAsyncPHYCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWAsyncPHYCommand *fwCmd ); + +// Callback when async stream packet is received +typedef void (*FWAsyncStreamReceiveCallback)(void *refcon, const void *buf); + +#pragma mark - + +/* + * Base class for FireWire commands + */ +/*! @class IOFWCommand +*/ +class IOFWCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOFWCommand) + +protected: + IOReturn fStatus; + IOFireWireController *fControl; + IOFWCommand * fQueuePrev; + IOFWCommand * fQueueNext; + IOFWCmdQ * fQueue; + UInt32 fTimeout; // How long (in microsecs) after execute() to timeout + AbsoluteTime fDeadline; // Time after which this command has timed out. + IOFWSyncer * fSyncWakeup; + UInt8 fSync; + UInt8 fCancelOnReset; + UInt8 spare[2]; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct MemberVariables + { + void * fFWIMRefCon; + IOReturn fCompletionStatus; + bool fSubmitTimeLatched; + AbsoluteTime fSubmitTime; + bool fFlush; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + MemberVariables * fMembers; + + virtual IOReturn complete(IOReturn status); + virtual void updateTimer(); + virtual IOReturn startExecution(); + + /* + * Execute the FWCommand immediately + * must be called with the workloop gate closed + */ + virtual IOReturn execute() = 0; + +public: + + virtual bool initWithController(IOFireWireController *control); + virtual void free( void ); + + IOReturn getStatus() const { return fStatus; }; + + /* + * Submit the FWCommand. + * if queue is false the command's execute() + * method will be called on the caller's thread, otherwise + * the command wil be queued for execution on the work loop thread. + */ + virtual IOReturn submit(bool queue = false); + + /* + * Cancel command, causes it to complete with given status + */ + virtual IOReturn cancel(IOReturn reason); + + /*! + @function setHead + inserts a command at the head of a queue. + @param queue queue command is being added to + */ + virtual void setHead(IOFWCmdQ &queue); + /*! + @function insertAfter + inserts a command after the specified one. + @param prev command to insert after + @param queue queue command is being added to + */ + virtual void insertAfter(IOFWCommand &prev); + + /*! + @function removeFromQ + Removes command from current queue. + */ + virtual void removeFromQ(); + + IOFWCommand *getPrevious() const + { return fQueuePrev; }; + IOFWCommand *getNext() const + { return fQueueNext; }; + const AbsoluteTime &getDeadline() const + { return fDeadline; }; + + bool cancelOnReset() const + { return fCancelOnReset; }; + + bool Busy() const + { return fStatus == kIOReturnBusy || fStatus == kIOFireWirePending;}; + + void setTimeout( UInt32 timeout ) + { fTimeout = timeout; }; + + friend class IOFWCmdQ; + + void * getFWIMRefCon( void ) + { + return fMembers->fFWIMRefCon; + } + + void setFWIMRefCon( void * refcon ) + { + fMembers->fFWIMRefCon = refcon; + } + + void setFlush( bool flush ) + { + fMembers->fFlush = flush; + } + + virtual IOReturn checkProgress( void ); + +private: + OSMetaClassDeclareReservedUsed(IOFWCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWCommand, 1); + +}; + +#pragma mark - + +/* + * Bus control commands + */ +/*! @class IOFWBusCommand +*/ +class IOFWBusCommand : public IOFWCommand +{ + OSDeclareAbstractStructors(IOFWBusCommand) + +protected: + FWBusCallback fComplete; + void * fRefCon; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual IOReturn complete(IOReturn status); + + virtual bool initWithController(IOFireWireController *control, + FWBusCallback completion=NULL, void *refcon=NULL); + virtual IOReturn reinit(FWBusCallback completion, void *refcon); + +private: + OSMetaClassDeclareReservedUnused(IOFWBusCommand, 0); + +}; + +#pragma mark - + +/* + * Command to execute some code after a specified delay (in microseconds) + * All it does is timeout after the specified delay, hence calling the completion + * callback. + */ +/*! @class IOFWDelayCommand +*/ +class IOFWDelayCommand : public IOFWBusCommand +{ + OSDeclareDefaultStructors(IOFWDelayCommand) + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +protected: + virtual IOReturn execute(); + +public: + virtual bool initWithDelay(IOFireWireController *control, UInt32 uSecs, + FWBusCallback completion, void *refcon); + virtual IOReturn reinit(UInt32 uSecs, FWBusCallback completion, void *refcon); + +private: + OSMetaClassDeclareReservedUnused(IOFWDelayCommand, 0); + +}; + +/* + * Send an async request to a device + */ +class IOFWUserReadQuadletCommand ; +class IOFWUserWriteCommand ; + +#pragma mark - + +/*! @class IOFWAsyncCommand +*/ +class IOFWAsyncCommand : public IOFWCommand +{ + OSDeclareAbstractStructors(IOFWAsyncCommand) + +protected: + IOFireWireNub * fDevice; + FWDeviceCallback fComplete; + void * fRefCon; + IOMemoryDescriptor *fMemDesc; + AsyncPendingTrans * fTrans; + UInt32 fAddressHi; + UInt32 fAddressLo; + IOByteCount fBytesTransferred; + int fSize; + int fSpeed; + int fMaxPack; + int fCurRetries; + int fMaxRetries; + UInt32 fGeneration; // bus topology fNodeID is valid for. + UInt16 fNodeID; + bool fFailOnReset; + bool fWrite; + + typedef struct + { + // some of our subclasses didn't have room for expansion data, so + // we've reserved space for their use here. + + void * fSubclassMembers; + int fMaxSpeed; + int fAckCode; + UInt32 fResponseCode; + UInt32 fFastRetryCount; + int fResponseSpeed; + bool fForceBlockRequests; + } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete(IOReturn status); + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + virtual void free( void ); + virtual IOReturn reinit(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + bool createMemberVariables( void ); + void destroyMemberVariables( void ); +public: + // Utility for setting generation on newly created command + virtual void setGeneration(UInt32 generation) + { fGeneration = generation; } + + // To be called by IOFireWireController and derived classes. + virtual void gotPacket(int rcode, const void* data, int size) = 0; + virtual void gotAck(int ackCode); + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + // explicitly update nodeID/generation after bus reset + IOReturn updateNodeID(UInt32 generation, UInt16 nodeID); + + // Generally useful stuff + IOByteCount getBytesTransferred() const + { return fBytesTransferred; }; + + FWAddress getAddress() const + { return FWAddress(fAddressHi, fAddressLo, fNodeID); } + + bool failOnReset() const + { return fFailOnReset; } + + IOFireWireNub * getDevice() const + { return fDevice; } + + /*! + @function setMaxPacket + Sets the maximum size for block transfers used by the command. + The command is initialized to use the maximum packet size calculated from the device's + PHY speed, bus info block and the bus topology. + Call this method before calling submit(). + @param maxBytes Maximum packet size in bytes. If the maxsize is 4 then quadlet transfers will be used. + */ + IOReturn setMaxPacket(UInt32 maxBytes) + { + if(fStatus == kIOReturnBusy || fStatus == kIOFireWirePending) + return fStatus; + fMaxPack = maxBytes; + return kIOReturnSuccess; + } + + void setMaxSpeed( int speed ); + + void setAckCode( int ack ); + int getAckCode( void ); + + void setRetries( int retries); + int getMaxRetries( void ); + + void setResponseCode( UInt32 rcode ); + UInt32 getResponseCode( void ) const; + + void setFastRetryCount( UInt32 count ) + { fMembers->fFastRetryCount = count; }; + + UInt32 getFastRetryCount( void ) + { return fMembers->fFastRetryCount; }; + + void setResponseSpeed( int speed ) + { fMembers->fResponseSpeed = speed; }; + + int getResponseSpeed( void ) + { return fMembers->fResponseSpeed; }; + + // forces even 4 byte transactions to be block requests + void setForceBlockRequests( bool enabled ) + { fMembers->fForceBlockRequests = enabled; } + + virtual IOReturn checkProgress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 3); + +}; + +#pragma mark - + +/* + * Concrete async requests - read, write and hordes of read/modify/write + */ +class IOFWReadCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWReadCommand) + +protected: + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + virtual IOReturn reinit(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL); + +private: + OSMetaClassDeclareReservedUnused(IOFWReadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWReadCommand, 1); +}; + +#pragma mark - + +/*! + @class IOFWReadQuadCommand + @discussion An easier to use version of IOFWReadCommand for use when the data to be transferred + is an integer number of quads. + Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) + is called. +*/ + +class IOFWReadQuadCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWReadQuadCommand) + +protected: + + UInt32 * fQuads; + + typedef struct + { + bool fPingTime; + } + MemberVariables; + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + virtual void free( void ); + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + UInt32 *quads, int numQuads, + FWDeviceCallback completion, void *refcon, bool failOnReset); + + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + UInt32 *quads, int numQuads, + FWDeviceCallback completion, void *refcon); + + virtual IOReturn reinit(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL); + + void setPingTime( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fPingTime = state; }; + +private: + OSMetaClassDeclareReservedUnused(IOFWReadQuadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWReadQuadCommand, 1); +}; + +#pragma mark - + +class IOFWWriteCommand : public IOFWAsyncCommand +{ + + OSDeclareDefaultStructors(IOFWWriteCommand) + +protected: + + int fPackSize; + + typedef struct + { + bool fDeferredNotify; + bool fFastRetryOnBusy; + } + MemberVariables; + + virtual IOReturn execute(); + + virtual void gotPacket( int rcode, const void* data, int size ); + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + +public: + + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll( IOFireWireNub * device, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion, + void * refcon, + bool failOnReset ); + + virtual bool initAll( IOFireWireController * control, + UInt32 generation, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion, + void * refcon ); + virtual void free( void ); + + virtual IOReturn reinit( FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion = NULL, + void * refcon = NULL, + bool failOnReset = false ); + + virtual IOReturn reinit( UInt32 generation, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion = NULL, + void * refcon = NULL ); + + void setDeferredNotify( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fDeferredNotify = state; }; + + void setFastRetryOnBusy( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fFastRetryOnBusy = state; }; + +private: + + OSMetaClassDeclareReservedUnused(IOFWWriteCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWWriteCommand, 1); + +}; + +#pragma mark - + +/*! + @class IOFWWriteQuadCommand + @discussion An easier to use version of IOFWWriteCommand for use when the data to be transferred + is small and an integer number of quads. + Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) + is called. + kMaxWriteQuads is the largest legal number of quads that this object can be asked to transfer + (the data is copied into an internal buffer in init() and reinit()). +*/ + +class IOFWWriteQuadCommand : public IOFWAsyncCommand +{ + + OSDeclareDefaultStructors(IOFWWriteQuadCommand) + +public: + + enum + { + kMaxWriteQuads = 8 + }; + +protected: + + UInt32 fQuads[kMaxWriteQuads]; + UInt32 * fQPtr; + int fPackSize; + + typedef struct + { + bool fDeferredNotify; + IOMemoryDescriptor * fMemory; + } + MemberVariables; + + virtual void gotPacket( int rcode, const void* data, int size ); + + virtual IOReturn execute(); + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + +public: + virtual bool initWithController(IOFireWireController *control); + + virtual bool initAll( IOFireWireNub * device, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion, + void * refcon, + bool failOnReset ); + + virtual bool initAll( IOFireWireController * control, + UInt32 generation, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion, + void * refcon ); + + virtual void free( void ); + + virtual IOReturn reinit( FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion = NULL, + void * refcon = NULL, + bool failOnReset = false ); + + virtual IOReturn reinit( UInt32 generation, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion = NULL, + void * refcon = NULL ); + +protected: + + void setQuads( UInt32 * quads, int numQuads ); + bool createMemoryDescriptor( void ); + void destroyMemoryDescriptor( void ); + +public: + + void setDeferredNotify( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fDeferredNotify = state; }; + +private: + + OSMetaClassDeclareReservedUnused(IOFWWriteQuadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWWriteQuadCommand, 1); + +}; + +/* + * May need more parameters for some of these, + * and/or derive from a base Lock transaction command + */ + +#pragma mark - + +/*! @class IOFWCompareAndSwapCommand +*/ +class IOFWCompareAndSwapCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWCompareAndSwapCommand) + +protected: + UInt32 fInputVals[4]; + UInt32 fOldVal[2]; + + typedef struct + { + IOMemoryDescriptor * fMemory; + } + MemberVariables; + + MemberVariables * fMembers; + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + // Compare to cmpVal, and if equal replace with newVal. + // Size = 1 for 32 bit operation (one quad), 2 for 64 bit (two quads) + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion, void *refcon); + + virtual IOReturn reinit(FWAddress devAddress, const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL, bool failOnReset=false); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL); + + // sets oldVal to the old value returned by the device, and + // returns true if it was the expected value, ie. the lock succeeded + virtual bool locked(UInt32 *oldVal); + + virtual void free( void ); + +protected: + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + + void setInputVals( const UInt32 * cmpVal, const UInt32 * newVal, int size ); + + bool createMemoryDescriptor( void ); + void destroyMemoryDescriptor( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 3); + +}; + +/* + * Send an async stream packet + */ + +#pragma mark - + +/*! @class IOFWAsyncStreamCommand +*/ +class IOFWAsyncStreamCommand : public IOFWCommand +{ + // temporary for debugging: + friend class IOFireWireUserClient ; + + OSDeclareDefaultStructors(IOFWAsyncStreamCommand) + +protected: + FWAsyncStreamCallback fComplete; + void * fRefCon; + IOMemoryDescriptor * fMemDesc; + int fSpeed; + int fSize; + int fCurRetries; + int fMaxRetries; + int fChannel; + int fSyncBits; + int fTag; + UInt32 fGeneration; // bus topology fNodeID is valid for. + bool fFailOnReset; + + typedef struct + { } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete( + IOReturn status); + + // To be called by IOFireWireController and derived classes. + virtual IOReturn execute(); + +public: + + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon); + + virtual void free( void ); + + virtual IOReturn reinit( UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon); + + virtual void gotAck( + int ackCode); + // Utility for setting generation on newly created command + virtual void setGeneration( + UInt32 generation) + { fGeneration = generation; } + + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + + bool failOnReset() const + { return fFailOnReset; } + +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamCommand, 1); + +public: + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon, + bool failOnReset ); + + + virtual IOReturn reinit( + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon, + bool failOnReset); + + +}; + +/* + * Send an async PHY packet + */ + +#pragma mark - + +/*! @class IOFWAsyncPHYCommand +*/ +class IOFWAsyncPHYCommand : public IOFWCommand +{ + // temporary for debugging: + friend class IOFireWireUserClient; + + OSDeclareDefaultStructors( IOFWAsyncPHYCommand ) + +protected: + AsyncPendingTrans * fTrans; + FWAsyncPHYCallback fComplete; + void * fRefCon; + int fCurRetries; + int fMaxRetries; + UInt32 fGeneration; + bool fFailOnReset; + UInt32 fData1; + UInt32 fData2; + int fAckCode; + UInt32 fResponseCode; + + typedef struct + { } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete( + IOReturn status ); + + // To be called by IOFireWireController and derived classes. + virtual IOReturn execute(); + + void setResponseCode( UInt32 rcode ); + void setAckCode( int ack ); + +public: + + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + virtual void free( void ); + + virtual IOReturn reinit( UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + + virtual void gotAck( + int ackCode ); + + // Utility for setting generation on newly created command + virtual void setGeneration( + UInt32 generation ) + { fGeneration = generation; } + + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + + bool failOnReset() const + { return fFailOnReset; } + + + virtual void gotPacket( int rcode ); + + int getAckCode( void ); + UInt32 getResponseCode( void ) const; + + void setRetries( int retries); +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 3); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 4); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 5); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 6); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 7); +}; + +#endif /* _IOKIT_IOFWCOMMAND_H */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWDCL.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCL.h.svn-base new file mode 100644 index 0000000..8919485 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCL.h.svn-base @@ -0,0 +1,346 @@ +/* +* IOFWDCL.h +* IOFireWireFamily +* +* Created by Niels on Fri Feb 21 2003. +* Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +* +* $Log: IOFWDCL.h,v $ +* Revision 1.20 2008/11/14 00:17:11 arulchan +* fix for rdar://5939334 +* +* Revision 1.19 2007/03/14 01:01:12 collin +* *** empty log message *** +* +* Revision 1.18 2007/01/26 23:42:19 ayanowit +* another fix for nuDCL rosetta mode +* +* Revision 1.17 2006/08/16 01:41:41 collin +* *** empty log message *** +* +* Revision 1.16 2006/03/09 22:26:46 niels +* fix 4466075 +* +* Revision 1.15 2006/03/09 22:20:14 niels +* fix 4466075 +* +* Revision 1.14 2006/03/09 21:40:44 niels +* fix 4466075 +* +* Revision 1.13 2006/02/09 00:21:50 niels +* merge chardonnay branch to tot +* +* Revision 1.12.4.1 2005/08/06 01:31:31 collin +* *** empty log message *** +* +* Revision 1.12 2005/02/18 03:19:03 niels +* fix isight +* +* Revision 1.11 2004/04/19 21:51:49 niels +* *** empty log message *** +* +* Revision 1.10 2004/03/25 00:00:23 niels +* fix panic allocating large physical address spaces +* +* Revision 1.9 2003/10/31 02:40:58 niels +* *** empty log message *** +* +* Revision 1.8 2003/08/26 05:11:21 niels +* *** empty log message *** +* +* Revision 1.7 2003/08/25 08:39:15 niels +* *** empty log message *** +* +* Revision 1.6 2003/08/18 23:18:14 niels +* *** empty log message *** +* +* Revision 1.5 2003/08/08 22:30:32 niels +* *** empty log message *** +* +* Revision 1.4 2003/07/30 05:22:14 niels +* *** empty log message *** +* +* Revision 1.3 2003/07/29 22:49:22 niels +* *** empty log message *** +* +* Revision 1.2 2003/07/21 06:52:58 niels +* merge isoch to TOT +* +* Revision 1.1.2.5 2003/07/18 00:17:41 niels +* *** empty log message *** +* +* Revision 1.1.2.4 2003/07/14 22:08:53 niels +* *** empty log message *** +* +* Revision 1.1.2.3 2003/07/11 18:15:33 niels +* *** empty log message *** +* +* Revision 1.1.2.2 2003/07/03 22:10:24 niels +* fix iidc/dv rcv +* +* Revision 1.1.2.1 2003/07/01 20:54:06 niels +* isoch merge +* +*/ + +#import + +#import +#import +#import + +class IODCLProgram ; +class OSIterator ; +class IOFireWireLink ; +class IOMemoryMap ; + +/*! @class IOFWDCL +*/ + +class IOFWDCL : public OSObject +{ + OSDeclareAbstractStructors( IOFWDCL ) ; + + public: + + typedef void (*Callback)( void * refcon ) ; + + enum + { + kDynamic = BIT(1)//kNuDCLDynamic, + ,kUpdateBeforeCallback = BIT(2)//kNuDCLUpdateBeforeCallback + ,kUser = BIT(18) // kNuDCLUser + ,kBigEndianUpdates = BIT(19) // NOTE: Don't change this without making similar change to IOFireWireLib's NuDCL::Export(...)! + } ; + + class InternalData + { + public: + + IOFWDCL * lastBranch ; + } ; + + protected: + + IOFWDCL* fBranch ; + Callback fCallback ; + volatile UInt32 * fTimeStampPtr ; + UInt32 fRangeCount ; + IOVirtualRange * fRanges ; + OSSet* fUpdateList ; + OSIterator * fUpdateIterator ; + volatile UInt32 * fUserStatusPtr ; + void* fRefcon ; + UInt32 fFlags ; + + InternalData * fLoLevel ; + + public: + + // + // IOFWDCL public API: + // + + virtual bool initWithRanges ( + OSSet * updateSet, + unsigned rangesCount = 0, + IOVirtualRange ranges [] = NULL ) ; + + void setBranch( IOFWDCL* branch ) ; + IOFWDCL* getBranch() const ; + void setTimeStampPtr ( UInt32* timeStampPtr ) ; + UInt32* getTimeStampPtr () const ; + void setCallback( Callback callback ) ; + Callback getCallback() const ; + void setStatusPtr( UInt32* statusPtr ) ; + UInt32* getStatusPtr() const ; + void setRefcon( void * refcon ) ; + void * getRefcon() const ; + const OSSet* getUpdateList() const ; + + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + virtual UInt32 getRanges( UInt32 maxRanges, IOVirtualRange ranges[] ) const ; + virtual UInt32 countRanges() ; + virtual IOReturn getSpan( IOVirtualRange& result ) const ; + virtual IOByteCount getSize() const ; + IOReturn appendUpdateList( IOFWDCL* updateDCL ) ; + IOReturn setUpdateList( OSSet* updateList ) ; + void emptyUpdateList() ; + void setFlags( UInt32 flags ) ; + UInt32 getFlags() const ; + + + virtual void update() = 0 ; + + // OSObject + + virtual void free () ; + + public: + + // + // internal use only; please don't use... + // + + virtual IOReturn compile( IODCLProgram & , bool & ) = 0 ; + virtual void link () = 0 ; + + OSMetaClassDeclareReservedUnused ( IOFWDCL, 4 ) ; // used to be relink() + + public : + virtual bool interrupt( bool &, IOFWDCL * & ) = 0 ; + virtual void finalize ( IODCLProgram & ) ; + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + + protected : + + friend class IOFWDCLFriend ; + + public : + + // dump DCL info... + virtual void debug() ; + + public: + + // + // internal use only; please don't use... + // + + virtual bool checkForInterrupt() = 0 ; + + OSMetaClassDeclareReservedUsed ( IOFWDCL, 0 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 1 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 2 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 3 ) ; +// OSMetaClassDeclareReservedUnused ( ***, 4 ) ; // used above + +} ; + +#pragma mark - + +/*! @class IOFWReceiveDCL +*/ + +class IOFWReceiveDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWReceiveDCL ) + + protected : + + UInt8 fHeaderBytes ; + bool fWait ; + + public: + + // me + virtual bool initWithParams( + OSSet * updateSet, + UInt8 headerBytes, + unsigned rangesCount, + IOVirtualRange ranges [] ) ; + IOReturn setWaitControl( bool wait ) ; + + public : + + // internal use only: + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + + protected : + + virtual void debug() ; + +} ; + +#pragma mark - + +/*! @class IOFWSendDCL +*/ + +class IOFWSendDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWSendDCL ) + + protected: + + UInt32 * fUserHeaderPtr ; // pointer to 2 quadlets containing isoch header for this packet + UInt32 * fUserHeaderMaskPtr ; // pointer to 2 quadlets; used to mask header quadlets + IOFWDCL * fSkipBranchDCL ; + Callback fSkipCallback ; + void * fSkipRefcon ; + UInt8 fSync ; + UInt8 fTag ; + + public: + + // OSObject + virtual void free() ; + + // IOFWDCL + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + + // me + virtual bool initWithParams( OSSet * updateSet, + unsigned rangesCount = 0, + IOVirtualRange ranges [] = NULL, + UInt8 sync = 0, + UInt8 tag = 0 ) ; + + void setUserHeaderPtr( UInt32* userHeaderPtr, UInt32 * maskPtr ) ; + UInt32 * getUserHeaderPtr() ; + UInt32 * getUserHeaderMask() ; + void setSkipBranch( IOFWDCL * skipBranchDCL ) ; + IOFWDCL * getSkipBranch() const ; + void setSkipCallback( Callback callback ) ; + Callback getSkipCallback() const ; + void setSkipRefcon( void * refcon = 0 ) ; + void * getSkipRefcon() const ; + void setSync( UInt8 sync ) ; + UInt8 getSync() const ; + void setTag( UInt8 tag ) ; + UInt8 getTag() const ; + + public : + + // internal use only: + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + protected : + + virtual void debug() ; +} ; + +#pragma mark - + +/*! @class IOFWSkipCycleDCL +*/ + +class IOFWSkipCycleDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWSkipCycleDCL ) + + public: + + virtual bool init() ; + + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + virtual IOReturn getSpan( IOVirtualRange& result ) ; + + protected : + + virtual void debug() ; +} ; diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLPool.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLPool.h.svn-base new file mode 100644 index 0000000..005b62a --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLPool.h.svn-base @@ -0,0 +1,160 @@ +/* + * IOFWNuDCLPool.h + * IOFireWireFamily + * + * Created by Niels on Fri Mar 07 2003. + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * $Log: IOFWDCLPool.h,v $ + * Revision 1.15 2008/11/14 00:17:12 arulchan + * fix for rdar://5939334 + * + * Revision 1.14 2008/03/03 23:31:42 ayanowit + * another gcc-42 fix. + * + * Revision 1.13 2007/01/26 20:52:31 ayanowit + * changes to user-space isoch stuff to support 64-bit apps. + * + * Revision 1.12 2006/02/09 00:21:50 niels + * merge chardonnay branch to tot + * + * Revision 1.11 2005/04/12 20:09:13 niels + * fix memory leak importing NuDCL programs from user space + * + * Revision 1.10.20.2 2006/01/31 04:49:50 collin + * *** empty log message *** + * + * Revision 1.10 2003/11/07 21:24:28 niels + * *** empty log message *** + * + * Revision 1.9 2003/11/07 21:01:18 niels + * *** empty log message *** + * + * Revision 1.8 2003/08/25 08:39:15 niels + * *** empty log message *** + * + * Revision 1.7 2003/08/22 18:15:16 niels + * *** empty log message *** + * + * Revision 1.6 2003/08/15 04:36:55 niels + * *** empty log message *** + * + * Revision 1.5 2003/07/30 05:22:14 niels + * *** empty log message *** + * + * Revision 1.4 2003/07/21 08:48:20 niels + * *** empty log message *** + * + * Revision 1.3 2003/07/21 07:52:13 niels + * *** empty log message *** + * + * Revision 1.2 2003/07/21 06:52:58 niels + * merge isoch to TOT + * + * Revision 1.1.2.3 2003/07/11 18:15:34 niels + * *** empty log message *** + * + * Revision 1.1.2.2 2003/07/09 21:24:00 niels + * *** empty log message *** + * + * Revision 1.1.2.1 2003/07/01 20:54:06 niels + * isoch merge + * + */ + +#import +#import +#import + +class IOFireWireLink ; +class IOFWDCL ; +class IOFWReceiveDCL ; +class IOFWSendDCL ; +class IOFWSkipCycleDCL ; +class IOFireWireUserClient ; +class IOMemoryDescriptor ; +class IOMemoryMap ; +class OSSet; + +/*! @class IOFWDCLPool + @discussion You should never subclass IOFWDCLPool +*/ + +class IOFWDCLPool : public OSObject +{ + OSDeclareAbstractStructors( IOFWDCLPool ) + + friend class IOFireWireUserClient ; + friend class IOFWUserLocalIsochPort ; + + protected: + + class Expansion* fReserved ; // for class expansion + + IOFireWireLink * fLink ; + UInt8 fCurrentTag ; + UInt8 fCurrentSync ; + OSArray* fProgram ; + DCLNuDCLLeader fLeader ; + + public: + + // OSObject + + virtual void free() ; + + // me + + virtual bool initWithLink ( IOFireWireLink& link, UInt32 capacity ) ; + + virtual void setCurrentTagAndSync ( UInt8 tag, UInt8 sync ) ; + + virtual IOFWReceiveDCL* appendReceiveDCL ( + OSSet * updateSet, + UInt8 headerBytes, + UInt32 rangesCount, + IOVirtualRange ranges[] ) ; + virtual IOFWSendDCL* appendSendDCL ( + OSSet * updateSet, + UInt32 rangesCount, + IOVirtualRange ranges[] ) ; + virtual IOFWSkipCycleDCL* appendSkipCycleDCL () ; + virtual const OSArray * getProgramRef () const ; + + protected : + + IOReturn importUserProgram ( + IOMemoryDescriptor * userExportDesc, + unsigned bufferRangeCount, + IOAddressRange bufferRanges[], + IOMemoryMap * bufferMap ) ; + IOReturn importUserDCL( + IOFWDCL * dcl, + void * importData, + IOByteCount & dataSize, + IOMemoryMap * bufferMap ) ; + + + protected : + + virtual IOFWReceiveDCL * allocReceiveDCL () = 0 ; + virtual IOFWSendDCL * allocSendDCL () = 0 ; + virtual IOFWSkipCycleDCL * allocSkipCycleDCL () = 0 ; + + private : + + void appendDCL( IOFWDCL * dcl ) ; + + public : + + DCLCommand * getProgram() ; + + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 0); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 1); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 2); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 3); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 4); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 5); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 6); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 7); +} ; diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLProgram.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLProgram.h.svn-base new file mode 100644 index 0000000..cf91f06 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLProgram.h.svn-base @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWDCLPROGRAM_H +#define _IOKIT_IOFWDCLPROGRAM_H + +#include +#include +#include +#include + +/*! @class IODCLProgram +*/ +class IODCLProgram : public OSObject +{ + OSDeclareAbstractStructors(IODCLProgram) + + private : + + void * reserved0 ;//fDCLTaskToKernel; + void * reserved1 ;//fDataTaskToKernel; + void * reserved2 ;//fDataBase; + void * reserved3 ;// IOMemoryDescriptor * fDCLDesc; + IOMemoryMap * fBufferMem ; + void * reserved5 ;// IOMemoryCursor * fDataCursor; + + protected: + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData + { + IOFWIsochResourceFlags resourceFlags ; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * fExpansionData ; + + public : + + virtual void setIsochResourceFlags ( IOFWIsochResourceFlags flags ) ; // formerly getPhysicalSegs() + IOFWIsochResourceFlags getIsochResourceFlags () const ; + + protected: + + virtual void free () ; + + public: + + virtual bool init ( IOFireWireBus::DCLTaskInfo * info = NULL ) ; + virtual IOReturn allocateHW ( + IOFWSpeed speed, + UInt32 chan) = 0; + virtual IOReturn releaseHW () = 0; + virtual IOReturn compile ( + IOFWSpeed speed, + UInt32 chan) = 0; + virtual IOReturn notify ( + IOFWDCLNotificationType notificationType, + DCLCommand ** dclCommandList, + UInt32 numDCLCommands ) = 0; + virtual IOReturn start () = 0; + virtual void stop () = 0; + virtual IOReturn pause (); + virtual IOReturn resume (); + + virtual void setForceStopProc( + IOFWIsochChannel::ForceStopNotificationProc proc, + void * refCon, + IOFWIsochChannel * channel ) ; + protected : + + void generateBufferMap( DCLCommand * program ) ; + IOReturn virtualToPhysical( + IOVirtualRange ranges[], + unsigned rangeCount, + IOMemoryCursor::IOPhysicalSegment outSegments[], + unsigned & outPhysicalSegmentCount, + unsigned maxSegments ) ; + + public : + + IOMemoryMap * getBufferMap() const ; + + public : + + // close/open isoch workloop gate... + // clients should not need to call these. + virtual void closeGate() = 0 ; + virtual void openGate() = 0 ; + + virtual IOReturn synchronizeWithIO() = 0 ; + + private: + + OSMetaClassDeclareReservedUsed(IODCLProgram, 0); + OSMetaClassDeclareReservedUsed(IODCLProgram, 1); + OSMetaClassDeclareReservedUnused(IODCLProgram, 2); + OSMetaClassDeclareReservedUnused(IODCLProgram, 3); + OSMetaClassDeclareReservedUnused(IODCLProgram, 4); + +}; + +#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLTranslator.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLTranslator.h.svn-base new file mode 100644 index 0000000..e02067c --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWDCLTranslator.h.svn-base @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * A DCL program to interpret (in software) a program that's too complicated + * for the DMA engine. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWDCLTRANSLATOR_H +#define _IOKIT_IOFWDCLTRANSLATOR_H + +#include +#include + + +/*! @class IODCLTranslator +*/ + +class IODCLTranslator : public IODCLProgram +{ + OSDeclareAbstractStructors(IODCLTranslator) + +protected: + enum + { + kNumPingPongs = 2, + kNumPacketsPerPingPong = 500, + kMaxIsochPacketSize = 1000, + kPingPongBufferSize = kNumPingPongs * kNumPacketsPerPingPong * kMaxIsochPacketSize + }; + + // Opcodes and buffer for pingpong program + DCLLabel fStartLabel; + DCLTransferPacket fTransfers[kNumPingPongs*kNumPacketsPerPingPong]; + DCLCallProc fCalls[kNumPingPongs]; + DCLJump fJumpToStart; + UInt8 fBuffer[kPingPongBufferSize]; + + IODCLProgram * fHWProgram; // Hardware program executing our opcodes + DCLCommand* fToInterpret; // The commands to interpret + DCLCommand* fCurrentDCLCommand; // Current command to interpret + int fPingCount; // Are we pinging or ponging? + UInt32 fPacketHeader; + + static void ListeningDCLPingPongProc(DCLCommand* pDCLCommand); + static void TalkingDCLPingPongProc(DCLCommand* pDCLCommand); + +public: + virtual bool init(DCLCommand* toInterpret); + virtual IOReturn allocateHW(IOFWSpeed speed, UInt32 chan); + virtual IOReturn releaseHW(); + virtual IOReturn notify(IOFWDCLNotificationType notificationType, + DCLCommand** dclCommandList, UInt32 numDCLCommands); + virtual void stop(); + + DCLCommand* getTranslatorOpcodes(); + void setHWProgram(IODCLProgram *program); +}; + +/*! @class IODCLTranslateTalk +*/ + +class IODCLTranslateTalk : public IODCLTranslator +{ + OSDeclareDefaultStructors(IODCLTranslateTalk) + +protected: + +public: + virtual IOReturn compile(IOFWSpeed speed, UInt32 chan); + virtual IOReturn start(); + +}; + +/*! @class IODCLTranslateListen +*/ + +class IODCLTranslateListen : public IODCLTranslator +{ + OSDeclareDefaultStructors(IODCLTranslateListen) + +protected: + +public: + virtual IOReturn compile(IOFWSpeed speed, UInt32 chan); + virtual IOReturn start(); + +}; +#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWIsochChannel.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWIsochChannel.h.svn-base new file mode 100644 index 0000000..4bbd6c8 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWIsochChannel.h.svn-base @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWISOCHCHANNEL_H +#define _IOKIT_IOFWISOCHCHANNEL_H + +#include +#include + +enum +{ + kFWIsochChannelUnknownCondition = 0, + kFWIsochChannelNotEnoughBandwidth = 1, + kFWIsochChannelChannelNotAvailable = 2 +}; + +class IOFireWireController; +class IOFWIsochChannel; +class IOFWIsochPort; +class OSSet; +class IOFWReadQuadCommand; +class IOFWCompareAndSwapCommand; + +/*! @class IOFWIsochChannel +*/ +class IOFWIsochChannel : public OSObject +{ + OSDeclareDefaultStructors(IOFWIsochChannel) + + public: + + typedef IOReturn (ForceStopNotificationProc)(void* refCon, IOFWIsochChannel* channel, UInt32 stopCondition ); + +protected: + IOFireWireController * fControl; + ForceStopNotificationProc* fStopProc; + void * fStopRefCon; + IOFWIsochPort * fTalker; + OSSet * fListeners; + bool fDoIRM; + UInt32 fBandwidth; // Allocation units used + UInt32 fPacketSize; + IOFWSpeed fPrefSpeed; + IOFWSpeed fSpeed; // Actual speed used + UInt32 fChannel; // Actual channel used + IOFWReadQuadCommand * fReadCmd; + IOFWCompareAndSwapCommand * fLockCmd; + UInt32 fGeneration; // When bandwidth was allocated + + IOLock * fLock; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void threadFunc( void * arg ); + + virtual IOReturn updateBandwidth(bool claim); + virtual void reallocBandwidth( UInt32 generation ); + virtual void free(); + +public: + // Called from IOFireWireController + virtual bool init( IOFireWireController *control, bool doIRM, UInt32 packetSize, + IOFWSpeed prefSpeed, ForceStopNotificationProc* stopProc, + void *stopRefCon ); + virtual void handleBusReset(); + + // Called by clients + virtual IOReturn setTalker(IOFWIsochPort *talker); + virtual IOReturn addListener(IOFWIsochPort *listener); + + virtual IOReturn allocateChannel(); + virtual IOReturn releaseChannel(); + virtual IOReturn start(); + virtual IOReturn stop(); + +protected: + // handles IRM and channel determination and allocation. + // called by both user and kernel isoch channels + IOReturn allocateChannelBegin( IOFWSpeed speed, UInt64 allowedChans, UInt32 * channel = NULL ) ; + + // handles IRM and channel allocation. + // called by both user and kernel isoch channels + IOReturn releaseChannelComplete() ; + + IOReturn checkMemoryInRange( IOMemoryDescriptor * memory ); + +private: + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 0); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 1); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 2); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 3); + +}; + +typedef IOFWIsochChannel::ForceStopNotificationProc FWIsochChannelForceStopNotificationProc ; +typedef IOFWIsochChannel::ForceStopNotificationProc* FWIsochChannelForceStopNotificationProcPtr ; + +#endif /* ! _IOKIT_IOFWISOCHCHANNEL_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWIsochPort.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWIsochPort.h.svn-base new file mode 100644 index 0000000..793c5e9 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWIsochPort.h.svn-base @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * IOFWIsochPort is an abstract object that represents hardware on the bus + * (locally or remotely) that sends or receives isochronous packets. + * Local ports are implemented by the local device driver, + * Remote ports are implemented by the driver for the remote device. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWISOCHPORT_H +#define _IOKIT_IOFWISOCHPORT_H + +#include +#include + +/*! @class IOFWIsochPort +*/ + +class IOFWIsochPort : public OSObject +{ + OSDeclareAbstractStructors(IOFWIsochPort) + +public: + // Return maximum speed and channels supported + // (bit n set = chan n supported) + virtual IOReturn getSupported(IOFWSpeed &maxSpeed, UInt64 &chanSupported) = 0; + + // Allocate hardware resources for port + virtual IOReturn allocatePort(IOFWSpeed speed, UInt32 chan) = 0; + virtual IOReturn releasePort() = 0; // Free hardware resources + virtual IOReturn start() = 0; // Start port processing packets + virtual IOReturn stop() = 0; // Stop processing packets + +private: + OSMetaClassDeclareReservedUnused(IOFWIsochPort, 0); + OSMetaClassDeclareReservedUnused(IOFWIsochPort, 1); + +}; + +#endif /* ! _IOKIT_IOFWISOCHPORT_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWLocalIsochPort.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWLocalIsochPort.h.svn-base new file mode 100644 index 0000000..493f719 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWLocalIsochPort.h.svn-base @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * IOFWIsochPort is an abstract object that represents hardware on the bus + * (locally or remotely) that sends or receives isochronous packets. + * Local ports are implemented by the local device driver, + * Remote ports are implemented by the driver for the remote device. + * + * HISTORY + * + * $Log: IOFWLocalIsochPort.h,v $ + * Revision 1.10 2004/06/10 20:57:36 niels + * *** empty log message *** + * + * Revision 1.9 2003/08/30 00:16:44 collin + * *** empty log message *** + * + * Revision 1.8 2003/08/15 04:36:55 niels + * *** empty log message *** + * + * Revision 1.7 2003/07/29 22:49:22 niels + * *** empty log message *** + * + * Revision 1.6 2003/07/21 06:52:58 niels + * merge isoch to TOT + * + * Revision 1.5.14.1 2003/07/01 20:54:07 niels + * isoch merge + * + */ + + +#ifndef _IOKIT_IOFWLOCALISOCHPORT_H +#define _IOKIT_IOFWLOCALISOCHPORT_H + +#import +#import + +class IOFireWireController; +class IODCLProgram; + +/*! @class IOFWLocalIsochPort +*/ +class IOFWLocalIsochPort : public IOFWIsochPort +{ + OSDeclareDefaultStructors(IOFWLocalIsochPort) + + protected: + + IOFireWireController * fControl; + IODCLProgram * fProgram; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData + { + } ; + + ExpansionData * fExpansion ; + + protected : + + virtual void free ( void ) ; + + public: + + virtual bool init ( + IODCLProgram * program, + IOFireWireController * control ) ; + + // Return maximum speed and channels supported + // (bit n set = chan n supported) + virtual IOReturn getSupported ( + IOFWSpeed & maxSpeed, + UInt64 & chanSupported ) ; + + // Allocate hardware resources for port + virtual IOReturn allocatePort ( + IOFWSpeed speed, + UInt32 chan ) ; + virtual IOReturn releasePort ( void ) ; // Free hardware resources + virtual IOReturn start ( void ) ; // Start port processing packets + virtual IOReturn stop ( void ) ; // Stop processing packets + + /*! @function notify + @abstract Informs hardware of a change to the DCL program. + @param notificationType Type of change. + @param dclCommandList List of DCL commands that have been changed. + @param numDCLCommands Number of commands in list. + @result IOKit error code. */ + virtual IOReturn notify( + IOFWDCLNotificationType notificationType, + DCLCommand ** dclCommandList, + UInt32 numDCLCommands ) ; + static void printDCLProgram ( + const DCLCommand * dcl, + UInt32 count = 0, + void (*printFN)( const char *format, ...) = NULL, + unsigned lineDelayMS = 0 ) ; + IOReturn setIsochResourceFlags ( + IOFWIsochResourceFlags flags ) ; + IODCLProgram * getProgramRef() const ; + + IOReturn synchronizeWithIO() ; + + private: + + OSMetaClassDeclareReservedUnused ( IOFWLocalIsochPort, 0 ) ; + OSMetaClassDeclareReservedUnused ( IOFWLocalIsochPort, 1 ) ; +}; + +#endif /* ! _IOKIT_IOFWLOCALISOCHPORT_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWPHYPacketListener.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWPHYPacketListener.h.svn-base new file mode 100644 index 0000000..ea2c6ff --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWPHYPacketListener.h.svn-base @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWPHYPACKETLISTENER_H_ +#define _IOFWPHYPACKETLISTENER_H_ + +#include + +class IOFireWireController; + +// Callback when phy packet is received +typedef void (*FWPHYPacketCallback)( void *refcon, UInt32 data1, UInt32 data2 ); + +/*! @class IOFWPHYPacketListener +*/ + +class IOFWPHYPacketListener : public OSObject +{ + OSDeclareDefaultStructors( IOFWPHYPacketListener ); + + friend class IOFireWireController; + +protected: + + IOFireWireController * fControl; + FWPHYPacketCallback fCallback; + void * fRefCon; + + static IOFWPHYPacketListener * createWithController( IOFireWireController * controller ); + + virtual bool initWithController( IOFireWireController * control ); + virtual void free( void ); + +public: + + virtual IOReturn activate( void ); + virtual void deactivate( void ); + + virtual void setCallback( FWPHYPacketCallback callback ); + virtual void setRefCon( void * refcon ); + virtual void * getRefCon( void ); + +protected: + virtual void processPHYPacket( UInt32 data1, UInt32 data2 ); + + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 0 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 1 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 2 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 3 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 4 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 5 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 6 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 7 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 8 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 9 ); +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWPhysicalAddressSpace.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWPhysicalAddressSpace.h.svn-base new file mode 100644 index 0000000..b1944f4 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWPhysicalAddressSpace.h.svn-base @@ -0,0 +1,263 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFWPHYSICALADDRESSSPACE_H +#define _IOKIT_IOFWPHYSICALADDRESSSPACE_H + +#include +#include + +/* + * Direct physical memory <-> FireWire address. + * Accesses to these addresses may be handled automatically by the + * hardware without notification. + * + * The 64 bit FireWire address of (32 bit) physical addr xxxx:xxxx is hostNode:0000:xxxx:xxxx + */ + +class IOFWPhysicalAddressSpace; + +struct FWSegment +{ + FWAddress address; + UInt32 length; +}; + +#pragma mark - + +/*! + @class IOFWPhysicalAddressSpaceAux +*/ + +class IOFWPhysicalAddressSpaceAux : public IOFWAddressSpaceAux +{ + OSDeclareDefaultStructors(IOFWPhysicalAddressSpaceAux) + + friend class IOFWAddressSpace; + friend class IOFWPhysicalAddressSpace; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData *reserved; + + IODMACommand * fDMACommand; + bool fDMACommandPrepared; + +public: + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + + void setDMACommand( IODMACommand * dma_command ); + IODMACommand * getDMACommand( void ); + UInt64 getPhysicalSegment( UInt64 offset, UInt64 * length ); + + IOReturn prepare( void ); + IOReturn synchronize( IOOptionBits options ); + IOReturn complete( void ); + + bool isPrepared( void ); + + IOReturn getSegments( UInt64 * offset, FWSegment * fw_segments, UInt32 * num_segments ); + +private: + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 0); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 9); + +}; + +#pragma mark - + +/*! + @class IOFWPhysicalAddressSpace +*/ + +class IOFWPhysicalAddressSpace : public IOFWAddressSpace +{ + OSDeclareDefaultStructors(IOFWPhysicalAddressSpace) + + friend class IOFWPhysicalAddressSpaceAux; + +protected: + + IOMemoryDescriptor * fMem; // unused + vm_size_t fLen; // unused + + virtual void free(); + +public: + +/*! @function init + @abstract Initialize physical address space. + @param bus Points to IOFireWireBus object. + @result returns true if success, else false */ + virtual bool init( IOFireWireBus * bus ); + +/*! @function initWithDesc + @abstract Initialize physical address space with IOMemoryDescriptor. + @param bus Points to IOFireWireBus object. + @param mem Points to IOMemoryDescriptor. + @result returns true if success, else false */ + virtual bool initWithDesc(IOFireWireBus *bus, + IOMemoryDescriptor *mem); + +/*! @function doRead + @abstract A method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, + IOFWRequestRefCon refcon); + +/*! @function doWrite + @abstract A method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + +/*! @function getMemoryDescriptor + @abstract Gets the memory descriptor, which is associated to this + PhysicalAddressSpace. + @param none. + @result returns the IOMemoryDescriptor */ + IOMemoryDescriptor * getMemoryDescriptor( void ); + +/*! @function setMemoryDescriptor + @abstract Sets the memory descriptor, which will be associated to this + PhysicalAddressSpace. + @param none. + @result returns the IOMemoryDescriptor */ + IOReturn setMemoryDescriptor( IOMemoryDescriptor * descriptor ); + +/*! @function getLength + @abstract Get the length of the memory backed by PhysicalAddressSpace. + @param none. + @result returns the length */ + UInt64 getLength( void ); + +/*! @function setDMACommand + @abstract Set the DMACommand for this PhysicalAddressSpace. + @param dma_command Points to IODMACommand object. + @result none */ + inline void setDMACommand( IODMACommand * dma_command ) + { ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->setDMACommand( dma_command ); }; + +/*! @function getDMACommand + @abstract Get the DMACommand from this PhysicalAddressSpace. + @param none. + @result return previously assigned IODMACommand, null if not initialized */ + inline IODMACommand * getDMACommand( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getDMACommand(); }; + +/*! @function initWithDMACommand + @abstract Initialize physical address space with IODMACommand. + @param bus Points to IOFireWireBus object. + @param command Points to IODMACommand. + @result returns true if success, else false */ + virtual bool initWithDMACommand( IOFireWireBus * control, IODMACommand * command ); + +/*! @function prepare + @abstract Prepare the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn prepare( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->prepare(); }; + +/*! @function synchronize + @abstract synchronize the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn synchronize( IOOptionBits options ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->synchronize( options ); }; + +/*! @function complete + @abstract complete the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn complete( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->complete(); }; + +/*! @function isPrepared + @abstract Inspects whether the IODMACommand was prepared in this PhysicalAddressSpace. + @param none. + @result returns true if prepared, else false */ + inline bool isPrepared( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->isPrepared(); }; + +/*! @function getSegments + @abstract Returns the scatter gather list of memory segments from the IODMACommand + used in this PhysicalAddressSpace. + @param offset input/output parameter, defines the starting and ending offset in the memory + descriptor, relative to any offset passed to the prepare() method. + FWSegment Points to an array of memory segments. + num_segments Size of the FWSegment array. + @result returns kIOReturnSuccess on success */ + inline IOReturn getSegments( UInt64 * offset, FWSegment * fw_segments, UInt32 * num_segments ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getSegments( offset, fw_segments, num_segments ); }; + +/*! @function checkMemoryInRange + @abstract Validates the IOMemoryDescriptor, which is used to initialize the PhysicalAddressSpace. + @param memory Points to a valid IOMemoryDescriptor. + @result returns kIOReturnSuccess on success */ + IOReturn checkMemoryInRange( IOMemoryDescriptor * memory ); + +protected: + + UInt64 getPhysicalSegment( UInt64 offset, UInt64 * length ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getPhysicalSegment( offset, length); }; + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWPseudoAddressSpace.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWPseudoAddressSpace.h.svn-base new file mode 100644 index 0000000..02c2c30 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWPseudoAddressSpace.h.svn-base @@ -0,0 +1,370 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFWPSEUDOADDRESSSPACE_H +#define _IOKIT_IOFWPSEUDOADDRESSSPACE_H + +#include + +/* + * If installed, this callback is invoked for drivers which + * would like to coalesce incoming writes and do batch processing + * of incoming block write packets. + * This callback can be installed by calling setARxReqIntCompleteHandler + * method in IOFWPseudoAddressSpace object. + */ +typedef void (*IOFWARxReqIntCompleteHandler)( void * refcon ); + +/* + * Pseudo firewire addresses usually represent emulated registers of some kind. + * Accesses to these addresses will result in the owner being notified. + * + * Virtual addresses should not have zero as the top 16 bits of the 48 bit local address, + * since that may look like a physical address to hardware (eg. OHCI). + * if reader is NULL then reads will not be allowed. + * if writer is NULL then writes will not be allowed. + * if either is NULL then lock requests will not be allowed. + * refcon is passed back as the first argument of read and write callbacks. + */ + +class IOFWPseudoAddressSpace; + +#pragma mark - + +/*! + @class IOFWPseudoAddressSpaceAux +*/ + +class IOFWPseudoAddressSpaceAux : public IOFWAddressSpaceAux +{ + OSDeclareDefaultStructors(IOFWPseudoAddressSpaceAux) + + friend class IOFWAddressSpace; + friend class IOFWPseudoAddressSpace; + friend class IOFireWireController; + +protected: + + struct MemberVariables + { + IOFWARxReqIntCompleteHandler fARxReqIntCompleteHandler; + void * fARxReqIntCompleteHandlerRefcon; + }; + + MemberVariables * fMembers; + +public: + + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + +protected: + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + + virtual void handleARxReqIntComplete(); + +public: + +/*! @function setARxReqIntCompleteHandler + @abstract Installs a callback to receive notification, when FWIM has completed + ARxReqInt processing and no incoming packets are left in the queue. + @param refcon Client's callback object. + @param handler Client callback to be invoked, at the end of interrupt processing. + @result none. */ + virtual void setARxReqIntCompleteHandler( void * refcon, IOFWARxReqIntCompleteHandler handler ); + + virtual bool intersects( IOFWAddressSpace * space ); + +private: + + OSMetaClassDeclareReservedUsed(IOFWPseudoAddressSpaceAux, 0); + OSMetaClassDeclareReservedUsed(IOFWPseudoAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 9); + +}; + +/*! + @class IOFWPseudoAddressSpace +*/ + +class IOFWPseudoAddressSpace : public IOFWAddressSpace +{ + OSDeclareDefaultStructors(IOFWPseudoAddressSpace) + + friend class IOFWPseudoAddressSpaceAux; + friend class IOFireWireController; + +protected: + + IOMemoryDescriptor* fDesc; + void * fRefCon; + FWReadCallback fReader; + FWWriteCallback fWriter; + FWAddress fBase; + UInt32 fLen; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static OSData * allocatedAddresses; // unused + + virtual void free(); + +public: + +/*! @function simpleReader + @abstract A method for processing an address space read request + @param refcon Client's callback object. + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + static UInt32 simpleReader( + void* refcon, + UInt16 nodeID, + IOFWSpeed & speed, + FWAddress addr, + UInt32 len, + IOMemoryDescriptor** buf, + IOByteCount* offset, + IOFWRequestRefCon reqrefcon); + +/*! @function simpleWriter + @abstract A method for processing an address space write request + @param refcon Client's callback object. + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + static UInt32 simpleWriter( + void* refcon, + UInt16 nodeID, + IOFWSpeed& speed, + FWAddress addr, + UInt32 len, + const void* buf, + IOFWRequestRefCon reqrefcon); +protected: + + // Get a unique address range + IOReturn allocateAddress( + FWAddress* addr, + UInt32 len); + // free address + void freeAddress( + FWAddress addr, + UInt32 len); + +public: + + static IOFWPseudoAddressSpace* readWrite( + FWAddress addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function simpleRead + @abstract Create an address space object to handle read-only memory (eg. the local ROM) + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRead( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + const void* data); + +/*! @function simpleReadFixed + @abstract Create an address space object to handle fixed read-only memory (eg. the local ROM) + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleReadFixed( + IOFireWireBus* bus, + FWAddress addr, + UInt32 len, + const void* data); + +/*! @function simpleRW + @abstract Create an address space object to handle r/w memory + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRW( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + void * data); + +/*! @function simpleRW + @abstract Create an address space object to handle r/w memory + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRW( + IOFireWireBus* bus, + FWAddress* addr, + IOMemoryDescriptor * data); + +/*! @function initAll + @abstract Initialize an address space object to handle r/w memory + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param reader Callback handler for incoming Read. + @param writer Callback handler for incoming Write. + @param refcon Client's callback object. + @result returns true on success, false on failure */ + virtual bool initAll( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function initFixed + @abstract Initialize a fixed address space at top of kCSRRegisterSpaceBaseAddressHi + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param reader Callback handler for incoming Read. + @param writer Callback handler for incoming Write. + @param refcon Client's callback object. + @result returns true on success, false on failure */ + virtual bool initFixed( + IOFireWireBus* bus, + FWAddress addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function doRead + @abstract A method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead( + UInt16 nodeID, + IOFWSpeed & speed, + FWAddress addr, + UInt32 len, + IOMemoryDescriptor ** buf, + IOByteCount * offset, + IOFWRequestRefCon reqrefcon); +/*! @function doWrite + @abstract A method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite( + UInt16 nodeID, + IOFWSpeed& speed, + FWAddress addr, + UInt32 len, + const void* buf, + IOFWRequestRefCon reqrefcon); + +/*! @function contains + @abstract returns number of bytes starting at addr in this space + @result 0 if it doesn't contain the address + */ + virtual UInt32 contains(FWAddress addr); + +/*! @function simpleRWFixed + @abstract Create a Read/Write fixed address space at top of kCSRRegisterSpaceBaseAddressHi. + @param control Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the address range. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace * simpleRWFixed( IOFireWireBus *control, FWAddress addr, UInt32 len, const void *data ); + +protected: + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +protected: + inline void handleARxReqIntComplete( void ) + { ((IOFWPseudoAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->handleARxReqIntComplete(); } + +public: +/*! @function setARxReqIntCompleteHandler + @abstract Installs a callback to receive notification, when FWIM has completed + ARxReqInt processing and no incoming packets are left in the queue. + @param refcon Client's callback object. + @param handler Client callback to be invoked, at the end of interrupt processing. + @result none. */ + inline void setARxReqIntCompleteHandler( void * refcon, IOFWARxReqIntCompleteHandler handler ) + { ((IOFWPseudoAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->setARxReqIntCompleteHandler( refcon, handler ); } + +private: + + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpace, 1); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWRegs.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWRegs.h.svn-base new file mode 100644 index 0000000..97c7078 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWRegs.h.svn-base @@ -0,0 +1,73 @@ +/* +* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.1 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +* License for the specific language governing rights and limitations +* under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ +/* + File: IOFWRegs.h + + Copyright: 1996-1999 by Apple Computer, Inc., all rights reserved. + +*/ + +#ifndef __IOFWREGS_H__ +#define __IOFWREGS_H__ + +#include + +#ifndef NEW_ERROR_CODES + +// +// (!) The following error codes are obsolete... +// Please use the error codes defined in IOFireWireFamilyCommon.h +// + +enum { + inUseErr = -4160, // Item already in use + notFoundErr = -4161, // Item not found + timeoutErr = -4162, // Something timed out + busReconfiguredErr = -4163, // Bus was reconfigured + invalidIDTypeErr = -4166, // Given ID is of an invalid type for the requested operation. + alreadyRegisteredErr = -4168, // Item has already been registered. + disconnectedErr = -4169, // Target of request has been disconnected. + retryExceededErr = -4170, // Retry limit was exceeded. + addressRangeErr = -4171, // Address is not in range. + addressAlignmentErr = -4172, // Address is not of proper alignment. + + multipleTalkerErr = -4180, // Tried to install multiple talkers + channelActiveErr = -4181, // Operation not permitted when channel is active + noListenerOrTalkerErr = -4182, // Every isochronous channel must have one talker and at least + // one listener + noChannelsAvailableErr = -4183, // No supported isochronous channels are available + channelNotAvailableErr = -4184, // Required channel was not available. + invalidIsochPortIDErr = -4185, // An isochronous port ID is invalid. + invalidFWReferenceTypeErr = -4186, // Operation does not support type of given reference ID + separateBusErr = -4187, // Two or more entities are on two or more busses and cannot be associated with eachother. + badSelfIDsErr = -4188, // Received self IDs are bad. + +//zzz Do we own these next ID numbers? + cableVoltageTooLowErr = -4190, // Cable power below device's minimum voltage + cablePowerInsufficientErr = -4191 // Can't grant power request at this time +}; + + +#endif //NEW_ERROR_CODES + +#endif /* __IOFWREGS_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWSimpleContiguousPhysicalAddressSpace.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWSimpleContiguousPhysicalAddressSpace.h.svn-base new file mode 100644 index 0000000..606a9b2 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWSimpleContiguousPhysicalAddressSpace.h.svn-base @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSIMPLECONTIGUOUSPHYSICALADDRESSSPACE_H_ +#define _IOFWSIMPLECONTIGUOUSPHYSICALADDRESSSPACE_H_ + +#include + +/*! @class IOFWSimpleContiguousPhysicalAddressSpace +*/ + +class IOFWSimpleContiguousPhysicalAddressSpace : public IOFWSimplePhysicalAddressSpace +{ + OSDeclareDefaultStructors( IOFWSimpleContiguousPhysicalAddressSpace ) + +private: + + void * fSimpleContigPhysSpaceMembers; + + IOReturn cachePhysicalAddress( void ); + +protected: + virtual bool createMemberVariables( void ); + virtual void destroyMemberVariables( void ); + +public: + + virtual bool init( IOFireWireBus * control, vm_size_t size, IODirection direction ); + virtual void free( void ); + + FWAddress getFWAddress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 1); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 2); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 3); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 4); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 5); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 6); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 7); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 8); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 9); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWSimplePhysicalAddressSpace.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWSimplePhysicalAddressSpace.h.svn-base new file mode 100644 index 0000000..83a76a4 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWSimplePhysicalAddressSpace.h.svn-base @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSIMPLEPHYSICALADDRESSSPACE_H_ +#define _IOFWSIMPLEPHYSICALADDRESSSPACE_H_ + +#include +#include +#include +#include + +/*! @class IOFWSimplePhysicalAddressSpace +*/ + +class IOFWSimplePhysicalAddressSpace : public IOFWPhysicalAddressSpace +{ + OSDeclareDefaultStructors( IOFWSimplePhysicalAddressSpace ) + +private: + + void * fSimplePhysSpaceMembers; + + IOReturn allocateMemory( void ); + void deallocateMemory( void ); + +protected: + virtual bool createMemberVariables( void ); + virtual void destroyMemberVariables( void ); + +public: + + virtual bool init( IOFireWireBus * control, vm_size_t size, IODirection direction, bool contiguous = false ); + virtual void free( void ); + + IOVirtualAddress getVirtualAddress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 1); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 2); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 3); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 4); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 5); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 6); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 7); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 8); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 9); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWSyncer.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWSyncer.h.svn-base new file mode 100644 index 0000000..0fa497f --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWSyncer.h.svn-base @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSYNCER_H +#define _IOFWSYNCER_H + +#include +#include +#include + +class IOFWSyncer : public OSObject +{ + OSDeclareDefaultStructors(IOFWSyncer) + +private: + // The spin lock that is used to guard the 'threadMustStop' variable. + IOSimpleLock *guardLock; + volatile bool threadMustStop; + IOReturn fResult; + virtual void free(); + virtual void privateSignal(); + +public: + + static IOFWSyncer * create(bool twoRetains = true); + + virtual bool init(bool twoRetains); + virtual void reinit(); + virtual IOReturn wait(bool autoRelease = true); + virtual void signal(IOReturn res = kIOReturnSuccess, + bool autoRelease = true); +}; + +#endif /* !_IOFWSYNCER */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWUserObjectExporter.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWUserObjectExporter.h.svn-base new file mode 100644 index 0000000..5d12307 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWUserObjectExporter.h.svn-base @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1998-2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! @class IOFWUserObjectExporter + @discussion An IOFWUserObjectExporter is for internal use only. You should never subclass IOFWUserObjectExporter +*/ + + namespace IOFireWireLib + { + typedef UInt32 UserObjectHandle; + } + +#ifdef KERNEL + + class IOFWUserObjectExporter : public OSObject + { + OSDeclareDefaultStructors (IOFWUserObjectExporter ) + + public : + + typedef void (*CleanupFunction)( const OSObject * obj ); + typedef void (*CleanupFunctionWithExporter)( const OSObject * obj, IOFWUserObjectExporter * ); + + private : + + unsigned fCapacity; + unsigned fObjectCount; + const OSObject ** fObjects; + CleanupFunctionWithExporter * fCleanupFunctions; + IOLock * fLock; + OSObject * fOwner; + + public : + + static IOFWUserObjectExporter * createWithOwner( OSObject * owner ); + bool initWithOwner( OSObject * owner ); + + virtual bool init(); + + virtual void free (); + virtual bool serialize ( OSSerialize * s ) const; + + // me + IOReturn addObject ( OSObject * obj, CleanupFunction cleanup, IOFireWireLib::UserObjectHandle * outHandle ); + void removeObject ( IOFireWireLib::UserObjectHandle handle ); + + // the returned object is retained! This is for thread safety.. if someone else released + // the object from the pool after you got it, you be in for Trouble + // Release the returned value when you're done!! + const OSObject * lookupObject ( IOFireWireLib::UserObjectHandle handle ) const; + const OSObject * lookupObjectForType( IOFireWireLib::UserObjectHandle handle, const OSMetaClass * toType ) const; + void removeAllObjects (); + + void lock () const; + void unlock () const; + + OSObject * getOwner() const; + + const IOFireWireLib::UserObjectHandle lookupHandle ( OSObject * object ) const; + + // don't subclass, but just in case someone does... + + private: + + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 0); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 1); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 2); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 3); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 4); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 5); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 6); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 7); + + }; + +#endif diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFWUtils.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFWUtils.h.svn-base new file mode 100644 index 0000000..1a0ffc3 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFWUtils.h.svn-base @@ -0,0 +1,32 @@ +/* + * IOFWUtils.h + * IOFireWireFamily + * + * Created by Niels on Fri Aug 16 2002. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + */ + +#import + +//////////////////////////////////////////////////////////////////////////////// +// +// Useful FireWire utility functions. +// + +#ifdef __cplusplus +extern "C" { +#endif + +UInt16 FWComputeCRC16(const UInt32 *pQuads, UInt32 numQuads); +UInt16 FWUpdateCRC16(UInt16 crc16, UInt32 quad); + +UInt32 AddFWCycleTimeToFWCycleTime( UInt32 cycleTime1, UInt32 cycleTime2 ); +UInt32 SubtractFWCycleTimeFromFWCycleTime( UInt32 cycleTime1, UInt32 cycleTime2); + +void IOFWGetAbsoluteTime( AbsoluteTime * result ); + +#ifdef __cplusplus +} +#endif + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireBus.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireBus.h.svn-base new file mode 100644 index 0000000..053bfe4 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireBus.h.svn-base @@ -0,0 +1,373 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFIREWIREBUS_H +#define _IOKIT_IOFIREWIREBUS_H + +#include +#include +#include +#include +#include + +extern const OSSymbol *gFireWireROM; +extern const OSSymbol *gFireWireNodeID; +extern const OSSymbol *gFireWireSelfIDs; +extern const OSSymbol *gFireWireSpeed; +extern const OSSymbol *gFireWireUnit_Spec_ID; +extern const OSSymbol *gFireWireUnit_SW_Version; +extern const OSSymbol *gFireWireVendor_ID; +extern const OSSymbol *gFireWire_GUID; +extern const OSSymbol *gFireWireVendor_Name; +extern const OSSymbol *gFireWireProduct_Name; +extern const OSSymbol *gFireWireModel_ID; +extern const OSSymbol *gFireWireTDM; + +class IOFireWireDevice; +class IOLocalConfigDirectory; +class IOFWLocalIsochPort; +class IOFireWirePowerManager; +class IOFireWireBus; +class IOFWDCLPool; +class IOFWSimpleContiguousPhysicalAddressSpace; +class IOFWSimplePhysicalAddressSpace; +class IOFWUserObjectExporter; + +#pragma mark - + +/*! + @class IOFireWireBusAux +*/ + +class IOFireWireBusAux : public OSObject +{ + OSDeclareAbstractStructors(IOFireWireBusAux) + + friend class IOFireWireBus; + + protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + public : + + virtual IOFWDCLPool * createDCLPool ( unsigned capacity ) const = 0 ; + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 32); + virtual UInt8 getMaxRec( void ) = 0; + + virtual UInt64 getFireWirePhysicalAddressMask( void ) = 0; + virtual UInt32 getFireWirePhysicalAddressBits( void ) = 0; + virtual UInt64 getFireWirePhysicalBufferMask( void ) = 0; + virtual UInt32 getFireWirePhysicalBufferBits( void ) = 0; + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) = 0; + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) = 0; + + virtual IOFWUserObjectExporter * getSessionRefExporter( void ) = 0; + + private: + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 0); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 1); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 2); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 7); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 8); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 9); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 10); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 11); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 12); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 13); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 14); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 15); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 16); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 17); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 18); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 19); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 20); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 21); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 22); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 23); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 24); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 25); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 26); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 27); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 28); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 29); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 30); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 31); + +}; + +#pragma mark - + +/*! + @class IOFireWireBus + @abstract IOFireWireBus is a public class the provides access to + general FireWire functionality... +*/ + +class IOFireWireBus : public IOService +{ + OSDeclareAbstractStructors(IOFireWireBus) + +public: + + struct DCLTaskInfoAux + { + unsigned version ; + union // u + { + struct // v0 + { + IOMemoryMap * bufferMemoryMap ; // This field required to get physical addresses to program DMA. + // If NULL, we try to make the map ourselves. + // If you created a buffer memory descriptor + // for your program's buffers, just call map() on it + // and pass the returned object here... + } v0 ; + + struct // v1 + { + IOMemoryMap * bufferMemoryMap ; // same as 'bufferMemoryMap' from version 0, above. + + IOWorkLoop * workloop ; // A workloop on which to run callbacks for this port.. + // Can be NULL to use FireWire isochronous workloop... + // The workloop will be retained by the program object. + } v1 ; + + struct + { + IOMemoryMap * bufferMemoryMap ; // same as 'bufferMemoryMap' from version 0, above. + + IOWorkLoop * workloop ; // A workloop on which to run callbacks for this port.. + // Can be NULL to use FireWire isochronous workloop... + // The workloop will be retained by the program object. + IOFWIsochPortOptions options ; // extra options + } v2 ; + } u ; + } ; + + // this struct has been redefined for our next generation isochronous architecture, + // but is backwards compatible with the old definition.. This means we should + // be safe when an old-style driver is loaded.. + // To use DCLTaskInfo (see createLocalIsochPort) make sure all 'unused' fields are set to 0 or NULL + // and that auxInfo points to a valid DCLTaskInfoAux struct, defined above. + + struct DCLTaskInfo + { + task_t unused0 ; + vm_address_t unused1 ; + UInt32 unused2 ; + vm_address_t unused3 ; + UInt32 unused4 ; + void (*unused5)(void) ; + DCLTaskInfoAux * auxInfo ; // Refcon for user call + } ; + + static const IORegistryPlane * gIOFireWirePlane; + + IOFireWireBusAux * fAuxiliary; + + // Create an Isochronous Channel object + virtual IOFWIsochChannel *createIsochChannel( + bool doIRM, UInt32 bandwidth, IOFWSpeed prefSpeed, + IOFWIsochChannel::ForceStopNotificationProc stopProc=NULL, + void *stopRefCon=NULL) = 0; + + /*! @function createLocalIsochPort + @abstract Create a local isochronous port to run the given DCL program + @param talking Pass true to create a talker port; pass false to create a listener port. + @param opcodes A pointer to your DCL program (linked list of DCLCommand structs) + To use an IOFWDCL/IOFWDCLPool program, pass the DCLCommand returned by + IOFWDCLPool::getProgram(). + @param info (Optional) Pointer to DCLTaskInfo struct containing additional + configuration information. If you have an IOMemoryMap for your DCL program data buffers, + pass it here. You can also pass an IOWorkLoop if you want to use your own + workloop to handle callbacks for the created port object. + @param startEvent Specifies a bus condition on which the port should start receiving/sending packets + Must be kFWDCLImmediateEvent, kFWDCLCycleEvent, or kFWDCLSyBitsEvent. + Pass kFWDCLImmediateEvent to start without waiting when start() is called. Pass kFWDCLCycleEvent + to start() transmitting at a specified bus cycle time. Pass kFWDCLSyBitsEvent (receive only) + to start receiving packets once an isochronous packet with a specified sync field arrives. + @param startState Pass the value for the desired start condition, as specified by 'startEvent' + kFWDCLImmediateEvent: set to 0 + kFWDCLCycleEvent: the cycle timer value on which to start processing packets. For talker + ports, This value will be masked by 'startMask' and packet processing will be begin on the + next cycle whose lowest bits match the masked value. For listener ports, pass a 15-bit value + containg to the low order two bits of cycleSeconds and the 13-bit cycleCount on which to start + processing packets. + kFWDCLSyBitsEvent: The value of the sync field on which to start receive packets. The value will be masked + by 'startMask'. For DCLCommand based isoch ports, processing will begin on the first received packet + that has an isochronous header sync field matching 'startState'. For IOFWDCL/IOFWDCLPool based + ports, processing will pause on each IOFWDCL that has wait set to true until a packet that has + an isochronous header sync field matching 'startState' is received. + @result Returns an IOFWLocalIsochPort on success.*/ + virtual IOFWLocalIsochPort *createLocalIsochPort(bool talking, + DCLCommand *opcodes, DCLTaskInfo *info = 0, + UInt32 startEvent = 0, UInt32 startState = 0, UInt32 startMask = 0) = 0; + + virtual IOReturn getCycleTime(UInt32 &cycleTime) = 0; + virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime) = 0; + + // Methods to manipulate the local Config ROM + virtual IOReturn AddUnitDirectory(IOLocalConfigDirectory *unitDir) = 0; + virtual IOReturn RemoveUnitDirectory(IOLocalConfigDirectory *unitDir) = 0; + + // Cause a bus reset + virtual IOReturn resetBus() = 0; + + // Convert a firewire nodeID into the IOFireWireDevice for it + virtual IOFireWireDevice * nodeIDtoDevice(UInt32 generation, UInt16 nodeID) = 0; + + // Execute specified function on workloop after specified delay + // Returned command is for delay, call it's cancel() function to cancel timeout. + virtual IOFWDelayCommand * createDelayedCmd(UInt32 uSecDelay, FWBusCallback func, void *refcon) = 0; + + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem) = 0; + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) = 0; + + + // Extract info about the async request + virtual bool isLockRequest(IOFWRequestRefCon refcon) = 0; + virtual bool isQuadRequest(IOFWRequestRefCon refcon) = 0; + virtual UInt32 getExtendedTCode(IOFWRequestRefCon refcon) = 0; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog ( bool forSend, UInt16 nodeAddress) const = 0; + + // How big (as a power of two) can packets sent from A to B be? + virtual int maxPackLog ( UInt16 nodeA, UInt16 nodeB) const = 0; + + // Force given node to be root (via root holdoff Phy packet) + virtual IOReturn makeRoot ( UInt32 generation, UInt16 nodeID) = 0; + + // Create address space at fixed address in initial register space + virtual IOFWPseudoAddressSpace * createInitialAddressSpace ( UInt32 addressLo, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) = 0; + + // Get address space object for given address, if any + virtual IOFWAddressSpace * getAddressSpace(FWAddress address) = 0; + + // Extract info about the async request - was the request ack'ed complete already? + virtual bool isCompleteRequest(IOFWRequestRefCon refcon) = 0; + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion=NULL, void *refcon=NULL) = 0; + virtual UInt32 hopCount(UInt16 nodeAAddress, UInt16 nodeBAddress ) = 0; + virtual UInt32 hopCount(UInt16 nodeAAddress ) = 0; + virtual IOFireWirePowerManager * getBusPowerManager( void ) = 0; + +protected: + + virtual IOFireWireBusAux * createAuxiliary( void ) = 0; + + public : + + inline IOFWDCLPool * createDCLPool ( UInt32 capacity = 0 ) { return fAuxiliary->createDCLPool ( capacity ) ; } + inline UInt8 getMaxRec( void ) { return fAuxiliary->getMaxRec(); } + + // get the physical addressing limitations for this controller + + // returns the physical mask for memory addressable by the bus and this controller's DMA engine + // intended for use with IOBufferMemoryDescriptor::inTaskWithPhysicalMask() + // all current hardware is 32 bit --- currently returns 0x00000000FFFFFFFF + // this API is intended for allocating physical buffers. + // it will not return more than 48 bits so that buffer addresses can be turned into FWAddresses + inline UInt64 getFireWirePhysicalAddressMask( void ) + { return fAuxiliary->getFireWirePhysicalAddressMask(); } + + // returns a count of the maximum addressing bits supported by the bus and this controller + // intended for use with IODMACommand::withSpecification() + // all current hardware is 32 bit --- currently returns 32 + // this API is intended for allocating physical buffers. + // it will not return more than 48 bits so that buffer addresses can be turned into FWAddresses + inline UInt32 getFireWirePhysicalAddressBits( void ) + { return fAuxiliary->getFireWirePhysicalAddressBits(); } + + // returns the physical mask for memory addressable by this controller's DMA engine + // intended for use with IOBufferMemoryDescriptor::inTaskWithPhysicalMask() + // all current hardware is 32 bit --- currently returns 0x00000000FFFFFFFF + // this API is to allocate isoch and other buffers that don't need to be addressable by the bus + // it may someday return as high 64 bits + inline UInt64 getFireWirePhysicalBufferMask( void ) + { return fAuxiliary->getFireWirePhysicalBufferMask(); } + + // returns a count of the maximum addressing bits supported by this controller + // intended for use with IODMACommand::withSpecification() + // all current hardware is 32 bit --- currently returns 32 + // this API is to allocate isoch and other buffers that don't need to be addressable by the bus + // it may someday return as high 64 bits + inline UInt32 getFireWirePhysicalBufferBits( void ) + { return fAuxiliary->getFireWirePhysicalBufferBits(); } + + inline IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimpleContiguousPhysicalAddressSpace( size, direction ); } + + inline IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimplePhysicalAddressSpace( size, direction ); } + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon, bool failOnReset) = 0; + + inline IOFWUserObjectExporter * getSessionRefExporter( void ) + { return fAuxiliary->getSessionRefExporter(); } + + private: + + OSMetaClassDeclareReservedUsed(IOFireWireBus, 0); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 1); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 2); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 3); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 4); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 5); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 6); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 7); + +}; + +#endif /* ! _IOKIT_IOFIREWIREBUS_H */ + diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireController.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireController.h.svn-base new file mode 100644 index 0000000..e2f3ae1 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireController.h.svn-base @@ -0,0 +1,1089 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IOFIREWIRECONTROLLER_H +#define _IOKIT_IOFIREWIRECONTROLLER_H + +#ifndef FIREWIREPRIVATE +#warning Please do not include this file. Include IOFireWireBus.h instead. +#endif + +#include +#include +#include +#include +#include +#include + +class OSData; +class IOWorkLoop; +class IOEventSource; +class IOFWQEventSource; +class IOTimerEventSource; +class IOMemoryDescriptor; +class IOFireWireController; +class IOFWAddressSpace; +class IOFWPseudoAddressSpace; +class IOFireWireNub; +class IOFireWireDevice; +class IOFireWireDeviceAux; +class IOFireWireUnit; +class IODCLProgram; +class IOLocalConfigDirectory; +class IOFireWireLink; +class IOFireWireSBP2ORB; +class IOFireWireSBP2Login; +class IOFireWireROMCache; +class IOFireWireLocalNode; +class IOFWWorkLoop; +class IOFireWireIRM; +class IOFireWirePowerManager; +class IOFWSimplePhysicalAddressSpace; +class IOFWSimpleContiguousPhysicalAddressSpace; +class IOFWAsyncStreamReceiver; +class IOFWAsyncStreamListener; +class IOFWUserVectorCommand; +class IOFWAsyncPHYCommand; +class IOFWPHYPacketListener; +class IOFWUserPHYPacketListener; + +#if FIRELOGCORE +class IOFireLog; +class IOFireLogPublisher; +#endif + +const UInt32 kMaxWaitForValidSelfID = 20; // Still invalid SelfID after 20 retries + +// Phy packet defs. + +enum +{ + kFWPhyPacketID = FWBitRange (0, 1), + kFWPhyPacketIDPhase = FWBitRangePhase (0, 1), + + kFWPhyPacketPhyID = FWBitRange (2, 7), + kFWPhyPacketPhyIDPhase = FWBitRangePhase (2, 7) +}; + +enum +{ + kSelfIDPacketSize = 8, + kMaxSelfIDs = 4 // SelfID 0,1,3,8 +}; + +enum +{ + kFWConfigurationPacketID = 0, + kFWLinkOnPacketID = 1, + kFWSelfIDPacketID = 2 +}; + +enum +{ + kFWPhyConfigurationR = FW_BIT(8), + kFWPhyConfigurationT = FW_BIT(9), + kFWPhyConfigurationGapCnt = FWBitRange (10, 15), + kFWPhyConfigurationGapCntPhase = FWBitRangePhase (10, 15) +}; + +enum +{ + kFWSelfIDPortStatusChild = 3, + kFWSelfIDPortStatusParent = 2, + kFWSelfIDPortStatusNotConnected = 1, + kFWSelfIDPortStatusNotPresent = 0, + + kFWSelfIDNoPower = 0, + kFWSelfIDSelfPowered15W = 1, + kFWSelfIDSelfPowered30W = 2, + kFWSelfIDSelfPowered45W = 3, + kFWSelfIDBusPowered1W = 4, + kFWSelfIDBusPowered3W = 5, + kFWSelfIDBusPowered6W = 6, + kFWSelfIDBusPowered10W = 7, + + kFWSelfIDPhyID = kFWPhyPacketPhyID,//zzz do we need or want this? + kFWSelfIDPhyIDPhase = kFWPhyPacketPhyIDPhase, + kFWSelfIDM = FW_BIT(31), + + kFWSelfID0L = FW_BIT(9), + kFWSelfID0GapCnt = FWBitRange (10, 15), + kFWSelfID0GapCntPhase = FWBitRangePhase (10, 15), + kFWSelfID0SP = FWBitRange (16, 17), + kFWSelfID0SPPhase = FWBitRangePhase (16, 17), + kFWSelfID0Del = FWBitRange (18, 19), + kFWSelfID0DelPhase = FWBitRangePhase (18, 19), + kFWSelfID0C = FW_BIT(20), + kFWSelfID0Pwr = FWBitRange (21, 23), + kFWSelfID0PwrPhase = FWBitRangePhase (21, 23), + kFWSelfID0P0 = FWBitRange (24, 25), + kFWSelfID0P0Phase = FWBitRangePhase (24, 25), + kFWSelfID0P1 = FWBitRange (26, 27), + kFWSelfID0P1Phase = FWBitRangePhase (26, 27), + kFWSelfID0P2 = FWBitRange (28, 29), + kFWSelfID0P2Phase = FWBitRangePhase (28, 29), + kFWSelfID0I = FW_BIT(30), + + kFWSelfIDPacketType = FW_BIT(8), + kFWSelfIDNN = FWBitRange (9, 11), + kFWSelfIDNNPhase = FWBitRangePhase (9, 11), + kFWSelfIDNPa = FWBitRange (14, 15), + kFWSelfIDNPaPhase = FWBitRangePhase (14, 15), + kFWSelfIDNPb = FWBitRange (16, 17), + kFWSelfIDNPbPhase = FWBitRangePhase (16, 17), + kFWSelfIDNPc = FWBitRange (18, 19), + kFWSelfIDNPcPhase = FWBitRangePhase (18, 19), + kFWSelfIDNPd = FWBitRange (20, 21), + kFWSelfIDNPdPhase = FWBitRangePhase (20, 21), + kFWSelfIDNPe = FWBitRange (22, 23), + kFWSelfIDNPePhase = FWBitRangePhase (22, 23), + kFWSelfIDNPf = FWBitRange (24, 25), + kFWSelfIDNPfPhase = FWBitRangePhase (24, 25), + kFWSelfIDNPg = FWBitRange (26, 27), + kFWSelfIDNPgPhase = FWBitRangePhase (26, 27), + kFWSelfIDNPh = FWBitRange (28, 29), + kFWSelfIDNPhPhase = FWBitRangePhase (28, 29), + kFWSelfIDMore = FW_BIT(31) +}; + +// Primary packet defs. +enum +{ + kFWPacketTCode = FWBitRange (24, 27), + kFWPacketTCodePhase = FWBitRangePhase (24, 27) +}; + + +enum +{ + kFWAsynchSpd = FWBitRange (14, 15), + kFWAsynchSpdPhase = FWBitRangePhase (14, 15), + + kFWAsynchTLabel = FWBitRange (16, 21), + kFWAsynchTLabelPhase = FWBitRangePhase (16, 21), + kFWAsynchTTotal = ((0xffffffff & kFWAsynchTLabel) >> kFWAsynchTLabelPhase)+1, + kFWAsynchRt = FWBitRange (22, 23), + kFWAsynchRtPhase = FWBitRangePhase (22, 23), + kFWAsynchNew = 0, + kFWAsynchRetryA = 2, + kTIAsycnhRetryB = 3, + + kFWAsynchPriority = FWBitRange (28, 31), + kFWAsynchPriorityPhase = FWBitRangePhase (28, 31), + + kFWAsynchDestinationID = FWBitRange (0, 15), + kFWAsynchDestinationIDPhase = FWBitRangePhase (0, 15), + + kFWAsynchSourceID = FWBitRange (0, 15), + kFWAsynchSourceIDPhase = FWBitRangePhase (0, 15), + + kFWAsynchDestinationOffsetHigh = FWBitRange (16, 31), + kFWAsynchDestinationOffsetHighPhase = FWBitRangePhase (16, 31), + + kFWAsynchDestinationOffsetLow = FWBitRange (0, 31), + kFWAsynchDestinationOffsetLowPhase = FWBitRangePhase (0, 31), + + kFWAsynchDataLength = FWBitRange (0, 15), + kFWAsynchDataLengthPhase = FWBitRangePhase (0, 15), + + kFWAsynchExtendedTCode = FWBitRange (16, 31), + kFWAsynchExtendedTCodePhase = FWBitRangePhase (16, 31), + + kFWAsynchAckSent = FWBitRange (28, 31), + kFWAsynchAckSentPhase = FWBitRangePhase (28, 31), + + kFWAsynchRCode = FWBitRange (16, 19), + kFWAsynchRCodePhase = FWBitRangePhase (16, 19) +}; + +enum +{ + kFWTCodeWriteQuadlet = 0, + kFWTCodeWriteBlock = 1, + kFWTCodeWriteResponse = 2, + kFWTCodeReadQuadlet = 4, + kFWTCodeReadBlock = 5, + kFWTCodeReadQuadletResponse = 6, + kFWTCodeReadBlockResponse = 7, + kFWTCodeCycleStart = 8, + kFWTCodeLock = 9, + kFWTCodeIsochronousBlock = 10, + kFWTCodeLockResponse = 11, + kFWTCodePHYPacket = 14 +}; + +enum +{ + kFWExtendedTCodeMaskSwap = 1, + kFWExtendedTCodeCompareSwap = 2, + kFWExtendedTCodeFetchAdd = 3, + kFWExtendedTCodeLittleAdd = 4, + kFWExtendedTCodeBoundedAdd = 5, + kFWExtendedTCodeWrapAdd = 6, + kFWExtendedTCodeVendorDependent = 7 +}; + +// debug boot-arg constants +enum +{ + kFWDebugIgnoreNodeNone = 0xFFFFFFFF +}; + +struct AsyncPendingTrans { + IOFWAsyncCommand * fHandler; + IOFWCommand * fAltHandler; + int fTCode; + bool fInUse; +}; + +struct IOFWNodeScan { + IOFireWireController * fControl; + FWAddress fAddr; + UInt32 fBuf[5]; // Enough for bus info block + UInt32 * fSelfIDs; + int fNumSelfIDs; + int fROMSize; + int fRead; + IOFWReadQuadCommand * fCmd; + IOFWCompareAndSwapCommand * fLockCmd; + UInt32 generation; + UInt32 fIRMBitBucketOld; + UInt32 fIRMBitBucketNew; + bool fIRMisBad; + bool speedChecking; + bool fContenderNeedsChecking; + bool fIRMCheckingRead; + bool fIRMCheckingLock; + int fRetriesBumped; + bool fMustNotBeRoot; +}; + + +typedef struct IOFWDuplicateGUIDStruct IOFWDuplicateGUIDRec; +struct IOFWDuplicateGUIDStruct + { + IOFWDuplicateGUIDRec * fNextGUID; + CSRNodeUniqueID fGUID; + UInt32 fLastGenSeen; +}; + + +// IOFireWireDuplicateGUIDList +// +// A little class for keeping track of GUIDs which where we have observed 2 nodes with +// the same GUID + +class IOFireWireDuplicateGUIDList : public OSObject +{ + OSDeclareDefaultStructors(IOFireWireDuplicateGUIDList); + +private: + IOFWDuplicateGUIDRec * fFirstGUID; + +protected: + virtual void free(); + +public: + + static IOFireWireDuplicateGUIDList * create( void ); + + void addDuplicateGUID( CSRNodeUniqueID guid, UInt32 gen ); + void removeDuplicateGUID( CSRNodeUniqueID guid ); + + bool findDuplicateGUID( CSRNodeUniqueID guid, UInt32 gen ); + +}; + +#define kMaxPendingTransfers kFWAsynchTTotal + +class IOFireWireController; + +#pragma mark - + +/*! + @class IOFireWireControllerAux +*/ + +class IOFireWireControllerAux : public IOFireWireBusAux +{ + OSDeclareDefaultStructors(IOFireWireControllerAux) + + friend class IOFireWireController; + +protected: + + IOFireWireController * fPrimary; + + UInt8 fMaxRec; + + UInt8 fPadding; + UInt16 fPadding2; + + IOFWUserObjectExporter * fSessionRefExporter; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init ( + IOFireWireController * primary ); + virtual void free (); + virtual IOFWDCLPool * createDCLPool ( unsigned capacity ) const ; + virtual UInt8 getMaxRec( void ); + + virtual UInt64 getFireWirePhysicalAddressMask( void ); + virtual UInt32 getFireWirePhysicalAddressBits( void ); + virtual UInt64 getFireWirePhysicalBufferMask( void ); + virtual UInt32 getFireWirePhysicalBufferBits( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWUserObjectExporter * getSessionRefExporter( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 7); + +}; + + +#pragma mark - + +/*! @class IOFireWireController +*/ +class IOFireWireController : public IOFireWireBus +{ + OSDeclareAbstractStructors(IOFireWireController) + +protected: + enum busState { + kStarting = 0, + kAsleep, // Link off, zzzzzz + kWaitingBusReset, + kWaitingSelfIDs, // Bus has been reset, no selfIDs yet + kWaitingScan, // Got selfIDs, waiting a bit before hitting lame devices + kScanning, // Reading node ROMs + kWaitingPrune, // Read all ROMs, pausing before pruning missing devices + kRunning, // Normal happy state, + kWaitingBusResetStart // bus reset is desired, but not yet sent to the fwim + }; + + enum ResetState + { + kResetStateResetting, + kResetStateDisabled, + kResetStateArbitrated + }; + + enum + { + kDisablePhysicalAccess = (1 << 0) + }; + + struct timeoutQ: public IOFWCmdQ + { + IOTimerEventSource *fTimer; + virtual void headChanged(IOFWCommand *oldHead); + void busReset(); + }; + + struct pendingQ: public IOFWCmdQ + { + IOFWQEventSource *fSource; + virtual void headChanged(IOFWCommand *oldHead); + }; + + friend class IOFireWireLink; + friend class IOFireWireDevice; + friend class IOFireWireDeviceAux; + friend class IOFWAddressSpace; + friend class IOFWAddressSpaceAux; + friend class IOFWPseudoAddressSpace; + friend class IOFireWireSBP2ORB; + friend class IOFireWireSBP2Login; + friend class IOFWLocalIsochPort; + friend class IOFWCommand; + friend class IOFireWireUnit; + friend class IOFireWirePCRSpace; + friend class IOFireWireROMCache; + friend class IOFWAsyncStreamCommand; + friend class IOFireWireAVCLocalUnit; + friend class IOFireWireAVCUnit; + friend class IOFireWireAVCCommand; + friend class IOFireWirePowerManager; + friend class IOFWWriteQuadCommand; + friend class IOFWWriteCommand; + friend class IOFWCompareAndSwapCommand; + friend class IOFWAsyncCommand; + friend class IOFireWireAVCTargetSpace; + friend class AppleFWOHCI; + friend class IOFireWireNub; + friend class IOFWAsyncStreamListener; + friend class IOFireWireLocalNode; + friend class IOFireWireIRMAllocation; + friend class IOFWUserVectorCommand; + friend class IOFWAsyncPHYCommand; + friend class IOFWUserPHYPacketListener; + friend class IOFWAsyncStreamReceiver; + +#if FIRELOGCORE + friend class IOFireLog; +#endif + + IOFireWireLink * fFWIM; + IOFWWorkLoop * fWorkLoop; + IOTimerEventSource * fTimer; + OSSet * fLocalAddresses; // Collection of local adress spaces + OSIterator * fSpaceIterator; // Iterator over local addr spaces + + OSSet * fAllocatedChannels; // Need to be informed of bus resets + OSIterator * fAllocChannelIterator; // Iterator over channels + + OSSet * fIRMAllocations; // Need to be informed of bus resets + OSIterator * fIRMAllocationsIterator; // Iterator over channels + OSSet * fIRMAllocationsAllocated; // Need to be informed of bus resets + + // Bus management variables (although we aren't a FireWire Bus Manager...) + AbsoluteTime fResetTime; // Time of last reset + UInt32 fBusGeneration; // ID of current bus topology. + UInt16 fLocalNodeID; // ID of local node, ie. this computer + UInt16 fRootNodeID; // ID of root, ie. highest node id in use. + UInt16 fIRMNodeID; // ID of Isochronous resource manager, or kFWBadNodeID + bool fBusMgr; // true if at least one node is bus manager capable + IORegistryEntry * fNodes[kFWMaxNodesPerBus]; // FireWire nodes on this bus + UInt32 * fNodeIDs[kFWMaxNodesPerBus+1]; // Pointer to SelfID list for each node + // +1 so we know how many selfIDs the last node has + + UInt32 fGapCount; // What we think the gap count should be + //UInt8 fSpeedCodes[(kFWMaxNodesPerBus+1)*kFWMaxNodesPerBus]; + UInt8 fSpeedVector[((kFWMaxNodesPerBus+1)*kFWMaxNodesPerBus)/2]; + // Max speed between two nodes + busState fBusState; // Which state are we in? + int fNumROMReads; // Number of device ROMs we are still reading + // SelfIDs + int fNumSelfIDs; // Total number of SelfID packets + UInt32 fSelfIDs[kMaxSelfIDs*kFWMaxNodesPerBus]; + + // The local device's Config ROM + UInt32 fROMHeader[5]; // More or less fixed header and bus info block + IOLocalConfigDirectory * fRootDir; // Local Config ROM root directory. + + // log base 2 of maximum packet size the FWIM can send/receive + // Normally calculated from bus info block. + int fMaxSendLog; + int fMaxRecvLog; + + IOFWAddressSpace * fROMAddrSpace; + IOMemoryDescriptor * fBadReadResponse; // Send back easily identified bad data to out of range addrs. + + // Array for outstanding requests (up to 64) + AsyncPendingTrans fTrans[kMaxPendingTransfers]; + int fLastTrans; + + // queue for executing commands that may timeout + timeoutQ fTimeoutQ; + + // queue for commands that can't execute yet + pendingQ fPendingQ; + + // queue for async commands interrupted by bus reset + IOFWCmdQ fAfterResetHandledQ; + + // Command to change bus state after a delay. + IOFWDelayCommand * fDelayedStateChangeCmd; + bool fDelayedStateChangeCmdNeedAbort; + + UInt32 fDelayedPhyPacket; + bool fBusResetScheduled; + ResetState fBusResetState; + IOFWDelayCommand * fBusResetStateChangeCmd; + UInt32 fBusResetDisabledCount; + +#if FIRELOGCORE + IOFireLogPublisher * fFireLogPublisher; +#else + void * fFireLogPublisher; +#endif + + OSData * fAllocatedAddresses; + + UInt32 fDevicePruneDelay; + + IOFWPhysicalAccessMode fPhysicalAccessMode; + IOFWSecurityMode fSecurityMode; + IONotifier * fKeyswitchNotifier; + + IOFireWireIRM * fIRM; + IOFireWirePowerManager * fBusPowerManager; + + bool fGapCountMismatch; + + bool fUseHalfSizePackets; + bool fRequestedHalfSizePackets; + + IOFWNodeScan * fScans[kFWMaxNodesPerBus]; + IOFireWireDuplicateGUIDList * fGUIDDups; + + bool fDelegateCycleMaster; + bool fBadIRMsKnown; + + UInt32 fPreviousGap; + + UInt32 fOutOfTLabels; + UInt32 fOutOfTLabels10S; + UInt32 fOutOfTLabelsThreshold; + +#ifdef LEGACY_SHUTDOWN + IONotifier * fPowerEventNotifier; +#endif + + bool fStarted; + + UInt32 fIOCriticalSectionCount; + UInt32 fHubPort; + UInt32 fDebugIgnoreNode; + + OSSet * fLocalAsyncStreamReceivers; + OSIterator * fAsyncStreamReceiverIterator; + + bool fInstantiated; + + IOReturn fStartStatus; + UInt32 fWaitingForSelfID; + + UInt32 fForcedRootNodeID; + bool fNodeMustBeRootFlag; + bool fNodeMustNotBeRootFlag; + + UInt32 fForcedGapCount; + bool fForcedGapFlag; + + OSSet * fPHYPacketListeners; + OSIterator * fPHYPacketListenersIterator; + + bool fDSLimited; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void clockTick(OSObject *, IOTimerEventSource *); + static void readROMGlue(void *refcon, IOReturn status, + IOFireWireNub *device, IOFWCommand *fwCmd); + static void delayedStateChange(void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd); + + virtual void processBusReset(); + virtual void processSelfIDs(UInt32 *IDs, int numIDs, UInt32 *ownIDs, int numOwnIDs); + virtual void processTimeout(IOTimerEventSource *src); + virtual void processRcvPacket( UInt32 *data, int numQuads, IOFWSpeed speed ); + virtual void processWriteRequest(UInt16 sourceID, UInt32 tlabel, + UInt32 *hdr, void *buf, int len, IOFWSpeed speed); + virtual void processLockRequest(UInt16 sourceID, UInt32 tlabel, + UInt32 *hdr, void *buf, int len, IOFWSpeed speed); + + // Process read from a local address, return rcode + virtual UInt32 doReadSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, IODMACommand **dma_command, + IOFWRequestRefCon refcon); + + // Process write to a local address, return rcode + virtual UInt32 doWriteSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + // Process lock to a local address, return rcode + UInt32 doLockSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 inlen, + const UInt32 *newVal, UInt32 &outLen, UInt32 *oldVal, + UInt32 extType, IOFWRequestRefCon refcon); + + virtual void updatePlane(); + virtual void startBusScan(); + + // Called when all devices on bus have been examined + virtual void finishedBusScan(); + + virtual void buildTopology(bool doFWPlane); + + virtual void readDeviceROM(IOFWNodeScan *refCon, IOReturn status); + + virtual IOReturn UpdateROM(); + virtual IOReturn allocAddress(IOFWAddressSpace *space); + virtual void freeAddress(IOFWAddressSpace *space); + + IOFireWireBusAux * createAuxiliary( void ); + +public: + + // Initialization + virtual bool init(IOFireWireLink *fwim); + virtual void free(); + virtual bool start(IOService *provider); + virtual void stop( IOService * provider ); + virtual bool finalize( IOOptionBits options ); + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + + // Power management + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); + + // Implement IOService::getWorkLoop + virtual IOWorkLoop *getWorkLoop() const; + + // Allocate struct for tracking a transaction + virtual AsyncPendingTrans *allocTrans(IOFWAsyncCommand *cmd=NULL); + virtual void freeTrans(AsyncPendingTrans *trans); + + // Really public methods + + virtual IOReturn getCycleTime(UInt32 &cycleTime); + virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime); + + // Methods to manipulate the local Config ROM + virtual IOReturn AddUnitDirectory(IOLocalConfigDirectory *unitDir); + virtual IOReturn RemoveUnitDirectory(IOLocalConfigDirectory *unitDir); + + // Cause a bus reset + virtual IOReturn resetBus(); + + // Send async request packets + virtual IOReturn asyncRead( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int size, + IOFWAsyncCommand * cmd ); + + virtual IOReturn asyncWrite( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd ); + + /* DEPRECATED */ virtual IOReturn asyncWrite( UInt32 generation, + /* DEPRECATED */ UInt16 nodeID, + /* DEPRECATED */ UInt16 addrHi, + /* DEPRECATED */ UInt32 addrLo, + /* DEPRECATED */ int speed, + /* DEPRECATED */ int label, + /* DEPRECATED */ void * data, + /* DEPRECATED */ int size, + /* DEPRECATED */ IOFWAsyncCommand * cmd ); + + /* DEPRECATED */ virtual IOReturn asyncLock( UInt32 generation, + /* DEPRECATED */ UInt16 nodeID, + /* DEPRECATED */ UInt16 addrHi, + /* DEPRECATED */ UInt32 addrLo, + /* DEPRECATED */ int speed, + /* DEPRECATED */ int label, + /* DEPRECATED */ int type, + /* DEPRECATED */ void * data, + /* DEPRECATED */ int size, + /* DEPRECATED */ IOFWAsyncCommand * cmd); + + + // Send async read response packets + // useful for pseudo address spaces that require servicing outside the FireWire work loop. + virtual IOReturn asyncReadResponse( UInt32 generation, + UInt16 nodeID, + int speed, + IOMemoryDescriptor * buf, + IOByteCount offset, + int len, + IOFWRequestRefCon refcon ); + + virtual IOReturn asyncLockResponse( UInt32 generation, + UInt16 nodeID, + int speed, + IOMemoryDescriptor * buf, + IOByteCount offset, + int len, + IOFWRequestRefCon refcon ); + + // Try to fix whatever might have caused the other device to not respond + virtual IOReturn handleAsyncTimeout(IOFWAsyncCommand *cmd); + + // Convert a firewire nodeID into the IOFireWireDevice for it + virtual IOFireWireDevice * nodeIDtoDevice(UInt32 generation, UInt16 nodeID); + + // Add/remove a channel from the list informed of bus resets + virtual void addAllocatedChannel(IOFWIsochChannel *channel); + virtual void removeAllocatedChannel(IOFWIsochChannel *channel); + + // Add/remove a IRM allocation from the list informed of bus resets + virtual void addIRMAllocation(IOFireWireIRMAllocation *irmAllocation); + virtual void removeIRMAllocation(IOFireWireIRMAllocation *irmAllocation); + + // Create an Isochronous Channel object + // doIRM = true => allocate channel and bandwith in Isochronous Resource Manager + // packetSize packet size (in bytes), used to calculate bandwidth needed. + virtual IOFWIsochChannel *createIsochChannel( + bool doIRM, UInt32 packetSize, IOFWSpeed prefSpeed, + FWIsochChannelForceStopNotificationProc stopProc=NULL, + void *stopRefCon=NULL); + + // Create a local isochronous port to run the given DCL program + // if task is 0, the DCL program is for the kernel task, + // otherwise all DCL pointers are valid in the specified task. + // opcodes is also pointer valid in the specified task. + virtual IOFWLocalIsochPort *createLocalIsochPort(bool talking, + DCLCommand* opcodes, DCLTaskInfo *info = 0, + UInt32 startEvent = 0, UInt32 startState = 0, UInt32 startMask = 0); + + // Execute specified function on workloop after specified delay + // Returned command is for delay, call it's cancel() function to cancel timeout. + virtual IOFWDelayCommand * createDelayedCmd(UInt32 uSecDelay, FWBusCallback func, void *refcon); + + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + // Extract info about the async request + virtual bool isLockRequest(IOFWRequestRefCon refcon); + virtual bool isQuadRequest(IOFWRequestRefCon refcon); + virtual UInt32 getExtendedTCode(IOFWRequestRefCon refcon); + + // Inline accessors for protected member variables + IOFWCmdQ &getTimeoutQ(); + IOFWCmdQ &getPendingQ(); + IOFWCmdQ &getAfterResetHandledQ(); + IOFireWireLink * getLink() const; + + IOLocalConfigDirectory *getRootDir() const; + bool checkGeneration(UInt32 gen) const; + UInt32 getGeneration() const; + UInt16 getLocalNodeID() const; + IOReturn getIRMNodeID(UInt32 &generation, UInt16 &id); + + const AbsoluteTime * getResetTime() const; + + IOFWSpeed FWSpeed(UInt16 nodeAddress) const; + IOFWSpeed FWSpeed(UInt16 nodeA, UInt16 nodeB) const; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog(bool forSend, UInt16 nodeAddress) const; + + // How big (as a power of two) can packets sent from A to B be? + virtual int maxPackLog(UInt16 nodeA, UInt16 nodeB) const; + + // Force given node to be root (via root holdoff Phy packet) + virtual IOReturn makeRoot(UInt32 generation, UInt16 nodeID) ; + + virtual IOFWPseudoAddressSpace *createInitialAddressSpace(UInt32 addressLo, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + virtual IOFWAddressSpace *getAddressSpace(FWAddress address); + + // Extract info about the async request - was the request ack'ed complete already? + virtual bool isCompleteRequest(IOFWRequestRefCon refcon); + + // Are we currently scanning the bus? + bool scanningBus() const; + +protected: + + void openGate(); + void closeGate(); + +protected: + virtual void doBusReset( void ); + static void resetStateChange( void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +public: + virtual IOReturn disableSoftwareBusResets( void ); + virtual void enableSoftwareBusResets( void ); + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon); + + virtual IOReturn asyncStreamWrite(UInt32 generation, + int speed, int tag, int sync, int channel, + IOMemoryDescriptor *buf, IOByteCount offset, + int size, IOFWAsyncStreamCommand *cmd); + +protected: + bool inGate(); + + virtual IOReturn allocatePseudoAddress(FWAddress *addr, UInt32 lenDummy); + virtual void freePseudoAddress(FWAddress addr, UInt32 lenDummy); + + virtual IORegistryEntry * createDummyRegistryEntry( IOFWNodeScan *scan ); + + static IOFireWireLocalNode * getLocalNode(IOFireWireController *control); + + virtual void setPhysicalAccessMode( IOFWPhysicalAccessMode mode ); + virtual IOFWPhysicalAccessMode getPhysicalAccessMode( void ); + virtual void physicalAccessProcessBusReset( void ); + virtual void setNodeIDPhysicalFilter( UInt16 nodeID, bool state ); + + virtual void initSecurity( void ); + virtual void freeSecurity( void ); + static bool serverKeyswitchCallback( void * target, void * refCon, IOService * service, IONotifier * notifier ); + virtual void setSecurityMode( IOFWSecurityMode mode ); + virtual IOFWSecurityMode getSecurityMode( void ); + + virtual IOReturn createTimeoutQ( void ); + virtual void destroyTimeoutQ( void ); + virtual IOReturn createPendingQ( void ); + virtual void destroyPendingQ( void ); + + virtual UInt32 countNodeIDChildren( UInt16 nodeID, int hub_port = 0, int * hubChildRemainder = NULL, bool * hubParentFlag = NULL ); + +public: + virtual UInt32 hopCount(UInt16 nodeAAddress, UInt16 nodeBAddress ); + virtual UInt32 hopCount(UInt16 nodeAAddress ); + + virtual IOFireWirePowerManager * getBusPowerManager( void ); + +protected: + virtual void handleARxReqIntComplete(); + + virtual IOReturn asyncLock( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int type, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd ); + + virtual IOReturn asyncWrite( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd, + IOFWWriteFlags flags ); + +protected: + bool delayedStateCommandInUse() const; + void enterBusResetDisabledState( ); + + virtual UInt32 getPortNumberFromIndex( UInt16 index ); + + virtual bool checkForDuplicateGUID(IOFWNodeScan *scan, CSRNodeUniqueID *currentGUIDs ); + virtual void updateDevice(IOFWNodeScan *scan ); + virtual bool AssignCycleMaster(); + +public: + + IOReturn clipMaxRec2K(Boolean clipMaxRec ); + void setNodeSpeed( UInt16 nodeAddress, IOFWSpeed speed ); + void useHalfSizePackets( void ); + void disablePhyPortOnSleepForNodeID( UInt32 nodeID ); + + IOReturn handleAsyncCompletion( IOFWCommand *cmd, IOReturn status ); + void processCycle64Int(); + +#ifdef LEGACY_SHUTDOWN + static IOReturn systemShutDownHandler( void * target, void * refCon, + UInt32 messageType, IOService * service, + void * messageArgument, vm_size_t argSize ); +#else + virtual void systemWillShutdown( IOOptionBits specifier ); +#endif + + IOReturn beginIOCriticalSection( void ); + void endIOCriticalSection( void ); + +protected: + IOReturn poweredStart( void ); + void setNodeSpeed( UInt16 nodeA, UInt16 nodeB, UInt8 speed ); + void setNodeSpeed( UInt16 nodeAddress, UInt8 speed ); + +public: + bool isPhysicalAccessEnabledForNodeID( UInt16 nodeID ); + + // Allocate IRM bandwidth if the specified generation is the current FireWire generation. + IOReturn allocateIRMBandwidthInGeneration(UInt32 bandwidthUnits, UInt32 generation) ; + + // Release IRM bandwidth if the specified generation is the current FireWire generation. + IOReturn releaseIRMBandwidthInGeneration(UInt32 bandwidthUnits, UInt32 generation) ; + + // Allocate IRM channel if the specified generation is the current FireWire generation. + IOReturn allocateIRMChannelInGeneration(UInt8 isochChannel, UInt32 generation) ; + + // Release IRM channel if the specified generation is the current FireWire generation. + IOReturn releaseIRMChannelInGeneration(UInt8 isochChannel, UInt32 generation) ; + + // Create an IOFireWireIRMAllocation object which can be used to allocate isoch resources that are automatically reallocated after bus-resets! + IOFireWireIRMAllocation *createIRMAllocation(Boolean releaseIRMResourcesOnFree = true, + IOFireWireIRMAllocation::AllocationLostNotificationProc allocationLostProc = NULL, + void *pLostNotificationProcRefCon = NULL); + + IOFWAsyncStreamListener *createAsyncStreamListener( UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + + void removeAsyncStreamListener( IOFWAsyncStreamListener *listener ); + + IOFWSpeed getBroadcastSpeed(){ return FWSpeed( fLocalNodeID ); }; + +private: + + IOFWAsyncStreamReceiver *allocAsyncStreamReceiver( UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + + IOFWAsyncStreamReceiver *getAsyncStreamReceiver( UInt32 channel ); + + void freeAllAsyncStreamReceiver(); + + void activateAsyncStreamReceivers(); + + void deactivateAsyncStreamReceivers(); + +protected: + IOService *findKeyswitchDevice( void ); + void suspendBus( void ); + +public: + virtual IOReturn asyncRead( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int size, + IOFWAsyncCommand * cmd, + IOFWReadFlags flags ); + + void checkProgress( void ); + + void terminateDevice( IOFireWireDevice * device ); + + void nodeMustBeRoot( UInt32 nodeID ); + + void nodeMustNotBeRoot( UInt32 nodeID ); + + void setGapCount( UInt32 gapCount ); + + IOReturn asyncPHYPacket( UInt32 generation, + UInt32 data, + UInt32 data2, + IOFWAsyncPHYCommand * cmd ); + + IOFWAsyncPHYCommand * createAsyncPHYCommand( UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + +private: + AsyncPendingTrans * allocTrans( IOFWAsyncCommand * cmd, IOFWCommand * altcmd ); + +public: + + IOReturn activatePHYPacketListener( IOFWPHYPacketListener * listener ); + void deactivatePHYPacketListener( IOFWPHYPacketListener * listener ); + + IOFWPHYPacketListener * createPHYPacketListener( FWPHYPacketCallback proc, void * refcon ); + +private: + void processPHYPacket( UInt32 data1, UInt32 data2 ); + void enterLoggingMode( void ); + +public: + IOReturn getCycleTimeAndUpTime( UInt32 &cycleTime, UInt64 &uptime ); + +protected: + void removeAsyncStreamReceiver( IOFWAsyncStreamReceiver *receiver ); + +public: + + // Create a multi-isoch-receive listener + IOFireWireMultiIsochReceiveListener * createMultiIsochReceiveListener(UInt32 channel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams = NULL); + + // Activate a multi-isoch-receive listener + IOReturn activateMultiIsochReceiveListener(IOFireWireMultiIsochReceiveListener *pListener); + + // Deactivate a multi-isoch-receive listener + IOReturn deactivateMultiIsochReceiveListener(IOFireWireMultiIsochReceiveListener *pListener); + + // Call for client to specify he is done with a multi-isoch receiver isoch packet + void clientDoneWithMultiIsochReceivePacket(IOFireWireMultiIsochReceivePacket *pPacket); + +public: + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon, bool failOnReset); + +private: + void addToIRMAllocationSet(IOFireWireIRMAllocation *anObject); + void removeFromIRMAllocationSet(IOFireWireIRMAllocation *anObject); + +protected: + OSMetaClassDeclareReservedUnused(IOFireWireController, 0); + OSMetaClassDeclareReservedUnused(IOFireWireController, 1); + OSMetaClassDeclareReservedUnused(IOFireWireController, 2); + OSMetaClassDeclareReservedUnused(IOFireWireController, 3); + OSMetaClassDeclareReservedUnused(IOFireWireController, 4); + OSMetaClassDeclareReservedUnused(IOFireWireController, 5); + OSMetaClassDeclareReservedUnused(IOFireWireController, 6); + OSMetaClassDeclareReservedUnused(IOFireWireController, 7); + OSMetaClassDeclareReservedUnused(IOFireWireController, 8); + +}; + +#endif /* ! _IOKIT_IOFIREWIRECONTROLLER_H */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireDevice.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireDevice.h.svn-base new file mode 100644 index 0000000..a68e5a2 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireDevice.h.svn-base @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + /*! @header + This header contains the definition of the IOFireWireDevice and IOFireWireDeviceAux classes. + An IOFireWireDevice object represents a FireWire device in the I/O Registry. + It is strongly recommended that you write applications that access FireWire devices rather than in-kernel device drivers. + For more information on how to do this, see {@linkdoc //apple_ref/doc/uid/TP40000969 FireWire Device Interface Guide}. + @indexgroup FireWire + */ +#ifndef _IOKIT_IOFIREWIREDEVICE_H +#define _IOKIT_IOFIREWIREDEVICE_H + +#include + +class IOFireWireROMCache; + +struct IOFWNodeScan; +struct RomScan; + +class IOFireWireDevice; + +#pragma mark - + +/*! @class IOFireWireDeviceAux + @discussion An IOFireWireDeviceAux is for internal use only. You should never subclass IOFireWireDeviceAux +*/ + +class IOFireWireDeviceAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireDeviceAux) + + friend class IOFireWireDevice; + +protected: + + UInt32 fUnitCount; + IOFWSpeed fMaxSpeed; + OSSet * fOpenUnitSet; + AbsoluteTime fResumeTime; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireDevice * primary ); + + virtual void free(); + + virtual bool isTerminated( void ); + + virtual void setTerminationState( TerminationState state ); + + void setMaxSpeed( IOFWSpeed speed ); + + void setUnitCount( UInt32 count ); + + UInt32 getUnitCount( void ); + + bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + + OSSet * getOpenUnitSet() const; + + void latchResumeTime( void ); + + AbsoluteTime getResumeTime( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 3); +}; + +#pragma mark - +/*! @class IOFireWireDevice + @abstract Represents a FireWire device. + @discussion The FireWire family tries to read the configuration ROM of each device on the FireWire bus. For each device that responds with + its bus information block, the FireWire family publishes an IOFireWireDevice object in the I/O Registry. An + IOFireWireDevice object keeps track of the device's node ID, copies config ROM properties into the object's property + list, and scans the config ROM for unit directories, publishing an IOFireWireUnit object for each unit directory it finds. +*/ + +class IOFireWireDevice : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireDevice) + + friend class IOFireWireController; + friend class IOFireWireDeviceAux; + +protected: + + enum RegistrationState + { + kDeviceRegistered, + kDeviceNeedsRegisterService, + kDeviceNotRegistered + }; + + IOFireWireROMCache *fDeviceROM; + bool fOpenFromDevice; + UInt32 fOpenFromUnitCount; + UInt32 fROMGeneration; + IORecursiveLock *fROMLock; + RegistrationState fRegistrationState; + UInt32 fROMReadRetry; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void readROMDirGlue(void *refcon, IOReturn status, + IOFireWireNub *device, IOFWCommand *fwCmd); + static void readROMThreadFunc(void *arg); + + static void terminateDevice(void *arg); + + void processROM(RomScan *romScan); + + virtual void free(); + +public: + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ); + + virtual void handleClose( IOService * forClient, IOOptionBits options ); + + virtual bool handleIsOpen( const IOService * forClient ) const; + +protected: + virtual IOReturn cacheROM(OSData *rom, UInt32 offset, const UInt32 *&romBase); + + virtual const UInt32 * getROMBase(); + + virtual void setNodeROM(UInt32 generation, UInt16 localNodeID, const IOFWNodeScan *info); + +public: + virtual bool matchPropertyTable(OSDictionary * table); + + /*! @function init + @abstract Initializes the nub. + @param propTable Property table passed to the standard nub initialization. + @param scan Pointer to the node scan structure. + @result Returns true if initialization was successful; false otherwise. + */ + virtual bool init(OSDictionary * propTable, const IOFWNodeScan *scan); + + virtual bool attach(IOService * provider ); + + virtual bool finalize( IOOptionBits options ); + + /*! @function setNodeFlags + @abstract Sets the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + */ + virtual void setNodeFlags( UInt32 flags ); + + /*! @function clearNodeFlags + @abstract Resets the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + */ + virtual void clearNodeFlags( UInt32 flags ); + + /*! @function getNodeFlags + @abstract Retrieves the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + @result UInt32 The flags set for a particular node. + */ + virtual UInt32 getNodeFlags( void ); + +protected: + virtual IOReturn configureNode( void ); + +public: + /*! @function createPhysicalAddressSpace + @abstract Creates local physical FireWire address spaces for the device to access. + @param mem Memory area allocated to back the physical access by Link hardware. + @result A valid IOFWPhysicalAddressSpace object on success; NULL on failure. + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + + /*! @function createPseudoAddressSpace + @abstract Creates local pseudo FireWire address spaces for the device to access. + @param addr The FireWire address that is mapped to the pseudo address access. + @param len Size of the address space to allocate. + @param reader Read callback, when the device reads from this address space. + @param writer Write callback, when the device writes to this address space. + @param refcon Client's callback object returned during reader/writer callbacks. + @result A valid IOFWPseudoAddressSpace object on success; NULL on failure. + */ + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + +protected: + virtual IOReturn readRootDirectory( IOConfigDirectory * directory, OSDictionary * propTable ); + + virtual IOReturn processRootDirectory( OSDictionary * propTable ); + + virtual IOReturn readUnitDirectories( IOConfigDirectory * directory, OSSet * unitInfo ); + + virtual IOReturn processUnitDirectories( OSSet * unitSet ); + + virtual void setRegistrationState( RegistrationState fRegistrationState ); + + virtual void preprocessDirectories( OSDictionary * rootPropTable, OSSet * unitSet ); + + virtual void configurePhysicalFilter( void ); + +protected: + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + inline bool isTerminated( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->isTerminated(); } + + /*! @function setMaxSpeed + @abstract Sets the maximum speed for this node. + @param speed Maximum speed. Refer to "bus speed numbers" in IOFireWireFamilyCommon.h. + */ + inline void setMaxSpeed( IOFWSpeed speed ) + { ((IOFireWireDeviceAux*)fAuxiliary)->setMaxSpeed( speed ); } + +protected: + inline void setUnitCount( UInt32 count ) + { ((IOFireWireDeviceAux*)fAuxiliary)->setUnitCount( count ); } + + inline OSSet * getOpenUnitSet( void ) const + { return ((IOFireWireDeviceAux*)fAuxiliary)->getOpenUnitSet(); } + +public: + /*! @function getUnitCount + @abstract Returns number of units attached to this device. + @result UInt32 The number of units attached to this device. + */ + inline UInt32 getUnitCount( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->getUnitCount(); } + +protected: + inline AbsoluteTime getResumeTime( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->getResumeTime(); } + + inline void latchResumeTime( void ) + { ((IOFireWireDeviceAux*)fAuxiliary)->latchResumeTime(); } + +private: + OSMetaClassDeclareReservedUnused(IOFireWireDevice, 0); + OSMetaClassDeclareReservedUnused(IOFireWireDevice, 1); + +}; + +#endif /* ! _IOKIT_IOFIREWIREDEVICE_H */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireFamilyCommon.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireFamilyCommon.h.svn-base new file mode 100644 index 0000000..ceb426d --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireFamilyCommon.h.svn-base @@ -0,0 +1,1235 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOFireWireFamilyCommon.h + * IOFireWireUserClient/IOFireWireFamily + * + * Created by NWG on Fri Apr 28 2000. + * Copyright (c) 2000-2001 Apple Computer, Inc. All rights reserved. + * + */ +/* + $Log: IOFireWireFamilyCommon.h,v $ + Revision 1.79 2008/07/15 01:29:44 collin + & + + Revision 1.78 2008/05/08 02:33:22 collin + more K64 + + Revision 1.77 2008/04/24 00:01:39 collin + more K640 + + Revision 1.76 2007/12/05 04:52:08 collin + integrate chex workaround + + Revision 1.75 2007/08/31 20:29:06 collin + fixed 5437835 + + Revision 1.74 2007/04/24 21:40:23 arulchan + headerdoc changes + + Revision 1.73 2007/04/24 21:28:24 arulchan + changes for headerdoc + + Revision 1.72 2007/04/13 19:37:01 calderon + Integrated FireWireKPrintf implemented + + Revision 1.71 2007/03/14 18:41:43 collin + *** empty log message *** + + Revision 1.70 2007/02/28 23:10:13 ayanowit + Another IRMAllocation fix. + + Revision 1.69 2007/02/20 01:25:28 collin + *** empty log message *** + + Revision 1.68 2007/02/17 00:26:51 collin + *** empty log message *** + + Revision 1.67 2007/02/15 19:42:07 ayanowit + For 4369537, eliminated support for legacy DCL SendPacketWithHeader, since it didn't work anyway, and NuDCL does support it. + + Revision 1.66 2007/02/15 01:23:39 arulchan + changes in AssignCycleMaster + + Revision 1.65 2007/02/09 04:44:06 collin + *** empty log message *** + + Revision 1.64 2007/01/26 20:52:31 ayanowit + changes to user-space isoch stuff to support 64-bit apps. + + Revision 1.63 2007/01/16 01:41:02 gecko1 + 4159728 Add improved async lock based check for bad IRMs + + Revision 1.62 2007/01/15 23:29:05 arulchan + Fixed Skipped Packet Handler Notifications + + Revision 1.61 2007/01/12 22:15:14 arulchan + Added flag kIOFWEnableBeingRoot + + Revision 1.60 2007/01/10 22:14:44 calderon + Fixed 4046607 Propagate vendor/model from IIDC UnitDepedantInfoDir + Fixed some null termination shinanigans in getIndexValue(string) + + Revision 1.59 2007/01/08 18:47:19 ayanowit + More 64-bit changes for isoch. + + Revision 1.58 2006/07/07 20:18:25 calderon + 4227201: SpeedMap and HopCount table reductions. + + Revision 1.57 2006/04/03 21:29:48 collin + *** empty log message *** + + Revision 1.56 2006/02/09 00:21:51 niels + merge chardonnay branch to tot + + Revision 1.55.4.1 2005/08/06 01:31:31 collin + *** empty log message *** + + Revision 1.55 2005/03/12 03:27:51 collin + *** empty log message *** + + Revision 1.54 2005/01/12 06:34:53 collin + *** empty log message *** + + Revision 1.53 2004/05/04 22:52:19 niels + *** empty log message *** + + Revision 1.52 2004/03/26 01:42:53 gecko1 + Add code to disable any port directly connected to an iPod when we go to sleep. + + Revision 1.51 2004/03/05 00:33:59 calderon + Fixed 3570909 - FireWire - iokit_fw_errs should be defined in hex + All decimal #define errors in header changed to hex + + Revision 1.50 2003/11/07 21:01:18 niels + Revision 1.49 2003/10/21 01:16:41 collin + Revision 1.48 2003/10/17 00:25:24 collin + Revision 1.47 2003/10/15 02:19:45 collin + Revision 1.46 2003/07/22 10:49:47 niels + Revision 1.45 2003/07/21 06:52:59 niels + merge isoch to TOT + + Revision 1.44.4.5 2003/07/21 06:44:44 niels + Revision 1.44.4.4 2003/07/18 00:17:42 niels + Revision 1.44.4.3 2003/07/14 22:08:53 niels + Revision 1.44.4.2 2003/07/09 21:24:01 niels + Revision 1.44.4.1 2003/07/01 20:54:07 niels + isoch merge + + Revision 1.44 2003/03/17 01:05:22 collin + Revision 1.43 2003/03/07 01:26:06 collin + Revision 1.42 2003/02/19 22:33:17 niels + add skip cycle DCL + + Revision 1.41 2003/02/18 00:14:01 collin + Revision 1.40 2003/02/17 21:47:52 collin + Revision 1.39 2002/12/05 19:08:37 niels + remove trailing commas from enums in IOFireWireFamilyCommon.h + + Revision 1.38 2002/11/01 20:45:57 collin + add enhanced IRM with support for the BROADCAST_CHANNEL register + + Revision 1.37 2002/10/01 02:40:27 collin + security mode support + + Revision 1.36 2002/09/25 21:17:14 collin + fix headers again. + + Revision 1.35 2002/09/25 00:27:23 niels + flip your world upside-down + + Revision 1.34 2002/09/12 22:41:53 niels + add GetIRMNodeID() to user client + +*/ + +/*! @header IOFireWireFamilyCommon.h +This file contains useful definitions for working with FireWire +in the kernel and in user space +*/ + +#ifndef __IOFireWireFamilyCommon_H__ +#define __IOFireWireFamilyCommon_H__ + +#ifdef KERNEL +#ifndef __IOKIT_IOTYPES_H + #include +#endif +#else +#include +#endif + +//#define LEGACY_SHUTDOWN + +#define FW_OLD_DCL_DEFS +#define FW_OLD_BIT_DEFS + +// ================================================================= +// bit ranges and fields +// ================================================================= +#pragma mark - +#pragma mark BITS + +// FireWire bit defs. + +#define BIT(x) ( 1 << (x) ) +#define FW_BIT(x) ( 1 << (31 - (x) ) ) + +#define FWBitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (start)) >> \ + ((start) + (31 - (end)))) << \ + (31 - (end)) \ +) + +#define FWBitRangePhase(start, end) \ + (31 - (end)) + +#define BitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >> \ + ((31 - (end)) + (start))) << \ + (start) \ +) + + +#define BitRangePhase(start, end) \ + (start) + +// ================================================================= +// FireWire messages & errors +// ================================================================= +#pragma mark - +#pragma mark MESSAGES AND ERRORS + +#define iokit_fw_err(return) (sys_iokit|sub_iokit_firewire|return) + +// e0008010 -> 0xe000801f Response codes from response packets + +// Base of Response error codes +#define kIOFireWireResponseBase iokit_fw_err(0x10) + +// e0008020 -- Bus reset during command execution (current bus generation does +// not match that specified in command.) +#define kIOFireWireBusReset (kIOFireWireResponseBase+kFWResponseBusResetError) + +// e0008001 -- Can't find requested entry in ROM +#define kIOConfigNoEntry iokit_fw_err(0x1) + +// e0008002 -- In pending queue waiting to execute +#define kIOFireWirePending iokit_fw_err(0x2) + +// e0008003 -- Last DCL callback of program (internal use) +#define kIOFireWireLastDCLToken iokit_fw_err(0x3) + +// e0008004 +#define kIOFireWireConfigROMInvalid iokit_fw_err(0x4) + +// e0008005 +#define kIOFireWireAlreadyRegistered iokit_fw_err(0x5) + +// e0008006 +#define kIOFireWireMultipleTalkers iokit_fw_err(0x6) + +// e0008007 +#define kIOFireWireChannelActive iokit_fw_err(0x7) + +// e0008008 +#define kIOFireWireNoListenerOrTalker iokit_fw_err(0x8) + +// e0008009 +#define kIOFireWireNoChannels iokit_fw_err(0x9) + +// e000800A +#define kIOFireWireChannelNotAvailable iokit_fw_err(0xA) + +// e000800B +#define kIOFireWireSeparateBus iokit_fw_err(0xB) + +// e000800C +#define kIOFireWireBadSelfIDs iokit_fw_err(0xC) + +// e000800D +#define kIOFireWireLowCableVoltage iokit_fw_err(0xD) + +// e000800E +#define kIOFireWireInsufficientPower iokit_fw_err(0xE) + +// e000800f +#define kIOFireWireOutOfTLabels iokit_fw_err(0xF) + +// NOTE: errors 1631 used for address space response codes.. (see above) + +// e0008101 +#define kIOFireWireBogusDCLProgram iokit_fw_err(0x101) + +// e0008102 +#define kIOFireWireTalkingAndListening iokit_fw_err(0x102) + +// e0008103 +#define kIOFireWireHardwareSlept iokit_fw_err(0x103) + +// e0008104 // let's resume here... + +// e0008104 -- In the middle of completing +#define kIOFireWireCompleting iokit_fw_err(0x104) + +// e0008105 -- Invalid Response Length +#define kIOFireWireInvalidResponseLength iokit_fw_err(0x105) + +// e0008106 -- Isoch Bandwidth Not Available +#define kIOFireWireIsochBandwidthNotAvailable iokit_fw_err(0x106) + + +// e00087d0 +#define kIOFWMessageServiceIsRequestingClose (UInt32)iokit_fw_err(0x7D0) +#define kIOFWMessagePowerStateChanged (UInt32)iokit_fw_err(0x7D1) +#define kIOFWMessageTopologyChanged (UInt32)iokit_fw_err(0x7D2) +// ================================================================= +// Pseudo address space response codes +// ================================================================= +#pragma mark - +#pragma mark PSEDUO ADDRESS SPACE RESPONSE CODES +enum +{ + kFWResponseComplete = 0, // OK! + kFWResponseConflictError = 4, // Resource conflict, may retry + kFWResponseDataError = 5, // Data not available + kFWResponseTypeError = 6, // Operation not supported + kFWResponseAddressError = 7, // Address not valid in target device + kFWResponseBusResetError = 16, // Pseudo response generated locally + kFWResponsePending = 17 // Pseudo response, real response sent later. +}; + +// +// Pseudo address space response codes +// +enum +{ + kFWAckTimeout = -1, // Pseudo ack generated locally + kFWAckComplete = 1, + kFWAckPending = 2, + kFWAckBusyX = 4, + kFWAckBusyA = 5, + kFWAckBusyB = 6, + kFWAckDataError = 13, + kFWAckTypeError = 14 +}; + +// ================================================================= +// FireWire bus speed numbers +// ================================================================= +#pragma mark - +#pragma mark BUS SPEED NUMBERS + +typedef enum +{ + kFWSpeed100MBit = 0, + kFWSpeed200MBit = 1, + kFWSpeed400MBit = 2, + kFWSpeed800MBit = 3, + kFWSpeedReserved = 3, // In all cases, 1394B Devices report this speed, + // each port of the PHY could be different + + kFWSpeedUnknownMask = 0x80, // If speed was reserved and we haven't probed it further + + kFWSpeedMaximum = 0x7FFFFFFF, + kFWSpeedInvalid = 0x80000000 +} IOFWSpeed; + +// ================================================================= +// FWAddress +// ================================================================= +#pragma mark - +#pragma mark FWADDRESS +// +// The venerable FWAddress structure. This is the standard +// struct to use for passing FireWire addresses. +// + +typedef struct FWAddressStruct +{ + UInt16 nodeID; // bus/node + UInt16 addressHi; // Top 16 bits of node address. + UInt32 addressLo; // Bottom 32 bits of node address + + // + // Useful C++ only constructors + // + #ifdef __cplusplus + FWAddressStruct(const FWAddressStruct & a): + nodeID(a.nodeID), addressHi(a.addressHi), addressLo(a.addressLo) {}; + FWAddressStruct(UInt16 h=0xdead, UInt32 l=0xcafebabe) : + nodeID(0), addressHi(h), addressLo(l) {}; + FWAddressStruct(UInt16 h, UInt32 l, UInt16 n) : + nodeID(n), addressHi(h), addressLo(l) {}; + #endif +} FWAddress, *FWAddressPtr ; + +// ================================================================= +// Config ROM +// ================================================================= +#pragma mark - +#pragma mark CONFIG ROM + +// +// CSR bit defs. +// + +#define CSR_BIT(x) FW_BIT(x) + +#define CSRBitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (start)) >> \ + ((start) + (31 - (end)))) << \ + (31 - (end)) \ +) + +#define CSRBitRangePhase(start, end) \ + (31 - end) + +// +// Key types. +// + +typedef enum +{ + kConfigImmediateKeyType = 0, + kConfigOffsetKeyType = 1, + kConfigLeafKeyType = 2, + kConfigDirectoryKeyType = 3, + kInvalidConfigROMEntryType = 0xff +} IOConfigKeyType; + +// +// Key values. +// + +enum +{ + kConfigTextualDescriptorKey = 0x01, + kConfigBusDependentInfoKey = 0x02, + kConfigModuleVendorIdKey = 0x03, + kConfigModuleHwVersionKey = 0x04, + kConfigModuleSpecIdKey = 0x05, + kConfigModuleSwVersionKey = 0x06, + kConfigModuleDependentInfoKey = 0x07, + kConfigNodeVendorIdKey = 0x08, + kConfigNodeHwVersionKey = 0x09, + kConfigNodeSpecIdKey = 0x0A, + kConfigNodeSwVersionKey = 0x0B, + kConfigNodeCapabilitiesKey = 0x0C, + kConfigNodeUniqueIdKey = 0x0D, + kConfigNodeUnitsExtentKey = 0x0E, + kConfigNodeMemoryExtentKey = 0x0F, + kConfigNodeDependentInfoKey = 0x10, + kConfigUnitDirectoryKey = 0x11, + kConfigUnitSpecIdKey = 0x12, + kConfigUnitSwVersionKey = 0x13, + kConfigUnitDependentInfoKey = 0x14, + kConfigUnitLocationKey = 0x15, + kConfigUnitPollMaskKey = 0x16, + kConfigModelIdKey = 0x17, + kConfigGenerationKey = 0x38, // Apple-specific + + kConfigRootDirectoryKey = 0xffff // Not a real key +}; + +enum +{ + kConfigSBP2LUN = 0x14, + kConfigSBP2Revision = 0x21, + kConfigSBP2MAO = 0x54 +}; + +// Core CSR registers. +enum +{ + kCSRStateUnitDepend = CSRBitRange(0, 15), + kCSRStateUnitDependPhase = CSRBitRangePhase(0, 15), + + kCSRStateBusDepend = CSRBitRange(16, 23), + kCSRStateBusDependPhase = CSRBitRangePhase(16, 23), + + kCSRStateLost = CSR_BIT(24), + kCSRStateDReq = CSR_BIT(25), + kCSRStateELog = CSR_BIT(27), + kCSRStateAtn = CSR_BIT(28), + kCSRStateOff = CSR_BIT(29), + + kCSRStateState = CSRBitRange(30, 31), + kCSRStateStatePhase = CSRBitRangePhase(30, 31), + kCSRStateStateRunning = 0, + kCSRStateStateInitializing = 1, + kCSRStateStateTesting = 2, + kCSRStateStateDead = 3 +}; + +// Config ROM entry bit locations. + +enum +{ + kConfigBusInfoBlockLength = CSRBitRange (0, 7), + kConfigBusInfoBlockLengthPhase = CSRBitRangePhase (0, 7), + + kConfigROMCRCLength = CSRBitRange (8, 15), + kConfigROMCRCLengthPhase = CSRBitRangePhase (8, 15), + + kConfigROMCRCValue = CSRBitRange (16, 31), + kConfigROMCRCValuePhase = CSRBitRangePhase (16, 31), + + kConfigEntryKeyType = CSRBitRange (0, 1), + kConfigEntryKeyTypePhase = CSRBitRangePhase (0, 1), + + kConfigEntryKeyValue = CSRBitRange (2, 7), + kConfigEntryKeyValuePhase = CSRBitRangePhase (2, 7), + + kConfigEntryValue = CSRBitRange (8, 31), + kConfigEntryValuePhase = CSRBitRangePhase (8, 31), + + kConfigLeafDirLength = CSRBitRange (0, 15), + kConfigLeafDirLengthPhase = CSRBitRangePhase (0, 15), + + kConfigLeafDirCRC = CSRBitRange (16, 31), + kConfigLeafDirCRCPhase = CSRBitRangePhase (16, 31) +}; + +// +// Key types. +// +typedef enum +{ + kCSRImmediateKeyType = 0, + kCSROffsetKeyType = 1, + kCSRLeafKeyType = 2, + kCSRDirectoryKeyType = 3, + kInvalidCSRROMEntryType = 0xff +} IOCSRKeyType; + +// CSR 64-bit fixed address defs. + +enum +{ + kCSRNodeID = CSRBitRange (0, 15), + kCSRNodeIDPhase = CSRBitRangePhase (0, 15), + + kCSRInitialMemorySpaceBaseAddressHi = 0x00000000, + kCSRInitialMemorySpaceBaseAddressLo = 0x00000000, + + kCSRPrivateSpaceBaseAddressHi = 0x0000FFFF, + kCSRPrivateSpaceBaseAddressLo = 0xE0000000, + + kCSRRegisterSpaceBaseAddressHi = 0x0000FFFF, + kCSRRegisterSpaceBaseAddressLo = 0xF0000000, + + kCSRCoreRegistersBaseAddress = kCSRRegisterSpaceBaseAddressLo, + kCSRStateClearAddress = kCSRCoreRegistersBaseAddress + 0x0000, + kCSRStateSetAddress = kCSRCoreRegistersBaseAddress + 0x0004, + kCSRNodeIDsAddress = kCSRCoreRegistersBaseAddress + 0x0008, + kCSRResetStartAddress = kCSRCoreRegistersBaseAddress + 0x000C, + kCSRIndirectAddressAddress = kCSRCoreRegistersBaseAddress + 0x0010, + kCSRIndirectDataAddress = kCSRCoreRegistersBaseAddress + 0x0014, + kCSRSplitTimeoutHiAddress = kCSRCoreRegistersBaseAddress + 0x0018, + kCSRSplitTimeoutLoAddress = kCSRCoreRegistersBaseAddress + 0x001C, + kCSRArgumentHiAddress = kCSRCoreRegistersBaseAddress + 0x0020, + kCSRArgumentLoAddress = kCSRCoreRegistersBaseAddress + 0x0024, + kCSRTestStartAddress = kCSRCoreRegistersBaseAddress + 0x0028, + kCSRTestStatusAddress = kCSRCoreRegistersBaseAddress + 0x002C, + kCSRUnitsBaseHiAddress = kCSRCoreRegistersBaseAddress + 0x0030, + kCSRUnitsBaseLoAddress = kCSRCoreRegistersBaseAddress + 0x0034, + kCSRUnitsBoundHiAddress = kCSRCoreRegistersBaseAddress + 0x0038, + kCSRUnitsBoundLoAddress = kCSRCoreRegistersBaseAddress + 0x003C, + kCSRMemoryBaseHiAddress = kCSRCoreRegistersBaseAddress + 0x0040, + kCSRMemoryBaseLoAddress = kCSRCoreRegistersBaseAddress + 0x0044, + kCSRMemoryBoundHiAddress = kCSRCoreRegistersBaseAddress + 0x0048, + kCSRMemoryBoundLoAddress = kCSRCoreRegistersBaseAddress + 0x004C, + kCSRInterruptTargetAddress = kCSRCoreRegistersBaseAddress + 0x0050, + kCSRInterruptMaskAddress = kCSRCoreRegistersBaseAddress + 0x0054, + kCSRClockValueHiAddress = kCSRCoreRegistersBaseAddress + 0x0058, + kCSRClockValueMidAddress = kCSRCoreRegistersBaseAddress + 0x005C, + kCSRClockTickPeriodMidAddress = kCSRCoreRegistersBaseAddress + 0x0060, + kCSRClockTickPeriodLoAddress = kCSRCoreRegistersBaseAddress + 0x0064, + kCSRClockStrobeArrivedHiAddress = kCSRCoreRegistersBaseAddress + 0x0068, + kCSRClockStrobeArrivedMidAddress = kCSRCoreRegistersBaseAddress + 0x006C, + kCSRClockInfo0Address = kCSRCoreRegistersBaseAddress + 0x0070, + kCSRClockInfo1Address = kCSRCoreRegistersBaseAddress + 0x0074, + kCSRClockInfo2Address = kCSRCoreRegistersBaseAddress + 0x0078, + kCSRClockInfo3Address = kCSRCoreRegistersBaseAddress + 0x007C, + kCSRMessageRequestAddress = kCSRCoreRegistersBaseAddress + 0x0080, + kCSRMessageResponseAddress = kCSRCoreRegistersBaseAddress + 0x00C0, + kCSRErrorLogBufferAddress = kCSRCoreRegistersBaseAddress + 0x0180, + + kCSRBusDependentRegistersBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x0200, + kCSRBusyTimeout = kCSRRegisterSpaceBaseAddressLo + 0x0210, + kCSRBusManagerID = kCSRRegisterSpaceBaseAddressLo + 0x021C, + kCSRBandwidthAvailable = kCSRRegisterSpaceBaseAddressLo + 0x0220, + kCSRChannelsAvailable31_0 = kCSRRegisterSpaceBaseAddressLo + 0x0224, + kCSRChannelsAvailable63_32 = kCSRRegisterSpaceBaseAddressLo + 0x0228, + kCSRBroadcastChannel = kCSRRegisterSpaceBaseAddressLo + 0x0234, + + kConfigROMBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x0400, + kConfigBIBHeaderAddress = kConfigROMBaseAddress, + kConfigBIBBusNameAddress = kConfigROMBaseAddress + 4, + + kPCRBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x900, + kFCPCommandAddress = kCSRRegisterSpaceBaseAddressLo + 0xb00, + kFCPResponseAddress = kCSRRegisterSpaceBaseAddressLo + 0xd00 +}; + +// from figure 10-7 of 1394a +#define kBroadcastChannelInitialValues 0x8000001f +#define kBroadcastChannelValidMask 0x40000000 + +// CSR defined 64 bit unique ID. + +typedef UInt64 CSRNodeUniqueID; + +// FireWire core CSR registers. + +enum +{ + kFWCSRStateGone = FW_BIT(16), + kFWCSRStateLinkOff = FW_BIT(22), + kFWCSRStateCMstr = FW_BIT(23) +}; + +// FireWire bus/nodeID address defs. + +enum +{ + kFWAddressBusID = FWBitRange (16, 25) << kCSRNodeIDPhase, + kFWAddressBusIDPhase = FWBitRangePhase (16, 25) + kCSRNodeIDPhase, + + kFWAddressNodeID = FWBitRange (26, 31) << kCSRNodeIDPhase, + kFWAddressNodeIDPhase = FWBitRangePhase (26, 31) + kCSRNodeIDPhase, + + kFWLocalBusID = 1023, + kFWBroadcastNodeID = 63, + kFWBadNodeID = 0xffff, + + kFWLocalBusAddress = kFWLocalBusID << kFWAddressBusIDPhase, + kFWBroadcastAddress = kFWBroadcastNodeID << kFWAddressNodeIDPhase +}; + +#define FWNodeBaseAddress(busID, nodeID) \ +( \ + (busID << kFWAddressBusIDPhase) | \ + (nodeID << kFWAddressNodeIDPhase) \ +) + +#define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID) \ +( \ + FWNodeBaseAddress (busID, nodeID) | \ + kCSRRegisterSpaceBaseAddressHi \ +) + +// FireWire CSR bus info block defs. + +enum +{ + kFWBIBHeaderAddress = kConfigBIBHeaderAddress, + kFWBIBBusNameAddress = kConfigBIBBusNameAddress, + kFWBIBNodeCapabilitiesAddress = kConfigROMBaseAddress + 8, + kFWBIBNodeUniqueIDHiAddress = kConfigROMBaseAddress + 12, + kFWBIBNodeUniqueIDLoAddress = kConfigROMBaseAddress + 16, + + kFWBIBBusName = 0x31333934, //'1394' + + kFWBIBIrmc = FW_BIT(0), + kFWBIBCmc = FW_BIT(1), + kFWBIBIsc = FW_BIT(2), + kFWBIBBmc = FW_BIT(3), + kFWBIBCycClkAcc = FWBitRange (8, 15), + kFWBIBCycClkAccPhase = FWBitRangePhase (8, 15), + kFWBIBMaxRec = FWBitRange (16, 19), + kFWBIBMaxRecPhase = FWBitRangePhase (16, 19), + kFWBIBMaxROM = FWBitRange (20, 21), + kFWBIBMaxROMPhase = FWBitRangePhase (20, 21), + kFWBIBGeneration = FWBitRange (24, 27), + kFWBIBGenerationPhase = FWBitRangePhase (24, 27), + kFWBIBLinkSpeed = FWBitRange (29, 31), + kFWBIBLinkSpeedPhase = FWBitRangePhase (29, 31) +}; + +enum +{ + kConfigUnitSpecAppleA27 = 0x000a27, + kConfigUnitSpec1394TA1 = 0x00a02d, + + kConfigUnitSWVersMacintosh10 = 10, + kConfigUnitSWVersIIDC100 = 0x000100, + kConfigUnitSWVersIIDC101 = 0x000101, + kConfigUnitSWVersIIDC102 = 0x000102 +}; + + +// ================================================================= +// Isoch defines +// ================================================================= +#pragma mark - +#pragma mark ISOCH + +enum +{ + kFWIsochDataLength = FWBitRange (0, 15), + kFWIsochDataLengthPhase = FWBitRangePhase (0, 15), + + kFWIsochTag = FWBitRange (16, 17), + kFWIsochTagPhase = FWBitRangePhase (16, 17), + + kFWIsochChanNum = FWBitRange (18, 23), + kFWIsochChanNumPhase = FWBitRangePhase (18, 23), + + kFWIsochTCode = FWBitRange (24, 27), + kFWIsochTCodePhase = FWBitRangePhase (24, 27), + + kFWIsochSy = FWBitRange (28, 31), + kFWIsochSyPhase = FWBitRangePhase (28, 31) +}; + +#define CHAN_BIT(x) (((UInt64)1) << (63 - (x)) +#define CHAN_MASK(x) (~CHAN_BIT(X)) + +typedef enum +{ + kFWNeverMultiMode = 0, + kFWAllowMultiMode, + kFWSuggestMultiMode, + kFWAlwaysMultiMode, + + kFWDefaultIsochResourceFlags = kFWNeverMultiMode +} IOFWIsochResourceFlags ; + +enum +{ + kFWIsochChannelDefaultFlags = 0, + kFWIsochChannelDoNotResumeOnWake = BIT(1) +} ; + +typedef enum +{ + kFWIsochPortDefaultOptions = 0, + kFWIsochPortUseSeparateKernelThread = BIT(1), + kFWIsochEnableRobustness = BIT(2), + kFWIsochBigEndianUpdates = BIT(3), // private + kFWIsochRequireLastContext = BIT(4), // private +} IOFWIsochPortOptions ; + +// ================================================================= +// DCL opcode defs. +// ================================================================= +#pragma mark - +#pragma mark DCL OPCODES + +enum +{ + kFWDCLImmediateEvent = 0, + kFWDCLCycleEvent = 1, + kFWDCLSyBitsEvent = 2 +}; + +typedef enum +{ + kFWDCLInvalidNotification = 0 + , kFWDCLUpdateNotification = 1 + , kFWDCLModifyNotification = 2 + , kFWNuDCLModifyNotification = 3 + , kFWNuDCLModifyJumpNotification = 4 + , kFWNuDCLUpdateNotification = 5 +} IOFWDCLNotificationType ; + +enum +{ + kFWDCLOpDynamicFlag = BIT(16), + kFWDCLOpVendorDefinedFlag = BIT(17), + kFWDCLOpFlagMask = BitRange (16, 31), + kFWDCLOpFlagPhase = BitRangePhase (16, 31) +}; + +enum +{ + kDCLInvalidOp = 0, + kDCLSendPacketStartOp = 1, + //kDCLSendPacketWithHeaderStartOp = 2, // Deprecated legacy DCL opcode! Use NuDCL instead! + kDCLSendPacketOp = 3, + kDCLSendBufferOp = 4, // obsolete - do not use + kDCLReceivePacketStartOp = 5, + kDCLReceivePacketOp = 6, + kDCLReceiveBufferOp = 7, // obsolete - do not use + kDCLCallProcOp = 8, + kDCLLabelOp = 9, + kDCLJumpOp = 10, + kDCLSetTagSyncBitsOp = 11, + kDCLUpdateDCLListOp = 12, + kDCLTimeStampOp = 13, + kDCLPtrTimeStampOp = 14, + kDCLSkipCycleOp = 15, + + kDCLNuDCLLeaderOp = 20 // compilerData field contains NuDCLRef to start of NuDCL + // program. + // Should not need to use this directly. +}; + +#ifdef FW_OLD_DCL_DEFS + +//typedef struct DCLCommandStruct ; +//typedef void (DCLCallCommandProc)(DCLCommandStruct* command); + +#else + +//typedef struct DCLCommand ; +//typedef void (DCLCallCommandProc)(DCLCommand* command); + +#endif + +// ================================================================= +// DCL structs +// ================================================================= +#pragma mark - +#pragma mark DCL + +#ifdef __LP64__ +typedef void* DCLCallProcDataType; +#else +typedef UInt32 DCLCallProcDataType; +#endif + +#ifdef KERNEL + #ifdef __LP64__ + typedef void* DCLCompilerDataType; + #else + typedef UInt32 DCLCompilerDataType; + #endif +#else + typedef UInt32 DCLCompilerDataType; +#endif + +typedef struct DCLCommandStruct +{ + struct DCLCommandStruct * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 operands[1]; // DCL operands (size varies) +} DCLCommand; + +typedef void (DCLCallCommandProc)(DCLCommand * command); + +typedef struct DCLTransferPacketStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + void * buffer; // Packet buffer. + UInt32 size; // Buffer size. +} DCLTransferPacket ; + +typedef struct DCLTransferBufferStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + void * buffer; // Buffer. + UInt32 size; // Buffer size. + UInt16 packetSize; // Size of packets to send. + UInt16 reserved; + UInt32 bufferOffset; // Current offset into buffer. +} DCLTransferBuffer ; + +typedef struct DCLCallProcStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLCallCommandProc * proc; // Procedure to call. + DCLCallProcDataType procData; // Data for use by called procedure. +} DCLCallProc; + +typedef struct DCLLabelStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. +} DCLLabel; + +typedef struct DCLJumpStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLLabel * pJumpDCLLabel; // DCL label to jump to. +} DCLJump; + +typedef struct DCLSetTagSyncBitsStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt16 tagBits; // Tag bits for following packets. + UInt16 syncBits; // Sync bits for following packets. +} DCLSetTagSyncBits; + +typedef struct DCLUpdateDCLListStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLCommand ** dclCommandList; // List of DCL commands to update. + UInt32 numDCLCommands; // Number of DCL commands in list. +} DCLUpdateDCLList; + +typedef struct DCLTimeStampStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 timeStamp; // Time stamp. +} DCLTimeStamp; + +typedef struct DCLPtrTimeStampStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 * timeStampPtr; // Where to store the time stamp. +} DCLPtrTimeStamp ; + +typedef struct +{ + DCLCommand * pNextDCLCommand ; // unused - always NULL + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode ; // must be kDCLNuDCLLeaderOp + void* program ; // NuDCL program here... +} DCLNuDCLLeader ; + +#ifdef FW_OLD_DCL_DEFS + +// should not use these... + +typedef DCLCommand* DCLCommandPtr ; +typedef DCLTransferBuffer* DCLTransferBufferPtr ; +typedef DCLTransferPacket* DCLTransferPacketPtr ; +typedef DCLCallProc* DCLCallProcPtr ; +typedef DCLLabel* DCLLabelPtr ; +typedef DCLJump* DCLJumpPtr ; +typedef DCLSetTagSyncBits* DCLSetTagSyncBitsPtr ; +typedef DCLUpdateDCLList* DCLUpdateDCLListPtr ; +typedef DCLTimeStamp* DCLTimeStampPtr ; +typedef DCLPtrTimeStamp* DCLPtrTimeStampPtr ; +typedef DCLCallCommandProc* DCLCallCommandProcPtr ; + +#endif + + +// ================================================================= +// User-Lib Export DCL structs - Thses structus are used to pass +// a user-created legacy DCL program down into kernel space. These +// structs allow support for both 32-bit and 64-bit user-space clients. +// These structs should only be used internally. They are not for +// clients to create DCL programs with. +// ================================================================= + +typedef struct UserExportDCLCommandStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 operands[1]; // DCL operands (size varies) +} __attribute__ ((packed)) UserExportDCLCommand; + +typedef void (UserExportDCLCallCommandProc)(UserExportDCLCommand * command); + +typedef struct UserExportDCLTransferPacketStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t buffer; // Packet buffer. + UInt32 size; // Buffer size. +} __attribute__ ((packed)) UserExportDCLTransferPacket ; + +typedef struct UserExportDCLTransferBufferStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t buffer; // Buffer. + UInt32 size; // Buffer size. + UInt16 packetSize; // Size of packets to send. + UInt16 reserved; + UInt32 bufferOffset; // Current offset into buffer. +} __attribute__ ((packed)) UserExportDCLTransferBuffer ; + +typedef struct UserExportDCLCallProcStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t proc; // Procedure to call. + uint64_t procData; // Data for use by called procedure. +} __attribute__ ((packed)) UserExportDCLCallProc; + +typedef struct UserExportDCLLabelStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. +} __attribute__ ((packed)) UserExportDCLLabel; + +typedef struct UserExportDCLJumpStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t pJumpDCLLabel; // DCL label to jump to. +} __attribute__ ((packed)) UserExportDCLJump; + +typedef struct UserExportDCLSetTagSyncBitsStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt16 tagBits; // Tag bits for following packets. + UInt16 syncBits; // Sync bits for following packets. +} __attribute__ ((packed)) UserExportDCLSetTagSyncBits; + +typedef struct UserExportDCLUpdateDCLListStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t dclCommandList; // List of DCL commands to update. + UInt32 numDCLCommands; // Number of DCL commands in list. +} __attribute__ ((packed)) UserExportDCLUpdateDCLList; + +typedef struct UserExportDCLTimeStampStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 timeStamp; // Time stamp. +} __attribute__ ((packed)) UserExportDCLTimeStamp; + +typedef struct UserExportDCLPtrTimeStampStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t timeStampPtr; // Where to store the time stamp. +} __attribute__ ((packed)) UserExportDCLPtrTimeStamp ; + +typedef struct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand ; // unused - always NULL + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode ; // must be kDCLNuDCLLeaderOp + mach_vm_address_t program ; // NuDCL program here... +} __attribute__ ((packed)) UserExportDCLNuDCLLeader ; + + +// ================================================================= +// NuDCL +// ================================================================= +#pragma mark - +#pragma mark NUDCL + +typedef struct __NuDCL * NuDCLRef ; +typedef NuDCLRef NuDCLSendPacketRef ; +typedef NuDCLRef NuDCLSkipCycleRef ; +typedef NuDCLRef NuDCLReceivePacketRef ; + +typedef void (*NuDCLCallback)( void* refcon, NuDCLRef dcl ); + +typedef enum +{ + kNuDCLDynamic = BIT( 1 ), + kNuDCLUpdateBeforeCallback = BIT( 2 ) + +} NuDCLFlags ; + +// ================================================================= +// Miscellaneous +// ================================================================= +#pragma mark - +#pragma mark MISCELLANEOUS + +typedef void* FWClientCommandID ; + +typedef struct IOFireWireSessionRefOpaqueStuct* IOFireWireSessionRef ; + +// +// bus management constants. +// + +enum +{ + kFWBusManagerArbitrationTimeoutDuration = 625 // durationMillisecond +}; + +// +// bus characteristics. +// + +enum +{ + kFWMaxBusses = 1023, + kFWMaxNodesPerBus = 63, + kFWMaxNodeHops = 16 +}; + +/*! @enum NodeFlags + + @abstract Flags that specify characteristics of the FireWire device node. + + @constant kIOFWDisablePhysicalAccess Disable physical memory access + + @constant kIOFWDisableAllPhysicalAccess Disable all physical memory access + + @constant kIOFWEnableRetryOnAckD Enable retry on Ack D + + @constant kIOFWLimitAsyncPacketSize Limit async packet size + + @constant kIOFWDisablePhyOnSleep Disable Phy, when machine is in Sleep mode + + @constant kIOFWMustBeRoot Attempt to make this device root, There is no guarentee Mac OS will succeed in making the device + root. + + @constant kIOFWMustNotBeRoot Attempt to prevent this device from being root, There is no guarentee Mac OS will succeed in preventing the device + from being root. + + @constant kIOFWMustHaveGap63 Attempt to ensure the gap count is 63, when this device is on the bus. Gap 63 reduces bus performance significantly, + so this flag should be used only when absolutely necessary. There is no guarentee Mac OS will succeed in forcing + the gap count to 63. +*/ +enum +{ + kIOFWDisablePhysicalAccess = (1 << 0), + kIOFWDisableAllPhysicalAccess = (1 << 1), + kIOFWEnableRetryOnAckD = (1 << 2), + kIOFWLimitAsyncPacketSize = (1 << 3), + kIOFWDisablePhyOnSleep = (1 << 4), + kIOFWMustBeRoot = (1 << 5), + kIOFWMustNotBeRoot = (1 << 6), + kIOFWMustHaveGap63 = (1 << 7) +}; + +// +// write flags +// + +enum IOFWWriteFlags +{ + kIOFWWriteFlagsNone = 0x00000000, + kIOFWWriteFlagsDeferredNotify = 0x00000001, + kIOFWWriteFastRetryOnBusy = 0x00000002, + kIOFWWriteBlockRequest = 0x00000004, // force a block request +}; + +// +// read flags +// + +enum IOFWReadFlags +{ + kIOFWReadFlagsNone = 0x00000000, + kIOFWReadBlockRequest = 0x00000004, // force a block request + kIOFWReadPingTime = 0x00000008 // ping time +}; + +// +// security modes +// + +enum IOFWSecurityMode +{ + kIOFWSecurityModeNormal = 0, + kIOFWSecurityModeSecure = 1, + kIOFWSecurityModeSecurePermanent = 2 +}; + +// +// physical access settings +// + +enum IOFWPhysicalAccessMode +{ + kIOFWPhysicalAccessEnabled = 0, + kIOFWPhysicalAccessDisabled = 1, + kIOFWPhysicalAccessDisabledForGeneration = 2 +}; + +enum +{ + kIOFWSpecID_AAPL = 0xa27, + kIOFWSWVers_KPF = 0x40 +}; + +// old style bit defs +#ifdef FW_OLD_BIT_DEFS + + #define kBit0 BIT(0) + #define kBit1 BIT(1) + #define kBit2 BIT(2) + #define kBit3 BIT(3) + #define kBit4 BIT(4) + #define kBit5 BIT(5) + #define kBit6 BIT(6) + #define kBit7 BIT(7) + #define kBit8 BIT(8) + #define kBit9 BIT(9) + #define kBit10 BIT(10) + #define kBit11 BIT(11) + #define kBit12 BIT(12) + #define kBit13 BIT(13) + #define kBit14 BIT(14) + #define kBit15 BIT(15) + #define kBit16 BIT(16) + #define kBit17 BIT(17) + #define kBit18 BIT(18) + #define kBit19 BIT(19) + #define kBit20 BIT(20) + #define kBit21 BIT(21) + #define kBit22 BIT(22) + #define kBit23 BIT(23) + #define kBit24 BIT(24) + #define kBit25 BIT(25) + #define kBit26 BIT(26) + #define kBit27 BIT(27) + #define kBit28 BIT(28) + #define kBit29 BIT(29) + #define kBit30 BIT(30) + #define kBit31 BIT(31) + +#endif + +#endif //__IOFireWireFamilyCommon_H__ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireIRMAllocation.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireIRMAllocation.h.svn-base new file mode 100644 index 0000000..c67986c --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireIRMAllocation.h.svn-base @@ -0,0 +1,116 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREIRMALLOCATION_H +#define _IOKIT_IOFIREWIREIRMALLOCATION_H + +#include + +class IOFireWireController; + +//#include +//#include + +/*! @class IOFireWireIRMAllocation +*/ + +class IOFireWireIRMAllocation : public OSObject +{ + friend class IOFireWireController; + + OSDeclareDefaultStructors(IOFireWireIRMAllocation) + +public: + + // Prototype for the callback if reallocation after bus-reset is unsuccessful. + typedef IOReturn (*AllocationLostNotificationProc)(void* refCon, class IOFireWireIRMAllocation* allocation); + + // Initialize the IRM allocation object. + virtual bool init( IOFireWireController * control, + Boolean releaseIRMResourcesOnFree = true, + AllocationLostNotificationProc allocationLostProc = NULL, + void *pLostProcRefCon = NULL); + + // Specify whether of not the IRM resources should automatically + // be released when freeing this allocation object. + virtual void setReleaseIRMResourcesOnFree(Boolean doRelease); + + // Use the IRMAllocation object to allocate isoch resources + virtual IOReturn allocateIsochResources(UInt8 isochChannel, UInt32 bandwidthUnits); + + // Free isoch resources previously allocated with a call to allocateIsochResources + virtual IOReturn deallocateIsochResources(void); + + // Returns true if isoch resources are currently allocated, and if true, the allocated channel, and amount of isoch bandwidth. + virtual Boolean areIsochResourcesAllocated(UInt8 *pAllocatedIsochChannel, UInt32 *pAllocatedBandwidthUnits); + + // Get the refcon + virtual void * GetRefCon(void); + virtual void SetRefCon(void* refCon); + + // Override the base-class release function for special processing + virtual void release() const; + +protected: + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // Free the allocation object (and release IRM resources if needed) + virtual void free( void ); + + // Controller will call this to notify about bus-reset complete. + virtual void handleBusReset(UInt32 generation); + + virtual void failedToRealloc(void); + virtual UInt32 getAllocationGeneration(void); + static void threadFunc( void * arg ); + +private: + + AllocationLostNotificationProc fAllocationLostProc; + void *fLostProcRefCon; + Boolean fReleaseIRMResourcesOnFree; + UInt8 fIsochChannel; + UInt32 fBandwidthUnits; + UInt32 fAllocationGeneration; + IORecursiveLock *fLock ; + IOFireWireController *fControl; + Boolean isAllocated; + + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 0); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 1); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 2); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 3); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 4); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 5); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 6); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 7); +}; + +#endif // _IOKIT_IOFIREWIREIRMALLOCATION_H diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireLocalNode.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireLocalNode.h.svn-base new file mode 100644 index 0000000..339fb9e --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireLocalNode.h.svn-base @@ -0,0 +1,143 @@ +/* + * IOFireWireLocalNode.h + * IOFireWireFamily + * + * Created by Niels on Fri Aug 16 2002. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + $Log: IOFireWireLocalNode.h,v $ + Revision 1.8 2009/03/26 22:45:17 calderon + User client fails to terminate with unexpected consuequences + + Revision 1.7 2008/11/14 00:17:12 arulchan + fix for rdar://5939334 + + Revision 1.6 2005/02/18 22:56:53 gecko1 + 3958781 Q45C EVT: FireWire ASP reporter says port speed is 800 Mb/sec + + Revision 1.5 2003/02/20 02:00:12 collin + *** empty log message *** + + Revision 1.4 2003/02/17 21:47:53 collin + *** empty log message *** + + Revision 1.3 2002/10/18 23:29:44 collin + fix includes, fix cast which fails on new compiler + + Revision 1.2 2002/09/25 00:27:24 niels + flip your world upside-down + +*/ + +// public +#import + +class IOFireWireLocalNode; + +#pragma mark - + +/*! + @class IOFireWireLocalNodeAux +*/ + +class IOFireWireLocalNodeAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireLocalNodeAux) + + friend class IOFireWireLocalNode; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireLocalNode * primary ); + virtual void free(); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 3); + +}; + +#pragma mark - + +/*! @class IOFireWireLocalNode +*/ + +class IOFireWireLocalNode : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireLocalNode) + + friend class IOFireWireLocalNodeAux; + + /*------------------Useful info about device (also available in the registry)--------*/ +protected: + + /*-----------Methods provided to FireWire device clients-------------*/ +public: + + // Set up properties affected by bus reset + virtual void setNodeProperties(UInt32 generation, UInt16 nodeID, UInt32 *selfIDs, int numIDs, IOFWSpeed maxSpeed ); + + /* + * Standard nub initialization + */ + virtual bool init(OSDictionary * propTable); + virtual bool attach(IOService * provider ); + + virtual void handleClose( IOService * forClient, + IOOptionBits options ) ; + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ) ; + virtual bool handleIsOpen( const IOService * forClient ) const; + + /* + * Trick method to create protocol user clients + */ + virtual IOReturn setProperties( OSObject * properties ); + +protected: + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + virtual void free(); + +protected: + OSSet * fOpenClients; +}; diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireMultiIsochReceive.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireMultiIsochReceive.h.svn-base new file mode 100644 index 0000000..e003660 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireMultiIsochReceive.h.svn-base @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREMULTIISOCHRECEIVE_H_ +#define _IOKIT_IOFIREWIREMULTIISOCHRECEIVE_H_ + +class IOFireWireMultiIsochReceiveListener; +class IOFireWireMultiIsochReceivePacket; +class IOFireWireController; + +typedef IOReturn (*FWMultiIsochReceiveListenerCallback)(void *refcon, IOFireWireMultiIsochReceivePacket *pPacket); + +// These are the parameters clients can set which help us to optimize the mult-isoch-receiver +// polling interval, and memory resources +typedef struct FWMultiIsochReceiveListenerParamsStruct + { + // How much latency, from when the packet arrives to when the client is notified, can the client tolerate. + UInt32 maxLatencyInFireWireCycles; + + // In bits per second, the expected bit-rate of the incoming stream + UInt32 expectedStreamBitRate; + + // How long does the client expect to hold onto packets objects before returning them back to the receiver + UInt32 clientPacketReturnLatencyInFireWireCycles; + }FWMultiIsochReceiveListenerParams; + +/*! @class IOFireWireMultiIsochReceiveListener +*/ + +class IOFireWireMultiIsochReceiveListener : public OSObject + { + friend class IOFireWireLink; + + protected: + OSDeclareDefaultStructors(IOFireWireMultiIsochReceiveListener) + bool init(IOFireWireController *fwController, + UInt32 receiveChannel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams); + void free(); + public: + static IOFireWireMultiIsochReceiveListener *create(IOFireWireController *fwController, + UInt32 channel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams); + + // Call this to activate the listener + IOReturn Activate(); + + // Call this to deactivate the listener + IOReturn Deactivate(); + + // Call this to modify the callback/refcon pointers. Only call this when not activated! + IOReturn SetCallback(FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon); + + // Accessors + inline UInt32 getReceiveChannel(void) {return fChannel;}; + inline FWMultiIsochReceiveListenerCallback getCallback(void){return fClientCallback;}; + inline void * getRefCon(void){return fClientCallbackRefCon;}; + inline bool getActivatedState(void) {return fActivated;}; + + protected: + IOFireWireController *fControl; + UInt32 fChannel; + FWMultiIsochReceiveListenerCallback fClientCallback; + void *fClientCallbackRefCon; + bool fActivated; + FWMultiIsochReceiveListenerParams *fListenerParams; + }; + +#define kMaxRangesPerMultiIsochReceivePacket 6 + +/*! @class IOFireWireMultiIsochReceivePacket +*/ + +class IOFireWireMultiIsochReceivePacket : public OSObject + { + OSDeclareDefaultStructors(IOFireWireMultiIsochReceivePacket) + bool init(IOFireWireController *fwController); + void free(); + public: + static IOFireWireMultiIsochReceivePacket *create(IOFireWireController *fwController); + + // The clients who are passed this packet by the + // multi-isoch receiver calling their callback + // MUST call clientDone() on this packet to + // return it back for reuse! + void clientDone(void); + + UInt32 isochChannel(void); + UInt32 packetReceiveTime(void); + + UInt32 isochPayloadSize(void); // The size of just the isoch payload, not including header/trailer quads. + inline UInt32 isochPacketSize(void) {return isochPayloadSize()+8; }; // The size of the packet, including header/trailer quads. + + // This returns a memory descriptor to the client. The client must call complete(), and release() on the + // memory descriptor when done. + IOMemoryDescriptor *createMemoryDescriptorForRanges(void); + + // These should be treated as read-only by clients, + // as should the data contained in these buffers! + IOAddressRange ranges[kMaxRangesPerMultiIsochReceivePacket] ; + UInt32 numRanges; + + // These should be treated private for clients! + // Messing with them will screw up the bookkeepping + // in the Multi-Isoch Receiver! + UInt32 numClientReferences; + void* elements[kMaxRangesPerMultiIsochReceivePacket]; + + protected: + IOFireWireController *fControl; + }; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireNub.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireNub.h.svn-base new file mode 100644 index 0000000..7df983b --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireNub.h.svn-base @@ -0,0 +1,293 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWireNub.h + * + * + * Note: IOFWCommand(s) are allocated by methods in this class. + * The remaining methods to setup and submit IOFWCommands are defined in + * IOFWCommand.h + */ +#ifndef _IOKIT_IOFIREWIRENUB_H +#define _IOKIT_IOFIREWIRENUB_H + +// public +#include +#include +#include + +class IOFireWireController; +class IOFireWireBus; +class IOConfigDirectory; +class IOFireWireNub; +class IOFireWireDevice; +class IOFireWireUnit; +class IOFWSimplePhysicalAddressSpace; +class IOFWSimpleContiguousPhysicalAddressSpace; + +enum TerminationState +{ + kNotTerminated = 0, + kNeedsTermination, + kTerminated +}; + +#pragma mark - + +/*! + @class IOFireWireNubAux +*/ + +class IOFireWireNubAux : public OSObject +{ + OSDeclareDefaultStructors(IOFireWireNubAux) + + friend class IOFireWireNub; + +protected: + + IOFireWireNub * fPrimary; + TerminationState fTerminationState; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireNub * primary ); + virtual void free(); + + virtual UInt32 hopCount( IOFireWireNub * nub ); + virtual UInt32 hopCount( void ); + + virtual TerminationState getTerminationState( void ); + virtual void setTerminationState( TerminationState state ); + + virtual bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 7); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 8); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 9); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 10); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 11); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 12); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 13); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 14); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 15); + +}; + +#pragma mark - + +/*! @class IOFireWireNub +*/ +class IOFireWireNub : public IOService +{ + OSDeclareAbstractStructors(IOFireWireNub) + + friend class IOFireWireController; + friend class IOFireWireNubAux; + friend class IOFireWireDeviceAux; + friend class IOFireWireUnitAux; + friend class IOFireWireDevice; + friend class IOFireWireUnit; + +/*------------------Useful info about device (also available in the registry)--------*/ +protected: + int fDeviceSpeed; // Max supported by device + int fCommsSpeed; // Max speed this node can communicate with device + UInt16 fNodeID; // Current node ID (could change after bus reset!) + UInt16 fLocalNodeID; // ID of the local node (could change after bus reset!) + UInt32 fGeneration; // ID Of bus topology that fNodeID is valid for. + CSRNodeUniqueID fUniqueID; // Device's globally unique ID (never changes) + mach_timespec_t fAsyncTimeout; // Guesstimate of how long to wait for response + // from device when making async requests + // Different values for quad/block transfers? + // OS8 FW has 40/100 mSec. + + int fMaxReadPackLog; + int fMaxWritePackLog; + int fMaxReadROMPackLog; + + IOFireWireController *fControl; + IOConfigDirectory *fDirectory; + + UInt32 fNodeFlags; + + OSSet * fConfigDirectorySet; + + IOFireWireNubAux * fAuxiliary; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual void free(); + +/*------------------Methods provided to FireWire device clients-----------------------*/ +public: + + // Get nodeID and bus generation info + IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID, UInt16 &localID) const; + IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID) const; + + // How fast can this system talk to the node? + virtual IOFWSpeed FWSpeed() const; + + // How fast can this node talk to another node? + virtual IOFWSpeed FWSpeed(const IOFireWireNub *dst) const; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog(bool forSend) const; + + // How big (as a power of two) can packets sent to/received from a specified address in the node be? + virtual int maxPackLog(bool forSend, FWAddress address) const; + + // How big (as a power of two) can packets sent from this node to dst node/received from dst be? + virtual int maxPackLog(bool forSend, const IOFireWireNub *dst) const; + + // Set maximum packet size nub can handle + virtual void setMaxPackLog(bool forSend, bool forROM, int maxPackLog); + + /* + * Create various FireWire commands to send to the device + */ + virtual IOFWReadCommand *createReadCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOFWReadQuadCommand *createReadQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + virtual IOFWWriteCommand *createWriteCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOFWWriteQuadCommand *createWriteQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + // size is 1 for 32 bit compare, 2 for 64 bit. + virtual IOFWCompareAndSwapCommand *createCompareAndSwapCommand(FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + /* + * Create local FireWire address spaces for the device to access + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + /* + * Get Config directory for nub + * Device nub directory is root directory, Unit nub directory is Unit directory. + * + * Depricated use getConfigDirectoryRef + * + */ + + virtual IOReturn getConfigDirectory(IOConfigDirectory *&dir); + + /* + * Get bus for nub + */ + IOFireWireBus * getBus() const; + + IOFireWireController * getController() const; + + const CSRNodeUniqueID &getUniqueID() const; + + /* + * Standard nub initialization + */ + virtual bool init(OSDictionary * propTable); + + virtual void setNodeFlags( UInt32 flags ); + virtual UInt32 getNodeFlags( void ); + virtual void clearNodeFlags( UInt32 flags ); + + virtual IOReturn setConfigDirectory( IOConfigDirectory *directory ); + + virtual IOReturn getConfigDirectoryRef( IOConfigDirectory *&dir ); + + inline UInt32 hopCount( IOFireWireNub * nub ) + { return fAuxiliary->hopCount( nub ); } + + inline UInt32 hopCount( void ) + { return fAuxiliary->hopCount(); } + + inline TerminationState getTerminationState( void ) + { return fAuxiliary->getTerminationState(); } + +protected: + inline void setTerminationState( TerminationState state ) + { fAuxiliary->setTerminationState( state ); } + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + + inline bool isPhysicalAccessEnabled( void ) + { return fAuxiliary->isPhysicalAccessEnabled(); } + + inline IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimpleContiguousPhysicalAddressSpace( size, direction ); } + + inline IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimplePhysicalAddressSpace( size, direction ); } + +private: + OSMetaClassDeclareReservedUsed(IOFireWireNub, 0); + OSMetaClassDeclareReservedUsed(IOFireWireNub, 1); + OSMetaClassDeclareReservedUnused(IOFireWireNub, 2); + OSMetaClassDeclareReservedUnused(IOFireWireNub, 3); + +}; + +#endif /* ! _IOKIT_IOFIREWIRENUB_H */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWirePowerManager.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWirePowerManager.h.svn-base new file mode 100644 index 0000000..e0a141a --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWirePowerManager.h.svn-base @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREPOWERMANAGER_H +#define _IOKIT_IOFIREWIREPOWERMANAGER_H + +#include + +#include +#include + +class IOFireWireController; + +/*! @class IOFireWirePowerManager +*/ + +class IOFireWirePowerManager : public OSObject +{ + OSDeclareAbstractStructors(IOFireWirePowerManager); + +protected: + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + IOFireWireController * fControl; + + UInt32 fMaximumDeciwatts; + UInt32 fAllocatedDeciwatts; + +public: + static IOFireWirePowerManager * createWithController( IOFireWireController * controller ); + + virtual bool initWithController( IOFireWireController * controller ); + + virtual void setMaximumDeciwatts( UInt32 deciwatts ); + virtual IOReturn allocateDeciwatts( UInt32 deciwatts ); + virtual void deallocateDeciwatts( UInt32 deciwatts ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 0); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 1); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 2); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 3); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 4); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 5); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 6); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 7); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 8); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 9); +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOFireWireUnit.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireUnit.h.svn-base new file mode 100644 index 0000000..6509b94 --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOFireWireUnit.h.svn-base @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWireUnit.h + * + * + */ +#ifndef _IOKIT_IOFIREWIREUNIT_H +#define _IOKIT_IOFIREWIREUNIT_H + +// public +#include + +class IOFireWireDevice; +class IOFireWireUnit; + +#pragma mark - + +/*! + @class IOFireWireUnitAux +*/ + +class IOFireWireUnitAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireUnitAux) + + friend class IOFireWireUnit; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireUnit * primary ); + virtual void free(); + + virtual bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 3); + +}; + +#pragma mark - + +/*! @class IOFireWireUnit +*/ +class IOFireWireUnit : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireUnit) + + friend class IOFireWireUnitAux; + friend class IOFireWireDevice; + +protected: + IOFireWireDevice *fDevice; // The device unit is part of + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*------------------Methods provided to FireWire device clients-----------------------*/ +public: + + virtual bool init(OSDictionary *propTable, IOConfigDirectory *directory); + + /* + * Standard nub initialization + */ + virtual bool attach(IOService * provider ); + virtual void free(); + + /* + * Matching language support + * Match on the following properties of the unit: + * Vendor_ID + * GUID + * Unit_Spec_ID + * Unit_SW_Version + */ + virtual bool matchPropertyTable(OSDictionary * table); + + + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + + // Override handleOpen() and handleClose() to pass on to device + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + virtual void setNodeFlags( UInt32 flags ); + virtual void clearNodeFlags( UInt32 flags ); + virtual UInt32 getNodeFlags( void ); + + virtual IOReturn setConfigDirectory( IOConfigDirectory *directory ); + + /* + * Create local FireWire address spaces for the device to access + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + +protected: + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + void setMaxSpeed( IOFWSpeed speed ); + +protected: + void terminateUnit( void ); + static void terminateUnitThreadFunc( void * refcon ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireUnit, 1); + +}; + +#endif /* ! _IOKIT_IOFIREWIREDEVICE_H */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IOLocalConfigDirectory.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IOLocalConfigDirectory.h.svn-base new file mode 100644 index 0000000..4be26df --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IOLocalConfigDirectory.h.svn-base @@ -0,0 +1,110 @@ +/* +* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.1 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +* License for the specific language governing rights and limitations +* under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ + +#ifndef __IOLOCALCONFIGDIRECTORY_H__ +#define __IOLOCALCONFIGDIRECTORY_H__ + +#include +#include +#include +#include + +class OSArray; +class OSData; +class IOFireWireController; +class IOFWUserObjectExporter ; + +/*! @class IOLocalConfigDirectory +*/ +class IOLocalConfigDirectory : public IOConfigDirectory +{ + friend class IOFireWireController; + friend class IOFireWireUserClient ; + + OSDeclareDefaultStructors(IOLocalConfigDirectory); + +protected: + OSArray *fEntries; // Entries for this directory. + OSData *fROM; // Local ROM, if compiled. + UInt32 fHeader; // Num entries and CRC. + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool init(); + virtual void free(); + + virtual const UInt32 *getBase(); + virtual IOConfigDirectory *getSubDir(int start, int type); + +public: + static IOLocalConfigDirectory *create(); + + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase); + + virtual IOReturn compile(OSData *rom); + + // All flavours of addEntry eat a retain of the desc string + virtual IOReturn addEntry(int key, UInt32 value, OSString *desc = NULL); + virtual IOReturn addEntry(int key, IOLocalConfigDirectory *value, + OSString *desc = NULL); + virtual IOReturn addEntry(int key, OSData *value, OSString *desc = NULL); + virtual IOReturn addEntry(int key, FWAddress value, OSString *desc = NULL); + virtual IOReturn removeSubDir(IOLocalConfigDirectory *value); + const OSArray *getEntries() const; + + virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value); + +protected: + + virtual const UInt32 * lockData( void ); + virtual void unlockData( void ); + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ); + virtual IOReturn checkROMState( void ); + + // call eats a retain count + virtual IOReturn addEntry(OSString *desc); + + IOReturn incrementGeneration( void ); + static void exporterCleanup( const OSObject * self, IOFWUserObjectExporter * exporter ) ; + +private: + OSMetaClassDeclareReservedUsed(IOLocalConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 2); +}; + +#endif /* __IOLOCALCONFIGDIRECTORY_H__ */ diff --git a/i386/include/IOKit/firewire/.svn/text-base/IORemoteConfigDirectory.h.svn-base b/i386/include/IOKit/firewire/.svn/text-base/IORemoteConfigDirectory.h.svn-base new file mode 100644 index 0000000..7ddbb7c --- /dev/null +++ b/i386/include/IOKit/firewire/.svn/text-base/IORemoteConfigDirectory.h.svn-base @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOREMOTECONFIGDIRECTORY_H__ +#define __IOREMOTECONFIGDIRECTORY_H__ + +#include +#include + +#include +#include + +#include "IOFireWireROMCache.h" + +class OSString; +class OSIterator; +class IOFireWireDevice; + +/*! @class IORemoteConfigDirectory +*/ +class IORemoteConfigDirectory : public IOConfigDirectory +{ + OSDeclareDefaultStructors(IORemoteConfigDirectory); + +protected: + IOFireWireROMCache *fROM; // Our cache of the ROM + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithOwnerOffset(IOFireWireROMCache *rom, + int start, int type); + virtual void free(); + + virtual const UInt32 *getBase(); + virtual IOConfigDirectory *getSubDir(int start, int type); + +public: + static IOConfigDirectory *withOwnerOffset(IOFireWireROMCache *rom, + int start, int type); + + + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase); + +protected: + + virtual const UInt32 * lockData( void ); + virtual void unlockData( void ); + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ); + virtual IOReturn checkROMState( void ); + +private: + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 2); +}; + + +#endif /* __IOREMOTECONFIGDIRECTORY_H__ */ diff --git a/i386/include/IOKit/firewire/IOConfigDirectory.h b/i386/include/IOKit/firewire/IOConfigDirectory.h new file mode 100644 index 0000000..d72ed21 --- /dev/null +++ b/i386/include/IOKit/firewire/IOConfigDirectory.h @@ -0,0 +1,182 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOCONFIGDIRECTORY_H__ +#define __IOCONFIGDIRECTORY_H__ + +#include +#include + +#include + +class OSData; +class OSString; +class OSIterator; +class IOFireWireDevice; + +/*! @class IOConfigDirectory +*/ +class IOConfigDirectory : public OSObject +{ + OSDeclareAbstractStructors(IOConfigDirectory); + +protected: + int fStart; // Offset into ROM of start of this dir + int fType; // Directory type + int fNumEntries; // In directory + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithOffset(int start, int type); + + virtual const UInt32 *getBase() = 0; + virtual IOReturn createIterator(UInt32 testVal, UInt32 testMask, + OSIterator *&iterator); + virtual IOConfigDirectory *getSubDir(int start, int type) = 0; + +public: + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase) = 0; + + /*! + @function getKeyType + Gets the data type for the specified key + @param type on return, set to the data type + @result kIOReturnSuccess if the key exists in the dictionary + */ + virtual IOReturn getKeyType(int key, IOConfigKeyType &type); + /*! + @function getKeyValue + Gets the value for the specified key, in a variety of forms. + @param value on return, set to the data type + @param text if non-zero, on return points to the + string description of the field, or NULL if no text found. + @result kIOReturnSuccess if the key exists in the dictionary + and is of a type appropriate for the value parameter + @param value reference to variable to store the entry's value + */ + virtual IOReturn getKeyValue(int key, UInt32 &value, OSString** text = NULL); + virtual IOReturn getKeyValue(int key, OSData *&value, + OSString** text = NULL); + virtual IOReturn getKeyValue(int key, IOConfigDirectory *&value, + OSString** text = NULL); + virtual IOReturn getKeyOffset(int key, FWAddress &value, + OSString** text = NULL); + + + /*! + @function getIndexType + Gets the data type for entry at the specified index + @param type on return, set to the data type + @result kIOReturnSuccess if the index exists in the dictionary + */ + virtual IOReturn getIndexType(int index, IOConfigKeyType &type); + /*! + @function getIndexKey + Gets the key for entry at the specified index + @param key on return, set to the key + @result kIOReturnSuccess if the index exists in the dictionary + */ + virtual IOReturn getIndexKey(int index, int &key); + + /*! + @function getIndexValue + Gets the value at the specified index of the directory, + in a variety of forms. + @param type on return, set to the data type + @result kIOReturnSuccess if the index exists in the dictionary + and is of a type appropriate for the value parameter + @param value reference to variable to store the entry's value + */ + virtual IOReturn getIndexValue(int index, UInt32 &value); + virtual IOReturn getIndexValue(int index, OSData *&value); + virtual IOReturn getIndexValue(int index, OSString *&value); + virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value); + virtual IOReturn getIndexOffset(int index, FWAddress &value); + virtual IOReturn getIndexOffset(int index, UInt32 &value); + + /*! + @function getIndexEntry + Gets the entry at the specified index of the directory, + as a raw UInt32. + @param entry on return, set to the entry value + @result kIOReturnSuccess if the index exists in the dictionary + @param value reference to variable to store the entry's value + */ + virtual IOReturn getIndexEntry(int index, UInt32 &value); + + /*! + @function getSubdirectories + Creates an iterator over the subdirectories of the directory. + @param iterator on return, set to point to an OSIterator + @result kIOReturnSuccess if the iterator could be created + */ + virtual IOReturn getSubdirectories(OSIterator *&iterator); + + /*! + @function getKeySubdirectories + Creates an iterator over subdirectories of a given type of the directory. + @param key type of subdirectory to iterate over + @param iterator on return, set to point to an OSIterator + @result kIOReturnSuccess if the iterator could be created + */ + virtual IOReturn getKeySubdirectories(int key, OSIterator *&iterator); + + int getType() const; + + int getNumEntries() const; + +protected: + + virtual const UInt32 * lockData( void ) = 0; + virtual void unlockData( void ) = 0; + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ) = 0; + virtual IOReturn checkROMState( void ) = 0; + +private: + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 2); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 3); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 4); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 5); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 6); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 7); + OSMetaClassDeclareReservedUnused(IOConfigDirectory, 8); + +}; + +#endif /* __IOCONFIGDIRECTORY_H__ */ diff --git a/i386/include/IOKit/firewire/IOFWAddressSpace.h b/i386/include/IOKit/firewire/IOFWAddressSpace.h new file mode 100644 index 0000000..7ad6764 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWAddressSpace.h @@ -0,0 +1,331 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * + * IOFWAddressSpace.h + * + * Classes which describe addresses in the local node which are accessable to other nodes + * via firewire asynchronous read/write/lock requests. + */ + +#ifndef _IOKIT_IOFWADDRESSSPACE_H +#define _IOKIT_IOFWADDRESSSPACE_H + +#include +#include + +class IOFireWireDevice; +class IOFireWireBus; +class IOFireWireController; + +typedef void * IOFWRequestRefCon; + +/*! @function FWWriteCallback + @abstract Callback called when a write request packet is received for + a 'virtual' firewire address. + @param device is the node originating the request + @param speed is the FireWire speed of the request, update it if you need to control + the speed of the reply, otherwise the response will be the same speed. + @param addr is the address the device is requesting to write to + @param len is the number of bytes to write + @param buf contains the packet data + @param requestRefcon refcon Can be queried for extra info about the request, + using IOFireWireController::isLockRequest(), isQuadRequest() + @result return: + kFWResponseComplete = 0, OK + kFWResponseConflictError = 4, Resource conflict, may retry + kFWResponseDataError = 5, Data not available + kFWResponseTypeError = 6, Operation not supported + kFWResponseAddressError = 7 Address not valid in target device */ +typedef UInt32 (*FWWriteCallback)(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon requestRefcon); + +/*! @function FWReadCallback + @abstract Callback called when a read request packet is received for + a 'virtual' firewire address. + @param nodeID is the node originating the request + @param speed is the FireWire speed of the request, update it if you need to control + the speed of the reply, otherwise the response will be the same speed. + @param addr is the address the device is requesting to read from + @param len is the number of bytes to read + @param buf contains the packet data + @param offset on return points to the offset into *buf of the packet data + @param requestRefcon refcon to pass back if sending a delayed response. Also can be queried + for extra info about the request + @result return: + kFWResponsePending = -1, Pseudo response, real response sent later. + kFWResponseComplete = 0, OK! + kFWResponseConflictError = 4, Resource conflict, may retry + kFWResponseDataError = 5, Data not available + kFWResponseTypeError = 6, Operation not supported + kFWResponseAddressError = 7 Address not valid in target device + + A return of kFWResponsePending should be followed at some later time by a call to + IOFireWireController::asyncReadResponse */ +typedef UInt32 (*FWReadCallback)(void *refcon, UInt16 nodeID, IOFWSpeed &speed, + FWAddress addr, UInt32 len, IOMemoryDescriptor **buf, + IOByteCount * offset, IOFWRequestRefCon requestRefcon); + +class IOFWAddressSpace; + +#pragma mark - + +/*! @class IOFWAddressSpaceAux + @discussion An IOFWAddressSpaceAux is for internal use only. You should never subclass IOFWAddressSpaceAux +*/ + +class IOFWAddressSpaceAux : public OSObject +{ + OSDeclareDefaultStructors(IOFWAddressSpaceAux) + + friend class IOFWAddressSpace; + +protected: + + IOFWAddressSpace * fPrimary; + IOFireWireController * fControl; + + OSSet * fTrustedNodeSet; + OSIterator * fTrustedNodeSetIterator; + + bool fExclusive; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + + virtual bool isTrustedNode( UInt16 nodeID ); + virtual void addTrustedNode( IOFireWireDevice * device ); + virtual void removeTrustedNode( IOFireWireDevice * device ); + virtual void removeAllTrustedNodes( void ); + + bool isExclusive( void ); + void setExclusive( bool exclusive ); + + virtual bool intersects( IOFWAddressSpace * space ); + +private: + OSMetaClassDeclareReservedUsed(IOFWAddressSpaceAux, 0); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWAddressSpaceAux, 9); + +}; + +#pragma mark - + +/* + * Base class for FireWire address space objects + */ + +/*! + @class IOFWAddressSpace +*/ + +class IOFWAddressSpace : public OSObject +{ + OSDeclareAbstractStructors(IOFWAddressSpace) + + friend class IOFWAddressSpaceAux; + +protected: + + IOFireWireController *fControl; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData + { + IOFWAddressSpaceAux * fAuxiliary; + }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * fIOFWAddressSpaceExpansion; + + virtual bool init(IOFireWireBus *bus); + virtual void free(); + +public: + + /*! @function doRead + @abstract An abstract method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, + IOFWRequestRefCon refcon) = 0; + + /*! @function doWrite + @abstract An abstract method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon) = 0; + + /*! @function doLock + @abstract A method for processing a lock request. + @param nodeID FireWire Lock request for nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param inlen 'inlen' bytes to use. + @param newVal new value to write at 'addr' location . + @param outLen 'outLen' bytes for result. + @param oldVal old value read from 'addr' location. + @param extType Type like kFWExtendedTCodeCompareSwap. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doLock(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 inlen, + const UInt32 *newVal, UInt32 &outLen, UInt32 *oldVal, + UInt32 extType, IOFWRequestRefCon refcon); + + /*! @function activate + @abstract Address space is ready for handling requests. + @result IOReturn + */ + virtual IOReturn activate(); + + /*! @function deactivate + @abstract Address space request handler is disabled. + @result none + */ + virtual void deactivate(); + + /*! @function contains + @abstract returns number of bytes starting at addr in this space + @result 0 if it doesn't contain the address + */ + virtual UInt32 contains(FWAddress addr); + + /*! @function isTrustedNode + @abstract returns true if the node is added as a trusted node + @param nodeID is the nodeID to verify whether its trusted. + @result false if nodeID is not trusted + */ + inline bool isTrustedNode( UInt16 nodeID ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->isTrustedNode( nodeID ); } + + /*! @function addTrustedNode + @abstract Add a trusted node. + @param device object pointing to a FireWire node on the bus. + @result none + */ + inline void addTrustedNode( IOFireWireDevice * device ) + { fIOFWAddressSpaceExpansion->fAuxiliary->addTrustedNode( device ); } + + /*! @function removeTrustedNode + @abstract Remove a trusted node. + @param device object pointing to a FireWire node on the bus. + @result none + */ + inline void removeTrustedNode( IOFireWireDevice * device ) + { fIOFWAddressSpaceExpansion->fAuxiliary->removeTrustedNode( device ); } + + /*! @function removeAllTrustedNodes + @abstract Remove all trusted nodes. + @result none + */ + inline void removeAllTrustedNodes( void ) + { fIOFWAddressSpaceExpansion->fAuxiliary->removeAllTrustedNodes(); } + + /*! @function isExclusive + @abstract Checks if an address space wants exclusive control of its address range + @result True if the address space is marked exclusive false otherwise + */ + + inline bool isExclusive( void ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->isExclusive(); } + + /*! @function setExclusive + @abstract Sets if this address space requires exclusive control of its address range. Exclusivity should be set before an address space is activated. + @param exclusive True if address space should be exclusive, false otherwise + @result none + */ + + inline void setExclusive( bool exclusive ) + { fIOFWAddressSpaceExpansion->fAuxiliary->setExclusive( exclusive ); } + + /*! @function intersects + @abstract Checks this address space intersects with the given address range. Currently only supports IOFWPsuedoAddressSpaces. + @param space An address space to compare against + @result True if the address spaces intersect false otherwise + */ + + inline bool intersects( IOFWAddressSpace * space ) + { return fIOFWAddressSpaceExpansion->fAuxiliary->intersects( space ); } + + +protected: + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +private: + OSMetaClassDeclareReservedUsed(IOFWAddressSpace, 0); + OSMetaClassDeclareReservedUsed(IOFWAddressSpace, 1); + +}; + +// the physical and psuedo address space classes used to be defined here +// for backwards compatibility, we pull them in now. the ifdefs surrounding +// the content of the header files ensures we do not multiply include a header. + +#include +#include + +#endif /* _IOKIT_IOFWADDRESSSPACE */ diff --git a/i386/include/IOKit/firewire/IOFWAsyncStreamListener.h b/i386/include/IOKit/firewire/IOFWAsyncStreamListener.h new file mode 100644 index 0000000..cef64f8 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWAsyncStreamListener.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOFWASYNCSTREAMLISTENER_H +#define _IOKIT_IOFWASYNCSTREAMLISTENER_H + +#include +#include +#include +#include + +class IOFWAsyncStreamReceiver; +class IOFWAsyncStreamReceivePort; + +/*! @class IOFWAsyncStreamListener +*/ +class IOFWAsyncStreamListener : public OSObject +{ + OSDeclareDefaultStructors(IOFWAsyncStreamListener) + +friend class IOFWAsyncStreamReceiver; +friend class IOFireWireController; + +public: + +/*! @function initAll + @abstract Creates an AsyncStream client for an Isoch channel. + @param control Points to IOFireWireController. + @param channel Isoch channel for listening. + @param proc Callback on packet reception. + @param obj Client's callback object. + @result returns true on success, else false. */ + bool initAll( IOFireWireController *control, UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + +/*! @function setListenerHandler + @abstract Set the callback that should be called to handle incoming async stream packets + @param inReceiver The callback to set. + @result Returns the callback that was previously set or nil for none.*/ + const FWAsyncStreamReceiveCallback setListenerHandler( FWAsyncStreamReceiveCallback inReceiver ); + +/*! @function TurnOffNotification + @abstract Turns off client callback notification. + @result none. */ + inline void TurnOffNotification() { fNotify = false; }; + +/*! @function TurnOnNotification + @abstract Turns on client callback notification. + @result none. */ + inline void TurnOnNotification() { fNotify = true; }; + +/*! @function IsNotificationOn + @abstract checks the notification state. + @result true if ON, else false */ + inline bool IsNotificationOn() { return fNotify; }; + +/*! @function setFlags + @abstract set flags for the listener. + @param flags indicate performance metrics. + @result none. */ + void setFlags( UInt32 flags ); + +/*! @function getFlags + @abstract get the flags of listener. + @param none. + @result flags. */ + UInt32 getFlags(); + +/*! @function getRefCon + @abstract get the refcon specific to this listener. + @param none. + @result fRefCon refcon passed during initialization. */ + inline void* getRefCon() { return fRefCon; }; + +/*! @function getOverrunCounter + @abstract get overrun counter from the DCL program. + @param none. + @result returns the counter value. */ + UInt32 getOverrunCounter(); + +protected: + + FWAsyncStreamReceiveCallback fClientProc; + void *fRefCon; + IOFWAsyncStreamReceiver *fReceiver; + bool fNotify; + UInt32 fFlags; + IOFireWireController *fControl; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual void free(); + +private: +/*! function getReceiver + abstract Returns the Async Stream receiver object which tracks multiple + IOFWAsyncStreamListeners for the same Isoc channel. */ + inline IOFWAsyncStreamReceiver *getReceiver() { return fReceiver; }; + +/*! function invokeClients + abstract Invokes client's callback function with fRefCon. */ + void invokeClients( UInt8 *buffer ); + + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 1); +}; +#endif // _IOKIT_IOFWASYNCSTREAMLISTENER_H + diff --git a/i386/include/IOKit/firewire/IOFWCommand.h b/i386/include/IOKit/firewire/IOFWCommand.h new file mode 100644 index 0000000..fdf85b5 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWCommand.h @@ -0,0 +1,977 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFWCommand.h + * + */ +#ifndef _IOKIT_IOFWCOMMAND_H +#define _IOKIT_IOFWCOMMAND_H + +#include +#include + +#include + +#include + +#define kFWCmdDefaultRetries 3 +#define kFWCmdZeroRetries 0 +#define kFWCmdReducedRetries 2 +#define kFWCmdIncreasedRetries 6 + +class IOMemoryDescriptor; +class IOSyncer; +class IOFireWireBus; +class IOFireWireController; +class IOFireWireNub; +class IOFWAddressSpace; // Description of chunk of local FW address space +class IOFWCommand; +class IOFWBusCommand; +class IOFWAsyncStreamCommand; +class IOCommandGate; +class IOFWAsyncPHYCommand; + +struct AsyncPendingTrans; + +// Struct for head of command queue +/*! + @struct IOFWCmdQ + @abstract Structure for head of a queue of IOFWCommands + @field fHead Points to the head of the queue, or NULL if queue is empty + @field fTail Points to the tail of the queue, or NULL if queue is empty + @function headChanged called when head command is changed, or the command + itself changes state. +*/ + +struct IOFWCmdQ +{ + IOFWCommand *fHead; + IOFWCommand *fTail; + bool executeQueue(bool all); + virtual void headChanged(IOFWCommand *oldHead); + + virtual ~IOFWCmdQ() {} + + void checkProgress( void ); +}; + +// Callback when device command completes asynchronously +typedef void (*FWDeviceCallback)(void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd); + +// Callback when bus command completes asynchronously +typedef void (*FWBusCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +// Callback when async stream command completes asynchronously +typedef void (*FWAsyncStreamCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWAsyncStreamCommand *fwCmd); + +// Callback when async stream command completes asynchronously +typedef void (*FWAsyncPHYCallback)(void *refcon, IOReturn status, IOFireWireBus *bus, IOFWAsyncPHYCommand *fwCmd ); + +// Callback when async stream packet is received +typedef void (*FWAsyncStreamReceiveCallback)(void *refcon, const void *buf); + +#pragma mark - + +/* + * Base class for FireWire commands + */ +/*! @class IOFWCommand +*/ +class IOFWCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOFWCommand) + +protected: + IOReturn fStatus; + IOFireWireController *fControl; + IOFWCommand * fQueuePrev; + IOFWCommand * fQueueNext; + IOFWCmdQ * fQueue; + UInt32 fTimeout; // How long (in microsecs) after execute() to timeout + AbsoluteTime fDeadline; // Time after which this command has timed out. + IOFWSyncer * fSyncWakeup; + UInt8 fSync; + UInt8 fCancelOnReset; + UInt8 spare[2]; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct MemberVariables + { + void * fFWIMRefCon; + IOReturn fCompletionStatus; + bool fSubmitTimeLatched; + AbsoluteTime fSubmitTime; + bool fFlush; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + MemberVariables * fMembers; + + virtual IOReturn complete(IOReturn status); + virtual void updateTimer(); + virtual IOReturn startExecution(); + + /* + * Execute the FWCommand immediately + * must be called with the workloop gate closed + */ + virtual IOReturn execute() = 0; + +public: + + virtual bool initWithController(IOFireWireController *control); + virtual void free( void ); + + IOReturn getStatus() const { return fStatus; }; + + /* + * Submit the FWCommand. + * if queue is false the command's execute() + * method will be called on the caller's thread, otherwise + * the command wil be queued for execution on the work loop thread. + */ + virtual IOReturn submit(bool queue = false); + + /* + * Cancel command, causes it to complete with given status + */ + virtual IOReturn cancel(IOReturn reason); + + /*! + @function setHead + inserts a command at the head of a queue. + @param queue queue command is being added to + */ + virtual void setHead(IOFWCmdQ &queue); + /*! + @function insertAfter + inserts a command after the specified one. + @param prev command to insert after + @param queue queue command is being added to + */ + virtual void insertAfter(IOFWCommand &prev); + + /*! + @function removeFromQ + Removes command from current queue. + */ + virtual void removeFromQ(); + + IOFWCommand *getPrevious() const + { return fQueuePrev; }; + IOFWCommand *getNext() const + { return fQueueNext; }; + const AbsoluteTime &getDeadline() const + { return fDeadline; }; + + bool cancelOnReset() const + { return fCancelOnReset; }; + + bool Busy() const + { return fStatus == kIOReturnBusy || fStatus == kIOFireWirePending;}; + + void setTimeout( UInt32 timeout ) + { fTimeout = timeout; }; + + friend class IOFWCmdQ; + + void * getFWIMRefCon( void ) + { + return fMembers->fFWIMRefCon; + } + + void setFWIMRefCon( void * refcon ) + { + fMembers->fFWIMRefCon = refcon; + } + + void setFlush( bool flush ) + { + fMembers->fFlush = flush; + } + + virtual IOReturn checkProgress( void ); + +private: + OSMetaClassDeclareReservedUsed(IOFWCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWCommand, 1); + +}; + +#pragma mark - + +/* + * Bus control commands + */ +/*! @class IOFWBusCommand +*/ +class IOFWBusCommand : public IOFWCommand +{ + OSDeclareAbstractStructors(IOFWBusCommand) + +protected: + FWBusCallback fComplete; + void * fRefCon; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual IOReturn complete(IOReturn status); + + virtual bool initWithController(IOFireWireController *control, + FWBusCallback completion=NULL, void *refcon=NULL); + virtual IOReturn reinit(FWBusCallback completion, void *refcon); + +private: + OSMetaClassDeclareReservedUnused(IOFWBusCommand, 0); + +}; + +#pragma mark - + +/* + * Command to execute some code after a specified delay (in microseconds) + * All it does is timeout after the specified delay, hence calling the completion + * callback. + */ +/*! @class IOFWDelayCommand +*/ +class IOFWDelayCommand : public IOFWBusCommand +{ + OSDeclareDefaultStructors(IOFWDelayCommand) + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +protected: + virtual IOReturn execute(); + +public: + virtual bool initWithDelay(IOFireWireController *control, UInt32 uSecs, + FWBusCallback completion, void *refcon); + virtual IOReturn reinit(UInt32 uSecs, FWBusCallback completion, void *refcon); + +private: + OSMetaClassDeclareReservedUnused(IOFWDelayCommand, 0); + +}; + +/* + * Send an async request to a device + */ +class IOFWUserReadQuadletCommand ; +class IOFWUserWriteCommand ; + +#pragma mark - + +/*! @class IOFWAsyncCommand +*/ +class IOFWAsyncCommand : public IOFWCommand +{ + OSDeclareAbstractStructors(IOFWAsyncCommand) + +protected: + IOFireWireNub * fDevice; + FWDeviceCallback fComplete; + void * fRefCon; + IOMemoryDescriptor *fMemDesc; + AsyncPendingTrans * fTrans; + UInt32 fAddressHi; + UInt32 fAddressLo; + IOByteCount fBytesTransferred; + int fSize; + int fSpeed; + int fMaxPack; + int fCurRetries; + int fMaxRetries; + UInt32 fGeneration; // bus topology fNodeID is valid for. + UInt16 fNodeID; + bool fFailOnReset; + bool fWrite; + + typedef struct + { + // some of our subclasses didn't have room for expansion data, so + // we've reserved space for their use here. + + void * fSubclassMembers; + int fMaxSpeed; + int fAckCode; + UInt32 fResponseCode; + UInt32 fFastRetryCount; + int fResponseSpeed; + bool fForceBlockRequests; + } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete(IOReturn status); + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + virtual void free( void ); + virtual IOReturn reinit(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + bool createMemberVariables( void ); + void destroyMemberVariables( void ); +public: + // Utility for setting generation on newly created command + virtual void setGeneration(UInt32 generation) + { fGeneration = generation; } + + // To be called by IOFireWireController and derived classes. + virtual void gotPacket(int rcode, const void* data, int size) = 0; + virtual void gotAck(int ackCode); + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + // explicitly update nodeID/generation after bus reset + IOReturn updateNodeID(UInt32 generation, UInt16 nodeID); + + // Generally useful stuff + IOByteCount getBytesTransferred() const + { return fBytesTransferred; }; + + FWAddress getAddress() const + { return FWAddress(fAddressHi, fAddressLo, fNodeID); } + + bool failOnReset() const + { return fFailOnReset; } + + IOFireWireNub * getDevice() const + { return fDevice; } + + /*! + @function setMaxPacket + Sets the maximum size for block transfers used by the command. + The command is initialized to use the maximum packet size calculated from the device's + PHY speed, bus info block and the bus topology. + Call this method before calling submit(). + @param maxBytes Maximum packet size in bytes. If the maxsize is 4 then quadlet transfers will be used. + */ + IOReturn setMaxPacket(UInt32 maxBytes) + { + if(fStatus == kIOReturnBusy || fStatus == kIOFireWirePending) + return fStatus; + fMaxPack = maxBytes; + return kIOReturnSuccess; + } + + void setMaxSpeed( int speed ); + + void setAckCode( int ack ); + int getAckCode( void ); + + void setRetries( int retries); + int getMaxRetries( void ); + + void setResponseCode( UInt32 rcode ); + UInt32 getResponseCode( void ) const; + + void setFastRetryCount( UInt32 count ) + { fMembers->fFastRetryCount = count; }; + + UInt32 getFastRetryCount( void ) + { return fMembers->fFastRetryCount; }; + + void setResponseSpeed( int speed ) + { fMembers->fResponseSpeed = speed; }; + + int getResponseSpeed( void ) + { return fMembers->fResponseSpeed; }; + + // forces even 4 byte transactions to be block requests + void setForceBlockRequests( bool enabled ) + { fMembers->fForceBlockRequests = enabled; } + + virtual IOReturn checkProgress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWAsyncCommand, 3); + +}; + +#pragma mark - + +/* + * Concrete async requests - read, write and hordes of read/modify/write + */ +class IOFWReadCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWReadCommand) + +protected: + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + IOMemoryDescriptor *hostMem, + FWDeviceCallback completion, void *refcon); + virtual IOReturn reinit(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL); + +private: + OSMetaClassDeclareReservedUnused(IOFWReadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWReadCommand, 1); +}; + +#pragma mark - + +/*! + @class IOFWReadQuadCommand + @discussion An easier to use version of IOFWReadCommand for use when the data to be transferred + is an integer number of quads. + Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) + is called. +*/ + +class IOFWReadQuadCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWReadQuadCommand) + +protected: + + UInt32 * fQuads; + + typedef struct + { + bool fPingTime; + } + MemberVariables; + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + virtual void free( void ); + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + UInt32 *quads, int numQuads, + FWDeviceCallback completion, void *refcon, bool failOnReset); + + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + UInt32 *quads, int numQuads, + FWDeviceCallback completion, void *refcon); + + virtual IOReturn reinit(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL); + + void setPingTime( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fPingTime = state; }; + +private: + OSMetaClassDeclareReservedUnused(IOFWReadQuadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWReadQuadCommand, 1); +}; + +#pragma mark - + +class IOFWWriteCommand : public IOFWAsyncCommand +{ + + OSDeclareDefaultStructors(IOFWWriteCommand) + +protected: + + int fPackSize; + + typedef struct + { + bool fDeferredNotify; + bool fFastRetryOnBusy; + } + MemberVariables; + + virtual IOReturn execute(); + + virtual void gotPacket( int rcode, const void* data, int size ); + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + +public: + + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll( IOFireWireNub * device, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion, + void * refcon, + bool failOnReset ); + + virtual bool initAll( IOFireWireController * control, + UInt32 generation, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion, + void * refcon ); + virtual void free( void ); + + virtual IOReturn reinit( FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion = NULL, + void * refcon = NULL, + bool failOnReset = false ); + + virtual IOReturn reinit( UInt32 generation, + FWAddress devAddress, + IOMemoryDescriptor * hostMem, + FWDeviceCallback completion = NULL, + void * refcon = NULL ); + + void setDeferredNotify( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fDeferredNotify = state; }; + + void setFastRetryOnBusy( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fFastRetryOnBusy = state; }; + +private: + + OSMetaClassDeclareReservedUnused(IOFWWriteCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWWriteCommand, 1); + +}; + +#pragma mark - + +/*! + @class IOFWWriteQuadCommand + @discussion An easier to use version of IOFWWriteCommand for use when the data to be transferred + is small and an integer number of quads. + Note that block read requests will be used for transfers greater than one quad unless setMaxPacket(4) + is called. + kMaxWriteQuads is the largest legal number of quads that this object can be asked to transfer + (the data is copied into an internal buffer in init() and reinit()). +*/ + +class IOFWWriteQuadCommand : public IOFWAsyncCommand +{ + + OSDeclareDefaultStructors(IOFWWriteQuadCommand) + +public: + + enum + { + kMaxWriteQuads = 8 + }; + +protected: + + UInt32 fQuads[kMaxWriteQuads]; + UInt32 * fQPtr; + int fPackSize; + + typedef struct + { + bool fDeferredNotify; + IOMemoryDescriptor * fMemory; + } + MemberVariables; + + virtual void gotPacket( int rcode, const void* data, int size ); + + virtual IOReturn execute(); + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + +public: + virtual bool initWithController(IOFireWireController *control); + + virtual bool initAll( IOFireWireNub * device, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion, + void * refcon, + bool failOnReset ); + + virtual bool initAll( IOFireWireController * control, + UInt32 generation, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion, + void * refcon ); + + virtual void free( void ); + + virtual IOReturn reinit( FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion = NULL, + void * refcon = NULL, + bool failOnReset = false ); + + virtual IOReturn reinit( UInt32 generation, + FWAddress devAddress, + UInt32 * quads, + int numQuads, + FWDeviceCallback completion = NULL, + void * refcon = NULL ); + +protected: + + void setQuads( UInt32 * quads, int numQuads ); + bool createMemoryDescriptor( void ); + void destroyMemoryDescriptor( void ); + +public: + + void setDeferredNotify( bool state ) + { ((MemberVariables*)fMembers->fSubclassMembers)->fDeferredNotify = state; }; + +private: + + OSMetaClassDeclareReservedUnused(IOFWWriteQuadCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWWriteQuadCommand, 1); + +}; + +/* + * May need more parameters for some of these, + * and/or derive from a base Lock transaction command + */ + +#pragma mark - + +/*! @class IOFWCompareAndSwapCommand +*/ +class IOFWCompareAndSwapCommand : public IOFWAsyncCommand +{ + OSDeclareDefaultStructors(IOFWCompareAndSwapCommand) + +protected: + UInt32 fInputVals[4]; + UInt32 fOldVal[2]; + + typedef struct + { + IOMemoryDescriptor * fMemory; + } + MemberVariables; + + MemberVariables * fMembers; + + virtual void gotPacket(int rcode, const void* data, int size); + + virtual IOReturn execute(); + +public: + // Compare to cmpVal, and if equal replace with newVal. + // Size = 1 for 32 bit operation (one quad), 2 for 64 bit (two quads) + virtual bool initWithController(IOFireWireController *control); + virtual bool initAll(IOFireWireNub *device, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion, void *refcon, bool failOnReset); + virtual bool initAll(IOFireWireController *control, + UInt32 generation, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion, void *refcon); + + virtual IOReturn reinit(FWAddress devAddress, const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL, bool failOnReset=false); + virtual IOReturn reinit(UInt32 generation, FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL); + + // sets oldVal to the old value returned by the device, and + // returns true if it was the expected value, ie. the lock succeeded + virtual bool locked(UInt32 *oldVal); + + virtual void free( void ); + +protected: + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + + void setInputVals( const UInt32 * cmpVal, const UInt32 * newVal, int size ); + + bool createMemoryDescriptor( void ); + void destroyMemoryDescriptor( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWCompareAndSwapCommand, 3); + +}; + +/* + * Send an async stream packet + */ + +#pragma mark - + +/*! @class IOFWAsyncStreamCommand +*/ +class IOFWAsyncStreamCommand : public IOFWCommand +{ + // temporary for debugging: + friend class IOFireWireUserClient ; + + OSDeclareDefaultStructors(IOFWAsyncStreamCommand) + +protected: + FWAsyncStreamCallback fComplete; + void * fRefCon; + IOMemoryDescriptor * fMemDesc; + int fSpeed; + int fSize; + int fCurRetries; + int fMaxRetries; + int fChannel; + int fSyncBits; + int fTag; + UInt32 fGeneration; // bus topology fNodeID is valid for. + bool fFailOnReset; + + typedef struct + { } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete( + IOReturn status); + + // To be called by IOFireWireController and derived classes. + virtual IOReturn execute(); + +public: + + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon); + + virtual void free( void ); + + virtual IOReturn reinit( UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon); + + virtual void gotAck( + int ackCode); + // Utility for setting generation on newly created command + virtual void setGeneration( + UInt32 generation) + { fGeneration = generation; } + + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + + bool failOnReset() const + { return fFailOnReset; } + +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncStreamCommand, 1); + +public: + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon, + bool failOnReset ); + + + virtual IOReturn reinit( + UInt32 generation, + UInt32 channel, + UInt32 sync, + UInt32 tag, + IOMemoryDescriptor * hostMem, + UInt32 size, + int speed, + FWAsyncStreamCallback completion, + void * refcon, + bool failOnReset); + + +}; + +/* + * Send an async PHY packet + */ + +#pragma mark - + +/*! @class IOFWAsyncPHYCommand +*/ +class IOFWAsyncPHYCommand : public IOFWCommand +{ + // temporary for debugging: + friend class IOFireWireUserClient; + + OSDeclareDefaultStructors( IOFWAsyncPHYCommand ) + +protected: + AsyncPendingTrans * fTrans; + FWAsyncPHYCallback fComplete; + void * fRefCon; + int fCurRetries; + int fMaxRetries; + UInt32 fGeneration; + bool fFailOnReset; + UInt32 fData1; + UInt32 fData2; + int fAckCode; + UInt32 fResponseCode; + + typedef struct + { } + MemberVariables; + + MemberVariables * fMembers; + + virtual IOReturn complete( + IOReturn status ); + + // To be called by IOFireWireController and derived classes. + virtual IOReturn execute(); + + void setResponseCode( UInt32 rcode ); + void setAckCode( int ack ); + +public: + + virtual bool initAll( + IOFireWireController * control, + UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + virtual void free( void ); + + virtual IOReturn reinit( UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + + virtual void gotAck( + int ackCode ); + + // Utility for setting generation on newly created command + virtual void setGeneration( + UInt32 generation ) + { fGeneration = generation; } + + + // update nodeID/generation after bus reset, from the device object + IOReturn updateGeneration(); + + bool failOnReset() const + { return fFailOnReset; } + + + virtual void gotPacket( int rcode ); + + int getAckCode( void ); + UInt32 getResponseCode( void ) const; + + void setRetries( int retries); +private: + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 0); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 1); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 2); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 3); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 4); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 5); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 6); + OSMetaClassDeclareReservedUnused(IOFWAsyncPHYCommand, 7); +}; + +#endif /* _IOKIT_IOFWCOMMAND_H */ diff --git a/i386/include/IOKit/firewire/IOFWDCL.h b/i386/include/IOKit/firewire/IOFWDCL.h new file mode 100644 index 0000000..8919485 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWDCL.h @@ -0,0 +1,346 @@ +/* +* IOFWDCL.h +* IOFireWireFamily +* +* Created by Niels on Fri Feb 21 2003. +* Copyright (c) 2003 Apple Computer, Inc. All rights reserved. +* +* $Log: IOFWDCL.h,v $ +* Revision 1.20 2008/11/14 00:17:11 arulchan +* fix for rdar://5939334 +* +* Revision 1.19 2007/03/14 01:01:12 collin +* *** empty log message *** +* +* Revision 1.18 2007/01/26 23:42:19 ayanowit +* another fix for nuDCL rosetta mode +* +* Revision 1.17 2006/08/16 01:41:41 collin +* *** empty log message *** +* +* Revision 1.16 2006/03/09 22:26:46 niels +* fix 4466075 +* +* Revision 1.15 2006/03/09 22:20:14 niels +* fix 4466075 +* +* Revision 1.14 2006/03/09 21:40:44 niels +* fix 4466075 +* +* Revision 1.13 2006/02/09 00:21:50 niels +* merge chardonnay branch to tot +* +* Revision 1.12.4.1 2005/08/06 01:31:31 collin +* *** empty log message *** +* +* Revision 1.12 2005/02/18 03:19:03 niels +* fix isight +* +* Revision 1.11 2004/04/19 21:51:49 niels +* *** empty log message *** +* +* Revision 1.10 2004/03/25 00:00:23 niels +* fix panic allocating large physical address spaces +* +* Revision 1.9 2003/10/31 02:40:58 niels +* *** empty log message *** +* +* Revision 1.8 2003/08/26 05:11:21 niels +* *** empty log message *** +* +* Revision 1.7 2003/08/25 08:39:15 niels +* *** empty log message *** +* +* Revision 1.6 2003/08/18 23:18:14 niels +* *** empty log message *** +* +* Revision 1.5 2003/08/08 22:30:32 niels +* *** empty log message *** +* +* Revision 1.4 2003/07/30 05:22:14 niels +* *** empty log message *** +* +* Revision 1.3 2003/07/29 22:49:22 niels +* *** empty log message *** +* +* Revision 1.2 2003/07/21 06:52:58 niels +* merge isoch to TOT +* +* Revision 1.1.2.5 2003/07/18 00:17:41 niels +* *** empty log message *** +* +* Revision 1.1.2.4 2003/07/14 22:08:53 niels +* *** empty log message *** +* +* Revision 1.1.2.3 2003/07/11 18:15:33 niels +* *** empty log message *** +* +* Revision 1.1.2.2 2003/07/03 22:10:24 niels +* fix iidc/dv rcv +* +* Revision 1.1.2.1 2003/07/01 20:54:06 niels +* isoch merge +* +*/ + +#import + +#import +#import +#import + +class IODCLProgram ; +class OSIterator ; +class IOFireWireLink ; +class IOMemoryMap ; + +/*! @class IOFWDCL +*/ + +class IOFWDCL : public OSObject +{ + OSDeclareAbstractStructors( IOFWDCL ) ; + + public: + + typedef void (*Callback)( void * refcon ) ; + + enum + { + kDynamic = BIT(1)//kNuDCLDynamic, + ,kUpdateBeforeCallback = BIT(2)//kNuDCLUpdateBeforeCallback + ,kUser = BIT(18) // kNuDCLUser + ,kBigEndianUpdates = BIT(19) // NOTE: Don't change this without making similar change to IOFireWireLib's NuDCL::Export(...)! + } ; + + class InternalData + { + public: + + IOFWDCL * lastBranch ; + } ; + + protected: + + IOFWDCL* fBranch ; + Callback fCallback ; + volatile UInt32 * fTimeStampPtr ; + UInt32 fRangeCount ; + IOVirtualRange * fRanges ; + OSSet* fUpdateList ; + OSIterator * fUpdateIterator ; + volatile UInt32 * fUserStatusPtr ; + void* fRefcon ; + UInt32 fFlags ; + + InternalData * fLoLevel ; + + public: + + // + // IOFWDCL public API: + // + + virtual bool initWithRanges ( + OSSet * updateSet, + unsigned rangesCount = 0, + IOVirtualRange ranges [] = NULL ) ; + + void setBranch( IOFWDCL* branch ) ; + IOFWDCL* getBranch() const ; + void setTimeStampPtr ( UInt32* timeStampPtr ) ; + UInt32* getTimeStampPtr () const ; + void setCallback( Callback callback ) ; + Callback getCallback() const ; + void setStatusPtr( UInt32* statusPtr ) ; + UInt32* getStatusPtr() const ; + void setRefcon( void * refcon ) ; + void * getRefcon() const ; + const OSSet* getUpdateList() const ; + + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + virtual UInt32 getRanges( UInt32 maxRanges, IOVirtualRange ranges[] ) const ; + virtual UInt32 countRanges() ; + virtual IOReturn getSpan( IOVirtualRange& result ) const ; + virtual IOByteCount getSize() const ; + IOReturn appendUpdateList( IOFWDCL* updateDCL ) ; + IOReturn setUpdateList( OSSet* updateList ) ; + void emptyUpdateList() ; + void setFlags( UInt32 flags ) ; + UInt32 getFlags() const ; + + + virtual void update() = 0 ; + + // OSObject + + virtual void free () ; + + public: + + // + // internal use only; please don't use... + // + + virtual IOReturn compile( IODCLProgram & , bool & ) = 0 ; + virtual void link () = 0 ; + + OSMetaClassDeclareReservedUnused ( IOFWDCL, 4 ) ; // used to be relink() + + public : + virtual bool interrupt( bool &, IOFWDCL * & ) = 0 ; + virtual void finalize ( IODCLProgram & ) ; + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + + protected : + + friend class IOFWDCLFriend ; + + public : + + // dump DCL info... + virtual void debug() ; + + public: + + // + // internal use only; please don't use... + // + + virtual bool checkForInterrupt() = 0 ; + + OSMetaClassDeclareReservedUsed ( IOFWDCL, 0 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 1 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 2 ) ; + OSMetaClassDeclareReservedUnused ( IOFWDCL, 3 ) ; +// OSMetaClassDeclareReservedUnused ( ***, 4 ) ; // used above + +} ; + +#pragma mark - + +/*! @class IOFWReceiveDCL +*/ + +class IOFWReceiveDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWReceiveDCL ) + + protected : + + UInt8 fHeaderBytes ; + bool fWait ; + + public: + + // me + virtual bool initWithParams( + OSSet * updateSet, + UInt8 headerBytes, + unsigned rangesCount, + IOVirtualRange ranges [] ) ; + IOReturn setWaitControl( bool wait ) ; + + public : + + // internal use only: + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + + protected : + + virtual void debug() ; + +} ; + +#pragma mark - + +/*! @class IOFWSendDCL +*/ + +class IOFWSendDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWSendDCL ) + + protected: + + UInt32 * fUserHeaderPtr ; // pointer to 2 quadlets containing isoch header for this packet + UInt32 * fUserHeaderMaskPtr ; // pointer to 2 quadlets; used to mask header quadlets + IOFWDCL * fSkipBranchDCL ; + Callback fSkipCallback ; + void * fSkipRefcon ; + UInt8 fSync ; + UInt8 fTag ; + + public: + + // OSObject + virtual void free() ; + + // IOFWDCL + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + + // me + virtual bool initWithParams( OSSet * updateSet, + unsigned rangesCount = 0, + IOVirtualRange ranges [] = NULL, + UInt8 sync = 0, + UInt8 tag = 0 ) ; + + void setUserHeaderPtr( UInt32* userHeaderPtr, UInt32 * maskPtr ) ; + UInt32 * getUserHeaderPtr() ; + UInt32 * getUserHeaderMask() ; + void setSkipBranch( IOFWDCL * skipBranchDCL ) ; + IOFWDCL * getSkipBranch() const ; + void setSkipCallback( Callback callback ) ; + Callback getSkipCallback() const ; + void setSkipRefcon( void * refcon = 0 ) ; + void * getSkipRefcon() const ; + void setSync( UInt8 sync ) ; + UInt8 getSync() const ; + void setTag( UInt8 tag ) ; + UInt8 getTag() const ; + + public : + + // internal use only: + virtual IOReturn importUserDCL ( + UInt8 * data, + IOByteCount & dataSize, + IOMemoryMap * bufferMap, + const OSArray * dcl ) ; + protected : + + virtual void debug() ; +} ; + +#pragma mark - + +/*! @class IOFWSkipCycleDCL +*/ + +class IOFWSkipCycleDCL : public IOFWDCL +{ + OSDeclareAbstractStructors( IOFWSkipCycleDCL ) + + public: + + virtual bool init() ; + + virtual IOReturn addRange ( IOVirtualRange& range ) ; + virtual IOReturn setRanges ( UInt32 numRanges, IOVirtualRange ranges[] ) ; + virtual IOReturn getSpan( IOVirtualRange& result ) ; + + protected : + + virtual void debug() ; +} ; diff --git a/i386/include/IOKit/firewire/IOFWDCLPool.h b/i386/include/IOKit/firewire/IOFWDCLPool.h new file mode 100644 index 0000000..005b62a --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWDCLPool.h @@ -0,0 +1,160 @@ +/* + * IOFWNuDCLPool.h + * IOFireWireFamily + * + * Created by Niels on Fri Mar 07 2003. + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * $Log: IOFWDCLPool.h,v $ + * Revision 1.15 2008/11/14 00:17:12 arulchan + * fix for rdar://5939334 + * + * Revision 1.14 2008/03/03 23:31:42 ayanowit + * another gcc-42 fix. + * + * Revision 1.13 2007/01/26 20:52:31 ayanowit + * changes to user-space isoch stuff to support 64-bit apps. + * + * Revision 1.12 2006/02/09 00:21:50 niels + * merge chardonnay branch to tot + * + * Revision 1.11 2005/04/12 20:09:13 niels + * fix memory leak importing NuDCL programs from user space + * + * Revision 1.10.20.2 2006/01/31 04:49:50 collin + * *** empty log message *** + * + * Revision 1.10 2003/11/07 21:24:28 niels + * *** empty log message *** + * + * Revision 1.9 2003/11/07 21:01:18 niels + * *** empty log message *** + * + * Revision 1.8 2003/08/25 08:39:15 niels + * *** empty log message *** + * + * Revision 1.7 2003/08/22 18:15:16 niels + * *** empty log message *** + * + * Revision 1.6 2003/08/15 04:36:55 niels + * *** empty log message *** + * + * Revision 1.5 2003/07/30 05:22:14 niels + * *** empty log message *** + * + * Revision 1.4 2003/07/21 08:48:20 niels + * *** empty log message *** + * + * Revision 1.3 2003/07/21 07:52:13 niels + * *** empty log message *** + * + * Revision 1.2 2003/07/21 06:52:58 niels + * merge isoch to TOT + * + * Revision 1.1.2.3 2003/07/11 18:15:34 niels + * *** empty log message *** + * + * Revision 1.1.2.2 2003/07/09 21:24:00 niels + * *** empty log message *** + * + * Revision 1.1.2.1 2003/07/01 20:54:06 niels + * isoch merge + * + */ + +#import +#import +#import + +class IOFireWireLink ; +class IOFWDCL ; +class IOFWReceiveDCL ; +class IOFWSendDCL ; +class IOFWSkipCycleDCL ; +class IOFireWireUserClient ; +class IOMemoryDescriptor ; +class IOMemoryMap ; +class OSSet; + +/*! @class IOFWDCLPool + @discussion You should never subclass IOFWDCLPool +*/ + +class IOFWDCLPool : public OSObject +{ + OSDeclareAbstractStructors( IOFWDCLPool ) + + friend class IOFireWireUserClient ; + friend class IOFWUserLocalIsochPort ; + + protected: + + class Expansion* fReserved ; // for class expansion + + IOFireWireLink * fLink ; + UInt8 fCurrentTag ; + UInt8 fCurrentSync ; + OSArray* fProgram ; + DCLNuDCLLeader fLeader ; + + public: + + // OSObject + + virtual void free() ; + + // me + + virtual bool initWithLink ( IOFireWireLink& link, UInt32 capacity ) ; + + virtual void setCurrentTagAndSync ( UInt8 tag, UInt8 sync ) ; + + virtual IOFWReceiveDCL* appendReceiveDCL ( + OSSet * updateSet, + UInt8 headerBytes, + UInt32 rangesCount, + IOVirtualRange ranges[] ) ; + virtual IOFWSendDCL* appendSendDCL ( + OSSet * updateSet, + UInt32 rangesCount, + IOVirtualRange ranges[] ) ; + virtual IOFWSkipCycleDCL* appendSkipCycleDCL () ; + virtual const OSArray * getProgramRef () const ; + + protected : + + IOReturn importUserProgram ( + IOMemoryDescriptor * userExportDesc, + unsigned bufferRangeCount, + IOAddressRange bufferRanges[], + IOMemoryMap * bufferMap ) ; + IOReturn importUserDCL( + IOFWDCL * dcl, + void * importData, + IOByteCount & dataSize, + IOMemoryMap * bufferMap ) ; + + + protected : + + virtual IOFWReceiveDCL * allocReceiveDCL () = 0 ; + virtual IOFWSendDCL * allocSendDCL () = 0 ; + virtual IOFWSkipCycleDCL * allocSkipCycleDCL () = 0 ; + + private : + + void appendDCL( IOFWDCL * dcl ) ; + + public : + + DCLCommand * getProgram() ; + + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 0); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 1); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 2); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 3); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 4); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 5); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 6); + OSMetaClassDeclareReservedUnused ( IOFWDCLPool, 7); +} ; diff --git a/i386/include/IOKit/firewire/IOFWDCLProgram.h b/i386/include/IOKit/firewire/IOFWDCLProgram.h new file mode 100644 index 0000000..cf91f06 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWDCLProgram.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWDCLPROGRAM_H +#define _IOKIT_IOFWDCLPROGRAM_H + +#include +#include +#include +#include + +/*! @class IODCLProgram +*/ +class IODCLProgram : public OSObject +{ + OSDeclareAbstractStructors(IODCLProgram) + + private : + + void * reserved0 ;//fDCLTaskToKernel; + void * reserved1 ;//fDataTaskToKernel; + void * reserved2 ;//fDataBase; + void * reserved3 ;// IOMemoryDescriptor * fDCLDesc; + IOMemoryMap * fBufferMem ; + void * reserved5 ;// IOMemoryCursor * fDataCursor; + + protected: + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData + { + IOFWIsochResourceFlags resourceFlags ; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * fExpansionData ; + + public : + + virtual void setIsochResourceFlags ( IOFWIsochResourceFlags flags ) ; // formerly getPhysicalSegs() + IOFWIsochResourceFlags getIsochResourceFlags () const ; + + protected: + + virtual void free () ; + + public: + + virtual bool init ( IOFireWireBus::DCLTaskInfo * info = NULL ) ; + virtual IOReturn allocateHW ( + IOFWSpeed speed, + UInt32 chan) = 0; + virtual IOReturn releaseHW () = 0; + virtual IOReturn compile ( + IOFWSpeed speed, + UInt32 chan) = 0; + virtual IOReturn notify ( + IOFWDCLNotificationType notificationType, + DCLCommand ** dclCommandList, + UInt32 numDCLCommands ) = 0; + virtual IOReturn start () = 0; + virtual void stop () = 0; + virtual IOReturn pause (); + virtual IOReturn resume (); + + virtual void setForceStopProc( + IOFWIsochChannel::ForceStopNotificationProc proc, + void * refCon, + IOFWIsochChannel * channel ) ; + protected : + + void generateBufferMap( DCLCommand * program ) ; + IOReturn virtualToPhysical( + IOVirtualRange ranges[], + unsigned rangeCount, + IOMemoryCursor::IOPhysicalSegment outSegments[], + unsigned & outPhysicalSegmentCount, + unsigned maxSegments ) ; + + public : + + IOMemoryMap * getBufferMap() const ; + + public : + + // close/open isoch workloop gate... + // clients should not need to call these. + virtual void closeGate() = 0 ; + virtual void openGate() = 0 ; + + virtual IOReturn synchronizeWithIO() = 0 ; + + private: + + OSMetaClassDeclareReservedUsed(IODCLProgram, 0); + OSMetaClassDeclareReservedUsed(IODCLProgram, 1); + OSMetaClassDeclareReservedUnused(IODCLProgram, 2); + OSMetaClassDeclareReservedUnused(IODCLProgram, 3); + OSMetaClassDeclareReservedUnused(IODCLProgram, 4); + +}; + +#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */ + diff --git a/i386/include/IOKit/firewire/IOFWDCLTranslator.h b/i386/include/IOKit/firewire/IOFWDCLTranslator.h new file mode 100644 index 0000000..e02067c --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWDCLTranslator.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * A DCL program to interpret (in software) a program that's too complicated + * for the DMA engine. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWDCLTRANSLATOR_H +#define _IOKIT_IOFWDCLTRANSLATOR_H + +#include +#include + + +/*! @class IODCLTranslator +*/ + +class IODCLTranslator : public IODCLProgram +{ + OSDeclareAbstractStructors(IODCLTranslator) + +protected: + enum + { + kNumPingPongs = 2, + kNumPacketsPerPingPong = 500, + kMaxIsochPacketSize = 1000, + kPingPongBufferSize = kNumPingPongs * kNumPacketsPerPingPong * kMaxIsochPacketSize + }; + + // Opcodes and buffer for pingpong program + DCLLabel fStartLabel; + DCLTransferPacket fTransfers[kNumPingPongs*kNumPacketsPerPingPong]; + DCLCallProc fCalls[kNumPingPongs]; + DCLJump fJumpToStart; + UInt8 fBuffer[kPingPongBufferSize]; + + IODCLProgram * fHWProgram; // Hardware program executing our opcodes + DCLCommand* fToInterpret; // The commands to interpret + DCLCommand* fCurrentDCLCommand; // Current command to interpret + int fPingCount; // Are we pinging or ponging? + UInt32 fPacketHeader; + + static void ListeningDCLPingPongProc(DCLCommand* pDCLCommand); + static void TalkingDCLPingPongProc(DCLCommand* pDCLCommand); + +public: + virtual bool init(DCLCommand* toInterpret); + virtual IOReturn allocateHW(IOFWSpeed speed, UInt32 chan); + virtual IOReturn releaseHW(); + virtual IOReturn notify(IOFWDCLNotificationType notificationType, + DCLCommand** dclCommandList, UInt32 numDCLCommands); + virtual void stop(); + + DCLCommand* getTranslatorOpcodes(); + void setHWProgram(IODCLProgram *program); +}; + +/*! @class IODCLTranslateTalk +*/ + +class IODCLTranslateTalk : public IODCLTranslator +{ + OSDeclareDefaultStructors(IODCLTranslateTalk) + +protected: + +public: + virtual IOReturn compile(IOFWSpeed speed, UInt32 chan); + virtual IOReturn start(); + +}; + +/*! @class IODCLTranslateListen +*/ + +class IODCLTranslateListen : public IODCLTranslator +{ + OSDeclareDefaultStructors(IODCLTranslateListen) + +protected: + +public: + virtual IOReturn compile(IOFWSpeed speed, UInt32 chan); + virtual IOReturn start(); + +}; +#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */ + diff --git a/i386/include/IOKit/firewire/IOFWIsochChannel.h b/i386/include/IOKit/firewire/IOFWIsochChannel.h new file mode 100644 index 0000000..4bbd6c8 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWIsochChannel.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWISOCHCHANNEL_H +#define _IOKIT_IOFWISOCHCHANNEL_H + +#include +#include + +enum +{ + kFWIsochChannelUnknownCondition = 0, + kFWIsochChannelNotEnoughBandwidth = 1, + kFWIsochChannelChannelNotAvailable = 2 +}; + +class IOFireWireController; +class IOFWIsochChannel; +class IOFWIsochPort; +class OSSet; +class IOFWReadQuadCommand; +class IOFWCompareAndSwapCommand; + +/*! @class IOFWIsochChannel +*/ +class IOFWIsochChannel : public OSObject +{ + OSDeclareDefaultStructors(IOFWIsochChannel) + + public: + + typedef IOReturn (ForceStopNotificationProc)(void* refCon, IOFWIsochChannel* channel, UInt32 stopCondition ); + +protected: + IOFireWireController * fControl; + ForceStopNotificationProc* fStopProc; + void * fStopRefCon; + IOFWIsochPort * fTalker; + OSSet * fListeners; + bool fDoIRM; + UInt32 fBandwidth; // Allocation units used + UInt32 fPacketSize; + IOFWSpeed fPrefSpeed; + IOFWSpeed fSpeed; // Actual speed used + UInt32 fChannel; // Actual channel used + IOFWReadQuadCommand * fReadCmd; + IOFWCompareAndSwapCommand * fLockCmd; + UInt32 fGeneration; // When bandwidth was allocated + + IOLock * fLock; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void threadFunc( void * arg ); + + virtual IOReturn updateBandwidth(bool claim); + virtual void reallocBandwidth( UInt32 generation ); + virtual void free(); + +public: + // Called from IOFireWireController + virtual bool init( IOFireWireController *control, bool doIRM, UInt32 packetSize, + IOFWSpeed prefSpeed, ForceStopNotificationProc* stopProc, + void *stopRefCon ); + virtual void handleBusReset(); + + // Called by clients + virtual IOReturn setTalker(IOFWIsochPort *talker); + virtual IOReturn addListener(IOFWIsochPort *listener); + + virtual IOReturn allocateChannel(); + virtual IOReturn releaseChannel(); + virtual IOReturn start(); + virtual IOReturn stop(); + +protected: + // handles IRM and channel determination and allocation. + // called by both user and kernel isoch channels + IOReturn allocateChannelBegin( IOFWSpeed speed, UInt64 allowedChans, UInt32 * channel = NULL ) ; + + // handles IRM and channel allocation. + // called by both user and kernel isoch channels + IOReturn releaseChannelComplete() ; + + IOReturn checkMemoryInRange( IOMemoryDescriptor * memory ); + +private: + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 0); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 1); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 2); + OSMetaClassDeclareReservedUnused(IOFWIsochChannel, 3); + +}; + +typedef IOFWIsochChannel::ForceStopNotificationProc FWIsochChannelForceStopNotificationProc ; +typedef IOFWIsochChannel::ForceStopNotificationProc* FWIsochChannelForceStopNotificationProcPtr ; + +#endif /* ! _IOKIT_IOFWISOCHCHANNEL_H */ + diff --git a/i386/include/IOKit/firewire/IOFWIsochPort.h b/i386/include/IOKit/firewire/IOFWIsochPort.h new file mode 100644 index 0000000..793c5e9 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWIsochPort.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * IOFWIsochPort is an abstract object that represents hardware on the bus + * (locally or remotely) that sends or receives isochronous packets. + * Local ports are implemented by the local device driver, + * Remote ports are implemented by the driver for the remote device. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFWISOCHPORT_H +#define _IOKIT_IOFWISOCHPORT_H + +#include +#include + +/*! @class IOFWIsochPort +*/ + +class IOFWIsochPort : public OSObject +{ + OSDeclareAbstractStructors(IOFWIsochPort) + +public: + // Return maximum speed and channels supported + // (bit n set = chan n supported) + virtual IOReturn getSupported(IOFWSpeed &maxSpeed, UInt64 &chanSupported) = 0; + + // Allocate hardware resources for port + virtual IOReturn allocatePort(IOFWSpeed speed, UInt32 chan) = 0; + virtual IOReturn releasePort() = 0; // Free hardware resources + virtual IOReturn start() = 0; // Start port processing packets + virtual IOReturn stop() = 0; // Stop processing packets + +private: + OSMetaClassDeclareReservedUnused(IOFWIsochPort, 0); + OSMetaClassDeclareReservedUnused(IOFWIsochPort, 1); + +}; + +#endif /* ! _IOKIT_IOFWISOCHPORT_H */ + diff --git a/i386/include/IOKit/firewire/IOFWLocalIsochPort.h b/i386/include/IOKit/firewire/IOFWLocalIsochPort.h new file mode 100644 index 0000000..493f719 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWLocalIsochPort.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * IOFWIsochPort is an abstract object that represents hardware on the bus + * (locally or remotely) that sends or receives isochronous packets. + * Local ports are implemented by the local device driver, + * Remote ports are implemented by the driver for the remote device. + * + * HISTORY + * + * $Log: IOFWLocalIsochPort.h,v $ + * Revision 1.10 2004/06/10 20:57:36 niels + * *** empty log message *** + * + * Revision 1.9 2003/08/30 00:16:44 collin + * *** empty log message *** + * + * Revision 1.8 2003/08/15 04:36:55 niels + * *** empty log message *** + * + * Revision 1.7 2003/07/29 22:49:22 niels + * *** empty log message *** + * + * Revision 1.6 2003/07/21 06:52:58 niels + * merge isoch to TOT + * + * Revision 1.5.14.1 2003/07/01 20:54:07 niels + * isoch merge + * + */ + + +#ifndef _IOKIT_IOFWLOCALISOCHPORT_H +#define _IOKIT_IOFWLOCALISOCHPORT_H + +#import +#import + +class IOFireWireController; +class IODCLProgram; + +/*! @class IOFWLocalIsochPort +*/ +class IOFWLocalIsochPort : public IOFWIsochPort +{ + OSDeclareDefaultStructors(IOFWLocalIsochPort) + + protected: + + IOFireWireController * fControl; + IODCLProgram * fProgram; + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData + { + } ; + + ExpansionData * fExpansion ; + + protected : + + virtual void free ( void ) ; + + public: + + virtual bool init ( + IODCLProgram * program, + IOFireWireController * control ) ; + + // Return maximum speed and channels supported + // (bit n set = chan n supported) + virtual IOReturn getSupported ( + IOFWSpeed & maxSpeed, + UInt64 & chanSupported ) ; + + // Allocate hardware resources for port + virtual IOReturn allocatePort ( + IOFWSpeed speed, + UInt32 chan ) ; + virtual IOReturn releasePort ( void ) ; // Free hardware resources + virtual IOReturn start ( void ) ; // Start port processing packets + virtual IOReturn stop ( void ) ; // Stop processing packets + + /*! @function notify + @abstract Informs hardware of a change to the DCL program. + @param notificationType Type of change. + @param dclCommandList List of DCL commands that have been changed. + @param numDCLCommands Number of commands in list. + @result IOKit error code. */ + virtual IOReturn notify( + IOFWDCLNotificationType notificationType, + DCLCommand ** dclCommandList, + UInt32 numDCLCommands ) ; + static void printDCLProgram ( + const DCLCommand * dcl, + UInt32 count = 0, + void (*printFN)( const char *format, ...) = NULL, + unsigned lineDelayMS = 0 ) ; + IOReturn setIsochResourceFlags ( + IOFWIsochResourceFlags flags ) ; + IODCLProgram * getProgramRef() const ; + + IOReturn synchronizeWithIO() ; + + private: + + OSMetaClassDeclareReservedUnused ( IOFWLocalIsochPort, 0 ) ; + OSMetaClassDeclareReservedUnused ( IOFWLocalIsochPort, 1 ) ; +}; + +#endif /* ! _IOKIT_IOFWLOCALISOCHPORT_H */ + diff --git a/i386/include/IOKit/firewire/IOFWPHYPacketListener.h b/i386/include/IOKit/firewire/IOFWPHYPacketListener.h new file mode 100644 index 0000000..ea2c6ff --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWPHYPacketListener.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWPHYPACKETLISTENER_H_ +#define _IOFWPHYPACKETLISTENER_H_ + +#include + +class IOFireWireController; + +// Callback when phy packet is received +typedef void (*FWPHYPacketCallback)( void *refcon, UInt32 data1, UInt32 data2 ); + +/*! @class IOFWPHYPacketListener +*/ + +class IOFWPHYPacketListener : public OSObject +{ + OSDeclareDefaultStructors( IOFWPHYPacketListener ); + + friend class IOFireWireController; + +protected: + + IOFireWireController * fControl; + FWPHYPacketCallback fCallback; + void * fRefCon; + + static IOFWPHYPacketListener * createWithController( IOFireWireController * controller ); + + virtual bool initWithController( IOFireWireController * control ); + virtual void free( void ); + +public: + + virtual IOReturn activate( void ); + virtual void deactivate( void ); + + virtual void setCallback( FWPHYPacketCallback callback ); + virtual void setRefCon( void * refcon ); + virtual void * getRefCon( void ); + +protected: + virtual void processPHYPacket( UInt32 data1, UInt32 data2 ); + + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 0 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 1 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 2 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 3 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 4 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 5 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 6 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 7 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 8 ); + OSMetaClassDeclareReservedUnused( IOFWPHYPacketListener, 9 ); +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/firewire/IOFWPhysicalAddressSpace.h b/i386/include/IOKit/firewire/IOFWPhysicalAddressSpace.h new file mode 100644 index 0000000..b1944f4 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWPhysicalAddressSpace.h @@ -0,0 +1,263 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFWPHYSICALADDRESSSPACE_H +#define _IOKIT_IOFWPHYSICALADDRESSSPACE_H + +#include +#include + +/* + * Direct physical memory <-> FireWire address. + * Accesses to these addresses may be handled automatically by the + * hardware without notification. + * + * The 64 bit FireWire address of (32 bit) physical addr xxxx:xxxx is hostNode:0000:xxxx:xxxx + */ + +class IOFWPhysicalAddressSpace; + +struct FWSegment +{ + FWAddress address; + UInt32 length; +}; + +#pragma mark - + +/*! + @class IOFWPhysicalAddressSpaceAux +*/ + +class IOFWPhysicalAddressSpaceAux : public IOFWAddressSpaceAux +{ + OSDeclareDefaultStructors(IOFWPhysicalAddressSpaceAux) + + friend class IOFWAddressSpace; + friend class IOFWPhysicalAddressSpace; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData *reserved; + + IODMACommand * fDMACommand; + bool fDMACommandPrepared; + +public: + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + + void setDMACommand( IODMACommand * dma_command ); + IODMACommand * getDMACommand( void ); + UInt64 getPhysicalSegment( UInt64 offset, UInt64 * length ); + + IOReturn prepare( void ); + IOReturn synchronize( IOOptionBits options ); + IOReturn complete( void ); + + bool isPrepared( void ); + + IOReturn getSegments( UInt64 * offset, FWSegment * fw_segments, UInt32 * num_segments ); + +private: + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 0); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWPhysicalAddressSpaceAux, 9); + +}; + +#pragma mark - + +/*! + @class IOFWPhysicalAddressSpace +*/ + +class IOFWPhysicalAddressSpace : public IOFWAddressSpace +{ + OSDeclareDefaultStructors(IOFWPhysicalAddressSpace) + + friend class IOFWPhysicalAddressSpaceAux; + +protected: + + IOMemoryDescriptor * fMem; // unused + vm_size_t fLen; // unused + + virtual void free(); + +public: + +/*! @function init + @abstract Initialize physical address space. + @param bus Points to IOFireWireBus object. + @result returns true if success, else false */ + virtual bool init( IOFireWireBus * bus ); + +/*! @function initWithDesc + @abstract Initialize physical address space with IOMemoryDescriptor. + @param bus Points to IOFireWireBus object. + @param mem Points to IOMemoryDescriptor. + @result returns true if success, else false */ + virtual bool initWithDesc(IOFireWireBus *bus, + IOMemoryDescriptor *mem); + +/*! @function doRead + @abstract A method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param refcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, + IOFWRequestRefCon refcon); + +/*! @function doWrite + @abstract A method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + +/*! @function getMemoryDescriptor + @abstract Gets the memory descriptor, which is associated to this + PhysicalAddressSpace. + @param none. + @result returns the IOMemoryDescriptor */ + IOMemoryDescriptor * getMemoryDescriptor( void ); + +/*! @function setMemoryDescriptor + @abstract Sets the memory descriptor, which will be associated to this + PhysicalAddressSpace. + @param none. + @result returns the IOMemoryDescriptor */ + IOReturn setMemoryDescriptor( IOMemoryDescriptor * descriptor ); + +/*! @function getLength + @abstract Get the length of the memory backed by PhysicalAddressSpace. + @param none. + @result returns the length */ + UInt64 getLength( void ); + +/*! @function setDMACommand + @abstract Set the DMACommand for this PhysicalAddressSpace. + @param dma_command Points to IODMACommand object. + @result none */ + inline void setDMACommand( IODMACommand * dma_command ) + { ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->setDMACommand( dma_command ); }; + +/*! @function getDMACommand + @abstract Get the DMACommand from this PhysicalAddressSpace. + @param none. + @result return previously assigned IODMACommand, null if not initialized */ + inline IODMACommand * getDMACommand( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getDMACommand(); }; + +/*! @function initWithDMACommand + @abstract Initialize physical address space with IODMACommand. + @param bus Points to IOFireWireBus object. + @param command Points to IODMACommand. + @result returns true if success, else false */ + virtual bool initWithDMACommand( IOFireWireBus * control, IODMACommand * command ); + +/*! @function prepare + @abstract Prepare the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn prepare( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->prepare(); }; + +/*! @function synchronize + @abstract synchronize the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn synchronize( IOOptionBits options ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->synchronize( options ); }; + +/*! @function complete + @abstract complete the IODMACommand used by this PhysicalAddressSpace. + @param none. + @result returns kIOReturnSuccess on success */ + inline IOReturn complete( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->complete(); }; + +/*! @function isPrepared + @abstract Inspects whether the IODMACommand was prepared in this PhysicalAddressSpace. + @param none. + @result returns true if prepared, else false */ + inline bool isPrepared( void ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->isPrepared(); }; + +/*! @function getSegments + @abstract Returns the scatter gather list of memory segments from the IODMACommand + used in this PhysicalAddressSpace. + @param offset input/output parameter, defines the starting and ending offset in the memory + descriptor, relative to any offset passed to the prepare() method. + FWSegment Points to an array of memory segments. + num_segments Size of the FWSegment array. + @result returns kIOReturnSuccess on success */ + inline IOReturn getSegments( UInt64 * offset, FWSegment * fw_segments, UInt32 * num_segments ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getSegments( offset, fw_segments, num_segments ); }; + +/*! @function checkMemoryInRange + @abstract Validates the IOMemoryDescriptor, which is used to initialize the PhysicalAddressSpace. + @param memory Points to a valid IOMemoryDescriptor. + @result returns kIOReturnSuccess on success */ + IOReturn checkMemoryInRange( IOMemoryDescriptor * memory ); + +protected: + + UInt64 getPhysicalSegment( UInt64 offset, UInt64 * length ) + { return ((IOFWPhysicalAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->getPhysicalSegment( offset, length); }; + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/IOFWPseudoAddressSpace.h b/i386/include/IOKit/firewire/IOFWPseudoAddressSpace.h new file mode 100644 index 0000000..02c2c30 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWPseudoAddressSpace.h @@ -0,0 +1,370 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFWPSEUDOADDRESSSPACE_H +#define _IOKIT_IOFWPSEUDOADDRESSSPACE_H + +#include + +/* + * If installed, this callback is invoked for drivers which + * would like to coalesce incoming writes and do batch processing + * of incoming block write packets. + * This callback can be installed by calling setARxReqIntCompleteHandler + * method in IOFWPseudoAddressSpace object. + */ +typedef void (*IOFWARxReqIntCompleteHandler)( void * refcon ); + +/* + * Pseudo firewire addresses usually represent emulated registers of some kind. + * Accesses to these addresses will result in the owner being notified. + * + * Virtual addresses should not have zero as the top 16 bits of the 48 bit local address, + * since that may look like a physical address to hardware (eg. OHCI). + * if reader is NULL then reads will not be allowed. + * if writer is NULL then writes will not be allowed. + * if either is NULL then lock requests will not be allowed. + * refcon is passed back as the first argument of read and write callbacks. + */ + +class IOFWPseudoAddressSpace; + +#pragma mark - + +/*! + @class IOFWPseudoAddressSpaceAux +*/ + +class IOFWPseudoAddressSpaceAux : public IOFWAddressSpaceAux +{ + OSDeclareDefaultStructors(IOFWPseudoAddressSpaceAux) + + friend class IOFWAddressSpace; + friend class IOFWPseudoAddressSpace; + friend class IOFireWireController; + +protected: + + struct MemberVariables + { + IOFWARxReqIntCompleteHandler fARxReqIntCompleteHandler; + void * fARxReqIntCompleteHandlerRefcon; + }; + + MemberVariables * fMembers; + +public: + + virtual bool init( IOFWAddressSpace * primary ); + virtual void free(); + +protected: + + bool createMemberVariables( void ); + void destroyMemberVariables( void ); + + virtual void handleARxReqIntComplete(); + +public: + +/*! @function setARxReqIntCompleteHandler + @abstract Installs a callback to receive notification, when FWIM has completed + ARxReqInt processing and no incoming packets are left in the queue. + @param refcon Client's callback object. + @param handler Client callback to be invoked, at the end of interrupt processing. + @result none. */ + virtual void setARxReqIntCompleteHandler( void * refcon, IOFWARxReqIntCompleteHandler handler ); + + virtual bool intersects( IOFWAddressSpace * space ); + +private: + + OSMetaClassDeclareReservedUsed(IOFWPseudoAddressSpaceAux, 0); + OSMetaClassDeclareReservedUsed(IOFWPseudoAddressSpaceAux, 1); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 2); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 3); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 4); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 5); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 6); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 7); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 8); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpaceAux, 9); + +}; + +/*! + @class IOFWPseudoAddressSpace +*/ + +class IOFWPseudoAddressSpace : public IOFWAddressSpace +{ + OSDeclareDefaultStructors(IOFWPseudoAddressSpace) + + friend class IOFWPseudoAddressSpaceAux; + friend class IOFireWireController; + +protected: + + IOMemoryDescriptor* fDesc; + void * fRefCon; + FWReadCallback fReader; + FWWriteCallback fWriter; + FWAddress fBase; + UInt32 fLen; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static OSData * allocatedAddresses; // unused + + virtual void free(); + +public: + +/*! @function simpleReader + @abstract A method for processing an address space read request + @param refcon Client's callback object. + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + static UInt32 simpleReader( + void* refcon, + UInt16 nodeID, + IOFWSpeed & speed, + FWAddress addr, + UInt32 len, + IOMemoryDescriptor** buf, + IOByteCount* offset, + IOFWRequestRefCon reqrefcon); + +/*! @function simpleWriter + @abstract A method for processing an address space write request + @param refcon Client's callback object. + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + static UInt32 simpleWriter( + void* refcon, + UInt16 nodeID, + IOFWSpeed& speed, + FWAddress addr, + UInt32 len, + const void* buf, + IOFWRequestRefCon reqrefcon); +protected: + + // Get a unique address range + IOReturn allocateAddress( + FWAddress* addr, + UInt32 len); + // free address + void freeAddress( + FWAddress addr, + UInt32 len); + +public: + + static IOFWPseudoAddressSpace* readWrite( + FWAddress addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function simpleRead + @abstract Create an address space object to handle read-only memory (eg. the local ROM) + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRead( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + const void* data); + +/*! @function simpleReadFixed + @abstract Create an address space object to handle fixed read-only memory (eg. the local ROM) + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleReadFixed( + IOFireWireBus* bus, + FWAddress addr, + UInt32 len, + const void* data); + +/*! @function simpleRW + @abstract Create an address space object to handle r/w memory + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRW( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + void * data); + +/*! @function simpleRW + @abstract Create an address space object to handle r/w memory + handles everything itself + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace* simpleRW( + IOFireWireBus* bus, + FWAddress* addr, + IOMemoryDescriptor * data); + +/*! @function initAll + @abstract Initialize an address space object to handle r/w memory + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the Pseudo Address Space. + @param reader Callback handler for incoming Read. + @param writer Callback handler for incoming Write. + @param refcon Client's callback object. + @result returns true on success, false on failure */ + virtual bool initAll( + IOFireWireBus* bus, + FWAddress* addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function initFixed + @abstract Initialize a fixed address space at top of kCSRRegisterSpaceBaseAddressHi + @param bus Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param reader Callback handler for incoming Read. + @param writer Callback handler for incoming Write. + @param refcon Client's callback object. + @result returns true on success, false on failure */ + virtual bool initFixed( + IOFireWireBus* bus, + FWAddress addr, + UInt32 len, + FWReadCallback reader, + FWWriteCallback writer, + void* refcon); + +/*! @function doRead + @abstract A method for processing an address space read request + @param nodeID FireWire Read from nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len read 'len' bytes from nodeID. + @param buf points to a memory descriptor containing the packet data. + @param offset start from this 'offset' in 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doRead( + UInt16 nodeID, + IOFWSpeed & speed, + FWAddress addr, + UInt32 len, + IOMemoryDescriptor ** buf, + IOByteCount * offset, + IOFWRequestRefCon reqrefcon); +/*! @function doWrite + @abstract A method for processing an address space write request + @param nodeID FireWire Write to nodeID. + @param speed at this 'speed'. + @param addr with FireWire address 'addr'. + @param len write 'len' bytes to nodeID. + @param buf obtain bytes from location given by 'buf'. + @param reqrefcon Can be queried for extra info about the request. + @result UIn32 returns kFWResponseComplete on success */ + virtual UInt32 doWrite( + UInt16 nodeID, + IOFWSpeed& speed, + FWAddress addr, + UInt32 len, + const void* buf, + IOFWRequestRefCon reqrefcon); + +/*! @function contains + @abstract returns number of bytes starting at addr in this space + @result 0 if it doesn't contain the address + */ + virtual UInt32 contains(FWAddress addr); + +/*! @function simpleRWFixed + @abstract Create a Read/Write fixed address space at top of kCSRRegisterSpaceBaseAddressHi. + @param control Points to IOFireWireBus object. + @param addr Points to starting address for the Pseudo Address Space. + @param len Length of the address range. + @param data The virtual address of the first byte in the memory. + @result returns valid IOFWPseudoAddressSpace on success, null on failure */ + static IOFWPseudoAddressSpace * simpleRWFixed( IOFireWireBus *control, FWAddress addr, UInt32 len, const void *data ); + +protected: + + virtual IOFWAddressSpaceAux * createAuxiliary( void ); + +protected: + inline void handleARxReqIntComplete( void ) + { ((IOFWPseudoAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->handleARxReqIntComplete(); } + +public: +/*! @function setARxReqIntCompleteHandler + @abstract Installs a callback to receive notification, when FWIM has completed + ARxReqInt processing and no incoming packets are left in the queue. + @param refcon Client's callback object. + @param handler Client callback to be invoked, at the end of interrupt processing. + @result none. */ + inline void setARxReqIntCompleteHandler( void * refcon, IOFWARxReqIntCompleteHandler handler ) + { ((IOFWPseudoAddressSpaceAux*)fIOFWAddressSpaceExpansion->fAuxiliary)->setARxReqIntCompleteHandler( refcon, handler ); } + +private: + + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWPseudoAddressSpace, 1); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/IOFWRegs.h b/i386/include/IOKit/firewire/IOFWRegs.h new file mode 100644 index 0000000..97c7078 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWRegs.h @@ -0,0 +1,73 @@ +/* +* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.1 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +* License for the specific language governing rights and limitations +* under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ +/* + File: IOFWRegs.h + + Copyright: 1996-1999 by Apple Computer, Inc., all rights reserved. + +*/ + +#ifndef __IOFWREGS_H__ +#define __IOFWREGS_H__ + +#include + +#ifndef NEW_ERROR_CODES + +// +// (!) The following error codes are obsolete... +// Please use the error codes defined in IOFireWireFamilyCommon.h +// + +enum { + inUseErr = -4160, // Item already in use + notFoundErr = -4161, // Item not found + timeoutErr = -4162, // Something timed out + busReconfiguredErr = -4163, // Bus was reconfigured + invalidIDTypeErr = -4166, // Given ID is of an invalid type for the requested operation. + alreadyRegisteredErr = -4168, // Item has already been registered. + disconnectedErr = -4169, // Target of request has been disconnected. + retryExceededErr = -4170, // Retry limit was exceeded. + addressRangeErr = -4171, // Address is not in range. + addressAlignmentErr = -4172, // Address is not of proper alignment. + + multipleTalkerErr = -4180, // Tried to install multiple talkers + channelActiveErr = -4181, // Operation not permitted when channel is active + noListenerOrTalkerErr = -4182, // Every isochronous channel must have one talker and at least + // one listener + noChannelsAvailableErr = -4183, // No supported isochronous channels are available + channelNotAvailableErr = -4184, // Required channel was not available. + invalidIsochPortIDErr = -4185, // An isochronous port ID is invalid. + invalidFWReferenceTypeErr = -4186, // Operation does not support type of given reference ID + separateBusErr = -4187, // Two or more entities are on two or more busses and cannot be associated with eachother. + badSelfIDsErr = -4188, // Received self IDs are bad. + +//zzz Do we own these next ID numbers? + cableVoltageTooLowErr = -4190, // Cable power below device's minimum voltage + cablePowerInsufficientErr = -4191 // Can't grant power request at this time +}; + + +#endif //NEW_ERROR_CODES + +#endif /* __IOFWREGS_H */ + diff --git a/i386/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h b/i386/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h new file mode 100644 index 0000000..606a9b2 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSIMPLECONTIGUOUSPHYSICALADDRESSSPACE_H_ +#define _IOFWSIMPLECONTIGUOUSPHYSICALADDRESSSPACE_H_ + +#include + +/*! @class IOFWSimpleContiguousPhysicalAddressSpace +*/ + +class IOFWSimpleContiguousPhysicalAddressSpace : public IOFWSimplePhysicalAddressSpace +{ + OSDeclareDefaultStructors( IOFWSimpleContiguousPhysicalAddressSpace ) + +private: + + void * fSimpleContigPhysSpaceMembers; + + IOReturn cachePhysicalAddress( void ); + +protected: + virtual bool createMemberVariables( void ); + virtual void destroyMemberVariables( void ); + +public: + + virtual bool init( IOFireWireBus * control, vm_size_t size, IODirection direction ); + virtual void free( void ); + + FWAddress getFWAddress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 1); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 2); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 3); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 4); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 5); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 6); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 7); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 8); + OSMetaClassDeclareReservedUnused(IOFWSimpleContiguousPhysicalAddressSpace, 9); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h b/i386/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h new file mode 100644 index 0000000..83a76a4 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWSimplePhysicalAddressSpace.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSIMPLEPHYSICALADDRESSSPACE_H_ +#define _IOFWSIMPLEPHYSICALADDRESSSPACE_H_ + +#include +#include +#include +#include + +/*! @class IOFWSimplePhysicalAddressSpace +*/ + +class IOFWSimplePhysicalAddressSpace : public IOFWPhysicalAddressSpace +{ + OSDeclareDefaultStructors( IOFWSimplePhysicalAddressSpace ) + +private: + + void * fSimplePhysSpaceMembers; + + IOReturn allocateMemory( void ); + void deallocateMemory( void ); + +protected: + virtual bool createMemberVariables( void ); + virtual void destroyMemberVariables( void ); + +public: + + virtual bool init( IOFireWireBus * control, vm_size_t size, IODirection direction, bool contiguous = false ); + virtual void free( void ); + + IOVirtualAddress getVirtualAddress( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 0); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 1); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 2); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 3); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 4); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 5); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 6); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 7); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 8); + OSMetaClassDeclareReservedUnused(IOFWSimplePhysicalAddressSpace, 9); + +}; + +#endif diff --git a/i386/include/IOKit/firewire/IOFWSyncer.h b/i386/include/IOKit/firewire/IOFWSyncer.h new file mode 100644 index 0000000..0fa497f --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWSyncer.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOFWSYNCER_H +#define _IOFWSYNCER_H + +#include +#include +#include + +class IOFWSyncer : public OSObject +{ + OSDeclareDefaultStructors(IOFWSyncer) + +private: + // The spin lock that is used to guard the 'threadMustStop' variable. + IOSimpleLock *guardLock; + volatile bool threadMustStop; + IOReturn fResult; + virtual void free(); + virtual void privateSignal(); + +public: + + static IOFWSyncer * create(bool twoRetains = true); + + virtual bool init(bool twoRetains); + virtual void reinit(); + virtual IOReturn wait(bool autoRelease = true); + virtual void signal(IOReturn res = kIOReturnSuccess, + bool autoRelease = true); +}; + +#endif /* !_IOFWSYNCER */ + diff --git a/i386/include/IOKit/firewire/IOFWUserObjectExporter.h b/i386/include/IOKit/firewire/IOFWUserObjectExporter.h new file mode 100644 index 0000000..5d12307 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWUserObjectExporter.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1998-2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! @class IOFWUserObjectExporter + @discussion An IOFWUserObjectExporter is for internal use only. You should never subclass IOFWUserObjectExporter +*/ + + namespace IOFireWireLib + { + typedef UInt32 UserObjectHandle; + } + +#ifdef KERNEL + + class IOFWUserObjectExporter : public OSObject + { + OSDeclareDefaultStructors (IOFWUserObjectExporter ) + + public : + + typedef void (*CleanupFunction)( const OSObject * obj ); + typedef void (*CleanupFunctionWithExporter)( const OSObject * obj, IOFWUserObjectExporter * ); + + private : + + unsigned fCapacity; + unsigned fObjectCount; + const OSObject ** fObjects; + CleanupFunctionWithExporter * fCleanupFunctions; + IOLock * fLock; + OSObject * fOwner; + + public : + + static IOFWUserObjectExporter * createWithOwner( OSObject * owner ); + bool initWithOwner( OSObject * owner ); + + virtual bool init(); + + virtual void free (); + virtual bool serialize ( OSSerialize * s ) const; + + // me + IOReturn addObject ( OSObject * obj, CleanupFunction cleanup, IOFireWireLib::UserObjectHandle * outHandle ); + void removeObject ( IOFireWireLib::UserObjectHandle handle ); + + // the returned object is retained! This is for thread safety.. if someone else released + // the object from the pool after you got it, you be in for Trouble + // Release the returned value when you're done!! + const OSObject * lookupObject ( IOFireWireLib::UserObjectHandle handle ) const; + const OSObject * lookupObjectForType( IOFireWireLib::UserObjectHandle handle, const OSMetaClass * toType ) const; + void removeAllObjects (); + + void lock () const; + void unlock () const; + + OSObject * getOwner() const; + + const IOFireWireLib::UserObjectHandle lookupHandle ( OSObject * object ) const; + + // don't subclass, but just in case someone does... + + private: + + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 0); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 1); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 2); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 3); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 4); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 5); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 6); + OSMetaClassDeclareReservedUnused(IOFWUserObjectExporter, 7); + + }; + +#endif diff --git a/i386/include/IOKit/firewire/IOFWUtils.h b/i386/include/IOKit/firewire/IOFWUtils.h new file mode 100644 index 0000000..1a0ffc3 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFWUtils.h @@ -0,0 +1,32 @@ +/* + * IOFWUtils.h + * IOFireWireFamily + * + * Created by Niels on Fri Aug 16 2002. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + */ + +#import + +//////////////////////////////////////////////////////////////////////////////// +// +// Useful FireWire utility functions. +// + +#ifdef __cplusplus +extern "C" { +#endif + +UInt16 FWComputeCRC16(const UInt32 *pQuads, UInt32 numQuads); +UInt16 FWUpdateCRC16(UInt16 crc16, UInt32 quad); + +UInt32 AddFWCycleTimeToFWCycleTime( UInt32 cycleTime1, UInt32 cycleTime2 ); +UInt32 SubtractFWCycleTimeFromFWCycleTime( UInt32 cycleTime1, UInt32 cycleTime2); + +void IOFWGetAbsoluteTime( AbsoluteTime * result ); + +#ifdef __cplusplus +} +#endif + diff --git a/i386/include/IOKit/firewire/IOFireWireBus.h b/i386/include/IOKit/firewire/IOFireWireBus.h new file mode 100644 index 0000000..053bfe4 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireBus.h @@ -0,0 +1,373 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOFIREWIREBUS_H +#define _IOKIT_IOFIREWIREBUS_H + +#include +#include +#include +#include +#include + +extern const OSSymbol *gFireWireROM; +extern const OSSymbol *gFireWireNodeID; +extern const OSSymbol *gFireWireSelfIDs; +extern const OSSymbol *gFireWireSpeed; +extern const OSSymbol *gFireWireUnit_Spec_ID; +extern const OSSymbol *gFireWireUnit_SW_Version; +extern const OSSymbol *gFireWireVendor_ID; +extern const OSSymbol *gFireWire_GUID; +extern const OSSymbol *gFireWireVendor_Name; +extern const OSSymbol *gFireWireProduct_Name; +extern const OSSymbol *gFireWireModel_ID; +extern const OSSymbol *gFireWireTDM; + +class IOFireWireDevice; +class IOLocalConfigDirectory; +class IOFWLocalIsochPort; +class IOFireWirePowerManager; +class IOFireWireBus; +class IOFWDCLPool; +class IOFWSimpleContiguousPhysicalAddressSpace; +class IOFWSimplePhysicalAddressSpace; +class IOFWUserObjectExporter; + +#pragma mark - + +/*! + @class IOFireWireBusAux +*/ + +class IOFireWireBusAux : public OSObject +{ + OSDeclareAbstractStructors(IOFireWireBusAux) + + friend class IOFireWireBus; + + protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + public : + + virtual IOFWDCLPool * createDCLPool ( unsigned capacity ) const = 0 ; + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 32); + virtual UInt8 getMaxRec( void ) = 0; + + virtual UInt64 getFireWirePhysicalAddressMask( void ) = 0; + virtual UInt32 getFireWirePhysicalAddressBits( void ) = 0; + virtual UInt64 getFireWirePhysicalBufferMask( void ) = 0; + virtual UInt32 getFireWirePhysicalBufferBits( void ) = 0; + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) = 0; + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) = 0; + + virtual IOFWUserObjectExporter * getSessionRefExporter( void ) = 0; + + private: + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 0); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 1); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 2); + OSMetaClassDeclareReservedUsed(IOFireWireBusAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 7); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 8); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 9); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 10); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 11); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 12); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 13); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 14); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 15); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 16); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 17); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 18); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 19); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 20); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 21); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 22); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 23); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 24); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 25); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 26); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 27); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 28); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 29); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 30); + OSMetaClassDeclareReservedUnused(IOFireWireBusAux, 31); + +}; + +#pragma mark - + +/*! + @class IOFireWireBus + @abstract IOFireWireBus is a public class the provides access to + general FireWire functionality... +*/ + +class IOFireWireBus : public IOService +{ + OSDeclareAbstractStructors(IOFireWireBus) + +public: + + struct DCLTaskInfoAux + { + unsigned version ; + union // u + { + struct // v0 + { + IOMemoryMap * bufferMemoryMap ; // This field required to get physical addresses to program DMA. + // If NULL, we try to make the map ourselves. + // If you created a buffer memory descriptor + // for your program's buffers, just call map() on it + // and pass the returned object here... + } v0 ; + + struct // v1 + { + IOMemoryMap * bufferMemoryMap ; // same as 'bufferMemoryMap' from version 0, above. + + IOWorkLoop * workloop ; // A workloop on which to run callbacks for this port.. + // Can be NULL to use FireWire isochronous workloop... + // The workloop will be retained by the program object. + } v1 ; + + struct + { + IOMemoryMap * bufferMemoryMap ; // same as 'bufferMemoryMap' from version 0, above. + + IOWorkLoop * workloop ; // A workloop on which to run callbacks for this port.. + // Can be NULL to use FireWire isochronous workloop... + // The workloop will be retained by the program object. + IOFWIsochPortOptions options ; // extra options + } v2 ; + } u ; + } ; + + // this struct has been redefined for our next generation isochronous architecture, + // but is backwards compatible with the old definition.. This means we should + // be safe when an old-style driver is loaded.. + // To use DCLTaskInfo (see createLocalIsochPort) make sure all 'unused' fields are set to 0 or NULL + // and that auxInfo points to a valid DCLTaskInfoAux struct, defined above. + + struct DCLTaskInfo + { + task_t unused0 ; + vm_address_t unused1 ; + UInt32 unused2 ; + vm_address_t unused3 ; + UInt32 unused4 ; + void (*unused5)(void) ; + DCLTaskInfoAux * auxInfo ; // Refcon for user call + } ; + + static const IORegistryPlane * gIOFireWirePlane; + + IOFireWireBusAux * fAuxiliary; + + // Create an Isochronous Channel object + virtual IOFWIsochChannel *createIsochChannel( + bool doIRM, UInt32 bandwidth, IOFWSpeed prefSpeed, + IOFWIsochChannel::ForceStopNotificationProc stopProc=NULL, + void *stopRefCon=NULL) = 0; + + /*! @function createLocalIsochPort + @abstract Create a local isochronous port to run the given DCL program + @param talking Pass true to create a talker port; pass false to create a listener port. + @param opcodes A pointer to your DCL program (linked list of DCLCommand structs) + To use an IOFWDCL/IOFWDCLPool program, pass the DCLCommand returned by + IOFWDCLPool::getProgram(). + @param info (Optional) Pointer to DCLTaskInfo struct containing additional + configuration information. If you have an IOMemoryMap for your DCL program data buffers, + pass it here. You can also pass an IOWorkLoop if you want to use your own + workloop to handle callbacks for the created port object. + @param startEvent Specifies a bus condition on which the port should start receiving/sending packets + Must be kFWDCLImmediateEvent, kFWDCLCycleEvent, or kFWDCLSyBitsEvent. + Pass kFWDCLImmediateEvent to start without waiting when start() is called. Pass kFWDCLCycleEvent + to start() transmitting at a specified bus cycle time. Pass kFWDCLSyBitsEvent (receive only) + to start receiving packets once an isochronous packet with a specified sync field arrives. + @param startState Pass the value for the desired start condition, as specified by 'startEvent' + kFWDCLImmediateEvent: set to 0 + kFWDCLCycleEvent: the cycle timer value on which to start processing packets. For talker + ports, This value will be masked by 'startMask' and packet processing will be begin on the + next cycle whose lowest bits match the masked value. For listener ports, pass a 15-bit value + containg to the low order two bits of cycleSeconds and the 13-bit cycleCount on which to start + processing packets. + kFWDCLSyBitsEvent: The value of the sync field on which to start receive packets. The value will be masked + by 'startMask'. For DCLCommand based isoch ports, processing will begin on the first received packet + that has an isochronous header sync field matching 'startState'. For IOFWDCL/IOFWDCLPool based + ports, processing will pause on each IOFWDCL that has wait set to true until a packet that has + an isochronous header sync field matching 'startState' is received. + @result Returns an IOFWLocalIsochPort on success.*/ + virtual IOFWLocalIsochPort *createLocalIsochPort(bool talking, + DCLCommand *opcodes, DCLTaskInfo *info = 0, + UInt32 startEvent = 0, UInt32 startState = 0, UInt32 startMask = 0) = 0; + + virtual IOReturn getCycleTime(UInt32 &cycleTime) = 0; + virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime) = 0; + + // Methods to manipulate the local Config ROM + virtual IOReturn AddUnitDirectory(IOLocalConfigDirectory *unitDir) = 0; + virtual IOReturn RemoveUnitDirectory(IOLocalConfigDirectory *unitDir) = 0; + + // Cause a bus reset + virtual IOReturn resetBus() = 0; + + // Convert a firewire nodeID into the IOFireWireDevice for it + virtual IOFireWireDevice * nodeIDtoDevice(UInt32 generation, UInt16 nodeID) = 0; + + // Execute specified function on workloop after specified delay + // Returned command is for delay, call it's cancel() function to cancel timeout. + virtual IOFWDelayCommand * createDelayedCmd(UInt32 uSecDelay, FWBusCallback func, void *refcon) = 0; + + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem) = 0; + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) = 0; + + + // Extract info about the async request + virtual bool isLockRequest(IOFWRequestRefCon refcon) = 0; + virtual bool isQuadRequest(IOFWRequestRefCon refcon) = 0; + virtual UInt32 getExtendedTCode(IOFWRequestRefCon refcon) = 0; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog ( bool forSend, UInt16 nodeAddress) const = 0; + + // How big (as a power of two) can packets sent from A to B be? + virtual int maxPackLog ( UInt16 nodeA, UInt16 nodeB) const = 0; + + // Force given node to be root (via root holdoff Phy packet) + virtual IOReturn makeRoot ( UInt32 generation, UInt16 nodeID) = 0; + + // Create address space at fixed address in initial register space + virtual IOFWPseudoAddressSpace * createInitialAddressSpace ( UInt32 addressLo, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon) = 0; + + // Get address space object for given address, if any + virtual IOFWAddressSpace * getAddressSpace(FWAddress address) = 0; + + // Extract info about the async request - was the request ack'ed complete already? + virtual bool isCompleteRequest(IOFWRequestRefCon refcon) = 0; + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion=NULL, void *refcon=NULL) = 0; + virtual UInt32 hopCount(UInt16 nodeAAddress, UInt16 nodeBAddress ) = 0; + virtual UInt32 hopCount(UInt16 nodeAAddress ) = 0; + virtual IOFireWirePowerManager * getBusPowerManager( void ) = 0; + +protected: + + virtual IOFireWireBusAux * createAuxiliary( void ) = 0; + + public : + + inline IOFWDCLPool * createDCLPool ( UInt32 capacity = 0 ) { return fAuxiliary->createDCLPool ( capacity ) ; } + inline UInt8 getMaxRec( void ) { return fAuxiliary->getMaxRec(); } + + // get the physical addressing limitations for this controller + + // returns the physical mask for memory addressable by the bus and this controller's DMA engine + // intended for use with IOBufferMemoryDescriptor::inTaskWithPhysicalMask() + // all current hardware is 32 bit --- currently returns 0x00000000FFFFFFFF + // this API is intended for allocating physical buffers. + // it will not return more than 48 bits so that buffer addresses can be turned into FWAddresses + inline UInt64 getFireWirePhysicalAddressMask( void ) + { return fAuxiliary->getFireWirePhysicalAddressMask(); } + + // returns a count of the maximum addressing bits supported by the bus and this controller + // intended for use with IODMACommand::withSpecification() + // all current hardware is 32 bit --- currently returns 32 + // this API is intended for allocating physical buffers. + // it will not return more than 48 bits so that buffer addresses can be turned into FWAddresses + inline UInt32 getFireWirePhysicalAddressBits( void ) + { return fAuxiliary->getFireWirePhysicalAddressBits(); } + + // returns the physical mask for memory addressable by this controller's DMA engine + // intended for use with IOBufferMemoryDescriptor::inTaskWithPhysicalMask() + // all current hardware is 32 bit --- currently returns 0x00000000FFFFFFFF + // this API is to allocate isoch and other buffers that don't need to be addressable by the bus + // it may someday return as high 64 bits + inline UInt64 getFireWirePhysicalBufferMask( void ) + { return fAuxiliary->getFireWirePhysicalBufferMask(); } + + // returns a count of the maximum addressing bits supported by this controller + // intended for use with IODMACommand::withSpecification() + // all current hardware is 32 bit --- currently returns 32 + // this API is to allocate isoch and other buffers that don't need to be addressable by the bus + // it may someday return as high 64 bits + inline UInt32 getFireWirePhysicalBufferBits( void ) + { return fAuxiliary->getFireWirePhysicalBufferBits(); } + + inline IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimpleContiguousPhysicalAddressSpace( size, direction ); } + + inline IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimplePhysicalAddressSpace( size, direction ); } + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon, bool failOnReset) = 0; + + inline IOFWUserObjectExporter * getSessionRefExporter( void ) + { return fAuxiliary->getSessionRefExporter(); } + + private: + + OSMetaClassDeclareReservedUsed(IOFireWireBus, 0); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 1); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 2); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 3); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 4); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 5); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 6); + OSMetaClassDeclareReservedUsed(IOFireWireBus, 7); + +}; + +#endif /* ! _IOKIT_IOFIREWIREBUS_H */ + diff --git a/i386/include/IOKit/firewire/IOFireWireController.h b/i386/include/IOKit/firewire/IOFireWireController.h new file mode 100644 index 0000000..e2f3ae1 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireController.h @@ -0,0 +1,1089 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _IOKIT_IOFIREWIRECONTROLLER_H +#define _IOKIT_IOFIREWIRECONTROLLER_H + +#ifndef FIREWIREPRIVATE +#warning Please do not include this file. Include IOFireWireBus.h instead. +#endif + +#include +#include +#include +#include +#include +#include + +class OSData; +class IOWorkLoop; +class IOEventSource; +class IOFWQEventSource; +class IOTimerEventSource; +class IOMemoryDescriptor; +class IOFireWireController; +class IOFWAddressSpace; +class IOFWPseudoAddressSpace; +class IOFireWireNub; +class IOFireWireDevice; +class IOFireWireDeviceAux; +class IOFireWireUnit; +class IODCLProgram; +class IOLocalConfigDirectory; +class IOFireWireLink; +class IOFireWireSBP2ORB; +class IOFireWireSBP2Login; +class IOFireWireROMCache; +class IOFireWireLocalNode; +class IOFWWorkLoop; +class IOFireWireIRM; +class IOFireWirePowerManager; +class IOFWSimplePhysicalAddressSpace; +class IOFWSimpleContiguousPhysicalAddressSpace; +class IOFWAsyncStreamReceiver; +class IOFWAsyncStreamListener; +class IOFWUserVectorCommand; +class IOFWAsyncPHYCommand; +class IOFWPHYPacketListener; +class IOFWUserPHYPacketListener; + +#if FIRELOGCORE +class IOFireLog; +class IOFireLogPublisher; +#endif + +const UInt32 kMaxWaitForValidSelfID = 20; // Still invalid SelfID after 20 retries + +// Phy packet defs. + +enum +{ + kFWPhyPacketID = FWBitRange (0, 1), + kFWPhyPacketIDPhase = FWBitRangePhase (0, 1), + + kFWPhyPacketPhyID = FWBitRange (2, 7), + kFWPhyPacketPhyIDPhase = FWBitRangePhase (2, 7) +}; + +enum +{ + kSelfIDPacketSize = 8, + kMaxSelfIDs = 4 // SelfID 0,1,3,8 +}; + +enum +{ + kFWConfigurationPacketID = 0, + kFWLinkOnPacketID = 1, + kFWSelfIDPacketID = 2 +}; + +enum +{ + kFWPhyConfigurationR = FW_BIT(8), + kFWPhyConfigurationT = FW_BIT(9), + kFWPhyConfigurationGapCnt = FWBitRange (10, 15), + kFWPhyConfigurationGapCntPhase = FWBitRangePhase (10, 15) +}; + +enum +{ + kFWSelfIDPortStatusChild = 3, + kFWSelfIDPortStatusParent = 2, + kFWSelfIDPortStatusNotConnected = 1, + kFWSelfIDPortStatusNotPresent = 0, + + kFWSelfIDNoPower = 0, + kFWSelfIDSelfPowered15W = 1, + kFWSelfIDSelfPowered30W = 2, + kFWSelfIDSelfPowered45W = 3, + kFWSelfIDBusPowered1W = 4, + kFWSelfIDBusPowered3W = 5, + kFWSelfIDBusPowered6W = 6, + kFWSelfIDBusPowered10W = 7, + + kFWSelfIDPhyID = kFWPhyPacketPhyID,//zzz do we need or want this? + kFWSelfIDPhyIDPhase = kFWPhyPacketPhyIDPhase, + kFWSelfIDM = FW_BIT(31), + + kFWSelfID0L = FW_BIT(9), + kFWSelfID0GapCnt = FWBitRange (10, 15), + kFWSelfID0GapCntPhase = FWBitRangePhase (10, 15), + kFWSelfID0SP = FWBitRange (16, 17), + kFWSelfID0SPPhase = FWBitRangePhase (16, 17), + kFWSelfID0Del = FWBitRange (18, 19), + kFWSelfID0DelPhase = FWBitRangePhase (18, 19), + kFWSelfID0C = FW_BIT(20), + kFWSelfID0Pwr = FWBitRange (21, 23), + kFWSelfID0PwrPhase = FWBitRangePhase (21, 23), + kFWSelfID0P0 = FWBitRange (24, 25), + kFWSelfID0P0Phase = FWBitRangePhase (24, 25), + kFWSelfID0P1 = FWBitRange (26, 27), + kFWSelfID0P1Phase = FWBitRangePhase (26, 27), + kFWSelfID0P2 = FWBitRange (28, 29), + kFWSelfID0P2Phase = FWBitRangePhase (28, 29), + kFWSelfID0I = FW_BIT(30), + + kFWSelfIDPacketType = FW_BIT(8), + kFWSelfIDNN = FWBitRange (9, 11), + kFWSelfIDNNPhase = FWBitRangePhase (9, 11), + kFWSelfIDNPa = FWBitRange (14, 15), + kFWSelfIDNPaPhase = FWBitRangePhase (14, 15), + kFWSelfIDNPb = FWBitRange (16, 17), + kFWSelfIDNPbPhase = FWBitRangePhase (16, 17), + kFWSelfIDNPc = FWBitRange (18, 19), + kFWSelfIDNPcPhase = FWBitRangePhase (18, 19), + kFWSelfIDNPd = FWBitRange (20, 21), + kFWSelfIDNPdPhase = FWBitRangePhase (20, 21), + kFWSelfIDNPe = FWBitRange (22, 23), + kFWSelfIDNPePhase = FWBitRangePhase (22, 23), + kFWSelfIDNPf = FWBitRange (24, 25), + kFWSelfIDNPfPhase = FWBitRangePhase (24, 25), + kFWSelfIDNPg = FWBitRange (26, 27), + kFWSelfIDNPgPhase = FWBitRangePhase (26, 27), + kFWSelfIDNPh = FWBitRange (28, 29), + kFWSelfIDNPhPhase = FWBitRangePhase (28, 29), + kFWSelfIDMore = FW_BIT(31) +}; + +// Primary packet defs. +enum +{ + kFWPacketTCode = FWBitRange (24, 27), + kFWPacketTCodePhase = FWBitRangePhase (24, 27) +}; + + +enum +{ + kFWAsynchSpd = FWBitRange (14, 15), + kFWAsynchSpdPhase = FWBitRangePhase (14, 15), + + kFWAsynchTLabel = FWBitRange (16, 21), + kFWAsynchTLabelPhase = FWBitRangePhase (16, 21), + kFWAsynchTTotal = ((0xffffffff & kFWAsynchTLabel) >> kFWAsynchTLabelPhase)+1, + kFWAsynchRt = FWBitRange (22, 23), + kFWAsynchRtPhase = FWBitRangePhase (22, 23), + kFWAsynchNew = 0, + kFWAsynchRetryA = 2, + kTIAsycnhRetryB = 3, + + kFWAsynchPriority = FWBitRange (28, 31), + kFWAsynchPriorityPhase = FWBitRangePhase (28, 31), + + kFWAsynchDestinationID = FWBitRange (0, 15), + kFWAsynchDestinationIDPhase = FWBitRangePhase (0, 15), + + kFWAsynchSourceID = FWBitRange (0, 15), + kFWAsynchSourceIDPhase = FWBitRangePhase (0, 15), + + kFWAsynchDestinationOffsetHigh = FWBitRange (16, 31), + kFWAsynchDestinationOffsetHighPhase = FWBitRangePhase (16, 31), + + kFWAsynchDestinationOffsetLow = FWBitRange (0, 31), + kFWAsynchDestinationOffsetLowPhase = FWBitRangePhase (0, 31), + + kFWAsynchDataLength = FWBitRange (0, 15), + kFWAsynchDataLengthPhase = FWBitRangePhase (0, 15), + + kFWAsynchExtendedTCode = FWBitRange (16, 31), + kFWAsynchExtendedTCodePhase = FWBitRangePhase (16, 31), + + kFWAsynchAckSent = FWBitRange (28, 31), + kFWAsynchAckSentPhase = FWBitRangePhase (28, 31), + + kFWAsynchRCode = FWBitRange (16, 19), + kFWAsynchRCodePhase = FWBitRangePhase (16, 19) +}; + +enum +{ + kFWTCodeWriteQuadlet = 0, + kFWTCodeWriteBlock = 1, + kFWTCodeWriteResponse = 2, + kFWTCodeReadQuadlet = 4, + kFWTCodeReadBlock = 5, + kFWTCodeReadQuadletResponse = 6, + kFWTCodeReadBlockResponse = 7, + kFWTCodeCycleStart = 8, + kFWTCodeLock = 9, + kFWTCodeIsochronousBlock = 10, + kFWTCodeLockResponse = 11, + kFWTCodePHYPacket = 14 +}; + +enum +{ + kFWExtendedTCodeMaskSwap = 1, + kFWExtendedTCodeCompareSwap = 2, + kFWExtendedTCodeFetchAdd = 3, + kFWExtendedTCodeLittleAdd = 4, + kFWExtendedTCodeBoundedAdd = 5, + kFWExtendedTCodeWrapAdd = 6, + kFWExtendedTCodeVendorDependent = 7 +}; + +// debug boot-arg constants +enum +{ + kFWDebugIgnoreNodeNone = 0xFFFFFFFF +}; + +struct AsyncPendingTrans { + IOFWAsyncCommand * fHandler; + IOFWCommand * fAltHandler; + int fTCode; + bool fInUse; +}; + +struct IOFWNodeScan { + IOFireWireController * fControl; + FWAddress fAddr; + UInt32 fBuf[5]; // Enough for bus info block + UInt32 * fSelfIDs; + int fNumSelfIDs; + int fROMSize; + int fRead; + IOFWReadQuadCommand * fCmd; + IOFWCompareAndSwapCommand * fLockCmd; + UInt32 generation; + UInt32 fIRMBitBucketOld; + UInt32 fIRMBitBucketNew; + bool fIRMisBad; + bool speedChecking; + bool fContenderNeedsChecking; + bool fIRMCheckingRead; + bool fIRMCheckingLock; + int fRetriesBumped; + bool fMustNotBeRoot; +}; + + +typedef struct IOFWDuplicateGUIDStruct IOFWDuplicateGUIDRec; +struct IOFWDuplicateGUIDStruct + { + IOFWDuplicateGUIDRec * fNextGUID; + CSRNodeUniqueID fGUID; + UInt32 fLastGenSeen; +}; + + +// IOFireWireDuplicateGUIDList +// +// A little class for keeping track of GUIDs which where we have observed 2 nodes with +// the same GUID + +class IOFireWireDuplicateGUIDList : public OSObject +{ + OSDeclareDefaultStructors(IOFireWireDuplicateGUIDList); + +private: + IOFWDuplicateGUIDRec * fFirstGUID; + +protected: + virtual void free(); + +public: + + static IOFireWireDuplicateGUIDList * create( void ); + + void addDuplicateGUID( CSRNodeUniqueID guid, UInt32 gen ); + void removeDuplicateGUID( CSRNodeUniqueID guid ); + + bool findDuplicateGUID( CSRNodeUniqueID guid, UInt32 gen ); + +}; + +#define kMaxPendingTransfers kFWAsynchTTotal + +class IOFireWireController; + +#pragma mark - + +/*! + @class IOFireWireControllerAux +*/ + +class IOFireWireControllerAux : public IOFireWireBusAux +{ + OSDeclareDefaultStructors(IOFireWireControllerAux) + + friend class IOFireWireController; + +protected: + + IOFireWireController * fPrimary; + + UInt8 fMaxRec; + + UInt8 fPadding; + UInt16 fPadding2; + + IOFWUserObjectExporter * fSessionRefExporter; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init ( + IOFireWireController * primary ); + virtual void free (); + virtual IOFWDCLPool * createDCLPool ( unsigned capacity ) const ; + virtual UInt8 getMaxRec( void ); + + virtual UInt64 getFireWirePhysicalAddressMask( void ); + virtual UInt32 getFireWirePhysicalAddressBits( void ); + virtual UInt64 getFireWirePhysicalBufferMask( void ); + virtual UInt32 getFireWirePhysicalBufferBits( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWUserObjectExporter * getSessionRefExporter( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireControllerAux, 7); + +}; + + +#pragma mark - + +/*! @class IOFireWireController +*/ +class IOFireWireController : public IOFireWireBus +{ + OSDeclareAbstractStructors(IOFireWireController) + +protected: + enum busState { + kStarting = 0, + kAsleep, // Link off, zzzzzz + kWaitingBusReset, + kWaitingSelfIDs, // Bus has been reset, no selfIDs yet + kWaitingScan, // Got selfIDs, waiting a bit before hitting lame devices + kScanning, // Reading node ROMs + kWaitingPrune, // Read all ROMs, pausing before pruning missing devices + kRunning, // Normal happy state, + kWaitingBusResetStart // bus reset is desired, but not yet sent to the fwim + }; + + enum ResetState + { + kResetStateResetting, + kResetStateDisabled, + kResetStateArbitrated + }; + + enum + { + kDisablePhysicalAccess = (1 << 0) + }; + + struct timeoutQ: public IOFWCmdQ + { + IOTimerEventSource *fTimer; + virtual void headChanged(IOFWCommand *oldHead); + void busReset(); + }; + + struct pendingQ: public IOFWCmdQ + { + IOFWQEventSource *fSource; + virtual void headChanged(IOFWCommand *oldHead); + }; + + friend class IOFireWireLink; + friend class IOFireWireDevice; + friend class IOFireWireDeviceAux; + friend class IOFWAddressSpace; + friend class IOFWAddressSpaceAux; + friend class IOFWPseudoAddressSpace; + friend class IOFireWireSBP2ORB; + friend class IOFireWireSBP2Login; + friend class IOFWLocalIsochPort; + friend class IOFWCommand; + friend class IOFireWireUnit; + friend class IOFireWirePCRSpace; + friend class IOFireWireROMCache; + friend class IOFWAsyncStreamCommand; + friend class IOFireWireAVCLocalUnit; + friend class IOFireWireAVCUnit; + friend class IOFireWireAVCCommand; + friend class IOFireWirePowerManager; + friend class IOFWWriteQuadCommand; + friend class IOFWWriteCommand; + friend class IOFWCompareAndSwapCommand; + friend class IOFWAsyncCommand; + friend class IOFireWireAVCTargetSpace; + friend class AppleFWOHCI; + friend class IOFireWireNub; + friend class IOFWAsyncStreamListener; + friend class IOFireWireLocalNode; + friend class IOFireWireIRMAllocation; + friend class IOFWUserVectorCommand; + friend class IOFWAsyncPHYCommand; + friend class IOFWUserPHYPacketListener; + friend class IOFWAsyncStreamReceiver; + +#if FIRELOGCORE + friend class IOFireLog; +#endif + + IOFireWireLink * fFWIM; + IOFWWorkLoop * fWorkLoop; + IOTimerEventSource * fTimer; + OSSet * fLocalAddresses; // Collection of local adress spaces + OSIterator * fSpaceIterator; // Iterator over local addr spaces + + OSSet * fAllocatedChannels; // Need to be informed of bus resets + OSIterator * fAllocChannelIterator; // Iterator over channels + + OSSet * fIRMAllocations; // Need to be informed of bus resets + OSIterator * fIRMAllocationsIterator; // Iterator over channels + OSSet * fIRMAllocationsAllocated; // Need to be informed of bus resets + + // Bus management variables (although we aren't a FireWire Bus Manager...) + AbsoluteTime fResetTime; // Time of last reset + UInt32 fBusGeneration; // ID of current bus topology. + UInt16 fLocalNodeID; // ID of local node, ie. this computer + UInt16 fRootNodeID; // ID of root, ie. highest node id in use. + UInt16 fIRMNodeID; // ID of Isochronous resource manager, or kFWBadNodeID + bool fBusMgr; // true if at least one node is bus manager capable + IORegistryEntry * fNodes[kFWMaxNodesPerBus]; // FireWire nodes on this bus + UInt32 * fNodeIDs[kFWMaxNodesPerBus+1]; // Pointer to SelfID list for each node + // +1 so we know how many selfIDs the last node has + + UInt32 fGapCount; // What we think the gap count should be + //UInt8 fSpeedCodes[(kFWMaxNodesPerBus+1)*kFWMaxNodesPerBus]; + UInt8 fSpeedVector[((kFWMaxNodesPerBus+1)*kFWMaxNodesPerBus)/2]; + // Max speed between two nodes + busState fBusState; // Which state are we in? + int fNumROMReads; // Number of device ROMs we are still reading + // SelfIDs + int fNumSelfIDs; // Total number of SelfID packets + UInt32 fSelfIDs[kMaxSelfIDs*kFWMaxNodesPerBus]; + + // The local device's Config ROM + UInt32 fROMHeader[5]; // More or less fixed header and bus info block + IOLocalConfigDirectory * fRootDir; // Local Config ROM root directory. + + // log base 2 of maximum packet size the FWIM can send/receive + // Normally calculated from bus info block. + int fMaxSendLog; + int fMaxRecvLog; + + IOFWAddressSpace * fROMAddrSpace; + IOMemoryDescriptor * fBadReadResponse; // Send back easily identified bad data to out of range addrs. + + // Array for outstanding requests (up to 64) + AsyncPendingTrans fTrans[kMaxPendingTransfers]; + int fLastTrans; + + // queue for executing commands that may timeout + timeoutQ fTimeoutQ; + + // queue for commands that can't execute yet + pendingQ fPendingQ; + + // queue for async commands interrupted by bus reset + IOFWCmdQ fAfterResetHandledQ; + + // Command to change bus state after a delay. + IOFWDelayCommand * fDelayedStateChangeCmd; + bool fDelayedStateChangeCmdNeedAbort; + + UInt32 fDelayedPhyPacket; + bool fBusResetScheduled; + ResetState fBusResetState; + IOFWDelayCommand * fBusResetStateChangeCmd; + UInt32 fBusResetDisabledCount; + +#if FIRELOGCORE + IOFireLogPublisher * fFireLogPublisher; +#else + void * fFireLogPublisher; +#endif + + OSData * fAllocatedAddresses; + + UInt32 fDevicePruneDelay; + + IOFWPhysicalAccessMode fPhysicalAccessMode; + IOFWSecurityMode fSecurityMode; + IONotifier * fKeyswitchNotifier; + + IOFireWireIRM * fIRM; + IOFireWirePowerManager * fBusPowerManager; + + bool fGapCountMismatch; + + bool fUseHalfSizePackets; + bool fRequestedHalfSizePackets; + + IOFWNodeScan * fScans[kFWMaxNodesPerBus]; + IOFireWireDuplicateGUIDList * fGUIDDups; + + bool fDelegateCycleMaster; + bool fBadIRMsKnown; + + UInt32 fPreviousGap; + + UInt32 fOutOfTLabels; + UInt32 fOutOfTLabels10S; + UInt32 fOutOfTLabelsThreshold; + +#ifdef LEGACY_SHUTDOWN + IONotifier * fPowerEventNotifier; +#endif + + bool fStarted; + + UInt32 fIOCriticalSectionCount; + UInt32 fHubPort; + UInt32 fDebugIgnoreNode; + + OSSet * fLocalAsyncStreamReceivers; + OSIterator * fAsyncStreamReceiverIterator; + + bool fInstantiated; + + IOReturn fStartStatus; + UInt32 fWaitingForSelfID; + + UInt32 fForcedRootNodeID; + bool fNodeMustBeRootFlag; + bool fNodeMustNotBeRootFlag; + + UInt32 fForcedGapCount; + bool fForcedGapFlag; + + OSSet * fPHYPacketListeners; + OSIterator * fPHYPacketListenersIterator; + + bool fDSLimited; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void clockTick(OSObject *, IOTimerEventSource *); + static void readROMGlue(void *refcon, IOReturn status, + IOFireWireNub *device, IOFWCommand *fwCmd); + static void delayedStateChange(void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd); + + virtual void processBusReset(); + virtual void processSelfIDs(UInt32 *IDs, int numIDs, UInt32 *ownIDs, int numOwnIDs); + virtual void processTimeout(IOTimerEventSource *src); + virtual void processRcvPacket( UInt32 *data, int numQuads, IOFWSpeed speed ); + virtual void processWriteRequest(UInt16 sourceID, UInt32 tlabel, + UInt32 *hdr, void *buf, int len, IOFWSpeed speed); + virtual void processLockRequest(UInt16 sourceID, UInt32 tlabel, + UInt32 *hdr, void *buf, int len, IOFWSpeed speed); + + // Process read from a local address, return rcode + virtual UInt32 doReadSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + IOMemoryDescriptor **buf, IOByteCount * offset, IODMACommand **dma_command, + IOFWRequestRefCon refcon); + + // Process write to a local address, return rcode + virtual UInt32 doWriteSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon refcon); + + // Process lock to a local address, return rcode + UInt32 doLockSpace(UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 inlen, + const UInt32 *newVal, UInt32 &outLen, UInt32 *oldVal, + UInt32 extType, IOFWRequestRefCon refcon); + + virtual void updatePlane(); + virtual void startBusScan(); + + // Called when all devices on bus have been examined + virtual void finishedBusScan(); + + virtual void buildTopology(bool doFWPlane); + + virtual void readDeviceROM(IOFWNodeScan *refCon, IOReturn status); + + virtual IOReturn UpdateROM(); + virtual IOReturn allocAddress(IOFWAddressSpace *space); + virtual void freeAddress(IOFWAddressSpace *space); + + IOFireWireBusAux * createAuxiliary( void ); + +public: + + // Initialization + virtual bool init(IOFireWireLink *fwim); + virtual void free(); + virtual bool start(IOService *provider); + virtual void stop( IOService * provider ); + virtual bool finalize( IOOptionBits options ); + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + + // Power management + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); + + // Implement IOService::getWorkLoop + virtual IOWorkLoop *getWorkLoop() const; + + // Allocate struct for tracking a transaction + virtual AsyncPendingTrans *allocTrans(IOFWAsyncCommand *cmd=NULL); + virtual void freeTrans(AsyncPendingTrans *trans); + + // Really public methods + + virtual IOReturn getCycleTime(UInt32 &cycleTime); + virtual IOReturn getBusCycleTime(UInt32 &busTime, UInt32 &cycleTime); + + // Methods to manipulate the local Config ROM + virtual IOReturn AddUnitDirectory(IOLocalConfigDirectory *unitDir); + virtual IOReturn RemoveUnitDirectory(IOLocalConfigDirectory *unitDir); + + // Cause a bus reset + virtual IOReturn resetBus(); + + // Send async request packets + virtual IOReturn asyncRead( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int size, + IOFWAsyncCommand * cmd ); + + virtual IOReturn asyncWrite( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd ); + + /* DEPRECATED */ virtual IOReturn asyncWrite( UInt32 generation, + /* DEPRECATED */ UInt16 nodeID, + /* DEPRECATED */ UInt16 addrHi, + /* DEPRECATED */ UInt32 addrLo, + /* DEPRECATED */ int speed, + /* DEPRECATED */ int label, + /* DEPRECATED */ void * data, + /* DEPRECATED */ int size, + /* DEPRECATED */ IOFWAsyncCommand * cmd ); + + /* DEPRECATED */ virtual IOReturn asyncLock( UInt32 generation, + /* DEPRECATED */ UInt16 nodeID, + /* DEPRECATED */ UInt16 addrHi, + /* DEPRECATED */ UInt32 addrLo, + /* DEPRECATED */ int speed, + /* DEPRECATED */ int label, + /* DEPRECATED */ int type, + /* DEPRECATED */ void * data, + /* DEPRECATED */ int size, + /* DEPRECATED */ IOFWAsyncCommand * cmd); + + + // Send async read response packets + // useful for pseudo address spaces that require servicing outside the FireWire work loop. + virtual IOReturn asyncReadResponse( UInt32 generation, + UInt16 nodeID, + int speed, + IOMemoryDescriptor * buf, + IOByteCount offset, + int len, + IOFWRequestRefCon refcon ); + + virtual IOReturn asyncLockResponse( UInt32 generation, + UInt16 nodeID, + int speed, + IOMemoryDescriptor * buf, + IOByteCount offset, + int len, + IOFWRequestRefCon refcon ); + + // Try to fix whatever might have caused the other device to not respond + virtual IOReturn handleAsyncTimeout(IOFWAsyncCommand *cmd); + + // Convert a firewire nodeID into the IOFireWireDevice for it + virtual IOFireWireDevice * nodeIDtoDevice(UInt32 generation, UInt16 nodeID); + + // Add/remove a channel from the list informed of bus resets + virtual void addAllocatedChannel(IOFWIsochChannel *channel); + virtual void removeAllocatedChannel(IOFWIsochChannel *channel); + + // Add/remove a IRM allocation from the list informed of bus resets + virtual void addIRMAllocation(IOFireWireIRMAllocation *irmAllocation); + virtual void removeIRMAllocation(IOFireWireIRMAllocation *irmAllocation); + + // Create an Isochronous Channel object + // doIRM = true => allocate channel and bandwith in Isochronous Resource Manager + // packetSize packet size (in bytes), used to calculate bandwidth needed. + virtual IOFWIsochChannel *createIsochChannel( + bool doIRM, UInt32 packetSize, IOFWSpeed prefSpeed, + FWIsochChannelForceStopNotificationProc stopProc=NULL, + void *stopRefCon=NULL); + + // Create a local isochronous port to run the given DCL program + // if task is 0, the DCL program is for the kernel task, + // otherwise all DCL pointers are valid in the specified task. + // opcodes is also pointer valid in the specified task. + virtual IOFWLocalIsochPort *createLocalIsochPort(bool talking, + DCLCommand* opcodes, DCLTaskInfo *info = 0, + UInt32 startEvent = 0, UInt32 startState = 0, UInt32 startMask = 0); + + // Execute specified function on workloop after specified delay + // Returned command is for delay, call it's cancel() function to cancel timeout. + virtual IOFWDelayCommand * createDelayedCmd(UInt32 uSecDelay, FWBusCallback func, void *refcon); + + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + // Extract info about the async request + virtual bool isLockRequest(IOFWRequestRefCon refcon); + virtual bool isQuadRequest(IOFWRequestRefCon refcon); + virtual UInt32 getExtendedTCode(IOFWRequestRefCon refcon); + + // Inline accessors for protected member variables + IOFWCmdQ &getTimeoutQ(); + IOFWCmdQ &getPendingQ(); + IOFWCmdQ &getAfterResetHandledQ(); + IOFireWireLink * getLink() const; + + IOLocalConfigDirectory *getRootDir() const; + bool checkGeneration(UInt32 gen) const; + UInt32 getGeneration() const; + UInt16 getLocalNodeID() const; + IOReturn getIRMNodeID(UInt32 &generation, UInt16 &id); + + const AbsoluteTime * getResetTime() const; + + IOFWSpeed FWSpeed(UInt16 nodeAddress) const; + IOFWSpeed FWSpeed(UInt16 nodeA, UInt16 nodeB) const; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog(bool forSend, UInt16 nodeAddress) const; + + // How big (as a power of two) can packets sent from A to B be? + virtual int maxPackLog(UInt16 nodeA, UInt16 nodeB) const; + + // Force given node to be root (via root holdoff Phy packet) + virtual IOReturn makeRoot(UInt32 generation, UInt16 nodeID) ; + + virtual IOFWPseudoAddressSpace *createInitialAddressSpace(UInt32 addressLo, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + virtual IOFWAddressSpace *getAddressSpace(FWAddress address); + + // Extract info about the async request - was the request ack'ed complete already? + virtual bool isCompleteRequest(IOFWRequestRefCon refcon); + + // Are we currently scanning the bus? + bool scanningBus() const; + +protected: + + void openGate(); + void closeGate(); + +protected: + virtual void doBusReset( void ); + static void resetStateChange( void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd); + +public: + virtual IOReturn disableSoftwareBusResets( void ); + virtual void enableSoftwareBusResets( void ); + + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon); + + virtual IOReturn asyncStreamWrite(UInt32 generation, + int speed, int tag, int sync, int channel, + IOMemoryDescriptor *buf, IOByteCount offset, + int size, IOFWAsyncStreamCommand *cmd); + +protected: + bool inGate(); + + virtual IOReturn allocatePseudoAddress(FWAddress *addr, UInt32 lenDummy); + virtual void freePseudoAddress(FWAddress addr, UInt32 lenDummy); + + virtual IORegistryEntry * createDummyRegistryEntry( IOFWNodeScan *scan ); + + static IOFireWireLocalNode * getLocalNode(IOFireWireController *control); + + virtual void setPhysicalAccessMode( IOFWPhysicalAccessMode mode ); + virtual IOFWPhysicalAccessMode getPhysicalAccessMode( void ); + virtual void physicalAccessProcessBusReset( void ); + virtual void setNodeIDPhysicalFilter( UInt16 nodeID, bool state ); + + virtual void initSecurity( void ); + virtual void freeSecurity( void ); + static bool serverKeyswitchCallback( void * target, void * refCon, IOService * service, IONotifier * notifier ); + virtual void setSecurityMode( IOFWSecurityMode mode ); + virtual IOFWSecurityMode getSecurityMode( void ); + + virtual IOReturn createTimeoutQ( void ); + virtual void destroyTimeoutQ( void ); + virtual IOReturn createPendingQ( void ); + virtual void destroyPendingQ( void ); + + virtual UInt32 countNodeIDChildren( UInt16 nodeID, int hub_port = 0, int * hubChildRemainder = NULL, bool * hubParentFlag = NULL ); + +public: + virtual UInt32 hopCount(UInt16 nodeAAddress, UInt16 nodeBAddress ); + virtual UInt32 hopCount(UInt16 nodeAAddress ); + + virtual IOFireWirePowerManager * getBusPowerManager( void ); + +protected: + virtual void handleARxReqIntComplete(); + + virtual IOReturn asyncLock( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int type, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd ); + + virtual IOReturn asyncWrite( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + IOMemoryDescriptor * buf, + IOByteCount offset, + int size, + IOFWAsyncCommand * cmd, + IOFWWriteFlags flags ); + +protected: + bool delayedStateCommandInUse() const; + void enterBusResetDisabledState( ); + + virtual UInt32 getPortNumberFromIndex( UInt16 index ); + + virtual bool checkForDuplicateGUID(IOFWNodeScan *scan, CSRNodeUniqueID *currentGUIDs ); + virtual void updateDevice(IOFWNodeScan *scan ); + virtual bool AssignCycleMaster(); + +public: + + IOReturn clipMaxRec2K(Boolean clipMaxRec ); + void setNodeSpeed( UInt16 nodeAddress, IOFWSpeed speed ); + void useHalfSizePackets( void ); + void disablePhyPortOnSleepForNodeID( UInt32 nodeID ); + + IOReturn handleAsyncCompletion( IOFWCommand *cmd, IOReturn status ); + void processCycle64Int(); + +#ifdef LEGACY_SHUTDOWN + static IOReturn systemShutDownHandler( void * target, void * refCon, + UInt32 messageType, IOService * service, + void * messageArgument, vm_size_t argSize ); +#else + virtual void systemWillShutdown( IOOptionBits specifier ); +#endif + + IOReturn beginIOCriticalSection( void ); + void endIOCriticalSection( void ); + +protected: + IOReturn poweredStart( void ); + void setNodeSpeed( UInt16 nodeA, UInt16 nodeB, UInt8 speed ); + void setNodeSpeed( UInt16 nodeAddress, UInt8 speed ); + +public: + bool isPhysicalAccessEnabledForNodeID( UInt16 nodeID ); + + // Allocate IRM bandwidth if the specified generation is the current FireWire generation. + IOReturn allocateIRMBandwidthInGeneration(UInt32 bandwidthUnits, UInt32 generation) ; + + // Release IRM bandwidth if the specified generation is the current FireWire generation. + IOReturn releaseIRMBandwidthInGeneration(UInt32 bandwidthUnits, UInt32 generation) ; + + // Allocate IRM channel if the specified generation is the current FireWire generation. + IOReturn allocateIRMChannelInGeneration(UInt8 isochChannel, UInt32 generation) ; + + // Release IRM channel if the specified generation is the current FireWire generation. + IOReturn releaseIRMChannelInGeneration(UInt8 isochChannel, UInt32 generation) ; + + // Create an IOFireWireIRMAllocation object which can be used to allocate isoch resources that are automatically reallocated after bus-resets! + IOFireWireIRMAllocation *createIRMAllocation(Boolean releaseIRMResourcesOnFree = true, + IOFireWireIRMAllocation::AllocationLostNotificationProc allocationLostProc = NULL, + void *pLostNotificationProcRefCon = NULL); + + IOFWAsyncStreamListener *createAsyncStreamListener( UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + + void removeAsyncStreamListener( IOFWAsyncStreamListener *listener ); + + IOFWSpeed getBroadcastSpeed(){ return FWSpeed( fLocalNodeID ); }; + +private: + + IOFWAsyncStreamReceiver *allocAsyncStreamReceiver( UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon ); + + IOFWAsyncStreamReceiver *getAsyncStreamReceiver( UInt32 channel ); + + void freeAllAsyncStreamReceiver(); + + void activateAsyncStreamReceivers(); + + void deactivateAsyncStreamReceivers(); + +protected: + IOService *findKeyswitchDevice( void ); + void suspendBus( void ); + +public: + virtual IOReturn asyncRead( UInt32 generation, + UInt16 nodeID, + UInt16 addrHi, + UInt32 addrLo, + int speed, + int label, + int size, + IOFWAsyncCommand * cmd, + IOFWReadFlags flags ); + + void checkProgress( void ); + + void terminateDevice( IOFireWireDevice * device ); + + void nodeMustBeRoot( UInt32 nodeID ); + + void nodeMustNotBeRoot( UInt32 nodeID ); + + void setGapCount( UInt32 gapCount ); + + IOReturn asyncPHYPacket( UInt32 generation, + UInt32 data, + UInt32 data2, + IOFWAsyncPHYCommand * cmd ); + + IOFWAsyncPHYCommand * createAsyncPHYCommand( UInt32 generation, + UInt32 data1, + UInt32 data2, + FWAsyncPHYCallback completion, + void * refcon, + bool failOnReset ); + +private: + AsyncPendingTrans * allocTrans( IOFWAsyncCommand * cmd, IOFWCommand * altcmd ); + +public: + + IOReturn activatePHYPacketListener( IOFWPHYPacketListener * listener ); + void deactivatePHYPacketListener( IOFWPHYPacketListener * listener ); + + IOFWPHYPacketListener * createPHYPacketListener( FWPHYPacketCallback proc, void * refcon ); + +private: + void processPHYPacket( UInt32 data1, UInt32 data2 ); + void enterLoggingMode( void ); + +public: + IOReturn getCycleTimeAndUpTime( UInt32 &cycleTime, UInt64 &uptime ); + +protected: + void removeAsyncStreamReceiver( IOFWAsyncStreamReceiver *receiver ); + +public: + + // Create a multi-isoch-receive listener + IOFireWireMultiIsochReceiveListener * createMultiIsochReceiveListener(UInt32 channel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams = NULL); + + // Activate a multi-isoch-receive listener + IOReturn activateMultiIsochReceiveListener(IOFireWireMultiIsochReceiveListener *pListener); + + // Deactivate a multi-isoch-receive listener + IOReturn deactivateMultiIsochReceiveListener(IOFireWireMultiIsochReceiveListener *pListener); + + // Call for client to specify he is done with a multi-isoch receiver isoch packet + void clientDoneWithMultiIsochReceivePacket(IOFireWireMultiIsochReceivePacket *pPacket); + +public: + virtual IOFWAsyncStreamCommand * createAsyncStreamCommand( UInt32 generation, + UInt32 channel, UInt32 sync, UInt32 tag, IOMemoryDescriptor *hostMem, + UInt32 size, int speed,FWAsyncStreamCallback completion, void *refcon, bool failOnReset); + +private: + void addToIRMAllocationSet(IOFireWireIRMAllocation *anObject); + void removeFromIRMAllocationSet(IOFireWireIRMAllocation *anObject); + +protected: + OSMetaClassDeclareReservedUnused(IOFireWireController, 0); + OSMetaClassDeclareReservedUnused(IOFireWireController, 1); + OSMetaClassDeclareReservedUnused(IOFireWireController, 2); + OSMetaClassDeclareReservedUnused(IOFireWireController, 3); + OSMetaClassDeclareReservedUnused(IOFireWireController, 4); + OSMetaClassDeclareReservedUnused(IOFireWireController, 5); + OSMetaClassDeclareReservedUnused(IOFireWireController, 6); + OSMetaClassDeclareReservedUnused(IOFireWireController, 7); + OSMetaClassDeclareReservedUnused(IOFireWireController, 8); + +}; + +#endif /* ! _IOKIT_IOFIREWIRECONTROLLER_H */ diff --git a/i386/include/IOKit/firewire/IOFireWireDevice.h b/i386/include/IOKit/firewire/IOFireWireDevice.h new file mode 100644 index 0000000..a68e5a2 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireDevice.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + /*! @header + This header contains the definition of the IOFireWireDevice and IOFireWireDeviceAux classes. + An IOFireWireDevice object represents a FireWire device in the I/O Registry. + It is strongly recommended that you write applications that access FireWire devices rather than in-kernel device drivers. + For more information on how to do this, see {@linkdoc //apple_ref/doc/uid/TP40000969 FireWire Device Interface Guide}. + @indexgroup FireWire + */ +#ifndef _IOKIT_IOFIREWIREDEVICE_H +#define _IOKIT_IOFIREWIREDEVICE_H + +#include + +class IOFireWireROMCache; + +struct IOFWNodeScan; +struct RomScan; + +class IOFireWireDevice; + +#pragma mark - + +/*! @class IOFireWireDeviceAux + @discussion An IOFireWireDeviceAux is for internal use only. You should never subclass IOFireWireDeviceAux +*/ + +class IOFireWireDeviceAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireDeviceAux) + + friend class IOFireWireDevice; + +protected: + + UInt32 fUnitCount; + IOFWSpeed fMaxSpeed; + OSSet * fOpenUnitSet; + AbsoluteTime fResumeTime; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireDevice * primary ); + + virtual void free(); + + virtual bool isTerminated( void ); + + virtual void setTerminationState( TerminationState state ); + + void setMaxSpeed( IOFWSpeed speed ); + + void setUnitCount( UInt32 count ); + + UInt32 getUnitCount( void ); + + bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + + OSSet * getOpenUnitSet() const; + + void latchResumeTime( void ); + + AbsoluteTime getResumeTime( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireDeviceAux, 3); +}; + +#pragma mark - +/*! @class IOFireWireDevice + @abstract Represents a FireWire device. + @discussion The FireWire family tries to read the configuration ROM of each device on the FireWire bus. For each device that responds with + its bus information block, the FireWire family publishes an IOFireWireDevice object in the I/O Registry. An + IOFireWireDevice object keeps track of the device's node ID, copies config ROM properties into the object's property + list, and scans the config ROM for unit directories, publishing an IOFireWireUnit object for each unit directory it finds. +*/ + +class IOFireWireDevice : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireDevice) + + friend class IOFireWireController; + friend class IOFireWireDeviceAux; + +protected: + + enum RegistrationState + { + kDeviceRegistered, + kDeviceNeedsRegisterService, + kDeviceNotRegistered + }; + + IOFireWireROMCache *fDeviceROM; + bool fOpenFromDevice; + UInt32 fOpenFromUnitCount; + UInt32 fROMGeneration; + IORecursiveLock *fROMLock; + RegistrationState fRegistrationState; + UInt32 fROMReadRetry; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + static void readROMDirGlue(void *refcon, IOReturn status, + IOFireWireNub *device, IOFWCommand *fwCmd); + static void readROMThreadFunc(void *arg); + + static void terminateDevice(void *arg); + + void processROM(RomScan *romScan); + + virtual void free(); + +public: + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ); + + virtual void handleClose( IOService * forClient, IOOptionBits options ); + + virtual bool handleIsOpen( const IOService * forClient ) const; + +protected: + virtual IOReturn cacheROM(OSData *rom, UInt32 offset, const UInt32 *&romBase); + + virtual const UInt32 * getROMBase(); + + virtual void setNodeROM(UInt32 generation, UInt16 localNodeID, const IOFWNodeScan *info); + +public: + virtual bool matchPropertyTable(OSDictionary * table); + + /*! @function init + @abstract Initializes the nub. + @param propTable Property table passed to the standard nub initialization. + @param scan Pointer to the node scan structure. + @result Returns true if initialization was successful; false otherwise. + */ + virtual bool init(OSDictionary * propTable, const IOFWNodeScan *scan); + + virtual bool attach(IOService * provider ); + + virtual bool finalize( IOOptionBits options ); + + /*! @function setNodeFlags + @abstract Sets the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + */ + virtual void setNodeFlags( UInt32 flags ); + + /*! @function clearNodeFlags + @abstract Resets the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + */ + virtual void clearNodeFlags( UInt32 flags ); + + /*! @function getNodeFlags + @abstract Retrieves the node's characteristics. + @param flags Refer to "node flags" in IOFireWireFamilyCommon.h. + @result UInt32 The flags set for a particular node. + */ + virtual UInt32 getNodeFlags( void ); + +protected: + virtual IOReturn configureNode( void ); + +public: + /*! @function createPhysicalAddressSpace + @abstract Creates local physical FireWire address spaces for the device to access. + @param mem Memory area allocated to back the physical access by Link hardware. + @result A valid IOFWPhysicalAddressSpace object on success; NULL on failure. + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + + /*! @function createPseudoAddressSpace + @abstract Creates local pseudo FireWire address spaces for the device to access. + @param addr The FireWire address that is mapped to the pseudo address access. + @param len Size of the address space to allocate. + @param reader Read callback, when the device reads from this address space. + @param writer Write callback, when the device writes to this address space. + @param refcon Client's callback object returned during reader/writer callbacks. + @result A valid IOFWPseudoAddressSpace object on success; NULL on failure. + */ + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + +protected: + virtual IOReturn readRootDirectory( IOConfigDirectory * directory, OSDictionary * propTable ); + + virtual IOReturn processRootDirectory( OSDictionary * propTable ); + + virtual IOReturn readUnitDirectories( IOConfigDirectory * directory, OSSet * unitInfo ); + + virtual IOReturn processUnitDirectories( OSSet * unitSet ); + + virtual void setRegistrationState( RegistrationState fRegistrationState ); + + virtual void preprocessDirectories( OSDictionary * rootPropTable, OSSet * unitSet ); + + virtual void configurePhysicalFilter( void ); + +protected: + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + inline bool isTerminated( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->isTerminated(); } + + /*! @function setMaxSpeed + @abstract Sets the maximum speed for this node. + @param speed Maximum speed. Refer to "bus speed numbers" in IOFireWireFamilyCommon.h. + */ + inline void setMaxSpeed( IOFWSpeed speed ) + { ((IOFireWireDeviceAux*)fAuxiliary)->setMaxSpeed( speed ); } + +protected: + inline void setUnitCount( UInt32 count ) + { ((IOFireWireDeviceAux*)fAuxiliary)->setUnitCount( count ); } + + inline OSSet * getOpenUnitSet( void ) const + { return ((IOFireWireDeviceAux*)fAuxiliary)->getOpenUnitSet(); } + +public: + /*! @function getUnitCount + @abstract Returns number of units attached to this device. + @result UInt32 The number of units attached to this device. + */ + inline UInt32 getUnitCount( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->getUnitCount(); } + +protected: + inline AbsoluteTime getResumeTime( void ) + { return ((IOFireWireDeviceAux*)fAuxiliary)->getResumeTime(); } + + inline void latchResumeTime( void ) + { ((IOFireWireDeviceAux*)fAuxiliary)->latchResumeTime(); } + +private: + OSMetaClassDeclareReservedUnused(IOFireWireDevice, 0); + OSMetaClassDeclareReservedUnused(IOFireWireDevice, 1); + +}; + +#endif /* ! _IOKIT_IOFIREWIREDEVICE_H */ diff --git a/i386/include/IOKit/firewire/IOFireWireFamilyCommon.h b/i386/include/IOKit/firewire/IOFireWireFamilyCommon.h new file mode 100644 index 0000000..ceb426d --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireFamilyCommon.h @@ -0,0 +1,1235 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOFireWireFamilyCommon.h + * IOFireWireUserClient/IOFireWireFamily + * + * Created by NWG on Fri Apr 28 2000. + * Copyright (c) 2000-2001 Apple Computer, Inc. All rights reserved. + * + */ +/* + $Log: IOFireWireFamilyCommon.h,v $ + Revision 1.79 2008/07/15 01:29:44 collin + & + + Revision 1.78 2008/05/08 02:33:22 collin + more K64 + + Revision 1.77 2008/04/24 00:01:39 collin + more K640 + + Revision 1.76 2007/12/05 04:52:08 collin + integrate chex workaround + + Revision 1.75 2007/08/31 20:29:06 collin + fixed 5437835 + + Revision 1.74 2007/04/24 21:40:23 arulchan + headerdoc changes + + Revision 1.73 2007/04/24 21:28:24 arulchan + changes for headerdoc + + Revision 1.72 2007/04/13 19:37:01 calderon + Integrated FireWireKPrintf implemented + + Revision 1.71 2007/03/14 18:41:43 collin + *** empty log message *** + + Revision 1.70 2007/02/28 23:10:13 ayanowit + Another IRMAllocation fix. + + Revision 1.69 2007/02/20 01:25:28 collin + *** empty log message *** + + Revision 1.68 2007/02/17 00:26:51 collin + *** empty log message *** + + Revision 1.67 2007/02/15 19:42:07 ayanowit + For 4369537, eliminated support for legacy DCL SendPacketWithHeader, since it didn't work anyway, and NuDCL does support it. + + Revision 1.66 2007/02/15 01:23:39 arulchan + changes in AssignCycleMaster + + Revision 1.65 2007/02/09 04:44:06 collin + *** empty log message *** + + Revision 1.64 2007/01/26 20:52:31 ayanowit + changes to user-space isoch stuff to support 64-bit apps. + + Revision 1.63 2007/01/16 01:41:02 gecko1 + 4159728 Add improved async lock based check for bad IRMs + + Revision 1.62 2007/01/15 23:29:05 arulchan + Fixed Skipped Packet Handler Notifications + + Revision 1.61 2007/01/12 22:15:14 arulchan + Added flag kIOFWEnableBeingRoot + + Revision 1.60 2007/01/10 22:14:44 calderon + Fixed 4046607 Propagate vendor/model from IIDC UnitDepedantInfoDir + Fixed some null termination shinanigans in getIndexValue(string) + + Revision 1.59 2007/01/08 18:47:19 ayanowit + More 64-bit changes for isoch. + + Revision 1.58 2006/07/07 20:18:25 calderon + 4227201: SpeedMap and HopCount table reductions. + + Revision 1.57 2006/04/03 21:29:48 collin + *** empty log message *** + + Revision 1.56 2006/02/09 00:21:51 niels + merge chardonnay branch to tot + + Revision 1.55.4.1 2005/08/06 01:31:31 collin + *** empty log message *** + + Revision 1.55 2005/03/12 03:27:51 collin + *** empty log message *** + + Revision 1.54 2005/01/12 06:34:53 collin + *** empty log message *** + + Revision 1.53 2004/05/04 22:52:19 niels + *** empty log message *** + + Revision 1.52 2004/03/26 01:42:53 gecko1 + Add code to disable any port directly connected to an iPod when we go to sleep. + + Revision 1.51 2004/03/05 00:33:59 calderon + Fixed 3570909 - FireWire - iokit_fw_errs should be defined in hex + All decimal #define errors in header changed to hex + + Revision 1.50 2003/11/07 21:01:18 niels + Revision 1.49 2003/10/21 01:16:41 collin + Revision 1.48 2003/10/17 00:25:24 collin + Revision 1.47 2003/10/15 02:19:45 collin + Revision 1.46 2003/07/22 10:49:47 niels + Revision 1.45 2003/07/21 06:52:59 niels + merge isoch to TOT + + Revision 1.44.4.5 2003/07/21 06:44:44 niels + Revision 1.44.4.4 2003/07/18 00:17:42 niels + Revision 1.44.4.3 2003/07/14 22:08:53 niels + Revision 1.44.4.2 2003/07/09 21:24:01 niels + Revision 1.44.4.1 2003/07/01 20:54:07 niels + isoch merge + + Revision 1.44 2003/03/17 01:05:22 collin + Revision 1.43 2003/03/07 01:26:06 collin + Revision 1.42 2003/02/19 22:33:17 niels + add skip cycle DCL + + Revision 1.41 2003/02/18 00:14:01 collin + Revision 1.40 2003/02/17 21:47:52 collin + Revision 1.39 2002/12/05 19:08:37 niels + remove trailing commas from enums in IOFireWireFamilyCommon.h + + Revision 1.38 2002/11/01 20:45:57 collin + add enhanced IRM with support for the BROADCAST_CHANNEL register + + Revision 1.37 2002/10/01 02:40:27 collin + security mode support + + Revision 1.36 2002/09/25 21:17:14 collin + fix headers again. + + Revision 1.35 2002/09/25 00:27:23 niels + flip your world upside-down + + Revision 1.34 2002/09/12 22:41:53 niels + add GetIRMNodeID() to user client + +*/ + +/*! @header IOFireWireFamilyCommon.h +This file contains useful definitions for working with FireWire +in the kernel and in user space +*/ + +#ifndef __IOFireWireFamilyCommon_H__ +#define __IOFireWireFamilyCommon_H__ + +#ifdef KERNEL +#ifndef __IOKIT_IOTYPES_H + #include +#endif +#else +#include +#endif + +//#define LEGACY_SHUTDOWN + +#define FW_OLD_DCL_DEFS +#define FW_OLD_BIT_DEFS + +// ================================================================= +// bit ranges and fields +// ================================================================= +#pragma mark - +#pragma mark BITS + +// FireWire bit defs. + +#define BIT(x) ( 1 << (x) ) +#define FW_BIT(x) ( 1 << (31 - (x) ) ) + +#define FWBitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (start)) >> \ + ((start) + (31 - (end)))) << \ + (31 - (end)) \ +) + +#define FWBitRangePhase(start, end) \ + (31 - (end)) + +#define BitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (31 - (end))) >> \ + ((31 - (end)) + (start))) << \ + (start) \ +) + + +#define BitRangePhase(start, end) \ + (start) + +// ================================================================= +// FireWire messages & errors +// ================================================================= +#pragma mark - +#pragma mark MESSAGES AND ERRORS + +#define iokit_fw_err(return) (sys_iokit|sub_iokit_firewire|return) + +// e0008010 -> 0xe000801f Response codes from response packets + +// Base of Response error codes +#define kIOFireWireResponseBase iokit_fw_err(0x10) + +// e0008020 -- Bus reset during command execution (current bus generation does +// not match that specified in command.) +#define kIOFireWireBusReset (kIOFireWireResponseBase+kFWResponseBusResetError) + +// e0008001 -- Can't find requested entry in ROM +#define kIOConfigNoEntry iokit_fw_err(0x1) + +// e0008002 -- In pending queue waiting to execute +#define kIOFireWirePending iokit_fw_err(0x2) + +// e0008003 -- Last DCL callback of program (internal use) +#define kIOFireWireLastDCLToken iokit_fw_err(0x3) + +// e0008004 +#define kIOFireWireConfigROMInvalid iokit_fw_err(0x4) + +// e0008005 +#define kIOFireWireAlreadyRegistered iokit_fw_err(0x5) + +// e0008006 +#define kIOFireWireMultipleTalkers iokit_fw_err(0x6) + +// e0008007 +#define kIOFireWireChannelActive iokit_fw_err(0x7) + +// e0008008 +#define kIOFireWireNoListenerOrTalker iokit_fw_err(0x8) + +// e0008009 +#define kIOFireWireNoChannels iokit_fw_err(0x9) + +// e000800A +#define kIOFireWireChannelNotAvailable iokit_fw_err(0xA) + +// e000800B +#define kIOFireWireSeparateBus iokit_fw_err(0xB) + +// e000800C +#define kIOFireWireBadSelfIDs iokit_fw_err(0xC) + +// e000800D +#define kIOFireWireLowCableVoltage iokit_fw_err(0xD) + +// e000800E +#define kIOFireWireInsufficientPower iokit_fw_err(0xE) + +// e000800f +#define kIOFireWireOutOfTLabels iokit_fw_err(0xF) + +// NOTE: errors 1631 used for address space response codes.. (see above) + +// e0008101 +#define kIOFireWireBogusDCLProgram iokit_fw_err(0x101) + +// e0008102 +#define kIOFireWireTalkingAndListening iokit_fw_err(0x102) + +// e0008103 +#define kIOFireWireHardwareSlept iokit_fw_err(0x103) + +// e0008104 // let's resume here... + +// e0008104 -- In the middle of completing +#define kIOFireWireCompleting iokit_fw_err(0x104) + +// e0008105 -- Invalid Response Length +#define kIOFireWireInvalidResponseLength iokit_fw_err(0x105) + +// e0008106 -- Isoch Bandwidth Not Available +#define kIOFireWireIsochBandwidthNotAvailable iokit_fw_err(0x106) + + +// e00087d0 +#define kIOFWMessageServiceIsRequestingClose (UInt32)iokit_fw_err(0x7D0) +#define kIOFWMessagePowerStateChanged (UInt32)iokit_fw_err(0x7D1) +#define kIOFWMessageTopologyChanged (UInt32)iokit_fw_err(0x7D2) +// ================================================================= +// Pseudo address space response codes +// ================================================================= +#pragma mark - +#pragma mark PSEDUO ADDRESS SPACE RESPONSE CODES +enum +{ + kFWResponseComplete = 0, // OK! + kFWResponseConflictError = 4, // Resource conflict, may retry + kFWResponseDataError = 5, // Data not available + kFWResponseTypeError = 6, // Operation not supported + kFWResponseAddressError = 7, // Address not valid in target device + kFWResponseBusResetError = 16, // Pseudo response generated locally + kFWResponsePending = 17 // Pseudo response, real response sent later. +}; + +// +// Pseudo address space response codes +// +enum +{ + kFWAckTimeout = -1, // Pseudo ack generated locally + kFWAckComplete = 1, + kFWAckPending = 2, + kFWAckBusyX = 4, + kFWAckBusyA = 5, + kFWAckBusyB = 6, + kFWAckDataError = 13, + kFWAckTypeError = 14 +}; + +// ================================================================= +// FireWire bus speed numbers +// ================================================================= +#pragma mark - +#pragma mark BUS SPEED NUMBERS + +typedef enum +{ + kFWSpeed100MBit = 0, + kFWSpeed200MBit = 1, + kFWSpeed400MBit = 2, + kFWSpeed800MBit = 3, + kFWSpeedReserved = 3, // In all cases, 1394B Devices report this speed, + // each port of the PHY could be different + + kFWSpeedUnknownMask = 0x80, // If speed was reserved and we haven't probed it further + + kFWSpeedMaximum = 0x7FFFFFFF, + kFWSpeedInvalid = 0x80000000 +} IOFWSpeed; + +// ================================================================= +// FWAddress +// ================================================================= +#pragma mark - +#pragma mark FWADDRESS +// +// The venerable FWAddress structure. This is the standard +// struct to use for passing FireWire addresses. +// + +typedef struct FWAddressStruct +{ + UInt16 nodeID; // bus/node + UInt16 addressHi; // Top 16 bits of node address. + UInt32 addressLo; // Bottom 32 bits of node address + + // + // Useful C++ only constructors + // + #ifdef __cplusplus + FWAddressStruct(const FWAddressStruct & a): + nodeID(a.nodeID), addressHi(a.addressHi), addressLo(a.addressLo) {}; + FWAddressStruct(UInt16 h=0xdead, UInt32 l=0xcafebabe) : + nodeID(0), addressHi(h), addressLo(l) {}; + FWAddressStruct(UInt16 h, UInt32 l, UInt16 n) : + nodeID(n), addressHi(h), addressLo(l) {}; + #endif +} FWAddress, *FWAddressPtr ; + +// ================================================================= +// Config ROM +// ================================================================= +#pragma mark - +#pragma mark CONFIG ROM + +// +// CSR bit defs. +// + +#define CSR_BIT(x) FW_BIT(x) + +#define CSRBitRange(start, end) \ +( \ + ((((UInt32) 0xFFFFFFFF) << (start)) >> \ + ((start) + (31 - (end)))) << \ + (31 - (end)) \ +) + +#define CSRBitRangePhase(start, end) \ + (31 - end) + +// +// Key types. +// + +typedef enum +{ + kConfigImmediateKeyType = 0, + kConfigOffsetKeyType = 1, + kConfigLeafKeyType = 2, + kConfigDirectoryKeyType = 3, + kInvalidConfigROMEntryType = 0xff +} IOConfigKeyType; + +// +// Key values. +// + +enum +{ + kConfigTextualDescriptorKey = 0x01, + kConfigBusDependentInfoKey = 0x02, + kConfigModuleVendorIdKey = 0x03, + kConfigModuleHwVersionKey = 0x04, + kConfigModuleSpecIdKey = 0x05, + kConfigModuleSwVersionKey = 0x06, + kConfigModuleDependentInfoKey = 0x07, + kConfigNodeVendorIdKey = 0x08, + kConfigNodeHwVersionKey = 0x09, + kConfigNodeSpecIdKey = 0x0A, + kConfigNodeSwVersionKey = 0x0B, + kConfigNodeCapabilitiesKey = 0x0C, + kConfigNodeUniqueIdKey = 0x0D, + kConfigNodeUnitsExtentKey = 0x0E, + kConfigNodeMemoryExtentKey = 0x0F, + kConfigNodeDependentInfoKey = 0x10, + kConfigUnitDirectoryKey = 0x11, + kConfigUnitSpecIdKey = 0x12, + kConfigUnitSwVersionKey = 0x13, + kConfigUnitDependentInfoKey = 0x14, + kConfigUnitLocationKey = 0x15, + kConfigUnitPollMaskKey = 0x16, + kConfigModelIdKey = 0x17, + kConfigGenerationKey = 0x38, // Apple-specific + + kConfigRootDirectoryKey = 0xffff // Not a real key +}; + +enum +{ + kConfigSBP2LUN = 0x14, + kConfigSBP2Revision = 0x21, + kConfigSBP2MAO = 0x54 +}; + +// Core CSR registers. +enum +{ + kCSRStateUnitDepend = CSRBitRange(0, 15), + kCSRStateUnitDependPhase = CSRBitRangePhase(0, 15), + + kCSRStateBusDepend = CSRBitRange(16, 23), + kCSRStateBusDependPhase = CSRBitRangePhase(16, 23), + + kCSRStateLost = CSR_BIT(24), + kCSRStateDReq = CSR_BIT(25), + kCSRStateELog = CSR_BIT(27), + kCSRStateAtn = CSR_BIT(28), + kCSRStateOff = CSR_BIT(29), + + kCSRStateState = CSRBitRange(30, 31), + kCSRStateStatePhase = CSRBitRangePhase(30, 31), + kCSRStateStateRunning = 0, + kCSRStateStateInitializing = 1, + kCSRStateStateTesting = 2, + kCSRStateStateDead = 3 +}; + +// Config ROM entry bit locations. + +enum +{ + kConfigBusInfoBlockLength = CSRBitRange (0, 7), + kConfigBusInfoBlockLengthPhase = CSRBitRangePhase (0, 7), + + kConfigROMCRCLength = CSRBitRange (8, 15), + kConfigROMCRCLengthPhase = CSRBitRangePhase (8, 15), + + kConfigROMCRCValue = CSRBitRange (16, 31), + kConfigROMCRCValuePhase = CSRBitRangePhase (16, 31), + + kConfigEntryKeyType = CSRBitRange (0, 1), + kConfigEntryKeyTypePhase = CSRBitRangePhase (0, 1), + + kConfigEntryKeyValue = CSRBitRange (2, 7), + kConfigEntryKeyValuePhase = CSRBitRangePhase (2, 7), + + kConfigEntryValue = CSRBitRange (8, 31), + kConfigEntryValuePhase = CSRBitRangePhase (8, 31), + + kConfigLeafDirLength = CSRBitRange (0, 15), + kConfigLeafDirLengthPhase = CSRBitRangePhase (0, 15), + + kConfigLeafDirCRC = CSRBitRange (16, 31), + kConfigLeafDirCRCPhase = CSRBitRangePhase (16, 31) +}; + +// +// Key types. +// +typedef enum +{ + kCSRImmediateKeyType = 0, + kCSROffsetKeyType = 1, + kCSRLeafKeyType = 2, + kCSRDirectoryKeyType = 3, + kInvalidCSRROMEntryType = 0xff +} IOCSRKeyType; + +// CSR 64-bit fixed address defs. + +enum +{ + kCSRNodeID = CSRBitRange (0, 15), + kCSRNodeIDPhase = CSRBitRangePhase (0, 15), + + kCSRInitialMemorySpaceBaseAddressHi = 0x00000000, + kCSRInitialMemorySpaceBaseAddressLo = 0x00000000, + + kCSRPrivateSpaceBaseAddressHi = 0x0000FFFF, + kCSRPrivateSpaceBaseAddressLo = 0xE0000000, + + kCSRRegisterSpaceBaseAddressHi = 0x0000FFFF, + kCSRRegisterSpaceBaseAddressLo = 0xF0000000, + + kCSRCoreRegistersBaseAddress = kCSRRegisterSpaceBaseAddressLo, + kCSRStateClearAddress = kCSRCoreRegistersBaseAddress + 0x0000, + kCSRStateSetAddress = kCSRCoreRegistersBaseAddress + 0x0004, + kCSRNodeIDsAddress = kCSRCoreRegistersBaseAddress + 0x0008, + kCSRResetStartAddress = kCSRCoreRegistersBaseAddress + 0x000C, + kCSRIndirectAddressAddress = kCSRCoreRegistersBaseAddress + 0x0010, + kCSRIndirectDataAddress = kCSRCoreRegistersBaseAddress + 0x0014, + kCSRSplitTimeoutHiAddress = kCSRCoreRegistersBaseAddress + 0x0018, + kCSRSplitTimeoutLoAddress = kCSRCoreRegistersBaseAddress + 0x001C, + kCSRArgumentHiAddress = kCSRCoreRegistersBaseAddress + 0x0020, + kCSRArgumentLoAddress = kCSRCoreRegistersBaseAddress + 0x0024, + kCSRTestStartAddress = kCSRCoreRegistersBaseAddress + 0x0028, + kCSRTestStatusAddress = kCSRCoreRegistersBaseAddress + 0x002C, + kCSRUnitsBaseHiAddress = kCSRCoreRegistersBaseAddress + 0x0030, + kCSRUnitsBaseLoAddress = kCSRCoreRegistersBaseAddress + 0x0034, + kCSRUnitsBoundHiAddress = kCSRCoreRegistersBaseAddress + 0x0038, + kCSRUnitsBoundLoAddress = kCSRCoreRegistersBaseAddress + 0x003C, + kCSRMemoryBaseHiAddress = kCSRCoreRegistersBaseAddress + 0x0040, + kCSRMemoryBaseLoAddress = kCSRCoreRegistersBaseAddress + 0x0044, + kCSRMemoryBoundHiAddress = kCSRCoreRegistersBaseAddress + 0x0048, + kCSRMemoryBoundLoAddress = kCSRCoreRegistersBaseAddress + 0x004C, + kCSRInterruptTargetAddress = kCSRCoreRegistersBaseAddress + 0x0050, + kCSRInterruptMaskAddress = kCSRCoreRegistersBaseAddress + 0x0054, + kCSRClockValueHiAddress = kCSRCoreRegistersBaseAddress + 0x0058, + kCSRClockValueMidAddress = kCSRCoreRegistersBaseAddress + 0x005C, + kCSRClockTickPeriodMidAddress = kCSRCoreRegistersBaseAddress + 0x0060, + kCSRClockTickPeriodLoAddress = kCSRCoreRegistersBaseAddress + 0x0064, + kCSRClockStrobeArrivedHiAddress = kCSRCoreRegistersBaseAddress + 0x0068, + kCSRClockStrobeArrivedMidAddress = kCSRCoreRegistersBaseAddress + 0x006C, + kCSRClockInfo0Address = kCSRCoreRegistersBaseAddress + 0x0070, + kCSRClockInfo1Address = kCSRCoreRegistersBaseAddress + 0x0074, + kCSRClockInfo2Address = kCSRCoreRegistersBaseAddress + 0x0078, + kCSRClockInfo3Address = kCSRCoreRegistersBaseAddress + 0x007C, + kCSRMessageRequestAddress = kCSRCoreRegistersBaseAddress + 0x0080, + kCSRMessageResponseAddress = kCSRCoreRegistersBaseAddress + 0x00C0, + kCSRErrorLogBufferAddress = kCSRCoreRegistersBaseAddress + 0x0180, + + kCSRBusDependentRegistersBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x0200, + kCSRBusyTimeout = kCSRRegisterSpaceBaseAddressLo + 0x0210, + kCSRBusManagerID = kCSRRegisterSpaceBaseAddressLo + 0x021C, + kCSRBandwidthAvailable = kCSRRegisterSpaceBaseAddressLo + 0x0220, + kCSRChannelsAvailable31_0 = kCSRRegisterSpaceBaseAddressLo + 0x0224, + kCSRChannelsAvailable63_32 = kCSRRegisterSpaceBaseAddressLo + 0x0228, + kCSRBroadcastChannel = kCSRRegisterSpaceBaseAddressLo + 0x0234, + + kConfigROMBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x0400, + kConfigBIBHeaderAddress = kConfigROMBaseAddress, + kConfigBIBBusNameAddress = kConfigROMBaseAddress + 4, + + kPCRBaseAddress = kCSRRegisterSpaceBaseAddressLo + 0x900, + kFCPCommandAddress = kCSRRegisterSpaceBaseAddressLo + 0xb00, + kFCPResponseAddress = kCSRRegisterSpaceBaseAddressLo + 0xd00 +}; + +// from figure 10-7 of 1394a +#define kBroadcastChannelInitialValues 0x8000001f +#define kBroadcastChannelValidMask 0x40000000 + +// CSR defined 64 bit unique ID. + +typedef UInt64 CSRNodeUniqueID; + +// FireWire core CSR registers. + +enum +{ + kFWCSRStateGone = FW_BIT(16), + kFWCSRStateLinkOff = FW_BIT(22), + kFWCSRStateCMstr = FW_BIT(23) +}; + +// FireWire bus/nodeID address defs. + +enum +{ + kFWAddressBusID = FWBitRange (16, 25) << kCSRNodeIDPhase, + kFWAddressBusIDPhase = FWBitRangePhase (16, 25) + kCSRNodeIDPhase, + + kFWAddressNodeID = FWBitRange (26, 31) << kCSRNodeIDPhase, + kFWAddressNodeIDPhase = FWBitRangePhase (26, 31) + kCSRNodeIDPhase, + + kFWLocalBusID = 1023, + kFWBroadcastNodeID = 63, + kFWBadNodeID = 0xffff, + + kFWLocalBusAddress = kFWLocalBusID << kFWAddressBusIDPhase, + kFWBroadcastAddress = kFWBroadcastNodeID << kFWAddressNodeIDPhase +}; + +#define FWNodeBaseAddress(busID, nodeID) \ +( \ + (busID << kFWAddressBusIDPhase) | \ + (nodeID << kFWAddressNodeIDPhase) \ +) + +#define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID) \ +( \ + FWNodeBaseAddress (busID, nodeID) | \ + kCSRRegisterSpaceBaseAddressHi \ +) + +// FireWire CSR bus info block defs. + +enum +{ + kFWBIBHeaderAddress = kConfigBIBHeaderAddress, + kFWBIBBusNameAddress = kConfigBIBBusNameAddress, + kFWBIBNodeCapabilitiesAddress = kConfigROMBaseAddress + 8, + kFWBIBNodeUniqueIDHiAddress = kConfigROMBaseAddress + 12, + kFWBIBNodeUniqueIDLoAddress = kConfigROMBaseAddress + 16, + + kFWBIBBusName = 0x31333934, //'1394' + + kFWBIBIrmc = FW_BIT(0), + kFWBIBCmc = FW_BIT(1), + kFWBIBIsc = FW_BIT(2), + kFWBIBBmc = FW_BIT(3), + kFWBIBCycClkAcc = FWBitRange (8, 15), + kFWBIBCycClkAccPhase = FWBitRangePhase (8, 15), + kFWBIBMaxRec = FWBitRange (16, 19), + kFWBIBMaxRecPhase = FWBitRangePhase (16, 19), + kFWBIBMaxROM = FWBitRange (20, 21), + kFWBIBMaxROMPhase = FWBitRangePhase (20, 21), + kFWBIBGeneration = FWBitRange (24, 27), + kFWBIBGenerationPhase = FWBitRangePhase (24, 27), + kFWBIBLinkSpeed = FWBitRange (29, 31), + kFWBIBLinkSpeedPhase = FWBitRangePhase (29, 31) +}; + +enum +{ + kConfigUnitSpecAppleA27 = 0x000a27, + kConfigUnitSpec1394TA1 = 0x00a02d, + + kConfigUnitSWVersMacintosh10 = 10, + kConfigUnitSWVersIIDC100 = 0x000100, + kConfigUnitSWVersIIDC101 = 0x000101, + kConfigUnitSWVersIIDC102 = 0x000102 +}; + + +// ================================================================= +// Isoch defines +// ================================================================= +#pragma mark - +#pragma mark ISOCH + +enum +{ + kFWIsochDataLength = FWBitRange (0, 15), + kFWIsochDataLengthPhase = FWBitRangePhase (0, 15), + + kFWIsochTag = FWBitRange (16, 17), + kFWIsochTagPhase = FWBitRangePhase (16, 17), + + kFWIsochChanNum = FWBitRange (18, 23), + kFWIsochChanNumPhase = FWBitRangePhase (18, 23), + + kFWIsochTCode = FWBitRange (24, 27), + kFWIsochTCodePhase = FWBitRangePhase (24, 27), + + kFWIsochSy = FWBitRange (28, 31), + kFWIsochSyPhase = FWBitRangePhase (28, 31) +}; + +#define CHAN_BIT(x) (((UInt64)1) << (63 - (x)) +#define CHAN_MASK(x) (~CHAN_BIT(X)) + +typedef enum +{ + kFWNeverMultiMode = 0, + kFWAllowMultiMode, + kFWSuggestMultiMode, + kFWAlwaysMultiMode, + + kFWDefaultIsochResourceFlags = kFWNeverMultiMode +} IOFWIsochResourceFlags ; + +enum +{ + kFWIsochChannelDefaultFlags = 0, + kFWIsochChannelDoNotResumeOnWake = BIT(1) +} ; + +typedef enum +{ + kFWIsochPortDefaultOptions = 0, + kFWIsochPortUseSeparateKernelThread = BIT(1), + kFWIsochEnableRobustness = BIT(2), + kFWIsochBigEndianUpdates = BIT(3), // private + kFWIsochRequireLastContext = BIT(4), // private +} IOFWIsochPortOptions ; + +// ================================================================= +// DCL opcode defs. +// ================================================================= +#pragma mark - +#pragma mark DCL OPCODES + +enum +{ + kFWDCLImmediateEvent = 0, + kFWDCLCycleEvent = 1, + kFWDCLSyBitsEvent = 2 +}; + +typedef enum +{ + kFWDCLInvalidNotification = 0 + , kFWDCLUpdateNotification = 1 + , kFWDCLModifyNotification = 2 + , kFWNuDCLModifyNotification = 3 + , kFWNuDCLModifyJumpNotification = 4 + , kFWNuDCLUpdateNotification = 5 +} IOFWDCLNotificationType ; + +enum +{ + kFWDCLOpDynamicFlag = BIT(16), + kFWDCLOpVendorDefinedFlag = BIT(17), + kFWDCLOpFlagMask = BitRange (16, 31), + kFWDCLOpFlagPhase = BitRangePhase (16, 31) +}; + +enum +{ + kDCLInvalidOp = 0, + kDCLSendPacketStartOp = 1, + //kDCLSendPacketWithHeaderStartOp = 2, // Deprecated legacy DCL opcode! Use NuDCL instead! + kDCLSendPacketOp = 3, + kDCLSendBufferOp = 4, // obsolete - do not use + kDCLReceivePacketStartOp = 5, + kDCLReceivePacketOp = 6, + kDCLReceiveBufferOp = 7, // obsolete - do not use + kDCLCallProcOp = 8, + kDCLLabelOp = 9, + kDCLJumpOp = 10, + kDCLSetTagSyncBitsOp = 11, + kDCLUpdateDCLListOp = 12, + kDCLTimeStampOp = 13, + kDCLPtrTimeStampOp = 14, + kDCLSkipCycleOp = 15, + + kDCLNuDCLLeaderOp = 20 // compilerData field contains NuDCLRef to start of NuDCL + // program. + // Should not need to use this directly. +}; + +#ifdef FW_OLD_DCL_DEFS + +//typedef struct DCLCommandStruct ; +//typedef void (DCLCallCommandProc)(DCLCommandStruct* command); + +#else + +//typedef struct DCLCommand ; +//typedef void (DCLCallCommandProc)(DCLCommand* command); + +#endif + +// ================================================================= +// DCL structs +// ================================================================= +#pragma mark - +#pragma mark DCL + +#ifdef __LP64__ +typedef void* DCLCallProcDataType; +#else +typedef UInt32 DCLCallProcDataType; +#endif + +#ifdef KERNEL + #ifdef __LP64__ + typedef void* DCLCompilerDataType; + #else + typedef UInt32 DCLCompilerDataType; + #endif +#else + typedef UInt32 DCLCompilerDataType; +#endif + +typedef struct DCLCommandStruct +{ + struct DCLCommandStruct * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 operands[1]; // DCL operands (size varies) +} DCLCommand; + +typedef void (DCLCallCommandProc)(DCLCommand * command); + +typedef struct DCLTransferPacketStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + void * buffer; // Packet buffer. + UInt32 size; // Buffer size. +} DCLTransferPacket ; + +typedef struct DCLTransferBufferStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + void * buffer; // Buffer. + UInt32 size; // Buffer size. + UInt16 packetSize; // Size of packets to send. + UInt16 reserved; + UInt32 bufferOffset; // Current offset into buffer. +} DCLTransferBuffer ; + +typedef struct DCLCallProcStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLCallCommandProc * proc; // Procedure to call. + DCLCallProcDataType procData; // Data for use by called procedure. +} DCLCallProc; + +typedef struct DCLLabelStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. +} DCLLabel; + +typedef struct DCLJumpStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLLabel * pJumpDCLLabel; // DCL label to jump to. +} DCLJump; + +typedef struct DCLSetTagSyncBitsStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt16 tagBits; // Tag bits for following packets. + UInt16 syncBits; // Sync bits for following packets. +} DCLSetTagSyncBits; + +typedef struct DCLUpdateDCLListStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + DCLCommand ** dclCommandList; // List of DCL commands to update. + UInt32 numDCLCommands; // Number of DCL commands in list. +} DCLUpdateDCLList; + +typedef struct DCLTimeStampStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 timeStamp; // Time stamp. +} DCLTimeStamp; + +typedef struct DCLPtrTimeStampStruct +{ + DCLCommand * pNextDCLCommand; // Next DCL command. + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 * timeStampPtr; // Where to store the time stamp. +} DCLPtrTimeStamp ; + +typedef struct +{ + DCLCommand * pNextDCLCommand ; // unused - always NULL + DCLCompilerDataType compilerData; // Data for use by DCL compiler. + UInt32 opcode ; // must be kDCLNuDCLLeaderOp + void* program ; // NuDCL program here... +} DCLNuDCLLeader ; + +#ifdef FW_OLD_DCL_DEFS + +// should not use these... + +typedef DCLCommand* DCLCommandPtr ; +typedef DCLTransferBuffer* DCLTransferBufferPtr ; +typedef DCLTransferPacket* DCLTransferPacketPtr ; +typedef DCLCallProc* DCLCallProcPtr ; +typedef DCLLabel* DCLLabelPtr ; +typedef DCLJump* DCLJumpPtr ; +typedef DCLSetTagSyncBits* DCLSetTagSyncBitsPtr ; +typedef DCLUpdateDCLList* DCLUpdateDCLListPtr ; +typedef DCLTimeStamp* DCLTimeStampPtr ; +typedef DCLPtrTimeStamp* DCLPtrTimeStampPtr ; +typedef DCLCallCommandProc* DCLCallCommandProcPtr ; + +#endif + + +// ================================================================= +// User-Lib Export DCL structs - Thses structus are used to pass +// a user-created legacy DCL program down into kernel space. These +// structs allow support for both 32-bit and 64-bit user-space clients. +// These structs should only be used internally. They are not for +// clients to create DCL programs with. +// ================================================================= + +typedef struct UserExportDCLCommandStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 operands[1]; // DCL operands (size varies) +} __attribute__ ((packed)) UserExportDCLCommand; + +typedef void (UserExportDCLCallCommandProc)(UserExportDCLCommand * command); + +typedef struct UserExportDCLTransferPacketStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t buffer; // Packet buffer. + UInt32 size; // Buffer size. +} __attribute__ ((packed)) UserExportDCLTransferPacket ; + +typedef struct UserExportDCLTransferBufferStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t buffer; // Buffer. + UInt32 size; // Buffer size. + UInt16 packetSize; // Size of packets to send. + UInt16 reserved; + UInt32 bufferOffset; // Current offset into buffer. +} __attribute__ ((packed)) UserExportDCLTransferBuffer ; + +typedef struct UserExportDCLCallProcStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t proc; // Procedure to call. + uint64_t procData; // Data for use by called procedure. +} __attribute__ ((packed)) UserExportDCLCallProc; + +typedef struct UserExportDCLLabelStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. +} __attribute__ ((packed)) UserExportDCLLabel; + +typedef struct UserExportDCLJumpStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t pJumpDCLLabel; // DCL label to jump to. +} __attribute__ ((packed)) UserExportDCLJump; + +typedef struct UserExportDCLSetTagSyncBitsStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt16 tagBits; // Tag bits for following packets. + UInt16 syncBits; // Sync bits for following packets. +} __attribute__ ((packed)) UserExportDCLSetTagSyncBits; + +typedef struct UserExportDCLUpdateDCLListStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t dclCommandList; // List of DCL commands to update. + UInt32 numDCLCommands; // Number of DCL commands in list. +} __attribute__ ((packed)) UserExportDCLUpdateDCLList; + +typedef struct UserExportDCLTimeStampStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + UInt32 timeStamp; // Time stamp. +} __attribute__ ((packed)) UserExportDCLTimeStamp; + +typedef struct UserExportDCLPtrTimeStampStruct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand; // Next DCL command. + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode; // DCL opcode. + mach_vm_address_t timeStampPtr; // Where to store the time stamp. +} __attribute__ ((packed)) UserExportDCLPtrTimeStamp ; + +typedef struct +{ + mach_vm_address_t pClientDCLStruct; // A pointer to the client's DCL struct + mach_vm_address_t pNextDCLCommand ; // unused - always NULL + uint64_t compilerData; // Data for use by DCL compiler. + UInt32 opcode ; // must be kDCLNuDCLLeaderOp + mach_vm_address_t program ; // NuDCL program here... +} __attribute__ ((packed)) UserExportDCLNuDCLLeader ; + + +// ================================================================= +// NuDCL +// ================================================================= +#pragma mark - +#pragma mark NUDCL + +typedef struct __NuDCL * NuDCLRef ; +typedef NuDCLRef NuDCLSendPacketRef ; +typedef NuDCLRef NuDCLSkipCycleRef ; +typedef NuDCLRef NuDCLReceivePacketRef ; + +typedef void (*NuDCLCallback)( void* refcon, NuDCLRef dcl ); + +typedef enum +{ + kNuDCLDynamic = BIT( 1 ), + kNuDCLUpdateBeforeCallback = BIT( 2 ) + +} NuDCLFlags ; + +// ================================================================= +// Miscellaneous +// ================================================================= +#pragma mark - +#pragma mark MISCELLANEOUS + +typedef void* FWClientCommandID ; + +typedef struct IOFireWireSessionRefOpaqueStuct* IOFireWireSessionRef ; + +// +// bus management constants. +// + +enum +{ + kFWBusManagerArbitrationTimeoutDuration = 625 // durationMillisecond +}; + +// +// bus characteristics. +// + +enum +{ + kFWMaxBusses = 1023, + kFWMaxNodesPerBus = 63, + kFWMaxNodeHops = 16 +}; + +/*! @enum NodeFlags + + @abstract Flags that specify characteristics of the FireWire device node. + + @constant kIOFWDisablePhysicalAccess Disable physical memory access + + @constant kIOFWDisableAllPhysicalAccess Disable all physical memory access + + @constant kIOFWEnableRetryOnAckD Enable retry on Ack D + + @constant kIOFWLimitAsyncPacketSize Limit async packet size + + @constant kIOFWDisablePhyOnSleep Disable Phy, when machine is in Sleep mode + + @constant kIOFWMustBeRoot Attempt to make this device root, There is no guarentee Mac OS will succeed in making the device + root. + + @constant kIOFWMustNotBeRoot Attempt to prevent this device from being root, There is no guarentee Mac OS will succeed in preventing the device + from being root. + + @constant kIOFWMustHaveGap63 Attempt to ensure the gap count is 63, when this device is on the bus. Gap 63 reduces bus performance significantly, + so this flag should be used only when absolutely necessary. There is no guarentee Mac OS will succeed in forcing + the gap count to 63. +*/ +enum +{ + kIOFWDisablePhysicalAccess = (1 << 0), + kIOFWDisableAllPhysicalAccess = (1 << 1), + kIOFWEnableRetryOnAckD = (1 << 2), + kIOFWLimitAsyncPacketSize = (1 << 3), + kIOFWDisablePhyOnSleep = (1 << 4), + kIOFWMustBeRoot = (1 << 5), + kIOFWMustNotBeRoot = (1 << 6), + kIOFWMustHaveGap63 = (1 << 7) +}; + +// +// write flags +// + +enum IOFWWriteFlags +{ + kIOFWWriteFlagsNone = 0x00000000, + kIOFWWriteFlagsDeferredNotify = 0x00000001, + kIOFWWriteFastRetryOnBusy = 0x00000002, + kIOFWWriteBlockRequest = 0x00000004, // force a block request +}; + +// +// read flags +// + +enum IOFWReadFlags +{ + kIOFWReadFlagsNone = 0x00000000, + kIOFWReadBlockRequest = 0x00000004, // force a block request + kIOFWReadPingTime = 0x00000008 // ping time +}; + +// +// security modes +// + +enum IOFWSecurityMode +{ + kIOFWSecurityModeNormal = 0, + kIOFWSecurityModeSecure = 1, + kIOFWSecurityModeSecurePermanent = 2 +}; + +// +// physical access settings +// + +enum IOFWPhysicalAccessMode +{ + kIOFWPhysicalAccessEnabled = 0, + kIOFWPhysicalAccessDisabled = 1, + kIOFWPhysicalAccessDisabledForGeneration = 2 +}; + +enum +{ + kIOFWSpecID_AAPL = 0xa27, + kIOFWSWVers_KPF = 0x40 +}; + +// old style bit defs +#ifdef FW_OLD_BIT_DEFS + + #define kBit0 BIT(0) + #define kBit1 BIT(1) + #define kBit2 BIT(2) + #define kBit3 BIT(3) + #define kBit4 BIT(4) + #define kBit5 BIT(5) + #define kBit6 BIT(6) + #define kBit7 BIT(7) + #define kBit8 BIT(8) + #define kBit9 BIT(9) + #define kBit10 BIT(10) + #define kBit11 BIT(11) + #define kBit12 BIT(12) + #define kBit13 BIT(13) + #define kBit14 BIT(14) + #define kBit15 BIT(15) + #define kBit16 BIT(16) + #define kBit17 BIT(17) + #define kBit18 BIT(18) + #define kBit19 BIT(19) + #define kBit20 BIT(20) + #define kBit21 BIT(21) + #define kBit22 BIT(22) + #define kBit23 BIT(23) + #define kBit24 BIT(24) + #define kBit25 BIT(25) + #define kBit26 BIT(26) + #define kBit27 BIT(27) + #define kBit28 BIT(28) + #define kBit29 BIT(29) + #define kBit30 BIT(30) + #define kBit31 BIT(31) + +#endif + +#endif //__IOFireWireFamilyCommon_H__ diff --git a/i386/include/IOKit/firewire/IOFireWireIRMAllocation.h b/i386/include/IOKit/firewire/IOFireWireIRMAllocation.h new file mode 100644 index 0000000..c67986c --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireIRMAllocation.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREIRMALLOCATION_H +#define _IOKIT_IOFIREWIREIRMALLOCATION_H + +#include + +class IOFireWireController; + +//#include +//#include + +/*! @class IOFireWireIRMAllocation +*/ + +class IOFireWireIRMAllocation : public OSObject +{ + friend class IOFireWireController; + + OSDeclareDefaultStructors(IOFireWireIRMAllocation) + +public: + + // Prototype for the callback if reallocation after bus-reset is unsuccessful. + typedef IOReturn (*AllocationLostNotificationProc)(void* refCon, class IOFireWireIRMAllocation* allocation); + + // Initialize the IRM allocation object. + virtual bool init( IOFireWireController * control, + Boolean releaseIRMResourcesOnFree = true, + AllocationLostNotificationProc allocationLostProc = NULL, + void *pLostProcRefCon = NULL); + + // Specify whether of not the IRM resources should automatically + // be released when freeing this allocation object. + virtual void setReleaseIRMResourcesOnFree(Boolean doRelease); + + // Use the IRMAllocation object to allocate isoch resources + virtual IOReturn allocateIsochResources(UInt8 isochChannel, UInt32 bandwidthUnits); + + // Free isoch resources previously allocated with a call to allocateIsochResources + virtual IOReturn deallocateIsochResources(void); + + // Returns true if isoch resources are currently allocated, and if true, the allocated channel, and amount of isoch bandwidth. + virtual Boolean areIsochResourcesAllocated(UInt8 *pAllocatedIsochChannel, UInt32 *pAllocatedBandwidthUnits); + + // Get the refcon + virtual void * GetRefCon(void); + virtual void SetRefCon(void* refCon); + + // Override the base-class release function for special processing + virtual void release() const; + +protected: + + /*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + // Free the allocation object (and release IRM resources if needed) + virtual void free( void ); + + // Controller will call this to notify about bus-reset complete. + virtual void handleBusReset(UInt32 generation); + + virtual void failedToRealloc(void); + virtual UInt32 getAllocationGeneration(void); + static void threadFunc( void * arg ); + +private: + + AllocationLostNotificationProc fAllocationLostProc; + void *fLostProcRefCon; + Boolean fReleaseIRMResourcesOnFree; + UInt8 fIsochChannel; + UInt32 fBandwidthUnits; + UInt32 fAllocationGeneration; + IORecursiveLock *fLock ; + IOFireWireController *fControl; + Boolean isAllocated; + + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 0); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 1); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 2); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 3); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 4); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 5); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 6); + OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 7); +}; + +#endif // _IOKIT_IOFIREWIREIRMALLOCATION_H diff --git a/i386/include/IOKit/firewire/IOFireWireLocalNode.h b/i386/include/IOKit/firewire/IOFireWireLocalNode.h new file mode 100644 index 0000000..339fb9e --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireLocalNode.h @@ -0,0 +1,143 @@ +/* + * IOFireWireLocalNode.h + * IOFireWireFamily + * + * Created by Niels on Fri Aug 16 2002. + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + $Log: IOFireWireLocalNode.h,v $ + Revision 1.8 2009/03/26 22:45:17 calderon + User client fails to terminate with unexpected consuequences + + Revision 1.7 2008/11/14 00:17:12 arulchan + fix for rdar://5939334 + + Revision 1.6 2005/02/18 22:56:53 gecko1 + 3958781 Q45C EVT: FireWire ASP reporter says port speed is 800 Mb/sec + + Revision 1.5 2003/02/20 02:00:12 collin + *** empty log message *** + + Revision 1.4 2003/02/17 21:47:53 collin + *** empty log message *** + + Revision 1.3 2002/10/18 23:29:44 collin + fix includes, fix cast which fails on new compiler + + Revision 1.2 2002/09/25 00:27:24 niels + flip your world upside-down + +*/ + +// public +#import + +class IOFireWireLocalNode; + +#pragma mark - + +/*! + @class IOFireWireLocalNodeAux +*/ + +class IOFireWireLocalNodeAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireLocalNodeAux) + + friend class IOFireWireLocalNode; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireLocalNode * primary ); + virtual void free(); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireLocalNodeAux, 3); + +}; + +#pragma mark - + +/*! @class IOFireWireLocalNode +*/ + +class IOFireWireLocalNode : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireLocalNode) + + friend class IOFireWireLocalNodeAux; + + /*------------------Useful info about device (also available in the registry)--------*/ +protected: + + /*-----------Methods provided to FireWire device clients-------------*/ +public: + + // Set up properties affected by bus reset + virtual void setNodeProperties(UInt32 generation, UInt16 nodeID, UInt32 *selfIDs, int numIDs, IOFWSpeed maxSpeed ); + + /* + * Standard nub initialization + */ + virtual bool init(OSDictionary * propTable); + virtual bool attach(IOService * provider ); + + virtual void handleClose( IOService * forClient, + IOOptionBits options ) ; + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ) ; + virtual bool handleIsOpen( const IOService * forClient ) const; + + /* + * Trick method to create protocol user clients + */ + virtual IOReturn setProperties( OSObject * properties ); + +protected: + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + virtual void free(); + +protected: + OSSet * fOpenClients; +}; diff --git a/i386/include/IOKit/firewire/IOFireWireMultiIsochReceive.h b/i386/include/IOKit/firewire/IOFireWireMultiIsochReceive.h new file mode 100644 index 0000000..e003660 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireMultiIsochReceive.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREMULTIISOCHRECEIVE_H_ +#define _IOKIT_IOFIREWIREMULTIISOCHRECEIVE_H_ + +class IOFireWireMultiIsochReceiveListener; +class IOFireWireMultiIsochReceivePacket; +class IOFireWireController; + +typedef IOReturn (*FWMultiIsochReceiveListenerCallback)(void *refcon, IOFireWireMultiIsochReceivePacket *pPacket); + +// These are the parameters clients can set which help us to optimize the mult-isoch-receiver +// polling interval, and memory resources +typedef struct FWMultiIsochReceiveListenerParamsStruct + { + // How much latency, from when the packet arrives to when the client is notified, can the client tolerate. + UInt32 maxLatencyInFireWireCycles; + + // In bits per second, the expected bit-rate of the incoming stream + UInt32 expectedStreamBitRate; + + // How long does the client expect to hold onto packets objects before returning them back to the receiver + UInt32 clientPacketReturnLatencyInFireWireCycles; + }FWMultiIsochReceiveListenerParams; + +/*! @class IOFireWireMultiIsochReceiveListener +*/ + +class IOFireWireMultiIsochReceiveListener : public OSObject + { + friend class IOFireWireLink; + + protected: + OSDeclareDefaultStructors(IOFireWireMultiIsochReceiveListener) + bool init(IOFireWireController *fwController, + UInt32 receiveChannel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams); + void free(); + public: + static IOFireWireMultiIsochReceiveListener *create(IOFireWireController *fwController, + UInt32 channel, + FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon, + FWMultiIsochReceiveListenerParams *pListenerParams); + + // Call this to activate the listener + IOReturn Activate(); + + // Call this to deactivate the listener + IOReturn Deactivate(); + + // Call this to modify the callback/refcon pointers. Only call this when not activated! + IOReturn SetCallback(FWMultiIsochReceiveListenerCallback callback, + void *pCallbackRefCon); + + // Accessors + inline UInt32 getReceiveChannel(void) {return fChannel;}; + inline FWMultiIsochReceiveListenerCallback getCallback(void){return fClientCallback;}; + inline void * getRefCon(void){return fClientCallbackRefCon;}; + inline bool getActivatedState(void) {return fActivated;}; + + protected: + IOFireWireController *fControl; + UInt32 fChannel; + FWMultiIsochReceiveListenerCallback fClientCallback; + void *fClientCallbackRefCon; + bool fActivated; + FWMultiIsochReceiveListenerParams *fListenerParams; + }; + +#define kMaxRangesPerMultiIsochReceivePacket 6 + +/*! @class IOFireWireMultiIsochReceivePacket +*/ + +class IOFireWireMultiIsochReceivePacket : public OSObject + { + OSDeclareDefaultStructors(IOFireWireMultiIsochReceivePacket) + bool init(IOFireWireController *fwController); + void free(); + public: + static IOFireWireMultiIsochReceivePacket *create(IOFireWireController *fwController); + + // The clients who are passed this packet by the + // multi-isoch receiver calling their callback + // MUST call clientDone() on this packet to + // return it back for reuse! + void clientDone(void); + + UInt32 isochChannel(void); + UInt32 packetReceiveTime(void); + + UInt32 isochPayloadSize(void); // The size of just the isoch payload, not including header/trailer quads. + inline UInt32 isochPacketSize(void) {return isochPayloadSize()+8; }; // The size of the packet, including header/trailer quads. + + // This returns a memory descriptor to the client. The client must call complete(), and release() on the + // memory descriptor when done. + IOMemoryDescriptor *createMemoryDescriptorForRanges(void); + + // These should be treated as read-only by clients, + // as should the data contained in these buffers! + IOAddressRange ranges[kMaxRangesPerMultiIsochReceivePacket] ; + UInt32 numRanges; + + // These should be treated private for clients! + // Messing with them will screw up the bookkeepping + // in the Multi-Isoch Receiver! + UInt32 numClientReferences; + void* elements[kMaxRangesPerMultiIsochReceivePacket]; + + protected: + IOFireWireController *fControl; + }; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/firewire/IOFireWireNub.h b/i386/include/IOKit/firewire/IOFireWireNub.h new file mode 100644 index 0000000..7df983b --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireNub.h @@ -0,0 +1,293 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWireNub.h + * + * + * Note: IOFWCommand(s) are allocated by methods in this class. + * The remaining methods to setup and submit IOFWCommands are defined in + * IOFWCommand.h + */ +#ifndef _IOKIT_IOFIREWIRENUB_H +#define _IOKIT_IOFIREWIRENUB_H + +// public +#include +#include +#include + +class IOFireWireController; +class IOFireWireBus; +class IOConfigDirectory; +class IOFireWireNub; +class IOFireWireDevice; +class IOFireWireUnit; +class IOFWSimplePhysicalAddressSpace; +class IOFWSimpleContiguousPhysicalAddressSpace; + +enum TerminationState +{ + kNotTerminated = 0, + kNeedsTermination, + kTerminated +}; + +#pragma mark - + +/*! + @class IOFireWireNubAux +*/ + +class IOFireWireNubAux : public OSObject +{ + OSDeclareDefaultStructors(IOFireWireNubAux) + + friend class IOFireWireNub; + +protected: + + IOFireWireNub * fPrimary; + TerminationState fTerminationState; + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireNub * primary ); + virtual void free(); + + virtual UInt32 hopCount( IOFireWireNub * nub ); + virtual UInt32 hopCount( void ); + + virtual TerminationState getTerminationState( void ); + virtual void setTerminationState( TerminationState state ); + + virtual bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 3); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 4); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 5); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 6); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 7); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 8); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 9); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 10); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 11); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 12); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 13); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 14); + OSMetaClassDeclareReservedUnused(IOFireWireNubAux, 15); + +}; + +#pragma mark - + +/*! @class IOFireWireNub +*/ +class IOFireWireNub : public IOService +{ + OSDeclareAbstractStructors(IOFireWireNub) + + friend class IOFireWireController; + friend class IOFireWireNubAux; + friend class IOFireWireDeviceAux; + friend class IOFireWireUnitAux; + friend class IOFireWireDevice; + friend class IOFireWireUnit; + +/*------------------Useful info about device (also available in the registry)--------*/ +protected: + int fDeviceSpeed; // Max supported by device + int fCommsSpeed; // Max speed this node can communicate with device + UInt16 fNodeID; // Current node ID (could change after bus reset!) + UInt16 fLocalNodeID; // ID of the local node (could change after bus reset!) + UInt32 fGeneration; // ID Of bus topology that fNodeID is valid for. + CSRNodeUniqueID fUniqueID; // Device's globally unique ID (never changes) + mach_timespec_t fAsyncTimeout; // Guesstimate of how long to wait for response + // from device when making async requests + // Different values for quad/block transfers? + // OS8 FW has 40/100 mSec. + + int fMaxReadPackLog; + int fMaxWritePackLog; + int fMaxReadROMPackLog; + + IOFireWireController *fControl; + IOConfigDirectory *fDirectory; + + UInt32 fNodeFlags; + + OSSet * fConfigDirectorySet; + + IOFireWireNubAux * fAuxiliary; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual void free(); + +/*------------------Methods provided to FireWire device clients-----------------------*/ +public: + + // Get nodeID and bus generation info + IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID, UInt16 &localID) const; + IOReturn getNodeIDGeneration(UInt32 &generation, UInt16 &nodeID) const; + + // How fast can this system talk to the node? + virtual IOFWSpeed FWSpeed() const; + + // How fast can this node talk to another node? + virtual IOFWSpeed FWSpeed(const IOFireWireNub *dst) const; + + // How big (as a power of two) can packets sent to/received from the node be? + virtual int maxPackLog(bool forSend) const; + + // How big (as a power of two) can packets sent to/received from a specified address in the node be? + virtual int maxPackLog(bool forSend, FWAddress address) const; + + // How big (as a power of two) can packets sent from this node to dst node/received from dst be? + virtual int maxPackLog(bool forSend, const IOFireWireNub *dst) const; + + // Set maximum packet size nub can handle + virtual void setMaxPackLog(bool forSend, bool forROM, int maxPackLog); + + /* + * Create various FireWire commands to send to the device + */ + virtual IOFWReadCommand *createReadCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOFWReadQuadCommand *createReadQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + virtual IOFWWriteCommand *createWriteCommand(FWAddress devAddress, IOMemoryDescriptor *hostMem, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + virtual IOFWWriteQuadCommand *createWriteQuadCommand(FWAddress devAddress, UInt32 *quads, int numQuads, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + + // size is 1 for 32 bit compare, 2 for 64 bit. + virtual IOFWCompareAndSwapCommand *createCompareAndSwapCommand(FWAddress devAddress, + const UInt32 *cmpVal, const UInt32 *newVal, int size, + FWDeviceCallback completion=NULL, void *refcon=NULL, + bool failOnReset=false); + /* + * Create local FireWire address spaces for the device to access + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + + /* + * Get Config directory for nub + * Device nub directory is root directory, Unit nub directory is Unit directory. + * + * Depricated use getConfigDirectoryRef + * + */ + + virtual IOReturn getConfigDirectory(IOConfigDirectory *&dir); + + /* + * Get bus for nub + */ + IOFireWireBus * getBus() const; + + IOFireWireController * getController() const; + + const CSRNodeUniqueID &getUniqueID() const; + + /* + * Standard nub initialization + */ + virtual bool init(OSDictionary * propTable); + + virtual void setNodeFlags( UInt32 flags ); + virtual UInt32 getNodeFlags( void ); + virtual void clearNodeFlags( UInt32 flags ); + + virtual IOReturn setConfigDirectory( IOConfigDirectory *directory ); + + virtual IOReturn getConfigDirectoryRef( IOConfigDirectory *&dir ); + + inline UInt32 hopCount( IOFireWireNub * nub ) + { return fAuxiliary->hopCount( nub ); } + + inline UInt32 hopCount( void ) + { return fAuxiliary->hopCount(); } + + inline TerminationState getTerminationState( void ) + { return fAuxiliary->getTerminationState(); } + +protected: + inline void setTerminationState( TerminationState state ) + { fAuxiliary->setTerminationState( state ); } + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + + inline bool isPhysicalAccessEnabled( void ) + { return fAuxiliary->isPhysicalAccessEnabled(); } + + inline IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimpleContiguousPhysicalAddressSpace( size, direction ); } + + inline IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ) + { return fAuxiliary->createSimplePhysicalAddressSpace( size, direction ); } + +private: + OSMetaClassDeclareReservedUsed(IOFireWireNub, 0); + OSMetaClassDeclareReservedUsed(IOFireWireNub, 1); + OSMetaClassDeclareReservedUnused(IOFireWireNub, 2); + OSMetaClassDeclareReservedUnused(IOFireWireNub, 3); + +}; + +#endif /* ! _IOKIT_IOFIREWIRENUB_H */ diff --git a/i386/include/IOKit/firewire/IOFireWirePowerManager.h b/i386/include/IOKit/firewire/IOFireWirePowerManager.h new file mode 100644 index 0000000..e0a141a --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWirePowerManager.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIREPOWERMANAGER_H +#define _IOKIT_IOFIREWIREPOWERMANAGER_H + +#include + +#include +#include + +class IOFireWireController; + +/*! @class IOFireWirePowerManager +*/ + +class IOFireWirePowerManager : public OSObject +{ + OSDeclareAbstractStructors(IOFireWirePowerManager); + +protected: + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + IOFireWireController * fControl; + + UInt32 fMaximumDeciwatts; + UInt32 fAllocatedDeciwatts; + +public: + static IOFireWirePowerManager * createWithController( IOFireWireController * controller ); + + virtual bool initWithController( IOFireWireController * controller ); + + virtual void setMaximumDeciwatts( UInt32 deciwatts ); + virtual IOReturn allocateDeciwatts( UInt32 deciwatts ); + virtual void deallocateDeciwatts( UInt32 deciwatts ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 0); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 1); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 2); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 3); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 4); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 5); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 6); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 7); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 8); + OSMetaClassDeclareReservedUnused(IOFireWirePowerManager, 9); +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/firewire/IOFireWireUnit.h b/i386/include/IOKit/firewire/IOFireWireUnit.h new file mode 100644 index 0000000..6509b94 --- /dev/null +++ b/i386/include/IOKit/firewire/IOFireWireUnit.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOFireWireUnit.h + * + * + */ +#ifndef _IOKIT_IOFIREWIREUNIT_H +#define _IOKIT_IOFIREWIREUNIT_H + +// public +#include + +class IOFireWireDevice; +class IOFireWireUnit; + +#pragma mark - + +/*! + @class IOFireWireUnitAux +*/ + +class IOFireWireUnitAux : public IOFireWireNubAux +{ + OSDeclareDefaultStructors(IOFireWireUnitAux) + + friend class IOFireWireUnit; + +protected: + + /*! + @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + + struct ExpansionData { }; + + /*! + @var reserved + Reserved for future use. (Internal use only) + */ + + ExpansionData * reserved; + + virtual bool init( IOFireWireUnit * primary ); + virtual void free(); + + virtual bool isPhysicalAccessEnabled( void ); + + virtual IOFWSimpleContiguousPhysicalAddressSpace * createSimpleContiguousPhysicalAddressSpace( vm_size_t size, IODirection direction ); + + virtual IOFWSimplePhysicalAddressSpace * createSimplePhysicalAddressSpace( vm_size_t size, IODirection direction ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 0); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 1); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 2); + OSMetaClassDeclareReservedUnused(IOFireWireUnitAux, 3); + +}; + +#pragma mark - + +/*! @class IOFireWireUnit +*/ +class IOFireWireUnit : public IOFireWireNub +{ + OSDeclareDefaultStructors(IOFireWireUnit) + + friend class IOFireWireUnitAux; + friend class IOFireWireDevice; + +protected: + IOFireWireDevice *fDevice; // The device unit is part of + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + +/*------------------Methods provided to FireWire device clients-----------------------*/ +public: + + virtual bool init(OSDictionary *propTable, IOConfigDirectory *directory); + + /* + * Standard nub initialization + */ + virtual bool attach(IOService * provider ); + virtual void free(); + + /* + * Matching language support + * Match on the following properties of the unit: + * Vendor_ID + * GUID + * Unit_Spec_ID + * Unit_SW_Version + */ + virtual bool matchPropertyTable(OSDictionary * table); + + + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + + // Override handleOpen() and handleClose() to pass on to device + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + virtual void setNodeFlags( UInt32 flags ); + virtual void clearNodeFlags( UInt32 flags ); + virtual UInt32 getNodeFlags( void ); + + virtual IOReturn setConfigDirectory( IOConfigDirectory *directory ); + + /* + * Create local FireWire address spaces for the device to access + */ + virtual IOFWPhysicalAddressSpace *createPhysicalAddressSpace(IOMemoryDescriptor *mem); + virtual IOFWPseudoAddressSpace *createPseudoAddressSpace(FWAddress *addr, UInt32 len, + FWReadCallback reader, FWWriteCallback writer, void *refcon); + +protected: + + virtual IOFireWireNubAux * createAuxiliary( void ); + +public: + void setMaxSpeed( IOFWSpeed speed ); + +protected: + void terminateUnit( void ); + static void terminateUnitThreadFunc( void * refcon ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireUnit, 0); + OSMetaClassDeclareReservedUnused(IOFireWireUnit, 1); + +}; + +#endif /* ! _IOKIT_IOFIREWIREDEVICE_H */ diff --git a/i386/include/IOKit/firewire/IOLocalConfigDirectory.h b/i386/include/IOKit/firewire/IOLocalConfigDirectory.h new file mode 100644 index 0000000..4be26df --- /dev/null +++ b/i386/include/IOKit/firewire/IOLocalConfigDirectory.h @@ -0,0 +1,110 @@ +/* +* Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.1 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +* License for the specific language governing rights and limitations +* under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ + +#ifndef __IOLOCALCONFIGDIRECTORY_H__ +#define __IOLOCALCONFIGDIRECTORY_H__ + +#include +#include +#include +#include + +class OSArray; +class OSData; +class IOFireWireController; +class IOFWUserObjectExporter ; + +/*! @class IOLocalConfigDirectory +*/ +class IOLocalConfigDirectory : public IOConfigDirectory +{ + friend class IOFireWireController; + friend class IOFireWireUserClient ; + + OSDeclareDefaultStructors(IOLocalConfigDirectory); + +protected: + OSArray *fEntries; // Entries for this directory. + OSData *fROM; // Local ROM, if compiled. + UInt32 fHeader; // Num entries and CRC. + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool init(); + virtual void free(); + + virtual const UInt32 *getBase(); + virtual IOConfigDirectory *getSubDir(int start, int type); + +public: + static IOLocalConfigDirectory *create(); + + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase); + + virtual IOReturn compile(OSData *rom); + + // All flavours of addEntry eat a retain of the desc string + virtual IOReturn addEntry(int key, UInt32 value, OSString *desc = NULL); + virtual IOReturn addEntry(int key, IOLocalConfigDirectory *value, + OSString *desc = NULL); + virtual IOReturn addEntry(int key, OSData *value, OSString *desc = NULL); + virtual IOReturn addEntry(int key, FWAddress value, OSString *desc = NULL); + virtual IOReturn removeSubDir(IOLocalConfigDirectory *value); + const OSArray *getEntries() const; + + virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value); + +protected: + + virtual const UInt32 * lockData( void ); + virtual void unlockData( void ); + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ); + virtual IOReturn checkROMState( void ); + + // call eats a retain count + virtual IOReturn addEntry(OSString *desc); + + IOReturn incrementGeneration( void ); + static void exporterCleanup( const OSObject * self, IOFWUserObjectExporter * exporter ) ; + +private: + OSMetaClassDeclareReservedUsed(IOLocalConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 2); +}; + +#endif /* __IOLOCALCONFIGDIRECTORY_H__ */ diff --git a/i386/include/IOKit/firewire/IORemoteConfigDirectory.h b/i386/include/IOKit/firewire/IORemoteConfigDirectory.h new file mode 100644 index 0000000..7ddbb7c --- /dev/null +++ b/i386/include/IOKit/firewire/IORemoteConfigDirectory.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1998-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOREMOTECONFIGDIRECTORY_H__ +#define __IOREMOTECONFIGDIRECTORY_H__ + +#include +#include + +#include +#include + +#include "IOFireWireROMCache.h" + +class OSString; +class OSIterator; +class IOFireWireDevice; + +/*! @class IORemoteConfigDirectory +*/ +class IORemoteConfigDirectory : public IOConfigDirectory +{ + OSDeclareDefaultStructors(IORemoteConfigDirectory); + +protected: + IOFireWireROMCache *fROM; // Our cache of the ROM + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithOwnerOffset(IOFireWireROMCache *rom, + int start, int type); + virtual void free(); + + virtual const UInt32 *getBase(); + virtual IOConfigDirectory *getSubDir(int start, int type); + +public: + static IOConfigDirectory *withOwnerOffset(IOFireWireROMCache *rom, + int start, int type); + + + /*! + @function update + makes sure that the ROM has at least the specified capacity, + and that the ROM is uptodate from its start to at least the + specified quadlet offset. + @result kIOReturnSuccess if the specified offset is now + accessable at romBase[offset]. + */ + virtual IOReturn update(UInt32 offset, const UInt32 *&romBase); + +protected: + + virtual const UInt32 * lockData( void ); + virtual void unlockData( void ); + virtual IOReturn updateROMCache( UInt32 offset, UInt32 length ); + virtual IOReturn checkROMState( void ); + +private: + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 0); + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 1); + OSMetaClassDeclareReservedUnused(IORemoteConfigDirectory, 2); +}; + + +#endif /* __IOREMOTECONFIGDIRECTORY_H__ */ diff --git a/i386/include/IOKit/graphics/.svn/all-wcprops b/i386/include/IOKit/graphics/.svn/all-wcprops new file mode 100644 index 0000000..ef8a0b4 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/all-wcprops @@ -0,0 +1,71 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics +END +IOAccelerator.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOAccelerator.h +END +IOFramebuffer.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOFramebuffer.h +END +IODisplay.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IODisplay.h +END +IOGraphicsTypes.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOGraphicsTypes.h +END +IOGraphicsEngine.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOGraphicsEngine.h +END +IOGraphicsInterfaceTypes.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOGraphicsInterfaceTypes.h +END +IOAccelSurfaceConnect.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOAccelSurfaceConnect.h +END +IOFramebufferShared.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOFramebufferShared.h +END +IOAccelTypes.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOAccelTypes.h +END +IOAccelClientConnect.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOAccelClientConnect.h +END +IOGraphicsDevice.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/graphics/IOGraphicsDevice.h +END diff --git a/i386/include/IOKit/graphics/.svn/entries b/i386/include/IOKit/graphics/.svn/entries new file mode 100644 index 0000000..d8269b4 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/entries @@ -0,0 +1,402 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/graphics +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOAccelerator.h +file + + + + +2013-08-27T23:54:18.000000Z +caebfad8a8686824e1ffe4b09c8eab47 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1437 + +IOFramebuffer.h +file + + + + +2013-08-27T23:54:18.000000Z +bc663f0bf6444e3e086e354fddf03a73 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +46292 + +IODisplay.h +file + + + + +2013-08-27T23:54:18.000000Z +9d41074f076e36f9b66d2a76a6586f41 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11618 + +IOGraphicsTypes.h +file + + + + +2013-08-27T23:54:18.000000Z +cb8f1e0a696911ebc6807700cc6fff97 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +56895 + +IOGraphicsEngine.h +file + + + + +2013-08-27T23:54:18.000000Z +68e0c7dbf0b8563a3bd575aa6919d56a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1567 + +IOGraphicsInterfaceTypes.h +file + + + + +2013-08-27T23:54:18.000000Z +22877866e773e2825265819e169d60ef +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10741 + +IOAccelSurfaceConnect.h +file + + + + +2013-08-27T23:54:18.000000Z +a77ce3a015213f8b1f460d8c87139688 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6098 + +IOFramebufferShared.h +file + + + + +2013-08-27T23:54:18.000000Z +c45bf9f7b7c641115cd64adb67e560b6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13144 + +IOAccelTypes.h +file + + + + +2013-08-27T23:54:18.000000Z +88100159ecf41f49b1662ddbb87706af +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2557 + +IOAccelClientConnect.h +file + + + + +2013-08-27T23:54:18.000000Z +846956403924a54abe612fb24d5ea5f5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1343 + +IOGraphicsDevice.h +file + + + + +2013-08-27T23:54:18.000000Z +56a1d688b72ea29ee8ad9afa9cfb5eb7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1553 + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOAccelClientConnect.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOAccelClientConnect.h.svn-base new file mode 100644 index 0000000..80ff711 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOAccelClientConnect.h.svn-base @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_CLIENT_CONNECT_H +#define _IOACCEL_CLIENT_CONNECT_H + + +/* +** The IOAccelerator service name +*/ +#define kIOAcceleratorClassName "IOAccelerator" + + +/* +** IOAccelerator public client types. Private client types start with +** kIOAccelNumClientTypes. +*/ +enum eIOAcceleratorClientTypes { + kIOAccelSurfaceClientType, + kIOAccelNumClientTypes +}; + + +#endif /* _IOACCEL_CLIENT_CONNECT_H */ + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOAccelSurfaceConnect.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOAccelSurfaceConnect.h.svn-base new file mode 100644 index 0000000..b597370 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOAccelSurfaceConnect.h.svn-base @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_SURFACE_CONNECT_H +#define _IOACCEL_SURFACE_CONNECT_H + +#include +#include + +/* +** Surface visible region in device coordinates. +** +** num_rects: The number of rectangles in the rect array. If num_rects +** is zero the bounds rectangle is used for the visible rectangle. +** If num_rects is zero the surface must be completely contained +** by the device. +** +** bounds: The unclipped surface rectangle in device coords. Extends +** beyond the device bounds if the surface is not totally on +** the device. +** +** rect[]: An array of visible rectangles in device coords. If num_rects +** is non-zero only the region described by these rectangles is +** copied to the frame buffer during a flush operation. +*/ +typedef struct +{ + UInt32 num_rects; + IOAccelBounds bounds; + IOAccelBounds rect[0]; +} IOAccelDeviceRegion; + + +/* +** Determine the size of a region. +*/ +#define IOACCEL_SIZEOF_DEVICE_REGION(_rgn_) (sizeof(IOAccelDeviceRegion) + (_rgn_)->num_rects * sizeof(IOAccelBounds)) + + +/* +** Surface client public memory types. Private memory types start with +** kIOAccelNumSurfaceMemoryTypes. +*/ +enum eIOAccelSurfaceMemoryTypes { + kIOAccelNumSurfaceMemoryTypes +}; + + +/* +** Surface client public methods. Private methods start with +** kIOAccelNumSurfaceMethods. +*/ +enum eIOAccelSurfaceMethods { + kIOAccelSurfaceReadLockOptions, + kIOAccelSurfaceReadUnlockOptions, + kIOAccelSurfaceGetState, + kIOAccelSurfaceWriteLockOptions, + kIOAccelSurfaceWriteUnlockOptions, + kIOAccelSurfaceRead, + kIOAccelSurfaceSetShapeBacking, + + kIOAccelSurfaceSetIDMode, + kIOAccelSurfaceSetScale, + + kIOAccelSurfaceSetShape, + kIOAccelSurfaceFlush, + + kIOAccelSurfaceQueryLock, + + kIOAccelSurfaceReadLock, + kIOAccelSurfaceReadUnlock, + kIOAccelSurfaceWriteLock, + kIOAccelSurfaceWriteUnlock, + + kIOAccelSurfaceControl, + kIOAccelSurfaceSetShapeBackingAndLength, + + kIOAccelNumSurfaceMethods +}; + + +/* +** Option bits for IOAccelCreateSurface and the kIOAccelSurfaceSetIDMode method. +** The color depth field can take any value of the _CGSDepth enumeration. +*/ +typedef enum { + kIOAccelSurfaceModeColorDepth1555 = 0x00000003, + kIOAccelSurfaceModeColorDepth8888 = 0x00000004, +// kIOAccelSurfaceModeColorDepthRGB565 = 0x00000005, + kIOAccelSurfaceModeColorDepthYUV = 0x00000006, + kIOAccelSurfaceModeColorDepthYUV9 = 0x00000007, + kIOAccelSurfaceModeColorDepthYUV12 = 0x00000008, + kIOAccelSurfaceModeColorDepthYUV2 = 0x00000009, + kIOAccelSurfaceModeColorDepthBGRA32 = 0x0000000A, + +// kIOAccelSurfaceModeColorDepthRGBA64 = 0x0000000B, +// kIOAccelSurfaceModeColorDepthRGBAFloat64 = 0x0000000C, +// kIOAccelSurfaceModeColorDepthRGBAFloat128 = 0x0000000D, + +// kIOAccelSurfaceModeColorDepthYUV420 = 0x0000000E, + kIOAccelSurfaceModeColorDepth2101010 = 0x0000000F, + + kIOAccelSurfaceModeColorDepthBits = 0x0000000F, + + kIOAccelSurfaceModeStereoBit = 0x00000010, + kIOAccelSurfaceModeWindowedBit = 0x00000020, + + kIOAccelSurfaceModeBeamSync = 0x00008000 +} eIOAccelSurfaceModeBits; + + +/* +** Options bits for IOAccelSetSurfaceShape and the kIOAccelSurfaceSetShape method. +*/ +typedef enum { + kIOAccelSurfaceShapeNone = 0x00000000, + kIOAccelSurfaceShapeNonBlockingBit = 0x00000001, + kIOAccelSurfaceShapeNonSimpleBit = 0x00000002, + kIOAccelSurfaceShapeIdentityScaleBit = 0x00000004, + kIOAccelSurfaceShapeFrameSyncBit = 0x00000008, + kIOAccelSurfaceShapeBeamSyncBit = 0x00000010, + kIOAccelSurfaceShapeStaleBackingBit = 0x00000020, + kIOAccelSurfaceShapeAssemblyBit = 0x00000040, + kIOAccelSurfaceShapeWaitEnabledBit = 0x00000080, + + /* wrong name, use kIOAccelSurfaceShapeNonBlockingBit */ + kIOAccelSurfaceShapeBlockingBit = kIOAccelSurfaceShapeNonBlockingBit +} eIOAccelSurfaceShapeBits; + +/* +** Return bits for the kIOAccelSurfaceGetState method. +*/ +typedef enum { + kIOAccelSurfaceStateNone = 0x00000000, + kIOAccelSurfaceStateIdleBit = 0x00000001 +} eIOAccelSurfaceStateBits; + +/* +** Option bits for the kIOAccelSurfaceSetScale method. +*/ +typedef enum { + kIOAccelSurfaceBeamSyncSwaps = 0x00000001, + kIOAccelSurfaceFixedSource = 0x00000002, + + kIOAccelSurfaceFiltering = 0x000000f0, + kIOAccelSurfaceFilterDefault = 0x00000000, + kIOAccelSurfaceFilterNone = 0x00000010, + kIOAccelSurfaceFilterLinear = 0x00000020 + +} eIOAccelSurfaceScaleBits; + +/* +** Option bits for the kIOAccelSurfaceLock methods. +*/ +typedef enum { + kIOAccelSurfaceLockInBacking = 0, + kIOAccelSurfaceLockInAccel = 1, + kIOAccelSurfaceLockInDontCare = 2, + kIOAccelSurfaceLockInMask = 0x00000003 +} eIOAccelSurfaceLockBits; + +#endif /* _IOACCEL_SURFACE_CONNECT_H */ + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOAccelTypes.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOAccelTypes.h.svn-base new file mode 100644 index 0000000..09084c1 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOAccelTypes.h.svn-base @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_TYPES_H +#define _IOACCEL_TYPES_H + +#include +#include + +#define IOACCEL_TYPES_REV 12 + +#if !defined(OSTYPES_K64_REV) && !defined(MAC_OS_X_VERSION_10_6) +#define IOACCELTYPES_10_5 1 +#endif + +/* Integer rectangle in device coordinates */ +typedef struct +{ + SInt16 x; + SInt16 y; + SInt16 w; + SInt16 h; +} IOAccelBounds; + +typedef struct +{ + SInt16 w; + SInt16 h; +} IOAccelSize; + +/* Surface information */ + +enum { + kIOAccelVolatileSurface = 0x00000001, + kIOAccelKeycolorSurface = 0x00000002 +}; + +typedef struct +{ +#if IOACCELTYPES_10_5 + vm_address_t address[4]; +#else + mach_vm_address_t address[4]; +#endif /* IOACCELTYPES_10_5 */ + UInt32 rowBytes; + UInt32 width; + UInt32 height; + UInt32 pixelFormat; + IOOptionBits flags; + IOFixed colorTemperature[4]; + UInt32 typeDependent[4]; +} IOAccelSurfaceInformation; + +typedef struct +{ +#if IOACCELTYPES_10_5 + long x, y, w, h; + void *client_addr; + unsigned long client_row_bytes; +#else + SInt32 x, y, w, h; + mach_vm_address_t client_addr; + UInt32 client_row_bytes; +#endif /* IOACCELTYPES_10_5 */ +} IOAccelSurfaceReadData; + +typedef struct { + IOAccelBounds buffer; + IOAccelSize source; + UInt32 reserved[8]; +} IOAccelSurfaceScaling; + + +typedef SInt32 IOAccelID; + +enum { + kIOAccelPrivateID = 0x00000001 +}; + + +#endif /* _IOACCEL_TYPES_H */ + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOAccelerator.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOAccelerator.h.svn-base new file mode 100644 index 0000000..1c2119c --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOAccelerator.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IO_ACCELERATOR_H +#define _IO_ACCELERATOR_H + +#include +#include + +class IOAccelerator : public IOService +{ + OSDeclareDefaultStructors(IOAccelerator) + +public: + static IOReturn createAccelID(IOOptionBits options, IOAccelID * identifier); + static IOReturn retainAccelID(IOOptionBits options, IOAccelID identifier); + static IOReturn releaseAccelID(IOOptionBits options, IOAccelID identifier); + +}; + + +#endif /* _IO_ACCELERATOR_H */ + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IODisplay.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IODisplay.h.svn-base new file mode 100644 index 0000000..adcfc49 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IODisplay.h.svn-base @@ -0,0 +1,292 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODISPLAY_H +#define _IOKIT_IODISPLAY_H + +#include +#include + +extern const OSSymbol * gIODisplayParametersKey; +extern const OSSymbol * gIODisplayGUIDKey; + +extern const OSSymbol * gIODisplayValueKey; +extern const OSSymbol * gIODisplayMinValueKey; +extern const OSSymbol * gIODisplayMaxValueKey; + +extern const OSSymbol * gIODisplayContrastKey; +extern const OSSymbol * gIODisplayBrightnessKey; +extern const OSSymbol * gIODisplayHorizontalPositionKey; +extern const OSSymbol * gIODisplayHorizontalSizeKey; +extern const OSSymbol * gIODisplayVerticalPositionKey; +extern const OSSymbol * gIODisplayVerticalSizeKey; +extern const OSSymbol * gIODisplayTrapezoidKey; +extern const OSSymbol * gIODisplayPincushionKey; +extern const OSSymbol * gIODisplayParallelogramKey; +extern const OSSymbol * gIODisplayRotationKey; +extern const OSSymbol * gIODisplayOverscanKey; +extern const OSSymbol * gIODisplayVideoBestKey; + +extern const OSSymbol * gIODisplayParametersTheatreModeKey; +extern const OSSymbol * gIODisplayParametersTheatreModeWindowKey; + +extern const OSSymbol * gIODisplayMCCSVersionKey; +extern const OSSymbol * gIODisplayTechnologyTypeKey; +extern const OSSymbol * gIODisplayUsageTimeKey; +extern const OSSymbol * gIODisplayFirmwareLevelKey; + +extern const OSSymbol * gIODisplaySpeakerVolumeKey; +extern const OSSymbol * gIODisplaySpeakerSelectKey; +extern const OSSymbol * gIODisplayMicrophoneVolumeKey; +extern const OSSymbol * gIODisplayAmbientLightSensorKey; +extern const OSSymbol * gIODisplayAudioMuteAndScreenBlankKey; +extern const OSSymbol * gIODisplayAudioTrebleKey; +extern const OSSymbol * gIODisplayAudioBassKey; +extern const OSSymbol * gIODisplayAudioBalanceLRKey; +extern const OSSymbol * gIODisplayAudioProcessorModeKey; +extern const OSSymbol * gIODisplayPowerModeKey; +extern const OSSymbol * gIODisplayManufacturerSpecificKey; + +extern const OSSymbol * gIODisplayParametersCommitKey; +extern const OSSymbol * gIODisplayParametersDefaultKey; +extern const OSSymbol * gIODisplayParametersFlushKey; + +enum { + kIODisplayNumPowerStates = 4, + kIODisplayMaxPowerState = kIODisplayNumPowerStates - 1 +}; + +// these are the private instance variables for power management +struct DisplayPMVars +{ + UInt32 currentState; + // highest state number normally, lowest usable state in emergency + unsigned long maxState; + // true if the display has had power lowered due to user inactivity + bool displayIdle; +}; + +class IODisplayConnect : public IOService +{ + OSDeclareDefaultStructors(IODisplayConnect) + +private: + IOIndex connection; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +public: + virtual bool initWithConnection( IOIndex connection ); + virtual IOFramebuffer * getFramebuffer( void ); + virtual IOIndex getConnection( void ); + virtual IOReturn getAttributeForConnection( IOSelect selector, uintptr_t * value ); + virtual IOReturn setAttributeForConnection( IOSelect selector, uintptr_t value ); + virtual void joinPMtree ( IOService * driver ); +}; + +class IODisplay : public IOService +{ + OSDeclareAbstractStructors(IODisplay) + +public: + static void initialize( void ); + +protected: + // used to query the framebuffer controller + IODisplayConnect * fConnection; + class IODisplayParameterHandler * fParameterHandler; + void * __resv; + IONotifier * fNotifier; + + // pointer to protected instance variables for power management + struct DisplayPMVars * fDisplayPMVars; + + // reserved for future expansion + void * _IODisplay_reserved[32]; + +public: + virtual IOService * probe( IOService * provider, + SInt32 * score ); + + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual void free(); + + virtual IODisplayConnect * getConnection( void ); + + virtual IOReturn getConnectFlagsForDisplayMode( + IODisplayModeID mode, UInt32 * flags ); + + virtual IOReturn getGammaTableByIndex( + UInt32 * channelCount, UInt32 * dataCount, + UInt32 * dataWidth, void ** data ); + + virtual IOReturn readFramebufferEDID( void ); + + // + virtual IOReturn framebufferEvent( IOFramebuffer * framebuffer, + IOIndex event, void * info ); + + // parameter setting + virtual IOReturn setProperties( OSObject * properties ); + virtual bool setForKey( OSDictionary * params, const OSSymbol * key, + SInt32 value, SInt32 min, SInt32 max ); + + static bool addParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 min, SInt32 max ); + static bool setParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 value ); + static OSDictionary * getIntegerRange( OSDictionary * params, const OSSymbol * sym, + SInt32 * value, SInt32 * min, SInt32 * max ); + + // low level set/get + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ); + virtual bool doDataSet( const OSSymbol * paramName, OSData * value ); + virtual bool doUpdate( void ); + + // power management methods + virtual IOReturn setPowerState( unsigned long, IOService * ); + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags ); + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags ); + virtual unsigned long powerStateForDomainState( IOPMPowerFlags ); + + // + virtual void initPowerManagement( IOService * provider); + virtual void dropOneLevel( void ); + virtual void makeDisplayUsable( void ); + +private: + OSMetaClassDeclareReservedUnused(IODisplay, 0); + OSMetaClassDeclareReservedUnused(IODisplay, 1); + OSMetaClassDeclareReservedUnused(IODisplay, 2); + OSMetaClassDeclareReservedUnused(IODisplay, 3); + OSMetaClassDeclareReservedUnused(IODisplay, 4); + OSMetaClassDeclareReservedUnused(IODisplay, 5); + OSMetaClassDeclareReservedUnused(IODisplay, 6); + OSMetaClassDeclareReservedUnused(IODisplay, 7); + OSMetaClassDeclareReservedUnused(IODisplay, 8); + OSMetaClassDeclareReservedUnused(IODisplay, 9); + OSMetaClassDeclareReservedUnused(IODisplay, 10); + OSMetaClassDeclareReservedUnused(IODisplay, 11); + OSMetaClassDeclareReservedUnused(IODisplay, 12); + OSMetaClassDeclareReservedUnused(IODisplay, 13); + OSMetaClassDeclareReservedUnused(IODisplay, 14); + OSMetaClassDeclareReservedUnused(IODisplay, 15); + OSMetaClassDeclareReservedUnused(IODisplay, 16); + OSMetaClassDeclareReservedUnused(IODisplay, 17); + OSMetaClassDeclareReservedUnused(IODisplay, 18); + OSMetaClassDeclareReservedUnused(IODisplay, 19); + +private: + static IOReturn _framebufferEvent( OSObject * self, void * ref, + IOFramebuffer *framebuffer, IOIndex event, void * info ); + + bool addParameterHandler( IODisplayParameterHandler * parameterHandler ); + bool removeParameterHandler( IODisplayParameterHandler * parameterHandler ); + static bool updateNumber( OSDictionary * params, const OSSymbol * key, SInt32 value ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IOBacklightDisplay : public IODisplay +{ + OSDeclareDefaultStructors(IOBacklightDisplay) + +protected: + // User preferred brightness level + SInt32 fCurrentUserBrightness; + SInt32 fCurrentBrightness; + UInt32 fCurrentPowerState; + SInt32 fMinBrightness; + SInt32 fMaxBrightness; + UInt16 fMaxBrightnessLevel[kIODisplayNumPowerStates]; + +public: + virtual IOService * probe( IOService *, SInt32 * ); + virtual void stop( IOService * provider ); + virtual IOReturn setPowerState( unsigned long, IOService * ); + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags ); + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags ); + virtual unsigned long powerStateForDomainState( IOPMPowerFlags ); + + // + virtual void initPowerManagement( IOService * ); + +public: + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ); + virtual bool doUpdate( void ); + virtual void makeDisplayUsable( void ); + virtual bool setBrightness( SInt32 value ); + +private: + void handlePMSettingCallback(const OSSymbol *, OSObject *, uintptr_t); + + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 0); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 1); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 2); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 3); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 4); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 5); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 6); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 7); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 8); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 9); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IODisplayParameterHandler : public IOService +{ + OSDeclareDefaultStructors(IODisplayParameterHandler) + +public: + virtual bool setDisplay( IODisplay * display ) = 0; + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ) = 0; + virtual bool doDataSet( const OSSymbol * paramName, OSData * value ) = 0; + virtual bool doUpdate( void ) = 0; + +private: + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 0); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 1); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 2); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 3); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 4); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 5); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 6); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 7); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 8); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 9); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* ! _IOKIT_IODISPLAY_H */ + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOFramebuffer.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOFramebuffer.h.svn-base new file mode 100644 index 0000000..16a5ffd --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOFramebuffer.h.svn-base @@ -0,0 +1,827 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFRAMEBUFFER_H +#define _IOKIT_IOFRAMEBUFFER_H + +#include +#include +#include +#include +#include + +class IOFramebuffer; +class IOBufferMemoryDescriptor; + +typedef void (*CursorBlitProc)( + IOFramebuffer * inst, + void * shmem, + volatile unsigned char *vramPtr, + unsigned int cursStart, + unsigned int vramRow, + unsigned int cursRow, + int width, + int height ); + +typedef void (*CursorRemoveProc)( + IOFramebuffer * inst, + void * shmem, + volatile unsigned char *vramPtr, + unsigned int vramRow, + int width, + int height ); + + +typedef void * IOFBCursorRef; + +struct IOFBCursorControlCallouts { + IOReturn (*setCursorImage) (void * self, void * ref, + IOHardwareCursorDescriptor * description, IOFBCursorRef cursorImage); + IOReturn (*setCursorState) (void * self, void * ref, + SInt32 x, SInt32 y, bool visible); + UInt32 reserved[30]; +}; +typedef struct IOFBCursorControlCallouts IOFBCursorControlCallouts; + +struct IOFBCursorControlAttribute { + void * self; + void * ref; + const IOFBCursorControlCallouts * callouts; + UInt32 reserved[29]; +}; +typedef struct IOFBCursorControlAttribute IOFBCursorControlAttribute; + +// clock & data values +enum { + kIODDCLow = 0, + kIODDCHigh = 1, + kIODDCTristate = 2 +}; +// ddcBlockType constants +enum { + // EDID block type. + kIODDCBlockTypeEDID = 0 +}; + +// ddcFlags constants +enum { + // Force a new read of the EDID. + kIODDCForceRead = 0x00000001 +}; + +enum { + kDisabledInterruptState = 0, + kEnabledInterruptState = 1 +}; + +typedef void (*IOFBInterruptProc)( OSObject * target, void * ref ); + + +typedef IOReturn (*IOFramebufferNotificationHandler) + (OSObject * self, void * ref, + IOFramebuffer * framebuffer, IOIndex event, + void * info); + +// IOFramebufferNotificationHandler events +enum { + kIOFBNotifyDisplayModeWillChange = 1, + kIOFBNotifyDisplayModeDidChange = 2, + + kIOFBNotifyWillSleep = 3, + kIOFBNotifyDidWake = 4, + + kIOFBNotifyDidPowerOff = 5, + kIOFBNotifyWillPowerOn = 6, + + kIOFBNotifyDidSleep = kIOFBNotifyDidPowerOff, + kIOFBNotifyWillWake = kIOFBNotifyWillPowerOn, + + kIOFBNotifyWillPowerOff = 7, + kIOFBNotifyDidPowerOn = 8, + + kIOFBNotifyWillChangeSpeed = 9, + kIOFBNotifyDidChangeSpeed = 10, + + kIOFBNotifyClamshellChange = 20, + + kIOFBNotifyCaptureChange = 30, + + kIOFBNotifyOnlineChange = 40, + + kIOFBNotifyDisplayDimsChange = 50, + + kIOFBNotifyProbed = 60, +}; + +enum { + kFBDisplayUsablePowerState = 0x80000000, + kFBDisplayPowerStateMask = 0x0000ffff +}; + +#define kIOFBDependentIDKey "IOFBDependentID" +#define kIOFBDependentIndexKey "IOFBDependentIndex" + +struct StdFBShmem_t; +class IOFramebufferUserClient; + +/*! @class IOFramebuffer : public IOGraphicsDevice + @abstract The base class for graphics devices to be made available as part of the desktop. + @discussion The IOFramebuffer base class defines APIs used to publish a linear framebuffer device. Device driver writers should subclass this class to provide a X native driver. Mac OS X will also utilize 'ndrv' drivers via a subclass of IOFramebuffer IONDRVFramebuffer that does not require device driver writers to provide a X native driver. + + There are no in kernel clients of IOFramebuffer aside from rudimentary console and panic UI supported by the IOFramebuffer class. The IOFramebuffer class provides the IOUserClient implementation to allow the CoreGraphics server to provide the user accessible interface to all displays on a Mac OS X system, and this is further layered underneath application frameworks. Device driver writers should not need any knowledge of this part of the interfaces. Similarly the instance variables of IOFramebuffer are mostly used for cursor rendering which is handled by the IOFramebuffer class, and should be avoided by subclass implementors. Only IOFramebuffer methods with header documentation in this header are designed for subclasses to implement. + + IOFramebuffer provides simple dumb framebuffer operation - accceleration for 2D, 3D and video may be provided by a separate implementation of the IOAccelerator class. +*/ + +class IOFramebuffer : public IOGraphicsDevice +{ + friend class IOFramebufferUserClient; + friend class IOFramebufferSharedUserClient; + friend class IODisplay; + + OSDeclareDefaultStructors(IOFramebuffer) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + +protected: + StdFBShmem_t * priv; + int shmemClientVersion; + IOBufferMemoryDescriptor * sharedCursor; + + union { + struct { + /* Mapping tables used in cursor drawing to 5-5-5 displays. */ + unsigned char * _bm34To35SampleTable; + unsigned char * _bm35To34SampleTable; + /* Mapping tables used in cursor drawing to 8-bit RGB displays. */ + unsigned int * _bm256To38SampleTable; + unsigned char * _bm38To256SampleTable; + } t; + UInt8 * tables[ 4 ]; + } colorConvert; + + /* cursor blitting vars */ + CursorBlitProc cursorBlitProc; + CursorRemoveProc cursorRemoveProc; + + IOGSize maxCursorSize; + void * _IOFramebuffer_reservedE[7]; + const char * thisName; + volatile unsigned char * cursorSave; + unsigned int white; + + IOGPoint nextCursorLoc; + int nextCursorFrame; + SInt32 connectChange; + semaphore_t vblSemaphore; + + /* memory ranges */ + volatile unsigned char * frameBuffer; + unsigned int totalWidth; + unsigned int rowBytes; + unsigned int bytesPerPixel; + + IOMemoryMap * vramMap; + IOByteCount vramMapOffset; + OSArray * userAccessRanges; + unsigned int suspended:1; + unsigned int captured:1; + unsigned int sleepConnectCheck:1; + unsigned int messaged:1; + unsigned int _IOFramebuffer_reservedC:28; + IOFramebuffer * nextDependent; + OSSet * fbNotifications; + + class IOFramebufferUserClient * serverConnect; + class IOFramebufferSharedUserClient * sharedConnect; + + unsigned int opened:1; + unsigned int dead:1; + unsigned int configPending:1; + unsigned int serverNotified:1; + unsigned int serverState:1; + unsigned int serverPendingAck:1; + unsigned int isUsable:1; + unsigned int mirrored:1; + unsigned int pendingPowerState:4; + unsigned int pendingPowerChange:1; + unsigned int pagingState:1; + unsigned int mirrorPrimary:1; + unsigned int mirrorSWCursor:1; + + bool clutValid; + bool currentMono; + bool needCursorService; + bool haveVBLService; + bool haveHWCursor; + bool hwCursorLoaded; + + void * serverMsg; + IOInterruptEventSource * deferredEvents; + + /* Reserved for future expansion. */ + int _IOFramebuffer_reserved[5]; + +private: + struct IOFramebufferPrivate * __private; + +public: +/*! @function doI2CRequest + @abstract Carry out an I2C request. + @discussion IOFramebuffer subclasses may optionally implement this method to perform I2C bus requests on one of the buses they support. Alternatively they may implement the setDDCClock(), setDDCData(), readDDCClock(), readDDCData() methods and respond from getAttributeForConnection() to the kConnectionSupportsLLDDCSense attribute with success, in which case IOFramebuffer::doI2CRequest() will carry out a software implementation of I2C using the low level routines and conforming to the timing constraints passed in the timing parameter. Subclasses may pass timing parameters tuned for the specific bus, otherwise VESA DDC defaults will apply. + @timing event Subclasses may pass timing parameters tuned for the specific bus, otherwise if NULL, VESA DDC defaults will apply. + @param request An IOI2CRequest structure. The request should be carried out synchronously if the completion routine is NULL, otherwise it may optionally be carried out asynchronously. The completion routine should be called if supplied. + @result an IOReturn code. If kIOReturnSuccces, the result of the transaction is returned in the requests result field. +*/ + virtual IOReturn doI2CRequest( UInt32 bus, struct IOI2CBusTiming * timing, struct IOI2CRequest * request ); + +private: + OSMetaClassDeclareReservedUsed(IOFramebuffer, 0); + + OSMetaClassDeclareReservedUnused(IOFramebuffer, 1); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 2); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 3); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 4); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 5); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 6); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 7); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 8); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 9); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 10); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 11); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 12); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 13); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 14); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 15); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 16); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 17); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 18); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 19); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 20); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 21); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 22); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 23); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 24); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 25); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 26); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 27); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 28); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 29); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 30); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 31); + + +public: + static void initialize(); + + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + virtual IOService * probe( IOService * provider, SInt32 * score ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual void free(); + virtual IOWorkLoop * getWorkLoop() const; + + IOWorkLoop * getGraphicsSystemWorkLoop() const; + IOWorkLoop * getControllerWorkLoop() const; + + virtual IOReturn requestProbe( IOOptionBits options ); + + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags, unsigned long, IOService* ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags, unsigned long, IOService* ); + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService * device); + virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ); + virtual IOReturn getAggressiveness( unsigned long type, unsigned long * currentLevel ); + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler ); + virtual IOReturn callPlatformFunction( const OSSymbol * functionName, + bool waitForFunction, + void *p1, void *p2, + void *p3, void *p4 ); + + virtual void hideCursor( void ); + virtual void showCursor( IOGPoint * cursorLoc, int frame ); + virtual void moveCursor( IOGPoint * cursorLoc, int frame ); + // virtual + void resetCursor( void ); + + virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ); + + virtual void getBoundingRect ( IOGBounds ** bounds ); + + virtual IOReturn open( void ); + + virtual void close( void ); + + virtual bool isConsoleDevice( void ); + + virtual IOReturn setupForCurrentConfig( void ); + + virtual bool serializeInfo( OSSerialize * s ); + virtual bool setNumber( OSDictionary * dict, const char * key, + UInt32 number ); + + IONotifier * addFramebufferNotification( + IOFramebufferNotificationHandler handler, + OSObject * self, void * ref); + +/*! @function getApertureRange + @abstract Return reference to IODeviceMemory object representing memory range of framebuffer. + @discussion IOFramebuffer subclasses must implement this method to describe the memory used by the framebuffer in the current mode. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers. + @param aperture The system will only access the aperture kIOFBSystemAperture. + @result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call. +*/ + + virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ) = 0; + +/*! @function getVRAMRange + @abstract Return reference to IODeviceMemory object representing memory range of all the cards vram. + @discussion IOFramebuffer subclasses should implement this method to describe all the vram memory available on the card. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers. + @result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call. +*/ + + virtual IODeviceMemory * getVRAMRange( void ); + +protected: + +/*! @function handleEvent + @abstract Notify IOFramebuffer superclass code of events. + @discussion IOFramebuffer subclasses should call this IOFramebuffer method on certain power state changes. + @param event The event that has occurred:
+ kIOFBNotifyWillPowerOff call before entering a state other than the maximum.
+ kIOFBNotifyDidPowerOn call after entering the maximum power state.
+ kIOFBNotifyWillPowerOff call before entering a state other than the maximum.
+ kIOFBNotifyDidPowerOn call after entering a state other than the maximum.
+ @param info None of the above events require additional info, pass zero. + @result an IOReturn code, safely ignored. +*/ + + IOReturn handleEvent( IOIndex event, void * info = 0 ); + + + IOReturn deliverFramebufferNotification( + IOIndex event, void * info = 0 ); + +#ifdef IOFRAMEBUFFER_PRIVATE +#include +#endif + +public: +/*! @function enableController + @abstract Perform first time setup of the framebuffer. + @discussion IOFramebuffer subclasses should perform their initialization of the hardware here. The IOService start() method is not called at a time appropriate for this initialization. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn enableController( void ); + +/*! @function getPixelFormats + @abstract List the pixel formats the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return an array of strings representing the possible pixel formats available in the framebuffer. + @result A const char * pointer. The string consists of a concatenation of each pixel format string separated by the NULL character. The commonly supported pixel formats for Mac OS X are defined as IO8BitIndexedPixels, IO16BitDirectPixels, IO32BitDirectPixels. +*/ + + virtual const char * getPixelFormats( void ) = 0; + +/*! @function getDisplayModeCount + @abstract Return the number of display modes the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return a count of the display modes available. This count should change unless a connection change is posted for the device indicated the framebuffer and/or display configuration has changed. + @result A count of the display modes available. +*/ + + virtual IOItemCount getDisplayModeCount( void ) = 0; + +/*! @function getDisplayModes + @abstract Return the number of display modes the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return an array of display mode IDs available for the framebuffer. The IDs are defined by the driver in the range 0x00000001 - 0x7fffffff, and should be constant for a given display mode. + @param allDisplayModes A caller allocated buffer with the size given by the result of getDisplayModeCount(). + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ) = 0; + +/*! @function getInformationForDisplayMode + @abstract Return information about a given display mode. + @discussion IOFramebuffer subclasses must implement this method to return information in the IODisplayModeInformation structure for the display mode with the passed ID. + @param displayMode A display mode ID previously returned by getDisplayModes(). + @param info Pointer to a structure of type IODisplayModeInformation to be filled out by the driver. IODisplayModeInformation is documented in IOGraphicsTypes.h. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode, + IODisplayModeInformation * info ) = 0; + +/*! @function getPixelFormatsForDisplayMode + @abstract Obsolete. + @discussion IOFramebuffer subclasses must implement this method to return zero. + @param displayMode Ignored. + @param depth Ignored. + @result Return zero. +*/ + + virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode, + IOIndex depth ) = 0; + +/*! @function getPixelInformation + @abstract Return information about the framebuffer format for a given display mode and depth. + @discussion IOFramebuffer subclasses must implement this method to return information in the IOPixelInformation structure for the display mode with the passed ID, depth index and aperture. The aperture utilized by the system is always kIOFBSystemAperture. Drivers may define alternative apertures, being a view of the framebuffer in a different pixel format from the default. + @param displayMode A display mode ID previously returned by getDisplayModes(). + @param depth An index from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure (inclusive). + @param info Pointer to a structure of type IOPixelInformation to be filled out by the driver. IOPixelInformation is documented in IOGraphicsTypes.h. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getPixelInformation( + IODisplayModeID displayMode, IOIndex depth, + IOPixelAperture aperture, IOPixelInformation * pixelInfo ) = 0; + +/*! @function getCurrentDisplayMode + @abstract Return the framebuffers current display mode and depth. + @discussion IOFramebuffer subclasses must implement this method to return the current mode and depth. + @param displayMode A display mode ID representing the current mode. + @param depth An index indicating the depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ) = 0; + +/*! @function setCurrentDisplayMode + @abstract Set the framebuffers current display mode and depth. + @discussion IOFramebuffer subclasses should implement this method to set the current mode and depth. Other than at enableController() time, this is the only method that should change the framebuffer format and is synchronized with clients and attached accelerators to make sure access to the device is disallowed during the change. + @param displayMode A display mode ID representing the new mode. + @param depth An index indicating the new depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn setDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + +/*! @function setApertureEnable + @abstract Enable an aperture on the framebuffer (usually unimplemented, no OS usage). + @discussion IOFramebuffer subclasses may implement this method to set enable a non standard aperture. The system does not call this method. + @param aperture A device specific aperture index. + @param enable Device specific mask of options. + @result an IOReturn code. +*/ + + virtual IOReturn setApertureEnable( IOPixelAperture aperture, + IOOptionBits enable ); + +/*! @function setStartupDisplayMode + @abstract Set the framebuffers display mode and depth to be used during boot and at startup. + @discussion IOFramebuffer subclasses should implement this method to set the mode and depth to be used during boot and at startup, to reduce needed mode changes during boot when the display connection type is the same. If possible this mode should also be used by the OpenFirmware driver for the card. + @param displayMode A display mode ID representing the new startup mode. + @param depth An index indicating the new startup depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. +*/ + + virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + +/*! @function getCurrentDisplayMode + @abstract Return the framebuffers display mode and depth to be used during boot and at startup. + @discussion IOFramebuffer subclasses should implement this method to return the current mode and depth. + @param displayMode A display mode ID representing the mode used during startup. + @param depth An index indicating the depth configuration of the framebuffer used during startup. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. +*/ + + virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + +/*! @function setCLUTWithEntries + @abstract Set the color lookup table to be used by the framebuffer in indexed modes. + @discussion IOFramebuffer subclasses may implement this method to allow a palette to be set for indexed display modes. It will not be called on framebuffers in direct display modes. + @param colors A pointer to an array of numEntries RGB color entries. + @param index The index of the first entry to set. + @param numEntries The number of entries in the table. + @param options Options controlling the operation.
+ kSetCLUTByValue is set if the index field of each entry should be used to set the table sparsely, otherwise consecutive entries from the index parameter should be set.
+ kSetCLUTImmediately is set if the CLUT set should not be synchronized with the vertical blank, otherwise it should.
+ kSetCLUTWithLuminance is set if the CLUT should be set to a gray value equivalent in luminance to the passed color entry.
+ @result an IOReturn code. +*/ + + virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index, + UInt32 numEntries, IOOptionBits options ); + +/*! @function setGammaTable + @abstract Set the gamma table to be used by the framebuffer. + @discussion IOFramebuffer subclasses should implement this method to allow a gamma table to be set. + @param channelCount Defines the number of channels in the supplied data. OS X will pass three for separate R, G, B data, or one if the same data should apply to all channels. + @param dataCount The number of data entries per channel. + @param dataWidth The number of bits in each entry. 8 for Mac OS X 10.1 and earlier, 16 for later releases. + @param data The packed array of correction data. Data is passed for the R (or single) channel followed by the G & B channels. Each entry is one or two bytes (if dataWidth > 8). + @result an IOReturn code. +*/ + + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data ); + +/*! @function setAttribute + @abstract Generic method to set some attribute of the framebuffer device. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOPowerAttribute The IOFramebuffer class implements most power management (IOService) methods. It calls the subclass to carry out the power management state change with this attribute. When carrying out power state changes, the subclass should call IOFramebuffer::handleEvent for certain changes - set that method for more information. + @param value The new value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value ); + +/*! @function getAttribute + @abstract Generic method to retrieve some attribute of the framebuffer device. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOHardwareCursorAttribute If the device supports a hardware cursor and implements the setCursorImage() and setCursorState() calls it should return true for this attribute. + @param value Returns the value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value ); + +/*! @function getTimingInfoForDisplayMode + @abstract Returns a timing description for a display mode. + @discussion IOFramebuffer subclasses should implement this method to return timing information for a display mode. This allows the OS to enable display modes based on its knowledge of the connected display type. Two types of timing information are defined, by Apple defined constant, or by a detailed description of the timing parameters of the mode. + @param displayMode A display mode ID representing the mode to examine. + @param info The driver returns the information for the display mode in this structure.
+ If the mode has an Apple defined constant, such as timingVESA_1024x768_75hz, it should be returned in the appleTimingID field. Otherwise the field should be set to timingInvalid.
+ If the driver is able to supply detailed timing information, it should return it in the detailedInfo.v2 field of the structure, otherwise the driver should clear the kIODetailedTimingValid flag from the flags field.
+ The IODetailedTimingInformationV2 structure is documented in IOGraphicsTypes.h + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getTimingInfoForDisplayMode( + IODisplayModeID displayMode, IOTimingInformation * info ); + +/*! @function validateDetailedTiming + @abstract Reports whether a detailed timing is able to be programmed with the device. + @discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. + @param description A pointer to a IODetailedTimingInformationV2 structure. The driver should examine this description and change any fields that it cannot implement to reflect its closest possible implementation. + @param descripSize sizeof(IODetailedTimingInformationV2) + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable mode. +*/ + + virtual IOReturn validateDetailedTiming( + void * description, IOByteCount descripSize ); + +/*! @function setDetailedTimings + @abstract Installs an array of OS programmed detailed timings to be made available by the driver. + @discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. The driver needs to add these modes to its internal mode list if it provides this functionality. + @param array An OSArray of OSData objects. Each OSData contains one IODetailedTimingInformationV2 structure. All the data described by the array should be copied or retained by this call until the next invocation of this method. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable modes. +*/ + + virtual IOReturn setDetailedTimings( OSArray * array ); + +/*! @function getConnectionCount + @abstract Reports the number of display connections the device supports, driven from one framebuffer. + @discussion IOFramebuffer subclasses may implement functionality where a single framebuffer drives multiple displays. This is not recommended or fully supported and instead multihead cards should implement multiple instances of IOFramebuffer objects to provide full functionality. + @result A count of the number of display connections reported by the framebuffer. Current versions of OS X only support one connection completely. +*/ + + virtual IOItemCount getConnectionCount( void ); + + +/*! @function setAttributeForConnection + @abstract Generic method to set some attribute of the framebuffer device, specific to one display connection. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one display connection. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOCapturedAttribute If the device supports hotplugging displays, it should disable the generation of hot plug interrupts when the attribute kIOCapturedAttribute is set to true. + @param value The new value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn setAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t value ); + +/*! @function getAttributeForConnection + @abstract Generic method to retrieve some attribute of the framebuffer device, specific to one display connection. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one display connection. + @param attribute Defines the attribute to be returned. Some defined attributes are:
+ kConnectionSupportsHLDDCSense If the framebuffer supports the DDC methods hasDDCConnect() and getDDCBlock() it should return success (and no value) for this attribute.
+ kConnectionSupportsLLDDCSense If the framebuffer wishes to make use of IOFramebuffer::doI2CRequest software implementation of I2C it should implement the I2C methods setDDCClock(), setDDCData(), readDDCClock(), readDDCData(), and it should return success (and no value) for this attribute.
+ @param value Returns the value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn getAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); + +/*! @function convertCursorImage + @abstract Utility method of IOFramebuffer to convert cursor image to a hardware cursor format. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should pass the cursor image given by the setCursorImage() method, with a description of their hardware cursor format, to this helper function to this routine to convert the image to one suitable for the hardware. + @param cursorImage Opaque cursor parameter from the setCursorImage() call. + @param description Describes the cursor format supported by the driver. + @param cursor Structure describing the drivers allocated buffer to receive the converted image. + @result a bool indicating the conversion was successful. +*/ + + virtual bool convertCursorImage( void * cursorImage, + IOHardwareCursorDescriptor * description, + IOHardwareCursorInfo * cursor ); + +/*! @function setCursorImage + @abstract Set a new image for the hardware cursor. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the hardware cursor image. The image should be passed to the convertCursorImage() method with each type of cursor format the hardware supports until success, if all fail the hardware cursor should be hidden and kIOReturnUnsupported returned. + @param cursorImage Opaque cursor description. This should be passed to the convertCursorImage() method to convert to a format specific to the hardware. + @result An IOReturn code. +*/ + + virtual IOReturn setCursorImage( void * cursorImage ); + +/*! @function setCursorState + @abstract Set a new position and visibility for the hardware cursor. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the position and visibility of the cursor. + @param x Left coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen. + @param y Top coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen. + @param visible Visible state of the cursor. + @result An IOReturn code. +*/ + + virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible ); + +/*! @function flushCursor + @abstract Perform any needed cache flushing after software cursor rendering. + @discussion IOFramebuffer implements software cursor functionality when a hardware cursor is unavailable. Some hardware may need to flush a cache after the processor has finished lifting and dropping the software cursor. +*/ + + virtual void flushCursor( void ); + +/*! @function getAppleSense + @abstract Return display sense information for legacy Apple sensing. + @discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return sense information. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param senseType Return zero to indicate legacy Apple sensing. + @param primary Return the value of the primary Apple sense code. + @param extended Return the value of the secondary Apple sense code. + @param displayType Return an Apple defined constant for the type of display sensed. For example, kVGAConnect, kNTSCConnect, kPALConnect etc. + @result An IOReturn code. +*/ + + virtual IOReturn getAppleSense( IOIndex connectIndex, + UInt32 * senseType, + UInt32 * primary, + UInt32 * extended, + UInt32 * displayType ); + +/*! @function connectFlags + @abstract Return display sense information for legacy Apple sensing. + @discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return mode flags relative to the sensed display. If this method is unimplemented, all modes have are given the flags kDisplayModeValidFlag | kDisplayModeSafeFlag. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param displayMode A display mode ID. + @param flags Return the flags value for the given mode with the connected display. Flags are:
+ kDisplayModeValidFlag - mode is considered valid for the connected display by the driver. + kDisplayModeSafeFlag - mode is considered safe (not requiring mode change confirmation) for the connected display by the driver. + kDisplayModeDefaultFlag - mode is considered default for the connected display by the driver. + @result An IOReturn code. +*/ + + virtual IOReturn connectFlags( IOIndex connectIndex, + IODisplayModeID displayMode, IOOptionBits * flags ); + + //// IOLowLevelDDCSense + +/*! @function setDDCClock + @abstract Sets the state of the I2C clock line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C clock line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @param value One of kIODDCLow, kIODDCHigh, kIODDCTristate. +*/ + + virtual void setDDCClock( IOIndex bus, UInt32 value ); + +/*! @function setDDCData + @abstract Sets the state of the I2C data line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C data line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @param value One of kIODDCLow, kIODDCHigh, kIODDCTristate. +*/ + virtual void setDDCData( IOIndex bus, UInt32 value ); + +/*! @function readDDCClock + @abstract Reads the input state of the I2C clock line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C clock line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @result A boolean reflecting the current state of the clock line on the given bus. +*/ + virtual bool readDDCClock( IOIndex bus ); + +/*! @function readDDCData + @abstract Reads the input state of the I2C data line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C data line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @result A boolean reflecting the current state of the data line on the given bus. +*/ + virtual bool readDDCData( IOIndex bus ); + + virtual IOReturn enableDDCRaster( bool enable ); + +/*! @function hasDDCConnect + @abstract Return display DDC connect state. + @discussion Hardware that supports DDC/EDID display sensing should implement this method to return true if a DDC display is detected. They should also return success for the connection attribute kConnectionSupportsHLDDCSense (from getAttributeForConnection()). + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @result True if a DDC display is detected. +*/ + + virtual bool hasDDCConnect( IOIndex connectIndex ); + +/*! @function getDDCBlock + @abstract Return display EDID data. + @discussion Hardware that supports DDC/EDID display sensing should implement this method to return EDID data in 128 byte blocks. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param blockNumber Block number, ranging from one to the number of blocks return by the display. + @param blockType kIODDCBlockTypeEDID will be passed. + @param options No options are currently defined. + @param data Caller allocated buffer to receive the blocks data. + @param length In/out parameter - callers allocated buffer size, driver returns actual size. + @result An IOReturn code. +*/ + + virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber, + IOSelect blockType, IOOptionBits options, + UInt8 * data, IOByteCount * length ); + +/*! @function registerForInterruptType + @abstract Set callbacks for driver to call on interrupt events. + @discussion The IOFramebuffer class will call its subclasses to set callbacks to be called on interrupt events generated by hardware events. Only two are currently in use - vertical blank interrupts and connection changed interrupts. + @param interruptType One of these constants:
+ kIOFBVBLInterruptType Specifying a vertical blanking interrupt. + kIOFBConnectInterruptType Specify the display connection should be resensed. + @param proc C callback to be called by the driver when the specified event occurs. + @param target Target parameter for the callback proc. + @param ref Ref parameter for the callback proc. + @param interruptRef The subclass should return an opaque reference to the installed interrupt handler, for use with unregisterInterrupt() and setInterruptState(). + @result An IOReturn code. +*/ + + virtual IOReturn registerForInterruptType( IOSelect interruptType, + IOFBInterruptProc proc, OSObject * target, void * ref, + void ** interruptRef ); + +/*! @function unregisterInterrupt + @abstract Remove a callback previously installed by registerForInterruptType(). + @discussion Remove a callback previously installed by registerForInterruptType(). + @param interruptRef The interruptRef returned from the registerForInterruptType call that installed the interrupt. + @result An IOReturn code. +*/ + + virtual IOReturn unregisterInterrupt( void * interruptRef ); + +/*! @function unregisterInterrupt + @abstract Enable or disable a callback previously installed by registerForInterruptType(). + @discussion Enable or disable a callback previously installed by registerForInterruptType(). + @param state True or false to enable the callback. + @result An IOReturn code. +*/ + + virtual IOReturn setInterruptState( void * interruptRef, UInt32 state ); + + virtual IOReturn getNotificationSemaphore( IOSelect interruptType, + semaphore_t * semaphore ); + +/* non WL clients apis +*/ + IOReturn setAttributeExt( IOSelect attribute, uintptr_t value ); + + IOReturn getAttributeExt( IOSelect attribute, uintptr_t * value ); + + IOReturn setAttributeForConnectionExt( IOIndex connectIndex, + IOSelect attribute, uintptr_t value ); + + IOReturn getAttributeForConnectionExt( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); +}; + +#endif /* ! _IOKIT_IOFRAMEBUFFER_H */ diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOFramebufferShared.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOFramebufferShared.h.svn-base new file mode 100644 index 0000000..7f01ff3 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOFramebufferShared.h.svn-base @@ -0,0 +1,255 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFRAMEBUFFERSHARED_H +#define _IOKIT_IOFRAMEBUFFERSHARED_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! @header IOFramebufferShared +The IOFramebufferShared.h header contains definitions of objects and types shared between a kernel level IOFrameBuffer service and a non-kernel window server. In Mac OS X this structure is used by the CoreGraphics server and IOGraphics Family, and is not available to other clients. IOFramebuffer subclasses and IOFramebuffer clients within the kernel should also not rely on this structure definition and constants. It is public only for use on Darwin based window servers. Cursor and window server state data is exchanged by kernel and non-kernel tasks through a slice of shared memory containing a StdFBShmem_t structure.
+For a non-kernel task to get access to this slice of shared memory, a connection to an IOFramebuffer service must be made. A connection is made with the IOServiceOpen() function described in IOKitLib.h. A connection type of kIOFBServerConnectType or kIOFBSharedConnectType (for read-only access) should be specified. An io_connect_t handle is returned by IOServiceOpen(). This handle must be passed to IOFBCreateSharedCursor() to create the slice of shared memory. Then IOConnectMapMemory() may be called with a memory type of kIOFBCursorMemory to map the shared memory into the non-kernel task. +*/ + +#ifdef KERNEL +// CGS use optional +/*! @defined IOFB_ARBITRARY_SIZE_CURSOR + @discussion When IOFB_ARBITRARY_SIZE_CURSOR is not defined, the maximum cursor size is assumed to be CURSORWIDTH x CURSORHEIGHT and this header file will define a number of structures for storing cursor images accordingly. A non-kernel task may define IOFB_ARBITRARY_SIZE_CURSOR and use cursors up to the size specified when IOFBCreateSharedCursor() was called. In this case appropriate structures for storing cursor images must be defined elsewhere. In the kernel, IOFB_ARBITRARY_SIZE_CURSOR is always defined. +*/ +#define IOFB_ARBITRARY_SIZE_CURSOR +#define IOFB_ARBITRARY_FRAMES_CURSOR 1 +#endif + +#define IOFB_SUPPORTS_XOR_CURSOR +#define IOFB_SUPPORTS_HW_SHIELD +#define IOFB_SUPPORTS_ARBITRARY_FRAMES_CURSOR + +// +// Cursor and Window Server state data, occupying a slice of shared memory +// between the kernel and WindowServer. +// +/*! @enum CursorParameters + @constant kIOFBNumCursorFrames The number of cursor images stored in the StdFBShmem_t structure. + @constant kIOFBNumCursorFramesShift Used with waiting cursors. + @constant kIOFBMaxCursorDepth The maximum cursor pixel depth. +*/ +enum { +#if IOFB_ARBITRARY_FRAMES_CURSOR + kIOFBMainCursorIndex = 0, + kIOFBWaitCursorIndex = 1, + kIOFBNumCursorIndex = 4, +#else + kIOFBNumCursorFrames = 4, + kIOFBNumCursorFramesShift = 2, +#endif + kIOFBMaxCursorDepth = 32 +}; + +#ifndef IOFB_ARBITRARY_SIZE_CURSOR + +/*! @defined CURSORWIDTH + @discussion The maximum width of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. +*/ +#define CURSORWIDTH 16 /* width in pixels */ + +/*! @defined CURSORHEIGHT + @discussion The maximum height of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. +*/ +#define CURSORHEIGHT 16 /* height in pixels */ + +/*! @struct bm12Cursor + @abstract Cursor image for 1-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 1-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array contains the cursor images. + @field mask This array contains the cursor mask. + @field save This array stores the pixel values of the region underneath the cursor in its last drawn position. +*/ +struct bm12Cursor { + unsigned int image[4][16]; + unsigned int mask[4][16]; + unsigned int save[16]; +}; + +/*! @struct bm18Cursor + @abstract Cursor image for 8-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 8-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array contains cursor color values, which are converted to displayed colors through the color table. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. + @field mask This array contains the cursor alpha mask. The array is two dimensional with the same indexing as the image. If an alpha mask pixel is 0 and the corresponding image pixel is set to white for the display, then this cursor pixel will invert pixels on the display. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm18Cursor { + unsigned char image[4][256]; + unsigned char mask[4][256]; + unsigned char save[256]; +}; + +/*! @struct bm34Cursor + @abstract Cursor image for 15-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 15-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. A value of 0 means the pixel is transparent. Non-zero values are stored with the red, green, blue, and alpha values encoded with the following masks:
+ red mask = 0xF000
+ blue mask 0x0F00
+ green mask 0x00F0
+ alpha mask = 0x000F
+Note, only 4 bits are allocated for each color component. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm34Cursor { + unsigned short image[4][256]; + unsigned short save[256]; +}; + +/*! @struct bm38Cursor + @abstract Cursor image for 24-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 24-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. The lower 24 bits of a pixel's value contain the RGB color, while the upper 8 bits contain the alpha value. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm38Cursor { + unsigned int image[4][256]; + unsigned int save[256]; +}; + +#endif /* IOFB_ARBITRARY_SIZE_CURSOR */ + +enum { + kIOFBCursorImageNew = 0x01, + kIOFBCursorHWCapable = 0x02 +}; +enum { + kIOFBHardwareCursorActive = 0x01, + kIOFBHardwareCursorInVRAM = 0x02 +}; + +/*! @struct StdFBShmem_t + @discussion This structure contains cursor and window server state data and occupies a slice of shared memory between the kernel and window server. Several elements of this structure are only used in software cursor mode. Unless otherwise indicated, the coordinates in this structure are given in display space. Display space is the coordinate space that encompasses all the screens. The positions of the screens within display space indicate their location relative to each other as the cursor moves between them. If there is only one screen, the screen coordinates and display space coordinates will be the same. + @field cursorSema Semaphore lock for write access to the shared data in this structure. + @field frame The current cursor frame index. + @field cursorShow The cursor is displayed when cursorShow is 0. + @field cursorObscured If this is true, the cursor has been obscured and cursorShow should not be 0. The cursor will be shown again the next time it is moved. + @field shieldFlag When this is set to true the cursor will not be displayed in the region specified by shieldRect. + @field shielded True if the cursor has been hidden because it entered the shielded region. + @field saveRect The region that is saved underneath the cursor in software cursor mode. + @field shieldRect The region that the cursor will not be displayed in if shieldFlag is true. + @field cursorLoc The location of the cursor hot spot. + @field cursorRect The region that the cursor image currently occupies in software cursor mode. + @field oldCursorRect The region that the cursor image occupied the last time the cursor was drawn in software cursor mode. + @field screenBounds The region that the current screen occupies. + @field version Contains kIOFBCurrentShmemVersion so that a user client can ensure it is using the same version of this structure as the kernel. + @field structSize Contains the size of this structure. + @field vblTime The time of the most recent vertical blanking. + @field vblDelta The interval between the two most recent vertical blankings. + @field vblCount A running count of vertical blank interrupts. + @field reservedC Reserved for future use. + @field hardwareCursorCapable True if the hardware is capable of using hardware cursor mode. + @field hardwareCursorActive True if currently using the hardware cursor mode. + @field reservedB Reserved for future use. + @field cursorSize This array contains the cursor sizes indexed by frame. + @field hotSpot This array contains the location of the cursor hot spots indexed by frame. The hot spots coordinates are given relative to the top left corner of the cursor image. + @field cursor A union of structures that define the cursor images. The structure used depends on the framebuffer's bit depth. These structures are defined above. +*/ + +struct StdFBShmem_t { + ev_lock_data_t cursorSema; + int frame; + char cursorShow; + char cursorObscured; + char shieldFlag; + char shielded; + IOGBounds saveRect; + IOGBounds shieldRect; + IOGPoint cursorLoc; + IOGBounds cursorRect; + IOGBounds oldCursorRect; + IOGBounds screenBounds; + int version; + int structSize; + AbsoluteTime vblTime; + AbsoluteTime vblDelta; + unsigned long long int vblCount; +#if IOFB_ARBITRARY_FRAMES_CURSOR + unsigned int reservedC[28]; +#else + unsigned int reservedC[27]; + unsigned char hardwareCursorFlags[kIOFBNumCursorFrames]; +#endif + unsigned char hardwareCursorCapable; + unsigned char hardwareCursorActive; + unsigned char hardwareCursorShields; + unsigned char reservedB[1]; +#if IOFB_ARBITRARY_FRAMES_CURSOR + IOGSize cursorSize[kIOFBNumCursorIndex]; + IOGPoint hotSpot[kIOFBNumCursorIndex]; +#else + IOGSize cursorSize[kIOFBNumCursorFrames]; + IOGPoint hotSpot[kIOFBNumCursorFrames]; +#endif +#ifndef IOFB_ARBITRARY_SIZE_CURSOR + union { + struct bm12Cursor bw; + struct bm18Cursor bw8; + struct bm34Cursor rgb; + struct bm38Cursor rgb24; + } cursor; +#else /* IOFB_ARBITRARY_SIZE_CURSOR */ + unsigned char cursor[0]; +#endif /* IOFB_ARBITRARY_SIZE_CURSOR */ +}; +#ifndef __cplusplus +typedef volatile struct StdFBShmem_t StdFBShmem_t; +#endif + + +/*! @enum FramebufferConstants + @constant kIOFBCurrentShmemVersion The current version of the slice of shared memory that contains the cursor and window server state data in the StdFBShmem_t structure. + @constant kIOFBCursorMemory The memory type for IOConnectMapMemory() to get a slice of shared memory that contains the StdFBShmem_t structure. +*/ +enum { + // version for IOFBCreateSharedCursor + kIOFBShmemVersionMask = 0x000000ff, + kIOFBTenPtOneShmemVersion = 2, + kIOFBTenPtTwoShmemVersion = 3, + kIOFBCurrentShmemVersion = 2, + + // number of frames in animating cursor (if > kIOFBTenPtTwoShmemVersion) + kIOFBShmemCursorNumFramesMask = 0x00ff0000, + kIOFBShmemCursorNumFramesShift = 16, + + // memory types for IOConnectMapMemory. + kIOFBCursorMemory = 100 +}; + +/*! @defined IOFRAMEBUFFER_CONFORMSTO + @discussion The class name of the framebuffer service. +*/ +#define IOFRAMEBUFFER_CONFORMSTO "IOFramebuffer" + +#ifdef __cplusplus +} +#endif + +#endif /* ! _IOKIT_IOFRAMEBUFFERSHARED_H */ diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsDevice.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsDevice.h.svn-base new file mode 100644 index 0000000..8f51330 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsDevice.h.svn-base @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOGRAPHICSDEVICE_H +#define _IOKIT_IOGRAPHICSDEVICE_H + +#include +#include + + +class IOGraphicsDevice : public IOService +{ + OSDeclareAbstractStructors(IOGraphicsDevice) + +public: + + virtual void hideCursor( void ) = 0; + virtual void showCursor( IOGPoint * cursorLoc, int frame ) = 0; + virtual void moveCursor( IOGPoint * cursorLoc, int frame ) = 0; + + virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ) = 0; + + virtual void getBoundingRect ( IOGBounds ** bounds ) = 0; +}; + +#endif /* ! _IOKIT_IOGRAPHICSDEVICE_H */ + diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsEngine.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsEngine.h.svn-base new file mode 100644 index 0000000..4c79b41 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsEngine.h.svn-base @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 10 Mar 99 sdouglas created. + */ + + +struct IOGraphicsEngineContext { + IOSharedLockData contextLock; + IOOptionBits state; + void * owner; + UInt32 version; + IOByteCount structSize; + UInt32 reserved[ 8 ]; +}; +#ifndef __cplusplus +typedef volatile struct IOGraphicsEngineContext IOGraphicsEngineContext; +#endif + +enum { + // memory type for IOMapMemory + kIOGraphicsEngineContext = 100 +}; + +enum { + // version + kIOGraphicsEngineContextVersion = 1 +}; diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsInterfaceTypes.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsInterfaceTypes.h.svn-base new file mode 100644 index 0000000..5b392a7 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsInterfaceTypes.h.svn-base @@ -0,0 +1,301 @@ +/* + * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOGRAPHICSINTERFACETYPES_H +#define _IOKIT_IOGRAPHICSINTERFACETYPES_H + +#include + +#define IO_FOUR_CHAR_CODE(x) (x) + +typedef UInt32 IOFourCharCode; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kCurrentGraphicsInterfaceVersion 1 +#define kCurrentGraphicsInterfaceRevision 2 + + +#ifdef IOGA_COMPAT +typedef SInt32 IOBlitCompletionToken; +#endif + +typedef UInt32 IOBlitType; +enum { + kIOBlitTypeVerbMask = 0x000000ff, + kIOBlitTypeRects = 0, + kIOBlitTypeCopyRects, + kIOBlitTypeLines, + kIOBlitTypeScanlines, + kIOBlitTypeCopyRegion, + + kIOBlitTypeMoveCursor, + kIOBlitTypeShowCursor, + kIOBlitTypeHideCursor, + + kIOBlitTypeMonoExpand = 0x00000100, + kIOBlitTypeColorSpaceConvert = 0x00000200, + kIOBlitTypeScale = 0x00000400, + + kIOBlitTypeSourceKeyColorModeMask = 0x00003000, + kIOBlitTypeDestKeyColorModeMask = 0x0000c000, + kIOBlitTypeSourceKeyColorEqual = 0x00001000, + kIOBlitTypeSourceKeyColorNotEqual = 0x00002000, + kIOBlitTypeDestKeyColorEqual = 0x00004000, + kIOBlitTypeDestKeyColorNotEqual = 0x00008000, + + kIOBlitTypeOperationMask = 0x0fff0000, + kIOBlitTypeOperationShift = 16, + kIOBlitTypeOperationTypeMask = 0x0f000000, + + kIOBlitTypeOperationType0 = 0x00000000, + kIOBlitCopyOperation = 0x00000000 | kIOBlitTypeOperationType0, + kIOBlitOrOperation = 0x00010000 | kIOBlitTypeOperationType0, + kIOBlitXorOperation = 0x00020000 | kIOBlitTypeOperationType0, + kIOBlitBlendOperation = 0x00030000 | kIOBlitTypeOperationType0, + kIOBlitHighlightOperation = 0x00040000 | kIOBlitTypeOperationType0 +}; + +typedef UInt32 IOBlitSourceType; +enum { + kIOBlitSourceDefault = 0x00000000, + kIOBlitSourceFramebuffer = 0x00001000, + kIOBlitSourceMemory = 0x00002000, + kIOBlitSourceOOLMemory = 0x00003000, + kIOBlitSourcePattern = 0x00004000, + kIOBlitSourceOOLPattern = 0x00005000, + kIOBlitSourceSolid = 0x00006000, + kIOBlitSourceCGSSurface = 0x00007000, + kIOBlitSourceIsSame = 0x80000000 +}; + +#ifdef IOGA_COMPAT +typedef IOBlitSourceType IOBlitSourceDestType; +enum { + kIOBlitDestFramebuffer = 0x00000001 +}; +#endif + +typedef struct IOBlitOperationStruct { + UInt32 color0; + UInt32 color1; + SInt32 offsetX; + SInt32 offsetY; + UInt32 sourceKeyColor; + UInt32 destKeyColor; + UInt32 specific[16]; +} IOBlitOperation; + +typedef struct IOBlitRectangleStruct { + SInt32 x; + SInt32 y; + SInt32 width; + SInt32 height; +} IOBlitRectangle; + +typedef struct IOBlitRectanglesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitRectangle rects[1]; +} IOBlitRectangles; + +typedef struct IOBlitCopyRectangleStruct { + SInt32 sourceX; + SInt32 sourceY; + SInt32 x; + SInt32 y; + SInt32 width; + SInt32 height; +} IOBlitCopyRectangle; + +typedef struct IOBlitCopyRectanglesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitCopyRectangle rects[1]; +} IOBlitCopyRectangles; + + +typedef struct IOBlitCopyRegionStruct { + IOBlitOperation operation; + SInt32 deltaX; + SInt32 deltaY; + IOAccelDeviceRegion * region; +} IOBlitCopyRegion; + + +typedef struct IOBlitVertexStruct { + SInt32 x; + SInt32 y; +} IOBlitVertex; + +typedef struct IOBlitVerticesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitVertex vertices[2]; +} IOBlitVertices; + +typedef struct IOBlitScanlinesStruct { + IOBlitOperation operation; + IOItemCount count; + SInt32 y; + SInt32 height; + SInt32 x[2]; +} IOBlitScanlines; + + +typedef struct IOBlitCursorStruct { + IOBlitOperation operation; + IOBlitRectangle rect; +} IOBlitCursor; + +typedef struct _IOBlitMemory * IOBlitMemoryRef; + + +/* Quickdraw.h pixel formats*/ + +enum { + kIO1MonochromePixelFormat = 0x00000001, /* 1 bit indexed*/ + kIO2IndexedPixelFormat = 0x00000002, /* 2 bit indexed*/ + kIO4IndexedPixelFormat = 0x00000004, /* 4 bit indexed*/ + kIO8IndexedPixelFormat = 0x00000008, /* 8 bit indexed*/ + kIO16BE555PixelFormat = 0x00000010, /* 16 bit BE rgb 555 (Mac)*/ + kIO24RGBPixelFormat = 0x00000018, /* 24 bit rgb */ + kIO32ARGBPixelFormat = 0x00000020, /* 32 bit argb (Mac)*/ + kIO1IndexedGrayPixelFormat = 0x00000021, /* 1 bit indexed gray*/ + kIO2IndexedGrayPixelFormat = 0x00000022, /* 2 bit indexed gray*/ + kIO4IndexedGrayPixelFormat = 0x00000024, /* 4 bit indexed gray*/ + kIO8IndexedGrayPixelFormat = 0x00000028 /* 8 bit indexed gray*/ +}; + +enum { + kIO16LE555PixelFormat = IO_FOUR_CHAR_CODE('L555'), /* 16 bit LE rgb 555 (PC)*/ + kIO16LE5551PixelFormat = IO_FOUR_CHAR_CODE('5551'), /* 16 bit LE rgb 5551*/ + kIO16BE565PixelFormat = IO_FOUR_CHAR_CODE('B565'), /* 16 bit BE rgb 565*/ + kIO16LE565PixelFormat = IO_FOUR_CHAR_CODE('L565'), /* 16 bit LE rgb 565*/ + kIO24BGRPixelFormat = IO_FOUR_CHAR_CODE('24BG'), /* 24 bit bgr */ + kIO32BGRAPixelFormat = IO_FOUR_CHAR_CODE('BGRA'), /* 32 bit bgra (Matrox)*/ + kIO32ABGRPixelFormat = IO_FOUR_CHAR_CODE('ABGR'), /* 32 bit abgr */ + kIO32RGBAPixelFormat = IO_FOUR_CHAR_CODE('RGBA'), /* 32 bit rgba */ + kIOYUVSPixelFormat = IO_FOUR_CHAR_CODE('yuvs'), /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/ + kIOYUVUPixelFormat = IO_FOUR_CHAR_CODE('yuvu'), /* YUV 4:2:2 byte ordering 16-signed*/ + kIOYVU9PixelFormat = IO_FOUR_CHAR_CODE('YVU9'), /* YVU9 Planar 9*/ + kIOYUV411PixelFormat = IO_FOUR_CHAR_CODE('Y411'), /* YUV 4:1:1 Interleaved 16*/ + kIOYVYU422PixelFormat = IO_FOUR_CHAR_CODE('YVYU'), /* YVYU 4:2:2 byte ordering 16*/ + kIOUYVY422PixelFormat = IO_FOUR_CHAR_CODE('UYVY'), /* UYVY 4:2:2 byte ordering 16*/ + kIOYUV211PixelFormat = IO_FOUR_CHAR_CODE('Y211'), /* YUV 2:1:1 Packed 8*/ + kIO2vuyPixelFormat = IO_FOUR_CHAR_CODE('2vuy') /* UYVY 4:2:2 byte ordering 16*/ +}; + +/* Non Quickdraw.h pixel formats*/ +enum { + kIO16LE4444PixelFormat = IO_FOUR_CHAR_CODE('L444'), /* 16 bit LE argb 4444*/ + kIO16BE4444PixelFormat = IO_FOUR_CHAR_CODE('B444'), /* 16 bit BE argb 4444*/ + kIO64BGRAPixelFormat = IO_FOUR_CHAR_CODE('B16I'), /* 64 bit bgra */ + kIO64RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B16F'), /* 64 bit rgba */ + kIO128RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B32F') /* 128 bit rgba float */ +}; + +enum { + kIOBlitMemoryRequiresHostFlush = 0x00000001 +}; + +typedef struct IOBlitSurfaceStruct { + union { + UInt8 * bytes; + IOBlitMemoryRef ref; + } memory; + IOFourCharCode pixelFormat; + IOBlitRectangle size; + UInt32 rowBytes; + UInt32 byteOffset; + UInt32 * palette; + IOOptionBits accessFlags; + IOBlitMemoryRef interfaceRef; + UInt32 more[14]; +} IOBlitSurface; + +typedef IOBlitSurface IOBlitMemory; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +enum { + // options for Synchronize + kIOBlitSynchronizeWaitBeamExit = 0x00000001, + kIOBlitSynchronizeFlushHostWrites = 0x00000002 +}; + +enum { + // options for WaitComplete & Flush + kIOBlitWaitContext = 0x00000000, + kIOBlitWaitAll2D = 0x00000001, + kIOBlitWaitGlobal = 0x00000001, + kIOBlitWaitAll = 0x00000002, + kIOBlitWaitCheck = 0x00000080, + kIOBlitFlushWithSwap = 0x00010000 +}; + +enum { + // options for AllocateSurface + kIOBlitHasCGSSurface = 0x00000001, + kIOBlitFixedSource = 0x00000002, + kIOBlitBeamSyncSwaps = 0x00000004, + kIOBlitReferenceSource = 0x00000008 +}; + +enum { + // options for UnlockSurface + kIOBlitUnlockWithSwap = 0x80000000 +}; + +enum { + // options for SetDestination + kIOBlitFramebufferDestination = 0x00000000, + kIOBlitSurfaceDestination = 0x00000001 +}; + + + +enum { + // options for blit procs + kIOBlitBeamSync = 0x00000001, + kIOBlitBeamSyncAlways = 0x00000002, + kIOBlitBeamSyncSpin = 0x00000004, + + kIOBlitAllOptions = 0xffffffff +}; + +enum { + // capabilities + kIOBlitColorSpaceTypes = IO_FOUR_CHAR_CODE('cspc') +}; + + +// keys for IOAccelFindAccelerator() +#define kIOAccelTypesKey "IOAccelTypes" +#define kIOAccelIndexKey "IOAccelIndex" + +#define kIOAccelRevisionKey "IOAccelRevision" + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* !_IOKIT_IOGRAPHICSINTERFACETYPES_H */ diff --git a/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsTypes.h.svn-base b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsTypes.h.svn-base new file mode 100644 index 0000000..00bc2a8 --- /dev/null +++ b/i386/include/IOKit/graphics/.svn/text-base/IOGraphicsTypes.h.svn-base @@ -0,0 +1,1260 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOGRAPHICSTYPES_H +#define _IOKIT_IOGRAPHICSTYPES_H + + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOGRAPHICSTYPES_REV 24 + +typedef SInt32 IOIndex; +typedef UInt32 IOSelect; +typedef UInt32 IOFixed1616; +typedef UInt32 IODisplayVendorID; +typedef UInt32 IODisplayProductID; + +typedef SInt32 IODisplayModeID; +enum { + // This is the ID given to a programmable timing used at boot time + kIODisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, + // Lowest (unsigned) DisplayModeID reserved by Apple + kIODisplayModeIDReservedBase = (IODisplayModeID)0x80000000 +}; + +enum { + kIOMaxPixelBits = 64 +}; +typedef char IOPixelEncoding[ kIOMaxPixelBits ]; + +// Common Apple pixel formats + +#define IO1BitIndexedPixels "P" +#define IO2BitIndexedPixels "PP" +#define IO4BitIndexedPixels "PPPP" +#define IO8BitIndexedPixels "PPPPPPPP" +#define IO16BitDirectPixels "-RRRRRGGGGGBBBBB" +#define IO32BitDirectPixels "--------RRRRRRRRGGGGGGGGBBBBBBBB" + +#define kIO30BitDirectPixels "--RRRRRRRRRRGGGGGGGGGGBBBBBBBBBB" +#define kIO64BitDirectPixels "-16R16G16B16" + +#define kIO16BitFloatPixels "-16FR16FG16FB16" +#define kIO32BitFloatPixels "-32FR32FG32FB32" + +// other possible pixel formats + +#define IOYUV422Pixels "Y4U2V2" +#define IO8BitOverlayPixels "O8" +// page flipping +#define IOPagedPixels "Page1" + +#define IO_SampleTypeAlpha 'A' +#define IO_SampleTypeSkip '-' + +// Info about a pixel format +enum { + kIOCLUTPixels = 0, + kIOFixedCLUTPixels = 1, + kIORGBDirectPixels = 2, + kIOMonoDirectPixels = 3, + kIOMonoInverseDirectPixels = 4, + kIORGBSignedDirectPixels = 5, + kIORGBSignedFloatingPointPixels = 6 +}; + +/*! + * @struct IOPixelInformation + * @abstract A structure defining the format of a framebuffer. + * @discussion This structure is used by IOFramebuffer to define the format of the pixels. + * @field bytesPerRow The number of bytes per row. + * @field bytesPerPlane Not used. + * @field bitsPerPixel The number of bits per pixel, including unused bits and alpha. + * @field pixelType One of kIOCLUTPixels (indexed pixels with changeable CLUT), kIORGBDirectPixels (direct pixels). + * @field componentCount One for indexed pixels, three for direct pixel formats. + * @field bitsPerComponent Number of bits per component in each pixel. + * @field componentMasks Mask of the bits valid for each component of the pixel - in R, G, B order for direct pixels. + * @field pixelFormat String description of the pixel format - IO32BitDirectPixels, IO16BitDirectPixels etc. + * @field flags None defined - set to zero. + * @field activeWidth Number of pixels visible per row. + * @field activeHeight Number of visible pixel rows. + * @field reserved Set to zero. + */ + +struct IOPixelInformation { + UInt32 bytesPerRow; + UInt32 bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 componentCount; + UInt32 bitsPerComponent; + UInt32 componentMasks[ 8 * 2 ]; + IOPixelEncoding pixelFormat; + UInt32 flags; + UInt32 activeWidth; + UInt32 activeHeight; + UInt32 reserved[ 2 ]; +}; +typedef struct IOPixelInformation IOPixelInformation; + +// ID for industry standard display timings +typedef UInt32 IOAppleTimingID; + +/*! + * @struct IODisplayModeInformation + * @abstract A structure defining the format of a framebuffer. + * @discussion This structure is used by IOFramebuffer to define the format of the pixels. + * @field nominalWidth Number of pixels visible per row. + * @field nominalHeight Number of visible pixel rows. + * @field refreshRate Refresh rate in fixed point 16.16. + * @field maxDepthIndex Highest depth index available in this display mode. + * @field flags Flags for the mode, including:
+ * kDisplayModeInterlacedFlag mode is interlaced.
+ * kDisplayModeSimulscanFlag mode is available on multiple display connections.
+ * kDisplayModeNotPresetFlag mode is not a factory preset for the display (geometry may need correction).
+ * kDisplayModeStretchedFlag mode is stretched/distorted to match the display aspect ratio.
+ * @field reserved Set to zero. + */ + +struct IODisplayModeInformation { + UInt32 nominalWidth; + UInt32 nominalHeight; + IOFixed1616 refreshRate; + IOIndex maxDepthIndex; + UInt32 flags; + UInt32 reserved[ 4 ]; +}; +typedef struct IODisplayModeInformation IODisplayModeInformation; + +// flags +enum { + kDisplayModeSafetyFlags = 0x00000007, + + kDisplayModeAlwaysShowFlag = 0x00000008, + kDisplayModeNeverShowFlag = 0x00000080, + kDisplayModeNotResizeFlag = 0x00000010, + kDisplayModeRequiresPanFlag = 0x00000020, + + kDisplayModeInterlacedFlag = 0x00000040, + + kDisplayModeSimulscanFlag = 0x00000100, + kDisplayModeBuiltInFlag = 0x00000400, + kDisplayModeNotPresetFlag = 0x00000200, + kDisplayModeStretchedFlag = 0x00000800, + kDisplayModeNotGraphicsQualityFlag = 0x00001000, + kDisplayModeValidateAgainstDisplay = 0x00002000, + kDisplayModeTelevisionFlag = 0x00100000, + kDisplayModeValidForMirroringFlag = 0x00200000 +}; +enum { + kDisplayModeValidFlag = 0x00000001, + kDisplayModeSafeFlag = 0x00000002, + kDisplayModeDefaultFlag = 0x00000004 +}; + +#ifndef KERNEL +// Framebuffer info - obsolete + +struct IOFramebufferInformation { + IOPhysicalAddress baseAddress; + UInt32 activeWidth; + UInt32 activeHeight; + IOByteCount bytesPerRow; + IOByteCount bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 flags; + UInt32 reserved[ 4 ]; +}; +typedef struct IOFramebufferInformation IOFramebufferInformation; +#endif + +// flags +enum { + kFramebufferSupportsCopybackCache = 0x00010000, + kFramebufferSupportsWritethruCache = 0x00020000, + kFramebufferSupportsGammaCorrection = 0x00040000, + kFramebufferDisableAltivecAccess = 0x00080000 +}; + +// Aperture is an index into supported pixel formats for a mode & depth +typedef IOIndex IOPixelAperture; +enum { + kIOFBSystemAperture = 0 +}; + +//// CLUTs + +typedef UInt16 IOColorComponent; + +/*! + * @struct IOColorEntry + * @abstract A structure defining one entry of a color lookup table. + * @discussion This structure is used by IOFramebuffer to define an entry of a color lookup table. + * @field index Number of pixels visible per row. + * @field red Value of red component 0-65535. + * @field green Value of green component 0-65535. + * @field blue Value of blue component 0-65535. + */ + +struct IOColorEntry { + UInt16 index; + IOColorComponent red; + IOColorComponent green; + IOColorComponent blue; +}; +typedef struct IOColorEntry IOColorEntry; + +// options (masks) +enum { + kSetCLUTByValue = 0x00000001, // else at index + kSetCLUTImmediately = 0x00000002, // else at VBL + kSetCLUTWithLuminance = 0x00000004 // else RGB +}; + +//// Controller attributes + +enum { + kIOPowerStateAttribute = 'pwrs', + kIOPowerAttribute = 'powr', + kIODriverPowerAttribute = 'dpow', + kIOHardwareCursorAttribute = 'crsr', + + kIOMirrorAttribute = 'mirr', + kIOMirrorDefaultAttribute = 'mrdf', + + kIOCapturedAttribute = 'capd', + + kIOCursorControlAttribute = 'crsc', + + kIOSystemPowerAttribute = 'spwr', + kIOVRAMSaveAttribute = 'vrsv', + kIODeferCLUTSetAttribute = 'vclt', + + kIOClamshellStateAttribute = 'clam' +}; + +// values for kIOMirrorAttribute +enum { + kIOMirrorIsPrimary = 0x80000000, + kIOMirrorHWClipped = 0x40000000 +}; + +// values for kIOMirrorDefaultAttribute +enum { + kIOMirrorDefault = 0x00000001, + kIOMirrorForced = 0x00000002 +}; + +//// Display mode timing information + +struct IODetailedTimingInformationV1 { + // from EDID defn + UInt32 pixelClock; // Hertz + UInt32 horizontalActive; // pixels + UInt32 horizontalBlanking; // pixels + UInt32 horizontalBorder; // pixels + UInt32 horizontalSyncOffset; // pixels + UInt32 horizontalSyncWidth; // pixels + UInt32 verticalActive; // lines + UInt32 verticalBlanking; // lines + UInt32 verticalBorder; // lines + UInt32 verticalSyncOffset; // lines + UInt32 verticalSyncWidth; // lines +}; +typedef struct IODetailedTimingInformationV1 IODetailedTimingInformationV1; + +/*! + * @struct IODetailedTimingInformationV2 + * @abstract A structure defining the detailed timing information of a display mode. + * @discussion This structure is used by IOFramebuffer to define detailed timing information for a display mode. The VESA EDID document has more information. + * @field __reservedA Set to zero. + * @field horizontalScaledInset If the mode is scaled, sets the number of active pixels to remove the left and right edges in order to display an underscanned image. + * @field verticalScaledInset If the mode is scaled, sets the number of active lines to remove the top and bottom edges in order to display an underscanned image. + * @field scalerFlags If the mode is scaled, + * kIOScaleStretchToFit may be set to allow stretching. + * kIOScaleRotateFlags is mask which may have the value given by kIOScaleRotate90, kIOScaleRotate180, kIOScaleRotate270 to display a rotated framebuffer. + * @field horizontalScaled If the mode is scaled, sets the size of the image before scaling or rotation. + * @field verticalScaled If the mode is scaled, sets the size of the image before scaling or rotation. + * @field signalConfig + * kIOAnalogSetupExpected set if display expects a blank-to-black setup or pedestal. See VESA signal standards.
+ * kIOInterlacedCEATiming set for a CEA style interlaced timing:
+ * Field 1 vertical blanking = half specified vertical blanking lines.
+ * Field 2 vertical blanking = (half vertical blanking lines) + 1 line.
+ * Field 1 vertical offset = half specified vertical sync offset.
+ * Field 2 vertical offset = (half specified vertical sync offset) + 0.5 lines.
+ * @field signalLevels One of:
+ * kIOAnalogSignalLevel_0700_0300 0.700 - 0.300 V p-p.
+ * kIOAnalogSignalLevel_0714_0286 0.714 - 0.286 V p-p.
+ * kIOAnalogSignalLevel_1000_0400 1.000 - 0.400 V p-p.
+ * kIOAnalogSignalLevel_0700_0000 0.700 - 0.000 V p-p.
+ * @field pixelClock Pixel clock frequency in Hz. + * @field minPixelClock Minimum pixel clock frequency in Hz, with error. + * @field maxPixelClock Maximum pixel clock frequency in Hz, with error. + * @field horizontalActive Pixel clocks per line. + * @field horizontalBlanking Blanking clocks per line. + * @field horizontalSyncOffset First clock of horizontal sync. + * @field horizontalSyncPulseWidth Width of horizontal sync. + * @field verticalActive Number of lines per frame. + * @field verticalBlanking Blanking lines per frame. + * @field verticalSyncOffset First line of vertical sync. + * @field verticalSyncPulseWidth Height of vertical sync. + * @field horizontalBorderLeft Number of pixels in left horizontal border. + * @field horizontalBorderRight Number of pixels in right horizontal border. + * @field verticalBorderTop Number of lines in top vertical border. + * @field verticalBorderBottom Number of lines in bottom vertical border. + * @field horizontalSyncConfig kIOSyncPositivePolarity for positive polarity horizontal sync (0 for negative). + * @field horizontalSyncLevel Zero. + * @field verticalSyncConfig kIOSyncPositivePolarity for positive polarity vertical sync (0 for negative). + * @field verticalSyncLevel Zero. + * @field numLinks number of links to be used by a dual link timing, if zero, assume one link. + * @field __reservedB Reserved set to zero. + */ + +struct IODetailedTimingInformationV2 { + + UInt32 __reservedA[3]; // Init to 0 + UInt32 horizontalScaledInset; // pixels + UInt32 verticalScaledInset; // lines + + UInt32 scalerFlags; + UInt32 horizontalScaled; + UInt32 verticalScaled; + + UInt32 signalConfig; + UInt32 signalLevels; + + UInt64 pixelClock; // Hz + + UInt64 minPixelClock; // Hz - With error what is slowest actual clock + UInt64 maxPixelClock; // Hz - With error what is fasted actual clock + + UInt32 horizontalActive; // pixels + UInt32 horizontalBlanking; // pixels + UInt32 horizontalSyncOffset; // pixels + UInt32 horizontalSyncPulseWidth; // pixels + + UInt32 verticalActive; // lines + UInt32 verticalBlanking; // lines + UInt32 verticalSyncOffset; // lines + UInt32 verticalSyncPulseWidth; // lines + + UInt32 horizontalBorderLeft; // pixels + UInt32 horizontalBorderRight; // pixels + UInt32 verticalBorderTop; // lines + UInt32 verticalBorderBottom; // lines + + UInt32 horizontalSyncConfig; + UInt32 horizontalSyncLevel; // Future use (init to 0) + UInt32 verticalSyncConfig; + UInt32 verticalSyncLevel; // Future use (init to 0) + UInt32 numLinks; + + UInt32 __reservedB[7]; // Init to 0 +}; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformationV2; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformation; + +struct IOTimingInformation { + IOAppleTimingID appleTimingID; // kIOTimingIDXXX const + UInt32 flags; + union { + IODetailedTimingInformationV1 v1; + IODetailedTimingInformationV2 v2; + } detailedInfo; +}; +typedef struct IOTimingInformation IOTimingInformation; + +enum { + // IOTimingInformation flags + kIODetailedTimingValid = 0x80000000, + kIOScalingInfoValid = 0x40000000 +}; + +enum { + // scalerFlags + kIOScaleStretchToFit = 0x00000001, + + kIOScaleRotateFlags = 0x000000f0, + + kIOScaleSwapAxes = 0x00000010, + kIOScaleInvertX = 0x00000020, + kIOScaleInvertY = 0x00000040, + + kIOScaleRotate0 = 0x00000000, + kIOScaleRotate90 = kIOScaleSwapAxes | kIOScaleInvertX, + kIOScaleRotate180 = kIOScaleInvertX | kIOScaleInvertY, + kIOScaleRotate270 = kIOScaleSwapAxes | kIOScaleInvertY +}; + + +#pragma pack(push, 4) +struct IOFBDisplayModeDescription { + IODisplayModeInformation info; + IOTimingInformation timingInfo; +}; +typedef struct IOFBDisplayModeDescription IOFBDisplayModeDescription; +#pragma pack(pop) + +/*! + * @struct IODisplayTimingRange + * @abstract A structure defining the limits and attributes of a display or framebuffer. + * @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. The VESA EDID is useful background information for many of these fields. A data property with this structure under the key kIOFBTimingRangeKey in a framebuffer will allow the OS to program detailed timings that fall within its range. + * @field __reservedA Set to zero. + * @field version Set to zero. + * @field __reservedB Set to zero. + * @field minPixelClock minimum pixel clock frequency in range, in Hz. + * @field minPixelClock maximum pixel clock frequency in range, in Hz. + * @field maxPixelError largest variation between specified and actual pixel clock frequency, in Hz. + * @field supportedSyncFlags mask of supported sync attributes. The following are defined:
+ * kIORangeSupportsSeparateSyncs - digital separate syncs.
+ * kIORangeSupportsSyncOnGreen - sync on green.
+ * kIORangeSupportsCompositeSync - composite sync.
+ * kIORangeSupportsVSyncSerration - vertical sync has serration and equalization pulses.
+ * @field supportedSignalLevels mask of possible signal levels. The following are defined:
+ * kIORangeSupportsSignal_0700_0300 0.700 - 0.300 V p-p.
+ * kIORangeSupportsSignal_0714_0286 0.714 - 0.286 V p-p.
+ * kIORangeSupportsSignal_1000_0400 1.000 - 0.400 V p-p.
+ * kIORangeSupportsSignal_0700_0000 0.700 - 0.000 V p-p.
+ * @field supportedSignalConfigs mask of possible signal configurations. The following are defined:
+ * kIORangeSupportsInterlacedCEATiming Supports CEA style interlaced timing:
+ * Field 1 vertical blanking = specified vertical blanking lines.
+ * Field 2 vertical blanking = vertical blanking lines + 1 line.
+ * Field 1 vertical offset = specified vertical sync offset.
+ * Field 2 vertical offset = specified vertical sync offset + 0.5 lines.
+ * kIORangeSupportsInterlacedCEATimingWithConfirm Supports CEA style interlaced timing, but require a confirm. + * @field minFrameRate minimum frame rate (vertical refresh frequency) in range, in Hz. + * @field maxFrameRate maximum frame rate (vertical refresh frequency) in range, in Hz. + * @field minLineRate minimum line rate (horizontal refresh frequency) in range, in Hz. + * @field maxLineRate maximum line rate (horizontal refresh frequency) in range, in Hz. + * @field maxHorizontalTotal maximum clocks in horizontal line (active + blanking). + * @field maxVerticalTotal maximum lines in vertical frame (active + blanking). + * @field __reservedD Set to zero. + * @field charSizeHorizontalActive horizontalActive must be a multiple of charSizeHorizontalActive. + * @field charSizeHorizontalBlanking horizontalBlanking must be a multiple of charSizeHorizontalBlanking. + * @field charSizeHorizontalSyncOffset horizontalSyncOffset must be a multiple of charSizeHorizontalSyncOffset. + * @field charSizeHorizontalSyncPulse horizontalSyncPulse must be a multiple of charSizeHorizontalSyncPulse. + * @field charSizeVerticalActive verticalActive must be a multiple of charSizeVerticalActive. + * @field charSizeVerticalBlanking verticalBlanking must be a multiple of charSizeVerticalBlanking. + * @field charSizeVerticalSyncOffset verticalSyncOffset must be a multiple of charSizeVerticalSyncOffset. + * @field charSizeVerticalSyncPulse verticalSyncPulse must be a multiple of charSizeVerticalSyncPulse. + * @field charSizeHorizontalBorderLeft horizontalBorderLeft must be a multiple of charSizeHorizontalBorderLeft. + * @field charSizeHorizontalBorderRight horizontalBorderRight must be a multiple of charSizeHorizontalBorderRight. + * @field charSizeVerticalBorderTop verticalBorderTop must be a multiple of charSizeVerticalBorderTop. + * @field charSizeVerticalBorderBottom verticalBorderBottom must be a multiple of charSizeVerticalBorderBottom. + * @field charSizeHorizontalTotal (horizontalActive + horizontalBlanking) must be a multiple of charSizeHorizontalTotal. + * @field charSizeVerticalTotal (verticalActive + verticalBlanking) must be a multiple of charSizeVerticalTotal. + * @field __reservedE Set to zero. + * @field minHorizontalActiveClocks minimum value of horizontalActive. + * @field maxHorizontalActiveClocks maximum value of horizontalActive. + * @field minHorizontalBlankingClocks minimum value of horizontalBlanking. + * @field maxHorizontalBlankingClocks maximum value of horizontalBlanking. + * @field minHorizontalSyncOffsetClocks minimum value of horizontalSyncOffset. + * @field maxHorizontalSyncOffsetClocks maximum value of horizontalSyncOffset. + * @field minHorizontalPulseWidthClocks minimum value of horizontalPulseWidth. + * @field maxHorizontalPulseWidthClocks maximum value of horizontalPulseWidth. + * @field minVerticalActiveClocks minimum value of verticalActive. + * @field maxVerticalActiveClocks maximum value of verticalActive. + * @field minVerticalBlankingClocks minimum value of verticalBlanking. + * @field maxVerticalBlankingClocks maximum value of verticalBlanking. + * @field minVerticalSyncOffsetClocks minimum value of verticalSyncOffset. + * @field maxVerticalSyncOffsetClocks maximum value of verticalSyncOffset. + * @field minVerticalPulseWidthClocks minimum value of verticalPulseWidth. + * @field maxVerticalPulseWidthClocks maximum value of verticalPulseWidth. + * @field minHorizontalBorderLeft minimum value of horizontalBorderLeft. + * @field maxHorizontalBorderLeft maximum value of horizontalBorderLeft. + * @field minHorizontalBorderRight minimum value of horizontalBorderRight. + * @field maxHorizontalBorderRight maximum value of horizontalBorderRight. + * @field minVerticalBorderTop minimum value of verticalBorderTop. + * @field maxVerticalBorderTop maximum value of verticalBorderTop. + * @field minVerticalBorderBottom minimum value of verticalBorderBottom. + * @field maxVerticalBorderBottom maximum value of verticalBorderBottom. + * @field maxNumLinks number of links supported, if zero, 1 link is assumed. + * @field minLink0PixelClock minimum pixel clock for link 0 (kHz). + * @field maxLink0PixelClock maximum pixel clock for link 0 (kHz). + * @field minLink1PixelClock minimum pixel clock for link 1 (kHz). + * @field maxLink1PixelClock maximum pixel clock for link 1 (kHz). + * @field __reservedF Set to zero. + */ + +struct IODisplayTimingRange +{ + UInt32 __reservedA[2]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[5]; // Init to 0 + + UInt64 minPixelClock; // Min dot clock in Hz + UInt64 maxPixelClock; // Max dot clock in Hz + + UInt32 maxPixelError; // Max dot clock error + UInt32 supportedSyncFlags; + UInt32 supportedSignalLevels; + UInt32 supportedSignalConfigs; + + UInt32 minFrameRate; // Hz + UInt32 maxFrameRate; // Hz + UInt32 minLineRate; // Hz + UInt32 maxLineRate; // Hz + + UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking) + UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking) + UInt32 __reservedD[2]; // Init to 0 + + UInt8 charSizeHorizontalActive; + UInt8 charSizeHorizontalBlanking; + UInt8 charSizeHorizontalSyncOffset; + UInt8 charSizeHorizontalSyncPulse; + + UInt8 charSizeVerticalActive; + UInt8 charSizeVerticalBlanking; + UInt8 charSizeVerticalSyncOffset; + UInt8 charSizeVerticalSyncPulse; + + UInt8 charSizeHorizontalBorderLeft; + UInt8 charSizeHorizontalBorderRight; + UInt8 charSizeVerticalBorderTop; + UInt8 charSizeVerticalBorderBottom; + + UInt8 charSizeHorizontalTotal; // Character size for active + blanking + UInt8 charSizeVerticalTotal; // Character size for active + blanking + UInt16 __reservedE; // Reserved (Init to 0) + + UInt32 minHorizontalActiveClocks; + UInt32 maxHorizontalActiveClocks; + UInt32 minHorizontalBlankingClocks; + UInt32 maxHorizontalBlankingClocks; + + UInt32 minHorizontalSyncOffsetClocks; + UInt32 maxHorizontalSyncOffsetClocks; + UInt32 minHorizontalPulseWidthClocks; + UInt32 maxHorizontalPulseWidthClocks; + + UInt32 minVerticalActiveClocks; + UInt32 maxVerticalActiveClocks; + UInt32 minVerticalBlankingClocks; + UInt32 maxVerticalBlankingClocks; + + UInt32 minVerticalSyncOffsetClocks; + UInt32 maxVerticalSyncOffsetClocks; + UInt32 minVerticalPulseWidthClocks; + UInt32 maxVerticalPulseWidthClocks; + + UInt32 minHorizontalBorderLeft; + UInt32 maxHorizontalBorderLeft; + UInt32 minHorizontalBorderRight; + UInt32 maxHorizontalBorderRight; + + UInt32 minVerticalBorderTop; + UInt32 maxVerticalBorderTop; + UInt32 minVerticalBorderBottom; + UInt32 maxVerticalBorderBottom; + UInt32 maxNumLinks; // number of links, if zero, assume link 1 + UInt32 minLink0PixelClock; // min pixel clock for link 0 (kHz) + UInt32 maxLink0PixelClock; // max pixel clock for link 0 (kHz) + UInt32 minLink1PixelClock; // min pixel clock for link 1 (kHz) + UInt32 maxLink1PixelClock; // max pixel clock for link 1 (kHz) + + UInt32 __reservedF[3]; // Init to 0 +}; +typedef struct IODisplayTimingRange IODisplayTimingRange; + +enum { + // supportedSignalLevels + kIORangeSupportsSignal_0700_0300 = 0x00000001, + kIORangeSupportsSignal_0714_0286 = 0x00000002, + kIORangeSupportsSignal_1000_0400 = 0x00000004, + kIORangeSupportsSignal_0700_0000 = 0x00000008 +}; +enum { + // supportedSyncFlags + kIORangeSupportsSeparateSyncs = 0x00000001, + kIORangeSupportsSyncOnGreen = 0x00000002, + kIORangeSupportsCompositeSync = 0x00000004, + kIORangeSupportsVSyncSerration = 0x00000008 +}; +enum { + // supportedSignalConfigs + kIORangeSupportsInterlacedCEATiming = 0x00000004, + kIORangeSupportsInterlacedCEATimingWithConfirm = 0x00000008 +}; + +enum { + // signalConfig + kIODigitalSignal = 0x00000001, + kIOAnalogSetupExpected = 0x00000002, + kIOInterlacedCEATiming = 0x00000004, + kIONTSCTiming = 0x00000008, + kIOPALTiming = 0x00000010 +}; + +enum { + // signalLevels for analog + kIOAnalogSignalLevel_0700_0300 = 0, + kIOAnalogSignalLevel_0714_0286 = 1, + kIOAnalogSignalLevel_1000_0400 = 2, + kIOAnalogSignalLevel_0700_0000 = 3 +}; + +enum { + // horizontalSyncConfig and verticalSyncConfig + kIOSyncPositivePolarity = 0x00000001 +}; + +/*! + * @struct IODisplayScalerInformation + * @abstract A structure defining the scaling capabilities of a framebuffer. + * @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. A data property with this structure under the key kIOFBScalerInfoKey in a framebuffer will allow the OS to program detailed timings that are scaled to a displays native resolution. + * @field __reservedA Set to zero. + * @field version Set to zero. + * @field __reservedB Set to zero. + * @field scalerFeatures Mask of scaling features. The following are defined:
+ * kIOScaleStretchOnly If set the framebuffer can only provide stretched scaling with non-square pixels, without borders.
+ * kIOScaleCanUpSamplePixels If set framebuffer can scale up from a smaller number of source pixels to a larger native timing (eg. 640x480 pixels on a 1600x1200 timing).
+ * kIOScaleCanDownSamplePixels If set framebuffer can scale down from a larger number of source pixels to a smaller native timing (eg. 1600x1200 pixels on a 640x480 timing).
+ * kIOScaleCanScaleInterlaced If set framebuffer can scale an interlaced detailed timing.
+ * kIOScaleCanSupportInset If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields.
+ * kIOScaleCanRotate If set framebuffer can support some of the flags in the kIOScaleRotateFlags mask.
+ * kIOScaleCanBorderInsetOnly If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields, but requires the active pixels to be equal in size to the inset area, ie. can do insets with a border versus scaling an image.
+ * @field maxHorizontalPixels Maximum number of horizontal source pixels (horizontalScaled).
+ * @field maxVerticalPixels Maximum number of vertical source pixels (verticalScaled).
+ * @field __reservedC Set to zero. + */ + +struct IODisplayScalerInformation { + UInt32 __reservedA[1]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[2]; // Init to 0 + + IOOptionBits scalerFeatures; + UInt32 maxHorizontalPixels; + UInt32 maxVerticalPixels; + UInt32 __reservedC[5]; // Init to 0 +}; +typedef struct IODisplayScalerInformation IODisplayScalerInformation; + +enum { + /* scalerFeatures */ + kIOScaleStretchOnly = 0x00000001, + kIOScaleCanUpSamplePixels = 0x00000002, + kIOScaleCanDownSamplePixels = 0x00000004, + kIOScaleCanScaleInterlaced = 0x00000008, + kIOScaleCanSupportInset = 0x00000010, + kIOScaleCanRotate = 0x00000020, + kIOScaleCanBorderInsetOnly = 0x00000040 +}; + +//// Connections + +enum { + kOrConnections = 0xffffffe, + kAndConnections = 0xffffffd +}; + +enum { + kConnectionFlags = 'flgs', + kConnectionSyncEnable = 'sync', + kConnectionSyncFlags = 'sycf', + kConnectionSupportsAppleSense = 'asns', + kConnectionSupportsLLDDCSense = 'lddc', + kConnectionSupportsHLDDCSense = 'hddc', + kConnectionEnable = 'enab', + kConnectionCheckEnable = 'cena', + kConnectionProbe = 'prob', + kConnectionChanged = 'chng', + kConnectionPower = 'powr', + kConnectionPostWake = 'pwak', + kConnectionDisplayParameterCount = 'pcnt', + kConnectionDisplayParameters = 'parm', + kConnectionOverscan = 'oscn', + kConnectionVideoBest = 'vbst', + + kConnectionRedGammaScale = 'rgsc', + kConnectionGreenGammaScale = 'ggsc', + kConnectionBlueGammaScale = 'bgsc', + + kConnectionHandleDisplayPortEvent = 'dpir', + + kConnectionPanelTimingDisable = 'pnlt', + + kConnectionColorMode = 'cyuv', + kConnectionColorModesSupported = 'colr', + kConnectionColorDepthsSupported = ' bpc', + + kConnectionControllerDepthsSupported = '\0grd', + kConnectionControllerColorDepth = '\0dpd', + kConnectionControllerDitherControl = '\0gdc', + + kConnectionDisplayFlags = 'dflg', +}; + +// kConnectionFlags values +enum { + kIOConnectionBuiltIn = 0x00000800, + kIOConnectionStereoSync = 0x00008000 +}; + +// kConnectionSyncControl values +enum { + kIOHSyncDisable = 0x00000001, + kIOVSyncDisable = 0x00000002, + kIOCSyncDisable = 0x00000004, + kIONoSeparateSyncControl = 0x00000040, + kIOTriStateSyncs = 0x00000080, + kIOSyncOnBlue = 0x00000008, + kIOSyncOnGreen = 0x00000010, + kIOSyncOnRed = 0x00000020 +}; + +// kConnectionHandleDisplayPortEvent values +enum { + kIODPEventStart = 1, + kIODPEventIdle = 2, + + kIODPEventForceRetrain = 3, + + kIODPEventRemoteControlCommandPending = 256, + kIODPEventAutomatedTestRequest = 257, + kIODPEventContentProtection = 258, + kIODPEventMCCS = 259, + kIODPEventSinkSpecific = 260 +}; + +#define kIODisplayAttributesKey "IODisplayAttributes" + +#define kIODisplaySupportsUnderscanKey "IODisplaySupportsUnderscan" +#define kIODisplaySupportsBasicAudioKey "IODisplaySupportsBasicAudio" +#define kIODisplaySupportsYCbCr444Key "IODisplaySupportsYCbCr444" +#define kIODisplaySupportsYCbCr422Key "IODisplaySupportsYCbCr422" + +enum +{ + kIODisplayColorMode = kConnectionColorMode, +}; + +#if 0 +enum +{ + // kConnectionColorMode attribute + kIODisplayColorModeReserved = 0x00000000, + kIODisplayColorModeRGB = 0x00000001, + kIODisplayColorModeYCbCr422 = 0x00000010, + kIODisplayColorModeYCbCr444 = 0x00000100, + kIODisplayColorModeRGBLimited = 0x00001000, + kIODisplayColorModeAuto = 0x10000000, +}; +#endif + +enum +{ + // kConnectionColorDepthsSupported attribute + kIODisplayRGBColorComponentBitsUnknown = 0x00000000, + kIODisplayRGBColorComponentBits6 = 0x00000001, + kIODisplayRGBColorComponentBits8 = 0x00000002, + kIODisplayRGBColorComponentBits10 = 0x00000004, + kIODisplayRGBColorComponentBits12 = 0x00000008, + kIODisplayRGBColorComponentBits14 = 0x00000010, + kIODisplayRGBColorComponentBits16 = 0x00000020, + + kIODisplayYCbCr444ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr444ColorComponentBits6 = 0x00000100, + kIODisplayYCbCr444ColorComponentBits8 = 0x00000200, + kIODisplayYCbCr444ColorComponentBits10 = 0x00000400, + kIODisplayYCbCr444ColorComponentBits12 = 0x00000800, + kIODisplayYCbCr444ColorComponentBits14 = 0x00001000, + kIODisplayYCbCr444ColorComponentBits16 = 0x00002000, + + kIODisplayYCbCr422ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr422ColorComponentBits6 = 0x00010000, + kIODisplayYCbCr422ColorComponentBits8 = 0x00020000, + kIODisplayYCbCr422ColorComponentBits10 = 0x00040000, + kIODisplayYCbCr422ColorComponentBits12 = 0x00080000, + kIODisplayYCbCr422ColorComponentBits14 = 0x00100000, + kIODisplayYCbCr422ColorComponentBits16 = 0x00200000, +}; + +enum +{ + // kConnectionDitherControl attribute + kIODisplayDitherDisable = 0x00000000, + kIODisplayDitherSpatial = 0x00000001, + kIODisplayDitherTemporal = 0x00000002, + kIODisplayDitherFrameRateControl = 0x00000004, + kIODisplayDitherDefault = 0x00000080, + kIODisplayDitherAll = 0x000000FF, + kIODisplayDitherRGBShift = 0, + kIODisplayDitherYCbCr444Shift = 8, + kIODisplayDitherYCbCr422Shift = 16, +}; + +enum +{ + // kConnectionDisplayFlags attribute + kIODisplayNeedsCEAUnderscan = 0x00000001, +}; + + +#define IO_DISPLAY_CAN_FILL 0x00000040 +#define IO_DISPLAY_CAN_BLIT 0x00000020 + +#define IO_24BPP_TRANSFER_TABLE_SIZE 256 +#define IO_15BPP_TRANSFER_TABLE_SIZE 256 +#define IO_8BPP_TRANSFER_TABLE_SIZE 256 +#define IO_12BPP_TRANSFER_TABLE_SIZE 256 +#define IO_2BPP_TRANSFER_TABLE_SIZE 256 + +#define STDFB_BM256_TO_BM38_MAP_SIZE 256 +#define STDFB_BM38_TO_BM256_MAP_SIZE 256 +#define STDFB_BM38_TO_256_WITH_LOGICAL_SIZE \ + (STDFB_BM38_TO_BM256_MAP_SIZE + (256/sizeof(int))) + +#define STDFB_4BPS_TO_5BPS_MAP_SIZE 16 +#define STDFB_5BPS_TO_4BPS_MAP_SIZE 32 + +enum { + // connection types for IOServiceOpen + kIOFBServerConnectType = 0, + kIOFBSharedConnectType = 1 +}; + +enum { + // options for IOServiceRequestProbe() + kIOFBUserRequestProbe = 0x00000001 +}; + +struct IOGPoint { + SInt16 x; + SInt16 y; +}; +typedef struct IOGPoint IOGPoint; + +struct IOGSize { + SInt16 width; + SInt16 height; +}; +typedef struct IOGSize IOGSize; + +struct IOGBounds { + SInt16 minx; + SInt16 maxx; + SInt16 miny; + SInt16 maxy; +}; +typedef struct IOGBounds IOGBounds; + +#ifndef kIODescriptionKey + +#if !defined(__Point__) && !defined(BINTREE_H) && !defined(__MACTYPES__) +#define __Point__ +typedef IOGPoint Point; +#endif + +#if !defined(__Bounds__) && !defined(BINTREE_H) && !defined(__MACTYPES__) +#define __Bounds__ +typedef IOGBounds Bounds; +#endif + +#endif /* !kIODescriptionKey */ + +// cursor description + +enum { + kTransparentEncoding = 0, + kInvertingEncoding +}; + +enum { + kTransparentEncodingShift = (kTransparentEncoding << 1), + kTransparentEncodedPixel = (0x01 << kTransparentEncodingShift), + + kInvertingEncodingShift = (kInvertingEncoding << 1), + kInvertingEncodedPixel = (0x01 << kInvertingEncodingShift) +}; + +enum { + kHardwareCursorDescriptorMajorVersion = 0x0001, + kHardwareCursorDescriptorMinorVersion = 0x0000 +}; + +/*! + * @struct IOHardwareCursorDescriptor + * @abstract A structure defining the format of a hardware cursor. + * @discussion This structure is used by IOFramebuffer to define the format of a hardware cursor. + * @field majorVersion Set to kHardwareCursorDescriptorMajorVersion. + * @field minorVersion Set to kHardwareCursorDescriptorMinorVersion. + * @field height Maximum size of the cursor. + * @field width Maximum size of the cursor. + * @field bitDepth Number bits per pixel, or a QD/QT pixel type, for example kIO8IndexedPixelFormat, kIO32ARGBPixelFormat. + * @field maskBitDepth Unused. + * @field numColors Number of colors for indexed pixel types. + * @field colorEncodings An array pointer specifying the pixel values corresponding to the indices into the color table, for indexed pixel types. + * @field flags None defined, set to zero. + * @field supportedSpecialEncodings Mask of supported special pixel values, eg. kTransparentEncodedPixel, kInvertingEncodedPixel. + * @field specialEncodings Array of pixel values for each supported special encoding. + */ + +struct IOHardwareCursorDescriptor { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 height; + UInt32 width; + UInt32 bitDepth; // bits per pixel, or a QD/QT pixel type + UInt32 maskBitDepth; // unused + UInt32 numColors; // number of colors in the colorMap. ie. + UInt32 * colorEncodings; + UInt32 flags; + UInt32 supportedSpecialEncodings; + UInt32 specialEncodings[16]; +}; +typedef struct IOHardwareCursorDescriptor IOHardwareCursorDescriptor; + +enum { + kHardwareCursorInfoMajorVersion = 0x0001, + kHardwareCursorInfoMinorVersion = 0x0000 +}; + +/*! + * @struct IOHardwareCursorInfo + * @abstract A structure defining the converted data of a hardware cursor. + * @discussion This structure is used by IOFramebuffer to return the data of a hardware cursor by convertCursorImage() after conversion based on the IOHardwareCursorDescriptor passed to that routine. + * @field majorVersion Set to kHardwareCursorInfoMajorVersion. + * @field minorVersion Set to kHardwareCursorInfoMinorVersion. + * @field cursorHeight The actual size of the cursor is returned. + * @field cursorWidth The actual size of the cursor is returned. + * @field colorMap Pointer to array of IOColorEntry structures, with the number of elements set by the numColors field of the IOHardwareCursorDescriptor. Zero should be passed for direct pixel formats. + * @field hardwareCursorData Buffer to receive the converted cursor data. + * @field cursorHotSpotX Cursor's hotspot. + * @field cursorHotSpotY Cursor's hotspot. + * @field reserved Reserved, set to zero. + */ + +struct IOHardwareCursorInfo { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 cursorHeight; + UInt32 cursorWidth; + // nil or big enough for hardware's max colors + IOColorEntry * colorMap; + UInt8 * hardwareCursorData; + UInt16 cursorHotSpotX; + UInt16 cursorHotSpotY; + UInt32 reserved[5]; +}; +typedef struct IOHardwareCursorInfo IOHardwareCursorInfo; + +// interrupt types + +enum { + kIOFBVBLInterruptType = 'vbl ', + kIOFBHBLInterruptType = 'hbl ', + kIOFBFrameInterruptType = 'fram', + // Demand to check configuration (Hardware unchanged) + kIOFBConnectInterruptType = 'dci ', + // Demand to rebuild (Hardware has reinitialized on dependent change) + kIOFBChangedInterruptType = 'chng', + // Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror) + kIOFBOfflineInterruptType = 'remv', + // Notice that hardware is available (after being removed) + kIOFBOnlineInterruptType = 'add ', + // DisplayPort short pulse + kIOFBDisplayPortInterruptType = 'dpir', + // DisplayPort link event + kIOFBDisplayPortLinkChangeInterruptType = 'dplk', + // MCCS + kIOFBMCCSInterruptType = 'mccs' +}; + +// IOAppleTimingID's +enum { + kIOTimingIDInvalid = 0, /* Not a standard timing */ + kIOTimingIDApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/ + kIOTimingIDApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ + kIOTimingIDApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ + kIOTimingIDApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ + kIOTimingIDApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ + kIOTimingIDVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ + kIOTimingIDGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ + kIOTimingIDApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ + kIOTimingIDApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ + kIOTimingIDApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ + kIOTimingIDVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ + kIOTimingIDVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ + kIOTimingIDVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ + kIOTimingIDVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to kIOTimingIDApple_1024x768_75hz). */ + kIOTimingIDVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ + kIOTimingIDApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ + kIOTimingIDApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ + kIOTimingIDAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */ + kIOTimingIDAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */ + kIOTimingIDAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */ + kIOTimingIDAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */ + kIOTimingIDApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */ + kIOTimingIDApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */ + kIOTimingIDApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */ + kIOTimingIDApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */ + kIOTimingIDVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ + kIOTimingIDVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ + kIOTimingIDVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ + kIOTimingIDVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ + kIOTimingIDVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ + kIOTimingIDVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ + kIOTimingIDVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */ + kIOTimingIDVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */ + kIOTimingIDVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */ + kIOTimingIDVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */ + kIOTimingIDVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */ + kIOTimingIDVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */ + kIOTimingIDVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */ + kIOTimingIDVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */ + kIOTimingIDVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */ + kIOTimingIDSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ + kIOTimingIDFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ + kIOTimingIDSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */ + kIOTimingIDSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */ + kIOTimingIDSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */ + kIOTimingIDSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */ + kIOTimingIDApple_0x0_0hz_Offline = 550, /* Indicates that this timing will take the display off-line and remove it from the system. */ + kIOTimingIDVESA_848x480_60hz = 570, /* 848x480 (60 Hz) VESA timing. */ + kIOTimingIDVESA_1360x768_60hz = 590 /* 1360x768 (60 Hz) VESA timing. */ +}; + +// framebuffer property keys + +#define kIOFramebufferInfoKey "IOFramebufferInformation" + +#define kIOFBWidthKey "IOFBWidth" +#define kIOFBHeightKey "IOFBHeight" +#define kIOFBRefreshRateKey "IOFBRefreshRate" +#define kIOFBFlagsKey "IOFBFlags" +#define kIOFBBytesPerRowKey "IOFBBytesPerRow" +#define kIOFBBytesPerPlaneKey "IOFBBytesPerPlane" +#define kIOFBBitsPerPixelKey "IOFBBitsPerPixel" +#define kIOFBComponentCountKey "IOFBComponentCount" +#define kIOFBBitsPerComponentKey "IOFBBitsPerComponent" + +#define kIOFBDetailedTimingsKey "IOFBDetailedTimings" +#define kIOFBTimingRangeKey "IOFBTimingRange" +#define kIOFBScalerInfoKey "IOFBScalerInfo" +#define kIOFBCursorInfoKey "IOFBCursorInfo" + +#define kIOFBHostAccessFlagsKey "IOFBHostAccessFlags" + +#define kIOFBMemorySizeKey "IOFBMemorySize" + +#define kIOFBProbeOptionsKey "IOFBProbeOptions" + +#define kIOFBGammaWidthKey "IOFBGammaWidth" +#define kIOFBGammaCountKey "IOFBGammaCount" +#define kIOFBCLUTDeferKey "IOFBCLUTDefer" + +// exists on the hibernate progress display device +#ifndef kIOHibernatePreviewActiveKey +#define kIOHibernatePreviewActiveKey "IOHibernatePreviewActive" +// values for kIOHibernatePreviewActiveKey set by driver +enum { + kIOHibernatePreviewActive = 0x00000001, + kIOHibernatePreviewUpdates = 0x00000002 +}; +#endif + +// CFNumber/CFData +#define kIOFBAVSignalTypeKey "av-signal-type" +enum { + kIOFBAVSignalTypeUnknown = 0x00000000, + kIOFBAVSignalTypeVGA = 0x00000001, + kIOFBAVSignalTypeDVI = 0x00000002, + kIOFBAVSignalTypeHDMI = 0x00000008, + kIOFBAVSignalTypeDP = 0x00000010, +}; + +// diagnostic keys + +#define kIOFBConfigKey "IOFBConfig" +#define kIOFBModesKey "IOFBModes" +#define kIOFBModeIDKey "ID" +#define kIOFBModeDMKey "DM" +#define kIOFBModeTMKey "TM" +#define kIOFBModeAIDKey "AID" +#define kIOFBModeDFKey "DF" + +// display property keys + +#define kIODisplayEDIDKey "IODisplayEDID" +#define kIODisplayLocationKey "IODisplayLocation" // CFString +#define kIODisplayConnectFlagsKey "IODisplayConnectFlags" // CFNumber +#define kIODisplayHasBacklightKey "IODisplayHasBacklight" // CFBoolean +#define kIODisplayIsDigitalKey "IODisplayIsDigital" // CFBoolean +#define kDisplayBundleKey "DisplayBundle" + +#define kAppleDisplayTypeKey "AppleDisplayType" +#define kAppleSenseKey "AppleSense" + +#define kIODisplayMCCSVersionKey "IODisplayMCCSVersion" +#define kIODisplayTechnologyTypeKey "IODisplayTechnologyType" +#define kIODisplayUsageTimeKey "IODisplayUsageTime" +#define kIODisplayFirmwareLevelKey "IODisplayFirmwareLevel" + +enum { + kDisplayVendorIDUnknown = 'unkn', + kDisplayProductIDGeneric = 0x717 +}; + +#define kDisplayVendorID "DisplayVendorID" // CFNumber +#define kDisplayProductID "DisplayProductID" // CFNumber +#define kDisplaySerialNumber "DisplaySerialNumber" // CFNumber +#define kDisplaySerialString "DisplaySerialString" // CFString +#define kDisplayWeekOfManufacture "DisplayWeekManufacture" // CFNumber +#define kDisplayYearOfManufacture "DisplayYearManufacture" // CFNumber + +// CFDictionary of language-locale keys, name values +// eg. "en"="Color LCD", "en-GB"="Colour LCD" +#define kDisplayProductName "DisplayProductName" + +// all CFNumber or CFArray of CFNumber (floats) +#define kDisplayWhitePointX "DisplayWhitePointX" +#define kDisplayWhitePointY "DisplayWhitePointY" +#define kDisplayRedPointX "DisplayRedPointX" +#define kDisplayRedPointY "DisplayRedPointY" +#define kDisplayGreenPointX "DisplayGreenPointX" +#define kDisplayGreenPointY "DisplayGreenPointY" +#define kDisplayBluePointX "DisplayBluePointX" +#define kDisplayBluePointY "DisplayBluePointY" +#define kDisplayWhiteGamma "DisplayWhiteGamma" +#define kDisplayRedGamma "DisplayRedGamma" +#define kDisplayGreenGamma "DisplayGreenGamma" +#define kDisplayBlueGamma "DisplayBlueGamma" + +// Display gamma +#define kDisplayGammaChannels "DisplayGammaChannels" // CFNumber 1 or 3 channel count +#define kDisplayGammaEntryCount "DisplayGammaEntryCount" // CFNumber 1-based count of entries per channel +#define kDisplayGammaEntrySize "DisplayGammaEntrySize" // CFNumber size in bytes of each table entry +#define kDisplayGammaTable "DisplayGammaTable" // CFData + +// CFBoolean +#define kDisplayBrightnessAffectsGamma "DisplayBrightnessAffectsGamma" +#define kDisplayViewAngleAffectsGamma "DisplayViewAngleAffectsGamma" + +// CFData +#define kDisplayCSProfile "DisplayCSProfile" + +// CFNumber +#define kDisplayHorizontalImageSize "DisplayHorizontalImageSize" +#define kDisplayVerticalImageSize "DisplayVerticalImageSize" + +// Pixel description + +// CFBoolean +#define kDisplayFixedPixelFormat "DisplayFixedPixelFormat" + +enum { + kDisplaySubPixelLayoutUndefined = 0x00000000, + kDisplaySubPixelLayoutRGB = 0x00000001, + kDisplaySubPixelLayoutBGR = 0x00000002, + kDisplaySubPixelLayoutQuadGBL = 0x00000003, + kDisplaySubPixelLayoutQuadGBR = 0x00000004, + + kDisplaySubPixelConfigurationUndefined = 0x00000000, + kDisplaySubPixelConfigurationDelta = 0x00000001, + kDisplaySubPixelConfigurationStripe = 0x00000002, + kDisplaySubPixelConfigurationStripeOffset = 0x00000003, + kDisplaySubPixelConfigurationQuad = 0x00000004, + + kDisplaySubPixelShapeUndefined = 0x00000000, + kDisplaySubPixelShapeRound = 0x00000001, + kDisplaySubPixelShapeSquare = 0x00000002, + kDisplaySubPixelShapeRectangular = 0x00000003, + kDisplaySubPixelShapeOval = 0x00000004, + kDisplaySubPixelShapeElliptical = 0x00000005 +}; + +// CFNumbers +#define kDisplaySubPixelLayout "DisplaySubPixelLayout" +#define kDisplaySubPixelConfiguration "DisplaySubPixelConfiguration" +#define kDisplaySubPixelShape "DisplaySubPixelShape" + +#define kIODisplayOverrideMatchingKey "IODisplayOverrideMatching" + +// Display parameters + +#define kIODisplayParametersKey "IODisplayParameters" +#define kIODisplayGUIDKey "IODisplayGUID" + +#define kIODisplayValueKey "value" +#define kIODisplayMinValueKey "min" +#define kIODisplayMaxValueKey "max" + +#define kIODisplayBrightnessKey "brightness" +#define kIODisplayContrastKey "contrast" +#define kIODisplayHorizontalPositionKey "horizontal-position" +#define kIODisplayHorizontalSizeKey "horizontal-size" +#define kIODisplayVerticalPositionKey "vertical-position" +#define kIODisplayVerticalSizeKey "vertical-size" +#define kIODisplayTrapezoidKey "trapezoid" +#define kIODisplayPincushionKey "pincushion" +#define kIODisplayParallelogramKey "parallelogram" +#define kIODisplayRotationKey "rotation" +#define kIODisplayTheatreModeKey "theatre-mode" +#define kIODisplayTheatreModeWindowKey "theatre-mode-window" +#define kIODisplayOverscanKey "oscn" +#define kIODisplayVideoBestKey "vbst" + +#define kIODisplaySpeakerVolumeKey "speaker-volume" +#define kIODisplaySpeakerSelectKey "speaker-select" +#define kIODisplayMicrophoneVolumeKey "microphone-volume" +#define kIODisplayAmbientLightSensorKey "ambient-light-sensor" +#define kIODisplayAudioMuteAndScreenBlankKey "audio-mute-and-screen-blank" +#define kIODisplayAudioTrebleKey "audio-treble" +#define kIODisplayAudioBassKey "audio-bass" +#define kIODisplayAudioBalanceLRKey "audio-balance-LR" +#define kIODisplayAudioProcessorModeKey "audio-processor-mode" +#define kIODisplayPowerModeKey "power-mode" +#define kIODisplayManufacturerSpecificKey "manufacturer-specific" + + +#define kIODisplayRedGammaScaleKey "rgsc" +#define kIODisplayGreenGammaScaleKey "ggsc" +#define kIODisplayBlueGammaScaleKey "bgsc" + +#define kIODisplayParametersCommitKey "commit" +#define kIODisplayParametersDefaultKey "defaults" +#define kIODisplayParametersFlushKey "flush" + +#ifdef __cplusplus +} +#endif + +#endif /* ! _IOKIT_IOGRAPHICSTYPES_H */ diff --git a/i386/include/IOKit/graphics/IOAccelClientConnect.h b/i386/include/IOKit/graphics/IOAccelClientConnect.h new file mode 100644 index 0000000..80ff711 --- /dev/null +++ b/i386/include/IOKit/graphics/IOAccelClientConnect.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_CLIENT_CONNECT_H +#define _IOACCEL_CLIENT_CONNECT_H + + +/* +** The IOAccelerator service name +*/ +#define kIOAcceleratorClassName "IOAccelerator" + + +/* +** IOAccelerator public client types. Private client types start with +** kIOAccelNumClientTypes. +*/ +enum eIOAcceleratorClientTypes { + kIOAccelSurfaceClientType, + kIOAccelNumClientTypes +}; + + +#endif /* _IOACCEL_CLIENT_CONNECT_H */ + diff --git a/i386/include/IOKit/graphics/IOAccelSurfaceConnect.h b/i386/include/IOKit/graphics/IOAccelSurfaceConnect.h new file mode 100644 index 0000000..b597370 --- /dev/null +++ b/i386/include/IOKit/graphics/IOAccelSurfaceConnect.h @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_SURFACE_CONNECT_H +#define _IOACCEL_SURFACE_CONNECT_H + +#include +#include + +/* +** Surface visible region in device coordinates. +** +** num_rects: The number of rectangles in the rect array. If num_rects +** is zero the bounds rectangle is used for the visible rectangle. +** If num_rects is zero the surface must be completely contained +** by the device. +** +** bounds: The unclipped surface rectangle in device coords. Extends +** beyond the device bounds if the surface is not totally on +** the device. +** +** rect[]: An array of visible rectangles in device coords. If num_rects +** is non-zero only the region described by these rectangles is +** copied to the frame buffer during a flush operation. +*/ +typedef struct +{ + UInt32 num_rects; + IOAccelBounds bounds; + IOAccelBounds rect[0]; +} IOAccelDeviceRegion; + + +/* +** Determine the size of a region. +*/ +#define IOACCEL_SIZEOF_DEVICE_REGION(_rgn_) (sizeof(IOAccelDeviceRegion) + (_rgn_)->num_rects * sizeof(IOAccelBounds)) + + +/* +** Surface client public memory types. Private memory types start with +** kIOAccelNumSurfaceMemoryTypes. +*/ +enum eIOAccelSurfaceMemoryTypes { + kIOAccelNumSurfaceMemoryTypes +}; + + +/* +** Surface client public methods. Private methods start with +** kIOAccelNumSurfaceMethods. +*/ +enum eIOAccelSurfaceMethods { + kIOAccelSurfaceReadLockOptions, + kIOAccelSurfaceReadUnlockOptions, + kIOAccelSurfaceGetState, + kIOAccelSurfaceWriteLockOptions, + kIOAccelSurfaceWriteUnlockOptions, + kIOAccelSurfaceRead, + kIOAccelSurfaceSetShapeBacking, + + kIOAccelSurfaceSetIDMode, + kIOAccelSurfaceSetScale, + + kIOAccelSurfaceSetShape, + kIOAccelSurfaceFlush, + + kIOAccelSurfaceQueryLock, + + kIOAccelSurfaceReadLock, + kIOAccelSurfaceReadUnlock, + kIOAccelSurfaceWriteLock, + kIOAccelSurfaceWriteUnlock, + + kIOAccelSurfaceControl, + kIOAccelSurfaceSetShapeBackingAndLength, + + kIOAccelNumSurfaceMethods +}; + + +/* +** Option bits for IOAccelCreateSurface and the kIOAccelSurfaceSetIDMode method. +** The color depth field can take any value of the _CGSDepth enumeration. +*/ +typedef enum { + kIOAccelSurfaceModeColorDepth1555 = 0x00000003, + kIOAccelSurfaceModeColorDepth8888 = 0x00000004, +// kIOAccelSurfaceModeColorDepthRGB565 = 0x00000005, + kIOAccelSurfaceModeColorDepthYUV = 0x00000006, + kIOAccelSurfaceModeColorDepthYUV9 = 0x00000007, + kIOAccelSurfaceModeColorDepthYUV12 = 0x00000008, + kIOAccelSurfaceModeColorDepthYUV2 = 0x00000009, + kIOAccelSurfaceModeColorDepthBGRA32 = 0x0000000A, + +// kIOAccelSurfaceModeColorDepthRGBA64 = 0x0000000B, +// kIOAccelSurfaceModeColorDepthRGBAFloat64 = 0x0000000C, +// kIOAccelSurfaceModeColorDepthRGBAFloat128 = 0x0000000D, + +// kIOAccelSurfaceModeColorDepthYUV420 = 0x0000000E, + kIOAccelSurfaceModeColorDepth2101010 = 0x0000000F, + + kIOAccelSurfaceModeColorDepthBits = 0x0000000F, + + kIOAccelSurfaceModeStereoBit = 0x00000010, + kIOAccelSurfaceModeWindowedBit = 0x00000020, + + kIOAccelSurfaceModeBeamSync = 0x00008000 +} eIOAccelSurfaceModeBits; + + +/* +** Options bits for IOAccelSetSurfaceShape and the kIOAccelSurfaceSetShape method. +*/ +typedef enum { + kIOAccelSurfaceShapeNone = 0x00000000, + kIOAccelSurfaceShapeNonBlockingBit = 0x00000001, + kIOAccelSurfaceShapeNonSimpleBit = 0x00000002, + kIOAccelSurfaceShapeIdentityScaleBit = 0x00000004, + kIOAccelSurfaceShapeFrameSyncBit = 0x00000008, + kIOAccelSurfaceShapeBeamSyncBit = 0x00000010, + kIOAccelSurfaceShapeStaleBackingBit = 0x00000020, + kIOAccelSurfaceShapeAssemblyBit = 0x00000040, + kIOAccelSurfaceShapeWaitEnabledBit = 0x00000080, + + /* wrong name, use kIOAccelSurfaceShapeNonBlockingBit */ + kIOAccelSurfaceShapeBlockingBit = kIOAccelSurfaceShapeNonBlockingBit +} eIOAccelSurfaceShapeBits; + +/* +** Return bits for the kIOAccelSurfaceGetState method. +*/ +typedef enum { + kIOAccelSurfaceStateNone = 0x00000000, + kIOAccelSurfaceStateIdleBit = 0x00000001 +} eIOAccelSurfaceStateBits; + +/* +** Option bits for the kIOAccelSurfaceSetScale method. +*/ +typedef enum { + kIOAccelSurfaceBeamSyncSwaps = 0x00000001, + kIOAccelSurfaceFixedSource = 0x00000002, + + kIOAccelSurfaceFiltering = 0x000000f0, + kIOAccelSurfaceFilterDefault = 0x00000000, + kIOAccelSurfaceFilterNone = 0x00000010, + kIOAccelSurfaceFilterLinear = 0x00000020 + +} eIOAccelSurfaceScaleBits; + +/* +** Option bits for the kIOAccelSurfaceLock methods. +*/ +typedef enum { + kIOAccelSurfaceLockInBacking = 0, + kIOAccelSurfaceLockInAccel = 1, + kIOAccelSurfaceLockInDontCare = 2, + kIOAccelSurfaceLockInMask = 0x00000003 +} eIOAccelSurfaceLockBits; + +#endif /* _IOACCEL_SURFACE_CONNECT_H */ + diff --git a/i386/include/IOKit/graphics/IOAccelTypes.h b/i386/include/IOKit/graphics/IOAccelTypes.h new file mode 100644 index 0000000..09084c1 --- /dev/null +++ b/i386/include/IOKit/graphics/IOAccelTypes.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOACCEL_TYPES_H +#define _IOACCEL_TYPES_H + +#include +#include + +#define IOACCEL_TYPES_REV 12 + +#if !defined(OSTYPES_K64_REV) && !defined(MAC_OS_X_VERSION_10_6) +#define IOACCELTYPES_10_5 1 +#endif + +/* Integer rectangle in device coordinates */ +typedef struct +{ + SInt16 x; + SInt16 y; + SInt16 w; + SInt16 h; +} IOAccelBounds; + +typedef struct +{ + SInt16 w; + SInt16 h; +} IOAccelSize; + +/* Surface information */ + +enum { + kIOAccelVolatileSurface = 0x00000001, + kIOAccelKeycolorSurface = 0x00000002 +}; + +typedef struct +{ +#if IOACCELTYPES_10_5 + vm_address_t address[4]; +#else + mach_vm_address_t address[4]; +#endif /* IOACCELTYPES_10_5 */ + UInt32 rowBytes; + UInt32 width; + UInt32 height; + UInt32 pixelFormat; + IOOptionBits flags; + IOFixed colorTemperature[4]; + UInt32 typeDependent[4]; +} IOAccelSurfaceInformation; + +typedef struct +{ +#if IOACCELTYPES_10_5 + long x, y, w, h; + void *client_addr; + unsigned long client_row_bytes; +#else + SInt32 x, y, w, h; + mach_vm_address_t client_addr; + UInt32 client_row_bytes; +#endif /* IOACCELTYPES_10_5 */ +} IOAccelSurfaceReadData; + +typedef struct { + IOAccelBounds buffer; + IOAccelSize source; + UInt32 reserved[8]; +} IOAccelSurfaceScaling; + + +typedef SInt32 IOAccelID; + +enum { + kIOAccelPrivateID = 0x00000001 +}; + + +#endif /* _IOACCEL_TYPES_H */ + diff --git a/i386/include/IOKit/graphics/IOAccelerator.h b/i386/include/IOKit/graphics/IOAccelerator.h new file mode 100644 index 0000000..1c2119c --- /dev/null +++ b/i386/include/IOKit/graphics/IOAccelerator.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IO_ACCELERATOR_H +#define _IO_ACCELERATOR_H + +#include +#include + +class IOAccelerator : public IOService +{ + OSDeclareDefaultStructors(IOAccelerator) + +public: + static IOReturn createAccelID(IOOptionBits options, IOAccelID * identifier); + static IOReturn retainAccelID(IOOptionBits options, IOAccelID identifier); + static IOReturn releaseAccelID(IOOptionBits options, IOAccelID identifier); + +}; + + +#endif /* _IO_ACCELERATOR_H */ + diff --git a/i386/include/IOKit/graphics/IODisplay.h b/i386/include/IOKit/graphics/IODisplay.h new file mode 100644 index 0000000..adcfc49 --- /dev/null +++ b/i386/include/IOKit/graphics/IODisplay.h @@ -0,0 +1,292 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IODISPLAY_H +#define _IOKIT_IODISPLAY_H + +#include +#include + +extern const OSSymbol * gIODisplayParametersKey; +extern const OSSymbol * gIODisplayGUIDKey; + +extern const OSSymbol * gIODisplayValueKey; +extern const OSSymbol * gIODisplayMinValueKey; +extern const OSSymbol * gIODisplayMaxValueKey; + +extern const OSSymbol * gIODisplayContrastKey; +extern const OSSymbol * gIODisplayBrightnessKey; +extern const OSSymbol * gIODisplayHorizontalPositionKey; +extern const OSSymbol * gIODisplayHorizontalSizeKey; +extern const OSSymbol * gIODisplayVerticalPositionKey; +extern const OSSymbol * gIODisplayVerticalSizeKey; +extern const OSSymbol * gIODisplayTrapezoidKey; +extern const OSSymbol * gIODisplayPincushionKey; +extern const OSSymbol * gIODisplayParallelogramKey; +extern const OSSymbol * gIODisplayRotationKey; +extern const OSSymbol * gIODisplayOverscanKey; +extern const OSSymbol * gIODisplayVideoBestKey; + +extern const OSSymbol * gIODisplayParametersTheatreModeKey; +extern const OSSymbol * gIODisplayParametersTheatreModeWindowKey; + +extern const OSSymbol * gIODisplayMCCSVersionKey; +extern const OSSymbol * gIODisplayTechnologyTypeKey; +extern const OSSymbol * gIODisplayUsageTimeKey; +extern const OSSymbol * gIODisplayFirmwareLevelKey; + +extern const OSSymbol * gIODisplaySpeakerVolumeKey; +extern const OSSymbol * gIODisplaySpeakerSelectKey; +extern const OSSymbol * gIODisplayMicrophoneVolumeKey; +extern const OSSymbol * gIODisplayAmbientLightSensorKey; +extern const OSSymbol * gIODisplayAudioMuteAndScreenBlankKey; +extern const OSSymbol * gIODisplayAudioTrebleKey; +extern const OSSymbol * gIODisplayAudioBassKey; +extern const OSSymbol * gIODisplayAudioBalanceLRKey; +extern const OSSymbol * gIODisplayAudioProcessorModeKey; +extern const OSSymbol * gIODisplayPowerModeKey; +extern const OSSymbol * gIODisplayManufacturerSpecificKey; + +extern const OSSymbol * gIODisplayParametersCommitKey; +extern const OSSymbol * gIODisplayParametersDefaultKey; +extern const OSSymbol * gIODisplayParametersFlushKey; + +enum { + kIODisplayNumPowerStates = 4, + kIODisplayMaxPowerState = kIODisplayNumPowerStates - 1 +}; + +// these are the private instance variables for power management +struct DisplayPMVars +{ + UInt32 currentState; + // highest state number normally, lowest usable state in emergency + unsigned long maxState; + // true if the display has had power lowered due to user inactivity + bool displayIdle; +}; + +class IODisplayConnect : public IOService +{ + OSDeclareDefaultStructors(IODisplayConnect) + +private: + IOIndex connection; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +public: + virtual bool initWithConnection( IOIndex connection ); + virtual IOFramebuffer * getFramebuffer( void ); + virtual IOIndex getConnection( void ); + virtual IOReturn getAttributeForConnection( IOSelect selector, uintptr_t * value ); + virtual IOReturn setAttributeForConnection( IOSelect selector, uintptr_t value ); + virtual void joinPMtree ( IOService * driver ); +}; + +class IODisplay : public IOService +{ + OSDeclareAbstractStructors(IODisplay) + +public: + static void initialize( void ); + +protected: + // used to query the framebuffer controller + IODisplayConnect * fConnection; + class IODisplayParameterHandler * fParameterHandler; + void * __resv; + IONotifier * fNotifier; + + // pointer to protected instance variables for power management + struct DisplayPMVars * fDisplayPMVars; + + // reserved for future expansion + void * _IODisplay_reserved[32]; + +public: + virtual IOService * probe( IOService * provider, + SInt32 * score ); + + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual void free(); + + virtual IODisplayConnect * getConnection( void ); + + virtual IOReturn getConnectFlagsForDisplayMode( + IODisplayModeID mode, UInt32 * flags ); + + virtual IOReturn getGammaTableByIndex( + UInt32 * channelCount, UInt32 * dataCount, + UInt32 * dataWidth, void ** data ); + + virtual IOReturn readFramebufferEDID( void ); + + // + virtual IOReturn framebufferEvent( IOFramebuffer * framebuffer, + IOIndex event, void * info ); + + // parameter setting + virtual IOReturn setProperties( OSObject * properties ); + virtual bool setForKey( OSDictionary * params, const OSSymbol * key, + SInt32 value, SInt32 min, SInt32 max ); + + static bool addParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 min, SInt32 max ); + static bool setParameter( OSDictionary * params, const OSSymbol * paramName, SInt32 value ); + static OSDictionary * getIntegerRange( OSDictionary * params, const OSSymbol * sym, + SInt32 * value, SInt32 * min, SInt32 * max ); + + // low level set/get + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ); + virtual bool doDataSet( const OSSymbol * paramName, OSData * value ); + virtual bool doUpdate( void ); + + // power management methods + virtual IOReturn setPowerState( unsigned long, IOService * ); + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags ); + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags ); + virtual unsigned long powerStateForDomainState( IOPMPowerFlags ); + + // + virtual void initPowerManagement( IOService * provider); + virtual void dropOneLevel( void ); + virtual void makeDisplayUsable( void ); + +private: + OSMetaClassDeclareReservedUnused(IODisplay, 0); + OSMetaClassDeclareReservedUnused(IODisplay, 1); + OSMetaClassDeclareReservedUnused(IODisplay, 2); + OSMetaClassDeclareReservedUnused(IODisplay, 3); + OSMetaClassDeclareReservedUnused(IODisplay, 4); + OSMetaClassDeclareReservedUnused(IODisplay, 5); + OSMetaClassDeclareReservedUnused(IODisplay, 6); + OSMetaClassDeclareReservedUnused(IODisplay, 7); + OSMetaClassDeclareReservedUnused(IODisplay, 8); + OSMetaClassDeclareReservedUnused(IODisplay, 9); + OSMetaClassDeclareReservedUnused(IODisplay, 10); + OSMetaClassDeclareReservedUnused(IODisplay, 11); + OSMetaClassDeclareReservedUnused(IODisplay, 12); + OSMetaClassDeclareReservedUnused(IODisplay, 13); + OSMetaClassDeclareReservedUnused(IODisplay, 14); + OSMetaClassDeclareReservedUnused(IODisplay, 15); + OSMetaClassDeclareReservedUnused(IODisplay, 16); + OSMetaClassDeclareReservedUnused(IODisplay, 17); + OSMetaClassDeclareReservedUnused(IODisplay, 18); + OSMetaClassDeclareReservedUnused(IODisplay, 19); + +private: + static IOReturn _framebufferEvent( OSObject * self, void * ref, + IOFramebuffer *framebuffer, IOIndex event, void * info ); + + bool addParameterHandler( IODisplayParameterHandler * parameterHandler ); + bool removeParameterHandler( IODisplayParameterHandler * parameterHandler ); + static bool updateNumber( OSDictionary * params, const OSSymbol * key, SInt32 value ); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IOBacklightDisplay : public IODisplay +{ + OSDeclareDefaultStructors(IOBacklightDisplay) + +protected: + // User preferred brightness level + SInt32 fCurrentUserBrightness; + SInt32 fCurrentBrightness; + UInt32 fCurrentPowerState; + SInt32 fMinBrightness; + SInt32 fMaxBrightness; + UInt16 fMaxBrightnessLevel[kIODisplayNumPowerStates]; + +public: + virtual IOService * probe( IOService *, SInt32 * ); + virtual void stop( IOService * provider ); + virtual IOReturn setPowerState( unsigned long, IOService * ); + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags ); + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags ); + virtual unsigned long powerStateForDomainState( IOPMPowerFlags ); + + // + virtual void initPowerManagement( IOService * ); + +public: + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ); + virtual bool doUpdate( void ); + virtual void makeDisplayUsable( void ); + virtual bool setBrightness( SInt32 value ); + +private: + void handlePMSettingCallback(const OSSymbol *, OSObject *, uintptr_t); + + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 0); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 1); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 2); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 3); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 4); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 5); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 6); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 7); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 8); + OSMetaClassDeclareReservedUnused(IOBacklightDisplay, 9); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +class IODisplayParameterHandler : public IOService +{ + OSDeclareDefaultStructors(IODisplayParameterHandler) + +public: + virtual bool setDisplay( IODisplay * display ) = 0; + virtual bool doIntegerSet( OSDictionary * params, + const OSSymbol * paramName, UInt32 value ) = 0; + virtual bool doDataSet( const OSSymbol * paramName, OSData * value ) = 0; + virtual bool doUpdate( void ) = 0; + +private: + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 0); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 1); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 2); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 3); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 4); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 5); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 6); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 7); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 8); + OSMetaClassDeclareReservedUnused(IODisplayParameterHandler, 9); +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* ! _IOKIT_IODISPLAY_H */ + diff --git a/i386/include/IOKit/graphics/IOFramebuffer.h b/i386/include/IOKit/graphics/IOFramebuffer.h new file mode 100644 index 0000000..16a5ffd --- /dev/null +++ b/i386/include/IOKit/graphics/IOFramebuffer.h @@ -0,0 +1,827 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFRAMEBUFFER_H +#define _IOKIT_IOFRAMEBUFFER_H + +#include +#include +#include +#include +#include + +class IOFramebuffer; +class IOBufferMemoryDescriptor; + +typedef void (*CursorBlitProc)( + IOFramebuffer * inst, + void * shmem, + volatile unsigned char *vramPtr, + unsigned int cursStart, + unsigned int vramRow, + unsigned int cursRow, + int width, + int height ); + +typedef void (*CursorRemoveProc)( + IOFramebuffer * inst, + void * shmem, + volatile unsigned char *vramPtr, + unsigned int vramRow, + int width, + int height ); + + +typedef void * IOFBCursorRef; + +struct IOFBCursorControlCallouts { + IOReturn (*setCursorImage) (void * self, void * ref, + IOHardwareCursorDescriptor * description, IOFBCursorRef cursorImage); + IOReturn (*setCursorState) (void * self, void * ref, + SInt32 x, SInt32 y, bool visible); + UInt32 reserved[30]; +}; +typedef struct IOFBCursorControlCallouts IOFBCursorControlCallouts; + +struct IOFBCursorControlAttribute { + void * self; + void * ref; + const IOFBCursorControlCallouts * callouts; + UInt32 reserved[29]; +}; +typedef struct IOFBCursorControlAttribute IOFBCursorControlAttribute; + +// clock & data values +enum { + kIODDCLow = 0, + kIODDCHigh = 1, + kIODDCTristate = 2 +}; +// ddcBlockType constants +enum { + // EDID block type. + kIODDCBlockTypeEDID = 0 +}; + +// ddcFlags constants +enum { + // Force a new read of the EDID. + kIODDCForceRead = 0x00000001 +}; + +enum { + kDisabledInterruptState = 0, + kEnabledInterruptState = 1 +}; + +typedef void (*IOFBInterruptProc)( OSObject * target, void * ref ); + + +typedef IOReturn (*IOFramebufferNotificationHandler) + (OSObject * self, void * ref, + IOFramebuffer * framebuffer, IOIndex event, + void * info); + +// IOFramebufferNotificationHandler events +enum { + kIOFBNotifyDisplayModeWillChange = 1, + kIOFBNotifyDisplayModeDidChange = 2, + + kIOFBNotifyWillSleep = 3, + kIOFBNotifyDidWake = 4, + + kIOFBNotifyDidPowerOff = 5, + kIOFBNotifyWillPowerOn = 6, + + kIOFBNotifyDidSleep = kIOFBNotifyDidPowerOff, + kIOFBNotifyWillWake = kIOFBNotifyWillPowerOn, + + kIOFBNotifyWillPowerOff = 7, + kIOFBNotifyDidPowerOn = 8, + + kIOFBNotifyWillChangeSpeed = 9, + kIOFBNotifyDidChangeSpeed = 10, + + kIOFBNotifyClamshellChange = 20, + + kIOFBNotifyCaptureChange = 30, + + kIOFBNotifyOnlineChange = 40, + + kIOFBNotifyDisplayDimsChange = 50, + + kIOFBNotifyProbed = 60, +}; + +enum { + kFBDisplayUsablePowerState = 0x80000000, + kFBDisplayPowerStateMask = 0x0000ffff +}; + +#define kIOFBDependentIDKey "IOFBDependentID" +#define kIOFBDependentIndexKey "IOFBDependentIndex" + +struct StdFBShmem_t; +class IOFramebufferUserClient; + +/*! @class IOFramebuffer : public IOGraphicsDevice + @abstract The base class for graphics devices to be made available as part of the desktop. + @discussion The IOFramebuffer base class defines APIs used to publish a linear framebuffer device. Device driver writers should subclass this class to provide a X native driver. Mac OS X will also utilize 'ndrv' drivers via a subclass of IOFramebuffer IONDRVFramebuffer that does not require device driver writers to provide a X native driver. + + There are no in kernel clients of IOFramebuffer aside from rudimentary console and panic UI supported by the IOFramebuffer class. The IOFramebuffer class provides the IOUserClient implementation to allow the CoreGraphics server to provide the user accessible interface to all displays on a Mac OS X system, and this is further layered underneath application frameworks. Device driver writers should not need any knowledge of this part of the interfaces. Similarly the instance variables of IOFramebuffer are mostly used for cursor rendering which is handled by the IOFramebuffer class, and should be avoided by subclass implementors. Only IOFramebuffer methods with header documentation in this header are designed for subclasses to implement. + + IOFramebuffer provides simple dumb framebuffer operation - accceleration for 2D, 3D and video may be provided by a separate implementation of the IOAccelerator class. +*/ + +class IOFramebuffer : public IOGraphicsDevice +{ + friend class IOFramebufferUserClient; + friend class IOFramebufferSharedUserClient; + friend class IODisplay; + + OSDeclareDefaultStructors(IOFramebuffer) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +private: + +protected: + StdFBShmem_t * priv; + int shmemClientVersion; + IOBufferMemoryDescriptor * sharedCursor; + + union { + struct { + /* Mapping tables used in cursor drawing to 5-5-5 displays. */ + unsigned char * _bm34To35SampleTable; + unsigned char * _bm35To34SampleTable; + /* Mapping tables used in cursor drawing to 8-bit RGB displays. */ + unsigned int * _bm256To38SampleTable; + unsigned char * _bm38To256SampleTable; + } t; + UInt8 * tables[ 4 ]; + } colorConvert; + + /* cursor blitting vars */ + CursorBlitProc cursorBlitProc; + CursorRemoveProc cursorRemoveProc; + + IOGSize maxCursorSize; + void * _IOFramebuffer_reservedE[7]; + const char * thisName; + volatile unsigned char * cursorSave; + unsigned int white; + + IOGPoint nextCursorLoc; + int nextCursorFrame; + SInt32 connectChange; + semaphore_t vblSemaphore; + + /* memory ranges */ + volatile unsigned char * frameBuffer; + unsigned int totalWidth; + unsigned int rowBytes; + unsigned int bytesPerPixel; + + IOMemoryMap * vramMap; + IOByteCount vramMapOffset; + OSArray * userAccessRanges; + unsigned int suspended:1; + unsigned int captured:1; + unsigned int sleepConnectCheck:1; + unsigned int messaged:1; + unsigned int _IOFramebuffer_reservedC:28; + IOFramebuffer * nextDependent; + OSSet * fbNotifications; + + class IOFramebufferUserClient * serverConnect; + class IOFramebufferSharedUserClient * sharedConnect; + + unsigned int opened:1; + unsigned int dead:1; + unsigned int configPending:1; + unsigned int serverNotified:1; + unsigned int serverState:1; + unsigned int serverPendingAck:1; + unsigned int isUsable:1; + unsigned int mirrored:1; + unsigned int pendingPowerState:4; + unsigned int pendingPowerChange:1; + unsigned int pagingState:1; + unsigned int mirrorPrimary:1; + unsigned int mirrorSWCursor:1; + + bool clutValid; + bool currentMono; + bool needCursorService; + bool haveVBLService; + bool haveHWCursor; + bool hwCursorLoaded; + + void * serverMsg; + IOInterruptEventSource * deferredEvents; + + /* Reserved for future expansion. */ + int _IOFramebuffer_reserved[5]; + +private: + struct IOFramebufferPrivate * __private; + +public: +/*! @function doI2CRequest + @abstract Carry out an I2C request. + @discussion IOFramebuffer subclasses may optionally implement this method to perform I2C bus requests on one of the buses they support. Alternatively they may implement the setDDCClock(), setDDCData(), readDDCClock(), readDDCData() methods and respond from getAttributeForConnection() to the kConnectionSupportsLLDDCSense attribute with success, in which case IOFramebuffer::doI2CRequest() will carry out a software implementation of I2C using the low level routines and conforming to the timing constraints passed in the timing parameter. Subclasses may pass timing parameters tuned for the specific bus, otherwise VESA DDC defaults will apply. + @timing event Subclasses may pass timing parameters tuned for the specific bus, otherwise if NULL, VESA DDC defaults will apply. + @param request An IOI2CRequest structure. The request should be carried out synchronously if the completion routine is NULL, otherwise it may optionally be carried out asynchronously. The completion routine should be called if supplied. + @result an IOReturn code. If kIOReturnSuccces, the result of the transaction is returned in the requests result field. +*/ + virtual IOReturn doI2CRequest( UInt32 bus, struct IOI2CBusTiming * timing, struct IOI2CRequest * request ); + +private: + OSMetaClassDeclareReservedUsed(IOFramebuffer, 0); + + OSMetaClassDeclareReservedUnused(IOFramebuffer, 1); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 2); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 3); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 4); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 5); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 6); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 7); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 8); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 9); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 10); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 11); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 12); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 13); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 14); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 15); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 16); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 17); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 18); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 19); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 20); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 21); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 22); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 23); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 24); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 25); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 26); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 27); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 28); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 29); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 30); + OSMetaClassDeclareReservedUnused(IOFramebuffer, 31); + + +public: + static void initialize(); + + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + virtual IOService * probe( IOService * provider, SInt32 * score ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual void free(); + virtual IOWorkLoop * getWorkLoop() const; + + IOWorkLoop * getGraphicsSystemWorkLoop() const; + IOWorkLoop * getControllerWorkLoop() const; + + virtual IOReturn requestProbe( IOOptionBits options ); + + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags, unsigned long, IOService* ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags, unsigned long, IOService* ); + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService * device); + virtual IOReturn setAggressiveness( unsigned long type, unsigned long newLevel ); + virtual IOReturn getAggressiveness( unsigned long type, unsigned long * currentLevel ); + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler ); + virtual IOReturn callPlatformFunction( const OSSymbol * functionName, + bool waitForFunction, + void *p1, void *p2, + void *p3, void *p4 ); + + virtual void hideCursor( void ); + virtual void showCursor( IOGPoint * cursorLoc, int frame ); + virtual void moveCursor( IOGPoint * cursorLoc, int frame ); + // virtual + void resetCursor( void ); + + virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ); + + virtual void getBoundingRect ( IOGBounds ** bounds ); + + virtual IOReturn open( void ); + + virtual void close( void ); + + virtual bool isConsoleDevice( void ); + + virtual IOReturn setupForCurrentConfig( void ); + + virtual bool serializeInfo( OSSerialize * s ); + virtual bool setNumber( OSDictionary * dict, const char * key, + UInt32 number ); + + IONotifier * addFramebufferNotification( + IOFramebufferNotificationHandler handler, + OSObject * self, void * ref); + +/*! @function getApertureRange + @abstract Return reference to IODeviceMemory object representing memory range of framebuffer. + @discussion IOFramebuffer subclasses must implement this method to describe the memory used by the framebuffer in the current mode. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers. + @param aperture The system will only access the aperture kIOFBSystemAperture. + @result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call. +*/ + + virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ) = 0; + +/*! @function getVRAMRange + @abstract Return reference to IODeviceMemory object representing memory range of all the cards vram. + @discussion IOFramebuffer subclasses should implement this method to describe all the vram memory available on the card. The OS will map this memory range into user space for client access - the range should only include vram memory not hardware registers. + @result an IODeviceMemory instance. A reference will be consumed by the caller for each call of this method - the implementatation should create a new instance of IODeviceMemory for each call, or return one instance with a retain for each call. +*/ + + virtual IODeviceMemory * getVRAMRange( void ); + +protected: + +/*! @function handleEvent + @abstract Notify IOFramebuffer superclass code of events. + @discussion IOFramebuffer subclasses should call this IOFramebuffer method on certain power state changes. + @param event The event that has occurred:
+ kIOFBNotifyWillPowerOff call before entering a state other than the maximum.
+ kIOFBNotifyDidPowerOn call after entering the maximum power state.
+ kIOFBNotifyWillPowerOff call before entering a state other than the maximum.
+ kIOFBNotifyDidPowerOn call after entering a state other than the maximum.
+ @param info None of the above events require additional info, pass zero. + @result an IOReturn code, safely ignored. +*/ + + IOReturn handleEvent( IOIndex event, void * info = 0 ); + + + IOReturn deliverFramebufferNotification( + IOIndex event, void * info = 0 ); + +#ifdef IOFRAMEBUFFER_PRIVATE +#include +#endif + +public: +/*! @function enableController + @abstract Perform first time setup of the framebuffer. + @discussion IOFramebuffer subclasses should perform their initialization of the hardware here. The IOService start() method is not called at a time appropriate for this initialization. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn enableController( void ); + +/*! @function getPixelFormats + @abstract List the pixel formats the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return an array of strings representing the possible pixel formats available in the framebuffer. + @result A const char * pointer. The string consists of a concatenation of each pixel format string separated by the NULL character. The commonly supported pixel formats for Mac OS X are defined as IO8BitIndexedPixels, IO16BitDirectPixels, IO32BitDirectPixels. +*/ + + virtual const char * getPixelFormats( void ) = 0; + +/*! @function getDisplayModeCount + @abstract Return the number of display modes the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return a count of the display modes available. This count should change unless a connection change is posted for the device indicated the framebuffer and/or display configuration has changed. + @result A count of the display modes available. +*/ + + virtual IOItemCount getDisplayModeCount( void ) = 0; + +/*! @function getDisplayModes + @abstract Return the number of display modes the framebuffer supports. + @discussion IOFramebuffer subclasses must implement this method to return an array of display mode IDs available for the framebuffer. The IDs are defined by the driver in the range 0x00000001 - 0x7fffffff, and should be constant for a given display mode. + @param allDisplayModes A caller allocated buffer with the size given by the result of getDisplayModeCount(). + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ) = 0; + +/*! @function getInformationForDisplayMode + @abstract Return information about a given display mode. + @discussion IOFramebuffer subclasses must implement this method to return information in the IODisplayModeInformation structure for the display mode with the passed ID. + @param displayMode A display mode ID previously returned by getDisplayModes(). + @param info Pointer to a structure of type IODisplayModeInformation to be filled out by the driver. IODisplayModeInformation is documented in IOGraphicsTypes.h. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode, + IODisplayModeInformation * info ) = 0; + +/*! @function getPixelFormatsForDisplayMode + @abstract Obsolete. + @discussion IOFramebuffer subclasses must implement this method to return zero. + @param displayMode Ignored. + @param depth Ignored. + @result Return zero. +*/ + + virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode, + IOIndex depth ) = 0; + +/*! @function getPixelInformation + @abstract Return information about the framebuffer format for a given display mode and depth. + @discussion IOFramebuffer subclasses must implement this method to return information in the IOPixelInformation structure for the display mode with the passed ID, depth index and aperture. The aperture utilized by the system is always kIOFBSystemAperture. Drivers may define alternative apertures, being a view of the framebuffer in a different pixel format from the default. + @param displayMode A display mode ID previously returned by getDisplayModes(). + @param depth An index from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure (inclusive). + @param info Pointer to a structure of type IOPixelInformation to be filled out by the driver. IOPixelInformation is documented in IOGraphicsTypes.h. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getPixelInformation( + IODisplayModeID displayMode, IOIndex depth, + IOPixelAperture aperture, IOPixelInformation * pixelInfo ) = 0; + +/*! @function getCurrentDisplayMode + @abstract Return the framebuffers current display mode and depth. + @discussion IOFramebuffer subclasses must implement this method to return the current mode and depth. + @param displayMode A display mode ID representing the current mode. + @param depth An index indicating the depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ) = 0; + +/*! @function setCurrentDisplayMode + @abstract Set the framebuffers current display mode and depth. + @discussion IOFramebuffer subclasses should implement this method to set the current mode and depth. Other than at enableController() time, this is the only method that should change the framebuffer format and is synchronized with clients and attached accelerators to make sure access to the device is disallowed during the change. + @param displayMode A display mode ID representing the new mode. + @param depth An index indicating the new depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn setDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + +/*! @function setApertureEnable + @abstract Enable an aperture on the framebuffer (usually unimplemented, no OS usage). + @discussion IOFramebuffer subclasses may implement this method to set enable a non standard aperture. The system does not call this method. + @param aperture A device specific aperture index. + @param enable Device specific mask of options. + @result an IOReturn code. +*/ + + virtual IOReturn setApertureEnable( IOPixelAperture aperture, + IOOptionBits enable ); + +/*! @function setStartupDisplayMode + @abstract Set the framebuffers display mode and depth to be used during boot and at startup. + @discussion IOFramebuffer subclasses should implement this method to set the mode and depth to be used during boot and at startup, to reduce needed mode changes during boot when the display connection type is the same. If possible this mode should also be used by the OpenFirmware driver for the card. + @param displayMode A display mode ID representing the new startup mode. + @param depth An index indicating the new startup depth configuration of the framebuffer. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. +*/ + + virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + +/*! @function getCurrentDisplayMode + @abstract Return the framebuffers display mode and depth to be used during boot and at startup. + @discussion IOFramebuffer subclasses should implement this method to return the current mode and depth. + @param displayMode A display mode ID representing the mode used during startup. + @param depth An index indicating the depth configuration of the framebuffer used during startup. The index should range from zero to the value of the maxDepthIndex field from the IODisplayModeInformation structure for the display mode. + @result an IOReturn code. +*/ + + virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + +/*! @function setCLUTWithEntries + @abstract Set the color lookup table to be used by the framebuffer in indexed modes. + @discussion IOFramebuffer subclasses may implement this method to allow a palette to be set for indexed display modes. It will not be called on framebuffers in direct display modes. + @param colors A pointer to an array of numEntries RGB color entries. + @param index The index of the first entry to set. + @param numEntries The number of entries in the table. + @param options Options controlling the operation.
+ kSetCLUTByValue is set if the index field of each entry should be used to set the table sparsely, otherwise consecutive entries from the index parameter should be set.
+ kSetCLUTImmediately is set if the CLUT set should not be synchronized with the vertical blank, otherwise it should.
+ kSetCLUTWithLuminance is set if the CLUT should be set to a gray value equivalent in luminance to the passed color entry.
+ @result an IOReturn code. +*/ + + virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index, + UInt32 numEntries, IOOptionBits options ); + +/*! @function setGammaTable + @abstract Set the gamma table to be used by the framebuffer. + @discussion IOFramebuffer subclasses should implement this method to allow a gamma table to be set. + @param channelCount Defines the number of channels in the supplied data. OS X will pass three for separate R, G, B data, or one if the same data should apply to all channels. + @param dataCount The number of data entries per channel. + @param dataWidth The number of bits in each entry. 8 for Mac OS X 10.1 and earlier, 16 for later releases. + @param data The packed array of correction data. Data is passed for the R (or single) channel followed by the G & B channels. Each entry is one or two bytes (if dataWidth > 8). + @result an IOReturn code. +*/ + + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data ); + +/*! @function setAttribute + @abstract Generic method to set some attribute of the framebuffer device. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOPowerAttribute The IOFramebuffer class implements most power management (IOService) methods. It calls the subclass to carry out the power management state change with this attribute. When carrying out power state changes, the subclass should call IOFramebuffer::handleEvent for certain changes - set that method for more information. + @param value The new value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value ); + +/*! @function getAttribute + @abstract Generic method to retrieve some attribute of the framebuffer device. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOHardwareCursorAttribute If the device supports a hardware cursor and implements the setCursorImage() and setCursorState() calls it should return true for this attribute. + @param value Returns the value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value ); + +/*! @function getTimingInfoForDisplayMode + @abstract Returns a timing description for a display mode. + @discussion IOFramebuffer subclasses should implement this method to return timing information for a display mode. This allows the OS to enable display modes based on its knowledge of the connected display type. Two types of timing information are defined, by Apple defined constant, or by a detailed description of the timing parameters of the mode. + @param displayMode A display mode ID representing the mode to examine. + @param info The driver returns the information for the display mode in this structure.
+ If the mode has an Apple defined constant, such as timingVESA_1024x768_75hz, it should be returned in the appleTimingID field. Otherwise the field should be set to timingInvalid.
+ If the driver is able to supply detailed timing information, it should return it in the detailedInfo.v2 field of the structure, otherwise the driver should clear the kIODetailedTimingValid flag from the flags field.
+ The IODetailedTimingInformationV2 structure is documented in IOGraphicsTypes.h + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from using the device. +*/ + + virtual IOReturn getTimingInfoForDisplayMode( + IODisplayModeID displayMode, IOTimingInformation * info ); + +/*! @function validateDetailedTiming + @abstract Reports whether a detailed timing is able to be programmed with the device. + @discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. + @param description A pointer to a IODetailedTimingInformationV2 structure. The driver should examine this description and change any fields that it cannot implement to reflect its closest possible implementation. + @param descripSize sizeof(IODetailedTimingInformationV2) + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable mode. +*/ + + virtual IOReturn validateDetailedTiming( + void * description, IOByteCount descripSize ); + +/*! @function setDetailedTimings + @abstract Installs an array of OS programmed detailed timings to be made available by the driver. + @discussion IOFramebuffer subclasses may implement programmable mode functionality where the OS is able to install modes described by a detailed timing into the driver. The driver needs to add these modes to its internal mode list if it provides this functionality. + @param array An OSArray of OSData objects. Each OSData contains one IODetailedTimingInformationV2 structure. All the data described by the array should be copied or retained by this call until the next invocation of this method. + @result an IOReturn code. A return other than kIOReturnSuccess will prevent the system from installing the programmable modes. +*/ + + virtual IOReturn setDetailedTimings( OSArray * array ); + +/*! @function getConnectionCount + @abstract Reports the number of display connections the device supports, driven from one framebuffer. + @discussion IOFramebuffer subclasses may implement functionality where a single framebuffer drives multiple displays. This is not recommended or fully supported and instead multihead cards should implement multiple instances of IOFramebuffer objects to provide full functionality. + @result A count of the number of display connections reported by the framebuffer. Current versions of OS X only support one connection completely. +*/ + + virtual IOItemCount getConnectionCount( void ); + + +/*! @function setAttributeForConnection + @abstract Generic method to set some attribute of the framebuffer device, specific to one display connection. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be set, specific to one display connection. + @param attribute Defines the attribute to be set. Some defined attributes are:
+ kIOCapturedAttribute If the device supports hotplugging displays, it should disable the generation of hot plug interrupts when the attribute kIOCapturedAttribute is set to true. + @param value The new value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn setAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t value ); + +/*! @function getAttributeForConnection + @abstract Generic method to retrieve some attribute of the framebuffer device, specific to one display connection. + @discussion IOFramebuffer subclasses may implement this method to allow arbitrary attribute/value pairs to be returned, specific to one display connection. + @param attribute Defines the attribute to be returned. Some defined attributes are:
+ kConnectionSupportsHLDDCSense If the framebuffer supports the DDC methods hasDDCConnect() and getDDCBlock() it should return success (and no value) for this attribute.
+ kConnectionSupportsLLDDCSense If the framebuffer wishes to make use of IOFramebuffer::doI2CRequest software implementation of I2C it should implement the I2C methods setDDCClock(), setDDCData(), readDDCClock(), readDDCData(), and it should return success (and no value) for this attribute.
+ @param value Returns the value for the attribute. + @result an IOReturn code. +*/ + + virtual IOReturn getAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); + +/*! @function convertCursorImage + @abstract Utility method of IOFramebuffer to convert cursor image to a hardware cursor format. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should pass the cursor image given by the setCursorImage() method, with a description of their hardware cursor format, to this helper function to this routine to convert the image to one suitable for the hardware. + @param cursorImage Opaque cursor parameter from the setCursorImage() call. + @param description Describes the cursor format supported by the driver. + @param cursor Structure describing the drivers allocated buffer to receive the converted image. + @result a bool indicating the conversion was successful. +*/ + + virtual bool convertCursorImage( void * cursorImage, + IOHardwareCursorDescriptor * description, + IOHardwareCursorInfo * cursor ); + +/*! @function setCursorImage + @abstract Set a new image for the hardware cursor. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the hardware cursor image. The image should be passed to the convertCursorImage() method with each type of cursor format the hardware supports until success, if all fail the hardware cursor should be hidden and kIOReturnUnsupported returned. + @param cursorImage Opaque cursor description. This should be passed to the convertCursorImage() method to convert to a format specific to the hardware. + @result An IOReturn code. +*/ + + virtual IOReturn setCursorImage( void * cursorImage ); + +/*! @function setCursorState + @abstract Set a new position and visibility for the hardware cursor. + @discussion IOFramebuffer subclasses may implement hardware cursor functionality, if so they should implement this method to change the position and visibility of the cursor. + @param x Left coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen. + @param y Top coordinate of the cursor image. A signed value, will be negative if the cursor's hot spot and position place it partly offscreen. + @param visible Visible state of the cursor. + @result An IOReturn code. +*/ + + virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible ); + +/*! @function flushCursor + @abstract Perform any needed cache flushing after software cursor rendering. + @discussion IOFramebuffer implements software cursor functionality when a hardware cursor is unavailable. Some hardware may need to flush a cache after the processor has finished lifting and dropping the software cursor. +*/ + + virtual void flushCursor( void ); + +/*! @function getAppleSense + @abstract Return display sense information for legacy Apple sensing. + @discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return sense information. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param senseType Return zero to indicate legacy Apple sensing. + @param primary Return the value of the primary Apple sense code. + @param extended Return the value of the secondary Apple sense code. + @param displayType Return an Apple defined constant for the type of display sensed. For example, kVGAConnect, kNTSCConnect, kPALConnect etc. + @result An IOReturn code. +*/ + + virtual IOReturn getAppleSense( IOIndex connectIndex, + UInt32 * senseType, + UInt32 * primary, + UInt32 * extended, + UInt32 * displayType ); + +/*! @function connectFlags + @abstract Return display sense information for legacy Apple sensing. + @discussion Hardware that supports simple display sensing, or the classic 3 pin Apple sensing described in Designing Cards and Drivers, should implement this method to return mode flags relative to the sensed display. If this method is unimplemented, all modes have are given the flags kDisplayModeValidFlag | kDisplayModeSafeFlag. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param displayMode A display mode ID. + @param flags Return the flags value for the given mode with the connected display. Flags are:
+ kDisplayModeValidFlag - mode is considered valid for the connected display by the driver. + kDisplayModeSafeFlag - mode is considered safe (not requiring mode change confirmation) for the connected display by the driver. + kDisplayModeDefaultFlag - mode is considered default for the connected display by the driver. + @result An IOReturn code. +*/ + + virtual IOReturn connectFlags( IOIndex connectIndex, + IODisplayModeID displayMode, IOOptionBits * flags ); + + //// IOLowLevelDDCSense + +/*! @function setDDCClock + @abstract Sets the state of the I2C clock line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C clock line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @param value One of kIODDCLow, kIODDCHigh, kIODDCTristate. +*/ + + virtual void setDDCClock( IOIndex bus, UInt32 value ); + +/*! @function setDDCData + @abstract Sets the state of the I2C data line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to set the state of the I2C data line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @param value One of kIODDCLow, kIODDCHigh, kIODDCTristate. +*/ + virtual void setDDCData( IOIndex bus, UInt32 value ); + +/*! @function readDDCClock + @abstract Reads the input state of the I2C clock line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C clock line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @result A boolean reflecting the current state of the clock line on the given bus. +*/ + virtual bool readDDCClock( IOIndex bus ); + +/*! @function readDDCData + @abstract Reads the input state of the I2C data line on a bus. + @discussion Framebuffers making use of the IOFramebuffer::doI2CRequest() software implementation of I2C should implement this method to return the input state of the I2C data line on the given bus. Otherwise may be unimplemented. + @param bus Index of the bus. + @result A boolean reflecting the current state of the data line on the given bus. +*/ + virtual bool readDDCData( IOIndex bus ); + + virtual IOReturn enableDDCRaster( bool enable ); + +/*! @function hasDDCConnect + @abstract Return display DDC connect state. + @discussion Hardware that supports DDC/EDID display sensing should implement this method to return true if a DDC display is detected. They should also return success for the connection attribute kConnectionSupportsHLDDCSense (from getAttributeForConnection()). + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @result True if a DDC display is detected. +*/ + + virtual bool hasDDCConnect( IOIndex connectIndex ); + +/*! @function getDDCBlock + @abstract Return display EDID data. + @discussion Hardware that supports DDC/EDID display sensing should implement this method to return EDID data in 128 byte blocks. + @param connectIndex Index of the display connection, from zero to the value of getConnectionCount(). + @param blockNumber Block number, ranging from one to the number of blocks return by the display. + @param blockType kIODDCBlockTypeEDID will be passed. + @param options No options are currently defined. + @param data Caller allocated buffer to receive the blocks data. + @param length In/out parameter - callers allocated buffer size, driver returns actual size. + @result An IOReturn code. +*/ + + virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber, + IOSelect blockType, IOOptionBits options, + UInt8 * data, IOByteCount * length ); + +/*! @function registerForInterruptType + @abstract Set callbacks for driver to call on interrupt events. + @discussion The IOFramebuffer class will call its subclasses to set callbacks to be called on interrupt events generated by hardware events. Only two are currently in use - vertical blank interrupts and connection changed interrupts. + @param interruptType One of these constants:
+ kIOFBVBLInterruptType Specifying a vertical blanking interrupt. + kIOFBConnectInterruptType Specify the display connection should be resensed. + @param proc C callback to be called by the driver when the specified event occurs. + @param target Target parameter for the callback proc. + @param ref Ref parameter for the callback proc. + @param interruptRef The subclass should return an opaque reference to the installed interrupt handler, for use with unregisterInterrupt() and setInterruptState(). + @result An IOReturn code. +*/ + + virtual IOReturn registerForInterruptType( IOSelect interruptType, + IOFBInterruptProc proc, OSObject * target, void * ref, + void ** interruptRef ); + +/*! @function unregisterInterrupt + @abstract Remove a callback previously installed by registerForInterruptType(). + @discussion Remove a callback previously installed by registerForInterruptType(). + @param interruptRef The interruptRef returned from the registerForInterruptType call that installed the interrupt. + @result An IOReturn code. +*/ + + virtual IOReturn unregisterInterrupt( void * interruptRef ); + +/*! @function unregisterInterrupt + @abstract Enable or disable a callback previously installed by registerForInterruptType(). + @discussion Enable or disable a callback previously installed by registerForInterruptType(). + @param state True or false to enable the callback. + @result An IOReturn code. +*/ + + virtual IOReturn setInterruptState( void * interruptRef, UInt32 state ); + + virtual IOReturn getNotificationSemaphore( IOSelect interruptType, + semaphore_t * semaphore ); + +/* non WL clients apis +*/ + IOReturn setAttributeExt( IOSelect attribute, uintptr_t value ); + + IOReturn getAttributeExt( IOSelect attribute, uintptr_t * value ); + + IOReturn setAttributeForConnectionExt( IOIndex connectIndex, + IOSelect attribute, uintptr_t value ); + + IOReturn getAttributeForConnectionExt( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); +}; + +#endif /* ! _IOKIT_IOFRAMEBUFFER_H */ diff --git a/i386/include/IOKit/graphics/IOFramebufferShared.h b/i386/include/IOKit/graphics/IOFramebufferShared.h new file mode 100644 index 0000000..7f01ff3 --- /dev/null +++ b/i386/include/IOKit/graphics/IOFramebufferShared.h @@ -0,0 +1,255 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFRAMEBUFFERSHARED_H +#define _IOKIT_IOFRAMEBUFFERSHARED_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! @header IOFramebufferShared +The IOFramebufferShared.h header contains definitions of objects and types shared between a kernel level IOFrameBuffer service and a non-kernel window server. In Mac OS X this structure is used by the CoreGraphics server and IOGraphics Family, and is not available to other clients. IOFramebuffer subclasses and IOFramebuffer clients within the kernel should also not rely on this structure definition and constants. It is public only for use on Darwin based window servers. Cursor and window server state data is exchanged by kernel and non-kernel tasks through a slice of shared memory containing a StdFBShmem_t structure.
+For a non-kernel task to get access to this slice of shared memory, a connection to an IOFramebuffer service must be made. A connection is made with the IOServiceOpen() function described in IOKitLib.h. A connection type of kIOFBServerConnectType or kIOFBSharedConnectType (for read-only access) should be specified. An io_connect_t handle is returned by IOServiceOpen(). This handle must be passed to IOFBCreateSharedCursor() to create the slice of shared memory. Then IOConnectMapMemory() may be called with a memory type of kIOFBCursorMemory to map the shared memory into the non-kernel task. +*/ + +#ifdef KERNEL +// CGS use optional +/*! @defined IOFB_ARBITRARY_SIZE_CURSOR + @discussion When IOFB_ARBITRARY_SIZE_CURSOR is not defined, the maximum cursor size is assumed to be CURSORWIDTH x CURSORHEIGHT and this header file will define a number of structures for storing cursor images accordingly. A non-kernel task may define IOFB_ARBITRARY_SIZE_CURSOR and use cursors up to the size specified when IOFBCreateSharedCursor() was called. In this case appropriate structures for storing cursor images must be defined elsewhere. In the kernel, IOFB_ARBITRARY_SIZE_CURSOR is always defined. +*/ +#define IOFB_ARBITRARY_SIZE_CURSOR +#define IOFB_ARBITRARY_FRAMES_CURSOR 1 +#endif + +#define IOFB_SUPPORTS_XOR_CURSOR +#define IOFB_SUPPORTS_HW_SHIELD +#define IOFB_SUPPORTS_ARBITRARY_FRAMES_CURSOR + +// +// Cursor and Window Server state data, occupying a slice of shared memory +// between the kernel and WindowServer. +// +/*! @enum CursorParameters + @constant kIOFBNumCursorFrames The number of cursor images stored in the StdFBShmem_t structure. + @constant kIOFBNumCursorFramesShift Used with waiting cursors. + @constant kIOFBMaxCursorDepth The maximum cursor pixel depth. +*/ +enum { +#if IOFB_ARBITRARY_FRAMES_CURSOR + kIOFBMainCursorIndex = 0, + kIOFBWaitCursorIndex = 1, + kIOFBNumCursorIndex = 4, +#else + kIOFBNumCursorFrames = 4, + kIOFBNumCursorFramesShift = 2, +#endif + kIOFBMaxCursorDepth = 32 +}; + +#ifndef IOFB_ARBITRARY_SIZE_CURSOR + +/*! @defined CURSORWIDTH + @discussion The maximum width of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. +*/ +#define CURSORWIDTH 16 /* width in pixels */ + +/*! @defined CURSORHEIGHT + @discussion The maximum height of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. +*/ +#define CURSORHEIGHT 16 /* height in pixels */ + +/*! @struct bm12Cursor + @abstract Cursor image for 1-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 1-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array contains the cursor images. + @field mask This array contains the cursor mask. + @field save This array stores the pixel values of the region underneath the cursor in its last drawn position. +*/ +struct bm12Cursor { + unsigned int image[4][16]; + unsigned int mask[4][16]; + unsigned int save[16]; +}; + +/*! @struct bm18Cursor + @abstract Cursor image for 8-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 8-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array contains cursor color values, which are converted to displayed colors through the color table. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. + @field mask This array contains the cursor alpha mask. The array is two dimensional with the same indexing as the image. If an alpha mask pixel is 0 and the corresponding image pixel is set to white for the display, then this cursor pixel will invert pixels on the display. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm18Cursor { + unsigned char image[4][256]; + unsigned char mask[4][256]; + unsigned char save[256]; +}; + +/*! @struct bm34Cursor + @abstract Cursor image for 15-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 15-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. A value of 0 means the pixel is transparent. Non-zero values are stored with the red, green, blue, and alpha values encoded with the following masks:
+ red mask = 0xF000
+ blue mask 0x0F00
+ green mask 0x00F0
+ alpha mask = 0x000F
+Note, only 4 bits are allocated for each color component. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm34Cursor { + unsigned short image[4][256]; + unsigned short save[256]; +}; + +/*! @struct bm38Cursor + @abstract Cursor image for 24-bit cursor. + @discussion This structure stores 16 pixel x 16 pixel cursors to be used with 24-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. + @field image This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. The lower 24 bits of a pixel's value contain the RGB color, while the upper 8 bits contain the alpha value. + @field save This array stores the color values of the region underneath the cursor in its last drawn position. +*/ +struct bm38Cursor { + unsigned int image[4][256]; + unsigned int save[256]; +}; + +#endif /* IOFB_ARBITRARY_SIZE_CURSOR */ + +enum { + kIOFBCursorImageNew = 0x01, + kIOFBCursorHWCapable = 0x02 +}; +enum { + kIOFBHardwareCursorActive = 0x01, + kIOFBHardwareCursorInVRAM = 0x02 +}; + +/*! @struct StdFBShmem_t + @discussion This structure contains cursor and window server state data and occupies a slice of shared memory between the kernel and window server. Several elements of this structure are only used in software cursor mode. Unless otherwise indicated, the coordinates in this structure are given in display space. Display space is the coordinate space that encompasses all the screens. The positions of the screens within display space indicate their location relative to each other as the cursor moves between them. If there is only one screen, the screen coordinates and display space coordinates will be the same. + @field cursorSema Semaphore lock for write access to the shared data in this structure. + @field frame The current cursor frame index. + @field cursorShow The cursor is displayed when cursorShow is 0. + @field cursorObscured If this is true, the cursor has been obscured and cursorShow should not be 0. The cursor will be shown again the next time it is moved. + @field shieldFlag When this is set to true the cursor will not be displayed in the region specified by shieldRect. + @field shielded True if the cursor has been hidden because it entered the shielded region. + @field saveRect The region that is saved underneath the cursor in software cursor mode. + @field shieldRect The region that the cursor will not be displayed in if shieldFlag is true. + @field cursorLoc The location of the cursor hot spot. + @field cursorRect The region that the cursor image currently occupies in software cursor mode. + @field oldCursorRect The region that the cursor image occupied the last time the cursor was drawn in software cursor mode. + @field screenBounds The region that the current screen occupies. + @field version Contains kIOFBCurrentShmemVersion so that a user client can ensure it is using the same version of this structure as the kernel. + @field structSize Contains the size of this structure. + @field vblTime The time of the most recent vertical blanking. + @field vblDelta The interval between the two most recent vertical blankings. + @field vblCount A running count of vertical blank interrupts. + @field reservedC Reserved for future use. + @field hardwareCursorCapable True if the hardware is capable of using hardware cursor mode. + @field hardwareCursorActive True if currently using the hardware cursor mode. + @field reservedB Reserved for future use. + @field cursorSize This array contains the cursor sizes indexed by frame. + @field hotSpot This array contains the location of the cursor hot spots indexed by frame. The hot spots coordinates are given relative to the top left corner of the cursor image. + @field cursor A union of structures that define the cursor images. The structure used depends on the framebuffer's bit depth. These structures are defined above. +*/ + +struct StdFBShmem_t { + ev_lock_data_t cursorSema; + int frame; + char cursorShow; + char cursorObscured; + char shieldFlag; + char shielded; + IOGBounds saveRect; + IOGBounds shieldRect; + IOGPoint cursorLoc; + IOGBounds cursorRect; + IOGBounds oldCursorRect; + IOGBounds screenBounds; + int version; + int structSize; + AbsoluteTime vblTime; + AbsoluteTime vblDelta; + unsigned long long int vblCount; +#if IOFB_ARBITRARY_FRAMES_CURSOR + unsigned int reservedC[28]; +#else + unsigned int reservedC[27]; + unsigned char hardwareCursorFlags[kIOFBNumCursorFrames]; +#endif + unsigned char hardwareCursorCapable; + unsigned char hardwareCursorActive; + unsigned char hardwareCursorShields; + unsigned char reservedB[1]; +#if IOFB_ARBITRARY_FRAMES_CURSOR + IOGSize cursorSize[kIOFBNumCursorIndex]; + IOGPoint hotSpot[kIOFBNumCursorIndex]; +#else + IOGSize cursorSize[kIOFBNumCursorFrames]; + IOGPoint hotSpot[kIOFBNumCursorFrames]; +#endif +#ifndef IOFB_ARBITRARY_SIZE_CURSOR + union { + struct bm12Cursor bw; + struct bm18Cursor bw8; + struct bm34Cursor rgb; + struct bm38Cursor rgb24; + } cursor; +#else /* IOFB_ARBITRARY_SIZE_CURSOR */ + unsigned char cursor[0]; +#endif /* IOFB_ARBITRARY_SIZE_CURSOR */ +}; +#ifndef __cplusplus +typedef volatile struct StdFBShmem_t StdFBShmem_t; +#endif + + +/*! @enum FramebufferConstants + @constant kIOFBCurrentShmemVersion The current version of the slice of shared memory that contains the cursor and window server state data in the StdFBShmem_t structure. + @constant kIOFBCursorMemory The memory type for IOConnectMapMemory() to get a slice of shared memory that contains the StdFBShmem_t structure. +*/ +enum { + // version for IOFBCreateSharedCursor + kIOFBShmemVersionMask = 0x000000ff, + kIOFBTenPtOneShmemVersion = 2, + kIOFBTenPtTwoShmemVersion = 3, + kIOFBCurrentShmemVersion = 2, + + // number of frames in animating cursor (if > kIOFBTenPtTwoShmemVersion) + kIOFBShmemCursorNumFramesMask = 0x00ff0000, + kIOFBShmemCursorNumFramesShift = 16, + + // memory types for IOConnectMapMemory. + kIOFBCursorMemory = 100 +}; + +/*! @defined IOFRAMEBUFFER_CONFORMSTO + @discussion The class name of the framebuffer service. +*/ +#define IOFRAMEBUFFER_CONFORMSTO "IOFramebuffer" + +#ifdef __cplusplus +} +#endif + +#endif /* ! _IOKIT_IOFRAMEBUFFERSHARED_H */ diff --git a/i386/include/IOKit/graphics/IOGraphicsDevice.h b/i386/include/IOKit/graphics/IOGraphicsDevice.h new file mode 100644 index 0000000..8f51330 --- /dev/null +++ b/i386/include/IOKit/graphics/IOGraphicsDevice.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOGRAPHICSDEVICE_H +#define _IOKIT_IOGRAPHICSDEVICE_H + +#include +#include + + +class IOGraphicsDevice : public IOService +{ + OSDeclareAbstractStructors(IOGraphicsDevice) + +public: + + virtual void hideCursor( void ) = 0; + virtual void showCursor( IOGPoint * cursorLoc, int frame ) = 0; + virtual void moveCursor( IOGPoint * cursorLoc, int frame ) = 0; + + virtual void getVBLTime( AbsoluteTime * time, AbsoluteTime * delta ) = 0; + + virtual void getBoundingRect ( IOGBounds ** bounds ) = 0; +}; + +#endif /* ! _IOKIT_IOGRAPHICSDEVICE_H */ + diff --git a/i386/include/IOKit/graphics/IOGraphicsEngine.h b/i386/include/IOKit/graphics/IOGraphicsEngine.h new file mode 100644 index 0000000..4c79b41 --- /dev/null +++ b/i386/include/IOKit/graphics/IOGraphicsEngine.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + * 10 Mar 99 sdouglas created. + */ + + +struct IOGraphicsEngineContext { + IOSharedLockData contextLock; + IOOptionBits state; + void * owner; + UInt32 version; + IOByteCount structSize; + UInt32 reserved[ 8 ]; +}; +#ifndef __cplusplus +typedef volatile struct IOGraphicsEngineContext IOGraphicsEngineContext; +#endif + +enum { + // memory type for IOMapMemory + kIOGraphicsEngineContext = 100 +}; + +enum { + // version + kIOGraphicsEngineContextVersion = 1 +}; diff --git a/i386/include/IOKit/graphics/IOGraphicsInterfaceTypes.h b/i386/include/IOKit/graphics/IOGraphicsInterfaceTypes.h new file mode 100644 index 0000000..5b392a7 --- /dev/null +++ b/i386/include/IOKit/graphics/IOGraphicsInterfaceTypes.h @@ -0,0 +1,301 @@ +/* + * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOGRAPHICSINTERFACETYPES_H +#define _IOKIT_IOGRAPHICSINTERFACETYPES_H + +#include + +#define IO_FOUR_CHAR_CODE(x) (x) + +typedef UInt32 IOFourCharCode; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kCurrentGraphicsInterfaceVersion 1 +#define kCurrentGraphicsInterfaceRevision 2 + + +#ifdef IOGA_COMPAT +typedef SInt32 IOBlitCompletionToken; +#endif + +typedef UInt32 IOBlitType; +enum { + kIOBlitTypeVerbMask = 0x000000ff, + kIOBlitTypeRects = 0, + kIOBlitTypeCopyRects, + kIOBlitTypeLines, + kIOBlitTypeScanlines, + kIOBlitTypeCopyRegion, + + kIOBlitTypeMoveCursor, + kIOBlitTypeShowCursor, + kIOBlitTypeHideCursor, + + kIOBlitTypeMonoExpand = 0x00000100, + kIOBlitTypeColorSpaceConvert = 0x00000200, + kIOBlitTypeScale = 0x00000400, + + kIOBlitTypeSourceKeyColorModeMask = 0x00003000, + kIOBlitTypeDestKeyColorModeMask = 0x0000c000, + kIOBlitTypeSourceKeyColorEqual = 0x00001000, + kIOBlitTypeSourceKeyColorNotEqual = 0x00002000, + kIOBlitTypeDestKeyColorEqual = 0x00004000, + kIOBlitTypeDestKeyColorNotEqual = 0x00008000, + + kIOBlitTypeOperationMask = 0x0fff0000, + kIOBlitTypeOperationShift = 16, + kIOBlitTypeOperationTypeMask = 0x0f000000, + + kIOBlitTypeOperationType0 = 0x00000000, + kIOBlitCopyOperation = 0x00000000 | kIOBlitTypeOperationType0, + kIOBlitOrOperation = 0x00010000 | kIOBlitTypeOperationType0, + kIOBlitXorOperation = 0x00020000 | kIOBlitTypeOperationType0, + kIOBlitBlendOperation = 0x00030000 | kIOBlitTypeOperationType0, + kIOBlitHighlightOperation = 0x00040000 | kIOBlitTypeOperationType0 +}; + +typedef UInt32 IOBlitSourceType; +enum { + kIOBlitSourceDefault = 0x00000000, + kIOBlitSourceFramebuffer = 0x00001000, + kIOBlitSourceMemory = 0x00002000, + kIOBlitSourceOOLMemory = 0x00003000, + kIOBlitSourcePattern = 0x00004000, + kIOBlitSourceOOLPattern = 0x00005000, + kIOBlitSourceSolid = 0x00006000, + kIOBlitSourceCGSSurface = 0x00007000, + kIOBlitSourceIsSame = 0x80000000 +}; + +#ifdef IOGA_COMPAT +typedef IOBlitSourceType IOBlitSourceDestType; +enum { + kIOBlitDestFramebuffer = 0x00000001 +}; +#endif + +typedef struct IOBlitOperationStruct { + UInt32 color0; + UInt32 color1; + SInt32 offsetX; + SInt32 offsetY; + UInt32 sourceKeyColor; + UInt32 destKeyColor; + UInt32 specific[16]; +} IOBlitOperation; + +typedef struct IOBlitRectangleStruct { + SInt32 x; + SInt32 y; + SInt32 width; + SInt32 height; +} IOBlitRectangle; + +typedef struct IOBlitRectanglesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitRectangle rects[1]; +} IOBlitRectangles; + +typedef struct IOBlitCopyRectangleStruct { + SInt32 sourceX; + SInt32 sourceY; + SInt32 x; + SInt32 y; + SInt32 width; + SInt32 height; +} IOBlitCopyRectangle; + +typedef struct IOBlitCopyRectanglesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitCopyRectangle rects[1]; +} IOBlitCopyRectangles; + + +typedef struct IOBlitCopyRegionStruct { + IOBlitOperation operation; + SInt32 deltaX; + SInt32 deltaY; + IOAccelDeviceRegion * region; +} IOBlitCopyRegion; + + +typedef struct IOBlitVertexStruct { + SInt32 x; + SInt32 y; +} IOBlitVertex; + +typedef struct IOBlitVerticesStruct { + IOBlitOperation operation; + IOItemCount count; + IOBlitVertex vertices[2]; +} IOBlitVertices; + +typedef struct IOBlitScanlinesStruct { + IOBlitOperation operation; + IOItemCount count; + SInt32 y; + SInt32 height; + SInt32 x[2]; +} IOBlitScanlines; + + +typedef struct IOBlitCursorStruct { + IOBlitOperation operation; + IOBlitRectangle rect; +} IOBlitCursor; + +typedef struct _IOBlitMemory * IOBlitMemoryRef; + + +/* Quickdraw.h pixel formats*/ + +enum { + kIO1MonochromePixelFormat = 0x00000001, /* 1 bit indexed*/ + kIO2IndexedPixelFormat = 0x00000002, /* 2 bit indexed*/ + kIO4IndexedPixelFormat = 0x00000004, /* 4 bit indexed*/ + kIO8IndexedPixelFormat = 0x00000008, /* 8 bit indexed*/ + kIO16BE555PixelFormat = 0x00000010, /* 16 bit BE rgb 555 (Mac)*/ + kIO24RGBPixelFormat = 0x00000018, /* 24 bit rgb */ + kIO32ARGBPixelFormat = 0x00000020, /* 32 bit argb (Mac)*/ + kIO1IndexedGrayPixelFormat = 0x00000021, /* 1 bit indexed gray*/ + kIO2IndexedGrayPixelFormat = 0x00000022, /* 2 bit indexed gray*/ + kIO4IndexedGrayPixelFormat = 0x00000024, /* 4 bit indexed gray*/ + kIO8IndexedGrayPixelFormat = 0x00000028 /* 8 bit indexed gray*/ +}; + +enum { + kIO16LE555PixelFormat = IO_FOUR_CHAR_CODE('L555'), /* 16 bit LE rgb 555 (PC)*/ + kIO16LE5551PixelFormat = IO_FOUR_CHAR_CODE('5551'), /* 16 bit LE rgb 5551*/ + kIO16BE565PixelFormat = IO_FOUR_CHAR_CODE('B565'), /* 16 bit BE rgb 565*/ + kIO16LE565PixelFormat = IO_FOUR_CHAR_CODE('L565'), /* 16 bit LE rgb 565*/ + kIO24BGRPixelFormat = IO_FOUR_CHAR_CODE('24BG'), /* 24 bit bgr */ + kIO32BGRAPixelFormat = IO_FOUR_CHAR_CODE('BGRA'), /* 32 bit bgra (Matrox)*/ + kIO32ABGRPixelFormat = IO_FOUR_CHAR_CODE('ABGR'), /* 32 bit abgr */ + kIO32RGBAPixelFormat = IO_FOUR_CHAR_CODE('RGBA'), /* 32 bit rgba */ + kIOYUVSPixelFormat = IO_FOUR_CHAR_CODE('yuvs'), /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/ + kIOYUVUPixelFormat = IO_FOUR_CHAR_CODE('yuvu'), /* YUV 4:2:2 byte ordering 16-signed*/ + kIOYVU9PixelFormat = IO_FOUR_CHAR_CODE('YVU9'), /* YVU9 Planar 9*/ + kIOYUV411PixelFormat = IO_FOUR_CHAR_CODE('Y411'), /* YUV 4:1:1 Interleaved 16*/ + kIOYVYU422PixelFormat = IO_FOUR_CHAR_CODE('YVYU'), /* YVYU 4:2:2 byte ordering 16*/ + kIOUYVY422PixelFormat = IO_FOUR_CHAR_CODE('UYVY'), /* UYVY 4:2:2 byte ordering 16*/ + kIOYUV211PixelFormat = IO_FOUR_CHAR_CODE('Y211'), /* YUV 2:1:1 Packed 8*/ + kIO2vuyPixelFormat = IO_FOUR_CHAR_CODE('2vuy') /* UYVY 4:2:2 byte ordering 16*/ +}; + +/* Non Quickdraw.h pixel formats*/ +enum { + kIO16LE4444PixelFormat = IO_FOUR_CHAR_CODE('L444'), /* 16 bit LE argb 4444*/ + kIO16BE4444PixelFormat = IO_FOUR_CHAR_CODE('B444'), /* 16 bit BE argb 4444*/ + kIO64BGRAPixelFormat = IO_FOUR_CHAR_CODE('B16I'), /* 64 bit bgra */ + kIO64RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B16F'), /* 64 bit rgba */ + kIO128RGBAFloatPixelFormat = IO_FOUR_CHAR_CODE('B32F') /* 128 bit rgba float */ +}; + +enum { + kIOBlitMemoryRequiresHostFlush = 0x00000001 +}; + +typedef struct IOBlitSurfaceStruct { + union { + UInt8 * bytes; + IOBlitMemoryRef ref; + } memory; + IOFourCharCode pixelFormat; + IOBlitRectangle size; + UInt32 rowBytes; + UInt32 byteOffset; + UInt32 * palette; + IOOptionBits accessFlags; + IOBlitMemoryRef interfaceRef; + UInt32 more[14]; +} IOBlitSurface; + +typedef IOBlitSurface IOBlitMemory; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +enum { + // options for Synchronize + kIOBlitSynchronizeWaitBeamExit = 0x00000001, + kIOBlitSynchronizeFlushHostWrites = 0x00000002 +}; + +enum { + // options for WaitComplete & Flush + kIOBlitWaitContext = 0x00000000, + kIOBlitWaitAll2D = 0x00000001, + kIOBlitWaitGlobal = 0x00000001, + kIOBlitWaitAll = 0x00000002, + kIOBlitWaitCheck = 0x00000080, + kIOBlitFlushWithSwap = 0x00010000 +}; + +enum { + // options for AllocateSurface + kIOBlitHasCGSSurface = 0x00000001, + kIOBlitFixedSource = 0x00000002, + kIOBlitBeamSyncSwaps = 0x00000004, + kIOBlitReferenceSource = 0x00000008 +}; + +enum { + // options for UnlockSurface + kIOBlitUnlockWithSwap = 0x80000000 +}; + +enum { + // options for SetDestination + kIOBlitFramebufferDestination = 0x00000000, + kIOBlitSurfaceDestination = 0x00000001 +}; + + + +enum { + // options for blit procs + kIOBlitBeamSync = 0x00000001, + kIOBlitBeamSyncAlways = 0x00000002, + kIOBlitBeamSyncSpin = 0x00000004, + + kIOBlitAllOptions = 0xffffffff +}; + +enum { + // capabilities + kIOBlitColorSpaceTypes = IO_FOUR_CHAR_CODE('cspc') +}; + + +// keys for IOAccelFindAccelerator() +#define kIOAccelTypesKey "IOAccelTypes" +#define kIOAccelIndexKey "IOAccelIndex" + +#define kIOAccelRevisionKey "IOAccelRevision" + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* !_IOKIT_IOGRAPHICSINTERFACETYPES_H */ diff --git a/i386/include/IOKit/graphics/IOGraphicsTypes.h b/i386/include/IOKit/graphics/IOGraphicsTypes.h new file mode 100644 index 0000000..00bc2a8 --- /dev/null +++ b/i386/include/IOKit/graphics/IOGraphicsTypes.h @@ -0,0 +1,1260 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOGRAPHICSTYPES_H +#define _IOKIT_IOGRAPHICSTYPES_H + + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define IOGRAPHICSTYPES_REV 24 + +typedef SInt32 IOIndex; +typedef UInt32 IOSelect; +typedef UInt32 IOFixed1616; +typedef UInt32 IODisplayVendorID; +typedef UInt32 IODisplayProductID; + +typedef SInt32 IODisplayModeID; +enum { + // This is the ID given to a programmable timing used at boot time + kIODisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, + // Lowest (unsigned) DisplayModeID reserved by Apple + kIODisplayModeIDReservedBase = (IODisplayModeID)0x80000000 +}; + +enum { + kIOMaxPixelBits = 64 +}; +typedef char IOPixelEncoding[ kIOMaxPixelBits ]; + +// Common Apple pixel formats + +#define IO1BitIndexedPixels "P" +#define IO2BitIndexedPixels "PP" +#define IO4BitIndexedPixels "PPPP" +#define IO8BitIndexedPixels "PPPPPPPP" +#define IO16BitDirectPixels "-RRRRRGGGGGBBBBB" +#define IO32BitDirectPixels "--------RRRRRRRRGGGGGGGGBBBBBBBB" + +#define kIO30BitDirectPixels "--RRRRRRRRRRGGGGGGGGGGBBBBBBBBBB" +#define kIO64BitDirectPixels "-16R16G16B16" + +#define kIO16BitFloatPixels "-16FR16FG16FB16" +#define kIO32BitFloatPixels "-32FR32FG32FB32" + +// other possible pixel formats + +#define IOYUV422Pixels "Y4U2V2" +#define IO8BitOverlayPixels "O8" +// page flipping +#define IOPagedPixels "Page1" + +#define IO_SampleTypeAlpha 'A' +#define IO_SampleTypeSkip '-' + +// Info about a pixel format +enum { + kIOCLUTPixels = 0, + kIOFixedCLUTPixels = 1, + kIORGBDirectPixels = 2, + kIOMonoDirectPixels = 3, + kIOMonoInverseDirectPixels = 4, + kIORGBSignedDirectPixels = 5, + kIORGBSignedFloatingPointPixels = 6 +}; + +/*! + * @struct IOPixelInformation + * @abstract A structure defining the format of a framebuffer. + * @discussion This structure is used by IOFramebuffer to define the format of the pixels. + * @field bytesPerRow The number of bytes per row. + * @field bytesPerPlane Not used. + * @field bitsPerPixel The number of bits per pixel, including unused bits and alpha. + * @field pixelType One of kIOCLUTPixels (indexed pixels with changeable CLUT), kIORGBDirectPixels (direct pixels). + * @field componentCount One for indexed pixels, three for direct pixel formats. + * @field bitsPerComponent Number of bits per component in each pixel. + * @field componentMasks Mask of the bits valid for each component of the pixel - in R, G, B order for direct pixels. + * @field pixelFormat String description of the pixel format - IO32BitDirectPixels, IO16BitDirectPixels etc. + * @field flags None defined - set to zero. + * @field activeWidth Number of pixels visible per row. + * @field activeHeight Number of visible pixel rows. + * @field reserved Set to zero. + */ + +struct IOPixelInformation { + UInt32 bytesPerRow; + UInt32 bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 componentCount; + UInt32 bitsPerComponent; + UInt32 componentMasks[ 8 * 2 ]; + IOPixelEncoding pixelFormat; + UInt32 flags; + UInt32 activeWidth; + UInt32 activeHeight; + UInt32 reserved[ 2 ]; +}; +typedef struct IOPixelInformation IOPixelInformation; + +// ID for industry standard display timings +typedef UInt32 IOAppleTimingID; + +/*! + * @struct IODisplayModeInformation + * @abstract A structure defining the format of a framebuffer. + * @discussion This structure is used by IOFramebuffer to define the format of the pixels. + * @field nominalWidth Number of pixels visible per row. + * @field nominalHeight Number of visible pixel rows. + * @field refreshRate Refresh rate in fixed point 16.16. + * @field maxDepthIndex Highest depth index available in this display mode. + * @field flags Flags for the mode, including:
+ * kDisplayModeInterlacedFlag mode is interlaced.
+ * kDisplayModeSimulscanFlag mode is available on multiple display connections.
+ * kDisplayModeNotPresetFlag mode is not a factory preset for the display (geometry may need correction).
+ * kDisplayModeStretchedFlag mode is stretched/distorted to match the display aspect ratio.
+ * @field reserved Set to zero. + */ + +struct IODisplayModeInformation { + UInt32 nominalWidth; + UInt32 nominalHeight; + IOFixed1616 refreshRate; + IOIndex maxDepthIndex; + UInt32 flags; + UInt32 reserved[ 4 ]; +}; +typedef struct IODisplayModeInformation IODisplayModeInformation; + +// flags +enum { + kDisplayModeSafetyFlags = 0x00000007, + + kDisplayModeAlwaysShowFlag = 0x00000008, + kDisplayModeNeverShowFlag = 0x00000080, + kDisplayModeNotResizeFlag = 0x00000010, + kDisplayModeRequiresPanFlag = 0x00000020, + + kDisplayModeInterlacedFlag = 0x00000040, + + kDisplayModeSimulscanFlag = 0x00000100, + kDisplayModeBuiltInFlag = 0x00000400, + kDisplayModeNotPresetFlag = 0x00000200, + kDisplayModeStretchedFlag = 0x00000800, + kDisplayModeNotGraphicsQualityFlag = 0x00001000, + kDisplayModeValidateAgainstDisplay = 0x00002000, + kDisplayModeTelevisionFlag = 0x00100000, + kDisplayModeValidForMirroringFlag = 0x00200000 +}; +enum { + kDisplayModeValidFlag = 0x00000001, + kDisplayModeSafeFlag = 0x00000002, + kDisplayModeDefaultFlag = 0x00000004 +}; + +#ifndef KERNEL +// Framebuffer info - obsolete + +struct IOFramebufferInformation { + IOPhysicalAddress baseAddress; + UInt32 activeWidth; + UInt32 activeHeight; + IOByteCount bytesPerRow; + IOByteCount bytesPerPlane; + UInt32 bitsPerPixel; + UInt32 pixelType; + UInt32 flags; + UInt32 reserved[ 4 ]; +}; +typedef struct IOFramebufferInformation IOFramebufferInformation; +#endif + +// flags +enum { + kFramebufferSupportsCopybackCache = 0x00010000, + kFramebufferSupportsWritethruCache = 0x00020000, + kFramebufferSupportsGammaCorrection = 0x00040000, + kFramebufferDisableAltivecAccess = 0x00080000 +}; + +// Aperture is an index into supported pixel formats for a mode & depth +typedef IOIndex IOPixelAperture; +enum { + kIOFBSystemAperture = 0 +}; + +//// CLUTs + +typedef UInt16 IOColorComponent; + +/*! + * @struct IOColorEntry + * @abstract A structure defining one entry of a color lookup table. + * @discussion This structure is used by IOFramebuffer to define an entry of a color lookup table. + * @field index Number of pixels visible per row. + * @field red Value of red component 0-65535. + * @field green Value of green component 0-65535. + * @field blue Value of blue component 0-65535. + */ + +struct IOColorEntry { + UInt16 index; + IOColorComponent red; + IOColorComponent green; + IOColorComponent blue; +}; +typedef struct IOColorEntry IOColorEntry; + +// options (masks) +enum { + kSetCLUTByValue = 0x00000001, // else at index + kSetCLUTImmediately = 0x00000002, // else at VBL + kSetCLUTWithLuminance = 0x00000004 // else RGB +}; + +//// Controller attributes + +enum { + kIOPowerStateAttribute = 'pwrs', + kIOPowerAttribute = 'powr', + kIODriverPowerAttribute = 'dpow', + kIOHardwareCursorAttribute = 'crsr', + + kIOMirrorAttribute = 'mirr', + kIOMirrorDefaultAttribute = 'mrdf', + + kIOCapturedAttribute = 'capd', + + kIOCursorControlAttribute = 'crsc', + + kIOSystemPowerAttribute = 'spwr', + kIOVRAMSaveAttribute = 'vrsv', + kIODeferCLUTSetAttribute = 'vclt', + + kIOClamshellStateAttribute = 'clam' +}; + +// values for kIOMirrorAttribute +enum { + kIOMirrorIsPrimary = 0x80000000, + kIOMirrorHWClipped = 0x40000000 +}; + +// values for kIOMirrorDefaultAttribute +enum { + kIOMirrorDefault = 0x00000001, + kIOMirrorForced = 0x00000002 +}; + +//// Display mode timing information + +struct IODetailedTimingInformationV1 { + // from EDID defn + UInt32 pixelClock; // Hertz + UInt32 horizontalActive; // pixels + UInt32 horizontalBlanking; // pixels + UInt32 horizontalBorder; // pixels + UInt32 horizontalSyncOffset; // pixels + UInt32 horizontalSyncWidth; // pixels + UInt32 verticalActive; // lines + UInt32 verticalBlanking; // lines + UInt32 verticalBorder; // lines + UInt32 verticalSyncOffset; // lines + UInt32 verticalSyncWidth; // lines +}; +typedef struct IODetailedTimingInformationV1 IODetailedTimingInformationV1; + +/*! + * @struct IODetailedTimingInformationV2 + * @abstract A structure defining the detailed timing information of a display mode. + * @discussion This structure is used by IOFramebuffer to define detailed timing information for a display mode. The VESA EDID document has more information. + * @field __reservedA Set to zero. + * @field horizontalScaledInset If the mode is scaled, sets the number of active pixels to remove the left and right edges in order to display an underscanned image. + * @field verticalScaledInset If the mode is scaled, sets the number of active lines to remove the top and bottom edges in order to display an underscanned image. + * @field scalerFlags If the mode is scaled, + * kIOScaleStretchToFit may be set to allow stretching. + * kIOScaleRotateFlags is mask which may have the value given by kIOScaleRotate90, kIOScaleRotate180, kIOScaleRotate270 to display a rotated framebuffer. + * @field horizontalScaled If the mode is scaled, sets the size of the image before scaling or rotation. + * @field verticalScaled If the mode is scaled, sets the size of the image before scaling or rotation. + * @field signalConfig + * kIOAnalogSetupExpected set if display expects a blank-to-black setup or pedestal. See VESA signal standards.
+ * kIOInterlacedCEATiming set for a CEA style interlaced timing:
+ * Field 1 vertical blanking = half specified vertical blanking lines.
+ * Field 2 vertical blanking = (half vertical blanking lines) + 1 line.
+ * Field 1 vertical offset = half specified vertical sync offset.
+ * Field 2 vertical offset = (half specified vertical sync offset) + 0.5 lines.
+ * @field signalLevels One of:
+ * kIOAnalogSignalLevel_0700_0300 0.700 - 0.300 V p-p.
+ * kIOAnalogSignalLevel_0714_0286 0.714 - 0.286 V p-p.
+ * kIOAnalogSignalLevel_1000_0400 1.000 - 0.400 V p-p.
+ * kIOAnalogSignalLevel_0700_0000 0.700 - 0.000 V p-p.
+ * @field pixelClock Pixel clock frequency in Hz. + * @field minPixelClock Minimum pixel clock frequency in Hz, with error. + * @field maxPixelClock Maximum pixel clock frequency in Hz, with error. + * @field horizontalActive Pixel clocks per line. + * @field horizontalBlanking Blanking clocks per line. + * @field horizontalSyncOffset First clock of horizontal sync. + * @field horizontalSyncPulseWidth Width of horizontal sync. + * @field verticalActive Number of lines per frame. + * @field verticalBlanking Blanking lines per frame. + * @field verticalSyncOffset First line of vertical sync. + * @field verticalSyncPulseWidth Height of vertical sync. + * @field horizontalBorderLeft Number of pixels in left horizontal border. + * @field horizontalBorderRight Number of pixels in right horizontal border. + * @field verticalBorderTop Number of lines in top vertical border. + * @field verticalBorderBottom Number of lines in bottom vertical border. + * @field horizontalSyncConfig kIOSyncPositivePolarity for positive polarity horizontal sync (0 for negative). + * @field horizontalSyncLevel Zero. + * @field verticalSyncConfig kIOSyncPositivePolarity for positive polarity vertical sync (0 for negative). + * @field verticalSyncLevel Zero. + * @field numLinks number of links to be used by a dual link timing, if zero, assume one link. + * @field __reservedB Reserved set to zero. + */ + +struct IODetailedTimingInformationV2 { + + UInt32 __reservedA[3]; // Init to 0 + UInt32 horizontalScaledInset; // pixels + UInt32 verticalScaledInset; // lines + + UInt32 scalerFlags; + UInt32 horizontalScaled; + UInt32 verticalScaled; + + UInt32 signalConfig; + UInt32 signalLevels; + + UInt64 pixelClock; // Hz + + UInt64 minPixelClock; // Hz - With error what is slowest actual clock + UInt64 maxPixelClock; // Hz - With error what is fasted actual clock + + UInt32 horizontalActive; // pixels + UInt32 horizontalBlanking; // pixels + UInt32 horizontalSyncOffset; // pixels + UInt32 horizontalSyncPulseWidth; // pixels + + UInt32 verticalActive; // lines + UInt32 verticalBlanking; // lines + UInt32 verticalSyncOffset; // lines + UInt32 verticalSyncPulseWidth; // lines + + UInt32 horizontalBorderLeft; // pixels + UInt32 horizontalBorderRight; // pixels + UInt32 verticalBorderTop; // lines + UInt32 verticalBorderBottom; // lines + + UInt32 horizontalSyncConfig; + UInt32 horizontalSyncLevel; // Future use (init to 0) + UInt32 verticalSyncConfig; + UInt32 verticalSyncLevel; // Future use (init to 0) + UInt32 numLinks; + + UInt32 __reservedB[7]; // Init to 0 +}; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformationV2; +typedef struct IODetailedTimingInformationV2 IODetailedTimingInformation; + +struct IOTimingInformation { + IOAppleTimingID appleTimingID; // kIOTimingIDXXX const + UInt32 flags; + union { + IODetailedTimingInformationV1 v1; + IODetailedTimingInformationV2 v2; + } detailedInfo; +}; +typedef struct IOTimingInformation IOTimingInformation; + +enum { + // IOTimingInformation flags + kIODetailedTimingValid = 0x80000000, + kIOScalingInfoValid = 0x40000000 +}; + +enum { + // scalerFlags + kIOScaleStretchToFit = 0x00000001, + + kIOScaleRotateFlags = 0x000000f0, + + kIOScaleSwapAxes = 0x00000010, + kIOScaleInvertX = 0x00000020, + kIOScaleInvertY = 0x00000040, + + kIOScaleRotate0 = 0x00000000, + kIOScaleRotate90 = kIOScaleSwapAxes | kIOScaleInvertX, + kIOScaleRotate180 = kIOScaleInvertX | kIOScaleInvertY, + kIOScaleRotate270 = kIOScaleSwapAxes | kIOScaleInvertY +}; + + +#pragma pack(push, 4) +struct IOFBDisplayModeDescription { + IODisplayModeInformation info; + IOTimingInformation timingInfo; +}; +typedef struct IOFBDisplayModeDescription IOFBDisplayModeDescription; +#pragma pack(pop) + +/*! + * @struct IODisplayTimingRange + * @abstract A structure defining the limits and attributes of a display or framebuffer. + * @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. The VESA EDID is useful background information for many of these fields. A data property with this structure under the key kIOFBTimingRangeKey in a framebuffer will allow the OS to program detailed timings that fall within its range. + * @field __reservedA Set to zero. + * @field version Set to zero. + * @field __reservedB Set to zero. + * @field minPixelClock minimum pixel clock frequency in range, in Hz. + * @field minPixelClock maximum pixel clock frequency in range, in Hz. + * @field maxPixelError largest variation between specified and actual pixel clock frequency, in Hz. + * @field supportedSyncFlags mask of supported sync attributes. The following are defined:
+ * kIORangeSupportsSeparateSyncs - digital separate syncs.
+ * kIORangeSupportsSyncOnGreen - sync on green.
+ * kIORangeSupportsCompositeSync - composite sync.
+ * kIORangeSupportsVSyncSerration - vertical sync has serration and equalization pulses.
+ * @field supportedSignalLevels mask of possible signal levels. The following are defined:
+ * kIORangeSupportsSignal_0700_0300 0.700 - 0.300 V p-p.
+ * kIORangeSupportsSignal_0714_0286 0.714 - 0.286 V p-p.
+ * kIORangeSupportsSignal_1000_0400 1.000 - 0.400 V p-p.
+ * kIORangeSupportsSignal_0700_0000 0.700 - 0.000 V p-p.
+ * @field supportedSignalConfigs mask of possible signal configurations. The following are defined:
+ * kIORangeSupportsInterlacedCEATiming Supports CEA style interlaced timing:
+ * Field 1 vertical blanking = specified vertical blanking lines.
+ * Field 2 vertical blanking = vertical blanking lines + 1 line.
+ * Field 1 vertical offset = specified vertical sync offset.
+ * Field 2 vertical offset = specified vertical sync offset + 0.5 lines.
+ * kIORangeSupportsInterlacedCEATimingWithConfirm Supports CEA style interlaced timing, but require a confirm. + * @field minFrameRate minimum frame rate (vertical refresh frequency) in range, in Hz. + * @field maxFrameRate maximum frame rate (vertical refresh frequency) in range, in Hz. + * @field minLineRate minimum line rate (horizontal refresh frequency) in range, in Hz. + * @field maxLineRate maximum line rate (horizontal refresh frequency) in range, in Hz. + * @field maxHorizontalTotal maximum clocks in horizontal line (active + blanking). + * @field maxVerticalTotal maximum lines in vertical frame (active + blanking). + * @field __reservedD Set to zero. + * @field charSizeHorizontalActive horizontalActive must be a multiple of charSizeHorizontalActive. + * @field charSizeHorizontalBlanking horizontalBlanking must be a multiple of charSizeHorizontalBlanking. + * @field charSizeHorizontalSyncOffset horizontalSyncOffset must be a multiple of charSizeHorizontalSyncOffset. + * @field charSizeHorizontalSyncPulse horizontalSyncPulse must be a multiple of charSizeHorizontalSyncPulse. + * @field charSizeVerticalActive verticalActive must be a multiple of charSizeVerticalActive. + * @field charSizeVerticalBlanking verticalBlanking must be a multiple of charSizeVerticalBlanking. + * @field charSizeVerticalSyncOffset verticalSyncOffset must be a multiple of charSizeVerticalSyncOffset. + * @field charSizeVerticalSyncPulse verticalSyncPulse must be a multiple of charSizeVerticalSyncPulse. + * @field charSizeHorizontalBorderLeft horizontalBorderLeft must be a multiple of charSizeHorizontalBorderLeft. + * @field charSizeHorizontalBorderRight horizontalBorderRight must be a multiple of charSizeHorizontalBorderRight. + * @field charSizeVerticalBorderTop verticalBorderTop must be a multiple of charSizeVerticalBorderTop. + * @field charSizeVerticalBorderBottom verticalBorderBottom must be a multiple of charSizeVerticalBorderBottom. + * @field charSizeHorizontalTotal (horizontalActive + horizontalBlanking) must be a multiple of charSizeHorizontalTotal. + * @field charSizeVerticalTotal (verticalActive + verticalBlanking) must be a multiple of charSizeVerticalTotal. + * @field __reservedE Set to zero. + * @field minHorizontalActiveClocks minimum value of horizontalActive. + * @field maxHorizontalActiveClocks maximum value of horizontalActive. + * @field minHorizontalBlankingClocks minimum value of horizontalBlanking. + * @field maxHorizontalBlankingClocks maximum value of horizontalBlanking. + * @field minHorizontalSyncOffsetClocks minimum value of horizontalSyncOffset. + * @field maxHorizontalSyncOffsetClocks maximum value of horizontalSyncOffset. + * @field minHorizontalPulseWidthClocks minimum value of horizontalPulseWidth. + * @field maxHorizontalPulseWidthClocks maximum value of horizontalPulseWidth. + * @field minVerticalActiveClocks minimum value of verticalActive. + * @field maxVerticalActiveClocks maximum value of verticalActive. + * @field minVerticalBlankingClocks minimum value of verticalBlanking. + * @field maxVerticalBlankingClocks maximum value of verticalBlanking. + * @field minVerticalSyncOffsetClocks minimum value of verticalSyncOffset. + * @field maxVerticalSyncOffsetClocks maximum value of verticalSyncOffset. + * @field minVerticalPulseWidthClocks minimum value of verticalPulseWidth. + * @field maxVerticalPulseWidthClocks maximum value of verticalPulseWidth. + * @field minHorizontalBorderLeft minimum value of horizontalBorderLeft. + * @field maxHorizontalBorderLeft maximum value of horizontalBorderLeft. + * @field minHorizontalBorderRight minimum value of horizontalBorderRight. + * @field maxHorizontalBorderRight maximum value of horizontalBorderRight. + * @field minVerticalBorderTop minimum value of verticalBorderTop. + * @field maxVerticalBorderTop maximum value of verticalBorderTop. + * @field minVerticalBorderBottom minimum value of verticalBorderBottom. + * @field maxVerticalBorderBottom maximum value of verticalBorderBottom. + * @field maxNumLinks number of links supported, if zero, 1 link is assumed. + * @field minLink0PixelClock minimum pixel clock for link 0 (kHz). + * @field maxLink0PixelClock maximum pixel clock for link 0 (kHz). + * @field minLink1PixelClock minimum pixel clock for link 1 (kHz). + * @field maxLink1PixelClock maximum pixel clock for link 1 (kHz). + * @field __reservedF Set to zero. + */ + +struct IODisplayTimingRange +{ + UInt32 __reservedA[2]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[5]; // Init to 0 + + UInt64 minPixelClock; // Min dot clock in Hz + UInt64 maxPixelClock; // Max dot clock in Hz + + UInt32 maxPixelError; // Max dot clock error + UInt32 supportedSyncFlags; + UInt32 supportedSignalLevels; + UInt32 supportedSignalConfigs; + + UInt32 minFrameRate; // Hz + UInt32 maxFrameRate; // Hz + UInt32 minLineRate; // Hz + UInt32 maxLineRate; // Hz + + UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking) + UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking) + UInt32 __reservedD[2]; // Init to 0 + + UInt8 charSizeHorizontalActive; + UInt8 charSizeHorizontalBlanking; + UInt8 charSizeHorizontalSyncOffset; + UInt8 charSizeHorizontalSyncPulse; + + UInt8 charSizeVerticalActive; + UInt8 charSizeVerticalBlanking; + UInt8 charSizeVerticalSyncOffset; + UInt8 charSizeVerticalSyncPulse; + + UInt8 charSizeHorizontalBorderLeft; + UInt8 charSizeHorizontalBorderRight; + UInt8 charSizeVerticalBorderTop; + UInt8 charSizeVerticalBorderBottom; + + UInt8 charSizeHorizontalTotal; // Character size for active + blanking + UInt8 charSizeVerticalTotal; // Character size for active + blanking + UInt16 __reservedE; // Reserved (Init to 0) + + UInt32 minHorizontalActiveClocks; + UInt32 maxHorizontalActiveClocks; + UInt32 minHorizontalBlankingClocks; + UInt32 maxHorizontalBlankingClocks; + + UInt32 minHorizontalSyncOffsetClocks; + UInt32 maxHorizontalSyncOffsetClocks; + UInt32 minHorizontalPulseWidthClocks; + UInt32 maxHorizontalPulseWidthClocks; + + UInt32 minVerticalActiveClocks; + UInt32 maxVerticalActiveClocks; + UInt32 minVerticalBlankingClocks; + UInt32 maxVerticalBlankingClocks; + + UInt32 minVerticalSyncOffsetClocks; + UInt32 maxVerticalSyncOffsetClocks; + UInt32 minVerticalPulseWidthClocks; + UInt32 maxVerticalPulseWidthClocks; + + UInt32 minHorizontalBorderLeft; + UInt32 maxHorizontalBorderLeft; + UInt32 minHorizontalBorderRight; + UInt32 maxHorizontalBorderRight; + + UInt32 minVerticalBorderTop; + UInt32 maxVerticalBorderTop; + UInt32 minVerticalBorderBottom; + UInt32 maxVerticalBorderBottom; + UInt32 maxNumLinks; // number of links, if zero, assume link 1 + UInt32 minLink0PixelClock; // min pixel clock for link 0 (kHz) + UInt32 maxLink0PixelClock; // max pixel clock for link 0 (kHz) + UInt32 minLink1PixelClock; // min pixel clock for link 1 (kHz) + UInt32 maxLink1PixelClock; // max pixel clock for link 1 (kHz) + + UInt32 __reservedF[3]; // Init to 0 +}; +typedef struct IODisplayTimingRange IODisplayTimingRange; + +enum { + // supportedSignalLevels + kIORangeSupportsSignal_0700_0300 = 0x00000001, + kIORangeSupportsSignal_0714_0286 = 0x00000002, + kIORangeSupportsSignal_1000_0400 = 0x00000004, + kIORangeSupportsSignal_0700_0000 = 0x00000008 +}; +enum { + // supportedSyncFlags + kIORangeSupportsSeparateSyncs = 0x00000001, + kIORangeSupportsSyncOnGreen = 0x00000002, + kIORangeSupportsCompositeSync = 0x00000004, + kIORangeSupportsVSyncSerration = 0x00000008 +}; +enum { + // supportedSignalConfigs + kIORangeSupportsInterlacedCEATiming = 0x00000004, + kIORangeSupportsInterlacedCEATimingWithConfirm = 0x00000008 +}; + +enum { + // signalConfig + kIODigitalSignal = 0x00000001, + kIOAnalogSetupExpected = 0x00000002, + kIOInterlacedCEATiming = 0x00000004, + kIONTSCTiming = 0x00000008, + kIOPALTiming = 0x00000010 +}; + +enum { + // signalLevels for analog + kIOAnalogSignalLevel_0700_0300 = 0, + kIOAnalogSignalLevel_0714_0286 = 1, + kIOAnalogSignalLevel_1000_0400 = 2, + kIOAnalogSignalLevel_0700_0000 = 3 +}; + +enum { + // horizontalSyncConfig and verticalSyncConfig + kIOSyncPositivePolarity = 0x00000001 +}; + +/*! + * @struct IODisplayScalerInformation + * @abstract A structure defining the scaling capabilities of a framebuffer. + * @discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. A data property with this structure under the key kIOFBScalerInfoKey in a framebuffer will allow the OS to program detailed timings that are scaled to a displays native resolution. + * @field __reservedA Set to zero. + * @field version Set to zero. + * @field __reservedB Set to zero. + * @field scalerFeatures Mask of scaling features. The following are defined:
+ * kIOScaleStretchOnly If set the framebuffer can only provide stretched scaling with non-square pixels, without borders.
+ * kIOScaleCanUpSamplePixels If set framebuffer can scale up from a smaller number of source pixels to a larger native timing (eg. 640x480 pixels on a 1600x1200 timing).
+ * kIOScaleCanDownSamplePixels If set framebuffer can scale down from a larger number of source pixels to a smaller native timing (eg. 1600x1200 pixels on a 640x480 timing).
+ * kIOScaleCanScaleInterlaced If set framebuffer can scale an interlaced detailed timing.
+ * kIOScaleCanSupportInset If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields.
+ * kIOScaleCanRotate If set framebuffer can support some of the flags in the kIOScaleRotateFlags mask.
+ * kIOScaleCanBorderInsetOnly If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields, but requires the active pixels to be equal in size to the inset area, ie. can do insets with a border versus scaling an image.
+ * @field maxHorizontalPixels Maximum number of horizontal source pixels (horizontalScaled).
+ * @field maxVerticalPixels Maximum number of vertical source pixels (verticalScaled).
+ * @field __reservedC Set to zero. + */ + +struct IODisplayScalerInformation { + UInt32 __reservedA[1]; // Init to 0 + UInt32 version; // Init to 0 + UInt32 __reservedB[2]; // Init to 0 + + IOOptionBits scalerFeatures; + UInt32 maxHorizontalPixels; + UInt32 maxVerticalPixels; + UInt32 __reservedC[5]; // Init to 0 +}; +typedef struct IODisplayScalerInformation IODisplayScalerInformation; + +enum { + /* scalerFeatures */ + kIOScaleStretchOnly = 0x00000001, + kIOScaleCanUpSamplePixels = 0x00000002, + kIOScaleCanDownSamplePixels = 0x00000004, + kIOScaleCanScaleInterlaced = 0x00000008, + kIOScaleCanSupportInset = 0x00000010, + kIOScaleCanRotate = 0x00000020, + kIOScaleCanBorderInsetOnly = 0x00000040 +}; + +//// Connections + +enum { + kOrConnections = 0xffffffe, + kAndConnections = 0xffffffd +}; + +enum { + kConnectionFlags = 'flgs', + kConnectionSyncEnable = 'sync', + kConnectionSyncFlags = 'sycf', + kConnectionSupportsAppleSense = 'asns', + kConnectionSupportsLLDDCSense = 'lddc', + kConnectionSupportsHLDDCSense = 'hddc', + kConnectionEnable = 'enab', + kConnectionCheckEnable = 'cena', + kConnectionProbe = 'prob', + kConnectionChanged = 'chng', + kConnectionPower = 'powr', + kConnectionPostWake = 'pwak', + kConnectionDisplayParameterCount = 'pcnt', + kConnectionDisplayParameters = 'parm', + kConnectionOverscan = 'oscn', + kConnectionVideoBest = 'vbst', + + kConnectionRedGammaScale = 'rgsc', + kConnectionGreenGammaScale = 'ggsc', + kConnectionBlueGammaScale = 'bgsc', + + kConnectionHandleDisplayPortEvent = 'dpir', + + kConnectionPanelTimingDisable = 'pnlt', + + kConnectionColorMode = 'cyuv', + kConnectionColorModesSupported = 'colr', + kConnectionColorDepthsSupported = ' bpc', + + kConnectionControllerDepthsSupported = '\0grd', + kConnectionControllerColorDepth = '\0dpd', + kConnectionControllerDitherControl = '\0gdc', + + kConnectionDisplayFlags = 'dflg', +}; + +// kConnectionFlags values +enum { + kIOConnectionBuiltIn = 0x00000800, + kIOConnectionStereoSync = 0x00008000 +}; + +// kConnectionSyncControl values +enum { + kIOHSyncDisable = 0x00000001, + kIOVSyncDisable = 0x00000002, + kIOCSyncDisable = 0x00000004, + kIONoSeparateSyncControl = 0x00000040, + kIOTriStateSyncs = 0x00000080, + kIOSyncOnBlue = 0x00000008, + kIOSyncOnGreen = 0x00000010, + kIOSyncOnRed = 0x00000020 +}; + +// kConnectionHandleDisplayPortEvent values +enum { + kIODPEventStart = 1, + kIODPEventIdle = 2, + + kIODPEventForceRetrain = 3, + + kIODPEventRemoteControlCommandPending = 256, + kIODPEventAutomatedTestRequest = 257, + kIODPEventContentProtection = 258, + kIODPEventMCCS = 259, + kIODPEventSinkSpecific = 260 +}; + +#define kIODisplayAttributesKey "IODisplayAttributes" + +#define kIODisplaySupportsUnderscanKey "IODisplaySupportsUnderscan" +#define kIODisplaySupportsBasicAudioKey "IODisplaySupportsBasicAudio" +#define kIODisplaySupportsYCbCr444Key "IODisplaySupportsYCbCr444" +#define kIODisplaySupportsYCbCr422Key "IODisplaySupportsYCbCr422" + +enum +{ + kIODisplayColorMode = kConnectionColorMode, +}; + +#if 0 +enum +{ + // kConnectionColorMode attribute + kIODisplayColorModeReserved = 0x00000000, + kIODisplayColorModeRGB = 0x00000001, + kIODisplayColorModeYCbCr422 = 0x00000010, + kIODisplayColorModeYCbCr444 = 0x00000100, + kIODisplayColorModeRGBLimited = 0x00001000, + kIODisplayColorModeAuto = 0x10000000, +}; +#endif + +enum +{ + // kConnectionColorDepthsSupported attribute + kIODisplayRGBColorComponentBitsUnknown = 0x00000000, + kIODisplayRGBColorComponentBits6 = 0x00000001, + kIODisplayRGBColorComponentBits8 = 0x00000002, + kIODisplayRGBColorComponentBits10 = 0x00000004, + kIODisplayRGBColorComponentBits12 = 0x00000008, + kIODisplayRGBColorComponentBits14 = 0x00000010, + kIODisplayRGBColorComponentBits16 = 0x00000020, + + kIODisplayYCbCr444ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr444ColorComponentBits6 = 0x00000100, + kIODisplayYCbCr444ColorComponentBits8 = 0x00000200, + kIODisplayYCbCr444ColorComponentBits10 = 0x00000400, + kIODisplayYCbCr444ColorComponentBits12 = 0x00000800, + kIODisplayYCbCr444ColorComponentBits14 = 0x00001000, + kIODisplayYCbCr444ColorComponentBits16 = 0x00002000, + + kIODisplayYCbCr422ColorComponentBitsUnknown = 0x00000000, + kIODisplayYCbCr422ColorComponentBits6 = 0x00010000, + kIODisplayYCbCr422ColorComponentBits8 = 0x00020000, + kIODisplayYCbCr422ColorComponentBits10 = 0x00040000, + kIODisplayYCbCr422ColorComponentBits12 = 0x00080000, + kIODisplayYCbCr422ColorComponentBits14 = 0x00100000, + kIODisplayYCbCr422ColorComponentBits16 = 0x00200000, +}; + +enum +{ + // kConnectionDitherControl attribute + kIODisplayDitherDisable = 0x00000000, + kIODisplayDitherSpatial = 0x00000001, + kIODisplayDitherTemporal = 0x00000002, + kIODisplayDitherFrameRateControl = 0x00000004, + kIODisplayDitherDefault = 0x00000080, + kIODisplayDitherAll = 0x000000FF, + kIODisplayDitherRGBShift = 0, + kIODisplayDitherYCbCr444Shift = 8, + kIODisplayDitherYCbCr422Shift = 16, +}; + +enum +{ + // kConnectionDisplayFlags attribute + kIODisplayNeedsCEAUnderscan = 0x00000001, +}; + + +#define IO_DISPLAY_CAN_FILL 0x00000040 +#define IO_DISPLAY_CAN_BLIT 0x00000020 + +#define IO_24BPP_TRANSFER_TABLE_SIZE 256 +#define IO_15BPP_TRANSFER_TABLE_SIZE 256 +#define IO_8BPP_TRANSFER_TABLE_SIZE 256 +#define IO_12BPP_TRANSFER_TABLE_SIZE 256 +#define IO_2BPP_TRANSFER_TABLE_SIZE 256 + +#define STDFB_BM256_TO_BM38_MAP_SIZE 256 +#define STDFB_BM38_TO_BM256_MAP_SIZE 256 +#define STDFB_BM38_TO_256_WITH_LOGICAL_SIZE \ + (STDFB_BM38_TO_BM256_MAP_SIZE + (256/sizeof(int))) + +#define STDFB_4BPS_TO_5BPS_MAP_SIZE 16 +#define STDFB_5BPS_TO_4BPS_MAP_SIZE 32 + +enum { + // connection types for IOServiceOpen + kIOFBServerConnectType = 0, + kIOFBSharedConnectType = 1 +}; + +enum { + // options for IOServiceRequestProbe() + kIOFBUserRequestProbe = 0x00000001 +}; + +struct IOGPoint { + SInt16 x; + SInt16 y; +}; +typedef struct IOGPoint IOGPoint; + +struct IOGSize { + SInt16 width; + SInt16 height; +}; +typedef struct IOGSize IOGSize; + +struct IOGBounds { + SInt16 minx; + SInt16 maxx; + SInt16 miny; + SInt16 maxy; +}; +typedef struct IOGBounds IOGBounds; + +#ifndef kIODescriptionKey + +#if !defined(__Point__) && !defined(BINTREE_H) && !defined(__MACTYPES__) +#define __Point__ +typedef IOGPoint Point; +#endif + +#if !defined(__Bounds__) && !defined(BINTREE_H) && !defined(__MACTYPES__) +#define __Bounds__ +typedef IOGBounds Bounds; +#endif + +#endif /* !kIODescriptionKey */ + +// cursor description + +enum { + kTransparentEncoding = 0, + kInvertingEncoding +}; + +enum { + kTransparentEncodingShift = (kTransparentEncoding << 1), + kTransparentEncodedPixel = (0x01 << kTransparentEncodingShift), + + kInvertingEncodingShift = (kInvertingEncoding << 1), + kInvertingEncodedPixel = (0x01 << kInvertingEncodingShift) +}; + +enum { + kHardwareCursorDescriptorMajorVersion = 0x0001, + kHardwareCursorDescriptorMinorVersion = 0x0000 +}; + +/*! + * @struct IOHardwareCursorDescriptor + * @abstract A structure defining the format of a hardware cursor. + * @discussion This structure is used by IOFramebuffer to define the format of a hardware cursor. + * @field majorVersion Set to kHardwareCursorDescriptorMajorVersion. + * @field minorVersion Set to kHardwareCursorDescriptorMinorVersion. + * @field height Maximum size of the cursor. + * @field width Maximum size of the cursor. + * @field bitDepth Number bits per pixel, or a QD/QT pixel type, for example kIO8IndexedPixelFormat, kIO32ARGBPixelFormat. + * @field maskBitDepth Unused. + * @field numColors Number of colors for indexed pixel types. + * @field colorEncodings An array pointer specifying the pixel values corresponding to the indices into the color table, for indexed pixel types. + * @field flags None defined, set to zero. + * @field supportedSpecialEncodings Mask of supported special pixel values, eg. kTransparentEncodedPixel, kInvertingEncodedPixel. + * @field specialEncodings Array of pixel values for each supported special encoding. + */ + +struct IOHardwareCursorDescriptor { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 height; + UInt32 width; + UInt32 bitDepth; // bits per pixel, or a QD/QT pixel type + UInt32 maskBitDepth; // unused + UInt32 numColors; // number of colors in the colorMap. ie. + UInt32 * colorEncodings; + UInt32 flags; + UInt32 supportedSpecialEncodings; + UInt32 specialEncodings[16]; +}; +typedef struct IOHardwareCursorDescriptor IOHardwareCursorDescriptor; + +enum { + kHardwareCursorInfoMajorVersion = 0x0001, + kHardwareCursorInfoMinorVersion = 0x0000 +}; + +/*! + * @struct IOHardwareCursorInfo + * @abstract A structure defining the converted data of a hardware cursor. + * @discussion This structure is used by IOFramebuffer to return the data of a hardware cursor by convertCursorImage() after conversion based on the IOHardwareCursorDescriptor passed to that routine. + * @field majorVersion Set to kHardwareCursorInfoMajorVersion. + * @field minorVersion Set to kHardwareCursorInfoMinorVersion. + * @field cursorHeight The actual size of the cursor is returned. + * @field cursorWidth The actual size of the cursor is returned. + * @field colorMap Pointer to array of IOColorEntry structures, with the number of elements set by the numColors field of the IOHardwareCursorDescriptor. Zero should be passed for direct pixel formats. + * @field hardwareCursorData Buffer to receive the converted cursor data. + * @field cursorHotSpotX Cursor's hotspot. + * @field cursorHotSpotY Cursor's hotspot. + * @field reserved Reserved, set to zero. + */ + +struct IOHardwareCursorInfo { + UInt16 majorVersion; + UInt16 minorVersion; + UInt32 cursorHeight; + UInt32 cursorWidth; + // nil or big enough for hardware's max colors + IOColorEntry * colorMap; + UInt8 * hardwareCursorData; + UInt16 cursorHotSpotX; + UInt16 cursorHotSpotY; + UInt32 reserved[5]; +}; +typedef struct IOHardwareCursorInfo IOHardwareCursorInfo; + +// interrupt types + +enum { + kIOFBVBLInterruptType = 'vbl ', + kIOFBHBLInterruptType = 'hbl ', + kIOFBFrameInterruptType = 'fram', + // Demand to check configuration (Hardware unchanged) + kIOFBConnectInterruptType = 'dci ', + // Demand to rebuild (Hardware has reinitialized on dependent change) + kIOFBChangedInterruptType = 'chng', + // Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror) + kIOFBOfflineInterruptType = 'remv', + // Notice that hardware is available (after being removed) + kIOFBOnlineInterruptType = 'add ', + // DisplayPort short pulse + kIOFBDisplayPortInterruptType = 'dpir', + // DisplayPort link event + kIOFBDisplayPortLinkChangeInterruptType = 'dplk', + // MCCS + kIOFBMCCSInterruptType = 'mccs' +}; + +// IOAppleTimingID's +enum { + kIOTimingIDInvalid = 0, /* Not a standard timing */ + kIOTimingIDApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/ + kIOTimingIDApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ + kIOTimingIDApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ + kIOTimingIDApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ + kIOTimingIDApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ + kIOTimingIDVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ + kIOTimingIDVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ + kIOTimingIDGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ + kIOTimingIDApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ + kIOTimingIDApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ + kIOTimingIDApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ + kIOTimingIDVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ + kIOTimingIDVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ + kIOTimingIDVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ + kIOTimingIDVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ + kIOTimingIDVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to kIOTimingIDApple_1024x768_75hz). */ + kIOTimingIDVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ + kIOTimingIDApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ + kIOTimingIDApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ + kIOTimingIDAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */ + kIOTimingIDAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */ + kIOTimingIDAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */ + kIOTimingIDAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */ + kIOTimingIDApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */ + kIOTimingIDApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */ + kIOTimingIDApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */ + kIOTimingIDApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */ + kIOTimingIDVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ + kIOTimingIDVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ + kIOTimingIDVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ + kIOTimingIDVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ + kIOTimingIDVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ + kIOTimingIDVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ + kIOTimingIDVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */ + kIOTimingIDVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */ + kIOTimingIDVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */ + kIOTimingIDVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */ + kIOTimingIDVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */ + kIOTimingIDVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */ + kIOTimingIDVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */ + kIOTimingIDVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */ + kIOTimingIDVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */ + kIOTimingIDVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */ + kIOTimingIDSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ + kIOTimingIDFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ + kIOTimingIDSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */ + kIOTimingIDSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */ + kIOTimingIDSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */ + kIOTimingIDSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */ + kIOTimingIDApple_0x0_0hz_Offline = 550, /* Indicates that this timing will take the display off-line and remove it from the system. */ + kIOTimingIDVESA_848x480_60hz = 570, /* 848x480 (60 Hz) VESA timing. */ + kIOTimingIDVESA_1360x768_60hz = 590 /* 1360x768 (60 Hz) VESA timing. */ +}; + +// framebuffer property keys + +#define kIOFramebufferInfoKey "IOFramebufferInformation" + +#define kIOFBWidthKey "IOFBWidth" +#define kIOFBHeightKey "IOFBHeight" +#define kIOFBRefreshRateKey "IOFBRefreshRate" +#define kIOFBFlagsKey "IOFBFlags" +#define kIOFBBytesPerRowKey "IOFBBytesPerRow" +#define kIOFBBytesPerPlaneKey "IOFBBytesPerPlane" +#define kIOFBBitsPerPixelKey "IOFBBitsPerPixel" +#define kIOFBComponentCountKey "IOFBComponentCount" +#define kIOFBBitsPerComponentKey "IOFBBitsPerComponent" + +#define kIOFBDetailedTimingsKey "IOFBDetailedTimings" +#define kIOFBTimingRangeKey "IOFBTimingRange" +#define kIOFBScalerInfoKey "IOFBScalerInfo" +#define kIOFBCursorInfoKey "IOFBCursorInfo" + +#define kIOFBHostAccessFlagsKey "IOFBHostAccessFlags" + +#define kIOFBMemorySizeKey "IOFBMemorySize" + +#define kIOFBProbeOptionsKey "IOFBProbeOptions" + +#define kIOFBGammaWidthKey "IOFBGammaWidth" +#define kIOFBGammaCountKey "IOFBGammaCount" +#define kIOFBCLUTDeferKey "IOFBCLUTDefer" + +// exists on the hibernate progress display device +#ifndef kIOHibernatePreviewActiveKey +#define kIOHibernatePreviewActiveKey "IOHibernatePreviewActive" +// values for kIOHibernatePreviewActiveKey set by driver +enum { + kIOHibernatePreviewActive = 0x00000001, + kIOHibernatePreviewUpdates = 0x00000002 +}; +#endif + +// CFNumber/CFData +#define kIOFBAVSignalTypeKey "av-signal-type" +enum { + kIOFBAVSignalTypeUnknown = 0x00000000, + kIOFBAVSignalTypeVGA = 0x00000001, + kIOFBAVSignalTypeDVI = 0x00000002, + kIOFBAVSignalTypeHDMI = 0x00000008, + kIOFBAVSignalTypeDP = 0x00000010, +}; + +// diagnostic keys + +#define kIOFBConfigKey "IOFBConfig" +#define kIOFBModesKey "IOFBModes" +#define kIOFBModeIDKey "ID" +#define kIOFBModeDMKey "DM" +#define kIOFBModeTMKey "TM" +#define kIOFBModeAIDKey "AID" +#define kIOFBModeDFKey "DF" + +// display property keys + +#define kIODisplayEDIDKey "IODisplayEDID" +#define kIODisplayLocationKey "IODisplayLocation" // CFString +#define kIODisplayConnectFlagsKey "IODisplayConnectFlags" // CFNumber +#define kIODisplayHasBacklightKey "IODisplayHasBacklight" // CFBoolean +#define kIODisplayIsDigitalKey "IODisplayIsDigital" // CFBoolean +#define kDisplayBundleKey "DisplayBundle" + +#define kAppleDisplayTypeKey "AppleDisplayType" +#define kAppleSenseKey "AppleSense" + +#define kIODisplayMCCSVersionKey "IODisplayMCCSVersion" +#define kIODisplayTechnologyTypeKey "IODisplayTechnologyType" +#define kIODisplayUsageTimeKey "IODisplayUsageTime" +#define kIODisplayFirmwareLevelKey "IODisplayFirmwareLevel" + +enum { + kDisplayVendorIDUnknown = 'unkn', + kDisplayProductIDGeneric = 0x717 +}; + +#define kDisplayVendorID "DisplayVendorID" // CFNumber +#define kDisplayProductID "DisplayProductID" // CFNumber +#define kDisplaySerialNumber "DisplaySerialNumber" // CFNumber +#define kDisplaySerialString "DisplaySerialString" // CFString +#define kDisplayWeekOfManufacture "DisplayWeekManufacture" // CFNumber +#define kDisplayYearOfManufacture "DisplayYearManufacture" // CFNumber + +// CFDictionary of language-locale keys, name values +// eg. "en"="Color LCD", "en-GB"="Colour LCD" +#define kDisplayProductName "DisplayProductName" + +// all CFNumber or CFArray of CFNumber (floats) +#define kDisplayWhitePointX "DisplayWhitePointX" +#define kDisplayWhitePointY "DisplayWhitePointY" +#define kDisplayRedPointX "DisplayRedPointX" +#define kDisplayRedPointY "DisplayRedPointY" +#define kDisplayGreenPointX "DisplayGreenPointX" +#define kDisplayGreenPointY "DisplayGreenPointY" +#define kDisplayBluePointX "DisplayBluePointX" +#define kDisplayBluePointY "DisplayBluePointY" +#define kDisplayWhiteGamma "DisplayWhiteGamma" +#define kDisplayRedGamma "DisplayRedGamma" +#define kDisplayGreenGamma "DisplayGreenGamma" +#define kDisplayBlueGamma "DisplayBlueGamma" + +// Display gamma +#define kDisplayGammaChannels "DisplayGammaChannels" // CFNumber 1 or 3 channel count +#define kDisplayGammaEntryCount "DisplayGammaEntryCount" // CFNumber 1-based count of entries per channel +#define kDisplayGammaEntrySize "DisplayGammaEntrySize" // CFNumber size in bytes of each table entry +#define kDisplayGammaTable "DisplayGammaTable" // CFData + +// CFBoolean +#define kDisplayBrightnessAffectsGamma "DisplayBrightnessAffectsGamma" +#define kDisplayViewAngleAffectsGamma "DisplayViewAngleAffectsGamma" + +// CFData +#define kDisplayCSProfile "DisplayCSProfile" + +// CFNumber +#define kDisplayHorizontalImageSize "DisplayHorizontalImageSize" +#define kDisplayVerticalImageSize "DisplayVerticalImageSize" + +// Pixel description + +// CFBoolean +#define kDisplayFixedPixelFormat "DisplayFixedPixelFormat" + +enum { + kDisplaySubPixelLayoutUndefined = 0x00000000, + kDisplaySubPixelLayoutRGB = 0x00000001, + kDisplaySubPixelLayoutBGR = 0x00000002, + kDisplaySubPixelLayoutQuadGBL = 0x00000003, + kDisplaySubPixelLayoutQuadGBR = 0x00000004, + + kDisplaySubPixelConfigurationUndefined = 0x00000000, + kDisplaySubPixelConfigurationDelta = 0x00000001, + kDisplaySubPixelConfigurationStripe = 0x00000002, + kDisplaySubPixelConfigurationStripeOffset = 0x00000003, + kDisplaySubPixelConfigurationQuad = 0x00000004, + + kDisplaySubPixelShapeUndefined = 0x00000000, + kDisplaySubPixelShapeRound = 0x00000001, + kDisplaySubPixelShapeSquare = 0x00000002, + kDisplaySubPixelShapeRectangular = 0x00000003, + kDisplaySubPixelShapeOval = 0x00000004, + kDisplaySubPixelShapeElliptical = 0x00000005 +}; + +// CFNumbers +#define kDisplaySubPixelLayout "DisplaySubPixelLayout" +#define kDisplaySubPixelConfiguration "DisplaySubPixelConfiguration" +#define kDisplaySubPixelShape "DisplaySubPixelShape" + +#define kIODisplayOverrideMatchingKey "IODisplayOverrideMatching" + +// Display parameters + +#define kIODisplayParametersKey "IODisplayParameters" +#define kIODisplayGUIDKey "IODisplayGUID" + +#define kIODisplayValueKey "value" +#define kIODisplayMinValueKey "min" +#define kIODisplayMaxValueKey "max" + +#define kIODisplayBrightnessKey "brightness" +#define kIODisplayContrastKey "contrast" +#define kIODisplayHorizontalPositionKey "horizontal-position" +#define kIODisplayHorizontalSizeKey "horizontal-size" +#define kIODisplayVerticalPositionKey "vertical-position" +#define kIODisplayVerticalSizeKey "vertical-size" +#define kIODisplayTrapezoidKey "trapezoid" +#define kIODisplayPincushionKey "pincushion" +#define kIODisplayParallelogramKey "parallelogram" +#define kIODisplayRotationKey "rotation" +#define kIODisplayTheatreModeKey "theatre-mode" +#define kIODisplayTheatreModeWindowKey "theatre-mode-window" +#define kIODisplayOverscanKey "oscn" +#define kIODisplayVideoBestKey "vbst" + +#define kIODisplaySpeakerVolumeKey "speaker-volume" +#define kIODisplaySpeakerSelectKey "speaker-select" +#define kIODisplayMicrophoneVolumeKey "microphone-volume" +#define kIODisplayAmbientLightSensorKey "ambient-light-sensor" +#define kIODisplayAudioMuteAndScreenBlankKey "audio-mute-and-screen-blank" +#define kIODisplayAudioTrebleKey "audio-treble" +#define kIODisplayAudioBassKey "audio-bass" +#define kIODisplayAudioBalanceLRKey "audio-balance-LR" +#define kIODisplayAudioProcessorModeKey "audio-processor-mode" +#define kIODisplayPowerModeKey "power-mode" +#define kIODisplayManufacturerSpecificKey "manufacturer-specific" + + +#define kIODisplayRedGammaScaleKey "rgsc" +#define kIODisplayGreenGammaScaleKey "ggsc" +#define kIODisplayBlueGammaScaleKey "bgsc" + +#define kIODisplayParametersCommitKey "commit" +#define kIODisplayParametersDefaultKey "defaults" +#define kIODisplayParametersFlushKey "flush" + +#ifdef __cplusplus +} +#endif + +#endif /* ! _IOKIT_IOGRAPHICSTYPES_H */ diff --git a/i386/include/IOKit/hid/.svn/all-wcprops b/i386/include/IOKit/hid/.svn/all-wcprops new file mode 100644 index 0000000..80e0eb4 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hid +END +IOHIDDevice.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hid/IOHIDDevice.h +END +IOHIDUsageTables.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hid/IOHIDUsageTables.h +END +IOHIDInterface.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hid/IOHIDInterface.h +END +IOHIDElement.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hid/IOHIDElement.h +END +IOHIDKeys.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hid/IOHIDKeys.h +END diff --git a/i386/include/IOKit/hid/.svn/entries b/i386/include/IOKit/hid/.svn/entries new file mode 100644 index 0000000..7d1a489 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/hid +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOHIDDevice.h +file + + + + +2013-08-27T23:54:23.000000Z +f7eeed7b0afe1afd50442e7498baa91c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +32108 + +IOHIDUsageTables.h +file + + + + +2013-08-27T23:54:23.000000Z +ce9974eaa13ae4e48c8053efaac94db6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +98997 + +IOHIDInterface.h +file + + + + +2013-08-27T23:54:23.000000Z +eedee0102763e025f9c6b93ac185cf35 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11183 + +IOHIDElement.h +file + + + + +2013-08-27T23:54:23.000000Z +1566fc655b0473bd820f8ed8325c9a14 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4986 + +IOHIDKeys.h +file + + + + +2013-08-27T23:54:23.000000Z +8cf4eb097a85ace6541709c2f6f4e56b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14671 + diff --git a/i386/include/IOKit/hid/.svn/text-base/IOHIDDevice.h.svn-base b/i386/include/IOKit/hid/.svn/text-base/IOHIDDevice.h.svn-base new file mode 100644 index 0000000..29f0024 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/text-base/IOHIDDevice.h.svn-base @@ -0,0 +1,706 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDDEVICE_H +#define _IOKIT_HID_IOHIDDEVICE_H + +#include +#include +#include +#include +#include + +class IOHIDSystem; +class IOHIDPointing; +class IOHIDKeyboard; +class IOHIDConsumer; +class IOHIDElementPrivate; +class IOHIDEventQueue; +class IOHIDInterface; +class IOHIDDeviceShim; +struct IOHIDReportHandler; + +/*! + @typedef IOHIDCompletionAction + @abstract Function called when set/get report completes + @param target The target specified in the IOHIDCompletion struct. + @param parameter The parameter specified in the IOHIDCompletion struct. + @param status Completion status +*/ +typedef void (*IOHIDCompletionAction)( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + +/*! + @typedef IOHIDCompletion + @abstract Struct spefifying action to perform when set/get report completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. +*/ +typedef struct IOHIDCompletion { + void * target; + IOHIDCompletionAction action; + void * parameter; +} IOHIDCompletion; + +/*! + @enum IOHIDReportOption + @abstract Option bits for IOHIDDevice::handleReport, + IOHIDDevice::getReport, and IOHIDDevice::setReport + @constant kIOHIDReportOptionNotInterrupt Tells method that the report + passed was not interrupt driven. +*/ +enum +{ + kIOHIDReportOptionNotInterrupt = 0x100 +}; + + +/*! @class IOHIDDevice : public IOService + @abstract IOHIDDevice defines a Human Interface Device (HID) object, + which will interact with the HID Manager by publishing static properties + in the registry, and also by reporting HID events through shared memory. + IOHIDDevice is an abstract class that must be subclassed to support a + specific type of HID devices, such as USB HID class devices. +
+ Since most HID devices are expected to be USB devices, IOHIDDevice + uses the USB HID specification to define the format of the report + descriptor, and also reports that are used to communicate with the + hardware via some intervening transport layer. However, there is no + mandate that the transport layer must be restricted to USB. A subclass + may be created to support legacy ADB joysticks, and issue packets on + the ADB bus and translate those packets to USB reports, and vice versa. + IOHIDDevice does not care how those reports are generated or consumed + by the physical device, as long as the reports abide to the USB + specification. */ + +class IOHIDDevice : public IOService +{ + OSDeclareDefaultStructors( IOHIDDevice ) + + friend class IOHIDLibUserClient; + friend class IOHIDDeviceShim; + +private: + OSArray * _elementArray; + UInt32 _dataElementIndex; + IORecursiveLock * _elementLock; + IOHIDReportHandler * _reportHandlers; + IOBufferMemoryDescriptor * _elementValuesDescriptor; + bool _readyForInputReports; + UInt32 _reportCount; + UInt32 _maxInputReportSize; + UInt32 _maxOutputReportSize; + UInt32 _maxFeatureReportSize; + + struct ExpansionData { + OSSet * clientSet; + IOService * seizedClient; + AbsoluteTime eventDeadline; + IONotifier * publishNotify; + OSArray * inputInterruptElementArray; + bool performTickle; + IOHIDInterface * interfaceNub; + IOHIDElementPrivate * rollOverElement; + OSArray * hierarchElements; + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + // HID report descriptor parsing support. + + bool linkToParent( const OSArray * array, + UInt32 parentIndex, + UInt32 childIndex ); + + bool createCollectionElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 maxCount ); + + bool createValueElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 hidReportType, + IOHIDElementType elementType, + UInt32 maxCount ); + + bool createButtonElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 hidReportType, + IOHIDElementType elementType, + UInt32 maxCount ); + + bool createReportHandlerElements( HIDPreparsedDataRef parseData); + + OSArray * newDeviceUsagePairs(); + + bool getReportCountAndSizes( HIDPreparsedDataRef parseData ); + + bool setReportSize( UInt8 reportID, + IOHIDReportType reportType, + UInt32 bits ); + + IOReturn createElementHierarchy( HIDPreparsedDataRef parseData ); + + IOReturn parseReportDescriptor( IOMemoryDescriptor * report, + IOOptionBits options = 0 ); + + IOBufferMemoryDescriptor * createMemoryForElementValues(); + + + static bool _publishNotificationHandler( void * target, + void * ref, IOService * newService ); + +protected: + +/*! @function free + @abstract Free the IOHIDDevice object. + @discussion Release all resources that were previously allocated, + then call super::free() to propagate the call to our superclass. */ + + virtual void free(); + +/*! @function handleOpen + @abstract Handle a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result true to accept the client open, false otherwise. */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handle a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). */ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Query whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result true if the specified client, or any client if none (0) is + specified, presently has an open on this object. */ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function handleStart + @abstract Prepare the hardware and driver to support I/O operations. + @discussion IOHIDDevice will call this method from start() before + any I/O operations are issued to the concrete subclass. Methods + such as newReportDescriptor() are only called after handleStart() + has returned true. A subclass that overrides this method should + begin its implementation by calling the version in super, and + then check the return value. + @param provider The provider argument passed to start(). + @result True on success, or false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool handleStart( IOService * provider ); + +/*! @function handleStop + @abstract Quiesce the hardware and stop the driver. + @discussion IOHIDDevice will call this method from stop() to + signal that the hardware should be quiesced and the driver stopped. + A subclass that overrides this method should end its implementation + by calling the version in super. + @param provider The provider argument passed to stop(). */ + + virtual void handleStop( IOService * provider ); + +/*! @function newUserClient + @abstract Handle a request to create a connection for a non kernel + client. + @discussion Create a new IOUserClient, or a subclass of IOUserClient, + to service a connection to a non kernel client. This implementation + will simply call the implementation in IOService to handle the call. + @param owningTask The mach task requesting the connection. + @param security_id A token representing the access level for the task. + @param type A constant specifying the type of connection to be created. + @param properties A dictionary of additional properties for the connection. + @param handler The IOUserClient object returned. + @result The return from IOService::newUserClient() is returned. */ + + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ); + IOReturn newUserClientGated(task_t owningTask, + void * security_id, + OSDictionary * properties, + IOUserClient ** handler ); + +/*! @function publishProperties + @abstract Publish HID properties to the I/O Kit registry. + @discussion Called by the start() method to fetch and publish all + HID properties to the I/O Kit registry. These properties will allow + the HID Manager to identify all HID device(s) in the system, by + iterating through objects that are subclasses of IOHIDDevice, and + then fetch their published property values. The implementation in + IOHIDDevice will call methods to get each individual HID property, + and subclasses will not normally need to override this method. + @param provider The provider argument passed to start(). + @result True to indicate that all properties were discovered and + published to the registry, false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool publishProperties( IOService * provider ); + +public: + +/*! @function init + @abstract Initialize an IOHIDDevice object. + @discussion Prime the IOHIDDevice object and prepare it to support + a probe() or a start() call. This implementation will simply call + super::init(). + @param A dictionary A property table associated with this IOHIDDevice + instance. + @result True on sucess, or false otherwise. */ + + virtual bool init( OSDictionary * dictionary = 0 ); + +/*! @function start + @abstract Start up the driver using the given provider. + @discussion IOHIDDevice will allocate resources, then call handleStart() + before fetching the report descriptor through newReportDescriptor(), and + publishing HID properties to the registry. Before returning true to + indicate success, registerService() is called to trigger client matching. + Subclasses are recommended to override handleStart(). + @param provider The provider that the driver was matched to, and selected + to run with. + @result True on success, or false otherwise. */ + + virtual bool start( IOService * provider ); + +/*! @function stop + @abstract Called by a provider (during its termination) before detaching + all its clients. + @discussion IOHIDDevice will call handleStop(), then release allocated + resources. Subclasses are recommended to override handleStop(). + @param provider The provider that the driver was started on. */ + + virtual void stop( IOService * provider ); + +/*! @function matchPropertyTable + @abstract Called by the provider during a match + @discussion Compare the properties in the supplied table to this + object's properties. + @param table The property table that this device will match against +*/ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + +/*! @function newTransportString + @abstract Returns a string object that describes the transport + layer used by the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newTransportString() const; + +/*! @function newManufacturerString + @abstract Returns a string object that describes the manufacturer + of the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newManufacturerString() const; + +/*! @function newProductString + @abstract Returns a string object that describes the product + of the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newProductString() const; + +/*! @function newVendorIDNumber + @abstract Returns a number object that describes the vendor ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newVendorIDNumber() const; + +/*! @function newProductIDNumber + @abstract Returns a number object that describes the product ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newProductIDNumber() const; + +/*! @function newVersionNumber + @abstract Returns a number object that describes the version number + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newVersionNumber() const; + +// *** THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString *** +/*! @function newSerialNumber + @abstract THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newSerialNumber() const; + +/*! @function newPrimaryUsageNumber + @abstract Returns a number object that describes the primary usage + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newPrimaryUsageNumber() const; + +/*! @function newPrimaryUsagePageNumber + @abstract Returns a number object that describes the primary usage + page of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newPrimaryUsagePageNumber() const; + +/*! @function newReportDescriptor + @abstract Create and return a new memory descriptor that describes the + report descriptor for the HID device. + @discussion A subclass must override this pure virtual function, and + return a memory descriptor that describes the HID report descriptor as + defined by the USB Device Class Definition for Human Interface Devices + Version 1.1 specification. + @param descriptor Pointer to the memory descriptor returned. This + memory descriptor will be released by the caller. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn newReportDescriptor( + IOMemoryDescriptor ** descriptor ) const = 0; + +/*! @function handleReport + @abstract Handle an asynchronous report received from the HID device. + @param report A memory descriptor that describes the report. + @param reportType The type of report. + @param options Options to specify the request. No options are + currently defined, and the default value is 0. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn handleReport( + IOMemoryDescriptor * report, + IOHIDReportType reportType = kIOHIDReportTypeInput, + IOOptionBits options = 0 ); + +/*! @function getReport + @abstract Get a report from the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the memory to store + the report read from the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options ); + +/*! @function setReport + @abstract Send a report to the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the report to send + to the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + +/*! @function getMemoryWithCurrentElementValues + @abstract Get a reference to a memory descriptor that describes the + memory block containing the current HID element values. + @discussion Each HID element that can contribute to an input, output, + or feature report, is assigned an area of memory from a common memory + block allocated by IOHIDDevice. Each element will use its assigned + memory area to store its current value, defined by an IOHIDElementValue + structure. The memory described by the memory descriptor may be mapped + to user space to allow the HID Manager to poll the current element + value without the cost of a user-kernel transition. Subclasses should + not override this method. + @result A reference to a memory descriptor that describes the current + element values, or 0 to indicate a resource shortage. */ + + virtual IOMemoryDescriptor * getMemoryWithCurrentElementValues() const; + +/*! @function registerElement + @abstract A registration function called by a HID element to register + itself, and also to obtain an unique cookie identifier + (unique per device, not unique system-wide). + @discussion An internal data type, an IOHIDElementPrivate, is created to + represent each HID element discovered by parsing the HID report + descriptor. Each element created will call this method to register + itself with its owner (IOHIDDevice), and also to obtain an element + cookie that is used by HID Manager to specify and identify the element. + Subclasses should not override this method. + @param element The element that is requesting registration with its + owner. + @param cookie Pointer to the returned cookie assigned to this element. + @result True on success, or false otherwise. */ + + virtual bool registerElement( IOHIDElementPrivate * element, + IOHIDElementCookie * cookie ); + +/*! @function startEventDelivery + @abstract Start delivering events from a HID element to the event + queue specified. + @discussion Clients of IOHIDDevice may create an IOHIDEventQueue, and + then call this method to register for delivery of events generated by + one or more HID elements to that event queue. Subclasses should not + override this method. + @param queue The event queue that is interested in receiving events + generated by the HID element specified. The retain count on the queue + will be incremented by one. + @param cookie The cookie for a HID element published by the HID device. + @param options Options to specify the request. No options are currently + defined, and the default value is zero. + @result kIOReturnSuccess on success, or kIOReturnBadArgument if the + queue or the cookie argument specified is invalid, or kIOReturnNoMemory + if a resource shortage was encountered. */ + + virtual IOReturn startEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie, + IOOptionBits options = 0 ); + +/*! @function stopEventDelivery + @abstract Stop delivering events from one or more HID elements to the + event queue specified. + @discussion Clients that called startEventDelivery() must eventually + call this method to stop event delivery to its queue from one or more + HID elements. + @param queue The event queue that no longer wishes to receive events + generated by the HID element specified. + @param cookie The cookie for a HID element published by the HID device. + The default value of zero indicates that the queue should be removed from + the event dispatch list of all HID elements published by the HID device. + Subclasses should not override this method. + @result kIOReturnSuccess if the queue was removed from the event dispatch + list for one or more HID elements, or kIOReturnBadArgument if the queue + or the cookie argument specified is invalid, or kIOReturnNotFound if the + queue was not found. */ + + virtual IOReturn stopEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie = 0 ); + +/*! @function checkEventDelivery + @abstract Check whether events from a HID element will be delivered to + the event queue specified. + @param queue The event queue. + @param cookie The cookie for a HID element published by the HID device. + @param isActive Pointer to the return value that is set to true if events + generated by the HID element will be delivered to the queue, or false + otherwise. This return value is set only if kIOReturnSuccess is + returned. + @result kIOReturnSuccess on success, or kIOReturnBadArgument if one or + more of the arguments provided are invalid. */ + + virtual IOReturn checkEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie, + bool * isActive ); + +/*! @function updateElementValues + @abstract Updates element values from a HID device via getReport. + @discussion A completion parameter may be added in the future. + @param cookies A list of element cookies who's values need to be + set on the device. + @param cookieCount The number of element cookies. + @result kIOReturnSuccess on success, or an error return otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 0); + virtual IOReturn updateElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1); + +/*! @function postElementValues + @abstract Posts element values to a HID device via setReport. + @discussion A completion parameter may be added in the future. + @param cookies A list of element cookies who's values need to be + set on the device. + @param cookieCount The number of element cookies. + @result kIOReturnSuccess on success, or an error return otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 1); + virtual IOReturn postElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1); + +/*! @function newSerialNumberString + @abstract Returns a string object that describes the serial number + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 2); + virtual OSString * newSerialNumberString() const; + +/*! @function newLocationIDNumber + @abstract Returns a number object that describes the location ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 3); + virtual OSNumber * newLocationIDNumber() const; + +/*! @function getReport + @abstract Get a report from the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the memory to store + the report read from the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @param completionTimeout Specifies an amount of time (in ms) after which + the command will be aborted if the entire command has not been completed. + @param completion Function to call when request completes. If omitted then + getReport() executes synchronously, blocking until the request is complete. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 4); + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion = 0); + +/*! @function setReport + @abstract Send a report to the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the report to send + to the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @param completionTimeout Specifies an amount of time (in ms) after which + the command will be aborted if the entire command has not been completed. + @param completion Function to call when request completes. If omitted then + setReport() executes synchronously, blocking until the request is complete. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 5); + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion = 0); + +/*! @function newVendorIDSourceNumber + @abstract Returns a number object that describes the vendor ID + source of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 6); + virtual OSNumber * newVendorIDSourceNumber() const; + +/*! @function newCountryCodeNumber + @abstract Returns a number object that describes the country code + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 7); + virtual OSNumber * newCountryCodeNumber() const; + + +/*! @function handleReportWithTime + @abstract Handle an asynchronous report received from the HID device. + @param timeStamp The timestamp of report. + @param report A memory descriptor that describes the report. + @param reportType The type of report. Currently, only + kIOHIDReportTypeInput report type is handled. + @param options Options to specify the request. No options are + currently defined, and the default value is 0. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 8); + virtual IOReturn handleReportWithTime( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType = kIOHIDReportTypeInput, + IOOptionBits options = 0); + +/*! @function newReportInterval + @abstract Returns a number object that describes the actual polling + interval of the HID device in microseconds. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 9); + virtual OSNumber * newReportIntervalNumber() const; + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 10); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 11); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 12); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 13); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 14); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 15); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 16); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 17); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 18); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 19); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 20); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 21); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 22); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 23); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 24); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 25); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 26); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 27); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 28); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 29); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 30); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 31); + +#ifndef __ppc__ + OSMetaClassDeclareReservedUnused(IOHIDDevice, 32); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 33); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 34); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 35); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 36); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 37); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 38); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 39); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 40); +#endif + +}; + +#endif /* !_IOKIT_HID_IOHIDDEVICE_H */ diff --git a/i386/include/IOKit/hid/.svn/text-base/IOHIDElement.h.svn-base b/i386/include/IOKit/hid/.svn/text-base/IOHIDElement.h.svn-base new file mode 100644 index 0000000..f4fbb17 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/text-base/IOHIDElement.h.svn-base @@ -0,0 +1,106 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDELEMENT_H +#define _IOKIT_HID_IOHIDELEMENT_H + +#include +#include +#include + +//=========================================================================== +// An object that describes a single HID element. + +class IOHIDElement: public OSObject +{ + OSDeclareAbstractStructors( IOHIDElement ) + + struct ExpansionData { + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +public: + + virtual IOHIDElementCookie getCookie() = 0; + virtual IOHIDElement * getParentElement() = 0; + virtual OSArray * getChildElements() = 0; + virtual IOHIDElementType getType() = 0; + virtual IOHIDElementCollectionType getCollectionType() = 0; + virtual UInt32 getUsagePage() = 0; + virtual UInt32 getUsage() = 0; + virtual UInt32 getLogicalMin() = 0; + virtual UInt32 getLogicalMax() = 0; + virtual UInt32 getPhysicalMin() = 0; + virtual UInt32 getPhysicalMax() = 0; + virtual UInt32 getUnitExponent() = 0; + virtual UInt32 getUnit() = 0; + virtual UInt32 getReportSize() = 0; + virtual UInt32 getReportCount() = 0; + virtual UInt32 getReportID() = 0; + virtual UInt32 getFlags() = 0; + virtual AbsoluteTime getTimeStamp() = 0; + virtual UInt32 getValue() = 0; + virtual OSData * getDataValue() = 0; + virtual void setValue(UInt32 value) = 0; + virtual void setDataValue(OSData * value) = 0; + + OSMetaClassDeclareReservedUnused(IOHIDElement, 0); + OSMetaClassDeclareReservedUnused(IOHIDElement, 1); + OSMetaClassDeclareReservedUnused(IOHIDElement, 2); + OSMetaClassDeclareReservedUnused(IOHIDElement, 3); + OSMetaClassDeclareReservedUnused(IOHIDElement, 4); + OSMetaClassDeclareReservedUnused(IOHIDElement, 5); + OSMetaClassDeclareReservedUnused(IOHIDElement, 6); + OSMetaClassDeclareReservedUnused(IOHIDElement, 7); + OSMetaClassDeclareReservedUnused(IOHIDElement, 8); + OSMetaClassDeclareReservedUnused(IOHIDElement, 9); + OSMetaClassDeclareReservedUnused(IOHIDElement, 10); + OSMetaClassDeclareReservedUnused(IOHIDElement, 11); + OSMetaClassDeclareReservedUnused(IOHIDElement, 12); + OSMetaClassDeclareReservedUnused(IOHIDElement, 13); + OSMetaClassDeclareReservedUnused(IOHIDElement, 14); + OSMetaClassDeclareReservedUnused(IOHIDElement, 15); + OSMetaClassDeclareReservedUnused(IOHIDElement, 16); + OSMetaClassDeclareReservedUnused(IOHIDElement, 17); + OSMetaClassDeclareReservedUnused(IOHIDElement, 18); + OSMetaClassDeclareReservedUnused(IOHIDElement, 19); + OSMetaClassDeclareReservedUnused(IOHIDElement, 20); + OSMetaClassDeclareReservedUnused(IOHIDElement, 21); + OSMetaClassDeclareReservedUnused(IOHIDElement, 22); + OSMetaClassDeclareReservedUnused(IOHIDElement, 23); + OSMetaClassDeclareReservedUnused(IOHIDElement, 24); + OSMetaClassDeclareReservedUnused(IOHIDElement, 25); + OSMetaClassDeclareReservedUnused(IOHIDElement, 26); + OSMetaClassDeclareReservedUnused(IOHIDElement, 27); + OSMetaClassDeclareReservedUnused(IOHIDElement, 28); + OSMetaClassDeclareReservedUnused(IOHIDElement, 29); + OSMetaClassDeclareReservedUnused(IOHIDElement, 30); + OSMetaClassDeclareReservedUnused(IOHIDElement, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDELEMENT_H */ diff --git a/i386/include/IOKit/hid/.svn/text-base/IOHIDInterface.h.svn-base b/i386/include/IOKit/hid/.svn/text-base/IOHIDInterface.h.svn-base new file mode 100644 index 0000000..54b4230 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/text-base/IOHIDInterface.h.svn-base @@ -0,0 +1,252 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDINTERFACE_H +#define _IOKIT_HID_IOHIDINTERFACE_H + +#include +#include + +class IOHIDDevice; + +/*! @class IOHIDInterface : public IOService + @abstract In kernel interface to a HID device. + @discussion +*/ + +class IOHIDInterface: public IOService +{ + OSDeclareDefaultStructors( IOHIDInterface ) + +public: + + /*! @typedef IOHIDInterface::InterruptReportAction + @abstract Callback to handle an asynchronous report received from + the HID device. + @discussion This callback is set when calling IOHIDInterface::open. + @param target Pointer to your data object. + @param timestamp Time when the report was delivered. + @param report A memory descriptor that describes the report. + @param reportType The type of report. + @param reportID The ID of the report. + @param refcon void * pointer to more data. + */ + typedef void (*InterruptReportAction)( + OSObject * target, + AbsoluteTime timestamp, + IOMemoryDescriptor * report, + IOHIDReportType type, + UInt32 reportID, + void * refcon); + + /*! + @typedef IOHIDInterface::CompletionAction + @discussion Function called when HID I/O completes. + @param target + @param refcon + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + */ + + typedef void (*CompletionAction)( + OSObject * target, + void * refcon, + IOReturn status, + UInt32 bufferSizeRemaining); + +private: + IOHIDDevice * _owner; + OSArray * _elementArray; + InterruptReportAction _interruptAction; + void * _interruptRefCon; + OSObject * _interruptTarget; + OSString * _transportString; + OSString * _manufacturerString; + OSString * _productString; + OSString * _serialNumberString; + UInt32 _locationID; + UInt32 _vendorID; + UInt32 _vendorIDSource; + UInt32 _productID; + UInt32 _version; + UInt32 _countryCode; + IOByteCount _maxReportSize[kIOHIDReportTypeCount]; + + struct ExpansionData { + UInt32 reportInterval; + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +protected: + + /*! + @function free + @abstract Free the IOHIDInterface object. + @discussion Release all resources that were previously allocated, + then call super::free() to propagate the call to our superclass. + */ + + virtual void free(); + +public: + + static IOHIDInterface * withElements ( OSArray * elements ); + + /*! + @function init + @abstract Initialize an IOHIDInterface object. + @discussion Prime the IOHIDInterface object and prepare it to support + a probe() or a start() call. This implementation will simply call + super::init(). + @param A dictionary A property table associated with this IOHIDInterface + instance. + @result True on sucess, or false otherwise. + */ + + virtual bool init( OSDictionary * dictionary = 0 ); + + /*! + @function start + @abstract Start up the driver using the given provider. + @discussion IOHIDInterface will allocate resources. Before returning true + to indicate success, registerService() is called to trigger client matching. + @param provider The provider that the driver was matched to, and selected + to run with. + @result True on success, or false otherwise. + */ + + virtual bool start( IOService * provider ); + + /*! + @function matchPropertyTable + @abstract Called by the provider during a match + @discussion Compare the properties in the supplied table to this + object's properties. + @param table The property table that this device will match against + */ + + virtual bool matchPropertyTable( + OSDictionary * table, + SInt32 * score); + + virtual bool open ( + IOService * client, + IOOptionBits options, + InterruptReportAction action, + void * refCon); + + virtual void close( + IOService * client, + IOOptionBits options = 0 ); + + virtual OSString * getTransport (); + virtual UInt32 getLocationID (); + virtual UInt32 getVendorID (); + virtual UInt32 getVendorIDSource (); + virtual UInt32 getProductID (); + virtual UInt32 getVersion (); + virtual UInt32 getCountryCode (); + virtual OSString * getManufacturer (); + virtual OSString * getProduct (); + virtual OSString * getSerialNumber (); + virtual IOByteCount getMaxReportSize (IOHIDReportType type); + + virtual OSArray * createMatchingElements ( + OSDictionary * matching = 0, + IOOptionBits options = 0); + + virtual void handleReport ( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + IOOptionBits options = 0); + + virtual IOReturn setReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0); + + virtual IOReturn getReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0); + + virtual IOReturn setReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0, + UInt32 completionTimeout = 0, + CompletionAction * completion = 0); + + virtual IOReturn getReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0, + UInt32 completionTimeout = 0, + CompletionAction * completion = 0); + + OSMetaClassDeclareReservedUsed(IOHIDInterface, 0); + virtual UInt32 getReportInterval (); + + OSMetaClassDeclareReservedUnused(IOHIDInterface, 1); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 2); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 3); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 4); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 5); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 6); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 7); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 8); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 9); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 10); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 11); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 12); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 13); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 14); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 15); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 16); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 17); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 18); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 19); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 20); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 21); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 22); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 23); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 24); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 25); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 26); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 27); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 28); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 29); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 30); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 31); +}; + +#endif /* !_IOKIT_HID_IOHIDINTERFACE_H */ diff --git a/i386/include/IOKit/hid/.svn/text-base/IOHIDKeys.h.svn-base b/i386/include/IOKit/hid/.svn/text-base/IOHIDKeys.h.svn-base new file mode 100644 index 0000000..a4e3789 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/text-base/IOHIDKeys.h.svn-base @@ -0,0 +1,349 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDKEYS_H_ +#define _IOKIT_HID_IOHIDKEYS_H_ + +#include +#include + +__BEGIN_DECLS + +/* The following keys are used to search the IORegistry for HID related services +*/ + +/* This is used to find HID Devices in the IORegistry */ +#define kIOHIDDeviceKey "IOHIDDevice" + +/*! + @defined HID Device Property Keys + @abstract Keys that represent properties of a paticular device. + @discussion Keys that represent properties of a paticular device. Can be added + to your matching dictionary when refining searches for HID devices. +

+ Please note:
+ kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer + rich enough to describe a device's capabilities. Take, for example, a + device that describes both a keyboard and a mouse in the same descriptor. + The previous behavior was to only describe the keyboard behavior with the + primary usage and usage page. Needless to say, this would sometimes cause + a program interested in mice to skip this device when matching. +
+ Thus we have added 3 + additional keys: +
    +
  • kIOHIDDeviceUsageKey
  • +
  • kIOHIDDeviceUsagePageKey
  • +
  • kIOHIDDeviceUsagePairsKey
  • +
+ kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing + key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. + These usage pairs describe all application type collections (behaviors) defined + by the device. +

+ An application intersted in only matching on one criteria would only add the + kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. + If it is interested in a device that has multiple behaviors, the application would + instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his + matching dictionary. +*/ +#define kIOHIDTransportKey "Transport" +#define kIOHIDVendorIDKey "VendorID" +#define kIOHIDVendorIDSourceKey "VendorIDSource" +#define kIOHIDProductIDKey "ProductID" +#define kIOHIDVersionNumberKey "VersionNumber" +#define kIOHIDManufacturerKey "Manufacturer" +#define kIOHIDProductKey "Product" +#define kIOHIDSerialNumberKey "SerialNumber" +#define kIOHIDCountryCodeKey "CountryCode" +#define kIOHIDStandardTypeKey "StandardType" +#define kIOHIDLocationIDKey "LocationID" +#define kIOHIDDeviceUsageKey "DeviceUsage" +#define kIOHIDDeviceUsagePageKey "DeviceUsagePage" +#define kIOHIDDeviceUsagePairsKey "DeviceUsagePairs" +#define kIOHIDPrimaryUsageKey "PrimaryUsage" +#define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage" +#define kIOHIDMaxInputReportSizeKey "MaxInputReportSize" +#define kIOHIDMaxOutputReportSizeKey "MaxOutputReportSize" +#define kIOHIDMaxFeatureReportSizeKey "MaxFeatureReportSize" +#define kIOHIDReportIntervalKey "ReportInterval" +#define kIOHIDReportDescriptorKey "ReportDescriptor" + +/*! + @define kIOHIDElementKey + @abstract Keys that represents an element property. + @discussion Property for a HID Device or element dictionary. + Elements can be heirarchical, so they can contain other elements. +*/ +#define kIOHIDElementKey "Elements" + +/*! + @defined HID Element Dictionary Keys + @abstract Keys that represent properties of a particular elements. + @discussion These keys can also be added to a matching dictionary + when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCookieKey "ElementCookie" +#define kIOHIDElementTypeKey "Type" +#define kIOHIDElementCollectionTypeKey "CollectionType" +#define kIOHIDElementUsageKey "Usage" +#define kIOHIDElementUsagePageKey "UsagePage" +#define kIOHIDElementMinKey "Min" +#define kIOHIDElementMaxKey "Max" +#define kIOHIDElementScaledMinKey "ScaledMin" +#define kIOHIDElementScaledMaxKey "ScaledMax" +#define kIOHIDElementSizeKey "Size" +#define kIOHIDElementReportSizeKey "ReportSize" +#define kIOHIDElementReportCountKey "ReportCount" +#define kIOHIDElementReportIDKey "ReportID" +#define kIOHIDElementIsArrayKey "IsArray" +#define kIOHIDElementIsRelativeKey "IsRelative" +#define kIOHIDElementIsWrappingKey "IsWrapping" +#define kIOHIDElementIsNonLinearKey "IsNonLinear" +#define kIOHIDElementHasPreferredStateKey "HasPreferredState" +#define kIOHIDElementHasNullStateKey "HasNullState" +#define kIOHIDElementFlagsKey "Flags" +#define kIOHIDElementUnitKey "Unit" +#define kIOHIDElementUnitExponentKey "UnitExponent" +#define kIOHIDElementNameKey "Name" +#define kIOHIDElementValueLocationKey "ValueLocation" +#define kIOHIDElementDuplicateIndexKey "DuplicateIndex" +#define kIOHIDElementParentCollectionKey "ParentCollection" + +#ifndef __ppc__ + #define kIOHIDElementVendorSpecificKey "VendorSpecific" +#else + #define kIOHIDElementVendorSpecificKey "VendorSpecifc" +#endif + +/*! + @defined HID Element Match Keys + @abstract Keys used for matching particular elements. + @discussion These keys should only be used with a matching + dictionary when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCookieMinKey "ElementCookieMin" +#define kIOHIDElementCookieMaxKey "ElementCookieMax" +#define kIOHIDElementUsageMinKey "UsageMin" +#define kIOHIDElementUsageMaxKey "UsageMax" + +/*! + @defined kIOHIDElementCalibrationMinKey + @abstract The minimum bounds for a calibrated value. +*/ +#define kIOHIDElementCalibrationMinKey "CalibrationMin" + +/*! + @defined kIOHIDElementCalibrationMaxKey + @abstract The maximum bounds for a calibrated value. +*/ +#define kIOHIDElementCalibrationMaxKey "CalibrationMax" + +/*! + @defined kIOHIDElementCalibrationSaturationMinKey + @abstract The mininum tolerance to be used when calibrating a logical element value. + @discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. +*/ +#define kIOHIDElementCalibrationSaturationMinKey "CalibrationSaturationMin" + +/*! + @defined kIOHIDElementCalibrationSaturationMaxKey + @abstract The maximum tolerance to be used when calibrating a logical element value. + @discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. +*/ +#define kIOHIDElementCalibrationSaturationMaxKey "CalibrationSaturationMax" + +/*! + @defined kIOHIDElementCalibrationDeadZoneMinKey + @abstract The minimum bounds near the midpoint of a logical value in which the value is ignored. + @discussion The dead zone property is used to allow for slight differences in the idle value returned by an element. +*/ +#define kIOHIDElementCalibrationDeadZoneMinKey "CalibrationDeadZoneMin" + +/*! + @defined kIOHIDElementCalibrationDeadZoneMinKey + @abstract The maximum bounds near the midpoint of a logical value in which the value is ignored. + @discussion The dead zone property is used to allow for slight differences in the idle value returned by an element. +*/ +#define kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax" + +/*! + @defined kIOHIDElementCalibrationGranularityKey + @abstract The scale or level of detail returned in a calibrated element value. + @discussion Values are rounded off such that if granularity=0.1, values after calibration are 0, 0.1, 0.2, 0.3, etc. +*/ +#define kIOHIDElementCalibrationGranularityKey "CalibrationGranularity" + +/*! + @typedef IOHIDElementCookie + @abstract Abstract data type used as a unique identifier for an element. +*/ +#ifdef __LP64__ + typedef uint32_t IOHIDElementCookie; +#else + typedef void * IOHIDElementCookie; +#endif + +/*! + @typedef IOHIDElementType + @abstract Describes different types of HID elements. + @discussion Used by the IOHIDFamily to identify the type of + element processed. Represented by the key kIOHIDElementTypeKey in the + dictionary describing the element. + @constant kIOHIDElementTypeInput_Misc + Misc input data field or varying size. + @constant kIOHIDElementTypeInput_Button + One bit input data field. + @constant kIOHIDElementTypeInput_Axis + Input data field used to represent an axis. + @constant kIOHIDElementTypeInput_ScanCodes + Input data field used to represent a scan code or usage selector. + @constant kIOHIDElementTypeOutput + Used to represent an output data field in a report. + @constant kIOHIDElementTypeFeature + Describes input and output elements not intended for + consumption by the end user. + @constant kIOHIDElementTypeCollection + Element used to identify a relationship between two or more elements. +*/ +enum IOHIDElementType { + kIOHIDElementTypeInput_Misc = 1, + kIOHIDElementTypeInput_Button = 2, + kIOHIDElementTypeInput_Axis = 3, + kIOHIDElementTypeInput_ScanCodes = 4, + kIOHIDElementTypeOutput = 129, + kIOHIDElementTypeFeature = 257, + kIOHIDElementTypeCollection = 513 +}; +typedef enum IOHIDElementType IOHIDElementType; + +/*! + @typedef IOHIDElementCollectionType + @abstract Describes different types of HID collections. + @discussion Collections identify a relationship between two or more + elements. + @constant kIOHIDElementCollectionTypePhysical + Used for a set of data items that represent data points + collected at one geometric point. + @constant kIOHIDElementCollectionTypeApplication + Identifies item groups serving different purposes in a single device. + @constant kIOHIDElementCollectionTypeLogical + Used when a set of data items form a composite data structure. + @constant kIOHIDElementCollectionTypeReport + Wraps all the fields in a report. + @constant kIOHIDElementCollectionTypeNamedArray + Contains an array of selector usages. + @constant kIOHIDElementCollectionTypeUsageSwitch + Modifies the meaning of the usage it contains. + @constant kIOHIDElementCollectionTypeUsageModifier + Modifies the meaning of the usage attached to the encompassing collection. +*/ +enum IOHIDElementCollectionType{ + kIOHIDElementCollectionTypePhysical = 0x00, + kIOHIDElementCollectionTypeApplication, + kIOHIDElementCollectionTypeLogical, + kIOHIDElementCollectionTypeReport, + kIOHIDElementCollectionTypeNamedArray, + kIOHIDElementCollectionTypeUsageSwitch, + kIOHIDElementCollectionTypeUsageModifier +}; +typedef enum IOHIDElementCollectionType IOHIDElementCollectionType; + + +/*! + @typedef IOHIDReportType + @abstract Describes different type of HID reports. + @discussion Used by the IOHIDFamily to identify the type of + report being processed. + @constant kIOHIDReportTypeInput Input report. + @constant kIOHIDReportTypeOutput Output report. + @constant kIOHIDReportTypeFeature Feature report. +*/ +enum IOHIDReportType{ + kIOHIDReportTypeInput = 0, + kIOHIDReportTypeOutput, + kIOHIDReportTypeFeature, + kIOHIDReportTypeCount +}; +typedef enum IOHIDReportType IOHIDReportType; + +/*! + @typedef IOHIDOptionsType + @abstract Options for opening a device via IOHIDLib. + @constant kIOHIDOptionsTypeNone Default option. + @constant kIOHIDOptionsTypeSeizeDevice Used to open exclusive + communication with the device. This will prevent the system + and other clients from receiving events from the device. +*/ +enum { + kIOHIDOptionsTypeNone = 0x00, + kIOHIDOptionsTypeSeizeDevice = 0x01 +}; +typedef uint32_t IOHIDOptionsType; + + +/*! + @typedef IOHIDQueueOptionsType + @abstract Options for creating a queue via IOHIDLib. + @constant kIOHIDQueueOptionsTypeNone Default option. + @constant kIOHIDQueueOptionsTypeEnqueueAll Force the IOHIDQueue + to enqueue all events, relative or absolute, regardless of change. +*/ +enum { + kIOHIDQueueOptionsTypeNone = 0x00, + kIOHIDQueueOptionsTypeEnqueueAll = 0x01 +}; +typedef uint32_t IOHIDQueueOptionsType; + + +enum { + kIOHIDElementFlagsConstantMask = 0x0001, + kIOHIDElementFlagsVariableMask = 0x0002, + kIOHIDElementFlagsRelativeMask = 0x0004, + kIOHIDElementFlagsWrapMask = 0x0008, + kIOHIDElementFlagsNonLinearMask = 0x0010, + kIOHIDElementFlagsNoPreferredMask = 0x0020, + kIOHIDElementFlagsNullStateMask = 0x0040, + kIOHIDElementFlagsVolativeMask = 0x0080, + kIOHIDElementFlagsBufferedByteMask = 0x0100 +}; +typedef uint32_t IOHIDElementFlags; + +/*! + @typedef IOHIDStandardType + @abstract Type to define what industrial standard the device is referencing. + @constant kIOHIDStandardTypeANSI ANSI. + @constant kIOHIDStandardTypeISO ISO. + @constant kIOHIDStandardTypeJIS JIS. +*/ +enum { + kIOHIDStandardTypeANSI = 0, + kIOHIDStandardTypeISO = 1, + kIOHIDStandardTypeJIS = 2 +}; +typedef uint32_t IOHIDStandardType; + +__END_DECLS + +#endif /* !_IOKIT_HID_IOHIDKEYS_H_ */ diff --git a/i386/include/IOKit/hid/.svn/text-base/IOHIDUsageTables.h.svn-base b/i386/include/IOKit/hid/.svn/text-base/IOHIDUsageTables.h.svn-base new file mode 100644 index 0000000..ff0fd88 --- /dev/null +++ b/i386/include/IOKit/hid/.svn/text-base/IOHIDUsageTables.h.svn-base @@ -0,0 +1,1665 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIDUSAGETABLES_H +#define _IOHIDUSAGETABLES_H + +/* ****************************************************************************************** + * HID Usage Tables + * + * The following constants are from the USB 'HID Usage Tables' specification, revision 1.1rc3 + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum +{ + kHIDPage_Undefined = 0x00, + kHIDPage_GenericDesktop = 0x01, + kHIDPage_Simulation = 0x02, + kHIDPage_VR = 0x03, + kHIDPage_Sport = 0x04, + kHIDPage_Game = 0x05, + /* Reserved 0x06 */ + kHIDPage_KeyboardOrKeypad = 0x07, /* USB Device Class Definition for Human Interface Devices (HID). Note: the usage type for all key codes is Selector (Sel). */ + kHIDPage_LEDs = 0x08, + kHIDPage_Button = 0x09, + kHIDPage_Ordinal = 0x0A, + kHIDPage_Telephony = 0x0B, + kHIDPage_Consumer = 0x0C, + kHIDPage_Digitizer = 0x0D, + /* Reserved 0x0E */ + kHIDPage_PID = 0x0F, /* USB Physical Interface Device definitions for force feedback and related devices. */ + kHIDPage_Unicode = 0x10, + /* Reserved 0x11 - 0x13 */ + kHIDPage_AlphanumericDisplay = 0x14, + /* Reserved 0x15 - 0x7F */ + /* Monitor 0x80 - 0x83 USB Device Class Definition for Monitor Devices */ + /* Power 0x84 - 0x87 USB Device Class Definition for Power Devices */ + kHIDPage_PowerDevice = 0x84, /* Power Device Page */ + kHIDPage_BatterySystem = 0x85, /* Battery System Page */ + /* Reserved 0x88 - 0x8B */ + kHIDPage_BarCodeScanner = 0x8C, /* (Point of Sale) USB Device Class Definition for Bar Code Scanner Devices */ + kHIDPage_WeighingDevice = 0x8D, /* (Point of Sale) USB Device Class Definition for Weighing Devices */ + kHIDPage_Scale = 0x8D, /* (Point of Sale) USB Device Class Definition for Scale Devices */ + kHIDPage_MagneticStripeReader = 0x8E, + /* ReservedPointofSalepages 0x8F */ + kHIDPage_CameraControl = 0x90, /* USB Device Class Definition for Image Class Devices */ + kHIDPage_Arcade = 0x91, /* OAAF Definitions for arcade and coinop related Devices */ + /* Reserved 0x92 - 0xFEFF */ + /* VendorDefined 0xFF00 - 0xFFFF */ + kHIDPage_VendorDefinedStart = 0xFF00 +}; + +/* Undefined Usage for all usage pages */ +enum +{ + kHIDUsage_Undefined = 0x00 +}; + +/* GenericDesktop Page (0x01) */ +enum +{ + kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */ + kHIDUsage_GD_Mouse = 0x02, /* Application Collection */ + /* 0x03 Reserved */ + kHIDUsage_GD_Joystick = 0x04, /* Application Collection */ + kHIDUsage_GD_GamePad = 0x05, /* Application Collection */ + kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */ + kHIDUsage_GD_Keypad = 0x07, /* Application Collection */ + kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */ + /* 0x09 - 0x2F Reserved */ + kHIDUsage_GD_X = 0x30, /* Dynamic Value */ + kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ + kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ + kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ + kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ + kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ + kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */ + kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */ + kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */ + kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */ + kHIDUsage_GD_CountedBuffer = 0x3A, /* Logical Collection */ + kHIDUsage_GD_ByteCount = 0x3B, /* Dynamic Value */ + kHIDUsage_GD_MotionWakeup = 0x3C, /* One-Shot Control */ + kHIDUsage_GD_Start = 0x3D, /* On/Off Control */ + kHIDUsage_GD_Select = 0x3E, /* On/Off Control */ + /* 0x3F Reserved */ + kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ + kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ + kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ + kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ + kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ + kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ + kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ + /* 0x47 - 0x7F Reserved */ + kHIDUsage_GD_SystemControl = 0x80, /* Application Collection */ + kHIDUsage_GD_SystemPowerDown = 0x81, /* One-Shot Control */ + kHIDUsage_GD_SystemSleep = 0x82, /* One-Shot Control */ + kHIDUsage_GD_SystemWakeUp = 0x83, /* One-Shot Control */ + kHIDUsage_GD_SystemContextMenu = 0x84, /* One-Shot Control */ + kHIDUsage_GD_SystemMainMenu = 0x85, /* One-Shot Control */ + kHIDUsage_GD_SystemAppMenu = 0x86, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuHelp = 0x87, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuExit = 0x88, /* One-Shot Control */ + kHIDUsage_GD_SystemMenu = 0x89, /* Selector */ + kHIDUsage_GD_SystemMenuRight = 0x8A, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuLeft = 0x8B, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuUp = 0x8C, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuDown = 0x8D, /* Re-Trigger Control */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_GD_DPadUp = 0x90, /* On/Off Control */ + kHIDUsage_GD_DPadDown = 0x91, /* On/Off Control */ + kHIDUsage_GD_DPadRight = 0x92, /* On/Off Control */ + kHIDUsage_GD_DPadLeft = 0x93, /* On/Off Control */ + /* 0x94 - 0xFFFF Reserved */ + kHIDUsage_GD_Reserved = 0xFFFF +}; + +/* Simulation Page (0x02) */ +/* This section provides detailed descriptions of the usages employed by simulation devices. */ +enum +{ + kHIDUsage_Sim_FlightSimulationDevice = 0x01, /* Application Collection */ + kHIDUsage_Sim_AutomobileSimulationDevice = 0x02, /* Application Collection */ + kHIDUsage_Sim_TankSimulationDevice = 0x03, /* Application Collection */ + kHIDUsage_Sim_SpaceshipSimulationDevice = 0x04, /* Application Collection */ + kHIDUsage_Sim_SubmarineSimulationDevice = 0x05, /* Application Collection */ + kHIDUsage_Sim_SailingSimulationDevice = 0x06, /* Application Collection */ + kHIDUsage_Sim_MotorcycleSimulationDevice = 0x07, /* Application Collection */ + kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection */ + kHIDUsage_Sim_AirplaneSimulationDevice = 0x09, /* Application Collection */ + kHIDUsage_Sim_HelicopterSimulationDevice = 0x0A, /* Application Collection */ + kHIDUsage_Sim_MagicCarpetSimulationDevice = 0x0B, /* Application Collection */ + kHIDUsage_Sim_BicycleSimulationDevice = 0x0C, /* Application Collection */ + /* 0x0D - 0x1F Reserved */ + kHIDUsage_Sim_FlightControlStick = 0x20, /* Application Collection */ + kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */ + kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */ + kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */ + kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */ + kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */ + /* 0x26 - 0xAF Reserved */ + kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */ + kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */ + kHIDUsage_Sim_AntiTorqueControl = 0xB2, /* Dynamic Value */ + kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */ + kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */ + kHIDUsage_Sim_CollectiveControl = 0xB5, /* Dynamic Value */ + kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */ + kHIDUsage_Sim_ElectronicCountermeasures = 0xB7, /* On/Off Control */ + kHIDUsage_Sim_Elevator = 0xB8, /* Dynamic Value */ + kHIDUsage_Sim_ElevatorTrim = 0xB9, /* Dynamic Value */ + kHIDUsage_Sim_Rudder = 0xBA, /* Dynamic Value */ + kHIDUsage_Sim_Throttle = 0xBB, /* Dynamic Value */ + kHIDUsage_Sim_FlightCommunications = 0xBC, /* On/Off Control */ + kHIDUsage_Sim_FlareRelease = 0xBD, /* One-Shot Control */ + kHIDUsage_Sim_LandingGear = 0xBE, /* On/Off Control */ + kHIDUsage_Sim_ToeBrake = 0xBF, /* Dynamic Value */ + kHIDUsage_Sim_Trigger = 0xC0, /* Momentary Control */ + kHIDUsage_Sim_WeaponsArm = 0xC1, /* On/Off Control */ + kHIDUsage_Sim_Weapons = 0xC2, /* Selector */ + kHIDUsage_Sim_WingFlaps = 0xC3, /* Dynamic Value */ + kHIDUsage_Sim_Accelerator = 0xC4, /* Dynamic Value */ + kHIDUsage_Sim_Brake = 0xC5, /* Dynamic Value */ + kHIDUsage_Sim_Clutch = 0xC6, /* Dynamic Value */ + kHIDUsage_Sim_Shifter = 0xC7, /* Dynamic Value */ + kHIDUsage_Sim_Steering = 0xC8, /* Dynamic Value */ + kHIDUsage_Sim_TurretDirection = 0xC9, /* Dynamic Value */ + kHIDUsage_Sim_BarrelElevation = 0xCA, /* Dynamic Value */ + kHIDUsage_Sim_DivePlane = 0xCB, /* Dynamic Value */ + kHIDUsage_Sim_Ballast = 0xCC, /* Dynamic Value */ + kHIDUsage_Sim_BicycleCrank = 0xCD, /* Dynamic Value */ + kHIDUsage_Sim_HandleBars = 0xCE, /* Dynamic Value */ + kHIDUsage_Sim_FrontBrake = 0xCF, /* Dynamic Value */ + kHIDUsage_Sim_RearBrake = 0xD0, /* Dynamic Value */ + /* 0xD1 - 0xFFFF Reserved */ + kHIDUsage_Sim_Reserved = 0xFFFF +}; + +/* VR Page (0x03) */ +/* Virtual Reality controls depend on designators to identify the individual controls. Most of the following are */ +/* usages are applied to the collections of entities that comprise the actual device. */ +enum +{ + kHIDUsage_VR_Belt = 0x01, /* Application Collection */ + kHIDUsage_VR_BodySuit = 0x02, /* Application Collection */ + kHIDUsage_VR_Flexor = 0x03, /* Physical Collection */ + kHIDUsage_VR_Glove = 0x04, /* Application Collection */ + kHIDUsage_VR_HeadTracker = 0x05, /* Physical Collection */ + kHIDUsage_VR_HeadMountedDisplay = 0x06, /* Application Collection */ + kHIDUsage_VR_HandTracker = 0x07, /* Application Collection */ + kHIDUsage_VR_Oculometer = 0x08, /* Application Collection */ + kHIDUsage_VR_Vest = 0x09, /* Application Collection */ + kHIDUsage_VR_AnimatronicDevice = 0x0A, /* Application Collection */ + /* 0x0B - 0x1F Reserved */ + kHIDUsage_VR_StereoEnable = 0x20, /* On/Off Control */ + kHIDUsage_VR_DisplayEnable = 0x21, /* On/Off Control */ + /* 0x22 - 0xFFFF Reserved */ + kHIDUsage_VR_Reserved = 0xFFFF +}; + +/* Sport Page (0x04) */ +enum +{ + kHIDUsage_Sprt_BaseballBat = 0x01, /* Application Collection */ + kHIDUsage_Sprt_GolfClub = 0x02, /* Application Collection */ + kHIDUsage_Sprt_RowingMachine = 0x03, /* Application Collection */ + kHIDUsage_Sprt_Treadmill = 0x04, /* Application Collection */ + /* 0x05 - 0x2F Reserved */ + kHIDUsage_Sprt_Oar = 0x30, /* Dynamic Value */ + kHIDUsage_Sprt_Slope = 0x31, /* Dynamic Value */ + kHIDUsage_Sprt_Rate = 0x32, /* Dynamic Value */ + kHIDUsage_Sprt_StickSpeed = 0x33, /* Dynamic Value */ + kHIDUsage_Sprt_StickFaceAngle = 0x34, /* Dynamic Value */ + kHIDUsage_Sprt_StickHeelOrToe = 0x35, /* Dynamic Value */ + kHIDUsage_Sprt_StickFollowThrough = 0x36, /* Dynamic Value */ + kHIDUsage_Sprt_StickTempo = 0x37, /* Dynamic Value */ + kHIDUsage_Sprt_StickType = 0x38, /* Named Array */ + kHIDUsage_Sprt_StickHeight = 0x39, /* Dynamic Value */ + /* 0x3A - 0x4F Reserved */ + kHIDUsage_Sprt_Putter = 0x50, /* Selector */ + kHIDUsage_Sprt_1Iron = 0x51, /* Selector */ + kHIDUsage_Sprt_2Iron = 0x52, /* Selector */ + kHIDUsage_Sprt_3Iron = 0x53, /* Selector */ + kHIDUsage_Sprt_4Iron = 0x54, /* Selector */ + kHIDUsage_Sprt_5Iron = 0x55, /* Selector */ + kHIDUsage_Sprt_6Iron = 0x56, /* Selector */ + kHIDUsage_Sprt_7Iron = 0x57, /* Selector */ + kHIDUsage_Sprt_8Iron = 0x58, /* Selector */ + kHIDUsage_Sprt_9Iron = 0x59, /* Selector */ + kHIDUsage_Sprt_10Iron = 0x5A, /* Selector */ + kHIDUsage_Sprt_11Iron = 0x5B, /* Selector */ + kHIDUsage_Sprt_SandWedge = 0x5C, /* Selector */ + kHIDUsage_Sprt_LoftWedge = 0x5D, /* Selector */ + kHIDUsage_Sprt_PowerWedge = 0x5E, /* Selector */ + kHIDUsage_Sprt_1Wood = 0x5F, /* Selector */ + kHIDUsage_Sprt_3Wood = 0x60, /* Selector */ + kHIDUsage_Sprt_5Wood = 0x61, /* Selector */ + kHIDUsage_Sprt_7Wood = 0x62, /* Selector */ + kHIDUsage_Sprt_9Wood = 0x63, /* Selector */ + /* 0x64 - 0xFFFF Reserved */ + kHIDUsage_Sprt_Reserved = 0xFFFF +}; + +/* Game Page (0x05) */ +enum +{ + kHIDUsage_Game_3DGameController = 0x01, /* Application Collection */ + kHIDUsage_Game_PinballDevice = 0x02, /* Application Collection */ + kHIDUsage_Game_GunDevice = 0x03, /* Application Collection */ + /* 0x04 - 0x1F Reserved */ + kHIDUsage_Game_PointofView = 0x20, /* Physical Collection */ + kHIDUsage_Game_TurnRightOrLeft = 0x21, /* Dynamic Value */ + kHIDUsage_Game_PitchUpOrDown = 0x22, /* Dynamic Value */ + kHIDUsage_Game_RollRightOrLeft = 0x23, /* Dynamic Value */ + kHIDUsage_Game_MoveRightOrLeft = 0x24, /* Dynamic Value */ + kHIDUsage_Game_MoveForwardOrBackward = 0x25, /* Dynamic Value */ + kHIDUsage_Game_MoveUpOrDown = 0x26, /* Dynamic Value */ + kHIDUsage_Game_LeanRightOrLeft = 0x27, /* Dynamic Value */ + kHIDUsage_Game_LeanForwardOrBackward = 0x28, /* Dynamic Value */ + kHIDUsage_Game_HeightOfPOV = 0x29, /* Dynamic Value */ + kHIDUsage_Game_Flipper = 0x2A, /* Momentary Control */ + kHIDUsage_Game_SecondaryFlipper = 0x2B, /* Momentary Control */ + kHIDUsage_Game_Bump = 0x2C, /* Momentary Control */ + kHIDUsage_Game_NewGame = 0x2D, /* One-Shot Control */ + kHIDUsage_Game_ShootBall = 0x2E, /* One-Shot Control */ + kHIDUsage_Game_Player = 0x2F, /* One-Shot Control */ + kHIDUsage_Game_GunBolt = 0x30, /* On/Off Control */ + kHIDUsage_Game_GunClip = 0x31, /* On/Off Control */ + kHIDUsage_Game_Gun = 0x32, /* Selector */ + kHIDUsage_Game_GunSingleShot = 0x33, /* Selector */ + kHIDUsage_Game_GunBurst = 0x34, /* Selector */ + kHIDUsage_Game_GunAutomatic = 0x35, /* Selector */ + kHIDUsage_Game_GunSafety = 0x36, /* On/Off Control */ + kHIDUsage_Game_GamepadFireOrJump = 0x37, /* Logical Collection */ + kHIDUsage_Game_GamepadTrigger = 0x39, /* Logical Collection */ + /* 0x3A - 0xFFFF Reserved */ + kHIDUsage_Game_Reserved = 0xFFFF +}; + +/* KeyboardOrKeypad Page (0x07) */ +/* This section is the Usage Page for key codes to be used in implementing a USB keyboard. A Boot Keyboard (84-, 101- or 104-key) should at a minimum support all associated usage codes as indicated in the Boot */ +/* column below. */ +/* The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control (0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV). */ +/* Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate otherlanguages. */ +enum +{ + kHIDUsage_KeyboardErrorRollOver = 0x01, /* ErrorRollOver */ + kHIDUsage_KeyboardPOSTFail = 0x02, /* POSTFail */ + kHIDUsage_KeyboardErrorUndefined = 0x03, /* ErrorUndefined */ + kHIDUsage_KeyboardA = 0x04, /* a or A */ + kHIDUsage_KeyboardB = 0x05, /* b or B */ + kHIDUsage_KeyboardC = 0x06, /* c or C */ + kHIDUsage_KeyboardD = 0x07, /* d or D */ + kHIDUsage_KeyboardE = 0x08, /* e or E */ + kHIDUsage_KeyboardF = 0x09, /* f or F */ + kHIDUsage_KeyboardG = 0x0A, /* g or G */ + kHIDUsage_KeyboardH = 0x0B, /* h or H */ + kHIDUsage_KeyboardI = 0x0C, /* i or I */ + kHIDUsage_KeyboardJ = 0x0D, /* j or J */ + kHIDUsage_KeyboardK = 0x0E, /* k or K */ + kHIDUsage_KeyboardL = 0x0F, /* l or L */ + kHIDUsage_KeyboardM = 0x10, /* m or M */ + kHIDUsage_KeyboardN = 0x11, /* n or N */ + kHIDUsage_KeyboardO = 0x12, /* o or O */ + kHIDUsage_KeyboardP = 0x13, /* p or P */ + kHIDUsage_KeyboardQ = 0x14, /* q or Q */ + kHIDUsage_KeyboardR = 0x15, /* r or R */ + kHIDUsage_KeyboardS = 0x16, /* s or S */ + kHIDUsage_KeyboardT = 0x17, /* t or T */ + kHIDUsage_KeyboardU = 0x18, /* u or U */ + kHIDUsage_KeyboardV = 0x19, /* v or V */ + kHIDUsage_KeyboardW = 0x1A, /* w or W */ + kHIDUsage_KeyboardX = 0x1B, /* x or X */ + kHIDUsage_KeyboardY = 0x1C, /* y or Y */ + kHIDUsage_KeyboardZ = 0x1D, /* z or Z */ + kHIDUsage_Keyboard1 = 0x1E, /* 1 or ! */ + kHIDUsage_Keyboard2 = 0x1F, /* 2 or @ */ + kHIDUsage_Keyboard3 = 0x20, /* 3 or # */ + kHIDUsage_Keyboard4 = 0x21, /* 4 or $ */ + kHIDUsage_Keyboard5 = 0x22, /* 5 or % */ + kHIDUsage_Keyboard6 = 0x23, /* 6 or ^ */ + kHIDUsage_Keyboard7 = 0x24, /* 7 or & */ + kHIDUsage_Keyboard8 = 0x25, /* 8 or * */ + kHIDUsage_Keyboard9 = 0x26, /* 9 or ( */ + kHIDUsage_Keyboard0 = 0x27, /* 0 or ) */ + kHIDUsage_KeyboardReturnOrEnter = 0x28, /* Return (Enter) */ + kHIDUsage_KeyboardEscape = 0x29, /* Escape */ + kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, /* Delete (Backspace) */ + kHIDUsage_KeyboardTab = 0x2B, /* Tab */ + kHIDUsage_KeyboardSpacebar = 0x2C, /* Spacebar */ + kHIDUsage_KeyboardHyphen = 0x2D, /* - or _ */ + kHIDUsage_KeyboardEqualSign = 0x2E, /* = or + */ + kHIDUsage_KeyboardOpenBracket = 0x2F, /* [ or { */ + kHIDUsage_KeyboardCloseBracket = 0x30, /* ] or } */ + kHIDUsage_KeyboardBackslash = 0x31, /* \ or | */ + kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ */ + kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : */ + kHIDUsage_KeyboardQuote = 0x34, /* ' or " */ + kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde */ + kHIDUsage_KeyboardComma = 0x36, /* , or < */ + kHIDUsage_KeyboardPeriod = 0x37, /* . or > */ + kHIDUsage_KeyboardSlash = 0x38, /* / or ? */ + kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock */ + kHIDUsage_KeyboardF1 = 0x3A, /* F1 */ + kHIDUsage_KeyboardF2 = 0x3B, /* F2 */ + kHIDUsage_KeyboardF3 = 0x3C, /* F3 */ + kHIDUsage_KeyboardF4 = 0x3D, /* F4 */ + kHIDUsage_KeyboardF5 = 0x3E, /* F5 */ + kHIDUsage_KeyboardF6 = 0x3F, /* F6 */ + kHIDUsage_KeyboardF7 = 0x40, /* F7 */ + kHIDUsage_KeyboardF8 = 0x41, /* F8 */ + kHIDUsage_KeyboardF9 = 0x42, /* F9 */ + kHIDUsage_KeyboardF10 = 0x43, /* F10 */ + kHIDUsage_KeyboardF11 = 0x44, /* F11 */ + kHIDUsage_KeyboardF12 = 0x45, /* F12 */ + kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen */ + kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock */ + kHIDUsage_KeyboardPause = 0x48, /* Pause */ + kHIDUsage_KeyboardInsert = 0x49, /* Insert */ + kHIDUsage_KeyboardHome = 0x4A, /* Home */ + kHIDUsage_KeyboardPageUp = 0x4B, /* Page Up */ + kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward */ + kHIDUsage_KeyboardEnd = 0x4D, /* End */ + kHIDUsage_KeyboardPageDown = 0x4E, /* Page Down */ + kHIDUsage_KeyboardRightArrow = 0x4F, /* Right Arrow */ + kHIDUsage_KeyboardLeftArrow = 0x50, /* Left Arrow */ + kHIDUsage_KeyboardDownArrow = 0x51, /* Down Arrow */ + kHIDUsage_KeyboardUpArrow = 0x52, /* Up Arrow */ + kHIDUsage_KeypadNumLock = 0x53, /* Keypad NumLock or Clear */ + kHIDUsage_KeypadSlash = 0x54, /* Keypad / */ + kHIDUsage_KeypadAsterisk = 0x55, /* Keypad * */ + kHIDUsage_KeypadHyphen = 0x56, /* Keypad - */ + kHIDUsage_KeypadPlus = 0x57, /* Keypad + */ + kHIDUsage_KeypadEnter = 0x58, /* Keypad Enter */ + kHIDUsage_Keypad1 = 0x59, /* Keypad 1 or End */ + kHIDUsage_Keypad2 = 0x5A, /* Keypad 2 or Down Arrow */ + kHIDUsage_Keypad3 = 0x5B, /* Keypad 3 or Page Down */ + kHIDUsage_Keypad4 = 0x5C, /* Keypad 4 or Left Arrow */ + kHIDUsage_Keypad5 = 0x5D, /* Keypad 5 */ + kHIDUsage_Keypad6 = 0x5E, /* Keypad 6 or Right Arrow */ + kHIDUsage_Keypad7 = 0x5F, /* Keypad 7 or Home */ + kHIDUsage_Keypad8 = 0x60, /* Keypad 8 or Up Arrow */ + kHIDUsage_Keypad9 = 0x61, /* Keypad 9 or Page Up */ + kHIDUsage_Keypad0 = 0x62, /* Keypad 0 or Insert */ + kHIDUsage_KeypadPeriod = 0x63, /* Keypad . or Delete */ + kHIDUsage_KeyboardNonUSBackslash = 0x64, /* Non-US \ or | */ + kHIDUsage_KeyboardApplication = 0x65, /* Application */ + kHIDUsage_KeyboardPower = 0x66, /* Power */ + kHIDUsage_KeypadEqualSign = 0x67, /* Keypad = */ + kHIDUsage_KeyboardF13 = 0x68, /* F13 */ + kHIDUsage_KeyboardF14 = 0x69, /* F14 */ + kHIDUsage_KeyboardF15 = 0x6A, /* F15 */ + kHIDUsage_KeyboardF16 = 0x6B, /* F16 */ + kHIDUsage_KeyboardF17 = 0x6C, /* F17 */ + kHIDUsage_KeyboardF18 = 0x6D, /* F18 */ + kHIDUsage_KeyboardF19 = 0x6E, /* F19 */ + kHIDUsage_KeyboardF20 = 0x6F, /* F20 */ + kHIDUsage_KeyboardF21 = 0x70, /* F21 */ + kHIDUsage_KeyboardF22 = 0x71, /* F22 */ + kHIDUsage_KeyboardF23 = 0x72, /* F23 */ + kHIDUsage_KeyboardF24 = 0x73, /* F24 */ + kHIDUsage_KeyboardExecute = 0x74, /* Execute */ + kHIDUsage_KeyboardHelp = 0x75, /* Help */ + kHIDUsage_KeyboardMenu = 0x76, /* Menu */ + kHIDUsage_KeyboardSelect = 0x77, /* Select */ + kHIDUsage_KeyboardStop = 0x78, /* Stop */ + kHIDUsage_KeyboardAgain = 0x79, /* Again */ + kHIDUsage_KeyboardUndo = 0x7A, /* Undo */ + kHIDUsage_KeyboardCut = 0x7B, /* Cut */ + kHIDUsage_KeyboardCopy = 0x7C, /* Copy */ + kHIDUsage_KeyboardPaste = 0x7D, /* Paste */ + kHIDUsage_KeyboardFind = 0x7E, /* Find */ + kHIDUsage_KeyboardMute = 0x7F, /* Mute */ + kHIDUsage_KeyboardVolumeUp = 0x80, /* Volume Up */ + kHIDUsage_KeyboardVolumeDown = 0x81, /* Volume Down */ + kHIDUsage_KeyboardLockingCapsLock = 0x82, /* Locking Caps Lock */ + kHIDUsage_KeyboardLockingNumLock = 0x83, /* Locking Num Lock */ + kHIDUsage_KeyboardLockingScrollLock = 0x84, /* Locking Scroll Lock */ + kHIDUsage_KeypadComma = 0x85, /* Keypad Comma */ + kHIDUsage_KeypadEqualSignAS400 = 0x86, /* Keypad Equal Sign for AS/400 */ + kHIDUsage_KeyboardInternational1 = 0x87, /* International1 */ + kHIDUsage_KeyboardInternational2 = 0x88, /* International2 */ + kHIDUsage_KeyboardInternational3 = 0x89, /* International3 */ + kHIDUsage_KeyboardInternational4 = 0x8A, /* International4 */ + kHIDUsage_KeyboardInternational5 = 0x8B, /* International5 */ + kHIDUsage_KeyboardInternational6 = 0x8C, /* International6 */ + kHIDUsage_KeyboardInternational7 = 0x8D, /* International7 */ + kHIDUsage_KeyboardInternational8 = 0x8E, /* International8 */ + kHIDUsage_KeyboardInternational9 = 0x8F, /* International9 */ + kHIDUsage_KeyboardLANG1 = 0x90, /* LANG1 */ + kHIDUsage_KeyboardLANG2 = 0x91, /* LANG2 */ + kHIDUsage_KeyboardLANG3 = 0x92, /* LANG3 */ + kHIDUsage_KeyboardLANG4 = 0x93, /* LANG4 */ + kHIDUsage_KeyboardLANG5 = 0x94, /* LANG5 */ + kHIDUsage_KeyboardLANG6 = 0x95, /* LANG6 */ + kHIDUsage_KeyboardLANG7 = 0x96, /* LANG7 */ + kHIDUsage_KeyboardLANG8 = 0x97, /* LANG8 */ + kHIDUsage_KeyboardLANG9 = 0x98, /* LANG9 */ + kHIDUsage_KeyboardAlternateErase = 0x99, /* AlternateErase */ + kHIDUsage_KeyboardSysReqOrAttention = 0x9A, /* SysReq/Attention */ + kHIDUsage_KeyboardCancel = 0x9B, /* Cancel */ + kHIDUsage_KeyboardClear = 0x9C, /* Clear */ + kHIDUsage_KeyboardPrior = 0x9D, /* Prior */ + kHIDUsage_KeyboardReturn = 0x9E, /* Return */ + kHIDUsage_KeyboardSeparator = 0x9F, /* Separator */ + kHIDUsage_KeyboardOut = 0xA0, /* Out */ + kHIDUsage_KeyboardOper = 0xA1, /* Oper */ + kHIDUsage_KeyboardClearOrAgain = 0xA2, /* Clear/Again */ + kHIDUsage_KeyboardCrSelOrProps = 0xA3, /* CrSel/Props */ + kHIDUsage_KeyboardExSel = 0xA4, /* ExSel */ + /* 0xA5-0xDF Reserved */ + kHIDUsage_KeyboardLeftControl = 0xE0, /* Left Control */ + kHIDUsage_KeyboardLeftShift = 0xE1, /* Left Shift */ + kHIDUsage_KeyboardLeftAlt = 0xE2, /* Left Alt */ + kHIDUsage_KeyboardLeftGUI = 0xE3, /* Left GUI */ + kHIDUsage_KeyboardRightControl = 0xE4, /* Right Control */ + kHIDUsage_KeyboardRightShift = 0xE5, /* Right Shift */ + kHIDUsage_KeyboardRightAlt = 0xE6, /* Right Alt */ + kHIDUsage_KeyboardRightGUI = 0xE7, /* Right GUI */ + /* 0xE8-0xFFFF Reserved */ + kHIDUsage_Keyboard_Reserved = 0xFFFF +}; + +/* LEDs Page (0x08) */ +/* An LED or indicator is implemented as an On/Off Control (OOF) using the Single button toggle mode, where a value of 1 will turn on the indicator, and a value of 0 will turn it off. The exceptions are described below. */ +enum +{ + kHIDUsage_LED_NumLock = 0x01, /* On/Off Control */ + kHIDUsage_LED_CapsLock = 0x02, /* On/Off Control */ + kHIDUsage_LED_ScrollLock = 0x03, /* On/Off Control */ + kHIDUsage_LED_Compose = 0x04, /* On/Off Control */ + kHIDUsage_LED_Kana = 0x05, /* On/Off Control */ + kHIDUsage_LED_Power = 0x06, /* On/Off Control */ + kHIDUsage_LED_Shift = 0x07, /* On/Off Control */ + kHIDUsage_LED_DoNotDisturb = 0x08, /* On/Off Control */ + kHIDUsage_LED_Mute = 0x09, /* On/Off Control */ + kHIDUsage_LED_ToneEnable = 0x0A, /* On/Off Control */ + kHIDUsage_LED_HighCutFilter = 0x0B, /* On/Off Control */ + kHIDUsage_LED_LowCutFilter = 0x0C, /* On/Off Control */ + kHIDUsage_LED_EqualizerEnable = 0x0D, /* On/Off Control */ + kHIDUsage_LED_SoundFieldOn = 0x0E, /* On/Off Control */ + kHIDUsage_LED_SurroundOn = 0x0F, /* On/Off Control */ + kHIDUsage_LED_Repeat = 0x10, /* On/Off Control */ + kHIDUsage_LED_Stereo = 0x11, /* On/Off Control */ + kHIDUsage_LED_SamplingRateDetect = 0x12, /* On/Off Control */ + kHIDUsage_LED_Spinning = 0x13, /* On/Off Control */ + kHIDUsage_LED_CAV = 0x14, /* On/Off Control */ + kHIDUsage_LED_CLV = 0x15, /* On/Off Control */ + kHIDUsage_LED_RecordingFormatDetect = 0x16, /* On/Off Control */ + kHIDUsage_LED_OffHook = 0x17, /* On/Off Control */ + kHIDUsage_LED_Ring = 0x18, /* On/Off Control */ + kHIDUsage_LED_MessageWaiting = 0x19, /* On/Off Control */ + kHIDUsage_LED_DataMode = 0x1A, /* On/Off Control */ + kHIDUsage_LED_BatteryOperation = 0x1B, /* On/Off Control */ + kHIDUsage_LED_BatteryOK = 0x1C, /* On/Off Control */ + kHIDUsage_LED_BatteryLow = 0x1D, /* On/Off Control */ + kHIDUsage_LED_Speaker = 0x1E, /* On/Off Control */ + kHIDUsage_LED_HeadSet = 0x1F, /* On/Off Control */ + kHIDUsage_LED_Hold = 0x20, /* On/Off Control */ + kHIDUsage_LED_Microphone = 0x21, /* On/Off Control */ + kHIDUsage_LED_Coverage = 0x22, /* On/Off Control */ + kHIDUsage_LED_NightMode = 0x23, /* On/Off Control */ + kHIDUsage_LED_SendCalls = 0x24, /* On/Off Control */ + kHIDUsage_LED_CallPickup = 0x25, /* On/Off Control */ + kHIDUsage_LED_Conference = 0x26, /* On/Off Control */ + kHIDUsage_LED_StandBy = 0x27, /* On/Off Control */ + kHIDUsage_LED_CameraOn = 0x28, /* On/Off Control */ + kHIDUsage_LED_CameraOff = 0x29, /* On/Off Control */ + kHIDUsage_LED_OnLine = 0x2A, /* On/Off Control */ + kHIDUsage_LED_OffLine = 0x2B, /* On/Off Control */ + kHIDUsage_LED_Busy = 0x2C, /* On/Off Control */ + kHIDUsage_LED_Ready = 0x2D, /* On/Off Control */ + kHIDUsage_LED_PaperOut = 0x2E, /* On/Off Control */ + kHIDUsage_LED_PaperJam = 0x2F, /* On/Off Control */ + kHIDUsage_LED_Remote = 0x30, /* On/Off Control */ + kHIDUsage_LED_Forward = 0x31, /* On/Off Control */ + kHIDUsage_LED_Reverse = 0x32, /* On/Off Control */ + kHIDUsage_LED_Stop = 0x33, /* On/Off Control */ + kHIDUsage_LED_Rewind = 0x34, /* On/Off Control */ + kHIDUsage_LED_FastForward = 0x35, /* On/Off Control */ + kHIDUsage_LED_Play = 0x36, /* On/Off Control */ + kHIDUsage_LED_Pause = 0x37, /* On/Off Control */ + kHIDUsage_LED_Record = 0x38, /* On/Off Control */ + kHIDUsage_LED_Error = 0x39, /* On/Off Control */ + kHIDUsage_LED_Usage = 0x3A, /* Selector */ + kHIDUsage_LED_UsageInUseIndicator = 0x3B, /* Usage Switch */ + kHIDUsage_LED_UsageMultiModeIndicator = 0x3C, /* Usage Modifier */ + kHIDUsage_LED_IndicatorOn = 0x3D, /* Selector */ + kHIDUsage_LED_IndicatorFlash = 0x3E, /* Selector */ + kHIDUsage_LED_IndicatorSlowBlink = 0x3F, /* Selector */ + kHIDUsage_LED_IndicatorFastBlink = 0x40, /* Selector */ + kHIDUsage_LED_IndicatorOff = 0x41, /* Selector */ + kHIDUsage_LED_FlashOnTime = 0x42, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOnTime = 0x43, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOffTime = 0x44, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOnTime = 0x45, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOffTime = 0x46, /* Dynamic Value */ + kHIDUsage_LED_UsageIndicatorColor = 0x47, /* Usage Modifier */ + kHIDUsage_LED_IndicatorRed = 0x48, /* Selector */ + kHIDUsage_LED_IndicatorGreen = 0x49, /* Selector */ + kHIDUsage_LED_IndicatorAmber = 0x4A, /* Selector */ + kHIDUsage_LED_GenericIndicator = 0x4B, /* On/Off Control */ + kHIDUsage_LED_SystemSuspend = 0x4C, /* On/Off Control */ + kHIDUsage_LED_ExternalPowerConnected = 0x4D, /* On/Off Control */ + /* 0x4E - 0xFFFF Reserved */ + kHIDUsage_LED_Reserved = 0xFFFF +}; + +/* Button Page (0x09) */ +/* The Button page is the first place an application should look for user selection controls. System graphical user interfaces typically employ a pointer and a set of hierarchical selectors to select, move and otherwise manipulate their environment. For these purposes the following assignment of significance can be applied to the Button usages: */ +/* Button 1, Primary Button. Used for object selecting, dragging, and double click activation. On MacOS, this is the only button. Microsoft operating systems call this a logical left button, because it */ +/* is not necessarily physically located on the left of the pointing device. */ +/* Button 2, Secondary Button. Used by newer graphical user interfaces to browse object properties. Exposed by systems to applications that typically assign application-specific functionality. */ +/* Button 3, Tertiary Button. Optional control. Exposed to applications, but seldom assigned functionality due to prevalence of two- and one-button devices. */ +/* Buttons 4 -55. As the button number increases, its significance as a selector decreases. */ +/* In many ways the assignment of button numbers is similar to the assignment of Effort in Physical descriptors. Button 1 would be used to define the button a finger rests on when the hand is in the at rest position, that is, virtually no effort is required by the user to activate the button. Button values increment as the finger has to stretch to reach a control. See Section 6.2.3, Physical Descriptors, in the HID Specification for methods of further qualifying buttons. */ +enum +{ + kHIDUsage_Button_1 = 0x01, /* (primary/trigger) */ + kHIDUsage_Button_2 = 0x02, /* (secondary) */ + kHIDUsage_Button_3 = 0x03, /* (tertiary) */ + kHIDUsage_Button_4 = 0x04, /* 4th button */ + /* ... */ + kHIDUsage_Button_65535 = 0xFFFF +}; + +/* Ordinal Page (0x0A) */ +/* The Ordinal page allows multiple instances of a control or sets of controls to be declared without requiring individual enumeration in the native usage page. For example, it is not necessary to declare usages of Pointer 1, Pointer 2, and so forth on the Generic Desktop page. When parsed, the ordinal instance number is, in essence, concatenated to the usages attached to the encompassing collection to create Pointer 1, Pointer 2, and so forth. */ +/* For an example, see Section A.5, Multiple Instances of a Control, in Appendix A, Usage Examples. By convention, an Ordinal collection is placed inside the collection for which it is declaring multiple instances. */ +/* Instances do not have to be identical. */ +enum +{ + /* 0x00 Reserved */ + kHIDUsage_Ord_Instance1 = 0x01, /* Usage Modifier */ + kHIDUsage_Ord_Instance2 = 0x02, /* Usage Modifier */ + kHIDUsage_Ord_Instance3 = 0x03, /* Usage Modifier */ + kHIDUsage_Ord_Instance4 = 0x04, /* Usage Modifier */ + kHIDUsage_Ord_Instance65535 = 0xFFFF /* Usage Modifier */ +}; + +/* Telephony Page (0x0B) */ +/* This usage page defines the keytop and control usages for telephony devices. */ +/* Indicators on a phone are handled by wrapping them in LED: Usage In Use Indicator and LED: Usage Selected Indicator usages. For example, a message-indicator LED would be identified by a Telephony: Message usage declared as a Feature or Output in a LED: Usage In Use Indicator collection. */ +/* See Section 14, Consumer Page (0x0C), for audio volume and tone controls. */ +enum +{ + kHIDUsage_Tfon_Phone = 0x01, /* Application Collection */ + kHIDUsage_Tfon_AnsweringMachine = 0x02, /* Application Collection */ + kHIDUsage_Tfon_MessageControls = 0x03, /* Logical Collection */ + kHIDUsage_Tfon_Handset = 0x04, /* Logical Collection */ + kHIDUsage_Tfon_Headset = 0x05, /* Logical Collection */ + kHIDUsage_Tfon_TelephonyKeyPad = 0x06, /* Named Array */ + kHIDUsage_Tfon_ProgrammableButton = 0x07, /* Named Array */ + /* 0x08 - 0x1F Reserved */ + kHIDUsage_Tfon_HookSwitch = 0x20, /* On/Off Control */ + kHIDUsage_Tfon_Flash = 0x21, /* Momentary Control */ + kHIDUsage_Tfon_Feature = 0x22, /* One-Shot Control */ + kHIDUsage_Tfon_Hold = 0x23, /* On/Off Control */ + kHIDUsage_Tfon_Redial = 0x24, /* One-Shot Control */ + kHIDUsage_Tfon_Transfer = 0x25, /* One-Shot Control */ + kHIDUsage_Tfon_Drop = 0x26, /* One-Shot Control */ + kHIDUsage_Tfon_Park = 0x27, /* On/Off Control */ + kHIDUsage_Tfon_ForwardCalls = 0x28, /* On/Off Control */ + kHIDUsage_Tfon_AlternateFunction = 0x29, /* Momentary Control */ + kHIDUsage_Tfon_Line = 0x2A, /* One-Shot Control */ + kHIDUsage_Tfon_SpeakerPhone = 0x2B, /* On/Off Control */ + kHIDUsage_Tfon_Conference = 0x2C, /* On/Off Control */ + kHIDUsage_Tfon_RingEnable = 0x2D, /* On/Off Control */ + kHIDUsage_Tfon_Ring = 0x2E, /* Selector */ + kHIDUsage_Tfon_PhoneMute = 0x2F, /* On/Off Control */ + kHIDUsage_Tfon_CallerID = 0x30, /* Momentary Control */ + /* 0x31 - 0x4F Reserved */ + kHIDUsage_Tfon_SpeedDial = 0x50, /* One-Shot Control */ + kHIDUsage_Tfon_StoreNumber = 0x51, /* One-Shot Control */ + kHIDUsage_Tfon_RecallNumber = 0x52, /* One-Shot Control */ + kHIDUsage_Tfon_PhoneDirectory = 0x53, /* On/Off Control */ + /* 0x54 - 0x6F Reserved */ + kHIDUsage_Tfon_VoiceMail = 0x70, /* On/Off Control */ + kHIDUsage_Tfon_ScreenCalls = 0x71, /* On/Off Control */ + kHIDUsage_Tfon_DoNotDisturb = 0x72, /* On/Off Control */ + kHIDUsage_Tfon_Message = 0x73, /* One-Shot Control */ + kHIDUsage_Tfon_AnswerOnOrOff = 0x74, /* On/Off Control */ + /* 0x75 - 0x8F Reserved */ + kHIDUsage_Tfon_InsideDialTone = 0x90, /* Momentary Control */ + kHIDUsage_Tfon_OutsideDialTone = 0x91, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingTone = 0x92, /* Momentary Control */ + kHIDUsage_Tfon_OutsideRingTone = 0x93, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingTone = 0x94, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingback = 0x95, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingback = 0x96, /* Momentary Control */ + kHIDUsage_Tfon_LineBusyTone = 0x97, /* Momentary Control */ + kHIDUsage_Tfon_ReorderTone = 0x98, /* Momentary Control */ + kHIDUsage_Tfon_CallWaitingTone = 0x99, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone1 = 0x9A, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone2 = 0x9B, /* Momentary Control */ + kHIDUsage_Tfon_TonesOff = 0x9C, /* On/Off Control */ + kHIDUsage_Tfon_OutsideRingback = 0x9D, /* Momentary Control */ + /* 0x9E - 0xAF Reserved */ + kHIDUsage_Tfon_PhoneKey0 = 0xB0, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey1 = 0xB1, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey2 = 0xB2, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey3 = 0xB3, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey4 = 0xB4, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey5 = 0xB5, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey6 = 0xB6, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey7 = 0xB7, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey8 = 0xB8, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey9 = 0xB9, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyStar = 0xBA, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyPound = 0xBB, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyA = 0xBC, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyB = 0xBD, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyC = 0xBE, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyD = 0xBF, /* Selector/One-Shot Control */ + /* 0xC0 - 0xFFFF Reserved */ + kHIDUsage_TFon_Reserved = 0xFFFF +}; + +/* Consumer Page (0x0C) */ +/* All controls on the Consumer page are application-specific. That is, they affect a specific device, not the system as a whole. */ +enum +{ + kHIDUsage_Csmr_ConsumerControl = 0x01, /* Application Collection */ + kHIDUsage_Csmr_NumericKeyPad = 0x02, /* Named Array */ + kHIDUsage_Csmr_ProgrammableButtons = 0x03, /* Named Array */ + /* 0x03 - 0x1F Reserved */ + kHIDUsage_Csmr_Plus10 = 0x20, /* One-Shot Control */ + kHIDUsage_Csmr_Plus100 = 0x21, /* One-Shot Control */ + kHIDUsage_Csmr_AMOrPM = 0x22, /* One-Shot Control */ + /* 0x23 - 0x3F Reserved */ + kHIDUsage_Csmr_Power = 0x30, /* On/Off Control */ + kHIDUsage_Csmr_Reset = 0x31, /* One-Shot Control */ + kHIDUsage_Csmr_Sleep = 0x32, /* One-Shot Control */ + kHIDUsage_Csmr_SleepAfter = 0x33, /* One-Shot Control */ + kHIDUsage_Csmr_SleepMode = 0x34, /* Re-Trigger Control */ + kHIDUsage_Csmr_Illumination = 0x35, /* On/Off Control */ + kHIDUsage_Csmr_FunctionButtons = 0x36, /* Named Array */ + /* 0x37 - 0x3F Reserved */ + kHIDUsage_Csmr_Menu = 0x40, /* On/Off Control */ + kHIDUsage_Csmr_MenuPick = 0x41, /* One-Shot Control */ + kHIDUsage_Csmr_MenuUp = 0x42, /* One-Shot Control */ + kHIDUsage_Csmr_MenuDown = 0x43, /* One-Shot Control */ + kHIDUsage_Csmr_MenuLeft = 0x44, /* One-Shot Control */ + kHIDUsage_Csmr_MenuRight = 0x45, /* One-Shot Control */ + kHIDUsage_Csmr_MenuEscape = 0x46, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueIncrease = 0x47, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueDecrease = 0x48, /* One-Shot Control */ + /* 0x49 - 0x5F Reserved */ + kHIDUsage_Csmr_DataOnScreen = 0x60, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaption = 0x61, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaptionSelect = 0x62, /* Selector */ + kHIDUsage_Csmr_VCROrTV = 0x63, /* On/Off Control */ + kHIDUsage_Csmr_BroadcastMode = 0x64, /* One-Shot Control */ + kHIDUsage_Csmr_Snapshot = 0x65, /* One-Shot Control */ + kHIDUsage_Csmr_Still = 0x66, /* One-Shot Control */ + /* 0x67 - 0x7F Reserved */ + kHIDUsage_Csmr_Selection = 0x80, /* Named Array */ + kHIDUsage_Csmr_Assign = 0x81, /* Selector */ + kHIDUsage_Csmr_ModeStep = 0x82, /* One-Shot Control */ + kHIDUsage_Csmr_RecallLast = 0x83, /* One-Shot Control */ + kHIDUsage_Csmr_EnterChannel = 0x84, /* One-Shot Control */ + kHIDUsage_Csmr_OrderMovie = 0x85, /* One-Shot Control */ + kHIDUsage_Csmr_Channel = 0x86, /* Linear Control */ + kHIDUsage_Csmr_MediaSelection = 0x87, /* Selector */ + kHIDUsage_Csmr_MediaSelectComputer = 0x88, /* Selector */ + kHIDUsage_Csmr_MediaSelectTV = 0x89, /* Selector */ + kHIDUsage_Csmr_MediaSelectWWW = 0x8A, /* Selector */ + kHIDUsage_Csmr_MediaSelectDVD = 0x8B, /* Selector */ + kHIDUsage_Csmr_MediaSelectTelephone = 0x8C, /* Selector */ + kHIDUsage_Csmr_MediaSelectProgramGuide = 0x8D, /* Selector */ + kHIDUsage_Csmr_MediaSelectVideoPhone = 0x8E, /* Selector */ + kHIDUsage_Csmr_MediaSelectGames = 0x8F, /* Selector */ + kHIDUsage_Csmr_MediaSelectMessages = 0x90, /* Selector */ + kHIDUsage_Csmr_MediaSelectCD = 0x91, /* Selector */ + kHIDUsage_Csmr_MediaSelectVCR = 0x92, /* Selector */ + kHIDUsage_Csmr_MediaSelectTuner = 0x93, /* Selector */ + kHIDUsage_Csmr_Quit = 0x94, /* One-Shot Control */ + kHIDUsage_Csmr_Help = 0x95, /* On/Off Control */ + kHIDUsage_Csmr_MediaSelectTape = 0x96, /* Selector */ + kHIDUsage_Csmr_MediaSelectCable = 0x97, /* Selector */ + kHIDUsage_Csmr_MediaSelectSatellite = 0x98, /* Selector */ + kHIDUsage_Csmr_MediaSelectSecurity = 0x99, /* Selector */ + kHIDUsage_Csmr_MediaSelectHome = 0x9A, /* Selector */ + kHIDUsage_Csmr_MediaSelectCall = 0x9B, /* Selector */ + kHIDUsage_Csmr_ChannelIncrement = 0x9C, /* One-Shot Control */ + kHIDUsage_Csmr_ChannelDecrement = 0x9D, /* One-Shot Control */ + kHIDUsage_Csmr_Media = 0x9E, /* Selector */ + /* 0x9F Reserved */ + kHIDUsage_Csmr_VCRPlus = 0xA0, /* One-Shot Control */ + kHIDUsage_Csmr_Once = 0xA1, /* One-Shot Control */ + kHIDUsage_Csmr_Daily = 0xA2, /* One-Shot Control */ + kHIDUsage_Csmr_Weekly = 0xA3, /* One-Shot Control */ + kHIDUsage_Csmr_Monthly = 0xA4, /* One-Shot Control */ + /* 0xA5 - 0xAF Reserved */ + kHIDUsage_Csmr_Play = 0xB0, /* On/Off Control */ + kHIDUsage_Csmr_Pause = 0xB1, /* On/Off Control */ + kHIDUsage_Csmr_Record = 0xB2, /* On/Off Control */ + kHIDUsage_Csmr_FastForward = 0xB3, /* On/Off Control */ + kHIDUsage_Csmr_Rewind = 0xB4, /* On/Off Control */ + kHIDUsage_Csmr_ScanNextTrack = 0xB5, /* One-Shot Control */ + kHIDUsage_Csmr_ScanPreviousTrack = 0xB6, /* One-Shot Control */ + kHIDUsage_Csmr_Stop = 0xB7, /* One-Shot Control */ + kHIDUsage_Csmr_Eject = 0xB8, /* One-Shot Control */ + kHIDUsage_Csmr_RandomPlay = 0xB9, /* On/Off Control */ + kHIDUsage_Csmr_SelectDisc = 0xBA, /* Named Array */ + kHIDUsage_Csmr_EnterDisc = 0xBB, /* Momentary Control */ + kHIDUsage_Csmr_Repeat = 0xBC, /* One-Shot Control */ + kHIDUsage_Csmr_Tracking = 0xBD, /* Linear Control */ + kHIDUsage_Csmr_TrackNormal = 0xBE, /* One-Shot Control */ + kHIDUsage_Csmr_SlowTracking = 0xBF, /* Linear Control */ + kHIDUsage_Csmr_FrameForward = 0xC0, /* Re-Trigger Control */ + kHIDUsage_Csmr_FrameBack = 0xC1, /* Re-Trigger Control */ + kHIDUsage_Csmr_Mark = 0xC2, /* One-Shot Control */ + kHIDUsage_Csmr_ClearMark = 0xC3, /* One-Shot Control */ + kHIDUsage_Csmr_RepeatFromMark = 0xC4, /* On/Off Control */ + kHIDUsage_Csmr_ReturnToMark = 0xC5, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkForward = 0xC6, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkBackwards = 0xC7, /* One-Shot Control */ + kHIDUsage_Csmr_CounterReset = 0xC8, /* One-Shot Control */ + kHIDUsage_Csmr_ShowCounter = 0xC9, /* One-Shot Control */ + kHIDUsage_Csmr_TrackingIncrement = 0xCA, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrackingDecrement = 0xCB, /* Re-Trigger Control */ + kHIDUsage_Csmr_StopOrEject = 0xCC, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrPause = 0xCD, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrSkip = 0xCE, /* One-Shot Control */ + /* 0xCF - 0xDF Reserved */ + kHIDUsage_Csmr_Volume = 0xE0, /* Linear Control */ + kHIDUsage_Csmr_Balance = 0xE1, /* Linear Control */ + kHIDUsage_Csmr_Mute = 0xE2, /* On/Off Control */ + kHIDUsage_Csmr_Bass = 0xE3, /* Linear Control */ + kHIDUsage_Csmr_Treble = 0xE4, /* Linear Control */ + kHIDUsage_Csmr_BassBoost = 0xE5, /* On/Off Control */ + kHIDUsage_Csmr_SurroundMode = 0xE6, /* One-Shot Control */ + kHIDUsage_Csmr_Loudness = 0xE7, /* On/Off Control */ + kHIDUsage_Csmr_MPX = 0xE8, /* On/Off Control */ + kHIDUsage_Csmr_VolumeIncrement = 0xE9, /* Re-Trigger Control */ + kHIDUsage_Csmr_VolumeDecrement = 0xEA, /* Re-Trigger Control */ + /* 0xEB - 0xEF Reserved */ + kHIDUsage_Csmr_Speed = 0xF0, /* Selector */ + kHIDUsage_Csmr_PlaybackSpeed = 0xF1, /* Named Array */ + kHIDUsage_Csmr_StandardPlay = 0xF2, /* Selector */ + kHIDUsage_Csmr_LongPlay = 0xF3, /* Selector */ + kHIDUsage_Csmr_ExtendedPlay = 0xF4, /* Selector */ + kHIDUsage_Csmr_Slow = 0xF5, /* One-Shot Control */ + /* 0xF6 - 0xFF Reserved */ + kHIDUsage_Csmr_FanEnable = 0x100, /* On/Off Control */ + kHIDUsage_Csmr_FanSpeed = 0x101, /* Linear Control */ + kHIDUsage_Csmr_LightEnable = 0x102, /* On/Off Control */ + kHIDUsage_Csmr_LightIlluminationLevel = 0x103, /* Linear Control */ + kHIDUsage_Csmr_ClimateControlEnable = 0x104, /* On/Off Control */ + kHIDUsage_Csmr_RoomTemperature = 0x105, /* Linear Control */ + kHIDUsage_Csmr_SecurityEnable = 0x106, /* On/Off Control */ + kHIDUsage_Csmr_FireAlarm = 0x107, /* One-Shot Control */ + kHIDUsage_Csmr_PoliceAlarm = 0x108, /* One-Shot Control */ + /* 0x109 - 0x14F Reserved */ + kHIDUsage_Csmr_BalanceRight = 0x150, /* Re-Trigger Control */ + kHIDUsage_Csmr_BalanceLeft = 0x151, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassIncrement = 0x152, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassDecrement = 0x153, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleIncrement = 0x154, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleDecrement = 0x155, /* Re-Trigger Control */ + /* 0x156 - 0x15F Reserved */ + kHIDUsage_Csmr_SpeakerSystem = 0x160, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLeft = 0x161, /* Logical Collection */ + kHIDUsage_Csmr_ChannelRight = 0x162, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenter = 0x163, /* Logical Collection */ + kHIDUsage_Csmr_ChannelFront = 0x164, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenterFront = 0x165, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSide = 0x166, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSurround = 0x167, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLowFrequencyEnhancement = 0x168, /* Logical Collection */ + kHIDUsage_Csmr_ChannelTop = 0x169, /* Logical Collection */ + kHIDUsage_Csmr_ChannelUnknown = 0x16A, /* Logical Collection */ + /* 0x16B - 0x16F Reserved */ + kHIDUsage_Csmr_SubChannel = 0x170, /* Linear Control */ + kHIDUsage_Csmr_SubChannelIncrement = 0x171, /* One-Shot Control */ + kHIDUsage_Csmr_SubChannelDecrement = 0x172, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioIncrement = 0x173, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioDecrement = 0x174, /* One-Shot Control */ + /* 0x175 - 0x17F Reserved */ + kHIDUsage_Csmr_ApplicationLaunchButtons = 0x180, /* Named Array */ + kHIDUsage_Csmr_ALLaunchButtonConfigurationTool = 0x181, /* Selector */ + kHIDUsage_Csmr_ALProgrammableButtonConfiguration = 0x182, /* Selector */ + kHIDUsage_Csmr_ALConsumerControlConfiguration = 0x183, /* Selector */ + kHIDUsage_Csmr_ALWordProcessor = 0x184, /* Selector */ + kHIDUsage_Csmr_ALTextEditor = 0x185, /* Selector */ + kHIDUsage_Csmr_ALSpreadsheet = 0x186, /* Selector */ + kHIDUsage_Csmr_ALGraphicsEditor = 0x187, /* Selector */ + kHIDUsage_Csmr_ALPresentationApp = 0x188, /* Selector */ + kHIDUsage_Csmr_ALDatabaseApp = 0x189, /* Selector */ + kHIDUsage_Csmr_ALEmailReader = 0x18A, /* Selector */ + kHIDUsage_Csmr_ALNewsreader = 0x18B, /* Selector */ + kHIDUsage_Csmr_ALVoicemail = 0x18C, /* Selector */ + kHIDUsage_Csmr_ALContactsOrAddressBook = 0x18D, /* Selector */ + kHIDUsage_Csmr_ALCalendarOrSchedule = 0x18E, /* Selector */ + kHIDUsage_Csmr_ALTaskOrProjectManager = 0x18F, /* Selector */ + kHIDUsage_Csmr_ALLogOrJournalOrTimecard = 0x190, /* Selector */ + kHIDUsage_Csmr_ALCheckbookOrFinance = 0x191, /* Selector */ + kHIDUsage_Csmr_ALCalculator = 0x192, /* Selector */ + kHIDUsage_Csmr_ALAOrVCaptureOrPlayback = 0x193, /* Selector */ + kHIDUsage_Csmr_ALLocalMachineBrowser = 0x194, /* Selector */ + kHIDUsage_Csmr_ALLANOrWANBrowser = 0x195, /* Selector */ + kHIDUsage_Csmr_ALInternetBrowser = 0x196, /* Selector */ + kHIDUsage_Csmr_ALRemoteNetworkingOrISPConnect = 0x197, /* Selector */ + kHIDUsage_Csmr_ALNetworkConference = 0x198, /* Selector */ + kHIDUsage_Csmr_ALNetworkChat = 0x199, /* Selector */ + kHIDUsage_Csmr_ALTelephonyOrDialer = 0x19A, /* Selector */ + kHIDUsage_Csmr_ALLogon = 0x19B, /* Selector */ + kHIDUsage_Csmr_ALLogoff = 0x19C, /* Selector */ + kHIDUsage_Csmr_ALLogonOrLogoff = 0x19D, /* Selector */ + kHIDUsage_Csmr_ALTerminalLockOrScreensaver = 0x19E, /* Selector */ + kHIDUsage_Csmr_ALControlPanel = 0x19F, /* Selector */ + kHIDUsage_Csmr_ALCommandLineProcessorOrRun = 0x1A0, /* Selector */ + kHIDUsage_Csmr_ALProcessOrTaskManager = 0x1A1, /* Selector */ + kHIDUsage_Csmr_AL = 0x1A2, /* Selector */ + kHIDUsage_Csmr_ALNextTaskOrApplication = 0x1A3, /* Selector */ + kHIDUsage_Csmr_ALPreviousTaskOrApplication = 0x1A4, /* Selector */ + kHIDUsage_Csmr_ALPreemptiveHaltTaskOrApplication = 0x1A5, /* Selector */ + kHIDUsage_Csmr_ALIntegratedHelpCenter = 0x1A6, /* Selector */ + kHIDUsage_Csmr_ALDocuments = 0x1A7, /* Selector */ + kHIDUsage_Csmr_ALThesaurus = 0x1A8, /* Selector */ + kHIDUsage_Csmr_ALDictionary = 0x1A9, /* Selector */ + kHIDUsage_Csmr_ALDesktop = 0x1AA, /* Selector */ + kHIDUsage_Csmr_ALSpellCheck = 0x1AB, /* Selector */ + kHIDUsage_Csmr_ALGrammerCheck = 0x1AC, /* Selector */ + kHIDUsage_Csmr_ALWirelessStatus = 0x1AD, /* Selector */ + kHIDUsage_Csmr_ALKeyboardLayout = 0x1AE, /* Selector */ + kHIDUsage_Csmr_ALVirusProtection = 0x1AF, /* Selector */ + kHIDUsage_Csmr_ALEncryption = 0x1B0, /* Selector */ + kHIDUsage_Csmr_ALScreenSaver = 0x1B1, /* Selector */ + kHIDUsage_Csmr_ALAlarms = 0x1B2, /* Selector */ + kHIDUsage_Csmr_ALClock = 0x1B3, /* Selector */ + kHIDUsage_Csmr_ALFileBrowser = 0x1B4, /* Selector */ + kHIDUsage_Csmr_ALPowerStatus = 0x1B5, /* Selector */ + /* 0x1A6 - 0x1FF Reserved */ + kHIDUsage_Csmr_GenericGUIApplicationControls = 0x200, /* Named Array */ + kHIDUsage_Csmr_ACNew = 0x201, /* Selector */ + kHIDUsage_Csmr_ACOpen = 0x202, /* Selector */ + kHIDUsage_Csmr_ACClose = 0x203, /* Selector */ + kHIDUsage_Csmr_ACExit = 0x204, /* Selector */ + kHIDUsage_Csmr_ACMaximize = 0x205, /* Selector */ + kHIDUsage_Csmr_ACMinimize = 0x206, /* Selector */ + kHIDUsage_Csmr_ACSave = 0x207, /* Selector */ + kHIDUsage_Csmr_ACPrint = 0x208, /* Selector */ + kHIDUsage_Csmr_ACProperties = 0x209, /* Selector */ + kHIDUsage_Csmr_ACUndo = 0x21A, /* Selector */ + kHIDUsage_Csmr_ACCopy = 0x21B, /* Selector */ + kHIDUsage_Csmr_ACCut = 0x21C, /* Selector */ + kHIDUsage_Csmr_ACPaste = 0x21D, /* Selector */ + kHIDUsage_Csmr_AC = 0x21E, /* Selector */ + kHIDUsage_Csmr_ACFind = 0x21F, /* Selector */ + kHIDUsage_Csmr_ACFindandReplace = 0x220, /* Selector */ + kHIDUsage_Csmr_ACSearch = 0x221, /* Selector */ + kHIDUsage_Csmr_ACGoTo = 0x222, /* Selector */ + kHIDUsage_Csmr_ACHome = 0x223, /* Selector */ + kHIDUsage_Csmr_ACBack = 0x224, /* Selector */ + kHIDUsage_Csmr_ACForward = 0x225, /* Selector */ + kHIDUsage_Csmr_ACStop = 0x226, /* Selector */ + kHIDUsage_Csmr_ACRefresh = 0x227, /* Selector */ + kHIDUsage_Csmr_ACPreviousLink = 0x228, /* Selector */ + kHIDUsage_Csmr_ACNextLink = 0x229, /* Selector */ + kHIDUsage_Csmr_ACBookmarks = 0x22A, /* Selector */ + kHIDUsage_Csmr_ACHistory = 0x22B, /* Selector */ + kHIDUsage_Csmr_ACSubscriptions = 0x22C, /* Selector */ + kHIDUsage_Csmr_ACZoomIn = 0x22D, /* Selector */ + kHIDUsage_Csmr_ACZoomOut = 0x22E, /* Selector */ + kHIDUsage_Csmr_ACZoom = 0x22F, /* Selector */ + kHIDUsage_Csmr_ACFullScreenView = 0x230, /* Selector */ + kHIDUsage_Csmr_ACNormalView = 0x231, /* Selector */ + kHIDUsage_Csmr_ACViewToggle = 0x232, /* Selector */ + kHIDUsage_Csmr_ACScrollUp = 0x233, /* Selector */ + kHIDUsage_Csmr_ACScrollDown = 0x234, /* Selector */ + kHIDUsage_Csmr_ACScroll = 0x235, /* Selector */ + kHIDUsage_Csmr_ACPanLeft = 0x236, /* Selector */ + kHIDUsage_Csmr_ACPanRight = 0x237, /* Selector */ + kHIDUsage_Csmr_ACPan = 0x238, /* Selector */ + kHIDUsage_Csmr_ACNewWindow = 0x239, /* Selector */ + kHIDUsage_Csmr_ACTileHorizontally = 0x23A, /* Selector */ + kHIDUsage_Csmr_ACTileVertically = 0x23B, /* Selector */ + kHIDUsage_Csmr_ACFormat = 0x23C, /* Selector */ + /* 0x23D - 0xFFFF Reserved */ + kHIDUsage_Csmr_Reserved = 0xFFFF +}; + +/* Physical Interface Device Page (0x0F) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_PID_PhysicalInterfaceDevice = 0x01, /* CA - A collection of PID usages */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_PID_Normal = 0x20, /* DV - A force applied perpendicular to the surface of an object */ + kHIDUsage_PID_SetEffectReport = 0x21, /* XXX */ + kHIDUsage_PID_EffectBlockIndex = 0x22, /* XXX */ + kHIDUsage_PID_ParamBlockOffset = 0x23, /* XXX */ + kHIDUsage_PID_ROM_Flag = 0x24, /* XXX */ + kHIDUsage_PID_EffectType = 0x25, /* XXX */ + kHIDUsage_PID_ET_ConstantForce = 0x26, /* XXX */ + kHIDUsage_PID_ET_Ramp = 0x27, /* XXX */ + kHIDUsage_PID_ET_CustomForceData = 0x28, /* XXX */ + /* 0x29 - 0x2F Reserved */ + kHIDUsage_PID_ET_Square = 0x30, /* XXX */ + kHIDUsage_PID_ET_Sine = 0x31, /* XXX */ + kHIDUsage_PID_ET_Triangle = 0x32, /* XXX */ + kHIDUsage_PID_ET_SawtoothUp = 0x33, /* XXX */ + kHIDUsage_PID_ET_SawtoothDown = 0x34, /* XXX */ + /* 0x35 - 0x3F Reserved */ + kHIDUsage_PID_ET_Spring = 0x40, /* XXX */ + kHIDUsage_PID_ET_Damper = 0x41, /* XXX */ + kHIDUsage_PID_ET_Inertia = 0x42, /* XXX */ + kHIDUsage_PID_ET_Friction = 0x43, /* XXX */ + /* 0x44 - 0x4F Reserved */ + kHIDUsage_PID_Duration = 0x50, /* XXX */ + kHIDUsage_PID_SamplePeriod = 0x51, /* XXX */ + kHIDUsage_PID_Gain = 0x52, /* XXX */ + kHIDUsage_PID_TriggerButton = 0x53, /* XXX */ + kHIDUsage_PID_TriggerRepeatInterval = 0x54, /* XXX */ + kHIDUsage_PID_AxesEnable = 0x55, /* XXX */ + kHIDUsage_PID_DirectionEnable = 0x56, /* XXX */ + kHIDUsage_PID_Direction = 0x57, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockOffset = 0x58, /* XXX */ + kHIDUsage_PID_BlockType = 0x59, /* XXX */ + kHIDUsage_PID_SetEnvelopeReport = 0x5A, /* XXX */ + kHIDUsage_PID_AttackLevel = 0x5B, /* XXX */ + kHIDUsage_PID_AttackTime = 0x5C, /* XXX */ + kHIDUsage_PID_FadeLevel = 0x5D, /* XXX */ + kHIDUsage_PID_FadeTime = 0x5E, /* XXX */ + kHIDUsage_PID_SetConditionReport = 0x5F, /* XXX */ + + kHIDUsage_PID_CP_Offset = 0x60, /* XXX */ + kHIDUsage_PID_PositiveCoefficient = 0x61, /* XXX */ + kHIDUsage_PID_NegativeCoefficient = 0x62, /* XXX */ + kHIDUsage_PID_PositiveSaturation = 0x63, /* XXX */ + kHIDUsage_PID_NegativeSaturation = 0x64, /* XXX */ + kHIDUsage_PID_DeadBand = 0x65, /* XXX */ + kHIDUsage_PID_DownloadForceSample = 0x66, /* XXX */ + kHIDUsage_PID_IsochCustomForceEnable = 0x67, /* XXX */ + kHIDUsage_PID_CustomForceDataReport = 0x68, /* XXX */ + kHIDUsage_PID_CustomForceData = 0x69, /* XXX */ + kHIDUsage_PID_CustomForceVendorDefinedData = 0x6A, /* XXX */ + kHIDUsage_PID_SetCustomForceReport = 0x6B, /* XXX */ + kHIDUsage_PID_CustomForceDataOffset = 0x6C, /* XXX */ + kHIDUsage_PID_SampleCount = 0x6D, /* XXX */ + kHIDUsage_PID_SetPeriodicReport = 0x6E, /* XXX */ + kHIDUsage_PID_Offset = 0x6F, /* XXX */ + + kHIDUsage_PID_Magnitude = 0x70, /* XXX */ + kHIDUsage_PID_Phase = 0x71, /* XXX */ + kHIDUsage_PID_Period = 0x72, /* XXX */ + kHIDUsage_PID_SetConstantForceReport = 0x73, /* XXX */ + kHIDUsage_PID_SetRampForceReport = 0x74, /* XXX */ + kHIDUsage_PID_RampStart = 0x75, /* XXX */ + kHIDUsage_PID_RampEnd = 0x76, /* XXX */ + kHIDUsage_PID_EffectOperationReport = 0x77, /* XXX */ + kHIDUsage_PID_EffectOperation = 0x78, /* XXX */ + kHIDUsage_PID_OpEffectStart = 0x79, /* XXX */ + kHIDUsage_PID_OpEffectStartSolo = 0x7A, /* XXX */ + kHIDUsage_PID_OpEffectStop = 0x7B, /* XXX */ + kHIDUsage_PID_LoopCount = 0x7C, /* XXX */ + kHIDUsage_PID_DeviceGainReport = 0x7D, /* XXX */ + kHIDUsage_PID_DeviceGain = 0x7E, /* XXX */ + kHIDUsage_PID_PoolReport = 0x7F, /* XXX */ + + kHIDUsage_PID_RAM_PoolSize = 0x80, /* XXX */ + kHIDUsage_PID_ROM_PoolSize = 0x81, /* XXX */ + kHIDUsage_PID_ROM_EffectBlockCount = 0x82, /* XXX */ + kHIDUsage_PID_SimultaneousEffectsMax = 0x83, /* XXX */ + kHIDUsage_PID_PoolAlignment = 0x84, /* XXX */ + kHIDUsage_PID_PoolMoveReport = 0x85, /* XXX */ + kHIDUsage_PID_MoveSource = 0x86, /* XXX */ + kHIDUsage_PID_MoveDestination = 0x87, /* XXX */ + kHIDUsage_PID_MoveLength = 0x88, /* XXX */ + kHIDUsage_PID_BlockLoadReport = 0x89, /* XXX */ + /* 0x8A Reserved */ + kHIDUsage_PID_BlockLoadStatus = 0x8B, /* XXX */ + kHIDUsage_PID_BlockLoadSuccess = 0x8C, /* XXX */ + kHIDUsage_PID_BlockLoadFull = 0x8D, /* XXX */ + kHIDUsage_PID_BlockLoadError = 0x8E, /* XXX */ + kHIDUsage_PID_BlockHandle = 0x8F, /* XXX */ + + kHIDUsage_PID_BlockFreeReport = 0x90, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockHandle = 0x91, /* XXX */ + kHIDUsage_PID_StateReport = 0x92, /* XXX */ + /* 0x93 Reserved */ + kHIDUsage_PID_EffectPlaying = 0x94, /* XXX */ + kHIDUsage_PID_DeviceControlReport = 0x95, /* XXX */ + kHIDUsage_PID_DeviceControl = 0x96, /* XXX */ + kHIDUsage_PID_DC_EnableActuators = 0x97, /* XXX */ + kHIDUsage_PID_DC_DisableActuators = 0x98, /* XXX */ + kHIDUsage_PID_DC_StopAllEffects = 0x99, /* XXX */ + kHIDUsage_PID_DC_DeviceReset = 0x9A, /* XXX */ + kHIDUsage_PID_DC_DevicePause = 0x9B, /* XXX */ + kHIDUsage_PID_DC_DeviceContinue = 0x9C, /* XXX */ + /* 0x9d - 0x9E Reserved */ + kHIDUsage_PID_DevicePaused = 0x9F, /* XXX */ + + kHIDUsage_PID_ActuatorsEnabled = 0xA0, /* XXX */ + /* 0xA1 - 0xA3 Reserved */ + kHIDUsage_PID_SafetySwitch = 0xA4, /* XXX */ + kHIDUsage_PID_ActuatorOverrideSwitch = 0xA5, /* XXX */ + kHIDUsage_PID_ActuatorPower = 0xA6, /* XXX */ + kHIDUsage_PID_StartDelay = 0xA7, /* XXX */ + kHIDUsage_PID_ParameterBlockSize = 0xA8, /* XXX */ + kHIDUsage_PID_DeviceManagedPool = 0xA9, /* XXX */ + kHIDUsage_PID_SharedParameterBlocks = 0xAA, /* XXX */ + kHIDUsage_PID_CreateNewEffectReport = 0xAB, /* XXX */ + kHIDUsage_PID_RAM_PoolAvailable = 0xAC, /* XXX */ + /* 0xAD - 0xFFFF Reserved */ + kHIDUsage_PID_Reserved = 0xFFFF +}; + +/* Digitizer Page (0x0D) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_Dig_Digitizer = 0x01, /* Application Collection */ + kHIDUsage_Dig_Pen = 0x02, /* Application Collection */ + kHIDUsage_Dig_LightPen = 0x03, /* Application Collection */ + kHIDUsage_Dig_TouchScreen = 0x04, /* Application Collection */ + kHIDUsage_Dig_TouchPad = 0x05, /* Application Collection */ + kHIDUsage_Dig_WhiteBoard = 0x06, /* Application Collection */ + kHIDUsage_Dig_CoordinateMeasuringMachine = 0x07, /* Application Collection */ + kHIDUsage_Dig_3DDigitizer = 0x08, /* Application Collection */ + kHIDUsage_Dig_StereoPlotter = 0x09, /* Application Collection */ + kHIDUsage_Dig_ArticulatedArm = 0x0A, /* Application Collection */ + kHIDUsage_Dig_Armature = 0x0B, /* Application Collection */ + kHIDUsage_Dig_MultiplePointDigitizer = 0x0C, /* Application Collection */ + kHIDUsage_Dig_FreeSpaceWand = 0x0D, /* Application Collection */ + /* 0x0E - 0x1F Reserved */ + kHIDUsage_Dig_Stylus = 0x20, /* Logical Collection */ + kHIDUsage_Dig_Puck = 0x21, /* Logical Collection */ + kHIDUsage_Dig_Finger = 0x22, /* Logical Collection */ + /* 0x23 - 0x2F Reserved */ + kHIDUsage_Dig_TipPressure = 0x30, /* Dynamic Value */ + kHIDUsage_Dig_BarrelPressure = 0x31, /* Dynamic Value */ + kHIDUsage_Dig_InRange = 0x32, /* Momentary Control */ + kHIDUsage_Dig_Touch = 0x33, /* Momentary Control */ + kHIDUsage_Dig_Untouch = 0x34, /* One-Shot Control */ + kHIDUsage_Dig_Tap = 0x35, /* One-Shot Control */ + kHIDUsage_Dig_Quality = 0x36, /* Dynamic Value */ + kHIDUsage_Dig_DataValid = 0x37, /* Momentary Control */ + kHIDUsage_Dig_TransducerIndex = 0x38, /* Dynamic Value */ + kHIDUsage_Dig_TabletFunctionKeys = 0x39, /* Logical Collection */ + kHIDUsage_Dig_ProgramChangeKeys = 0x3A, /* Logical Collection */ + kHIDUsage_Dig_BatteryStrength = 0x3B, /* Dynamic Value */ + kHIDUsage_Dig_Invert = 0x3C, /* Momentary Control */ + kHIDUsage_Dig_XTilt = 0x3D, /* Dynamic Value */ + kHIDUsage_Dig_YTilt = 0x3E, /* Dynamic Value */ + kHIDUsage_Dig_Azimuth = 0x3F, /* Dynamic Value */ + kHIDUsage_Dig_Altitude = 0x40, /* Dynamic Value */ + kHIDUsage_Dig_Twist = 0x41, /* Dynamic Value */ + kHIDUsage_Dig_TipSwitch = 0x42, /* Momentary Control */ + kHIDUsage_Dig_SecondaryTipSwitch = 0x43, /* Momentary Control */ + kHIDUsage_Dig_BarrelSwitch = 0x44, /* Momentary Control */ + kHIDUsage_Dig_Eraser = 0x45, /* Momentary Control */ + kHIDUsage_Dig_TabletPick = 0x46, /* Momentary Control */ + /* 0x47 - 0xFFFF Reserved */ + kHIDUsage_Dig_Reserved = 0xFFFF +}; + +/* AlphanumericDisplay Page (0x14) */ +/* The Alphanumeric Display page is intended for use by simple alphanumeric displays that are used on consumer devices. */ +enum +{ + kHIDUsage_AD_AlphanumericDisplay = 0x01, /* Application Collection */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_AD_DisplayAttributesReport = 0x20, /* Logical Collection */ + kHIDUsage_AD_ASCIICharacterSet = 0x21, /* Static Flag */ + kHIDUsage_AD_DataReadBack = 0x22, /* Static Flag */ + kHIDUsage_AD_FontReadBack = 0x23, /* Static Flag */ + kHIDUsage_AD_DisplayControlReport = 0x24, /* Logical Collection */ + kHIDUsage_AD_ClearDisplay = 0x25, /* Dynamic Flag */ + kHIDUsage_AD_DisplayEnable = 0x26, /* Dynamic Flag */ + kHIDUsage_AD_ScreenSaverDelay = 0x27, /* Static Value */ + kHIDUsage_AD_ScreenSaverEnable = 0x28, /* Dynamic Flag */ + kHIDUsage_AD_VerticalScroll = 0x29, /* Static Flag */ + kHIDUsage_AD_HorizontalScroll = 0x2A, /* Static Flag */ + kHIDUsage_AD_CharacterReport = 0x2B, /* Logical Collection */ + kHIDUsage_AD_DisplayData = 0x2C, /* Dynamic Value */ + kHIDUsage_AD_DisplayStatus = 0x2D, /* Logical Collection */ + kHIDUsage_AD_StatNotReady = 0x2E, /* Selector */ + kHIDUsage_AD_StatReady = 0x2F, /* Selector */ + kHIDUsage_AD_ErrNotaloadablecharacter = 0x30, /* Selector */ + kHIDUsage_AD_ErrFontdatacannotberead = 0x31, /* Selector */ + kHIDUsage_AD_CursorPositionReport = 0x32, /* Logical Collection */ + kHIDUsage_AD_Row = 0x33, /* Dynamic Value */ + kHIDUsage_AD_Column = 0x34, /* Dynamic Value */ + kHIDUsage_AD_Rows = 0x35, /* Static Value */ + kHIDUsage_AD_Columns = 0x36, /* Static Value */ + kHIDUsage_AD_CursorPixelPositioning = 0x37, /* Static Flag */ + kHIDUsage_AD_CursorMode = 0x38, /* Dynamic Flag */ + kHIDUsage_AD_CursorEnable = 0x39, /* Dynamic Flag */ + kHIDUsage_AD_CursorBlink = 0x3A, /* Dynamic Flag */ + kHIDUsage_AD_FontReport = 0x3B, /* Logical Collection */ + kHIDUsage_AD_FontData = 0x3C, /* Buffered Byte */ + kHIDUsage_AD_CharacterWidth = 0x3D, /* Static Value */ + kHIDUsage_AD_CharacterHeight = 0x3E, /* Static Value */ + kHIDUsage_AD_CharacterSpacingHorizontal = 0x3F, /* Static Value */ + kHIDUsage_AD_CharacterSpacingVertical = 0x40, /* Static Value */ + kHIDUsage_AD_UnicodeCharacterSet = 0x41, /* Static Flag */ + /* 0x42 - 0xFFFF Reserved */ + kHIDUsage_AD_Reserved = 0xFFFF +}; + +/* Power Device Page (0x84) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + + kHIDUsage_PD_Undefined = 0x00, /* Power Device Undefined Usage */ + kHIDUsage_PD_iName = 0x01, /* CL- Power Device Name Index */ + kHIDUsage_PD_PresentStatus = 0x02, /* CL- Power Device Present Status */ + kHIDUsage_PD_ChangedStatus = 0x03, /* CA- Power Device Changed Status */ + kHIDUsage_PD_UPS = 0x04, /* CA- Uninterruptible Power Supply */ + kHIDUsage_PD_PowerSupply = 0x05, /* CA- Power Supply */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_PD_BatterySystem = 0x10, /* CP- Battery System power module */ + kHIDUsage_PD_BatterySystemID = 0x11, /* SV IF- Battery System ID */ + kHIDUsage_PD_Battery = 0x12, /* CP- Battery */ + kHIDUsage_PD_BatteryID = 0x13, /* SV IF- Battery ID */ + kHIDUsage_PD_Charger = 0x14, /* CP- Charger */ + kHIDUsage_PD_ChargerID = 0x15, /* SV IF- Charger ID */ + kHIDUsage_PD_PowerConverter = 0x16, /* CP- Power Converter power module */ + kHIDUsage_PD_PowerConverterID = 0x17, /* SV IF- Power Converter ID */ + kHIDUsage_PD_OutletSystem = 0x18, /* CP- Outlet System power module */ + kHIDUsage_PD_OutletSystemID = 0x19, /* SV IF-Outlet System ID */ + kHIDUsage_PD_Input = 0x1A, /* CP- Power Device Input */ + kHIDUsage_PD_InputID = 0x1B, /* SV IF- Power Device Input ID */ + kHIDUsage_PD_Output = 0x1C, /* CP- Power Device Output */ + kHIDUsage_PD_OutputID = 0x1D, /* SV IF- Power Device Output ID */ + kHIDUsage_PD_Flow = 0x1E, /* CP- Power Device Flow */ + kHIDUsage_PD_FlowID = 0x1F, /* Item IF- Power Device Flow ID */ + kHIDUsage_PD_Outlet = 0x20, /* CP- Power Device Outlet */ + kHIDUsage_PD_OutletID = 0x21, /* SV IF- Power Device Outlet ID */ + kHIDUsage_PD_Gang = 0x22, /* CL/CP- Power Device Gang */ + kHIDUsage_PD_GangID = 0x23, /* SV IF- Power Device Gang ID */ + kHIDUsage_PD_PowerSummary = 0x24, /* CL/CP- Power Device Power Summary */ + kHIDUsage_PD_PowerSummaryID = 0x25, /* SV IF- Power Device Power Summary ID */ + /* Reserved 0x26 - 0x2F */ + kHIDUsage_PD_Voltage = 0x30, /* DV IF- Power Device Voltage */ + kHIDUsage_PD_Current = 0x31, /* DV IF- Power Device Current */ + kHIDUsage_PD_Frequency = 0x32, /* DV IF- Power Device Frequency */ + kHIDUsage_PD_ApparentPower = 0x33, /* DV IF- Power Device Apparent Power */ + kHIDUsage_PD_ActivePower = 0x34, /* DV IF- Power Device RMS Power */ + kHIDUsage_PD_PercentLoad = 0x35, /* DV IF- Power Device Percent Load */ + kHIDUsage_PD_Temperature = 0x36, /* DV IF- Power Device Temperature */ + kHIDUsage_PD_Humidity = 0x37, /* DV IF- Power Device Humidity */ + kHIDUsage_PD_BadCount = 0x38, /* DV IF- Power Device Bad Condition Count */ + /* Reserved 0x39 - 0x3F */ + kHIDUsage_PD_ConfigVoltage = 0x40, /* SV/DV F- Power Device Nominal Voltage */ + kHIDUsage_PD_ConfigCurrent = 0x41, /* SV/DV F- Power Device Nominal Current */ + kHIDUsage_PD_ConfigFrequency = 0x42, /* SV/DV F- Power Device Nominal Frequency */ + kHIDUsage_PD_ConfigApparentPower = 0x43, /* SV/DV F- Power Device Nominal Apparent Power */ + kHIDUsage_PD_ConfigActivePower = 0x44, /* SV/DV F- Power Device Nominal RMS Power */ + kHIDUsage_PD_ConfigPercentLoad = 0x45, /* SV/DV F- Power Device Nominal Percent Load */ + kHIDUsage_PD_ConfigTemperature = 0x46, /* SV/DV F- Power Device Nominal Temperature */ + kHIDUsage_PD_ConfigHumidity = 0x47, /* SV/DV F- Power Device Nominal Humidity */ + /* Reserved 0x48 - 0x4F */ + kHIDUsage_PD_SwitchOnControl = 0x50, /* DV F- Power Device Switch On Control */ + kHIDUsage_PD_SwitchOffControl = 0x51, /* DV F- Power Device Switch Off Control */ + kHIDUsage_PD_ToggleControl = 0x52, /* DV F- Power Device Toogle Sequence Control */ + kHIDUsage_PD_LowVoltageTransfer = 0x53, /* DV F- Power Device Min Transfer Voltage */ + kHIDUsage_PD_HighVoltageTransfer = 0x54, /* DV F- Power Device Max Transfer Voltage */ + kHIDUsage_PD_DelayBeforeReboot = 0x55, /* DV F- Power Device Delay Before Reboot */ + kHIDUsage_PD_DelayBeforeStartup = 0x56, /* DV F- Power Device Delay Before Startup */ + kHIDUsage_PD_DelayBeforeShutdown = 0x57, /* DV F- Power Device Delay Before Shutdown */ + kHIDUsage_PD_Test = 0x58, /* DV F- Power Device Test Request/Result */ + kHIDUsage_PD_ModuleReset = 0x59, /* DV F- Power Device Reset Request/Result */ + kHIDUsage_PD_AudibleAlarmControl = 0x5A, /* DV F- Power Device Audible Alarm Control */ + /* Reserved 0x5B - 0x5F */ + kHIDUsage_PD_Present = 0x60, /* DV IOF- Power Device Present */ + kHIDUsage_PD_Good = 0x61, /* DV IOF- Power Device Good */ + kHIDUsage_PD_InternalFailure = 0x62, /* DV IOF- Power Device Internal Failure */ + kHIDUsage_PD_VoltageOutOfRange = 0x63, /* DV IOF- Power Device Voltage Out Of Range */ + kHIDUsage_PD_FrequencyOutOfRange = 0x64, /* DV IOF- Power Device Frequency Out Of Range */ + kHIDUsage_PD_Overload = 0x65, /* DV IOF- Power Device Overload */ + kHIDUsage_PD_OverCharged = 0x66, /* DV IOF- Power Device Over Charged */ + kHIDUsage_PD_OverTemperature = 0x67, /* DV IOF- Power Device Over Temperature */ + kHIDUsage_PD_ShutdownRequested = 0x68, /* DV IOF- Power Device Shutdown Requested */ + kHIDUsage_PD_ShutdownImminent = 0x69, /* DV IOF- Power Device Shutdown Imminent */ + /* Reserved 0x6A */ + kHIDUsage_PD_SwitchOnOff = 0x6B, /* DV IOF- Power Device On/Off Switch Status */ + kHIDUsage_PD_Switchable = 0x6C, /* DV IOF- Power Device Switchable */ + kHIDUsage_PD_Used = 0x6D, /* DV IOF- Power Device Used */ + kHIDUsage_PD_Boost = 0x6E, /* DV IOF- Power Device Boosted */ + kHIDUsage_PD_Buck = 0x6F, /* DV IOF- Power Device Bucked */ + kHIDUsage_PD_Initialized = 0x70, /* DV IOF- Power Device Initialized */ + kHIDUsage_PD_Tested = 0x71, /* DV IOF- Power Device Tested */ + kHIDUsage_PD_AwaitingPower = 0x72, /* DV IOF- Power Device Awaiting Power */ + kHIDUsage_PD_CommunicationLost = 0x73, /* DV IOF- Power Device Communication Lost */ + /* Reserved 0x74 - 0xFC */ + kHIDUsage_PD_iManufacturer = 0xFD, /* SV F- Power Device Manufacturer String Index */ + kHIDUsage_PD_iProduct = 0xFE, /* SV F- Power Device Product String Index */ + kHIDUsage_PD_iserialNumber = 0xFF /* SV F- Power Device Serial Number String Index */ +}; + +/* Battery System Page (x85) */ +/* This section provides detailed descriptions of the usages employed by Battery Systems. */ +enum +{ + kHIDUsage_BS_Undefined = 0x00, /* Battery System Undefined */ + kHIDUsage_BS_SMBBatteryMode = 0x01, /* CL - SMB Mode */ + kHIDUsage_BS_SMBBatteryStatus = 0x02, /* CL - SMB Status */ + kHIDUsage_BS_SMBAlarmWarning = 0x03, /* CL - SMB Alarm Warning */ + kHIDUsage_BS_SMBChargerMode = 0x04, /* CL - SMB Charger Mode */ + kHIDUsage_BS_SMBChargerStatus = 0x05, /* CL - SMB Charger Status */ + kHIDUsage_BS_SMBChargerSpecInfo = 0x06, /* CL - SMB Charger Extended Status */ + kHIDUsage_BS_SMBSelectorState = 0x07, /* CL - SMB Selector State */ + kHIDUsage_BS_SMBSelectorPresets = 0x08, /* CL - SMB Selector Presets */ + kHIDUsage_BS_SMBSelectorInfo = 0x09, /* CL - SMB Selector Info */ + /* Reserved 0x0A - 0x0F */ + kHIDUsage_BS_OptionalMfgFunction1 = 0x10, /* DV F - Battery System Optional SMB Mfg Function 1 */ + kHIDUsage_BS_OptionalMfgFunction2 = 0x11, /* DV F - Battery System Optional SMB Mfg Function 2 */ + kHIDUsage_BS_OptionalMfgFunction3 = 0x12, /* DV F - Battery System Optional SMB Mfg Function 3 */ + kHIDUsage_BS_OptionalMfgFunction4 = 0x13, /* DV F - Battery System Optional SMB Mfg Function 4 */ + kHIDUsage_BS_OptionalMfgFunction5 = 0x14, /* DV F - Battery System Optional SMB Mfg Function 5 */ + kHIDUsage_BS_ConnectionToSMBus = 0x15, /* DF F - Battery System Connection To System Management Bus */ + kHIDUsage_BS_OutputConnection = 0x16, /* DF F - Battery System Output Connection Status */ + kHIDUsage_BS_ChargerConnection = 0x17, /* DF F - Battery System Charger Connection */ + kHIDUsage_BS_BatteryInsertion = 0x18, /* DF F - Battery System Battery Insertion */ + kHIDUsage_BS_Usenext = 0x19, /* DF F - Battery System Use Next */ + kHIDUsage_BS_OKToUse = 0x1A, /* DF F - Battery System OK To Use */ + kHIDUsage_BS_BatterySupported = 0x1B, /* DF F - Battery System Battery Supported */ + kHIDUsage_BS_SelectorRevision = 0x1C, /* DF F - Battery System Selector Revision */ + kHIDUsage_BS_ChargingIndicator = 0x1D, /* DF F - Battery System Charging Indicator */ + /* Reserved 0x1E - 0x27 */ + kHIDUsage_BS_ManufacturerAccess = 0x28, /* DV F - Battery System Manufacturer Access */ + kHIDUsage_BS_RemainingCapacityLimit = 0x29, /* DV F - Battery System Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimit = 0x2A, /* DV F - Battery System Remaining Time Limit */ + kHIDUsage_BS_AtRate = 0x2B, /* DV F - Battery System At Rate... */ + kHIDUsage_BS_CapacityMode = 0x2C, /* DV F - Battery System Capacity Mode */ + kHIDUsage_BS_BroadcastToCharger = 0x2D, /* DV F - Battery System Broadcast To Charger */ + kHIDUsage_BS_PrimaryBattery = 0x2E, /* DV F - Battery System Primary Battery */ + kHIDUsage_BS_ChargeController = 0x2F, /* DV F - Battery System Charge Controller */ + /* Reserved 0x30 - 0x3F */ + kHIDUsage_BS_TerminateCharge = 0x40, /* DF IOF - Battery System Terminate Charge */ + kHIDUsage_BS_TerminateDischarge = 0x41, /* DF IOF - Battery System Terminate Discharge */ + kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */ + kHIDUsage_BS_Charging = 0x44, /* DF IOF - Battery System Charging */ + kHIDUsage_BS_Discharging = 0x45, /* DV IOF - Battery System Discharging */ + kHIDUsage_BS_FullyCharged = 0x46, /* DF IOF - Battery System Fully Charged */ + kHIDUsage_BS_FullyDischarged = 0x47, /* DV IOF - Battery System Fully Discharged */ + kHIDUsage_BS_ConditioningFlag = 0x48, /* DV IOF - Battery System Conditioning Flag */ + kHIDUsage_BS_AtRateOK = 0x49, /* DV IOF - Battery System At Rate OK */ + kHIDUsage_BS_SMBErrorCode = 0x4A, /* DF IOF - Battery System SMB Error Code */ + kHIDUsage_BS_NeedReplacement = 0x4B, /* DF IOF - Battery System Need Replacement */ + /* Reserved 0x4C - 0x5F */ + kHIDUsage_BS_AtRateTimeToFull = 0x60, /* DV IF - Battery System At Rate Time To Full */ + kHIDUsage_BS_AtRateTimeToEmpty = 0x61, /* DV IF - Battery System At Rate Time To Empty */ + kHIDUsage_BS_AverageCurrent = 0x62, /* DV IF - Battery System Average Current */ + kHIDUsage_BS_Maxerror = 0x63, /* DV IF - Battery System Max Error */ + kHIDUsage_BS_RelativeStateOfCharge = 0x64, /* DV IF - Battery System Relative State Of Charge */ + kHIDUsage_BS_AbsoluteStateOfCharge = 0x65, /* DV IF - Battery System Absolute State Of Charge */ + kHIDUsage_BS_RemainingCapacity = 0x66, /* DV IF - Battery System Remaining Capacity */ + kHIDUsage_BS_FullChargeCapacity = 0x67, /* DV IF - Battery System Full Charge Capacity */ + kHIDUsage_BS_RunTimeToEmpty = 0x68, /* DV IF - Battery System Run Time To Empty */ + kHIDUsage_BS_AverageTimeToEmpty = 0x69, /* DV IF - Battery System Average Time To Empty */ + kHIDUsage_BS_AverageTimeToFull = 0x6A, /* DV IF - Battery System Average Time To Full */ + kHIDUsage_BS_CycleCount = 0x6B, /* DV IF - Battery System Cycle Count */ + /* Reserved 0x6C - 0x7F */ + kHIDUsage_BS_BattPackModelLevel = 0x80, /* SV F - Battery System Batt Pack Model Level */ + kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */ + kHIDUsage_BS_PrimaryBatterySupport = 0x82, /* SF F - Battery System Primary Battery Support */ + kHIDUsage_BS_DesignCapacity = 0x83, /* SV F - Battery System Design Capacity */ + kHIDUsage_BS_SpecificationInfo = 0x84, /* SV F - Battery System Specification Info */ + kHIDUsage_BS_ManufacturerDate = 0x85, /* SV F - Battery System Manufacturer Date */ + kHIDUsage_BS_SerialNumber = 0x86, /* SV F - Battery System Serial Number */ + kHIDUsage_BS_iManufacturerName = 0x87, /* SV F - Battery System Manufacturer Name Index */ + kHIDUsage_BS_iDevicename = 0x88, /* SV F - Battery System Device Name Index */ + kHIDUsage_BS_iDeviceChemistry = 0x89, /* SV F - Battery System Device Chemistry Index */ + kHIDUsage_BS_ManufacturerData = 0x8A, /* SV F - Battery System Manufacturer Data */ + kHIDUsage_BS_Rechargable = 0x8B, /* SV F - Battery System Rechargable */ + kHIDUsage_BS_WarningCapacityLimit = 0x8C, /* SV F - Battery System Warning Capacity Limit */ + kHIDUsage_BS_CapacityGranularity1 = 0x8D, /* SV F - Battery System Capacity Granularity 1 */ + kHIDUsage_BS_CapacityGranularity2 = 0x8E, /* SV F - Battery System Capacity Granularity 2 */ + kHIDUsage_BS_iOEMInformation = 0x8F, /* SV F - Battery System OEM Information Index */ + /* Reserved 0x90 - 0xBF */ + kHIDUsage_BS_InhibitCharge = 0xC0, /* DF IOF - Battery System Inhibit Charge */ + kHIDUsage_BS_EnablePolling = 0xC1, /* DF IOF - Battery System Enable Polling */ + kHIDUsage_BS_ResetToZero = 0xC2, /* DF IOF - Battery System Reset To Zero */ + /* Reserved 0xC3 - 0xCF */ + kHIDUsage_BS_ACPresent = 0xD0, /* DF IOF - Battery System AC Present */ + kHIDUsage_BS_BatteryPresent = 0xD1, /* DF IOF - Battery System Battery Present */ + kHIDUsage_BS_PowerFail = 0xD2, /* DF IOF - Battery System Power Fail */ + kHIDUsage_BS_AlarmInhibited = 0xD3, /* DF IOF - Battery System Alarm Inhibited */ + kHIDUsage_BS_ThermistorUnderRange = 0xD4, /* DF IOF - Battery System Thermistor Under Range */ + kHIDUsage_BS_ThermistorHot = 0xD5, /* DF IOF - Battery System Thermistor Hot */ + kHIDUsage_BS_ThermistorCold = 0xD6, /* DF IOF - Battery System Thermistor Cold */ + kHIDUsage_BS_ThermistorOverRange = 0xD7, /* DF IOF - Battery System Thermistor Over Range */ + kHIDUsage_BS_VoltageOutOfRange = 0xD8, /* DF IOF - Battery System Voltage Out Of Range */ + kHIDUsage_BS_CurrentOutOfRange = 0xD9, /* DF IOF - Battery System Current Out Of Range */ + kHIDUsage_BS_CurrentNotRegulated = 0xDA, /* DF IOF - Battery System Current Not Regulated */ + kHIDUsage_BS_VoltageNotRegulated = 0xDB, /* DF IOF - Battery System Voltage Not Regulated */ + kHIDUsage_BS_MasterMode = 0xDC, /* DF IOF - Battery System Master Mode */ + /* Reserved 0xDD - 0xEF */ + kHIDUsage_BS_ChargerSelectorSupport = 0xF0, /* SF F- Battery System Charger Support Selector */ + kHIDUsage_BS_ChargerSpec = 0xF1, /* SF F- Battery System Charger Specification */ + kHIDUsage_BS_Level2 = 0xF2, /* SF F- Battery System Charger Level 2 */ + kHIDUsage_BS_Level3 = 0xF3 /* SF F- Battery System Charger Level 3 */ + /* Reserved 0xF2 - 0xFF */ +}; + +/* Bar Code Scanner Page (0x8C) */ +/* This section provides detailed descriptions of the usages employed by Bar Code Scanner Devices. */ +enum +{ + kHIDUsage_BCS_Undefined = 0x00, /* Bar Code Scanner Undefined Usage */ + kHIDUsage_BCS_BadgeReader = 0x01, /* CA - Bar Code Badge Reader */ + kHIDUsage_BCS_BarCodeScanner = 0x02, /* CA -Bar Code Scanner */ + kHIDUsage_BCS_DumbBarCodeScanner = 0x03, /* CA -Dumb Bar Code Scanner Usage */ + kHIDUsage_BCS_CordlessScannerBase = 0x04, /* CA -Cordless Base Usage */ + kHIDUsage_BCS_BarCodeScannerCradle = 0x05, /* CA -Bar Code Scanner Cradle Usage */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_BCS_AttributeReport = 0x10, /* CL - Attribute Report */ + kHIDUsage_BCS_SettingsReport = 0x11, /* CL - Settings Report */ + kHIDUsage_BCS_ScannedDataReport = 0x12, /* CL - Scanned Data Report */ + kHIDUsage_BCS_RawScannedDataReport = 0x13, /* CL - Raw Scanned Data Report */ + kHIDUsage_BCS_TriggerReport = 0x14, /* CL - Trigger Report */ + kHIDUsage_BCS_StatusReport = 0x15, /* CL - Status Report */ + kHIDUsage_BCS_UPC_EANControlReport = 0x16, /* CL - UPC/EAN Control Report */ + kHIDUsage_BCS_EAN2_3LabelControlReport = 0x17, /* CL - EAN 2/3 Label Control Report */ + kHIDUsage_BCS_Code39ControlReport = 0x18, /* CL - Code 39 Control Report */ + kHIDUsage_BCS_Interleaved2of5ControlReport = 0x19, /* CL - Interleaved 2 of 5 Control Report */ + kHIDUsage_BCS_Standard2of5ControlReport = 0x1A, /* CL - Standard 2 of 5 Control Report */ + kHIDUsage_BCS_MSIPlesseyControlReport = 0x1B, /* CL - MSI Plessey Control Report */ + kHIDUsage_BCS_CodabarControlReport = 0x1C, /* CL - Codabar Control Report */ + kHIDUsage_BCS_Code128ControlReport = 0x1D, /* CL - Code 128 Control Report */ + kHIDUsage_BCS_Misc1DControlReport = 0x1E, /* CL - Misc 1D Control Report */ + kHIDUsage_BCS_2DControlReport = 0x1F, /* CL - 2D Control Report */ + /* Reserved 0x20 - 0x2F */ + kHIDUsage_BCS_Aiming_PointerMide = 0x30, /* SF - Aiming Pointer Mode */ + kHIDUsage_BCS_BarCodePresentSensor = 0x31, /* SF - Bar Code Present Sensor */ + kHIDUsage_BCS_Class1ALaser = 0x32, /* SF - Class 1A Laser */ + kHIDUsage_BCS_Class2Laser = 0x33, /* SF - Class 2 Laser */ + kHIDUsage_BCS_HeaterPresent = 0x34, /* SF - Heater Present */ + kHIDUsage_BCS_ContactScanner = 0x35, /* SF - Contact Scanner */ + kHIDUsage_BCS_ElectronicArticleSurveillanceNotification = 0x36, /* SF - Electronic Article Surveillance Notification */ + kHIDUsage_BCS_ConstantElectronicArticleSurveillance = 0x37, /* SF - Constant Electronic Article Surveillance */ + kHIDUsage_BCS_ErrorIndication = 0x38, /* SF - Error Indication */ + kHIDUsage_BCS_FixedBeeper = 0x39, /* SF - Fixed Beeper */ + kHIDUsage_BCS_GoodDecodeIndication = 0x3A, /* SF - Good Decode Indication */ + kHIDUsage_BCS_HandsFreeScanning = 0x3B, /* SF - Hands Free Scanning */ + kHIDUsage_BCS_IntrinsicallySafe = 0x3C, /* SF - Intrinsically Safe */ + kHIDUsage_BCS_KlasseEinsLaser = 0x3D, /* SF - Klasse Eins Laser */ + kHIDUsage_BCS_LongRangeScanner = 0x3E, /* SF - Long Range Scanner */ + kHIDUsage_BCS_MirrorSpeedControl = 0x3F, /* SF - Mirror Speed Control */ + kHIDUsage_BCS_NotOnFileIndication = 0x40, /* SF - Not On File Indication */ + kHIDUsage_BCS_ProgrammableBeeper = 0x41, /* SF - Programmable Beeper */ + kHIDUsage_BCS_Triggerless = 0x42, /* SF - Triggerless */ + kHIDUsage_BCS_Wand = 0x43, /* SF - Wand */ + kHIDUsage_BCS_WaterResistant = 0x44, /* SF - Water Resistant */ + kHIDUsage_BCS_MultiRangeScanner = 0x45, /* SF - Multi-Range Scanner */ + kHIDUsage_BCS_ProximitySensor = 0x46, /* SF - Proximity Sensor */ + /* Reserved 0x47 - 0x4C */ + kHIDUsage_BCS_FragmentDecoding = 0x4D, /* DF - Fragment Decoding */ + kHIDUsage_BCS_ScannerReadConfidence = 0x4E, /* DV - Scanner Read Confidence */ + kHIDUsage_BCS_DataPrefix = 0x4F, /* NAry - Data Prefix */ + kHIDUsage_BCS_PrefixAIMI = 0x50, /* SEL - Prefix AIMI */ + kHIDUsage_BCS_PrefixNone = 0x51, /* SEL - Prefix None */ + kHIDUsage_BCS_PrefixProprietary = 0x52, /* SEL - Prefix Proprietary */ + /* Reserved 0x53 - 0x54 */ + kHIDUsage_BCS_ActiveTime = 0x55, /* DV - Active Time */ + kHIDUsage_BCS_AimingLaserPattern = 0x56, /* DF - Aiming Laser Pattern */ + kHIDUsage_BCS_BarCodePresent = 0x57, /* OOC - Bar Code Present */ + kHIDUsage_BCS_BeeperState = 0x58, /* OOC - Beeper State */ + kHIDUsage_BCS_LaserOnTime = 0x59, /* DV - Laser On Time */ + kHIDUsage_BCS_LaserState = 0x5A, /* OOC - Laser State */ + kHIDUsage_BCS_LockoutTime = 0x5B, /* DV - Lockout Time */ + kHIDUsage_BCS_MotorState = 0x5C, /* OOC - Motor State */ + kHIDUsage_BCS_MotorTimeout = 0x5D, /* DV - Motor Timeout */ + kHIDUsage_BCS_PowerOnResetScanner = 0x5E, /* DF - Power On Reset Scanner */ + kHIDUsage_BCS_PreventReadOfBarcodes = 0x5F, /* DF - Prevent Read of Barcodes */ + kHIDUsage_BCS_InitiateBarcodeRead = 0x60, /* DF - Initiate Barcode Read */ + kHIDUsage_BCS_TriggerState = 0x61, /* DF - Trigger State */ + kHIDUsage_BCS_TriggerMode = 0x62, /* NAry - Trigger Mode */ + kHIDUsage_BCS_TriggerModeBlinkingLaserOn = 0x63, /* SEL - Trigger Mode Blinking Laser On */ + kHIDUsage_BCS_TriggerModeContinuousLaserOn = 0x64, /* SEL - Trigger Mode Continuous Laser On */ + kHIDUsage_BCS_TriggerModeLaserOnWhilePulled = 0x65, /* SEL - Trigger Mode Laser on while Pulled */ + kHIDUsage_BCS_TriggerModeLaserStaysOnAfterTriggerRelease = 0x66, /* SEL - Trigger Mode Laser stays on after Trigger Release */ + /* Reserved 0x67 - 0x6C */ + kHIDUsage_BCS_CommitParametersToNVM = 0x6D, /* DF - Commit Parameters to NVM */ + kHIDUsage_BCS_ParameterScanning = 0x6E, /* DF - Parameter Scanning */ + kHIDUsage_BCS_ParametersChanged = 0x6F, /* OOC - Parameters Changed */ + kHIDUsage_BCS_SetParameterDefaultValues = 0x70, /* DF - Set parameter default values */ + /* Reserved 0x71 - 0x74 */ + kHIDUsage_BCS_ScannerInCradle = 0x75, /* OOC - Scanner In Cradle */ + kHIDUsage_BCS_ScannerInRange = 0x76, /* OOC - Scanner In Range */ + /* Reserved 0x77 - 0x79 */ + kHIDUsage_BCS_AimDuration = 0x7A, /* DV - Aim Duration */ + kHIDUsage_BCS_GoodReadLampDuration = 0x7B, /* DV - Good Read Lamp Duration */ + kHIDUsage_BCS_GoodReadLampIntensity = 0x7C, /* DV - Good Read Lamp Intensity */ + kHIDUsage_BCS_GoodReadLED = 0x7D, /* DF - Good Read LED */ + kHIDUsage_BCS_GoodReadToneFrequency = 0x7E, /* DV - Good Read Tone Frequency*/ + kHIDUsage_BCS_GoodReadToneLength = 0x7F, /* DV - Good Read Tone Length */ + kHIDUsage_BCS_GoodReadToneVolume = 0x80, /* DV - Good Read Tone Volume */ + /* Reserved 0x81 */ + kHIDUsage_BCS_NoReadMessage = 0x82, /* DF - No Read Message */ + kHIDUsage_BCS_NotOnFileVolume = 0x83, /* DV - Not on File Volume */ + kHIDUsage_BCS_PowerupBeep = 0x84, /* DF - Powerup Beep */ + kHIDUsage_BCS_SoundErrorBeep = 0x85, /* DF - Sound Error Beep */ + kHIDUsage_BCS_SoundGoodReadBeep = 0x86, /* DF - Sound Good Read Beep */ + kHIDUsage_BCS_SoundNotOnFileBeep = 0x87, /* DF - Sound Not On File Beep */ + kHIDUsage_BCS_GoodReadWhenToWrite = 0x88, /* NArry - Good Read When to Write */ + kHIDUsage_BCS_GRWTIAfterDecode = 0x89, /* SEL - GRWTI After Decode */ + kHIDUsage_BCS_GRWTIBeep_LampAfterTransmit = 0x8A, /* SEL - GRWTI Beep/Lamp after transmit */ + kHIDUsage_BCS_GRWTINoBeep_LampUseAtAll = 0x8B, /* SEL - GRWTI No Beep/Lamp at all */ + /* Reserved 0x8C - 0x90 */ + kHIDUsage_BCS_BooklandEAN = 0x91, /* DF - Bookland EAN */ + kHIDUsage_BCS_ConvertEAN8To13Type = 0x92, /* DF - Convert EAN 8 to 13 Type */ + kHIDUsage_BCS_ConvertUPCAToEAN_13 = 0x93, /* DF - Convert UPC A to EAN-13 */ + kHIDUsage_BCS_ConvertUPC_EToA = 0x94, /* DF - Convert UPC-E to A */ + kHIDUsage_BCS_EAN_13 = 0x95, /* DF - EAN-13 */ + kHIDUsage_BCS_EAN_8 = 0x96, /* DF - EAN_8 */ + kHIDUsage_BCS_EAN_99_128_Mandatory = 0x97, /* DF - EAN-99 128_Mandatory */ + kHIDUsage_BCS_EAN_99_P5_128_Optional = 0x98, /* DF - EAN-99 P5/128_Optional */ + /* Reserved 0x99 */ + kHIDUsage_BCS_UPC_EAN = 0x9A, /* DF - UPC/EAN */ + kHIDUsage_BCS_UPC_EANCouponCode = 0x9B, /* DF - UPC/EAN Coupon Code */ + kHIDUsage_BCS_UPC_EANPeriodicals = 0x9C, /* DV - UPC/EAN Periodicals */ + kHIDUsage_BCS_UPC_A = 0x9D, /* DF - UPC-A */ + kHIDUsage_BCS_UPC_AWith128Mandatory = 0x9E, /* DF - UPC-A with 128 Mandatory */ + kHIDUsage_BCS_UPC_AWith128Optical = 0x9F, /* DF - UPC-A with 128 Optical */ + kHIDUsage_BCS_UPC_AWithP5Optional = 0xA0, /* DF - UPC-A with P5 Optional */ + kHIDUsage_BCS_UPC_E = 0xA1, /* DF - UPC-E */ + kHIDUsage_BCS_UPC_E1 = 0xA2, /* DF - UPC-E1 */ + /* Reserved 0xA3 - 0xA8 */ + kHIDUsage_BCS_Periodical = 0xA9, /* NArry - Periodical */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus2 = 0xAA,/* SEL - Periodical Auto-Discriminate + 2 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus2 = 0xAB, /* SEL - Periodical Only Decode with + 2 */ + kHIDUsage_BCS_PeriodicalIgnorePlus2 = 0xAC, /* SEL - Periodical Ignore + 2 */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus5 = 0xAD,/* SEL - Periodical Auto-Discriminate + 5 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus5 = 0xAE, /* SEL - Periodical Only Decode with + 5 */ + kHIDUsage_BCS_PeriodicalIgnorePlus5 = 0xAF, /* SEL - Periodical Ignore + 5 */ + kHIDUsage_BCS_Check = 0xB0, /* NArry - Check */ + kHIDUsage_BCS_CheckDisablePrice = 0xB1, /* SEL - Check Disable Price */ + kHIDUsage_BCS_CheckEnable4DigitPrice = 0xB2, /* SEL - Check Enable 4 digit Price */ + kHIDUsage_BCS_CheckEnable5DigitPrice = 0xB3, /* SEL - Check Enable 5 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean4DigitPrice = 0xB4,/* SEL - Check Enable European 4 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean5DigitPrice = 0xB5,/* SEL - Check Enable European 5 digit Price */ + /* Reserved 0xB6 */ + kHIDUsage_BCS_EANTwoLabel = 0xB7, /* DF - EAN Two Label */ + kHIDUsage_BCS_EANThreeLabel = 0xB8, /* DF - EAN Thread Label */ + kHIDUsage_BCS_EAN8FlagDigit1 = 0xB9, /* DV - EAN 8 Flag Digit 1 */ + kHIDUsage_BCS_EAN8FlagDigit2 = 0xBA, /* DV - EAN 8 Flag Digit 2 */ + kHIDUsage_BCS_EAN8FlagDigit3 = 0xBB, /* DV - EAN 8 Flag Digit 3 */ + kHIDUsage_BCS_EAN13FlagDigit1 = 0xBC, /* DV - EAN 13 Flag Digit 1 */ + kHIDUsage_BCS_EAN13FlagDigit2 = 0xBD, /* DV - EAN 13 Flag Digit 2 */ + kHIDUsage_BCS_EAN13FlagDigit3 = 0xBE, /* DV - EAN 13 Flag Digit 3 */ + kHIDUsage_BCS_AddEAN2_3LabelDefinition = 0xBF, /* DF - Add EAN 2/3 Label Definition */ + kHIDUsage_BCS_ClearAllEAN2_3LabelDefinitions = 0xC0,/* DF - Clear all EAN 2/3 Label Definitions */ + /* Reserved 0xC1 - 0xC2 */ + kHIDUsage_BCS_Codabar = 0xC3, /* DF - Codabar */ + kHIDUsage_BCS_Code128 = 0xC4, /* DF - Code 128 */ + /* Reserved 0xC5 - 0xC6 */ + kHIDUsage_BCS_Code39 = 0xC7, /* DF - Code 39 */ + kHIDUsage_BCS_Code93 = 0xC8, /* DF - Code 93 */ + kHIDUsage_BCS_FullASCIIConversion = 0xC9, /* DF - Full ASCII Conversion */ + kHIDUsage_BCS_Interleaved2of5 = 0xCA, /* DF - Interleaved 2 of 5 */ + kHIDUsage_BCS_ItalianPharmacyCode = 0xCB, /* DF - Italian Pharmacy Code */ + kHIDUsage_BCS_MSI_Plessey = 0xCC, /* DF - MSI/Plessey */ + kHIDUsage_BCS_Standard2of5IATA = 0xCD, /* DF - Standard 2 of 5 IATA */ + kHIDUsage_BCS_Standard2of5 = 0xCE, /* DF - Standard 2 of 5 */ + /* Reserved 0xCF - 0xD2 */ + kHIDUsage_BCS_TransmitStart_Stop = 0xD3, /* DF - Transmit Start/Stop */ + kHIDUsage_BCS_TriOptic = 0xD4, /* DF - Tri-Optic */ + kHIDUsage_BCS_UCC_EAN_128 = 0xD5, /* DF - UCC/EAN-128 */ + kHIDUsage_BCS_CheckDigit = 0xD6, /* NArry - Check Digit */ + kHIDUsage_BCS_CheckDigitDisable = 0xD7, /* SEL - Check Digit Disable */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5OPCC = 0xD8, /* SEL - Check Digit Enable Interleaved 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5USS = 0xD9, /* SEL - Check Digit Enable Interleaved 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5OPCC = 0xD8, /* SEL - Check Digit Enable Standard 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5USS = 0xD9, /* SEL - Check Digit Enable Standard 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableOneMSIPlessey = 0xDC, /* SEL - Check Digit Enable One MSI Plessey */ + kHIDUsage_BCS_CheckDigitEnableTwoMSIPlessey = 0xDD, /* SEL - Check Digit Enable Two MSI Plessey */ + kHIDUsage_BCS_CheckDigitCodabarEnable = 0xDE, /* SEL - Check Digit Codabar Enable */ + kHIDUsage_BCS_CheckDigitCode99Enable = 0xDF, /* SEL - Check Digit Code 99 Enable */ + /* Reserved 0xE0 - 0xEF */ + kHIDUsage_BCS_TransmitCheckDigit = 0xF0, /* NArry - Transmit Check Digit */ + kHIDUsage_BCS_DisableCheckDigitTransmit = 0xF1, /* SEL - Disable Check Digit Transmit */ + kHIDUsage_BCS_EnableCheckDigitTransmit = 0xF2, /* SEL - Enable Check Digit Transmit */ + /* Reserved 0xF3 - 0xFA */ + kHIDUsage_BCS_SymbologyIdentifier1 = 0xFB, /* DV - Symbology Identifier 1 */ + kHIDUsage_BCS_SymbologyIdentifier2 = 0xFC, /* DV - Symbology Identifier 2 */ + kHIDUsage_BCS_SymbologyIdentifier3 = 0xFD, /* DV - Symbology Identifier 3 */ + kHIDUsage_BCS_DecodedData = 0xFE, /* DV - Decoded Data */ + kHIDUsage_BCS_DecodeDataContinued = 0xFF, /* DF - Decode Data Continued */ + kHIDUsage_BCS_BarSpaceData = 0x100, /* DV - Bar Space Data */ + kHIDUsage_BCS_ScannerDataAccuracy = 0x101, /* DV - Scanner Data Accuracy */ + kHIDUsage_BCS_RawDataPolarity = 0x102, /* NArry - Raw Data Polarity */ + kHIDUsage_BCS_PolarityInvertedBarCode = 0x103, /* SEL - Polarity Inverted Bar Code */ + kHIDUsage_BCS_PolarityNormalBarCode = 0x103, /* SEL - Polarity Normal Bar Code */ + /* Reserved 0x105 */ + kHIDUsage_BCS_MinimumLengthToDecode = 0x106, /* DV - Minimum Length to Decode */ + kHIDUsage_BCS_MaximumLengthToDecode = 0x107, /* DV - Maximum Length to Decode */ + kHIDUsage_BCS_FirstDiscreteLengthToDecode = 0x108, /* DV - First Discrete Length to Decode */ + kHIDUsage_BCS_SecondDiscreteLengthToDecode = 0x109, /* DV - Second Discrete Length to Decode */ + kHIDUsage_BCS_DataLengthMethod = 0x10A, /* NArry - Data Length Method */ + kHIDUsage_BCS_DLMethodReadAny = 0x10B, /* DF - DL Method Read any */ + kHIDUsage_BCS_DLMethodCheckInRange = 0x10C, /* DF - DL Method Check in Range */ + kHIDUsage_BCS_DLMethodCheckForDiscrete = 0x10D, /* DF - DL Method Check for Discrete */ + /* Reserved 0x10E - 0x10F */ + kHIDUsage_BCS_AztecCode = 0x110, /* DF - Aztec Code */ + kHIDUsage_BCS_BC412 = 0x111, /* DF - BC412 */ + kHIDUsage_BCS_ChannelCode = 0x112, /* DF - Channel Code */ + kHIDUsage_BCS_Code16 = 0x113, /* DF - Code 16 */ + kHIDUsage_BCS_Code32 = 0x114, /* DF - Code 32 */ + kHIDUsage_BCS_Code49 = 0x115, /* DF - Code 49 */ + kHIDUsage_BCS_CodeOne = 0x116, /* DF - Code One */ + kHIDUsage_BCS_Colorcode = 0x117, /* DF - Colorcode */ + kHIDUsage_BCS_DataMatrix = 0x118, /* DF - Data Matrix */ + kHIDUsage_BCS_MaxiCode = 0x119, /* DF - MaxiCode */ + kHIDUsage_BCS_MicroPDF = 0x11A, /* DF - MicroPDF */ + kHIDUsage_BCS_PDF_417 = 0x11B, /* DF - PDF-417 */ + kHIDUsage_BCS_PosiCode = 0x11C, /* DF - PosiCode */ + kHIDUsage_BCS_QRCode = 0x11D, /* DF - QR Code */ + kHIDUsage_BCS_SuperCode = 0x11E, /* DF - SuperCode */ + kHIDUsage_BCS_UltraCode = 0x11F, /* DF - UltraCode */ + kHIDUsage_BCS_USB_5_SlugCode = 0x120, /* DF - USD-5 (Slug Code) */ + kHIDUsage_BCS_VeriCode = 0x121 /* DF - VeriCode */ + /* Reserved 0x122 - 0xFFFF */ +}; + +/* Weighing Devices Page (0x8D) */ +/* This section provides detailed descriptions of the usages employed by Weighing Devices. */ +enum +{ + kHIDUsage_WD_Undefined = 0x00, /* Weighing Device Undefined Usage */ + kHIDUsage_WD_WeighingDevice = 0x01, /* CA - Weighing Device */ + /* Reserved 0x02 - 0x1F */ + kHIDUsage_WD_ScaleScaleDevice = 0x20, /* CL - Scale Device */ + kHIDUsage_WD_ScaleScaleClassIMetricCL = 0x21, /* CL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIMetric = 0x22, /* SEL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIIMetric = 0x23, /* SEL - Scale Class II Metric */ + kHIDUsage_WD_ScaleScaleClassIIIMetric = 0x24, /* SEL - Scale Class III Metric */ + kHIDUsage_WD_ScaleScaleClassIIILMetric = 0x25, /* SEL - Scale Class IIIL Metric */ + kHIDUsage_WD_ScaleScaleClassIVMetric = 0x26, /* SEL - Scale Class IV Metric */ + kHIDUsage_WD_ScaleScaleClassIIIEnglish = 0x27, /* SEL - Scale Class III English */ + kHIDUsage_WD_ScaleScaleClassIIILEnglish = 0x28, /* SEL - Scale Class IIIL English */ + kHIDUsage_WD_ScaleScaleClassIVEnglish = 0x29, /* SEL - Scale Class IV English */ + kHIDUsage_WD_ScaleScaleClassGeneric = 0x2A, /* SEL - Scale Class Generic */ + /* Reserved 0x2B - 0x2F */ + kHIDUsage_WD_ScaleAtrributeReport = 0x30, /* CL - Scale Attribute Report */ + kHIDUsage_WD_ScaleControlReport = 0x31, /* CL - Scale Control Report */ + kHIDUsage_WD_ScaleDataReport = 0x32, /* CL - Scale Data Report */ + kHIDUsage_WD_ScaleStatusReport = 0x33, /* CL - Scale Status Report */ + kHIDUsage_WD_ScaleWeightLimitReport = 0x34, /* CL - Scale Weight Limit Report */ + kHIDUsage_WD_ScaleStatisticsReport = 0x35, /* CL - Scale Statistics Report */ + /* Reserved 0x36 - 0x3F */ + kHIDUsage_WD_DataWeight = 0x40, /* DV - Data Weight */ + kHIDUsage_WD_DataScaling = 0x41, /* DV - Data Scaling */ + /* Reserved 0x42 - 0x4F */ + kHIDUsage_WD_WeightUnit = 0x50, /* CL - Weight Unit */ + kHIDUsage_WD_WeightUnitMilligram = 0x51, /* SEL - Weight Unit Milligram */ + kHIDUsage_WD_WeightUnitGram = 0x52, /* SEL - Weight Unit Gram */ + kHIDUsage_WD_WeightUnitKilogram = 0x53, /* SEL - Weight Unit Kilogram */ + kHIDUsage_WD_WeightUnitCarats = 0x54, /* SEL - Weight Unit Carats */ + kHIDUsage_WD_WeightUnitTaels = 0x55, /* SEL - Weight Unit Taels */ + kHIDUsage_WD_WeightUnitGrains = 0x56, /* SEL - Weight Unit Grains */ + kHIDUsage_WD_WeightUnitPennyweights = 0x57, /* SEL - Weight Unit Pennyweights */ + kHIDUsage_WD_WeightUnitMetricTon = 0x58, /* SEL - Weight Unit Metric Ton */ + kHIDUsage_WD_WeightUnitAvoirTon = 0x59, /* SEL - Weight Unit Avoir Ton */ + kHIDUsage_WD_WeightUnitTroyOunce = 0x5A, /* SEL - Weight Unit Troy Ounce */ + kHIDUsage_WD_WeightUnitOunce = 0x5B, /* SEL - Weight Unit Ounce */ + kHIDUsage_WD_WeightUnitPound = 0x5C, /* SEL - Weight Unit Pound */ + /* Reserved 0x5D - 0x5F */ + kHIDUsage_WD_CalibrationCount = 0x60, /* DV - Calibration Count */ + kHIDUsage_WD_RezeroCount = 0x61, /* DV - Re-Zero Count*/ + /* Reserved 0x62 - 0x6F */ + kHIDUsage_WD_ScaleStatus = 0x70, /* CL - Scale Status */ + kHIDUsage_WD_ScaleStatusFault = 0x71, /* SEL - Scale Status Fault */ + kHIDUsage_WD_ScaleStatusStableAtZero = 0x72, /* SEL - Scale Status Stable at Center of Zero */ + kHIDUsage_WD_ScaleStatusInMotion = 0x73, /* SEL - Scale Status In Motion */ + kHIDUsage_WD_ScaleStatusWeightStable = 0x74, /* SEL - Scale Status Weight Stable */ + kHIDUsage_WD_ScaleStatusUnderZero = 0x75, /* SEL - Scale Status Under Zero */ + kHIDUsage_WD_ScaleStatusOverWeightLimit = 0x76, /* SEL - Scale Status Over Weight Limit */ + kHIDUsage_WD_ScaleStatusRequiresCalibration = 0x77, /* SEL - Scale Status Requires Calibration */ + kHIDUsage_WD_ScaleStatusRequiresRezeroing = 0x78, /* SEL - Scale Status Requires Re-zeroing */ + /* Reserved 0x79 - 0x7F */ + kHIDUsage_WD_ZeroScale = 0x80, /* OOC - Zero Scale */ + kHIDUsage_WD_EnforcedZeroReturn = 0x81 /* OOC - Enforced Zero Return */ + /* Reserved 0x82 - 0xFFFF */ + +}; + +/* Magnetic Stripe Reader Page (0x8E) */ +/* This section provides detailed descriptions of the usages employed by Magnetic Stripe Reader Devices. */ +enum +{ + kHIDUsage_MSR_Undefined = 0x00, /* MagStripe Undefined Usage */ + kHIDUsage_MSR_DeviceReadOnly = 0x01, /* CA - MSR Device Read-Only */ + /* Reserved 0x02 - 0x10 */ + kHIDUsage_MSR_Track1Length = 0x11, /* SF, DF, SEL - Track 1 Length */ + kHIDUsage_MSR_Track2Length = 0x12, /* SF, DF, SEL - Track 2 Length */ + kHIDUsage_MSR_Track3Length = 0x13, /* SF, DF, SEL - Track 3 Length */ + kHIDUsage_MSR_TrackJISLength = 0x14, /* SF, DF, SEL - Track JIS Length */ + /* Reserved 0x15 - 0x1F */ + kHIDUsage_MSR_TrackData = 0x20, /* SF, DF, SEL - Track Data */ + kHIDUsage_MSR_Track1Data = 0x21, /* SF, DF, SEL - Track 1 Data */ + kHIDUsage_MSR_Track2Data = 0x22, /* SF, DF, SEL - Track 2 Data */ + kHIDUsage_MSR_Track3Data = 0x23, /* SF, DF, SEL - Track 3 Data */ + kHIDUsage_MSR_TrackJISData = 0x24 /* SF, DF, SEL - Track JIS Data */ + /* Reserved 0x25 - 0xFFFF */ +}; + +#endif /* _IOHIDUSAGETABLES_H */ diff --git a/i386/include/IOKit/hid/IOHIDDevice.h b/i386/include/IOKit/hid/IOHIDDevice.h new file mode 100644 index 0000000..29f0024 --- /dev/null +++ b/i386/include/IOKit/hid/IOHIDDevice.h @@ -0,0 +1,706 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDDEVICE_H +#define _IOKIT_HID_IOHIDDEVICE_H + +#include +#include +#include +#include +#include + +class IOHIDSystem; +class IOHIDPointing; +class IOHIDKeyboard; +class IOHIDConsumer; +class IOHIDElementPrivate; +class IOHIDEventQueue; +class IOHIDInterface; +class IOHIDDeviceShim; +struct IOHIDReportHandler; + +/*! + @typedef IOHIDCompletionAction + @abstract Function called when set/get report completes + @param target The target specified in the IOHIDCompletion struct. + @param parameter The parameter specified in the IOHIDCompletion struct. + @param status Completion status +*/ +typedef void (*IOHIDCompletionAction)( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + +/*! + @typedef IOHIDCompletion + @abstract Struct spefifying action to perform when set/get report completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. +*/ +typedef struct IOHIDCompletion { + void * target; + IOHIDCompletionAction action; + void * parameter; +} IOHIDCompletion; + +/*! + @enum IOHIDReportOption + @abstract Option bits for IOHIDDevice::handleReport, + IOHIDDevice::getReport, and IOHIDDevice::setReport + @constant kIOHIDReportOptionNotInterrupt Tells method that the report + passed was not interrupt driven. +*/ +enum +{ + kIOHIDReportOptionNotInterrupt = 0x100 +}; + + +/*! @class IOHIDDevice : public IOService + @abstract IOHIDDevice defines a Human Interface Device (HID) object, + which will interact with the HID Manager by publishing static properties + in the registry, and also by reporting HID events through shared memory. + IOHIDDevice is an abstract class that must be subclassed to support a + specific type of HID devices, such as USB HID class devices. +
+ Since most HID devices are expected to be USB devices, IOHIDDevice + uses the USB HID specification to define the format of the report + descriptor, and also reports that are used to communicate with the + hardware via some intervening transport layer. However, there is no + mandate that the transport layer must be restricted to USB. A subclass + may be created to support legacy ADB joysticks, and issue packets on + the ADB bus and translate those packets to USB reports, and vice versa. + IOHIDDevice does not care how those reports are generated or consumed + by the physical device, as long as the reports abide to the USB + specification. */ + +class IOHIDDevice : public IOService +{ + OSDeclareDefaultStructors( IOHIDDevice ) + + friend class IOHIDLibUserClient; + friend class IOHIDDeviceShim; + +private: + OSArray * _elementArray; + UInt32 _dataElementIndex; + IORecursiveLock * _elementLock; + IOHIDReportHandler * _reportHandlers; + IOBufferMemoryDescriptor * _elementValuesDescriptor; + bool _readyForInputReports; + UInt32 _reportCount; + UInt32 _maxInputReportSize; + UInt32 _maxOutputReportSize; + UInt32 _maxFeatureReportSize; + + struct ExpansionData { + OSSet * clientSet; + IOService * seizedClient; + AbsoluteTime eventDeadline; + IONotifier * publishNotify; + OSArray * inputInterruptElementArray; + bool performTickle; + IOHIDInterface * interfaceNub; + IOHIDElementPrivate * rollOverElement; + OSArray * hierarchElements; + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + // HID report descriptor parsing support. + + bool linkToParent( const OSArray * array, + UInt32 parentIndex, + UInt32 childIndex ); + + bool createCollectionElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 maxCount ); + + bool createValueElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 hidReportType, + IOHIDElementType elementType, + UInt32 maxCount ); + + bool createButtonElements( HIDPreparsedDataRef parseData, + OSArray * array, + UInt32 hidReportType, + IOHIDElementType elementType, + UInt32 maxCount ); + + bool createReportHandlerElements( HIDPreparsedDataRef parseData); + + OSArray * newDeviceUsagePairs(); + + bool getReportCountAndSizes( HIDPreparsedDataRef parseData ); + + bool setReportSize( UInt8 reportID, + IOHIDReportType reportType, + UInt32 bits ); + + IOReturn createElementHierarchy( HIDPreparsedDataRef parseData ); + + IOReturn parseReportDescriptor( IOMemoryDescriptor * report, + IOOptionBits options = 0 ); + + IOBufferMemoryDescriptor * createMemoryForElementValues(); + + + static bool _publishNotificationHandler( void * target, + void * ref, IOService * newService ); + +protected: + +/*! @function free + @abstract Free the IOHIDDevice object. + @discussion Release all resources that were previously allocated, + then call super::free() to propagate the call to our superclass. */ + + virtual void free(); + +/*! @function handleOpen + @abstract Handle a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result true to accept the client open, false otherwise. */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handle a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). */ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Query whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result true if the specified client, or any client if none (0) is + specified, presently has an open on this object. */ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function handleStart + @abstract Prepare the hardware and driver to support I/O operations. + @discussion IOHIDDevice will call this method from start() before + any I/O operations are issued to the concrete subclass. Methods + such as newReportDescriptor() are only called after handleStart() + has returned true. A subclass that overrides this method should + begin its implementation by calling the version in super, and + then check the return value. + @param provider The provider argument passed to start(). + @result True on success, or false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool handleStart( IOService * provider ); + +/*! @function handleStop + @abstract Quiesce the hardware and stop the driver. + @discussion IOHIDDevice will call this method from stop() to + signal that the hardware should be quiesced and the driver stopped. + A subclass that overrides this method should end its implementation + by calling the version in super. + @param provider The provider argument passed to stop(). */ + + virtual void handleStop( IOService * provider ); + +/*! @function newUserClient + @abstract Handle a request to create a connection for a non kernel + client. + @discussion Create a new IOUserClient, or a subclass of IOUserClient, + to service a connection to a non kernel client. This implementation + will simply call the implementation in IOService to handle the call. + @param owningTask The mach task requesting the connection. + @param security_id A token representing the access level for the task. + @param type A constant specifying the type of connection to be created. + @param properties A dictionary of additional properties for the connection. + @param handler The IOUserClient object returned. + @result The return from IOService::newUserClient() is returned. */ + + virtual IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ); + IOReturn newUserClientGated(task_t owningTask, + void * security_id, + OSDictionary * properties, + IOUserClient ** handler ); + +/*! @function publishProperties + @abstract Publish HID properties to the I/O Kit registry. + @discussion Called by the start() method to fetch and publish all + HID properties to the I/O Kit registry. These properties will allow + the HID Manager to identify all HID device(s) in the system, by + iterating through objects that are subclasses of IOHIDDevice, and + then fetch their published property values. The implementation in + IOHIDDevice will call methods to get each individual HID property, + and subclasses will not normally need to override this method. + @param provider The provider argument passed to start(). + @result True to indicate that all properties were discovered and + published to the registry, false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool publishProperties( IOService * provider ); + +public: + +/*! @function init + @abstract Initialize an IOHIDDevice object. + @discussion Prime the IOHIDDevice object and prepare it to support + a probe() or a start() call. This implementation will simply call + super::init(). + @param A dictionary A property table associated with this IOHIDDevice + instance. + @result True on sucess, or false otherwise. */ + + virtual bool init( OSDictionary * dictionary = 0 ); + +/*! @function start + @abstract Start up the driver using the given provider. + @discussion IOHIDDevice will allocate resources, then call handleStart() + before fetching the report descriptor through newReportDescriptor(), and + publishing HID properties to the registry. Before returning true to + indicate success, registerService() is called to trigger client matching. + Subclasses are recommended to override handleStart(). + @param provider The provider that the driver was matched to, and selected + to run with. + @result True on success, or false otherwise. */ + + virtual bool start( IOService * provider ); + +/*! @function stop + @abstract Called by a provider (during its termination) before detaching + all its clients. + @discussion IOHIDDevice will call handleStop(), then release allocated + resources. Subclasses are recommended to override handleStop(). + @param provider The provider that the driver was started on. */ + + virtual void stop( IOService * provider ); + +/*! @function matchPropertyTable + @abstract Called by the provider during a match + @discussion Compare the properties in the supplied table to this + object's properties. + @param table The property table that this device will match against +*/ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + +/*! @function newTransportString + @abstract Returns a string object that describes the transport + layer used by the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newTransportString() const; + +/*! @function newManufacturerString + @abstract Returns a string object that describes the manufacturer + of the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newManufacturerString() const; + +/*! @function newProductString + @abstract Returns a string object that describes the product + of the HID device. + @result A string object. The caller must decrement the retain count + on the object returned. */ + + virtual OSString * newProductString() const; + +/*! @function newVendorIDNumber + @abstract Returns a number object that describes the vendor ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newVendorIDNumber() const; + +/*! @function newProductIDNumber + @abstract Returns a number object that describes the product ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newProductIDNumber() const; + +/*! @function newVersionNumber + @abstract Returns a number object that describes the version number + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newVersionNumber() const; + +// *** THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString *** +/*! @function newSerialNumber + @abstract THIS HAS BEEN DEPRECATED. PLEASE USE newSerialNumberString. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newSerialNumber() const; + +/*! @function newPrimaryUsageNumber + @abstract Returns a number object that describes the primary usage + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newPrimaryUsageNumber() const; + +/*! @function newPrimaryUsagePageNumber + @abstract Returns a number object that describes the primary usage + page of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + + virtual OSNumber * newPrimaryUsagePageNumber() const; + +/*! @function newReportDescriptor + @abstract Create and return a new memory descriptor that describes the + report descriptor for the HID device. + @discussion A subclass must override this pure virtual function, and + return a memory descriptor that describes the HID report descriptor as + defined by the USB Device Class Definition for Human Interface Devices + Version 1.1 specification. + @param descriptor Pointer to the memory descriptor returned. This + memory descriptor will be released by the caller. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn newReportDescriptor( + IOMemoryDescriptor ** descriptor ) const = 0; + +/*! @function handleReport + @abstract Handle an asynchronous report received from the HID device. + @param report A memory descriptor that describes the report. + @param reportType The type of report. + @param options Options to specify the request. No options are + currently defined, and the default value is 0. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn handleReport( + IOMemoryDescriptor * report, + IOHIDReportType reportType = kIOHIDReportTypeInput, + IOOptionBits options = 0 ); + +/*! @function getReport + @abstract Get a report from the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the memory to store + the report read from the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options ); + +/*! @function setReport + @abstract Send a report to the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the report to send + to the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + +/*! @function getMemoryWithCurrentElementValues + @abstract Get a reference to a memory descriptor that describes the + memory block containing the current HID element values. + @discussion Each HID element that can contribute to an input, output, + or feature report, is assigned an area of memory from a common memory + block allocated by IOHIDDevice. Each element will use its assigned + memory area to store its current value, defined by an IOHIDElementValue + structure. The memory described by the memory descriptor may be mapped + to user space to allow the HID Manager to poll the current element + value without the cost of a user-kernel transition. Subclasses should + not override this method. + @result A reference to a memory descriptor that describes the current + element values, or 0 to indicate a resource shortage. */ + + virtual IOMemoryDescriptor * getMemoryWithCurrentElementValues() const; + +/*! @function registerElement + @abstract A registration function called by a HID element to register + itself, and also to obtain an unique cookie identifier + (unique per device, not unique system-wide). + @discussion An internal data type, an IOHIDElementPrivate, is created to + represent each HID element discovered by parsing the HID report + descriptor. Each element created will call this method to register + itself with its owner (IOHIDDevice), and also to obtain an element + cookie that is used by HID Manager to specify and identify the element. + Subclasses should not override this method. + @param element The element that is requesting registration with its + owner. + @param cookie Pointer to the returned cookie assigned to this element. + @result True on success, or false otherwise. */ + + virtual bool registerElement( IOHIDElementPrivate * element, + IOHIDElementCookie * cookie ); + +/*! @function startEventDelivery + @abstract Start delivering events from a HID element to the event + queue specified. + @discussion Clients of IOHIDDevice may create an IOHIDEventQueue, and + then call this method to register for delivery of events generated by + one or more HID elements to that event queue. Subclasses should not + override this method. + @param queue The event queue that is interested in receiving events + generated by the HID element specified. The retain count on the queue + will be incremented by one. + @param cookie The cookie for a HID element published by the HID device. + @param options Options to specify the request. No options are currently + defined, and the default value is zero. + @result kIOReturnSuccess on success, or kIOReturnBadArgument if the + queue or the cookie argument specified is invalid, or kIOReturnNoMemory + if a resource shortage was encountered. */ + + virtual IOReturn startEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie, + IOOptionBits options = 0 ); + +/*! @function stopEventDelivery + @abstract Stop delivering events from one or more HID elements to the + event queue specified. + @discussion Clients that called startEventDelivery() must eventually + call this method to stop event delivery to its queue from one or more + HID elements. + @param queue The event queue that no longer wishes to receive events + generated by the HID element specified. + @param cookie The cookie for a HID element published by the HID device. + The default value of zero indicates that the queue should be removed from + the event dispatch list of all HID elements published by the HID device. + Subclasses should not override this method. + @result kIOReturnSuccess if the queue was removed from the event dispatch + list for one or more HID elements, or kIOReturnBadArgument if the queue + or the cookie argument specified is invalid, or kIOReturnNotFound if the + queue was not found. */ + + virtual IOReturn stopEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie = 0 ); + +/*! @function checkEventDelivery + @abstract Check whether events from a HID element will be delivered to + the event queue specified. + @param queue The event queue. + @param cookie The cookie for a HID element published by the HID device. + @param isActive Pointer to the return value that is set to true if events + generated by the HID element will be delivered to the queue, or false + otherwise. This return value is set only if kIOReturnSuccess is + returned. + @result kIOReturnSuccess on success, or kIOReturnBadArgument if one or + more of the arguments provided are invalid. */ + + virtual IOReturn checkEventDelivery( IOHIDEventQueue * queue, + IOHIDElementCookie cookie, + bool * isActive ); + +/*! @function updateElementValues + @abstract Updates element values from a HID device via getReport. + @discussion A completion parameter may be added in the future. + @param cookies A list of element cookies who's values need to be + set on the device. + @param cookieCount The number of element cookies. + @result kIOReturnSuccess on success, or an error return otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 0); + virtual IOReturn updateElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1); + +/*! @function postElementValues + @abstract Posts element values to a HID device via setReport. + @discussion A completion parameter may be added in the future. + @param cookies A list of element cookies who's values need to be + set on the device. + @param cookieCount The number of element cookies. + @result kIOReturnSuccess on success, or an error return otherwise. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 1); + virtual IOReturn postElementValues(IOHIDElementCookie * cookies, UInt32 cookieCount = 1); + +/*! @function newSerialNumberString + @abstract Returns a string object that describes the serial number + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 2); + virtual OSString * newSerialNumberString() const; + +/*! @function newLocationIDNumber + @abstract Returns a number object that describes the location ID + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 3); + virtual OSNumber * newLocationIDNumber() const; + +/*! @function getReport + @abstract Get a report from the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the memory to store + the report read from the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @param completionTimeout Specifies an amount of time (in ms) after which + the command will be aborted if the entire command has not been completed. + @param completion Function to call when request completes. If omitted then + getReport() executes synchronously, blocking until the request is complete. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 4); + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion = 0); + +/*! @function setReport + @abstract Send a report to the HID device. + @discussion A completion parameter may be added in the future. + @param report A memory descriptor that describes the report to send + to the HID device. + @param reportType The report type. + @param options The lower 8 bits will represent the Report ID. The + other 24 bits are options to specify the request. + @param completionTimeout Specifies an amount of time (in ms) after which + the command will be aborted if the entire command has not been completed. + @param completion Function to call when request completes. If omitted then + setReport() executes synchronously, blocking until the request is complete. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 5); + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options, + UInt32 completionTimeout, + IOHIDCompletion * completion = 0); + +/*! @function newVendorIDSourceNumber + @abstract Returns a number object that describes the vendor ID + source of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 6); + virtual OSNumber * newVendorIDSourceNumber() const; + +/*! @function newCountryCodeNumber + @abstract Returns a number object that describes the country code + of the HID device. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 7); + virtual OSNumber * newCountryCodeNumber() const; + + +/*! @function handleReportWithTime + @abstract Handle an asynchronous report received from the HID device. + @param timeStamp The timestamp of report. + @param report A memory descriptor that describes the report. + @param reportType The type of report. Currently, only + kIOHIDReportTypeInput report type is handled. + @param options Options to specify the request. No options are + currently defined, and the default value is 0. + @result kIOReturnSuccess on success, or an error return otherwise. */ + + OSMetaClassDeclareReservedUsed(IOHIDDevice, 8); + virtual IOReturn handleReportWithTime( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType = kIOHIDReportTypeInput, + IOOptionBits options = 0); + +/*! @function newReportInterval + @abstract Returns a number object that describes the actual polling + interval of the HID device in microseconds. + @result A number object. The caller must decrement the retain count + on the object returned. */ + OSMetaClassDeclareReservedUsed(IOHIDDevice, 9); + virtual OSNumber * newReportIntervalNumber() const; + + OSMetaClassDeclareReservedUnused(IOHIDDevice, 10); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 11); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 12); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 13); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 14); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 15); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 16); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 17); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 18); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 19); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 20); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 21); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 22); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 23); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 24); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 25); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 26); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 27); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 28); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 29); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 30); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 31); + +#ifndef __ppc__ + OSMetaClassDeclareReservedUnused(IOHIDDevice, 32); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 33); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 34); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 35); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 36); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 37); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 38); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 39); + OSMetaClassDeclareReservedUnused(IOHIDDevice, 40); +#endif + +}; + +#endif /* !_IOKIT_HID_IOHIDDEVICE_H */ diff --git a/i386/include/IOKit/hid/IOHIDElement.h b/i386/include/IOKit/hid/IOHIDElement.h new file mode 100644 index 0000000..f4fbb17 --- /dev/null +++ b/i386/include/IOKit/hid/IOHIDElement.h @@ -0,0 +1,106 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDELEMENT_H +#define _IOKIT_HID_IOHIDELEMENT_H + +#include +#include +#include + +//=========================================================================== +// An object that describes a single HID element. + +class IOHIDElement: public OSObject +{ + OSDeclareAbstractStructors( IOHIDElement ) + + struct ExpansionData { + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +public: + + virtual IOHIDElementCookie getCookie() = 0; + virtual IOHIDElement * getParentElement() = 0; + virtual OSArray * getChildElements() = 0; + virtual IOHIDElementType getType() = 0; + virtual IOHIDElementCollectionType getCollectionType() = 0; + virtual UInt32 getUsagePage() = 0; + virtual UInt32 getUsage() = 0; + virtual UInt32 getLogicalMin() = 0; + virtual UInt32 getLogicalMax() = 0; + virtual UInt32 getPhysicalMin() = 0; + virtual UInt32 getPhysicalMax() = 0; + virtual UInt32 getUnitExponent() = 0; + virtual UInt32 getUnit() = 0; + virtual UInt32 getReportSize() = 0; + virtual UInt32 getReportCount() = 0; + virtual UInt32 getReportID() = 0; + virtual UInt32 getFlags() = 0; + virtual AbsoluteTime getTimeStamp() = 0; + virtual UInt32 getValue() = 0; + virtual OSData * getDataValue() = 0; + virtual void setValue(UInt32 value) = 0; + virtual void setDataValue(OSData * value) = 0; + + OSMetaClassDeclareReservedUnused(IOHIDElement, 0); + OSMetaClassDeclareReservedUnused(IOHIDElement, 1); + OSMetaClassDeclareReservedUnused(IOHIDElement, 2); + OSMetaClassDeclareReservedUnused(IOHIDElement, 3); + OSMetaClassDeclareReservedUnused(IOHIDElement, 4); + OSMetaClassDeclareReservedUnused(IOHIDElement, 5); + OSMetaClassDeclareReservedUnused(IOHIDElement, 6); + OSMetaClassDeclareReservedUnused(IOHIDElement, 7); + OSMetaClassDeclareReservedUnused(IOHIDElement, 8); + OSMetaClassDeclareReservedUnused(IOHIDElement, 9); + OSMetaClassDeclareReservedUnused(IOHIDElement, 10); + OSMetaClassDeclareReservedUnused(IOHIDElement, 11); + OSMetaClassDeclareReservedUnused(IOHIDElement, 12); + OSMetaClassDeclareReservedUnused(IOHIDElement, 13); + OSMetaClassDeclareReservedUnused(IOHIDElement, 14); + OSMetaClassDeclareReservedUnused(IOHIDElement, 15); + OSMetaClassDeclareReservedUnused(IOHIDElement, 16); + OSMetaClassDeclareReservedUnused(IOHIDElement, 17); + OSMetaClassDeclareReservedUnused(IOHIDElement, 18); + OSMetaClassDeclareReservedUnused(IOHIDElement, 19); + OSMetaClassDeclareReservedUnused(IOHIDElement, 20); + OSMetaClassDeclareReservedUnused(IOHIDElement, 21); + OSMetaClassDeclareReservedUnused(IOHIDElement, 22); + OSMetaClassDeclareReservedUnused(IOHIDElement, 23); + OSMetaClassDeclareReservedUnused(IOHIDElement, 24); + OSMetaClassDeclareReservedUnused(IOHIDElement, 25); + OSMetaClassDeclareReservedUnused(IOHIDElement, 26); + OSMetaClassDeclareReservedUnused(IOHIDElement, 27); + OSMetaClassDeclareReservedUnused(IOHIDElement, 28); + OSMetaClassDeclareReservedUnused(IOHIDElement, 29); + OSMetaClassDeclareReservedUnused(IOHIDElement, 30); + OSMetaClassDeclareReservedUnused(IOHIDElement, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDELEMENT_H */ diff --git a/i386/include/IOKit/hid/IOHIDInterface.h b/i386/include/IOKit/hid/IOHIDInterface.h new file mode 100644 index 0000000..54b4230 --- /dev/null +++ b/i386/include/IOKit/hid/IOHIDInterface.h @@ -0,0 +1,252 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDINTERFACE_H +#define _IOKIT_HID_IOHIDINTERFACE_H + +#include +#include + +class IOHIDDevice; + +/*! @class IOHIDInterface : public IOService + @abstract In kernel interface to a HID device. + @discussion +*/ + +class IOHIDInterface: public IOService +{ + OSDeclareDefaultStructors( IOHIDInterface ) + +public: + + /*! @typedef IOHIDInterface::InterruptReportAction + @abstract Callback to handle an asynchronous report received from + the HID device. + @discussion This callback is set when calling IOHIDInterface::open. + @param target Pointer to your data object. + @param timestamp Time when the report was delivered. + @param report A memory descriptor that describes the report. + @param reportType The type of report. + @param reportID The ID of the report. + @param refcon void * pointer to more data. + */ + typedef void (*InterruptReportAction)( + OSObject * target, + AbsoluteTime timestamp, + IOMemoryDescriptor * report, + IOHIDReportType type, + UInt32 reportID, + void * refcon); + + /*! + @typedef IOHIDInterface::CompletionAction + @discussion Function called when HID I/O completes. + @param target + @param refcon + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + */ + + typedef void (*CompletionAction)( + OSObject * target, + void * refcon, + IOReturn status, + UInt32 bufferSizeRemaining); + +private: + IOHIDDevice * _owner; + OSArray * _elementArray; + InterruptReportAction _interruptAction; + void * _interruptRefCon; + OSObject * _interruptTarget; + OSString * _transportString; + OSString * _manufacturerString; + OSString * _productString; + OSString * _serialNumberString; + UInt32 _locationID; + UInt32 _vendorID; + UInt32 _vendorIDSource; + UInt32 _productID; + UInt32 _version; + UInt32 _countryCode; + IOByteCount _maxReportSize[kIOHIDReportTypeCount]; + + struct ExpansionData { + UInt32 reportInterval; + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +protected: + + /*! + @function free + @abstract Free the IOHIDInterface object. + @discussion Release all resources that were previously allocated, + then call super::free() to propagate the call to our superclass. + */ + + virtual void free(); + +public: + + static IOHIDInterface * withElements ( OSArray * elements ); + + /*! + @function init + @abstract Initialize an IOHIDInterface object. + @discussion Prime the IOHIDInterface object and prepare it to support + a probe() or a start() call. This implementation will simply call + super::init(). + @param A dictionary A property table associated with this IOHIDInterface + instance. + @result True on sucess, or false otherwise. + */ + + virtual bool init( OSDictionary * dictionary = 0 ); + + /*! + @function start + @abstract Start up the driver using the given provider. + @discussion IOHIDInterface will allocate resources. Before returning true + to indicate success, registerService() is called to trigger client matching. + @param provider The provider that the driver was matched to, and selected + to run with. + @result True on success, or false otherwise. + */ + + virtual bool start( IOService * provider ); + + /*! + @function matchPropertyTable + @abstract Called by the provider during a match + @discussion Compare the properties in the supplied table to this + object's properties. + @param table The property table that this device will match against + */ + + virtual bool matchPropertyTable( + OSDictionary * table, + SInt32 * score); + + virtual bool open ( + IOService * client, + IOOptionBits options, + InterruptReportAction action, + void * refCon); + + virtual void close( + IOService * client, + IOOptionBits options = 0 ); + + virtual OSString * getTransport (); + virtual UInt32 getLocationID (); + virtual UInt32 getVendorID (); + virtual UInt32 getVendorIDSource (); + virtual UInt32 getProductID (); + virtual UInt32 getVersion (); + virtual UInt32 getCountryCode (); + virtual OSString * getManufacturer (); + virtual OSString * getProduct (); + virtual OSString * getSerialNumber (); + virtual IOByteCount getMaxReportSize (IOHIDReportType type); + + virtual OSArray * createMatchingElements ( + OSDictionary * matching = 0, + IOOptionBits options = 0); + + virtual void handleReport ( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + IOOptionBits options = 0); + + virtual IOReturn setReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0); + + virtual IOReturn getReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0); + + virtual IOReturn setReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0, + UInt32 completionTimeout = 0, + CompletionAction * completion = 0); + + virtual IOReturn getReport ( + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID = 0, + IOOptionBits options = 0, + UInt32 completionTimeout = 0, + CompletionAction * completion = 0); + + OSMetaClassDeclareReservedUsed(IOHIDInterface, 0); + virtual UInt32 getReportInterval (); + + OSMetaClassDeclareReservedUnused(IOHIDInterface, 1); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 2); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 3); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 4); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 5); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 6); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 7); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 8); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 9); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 10); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 11); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 12); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 13); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 14); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 15); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 16); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 17); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 18); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 19); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 20); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 21); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 22); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 23); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 24); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 25); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 26); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 27); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 28); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 29); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 30); + OSMetaClassDeclareReservedUnused(IOHIDInterface, 31); +}; + +#endif /* !_IOKIT_HID_IOHIDINTERFACE_H */ diff --git a/i386/include/IOKit/hid/IOHIDKeys.h b/i386/include/IOKit/hid/IOHIDKeys.h new file mode 100644 index 0000000..a4e3789 --- /dev/null +++ b/i386/include/IOKit/hid/IOHIDKeys.h @@ -0,0 +1,349 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDKEYS_H_ +#define _IOKIT_HID_IOHIDKEYS_H_ + +#include +#include + +__BEGIN_DECLS + +/* The following keys are used to search the IORegistry for HID related services +*/ + +/* This is used to find HID Devices in the IORegistry */ +#define kIOHIDDeviceKey "IOHIDDevice" + +/*! + @defined HID Device Property Keys + @abstract Keys that represent properties of a paticular device. + @discussion Keys that represent properties of a paticular device. Can be added + to your matching dictionary when refining searches for HID devices. +

+ Please note:
+ kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer + rich enough to describe a device's capabilities. Take, for example, a + device that describes both a keyboard and a mouse in the same descriptor. + The previous behavior was to only describe the keyboard behavior with the + primary usage and usage page. Needless to say, this would sometimes cause + a program interested in mice to skip this device when matching. +
+ Thus we have added 3 + additional keys: +
    +
  • kIOHIDDeviceUsageKey
  • +
  • kIOHIDDeviceUsagePageKey
  • +
  • kIOHIDDeviceUsagePairsKey
  • +
+ kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing + key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. + These usage pairs describe all application type collections (behaviors) defined + by the device. +

+ An application intersted in only matching on one criteria would only add the + kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. + If it is interested in a device that has multiple behaviors, the application would + instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his + matching dictionary. +*/ +#define kIOHIDTransportKey "Transport" +#define kIOHIDVendorIDKey "VendorID" +#define kIOHIDVendorIDSourceKey "VendorIDSource" +#define kIOHIDProductIDKey "ProductID" +#define kIOHIDVersionNumberKey "VersionNumber" +#define kIOHIDManufacturerKey "Manufacturer" +#define kIOHIDProductKey "Product" +#define kIOHIDSerialNumberKey "SerialNumber" +#define kIOHIDCountryCodeKey "CountryCode" +#define kIOHIDStandardTypeKey "StandardType" +#define kIOHIDLocationIDKey "LocationID" +#define kIOHIDDeviceUsageKey "DeviceUsage" +#define kIOHIDDeviceUsagePageKey "DeviceUsagePage" +#define kIOHIDDeviceUsagePairsKey "DeviceUsagePairs" +#define kIOHIDPrimaryUsageKey "PrimaryUsage" +#define kIOHIDPrimaryUsagePageKey "PrimaryUsagePage" +#define kIOHIDMaxInputReportSizeKey "MaxInputReportSize" +#define kIOHIDMaxOutputReportSizeKey "MaxOutputReportSize" +#define kIOHIDMaxFeatureReportSizeKey "MaxFeatureReportSize" +#define kIOHIDReportIntervalKey "ReportInterval" +#define kIOHIDReportDescriptorKey "ReportDescriptor" + +/*! + @define kIOHIDElementKey + @abstract Keys that represents an element property. + @discussion Property for a HID Device or element dictionary. + Elements can be heirarchical, so they can contain other elements. +*/ +#define kIOHIDElementKey "Elements" + +/*! + @defined HID Element Dictionary Keys + @abstract Keys that represent properties of a particular elements. + @discussion These keys can also be added to a matching dictionary + when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCookieKey "ElementCookie" +#define kIOHIDElementTypeKey "Type" +#define kIOHIDElementCollectionTypeKey "CollectionType" +#define kIOHIDElementUsageKey "Usage" +#define kIOHIDElementUsagePageKey "UsagePage" +#define kIOHIDElementMinKey "Min" +#define kIOHIDElementMaxKey "Max" +#define kIOHIDElementScaledMinKey "ScaledMin" +#define kIOHIDElementScaledMaxKey "ScaledMax" +#define kIOHIDElementSizeKey "Size" +#define kIOHIDElementReportSizeKey "ReportSize" +#define kIOHIDElementReportCountKey "ReportCount" +#define kIOHIDElementReportIDKey "ReportID" +#define kIOHIDElementIsArrayKey "IsArray" +#define kIOHIDElementIsRelativeKey "IsRelative" +#define kIOHIDElementIsWrappingKey "IsWrapping" +#define kIOHIDElementIsNonLinearKey "IsNonLinear" +#define kIOHIDElementHasPreferredStateKey "HasPreferredState" +#define kIOHIDElementHasNullStateKey "HasNullState" +#define kIOHIDElementFlagsKey "Flags" +#define kIOHIDElementUnitKey "Unit" +#define kIOHIDElementUnitExponentKey "UnitExponent" +#define kIOHIDElementNameKey "Name" +#define kIOHIDElementValueLocationKey "ValueLocation" +#define kIOHIDElementDuplicateIndexKey "DuplicateIndex" +#define kIOHIDElementParentCollectionKey "ParentCollection" + +#ifndef __ppc__ + #define kIOHIDElementVendorSpecificKey "VendorSpecific" +#else + #define kIOHIDElementVendorSpecificKey "VendorSpecifc" +#endif + +/*! + @defined HID Element Match Keys + @abstract Keys used for matching particular elements. + @discussion These keys should only be used with a matching + dictionary when searching for elements via copyMatchingElements. +*/ +#define kIOHIDElementCookieMinKey "ElementCookieMin" +#define kIOHIDElementCookieMaxKey "ElementCookieMax" +#define kIOHIDElementUsageMinKey "UsageMin" +#define kIOHIDElementUsageMaxKey "UsageMax" + +/*! + @defined kIOHIDElementCalibrationMinKey + @abstract The minimum bounds for a calibrated value. +*/ +#define kIOHIDElementCalibrationMinKey "CalibrationMin" + +/*! + @defined kIOHIDElementCalibrationMaxKey + @abstract The maximum bounds for a calibrated value. +*/ +#define kIOHIDElementCalibrationMaxKey "CalibrationMax" + +/*! + @defined kIOHIDElementCalibrationSaturationMinKey + @abstract The mininum tolerance to be used when calibrating a logical element value. + @discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. +*/ +#define kIOHIDElementCalibrationSaturationMinKey "CalibrationSaturationMin" + +/*! + @defined kIOHIDElementCalibrationSaturationMaxKey + @abstract The maximum tolerance to be used when calibrating a logical element value. + @discussion The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. +*/ +#define kIOHIDElementCalibrationSaturationMaxKey "CalibrationSaturationMax" + +/*! + @defined kIOHIDElementCalibrationDeadZoneMinKey + @abstract The minimum bounds near the midpoint of a logical value in which the value is ignored. + @discussion The dead zone property is used to allow for slight differences in the idle value returned by an element. +*/ +#define kIOHIDElementCalibrationDeadZoneMinKey "CalibrationDeadZoneMin" + +/*! + @defined kIOHIDElementCalibrationDeadZoneMinKey + @abstract The maximum bounds near the midpoint of a logical value in which the value is ignored. + @discussion The dead zone property is used to allow for slight differences in the idle value returned by an element. +*/ +#define kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax" + +/*! + @defined kIOHIDElementCalibrationGranularityKey + @abstract The scale or level of detail returned in a calibrated element value. + @discussion Values are rounded off such that if granularity=0.1, values after calibration are 0, 0.1, 0.2, 0.3, etc. +*/ +#define kIOHIDElementCalibrationGranularityKey "CalibrationGranularity" + +/*! + @typedef IOHIDElementCookie + @abstract Abstract data type used as a unique identifier for an element. +*/ +#ifdef __LP64__ + typedef uint32_t IOHIDElementCookie; +#else + typedef void * IOHIDElementCookie; +#endif + +/*! + @typedef IOHIDElementType + @abstract Describes different types of HID elements. + @discussion Used by the IOHIDFamily to identify the type of + element processed. Represented by the key kIOHIDElementTypeKey in the + dictionary describing the element. + @constant kIOHIDElementTypeInput_Misc + Misc input data field or varying size. + @constant kIOHIDElementTypeInput_Button + One bit input data field. + @constant kIOHIDElementTypeInput_Axis + Input data field used to represent an axis. + @constant kIOHIDElementTypeInput_ScanCodes + Input data field used to represent a scan code or usage selector. + @constant kIOHIDElementTypeOutput + Used to represent an output data field in a report. + @constant kIOHIDElementTypeFeature + Describes input and output elements not intended for + consumption by the end user. + @constant kIOHIDElementTypeCollection + Element used to identify a relationship between two or more elements. +*/ +enum IOHIDElementType { + kIOHIDElementTypeInput_Misc = 1, + kIOHIDElementTypeInput_Button = 2, + kIOHIDElementTypeInput_Axis = 3, + kIOHIDElementTypeInput_ScanCodes = 4, + kIOHIDElementTypeOutput = 129, + kIOHIDElementTypeFeature = 257, + kIOHIDElementTypeCollection = 513 +}; +typedef enum IOHIDElementType IOHIDElementType; + +/*! + @typedef IOHIDElementCollectionType + @abstract Describes different types of HID collections. + @discussion Collections identify a relationship between two or more + elements. + @constant kIOHIDElementCollectionTypePhysical + Used for a set of data items that represent data points + collected at one geometric point. + @constant kIOHIDElementCollectionTypeApplication + Identifies item groups serving different purposes in a single device. + @constant kIOHIDElementCollectionTypeLogical + Used when a set of data items form a composite data structure. + @constant kIOHIDElementCollectionTypeReport + Wraps all the fields in a report. + @constant kIOHIDElementCollectionTypeNamedArray + Contains an array of selector usages. + @constant kIOHIDElementCollectionTypeUsageSwitch + Modifies the meaning of the usage it contains. + @constant kIOHIDElementCollectionTypeUsageModifier + Modifies the meaning of the usage attached to the encompassing collection. +*/ +enum IOHIDElementCollectionType{ + kIOHIDElementCollectionTypePhysical = 0x00, + kIOHIDElementCollectionTypeApplication, + kIOHIDElementCollectionTypeLogical, + kIOHIDElementCollectionTypeReport, + kIOHIDElementCollectionTypeNamedArray, + kIOHIDElementCollectionTypeUsageSwitch, + kIOHIDElementCollectionTypeUsageModifier +}; +typedef enum IOHIDElementCollectionType IOHIDElementCollectionType; + + +/*! + @typedef IOHIDReportType + @abstract Describes different type of HID reports. + @discussion Used by the IOHIDFamily to identify the type of + report being processed. + @constant kIOHIDReportTypeInput Input report. + @constant kIOHIDReportTypeOutput Output report. + @constant kIOHIDReportTypeFeature Feature report. +*/ +enum IOHIDReportType{ + kIOHIDReportTypeInput = 0, + kIOHIDReportTypeOutput, + kIOHIDReportTypeFeature, + kIOHIDReportTypeCount +}; +typedef enum IOHIDReportType IOHIDReportType; + +/*! + @typedef IOHIDOptionsType + @abstract Options for opening a device via IOHIDLib. + @constant kIOHIDOptionsTypeNone Default option. + @constant kIOHIDOptionsTypeSeizeDevice Used to open exclusive + communication with the device. This will prevent the system + and other clients from receiving events from the device. +*/ +enum { + kIOHIDOptionsTypeNone = 0x00, + kIOHIDOptionsTypeSeizeDevice = 0x01 +}; +typedef uint32_t IOHIDOptionsType; + + +/*! + @typedef IOHIDQueueOptionsType + @abstract Options for creating a queue via IOHIDLib. + @constant kIOHIDQueueOptionsTypeNone Default option. + @constant kIOHIDQueueOptionsTypeEnqueueAll Force the IOHIDQueue + to enqueue all events, relative or absolute, regardless of change. +*/ +enum { + kIOHIDQueueOptionsTypeNone = 0x00, + kIOHIDQueueOptionsTypeEnqueueAll = 0x01 +}; +typedef uint32_t IOHIDQueueOptionsType; + + +enum { + kIOHIDElementFlagsConstantMask = 0x0001, + kIOHIDElementFlagsVariableMask = 0x0002, + kIOHIDElementFlagsRelativeMask = 0x0004, + kIOHIDElementFlagsWrapMask = 0x0008, + kIOHIDElementFlagsNonLinearMask = 0x0010, + kIOHIDElementFlagsNoPreferredMask = 0x0020, + kIOHIDElementFlagsNullStateMask = 0x0040, + kIOHIDElementFlagsVolativeMask = 0x0080, + kIOHIDElementFlagsBufferedByteMask = 0x0100 +}; +typedef uint32_t IOHIDElementFlags; + +/*! + @typedef IOHIDStandardType + @abstract Type to define what industrial standard the device is referencing. + @constant kIOHIDStandardTypeANSI ANSI. + @constant kIOHIDStandardTypeISO ISO. + @constant kIOHIDStandardTypeJIS JIS. +*/ +enum { + kIOHIDStandardTypeANSI = 0, + kIOHIDStandardTypeISO = 1, + kIOHIDStandardTypeJIS = 2 +}; +typedef uint32_t IOHIDStandardType; + +__END_DECLS + +#endif /* !_IOKIT_HID_IOHIDKEYS_H_ */ diff --git a/i386/include/IOKit/hid/IOHIDUsageTables.h b/i386/include/IOKit/hid/IOHIDUsageTables.h new file mode 100644 index 0000000..ff0fd88 --- /dev/null +++ b/i386/include/IOKit/hid/IOHIDUsageTables.h @@ -0,0 +1,1665 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIDUSAGETABLES_H +#define _IOHIDUSAGETABLES_H + +/* ****************************************************************************************** + * HID Usage Tables + * + * The following constants are from the USB 'HID Usage Tables' specification, revision 1.1rc3 + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum +{ + kHIDPage_Undefined = 0x00, + kHIDPage_GenericDesktop = 0x01, + kHIDPage_Simulation = 0x02, + kHIDPage_VR = 0x03, + kHIDPage_Sport = 0x04, + kHIDPage_Game = 0x05, + /* Reserved 0x06 */ + kHIDPage_KeyboardOrKeypad = 0x07, /* USB Device Class Definition for Human Interface Devices (HID). Note: the usage type for all key codes is Selector (Sel). */ + kHIDPage_LEDs = 0x08, + kHIDPage_Button = 0x09, + kHIDPage_Ordinal = 0x0A, + kHIDPage_Telephony = 0x0B, + kHIDPage_Consumer = 0x0C, + kHIDPage_Digitizer = 0x0D, + /* Reserved 0x0E */ + kHIDPage_PID = 0x0F, /* USB Physical Interface Device definitions for force feedback and related devices. */ + kHIDPage_Unicode = 0x10, + /* Reserved 0x11 - 0x13 */ + kHIDPage_AlphanumericDisplay = 0x14, + /* Reserved 0x15 - 0x7F */ + /* Monitor 0x80 - 0x83 USB Device Class Definition for Monitor Devices */ + /* Power 0x84 - 0x87 USB Device Class Definition for Power Devices */ + kHIDPage_PowerDevice = 0x84, /* Power Device Page */ + kHIDPage_BatterySystem = 0x85, /* Battery System Page */ + /* Reserved 0x88 - 0x8B */ + kHIDPage_BarCodeScanner = 0x8C, /* (Point of Sale) USB Device Class Definition for Bar Code Scanner Devices */ + kHIDPage_WeighingDevice = 0x8D, /* (Point of Sale) USB Device Class Definition for Weighing Devices */ + kHIDPage_Scale = 0x8D, /* (Point of Sale) USB Device Class Definition for Scale Devices */ + kHIDPage_MagneticStripeReader = 0x8E, + /* ReservedPointofSalepages 0x8F */ + kHIDPage_CameraControl = 0x90, /* USB Device Class Definition for Image Class Devices */ + kHIDPage_Arcade = 0x91, /* OAAF Definitions for arcade and coinop related Devices */ + /* Reserved 0x92 - 0xFEFF */ + /* VendorDefined 0xFF00 - 0xFFFF */ + kHIDPage_VendorDefinedStart = 0xFF00 +}; + +/* Undefined Usage for all usage pages */ +enum +{ + kHIDUsage_Undefined = 0x00 +}; + +/* GenericDesktop Page (0x01) */ +enum +{ + kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */ + kHIDUsage_GD_Mouse = 0x02, /* Application Collection */ + /* 0x03 Reserved */ + kHIDUsage_GD_Joystick = 0x04, /* Application Collection */ + kHIDUsage_GD_GamePad = 0x05, /* Application Collection */ + kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */ + kHIDUsage_GD_Keypad = 0x07, /* Application Collection */ + kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */ + /* 0x09 - 0x2F Reserved */ + kHIDUsage_GD_X = 0x30, /* Dynamic Value */ + kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ + kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ + kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ + kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ + kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ + kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */ + kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */ + kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */ + kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */ + kHIDUsage_GD_CountedBuffer = 0x3A, /* Logical Collection */ + kHIDUsage_GD_ByteCount = 0x3B, /* Dynamic Value */ + kHIDUsage_GD_MotionWakeup = 0x3C, /* One-Shot Control */ + kHIDUsage_GD_Start = 0x3D, /* On/Off Control */ + kHIDUsage_GD_Select = 0x3E, /* On/Off Control */ + /* 0x3F Reserved */ + kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ + kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ + kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ + kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ + kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ + kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ + kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ + /* 0x47 - 0x7F Reserved */ + kHIDUsage_GD_SystemControl = 0x80, /* Application Collection */ + kHIDUsage_GD_SystemPowerDown = 0x81, /* One-Shot Control */ + kHIDUsage_GD_SystemSleep = 0x82, /* One-Shot Control */ + kHIDUsage_GD_SystemWakeUp = 0x83, /* One-Shot Control */ + kHIDUsage_GD_SystemContextMenu = 0x84, /* One-Shot Control */ + kHIDUsage_GD_SystemMainMenu = 0x85, /* One-Shot Control */ + kHIDUsage_GD_SystemAppMenu = 0x86, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuHelp = 0x87, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuExit = 0x88, /* One-Shot Control */ + kHIDUsage_GD_SystemMenu = 0x89, /* Selector */ + kHIDUsage_GD_SystemMenuRight = 0x8A, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuLeft = 0x8B, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuUp = 0x8C, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuDown = 0x8D, /* Re-Trigger Control */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_GD_DPadUp = 0x90, /* On/Off Control */ + kHIDUsage_GD_DPadDown = 0x91, /* On/Off Control */ + kHIDUsage_GD_DPadRight = 0x92, /* On/Off Control */ + kHIDUsage_GD_DPadLeft = 0x93, /* On/Off Control */ + /* 0x94 - 0xFFFF Reserved */ + kHIDUsage_GD_Reserved = 0xFFFF +}; + +/* Simulation Page (0x02) */ +/* This section provides detailed descriptions of the usages employed by simulation devices. */ +enum +{ + kHIDUsage_Sim_FlightSimulationDevice = 0x01, /* Application Collection */ + kHIDUsage_Sim_AutomobileSimulationDevice = 0x02, /* Application Collection */ + kHIDUsage_Sim_TankSimulationDevice = 0x03, /* Application Collection */ + kHIDUsage_Sim_SpaceshipSimulationDevice = 0x04, /* Application Collection */ + kHIDUsage_Sim_SubmarineSimulationDevice = 0x05, /* Application Collection */ + kHIDUsage_Sim_SailingSimulationDevice = 0x06, /* Application Collection */ + kHIDUsage_Sim_MotorcycleSimulationDevice = 0x07, /* Application Collection */ + kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection */ + kHIDUsage_Sim_AirplaneSimulationDevice = 0x09, /* Application Collection */ + kHIDUsage_Sim_HelicopterSimulationDevice = 0x0A, /* Application Collection */ + kHIDUsage_Sim_MagicCarpetSimulationDevice = 0x0B, /* Application Collection */ + kHIDUsage_Sim_BicycleSimulationDevice = 0x0C, /* Application Collection */ + /* 0x0D - 0x1F Reserved */ + kHIDUsage_Sim_FlightControlStick = 0x20, /* Application Collection */ + kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */ + kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */ + kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */ + kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */ + kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */ + /* 0x26 - 0xAF Reserved */ + kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */ + kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */ + kHIDUsage_Sim_AntiTorqueControl = 0xB2, /* Dynamic Value */ + kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */ + kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */ + kHIDUsage_Sim_CollectiveControl = 0xB5, /* Dynamic Value */ + kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */ + kHIDUsage_Sim_ElectronicCountermeasures = 0xB7, /* On/Off Control */ + kHIDUsage_Sim_Elevator = 0xB8, /* Dynamic Value */ + kHIDUsage_Sim_ElevatorTrim = 0xB9, /* Dynamic Value */ + kHIDUsage_Sim_Rudder = 0xBA, /* Dynamic Value */ + kHIDUsage_Sim_Throttle = 0xBB, /* Dynamic Value */ + kHIDUsage_Sim_FlightCommunications = 0xBC, /* On/Off Control */ + kHIDUsage_Sim_FlareRelease = 0xBD, /* One-Shot Control */ + kHIDUsage_Sim_LandingGear = 0xBE, /* On/Off Control */ + kHIDUsage_Sim_ToeBrake = 0xBF, /* Dynamic Value */ + kHIDUsage_Sim_Trigger = 0xC0, /* Momentary Control */ + kHIDUsage_Sim_WeaponsArm = 0xC1, /* On/Off Control */ + kHIDUsage_Sim_Weapons = 0xC2, /* Selector */ + kHIDUsage_Sim_WingFlaps = 0xC3, /* Dynamic Value */ + kHIDUsage_Sim_Accelerator = 0xC4, /* Dynamic Value */ + kHIDUsage_Sim_Brake = 0xC5, /* Dynamic Value */ + kHIDUsage_Sim_Clutch = 0xC6, /* Dynamic Value */ + kHIDUsage_Sim_Shifter = 0xC7, /* Dynamic Value */ + kHIDUsage_Sim_Steering = 0xC8, /* Dynamic Value */ + kHIDUsage_Sim_TurretDirection = 0xC9, /* Dynamic Value */ + kHIDUsage_Sim_BarrelElevation = 0xCA, /* Dynamic Value */ + kHIDUsage_Sim_DivePlane = 0xCB, /* Dynamic Value */ + kHIDUsage_Sim_Ballast = 0xCC, /* Dynamic Value */ + kHIDUsage_Sim_BicycleCrank = 0xCD, /* Dynamic Value */ + kHIDUsage_Sim_HandleBars = 0xCE, /* Dynamic Value */ + kHIDUsage_Sim_FrontBrake = 0xCF, /* Dynamic Value */ + kHIDUsage_Sim_RearBrake = 0xD0, /* Dynamic Value */ + /* 0xD1 - 0xFFFF Reserved */ + kHIDUsage_Sim_Reserved = 0xFFFF +}; + +/* VR Page (0x03) */ +/* Virtual Reality controls depend on designators to identify the individual controls. Most of the following are */ +/* usages are applied to the collections of entities that comprise the actual device. */ +enum +{ + kHIDUsage_VR_Belt = 0x01, /* Application Collection */ + kHIDUsage_VR_BodySuit = 0x02, /* Application Collection */ + kHIDUsage_VR_Flexor = 0x03, /* Physical Collection */ + kHIDUsage_VR_Glove = 0x04, /* Application Collection */ + kHIDUsage_VR_HeadTracker = 0x05, /* Physical Collection */ + kHIDUsage_VR_HeadMountedDisplay = 0x06, /* Application Collection */ + kHIDUsage_VR_HandTracker = 0x07, /* Application Collection */ + kHIDUsage_VR_Oculometer = 0x08, /* Application Collection */ + kHIDUsage_VR_Vest = 0x09, /* Application Collection */ + kHIDUsage_VR_AnimatronicDevice = 0x0A, /* Application Collection */ + /* 0x0B - 0x1F Reserved */ + kHIDUsage_VR_StereoEnable = 0x20, /* On/Off Control */ + kHIDUsage_VR_DisplayEnable = 0x21, /* On/Off Control */ + /* 0x22 - 0xFFFF Reserved */ + kHIDUsage_VR_Reserved = 0xFFFF +}; + +/* Sport Page (0x04) */ +enum +{ + kHIDUsage_Sprt_BaseballBat = 0x01, /* Application Collection */ + kHIDUsage_Sprt_GolfClub = 0x02, /* Application Collection */ + kHIDUsage_Sprt_RowingMachine = 0x03, /* Application Collection */ + kHIDUsage_Sprt_Treadmill = 0x04, /* Application Collection */ + /* 0x05 - 0x2F Reserved */ + kHIDUsage_Sprt_Oar = 0x30, /* Dynamic Value */ + kHIDUsage_Sprt_Slope = 0x31, /* Dynamic Value */ + kHIDUsage_Sprt_Rate = 0x32, /* Dynamic Value */ + kHIDUsage_Sprt_StickSpeed = 0x33, /* Dynamic Value */ + kHIDUsage_Sprt_StickFaceAngle = 0x34, /* Dynamic Value */ + kHIDUsage_Sprt_StickHeelOrToe = 0x35, /* Dynamic Value */ + kHIDUsage_Sprt_StickFollowThrough = 0x36, /* Dynamic Value */ + kHIDUsage_Sprt_StickTempo = 0x37, /* Dynamic Value */ + kHIDUsage_Sprt_StickType = 0x38, /* Named Array */ + kHIDUsage_Sprt_StickHeight = 0x39, /* Dynamic Value */ + /* 0x3A - 0x4F Reserved */ + kHIDUsage_Sprt_Putter = 0x50, /* Selector */ + kHIDUsage_Sprt_1Iron = 0x51, /* Selector */ + kHIDUsage_Sprt_2Iron = 0x52, /* Selector */ + kHIDUsage_Sprt_3Iron = 0x53, /* Selector */ + kHIDUsage_Sprt_4Iron = 0x54, /* Selector */ + kHIDUsage_Sprt_5Iron = 0x55, /* Selector */ + kHIDUsage_Sprt_6Iron = 0x56, /* Selector */ + kHIDUsage_Sprt_7Iron = 0x57, /* Selector */ + kHIDUsage_Sprt_8Iron = 0x58, /* Selector */ + kHIDUsage_Sprt_9Iron = 0x59, /* Selector */ + kHIDUsage_Sprt_10Iron = 0x5A, /* Selector */ + kHIDUsage_Sprt_11Iron = 0x5B, /* Selector */ + kHIDUsage_Sprt_SandWedge = 0x5C, /* Selector */ + kHIDUsage_Sprt_LoftWedge = 0x5D, /* Selector */ + kHIDUsage_Sprt_PowerWedge = 0x5E, /* Selector */ + kHIDUsage_Sprt_1Wood = 0x5F, /* Selector */ + kHIDUsage_Sprt_3Wood = 0x60, /* Selector */ + kHIDUsage_Sprt_5Wood = 0x61, /* Selector */ + kHIDUsage_Sprt_7Wood = 0x62, /* Selector */ + kHIDUsage_Sprt_9Wood = 0x63, /* Selector */ + /* 0x64 - 0xFFFF Reserved */ + kHIDUsage_Sprt_Reserved = 0xFFFF +}; + +/* Game Page (0x05) */ +enum +{ + kHIDUsage_Game_3DGameController = 0x01, /* Application Collection */ + kHIDUsage_Game_PinballDevice = 0x02, /* Application Collection */ + kHIDUsage_Game_GunDevice = 0x03, /* Application Collection */ + /* 0x04 - 0x1F Reserved */ + kHIDUsage_Game_PointofView = 0x20, /* Physical Collection */ + kHIDUsage_Game_TurnRightOrLeft = 0x21, /* Dynamic Value */ + kHIDUsage_Game_PitchUpOrDown = 0x22, /* Dynamic Value */ + kHIDUsage_Game_RollRightOrLeft = 0x23, /* Dynamic Value */ + kHIDUsage_Game_MoveRightOrLeft = 0x24, /* Dynamic Value */ + kHIDUsage_Game_MoveForwardOrBackward = 0x25, /* Dynamic Value */ + kHIDUsage_Game_MoveUpOrDown = 0x26, /* Dynamic Value */ + kHIDUsage_Game_LeanRightOrLeft = 0x27, /* Dynamic Value */ + kHIDUsage_Game_LeanForwardOrBackward = 0x28, /* Dynamic Value */ + kHIDUsage_Game_HeightOfPOV = 0x29, /* Dynamic Value */ + kHIDUsage_Game_Flipper = 0x2A, /* Momentary Control */ + kHIDUsage_Game_SecondaryFlipper = 0x2B, /* Momentary Control */ + kHIDUsage_Game_Bump = 0x2C, /* Momentary Control */ + kHIDUsage_Game_NewGame = 0x2D, /* One-Shot Control */ + kHIDUsage_Game_ShootBall = 0x2E, /* One-Shot Control */ + kHIDUsage_Game_Player = 0x2F, /* One-Shot Control */ + kHIDUsage_Game_GunBolt = 0x30, /* On/Off Control */ + kHIDUsage_Game_GunClip = 0x31, /* On/Off Control */ + kHIDUsage_Game_Gun = 0x32, /* Selector */ + kHIDUsage_Game_GunSingleShot = 0x33, /* Selector */ + kHIDUsage_Game_GunBurst = 0x34, /* Selector */ + kHIDUsage_Game_GunAutomatic = 0x35, /* Selector */ + kHIDUsage_Game_GunSafety = 0x36, /* On/Off Control */ + kHIDUsage_Game_GamepadFireOrJump = 0x37, /* Logical Collection */ + kHIDUsage_Game_GamepadTrigger = 0x39, /* Logical Collection */ + /* 0x3A - 0xFFFF Reserved */ + kHIDUsage_Game_Reserved = 0xFFFF +}; + +/* KeyboardOrKeypad Page (0x07) */ +/* This section is the Usage Page for key codes to be used in implementing a USB keyboard. A Boot Keyboard (84-, 101- or 104-key) should at a minimum support all associated usage codes as indicated in the Boot */ +/* column below. */ +/* The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control (0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV). */ +/* Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate otherlanguages. */ +enum +{ + kHIDUsage_KeyboardErrorRollOver = 0x01, /* ErrorRollOver */ + kHIDUsage_KeyboardPOSTFail = 0x02, /* POSTFail */ + kHIDUsage_KeyboardErrorUndefined = 0x03, /* ErrorUndefined */ + kHIDUsage_KeyboardA = 0x04, /* a or A */ + kHIDUsage_KeyboardB = 0x05, /* b or B */ + kHIDUsage_KeyboardC = 0x06, /* c or C */ + kHIDUsage_KeyboardD = 0x07, /* d or D */ + kHIDUsage_KeyboardE = 0x08, /* e or E */ + kHIDUsage_KeyboardF = 0x09, /* f or F */ + kHIDUsage_KeyboardG = 0x0A, /* g or G */ + kHIDUsage_KeyboardH = 0x0B, /* h or H */ + kHIDUsage_KeyboardI = 0x0C, /* i or I */ + kHIDUsage_KeyboardJ = 0x0D, /* j or J */ + kHIDUsage_KeyboardK = 0x0E, /* k or K */ + kHIDUsage_KeyboardL = 0x0F, /* l or L */ + kHIDUsage_KeyboardM = 0x10, /* m or M */ + kHIDUsage_KeyboardN = 0x11, /* n or N */ + kHIDUsage_KeyboardO = 0x12, /* o or O */ + kHIDUsage_KeyboardP = 0x13, /* p or P */ + kHIDUsage_KeyboardQ = 0x14, /* q or Q */ + kHIDUsage_KeyboardR = 0x15, /* r or R */ + kHIDUsage_KeyboardS = 0x16, /* s or S */ + kHIDUsage_KeyboardT = 0x17, /* t or T */ + kHIDUsage_KeyboardU = 0x18, /* u or U */ + kHIDUsage_KeyboardV = 0x19, /* v or V */ + kHIDUsage_KeyboardW = 0x1A, /* w or W */ + kHIDUsage_KeyboardX = 0x1B, /* x or X */ + kHIDUsage_KeyboardY = 0x1C, /* y or Y */ + kHIDUsage_KeyboardZ = 0x1D, /* z or Z */ + kHIDUsage_Keyboard1 = 0x1E, /* 1 or ! */ + kHIDUsage_Keyboard2 = 0x1F, /* 2 or @ */ + kHIDUsage_Keyboard3 = 0x20, /* 3 or # */ + kHIDUsage_Keyboard4 = 0x21, /* 4 or $ */ + kHIDUsage_Keyboard5 = 0x22, /* 5 or % */ + kHIDUsage_Keyboard6 = 0x23, /* 6 or ^ */ + kHIDUsage_Keyboard7 = 0x24, /* 7 or & */ + kHIDUsage_Keyboard8 = 0x25, /* 8 or * */ + kHIDUsage_Keyboard9 = 0x26, /* 9 or ( */ + kHIDUsage_Keyboard0 = 0x27, /* 0 or ) */ + kHIDUsage_KeyboardReturnOrEnter = 0x28, /* Return (Enter) */ + kHIDUsage_KeyboardEscape = 0x29, /* Escape */ + kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, /* Delete (Backspace) */ + kHIDUsage_KeyboardTab = 0x2B, /* Tab */ + kHIDUsage_KeyboardSpacebar = 0x2C, /* Spacebar */ + kHIDUsage_KeyboardHyphen = 0x2D, /* - or _ */ + kHIDUsage_KeyboardEqualSign = 0x2E, /* = or + */ + kHIDUsage_KeyboardOpenBracket = 0x2F, /* [ or { */ + kHIDUsage_KeyboardCloseBracket = 0x30, /* ] or } */ + kHIDUsage_KeyboardBackslash = 0x31, /* \ or | */ + kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ */ + kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : */ + kHIDUsage_KeyboardQuote = 0x34, /* ' or " */ + kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde */ + kHIDUsage_KeyboardComma = 0x36, /* , or < */ + kHIDUsage_KeyboardPeriod = 0x37, /* . or > */ + kHIDUsage_KeyboardSlash = 0x38, /* / or ? */ + kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock */ + kHIDUsage_KeyboardF1 = 0x3A, /* F1 */ + kHIDUsage_KeyboardF2 = 0x3B, /* F2 */ + kHIDUsage_KeyboardF3 = 0x3C, /* F3 */ + kHIDUsage_KeyboardF4 = 0x3D, /* F4 */ + kHIDUsage_KeyboardF5 = 0x3E, /* F5 */ + kHIDUsage_KeyboardF6 = 0x3F, /* F6 */ + kHIDUsage_KeyboardF7 = 0x40, /* F7 */ + kHIDUsage_KeyboardF8 = 0x41, /* F8 */ + kHIDUsage_KeyboardF9 = 0x42, /* F9 */ + kHIDUsage_KeyboardF10 = 0x43, /* F10 */ + kHIDUsage_KeyboardF11 = 0x44, /* F11 */ + kHIDUsage_KeyboardF12 = 0x45, /* F12 */ + kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen */ + kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock */ + kHIDUsage_KeyboardPause = 0x48, /* Pause */ + kHIDUsage_KeyboardInsert = 0x49, /* Insert */ + kHIDUsage_KeyboardHome = 0x4A, /* Home */ + kHIDUsage_KeyboardPageUp = 0x4B, /* Page Up */ + kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward */ + kHIDUsage_KeyboardEnd = 0x4D, /* End */ + kHIDUsage_KeyboardPageDown = 0x4E, /* Page Down */ + kHIDUsage_KeyboardRightArrow = 0x4F, /* Right Arrow */ + kHIDUsage_KeyboardLeftArrow = 0x50, /* Left Arrow */ + kHIDUsage_KeyboardDownArrow = 0x51, /* Down Arrow */ + kHIDUsage_KeyboardUpArrow = 0x52, /* Up Arrow */ + kHIDUsage_KeypadNumLock = 0x53, /* Keypad NumLock or Clear */ + kHIDUsage_KeypadSlash = 0x54, /* Keypad / */ + kHIDUsage_KeypadAsterisk = 0x55, /* Keypad * */ + kHIDUsage_KeypadHyphen = 0x56, /* Keypad - */ + kHIDUsage_KeypadPlus = 0x57, /* Keypad + */ + kHIDUsage_KeypadEnter = 0x58, /* Keypad Enter */ + kHIDUsage_Keypad1 = 0x59, /* Keypad 1 or End */ + kHIDUsage_Keypad2 = 0x5A, /* Keypad 2 or Down Arrow */ + kHIDUsage_Keypad3 = 0x5B, /* Keypad 3 or Page Down */ + kHIDUsage_Keypad4 = 0x5C, /* Keypad 4 or Left Arrow */ + kHIDUsage_Keypad5 = 0x5D, /* Keypad 5 */ + kHIDUsage_Keypad6 = 0x5E, /* Keypad 6 or Right Arrow */ + kHIDUsage_Keypad7 = 0x5F, /* Keypad 7 or Home */ + kHIDUsage_Keypad8 = 0x60, /* Keypad 8 or Up Arrow */ + kHIDUsage_Keypad9 = 0x61, /* Keypad 9 or Page Up */ + kHIDUsage_Keypad0 = 0x62, /* Keypad 0 or Insert */ + kHIDUsage_KeypadPeriod = 0x63, /* Keypad . or Delete */ + kHIDUsage_KeyboardNonUSBackslash = 0x64, /* Non-US \ or | */ + kHIDUsage_KeyboardApplication = 0x65, /* Application */ + kHIDUsage_KeyboardPower = 0x66, /* Power */ + kHIDUsage_KeypadEqualSign = 0x67, /* Keypad = */ + kHIDUsage_KeyboardF13 = 0x68, /* F13 */ + kHIDUsage_KeyboardF14 = 0x69, /* F14 */ + kHIDUsage_KeyboardF15 = 0x6A, /* F15 */ + kHIDUsage_KeyboardF16 = 0x6B, /* F16 */ + kHIDUsage_KeyboardF17 = 0x6C, /* F17 */ + kHIDUsage_KeyboardF18 = 0x6D, /* F18 */ + kHIDUsage_KeyboardF19 = 0x6E, /* F19 */ + kHIDUsage_KeyboardF20 = 0x6F, /* F20 */ + kHIDUsage_KeyboardF21 = 0x70, /* F21 */ + kHIDUsage_KeyboardF22 = 0x71, /* F22 */ + kHIDUsage_KeyboardF23 = 0x72, /* F23 */ + kHIDUsage_KeyboardF24 = 0x73, /* F24 */ + kHIDUsage_KeyboardExecute = 0x74, /* Execute */ + kHIDUsage_KeyboardHelp = 0x75, /* Help */ + kHIDUsage_KeyboardMenu = 0x76, /* Menu */ + kHIDUsage_KeyboardSelect = 0x77, /* Select */ + kHIDUsage_KeyboardStop = 0x78, /* Stop */ + kHIDUsage_KeyboardAgain = 0x79, /* Again */ + kHIDUsage_KeyboardUndo = 0x7A, /* Undo */ + kHIDUsage_KeyboardCut = 0x7B, /* Cut */ + kHIDUsage_KeyboardCopy = 0x7C, /* Copy */ + kHIDUsage_KeyboardPaste = 0x7D, /* Paste */ + kHIDUsage_KeyboardFind = 0x7E, /* Find */ + kHIDUsage_KeyboardMute = 0x7F, /* Mute */ + kHIDUsage_KeyboardVolumeUp = 0x80, /* Volume Up */ + kHIDUsage_KeyboardVolumeDown = 0x81, /* Volume Down */ + kHIDUsage_KeyboardLockingCapsLock = 0x82, /* Locking Caps Lock */ + kHIDUsage_KeyboardLockingNumLock = 0x83, /* Locking Num Lock */ + kHIDUsage_KeyboardLockingScrollLock = 0x84, /* Locking Scroll Lock */ + kHIDUsage_KeypadComma = 0x85, /* Keypad Comma */ + kHIDUsage_KeypadEqualSignAS400 = 0x86, /* Keypad Equal Sign for AS/400 */ + kHIDUsage_KeyboardInternational1 = 0x87, /* International1 */ + kHIDUsage_KeyboardInternational2 = 0x88, /* International2 */ + kHIDUsage_KeyboardInternational3 = 0x89, /* International3 */ + kHIDUsage_KeyboardInternational4 = 0x8A, /* International4 */ + kHIDUsage_KeyboardInternational5 = 0x8B, /* International5 */ + kHIDUsage_KeyboardInternational6 = 0x8C, /* International6 */ + kHIDUsage_KeyboardInternational7 = 0x8D, /* International7 */ + kHIDUsage_KeyboardInternational8 = 0x8E, /* International8 */ + kHIDUsage_KeyboardInternational9 = 0x8F, /* International9 */ + kHIDUsage_KeyboardLANG1 = 0x90, /* LANG1 */ + kHIDUsage_KeyboardLANG2 = 0x91, /* LANG2 */ + kHIDUsage_KeyboardLANG3 = 0x92, /* LANG3 */ + kHIDUsage_KeyboardLANG4 = 0x93, /* LANG4 */ + kHIDUsage_KeyboardLANG5 = 0x94, /* LANG5 */ + kHIDUsage_KeyboardLANG6 = 0x95, /* LANG6 */ + kHIDUsage_KeyboardLANG7 = 0x96, /* LANG7 */ + kHIDUsage_KeyboardLANG8 = 0x97, /* LANG8 */ + kHIDUsage_KeyboardLANG9 = 0x98, /* LANG9 */ + kHIDUsage_KeyboardAlternateErase = 0x99, /* AlternateErase */ + kHIDUsage_KeyboardSysReqOrAttention = 0x9A, /* SysReq/Attention */ + kHIDUsage_KeyboardCancel = 0x9B, /* Cancel */ + kHIDUsage_KeyboardClear = 0x9C, /* Clear */ + kHIDUsage_KeyboardPrior = 0x9D, /* Prior */ + kHIDUsage_KeyboardReturn = 0x9E, /* Return */ + kHIDUsage_KeyboardSeparator = 0x9F, /* Separator */ + kHIDUsage_KeyboardOut = 0xA0, /* Out */ + kHIDUsage_KeyboardOper = 0xA1, /* Oper */ + kHIDUsage_KeyboardClearOrAgain = 0xA2, /* Clear/Again */ + kHIDUsage_KeyboardCrSelOrProps = 0xA3, /* CrSel/Props */ + kHIDUsage_KeyboardExSel = 0xA4, /* ExSel */ + /* 0xA5-0xDF Reserved */ + kHIDUsage_KeyboardLeftControl = 0xE0, /* Left Control */ + kHIDUsage_KeyboardLeftShift = 0xE1, /* Left Shift */ + kHIDUsage_KeyboardLeftAlt = 0xE2, /* Left Alt */ + kHIDUsage_KeyboardLeftGUI = 0xE3, /* Left GUI */ + kHIDUsage_KeyboardRightControl = 0xE4, /* Right Control */ + kHIDUsage_KeyboardRightShift = 0xE5, /* Right Shift */ + kHIDUsage_KeyboardRightAlt = 0xE6, /* Right Alt */ + kHIDUsage_KeyboardRightGUI = 0xE7, /* Right GUI */ + /* 0xE8-0xFFFF Reserved */ + kHIDUsage_Keyboard_Reserved = 0xFFFF +}; + +/* LEDs Page (0x08) */ +/* An LED or indicator is implemented as an On/Off Control (OOF) using the Single button toggle mode, where a value of 1 will turn on the indicator, and a value of 0 will turn it off. The exceptions are described below. */ +enum +{ + kHIDUsage_LED_NumLock = 0x01, /* On/Off Control */ + kHIDUsage_LED_CapsLock = 0x02, /* On/Off Control */ + kHIDUsage_LED_ScrollLock = 0x03, /* On/Off Control */ + kHIDUsage_LED_Compose = 0x04, /* On/Off Control */ + kHIDUsage_LED_Kana = 0x05, /* On/Off Control */ + kHIDUsage_LED_Power = 0x06, /* On/Off Control */ + kHIDUsage_LED_Shift = 0x07, /* On/Off Control */ + kHIDUsage_LED_DoNotDisturb = 0x08, /* On/Off Control */ + kHIDUsage_LED_Mute = 0x09, /* On/Off Control */ + kHIDUsage_LED_ToneEnable = 0x0A, /* On/Off Control */ + kHIDUsage_LED_HighCutFilter = 0x0B, /* On/Off Control */ + kHIDUsage_LED_LowCutFilter = 0x0C, /* On/Off Control */ + kHIDUsage_LED_EqualizerEnable = 0x0D, /* On/Off Control */ + kHIDUsage_LED_SoundFieldOn = 0x0E, /* On/Off Control */ + kHIDUsage_LED_SurroundOn = 0x0F, /* On/Off Control */ + kHIDUsage_LED_Repeat = 0x10, /* On/Off Control */ + kHIDUsage_LED_Stereo = 0x11, /* On/Off Control */ + kHIDUsage_LED_SamplingRateDetect = 0x12, /* On/Off Control */ + kHIDUsage_LED_Spinning = 0x13, /* On/Off Control */ + kHIDUsage_LED_CAV = 0x14, /* On/Off Control */ + kHIDUsage_LED_CLV = 0x15, /* On/Off Control */ + kHIDUsage_LED_RecordingFormatDetect = 0x16, /* On/Off Control */ + kHIDUsage_LED_OffHook = 0x17, /* On/Off Control */ + kHIDUsage_LED_Ring = 0x18, /* On/Off Control */ + kHIDUsage_LED_MessageWaiting = 0x19, /* On/Off Control */ + kHIDUsage_LED_DataMode = 0x1A, /* On/Off Control */ + kHIDUsage_LED_BatteryOperation = 0x1B, /* On/Off Control */ + kHIDUsage_LED_BatteryOK = 0x1C, /* On/Off Control */ + kHIDUsage_LED_BatteryLow = 0x1D, /* On/Off Control */ + kHIDUsage_LED_Speaker = 0x1E, /* On/Off Control */ + kHIDUsage_LED_HeadSet = 0x1F, /* On/Off Control */ + kHIDUsage_LED_Hold = 0x20, /* On/Off Control */ + kHIDUsage_LED_Microphone = 0x21, /* On/Off Control */ + kHIDUsage_LED_Coverage = 0x22, /* On/Off Control */ + kHIDUsage_LED_NightMode = 0x23, /* On/Off Control */ + kHIDUsage_LED_SendCalls = 0x24, /* On/Off Control */ + kHIDUsage_LED_CallPickup = 0x25, /* On/Off Control */ + kHIDUsage_LED_Conference = 0x26, /* On/Off Control */ + kHIDUsage_LED_StandBy = 0x27, /* On/Off Control */ + kHIDUsage_LED_CameraOn = 0x28, /* On/Off Control */ + kHIDUsage_LED_CameraOff = 0x29, /* On/Off Control */ + kHIDUsage_LED_OnLine = 0x2A, /* On/Off Control */ + kHIDUsage_LED_OffLine = 0x2B, /* On/Off Control */ + kHIDUsage_LED_Busy = 0x2C, /* On/Off Control */ + kHIDUsage_LED_Ready = 0x2D, /* On/Off Control */ + kHIDUsage_LED_PaperOut = 0x2E, /* On/Off Control */ + kHIDUsage_LED_PaperJam = 0x2F, /* On/Off Control */ + kHIDUsage_LED_Remote = 0x30, /* On/Off Control */ + kHIDUsage_LED_Forward = 0x31, /* On/Off Control */ + kHIDUsage_LED_Reverse = 0x32, /* On/Off Control */ + kHIDUsage_LED_Stop = 0x33, /* On/Off Control */ + kHIDUsage_LED_Rewind = 0x34, /* On/Off Control */ + kHIDUsage_LED_FastForward = 0x35, /* On/Off Control */ + kHIDUsage_LED_Play = 0x36, /* On/Off Control */ + kHIDUsage_LED_Pause = 0x37, /* On/Off Control */ + kHIDUsage_LED_Record = 0x38, /* On/Off Control */ + kHIDUsage_LED_Error = 0x39, /* On/Off Control */ + kHIDUsage_LED_Usage = 0x3A, /* Selector */ + kHIDUsage_LED_UsageInUseIndicator = 0x3B, /* Usage Switch */ + kHIDUsage_LED_UsageMultiModeIndicator = 0x3C, /* Usage Modifier */ + kHIDUsage_LED_IndicatorOn = 0x3D, /* Selector */ + kHIDUsage_LED_IndicatorFlash = 0x3E, /* Selector */ + kHIDUsage_LED_IndicatorSlowBlink = 0x3F, /* Selector */ + kHIDUsage_LED_IndicatorFastBlink = 0x40, /* Selector */ + kHIDUsage_LED_IndicatorOff = 0x41, /* Selector */ + kHIDUsage_LED_FlashOnTime = 0x42, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOnTime = 0x43, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOffTime = 0x44, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOnTime = 0x45, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOffTime = 0x46, /* Dynamic Value */ + kHIDUsage_LED_UsageIndicatorColor = 0x47, /* Usage Modifier */ + kHIDUsage_LED_IndicatorRed = 0x48, /* Selector */ + kHIDUsage_LED_IndicatorGreen = 0x49, /* Selector */ + kHIDUsage_LED_IndicatorAmber = 0x4A, /* Selector */ + kHIDUsage_LED_GenericIndicator = 0x4B, /* On/Off Control */ + kHIDUsage_LED_SystemSuspend = 0x4C, /* On/Off Control */ + kHIDUsage_LED_ExternalPowerConnected = 0x4D, /* On/Off Control */ + /* 0x4E - 0xFFFF Reserved */ + kHIDUsage_LED_Reserved = 0xFFFF +}; + +/* Button Page (0x09) */ +/* The Button page is the first place an application should look for user selection controls. System graphical user interfaces typically employ a pointer and a set of hierarchical selectors to select, move and otherwise manipulate their environment. For these purposes the following assignment of significance can be applied to the Button usages: */ +/* Button 1, Primary Button. Used for object selecting, dragging, and double click activation. On MacOS, this is the only button. Microsoft operating systems call this a logical left button, because it */ +/* is not necessarily physically located on the left of the pointing device. */ +/* Button 2, Secondary Button. Used by newer graphical user interfaces to browse object properties. Exposed by systems to applications that typically assign application-specific functionality. */ +/* Button 3, Tertiary Button. Optional control. Exposed to applications, but seldom assigned functionality due to prevalence of two- and one-button devices. */ +/* Buttons 4 -55. As the button number increases, its significance as a selector decreases. */ +/* In many ways the assignment of button numbers is similar to the assignment of Effort in Physical descriptors. Button 1 would be used to define the button a finger rests on when the hand is in the at rest position, that is, virtually no effort is required by the user to activate the button. Button values increment as the finger has to stretch to reach a control. See Section 6.2.3, Physical Descriptors, in the HID Specification for methods of further qualifying buttons. */ +enum +{ + kHIDUsage_Button_1 = 0x01, /* (primary/trigger) */ + kHIDUsage_Button_2 = 0x02, /* (secondary) */ + kHIDUsage_Button_3 = 0x03, /* (tertiary) */ + kHIDUsage_Button_4 = 0x04, /* 4th button */ + /* ... */ + kHIDUsage_Button_65535 = 0xFFFF +}; + +/* Ordinal Page (0x0A) */ +/* The Ordinal page allows multiple instances of a control or sets of controls to be declared without requiring individual enumeration in the native usage page. For example, it is not necessary to declare usages of Pointer 1, Pointer 2, and so forth on the Generic Desktop page. When parsed, the ordinal instance number is, in essence, concatenated to the usages attached to the encompassing collection to create Pointer 1, Pointer 2, and so forth. */ +/* For an example, see Section A.5, Multiple Instances of a Control, in Appendix A, Usage Examples. By convention, an Ordinal collection is placed inside the collection for which it is declaring multiple instances. */ +/* Instances do not have to be identical. */ +enum +{ + /* 0x00 Reserved */ + kHIDUsage_Ord_Instance1 = 0x01, /* Usage Modifier */ + kHIDUsage_Ord_Instance2 = 0x02, /* Usage Modifier */ + kHIDUsage_Ord_Instance3 = 0x03, /* Usage Modifier */ + kHIDUsage_Ord_Instance4 = 0x04, /* Usage Modifier */ + kHIDUsage_Ord_Instance65535 = 0xFFFF /* Usage Modifier */ +}; + +/* Telephony Page (0x0B) */ +/* This usage page defines the keytop and control usages for telephony devices. */ +/* Indicators on a phone are handled by wrapping them in LED: Usage In Use Indicator and LED: Usage Selected Indicator usages. For example, a message-indicator LED would be identified by a Telephony: Message usage declared as a Feature or Output in a LED: Usage In Use Indicator collection. */ +/* See Section 14, Consumer Page (0x0C), for audio volume and tone controls. */ +enum +{ + kHIDUsage_Tfon_Phone = 0x01, /* Application Collection */ + kHIDUsage_Tfon_AnsweringMachine = 0x02, /* Application Collection */ + kHIDUsage_Tfon_MessageControls = 0x03, /* Logical Collection */ + kHIDUsage_Tfon_Handset = 0x04, /* Logical Collection */ + kHIDUsage_Tfon_Headset = 0x05, /* Logical Collection */ + kHIDUsage_Tfon_TelephonyKeyPad = 0x06, /* Named Array */ + kHIDUsage_Tfon_ProgrammableButton = 0x07, /* Named Array */ + /* 0x08 - 0x1F Reserved */ + kHIDUsage_Tfon_HookSwitch = 0x20, /* On/Off Control */ + kHIDUsage_Tfon_Flash = 0x21, /* Momentary Control */ + kHIDUsage_Tfon_Feature = 0x22, /* One-Shot Control */ + kHIDUsage_Tfon_Hold = 0x23, /* On/Off Control */ + kHIDUsage_Tfon_Redial = 0x24, /* One-Shot Control */ + kHIDUsage_Tfon_Transfer = 0x25, /* One-Shot Control */ + kHIDUsage_Tfon_Drop = 0x26, /* One-Shot Control */ + kHIDUsage_Tfon_Park = 0x27, /* On/Off Control */ + kHIDUsage_Tfon_ForwardCalls = 0x28, /* On/Off Control */ + kHIDUsage_Tfon_AlternateFunction = 0x29, /* Momentary Control */ + kHIDUsage_Tfon_Line = 0x2A, /* One-Shot Control */ + kHIDUsage_Tfon_SpeakerPhone = 0x2B, /* On/Off Control */ + kHIDUsage_Tfon_Conference = 0x2C, /* On/Off Control */ + kHIDUsage_Tfon_RingEnable = 0x2D, /* On/Off Control */ + kHIDUsage_Tfon_Ring = 0x2E, /* Selector */ + kHIDUsage_Tfon_PhoneMute = 0x2F, /* On/Off Control */ + kHIDUsage_Tfon_CallerID = 0x30, /* Momentary Control */ + /* 0x31 - 0x4F Reserved */ + kHIDUsage_Tfon_SpeedDial = 0x50, /* One-Shot Control */ + kHIDUsage_Tfon_StoreNumber = 0x51, /* One-Shot Control */ + kHIDUsage_Tfon_RecallNumber = 0x52, /* One-Shot Control */ + kHIDUsage_Tfon_PhoneDirectory = 0x53, /* On/Off Control */ + /* 0x54 - 0x6F Reserved */ + kHIDUsage_Tfon_VoiceMail = 0x70, /* On/Off Control */ + kHIDUsage_Tfon_ScreenCalls = 0x71, /* On/Off Control */ + kHIDUsage_Tfon_DoNotDisturb = 0x72, /* On/Off Control */ + kHIDUsage_Tfon_Message = 0x73, /* One-Shot Control */ + kHIDUsage_Tfon_AnswerOnOrOff = 0x74, /* On/Off Control */ + /* 0x75 - 0x8F Reserved */ + kHIDUsage_Tfon_InsideDialTone = 0x90, /* Momentary Control */ + kHIDUsage_Tfon_OutsideDialTone = 0x91, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingTone = 0x92, /* Momentary Control */ + kHIDUsage_Tfon_OutsideRingTone = 0x93, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingTone = 0x94, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingback = 0x95, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingback = 0x96, /* Momentary Control */ + kHIDUsage_Tfon_LineBusyTone = 0x97, /* Momentary Control */ + kHIDUsage_Tfon_ReorderTone = 0x98, /* Momentary Control */ + kHIDUsage_Tfon_CallWaitingTone = 0x99, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone1 = 0x9A, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone2 = 0x9B, /* Momentary Control */ + kHIDUsage_Tfon_TonesOff = 0x9C, /* On/Off Control */ + kHIDUsage_Tfon_OutsideRingback = 0x9D, /* Momentary Control */ + /* 0x9E - 0xAF Reserved */ + kHIDUsage_Tfon_PhoneKey0 = 0xB0, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey1 = 0xB1, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey2 = 0xB2, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey3 = 0xB3, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey4 = 0xB4, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey5 = 0xB5, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey6 = 0xB6, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey7 = 0xB7, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey8 = 0xB8, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey9 = 0xB9, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyStar = 0xBA, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyPound = 0xBB, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyA = 0xBC, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyB = 0xBD, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyC = 0xBE, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyD = 0xBF, /* Selector/One-Shot Control */ + /* 0xC0 - 0xFFFF Reserved */ + kHIDUsage_TFon_Reserved = 0xFFFF +}; + +/* Consumer Page (0x0C) */ +/* All controls on the Consumer page are application-specific. That is, they affect a specific device, not the system as a whole. */ +enum +{ + kHIDUsage_Csmr_ConsumerControl = 0x01, /* Application Collection */ + kHIDUsage_Csmr_NumericKeyPad = 0x02, /* Named Array */ + kHIDUsage_Csmr_ProgrammableButtons = 0x03, /* Named Array */ + /* 0x03 - 0x1F Reserved */ + kHIDUsage_Csmr_Plus10 = 0x20, /* One-Shot Control */ + kHIDUsage_Csmr_Plus100 = 0x21, /* One-Shot Control */ + kHIDUsage_Csmr_AMOrPM = 0x22, /* One-Shot Control */ + /* 0x23 - 0x3F Reserved */ + kHIDUsage_Csmr_Power = 0x30, /* On/Off Control */ + kHIDUsage_Csmr_Reset = 0x31, /* One-Shot Control */ + kHIDUsage_Csmr_Sleep = 0x32, /* One-Shot Control */ + kHIDUsage_Csmr_SleepAfter = 0x33, /* One-Shot Control */ + kHIDUsage_Csmr_SleepMode = 0x34, /* Re-Trigger Control */ + kHIDUsage_Csmr_Illumination = 0x35, /* On/Off Control */ + kHIDUsage_Csmr_FunctionButtons = 0x36, /* Named Array */ + /* 0x37 - 0x3F Reserved */ + kHIDUsage_Csmr_Menu = 0x40, /* On/Off Control */ + kHIDUsage_Csmr_MenuPick = 0x41, /* One-Shot Control */ + kHIDUsage_Csmr_MenuUp = 0x42, /* One-Shot Control */ + kHIDUsage_Csmr_MenuDown = 0x43, /* One-Shot Control */ + kHIDUsage_Csmr_MenuLeft = 0x44, /* One-Shot Control */ + kHIDUsage_Csmr_MenuRight = 0x45, /* One-Shot Control */ + kHIDUsage_Csmr_MenuEscape = 0x46, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueIncrease = 0x47, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueDecrease = 0x48, /* One-Shot Control */ + /* 0x49 - 0x5F Reserved */ + kHIDUsage_Csmr_DataOnScreen = 0x60, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaption = 0x61, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaptionSelect = 0x62, /* Selector */ + kHIDUsage_Csmr_VCROrTV = 0x63, /* On/Off Control */ + kHIDUsage_Csmr_BroadcastMode = 0x64, /* One-Shot Control */ + kHIDUsage_Csmr_Snapshot = 0x65, /* One-Shot Control */ + kHIDUsage_Csmr_Still = 0x66, /* One-Shot Control */ + /* 0x67 - 0x7F Reserved */ + kHIDUsage_Csmr_Selection = 0x80, /* Named Array */ + kHIDUsage_Csmr_Assign = 0x81, /* Selector */ + kHIDUsage_Csmr_ModeStep = 0x82, /* One-Shot Control */ + kHIDUsage_Csmr_RecallLast = 0x83, /* One-Shot Control */ + kHIDUsage_Csmr_EnterChannel = 0x84, /* One-Shot Control */ + kHIDUsage_Csmr_OrderMovie = 0x85, /* One-Shot Control */ + kHIDUsage_Csmr_Channel = 0x86, /* Linear Control */ + kHIDUsage_Csmr_MediaSelection = 0x87, /* Selector */ + kHIDUsage_Csmr_MediaSelectComputer = 0x88, /* Selector */ + kHIDUsage_Csmr_MediaSelectTV = 0x89, /* Selector */ + kHIDUsage_Csmr_MediaSelectWWW = 0x8A, /* Selector */ + kHIDUsage_Csmr_MediaSelectDVD = 0x8B, /* Selector */ + kHIDUsage_Csmr_MediaSelectTelephone = 0x8C, /* Selector */ + kHIDUsage_Csmr_MediaSelectProgramGuide = 0x8D, /* Selector */ + kHIDUsage_Csmr_MediaSelectVideoPhone = 0x8E, /* Selector */ + kHIDUsage_Csmr_MediaSelectGames = 0x8F, /* Selector */ + kHIDUsage_Csmr_MediaSelectMessages = 0x90, /* Selector */ + kHIDUsage_Csmr_MediaSelectCD = 0x91, /* Selector */ + kHIDUsage_Csmr_MediaSelectVCR = 0x92, /* Selector */ + kHIDUsage_Csmr_MediaSelectTuner = 0x93, /* Selector */ + kHIDUsage_Csmr_Quit = 0x94, /* One-Shot Control */ + kHIDUsage_Csmr_Help = 0x95, /* On/Off Control */ + kHIDUsage_Csmr_MediaSelectTape = 0x96, /* Selector */ + kHIDUsage_Csmr_MediaSelectCable = 0x97, /* Selector */ + kHIDUsage_Csmr_MediaSelectSatellite = 0x98, /* Selector */ + kHIDUsage_Csmr_MediaSelectSecurity = 0x99, /* Selector */ + kHIDUsage_Csmr_MediaSelectHome = 0x9A, /* Selector */ + kHIDUsage_Csmr_MediaSelectCall = 0x9B, /* Selector */ + kHIDUsage_Csmr_ChannelIncrement = 0x9C, /* One-Shot Control */ + kHIDUsage_Csmr_ChannelDecrement = 0x9D, /* One-Shot Control */ + kHIDUsage_Csmr_Media = 0x9E, /* Selector */ + /* 0x9F Reserved */ + kHIDUsage_Csmr_VCRPlus = 0xA0, /* One-Shot Control */ + kHIDUsage_Csmr_Once = 0xA1, /* One-Shot Control */ + kHIDUsage_Csmr_Daily = 0xA2, /* One-Shot Control */ + kHIDUsage_Csmr_Weekly = 0xA3, /* One-Shot Control */ + kHIDUsage_Csmr_Monthly = 0xA4, /* One-Shot Control */ + /* 0xA5 - 0xAF Reserved */ + kHIDUsage_Csmr_Play = 0xB0, /* On/Off Control */ + kHIDUsage_Csmr_Pause = 0xB1, /* On/Off Control */ + kHIDUsage_Csmr_Record = 0xB2, /* On/Off Control */ + kHIDUsage_Csmr_FastForward = 0xB3, /* On/Off Control */ + kHIDUsage_Csmr_Rewind = 0xB4, /* On/Off Control */ + kHIDUsage_Csmr_ScanNextTrack = 0xB5, /* One-Shot Control */ + kHIDUsage_Csmr_ScanPreviousTrack = 0xB6, /* One-Shot Control */ + kHIDUsage_Csmr_Stop = 0xB7, /* One-Shot Control */ + kHIDUsage_Csmr_Eject = 0xB8, /* One-Shot Control */ + kHIDUsage_Csmr_RandomPlay = 0xB9, /* On/Off Control */ + kHIDUsage_Csmr_SelectDisc = 0xBA, /* Named Array */ + kHIDUsage_Csmr_EnterDisc = 0xBB, /* Momentary Control */ + kHIDUsage_Csmr_Repeat = 0xBC, /* One-Shot Control */ + kHIDUsage_Csmr_Tracking = 0xBD, /* Linear Control */ + kHIDUsage_Csmr_TrackNormal = 0xBE, /* One-Shot Control */ + kHIDUsage_Csmr_SlowTracking = 0xBF, /* Linear Control */ + kHIDUsage_Csmr_FrameForward = 0xC0, /* Re-Trigger Control */ + kHIDUsage_Csmr_FrameBack = 0xC1, /* Re-Trigger Control */ + kHIDUsage_Csmr_Mark = 0xC2, /* One-Shot Control */ + kHIDUsage_Csmr_ClearMark = 0xC3, /* One-Shot Control */ + kHIDUsage_Csmr_RepeatFromMark = 0xC4, /* On/Off Control */ + kHIDUsage_Csmr_ReturnToMark = 0xC5, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkForward = 0xC6, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkBackwards = 0xC7, /* One-Shot Control */ + kHIDUsage_Csmr_CounterReset = 0xC8, /* One-Shot Control */ + kHIDUsage_Csmr_ShowCounter = 0xC9, /* One-Shot Control */ + kHIDUsage_Csmr_TrackingIncrement = 0xCA, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrackingDecrement = 0xCB, /* Re-Trigger Control */ + kHIDUsage_Csmr_StopOrEject = 0xCC, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrPause = 0xCD, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrSkip = 0xCE, /* One-Shot Control */ + /* 0xCF - 0xDF Reserved */ + kHIDUsage_Csmr_Volume = 0xE0, /* Linear Control */ + kHIDUsage_Csmr_Balance = 0xE1, /* Linear Control */ + kHIDUsage_Csmr_Mute = 0xE2, /* On/Off Control */ + kHIDUsage_Csmr_Bass = 0xE3, /* Linear Control */ + kHIDUsage_Csmr_Treble = 0xE4, /* Linear Control */ + kHIDUsage_Csmr_BassBoost = 0xE5, /* On/Off Control */ + kHIDUsage_Csmr_SurroundMode = 0xE6, /* One-Shot Control */ + kHIDUsage_Csmr_Loudness = 0xE7, /* On/Off Control */ + kHIDUsage_Csmr_MPX = 0xE8, /* On/Off Control */ + kHIDUsage_Csmr_VolumeIncrement = 0xE9, /* Re-Trigger Control */ + kHIDUsage_Csmr_VolumeDecrement = 0xEA, /* Re-Trigger Control */ + /* 0xEB - 0xEF Reserved */ + kHIDUsage_Csmr_Speed = 0xF0, /* Selector */ + kHIDUsage_Csmr_PlaybackSpeed = 0xF1, /* Named Array */ + kHIDUsage_Csmr_StandardPlay = 0xF2, /* Selector */ + kHIDUsage_Csmr_LongPlay = 0xF3, /* Selector */ + kHIDUsage_Csmr_ExtendedPlay = 0xF4, /* Selector */ + kHIDUsage_Csmr_Slow = 0xF5, /* One-Shot Control */ + /* 0xF6 - 0xFF Reserved */ + kHIDUsage_Csmr_FanEnable = 0x100, /* On/Off Control */ + kHIDUsage_Csmr_FanSpeed = 0x101, /* Linear Control */ + kHIDUsage_Csmr_LightEnable = 0x102, /* On/Off Control */ + kHIDUsage_Csmr_LightIlluminationLevel = 0x103, /* Linear Control */ + kHIDUsage_Csmr_ClimateControlEnable = 0x104, /* On/Off Control */ + kHIDUsage_Csmr_RoomTemperature = 0x105, /* Linear Control */ + kHIDUsage_Csmr_SecurityEnable = 0x106, /* On/Off Control */ + kHIDUsage_Csmr_FireAlarm = 0x107, /* One-Shot Control */ + kHIDUsage_Csmr_PoliceAlarm = 0x108, /* One-Shot Control */ + /* 0x109 - 0x14F Reserved */ + kHIDUsage_Csmr_BalanceRight = 0x150, /* Re-Trigger Control */ + kHIDUsage_Csmr_BalanceLeft = 0x151, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassIncrement = 0x152, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassDecrement = 0x153, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleIncrement = 0x154, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleDecrement = 0x155, /* Re-Trigger Control */ + /* 0x156 - 0x15F Reserved */ + kHIDUsage_Csmr_SpeakerSystem = 0x160, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLeft = 0x161, /* Logical Collection */ + kHIDUsage_Csmr_ChannelRight = 0x162, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenter = 0x163, /* Logical Collection */ + kHIDUsage_Csmr_ChannelFront = 0x164, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenterFront = 0x165, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSide = 0x166, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSurround = 0x167, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLowFrequencyEnhancement = 0x168, /* Logical Collection */ + kHIDUsage_Csmr_ChannelTop = 0x169, /* Logical Collection */ + kHIDUsage_Csmr_ChannelUnknown = 0x16A, /* Logical Collection */ + /* 0x16B - 0x16F Reserved */ + kHIDUsage_Csmr_SubChannel = 0x170, /* Linear Control */ + kHIDUsage_Csmr_SubChannelIncrement = 0x171, /* One-Shot Control */ + kHIDUsage_Csmr_SubChannelDecrement = 0x172, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioIncrement = 0x173, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioDecrement = 0x174, /* One-Shot Control */ + /* 0x175 - 0x17F Reserved */ + kHIDUsage_Csmr_ApplicationLaunchButtons = 0x180, /* Named Array */ + kHIDUsage_Csmr_ALLaunchButtonConfigurationTool = 0x181, /* Selector */ + kHIDUsage_Csmr_ALProgrammableButtonConfiguration = 0x182, /* Selector */ + kHIDUsage_Csmr_ALConsumerControlConfiguration = 0x183, /* Selector */ + kHIDUsage_Csmr_ALWordProcessor = 0x184, /* Selector */ + kHIDUsage_Csmr_ALTextEditor = 0x185, /* Selector */ + kHIDUsage_Csmr_ALSpreadsheet = 0x186, /* Selector */ + kHIDUsage_Csmr_ALGraphicsEditor = 0x187, /* Selector */ + kHIDUsage_Csmr_ALPresentationApp = 0x188, /* Selector */ + kHIDUsage_Csmr_ALDatabaseApp = 0x189, /* Selector */ + kHIDUsage_Csmr_ALEmailReader = 0x18A, /* Selector */ + kHIDUsage_Csmr_ALNewsreader = 0x18B, /* Selector */ + kHIDUsage_Csmr_ALVoicemail = 0x18C, /* Selector */ + kHIDUsage_Csmr_ALContactsOrAddressBook = 0x18D, /* Selector */ + kHIDUsage_Csmr_ALCalendarOrSchedule = 0x18E, /* Selector */ + kHIDUsage_Csmr_ALTaskOrProjectManager = 0x18F, /* Selector */ + kHIDUsage_Csmr_ALLogOrJournalOrTimecard = 0x190, /* Selector */ + kHIDUsage_Csmr_ALCheckbookOrFinance = 0x191, /* Selector */ + kHIDUsage_Csmr_ALCalculator = 0x192, /* Selector */ + kHIDUsage_Csmr_ALAOrVCaptureOrPlayback = 0x193, /* Selector */ + kHIDUsage_Csmr_ALLocalMachineBrowser = 0x194, /* Selector */ + kHIDUsage_Csmr_ALLANOrWANBrowser = 0x195, /* Selector */ + kHIDUsage_Csmr_ALInternetBrowser = 0x196, /* Selector */ + kHIDUsage_Csmr_ALRemoteNetworkingOrISPConnect = 0x197, /* Selector */ + kHIDUsage_Csmr_ALNetworkConference = 0x198, /* Selector */ + kHIDUsage_Csmr_ALNetworkChat = 0x199, /* Selector */ + kHIDUsage_Csmr_ALTelephonyOrDialer = 0x19A, /* Selector */ + kHIDUsage_Csmr_ALLogon = 0x19B, /* Selector */ + kHIDUsage_Csmr_ALLogoff = 0x19C, /* Selector */ + kHIDUsage_Csmr_ALLogonOrLogoff = 0x19D, /* Selector */ + kHIDUsage_Csmr_ALTerminalLockOrScreensaver = 0x19E, /* Selector */ + kHIDUsage_Csmr_ALControlPanel = 0x19F, /* Selector */ + kHIDUsage_Csmr_ALCommandLineProcessorOrRun = 0x1A0, /* Selector */ + kHIDUsage_Csmr_ALProcessOrTaskManager = 0x1A1, /* Selector */ + kHIDUsage_Csmr_AL = 0x1A2, /* Selector */ + kHIDUsage_Csmr_ALNextTaskOrApplication = 0x1A3, /* Selector */ + kHIDUsage_Csmr_ALPreviousTaskOrApplication = 0x1A4, /* Selector */ + kHIDUsage_Csmr_ALPreemptiveHaltTaskOrApplication = 0x1A5, /* Selector */ + kHIDUsage_Csmr_ALIntegratedHelpCenter = 0x1A6, /* Selector */ + kHIDUsage_Csmr_ALDocuments = 0x1A7, /* Selector */ + kHIDUsage_Csmr_ALThesaurus = 0x1A8, /* Selector */ + kHIDUsage_Csmr_ALDictionary = 0x1A9, /* Selector */ + kHIDUsage_Csmr_ALDesktop = 0x1AA, /* Selector */ + kHIDUsage_Csmr_ALSpellCheck = 0x1AB, /* Selector */ + kHIDUsage_Csmr_ALGrammerCheck = 0x1AC, /* Selector */ + kHIDUsage_Csmr_ALWirelessStatus = 0x1AD, /* Selector */ + kHIDUsage_Csmr_ALKeyboardLayout = 0x1AE, /* Selector */ + kHIDUsage_Csmr_ALVirusProtection = 0x1AF, /* Selector */ + kHIDUsage_Csmr_ALEncryption = 0x1B0, /* Selector */ + kHIDUsage_Csmr_ALScreenSaver = 0x1B1, /* Selector */ + kHIDUsage_Csmr_ALAlarms = 0x1B2, /* Selector */ + kHIDUsage_Csmr_ALClock = 0x1B3, /* Selector */ + kHIDUsage_Csmr_ALFileBrowser = 0x1B4, /* Selector */ + kHIDUsage_Csmr_ALPowerStatus = 0x1B5, /* Selector */ + /* 0x1A6 - 0x1FF Reserved */ + kHIDUsage_Csmr_GenericGUIApplicationControls = 0x200, /* Named Array */ + kHIDUsage_Csmr_ACNew = 0x201, /* Selector */ + kHIDUsage_Csmr_ACOpen = 0x202, /* Selector */ + kHIDUsage_Csmr_ACClose = 0x203, /* Selector */ + kHIDUsage_Csmr_ACExit = 0x204, /* Selector */ + kHIDUsage_Csmr_ACMaximize = 0x205, /* Selector */ + kHIDUsage_Csmr_ACMinimize = 0x206, /* Selector */ + kHIDUsage_Csmr_ACSave = 0x207, /* Selector */ + kHIDUsage_Csmr_ACPrint = 0x208, /* Selector */ + kHIDUsage_Csmr_ACProperties = 0x209, /* Selector */ + kHIDUsage_Csmr_ACUndo = 0x21A, /* Selector */ + kHIDUsage_Csmr_ACCopy = 0x21B, /* Selector */ + kHIDUsage_Csmr_ACCut = 0x21C, /* Selector */ + kHIDUsage_Csmr_ACPaste = 0x21D, /* Selector */ + kHIDUsage_Csmr_AC = 0x21E, /* Selector */ + kHIDUsage_Csmr_ACFind = 0x21F, /* Selector */ + kHIDUsage_Csmr_ACFindandReplace = 0x220, /* Selector */ + kHIDUsage_Csmr_ACSearch = 0x221, /* Selector */ + kHIDUsage_Csmr_ACGoTo = 0x222, /* Selector */ + kHIDUsage_Csmr_ACHome = 0x223, /* Selector */ + kHIDUsage_Csmr_ACBack = 0x224, /* Selector */ + kHIDUsage_Csmr_ACForward = 0x225, /* Selector */ + kHIDUsage_Csmr_ACStop = 0x226, /* Selector */ + kHIDUsage_Csmr_ACRefresh = 0x227, /* Selector */ + kHIDUsage_Csmr_ACPreviousLink = 0x228, /* Selector */ + kHIDUsage_Csmr_ACNextLink = 0x229, /* Selector */ + kHIDUsage_Csmr_ACBookmarks = 0x22A, /* Selector */ + kHIDUsage_Csmr_ACHistory = 0x22B, /* Selector */ + kHIDUsage_Csmr_ACSubscriptions = 0x22C, /* Selector */ + kHIDUsage_Csmr_ACZoomIn = 0x22D, /* Selector */ + kHIDUsage_Csmr_ACZoomOut = 0x22E, /* Selector */ + kHIDUsage_Csmr_ACZoom = 0x22F, /* Selector */ + kHIDUsage_Csmr_ACFullScreenView = 0x230, /* Selector */ + kHIDUsage_Csmr_ACNormalView = 0x231, /* Selector */ + kHIDUsage_Csmr_ACViewToggle = 0x232, /* Selector */ + kHIDUsage_Csmr_ACScrollUp = 0x233, /* Selector */ + kHIDUsage_Csmr_ACScrollDown = 0x234, /* Selector */ + kHIDUsage_Csmr_ACScroll = 0x235, /* Selector */ + kHIDUsage_Csmr_ACPanLeft = 0x236, /* Selector */ + kHIDUsage_Csmr_ACPanRight = 0x237, /* Selector */ + kHIDUsage_Csmr_ACPan = 0x238, /* Selector */ + kHIDUsage_Csmr_ACNewWindow = 0x239, /* Selector */ + kHIDUsage_Csmr_ACTileHorizontally = 0x23A, /* Selector */ + kHIDUsage_Csmr_ACTileVertically = 0x23B, /* Selector */ + kHIDUsage_Csmr_ACFormat = 0x23C, /* Selector */ + /* 0x23D - 0xFFFF Reserved */ + kHIDUsage_Csmr_Reserved = 0xFFFF +}; + +/* Physical Interface Device Page (0x0F) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_PID_PhysicalInterfaceDevice = 0x01, /* CA - A collection of PID usages */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_PID_Normal = 0x20, /* DV - A force applied perpendicular to the surface of an object */ + kHIDUsage_PID_SetEffectReport = 0x21, /* XXX */ + kHIDUsage_PID_EffectBlockIndex = 0x22, /* XXX */ + kHIDUsage_PID_ParamBlockOffset = 0x23, /* XXX */ + kHIDUsage_PID_ROM_Flag = 0x24, /* XXX */ + kHIDUsage_PID_EffectType = 0x25, /* XXX */ + kHIDUsage_PID_ET_ConstantForce = 0x26, /* XXX */ + kHIDUsage_PID_ET_Ramp = 0x27, /* XXX */ + kHIDUsage_PID_ET_CustomForceData = 0x28, /* XXX */ + /* 0x29 - 0x2F Reserved */ + kHIDUsage_PID_ET_Square = 0x30, /* XXX */ + kHIDUsage_PID_ET_Sine = 0x31, /* XXX */ + kHIDUsage_PID_ET_Triangle = 0x32, /* XXX */ + kHIDUsage_PID_ET_SawtoothUp = 0x33, /* XXX */ + kHIDUsage_PID_ET_SawtoothDown = 0x34, /* XXX */ + /* 0x35 - 0x3F Reserved */ + kHIDUsage_PID_ET_Spring = 0x40, /* XXX */ + kHIDUsage_PID_ET_Damper = 0x41, /* XXX */ + kHIDUsage_PID_ET_Inertia = 0x42, /* XXX */ + kHIDUsage_PID_ET_Friction = 0x43, /* XXX */ + /* 0x44 - 0x4F Reserved */ + kHIDUsage_PID_Duration = 0x50, /* XXX */ + kHIDUsage_PID_SamplePeriod = 0x51, /* XXX */ + kHIDUsage_PID_Gain = 0x52, /* XXX */ + kHIDUsage_PID_TriggerButton = 0x53, /* XXX */ + kHIDUsage_PID_TriggerRepeatInterval = 0x54, /* XXX */ + kHIDUsage_PID_AxesEnable = 0x55, /* XXX */ + kHIDUsage_PID_DirectionEnable = 0x56, /* XXX */ + kHIDUsage_PID_Direction = 0x57, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockOffset = 0x58, /* XXX */ + kHIDUsage_PID_BlockType = 0x59, /* XXX */ + kHIDUsage_PID_SetEnvelopeReport = 0x5A, /* XXX */ + kHIDUsage_PID_AttackLevel = 0x5B, /* XXX */ + kHIDUsage_PID_AttackTime = 0x5C, /* XXX */ + kHIDUsage_PID_FadeLevel = 0x5D, /* XXX */ + kHIDUsage_PID_FadeTime = 0x5E, /* XXX */ + kHIDUsage_PID_SetConditionReport = 0x5F, /* XXX */ + + kHIDUsage_PID_CP_Offset = 0x60, /* XXX */ + kHIDUsage_PID_PositiveCoefficient = 0x61, /* XXX */ + kHIDUsage_PID_NegativeCoefficient = 0x62, /* XXX */ + kHIDUsage_PID_PositiveSaturation = 0x63, /* XXX */ + kHIDUsage_PID_NegativeSaturation = 0x64, /* XXX */ + kHIDUsage_PID_DeadBand = 0x65, /* XXX */ + kHIDUsage_PID_DownloadForceSample = 0x66, /* XXX */ + kHIDUsage_PID_IsochCustomForceEnable = 0x67, /* XXX */ + kHIDUsage_PID_CustomForceDataReport = 0x68, /* XXX */ + kHIDUsage_PID_CustomForceData = 0x69, /* XXX */ + kHIDUsage_PID_CustomForceVendorDefinedData = 0x6A, /* XXX */ + kHIDUsage_PID_SetCustomForceReport = 0x6B, /* XXX */ + kHIDUsage_PID_CustomForceDataOffset = 0x6C, /* XXX */ + kHIDUsage_PID_SampleCount = 0x6D, /* XXX */ + kHIDUsage_PID_SetPeriodicReport = 0x6E, /* XXX */ + kHIDUsage_PID_Offset = 0x6F, /* XXX */ + + kHIDUsage_PID_Magnitude = 0x70, /* XXX */ + kHIDUsage_PID_Phase = 0x71, /* XXX */ + kHIDUsage_PID_Period = 0x72, /* XXX */ + kHIDUsage_PID_SetConstantForceReport = 0x73, /* XXX */ + kHIDUsage_PID_SetRampForceReport = 0x74, /* XXX */ + kHIDUsage_PID_RampStart = 0x75, /* XXX */ + kHIDUsage_PID_RampEnd = 0x76, /* XXX */ + kHIDUsage_PID_EffectOperationReport = 0x77, /* XXX */ + kHIDUsage_PID_EffectOperation = 0x78, /* XXX */ + kHIDUsage_PID_OpEffectStart = 0x79, /* XXX */ + kHIDUsage_PID_OpEffectStartSolo = 0x7A, /* XXX */ + kHIDUsage_PID_OpEffectStop = 0x7B, /* XXX */ + kHIDUsage_PID_LoopCount = 0x7C, /* XXX */ + kHIDUsage_PID_DeviceGainReport = 0x7D, /* XXX */ + kHIDUsage_PID_DeviceGain = 0x7E, /* XXX */ + kHIDUsage_PID_PoolReport = 0x7F, /* XXX */ + + kHIDUsage_PID_RAM_PoolSize = 0x80, /* XXX */ + kHIDUsage_PID_ROM_PoolSize = 0x81, /* XXX */ + kHIDUsage_PID_ROM_EffectBlockCount = 0x82, /* XXX */ + kHIDUsage_PID_SimultaneousEffectsMax = 0x83, /* XXX */ + kHIDUsage_PID_PoolAlignment = 0x84, /* XXX */ + kHIDUsage_PID_PoolMoveReport = 0x85, /* XXX */ + kHIDUsage_PID_MoveSource = 0x86, /* XXX */ + kHIDUsage_PID_MoveDestination = 0x87, /* XXX */ + kHIDUsage_PID_MoveLength = 0x88, /* XXX */ + kHIDUsage_PID_BlockLoadReport = 0x89, /* XXX */ + /* 0x8A Reserved */ + kHIDUsage_PID_BlockLoadStatus = 0x8B, /* XXX */ + kHIDUsage_PID_BlockLoadSuccess = 0x8C, /* XXX */ + kHIDUsage_PID_BlockLoadFull = 0x8D, /* XXX */ + kHIDUsage_PID_BlockLoadError = 0x8E, /* XXX */ + kHIDUsage_PID_BlockHandle = 0x8F, /* XXX */ + + kHIDUsage_PID_BlockFreeReport = 0x90, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockHandle = 0x91, /* XXX */ + kHIDUsage_PID_StateReport = 0x92, /* XXX */ + /* 0x93 Reserved */ + kHIDUsage_PID_EffectPlaying = 0x94, /* XXX */ + kHIDUsage_PID_DeviceControlReport = 0x95, /* XXX */ + kHIDUsage_PID_DeviceControl = 0x96, /* XXX */ + kHIDUsage_PID_DC_EnableActuators = 0x97, /* XXX */ + kHIDUsage_PID_DC_DisableActuators = 0x98, /* XXX */ + kHIDUsage_PID_DC_StopAllEffects = 0x99, /* XXX */ + kHIDUsage_PID_DC_DeviceReset = 0x9A, /* XXX */ + kHIDUsage_PID_DC_DevicePause = 0x9B, /* XXX */ + kHIDUsage_PID_DC_DeviceContinue = 0x9C, /* XXX */ + /* 0x9d - 0x9E Reserved */ + kHIDUsage_PID_DevicePaused = 0x9F, /* XXX */ + + kHIDUsage_PID_ActuatorsEnabled = 0xA0, /* XXX */ + /* 0xA1 - 0xA3 Reserved */ + kHIDUsage_PID_SafetySwitch = 0xA4, /* XXX */ + kHIDUsage_PID_ActuatorOverrideSwitch = 0xA5, /* XXX */ + kHIDUsage_PID_ActuatorPower = 0xA6, /* XXX */ + kHIDUsage_PID_StartDelay = 0xA7, /* XXX */ + kHIDUsage_PID_ParameterBlockSize = 0xA8, /* XXX */ + kHIDUsage_PID_DeviceManagedPool = 0xA9, /* XXX */ + kHIDUsage_PID_SharedParameterBlocks = 0xAA, /* XXX */ + kHIDUsage_PID_CreateNewEffectReport = 0xAB, /* XXX */ + kHIDUsage_PID_RAM_PoolAvailable = 0xAC, /* XXX */ + /* 0xAD - 0xFFFF Reserved */ + kHIDUsage_PID_Reserved = 0xFFFF +}; + +/* Digitizer Page (0x0D) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_Dig_Digitizer = 0x01, /* Application Collection */ + kHIDUsage_Dig_Pen = 0x02, /* Application Collection */ + kHIDUsage_Dig_LightPen = 0x03, /* Application Collection */ + kHIDUsage_Dig_TouchScreen = 0x04, /* Application Collection */ + kHIDUsage_Dig_TouchPad = 0x05, /* Application Collection */ + kHIDUsage_Dig_WhiteBoard = 0x06, /* Application Collection */ + kHIDUsage_Dig_CoordinateMeasuringMachine = 0x07, /* Application Collection */ + kHIDUsage_Dig_3DDigitizer = 0x08, /* Application Collection */ + kHIDUsage_Dig_StereoPlotter = 0x09, /* Application Collection */ + kHIDUsage_Dig_ArticulatedArm = 0x0A, /* Application Collection */ + kHIDUsage_Dig_Armature = 0x0B, /* Application Collection */ + kHIDUsage_Dig_MultiplePointDigitizer = 0x0C, /* Application Collection */ + kHIDUsage_Dig_FreeSpaceWand = 0x0D, /* Application Collection */ + /* 0x0E - 0x1F Reserved */ + kHIDUsage_Dig_Stylus = 0x20, /* Logical Collection */ + kHIDUsage_Dig_Puck = 0x21, /* Logical Collection */ + kHIDUsage_Dig_Finger = 0x22, /* Logical Collection */ + /* 0x23 - 0x2F Reserved */ + kHIDUsage_Dig_TipPressure = 0x30, /* Dynamic Value */ + kHIDUsage_Dig_BarrelPressure = 0x31, /* Dynamic Value */ + kHIDUsage_Dig_InRange = 0x32, /* Momentary Control */ + kHIDUsage_Dig_Touch = 0x33, /* Momentary Control */ + kHIDUsage_Dig_Untouch = 0x34, /* One-Shot Control */ + kHIDUsage_Dig_Tap = 0x35, /* One-Shot Control */ + kHIDUsage_Dig_Quality = 0x36, /* Dynamic Value */ + kHIDUsage_Dig_DataValid = 0x37, /* Momentary Control */ + kHIDUsage_Dig_TransducerIndex = 0x38, /* Dynamic Value */ + kHIDUsage_Dig_TabletFunctionKeys = 0x39, /* Logical Collection */ + kHIDUsage_Dig_ProgramChangeKeys = 0x3A, /* Logical Collection */ + kHIDUsage_Dig_BatteryStrength = 0x3B, /* Dynamic Value */ + kHIDUsage_Dig_Invert = 0x3C, /* Momentary Control */ + kHIDUsage_Dig_XTilt = 0x3D, /* Dynamic Value */ + kHIDUsage_Dig_YTilt = 0x3E, /* Dynamic Value */ + kHIDUsage_Dig_Azimuth = 0x3F, /* Dynamic Value */ + kHIDUsage_Dig_Altitude = 0x40, /* Dynamic Value */ + kHIDUsage_Dig_Twist = 0x41, /* Dynamic Value */ + kHIDUsage_Dig_TipSwitch = 0x42, /* Momentary Control */ + kHIDUsage_Dig_SecondaryTipSwitch = 0x43, /* Momentary Control */ + kHIDUsage_Dig_BarrelSwitch = 0x44, /* Momentary Control */ + kHIDUsage_Dig_Eraser = 0x45, /* Momentary Control */ + kHIDUsage_Dig_TabletPick = 0x46, /* Momentary Control */ + /* 0x47 - 0xFFFF Reserved */ + kHIDUsage_Dig_Reserved = 0xFFFF +}; + +/* AlphanumericDisplay Page (0x14) */ +/* The Alphanumeric Display page is intended for use by simple alphanumeric displays that are used on consumer devices. */ +enum +{ + kHIDUsage_AD_AlphanumericDisplay = 0x01, /* Application Collection */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_AD_DisplayAttributesReport = 0x20, /* Logical Collection */ + kHIDUsage_AD_ASCIICharacterSet = 0x21, /* Static Flag */ + kHIDUsage_AD_DataReadBack = 0x22, /* Static Flag */ + kHIDUsage_AD_FontReadBack = 0x23, /* Static Flag */ + kHIDUsage_AD_DisplayControlReport = 0x24, /* Logical Collection */ + kHIDUsage_AD_ClearDisplay = 0x25, /* Dynamic Flag */ + kHIDUsage_AD_DisplayEnable = 0x26, /* Dynamic Flag */ + kHIDUsage_AD_ScreenSaverDelay = 0x27, /* Static Value */ + kHIDUsage_AD_ScreenSaverEnable = 0x28, /* Dynamic Flag */ + kHIDUsage_AD_VerticalScroll = 0x29, /* Static Flag */ + kHIDUsage_AD_HorizontalScroll = 0x2A, /* Static Flag */ + kHIDUsage_AD_CharacterReport = 0x2B, /* Logical Collection */ + kHIDUsage_AD_DisplayData = 0x2C, /* Dynamic Value */ + kHIDUsage_AD_DisplayStatus = 0x2D, /* Logical Collection */ + kHIDUsage_AD_StatNotReady = 0x2E, /* Selector */ + kHIDUsage_AD_StatReady = 0x2F, /* Selector */ + kHIDUsage_AD_ErrNotaloadablecharacter = 0x30, /* Selector */ + kHIDUsage_AD_ErrFontdatacannotberead = 0x31, /* Selector */ + kHIDUsage_AD_CursorPositionReport = 0x32, /* Logical Collection */ + kHIDUsage_AD_Row = 0x33, /* Dynamic Value */ + kHIDUsage_AD_Column = 0x34, /* Dynamic Value */ + kHIDUsage_AD_Rows = 0x35, /* Static Value */ + kHIDUsage_AD_Columns = 0x36, /* Static Value */ + kHIDUsage_AD_CursorPixelPositioning = 0x37, /* Static Flag */ + kHIDUsage_AD_CursorMode = 0x38, /* Dynamic Flag */ + kHIDUsage_AD_CursorEnable = 0x39, /* Dynamic Flag */ + kHIDUsage_AD_CursorBlink = 0x3A, /* Dynamic Flag */ + kHIDUsage_AD_FontReport = 0x3B, /* Logical Collection */ + kHIDUsage_AD_FontData = 0x3C, /* Buffered Byte */ + kHIDUsage_AD_CharacterWidth = 0x3D, /* Static Value */ + kHIDUsage_AD_CharacterHeight = 0x3E, /* Static Value */ + kHIDUsage_AD_CharacterSpacingHorizontal = 0x3F, /* Static Value */ + kHIDUsage_AD_CharacterSpacingVertical = 0x40, /* Static Value */ + kHIDUsage_AD_UnicodeCharacterSet = 0x41, /* Static Flag */ + /* 0x42 - 0xFFFF Reserved */ + kHIDUsage_AD_Reserved = 0xFFFF +}; + +/* Power Device Page (0x84) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + + kHIDUsage_PD_Undefined = 0x00, /* Power Device Undefined Usage */ + kHIDUsage_PD_iName = 0x01, /* CL- Power Device Name Index */ + kHIDUsage_PD_PresentStatus = 0x02, /* CL- Power Device Present Status */ + kHIDUsage_PD_ChangedStatus = 0x03, /* CA- Power Device Changed Status */ + kHIDUsage_PD_UPS = 0x04, /* CA- Uninterruptible Power Supply */ + kHIDUsage_PD_PowerSupply = 0x05, /* CA- Power Supply */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_PD_BatterySystem = 0x10, /* CP- Battery System power module */ + kHIDUsage_PD_BatterySystemID = 0x11, /* SV IF- Battery System ID */ + kHIDUsage_PD_Battery = 0x12, /* CP- Battery */ + kHIDUsage_PD_BatteryID = 0x13, /* SV IF- Battery ID */ + kHIDUsage_PD_Charger = 0x14, /* CP- Charger */ + kHIDUsage_PD_ChargerID = 0x15, /* SV IF- Charger ID */ + kHIDUsage_PD_PowerConverter = 0x16, /* CP- Power Converter power module */ + kHIDUsage_PD_PowerConverterID = 0x17, /* SV IF- Power Converter ID */ + kHIDUsage_PD_OutletSystem = 0x18, /* CP- Outlet System power module */ + kHIDUsage_PD_OutletSystemID = 0x19, /* SV IF-Outlet System ID */ + kHIDUsage_PD_Input = 0x1A, /* CP- Power Device Input */ + kHIDUsage_PD_InputID = 0x1B, /* SV IF- Power Device Input ID */ + kHIDUsage_PD_Output = 0x1C, /* CP- Power Device Output */ + kHIDUsage_PD_OutputID = 0x1D, /* SV IF- Power Device Output ID */ + kHIDUsage_PD_Flow = 0x1E, /* CP- Power Device Flow */ + kHIDUsage_PD_FlowID = 0x1F, /* Item IF- Power Device Flow ID */ + kHIDUsage_PD_Outlet = 0x20, /* CP- Power Device Outlet */ + kHIDUsage_PD_OutletID = 0x21, /* SV IF- Power Device Outlet ID */ + kHIDUsage_PD_Gang = 0x22, /* CL/CP- Power Device Gang */ + kHIDUsage_PD_GangID = 0x23, /* SV IF- Power Device Gang ID */ + kHIDUsage_PD_PowerSummary = 0x24, /* CL/CP- Power Device Power Summary */ + kHIDUsage_PD_PowerSummaryID = 0x25, /* SV IF- Power Device Power Summary ID */ + /* Reserved 0x26 - 0x2F */ + kHIDUsage_PD_Voltage = 0x30, /* DV IF- Power Device Voltage */ + kHIDUsage_PD_Current = 0x31, /* DV IF- Power Device Current */ + kHIDUsage_PD_Frequency = 0x32, /* DV IF- Power Device Frequency */ + kHIDUsage_PD_ApparentPower = 0x33, /* DV IF- Power Device Apparent Power */ + kHIDUsage_PD_ActivePower = 0x34, /* DV IF- Power Device RMS Power */ + kHIDUsage_PD_PercentLoad = 0x35, /* DV IF- Power Device Percent Load */ + kHIDUsage_PD_Temperature = 0x36, /* DV IF- Power Device Temperature */ + kHIDUsage_PD_Humidity = 0x37, /* DV IF- Power Device Humidity */ + kHIDUsage_PD_BadCount = 0x38, /* DV IF- Power Device Bad Condition Count */ + /* Reserved 0x39 - 0x3F */ + kHIDUsage_PD_ConfigVoltage = 0x40, /* SV/DV F- Power Device Nominal Voltage */ + kHIDUsage_PD_ConfigCurrent = 0x41, /* SV/DV F- Power Device Nominal Current */ + kHIDUsage_PD_ConfigFrequency = 0x42, /* SV/DV F- Power Device Nominal Frequency */ + kHIDUsage_PD_ConfigApparentPower = 0x43, /* SV/DV F- Power Device Nominal Apparent Power */ + kHIDUsage_PD_ConfigActivePower = 0x44, /* SV/DV F- Power Device Nominal RMS Power */ + kHIDUsage_PD_ConfigPercentLoad = 0x45, /* SV/DV F- Power Device Nominal Percent Load */ + kHIDUsage_PD_ConfigTemperature = 0x46, /* SV/DV F- Power Device Nominal Temperature */ + kHIDUsage_PD_ConfigHumidity = 0x47, /* SV/DV F- Power Device Nominal Humidity */ + /* Reserved 0x48 - 0x4F */ + kHIDUsage_PD_SwitchOnControl = 0x50, /* DV F- Power Device Switch On Control */ + kHIDUsage_PD_SwitchOffControl = 0x51, /* DV F- Power Device Switch Off Control */ + kHIDUsage_PD_ToggleControl = 0x52, /* DV F- Power Device Toogle Sequence Control */ + kHIDUsage_PD_LowVoltageTransfer = 0x53, /* DV F- Power Device Min Transfer Voltage */ + kHIDUsage_PD_HighVoltageTransfer = 0x54, /* DV F- Power Device Max Transfer Voltage */ + kHIDUsage_PD_DelayBeforeReboot = 0x55, /* DV F- Power Device Delay Before Reboot */ + kHIDUsage_PD_DelayBeforeStartup = 0x56, /* DV F- Power Device Delay Before Startup */ + kHIDUsage_PD_DelayBeforeShutdown = 0x57, /* DV F- Power Device Delay Before Shutdown */ + kHIDUsage_PD_Test = 0x58, /* DV F- Power Device Test Request/Result */ + kHIDUsage_PD_ModuleReset = 0x59, /* DV F- Power Device Reset Request/Result */ + kHIDUsage_PD_AudibleAlarmControl = 0x5A, /* DV F- Power Device Audible Alarm Control */ + /* Reserved 0x5B - 0x5F */ + kHIDUsage_PD_Present = 0x60, /* DV IOF- Power Device Present */ + kHIDUsage_PD_Good = 0x61, /* DV IOF- Power Device Good */ + kHIDUsage_PD_InternalFailure = 0x62, /* DV IOF- Power Device Internal Failure */ + kHIDUsage_PD_VoltageOutOfRange = 0x63, /* DV IOF- Power Device Voltage Out Of Range */ + kHIDUsage_PD_FrequencyOutOfRange = 0x64, /* DV IOF- Power Device Frequency Out Of Range */ + kHIDUsage_PD_Overload = 0x65, /* DV IOF- Power Device Overload */ + kHIDUsage_PD_OverCharged = 0x66, /* DV IOF- Power Device Over Charged */ + kHIDUsage_PD_OverTemperature = 0x67, /* DV IOF- Power Device Over Temperature */ + kHIDUsage_PD_ShutdownRequested = 0x68, /* DV IOF- Power Device Shutdown Requested */ + kHIDUsage_PD_ShutdownImminent = 0x69, /* DV IOF- Power Device Shutdown Imminent */ + /* Reserved 0x6A */ + kHIDUsage_PD_SwitchOnOff = 0x6B, /* DV IOF- Power Device On/Off Switch Status */ + kHIDUsage_PD_Switchable = 0x6C, /* DV IOF- Power Device Switchable */ + kHIDUsage_PD_Used = 0x6D, /* DV IOF- Power Device Used */ + kHIDUsage_PD_Boost = 0x6E, /* DV IOF- Power Device Boosted */ + kHIDUsage_PD_Buck = 0x6F, /* DV IOF- Power Device Bucked */ + kHIDUsage_PD_Initialized = 0x70, /* DV IOF- Power Device Initialized */ + kHIDUsage_PD_Tested = 0x71, /* DV IOF- Power Device Tested */ + kHIDUsage_PD_AwaitingPower = 0x72, /* DV IOF- Power Device Awaiting Power */ + kHIDUsage_PD_CommunicationLost = 0x73, /* DV IOF- Power Device Communication Lost */ + /* Reserved 0x74 - 0xFC */ + kHIDUsage_PD_iManufacturer = 0xFD, /* SV F- Power Device Manufacturer String Index */ + kHIDUsage_PD_iProduct = 0xFE, /* SV F- Power Device Product String Index */ + kHIDUsage_PD_iserialNumber = 0xFF /* SV F- Power Device Serial Number String Index */ +}; + +/* Battery System Page (x85) */ +/* This section provides detailed descriptions of the usages employed by Battery Systems. */ +enum +{ + kHIDUsage_BS_Undefined = 0x00, /* Battery System Undefined */ + kHIDUsage_BS_SMBBatteryMode = 0x01, /* CL - SMB Mode */ + kHIDUsage_BS_SMBBatteryStatus = 0x02, /* CL - SMB Status */ + kHIDUsage_BS_SMBAlarmWarning = 0x03, /* CL - SMB Alarm Warning */ + kHIDUsage_BS_SMBChargerMode = 0x04, /* CL - SMB Charger Mode */ + kHIDUsage_BS_SMBChargerStatus = 0x05, /* CL - SMB Charger Status */ + kHIDUsage_BS_SMBChargerSpecInfo = 0x06, /* CL - SMB Charger Extended Status */ + kHIDUsage_BS_SMBSelectorState = 0x07, /* CL - SMB Selector State */ + kHIDUsage_BS_SMBSelectorPresets = 0x08, /* CL - SMB Selector Presets */ + kHIDUsage_BS_SMBSelectorInfo = 0x09, /* CL - SMB Selector Info */ + /* Reserved 0x0A - 0x0F */ + kHIDUsage_BS_OptionalMfgFunction1 = 0x10, /* DV F - Battery System Optional SMB Mfg Function 1 */ + kHIDUsage_BS_OptionalMfgFunction2 = 0x11, /* DV F - Battery System Optional SMB Mfg Function 2 */ + kHIDUsage_BS_OptionalMfgFunction3 = 0x12, /* DV F - Battery System Optional SMB Mfg Function 3 */ + kHIDUsage_BS_OptionalMfgFunction4 = 0x13, /* DV F - Battery System Optional SMB Mfg Function 4 */ + kHIDUsage_BS_OptionalMfgFunction5 = 0x14, /* DV F - Battery System Optional SMB Mfg Function 5 */ + kHIDUsage_BS_ConnectionToSMBus = 0x15, /* DF F - Battery System Connection To System Management Bus */ + kHIDUsage_BS_OutputConnection = 0x16, /* DF F - Battery System Output Connection Status */ + kHIDUsage_BS_ChargerConnection = 0x17, /* DF F - Battery System Charger Connection */ + kHIDUsage_BS_BatteryInsertion = 0x18, /* DF F - Battery System Battery Insertion */ + kHIDUsage_BS_Usenext = 0x19, /* DF F - Battery System Use Next */ + kHIDUsage_BS_OKToUse = 0x1A, /* DF F - Battery System OK To Use */ + kHIDUsage_BS_BatterySupported = 0x1B, /* DF F - Battery System Battery Supported */ + kHIDUsage_BS_SelectorRevision = 0x1C, /* DF F - Battery System Selector Revision */ + kHIDUsage_BS_ChargingIndicator = 0x1D, /* DF F - Battery System Charging Indicator */ + /* Reserved 0x1E - 0x27 */ + kHIDUsage_BS_ManufacturerAccess = 0x28, /* DV F - Battery System Manufacturer Access */ + kHIDUsage_BS_RemainingCapacityLimit = 0x29, /* DV F - Battery System Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimit = 0x2A, /* DV F - Battery System Remaining Time Limit */ + kHIDUsage_BS_AtRate = 0x2B, /* DV F - Battery System At Rate... */ + kHIDUsage_BS_CapacityMode = 0x2C, /* DV F - Battery System Capacity Mode */ + kHIDUsage_BS_BroadcastToCharger = 0x2D, /* DV F - Battery System Broadcast To Charger */ + kHIDUsage_BS_PrimaryBattery = 0x2E, /* DV F - Battery System Primary Battery */ + kHIDUsage_BS_ChargeController = 0x2F, /* DV F - Battery System Charge Controller */ + /* Reserved 0x30 - 0x3F */ + kHIDUsage_BS_TerminateCharge = 0x40, /* DF IOF - Battery System Terminate Charge */ + kHIDUsage_BS_TerminateDischarge = 0x41, /* DF IOF - Battery System Terminate Discharge */ + kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */ + kHIDUsage_BS_Charging = 0x44, /* DF IOF - Battery System Charging */ + kHIDUsage_BS_Discharging = 0x45, /* DV IOF - Battery System Discharging */ + kHIDUsage_BS_FullyCharged = 0x46, /* DF IOF - Battery System Fully Charged */ + kHIDUsage_BS_FullyDischarged = 0x47, /* DV IOF - Battery System Fully Discharged */ + kHIDUsage_BS_ConditioningFlag = 0x48, /* DV IOF - Battery System Conditioning Flag */ + kHIDUsage_BS_AtRateOK = 0x49, /* DV IOF - Battery System At Rate OK */ + kHIDUsage_BS_SMBErrorCode = 0x4A, /* DF IOF - Battery System SMB Error Code */ + kHIDUsage_BS_NeedReplacement = 0x4B, /* DF IOF - Battery System Need Replacement */ + /* Reserved 0x4C - 0x5F */ + kHIDUsage_BS_AtRateTimeToFull = 0x60, /* DV IF - Battery System At Rate Time To Full */ + kHIDUsage_BS_AtRateTimeToEmpty = 0x61, /* DV IF - Battery System At Rate Time To Empty */ + kHIDUsage_BS_AverageCurrent = 0x62, /* DV IF - Battery System Average Current */ + kHIDUsage_BS_Maxerror = 0x63, /* DV IF - Battery System Max Error */ + kHIDUsage_BS_RelativeStateOfCharge = 0x64, /* DV IF - Battery System Relative State Of Charge */ + kHIDUsage_BS_AbsoluteStateOfCharge = 0x65, /* DV IF - Battery System Absolute State Of Charge */ + kHIDUsage_BS_RemainingCapacity = 0x66, /* DV IF - Battery System Remaining Capacity */ + kHIDUsage_BS_FullChargeCapacity = 0x67, /* DV IF - Battery System Full Charge Capacity */ + kHIDUsage_BS_RunTimeToEmpty = 0x68, /* DV IF - Battery System Run Time To Empty */ + kHIDUsage_BS_AverageTimeToEmpty = 0x69, /* DV IF - Battery System Average Time To Empty */ + kHIDUsage_BS_AverageTimeToFull = 0x6A, /* DV IF - Battery System Average Time To Full */ + kHIDUsage_BS_CycleCount = 0x6B, /* DV IF - Battery System Cycle Count */ + /* Reserved 0x6C - 0x7F */ + kHIDUsage_BS_BattPackModelLevel = 0x80, /* SV F - Battery System Batt Pack Model Level */ + kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */ + kHIDUsage_BS_PrimaryBatterySupport = 0x82, /* SF F - Battery System Primary Battery Support */ + kHIDUsage_BS_DesignCapacity = 0x83, /* SV F - Battery System Design Capacity */ + kHIDUsage_BS_SpecificationInfo = 0x84, /* SV F - Battery System Specification Info */ + kHIDUsage_BS_ManufacturerDate = 0x85, /* SV F - Battery System Manufacturer Date */ + kHIDUsage_BS_SerialNumber = 0x86, /* SV F - Battery System Serial Number */ + kHIDUsage_BS_iManufacturerName = 0x87, /* SV F - Battery System Manufacturer Name Index */ + kHIDUsage_BS_iDevicename = 0x88, /* SV F - Battery System Device Name Index */ + kHIDUsage_BS_iDeviceChemistry = 0x89, /* SV F - Battery System Device Chemistry Index */ + kHIDUsage_BS_ManufacturerData = 0x8A, /* SV F - Battery System Manufacturer Data */ + kHIDUsage_BS_Rechargable = 0x8B, /* SV F - Battery System Rechargable */ + kHIDUsage_BS_WarningCapacityLimit = 0x8C, /* SV F - Battery System Warning Capacity Limit */ + kHIDUsage_BS_CapacityGranularity1 = 0x8D, /* SV F - Battery System Capacity Granularity 1 */ + kHIDUsage_BS_CapacityGranularity2 = 0x8E, /* SV F - Battery System Capacity Granularity 2 */ + kHIDUsage_BS_iOEMInformation = 0x8F, /* SV F - Battery System OEM Information Index */ + /* Reserved 0x90 - 0xBF */ + kHIDUsage_BS_InhibitCharge = 0xC0, /* DF IOF - Battery System Inhibit Charge */ + kHIDUsage_BS_EnablePolling = 0xC1, /* DF IOF - Battery System Enable Polling */ + kHIDUsage_BS_ResetToZero = 0xC2, /* DF IOF - Battery System Reset To Zero */ + /* Reserved 0xC3 - 0xCF */ + kHIDUsage_BS_ACPresent = 0xD0, /* DF IOF - Battery System AC Present */ + kHIDUsage_BS_BatteryPresent = 0xD1, /* DF IOF - Battery System Battery Present */ + kHIDUsage_BS_PowerFail = 0xD2, /* DF IOF - Battery System Power Fail */ + kHIDUsage_BS_AlarmInhibited = 0xD3, /* DF IOF - Battery System Alarm Inhibited */ + kHIDUsage_BS_ThermistorUnderRange = 0xD4, /* DF IOF - Battery System Thermistor Under Range */ + kHIDUsage_BS_ThermistorHot = 0xD5, /* DF IOF - Battery System Thermistor Hot */ + kHIDUsage_BS_ThermistorCold = 0xD6, /* DF IOF - Battery System Thermistor Cold */ + kHIDUsage_BS_ThermistorOverRange = 0xD7, /* DF IOF - Battery System Thermistor Over Range */ + kHIDUsage_BS_VoltageOutOfRange = 0xD8, /* DF IOF - Battery System Voltage Out Of Range */ + kHIDUsage_BS_CurrentOutOfRange = 0xD9, /* DF IOF - Battery System Current Out Of Range */ + kHIDUsage_BS_CurrentNotRegulated = 0xDA, /* DF IOF - Battery System Current Not Regulated */ + kHIDUsage_BS_VoltageNotRegulated = 0xDB, /* DF IOF - Battery System Voltage Not Regulated */ + kHIDUsage_BS_MasterMode = 0xDC, /* DF IOF - Battery System Master Mode */ + /* Reserved 0xDD - 0xEF */ + kHIDUsage_BS_ChargerSelectorSupport = 0xF0, /* SF F- Battery System Charger Support Selector */ + kHIDUsage_BS_ChargerSpec = 0xF1, /* SF F- Battery System Charger Specification */ + kHIDUsage_BS_Level2 = 0xF2, /* SF F- Battery System Charger Level 2 */ + kHIDUsage_BS_Level3 = 0xF3 /* SF F- Battery System Charger Level 3 */ + /* Reserved 0xF2 - 0xFF */ +}; + +/* Bar Code Scanner Page (0x8C) */ +/* This section provides detailed descriptions of the usages employed by Bar Code Scanner Devices. */ +enum +{ + kHIDUsage_BCS_Undefined = 0x00, /* Bar Code Scanner Undefined Usage */ + kHIDUsage_BCS_BadgeReader = 0x01, /* CA - Bar Code Badge Reader */ + kHIDUsage_BCS_BarCodeScanner = 0x02, /* CA -Bar Code Scanner */ + kHIDUsage_BCS_DumbBarCodeScanner = 0x03, /* CA -Dumb Bar Code Scanner Usage */ + kHIDUsage_BCS_CordlessScannerBase = 0x04, /* CA -Cordless Base Usage */ + kHIDUsage_BCS_BarCodeScannerCradle = 0x05, /* CA -Bar Code Scanner Cradle Usage */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_BCS_AttributeReport = 0x10, /* CL - Attribute Report */ + kHIDUsage_BCS_SettingsReport = 0x11, /* CL - Settings Report */ + kHIDUsage_BCS_ScannedDataReport = 0x12, /* CL - Scanned Data Report */ + kHIDUsage_BCS_RawScannedDataReport = 0x13, /* CL - Raw Scanned Data Report */ + kHIDUsage_BCS_TriggerReport = 0x14, /* CL - Trigger Report */ + kHIDUsage_BCS_StatusReport = 0x15, /* CL - Status Report */ + kHIDUsage_BCS_UPC_EANControlReport = 0x16, /* CL - UPC/EAN Control Report */ + kHIDUsage_BCS_EAN2_3LabelControlReport = 0x17, /* CL - EAN 2/3 Label Control Report */ + kHIDUsage_BCS_Code39ControlReport = 0x18, /* CL - Code 39 Control Report */ + kHIDUsage_BCS_Interleaved2of5ControlReport = 0x19, /* CL - Interleaved 2 of 5 Control Report */ + kHIDUsage_BCS_Standard2of5ControlReport = 0x1A, /* CL - Standard 2 of 5 Control Report */ + kHIDUsage_BCS_MSIPlesseyControlReport = 0x1B, /* CL - MSI Plessey Control Report */ + kHIDUsage_BCS_CodabarControlReport = 0x1C, /* CL - Codabar Control Report */ + kHIDUsage_BCS_Code128ControlReport = 0x1D, /* CL - Code 128 Control Report */ + kHIDUsage_BCS_Misc1DControlReport = 0x1E, /* CL - Misc 1D Control Report */ + kHIDUsage_BCS_2DControlReport = 0x1F, /* CL - 2D Control Report */ + /* Reserved 0x20 - 0x2F */ + kHIDUsage_BCS_Aiming_PointerMide = 0x30, /* SF - Aiming Pointer Mode */ + kHIDUsage_BCS_BarCodePresentSensor = 0x31, /* SF - Bar Code Present Sensor */ + kHIDUsage_BCS_Class1ALaser = 0x32, /* SF - Class 1A Laser */ + kHIDUsage_BCS_Class2Laser = 0x33, /* SF - Class 2 Laser */ + kHIDUsage_BCS_HeaterPresent = 0x34, /* SF - Heater Present */ + kHIDUsage_BCS_ContactScanner = 0x35, /* SF - Contact Scanner */ + kHIDUsage_BCS_ElectronicArticleSurveillanceNotification = 0x36, /* SF - Electronic Article Surveillance Notification */ + kHIDUsage_BCS_ConstantElectronicArticleSurveillance = 0x37, /* SF - Constant Electronic Article Surveillance */ + kHIDUsage_BCS_ErrorIndication = 0x38, /* SF - Error Indication */ + kHIDUsage_BCS_FixedBeeper = 0x39, /* SF - Fixed Beeper */ + kHIDUsage_BCS_GoodDecodeIndication = 0x3A, /* SF - Good Decode Indication */ + kHIDUsage_BCS_HandsFreeScanning = 0x3B, /* SF - Hands Free Scanning */ + kHIDUsage_BCS_IntrinsicallySafe = 0x3C, /* SF - Intrinsically Safe */ + kHIDUsage_BCS_KlasseEinsLaser = 0x3D, /* SF - Klasse Eins Laser */ + kHIDUsage_BCS_LongRangeScanner = 0x3E, /* SF - Long Range Scanner */ + kHIDUsage_BCS_MirrorSpeedControl = 0x3F, /* SF - Mirror Speed Control */ + kHIDUsage_BCS_NotOnFileIndication = 0x40, /* SF - Not On File Indication */ + kHIDUsage_BCS_ProgrammableBeeper = 0x41, /* SF - Programmable Beeper */ + kHIDUsage_BCS_Triggerless = 0x42, /* SF - Triggerless */ + kHIDUsage_BCS_Wand = 0x43, /* SF - Wand */ + kHIDUsage_BCS_WaterResistant = 0x44, /* SF - Water Resistant */ + kHIDUsage_BCS_MultiRangeScanner = 0x45, /* SF - Multi-Range Scanner */ + kHIDUsage_BCS_ProximitySensor = 0x46, /* SF - Proximity Sensor */ + /* Reserved 0x47 - 0x4C */ + kHIDUsage_BCS_FragmentDecoding = 0x4D, /* DF - Fragment Decoding */ + kHIDUsage_BCS_ScannerReadConfidence = 0x4E, /* DV - Scanner Read Confidence */ + kHIDUsage_BCS_DataPrefix = 0x4F, /* NAry - Data Prefix */ + kHIDUsage_BCS_PrefixAIMI = 0x50, /* SEL - Prefix AIMI */ + kHIDUsage_BCS_PrefixNone = 0x51, /* SEL - Prefix None */ + kHIDUsage_BCS_PrefixProprietary = 0x52, /* SEL - Prefix Proprietary */ + /* Reserved 0x53 - 0x54 */ + kHIDUsage_BCS_ActiveTime = 0x55, /* DV - Active Time */ + kHIDUsage_BCS_AimingLaserPattern = 0x56, /* DF - Aiming Laser Pattern */ + kHIDUsage_BCS_BarCodePresent = 0x57, /* OOC - Bar Code Present */ + kHIDUsage_BCS_BeeperState = 0x58, /* OOC - Beeper State */ + kHIDUsage_BCS_LaserOnTime = 0x59, /* DV - Laser On Time */ + kHIDUsage_BCS_LaserState = 0x5A, /* OOC - Laser State */ + kHIDUsage_BCS_LockoutTime = 0x5B, /* DV - Lockout Time */ + kHIDUsage_BCS_MotorState = 0x5C, /* OOC - Motor State */ + kHIDUsage_BCS_MotorTimeout = 0x5D, /* DV - Motor Timeout */ + kHIDUsage_BCS_PowerOnResetScanner = 0x5E, /* DF - Power On Reset Scanner */ + kHIDUsage_BCS_PreventReadOfBarcodes = 0x5F, /* DF - Prevent Read of Barcodes */ + kHIDUsage_BCS_InitiateBarcodeRead = 0x60, /* DF - Initiate Barcode Read */ + kHIDUsage_BCS_TriggerState = 0x61, /* DF - Trigger State */ + kHIDUsage_BCS_TriggerMode = 0x62, /* NAry - Trigger Mode */ + kHIDUsage_BCS_TriggerModeBlinkingLaserOn = 0x63, /* SEL - Trigger Mode Blinking Laser On */ + kHIDUsage_BCS_TriggerModeContinuousLaserOn = 0x64, /* SEL - Trigger Mode Continuous Laser On */ + kHIDUsage_BCS_TriggerModeLaserOnWhilePulled = 0x65, /* SEL - Trigger Mode Laser on while Pulled */ + kHIDUsage_BCS_TriggerModeLaserStaysOnAfterTriggerRelease = 0x66, /* SEL - Trigger Mode Laser stays on after Trigger Release */ + /* Reserved 0x67 - 0x6C */ + kHIDUsage_BCS_CommitParametersToNVM = 0x6D, /* DF - Commit Parameters to NVM */ + kHIDUsage_BCS_ParameterScanning = 0x6E, /* DF - Parameter Scanning */ + kHIDUsage_BCS_ParametersChanged = 0x6F, /* OOC - Parameters Changed */ + kHIDUsage_BCS_SetParameterDefaultValues = 0x70, /* DF - Set parameter default values */ + /* Reserved 0x71 - 0x74 */ + kHIDUsage_BCS_ScannerInCradle = 0x75, /* OOC - Scanner In Cradle */ + kHIDUsage_BCS_ScannerInRange = 0x76, /* OOC - Scanner In Range */ + /* Reserved 0x77 - 0x79 */ + kHIDUsage_BCS_AimDuration = 0x7A, /* DV - Aim Duration */ + kHIDUsage_BCS_GoodReadLampDuration = 0x7B, /* DV - Good Read Lamp Duration */ + kHIDUsage_BCS_GoodReadLampIntensity = 0x7C, /* DV - Good Read Lamp Intensity */ + kHIDUsage_BCS_GoodReadLED = 0x7D, /* DF - Good Read LED */ + kHIDUsage_BCS_GoodReadToneFrequency = 0x7E, /* DV - Good Read Tone Frequency*/ + kHIDUsage_BCS_GoodReadToneLength = 0x7F, /* DV - Good Read Tone Length */ + kHIDUsage_BCS_GoodReadToneVolume = 0x80, /* DV - Good Read Tone Volume */ + /* Reserved 0x81 */ + kHIDUsage_BCS_NoReadMessage = 0x82, /* DF - No Read Message */ + kHIDUsage_BCS_NotOnFileVolume = 0x83, /* DV - Not on File Volume */ + kHIDUsage_BCS_PowerupBeep = 0x84, /* DF - Powerup Beep */ + kHIDUsage_BCS_SoundErrorBeep = 0x85, /* DF - Sound Error Beep */ + kHIDUsage_BCS_SoundGoodReadBeep = 0x86, /* DF - Sound Good Read Beep */ + kHIDUsage_BCS_SoundNotOnFileBeep = 0x87, /* DF - Sound Not On File Beep */ + kHIDUsage_BCS_GoodReadWhenToWrite = 0x88, /* NArry - Good Read When to Write */ + kHIDUsage_BCS_GRWTIAfterDecode = 0x89, /* SEL - GRWTI After Decode */ + kHIDUsage_BCS_GRWTIBeep_LampAfterTransmit = 0x8A, /* SEL - GRWTI Beep/Lamp after transmit */ + kHIDUsage_BCS_GRWTINoBeep_LampUseAtAll = 0x8B, /* SEL - GRWTI No Beep/Lamp at all */ + /* Reserved 0x8C - 0x90 */ + kHIDUsage_BCS_BooklandEAN = 0x91, /* DF - Bookland EAN */ + kHIDUsage_BCS_ConvertEAN8To13Type = 0x92, /* DF - Convert EAN 8 to 13 Type */ + kHIDUsage_BCS_ConvertUPCAToEAN_13 = 0x93, /* DF - Convert UPC A to EAN-13 */ + kHIDUsage_BCS_ConvertUPC_EToA = 0x94, /* DF - Convert UPC-E to A */ + kHIDUsage_BCS_EAN_13 = 0x95, /* DF - EAN-13 */ + kHIDUsage_BCS_EAN_8 = 0x96, /* DF - EAN_8 */ + kHIDUsage_BCS_EAN_99_128_Mandatory = 0x97, /* DF - EAN-99 128_Mandatory */ + kHIDUsage_BCS_EAN_99_P5_128_Optional = 0x98, /* DF - EAN-99 P5/128_Optional */ + /* Reserved 0x99 */ + kHIDUsage_BCS_UPC_EAN = 0x9A, /* DF - UPC/EAN */ + kHIDUsage_BCS_UPC_EANCouponCode = 0x9B, /* DF - UPC/EAN Coupon Code */ + kHIDUsage_BCS_UPC_EANPeriodicals = 0x9C, /* DV - UPC/EAN Periodicals */ + kHIDUsage_BCS_UPC_A = 0x9D, /* DF - UPC-A */ + kHIDUsage_BCS_UPC_AWith128Mandatory = 0x9E, /* DF - UPC-A with 128 Mandatory */ + kHIDUsage_BCS_UPC_AWith128Optical = 0x9F, /* DF - UPC-A with 128 Optical */ + kHIDUsage_BCS_UPC_AWithP5Optional = 0xA0, /* DF - UPC-A with P5 Optional */ + kHIDUsage_BCS_UPC_E = 0xA1, /* DF - UPC-E */ + kHIDUsage_BCS_UPC_E1 = 0xA2, /* DF - UPC-E1 */ + /* Reserved 0xA3 - 0xA8 */ + kHIDUsage_BCS_Periodical = 0xA9, /* NArry - Periodical */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus2 = 0xAA,/* SEL - Periodical Auto-Discriminate + 2 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus2 = 0xAB, /* SEL - Periodical Only Decode with + 2 */ + kHIDUsage_BCS_PeriodicalIgnorePlus2 = 0xAC, /* SEL - Periodical Ignore + 2 */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus5 = 0xAD,/* SEL - Periodical Auto-Discriminate + 5 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus5 = 0xAE, /* SEL - Periodical Only Decode with + 5 */ + kHIDUsage_BCS_PeriodicalIgnorePlus5 = 0xAF, /* SEL - Periodical Ignore + 5 */ + kHIDUsage_BCS_Check = 0xB0, /* NArry - Check */ + kHIDUsage_BCS_CheckDisablePrice = 0xB1, /* SEL - Check Disable Price */ + kHIDUsage_BCS_CheckEnable4DigitPrice = 0xB2, /* SEL - Check Enable 4 digit Price */ + kHIDUsage_BCS_CheckEnable5DigitPrice = 0xB3, /* SEL - Check Enable 5 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean4DigitPrice = 0xB4,/* SEL - Check Enable European 4 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean5DigitPrice = 0xB5,/* SEL - Check Enable European 5 digit Price */ + /* Reserved 0xB6 */ + kHIDUsage_BCS_EANTwoLabel = 0xB7, /* DF - EAN Two Label */ + kHIDUsage_BCS_EANThreeLabel = 0xB8, /* DF - EAN Thread Label */ + kHIDUsage_BCS_EAN8FlagDigit1 = 0xB9, /* DV - EAN 8 Flag Digit 1 */ + kHIDUsage_BCS_EAN8FlagDigit2 = 0xBA, /* DV - EAN 8 Flag Digit 2 */ + kHIDUsage_BCS_EAN8FlagDigit3 = 0xBB, /* DV - EAN 8 Flag Digit 3 */ + kHIDUsage_BCS_EAN13FlagDigit1 = 0xBC, /* DV - EAN 13 Flag Digit 1 */ + kHIDUsage_BCS_EAN13FlagDigit2 = 0xBD, /* DV - EAN 13 Flag Digit 2 */ + kHIDUsage_BCS_EAN13FlagDigit3 = 0xBE, /* DV - EAN 13 Flag Digit 3 */ + kHIDUsage_BCS_AddEAN2_3LabelDefinition = 0xBF, /* DF - Add EAN 2/3 Label Definition */ + kHIDUsage_BCS_ClearAllEAN2_3LabelDefinitions = 0xC0,/* DF - Clear all EAN 2/3 Label Definitions */ + /* Reserved 0xC1 - 0xC2 */ + kHIDUsage_BCS_Codabar = 0xC3, /* DF - Codabar */ + kHIDUsage_BCS_Code128 = 0xC4, /* DF - Code 128 */ + /* Reserved 0xC5 - 0xC6 */ + kHIDUsage_BCS_Code39 = 0xC7, /* DF - Code 39 */ + kHIDUsage_BCS_Code93 = 0xC8, /* DF - Code 93 */ + kHIDUsage_BCS_FullASCIIConversion = 0xC9, /* DF - Full ASCII Conversion */ + kHIDUsage_BCS_Interleaved2of5 = 0xCA, /* DF - Interleaved 2 of 5 */ + kHIDUsage_BCS_ItalianPharmacyCode = 0xCB, /* DF - Italian Pharmacy Code */ + kHIDUsage_BCS_MSI_Plessey = 0xCC, /* DF - MSI/Plessey */ + kHIDUsage_BCS_Standard2of5IATA = 0xCD, /* DF - Standard 2 of 5 IATA */ + kHIDUsage_BCS_Standard2of5 = 0xCE, /* DF - Standard 2 of 5 */ + /* Reserved 0xCF - 0xD2 */ + kHIDUsage_BCS_TransmitStart_Stop = 0xD3, /* DF - Transmit Start/Stop */ + kHIDUsage_BCS_TriOptic = 0xD4, /* DF - Tri-Optic */ + kHIDUsage_BCS_UCC_EAN_128 = 0xD5, /* DF - UCC/EAN-128 */ + kHIDUsage_BCS_CheckDigit = 0xD6, /* NArry - Check Digit */ + kHIDUsage_BCS_CheckDigitDisable = 0xD7, /* SEL - Check Digit Disable */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5OPCC = 0xD8, /* SEL - Check Digit Enable Interleaved 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5USS = 0xD9, /* SEL - Check Digit Enable Interleaved 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5OPCC = 0xD8, /* SEL - Check Digit Enable Standard 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5USS = 0xD9, /* SEL - Check Digit Enable Standard 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableOneMSIPlessey = 0xDC, /* SEL - Check Digit Enable One MSI Plessey */ + kHIDUsage_BCS_CheckDigitEnableTwoMSIPlessey = 0xDD, /* SEL - Check Digit Enable Two MSI Plessey */ + kHIDUsage_BCS_CheckDigitCodabarEnable = 0xDE, /* SEL - Check Digit Codabar Enable */ + kHIDUsage_BCS_CheckDigitCode99Enable = 0xDF, /* SEL - Check Digit Code 99 Enable */ + /* Reserved 0xE0 - 0xEF */ + kHIDUsage_BCS_TransmitCheckDigit = 0xF0, /* NArry - Transmit Check Digit */ + kHIDUsage_BCS_DisableCheckDigitTransmit = 0xF1, /* SEL - Disable Check Digit Transmit */ + kHIDUsage_BCS_EnableCheckDigitTransmit = 0xF2, /* SEL - Enable Check Digit Transmit */ + /* Reserved 0xF3 - 0xFA */ + kHIDUsage_BCS_SymbologyIdentifier1 = 0xFB, /* DV - Symbology Identifier 1 */ + kHIDUsage_BCS_SymbologyIdentifier2 = 0xFC, /* DV - Symbology Identifier 2 */ + kHIDUsage_BCS_SymbologyIdentifier3 = 0xFD, /* DV - Symbology Identifier 3 */ + kHIDUsage_BCS_DecodedData = 0xFE, /* DV - Decoded Data */ + kHIDUsage_BCS_DecodeDataContinued = 0xFF, /* DF - Decode Data Continued */ + kHIDUsage_BCS_BarSpaceData = 0x100, /* DV - Bar Space Data */ + kHIDUsage_BCS_ScannerDataAccuracy = 0x101, /* DV - Scanner Data Accuracy */ + kHIDUsage_BCS_RawDataPolarity = 0x102, /* NArry - Raw Data Polarity */ + kHIDUsage_BCS_PolarityInvertedBarCode = 0x103, /* SEL - Polarity Inverted Bar Code */ + kHIDUsage_BCS_PolarityNormalBarCode = 0x103, /* SEL - Polarity Normal Bar Code */ + /* Reserved 0x105 */ + kHIDUsage_BCS_MinimumLengthToDecode = 0x106, /* DV - Minimum Length to Decode */ + kHIDUsage_BCS_MaximumLengthToDecode = 0x107, /* DV - Maximum Length to Decode */ + kHIDUsage_BCS_FirstDiscreteLengthToDecode = 0x108, /* DV - First Discrete Length to Decode */ + kHIDUsage_BCS_SecondDiscreteLengthToDecode = 0x109, /* DV - Second Discrete Length to Decode */ + kHIDUsage_BCS_DataLengthMethod = 0x10A, /* NArry - Data Length Method */ + kHIDUsage_BCS_DLMethodReadAny = 0x10B, /* DF - DL Method Read any */ + kHIDUsage_BCS_DLMethodCheckInRange = 0x10C, /* DF - DL Method Check in Range */ + kHIDUsage_BCS_DLMethodCheckForDiscrete = 0x10D, /* DF - DL Method Check for Discrete */ + /* Reserved 0x10E - 0x10F */ + kHIDUsage_BCS_AztecCode = 0x110, /* DF - Aztec Code */ + kHIDUsage_BCS_BC412 = 0x111, /* DF - BC412 */ + kHIDUsage_BCS_ChannelCode = 0x112, /* DF - Channel Code */ + kHIDUsage_BCS_Code16 = 0x113, /* DF - Code 16 */ + kHIDUsage_BCS_Code32 = 0x114, /* DF - Code 32 */ + kHIDUsage_BCS_Code49 = 0x115, /* DF - Code 49 */ + kHIDUsage_BCS_CodeOne = 0x116, /* DF - Code One */ + kHIDUsage_BCS_Colorcode = 0x117, /* DF - Colorcode */ + kHIDUsage_BCS_DataMatrix = 0x118, /* DF - Data Matrix */ + kHIDUsage_BCS_MaxiCode = 0x119, /* DF - MaxiCode */ + kHIDUsage_BCS_MicroPDF = 0x11A, /* DF - MicroPDF */ + kHIDUsage_BCS_PDF_417 = 0x11B, /* DF - PDF-417 */ + kHIDUsage_BCS_PosiCode = 0x11C, /* DF - PosiCode */ + kHIDUsage_BCS_QRCode = 0x11D, /* DF - QR Code */ + kHIDUsage_BCS_SuperCode = 0x11E, /* DF - SuperCode */ + kHIDUsage_BCS_UltraCode = 0x11F, /* DF - UltraCode */ + kHIDUsage_BCS_USB_5_SlugCode = 0x120, /* DF - USD-5 (Slug Code) */ + kHIDUsage_BCS_VeriCode = 0x121 /* DF - VeriCode */ + /* Reserved 0x122 - 0xFFFF */ +}; + +/* Weighing Devices Page (0x8D) */ +/* This section provides detailed descriptions of the usages employed by Weighing Devices. */ +enum +{ + kHIDUsage_WD_Undefined = 0x00, /* Weighing Device Undefined Usage */ + kHIDUsage_WD_WeighingDevice = 0x01, /* CA - Weighing Device */ + /* Reserved 0x02 - 0x1F */ + kHIDUsage_WD_ScaleScaleDevice = 0x20, /* CL - Scale Device */ + kHIDUsage_WD_ScaleScaleClassIMetricCL = 0x21, /* CL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIMetric = 0x22, /* SEL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIIMetric = 0x23, /* SEL - Scale Class II Metric */ + kHIDUsage_WD_ScaleScaleClassIIIMetric = 0x24, /* SEL - Scale Class III Metric */ + kHIDUsage_WD_ScaleScaleClassIIILMetric = 0x25, /* SEL - Scale Class IIIL Metric */ + kHIDUsage_WD_ScaleScaleClassIVMetric = 0x26, /* SEL - Scale Class IV Metric */ + kHIDUsage_WD_ScaleScaleClassIIIEnglish = 0x27, /* SEL - Scale Class III English */ + kHIDUsage_WD_ScaleScaleClassIIILEnglish = 0x28, /* SEL - Scale Class IIIL English */ + kHIDUsage_WD_ScaleScaleClassIVEnglish = 0x29, /* SEL - Scale Class IV English */ + kHIDUsage_WD_ScaleScaleClassGeneric = 0x2A, /* SEL - Scale Class Generic */ + /* Reserved 0x2B - 0x2F */ + kHIDUsage_WD_ScaleAtrributeReport = 0x30, /* CL - Scale Attribute Report */ + kHIDUsage_WD_ScaleControlReport = 0x31, /* CL - Scale Control Report */ + kHIDUsage_WD_ScaleDataReport = 0x32, /* CL - Scale Data Report */ + kHIDUsage_WD_ScaleStatusReport = 0x33, /* CL - Scale Status Report */ + kHIDUsage_WD_ScaleWeightLimitReport = 0x34, /* CL - Scale Weight Limit Report */ + kHIDUsage_WD_ScaleStatisticsReport = 0x35, /* CL - Scale Statistics Report */ + /* Reserved 0x36 - 0x3F */ + kHIDUsage_WD_DataWeight = 0x40, /* DV - Data Weight */ + kHIDUsage_WD_DataScaling = 0x41, /* DV - Data Scaling */ + /* Reserved 0x42 - 0x4F */ + kHIDUsage_WD_WeightUnit = 0x50, /* CL - Weight Unit */ + kHIDUsage_WD_WeightUnitMilligram = 0x51, /* SEL - Weight Unit Milligram */ + kHIDUsage_WD_WeightUnitGram = 0x52, /* SEL - Weight Unit Gram */ + kHIDUsage_WD_WeightUnitKilogram = 0x53, /* SEL - Weight Unit Kilogram */ + kHIDUsage_WD_WeightUnitCarats = 0x54, /* SEL - Weight Unit Carats */ + kHIDUsage_WD_WeightUnitTaels = 0x55, /* SEL - Weight Unit Taels */ + kHIDUsage_WD_WeightUnitGrains = 0x56, /* SEL - Weight Unit Grains */ + kHIDUsage_WD_WeightUnitPennyweights = 0x57, /* SEL - Weight Unit Pennyweights */ + kHIDUsage_WD_WeightUnitMetricTon = 0x58, /* SEL - Weight Unit Metric Ton */ + kHIDUsage_WD_WeightUnitAvoirTon = 0x59, /* SEL - Weight Unit Avoir Ton */ + kHIDUsage_WD_WeightUnitTroyOunce = 0x5A, /* SEL - Weight Unit Troy Ounce */ + kHIDUsage_WD_WeightUnitOunce = 0x5B, /* SEL - Weight Unit Ounce */ + kHIDUsage_WD_WeightUnitPound = 0x5C, /* SEL - Weight Unit Pound */ + /* Reserved 0x5D - 0x5F */ + kHIDUsage_WD_CalibrationCount = 0x60, /* DV - Calibration Count */ + kHIDUsage_WD_RezeroCount = 0x61, /* DV - Re-Zero Count*/ + /* Reserved 0x62 - 0x6F */ + kHIDUsage_WD_ScaleStatus = 0x70, /* CL - Scale Status */ + kHIDUsage_WD_ScaleStatusFault = 0x71, /* SEL - Scale Status Fault */ + kHIDUsage_WD_ScaleStatusStableAtZero = 0x72, /* SEL - Scale Status Stable at Center of Zero */ + kHIDUsage_WD_ScaleStatusInMotion = 0x73, /* SEL - Scale Status In Motion */ + kHIDUsage_WD_ScaleStatusWeightStable = 0x74, /* SEL - Scale Status Weight Stable */ + kHIDUsage_WD_ScaleStatusUnderZero = 0x75, /* SEL - Scale Status Under Zero */ + kHIDUsage_WD_ScaleStatusOverWeightLimit = 0x76, /* SEL - Scale Status Over Weight Limit */ + kHIDUsage_WD_ScaleStatusRequiresCalibration = 0x77, /* SEL - Scale Status Requires Calibration */ + kHIDUsage_WD_ScaleStatusRequiresRezeroing = 0x78, /* SEL - Scale Status Requires Re-zeroing */ + /* Reserved 0x79 - 0x7F */ + kHIDUsage_WD_ZeroScale = 0x80, /* OOC - Zero Scale */ + kHIDUsage_WD_EnforcedZeroReturn = 0x81 /* OOC - Enforced Zero Return */ + /* Reserved 0x82 - 0xFFFF */ + +}; + +/* Magnetic Stripe Reader Page (0x8E) */ +/* This section provides detailed descriptions of the usages employed by Magnetic Stripe Reader Devices. */ +enum +{ + kHIDUsage_MSR_Undefined = 0x00, /* MagStripe Undefined Usage */ + kHIDUsage_MSR_DeviceReadOnly = 0x01, /* CA - MSR Device Read-Only */ + /* Reserved 0x02 - 0x10 */ + kHIDUsage_MSR_Track1Length = 0x11, /* SF, DF, SEL - Track 1 Length */ + kHIDUsage_MSR_Track2Length = 0x12, /* SF, DF, SEL - Track 2 Length */ + kHIDUsage_MSR_Track3Length = 0x13, /* SF, DF, SEL - Track 3 Length */ + kHIDUsage_MSR_TrackJISLength = 0x14, /* SF, DF, SEL - Track JIS Length */ + /* Reserved 0x15 - 0x1F */ + kHIDUsage_MSR_TrackData = 0x20, /* SF, DF, SEL - Track Data */ + kHIDUsage_MSR_Track1Data = 0x21, /* SF, DF, SEL - Track 1 Data */ + kHIDUsage_MSR_Track2Data = 0x22, /* SF, DF, SEL - Track 2 Data */ + kHIDUsage_MSR_Track3Data = 0x23, /* SF, DF, SEL - Track 3 Data */ + kHIDUsage_MSR_TrackJISData = 0x24 /* SF, DF, SEL - Track JIS Data */ + /* Reserved 0x25 - 0xFFFF */ +}; + +#endif /* _IOHIDUSAGETABLES_H */ diff --git a/i386/include/IOKit/hidevent/.svn/all-wcprops b/i386/include/IOKit/hidevent/.svn/all-wcprops new file mode 100644 index 0000000..aca99ba --- /dev/null +++ b/i386/include/IOKit/hidevent/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidevent +END +IOHIDEventDriver.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidevent/IOHIDEventDriver.h +END +IOHIDEventService.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidevent/IOHIDEventService.h +END diff --git a/i386/include/IOKit/hidevent/.svn/entries b/i386/include/IOKit/hidevent/.svn/entries new file mode 100644 index 0000000..e68c1a4 --- /dev/null +++ b/i386/include/IOKit/hidevent/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/hidevent +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOHIDEventDriver.h +file + + + + +2013-08-27T23:54:23.000000Z +361d3865f850b7361bbfb7994c01d450 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6856 + +IOHIDEventService.h +file + + + + +2013-08-27T23:54:23.000000Z +355ea262ba875846e8cd32f1788b2cbc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17634 + diff --git a/i386/include/IOKit/hidevent/.svn/text-base/IOHIDEventDriver.h.svn-base b/i386/include/IOKit/hidevent/.svn/text-base/IOHIDEventDriver.h.svn-base new file mode 100644 index 0000000..9eddb24 --- /dev/null +++ b/i386/include/IOKit/hidevent/.svn/text-base/IOHIDEventDriver.h.svn-base @@ -0,0 +1,171 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDEVENTDRIVER_H +#define _IOKIT_HID_IOHIDEVENTDRIVER_H + +#include +#include +#include +#include + + +/*! @class IOHIDEventDriver : public IOHIDEventService + @abstract + @discussion +*/ +struct IOHIDReportHandler; + +class IOHIDEventDriver: public IOHIDEventService +{ + OSDeclareDefaultStructors( IOHIDEventDriver ) + +private: + IOHIDInterface * _interface; + IOHIDReportHandler * _reportHandlers; + + IOHIDElement * _ledElements[2]; + OSArray * _supportedElements; + + UInt32 _bootSupport; + bool _multipleReports; + bool _relativeButtonCollection; + UInt32 _cachedButtonState; + bool _cachedRangeState; + + struct ExpansionData { + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + bool findElements ( OSArray * elementArray, UInt32 bootProtocol ); + + bool storeReportElement ( IOHIDElement * element ); + + void handleBootPointingReport ( + IOMemoryDescriptor * report, + SInt32 * dX, + SInt32 * dY, + UInt32 * buttonState); + + static void _handleInterruptReport ( + OSObject * target, + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + void * refcon); + +protected: + + virtual void free(); + + virtual OSArray * getReportElements(); + + virtual bool handleStart( IOService * provider ); + + virtual void handleStop( IOService * provider ); + + virtual void handleInterruptReport ( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID); + + virtual OSString * getTransport (); + + virtual UInt32 getLocationID (); + + virtual UInt32 getVendorID (); + + virtual UInt32 getVendorIDSource (); + + virtual UInt32 getProductID (); + + virtual UInt32 getVersion (); + + virtual UInt32 getCountryCode (); + + virtual OSString * getManufacturer (); + + virtual OSString * getProduct (); + + virtual OSString * getSerialNumber (); + + virtual void setElementValue ( + UInt32 usagePage, + UInt32 usage, + UInt32 value ); + + virtual UInt32 getElementValue ( + UInt32 usagePage, + UInt32 usage ); + +public: + + + virtual bool init( OSDictionary * dictionary = 0 ); + + virtual bool didTerminate( + IOService * provider, + IOOptionBits options, + bool * defer ); + + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 0); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 1); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 2); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 3); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 4); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 5); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 6); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 7); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 8); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 9); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 10); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 11); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 12); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 13); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 14); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 15); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 16); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 17); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 18); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 19); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 20); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 21); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 22); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 23); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 24); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 25); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 26); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 27); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 28); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 29); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 30); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDEVENTDRIVER_H */ diff --git a/i386/include/IOKit/hidevent/.svn/text-base/IOHIDEventService.h.svn-base b/i386/include/IOKit/hidevent/.svn/text-base/IOHIDEventService.h.svn-base new file mode 100644 index 0000000..bc82511 --- /dev/null +++ b/i386/include/IOKit/hidevent/.svn/text-base/IOHIDEventService.h.svn-base @@ -0,0 +1,394 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDEVENTSERVICE_H +#define _IOKIT_HID_IOHIDEVENTSERVICE_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +#if TARGET_OS_EMBEDDED + #include +#endif + +enum +{ + kHIDDispatchOptionPointerNoAcceleration = 0x01, + kHIDDispatchOptionPointerAffixToScreen = 0x02, + kHIDDispatchOptionPointerAbsolutToRelative = 0x04 +}; + +enum +{ + kHIDDispatchOptionScrollNoAcceleration = 0x01, + kHIDDispatchOptionScrollMomentumContinue = 0x02, + kHIDDispatchOptionScrollMomentumStart = 0x04, + kHIDDispatchOptionScrollMomentumEnd = 0x08, + + kHIDDispatchOptionScrollMomentumAny = kHIDDispatchOptionScrollMomentumContinue | kHIDDispatchOptionScrollMomentumStart | kHIDDispatchOptionScrollMomentumEnd +}; + +enum +{ + kHIDDispatchOptionKeyboardNoRepeat = 0x01 +}; + +/*! @class IOHIDEventService : public IOService + @abstract + @discussion +*/ +class IOHIDPointing; +class IOHIDKeyboard; +class IOHIDConsumer; +struct TransducerData; + +class IOHIDEventService: public IOService +{ + OSDeclareAbstractStructors( IOHIDEventService ) + + friend class IOHIDPointing; + friend class IOHIDKeyboard; + friend class IOHIDConsumer; + friend class AppleEmbeddedKeyboard; + friend class IOHIDEventServiceUserClient; + +private: + IOHIDKeyboard * _keyboardNub; + IOHIDPointing * _pointingNub; + IOHIDConsumer * _consumerNub; + + IONotifier * _publishNotify; + IORecursiveLock * _nubLock; + + OSArray * _transducerDataArray; + + bool _readyForInputReports; + + + struct ExpansionData { + IOService * provider; + IOWorkLoop * workLoop; + UInt32 ejectDelayMS; + IOTimerEventSource * ejectTimerEventSource; + UInt32 ejectState; + IOOptionBits ejectOptions; + UInt32 capsDelayMS; + IOTimerEventSource * capsTimerEventSource; + UInt32 capsState; + IOOptionBits capsOptions; + OSArray * deviceUsagePairs; + +#if TARGET_OS_EMBEDDED + OSDictionary * clientDict; + UInt32 debuggerMask; + UInt32 startDebuggerMask; + IOTimerEventSource * debuggerTimerEventSource; + bool shouldSwapISO; +#endif + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + IOHIDPointing * newPointingShim ( + UInt32 buttonCount = 1, + IOFixed pointerResolution = (400 << 16), + IOFixed scrollResolution = 0, + IOOptionBits options = 0 ); + + IOHIDKeyboard * newKeyboardShim ( + UInt32 supportedModifiers = 0, + IOOptionBits options = 0 ); + + IOHIDConsumer * newConsumerShim ( IOOptionBits options = 0 ); + + void parseSupportedElements ( + OSArray * elementArray, + UInt32 bootProtocol ); + + void processTabletElement ( IOHIDElement * element ); + + void processTransducerData (); + + TransducerData * createTransducerData ( UInt32 tranducerID ); + + TransducerData * getTransducerData ( UInt32 tranducerID ); + + IOFixed determineResolution ( IOHIDElement * element ); + + static bool _publishMatchingNotificationHandler(void * target, void * ref, IOService * newService, IONotifier * notifier); + + void ejectTimerCallback(IOTimerEventSource *sender); + + void capsTimerCallback(IOTimerEventSource *sender); + +#if TARGET_OS_EMBEDDED + void debuggerTimerCallback(IOTimerEventSource *sender); +#endif + void calculateCapsLockDelay(); + + void calculateStandardType(); + +protected: + + virtual void free(); + +/*! @function handleOpen + @abstract Handle a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result true to accept the client open, false otherwise. */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handle a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). */ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Query whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result true if the specified client, or any client if none (0) is + specified, presently has an open on this object. */ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function handleStart + @abstract Prepare the hardware and driver to support I/O operations. + @discussion IOHIDEventService will call this method from start() before + any I/O operations are issued to the concrete subclass. Methods + such as getReportElements() are only called after handleStart() + has returned true. A subclass that overrides this method should + begin its implementation by calling the version in super, and + then check the return value. + @param provider The provider argument passed to start(). + @result True on success, or false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool handleStart( IOService * provider ); + +/*! @function handleStop + @abstract Quiesce the hardware and stop the driver. + @discussion IOHIDEventService will call this method from stop() to + signal that the hardware should be quiesced and the driver stopped. + A subclass that overrides this method should end its implementation + by calling the version in super. + @param provider The provider argument passed to stop(). */ + + virtual void handleStop( IOService * provider ); + + virtual OSString * getTransport (); + virtual UInt32 getLocationID (); + virtual UInt32 getVendorID (); + virtual UInt32 getVendorIDSource (); + virtual UInt32 getProductID (); + virtual UInt32 getVersion (); + virtual UInt32 getCountryCode (); + virtual OSString * getManufacturer (); + virtual OSString * getProduct (); + virtual OSString * getSerialNumber (); + + virtual OSArray * getReportElements(); + + virtual void setElementValue ( + UInt32 usagePage, + UInt32 usage, + UInt32 value ); + + virtual UInt32 getElementValue ( + UInt32 usagePage, + UInt32 usage ); + + virtual void dispatchKeyboardEvent( + AbsoluteTime timeStamp, + UInt32 usagePage, + UInt32 usage, + UInt32 value, + IOOptionBits options = 0 ); + + virtual void dispatchRelativePointerEvent( + AbsoluteTime timeStamp, + SInt32 dx, + SInt32 dy, + UInt32 buttonState, + IOOptionBits options = 0 ); + + virtual void dispatchAbsolutePointerEvent( + AbsoluteTime timeStamp, + SInt32 x, + SInt32 y, + IOGBounds * bounds, + UInt32 buttonState, + bool inRange, + SInt32 tipPressure, + SInt32 tipPressureMin, + SInt32 tipPressureMax, + IOOptionBits options = 0 ); + + virtual void dispatchScrollWheelEvent( + AbsoluteTime timeStamp, + SInt32 deltaAxis1, + SInt32 deltaAxis2, + SInt32 deltaAxis3, + IOOptionBits options = 0 ); + + virtual void dispatchTabletPointerEvent( + AbsoluteTime timeStamp, + UInt32 tranducerID, + SInt32 x, + SInt32 y, + SInt32 z, + IOGBounds * bounds, + UInt32 buttonState, + SInt32 tipPressure, + SInt32 tipPressureMin, + SInt32 tipPressureMax, + SInt32 barrelPressure, + SInt32 barrelPressureMin, + SInt32 barrelPressureMax, + SInt32 tiltX, + SInt32 tiltY, + UInt32 twist, + IOOptionBits options = 0 ); + + virtual void dispatchTabletProximityEvent( + AbsoluteTime timeStamp, + UInt32 tranducerID, + bool inRange, + bool invert, + UInt32 vendorTransducerUniqueID = 0, + UInt32 vendorTransducerSerialNumber = 0, + IOOptionBits options = 0 ); + +public: + bool readyForReports(); + + virtual bool init(OSDictionary * properties = 0); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + virtual IOReturn setSystemProperties( OSDictionary * properties ); + + virtual IOReturn setProperties( OSObject * properties ); + +protected: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 0); + virtual OSArray * getDeviceUsagePairs(); + + +#if TARGET_OS_EMBEDDED +public: + typedef void (*Action)(OSObject *target, OSObject * sender, void *context, OSObject *event, IOOptionBits options); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 1); + virtual bool open( + IOService * client, + IOOptionBits options, + void * context, + Action action); + +protected: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 2); + virtual void dispatchEvent(IOHIDEvent * event, IOOptionBits options=0); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 3); + virtual UInt32 getPrimaryUsagePage(); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 4); + virtual UInt32 getPrimaryUsage(); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 5); + virtual UInt32 getReportInterval(); + +public: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 6); + virtual IOHIDEvent * copyEvent( + IOHIDEventType type, + IOHIDEvent * matching = 0, + IOOptionBits options = 0); +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 1); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 2); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 3); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 4); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 5); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 6); +#endif + OSMetaClassDeclareReservedUnused(IOHIDEventService, 7); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 8); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 9); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 10); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 11); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 12); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 13); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 14); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 15); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 16); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 17); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 18); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 19); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 20); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 21); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 22); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 23); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 24); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 25); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 26); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 27); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 28); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 29); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 30); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDEVENTSERVICE_H */ diff --git a/i386/include/IOKit/hidevent/IOHIDEventDriver.h b/i386/include/IOKit/hidevent/IOHIDEventDriver.h new file mode 100644 index 0000000..9eddb24 --- /dev/null +++ b/i386/include/IOKit/hidevent/IOHIDEventDriver.h @@ -0,0 +1,171 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDEVENTDRIVER_H +#define _IOKIT_HID_IOHIDEVENTDRIVER_H + +#include +#include +#include +#include + + +/*! @class IOHIDEventDriver : public IOHIDEventService + @abstract + @discussion +*/ +struct IOHIDReportHandler; + +class IOHIDEventDriver: public IOHIDEventService +{ + OSDeclareDefaultStructors( IOHIDEventDriver ) + +private: + IOHIDInterface * _interface; + IOHIDReportHandler * _reportHandlers; + + IOHIDElement * _ledElements[2]; + OSArray * _supportedElements; + + UInt32 _bootSupport; + bool _multipleReports; + bool _relativeButtonCollection; + UInt32 _cachedButtonState; + bool _cachedRangeState; + + struct ExpansionData { + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + bool findElements ( OSArray * elementArray, UInt32 bootProtocol ); + + bool storeReportElement ( IOHIDElement * element ); + + void handleBootPointingReport ( + IOMemoryDescriptor * report, + SInt32 * dX, + SInt32 * dY, + UInt32 * buttonState); + + static void _handleInterruptReport ( + OSObject * target, + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID, + void * refcon); + +protected: + + virtual void free(); + + virtual OSArray * getReportElements(); + + virtual bool handleStart( IOService * provider ); + + virtual void handleStop( IOService * provider ); + + virtual void handleInterruptReport ( + AbsoluteTime timeStamp, + IOMemoryDescriptor * report, + IOHIDReportType reportType, + UInt32 reportID); + + virtual OSString * getTransport (); + + virtual UInt32 getLocationID (); + + virtual UInt32 getVendorID (); + + virtual UInt32 getVendorIDSource (); + + virtual UInt32 getProductID (); + + virtual UInt32 getVersion (); + + virtual UInt32 getCountryCode (); + + virtual OSString * getManufacturer (); + + virtual OSString * getProduct (); + + virtual OSString * getSerialNumber (); + + virtual void setElementValue ( + UInt32 usagePage, + UInt32 usage, + UInt32 value ); + + virtual UInt32 getElementValue ( + UInt32 usagePage, + UInt32 usage ); + +public: + + + virtual bool init( OSDictionary * dictionary = 0 ); + + virtual bool didTerminate( + IOService * provider, + IOOptionBits options, + bool * defer ); + + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 0); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 1); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 2); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 3); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 4); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 5); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 6); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 7); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 8); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 9); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 10); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 11); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 12); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 13); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 14); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 15); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 16); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 17); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 18); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 19); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 20); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 21); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 22); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 23); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 24); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 25); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 26); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 27); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 28); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 29); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 30); + OSMetaClassDeclareReservedUnused(IOHIDEventDriver, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDEVENTDRIVER_H */ diff --git a/i386/include/IOKit/hidevent/IOHIDEventService.h b/i386/include/IOKit/hidevent/IOHIDEventService.h new file mode 100644 index 0000000..bc82511 --- /dev/null +++ b/i386/include/IOKit/hidevent/IOHIDEventService.h @@ -0,0 +1,394 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_HID_IOHIDEVENTSERVICE_H +#define _IOKIT_HID_IOHIDEVENTSERVICE_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +#if TARGET_OS_EMBEDDED + #include +#endif + +enum +{ + kHIDDispatchOptionPointerNoAcceleration = 0x01, + kHIDDispatchOptionPointerAffixToScreen = 0x02, + kHIDDispatchOptionPointerAbsolutToRelative = 0x04 +}; + +enum +{ + kHIDDispatchOptionScrollNoAcceleration = 0x01, + kHIDDispatchOptionScrollMomentumContinue = 0x02, + kHIDDispatchOptionScrollMomentumStart = 0x04, + kHIDDispatchOptionScrollMomentumEnd = 0x08, + + kHIDDispatchOptionScrollMomentumAny = kHIDDispatchOptionScrollMomentumContinue | kHIDDispatchOptionScrollMomentumStart | kHIDDispatchOptionScrollMomentumEnd +}; + +enum +{ + kHIDDispatchOptionKeyboardNoRepeat = 0x01 +}; + +/*! @class IOHIDEventService : public IOService + @abstract + @discussion +*/ +class IOHIDPointing; +class IOHIDKeyboard; +class IOHIDConsumer; +struct TransducerData; + +class IOHIDEventService: public IOService +{ + OSDeclareAbstractStructors( IOHIDEventService ) + + friend class IOHIDPointing; + friend class IOHIDKeyboard; + friend class IOHIDConsumer; + friend class AppleEmbeddedKeyboard; + friend class IOHIDEventServiceUserClient; + +private: + IOHIDKeyboard * _keyboardNub; + IOHIDPointing * _pointingNub; + IOHIDConsumer * _consumerNub; + + IONotifier * _publishNotify; + IORecursiveLock * _nubLock; + + OSArray * _transducerDataArray; + + bool _readyForInputReports; + + + struct ExpansionData { + IOService * provider; + IOWorkLoop * workLoop; + UInt32 ejectDelayMS; + IOTimerEventSource * ejectTimerEventSource; + UInt32 ejectState; + IOOptionBits ejectOptions; + UInt32 capsDelayMS; + IOTimerEventSource * capsTimerEventSource; + UInt32 capsState; + IOOptionBits capsOptions; + OSArray * deviceUsagePairs; + +#if TARGET_OS_EMBEDDED + OSDictionary * clientDict; + UInt32 debuggerMask; + UInt32 startDebuggerMask; + IOTimerEventSource * debuggerTimerEventSource; + bool shouldSwapISO; +#endif + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + IOHIDPointing * newPointingShim ( + UInt32 buttonCount = 1, + IOFixed pointerResolution = (400 << 16), + IOFixed scrollResolution = 0, + IOOptionBits options = 0 ); + + IOHIDKeyboard * newKeyboardShim ( + UInt32 supportedModifiers = 0, + IOOptionBits options = 0 ); + + IOHIDConsumer * newConsumerShim ( IOOptionBits options = 0 ); + + void parseSupportedElements ( + OSArray * elementArray, + UInt32 bootProtocol ); + + void processTabletElement ( IOHIDElement * element ); + + void processTransducerData (); + + TransducerData * createTransducerData ( UInt32 tranducerID ); + + TransducerData * getTransducerData ( UInt32 tranducerID ); + + IOFixed determineResolution ( IOHIDElement * element ); + + static bool _publishMatchingNotificationHandler(void * target, void * ref, IOService * newService, IONotifier * notifier); + + void ejectTimerCallback(IOTimerEventSource *sender); + + void capsTimerCallback(IOTimerEventSource *sender); + +#if TARGET_OS_EMBEDDED + void debuggerTimerCallback(IOTimerEventSource *sender); +#endif + void calculateCapsLockDelay(); + + void calculateStandardType(); + +protected: + + virtual void free(); + +/*! @function handleOpen + @abstract Handle a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result true to accept the client open, false otherwise. */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handle a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). */ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Query whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result true if the specified client, or any client if none (0) is + specified, presently has an open on this object. */ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function handleStart + @abstract Prepare the hardware and driver to support I/O operations. + @discussion IOHIDEventService will call this method from start() before + any I/O operations are issued to the concrete subclass. Methods + such as getReportElements() are only called after handleStart() + has returned true. A subclass that overrides this method should + begin its implementation by calling the version in super, and + then check the return value. + @param provider The provider argument passed to start(). + @result True on success, or false otherwise. Returning false will + cause start() to fail and return false. */ + + virtual bool handleStart( IOService * provider ); + +/*! @function handleStop + @abstract Quiesce the hardware and stop the driver. + @discussion IOHIDEventService will call this method from stop() to + signal that the hardware should be quiesced and the driver stopped. + A subclass that overrides this method should end its implementation + by calling the version in super. + @param provider The provider argument passed to stop(). */ + + virtual void handleStop( IOService * provider ); + + virtual OSString * getTransport (); + virtual UInt32 getLocationID (); + virtual UInt32 getVendorID (); + virtual UInt32 getVendorIDSource (); + virtual UInt32 getProductID (); + virtual UInt32 getVersion (); + virtual UInt32 getCountryCode (); + virtual OSString * getManufacturer (); + virtual OSString * getProduct (); + virtual OSString * getSerialNumber (); + + virtual OSArray * getReportElements(); + + virtual void setElementValue ( + UInt32 usagePage, + UInt32 usage, + UInt32 value ); + + virtual UInt32 getElementValue ( + UInt32 usagePage, + UInt32 usage ); + + virtual void dispatchKeyboardEvent( + AbsoluteTime timeStamp, + UInt32 usagePage, + UInt32 usage, + UInt32 value, + IOOptionBits options = 0 ); + + virtual void dispatchRelativePointerEvent( + AbsoluteTime timeStamp, + SInt32 dx, + SInt32 dy, + UInt32 buttonState, + IOOptionBits options = 0 ); + + virtual void dispatchAbsolutePointerEvent( + AbsoluteTime timeStamp, + SInt32 x, + SInt32 y, + IOGBounds * bounds, + UInt32 buttonState, + bool inRange, + SInt32 tipPressure, + SInt32 tipPressureMin, + SInt32 tipPressureMax, + IOOptionBits options = 0 ); + + virtual void dispatchScrollWheelEvent( + AbsoluteTime timeStamp, + SInt32 deltaAxis1, + SInt32 deltaAxis2, + SInt32 deltaAxis3, + IOOptionBits options = 0 ); + + virtual void dispatchTabletPointerEvent( + AbsoluteTime timeStamp, + UInt32 tranducerID, + SInt32 x, + SInt32 y, + SInt32 z, + IOGBounds * bounds, + UInt32 buttonState, + SInt32 tipPressure, + SInt32 tipPressureMin, + SInt32 tipPressureMax, + SInt32 barrelPressure, + SInt32 barrelPressureMin, + SInt32 barrelPressureMax, + SInt32 tiltX, + SInt32 tiltY, + UInt32 twist, + IOOptionBits options = 0 ); + + virtual void dispatchTabletProximityEvent( + AbsoluteTime timeStamp, + UInt32 tranducerID, + bool inRange, + bool invert, + UInt32 vendorTransducerUniqueID = 0, + UInt32 vendorTransducerSerialNumber = 0, + IOOptionBits options = 0 ); + +public: + bool readyForReports(); + + virtual bool init(OSDictionary * properties = 0); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + virtual IOReturn setSystemProperties( OSDictionary * properties ); + + virtual IOReturn setProperties( OSObject * properties ); + +protected: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 0); + virtual OSArray * getDeviceUsagePairs(); + + +#if TARGET_OS_EMBEDDED +public: + typedef void (*Action)(OSObject *target, OSObject * sender, void *context, OSObject *event, IOOptionBits options); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 1); + virtual bool open( + IOService * client, + IOOptionBits options, + void * context, + Action action); + +protected: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 2); + virtual void dispatchEvent(IOHIDEvent * event, IOOptionBits options=0); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 3); + virtual UInt32 getPrimaryUsagePage(); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 4); + virtual UInt32 getPrimaryUsage(); + + OSMetaClassDeclareReservedUsed(IOHIDEventService, 5); + virtual UInt32 getReportInterval(); + +public: + OSMetaClassDeclareReservedUsed(IOHIDEventService, 6); + virtual IOHIDEvent * copyEvent( + IOHIDEventType type, + IOHIDEvent * matching = 0, + IOOptionBits options = 0); +#else + OSMetaClassDeclareReservedUnused(IOHIDEventService, 1); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 2); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 3); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 4); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 5); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 6); +#endif + OSMetaClassDeclareReservedUnused(IOHIDEventService, 7); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 8); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 9); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 10); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 11); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 12); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 13); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 14); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 15); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 16); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 17); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 18); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 19); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 20); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 21); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 22); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 23); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 24); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 25); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 26); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 27); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 28); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 29); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 30); + OSMetaClassDeclareReservedUnused(IOHIDEventService, 31); + +}; + +#endif /* !_IOKIT_HID_IOHIDEVENTSERVICE_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/all-wcprops b/i386/include/IOKit/hidsystem/.svn/all-wcprops new file mode 100644 index 0000000..a6e3c86 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/all-wcprops @@ -0,0 +1,77 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem +END +IOHIKeyboard.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIKeyboard.h +END +IOHIDUsageTables.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDUsageTables.h +END +IOHIDParameter.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDParameter.h +END +IOHIKeyboardMapper.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIKeyboardMapper.h +END +IOHIPointing.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIPointing.h +END +ev_keymap.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/ev_keymap.h +END +IOHIDSystem.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDSystem.h +END +IOHIDTypes.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDTypes.h +END +IOLLEvent.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOLLEvent.h +END +IOHIDShared.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDShared.h +END +IOHIDDescriptorParser.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDDescriptorParser.h +END +IOHIDevice.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/hidsystem/IOHIDevice.h +END diff --git a/i386/include/IOKit/hidsystem/.svn/entries b/i386/include/IOKit/hidsystem/.svn/entries new file mode 100644 index 0000000..841280e --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/entries @@ -0,0 +1,436 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/hidsystem +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOHIKeyboard.h +file + + + + +2013-08-27T23:54:25.000000Z +94a12f5e77c621a30d5f3a88b248027e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11146 + +IOHIDUsageTables.h +file + + + + +2013-08-27T23:54:25.000000Z +ce9974eaa13ae4e48c8053efaac94db6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +98997 + +IOHIDParameter.h +file + + + + +2013-08-27T23:54:25.000000Z +12f0b9b52b1128f5b4dde58f89bdb422 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10655 + +IOHIKeyboardMapper.h +file + + + + +2013-08-27T23:54:25.000000Z +e444bf69b1791f5ee5e35d640f41e388 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12632 + +IOHIPointing.h +file + + + + +2013-08-27T23:54:25.000000Z +f225bcddbfe7cb2381990646e57cf3f2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11667 + +ev_keymap.h +file + + + + +2013-08-27T23:54:25.000000Z +8d6ad7e9ba28d6510bfef94c62de11d8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6146 + +IOHIDSystem.h +file + + + + +2013-08-27T23:54:25.000000Z +ed8a79f5fd1be6f705b88cef26e44aaf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +33069 + +IOHIDTypes.h +file + + + + +2013-08-27T23:54:25.000000Z +b5b84e7db0ffe36cba395bb1eb44abd6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5699 + +IOLLEvent.h +file + + + + +2013-08-27T23:54:25.000000Z +17935c66e1f6fd887ccbedd6d475bf18 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22122 + +IOHIDShared.h +file + + + + +2013-08-27T23:54:25.000000Z +dd29aed9a85942ae54ae7fd7e139c91f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13015 + +IOHIDDescriptorParser.h +file + + + + +2013-08-27T23:54:25.000000Z +d2262481a48acaafbb4cd414fd33a0d2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +52794 + +IOHIDevice.h +file + + + + +2013-08-27T23:54:25.000000Z +70be8de95ce12c43d3fee989acf72ec9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2270 + diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDDescriptorParser.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDDescriptorParser.h.svn-base new file mode 100644 index 0000000..0a32647 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDDescriptorParser.h.svn-base @@ -0,0 +1,939 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __IOHIDDescriptorParser__ +#define __IOHIDDescriptorParser__ + +#include +#include +#include +#if !TARGET_OS_EMBEDDED + #include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if TARGET_OS_EMBEDDED +/* Types and enums required by these functions but not in IOTypes.h */ + +typedef UInt8 Byte; +typedef SInt8 SignedByte; +typedef unsigned long FourCharCode; +typedef FourCharCode OSType; +typedef UInt32 ByteCount; + +enum { + noErr = 0 +}; +#endif + +/* End missing types and enums */ + +enum +{ + kHIDSuccess = 0, + +/* HID assigned error numbers are -13949 .. -13900 */ + kHIDBaseError = -13950, + + kHIDNullStateErr, + kHIDBufferTooSmallErr, + kHIDValueOutOfRangeErr, + kHIDUsageNotFoundErr, + kHIDNotValueArrayErr, + kHIDInvalidPreparsedDataErr, + kHIDIncompatibleReportErr, + kHIDBadLogPhysValuesErr, + kHIDInvalidReportTypeErr, + kHIDInvalidReportLengthErr, + kHIDNullPointerErr, + kHIDBadParameterErr, + kHIDNotEnoughMemoryErr, + kHIDEndOfDescriptorErr, + kHIDUsagePageZeroErr, + kHIDBadLogicalMinimumErr, + kHIDBadLogicalMaximumErr, + kHIDInvertedLogicalRangeErr, + kHIDInvertedPhysicalRangeErr, + kHIDUnmatchedUsageRangeErr, + kHIDInvertedUsageRangeErr, + kHIDUnmatchedStringRangeErr, + kHIDUnmatchedDesignatorRangeErr, + kHIDReportSizeZeroErr, + kHIDReportCountZeroErr, + kHIDReportIDZeroErr, + kHIDInvalidRangePageErr, + + // + // HID device driver errors + // + + kHIDDeviceNotReady = -13910, // The device is still initializing, try again later + kHIDVersionIncompatibleErr, +}; + +// types of HID reports (input, output, feature) +enum +{ + kHIDInputReport = 1, + kHIDOutputReport, + kHIDFeatureReport, + kHIDUnknownReport = 255 +}; + +// flags passed to HIDOpenReportDescriptor +enum +{ + kHIDFlag_StrictErrorChecking = 0x00000001 +}; + +typedef UInt32 HIDReportType; +typedef UInt32 HIDUsage; + +typedef void *HIDPreparsedDataRef; + +/*! + @typedef HIDUsageAndPage + @abstract The HIDUsageAndPage data structure is used by HID clients when obtaining status of buttons to hold the usage page and usage of a button that is down. + @discussion Clients use the HIDUSageAndPage structure with the HIDGetButtonsEx function to obtain both the usage page and usage identifiers of each button that is down. + @field usage Specifies the usage identifier within the usage page specified by usagePage of a button that is down. + @field usagePage Specifies the usage page identifier of a button that is down. + */ +struct HIDUsageAndPage +{ + HIDUsage usage; + HIDUsage usagePage; +}; +typedef struct HIDUsageAndPage HIDUsageAndPage, *HIDUsageAndPagePtr; + +/*! + @typedef HIDCaps + @abstract The HIDCaps data structure is used by HID clients to hold the capabilities of a HID device. + @discussion This structure holds the parsed capabilities and data maximums returned for a device by the HIDGetCaps function. + @field usage Specifies the specific class of functionality that this device provides. This value is dependent and specific to the value provided in the usagePage field. For example, a keyboard could have a usagePage of kHIDUsagePage_Generic and a usage of kHIDUsage_Generic_Keyboard. + @field usagePage Specifies the usage page identifier for this top level collection. + @field inputReportByteLength Specifies the maximum length, in bytes, of an input report for this device, including the report ID which is unilaterally prepended to the device data. + @field outputReportByteLength Specifies the maximum length, in bytes, of an output report for this device, including the report ID which is unilaterally prepended to the device data. + @field featureReportByteLength Specifies the maximum length, in bytes, of a feature report for this device, including the report ID which is unilaterally prepended to the device data. + @field numberCollectionNodes Specifies the number of HIDCollectionNode structures that are returned for this top level collection by the HIDGetConnectionNodes function. + @field numberInputButtonCaps Specifies the number of input buttons. + @field numberInputValueCaps Specifies the number of input values. + @field numberOutputButtonCaps Specifies the number of output buttons. + @field numberOutputValueCaps Specifies the number of output values + @field numberFeatureButtonCaps Specifies the number of feature buttons. + @field numberFeatureValueCaps Specifies the number of feature values. + */ +struct HIDCaps +{ + HIDUsage usage; + HIDUsage usagePage; + ByteCount inputReportByteLength; + ByteCount outputReportByteLength; + ByteCount featureReportByteLength; + UInt32 numberCollectionNodes; + UInt32 numberInputButtonCaps; + UInt32 numberInputValueCaps; + UInt32 numberOutputButtonCaps; + UInt32 numberOutputValueCaps; + UInt32 numberFeatureButtonCaps; + UInt32 numberFeatureValueCaps; +}; +typedef struct HIDCaps HIDCaps, * HIDCapsPtr; + +struct HIDCapabilities { + HIDUsage usage; + HIDUsage usagePage; + ByteCount inputReportByteLength; + ByteCount outputReportByteLength; + ByteCount featureReportByteLength; + UInt32 numberCollectionNodes; + UInt32 numberInputButtonCaps; + UInt32 numberInputValueCaps; + UInt32 numberOutputButtonCaps; + UInt32 numberOutputValueCaps; + UInt32 numberFeatureButtonCaps; + UInt32 numberFeatureValueCaps; +}; +typedef struct HIDCapabilities HIDCapabilities, * HIDCapabilitiesPtr; + + +struct HIDCollectionNode +{ + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + UInt32 parent; + UInt32 numberOfChildren; + UInt32 nextSibling; + UInt32 firstChild; +}; +typedef struct HIDCollectionNode HIDCollectionNode, * HIDCollectionNodePtr; + +struct HIDButtonCaps +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + SInt32 startBit; // Added esb 9-29-99 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDButtonCaps HIDButtonCaps, * HIDButtonCapsPtr; + +struct HIDButtonCapabilities +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + SInt32 unitExponent; // Added KH 1/25/01 + SInt32 units; // Added KH 1/25/01 +// UInt32 reserved; // Not added KH 1/25/01 + SInt32 startBit; // Added esb 9-29-99 + UInt32 pbVersion; // Added KH 1/25/01 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDButtonCapabilities HIDButtonCapabilities, * HIDButtonCapabilitiesPtr; + +struct HIDValueCaps +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + UInt32 startBit; // Added by esb 9-28-99 + UInt32 bitSize; + UInt32 reportCount; + + SInt32 logicalMin; + SInt32 logicalMax; + SInt32 physicalMin; + SInt32 physicalMax; + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDValueCaps HIDValueCaps, * HIDValueCapsPtr; + +struct HIDValueCapabilities +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + UInt32 bitSize; + UInt32 reportCount; + + SInt32 logicalMin; + SInt32 logicalMax; + SInt32 physicalMin; + SInt32 physicalMax; + + SInt32 unitExponent; // Added KH 1/25/01 + SInt32 units; // Added KH 1/25/01 +// UInt32 reserved; // Not added KH 1/25/01 + SInt32 startBit; // Added esb 9-29-99 // Moved here KH 1/25/01 + UInt32 pbVersion; // Added KH 1/25/01 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDValueCapabilities HIDValueCapabilities, * HIDValueCapabilitiesPtr; + +/*! + @function HIDOpenReportDescriptor + @abstract The HIDOpenReportDescriptor function allocates the memory the parser needs to handle the given report descriptor, and then parses the report descriptor. + @discussion When the parsed information is no longer needed, clients should call the HIDCloseReportDescriptor function. + @param hidReportDescriptor Contains a pointer to the actual HID report descriptor from the USB device's firmware + @param descriptorLength The length of the HID report descriptor + @param preparsedDataRef Preparsed data reference to be used for subsequent function calls + @param flags Flags for this runction are kHIDFlag_StrictErrorChecking = 0x00000001 + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDOpenReportDescriptor (void * hidReportDescriptor, + ByteCount descriptorLength, + HIDPreparsedDataRef * preparsedDataRef, + UInt32 flags); + +/*! + @function HIDCloseReportDescriptor + @abstract Disposes of the memory the parser allocated for the HIDOpenReportDescriptor function. + @param hidReportDescriptor Contains a pointer to the actual HID report descriptor from the USB device's firmware + @param preparsedDataRef Preparsed data reference for the report that is returned by the HIDOpenReportDescriptor function. After making a call to the HIDCloseReportDescriptor function, the preparsedDataRef is invalid and should not be used. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDCloseReportDescriptor (HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonCaps + @abstract Returns the button capabilities structures for a HID device based on the given preparsed data. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria + @param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtonCaps (HIDReportType reportType, + HIDButtonCapsPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonCapabilities + @abstract Returns the button capabilities structures for a HID device based on the given preparsed data. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria + @param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtonCapabilities (HIDReportType reportType, + HIDButtonCapabilitiesPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetCaps + @abstract Returns the capabilities of a HID device based on the given preparsed data. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetCaps (HIDPreparsedDataRef preparsedDataRef, + HIDCapsPtr capabilities); + +/*! + @function HIDGetCapabilities + @abstract Returns the capabilities of a HID device based on the given preparsed data. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetCapabilities (HIDPreparsedDataRef preparsedDataRef, + HIDCapabilitiesPtr capabilities); + +/*! + @function HIDGetCollectionNodes + @abstract Returns an array of HIDCollectionNode structures that describe the relationships and layout of the link collections within this top level collection. + @discussion The length of the buffer required, in array elements, for an entire collection node array is found in the HIDCaps structure member numberCollectionNodes. You obtain the HIDCaps information by calling the HIDGetCaps function. For information on the relationships of link collections described by the data returned from this routine, see the descripton of the HIDCollectionNode structure. + @param collectionNodes Points to a caller-allocated array of HIDCollectionNode structures in which this routine returns an entry for each collection within the top level collection. A collection is a group of corresponding HID descriptors containing input, output, and feature items that have some common relationship to one another. For example, a pointer collection contains items for x and y position data, and button data. + @param collectionNodesSize On input, specifies the length in array elements of the buffer provided at collectionNodes. On output, this parameter is set to the number of entries in the collectionNodes array that were initialized. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetCollectionNodes (HIDCollectionNodePtr collectionNodes, + UInt32 * collectionNodesSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetScaledUsageValue + @abstract The HIDGetScaledUsageValue function returns the capabilities for all buttons for a given top level collection. + @discussion Clients who which to obtain all capabilities for a usage that contains multiple data items for a single usage that corresponds to a HID byte array, must call the HIDGetUsageValueArray function. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the value to be retrieved. + @param collection Optionally specifies the link collection identifier of the value to be retrieved. + @param usage Specifies the usage of the scaled value to be retrieved. + @param usageValue Points to a variable, that on return from this routine holds the scaled value retrieved from the device report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data + @param reportLength Specifies the length, in bytes, of the report data provided at report + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetScaledUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 * usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetSpecificButtonCaps + @abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificButtonCaps function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCaps function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCaps function. + @param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved. + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria. + @param buttonCapsLength On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificButtonCaps (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDButtonCapsPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificButtonCapabilities + @abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificButtonCapabilities function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCapabilities function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCapabilities function. + @param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved. + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria. + @param buttonCapsLength On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificButtonCapabilities (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDButtonCapabilitiesPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificValueCaps + @abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificValueCaps function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCaps function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCaps function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved. + @param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCaps structures that contain information for all values that meet the search criteria. + @param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificValueCaps (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDValueCapsPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificValueCapabilities + @abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificValueCapabilities function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCapabilities function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCapabilities function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved. + @param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCapabilities structures that contain information for all values that meet the search criteria. + @param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificValueCapabilities (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDValueCapabilitiesPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonsOnPage + @abstract Retrieves the button stat information for buttons on a specified usage page. + @param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies the usage page of the buttons for which to retrieve the current state. + @param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned. + @param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are perssed and belong to the usage page specified in the usagePage parameter. + @param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferTooSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtonsOnPage (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage * usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetButtons + @abstract The HIDGetButtons function takes a report from a HID device and gets the current state of the buttons in that report. + @param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport + @param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned. + @param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are pressed. + @param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferToSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the length, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtons (HIDReportType reportType, + UInt32 collection, + HIDUsageAndPagePtr usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +extern +OSStatus +HIDGetNextButtonInfo (HIDReportType reportType, + HIDUsage usagePage, + HIDUsage usage, + UInt32 * collection, + UInt8 * reportID, + HIDPreparsedDataRef preparsedDataRef); + +extern +OSStatus +HIDGetNextUsageValueInfo (HIDReportType reportType, + HIDUsage usagePage, + HIDUsage usage, + UInt32 * collection, + UInt8 * reportID, + HIDPreparsedDataRef preparsedDataRef); + +extern +OSStatus +HIDGetReportLength (HIDReportType reportType, + UInt8 reportID, + ByteCount * reportLength, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetUsageValue + @abstract The HIDGetUsageValue function returns a value from a device data report given a selected search criteria. + @discussion The HIDGetUsageValue function does not sign the value. To have the sign bit automatically applied, use the HIDGetScaledUsageValue function instead. For manually assigning the sign bit, the position of the sign bit can be found in the HIDValueCaps structure for this value. Clients who wish to obtain all data for a usage that contains multiple data items for a single usage, corresponding to a HID byte array, must call the HIDGetUsageValueArray function instead. + @param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the value to retrieve. + @param collection Optionally specifies the link collection identifier of the value to be retrieved. + @param usage Specifies the usage of the value to be retrieved. + @param usageValue Points to a variable, that on return from this routine holds the value retrieved from the device report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 * usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetUsageValueArray + @abstract The HIDGetUsageValueArray function returns a value from a device data report given a selected search criteria. + @discussion When the HIDGetUsageValueArray function retrieves the data, it fills in the buffer in little-endian order beginning with the least significant bit of the data for this usage. The data is filled in without regard to byte alignment and is shifted such that the least significant bit is placed as the 1st bit of the given buffer. + @param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the data to be retrieved. + @param collection Optionally specifies the link collection identifier of the data to be retrieved. + @param usage Specifies the usage identifier of the value to be retrieved. + @param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for the value and rounding the resulting value up to the nearest byte. + @param usageValueBufferSize Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in report. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetUsageValueArray (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + Byte * usageValueBuffer, + ByteCount usageValueBufferSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetValueCaps + @abstract The HIDGetValueCaps function retrieves the capabilities for all values for a specified top level collection. + @discussion The HIDGetValueCaps function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCaps function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCaps structures containing information for all values in the top level collection. + @param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetValueCaps (HIDReportType reportType, + HIDValueCapsPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetValueCapabilities + @abstract The HIDGetValueCapabilities function retrieves the capabilities for all values for a specified top level collection. + @discussion The HIDGetValueCapabilities function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCapabilities function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCapabilities structures containing information for all values in the top level collection. + @param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCapabilities function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetValueCapabilities (HIDReportType reportType, + HIDValueCapabilitiesPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +extern +OSStatus +HIDInitReport (HIDReportType reportType, + UInt8 reportID, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDMaxUsageListLength + @abstract The HIDMaxUsageListLength function returns the maximum number of buttons that can be returned from a given report type for the top level collection. + @param reportType Specifies the type of report for which to get a maximum usage count. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Optionally specifies the usage page identifier to use as a search criteria. If this parameter is zero, the function returns the number of buttons for the entire top-level collection regardless of the actual value of the usage page. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +UInt32 +HIDMaxUsageListLength (HIDReportType reportType, + HIDUsage usagePage, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDSetScaledUsageValue + @abstract The HIDSetScaledUsageValue function takes a signed physical (scaled) number and converts it to the logical, or device representation and inserts it in a given report. + @discussion The HIDSetScaledUsageValue function automatically handles the setting of the signed bit in the data to be sent to the device. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it will be ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValue Specifies the physical, or scaled, value to be set in the value for the given report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param Specifies the length, in bytes of the report data specified in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetScaledUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDSetButtons + @abstract The HIDSetButtons function takes a report from a HID device and returns the current state of the buttons in that report. + @param reportType Specifies the type of repor. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored. + @param usageList Points to a caller-allocated buffer that contains an array of button data to be set in the report in the report parameter. + @param usageListSize Specifies the size, in array elements, of the buffer provided in the usageList parameter. If an error is returned by a call to this function, the usageListLength parameter contains the location in the array provided in the usageList parameter where the error was encountered. All array entries encountered prior to the error location were successfully set in the report provided in the report parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetButtons (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage * usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDSetUsageValue + @abstract The HIDSetUsageValue function sets a value in a give report. + @discussion The HIDSetUsageVlaue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValue Specifies the data that is to be set in the value for the given report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDSetUsageValueArray + @abstract The HIDSetUsageValueArray function sets an array of values in a given report. + @discussion The HIDSetUsageValue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for this value and rounding the resulting value up to the nearest byte. + @param usageValueBufferLength Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetUsageValueArray (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + Byte * usageValueBuffer, + ByteCount usageValueBufferLength, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDUsageListDifference + @abstract The HIDUsageListDifference function compares and provides the differences between two lists of buttons. + @param previousUsageList Points to the older button list to be used for comparison. + @param currentUsageList Points to the newer button list to be used for comparison. + @param breakUsageList On return, points to a caller-allocated buffer that contains the buttons set in the older list, specified in the previousUsageList parameter, but not set in the new list, specified in the currentUsageList parameter. + @param makeUsageList On return, points to a caller-allocated buffer that contains the buttons set in the new list, specified in the currentUsageList parameter, but not set in the old list, specified in the previousUsageList parameter. + @param usageListsLength Specifies the length, in array elements, of the buffers provided in the currentUsageList and previousUssageList parameters. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDUsageListDifference (HIDUsage * previousUsageList, + HIDUsage * currentUsageList, + HIDUsage * breakUsageList, + HIDUsage * makeUsageList, + UInt32 usageListsSize); + +/*! + @function HIDSetButton + @abstract The HIDSetButton function takes a report from a HID device and sets the current state of the specified button in that report. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored. + @param usage Points to a caller-allocated buffer that contains the button data to be set in the report in the report parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetButton (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDParameter.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDParameter.h.svn-base new file mode 100644 index 0000000..f528d03 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDParameter.h.svn-base @@ -0,0 +1,310 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * evsio.h - Get/Set parameter calls for Event Status Driver. + * + * CAUTION: Developers should stick to the API exported in + * to guarantee + * binary compatability of their applications in future + * releases. + * + * HISTORY + * 22 May 1992 Mike Paquette at NeXT + * Created. + */ +#ifndef _DEV_EVSIO_H +#define _DEV_EVSIO_H + +/* Public type definitions. */ +#include +#include + +/* + * Identify this driver as one that uses the new driverkit and messaging API + */ +#ifndef _NeXT_MACH_EVENT_DRIVER_ +#define _NeXT_MACH_EVENT_DRIVER_ (1) +#endif /* !_NeXT_MACH_EVENT_DRIVER_ */ + +/* * */ + +#define kIOHIDKindKey "HIDKind" +#define kIOHIDInterfaceIDKey "HIDInterfaceID" +#define kIOHIDSubinterfaceIDKey "HIDSubinterfaceID" + +#define kIOHIDParametersKey "HIDParameters" + +#define kIOHIDVirtualHIDevice "HIDVirtualDevice" + +#define kIOHIDKeyRepeatKey "HIDKeyRepeat" +#define kIOHIDInitialKeyRepeatKey "HIDInitialKeyRepeat" +#define kIOHIDKeyMappingKey "HIDKeyMapping" +#define kIOHIDResetKeyboardKey "HIDResetKeyboard" + +#define kIOHIDKeyboardModifierMappingPairsKey "HIDKeyboardModifierMappingPairs" +#define kIOHIDKeyboardModifierMappingSrcKey "HIDKeyboardModifierMappingSrc" +#define kIOHIDKeyboardModifierMappingDstKey "HIDKeyboardModifierMappingDst" + +#define kIOHIDKeyboardCapsLockDoesLockKey "HIDKeyboardCapsLockDoesLock" +#define kIOHIDKeyboardSupportsF12EjectKey "HIDKeyboardSupportsF12Eject" +#define kIOHIDKeyboardSupportedModifiersKey "HIDKeyboardSupportedModifiers" + +#define kIOHIDPointerResolutionKey "HIDPointerResolution" +#define kIOHIDResetPointerKey "HIDResetPointer" +#define kIOHIDPointerConvertAbsoluteKey "HIDPointerConvertAbsolute" +#define kIOHIDPointerContactToMoveKey "HIDPointerContactToMove" +#define kIOHIDPointerPressureToClickKey "HIDPointerPressureToClick" +#define kIOHIDPointerButtonMode "HIDPointerButtonMode" +#define kIOHIDPointerButtonCountKey "HIDPointerButtonCount" + +#define kIOHIDPointerAccelerationKey "HIDPointerAcceleration" +#define kIOHIDPointerAccelerationSettingsKey "HIDPointerAccelerationSettings" +#define kIOHIDPointerAccelerationTypeKey "HIDPointerAccelerationType" +#define kIOHIDPointerAccelerationTableKey "HIDPointerAccelerationTable" + +#define kIOHIDScrollResetKey "HIDScrollReset" +#define kIOHIDScrollResolutionKey "HIDScrollResolution" +#define kIOHIDScrollReportRateKey "HIDScrollReportRate" +#define kIOHIDScrollAccelerationKey "HIDScrollAcceleration" +#define kIOHIDScrollAccelerationTypeKey "HIDScrollAccelerationType" +#define kIOHIDScrollAccelerationTableKey "HIDScrollAccelerationTable" + +#define kIOHIDScrollResolutionXKey "HIDScrollResolutionX" +#define kIOHIDScrollResolutionYKey "HIDScrollResolutionY" +#define kIOHIDScrollResolutionZKey "HIDScrollResolutionZ" + +#define kIOHIDScrollAccelerationTableXKey "HIDScrollAccelerationTableX" +#define kIOHIDScrollAccelerationTableYKey "HIDScrollAccelerationTableY" +#define kIOHIDScrollAccelerationTableZKey "HIDScrollAccelerationTableZ" + +#define kIOHIDScrollMouseButtonKey "HIDScrollMouseButton" + +#define kIOHIDScrollZoomModifierMaskKey "HIDScrollZoomModifierMask" + +#define kIOHIDTrackpadScrollAccelerationKey "HIDTrackpadScrollAcceleration" +#define kIOHIDMouseScrollAccelerationKey "HIDMouseScrollAcceleration" + +#define kIOHIDTrackpadAccelerationType "HIDTrackpadAcceleration" +#define kIOHIDMouseAccelerationType "HIDMouseAcceleration" + +#define kIOHIDClickTimeKey "HIDClickTime" +#define kIOHIDClickSpaceKey "HIDClickSpace" + +#define kIOHIDWaitCursorFrameIntervalKey "HIDWaitCursorFrameInterval" + +#define kIOHIDAutoDimThresholdKey "HIDAutoDimThreshold" +#define kIOHIDAutoDimStateKey "HIDAutoDimState" +#define kIOHIDAutoDimTimeKey "HIDAutoDimTime" +#define kIOHIDIdleTimeKey "HIDIdleTime" + +#define kIOHIDBrightnessKey "HIDBrightness" +#define kIOHIDAutoDimBrightnessKey "HIDAutoDimBrightness" + +#define kIOHIDFKeyModeKey "HIDFKeyMode" + +// if kIOHIDStickyKeysDisabledKey is 1, then all sticky keys functionality +// is completely turned off. Multiple shifts will have no effect. +#define kIOHIDStickyKeysDisabledKey "HIDStickyKeysDisabled" + +// if kIOHIDStickyKeysOnKey is 1 then a depressed modifier will stay down +// until a non-modifer key is pressed (or sticky keys is turned off) +#define kIOHIDStickyKeysOnKey "HIDStickyKeysOn" + +// if kIOHIDStickyKeysShiftTogglesKey is 1, then a sequence of five +// shift keys in sequence will toggle sticky keys on or off +#define kIOHIDStickyKeysShiftTogglesKey "HIDStickyKeysShiftToggles" + +// if kIOHIDMouseKeysOptionTogglesKey is 1, then a sequence of five +// option keys in sequence will toggle mouse keys on or off +#define kIOHIDMouseKeysOptionTogglesKey "HIDMouseKeysOptionToggles" + +// kIOHIDSlowKeysDelayKey represents the delay used for slow keys. +// if kIOHIDSlowKeysDelayKey is 0, then slow keys off +#define kIOHIDSlowKeysDelayKey "HIDSlowKeysDelay" + +#define kIOHIDF12EjectDelayKey "HIDF12EjectDelay" + +#define kIOHIDMouseKeysOnKey "HIDMouseKeysOn" + +#define kIOHIDUseKeyswitchKey "HIDUseKeyswitch" + +#define kIOHIDDisallowRemappingOfPrimaryClickKey "HIDDisallowRemappingOfPrimaryClick" +#define kIOHIDMouseKeysEnablesVirtualNumPadKey "HIDMouseKeysEnablesVirtualNumPad" + +#define kIOHIDResetLEDsKey "HIDResetLEDs" + + +#ifdef __ppc__ + // the following are misspelled keys present in the system + // they are being kept around, but will eventually be deprecated + #define kIOHIDSickyKeysDisabledKey kIOHIDStickyKeysDisabledKey + #define kIOHIDSickyKeysOnKey kIOHIDStickyKeysOnKey + #define kIOHIDSickyKeysShiftTogglesKey kIOHIDStickyKeysShiftTogglesKey +#endif + +// the following values are used in kIOHIDPointerButtonMode +typedef enum { + kIOHIDButtonMode_BothLeftClicks = 0, + kIOHIDButtonMode_ReverseLeftRightClicks = 1, + kIOHIDButtonMode_EnableRightClick = 2 +} IOHIDButtonModes; + +#ifdef _undef +#define EVS_PREFIX "Evs_" /* All EVS calls start with this string */ + +/* WaitCursor-related ioctls */ + +#define EVSIOSWT "Evs_SetWaitThreshold" +#define EVSIOSWT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSWS "Evs_SetWaitSustain" +#define EVSIOSWS_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSWFI "Evs_SetWaitFrameInterval" +#define EVSIOSWFI_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCWINFO "Evs_CurrentWaitCursorInfo" +#define EVSIOCWINFO_THRESH 0 +#define EVSIOCWINFO_SUSTAIN (EVSIOCWINFO_THRESH + EVS_PACKED_TIME_SIZE) +#define EVSIOCWINFO_FINTERVAL (EVSIOCWINFO_SUSTAIN + EVS_PACKED_TIME_SIZE) +#define EVSIOCWINFO_SIZE (EVSIOCWINFO_FINTERVAL + EVS_PACKED_TIME_SIZE) +#endif + +#define EVS_PACKED_TIME_SIZE (sizeof(UInt64) / sizeof( unsigned int)) + +/* Device control ioctls. Levels specified may be in the range 0 - 64. */ + +#define EVSIOSB kIOHIDBrightnessKey +#define EVSIOSB_SIZE 1 + +#define EVSIOSADB kIOHIDAutoDimBrightnessKey +#define EVSIOSADB_SIZE 1 + +#ifdef _undef +#define EVSIOSA "Evs_SetAttenuation" +#define EVIOSA_SIZE 1 + +#define EVSIO_DCTLINFO "Evs_DeviceControlInfo" +typedef enum { + EVSIO_DCTLINFO_BRIGHT, + EVSIO_DCTLINFO_ATTEN, + EVSIO_DCTLINFO_AUTODIMBRIGHT +} evsio_DCTLINFOIndices; +#define EVSIO_DCTLINFO_SIZE (EVSIO_DCTLINFO_AUTODIMBRIGHT + 1) +#endif + +/* + * Device status request + */ +#define EVSIOINFO NX_EVS_DEVICE_INFO + + +/* Keyboard-related ioctls - implemented within Event Sources */ + +#define EVSIOSKR kIOHIDKeyRepeatKey +#define EVSIOSKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSIKR kIOHIDInitialKeyRepeatKey +#define EVSIOSIKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIORKBD kIOHIDResetKeyboardKey +#define EVSIORKBD_SIZE 1 + +#define EVSIOCKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCKML kIOHIDKeyMappingKey +#define EVSIOCKML_SIZE 1 + +/* The following two tokens are for use with the get/set character routines. */ +#define EVSIOSKM kIOHIDKeyMappingKey +#define EVSIOSKM_SIZE 4096 + +#define EVSIOCKM kIOHIDKeyMappingKey +#define EVSIOCKM_SIZE 4096 + +/* Mouse-related ioctls - implemented within Event Sources */ + +#define EVSIOSMS kIOHIDPointerAccelerationKey +#define EVSIOSMS_SIZE (1) + +#define EVSIOCMS kIOHIDPointerAccelerationKey +#define EVSIOCMS_SIZE (1) + +#ifdef _undef +#define EVSIOSMH "Evs_SetMouseHandedness" +#define EVSIOSMH_SIZE 1 // value from NXMouseButton enum + +#define EVSIOCMH "Evs_CurrentMouseHandedness" +#define EVSIOCMH_SIZE 1 +#endif + +/* Generic pointer device controls, implemented by the Event Driver. */ +#define EVSIOSCT kIOHIDClickTimeKey +#define EVSIOSCT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSCS kIOHIDClickSpaceKey +typedef enum { + EVSIOSCS_X, + EVSIOSCS_Y +} evsioEVSIOSCSIndices; +#define EVSIOSCS_SIZE (EVSIOSCS_Y + 1) + +#define EVSIOSADT kIOHIDAutoDimThresholdKey +#define EVSIOSADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSADS kIOHIDAutoDimStateKey +#define EVSIOSADS_SIZE 1 + +#define EVSIORMS kIOHIDResetPointerKey +#define EVSIORMS_SIZE 1 + +#define EVSIOCCT kIOHIDClickTimeKey +#define EVSIOCCT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCADT kIOHIDAutoDimThresholdKey +#define EVSIOCADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOGDADT kIOHIDAutoDimTimeKey +#define EVSIOGDADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOIDLE kIOHIDIdleTimeKey +#define EVSIOIDLE_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCCS kIOHIDClickSpaceKey +typedef enum { + EVSIOCCS_X, + EVSIOCCS_Y +} evsioEVSIOCCSIndices; +#define EVSIOCCS_SIZE (EVSIOCCS_Y + 1) + +#define EVSIOCADS kIOHIDAutoDimStateKey +#define EVSIOCADS_SIZE 1 + +enum { + // Selectors for IOHIDGetModifierLockState and IOHIDSetModifierLockState + kIOHIDCapsLockState = 0x00000001, + kIOHIDNumLockState = 0x00000002, +}; + +#endif /* !_DEV_EVSIO_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDShared.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDShared.h.svn-base new file mode 100644 index 0000000..e7c5e3a --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDShared.h.svn-base @@ -0,0 +1,341 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + + evio.h + Ioctl calls for the events driver + Leovitch 02Jan88 + + Copyright 1988 NeXT, Inc. + + CAUTION: Developers should stick to the API exported in + to guarantee + binary compatability of their applications in future + releases. + + Modified: + + 09Dec88 Leo Broken out from evsio.h + 24Aug89 Ted ANSI function prototyping. + 19Feb90 Ted Major revision for multiple driver support. + 26Feb90 Ted New evioScreen structure and EVIOST ioctl. + 12Mar90 Ted New ev_unregister_screen function, SCREENTOKEN constant. + 06May90 Ted Added AALastEventSent and AALastEventConsumed to EvVars. + 22May90 Trey More wait cursor vars in EvVars. + 13Jun90 Ted NXCursorData structure. + 18Jun90 Ted Default wait cursor constants. + 26Sep90 Ted Enhanced cursor system to support intelligent drivers. + 26Nov90 Ted Removed NXSaveCursor and NXCursorData structures + 28Nov90 Ted Remove EvVars, rolled into EventGlobals + 28Nov90 Ted Renamed EventGlobals -> EvGlobals, eventGlobals -> evg + 05May92 Mike Reworked for NRW driver architecture. + +******************************************************************************/ + +#ifndef _DEV_EVIO_H +#define _DEV_EVIO_H + +#include + +__BEGIN_DECLS + +#if KERNEL +#include +#else /* !KERNEL */ +#include +#include +#endif /* KERNEL */ + +#include +#include +#include +#include + +/* + * Identify this driver as one that uses the new driverkit and messaging API + */ +#ifndef _NeXT_MACH_EVENT_DRIVER_ +#define _NeXT_MACH_EVENT_DRIVER_ (1) +#endif /* _NeXT_MACH_EVENT_DRIVER_ */ + + +/* Pressure Constants */ +#define MINPRESSURE EV_MINPRESSURE +#define MAXPRESSURE EV_MAXPRESSURE + +#define LLEQSIZE 240 /* Entries in low-level event queue */ + +typedef struct _NXEQElStruct { + int next; /* Slot of lleq for next event */ + ev_lock_data_t sema; /* Is high-level code reading this event now? */ + NXEvent event; /* The event itself */ +} NXEQElement; + + +/****************************************************************************** + SHARED MEMORY OVERVIEW + + PERSPECTIVE + The ev driver and PostScript share at least one page of wired memory. + This memory contains the low-level event queue which ev deposits events + into and PostScript reads events from. Also, this memory contains other + important data such as wait cursor state and some general cursor state. + This memory is critical for speed. That is, we avoid having to make + system calls for common operations. + + SHARED MEMORY REGIONS + There are currently three "regions" or "zones" delineated within this + shared memory. The first zone is the EvOffsets structure. This structure + contains two offsets from the beginning of shared memory. The first offset + is to the second zone, EvGlobals. The second offset is to the third + zone, private shmem for drivers. + + INITIALIZATION OF SHARED MEMORY + When the WindowServer starts up, it finds all screens that will be active. + It then opens the ev driver and calls the EVIOSSCR ioctl repeatedly for + each screen in use. This lets the ev driver set up the evScreen array + and fill in each element. This ioctl also returns to PostScript a running + total shared memory size with which to allocate. PostScript then allocates + a region of memory this size and calls evmmap to "map in" this shared + region. Evmmap initializes and fills in the EvOffsets and EvGlobals. + Next the WindowServer calls each screen in turn to register itself with + the ev driver in the same sequence as presented to EVIOSSCR. Each screen + driver calls ev_register_screen() which among other things allocates a + part of the private shmem (of the third shared memory zone) for the driver. + + DEBUGGING NOTES + You can easily display and set this shared memory from kgdb, but usually + cannot do so from within PostScript. Gdb (or some weird interaction + between gdb and the os) chokes on this shmem. So if you read or write + this area of memory, copy-on-write will occur and you'll get a completely + new page for PostScript. This will render the shared memory scheme + useless and you will have to restart PostScript. It was my understanding + that before, we were able to "read" this area from PS, but not write to + it (the idea behind copy-on-WRITE). However, this seems to be broken + in 2.0. We think this is a kernel bug. +******************************************************************************/ + +typedef volatile struct _evOffsets { + int evGlobalsOffset; /* Offset to EvGlobals structure */ + int evShmemOffset; /* Offset to private shmem regions */ +} EvOffsets; + +/****************************************************************************** + EvGlobals + This structures defines the portion of the events driver data structure + that is exported to the PostScript server. It contains the event queue + which is in memory shared between the driver and the PostScript server. + All the variables necessary to read and process events from the queue are + contained here. +******************************************************************************/ + +#ifndef __ppc__ +typedef volatile struct _evGlobals { + ev_lock_data_t cursorSema; /* set to disable periodic code */ + int eNum; /* Unique id for mouse events */ + int buttons; /* State of the mouse buttons 1==down, 0==up */ + int eventFlags; /* The current value of event.flags */ + int VertRetraceClock; /* The current value of event.time */ + IOGPoint cursorLoc; /* The current location of the cursor */ + int frame; /* current cursor frame */ + IOGBounds workBounds; /* bounding box of all screens */ + IOGBounds mouseRect; /* Rect for mouse-exited events */ + int version; /* for run time checks */ + int structSize; /* for run time checks */ + int lastFrame; + unsigned int reservedA[31]; + + unsigned reserved:27; + unsigned wantPressure:1; /* pressure in current mouseRect? */ + unsigned wantPrecision:1; /* precise coordinates in current mouseRect? */ + unsigned dontWantCoalesce:1;/* coalesce within the current mouseRect? */ + unsigned dontCoalesce:1; /* actual flag which determines coalescing */ + unsigned mouseRectValid:1; /* If nonzero, post a mouse-exited + whenever mouse outside mouseRect. */ + int movedMask; /* This contains an event mask for the + three events MOUSEMOVED, + LMOUSEDRAGGED, and RMOUSEDRAGGED. + It says whether driver should + generate those events. */ + ev_lock_data_t waitCursorSema; /* protects wait cursor fields */ + int AALastEventSent; /* timestamp for wait cursor */ + int AALastEventConsumed; /* timestamp for wait cursor */ + int waitCursorUp; /* Is wait cursor up? */ + char ctxtTimedOut; /* Has wait cursor timer expired? */ + char waitCursorEnabled; /* Play wait cursor game (per ctxt)? */ + char globalWaitCursorEnabled; /* Play wait cursor game (global)? */ + int waitThreshold; /* time before wait cursor appears */ + + int LLEHead; /* The next event to be read */ + int LLETail; /* Where the next event will go */ + int LLELast; /* The last event entered */ + NXEQElement lleq[LLEQSIZE]; /* The event queue itself */ +} EvGlobals; + +#else + +typedef volatile struct _evGlobals { + ev_lock_data_t cursorSema; /* set to disable periodic code */ + int LLEHead; /* The next event to be read */ + int LLETail; /* Where the next event will go */ + int LLELast; /* The last event entered */ + int eNum; /* Unique id for mouse events */ + int buttons; /* State of the mouse buttons 1==down, 0==up */ + int eventFlags; /* The current value of event.flags */ + int VertRetraceClock; /* The current value of event.time */ + IOGPoint cursorLoc; /* The current location of the cursor */ + int frame; /* current cursor frame */ + IOGBounds workBounds; /* bounding box of all screens */ + IOGBounds mouseRect; /* Rect for mouse-exited events */ + int version; /* for run time checks */ + int structSize; /* for run time checks */ + int lastFrame; + unsigned int reservedA[31]; + + unsigned reserved:27; + unsigned wantPressure:1; /* pressure in current mouseRect? */ + unsigned wantPrecision:1; /* precise coordinates in current mouseRect? */ + unsigned dontWantCoalesce:1;/* coalesce within the current mouseRect? */ + unsigned dontCoalesce:1; /* actual flag which determines coalescing */ + unsigned mouseRectValid:1; /* If nonzero, post a mouse-exited + whenever mouse outside mouseRect. */ + int movedMask; /* This contains an event mask for the + three events MOUSEMOVED, + LMOUSEDRAGGED, and RMOUSEDRAGGED. + It says whether driver should + generate those events. */ + int AALastEventSent; /* timestamp for wait cursor */ + int AALastEventConsumed; /* timestamp for wait cursor */ + ev_lock_data_t waitCursorSema; /* protects wait cursor fields */ + int waitCursorUp; /* Is wait cursor up? */ + char ctxtTimedOut; /* Has wait cursor timer expired? */ + char waitCursorEnabled; /* Play wait cursor game (per ctxt)? */ + char globalWaitCursorEnabled; /* Play wait cursor game (global)? */ + int waitThreshold; /* time before wait cursor appears */ + NXEQElement lleq[LLEQSIZE]; /* The event queue itself */ +} EvGlobals; +#endif + +/* These evio structs are used in various calls supported by the ev driver. */ + +struct evioLLEvent { + int setCursor; + int type; + IOGPoint location; + NXEventData data; + int setFlags; + int flags; +}; + +typedef struct evioLLEvent _NXLLEvent; + +#ifdef mach3xxx + +/* + * On a keypress of a VOL UP or VOL DOWN key, we send a message to the + * sound server to notify it of the volume change. The message includes + * a flag to indicate which key was pressed, and the machine independant + * flag bits to indicate which modifier keys were pressed. + */ + +struct evioSpecialKeyMsg +{ + msg_header_t Head; + msg_type_t keyType; + int key; // special key number, from bsd/dev/ev_keymap.h + msg_type_t directionType; + int direction; // NX_KEYDOWN, NX_KEYUP from event.h + msg_type_t flagsType; + int flags; // device independant flags from event.h + msg_type_t levelType; + int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME +}; +#else +struct evioSpecialKeyMsg +{ + mach_msg_header_t Head; + int key; // special key number, from bsd/dev/ev_keymap.h + int direction; // NX_KEYDOWN, NX_KEYUP from event.h + int flags; // device independant flags from event.h + int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME +}; +#endif + +#define EV_SPECIAL_KEY_MSG_ID (('S'<<24) | ('k'<<16) | ('e'<<8) | ('y')) +typedef struct evioSpecialKeyMsg *evioSpecialKeyMsg_t; + +/* + * Volume ranges + */ +#define EV_AUDIO_MIN_VOLUME 0 +#define EV_AUDIO_MAX_VOLUME 64 + +#define kIOHIDSystemClass "IOHIDSystem" +#define kIOHIKeyboardClass "IOHIKeyboard" +#define kIOHIPointingClass "IOHIPointing" + +#define IOHIDSYSTEM_CONFORMSTO kIOHIDSystemClass + +enum { + kIOHIDCurrentShmemVersion = 3, + kIOHIDEventNotification = 0, +}; + +enum { + kIOHIDServerConnectType = 0, + kIOHIDParamConnectType = 1, + kIOHIDEventSystemConnectType = 3, +}; + +enum { + kIOHIDGlobalMemory = 0 +}; + +enum { + kIOHIDEventQueueTypeKernel = 0, + kIOHIDEventQueueTypeUser = 1 +}; + +#ifdef KERNEL +typedef UInt16 (*MasterVolumeUpdate)(void); +typedef bool (*MasterMuteUpdate)(void); + +typedef struct { + MasterVolumeUpdate incrementMasterVolume; + MasterVolumeUpdate decrementMasterVolume; + MasterMuteUpdate toggleMasterMute; +} MasterAudioFunctions; + +extern MasterAudioFunctions *masterAudioFunctions; +#endif + +#ifndef KERNEL +#ifndef _IOKIT_IOHIDLIB_H +#include +#endif +#endif /* !KERNEL */ + +__END_DECLS + + +#endif /* !_DEV_EVIO_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDSystem.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDSystem.h.svn-base new file mode 100644 index 0000000..1a78a38 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDSystem.h.svn-base @@ -0,0 +1,785 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * EventDriver.h - Exported Interface Event Driver object. + * + * The EventDriver is a pseudo-device driver. + * + * HISTORY + * 19 Mar 1992 Mike Paquette at NeXT + * Created. + * 4 Aug 1993 Erik Kay at NeXT + * API cleanup + */ + +#ifndef _IOHIDSYSTEM_H +#define _IOHIDSYSTEM_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if TARGET_OS_EMBEDDED +class IOGraphicsDevice; +#else +#include +#endif +#include +#include +#include +#include +#include +#include /* For NX_NUM_SCANNED_SPECIALKEYS */ + + +// The following messages should be unique across the entire system +#ifndef sub_iokit_hidsystem +#define sub_iokit_hidsystem err_sub(14) +#endif + +#define kIOHIDSystem508MouseClickMessage iokit_family_msg(sub_iokit_hidsystem, 1) +#define kIOHIDSystemDeviceSeizeRequestMessage iokit_family_msg(sub_iokit_hidsystem, 2) +#define kIOHIDSystem508SpecialKeyDownMessage iokit_family_msg(sub_iokit_hidsystem, 3) + +class IOHIDKeyboardDevice; +class IOHIDPointingDevice; +class IOHIDEvent; + +class IOHIDSystem : public IOService +{ + OSDeclareDefaultStructors(IOHIDSystem); + + friend class IOHIDUserClient; + friend class IOHIDParamUserClient; + friend class IOHIDEventSystemUserClient; + +private: + IOWorkLoop * workLoop; + IOTimerEventSource * timerES; + IOTimerEventSource * vblES; + IOInterruptEventSource * eventConsumerES; + IOInterruptEventSource * keyboardEQES; + IOCommandGate * cmdGate; + IOUserClient * serverConnect; + IOUserClient * paramConnect; + IONotifier * eventPublishNotify; + IONotifier * eventTerminateNotify; + IONotifier * publishNotify; + IONotifier * terminateNotify; + + OSArray * ioHIDevices; + OSSet * touchEventPosters; + + // Ports on which we hold send rights + mach_port_t eventPort; // Send msg here when event queue + // goes non-empty + mach_port_t stackShotPort; + mach_port_t _specialKeyPort[NX_NUM_SCANNED_SPECIALKEYS]; // Special key msgs + void *eventMsg; // Msg to be sent to Window Server. + void *stackShotMsg; // Msg to be sent to Stack Shot. + + // Shared memory area information + IOBufferMemoryDescriptor * globalMemory; + uintptr_t shmem_addr; // kernel address of shared memory + vm_size_t shmem_size; // size of shared memory + + // Pointers to structures which occupy the shared memory area. + volatile void *evs; // Pointer to private driver shmem + volatile EvGlobals *evg; // Pointer to EvGlobals (shmem) + // Internal variables related to the shared memory area + int lleqSize; // # of entries in low-level queue + // FIXME: why is this ivar lleqSize an ivar? {Dan] + + // Screens list + vm_size_t evScreenSize; // Byte size of evScreen array + void *evScreen; // array of screens known to driver + volatile void *lastShmemPtr; // Pointer used to index thru shmem + // while assigning shared areas to + // drivers. + int screens; // running total of allocated screens + UInt32 cursorScreens; // bit mask of screens with cursor present + UInt32 cursorPinScreen;// a screen to pin against + IOGBounds cursorPin; // Range to which cursor is pinned + // while on this screen. + IOGBounds workSpace; // IOGBounds of full workspace. + // Event Status state - This includes things like event timestamps, + // time til screen dim, and related things manipulated through the + // Event Status API. + // + IOGPoint pointerLoc; // Current pointing device location + // The value leads evg->cursorLoc. + IOGPoint pointerDelta; // The cumulative pointer delta values since + // previous mouse move event was posted + + IOGPoint clickLoc; // location of last mouse click + IOGPoint clickSpaceThresh; // max mouse delta to be a doubleclick + int clickState; // Current click state + + bool evOpenCalled; // Has the driver been opened? + bool evInitialized; // Has the first-open-only initialization run? + bool evStateChanging; // Is the event system state changing. + bool eventsOpen; // Boolean: has evmmap been called yet? + bool cursorStarted; // periodic events running? + bool cursorEnabled; // cursor positioning ok? + bool cursorCoupled; // cursor positioning on pointer moves ok? + bool cursorPinned; // cursor positioning on pointer moves ok? + + short leftENum; // Unique ID for last left down event + short rightENum; // Unique ID for last right down event + + // The periodic event mechanism timestamps and state + // are recorded here. + AbsoluteTime thisPeriodicRun; + AbsoluteTime periodicEventDelta;// Time between periodic events + // todo: make infinite + AbsoluteTime clickTime; // Timestamps used to determine doubleclicks + AbsoluteTime clickTimeThresh; + + AbsoluteTime waitSustain; // Sustain time before removing cursor + AbsoluteTime waitSusTime; // Sustain counter + AbsoluteTime waitFrameRate; // Ticks per wait cursor frame + AbsoluteTime waitFrameTime; // Wait cursor frame timer + + AbsoluteTime lastRelativeEventTime; // Used to post mouse events once per frame + AbsoluteTime lastRelativeMoveTime; + AbsoluteTime lastEventTime; + AbsoluteTime lastUndimEvent; + SInt32 postDeltaX, accumDX; + SInt32 postDeltaY, accumDY; + + // Flags used in scheduling periodic event callbacks + bool needSetCursorPosition; + bool needToKickEventConsumer; + + IOService * displayManager; // points to display manager + IOPMPowerFlags displayState; + + IOService * rootDomain; + AbsoluteTime stateChangeDeadline; + + OSDictionary * savedParameters; // keep user settings + + const char * registryName; // cache our name + UInt32 maxWaitCursorFrame; // animation frames + UInt32 firstWaitCursorFrame; // + + int cachedEventFlags; + OSArray * cachedButtonStates; + + OSArray * systemInfo; + + IOHIDPointingDevice * _hidPointingDevice; + IOHIDKeyboardDevice * _hidKeyboardDevice; + + unsigned consumedKeyCode; + + OSObject * lastSender; + + UInt32 scrollZoomMask; + + bool setParamPropertiesInProgress; + + OSSet * dataQueueSet; + +private: + void vblEvent(void); + UInt8 getSubtypeForSender(OSObject * sender); + void updateMouseEventForSender(OSObject * sender, NXEventData * evData); + void updateMouseMoveEventForSender(OSObject * sender, NXEventData * evData); + void updateScrollEventForSender(OSObject * sender, NXEventData * evData); + static void _vblEvent(OSObject *self, IOTimerEventSource *sender); + + inline short getUniqueEventNum(); + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags, unsigned long, IOService * ); + /* Resets */ + void _resetMouseParameters(); + + /* Initialize the shared memory area */ + void initShmem(bool clean); + /* Dispatch low level events through shared memory to the WindowServer */ + void postEvent(int what, + /* at */ IOGPoint * location, + /* atTime */ AbsoluteTime ts, + /* withData */ NXEventData * myData, + /* sender */ OSObject * sender = 0, + /* pid */ UInt32 extPID = 0, + /* processKEQ*/bool processKEQ = true); + /* Dispatch mechanisms for screen state changes */ + void evDispatch( + /* command */ EvCmd evcmd); + /* Dispatch mechanism for special key press */ + void evSpecialKeyMsg(unsigned key, + /* direction */ unsigned dir, + /* flags */ unsigned f, + /* level */ unsigned l); + /* Message the event consumer to process posted events */ + void kickEventConsumer(); + void sendStackShotMessage(); + + OSDictionary * createFilteredParamPropertiesForService(IOService * service, OSDictionary * dict); + + static void _periodicEvents(IOHIDSystem * self, + IOTimerEventSource *timer); + + static void doSpecialKeyMsg(IOHIDSystem * self, + struct evioSpecialKeyMsg *msg); + static void doKickEventConsumer(IOHIDSystem * self); + + static void doProcessKeyboardEQ(IOHIDSystem * self); + static void processKeyboardEQ(IOHIDSystem * self, AbsoluteTime * deadline = 0); + + static bool genericNotificationHandler( void * target, + void * ref, IOService * newService ); + + static bool handlePublishNotification( void * target, IOService * newService ); + + static bool handleTerminateNotification( void * target, IOService * service ); + + static void makeNumberParamProperty( OSDictionary * dict, const char * key, + unsigned long long number, unsigned int bits ); + + static void makeInt32ArrayParamProperty( OSDictionary * dict, const char * key, + UInt32 * array, unsigned int count ); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIDSystem(Input) category; + * the declarations have now been merged directly into this class. + * + * Exported Interface Event Driver object input services. + */ + +private: + // Schedule next periodic run based on current event system state. + void scheduleNextPeriodicEvent(); + // Message invoked to run periodic events. This method runs in the workloop. + void periodicEvents(IOTimerEventSource *timer); + // Start the cursor running. + bool startCursor(); + // Repin cursor location. + bool resetCursor(); + // Wait Cursor machinery. + void showWaitCursor(); + void hideWaitCursor(); + void animateWaitCursor(); + void changeCursor(int frame); + // Return screen number a point lies on. + int pointToScreen(IOGPoint * p); + + inline void showCursor(); + inline void hideCursor(); + inline void moveCursor(); + // Claim ownership of event sources. + void attachDefaultEventSources(); + // Give up ownership of event sources. + void detachEventSources(); + bool registerEventSource(IOService * source); + + // Set abs cursor position. + void setCursorPosition(IOGPoint * newLoc, bool external, OSObject * sender=0); + void _setButtonState(int buttons, + /* atTime */ AbsoluteTime ts, + OSObject * sender); + void _setCursorPosition(IOGPoint * newLoc, bool external, bool proximityChange = false, OSObject * sender=0); + + static bool _idleTimeSerializerCallback(void * target, void * ref, OSSerialize *s); + + void _postMouseMoveEvent(int what, + IOGPoint * location, + AbsoluteTime theClock, + OSObject * sender); + void createParameters( void ); + +/* END HISTORICAL NOTE */ + +public: + static IOHIDSystem * instance(); /* Return the current instance of the */ + /* EventDriver, or 0 if none. */ + static void scaleLocationToCurrentScreen(IOGPoint *location, IOGBounds *bounds); + + virtual bool init(OSDictionary * properties = 0); + virtual IOHIDSystem * probe(IOService * provider, + SInt32 * score); + virtual bool start(IOService * provider); + virtual IOReturn message(UInt32 type, IOService * provider, + void * argument); + virtual void free(); + virtual bool attach( IOService * provider ); + virtual void detach( IOService * provider ); + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOReturn evOpen(void); + virtual IOReturn evClose(void); + + virtual IOReturn setProperties( OSObject * properties ); + virtual IOReturn setParamProperties(OSDictionary * dict); + + /* Create the shared memory area */ + virtual IOReturn createShmem(void*,void*,void*,void*,void*,void*); + + /* register the IODataQueue for the new user events */ + virtual IOReturn registerEventQueue(IODataQueue * queue); + + /* Unregister the IODataQueue for the new user events */ + virtual IOReturn unregisterEventQueue(IODataQueue * queue); + + /* Set the port for event available notify msg */ + virtual void setEventPort(mach_port_t port); + /* Set the port for the special key keypress msg */ + virtual IOReturn setSpecialKeyPort( + /* keyFlavor */ int special_key, + /* keyPort */ mach_port_t key_port); + virtual mach_port_t specialKeyPort(int special_key); + + + virtual IOReturn newUserClient(task_t owningTask, + /* withToken */ void * security_id, + /* ofType */ UInt32 type, + /* withProps*/ OSDictionary * properties, + /* client */ IOUserClient ** handler); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIPointingEvents protocol; + * the declarations have now been merged directly into this class. + */ + +public: + /* Mouse event reporting */ + virtual void relativePointerEvent(int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + + /* Tablet event reporting */ + virtual void absolutePointerEvent(int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + + /* Mouse scroll wheel event reporting */ + virtual void scrollWheelEvent(short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + + + virtual void tabletEvent(NXEventData *tabletData, + AbsoluteTime ts); + + virtual void proximityEvent(NXEventData *proximityData, + AbsoluteTime ts); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIKeyboardEvents protocol; + * the declarations have now been merged directly into this class. + */ + +public: + virtual void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + virtual void keyboardSpecialEvent( unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + virtual void updateEventFlags(unsigned flags); /* Does not generate events */ + + + + +private: + + /* + * statics for upstream callouts + */ + + void _scaleLocationToCurrentScreen(IOGPoint *location, IOGPoint *fraction, IOGBounds *bounds); // Should this one be public??? + + static void _relativePointerEvent(IOHIDSystem * self, + int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + /* Tablet event reporting */ + static void _absolutePointerEvent(IOHIDSystem * self, + int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + /* Mouse scroll wheel event reporting */ + static void _scrollWheelEvent( IOHIDSystem *self, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + IOFixed fixedDelta1, + IOFixed fixedDelta2, + IOFixed fixedDelta3, + SInt32 pointDeltaAxis1, + SInt32 pointDeltaAxis2, + SInt32 pointDeltaAxis3, + UInt32 options, + AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _tabletEvent( IOHIDSystem *self, + NXEventData *tabletData, + AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _proximityEvent( IOHIDSystem *self, + NXEventData *proximityData, + AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _keyboardEvent( IOHIDSystem * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _keyboardSpecialEvent(IOHIDSystem * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _updateEventFlags( IOHIDSystem * self, + unsigned flags, + OSObject * sender, + void * refcon); /* Does not generate events */ + + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOUserClient protocol; + * the declarations have now been merged directly into this class. + */ + +public: + + virtual IOReturn setEventsEnable(void*,void*,void*,void*,void*,void*); + virtual IOReturn setCursorEnable(void*,void*,void*,void*,void*,void*); + virtual IOReturn extPostEvent(void*,void*,void*,void*,void*,void*); + virtual IOReturn extSetMouseLocation(void*,void*,void*,void*,void*,void*); + virtual IOReturn extGetButtonEventNum(void*,void*,void*,void*,void*,void*); + IOReturn extSetBounds( IOGBounds * bounds ); + IOReturn extGetModifierLockState(void*,void*,void*,void*,void*,void*); + IOReturn extSetModifierLockState(void*,void*,void*,void*,void*,void*); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOScreenRegistration protocol; + * the declarations have now been merged directly into this class. + * + * Methods exported by the EventDriver for display systems. + * + * The screenRegister protocol is used by frame buffer drivers to register + * themselves with the Event Driver. These methods are called in response + * to an _IOGetParameterInIntArray() call with "IO_Framebuffer_Register" or + * "IO_Framebuffer_Unregister". + */ + +public: + virtual int registerScreen(IOGraphicsDevice * instance, + /* bounds */ IOGBounds * bp); +// /* shmem */ void ** addr, +// /* size */ int * size) + virtual void unregisterScreen(int index); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOWorkspaceBounds protocol; + * the declarations have now been merged directly into this class. + * + * Absolute position input devices and some specialized output devices + * may need to know the bounding rectangle for all attached displays. + * The following method returns a IOGBounds* for the workspace. Please note + * that the bounds are kept as signed values, and that on a multi-display + * system the minx and miny values may very well be negative. + */ + +public: + virtual IOGBounds * workspaceBounds(); + +/* END HISTORICAL NOTES */ + +private: +void relativePointerEvent( int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + /* senderID */ OSObject * sender); + + /* Tablet event reporting */ +void absolutePointerEvent( int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + /* senderID */ OSObject * sender); + + /* Mouse scroll wheel event reporting */ +void scrollWheelEvent( short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + IOFixed fixedDelta1, + IOFixed fixedDelta2, + IOFixed fixedDelta3, + SInt32 pointDeltaAxis1, + SInt32 pointDeltaAxis2, + SInt32 pointDeltaAxis3, + UInt32 options, + AbsoluteTime ts, + OSObject * sender); + +void tabletEvent( NXEventData * tabletData, + AbsoluteTime ts, + OSObject * sender); + +void proximityEvent( NXEventData * proximityData, + AbsoluteTime ts, + OSObject * sender); + +void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender); + +void keyboardSpecialEvent( unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender); + +void updateEventFlags(unsigned flags, OSObject * sender); + +/* + * COMMAND GATE COMPATIBILITY: + * The following method is part of the work needed to make IOHIDSystem + * compatible with IOCommandGate. The use of IOCommandQueue has been + * deprecated, thus requiring this move. This should allow for less + * context switching as all actions formerly run on the I/O Workloop + * thread, will now be run on the caller thread. The static methods + * will be called from cmdGate->runAction and returns the appropriate + * non-static helper method. Arguments are stored in the void* array, + * args, and are passed through. Since we are returning in the static + * function, gcc3 should translate that to one instruction, thus + * minimizing cost. + */ + +static IOReturn doEvClose (IOHIDSystem *self); + IOReturn evCloseGated (void); + +static IOReturn doSetEventsEnablePre (IOHIDSystem *self, void *p1); + IOReturn setEventsEnablePreGated (void *p1); + +static IOReturn doSetEventsEnablePost (IOHIDSystem *self, void *p1); + IOReturn setEventsEnablePostGated (void *p1); + +static IOReturn doUnregisterScreen (IOHIDSystem *self, void * arg0); + void unregisterScreenGated (int index); + +static IOReturn doCreateShmem (IOHIDSystem *self, void * arg0); + IOReturn createShmemGated (void * p1); + +static IOReturn doRegisterEventQueue (IOHIDSystem *self, void * arg0); + IOReturn registerEventQueueGated (void * p1); + +static IOReturn doUnregisterEventQueue (IOHIDSystem *self, void * arg0); + IOReturn unregisterEventQueueGated (void * p1); + +static IOReturn doRelativePointerEvent (IOHIDSystem *self, void * args); + void relativePointerEventGated(int buttons, + int dx, + int dy, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doAbsolutePointerEvent (IOHIDSystem *self, void * args); + void absolutePointerEventGated (int buttons, + IOGPoint * newLoc, + IOGBounds *bounds, + bool proximity, + int pressure, + int stylusAngle, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doScrollWheelEvent(IOHIDSystem *self, void * args); + void scrollWheelEventGated (short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + IOFixed fixedDelta1, + IOFixed fixedDelta2, + IOFixed fixedDelta3, + SInt32 pointDeltaAxis1, + SInt32 pointDeltaAxis2, + SInt32 pointDeltaAxis3, + UInt32 options, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doTabletEvent (IOHIDSystem *self, void * arg0, void * arg1, void * arg2); + void tabletEventGated ( NXEventData *tabletData, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doProximityEvent (IOHIDSystem *self, void * arg0, void * arg1, void * arg2); + void proximityEventGated ( NXEventData *proximityData, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doKeyboardEvent (IOHIDSystem *self, void * args); + void keyboardEventGated (unsigned eventType, + unsigned flags, + unsigned key, + unsigned charCode, + unsigned charSet, + unsigned origCharCode, + unsigned origCharSet, + unsigned keyboardType, + bool repeat, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doKeyboardSpecialEvent (IOHIDSystem *self, void * args); + void keyboardSpecialEventGated ( + unsigned eventType, + unsigned flags, + unsigned key, + unsigned flavor, + UInt64 guid, + bool repeat, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doUpdateEventFlags (IOHIDSystem *self, void * args); + void updateEventFlagsGated (unsigned flags, OSObject * sender); + +static IOReturn doNewUserClient (IOHIDSystem *self, void * args); + IOReturn newUserClientGated (task_t owningTask, + void * security_id, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler); + +static IOReturn doSetCursorEnable (IOHIDSystem *self, void * arg0); + IOReturn setCursorEnableGated (void * p1); + +static IOReturn doExtPostEvent(IOHIDSystem *self, void * arg0, void * arg1, void * arg2, void * arg3); + IOReturn extPostEventGated (void * p1, void * p2, void * p3); + +static IOReturn doExtSetMouseLocation (IOHIDSystem *self, void * args); + IOReturn extSetMouseLocationGated (void * args); + +static IOReturn doExtGetButtonEventNum (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn extGetButtonEventNumGated (void * p1, void * p2); + +static IOReturn doSetParamPropertiesPre (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn setParamPropertiesPreGated (OSDictionary * dict, OSIterator ** pOpenIter); + +static IOReturn doSetParamPropertiesPost (IOHIDSystem *self, void * arg0); + IOReturn setParamPropertiesPostGated (OSDictionary * dict); + +static IOReturn doExtGetToggleState (IOHIDSystem *self, void *p1, void *p2); +static IOReturn doExtSetToggleState (IOHIDSystem *self, void *p1, void *p2); + IOReturn getCapsLockState(unsigned int *state_O); + IOReturn setCapsLockState(unsigned int state_I); + IOReturn getNumLockState(unsigned int *state_O); + IOReturn setNumLockState(unsigned int state_I); + +/* END COMMAND GATE COMPATIBILITY */ + +public: + virtual void setStackShotPort(mach_port_t port); + + virtual UInt32 eventFlags(); + + virtual void dispatchEvent(IOHIDEvent *event, IOOptionBits options=0); + +}; + +#endif /* !_IOHIDSYSTEM_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDTypes.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDTypes.h.svn-base new file mode 100644 index 0000000..786af07 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDTypes.h.svn-base @@ -0,0 +1,171 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + ev_types.h + Data types for the events status driver. + This file contains public API. + mpaque 11Oct91 + + Copyright 1991 NeXT Computer, Inc. + + Modified: + +******************************************************************************/ + +#ifndef _DEV_EV_TYPES_H +#define _DEV_EV_TYPES_H + +#include +#include +#include + +/* Shared memory versions */ +#define EVENT_SYSTEM_VERSION 2 + +/* Maximum length of SetMouseScaling arrays */ +#define NX_MAXMOUSESCALINGS 20 + +typedef struct evsioKeymapping /* Match old struct names in kernel */ +{ + int size; + char *mapping; +} NXKeyMapping; + +typedef struct evsioMouseScaling /* Match old struct names in kernel */ +{ + int numScaleLevels; + short scaleThresholds[NX_MAXMOUSESCALINGS]; + short scaleFactors[NX_MAXMOUSESCALINGS]; +} NXMouseScaling; + +typedef enum { + NX_OneButton, + NX_LeftButton, + NX_RightButton +} NXMouseButton; + +/* + * NXEventSystemInfo() information structures. These are designed to + * allow for expansion. + * + * The current implementation of NXEventSystemInfo() uses an ioctl call. + * THIS WILL CHANGE. + */ + +/* + * Generic query max size and typedefs. + * + * The maximum size is selected to support anticipated future extensions + * of request flavors. Certain flavors planned for future releases may + * require roughtly 800 ints to represent. We allow a little extra, in + * case further growth is needed. + */ +typedef int *NXEventSystemInfoType; +#define NX_EVS_INFO_MAX (1024) /* Max array size */ +typedef int NXEventSystemInfoData[NX_EVS_INFO_MAX]; + +/* Event System Devices query */ +#define NX_EVS_DEVICE_MAX 16 + + /* Interface types */ +#define NX_EVS_DEVICE_INTERFACE_OTHER 0 +#define NX_EVS_DEVICE_INTERFACE_NeXT 1 // NeXT custom, in older sys +#define NX_EVS_DEVICE_INTERFACE_ADB 2 // NeXT/fruit keybds/mice +#define NX_EVS_DEVICE_INTERFACE_ACE 3 // For x86 PC keyboards +#define NX_EVS_DEVICE_INTERFACE_SERIAL_ACE 4 // For PC serial mice +#define NX_EVS_DEVICE_INTERFACE_BUS_ACE 5 // For PC bus mice +#define NX_EVS_DEVICE_INTERFACE_HIL 6 // For HIL hp keyboard +#define NX_EVS_DEVICE_INTERFACE_TYPE5 7 // For Sun Type5 keyboard + +/* + * Note! if any new interface types are added above, the following + * definition of the number of interfaces supported must reflect this. + * This is used in the libkeymap project (storemap.c module) which needs + * to be cognizant of the number of new devices coming online + * via support for heterogeneous architecture platforms. + * e.g., PCs, HP's HIL, Sun's Type5 keyboard,... + */ +#define NUM_SUPPORTED_INTERFACES (NX_EVS_DEVICE_INTERFACE_TYPE5 + 1) + // Other, NeXT, ADB, ACE,... + + /* Device types */ +#define NX_EVS_DEVICE_TYPE_OTHER 0 +#define NX_EVS_DEVICE_TYPE_KEYBOARD 1 +#define NX_EVS_DEVICE_TYPE_MOUSE 2 // Relative position devices +#define NX_EVS_DEVICE_TYPE_TABLET 3 // Absolute position devices + +typedef struct { + int interface; /* NeXT, ADB, other */ + int interface_addr; /* Device address on the interface */ + int dev_type; /* Keyboard, mouse, tablet, other */ + int id; /* manufacturer's device handler ID */ +} NXEventSystemDevice; + +typedef struct { + NXEventSystemDevice dev[NX_EVS_DEVICE_MAX]; +} NXEventSystemDeviceList; + +#define __OLD_NX_EVS_DEVICE_INFO 1 +#define NX_EVS_DEVICE_INFO "Evs_EventDeviceInfo" +#define NX_EVS_DEVICE_INFO_COUNT \ + (sizeof (NXEventSystemDeviceList) / sizeof (int)) + +/* + * Types used in evScreen protocol compliant operations. + */ + +typedef enum {EVNOP, EVHIDE, EVSHOW, EVMOVE, EVLEVEL} EvCmd; /* Cursor state */ + +#define EV_SCREEN_MIN_BRIGHTNESS 0 +#define EV_SCREEN_MAX_BRIGHTNESS 64 +/* Scale should lie between MIN_BRIGHTNESS and MAX_BRIGHTNESS */ +#define EV_SCALE_BRIGHTNESS( scale, datum ) \ + ((((UInt32)(datum))*((UInt32)scale)) >> 6) + +/* + * Definition of a tick, as a time in milliseconds. This controls how + * often the event system periodic jobs are run. All actual tick times + * are derived from the nanosecond timer. These values are typically used + * as part of computing mouse velocity for acceleration purposes. + */ +#define EV_TICK_TIME 16 /* 16 milliseconds */ +#define EV_TICKS_PER_SEC (1000/EV_TICK_TIME) /* ~ 62 Hz */ + +/* Mouse Button bits, as passed from an EventSrc to the Event Driver */ +#define EV_RB (0x01) +#define EV_LB (0x04) +#define EV_MOUSEBUTTONMASK (EV_LB | EV_RB) + +/* Tablet Pressure Constants, as passed from an EventSrc to the Event Driver */ +#define EV_MINPRESSURE 0 +#define EV_MAXPRESSURE 255 + +/* Cursor size in pixels */ +#define EV_CURSOR_WIDTH 16 +#define EV_CURSOR_HEIGHT 16 + + +#define kAppleOnboardGUID 0x0610000000000000ULL + +#endif /* !_DEV_EV_TYPES_H */ + diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDUsageTables.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDUsageTables.h.svn-base new file mode 100644 index 0000000..ff0fd88 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDUsageTables.h.svn-base @@ -0,0 +1,1665 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIDUSAGETABLES_H +#define _IOHIDUSAGETABLES_H + +/* ****************************************************************************************** + * HID Usage Tables + * + * The following constants are from the USB 'HID Usage Tables' specification, revision 1.1rc3 + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum +{ + kHIDPage_Undefined = 0x00, + kHIDPage_GenericDesktop = 0x01, + kHIDPage_Simulation = 0x02, + kHIDPage_VR = 0x03, + kHIDPage_Sport = 0x04, + kHIDPage_Game = 0x05, + /* Reserved 0x06 */ + kHIDPage_KeyboardOrKeypad = 0x07, /* USB Device Class Definition for Human Interface Devices (HID). Note: the usage type for all key codes is Selector (Sel). */ + kHIDPage_LEDs = 0x08, + kHIDPage_Button = 0x09, + kHIDPage_Ordinal = 0x0A, + kHIDPage_Telephony = 0x0B, + kHIDPage_Consumer = 0x0C, + kHIDPage_Digitizer = 0x0D, + /* Reserved 0x0E */ + kHIDPage_PID = 0x0F, /* USB Physical Interface Device definitions for force feedback and related devices. */ + kHIDPage_Unicode = 0x10, + /* Reserved 0x11 - 0x13 */ + kHIDPage_AlphanumericDisplay = 0x14, + /* Reserved 0x15 - 0x7F */ + /* Monitor 0x80 - 0x83 USB Device Class Definition for Monitor Devices */ + /* Power 0x84 - 0x87 USB Device Class Definition for Power Devices */ + kHIDPage_PowerDevice = 0x84, /* Power Device Page */ + kHIDPage_BatterySystem = 0x85, /* Battery System Page */ + /* Reserved 0x88 - 0x8B */ + kHIDPage_BarCodeScanner = 0x8C, /* (Point of Sale) USB Device Class Definition for Bar Code Scanner Devices */ + kHIDPage_WeighingDevice = 0x8D, /* (Point of Sale) USB Device Class Definition for Weighing Devices */ + kHIDPage_Scale = 0x8D, /* (Point of Sale) USB Device Class Definition for Scale Devices */ + kHIDPage_MagneticStripeReader = 0x8E, + /* ReservedPointofSalepages 0x8F */ + kHIDPage_CameraControl = 0x90, /* USB Device Class Definition for Image Class Devices */ + kHIDPage_Arcade = 0x91, /* OAAF Definitions for arcade and coinop related Devices */ + /* Reserved 0x92 - 0xFEFF */ + /* VendorDefined 0xFF00 - 0xFFFF */ + kHIDPage_VendorDefinedStart = 0xFF00 +}; + +/* Undefined Usage for all usage pages */ +enum +{ + kHIDUsage_Undefined = 0x00 +}; + +/* GenericDesktop Page (0x01) */ +enum +{ + kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */ + kHIDUsage_GD_Mouse = 0x02, /* Application Collection */ + /* 0x03 Reserved */ + kHIDUsage_GD_Joystick = 0x04, /* Application Collection */ + kHIDUsage_GD_GamePad = 0x05, /* Application Collection */ + kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */ + kHIDUsage_GD_Keypad = 0x07, /* Application Collection */ + kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */ + /* 0x09 - 0x2F Reserved */ + kHIDUsage_GD_X = 0x30, /* Dynamic Value */ + kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ + kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ + kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ + kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ + kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ + kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */ + kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */ + kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */ + kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */ + kHIDUsage_GD_CountedBuffer = 0x3A, /* Logical Collection */ + kHIDUsage_GD_ByteCount = 0x3B, /* Dynamic Value */ + kHIDUsage_GD_MotionWakeup = 0x3C, /* One-Shot Control */ + kHIDUsage_GD_Start = 0x3D, /* On/Off Control */ + kHIDUsage_GD_Select = 0x3E, /* On/Off Control */ + /* 0x3F Reserved */ + kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ + kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ + kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ + kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ + kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ + kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ + kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ + /* 0x47 - 0x7F Reserved */ + kHIDUsage_GD_SystemControl = 0x80, /* Application Collection */ + kHIDUsage_GD_SystemPowerDown = 0x81, /* One-Shot Control */ + kHIDUsage_GD_SystemSleep = 0x82, /* One-Shot Control */ + kHIDUsage_GD_SystemWakeUp = 0x83, /* One-Shot Control */ + kHIDUsage_GD_SystemContextMenu = 0x84, /* One-Shot Control */ + kHIDUsage_GD_SystemMainMenu = 0x85, /* One-Shot Control */ + kHIDUsage_GD_SystemAppMenu = 0x86, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuHelp = 0x87, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuExit = 0x88, /* One-Shot Control */ + kHIDUsage_GD_SystemMenu = 0x89, /* Selector */ + kHIDUsage_GD_SystemMenuRight = 0x8A, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuLeft = 0x8B, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuUp = 0x8C, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuDown = 0x8D, /* Re-Trigger Control */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_GD_DPadUp = 0x90, /* On/Off Control */ + kHIDUsage_GD_DPadDown = 0x91, /* On/Off Control */ + kHIDUsage_GD_DPadRight = 0x92, /* On/Off Control */ + kHIDUsage_GD_DPadLeft = 0x93, /* On/Off Control */ + /* 0x94 - 0xFFFF Reserved */ + kHIDUsage_GD_Reserved = 0xFFFF +}; + +/* Simulation Page (0x02) */ +/* This section provides detailed descriptions of the usages employed by simulation devices. */ +enum +{ + kHIDUsage_Sim_FlightSimulationDevice = 0x01, /* Application Collection */ + kHIDUsage_Sim_AutomobileSimulationDevice = 0x02, /* Application Collection */ + kHIDUsage_Sim_TankSimulationDevice = 0x03, /* Application Collection */ + kHIDUsage_Sim_SpaceshipSimulationDevice = 0x04, /* Application Collection */ + kHIDUsage_Sim_SubmarineSimulationDevice = 0x05, /* Application Collection */ + kHIDUsage_Sim_SailingSimulationDevice = 0x06, /* Application Collection */ + kHIDUsage_Sim_MotorcycleSimulationDevice = 0x07, /* Application Collection */ + kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection */ + kHIDUsage_Sim_AirplaneSimulationDevice = 0x09, /* Application Collection */ + kHIDUsage_Sim_HelicopterSimulationDevice = 0x0A, /* Application Collection */ + kHIDUsage_Sim_MagicCarpetSimulationDevice = 0x0B, /* Application Collection */ + kHIDUsage_Sim_BicycleSimulationDevice = 0x0C, /* Application Collection */ + /* 0x0D - 0x1F Reserved */ + kHIDUsage_Sim_FlightControlStick = 0x20, /* Application Collection */ + kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */ + kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */ + kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */ + kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */ + kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */ + /* 0x26 - 0xAF Reserved */ + kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */ + kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */ + kHIDUsage_Sim_AntiTorqueControl = 0xB2, /* Dynamic Value */ + kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */ + kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */ + kHIDUsage_Sim_CollectiveControl = 0xB5, /* Dynamic Value */ + kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */ + kHIDUsage_Sim_ElectronicCountermeasures = 0xB7, /* On/Off Control */ + kHIDUsage_Sim_Elevator = 0xB8, /* Dynamic Value */ + kHIDUsage_Sim_ElevatorTrim = 0xB9, /* Dynamic Value */ + kHIDUsage_Sim_Rudder = 0xBA, /* Dynamic Value */ + kHIDUsage_Sim_Throttle = 0xBB, /* Dynamic Value */ + kHIDUsage_Sim_FlightCommunications = 0xBC, /* On/Off Control */ + kHIDUsage_Sim_FlareRelease = 0xBD, /* One-Shot Control */ + kHIDUsage_Sim_LandingGear = 0xBE, /* On/Off Control */ + kHIDUsage_Sim_ToeBrake = 0xBF, /* Dynamic Value */ + kHIDUsage_Sim_Trigger = 0xC0, /* Momentary Control */ + kHIDUsage_Sim_WeaponsArm = 0xC1, /* On/Off Control */ + kHIDUsage_Sim_Weapons = 0xC2, /* Selector */ + kHIDUsage_Sim_WingFlaps = 0xC3, /* Dynamic Value */ + kHIDUsage_Sim_Accelerator = 0xC4, /* Dynamic Value */ + kHIDUsage_Sim_Brake = 0xC5, /* Dynamic Value */ + kHIDUsage_Sim_Clutch = 0xC6, /* Dynamic Value */ + kHIDUsage_Sim_Shifter = 0xC7, /* Dynamic Value */ + kHIDUsage_Sim_Steering = 0xC8, /* Dynamic Value */ + kHIDUsage_Sim_TurretDirection = 0xC9, /* Dynamic Value */ + kHIDUsage_Sim_BarrelElevation = 0xCA, /* Dynamic Value */ + kHIDUsage_Sim_DivePlane = 0xCB, /* Dynamic Value */ + kHIDUsage_Sim_Ballast = 0xCC, /* Dynamic Value */ + kHIDUsage_Sim_BicycleCrank = 0xCD, /* Dynamic Value */ + kHIDUsage_Sim_HandleBars = 0xCE, /* Dynamic Value */ + kHIDUsage_Sim_FrontBrake = 0xCF, /* Dynamic Value */ + kHIDUsage_Sim_RearBrake = 0xD0, /* Dynamic Value */ + /* 0xD1 - 0xFFFF Reserved */ + kHIDUsage_Sim_Reserved = 0xFFFF +}; + +/* VR Page (0x03) */ +/* Virtual Reality controls depend on designators to identify the individual controls. Most of the following are */ +/* usages are applied to the collections of entities that comprise the actual device. */ +enum +{ + kHIDUsage_VR_Belt = 0x01, /* Application Collection */ + kHIDUsage_VR_BodySuit = 0x02, /* Application Collection */ + kHIDUsage_VR_Flexor = 0x03, /* Physical Collection */ + kHIDUsage_VR_Glove = 0x04, /* Application Collection */ + kHIDUsage_VR_HeadTracker = 0x05, /* Physical Collection */ + kHIDUsage_VR_HeadMountedDisplay = 0x06, /* Application Collection */ + kHIDUsage_VR_HandTracker = 0x07, /* Application Collection */ + kHIDUsage_VR_Oculometer = 0x08, /* Application Collection */ + kHIDUsage_VR_Vest = 0x09, /* Application Collection */ + kHIDUsage_VR_AnimatronicDevice = 0x0A, /* Application Collection */ + /* 0x0B - 0x1F Reserved */ + kHIDUsage_VR_StereoEnable = 0x20, /* On/Off Control */ + kHIDUsage_VR_DisplayEnable = 0x21, /* On/Off Control */ + /* 0x22 - 0xFFFF Reserved */ + kHIDUsage_VR_Reserved = 0xFFFF +}; + +/* Sport Page (0x04) */ +enum +{ + kHIDUsage_Sprt_BaseballBat = 0x01, /* Application Collection */ + kHIDUsage_Sprt_GolfClub = 0x02, /* Application Collection */ + kHIDUsage_Sprt_RowingMachine = 0x03, /* Application Collection */ + kHIDUsage_Sprt_Treadmill = 0x04, /* Application Collection */ + /* 0x05 - 0x2F Reserved */ + kHIDUsage_Sprt_Oar = 0x30, /* Dynamic Value */ + kHIDUsage_Sprt_Slope = 0x31, /* Dynamic Value */ + kHIDUsage_Sprt_Rate = 0x32, /* Dynamic Value */ + kHIDUsage_Sprt_StickSpeed = 0x33, /* Dynamic Value */ + kHIDUsage_Sprt_StickFaceAngle = 0x34, /* Dynamic Value */ + kHIDUsage_Sprt_StickHeelOrToe = 0x35, /* Dynamic Value */ + kHIDUsage_Sprt_StickFollowThrough = 0x36, /* Dynamic Value */ + kHIDUsage_Sprt_StickTempo = 0x37, /* Dynamic Value */ + kHIDUsage_Sprt_StickType = 0x38, /* Named Array */ + kHIDUsage_Sprt_StickHeight = 0x39, /* Dynamic Value */ + /* 0x3A - 0x4F Reserved */ + kHIDUsage_Sprt_Putter = 0x50, /* Selector */ + kHIDUsage_Sprt_1Iron = 0x51, /* Selector */ + kHIDUsage_Sprt_2Iron = 0x52, /* Selector */ + kHIDUsage_Sprt_3Iron = 0x53, /* Selector */ + kHIDUsage_Sprt_4Iron = 0x54, /* Selector */ + kHIDUsage_Sprt_5Iron = 0x55, /* Selector */ + kHIDUsage_Sprt_6Iron = 0x56, /* Selector */ + kHIDUsage_Sprt_7Iron = 0x57, /* Selector */ + kHIDUsage_Sprt_8Iron = 0x58, /* Selector */ + kHIDUsage_Sprt_9Iron = 0x59, /* Selector */ + kHIDUsage_Sprt_10Iron = 0x5A, /* Selector */ + kHIDUsage_Sprt_11Iron = 0x5B, /* Selector */ + kHIDUsage_Sprt_SandWedge = 0x5C, /* Selector */ + kHIDUsage_Sprt_LoftWedge = 0x5D, /* Selector */ + kHIDUsage_Sprt_PowerWedge = 0x5E, /* Selector */ + kHIDUsage_Sprt_1Wood = 0x5F, /* Selector */ + kHIDUsage_Sprt_3Wood = 0x60, /* Selector */ + kHIDUsage_Sprt_5Wood = 0x61, /* Selector */ + kHIDUsage_Sprt_7Wood = 0x62, /* Selector */ + kHIDUsage_Sprt_9Wood = 0x63, /* Selector */ + /* 0x64 - 0xFFFF Reserved */ + kHIDUsage_Sprt_Reserved = 0xFFFF +}; + +/* Game Page (0x05) */ +enum +{ + kHIDUsage_Game_3DGameController = 0x01, /* Application Collection */ + kHIDUsage_Game_PinballDevice = 0x02, /* Application Collection */ + kHIDUsage_Game_GunDevice = 0x03, /* Application Collection */ + /* 0x04 - 0x1F Reserved */ + kHIDUsage_Game_PointofView = 0x20, /* Physical Collection */ + kHIDUsage_Game_TurnRightOrLeft = 0x21, /* Dynamic Value */ + kHIDUsage_Game_PitchUpOrDown = 0x22, /* Dynamic Value */ + kHIDUsage_Game_RollRightOrLeft = 0x23, /* Dynamic Value */ + kHIDUsage_Game_MoveRightOrLeft = 0x24, /* Dynamic Value */ + kHIDUsage_Game_MoveForwardOrBackward = 0x25, /* Dynamic Value */ + kHIDUsage_Game_MoveUpOrDown = 0x26, /* Dynamic Value */ + kHIDUsage_Game_LeanRightOrLeft = 0x27, /* Dynamic Value */ + kHIDUsage_Game_LeanForwardOrBackward = 0x28, /* Dynamic Value */ + kHIDUsage_Game_HeightOfPOV = 0x29, /* Dynamic Value */ + kHIDUsage_Game_Flipper = 0x2A, /* Momentary Control */ + kHIDUsage_Game_SecondaryFlipper = 0x2B, /* Momentary Control */ + kHIDUsage_Game_Bump = 0x2C, /* Momentary Control */ + kHIDUsage_Game_NewGame = 0x2D, /* One-Shot Control */ + kHIDUsage_Game_ShootBall = 0x2E, /* One-Shot Control */ + kHIDUsage_Game_Player = 0x2F, /* One-Shot Control */ + kHIDUsage_Game_GunBolt = 0x30, /* On/Off Control */ + kHIDUsage_Game_GunClip = 0x31, /* On/Off Control */ + kHIDUsage_Game_Gun = 0x32, /* Selector */ + kHIDUsage_Game_GunSingleShot = 0x33, /* Selector */ + kHIDUsage_Game_GunBurst = 0x34, /* Selector */ + kHIDUsage_Game_GunAutomatic = 0x35, /* Selector */ + kHIDUsage_Game_GunSafety = 0x36, /* On/Off Control */ + kHIDUsage_Game_GamepadFireOrJump = 0x37, /* Logical Collection */ + kHIDUsage_Game_GamepadTrigger = 0x39, /* Logical Collection */ + /* 0x3A - 0xFFFF Reserved */ + kHIDUsage_Game_Reserved = 0xFFFF +}; + +/* KeyboardOrKeypad Page (0x07) */ +/* This section is the Usage Page for key codes to be used in implementing a USB keyboard. A Boot Keyboard (84-, 101- or 104-key) should at a minimum support all associated usage codes as indicated in the Boot */ +/* column below. */ +/* The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control (0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV). */ +/* Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate otherlanguages. */ +enum +{ + kHIDUsage_KeyboardErrorRollOver = 0x01, /* ErrorRollOver */ + kHIDUsage_KeyboardPOSTFail = 0x02, /* POSTFail */ + kHIDUsage_KeyboardErrorUndefined = 0x03, /* ErrorUndefined */ + kHIDUsage_KeyboardA = 0x04, /* a or A */ + kHIDUsage_KeyboardB = 0x05, /* b or B */ + kHIDUsage_KeyboardC = 0x06, /* c or C */ + kHIDUsage_KeyboardD = 0x07, /* d or D */ + kHIDUsage_KeyboardE = 0x08, /* e or E */ + kHIDUsage_KeyboardF = 0x09, /* f or F */ + kHIDUsage_KeyboardG = 0x0A, /* g or G */ + kHIDUsage_KeyboardH = 0x0B, /* h or H */ + kHIDUsage_KeyboardI = 0x0C, /* i or I */ + kHIDUsage_KeyboardJ = 0x0D, /* j or J */ + kHIDUsage_KeyboardK = 0x0E, /* k or K */ + kHIDUsage_KeyboardL = 0x0F, /* l or L */ + kHIDUsage_KeyboardM = 0x10, /* m or M */ + kHIDUsage_KeyboardN = 0x11, /* n or N */ + kHIDUsage_KeyboardO = 0x12, /* o or O */ + kHIDUsage_KeyboardP = 0x13, /* p or P */ + kHIDUsage_KeyboardQ = 0x14, /* q or Q */ + kHIDUsage_KeyboardR = 0x15, /* r or R */ + kHIDUsage_KeyboardS = 0x16, /* s or S */ + kHIDUsage_KeyboardT = 0x17, /* t or T */ + kHIDUsage_KeyboardU = 0x18, /* u or U */ + kHIDUsage_KeyboardV = 0x19, /* v or V */ + kHIDUsage_KeyboardW = 0x1A, /* w or W */ + kHIDUsage_KeyboardX = 0x1B, /* x or X */ + kHIDUsage_KeyboardY = 0x1C, /* y or Y */ + kHIDUsage_KeyboardZ = 0x1D, /* z or Z */ + kHIDUsage_Keyboard1 = 0x1E, /* 1 or ! */ + kHIDUsage_Keyboard2 = 0x1F, /* 2 or @ */ + kHIDUsage_Keyboard3 = 0x20, /* 3 or # */ + kHIDUsage_Keyboard4 = 0x21, /* 4 or $ */ + kHIDUsage_Keyboard5 = 0x22, /* 5 or % */ + kHIDUsage_Keyboard6 = 0x23, /* 6 or ^ */ + kHIDUsage_Keyboard7 = 0x24, /* 7 or & */ + kHIDUsage_Keyboard8 = 0x25, /* 8 or * */ + kHIDUsage_Keyboard9 = 0x26, /* 9 or ( */ + kHIDUsage_Keyboard0 = 0x27, /* 0 or ) */ + kHIDUsage_KeyboardReturnOrEnter = 0x28, /* Return (Enter) */ + kHIDUsage_KeyboardEscape = 0x29, /* Escape */ + kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, /* Delete (Backspace) */ + kHIDUsage_KeyboardTab = 0x2B, /* Tab */ + kHIDUsage_KeyboardSpacebar = 0x2C, /* Spacebar */ + kHIDUsage_KeyboardHyphen = 0x2D, /* - or _ */ + kHIDUsage_KeyboardEqualSign = 0x2E, /* = or + */ + kHIDUsage_KeyboardOpenBracket = 0x2F, /* [ or { */ + kHIDUsage_KeyboardCloseBracket = 0x30, /* ] or } */ + kHIDUsage_KeyboardBackslash = 0x31, /* \ or | */ + kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ */ + kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : */ + kHIDUsage_KeyboardQuote = 0x34, /* ' or " */ + kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde */ + kHIDUsage_KeyboardComma = 0x36, /* , or < */ + kHIDUsage_KeyboardPeriod = 0x37, /* . or > */ + kHIDUsage_KeyboardSlash = 0x38, /* / or ? */ + kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock */ + kHIDUsage_KeyboardF1 = 0x3A, /* F1 */ + kHIDUsage_KeyboardF2 = 0x3B, /* F2 */ + kHIDUsage_KeyboardF3 = 0x3C, /* F3 */ + kHIDUsage_KeyboardF4 = 0x3D, /* F4 */ + kHIDUsage_KeyboardF5 = 0x3E, /* F5 */ + kHIDUsage_KeyboardF6 = 0x3F, /* F6 */ + kHIDUsage_KeyboardF7 = 0x40, /* F7 */ + kHIDUsage_KeyboardF8 = 0x41, /* F8 */ + kHIDUsage_KeyboardF9 = 0x42, /* F9 */ + kHIDUsage_KeyboardF10 = 0x43, /* F10 */ + kHIDUsage_KeyboardF11 = 0x44, /* F11 */ + kHIDUsage_KeyboardF12 = 0x45, /* F12 */ + kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen */ + kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock */ + kHIDUsage_KeyboardPause = 0x48, /* Pause */ + kHIDUsage_KeyboardInsert = 0x49, /* Insert */ + kHIDUsage_KeyboardHome = 0x4A, /* Home */ + kHIDUsage_KeyboardPageUp = 0x4B, /* Page Up */ + kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward */ + kHIDUsage_KeyboardEnd = 0x4D, /* End */ + kHIDUsage_KeyboardPageDown = 0x4E, /* Page Down */ + kHIDUsage_KeyboardRightArrow = 0x4F, /* Right Arrow */ + kHIDUsage_KeyboardLeftArrow = 0x50, /* Left Arrow */ + kHIDUsage_KeyboardDownArrow = 0x51, /* Down Arrow */ + kHIDUsage_KeyboardUpArrow = 0x52, /* Up Arrow */ + kHIDUsage_KeypadNumLock = 0x53, /* Keypad NumLock or Clear */ + kHIDUsage_KeypadSlash = 0x54, /* Keypad / */ + kHIDUsage_KeypadAsterisk = 0x55, /* Keypad * */ + kHIDUsage_KeypadHyphen = 0x56, /* Keypad - */ + kHIDUsage_KeypadPlus = 0x57, /* Keypad + */ + kHIDUsage_KeypadEnter = 0x58, /* Keypad Enter */ + kHIDUsage_Keypad1 = 0x59, /* Keypad 1 or End */ + kHIDUsage_Keypad2 = 0x5A, /* Keypad 2 or Down Arrow */ + kHIDUsage_Keypad3 = 0x5B, /* Keypad 3 or Page Down */ + kHIDUsage_Keypad4 = 0x5C, /* Keypad 4 or Left Arrow */ + kHIDUsage_Keypad5 = 0x5D, /* Keypad 5 */ + kHIDUsage_Keypad6 = 0x5E, /* Keypad 6 or Right Arrow */ + kHIDUsage_Keypad7 = 0x5F, /* Keypad 7 or Home */ + kHIDUsage_Keypad8 = 0x60, /* Keypad 8 or Up Arrow */ + kHIDUsage_Keypad9 = 0x61, /* Keypad 9 or Page Up */ + kHIDUsage_Keypad0 = 0x62, /* Keypad 0 or Insert */ + kHIDUsage_KeypadPeriod = 0x63, /* Keypad . or Delete */ + kHIDUsage_KeyboardNonUSBackslash = 0x64, /* Non-US \ or | */ + kHIDUsage_KeyboardApplication = 0x65, /* Application */ + kHIDUsage_KeyboardPower = 0x66, /* Power */ + kHIDUsage_KeypadEqualSign = 0x67, /* Keypad = */ + kHIDUsage_KeyboardF13 = 0x68, /* F13 */ + kHIDUsage_KeyboardF14 = 0x69, /* F14 */ + kHIDUsage_KeyboardF15 = 0x6A, /* F15 */ + kHIDUsage_KeyboardF16 = 0x6B, /* F16 */ + kHIDUsage_KeyboardF17 = 0x6C, /* F17 */ + kHIDUsage_KeyboardF18 = 0x6D, /* F18 */ + kHIDUsage_KeyboardF19 = 0x6E, /* F19 */ + kHIDUsage_KeyboardF20 = 0x6F, /* F20 */ + kHIDUsage_KeyboardF21 = 0x70, /* F21 */ + kHIDUsage_KeyboardF22 = 0x71, /* F22 */ + kHIDUsage_KeyboardF23 = 0x72, /* F23 */ + kHIDUsage_KeyboardF24 = 0x73, /* F24 */ + kHIDUsage_KeyboardExecute = 0x74, /* Execute */ + kHIDUsage_KeyboardHelp = 0x75, /* Help */ + kHIDUsage_KeyboardMenu = 0x76, /* Menu */ + kHIDUsage_KeyboardSelect = 0x77, /* Select */ + kHIDUsage_KeyboardStop = 0x78, /* Stop */ + kHIDUsage_KeyboardAgain = 0x79, /* Again */ + kHIDUsage_KeyboardUndo = 0x7A, /* Undo */ + kHIDUsage_KeyboardCut = 0x7B, /* Cut */ + kHIDUsage_KeyboardCopy = 0x7C, /* Copy */ + kHIDUsage_KeyboardPaste = 0x7D, /* Paste */ + kHIDUsage_KeyboardFind = 0x7E, /* Find */ + kHIDUsage_KeyboardMute = 0x7F, /* Mute */ + kHIDUsage_KeyboardVolumeUp = 0x80, /* Volume Up */ + kHIDUsage_KeyboardVolumeDown = 0x81, /* Volume Down */ + kHIDUsage_KeyboardLockingCapsLock = 0x82, /* Locking Caps Lock */ + kHIDUsage_KeyboardLockingNumLock = 0x83, /* Locking Num Lock */ + kHIDUsage_KeyboardLockingScrollLock = 0x84, /* Locking Scroll Lock */ + kHIDUsage_KeypadComma = 0x85, /* Keypad Comma */ + kHIDUsage_KeypadEqualSignAS400 = 0x86, /* Keypad Equal Sign for AS/400 */ + kHIDUsage_KeyboardInternational1 = 0x87, /* International1 */ + kHIDUsage_KeyboardInternational2 = 0x88, /* International2 */ + kHIDUsage_KeyboardInternational3 = 0x89, /* International3 */ + kHIDUsage_KeyboardInternational4 = 0x8A, /* International4 */ + kHIDUsage_KeyboardInternational5 = 0x8B, /* International5 */ + kHIDUsage_KeyboardInternational6 = 0x8C, /* International6 */ + kHIDUsage_KeyboardInternational7 = 0x8D, /* International7 */ + kHIDUsage_KeyboardInternational8 = 0x8E, /* International8 */ + kHIDUsage_KeyboardInternational9 = 0x8F, /* International9 */ + kHIDUsage_KeyboardLANG1 = 0x90, /* LANG1 */ + kHIDUsage_KeyboardLANG2 = 0x91, /* LANG2 */ + kHIDUsage_KeyboardLANG3 = 0x92, /* LANG3 */ + kHIDUsage_KeyboardLANG4 = 0x93, /* LANG4 */ + kHIDUsage_KeyboardLANG5 = 0x94, /* LANG5 */ + kHIDUsage_KeyboardLANG6 = 0x95, /* LANG6 */ + kHIDUsage_KeyboardLANG7 = 0x96, /* LANG7 */ + kHIDUsage_KeyboardLANG8 = 0x97, /* LANG8 */ + kHIDUsage_KeyboardLANG9 = 0x98, /* LANG9 */ + kHIDUsage_KeyboardAlternateErase = 0x99, /* AlternateErase */ + kHIDUsage_KeyboardSysReqOrAttention = 0x9A, /* SysReq/Attention */ + kHIDUsage_KeyboardCancel = 0x9B, /* Cancel */ + kHIDUsage_KeyboardClear = 0x9C, /* Clear */ + kHIDUsage_KeyboardPrior = 0x9D, /* Prior */ + kHIDUsage_KeyboardReturn = 0x9E, /* Return */ + kHIDUsage_KeyboardSeparator = 0x9F, /* Separator */ + kHIDUsage_KeyboardOut = 0xA0, /* Out */ + kHIDUsage_KeyboardOper = 0xA1, /* Oper */ + kHIDUsage_KeyboardClearOrAgain = 0xA2, /* Clear/Again */ + kHIDUsage_KeyboardCrSelOrProps = 0xA3, /* CrSel/Props */ + kHIDUsage_KeyboardExSel = 0xA4, /* ExSel */ + /* 0xA5-0xDF Reserved */ + kHIDUsage_KeyboardLeftControl = 0xE0, /* Left Control */ + kHIDUsage_KeyboardLeftShift = 0xE1, /* Left Shift */ + kHIDUsage_KeyboardLeftAlt = 0xE2, /* Left Alt */ + kHIDUsage_KeyboardLeftGUI = 0xE3, /* Left GUI */ + kHIDUsage_KeyboardRightControl = 0xE4, /* Right Control */ + kHIDUsage_KeyboardRightShift = 0xE5, /* Right Shift */ + kHIDUsage_KeyboardRightAlt = 0xE6, /* Right Alt */ + kHIDUsage_KeyboardRightGUI = 0xE7, /* Right GUI */ + /* 0xE8-0xFFFF Reserved */ + kHIDUsage_Keyboard_Reserved = 0xFFFF +}; + +/* LEDs Page (0x08) */ +/* An LED or indicator is implemented as an On/Off Control (OOF) using the Single button toggle mode, where a value of 1 will turn on the indicator, and a value of 0 will turn it off. The exceptions are described below. */ +enum +{ + kHIDUsage_LED_NumLock = 0x01, /* On/Off Control */ + kHIDUsage_LED_CapsLock = 0x02, /* On/Off Control */ + kHIDUsage_LED_ScrollLock = 0x03, /* On/Off Control */ + kHIDUsage_LED_Compose = 0x04, /* On/Off Control */ + kHIDUsage_LED_Kana = 0x05, /* On/Off Control */ + kHIDUsage_LED_Power = 0x06, /* On/Off Control */ + kHIDUsage_LED_Shift = 0x07, /* On/Off Control */ + kHIDUsage_LED_DoNotDisturb = 0x08, /* On/Off Control */ + kHIDUsage_LED_Mute = 0x09, /* On/Off Control */ + kHIDUsage_LED_ToneEnable = 0x0A, /* On/Off Control */ + kHIDUsage_LED_HighCutFilter = 0x0B, /* On/Off Control */ + kHIDUsage_LED_LowCutFilter = 0x0C, /* On/Off Control */ + kHIDUsage_LED_EqualizerEnable = 0x0D, /* On/Off Control */ + kHIDUsage_LED_SoundFieldOn = 0x0E, /* On/Off Control */ + kHIDUsage_LED_SurroundOn = 0x0F, /* On/Off Control */ + kHIDUsage_LED_Repeat = 0x10, /* On/Off Control */ + kHIDUsage_LED_Stereo = 0x11, /* On/Off Control */ + kHIDUsage_LED_SamplingRateDetect = 0x12, /* On/Off Control */ + kHIDUsage_LED_Spinning = 0x13, /* On/Off Control */ + kHIDUsage_LED_CAV = 0x14, /* On/Off Control */ + kHIDUsage_LED_CLV = 0x15, /* On/Off Control */ + kHIDUsage_LED_RecordingFormatDetect = 0x16, /* On/Off Control */ + kHIDUsage_LED_OffHook = 0x17, /* On/Off Control */ + kHIDUsage_LED_Ring = 0x18, /* On/Off Control */ + kHIDUsage_LED_MessageWaiting = 0x19, /* On/Off Control */ + kHIDUsage_LED_DataMode = 0x1A, /* On/Off Control */ + kHIDUsage_LED_BatteryOperation = 0x1B, /* On/Off Control */ + kHIDUsage_LED_BatteryOK = 0x1C, /* On/Off Control */ + kHIDUsage_LED_BatteryLow = 0x1D, /* On/Off Control */ + kHIDUsage_LED_Speaker = 0x1E, /* On/Off Control */ + kHIDUsage_LED_HeadSet = 0x1F, /* On/Off Control */ + kHIDUsage_LED_Hold = 0x20, /* On/Off Control */ + kHIDUsage_LED_Microphone = 0x21, /* On/Off Control */ + kHIDUsage_LED_Coverage = 0x22, /* On/Off Control */ + kHIDUsage_LED_NightMode = 0x23, /* On/Off Control */ + kHIDUsage_LED_SendCalls = 0x24, /* On/Off Control */ + kHIDUsage_LED_CallPickup = 0x25, /* On/Off Control */ + kHIDUsage_LED_Conference = 0x26, /* On/Off Control */ + kHIDUsage_LED_StandBy = 0x27, /* On/Off Control */ + kHIDUsage_LED_CameraOn = 0x28, /* On/Off Control */ + kHIDUsage_LED_CameraOff = 0x29, /* On/Off Control */ + kHIDUsage_LED_OnLine = 0x2A, /* On/Off Control */ + kHIDUsage_LED_OffLine = 0x2B, /* On/Off Control */ + kHIDUsage_LED_Busy = 0x2C, /* On/Off Control */ + kHIDUsage_LED_Ready = 0x2D, /* On/Off Control */ + kHIDUsage_LED_PaperOut = 0x2E, /* On/Off Control */ + kHIDUsage_LED_PaperJam = 0x2F, /* On/Off Control */ + kHIDUsage_LED_Remote = 0x30, /* On/Off Control */ + kHIDUsage_LED_Forward = 0x31, /* On/Off Control */ + kHIDUsage_LED_Reverse = 0x32, /* On/Off Control */ + kHIDUsage_LED_Stop = 0x33, /* On/Off Control */ + kHIDUsage_LED_Rewind = 0x34, /* On/Off Control */ + kHIDUsage_LED_FastForward = 0x35, /* On/Off Control */ + kHIDUsage_LED_Play = 0x36, /* On/Off Control */ + kHIDUsage_LED_Pause = 0x37, /* On/Off Control */ + kHIDUsage_LED_Record = 0x38, /* On/Off Control */ + kHIDUsage_LED_Error = 0x39, /* On/Off Control */ + kHIDUsage_LED_Usage = 0x3A, /* Selector */ + kHIDUsage_LED_UsageInUseIndicator = 0x3B, /* Usage Switch */ + kHIDUsage_LED_UsageMultiModeIndicator = 0x3C, /* Usage Modifier */ + kHIDUsage_LED_IndicatorOn = 0x3D, /* Selector */ + kHIDUsage_LED_IndicatorFlash = 0x3E, /* Selector */ + kHIDUsage_LED_IndicatorSlowBlink = 0x3F, /* Selector */ + kHIDUsage_LED_IndicatorFastBlink = 0x40, /* Selector */ + kHIDUsage_LED_IndicatorOff = 0x41, /* Selector */ + kHIDUsage_LED_FlashOnTime = 0x42, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOnTime = 0x43, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOffTime = 0x44, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOnTime = 0x45, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOffTime = 0x46, /* Dynamic Value */ + kHIDUsage_LED_UsageIndicatorColor = 0x47, /* Usage Modifier */ + kHIDUsage_LED_IndicatorRed = 0x48, /* Selector */ + kHIDUsage_LED_IndicatorGreen = 0x49, /* Selector */ + kHIDUsage_LED_IndicatorAmber = 0x4A, /* Selector */ + kHIDUsage_LED_GenericIndicator = 0x4B, /* On/Off Control */ + kHIDUsage_LED_SystemSuspend = 0x4C, /* On/Off Control */ + kHIDUsage_LED_ExternalPowerConnected = 0x4D, /* On/Off Control */ + /* 0x4E - 0xFFFF Reserved */ + kHIDUsage_LED_Reserved = 0xFFFF +}; + +/* Button Page (0x09) */ +/* The Button page is the first place an application should look for user selection controls. System graphical user interfaces typically employ a pointer and a set of hierarchical selectors to select, move and otherwise manipulate their environment. For these purposes the following assignment of significance can be applied to the Button usages: */ +/* Button 1, Primary Button. Used for object selecting, dragging, and double click activation. On MacOS, this is the only button. Microsoft operating systems call this a logical left button, because it */ +/* is not necessarily physically located on the left of the pointing device. */ +/* Button 2, Secondary Button. Used by newer graphical user interfaces to browse object properties. Exposed by systems to applications that typically assign application-specific functionality. */ +/* Button 3, Tertiary Button. Optional control. Exposed to applications, but seldom assigned functionality due to prevalence of two- and one-button devices. */ +/* Buttons 4 -55. As the button number increases, its significance as a selector decreases. */ +/* In many ways the assignment of button numbers is similar to the assignment of Effort in Physical descriptors. Button 1 would be used to define the button a finger rests on when the hand is in the at rest position, that is, virtually no effort is required by the user to activate the button. Button values increment as the finger has to stretch to reach a control. See Section 6.2.3, Physical Descriptors, in the HID Specification for methods of further qualifying buttons. */ +enum +{ + kHIDUsage_Button_1 = 0x01, /* (primary/trigger) */ + kHIDUsage_Button_2 = 0x02, /* (secondary) */ + kHIDUsage_Button_3 = 0x03, /* (tertiary) */ + kHIDUsage_Button_4 = 0x04, /* 4th button */ + /* ... */ + kHIDUsage_Button_65535 = 0xFFFF +}; + +/* Ordinal Page (0x0A) */ +/* The Ordinal page allows multiple instances of a control or sets of controls to be declared without requiring individual enumeration in the native usage page. For example, it is not necessary to declare usages of Pointer 1, Pointer 2, and so forth on the Generic Desktop page. When parsed, the ordinal instance number is, in essence, concatenated to the usages attached to the encompassing collection to create Pointer 1, Pointer 2, and so forth. */ +/* For an example, see Section A.5, Multiple Instances of a Control, in Appendix A, Usage Examples. By convention, an Ordinal collection is placed inside the collection for which it is declaring multiple instances. */ +/* Instances do not have to be identical. */ +enum +{ + /* 0x00 Reserved */ + kHIDUsage_Ord_Instance1 = 0x01, /* Usage Modifier */ + kHIDUsage_Ord_Instance2 = 0x02, /* Usage Modifier */ + kHIDUsage_Ord_Instance3 = 0x03, /* Usage Modifier */ + kHIDUsage_Ord_Instance4 = 0x04, /* Usage Modifier */ + kHIDUsage_Ord_Instance65535 = 0xFFFF /* Usage Modifier */ +}; + +/* Telephony Page (0x0B) */ +/* This usage page defines the keytop and control usages for telephony devices. */ +/* Indicators on a phone are handled by wrapping them in LED: Usage In Use Indicator and LED: Usage Selected Indicator usages. For example, a message-indicator LED would be identified by a Telephony: Message usage declared as a Feature or Output in a LED: Usage In Use Indicator collection. */ +/* See Section 14, Consumer Page (0x0C), for audio volume and tone controls. */ +enum +{ + kHIDUsage_Tfon_Phone = 0x01, /* Application Collection */ + kHIDUsage_Tfon_AnsweringMachine = 0x02, /* Application Collection */ + kHIDUsage_Tfon_MessageControls = 0x03, /* Logical Collection */ + kHIDUsage_Tfon_Handset = 0x04, /* Logical Collection */ + kHIDUsage_Tfon_Headset = 0x05, /* Logical Collection */ + kHIDUsage_Tfon_TelephonyKeyPad = 0x06, /* Named Array */ + kHIDUsage_Tfon_ProgrammableButton = 0x07, /* Named Array */ + /* 0x08 - 0x1F Reserved */ + kHIDUsage_Tfon_HookSwitch = 0x20, /* On/Off Control */ + kHIDUsage_Tfon_Flash = 0x21, /* Momentary Control */ + kHIDUsage_Tfon_Feature = 0x22, /* One-Shot Control */ + kHIDUsage_Tfon_Hold = 0x23, /* On/Off Control */ + kHIDUsage_Tfon_Redial = 0x24, /* One-Shot Control */ + kHIDUsage_Tfon_Transfer = 0x25, /* One-Shot Control */ + kHIDUsage_Tfon_Drop = 0x26, /* One-Shot Control */ + kHIDUsage_Tfon_Park = 0x27, /* On/Off Control */ + kHIDUsage_Tfon_ForwardCalls = 0x28, /* On/Off Control */ + kHIDUsage_Tfon_AlternateFunction = 0x29, /* Momentary Control */ + kHIDUsage_Tfon_Line = 0x2A, /* One-Shot Control */ + kHIDUsage_Tfon_SpeakerPhone = 0x2B, /* On/Off Control */ + kHIDUsage_Tfon_Conference = 0x2C, /* On/Off Control */ + kHIDUsage_Tfon_RingEnable = 0x2D, /* On/Off Control */ + kHIDUsage_Tfon_Ring = 0x2E, /* Selector */ + kHIDUsage_Tfon_PhoneMute = 0x2F, /* On/Off Control */ + kHIDUsage_Tfon_CallerID = 0x30, /* Momentary Control */ + /* 0x31 - 0x4F Reserved */ + kHIDUsage_Tfon_SpeedDial = 0x50, /* One-Shot Control */ + kHIDUsage_Tfon_StoreNumber = 0x51, /* One-Shot Control */ + kHIDUsage_Tfon_RecallNumber = 0x52, /* One-Shot Control */ + kHIDUsage_Tfon_PhoneDirectory = 0x53, /* On/Off Control */ + /* 0x54 - 0x6F Reserved */ + kHIDUsage_Tfon_VoiceMail = 0x70, /* On/Off Control */ + kHIDUsage_Tfon_ScreenCalls = 0x71, /* On/Off Control */ + kHIDUsage_Tfon_DoNotDisturb = 0x72, /* On/Off Control */ + kHIDUsage_Tfon_Message = 0x73, /* One-Shot Control */ + kHIDUsage_Tfon_AnswerOnOrOff = 0x74, /* On/Off Control */ + /* 0x75 - 0x8F Reserved */ + kHIDUsage_Tfon_InsideDialTone = 0x90, /* Momentary Control */ + kHIDUsage_Tfon_OutsideDialTone = 0x91, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingTone = 0x92, /* Momentary Control */ + kHIDUsage_Tfon_OutsideRingTone = 0x93, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingTone = 0x94, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingback = 0x95, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingback = 0x96, /* Momentary Control */ + kHIDUsage_Tfon_LineBusyTone = 0x97, /* Momentary Control */ + kHIDUsage_Tfon_ReorderTone = 0x98, /* Momentary Control */ + kHIDUsage_Tfon_CallWaitingTone = 0x99, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone1 = 0x9A, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone2 = 0x9B, /* Momentary Control */ + kHIDUsage_Tfon_TonesOff = 0x9C, /* On/Off Control */ + kHIDUsage_Tfon_OutsideRingback = 0x9D, /* Momentary Control */ + /* 0x9E - 0xAF Reserved */ + kHIDUsage_Tfon_PhoneKey0 = 0xB0, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey1 = 0xB1, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey2 = 0xB2, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey3 = 0xB3, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey4 = 0xB4, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey5 = 0xB5, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey6 = 0xB6, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey7 = 0xB7, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey8 = 0xB8, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey9 = 0xB9, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyStar = 0xBA, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyPound = 0xBB, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyA = 0xBC, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyB = 0xBD, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyC = 0xBE, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyD = 0xBF, /* Selector/One-Shot Control */ + /* 0xC0 - 0xFFFF Reserved */ + kHIDUsage_TFon_Reserved = 0xFFFF +}; + +/* Consumer Page (0x0C) */ +/* All controls on the Consumer page are application-specific. That is, they affect a specific device, not the system as a whole. */ +enum +{ + kHIDUsage_Csmr_ConsumerControl = 0x01, /* Application Collection */ + kHIDUsage_Csmr_NumericKeyPad = 0x02, /* Named Array */ + kHIDUsage_Csmr_ProgrammableButtons = 0x03, /* Named Array */ + /* 0x03 - 0x1F Reserved */ + kHIDUsage_Csmr_Plus10 = 0x20, /* One-Shot Control */ + kHIDUsage_Csmr_Plus100 = 0x21, /* One-Shot Control */ + kHIDUsage_Csmr_AMOrPM = 0x22, /* One-Shot Control */ + /* 0x23 - 0x3F Reserved */ + kHIDUsage_Csmr_Power = 0x30, /* On/Off Control */ + kHIDUsage_Csmr_Reset = 0x31, /* One-Shot Control */ + kHIDUsage_Csmr_Sleep = 0x32, /* One-Shot Control */ + kHIDUsage_Csmr_SleepAfter = 0x33, /* One-Shot Control */ + kHIDUsage_Csmr_SleepMode = 0x34, /* Re-Trigger Control */ + kHIDUsage_Csmr_Illumination = 0x35, /* On/Off Control */ + kHIDUsage_Csmr_FunctionButtons = 0x36, /* Named Array */ + /* 0x37 - 0x3F Reserved */ + kHIDUsage_Csmr_Menu = 0x40, /* On/Off Control */ + kHIDUsage_Csmr_MenuPick = 0x41, /* One-Shot Control */ + kHIDUsage_Csmr_MenuUp = 0x42, /* One-Shot Control */ + kHIDUsage_Csmr_MenuDown = 0x43, /* One-Shot Control */ + kHIDUsage_Csmr_MenuLeft = 0x44, /* One-Shot Control */ + kHIDUsage_Csmr_MenuRight = 0x45, /* One-Shot Control */ + kHIDUsage_Csmr_MenuEscape = 0x46, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueIncrease = 0x47, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueDecrease = 0x48, /* One-Shot Control */ + /* 0x49 - 0x5F Reserved */ + kHIDUsage_Csmr_DataOnScreen = 0x60, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaption = 0x61, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaptionSelect = 0x62, /* Selector */ + kHIDUsage_Csmr_VCROrTV = 0x63, /* On/Off Control */ + kHIDUsage_Csmr_BroadcastMode = 0x64, /* One-Shot Control */ + kHIDUsage_Csmr_Snapshot = 0x65, /* One-Shot Control */ + kHIDUsage_Csmr_Still = 0x66, /* One-Shot Control */ + /* 0x67 - 0x7F Reserved */ + kHIDUsage_Csmr_Selection = 0x80, /* Named Array */ + kHIDUsage_Csmr_Assign = 0x81, /* Selector */ + kHIDUsage_Csmr_ModeStep = 0x82, /* One-Shot Control */ + kHIDUsage_Csmr_RecallLast = 0x83, /* One-Shot Control */ + kHIDUsage_Csmr_EnterChannel = 0x84, /* One-Shot Control */ + kHIDUsage_Csmr_OrderMovie = 0x85, /* One-Shot Control */ + kHIDUsage_Csmr_Channel = 0x86, /* Linear Control */ + kHIDUsage_Csmr_MediaSelection = 0x87, /* Selector */ + kHIDUsage_Csmr_MediaSelectComputer = 0x88, /* Selector */ + kHIDUsage_Csmr_MediaSelectTV = 0x89, /* Selector */ + kHIDUsage_Csmr_MediaSelectWWW = 0x8A, /* Selector */ + kHIDUsage_Csmr_MediaSelectDVD = 0x8B, /* Selector */ + kHIDUsage_Csmr_MediaSelectTelephone = 0x8C, /* Selector */ + kHIDUsage_Csmr_MediaSelectProgramGuide = 0x8D, /* Selector */ + kHIDUsage_Csmr_MediaSelectVideoPhone = 0x8E, /* Selector */ + kHIDUsage_Csmr_MediaSelectGames = 0x8F, /* Selector */ + kHIDUsage_Csmr_MediaSelectMessages = 0x90, /* Selector */ + kHIDUsage_Csmr_MediaSelectCD = 0x91, /* Selector */ + kHIDUsage_Csmr_MediaSelectVCR = 0x92, /* Selector */ + kHIDUsage_Csmr_MediaSelectTuner = 0x93, /* Selector */ + kHIDUsage_Csmr_Quit = 0x94, /* One-Shot Control */ + kHIDUsage_Csmr_Help = 0x95, /* On/Off Control */ + kHIDUsage_Csmr_MediaSelectTape = 0x96, /* Selector */ + kHIDUsage_Csmr_MediaSelectCable = 0x97, /* Selector */ + kHIDUsage_Csmr_MediaSelectSatellite = 0x98, /* Selector */ + kHIDUsage_Csmr_MediaSelectSecurity = 0x99, /* Selector */ + kHIDUsage_Csmr_MediaSelectHome = 0x9A, /* Selector */ + kHIDUsage_Csmr_MediaSelectCall = 0x9B, /* Selector */ + kHIDUsage_Csmr_ChannelIncrement = 0x9C, /* One-Shot Control */ + kHIDUsage_Csmr_ChannelDecrement = 0x9D, /* One-Shot Control */ + kHIDUsage_Csmr_Media = 0x9E, /* Selector */ + /* 0x9F Reserved */ + kHIDUsage_Csmr_VCRPlus = 0xA0, /* One-Shot Control */ + kHIDUsage_Csmr_Once = 0xA1, /* One-Shot Control */ + kHIDUsage_Csmr_Daily = 0xA2, /* One-Shot Control */ + kHIDUsage_Csmr_Weekly = 0xA3, /* One-Shot Control */ + kHIDUsage_Csmr_Monthly = 0xA4, /* One-Shot Control */ + /* 0xA5 - 0xAF Reserved */ + kHIDUsage_Csmr_Play = 0xB0, /* On/Off Control */ + kHIDUsage_Csmr_Pause = 0xB1, /* On/Off Control */ + kHIDUsage_Csmr_Record = 0xB2, /* On/Off Control */ + kHIDUsage_Csmr_FastForward = 0xB3, /* On/Off Control */ + kHIDUsage_Csmr_Rewind = 0xB4, /* On/Off Control */ + kHIDUsage_Csmr_ScanNextTrack = 0xB5, /* One-Shot Control */ + kHIDUsage_Csmr_ScanPreviousTrack = 0xB6, /* One-Shot Control */ + kHIDUsage_Csmr_Stop = 0xB7, /* One-Shot Control */ + kHIDUsage_Csmr_Eject = 0xB8, /* One-Shot Control */ + kHIDUsage_Csmr_RandomPlay = 0xB9, /* On/Off Control */ + kHIDUsage_Csmr_SelectDisc = 0xBA, /* Named Array */ + kHIDUsage_Csmr_EnterDisc = 0xBB, /* Momentary Control */ + kHIDUsage_Csmr_Repeat = 0xBC, /* One-Shot Control */ + kHIDUsage_Csmr_Tracking = 0xBD, /* Linear Control */ + kHIDUsage_Csmr_TrackNormal = 0xBE, /* One-Shot Control */ + kHIDUsage_Csmr_SlowTracking = 0xBF, /* Linear Control */ + kHIDUsage_Csmr_FrameForward = 0xC0, /* Re-Trigger Control */ + kHIDUsage_Csmr_FrameBack = 0xC1, /* Re-Trigger Control */ + kHIDUsage_Csmr_Mark = 0xC2, /* One-Shot Control */ + kHIDUsage_Csmr_ClearMark = 0xC3, /* One-Shot Control */ + kHIDUsage_Csmr_RepeatFromMark = 0xC4, /* On/Off Control */ + kHIDUsage_Csmr_ReturnToMark = 0xC5, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkForward = 0xC6, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkBackwards = 0xC7, /* One-Shot Control */ + kHIDUsage_Csmr_CounterReset = 0xC8, /* One-Shot Control */ + kHIDUsage_Csmr_ShowCounter = 0xC9, /* One-Shot Control */ + kHIDUsage_Csmr_TrackingIncrement = 0xCA, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrackingDecrement = 0xCB, /* Re-Trigger Control */ + kHIDUsage_Csmr_StopOrEject = 0xCC, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrPause = 0xCD, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrSkip = 0xCE, /* One-Shot Control */ + /* 0xCF - 0xDF Reserved */ + kHIDUsage_Csmr_Volume = 0xE0, /* Linear Control */ + kHIDUsage_Csmr_Balance = 0xE1, /* Linear Control */ + kHIDUsage_Csmr_Mute = 0xE2, /* On/Off Control */ + kHIDUsage_Csmr_Bass = 0xE3, /* Linear Control */ + kHIDUsage_Csmr_Treble = 0xE4, /* Linear Control */ + kHIDUsage_Csmr_BassBoost = 0xE5, /* On/Off Control */ + kHIDUsage_Csmr_SurroundMode = 0xE6, /* One-Shot Control */ + kHIDUsage_Csmr_Loudness = 0xE7, /* On/Off Control */ + kHIDUsage_Csmr_MPX = 0xE8, /* On/Off Control */ + kHIDUsage_Csmr_VolumeIncrement = 0xE9, /* Re-Trigger Control */ + kHIDUsage_Csmr_VolumeDecrement = 0xEA, /* Re-Trigger Control */ + /* 0xEB - 0xEF Reserved */ + kHIDUsage_Csmr_Speed = 0xF0, /* Selector */ + kHIDUsage_Csmr_PlaybackSpeed = 0xF1, /* Named Array */ + kHIDUsage_Csmr_StandardPlay = 0xF2, /* Selector */ + kHIDUsage_Csmr_LongPlay = 0xF3, /* Selector */ + kHIDUsage_Csmr_ExtendedPlay = 0xF4, /* Selector */ + kHIDUsage_Csmr_Slow = 0xF5, /* One-Shot Control */ + /* 0xF6 - 0xFF Reserved */ + kHIDUsage_Csmr_FanEnable = 0x100, /* On/Off Control */ + kHIDUsage_Csmr_FanSpeed = 0x101, /* Linear Control */ + kHIDUsage_Csmr_LightEnable = 0x102, /* On/Off Control */ + kHIDUsage_Csmr_LightIlluminationLevel = 0x103, /* Linear Control */ + kHIDUsage_Csmr_ClimateControlEnable = 0x104, /* On/Off Control */ + kHIDUsage_Csmr_RoomTemperature = 0x105, /* Linear Control */ + kHIDUsage_Csmr_SecurityEnable = 0x106, /* On/Off Control */ + kHIDUsage_Csmr_FireAlarm = 0x107, /* One-Shot Control */ + kHIDUsage_Csmr_PoliceAlarm = 0x108, /* One-Shot Control */ + /* 0x109 - 0x14F Reserved */ + kHIDUsage_Csmr_BalanceRight = 0x150, /* Re-Trigger Control */ + kHIDUsage_Csmr_BalanceLeft = 0x151, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassIncrement = 0x152, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassDecrement = 0x153, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleIncrement = 0x154, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleDecrement = 0x155, /* Re-Trigger Control */ + /* 0x156 - 0x15F Reserved */ + kHIDUsage_Csmr_SpeakerSystem = 0x160, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLeft = 0x161, /* Logical Collection */ + kHIDUsage_Csmr_ChannelRight = 0x162, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenter = 0x163, /* Logical Collection */ + kHIDUsage_Csmr_ChannelFront = 0x164, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenterFront = 0x165, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSide = 0x166, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSurround = 0x167, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLowFrequencyEnhancement = 0x168, /* Logical Collection */ + kHIDUsage_Csmr_ChannelTop = 0x169, /* Logical Collection */ + kHIDUsage_Csmr_ChannelUnknown = 0x16A, /* Logical Collection */ + /* 0x16B - 0x16F Reserved */ + kHIDUsage_Csmr_SubChannel = 0x170, /* Linear Control */ + kHIDUsage_Csmr_SubChannelIncrement = 0x171, /* One-Shot Control */ + kHIDUsage_Csmr_SubChannelDecrement = 0x172, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioIncrement = 0x173, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioDecrement = 0x174, /* One-Shot Control */ + /* 0x175 - 0x17F Reserved */ + kHIDUsage_Csmr_ApplicationLaunchButtons = 0x180, /* Named Array */ + kHIDUsage_Csmr_ALLaunchButtonConfigurationTool = 0x181, /* Selector */ + kHIDUsage_Csmr_ALProgrammableButtonConfiguration = 0x182, /* Selector */ + kHIDUsage_Csmr_ALConsumerControlConfiguration = 0x183, /* Selector */ + kHIDUsage_Csmr_ALWordProcessor = 0x184, /* Selector */ + kHIDUsage_Csmr_ALTextEditor = 0x185, /* Selector */ + kHIDUsage_Csmr_ALSpreadsheet = 0x186, /* Selector */ + kHIDUsage_Csmr_ALGraphicsEditor = 0x187, /* Selector */ + kHIDUsage_Csmr_ALPresentationApp = 0x188, /* Selector */ + kHIDUsage_Csmr_ALDatabaseApp = 0x189, /* Selector */ + kHIDUsage_Csmr_ALEmailReader = 0x18A, /* Selector */ + kHIDUsage_Csmr_ALNewsreader = 0x18B, /* Selector */ + kHIDUsage_Csmr_ALVoicemail = 0x18C, /* Selector */ + kHIDUsage_Csmr_ALContactsOrAddressBook = 0x18D, /* Selector */ + kHIDUsage_Csmr_ALCalendarOrSchedule = 0x18E, /* Selector */ + kHIDUsage_Csmr_ALTaskOrProjectManager = 0x18F, /* Selector */ + kHIDUsage_Csmr_ALLogOrJournalOrTimecard = 0x190, /* Selector */ + kHIDUsage_Csmr_ALCheckbookOrFinance = 0x191, /* Selector */ + kHIDUsage_Csmr_ALCalculator = 0x192, /* Selector */ + kHIDUsage_Csmr_ALAOrVCaptureOrPlayback = 0x193, /* Selector */ + kHIDUsage_Csmr_ALLocalMachineBrowser = 0x194, /* Selector */ + kHIDUsage_Csmr_ALLANOrWANBrowser = 0x195, /* Selector */ + kHIDUsage_Csmr_ALInternetBrowser = 0x196, /* Selector */ + kHIDUsage_Csmr_ALRemoteNetworkingOrISPConnect = 0x197, /* Selector */ + kHIDUsage_Csmr_ALNetworkConference = 0x198, /* Selector */ + kHIDUsage_Csmr_ALNetworkChat = 0x199, /* Selector */ + kHIDUsage_Csmr_ALTelephonyOrDialer = 0x19A, /* Selector */ + kHIDUsage_Csmr_ALLogon = 0x19B, /* Selector */ + kHIDUsage_Csmr_ALLogoff = 0x19C, /* Selector */ + kHIDUsage_Csmr_ALLogonOrLogoff = 0x19D, /* Selector */ + kHIDUsage_Csmr_ALTerminalLockOrScreensaver = 0x19E, /* Selector */ + kHIDUsage_Csmr_ALControlPanel = 0x19F, /* Selector */ + kHIDUsage_Csmr_ALCommandLineProcessorOrRun = 0x1A0, /* Selector */ + kHIDUsage_Csmr_ALProcessOrTaskManager = 0x1A1, /* Selector */ + kHIDUsage_Csmr_AL = 0x1A2, /* Selector */ + kHIDUsage_Csmr_ALNextTaskOrApplication = 0x1A3, /* Selector */ + kHIDUsage_Csmr_ALPreviousTaskOrApplication = 0x1A4, /* Selector */ + kHIDUsage_Csmr_ALPreemptiveHaltTaskOrApplication = 0x1A5, /* Selector */ + kHIDUsage_Csmr_ALIntegratedHelpCenter = 0x1A6, /* Selector */ + kHIDUsage_Csmr_ALDocuments = 0x1A7, /* Selector */ + kHIDUsage_Csmr_ALThesaurus = 0x1A8, /* Selector */ + kHIDUsage_Csmr_ALDictionary = 0x1A9, /* Selector */ + kHIDUsage_Csmr_ALDesktop = 0x1AA, /* Selector */ + kHIDUsage_Csmr_ALSpellCheck = 0x1AB, /* Selector */ + kHIDUsage_Csmr_ALGrammerCheck = 0x1AC, /* Selector */ + kHIDUsage_Csmr_ALWirelessStatus = 0x1AD, /* Selector */ + kHIDUsage_Csmr_ALKeyboardLayout = 0x1AE, /* Selector */ + kHIDUsage_Csmr_ALVirusProtection = 0x1AF, /* Selector */ + kHIDUsage_Csmr_ALEncryption = 0x1B0, /* Selector */ + kHIDUsage_Csmr_ALScreenSaver = 0x1B1, /* Selector */ + kHIDUsage_Csmr_ALAlarms = 0x1B2, /* Selector */ + kHIDUsage_Csmr_ALClock = 0x1B3, /* Selector */ + kHIDUsage_Csmr_ALFileBrowser = 0x1B4, /* Selector */ + kHIDUsage_Csmr_ALPowerStatus = 0x1B5, /* Selector */ + /* 0x1A6 - 0x1FF Reserved */ + kHIDUsage_Csmr_GenericGUIApplicationControls = 0x200, /* Named Array */ + kHIDUsage_Csmr_ACNew = 0x201, /* Selector */ + kHIDUsage_Csmr_ACOpen = 0x202, /* Selector */ + kHIDUsage_Csmr_ACClose = 0x203, /* Selector */ + kHIDUsage_Csmr_ACExit = 0x204, /* Selector */ + kHIDUsage_Csmr_ACMaximize = 0x205, /* Selector */ + kHIDUsage_Csmr_ACMinimize = 0x206, /* Selector */ + kHIDUsage_Csmr_ACSave = 0x207, /* Selector */ + kHIDUsage_Csmr_ACPrint = 0x208, /* Selector */ + kHIDUsage_Csmr_ACProperties = 0x209, /* Selector */ + kHIDUsage_Csmr_ACUndo = 0x21A, /* Selector */ + kHIDUsage_Csmr_ACCopy = 0x21B, /* Selector */ + kHIDUsage_Csmr_ACCut = 0x21C, /* Selector */ + kHIDUsage_Csmr_ACPaste = 0x21D, /* Selector */ + kHIDUsage_Csmr_AC = 0x21E, /* Selector */ + kHIDUsage_Csmr_ACFind = 0x21F, /* Selector */ + kHIDUsage_Csmr_ACFindandReplace = 0x220, /* Selector */ + kHIDUsage_Csmr_ACSearch = 0x221, /* Selector */ + kHIDUsage_Csmr_ACGoTo = 0x222, /* Selector */ + kHIDUsage_Csmr_ACHome = 0x223, /* Selector */ + kHIDUsage_Csmr_ACBack = 0x224, /* Selector */ + kHIDUsage_Csmr_ACForward = 0x225, /* Selector */ + kHIDUsage_Csmr_ACStop = 0x226, /* Selector */ + kHIDUsage_Csmr_ACRefresh = 0x227, /* Selector */ + kHIDUsage_Csmr_ACPreviousLink = 0x228, /* Selector */ + kHIDUsage_Csmr_ACNextLink = 0x229, /* Selector */ + kHIDUsage_Csmr_ACBookmarks = 0x22A, /* Selector */ + kHIDUsage_Csmr_ACHistory = 0x22B, /* Selector */ + kHIDUsage_Csmr_ACSubscriptions = 0x22C, /* Selector */ + kHIDUsage_Csmr_ACZoomIn = 0x22D, /* Selector */ + kHIDUsage_Csmr_ACZoomOut = 0x22E, /* Selector */ + kHIDUsage_Csmr_ACZoom = 0x22F, /* Selector */ + kHIDUsage_Csmr_ACFullScreenView = 0x230, /* Selector */ + kHIDUsage_Csmr_ACNormalView = 0x231, /* Selector */ + kHIDUsage_Csmr_ACViewToggle = 0x232, /* Selector */ + kHIDUsage_Csmr_ACScrollUp = 0x233, /* Selector */ + kHIDUsage_Csmr_ACScrollDown = 0x234, /* Selector */ + kHIDUsage_Csmr_ACScroll = 0x235, /* Selector */ + kHIDUsage_Csmr_ACPanLeft = 0x236, /* Selector */ + kHIDUsage_Csmr_ACPanRight = 0x237, /* Selector */ + kHIDUsage_Csmr_ACPan = 0x238, /* Selector */ + kHIDUsage_Csmr_ACNewWindow = 0x239, /* Selector */ + kHIDUsage_Csmr_ACTileHorizontally = 0x23A, /* Selector */ + kHIDUsage_Csmr_ACTileVertically = 0x23B, /* Selector */ + kHIDUsage_Csmr_ACFormat = 0x23C, /* Selector */ + /* 0x23D - 0xFFFF Reserved */ + kHIDUsage_Csmr_Reserved = 0xFFFF +}; + +/* Physical Interface Device Page (0x0F) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_PID_PhysicalInterfaceDevice = 0x01, /* CA - A collection of PID usages */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_PID_Normal = 0x20, /* DV - A force applied perpendicular to the surface of an object */ + kHIDUsage_PID_SetEffectReport = 0x21, /* XXX */ + kHIDUsage_PID_EffectBlockIndex = 0x22, /* XXX */ + kHIDUsage_PID_ParamBlockOffset = 0x23, /* XXX */ + kHIDUsage_PID_ROM_Flag = 0x24, /* XXX */ + kHIDUsage_PID_EffectType = 0x25, /* XXX */ + kHIDUsage_PID_ET_ConstantForce = 0x26, /* XXX */ + kHIDUsage_PID_ET_Ramp = 0x27, /* XXX */ + kHIDUsage_PID_ET_CustomForceData = 0x28, /* XXX */ + /* 0x29 - 0x2F Reserved */ + kHIDUsage_PID_ET_Square = 0x30, /* XXX */ + kHIDUsage_PID_ET_Sine = 0x31, /* XXX */ + kHIDUsage_PID_ET_Triangle = 0x32, /* XXX */ + kHIDUsage_PID_ET_SawtoothUp = 0x33, /* XXX */ + kHIDUsage_PID_ET_SawtoothDown = 0x34, /* XXX */ + /* 0x35 - 0x3F Reserved */ + kHIDUsage_PID_ET_Spring = 0x40, /* XXX */ + kHIDUsage_PID_ET_Damper = 0x41, /* XXX */ + kHIDUsage_PID_ET_Inertia = 0x42, /* XXX */ + kHIDUsage_PID_ET_Friction = 0x43, /* XXX */ + /* 0x44 - 0x4F Reserved */ + kHIDUsage_PID_Duration = 0x50, /* XXX */ + kHIDUsage_PID_SamplePeriod = 0x51, /* XXX */ + kHIDUsage_PID_Gain = 0x52, /* XXX */ + kHIDUsage_PID_TriggerButton = 0x53, /* XXX */ + kHIDUsage_PID_TriggerRepeatInterval = 0x54, /* XXX */ + kHIDUsage_PID_AxesEnable = 0x55, /* XXX */ + kHIDUsage_PID_DirectionEnable = 0x56, /* XXX */ + kHIDUsage_PID_Direction = 0x57, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockOffset = 0x58, /* XXX */ + kHIDUsage_PID_BlockType = 0x59, /* XXX */ + kHIDUsage_PID_SetEnvelopeReport = 0x5A, /* XXX */ + kHIDUsage_PID_AttackLevel = 0x5B, /* XXX */ + kHIDUsage_PID_AttackTime = 0x5C, /* XXX */ + kHIDUsage_PID_FadeLevel = 0x5D, /* XXX */ + kHIDUsage_PID_FadeTime = 0x5E, /* XXX */ + kHIDUsage_PID_SetConditionReport = 0x5F, /* XXX */ + + kHIDUsage_PID_CP_Offset = 0x60, /* XXX */ + kHIDUsage_PID_PositiveCoefficient = 0x61, /* XXX */ + kHIDUsage_PID_NegativeCoefficient = 0x62, /* XXX */ + kHIDUsage_PID_PositiveSaturation = 0x63, /* XXX */ + kHIDUsage_PID_NegativeSaturation = 0x64, /* XXX */ + kHIDUsage_PID_DeadBand = 0x65, /* XXX */ + kHIDUsage_PID_DownloadForceSample = 0x66, /* XXX */ + kHIDUsage_PID_IsochCustomForceEnable = 0x67, /* XXX */ + kHIDUsage_PID_CustomForceDataReport = 0x68, /* XXX */ + kHIDUsage_PID_CustomForceData = 0x69, /* XXX */ + kHIDUsage_PID_CustomForceVendorDefinedData = 0x6A, /* XXX */ + kHIDUsage_PID_SetCustomForceReport = 0x6B, /* XXX */ + kHIDUsage_PID_CustomForceDataOffset = 0x6C, /* XXX */ + kHIDUsage_PID_SampleCount = 0x6D, /* XXX */ + kHIDUsage_PID_SetPeriodicReport = 0x6E, /* XXX */ + kHIDUsage_PID_Offset = 0x6F, /* XXX */ + + kHIDUsage_PID_Magnitude = 0x70, /* XXX */ + kHIDUsage_PID_Phase = 0x71, /* XXX */ + kHIDUsage_PID_Period = 0x72, /* XXX */ + kHIDUsage_PID_SetConstantForceReport = 0x73, /* XXX */ + kHIDUsage_PID_SetRampForceReport = 0x74, /* XXX */ + kHIDUsage_PID_RampStart = 0x75, /* XXX */ + kHIDUsage_PID_RampEnd = 0x76, /* XXX */ + kHIDUsage_PID_EffectOperationReport = 0x77, /* XXX */ + kHIDUsage_PID_EffectOperation = 0x78, /* XXX */ + kHIDUsage_PID_OpEffectStart = 0x79, /* XXX */ + kHIDUsage_PID_OpEffectStartSolo = 0x7A, /* XXX */ + kHIDUsage_PID_OpEffectStop = 0x7B, /* XXX */ + kHIDUsage_PID_LoopCount = 0x7C, /* XXX */ + kHIDUsage_PID_DeviceGainReport = 0x7D, /* XXX */ + kHIDUsage_PID_DeviceGain = 0x7E, /* XXX */ + kHIDUsage_PID_PoolReport = 0x7F, /* XXX */ + + kHIDUsage_PID_RAM_PoolSize = 0x80, /* XXX */ + kHIDUsage_PID_ROM_PoolSize = 0x81, /* XXX */ + kHIDUsage_PID_ROM_EffectBlockCount = 0x82, /* XXX */ + kHIDUsage_PID_SimultaneousEffectsMax = 0x83, /* XXX */ + kHIDUsage_PID_PoolAlignment = 0x84, /* XXX */ + kHIDUsage_PID_PoolMoveReport = 0x85, /* XXX */ + kHIDUsage_PID_MoveSource = 0x86, /* XXX */ + kHIDUsage_PID_MoveDestination = 0x87, /* XXX */ + kHIDUsage_PID_MoveLength = 0x88, /* XXX */ + kHIDUsage_PID_BlockLoadReport = 0x89, /* XXX */ + /* 0x8A Reserved */ + kHIDUsage_PID_BlockLoadStatus = 0x8B, /* XXX */ + kHIDUsage_PID_BlockLoadSuccess = 0x8C, /* XXX */ + kHIDUsage_PID_BlockLoadFull = 0x8D, /* XXX */ + kHIDUsage_PID_BlockLoadError = 0x8E, /* XXX */ + kHIDUsage_PID_BlockHandle = 0x8F, /* XXX */ + + kHIDUsage_PID_BlockFreeReport = 0x90, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockHandle = 0x91, /* XXX */ + kHIDUsage_PID_StateReport = 0x92, /* XXX */ + /* 0x93 Reserved */ + kHIDUsage_PID_EffectPlaying = 0x94, /* XXX */ + kHIDUsage_PID_DeviceControlReport = 0x95, /* XXX */ + kHIDUsage_PID_DeviceControl = 0x96, /* XXX */ + kHIDUsage_PID_DC_EnableActuators = 0x97, /* XXX */ + kHIDUsage_PID_DC_DisableActuators = 0x98, /* XXX */ + kHIDUsage_PID_DC_StopAllEffects = 0x99, /* XXX */ + kHIDUsage_PID_DC_DeviceReset = 0x9A, /* XXX */ + kHIDUsage_PID_DC_DevicePause = 0x9B, /* XXX */ + kHIDUsage_PID_DC_DeviceContinue = 0x9C, /* XXX */ + /* 0x9d - 0x9E Reserved */ + kHIDUsage_PID_DevicePaused = 0x9F, /* XXX */ + + kHIDUsage_PID_ActuatorsEnabled = 0xA0, /* XXX */ + /* 0xA1 - 0xA3 Reserved */ + kHIDUsage_PID_SafetySwitch = 0xA4, /* XXX */ + kHIDUsage_PID_ActuatorOverrideSwitch = 0xA5, /* XXX */ + kHIDUsage_PID_ActuatorPower = 0xA6, /* XXX */ + kHIDUsage_PID_StartDelay = 0xA7, /* XXX */ + kHIDUsage_PID_ParameterBlockSize = 0xA8, /* XXX */ + kHIDUsage_PID_DeviceManagedPool = 0xA9, /* XXX */ + kHIDUsage_PID_SharedParameterBlocks = 0xAA, /* XXX */ + kHIDUsage_PID_CreateNewEffectReport = 0xAB, /* XXX */ + kHIDUsage_PID_RAM_PoolAvailable = 0xAC, /* XXX */ + /* 0xAD - 0xFFFF Reserved */ + kHIDUsage_PID_Reserved = 0xFFFF +}; + +/* Digitizer Page (0x0D) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_Dig_Digitizer = 0x01, /* Application Collection */ + kHIDUsage_Dig_Pen = 0x02, /* Application Collection */ + kHIDUsage_Dig_LightPen = 0x03, /* Application Collection */ + kHIDUsage_Dig_TouchScreen = 0x04, /* Application Collection */ + kHIDUsage_Dig_TouchPad = 0x05, /* Application Collection */ + kHIDUsage_Dig_WhiteBoard = 0x06, /* Application Collection */ + kHIDUsage_Dig_CoordinateMeasuringMachine = 0x07, /* Application Collection */ + kHIDUsage_Dig_3DDigitizer = 0x08, /* Application Collection */ + kHIDUsage_Dig_StereoPlotter = 0x09, /* Application Collection */ + kHIDUsage_Dig_ArticulatedArm = 0x0A, /* Application Collection */ + kHIDUsage_Dig_Armature = 0x0B, /* Application Collection */ + kHIDUsage_Dig_MultiplePointDigitizer = 0x0C, /* Application Collection */ + kHIDUsage_Dig_FreeSpaceWand = 0x0D, /* Application Collection */ + /* 0x0E - 0x1F Reserved */ + kHIDUsage_Dig_Stylus = 0x20, /* Logical Collection */ + kHIDUsage_Dig_Puck = 0x21, /* Logical Collection */ + kHIDUsage_Dig_Finger = 0x22, /* Logical Collection */ + /* 0x23 - 0x2F Reserved */ + kHIDUsage_Dig_TipPressure = 0x30, /* Dynamic Value */ + kHIDUsage_Dig_BarrelPressure = 0x31, /* Dynamic Value */ + kHIDUsage_Dig_InRange = 0x32, /* Momentary Control */ + kHIDUsage_Dig_Touch = 0x33, /* Momentary Control */ + kHIDUsage_Dig_Untouch = 0x34, /* One-Shot Control */ + kHIDUsage_Dig_Tap = 0x35, /* One-Shot Control */ + kHIDUsage_Dig_Quality = 0x36, /* Dynamic Value */ + kHIDUsage_Dig_DataValid = 0x37, /* Momentary Control */ + kHIDUsage_Dig_TransducerIndex = 0x38, /* Dynamic Value */ + kHIDUsage_Dig_TabletFunctionKeys = 0x39, /* Logical Collection */ + kHIDUsage_Dig_ProgramChangeKeys = 0x3A, /* Logical Collection */ + kHIDUsage_Dig_BatteryStrength = 0x3B, /* Dynamic Value */ + kHIDUsage_Dig_Invert = 0x3C, /* Momentary Control */ + kHIDUsage_Dig_XTilt = 0x3D, /* Dynamic Value */ + kHIDUsage_Dig_YTilt = 0x3E, /* Dynamic Value */ + kHIDUsage_Dig_Azimuth = 0x3F, /* Dynamic Value */ + kHIDUsage_Dig_Altitude = 0x40, /* Dynamic Value */ + kHIDUsage_Dig_Twist = 0x41, /* Dynamic Value */ + kHIDUsage_Dig_TipSwitch = 0x42, /* Momentary Control */ + kHIDUsage_Dig_SecondaryTipSwitch = 0x43, /* Momentary Control */ + kHIDUsage_Dig_BarrelSwitch = 0x44, /* Momentary Control */ + kHIDUsage_Dig_Eraser = 0x45, /* Momentary Control */ + kHIDUsage_Dig_TabletPick = 0x46, /* Momentary Control */ + /* 0x47 - 0xFFFF Reserved */ + kHIDUsage_Dig_Reserved = 0xFFFF +}; + +/* AlphanumericDisplay Page (0x14) */ +/* The Alphanumeric Display page is intended for use by simple alphanumeric displays that are used on consumer devices. */ +enum +{ + kHIDUsage_AD_AlphanumericDisplay = 0x01, /* Application Collection */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_AD_DisplayAttributesReport = 0x20, /* Logical Collection */ + kHIDUsage_AD_ASCIICharacterSet = 0x21, /* Static Flag */ + kHIDUsage_AD_DataReadBack = 0x22, /* Static Flag */ + kHIDUsage_AD_FontReadBack = 0x23, /* Static Flag */ + kHIDUsage_AD_DisplayControlReport = 0x24, /* Logical Collection */ + kHIDUsage_AD_ClearDisplay = 0x25, /* Dynamic Flag */ + kHIDUsage_AD_DisplayEnable = 0x26, /* Dynamic Flag */ + kHIDUsage_AD_ScreenSaverDelay = 0x27, /* Static Value */ + kHIDUsage_AD_ScreenSaverEnable = 0x28, /* Dynamic Flag */ + kHIDUsage_AD_VerticalScroll = 0x29, /* Static Flag */ + kHIDUsage_AD_HorizontalScroll = 0x2A, /* Static Flag */ + kHIDUsage_AD_CharacterReport = 0x2B, /* Logical Collection */ + kHIDUsage_AD_DisplayData = 0x2C, /* Dynamic Value */ + kHIDUsage_AD_DisplayStatus = 0x2D, /* Logical Collection */ + kHIDUsage_AD_StatNotReady = 0x2E, /* Selector */ + kHIDUsage_AD_StatReady = 0x2F, /* Selector */ + kHIDUsage_AD_ErrNotaloadablecharacter = 0x30, /* Selector */ + kHIDUsage_AD_ErrFontdatacannotberead = 0x31, /* Selector */ + kHIDUsage_AD_CursorPositionReport = 0x32, /* Logical Collection */ + kHIDUsage_AD_Row = 0x33, /* Dynamic Value */ + kHIDUsage_AD_Column = 0x34, /* Dynamic Value */ + kHIDUsage_AD_Rows = 0x35, /* Static Value */ + kHIDUsage_AD_Columns = 0x36, /* Static Value */ + kHIDUsage_AD_CursorPixelPositioning = 0x37, /* Static Flag */ + kHIDUsage_AD_CursorMode = 0x38, /* Dynamic Flag */ + kHIDUsage_AD_CursorEnable = 0x39, /* Dynamic Flag */ + kHIDUsage_AD_CursorBlink = 0x3A, /* Dynamic Flag */ + kHIDUsage_AD_FontReport = 0x3B, /* Logical Collection */ + kHIDUsage_AD_FontData = 0x3C, /* Buffered Byte */ + kHIDUsage_AD_CharacterWidth = 0x3D, /* Static Value */ + kHIDUsage_AD_CharacterHeight = 0x3E, /* Static Value */ + kHIDUsage_AD_CharacterSpacingHorizontal = 0x3F, /* Static Value */ + kHIDUsage_AD_CharacterSpacingVertical = 0x40, /* Static Value */ + kHIDUsage_AD_UnicodeCharacterSet = 0x41, /* Static Flag */ + /* 0x42 - 0xFFFF Reserved */ + kHIDUsage_AD_Reserved = 0xFFFF +}; + +/* Power Device Page (0x84) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + + kHIDUsage_PD_Undefined = 0x00, /* Power Device Undefined Usage */ + kHIDUsage_PD_iName = 0x01, /* CL- Power Device Name Index */ + kHIDUsage_PD_PresentStatus = 0x02, /* CL- Power Device Present Status */ + kHIDUsage_PD_ChangedStatus = 0x03, /* CA- Power Device Changed Status */ + kHIDUsage_PD_UPS = 0x04, /* CA- Uninterruptible Power Supply */ + kHIDUsage_PD_PowerSupply = 0x05, /* CA- Power Supply */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_PD_BatterySystem = 0x10, /* CP- Battery System power module */ + kHIDUsage_PD_BatterySystemID = 0x11, /* SV IF- Battery System ID */ + kHIDUsage_PD_Battery = 0x12, /* CP- Battery */ + kHIDUsage_PD_BatteryID = 0x13, /* SV IF- Battery ID */ + kHIDUsage_PD_Charger = 0x14, /* CP- Charger */ + kHIDUsage_PD_ChargerID = 0x15, /* SV IF- Charger ID */ + kHIDUsage_PD_PowerConverter = 0x16, /* CP- Power Converter power module */ + kHIDUsage_PD_PowerConverterID = 0x17, /* SV IF- Power Converter ID */ + kHIDUsage_PD_OutletSystem = 0x18, /* CP- Outlet System power module */ + kHIDUsage_PD_OutletSystemID = 0x19, /* SV IF-Outlet System ID */ + kHIDUsage_PD_Input = 0x1A, /* CP- Power Device Input */ + kHIDUsage_PD_InputID = 0x1B, /* SV IF- Power Device Input ID */ + kHIDUsage_PD_Output = 0x1C, /* CP- Power Device Output */ + kHIDUsage_PD_OutputID = 0x1D, /* SV IF- Power Device Output ID */ + kHIDUsage_PD_Flow = 0x1E, /* CP- Power Device Flow */ + kHIDUsage_PD_FlowID = 0x1F, /* Item IF- Power Device Flow ID */ + kHIDUsage_PD_Outlet = 0x20, /* CP- Power Device Outlet */ + kHIDUsage_PD_OutletID = 0x21, /* SV IF- Power Device Outlet ID */ + kHIDUsage_PD_Gang = 0x22, /* CL/CP- Power Device Gang */ + kHIDUsage_PD_GangID = 0x23, /* SV IF- Power Device Gang ID */ + kHIDUsage_PD_PowerSummary = 0x24, /* CL/CP- Power Device Power Summary */ + kHIDUsage_PD_PowerSummaryID = 0x25, /* SV IF- Power Device Power Summary ID */ + /* Reserved 0x26 - 0x2F */ + kHIDUsage_PD_Voltage = 0x30, /* DV IF- Power Device Voltage */ + kHIDUsage_PD_Current = 0x31, /* DV IF- Power Device Current */ + kHIDUsage_PD_Frequency = 0x32, /* DV IF- Power Device Frequency */ + kHIDUsage_PD_ApparentPower = 0x33, /* DV IF- Power Device Apparent Power */ + kHIDUsage_PD_ActivePower = 0x34, /* DV IF- Power Device RMS Power */ + kHIDUsage_PD_PercentLoad = 0x35, /* DV IF- Power Device Percent Load */ + kHIDUsage_PD_Temperature = 0x36, /* DV IF- Power Device Temperature */ + kHIDUsage_PD_Humidity = 0x37, /* DV IF- Power Device Humidity */ + kHIDUsage_PD_BadCount = 0x38, /* DV IF- Power Device Bad Condition Count */ + /* Reserved 0x39 - 0x3F */ + kHIDUsage_PD_ConfigVoltage = 0x40, /* SV/DV F- Power Device Nominal Voltage */ + kHIDUsage_PD_ConfigCurrent = 0x41, /* SV/DV F- Power Device Nominal Current */ + kHIDUsage_PD_ConfigFrequency = 0x42, /* SV/DV F- Power Device Nominal Frequency */ + kHIDUsage_PD_ConfigApparentPower = 0x43, /* SV/DV F- Power Device Nominal Apparent Power */ + kHIDUsage_PD_ConfigActivePower = 0x44, /* SV/DV F- Power Device Nominal RMS Power */ + kHIDUsage_PD_ConfigPercentLoad = 0x45, /* SV/DV F- Power Device Nominal Percent Load */ + kHIDUsage_PD_ConfigTemperature = 0x46, /* SV/DV F- Power Device Nominal Temperature */ + kHIDUsage_PD_ConfigHumidity = 0x47, /* SV/DV F- Power Device Nominal Humidity */ + /* Reserved 0x48 - 0x4F */ + kHIDUsage_PD_SwitchOnControl = 0x50, /* DV F- Power Device Switch On Control */ + kHIDUsage_PD_SwitchOffControl = 0x51, /* DV F- Power Device Switch Off Control */ + kHIDUsage_PD_ToggleControl = 0x52, /* DV F- Power Device Toogle Sequence Control */ + kHIDUsage_PD_LowVoltageTransfer = 0x53, /* DV F- Power Device Min Transfer Voltage */ + kHIDUsage_PD_HighVoltageTransfer = 0x54, /* DV F- Power Device Max Transfer Voltage */ + kHIDUsage_PD_DelayBeforeReboot = 0x55, /* DV F- Power Device Delay Before Reboot */ + kHIDUsage_PD_DelayBeforeStartup = 0x56, /* DV F- Power Device Delay Before Startup */ + kHIDUsage_PD_DelayBeforeShutdown = 0x57, /* DV F- Power Device Delay Before Shutdown */ + kHIDUsage_PD_Test = 0x58, /* DV F- Power Device Test Request/Result */ + kHIDUsage_PD_ModuleReset = 0x59, /* DV F- Power Device Reset Request/Result */ + kHIDUsage_PD_AudibleAlarmControl = 0x5A, /* DV F- Power Device Audible Alarm Control */ + /* Reserved 0x5B - 0x5F */ + kHIDUsage_PD_Present = 0x60, /* DV IOF- Power Device Present */ + kHIDUsage_PD_Good = 0x61, /* DV IOF- Power Device Good */ + kHIDUsage_PD_InternalFailure = 0x62, /* DV IOF- Power Device Internal Failure */ + kHIDUsage_PD_VoltageOutOfRange = 0x63, /* DV IOF- Power Device Voltage Out Of Range */ + kHIDUsage_PD_FrequencyOutOfRange = 0x64, /* DV IOF- Power Device Frequency Out Of Range */ + kHIDUsage_PD_Overload = 0x65, /* DV IOF- Power Device Overload */ + kHIDUsage_PD_OverCharged = 0x66, /* DV IOF- Power Device Over Charged */ + kHIDUsage_PD_OverTemperature = 0x67, /* DV IOF- Power Device Over Temperature */ + kHIDUsage_PD_ShutdownRequested = 0x68, /* DV IOF- Power Device Shutdown Requested */ + kHIDUsage_PD_ShutdownImminent = 0x69, /* DV IOF- Power Device Shutdown Imminent */ + /* Reserved 0x6A */ + kHIDUsage_PD_SwitchOnOff = 0x6B, /* DV IOF- Power Device On/Off Switch Status */ + kHIDUsage_PD_Switchable = 0x6C, /* DV IOF- Power Device Switchable */ + kHIDUsage_PD_Used = 0x6D, /* DV IOF- Power Device Used */ + kHIDUsage_PD_Boost = 0x6E, /* DV IOF- Power Device Boosted */ + kHIDUsage_PD_Buck = 0x6F, /* DV IOF- Power Device Bucked */ + kHIDUsage_PD_Initialized = 0x70, /* DV IOF- Power Device Initialized */ + kHIDUsage_PD_Tested = 0x71, /* DV IOF- Power Device Tested */ + kHIDUsage_PD_AwaitingPower = 0x72, /* DV IOF- Power Device Awaiting Power */ + kHIDUsage_PD_CommunicationLost = 0x73, /* DV IOF- Power Device Communication Lost */ + /* Reserved 0x74 - 0xFC */ + kHIDUsage_PD_iManufacturer = 0xFD, /* SV F- Power Device Manufacturer String Index */ + kHIDUsage_PD_iProduct = 0xFE, /* SV F- Power Device Product String Index */ + kHIDUsage_PD_iserialNumber = 0xFF /* SV F- Power Device Serial Number String Index */ +}; + +/* Battery System Page (x85) */ +/* This section provides detailed descriptions of the usages employed by Battery Systems. */ +enum +{ + kHIDUsage_BS_Undefined = 0x00, /* Battery System Undefined */ + kHIDUsage_BS_SMBBatteryMode = 0x01, /* CL - SMB Mode */ + kHIDUsage_BS_SMBBatteryStatus = 0x02, /* CL - SMB Status */ + kHIDUsage_BS_SMBAlarmWarning = 0x03, /* CL - SMB Alarm Warning */ + kHIDUsage_BS_SMBChargerMode = 0x04, /* CL - SMB Charger Mode */ + kHIDUsage_BS_SMBChargerStatus = 0x05, /* CL - SMB Charger Status */ + kHIDUsage_BS_SMBChargerSpecInfo = 0x06, /* CL - SMB Charger Extended Status */ + kHIDUsage_BS_SMBSelectorState = 0x07, /* CL - SMB Selector State */ + kHIDUsage_BS_SMBSelectorPresets = 0x08, /* CL - SMB Selector Presets */ + kHIDUsage_BS_SMBSelectorInfo = 0x09, /* CL - SMB Selector Info */ + /* Reserved 0x0A - 0x0F */ + kHIDUsage_BS_OptionalMfgFunction1 = 0x10, /* DV F - Battery System Optional SMB Mfg Function 1 */ + kHIDUsage_BS_OptionalMfgFunction2 = 0x11, /* DV F - Battery System Optional SMB Mfg Function 2 */ + kHIDUsage_BS_OptionalMfgFunction3 = 0x12, /* DV F - Battery System Optional SMB Mfg Function 3 */ + kHIDUsage_BS_OptionalMfgFunction4 = 0x13, /* DV F - Battery System Optional SMB Mfg Function 4 */ + kHIDUsage_BS_OptionalMfgFunction5 = 0x14, /* DV F - Battery System Optional SMB Mfg Function 5 */ + kHIDUsage_BS_ConnectionToSMBus = 0x15, /* DF F - Battery System Connection To System Management Bus */ + kHIDUsage_BS_OutputConnection = 0x16, /* DF F - Battery System Output Connection Status */ + kHIDUsage_BS_ChargerConnection = 0x17, /* DF F - Battery System Charger Connection */ + kHIDUsage_BS_BatteryInsertion = 0x18, /* DF F - Battery System Battery Insertion */ + kHIDUsage_BS_Usenext = 0x19, /* DF F - Battery System Use Next */ + kHIDUsage_BS_OKToUse = 0x1A, /* DF F - Battery System OK To Use */ + kHIDUsage_BS_BatterySupported = 0x1B, /* DF F - Battery System Battery Supported */ + kHIDUsage_BS_SelectorRevision = 0x1C, /* DF F - Battery System Selector Revision */ + kHIDUsage_BS_ChargingIndicator = 0x1D, /* DF F - Battery System Charging Indicator */ + /* Reserved 0x1E - 0x27 */ + kHIDUsage_BS_ManufacturerAccess = 0x28, /* DV F - Battery System Manufacturer Access */ + kHIDUsage_BS_RemainingCapacityLimit = 0x29, /* DV F - Battery System Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimit = 0x2A, /* DV F - Battery System Remaining Time Limit */ + kHIDUsage_BS_AtRate = 0x2B, /* DV F - Battery System At Rate... */ + kHIDUsage_BS_CapacityMode = 0x2C, /* DV F - Battery System Capacity Mode */ + kHIDUsage_BS_BroadcastToCharger = 0x2D, /* DV F - Battery System Broadcast To Charger */ + kHIDUsage_BS_PrimaryBattery = 0x2E, /* DV F - Battery System Primary Battery */ + kHIDUsage_BS_ChargeController = 0x2F, /* DV F - Battery System Charge Controller */ + /* Reserved 0x30 - 0x3F */ + kHIDUsage_BS_TerminateCharge = 0x40, /* DF IOF - Battery System Terminate Charge */ + kHIDUsage_BS_TerminateDischarge = 0x41, /* DF IOF - Battery System Terminate Discharge */ + kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */ + kHIDUsage_BS_Charging = 0x44, /* DF IOF - Battery System Charging */ + kHIDUsage_BS_Discharging = 0x45, /* DV IOF - Battery System Discharging */ + kHIDUsage_BS_FullyCharged = 0x46, /* DF IOF - Battery System Fully Charged */ + kHIDUsage_BS_FullyDischarged = 0x47, /* DV IOF - Battery System Fully Discharged */ + kHIDUsage_BS_ConditioningFlag = 0x48, /* DV IOF - Battery System Conditioning Flag */ + kHIDUsage_BS_AtRateOK = 0x49, /* DV IOF - Battery System At Rate OK */ + kHIDUsage_BS_SMBErrorCode = 0x4A, /* DF IOF - Battery System SMB Error Code */ + kHIDUsage_BS_NeedReplacement = 0x4B, /* DF IOF - Battery System Need Replacement */ + /* Reserved 0x4C - 0x5F */ + kHIDUsage_BS_AtRateTimeToFull = 0x60, /* DV IF - Battery System At Rate Time To Full */ + kHIDUsage_BS_AtRateTimeToEmpty = 0x61, /* DV IF - Battery System At Rate Time To Empty */ + kHIDUsage_BS_AverageCurrent = 0x62, /* DV IF - Battery System Average Current */ + kHIDUsage_BS_Maxerror = 0x63, /* DV IF - Battery System Max Error */ + kHIDUsage_BS_RelativeStateOfCharge = 0x64, /* DV IF - Battery System Relative State Of Charge */ + kHIDUsage_BS_AbsoluteStateOfCharge = 0x65, /* DV IF - Battery System Absolute State Of Charge */ + kHIDUsage_BS_RemainingCapacity = 0x66, /* DV IF - Battery System Remaining Capacity */ + kHIDUsage_BS_FullChargeCapacity = 0x67, /* DV IF - Battery System Full Charge Capacity */ + kHIDUsage_BS_RunTimeToEmpty = 0x68, /* DV IF - Battery System Run Time To Empty */ + kHIDUsage_BS_AverageTimeToEmpty = 0x69, /* DV IF - Battery System Average Time To Empty */ + kHIDUsage_BS_AverageTimeToFull = 0x6A, /* DV IF - Battery System Average Time To Full */ + kHIDUsage_BS_CycleCount = 0x6B, /* DV IF - Battery System Cycle Count */ + /* Reserved 0x6C - 0x7F */ + kHIDUsage_BS_BattPackModelLevel = 0x80, /* SV F - Battery System Batt Pack Model Level */ + kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */ + kHIDUsage_BS_PrimaryBatterySupport = 0x82, /* SF F - Battery System Primary Battery Support */ + kHIDUsage_BS_DesignCapacity = 0x83, /* SV F - Battery System Design Capacity */ + kHIDUsage_BS_SpecificationInfo = 0x84, /* SV F - Battery System Specification Info */ + kHIDUsage_BS_ManufacturerDate = 0x85, /* SV F - Battery System Manufacturer Date */ + kHIDUsage_BS_SerialNumber = 0x86, /* SV F - Battery System Serial Number */ + kHIDUsage_BS_iManufacturerName = 0x87, /* SV F - Battery System Manufacturer Name Index */ + kHIDUsage_BS_iDevicename = 0x88, /* SV F - Battery System Device Name Index */ + kHIDUsage_BS_iDeviceChemistry = 0x89, /* SV F - Battery System Device Chemistry Index */ + kHIDUsage_BS_ManufacturerData = 0x8A, /* SV F - Battery System Manufacturer Data */ + kHIDUsage_BS_Rechargable = 0x8B, /* SV F - Battery System Rechargable */ + kHIDUsage_BS_WarningCapacityLimit = 0x8C, /* SV F - Battery System Warning Capacity Limit */ + kHIDUsage_BS_CapacityGranularity1 = 0x8D, /* SV F - Battery System Capacity Granularity 1 */ + kHIDUsage_BS_CapacityGranularity2 = 0x8E, /* SV F - Battery System Capacity Granularity 2 */ + kHIDUsage_BS_iOEMInformation = 0x8F, /* SV F - Battery System OEM Information Index */ + /* Reserved 0x90 - 0xBF */ + kHIDUsage_BS_InhibitCharge = 0xC0, /* DF IOF - Battery System Inhibit Charge */ + kHIDUsage_BS_EnablePolling = 0xC1, /* DF IOF - Battery System Enable Polling */ + kHIDUsage_BS_ResetToZero = 0xC2, /* DF IOF - Battery System Reset To Zero */ + /* Reserved 0xC3 - 0xCF */ + kHIDUsage_BS_ACPresent = 0xD0, /* DF IOF - Battery System AC Present */ + kHIDUsage_BS_BatteryPresent = 0xD1, /* DF IOF - Battery System Battery Present */ + kHIDUsage_BS_PowerFail = 0xD2, /* DF IOF - Battery System Power Fail */ + kHIDUsage_BS_AlarmInhibited = 0xD3, /* DF IOF - Battery System Alarm Inhibited */ + kHIDUsage_BS_ThermistorUnderRange = 0xD4, /* DF IOF - Battery System Thermistor Under Range */ + kHIDUsage_BS_ThermistorHot = 0xD5, /* DF IOF - Battery System Thermistor Hot */ + kHIDUsage_BS_ThermistorCold = 0xD6, /* DF IOF - Battery System Thermistor Cold */ + kHIDUsage_BS_ThermistorOverRange = 0xD7, /* DF IOF - Battery System Thermistor Over Range */ + kHIDUsage_BS_VoltageOutOfRange = 0xD8, /* DF IOF - Battery System Voltage Out Of Range */ + kHIDUsage_BS_CurrentOutOfRange = 0xD9, /* DF IOF - Battery System Current Out Of Range */ + kHIDUsage_BS_CurrentNotRegulated = 0xDA, /* DF IOF - Battery System Current Not Regulated */ + kHIDUsage_BS_VoltageNotRegulated = 0xDB, /* DF IOF - Battery System Voltage Not Regulated */ + kHIDUsage_BS_MasterMode = 0xDC, /* DF IOF - Battery System Master Mode */ + /* Reserved 0xDD - 0xEF */ + kHIDUsage_BS_ChargerSelectorSupport = 0xF0, /* SF F- Battery System Charger Support Selector */ + kHIDUsage_BS_ChargerSpec = 0xF1, /* SF F- Battery System Charger Specification */ + kHIDUsage_BS_Level2 = 0xF2, /* SF F- Battery System Charger Level 2 */ + kHIDUsage_BS_Level3 = 0xF3 /* SF F- Battery System Charger Level 3 */ + /* Reserved 0xF2 - 0xFF */ +}; + +/* Bar Code Scanner Page (0x8C) */ +/* This section provides detailed descriptions of the usages employed by Bar Code Scanner Devices. */ +enum +{ + kHIDUsage_BCS_Undefined = 0x00, /* Bar Code Scanner Undefined Usage */ + kHIDUsage_BCS_BadgeReader = 0x01, /* CA - Bar Code Badge Reader */ + kHIDUsage_BCS_BarCodeScanner = 0x02, /* CA -Bar Code Scanner */ + kHIDUsage_BCS_DumbBarCodeScanner = 0x03, /* CA -Dumb Bar Code Scanner Usage */ + kHIDUsage_BCS_CordlessScannerBase = 0x04, /* CA -Cordless Base Usage */ + kHIDUsage_BCS_BarCodeScannerCradle = 0x05, /* CA -Bar Code Scanner Cradle Usage */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_BCS_AttributeReport = 0x10, /* CL - Attribute Report */ + kHIDUsage_BCS_SettingsReport = 0x11, /* CL - Settings Report */ + kHIDUsage_BCS_ScannedDataReport = 0x12, /* CL - Scanned Data Report */ + kHIDUsage_BCS_RawScannedDataReport = 0x13, /* CL - Raw Scanned Data Report */ + kHIDUsage_BCS_TriggerReport = 0x14, /* CL - Trigger Report */ + kHIDUsage_BCS_StatusReport = 0x15, /* CL - Status Report */ + kHIDUsage_BCS_UPC_EANControlReport = 0x16, /* CL - UPC/EAN Control Report */ + kHIDUsage_BCS_EAN2_3LabelControlReport = 0x17, /* CL - EAN 2/3 Label Control Report */ + kHIDUsage_BCS_Code39ControlReport = 0x18, /* CL - Code 39 Control Report */ + kHIDUsage_BCS_Interleaved2of5ControlReport = 0x19, /* CL - Interleaved 2 of 5 Control Report */ + kHIDUsage_BCS_Standard2of5ControlReport = 0x1A, /* CL - Standard 2 of 5 Control Report */ + kHIDUsage_BCS_MSIPlesseyControlReport = 0x1B, /* CL - MSI Plessey Control Report */ + kHIDUsage_BCS_CodabarControlReport = 0x1C, /* CL - Codabar Control Report */ + kHIDUsage_BCS_Code128ControlReport = 0x1D, /* CL - Code 128 Control Report */ + kHIDUsage_BCS_Misc1DControlReport = 0x1E, /* CL - Misc 1D Control Report */ + kHIDUsage_BCS_2DControlReport = 0x1F, /* CL - 2D Control Report */ + /* Reserved 0x20 - 0x2F */ + kHIDUsage_BCS_Aiming_PointerMide = 0x30, /* SF - Aiming Pointer Mode */ + kHIDUsage_BCS_BarCodePresentSensor = 0x31, /* SF - Bar Code Present Sensor */ + kHIDUsage_BCS_Class1ALaser = 0x32, /* SF - Class 1A Laser */ + kHIDUsage_BCS_Class2Laser = 0x33, /* SF - Class 2 Laser */ + kHIDUsage_BCS_HeaterPresent = 0x34, /* SF - Heater Present */ + kHIDUsage_BCS_ContactScanner = 0x35, /* SF - Contact Scanner */ + kHIDUsage_BCS_ElectronicArticleSurveillanceNotification = 0x36, /* SF - Electronic Article Surveillance Notification */ + kHIDUsage_BCS_ConstantElectronicArticleSurveillance = 0x37, /* SF - Constant Electronic Article Surveillance */ + kHIDUsage_BCS_ErrorIndication = 0x38, /* SF - Error Indication */ + kHIDUsage_BCS_FixedBeeper = 0x39, /* SF - Fixed Beeper */ + kHIDUsage_BCS_GoodDecodeIndication = 0x3A, /* SF - Good Decode Indication */ + kHIDUsage_BCS_HandsFreeScanning = 0x3B, /* SF - Hands Free Scanning */ + kHIDUsage_BCS_IntrinsicallySafe = 0x3C, /* SF - Intrinsically Safe */ + kHIDUsage_BCS_KlasseEinsLaser = 0x3D, /* SF - Klasse Eins Laser */ + kHIDUsage_BCS_LongRangeScanner = 0x3E, /* SF - Long Range Scanner */ + kHIDUsage_BCS_MirrorSpeedControl = 0x3F, /* SF - Mirror Speed Control */ + kHIDUsage_BCS_NotOnFileIndication = 0x40, /* SF - Not On File Indication */ + kHIDUsage_BCS_ProgrammableBeeper = 0x41, /* SF - Programmable Beeper */ + kHIDUsage_BCS_Triggerless = 0x42, /* SF - Triggerless */ + kHIDUsage_BCS_Wand = 0x43, /* SF - Wand */ + kHIDUsage_BCS_WaterResistant = 0x44, /* SF - Water Resistant */ + kHIDUsage_BCS_MultiRangeScanner = 0x45, /* SF - Multi-Range Scanner */ + kHIDUsage_BCS_ProximitySensor = 0x46, /* SF - Proximity Sensor */ + /* Reserved 0x47 - 0x4C */ + kHIDUsage_BCS_FragmentDecoding = 0x4D, /* DF - Fragment Decoding */ + kHIDUsage_BCS_ScannerReadConfidence = 0x4E, /* DV - Scanner Read Confidence */ + kHIDUsage_BCS_DataPrefix = 0x4F, /* NAry - Data Prefix */ + kHIDUsage_BCS_PrefixAIMI = 0x50, /* SEL - Prefix AIMI */ + kHIDUsage_BCS_PrefixNone = 0x51, /* SEL - Prefix None */ + kHIDUsage_BCS_PrefixProprietary = 0x52, /* SEL - Prefix Proprietary */ + /* Reserved 0x53 - 0x54 */ + kHIDUsage_BCS_ActiveTime = 0x55, /* DV - Active Time */ + kHIDUsage_BCS_AimingLaserPattern = 0x56, /* DF - Aiming Laser Pattern */ + kHIDUsage_BCS_BarCodePresent = 0x57, /* OOC - Bar Code Present */ + kHIDUsage_BCS_BeeperState = 0x58, /* OOC - Beeper State */ + kHIDUsage_BCS_LaserOnTime = 0x59, /* DV - Laser On Time */ + kHIDUsage_BCS_LaserState = 0x5A, /* OOC - Laser State */ + kHIDUsage_BCS_LockoutTime = 0x5B, /* DV - Lockout Time */ + kHIDUsage_BCS_MotorState = 0x5C, /* OOC - Motor State */ + kHIDUsage_BCS_MotorTimeout = 0x5D, /* DV - Motor Timeout */ + kHIDUsage_BCS_PowerOnResetScanner = 0x5E, /* DF - Power On Reset Scanner */ + kHIDUsage_BCS_PreventReadOfBarcodes = 0x5F, /* DF - Prevent Read of Barcodes */ + kHIDUsage_BCS_InitiateBarcodeRead = 0x60, /* DF - Initiate Barcode Read */ + kHIDUsage_BCS_TriggerState = 0x61, /* DF - Trigger State */ + kHIDUsage_BCS_TriggerMode = 0x62, /* NAry - Trigger Mode */ + kHIDUsage_BCS_TriggerModeBlinkingLaserOn = 0x63, /* SEL - Trigger Mode Blinking Laser On */ + kHIDUsage_BCS_TriggerModeContinuousLaserOn = 0x64, /* SEL - Trigger Mode Continuous Laser On */ + kHIDUsage_BCS_TriggerModeLaserOnWhilePulled = 0x65, /* SEL - Trigger Mode Laser on while Pulled */ + kHIDUsage_BCS_TriggerModeLaserStaysOnAfterTriggerRelease = 0x66, /* SEL - Trigger Mode Laser stays on after Trigger Release */ + /* Reserved 0x67 - 0x6C */ + kHIDUsage_BCS_CommitParametersToNVM = 0x6D, /* DF - Commit Parameters to NVM */ + kHIDUsage_BCS_ParameterScanning = 0x6E, /* DF - Parameter Scanning */ + kHIDUsage_BCS_ParametersChanged = 0x6F, /* OOC - Parameters Changed */ + kHIDUsage_BCS_SetParameterDefaultValues = 0x70, /* DF - Set parameter default values */ + /* Reserved 0x71 - 0x74 */ + kHIDUsage_BCS_ScannerInCradle = 0x75, /* OOC - Scanner In Cradle */ + kHIDUsage_BCS_ScannerInRange = 0x76, /* OOC - Scanner In Range */ + /* Reserved 0x77 - 0x79 */ + kHIDUsage_BCS_AimDuration = 0x7A, /* DV - Aim Duration */ + kHIDUsage_BCS_GoodReadLampDuration = 0x7B, /* DV - Good Read Lamp Duration */ + kHIDUsage_BCS_GoodReadLampIntensity = 0x7C, /* DV - Good Read Lamp Intensity */ + kHIDUsage_BCS_GoodReadLED = 0x7D, /* DF - Good Read LED */ + kHIDUsage_BCS_GoodReadToneFrequency = 0x7E, /* DV - Good Read Tone Frequency*/ + kHIDUsage_BCS_GoodReadToneLength = 0x7F, /* DV - Good Read Tone Length */ + kHIDUsage_BCS_GoodReadToneVolume = 0x80, /* DV - Good Read Tone Volume */ + /* Reserved 0x81 */ + kHIDUsage_BCS_NoReadMessage = 0x82, /* DF - No Read Message */ + kHIDUsage_BCS_NotOnFileVolume = 0x83, /* DV - Not on File Volume */ + kHIDUsage_BCS_PowerupBeep = 0x84, /* DF - Powerup Beep */ + kHIDUsage_BCS_SoundErrorBeep = 0x85, /* DF - Sound Error Beep */ + kHIDUsage_BCS_SoundGoodReadBeep = 0x86, /* DF - Sound Good Read Beep */ + kHIDUsage_BCS_SoundNotOnFileBeep = 0x87, /* DF - Sound Not On File Beep */ + kHIDUsage_BCS_GoodReadWhenToWrite = 0x88, /* NArry - Good Read When to Write */ + kHIDUsage_BCS_GRWTIAfterDecode = 0x89, /* SEL - GRWTI After Decode */ + kHIDUsage_BCS_GRWTIBeep_LampAfterTransmit = 0x8A, /* SEL - GRWTI Beep/Lamp after transmit */ + kHIDUsage_BCS_GRWTINoBeep_LampUseAtAll = 0x8B, /* SEL - GRWTI No Beep/Lamp at all */ + /* Reserved 0x8C - 0x90 */ + kHIDUsage_BCS_BooklandEAN = 0x91, /* DF - Bookland EAN */ + kHIDUsage_BCS_ConvertEAN8To13Type = 0x92, /* DF - Convert EAN 8 to 13 Type */ + kHIDUsage_BCS_ConvertUPCAToEAN_13 = 0x93, /* DF - Convert UPC A to EAN-13 */ + kHIDUsage_BCS_ConvertUPC_EToA = 0x94, /* DF - Convert UPC-E to A */ + kHIDUsage_BCS_EAN_13 = 0x95, /* DF - EAN-13 */ + kHIDUsage_BCS_EAN_8 = 0x96, /* DF - EAN_8 */ + kHIDUsage_BCS_EAN_99_128_Mandatory = 0x97, /* DF - EAN-99 128_Mandatory */ + kHIDUsage_BCS_EAN_99_P5_128_Optional = 0x98, /* DF - EAN-99 P5/128_Optional */ + /* Reserved 0x99 */ + kHIDUsage_BCS_UPC_EAN = 0x9A, /* DF - UPC/EAN */ + kHIDUsage_BCS_UPC_EANCouponCode = 0x9B, /* DF - UPC/EAN Coupon Code */ + kHIDUsage_BCS_UPC_EANPeriodicals = 0x9C, /* DV - UPC/EAN Periodicals */ + kHIDUsage_BCS_UPC_A = 0x9D, /* DF - UPC-A */ + kHIDUsage_BCS_UPC_AWith128Mandatory = 0x9E, /* DF - UPC-A with 128 Mandatory */ + kHIDUsage_BCS_UPC_AWith128Optical = 0x9F, /* DF - UPC-A with 128 Optical */ + kHIDUsage_BCS_UPC_AWithP5Optional = 0xA0, /* DF - UPC-A with P5 Optional */ + kHIDUsage_BCS_UPC_E = 0xA1, /* DF - UPC-E */ + kHIDUsage_BCS_UPC_E1 = 0xA2, /* DF - UPC-E1 */ + /* Reserved 0xA3 - 0xA8 */ + kHIDUsage_BCS_Periodical = 0xA9, /* NArry - Periodical */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus2 = 0xAA,/* SEL - Periodical Auto-Discriminate + 2 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus2 = 0xAB, /* SEL - Periodical Only Decode with + 2 */ + kHIDUsage_BCS_PeriodicalIgnorePlus2 = 0xAC, /* SEL - Periodical Ignore + 2 */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus5 = 0xAD,/* SEL - Periodical Auto-Discriminate + 5 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus5 = 0xAE, /* SEL - Periodical Only Decode with + 5 */ + kHIDUsage_BCS_PeriodicalIgnorePlus5 = 0xAF, /* SEL - Periodical Ignore + 5 */ + kHIDUsage_BCS_Check = 0xB0, /* NArry - Check */ + kHIDUsage_BCS_CheckDisablePrice = 0xB1, /* SEL - Check Disable Price */ + kHIDUsage_BCS_CheckEnable4DigitPrice = 0xB2, /* SEL - Check Enable 4 digit Price */ + kHIDUsage_BCS_CheckEnable5DigitPrice = 0xB3, /* SEL - Check Enable 5 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean4DigitPrice = 0xB4,/* SEL - Check Enable European 4 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean5DigitPrice = 0xB5,/* SEL - Check Enable European 5 digit Price */ + /* Reserved 0xB6 */ + kHIDUsage_BCS_EANTwoLabel = 0xB7, /* DF - EAN Two Label */ + kHIDUsage_BCS_EANThreeLabel = 0xB8, /* DF - EAN Thread Label */ + kHIDUsage_BCS_EAN8FlagDigit1 = 0xB9, /* DV - EAN 8 Flag Digit 1 */ + kHIDUsage_BCS_EAN8FlagDigit2 = 0xBA, /* DV - EAN 8 Flag Digit 2 */ + kHIDUsage_BCS_EAN8FlagDigit3 = 0xBB, /* DV - EAN 8 Flag Digit 3 */ + kHIDUsage_BCS_EAN13FlagDigit1 = 0xBC, /* DV - EAN 13 Flag Digit 1 */ + kHIDUsage_BCS_EAN13FlagDigit2 = 0xBD, /* DV - EAN 13 Flag Digit 2 */ + kHIDUsage_BCS_EAN13FlagDigit3 = 0xBE, /* DV - EAN 13 Flag Digit 3 */ + kHIDUsage_BCS_AddEAN2_3LabelDefinition = 0xBF, /* DF - Add EAN 2/3 Label Definition */ + kHIDUsage_BCS_ClearAllEAN2_3LabelDefinitions = 0xC0,/* DF - Clear all EAN 2/3 Label Definitions */ + /* Reserved 0xC1 - 0xC2 */ + kHIDUsage_BCS_Codabar = 0xC3, /* DF - Codabar */ + kHIDUsage_BCS_Code128 = 0xC4, /* DF - Code 128 */ + /* Reserved 0xC5 - 0xC6 */ + kHIDUsage_BCS_Code39 = 0xC7, /* DF - Code 39 */ + kHIDUsage_BCS_Code93 = 0xC8, /* DF - Code 93 */ + kHIDUsage_BCS_FullASCIIConversion = 0xC9, /* DF - Full ASCII Conversion */ + kHIDUsage_BCS_Interleaved2of5 = 0xCA, /* DF - Interleaved 2 of 5 */ + kHIDUsage_BCS_ItalianPharmacyCode = 0xCB, /* DF - Italian Pharmacy Code */ + kHIDUsage_BCS_MSI_Plessey = 0xCC, /* DF - MSI/Plessey */ + kHIDUsage_BCS_Standard2of5IATA = 0xCD, /* DF - Standard 2 of 5 IATA */ + kHIDUsage_BCS_Standard2of5 = 0xCE, /* DF - Standard 2 of 5 */ + /* Reserved 0xCF - 0xD2 */ + kHIDUsage_BCS_TransmitStart_Stop = 0xD3, /* DF - Transmit Start/Stop */ + kHIDUsage_BCS_TriOptic = 0xD4, /* DF - Tri-Optic */ + kHIDUsage_BCS_UCC_EAN_128 = 0xD5, /* DF - UCC/EAN-128 */ + kHIDUsage_BCS_CheckDigit = 0xD6, /* NArry - Check Digit */ + kHIDUsage_BCS_CheckDigitDisable = 0xD7, /* SEL - Check Digit Disable */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5OPCC = 0xD8, /* SEL - Check Digit Enable Interleaved 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5USS = 0xD9, /* SEL - Check Digit Enable Interleaved 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5OPCC = 0xD8, /* SEL - Check Digit Enable Standard 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5USS = 0xD9, /* SEL - Check Digit Enable Standard 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableOneMSIPlessey = 0xDC, /* SEL - Check Digit Enable One MSI Plessey */ + kHIDUsage_BCS_CheckDigitEnableTwoMSIPlessey = 0xDD, /* SEL - Check Digit Enable Two MSI Plessey */ + kHIDUsage_BCS_CheckDigitCodabarEnable = 0xDE, /* SEL - Check Digit Codabar Enable */ + kHIDUsage_BCS_CheckDigitCode99Enable = 0xDF, /* SEL - Check Digit Code 99 Enable */ + /* Reserved 0xE0 - 0xEF */ + kHIDUsage_BCS_TransmitCheckDigit = 0xF0, /* NArry - Transmit Check Digit */ + kHIDUsage_BCS_DisableCheckDigitTransmit = 0xF1, /* SEL - Disable Check Digit Transmit */ + kHIDUsage_BCS_EnableCheckDigitTransmit = 0xF2, /* SEL - Enable Check Digit Transmit */ + /* Reserved 0xF3 - 0xFA */ + kHIDUsage_BCS_SymbologyIdentifier1 = 0xFB, /* DV - Symbology Identifier 1 */ + kHIDUsage_BCS_SymbologyIdentifier2 = 0xFC, /* DV - Symbology Identifier 2 */ + kHIDUsage_BCS_SymbologyIdentifier3 = 0xFD, /* DV - Symbology Identifier 3 */ + kHIDUsage_BCS_DecodedData = 0xFE, /* DV - Decoded Data */ + kHIDUsage_BCS_DecodeDataContinued = 0xFF, /* DF - Decode Data Continued */ + kHIDUsage_BCS_BarSpaceData = 0x100, /* DV - Bar Space Data */ + kHIDUsage_BCS_ScannerDataAccuracy = 0x101, /* DV - Scanner Data Accuracy */ + kHIDUsage_BCS_RawDataPolarity = 0x102, /* NArry - Raw Data Polarity */ + kHIDUsage_BCS_PolarityInvertedBarCode = 0x103, /* SEL - Polarity Inverted Bar Code */ + kHIDUsage_BCS_PolarityNormalBarCode = 0x103, /* SEL - Polarity Normal Bar Code */ + /* Reserved 0x105 */ + kHIDUsage_BCS_MinimumLengthToDecode = 0x106, /* DV - Minimum Length to Decode */ + kHIDUsage_BCS_MaximumLengthToDecode = 0x107, /* DV - Maximum Length to Decode */ + kHIDUsage_BCS_FirstDiscreteLengthToDecode = 0x108, /* DV - First Discrete Length to Decode */ + kHIDUsage_BCS_SecondDiscreteLengthToDecode = 0x109, /* DV - Second Discrete Length to Decode */ + kHIDUsage_BCS_DataLengthMethod = 0x10A, /* NArry - Data Length Method */ + kHIDUsage_BCS_DLMethodReadAny = 0x10B, /* DF - DL Method Read any */ + kHIDUsage_BCS_DLMethodCheckInRange = 0x10C, /* DF - DL Method Check in Range */ + kHIDUsage_BCS_DLMethodCheckForDiscrete = 0x10D, /* DF - DL Method Check for Discrete */ + /* Reserved 0x10E - 0x10F */ + kHIDUsage_BCS_AztecCode = 0x110, /* DF - Aztec Code */ + kHIDUsage_BCS_BC412 = 0x111, /* DF - BC412 */ + kHIDUsage_BCS_ChannelCode = 0x112, /* DF - Channel Code */ + kHIDUsage_BCS_Code16 = 0x113, /* DF - Code 16 */ + kHIDUsage_BCS_Code32 = 0x114, /* DF - Code 32 */ + kHIDUsage_BCS_Code49 = 0x115, /* DF - Code 49 */ + kHIDUsage_BCS_CodeOne = 0x116, /* DF - Code One */ + kHIDUsage_BCS_Colorcode = 0x117, /* DF - Colorcode */ + kHIDUsage_BCS_DataMatrix = 0x118, /* DF - Data Matrix */ + kHIDUsage_BCS_MaxiCode = 0x119, /* DF - MaxiCode */ + kHIDUsage_BCS_MicroPDF = 0x11A, /* DF - MicroPDF */ + kHIDUsage_BCS_PDF_417 = 0x11B, /* DF - PDF-417 */ + kHIDUsage_BCS_PosiCode = 0x11C, /* DF - PosiCode */ + kHIDUsage_BCS_QRCode = 0x11D, /* DF - QR Code */ + kHIDUsage_BCS_SuperCode = 0x11E, /* DF - SuperCode */ + kHIDUsage_BCS_UltraCode = 0x11F, /* DF - UltraCode */ + kHIDUsage_BCS_USB_5_SlugCode = 0x120, /* DF - USD-5 (Slug Code) */ + kHIDUsage_BCS_VeriCode = 0x121 /* DF - VeriCode */ + /* Reserved 0x122 - 0xFFFF */ +}; + +/* Weighing Devices Page (0x8D) */ +/* This section provides detailed descriptions of the usages employed by Weighing Devices. */ +enum +{ + kHIDUsage_WD_Undefined = 0x00, /* Weighing Device Undefined Usage */ + kHIDUsage_WD_WeighingDevice = 0x01, /* CA - Weighing Device */ + /* Reserved 0x02 - 0x1F */ + kHIDUsage_WD_ScaleScaleDevice = 0x20, /* CL - Scale Device */ + kHIDUsage_WD_ScaleScaleClassIMetricCL = 0x21, /* CL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIMetric = 0x22, /* SEL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIIMetric = 0x23, /* SEL - Scale Class II Metric */ + kHIDUsage_WD_ScaleScaleClassIIIMetric = 0x24, /* SEL - Scale Class III Metric */ + kHIDUsage_WD_ScaleScaleClassIIILMetric = 0x25, /* SEL - Scale Class IIIL Metric */ + kHIDUsage_WD_ScaleScaleClassIVMetric = 0x26, /* SEL - Scale Class IV Metric */ + kHIDUsage_WD_ScaleScaleClassIIIEnglish = 0x27, /* SEL - Scale Class III English */ + kHIDUsage_WD_ScaleScaleClassIIILEnglish = 0x28, /* SEL - Scale Class IIIL English */ + kHIDUsage_WD_ScaleScaleClassIVEnglish = 0x29, /* SEL - Scale Class IV English */ + kHIDUsage_WD_ScaleScaleClassGeneric = 0x2A, /* SEL - Scale Class Generic */ + /* Reserved 0x2B - 0x2F */ + kHIDUsage_WD_ScaleAtrributeReport = 0x30, /* CL - Scale Attribute Report */ + kHIDUsage_WD_ScaleControlReport = 0x31, /* CL - Scale Control Report */ + kHIDUsage_WD_ScaleDataReport = 0x32, /* CL - Scale Data Report */ + kHIDUsage_WD_ScaleStatusReport = 0x33, /* CL - Scale Status Report */ + kHIDUsage_WD_ScaleWeightLimitReport = 0x34, /* CL - Scale Weight Limit Report */ + kHIDUsage_WD_ScaleStatisticsReport = 0x35, /* CL - Scale Statistics Report */ + /* Reserved 0x36 - 0x3F */ + kHIDUsage_WD_DataWeight = 0x40, /* DV - Data Weight */ + kHIDUsage_WD_DataScaling = 0x41, /* DV - Data Scaling */ + /* Reserved 0x42 - 0x4F */ + kHIDUsage_WD_WeightUnit = 0x50, /* CL - Weight Unit */ + kHIDUsage_WD_WeightUnitMilligram = 0x51, /* SEL - Weight Unit Milligram */ + kHIDUsage_WD_WeightUnitGram = 0x52, /* SEL - Weight Unit Gram */ + kHIDUsage_WD_WeightUnitKilogram = 0x53, /* SEL - Weight Unit Kilogram */ + kHIDUsage_WD_WeightUnitCarats = 0x54, /* SEL - Weight Unit Carats */ + kHIDUsage_WD_WeightUnitTaels = 0x55, /* SEL - Weight Unit Taels */ + kHIDUsage_WD_WeightUnitGrains = 0x56, /* SEL - Weight Unit Grains */ + kHIDUsage_WD_WeightUnitPennyweights = 0x57, /* SEL - Weight Unit Pennyweights */ + kHIDUsage_WD_WeightUnitMetricTon = 0x58, /* SEL - Weight Unit Metric Ton */ + kHIDUsage_WD_WeightUnitAvoirTon = 0x59, /* SEL - Weight Unit Avoir Ton */ + kHIDUsage_WD_WeightUnitTroyOunce = 0x5A, /* SEL - Weight Unit Troy Ounce */ + kHIDUsage_WD_WeightUnitOunce = 0x5B, /* SEL - Weight Unit Ounce */ + kHIDUsage_WD_WeightUnitPound = 0x5C, /* SEL - Weight Unit Pound */ + /* Reserved 0x5D - 0x5F */ + kHIDUsage_WD_CalibrationCount = 0x60, /* DV - Calibration Count */ + kHIDUsage_WD_RezeroCount = 0x61, /* DV - Re-Zero Count*/ + /* Reserved 0x62 - 0x6F */ + kHIDUsage_WD_ScaleStatus = 0x70, /* CL - Scale Status */ + kHIDUsage_WD_ScaleStatusFault = 0x71, /* SEL - Scale Status Fault */ + kHIDUsage_WD_ScaleStatusStableAtZero = 0x72, /* SEL - Scale Status Stable at Center of Zero */ + kHIDUsage_WD_ScaleStatusInMotion = 0x73, /* SEL - Scale Status In Motion */ + kHIDUsage_WD_ScaleStatusWeightStable = 0x74, /* SEL - Scale Status Weight Stable */ + kHIDUsage_WD_ScaleStatusUnderZero = 0x75, /* SEL - Scale Status Under Zero */ + kHIDUsage_WD_ScaleStatusOverWeightLimit = 0x76, /* SEL - Scale Status Over Weight Limit */ + kHIDUsage_WD_ScaleStatusRequiresCalibration = 0x77, /* SEL - Scale Status Requires Calibration */ + kHIDUsage_WD_ScaleStatusRequiresRezeroing = 0x78, /* SEL - Scale Status Requires Re-zeroing */ + /* Reserved 0x79 - 0x7F */ + kHIDUsage_WD_ZeroScale = 0x80, /* OOC - Zero Scale */ + kHIDUsage_WD_EnforcedZeroReturn = 0x81 /* OOC - Enforced Zero Return */ + /* Reserved 0x82 - 0xFFFF */ + +}; + +/* Magnetic Stripe Reader Page (0x8E) */ +/* This section provides detailed descriptions of the usages employed by Magnetic Stripe Reader Devices. */ +enum +{ + kHIDUsage_MSR_Undefined = 0x00, /* MagStripe Undefined Usage */ + kHIDUsage_MSR_DeviceReadOnly = 0x01, /* CA - MSR Device Read-Only */ + /* Reserved 0x02 - 0x10 */ + kHIDUsage_MSR_Track1Length = 0x11, /* SF, DF, SEL - Track 1 Length */ + kHIDUsage_MSR_Track2Length = 0x12, /* SF, DF, SEL - Track 2 Length */ + kHIDUsage_MSR_Track3Length = 0x13, /* SF, DF, SEL - Track 3 Length */ + kHIDUsage_MSR_TrackJISLength = 0x14, /* SF, DF, SEL - Track JIS Length */ + /* Reserved 0x15 - 0x1F */ + kHIDUsage_MSR_TrackData = 0x20, /* SF, DF, SEL - Track Data */ + kHIDUsage_MSR_Track1Data = 0x21, /* SF, DF, SEL - Track 1 Data */ + kHIDUsage_MSR_Track2Data = 0x22, /* SF, DF, SEL - Track 2 Data */ + kHIDUsage_MSR_Track3Data = 0x23, /* SF, DF, SEL - Track 3 Data */ + kHIDUsage_MSR_TrackJISData = 0x24 /* SF, DF, SEL - Track JIS Data */ + /* Reserved 0x25 - 0xFFFF */ +}; + +#endif /* _IOHIDUSAGETABLES_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDevice.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDevice.h.svn-base new file mode 100644 index 0000000..bb705a8 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIDevice.h.svn-base @@ -0,0 +1,71 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * IOHIDevice.h - Common Event Source object class. + * + * HISTORY + * 22 May 1992 Mike Paquette at NeXT + * Created. + * 4 Aug 1993 Erik Kay at NeXT + * API cleanup + * 5 Aug 1993 Erik Kay at NeXT + * added ivar space for future expansion + */ + +#ifndef _IOHIDEVICE_H +#define _IOHIDEVICE_H + +#include +#include + +typedef enum { + kHIUnknownDevice = 0, + kHIKeyboardDevice = 1, + kHIRelativePointingDevice = 2 +} IOHIDKind; + +class IOHIDevice : public IOService +{ + OSDeclareDefaultStructors(IOHIDevice); + +public: + virtual bool init(OSDictionary * properties = 0); + virtual void free(); + virtual bool start(IOService * provider); + virtual bool open( IOService * forClient, + IOOptionBits options = 0, + void * arg = 0 ); + + virtual UInt32 deviceType(); + virtual IOHIDKind hidKind(); + virtual UInt32 interfaceID(); + virtual bool updateProperties(void); + virtual IOReturn setProperties( OSObject * properties ); + virtual IOReturn setParamProperties(OSDictionary * dict); + virtual UInt64 getGUID(); + + static SInt32 GenerateKey(OSObject *object); +}; + +#endif /* !_IOHIDEVICE_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIKeyboard.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIKeyboard.h.svn-base new file mode 100644 index 0000000..f6db152 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIKeyboard.h.svn-base @@ -0,0 +1,268 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * EventSrcPCKeyboard.h - PC Keyboard EventSrc subclass definition + * + * HISTORY + * 28 Aug 1992 Joe Pasqua + * Created. + */ + +#ifndef _IOHIKEYBOARD_H +#define _IOHIKEYBOARD_H + +#include +#include + +/* Start Action Definitions */ + +/* + * HISTORICAL NOTE: + * The following entry points were part of the IOHIKeyboardEvents + * protocol. + */ + +typedef void (*KeyboardEventAction)( OSObject * target, + /* eventFlags */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + +typedef void (*KeyboardSpecialEventAction)(OSObject * target, + /* eventType */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* source id */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + +typedef void (*UpdateEventFlagsAction)( OSObject * target, + /* flags */ unsigned flags); + +/* Event Callback Definitions */ + +typedef void (*KeyboardEventCallback)( + /* target */ OSObject * target, + /* eventFlags */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*KeyboardSpecialEventCallback)( + /* target */ OSObject * target, + /* eventType */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* source id */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*UpdateEventFlagsCallback)( + /* target */ OSObject * target, + /* flags */ unsigned flags, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +/* End Action Definitions */ + + + +/* Default key repeat parameters */ +#define EV_DEFAULTINITIALREPEAT 500000000ULL // 1/2 sec in nanoseconds +#define EV_DEFAULTKEYREPEAT 83333333ULL // 1/12 sec in nanoseconds +#define EV_MINKEYREPEAT 16700000ULL // 1/60 sec + +class IOHIKeyboard : public IOHIDevice +{ + OSDeclareDefaultStructors(IOHIKeyboard); + + friend class IOHIDKeyboardDevice; + friend class IOHIDKeyboard; + friend class IOHIDConsumer; + +protected: + IOLock * _deviceLock; // Lock for all device access + IOHIKeyboardMapper * _keyMap; // KeyMap instance + + // The following fields describe the kind of keyboard + UInt32 _interfaceType; + UInt32 _deviceType; + + // The following fields describe the state of the keyboard + UInt32 * _keyState; // kbdBitVector + IOByteCount _keyStateSize; // kbdBitVector allocated size + unsigned _eventFlags; // Current eventFlags + bool _alphaLock; // true means alpha lock is on + bool _numLock; // true means num lock is on + bool _charKeyActive; // true means char gen. key active + + // The following fields are used in performing key repeats + bool _isRepeat; // true means we're generating repeat + unsigned _codeToRepeat; // What we are repeating + bool _calloutPending; // true means we've sched. a callout + AbsoluteTime _lastEventTime; // Time last event was dispatched + AbsoluteTime _downRepeatTime; // Time when we should next repeat + AbsoluteTime _keyRepeat; // Delay between key repeats + AbsoluteTime _initialKeyRepeat; // Delay before initial key repeat + UInt64 _guid; + + OSObject * _keyboardEventTarget; + KeyboardEventAction _keyboardEventAction; + OSObject * _keyboardSpecialEventTarget; + KeyboardSpecialEventAction _keyboardSpecialEventAction; + OSObject * _updateEventFlagsTarget; + UpdateEventFlagsAction _updateEventFlagsAction; + +protected: + virtual void dispatchKeyboardEvent(unsigned int keyCode, + /* direction */ bool goingDown, + /* timeStamp */ AbsoluteTime time); + +public: + virtual bool init(OSDictionary * properties = 0); + virtual bool start(IOService * provider); + virtual void stop(IOService * provider); + virtual void free(); + + virtual bool open(IOService * client, + IOOptionBits options, + KeyboardEventAction keAction, + KeyboardSpecialEventAction kseAction, + UpdateEventFlagsAction uefAction); + + bool open( IOService * client, + IOOptionBits options, + void *, + KeyboardEventCallback keCallback, + KeyboardSpecialEventCallback kseCallback, + UpdateEventFlagsCallback uefCallback); + + virtual void close(IOService * client, IOOptionBits ); + + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ); + + virtual IOHIDKind hidKind(); + virtual bool updateProperties( void ); + virtual IOReturn setParamProperties(OSDictionary * dict); + virtual IOReturn setProperties( OSObject * properties ); + + inline bool isRepeat() {return _isRepeat;} + +protected: // for subclasses to implement + virtual const unsigned char * defaultKeymapOfLength(UInt32 * length); + virtual void setAlphaLockFeedback(bool val); + virtual void setNumLockFeedback(bool val); + virtual UInt32 maxKeyCodes(); + + +private: + virtual bool resetKeyboard(); + virtual void scheduleAutoRepeat(); + static void _autoRepeat(void * arg, void *); + virtual void autoRepeat(); + virtual void setRepeat(unsigned eventType, unsigned keyCode); + void setRepeatMode(bool repeat); + static void _createKeyboardNub(thread_call_param_t param0, thread_call_param_t param1); + +/* + * HISTORICAL NOTE: + * The following methods were part of the KeyMapDelegate protocol; + * the declarations have now been merged directly into this class. + */ + +public: + virtual void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned keyCode, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet); + + virtual void keyboardSpecialEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned keyCode, + /* specialty */ unsigned flavor); + + virtual void updateEventFlags(unsigned flags); // Does not generate events + + virtual unsigned eventFlags(); // Global event flags + virtual unsigned deviceFlags(); // per-device event flags + virtual void setDeviceFlags(unsigned flags); // Set device event flags + virtual bool alphaLock(); // current alpha-lock state + virtual void setAlphaLock(bool val); // Set current alpha-lock state + virtual bool numLock(); + virtual void setNumLock(bool val); + virtual bool charKeyActive(); // Is a character gen. key down? + virtual void setCharKeyActive(bool val); // Note that a char gen key is down. + virtual bool doesKeyLock(unsigned key); //does key lock physically + virtual unsigned getLEDStatus(); //check hardware for LED status + +private: + static void _keyboardEvent( IOHIKeyboard * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + static void _keyboardSpecialEvent( + IOHIKeyboard * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + static void _updateEventFlags( IOHIKeyboard * self, + unsigned flags); /* Does not generate events */ + +}; + +#endif /* !_IOHIKEYBOARD_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIKeyboardMapper.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIKeyboardMapper.h.svn-base new file mode 100644 index 0000000..374d25c --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIKeyboardMapper.h.svn-base @@ -0,0 +1,350 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIKEYBOARDMAPPER_H +#define _IOHIKEYBOARDMAPPER_H + +#include +#include +#include +#include + +class IOHIKeyboard; +class IOHIDSystem; + +/* + * Key ip/down state is tracked in a bit list. Bits are set + * for key-down, and cleared for key-up. The bit vector and macros + * for it's manipulation are defined here. + */ + +typedef UInt32 * kbdBitVector; + +#define EVK_BITS_PER_UNIT 32 +#define EVK_BITS_MASK 31 +#define EVK_BITS_SHIFT 5 // 1<<5 == 32, for cheap divide + +#define EVK_KEYDOWN(n, bits) \ + (bits)[((n)>>EVK_BITS_SHIFT)] |= (1 << ((n) & EVK_BITS_MASK)) + +#define EVK_KEYUP(n, bits) \ + (bits)[((n)>>EVK_BITS_SHIFT)] &= ~(1 << ((n) & EVK_BITS_MASK)) + +#define EVK_IS_KEYDOWN(n, bits) \ + (((bits)[((n)>>EVK_BITS_SHIFT)] & (1 << ((n) & EVK_BITS_MASK))) != 0) + +/* the maximum number of modifier keys sticky keys can hold at once */ +#define kMAX_MODIFIERS 5 + +/* the number of shift keys in a row that must be depressed to toggle state */ +#define kNUM_SHIFTS_TO_ACTIVATE 5 + +/* the number of milliseconds all the shifts must be pressed in - 30 seconds (30000 mS)*/ +#define kDEFAULT_SHIFTEXPIREINTERVAL 30000 + + +// sticky keys state flags +enum +{ + kState_Disabled_Flag = 0x0001, // disabled and will do nothing until this is changed + kState_ShiftActivates_Flag = 0x0002, // the 'on' gesture (5 shifts) will activate + kState_On = 0x0004, // currently on, will hold down modifiers when pressed + kState_On_ModifiersDown = 0x0008, // one or more modifiers being held down + + kState_Mask = 0x00FF, // mask for all states +}; + +typedef struct _stickyKeys_ToggleInfo +{ + // size of this allocation + IOByteCount size; + + // which modifier key we are tracking (using NX_WHICHMODMASK) + unsigned toggleModifier; + + // the number of times the modifier must be pressed to toggle + unsigned repetitionsToToggle; + + // how long the user has to press the modifier repetitionsToToggle times + // the default is 30 seconds + AbsoluteTime expireInterval; + + // the number of times the modifier used within the alloted time + unsigned currentCount; + + // the times that the last shift must occer for this one to be used + // this array will actually be of size repetitionsToToggle + AbsoluteTime deadlines[1]; +} StickyKeys_ToggleInfo; + +// Flags for each sticky key modifier +// This will allow for chording of keys +// and for key locking +enum +{ + kModifier_DidPerformModifiy = 0x01, + kModifier_DidKeyUp = 0x02, + kModifier_Locked = 0x04, +}; +typedef struct _stickyKeys_ModifierInfo +{ + UInt8 key; // Key code of the sticky modifier + UInt8 state; // The state of the sticky modifier + UInt8 leftModBit; // System Mod bit of the sticky modifier +} StickyKeys_ModifierInfo; + +class IOHIDKeyboardDevice; + +class IOHIKeyboardMapper : public OSObject +{ + OSDeclareDefaultStructors(IOHIKeyboardMapper); + +private: + IOHIKeyboard * _delegate; // KeyMap delegate + bool _mappingShouldBeFreed; // true if map can be IOFree'd + NXParsedKeyMapping _parsedMapping; // current system-wide keymap + IOHIDSystem * _hidSystem; // target of IOHIKeyboard (should be IOHIDSystem) + + // binary compatibility padding + struct ExpansionData { + + // This is for F12 eject + UInt16 f12Eject_State; + UInt32 eject_Delay_MS; + IOTimerEventSource *ejectTimerEventSource; + + // This is for sticky keys + kbdBitVector cached_KeyBits; + StickyKeys_ModifierInfo stickyKeys_StuckModifiers[kMAX_MODIFIERS]; + IOInterruptEventSource *stickyKeysMouseClickEventSource; + IOInterruptEventSource *stickyKeysSetFnStateEventSource; + // The following should really be statics, but placing here + // to match design by predecesor. + OSDictionary *offFnParamDict; + OSDictionary *onFnParamDict; + + // This is for SlowKeys + UInt16 slowKeys_State; + UInt32 slowKeys_Delay_MS; + IOTimerEventSource *slowKeysTimerEventSource; + + // stored for slowKeysPostProcess + UInt8 slowKeys_Aborted_Key; + UInt8 slowKeys_Current_Key; + + UInt32 specialKeyModifierFlags; + + bool supportsF12Eject; + + SInt32 modifierSwap_Modifiers[NX_NUMMODIFIERS]; + + unsigned char * cachedAlphaLockModDefs; + }; + ExpansionData * _reserved; // Reserved for future use. (Internal use only) + +public: + static IOHIKeyboardMapper * keyboardMapper( + IOHIKeyboard * delegate, + const UInt8 * mapping, + UInt32 mappingLength, + bool mappingShouldBeFreed ); + + virtual bool init(IOHIKeyboard * delegate, + const UInt8 * mapping, + UInt32 mappingLength, + bool mappingShouldBeFreed); + virtual void free(); + + virtual const UInt8 * mapping(); + virtual UInt32 mappingLength(); + virtual bool serialize(OSSerialize *s) const; + + virtual void translateKeyCode(UInt8 key, bool keyDown, kbdBitVector keyBits); + virtual UInt8 getParsedSpecialKey(UInt8 logical); //retrieve a key from _parsedMapping + + virtual void setKeyboardTarget (IOService * keyboardTarget); + + virtual bool updateProperties (void); + virtual IOReturn setParamProperties (OSDictionary * dict); + + // keyEventPostProcess is called while a lock is not held, so a recursive + // call back into HIKeyboard is possible + virtual void keyEventPostProcess (void); + +private: + static void makeNumberParamProperty( OSDictionary * dict, const char * key, + unsigned long long number, unsigned int bits ); + + + virtual bool parseKeyMapping(const UInt8 * mapping, + UInt32 mappingLength, + NXParsedKeyMapping * parsedMapping) const; + + virtual void calcModBit(int bit, kbdBitVector keyBits); + virtual void doModCalc(int key, kbdBitVector keyBits); + virtual void doCharGen(int keyCode, bool down); + + /* sticky keys functionality */ +private: + // original translateKeyCode + void rawTranslateKeyCode (UInt8 key, bool keyDown, kbdBitVector keyBits); + bool modifierSwapFilterKey(UInt8 * key); + + // the current state of stickyKeys + UInt32 _stickyKeys_State; + + // the number of modifiers being held down by stickyKeys + int _stickyKeys_NumModifiersDown; + + ////////////////////////////////////////////////////////////// + // THE FOLLOWING CLASS VARIABLE HAS BEEN DEPRECATED + // + // PLEASE USE _stickyKeys_StuckModifiers + // + UInt8 _stickyKeys_Modifiers[kMAX_MODIFIERS]; + ////////////////////////////////////////////////////////////// + + // contains the info needed to keep track of shift repetitions + StickyKeys_ToggleInfo * _stickyKeys_ShiftToggle; + + // contains the info needed to keep track of option repetitions + StickyKeys_ToggleInfo * _stickyKeys_OptionToggle; + + // dictionaries with cached on and off states, used to set params when state changes + bool _stateDirty; + OSDictionary * _onParamDict; + OSDictionary * _offParamDict; + + // init/free vars + bool stickyKeysinit (void); + void stickyKeysfree (void); + + // allocate/free a StickyKeys_ToggleInfo struct + static StickyKeys_ToggleInfo * stickyKeysAllocToggleInfo (unsigned maxCount); + static void stickyKeysFreeToggleInfo (StickyKeys_ToggleInfo * toggleInfo); + + // create on/off dicts as part of init + bool createParamDicts (void); + + // post special keyboard events thru the event system + void postKeyboardSpecialEvent (unsigned subtype, unsigned eventType=NX_SYSDEFINED); + + // check any modifier to see if it is pressed 5 times + // based on StickyKeys_ToggleInfo + bool stickyKeysModifierToggleCheck( + StickyKeys_ToggleInfo * toggleInfo, + UInt8 key, + bool keyDown, + kbdBitVector keyBits, + bool mouseClick = false); + + // non-modifier key pressed + void stickyKeysNonModifierKey (UInt8 key, bool keyDown, kbdBitVector keyBits, bool mouseClick = false); + + // modifier key pressed (shift, command, option, control) + bool stickyKeysModifierKey (UInt8 key, bool keyDown, kbdBitVector keyBits); + + // main entry point, called for all keys (returns true if key handled) + bool stickyKeysFilterKey (UInt8 key, bool keyDown, kbdBitVector keyBits, bool mouseClick = false); + + // called by interrupt event source to inform sticky keys of mouse down event + static void stickyKeysMouseUp(IOHIKeyboardMapper *owner, IOEventSource *sender); + + void stickyKeysCleanup(); + + // called by interrupt event source to restore prior fn state + static void stickyKeysSetFnState(IOHIKeyboardMapper *owner, IOEventSource *sender); + + /* F12 Eject Functionality */ +private: + + // Determining f12 eject key press + // Returns true if f12 held down for a predetermined period of time. + bool f12EjectFilterKey (UInt8 key, bool keyDown, kbdBitVector keyBits); + + // Timer function for eject + static void performF12Eject(IOHIKeyboardMapper *owner, IOTimerEventSource *sender); + + /* SlowKeys Functionality */ +private: + // Slow keys methods + bool slowKeysFilterKey (UInt8 key, bool keyDown, kbdBitVector keyBits); + + static void slowKeysPostProcess (IOHIKeyboardMapper *owner, IOTimerEventSource *sender); + + +public: + OSMetaClassDeclareReservedUsed(IOHIKeyboardMapper, 0); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + // binary compatibility padding + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 1); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 2); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 3); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 4); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 5); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 6); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 7); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 8); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 9); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 10); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 11); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 12); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 13); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 14); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 15); +}; + +#endif _IOHIKEYBOARDMAPPER_H + +/* + * HISTORICAL NOTE: + * The "delegate" object had to respond to the following protocol; + * this protocol has since been merged into the IOHIKeyboard class. + * + * @protocol KeyMapDelegate + * + * - keyboardEvent :(unsigned)eventType + * flags :(unsigned)flags + * keyCode :(unsigned)keyCode + * charCode:(unsigned)charCode + * charSet :(unsigned)charSet + * originalCharCode:(unsigned)origCharCode + * originalCharSet:(unsigned)origCharSet; + * + * - keyboardSpecialEvent:(unsigned)eventType + * flags :(unsigned)flags + * keyCode :(unsigned)keyCode + * specialty:(unsigned)flavor; + * + * - updateEventFlags:(unsigned)flags; // Does not generate events + * + * - (unsigned)eventFlags; // Global event flags + * - (unsigned)deviceFlags; // per-device event flags + * - setDeviceFlags:(unsigned)flags; // Set device event flags + * - (bool)alphaLock; // current alpha-lock state + * - setAlphaLock:(bool)val; // Set current alpha-lock state + * - (bool)charKeyActive; // Is a character gen. key down? + * - setCharKeyActive:(bool)val; // Note that a char gen key is down. + * + * @end + */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOHIPointing.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIPointing.h.svn-base new file mode 100644 index 0000000..1df225a --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOHIPointing.h.svn-base @@ -0,0 +1,280 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIPOINTING_H +#define _IOHIPOINTING_H + +#include +#include +#include + +/* Start Action Definitions */ + +/* + * HISTORICAL NOTE: + * The following entry points were part of the IOHIPointingEvents + * protocol. + */ +typedef void (*RelativePointerEventAction)(OSObject * target, + /* buttons */ int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + +typedef void (*AbsolutePointerEventAction)(OSObject * target, + /* buttons */ int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + +typedef void (*ScrollWheelEventAction)(OSObject * target, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +/* Event Callback Definitions */ + +typedef void (*RelativePointerEventCallback)( + /* target */ OSObject * target, + /* buttons */ int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*AbsolutePointerEventCallback)( + /* target */ OSObject * target, + /* buttons */ int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*ScrollWheelEventCallback)( + /* target */ OSObject * target, + /* delta1 */ short deltaAxis1, + /* delta2 */ short deltaAxis2, + /* delta3 */ short deltaAxis3, + /* fixedDelta1 */ IOFixed fixedDelta1, + /* fixedDelta2 */ IOFixed fixedDelta2, + /* fixedDelta3 */ IOFixed fixedDelta3, + /* pointDelta1 */ SInt32 pointDelta1, + /* pointDelta2 */ SInt32 pointDelta2, + /* pointDelta3 */ SInt32 pointDelta3, + /* reserved */ SInt32 options, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +/* End Action Definitions */ + +/* Default accel level parameters */ +#define EV_DEFAULTPOINTERACCELLEVEL 0x0000b000 +#define EV_DEFAULTSCROLLACCELLEVEL 0x00005000 + +class IOHIDPointingDevice; +struct ScrollAccelInfo; + +class IOHIPointing : public IOHIDevice +{ + OSDeclareDefaultStructors(IOHIPointing); + + friend class IOHITablet; + friend class IOHIDPointing; + +private: + IOLock * _deviceLock; // Lock for all device access + int _buttonMode; // The "handedness" of the pointer + IOFixed _acceleration; + bool _convertAbsoluteToRelative; + bool _contactToMove; + bool _hadContact; + IOGPoint _previousLocation; + UInt8 _pressureThresholdToClick; // A scale factor of 0 to 255 to determine how much pressure is necessary to generate a primary mouse click - a value of 255 means no click will be generated + void * _scaleSegments; + IOItemCount _scaleSegCount; + IOFixed _fractX; + IOFixed _fractY; + + OSObject * _relativePointerEventTarget; + RelativePointerEventAction _relativePointerEventAction; + OSObject * _absolutePointerEventTarget; + AbsolutePointerEventAction _absolutePointerEventAction; + OSObject * _scrollWheelEventTarget; + ScrollWheelEventAction _scrollWheelEventAction; + + struct ExpansionData { + UInt32 scrollType; + + ScrollAccelInfo * scrollWheelInfo; + ScrollAccelInfo * scrollPointerInfo; + + IOFixed scrollFixedDeltaAxis1; + IOFixed scrollFixedDeltaAxis2; + IOFixed scrollFixedDeltaAxis3; + SInt32 scrollPointDeltaAxis1; + SInt32 scrollPointDeltaAxis2; + SInt32 scrollPointDeltaAxis3; + UInt32 scrollButtonMask; + + // Added to post events to the HID Manager + IOHIDPointingDevice * hidPointingNub; + IOService * openClient; + + bool isSeized; + UInt32 accelerateMode; + + UInt32 scrollZoomMask; + bool lastScrollWasZoom; + bool scrollOff; + }; + + ExpansionData * _reserved; + + void setPointingMode(UInt32 accelerateMode); + UInt32 getPointingMode (); + void setScrollType(UInt32 scrollType); + UInt32 getScrollType(); + + void dispatchScrollWheelEventWithAccelInfo( + SInt32 deltaAxis1, + SInt32 deltaAxis2, + SInt32 deltaAxis3, + ScrollAccelInfo * info, + AbsoluteTime ts); + + +protected: + virtual void dispatchRelativePointerEvent(int dx, + int dy, + UInt32 buttonState, + AbsoluteTime ts); + + virtual void dispatchAbsolutePointerEvent(IOGPoint * newLoc, + IOGBounds * bounds, + UInt32 buttonState, + bool proximity, + int pressure, + int pressureMin, + int pressureMax, + int stylusAngle, + AbsoluteTime ts); + + virtual void dispatchScrollWheelEvent(short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +public: + virtual bool init(OSDictionary * properties = 0); + virtual bool start(IOService * provider); + virtual void free(); + + virtual bool open(IOService * client, + IOOptionBits options, + RelativePointerEventAction rpeAction, + AbsolutePointerEventAction apeAction, + ScrollWheelEventAction sweAction); + + bool open( IOService * client, + IOOptionBits options, + void *, + RelativePointerEventCallback rpeCallback, + AbsolutePointerEventCallback apeCallback, + ScrollWheelEventCallback sweCallback); + + virtual void close(IOService * client, IOOptionBits ); + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ); + + virtual IOHIDKind hidKind(); + virtual bool updateProperties( void ); + virtual IOReturn setParamProperties( OSDictionary * dict ); + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags, + unsigned long newState, IOService * device); + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags powerFlags, + unsigned long newState, IOService * device); + +protected: // for subclasses to implement + virtual OSData * copyAccelerationTable(); + virtual IOItemCount buttonCount(); + virtual IOFixed resolution(); + + // RY: Adding method to copy scroll wheel accel table. + // Unfortunately, we don't have any padding, so this + // is going to be non-virtual. + /*virtual*/ OSData * copyScrollAccelerationTable(); + +private: + virtual bool resetPointer(); + virtual void scalePointer(int * dxp, int * dyp); + virtual void setupForAcceleration(IOFixed accl); + + // RY: Adding methods to support scroll wheel accel. + // Unfortunately, we don't have any padding, so these + // are going to be non-virtual. + /*virtual*/ bool resetScroll(); + /*virtual*/ void setupScrollForAcceleration(IOFixed accl); + + // RY: We have to make sure that subclasses that will + // take advantage of this have their defined resolution + // in their property table. + /*virtual*/ IOFixed scrollResolutionForType(SInt32 type=-1); + /*virtual*/ IOFixed scrollReportRate(); + /*virtual*/ OSData * copyScrollAccelerationTableForType(SInt32 type=-1); + +private: + static void _relativePointerEvent( IOHIPointing * self, + int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + + /* Tablet event reporting */ + static void _absolutePointerEvent(IOHIPointing * self, + int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + + /* Mouse scroll wheel event reporting */ + static void _scrollWheelEvent(IOHIPointing *self, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +}; + +#endif /* !_IOHIPOINTING_H */ diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/IOLLEvent.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/IOLLEvent.h.svn-base new file mode 100644 index 0000000..53fd70c --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/IOLLEvent.h.svn-base @@ -0,0 +1,558 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + event.h (PostScript side version) + + CONFIDENTIAL + Copyright (c) 1988 NeXT, Inc. as an unpublished work. + All Rights Reserved. + + Created Leo 01Mar88 + + Modified: + 04May88 Leo Final event types and record + 22Aug88 Leo Change short -> int for window, add reserved + 26May90 Ted Added NX_UNDIMMASK to correct triggering of UndoAutoDim + 12Dec91 Mike Brought into sync with dpsclient/event.h, and fixed + the #ifndef interlock with dpsclient/event.h that was + broken during the Great Header Revision. + + The PostScript version of this file differs from the + Window Kit version in that the coordinates here are + ints instead of floats. +******************************************************************************/ + +#ifndef _DEV_EVENT_H +#define _DEV_EVENT_H + +#include +#include + +#ifdef EVENT_H /* Interlock with dpsclient/event.h */ +#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/ +#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */ +#define _NXSize_ NXSize +#endif /* _NXSIZE_ */ +#else /* EVENT_H */ /* Haven't seen dpsclient/event.h, so define away */ +#define EVENT_H + +#ifdef KERNEL +#else /* KERNEL */ + +#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/ +#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */ +typedef float NXCoord; + +typedef struct _NXPoint { /* point */ + NXCoord x, y; +} NXPoint; + +typedef struct _NXSize { /* size */ + NXCoord width, height; +} NXSize; +#define _NXSize_ NXSize /* Correct usage in event_status_driver.h */ +#endif /* _NXSIZE_ */ + +#endif /* KERNEL */ + +/* Event types */ + +#define NX_NULLEVENT 0 /* internal use */ + +/* mouse events */ + +#define NX_LMOUSEDOWN 1 /* left mouse-down event */ +#define NX_LMOUSEUP 2 /* left mouse-up event */ +#define NX_RMOUSEDOWN 3 /* right mouse-down event */ +#define NX_RMOUSEUP 4 /* right mouse-up event */ +#define NX_MOUSEMOVED 5 /* mouse-moved event */ +#define NX_LMOUSEDRAGGED 6 /* left mouse-dragged event */ +#define NX_RMOUSEDRAGGED 7 /* right mouse-dragged event */ +#define NX_MOUSEENTERED 8 /* mouse-entered event */ +#define NX_MOUSEEXITED 9 /* mouse-exited event */ + +/* other mouse events + * + * event.data.mouse.buttonNumber should contain the + * button number (2-31) changing state. + */ +#define NX_OMOUSEDOWN 25 /* other mouse-down event */ +#define NX_OMOUSEUP 26 /* other mouse-up event */ +#define NX_OMOUSEDRAGGED 27 /* other mouse-dragged event */ + +/* keyboard events */ + +#define NX_KEYDOWN 10 /* key-down event */ +#define NX_KEYUP 11 /* key-up event */ +#define NX_FLAGSCHANGED 12 /* flags-changed event */ + +/* composite events */ + +#define NX_KITDEFINED 13 /* application-kit-defined event */ +#define NX_SYSDEFINED 14 /* system-defined event */ +#define NX_APPDEFINED 15 /* application-defined event */ +/* There are additional DPS client defined events past this point. */ + +/* Scroll wheel events */ + +#define NX_SCROLLWHEELMOVED 22 + +/* Zoom events */ +#define NX_ZOOM 28 + +/* tablet events */ + +#define NX_TABLETPOINTER 23 /* for non-mousing transducers */ +#define NX_TABLETPROXIMITY 24 /* for non-mousing transducers */ + +/* event range */ + +#define NX_FIRSTEVENT 0 +#define NX_LASTEVENT 28 +#define NX_NUMPROCS (NX_LASTEVENT-NX_FIRSTEVENT+1) + +/* Event masks */ +#define NX_NULLEVENTMASK (1 << NX_NULLEVENT) /* NULL event */ +#define NX_LMOUSEDOWNMASK (1 << NX_LMOUSEDOWN) /* left mouse-down */ +#define NX_LMOUSEUPMASK (1 << NX_LMOUSEUP) /* left mouse-up */ +#define NX_RMOUSEDOWNMASK (1 << NX_RMOUSEDOWN) /* right mouse-down */ +#define NX_RMOUSEUPMASK (1 << NX_RMOUSEUP) /* right mouse-up */ +#define NX_OMOUSEDOWNMASK (1 << NX_OMOUSEDOWN) /* other mouse-down */ +#define NX_OMOUSEUPMASK (1 << NX_OMOUSEUP) /* other mouse-up */ +#define NX_MOUSEMOVEDMASK (1 << NX_MOUSEMOVED) /* mouse-moved */ +#define NX_LMOUSEDRAGGEDMASK (1 << NX_LMOUSEDRAGGED) /* left-dragged */ +#define NX_RMOUSEDRAGGEDMASK (1 << NX_RMOUSEDRAGGED) /* right-dragged */ +#define NX_OMOUSEDRAGGEDMASK (1 << NX_OMOUSEDRAGGED) /* other-dragged */ +#define NX_MOUSEENTEREDMASK (1 << NX_MOUSEENTERED) /* mouse-entered */ +#define NX_MOUSEEXITEDMASK (1 << NX_MOUSEEXITED) /* mouse-exited */ +#define NX_KEYDOWNMASK (1 << NX_KEYDOWN) /* key-down */ +#define NX_KEYUPMASK (1 << NX_KEYUP) /* key-up */ +#define NX_FLAGSCHANGEDMASK (1 << NX_FLAGSCHANGED) /* flags-changed */ +#define NX_KITDEFINEDMASK (1 << NX_KITDEFINED) /* kit-defined */ +#define NX_SYSDEFINEDMASK (1 << NX_SYSDEFINED) /* system-defined */ +#define NX_APPDEFINEDMASK (1 << NX_APPDEFINED) /* app-defined */ +#define NX_SCROLLWHEELMOVEDMASK (1 << NX_SCROLLWHEELMOVED) /* scroll wheel moved */ +#define NX_ZOOMMASK (1 << NX_ZOOM) /* Zoom */ +#define NX_TABLETPOINTERMASK (1 << NX_TABLETPOINTER) /* tablet pointer moved */ +#define NX_TABLETPROXIMITYMASK (1 << NX_TABLETPROXIMITY) /* tablet pointer proximity */ + +#define EventCodeMask(type) (1 << (type)) +#define NX_ALLEVENTS -1 /* Check for all events */ + +/* sub types for mouse and move events */ + +#define NX_SUBTYPE_DEFAULT 0 +#define NX_SUBTYPE_TABLET_POINT 1 +#define NX_SUBTYPE_TABLET_PROXIMITY 2 +#define NX_SUBTYPE_MOUSE_TOUCH 3 + +/* sub types for system defined events */ + +#define NX_SUBTYPE_POWER_KEY 1 +#define NX_SUBTYPE_AUX_MOUSE_BUTTONS 7 + +/* + * NX_SUBTYPE_AUX_CONTROL_BUTTONS usage + * + * The incoming NXEvent for other mouse button down/up has event.type + * NX_SYSDEFINED and event.data.compound.subtype NX_SUBTYPE_AUX_MOUSE_BUTTONS. + * Within the event.data.compound.misc.L[0] contains bits for all the buttons + * that have changed state, and event.data.compound.misc.L[1] contains the + * current button state as a bitmask, with 1 representing down, and 0 + * representing up. Bit 0 is the left button, bit one is the right button, + * bit 2 is the center button and so forth. + */ +#define NX_SUBTYPE_AUX_CONTROL_BUTTONS 8 + +#define NX_SUBTYPE_EJECT_KEY 10 +#define NX_SUBTYPE_SLEEP_EVENT 11 +#define NX_SUBTYPE_RESTART_EVENT 12 +#define NX_SUBTYPE_SHUTDOWN_EVENT 13 + +#define NX_SUBTYPE_STICKYKEYS_ON 100 +#define NX_SUBTYPE_STICKYKEYS_OFF 101 +#define NX_SUBTYPE_STICKYKEYS_SHIFT 102 +#define NX_SUBTYPE_STICKYKEYS_CONTROL 103 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE 104 +#define NX_SUBTYPE_STICKYKEYS_COMMAND 105 +#define NX_SUBTYPE_STICKYKEYS_RELEASE 106 +#define NX_SUBTYPE_STICKYKEYS_TOGGLEMOUSEDRIVING 107 + +// New stickykeys key events +// These were created to send an event describing the +// different state of the modifiers +#define NX_SUBTYPE_STICKYKEYS_SHIFT_DOWN 110 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_DOWN 111 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_DOWN 112 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_DOWN 113 +#define NX_SUBTYPE_STICKYKEYS_FN_DOWN 114 + +#define NX_SUBTYPE_STICKYKEYS_SHIFT_LOCK 120 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_LOCK 121 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_LOCK 122 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_LOCK 123 +#define NX_SUBTYPE_STICKYKEYS_FN_LOCK 124 + +#define NX_SUBTYPE_STICKYKEYS_SHIFT_UP 130 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_UP 131 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_UP 132 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_UP 133 +#define NX_SUBTYPE_STICKYKEYS_FN_UP 134 + + + +// SlowKeys +#define NX_SUBTYPE_SLOWKEYS_START 200 +#define NX_SUBTYPE_SLOWKEYS_ABORT 201 +#define NX_SUBTYPE_SLOWKEYS_END 202 + +// HID Parameter Property Modified +#define NX_SUBTYPE_HIDPARAMETER_MODIFIED 210 + +/* Masks for the bits in event.flags */ + +/* device-independent */ + +#define NX_ALPHASHIFTMASK 0x00010000 +#define NX_SHIFTMASK 0x00020000 +#define NX_CONTROLMASK 0x00040000 +#define NX_ALTERNATEMASK 0x00080000 +#define NX_COMMANDMASK 0x00100000 +#define NX_NUMERICPADMASK 0x00200000 +#define NX_HELPMASK 0x00400000 +#define NX_SECONDARYFNMASK 0x00800000 + +/* device-dependent (really?) */ + +#define NX_DEVICELCTLKEYMASK 0x00000001 +#define NX_DEVICELSHIFTKEYMASK 0x00000002 +#define NX_DEVICERSHIFTKEYMASK 0x00000004 +#define NX_DEVICELCMDKEYMASK 0x00000008 +#define NX_DEVICERCMDKEYMASK 0x00000010 +#define NX_DEVICELALTKEYMASK 0x00000020 +#define NX_DEVICERALTKEYMASK 0x00000040 +#define NX_DEVICERCTLKEYMASK 0x00002000 + +/* + * Additional reserved bits in event.flags + */ + +#define NX_STYLUSPROXIMITYMASK 0x00000080 /* deprecated */ +#define NX_NONCOALSESCEDMASK 0x00000100 + +/* click state values + * If you have the following events in close succession, the click + * field has the indicated value: + * + * Event Click Value Comments + * mouse-down 1 Not part of any click yet + * mouse-up 1 Aha! A click! + * mouse-down 2 Doing a double-click + * mouse-up 2 It's finished + * mouse-down 3 A triple + * mouse-up 3 + */ + +/* Values for the character set in event.data.key.charSet */ + +#define NX_ASCIISET 0 +#define NX_SYMBOLSET 1 +#define NX_DINGBATSSET 2 + +/* tablet button masks + * Mask bits for the tablet barrel buttons placed in tablet.buttons. + * The buttons field uses adopts the following convention: + * + * Bit Comments + * 0 Left Mouse Button ( kHIDUsage_Button_1 ) + * 1 Right Mouse Button ( kHIDUsage_Button_2 ) + * 2 Middle Mouse Button ( kHIDUsage_Button_3 ) + * 3 4th Mouse Button ( kHIDUsage_Button_4 ) + * ... + * 15 15th Mouse Button + * + * For your convenience, the following mask bits have been defined + * for tablet specific application: + */ + +#define NX_TABLET_BUTTON_PENTIPMASK 0x0001 +#define NX_TABLET_BUTTON_PENLOWERSIDEMASK 0x0002 +#define NX_TABLET_BUTTON_PENUPPERSIDEMASK 0x0004 + + +/* tablet capability masks + * Mask bits for the tablet capabilities field. Use these + * masks with the capabilities field of a proximity event to + * determine what fields in a Tablet Event are valid for this + * device. + */ +#define NX_TABLET_CAPABILITY_DEVICEIDMASK 0x0001 +#define NX_TABLET_CAPABILITY_ABSXMASK 0x0002 +#define NX_TABLET_CAPABILITY_ABSYMASK 0x0004 +#define NX_TABLET_CAPABILITY_VENDOR1MASK 0x0008 +#define NX_TABLET_CAPABILITY_VENDOR2MASK 0x0010 +#define NX_TABLET_CAPABILITY_VENDOR3MASK 0x0020 +#define NX_TABLET_CAPABILITY_BUTTONSMASK 0x0040 +#define NX_TABLET_CAPABILITY_TILTXMASK 0x0080 +#define NX_TABLET_CAPABILITY_TILTYMASK 0x0100 +#define NX_TABLET_CAPABILITY_ABSZMASK 0x0200 +#define NX_TABLET_CAPABILITY_PRESSUREMASK 0x0400 +#define NX_TABLET_CAPABILITY_TANGENTIALPRESSUREMASK 0x0800 +#define NX_TABLET_CAPABILITY_ORIENTINFOMASK 0x1000 +#define NX_TABLET_CAPABILITY_ROTATIONMASK 0x2000 + +/* proximity pointer types + * Value that describes the type of pointing device placed in + * proximity.pointerType. + */ + +#define NX_TABLET_POINTER_UNKNOWN 0 +#define NX_TABLET_POINTER_PEN 1 +#define NX_TABLET_POINTER_CURSOR 2 +#define NX_TABLET_POINTER_ERASER 3 + +/* TabletPointData type: defines the tablet data for points included + * in mouse events created by a tablet driver. + */ + +typedef struct _NXTabletPointData { + SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ + SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ + SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ + UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ + UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */ + struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ + SInt16 x; /* scaled tilt x value */ + SInt16 y; /* scaled tilt y value */ + } tilt; + UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ + SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */ + UInt16 deviceID; /* system-assigned unique device ID */ + SInt16 vendor1; /* vendor-defined signed 16-bit integer */ + SInt16 vendor2; /* vendor-defined signed 16-bit integer */ + SInt16 vendor3; /* vendor-defined signed 16-bit integer */ +} NXTabletPointData, *NXTabletPointDataPtr; + +/* TabletProximityData type: defines the tablet data for proximity + * events included in mouse events created by a tablet driver. + */ + +typedef struct _NXTabletProximityData { + UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */ + UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */ + UInt16 pointerID; /* vendor-defined ID of the specific pointing device */ + UInt16 deviceID; /* system-assigned unique device ID */ + UInt16 systemTabletID; /* system-assigned unique tablet ID */ + UInt16 vendorPointerType; /* vendor-defined pointer type */ + UInt32 pointerSerialNumber; /* vendor-defined serial number */ + UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */ + UInt32 capabilityMask; /* capabilities mask of the device */ + UInt8 pointerType; /* type of pointing device */ + UInt8 enterProximity; /* non-zero = entering; zero = leaving */ + SInt16 reserved1; +} NXTabletProximityData, *NXTabletProximityDataPtr; + +/* EventData type: defines the data field of an event */ + +typedef union { + struct { /* For mouse-down and mouse-up events */ + UInt8 subx; /* sub-pixel position for x */ + UInt8 suby; /* sub-pixel position for y */ + SInt16 eventNum; /* unique identifier for this button */ + SInt32 click; /* click state of this event */ + UInt8 pressure; /* pressure value: 0=none, 255=full */ + UInt8 buttonNumber;/* button generating other button event (0-31) */ + UInt8 subType; + UInt8 reserved2; + SInt32 reserved3; + union { + NXTabletPointData point; /* tablet point data */ + NXTabletProximityData proximity; /* tablet proximity data */ + } tablet; + } mouse; + struct { + SInt32 dx; + SInt32 dy; + UInt8 subx; + UInt8 suby; + UInt8 subType; + UInt8 reserved1; + SInt32 reserved2; + union { + NXTabletPointData point; /* tablet point data */ + NXTabletProximityData proximity; /* tablet proximity data */ + } tablet; + } mouseMove; + struct { /* For key-down and key-up events */ + UInt16 origCharSet; /* unmodified character set code */ + SInt16 repeat; /* for key-down: nonzero if really a repeat */ + UInt16 charSet; /* character set code */ + UInt16 charCode; /* character code in that set */ + UInt16 keyCode; /* device-dependent key number */ + UInt16 origCharCode; /* unmodified character code */ + SInt32 reserved1; + UInt32 keyboardType; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5[4]; + } key; + struct { /* For mouse-entered and mouse-exited events */ + SInt16 reserved; + SInt16 eventNum; /* unique identifier from mouse down event */ + SInt32 trackingNum; /* unique identifier from settrackingrect */ + SInt32 userData; /* uninterpreted integer from settrackingrect */ + SInt32 reserved1; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5; + SInt32 reserved6[4]; + } tracking; + struct { + SInt16 deltaAxis1; + SInt16 deltaAxis2; + SInt16 deltaAxis3; + SInt16 reserved1; + SInt32 fixedDeltaAxis1; + SInt32 fixedDeltaAxis2; + SInt32 fixedDeltaAxis3; + SInt32 pointDeltaAxis1; + SInt32 pointDeltaAxis2; + SInt32 pointDeltaAxis3; + SInt32 reserved8[4]; + } scrollWheel, zoom; + struct { /* For window-changed, sys-defined, and app-defined events */ + SInt16 reserved; + SInt16 subType; /* event subtype for compound events */ + union { + float F[11]; /* for use in compound events */ + SInt32 L[11]; /* for use in compound events */ + SInt16 S[22]; /* for use in compound events */ + char C[44]; /* for use in compound events */ + } misc; + } compound; + struct { + SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ + SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ + SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ + UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ + UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */ + struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ + SInt16 x; /* scaled tilt x value */ + SInt16 y; /* scaled tilt y value */ + } tilt; + UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ + SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */ + UInt16 deviceID; /* system-assigned unique device ID */ + SInt16 vendor1; /* vendor-defined signed 16-bit integer */ + SInt16 vendor2; /* vendor-defined signed 16-bit integer */ + SInt16 vendor3; /* vendor-defined signed 16-bit integer */ + SInt32 reserved[4]; + } tablet; + struct { + UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */ + UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */ + UInt16 pointerID; /* vendor-defined ID of the specific pointing device */ + UInt16 deviceID; /* system-assigned unique device ID */ + UInt16 systemTabletID; /* system-assigned unique tablet ID */ + UInt16 vendorPointerType; /* vendor-defined pointer type */ + UInt32 pointerSerialNumber; /* vendor-defined serial number */ + UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */ + UInt32 capabilityMask; /* capabilities mask of the device */ + UInt8 pointerType; /* type of pointing device */ + UInt8 enterProximity; /* non-zero = entering; zero = leaving */ + SInt16 reserved1; + SInt32 reserved2[4]; + } proximity; +} NXEventData; + +/* The current version number of the NXEventData structure. */ + +#define kNXEventDataVersion 2 + +/* Finally! The event record! */ +#ifndef __ppc__ +typedef struct _NXEvent { + SInt32 type; /* An event type from above */ + struct { + SInt32 x, y; /* Base coordinates in window, */ + } location; /* from bottom left */ + UInt64 time __attribute__ ((packed)); /* time since launch */ + SInt32 flags; /* key state flags */ + UInt32 window; /* window number of assigned window */ + UInt64 service_id __attribute__ ((packed)); /* service id */ + SInt32 ext_pid; /* external pid */ + NXEventData data; /* type-dependent data */ +} NXEvent, *NXEventPtr; + +#else + +typedef struct _NXEvent { + SInt32 type; /* An event type from above */ + struct { + SInt32 x, y; /* Base coordinates in window, */ + } location; /* from bottom left */ + UInt64 time __attribute__ ((packed)); /* time since launch */ + SInt32 flags; /* key state flags */ + UInt32 window; /* window number of assigned window */ + NXEventData data; /* type-dependent data */ + UInt64 service_id __attribute__ ((packed)); /* service id */ + SInt32 ext_pid; /* external pid */ +} NXEvent, *NXEventPtr; +#endif + +/* The current version number of the NXEvent structure. */ + +#define kNXEventVersion 2 + +/* How to pick window(s) for event (for PostEvent) */ +#define NX_NOWINDOW -1 +#define NX_BYTYPE 0 +#define NX_BROADCAST 1 +#define NX_TOPWINDOW 2 +#define NX_FIRSTWINDOW 3 +#define NX_MOUSEWINDOW 4 +#define NX_NEXTWINDOW 5 +#define NX_LASTLEFT 6 +#define NX_LASTRIGHT 7 +#define NX_LASTKEY 8 +#define NX_EXPLICIT 9 +#define NX_TRANSMIT 10 +#define NX_BYPSCONTEXT 11 + +#endif /* EVENT_H */ /* End of defs common with dpsclient/event.h */ + +/* Mask of events that cause screen to undim */ + +#define NX_UNDIMMASK (NX_KEYDOWNMASK | NX_KEYUPMASK | \ + NX_LMOUSEDOWNMASK | NX_LMOUSEUPMASK | \ + NX_RMOUSEDOWNMASK | NX_RMOUSEUPMASK | \ + NX_MOUSEMOVEDMASK | NX_FLAGSCHANGEDMASK | \ + NX_MOUSEENTEREDMASK | NX_MOUSEEXITEDMASK | \ + NX_LMOUSEDRAGGEDMASK | NX_RMOUSEDRAGGEDMASK | \ + NX_SCROLLWHEELMOVEDMASK | NX_TABLETPOINTERMASK | \ + NX_TABLETPROXIMITYMASK | NX_NULLEVENTMASK) + +#endif /* !_DEV_EVENT_H */ + diff --git a/i386/include/IOKit/hidsystem/.svn/text-base/ev_keymap.h.svn-base b/i386/include/IOKit/hidsystem/.svn/text-base/ev_keymap.h.svn-base new file mode 100644 index 0000000..a94cf11 --- /dev/null +++ b/i386/include/IOKit/hidsystem/.svn/text-base/ev_keymap.h.svn-base @@ -0,0 +1,166 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * ev_keymap.h + * Defines the structure used for parsing keymappings. These structures + * and definitions are used by event sources in the kernel and by + * applications and utilities which manipulate keymaps. + * + * HISTORY + * 02-Jun-1992 Mike Paquette at NeXT + * Created. + */ + +#ifndef _DEV_EV_KEYMAP_H +#define _DEV_EV_KEYMAP_H + +#define NX_NUMKEYCODES 256 /* Highest key code is 0xff. ADB used to use 0x80 for keydown state, but who the heck uses adb anymore. */ +#define NX_NUMSEQUENCES 128 /* Maximum possible number of sequences */ +#define NX_NUMMODIFIERS 16 /* Maximum number of modifier bits */ +#define NX_BYTE_CODES 0 /* If first short 0, all are bytes (else shorts) */ + +#define NX_WHICHMODMASK 0x0f /* bits out of keyBits for bucky bits */ +#define NX_MODMASK 0x10 /* Bit out of keyBits indicates modifier bit */ +#define NX_CHARGENMASK 0x20 /* bit out of keyBits for char gen */ +#define NX_SPECIALKEYMASK 0x40 /* bit out of keyBits for specialty key */ +#define NX_KEYSTATEMASK 0x80 /* OBSOLETE - DO NOT USE IN NEW DESIGNS */ + +/* + * Special keys currently known to and understood by the system. + * If new specialty keys are invented, extend this list as appropriate. + * The presence of these keys in a particular implementation is not + * guaranteed. + */ +#define NX_NOSPECIALKEY 0xFFFF +#define NX_KEYTYPE_SOUND_UP 0 +#define NX_KEYTYPE_SOUND_DOWN 1 +#define NX_KEYTYPE_BRIGHTNESS_UP 2 +#define NX_KEYTYPE_BRIGHTNESS_DOWN 3 +#define NX_KEYTYPE_CAPS_LOCK 4 +#define NX_KEYTYPE_HELP 5 +#define NX_POWER_KEY 6 +#define NX_KEYTYPE_MUTE 7 +#define NX_UP_ARROW_KEY 8 +#define NX_DOWN_ARROW_KEY 9 +#define NX_KEYTYPE_NUM_LOCK 10 + +#define NX_KEYTYPE_CONTRAST_UP 11 +#define NX_KEYTYPE_CONTRAST_DOWN 12 +#define NX_KEYTYPE_LAUNCH_PANEL 13 +#define NX_KEYTYPE_EJECT 14 +#define NX_KEYTYPE_VIDMIRROR 15 + +#define NX_KEYTYPE_PLAY 16 +#define NX_KEYTYPE_NEXT 17 +#define NX_KEYTYPE_PREVIOUS 18 +#define NX_KEYTYPE_FAST 19 +#define NX_KEYTYPE_REWIND 20 + +#define NX_KEYTYPE_ILLUMINATION_UP 21 +#define NX_KEYTYPE_ILLUMINATION_DOWN 22 +#define NX_KEYTYPE_ILLUMINATION_TOGGLE 23 + +#define NX_NUMSPECIALKEYS 24 /* Maximum number of special keys */ +#define NX_NUM_SCANNED_SPECIALKEYS 24 /* First 24 special keys are */ + /* actively scanned in kernel */ + +/* Mask of special keys that are posted as events */ + +#define NX_SPECIALKEY_POST_MASK \ + ((1 << NX_KEYTYPE_SOUND_UP) | (1 << NX_KEYTYPE_SOUND_DOWN) | \ + (1 << NX_POWER_KEY) | (1 << NX_KEYTYPE_MUTE) | \ + (1 << NX_KEYTYPE_BRIGHTNESS_UP) | (1 << NX_KEYTYPE_BRIGHTNESS_DOWN) | \ + (1 << NX_KEYTYPE_CONTRAST_UP) | (1 << NX_KEYTYPE_CONTRAST_UP) | \ + (1 << NX_KEYTYPE_LAUNCH_PANEL) | (1 << NX_KEYTYPE_EJECT) | \ + (1 << NX_KEYTYPE_VIDMIRROR) | (1 << NX_KEYTYPE_PLAY) | \ + (1 << NX_KEYTYPE_NEXT) | (1 << NX_KEYTYPE_PREVIOUS) | \ + (1 << NX_KEYTYPE_FAST) | (1 << NX_KEYTYPE_REWIND) | \ + (1 << NX_KEYTYPE_ILLUMINATION_UP) | \ + (1 << NX_KEYTYPE_ILLUMINATION_DOWN) | \ + (1 << NX_KEYTYPE_ILLUMINATION_TOGGLE) | 0) + +/* Modifier key indices into modDefs[] */ +#define NX_MODIFIERKEY_ALPHALOCK 0 +#define NX_MODIFIERKEY_SHIFT 1 +#define NX_MODIFIERKEY_CONTROL 2 +#define NX_MODIFIERKEY_ALTERNATE 3 +#define NX_MODIFIERKEY_COMMAND 4 +#define NX_MODIFIERKEY_NUMERICPAD 5 +#define NX_MODIFIERKEY_HELP 6 +#define NX_MODIFIERKEY_SECONDARYFN 7 +#define NX_MODIFIERKEY_NUMLOCK 8 + +/* support for right hand modifier */ +#define NX_MODIFIERKEY_RSHIFT 9 +#define NX_MODIFIERKEY_RCONTROL 10 +#define NX_MODIFIERKEY_RALTERNATE 11 +#define NX_MODIFIERKEY_RCOMMAND 12 + + +typedef struct _NXParsedKeyMapping_ { + /* If nonzero, all numbers are shorts; if zero, all numbers are bytes*/ + short shorts; + + /* + * For each keycode, low order bit says if the key + * generates characters. + * High order bit says if the key is assigned to a modifier bit. + * The second to low order bit gives the current state of the key. + */ + char keyBits[NX_NUMKEYCODES]; + + /* Bit number of highest numbered modifier bit */ + int maxMod; + + /* Pointers to where the list of keys for each modifiers bit begins, + * or NULL. + */ + unsigned char *modDefs[NX_NUMMODIFIERS]; + + /* Key code of highest key deinfed to generate characters */ + int numDefs; + + /* Pointer into the keyMapping where this key's definitions begin */ + unsigned char *keyDefs[NX_NUMKEYCODES]; + + /* number of sequence definitions */ + int numSeqs; + + /* pointers to sequences */ + unsigned char *seqDefs[NX_NUMSEQUENCES]; + + /* Special key definitions */ + int numSpecialKeys; + + /* Special key values, or 0xFFFF if none */ + unsigned short specialKeys[NX_NUMSPECIALKEYS]; + + /* Pointer to the original keymapping string */ + const unsigned char *mapping; + + /* Length of the original string */ + int mappingLen; +} NXParsedKeyMapping; + +#endif /* !_DEV_EV_KEYMAP_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIDDescriptorParser.h b/i386/include/IOKit/hidsystem/IOHIDDescriptorParser.h new file mode 100644 index 0000000..0a32647 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDDescriptorParser.h @@ -0,0 +1,939 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __IOHIDDescriptorParser__ +#define __IOHIDDescriptorParser__ + +#include +#include +#include +#if !TARGET_OS_EMBEDDED + #include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if TARGET_OS_EMBEDDED +/* Types and enums required by these functions but not in IOTypes.h */ + +typedef UInt8 Byte; +typedef SInt8 SignedByte; +typedef unsigned long FourCharCode; +typedef FourCharCode OSType; +typedef UInt32 ByteCount; + +enum { + noErr = 0 +}; +#endif + +/* End missing types and enums */ + +enum +{ + kHIDSuccess = 0, + +/* HID assigned error numbers are -13949 .. -13900 */ + kHIDBaseError = -13950, + + kHIDNullStateErr, + kHIDBufferTooSmallErr, + kHIDValueOutOfRangeErr, + kHIDUsageNotFoundErr, + kHIDNotValueArrayErr, + kHIDInvalidPreparsedDataErr, + kHIDIncompatibleReportErr, + kHIDBadLogPhysValuesErr, + kHIDInvalidReportTypeErr, + kHIDInvalidReportLengthErr, + kHIDNullPointerErr, + kHIDBadParameterErr, + kHIDNotEnoughMemoryErr, + kHIDEndOfDescriptorErr, + kHIDUsagePageZeroErr, + kHIDBadLogicalMinimumErr, + kHIDBadLogicalMaximumErr, + kHIDInvertedLogicalRangeErr, + kHIDInvertedPhysicalRangeErr, + kHIDUnmatchedUsageRangeErr, + kHIDInvertedUsageRangeErr, + kHIDUnmatchedStringRangeErr, + kHIDUnmatchedDesignatorRangeErr, + kHIDReportSizeZeroErr, + kHIDReportCountZeroErr, + kHIDReportIDZeroErr, + kHIDInvalidRangePageErr, + + // + // HID device driver errors + // + + kHIDDeviceNotReady = -13910, // The device is still initializing, try again later + kHIDVersionIncompatibleErr, +}; + +// types of HID reports (input, output, feature) +enum +{ + kHIDInputReport = 1, + kHIDOutputReport, + kHIDFeatureReport, + kHIDUnknownReport = 255 +}; + +// flags passed to HIDOpenReportDescriptor +enum +{ + kHIDFlag_StrictErrorChecking = 0x00000001 +}; + +typedef UInt32 HIDReportType; +typedef UInt32 HIDUsage; + +typedef void *HIDPreparsedDataRef; + +/*! + @typedef HIDUsageAndPage + @abstract The HIDUsageAndPage data structure is used by HID clients when obtaining status of buttons to hold the usage page and usage of a button that is down. + @discussion Clients use the HIDUSageAndPage structure with the HIDGetButtonsEx function to obtain both the usage page and usage identifiers of each button that is down. + @field usage Specifies the usage identifier within the usage page specified by usagePage of a button that is down. + @field usagePage Specifies the usage page identifier of a button that is down. + */ +struct HIDUsageAndPage +{ + HIDUsage usage; + HIDUsage usagePage; +}; +typedef struct HIDUsageAndPage HIDUsageAndPage, *HIDUsageAndPagePtr; + +/*! + @typedef HIDCaps + @abstract The HIDCaps data structure is used by HID clients to hold the capabilities of a HID device. + @discussion This structure holds the parsed capabilities and data maximums returned for a device by the HIDGetCaps function. + @field usage Specifies the specific class of functionality that this device provides. This value is dependent and specific to the value provided in the usagePage field. For example, a keyboard could have a usagePage of kHIDUsagePage_Generic and a usage of kHIDUsage_Generic_Keyboard. + @field usagePage Specifies the usage page identifier for this top level collection. + @field inputReportByteLength Specifies the maximum length, in bytes, of an input report for this device, including the report ID which is unilaterally prepended to the device data. + @field outputReportByteLength Specifies the maximum length, in bytes, of an output report for this device, including the report ID which is unilaterally prepended to the device data. + @field featureReportByteLength Specifies the maximum length, in bytes, of a feature report for this device, including the report ID which is unilaterally prepended to the device data. + @field numberCollectionNodes Specifies the number of HIDCollectionNode structures that are returned for this top level collection by the HIDGetConnectionNodes function. + @field numberInputButtonCaps Specifies the number of input buttons. + @field numberInputValueCaps Specifies the number of input values. + @field numberOutputButtonCaps Specifies the number of output buttons. + @field numberOutputValueCaps Specifies the number of output values + @field numberFeatureButtonCaps Specifies the number of feature buttons. + @field numberFeatureValueCaps Specifies the number of feature values. + */ +struct HIDCaps +{ + HIDUsage usage; + HIDUsage usagePage; + ByteCount inputReportByteLength; + ByteCount outputReportByteLength; + ByteCount featureReportByteLength; + UInt32 numberCollectionNodes; + UInt32 numberInputButtonCaps; + UInt32 numberInputValueCaps; + UInt32 numberOutputButtonCaps; + UInt32 numberOutputValueCaps; + UInt32 numberFeatureButtonCaps; + UInt32 numberFeatureValueCaps; +}; +typedef struct HIDCaps HIDCaps, * HIDCapsPtr; + +struct HIDCapabilities { + HIDUsage usage; + HIDUsage usagePage; + ByteCount inputReportByteLength; + ByteCount outputReportByteLength; + ByteCount featureReportByteLength; + UInt32 numberCollectionNodes; + UInt32 numberInputButtonCaps; + UInt32 numberInputValueCaps; + UInt32 numberOutputButtonCaps; + UInt32 numberOutputValueCaps; + UInt32 numberFeatureButtonCaps; + UInt32 numberFeatureValueCaps; +}; +typedef struct HIDCapabilities HIDCapabilities, * HIDCapabilitiesPtr; + + +struct HIDCollectionNode +{ + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + UInt32 parent; + UInt32 numberOfChildren; + UInt32 nextSibling; + UInt32 firstChild; +}; +typedef struct HIDCollectionNode HIDCollectionNode, * HIDCollectionNodePtr; + +struct HIDButtonCaps +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + SInt32 startBit; // Added esb 9-29-99 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDButtonCaps HIDButtonCaps, * HIDButtonCapsPtr; + +struct HIDButtonCapabilities +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + SInt32 unitExponent; // Added KH 1/25/01 + SInt32 units; // Added KH 1/25/01 +// UInt32 reserved; // Not added KH 1/25/01 + SInt32 startBit; // Added esb 9-29-99 + UInt32 pbVersion; // Added KH 1/25/01 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDButtonCapabilities HIDButtonCapabilities, * HIDButtonCapabilitiesPtr; + +struct HIDValueCaps +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + UInt32 startBit; // Added by esb 9-28-99 + UInt32 bitSize; + UInt32 reportCount; + + SInt32 logicalMin; + SInt32 logicalMax; + SInt32 physicalMin; + SInt32 physicalMax; + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDValueCaps HIDValueCaps, * HIDValueCapsPtr; + +struct HIDValueCapabilities +{ + HIDUsage usagePage; + UInt32 reportID; + UInt32 bitField; + UInt32 collection; + HIDUsage collectionUsage; + HIDUsage collectionUsagePage; + + Boolean isRange; + Boolean isStringRange; + Boolean isDesignatorRange; + Boolean isAbsolute; + + UInt32 bitSize; + UInt32 reportCount; + + SInt32 logicalMin; + SInt32 logicalMax; + SInt32 physicalMin; + SInt32 physicalMax; + + SInt32 unitExponent; // Added KH 1/25/01 + SInt32 units; // Added KH 1/25/01 +// UInt32 reserved; // Not added KH 1/25/01 + SInt32 startBit; // Added esb 9-29-99 // Moved here KH 1/25/01 + UInt32 pbVersion; // Added KH 1/25/01 + + union + { + struct + { + HIDUsage usageMin; + HIDUsage usageMax; + UInt32 stringMin; + UInt32 stringMax; + UInt32 designatorMin; + UInt32 designatorMax; + } range; + struct + { + HIDUsage usage; + HIDUsage reserved1; + UInt32 stringIndex; + UInt32 reserved2; + UInt32 designatorIndex; + UInt32 reserved3; + } notRange; + } u; +}; +typedef struct HIDValueCapabilities HIDValueCapabilities, * HIDValueCapabilitiesPtr; + +/*! + @function HIDOpenReportDescriptor + @abstract The HIDOpenReportDescriptor function allocates the memory the parser needs to handle the given report descriptor, and then parses the report descriptor. + @discussion When the parsed information is no longer needed, clients should call the HIDCloseReportDescriptor function. + @param hidReportDescriptor Contains a pointer to the actual HID report descriptor from the USB device's firmware + @param descriptorLength The length of the HID report descriptor + @param preparsedDataRef Preparsed data reference to be used for subsequent function calls + @param flags Flags for this runction are kHIDFlag_StrictErrorChecking = 0x00000001 + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDOpenReportDescriptor (void * hidReportDescriptor, + ByteCount descriptorLength, + HIDPreparsedDataRef * preparsedDataRef, + UInt32 flags); + +/*! + @function HIDCloseReportDescriptor + @abstract Disposes of the memory the parser allocated for the HIDOpenReportDescriptor function. + @param hidReportDescriptor Contains a pointer to the actual HID report descriptor from the USB device's firmware + @param preparsedDataRef Preparsed data reference for the report that is returned by the HIDOpenReportDescriptor function. After making a call to the HIDCloseReportDescriptor function, the preparsedDataRef is invalid and should not be used. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDCloseReportDescriptor (HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonCaps + @abstract Returns the button capabilities structures for a HID device based on the given preparsed data. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria + @param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtonCaps (HIDReportType reportType, + HIDButtonCapsPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonCapabilities + @abstract Returns the button capabilities structures for a HID device based on the given preparsed data. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria + @param buttonCapsSize Contains the size of the buttonCaps array passed in to the function and is set to the number of elements actually placed in the array after the call completes. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtonCapabilities (HIDReportType reportType, + HIDButtonCapabilitiesPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetCaps + @abstract Returns the capabilities of a HID device based on the given preparsed data. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetCaps (HIDPreparsedDataRef preparsedDataRef, + HIDCapsPtr capabilities); + +/*! + @function HIDGetCapabilities + @abstract Returns the capabilities of a HID device based on the given preparsed data. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param capabilities Points to a caller allocated buffer, that upon return contains the parsed capability information for this HID device. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetCapabilities (HIDPreparsedDataRef preparsedDataRef, + HIDCapabilitiesPtr capabilities); + +/*! + @function HIDGetCollectionNodes + @abstract Returns an array of HIDCollectionNode structures that describe the relationships and layout of the link collections within this top level collection. + @discussion The length of the buffer required, in array elements, for an entire collection node array is found in the HIDCaps structure member numberCollectionNodes. You obtain the HIDCaps information by calling the HIDGetCaps function. For information on the relationships of link collections described by the data returned from this routine, see the descripton of the HIDCollectionNode structure. + @param collectionNodes Points to a caller-allocated array of HIDCollectionNode structures in which this routine returns an entry for each collection within the top level collection. A collection is a group of corresponding HID descriptors containing input, output, and feature items that have some common relationship to one another. For example, a pointer collection contains items for x and y position data, and button data. + @param collectionNodesSize On input, specifies the length in array elements of the buffer provided at collectionNodes. On output, this parameter is set to the number of entries in the collectionNodes array that were initialized. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetCollectionNodes (HIDCollectionNodePtr collectionNodes, + UInt32 * collectionNodesSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetScaledUsageValue + @abstract The HIDGetScaledUsageValue function returns the capabilities for all buttons for a given top level collection. + @discussion Clients who which to obtain all capabilities for a usage that contains multiple data items for a single usage that corresponds to a HID byte array, must call the HIDGetUsageValueArray function. + @param reportType Specifies the type of report for which to retrieve the scaled value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the value to be retrieved. + @param collection Optionally specifies the link collection identifier of the value to be retrieved. + @param usage Specifies the usage of the scaled value to be retrieved. + @param usageValue Points to a variable, that on return from this routine holds the scaled value retrieved from the device report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data + @param reportLength Specifies the length, in bytes, of the report data provided at report + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetScaledUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 * usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetSpecificButtonCaps + @abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificButtonCaps function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCaps function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCaps function. + @param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved. + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCaps structures. The structures contain information for all buttons that meet the search criteria. + @param buttonCapsLength On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificButtonCaps (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDButtonCapsPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificButtonCapabilities + @abstract Retrieves the capabilities for all buttons in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificButtonCapabilities function retrieves capability data for buttons that meet a given search criteria, as opposed to the HIDGetButtonCapabilities function which returns the capability data for all buttons on the device. Calling this routine specifying zero for usagePage, usage and collection is equivalent to calling the HIDGetButtonCapabilities function. + @param reportType Specifies the type of report for which to retrieve the button capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only buttons that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only buttons that are part of the specified link collection are retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only buttons that match the value specified are retrieved. + @param buttonCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDButtonCapabilities structures. The structures contain information for all buttons that meet the search criteria. + @param buttonCapsLength On input, specifies the length, in array elements, of the buffer provided in the buttonCaps parameter. On output, this parameter is set to the actual number of elements that were returned by the function call, in the buffer provided in the buttonCaps parameter, if the routine completed without error. The correct length necessary to retrieve the button capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificButtonCapabilities (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDButtonCapabilitiesPtr buttonCaps, + UInt32 * buttonCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificValueCaps + @abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificValueCaps function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCaps function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCaps function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved. + @param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCaps structures that contain information for all values that meet the search criteria. + @param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificValueCaps (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDValueCapsPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetSpecificValueCapabilities + @abstract Retrieves the capabilities for all values in a specific type of report that meet the search criteria. + @discussion The HIDGetSpecificValueCapabilities function retrieves capability data for values that meet given search criteria, as opposed to the HIDGetValueCapabilities function, which returns the capability data for all values on the device. Calling this routine with a value of zero for usagePage, usage and collection parameters is equivalent to calling the HIDGetValueCapabilities function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies a usage page identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage page will be retrieved. + @param collection Specifies a link collection identifier to use as a search criteria. If this parameter is non-zero, then only values that are part of this link collection will be retrieved. + @param usage Specifies a usage identifier to use as a search criteria. If this parameter is non-zero, then only values that specify this usage will be retrieved. + @param valueCaps Points to a caller-allocated buffer that will contain, on return, an array of HIDValueCapabilities structures that contain information for all values that meet the search criteria. + @param valueCapsSize Specifies the length on input, in array elements, of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned by this function call, in the buffer provided in the valueCaps parameter, if the routine completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device from the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetSpecificValueCapabilities (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDValueCapabilitiesPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetButtonsOnPage + @abstract Retrieves the button stat information for buttons on a specified usage page. + @param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport. + @param usagePage Specifies the usage page of the buttons for which to retrieve the current state. + @param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned. + @param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are perssed and belong to the usage page specified in the usagePage parameter. + @param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferTooSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtonsOnPage (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage * usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetButtons + @abstract The HIDGetButtons function takes a report from a HID device and gets the current state of the buttons in that report. + @param reportType Specifies the type of report, provided in the report parameter, from which to retrieve the buttons. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport or kHIDFeatureReport + @param collection Optionally specifies the link collection identifier used to retrieve only specific button states. If this value is non-zero, only the buttons that are part of the given collection are returned. + @param usageList On return, points to a caller-allocated buffer that contains the usages of all the buttons that are pressed. + @param usageListSize Is the size, in array elements, of the buffer provided in the usageList parameter. On return, this parameter contains the number of button states that were set by this routine. If the error kHIDBufferToSmallErr was returned, this parameter contains the number of array elements required to hold all button data requested. The maximum number of buttons that can ever be returned for a given type of report can be obtained by calling the HIDMaxUsageListLength function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the length, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetButtons (HIDReportType reportType, + UInt32 collection, + HIDUsageAndPagePtr usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +extern +OSStatus +HIDGetNextButtonInfo (HIDReportType reportType, + HIDUsage usagePage, + HIDUsage usage, + UInt32 * collection, + UInt8 * reportID, + HIDPreparsedDataRef preparsedDataRef); + +extern +OSStatus +HIDGetNextUsageValueInfo (HIDReportType reportType, + HIDUsage usagePage, + HIDUsage usage, + UInt32 * collection, + UInt8 * reportID, + HIDPreparsedDataRef preparsedDataRef); + +extern +OSStatus +HIDGetReportLength (HIDReportType reportType, + UInt8 reportID, + ByteCount * reportLength, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetUsageValue + @abstract The HIDGetUsageValue function returns a value from a device data report given a selected search criteria. + @discussion The HIDGetUsageValue function does not sign the value. To have the sign bit automatically applied, use the HIDGetScaledUsageValue function instead. For manually assigning the sign bit, the position of the sign bit can be found in the HIDValueCaps structure for this value. Clients who wish to obtain all data for a usage that contains multiple data items for a single usage, corresponding to a HID byte array, must call the HIDGetUsageValueArray function instead. + @param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the value to retrieve. + @param collection Optionally specifies the link collection identifier of the value to be retrieved. + @param usage Specifies the usage of the value to be retrieved. + @param usageValue Points to a variable, that on return from this routine holds the value retrieved from the device report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 * usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetUsageValueArray + @abstract The HIDGetUsageValueArray function returns a value from a device data report given a selected search criteria. + @discussion When the HIDGetUsageValueArray function retrieves the data, it fills in the buffer in little-endian order beginning with the least significant bit of the data for this usage. The data is filled in without regard to byte alignment and is shifted such that the least significant bit is placed as the 1st bit of the given buffer. + @param reportType Specifies the type of report, provided in report, from which to retrieve the value. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page of the data to be retrieved. + @param collection Optionally specifies the link collection identifier of the data to be retrieved. + @param usage Specifies the usage identifier of the value to be retrieved. + @param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for the value and rounding the resulting value up to the nearest byte. + @param usageValueBufferSize Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in report. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetUsageValueArray (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + Byte * usageValueBuffer, + ByteCount usageValueBufferSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDGetValueCaps + @abstract The HIDGetValueCaps function retrieves the capabilities for all values for a specified top level collection. + @discussion The HIDGetValueCaps function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCaps function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCaps structures containing information for all values in the top level collection. + @param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCaps function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetValueCaps (HIDReportType reportType, + HIDValueCapsPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDGetValueCapabilities + @abstract The HIDGetValueCapabilities function retrieves the capabilities for all values for a specified top level collection. + @discussion The HIDGetValueCapabilities function retrieves the capability data for all values in a top level collection without regard for the usage, usage page or collection of the value. To retrieve value capabilities for a specific usage, usage page or collection, use the HIDGetSpecificValueCapabilities function. + @param reportType Specifies the type of report for which to retrieve the value capabilities. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param valueCaps On return, points to a caller-allocated buffer that contains an array of HIDValueCapabilities structures containing information for all values in the top level collection. + @param valueCapsSize On input, specifies the size in array elements of the buffer provided in the valueCaps parameter. On output, this parameter is set to the actual number of elements that were returned in the buffer provided in the valueCaps parameter, if the function completed without error. The correct length necessary to retrieve the value capabilities can be found in the capability data returned for the device by the HIDGetCapabilities function. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDGetValueCapabilities (HIDReportType reportType, + HIDValueCapabilitiesPtr valueCaps, + UInt32 * valueCapsSize, + HIDPreparsedDataRef preparsedDataRef); + +extern +OSStatus +HIDInitReport (HIDReportType reportType, + UInt8 reportID, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDMaxUsageListLength + @abstract The HIDMaxUsageListLength function returns the maximum number of buttons that can be returned from a given report type for the top level collection. + @param reportType Specifies the type of report for which to get a maximum usage count. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Optionally specifies the usage page identifier to use as a search criteria. If this parameter is zero, the function returns the number of buttons for the entire top-level collection regardless of the actual value of the usage page. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +UInt32 +HIDMaxUsageListLength (HIDReportType reportType, + HIDUsage usagePage, + HIDPreparsedDataRef preparsedDataRef); + +/*! + @function HIDSetScaledUsageValue + @abstract The HIDSetScaledUsageValue function takes a signed physical (scaled) number and converts it to the logical, or device representation and inserts it in a given report. + @discussion The HIDSetScaledUsageValue function automatically handles the setting of the signed bit in the data to be sent to the device. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it will be ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValue Specifies the physical, or scaled, value to be set in the value for the given report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param Specifies the length, in bytes of the report data specified in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetScaledUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDSetButtons + @abstract The HIDSetButtons function takes a report from a HID device and returns the current state of the buttons in that report. + @param reportType Specifies the type of repor. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored. + @param usageList Points to a caller-allocated buffer that contains an array of button data to be set in the report in the report parameter. + @param usageListSize Specifies the size, in array elements, of the buffer provided in the usageList parameter. If an error is returned by a call to this function, the usageListLength parameter contains the location in the array provided in the usageList parameter where the error was encountered. All array entries encountered prior to the error location were successfully set in the report provided in the report parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetButtons (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage * usageList, + UInt32 * usageListSize, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDSetUsageValue + @abstract The HIDSetUsageValue function sets a value in a give report. + @discussion The HIDSetUsageVlaue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValue Specifies the data that is to be set in the value for the given report. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetUsageValue (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + SInt32 usageValue, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDSetUsageValueArray + @abstract The HIDSetUsageValueArray function sets an array of values in a given report. + @discussion The HIDSetUsageValue function does not automatically handle the sign bit. Clients must either manually set the sign bit, at the position provided in the HIDValueCaps structure for this value, or call the HIDSetScaledUsageValue function. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between values that have the same usage page and usage identifiers. If this parameter is zero, it is ignored. + @param usage Specifies the usage identifier of the value to be set in the report. + @param usageValueBuffer Points to a caller-allocated buffer that contains, on output, the data from the device. The correct length for this buffer can be found by multiplying the reportCount and bitSize fields of the HIDValueCaps structure for this value and rounding the resulting value up to the nearest byte. + @param usageValueBufferLength Specifies the size, in bytes, of the buffer in the usageValueBuffer parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetUsageValueArray (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + Byte * usageValueBuffer, + ByteCount usageValueBufferLength, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + +/*! + @function HIDUsageListDifference + @abstract The HIDUsageListDifference function compares and provides the differences between two lists of buttons. + @param previousUsageList Points to the older button list to be used for comparison. + @param currentUsageList Points to the newer button list to be used for comparison. + @param breakUsageList On return, points to a caller-allocated buffer that contains the buttons set in the older list, specified in the previousUsageList parameter, but not set in the new list, specified in the currentUsageList parameter. + @param makeUsageList On return, points to a caller-allocated buffer that contains the buttons set in the new list, specified in the currentUsageList parameter, but not set in the old list, specified in the previousUsageList parameter. + @param usageListsLength Specifies the length, in array elements, of the buffers provided in the currentUsageList and previousUssageList parameters. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDUsageListDifference (HIDUsage * previousUsageList, + HIDUsage * currentUsageList, + HIDUsage * breakUsageList, + HIDUsage * makeUsageList, + UInt32 usageListsSize); + +/*! + @function HIDSetButton + @abstract The HIDSetButton function takes a report from a HID device and sets the current state of the specified button in that report. + @param reportType Specifies the type of report. This parameter must be one of the following: kHIDInputReport, kHIDOutputReport, or kHIDFeatureReport. + @param usagePage Specifies the usage page identifier of the value to be set in the report. + @param collection Optionally specifies the link collection identifier to distinguish between buttons. If this parameter is zero, it is ignored. + @param usage Points to a caller-allocated buffer that contains the button data to be set in the report in the report parameter. + @param preparsedDataRef Preparsed data reference for the report that is retuned by the HIDOpenReportDescriptor function + @param report Points to the caller-allocated buffer that contains the device report data. + @param reportLength Specifies the size, in bytes, of the report data provided in the report parameter. + @result OSStatus Returns an error code if an error was encountered or noErr on success. + */ + +extern +OSStatus +HIDSetButton (HIDReportType reportType, + HIDUsage usagePage, + UInt32 collection, + HIDUsage usage, + HIDPreparsedDataRef preparsedDataRef, + void * report, + ByteCount reportLength); + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/i386/include/IOKit/hidsystem/IOHIDParameter.h b/i386/include/IOKit/hidsystem/IOHIDParameter.h new file mode 100644 index 0000000..f528d03 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDParameter.h @@ -0,0 +1,310 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * evsio.h - Get/Set parameter calls for Event Status Driver. + * + * CAUTION: Developers should stick to the API exported in + * to guarantee + * binary compatability of their applications in future + * releases. + * + * HISTORY + * 22 May 1992 Mike Paquette at NeXT + * Created. + */ +#ifndef _DEV_EVSIO_H +#define _DEV_EVSIO_H + +/* Public type definitions. */ +#include +#include + +/* + * Identify this driver as one that uses the new driverkit and messaging API + */ +#ifndef _NeXT_MACH_EVENT_DRIVER_ +#define _NeXT_MACH_EVENT_DRIVER_ (1) +#endif /* !_NeXT_MACH_EVENT_DRIVER_ */ + +/* * */ + +#define kIOHIDKindKey "HIDKind" +#define kIOHIDInterfaceIDKey "HIDInterfaceID" +#define kIOHIDSubinterfaceIDKey "HIDSubinterfaceID" + +#define kIOHIDParametersKey "HIDParameters" + +#define kIOHIDVirtualHIDevice "HIDVirtualDevice" + +#define kIOHIDKeyRepeatKey "HIDKeyRepeat" +#define kIOHIDInitialKeyRepeatKey "HIDInitialKeyRepeat" +#define kIOHIDKeyMappingKey "HIDKeyMapping" +#define kIOHIDResetKeyboardKey "HIDResetKeyboard" + +#define kIOHIDKeyboardModifierMappingPairsKey "HIDKeyboardModifierMappingPairs" +#define kIOHIDKeyboardModifierMappingSrcKey "HIDKeyboardModifierMappingSrc" +#define kIOHIDKeyboardModifierMappingDstKey "HIDKeyboardModifierMappingDst" + +#define kIOHIDKeyboardCapsLockDoesLockKey "HIDKeyboardCapsLockDoesLock" +#define kIOHIDKeyboardSupportsF12EjectKey "HIDKeyboardSupportsF12Eject" +#define kIOHIDKeyboardSupportedModifiersKey "HIDKeyboardSupportedModifiers" + +#define kIOHIDPointerResolutionKey "HIDPointerResolution" +#define kIOHIDResetPointerKey "HIDResetPointer" +#define kIOHIDPointerConvertAbsoluteKey "HIDPointerConvertAbsolute" +#define kIOHIDPointerContactToMoveKey "HIDPointerContactToMove" +#define kIOHIDPointerPressureToClickKey "HIDPointerPressureToClick" +#define kIOHIDPointerButtonMode "HIDPointerButtonMode" +#define kIOHIDPointerButtonCountKey "HIDPointerButtonCount" + +#define kIOHIDPointerAccelerationKey "HIDPointerAcceleration" +#define kIOHIDPointerAccelerationSettingsKey "HIDPointerAccelerationSettings" +#define kIOHIDPointerAccelerationTypeKey "HIDPointerAccelerationType" +#define kIOHIDPointerAccelerationTableKey "HIDPointerAccelerationTable" + +#define kIOHIDScrollResetKey "HIDScrollReset" +#define kIOHIDScrollResolutionKey "HIDScrollResolution" +#define kIOHIDScrollReportRateKey "HIDScrollReportRate" +#define kIOHIDScrollAccelerationKey "HIDScrollAcceleration" +#define kIOHIDScrollAccelerationTypeKey "HIDScrollAccelerationType" +#define kIOHIDScrollAccelerationTableKey "HIDScrollAccelerationTable" + +#define kIOHIDScrollResolutionXKey "HIDScrollResolutionX" +#define kIOHIDScrollResolutionYKey "HIDScrollResolutionY" +#define kIOHIDScrollResolutionZKey "HIDScrollResolutionZ" + +#define kIOHIDScrollAccelerationTableXKey "HIDScrollAccelerationTableX" +#define kIOHIDScrollAccelerationTableYKey "HIDScrollAccelerationTableY" +#define kIOHIDScrollAccelerationTableZKey "HIDScrollAccelerationTableZ" + +#define kIOHIDScrollMouseButtonKey "HIDScrollMouseButton" + +#define kIOHIDScrollZoomModifierMaskKey "HIDScrollZoomModifierMask" + +#define kIOHIDTrackpadScrollAccelerationKey "HIDTrackpadScrollAcceleration" +#define kIOHIDMouseScrollAccelerationKey "HIDMouseScrollAcceleration" + +#define kIOHIDTrackpadAccelerationType "HIDTrackpadAcceleration" +#define kIOHIDMouseAccelerationType "HIDMouseAcceleration" + +#define kIOHIDClickTimeKey "HIDClickTime" +#define kIOHIDClickSpaceKey "HIDClickSpace" + +#define kIOHIDWaitCursorFrameIntervalKey "HIDWaitCursorFrameInterval" + +#define kIOHIDAutoDimThresholdKey "HIDAutoDimThreshold" +#define kIOHIDAutoDimStateKey "HIDAutoDimState" +#define kIOHIDAutoDimTimeKey "HIDAutoDimTime" +#define kIOHIDIdleTimeKey "HIDIdleTime" + +#define kIOHIDBrightnessKey "HIDBrightness" +#define kIOHIDAutoDimBrightnessKey "HIDAutoDimBrightness" + +#define kIOHIDFKeyModeKey "HIDFKeyMode" + +// if kIOHIDStickyKeysDisabledKey is 1, then all sticky keys functionality +// is completely turned off. Multiple shifts will have no effect. +#define kIOHIDStickyKeysDisabledKey "HIDStickyKeysDisabled" + +// if kIOHIDStickyKeysOnKey is 1 then a depressed modifier will stay down +// until a non-modifer key is pressed (or sticky keys is turned off) +#define kIOHIDStickyKeysOnKey "HIDStickyKeysOn" + +// if kIOHIDStickyKeysShiftTogglesKey is 1, then a sequence of five +// shift keys in sequence will toggle sticky keys on or off +#define kIOHIDStickyKeysShiftTogglesKey "HIDStickyKeysShiftToggles" + +// if kIOHIDMouseKeysOptionTogglesKey is 1, then a sequence of five +// option keys in sequence will toggle mouse keys on or off +#define kIOHIDMouseKeysOptionTogglesKey "HIDMouseKeysOptionToggles" + +// kIOHIDSlowKeysDelayKey represents the delay used for slow keys. +// if kIOHIDSlowKeysDelayKey is 0, then slow keys off +#define kIOHIDSlowKeysDelayKey "HIDSlowKeysDelay" + +#define kIOHIDF12EjectDelayKey "HIDF12EjectDelay" + +#define kIOHIDMouseKeysOnKey "HIDMouseKeysOn" + +#define kIOHIDUseKeyswitchKey "HIDUseKeyswitch" + +#define kIOHIDDisallowRemappingOfPrimaryClickKey "HIDDisallowRemappingOfPrimaryClick" +#define kIOHIDMouseKeysEnablesVirtualNumPadKey "HIDMouseKeysEnablesVirtualNumPad" + +#define kIOHIDResetLEDsKey "HIDResetLEDs" + + +#ifdef __ppc__ + // the following are misspelled keys present in the system + // they are being kept around, but will eventually be deprecated + #define kIOHIDSickyKeysDisabledKey kIOHIDStickyKeysDisabledKey + #define kIOHIDSickyKeysOnKey kIOHIDStickyKeysOnKey + #define kIOHIDSickyKeysShiftTogglesKey kIOHIDStickyKeysShiftTogglesKey +#endif + +// the following values are used in kIOHIDPointerButtonMode +typedef enum { + kIOHIDButtonMode_BothLeftClicks = 0, + kIOHIDButtonMode_ReverseLeftRightClicks = 1, + kIOHIDButtonMode_EnableRightClick = 2 +} IOHIDButtonModes; + +#ifdef _undef +#define EVS_PREFIX "Evs_" /* All EVS calls start with this string */ + +/* WaitCursor-related ioctls */ + +#define EVSIOSWT "Evs_SetWaitThreshold" +#define EVSIOSWT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSWS "Evs_SetWaitSustain" +#define EVSIOSWS_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSWFI "Evs_SetWaitFrameInterval" +#define EVSIOSWFI_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCWINFO "Evs_CurrentWaitCursorInfo" +#define EVSIOCWINFO_THRESH 0 +#define EVSIOCWINFO_SUSTAIN (EVSIOCWINFO_THRESH + EVS_PACKED_TIME_SIZE) +#define EVSIOCWINFO_FINTERVAL (EVSIOCWINFO_SUSTAIN + EVS_PACKED_TIME_SIZE) +#define EVSIOCWINFO_SIZE (EVSIOCWINFO_FINTERVAL + EVS_PACKED_TIME_SIZE) +#endif + +#define EVS_PACKED_TIME_SIZE (sizeof(UInt64) / sizeof( unsigned int)) + +/* Device control ioctls. Levels specified may be in the range 0 - 64. */ + +#define EVSIOSB kIOHIDBrightnessKey +#define EVSIOSB_SIZE 1 + +#define EVSIOSADB kIOHIDAutoDimBrightnessKey +#define EVSIOSADB_SIZE 1 + +#ifdef _undef +#define EVSIOSA "Evs_SetAttenuation" +#define EVIOSA_SIZE 1 + +#define EVSIO_DCTLINFO "Evs_DeviceControlInfo" +typedef enum { + EVSIO_DCTLINFO_BRIGHT, + EVSIO_DCTLINFO_ATTEN, + EVSIO_DCTLINFO_AUTODIMBRIGHT +} evsio_DCTLINFOIndices; +#define EVSIO_DCTLINFO_SIZE (EVSIO_DCTLINFO_AUTODIMBRIGHT + 1) +#endif + +/* + * Device status request + */ +#define EVSIOINFO NX_EVS_DEVICE_INFO + + +/* Keyboard-related ioctls - implemented within Event Sources */ + +#define EVSIOSKR kIOHIDKeyRepeatKey +#define EVSIOSKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSIKR kIOHIDInitialKeyRepeatKey +#define EVSIOSIKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIORKBD kIOHIDResetKeyboardKey +#define EVSIORKBD_SIZE 1 + +#define EVSIOCKR_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCKML kIOHIDKeyMappingKey +#define EVSIOCKML_SIZE 1 + +/* The following two tokens are for use with the get/set character routines. */ +#define EVSIOSKM kIOHIDKeyMappingKey +#define EVSIOSKM_SIZE 4096 + +#define EVSIOCKM kIOHIDKeyMappingKey +#define EVSIOCKM_SIZE 4096 + +/* Mouse-related ioctls - implemented within Event Sources */ + +#define EVSIOSMS kIOHIDPointerAccelerationKey +#define EVSIOSMS_SIZE (1) + +#define EVSIOCMS kIOHIDPointerAccelerationKey +#define EVSIOCMS_SIZE (1) + +#ifdef _undef +#define EVSIOSMH "Evs_SetMouseHandedness" +#define EVSIOSMH_SIZE 1 // value from NXMouseButton enum + +#define EVSIOCMH "Evs_CurrentMouseHandedness" +#define EVSIOCMH_SIZE 1 +#endif + +/* Generic pointer device controls, implemented by the Event Driver. */ +#define EVSIOSCT kIOHIDClickTimeKey +#define EVSIOSCT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSCS kIOHIDClickSpaceKey +typedef enum { + EVSIOSCS_X, + EVSIOSCS_Y +} evsioEVSIOSCSIndices; +#define EVSIOSCS_SIZE (EVSIOSCS_Y + 1) + +#define EVSIOSADT kIOHIDAutoDimThresholdKey +#define EVSIOSADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOSADS kIOHIDAutoDimStateKey +#define EVSIOSADS_SIZE 1 + +#define EVSIORMS kIOHIDResetPointerKey +#define EVSIORMS_SIZE 1 + +#define EVSIOCCT kIOHIDClickTimeKey +#define EVSIOCCT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCADT kIOHIDAutoDimThresholdKey +#define EVSIOCADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOGDADT kIOHIDAutoDimTimeKey +#define EVSIOGDADT_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOIDLE kIOHIDIdleTimeKey +#define EVSIOIDLE_SIZE EVS_PACKED_TIME_SIZE + +#define EVSIOCCS kIOHIDClickSpaceKey +typedef enum { + EVSIOCCS_X, + EVSIOCCS_Y +} evsioEVSIOCCSIndices; +#define EVSIOCCS_SIZE (EVSIOCCS_Y + 1) + +#define EVSIOCADS kIOHIDAutoDimStateKey +#define EVSIOCADS_SIZE 1 + +enum { + // Selectors for IOHIDGetModifierLockState and IOHIDSetModifierLockState + kIOHIDCapsLockState = 0x00000001, + kIOHIDNumLockState = 0x00000002, +}; + +#endif /* !_DEV_EVSIO_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIDShared.h b/i386/include/IOKit/hidsystem/IOHIDShared.h new file mode 100644 index 0000000..e7c5e3a --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDShared.h @@ -0,0 +1,341 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + + evio.h + Ioctl calls for the events driver + Leovitch 02Jan88 + + Copyright 1988 NeXT, Inc. + + CAUTION: Developers should stick to the API exported in + to guarantee + binary compatability of their applications in future + releases. + + Modified: + + 09Dec88 Leo Broken out from evsio.h + 24Aug89 Ted ANSI function prototyping. + 19Feb90 Ted Major revision for multiple driver support. + 26Feb90 Ted New evioScreen structure and EVIOST ioctl. + 12Mar90 Ted New ev_unregister_screen function, SCREENTOKEN constant. + 06May90 Ted Added AALastEventSent and AALastEventConsumed to EvVars. + 22May90 Trey More wait cursor vars in EvVars. + 13Jun90 Ted NXCursorData structure. + 18Jun90 Ted Default wait cursor constants. + 26Sep90 Ted Enhanced cursor system to support intelligent drivers. + 26Nov90 Ted Removed NXSaveCursor and NXCursorData structures + 28Nov90 Ted Remove EvVars, rolled into EventGlobals + 28Nov90 Ted Renamed EventGlobals -> EvGlobals, eventGlobals -> evg + 05May92 Mike Reworked for NRW driver architecture. + +******************************************************************************/ + +#ifndef _DEV_EVIO_H +#define _DEV_EVIO_H + +#include + +__BEGIN_DECLS + +#if KERNEL +#include +#else /* !KERNEL */ +#include +#include +#endif /* KERNEL */ + +#include +#include +#include +#include + +/* + * Identify this driver as one that uses the new driverkit and messaging API + */ +#ifndef _NeXT_MACH_EVENT_DRIVER_ +#define _NeXT_MACH_EVENT_DRIVER_ (1) +#endif /* _NeXT_MACH_EVENT_DRIVER_ */ + + +/* Pressure Constants */ +#define MINPRESSURE EV_MINPRESSURE +#define MAXPRESSURE EV_MAXPRESSURE + +#define LLEQSIZE 240 /* Entries in low-level event queue */ + +typedef struct _NXEQElStruct { + int next; /* Slot of lleq for next event */ + ev_lock_data_t sema; /* Is high-level code reading this event now? */ + NXEvent event; /* The event itself */ +} NXEQElement; + + +/****************************************************************************** + SHARED MEMORY OVERVIEW + + PERSPECTIVE + The ev driver and PostScript share at least one page of wired memory. + This memory contains the low-level event queue which ev deposits events + into and PostScript reads events from. Also, this memory contains other + important data such as wait cursor state and some general cursor state. + This memory is critical for speed. That is, we avoid having to make + system calls for common operations. + + SHARED MEMORY REGIONS + There are currently three "regions" or "zones" delineated within this + shared memory. The first zone is the EvOffsets structure. This structure + contains two offsets from the beginning of shared memory. The first offset + is to the second zone, EvGlobals. The second offset is to the third + zone, private shmem for drivers. + + INITIALIZATION OF SHARED MEMORY + When the WindowServer starts up, it finds all screens that will be active. + It then opens the ev driver and calls the EVIOSSCR ioctl repeatedly for + each screen in use. This lets the ev driver set up the evScreen array + and fill in each element. This ioctl also returns to PostScript a running + total shared memory size with which to allocate. PostScript then allocates + a region of memory this size and calls evmmap to "map in" this shared + region. Evmmap initializes and fills in the EvOffsets and EvGlobals. + Next the WindowServer calls each screen in turn to register itself with + the ev driver in the same sequence as presented to EVIOSSCR. Each screen + driver calls ev_register_screen() which among other things allocates a + part of the private shmem (of the third shared memory zone) for the driver. + + DEBUGGING NOTES + You can easily display and set this shared memory from kgdb, but usually + cannot do so from within PostScript. Gdb (or some weird interaction + between gdb and the os) chokes on this shmem. So if you read or write + this area of memory, copy-on-write will occur and you'll get a completely + new page for PostScript. This will render the shared memory scheme + useless and you will have to restart PostScript. It was my understanding + that before, we were able to "read" this area from PS, but not write to + it (the idea behind copy-on-WRITE). However, this seems to be broken + in 2.0. We think this is a kernel bug. +******************************************************************************/ + +typedef volatile struct _evOffsets { + int evGlobalsOffset; /* Offset to EvGlobals structure */ + int evShmemOffset; /* Offset to private shmem regions */ +} EvOffsets; + +/****************************************************************************** + EvGlobals + This structures defines the portion of the events driver data structure + that is exported to the PostScript server. It contains the event queue + which is in memory shared between the driver and the PostScript server. + All the variables necessary to read and process events from the queue are + contained here. +******************************************************************************/ + +#ifndef __ppc__ +typedef volatile struct _evGlobals { + ev_lock_data_t cursorSema; /* set to disable periodic code */ + int eNum; /* Unique id for mouse events */ + int buttons; /* State of the mouse buttons 1==down, 0==up */ + int eventFlags; /* The current value of event.flags */ + int VertRetraceClock; /* The current value of event.time */ + IOGPoint cursorLoc; /* The current location of the cursor */ + int frame; /* current cursor frame */ + IOGBounds workBounds; /* bounding box of all screens */ + IOGBounds mouseRect; /* Rect for mouse-exited events */ + int version; /* for run time checks */ + int structSize; /* for run time checks */ + int lastFrame; + unsigned int reservedA[31]; + + unsigned reserved:27; + unsigned wantPressure:1; /* pressure in current mouseRect? */ + unsigned wantPrecision:1; /* precise coordinates in current mouseRect? */ + unsigned dontWantCoalesce:1;/* coalesce within the current mouseRect? */ + unsigned dontCoalesce:1; /* actual flag which determines coalescing */ + unsigned mouseRectValid:1; /* If nonzero, post a mouse-exited + whenever mouse outside mouseRect. */ + int movedMask; /* This contains an event mask for the + three events MOUSEMOVED, + LMOUSEDRAGGED, and RMOUSEDRAGGED. + It says whether driver should + generate those events. */ + ev_lock_data_t waitCursorSema; /* protects wait cursor fields */ + int AALastEventSent; /* timestamp for wait cursor */ + int AALastEventConsumed; /* timestamp for wait cursor */ + int waitCursorUp; /* Is wait cursor up? */ + char ctxtTimedOut; /* Has wait cursor timer expired? */ + char waitCursorEnabled; /* Play wait cursor game (per ctxt)? */ + char globalWaitCursorEnabled; /* Play wait cursor game (global)? */ + int waitThreshold; /* time before wait cursor appears */ + + int LLEHead; /* The next event to be read */ + int LLETail; /* Where the next event will go */ + int LLELast; /* The last event entered */ + NXEQElement lleq[LLEQSIZE]; /* The event queue itself */ +} EvGlobals; + +#else + +typedef volatile struct _evGlobals { + ev_lock_data_t cursorSema; /* set to disable periodic code */ + int LLEHead; /* The next event to be read */ + int LLETail; /* Where the next event will go */ + int LLELast; /* The last event entered */ + int eNum; /* Unique id for mouse events */ + int buttons; /* State of the mouse buttons 1==down, 0==up */ + int eventFlags; /* The current value of event.flags */ + int VertRetraceClock; /* The current value of event.time */ + IOGPoint cursorLoc; /* The current location of the cursor */ + int frame; /* current cursor frame */ + IOGBounds workBounds; /* bounding box of all screens */ + IOGBounds mouseRect; /* Rect for mouse-exited events */ + int version; /* for run time checks */ + int structSize; /* for run time checks */ + int lastFrame; + unsigned int reservedA[31]; + + unsigned reserved:27; + unsigned wantPressure:1; /* pressure in current mouseRect? */ + unsigned wantPrecision:1; /* precise coordinates in current mouseRect? */ + unsigned dontWantCoalesce:1;/* coalesce within the current mouseRect? */ + unsigned dontCoalesce:1; /* actual flag which determines coalescing */ + unsigned mouseRectValid:1; /* If nonzero, post a mouse-exited + whenever mouse outside mouseRect. */ + int movedMask; /* This contains an event mask for the + three events MOUSEMOVED, + LMOUSEDRAGGED, and RMOUSEDRAGGED. + It says whether driver should + generate those events. */ + int AALastEventSent; /* timestamp for wait cursor */ + int AALastEventConsumed; /* timestamp for wait cursor */ + ev_lock_data_t waitCursorSema; /* protects wait cursor fields */ + int waitCursorUp; /* Is wait cursor up? */ + char ctxtTimedOut; /* Has wait cursor timer expired? */ + char waitCursorEnabled; /* Play wait cursor game (per ctxt)? */ + char globalWaitCursorEnabled; /* Play wait cursor game (global)? */ + int waitThreshold; /* time before wait cursor appears */ + NXEQElement lleq[LLEQSIZE]; /* The event queue itself */ +} EvGlobals; +#endif + +/* These evio structs are used in various calls supported by the ev driver. */ + +struct evioLLEvent { + int setCursor; + int type; + IOGPoint location; + NXEventData data; + int setFlags; + int flags; +}; + +typedef struct evioLLEvent _NXLLEvent; + +#ifdef mach3xxx + +/* + * On a keypress of a VOL UP or VOL DOWN key, we send a message to the + * sound server to notify it of the volume change. The message includes + * a flag to indicate which key was pressed, and the machine independant + * flag bits to indicate which modifier keys were pressed. + */ + +struct evioSpecialKeyMsg +{ + msg_header_t Head; + msg_type_t keyType; + int key; // special key number, from bsd/dev/ev_keymap.h + msg_type_t directionType; + int direction; // NX_KEYDOWN, NX_KEYUP from event.h + msg_type_t flagsType; + int flags; // device independant flags from event.h + msg_type_t levelType; + int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME +}; +#else +struct evioSpecialKeyMsg +{ + mach_msg_header_t Head; + int key; // special key number, from bsd/dev/ev_keymap.h + int direction; // NX_KEYDOWN, NX_KEYUP from event.h + int flags; // device independant flags from event.h + int level; // EV_AUDIO_MIN_VOLUME to EV_AUDIO_MAX_VOLUME +}; +#endif + +#define EV_SPECIAL_KEY_MSG_ID (('S'<<24) | ('k'<<16) | ('e'<<8) | ('y')) +typedef struct evioSpecialKeyMsg *evioSpecialKeyMsg_t; + +/* + * Volume ranges + */ +#define EV_AUDIO_MIN_VOLUME 0 +#define EV_AUDIO_MAX_VOLUME 64 + +#define kIOHIDSystemClass "IOHIDSystem" +#define kIOHIKeyboardClass "IOHIKeyboard" +#define kIOHIPointingClass "IOHIPointing" + +#define IOHIDSYSTEM_CONFORMSTO kIOHIDSystemClass + +enum { + kIOHIDCurrentShmemVersion = 3, + kIOHIDEventNotification = 0, +}; + +enum { + kIOHIDServerConnectType = 0, + kIOHIDParamConnectType = 1, + kIOHIDEventSystemConnectType = 3, +}; + +enum { + kIOHIDGlobalMemory = 0 +}; + +enum { + kIOHIDEventQueueTypeKernel = 0, + kIOHIDEventQueueTypeUser = 1 +}; + +#ifdef KERNEL +typedef UInt16 (*MasterVolumeUpdate)(void); +typedef bool (*MasterMuteUpdate)(void); + +typedef struct { + MasterVolumeUpdate incrementMasterVolume; + MasterVolumeUpdate decrementMasterVolume; + MasterMuteUpdate toggleMasterMute; +} MasterAudioFunctions; + +extern MasterAudioFunctions *masterAudioFunctions; +#endif + +#ifndef KERNEL +#ifndef _IOKIT_IOHIDLIB_H +#include +#endif +#endif /* !KERNEL */ + +__END_DECLS + + +#endif /* !_DEV_EVIO_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIDSystem.h b/i386/include/IOKit/hidsystem/IOHIDSystem.h new file mode 100644 index 0000000..1a78a38 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDSystem.h @@ -0,0 +1,785 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * EventDriver.h - Exported Interface Event Driver object. + * + * The EventDriver is a pseudo-device driver. + * + * HISTORY + * 19 Mar 1992 Mike Paquette at NeXT + * Created. + * 4 Aug 1993 Erik Kay at NeXT + * API cleanup + */ + +#ifndef _IOHIDSYSTEM_H +#define _IOHIDSYSTEM_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if TARGET_OS_EMBEDDED +class IOGraphicsDevice; +#else +#include +#endif +#include +#include +#include +#include +#include +#include /* For NX_NUM_SCANNED_SPECIALKEYS */ + + +// The following messages should be unique across the entire system +#ifndef sub_iokit_hidsystem +#define sub_iokit_hidsystem err_sub(14) +#endif + +#define kIOHIDSystem508MouseClickMessage iokit_family_msg(sub_iokit_hidsystem, 1) +#define kIOHIDSystemDeviceSeizeRequestMessage iokit_family_msg(sub_iokit_hidsystem, 2) +#define kIOHIDSystem508SpecialKeyDownMessage iokit_family_msg(sub_iokit_hidsystem, 3) + +class IOHIDKeyboardDevice; +class IOHIDPointingDevice; +class IOHIDEvent; + +class IOHIDSystem : public IOService +{ + OSDeclareDefaultStructors(IOHIDSystem); + + friend class IOHIDUserClient; + friend class IOHIDParamUserClient; + friend class IOHIDEventSystemUserClient; + +private: + IOWorkLoop * workLoop; + IOTimerEventSource * timerES; + IOTimerEventSource * vblES; + IOInterruptEventSource * eventConsumerES; + IOInterruptEventSource * keyboardEQES; + IOCommandGate * cmdGate; + IOUserClient * serverConnect; + IOUserClient * paramConnect; + IONotifier * eventPublishNotify; + IONotifier * eventTerminateNotify; + IONotifier * publishNotify; + IONotifier * terminateNotify; + + OSArray * ioHIDevices; + OSSet * touchEventPosters; + + // Ports on which we hold send rights + mach_port_t eventPort; // Send msg here when event queue + // goes non-empty + mach_port_t stackShotPort; + mach_port_t _specialKeyPort[NX_NUM_SCANNED_SPECIALKEYS]; // Special key msgs + void *eventMsg; // Msg to be sent to Window Server. + void *stackShotMsg; // Msg to be sent to Stack Shot. + + // Shared memory area information + IOBufferMemoryDescriptor * globalMemory; + uintptr_t shmem_addr; // kernel address of shared memory + vm_size_t shmem_size; // size of shared memory + + // Pointers to structures which occupy the shared memory area. + volatile void *evs; // Pointer to private driver shmem + volatile EvGlobals *evg; // Pointer to EvGlobals (shmem) + // Internal variables related to the shared memory area + int lleqSize; // # of entries in low-level queue + // FIXME: why is this ivar lleqSize an ivar? {Dan] + + // Screens list + vm_size_t evScreenSize; // Byte size of evScreen array + void *evScreen; // array of screens known to driver + volatile void *lastShmemPtr; // Pointer used to index thru shmem + // while assigning shared areas to + // drivers. + int screens; // running total of allocated screens + UInt32 cursorScreens; // bit mask of screens with cursor present + UInt32 cursorPinScreen;// a screen to pin against + IOGBounds cursorPin; // Range to which cursor is pinned + // while on this screen. + IOGBounds workSpace; // IOGBounds of full workspace. + // Event Status state - This includes things like event timestamps, + // time til screen dim, and related things manipulated through the + // Event Status API. + // + IOGPoint pointerLoc; // Current pointing device location + // The value leads evg->cursorLoc. + IOGPoint pointerDelta; // The cumulative pointer delta values since + // previous mouse move event was posted + + IOGPoint clickLoc; // location of last mouse click + IOGPoint clickSpaceThresh; // max mouse delta to be a doubleclick + int clickState; // Current click state + + bool evOpenCalled; // Has the driver been opened? + bool evInitialized; // Has the first-open-only initialization run? + bool evStateChanging; // Is the event system state changing. + bool eventsOpen; // Boolean: has evmmap been called yet? + bool cursorStarted; // periodic events running? + bool cursorEnabled; // cursor positioning ok? + bool cursorCoupled; // cursor positioning on pointer moves ok? + bool cursorPinned; // cursor positioning on pointer moves ok? + + short leftENum; // Unique ID for last left down event + short rightENum; // Unique ID for last right down event + + // The periodic event mechanism timestamps and state + // are recorded here. + AbsoluteTime thisPeriodicRun; + AbsoluteTime periodicEventDelta;// Time between periodic events + // todo: make infinite + AbsoluteTime clickTime; // Timestamps used to determine doubleclicks + AbsoluteTime clickTimeThresh; + + AbsoluteTime waitSustain; // Sustain time before removing cursor + AbsoluteTime waitSusTime; // Sustain counter + AbsoluteTime waitFrameRate; // Ticks per wait cursor frame + AbsoluteTime waitFrameTime; // Wait cursor frame timer + + AbsoluteTime lastRelativeEventTime; // Used to post mouse events once per frame + AbsoluteTime lastRelativeMoveTime; + AbsoluteTime lastEventTime; + AbsoluteTime lastUndimEvent; + SInt32 postDeltaX, accumDX; + SInt32 postDeltaY, accumDY; + + // Flags used in scheduling periodic event callbacks + bool needSetCursorPosition; + bool needToKickEventConsumer; + + IOService * displayManager; // points to display manager + IOPMPowerFlags displayState; + + IOService * rootDomain; + AbsoluteTime stateChangeDeadline; + + OSDictionary * savedParameters; // keep user settings + + const char * registryName; // cache our name + UInt32 maxWaitCursorFrame; // animation frames + UInt32 firstWaitCursorFrame; // + + int cachedEventFlags; + OSArray * cachedButtonStates; + + OSArray * systemInfo; + + IOHIDPointingDevice * _hidPointingDevice; + IOHIDKeyboardDevice * _hidKeyboardDevice; + + unsigned consumedKeyCode; + + OSObject * lastSender; + + UInt32 scrollZoomMask; + + bool setParamPropertiesInProgress; + + OSSet * dataQueueSet; + +private: + void vblEvent(void); + UInt8 getSubtypeForSender(OSObject * sender); + void updateMouseEventForSender(OSObject * sender, NXEventData * evData); + void updateMouseMoveEventForSender(OSObject * sender, NXEventData * evData); + void updateScrollEventForSender(OSObject * sender, NXEventData * evData); + static void _vblEvent(OSObject *self, IOTimerEventSource *sender); + + inline short getUniqueEventNum(); + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags, unsigned long, IOService * ); + /* Resets */ + void _resetMouseParameters(); + + /* Initialize the shared memory area */ + void initShmem(bool clean); + /* Dispatch low level events through shared memory to the WindowServer */ + void postEvent(int what, + /* at */ IOGPoint * location, + /* atTime */ AbsoluteTime ts, + /* withData */ NXEventData * myData, + /* sender */ OSObject * sender = 0, + /* pid */ UInt32 extPID = 0, + /* processKEQ*/bool processKEQ = true); + /* Dispatch mechanisms for screen state changes */ + void evDispatch( + /* command */ EvCmd evcmd); + /* Dispatch mechanism for special key press */ + void evSpecialKeyMsg(unsigned key, + /* direction */ unsigned dir, + /* flags */ unsigned f, + /* level */ unsigned l); + /* Message the event consumer to process posted events */ + void kickEventConsumer(); + void sendStackShotMessage(); + + OSDictionary * createFilteredParamPropertiesForService(IOService * service, OSDictionary * dict); + + static void _periodicEvents(IOHIDSystem * self, + IOTimerEventSource *timer); + + static void doSpecialKeyMsg(IOHIDSystem * self, + struct evioSpecialKeyMsg *msg); + static void doKickEventConsumer(IOHIDSystem * self); + + static void doProcessKeyboardEQ(IOHIDSystem * self); + static void processKeyboardEQ(IOHIDSystem * self, AbsoluteTime * deadline = 0); + + static bool genericNotificationHandler( void * target, + void * ref, IOService * newService ); + + static bool handlePublishNotification( void * target, IOService * newService ); + + static bool handleTerminateNotification( void * target, IOService * service ); + + static void makeNumberParamProperty( OSDictionary * dict, const char * key, + unsigned long long number, unsigned int bits ); + + static void makeInt32ArrayParamProperty( OSDictionary * dict, const char * key, + UInt32 * array, unsigned int count ); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIDSystem(Input) category; + * the declarations have now been merged directly into this class. + * + * Exported Interface Event Driver object input services. + */ + +private: + // Schedule next periodic run based on current event system state. + void scheduleNextPeriodicEvent(); + // Message invoked to run periodic events. This method runs in the workloop. + void periodicEvents(IOTimerEventSource *timer); + // Start the cursor running. + bool startCursor(); + // Repin cursor location. + bool resetCursor(); + // Wait Cursor machinery. + void showWaitCursor(); + void hideWaitCursor(); + void animateWaitCursor(); + void changeCursor(int frame); + // Return screen number a point lies on. + int pointToScreen(IOGPoint * p); + + inline void showCursor(); + inline void hideCursor(); + inline void moveCursor(); + // Claim ownership of event sources. + void attachDefaultEventSources(); + // Give up ownership of event sources. + void detachEventSources(); + bool registerEventSource(IOService * source); + + // Set abs cursor position. + void setCursorPosition(IOGPoint * newLoc, bool external, OSObject * sender=0); + void _setButtonState(int buttons, + /* atTime */ AbsoluteTime ts, + OSObject * sender); + void _setCursorPosition(IOGPoint * newLoc, bool external, bool proximityChange = false, OSObject * sender=0); + + static bool _idleTimeSerializerCallback(void * target, void * ref, OSSerialize *s); + + void _postMouseMoveEvent(int what, + IOGPoint * location, + AbsoluteTime theClock, + OSObject * sender); + void createParameters( void ); + +/* END HISTORICAL NOTE */ + +public: + static IOHIDSystem * instance(); /* Return the current instance of the */ + /* EventDriver, or 0 if none. */ + static void scaleLocationToCurrentScreen(IOGPoint *location, IOGBounds *bounds); + + virtual bool init(OSDictionary * properties = 0); + virtual IOHIDSystem * probe(IOService * provider, + SInt32 * score); + virtual bool start(IOService * provider); + virtual IOReturn message(UInt32 type, IOService * provider, + void * argument); + virtual void free(); + virtual bool attach( IOService * provider ); + virtual void detach( IOService * provider ); + + virtual IOWorkLoop *getWorkLoop() const; + + virtual IOReturn evOpen(void); + virtual IOReturn evClose(void); + + virtual IOReturn setProperties( OSObject * properties ); + virtual IOReturn setParamProperties(OSDictionary * dict); + + /* Create the shared memory area */ + virtual IOReturn createShmem(void*,void*,void*,void*,void*,void*); + + /* register the IODataQueue for the new user events */ + virtual IOReturn registerEventQueue(IODataQueue * queue); + + /* Unregister the IODataQueue for the new user events */ + virtual IOReturn unregisterEventQueue(IODataQueue * queue); + + /* Set the port for event available notify msg */ + virtual void setEventPort(mach_port_t port); + /* Set the port for the special key keypress msg */ + virtual IOReturn setSpecialKeyPort( + /* keyFlavor */ int special_key, + /* keyPort */ mach_port_t key_port); + virtual mach_port_t specialKeyPort(int special_key); + + + virtual IOReturn newUserClient(task_t owningTask, + /* withToken */ void * security_id, + /* ofType */ UInt32 type, + /* withProps*/ OSDictionary * properties, + /* client */ IOUserClient ** handler); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIPointingEvents protocol; + * the declarations have now been merged directly into this class. + */ + +public: + /* Mouse event reporting */ + virtual void relativePointerEvent(int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + + /* Tablet event reporting */ + virtual void absolutePointerEvent(int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + + /* Mouse scroll wheel event reporting */ + virtual void scrollWheelEvent(short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + + + virtual void tabletEvent(NXEventData *tabletData, + AbsoluteTime ts); + + virtual void proximityEvent(NXEventData *proximityData, + AbsoluteTime ts); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOHIKeyboardEvents protocol; + * the declarations have now been merged directly into this class. + */ + +public: + virtual void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + virtual void keyboardSpecialEvent( unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + virtual void updateEventFlags(unsigned flags); /* Does not generate events */ + + + + +private: + + /* + * statics for upstream callouts + */ + + void _scaleLocationToCurrentScreen(IOGPoint *location, IOGPoint *fraction, IOGBounds *bounds); // Should this one be public??? + + static void _relativePointerEvent(IOHIDSystem * self, + int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + /* Tablet event reporting */ + static void _absolutePointerEvent(IOHIDSystem * self, + int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + /* Mouse scroll wheel event reporting */ + static void _scrollWheelEvent( IOHIDSystem *self, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + IOFixed fixedDelta1, + IOFixed fixedDelta2, + IOFixed fixedDelta3, + SInt32 pointDeltaAxis1, + SInt32 pointDeltaAxis2, + SInt32 pointDeltaAxis3, + UInt32 options, + AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _tabletEvent( IOHIDSystem *self, + NXEventData *tabletData, + AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _proximityEvent( IOHIDSystem *self, + NXEventData *proximityData, + AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _keyboardEvent( IOHIDSystem * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _keyboardSpecialEvent(IOHIDSystem * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + OSObject * sender, + void * refcon); + + static void _updateEventFlags( IOHIDSystem * self, + unsigned flags, + OSObject * sender, + void * refcon); /* Does not generate events */ + + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOUserClient protocol; + * the declarations have now been merged directly into this class. + */ + +public: + + virtual IOReturn setEventsEnable(void*,void*,void*,void*,void*,void*); + virtual IOReturn setCursorEnable(void*,void*,void*,void*,void*,void*); + virtual IOReturn extPostEvent(void*,void*,void*,void*,void*,void*); + virtual IOReturn extSetMouseLocation(void*,void*,void*,void*,void*,void*); + virtual IOReturn extGetButtonEventNum(void*,void*,void*,void*,void*,void*); + IOReturn extSetBounds( IOGBounds * bounds ); + IOReturn extGetModifierLockState(void*,void*,void*,void*,void*,void*); + IOReturn extSetModifierLockState(void*,void*,void*,void*,void*,void*); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOScreenRegistration protocol; + * the declarations have now been merged directly into this class. + * + * Methods exported by the EventDriver for display systems. + * + * The screenRegister protocol is used by frame buffer drivers to register + * themselves with the Event Driver. These methods are called in response + * to an _IOGetParameterInIntArray() call with "IO_Framebuffer_Register" or + * "IO_Framebuffer_Unregister". + */ + +public: + virtual int registerScreen(IOGraphicsDevice * instance, + /* bounds */ IOGBounds * bp); +// /* shmem */ void ** addr, +// /* size */ int * size) + virtual void unregisterScreen(int index); + +/* + * HISTORICAL NOTE: + * The following methods were part of the IOWorkspaceBounds protocol; + * the declarations have now been merged directly into this class. + * + * Absolute position input devices and some specialized output devices + * may need to know the bounding rectangle for all attached displays. + * The following method returns a IOGBounds* for the workspace. Please note + * that the bounds are kept as signed values, and that on a multi-display + * system the minx and miny values may very well be negative. + */ + +public: + virtual IOGBounds * workspaceBounds(); + +/* END HISTORICAL NOTES */ + +private: +void relativePointerEvent( int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + /* senderID */ OSObject * sender); + + /* Tablet event reporting */ +void absolutePointerEvent( int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + /* senderID */ OSObject * sender); + + /* Mouse scroll wheel event reporting */ +void scrollWheelEvent( short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + IOFixed fixedDelta1, + IOFixed fixedDelta2, + IOFixed fixedDelta3, + SInt32 pointDeltaAxis1, + SInt32 pointDeltaAxis2, + SInt32 pointDeltaAxis3, + UInt32 options, + AbsoluteTime ts, + OSObject * sender); + +void tabletEvent( NXEventData * tabletData, + AbsoluteTime ts, + OSObject * sender); + +void proximityEvent( NXEventData * proximityData, + AbsoluteTime ts, + OSObject * sender); + +void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender); + +void keyboardSpecialEvent( unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender); + +void updateEventFlags(unsigned flags, OSObject * sender); + +/* + * COMMAND GATE COMPATIBILITY: + * The following method is part of the work needed to make IOHIDSystem + * compatible with IOCommandGate. The use of IOCommandQueue has been + * deprecated, thus requiring this move. This should allow for less + * context switching as all actions formerly run on the I/O Workloop + * thread, will now be run on the caller thread. The static methods + * will be called from cmdGate->runAction and returns the appropriate + * non-static helper method. Arguments are stored in the void* array, + * args, and are passed through. Since we are returning in the static + * function, gcc3 should translate that to one instruction, thus + * minimizing cost. + */ + +static IOReturn doEvClose (IOHIDSystem *self); + IOReturn evCloseGated (void); + +static IOReturn doSetEventsEnablePre (IOHIDSystem *self, void *p1); + IOReturn setEventsEnablePreGated (void *p1); + +static IOReturn doSetEventsEnablePost (IOHIDSystem *self, void *p1); + IOReturn setEventsEnablePostGated (void *p1); + +static IOReturn doUnregisterScreen (IOHIDSystem *self, void * arg0); + void unregisterScreenGated (int index); + +static IOReturn doCreateShmem (IOHIDSystem *self, void * arg0); + IOReturn createShmemGated (void * p1); + +static IOReturn doRegisterEventQueue (IOHIDSystem *self, void * arg0); + IOReturn registerEventQueueGated (void * p1); + +static IOReturn doUnregisterEventQueue (IOHIDSystem *self, void * arg0); + IOReturn unregisterEventQueueGated (void * p1); + +static IOReturn doRelativePointerEvent (IOHIDSystem *self, void * args); + void relativePointerEventGated(int buttons, + int dx, + int dy, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doAbsolutePointerEvent (IOHIDSystem *self, void * args); + void absolutePointerEventGated (int buttons, + IOGPoint * newLoc, + IOGBounds *bounds, + bool proximity, + int pressure, + int stylusAngle, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doScrollWheelEvent(IOHIDSystem *self, void * args); + void scrollWheelEventGated (short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + IOFixed fixedDelta1, + IOFixed fixedDelta2, + IOFixed fixedDelta3, + SInt32 pointDeltaAxis1, + SInt32 pointDeltaAxis2, + SInt32 pointDeltaAxis3, + UInt32 options, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doTabletEvent (IOHIDSystem *self, void * arg0, void * arg1, void * arg2); + void tabletEventGated ( NXEventData *tabletData, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doProximityEvent (IOHIDSystem *self, void * arg0, void * arg1, void * arg2); + void proximityEventGated ( NXEventData *proximityData, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doKeyboardEvent (IOHIDSystem *self, void * args); + void keyboardEventGated (unsigned eventType, + unsigned flags, + unsigned key, + unsigned charCode, + unsigned charSet, + unsigned origCharCode, + unsigned origCharSet, + unsigned keyboardType, + bool repeat, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doKeyboardSpecialEvent (IOHIDSystem *self, void * args); + void keyboardSpecialEventGated ( + unsigned eventType, + unsigned flags, + unsigned key, + unsigned flavor, + UInt64 guid, + bool repeat, + AbsoluteTime ts, + OSObject * sender); + +static IOReturn doUpdateEventFlags (IOHIDSystem *self, void * args); + void updateEventFlagsGated (unsigned flags, OSObject * sender); + +static IOReturn doNewUserClient (IOHIDSystem *self, void * args); + IOReturn newUserClientGated (task_t owningTask, + void * security_id, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler); + +static IOReturn doSetCursorEnable (IOHIDSystem *self, void * arg0); + IOReturn setCursorEnableGated (void * p1); + +static IOReturn doExtPostEvent(IOHIDSystem *self, void * arg0, void * arg1, void * arg2, void * arg3); + IOReturn extPostEventGated (void * p1, void * p2, void * p3); + +static IOReturn doExtSetMouseLocation (IOHIDSystem *self, void * args); + IOReturn extSetMouseLocationGated (void * args); + +static IOReturn doExtGetButtonEventNum (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn extGetButtonEventNumGated (void * p1, void * p2); + +static IOReturn doSetParamPropertiesPre (IOHIDSystem *self, void * arg0, void * arg1); + IOReturn setParamPropertiesPreGated (OSDictionary * dict, OSIterator ** pOpenIter); + +static IOReturn doSetParamPropertiesPost (IOHIDSystem *self, void * arg0); + IOReturn setParamPropertiesPostGated (OSDictionary * dict); + +static IOReturn doExtGetToggleState (IOHIDSystem *self, void *p1, void *p2); +static IOReturn doExtSetToggleState (IOHIDSystem *self, void *p1, void *p2); + IOReturn getCapsLockState(unsigned int *state_O); + IOReturn setCapsLockState(unsigned int state_I); + IOReturn getNumLockState(unsigned int *state_O); + IOReturn setNumLockState(unsigned int state_I); + +/* END COMMAND GATE COMPATIBILITY */ + +public: + virtual void setStackShotPort(mach_port_t port); + + virtual UInt32 eventFlags(); + + virtual void dispatchEvent(IOHIDEvent *event, IOOptionBits options=0); + +}; + +#endif /* !_IOHIDSYSTEM_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIDTypes.h b/i386/include/IOKit/hidsystem/IOHIDTypes.h new file mode 100644 index 0000000..786af07 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDTypes.h @@ -0,0 +1,171 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + ev_types.h + Data types for the events status driver. + This file contains public API. + mpaque 11Oct91 + + Copyright 1991 NeXT Computer, Inc. + + Modified: + +******************************************************************************/ + +#ifndef _DEV_EV_TYPES_H +#define _DEV_EV_TYPES_H + +#include +#include +#include + +/* Shared memory versions */ +#define EVENT_SYSTEM_VERSION 2 + +/* Maximum length of SetMouseScaling arrays */ +#define NX_MAXMOUSESCALINGS 20 + +typedef struct evsioKeymapping /* Match old struct names in kernel */ +{ + int size; + char *mapping; +} NXKeyMapping; + +typedef struct evsioMouseScaling /* Match old struct names in kernel */ +{ + int numScaleLevels; + short scaleThresholds[NX_MAXMOUSESCALINGS]; + short scaleFactors[NX_MAXMOUSESCALINGS]; +} NXMouseScaling; + +typedef enum { + NX_OneButton, + NX_LeftButton, + NX_RightButton +} NXMouseButton; + +/* + * NXEventSystemInfo() information structures. These are designed to + * allow for expansion. + * + * The current implementation of NXEventSystemInfo() uses an ioctl call. + * THIS WILL CHANGE. + */ + +/* + * Generic query max size and typedefs. + * + * The maximum size is selected to support anticipated future extensions + * of request flavors. Certain flavors planned for future releases may + * require roughtly 800 ints to represent. We allow a little extra, in + * case further growth is needed. + */ +typedef int *NXEventSystemInfoType; +#define NX_EVS_INFO_MAX (1024) /* Max array size */ +typedef int NXEventSystemInfoData[NX_EVS_INFO_MAX]; + +/* Event System Devices query */ +#define NX_EVS_DEVICE_MAX 16 + + /* Interface types */ +#define NX_EVS_DEVICE_INTERFACE_OTHER 0 +#define NX_EVS_DEVICE_INTERFACE_NeXT 1 // NeXT custom, in older sys +#define NX_EVS_DEVICE_INTERFACE_ADB 2 // NeXT/fruit keybds/mice +#define NX_EVS_DEVICE_INTERFACE_ACE 3 // For x86 PC keyboards +#define NX_EVS_DEVICE_INTERFACE_SERIAL_ACE 4 // For PC serial mice +#define NX_EVS_DEVICE_INTERFACE_BUS_ACE 5 // For PC bus mice +#define NX_EVS_DEVICE_INTERFACE_HIL 6 // For HIL hp keyboard +#define NX_EVS_DEVICE_INTERFACE_TYPE5 7 // For Sun Type5 keyboard + +/* + * Note! if any new interface types are added above, the following + * definition of the number of interfaces supported must reflect this. + * This is used in the libkeymap project (storemap.c module) which needs + * to be cognizant of the number of new devices coming online + * via support for heterogeneous architecture platforms. + * e.g., PCs, HP's HIL, Sun's Type5 keyboard,... + */ +#define NUM_SUPPORTED_INTERFACES (NX_EVS_DEVICE_INTERFACE_TYPE5 + 1) + // Other, NeXT, ADB, ACE,... + + /* Device types */ +#define NX_EVS_DEVICE_TYPE_OTHER 0 +#define NX_EVS_DEVICE_TYPE_KEYBOARD 1 +#define NX_EVS_DEVICE_TYPE_MOUSE 2 // Relative position devices +#define NX_EVS_DEVICE_TYPE_TABLET 3 // Absolute position devices + +typedef struct { + int interface; /* NeXT, ADB, other */ + int interface_addr; /* Device address on the interface */ + int dev_type; /* Keyboard, mouse, tablet, other */ + int id; /* manufacturer's device handler ID */ +} NXEventSystemDevice; + +typedef struct { + NXEventSystemDevice dev[NX_EVS_DEVICE_MAX]; +} NXEventSystemDeviceList; + +#define __OLD_NX_EVS_DEVICE_INFO 1 +#define NX_EVS_DEVICE_INFO "Evs_EventDeviceInfo" +#define NX_EVS_DEVICE_INFO_COUNT \ + (sizeof (NXEventSystemDeviceList) / sizeof (int)) + +/* + * Types used in evScreen protocol compliant operations. + */ + +typedef enum {EVNOP, EVHIDE, EVSHOW, EVMOVE, EVLEVEL} EvCmd; /* Cursor state */ + +#define EV_SCREEN_MIN_BRIGHTNESS 0 +#define EV_SCREEN_MAX_BRIGHTNESS 64 +/* Scale should lie between MIN_BRIGHTNESS and MAX_BRIGHTNESS */ +#define EV_SCALE_BRIGHTNESS( scale, datum ) \ + ((((UInt32)(datum))*((UInt32)scale)) >> 6) + +/* + * Definition of a tick, as a time in milliseconds. This controls how + * often the event system periodic jobs are run. All actual tick times + * are derived from the nanosecond timer. These values are typically used + * as part of computing mouse velocity for acceleration purposes. + */ +#define EV_TICK_TIME 16 /* 16 milliseconds */ +#define EV_TICKS_PER_SEC (1000/EV_TICK_TIME) /* ~ 62 Hz */ + +/* Mouse Button bits, as passed from an EventSrc to the Event Driver */ +#define EV_RB (0x01) +#define EV_LB (0x04) +#define EV_MOUSEBUTTONMASK (EV_LB | EV_RB) + +/* Tablet Pressure Constants, as passed from an EventSrc to the Event Driver */ +#define EV_MINPRESSURE 0 +#define EV_MAXPRESSURE 255 + +/* Cursor size in pixels */ +#define EV_CURSOR_WIDTH 16 +#define EV_CURSOR_HEIGHT 16 + + +#define kAppleOnboardGUID 0x0610000000000000ULL + +#endif /* !_DEV_EV_TYPES_H */ + diff --git a/i386/include/IOKit/hidsystem/IOHIDUsageTables.h b/i386/include/IOKit/hidsystem/IOHIDUsageTables.h new file mode 100644 index 0000000..ff0fd88 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDUsageTables.h @@ -0,0 +1,1665 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIDUSAGETABLES_H +#define _IOHIDUSAGETABLES_H + +/* ****************************************************************************************** + * HID Usage Tables + * + * The following constants are from the USB 'HID Usage Tables' specification, revision 1.1rc3 + * ****************************************************************************************** */ + + +/* Usage Pages */ +enum +{ + kHIDPage_Undefined = 0x00, + kHIDPage_GenericDesktop = 0x01, + kHIDPage_Simulation = 0x02, + kHIDPage_VR = 0x03, + kHIDPage_Sport = 0x04, + kHIDPage_Game = 0x05, + /* Reserved 0x06 */ + kHIDPage_KeyboardOrKeypad = 0x07, /* USB Device Class Definition for Human Interface Devices (HID). Note: the usage type for all key codes is Selector (Sel). */ + kHIDPage_LEDs = 0x08, + kHIDPage_Button = 0x09, + kHIDPage_Ordinal = 0x0A, + kHIDPage_Telephony = 0x0B, + kHIDPage_Consumer = 0x0C, + kHIDPage_Digitizer = 0x0D, + /* Reserved 0x0E */ + kHIDPage_PID = 0x0F, /* USB Physical Interface Device definitions for force feedback and related devices. */ + kHIDPage_Unicode = 0x10, + /* Reserved 0x11 - 0x13 */ + kHIDPage_AlphanumericDisplay = 0x14, + /* Reserved 0x15 - 0x7F */ + /* Monitor 0x80 - 0x83 USB Device Class Definition for Monitor Devices */ + /* Power 0x84 - 0x87 USB Device Class Definition for Power Devices */ + kHIDPage_PowerDevice = 0x84, /* Power Device Page */ + kHIDPage_BatterySystem = 0x85, /* Battery System Page */ + /* Reserved 0x88 - 0x8B */ + kHIDPage_BarCodeScanner = 0x8C, /* (Point of Sale) USB Device Class Definition for Bar Code Scanner Devices */ + kHIDPage_WeighingDevice = 0x8D, /* (Point of Sale) USB Device Class Definition for Weighing Devices */ + kHIDPage_Scale = 0x8D, /* (Point of Sale) USB Device Class Definition for Scale Devices */ + kHIDPage_MagneticStripeReader = 0x8E, + /* ReservedPointofSalepages 0x8F */ + kHIDPage_CameraControl = 0x90, /* USB Device Class Definition for Image Class Devices */ + kHIDPage_Arcade = 0x91, /* OAAF Definitions for arcade and coinop related Devices */ + /* Reserved 0x92 - 0xFEFF */ + /* VendorDefined 0xFF00 - 0xFFFF */ + kHIDPage_VendorDefinedStart = 0xFF00 +}; + +/* Undefined Usage for all usage pages */ +enum +{ + kHIDUsage_Undefined = 0x00 +}; + +/* GenericDesktop Page (0x01) */ +enum +{ + kHIDUsage_GD_Pointer = 0x01, /* Physical Collection */ + kHIDUsage_GD_Mouse = 0x02, /* Application Collection */ + /* 0x03 Reserved */ + kHIDUsage_GD_Joystick = 0x04, /* Application Collection */ + kHIDUsage_GD_GamePad = 0x05, /* Application Collection */ + kHIDUsage_GD_Keyboard = 0x06, /* Application Collection */ + kHIDUsage_GD_Keypad = 0x07, /* Application Collection */ + kHIDUsage_GD_MultiAxisController = 0x08, /* Application Collection */ + /* 0x09 - 0x2F Reserved */ + kHIDUsage_GD_X = 0x30, /* Dynamic Value */ + kHIDUsage_GD_Y = 0x31, /* Dynamic Value */ + kHIDUsage_GD_Z = 0x32, /* Dynamic Value */ + kHIDUsage_GD_Rx = 0x33, /* Dynamic Value */ + kHIDUsage_GD_Ry = 0x34, /* Dynamic Value */ + kHIDUsage_GD_Rz = 0x35, /* Dynamic Value */ + kHIDUsage_GD_Slider = 0x36, /* Dynamic Value */ + kHIDUsage_GD_Dial = 0x37, /* Dynamic Value */ + kHIDUsage_GD_Wheel = 0x38, /* Dynamic Value */ + kHIDUsage_GD_Hatswitch = 0x39, /* Dynamic Value */ + kHIDUsage_GD_CountedBuffer = 0x3A, /* Logical Collection */ + kHIDUsage_GD_ByteCount = 0x3B, /* Dynamic Value */ + kHIDUsage_GD_MotionWakeup = 0x3C, /* One-Shot Control */ + kHIDUsage_GD_Start = 0x3D, /* On/Off Control */ + kHIDUsage_GD_Select = 0x3E, /* On/Off Control */ + /* 0x3F Reserved */ + kHIDUsage_GD_Vx = 0x40, /* Dynamic Value */ + kHIDUsage_GD_Vy = 0x41, /* Dynamic Value */ + kHIDUsage_GD_Vz = 0x42, /* Dynamic Value */ + kHIDUsage_GD_Vbrx = 0x43, /* Dynamic Value */ + kHIDUsage_GD_Vbry = 0x44, /* Dynamic Value */ + kHIDUsage_GD_Vbrz = 0x45, /* Dynamic Value */ + kHIDUsage_GD_Vno = 0x46, /* Dynamic Value */ + /* 0x47 - 0x7F Reserved */ + kHIDUsage_GD_SystemControl = 0x80, /* Application Collection */ + kHIDUsage_GD_SystemPowerDown = 0x81, /* One-Shot Control */ + kHIDUsage_GD_SystemSleep = 0x82, /* One-Shot Control */ + kHIDUsage_GD_SystemWakeUp = 0x83, /* One-Shot Control */ + kHIDUsage_GD_SystemContextMenu = 0x84, /* One-Shot Control */ + kHIDUsage_GD_SystemMainMenu = 0x85, /* One-Shot Control */ + kHIDUsage_GD_SystemAppMenu = 0x86, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuHelp = 0x87, /* One-Shot Control */ + kHIDUsage_GD_SystemMenuExit = 0x88, /* One-Shot Control */ + kHIDUsage_GD_SystemMenu = 0x89, /* Selector */ + kHIDUsage_GD_SystemMenuRight = 0x8A, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuLeft = 0x8B, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuUp = 0x8C, /* Re-Trigger Control */ + kHIDUsage_GD_SystemMenuDown = 0x8D, /* Re-Trigger Control */ + /* 0x8E - 0x8F Reserved */ + kHIDUsage_GD_DPadUp = 0x90, /* On/Off Control */ + kHIDUsage_GD_DPadDown = 0x91, /* On/Off Control */ + kHIDUsage_GD_DPadRight = 0x92, /* On/Off Control */ + kHIDUsage_GD_DPadLeft = 0x93, /* On/Off Control */ + /* 0x94 - 0xFFFF Reserved */ + kHIDUsage_GD_Reserved = 0xFFFF +}; + +/* Simulation Page (0x02) */ +/* This section provides detailed descriptions of the usages employed by simulation devices. */ +enum +{ + kHIDUsage_Sim_FlightSimulationDevice = 0x01, /* Application Collection */ + kHIDUsage_Sim_AutomobileSimulationDevice = 0x02, /* Application Collection */ + kHIDUsage_Sim_TankSimulationDevice = 0x03, /* Application Collection */ + kHIDUsage_Sim_SpaceshipSimulationDevice = 0x04, /* Application Collection */ + kHIDUsage_Sim_SubmarineSimulationDevice = 0x05, /* Application Collection */ + kHIDUsage_Sim_SailingSimulationDevice = 0x06, /* Application Collection */ + kHIDUsage_Sim_MotorcycleSimulationDevice = 0x07, /* Application Collection */ + kHIDUsage_Sim_SportsSimulationDevice = 0x08, /* Application Collection */ + kHIDUsage_Sim_AirplaneSimulationDevice = 0x09, /* Application Collection */ + kHIDUsage_Sim_HelicopterSimulationDevice = 0x0A, /* Application Collection */ + kHIDUsage_Sim_MagicCarpetSimulationDevice = 0x0B, /* Application Collection */ + kHIDUsage_Sim_BicycleSimulationDevice = 0x0C, /* Application Collection */ + /* 0x0D - 0x1F Reserved */ + kHIDUsage_Sim_FlightControlStick = 0x20, /* Application Collection */ + kHIDUsage_Sim_FlightStick = 0x21, /* Application Collection */ + kHIDUsage_Sim_CyclicControl = 0x22, /* Physical Collection */ + kHIDUsage_Sim_CyclicTrim = 0x23, /* Physical Collection */ + kHIDUsage_Sim_FlightYoke = 0x24, /* Application Collection */ + kHIDUsage_Sim_TrackControl = 0x25, /* Physical Collection */ + /* 0x26 - 0xAF Reserved */ + kHIDUsage_Sim_Aileron = 0xB0, /* Dynamic Value */ + kHIDUsage_Sim_AileronTrim = 0xB1, /* Dynamic Value */ + kHIDUsage_Sim_AntiTorqueControl = 0xB2, /* Dynamic Value */ + kHIDUsage_Sim_AutopilotEnable = 0xB3, /* On/Off Control */ + kHIDUsage_Sim_ChaffRelease = 0xB4, /* One-Shot Control */ + kHIDUsage_Sim_CollectiveControl = 0xB5, /* Dynamic Value */ + kHIDUsage_Sim_DiveBrake = 0xB6, /* Dynamic Value */ + kHIDUsage_Sim_ElectronicCountermeasures = 0xB7, /* On/Off Control */ + kHIDUsage_Sim_Elevator = 0xB8, /* Dynamic Value */ + kHIDUsage_Sim_ElevatorTrim = 0xB9, /* Dynamic Value */ + kHIDUsage_Sim_Rudder = 0xBA, /* Dynamic Value */ + kHIDUsage_Sim_Throttle = 0xBB, /* Dynamic Value */ + kHIDUsage_Sim_FlightCommunications = 0xBC, /* On/Off Control */ + kHIDUsage_Sim_FlareRelease = 0xBD, /* One-Shot Control */ + kHIDUsage_Sim_LandingGear = 0xBE, /* On/Off Control */ + kHIDUsage_Sim_ToeBrake = 0xBF, /* Dynamic Value */ + kHIDUsage_Sim_Trigger = 0xC0, /* Momentary Control */ + kHIDUsage_Sim_WeaponsArm = 0xC1, /* On/Off Control */ + kHIDUsage_Sim_Weapons = 0xC2, /* Selector */ + kHIDUsage_Sim_WingFlaps = 0xC3, /* Dynamic Value */ + kHIDUsage_Sim_Accelerator = 0xC4, /* Dynamic Value */ + kHIDUsage_Sim_Brake = 0xC5, /* Dynamic Value */ + kHIDUsage_Sim_Clutch = 0xC6, /* Dynamic Value */ + kHIDUsage_Sim_Shifter = 0xC7, /* Dynamic Value */ + kHIDUsage_Sim_Steering = 0xC8, /* Dynamic Value */ + kHIDUsage_Sim_TurretDirection = 0xC9, /* Dynamic Value */ + kHIDUsage_Sim_BarrelElevation = 0xCA, /* Dynamic Value */ + kHIDUsage_Sim_DivePlane = 0xCB, /* Dynamic Value */ + kHIDUsage_Sim_Ballast = 0xCC, /* Dynamic Value */ + kHIDUsage_Sim_BicycleCrank = 0xCD, /* Dynamic Value */ + kHIDUsage_Sim_HandleBars = 0xCE, /* Dynamic Value */ + kHIDUsage_Sim_FrontBrake = 0xCF, /* Dynamic Value */ + kHIDUsage_Sim_RearBrake = 0xD0, /* Dynamic Value */ + /* 0xD1 - 0xFFFF Reserved */ + kHIDUsage_Sim_Reserved = 0xFFFF +}; + +/* VR Page (0x03) */ +/* Virtual Reality controls depend on designators to identify the individual controls. Most of the following are */ +/* usages are applied to the collections of entities that comprise the actual device. */ +enum +{ + kHIDUsage_VR_Belt = 0x01, /* Application Collection */ + kHIDUsage_VR_BodySuit = 0x02, /* Application Collection */ + kHIDUsage_VR_Flexor = 0x03, /* Physical Collection */ + kHIDUsage_VR_Glove = 0x04, /* Application Collection */ + kHIDUsage_VR_HeadTracker = 0x05, /* Physical Collection */ + kHIDUsage_VR_HeadMountedDisplay = 0x06, /* Application Collection */ + kHIDUsage_VR_HandTracker = 0x07, /* Application Collection */ + kHIDUsage_VR_Oculometer = 0x08, /* Application Collection */ + kHIDUsage_VR_Vest = 0x09, /* Application Collection */ + kHIDUsage_VR_AnimatronicDevice = 0x0A, /* Application Collection */ + /* 0x0B - 0x1F Reserved */ + kHIDUsage_VR_StereoEnable = 0x20, /* On/Off Control */ + kHIDUsage_VR_DisplayEnable = 0x21, /* On/Off Control */ + /* 0x22 - 0xFFFF Reserved */ + kHIDUsage_VR_Reserved = 0xFFFF +}; + +/* Sport Page (0x04) */ +enum +{ + kHIDUsage_Sprt_BaseballBat = 0x01, /* Application Collection */ + kHIDUsage_Sprt_GolfClub = 0x02, /* Application Collection */ + kHIDUsage_Sprt_RowingMachine = 0x03, /* Application Collection */ + kHIDUsage_Sprt_Treadmill = 0x04, /* Application Collection */ + /* 0x05 - 0x2F Reserved */ + kHIDUsage_Sprt_Oar = 0x30, /* Dynamic Value */ + kHIDUsage_Sprt_Slope = 0x31, /* Dynamic Value */ + kHIDUsage_Sprt_Rate = 0x32, /* Dynamic Value */ + kHIDUsage_Sprt_StickSpeed = 0x33, /* Dynamic Value */ + kHIDUsage_Sprt_StickFaceAngle = 0x34, /* Dynamic Value */ + kHIDUsage_Sprt_StickHeelOrToe = 0x35, /* Dynamic Value */ + kHIDUsage_Sprt_StickFollowThrough = 0x36, /* Dynamic Value */ + kHIDUsage_Sprt_StickTempo = 0x37, /* Dynamic Value */ + kHIDUsage_Sprt_StickType = 0x38, /* Named Array */ + kHIDUsage_Sprt_StickHeight = 0x39, /* Dynamic Value */ + /* 0x3A - 0x4F Reserved */ + kHIDUsage_Sprt_Putter = 0x50, /* Selector */ + kHIDUsage_Sprt_1Iron = 0x51, /* Selector */ + kHIDUsage_Sprt_2Iron = 0x52, /* Selector */ + kHIDUsage_Sprt_3Iron = 0x53, /* Selector */ + kHIDUsage_Sprt_4Iron = 0x54, /* Selector */ + kHIDUsage_Sprt_5Iron = 0x55, /* Selector */ + kHIDUsage_Sprt_6Iron = 0x56, /* Selector */ + kHIDUsage_Sprt_7Iron = 0x57, /* Selector */ + kHIDUsage_Sprt_8Iron = 0x58, /* Selector */ + kHIDUsage_Sprt_9Iron = 0x59, /* Selector */ + kHIDUsage_Sprt_10Iron = 0x5A, /* Selector */ + kHIDUsage_Sprt_11Iron = 0x5B, /* Selector */ + kHIDUsage_Sprt_SandWedge = 0x5C, /* Selector */ + kHIDUsage_Sprt_LoftWedge = 0x5D, /* Selector */ + kHIDUsage_Sprt_PowerWedge = 0x5E, /* Selector */ + kHIDUsage_Sprt_1Wood = 0x5F, /* Selector */ + kHIDUsage_Sprt_3Wood = 0x60, /* Selector */ + kHIDUsage_Sprt_5Wood = 0x61, /* Selector */ + kHIDUsage_Sprt_7Wood = 0x62, /* Selector */ + kHIDUsage_Sprt_9Wood = 0x63, /* Selector */ + /* 0x64 - 0xFFFF Reserved */ + kHIDUsage_Sprt_Reserved = 0xFFFF +}; + +/* Game Page (0x05) */ +enum +{ + kHIDUsage_Game_3DGameController = 0x01, /* Application Collection */ + kHIDUsage_Game_PinballDevice = 0x02, /* Application Collection */ + kHIDUsage_Game_GunDevice = 0x03, /* Application Collection */ + /* 0x04 - 0x1F Reserved */ + kHIDUsage_Game_PointofView = 0x20, /* Physical Collection */ + kHIDUsage_Game_TurnRightOrLeft = 0x21, /* Dynamic Value */ + kHIDUsage_Game_PitchUpOrDown = 0x22, /* Dynamic Value */ + kHIDUsage_Game_RollRightOrLeft = 0x23, /* Dynamic Value */ + kHIDUsage_Game_MoveRightOrLeft = 0x24, /* Dynamic Value */ + kHIDUsage_Game_MoveForwardOrBackward = 0x25, /* Dynamic Value */ + kHIDUsage_Game_MoveUpOrDown = 0x26, /* Dynamic Value */ + kHIDUsage_Game_LeanRightOrLeft = 0x27, /* Dynamic Value */ + kHIDUsage_Game_LeanForwardOrBackward = 0x28, /* Dynamic Value */ + kHIDUsage_Game_HeightOfPOV = 0x29, /* Dynamic Value */ + kHIDUsage_Game_Flipper = 0x2A, /* Momentary Control */ + kHIDUsage_Game_SecondaryFlipper = 0x2B, /* Momentary Control */ + kHIDUsage_Game_Bump = 0x2C, /* Momentary Control */ + kHIDUsage_Game_NewGame = 0x2D, /* One-Shot Control */ + kHIDUsage_Game_ShootBall = 0x2E, /* One-Shot Control */ + kHIDUsage_Game_Player = 0x2F, /* One-Shot Control */ + kHIDUsage_Game_GunBolt = 0x30, /* On/Off Control */ + kHIDUsage_Game_GunClip = 0x31, /* On/Off Control */ + kHIDUsage_Game_Gun = 0x32, /* Selector */ + kHIDUsage_Game_GunSingleShot = 0x33, /* Selector */ + kHIDUsage_Game_GunBurst = 0x34, /* Selector */ + kHIDUsage_Game_GunAutomatic = 0x35, /* Selector */ + kHIDUsage_Game_GunSafety = 0x36, /* On/Off Control */ + kHIDUsage_Game_GamepadFireOrJump = 0x37, /* Logical Collection */ + kHIDUsage_Game_GamepadTrigger = 0x39, /* Logical Collection */ + /* 0x3A - 0xFFFF Reserved */ + kHIDUsage_Game_Reserved = 0xFFFF +}; + +/* KeyboardOrKeypad Page (0x07) */ +/* This section is the Usage Page for key codes to be used in implementing a USB keyboard. A Boot Keyboard (84-, 101- or 104-key) should at a minimum support all associated usage codes as indicated in the Boot */ +/* column below. */ +/* The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control (0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV). */ +/* Note: A general note on Usages and languages: Due to the variation of keyboards from language to language, it is not feasible to specify exact key mappings for every language. Where this list is not specific for a key function in a language, the closest equivalent key position should be used, so that a keyboard may be modified for a different language by simply printing different keycaps. One example is the Y key on a North American keyboard. In Germany this is typically Z. Rather than changing the keyboard firmware to put the Z Usage into that place in the descriptor list, the vendor should use the Y Usage on both the North American and German keyboards. This continues to be the existing practice in the industry, in order to minimize the number of changes to the electronics to accommodate otherlanguages. */ +enum +{ + kHIDUsage_KeyboardErrorRollOver = 0x01, /* ErrorRollOver */ + kHIDUsage_KeyboardPOSTFail = 0x02, /* POSTFail */ + kHIDUsage_KeyboardErrorUndefined = 0x03, /* ErrorUndefined */ + kHIDUsage_KeyboardA = 0x04, /* a or A */ + kHIDUsage_KeyboardB = 0x05, /* b or B */ + kHIDUsage_KeyboardC = 0x06, /* c or C */ + kHIDUsage_KeyboardD = 0x07, /* d or D */ + kHIDUsage_KeyboardE = 0x08, /* e or E */ + kHIDUsage_KeyboardF = 0x09, /* f or F */ + kHIDUsage_KeyboardG = 0x0A, /* g or G */ + kHIDUsage_KeyboardH = 0x0B, /* h or H */ + kHIDUsage_KeyboardI = 0x0C, /* i or I */ + kHIDUsage_KeyboardJ = 0x0D, /* j or J */ + kHIDUsage_KeyboardK = 0x0E, /* k or K */ + kHIDUsage_KeyboardL = 0x0F, /* l or L */ + kHIDUsage_KeyboardM = 0x10, /* m or M */ + kHIDUsage_KeyboardN = 0x11, /* n or N */ + kHIDUsage_KeyboardO = 0x12, /* o or O */ + kHIDUsage_KeyboardP = 0x13, /* p or P */ + kHIDUsage_KeyboardQ = 0x14, /* q or Q */ + kHIDUsage_KeyboardR = 0x15, /* r or R */ + kHIDUsage_KeyboardS = 0x16, /* s or S */ + kHIDUsage_KeyboardT = 0x17, /* t or T */ + kHIDUsage_KeyboardU = 0x18, /* u or U */ + kHIDUsage_KeyboardV = 0x19, /* v or V */ + kHIDUsage_KeyboardW = 0x1A, /* w or W */ + kHIDUsage_KeyboardX = 0x1B, /* x or X */ + kHIDUsage_KeyboardY = 0x1C, /* y or Y */ + kHIDUsage_KeyboardZ = 0x1D, /* z or Z */ + kHIDUsage_Keyboard1 = 0x1E, /* 1 or ! */ + kHIDUsage_Keyboard2 = 0x1F, /* 2 or @ */ + kHIDUsage_Keyboard3 = 0x20, /* 3 or # */ + kHIDUsage_Keyboard4 = 0x21, /* 4 or $ */ + kHIDUsage_Keyboard5 = 0x22, /* 5 or % */ + kHIDUsage_Keyboard6 = 0x23, /* 6 or ^ */ + kHIDUsage_Keyboard7 = 0x24, /* 7 or & */ + kHIDUsage_Keyboard8 = 0x25, /* 8 or * */ + kHIDUsage_Keyboard9 = 0x26, /* 9 or ( */ + kHIDUsage_Keyboard0 = 0x27, /* 0 or ) */ + kHIDUsage_KeyboardReturnOrEnter = 0x28, /* Return (Enter) */ + kHIDUsage_KeyboardEscape = 0x29, /* Escape */ + kHIDUsage_KeyboardDeleteOrBackspace = 0x2A, /* Delete (Backspace) */ + kHIDUsage_KeyboardTab = 0x2B, /* Tab */ + kHIDUsage_KeyboardSpacebar = 0x2C, /* Spacebar */ + kHIDUsage_KeyboardHyphen = 0x2D, /* - or _ */ + kHIDUsage_KeyboardEqualSign = 0x2E, /* = or + */ + kHIDUsage_KeyboardOpenBracket = 0x2F, /* [ or { */ + kHIDUsage_KeyboardCloseBracket = 0x30, /* ] or } */ + kHIDUsage_KeyboardBackslash = 0x31, /* \ or | */ + kHIDUsage_KeyboardNonUSPound = 0x32, /* Non-US # or _ */ + kHIDUsage_KeyboardSemicolon = 0x33, /* ; or : */ + kHIDUsage_KeyboardQuote = 0x34, /* ' or " */ + kHIDUsage_KeyboardGraveAccentAndTilde = 0x35, /* Grave Accent and Tilde */ + kHIDUsage_KeyboardComma = 0x36, /* , or < */ + kHIDUsage_KeyboardPeriod = 0x37, /* . or > */ + kHIDUsage_KeyboardSlash = 0x38, /* / or ? */ + kHIDUsage_KeyboardCapsLock = 0x39, /* Caps Lock */ + kHIDUsage_KeyboardF1 = 0x3A, /* F1 */ + kHIDUsage_KeyboardF2 = 0x3B, /* F2 */ + kHIDUsage_KeyboardF3 = 0x3C, /* F3 */ + kHIDUsage_KeyboardF4 = 0x3D, /* F4 */ + kHIDUsage_KeyboardF5 = 0x3E, /* F5 */ + kHIDUsage_KeyboardF6 = 0x3F, /* F6 */ + kHIDUsage_KeyboardF7 = 0x40, /* F7 */ + kHIDUsage_KeyboardF8 = 0x41, /* F8 */ + kHIDUsage_KeyboardF9 = 0x42, /* F9 */ + kHIDUsage_KeyboardF10 = 0x43, /* F10 */ + kHIDUsage_KeyboardF11 = 0x44, /* F11 */ + kHIDUsage_KeyboardF12 = 0x45, /* F12 */ + kHIDUsage_KeyboardPrintScreen = 0x46, /* Print Screen */ + kHIDUsage_KeyboardScrollLock = 0x47, /* Scroll Lock */ + kHIDUsage_KeyboardPause = 0x48, /* Pause */ + kHIDUsage_KeyboardInsert = 0x49, /* Insert */ + kHIDUsage_KeyboardHome = 0x4A, /* Home */ + kHIDUsage_KeyboardPageUp = 0x4B, /* Page Up */ + kHIDUsage_KeyboardDeleteForward = 0x4C, /* Delete Forward */ + kHIDUsage_KeyboardEnd = 0x4D, /* End */ + kHIDUsage_KeyboardPageDown = 0x4E, /* Page Down */ + kHIDUsage_KeyboardRightArrow = 0x4F, /* Right Arrow */ + kHIDUsage_KeyboardLeftArrow = 0x50, /* Left Arrow */ + kHIDUsage_KeyboardDownArrow = 0x51, /* Down Arrow */ + kHIDUsage_KeyboardUpArrow = 0x52, /* Up Arrow */ + kHIDUsage_KeypadNumLock = 0x53, /* Keypad NumLock or Clear */ + kHIDUsage_KeypadSlash = 0x54, /* Keypad / */ + kHIDUsage_KeypadAsterisk = 0x55, /* Keypad * */ + kHIDUsage_KeypadHyphen = 0x56, /* Keypad - */ + kHIDUsage_KeypadPlus = 0x57, /* Keypad + */ + kHIDUsage_KeypadEnter = 0x58, /* Keypad Enter */ + kHIDUsage_Keypad1 = 0x59, /* Keypad 1 or End */ + kHIDUsage_Keypad2 = 0x5A, /* Keypad 2 or Down Arrow */ + kHIDUsage_Keypad3 = 0x5B, /* Keypad 3 or Page Down */ + kHIDUsage_Keypad4 = 0x5C, /* Keypad 4 or Left Arrow */ + kHIDUsage_Keypad5 = 0x5D, /* Keypad 5 */ + kHIDUsage_Keypad6 = 0x5E, /* Keypad 6 or Right Arrow */ + kHIDUsage_Keypad7 = 0x5F, /* Keypad 7 or Home */ + kHIDUsage_Keypad8 = 0x60, /* Keypad 8 or Up Arrow */ + kHIDUsage_Keypad9 = 0x61, /* Keypad 9 or Page Up */ + kHIDUsage_Keypad0 = 0x62, /* Keypad 0 or Insert */ + kHIDUsage_KeypadPeriod = 0x63, /* Keypad . or Delete */ + kHIDUsage_KeyboardNonUSBackslash = 0x64, /* Non-US \ or | */ + kHIDUsage_KeyboardApplication = 0x65, /* Application */ + kHIDUsage_KeyboardPower = 0x66, /* Power */ + kHIDUsage_KeypadEqualSign = 0x67, /* Keypad = */ + kHIDUsage_KeyboardF13 = 0x68, /* F13 */ + kHIDUsage_KeyboardF14 = 0x69, /* F14 */ + kHIDUsage_KeyboardF15 = 0x6A, /* F15 */ + kHIDUsage_KeyboardF16 = 0x6B, /* F16 */ + kHIDUsage_KeyboardF17 = 0x6C, /* F17 */ + kHIDUsage_KeyboardF18 = 0x6D, /* F18 */ + kHIDUsage_KeyboardF19 = 0x6E, /* F19 */ + kHIDUsage_KeyboardF20 = 0x6F, /* F20 */ + kHIDUsage_KeyboardF21 = 0x70, /* F21 */ + kHIDUsage_KeyboardF22 = 0x71, /* F22 */ + kHIDUsage_KeyboardF23 = 0x72, /* F23 */ + kHIDUsage_KeyboardF24 = 0x73, /* F24 */ + kHIDUsage_KeyboardExecute = 0x74, /* Execute */ + kHIDUsage_KeyboardHelp = 0x75, /* Help */ + kHIDUsage_KeyboardMenu = 0x76, /* Menu */ + kHIDUsage_KeyboardSelect = 0x77, /* Select */ + kHIDUsage_KeyboardStop = 0x78, /* Stop */ + kHIDUsage_KeyboardAgain = 0x79, /* Again */ + kHIDUsage_KeyboardUndo = 0x7A, /* Undo */ + kHIDUsage_KeyboardCut = 0x7B, /* Cut */ + kHIDUsage_KeyboardCopy = 0x7C, /* Copy */ + kHIDUsage_KeyboardPaste = 0x7D, /* Paste */ + kHIDUsage_KeyboardFind = 0x7E, /* Find */ + kHIDUsage_KeyboardMute = 0x7F, /* Mute */ + kHIDUsage_KeyboardVolumeUp = 0x80, /* Volume Up */ + kHIDUsage_KeyboardVolumeDown = 0x81, /* Volume Down */ + kHIDUsage_KeyboardLockingCapsLock = 0x82, /* Locking Caps Lock */ + kHIDUsage_KeyboardLockingNumLock = 0x83, /* Locking Num Lock */ + kHIDUsage_KeyboardLockingScrollLock = 0x84, /* Locking Scroll Lock */ + kHIDUsage_KeypadComma = 0x85, /* Keypad Comma */ + kHIDUsage_KeypadEqualSignAS400 = 0x86, /* Keypad Equal Sign for AS/400 */ + kHIDUsage_KeyboardInternational1 = 0x87, /* International1 */ + kHIDUsage_KeyboardInternational2 = 0x88, /* International2 */ + kHIDUsage_KeyboardInternational3 = 0x89, /* International3 */ + kHIDUsage_KeyboardInternational4 = 0x8A, /* International4 */ + kHIDUsage_KeyboardInternational5 = 0x8B, /* International5 */ + kHIDUsage_KeyboardInternational6 = 0x8C, /* International6 */ + kHIDUsage_KeyboardInternational7 = 0x8D, /* International7 */ + kHIDUsage_KeyboardInternational8 = 0x8E, /* International8 */ + kHIDUsage_KeyboardInternational9 = 0x8F, /* International9 */ + kHIDUsage_KeyboardLANG1 = 0x90, /* LANG1 */ + kHIDUsage_KeyboardLANG2 = 0x91, /* LANG2 */ + kHIDUsage_KeyboardLANG3 = 0x92, /* LANG3 */ + kHIDUsage_KeyboardLANG4 = 0x93, /* LANG4 */ + kHIDUsage_KeyboardLANG5 = 0x94, /* LANG5 */ + kHIDUsage_KeyboardLANG6 = 0x95, /* LANG6 */ + kHIDUsage_KeyboardLANG7 = 0x96, /* LANG7 */ + kHIDUsage_KeyboardLANG8 = 0x97, /* LANG8 */ + kHIDUsage_KeyboardLANG9 = 0x98, /* LANG9 */ + kHIDUsage_KeyboardAlternateErase = 0x99, /* AlternateErase */ + kHIDUsage_KeyboardSysReqOrAttention = 0x9A, /* SysReq/Attention */ + kHIDUsage_KeyboardCancel = 0x9B, /* Cancel */ + kHIDUsage_KeyboardClear = 0x9C, /* Clear */ + kHIDUsage_KeyboardPrior = 0x9D, /* Prior */ + kHIDUsage_KeyboardReturn = 0x9E, /* Return */ + kHIDUsage_KeyboardSeparator = 0x9F, /* Separator */ + kHIDUsage_KeyboardOut = 0xA0, /* Out */ + kHIDUsage_KeyboardOper = 0xA1, /* Oper */ + kHIDUsage_KeyboardClearOrAgain = 0xA2, /* Clear/Again */ + kHIDUsage_KeyboardCrSelOrProps = 0xA3, /* CrSel/Props */ + kHIDUsage_KeyboardExSel = 0xA4, /* ExSel */ + /* 0xA5-0xDF Reserved */ + kHIDUsage_KeyboardLeftControl = 0xE0, /* Left Control */ + kHIDUsage_KeyboardLeftShift = 0xE1, /* Left Shift */ + kHIDUsage_KeyboardLeftAlt = 0xE2, /* Left Alt */ + kHIDUsage_KeyboardLeftGUI = 0xE3, /* Left GUI */ + kHIDUsage_KeyboardRightControl = 0xE4, /* Right Control */ + kHIDUsage_KeyboardRightShift = 0xE5, /* Right Shift */ + kHIDUsage_KeyboardRightAlt = 0xE6, /* Right Alt */ + kHIDUsage_KeyboardRightGUI = 0xE7, /* Right GUI */ + /* 0xE8-0xFFFF Reserved */ + kHIDUsage_Keyboard_Reserved = 0xFFFF +}; + +/* LEDs Page (0x08) */ +/* An LED or indicator is implemented as an On/Off Control (OOF) using the Single button toggle mode, where a value of 1 will turn on the indicator, and a value of 0 will turn it off. The exceptions are described below. */ +enum +{ + kHIDUsage_LED_NumLock = 0x01, /* On/Off Control */ + kHIDUsage_LED_CapsLock = 0x02, /* On/Off Control */ + kHIDUsage_LED_ScrollLock = 0x03, /* On/Off Control */ + kHIDUsage_LED_Compose = 0x04, /* On/Off Control */ + kHIDUsage_LED_Kana = 0x05, /* On/Off Control */ + kHIDUsage_LED_Power = 0x06, /* On/Off Control */ + kHIDUsage_LED_Shift = 0x07, /* On/Off Control */ + kHIDUsage_LED_DoNotDisturb = 0x08, /* On/Off Control */ + kHIDUsage_LED_Mute = 0x09, /* On/Off Control */ + kHIDUsage_LED_ToneEnable = 0x0A, /* On/Off Control */ + kHIDUsage_LED_HighCutFilter = 0x0B, /* On/Off Control */ + kHIDUsage_LED_LowCutFilter = 0x0C, /* On/Off Control */ + kHIDUsage_LED_EqualizerEnable = 0x0D, /* On/Off Control */ + kHIDUsage_LED_SoundFieldOn = 0x0E, /* On/Off Control */ + kHIDUsage_LED_SurroundOn = 0x0F, /* On/Off Control */ + kHIDUsage_LED_Repeat = 0x10, /* On/Off Control */ + kHIDUsage_LED_Stereo = 0x11, /* On/Off Control */ + kHIDUsage_LED_SamplingRateDetect = 0x12, /* On/Off Control */ + kHIDUsage_LED_Spinning = 0x13, /* On/Off Control */ + kHIDUsage_LED_CAV = 0x14, /* On/Off Control */ + kHIDUsage_LED_CLV = 0x15, /* On/Off Control */ + kHIDUsage_LED_RecordingFormatDetect = 0x16, /* On/Off Control */ + kHIDUsage_LED_OffHook = 0x17, /* On/Off Control */ + kHIDUsage_LED_Ring = 0x18, /* On/Off Control */ + kHIDUsage_LED_MessageWaiting = 0x19, /* On/Off Control */ + kHIDUsage_LED_DataMode = 0x1A, /* On/Off Control */ + kHIDUsage_LED_BatteryOperation = 0x1B, /* On/Off Control */ + kHIDUsage_LED_BatteryOK = 0x1C, /* On/Off Control */ + kHIDUsage_LED_BatteryLow = 0x1D, /* On/Off Control */ + kHIDUsage_LED_Speaker = 0x1E, /* On/Off Control */ + kHIDUsage_LED_HeadSet = 0x1F, /* On/Off Control */ + kHIDUsage_LED_Hold = 0x20, /* On/Off Control */ + kHIDUsage_LED_Microphone = 0x21, /* On/Off Control */ + kHIDUsage_LED_Coverage = 0x22, /* On/Off Control */ + kHIDUsage_LED_NightMode = 0x23, /* On/Off Control */ + kHIDUsage_LED_SendCalls = 0x24, /* On/Off Control */ + kHIDUsage_LED_CallPickup = 0x25, /* On/Off Control */ + kHIDUsage_LED_Conference = 0x26, /* On/Off Control */ + kHIDUsage_LED_StandBy = 0x27, /* On/Off Control */ + kHIDUsage_LED_CameraOn = 0x28, /* On/Off Control */ + kHIDUsage_LED_CameraOff = 0x29, /* On/Off Control */ + kHIDUsage_LED_OnLine = 0x2A, /* On/Off Control */ + kHIDUsage_LED_OffLine = 0x2B, /* On/Off Control */ + kHIDUsage_LED_Busy = 0x2C, /* On/Off Control */ + kHIDUsage_LED_Ready = 0x2D, /* On/Off Control */ + kHIDUsage_LED_PaperOut = 0x2E, /* On/Off Control */ + kHIDUsage_LED_PaperJam = 0x2F, /* On/Off Control */ + kHIDUsage_LED_Remote = 0x30, /* On/Off Control */ + kHIDUsage_LED_Forward = 0x31, /* On/Off Control */ + kHIDUsage_LED_Reverse = 0x32, /* On/Off Control */ + kHIDUsage_LED_Stop = 0x33, /* On/Off Control */ + kHIDUsage_LED_Rewind = 0x34, /* On/Off Control */ + kHIDUsage_LED_FastForward = 0x35, /* On/Off Control */ + kHIDUsage_LED_Play = 0x36, /* On/Off Control */ + kHIDUsage_LED_Pause = 0x37, /* On/Off Control */ + kHIDUsage_LED_Record = 0x38, /* On/Off Control */ + kHIDUsage_LED_Error = 0x39, /* On/Off Control */ + kHIDUsage_LED_Usage = 0x3A, /* Selector */ + kHIDUsage_LED_UsageInUseIndicator = 0x3B, /* Usage Switch */ + kHIDUsage_LED_UsageMultiModeIndicator = 0x3C, /* Usage Modifier */ + kHIDUsage_LED_IndicatorOn = 0x3D, /* Selector */ + kHIDUsage_LED_IndicatorFlash = 0x3E, /* Selector */ + kHIDUsage_LED_IndicatorSlowBlink = 0x3F, /* Selector */ + kHIDUsage_LED_IndicatorFastBlink = 0x40, /* Selector */ + kHIDUsage_LED_IndicatorOff = 0x41, /* Selector */ + kHIDUsage_LED_FlashOnTime = 0x42, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOnTime = 0x43, /* Dynamic Value */ + kHIDUsage_LED_SlowBlinkOffTime = 0x44, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOnTime = 0x45, /* Dynamic Value */ + kHIDUsage_LED_FastBlinkOffTime = 0x46, /* Dynamic Value */ + kHIDUsage_LED_UsageIndicatorColor = 0x47, /* Usage Modifier */ + kHIDUsage_LED_IndicatorRed = 0x48, /* Selector */ + kHIDUsage_LED_IndicatorGreen = 0x49, /* Selector */ + kHIDUsage_LED_IndicatorAmber = 0x4A, /* Selector */ + kHIDUsage_LED_GenericIndicator = 0x4B, /* On/Off Control */ + kHIDUsage_LED_SystemSuspend = 0x4C, /* On/Off Control */ + kHIDUsage_LED_ExternalPowerConnected = 0x4D, /* On/Off Control */ + /* 0x4E - 0xFFFF Reserved */ + kHIDUsage_LED_Reserved = 0xFFFF +}; + +/* Button Page (0x09) */ +/* The Button page is the first place an application should look for user selection controls. System graphical user interfaces typically employ a pointer and a set of hierarchical selectors to select, move and otherwise manipulate their environment. For these purposes the following assignment of significance can be applied to the Button usages: */ +/* Button 1, Primary Button. Used for object selecting, dragging, and double click activation. On MacOS, this is the only button. Microsoft operating systems call this a logical left button, because it */ +/* is not necessarily physically located on the left of the pointing device. */ +/* Button 2, Secondary Button. Used by newer graphical user interfaces to browse object properties. Exposed by systems to applications that typically assign application-specific functionality. */ +/* Button 3, Tertiary Button. Optional control. Exposed to applications, but seldom assigned functionality due to prevalence of two- and one-button devices. */ +/* Buttons 4 -55. As the button number increases, its significance as a selector decreases. */ +/* In many ways the assignment of button numbers is similar to the assignment of Effort in Physical descriptors. Button 1 would be used to define the button a finger rests on when the hand is in the at rest position, that is, virtually no effort is required by the user to activate the button. Button values increment as the finger has to stretch to reach a control. See Section 6.2.3, Physical Descriptors, in the HID Specification for methods of further qualifying buttons. */ +enum +{ + kHIDUsage_Button_1 = 0x01, /* (primary/trigger) */ + kHIDUsage_Button_2 = 0x02, /* (secondary) */ + kHIDUsage_Button_3 = 0x03, /* (tertiary) */ + kHIDUsage_Button_4 = 0x04, /* 4th button */ + /* ... */ + kHIDUsage_Button_65535 = 0xFFFF +}; + +/* Ordinal Page (0x0A) */ +/* The Ordinal page allows multiple instances of a control or sets of controls to be declared without requiring individual enumeration in the native usage page. For example, it is not necessary to declare usages of Pointer 1, Pointer 2, and so forth on the Generic Desktop page. When parsed, the ordinal instance number is, in essence, concatenated to the usages attached to the encompassing collection to create Pointer 1, Pointer 2, and so forth. */ +/* For an example, see Section A.5, Multiple Instances of a Control, in Appendix A, Usage Examples. By convention, an Ordinal collection is placed inside the collection for which it is declaring multiple instances. */ +/* Instances do not have to be identical. */ +enum +{ + /* 0x00 Reserved */ + kHIDUsage_Ord_Instance1 = 0x01, /* Usage Modifier */ + kHIDUsage_Ord_Instance2 = 0x02, /* Usage Modifier */ + kHIDUsage_Ord_Instance3 = 0x03, /* Usage Modifier */ + kHIDUsage_Ord_Instance4 = 0x04, /* Usage Modifier */ + kHIDUsage_Ord_Instance65535 = 0xFFFF /* Usage Modifier */ +}; + +/* Telephony Page (0x0B) */ +/* This usage page defines the keytop and control usages for telephony devices. */ +/* Indicators on a phone are handled by wrapping them in LED: Usage In Use Indicator and LED: Usage Selected Indicator usages. For example, a message-indicator LED would be identified by a Telephony: Message usage declared as a Feature or Output in a LED: Usage In Use Indicator collection. */ +/* See Section 14, Consumer Page (0x0C), for audio volume and tone controls. */ +enum +{ + kHIDUsage_Tfon_Phone = 0x01, /* Application Collection */ + kHIDUsage_Tfon_AnsweringMachine = 0x02, /* Application Collection */ + kHIDUsage_Tfon_MessageControls = 0x03, /* Logical Collection */ + kHIDUsage_Tfon_Handset = 0x04, /* Logical Collection */ + kHIDUsage_Tfon_Headset = 0x05, /* Logical Collection */ + kHIDUsage_Tfon_TelephonyKeyPad = 0x06, /* Named Array */ + kHIDUsage_Tfon_ProgrammableButton = 0x07, /* Named Array */ + /* 0x08 - 0x1F Reserved */ + kHIDUsage_Tfon_HookSwitch = 0x20, /* On/Off Control */ + kHIDUsage_Tfon_Flash = 0x21, /* Momentary Control */ + kHIDUsage_Tfon_Feature = 0x22, /* One-Shot Control */ + kHIDUsage_Tfon_Hold = 0x23, /* On/Off Control */ + kHIDUsage_Tfon_Redial = 0x24, /* One-Shot Control */ + kHIDUsage_Tfon_Transfer = 0x25, /* One-Shot Control */ + kHIDUsage_Tfon_Drop = 0x26, /* One-Shot Control */ + kHIDUsage_Tfon_Park = 0x27, /* On/Off Control */ + kHIDUsage_Tfon_ForwardCalls = 0x28, /* On/Off Control */ + kHIDUsage_Tfon_AlternateFunction = 0x29, /* Momentary Control */ + kHIDUsage_Tfon_Line = 0x2A, /* One-Shot Control */ + kHIDUsage_Tfon_SpeakerPhone = 0x2B, /* On/Off Control */ + kHIDUsage_Tfon_Conference = 0x2C, /* On/Off Control */ + kHIDUsage_Tfon_RingEnable = 0x2D, /* On/Off Control */ + kHIDUsage_Tfon_Ring = 0x2E, /* Selector */ + kHIDUsage_Tfon_PhoneMute = 0x2F, /* On/Off Control */ + kHIDUsage_Tfon_CallerID = 0x30, /* Momentary Control */ + /* 0x31 - 0x4F Reserved */ + kHIDUsage_Tfon_SpeedDial = 0x50, /* One-Shot Control */ + kHIDUsage_Tfon_StoreNumber = 0x51, /* One-Shot Control */ + kHIDUsage_Tfon_RecallNumber = 0x52, /* One-Shot Control */ + kHIDUsage_Tfon_PhoneDirectory = 0x53, /* On/Off Control */ + /* 0x54 - 0x6F Reserved */ + kHIDUsage_Tfon_VoiceMail = 0x70, /* On/Off Control */ + kHIDUsage_Tfon_ScreenCalls = 0x71, /* On/Off Control */ + kHIDUsage_Tfon_DoNotDisturb = 0x72, /* On/Off Control */ + kHIDUsage_Tfon_Message = 0x73, /* One-Shot Control */ + kHIDUsage_Tfon_AnswerOnOrOff = 0x74, /* On/Off Control */ + /* 0x75 - 0x8F Reserved */ + kHIDUsage_Tfon_InsideDialTone = 0x90, /* Momentary Control */ + kHIDUsage_Tfon_OutsideDialTone = 0x91, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingTone = 0x92, /* Momentary Control */ + kHIDUsage_Tfon_OutsideRingTone = 0x93, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingTone = 0x94, /* Momentary Control */ + kHIDUsage_Tfon_InsideRingback = 0x95, /* Momentary Control */ + kHIDUsage_Tfon_PriorityRingback = 0x96, /* Momentary Control */ + kHIDUsage_Tfon_LineBusyTone = 0x97, /* Momentary Control */ + kHIDUsage_Tfon_ReorderTone = 0x98, /* Momentary Control */ + kHIDUsage_Tfon_CallWaitingTone = 0x99, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone1 = 0x9A, /* Momentary Control */ + kHIDUsage_Tfon_ConfirmationTone2 = 0x9B, /* Momentary Control */ + kHIDUsage_Tfon_TonesOff = 0x9C, /* On/Off Control */ + kHIDUsage_Tfon_OutsideRingback = 0x9D, /* Momentary Control */ + /* 0x9E - 0xAF Reserved */ + kHIDUsage_Tfon_PhoneKey0 = 0xB0, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey1 = 0xB1, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey2 = 0xB2, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey3 = 0xB3, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey4 = 0xB4, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey5 = 0xB5, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey6 = 0xB6, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey7 = 0xB7, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey8 = 0xB8, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKey9 = 0xB9, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyStar = 0xBA, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyPound = 0xBB, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyA = 0xBC, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyB = 0xBD, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyC = 0xBE, /* Selector/One-Shot Control */ + kHIDUsage_Tfon_PhoneKeyD = 0xBF, /* Selector/One-Shot Control */ + /* 0xC0 - 0xFFFF Reserved */ + kHIDUsage_TFon_Reserved = 0xFFFF +}; + +/* Consumer Page (0x0C) */ +/* All controls on the Consumer page are application-specific. That is, they affect a specific device, not the system as a whole. */ +enum +{ + kHIDUsage_Csmr_ConsumerControl = 0x01, /* Application Collection */ + kHIDUsage_Csmr_NumericKeyPad = 0x02, /* Named Array */ + kHIDUsage_Csmr_ProgrammableButtons = 0x03, /* Named Array */ + /* 0x03 - 0x1F Reserved */ + kHIDUsage_Csmr_Plus10 = 0x20, /* One-Shot Control */ + kHIDUsage_Csmr_Plus100 = 0x21, /* One-Shot Control */ + kHIDUsage_Csmr_AMOrPM = 0x22, /* One-Shot Control */ + /* 0x23 - 0x3F Reserved */ + kHIDUsage_Csmr_Power = 0x30, /* On/Off Control */ + kHIDUsage_Csmr_Reset = 0x31, /* One-Shot Control */ + kHIDUsage_Csmr_Sleep = 0x32, /* One-Shot Control */ + kHIDUsage_Csmr_SleepAfter = 0x33, /* One-Shot Control */ + kHIDUsage_Csmr_SleepMode = 0x34, /* Re-Trigger Control */ + kHIDUsage_Csmr_Illumination = 0x35, /* On/Off Control */ + kHIDUsage_Csmr_FunctionButtons = 0x36, /* Named Array */ + /* 0x37 - 0x3F Reserved */ + kHIDUsage_Csmr_Menu = 0x40, /* On/Off Control */ + kHIDUsage_Csmr_MenuPick = 0x41, /* One-Shot Control */ + kHIDUsage_Csmr_MenuUp = 0x42, /* One-Shot Control */ + kHIDUsage_Csmr_MenuDown = 0x43, /* One-Shot Control */ + kHIDUsage_Csmr_MenuLeft = 0x44, /* One-Shot Control */ + kHIDUsage_Csmr_MenuRight = 0x45, /* One-Shot Control */ + kHIDUsage_Csmr_MenuEscape = 0x46, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueIncrease = 0x47, /* One-Shot Control */ + kHIDUsage_Csmr_MenuValueDecrease = 0x48, /* One-Shot Control */ + /* 0x49 - 0x5F Reserved */ + kHIDUsage_Csmr_DataOnScreen = 0x60, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaption = 0x61, /* On/Off Control */ + kHIDUsage_Csmr_ClosedCaptionSelect = 0x62, /* Selector */ + kHIDUsage_Csmr_VCROrTV = 0x63, /* On/Off Control */ + kHIDUsage_Csmr_BroadcastMode = 0x64, /* One-Shot Control */ + kHIDUsage_Csmr_Snapshot = 0x65, /* One-Shot Control */ + kHIDUsage_Csmr_Still = 0x66, /* One-Shot Control */ + /* 0x67 - 0x7F Reserved */ + kHIDUsage_Csmr_Selection = 0x80, /* Named Array */ + kHIDUsage_Csmr_Assign = 0x81, /* Selector */ + kHIDUsage_Csmr_ModeStep = 0x82, /* One-Shot Control */ + kHIDUsage_Csmr_RecallLast = 0x83, /* One-Shot Control */ + kHIDUsage_Csmr_EnterChannel = 0x84, /* One-Shot Control */ + kHIDUsage_Csmr_OrderMovie = 0x85, /* One-Shot Control */ + kHIDUsage_Csmr_Channel = 0x86, /* Linear Control */ + kHIDUsage_Csmr_MediaSelection = 0x87, /* Selector */ + kHIDUsage_Csmr_MediaSelectComputer = 0x88, /* Selector */ + kHIDUsage_Csmr_MediaSelectTV = 0x89, /* Selector */ + kHIDUsage_Csmr_MediaSelectWWW = 0x8A, /* Selector */ + kHIDUsage_Csmr_MediaSelectDVD = 0x8B, /* Selector */ + kHIDUsage_Csmr_MediaSelectTelephone = 0x8C, /* Selector */ + kHIDUsage_Csmr_MediaSelectProgramGuide = 0x8D, /* Selector */ + kHIDUsage_Csmr_MediaSelectVideoPhone = 0x8E, /* Selector */ + kHIDUsage_Csmr_MediaSelectGames = 0x8F, /* Selector */ + kHIDUsage_Csmr_MediaSelectMessages = 0x90, /* Selector */ + kHIDUsage_Csmr_MediaSelectCD = 0x91, /* Selector */ + kHIDUsage_Csmr_MediaSelectVCR = 0x92, /* Selector */ + kHIDUsage_Csmr_MediaSelectTuner = 0x93, /* Selector */ + kHIDUsage_Csmr_Quit = 0x94, /* One-Shot Control */ + kHIDUsage_Csmr_Help = 0x95, /* On/Off Control */ + kHIDUsage_Csmr_MediaSelectTape = 0x96, /* Selector */ + kHIDUsage_Csmr_MediaSelectCable = 0x97, /* Selector */ + kHIDUsage_Csmr_MediaSelectSatellite = 0x98, /* Selector */ + kHIDUsage_Csmr_MediaSelectSecurity = 0x99, /* Selector */ + kHIDUsage_Csmr_MediaSelectHome = 0x9A, /* Selector */ + kHIDUsage_Csmr_MediaSelectCall = 0x9B, /* Selector */ + kHIDUsage_Csmr_ChannelIncrement = 0x9C, /* One-Shot Control */ + kHIDUsage_Csmr_ChannelDecrement = 0x9D, /* One-Shot Control */ + kHIDUsage_Csmr_Media = 0x9E, /* Selector */ + /* 0x9F Reserved */ + kHIDUsage_Csmr_VCRPlus = 0xA0, /* One-Shot Control */ + kHIDUsage_Csmr_Once = 0xA1, /* One-Shot Control */ + kHIDUsage_Csmr_Daily = 0xA2, /* One-Shot Control */ + kHIDUsage_Csmr_Weekly = 0xA3, /* One-Shot Control */ + kHIDUsage_Csmr_Monthly = 0xA4, /* One-Shot Control */ + /* 0xA5 - 0xAF Reserved */ + kHIDUsage_Csmr_Play = 0xB0, /* On/Off Control */ + kHIDUsage_Csmr_Pause = 0xB1, /* On/Off Control */ + kHIDUsage_Csmr_Record = 0xB2, /* On/Off Control */ + kHIDUsage_Csmr_FastForward = 0xB3, /* On/Off Control */ + kHIDUsage_Csmr_Rewind = 0xB4, /* On/Off Control */ + kHIDUsage_Csmr_ScanNextTrack = 0xB5, /* One-Shot Control */ + kHIDUsage_Csmr_ScanPreviousTrack = 0xB6, /* One-Shot Control */ + kHIDUsage_Csmr_Stop = 0xB7, /* One-Shot Control */ + kHIDUsage_Csmr_Eject = 0xB8, /* One-Shot Control */ + kHIDUsage_Csmr_RandomPlay = 0xB9, /* On/Off Control */ + kHIDUsage_Csmr_SelectDisc = 0xBA, /* Named Array */ + kHIDUsage_Csmr_EnterDisc = 0xBB, /* Momentary Control */ + kHIDUsage_Csmr_Repeat = 0xBC, /* One-Shot Control */ + kHIDUsage_Csmr_Tracking = 0xBD, /* Linear Control */ + kHIDUsage_Csmr_TrackNormal = 0xBE, /* One-Shot Control */ + kHIDUsage_Csmr_SlowTracking = 0xBF, /* Linear Control */ + kHIDUsage_Csmr_FrameForward = 0xC0, /* Re-Trigger Control */ + kHIDUsage_Csmr_FrameBack = 0xC1, /* Re-Trigger Control */ + kHIDUsage_Csmr_Mark = 0xC2, /* One-Shot Control */ + kHIDUsage_Csmr_ClearMark = 0xC3, /* One-Shot Control */ + kHIDUsage_Csmr_RepeatFromMark = 0xC4, /* On/Off Control */ + kHIDUsage_Csmr_ReturnToMark = 0xC5, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkForward = 0xC6, /* One-Shot Control */ + kHIDUsage_Csmr_SearchMarkBackwards = 0xC7, /* One-Shot Control */ + kHIDUsage_Csmr_CounterReset = 0xC8, /* One-Shot Control */ + kHIDUsage_Csmr_ShowCounter = 0xC9, /* One-Shot Control */ + kHIDUsage_Csmr_TrackingIncrement = 0xCA, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrackingDecrement = 0xCB, /* Re-Trigger Control */ + kHIDUsage_Csmr_StopOrEject = 0xCC, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrPause = 0xCD, /* One-Shot Control */ + kHIDUsage_Csmr_PlayOrSkip = 0xCE, /* One-Shot Control */ + /* 0xCF - 0xDF Reserved */ + kHIDUsage_Csmr_Volume = 0xE0, /* Linear Control */ + kHIDUsage_Csmr_Balance = 0xE1, /* Linear Control */ + kHIDUsage_Csmr_Mute = 0xE2, /* On/Off Control */ + kHIDUsage_Csmr_Bass = 0xE3, /* Linear Control */ + kHIDUsage_Csmr_Treble = 0xE4, /* Linear Control */ + kHIDUsage_Csmr_BassBoost = 0xE5, /* On/Off Control */ + kHIDUsage_Csmr_SurroundMode = 0xE6, /* One-Shot Control */ + kHIDUsage_Csmr_Loudness = 0xE7, /* On/Off Control */ + kHIDUsage_Csmr_MPX = 0xE8, /* On/Off Control */ + kHIDUsage_Csmr_VolumeIncrement = 0xE9, /* Re-Trigger Control */ + kHIDUsage_Csmr_VolumeDecrement = 0xEA, /* Re-Trigger Control */ + /* 0xEB - 0xEF Reserved */ + kHIDUsage_Csmr_Speed = 0xF0, /* Selector */ + kHIDUsage_Csmr_PlaybackSpeed = 0xF1, /* Named Array */ + kHIDUsage_Csmr_StandardPlay = 0xF2, /* Selector */ + kHIDUsage_Csmr_LongPlay = 0xF3, /* Selector */ + kHIDUsage_Csmr_ExtendedPlay = 0xF4, /* Selector */ + kHIDUsage_Csmr_Slow = 0xF5, /* One-Shot Control */ + /* 0xF6 - 0xFF Reserved */ + kHIDUsage_Csmr_FanEnable = 0x100, /* On/Off Control */ + kHIDUsage_Csmr_FanSpeed = 0x101, /* Linear Control */ + kHIDUsage_Csmr_LightEnable = 0x102, /* On/Off Control */ + kHIDUsage_Csmr_LightIlluminationLevel = 0x103, /* Linear Control */ + kHIDUsage_Csmr_ClimateControlEnable = 0x104, /* On/Off Control */ + kHIDUsage_Csmr_RoomTemperature = 0x105, /* Linear Control */ + kHIDUsage_Csmr_SecurityEnable = 0x106, /* On/Off Control */ + kHIDUsage_Csmr_FireAlarm = 0x107, /* One-Shot Control */ + kHIDUsage_Csmr_PoliceAlarm = 0x108, /* One-Shot Control */ + /* 0x109 - 0x14F Reserved */ + kHIDUsage_Csmr_BalanceRight = 0x150, /* Re-Trigger Control */ + kHIDUsage_Csmr_BalanceLeft = 0x151, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassIncrement = 0x152, /* Re-Trigger Control */ + kHIDUsage_Csmr_BassDecrement = 0x153, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleIncrement = 0x154, /* Re-Trigger Control */ + kHIDUsage_Csmr_TrebleDecrement = 0x155, /* Re-Trigger Control */ + /* 0x156 - 0x15F Reserved */ + kHIDUsage_Csmr_SpeakerSystem = 0x160, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLeft = 0x161, /* Logical Collection */ + kHIDUsage_Csmr_ChannelRight = 0x162, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenter = 0x163, /* Logical Collection */ + kHIDUsage_Csmr_ChannelFront = 0x164, /* Logical Collection */ + kHIDUsage_Csmr_ChannelCenterFront = 0x165, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSide = 0x166, /* Logical Collection */ + kHIDUsage_Csmr_ChannelSurround = 0x167, /* Logical Collection */ + kHIDUsage_Csmr_ChannelLowFrequencyEnhancement = 0x168, /* Logical Collection */ + kHIDUsage_Csmr_ChannelTop = 0x169, /* Logical Collection */ + kHIDUsage_Csmr_ChannelUnknown = 0x16A, /* Logical Collection */ + /* 0x16B - 0x16F Reserved */ + kHIDUsage_Csmr_SubChannel = 0x170, /* Linear Control */ + kHIDUsage_Csmr_SubChannelIncrement = 0x171, /* One-Shot Control */ + kHIDUsage_Csmr_SubChannelDecrement = 0x172, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioIncrement = 0x173, /* One-Shot Control */ + kHIDUsage_Csmr_AlternateAudioDecrement = 0x174, /* One-Shot Control */ + /* 0x175 - 0x17F Reserved */ + kHIDUsage_Csmr_ApplicationLaunchButtons = 0x180, /* Named Array */ + kHIDUsage_Csmr_ALLaunchButtonConfigurationTool = 0x181, /* Selector */ + kHIDUsage_Csmr_ALProgrammableButtonConfiguration = 0x182, /* Selector */ + kHIDUsage_Csmr_ALConsumerControlConfiguration = 0x183, /* Selector */ + kHIDUsage_Csmr_ALWordProcessor = 0x184, /* Selector */ + kHIDUsage_Csmr_ALTextEditor = 0x185, /* Selector */ + kHIDUsage_Csmr_ALSpreadsheet = 0x186, /* Selector */ + kHIDUsage_Csmr_ALGraphicsEditor = 0x187, /* Selector */ + kHIDUsage_Csmr_ALPresentationApp = 0x188, /* Selector */ + kHIDUsage_Csmr_ALDatabaseApp = 0x189, /* Selector */ + kHIDUsage_Csmr_ALEmailReader = 0x18A, /* Selector */ + kHIDUsage_Csmr_ALNewsreader = 0x18B, /* Selector */ + kHIDUsage_Csmr_ALVoicemail = 0x18C, /* Selector */ + kHIDUsage_Csmr_ALContactsOrAddressBook = 0x18D, /* Selector */ + kHIDUsage_Csmr_ALCalendarOrSchedule = 0x18E, /* Selector */ + kHIDUsage_Csmr_ALTaskOrProjectManager = 0x18F, /* Selector */ + kHIDUsage_Csmr_ALLogOrJournalOrTimecard = 0x190, /* Selector */ + kHIDUsage_Csmr_ALCheckbookOrFinance = 0x191, /* Selector */ + kHIDUsage_Csmr_ALCalculator = 0x192, /* Selector */ + kHIDUsage_Csmr_ALAOrVCaptureOrPlayback = 0x193, /* Selector */ + kHIDUsage_Csmr_ALLocalMachineBrowser = 0x194, /* Selector */ + kHIDUsage_Csmr_ALLANOrWANBrowser = 0x195, /* Selector */ + kHIDUsage_Csmr_ALInternetBrowser = 0x196, /* Selector */ + kHIDUsage_Csmr_ALRemoteNetworkingOrISPConnect = 0x197, /* Selector */ + kHIDUsage_Csmr_ALNetworkConference = 0x198, /* Selector */ + kHIDUsage_Csmr_ALNetworkChat = 0x199, /* Selector */ + kHIDUsage_Csmr_ALTelephonyOrDialer = 0x19A, /* Selector */ + kHIDUsage_Csmr_ALLogon = 0x19B, /* Selector */ + kHIDUsage_Csmr_ALLogoff = 0x19C, /* Selector */ + kHIDUsage_Csmr_ALLogonOrLogoff = 0x19D, /* Selector */ + kHIDUsage_Csmr_ALTerminalLockOrScreensaver = 0x19E, /* Selector */ + kHIDUsage_Csmr_ALControlPanel = 0x19F, /* Selector */ + kHIDUsage_Csmr_ALCommandLineProcessorOrRun = 0x1A0, /* Selector */ + kHIDUsage_Csmr_ALProcessOrTaskManager = 0x1A1, /* Selector */ + kHIDUsage_Csmr_AL = 0x1A2, /* Selector */ + kHIDUsage_Csmr_ALNextTaskOrApplication = 0x1A3, /* Selector */ + kHIDUsage_Csmr_ALPreviousTaskOrApplication = 0x1A4, /* Selector */ + kHIDUsage_Csmr_ALPreemptiveHaltTaskOrApplication = 0x1A5, /* Selector */ + kHIDUsage_Csmr_ALIntegratedHelpCenter = 0x1A6, /* Selector */ + kHIDUsage_Csmr_ALDocuments = 0x1A7, /* Selector */ + kHIDUsage_Csmr_ALThesaurus = 0x1A8, /* Selector */ + kHIDUsage_Csmr_ALDictionary = 0x1A9, /* Selector */ + kHIDUsage_Csmr_ALDesktop = 0x1AA, /* Selector */ + kHIDUsage_Csmr_ALSpellCheck = 0x1AB, /* Selector */ + kHIDUsage_Csmr_ALGrammerCheck = 0x1AC, /* Selector */ + kHIDUsage_Csmr_ALWirelessStatus = 0x1AD, /* Selector */ + kHIDUsage_Csmr_ALKeyboardLayout = 0x1AE, /* Selector */ + kHIDUsage_Csmr_ALVirusProtection = 0x1AF, /* Selector */ + kHIDUsage_Csmr_ALEncryption = 0x1B0, /* Selector */ + kHIDUsage_Csmr_ALScreenSaver = 0x1B1, /* Selector */ + kHIDUsage_Csmr_ALAlarms = 0x1B2, /* Selector */ + kHIDUsage_Csmr_ALClock = 0x1B3, /* Selector */ + kHIDUsage_Csmr_ALFileBrowser = 0x1B4, /* Selector */ + kHIDUsage_Csmr_ALPowerStatus = 0x1B5, /* Selector */ + /* 0x1A6 - 0x1FF Reserved */ + kHIDUsage_Csmr_GenericGUIApplicationControls = 0x200, /* Named Array */ + kHIDUsage_Csmr_ACNew = 0x201, /* Selector */ + kHIDUsage_Csmr_ACOpen = 0x202, /* Selector */ + kHIDUsage_Csmr_ACClose = 0x203, /* Selector */ + kHIDUsage_Csmr_ACExit = 0x204, /* Selector */ + kHIDUsage_Csmr_ACMaximize = 0x205, /* Selector */ + kHIDUsage_Csmr_ACMinimize = 0x206, /* Selector */ + kHIDUsage_Csmr_ACSave = 0x207, /* Selector */ + kHIDUsage_Csmr_ACPrint = 0x208, /* Selector */ + kHIDUsage_Csmr_ACProperties = 0x209, /* Selector */ + kHIDUsage_Csmr_ACUndo = 0x21A, /* Selector */ + kHIDUsage_Csmr_ACCopy = 0x21B, /* Selector */ + kHIDUsage_Csmr_ACCut = 0x21C, /* Selector */ + kHIDUsage_Csmr_ACPaste = 0x21D, /* Selector */ + kHIDUsage_Csmr_AC = 0x21E, /* Selector */ + kHIDUsage_Csmr_ACFind = 0x21F, /* Selector */ + kHIDUsage_Csmr_ACFindandReplace = 0x220, /* Selector */ + kHIDUsage_Csmr_ACSearch = 0x221, /* Selector */ + kHIDUsage_Csmr_ACGoTo = 0x222, /* Selector */ + kHIDUsage_Csmr_ACHome = 0x223, /* Selector */ + kHIDUsage_Csmr_ACBack = 0x224, /* Selector */ + kHIDUsage_Csmr_ACForward = 0x225, /* Selector */ + kHIDUsage_Csmr_ACStop = 0x226, /* Selector */ + kHIDUsage_Csmr_ACRefresh = 0x227, /* Selector */ + kHIDUsage_Csmr_ACPreviousLink = 0x228, /* Selector */ + kHIDUsage_Csmr_ACNextLink = 0x229, /* Selector */ + kHIDUsage_Csmr_ACBookmarks = 0x22A, /* Selector */ + kHIDUsage_Csmr_ACHistory = 0x22B, /* Selector */ + kHIDUsage_Csmr_ACSubscriptions = 0x22C, /* Selector */ + kHIDUsage_Csmr_ACZoomIn = 0x22D, /* Selector */ + kHIDUsage_Csmr_ACZoomOut = 0x22E, /* Selector */ + kHIDUsage_Csmr_ACZoom = 0x22F, /* Selector */ + kHIDUsage_Csmr_ACFullScreenView = 0x230, /* Selector */ + kHIDUsage_Csmr_ACNormalView = 0x231, /* Selector */ + kHIDUsage_Csmr_ACViewToggle = 0x232, /* Selector */ + kHIDUsage_Csmr_ACScrollUp = 0x233, /* Selector */ + kHIDUsage_Csmr_ACScrollDown = 0x234, /* Selector */ + kHIDUsage_Csmr_ACScroll = 0x235, /* Selector */ + kHIDUsage_Csmr_ACPanLeft = 0x236, /* Selector */ + kHIDUsage_Csmr_ACPanRight = 0x237, /* Selector */ + kHIDUsage_Csmr_ACPan = 0x238, /* Selector */ + kHIDUsage_Csmr_ACNewWindow = 0x239, /* Selector */ + kHIDUsage_Csmr_ACTileHorizontally = 0x23A, /* Selector */ + kHIDUsage_Csmr_ACTileVertically = 0x23B, /* Selector */ + kHIDUsage_Csmr_ACFormat = 0x23C, /* Selector */ + /* 0x23D - 0xFFFF Reserved */ + kHIDUsage_Csmr_Reserved = 0xFFFF +}; + +/* Physical Interface Device Page (0x0F) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_PID_PhysicalInterfaceDevice = 0x01, /* CA - A collection of PID usages */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_PID_Normal = 0x20, /* DV - A force applied perpendicular to the surface of an object */ + kHIDUsage_PID_SetEffectReport = 0x21, /* XXX */ + kHIDUsage_PID_EffectBlockIndex = 0x22, /* XXX */ + kHIDUsage_PID_ParamBlockOffset = 0x23, /* XXX */ + kHIDUsage_PID_ROM_Flag = 0x24, /* XXX */ + kHIDUsage_PID_EffectType = 0x25, /* XXX */ + kHIDUsage_PID_ET_ConstantForce = 0x26, /* XXX */ + kHIDUsage_PID_ET_Ramp = 0x27, /* XXX */ + kHIDUsage_PID_ET_CustomForceData = 0x28, /* XXX */ + /* 0x29 - 0x2F Reserved */ + kHIDUsage_PID_ET_Square = 0x30, /* XXX */ + kHIDUsage_PID_ET_Sine = 0x31, /* XXX */ + kHIDUsage_PID_ET_Triangle = 0x32, /* XXX */ + kHIDUsage_PID_ET_SawtoothUp = 0x33, /* XXX */ + kHIDUsage_PID_ET_SawtoothDown = 0x34, /* XXX */ + /* 0x35 - 0x3F Reserved */ + kHIDUsage_PID_ET_Spring = 0x40, /* XXX */ + kHIDUsage_PID_ET_Damper = 0x41, /* XXX */ + kHIDUsage_PID_ET_Inertia = 0x42, /* XXX */ + kHIDUsage_PID_ET_Friction = 0x43, /* XXX */ + /* 0x44 - 0x4F Reserved */ + kHIDUsage_PID_Duration = 0x50, /* XXX */ + kHIDUsage_PID_SamplePeriod = 0x51, /* XXX */ + kHIDUsage_PID_Gain = 0x52, /* XXX */ + kHIDUsage_PID_TriggerButton = 0x53, /* XXX */ + kHIDUsage_PID_TriggerRepeatInterval = 0x54, /* XXX */ + kHIDUsage_PID_AxesEnable = 0x55, /* XXX */ + kHIDUsage_PID_DirectionEnable = 0x56, /* XXX */ + kHIDUsage_PID_Direction = 0x57, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockOffset = 0x58, /* XXX */ + kHIDUsage_PID_BlockType = 0x59, /* XXX */ + kHIDUsage_PID_SetEnvelopeReport = 0x5A, /* XXX */ + kHIDUsage_PID_AttackLevel = 0x5B, /* XXX */ + kHIDUsage_PID_AttackTime = 0x5C, /* XXX */ + kHIDUsage_PID_FadeLevel = 0x5D, /* XXX */ + kHIDUsage_PID_FadeTime = 0x5E, /* XXX */ + kHIDUsage_PID_SetConditionReport = 0x5F, /* XXX */ + + kHIDUsage_PID_CP_Offset = 0x60, /* XXX */ + kHIDUsage_PID_PositiveCoefficient = 0x61, /* XXX */ + kHIDUsage_PID_NegativeCoefficient = 0x62, /* XXX */ + kHIDUsage_PID_PositiveSaturation = 0x63, /* XXX */ + kHIDUsage_PID_NegativeSaturation = 0x64, /* XXX */ + kHIDUsage_PID_DeadBand = 0x65, /* XXX */ + kHIDUsage_PID_DownloadForceSample = 0x66, /* XXX */ + kHIDUsage_PID_IsochCustomForceEnable = 0x67, /* XXX */ + kHIDUsage_PID_CustomForceDataReport = 0x68, /* XXX */ + kHIDUsage_PID_CustomForceData = 0x69, /* XXX */ + kHIDUsage_PID_CustomForceVendorDefinedData = 0x6A, /* XXX */ + kHIDUsage_PID_SetCustomForceReport = 0x6B, /* XXX */ + kHIDUsage_PID_CustomForceDataOffset = 0x6C, /* XXX */ + kHIDUsage_PID_SampleCount = 0x6D, /* XXX */ + kHIDUsage_PID_SetPeriodicReport = 0x6E, /* XXX */ + kHIDUsage_PID_Offset = 0x6F, /* XXX */ + + kHIDUsage_PID_Magnitude = 0x70, /* XXX */ + kHIDUsage_PID_Phase = 0x71, /* XXX */ + kHIDUsage_PID_Period = 0x72, /* XXX */ + kHIDUsage_PID_SetConstantForceReport = 0x73, /* XXX */ + kHIDUsage_PID_SetRampForceReport = 0x74, /* XXX */ + kHIDUsage_PID_RampStart = 0x75, /* XXX */ + kHIDUsage_PID_RampEnd = 0x76, /* XXX */ + kHIDUsage_PID_EffectOperationReport = 0x77, /* XXX */ + kHIDUsage_PID_EffectOperation = 0x78, /* XXX */ + kHIDUsage_PID_OpEffectStart = 0x79, /* XXX */ + kHIDUsage_PID_OpEffectStartSolo = 0x7A, /* XXX */ + kHIDUsage_PID_OpEffectStop = 0x7B, /* XXX */ + kHIDUsage_PID_LoopCount = 0x7C, /* XXX */ + kHIDUsage_PID_DeviceGainReport = 0x7D, /* XXX */ + kHIDUsage_PID_DeviceGain = 0x7E, /* XXX */ + kHIDUsage_PID_PoolReport = 0x7F, /* XXX */ + + kHIDUsage_PID_RAM_PoolSize = 0x80, /* XXX */ + kHIDUsage_PID_ROM_PoolSize = 0x81, /* XXX */ + kHIDUsage_PID_ROM_EffectBlockCount = 0x82, /* XXX */ + kHIDUsage_PID_SimultaneousEffectsMax = 0x83, /* XXX */ + kHIDUsage_PID_PoolAlignment = 0x84, /* XXX */ + kHIDUsage_PID_PoolMoveReport = 0x85, /* XXX */ + kHIDUsage_PID_MoveSource = 0x86, /* XXX */ + kHIDUsage_PID_MoveDestination = 0x87, /* XXX */ + kHIDUsage_PID_MoveLength = 0x88, /* XXX */ + kHIDUsage_PID_BlockLoadReport = 0x89, /* XXX */ + /* 0x8A Reserved */ + kHIDUsage_PID_BlockLoadStatus = 0x8B, /* XXX */ + kHIDUsage_PID_BlockLoadSuccess = 0x8C, /* XXX */ + kHIDUsage_PID_BlockLoadFull = 0x8D, /* XXX */ + kHIDUsage_PID_BlockLoadError = 0x8E, /* XXX */ + kHIDUsage_PID_BlockHandle = 0x8F, /* XXX */ + + kHIDUsage_PID_BlockFreeReport = 0x90, /* XXX */ + kHIDUsage_PID_TypeSpecificBlockHandle = 0x91, /* XXX */ + kHIDUsage_PID_StateReport = 0x92, /* XXX */ + /* 0x93 Reserved */ + kHIDUsage_PID_EffectPlaying = 0x94, /* XXX */ + kHIDUsage_PID_DeviceControlReport = 0x95, /* XXX */ + kHIDUsage_PID_DeviceControl = 0x96, /* XXX */ + kHIDUsage_PID_DC_EnableActuators = 0x97, /* XXX */ + kHIDUsage_PID_DC_DisableActuators = 0x98, /* XXX */ + kHIDUsage_PID_DC_StopAllEffects = 0x99, /* XXX */ + kHIDUsage_PID_DC_DeviceReset = 0x9A, /* XXX */ + kHIDUsage_PID_DC_DevicePause = 0x9B, /* XXX */ + kHIDUsage_PID_DC_DeviceContinue = 0x9C, /* XXX */ + /* 0x9d - 0x9E Reserved */ + kHIDUsage_PID_DevicePaused = 0x9F, /* XXX */ + + kHIDUsage_PID_ActuatorsEnabled = 0xA0, /* XXX */ + /* 0xA1 - 0xA3 Reserved */ + kHIDUsage_PID_SafetySwitch = 0xA4, /* XXX */ + kHIDUsage_PID_ActuatorOverrideSwitch = 0xA5, /* XXX */ + kHIDUsage_PID_ActuatorPower = 0xA6, /* XXX */ + kHIDUsage_PID_StartDelay = 0xA7, /* XXX */ + kHIDUsage_PID_ParameterBlockSize = 0xA8, /* XXX */ + kHIDUsage_PID_DeviceManagedPool = 0xA9, /* XXX */ + kHIDUsage_PID_SharedParameterBlocks = 0xAA, /* XXX */ + kHIDUsage_PID_CreateNewEffectReport = 0xAB, /* XXX */ + kHIDUsage_PID_RAM_PoolAvailable = 0xAC, /* XXX */ + /* 0xAD - 0xFFFF Reserved */ + kHIDUsage_PID_Reserved = 0xFFFF +}; + +/* Digitizer Page (0x0D) */ +/* This section provides detailed descriptions of the usages employed by Digitizer Devices. */ +enum +{ + kHIDUsage_Dig_Digitizer = 0x01, /* Application Collection */ + kHIDUsage_Dig_Pen = 0x02, /* Application Collection */ + kHIDUsage_Dig_LightPen = 0x03, /* Application Collection */ + kHIDUsage_Dig_TouchScreen = 0x04, /* Application Collection */ + kHIDUsage_Dig_TouchPad = 0x05, /* Application Collection */ + kHIDUsage_Dig_WhiteBoard = 0x06, /* Application Collection */ + kHIDUsage_Dig_CoordinateMeasuringMachine = 0x07, /* Application Collection */ + kHIDUsage_Dig_3DDigitizer = 0x08, /* Application Collection */ + kHIDUsage_Dig_StereoPlotter = 0x09, /* Application Collection */ + kHIDUsage_Dig_ArticulatedArm = 0x0A, /* Application Collection */ + kHIDUsage_Dig_Armature = 0x0B, /* Application Collection */ + kHIDUsage_Dig_MultiplePointDigitizer = 0x0C, /* Application Collection */ + kHIDUsage_Dig_FreeSpaceWand = 0x0D, /* Application Collection */ + /* 0x0E - 0x1F Reserved */ + kHIDUsage_Dig_Stylus = 0x20, /* Logical Collection */ + kHIDUsage_Dig_Puck = 0x21, /* Logical Collection */ + kHIDUsage_Dig_Finger = 0x22, /* Logical Collection */ + /* 0x23 - 0x2F Reserved */ + kHIDUsage_Dig_TipPressure = 0x30, /* Dynamic Value */ + kHIDUsage_Dig_BarrelPressure = 0x31, /* Dynamic Value */ + kHIDUsage_Dig_InRange = 0x32, /* Momentary Control */ + kHIDUsage_Dig_Touch = 0x33, /* Momentary Control */ + kHIDUsage_Dig_Untouch = 0x34, /* One-Shot Control */ + kHIDUsage_Dig_Tap = 0x35, /* One-Shot Control */ + kHIDUsage_Dig_Quality = 0x36, /* Dynamic Value */ + kHIDUsage_Dig_DataValid = 0x37, /* Momentary Control */ + kHIDUsage_Dig_TransducerIndex = 0x38, /* Dynamic Value */ + kHIDUsage_Dig_TabletFunctionKeys = 0x39, /* Logical Collection */ + kHIDUsage_Dig_ProgramChangeKeys = 0x3A, /* Logical Collection */ + kHIDUsage_Dig_BatteryStrength = 0x3B, /* Dynamic Value */ + kHIDUsage_Dig_Invert = 0x3C, /* Momentary Control */ + kHIDUsage_Dig_XTilt = 0x3D, /* Dynamic Value */ + kHIDUsage_Dig_YTilt = 0x3E, /* Dynamic Value */ + kHIDUsage_Dig_Azimuth = 0x3F, /* Dynamic Value */ + kHIDUsage_Dig_Altitude = 0x40, /* Dynamic Value */ + kHIDUsage_Dig_Twist = 0x41, /* Dynamic Value */ + kHIDUsage_Dig_TipSwitch = 0x42, /* Momentary Control */ + kHIDUsage_Dig_SecondaryTipSwitch = 0x43, /* Momentary Control */ + kHIDUsage_Dig_BarrelSwitch = 0x44, /* Momentary Control */ + kHIDUsage_Dig_Eraser = 0x45, /* Momentary Control */ + kHIDUsage_Dig_TabletPick = 0x46, /* Momentary Control */ + /* 0x47 - 0xFFFF Reserved */ + kHIDUsage_Dig_Reserved = 0xFFFF +}; + +/* AlphanumericDisplay Page (0x14) */ +/* The Alphanumeric Display page is intended for use by simple alphanumeric displays that are used on consumer devices. */ +enum +{ + kHIDUsage_AD_AlphanumericDisplay = 0x01, /* Application Collection */ + /* 0x02 - 0x1F Reserved */ + kHIDUsage_AD_DisplayAttributesReport = 0x20, /* Logical Collection */ + kHIDUsage_AD_ASCIICharacterSet = 0x21, /* Static Flag */ + kHIDUsage_AD_DataReadBack = 0x22, /* Static Flag */ + kHIDUsage_AD_FontReadBack = 0x23, /* Static Flag */ + kHIDUsage_AD_DisplayControlReport = 0x24, /* Logical Collection */ + kHIDUsage_AD_ClearDisplay = 0x25, /* Dynamic Flag */ + kHIDUsage_AD_DisplayEnable = 0x26, /* Dynamic Flag */ + kHIDUsage_AD_ScreenSaverDelay = 0x27, /* Static Value */ + kHIDUsage_AD_ScreenSaverEnable = 0x28, /* Dynamic Flag */ + kHIDUsage_AD_VerticalScroll = 0x29, /* Static Flag */ + kHIDUsage_AD_HorizontalScroll = 0x2A, /* Static Flag */ + kHIDUsage_AD_CharacterReport = 0x2B, /* Logical Collection */ + kHIDUsage_AD_DisplayData = 0x2C, /* Dynamic Value */ + kHIDUsage_AD_DisplayStatus = 0x2D, /* Logical Collection */ + kHIDUsage_AD_StatNotReady = 0x2E, /* Selector */ + kHIDUsage_AD_StatReady = 0x2F, /* Selector */ + kHIDUsage_AD_ErrNotaloadablecharacter = 0x30, /* Selector */ + kHIDUsage_AD_ErrFontdatacannotberead = 0x31, /* Selector */ + kHIDUsage_AD_CursorPositionReport = 0x32, /* Logical Collection */ + kHIDUsage_AD_Row = 0x33, /* Dynamic Value */ + kHIDUsage_AD_Column = 0x34, /* Dynamic Value */ + kHIDUsage_AD_Rows = 0x35, /* Static Value */ + kHIDUsage_AD_Columns = 0x36, /* Static Value */ + kHIDUsage_AD_CursorPixelPositioning = 0x37, /* Static Flag */ + kHIDUsage_AD_CursorMode = 0x38, /* Dynamic Flag */ + kHIDUsage_AD_CursorEnable = 0x39, /* Dynamic Flag */ + kHIDUsage_AD_CursorBlink = 0x3A, /* Dynamic Flag */ + kHIDUsage_AD_FontReport = 0x3B, /* Logical Collection */ + kHIDUsage_AD_FontData = 0x3C, /* Buffered Byte */ + kHIDUsage_AD_CharacterWidth = 0x3D, /* Static Value */ + kHIDUsage_AD_CharacterHeight = 0x3E, /* Static Value */ + kHIDUsage_AD_CharacterSpacingHorizontal = 0x3F, /* Static Value */ + kHIDUsage_AD_CharacterSpacingVertical = 0x40, /* Static Value */ + kHIDUsage_AD_UnicodeCharacterSet = 0x41, /* Static Flag */ + /* 0x42 - 0xFFFF Reserved */ + kHIDUsage_AD_Reserved = 0xFFFF +}; + +/* Power Device Page (0x84) */ +/* This section provides detailed descriptions of the usages employed by Power Devices. */ +enum +{ + + kHIDUsage_PD_Undefined = 0x00, /* Power Device Undefined Usage */ + kHIDUsage_PD_iName = 0x01, /* CL- Power Device Name Index */ + kHIDUsage_PD_PresentStatus = 0x02, /* CL- Power Device Present Status */ + kHIDUsage_PD_ChangedStatus = 0x03, /* CA- Power Device Changed Status */ + kHIDUsage_PD_UPS = 0x04, /* CA- Uninterruptible Power Supply */ + kHIDUsage_PD_PowerSupply = 0x05, /* CA- Power Supply */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_PD_BatterySystem = 0x10, /* CP- Battery System power module */ + kHIDUsage_PD_BatterySystemID = 0x11, /* SV IF- Battery System ID */ + kHIDUsage_PD_Battery = 0x12, /* CP- Battery */ + kHIDUsage_PD_BatteryID = 0x13, /* SV IF- Battery ID */ + kHIDUsage_PD_Charger = 0x14, /* CP- Charger */ + kHIDUsage_PD_ChargerID = 0x15, /* SV IF- Charger ID */ + kHIDUsage_PD_PowerConverter = 0x16, /* CP- Power Converter power module */ + kHIDUsage_PD_PowerConverterID = 0x17, /* SV IF- Power Converter ID */ + kHIDUsage_PD_OutletSystem = 0x18, /* CP- Outlet System power module */ + kHIDUsage_PD_OutletSystemID = 0x19, /* SV IF-Outlet System ID */ + kHIDUsage_PD_Input = 0x1A, /* CP- Power Device Input */ + kHIDUsage_PD_InputID = 0x1B, /* SV IF- Power Device Input ID */ + kHIDUsage_PD_Output = 0x1C, /* CP- Power Device Output */ + kHIDUsage_PD_OutputID = 0x1D, /* SV IF- Power Device Output ID */ + kHIDUsage_PD_Flow = 0x1E, /* CP- Power Device Flow */ + kHIDUsage_PD_FlowID = 0x1F, /* Item IF- Power Device Flow ID */ + kHIDUsage_PD_Outlet = 0x20, /* CP- Power Device Outlet */ + kHIDUsage_PD_OutletID = 0x21, /* SV IF- Power Device Outlet ID */ + kHIDUsage_PD_Gang = 0x22, /* CL/CP- Power Device Gang */ + kHIDUsage_PD_GangID = 0x23, /* SV IF- Power Device Gang ID */ + kHIDUsage_PD_PowerSummary = 0x24, /* CL/CP- Power Device Power Summary */ + kHIDUsage_PD_PowerSummaryID = 0x25, /* SV IF- Power Device Power Summary ID */ + /* Reserved 0x26 - 0x2F */ + kHIDUsage_PD_Voltage = 0x30, /* DV IF- Power Device Voltage */ + kHIDUsage_PD_Current = 0x31, /* DV IF- Power Device Current */ + kHIDUsage_PD_Frequency = 0x32, /* DV IF- Power Device Frequency */ + kHIDUsage_PD_ApparentPower = 0x33, /* DV IF- Power Device Apparent Power */ + kHIDUsage_PD_ActivePower = 0x34, /* DV IF- Power Device RMS Power */ + kHIDUsage_PD_PercentLoad = 0x35, /* DV IF- Power Device Percent Load */ + kHIDUsage_PD_Temperature = 0x36, /* DV IF- Power Device Temperature */ + kHIDUsage_PD_Humidity = 0x37, /* DV IF- Power Device Humidity */ + kHIDUsage_PD_BadCount = 0x38, /* DV IF- Power Device Bad Condition Count */ + /* Reserved 0x39 - 0x3F */ + kHIDUsage_PD_ConfigVoltage = 0x40, /* SV/DV F- Power Device Nominal Voltage */ + kHIDUsage_PD_ConfigCurrent = 0x41, /* SV/DV F- Power Device Nominal Current */ + kHIDUsage_PD_ConfigFrequency = 0x42, /* SV/DV F- Power Device Nominal Frequency */ + kHIDUsage_PD_ConfigApparentPower = 0x43, /* SV/DV F- Power Device Nominal Apparent Power */ + kHIDUsage_PD_ConfigActivePower = 0x44, /* SV/DV F- Power Device Nominal RMS Power */ + kHIDUsage_PD_ConfigPercentLoad = 0x45, /* SV/DV F- Power Device Nominal Percent Load */ + kHIDUsage_PD_ConfigTemperature = 0x46, /* SV/DV F- Power Device Nominal Temperature */ + kHIDUsage_PD_ConfigHumidity = 0x47, /* SV/DV F- Power Device Nominal Humidity */ + /* Reserved 0x48 - 0x4F */ + kHIDUsage_PD_SwitchOnControl = 0x50, /* DV F- Power Device Switch On Control */ + kHIDUsage_PD_SwitchOffControl = 0x51, /* DV F- Power Device Switch Off Control */ + kHIDUsage_PD_ToggleControl = 0x52, /* DV F- Power Device Toogle Sequence Control */ + kHIDUsage_PD_LowVoltageTransfer = 0x53, /* DV F- Power Device Min Transfer Voltage */ + kHIDUsage_PD_HighVoltageTransfer = 0x54, /* DV F- Power Device Max Transfer Voltage */ + kHIDUsage_PD_DelayBeforeReboot = 0x55, /* DV F- Power Device Delay Before Reboot */ + kHIDUsage_PD_DelayBeforeStartup = 0x56, /* DV F- Power Device Delay Before Startup */ + kHIDUsage_PD_DelayBeforeShutdown = 0x57, /* DV F- Power Device Delay Before Shutdown */ + kHIDUsage_PD_Test = 0x58, /* DV F- Power Device Test Request/Result */ + kHIDUsage_PD_ModuleReset = 0x59, /* DV F- Power Device Reset Request/Result */ + kHIDUsage_PD_AudibleAlarmControl = 0x5A, /* DV F- Power Device Audible Alarm Control */ + /* Reserved 0x5B - 0x5F */ + kHIDUsage_PD_Present = 0x60, /* DV IOF- Power Device Present */ + kHIDUsage_PD_Good = 0x61, /* DV IOF- Power Device Good */ + kHIDUsage_PD_InternalFailure = 0x62, /* DV IOF- Power Device Internal Failure */ + kHIDUsage_PD_VoltageOutOfRange = 0x63, /* DV IOF- Power Device Voltage Out Of Range */ + kHIDUsage_PD_FrequencyOutOfRange = 0x64, /* DV IOF- Power Device Frequency Out Of Range */ + kHIDUsage_PD_Overload = 0x65, /* DV IOF- Power Device Overload */ + kHIDUsage_PD_OverCharged = 0x66, /* DV IOF- Power Device Over Charged */ + kHIDUsage_PD_OverTemperature = 0x67, /* DV IOF- Power Device Over Temperature */ + kHIDUsage_PD_ShutdownRequested = 0x68, /* DV IOF- Power Device Shutdown Requested */ + kHIDUsage_PD_ShutdownImminent = 0x69, /* DV IOF- Power Device Shutdown Imminent */ + /* Reserved 0x6A */ + kHIDUsage_PD_SwitchOnOff = 0x6B, /* DV IOF- Power Device On/Off Switch Status */ + kHIDUsage_PD_Switchable = 0x6C, /* DV IOF- Power Device Switchable */ + kHIDUsage_PD_Used = 0x6D, /* DV IOF- Power Device Used */ + kHIDUsage_PD_Boost = 0x6E, /* DV IOF- Power Device Boosted */ + kHIDUsage_PD_Buck = 0x6F, /* DV IOF- Power Device Bucked */ + kHIDUsage_PD_Initialized = 0x70, /* DV IOF- Power Device Initialized */ + kHIDUsage_PD_Tested = 0x71, /* DV IOF- Power Device Tested */ + kHIDUsage_PD_AwaitingPower = 0x72, /* DV IOF- Power Device Awaiting Power */ + kHIDUsage_PD_CommunicationLost = 0x73, /* DV IOF- Power Device Communication Lost */ + /* Reserved 0x74 - 0xFC */ + kHIDUsage_PD_iManufacturer = 0xFD, /* SV F- Power Device Manufacturer String Index */ + kHIDUsage_PD_iProduct = 0xFE, /* SV F- Power Device Product String Index */ + kHIDUsage_PD_iserialNumber = 0xFF /* SV F- Power Device Serial Number String Index */ +}; + +/* Battery System Page (x85) */ +/* This section provides detailed descriptions of the usages employed by Battery Systems. */ +enum +{ + kHIDUsage_BS_Undefined = 0x00, /* Battery System Undefined */ + kHIDUsage_BS_SMBBatteryMode = 0x01, /* CL - SMB Mode */ + kHIDUsage_BS_SMBBatteryStatus = 0x02, /* CL - SMB Status */ + kHIDUsage_BS_SMBAlarmWarning = 0x03, /* CL - SMB Alarm Warning */ + kHIDUsage_BS_SMBChargerMode = 0x04, /* CL - SMB Charger Mode */ + kHIDUsage_BS_SMBChargerStatus = 0x05, /* CL - SMB Charger Status */ + kHIDUsage_BS_SMBChargerSpecInfo = 0x06, /* CL - SMB Charger Extended Status */ + kHIDUsage_BS_SMBSelectorState = 0x07, /* CL - SMB Selector State */ + kHIDUsage_BS_SMBSelectorPresets = 0x08, /* CL - SMB Selector Presets */ + kHIDUsage_BS_SMBSelectorInfo = 0x09, /* CL - SMB Selector Info */ + /* Reserved 0x0A - 0x0F */ + kHIDUsage_BS_OptionalMfgFunction1 = 0x10, /* DV F - Battery System Optional SMB Mfg Function 1 */ + kHIDUsage_BS_OptionalMfgFunction2 = 0x11, /* DV F - Battery System Optional SMB Mfg Function 2 */ + kHIDUsage_BS_OptionalMfgFunction3 = 0x12, /* DV F - Battery System Optional SMB Mfg Function 3 */ + kHIDUsage_BS_OptionalMfgFunction4 = 0x13, /* DV F - Battery System Optional SMB Mfg Function 4 */ + kHIDUsage_BS_OptionalMfgFunction5 = 0x14, /* DV F - Battery System Optional SMB Mfg Function 5 */ + kHIDUsage_BS_ConnectionToSMBus = 0x15, /* DF F - Battery System Connection To System Management Bus */ + kHIDUsage_BS_OutputConnection = 0x16, /* DF F - Battery System Output Connection Status */ + kHIDUsage_BS_ChargerConnection = 0x17, /* DF F - Battery System Charger Connection */ + kHIDUsage_BS_BatteryInsertion = 0x18, /* DF F - Battery System Battery Insertion */ + kHIDUsage_BS_Usenext = 0x19, /* DF F - Battery System Use Next */ + kHIDUsage_BS_OKToUse = 0x1A, /* DF F - Battery System OK To Use */ + kHIDUsage_BS_BatterySupported = 0x1B, /* DF F - Battery System Battery Supported */ + kHIDUsage_BS_SelectorRevision = 0x1C, /* DF F - Battery System Selector Revision */ + kHIDUsage_BS_ChargingIndicator = 0x1D, /* DF F - Battery System Charging Indicator */ + /* Reserved 0x1E - 0x27 */ + kHIDUsage_BS_ManufacturerAccess = 0x28, /* DV F - Battery System Manufacturer Access */ + kHIDUsage_BS_RemainingCapacityLimit = 0x29, /* DV F - Battery System Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimit = 0x2A, /* DV F - Battery System Remaining Time Limit */ + kHIDUsage_BS_AtRate = 0x2B, /* DV F - Battery System At Rate... */ + kHIDUsage_BS_CapacityMode = 0x2C, /* DV F - Battery System Capacity Mode */ + kHIDUsage_BS_BroadcastToCharger = 0x2D, /* DV F - Battery System Broadcast To Charger */ + kHIDUsage_BS_PrimaryBattery = 0x2E, /* DV F - Battery System Primary Battery */ + kHIDUsage_BS_ChargeController = 0x2F, /* DV F - Battery System Charge Controller */ + /* Reserved 0x30 - 0x3F */ + kHIDUsage_BS_TerminateCharge = 0x40, /* DF IOF - Battery System Terminate Charge */ + kHIDUsage_BS_TerminateDischarge = 0x41, /* DF IOF - Battery System Terminate Discharge */ + kHIDUsage_BS_BelowRemainingCapacityLimit = 0x42, /* DF IOF - Battery System Below Remaining Capacity Limit */ + kHIDUsage_BS_RemainingTimeLimitExpired = 0x43, /* DF IOF - Battery System Remaining Time Limit Expired */ + kHIDUsage_BS_Charging = 0x44, /* DF IOF - Battery System Charging */ + kHIDUsage_BS_Discharging = 0x45, /* DV IOF - Battery System Discharging */ + kHIDUsage_BS_FullyCharged = 0x46, /* DF IOF - Battery System Fully Charged */ + kHIDUsage_BS_FullyDischarged = 0x47, /* DV IOF - Battery System Fully Discharged */ + kHIDUsage_BS_ConditioningFlag = 0x48, /* DV IOF - Battery System Conditioning Flag */ + kHIDUsage_BS_AtRateOK = 0x49, /* DV IOF - Battery System At Rate OK */ + kHIDUsage_BS_SMBErrorCode = 0x4A, /* DF IOF - Battery System SMB Error Code */ + kHIDUsage_BS_NeedReplacement = 0x4B, /* DF IOF - Battery System Need Replacement */ + /* Reserved 0x4C - 0x5F */ + kHIDUsage_BS_AtRateTimeToFull = 0x60, /* DV IF - Battery System At Rate Time To Full */ + kHIDUsage_BS_AtRateTimeToEmpty = 0x61, /* DV IF - Battery System At Rate Time To Empty */ + kHIDUsage_BS_AverageCurrent = 0x62, /* DV IF - Battery System Average Current */ + kHIDUsage_BS_Maxerror = 0x63, /* DV IF - Battery System Max Error */ + kHIDUsage_BS_RelativeStateOfCharge = 0x64, /* DV IF - Battery System Relative State Of Charge */ + kHIDUsage_BS_AbsoluteStateOfCharge = 0x65, /* DV IF - Battery System Absolute State Of Charge */ + kHIDUsage_BS_RemainingCapacity = 0x66, /* DV IF - Battery System Remaining Capacity */ + kHIDUsage_BS_FullChargeCapacity = 0x67, /* DV IF - Battery System Full Charge Capacity */ + kHIDUsage_BS_RunTimeToEmpty = 0x68, /* DV IF - Battery System Run Time To Empty */ + kHIDUsage_BS_AverageTimeToEmpty = 0x69, /* DV IF - Battery System Average Time To Empty */ + kHIDUsage_BS_AverageTimeToFull = 0x6A, /* DV IF - Battery System Average Time To Full */ + kHIDUsage_BS_CycleCount = 0x6B, /* DV IF - Battery System Cycle Count */ + /* Reserved 0x6C - 0x7F */ + kHIDUsage_BS_BattPackModelLevel = 0x80, /* SV F - Battery System Batt Pack Model Level */ + kHIDUsage_BS_InternalChargeController = 0x81, /* SF F - Battery System Internal Charge Controller */ + kHIDUsage_BS_PrimaryBatterySupport = 0x82, /* SF F - Battery System Primary Battery Support */ + kHIDUsage_BS_DesignCapacity = 0x83, /* SV F - Battery System Design Capacity */ + kHIDUsage_BS_SpecificationInfo = 0x84, /* SV F - Battery System Specification Info */ + kHIDUsage_BS_ManufacturerDate = 0x85, /* SV F - Battery System Manufacturer Date */ + kHIDUsage_BS_SerialNumber = 0x86, /* SV F - Battery System Serial Number */ + kHIDUsage_BS_iManufacturerName = 0x87, /* SV F - Battery System Manufacturer Name Index */ + kHIDUsage_BS_iDevicename = 0x88, /* SV F - Battery System Device Name Index */ + kHIDUsage_BS_iDeviceChemistry = 0x89, /* SV F - Battery System Device Chemistry Index */ + kHIDUsage_BS_ManufacturerData = 0x8A, /* SV F - Battery System Manufacturer Data */ + kHIDUsage_BS_Rechargable = 0x8B, /* SV F - Battery System Rechargable */ + kHIDUsage_BS_WarningCapacityLimit = 0x8C, /* SV F - Battery System Warning Capacity Limit */ + kHIDUsage_BS_CapacityGranularity1 = 0x8D, /* SV F - Battery System Capacity Granularity 1 */ + kHIDUsage_BS_CapacityGranularity2 = 0x8E, /* SV F - Battery System Capacity Granularity 2 */ + kHIDUsage_BS_iOEMInformation = 0x8F, /* SV F - Battery System OEM Information Index */ + /* Reserved 0x90 - 0xBF */ + kHIDUsage_BS_InhibitCharge = 0xC0, /* DF IOF - Battery System Inhibit Charge */ + kHIDUsage_BS_EnablePolling = 0xC1, /* DF IOF - Battery System Enable Polling */ + kHIDUsage_BS_ResetToZero = 0xC2, /* DF IOF - Battery System Reset To Zero */ + /* Reserved 0xC3 - 0xCF */ + kHIDUsage_BS_ACPresent = 0xD0, /* DF IOF - Battery System AC Present */ + kHIDUsage_BS_BatteryPresent = 0xD1, /* DF IOF - Battery System Battery Present */ + kHIDUsage_BS_PowerFail = 0xD2, /* DF IOF - Battery System Power Fail */ + kHIDUsage_BS_AlarmInhibited = 0xD3, /* DF IOF - Battery System Alarm Inhibited */ + kHIDUsage_BS_ThermistorUnderRange = 0xD4, /* DF IOF - Battery System Thermistor Under Range */ + kHIDUsage_BS_ThermistorHot = 0xD5, /* DF IOF - Battery System Thermistor Hot */ + kHIDUsage_BS_ThermistorCold = 0xD6, /* DF IOF - Battery System Thermistor Cold */ + kHIDUsage_BS_ThermistorOverRange = 0xD7, /* DF IOF - Battery System Thermistor Over Range */ + kHIDUsage_BS_VoltageOutOfRange = 0xD8, /* DF IOF - Battery System Voltage Out Of Range */ + kHIDUsage_BS_CurrentOutOfRange = 0xD9, /* DF IOF - Battery System Current Out Of Range */ + kHIDUsage_BS_CurrentNotRegulated = 0xDA, /* DF IOF - Battery System Current Not Regulated */ + kHIDUsage_BS_VoltageNotRegulated = 0xDB, /* DF IOF - Battery System Voltage Not Regulated */ + kHIDUsage_BS_MasterMode = 0xDC, /* DF IOF - Battery System Master Mode */ + /* Reserved 0xDD - 0xEF */ + kHIDUsage_BS_ChargerSelectorSupport = 0xF0, /* SF F- Battery System Charger Support Selector */ + kHIDUsage_BS_ChargerSpec = 0xF1, /* SF F- Battery System Charger Specification */ + kHIDUsage_BS_Level2 = 0xF2, /* SF F- Battery System Charger Level 2 */ + kHIDUsage_BS_Level3 = 0xF3 /* SF F- Battery System Charger Level 3 */ + /* Reserved 0xF2 - 0xFF */ +}; + +/* Bar Code Scanner Page (0x8C) */ +/* This section provides detailed descriptions of the usages employed by Bar Code Scanner Devices. */ +enum +{ + kHIDUsage_BCS_Undefined = 0x00, /* Bar Code Scanner Undefined Usage */ + kHIDUsage_BCS_BadgeReader = 0x01, /* CA - Bar Code Badge Reader */ + kHIDUsage_BCS_BarCodeScanner = 0x02, /* CA -Bar Code Scanner */ + kHIDUsage_BCS_DumbBarCodeScanner = 0x03, /* CA -Dumb Bar Code Scanner Usage */ + kHIDUsage_BCS_CordlessScannerBase = 0x04, /* CA -Cordless Base Usage */ + kHIDUsage_BCS_BarCodeScannerCradle = 0x05, /* CA -Bar Code Scanner Cradle Usage */ + /* Reserved 0x06 - 0x0F */ + kHIDUsage_BCS_AttributeReport = 0x10, /* CL - Attribute Report */ + kHIDUsage_BCS_SettingsReport = 0x11, /* CL - Settings Report */ + kHIDUsage_BCS_ScannedDataReport = 0x12, /* CL - Scanned Data Report */ + kHIDUsage_BCS_RawScannedDataReport = 0x13, /* CL - Raw Scanned Data Report */ + kHIDUsage_BCS_TriggerReport = 0x14, /* CL - Trigger Report */ + kHIDUsage_BCS_StatusReport = 0x15, /* CL - Status Report */ + kHIDUsage_BCS_UPC_EANControlReport = 0x16, /* CL - UPC/EAN Control Report */ + kHIDUsage_BCS_EAN2_3LabelControlReport = 0x17, /* CL - EAN 2/3 Label Control Report */ + kHIDUsage_BCS_Code39ControlReport = 0x18, /* CL - Code 39 Control Report */ + kHIDUsage_BCS_Interleaved2of5ControlReport = 0x19, /* CL - Interleaved 2 of 5 Control Report */ + kHIDUsage_BCS_Standard2of5ControlReport = 0x1A, /* CL - Standard 2 of 5 Control Report */ + kHIDUsage_BCS_MSIPlesseyControlReport = 0x1B, /* CL - MSI Plessey Control Report */ + kHIDUsage_BCS_CodabarControlReport = 0x1C, /* CL - Codabar Control Report */ + kHIDUsage_BCS_Code128ControlReport = 0x1D, /* CL - Code 128 Control Report */ + kHIDUsage_BCS_Misc1DControlReport = 0x1E, /* CL - Misc 1D Control Report */ + kHIDUsage_BCS_2DControlReport = 0x1F, /* CL - 2D Control Report */ + /* Reserved 0x20 - 0x2F */ + kHIDUsage_BCS_Aiming_PointerMide = 0x30, /* SF - Aiming Pointer Mode */ + kHIDUsage_BCS_BarCodePresentSensor = 0x31, /* SF - Bar Code Present Sensor */ + kHIDUsage_BCS_Class1ALaser = 0x32, /* SF - Class 1A Laser */ + kHIDUsage_BCS_Class2Laser = 0x33, /* SF - Class 2 Laser */ + kHIDUsage_BCS_HeaterPresent = 0x34, /* SF - Heater Present */ + kHIDUsage_BCS_ContactScanner = 0x35, /* SF - Contact Scanner */ + kHIDUsage_BCS_ElectronicArticleSurveillanceNotification = 0x36, /* SF - Electronic Article Surveillance Notification */ + kHIDUsage_BCS_ConstantElectronicArticleSurveillance = 0x37, /* SF - Constant Electronic Article Surveillance */ + kHIDUsage_BCS_ErrorIndication = 0x38, /* SF - Error Indication */ + kHIDUsage_BCS_FixedBeeper = 0x39, /* SF - Fixed Beeper */ + kHIDUsage_BCS_GoodDecodeIndication = 0x3A, /* SF - Good Decode Indication */ + kHIDUsage_BCS_HandsFreeScanning = 0x3B, /* SF - Hands Free Scanning */ + kHIDUsage_BCS_IntrinsicallySafe = 0x3C, /* SF - Intrinsically Safe */ + kHIDUsage_BCS_KlasseEinsLaser = 0x3D, /* SF - Klasse Eins Laser */ + kHIDUsage_BCS_LongRangeScanner = 0x3E, /* SF - Long Range Scanner */ + kHIDUsage_BCS_MirrorSpeedControl = 0x3F, /* SF - Mirror Speed Control */ + kHIDUsage_BCS_NotOnFileIndication = 0x40, /* SF - Not On File Indication */ + kHIDUsage_BCS_ProgrammableBeeper = 0x41, /* SF - Programmable Beeper */ + kHIDUsage_BCS_Triggerless = 0x42, /* SF - Triggerless */ + kHIDUsage_BCS_Wand = 0x43, /* SF - Wand */ + kHIDUsage_BCS_WaterResistant = 0x44, /* SF - Water Resistant */ + kHIDUsage_BCS_MultiRangeScanner = 0x45, /* SF - Multi-Range Scanner */ + kHIDUsage_BCS_ProximitySensor = 0x46, /* SF - Proximity Sensor */ + /* Reserved 0x47 - 0x4C */ + kHIDUsage_BCS_FragmentDecoding = 0x4D, /* DF - Fragment Decoding */ + kHIDUsage_BCS_ScannerReadConfidence = 0x4E, /* DV - Scanner Read Confidence */ + kHIDUsage_BCS_DataPrefix = 0x4F, /* NAry - Data Prefix */ + kHIDUsage_BCS_PrefixAIMI = 0x50, /* SEL - Prefix AIMI */ + kHIDUsage_BCS_PrefixNone = 0x51, /* SEL - Prefix None */ + kHIDUsage_BCS_PrefixProprietary = 0x52, /* SEL - Prefix Proprietary */ + /* Reserved 0x53 - 0x54 */ + kHIDUsage_BCS_ActiveTime = 0x55, /* DV - Active Time */ + kHIDUsage_BCS_AimingLaserPattern = 0x56, /* DF - Aiming Laser Pattern */ + kHIDUsage_BCS_BarCodePresent = 0x57, /* OOC - Bar Code Present */ + kHIDUsage_BCS_BeeperState = 0x58, /* OOC - Beeper State */ + kHIDUsage_BCS_LaserOnTime = 0x59, /* DV - Laser On Time */ + kHIDUsage_BCS_LaserState = 0x5A, /* OOC - Laser State */ + kHIDUsage_BCS_LockoutTime = 0x5B, /* DV - Lockout Time */ + kHIDUsage_BCS_MotorState = 0x5C, /* OOC - Motor State */ + kHIDUsage_BCS_MotorTimeout = 0x5D, /* DV - Motor Timeout */ + kHIDUsage_BCS_PowerOnResetScanner = 0x5E, /* DF - Power On Reset Scanner */ + kHIDUsage_BCS_PreventReadOfBarcodes = 0x5F, /* DF - Prevent Read of Barcodes */ + kHIDUsage_BCS_InitiateBarcodeRead = 0x60, /* DF - Initiate Barcode Read */ + kHIDUsage_BCS_TriggerState = 0x61, /* DF - Trigger State */ + kHIDUsage_BCS_TriggerMode = 0x62, /* NAry - Trigger Mode */ + kHIDUsage_BCS_TriggerModeBlinkingLaserOn = 0x63, /* SEL - Trigger Mode Blinking Laser On */ + kHIDUsage_BCS_TriggerModeContinuousLaserOn = 0x64, /* SEL - Trigger Mode Continuous Laser On */ + kHIDUsage_BCS_TriggerModeLaserOnWhilePulled = 0x65, /* SEL - Trigger Mode Laser on while Pulled */ + kHIDUsage_BCS_TriggerModeLaserStaysOnAfterTriggerRelease = 0x66, /* SEL - Trigger Mode Laser stays on after Trigger Release */ + /* Reserved 0x67 - 0x6C */ + kHIDUsage_BCS_CommitParametersToNVM = 0x6D, /* DF - Commit Parameters to NVM */ + kHIDUsage_BCS_ParameterScanning = 0x6E, /* DF - Parameter Scanning */ + kHIDUsage_BCS_ParametersChanged = 0x6F, /* OOC - Parameters Changed */ + kHIDUsage_BCS_SetParameterDefaultValues = 0x70, /* DF - Set parameter default values */ + /* Reserved 0x71 - 0x74 */ + kHIDUsage_BCS_ScannerInCradle = 0x75, /* OOC - Scanner In Cradle */ + kHIDUsage_BCS_ScannerInRange = 0x76, /* OOC - Scanner In Range */ + /* Reserved 0x77 - 0x79 */ + kHIDUsage_BCS_AimDuration = 0x7A, /* DV - Aim Duration */ + kHIDUsage_BCS_GoodReadLampDuration = 0x7B, /* DV - Good Read Lamp Duration */ + kHIDUsage_BCS_GoodReadLampIntensity = 0x7C, /* DV - Good Read Lamp Intensity */ + kHIDUsage_BCS_GoodReadLED = 0x7D, /* DF - Good Read LED */ + kHIDUsage_BCS_GoodReadToneFrequency = 0x7E, /* DV - Good Read Tone Frequency*/ + kHIDUsage_BCS_GoodReadToneLength = 0x7F, /* DV - Good Read Tone Length */ + kHIDUsage_BCS_GoodReadToneVolume = 0x80, /* DV - Good Read Tone Volume */ + /* Reserved 0x81 */ + kHIDUsage_BCS_NoReadMessage = 0x82, /* DF - No Read Message */ + kHIDUsage_BCS_NotOnFileVolume = 0x83, /* DV - Not on File Volume */ + kHIDUsage_BCS_PowerupBeep = 0x84, /* DF - Powerup Beep */ + kHIDUsage_BCS_SoundErrorBeep = 0x85, /* DF - Sound Error Beep */ + kHIDUsage_BCS_SoundGoodReadBeep = 0x86, /* DF - Sound Good Read Beep */ + kHIDUsage_BCS_SoundNotOnFileBeep = 0x87, /* DF - Sound Not On File Beep */ + kHIDUsage_BCS_GoodReadWhenToWrite = 0x88, /* NArry - Good Read When to Write */ + kHIDUsage_BCS_GRWTIAfterDecode = 0x89, /* SEL - GRWTI After Decode */ + kHIDUsage_BCS_GRWTIBeep_LampAfterTransmit = 0x8A, /* SEL - GRWTI Beep/Lamp after transmit */ + kHIDUsage_BCS_GRWTINoBeep_LampUseAtAll = 0x8B, /* SEL - GRWTI No Beep/Lamp at all */ + /* Reserved 0x8C - 0x90 */ + kHIDUsage_BCS_BooklandEAN = 0x91, /* DF - Bookland EAN */ + kHIDUsage_BCS_ConvertEAN8To13Type = 0x92, /* DF - Convert EAN 8 to 13 Type */ + kHIDUsage_BCS_ConvertUPCAToEAN_13 = 0x93, /* DF - Convert UPC A to EAN-13 */ + kHIDUsage_BCS_ConvertUPC_EToA = 0x94, /* DF - Convert UPC-E to A */ + kHIDUsage_BCS_EAN_13 = 0x95, /* DF - EAN-13 */ + kHIDUsage_BCS_EAN_8 = 0x96, /* DF - EAN_8 */ + kHIDUsage_BCS_EAN_99_128_Mandatory = 0x97, /* DF - EAN-99 128_Mandatory */ + kHIDUsage_BCS_EAN_99_P5_128_Optional = 0x98, /* DF - EAN-99 P5/128_Optional */ + /* Reserved 0x99 */ + kHIDUsage_BCS_UPC_EAN = 0x9A, /* DF - UPC/EAN */ + kHIDUsage_BCS_UPC_EANCouponCode = 0x9B, /* DF - UPC/EAN Coupon Code */ + kHIDUsage_BCS_UPC_EANPeriodicals = 0x9C, /* DV - UPC/EAN Periodicals */ + kHIDUsage_BCS_UPC_A = 0x9D, /* DF - UPC-A */ + kHIDUsage_BCS_UPC_AWith128Mandatory = 0x9E, /* DF - UPC-A with 128 Mandatory */ + kHIDUsage_BCS_UPC_AWith128Optical = 0x9F, /* DF - UPC-A with 128 Optical */ + kHIDUsage_BCS_UPC_AWithP5Optional = 0xA0, /* DF - UPC-A with P5 Optional */ + kHIDUsage_BCS_UPC_E = 0xA1, /* DF - UPC-E */ + kHIDUsage_BCS_UPC_E1 = 0xA2, /* DF - UPC-E1 */ + /* Reserved 0xA3 - 0xA8 */ + kHIDUsage_BCS_Periodical = 0xA9, /* NArry - Periodical */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus2 = 0xAA,/* SEL - Periodical Auto-Discriminate + 2 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus2 = 0xAB, /* SEL - Periodical Only Decode with + 2 */ + kHIDUsage_BCS_PeriodicalIgnorePlus2 = 0xAC, /* SEL - Periodical Ignore + 2 */ + kHIDUsage_BCS_PeriodicalAutoDiscriminatePlus5 = 0xAD,/* SEL - Periodical Auto-Discriminate + 5 */ + kHIDUsage_BCS_PeriodicalOnlyDecodeWithPlus5 = 0xAE, /* SEL - Periodical Only Decode with + 5 */ + kHIDUsage_BCS_PeriodicalIgnorePlus5 = 0xAF, /* SEL - Periodical Ignore + 5 */ + kHIDUsage_BCS_Check = 0xB0, /* NArry - Check */ + kHIDUsage_BCS_CheckDisablePrice = 0xB1, /* SEL - Check Disable Price */ + kHIDUsage_BCS_CheckEnable4DigitPrice = 0xB2, /* SEL - Check Enable 4 digit Price */ + kHIDUsage_BCS_CheckEnable5DigitPrice = 0xB3, /* SEL - Check Enable 5 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean4DigitPrice = 0xB4,/* SEL - Check Enable European 4 digit Price */ + kHIDUsage_BCS_CheckEnableEuropean5DigitPrice = 0xB5,/* SEL - Check Enable European 5 digit Price */ + /* Reserved 0xB6 */ + kHIDUsage_BCS_EANTwoLabel = 0xB7, /* DF - EAN Two Label */ + kHIDUsage_BCS_EANThreeLabel = 0xB8, /* DF - EAN Thread Label */ + kHIDUsage_BCS_EAN8FlagDigit1 = 0xB9, /* DV - EAN 8 Flag Digit 1 */ + kHIDUsage_BCS_EAN8FlagDigit2 = 0xBA, /* DV - EAN 8 Flag Digit 2 */ + kHIDUsage_BCS_EAN8FlagDigit3 = 0xBB, /* DV - EAN 8 Flag Digit 3 */ + kHIDUsage_BCS_EAN13FlagDigit1 = 0xBC, /* DV - EAN 13 Flag Digit 1 */ + kHIDUsage_BCS_EAN13FlagDigit2 = 0xBD, /* DV - EAN 13 Flag Digit 2 */ + kHIDUsage_BCS_EAN13FlagDigit3 = 0xBE, /* DV - EAN 13 Flag Digit 3 */ + kHIDUsage_BCS_AddEAN2_3LabelDefinition = 0xBF, /* DF - Add EAN 2/3 Label Definition */ + kHIDUsage_BCS_ClearAllEAN2_3LabelDefinitions = 0xC0,/* DF - Clear all EAN 2/3 Label Definitions */ + /* Reserved 0xC1 - 0xC2 */ + kHIDUsage_BCS_Codabar = 0xC3, /* DF - Codabar */ + kHIDUsage_BCS_Code128 = 0xC4, /* DF - Code 128 */ + /* Reserved 0xC5 - 0xC6 */ + kHIDUsage_BCS_Code39 = 0xC7, /* DF - Code 39 */ + kHIDUsage_BCS_Code93 = 0xC8, /* DF - Code 93 */ + kHIDUsage_BCS_FullASCIIConversion = 0xC9, /* DF - Full ASCII Conversion */ + kHIDUsage_BCS_Interleaved2of5 = 0xCA, /* DF - Interleaved 2 of 5 */ + kHIDUsage_BCS_ItalianPharmacyCode = 0xCB, /* DF - Italian Pharmacy Code */ + kHIDUsage_BCS_MSI_Plessey = 0xCC, /* DF - MSI/Plessey */ + kHIDUsage_BCS_Standard2of5IATA = 0xCD, /* DF - Standard 2 of 5 IATA */ + kHIDUsage_BCS_Standard2of5 = 0xCE, /* DF - Standard 2 of 5 */ + /* Reserved 0xCF - 0xD2 */ + kHIDUsage_BCS_TransmitStart_Stop = 0xD3, /* DF - Transmit Start/Stop */ + kHIDUsage_BCS_TriOptic = 0xD4, /* DF - Tri-Optic */ + kHIDUsage_BCS_UCC_EAN_128 = 0xD5, /* DF - UCC/EAN-128 */ + kHIDUsage_BCS_CheckDigit = 0xD6, /* NArry - Check Digit */ + kHIDUsage_BCS_CheckDigitDisable = 0xD7, /* SEL - Check Digit Disable */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5OPCC = 0xD8, /* SEL - Check Digit Enable Interleaved 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableInterleaved2of5USS = 0xD9, /* SEL - Check Digit Enable Interleaved 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5OPCC = 0xD8, /* SEL - Check Digit Enable Standard 2 of 5 OPCC */ + kHIDUsage_BCS_CheckDigitEnableStandard2of5USS = 0xD9, /* SEL - Check Digit Enable Standard 2 of 5 USS */ + kHIDUsage_BCS_CheckDigitEnableOneMSIPlessey = 0xDC, /* SEL - Check Digit Enable One MSI Plessey */ + kHIDUsage_BCS_CheckDigitEnableTwoMSIPlessey = 0xDD, /* SEL - Check Digit Enable Two MSI Plessey */ + kHIDUsage_BCS_CheckDigitCodabarEnable = 0xDE, /* SEL - Check Digit Codabar Enable */ + kHIDUsage_BCS_CheckDigitCode99Enable = 0xDF, /* SEL - Check Digit Code 99 Enable */ + /* Reserved 0xE0 - 0xEF */ + kHIDUsage_BCS_TransmitCheckDigit = 0xF0, /* NArry - Transmit Check Digit */ + kHIDUsage_BCS_DisableCheckDigitTransmit = 0xF1, /* SEL - Disable Check Digit Transmit */ + kHIDUsage_BCS_EnableCheckDigitTransmit = 0xF2, /* SEL - Enable Check Digit Transmit */ + /* Reserved 0xF3 - 0xFA */ + kHIDUsage_BCS_SymbologyIdentifier1 = 0xFB, /* DV - Symbology Identifier 1 */ + kHIDUsage_BCS_SymbologyIdentifier2 = 0xFC, /* DV - Symbology Identifier 2 */ + kHIDUsage_BCS_SymbologyIdentifier3 = 0xFD, /* DV - Symbology Identifier 3 */ + kHIDUsage_BCS_DecodedData = 0xFE, /* DV - Decoded Data */ + kHIDUsage_BCS_DecodeDataContinued = 0xFF, /* DF - Decode Data Continued */ + kHIDUsage_BCS_BarSpaceData = 0x100, /* DV - Bar Space Data */ + kHIDUsage_BCS_ScannerDataAccuracy = 0x101, /* DV - Scanner Data Accuracy */ + kHIDUsage_BCS_RawDataPolarity = 0x102, /* NArry - Raw Data Polarity */ + kHIDUsage_BCS_PolarityInvertedBarCode = 0x103, /* SEL - Polarity Inverted Bar Code */ + kHIDUsage_BCS_PolarityNormalBarCode = 0x103, /* SEL - Polarity Normal Bar Code */ + /* Reserved 0x105 */ + kHIDUsage_BCS_MinimumLengthToDecode = 0x106, /* DV - Minimum Length to Decode */ + kHIDUsage_BCS_MaximumLengthToDecode = 0x107, /* DV - Maximum Length to Decode */ + kHIDUsage_BCS_FirstDiscreteLengthToDecode = 0x108, /* DV - First Discrete Length to Decode */ + kHIDUsage_BCS_SecondDiscreteLengthToDecode = 0x109, /* DV - Second Discrete Length to Decode */ + kHIDUsage_BCS_DataLengthMethod = 0x10A, /* NArry - Data Length Method */ + kHIDUsage_BCS_DLMethodReadAny = 0x10B, /* DF - DL Method Read any */ + kHIDUsage_BCS_DLMethodCheckInRange = 0x10C, /* DF - DL Method Check in Range */ + kHIDUsage_BCS_DLMethodCheckForDiscrete = 0x10D, /* DF - DL Method Check for Discrete */ + /* Reserved 0x10E - 0x10F */ + kHIDUsage_BCS_AztecCode = 0x110, /* DF - Aztec Code */ + kHIDUsage_BCS_BC412 = 0x111, /* DF - BC412 */ + kHIDUsage_BCS_ChannelCode = 0x112, /* DF - Channel Code */ + kHIDUsage_BCS_Code16 = 0x113, /* DF - Code 16 */ + kHIDUsage_BCS_Code32 = 0x114, /* DF - Code 32 */ + kHIDUsage_BCS_Code49 = 0x115, /* DF - Code 49 */ + kHIDUsage_BCS_CodeOne = 0x116, /* DF - Code One */ + kHIDUsage_BCS_Colorcode = 0x117, /* DF - Colorcode */ + kHIDUsage_BCS_DataMatrix = 0x118, /* DF - Data Matrix */ + kHIDUsage_BCS_MaxiCode = 0x119, /* DF - MaxiCode */ + kHIDUsage_BCS_MicroPDF = 0x11A, /* DF - MicroPDF */ + kHIDUsage_BCS_PDF_417 = 0x11B, /* DF - PDF-417 */ + kHIDUsage_BCS_PosiCode = 0x11C, /* DF - PosiCode */ + kHIDUsage_BCS_QRCode = 0x11D, /* DF - QR Code */ + kHIDUsage_BCS_SuperCode = 0x11E, /* DF - SuperCode */ + kHIDUsage_BCS_UltraCode = 0x11F, /* DF - UltraCode */ + kHIDUsage_BCS_USB_5_SlugCode = 0x120, /* DF - USD-5 (Slug Code) */ + kHIDUsage_BCS_VeriCode = 0x121 /* DF - VeriCode */ + /* Reserved 0x122 - 0xFFFF */ +}; + +/* Weighing Devices Page (0x8D) */ +/* This section provides detailed descriptions of the usages employed by Weighing Devices. */ +enum +{ + kHIDUsage_WD_Undefined = 0x00, /* Weighing Device Undefined Usage */ + kHIDUsage_WD_WeighingDevice = 0x01, /* CA - Weighing Device */ + /* Reserved 0x02 - 0x1F */ + kHIDUsage_WD_ScaleScaleDevice = 0x20, /* CL - Scale Device */ + kHIDUsage_WD_ScaleScaleClassIMetricCL = 0x21, /* CL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIMetric = 0x22, /* SEL - Scale Class I Metric */ + kHIDUsage_WD_ScaleScaleClassIIMetric = 0x23, /* SEL - Scale Class II Metric */ + kHIDUsage_WD_ScaleScaleClassIIIMetric = 0x24, /* SEL - Scale Class III Metric */ + kHIDUsage_WD_ScaleScaleClassIIILMetric = 0x25, /* SEL - Scale Class IIIL Metric */ + kHIDUsage_WD_ScaleScaleClassIVMetric = 0x26, /* SEL - Scale Class IV Metric */ + kHIDUsage_WD_ScaleScaleClassIIIEnglish = 0x27, /* SEL - Scale Class III English */ + kHIDUsage_WD_ScaleScaleClassIIILEnglish = 0x28, /* SEL - Scale Class IIIL English */ + kHIDUsage_WD_ScaleScaleClassIVEnglish = 0x29, /* SEL - Scale Class IV English */ + kHIDUsage_WD_ScaleScaleClassGeneric = 0x2A, /* SEL - Scale Class Generic */ + /* Reserved 0x2B - 0x2F */ + kHIDUsage_WD_ScaleAtrributeReport = 0x30, /* CL - Scale Attribute Report */ + kHIDUsage_WD_ScaleControlReport = 0x31, /* CL - Scale Control Report */ + kHIDUsage_WD_ScaleDataReport = 0x32, /* CL - Scale Data Report */ + kHIDUsage_WD_ScaleStatusReport = 0x33, /* CL - Scale Status Report */ + kHIDUsage_WD_ScaleWeightLimitReport = 0x34, /* CL - Scale Weight Limit Report */ + kHIDUsage_WD_ScaleStatisticsReport = 0x35, /* CL - Scale Statistics Report */ + /* Reserved 0x36 - 0x3F */ + kHIDUsage_WD_DataWeight = 0x40, /* DV - Data Weight */ + kHIDUsage_WD_DataScaling = 0x41, /* DV - Data Scaling */ + /* Reserved 0x42 - 0x4F */ + kHIDUsage_WD_WeightUnit = 0x50, /* CL - Weight Unit */ + kHIDUsage_WD_WeightUnitMilligram = 0x51, /* SEL - Weight Unit Milligram */ + kHIDUsage_WD_WeightUnitGram = 0x52, /* SEL - Weight Unit Gram */ + kHIDUsage_WD_WeightUnitKilogram = 0x53, /* SEL - Weight Unit Kilogram */ + kHIDUsage_WD_WeightUnitCarats = 0x54, /* SEL - Weight Unit Carats */ + kHIDUsage_WD_WeightUnitTaels = 0x55, /* SEL - Weight Unit Taels */ + kHIDUsage_WD_WeightUnitGrains = 0x56, /* SEL - Weight Unit Grains */ + kHIDUsage_WD_WeightUnitPennyweights = 0x57, /* SEL - Weight Unit Pennyweights */ + kHIDUsage_WD_WeightUnitMetricTon = 0x58, /* SEL - Weight Unit Metric Ton */ + kHIDUsage_WD_WeightUnitAvoirTon = 0x59, /* SEL - Weight Unit Avoir Ton */ + kHIDUsage_WD_WeightUnitTroyOunce = 0x5A, /* SEL - Weight Unit Troy Ounce */ + kHIDUsage_WD_WeightUnitOunce = 0x5B, /* SEL - Weight Unit Ounce */ + kHIDUsage_WD_WeightUnitPound = 0x5C, /* SEL - Weight Unit Pound */ + /* Reserved 0x5D - 0x5F */ + kHIDUsage_WD_CalibrationCount = 0x60, /* DV - Calibration Count */ + kHIDUsage_WD_RezeroCount = 0x61, /* DV - Re-Zero Count*/ + /* Reserved 0x62 - 0x6F */ + kHIDUsage_WD_ScaleStatus = 0x70, /* CL - Scale Status */ + kHIDUsage_WD_ScaleStatusFault = 0x71, /* SEL - Scale Status Fault */ + kHIDUsage_WD_ScaleStatusStableAtZero = 0x72, /* SEL - Scale Status Stable at Center of Zero */ + kHIDUsage_WD_ScaleStatusInMotion = 0x73, /* SEL - Scale Status In Motion */ + kHIDUsage_WD_ScaleStatusWeightStable = 0x74, /* SEL - Scale Status Weight Stable */ + kHIDUsage_WD_ScaleStatusUnderZero = 0x75, /* SEL - Scale Status Under Zero */ + kHIDUsage_WD_ScaleStatusOverWeightLimit = 0x76, /* SEL - Scale Status Over Weight Limit */ + kHIDUsage_WD_ScaleStatusRequiresCalibration = 0x77, /* SEL - Scale Status Requires Calibration */ + kHIDUsage_WD_ScaleStatusRequiresRezeroing = 0x78, /* SEL - Scale Status Requires Re-zeroing */ + /* Reserved 0x79 - 0x7F */ + kHIDUsage_WD_ZeroScale = 0x80, /* OOC - Zero Scale */ + kHIDUsage_WD_EnforcedZeroReturn = 0x81 /* OOC - Enforced Zero Return */ + /* Reserved 0x82 - 0xFFFF */ + +}; + +/* Magnetic Stripe Reader Page (0x8E) */ +/* This section provides detailed descriptions of the usages employed by Magnetic Stripe Reader Devices. */ +enum +{ + kHIDUsage_MSR_Undefined = 0x00, /* MagStripe Undefined Usage */ + kHIDUsage_MSR_DeviceReadOnly = 0x01, /* CA - MSR Device Read-Only */ + /* Reserved 0x02 - 0x10 */ + kHIDUsage_MSR_Track1Length = 0x11, /* SF, DF, SEL - Track 1 Length */ + kHIDUsage_MSR_Track2Length = 0x12, /* SF, DF, SEL - Track 2 Length */ + kHIDUsage_MSR_Track3Length = 0x13, /* SF, DF, SEL - Track 3 Length */ + kHIDUsage_MSR_TrackJISLength = 0x14, /* SF, DF, SEL - Track JIS Length */ + /* Reserved 0x15 - 0x1F */ + kHIDUsage_MSR_TrackData = 0x20, /* SF, DF, SEL - Track Data */ + kHIDUsage_MSR_Track1Data = 0x21, /* SF, DF, SEL - Track 1 Data */ + kHIDUsage_MSR_Track2Data = 0x22, /* SF, DF, SEL - Track 2 Data */ + kHIDUsage_MSR_Track3Data = 0x23, /* SF, DF, SEL - Track 3 Data */ + kHIDUsage_MSR_TrackJISData = 0x24 /* SF, DF, SEL - Track JIS Data */ + /* Reserved 0x25 - 0xFFFF */ +}; + +#endif /* _IOHIDUSAGETABLES_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIDevice.h b/i386/include/IOKit/hidsystem/IOHIDevice.h new file mode 100644 index 0000000..bb705a8 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIDevice.h @@ -0,0 +1,71 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * IOHIDevice.h - Common Event Source object class. + * + * HISTORY + * 22 May 1992 Mike Paquette at NeXT + * Created. + * 4 Aug 1993 Erik Kay at NeXT + * API cleanup + * 5 Aug 1993 Erik Kay at NeXT + * added ivar space for future expansion + */ + +#ifndef _IOHIDEVICE_H +#define _IOHIDEVICE_H + +#include +#include + +typedef enum { + kHIUnknownDevice = 0, + kHIKeyboardDevice = 1, + kHIRelativePointingDevice = 2 +} IOHIDKind; + +class IOHIDevice : public IOService +{ + OSDeclareDefaultStructors(IOHIDevice); + +public: + virtual bool init(OSDictionary * properties = 0); + virtual void free(); + virtual bool start(IOService * provider); + virtual bool open( IOService * forClient, + IOOptionBits options = 0, + void * arg = 0 ); + + virtual UInt32 deviceType(); + virtual IOHIDKind hidKind(); + virtual UInt32 interfaceID(); + virtual bool updateProperties(void); + virtual IOReturn setProperties( OSObject * properties ); + virtual IOReturn setParamProperties(OSDictionary * dict); + virtual UInt64 getGUID(); + + static SInt32 GenerateKey(OSObject *object); +}; + +#endif /* !_IOHIDEVICE_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIKeyboard.h b/i386/include/IOKit/hidsystem/IOHIKeyboard.h new file mode 100644 index 0000000..f6db152 --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIKeyboard.h @@ -0,0 +1,268 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * EventSrcPCKeyboard.h - PC Keyboard EventSrc subclass definition + * + * HISTORY + * 28 Aug 1992 Joe Pasqua + * Created. + */ + +#ifndef _IOHIKEYBOARD_H +#define _IOHIKEYBOARD_H + +#include +#include + +/* Start Action Definitions */ + +/* + * HISTORICAL NOTE: + * The following entry points were part of the IOHIKeyboardEvents + * protocol. + */ + +typedef void (*KeyboardEventAction)( OSObject * target, + /* eventFlags */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + +typedef void (*KeyboardSpecialEventAction)(OSObject * target, + /* eventType */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* source id */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + +typedef void (*UpdateEventFlagsAction)( OSObject * target, + /* flags */ unsigned flags); + +/* Event Callback Definitions */ + +typedef void (*KeyboardEventCallback)( + /* target */ OSObject * target, + /* eventFlags */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*KeyboardSpecialEventCallback)( + /* target */ OSObject * target, + /* eventType */ unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* source id */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*UpdateEventFlagsCallback)( + /* target */ OSObject * target, + /* flags */ unsigned flags, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +/* End Action Definitions */ + + + +/* Default key repeat parameters */ +#define EV_DEFAULTINITIALREPEAT 500000000ULL // 1/2 sec in nanoseconds +#define EV_DEFAULTKEYREPEAT 83333333ULL // 1/12 sec in nanoseconds +#define EV_MINKEYREPEAT 16700000ULL // 1/60 sec + +class IOHIKeyboard : public IOHIDevice +{ + OSDeclareDefaultStructors(IOHIKeyboard); + + friend class IOHIDKeyboardDevice; + friend class IOHIDKeyboard; + friend class IOHIDConsumer; + +protected: + IOLock * _deviceLock; // Lock for all device access + IOHIKeyboardMapper * _keyMap; // KeyMap instance + + // The following fields describe the kind of keyboard + UInt32 _interfaceType; + UInt32 _deviceType; + + // The following fields describe the state of the keyboard + UInt32 * _keyState; // kbdBitVector + IOByteCount _keyStateSize; // kbdBitVector allocated size + unsigned _eventFlags; // Current eventFlags + bool _alphaLock; // true means alpha lock is on + bool _numLock; // true means num lock is on + bool _charKeyActive; // true means char gen. key active + + // The following fields are used in performing key repeats + bool _isRepeat; // true means we're generating repeat + unsigned _codeToRepeat; // What we are repeating + bool _calloutPending; // true means we've sched. a callout + AbsoluteTime _lastEventTime; // Time last event was dispatched + AbsoluteTime _downRepeatTime; // Time when we should next repeat + AbsoluteTime _keyRepeat; // Delay between key repeats + AbsoluteTime _initialKeyRepeat; // Delay before initial key repeat + UInt64 _guid; + + OSObject * _keyboardEventTarget; + KeyboardEventAction _keyboardEventAction; + OSObject * _keyboardSpecialEventTarget; + KeyboardSpecialEventAction _keyboardSpecialEventAction; + OSObject * _updateEventFlagsTarget; + UpdateEventFlagsAction _updateEventFlagsAction; + +protected: + virtual void dispatchKeyboardEvent(unsigned int keyCode, + /* direction */ bool goingDown, + /* timeStamp */ AbsoluteTime time); + +public: + virtual bool init(OSDictionary * properties = 0); + virtual bool start(IOService * provider); + virtual void stop(IOService * provider); + virtual void free(); + + virtual bool open(IOService * client, + IOOptionBits options, + KeyboardEventAction keAction, + KeyboardSpecialEventAction kseAction, + UpdateEventFlagsAction uefAction); + + bool open( IOService * client, + IOOptionBits options, + void *, + KeyboardEventCallback keCallback, + KeyboardSpecialEventCallback kseCallback, + UpdateEventFlagsCallback uefCallback); + + virtual void close(IOService * client, IOOptionBits ); + + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ); + + virtual IOHIDKind hidKind(); + virtual bool updateProperties( void ); + virtual IOReturn setParamProperties(OSDictionary * dict); + virtual IOReturn setProperties( OSObject * properties ); + + inline bool isRepeat() {return _isRepeat;} + +protected: // for subclasses to implement + virtual const unsigned char * defaultKeymapOfLength(UInt32 * length); + virtual void setAlphaLockFeedback(bool val); + virtual void setNumLockFeedback(bool val); + virtual UInt32 maxKeyCodes(); + + +private: + virtual bool resetKeyboard(); + virtual void scheduleAutoRepeat(); + static void _autoRepeat(void * arg, void *); + virtual void autoRepeat(); + virtual void setRepeat(unsigned eventType, unsigned keyCode); + void setRepeatMode(bool repeat); + static void _createKeyboardNub(thread_call_param_t param0, thread_call_param_t param1); + +/* + * HISTORICAL NOTE: + * The following methods were part of the KeyMapDelegate protocol; + * the declarations have now been merged directly into this class. + */ + +public: + virtual void keyboardEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned keyCode, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet); + + virtual void keyboardSpecialEvent(unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned keyCode, + /* specialty */ unsigned flavor); + + virtual void updateEventFlags(unsigned flags); // Does not generate events + + virtual unsigned eventFlags(); // Global event flags + virtual unsigned deviceFlags(); // per-device event flags + virtual void setDeviceFlags(unsigned flags); // Set device event flags + virtual bool alphaLock(); // current alpha-lock state + virtual void setAlphaLock(bool val); // Set current alpha-lock state + virtual bool numLock(); + virtual void setNumLock(bool val); + virtual bool charKeyActive(); // Is a character gen. key down? + virtual void setCharKeyActive(bool val); // Note that a char gen key is down. + virtual bool doesKeyLock(unsigned key); //does key lock physically + virtual unsigned getLEDStatus(); //check hardware for LED status + +private: + static void _keyboardEvent( IOHIKeyboard * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* charCode */ unsigned charCode, + /* charSet */ unsigned charSet, + /* originalCharCode */ unsigned origCharCode, + /* originalCharSet */ unsigned origCharSet, + /* keyboardType */ unsigned keyboardType, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + static void _keyboardSpecialEvent( + IOHIKeyboard * self, + unsigned eventType, + /* flags */ unsigned flags, + /* keyCode */ unsigned key, + /* specialty */ unsigned flavor, + /* guid */ UInt64 guid, + /* repeat */ bool repeat, + /* atTime */ AbsoluteTime ts); + + static void _updateEventFlags( IOHIKeyboard * self, + unsigned flags); /* Does not generate events */ + +}; + +#endif /* !_IOHIKEYBOARD_H */ diff --git a/i386/include/IOKit/hidsystem/IOHIKeyboardMapper.h b/i386/include/IOKit/hidsystem/IOHIKeyboardMapper.h new file mode 100644 index 0000000..374d25c --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIKeyboardMapper.h @@ -0,0 +1,350 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIKEYBOARDMAPPER_H +#define _IOHIKEYBOARDMAPPER_H + +#include +#include +#include +#include + +class IOHIKeyboard; +class IOHIDSystem; + +/* + * Key ip/down state is tracked in a bit list. Bits are set + * for key-down, and cleared for key-up. The bit vector and macros + * for it's manipulation are defined here. + */ + +typedef UInt32 * kbdBitVector; + +#define EVK_BITS_PER_UNIT 32 +#define EVK_BITS_MASK 31 +#define EVK_BITS_SHIFT 5 // 1<<5 == 32, for cheap divide + +#define EVK_KEYDOWN(n, bits) \ + (bits)[((n)>>EVK_BITS_SHIFT)] |= (1 << ((n) & EVK_BITS_MASK)) + +#define EVK_KEYUP(n, bits) \ + (bits)[((n)>>EVK_BITS_SHIFT)] &= ~(1 << ((n) & EVK_BITS_MASK)) + +#define EVK_IS_KEYDOWN(n, bits) \ + (((bits)[((n)>>EVK_BITS_SHIFT)] & (1 << ((n) & EVK_BITS_MASK))) != 0) + +/* the maximum number of modifier keys sticky keys can hold at once */ +#define kMAX_MODIFIERS 5 + +/* the number of shift keys in a row that must be depressed to toggle state */ +#define kNUM_SHIFTS_TO_ACTIVATE 5 + +/* the number of milliseconds all the shifts must be pressed in - 30 seconds (30000 mS)*/ +#define kDEFAULT_SHIFTEXPIREINTERVAL 30000 + + +// sticky keys state flags +enum +{ + kState_Disabled_Flag = 0x0001, // disabled and will do nothing until this is changed + kState_ShiftActivates_Flag = 0x0002, // the 'on' gesture (5 shifts) will activate + kState_On = 0x0004, // currently on, will hold down modifiers when pressed + kState_On_ModifiersDown = 0x0008, // one or more modifiers being held down + + kState_Mask = 0x00FF, // mask for all states +}; + +typedef struct _stickyKeys_ToggleInfo +{ + // size of this allocation + IOByteCount size; + + // which modifier key we are tracking (using NX_WHICHMODMASK) + unsigned toggleModifier; + + // the number of times the modifier must be pressed to toggle + unsigned repetitionsToToggle; + + // how long the user has to press the modifier repetitionsToToggle times + // the default is 30 seconds + AbsoluteTime expireInterval; + + // the number of times the modifier used within the alloted time + unsigned currentCount; + + // the times that the last shift must occer for this one to be used + // this array will actually be of size repetitionsToToggle + AbsoluteTime deadlines[1]; +} StickyKeys_ToggleInfo; + +// Flags for each sticky key modifier +// This will allow for chording of keys +// and for key locking +enum +{ + kModifier_DidPerformModifiy = 0x01, + kModifier_DidKeyUp = 0x02, + kModifier_Locked = 0x04, +}; +typedef struct _stickyKeys_ModifierInfo +{ + UInt8 key; // Key code of the sticky modifier + UInt8 state; // The state of the sticky modifier + UInt8 leftModBit; // System Mod bit of the sticky modifier +} StickyKeys_ModifierInfo; + +class IOHIDKeyboardDevice; + +class IOHIKeyboardMapper : public OSObject +{ + OSDeclareDefaultStructors(IOHIKeyboardMapper); + +private: + IOHIKeyboard * _delegate; // KeyMap delegate + bool _mappingShouldBeFreed; // true if map can be IOFree'd + NXParsedKeyMapping _parsedMapping; // current system-wide keymap + IOHIDSystem * _hidSystem; // target of IOHIKeyboard (should be IOHIDSystem) + + // binary compatibility padding + struct ExpansionData { + + // This is for F12 eject + UInt16 f12Eject_State; + UInt32 eject_Delay_MS; + IOTimerEventSource *ejectTimerEventSource; + + // This is for sticky keys + kbdBitVector cached_KeyBits; + StickyKeys_ModifierInfo stickyKeys_StuckModifiers[kMAX_MODIFIERS]; + IOInterruptEventSource *stickyKeysMouseClickEventSource; + IOInterruptEventSource *stickyKeysSetFnStateEventSource; + // The following should really be statics, but placing here + // to match design by predecesor. + OSDictionary *offFnParamDict; + OSDictionary *onFnParamDict; + + // This is for SlowKeys + UInt16 slowKeys_State; + UInt32 slowKeys_Delay_MS; + IOTimerEventSource *slowKeysTimerEventSource; + + // stored for slowKeysPostProcess + UInt8 slowKeys_Aborted_Key; + UInt8 slowKeys_Current_Key; + + UInt32 specialKeyModifierFlags; + + bool supportsF12Eject; + + SInt32 modifierSwap_Modifiers[NX_NUMMODIFIERS]; + + unsigned char * cachedAlphaLockModDefs; + }; + ExpansionData * _reserved; // Reserved for future use. (Internal use only) + +public: + static IOHIKeyboardMapper * keyboardMapper( + IOHIKeyboard * delegate, + const UInt8 * mapping, + UInt32 mappingLength, + bool mappingShouldBeFreed ); + + virtual bool init(IOHIKeyboard * delegate, + const UInt8 * mapping, + UInt32 mappingLength, + bool mappingShouldBeFreed); + virtual void free(); + + virtual const UInt8 * mapping(); + virtual UInt32 mappingLength(); + virtual bool serialize(OSSerialize *s) const; + + virtual void translateKeyCode(UInt8 key, bool keyDown, kbdBitVector keyBits); + virtual UInt8 getParsedSpecialKey(UInt8 logical); //retrieve a key from _parsedMapping + + virtual void setKeyboardTarget (IOService * keyboardTarget); + + virtual bool updateProperties (void); + virtual IOReturn setParamProperties (OSDictionary * dict); + + // keyEventPostProcess is called while a lock is not held, so a recursive + // call back into HIKeyboard is possible + virtual void keyEventPostProcess (void); + +private: + static void makeNumberParamProperty( OSDictionary * dict, const char * key, + unsigned long long number, unsigned int bits ); + + + virtual bool parseKeyMapping(const UInt8 * mapping, + UInt32 mappingLength, + NXParsedKeyMapping * parsedMapping) const; + + virtual void calcModBit(int bit, kbdBitVector keyBits); + virtual void doModCalc(int key, kbdBitVector keyBits); + virtual void doCharGen(int keyCode, bool down); + + /* sticky keys functionality */ +private: + // original translateKeyCode + void rawTranslateKeyCode (UInt8 key, bool keyDown, kbdBitVector keyBits); + bool modifierSwapFilterKey(UInt8 * key); + + // the current state of stickyKeys + UInt32 _stickyKeys_State; + + // the number of modifiers being held down by stickyKeys + int _stickyKeys_NumModifiersDown; + + ////////////////////////////////////////////////////////////// + // THE FOLLOWING CLASS VARIABLE HAS BEEN DEPRECATED + // + // PLEASE USE _stickyKeys_StuckModifiers + // + UInt8 _stickyKeys_Modifiers[kMAX_MODIFIERS]; + ////////////////////////////////////////////////////////////// + + // contains the info needed to keep track of shift repetitions + StickyKeys_ToggleInfo * _stickyKeys_ShiftToggle; + + // contains the info needed to keep track of option repetitions + StickyKeys_ToggleInfo * _stickyKeys_OptionToggle; + + // dictionaries with cached on and off states, used to set params when state changes + bool _stateDirty; + OSDictionary * _onParamDict; + OSDictionary * _offParamDict; + + // init/free vars + bool stickyKeysinit (void); + void stickyKeysfree (void); + + // allocate/free a StickyKeys_ToggleInfo struct + static StickyKeys_ToggleInfo * stickyKeysAllocToggleInfo (unsigned maxCount); + static void stickyKeysFreeToggleInfo (StickyKeys_ToggleInfo * toggleInfo); + + // create on/off dicts as part of init + bool createParamDicts (void); + + // post special keyboard events thru the event system + void postKeyboardSpecialEvent (unsigned subtype, unsigned eventType=NX_SYSDEFINED); + + // check any modifier to see if it is pressed 5 times + // based on StickyKeys_ToggleInfo + bool stickyKeysModifierToggleCheck( + StickyKeys_ToggleInfo * toggleInfo, + UInt8 key, + bool keyDown, + kbdBitVector keyBits, + bool mouseClick = false); + + // non-modifier key pressed + void stickyKeysNonModifierKey (UInt8 key, bool keyDown, kbdBitVector keyBits, bool mouseClick = false); + + // modifier key pressed (shift, command, option, control) + bool stickyKeysModifierKey (UInt8 key, bool keyDown, kbdBitVector keyBits); + + // main entry point, called for all keys (returns true if key handled) + bool stickyKeysFilterKey (UInt8 key, bool keyDown, kbdBitVector keyBits, bool mouseClick = false); + + // called by interrupt event source to inform sticky keys of mouse down event + static void stickyKeysMouseUp(IOHIKeyboardMapper *owner, IOEventSource *sender); + + void stickyKeysCleanup(); + + // called by interrupt event source to restore prior fn state + static void stickyKeysSetFnState(IOHIKeyboardMapper *owner, IOEventSource *sender); + + /* F12 Eject Functionality */ +private: + + // Determining f12 eject key press + // Returns true if f12 held down for a predetermined period of time. + bool f12EjectFilterKey (UInt8 key, bool keyDown, kbdBitVector keyBits); + + // Timer function for eject + static void performF12Eject(IOHIKeyboardMapper *owner, IOTimerEventSource *sender); + + /* SlowKeys Functionality */ +private: + // Slow keys methods + bool slowKeysFilterKey (UInt8 key, bool keyDown, kbdBitVector keyBits); + + static void slowKeysPostProcess (IOHIKeyboardMapper *owner, IOTimerEventSource *sender); + + +public: + OSMetaClassDeclareReservedUsed(IOHIKeyboardMapper, 0); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + // binary compatibility padding + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 1); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 2); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 3); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 4); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 5); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 6); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 7); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 8); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 9); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 10); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 11); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 12); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 13); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 14); + OSMetaClassDeclareReservedUnused(IOHIKeyboardMapper, 15); +}; + +#endif _IOHIKEYBOARDMAPPER_H + +/* + * HISTORICAL NOTE: + * The "delegate" object had to respond to the following protocol; + * this protocol has since been merged into the IOHIKeyboard class. + * + * @protocol KeyMapDelegate + * + * - keyboardEvent :(unsigned)eventType + * flags :(unsigned)flags + * keyCode :(unsigned)keyCode + * charCode:(unsigned)charCode + * charSet :(unsigned)charSet + * originalCharCode:(unsigned)origCharCode + * originalCharSet:(unsigned)origCharSet; + * + * - keyboardSpecialEvent:(unsigned)eventType + * flags :(unsigned)flags + * keyCode :(unsigned)keyCode + * specialty:(unsigned)flavor; + * + * - updateEventFlags:(unsigned)flags; // Does not generate events + * + * - (unsigned)eventFlags; // Global event flags + * - (unsigned)deviceFlags; // per-device event flags + * - setDeviceFlags:(unsigned)flags; // Set device event flags + * - (bool)alphaLock; // current alpha-lock state + * - setAlphaLock:(bool)val; // Set current alpha-lock state + * - (bool)charKeyActive; // Is a character gen. key down? + * - setCharKeyActive:(bool)val; // Note that a char gen key is down. + * + * @end + */ diff --git a/i386/include/IOKit/hidsystem/IOHIPointing.h b/i386/include/IOKit/hidsystem/IOHIPointing.h new file mode 100644 index 0000000..1df225a --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOHIPointing.h @@ -0,0 +1,280 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _IOHIPOINTING_H +#define _IOHIPOINTING_H + +#include +#include +#include + +/* Start Action Definitions */ + +/* + * HISTORICAL NOTE: + * The following entry points were part of the IOHIPointingEvents + * protocol. + */ +typedef void (*RelativePointerEventAction)(OSObject * target, + /* buttons */ int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + +typedef void (*AbsolutePointerEventAction)(OSObject * target, + /* buttons */ int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + +typedef void (*ScrollWheelEventAction)(OSObject * target, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +/* Event Callback Definitions */ + +typedef void (*RelativePointerEventCallback)( + /* target */ OSObject * target, + /* buttons */ int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*AbsolutePointerEventCallback)( + /* target */ OSObject * target, + /* buttons */ int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +typedef void (*ScrollWheelEventCallback)( + /* target */ OSObject * target, + /* delta1 */ short deltaAxis1, + /* delta2 */ short deltaAxis2, + /* delta3 */ short deltaAxis3, + /* fixedDelta1 */ IOFixed fixedDelta1, + /* fixedDelta2 */ IOFixed fixedDelta2, + /* fixedDelta3 */ IOFixed fixedDelta3, + /* pointDelta1 */ SInt32 pointDelta1, + /* pointDelta2 */ SInt32 pointDelta2, + /* pointDelta3 */ SInt32 pointDelta3, + /* reserved */ SInt32 options, + /* atTime */ AbsoluteTime ts, + /* sender */ OSObject * sender, + /* refcon */ void * refcon); + +/* End Action Definitions */ + +/* Default accel level parameters */ +#define EV_DEFAULTPOINTERACCELLEVEL 0x0000b000 +#define EV_DEFAULTSCROLLACCELLEVEL 0x00005000 + +class IOHIDPointingDevice; +struct ScrollAccelInfo; + +class IOHIPointing : public IOHIDevice +{ + OSDeclareDefaultStructors(IOHIPointing); + + friend class IOHITablet; + friend class IOHIDPointing; + +private: + IOLock * _deviceLock; // Lock for all device access + int _buttonMode; // The "handedness" of the pointer + IOFixed _acceleration; + bool _convertAbsoluteToRelative; + bool _contactToMove; + bool _hadContact; + IOGPoint _previousLocation; + UInt8 _pressureThresholdToClick; // A scale factor of 0 to 255 to determine how much pressure is necessary to generate a primary mouse click - a value of 255 means no click will be generated + void * _scaleSegments; + IOItemCount _scaleSegCount; + IOFixed _fractX; + IOFixed _fractY; + + OSObject * _relativePointerEventTarget; + RelativePointerEventAction _relativePointerEventAction; + OSObject * _absolutePointerEventTarget; + AbsolutePointerEventAction _absolutePointerEventAction; + OSObject * _scrollWheelEventTarget; + ScrollWheelEventAction _scrollWheelEventAction; + + struct ExpansionData { + UInt32 scrollType; + + ScrollAccelInfo * scrollWheelInfo; + ScrollAccelInfo * scrollPointerInfo; + + IOFixed scrollFixedDeltaAxis1; + IOFixed scrollFixedDeltaAxis2; + IOFixed scrollFixedDeltaAxis3; + SInt32 scrollPointDeltaAxis1; + SInt32 scrollPointDeltaAxis2; + SInt32 scrollPointDeltaAxis3; + UInt32 scrollButtonMask; + + // Added to post events to the HID Manager + IOHIDPointingDevice * hidPointingNub; + IOService * openClient; + + bool isSeized; + UInt32 accelerateMode; + + UInt32 scrollZoomMask; + bool lastScrollWasZoom; + bool scrollOff; + }; + + ExpansionData * _reserved; + + void setPointingMode(UInt32 accelerateMode); + UInt32 getPointingMode (); + void setScrollType(UInt32 scrollType); + UInt32 getScrollType(); + + void dispatchScrollWheelEventWithAccelInfo( + SInt32 deltaAxis1, + SInt32 deltaAxis2, + SInt32 deltaAxis3, + ScrollAccelInfo * info, + AbsoluteTime ts); + + +protected: + virtual void dispatchRelativePointerEvent(int dx, + int dy, + UInt32 buttonState, + AbsoluteTime ts); + + virtual void dispatchAbsolutePointerEvent(IOGPoint * newLoc, + IOGBounds * bounds, + UInt32 buttonState, + bool proximity, + int pressure, + int pressureMin, + int pressureMax, + int stylusAngle, + AbsoluteTime ts); + + virtual void dispatchScrollWheelEvent(short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +public: + virtual bool init(OSDictionary * properties = 0); + virtual bool start(IOService * provider); + virtual void free(); + + virtual bool open(IOService * client, + IOOptionBits options, + RelativePointerEventAction rpeAction, + AbsolutePointerEventAction apeAction, + ScrollWheelEventAction sweAction); + + bool open( IOService * client, + IOOptionBits options, + void *, + RelativePointerEventCallback rpeCallback, + AbsolutePointerEventCallback apeCallback, + ScrollWheelEventCallback sweCallback); + + virtual void close(IOService * client, IOOptionBits ); + virtual IOReturn message( UInt32 type, IOService * provider, + void * argument = 0 ); + + virtual IOHIDKind hidKind(); + virtual bool updateProperties( void ); + virtual IOReturn setParamProperties( OSDictionary * dict ); + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags powerFlags, + unsigned long newState, IOService * device); + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags powerFlags, + unsigned long newState, IOService * device); + +protected: // for subclasses to implement + virtual OSData * copyAccelerationTable(); + virtual IOItemCount buttonCount(); + virtual IOFixed resolution(); + + // RY: Adding method to copy scroll wheel accel table. + // Unfortunately, we don't have any padding, so this + // is going to be non-virtual. + /*virtual*/ OSData * copyScrollAccelerationTable(); + +private: + virtual bool resetPointer(); + virtual void scalePointer(int * dxp, int * dyp); + virtual void setupForAcceleration(IOFixed accl); + + // RY: Adding methods to support scroll wheel accel. + // Unfortunately, we don't have any padding, so these + // are going to be non-virtual. + /*virtual*/ bool resetScroll(); + /*virtual*/ void setupScrollForAcceleration(IOFixed accl); + + // RY: We have to make sure that subclasses that will + // take advantage of this have their defined resolution + // in their property table. + /*virtual*/ IOFixed scrollResolutionForType(SInt32 type=-1); + /*virtual*/ IOFixed scrollReportRate(); + /*virtual*/ OSData * copyScrollAccelerationTableForType(SInt32 type=-1); + +private: + static void _relativePointerEvent( IOHIPointing * self, + int buttons, + /* deltaX */ int dx, + /* deltaY */ int dy, + /* atTime */ AbsoluteTime ts); + + /* Tablet event reporting */ + static void _absolutePointerEvent(IOHIPointing * self, + int buttons, + /* at */ IOGPoint * newLoc, + /* withBounds */ IOGBounds *bounds, + /* inProximity */ bool proximity, + /* withPressure */ int pressure, + /* withAngle */ int stylusAngle, + /* atTime */ AbsoluteTime ts); + + /* Mouse scroll wheel event reporting */ + static void _scrollWheelEvent(IOHIPointing *self, + short deltaAxis1, + short deltaAxis2, + short deltaAxis3, + AbsoluteTime ts); + +}; + +#endif /* !_IOHIPOINTING_H */ diff --git a/i386/include/IOKit/hidsystem/IOLLEvent.h b/i386/include/IOKit/hidsystem/IOLLEvent.h new file mode 100644 index 0000000..53fd70c --- /dev/null +++ b/i386/include/IOKit/hidsystem/IOLLEvent.h @@ -0,0 +1,558 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2009 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/****************************************************************************** + event.h (PostScript side version) + + CONFIDENTIAL + Copyright (c) 1988 NeXT, Inc. as an unpublished work. + All Rights Reserved. + + Created Leo 01Mar88 + + Modified: + 04May88 Leo Final event types and record + 22Aug88 Leo Change short -> int for window, add reserved + 26May90 Ted Added NX_UNDIMMASK to correct triggering of UndoAutoDim + 12Dec91 Mike Brought into sync with dpsclient/event.h, and fixed + the #ifndef interlock with dpsclient/event.h that was + broken during the Great Header Revision. + + The PostScript version of this file differs from the + Window Kit version in that the coordinates here are + ints instead of floats. +******************************************************************************/ + +#ifndef _DEV_EVENT_H +#define _DEV_EVENT_H + +#include +#include + +#ifdef EVENT_H /* Interlock with dpsclient/event.h */ +#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/ +#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */ +#define _NXSize_ NXSize +#endif /* _NXSIZE_ */ +#else /* EVENT_H */ /* Haven't seen dpsclient/event.h, so define away */ +#define EVENT_H + +#ifdef KERNEL +#else /* KERNEL */ + +#if !defined(_NXSIZE_) /* Work around patch for old event.h in Phase 3 projs*/ +#define _NXSIZE_ 1 /* NXCoord, NXPoint, NXSize decl seen */ +typedef float NXCoord; + +typedef struct _NXPoint { /* point */ + NXCoord x, y; +} NXPoint; + +typedef struct _NXSize { /* size */ + NXCoord width, height; +} NXSize; +#define _NXSize_ NXSize /* Correct usage in event_status_driver.h */ +#endif /* _NXSIZE_ */ + +#endif /* KERNEL */ + +/* Event types */ + +#define NX_NULLEVENT 0 /* internal use */ + +/* mouse events */ + +#define NX_LMOUSEDOWN 1 /* left mouse-down event */ +#define NX_LMOUSEUP 2 /* left mouse-up event */ +#define NX_RMOUSEDOWN 3 /* right mouse-down event */ +#define NX_RMOUSEUP 4 /* right mouse-up event */ +#define NX_MOUSEMOVED 5 /* mouse-moved event */ +#define NX_LMOUSEDRAGGED 6 /* left mouse-dragged event */ +#define NX_RMOUSEDRAGGED 7 /* right mouse-dragged event */ +#define NX_MOUSEENTERED 8 /* mouse-entered event */ +#define NX_MOUSEEXITED 9 /* mouse-exited event */ + +/* other mouse events + * + * event.data.mouse.buttonNumber should contain the + * button number (2-31) changing state. + */ +#define NX_OMOUSEDOWN 25 /* other mouse-down event */ +#define NX_OMOUSEUP 26 /* other mouse-up event */ +#define NX_OMOUSEDRAGGED 27 /* other mouse-dragged event */ + +/* keyboard events */ + +#define NX_KEYDOWN 10 /* key-down event */ +#define NX_KEYUP 11 /* key-up event */ +#define NX_FLAGSCHANGED 12 /* flags-changed event */ + +/* composite events */ + +#define NX_KITDEFINED 13 /* application-kit-defined event */ +#define NX_SYSDEFINED 14 /* system-defined event */ +#define NX_APPDEFINED 15 /* application-defined event */ +/* There are additional DPS client defined events past this point. */ + +/* Scroll wheel events */ + +#define NX_SCROLLWHEELMOVED 22 + +/* Zoom events */ +#define NX_ZOOM 28 + +/* tablet events */ + +#define NX_TABLETPOINTER 23 /* for non-mousing transducers */ +#define NX_TABLETPROXIMITY 24 /* for non-mousing transducers */ + +/* event range */ + +#define NX_FIRSTEVENT 0 +#define NX_LASTEVENT 28 +#define NX_NUMPROCS (NX_LASTEVENT-NX_FIRSTEVENT+1) + +/* Event masks */ +#define NX_NULLEVENTMASK (1 << NX_NULLEVENT) /* NULL event */ +#define NX_LMOUSEDOWNMASK (1 << NX_LMOUSEDOWN) /* left mouse-down */ +#define NX_LMOUSEUPMASK (1 << NX_LMOUSEUP) /* left mouse-up */ +#define NX_RMOUSEDOWNMASK (1 << NX_RMOUSEDOWN) /* right mouse-down */ +#define NX_RMOUSEUPMASK (1 << NX_RMOUSEUP) /* right mouse-up */ +#define NX_OMOUSEDOWNMASK (1 << NX_OMOUSEDOWN) /* other mouse-down */ +#define NX_OMOUSEUPMASK (1 << NX_OMOUSEUP) /* other mouse-up */ +#define NX_MOUSEMOVEDMASK (1 << NX_MOUSEMOVED) /* mouse-moved */ +#define NX_LMOUSEDRAGGEDMASK (1 << NX_LMOUSEDRAGGED) /* left-dragged */ +#define NX_RMOUSEDRAGGEDMASK (1 << NX_RMOUSEDRAGGED) /* right-dragged */ +#define NX_OMOUSEDRAGGEDMASK (1 << NX_OMOUSEDRAGGED) /* other-dragged */ +#define NX_MOUSEENTEREDMASK (1 << NX_MOUSEENTERED) /* mouse-entered */ +#define NX_MOUSEEXITEDMASK (1 << NX_MOUSEEXITED) /* mouse-exited */ +#define NX_KEYDOWNMASK (1 << NX_KEYDOWN) /* key-down */ +#define NX_KEYUPMASK (1 << NX_KEYUP) /* key-up */ +#define NX_FLAGSCHANGEDMASK (1 << NX_FLAGSCHANGED) /* flags-changed */ +#define NX_KITDEFINEDMASK (1 << NX_KITDEFINED) /* kit-defined */ +#define NX_SYSDEFINEDMASK (1 << NX_SYSDEFINED) /* system-defined */ +#define NX_APPDEFINEDMASK (1 << NX_APPDEFINED) /* app-defined */ +#define NX_SCROLLWHEELMOVEDMASK (1 << NX_SCROLLWHEELMOVED) /* scroll wheel moved */ +#define NX_ZOOMMASK (1 << NX_ZOOM) /* Zoom */ +#define NX_TABLETPOINTERMASK (1 << NX_TABLETPOINTER) /* tablet pointer moved */ +#define NX_TABLETPROXIMITYMASK (1 << NX_TABLETPROXIMITY) /* tablet pointer proximity */ + +#define EventCodeMask(type) (1 << (type)) +#define NX_ALLEVENTS -1 /* Check for all events */ + +/* sub types for mouse and move events */ + +#define NX_SUBTYPE_DEFAULT 0 +#define NX_SUBTYPE_TABLET_POINT 1 +#define NX_SUBTYPE_TABLET_PROXIMITY 2 +#define NX_SUBTYPE_MOUSE_TOUCH 3 + +/* sub types for system defined events */ + +#define NX_SUBTYPE_POWER_KEY 1 +#define NX_SUBTYPE_AUX_MOUSE_BUTTONS 7 + +/* + * NX_SUBTYPE_AUX_CONTROL_BUTTONS usage + * + * The incoming NXEvent for other mouse button down/up has event.type + * NX_SYSDEFINED and event.data.compound.subtype NX_SUBTYPE_AUX_MOUSE_BUTTONS. + * Within the event.data.compound.misc.L[0] contains bits for all the buttons + * that have changed state, and event.data.compound.misc.L[1] contains the + * current button state as a bitmask, with 1 representing down, and 0 + * representing up. Bit 0 is the left button, bit one is the right button, + * bit 2 is the center button and so forth. + */ +#define NX_SUBTYPE_AUX_CONTROL_BUTTONS 8 + +#define NX_SUBTYPE_EJECT_KEY 10 +#define NX_SUBTYPE_SLEEP_EVENT 11 +#define NX_SUBTYPE_RESTART_EVENT 12 +#define NX_SUBTYPE_SHUTDOWN_EVENT 13 + +#define NX_SUBTYPE_STICKYKEYS_ON 100 +#define NX_SUBTYPE_STICKYKEYS_OFF 101 +#define NX_SUBTYPE_STICKYKEYS_SHIFT 102 +#define NX_SUBTYPE_STICKYKEYS_CONTROL 103 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE 104 +#define NX_SUBTYPE_STICKYKEYS_COMMAND 105 +#define NX_SUBTYPE_STICKYKEYS_RELEASE 106 +#define NX_SUBTYPE_STICKYKEYS_TOGGLEMOUSEDRIVING 107 + +// New stickykeys key events +// These were created to send an event describing the +// different state of the modifiers +#define NX_SUBTYPE_STICKYKEYS_SHIFT_DOWN 110 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_DOWN 111 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_DOWN 112 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_DOWN 113 +#define NX_SUBTYPE_STICKYKEYS_FN_DOWN 114 + +#define NX_SUBTYPE_STICKYKEYS_SHIFT_LOCK 120 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_LOCK 121 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_LOCK 122 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_LOCK 123 +#define NX_SUBTYPE_STICKYKEYS_FN_LOCK 124 + +#define NX_SUBTYPE_STICKYKEYS_SHIFT_UP 130 +#define NX_SUBTYPE_STICKYKEYS_CONTROL_UP 131 +#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_UP 132 +#define NX_SUBTYPE_STICKYKEYS_COMMAND_UP 133 +#define NX_SUBTYPE_STICKYKEYS_FN_UP 134 + + + +// SlowKeys +#define NX_SUBTYPE_SLOWKEYS_START 200 +#define NX_SUBTYPE_SLOWKEYS_ABORT 201 +#define NX_SUBTYPE_SLOWKEYS_END 202 + +// HID Parameter Property Modified +#define NX_SUBTYPE_HIDPARAMETER_MODIFIED 210 + +/* Masks for the bits in event.flags */ + +/* device-independent */ + +#define NX_ALPHASHIFTMASK 0x00010000 +#define NX_SHIFTMASK 0x00020000 +#define NX_CONTROLMASK 0x00040000 +#define NX_ALTERNATEMASK 0x00080000 +#define NX_COMMANDMASK 0x00100000 +#define NX_NUMERICPADMASK 0x00200000 +#define NX_HELPMASK 0x00400000 +#define NX_SECONDARYFNMASK 0x00800000 + +/* device-dependent (really?) */ + +#define NX_DEVICELCTLKEYMASK 0x00000001 +#define NX_DEVICELSHIFTKEYMASK 0x00000002 +#define NX_DEVICERSHIFTKEYMASK 0x00000004 +#define NX_DEVICELCMDKEYMASK 0x00000008 +#define NX_DEVICERCMDKEYMASK 0x00000010 +#define NX_DEVICELALTKEYMASK 0x00000020 +#define NX_DEVICERALTKEYMASK 0x00000040 +#define NX_DEVICERCTLKEYMASK 0x00002000 + +/* + * Additional reserved bits in event.flags + */ + +#define NX_STYLUSPROXIMITYMASK 0x00000080 /* deprecated */ +#define NX_NONCOALSESCEDMASK 0x00000100 + +/* click state values + * If you have the following events in close succession, the click + * field has the indicated value: + * + * Event Click Value Comments + * mouse-down 1 Not part of any click yet + * mouse-up 1 Aha! A click! + * mouse-down 2 Doing a double-click + * mouse-up 2 It's finished + * mouse-down 3 A triple + * mouse-up 3 + */ + +/* Values for the character set in event.data.key.charSet */ + +#define NX_ASCIISET 0 +#define NX_SYMBOLSET 1 +#define NX_DINGBATSSET 2 + +/* tablet button masks + * Mask bits for the tablet barrel buttons placed in tablet.buttons. + * The buttons field uses adopts the following convention: + * + * Bit Comments + * 0 Left Mouse Button ( kHIDUsage_Button_1 ) + * 1 Right Mouse Button ( kHIDUsage_Button_2 ) + * 2 Middle Mouse Button ( kHIDUsage_Button_3 ) + * 3 4th Mouse Button ( kHIDUsage_Button_4 ) + * ... + * 15 15th Mouse Button + * + * For your convenience, the following mask bits have been defined + * for tablet specific application: + */ + +#define NX_TABLET_BUTTON_PENTIPMASK 0x0001 +#define NX_TABLET_BUTTON_PENLOWERSIDEMASK 0x0002 +#define NX_TABLET_BUTTON_PENUPPERSIDEMASK 0x0004 + + +/* tablet capability masks + * Mask bits for the tablet capabilities field. Use these + * masks with the capabilities field of a proximity event to + * determine what fields in a Tablet Event are valid for this + * device. + */ +#define NX_TABLET_CAPABILITY_DEVICEIDMASK 0x0001 +#define NX_TABLET_CAPABILITY_ABSXMASK 0x0002 +#define NX_TABLET_CAPABILITY_ABSYMASK 0x0004 +#define NX_TABLET_CAPABILITY_VENDOR1MASK 0x0008 +#define NX_TABLET_CAPABILITY_VENDOR2MASK 0x0010 +#define NX_TABLET_CAPABILITY_VENDOR3MASK 0x0020 +#define NX_TABLET_CAPABILITY_BUTTONSMASK 0x0040 +#define NX_TABLET_CAPABILITY_TILTXMASK 0x0080 +#define NX_TABLET_CAPABILITY_TILTYMASK 0x0100 +#define NX_TABLET_CAPABILITY_ABSZMASK 0x0200 +#define NX_TABLET_CAPABILITY_PRESSUREMASK 0x0400 +#define NX_TABLET_CAPABILITY_TANGENTIALPRESSUREMASK 0x0800 +#define NX_TABLET_CAPABILITY_ORIENTINFOMASK 0x1000 +#define NX_TABLET_CAPABILITY_ROTATIONMASK 0x2000 + +/* proximity pointer types + * Value that describes the type of pointing device placed in + * proximity.pointerType. + */ + +#define NX_TABLET_POINTER_UNKNOWN 0 +#define NX_TABLET_POINTER_PEN 1 +#define NX_TABLET_POINTER_CURSOR 2 +#define NX_TABLET_POINTER_ERASER 3 + +/* TabletPointData type: defines the tablet data for points included + * in mouse events created by a tablet driver. + */ + +typedef struct _NXTabletPointData { + SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ + SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ + SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ + UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ + UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */ + struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ + SInt16 x; /* scaled tilt x value */ + SInt16 y; /* scaled tilt y value */ + } tilt; + UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ + SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */ + UInt16 deviceID; /* system-assigned unique device ID */ + SInt16 vendor1; /* vendor-defined signed 16-bit integer */ + SInt16 vendor2; /* vendor-defined signed 16-bit integer */ + SInt16 vendor3; /* vendor-defined signed 16-bit integer */ +} NXTabletPointData, *NXTabletPointDataPtr; + +/* TabletProximityData type: defines the tablet data for proximity + * events included in mouse events created by a tablet driver. + */ + +typedef struct _NXTabletProximityData { + UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */ + UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */ + UInt16 pointerID; /* vendor-defined ID of the specific pointing device */ + UInt16 deviceID; /* system-assigned unique device ID */ + UInt16 systemTabletID; /* system-assigned unique tablet ID */ + UInt16 vendorPointerType; /* vendor-defined pointer type */ + UInt32 pointerSerialNumber; /* vendor-defined serial number */ + UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */ + UInt32 capabilityMask; /* capabilities mask of the device */ + UInt8 pointerType; /* type of pointing device */ + UInt8 enterProximity; /* non-zero = entering; zero = leaving */ + SInt16 reserved1; +} NXTabletProximityData, *NXTabletProximityDataPtr; + +/* EventData type: defines the data field of an event */ + +typedef union { + struct { /* For mouse-down and mouse-up events */ + UInt8 subx; /* sub-pixel position for x */ + UInt8 suby; /* sub-pixel position for y */ + SInt16 eventNum; /* unique identifier for this button */ + SInt32 click; /* click state of this event */ + UInt8 pressure; /* pressure value: 0=none, 255=full */ + UInt8 buttonNumber;/* button generating other button event (0-31) */ + UInt8 subType; + UInt8 reserved2; + SInt32 reserved3; + union { + NXTabletPointData point; /* tablet point data */ + NXTabletProximityData proximity; /* tablet proximity data */ + } tablet; + } mouse; + struct { + SInt32 dx; + SInt32 dy; + UInt8 subx; + UInt8 suby; + UInt8 subType; + UInt8 reserved1; + SInt32 reserved2; + union { + NXTabletPointData point; /* tablet point data */ + NXTabletProximityData proximity; /* tablet proximity data */ + } tablet; + } mouseMove; + struct { /* For key-down and key-up events */ + UInt16 origCharSet; /* unmodified character set code */ + SInt16 repeat; /* for key-down: nonzero if really a repeat */ + UInt16 charSet; /* character set code */ + UInt16 charCode; /* character code in that set */ + UInt16 keyCode; /* device-dependent key number */ + UInt16 origCharCode; /* unmodified character code */ + SInt32 reserved1; + UInt32 keyboardType; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5[4]; + } key; + struct { /* For mouse-entered and mouse-exited events */ + SInt16 reserved; + SInt16 eventNum; /* unique identifier from mouse down event */ + SInt32 trackingNum; /* unique identifier from settrackingrect */ + SInt32 userData; /* uninterpreted integer from settrackingrect */ + SInt32 reserved1; + SInt32 reserved2; + SInt32 reserved3; + SInt32 reserved4; + SInt32 reserved5; + SInt32 reserved6[4]; + } tracking; + struct { + SInt16 deltaAxis1; + SInt16 deltaAxis2; + SInt16 deltaAxis3; + SInt16 reserved1; + SInt32 fixedDeltaAxis1; + SInt32 fixedDeltaAxis2; + SInt32 fixedDeltaAxis3; + SInt32 pointDeltaAxis1; + SInt32 pointDeltaAxis2; + SInt32 pointDeltaAxis3; + SInt32 reserved8[4]; + } scrollWheel, zoom; + struct { /* For window-changed, sys-defined, and app-defined events */ + SInt16 reserved; + SInt16 subType; /* event subtype for compound events */ + union { + float F[11]; /* for use in compound events */ + SInt32 L[11]; /* for use in compound events */ + SInt16 S[22]; /* for use in compound events */ + char C[44]; /* for use in compound events */ + } misc; + } compound; + struct { + SInt32 x; /* absolute x coordinate in tablet space at full tablet resolution */ + SInt32 y; /* absolute y coordinate in tablet space at full tablet resolution */ + SInt32 z; /* absolute z coordinate in tablet space at full tablet resolution */ + UInt16 buttons; /* one bit per button - bit 0 is first button - 1 = closed */ + UInt16 pressure; /* scaled pressure value; MAX=(2^16)-1, MIN=0 */ + struct { /* tilt range is -((2^15)-1) to (2^15)-1 (-32767 to 32767) */ + SInt16 x; /* scaled tilt x value */ + SInt16 y; /* scaled tilt y value */ + } tilt; + UInt16 rotation; /* Fixed-point representation of device rotation in a 10.6 format */ + SInt16 tangentialPressure; /* tangential pressure on the device; same range as tilt */ + UInt16 deviceID; /* system-assigned unique device ID */ + SInt16 vendor1; /* vendor-defined signed 16-bit integer */ + SInt16 vendor2; /* vendor-defined signed 16-bit integer */ + SInt16 vendor3; /* vendor-defined signed 16-bit integer */ + SInt32 reserved[4]; + } tablet; + struct { + UInt16 vendorID; /* vendor-defined ID - typically the USB vendor ID */ + UInt16 tabletID; /* vendor-defined tablet ID - typically the USB product ID */ + UInt16 pointerID; /* vendor-defined ID of the specific pointing device */ + UInt16 deviceID; /* system-assigned unique device ID */ + UInt16 systemTabletID; /* system-assigned unique tablet ID */ + UInt16 vendorPointerType; /* vendor-defined pointer type */ + UInt32 pointerSerialNumber; /* vendor-defined serial number */ + UInt64 uniqueID __attribute__ ((packed)); /* vendor-defined unique ID */ + UInt32 capabilityMask; /* capabilities mask of the device */ + UInt8 pointerType; /* type of pointing device */ + UInt8 enterProximity; /* non-zero = entering; zero = leaving */ + SInt16 reserved1; + SInt32 reserved2[4]; + } proximity; +} NXEventData; + +/* The current version number of the NXEventData structure. */ + +#define kNXEventDataVersion 2 + +/* Finally! The event record! */ +#ifndef __ppc__ +typedef struct _NXEvent { + SInt32 type; /* An event type from above */ + struct { + SInt32 x, y; /* Base coordinates in window, */ + } location; /* from bottom left */ + UInt64 time __attribute__ ((packed)); /* time since launch */ + SInt32 flags; /* key state flags */ + UInt32 window; /* window number of assigned window */ + UInt64 service_id __attribute__ ((packed)); /* service id */ + SInt32 ext_pid; /* external pid */ + NXEventData data; /* type-dependent data */ +} NXEvent, *NXEventPtr; + +#else + +typedef struct _NXEvent { + SInt32 type; /* An event type from above */ + struct { + SInt32 x, y; /* Base coordinates in window, */ + } location; /* from bottom left */ + UInt64 time __attribute__ ((packed)); /* time since launch */ + SInt32 flags; /* key state flags */ + UInt32 window; /* window number of assigned window */ + NXEventData data; /* type-dependent data */ + UInt64 service_id __attribute__ ((packed)); /* service id */ + SInt32 ext_pid; /* external pid */ +} NXEvent, *NXEventPtr; +#endif + +/* The current version number of the NXEvent structure. */ + +#define kNXEventVersion 2 + +/* How to pick window(s) for event (for PostEvent) */ +#define NX_NOWINDOW -1 +#define NX_BYTYPE 0 +#define NX_BROADCAST 1 +#define NX_TOPWINDOW 2 +#define NX_FIRSTWINDOW 3 +#define NX_MOUSEWINDOW 4 +#define NX_NEXTWINDOW 5 +#define NX_LASTLEFT 6 +#define NX_LASTRIGHT 7 +#define NX_LASTKEY 8 +#define NX_EXPLICIT 9 +#define NX_TRANSMIT 10 +#define NX_BYPSCONTEXT 11 + +#endif /* EVENT_H */ /* End of defs common with dpsclient/event.h */ + +/* Mask of events that cause screen to undim */ + +#define NX_UNDIMMASK (NX_KEYDOWNMASK | NX_KEYUPMASK | \ + NX_LMOUSEDOWNMASK | NX_LMOUSEUPMASK | \ + NX_RMOUSEDOWNMASK | NX_RMOUSEUPMASK | \ + NX_MOUSEMOVEDMASK | NX_FLAGSCHANGEDMASK | \ + NX_MOUSEENTEREDMASK | NX_MOUSEEXITEDMASK | \ + NX_LMOUSEDRAGGEDMASK | NX_RMOUSEDRAGGEDMASK | \ + NX_SCROLLWHEELMOVEDMASK | NX_TABLETPOINTERMASK | \ + NX_TABLETPROXIMITYMASK | NX_NULLEVENTMASK) + +#endif /* !_DEV_EVENT_H */ + diff --git a/i386/include/IOKit/hidsystem/ev_keymap.h b/i386/include/IOKit/hidsystem/ev_keymap.h new file mode 100644 index 0000000..a94cf11 --- /dev/null +++ b/i386/include/IOKit/hidsystem/ev_keymap.h @@ -0,0 +1,166 @@ +/* + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * ev_keymap.h + * Defines the structure used for parsing keymappings. These structures + * and definitions are used by event sources in the kernel and by + * applications and utilities which manipulate keymaps. + * + * HISTORY + * 02-Jun-1992 Mike Paquette at NeXT + * Created. + */ + +#ifndef _DEV_EV_KEYMAP_H +#define _DEV_EV_KEYMAP_H + +#define NX_NUMKEYCODES 256 /* Highest key code is 0xff. ADB used to use 0x80 for keydown state, but who the heck uses adb anymore. */ +#define NX_NUMSEQUENCES 128 /* Maximum possible number of sequences */ +#define NX_NUMMODIFIERS 16 /* Maximum number of modifier bits */ +#define NX_BYTE_CODES 0 /* If first short 0, all are bytes (else shorts) */ + +#define NX_WHICHMODMASK 0x0f /* bits out of keyBits for bucky bits */ +#define NX_MODMASK 0x10 /* Bit out of keyBits indicates modifier bit */ +#define NX_CHARGENMASK 0x20 /* bit out of keyBits for char gen */ +#define NX_SPECIALKEYMASK 0x40 /* bit out of keyBits for specialty key */ +#define NX_KEYSTATEMASK 0x80 /* OBSOLETE - DO NOT USE IN NEW DESIGNS */ + +/* + * Special keys currently known to and understood by the system. + * If new specialty keys are invented, extend this list as appropriate. + * The presence of these keys in a particular implementation is not + * guaranteed. + */ +#define NX_NOSPECIALKEY 0xFFFF +#define NX_KEYTYPE_SOUND_UP 0 +#define NX_KEYTYPE_SOUND_DOWN 1 +#define NX_KEYTYPE_BRIGHTNESS_UP 2 +#define NX_KEYTYPE_BRIGHTNESS_DOWN 3 +#define NX_KEYTYPE_CAPS_LOCK 4 +#define NX_KEYTYPE_HELP 5 +#define NX_POWER_KEY 6 +#define NX_KEYTYPE_MUTE 7 +#define NX_UP_ARROW_KEY 8 +#define NX_DOWN_ARROW_KEY 9 +#define NX_KEYTYPE_NUM_LOCK 10 + +#define NX_KEYTYPE_CONTRAST_UP 11 +#define NX_KEYTYPE_CONTRAST_DOWN 12 +#define NX_KEYTYPE_LAUNCH_PANEL 13 +#define NX_KEYTYPE_EJECT 14 +#define NX_KEYTYPE_VIDMIRROR 15 + +#define NX_KEYTYPE_PLAY 16 +#define NX_KEYTYPE_NEXT 17 +#define NX_KEYTYPE_PREVIOUS 18 +#define NX_KEYTYPE_FAST 19 +#define NX_KEYTYPE_REWIND 20 + +#define NX_KEYTYPE_ILLUMINATION_UP 21 +#define NX_KEYTYPE_ILLUMINATION_DOWN 22 +#define NX_KEYTYPE_ILLUMINATION_TOGGLE 23 + +#define NX_NUMSPECIALKEYS 24 /* Maximum number of special keys */ +#define NX_NUM_SCANNED_SPECIALKEYS 24 /* First 24 special keys are */ + /* actively scanned in kernel */ + +/* Mask of special keys that are posted as events */ + +#define NX_SPECIALKEY_POST_MASK \ + ((1 << NX_KEYTYPE_SOUND_UP) | (1 << NX_KEYTYPE_SOUND_DOWN) | \ + (1 << NX_POWER_KEY) | (1 << NX_KEYTYPE_MUTE) | \ + (1 << NX_KEYTYPE_BRIGHTNESS_UP) | (1 << NX_KEYTYPE_BRIGHTNESS_DOWN) | \ + (1 << NX_KEYTYPE_CONTRAST_UP) | (1 << NX_KEYTYPE_CONTRAST_UP) | \ + (1 << NX_KEYTYPE_LAUNCH_PANEL) | (1 << NX_KEYTYPE_EJECT) | \ + (1 << NX_KEYTYPE_VIDMIRROR) | (1 << NX_KEYTYPE_PLAY) | \ + (1 << NX_KEYTYPE_NEXT) | (1 << NX_KEYTYPE_PREVIOUS) | \ + (1 << NX_KEYTYPE_FAST) | (1 << NX_KEYTYPE_REWIND) | \ + (1 << NX_KEYTYPE_ILLUMINATION_UP) | \ + (1 << NX_KEYTYPE_ILLUMINATION_DOWN) | \ + (1 << NX_KEYTYPE_ILLUMINATION_TOGGLE) | 0) + +/* Modifier key indices into modDefs[] */ +#define NX_MODIFIERKEY_ALPHALOCK 0 +#define NX_MODIFIERKEY_SHIFT 1 +#define NX_MODIFIERKEY_CONTROL 2 +#define NX_MODIFIERKEY_ALTERNATE 3 +#define NX_MODIFIERKEY_COMMAND 4 +#define NX_MODIFIERKEY_NUMERICPAD 5 +#define NX_MODIFIERKEY_HELP 6 +#define NX_MODIFIERKEY_SECONDARYFN 7 +#define NX_MODIFIERKEY_NUMLOCK 8 + +/* support for right hand modifier */ +#define NX_MODIFIERKEY_RSHIFT 9 +#define NX_MODIFIERKEY_RCONTROL 10 +#define NX_MODIFIERKEY_RALTERNATE 11 +#define NX_MODIFIERKEY_RCOMMAND 12 + + +typedef struct _NXParsedKeyMapping_ { + /* If nonzero, all numbers are shorts; if zero, all numbers are bytes*/ + short shorts; + + /* + * For each keycode, low order bit says if the key + * generates characters. + * High order bit says if the key is assigned to a modifier bit. + * The second to low order bit gives the current state of the key. + */ + char keyBits[NX_NUMKEYCODES]; + + /* Bit number of highest numbered modifier bit */ + int maxMod; + + /* Pointers to where the list of keys for each modifiers bit begins, + * or NULL. + */ + unsigned char *modDefs[NX_NUMMODIFIERS]; + + /* Key code of highest key deinfed to generate characters */ + int numDefs; + + /* Pointer into the keyMapping where this key's definitions begin */ + unsigned char *keyDefs[NX_NUMKEYCODES]; + + /* number of sequence definitions */ + int numSeqs; + + /* pointers to sequences */ + unsigned char *seqDefs[NX_NUMSEQUENCES]; + + /* Special key definitions */ + int numSpecialKeys; + + /* Special key values, or 0xFFFF if none */ + unsigned short specialKeys[NX_NUMSPECIALKEYS]; + + /* Pointer to the original keymapping string */ + const unsigned char *mapping; + + /* Length of the original string */ + int mappingLen; +} NXParsedKeyMapping; + +#endif /* !_DEV_EV_KEYMAP_H */ diff --git a/i386/include/IOKit/i2c/.svn/all-wcprops b/i386/include/IOKit/i2c/.svn/all-wcprops new file mode 100644 index 0000000..75d5ab6 --- /dev/null +++ b/i386/include/IOKit/i2c/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/i2c +END +IOI2CInterface.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/i2c/IOI2CInterface.h +END diff --git a/i386/include/IOKit/i2c/.svn/entries b/i386/include/IOKit/i2c/.svn/entries new file mode 100644 index 0000000..eed5076 --- /dev/null +++ b/i386/include/IOKit/i2c/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/i2c +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOI2CInterface.h +file + + + + +2013-08-27T23:54:32.000000Z +d73fc2a020b36f7913611e21d78e0d0d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11852 + diff --git a/i386/include/IOKit/i2c/.svn/text-base/IOI2CInterface.h.svn-base b/i386/include/IOKit/i2c/.svn/text-base/IOI2CInterface.h.svn-base new file mode 100644 index 0000000..70a38e2 --- /dev/null +++ b/i386/include/IOKit/i2c/.svn/text-base/IOI2CInterface.h.svn-base @@ -0,0 +1,262 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOI2CINTERFACE_H +#define _IOKIT_IOI2CINTERFACE_H + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct IOI2CRequest IOI2CRequest; +typedef struct IOI2CBuffer IOI2CBuffer; + +typedef void (*IOI2CRequestCompletion) (IOI2CRequest * request); + +// IOI2CRequest.sendTransactionType, IOI2CRequest.replyTransactionType +enum { + kIOI2CNoTransactionType = 0, + kIOI2CSimpleTransactionType = 1, + kIOI2CDDCciReplyTransactionType = 2, + kIOI2CCombinedTransactionType = 3, + kIOI2CDisplayPortNativeTransactionType = 4 +}; + +// IOI2CRequest.commFlags +enum { + kIOI2CUseSubAddressCommFlag = 0x00000002 +}; + +/*! + * @struct IOI2CRequest + * @abstract A structure defining an I2C bus transaction. + * @discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus. + * @field __reservedA Set to zero. + * @field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus. + * @field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously. + * @field commFlags Flags that modify the I2C transaction type. The following flags are defined:
+ * kIOI2CUseSubAddressCommFlag Transaction includes a subaddress.
+ * @field minReplyDelay Minimum delay as absolute time between send and reply transactions. + * @field sendAddress I2C address to write. + * @field sendSubAddress I2C subaddress to write. + * @field __reservedB Set to zero. + * @field sendTransactionType The following types of transaction are defined for the send part of the request:
+ * kIOI2CNoTransactionType No send transaction to perform.
+ * kIOI2CSimpleTransactionType Simple I2C message.
+ * kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
+ * @field sendBuffer Pointer to the send buffer. + * @field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request. + * @field replyAddress I2C Address from which to read. + * @field replySubAddress I2C Address from which to read. + * @field __reservedC Set to zero. + * @field replyTransactionType The following types of transaction are defined for the reply part of the request:
+ * kIOI2CNoTransactionType No reply transaction to perform.
+ * kIOI2CSimpleTransactionType Simple I2C message.
+ * kIOI2CDDCciReplyTransactionType DDC/ci message (with embedded length). See VESA DDC/ci specification.
+ * kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
+ * @field replyBuffer Pointer to the reply buffer. + * @field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request. + * @field __reservedD Set to zero. + */ + +#pragma pack(push, 4) +struct IOI2CRequest +{ + IOOptionBits sendTransactionType; + IOOptionBits replyTransactionType; + uint32_t sendAddress; + uint32_t replyAddress; + uint8_t sendSubAddress; + uint8_t replySubAddress; + uint8_t __reservedA[2]; + + uint64_t minReplyDelay; + + IOReturn result; + IOOptionBits commFlags; + +#if defined(__LP64__) + uint32_t __padA; +#else + vm_address_t sendBuffer; +#endif + uint32_t sendBytes; + + uint32_t __reservedB[2]; + +#if defined(__LP64__) + uint32_t __padB; +#else + vm_address_t replyBuffer; +#endif + uint32_t replyBytes; + + IOI2CRequestCompletion completion; +#if !defined(__LP64__) + uint32_t __padC[5]; +#else + vm_address_t sendBuffer; + vm_address_t replyBuffer; +#endif + + uint32_t __reservedC[10]; +#ifdef __ppc__ + uint32_t __reservedD; +#endif +}; +#pragma pack(pop) + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kIOI2CInterfaceClassName "IOI2CInterface" + +#define kIOI2CInterfaceIDKey "IOI2CInterfaceID" +#define kIOI2CBusTypeKey "IOI2CBusType" +#define kIOI2CTransactionTypesKey "IOI2CTransactionTypes" +#define kIOI2CSupportedCommFlagsKey "IOI2CSupportedCommFlags" + +#define kIOFBI2CInterfaceInfoKey "IOFBI2CInterfaceInfo" +#define kIOFBI2CInterfaceIDsKey "IOFBI2CInterfaceIDs" + +// kIOI2CBusTypeKey values +enum { + kIOI2CBusTypeI2C = 1, + kIOI2CBusTypeDisplayPort = 2 +}; + +/*! + * @struct IOI2CBusTiming + * @abstract A structure defining low level timing for an I2C bus. + * @discussion This structure is used to specify timeouts and pulse widths for an I2C bus implementation. + * @field bitTimeout Maximum time a slave can delay (by pulling the clock line low) a single bit response. + * @field byteTimeout Maximum time a slave can delay (by pulling the clock line low) the first bit of a byte response. + * @field acknowledgeTimeout Maximum time to wait for a slave to respond with an ACK after writing a byte. + * @field startTimeout Maximum time to wait for a slave to respond after a start signal. + * @field riseFallTime Time to wait after any change in output signal. + * @field __reservedA Set to zero. + */ + +struct IOI2CBusTiming +{ + AbsoluteTime bitTimeout; + AbsoluteTime byteTimeout; + AbsoluteTime acknowledgeTimeout; + AbsoluteTime startTimeout; + AbsoluteTime holdTime; + AbsoluteTime riseFallTime; + UInt32 __reservedA[8]; +}; +typedef struct IOI2CBusTiming IOI2CBusTiming; + +#ifndef KERNEL + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// options for IOFBCopyI2CInterfaceForBus() +enum { + kIOI2CBusNumberMask = 0x000000ff +}; + + +/*! @function IOFBGetI2CInterfaceCount + @abstract Returns a count of I2C interfaces available associated with an IOFramebuffer instance. + @discussion Returns a count of I2C interfaces available associated with an IOFramebuffer instance. + @param framebuffer The io_service_t of an IOFramebuffer instance. CoreGraphics will provide this for a CGDisplay with the CGDisplayIOServicePort() call. + @param count Interface count is returned. + @result An IOReturn code. */ + +IOReturn IOFBGetI2CInterfaceCount( io_service_t framebuffer, IOItemCount * count ); + +/*! @function IOFBCopyI2CInterfaceForBus + @abstract Returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. + @discussion Some graphics devices will allow access to an I2C bus routed through a display connector in order to control external devices on that bus. This function returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. The number of I2C buses is available from the IOFBGetI2CInterfaceCount() call. The interface may be used with the IOI2CInterfaceOpen/Close/SendRequest() calls to carry out I2C transactions on that bus. Not all graphics devices support this functionality. + @param bus The zero based index of the bus on the requested framebuffer. + @param interface The interface instance is returned. The caller should release this instance with IOObjectRelease(). + @result An IOReturn code. */ + +IOReturn IOFBCopyI2CInterfaceForBus( io_service_t framebuffer, IOOptionBits bus, io_service_t * interface ); + +typedef struct IOI2CConnect * IOI2CConnectRef; /* struct IOI2CConnect is opaque */ + +IOReturn IOI2CCopyInterfaceForID( CFTypeRef identifier, io_service_t * interface ); + +/*! @function IOI2CInterfaceOpen + @abstract Opens an instance of an I2C bus interface, allowing I2C requests to be made. + @discussion An instance of an I2C bus interface, obtained by IOFBCopyI2CInterfaceForBus, is opened with this function allowing I2C requests to be made. + @param interface An I2C bus interface (see IOFBCopyI2CInterfaceForBus). The interface may be released after this call is made. + @param options Pass kNilOptions. + @param connect The opaque IOI2CConnectRef is returned, for use with IOI2CSendRequest() and IOI2CInterfaceClose(). + @result An IOReturn code. */ + +IOReturn IOI2CInterfaceOpen( io_service_t interface, IOOptionBits options, + IOI2CConnectRef * connect ); + +/*! @function IOI2CInterfaceClose + @abstract Closes an IOI2CConnectRef. + @discussion Frees the resources associated with an IOI2CConnectRef. + @param connect The opaque IOI2CConnectRef returned by IOI2CInterfaceOpen(). + @param options Pass kNilOptions. + @result An IOReturn code. */ + +IOReturn IOI2CInterfaceClose( IOI2CConnectRef connect, IOOptionBits options ); + +/*! @function IOI2CSendRequest + @abstract Carries out the I2C transaction specified by an IOI2CRequest structure. + @discussion Frees the resources associated with an IOI2CConnectRef. + @param connect The opaque IOI2CConnectRef returned by IOI2CInterfaceOpen(). + @param options Pass kNilOptions. + @param request Pass a pointer to a IOI2CRequest structure describing the request. If an asynchronous request (with a non-NULL completion routine) the request structure must be valid for the life of the request. + @result An IOReturn code reflecting only the result of starting the transaction. If the result of IOI2CSendRequest() is kIOReturnSuccess, the I2C transaction result is returned in the result field of the request structure. */ + +IOReturn IOI2CSendRequest( IOI2CConnectRef connect, IOOptionBits options, + IOI2CRequest * request ); + +#else + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IOI2CInterface + @abstract The base class for an I2C bus interface. + @discussion The IOI2CInterface base class defines an I2C bus interface. Not useful for developers. */ + +class IOI2CInterface : public IOService +{ + OSDeclareDefaultStructors(IOI2CInterface) + +protected: + UInt64 fID; + +public: + IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler ); + + bool registerI2C( UInt64 id ); + + virtual IOReturn startIO( IOI2CRequest * request ) = 0; +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* KERNEL */ + +#endif /* ! _IOKIT_IOI2CINTERFACE_H */ + diff --git a/i386/include/IOKit/i2c/IOI2CInterface.h b/i386/include/IOKit/i2c/IOI2CInterface.h new file mode 100644 index 0000000..70a38e2 --- /dev/null +++ b/i386/include/IOKit/i2c/IOI2CInterface.h @@ -0,0 +1,262 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOI2CINTERFACE_H +#define _IOKIT_IOI2CINTERFACE_H + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct IOI2CRequest IOI2CRequest; +typedef struct IOI2CBuffer IOI2CBuffer; + +typedef void (*IOI2CRequestCompletion) (IOI2CRequest * request); + +// IOI2CRequest.sendTransactionType, IOI2CRequest.replyTransactionType +enum { + kIOI2CNoTransactionType = 0, + kIOI2CSimpleTransactionType = 1, + kIOI2CDDCciReplyTransactionType = 2, + kIOI2CCombinedTransactionType = 3, + kIOI2CDisplayPortNativeTransactionType = 4 +}; + +// IOI2CRequest.commFlags +enum { + kIOI2CUseSubAddressCommFlag = 0x00000002 +}; + +/*! + * @struct IOI2CRequest + * @abstract A structure defining an I2C bus transaction. + * @discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus. + * @field __reservedA Set to zero. + * @field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus. + * @field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously. + * @field commFlags Flags that modify the I2C transaction type. The following flags are defined:
+ * kIOI2CUseSubAddressCommFlag Transaction includes a subaddress.
+ * @field minReplyDelay Minimum delay as absolute time between send and reply transactions. + * @field sendAddress I2C address to write. + * @field sendSubAddress I2C subaddress to write. + * @field __reservedB Set to zero. + * @field sendTransactionType The following types of transaction are defined for the send part of the request:
+ * kIOI2CNoTransactionType No send transaction to perform.
+ * kIOI2CSimpleTransactionType Simple I2C message.
+ * kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
+ * @field sendBuffer Pointer to the send buffer. + * @field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request. + * @field replyAddress I2C Address from which to read. + * @field replySubAddress I2C Address from which to read. + * @field __reservedC Set to zero. + * @field replyTransactionType The following types of transaction are defined for the reply part of the request:
+ * kIOI2CNoTransactionType No reply transaction to perform.
+ * kIOI2CSimpleTransactionType Simple I2C message.
+ * kIOI2CDDCciReplyTransactionType DDC/ci message (with embedded length). See VESA DDC/ci specification.
+ * kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
+ * @field replyBuffer Pointer to the reply buffer. + * @field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request. + * @field __reservedD Set to zero. + */ + +#pragma pack(push, 4) +struct IOI2CRequest +{ + IOOptionBits sendTransactionType; + IOOptionBits replyTransactionType; + uint32_t sendAddress; + uint32_t replyAddress; + uint8_t sendSubAddress; + uint8_t replySubAddress; + uint8_t __reservedA[2]; + + uint64_t minReplyDelay; + + IOReturn result; + IOOptionBits commFlags; + +#if defined(__LP64__) + uint32_t __padA; +#else + vm_address_t sendBuffer; +#endif + uint32_t sendBytes; + + uint32_t __reservedB[2]; + +#if defined(__LP64__) + uint32_t __padB; +#else + vm_address_t replyBuffer; +#endif + uint32_t replyBytes; + + IOI2CRequestCompletion completion; +#if !defined(__LP64__) + uint32_t __padC[5]; +#else + vm_address_t sendBuffer; + vm_address_t replyBuffer; +#endif + + uint32_t __reservedC[10]; +#ifdef __ppc__ + uint32_t __reservedD; +#endif +}; +#pragma pack(pop) + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kIOI2CInterfaceClassName "IOI2CInterface" + +#define kIOI2CInterfaceIDKey "IOI2CInterfaceID" +#define kIOI2CBusTypeKey "IOI2CBusType" +#define kIOI2CTransactionTypesKey "IOI2CTransactionTypes" +#define kIOI2CSupportedCommFlagsKey "IOI2CSupportedCommFlags" + +#define kIOFBI2CInterfaceInfoKey "IOFBI2CInterfaceInfo" +#define kIOFBI2CInterfaceIDsKey "IOFBI2CInterfaceIDs" + +// kIOI2CBusTypeKey values +enum { + kIOI2CBusTypeI2C = 1, + kIOI2CBusTypeDisplayPort = 2 +}; + +/*! + * @struct IOI2CBusTiming + * @abstract A structure defining low level timing for an I2C bus. + * @discussion This structure is used to specify timeouts and pulse widths for an I2C bus implementation. + * @field bitTimeout Maximum time a slave can delay (by pulling the clock line low) a single bit response. + * @field byteTimeout Maximum time a slave can delay (by pulling the clock line low) the first bit of a byte response. + * @field acknowledgeTimeout Maximum time to wait for a slave to respond with an ACK after writing a byte. + * @field startTimeout Maximum time to wait for a slave to respond after a start signal. + * @field riseFallTime Time to wait after any change in output signal. + * @field __reservedA Set to zero. + */ + +struct IOI2CBusTiming +{ + AbsoluteTime bitTimeout; + AbsoluteTime byteTimeout; + AbsoluteTime acknowledgeTimeout; + AbsoluteTime startTimeout; + AbsoluteTime holdTime; + AbsoluteTime riseFallTime; + UInt32 __reservedA[8]; +}; +typedef struct IOI2CBusTiming IOI2CBusTiming; + +#ifndef KERNEL + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// options for IOFBCopyI2CInterfaceForBus() +enum { + kIOI2CBusNumberMask = 0x000000ff +}; + + +/*! @function IOFBGetI2CInterfaceCount + @abstract Returns a count of I2C interfaces available associated with an IOFramebuffer instance. + @discussion Returns a count of I2C interfaces available associated with an IOFramebuffer instance. + @param framebuffer The io_service_t of an IOFramebuffer instance. CoreGraphics will provide this for a CGDisplay with the CGDisplayIOServicePort() call. + @param count Interface count is returned. + @result An IOReturn code. */ + +IOReturn IOFBGetI2CInterfaceCount( io_service_t framebuffer, IOItemCount * count ); + +/*! @function IOFBCopyI2CInterfaceForBus + @abstract Returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. + @discussion Some graphics devices will allow access to an I2C bus routed through a display connector in order to control external devices on that bus. This function returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. The number of I2C buses is available from the IOFBGetI2CInterfaceCount() call. The interface may be used with the IOI2CInterfaceOpen/Close/SendRequest() calls to carry out I2C transactions on that bus. Not all graphics devices support this functionality. + @param bus The zero based index of the bus on the requested framebuffer. + @param interface The interface instance is returned. The caller should release this instance with IOObjectRelease(). + @result An IOReturn code. */ + +IOReturn IOFBCopyI2CInterfaceForBus( io_service_t framebuffer, IOOptionBits bus, io_service_t * interface ); + +typedef struct IOI2CConnect * IOI2CConnectRef; /* struct IOI2CConnect is opaque */ + +IOReturn IOI2CCopyInterfaceForID( CFTypeRef identifier, io_service_t * interface ); + +/*! @function IOI2CInterfaceOpen + @abstract Opens an instance of an I2C bus interface, allowing I2C requests to be made. + @discussion An instance of an I2C bus interface, obtained by IOFBCopyI2CInterfaceForBus, is opened with this function allowing I2C requests to be made. + @param interface An I2C bus interface (see IOFBCopyI2CInterfaceForBus). The interface may be released after this call is made. + @param options Pass kNilOptions. + @param connect The opaque IOI2CConnectRef is returned, for use with IOI2CSendRequest() and IOI2CInterfaceClose(). + @result An IOReturn code. */ + +IOReturn IOI2CInterfaceOpen( io_service_t interface, IOOptionBits options, + IOI2CConnectRef * connect ); + +/*! @function IOI2CInterfaceClose + @abstract Closes an IOI2CConnectRef. + @discussion Frees the resources associated with an IOI2CConnectRef. + @param connect The opaque IOI2CConnectRef returned by IOI2CInterfaceOpen(). + @param options Pass kNilOptions. + @result An IOReturn code. */ + +IOReturn IOI2CInterfaceClose( IOI2CConnectRef connect, IOOptionBits options ); + +/*! @function IOI2CSendRequest + @abstract Carries out the I2C transaction specified by an IOI2CRequest structure. + @discussion Frees the resources associated with an IOI2CConnectRef. + @param connect The opaque IOI2CConnectRef returned by IOI2CInterfaceOpen(). + @param options Pass kNilOptions. + @param request Pass a pointer to a IOI2CRequest structure describing the request. If an asynchronous request (with a non-NULL completion routine) the request structure must be valid for the life of the request. + @result An IOReturn code reflecting only the result of starting the transaction. If the result of IOI2CSendRequest() is kIOReturnSuccess, the I2C transaction result is returned in the result field of the request structure. */ + +IOReturn IOI2CSendRequest( IOI2CConnectRef connect, IOOptionBits options, + IOI2CRequest * request ); + +#else + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*! @class IOI2CInterface + @abstract The base class for an I2C bus interface. + @discussion The IOI2CInterface base class defines an I2C bus interface. Not useful for developers. */ + +class IOI2CInterface : public IOService +{ + OSDeclareDefaultStructors(IOI2CInterface) + +protected: + UInt64 fID; + +public: + IOReturn newUserClient( task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler ); + + bool registerI2C( UInt64 id ); + + virtual IOReturn startIO( IOI2CRequest * request ) = 0; +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#endif /* KERNEL */ + +#endif /* ! _IOKIT_IOI2CINTERFACE_H */ + diff --git a/i386/include/IOKit/ndrvsupport/.svn/all-wcprops b/i386/include/IOKit/ndrvsupport/.svn/all-wcprops new file mode 100644 index 0000000..b34e5ab --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ndrvsupport +END +IONDRVLibraries.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ndrvsupport/IONDRVLibraries.h +END +IONDRVSupport.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ndrvsupport/IONDRVSupport.h +END +IOMacOSTypes.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ndrvsupport/IOMacOSTypes.h +END +IOMacOSVideo.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ndrvsupport/IOMacOSVideo.h +END +IONDRVFramebuffer.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ndrvsupport/IONDRVFramebuffer.h +END diff --git a/i386/include/IOKit/ndrvsupport/.svn/entries b/i386/include/IOKit/ndrvsupport/.svn/entries new file mode 100644 index 0000000..0db269a --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/ndrvsupport +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IONDRVLibraries.h +file + + + + +2013-08-27T23:54:32.000000Z +ffd8d5b3d396f2867ca368ca77d06cc3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22928 + +IONDRVSupport.h +file + + + + +2013-08-27T23:54:32.000000Z +30113901554c5459c14b296b91190940 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3006 + +IOMacOSTypes.h +file + + + + +2013-08-27T23:54:32.000000Z +0c6e4448ebc3488817298920dffa7157 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16394 + +IOMacOSVideo.h +file + + + + +2013-08-27T23:54:32.000000Z +df9cf68ae13eea6b4160479b41ade929 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +82435 + +IONDRVFramebuffer.h +file + + + + +2013-08-27T23:54:32.000000Z +472a61e8cbcfd4821d1b011545340220 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13881 + diff --git a/i386/include/IOKit/ndrvsupport/.svn/text-base/IOMacOSTypes.h.svn-base b/i386/include/IOKit/ndrvsupport/.svn/text-base/IOMacOSTypes.h.svn-base new file mode 100644 index 0000000..0a2aae7 --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/text-base/IOMacOSTypes.h.svn-base @@ -0,0 +1,441 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 22 Oct 97 - first checked in. + * sdouglas 21 July 98 - start IOKit + */ + +/* + File: Types.h + + Contains: Basic Macintosh data types. + + Version: Technology: PowerSurge 1.0.2. + Package: Universal Interfaces 2.1.2 on ETO #20 + + Copyright: � 1984-1995 by Apple Computer, Inc. + All rights reserved. + + Bugs?: If you find a problem with this file, use the Apple Bug Reporter + stack. Include the file and version information (from above) + in the problem description and send to: + Internet: apple.bugs@applelink.apple.com + AppleLink: APPLE.BUGS + +*/ + +#ifndef _IOKIT_IOMACOSTYPES_H +#define _IOKIT_IOMACOSTYPES_H +#ifndef __MACTYPES__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +#ifndef NULL +#if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C)) +#define NULL ((void *) 0) +#else +#define NULL 0 +#endif +#endif + +enum { + noErr = 0 +}; + +typedef uintptr_t KernelProcessID; +typedef uintptr_t AddressSpaceID; + +#if 0 +#ifndef __cplusplus +enum { false, true }; +#endif +#endif + +typedef unsigned char Byte; + +typedef signed char SignedByte; + +typedef UInt16 UniChar; + +typedef char *Ptr; + +typedef Ptr *Handle; + +typedef UInt32 Fixed; + +typedef Fixed *FixedPtr; + +typedef UInt32 Fract; + +typedef Fract *FractPtr; + +struct _extended80 { + short exp; + short man[4]; +}; +struct _extended96 { + short exp[2]; + short man[4]; +}; +typedef struct wide *WidePtr; + +typedef struct UnsignedWide *UnsignedWidePtr; + + +/* +enum { + false, + true +}; +#if !__option(bool) + #ifndef true + #define true 1 + #endif + #ifndef false + #define false 0 + #endif +#endif + +typedef unsigned char Boolean; +*/ + + +typedef short OSErr; + +typedef unsigned int FourCharCode; + +typedef FourCharCode OSType; + +typedef FourCharCode ResType; + +typedef OSType *OSTypePtr; + +typedef ResType *ResTypePtr; + +struct Rect { + short top; + short left; + short bottom; + short right; +}; +typedef struct Rect Rect; + +typedef Rect *RectPtr; + +// Quickdraw.i + +/* + kVariableLengthArray is used in array bounds to specify a variable length array. + It is ususally used in variable length structs when the last field is an array + of any size. Before ANSI C, we used zero as the bounds of variable length + array, but that is illegal in ANSI C. Example: + + struct FooList + { + short listLength; + Foo elements[kVariableLengthArray]; + }; +*/ + +enum { + kVariableLengthArray = 1 +}; + +/* Numeric version part of 'vers' resource */ +struct NumVersion { + UInt8 majorRev; /*1st part of version number in BCD*/ + UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ + UInt8 stage; /*stage code: dev, alpha, beta, final*/ + UInt8 nonRelRev; /*revision level of non-released version*/ +}; +typedef struct NumVersion NumVersion; + +typedef struct OpaqueRef *KernelID; + +typedef UInt8 *BytePtr; + +typedef IOByteCount ByteCount; + +typedef IOItemCount ItemCount; + +typedef void *LogicalAddress; + +#if !defined(__LP64__) +typedef void *PhysicalAddress; +#endif + +typedef UInt32 PBVersion; + +typedef SInt32 Duration; + +#define kInvalidID 0 + +enum { + kNilOptions = 0 +}; + + +typedef unsigned char Str31[32]; + + +/* +From: + File: DriverFamilyMatching.i <18> + Copyright: � 1995-1996 by Apple Computer, Inc., all rights reserved. +*/ + +//############################################## +// Well known properties in the Name Registry +//############################################## + +#define kPropertyName "name" +#define kPropertyCompatible "compatible" +#define kPropertyDriverPtr "driver-ptr" +#define kPropertyDriverDesc "driver-description" +#define kPropertyReg "reg" +#define kPropertyAAPLAddress "AAPL,address" +#define kPropertyMatching "matching" + + +//######################################################### +// Descriptor for Drivers and NDRVs +//######################################################### +/* Driver Typing Information Used to Match Drivers With Devices */ +struct DriverType { + Str31 nameInfoStr; /* Driver Name/Info String*/ + NumVersion version; /* Driver Version Number*/ +}; +typedef struct DriverType DriverType; +typedef DriverType * DriverTypePtr; + +/* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */ +typedef OptionBits RuntimeOptions; + + +enum { + kDriverIsLoadedUponDiscovery = 0x00000001, /* auto-load driver when discovered*/ + kDriverIsOpenedUponLoad = 0x00000002, /* auto-open driver when loaded*/ + kDriverIsUnderExpertControl = 0x00000004, /* I/O expert handles loads/opens*/ + kDriverIsConcurrent = 0x00000008, /* supports concurrent requests*/ + kDriverQueuesIOPB = 0x00000010, /* device manager doesn't queue IOPB*/ + kDriverIsLoadedAtBoot = 0x00000020, /* Driver is loaded at the boot time */ + kDriverIsForVirtualDevice = 0x00000040, /* Driver is for a virtual Device */ + kDriverSupportDMSuspendAndResume = 0x00000080 /* Driver supports Device Manager Suspend and Resume command */ +}; + +struct DriverOSRuntime { + RuntimeOptions driverRuntime; /* Options for OS Runtime*/ + Str31 driverName; /* Driver's name to the OS*/ + UInt32 driverDescReserved[8]; /* Reserved area*/ +}; +typedef struct DriverOSRuntime DriverOSRuntime; +typedef DriverOSRuntime * DriverOSRuntimePtr; + +/* OS Service Information Used To Declare What APIs a Driver Supports */ +typedef UInt32 ServiceCount; + +struct DriverServiceInfo { + OSType serviceCategory; /* Service Category Name*/ + OSType serviceType; /* Type within Category*/ + NumVersion serviceVersion; /* Version of service*/ +}; +typedef struct DriverServiceInfo DriverServiceInfo; +typedef DriverServiceInfo * DriverServiceInfoPtr; + +struct DriverOSService { + ServiceCount nServices; /* Number of Services Supported*/ + DriverServiceInfo service[1]; /* The List of Services (at least one)*/ +}; +typedef struct DriverOSService DriverOSService; +typedef DriverOSService * DriverOSServicePtr; + +/* Categories */ + +enum { + kServiceCategoryDisplay = 'disp', /* Display Manager*/ + kServiceCategoryOpenTransport = 'otan', /* Open Transport*/ + kServiceCategoryBlockStorage = 'blok', /* Block Storage*/ + kServiceCategoryNdrvDriver = 'ndrv', /* Generic Native Driver*/ + kServiceCategoryScsiSIM = 'scsi', /* SCSI */ + kServiceCategoryFileManager = 'file', /* File Manager */ + kServiceCategoryIDE = 'ide-', /* ide */ + kServiceCategoryADB = 'adb-', /* adb */ + kServiceCategoryPCI = 'pci-', /* pci bus */ + /* Nu Bus */ + kServiceCategoryDFM = 'dfm-', /* DFM */ + kServiceCategoryMotherBoard = 'mrbd', /* mother Board */ + kServiceCategoryKeyboard = 'kybd', /* Keyboard */ + kServiceCategoryPointing = 'poit', /* Pointing */ + kServiceCategoryRTC = 'rtc-', /* RTC */ + kServiceCategoryNVRAM = 'nram', /* NVRAM */ + kServiceCategorySound = 'sond', /* Sound (1/3/96 MCS) */ + kServiceCategoryPowerMgt = 'pgmt', /* Power Management */ + kServiceCategoryGeneric = 'genr' /* Generic Service Category to receive general Events */ +}; + +/* Ndrv ServiceCategory Types */ +enum { + kNdrvTypeIsGeneric = 'genr', /* generic*/ + kNdrvTypeIsVideo = 'vido', /* video*/ + kNdrvTypeIsBlockStorage = 'blok', /* block storage*/ + kNdrvTypeIsNetworking = 'netw', /* networking*/ + kNdrvTypeIsSerial = 'serl', /* serial*/ + kNdrvTypeIsParallel = 'parl', /* parallel */ + kNdrvTypeIsSound = 'sond', /* sound*/ + kNdrvTypeIsBusBridge = 'brdg' +}; + +typedef UInt32 DriverDescVersion; + +/* The Driver Description */ +enum { + kInitialDriverDescriptor = 0, + kVersionOneDriverDescriptor = 1 +}; + +enum { + kTheDescriptionSignature = 'mtej', + kDriverDescriptionSignature = 'pdes' +}; + + +struct DriverDescription { + OSType driverDescSignature; /* Signature field of this structure*/ + DriverDescVersion driverDescVersion; /* Version of this data structure*/ + DriverType driverType; /* Type of Driver*/ + DriverOSRuntime driverOSRuntimeInfo; /* OS Runtime Requirements of Driver*/ + DriverOSService driverServices; /* Apple Service API Membership*/ +}; +typedef struct DriverDescription DriverDescription; +typedef DriverDescription * DriverDescriptionPtr; + + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __MACTYPES__ */ + +#ifndef __QUICKDRAW__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +struct RGBColor { + unsigned short red; /*magnitude of red component*/ + unsigned short green; /*magnitude of green component*/ + unsigned short blue; /*magnitude of blue component*/ +}; +typedef struct RGBColor RGBColor; +typedef RGBColor *RGBColorPtr; +typedef RGBColorPtr *RGBColorHdl; + +struct ColorSpec { + short value; /*index or other value*/ + RGBColor rgb; /*true color*/ +}; + +typedef struct ColorSpec ColorSpec; +typedef ColorSpec *ColorSpecPtr; + +struct GammaTbl { + short gVersion; /*gamma version number*/ + short gType; /*gamma data type*/ + short gFormulaSize; /*Formula data size*/ + short gChanCnt; /*number of channels of data*/ + short gDataCnt; /*number of values/channel*/ + short gDataWidth; /*bits/corrected value (data packed to next larger byte size)*/ + short gFormulaData[1]; /*data for formulas followed by gamma values*/ +}; +typedef struct GammaTbl GammaTbl; +typedef GammaTbl *GammaTblPtr; + +struct RegEntryID +{ + void * opaque[4]; +}; +typedef struct RegEntryID RegEntryID; +typedef RegEntryID * RegEntryIDPtr; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +struct IONDRVControlParameters { + UInt8 __reservedA[0x1a]; + UInt16 code; + void * params; + UInt8 __reservedB[0x12]; +}; + +enum { + kIONDRVOpenCommand = 128 + 0, + kIONDRVCloseCommand = 128 + 1, + kIONDRVReadCommand = 128 + 2, + kIONDRVWriteCommand = 128 + 3, + kIONDRVControlCommand = 128 + 4, + kIONDRVStatusCommand = 128 + 5, + kIONDRVKillIOCommand = 128 + 6, + kIONDRVInitializeCommand = 128 + 7, /* init driver and device*/ + kIONDRVFinalizeCommand = 128 + 8, /* shutdown driver and device*/ + kIONDRVReplaceCommand = 128 + 9, /* replace an old driver*/ + kIONDRVSupersededCommand = 128 + 10 /* prepare to be replaced by a new driver*/ +}; +enum { + kIONDRVSynchronousIOCommandKind = 0x00000001, + kIONDRVAsynchronousIOCommandKind = 0x00000002, + kIONDRVImmediateIOCommandKind = 0x00000004 +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __QUICKDRAW__ */ + +#endif /* _IOKIT_IOMACOSTYPES_H */ diff --git a/i386/include/IOKit/ndrvsupport/.svn/text-base/IOMacOSVideo.h.svn-base b/i386/include/IOKit/ndrvsupport/.svn/text-base/IOMacOSVideo.h.svn-base new file mode 100644 index 0000000..795072b --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/text-base/IOMacOSVideo.h.svn-base @@ -0,0 +1,1391 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + File: Video.h + + Contains: Video Driver Interfaces. + + Copyright: (c) 1986-2000 by Apple Computer, Inc., all rights reserved + + Bugs?: For bug reports, consult the following page on + the World Wide Web: + + http://developer.apple.com/bugreporter/ + +*/ +#ifndef __IOMACOSVIDEO__ +#define __IOMACOSVIDEO__ + +#define PRAGMA_STRUCT_ALIGN 1 +#define FOUR_CHAR_CODE(x) (x) +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +enum { + mBaseOffset = 1, /*Id of mBaseOffset.*/ + mRowBytes = 2, /*Video sResource parameter Id's */ + mBounds = 3, /*Video sResource parameter Id's */ + mVersion = 4, /*Video sResource parameter Id's */ + mHRes = 5, /*Video sResource parameter Id's */ + mVRes = 6, /*Video sResource parameter Id's */ + mPixelType = 7, /*Video sResource parameter Id's */ + mPixelSize = 8, /*Video sResource parameter Id's */ + mCmpCount = 9, /*Video sResource parameter Id's */ + mCmpSize = 10, /*Video sResource parameter Id's */ + mPlaneBytes = 11, /*Video sResource parameter Id's */ + mVertRefRate = 14, /*Video sResource parameter Id's */ + mVidParams = 1, /*Video parameter block id.*/ + mTable = 2, /*Offset to the table.*/ + mPageCnt = 3, /*Number of pages*/ + mDevType = 4, /*Device Type*/ + oneBitMode = 128, /*Id of OneBitMode Parameter list.*/ + twoBitMode = 129, /*Id of TwoBitMode Parameter list.*/ + fourBitMode = 130, /*Id of FourBitMode Parameter list.*/ + eightBitMode = 131 /*Id of EightBitMode Parameter list.*/ +}; + +enum { + sixteenBitMode = 132, /*Id of SixteenBitMode Parameter list.*/ + thirtyTwoBitMode = 133, /*Id of ThirtyTwoBitMode Parameter list.*/ + firstVidMode = 128, /*The new, better way to do the above. */ + secondVidMode = 129, /* QuickDraw only supports six video */ + thirdVidMode = 130, /* at this time. */ + fourthVidMode = 131, + fifthVidMode = 132, + sixthVidMode = 133, + spGammaDir = 64, + spVidNamesDir = 65 +}; + +typedef UInt32 AVIDType; +typedef AVIDType DisplayIDType; +typedef IODisplayModeID DisplayModeID; +typedef UInt16 DepthMode; +typedef UInt32 VideoDeviceType; +typedef UInt32 GammaTableID; + +/* csTimingFormat values in VDTimingInfo */ +/* look in the declaration rom for timing info */ +enum { + kDeclROMtables = FOUR_CHAR_CODE('decl'), + kDetailedTimingFormat = FOUR_CHAR_CODE('arba') /* Timing is a detailed timing*/ +}; + +/* Size of a block of EDID (Extended Display Identification Data) */ +enum { + kDDCBlockSize = 128 +}; + +/* ddcBlockType constants*/ +enum { + kDDCBlockTypeEDID = 0 /* EDID block type. */ +}; + +/* ddcFlags constants*/ +enum { + kDDCForceReadBit = 0, /* Force a new read of the EDID. */ + kDDCForceReadMask = (1 << kDDCForceReadBit) /* Mask for kddcForceReadBit. */ +}; + + +/* Timing mode constants for Display Manager MultiMode support + Corresponding .h equates are in Video.h + .a equates are in Video.a + .r equates are in DepVideoEqu.r + + The second enum is the old names (for compatibility). + The first enum is the new names. +*/ +enum { + timingInvalid = 0, /* Unknown timing... force user to confirm. */ + timingInvalid_SM_T24 = 8, /* Work around bug in SM Thunder24 card.*/ + timingApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/ + timingApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ + timingApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ + timingApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ + timingApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ + timingVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ + timingVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ + timingVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ + timingVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ + timingGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ + timingApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ + timingApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ + timingApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ + timingVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ + timingVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ + timingVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ + timingVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ + timingVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ + timingVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ + timingVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ + timingVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to timingApple_1024x768_75hz). */ + timingVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ + timingApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ + timingApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ + timingAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */ + timingAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */ + timingAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */ + timingAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */ + timingApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */ + timingApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */ + timingApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */ + timingApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */ + timingVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ + timingVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ + timingVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ + timingVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ + timingVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ + timingVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ + timingVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */ + timingVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */ + timingVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */ + timingVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */ + timingVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */ + timingVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */ + timingVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */ + timingVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */ + timingVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */ + timingVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */ + timingVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */ + timingVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */ + timingSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ + timingFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ + timingSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */ + timingSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */ + timingSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */ + timingSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */ + timingApple_0x0_0hz_Offline = 550 /* Indicates that this timing will take the display off-line and remove it from the system. */ +}; + + +/* Deprecated timing names.*/ +enum { + timingApple12 = timingApple_512x384_60hz, + timingApple12x = timingApple_560x384_60hz, + timingApple13 = timingApple_640x480_67hz, + timingApple13x = timingApple_640x400_67hz, + timingAppleVGA = timingVESA_640x480_60hz, + timingApple15 = timingApple_640x870_75hz, + timingApple15x = timingApple_640x818_75hz, + timingApple16 = timingApple_832x624_75hz, + timingAppleSVGA = timingVESA_800x600_56hz, + timingApple1Ka = timingVESA_1024x768_60hz, + timingApple1Kb = timingVESA_1024x768_70hz, + timingApple19 = timingApple_1024x768_75hz, + timingApple21 = timingApple_1152x870_75hz, + timingSony_1900x1200_74hz = 530, /* 1900x1200 (74 Hz) Sony timing (pixel clock is 236.25 Mhz dot clock). */ + timingSony_1900x1200_76hz = timingSony_1920x1200_76hz /* 1900x1200 (76 Hz) Sony timing (pixel clock is 245.48 Mhz dot clock). */ +}; + +/* csConnectFlags values in VDDisplayConnectInfo */ +enum { + kAllModesValid = 0, /* All modes not trimmed by primary init are good close enough to try */ + kAllModesSafe = 1, /* All modes not trimmed by primary init are know to be safe */ + kReportsTagging = 2, /* Can detect tagged displays (to identify smart monitors) */ + kHasDirectConnection = 3, /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */ + kIsMonoDev = 4, /* Says whether there's an RGB (0) or Monochrome (1) connection. */ + kUncertainConnection = 5, /* There may not be a display (no sense lines?). */ + kTaggingInfoNonStandard = 6, /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */ + kReportsDDCConnection = 7, /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */ + kHasDDCConnection = 8, /* Card has ddc connect now. */ + kConnectionInactive = 9, /* Set when the connection is NOT currently active (generally used in a multiconnection environment). */ + kDependentConnection = 10, /* Set when some ascpect of THIS connection depends on another (will generally be set in a kModeSimulscan environment). */ + kBuiltInConnection = 11, /* Set when connection is KNOWN to be built-in (this is not the same as kHasDirectConnection). */ + kOverrideConnection = 12, /* Set when the reported connection is not the true one, but is one that has been forced through a SetConnection call */ + kFastCheckForDDC = 13, /* Set when all 3 are true: 1) sense codes indicate DDC display could be attached 2) attempted fast check 3) DDC failed */ + kReportsHotPlugging = 14, /* Detects and reports hot pluggging on connector (via VSL also implies DDC will be up to date w/o force read) */ + kStereoSyncConnection = 15 /* Connection supports stereo sync signalling */ +}; + + +/* csDisplayType values in VDDisplayConnectInfo */ +enum { + kUnknownConnect = 1, /* Not sure how we'll use this, but seems like a good idea. */ + kPanelConnect = 2, /* For use with fixed-in-place LCD panels. */ + kPanelTFTConnect = 2, /* Alias for kPanelConnect */ + kFixedModeCRTConnect = 3, /* For use with fixed-mode (i.e., very limited range) displays. */ + kMultiModeCRT1Connect = 4, /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */ + kMultiModeCRT2Connect = 5, /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */ + kMultiModeCRT3Connect = 6, /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */ + kMultiModeCRT4Connect = 7, /* Expansion to large multi mode (not yet used) */ + kModelessConnect = 8, /* Expansion to modeless model (not yet used) */ + kFullPageConnect = 9, /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */ + kVGAConnect = 10, /* 640x480 VGA default -- question everything else */ + kNTSCConnect = 11, /* NTSC ST (default), FF, STconv, FFconv */ + kPALConnect = 12, /* PAL ST (default), FF, STconv, FFconv */ + kHRConnect = 13, /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */ + kPanelFSTNConnect = 14, /* For use with fixed-in-place LCD FSTN (aka "Supertwist") panels */ + kMonoTwoPageConnect = 15, /* 1152x870 Apple color two-page display */ + kColorTwoPageConnect = 16, /* 1152x870 Apple B&W two-page display */ + kColor16Connect = 17, /* 832x624 Apple B&W two-page display */ + kColor19Connect = 18, /* 1024x768 Apple B&W two-page display */ + kGenericCRT = 19, /* Indicates nothing except that connection is CRT in nature. */ + kGenericLCD = 20, /* Indicates nothing except that connection is LCD in nature. */ + kDDCConnect = 21, /* DDC connection, always set kHasDDCConnection */ + kNoConnect = 22 /* No display is connected - load sensing or similar level of hardware detection is assumed (used by resident drivers that support hot plugging when nothing is currently connected) */ +}; + +/* csTimingFlags values in VDTimingInfoRec */ +enum { + kModeValid = 0, /* Says that this mode should NOT be trimmed. */ + kModeSafe = 1, /* This mode does not need confirmation */ + kModeDefault = 2, /* This is the default mode for this type of connection */ + kModeShowNow = 3, /* This mode should always be shown (even though it may require a confirm) */ + kModeNotResize = 4, /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */ + kModeRequiresPan = 5, /* This mode has more pixels than are actually displayed */ + kModeInterlaced = 6, /* This mode is interlaced (single pixel lines look bad). */ + kModeShowNever = 7, /* This mode should not be shown in the user interface. */ + kModeSimulscan = 8, /* Indicates that more than one display connection can be driven from a single framebuffer controller. */ + kModeNotPreset = 9, /* Indicates that the timing is not a factory preset for the current display (geometry may need correction) */ + kModeBuiltIn = 10, /* Indicates that the display mode is for the built-in connect only (on multiconnect devices like the PB 3400) Only the driver is quieried */ + kModeStretched = 11, /* Indicates that the display mode will be stretched/distorted to match the display aspect ratio */ + kModeNotGraphicsQuality = 12, /* Indicates that the display mode is not the highest quality (eg. stretching artifacts). Intended as a hint */ + kModeValidateAgainstDisplay = 13 /* Indicates that this mode should be validated against the display EDID */ +}; + +/* csDepthFlags in VDVideoParametersInfoRec */ +enum { + kDepthDependent = 0, /* Says that this depth mode may cause dependent changes in other framebuffers (and . */ + kDepthDependentMask = (1 << kDepthDependent) /* mask for kDepthDependent */ +}; + +/* csResolutionFlags bit flags for VDResolutionInfoRec */ +enum { + kResolutionHasMultipleDepthSizes = 0 /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */ +}; + + +enum { + /* Power Mode constants for VDPowerStateRec.powerState. Note the numeric order does not match the power state order */ + kAVPowerOff = 0, /* Power fully off*/ + kAVPowerStandby = 1, + kAVPowerSuspend = 2, + kAVPowerOn = 3, + kHardwareSleep = 128, + kHardwareWake = 129, + kHardwareWakeFromSuspend = 130, + kHardwareWakeToDoze = 131, + kHardwareWakeToDozeFromSuspend = 132, + kHardwarePark = 133, + kHardwareDrive = 134 +}; + +/* Reduced perf level, for GetPowerState, SetPowerState*/ +enum { + kPowerStateReducedPowerMask = 0x00000300, + kPowerStateFullPower = 0x00000000, + kPowerStateReducedPower1 = 0x00000100, + kPowerStateReducedPower2 = 0x00000200, + kPowerStateReducedPower3 = 0x00000300 +}; + +enum { + /* Power Mode masks and bits for VDPowerStateRec.powerFlags. */ + kPowerStateNeedsRefresh = 0, /* When leaving this power mode, a display will need refreshing */ + kPowerStateSleepAwareBit = 1, /* if gestaltPCCardDockingSelectorFix, Docking mgr checks this bit before checking kPowerStateSleepAllowedBit */ + kPowerStateSleepForbiddenBit = 2, /* if kPowerStateSleepAwareBit, Docking mgr checks this bit before sleeping */ + kPowerStateSleepCanPowerOffBit = 3, /* supports power down sleep (ie PCI power off)*/ + kPowerStateSleepNoDPMSBit = 4, /* Bug #2425210. Do not use DPMS with this display.*/ + kPowerStateSleepWaketoDozeBit = 5, /* Supports Wake to Doze */ + kPowerStateSleepWakeNeedsProbeBit = 6, /* Does not sense connection changes on wake */ + + kPowerStateNeedsRefreshMask = (1 << kPowerStateNeedsRefresh), + kPowerStateSleepAwareMask = (1 << kPowerStateSleepAwareBit), + kPowerStateSleepForbiddenMask = (1 << kPowerStateSleepForbiddenBit), + kPowerStateSleepCanPowerOffMask = (1 << kPowerStateSleepCanPowerOffBit), + kPowerStateSleepNoDPMSMask = (1 << kPowerStateSleepNoDPMSBit), + kPowerStateSleepWaketoDozeMask = (1 << kPowerStateSleepWaketoDozeBit), + kPowerStateSleepWakeNeedsProbeMask = (1 << kPowerStateSleepWakeNeedsProbeBit), + + kPowerStateSupportsReducedPower1Bit = 10, + kPowerStateSupportsReducedPower2Bit = 11, + kPowerStateSupportsReducedPower3Bit = 12, + kPowerStateSupportsReducedPower1BitMask = (1 << 10), + kPowerStateSupportsReducedPower2BitMask = (1 << 11), + kPowerStateSupportsReducedPower3BitMask = (1 << 12) +}; + + +enum { + /* Control Codes */ + cscReset = 0, + cscKillIO = 1, + cscSetMode = 2, + cscSetEntries = 3, + cscSetGamma = 4, + cscGrayPage = 5, + cscGrayScreen = 5, + cscSetGray = 6, + cscSetInterrupt = 7, + cscDirectSetEntries = 8, + cscSetDefaultMode = 9, + cscSwitchMode = 10, /* Takes a VDSwitchInfoPtr */ + cscSetSync = 11, /* Takes a VDSyncInfoPtr */ + cscSavePreferredConfiguration = 16, /* Takes a VDSwitchInfoPtr */ + cscSetHardwareCursor = 22, /* Takes a VDSetHardwareCursorPtr */ + cscDrawHardwareCursor = 23, /* Takes a VDDrawHardwareCursorPtr */ + cscSetConvolution = 24, /* Takes a VDConvolutionInfoPtr */ + cscSetPowerState = 25, /* Takes a VDPowerStatePtr */ + cscPrivateControlCall = 26, /* Takes a VDPrivateSelectorDataRec*/ + cscSetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/ + cscSetClutBehavior = 29, /* Takes a VDClutBehavior */ + cscSetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */ + cscDoCommunication = 33, /* Takes a VDCommunicationPtr */ + cscProbeConnection = 34, /* Takes nil pointer */ + /* (may generate a kFBConnectInterruptServiceType service interrupt) */ + cscSetScaler = 36, /* Takes a VDScalerPtr */ + cscSetMirror = 37, /* Takes a VDMirrorPtr*/ + cscSetFeatureConfiguration = 38, /* Takes a VDConfigurationPtr*/ + cscUnusedCall = 127 /* This call used to expand the scrn resource. Its imbedded data contains more control info */ +}; + +enum { + /* Status Codes */ + cscGetMode = 2, + cscGetEntries = 3, + cscGetPageCnt = 4, + cscGetPages = 4, /* This is what C&D 2 calls it. */ + cscGetPageBase = 5, + cscGetBaseAddr = 5, /* This is what C&D 2 calls it. */ + cscGetGray = 6, + cscGetInterrupt = 7, + cscGetGamma = 8, + cscGetDefaultMode = 9, + cscGetCurMode = 10, /* Takes a VDSwitchInfoPtr */ + cscGetSync = 11, /* Takes a VDSyncInfoPtr */ + cscGetConnection = 12, /* Return information about the connection to the display */ + cscGetModeTiming = 13, /* Return timing info for a mode */ + cscGetModeBaseAddress = 14, /* Return base address information about a particular mode */ + cscGetScanProc = 15, /* QuickTime scan chasing routine */ + cscGetPreferredConfiguration = 16, /* Takes a VDSwitchInfoPtr */ + cscGetNextResolution = 17, /* Takes a VDResolutionInfoPtr */ + cscGetVideoParameters = 18, /* Takes a VDVideoParametersInfoPtr */ + cscGetGammaInfoList = 20, /* Takes a VDGetGammaListPtr */ + cscRetrieveGammaTable = 21, /* Takes a VDRetrieveGammaPtr */ + cscSupportsHardwareCursor = 22, /* Takes a VDSupportsHardwareCursorPtr */ + cscGetHardwareCursorDrawState = 23, /* Takes a VDHardwareCursorDrawStatePtr */ + cscGetConvolution = 24, /* Takes a VDConvolutionInfoPtr */ + cscGetPowerState = 25, /* Takes a VDPowerStatePtr */ + cscPrivateStatusCall = 26, /* Takes a VDPrivateSelectorDataRec*/ + cscGetDDCBlock = 27, /* Takes a VDDDCBlockRec */ + cscGetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/ + cscGetClutBehavior = 29, /* Takes a VDClutBehavior */ + cscGetTimingRanges = 30, /* Takes a VDDisplayTimingRangePtr */ + cscGetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */ + cscGetCommunicationInfo = 32, /* Takes a VDCommunicationInfoPtr */ + cscGetScalerInfo = 35, /* Takes a VDScalerInfoPtr */ + cscGetScaler = 36, /* Takes a VDScalerPtr */ + cscGetMirror = 37, /* Takes a VDMirrorPtr*/ + cscGetFeatureConfiguration = 38, /* Takes a VDConfigurationPtr*/ + cscGetFeatureList = 39 +}; + +/* Bit definitions for the Get/Set Sync call*/ +enum { + kDisableHorizontalSyncBit = 0, + kDisableVerticalSyncBit = 1, + kDisableCompositeSyncBit = 2, + kEnableSyncOnBlue = 3, + kEnableSyncOnGreen = 4, + kEnableSyncOnRed = 5, + kNoSeparateSyncControlBit = 6, + kTriStateSyncBit = 7, + kHorizontalSyncMask = 0x01, + kVerticalSyncMask = 0x02, + kCompositeSyncMask = 0x04, + kDPMSSyncMask = 0x07, + kTriStateSyncMask = 0x80, + kSyncOnBlueMask = 0x08, + kSyncOnGreenMask = 0x10, + kSyncOnRedMask = 0x20, + kSyncOnMask = 0x38 +}; + +enum { + /* Power Mode constants for translating DPMS modes to Get/SetSync calls. */ + kDPMSSyncOn = 0, + kDPMSSyncStandby = 1, + kDPMSSyncSuspend = 2, + kDPMSSyncOff = 7 +}; + +/* Bit definitions for the Get/Set Convolution call*/ +enum { + kConvolved = 0, + kLiveVideoPassThru = 1, + kConvolvedMask = 0x01, + kLiveVideoPassThruMask = 0x02 +}; + + + +struct VPBlock { + UInt32 vpBaseOffset; /*Offset to page zero of video RAM (From minorBaseOS).*/ +#if __LP64__ + UInt32 vpRowBytes; /*Width of each row of video memory.*/ +#else + SInt16 vpRowBytes; /*Width of each row of video memory.*/ +#endif + Rect vpBounds; /*BoundsRect for the video display (gives dimensions).*/ + SInt16 vpVersion; /*PixelMap version number.*/ + SInt16 vpPackType; + UInt32 vpPackSize; + UInt32 vpHRes; /*Horizontal resolution of the device (pixels per inch).*/ + UInt32 vpVRes; /*Vertical resolution of the device (pixels per inch).*/ + SInt16 vpPixelType; /*Defines the pixel type.*/ + SInt16 vpPixelSize; /*Number of bits in pixel.*/ + SInt16 vpCmpCount; /*Number of components in pixel.*/ + SInt16 vpCmpSize; /*Number of bits per component*/ + UInt32 vpPlaneBytes; /*Offset from one plane to the next.*/ +}; +typedef struct VPBlock VPBlock; +typedef VPBlock * VPBlockPtr; + +struct VDEntryRecord { + Ptr csTable; /* pointer to color table entry=value, r,g,b:INTEGER*/ +}; +typedef struct VDEntryRecord VDEntryRecord; + +typedef VDEntryRecord * VDEntRecPtr; +/* Parm block for SetGray control call */ + +struct VDGrayRecord { + Boolean csMode; /*Same as GDDevType value (0=color, 1=mono)*/ + SInt8 filler; +}; +typedef struct VDGrayRecord VDGrayRecord; + +typedef VDGrayRecord * VDGrayPtr; +/* Parm block for SetInterrupt call */ + +struct VDFlagRecord { + SInt8 csMode; + SInt8 filler; +}; +typedef struct VDFlagRecord VDFlagRecord; + +typedef VDFlagRecord * VDFlagRecPtr; +/* Parm block for SetEntries control call */ + +struct VDSetEntryRecord { + ColorSpec * csTable; /*Pointer to an array of color specs*/ + SInt16 csStart; /*Which spec in array to start with, or -1*/ + SInt16 csCount; /*Number of color spec entries to set*/ +}; +typedef struct VDSetEntryRecord VDSetEntryRecord; + +typedef VDSetEntryRecord * VDSetEntryPtr; +/* Parm block for SetGamma control call */ + +struct VDGammaRecord { + Ptr csGTable; /*pointer to gamma table*/ +}; +typedef struct VDGammaRecord VDGammaRecord; + +typedef VDGammaRecord * VDGamRecPtr; + +struct VDSwitchInfoRec { + DepthMode csMode; /* mode depth*/ + DisplayModeID csData; /* functional sResource of mode*/ + UInt16 csPage; /* page to switch in*/ + Ptr csBaseAddr; /* base address of page (return value)*/ + uintptr_t csReserved; /* Reserved (set to 0) */ +}; +typedef struct VDSwitchInfoRec VDSwitchInfoRec; + +typedef VDSwitchInfoRec * VDSwitchInfoPtr; + +struct VDTimingInfoRec { + DisplayModeID csTimingMode; /* timing mode (a la InitGDevice) */ + uintptr_t csTimingReserved; /* reserved */ + UInt32 csTimingFormat; /* what format is the timing info */ + UInt32 csTimingData; /* data supplied by driver */ + UInt32 csTimingFlags; /* mode within device */ +}; +typedef struct VDTimingInfoRec VDTimingInfoRec; + +typedef VDTimingInfoRec * VDTimingInfoPtr; + +struct VDDisplayConnectInfoRec { + UInt16 csDisplayType; /* Type of display connected */ + UInt8 csConnectTaggedType; /* type of tagging */ + UInt8 csConnectTaggedData; /* tagging data */ + UInt32 csConnectFlags; /* tell us about the connection */ + uintptr_t csDisplayComponent; /* if the card has a direct connection to the display, it returns the display component here (FUTURE) */ + uintptr_t csConnectReserved; /* reserved */ +}; +typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec; + +typedef VDDisplayConnectInfoRec * VDDisplayConnectInfoPtr; + +struct VDMultiConnectInfoRec { + UInt32 csDisplayCountOrNumber; /* For GetMultiConnect, returns count n of 1..n connections; otherwise, indicates the ith connection.*/ + VDDisplayConnectInfoRec csConnectInfo; /* Standard VDDisplayConnectionInfo for connection i.*/ +}; +typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec; + +typedef VDMultiConnectInfoRec * VDMultiConnectInfoPtr; +/* RawSenseCode + This abstract data type is not exactly abstract. Rather, it is merely enumerated constants + for the possible raw sense code values when 'standard' sense code hardware is implemented. + + For 'standard' sense code hardware, the raw sense is obtained as follows: + o Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines + o Read the state of the monitor sense lines 2, 1, and 0. (2 is the MSB, 0 the LSB) + + IMPORTANT Note: + When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants + are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo' + +*/ +typedef UInt8 RawSenseCode; +enum { + kRSCZero = 0, + kRSCOne = 1, + kRSCTwo = 2, + kRSCThree = 3, + kRSCFour = 4, + kRSCFive = 5, + kRSCSix = 6, + kRSCSeven = 7 +}; + + +/* ExtendedSenseCode + This abstract data type is not exactly abstract. Rather, it is merely enumerated constants + for the values which are possible when the extended sense algorithm is applied to hardware + which implements 'standard' sense code hardware. + + For 'standard' sense code hardware, the extended sense code algorithm is as follows: + (Note: as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0') + o Drive sense line 'A' low and read the values of 'B' and 'C'. + o Drive sense line 'B' low and read the values of 'A' and 'C'. + o Drive sense line 'C' low and read the values of 'A' and 'B'. + + In this way, a six-bit number of the form BC/AC/AB is generated. + + IMPORTANT Note: + When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants + are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo' + +*/ +typedef UInt8 ExtendedSenseCode; +enum { + kESCZero21Inch = 0x00, /* 21" RGB */ + kESCOnePortraitMono = 0x14, /* Portrait Monochrome */ + kESCTwo12Inch = 0x21, /* 12" RGB */ + kESCThree21InchRadius = 0x31, /* 21" RGB (Radius) */ + kESCThree21InchMonoRadius = 0x34, /* 21" Monochrome (Radius) */ + kESCThree21InchMono = 0x35, /* 21" Monochrome */ + kESCFourNTSC = 0x0A, /* NTSC */ + kESCFivePortrait = 0x1E, /* Portrait RGB */ + kESCSixMSB1 = 0x03, /* MultiScan Band-1 (12" thru 1Six") */ + kESCSixMSB2 = 0x0B, /* MultiScan Band-2 (13" thru 19") */ + kESCSixMSB3 = 0x23, /* MultiScan Band-3 (13" thru 21") */ + kESCSixStandard = 0x2B, /* 13"/14" RGB or 12" Monochrome */ + kESCSevenPAL = 0x00, /* PAL */ + kESCSevenNTSC = 0x14, /* NTSC */ + kESCSevenVGA = 0x17, /* VGA */ + kESCSeven16Inch = 0x2D, /* 16" RGB (GoldFish) */ + kESCSevenPALAlternate = 0x30, /* PAL (Alternate) */ + kESCSeven19Inch = 0x3A, /* Third-Party 19" */ + kESCSevenDDC = 0x3E, /* DDC display */ + kESCSevenNoDisplay = 0x3F /* No display connected */ +}; + +/* DepthMode + This abstract data type is used to to reference RELATIVE pixel depths. + Its definition is largely derived from its past usage, analogous to 'xxxVidMode' + + Bits per pixel DOES NOT directly map to 'DepthMode' For example, on some + graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other + hardware, 'kDepthMode1' may represent 8BPP. + + DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc. + behave as expected. The values of the constants which comprise the set are such + that 'kDepthMode4 < kDepthMode6' behaves as expected. +*/ +enum { + kDepthMode1 = 128, + kDepthMode2 = 129, + kDepthMode3 = 130, + kDepthMode4 = 131, + kDepthMode5 = 132, + kDepthMode6 = 133 +}; + +enum { + kFirstDepthMode = 128, /* These constants are obsolete, and just included */ + kSecondDepthMode = 129, /* for clients that have converted to the above */ + kThirdDepthMode = 130, /* kDepthModeXXX constants. */ + kFourthDepthMode = 131, + kFifthDepthMode = 132, + kSixthDepthMode = 133 +}; + + + +struct VDPageInfo { + DepthMode csMode; /* mode within device*/ + DisplayModeID csData; /* data supplied by driver*/ + SInt16 csPage; /* page to switch in*/ + Ptr csBaseAddr; /* base address of page*/ +}; +typedef struct VDPageInfo VDPageInfo; + +typedef VDPageInfo * VDPgInfoPtr; + +struct VDSizeInfo { + SInt16 csHSize; /* desired/returned h size*/ + SInt16 csHPos; /* desired/returned h position*/ + SInt16 csVSize; /* desired/returned v size*/ + SInt16 csVPos; /* desired/returned v position*/ +}; +typedef struct VDSizeInfo VDSizeInfo; + +typedef VDSizeInfo * VDSzInfoPtr; + +struct VDSettings { + SInt16 csParamCnt; /* number of params*/ + SInt16 csBrightMax; /* max brightness*/ + SInt16 csBrightDef; /* default brightness*/ + SInt16 csBrightVal; /* current brightness*/ + SInt16 csCntrstMax; /* max contrast*/ + SInt16 csCntrstDef; /* default contrast*/ + SInt16 csCntrstVal; /* current contrast*/ + SInt16 csTintMax; /* max tint*/ + SInt16 csTintDef; /* default tint*/ + SInt16 csTintVal; /* current tint*/ + SInt16 csHueMax; /* max hue*/ + SInt16 csHueDef; /* default hue*/ + SInt16 csHueVal; /* current hue*/ + SInt16 csHorizDef; /* default horizontal*/ + SInt16 csHorizVal; /* current horizontal*/ + SInt16 csHorizMax; /* max horizontal*/ + SInt16 csVertDef; /* default vertical*/ + SInt16 csVertVal; /* current vertical*/ + SInt16 csVertMax; /* max vertical*/ +}; +typedef struct VDSettings VDSettings; +typedef VDSettings * VDSettingsPtr; + +struct VDDefMode { + UInt8 csID; + SInt8 filler; +}; +typedef struct VDDefMode VDDefMode; +typedef VDDefMode * VDDefModePtr; + +struct VDSyncInfoRec { + UInt8 csMode; + UInt8 csFlags; +}; +typedef struct VDSyncInfoRec VDSyncInfoRec; + +typedef VDSyncInfoRec * VDSyncInfoPtr; +/* + All displayModeID values from 0x80000000 to 0xFFFFFFFF and 0x00 + are reserved for Apple Computer. +*/ +/* Constants for the cscGetNextResolution call */ +enum { + kDisplayModeIDCurrent = 0x00, /* Reference the Current DisplayModeID */ + kDisplayModeIDInvalid = (IODisplayModeID)0xFFFFFFFF, /* A bogus DisplayModeID in all cases */ + kDisplayModeIDFindFirstResolution = (IODisplayModeID)0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */ + kDisplayModeIDNoMoreResolutions = (IODisplayModeID)0xFFFFFFFD, /* Used in cscGetNextResolution to indicate End Of List */ + kDisplayModeIDFindFirstProgrammable = (IODisplayModeID)0xFFFFFFFC, /* Used in cscGetNextResolution to find unused programmable timing */ + kDisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, /* This is the ID given at boot time by the OF driver to a programmable timing */ + kDisplayModeIDReservedBase = (IODisplayModeID)0x80000000 /* Lowest (unsigned) DisplayModeID reserved by Apple */ +}; + +/* Constants for the GetGammaInfoList call */ +enum { + kGammaTableIDFindFirst = (GammaTableID)0xFFFFFFFE, /* Get the first gamma table ID */ + kGammaTableIDNoMoreTables = (GammaTableID)0xFFFFFFFD, /* Used to indicate end of list */ + kGammaTableIDSpecific = 0x00 /* Return the info for the given table id */ +}; + +/* Constants for GetMultiConnect call*/ +enum { + kGetConnectionCount = 0xFFFFFFFF, /* Used to get the number of possible connections in a "multi-headed" framebuffer environment.*/ + kActivateConnection = (0 << kConnectionInactive), /* Used for activating a connection (csConnectFlags value).*/ + kDeactivateConnection = (1 << kConnectionInactive) /* Used for deactivating a connection (csConnectFlags value.)*/ +}; + +/* VDCommunicationRec.csBusID values*/ +enum { + kVideoDefaultBus = 0 +}; + + +/* VDCommunicationInfoRec.csBusType values*/ +enum { + kVideoBusTypeInvalid = 0, + kVideoBusTypeI2C = 1, + kVideoBusTypeDisplayPort = 2 +}; + + +/* VDCommunicationRec.csSendType and VDCommunicationRec.csReplyType values*/ +enum { + kVideoNoTransactionType = 0, /* No transaction*/ + kVideoNoTransactionTypeMask = (1 << kVideoNoTransactionType), + kVideoSimpleI2CType = 1, /* Simple I2C message*/ + kVideoSimpleI2CTypeMask = (1 << kVideoSimpleI2CType), + kVideoDDCciReplyType = 2, /* DDC/ci message (with imbedded length)*/ + kVideoDDCciReplyTypeMask = (1 << kVideoDDCciReplyType), + kVideoCombinedI2CType = 3, /* Combined format I2C R/~W transaction*/ + kVideoCombinedI2CTypeMask = (1 << kVideoCombinedI2CType), + kVideoDisplayPortNativeType = 4, /* DisplayPort Native */ + kVideoDisplayPortNativeTypeMask = (1 << kVideoDisplayPortNativeType) +}; + +// VDCommunicationRec.csCommFlags and VDCommunicationInfoRec.csSupportedCommFlags +enum { + kVideoReplyMicroSecDelayBit = 0, /* If bit set, the driver should delay csMinReplyDelay micro seconds between send and receive*/ + kVideoReplyMicroSecDelayMask = (1 << kVideoReplyMicroSecDelayBit), + kVideoUsageAddrSubAddrBit = 1, /* If bit set, the driver understands to use the lower 16 bits of the address field as two 8 bit values (address/subaddress) for the I2C transaction*/ + kVideoUsageAddrSubAddrMask = (1 << kVideoUsageAddrSubAddrBit) +}; + + +struct VDResolutionInfoRec { + DisplayModeID csPreviousDisplayModeID; /* ID of the previous resolution in a chain */ + DisplayModeID csDisplayModeID; /* ID of the next resolution */ + UInt32 csHorizontalPixels; /* # of pixels in a horizontal line at the max depth */ + UInt32 csVerticalLines; /* # of lines in a screen at the max depth */ + Fixed csRefreshRate; /* Vertical Refresh Rate in Hz */ + DepthMode csMaxDepthMode; /* 0x80-based number representing max bit depth */ + UInt32 csResolutionFlags; /* Reserved - flag bits */ + uintptr_t csReserved; /* Reserved */ +}; +typedef struct VDResolutionInfoRec VDResolutionInfoRec; + +typedef VDResolutionInfoRec * VDResolutionInfoPtr; + +struct VDVideoParametersInfoRec { + DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ + DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ + VPBlockPtr csVPBlockPtr; /* Pointer to a video parameter block */ + UInt32 csPageCount; /* Number of pages supported by the resolution */ + VideoDeviceType csDeviceType; /* Device Type: Direct, Fixed or CLUT; */ + UInt32 csDepthFlags; /* Flags */ +}; +typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec; + +typedef VDVideoParametersInfoRec * VDVideoParametersInfoPtr; + +struct VDGammaInfoRec { + GammaTableID csLastGammaID; /* the ID of the previous gamma table */ + GammaTableID csNextGammaID; /* the ID of the next gamma table */ + Ptr csGammaPtr; /* Ptr to a gamma table data */ + uintptr_t csReserved; /* Reserved */ +}; +typedef struct VDGammaInfoRec VDGammaInfoRec; + +typedef VDGammaInfoRec * VDGammaInfoPtr; + +struct VDGetGammaListRec { + GammaTableID csPreviousGammaTableID; /* ID of the previous gamma table */ + GammaTableID csGammaTableID; /* ID of the gamma table following csPreviousDisplayModeID */ + UInt32 csGammaTableSize; /* Size of the gamma table in bytes */ + char * csGammaTableName; /* Gamma table name (c-string) */ +}; +typedef struct VDGetGammaListRec VDGetGammaListRec; + +typedef VDGetGammaListRec * VDGetGammaListPtr; + +struct VDRetrieveGammaRec { + GammaTableID csGammaTableID; /* ID of gamma table to retrieve */ + GammaTbl * csGammaTablePtr; /* Location to copy desired gamma to */ +}; +typedef struct VDRetrieveGammaRec VDRetrieveGammaRec; + +typedef VDRetrieveGammaRec * VDRetrieveGammaPtr; + +struct VDSetHardwareCursorRec { + void * csCursorRef; /* reference to cursor data */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* should be ignored */ +}; +typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec; + +typedef VDSetHardwareCursorRec * VDSetHardwareCursorPtr; + +struct VDDrawHardwareCursorRec { + SInt32 csCursorX; /* x coordinate */ + SInt32 csCursorY; /* y coordinate */ + UInt32 csCursorVisible; /* true if cursor is must be visible */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* should be ignored */ +}; +typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec; + +typedef VDDrawHardwareCursorRec * VDDrawHardwareCursorPtr; + +struct VDSupportsHardwareCursorRec { + UInt32 csSupportsHardwareCursor; + /* true if hardware cursor is supported */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* must be zero */ +}; +typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec; + +typedef VDSupportsHardwareCursorRec * VDSupportsHardwareCursorPtr; + +struct VDHardwareCursorDrawStateRec { + SInt32 csCursorX; /* x coordinate */ + SInt32 csCursorY; /* y coordinate */ + UInt32 csCursorVisible; /* true if cursor is visible */ + UInt32 csCursorSet; /* true if cursor successfully set by last set control call */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* must be zero */ +}; +typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec; + +typedef VDHardwareCursorDrawStateRec * VDHardwareCursorDrawStatePtr; + +struct VDConvolutionInfoRec { + DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ + DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ + UInt32 csPage; + UInt32 csFlags; + UInt32 csReserved; +}; +typedef struct VDConvolutionInfoRec VDConvolutionInfoRec; + +typedef VDConvolutionInfoRec * VDConvolutionInfoPtr; + +struct VDPowerStateRec { + UInt32 powerState; + UInt32 powerFlags; + + uintptr_t powerReserved1; + uintptr_t powerReserved2; +}; +typedef struct VDPowerStateRec VDPowerStateRec; + +typedef VDPowerStateRec * VDPowerStatePtr; +/* + Private Data to video drivers. + + In versions of MacOS with multiple address spaces (System 8), the OS + must know the extent of parameters in order to move them between the caller + and driver. The old private-selector model for video drivers does not have + this information so: + + For post-7.x Systems private calls should be implemented using the cscPrivateCall +*/ + +struct VDPrivateSelectorDataRec { + LogicalAddress privateParameters; /* Caller's parameters*/ + ByteCount privateParametersSize; /* Size of data sent from caller to driver*/ + LogicalAddress privateResults; /* Caller's return area. Can be nil, or same as privateParameters.*/ + ByteCount privateResultsSize; /* Size of data driver returns to caller. Can be nil, or same as privateParametersSize.*/ +}; +typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec; + + +struct VDPrivateSelectorRec { + UInt32 reserved; /* Reserved (set to 0). */ + VDPrivateSelectorDataRec data[1]; +}; +typedef struct VDPrivateSelectorRec VDPrivateSelectorRec; + +struct VDDDCBlockRec { + UInt32 ddcBlockNumber; /* Input -- DDC EDID (Extended Display Identification Data) number (1-based) */ + ResType ddcBlockType; /* Input -- DDC block type (EDID/VDIF) */ + UInt32 ddcFlags; /* Input -- DDC Flags*/ + UInt32 ddcReserved; /* Reserved */ + Byte ddcBlockData[128]; /* Output -- DDC EDID/VDIF data (kDDCBlockSize) */ +}; +typedef struct VDDDCBlockRec VDDDCBlockRec; + +typedef VDDDCBlockRec * VDDDCBlockPtr; + +enum { + /* timingSyncConfiguration*/ + kSyncInterlaceMask = (1 << 7), + kSyncAnalogCompositeMask = 0, + kSyncAnalogCompositeSerrateMask = (1 << 2), + kSyncAnalogCompositeRGBSyncMask = (1 << 1), + kSyncAnalogBipolarMask = (1 << 3), + kSyncAnalogBipolarSerrateMask = (1 << 2), + kSyncAnalogBipolarSRGBSyncMask = (1 << 1), + kSyncDigitalCompositeMask = (1 << 4), + kSyncDigitalCompositeSerrateMask = (1 << 2), + kSyncDigitalCompositeMatchHSyncMask = (1 << 2), + kSyncDigitalSeperateMask = (1 << 4) + (1 << 3), + kSyncDigitalVSyncPositiveMask = (1 << 2), + kSyncDigitalHSyncPositiveMask = (1 << 1) +}; + + + + +struct VDDisplayTimingRangeRec { + UInt32 csRangeSize; /* Init to sizeof(VDDisplayTimingRangeRec) */ + UInt32 csRangeType; /* Init to 0 */ + UInt32 csRangeVersion; /* Init to 0 */ + UInt32 csRangeReserved; /* Init to 0 */ + + UInt32 csRangeBlockIndex; /* Requested block (first index is 0)*/ + UInt32 csRangeGroup; /* set to 0 */ + UInt32 csRangeBlockCount; /* # blocks */ + UInt32 csRangeFlags; /* dependent video */ + + UInt64 csMinPixelClock; /* Min dot clock in Hz */ + UInt64 csMaxPixelClock; /* Max dot clock in Hz */ + + UInt32 csMaxPixelError; /* Max dot clock error */ + UInt32 csTimingRangeSyncFlags; + UInt32 csTimingRangeSignalLevels; + UInt32 csTimingRangeSupportedSignalConfigs; + + UInt32 csMinFrameRate; /* Hz */ + UInt32 csMaxFrameRate; /* Hz */ + UInt32 csMinLineRate; /* Hz */ + UInt32 csMaxLineRate; /* Hz */ + + + UInt32 csMaxHorizontalTotal; /* Clocks - Maximum total (active + blanking) */ + UInt32 csMaxVerticalTotal; /* Clocks - Maximum total (active + blanking) */ + UInt32 csMaxTotalReserved1; /* Reserved */ + UInt32 csMaxTotalReserved2; /* Reserved */ + + + + /* Some cards require that some timing elements*/ + /* be multiples of a "character size" (often 8*/ + /* clocks). The "xxxxCharSize" fields document*/ + /* those requirements.*/ + + + UInt8 csCharSizeHorizontalActive; /* Character size */ + UInt8 csCharSizeHorizontalBlanking; /* Character size */ + UInt8 csCharSizeHorizontalSyncOffset; /* Character size */ + UInt8 csCharSizeHorizontalSyncPulse; /* Character size */ + + UInt8 csCharSizeVerticalActive; /* Character size */ + UInt8 csCharSizeVerticalBlanking; /* Character size */ + UInt8 csCharSizeVerticalSyncOffset; /* Character size */ + UInt8 csCharSizeVerticalSyncPulse; /* Character size */ + + UInt8 csCharSizeHorizontalBorderLeft; /* Character size */ + UInt8 csCharSizeHorizontalBorderRight; /* Character size */ + UInt8 csCharSizeVerticalBorderTop; /* Character size */ + UInt8 csCharSizeVerticalBorderBottom; /* Character size */ + + UInt8 csCharSizeHorizontalTotal; /* Character size for active + blanking */ + UInt8 csCharSizeVerticalTotal; /* Character size for active + blanking */ + UInt16 csCharSizeReserved1; /* Reserved (Init to 0) */ + + + UInt32 csMinHorizontalActiveClocks; + UInt32 csMaxHorizontalActiveClocks; + UInt32 csMinHorizontalBlankingClocks; + UInt32 csMaxHorizontalBlankingClocks; + + UInt32 csMinHorizontalSyncOffsetClocks; + UInt32 csMaxHorizontalSyncOffsetClocks; + UInt32 csMinHorizontalPulseWidthClocks; + UInt32 csMaxHorizontalPulseWidthClocks; + + UInt32 csMinVerticalActiveClocks; + UInt32 csMaxVerticalActiveClocks; + UInt32 csMinVerticalBlankingClocks; + UInt32 csMaxVerticalBlankingClocks; + + UInt32 csMinVerticalSyncOffsetClocks; + UInt32 csMaxVerticalSyncOffsetClocks; + UInt32 csMinVerticalPulseWidthClocks; + UInt32 csMaxVerticalPulseWidthClocks; + + + UInt32 csMinHorizontalBorderLeft; + UInt32 csMaxHorizontalBorderLeft; + UInt32 csMinHorizontalBorderRight; + UInt32 csMaxHorizontalBorderRight; + + UInt32 csMinVerticalBorderTop; + UInt32 csMaxVerticalBorderTop; + UInt32 csMinVerticalBorderBottom; + UInt32 csMaxVerticalBorderBottom; + + UInt32 csMaxNumLinks; /* number of links, if zero, assume link 1 */ + UInt32 csMinLink0PixelClock; /* min pixel clock for link 0 (kHz) */ + UInt32 csMaxLink0PixelClock; /* max pixel clock for link 0 (kHz) */ + UInt32 csMinLink1PixelClock; /* min pixel clock for link 1 (kHz) */ + UInt32 csMaxLink1PixelClock; /* max pixel clock for link 1 (kHz) */ + + UInt32 csReserved6; /* Reserved (Init to 0)*/ + UInt32 csReserved7; /* Reserved (Init to 0)*/ + UInt32 csReserved8; /* Reserved (Init to 0)*/ +}; +typedef struct VDDisplayTimingRangeRec VDDisplayTimingRangeRec; + +typedef VDDisplayTimingRangeRec * VDDisplayTimingRangePtr; + +enum { + /* csDisplayModeState*/ + kDMSModeReady = 0, /* Display Mode ID is configured and ready*/ + kDMSModeNotReady = 1, /* Display Mode ID is is being programmed*/ + kDMSModeFree = 2 /* Display Mode ID is not associated with a timing*/ +}; + + +/* Video driver Errors -10930 to -10959 */ +enum { + kTimingChangeRestrictedErr = -10930, + kVideoI2CReplyPendingErr = -10931, + kVideoI2CTransactionErr = -10932, + kVideoI2CBusyErr = -10933, + kVideoI2CTransactionTypeErr = -10934, + kVideoBufferSizeErr = -10935, + kVideoCannotMirrorErr = -10936 +}; + + +enum { + /* csTimingRangeSignalLevels*/ + kRangeSupportsSignal_0700_0300_Bit = 0, + kRangeSupportsSignal_0714_0286_Bit = 1, + kRangeSupportsSignal_1000_0400_Bit = 2, + kRangeSupportsSignal_0700_0000_Bit = 3, + kRangeSupportsSignal_0700_0300_Mask = (1 << kRangeSupportsSignal_0700_0300_Bit), + kRangeSupportsSignal_0714_0286_Mask = (1 << kRangeSupportsSignal_0714_0286_Bit), + kRangeSupportsSignal_1000_0400_Mask = (1 << kRangeSupportsSignal_1000_0400_Bit), + kRangeSupportsSignal_0700_0000_Mask = (1 << kRangeSupportsSignal_0700_0000_Bit) +}; + + +enum { + /* csSignalConfig*/ + kDigitalSignalBit = 0, /* Do not set. Mac OS does not currently support arbitrary digital timings*/ + kAnalogSetupExpectedBit = 1, /* Analog displays - display expects a blank-to-black setup or pedestal. See VESA signal standards.*/ + kInterlacedCEA861SyncModeBit = 2, + + kDigitalSignalMask = (1 << kDigitalSignalBit), + kAnalogSetupExpectedMask = (1 << kAnalogSetupExpectedBit), + kInterlacedCEA861SyncModeMask = (1 << kInterlacedCEA861SyncModeBit) +}; + + +enum { + /* csSignalLevels for analog*/ + kAnalogSignalLevel_0700_0300 = 0, + kAnalogSignalLevel_0714_0286 = 1, + kAnalogSignalLevel_1000_0400 = 2, + kAnalogSignalLevel_0700_0000 = 3 +}; + + +enum { + /* csTimingRangeSyncFlags*/ + kRangeSupportsSeperateSyncsBit = 0, + kRangeSupportsSyncOnGreenBit = 1, + kRangeSupportsCompositeSyncBit = 2, + kRangeSupportsVSyncSerrationBit = 3, + kRangeSupportsSeperateSyncsMask = (1 << kRangeSupportsSeperateSyncsBit), + kRangeSupportsSyncOnGreenMask = (1 << kRangeSupportsSyncOnGreenBit), + kRangeSupportsCompositeSyncMask = (1 << kRangeSupportsCompositeSyncBit), + kRangeSupportsVSyncSerrationMask = (1 << kRangeSupportsVSyncSerrationBit) +}; + + + +enum { + /* csHorizontalSyncConfig and csVerticalSyncConfig*/ + kSyncPositivePolarityBit = 0, /* Digital separate sync polarity for analog interfaces (0 => negative polarity)*/ + kSyncPositivePolarityMask = (1 << kSyncPositivePolarityBit) +}; + + + + +/* For timings with kDetailedTimingFormat.*/ + +struct VDDetailedTimingRec { + UInt32 csTimingSize; /* Init to sizeof(VDDetailedTimingRec)*/ + UInt32 csTimingType; /* Init to 0*/ + UInt32 csTimingVersion; /* Init to 0*/ + UInt32 csTimingReserved; /* Init to 0*/ + + DisplayModeID csDisplayModeID; /* Init to 0*/ + UInt32 csDisplayModeSeed; /* */ + UInt32 csDisplayModeState; /* Display Mode state*/ + UInt32 csDisplayModeAlias; /* Mode to use when programmed.*/ + + UInt32 csSignalConfig; + UInt32 csSignalLevels; + + UInt64 csPixelClock; /* Hz*/ + + UInt64 csMinPixelClock; /* Hz - With error what is slowest actual clock */ + UInt64 csMaxPixelClock; /* Hz - With error what is fasted actual clock */ + + + UInt32 csHorizontalActive; /* Pixels*/ + UInt32 csHorizontalBlanking; /* Pixels*/ + UInt32 csHorizontalSyncOffset; /* Pixels*/ + UInt32 csHorizontalSyncPulseWidth; /* Pixels*/ + + UInt32 csVerticalActive; /* Lines*/ + UInt32 csVerticalBlanking; /* Lines*/ + UInt32 csVerticalSyncOffset; /* Lines*/ + UInt32 csVerticalSyncPulseWidth; /* Lines*/ + + UInt32 csHorizontalBorderLeft; /* Pixels*/ + UInt32 csHorizontalBorderRight; /* Pixels*/ + UInt32 csVerticalBorderTop; /* Lines*/ + UInt32 csVerticalBorderBottom; /* Lines*/ + + UInt32 csHorizontalSyncConfig; + UInt32 csHorizontalSyncLevel; /* Future use (init to 0)*/ + UInt32 csVerticalSyncConfig; + UInt32 csVerticalSyncLevel; /* Future use (init to 0)*/ + + UInt32 csNumLinks; /* number of links, if 0 = assume link - 0 */ + + UInt32 csReserved2; /* Init to 0*/ + UInt32 csReserved3; /* Init to 0*/ + UInt32 csReserved4; /* Init to 0*/ + + UInt32 csReserved5; /* Init to 0*/ + UInt32 csReserved6; /* Init to 0*/ + UInt32 csReserved7; /* Init to 0*/ + UInt32 csReserved8; /* Init to 0*/ +}; +typedef struct VDDetailedTimingRec VDDetailedTimingRec; + +typedef VDDetailedTimingRec * VDDetailedTimingPtr; + +/* csScalerFeatures */ +enum { + kScaleStretchOnlyMask = (1<<0), /* True means the driver cannot add borders to avoid non-square pixels */ + kScaleCanUpSamplePixelsMask = (1<<1), /* True means timings with more active clocks than pixels (ie 640x480 pixels on a 1600x1200 timing) */ + kScaleCanDownSamplePixelsMask = (1<<2), /* True means timings with fewer active clocks than pixels (ie 1600x1200 pixels on a 640x480 timing) */ + kScaleCanScaleInterlacedMask = (1<<3), /* True means can scale an interlaced timing */ + kScaleCanSupportInsetMask = (1<<4), /* True means can scale a timing with insets */ + kScaleCanRotateMask = (1<<5), /* True means can rotate image */ + kScaleCanBorderInsetOnlyMask = (1<<6) /* True means can scale a timing with insets */ +}; + +/* csScalerFlags */ +enum { + kScaleStretchToFitMask = 0x00000001, /* True means the driver should avoid borders and allow non-square pixels */ + + kScaleRotateFlagsMask = 0x000000f0, + + kScaleSwapAxesMask = 0x00000010, + kScaleInvertXMask = 0x00000020, + kScaleInvertYMask = 0x00000040, + + kScaleRotate0Mask = 0x00000000, + kScaleRotate90Mask = kScaleSwapAxesMask | kScaleInvertXMask, + kScaleRotate180Mask = kScaleInvertXMask | kScaleInvertYMask, + kScaleRotate270Mask = kScaleSwapAxesMask | kScaleInvertYMask +}; + +typedef UInt32 VDClutBehavior; +typedef VDClutBehavior * VDClutBehaviorPtr; +enum { + kSetClutAtSetEntries = 0, /* SetEntries behavior is to update clut during SetEntries call*/ + kSetClutAtVBL = 1 /* SetEntries behavior is to upate clut at next vbl*/ +}; + + +struct VDCommunicationRec { + SInt32 csBusID; /* kVideoDefaultBus for single headed cards.*/ + UInt32 csCommFlags; /* Always zero*/ + UInt32 csMinReplyDelay; /* Minimum delay between send and reply transactions (units depend on csCommFlags)*/ + UInt32 csReserved2; /* Always zero*/ + + UInt32 csSendAddress; /* Usually I2C address (eg 0x6E)*/ + UInt32 csSendType; /* See kVideoSimpleI2CType etc.*/ + LogicalAddress csSendBuffer; /* Pointer to the send buffer*/ + ByteCount csSendSize; /* Number of bytes to send*/ + + UInt32 csReplyAddress; /* Address from which to read (eg 0x6F for kVideoDDCciReplyType I2C address)*/ + UInt32 csReplyType; /* See kVideoDDCciReplyType etc.*/ + LogicalAddress csReplyBuffer; /* Pointer to the reply buffer*/ + ByteCount csReplySize; /* Max bytes to reply (size of csReplyBuffer)*/ + + UInt32 csReserved3; + UInt32 csReserved4; + UInt32 csReserved5; /* Always zero*/ + UInt32 csReserved6; /* Always zero*/ +}; +typedef struct VDCommunicationRec VDCommunicationRec; + +typedef VDCommunicationRec * VDCommunicationPtr; + +struct VDCommunicationInfoRec { + SInt32 csBusID; /* kVideoDefaultBus for single headed cards. */ + UInt32 csBusType; /* See kVideoBusI2C etc.*/ + SInt32 csMinBus; /* Minimum bus (usually kVideoDefaultBus). Used to probe additional busses*/ + SInt32 csMaxBus; /* Max bus (usually kVideoDefaultBus). Used to probe additional busses*/ + + UInt32 csSupportedTypes; /* Bit field for first 32 supported transaction types. Eg. 0x07 => support for kVideoNoTransactionType, kVideoSimpleI2CType and kVideoDDCciReplyType.*/ + UInt32 csSupportedCommFlags; /* Return the flags csCommFlags understood by this driver. */ + UInt32 csReserved2; /* Always zero*/ + UInt32 csReserved3; /* Always zero*/ + + UInt32 csReserved4; /* Always zero*/ + UInt32 csReserved5; /* Always zero*/ + UInt32 csReserved6; /* Always zero*/ + UInt32 csReserved7; /* Always zero*/ +}; +typedef struct VDCommunicationInfoRec VDCommunicationInfoRec; + +typedef VDCommunicationInfoRec * VDCommunicationInfoPtr; + + +struct VDScalerRec { + UInt32 csScalerSize; /* Init to sizeof(VDScalerRec) */ + UInt32 csScalerVersion; /* Init to 0 */ + UInt32 csReserved1; /* Init to 0 */ + UInt32 csReserved2; /* Init to 0 */ + + DisplayModeID csDisplayModeID; /* Display Mode ID modified by this call. */ + UInt32 csDisplayModeSeed; /* */ + UInt32 csDisplayModeState; /* Display Mode state */ + UInt32 csReserved3; /* Init to 0 */ + + UInt32 csScalerFlags; /* Init to 0 */ + UInt32 csHorizontalPixels; /* Graphics system addressable pixels */ + UInt32 csVerticalPixels; /* Graphics system addressable lines */ + UInt32 csHorizontalInset; /* Border pixels for underscan */ + UInt32 csVerticalInset; /* Border lines for underscan */ + UInt32 csReserved6; /* Init to 0 */ + UInt32 csReserved7; /* Init to 0 */ + UInt32 csReserved8; /* Init to 0 */ +}; +typedef struct VDScalerRec VDScalerRec; +typedef VDScalerRec *VDScalerPtr; + +struct VDScalerInfoRec { + UInt32 csScalerInfoSize; /* Init to sizeof(VDScalerInfoRec) */ + UInt32 csScalerInfoVersion; /* Init to 0 */ + UInt32 csReserved1; /* Init to 0 */ + UInt32 csReserved2; /* Init to 0 */ + + UInt32 csScalerFeatures; /* Feature flags */ + UInt32 csMaxHorizontalPixels; /* limit to horizontal scaled pixels */ + UInt32 csMaxVerticalPixels; /* limit to vertical scaled pixels */ + UInt32 csReserved3; /* Init to 0 */ + + UInt32 csReserved4; /* Init to 0 */ + UInt32 csReserved5; /* Init to 0 */ + UInt32 csReserved6; /* Init to 0 */ + UInt32 csReserved7; /* Init to 0 */ +}; +typedef struct VDScalerInfoRec VDScalerInfoRec; +typedef VDScalerInfoRec *VDScalerInfoPtr; + +enum { + /* csMirrorFeatures*/ + kMirrorSameDepthOnlyMirrorMask = (1 << 0), /* Commonly true - Mirroring can only be done if the displays are the same bitdepth*/ + kMirrorSameSizeOnlyMirrorMask = (1 << 1), /* Commonly false - Mirroring can only be done if the displays are the same size*/ + kMirrorSameTimingOnlyMirrorMask = (1 << 2), /* Sometimes true - Mirroring can only be done if the displays are the same timing*/ + kMirrorCommonGammaMask = (1 << 3) /* Sometimes true - Only one gamma correction LUT.*/ +}; + +enum { + /* csMirrorSupportedFlags and csMirrorFlags*/ + kMirrorCanMirrorMask = (1 << 0), /* Set means we can HW mirrored right now (uses csMirrorEntryID)*/ + kMirrorAreMirroredMask = (1 << 1), /* Set means we are HW mirrored right now (uses csMirrorEntryID)*/ + kMirrorUnclippedMirrorMask = (1 << 2), /* Set means mirrored displays are not clipped to their intersection*/ + kMirrorHAlignCenterMirrorMask = (1 << 3), /* Set means mirrored displays can/should be centered horizontally*/ + kMirrorVAlignCenterMirrorMask = (1 << 4), /* Set means mirrored displays can/should be centered vertically*/ + kMirrorCanChangePixelFormatMask = (1 << 5), /* Set means mirrored the device should change the pixel format of mirrored displays to allow mirroring.*/ + kMirrorCanChangeTimingMask = (1 << 6), /* Set means mirrored the device should change the timing of mirrored displays to allow mirroring.*/ + kMirrorClippedMirrorMask = (1 << 7) /* Set means mirrored displays are clipped to their intersection (driver handles blacking and base address adjustment)*/ +}; + +struct VDMirrorRec { + UInt32 csMirrorSize; /* Init to sizeof(VDMirrorRec)*/ + UInt32 csMirrorVersion; /* Init to 0*/ + + RegEntryID csMirrorRequestID; /* Input RegEntryID to check for mirroring support and state*/ + RegEntryID csMirrorResultID; /* Output RegEntryID of the next mirrored device*/ + + UInt32 csMirrorFeatures; /* Output summary features of the driver*/ + UInt32 csMirrorSupportedFlags; /* Output configuration options supported by the driver*/ + UInt32 csMirrorFlags; /* Output configuration options active now*/ + UInt32 csReserved1; /* Init to 0*/ + + + UInt32 csReserved2; /* Init to 0*/ + UInt32 csReserved3; /* Init to 0*/ + UInt32 csReserved4; /* Init to 0*/ + UInt32 csReserved5; /* Init to 0*/ +}; +typedef struct VDMirrorRec VDMirrorRec; +typedef VDMirrorRec * VDMirrorPtr; + +struct VDConfigurationRec { + UInt32 csConfigFeature; /* input what feature to config - always input*/ + UInt32 csConfigSupport; /* output support value - always output*/ + uintptr_t csConfigValue; /* input/output feature value - input on Control(), output on Status()*/ + uintptr_t csReserved1; + uintptr_t csReserved2; +}; +typedef struct VDConfigurationRec VDConfigurationRec; +typedef VDConfigurationRec * VDConfigurationPtr; + +enum +{ + kDVIPowerSwitchFeature = (1 << 0), /* Used for csConfigFeature*/ + kDVIPowerSwitchSupportMask = (1 << 0), /* Read-only*/ + kDVIPowerSwitchActiveMask = (1 << 0), /* Read/write for csConfigValue*/ +}; + +struct VDConfigurationFeatureListRec +{ + OSType * csConfigFeatureList; + ItemCount csNumConfigFeatures; + uintptr_t csReserved1; + uintptr_t csReserved2; +}; +typedef struct VDConfigurationFeatureListRec VDConfigurationFeatureListRec; +typedef VDConfigurationFeatureListRec * VDConfigurationFeatureListRecPtr; + + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __IOMACOSVIDEO__ */ + diff --git a/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVFramebuffer.h.svn-base b/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVFramebuffer.h.svn-base new file mode 100644 index 0000000..ca65891 --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVFramebuffer.h.svn-base @@ -0,0 +1,352 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-1998 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 22 Oct 97 - first checked in. + * sdouglas 24 Jul 98 - start IOKit. + * sdouglas 15 Dec 98 - cpp. + * + */ + +#ifndef _IOKIT_IONDRVFRAMEBUFFER_H +#define _IOKIT_IONDRVFRAMEBUFFER_H + +#include +#include +#include + +#define kIONDRVDisableKey "AAPL,disable-ndrv" + +class IONDRVFramebuffer : public IOFramebuffer +{ + OSDeclareDefaultStructors(IONDRVFramebuffer) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +protected: + + IOService * nub; + class IONDRV * ndrv; + + // current configuration + IODisplayModeID currentDisplayMode; + IOIndex currentDepth; + IOIndex currentPage; + UInt8 __reservedE; + + IOPhysicalAddress physicalFramebuffer; + IODeviceMemory * vramRange; + + UInt8 gammaWidth; + UInt8 __reservedD; + UInt8 lastGrayMode; + VDClutBehavior lastClutSetting; + UInt8 __reservedC; + + bool consoleDevice; + UInt32 powerState; + UInt32 ndrvState; + SInt32 ndrvEnter; + OSArray * detailedTimings; + UInt32 detailedTimingsSeed; + UInt32 * detailedTimingsCurrent; + + IODeviceMemory * vramMemory; + + VDResolutionInfoRec cachedVDResolution; + + struct _VSLService * vslServices; + + UInt32 accessFlags; + unsigned int shouldDoI2CPower:1; + unsigned int online:1; + unsigned int avJackState:1; + unsigned int grayMode:1; + unsigned int platformSleep:1; + unsigned int forceReadEDID:1; + unsigned int supportsProbe:1; + unsigned int __reservedB:25; + + IOService * device; + + UInt32 __reservedA[29]; + +private: + struct IONDRVFramebufferPrivate * __private; + +public: + virtual IOReturn doDriverIO( UInt32 commandID, void * contents, + UInt32 commandCode, UInt32 commandKind ); +private: + OSMetaClassDeclareReservedUsed(IONDRVFramebuffer, 0); + + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 1); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 2); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 3); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 4); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 5); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 6); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 7); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 8); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 9); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 10); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 11); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 12); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 13); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 14); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 15); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 16); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 17); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 18); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 19); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 20); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 21); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 22); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 23); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 24); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 25); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 26); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 27); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 28); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 29); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 30); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 31); + +private: + + void initForPM ( void ); + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags domainState ); + virtual unsigned long powerStateForDomainState( IOPMPowerFlags domainState ); + + virtual IOReturn checkDriver( void ); + virtual UInt32 iterateAllModes( IODisplayModeID * displayModeIDs ); + virtual IOReturn getResInfoForMode( IODisplayModeID modeID, + IODisplayModeInformation * theInfo ); + virtual IOReturn getResInfoForArbMode( IODisplayModeID modeID, + IODisplayModeInformation * theInfo ); + IOReturn getResInfoForDetailed( IODisplayModeID modeID, + VDDetailedTimingRec * detailed, + IODisplayModeInformation * info ); + IOIndex mapDepthIndex( IODisplayModeID modeID, IOIndex depth, bool fromDepthMode ); + virtual IOReturn validateDisplayMode( + IODisplayModeID mode, IOOptionBits flags, + VDDetailedTimingRec ** detailed ); + virtual IOReturn setDetailedTiming( + IODisplayModeID mode, IOOptionBits options, + void * description, IOByteCount descripSize ); + virtual void getCurrentConfiguration( void ); + static const IOTVector * _undefinedSymbolHandler( void * self, + const char * libraryName, const char * symbolName ); + static bool _videoJackStateChangeHandler( void * target, void * ref, + IOService * newService, IONotifier * notifier ); + static void _avProbeAction( OSObject * p0, IOTimerEventSource * evtSrc ); + void displayI2CPower( bool enable ); + IOReturn ndrvSetPowerState( UInt32 newState ); + IOReturn ndrvUpdatePowerState( void ); + IOReturn ndrvSetDisplayPowerState( UInt32 newState ); + static IOReturn _probeAction( IONDRVFramebuffer * self, IOOptionBits options ); + bool searchOfflineMode( IODisplayModeID * offlineMode ); + IOReturn processConnectChange( uintptr_t * value ); + IOReturn setMirror( IONDRVFramebuffer * other ); + IOReturn setConnectionFlags( void ); + bool getOnlineState( void ); + IOReturn ndrvGetSetFeature( UInt32 feature, uintptr_t newValue, uintptr_t * currentValue ); + static IOReturn _doControl( IONDRVFramebuffer * self, UInt32 code, void * params ); + static IOReturn _doStatus( IONDRVFramebuffer * self, UInt32 code, void * params ); + static IOReturn extControl( OSObject * owner, void * code, void * params ); + static IOReturn extStatus( OSObject * owner, void * code, void * params ); + IOReturn createI2C( void ); + void setInfoProperties( void ); + +public: + virtual IOReturn doControl( UInt32 code, void * params ); + virtual IOReturn doStatus( UInt32 code, void * params ); + +public: + + virtual IOService * probe( IOService * provider, + SInt32 * score ); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual void free( void ); + + virtual IOReturn setProperties( OSObject * properties ); + + virtual IOReturn requestProbe( IOOptionBits options ); + + virtual IOReturn enableController( void ); + + virtual IODeviceMemory * makeSubRange( IOPhysicalAddress start, + IOPhysicalLength length ); + virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ); + virtual IODeviceMemory * getVRAMRange( void ); + + virtual IODeviceMemory * findVRAM( void ); + + virtual bool isConsoleDevice( void ); + + virtual const IOTVector * undefinedSymbolHandler( const char * libraryName, + const char * symbolName ); + + virtual const char * getPixelFormats( void ); + + // Array of supported display modes + virtual IOItemCount getDisplayModeCount( void ); + virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ); + + // Info about a display mode + virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode, + IODisplayModeInformation * info ); + + // Mask of pixel formats available in mode and depth + virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + + virtual IOReturn getPixelInformation( + IODisplayModeID displayMode, IOIndex depth, + IOPixelAperture aperture, IOPixelInformation * pixelInfo ); + + // Framebuffer info + + // Current display mode and depth + virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + + // Set display mode and depth + virtual IOReturn setDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + + // For pages + virtual IOReturn setApertureEnable( IOPixelAperture aperture, + IOOptionBits enable ); + + virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + + //// CLUTs + + virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index, + UInt32 numEntries, IOOptionBits options ); + + //// Gamma + + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data ); + + //// Display mode timing information + + virtual IOReturn getTimingInfoForDisplayMode( IODisplayModeID displayMode, + IOTimingInformation * info ); + + //// Detailed timing information + + virtual IOReturn validateDetailedTiming( + void * description, IOByteCount descripSize ); + + virtual IOReturn setDetailedTimings( OSArray * array ); + + //// Controller attributes + + virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value ); + virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value ); + + //// Connections + + virtual IOItemCount getConnectionCount( void ); + + virtual IOReturn getAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); + + virtual IOReturn setAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t info ); + + // Apple sensing + + virtual IOReturn getAppleSense( IOIndex connectIndex, + UInt32 * senseType, + UInt32 * primary, + UInt32 * extended, + UInt32 * displayType ); + + virtual IOReturn connectFlags( IOIndex connectIndex, + IODisplayModeID displayMode, IOOptionBits * flags ); + + //// IOHighLevelDDCSense + + virtual bool hasDDCConnect( IOIndex connectIndex ); + virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber, + IOSelect blockType, IOOptionBits options, + UInt8 * data, IOByteCount * length ); + + //// Interrupts + + virtual IOReturn registerForInterruptType( IOSelect interruptType, + IOFBInterruptProc proc, OSObject * target, void * ref, + void ** interruptRef ); + virtual IOReturn unregisterInterrupt( void * interruptRef ); + virtual IOReturn setInterruptState( void * interruptRef, UInt32 state ); + + //// HW Cursors + + virtual IOReturn setCursorImage( void * cursorImage ); + virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible ); + + //// I2C calls + + virtual IOReturn doI2CRequest( UInt32 bus, IOI2CBusTiming * timing, IOI2CRequest * request ); + + //// VSL calls + + static OSStatus VSLNewInterruptService( + void * entryID, + UInt32 serviceType, + _VSLService ** serviceID ); + static OSStatus VSLDisposeInterruptService( _VSLService * serviceID ); + static OSStatus VSLDoInterruptService( _VSLService * serviceID ); + static Boolean VSLPrepareCursorForHardwareCursor( + void * cursorRef, + IOHardwareCursorDescriptor * hwDesc, + IOHardwareCursorInfo * hwCursorInfo ); +}; + +#endif /* ! _IOKIT_IONDRVFRAMEBUFFER_H */ + + diff --git a/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVLibraries.h.svn-base b/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVLibraries.h.svn-base new file mode 100644 index 0000000..ad4a26d --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVLibraries.h.svn-base @@ -0,0 +1,696 @@ + +#ifndef __IONDRVLIBRARIES__ +#define __IONDRVLIBRARIES__ + +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* NameRegistry error codes */ +enum { + nrLockedErr = -2536, + nrNotEnoughMemoryErr = -2537, + nrInvalidNodeErr = -2538, + nrNotFoundErr = -2539, + nrNotCreatedErr = -2540, + nrNameErr = -2541, + nrNotSlotDeviceErr = -2542, + nrDataTruncatedErr = -2543, + nrPowerErr = -2544, + nrPowerSwitchAbortErr = -2545, + nrTypeMismatchErr = -2546, + nrNotModifiedErr = -2547, + nrOverrunErr = -2548, + nrResultCodeBase = -2549, + nrPathNotFound = -2550, /* a path component lookup failed */ + nrPathBufferTooSmall = -2551, /* buffer for path is too small */ + nrInvalidEntryIterationOp = -2552, /* invalid entry iteration operation */ + nrPropertyAlreadyExists = -2553, /* property already exists */ + nrIterationDone = -2554, /* iteration operation is done */ + nrExitedIteratorScope = -2555, /* outer scope of iterator was exited */ + nrTransactionAborted = -2556, /* transaction was aborted */ + + gestaltUndefSelectorErr = -5551 /*undefined selector was passed to Gestalt*/ +}; + +enum { + kNVRAMProperty = 0x00000020, // matches NR +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef _IOKIT_IOSERVICE_H +typedef struct IOService IOService; +#endif + +IOReturn _IONDRVLibrariesInitialize( IOService * provider ); +IOReturn _IONDRVLibrariesFinalize( IOService * provider ); + +#ifndef kAAPLRegEntryIDKey +#define kAAPLRegEntryIDKey "AAPL,RegEntryID" +#endif + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +UInt32 EndianSwap32Bit( UInt32 data ); + +UInt16 EndianSwap16Bit( UInt16 data ); + +void SynchronizeIO(void); + +OSErr ExpMgrConfigReadLong( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt32 * valuePtr); + +OSErr ExpMgrConfigWriteLong( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt32 value); + +OSErr ExpMgrConfigReadWord( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt16 * valuePtr); + +OSErr ExpMgrConfigWriteWord( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt16 value); + +OSErr ExpMgrConfigReadByte( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt8 * valuePtr); + +OSErr ExpMgrConfigWriteByte( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt8 value); + +OSErr ExpMgrIOReadLong( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt32 * valuePtr); + +OSErr ExpMgrIOWriteLong( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt32 value); + +OSErr ExpMgrIOReadWord( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt16 * valuePtr); + +OSErr ExpMgrIOWriteWord( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt16 value); + +OSErr ExpMgrIOReadByte( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt8 * valuePtr); + +OSErr ExpMgrIOWriteByte( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt8 value); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/******************************************************************************* + * + * Foundation Types + * + */ +/* Value of a property */ +typedef void * RegPropertyValue; +/* Length of property value */ +typedef UInt32 RegPropertyValueSize; + +/*******************************************************************************/ + +/******************************************************************************* + * + * Root Entry Name Definitions (Applies to all Names in the RootNameSpace) + * + * + Names are a colon-separated list of name components. Name components + * may not themselves contain colons. + * + Names are presented as null-terminated ASCII character strings. + * + Names follow similar parsing rules to Apple file system absolute + * and relative paths. However the '::' parent directory syntax is + * not currently supported. + */ +/* Max length of Entry Name */ +enum { + kRegCStrMaxEntryNameLength = 47 +}; + +/* Entry Names are single byte ASCII */ +typedef char RegCStrEntryName; +typedef char * RegCStrEntryNamePtr; +/* length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1*/ +typedef char RegCStrEntryNameBuf[48]; +typedef char RegCStrPathName; +typedef UInt32 RegPathNameSize; +enum { + kRegPathNameSeparator = ':', /* 0x3A */ + kRegEntryNameTerminator = 0x00, /* '\0' */ + kRegPathNameTerminator = 0x00 /* '\0' */ +}; + +/******************************************************************************* + * + * Property Name and ID Definitions + * (Applies to all Properties Regardless of NameSpace) + */ +enum { + kRegMaximumPropertyNameLength = 31, /* Max length of Property Name */ + kRegPropertyNameTerminator = 0x00 /* '\0' */ +}; + +typedef char RegPropertyNameBuf[32]; +typedef char RegPropertyName; +typedef char * RegPropertyNamePtr; +enum { + kRegMaxPropertyNameLength = kRegMaximumPropertyNameLength +}; + +/******************************************************************************* + * + * Iteration Operations + * + * These specify direction when traversing the name relationships + */ +typedef UInt32 RegIterationOp; +typedef RegIterationOp RegEntryIterationOp; +enum { + /* Absolute locations*/ + kRegIterRoot = 0x00000002, /* "Upward" Relationships */ + kRegIterParents = 0x00000003, /* include all parent(s) of entry */ + /* "Downward" Relationships*/ + kRegIterChildren = 0x00000004, /* include all children */ + kRegIterSubTrees = 0x00000005, /* include all sub trees of entry */ + kRegIterDescendants = 0x00000005, /* include all descendants of entry */ + /* "Horizontal" Relationships */ + kRegIterSibling = 0x00000006, /* include all siblings */ + /* Keep doing the same thing*/ + kRegIterContinue = 0x00000001 +}; + +/******************************************************************************* + * + * Name Entry and Property Modifiers + * + * + * + * Modifiers describe special characteristics of names + * and properties. Modifiers might be supported for + * some names and not others. + * + * Device Drivers should not rely on functionality + * specified as a modifier. + */ +typedef UInt32 RegModifiers; +typedef RegModifiers RegEntryModifiers; +typedef RegModifiers RegPropertyModifiers; +enum { + kRegNoModifiers = 0x00000000, /* no entry modifiers in place */ + kRegUniversalModifierMask = 0x0000FFFF, /* mods to all entries */ + kRegNameSpaceModifierMask = 0x00FF0000, /* mods to all entries within namespace */ + kRegModifierMask = (RegModifiers)0xFF000000 /* mods to just this entry */ +}; + +/* Universal Property Modifiers */ +enum { + kRegPropertyValueIsSavedToNVRAM = 0x00000020, /* property is non-volatile (saved in NVRAM) */ + kRegPropertyValueIsSavedToDisk = 0x00000040 /* property is non-volatile (saved on disk) */ +}; + +typedef size_t Size; + +#ifndef _IOKIT_IOREGISTRYENTRY_H +typedef struct IORegistryIterator IORegistryIterator; +typedef struct OSIterator OSIterator; +#endif /* _IOKIT_IOREGISTRYENTRY_H */ +typedef IORegistryIterator * RegEntryIter; +typedef OSIterator * RegPropertyIter; + +OSStatus RegistryEntryIDCopy( const RegEntryID * entryID, RegEntryID * to ); + +OSStatus RegistryEntryIDInit( RegEntryID * entryID ); + +Boolean RegistryEntryIDCompare( const RegEntryID * id1, const RegEntryID * id2); + +OSStatus RegistryPropertyGetSize( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + RegPropertyValueSize * propertySize); + +OSStatus RegistryPropertyGet( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + void * propertyValue, + RegPropertyValueSize * propertySize); + +OSStatus RegistryPropertyCreate( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryPropertyDelete( + const RegEntryID * entryID, + const RegPropertyName * propertyName); + +OSStatus RegistryPropertySet( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryPropertyGetMod( + const RegEntryID * entry, + const RegPropertyName * name, + RegPropertyModifiers * modifiers); + +OSStatus RegistryPropertySetMod( + const RegEntryID * entry, + const RegPropertyName * name, + RegPropertyModifiers modifiers); + +OSStatus RegistryPropertyIterateCreate( + const RegEntryID * entry, + RegPropertyIter * cookie); + +OSStatus RegistryPropertyIterateDispose( RegPropertyIter * cookie); + +OSStatus RegistryPropertyIterate( + RegPropertyIter * cookie, + RegPropertyName * foundProperty, + Boolean * done); + +OSStatus RegistryEntryIterateCreate( RegEntryIter * cookie); + +OSStatus RegistryEntryIterateDispose( RegEntryIter * cookie); + +OSStatus RegistryEntryIterateSet( RegEntryIter * cookie, + const RegEntryID * startEntryID); + +OSStatus RegistryEntryIterate( RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done); + +OSStatus RegistryCStrEntryToName( const RegEntryID * entryID, + RegEntryID * parentEntry, + RegCStrEntryName * nameComponent, + Boolean * done ); + +OSStatus RegistryCStrEntryLookup( const RegEntryID * parentEntry, + const RegCStrPathName * path, + RegEntryID * newEntry); + +OSStatus RegistryCStrEntryCreate( const RegEntryID * parentEntry, + const RegCStrPathName * name, + RegEntryID * newEntry); + +OSStatus RegistryEntryDelete(const RegEntryID * entryID); + +OSStatus RegistryEntryIDDispose(RegEntryID * entryID); + +// + +OSStatus RegistryEntryCopy( + RegEntryID * parentEntryID, + RegEntryID * sourceDevice, + RegEntryID * destDevice); + +OSStatus RegistryEntrySearch( + RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryEntryToPathSize( + const RegEntryID * entryID, + RegPathNameSize * pathSize); + +OSStatus RegistryCStrEntryToPath( + const RegEntryID * entryID, + RegCStrPathName * pathName, + RegPathNameSize pathSize); + +OSStatus RegistryPropertyRename( + const RegEntryID * entry, + const RegPropertyName * oldName, + const RegPropertyName * newName); + +OSStatus RegistryEntryGetMod( + const RegEntryID * entry, + RegEntryModifiers * modifiers); + +OSStatus RegistryEntrySetMod( + const RegEntryID * entry, + RegEntryModifiers modifiers); + +OSStatus RegistryEntryMod( + RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done, + RegEntryModifiers matchingModifiers); + +OSStatus RegistryEntryPropertyMod( + RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done, + RegPropertyModifiers matchingModifiers); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +void SynchronizeIO(void); + +Boolean CompareAndSwap( + UInt32 oldVvalue, + UInt32 newValue, + UInt32 * OldValueAdr); + +UInt32 CStrLen(const char * src); + +char * CStrCopy( char * dst, const char * src); + +SInt16 CStrCmp( + const char * s1, + const char * s2); + +char * CStrCat( + char * dst, + const char * src); +char * CStrNCopy( + char * dst, + const char * src, + UInt32 max); +SInt16 CStrNCmp( + const char * s1, + const char * s2, + UInt32 max); +char * CStrNCat( + char * dst, + const char * src, + UInt32 max); + +void BlockCopy( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMove( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMoveData( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMoveDataUncached( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMoveUncached( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockZero( + const void * srcPtr, + Size byteCount); +void BlockZeroUncached( + const void * srcPtr, + Size byteCount); + +char * PStrCopy( char *to, const char *from ); + +void PStrToCStr( char *to, const char *from ); + +void CStrToPStr( char *to, const char *from ); + +LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear); + +OSStatus PoolDeallocate( LogicalAddress address ); + +UInt32 CurrentExecutionLevel(void); + +UnsignedWide UpTime( void ); + +UnsignedWide AddAbsoluteToAbsolute(UnsignedWide left, UnsignedWide right); + +UnsignedWide SubAbsoluteFromAbsolute(UnsignedWide left, UnsignedWide right); + +UnsignedWide DurationToAbsolute( Duration theDuration); + +UnsignedWide AddDurationToAbsolute( Duration duration, UnsignedWide absolute ); + +UnsignedWide NanosecondsToAbsolute ( UnsignedWide theNanoseconds); + +UnsignedWide AbsoluteToNanoseconds( UnsignedWide absolute ); + +Duration AbsoluteDeltaToDuration( UnsignedWide left, UnsignedWide right ); + +Duration AbsoluteToDuration( UnsignedWide result ); + +OSStatus DelayForHardware( UnsignedWide time ); + +OSStatus DelayUntil( UnsignedWide time ); + +OSStatus DelayFor( Duration theDuration ); + +void SysDebugStr( const char * from ); + +void SysDebug( void ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +enum { + paramErr = -50, /*error in user parameter list*/ + noHardwareErr = -200, /*Sound Manager Error Returns*/ + notEnoughHardwareErr = -201, /*Sound Manager Error Returns*/ + userCanceledErr = -128, + qErr = -1, /*queue element not found during deletion*/ + vTypErr = -2, /*invalid queue element*/ + corErr = -3, /*core routine number out of range*/ + unimpErr = -4, /*unimplemented core routine*/ + SlpTypeErr = -5, /*invalid queue element*/ + seNoDB = -8, /*no debugger installed to handle debugger command*/ + controlErr = -17, /*I/O System Errors*/ + statusErr = -18, /*I/O System Errors*/ + readErr = -19, /*I/O System Errors*/ + writErr = -20, /*I/O System Errors*/ + badUnitErr = -21, /*I/O System Errors*/ + unitEmptyErr = -22, /*I/O System Errors*/ + openErr = -23, /*I/O System Errors*/ + closErr = -24, /*I/O System Errors*/ + dRemovErr = -25, /*tried to remove an open driver*/ + dInstErr = -26, /*DrvrInstall couldn't find driver in resources*/ + + badCksmErr = -69, /*addr mark checksum didn't check*/ +}; +enum { + durationMicrosecond = -1, /* Microseconds are negative*/ + durationMillisecond = 1, /* Milliseconds are positive*/ + durationSecond = 1000, /* 1000 * durationMillisecond*/ + durationMinute = 60000, /* 60 * durationSecond,*/ + durationHour = 3600000, /* 60 * durationMinute,*/ + durationDay = 86400000, /* 24 * durationHour,*/ + durationNoWait = 0, /* don't block*/ + durationForever = 0x7FFFFFFF /* no time limit*/ +}; +#ifndef NULL + #if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C)) + /* Symantec C compilers (but not C++) want NULL and nil to be (void*)0 */ + #define NULL ((void *) 0) + #else + /* in case int is 16-bits, make sure NULL is 32-bits */ + #define NULL 0L + #endif +#endif + +#ifndef nil + #define nil NULL +#endif + +typedef ResType VSLGestaltType; + +enum { + clutType = 0, /*0 if lookup table*/ + fixedType = 1, /*1 if fixed table*/ + directType = 2, /*2 if direct values*/ + RGBDirect = 16 /* 16 & 32 bits/pixel pixelType value */ +}; +typedef UInt32 * UInt32Ptr; + +typedef struct IOHardwareCursorDescriptor HardwareCursorDescriptorRec; +typedef HardwareCursorDescriptorRec * HardwareCursorDescriptorPtr; +typedef struct IOHardwareCursorInfo HardwareCursorInfoRec; +typedef HardwareCursorInfoRec * HardwareCursorInfoPtr; + +typedef ResType InterruptServiceType; +typedef struct _VSLService * InterruptServiceIDType; +typedef InterruptServiceIDType * InterruptServiceIDPtr; + +enum { + kVBLInterruptServiceType = 'vbl ', + kHBLInterruptServiceType = 'hbl ', + kFrameInterruptServiceType = 'fram', + kConnectInterruptServiceType = 'dci ', /* Renamed -- Use kFBCheckInterruptServiceType*/ + kFBConnectInterruptServiceType = kConnectInterruptServiceType, /* Demand to check configuration (Hardware unchanged)*/ + kFBChangedInterruptServiceType = 'chng', /* Demand to rebuild (Hardware has reinitialized on dependent change)*/ + kFBOfflineInterruptServiceType = 'remv', /* Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror)*/ + kFBOnlineInterruptServiceType = 'add ' /* Notice that hardware is available (after being removed)*/ +}; + +enum { + kVSLClamshellStateGestaltType = 'clam', +}; + +OSStatus +VSLGestalt( VSLGestaltType selector, UInt32 * response ); + +OSStatus +VSLSetDisplayConfiguration(RegEntryID * entryID, + RegPropertyName * propertyName, + RegPropertyValue configData, + RegPropertyValueSize configDataSize); +OSErr +VSLNewInterruptService( + RegEntryID * serviceDevice, + InterruptServiceType serviceType, + InterruptServiceIDPtr serviceID); + +OSErr +VSLWaitOnInterruptService( + InterruptServiceIDType serviceID, + Duration timeout); + +OSErr +VSLDisposeInterruptService(InterruptServiceIDType serviceID); + +OSErr +VSLDoInterruptService(InterruptServiceIDType serviceID); + +Boolean +VSLPrepareCursorForHardwareCursor( + void * cursorRef, + IOHardwareCursorDescriptor * hardwareDescriptor, + IOHardwareCursorInfo * hwCursorInfo); + +typedef UnsignedWide Nanoseconds; +enum { + /* Version Release Stage Codes */ + developStage = 0x20, + alphaStage = 0x40, + betaStage = 0x60, + finalStage = 0x80 +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct OpaqueIOCommandID* IOCommandID; + +typedef UInt32 IOCommandKind; +typedef UInt32 IOCommandCode; + +OSErr IOCommandIsComplete( IOCommandID commandID, OSErr result); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __IONDRV__ +typedef struct OpaqueInterruptSetID* InterruptSetID; +#else +typedef class IONDRVInterruptSet * InterruptSetID; +#endif /* __IONDRV__ */ + +typedef long InterruptMemberNumber; +struct InterruptSetMember { + InterruptSetID setID; + InterruptMemberNumber member; +}; +typedef struct InterruptSetMember InterruptSetMember; +enum { + kISTChipInterruptSource = 0, + kISTOutputDMAInterruptSource = 1, + kISTInputDMAInterruptSource = 2, + kISTPropertyMemberCount = 3 +}; + +typedef InterruptSetMember ISTProperty[3]; +#define kISTPropertyName "driver-ist" + +typedef long InterruptReturnValue; +enum { + kFirstMemberNumber = 1, + kIsrIsComplete = 0, + kIsrIsNotComplete = -1, + kMemberNumberParent = -2 +}; + +typedef Boolean InterruptSourceState; +enum { + kSourceWasEnabled = true, + kSourceWasDisabled = false +}; + +typedef InterruptMemberNumber (*InterruptHandler) (InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount); +typedef void (*InterruptEnabler) (InterruptSetMember ISTmember, void *refCon); +typedef InterruptSourceState (*InterruptDisabler)(InterruptSetMember ISTmember, void *refCon); + +enum { + kReturnToParentWhenComplete = 0x00000001, + kReturnToParentWhenNotComplete = 0x00000002 +}; + +typedef OptionBits InterruptSetOptions; + + +OSStatus GetInterruptFunctions( + InterruptSetID setID, + InterruptMemberNumber member, + void ** refCon, + InterruptHandler * handlerFunction, + InterruptEnabler * enableFunction, + InterruptDisabler * disableFunction); + +OSStatus InstallInterruptFunctions( + InterruptSetID setID, + InterruptMemberNumber member, + void * refCon, + InterruptHandler handlerFunction, + InterruptEnabler enableFunction, + InterruptDisabler disableFunction); + +OSStatus CreateInterruptSet( + InterruptSetID parentSet, + InterruptMemberNumber parentMember, + InterruptMemberNumber setSize, + InterruptSetID * setID, + InterruptSetOptions options); + +OSStatus DeleteInterruptSet( InterruptSetID setID ); + + +#ifdef __cplusplus +} +#endif + +#endif /* __IONDRVLIBRARIES__ */ + diff --git a/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVSupport.h.svn-base b/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVSupport.h.svn-base new file mode 100644 index 0000000..2fdfcb6 --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/.svn/text-base/IONDRVSupport.h.svn-base @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IONDRVSUPPORT__ +#define __IONDRVSUPPORT__ + +#include + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define kIONDRVIgnoreKey "AAPL,iokit-ignore-ndrv" +#define kIONDRVForXKey "AAPL,iokit-ndrv" + +struct IOTVector { + void * pc; + UInt32 toc; +}; +typedef struct IOTVector IOTVector; + +struct IONDRVInterruptSetMember { + void * setID; + UInt32 member; +}; +typedef struct IONDRVInterruptSetMember IONDRVInterruptSetMember; + +typedef SInt32 (*IONDRVInterruptHandler)( IONDRVInterruptSetMember setMember, void *refCon, UInt32 theIntCount); +typedef void (*IONDRVInterruptEnabler)( IONDRVInterruptSetMember setMember, void *refCon); +typedef Boolean (*IONDRVInterruptDisabler)( IONDRVInterruptSetMember setMember, void *refCon); + +enum { + kIONDRVFirstMemberNumber = 1, + kIONDRVIsrIsComplete = 0, + kIONDRVIsrIsNotComplete = -1, + kIONDRVMemberNumberParent = -2 +}; + +enum { + kIONDRVReturnToParentWhenComplete = 0x00000001, + kIONDRVReturnToParentWhenNotComplete = 0x00000002 +}; + +enum { + kIONDRVISTChipInterruptSource = 0, + kIONDRVISTOutputDMAInterruptSource = 1, + kIONDRVISTInputDMAInterruptSource = 2, + kIONDRVISTPropertyMemberCount = 3 +}; + +#define kIONDRVISTPropertyName "driver-ist" + +IOReturn +IONDRVInstallInterruptFunctions(void * setID, + UInt32 member, + void * refCon, + IOTVector * handler, + IOTVector * enabler, + IOTVector * disabler ); + +typedef const IOTVector * (*IONDRVUndefinedSymbolHandler)( void * self, + const char * libraryName, const char * symbolName ); + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __IONDRVSUPPORT__ */ diff --git a/i386/include/IOKit/ndrvsupport/IOMacOSTypes.h b/i386/include/IOKit/ndrvsupport/IOMacOSTypes.h new file mode 100644 index 0000000..0a2aae7 --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/IOMacOSTypes.h @@ -0,0 +1,441 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 22 Oct 97 - first checked in. + * sdouglas 21 July 98 - start IOKit + */ + +/* + File: Types.h + + Contains: Basic Macintosh data types. + + Version: Technology: PowerSurge 1.0.2. + Package: Universal Interfaces 2.1.2 on ETO #20 + + Copyright: � 1984-1995 by Apple Computer, Inc. + All rights reserved. + + Bugs?: If you find a problem with this file, use the Apple Bug Reporter + stack. Include the file and version information (from above) + in the problem description and send to: + Internet: apple.bugs@applelink.apple.com + AppleLink: APPLE.BUGS + +*/ + +#ifndef _IOKIT_IOMACOSTYPES_H +#define _IOKIT_IOMACOSTYPES_H +#ifndef __MACTYPES__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +#ifndef NULL +#if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C)) +#define NULL ((void *) 0) +#else +#define NULL 0 +#endif +#endif + +enum { + noErr = 0 +}; + +typedef uintptr_t KernelProcessID; +typedef uintptr_t AddressSpaceID; + +#if 0 +#ifndef __cplusplus +enum { false, true }; +#endif +#endif + +typedef unsigned char Byte; + +typedef signed char SignedByte; + +typedef UInt16 UniChar; + +typedef char *Ptr; + +typedef Ptr *Handle; + +typedef UInt32 Fixed; + +typedef Fixed *FixedPtr; + +typedef UInt32 Fract; + +typedef Fract *FractPtr; + +struct _extended80 { + short exp; + short man[4]; +}; +struct _extended96 { + short exp[2]; + short man[4]; +}; +typedef struct wide *WidePtr; + +typedef struct UnsignedWide *UnsignedWidePtr; + + +/* +enum { + false, + true +}; +#if !__option(bool) + #ifndef true + #define true 1 + #endif + #ifndef false + #define false 0 + #endif +#endif + +typedef unsigned char Boolean; +*/ + + +typedef short OSErr; + +typedef unsigned int FourCharCode; + +typedef FourCharCode OSType; + +typedef FourCharCode ResType; + +typedef OSType *OSTypePtr; + +typedef ResType *ResTypePtr; + +struct Rect { + short top; + short left; + short bottom; + short right; +}; +typedef struct Rect Rect; + +typedef Rect *RectPtr; + +// Quickdraw.i + +/* + kVariableLengthArray is used in array bounds to specify a variable length array. + It is ususally used in variable length structs when the last field is an array + of any size. Before ANSI C, we used zero as the bounds of variable length + array, but that is illegal in ANSI C. Example: + + struct FooList + { + short listLength; + Foo elements[kVariableLengthArray]; + }; +*/ + +enum { + kVariableLengthArray = 1 +}; + +/* Numeric version part of 'vers' resource */ +struct NumVersion { + UInt8 majorRev; /*1st part of version number in BCD*/ + UInt8 minorAndBugRev; /*2nd & 3rd part of version number share a byte*/ + UInt8 stage; /*stage code: dev, alpha, beta, final*/ + UInt8 nonRelRev; /*revision level of non-released version*/ +}; +typedef struct NumVersion NumVersion; + +typedef struct OpaqueRef *KernelID; + +typedef UInt8 *BytePtr; + +typedef IOByteCount ByteCount; + +typedef IOItemCount ItemCount; + +typedef void *LogicalAddress; + +#if !defined(__LP64__) +typedef void *PhysicalAddress; +#endif + +typedef UInt32 PBVersion; + +typedef SInt32 Duration; + +#define kInvalidID 0 + +enum { + kNilOptions = 0 +}; + + +typedef unsigned char Str31[32]; + + +/* +From: + File: DriverFamilyMatching.i <18> + Copyright: � 1995-1996 by Apple Computer, Inc., all rights reserved. +*/ + +//############################################## +// Well known properties in the Name Registry +//############################################## + +#define kPropertyName "name" +#define kPropertyCompatible "compatible" +#define kPropertyDriverPtr "driver-ptr" +#define kPropertyDriverDesc "driver-description" +#define kPropertyReg "reg" +#define kPropertyAAPLAddress "AAPL,address" +#define kPropertyMatching "matching" + + +//######################################################### +// Descriptor for Drivers and NDRVs +//######################################################### +/* Driver Typing Information Used to Match Drivers With Devices */ +struct DriverType { + Str31 nameInfoStr; /* Driver Name/Info String*/ + NumVersion version; /* Driver Version Number*/ +}; +typedef struct DriverType DriverType; +typedef DriverType * DriverTypePtr; + +/* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */ +typedef OptionBits RuntimeOptions; + + +enum { + kDriverIsLoadedUponDiscovery = 0x00000001, /* auto-load driver when discovered*/ + kDriverIsOpenedUponLoad = 0x00000002, /* auto-open driver when loaded*/ + kDriverIsUnderExpertControl = 0x00000004, /* I/O expert handles loads/opens*/ + kDriverIsConcurrent = 0x00000008, /* supports concurrent requests*/ + kDriverQueuesIOPB = 0x00000010, /* device manager doesn't queue IOPB*/ + kDriverIsLoadedAtBoot = 0x00000020, /* Driver is loaded at the boot time */ + kDriverIsForVirtualDevice = 0x00000040, /* Driver is for a virtual Device */ + kDriverSupportDMSuspendAndResume = 0x00000080 /* Driver supports Device Manager Suspend and Resume command */ +}; + +struct DriverOSRuntime { + RuntimeOptions driverRuntime; /* Options for OS Runtime*/ + Str31 driverName; /* Driver's name to the OS*/ + UInt32 driverDescReserved[8]; /* Reserved area*/ +}; +typedef struct DriverOSRuntime DriverOSRuntime; +typedef DriverOSRuntime * DriverOSRuntimePtr; + +/* OS Service Information Used To Declare What APIs a Driver Supports */ +typedef UInt32 ServiceCount; + +struct DriverServiceInfo { + OSType serviceCategory; /* Service Category Name*/ + OSType serviceType; /* Type within Category*/ + NumVersion serviceVersion; /* Version of service*/ +}; +typedef struct DriverServiceInfo DriverServiceInfo; +typedef DriverServiceInfo * DriverServiceInfoPtr; + +struct DriverOSService { + ServiceCount nServices; /* Number of Services Supported*/ + DriverServiceInfo service[1]; /* The List of Services (at least one)*/ +}; +typedef struct DriverOSService DriverOSService; +typedef DriverOSService * DriverOSServicePtr; + +/* Categories */ + +enum { + kServiceCategoryDisplay = 'disp', /* Display Manager*/ + kServiceCategoryOpenTransport = 'otan', /* Open Transport*/ + kServiceCategoryBlockStorage = 'blok', /* Block Storage*/ + kServiceCategoryNdrvDriver = 'ndrv', /* Generic Native Driver*/ + kServiceCategoryScsiSIM = 'scsi', /* SCSI */ + kServiceCategoryFileManager = 'file', /* File Manager */ + kServiceCategoryIDE = 'ide-', /* ide */ + kServiceCategoryADB = 'adb-', /* adb */ + kServiceCategoryPCI = 'pci-', /* pci bus */ + /* Nu Bus */ + kServiceCategoryDFM = 'dfm-', /* DFM */ + kServiceCategoryMotherBoard = 'mrbd', /* mother Board */ + kServiceCategoryKeyboard = 'kybd', /* Keyboard */ + kServiceCategoryPointing = 'poit', /* Pointing */ + kServiceCategoryRTC = 'rtc-', /* RTC */ + kServiceCategoryNVRAM = 'nram', /* NVRAM */ + kServiceCategorySound = 'sond', /* Sound (1/3/96 MCS) */ + kServiceCategoryPowerMgt = 'pgmt', /* Power Management */ + kServiceCategoryGeneric = 'genr' /* Generic Service Category to receive general Events */ +}; + +/* Ndrv ServiceCategory Types */ +enum { + kNdrvTypeIsGeneric = 'genr', /* generic*/ + kNdrvTypeIsVideo = 'vido', /* video*/ + kNdrvTypeIsBlockStorage = 'blok', /* block storage*/ + kNdrvTypeIsNetworking = 'netw', /* networking*/ + kNdrvTypeIsSerial = 'serl', /* serial*/ + kNdrvTypeIsParallel = 'parl', /* parallel */ + kNdrvTypeIsSound = 'sond', /* sound*/ + kNdrvTypeIsBusBridge = 'brdg' +}; + +typedef UInt32 DriverDescVersion; + +/* The Driver Description */ +enum { + kInitialDriverDescriptor = 0, + kVersionOneDriverDescriptor = 1 +}; + +enum { + kTheDescriptionSignature = 'mtej', + kDriverDescriptionSignature = 'pdes' +}; + + +struct DriverDescription { + OSType driverDescSignature; /* Signature field of this structure*/ + DriverDescVersion driverDescVersion; /* Version of this data structure*/ + DriverType driverType; /* Type of Driver*/ + DriverOSRuntime driverOSRuntimeInfo; /* OS Runtime Requirements of Driver*/ + DriverOSService driverServices; /* Apple Service API Membership*/ +}; +typedef struct DriverDescription DriverDescription; +typedef DriverDescription * DriverDescriptionPtr; + + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __MACTYPES__ */ + +#ifndef __QUICKDRAW__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +struct RGBColor { + unsigned short red; /*magnitude of red component*/ + unsigned short green; /*magnitude of green component*/ + unsigned short blue; /*magnitude of blue component*/ +}; +typedef struct RGBColor RGBColor; +typedef RGBColor *RGBColorPtr; +typedef RGBColorPtr *RGBColorHdl; + +struct ColorSpec { + short value; /*index or other value*/ + RGBColor rgb; /*true color*/ +}; + +typedef struct ColorSpec ColorSpec; +typedef ColorSpec *ColorSpecPtr; + +struct GammaTbl { + short gVersion; /*gamma version number*/ + short gType; /*gamma data type*/ + short gFormulaSize; /*Formula data size*/ + short gChanCnt; /*number of channels of data*/ + short gDataCnt; /*number of values/channel*/ + short gDataWidth; /*bits/corrected value (data packed to next larger byte size)*/ + short gFormulaData[1]; /*data for formulas followed by gamma values*/ +}; +typedef struct GammaTbl GammaTbl; +typedef GammaTbl *GammaTblPtr; + +struct RegEntryID +{ + void * opaque[4]; +}; +typedef struct RegEntryID RegEntryID; +typedef RegEntryID * RegEntryIDPtr; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +struct IONDRVControlParameters { + UInt8 __reservedA[0x1a]; + UInt16 code; + void * params; + UInt8 __reservedB[0x12]; +}; + +enum { + kIONDRVOpenCommand = 128 + 0, + kIONDRVCloseCommand = 128 + 1, + kIONDRVReadCommand = 128 + 2, + kIONDRVWriteCommand = 128 + 3, + kIONDRVControlCommand = 128 + 4, + kIONDRVStatusCommand = 128 + 5, + kIONDRVKillIOCommand = 128 + 6, + kIONDRVInitializeCommand = 128 + 7, /* init driver and device*/ + kIONDRVFinalizeCommand = 128 + 8, /* shutdown driver and device*/ + kIONDRVReplaceCommand = 128 + 9, /* replace an old driver*/ + kIONDRVSupersededCommand = 128 + 10 /* prepare to be replaced by a new driver*/ +}; +enum { + kIONDRVSynchronousIOCommandKind = 0x00000001, + kIONDRVAsynchronousIOCommandKind = 0x00000002, + kIONDRVImmediateIOCommandKind = 0x00000004 +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __QUICKDRAW__ */ + +#endif /* _IOKIT_IOMACOSTYPES_H */ diff --git a/i386/include/IOKit/ndrvsupport/IOMacOSVideo.h b/i386/include/IOKit/ndrvsupport/IOMacOSVideo.h new file mode 100644 index 0000000..795072b --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/IOMacOSVideo.h @@ -0,0 +1,1391 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + File: Video.h + + Contains: Video Driver Interfaces. + + Copyright: (c) 1986-2000 by Apple Computer, Inc., all rights reserved + + Bugs?: For bug reports, consult the following page on + the World Wide Web: + + http://developer.apple.com/bugreporter/ + +*/ +#ifndef __IOMACOSVIDEO__ +#define __IOMACOSVIDEO__ + +#define PRAGMA_STRUCT_ALIGN 1 +#define FOUR_CHAR_CODE(x) (x) +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +enum { + mBaseOffset = 1, /*Id of mBaseOffset.*/ + mRowBytes = 2, /*Video sResource parameter Id's */ + mBounds = 3, /*Video sResource parameter Id's */ + mVersion = 4, /*Video sResource parameter Id's */ + mHRes = 5, /*Video sResource parameter Id's */ + mVRes = 6, /*Video sResource parameter Id's */ + mPixelType = 7, /*Video sResource parameter Id's */ + mPixelSize = 8, /*Video sResource parameter Id's */ + mCmpCount = 9, /*Video sResource parameter Id's */ + mCmpSize = 10, /*Video sResource parameter Id's */ + mPlaneBytes = 11, /*Video sResource parameter Id's */ + mVertRefRate = 14, /*Video sResource parameter Id's */ + mVidParams = 1, /*Video parameter block id.*/ + mTable = 2, /*Offset to the table.*/ + mPageCnt = 3, /*Number of pages*/ + mDevType = 4, /*Device Type*/ + oneBitMode = 128, /*Id of OneBitMode Parameter list.*/ + twoBitMode = 129, /*Id of TwoBitMode Parameter list.*/ + fourBitMode = 130, /*Id of FourBitMode Parameter list.*/ + eightBitMode = 131 /*Id of EightBitMode Parameter list.*/ +}; + +enum { + sixteenBitMode = 132, /*Id of SixteenBitMode Parameter list.*/ + thirtyTwoBitMode = 133, /*Id of ThirtyTwoBitMode Parameter list.*/ + firstVidMode = 128, /*The new, better way to do the above. */ + secondVidMode = 129, /* QuickDraw only supports six video */ + thirdVidMode = 130, /* at this time. */ + fourthVidMode = 131, + fifthVidMode = 132, + sixthVidMode = 133, + spGammaDir = 64, + spVidNamesDir = 65 +}; + +typedef UInt32 AVIDType; +typedef AVIDType DisplayIDType; +typedef IODisplayModeID DisplayModeID; +typedef UInt16 DepthMode; +typedef UInt32 VideoDeviceType; +typedef UInt32 GammaTableID; + +/* csTimingFormat values in VDTimingInfo */ +/* look in the declaration rom for timing info */ +enum { + kDeclROMtables = FOUR_CHAR_CODE('decl'), + kDetailedTimingFormat = FOUR_CHAR_CODE('arba') /* Timing is a detailed timing*/ +}; + +/* Size of a block of EDID (Extended Display Identification Data) */ +enum { + kDDCBlockSize = 128 +}; + +/* ddcBlockType constants*/ +enum { + kDDCBlockTypeEDID = 0 /* EDID block type. */ +}; + +/* ddcFlags constants*/ +enum { + kDDCForceReadBit = 0, /* Force a new read of the EDID. */ + kDDCForceReadMask = (1 << kDDCForceReadBit) /* Mask for kddcForceReadBit. */ +}; + + +/* Timing mode constants for Display Manager MultiMode support + Corresponding .h equates are in Video.h + .a equates are in Video.a + .r equates are in DepVideoEqu.r + + The second enum is the old names (for compatibility). + The first enum is the new names. +*/ +enum { + timingInvalid = 0, /* Unknown timing... force user to confirm. */ + timingInvalid_SM_T24 = 8, /* Work around bug in SM Thunder24 card.*/ + timingApple_FixedRateLCD = 42, /* Lump all fixed-rate LCDs into one category.*/ + timingApple_512x384_60hz = 130, /* 512x384 (60 Hz) Rubik timing. */ + timingApple_560x384_60hz = 135, /* 560x384 (60 Hz) Rubik-560 timing. */ + timingApple_640x480_67hz = 140, /* 640x480 (67 Hz) HR timing. */ + timingApple_640x400_67hz = 145, /* 640x400 (67 Hz) HR-400 timing. */ + timingVESA_640x480_60hz = 150, /* 640x480 (60 Hz) VGA timing. */ + timingVESA_640x480_72hz = 152, /* 640x480 (72 Hz) VGA timing. */ + timingVESA_640x480_75hz = 154, /* 640x480 (75 Hz) VGA timing. */ + timingVESA_640x480_85hz = 158, /* 640x480 (85 Hz) VGA timing. */ + timingGTF_640x480_120hz = 159, /* 640x480 (120 Hz) VESA Generalized Timing Formula */ + timingApple_640x870_75hz = 160, /* 640x870 (75 Hz) FPD timing.*/ + timingApple_640x818_75hz = 165, /* 640x818 (75 Hz) FPD-818 timing.*/ + timingApple_832x624_75hz = 170, /* 832x624 (75 Hz) GoldFish timing.*/ + timingVESA_800x600_56hz = 180, /* 800x600 (56 Hz) SVGA timing. */ + timingVESA_800x600_60hz = 182, /* 800x600 (60 Hz) SVGA timing. */ + timingVESA_800x600_72hz = 184, /* 800x600 (72 Hz) SVGA timing. */ + timingVESA_800x600_75hz = 186, /* 800x600 (75 Hz) SVGA timing. */ + timingVESA_800x600_85hz = 188, /* 800x600 (85 Hz) SVGA timing. */ + timingVESA_1024x768_60hz = 190, /* 1024x768 (60 Hz) VESA 1K-60Hz timing. */ + timingVESA_1024x768_70hz = 200, /* 1024x768 (70 Hz) VESA 1K-70Hz timing. */ + timingVESA_1024x768_75hz = 204, /* 1024x768 (75 Hz) VESA 1K-75Hz timing (very similar to timingApple_1024x768_75hz). */ + timingVESA_1024x768_85hz = 208, /* 1024x768 (85 Hz) VESA timing. */ + timingApple_1024x768_75hz = 210, /* 1024x768 (75 Hz) Apple 19" RGB. */ + timingApple_1152x870_75hz = 220, /* 1152x870 (75 Hz) Apple 21" RGB. */ + timingAppleNTSC_ST = 230, /* 512x384 (60 Hz, interlaced, non-convolved). */ + timingAppleNTSC_FF = 232, /* 640x480 (60 Hz, interlaced, non-convolved). */ + timingAppleNTSC_STconv = 234, /* 512x384 (60 Hz, interlaced, convolved). */ + timingAppleNTSC_FFconv = 236, /* 640x480 (60 Hz, interlaced, convolved). */ + timingApplePAL_ST = 238, /* 640x480 (50 Hz, interlaced, non-convolved). */ + timingApplePAL_FF = 240, /* 768x576 (50 Hz, interlaced, non-convolved). */ + timingApplePAL_STconv = 242, /* 640x480 (50 Hz, interlaced, convolved). */ + timingApplePAL_FFconv = 244, /* 768x576 (50 Hz, interlaced, convolved). */ + timingVESA_1280x960_75hz = 250, /* 1280x960 (75 Hz) */ + timingVESA_1280x960_60hz = 252, /* 1280x960 (60 Hz) */ + timingVESA_1280x960_85hz = 254, /* 1280x960 (85 Hz) */ + timingVESA_1280x1024_60hz = 260, /* 1280x1024 (60 Hz) */ + timingVESA_1280x1024_75hz = 262, /* 1280x1024 (75 Hz) */ + timingVESA_1280x1024_85hz = 268, /* 1280x1024 (85 Hz) */ + timingVESA_1600x1200_60hz = 280, /* 1600x1200 (60 Hz) VESA timing. */ + timingVESA_1600x1200_65hz = 282, /* 1600x1200 (65 Hz) VESA timing. */ + timingVESA_1600x1200_70hz = 284, /* 1600x1200 (70 Hz) VESA timing. */ + timingVESA_1600x1200_75hz = 286, /* 1600x1200 (75 Hz) VESA timing (pixel clock is 189.2 Mhz dot clock). */ + timingVESA_1600x1200_80hz = 288, /* 1600x1200 (80 Hz) VESA timing (pixel clock is 216>? Mhz dot clock) - proposed only. */ + timingVESA_1600x1200_85hz = 289, /* 1600x1200 (85 Hz) VESA timing (pixel clock is 229.5 Mhz dot clock). */ + timingVESA_1792x1344_60hz = 296, /* 1792x1344 (60 Hz) VESA timing (204.75 Mhz dot clock). */ + timingVESA_1792x1344_75hz = 298, /* 1792x1344 (75 Hz) VESA timing (261.75 Mhz dot clock). */ + timingVESA_1856x1392_60hz = 300, /* 1856x1392 (60 Hz) VESA timing (218.25 Mhz dot clock). */ + timingVESA_1856x1392_75hz = 302, /* 1856x1392 (75 Hz) VESA timing (288 Mhz dot clock). */ + timingVESA_1920x1440_60hz = 304, /* 1920x1440 (60 Hz) VESA timing (234 Mhz dot clock). */ + timingVESA_1920x1440_75hz = 306, /* 1920x1440 (75 Hz) VESA timing (297 Mhz dot clock). */ + timingSMPTE240M_60hz = 400, /* 60Hz V, 33.75KHz H, interlaced timing, 16:9 aspect, typical resolution of 1920x1035. */ + timingFilmRate_48hz = 410, /* 48Hz V, 25.20KHz H, non-interlaced timing, typical resolution of 640x480. */ + timingSony_1600x1024_76hz = 500, /* 1600x1024 (76 Hz) Sony timing (pixel clock is 170.447 Mhz dot clock). */ + timingSony_1920x1080_60hz = 510, /* 1920x1080 (60 Hz) Sony timing (pixel clock is 159.84 Mhz dot clock). */ + timingSony_1920x1080_72hz = 520, /* 1920x1080 (72 Hz) Sony timing (pixel clock is 216.023 Mhz dot clock). */ + timingSony_1920x1200_76hz = 540, /* 1900x1200 (76 Hz) Sony timing (pixel clock is 243.20 Mhz dot clock). */ + timingApple_0x0_0hz_Offline = 550 /* Indicates that this timing will take the display off-line and remove it from the system. */ +}; + + +/* Deprecated timing names.*/ +enum { + timingApple12 = timingApple_512x384_60hz, + timingApple12x = timingApple_560x384_60hz, + timingApple13 = timingApple_640x480_67hz, + timingApple13x = timingApple_640x400_67hz, + timingAppleVGA = timingVESA_640x480_60hz, + timingApple15 = timingApple_640x870_75hz, + timingApple15x = timingApple_640x818_75hz, + timingApple16 = timingApple_832x624_75hz, + timingAppleSVGA = timingVESA_800x600_56hz, + timingApple1Ka = timingVESA_1024x768_60hz, + timingApple1Kb = timingVESA_1024x768_70hz, + timingApple19 = timingApple_1024x768_75hz, + timingApple21 = timingApple_1152x870_75hz, + timingSony_1900x1200_74hz = 530, /* 1900x1200 (74 Hz) Sony timing (pixel clock is 236.25 Mhz dot clock). */ + timingSony_1900x1200_76hz = timingSony_1920x1200_76hz /* 1900x1200 (76 Hz) Sony timing (pixel clock is 245.48 Mhz dot clock). */ +}; + +/* csConnectFlags values in VDDisplayConnectInfo */ +enum { + kAllModesValid = 0, /* All modes not trimmed by primary init are good close enough to try */ + kAllModesSafe = 1, /* All modes not trimmed by primary init are know to be safe */ + kReportsTagging = 2, /* Can detect tagged displays (to identify smart monitors) */ + kHasDirectConnection = 3, /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */ + kIsMonoDev = 4, /* Says whether there's an RGB (0) or Monochrome (1) connection. */ + kUncertainConnection = 5, /* There may not be a display (no sense lines?). */ + kTaggingInfoNonStandard = 6, /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */ + kReportsDDCConnection = 7, /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */ + kHasDDCConnection = 8, /* Card has ddc connect now. */ + kConnectionInactive = 9, /* Set when the connection is NOT currently active (generally used in a multiconnection environment). */ + kDependentConnection = 10, /* Set when some ascpect of THIS connection depends on another (will generally be set in a kModeSimulscan environment). */ + kBuiltInConnection = 11, /* Set when connection is KNOWN to be built-in (this is not the same as kHasDirectConnection). */ + kOverrideConnection = 12, /* Set when the reported connection is not the true one, but is one that has been forced through a SetConnection call */ + kFastCheckForDDC = 13, /* Set when all 3 are true: 1) sense codes indicate DDC display could be attached 2) attempted fast check 3) DDC failed */ + kReportsHotPlugging = 14, /* Detects and reports hot pluggging on connector (via VSL also implies DDC will be up to date w/o force read) */ + kStereoSyncConnection = 15 /* Connection supports stereo sync signalling */ +}; + + +/* csDisplayType values in VDDisplayConnectInfo */ +enum { + kUnknownConnect = 1, /* Not sure how we'll use this, but seems like a good idea. */ + kPanelConnect = 2, /* For use with fixed-in-place LCD panels. */ + kPanelTFTConnect = 2, /* Alias for kPanelConnect */ + kFixedModeCRTConnect = 3, /* For use with fixed-mode (i.e., very limited range) displays. */ + kMultiModeCRT1Connect = 4, /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */ + kMultiModeCRT2Connect = 5, /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */ + kMultiModeCRT3Connect = 6, /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */ + kMultiModeCRT4Connect = 7, /* Expansion to large multi mode (not yet used) */ + kModelessConnect = 8, /* Expansion to modeless model (not yet used) */ + kFullPageConnect = 9, /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */ + kVGAConnect = 10, /* 640x480 VGA default -- question everything else */ + kNTSCConnect = 11, /* NTSC ST (default), FF, STconv, FFconv */ + kPALConnect = 12, /* PAL ST (default), FF, STconv, FFconv */ + kHRConnect = 13, /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */ + kPanelFSTNConnect = 14, /* For use with fixed-in-place LCD FSTN (aka "Supertwist") panels */ + kMonoTwoPageConnect = 15, /* 1152x870 Apple color two-page display */ + kColorTwoPageConnect = 16, /* 1152x870 Apple B&W two-page display */ + kColor16Connect = 17, /* 832x624 Apple B&W two-page display */ + kColor19Connect = 18, /* 1024x768 Apple B&W two-page display */ + kGenericCRT = 19, /* Indicates nothing except that connection is CRT in nature. */ + kGenericLCD = 20, /* Indicates nothing except that connection is LCD in nature. */ + kDDCConnect = 21, /* DDC connection, always set kHasDDCConnection */ + kNoConnect = 22 /* No display is connected - load sensing or similar level of hardware detection is assumed (used by resident drivers that support hot plugging when nothing is currently connected) */ +}; + +/* csTimingFlags values in VDTimingInfoRec */ +enum { + kModeValid = 0, /* Says that this mode should NOT be trimmed. */ + kModeSafe = 1, /* This mode does not need confirmation */ + kModeDefault = 2, /* This is the default mode for this type of connection */ + kModeShowNow = 3, /* This mode should always be shown (even though it may require a confirm) */ + kModeNotResize = 4, /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */ + kModeRequiresPan = 5, /* This mode has more pixels than are actually displayed */ + kModeInterlaced = 6, /* This mode is interlaced (single pixel lines look bad). */ + kModeShowNever = 7, /* This mode should not be shown in the user interface. */ + kModeSimulscan = 8, /* Indicates that more than one display connection can be driven from a single framebuffer controller. */ + kModeNotPreset = 9, /* Indicates that the timing is not a factory preset for the current display (geometry may need correction) */ + kModeBuiltIn = 10, /* Indicates that the display mode is for the built-in connect only (on multiconnect devices like the PB 3400) Only the driver is quieried */ + kModeStretched = 11, /* Indicates that the display mode will be stretched/distorted to match the display aspect ratio */ + kModeNotGraphicsQuality = 12, /* Indicates that the display mode is not the highest quality (eg. stretching artifacts). Intended as a hint */ + kModeValidateAgainstDisplay = 13 /* Indicates that this mode should be validated against the display EDID */ +}; + +/* csDepthFlags in VDVideoParametersInfoRec */ +enum { + kDepthDependent = 0, /* Says that this depth mode may cause dependent changes in other framebuffers (and . */ + kDepthDependentMask = (1 << kDepthDependent) /* mask for kDepthDependent */ +}; + +/* csResolutionFlags bit flags for VDResolutionInfoRec */ +enum { + kResolutionHasMultipleDepthSizes = 0 /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */ +}; + + +enum { + /* Power Mode constants for VDPowerStateRec.powerState. Note the numeric order does not match the power state order */ + kAVPowerOff = 0, /* Power fully off*/ + kAVPowerStandby = 1, + kAVPowerSuspend = 2, + kAVPowerOn = 3, + kHardwareSleep = 128, + kHardwareWake = 129, + kHardwareWakeFromSuspend = 130, + kHardwareWakeToDoze = 131, + kHardwareWakeToDozeFromSuspend = 132, + kHardwarePark = 133, + kHardwareDrive = 134 +}; + +/* Reduced perf level, for GetPowerState, SetPowerState*/ +enum { + kPowerStateReducedPowerMask = 0x00000300, + kPowerStateFullPower = 0x00000000, + kPowerStateReducedPower1 = 0x00000100, + kPowerStateReducedPower2 = 0x00000200, + kPowerStateReducedPower3 = 0x00000300 +}; + +enum { + /* Power Mode masks and bits for VDPowerStateRec.powerFlags. */ + kPowerStateNeedsRefresh = 0, /* When leaving this power mode, a display will need refreshing */ + kPowerStateSleepAwareBit = 1, /* if gestaltPCCardDockingSelectorFix, Docking mgr checks this bit before checking kPowerStateSleepAllowedBit */ + kPowerStateSleepForbiddenBit = 2, /* if kPowerStateSleepAwareBit, Docking mgr checks this bit before sleeping */ + kPowerStateSleepCanPowerOffBit = 3, /* supports power down sleep (ie PCI power off)*/ + kPowerStateSleepNoDPMSBit = 4, /* Bug #2425210. Do not use DPMS with this display.*/ + kPowerStateSleepWaketoDozeBit = 5, /* Supports Wake to Doze */ + kPowerStateSleepWakeNeedsProbeBit = 6, /* Does not sense connection changes on wake */ + + kPowerStateNeedsRefreshMask = (1 << kPowerStateNeedsRefresh), + kPowerStateSleepAwareMask = (1 << kPowerStateSleepAwareBit), + kPowerStateSleepForbiddenMask = (1 << kPowerStateSleepForbiddenBit), + kPowerStateSleepCanPowerOffMask = (1 << kPowerStateSleepCanPowerOffBit), + kPowerStateSleepNoDPMSMask = (1 << kPowerStateSleepNoDPMSBit), + kPowerStateSleepWaketoDozeMask = (1 << kPowerStateSleepWaketoDozeBit), + kPowerStateSleepWakeNeedsProbeMask = (1 << kPowerStateSleepWakeNeedsProbeBit), + + kPowerStateSupportsReducedPower1Bit = 10, + kPowerStateSupportsReducedPower2Bit = 11, + kPowerStateSupportsReducedPower3Bit = 12, + kPowerStateSupportsReducedPower1BitMask = (1 << 10), + kPowerStateSupportsReducedPower2BitMask = (1 << 11), + kPowerStateSupportsReducedPower3BitMask = (1 << 12) +}; + + +enum { + /* Control Codes */ + cscReset = 0, + cscKillIO = 1, + cscSetMode = 2, + cscSetEntries = 3, + cscSetGamma = 4, + cscGrayPage = 5, + cscGrayScreen = 5, + cscSetGray = 6, + cscSetInterrupt = 7, + cscDirectSetEntries = 8, + cscSetDefaultMode = 9, + cscSwitchMode = 10, /* Takes a VDSwitchInfoPtr */ + cscSetSync = 11, /* Takes a VDSyncInfoPtr */ + cscSavePreferredConfiguration = 16, /* Takes a VDSwitchInfoPtr */ + cscSetHardwareCursor = 22, /* Takes a VDSetHardwareCursorPtr */ + cscDrawHardwareCursor = 23, /* Takes a VDDrawHardwareCursorPtr */ + cscSetConvolution = 24, /* Takes a VDConvolutionInfoPtr */ + cscSetPowerState = 25, /* Takes a VDPowerStatePtr */ + cscPrivateControlCall = 26, /* Takes a VDPrivateSelectorDataRec*/ + cscSetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/ + cscSetClutBehavior = 29, /* Takes a VDClutBehavior */ + cscSetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */ + cscDoCommunication = 33, /* Takes a VDCommunicationPtr */ + cscProbeConnection = 34, /* Takes nil pointer */ + /* (may generate a kFBConnectInterruptServiceType service interrupt) */ + cscSetScaler = 36, /* Takes a VDScalerPtr */ + cscSetMirror = 37, /* Takes a VDMirrorPtr*/ + cscSetFeatureConfiguration = 38, /* Takes a VDConfigurationPtr*/ + cscUnusedCall = 127 /* This call used to expand the scrn resource. Its imbedded data contains more control info */ +}; + +enum { + /* Status Codes */ + cscGetMode = 2, + cscGetEntries = 3, + cscGetPageCnt = 4, + cscGetPages = 4, /* This is what C&D 2 calls it. */ + cscGetPageBase = 5, + cscGetBaseAddr = 5, /* This is what C&D 2 calls it. */ + cscGetGray = 6, + cscGetInterrupt = 7, + cscGetGamma = 8, + cscGetDefaultMode = 9, + cscGetCurMode = 10, /* Takes a VDSwitchInfoPtr */ + cscGetSync = 11, /* Takes a VDSyncInfoPtr */ + cscGetConnection = 12, /* Return information about the connection to the display */ + cscGetModeTiming = 13, /* Return timing info for a mode */ + cscGetModeBaseAddress = 14, /* Return base address information about a particular mode */ + cscGetScanProc = 15, /* QuickTime scan chasing routine */ + cscGetPreferredConfiguration = 16, /* Takes a VDSwitchInfoPtr */ + cscGetNextResolution = 17, /* Takes a VDResolutionInfoPtr */ + cscGetVideoParameters = 18, /* Takes a VDVideoParametersInfoPtr */ + cscGetGammaInfoList = 20, /* Takes a VDGetGammaListPtr */ + cscRetrieveGammaTable = 21, /* Takes a VDRetrieveGammaPtr */ + cscSupportsHardwareCursor = 22, /* Takes a VDSupportsHardwareCursorPtr */ + cscGetHardwareCursorDrawState = 23, /* Takes a VDHardwareCursorDrawStatePtr */ + cscGetConvolution = 24, /* Takes a VDConvolutionInfoPtr */ + cscGetPowerState = 25, /* Takes a VDPowerStatePtr */ + cscPrivateStatusCall = 26, /* Takes a VDPrivateSelectorDataRec*/ + cscGetDDCBlock = 27, /* Takes a VDDDCBlockRec */ + cscGetMultiConnect = 28, /* From a GDI point of view, this call should be implemented completely in the HAL and not at all in the core.*/ + cscGetClutBehavior = 29, /* Takes a VDClutBehavior */ + cscGetTimingRanges = 30, /* Takes a VDDisplayTimingRangePtr */ + cscGetDetailedTiming = 31, /* Takes a VDDetailedTimingPtr */ + cscGetCommunicationInfo = 32, /* Takes a VDCommunicationInfoPtr */ + cscGetScalerInfo = 35, /* Takes a VDScalerInfoPtr */ + cscGetScaler = 36, /* Takes a VDScalerPtr */ + cscGetMirror = 37, /* Takes a VDMirrorPtr*/ + cscGetFeatureConfiguration = 38, /* Takes a VDConfigurationPtr*/ + cscGetFeatureList = 39 +}; + +/* Bit definitions for the Get/Set Sync call*/ +enum { + kDisableHorizontalSyncBit = 0, + kDisableVerticalSyncBit = 1, + kDisableCompositeSyncBit = 2, + kEnableSyncOnBlue = 3, + kEnableSyncOnGreen = 4, + kEnableSyncOnRed = 5, + kNoSeparateSyncControlBit = 6, + kTriStateSyncBit = 7, + kHorizontalSyncMask = 0x01, + kVerticalSyncMask = 0x02, + kCompositeSyncMask = 0x04, + kDPMSSyncMask = 0x07, + kTriStateSyncMask = 0x80, + kSyncOnBlueMask = 0x08, + kSyncOnGreenMask = 0x10, + kSyncOnRedMask = 0x20, + kSyncOnMask = 0x38 +}; + +enum { + /* Power Mode constants for translating DPMS modes to Get/SetSync calls. */ + kDPMSSyncOn = 0, + kDPMSSyncStandby = 1, + kDPMSSyncSuspend = 2, + kDPMSSyncOff = 7 +}; + +/* Bit definitions for the Get/Set Convolution call*/ +enum { + kConvolved = 0, + kLiveVideoPassThru = 1, + kConvolvedMask = 0x01, + kLiveVideoPassThruMask = 0x02 +}; + + + +struct VPBlock { + UInt32 vpBaseOffset; /*Offset to page zero of video RAM (From minorBaseOS).*/ +#if __LP64__ + UInt32 vpRowBytes; /*Width of each row of video memory.*/ +#else + SInt16 vpRowBytes; /*Width of each row of video memory.*/ +#endif + Rect vpBounds; /*BoundsRect for the video display (gives dimensions).*/ + SInt16 vpVersion; /*PixelMap version number.*/ + SInt16 vpPackType; + UInt32 vpPackSize; + UInt32 vpHRes; /*Horizontal resolution of the device (pixels per inch).*/ + UInt32 vpVRes; /*Vertical resolution of the device (pixels per inch).*/ + SInt16 vpPixelType; /*Defines the pixel type.*/ + SInt16 vpPixelSize; /*Number of bits in pixel.*/ + SInt16 vpCmpCount; /*Number of components in pixel.*/ + SInt16 vpCmpSize; /*Number of bits per component*/ + UInt32 vpPlaneBytes; /*Offset from one plane to the next.*/ +}; +typedef struct VPBlock VPBlock; +typedef VPBlock * VPBlockPtr; + +struct VDEntryRecord { + Ptr csTable; /* pointer to color table entry=value, r,g,b:INTEGER*/ +}; +typedef struct VDEntryRecord VDEntryRecord; + +typedef VDEntryRecord * VDEntRecPtr; +/* Parm block for SetGray control call */ + +struct VDGrayRecord { + Boolean csMode; /*Same as GDDevType value (0=color, 1=mono)*/ + SInt8 filler; +}; +typedef struct VDGrayRecord VDGrayRecord; + +typedef VDGrayRecord * VDGrayPtr; +/* Parm block for SetInterrupt call */ + +struct VDFlagRecord { + SInt8 csMode; + SInt8 filler; +}; +typedef struct VDFlagRecord VDFlagRecord; + +typedef VDFlagRecord * VDFlagRecPtr; +/* Parm block for SetEntries control call */ + +struct VDSetEntryRecord { + ColorSpec * csTable; /*Pointer to an array of color specs*/ + SInt16 csStart; /*Which spec in array to start with, or -1*/ + SInt16 csCount; /*Number of color spec entries to set*/ +}; +typedef struct VDSetEntryRecord VDSetEntryRecord; + +typedef VDSetEntryRecord * VDSetEntryPtr; +/* Parm block for SetGamma control call */ + +struct VDGammaRecord { + Ptr csGTable; /*pointer to gamma table*/ +}; +typedef struct VDGammaRecord VDGammaRecord; + +typedef VDGammaRecord * VDGamRecPtr; + +struct VDSwitchInfoRec { + DepthMode csMode; /* mode depth*/ + DisplayModeID csData; /* functional sResource of mode*/ + UInt16 csPage; /* page to switch in*/ + Ptr csBaseAddr; /* base address of page (return value)*/ + uintptr_t csReserved; /* Reserved (set to 0) */ +}; +typedef struct VDSwitchInfoRec VDSwitchInfoRec; + +typedef VDSwitchInfoRec * VDSwitchInfoPtr; + +struct VDTimingInfoRec { + DisplayModeID csTimingMode; /* timing mode (a la InitGDevice) */ + uintptr_t csTimingReserved; /* reserved */ + UInt32 csTimingFormat; /* what format is the timing info */ + UInt32 csTimingData; /* data supplied by driver */ + UInt32 csTimingFlags; /* mode within device */ +}; +typedef struct VDTimingInfoRec VDTimingInfoRec; + +typedef VDTimingInfoRec * VDTimingInfoPtr; + +struct VDDisplayConnectInfoRec { + UInt16 csDisplayType; /* Type of display connected */ + UInt8 csConnectTaggedType; /* type of tagging */ + UInt8 csConnectTaggedData; /* tagging data */ + UInt32 csConnectFlags; /* tell us about the connection */ + uintptr_t csDisplayComponent; /* if the card has a direct connection to the display, it returns the display component here (FUTURE) */ + uintptr_t csConnectReserved; /* reserved */ +}; +typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec; + +typedef VDDisplayConnectInfoRec * VDDisplayConnectInfoPtr; + +struct VDMultiConnectInfoRec { + UInt32 csDisplayCountOrNumber; /* For GetMultiConnect, returns count n of 1..n connections; otherwise, indicates the ith connection.*/ + VDDisplayConnectInfoRec csConnectInfo; /* Standard VDDisplayConnectionInfo for connection i.*/ +}; +typedef struct VDMultiConnectInfoRec VDMultiConnectInfoRec; + +typedef VDMultiConnectInfoRec * VDMultiConnectInfoPtr; +/* RawSenseCode + This abstract data type is not exactly abstract. Rather, it is merely enumerated constants + for the possible raw sense code values when 'standard' sense code hardware is implemented. + + For 'standard' sense code hardware, the raw sense is obtained as follows: + o Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines + o Read the state of the monitor sense lines 2, 1, and 0. (2 is the MSB, 0 the LSB) + + IMPORTANT Note: + When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants + are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo' + +*/ +typedef UInt8 RawSenseCode; +enum { + kRSCZero = 0, + kRSCOne = 1, + kRSCTwo = 2, + kRSCThree = 3, + kRSCFour = 4, + kRSCFive = 5, + kRSCSix = 6, + kRSCSeven = 7 +}; + + +/* ExtendedSenseCode + This abstract data type is not exactly abstract. Rather, it is merely enumerated constants + for the values which are possible when the extended sense algorithm is applied to hardware + which implements 'standard' sense code hardware. + + For 'standard' sense code hardware, the extended sense code algorithm is as follows: + (Note: as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0') + o Drive sense line 'A' low and read the values of 'B' and 'C'. + o Drive sense line 'B' low and read the values of 'A' and 'C'. + o Drive sense line 'C' low and read the values of 'A' and 'B'. + + In this way, a six-bit number of the form BC/AC/AB is generated. + + IMPORTANT Note: + When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants + are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo' + +*/ +typedef UInt8 ExtendedSenseCode; +enum { + kESCZero21Inch = 0x00, /* 21" RGB */ + kESCOnePortraitMono = 0x14, /* Portrait Monochrome */ + kESCTwo12Inch = 0x21, /* 12" RGB */ + kESCThree21InchRadius = 0x31, /* 21" RGB (Radius) */ + kESCThree21InchMonoRadius = 0x34, /* 21" Monochrome (Radius) */ + kESCThree21InchMono = 0x35, /* 21" Monochrome */ + kESCFourNTSC = 0x0A, /* NTSC */ + kESCFivePortrait = 0x1E, /* Portrait RGB */ + kESCSixMSB1 = 0x03, /* MultiScan Band-1 (12" thru 1Six") */ + kESCSixMSB2 = 0x0B, /* MultiScan Band-2 (13" thru 19") */ + kESCSixMSB3 = 0x23, /* MultiScan Band-3 (13" thru 21") */ + kESCSixStandard = 0x2B, /* 13"/14" RGB or 12" Monochrome */ + kESCSevenPAL = 0x00, /* PAL */ + kESCSevenNTSC = 0x14, /* NTSC */ + kESCSevenVGA = 0x17, /* VGA */ + kESCSeven16Inch = 0x2D, /* 16" RGB (GoldFish) */ + kESCSevenPALAlternate = 0x30, /* PAL (Alternate) */ + kESCSeven19Inch = 0x3A, /* Third-Party 19" */ + kESCSevenDDC = 0x3E, /* DDC display */ + kESCSevenNoDisplay = 0x3F /* No display connected */ +}; + +/* DepthMode + This abstract data type is used to to reference RELATIVE pixel depths. + Its definition is largely derived from its past usage, analogous to 'xxxVidMode' + + Bits per pixel DOES NOT directly map to 'DepthMode' For example, on some + graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other + hardware, 'kDepthMode1' may represent 8BPP. + + DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc. + behave as expected. The values of the constants which comprise the set are such + that 'kDepthMode4 < kDepthMode6' behaves as expected. +*/ +enum { + kDepthMode1 = 128, + kDepthMode2 = 129, + kDepthMode3 = 130, + kDepthMode4 = 131, + kDepthMode5 = 132, + kDepthMode6 = 133 +}; + +enum { + kFirstDepthMode = 128, /* These constants are obsolete, and just included */ + kSecondDepthMode = 129, /* for clients that have converted to the above */ + kThirdDepthMode = 130, /* kDepthModeXXX constants. */ + kFourthDepthMode = 131, + kFifthDepthMode = 132, + kSixthDepthMode = 133 +}; + + + +struct VDPageInfo { + DepthMode csMode; /* mode within device*/ + DisplayModeID csData; /* data supplied by driver*/ + SInt16 csPage; /* page to switch in*/ + Ptr csBaseAddr; /* base address of page*/ +}; +typedef struct VDPageInfo VDPageInfo; + +typedef VDPageInfo * VDPgInfoPtr; + +struct VDSizeInfo { + SInt16 csHSize; /* desired/returned h size*/ + SInt16 csHPos; /* desired/returned h position*/ + SInt16 csVSize; /* desired/returned v size*/ + SInt16 csVPos; /* desired/returned v position*/ +}; +typedef struct VDSizeInfo VDSizeInfo; + +typedef VDSizeInfo * VDSzInfoPtr; + +struct VDSettings { + SInt16 csParamCnt; /* number of params*/ + SInt16 csBrightMax; /* max brightness*/ + SInt16 csBrightDef; /* default brightness*/ + SInt16 csBrightVal; /* current brightness*/ + SInt16 csCntrstMax; /* max contrast*/ + SInt16 csCntrstDef; /* default contrast*/ + SInt16 csCntrstVal; /* current contrast*/ + SInt16 csTintMax; /* max tint*/ + SInt16 csTintDef; /* default tint*/ + SInt16 csTintVal; /* current tint*/ + SInt16 csHueMax; /* max hue*/ + SInt16 csHueDef; /* default hue*/ + SInt16 csHueVal; /* current hue*/ + SInt16 csHorizDef; /* default horizontal*/ + SInt16 csHorizVal; /* current horizontal*/ + SInt16 csHorizMax; /* max horizontal*/ + SInt16 csVertDef; /* default vertical*/ + SInt16 csVertVal; /* current vertical*/ + SInt16 csVertMax; /* max vertical*/ +}; +typedef struct VDSettings VDSettings; +typedef VDSettings * VDSettingsPtr; + +struct VDDefMode { + UInt8 csID; + SInt8 filler; +}; +typedef struct VDDefMode VDDefMode; +typedef VDDefMode * VDDefModePtr; + +struct VDSyncInfoRec { + UInt8 csMode; + UInt8 csFlags; +}; +typedef struct VDSyncInfoRec VDSyncInfoRec; + +typedef VDSyncInfoRec * VDSyncInfoPtr; +/* + All displayModeID values from 0x80000000 to 0xFFFFFFFF and 0x00 + are reserved for Apple Computer. +*/ +/* Constants for the cscGetNextResolution call */ +enum { + kDisplayModeIDCurrent = 0x00, /* Reference the Current DisplayModeID */ + kDisplayModeIDInvalid = (IODisplayModeID)0xFFFFFFFF, /* A bogus DisplayModeID in all cases */ + kDisplayModeIDFindFirstResolution = (IODisplayModeID)0xFFFFFFFE, /* Used in cscGetNextResolution to reset iterator */ + kDisplayModeIDNoMoreResolutions = (IODisplayModeID)0xFFFFFFFD, /* Used in cscGetNextResolution to indicate End Of List */ + kDisplayModeIDFindFirstProgrammable = (IODisplayModeID)0xFFFFFFFC, /* Used in cscGetNextResolution to find unused programmable timing */ + kDisplayModeIDBootProgrammable = (IODisplayModeID)0xFFFFFFFB, /* This is the ID given at boot time by the OF driver to a programmable timing */ + kDisplayModeIDReservedBase = (IODisplayModeID)0x80000000 /* Lowest (unsigned) DisplayModeID reserved by Apple */ +}; + +/* Constants for the GetGammaInfoList call */ +enum { + kGammaTableIDFindFirst = (GammaTableID)0xFFFFFFFE, /* Get the first gamma table ID */ + kGammaTableIDNoMoreTables = (GammaTableID)0xFFFFFFFD, /* Used to indicate end of list */ + kGammaTableIDSpecific = 0x00 /* Return the info for the given table id */ +}; + +/* Constants for GetMultiConnect call*/ +enum { + kGetConnectionCount = 0xFFFFFFFF, /* Used to get the number of possible connections in a "multi-headed" framebuffer environment.*/ + kActivateConnection = (0 << kConnectionInactive), /* Used for activating a connection (csConnectFlags value).*/ + kDeactivateConnection = (1 << kConnectionInactive) /* Used for deactivating a connection (csConnectFlags value.)*/ +}; + +/* VDCommunicationRec.csBusID values*/ +enum { + kVideoDefaultBus = 0 +}; + + +/* VDCommunicationInfoRec.csBusType values*/ +enum { + kVideoBusTypeInvalid = 0, + kVideoBusTypeI2C = 1, + kVideoBusTypeDisplayPort = 2 +}; + + +/* VDCommunicationRec.csSendType and VDCommunicationRec.csReplyType values*/ +enum { + kVideoNoTransactionType = 0, /* No transaction*/ + kVideoNoTransactionTypeMask = (1 << kVideoNoTransactionType), + kVideoSimpleI2CType = 1, /* Simple I2C message*/ + kVideoSimpleI2CTypeMask = (1 << kVideoSimpleI2CType), + kVideoDDCciReplyType = 2, /* DDC/ci message (with imbedded length)*/ + kVideoDDCciReplyTypeMask = (1 << kVideoDDCciReplyType), + kVideoCombinedI2CType = 3, /* Combined format I2C R/~W transaction*/ + kVideoCombinedI2CTypeMask = (1 << kVideoCombinedI2CType), + kVideoDisplayPortNativeType = 4, /* DisplayPort Native */ + kVideoDisplayPortNativeTypeMask = (1 << kVideoDisplayPortNativeType) +}; + +// VDCommunicationRec.csCommFlags and VDCommunicationInfoRec.csSupportedCommFlags +enum { + kVideoReplyMicroSecDelayBit = 0, /* If bit set, the driver should delay csMinReplyDelay micro seconds between send and receive*/ + kVideoReplyMicroSecDelayMask = (1 << kVideoReplyMicroSecDelayBit), + kVideoUsageAddrSubAddrBit = 1, /* If bit set, the driver understands to use the lower 16 bits of the address field as two 8 bit values (address/subaddress) for the I2C transaction*/ + kVideoUsageAddrSubAddrMask = (1 << kVideoUsageAddrSubAddrBit) +}; + + +struct VDResolutionInfoRec { + DisplayModeID csPreviousDisplayModeID; /* ID of the previous resolution in a chain */ + DisplayModeID csDisplayModeID; /* ID of the next resolution */ + UInt32 csHorizontalPixels; /* # of pixels in a horizontal line at the max depth */ + UInt32 csVerticalLines; /* # of lines in a screen at the max depth */ + Fixed csRefreshRate; /* Vertical Refresh Rate in Hz */ + DepthMode csMaxDepthMode; /* 0x80-based number representing max bit depth */ + UInt32 csResolutionFlags; /* Reserved - flag bits */ + uintptr_t csReserved; /* Reserved */ +}; +typedef struct VDResolutionInfoRec VDResolutionInfoRec; + +typedef VDResolutionInfoRec * VDResolutionInfoPtr; + +struct VDVideoParametersInfoRec { + DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ + DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ + VPBlockPtr csVPBlockPtr; /* Pointer to a video parameter block */ + UInt32 csPageCount; /* Number of pages supported by the resolution */ + VideoDeviceType csDeviceType; /* Device Type: Direct, Fixed or CLUT; */ + UInt32 csDepthFlags; /* Flags */ +}; +typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec; + +typedef VDVideoParametersInfoRec * VDVideoParametersInfoPtr; + +struct VDGammaInfoRec { + GammaTableID csLastGammaID; /* the ID of the previous gamma table */ + GammaTableID csNextGammaID; /* the ID of the next gamma table */ + Ptr csGammaPtr; /* Ptr to a gamma table data */ + uintptr_t csReserved; /* Reserved */ +}; +typedef struct VDGammaInfoRec VDGammaInfoRec; + +typedef VDGammaInfoRec * VDGammaInfoPtr; + +struct VDGetGammaListRec { + GammaTableID csPreviousGammaTableID; /* ID of the previous gamma table */ + GammaTableID csGammaTableID; /* ID of the gamma table following csPreviousDisplayModeID */ + UInt32 csGammaTableSize; /* Size of the gamma table in bytes */ + char * csGammaTableName; /* Gamma table name (c-string) */ +}; +typedef struct VDGetGammaListRec VDGetGammaListRec; + +typedef VDGetGammaListRec * VDGetGammaListPtr; + +struct VDRetrieveGammaRec { + GammaTableID csGammaTableID; /* ID of gamma table to retrieve */ + GammaTbl * csGammaTablePtr; /* Location to copy desired gamma to */ +}; +typedef struct VDRetrieveGammaRec VDRetrieveGammaRec; + +typedef VDRetrieveGammaRec * VDRetrieveGammaPtr; + +struct VDSetHardwareCursorRec { + void * csCursorRef; /* reference to cursor data */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* should be ignored */ +}; +typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec; + +typedef VDSetHardwareCursorRec * VDSetHardwareCursorPtr; + +struct VDDrawHardwareCursorRec { + SInt32 csCursorX; /* x coordinate */ + SInt32 csCursorY; /* y coordinate */ + UInt32 csCursorVisible; /* true if cursor is must be visible */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* should be ignored */ +}; +typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec; + +typedef VDDrawHardwareCursorRec * VDDrawHardwareCursorPtr; + +struct VDSupportsHardwareCursorRec { + UInt32 csSupportsHardwareCursor; + /* true if hardware cursor is supported */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* must be zero */ +}; +typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec; + +typedef VDSupportsHardwareCursorRec * VDSupportsHardwareCursorPtr; + +struct VDHardwareCursorDrawStateRec { + SInt32 csCursorX; /* x coordinate */ + SInt32 csCursorY; /* y coordinate */ + UInt32 csCursorVisible; /* true if cursor is visible */ + UInt32 csCursorSet; /* true if cursor successfully set by last set control call */ + UInt32 csReserved1; /* reserved for future use */ + UInt32 csReserved2; /* must be zero */ +}; +typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec; + +typedef VDHardwareCursorDrawStateRec * VDHardwareCursorDrawStatePtr; + +struct VDConvolutionInfoRec { + DisplayModeID csDisplayModeID; /* the ID of the resolution we want info on */ + DepthMode csDepthMode; /* The bit depth we want the info on (0x80 based) */ + UInt32 csPage; + UInt32 csFlags; + UInt32 csReserved; +}; +typedef struct VDConvolutionInfoRec VDConvolutionInfoRec; + +typedef VDConvolutionInfoRec * VDConvolutionInfoPtr; + +struct VDPowerStateRec { + UInt32 powerState; + UInt32 powerFlags; + + uintptr_t powerReserved1; + uintptr_t powerReserved2; +}; +typedef struct VDPowerStateRec VDPowerStateRec; + +typedef VDPowerStateRec * VDPowerStatePtr; +/* + Private Data to video drivers. + + In versions of MacOS with multiple address spaces (System 8), the OS + must know the extent of parameters in order to move them between the caller + and driver. The old private-selector model for video drivers does not have + this information so: + + For post-7.x Systems private calls should be implemented using the cscPrivateCall +*/ + +struct VDPrivateSelectorDataRec { + LogicalAddress privateParameters; /* Caller's parameters*/ + ByteCount privateParametersSize; /* Size of data sent from caller to driver*/ + LogicalAddress privateResults; /* Caller's return area. Can be nil, or same as privateParameters.*/ + ByteCount privateResultsSize; /* Size of data driver returns to caller. Can be nil, or same as privateParametersSize.*/ +}; +typedef struct VDPrivateSelectorDataRec VDPrivateSelectorDataRec; + + +struct VDPrivateSelectorRec { + UInt32 reserved; /* Reserved (set to 0). */ + VDPrivateSelectorDataRec data[1]; +}; +typedef struct VDPrivateSelectorRec VDPrivateSelectorRec; + +struct VDDDCBlockRec { + UInt32 ddcBlockNumber; /* Input -- DDC EDID (Extended Display Identification Data) number (1-based) */ + ResType ddcBlockType; /* Input -- DDC block type (EDID/VDIF) */ + UInt32 ddcFlags; /* Input -- DDC Flags*/ + UInt32 ddcReserved; /* Reserved */ + Byte ddcBlockData[128]; /* Output -- DDC EDID/VDIF data (kDDCBlockSize) */ +}; +typedef struct VDDDCBlockRec VDDDCBlockRec; + +typedef VDDDCBlockRec * VDDDCBlockPtr; + +enum { + /* timingSyncConfiguration*/ + kSyncInterlaceMask = (1 << 7), + kSyncAnalogCompositeMask = 0, + kSyncAnalogCompositeSerrateMask = (1 << 2), + kSyncAnalogCompositeRGBSyncMask = (1 << 1), + kSyncAnalogBipolarMask = (1 << 3), + kSyncAnalogBipolarSerrateMask = (1 << 2), + kSyncAnalogBipolarSRGBSyncMask = (1 << 1), + kSyncDigitalCompositeMask = (1 << 4), + kSyncDigitalCompositeSerrateMask = (1 << 2), + kSyncDigitalCompositeMatchHSyncMask = (1 << 2), + kSyncDigitalSeperateMask = (1 << 4) + (1 << 3), + kSyncDigitalVSyncPositiveMask = (1 << 2), + kSyncDigitalHSyncPositiveMask = (1 << 1) +}; + + + + +struct VDDisplayTimingRangeRec { + UInt32 csRangeSize; /* Init to sizeof(VDDisplayTimingRangeRec) */ + UInt32 csRangeType; /* Init to 0 */ + UInt32 csRangeVersion; /* Init to 0 */ + UInt32 csRangeReserved; /* Init to 0 */ + + UInt32 csRangeBlockIndex; /* Requested block (first index is 0)*/ + UInt32 csRangeGroup; /* set to 0 */ + UInt32 csRangeBlockCount; /* # blocks */ + UInt32 csRangeFlags; /* dependent video */ + + UInt64 csMinPixelClock; /* Min dot clock in Hz */ + UInt64 csMaxPixelClock; /* Max dot clock in Hz */ + + UInt32 csMaxPixelError; /* Max dot clock error */ + UInt32 csTimingRangeSyncFlags; + UInt32 csTimingRangeSignalLevels; + UInt32 csTimingRangeSupportedSignalConfigs; + + UInt32 csMinFrameRate; /* Hz */ + UInt32 csMaxFrameRate; /* Hz */ + UInt32 csMinLineRate; /* Hz */ + UInt32 csMaxLineRate; /* Hz */ + + + UInt32 csMaxHorizontalTotal; /* Clocks - Maximum total (active + blanking) */ + UInt32 csMaxVerticalTotal; /* Clocks - Maximum total (active + blanking) */ + UInt32 csMaxTotalReserved1; /* Reserved */ + UInt32 csMaxTotalReserved2; /* Reserved */ + + + + /* Some cards require that some timing elements*/ + /* be multiples of a "character size" (often 8*/ + /* clocks). The "xxxxCharSize" fields document*/ + /* those requirements.*/ + + + UInt8 csCharSizeHorizontalActive; /* Character size */ + UInt8 csCharSizeHorizontalBlanking; /* Character size */ + UInt8 csCharSizeHorizontalSyncOffset; /* Character size */ + UInt8 csCharSizeHorizontalSyncPulse; /* Character size */ + + UInt8 csCharSizeVerticalActive; /* Character size */ + UInt8 csCharSizeVerticalBlanking; /* Character size */ + UInt8 csCharSizeVerticalSyncOffset; /* Character size */ + UInt8 csCharSizeVerticalSyncPulse; /* Character size */ + + UInt8 csCharSizeHorizontalBorderLeft; /* Character size */ + UInt8 csCharSizeHorizontalBorderRight; /* Character size */ + UInt8 csCharSizeVerticalBorderTop; /* Character size */ + UInt8 csCharSizeVerticalBorderBottom; /* Character size */ + + UInt8 csCharSizeHorizontalTotal; /* Character size for active + blanking */ + UInt8 csCharSizeVerticalTotal; /* Character size for active + blanking */ + UInt16 csCharSizeReserved1; /* Reserved (Init to 0) */ + + + UInt32 csMinHorizontalActiveClocks; + UInt32 csMaxHorizontalActiveClocks; + UInt32 csMinHorizontalBlankingClocks; + UInt32 csMaxHorizontalBlankingClocks; + + UInt32 csMinHorizontalSyncOffsetClocks; + UInt32 csMaxHorizontalSyncOffsetClocks; + UInt32 csMinHorizontalPulseWidthClocks; + UInt32 csMaxHorizontalPulseWidthClocks; + + UInt32 csMinVerticalActiveClocks; + UInt32 csMaxVerticalActiveClocks; + UInt32 csMinVerticalBlankingClocks; + UInt32 csMaxVerticalBlankingClocks; + + UInt32 csMinVerticalSyncOffsetClocks; + UInt32 csMaxVerticalSyncOffsetClocks; + UInt32 csMinVerticalPulseWidthClocks; + UInt32 csMaxVerticalPulseWidthClocks; + + + UInt32 csMinHorizontalBorderLeft; + UInt32 csMaxHorizontalBorderLeft; + UInt32 csMinHorizontalBorderRight; + UInt32 csMaxHorizontalBorderRight; + + UInt32 csMinVerticalBorderTop; + UInt32 csMaxVerticalBorderTop; + UInt32 csMinVerticalBorderBottom; + UInt32 csMaxVerticalBorderBottom; + + UInt32 csMaxNumLinks; /* number of links, if zero, assume link 1 */ + UInt32 csMinLink0PixelClock; /* min pixel clock for link 0 (kHz) */ + UInt32 csMaxLink0PixelClock; /* max pixel clock for link 0 (kHz) */ + UInt32 csMinLink1PixelClock; /* min pixel clock for link 1 (kHz) */ + UInt32 csMaxLink1PixelClock; /* max pixel clock for link 1 (kHz) */ + + UInt32 csReserved6; /* Reserved (Init to 0)*/ + UInt32 csReserved7; /* Reserved (Init to 0)*/ + UInt32 csReserved8; /* Reserved (Init to 0)*/ +}; +typedef struct VDDisplayTimingRangeRec VDDisplayTimingRangeRec; + +typedef VDDisplayTimingRangeRec * VDDisplayTimingRangePtr; + +enum { + /* csDisplayModeState*/ + kDMSModeReady = 0, /* Display Mode ID is configured and ready*/ + kDMSModeNotReady = 1, /* Display Mode ID is is being programmed*/ + kDMSModeFree = 2 /* Display Mode ID is not associated with a timing*/ +}; + + +/* Video driver Errors -10930 to -10959 */ +enum { + kTimingChangeRestrictedErr = -10930, + kVideoI2CReplyPendingErr = -10931, + kVideoI2CTransactionErr = -10932, + kVideoI2CBusyErr = -10933, + kVideoI2CTransactionTypeErr = -10934, + kVideoBufferSizeErr = -10935, + kVideoCannotMirrorErr = -10936 +}; + + +enum { + /* csTimingRangeSignalLevels*/ + kRangeSupportsSignal_0700_0300_Bit = 0, + kRangeSupportsSignal_0714_0286_Bit = 1, + kRangeSupportsSignal_1000_0400_Bit = 2, + kRangeSupportsSignal_0700_0000_Bit = 3, + kRangeSupportsSignal_0700_0300_Mask = (1 << kRangeSupportsSignal_0700_0300_Bit), + kRangeSupportsSignal_0714_0286_Mask = (1 << kRangeSupportsSignal_0714_0286_Bit), + kRangeSupportsSignal_1000_0400_Mask = (1 << kRangeSupportsSignal_1000_0400_Bit), + kRangeSupportsSignal_0700_0000_Mask = (1 << kRangeSupportsSignal_0700_0000_Bit) +}; + + +enum { + /* csSignalConfig*/ + kDigitalSignalBit = 0, /* Do not set. Mac OS does not currently support arbitrary digital timings*/ + kAnalogSetupExpectedBit = 1, /* Analog displays - display expects a blank-to-black setup or pedestal. See VESA signal standards.*/ + kInterlacedCEA861SyncModeBit = 2, + + kDigitalSignalMask = (1 << kDigitalSignalBit), + kAnalogSetupExpectedMask = (1 << kAnalogSetupExpectedBit), + kInterlacedCEA861SyncModeMask = (1 << kInterlacedCEA861SyncModeBit) +}; + + +enum { + /* csSignalLevels for analog*/ + kAnalogSignalLevel_0700_0300 = 0, + kAnalogSignalLevel_0714_0286 = 1, + kAnalogSignalLevel_1000_0400 = 2, + kAnalogSignalLevel_0700_0000 = 3 +}; + + +enum { + /* csTimingRangeSyncFlags*/ + kRangeSupportsSeperateSyncsBit = 0, + kRangeSupportsSyncOnGreenBit = 1, + kRangeSupportsCompositeSyncBit = 2, + kRangeSupportsVSyncSerrationBit = 3, + kRangeSupportsSeperateSyncsMask = (1 << kRangeSupportsSeperateSyncsBit), + kRangeSupportsSyncOnGreenMask = (1 << kRangeSupportsSyncOnGreenBit), + kRangeSupportsCompositeSyncMask = (1 << kRangeSupportsCompositeSyncBit), + kRangeSupportsVSyncSerrationMask = (1 << kRangeSupportsVSyncSerrationBit) +}; + + + +enum { + /* csHorizontalSyncConfig and csVerticalSyncConfig*/ + kSyncPositivePolarityBit = 0, /* Digital separate sync polarity for analog interfaces (0 => negative polarity)*/ + kSyncPositivePolarityMask = (1 << kSyncPositivePolarityBit) +}; + + + + +/* For timings with kDetailedTimingFormat.*/ + +struct VDDetailedTimingRec { + UInt32 csTimingSize; /* Init to sizeof(VDDetailedTimingRec)*/ + UInt32 csTimingType; /* Init to 0*/ + UInt32 csTimingVersion; /* Init to 0*/ + UInt32 csTimingReserved; /* Init to 0*/ + + DisplayModeID csDisplayModeID; /* Init to 0*/ + UInt32 csDisplayModeSeed; /* */ + UInt32 csDisplayModeState; /* Display Mode state*/ + UInt32 csDisplayModeAlias; /* Mode to use when programmed.*/ + + UInt32 csSignalConfig; + UInt32 csSignalLevels; + + UInt64 csPixelClock; /* Hz*/ + + UInt64 csMinPixelClock; /* Hz - With error what is slowest actual clock */ + UInt64 csMaxPixelClock; /* Hz - With error what is fasted actual clock */ + + + UInt32 csHorizontalActive; /* Pixels*/ + UInt32 csHorizontalBlanking; /* Pixels*/ + UInt32 csHorizontalSyncOffset; /* Pixels*/ + UInt32 csHorizontalSyncPulseWidth; /* Pixels*/ + + UInt32 csVerticalActive; /* Lines*/ + UInt32 csVerticalBlanking; /* Lines*/ + UInt32 csVerticalSyncOffset; /* Lines*/ + UInt32 csVerticalSyncPulseWidth; /* Lines*/ + + UInt32 csHorizontalBorderLeft; /* Pixels*/ + UInt32 csHorizontalBorderRight; /* Pixels*/ + UInt32 csVerticalBorderTop; /* Lines*/ + UInt32 csVerticalBorderBottom; /* Lines*/ + + UInt32 csHorizontalSyncConfig; + UInt32 csHorizontalSyncLevel; /* Future use (init to 0)*/ + UInt32 csVerticalSyncConfig; + UInt32 csVerticalSyncLevel; /* Future use (init to 0)*/ + + UInt32 csNumLinks; /* number of links, if 0 = assume link - 0 */ + + UInt32 csReserved2; /* Init to 0*/ + UInt32 csReserved3; /* Init to 0*/ + UInt32 csReserved4; /* Init to 0*/ + + UInt32 csReserved5; /* Init to 0*/ + UInt32 csReserved6; /* Init to 0*/ + UInt32 csReserved7; /* Init to 0*/ + UInt32 csReserved8; /* Init to 0*/ +}; +typedef struct VDDetailedTimingRec VDDetailedTimingRec; + +typedef VDDetailedTimingRec * VDDetailedTimingPtr; + +/* csScalerFeatures */ +enum { + kScaleStretchOnlyMask = (1<<0), /* True means the driver cannot add borders to avoid non-square pixels */ + kScaleCanUpSamplePixelsMask = (1<<1), /* True means timings with more active clocks than pixels (ie 640x480 pixels on a 1600x1200 timing) */ + kScaleCanDownSamplePixelsMask = (1<<2), /* True means timings with fewer active clocks than pixels (ie 1600x1200 pixels on a 640x480 timing) */ + kScaleCanScaleInterlacedMask = (1<<3), /* True means can scale an interlaced timing */ + kScaleCanSupportInsetMask = (1<<4), /* True means can scale a timing with insets */ + kScaleCanRotateMask = (1<<5), /* True means can rotate image */ + kScaleCanBorderInsetOnlyMask = (1<<6) /* True means can scale a timing with insets */ +}; + +/* csScalerFlags */ +enum { + kScaleStretchToFitMask = 0x00000001, /* True means the driver should avoid borders and allow non-square pixels */ + + kScaleRotateFlagsMask = 0x000000f0, + + kScaleSwapAxesMask = 0x00000010, + kScaleInvertXMask = 0x00000020, + kScaleInvertYMask = 0x00000040, + + kScaleRotate0Mask = 0x00000000, + kScaleRotate90Mask = kScaleSwapAxesMask | kScaleInvertXMask, + kScaleRotate180Mask = kScaleInvertXMask | kScaleInvertYMask, + kScaleRotate270Mask = kScaleSwapAxesMask | kScaleInvertYMask +}; + +typedef UInt32 VDClutBehavior; +typedef VDClutBehavior * VDClutBehaviorPtr; +enum { + kSetClutAtSetEntries = 0, /* SetEntries behavior is to update clut during SetEntries call*/ + kSetClutAtVBL = 1 /* SetEntries behavior is to upate clut at next vbl*/ +}; + + +struct VDCommunicationRec { + SInt32 csBusID; /* kVideoDefaultBus for single headed cards.*/ + UInt32 csCommFlags; /* Always zero*/ + UInt32 csMinReplyDelay; /* Minimum delay between send and reply transactions (units depend on csCommFlags)*/ + UInt32 csReserved2; /* Always zero*/ + + UInt32 csSendAddress; /* Usually I2C address (eg 0x6E)*/ + UInt32 csSendType; /* See kVideoSimpleI2CType etc.*/ + LogicalAddress csSendBuffer; /* Pointer to the send buffer*/ + ByteCount csSendSize; /* Number of bytes to send*/ + + UInt32 csReplyAddress; /* Address from which to read (eg 0x6F for kVideoDDCciReplyType I2C address)*/ + UInt32 csReplyType; /* See kVideoDDCciReplyType etc.*/ + LogicalAddress csReplyBuffer; /* Pointer to the reply buffer*/ + ByteCount csReplySize; /* Max bytes to reply (size of csReplyBuffer)*/ + + UInt32 csReserved3; + UInt32 csReserved4; + UInt32 csReserved5; /* Always zero*/ + UInt32 csReserved6; /* Always zero*/ +}; +typedef struct VDCommunicationRec VDCommunicationRec; + +typedef VDCommunicationRec * VDCommunicationPtr; + +struct VDCommunicationInfoRec { + SInt32 csBusID; /* kVideoDefaultBus for single headed cards. */ + UInt32 csBusType; /* See kVideoBusI2C etc.*/ + SInt32 csMinBus; /* Minimum bus (usually kVideoDefaultBus). Used to probe additional busses*/ + SInt32 csMaxBus; /* Max bus (usually kVideoDefaultBus). Used to probe additional busses*/ + + UInt32 csSupportedTypes; /* Bit field for first 32 supported transaction types. Eg. 0x07 => support for kVideoNoTransactionType, kVideoSimpleI2CType and kVideoDDCciReplyType.*/ + UInt32 csSupportedCommFlags; /* Return the flags csCommFlags understood by this driver. */ + UInt32 csReserved2; /* Always zero*/ + UInt32 csReserved3; /* Always zero*/ + + UInt32 csReserved4; /* Always zero*/ + UInt32 csReserved5; /* Always zero*/ + UInt32 csReserved6; /* Always zero*/ + UInt32 csReserved7; /* Always zero*/ +}; +typedef struct VDCommunicationInfoRec VDCommunicationInfoRec; + +typedef VDCommunicationInfoRec * VDCommunicationInfoPtr; + + +struct VDScalerRec { + UInt32 csScalerSize; /* Init to sizeof(VDScalerRec) */ + UInt32 csScalerVersion; /* Init to 0 */ + UInt32 csReserved1; /* Init to 0 */ + UInt32 csReserved2; /* Init to 0 */ + + DisplayModeID csDisplayModeID; /* Display Mode ID modified by this call. */ + UInt32 csDisplayModeSeed; /* */ + UInt32 csDisplayModeState; /* Display Mode state */ + UInt32 csReserved3; /* Init to 0 */ + + UInt32 csScalerFlags; /* Init to 0 */ + UInt32 csHorizontalPixels; /* Graphics system addressable pixels */ + UInt32 csVerticalPixels; /* Graphics system addressable lines */ + UInt32 csHorizontalInset; /* Border pixels for underscan */ + UInt32 csVerticalInset; /* Border lines for underscan */ + UInt32 csReserved6; /* Init to 0 */ + UInt32 csReserved7; /* Init to 0 */ + UInt32 csReserved8; /* Init to 0 */ +}; +typedef struct VDScalerRec VDScalerRec; +typedef VDScalerRec *VDScalerPtr; + +struct VDScalerInfoRec { + UInt32 csScalerInfoSize; /* Init to sizeof(VDScalerInfoRec) */ + UInt32 csScalerInfoVersion; /* Init to 0 */ + UInt32 csReserved1; /* Init to 0 */ + UInt32 csReserved2; /* Init to 0 */ + + UInt32 csScalerFeatures; /* Feature flags */ + UInt32 csMaxHorizontalPixels; /* limit to horizontal scaled pixels */ + UInt32 csMaxVerticalPixels; /* limit to vertical scaled pixels */ + UInt32 csReserved3; /* Init to 0 */ + + UInt32 csReserved4; /* Init to 0 */ + UInt32 csReserved5; /* Init to 0 */ + UInt32 csReserved6; /* Init to 0 */ + UInt32 csReserved7; /* Init to 0 */ +}; +typedef struct VDScalerInfoRec VDScalerInfoRec; +typedef VDScalerInfoRec *VDScalerInfoPtr; + +enum { + /* csMirrorFeatures*/ + kMirrorSameDepthOnlyMirrorMask = (1 << 0), /* Commonly true - Mirroring can only be done if the displays are the same bitdepth*/ + kMirrorSameSizeOnlyMirrorMask = (1 << 1), /* Commonly false - Mirroring can only be done if the displays are the same size*/ + kMirrorSameTimingOnlyMirrorMask = (1 << 2), /* Sometimes true - Mirroring can only be done if the displays are the same timing*/ + kMirrorCommonGammaMask = (1 << 3) /* Sometimes true - Only one gamma correction LUT.*/ +}; + +enum { + /* csMirrorSupportedFlags and csMirrorFlags*/ + kMirrorCanMirrorMask = (1 << 0), /* Set means we can HW mirrored right now (uses csMirrorEntryID)*/ + kMirrorAreMirroredMask = (1 << 1), /* Set means we are HW mirrored right now (uses csMirrorEntryID)*/ + kMirrorUnclippedMirrorMask = (1 << 2), /* Set means mirrored displays are not clipped to their intersection*/ + kMirrorHAlignCenterMirrorMask = (1 << 3), /* Set means mirrored displays can/should be centered horizontally*/ + kMirrorVAlignCenterMirrorMask = (1 << 4), /* Set means mirrored displays can/should be centered vertically*/ + kMirrorCanChangePixelFormatMask = (1 << 5), /* Set means mirrored the device should change the pixel format of mirrored displays to allow mirroring.*/ + kMirrorCanChangeTimingMask = (1 << 6), /* Set means mirrored the device should change the timing of mirrored displays to allow mirroring.*/ + kMirrorClippedMirrorMask = (1 << 7) /* Set means mirrored displays are clipped to their intersection (driver handles blacking and base address adjustment)*/ +}; + +struct VDMirrorRec { + UInt32 csMirrorSize; /* Init to sizeof(VDMirrorRec)*/ + UInt32 csMirrorVersion; /* Init to 0*/ + + RegEntryID csMirrorRequestID; /* Input RegEntryID to check for mirroring support and state*/ + RegEntryID csMirrorResultID; /* Output RegEntryID of the next mirrored device*/ + + UInt32 csMirrorFeatures; /* Output summary features of the driver*/ + UInt32 csMirrorSupportedFlags; /* Output configuration options supported by the driver*/ + UInt32 csMirrorFlags; /* Output configuration options active now*/ + UInt32 csReserved1; /* Init to 0*/ + + + UInt32 csReserved2; /* Init to 0*/ + UInt32 csReserved3; /* Init to 0*/ + UInt32 csReserved4; /* Init to 0*/ + UInt32 csReserved5; /* Init to 0*/ +}; +typedef struct VDMirrorRec VDMirrorRec; +typedef VDMirrorRec * VDMirrorPtr; + +struct VDConfigurationRec { + UInt32 csConfigFeature; /* input what feature to config - always input*/ + UInt32 csConfigSupport; /* output support value - always output*/ + uintptr_t csConfigValue; /* input/output feature value - input on Control(), output on Status()*/ + uintptr_t csReserved1; + uintptr_t csReserved2; +}; +typedef struct VDConfigurationRec VDConfigurationRec; +typedef VDConfigurationRec * VDConfigurationPtr; + +enum +{ + kDVIPowerSwitchFeature = (1 << 0), /* Used for csConfigFeature*/ + kDVIPowerSwitchSupportMask = (1 << 0), /* Read-only*/ + kDVIPowerSwitchActiveMask = (1 << 0), /* Read/write for csConfigValue*/ +}; + +struct VDConfigurationFeatureListRec +{ + OSType * csConfigFeatureList; + ItemCount csNumConfigFeatures; + uintptr_t csReserved1; + uintptr_t csReserved2; +}; +typedef struct VDConfigurationFeatureListRec VDConfigurationFeatureListRec; +typedef VDConfigurationFeatureListRec * VDConfigurationFeatureListRecPtr; + + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __IOMACOSVIDEO__ */ + diff --git a/i386/include/IOKit/ndrvsupport/IONDRVFramebuffer.h b/i386/include/IOKit/ndrvsupport/IONDRVFramebuffer.h new file mode 100644 index 0000000..ca65891 --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/IONDRVFramebuffer.h @@ -0,0 +1,352 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-1998 Apple Computer, Inc. + * + * + * HISTORY + * + * sdouglas 22 Oct 97 - first checked in. + * sdouglas 24 Jul 98 - start IOKit. + * sdouglas 15 Dec 98 - cpp. + * + */ + +#ifndef _IOKIT_IONDRVFRAMEBUFFER_H +#define _IOKIT_IONDRVFRAMEBUFFER_H + +#include +#include +#include + +#define kIONDRVDisableKey "AAPL,disable-ndrv" + +class IONDRVFramebuffer : public IOFramebuffer +{ + OSDeclareDefaultStructors(IONDRVFramebuffer) + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of this class in the future. + */ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * reserved; + +protected: + + IOService * nub; + class IONDRV * ndrv; + + // current configuration + IODisplayModeID currentDisplayMode; + IOIndex currentDepth; + IOIndex currentPage; + UInt8 __reservedE; + + IOPhysicalAddress physicalFramebuffer; + IODeviceMemory * vramRange; + + UInt8 gammaWidth; + UInt8 __reservedD; + UInt8 lastGrayMode; + VDClutBehavior lastClutSetting; + UInt8 __reservedC; + + bool consoleDevice; + UInt32 powerState; + UInt32 ndrvState; + SInt32 ndrvEnter; + OSArray * detailedTimings; + UInt32 detailedTimingsSeed; + UInt32 * detailedTimingsCurrent; + + IODeviceMemory * vramMemory; + + VDResolutionInfoRec cachedVDResolution; + + struct _VSLService * vslServices; + + UInt32 accessFlags; + unsigned int shouldDoI2CPower:1; + unsigned int online:1; + unsigned int avJackState:1; + unsigned int grayMode:1; + unsigned int platformSleep:1; + unsigned int forceReadEDID:1; + unsigned int supportsProbe:1; + unsigned int __reservedB:25; + + IOService * device; + + UInt32 __reservedA[29]; + +private: + struct IONDRVFramebufferPrivate * __private; + +public: + virtual IOReturn doDriverIO( UInt32 commandID, void * contents, + UInt32 commandCode, UInt32 commandKind ); +private: + OSMetaClassDeclareReservedUsed(IONDRVFramebuffer, 0); + + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 1); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 2); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 3); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 4); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 5); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 6); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 7); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 8); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 9); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 10); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 11); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 12); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 13); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 14); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 15); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 16); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 17); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 18); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 19); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 20); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 21); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 22); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 23); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 24); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 25); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 26); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 27); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 28); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 29); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 30); + OSMetaClassDeclareReservedUnused(IONDRVFramebuffer, 31); + +private: + + void initForPM ( void ); + + virtual unsigned long maxCapabilityForDomainState( IOPMPowerFlags domainState ); + virtual unsigned long initialPowerStateForDomainState( IOPMPowerFlags domainState ); + virtual unsigned long powerStateForDomainState( IOPMPowerFlags domainState ); + + virtual IOReturn checkDriver( void ); + virtual UInt32 iterateAllModes( IODisplayModeID * displayModeIDs ); + virtual IOReturn getResInfoForMode( IODisplayModeID modeID, + IODisplayModeInformation * theInfo ); + virtual IOReturn getResInfoForArbMode( IODisplayModeID modeID, + IODisplayModeInformation * theInfo ); + IOReturn getResInfoForDetailed( IODisplayModeID modeID, + VDDetailedTimingRec * detailed, + IODisplayModeInformation * info ); + IOIndex mapDepthIndex( IODisplayModeID modeID, IOIndex depth, bool fromDepthMode ); + virtual IOReturn validateDisplayMode( + IODisplayModeID mode, IOOptionBits flags, + VDDetailedTimingRec ** detailed ); + virtual IOReturn setDetailedTiming( + IODisplayModeID mode, IOOptionBits options, + void * description, IOByteCount descripSize ); + virtual void getCurrentConfiguration( void ); + static const IOTVector * _undefinedSymbolHandler( void * self, + const char * libraryName, const char * symbolName ); + static bool _videoJackStateChangeHandler( void * target, void * ref, + IOService * newService, IONotifier * notifier ); + static void _avProbeAction( OSObject * p0, IOTimerEventSource * evtSrc ); + void displayI2CPower( bool enable ); + IOReturn ndrvSetPowerState( UInt32 newState ); + IOReturn ndrvUpdatePowerState( void ); + IOReturn ndrvSetDisplayPowerState( UInt32 newState ); + static IOReturn _probeAction( IONDRVFramebuffer * self, IOOptionBits options ); + bool searchOfflineMode( IODisplayModeID * offlineMode ); + IOReturn processConnectChange( uintptr_t * value ); + IOReturn setMirror( IONDRVFramebuffer * other ); + IOReturn setConnectionFlags( void ); + bool getOnlineState( void ); + IOReturn ndrvGetSetFeature( UInt32 feature, uintptr_t newValue, uintptr_t * currentValue ); + static IOReturn _doControl( IONDRVFramebuffer * self, UInt32 code, void * params ); + static IOReturn _doStatus( IONDRVFramebuffer * self, UInt32 code, void * params ); + static IOReturn extControl( OSObject * owner, void * code, void * params ); + static IOReturn extStatus( OSObject * owner, void * code, void * params ); + IOReturn createI2C( void ); + void setInfoProperties( void ); + +public: + virtual IOReturn doControl( UInt32 code, void * params ); + virtual IOReturn doStatus( UInt32 code, void * params ); + +public: + + virtual IOService * probe( IOService * provider, + SInt32 * score ); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual void free( void ); + + virtual IOReturn setProperties( OSObject * properties ); + + virtual IOReturn requestProbe( IOOptionBits options ); + + virtual IOReturn enableController( void ); + + virtual IODeviceMemory * makeSubRange( IOPhysicalAddress start, + IOPhysicalLength length ); + virtual IODeviceMemory * getApertureRange( IOPixelAperture aperture ); + virtual IODeviceMemory * getVRAMRange( void ); + + virtual IODeviceMemory * findVRAM( void ); + + virtual bool isConsoleDevice( void ); + + virtual const IOTVector * undefinedSymbolHandler( const char * libraryName, + const char * symbolName ); + + virtual const char * getPixelFormats( void ); + + // Array of supported display modes + virtual IOItemCount getDisplayModeCount( void ); + virtual IOReturn getDisplayModes( IODisplayModeID * allDisplayModes ); + + // Info about a display mode + virtual IOReturn getInformationForDisplayMode( IODisplayModeID displayMode, + IODisplayModeInformation * info ); + + // Mask of pixel formats available in mode and depth + virtual UInt64 getPixelFormatsForDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + + virtual IOReturn getPixelInformation( + IODisplayModeID displayMode, IOIndex depth, + IOPixelAperture aperture, IOPixelInformation * pixelInfo ); + + // Framebuffer info + + // Current display mode and depth + virtual IOReturn getCurrentDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + + // Set display mode and depth + virtual IOReturn setDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + + // For pages + virtual IOReturn setApertureEnable( IOPixelAperture aperture, + IOOptionBits enable ); + + virtual IOReturn setStartupDisplayMode( IODisplayModeID displayMode, + IOIndex depth ); + virtual IOReturn getStartupDisplayMode( IODisplayModeID * displayMode, + IOIndex * depth ); + + //// CLUTs + + virtual IOReturn setCLUTWithEntries( IOColorEntry * colors, UInt32 index, + UInt32 numEntries, IOOptionBits options ); + + //// Gamma + + virtual IOReturn setGammaTable( UInt32 channelCount, UInt32 dataCount, + UInt32 dataWidth, void * data ); + + //// Display mode timing information + + virtual IOReturn getTimingInfoForDisplayMode( IODisplayModeID displayMode, + IOTimingInformation * info ); + + //// Detailed timing information + + virtual IOReturn validateDetailedTiming( + void * description, IOByteCount descripSize ); + + virtual IOReturn setDetailedTimings( OSArray * array ); + + //// Controller attributes + + virtual IOReturn setAttribute( IOSelect attribute, uintptr_t value ); + virtual IOReturn getAttribute( IOSelect attribute, uintptr_t * value ); + + //// Connections + + virtual IOItemCount getConnectionCount( void ); + + virtual IOReturn getAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t * value ); + + virtual IOReturn setAttributeForConnection( IOIndex connectIndex, + IOSelect attribute, uintptr_t info ); + + // Apple sensing + + virtual IOReturn getAppleSense( IOIndex connectIndex, + UInt32 * senseType, + UInt32 * primary, + UInt32 * extended, + UInt32 * displayType ); + + virtual IOReturn connectFlags( IOIndex connectIndex, + IODisplayModeID displayMode, IOOptionBits * flags ); + + //// IOHighLevelDDCSense + + virtual bool hasDDCConnect( IOIndex connectIndex ); + virtual IOReturn getDDCBlock( IOIndex connectIndex, UInt32 blockNumber, + IOSelect blockType, IOOptionBits options, + UInt8 * data, IOByteCount * length ); + + //// Interrupts + + virtual IOReturn registerForInterruptType( IOSelect interruptType, + IOFBInterruptProc proc, OSObject * target, void * ref, + void ** interruptRef ); + virtual IOReturn unregisterInterrupt( void * interruptRef ); + virtual IOReturn setInterruptState( void * interruptRef, UInt32 state ); + + //// HW Cursors + + virtual IOReturn setCursorImage( void * cursorImage ); + virtual IOReturn setCursorState( SInt32 x, SInt32 y, bool visible ); + + //// I2C calls + + virtual IOReturn doI2CRequest( UInt32 bus, IOI2CBusTiming * timing, IOI2CRequest * request ); + + //// VSL calls + + static OSStatus VSLNewInterruptService( + void * entryID, + UInt32 serviceType, + _VSLService ** serviceID ); + static OSStatus VSLDisposeInterruptService( _VSLService * serviceID ); + static OSStatus VSLDoInterruptService( _VSLService * serviceID ); + static Boolean VSLPrepareCursorForHardwareCursor( + void * cursorRef, + IOHardwareCursorDescriptor * hwDesc, + IOHardwareCursorInfo * hwCursorInfo ); +}; + +#endif /* ! _IOKIT_IONDRVFRAMEBUFFER_H */ + + diff --git a/i386/include/IOKit/ndrvsupport/IONDRVLibraries.h b/i386/include/IOKit/ndrvsupport/IONDRVLibraries.h new file mode 100644 index 0000000..ad4a26d --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/IONDRVLibraries.h @@ -0,0 +1,696 @@ + +#ifndef __IONDRVLIBRARIES__ +#define __IONDRVLIBRARIES__ + +#include +#include +#include +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/* NameRegistry error codes */ +enum { + nrLockedErr = -2536, + nrNotEnoughMemoryErr = -2537, + nrInvalidNodeErr = -2538, + nrNotFoundErr = -2539, + nrNotCreatedErr = -2540, + nrNameErr = -2541, + nrNotSlotDeviceErr = -2542, + nrDataTruncatedErr = -2543, + nrPowerErr = -2544, + nrPowerSwitchAbortErr = -2545, + nrTypeMismatchErr = -2546, + nrNotModifiedErr = -2547, + nrOverrunErr = -2548, + nrResultCodeBase = -2549, + nrPathNotFound = -2550, /* a path component lookup failed */ + nrPathBufferTooSmall = -2551, /* buffer for path is too small */ + nrInvalidEntryIterationOp = -2552, /* invalid entry iteration operation */ + nrPropertyAlreadyExists = -2553, /* property already exists */ + nrIterationDone = -2554, /* iteration operation is done */ + nrExitedIteratorScope = -2555, /* outer scope of iterator was exited */ + nrTransactionAborted = -2556, /* transaction was aborted */ + + gestaltUndefSelectorErr = -5551 /*undefined selector was passed to Gestalt*/ +}; + +enum { + kNVRAMProperty = 0x00000020, // matches NR +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef _IOKIT_IOSERVICE_H +typedef struct IOService IOService; +#endif + +IOReturn _IONDRVLibrariesInitialize( IOService * provider ); +IOReturn _IONDRVLibrariesFinalize( IOService * provider ); + +#ifndef kAAPLRegEntryIDKey +#define kAAPLRegEntryIDKey "AAPL,RegEntryID" +#endif + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +UInt32 EndianSwap32Bit( UInt32 data ); + +UInt16 EndianSwap16Bit( UInt16 data ); + +void SynchronizeIO(void); + +OSErr ExpMgrConfigReadLong( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt32 * valuePtr); + +OSErr ExpMgrConfigWriteLong( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt32 value); + +OSErr ExpMgrConfigReadWord( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt16 * valuePtr); + +OSErr ExpMgrConfigWriteWord( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt16 value); + +OSErr ExpMgrConfigReadByte( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt8 * valuePtr); + +OSErr ExpMgrConfigWriteByte( + RegEntryIDPtr node, + LogicalAddress configAddr, + UInt8 value); + +OSErr ExpMgrIOReadLong( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt32 * valuePtr); + +OSErr ExpMgrIOWriteLong( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt32 value); + +OSErr ExpMgrIOReadWord( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt16 * valuePtr); + +OSErr ExpMgrIOWriteWord( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt16 value); + +OSErr ExpMgrIOReadByte( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt8 * valuePtr); + +OSErr ExpMgrIOWriteByte( + RegEntryIDPtr node, + LogicalAddress ioAddr, + UInt8 value); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/******************************************************************************* + * + * Foundation Types + * + */ +/* Value of a property */ +typedef void * RegPropertyValue; +/* Length of property value */ +typedef UInt32 RegPropertyValueSize; + +/*******************************************************************************/ + +/******************************************************************************* + * + * Root Entry Name Definitions (Applies to all Names in the RootNameSpace) + * + * + Names are a colon-separated list of name components. Name components + * may not themselves contain colons. + * + Names are presented as null-terminated ASCII character strings. + * + Names follow similar parsing rules to Apple file system absolute + * and relative paths. However the '::' parent directory syntax is + * not currently supported. + */ +/* Max length of Entry Name */ +enum { + kRegCStrMaxEntryNameLength = 47 +}; + +/* Entry Names are single byte ASCII */ +typedef char RegCStrEntryName; +typedef char * RegCStrEntryNamePtr; +/* length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1*/ +typedef char RegCStrEntryNameBuf[48]; +typedef char RegCStrPathName; +typedef UInt32 RegPathNameSize; +enum { + kRegPathNameSeparator = ':', /* 0x3A */ + kRegEntryNameTerminator = 0x00, /* '\0' */ + kRegPathNameTerminator = 0x00 /* '\0' */ +}; + +/******************************************************************************* + * + * Property Name and ID Definitions + * (Applies to all Properties Regardless of NameSpace) + */ +enum { + kRegMaximumPropertyNameLength = 31, /* Max length of Property Name */ + kRegPropertyNameTerminator = 0x00 /* '\0' */ +}; + +typedef char RegPropertyNameBuf[32]; +typedef char RegPropertyName; +typedef char * RegPropertyNamePtr; +enum { + kRegMaxPropertyNameLength = kRegMaximumPropertyNameLength +}; + +/******************************************************************************* + * + * Iteration Operations + * + * These specify direction when traversing the name relationships + */ +typedef UInt32 RegIterationOp; +typedef RegIterationOp RegEntryIterationOp; +enum { + /* Absolute locations*/ + kRegIterRoot = 0x00000002, /* "Upward" Relationships */ + kRegIterParents = 0x00000003, /* include all parent(s) of entry */ + /* "Downward" Relationships*/ + kRegIterChildren = 0x00000004, /* include all children */ + kRegIterSubTrees = 0x00000005, /* include all sub trees of entry */ + kRegIterDescendants = 0x00000005, /* include all descendants of entry */ + /* "Horizontal" Relationships */ + kRegIterSibling = 0x00000006, /* include all siblings */ + /* Keep doing the same thing*/ + kRegIterContinue = 0x00000001 +}; + +/******************************************************************************* + * + * Name Entry and Property Modifiers + * + * + * + * Modifiers describe special characteristics of names + * and properties. Modifiers might be supported for + * some names and not others. + * + * Device Drivers should not rely on functionality + * specified as a modifier. + */ +typedef UInt32 RegModifiers; +typedef RegModifiers RegEntryModifiers; +typedef RegModifiers RegPropertyModifiers; +enum { + kRegNoModifiers = 0x00000000, /* no entry modifiers in place */ + kRegUniversalModifierMask = 0x0000FFFF, /* mods to all entries */ + kRegNameSpaceModifierMask = 0x00FF0000, /* mods to all entries within namespace */ + kRegModifierMask = (RegModifiers)0xFF000000 /* mods to just this entry */ +}; + +/* Universal Property Modifiers */ +enum { + kRegPropertyValueIsSavedToNVRAM = 0x00000020, /* property is non-volatile (saved in NVRAM) */ + kRegPropertyValueIsSavedToDisk = 0x00000040 /* property is non-volatile (saved on disk) */ +}; + +typedef size_t Size; + +#ifndef _IOKIT_IOREGISTRYENTRY_H +typedef struct IORegistryIterator IORegistryIterator; +typedef struct OSIterator OSIterator; +#endif /* _IOKIT_IOREGISTRYENTRY_H */ +typedef IORegistryIterator * RegEntryIter; +typedef OSIterator * RegPropertyIter; + +OSStatus RegistryEntryIDCopy( const RegEntryID * entryID, RegEntryID * to ); + +OSStatus RegistryEntryIDInit( RegEntryID * entryID ); + +Boolean RegistryEntryIDCompare( const RegEntryID * id1, const RegEntryID * id2); + +OSStatus RegistryPropertyGetSize( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + RegPropertyValueSize * propertySize); + +OSStatus RegistryPropertyGet( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + void * propertyValue, + RegPropertyValueSize * propertySize); + +OSStatus RegistryPropertyCreate( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryPropertyDelete( + const RegEntryID * entryID, + const RegPropertyName * propertyName); + +OSStatus RegistryPropertySet( + const RegEntryID * entryID, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryPropertyGetMod( + const RegEntryID * entry, + const RegPropertyName * name, + RegPropertyModifiers * modifiers); + +OSStatus RegistryPropertySetMod( + const RegEntryID * entry, + const RegPropertyName * name, + RegPropertyModifiers modifiers); + +OSStatus RegistryPropertyIterateCreate( + const RegEntryID * entry, + RegPropertyIter * cookie); + +OSStatus RegistryPropertyIterateDispose( RegPropertyIter * cookie); + +OSStatus RegistryPropertyIterate( + RegPropertyIter * cookie, + RegPropertyName * foundProperty, + Boolean * done); + +OSStatus RegistryEntryIterateCreate( RegEntryIter * cookie); + +OSStatus RegistryEntryIterateDispose( RegEntryIter * cookie); + +OSStatus RegistryEntryIterateSet( RegEntryIter * cookie, + const RegEntryID * startEntryID); + +OSStatus RegistryEntryIterate( RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done); + +OSStatus RegistryCStrEntryToName( const RegEntryID * entryID, + RegEntryID * parentEntry, + RegCStrEntryName * nameComponent, + Boolean * done ); + +OSStatus RegistryCStrEntryLookup( const RegEntryID * parentEntry, + const RegCStrPathName * path, + RegEntryID * newEntry); + +OSStatus RegistryCStrEntryCreate( const RegEntryID * parentEntry, + const RegCStrPathName * name, + RegEntryID * newEntry); + +OSStatus RegistryEntryDelete(const RegEntryID * entryID); + +OSStatus RegistryEntryIDDispose(RegEntryID * entryID); + +// + +OSStatus RegistryEntryCopy( + RegEntryID * parentEntryID, + RegEntryID * sourceDevice, + RegEntryID * destDevice); + +OSStatus RegistryEntrySearch( + RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done, + const RegPropertyName * propertyName, + const void * propertyValue, + RegPropertyValueSize propertySize); + +OSStatus RegistryEntryToPathSize( + const RegEntryID * entryID, + RegPathNameSize * pathSize); + +OSStatus RegistryCStrEntryToPath( + const RegEntryID * entryID, + RegCStrPathName * pathName, + RegPathNameSize pathSize); + +OSStatus RegistryPropertyRename( + const RegEntryID * entry, + const RegPropertyName * oldName, + const RegPropertyName * newName); + +OSStatus RegistryEntryGetMod( + const RegEntryID * entry, + RegEntryModifiers * modifiers); + +OSStatus RegistryEntrySetMod( + const RegEntryID * entry, + RegEntryModifiers modifiers); + +OSStatus RegistryEntryMod( + RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done, + RegEntryModifiers matchingModifiers); + +OSStatus RegistryEntryPropertyMod( + RegEntryIter * cookie, + RegEntryIterationOp relationship, + RegEntryID * foundEntry, + Boolean * done, + RegPropertyModifiers matchingModifiers); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +void SynchronizeIO(void); + +Boolean CompareAndSwap( + UInt32 oldVvalue, + UInt32 newValue, + UInt32 * OldValueAdr); + +UInt32 CStrLen(const char * src); + +char * CStrCopy( char * dst, const char * src); + +SInt16 CStrCmp( + const char * s1, + const char * s2); + +char * CStrCat( + char * dst, + const char * src); +char * CStrNCopy( + char * dst, + const char * src, + UInt32 max); +SInt16 CStrNCmp( + const char * s1, + const char * s2, + UInt32 max); +char * CStrNCat( + char * dst, + const char * src, + UInt32 max); + +void BlockCopy( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMove( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMoveData( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMoveDataUncached( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockMoveUncached( + const void * srcPtr, + void * destPtr, + Size byteCount); +void BlockZero( + const void * srcPtr, + Size byteCount); +void BlockZeroUncached( + const void * srcPtr, + Size byteCount); + +char * PStrCopy( char *to, const char *from ); + +void PStrToCStr( char *to, const char *from ); + +void CStrToPStr( char *to, const char *from ); + +LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear); + +OSStatus PoolDeallocate( LogicalAddress address ); + +UInt32 CurrentExecutionLevel(void); + +UnsignedWide UpTime( void ); + +UnsignedWide AddAbsoluteToAbsolute(UnsignedWide left, UnsignedWide right); + +UnsignedWide SubAbsoluteFromAbsolute(UnsignedWide left, UnsignedWide right); + +UnsignedWide DurationToAbsolute( Duration theDuration); + +UnsignedWide AddDurationToAbsolute( Duration duration, UnsignedWide absolute ); + +UnsignedWide NanosecondsToAbsolute ( UnsignedWide theNanoseconds); + +UnsignedWide AbsoluteToNanoseconds( UnsignedWide absolute ); + +Duration AbsoluteDeltaToDuration( UnsignedWide left, UnsignedWide right ); + +Duration AbsoluteToDuration( UnsignedWide result ); + +OSStatus DelayForHardware( UnsignedWide time ); + +OSStatus DelayUntil( UnsignedWide time ); + +OSStatus DelayFor( Duration theDuration ); + +void SysDebugStr( const char * from ); + +void SysDebug( void ); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +enum { + paramErr = -50, /*error in user parameter list*/ + noHardwareErr = -200, /*Sound Manager Error Returns*/ + notEnoughHardwareErr = -201, /*Sound Manager Error Returns*/ + userCanceledErr = -128, + qErr = -1, /*queue element not found during deletion*/ + vTypErr = -2, /*invalid queue element*/ + corErr = -3, /*core routine number out of range*/ + unimpErr = -4, /*unimplemented core routine*/ + SlpTypeErr = -5, /*invalid queue element*/ + seNoDB = -8, /*no debugger installed to handle debugger command*/ + controlErr = -17, /*I/O System Errors*/ + statusErr = -18, /*I/O System Errors*/ + readErr = -19, /*I/O System Errors*/ + writErr = -20, /*I/O System Errors*/ + badUnitErr = -21, /*I/O System Errors*/ + unitEmptyErr = -22, /*I/O System Errors*/ + openErr = -23, /*I/O System Errors*/ + closErr = -24, /*I/O System Errors*/ + dRemovErr = -25, /*tried to remove an open driver*/ + dInstErr = -26, /*DrvrInstall couldn't find driver in resources*/ + + badCksmErr = -69, /*addr mark checksum didn't check*/ +}; +enum { + durationMicrosecond = -1, /* Microseconds are negative*/ + durationMillisecond = 1, /* Milliseconds are positive*/ + durationSecond = 1000, /* 1000 * durationMillisecond*/ + durationMinute = 60000, /* 60 * durationSecond,*/ + durationHour = 3600000, /* 60 * durationMinute,*/ + durationDay = 86400000, /* 24 * durationHour,*/ + durationNoWait = 0, /* don't block*/ + durationForever = 0x7FFFFFFF /* no time limit*/ +}; +#ifndef NULL + #if !defined(__cplusplus) && (defined(__SC__) || defined(THINK_C)) + /* Symantec C compilers (but not C++) want NULL and nil to be (void*)0 */ + #define NULL ((void *) 0) + #else + /* in case int is 16-bits, make sure NULL is 32-bits */ + #define NULL 0L + #endif +#endif + +#ifndef nil + #define nil NULL +#endif + +typedef ResType VSLGestaltType; + +enum { + clutType = 0, /*0 if lookup table*/ + fixedType = 1, /*1 if fixed table*/ + directType = 2, /*2 if direct values*/ + RGBDirect = 16 /* 16 & 32 bits/pixel pixelType value */ +}; +typedef UInt32 * UInt32Ptr; + +typedef struct IOHardwareCursorDescriptor HardwareCursorDescriptorRec; +typedef HardwareCursorDescriptorRec * HardwareCursorDescriptorPtr; +typedef struct IOHardwareCursorInfo HardwareCursorInfoRec; +typedef HardwareCursorInfoRec * HardwareCursorInfoPtr; + +typedef ResType InterruptServiceType; +typedef struct _VSLService * InterruptServiceIDType; +typedef InterruptServiceIDType * InterruptServiceIDPtr; + +enum { + kVBLInterruptServiceType = 'vbl ', + kHBLInterruptServiceType = 'hbl ', + kFrameInterruptServiceType = 'fram', + kConnectInterruptServiceType = 'dci ', /* Renamed -- Use kFBCheckInterruptServiceType*/ + kFBConnectInterruptServiceType = kConnectInterruptServiceType, /* Demand to check configuration (Hardware unchanged)*/ + kFBChangedInterruptServiceType = 'chng', /* Demand to rebuild (Hardware has reinitialized on dependent change)*/ + kFBOfflineInterruptServiceType = 'remv', /* Demand to remove framebuffer (Hardware not available on dependent change -- but must not buserror)*/ + kFBOnlineInterruptServiceType = 'add ' /* Notice that hardware is available (after being removed)*/ +}; + +enum { + kVSLClamshellStateGestaltType = 'clam', +}; + +OSStatus +VSLGestalt( VSLGestaltType selector, UInt32 * response ); + +OSStatus +VSLSetDisplayConfiguration(RegEntryID * entryID, + RegPropertyName * propertyName, + RegPropertyValue configData, + RegPropertyValueSize configDataSize); +OSErr +VSLNewInterruptService( + RegEntryID * serviceDevice, + InterruptServiceType serviceType, + InterruptServiceIDPtr serviceID); + +OSErr +VSLWaitOnInterruptService( + InterruptServiceIDType serviceID, + Duration timeout); + +OSErr +VSLDisposeInterruptService(InterruptServiceIDType serviceID); + +OSErr +VSLDoInterruptService(InterruptServiceIDType serviceID); + +Boolean +VSLPrepareCursorForHardwareCursor( + void * cursorRef, + IOHardwareCursorDescriptor * hardwareDescriptor, + IOHardwareCursorInfo * hwCursorInfo); + +typedef UnsignedWide Nanoseconds; +enum { + /* Version Release Stage Codes */ + developStage = 0x20, + alphaStage = 0x40, + betaStage = 0x60, + finalStage = 0x80 +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef struct OpaqueIOCommandID* IOCommandID; + +typedef UInt32 IOCommandKind; +typedef UInt32 IOCommandCode; + +OSErr IOCommandIsComplete( IOCommandID commandID, OSErr result); + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef __IONDRV__ +typedef struct OpaqueInterruptSetID* InterruptSetID; +#else +typedef class IONDRVInterruptSet * InterruptSetID; +#endif /* __IONDRV__ */ + +typedef long InterruptMemberNumber; +struct InterruptSetMember { + InterruptSetID setID; + InterruptMemberNumber member; +}; +typedef struct InterruptSetMember InterruptSetMember; +enum { + kISTChipInterruptSource = 0, + kISTOutputDMAInterruptSource = 1, + kISTInputDMAInterruptSource = 2, + kISTPropertyMemberCount = 3 +}; + +typedef InterruptSetMember ISTProperty[3]; +#define kISTPropertyName "driver-ist" + +typedef long InterruptReturnValue; +enum { + kFirstMemberNumber = 1, + kIsrIsComplete = 0, + kIsrIsNotComplete = -1, + kMemberNumberParent = -2 +}; + +typedef Boolean InterruptSourceState; +enum { + kSourceWasEnabled = true, + kSourceWasDisabled = false +}; + +typedef InterruptMemberNumber (*InterruptHandler) (InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount); +typedef void (*InterruptEnabler) (InterruptSetMember ISTmember, void *refCon); +typedef InterruptSourceState (*InterruptDisabler)(InterruptSetMember ISTmember, void *refCon); + +enum { + kReturnToParentWhenComplete = 0x00000001, + kReturnToParentWhenNotComplete = 0x00000002 +}; + +typedef OptionBits InterruptSetOptions; + + +OSStatus GetInterruptFunctions( + InterruptSetID setID, + InterruptMemberNumber member, + void ** refCon, + InterruptHandler * handlerFunction, + InterruptEnabler * enableFunction, + InterruptDisabler * disableFunction); + +OSStatus InstallInterruptFunctions( + InterruptSetID setID, + InterruptMemberNumber member, + void * refCon, + InterruptHandler handlerFunction, + InterruptEnabler enableFunction, + InterruptDisabler disableFunction); + +OSStatus CreateInterruptSet( + InterruptSetID parentSet, + InterruptMemberNumber parentMember, + InterruptMemberNumber setSize, + InterruptSetID * setID, + InterruptSetOptions options); + +OSStatus DeleteInterruptSet( InterruptSetID setID ); + + +#ifdef __cplusplus +} +#endif + +#endif /* __IONDRVLIBRARIES__ */ + diff --git a/i386/include/IOKit/ndrvsupport/IONDRVSupport.h b/i386/include/IOKit/ndrvsupport/IONDRVSupport.h new file mode 100644 index 0000000..2fdfcb6 --- /dev/null +++ b/i386/include/IOKit/ndrvsupport/IONDRVSupport.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IONDRVSUPPORT__ +#define __IONDRVSUPPORT__ + +#include + +#ifndef __LP64__ +#pragma options align=mac68k +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define kIONDRVIgnoreKey "AAPL,iokit-ignore-ndrv" +#define kIONDRVForXKey "AAPL,iokit-ndrv" + +struct IOTVector { + void * pc; + UInt32 toc; +}; +typedef struct IOTVector IOTVector; + +struct IONDRVInterruptSetMember { + void * setID; + UInt32 member; +}; +typedef struct IONDRVInterruptSetMember IONDRVInterruptSetMember; + +typedef SInt32 (*IONDRVInterruptHandler)( IONDRVInterruptSetMember setMember, void *refCon, UInt32 theIntCount); +typedef void (*IONDRVInterruptEnabler)( IONDRVInterruptSetMember setMember, void *refCon); +typedef Boolean (*IONDRVInterruptDisabler)( IONDRVInterruptSetMember setMember, void *refCon); + +enum { + kIONDRVFirstMemberNumber = 1, + kIONDRVIsrIsComplete = 0, + kIONDRVIsrIsNotComplete = -1, + kIONDRVMemberNumberParent = -2 +}; + +enum { + kIONDRVReturnToParentWhenComplete = 0x00000001, + kIONDRVReturnToParentWhenNotComplete = 0x00000002 +}; + +enum { + kIONDRVISTChipInterruptSource = 0, + kIONDRVISTOutputDMAInterruptSource = 1, + kIONDRVISTInputDMAInterruptSource = 2, + kIONDRVISTPropertyMemberCount = 3 +}; + +#define kIONDRVISTPropertyName "driver-ist" + +IOReturn +IONDRVInstallInterruptFunctions(void * setID, + UInt32 member, + void * refCon, + IOTVector * handler, + IOTVector * enabler, + IOTVector * disabler ); + +typedef const IOTVector * (*IONDRVUndefinedSymbolHandler)( void * self, + const char * libraryName, const char * symbolName ); + +#ifndef __LP64__ +#pragma options align=reset +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __IONDRVSUPPORT__ */ diff --git a/i386/include/IOKit/network/.svn/all-wcprops b/i386/include/IOKit/network/.svn/all-wcprops new file mode 100644 index 0000000..79208c5 --- /dev/null +++ b/i386/include/IOKit/network/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network +END +IOEthernetController.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOEthernetController.h +END +IONetworkData.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IONetworkData.h +END +IOKernelDebugger.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOKernelDebugger.h +END +IOOutputQueue.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOOutputQueue.h +END +IOBasicOutputQueue.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOBasicOutputQueue.h +END +IONetworkStats.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IONetworkStats.h +END +IOGatedOutputQueue.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOGatedOutputQueue.h +END +IONetworkInterface.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IONetworkInterface.h +END +IONetworkMedium.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IONetworkMedium.h +END +IOPacketQueue.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOPacketQueue.h +END +IOEthernetStats.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOEthernetStats.h +END +IONetworkController.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IONetworkController.h +END +IOEthernetInterface.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOEthernetInterface.h +END +IOMbufMemoryCursor.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/network/IOMbufMemoryCursor.h +END diff --git a/i386/include/IOKit/network/.svn/entries b/i386/include/IOKit/network/.svn/entries new file mode 100644 index 0000000..7c39b62 --- /dev/null +++ b/i386/include/IOKit/network/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/network +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOEthernetController.h +file + + + + +2013-08-27T23:54:22.000000Z +7adf0b0913306b6988652da9f0f5cfac +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +23096 + +IONetworkData.h +file + + + + +2013-08-27T23:54:22.000000Z +8c48f364c542ef2ddb6ea69410843dd0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +19889 + +IOKernelDebugger.h +file + + + + +2013-08-27T23:54:22.000000Z +7b49bd4f927ba72234160571bd4c6bd5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13809 + +IOOutputQueue.h +file + + + + +2013-08-27T23:54:22.000000Z +025bc0209d732217ef55baece55c9808 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9577 + +IOBasicOutputQueue.h +file + + + + +2013-08-27T23:54:22.000000Z +e0e651cf1a7ea1eca99920406f2daa25 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12017 + +IONetworkStats.h +file + + + + +2013-08-27T23:54:22.000000Z +3632073d60f59cdd7ff74a1cba9f9d5d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3094 + +IOGatedOutputQueue.h +file + + + + +2013-08-27T23:54:22.000000Z +26c9a70eb013aeba236d8bc443b4193b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5588 + +IONetworkInterface.h +file + + + + +2013-08-27T23:54:22.000000Z +157d50f62a02d85e3baa4efb6f5ce66c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +47370 + +IONetworkMedium.h +file + + + + +2013-08-27T23:54:22.000000Z +be2ebf65ecb4fc7e4dbab4fa6018365e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16561 + +IOPacketQueue.h +file + + + + +2013-08-27T23:54:22.000000Z +05b3e55203cc6b67d8081c0fed0d3c34 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10292 + +IOEthernetStats.h +file + + + + +2013-08-27T23:54:22.000000Z +1a29850bc5c4d727cfbc15eaa59b0ac7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5839 + +IONetworkController.h +file + + + + +2013-08-27T23:54:22.000000Z +b99668e74d6d857dddbc86d7e754fdd2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +68064 + +IOEthernetInterface.h +file + + + + +2013-08-27T23:54:22.000000Z +9c9ad6f7b11d85d10fbb231ae3cf3b1b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14351 + +IOMbufMemoryCursor.h +file + + + + +2013-08-27T23:54:22.000000Z +a1d97b40e6c2281c419269c3bd38a468 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16114 + diff --git a/i386/include/IOKit/network/.svn/text-base/IOBasicOutputQueue.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOBasicOutputQueue.h.svn-base new file mode 100644 index 0000000..3519805 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOBasicOutputQueue.h.svn-base @@ -0,0 +1,319 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOBASICOUTPUTQUEUE_H +#define _IOBASICOUTPUTQUEUE_H + +#include +#include +#include // FIXME - remove + +struct IOMbufQueue; + +/*! @class IOBasicOutputQueue + @abstract A concrete implementation of an IOOutputQueue. + @discussion This object uses a spinlock to protect the packet queue from multiple producers. + A single producer is promoted to become a consumer when the queue is + not active. Otherwise, the producer will simply queue the packet and + return without blocking. + + The flow of packets from the queue to its target can be controlled + by calling methods such as start(), stop(), or service(). The target + is expected to call those methods from a single threaded context, + i.e. the work loop context in a network driver. In addition, the + target must also return a status for every packet delivered by the + consumer thread. This return value is the only mechanism that the + target can use to manage the queue when it is running on the + consumer thread. +*/ + +class IOBasicOutputQueue : public IOOutputQueue +{ + OSDeclareDefaultStructors( IOBasicOutputQueue ) + +private: + static IOReturn dispatchNetworkDataNotification(void * target, + void * param, + IONetworkData * data, + UInt32 type); + + void dequeue(); + +protected: + OSObject * _target; + IOOutputAction _action; + IOOutputQueueStats * _stats; + IONetworkData * _statsData; + IOSimpleLock * _spinlock; + IOMbufQueue * _inQueue; + IOMbufQueue * _queues[2]; + volatile bool _waitDequeueDone; + volatile UInt32 _state; + volatile UInt32 _serviceCount; + +/*! @function serviceThread + @abstract Provides an implementation for the serviceThread() method + defined in IOOutputQueue. + @discussion This method is called by the scheduled service thread when it + starts to run. The service thread is scheduled by service() + to restart a stalled queue when the kServiceAsync option is given. + @param param A parameter that was given to scheduleServiceThread(). + This parameter is not used. +*/ + + virtual void serviceThread(void * param); + +/*! @function output + @abstract Transfers all packets in the mbuf queue to the target. + @param queue A queue of output packets. + @param state Returns a state bit defined by IOBasicOutputQueue that + declares the new state of the queue following this method call. + A kStateStalled is returned if the queue should stall, otherwise 0 + is returned. +*/ + + virtual void output(IOMbufQueue * queue, UInt32 * state); + +/*! @function free + @abstract Frees the IOBasicOutputQueue object. + @discussion This function releases allocated resources, then call super::free(). +*/ + + virtual void free(); + +/*! @function handleNetworkDataAccess + @abstract Handles an external access to the IONetworkData object + returned by getStatisticsData(). + @param data The IONetworkData object being accessed. + @param type Description of the type of access being performed. + @param param An optional parameter for the handler. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn handleNetworkDataAccess(IONetworkData * data, + UInt32 type, + void * param); + +public: + +/*! @function init + @abstract Initializes an IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue, which is usually a subclass of IONetworkController. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(OSObject * target, + IOOutputAction action, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param capacity The initial capacity of the output queue. + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. +*/ + + static IOBasicOutputQueue * withTarget(IONetworkController * target, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. +*/ + + static IOBasicOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + UInt32 capacity = 0); + +/*! @function enqueue + @abstract Adds a packet, or a chain of packets, + to the queue. + @discussion This method is called by a client to add a packet, or a chain of packets, + to the queue. A packet is described by an mbuf chain, while a chain + of packets is constructed by linking multiple mbuf chains via the + m_nextpkt field. This method can be called by multiple client + threads. + @param m A single packet, or a chain of packets. + @param param A parameter provided by the caller. + @result Always returns 0. +*/ + + virtual UInt32 enqueue(mbuf_t m, void * param); + +/*! @function start + @abstract Starts up the packet flow between the queue and its target. + @discussion Called by the target to start the queue. This will allow + packets to be removed from the queue, and then delivered to the target. + @result Returns true if the queue was started successfully, false otherwise. */ + + virtual bool start(); + +/*! @function stop + @abstract Stops the packet flow between the queue and its target. + @discussion This method stops the queue and prevents it from sending packets to its + target. This call is synchronous and it may block. After this method + returns, the queue will no longer call the registered target/action, + even as new packets are added to the queue. The queue will continue to + absorb new packets until the size of the queue reaches its capacity. + The registered action must never call stop(), or a deadlock will occur. + @result Returns the previous running state of the queue, + true if the queue was running, false if the queue was already stopped. +*/ + + virtual bool stop(); + +/*! @enum ServiceAsync + @abstract The option bits recognized by service(). + @constant kServiceAsync Set this option to service the queue in + an asynchronous manner. The service() call will not block, but a + scheduling latency will be introduced before the queue is serviced. +*/ + + enum { + kServiceAsync = 0x1 + }; + +/*! @function service + @abstract Services a queue that was stalled by the target. + @discussion A target that stalls the queue must call service() when + it becomes ready to accept more packets. Calling this method when the + queue is not stalled is harmless. + @result Returns true if the queue was stalled and there were packets sitting in + the queue awaiting delivery, false otherwise. +*/ + + virtual bool service(IOOptionBits options = 0); + +/*! @function flush + @abstract Drops and frees all packets currently held by the queue. + @discussion To ensure that all packets are removed from the queue, + stop() should be called prior to flush(), to make sure there are + no packets in-flight and being delivered to the target. + @result Returns the number of packets that were dropped and freed. +*/ + + virtual UInt32 flush(); + +/*! @function setCapacity + @abstract Changes the number of packets that the queue can hold + before it begins to drop excess packets. + @param capacity The new desired capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity); + +/*! @function getCapacity + @abstract Gets the number of packets that the queue can hold. + @discussion The queue will begin to drop incoming packets when the + size of the queue reaches its capacity. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const; + +/*! @function getSize + @abstract Gets the number of packets currently held in the queue. + @result Returns the size of the queue. +*/ + + virtual UInt32 getSize() const; + +/*! @function getDropCount + @abstract Gets the number of packets dropped by the queue. + @result Returns the number of packets dropped due to over-capacity, or by + external calls to the flush() method. +*/ + + virtual UInt32 getDropCount(); + +/*! @function getOutputCount + @abstract Gets the number of packets accepted by the target. + @result Returns the number of times that kIOOutputStatusAccepted is returned by + the target. +*/ + + virtual UInt32 getOutputCount(); + +/*! @function getRetryCount + @abstract Gets the number of instances when the target has refused to + accept the packet provided. + @result Returns the number of times that kIOOutputStatusRetry is returned by the + target. +*/ + + virtual UInt32 getRetryCount(); + +/*! @function getStallCount + @abstract Gets the number of instances when the target has stalled the + queue. + @result Returns the number of times that kIOOutputCommandStall is returned by the + target. +*/ + + virtual UInt32 getStallCount(); + +/*! @enum GetStateBits + @abstract The bits in the value returned by getState(). + @constant kStateRunning Set when the queue is running. Calling start() + and stop() will set or clear this bit. + @constant kStateStalled Set when the queue is stalled by the target. + @constant kStateActive Set when a consumer thread is actively removing + packets from the queue and passing them to the target. +*/ + + enum { + kStateRunning = 0x1, + kStateOutputStalled = 0x2, + kStateOutputActive = 0x4, + kStateOutputServiceMask = 0xff00 + }; + +/*! @function getState + @abstract Gets the state of the queue object. + @result Returns the current state of the queue object. +*/ + + virtual UInt32 getState() const; + +/*! @function getStatisticsData + @abstract Returns an IONetworkData object containing statistics counters + updated by the queue. + @result Returns an IONetworkData object. +*/ + + virtual IONetworkData * getStatisticsData() const; +}; + +#endif /* !_IOBASICOUTPUTQUEUE_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOEthernetController.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOEthernetController.h.svn-base new file mode 100644 index 0000000..c2f85e7 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOEthernetController.h.svn-base @@ -0,0 +1,502 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOETHERNETCONTROLLER_H +#define _IOETHERNETCONTROLLER_H + +#include + +/*! @defined kIOEthernetControllerClass + @abstract kIOEthernetControllerClass is the name of the + IOEthernetController class. */ + +#define kIOEthernetControllerClass "IOEthernetController" + +/*! @defined kIOEthernetAddressSize + @abstract The number of bytes in an Ethernet hardware address. */ + +#define kIOEthernetAddressSize 6 + +/*! @defined kIOEthernetMaxPacketSize + @abstract The maximum size of an Ethernet packet, including + the FCS bytes. */ + +#define kIOEthernetMaxPacketSize 1518 + +/*! @defined kIOEthernetMinPacketSize + @abstract The minimum size of an Ethernet packet, including + the FCS bytes. */ + +#define kIOEthernetMinPacketSize 64 + +/*! @defined kIOEthernetCRCSize + @abstract The size in bytes of the 32-bit CRC value appended + to the end of each Ethernet frame. */ + +#define kIOEthernetCRCSize 4 + +/*! @defined kIOEthernetWakeOnLANFilterGroup + @abstract kIOEthernetWakeOnLANFilterGroup describes the name assigned + to the Ethernet Wake-On-LAN filter group. This group represents + wake filters that are supported by the controller. */ + +#define kIOEthernetWakeOnLANFilterGroup "IOEthernetWakeOnLANFilterGroup" + +/*! @defined kIOEthernetDisabledWakeOnLANFilterGroup + @abstract kIOEthernetDisabledWakeOnLANFilterGroup describes the name + assigned to the disabled Ethernet Wake-On-LAN filter group. This + group represents wake filters that are currently disabled. + Membership in this group is dynamic. */ + +#define kIOEthernetDisabledWakeOnLANFilterGroup \ + "IOEthernetDisabledWakeOnLANFilterGroup" + +/*! @enum WakeOnLANFilters. + @abstract All filters in the Wake-on-LAN filter group. + @discussion Each filter listed will respond to a network event that + will trigger a system wake-up. + @constant kIOEthernetWakeOnMagicPacket Reception of a Magic Packet. + @constant kIOEthernetWakeOnPacketAddressMatch Reception of a packet + which passes through any of the address filtering mechanisms based + on its destination Ethernet address. This may include unicast, + broadcast, or multicast addresses depending on the current state + and setting of the corresponding packet filters. */ + +enum { + kIOEthernetWakeOnMagicPacket = 0x00000001, + kIOEthernetWakeOnPacketAddressMatch = 0x00000002 +}; + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +struct IOEthernetAddress { + UInt8 bytes[kIOEthernetAddressSize]; +}; + +/*! @const gIOEthernetWakeOnLANFilterGroup + @discussion gIOEthernetWakeOnLANFilterGroup is an OSSymbol object + that contains the name of the Ethernet Wake-on-LAN filter group + defined by kIOEthernetWakeOnLANFilterGroup. */ + +extern const OSSymbol * gIOEthernetWakeOnLANFilterGroup; + +/*! @const gIOEthernetDisabledWakeOnLANFilterGroup + @discussion gIOEthernetDisabledWakeOnLANFilterGroup is an OSSymbol object + that contains the name of the disabled Ethernet Wake-on-LAN filter group + defined by kIOEthernetDisabledWakeOnLANFilterGroup. */ + +extern const OSSymbol * gIOEthernetDisabledWakeOnLANFilterGroup; + +/*! @class IOEthernetController + @abstract Abstract superclass for Ethernet controllers. + @discussion Ethernet controller drivers should subclass IOEthernetController, and implement + or override the hardware specific methods to create an Ethernet driver. + An interface object (an IOEthernetInterface instance) must be + instantiated by the driver, through attachInterface(), to connect + the controller driver to the data link layer. +*/ + +class IOEthernetController : public IONetworkController +{ + OSDeclareAbstractStructors( IOEthernetController ) + +protected: + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +public: + +/*! @function initialize + @abstract IOEthernetController class initializer. + @discussion Creates global OSSymbol objects that are used as keys. */ + + static void initialize(); + +/*! @function init + @abstract Initializes an IOEthernetController object. + @param properties A dictionary object containing a property table + associated with this instance. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(OSDictionary * properties); + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the Ethernet + controller in the given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. When the filter group specified is + gIONetworkFilterGroup, then this method will return a value formed by + a bitwise OR of kIOPacketFilterUnicast, kIOPacketFilterBroadcast, + kIOPacketFilterMulticast, kIOPacketFilterPromiscuous. Otherwise, the + return value will be set to zero (0). Subclasses must override this + method if their filtering capability differs from what is reported by + this default implementation. This method is called from the workloop + context, and the result is published to the I/O Kit Registry. + @param group The name of the filter group. + @param filters Pointer to the mask of supported filters returned by + this method. + @result Returns kIOReturnSuccess. Drivers that override this + method must return kIOReturnSuccess to indicate success, or an error + return code otherwise. +*/ + + virtual IOReturn getPacketFilters(const OSSymbol * group, + UInt32 * filters) const; + +/*! @function enablePacketFilter + @abstract Enables one of the supported packet filters from the + given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call setMulticastMode() or + setPromiscuousMode() when the multicast or the promiscuous filter is to be + enabled. Requests to disable the Unicast or Broadcast filters are handled + silently, without informing the subclass. Subclasses can override this + method to change this default behavior, or to extend it to handle + additional filter types or filter groups. This method call is synchronized + by the workloop's gate. + @param group The name of the filter group containing the filter to be + enabled. + @param aFilter The filter to enable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the enable request. + @result Returns the value returned by setMulticastMode() or setPromiscuousMode() if + either of those two methods are called. Returns kIOReturnSuccess if the filter + specified is kIOPacketFilterUnicast or kIOPacketFilterBroadcast. + Returns kIOReturnUnsupported if the filter group specified is not + gIONetworkFilterGroup. +*/ + + virtual IOReturn enablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0); + +/*! @function disablePacketFilter + @abstract Disables a packet filter that is currently enabled from the + given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call setMulticastMode() or + setPromiscuousMode() when the multicast or the promiscuous filter is to be + disabled. Requests to disable the Unicast or Broadcast filters are handled + silently, without informing the subclass. Subclasses can override this + method to change this default behavior, or to extend it to handle + additional filter types or filter groups. This method call is synchronized + by the workloop's gate. + @param group The name of the filter group containing the filter to be + disabled. + @param aFilter The filter to disable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the disable request. + @result Returns the value returned by setMulticastMode() or setPromiscuousMode() if + either of those two methods are called. Returns kIOReturnSuccess if the filter + specified is kIOPacketFilterUnicast or kIOPacketFilterBroadcast. + Returns kIOReturnUnsupported if the filter group specified is not + gIONetworkFilterGroup. +*/ + + virtual IOReturn disablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0); + +/*! @function getHardwareAddress + @abstract Gets the Ethernet controller's station address. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call the overloaded form + IOEthernetController::getHardwareAddress() that subclasses are expected + to override. + @param addr The buffer where the controller's hardware address should + be written. + @param inOutAddrBytes The size of the address buffer provided by the + client, and replaced by this method with the actual size of + the hardware address in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn getHardwareAddress(void * addr, + UInt32 * inOutAddrBytes); + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the Ethernet + controller. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call the overloaded form + IOEthernetController::setHardwareAddress() that subclasses are expected + to override. + @param addr The buffer containing the hardware address provided by + the client. + @param addrBytes The size of the address buffer provided by the + client in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn setHardwareAddress(const void * addr, + UInt32 addrBytes); + +/*! @function getMaxPacketSize + @abstract Gets the maximum packet size supported by the Ethernet + controller, including the frame header and FCS. + @param maxSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMaxPacketSize(UInt32 * maxSize) const; + +/*! @function getMinPacketSize + @abstract Gets the minimum packet size supported by the Ethernet + controller, including the frame header and FCS. + @param minSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMinPacketSize(UInt32 * minSize) const; + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the Ethernet + controller in the network filter group. + @param filters Pointer to the return value containing a mask of + supported filters. + @result Returns kIOReturnSuccess. Drivers that override this + method must return kIOReturnSuccess to indicate success, or an error + return code otherwise. +*/ + + virtual IOReturn getPacketFilters(UInt32 * filters) const; + +/*! @function getHardwareAddress + @abstract Gets the Ethernet controller's permanent station address. + @discussion Ethernet drivers must implement this method, by reading the + address from hardware and writing it to the buffer provided. This method + is called from the workloop context. + @param addrP Pointer to an IOEthernetAddress where the hardware address + should be returned. + @result Returns kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn getHardwareAddress(IOEthernetAddress * addrP) = 0; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the Ethernet + controller. + @discussion This method is called in response to a client command to + change the station address used by the Ethernet controller. Implementation + of this method is optional. This method is called from the workloop context. + @param addrP Pointer to an IOEthernetAddress containing the new station + address. + @result The default implementation will always return kIOReturnUnsupported. + If overridden, drivers must return kIOReturnSuccess on success, or an error + return code otherwise. +*/ + + virtual IOReturn setHardwareAddress(const IOEthernetAddress * addrP); + +/*! @function setMulticastMode + @abstract Enables or disables multicast mode. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the multicast filter + identified by kIOPacketFilterMulticast. This method is called from the + workloop context. + @param active True to enable multicast mode, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setMulticastMode(bool active); + +/*! @function setMulticastList + @abstract Sets the list of multicast addresses a multicast filter + should use to match against the destination address of an incoming frame. + @discussion This method sets the list of multicast addresses that the multicast filter + should use to match against the destination address of an incoming frame. + The frame should be accepted when a match occurs. Called when the multicast group membership of an interface + object is changed. Drivers that support kIOPacketFilterMulticast should + override this method and update the hardware multicast filter using the + list of Ethernet addresses provided. Perfect multicast filtering is + preferred if supported by the hardware, in order to reduce the number of + unwanted packets received. If the number of multicast addresses in the + list exceeds what the hardware is capable of supporting, or if perfect + filtering is not supported, then ideally the hardware should be programmed + to perform imperfect filtering, through some form of hash filtering + mechanism. Only as a last resort should the driver enable reception of + all multicast packets to satisfy this request. This method is called + from the workloop context, and only if the driver reports + kIOPacketFilterMulticast support in getPacketFilters(). + @param addrs An array of Ethernet addresses. This argument must be + ignored if the count argument is 0. + @param count The number of Ethernet addresses in the list. This value + will be zero when the list becomes empty. + @result Returns kIOReturnUnsupported. Drivers must return kIOReturnSuccess to + indicate success, or an error return code otherwise. +*/ + + virtual IOReturn setMulticastList(IOEthernetAddress * addrs, + UInt32 count); + +/*! @function setPromiscuousMode + @abstract Enables or disables promiscuous mode. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the promiscuous + filter identified by kIOPacketFilterPromiscuous. This method is + called from the workloop context. + @param active True to enable promiscuous mode, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setPromiscuousMode(bool active); + +/*! @function setWakeOnMagicPacket + @abstract Enables or disables the wake on Magic Packet support. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the Wake-on-LAN + filter identified by kIOEthernetWakeOnMagicPacket. This method is + called from the workloop context. + @param active True to enable support for system wake on reception + of a Magic Packet, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setWakeOnMagicPacket(bool active); + +protected: + +/*! @function createInterface + @abstract Creates an IOEthernetInterface object. + @discussion This method allocates and returns a new IOEthernetInterface instance. + A subclass of IONetworkController must implement this method and return + a matching interface object. The implementation in IOEthernetController + will return an IOEthernetInterface object. Subclasses of + IOEthernetController, such as Ethernet controller drivers, will have + little reason to override this implementation. + @result Returns a newly allocated and initialized IOEthernetInterface object. +*/ + + virtual IONetworkInterface * createInterface(); + +/*! @function free + @abstract Frees the IOEthernetController instance. + @discussion This method releases resources, and is + then followed by a call to super::free(). */ + + virtual void free(); + +/*! @function publishProperties + @abstract Publishes Ethernet controller properties and capabilities. + @discussion This method publishes Ethernet controller properties to the property + table. For instance, getHardwareAddress() is called to fetch the + hardware address, and the address is then published to the property + table. This method call is synchronized by the workloop's gate, + and must never be called directly by subclasses. + @result Returns true if all properties and capabilities were discovered, + and published successfully, false otherwise. Returning false will + prevent client objects from attaching to the Ethernet controller + since a property that a client relies upon may be missing. +*/ + + virtual bool publishProperties(); + + /*! @function getVlanTagDemand + @abstract Fetch the demand for hardware vlan tag stuffing + for the given packet before it is transmitted on the network. + @discussion A network controller that can insert 802.1Q vlan tags for output + packets must call this method to obtain vlan tag information that it must + insert into the given output packet. + @param packet A mbuf containing a packet that may require vlan tag stuffing. + @param vlanTag After calling, the low order 16 bits contain the 802.1Q priority and + vlan ID tag in host order. The hi-order 16 bits are currently unused and should be ignored. + @result true if vlanTag has been set and should be used. + false if no vlan tag stuffing is required for this packet. */ + + OSMetaClassDeclareReservedUsed( IOEthernetController, 0); + virtual bool getVlanTagDemand(mbuf_t m, UInt32 *vlanTag); + + /*! @function setVlanTag + @abstract Encode a received packet with the vlan tag result reported + by the hardware. + @discussion A network controller that can strip 802.1Q vlan tag information for a + received packet should call this method to encode the result on the + packet, before passing it up towards the protocol stacks. + @param packet A mbuf containing a packet that has had its 802.1q vlan tag stripped by + the hardware. + @param vlanTag A value in host order that contains the 802.1q vlan tag and priority + in the low order 16 bits. The hi order word is currently unused and should be set to 0. */ + + OSMetaClassDeclareReservedUsed( IOEthernetController, 1); + virtual void setVlanTag(mbuf_t m, UInt32 vlanTag); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOEthernetController, 2); + OSMetaClassDeclareReservedUnused( IOEthernetController, 3); + OSMetaClassDeclareReservedUnused( IOEthernetController, 4); + OSMetaClassDeclareReservedUnused( IOEthernetController, 5); + OSMetaClassDeclareReservedUnused( IOEthernetController, 6); + OSMetaClassDeclareReservedUnused( IOEthernetController, 7); + OSMetaClassDeclareReservedUnused( IOEthernetController, 8); + OSMetaClassDeclareReservedUnused( IOEthernetController, 9); + OSMetaClassDeclareReservedUnused( IOEthernetController, 10); + OSMetaClassDeclareReservedUnused( IOEthernetController, 11); + OSMetaClassDeclareReservedUnused( IOEthernetController, 12); + OSMetaClassDeclareReservedUnused( IOEthernetController, 13); + OSMetaClassDeclareReservedUnused( IOEthernetController, 14); + OSMetaClassDeclareReservedUnused( IOEthernetController, 15); + OSMetaClassDeclareReservedUnused( IOEthernetController, 16); + OSMetaClassDeclareReservedUnused( IOEthernetController, 17); + OSMetaClassDeclareReservedUnused( IOEthernetController, 18); + OSMetaClassDeclareReservedUnused( IOEthernetController, 19); + OSMetaClassDeclareReservedUnused( IOEthernetController, 20); + OSMetaClassDeclareReservedUnused( IOEthernetController, 21); + OSMetaClassDeclareReservedUnused( IOEthernetController, 22); + OSMetaClassDeclareReservedUnused( IOEthernetController, 23); + OSMetaClassDeclareReservedUnused( IOEthernetController, 24); + OSMetaClassDeclareReservedUnused( IOEthernetController, 25); + OSMetaClassDeclareReservedUnused( IOEthernetController, 26); + OSMetaClassDeclareReservedUnused( IOEthernetController, 27); + OSMetaClassDeclareReservedUnused( IOEthernetController, 28); + OSMetaClassDeclareReservedUnused( IOEthernetController, 29); + OSMetaClassDeclareReservedUnused( IOEthernetController, 30); + OSMetaClassDeclareReservedUnused( IOEthernetController, 31); +}; + +/* + * FIXME: remove this. + */ +enum { + kIOEnetPromiscuousModeOff = false, + kIOEnetPromiscuousModeOn = true, + kIOEnetPromiscuousModeAll = true, + kIOEnetMulticastModeOff = false, + kIOEnetMulticastModeFilter = true +}; +typedef bool IOEnetPromiscuousMode; +typedef bool IOEnetMulticastMode; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IOETHERNETCONTROLLER_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOEthernetInterface.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOEthernetInterface.h.svn-base new file mode 100644 index 0000000..96c7d95 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOEthernetInterface.h.svn-base @@ -0,0 +1,328 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOETHERNETINTERFACE_H +#define _IOETHERNETINTERFACE_H + +/*! @defined kIOEthernetInterfaceClass + @abstract The name of the + IOEthernetInterface class. +*/ + +#define kIOEthernetInterfaceClass "IOEthernetInterface" + +/*! @defined kIOActivePacketFilters + @abstract A property of IOEthernetInterface objects. + @discussion The kIOActivePacketFilters property has an OSDictionary value that describes the current + set of packet filters that have been successfully activated. Each + entry in the dictionary is a key/value pair consisting of the filter + group name, and an OSNumber describing the set of active filters for + that group. Entries in this dictionary will mirror those in + kIORequiredPacketFilters if the controller has reported success for + all filter change requests from the IOEthernetInterface object. +*/ + +#define kIOActivePacketFilters "IOActivePacketFilters" + +/*! @defined kIORequiredPacketFilters + @abstract A property of IOEthernetInterface objects. + @discussion The kIORequiredPacketFilters property has an OSDictionary value that describes the current + set of required packet filters. Each entry in the dictionary is a + key/value pair consisting of the filter group name, and an OSNumber + describing the set of required filters for that group. +*/ + +#define kIORequiredPacketFilters "IORequiredPacketFilters" + +/*! @defined kIOMulticastAddressList + @abstract A property of IOEthernetInterface objects. + @discussion The kIOMulticastAddressList property is an OSData object that describes the + list of multicast addresses that are being used by the + controller to match against the destination address of an + incoming frame. +*/ + +#define kIOMulticastAddressList "IOMulticastAddressList" +#define kIOMulticastFilterData kIOMulticastAddressList + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include + +/*! @class IOEthernetInterface + @abstract The Ethernet interface object. + @discussion An Ethernet controller driver, + that is a subclass of IOEthernetController, will instantiate an object + of this class when the driver calls the attachInterface() method. + This interface object will then vend an Ethernet interface to DLIL, + and manage the connection between the controller driver and the upper + networking layers. Drivers will seldom need to subclass + IOEthernetInterface. +*/ + +class IOEthernetInterface : public IONetworkInterface +{ + OSDeclareDefaultStructors( IOEthernetInterface ) + +private: + thread_call_t _inputEventThreadCall; // inputEvent() thread call + UInt32 _mcAddrCount; // # of multicast addresses + bool _ctrEnabled; // Is controller enabled? + OSDictionary * _supportedFilters; // Controller's supported filters + OSDictionary * _requiredFilters; // The required filters + OSDictionary * _activeFilters; // Currently active filters + bool _controllerLostPower; // true if controller is unusable + + struct ExpansionData { + UInt32 altMTU; // track the physical mtu of controller + UInt32 publishedFeatureID; // id for published wake packet + uint32_t supportedWakeFilters; // bitmask of supported wake filters + OSNumber * disabledWakeFilters; // OSNumber of disabled wake filters + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + + IOReturn enableController(IONetworkController * ctr); + IOReturn setupMulticastFilter(IONetworkController * ctr); + + UInt32 getFilters(const OSDictionary * dict, + const OSSymbol * group); + + bool setFilters(OSDictionary * dict, + const OSSymbol * group, + UInt32 filters); + + IOReturn disableFilter(IONetworkController * ctr, + const OSSymbol * group, + UInt32 filter, + IOOptionBits options = 0); + + IOReturn enableFilter(IONetworkController * ctr, + const OSSymbol * group, + UInt32 filter, + IOOptionBits options = 0); + + int syncSIOCSIFFLAGS(IONetworkController * ctr); + int syncSIOCSIFADDR(IONetworkController * ctr); + int syncSIOCADDMULTI(IONetworkController * ctr); + int syncSIOCDELMULTI(IONetworkController * ctr); + int syncSIOCSIFMTU(IONetworkController * ctr, struct ifreq * ifr, bool); + int syncSIOCGIFDEVMTU(IONetworkController * ctr, struct ifreq * ifr); + int syncSIOCSIFLLADDR(IONetworkController * ctr, const char * lladdr, int len); + void _fixupVlanPacket(mbuf_t, u_int16_t, int); + void reportInterfaceWakeFlags(void); + + static void handleEthernetInputEvent(thread_call_param_t param0, thread_call_param_t param1); + static int performGatedCommand(void *, void *, void *, void *, void *); + static IOReturn enableFilter_Wrapper( + IOEthernetInterface *, IONetworkController *, const OSSymbol *, UInt32 , IOOptionBits); + +public: + +/*! @function init + @abstract Initializes an IOEthernetInterface instance. + @discussion Instance variables are initialized, and an arpcom + structure is allocated. + @param controller A network controller object that will service + the interface object being initialized. + @result Returns true on success, false otherwise. +*/ + + virtual bool init( IONetworkController * controller ); + +/*! @function getNamePrefix + @abstract Returns a string containing the prefix to use when + creating a BSD name for this interface. + @discussion The BSD name for each interface object is created by + concatenating a string returned by this method, with an unique + unit number assigned by IONetworkStack. + @result Returns a pointer to a constant C string "en". Therefore, Ethernet + interfaces will be registered with BSD as en0, en1, etc. +*/ + + virtual const char * getNamePrefix() const; + +/*! @function setProperties + @abstract Handles a request to set Ethernet interface properties from + kernel or non-kernel clients. + @discussion For non-kernel clients, the preferred + access mechanism is through a user client connection. + @param properties An OSDictionary containing a collection of + properties. + @result Returns kIOReturnUnsupported if the interface did not + recognize any of the properties provided. Otherwise, the return + code will be kIOReturnSuccess to indicate no errors, or an + IOReturn error code to indicate that an error occurred while + handling one of the properties. +*/ + + virtual IOReturn setProperties( OSObject * properties ); + +protected: + +/*! @function free + @abstract Frees the IOEthernetInterface instance. + @discussion The memory allocated for the arpcom structure is released, + followed by a call to super::free(). +*/ + + virtual void free(); + +/*! @function performCommand + @abstract Handles an ioctl command sent to the Ethernet interface. + @discussion This method handles socket ioctl commands sent to the Ethernet + interface from DLIL. Commands recognized and processed by this method are + SIOCSIFADDR, SIOCSIFFLAGS, SIOCADDMULTI, and SIOCDELMULTI. Other commands + are passed to the superclass. + @param controller The controller object. + @param cmd The ioctl command code. + @param arg0 Command argument 0. Generally a pointer to an ifnet structure + associated with the interface. + @param arg1 Command argument 1. + @result Returns a BSD return value defined in bsd/sys/errno.h. +*/ + + virtual SInt32 performCommand(IONetworkController * controller, + unsigned long cmd, + void * arg0, + void * arg1); + +/*! @function controllerDidOpen + @abstract A notification that the interface has opened the network + controller. + @discussion This method will be called by IONetworkInterface after a + network controller has accepted an open from this interface object. + IOEthernetInterface will first call the implementation in its + superclass, then inspect the controller through properties published + in the registry. This method is called with the arbitration lock held. + @param controller The controller object that was opened. + @result Returns true on success, false otherwise. Returning false will + cause the controller to be closed, and any pending client opens to be + rejected. +*/ + + virtual bool controllerDidOpen(IONetworkController * controller); + +/*! @function controllerWillClose + @abstract A notification that the interface will close the network + controller. + @discussion This method will simply call super to propagate the method + call. This method is called with the arbitration lock held. + @param controller The controller that is about to be closed. +*/ + + virtual void controllerWillClose(IONetworkController * controller); + + +/*! @function controllerWillChangePowerState + @abstract Handles a notification that the network controller + servicing this interface object is about to transition to a new power state. + @discussion If the controller is about to transition to an unusable state, + and it is currently enabled, then the disable() method on the controller is + called. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Always returns kIOReturnSuccess. +*/ + + virtual IOReturn controllerWillChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +/*! @function controllerDidChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @discussion If the controller did transition to a usable state, and it was + previously disabled due to a previous power change, then it is re-enabled. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Always returns kIOReturnSuccess. +*/ + + virtual IOReturn controllerDidChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +public: + /* Override IONetworkInterface::willTerminate() */ + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ); + + /* Override IONetworkInterface::attachToDataLinkLayer() */ + + virtual IOReturn attachToDataLinkLayer( IOOptionBits options, + void * parameter ); + + /* Override IONetworkInterface::inputEvent() */ + + virtual bool inputEvent( UInt32 type, void * data ); + +protected: + virtual void feedPacketInputTap(mbuf_t); + virtual void feedPacketOutputTap(mbuf_t); + virtual bool initIfnetParams(struct ifnet_init_params *params); + +public: + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 0); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 1); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 2); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 3); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 4); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 5); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 6); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 7); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 8); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 9); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 10); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 11); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 12); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 13); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 14); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 15); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IOETHERNETINTERFACE_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOEthernetStats.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOEthernetStats.h.svn-base new file mode 100644 index 0000000..6125c2d --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOEthernetStats.h.svn-base @@ -0,0 +1,161 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOEthernetStats.h - Ethernet MIB statistics definitions. + * + * HISTORY + */ + +#ifndef _IOETHERNETSTATS_H +#define _IOETHERNETSTATS_H + +/*! @header IOEthernetStats.h + @discussion Ethernet statistics. */ + +//--------------------------------------------------------------------------- +// Ethernet-like statistics group. + +/*! @typedef IODot3StatsEntry + @discussion Ethernet MIB statistics structure. + @field alignmentErrors dot3StatsAlignmentErrors. + @field fcsErrors dot3StatsFCSErrors. + @field singleCollisionFrames dot3StatsSingleCollisionFrames. + @field multipleCollisionFrames dot3StatsMultipleCollisionFrames. + @field sqeTestErrors dot3StatsSQETestErrors. + @field deferredTransmissions dot3StatsDeferredTransmissions. + @field lateCollisions dot3StatsLateCollisions. + @field excessiveCollisions dot3StatsExcessiveCollisions. + @field internalMacTransmitErrors dot3StatsInternalMacTransmitErrors. + @field carrierSenseErrors dot3StatsCarrierSenseErrors. + @field frameTooLongs dot3StatsFrameTooLongs. + @field internalMacReceiveErrors dot3StatsInternalMacReceiveErrors. + @field etherChipSet dot3StatsEtherChipSet. + @field missedFrames dot3StatsMissedFrames (not in RFC1650). + */ + +typedef struct { + UInt32 alignmentErrors; + UInt32 fcsErrors; + UInt32 singleCollisionFrames; + UInt32 multipleCollisionFrames; + UInt32 sqeTestErrors; + UInt32 deferredTransmissions; + UInt32 lateCollisions; + UInt32 excessiveCollisions; + UInt32 internalMacTransmitErrors; + UInt32 carrierSenseErrors; + UInt32 frameTooLongs; + UInt32 internalMacReceiveErrors; + UInt32 etherChipSet; + UInt32 missedFrames; +} IODot3StatsEntry; + +//--------------------------------------------------------------------------- +// Ethernet-like collision statistics group (optional). + +/*! @typedef IODot3CollEntry + @discussion Collision statistics structure. + @field collFrequencies dot3StatsCollFrequencies. */ + +typedef struct { + UInt32 collFrequencies[16]; +} IODot3CollEntry; + +//--------------------------------------------------------------------------- +// Receiver extra statistics group (not defined by RFC 1650). + +/*! @typedef IODot3RxExtraEntry + @discussion Extra receiver statistics not defined by RFC1650. + @field overruns receiver overruns. + @field watchdogTimeouts watchdog timer expirations. + @field frameTooShorts runt frames. + @field collisionErrors frames damages by late collision. + @field phyErrors PHY receive errors. + @field timeouts receiver timeouts. + @field interrupts receiver interrupts. + @field resets receiver resets. + @field resourceErrors receiver resource shortages. + */ + +typedef struct { + UInt32 overruns; + UInt32 watchdogTimeouts; + UInt32 frameTooShorts; + UInt32 collisionErrors; + UInt32 phyErrors; + UInt32 timeouts; + UInt32 interrupts; + UInt32 resets; + UInt32 resourceErrors; + UInt32 reserved[4]; +} IODot3RxExtraEntry; + +//--------------------------------------------------------------------------- +// Transmitter extra statistics group (not defined by RFC 1650). + +/*! @typedef IODot3TxExtraEntry + @discussion Extra transmitter statistics not defined by RFC1650. + @field underruns transmit underruns. + @field jabbers jabber events. + @field phyErrors PHY transmit errors. + @field timeouts transmitter timeouts. + @field interrupts transmitter interrupts. + @field resets transmitter resets. + @field resourceErrors transmitter resource shortages. + */ + +typedef struct { + UInt32 underruns; + UInt32 jabbers; + UInt32 phyErrors; + UInt32 timeouts; + UInt32 interrupts; + UInt32 resets; + UInt32 resourceErrors; + UInt32 reserved[4]; +} IODot3TxExtraEntry; + +//--------------------------------------------------------------------------- +// Aggregate Ethernet statistics. + +/*! @typedef IOEthernetStats + @discussion Aggregate Ethernet statistics structure. + @field dot3StatsEntry IODot3StatsEntry statistics group. + @field dot3CollEntry IODot3CollEntry statistics group. + @field dot3RxExtraEntry IODot3RxExtraEntry statistics group. + @field dot3TxExtraEntry IODot3TxExtraEntry statistics group. + */ + +typedef struct { + IODot3StatsEntry dot3StatsEntry; + IODot3CollEntry dot3CollEntry; + IODot3RxExtraEntry dot3RxExtraEntry; + IODot3TxExtraEntry dot3TxExtraEntry; +} IOEthernetStats; + +/*! @defined kIOEthernetStatsKey + @discussion Defines the name of an IONetworkData that contains + an IOEthernetStats. */ + +#define kIOEthernetStatsKey "IOEthernetStatsKey" + +#endif /* !_IOETHERNETSTATS_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOGatedOutputQueue.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOGatedOutputQueue.h.svn-base new file mode 100644 index 0000000..48e9f79 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOGatedOutputQueue.h.svn-base @@ -0,0 +1,140 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOGATEDOUTPUTQUEUE_H +#define _IOGATEDOUTPUTQUEUE_H + +#include +#include +#include +#include + +/*! @class IOGatedOutputQueue + @abstract An extension of an IOBasicOutputQueue. + @discussion An IOCommandGate + object is created by this queue and added to a work loop as an + event source. All calls to the target by the consumer thread must + occur with the gate closed. Therefore, all calls to the target of + this type of queue will be serialized with any other thread that + runs on the same work loop context. This is useful for network + drivers that have a tight hardware coupling between the transmit + and receive engines, and a single-threaded hardware access model + is desirable. +*/ + +class IOGatedOutputQueue : public IOBasicOutputQueue +{ + OSDeclareDefaultStructors( IOGatedOutputQueue ) + +private: + static void gatedOutput(OSObject * owner, + IOGatedOutputQueue * self, + IOMbufQueue * queue, + UInt32 * state); + + static void restartDeferredOutput(OSObject * owner, + IOInterruptEventSource * sender, + int count); + +protected: + IOCommandGate * _gate; + IOInterruptEventSource * _interruptSrc; + +/*! @function output + @abstract Transfers all packets in the mbuf queue to the target. + @param queue A queue of output packets. + @param state Return a state bit defined by IOBasicOutputQueue that + declares the new state of the queue following this method call. + A kStateStalled is returned if the queue should stall, otherwise 0 + is returned. +*/ + + virtual void output(IOMbufQueue * queue, UInt32 * state); + +/*! @function free + @abstract Frees the IOGatedOutputQueue object. + @discussion Release allocated resources, then call super::free(). */ + + virtual void free(); + +/*! @function output + @abstract Overrides the method inherited from IOOutputQueue. + @result Returns true if a thread was successfully scheduled to service + the queue. +*/ + + virtual bool scheduleServiceThread(void * param); + +public: + +/*! @function init + @abstract Initializes an IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue, and is usually a subclass of IONetworkController. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. +*/ + + static IOGatedOutputQueue * withTarget(IONetworkController * target, + IOWorkLoop * workloop, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. +*/ + + static IOGatedOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity = 0); +}; + +#endif /* !_IOGATEDOUTPUTQUEUE_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOKernelDebugger.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOKernelDebugger.h.svn-base new file mode 100644 index 0000000..97fc905 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOKernelDebugger.h.svn-base @@ -0,0 +1,324 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKERNELDEBUGGER_H +#define _IOKERNELDEBUGGER_H + +#include + +/*! @typedef IODebuggerRxHandler + @discussion Defines the receive handler that must be implemented + by the target to service KDP receive requests. This handler is called + by kdpReceiveDispatcher(). + @param target The target object. + @param buffer KDP receive buffer. The buffer allocated has room for + 1518 bytes. The receive handler must not overflow this buffer. + @param length The amount of data received and placed into the buffer. + Set to 0 if no frame was received during the poll interval. + @param timeout The amount of time to poll in milliseconds while waiting + for a frame to arrive. */ + +typedef void (*IODebuggerRxHandler)( IOService * target, + void * buffer, + UInt32 * length, + UInt32 timeout ); + +/*! @typedef IODebuggerTxHandler + @discussion Defines the transmit handler that must be implemented + by the target to service KDP transmit requests. This handler is called + by kdpTransmitDispatcher(). + @param target The target object. + @param buffer KDP transmit buffer. This buffer contains a KDP frame + to be sent on the network. + @param length The number of bytes in the transmit buffer. */ + +typedef void (*IODebuggerTxHandler)( IOService * target, + void * buffer, + UInt32 length ); + +/*! @typedef IODebuggerLockState + @discussion Defines flags returned by IOKernelDebugger::lock(). + @constant kIODebuggerLockTaken Set if the debugger lock was taken. */ + +typedef enum { + kIODebuggerLockTaken = 0x1 +} IODebuggerLockState; + +/*! @class IOKernelDebugger + @abstract Kernel debugger nub. + @discussion This object interfaces with the KDP + (kernel debugger protocol) module and dispatches KDP requests to its + target (provider). The target, designated as the debugger device, must + implement a pair of handler functions that are called to handle KDP + transmit and receive requests during a debugging session. Only a single + IOKernelDebugger in the system can be active at a given time. The + active IOKernelDebugger is the one that has an IOKDP object attached + as a client. + + The debugger device is usually a subclass of IOEthernetController. + However, any IOService can service an IOKernelDebugger client, + implement the two polled mode handlers, and transport the KDP + packets through a data channel. However, KDP assumes that the + debugger device is an Ethernet interface and therefore it will + always send, and expect to receive, an Ethernet frame. */ + +class IOKernelDebugger : public IOService +{ + OSDeclareDefaultStructors( IOKernelDebugger ) + +protected: + IOService * _target; // target (provider) + IODebuggerTxHandler _txHandler; // target's transmit handler. + IODebuggerRxHandler _rxHandler; // target's receive handler. + IOService * _client; // client that has opened us. + bool _pmDisabled; // true if disabled by PM. + + struct ExpansionData { + thread_call_t activationChangeThreadCall; + UInt32 stateVars[2]; + IONotifier * interfaceNotifier; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +/*! @function kdpReceiveDispatcher + @abstract The KDP receive dispatch function. + @discussion Field KDP receives requests, then dispatches the call to the + registered receiver handler. + @param buffer KDP receive buffer. The buffer allocated by KDP has room + for 1518 bytes. The receive handler must not overflow this buffer. + @param length The amount of data received and placed into the buffer. + Set to 0 if a frame was not received during the poll interval. + @param timeout The amount of time to poll in milliseconds while waiting + for a frame to arrive. +*/ + + static void kdpReceiveDispatcher(void * buffer, + UInt32 * length, + UInt32 timeout); + +/*! @function kdpTransmitDispatcher + @abstract The KDP transmit dispatch function. + @discussion Field KDP transmit requests, then dispatches the call to the + registered transmit handler. + @param buffer KDP transmit buffer. This buffer contains a KDP frame to + be sent on the network. + @param length The number of bytes in the transmit buffer. +*/ + + static void kdpTransmitDispatcher(void * buffer, UInt32 length); + +/*! @function free + @abstract Frees the IOKernelDebugger instance. */ + + virtual void free(); + +/*! @function nullTxHandler + @abstract Null transmit handler. + @discussion This function is registered as the transmit handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled transmit requests from KDP. This function does nothing + useful. +*/ + + static void nullTxHandler( IOService * target, + void * buffer, + UInt32 length ); + +/*! @function nullRxHandler + @abstract Null receive handler. + @discussion This function is registered as the receive handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled receive requests from KDP. This function does nothing + except to log a warning message. +*/ + + static void nullRxHandler( IOService * target, + void * buffer, + UInt32 * length, + UInt32 timeout ); + +/*! @function registerHandler + @abstract Registers the target and the handler functions. + @discussion This method is called by handleOpen() and handleClose() + to register or unregister the target and its handler functions. + @param target The target object. + @param txHandler The transmit handler function. The null handler is + registered if the argument is zero. + @param rxHandler The receive handler function. The null handler is + registered if the argument is zero. +*/ + + static void registerHandler( IOService * target, + IODebuggerTxHandler txHandler = 0, + IODebuggerRxHandler rxHandler = 0 ); + +/*! @function powerStateWillChangeTo + @abstract Handles notification that the network controller will change + power state. + @discussion If the controller is about to become unusable, then the + controller's handlers are unregistered, and the controller is disabled. + @param flags Describe the capability of the controller in the new power + state. + @param stateNumber The number of the state in the state array that the + controller is switching to. + @param policyMaker The policy maker that manages the controller's + power state. + @result Returns the constant 3000000, to indicate a maximum of 3 seconds for the + preparation to complete, and an acknowledgement delivered to the + policy maker. +*/ + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function powerStateDidChangeTo + @abstract Handles notification that the network controller did change + power state. + @discussion If the controller became usable, then the controller is + re-enabled, and the controller's handlers are re-registered. + @param flags Description of the capability of the controller in the new power + state. + @param stateNumber The number of the state in the state array that the + controller is switching to. + @param policyMaker The policy maker that manages the controller's + power state. + @result Returns the constant 3000000, to indicate a maximum of 3 seconds for the + preparation to complete, and an acknowledgement delivered to the + policy maker. +*/ + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function handleOpen + @abstract Handles a client open. + @discussion This method is called by IOService::open() to handle an + open from a client (IOKDP) with the arbitration lock held. + @param forClient The client (IOKDP) requesting the open. + @param options Options passed to the open() call. Not used. + @param arg A family defined argument passed to the open() call. Not used. + @result Returns true on success, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + +/*! @function handleClose + @abstract Handles a client close. + @discussion This method is called by IOService::close() to handle a + close from a client with the arbitration lock held. + @param forClient The client (IOKDP) requesting the close. + @param options Options passed to the close() call. Not used. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on this object. + @discussion This method is called by IOService::isOpen() with the + arbitration lock held. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + static bool interfacePublished( void *target, void *param, IOService *service ); + +public: + +/*! @function lock + @abstract Takes the debugger lock conditionally. + @discussion This method takes the debugger lock if the object given matches the + target registered by registerHandler(). + @param target The target or provider of an IOKernelDebugger object. + @result Returns kIODebuggerLockTaken if the lock was taken, or 0 otherwise. +*/ + + static IODebuggerLockState lock( IOService * target ); + +/*! @function unlock + @abstract Releases the debugger lock. + @discussion This method releases the debugger lock if the kIODebuggerLockTaken flag is + set in the argument. +*/ + + static void unlock( IODebuggerLockState state ); + +/*! @function init + @abstract Initializes an IOKernelDebugger instance. + @param target The target object that implements the debugger handlers. + @param txHandler The target's transmit handler. A pointer to a 'C' function. + @param rxHandler The target's receive handler. A pointer to a 'C' function. + @result Returns true if the instance initialized successfully, false otherwise. +*/ + + virtual bool init( IOService * target, + IODebuggerTxHandler txHandler, + IODebuggerRxHandler rxHandler ); + +/*! @function debugger + @abstract Factory method that performs allocation and initialization + of an IOKernelDebugger object. + @param target The target object that implements the debugger handlers. + @param txHandler The target's transmit handler. A pointer to a 'C' function. + @param rxHandler The target's receive handler. A pointer to a 'C' function. + @result Returns an IOKernelDebugger instance on success, 0 otherwise. +*/ + + static IOKernelDebugger * debugger( IOService * target, + IODebuggerTxHandler txHandler, + IODebuggerRxHandler rxHandler ); + + /* + * Entry point for generic messages delivered from the provider. + */ + + virtual IOReturn message( UInt32 type, IOService * provider, void * arg ); + +/*! @function signalDebugger + @abstract Signal the kernel to enter the debugger when safe. +*/ + static void signalDebugger(void); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 0); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 1); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 2); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 3); +}; + +// Concise form of the lock()/unlock() static member functions. +// +#define IODebuggerLock IOKernelDebugger::lock +#define IODebuggerUnlock IOKernelDebugger::unlock + +#endif /* !_IOKERNELDEBUGGER_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOMbufMemoryCursor.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOMbufMemoryCursor.h.svn-base new file mode 100644 index 0000000..4e40173 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOMbufMemoryCursor.h.svn-base @@ -0,0 +1,381 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H +#define _IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H + +#include + + +/*! @class IOMbufMemoryCursor + @abstract A mechanism to convert mbuf chains to physical addresses. + @discussion The IOMbufMemoryCursor defines the super class that all + specific mbuf cursors must inherit from, but a mbuf cursor can be created + without a specific formal subclass by just providing a segment function to + the initializers. This class performs the task of walking a given + mbuf chain and creating a physical scatter/gather list appropriate for + the target hardware. When necessary, this class may also coalesce + mbuf chains when the generated scatter/gather list exceeds the specified + hardware limit. However, this should be avoided since it exacts a + performance cost. +

+ A driver is expected to create a mbuf cursor and configure it to match the + limitations of it's DMA hardware; for instance the mbuf cursor used by + an Ethernet controller driver may have a maximum physical segment size + of 1520, and allow for up to 6 physical segments. Thus it would create a + mbuf cursor with a maxSegmentSize of 1520 and a maxNumSegments of 6. + The driver may choose to supply an OutputSegmentFunc function to + format the output of each scatter/gather segment to match the + hardware descriptor format, or it may use a subclass of + IOMbufMemoryCursor to generate IOPhysicalSegment segments with + various byte orders. +

+ A driver may also create more than one mbuf cursor, perhaps one + dedicated for the transmit thread, and the other for the receive thread. + This becomes a requirement when the driver is multi-threaded, since the + mbuf cursor maintains state and does not support reentrancy. */ + +class IOMbufMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufMemoryCursor) + +protected: + UInt32 maxNumSegments; + UInt32 coalesceCount; + UInt32 packetTooBigErrors; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithSpecification(OutputSegmentFunc outSeg, + UInt32 maxSegmentSize, + UInt32 maxTransferSize, + UInt32 align); + +public: +/*! @function initWithSpecification + @abstract Primary initializer for the IOMbufMemoryCursor class. + @param outSeg Function to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns true if the inherited classes and this instance initialized + successfully. +*/ + + virtual bool initWithSpecification(OutputSegmentFunc outSeg, + UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function genPhysicalSegments + @abstract Generates a physical scatter/gather list given a mbuf packet. + @discussion Generates a list of physical segments from the given mbuf. + @param packet The mbuf packet. + @param vector Void pointer to base of output physical scatter/gather list. + Always passed directly onto the OutputSegmentFunc without interpretation + by the cursor. + @param maxSegs Maximum number of segments that can be written to segments + array. + @param doCoalesce Set to true to perform coalescing when the required + number of segments exceeds the specified limit, otherwise abort and + return 0. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + virtual UInt32 genPhysicalSegments(mbuf_t packet, void * vector, + UInt32 maxSegs, bool doCoalesce); + +/*! @function getAndResetCoalesceCount + @abstract Returns a count of the total number of mbuf chains coalesced + by genPhysicalSegments(). + @discussion This method returns a count of the total number of mbuf chains coalesced + by genPhysicalSegments(). The counter is then reset to 0. + @result Returns the coalesce count. +*/ + + UInt32 getAndResetCoalesceCount(); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 0); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 1); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 2); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 3); +}; + + +/*! @class IOMbufNaturalMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the natural byte orientation for the cpu. + @discussion The IOMbufNaturalMemoryCursor would be used when it is too + difficult to implement an OutputSegmentFunc that is more appropriate for + your hardware. This cursor just outputs an array of IOPhysicalSegments. +*/ + +class IOMbufNaturalMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufNaturalMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufNaturalMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufNaturalMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a cpu natural physical scatter/gather list from a given + mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a cpu natural physical scatter/gather list from a given + mbuf. + @discussion Generate a cpu natural physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufBigMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the big endian byte order. + @discussion The IOMbufBigMemoryCursor would be used when the DMA hardware + requires a big endian address and length pair. This cursor outputs an + array of IOPhysicalSegments that are encoded in big-endian format. +*/ + +class IOMbufBigMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufBigMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufBigMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufBigMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a big endian physical scatter/gather list from a given + mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a big endian physical scatter/gather list from a given + mbuf. + @discussion Generate a big endian physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufLittleMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the little endian byte order. + @discussion The IOMbufLittleMemoryCursor would be used when the DMA + hardware requires a little endian address and length pair. This cursor + outputs an array of IOPhysicalSegments that are encoded in little endian + format. +*/ + +class IOMbufLittleMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufLittleMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufLittleMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufLittleMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a little endian physical scatter/gather list from a + given mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a little endian physical scatter/gather list from a + given mbuf. + @discussion Generate a little endian physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +#ifdef __ppc__ + +struct IODBDMADescriptor; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufDBDMAMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IODBDMADescriptors. +*/ + +class IOMbufDBDMAMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufDBDMAMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufDBDMAMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufDBDMAMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a DBDMA descriptor list from a given mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IODBDMADescriptor for the output list. + @param numVectorSegments Maximum number of IODBDMADescriptors accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IODBDMADescriptor *vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a DBDMA descriptor list from a given mbuf. + @discussion Generate a DBDMA descriptor list from a given mbuf. + Coalesce mbuf chain when the number of elements in the list exceeds + numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IODBDMADescriptor for the output list. + @param numVectorSegments Maximum number of IODBDMADescriptors accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IODBDMADescriptor * vector, + UInt32 numVectorSegments = 0); +}; + +#endif /* __ppc__ */ + +#endif /* !_IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H */ + diff --git a/i386/include/IOKit/network/.svn/text-base/IONetworkController.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IONetworkController.h.svn-base new file mode 100644 index 0000000..05b12d3 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IONetworkController.h.svn-base @@ -0,0 +1,1452 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKCONTROLLER_H +#define _IONETWORKCONTROLLER_H + +/*! @defined kIONetworkControllerClass + @abstract The name of the IONetworkController class. */ + +#define kIONetworkControllerClass "IONetworkController" + +/*! @defined kIOVendor + @abstract A property of IONetworkController objects. + @discussion The kIOVendor property is a property of IONetworkController objects. It has an OSString value that describes the vendor of the network controller. */ + +#define kIOVendor "IOVendor" + +/*! @defined kIOModel + @abstract A property of IONetworkController objects. + @discussion The kIOModel property is a property of IONetworkController objects. It has an OSString value that describes the model of the network controller. */ + +#define kIOModel "IOModel" + +/*! @defined kIORevision + @abstract A property of IONetworkController objects. + @discussion The kIORevision property is a property of IONetworkController objects. It has an OSString value that describes the revision level of the network controller. */ + +#define kIORevision "IORevision" + +/*! @defined kIOFeatures + @abstract A property of IONetworkController objects. + @discussion The kIOFeatures property is a property of IONetworkController objects. It has an OSNumber value that describes generic features defined by IONetworkController that are supported by the + network controller. */ + +#define kIOFeatures "IOFeatures" + +/*! @defined kIOMediumDictionary + @abstract A property of IONetworkController objects. + @discussion The kIOMediumDictionary property is a property of IONetworkController + objects. It has an OSDictionary value that is a container for the + collection of IONetworkMedium objects that represent the media + types supported by the network controller. + Each entry in the dictionary is a key/value pair consisting of + the medium name, and a dictionary value that contains the + properties for that medium entry. */ + +#define kIOMediumDictionary "IOMediumDictionary" + +/*! @defined kIODefaultMedium + @abstract A property of IONetworkController objects. + @discussion The kIODefaultMedium property is a property of IONetworkController + objects. It has an OSString value that describes the name of the + default medium. This definition may change or disappear in the + future. */ + +#define kIODefaultMedium "IODefaultMedium" + +/*! @defined kIOSelectedMedium + @abstract A property of IONetworkController objects. + @discussion The kIOSelectedMedium property is a property of IONetworkController + objects. It has an OSSymbol value that describes the name of the + current selected medium. This name can be used as a key into the + medium dictionary to gather additional information about the + selected medium. */ + +#define kIOSelectedMedium "IOSelectedMedium" + +/*! @defined kIOActiveMedium + @abstract A property of IONetworkController objects. + @discussion The kIOActiveMedium property is a property of IONetworkController + objects. It has an OSSymbol value that describes the name of the + active medium. This is the name of the medium where an active + link has been established. This name can be used as a key into + the medium dictionary to gather additional information about the + active medium. */ + +#define kIOActiveMedium "IOActiveMedium" + +/*! @defined kIOLinkSpeed + @abstract A property of IONetworkController objects. + @discussion The kIOLinkSpeed property is a property of IONetworkController + objects. It has an OSNumber value that describes the speed of the + link established over the active medium in bits per second. */ + +#define kIOLinkSpeed "IOLinkSpeed" + +/*! @defined kIOLinkStatus + @abstract A property of IONetworkController objects. + @discussion The kIOLinkStatus property is a property of IONetworkController + objects. It has an OSNumber value that describes the current network + link status. See IONetworkMedium for the definition of the link + status bits. */ + +#define kIOLinkStatus "IOLinkStatus" + +/*! @defined kIOLinkData + @abstract A property of IONetworkController objects. + @discussion The kIOLinkData property is a property of IONetworkController + objects. It has an OSData value that contains additional information + describing the active link that was established. + Its interpretation is not defined. */ + +#define kIOLinkData "IOLinkData" + +/*! @defined kIOPacketFilters + @abstract A property of IONetworkController objects. + @discussion The kIOPacketFilters property is a property of IONetworkController + objects. It has an OSDictionary value that describes the entire + set of packet filters supported by the controller. Each entry + in the dictionary is a key/value pair consisting of the filter + group name, and an OSNumber describing the set of supported + filters for that group. */ + +#define kIOPacketFilters "IOPacketFilters" + +/*! @defined kIOMACAddress + @abstract A property of IONetworkController objects. + @discussion The kIOMACAddress property is a property of IONetworkController + objects. It has an OSData value that describes the hardware + MAC (media access controller) address, or station address, + of the network controller. */ + +#define kIOMACAddress "IOMACAddress" + +/*! @defined kIOMaxPacketSize + @abstract A property of IONetworkController objects. + @discussion The kIOMaxPacketSize property is a property of IONetworkController + objects. It has an OSNumber value that describes the maximum + packet size supported by the controller. */ + +#define kIOMaxPacketSize "IOMaxPacketSize" + +/*! @defined kIOMinPacketSize + @abstract A property of IONetworkController objects. + @discussion The kIOMinPacketSize property is a property of IONetworkController + objects. It has an OSNumber value that describes the minimum + packet size supported by the controller. */ + +#define kIOMinPacketSize "IOMinPacketSize" + +/*! @defined kIONetworkFilterGroup + @abstract The name assigned to the standard network filter group. */ + +#define kIONetworkFilterGroup "IONetworkFilterGroup" + +/*! @enum StandardPacketFilters + @abstract All standard packet filters. + @discussion Each filter will allow the reception of certain class of packets + depending on its destination MAC address. + @constant kIOPacketFilterUnicast Reception of unicast packets. + @constant kIOPacketFilterBroadcast Reception of broadcast packets. + @constant kIOPacketFilterMulticast Reception of multicast packets + addressed to a set of multicast addresses. + @constant kIOPacketFilterMulticastAll Reception of all multicast + packets. + @constant kIOPacketFilterPromiscuous Reception of all packets. + @constant kIOPacketFilterPromiscuousAll Reception of all packets, + including bad packets. */ + +enum { + kIOPacketFilterUnicast = 0x1, + kIOPacketFilterBroadcast = 0x2, + kIOPacketFilterMulticast = 0x10, + kIOPacketFilterMulticastAll = 0x20, + kIOPacketFilterPromiscuous = 0x100, + kIOPacketFilterPromiscuousAll = 0x200 +}; + +/*! @enum NetworkFeatureFlags + @abstract Feature flags returned by the getFeatures() method. + @constant kIONetworkFeatureNoBSDWait Set this bit in the value + returned by getFeatures() to disable the automatic wait for + "IOBSD" resource by the IONetworkController::start() method. + @constant kIONetworkFeaturesHardwareVlan Set this bit in the value + returned by getFeatures() to indicate the controller supports hardware + stripping and stuffing of 802.1q vlan tags. If the controller supports + this feature it must enable it when initializing so that all received + packets delivered to higher layers have the tag stripped. The controller + should use setVlanTag() to provide the tag information out of band. + @constant kIONetworkFeaturesSoftwareVlan Set this bit in the value + returned by getFeatures() to indicate that the controller can support software + based vlan by transmitting and receiving packets 4 bytes longer that normal. + @constant kIONetworkFeatureMultiPages Set this bit if the driver is + capable of handling packets coming down from the network stack that + reside in virtually, but not in physically contiguous span of the + external mbuf clusters. In this case, the data area of a packet in + the external mbuf cluster might cross one or more physical pages that + are disjoint, depending on the interface MTU and the packet size. + Such a use of larger than system page size clusters by the network + stack is done for better system efficiency. Drivers that utilize the + IOMbufNaturalMemoryCursor with the getPhysicalSegmentsWithCoalesce + interfaces and enumerate the list of vectors should set this flag + for possible gain in performance during bulk data transfer. + @constant kIONetworkFeatureTSOIPv4 Set this bit to advertise support + for TCP/IPv4 segmentation offload. + @constant kIONetworkFeatureTSOIPv6 Set this bit to advertise support + for TCP/IPv6 segmentation offload. +*/ + +enum { + kIONetworkFeatureNoBSDWait = 0x01, + kIONetworkFeatureHardwareVlan = 0x02, + kIONetworkFeatureSoftwareVlan = 0x04, + kIONetworkFeatureMultiPages = 0x08, + kIONetworkFeatureTSOIPv4 = 0x10, + kIONetworkFeatureTSOIPv6 = 0x20 +}; + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include + +class IOCommandGate; +class IOOutputQueue; +class IONetworkMedium; + +/*! @typedef IOPacketBufferConstraints + @discussion Constraint parameters, specified by a driver, + for the data buffer in a packet mbuf. This is observed by + allocatePacket() to satisfy the stated requirements. + @field alignStart Starting address byte alignment. + @field alignLength Buffer length byte alignment. */ + +typedef struct { + UInt32 alignStart; + UInt32 alignLength; + UInt32 reserved[6]; +} IOPacketBufferConstraints; + +// Some frequently used alignment constants. +// +enum { + kIOPacketBufferAlign1 = 1, + kIOPacketBufferAlign2 = 2, + kIOPacketBufferAlign4 = 4, + kIOPacketBufferAlign8 = 8, + kIOPacketBufferAlign16 = 16, + kIOPacketBufferAlign32 = 32 +}; + +/*! @const gIONetworkFilterGroup + @discussion gIONetworkFilterGroup is an OSSymbol object that contains + the name of the standard network filter group as defined by + kIONetworkFilterGroup. */ + +extern const OSSymbol * gIONetworkFilterGroup; + +/*! @class IONetworkController + @abstract Implements the framework for a generic + network controller. + @discussion A subclass of IONetworkController must provide + additional functionality specific for a particular networking type. + In addition, the driver must implement (override) a basic set of + hardware dependent methods to create a working driver. + + IONetworkController attaches itself to the data link layer (DLIL) via + an IONetworkInterface object. A controller object without a companion + interface is not accessible to the networking system. The controller + interacts with DLIL by calling methods defined by the interface object. + And conversely, DLIL will issue commands and packets to the controller + through the interface object. + + IONetworkController will create an IOCommandGate and attach this + event source to an IOWorkLoop object. All commands sent from the + interface object are handled through the IOCommandGate object, + which will serialize access to the controller. Outbound packets sent + from the interface to the controller have no implicit serialization. + Drivers must implement an output function that is thread safe, or use + an IOOutputQueue object which will provide a serialization model. + + Note: IONetworkController internally uses some private messaging constants + in the sys_iokit | sub_iokit_networking range defined in + "IONetworkControllerPrivate.h". If you create a client for your controller + (for example an IOUserClient), and it overrides the IOService::message + method, your client may receive these messages. It should ignore these + messages and pass them to super::message() + */ + +class IONetworkController : public IOService +{ + OSDeclareAbstractStructors( IONetworkController ) + +private: + + IOWorkLoop * _workLoop; + IOCommandGate * _cmdGate; + IOOutputQueue * _outputQueue; + OSSet * _clientSet; + OSCollectionIterator * _clientSetIter; + OSObject * _cmdClient; + UInt32 _alignStart; + UInt32 _alignLength; + UInt32 _alignPadding; + bool _propertiesPublished; + IOLock * _mediumLock; + IODebuggerLockState _debugLockState; + SInt32 _debugLockCount; + OSNumber * _linkStatus; + OSNumber * _linkSpeed; + const OSData * _lastLinkData; + const OSSymbol * _lastActiveMediumName; + const OSSymbol * _lastCurrentMediumName; + mbuf_t _freeList; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + + bool _broadcastEvent(UInt32 type, void * data = 0); + + static void debugRxHandler(IOService * handler, + void * buffer, + UInt32 * length, + UInt32 timeout); + + static void debugTxHandler(IOService * handler, + void * buffer, + UInt32 length); + + static IOReturn executeCommandAction(OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3); + + static IOReturn handleCommand(void * target, + void * param0, + void * param1, + void * param2, + void * param3); + +public: + +/*! @function init + @abstract Initializes the IONetworkController object. + @discussion Instance variables are initialized, then super::init() + is called. + @param properties A dictionary object containing a property table + associated with this instance. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(OSDictionary * properties); + +/*! @function start + @abstract Starts the network controller. + @discussion After the controller driver has successfully matched + to a provider, this method is called to start the network controller. + IONetworkController will allocate resources and gather controller + properties in its implementation. No I/O will be performed until + the subclass tries to attach a client object. A driver must override + this method, and call super::start() at the beginning of its own + implementation. Then check the return value to make sure that its + superclass was started successfully before proceeding. Tasks that + are usually performed by a driver's start method are: resource + allocation, hardware initialization, allocation of IOEventSources + and attaching them to a workloop, publishing a medium dictionary, + and finally, attaching an interface object when it is ready to + handle client requests. + @param provider The provider that the controller was matched + (and attached) to. + @result Returns true on success, false otherwise. +*/ + + virtual bool start(IOService * provider); + +/*! @function stop + @abstract Stops the network controller. + @discussion The counterpart of start(). The controller has been + instructed to stop running. The stop() method should release + resources and undo actions performed by the start() method. + Subclasses must override this method and call super::stop() + at the end of its implementation. + @param provider The provider that the controller was matched + (and attached) to. */ + + virtual void stop(IOService * provider); + +/*! @typedef IONetworkController::Action + @discussion Definition of a C function that can be called + through executeCommand(). + @param target The first argument passed to action. + @param param0 Action parameter 0. + @param param1 Action parameter 1. + @param param2 Action parameter 2. + @param param3 Action parameter 3. */ + + typedef IOReturn (*Action)(void * target, void * param0, + void * param1, + void * param2, + void * param3); + +/*! @function executeCommand + @abstract Makes a C function call through the command gate. + @discussion This method makes a call to a C function that will be synchronized + with the workloop thread, and any other threads that are called + with the workloop's gate closed. + @param client The client requesting the action. This parameter is not + passed to the function. + @param action Pointer to a C function to be executed. + @param target The first parameter in the action callout. + @param param0 Action parameter 0. + @param param1 Action parameter 1. + @param param2 Action parameter 2. + @param param3 Action parameter 3. + @result Returns the value returned by the action. +*/ + + virtual IOReturn executeCommand(OSObject * client, + Action action, + void * target, + void * param0 = 0, + void * param1 = 0, + void * param2 = 0, + void * param3 = 0); + +/*! @function outputPacket + @abstract Transmits an output packet. + @discussion If an IOOutputQueue was created by createOutputQueue(), + then this method will be called by the output queue object. + Otherwise, an interface object will call this method directly when + it receives an output packet from the data link layer. + + There is no upper limit on the number of mbufs, hence the number of + memory fragments, in the mbuf chain provided. Drivers must be able to + handle cases when the mbuf count might exceed the limit supported by their + DMA engines, and perform coalescing to copy the various memory fragments + into a lesser number of fragments. This complexity can be hidden from + the driver when an IOMbufMemoryCursor is used, which is able to convert + an mbuf chain into a physical address scatter-gather list that will not + exceed a specified number of physically contiguous memory segments. + See IOMbufMemoryCursor. + + The implementation in IONetworkController performs no useful action + and will drop all packets. A driver must override this method and + process the output packet provided. The implementation in the driver + must not block, since this may cause the network stack to be reentered + from an unsafe point. + @param packet An mbuf chain containing the output packet to be sent on + the network. + @param param A parameter provided by the caller. + @result Returns a return code defined by the caller. +*/ + + virtual UInt32 outputPacket(mbuf_t, void * param); + +/*! @function getFeatures + @abstract Reports generic features supported by the controller and/or + the driver. + @result This method will always return 0. Subclasses may override + this method and return a bit mask of all supported features. */ + + virtual UInt32 getFeatures() const; + +/*! @function newVendorString + @result Returns a string describing the vendor of the network controller. + The caller is responsible for releasing the string object returned. */ + + virtual const OSString * newVendorString() const; + +/*! @function newModelString + @result Returns a string describing the model of the network controller. + The caller is responsible for releasing the string object returned. */ + + virtual const OSString * newModelString() const; + +/*! @function newRevisionString + @result Returns a string describing the hardware revision of the + network controller. The caller is responsible for releasing the + string object returned. */ + + virtual const OSString * newRevisionString() const; + +/*! @function getSelectedMedium + @abstract Gets the current selected medium. + @discussion If the driver has previously called setSelectedMedium() + to indicate its current media selection, then this method will return + that medium object. Otherwise, the driver's property table is + consulted and a default medium property is examined, and the + corresponding entry in the medium dictionary is returned. + @result Returns the current selected medium, the default medium, or 0. +*/ + + virtual const IONetworkMedium * getSelectedMedium() const; + const IONetworkMedium * getCurrentMedium() const; + +/*! @function getMediumDictionary + @abstract Returns the medium dictionary published by the driver. + @discussion Returns the medium dictionary published by the driver + through publishMediumDictionary(). Use copyMediumDictionary() to + create and get a copy of the medium dictionary. + @result Returns the published medium dictionary, or 0 if the driver has not + yet published a medium dictionary through publishMediumDictionary(). +*/ + + virtual const OSDictionary * getMediumDictionary() const; + +/*! @function copyMediumDictionary + @abstract Returns a copy of the medium dictionary published by the + driver. + @discussion The caller is responsible for releasing the dictionary + object returned. Use getMediumDictionary() to get a reference to the + published medium dictionary instead of creating a copy. + @result Returns a copy of the medium dictionary, or 0 if the driver has not + published a medium dictionary through publishMediumDictionary(). +*/ + + virtual OSDictionary * copyMediumDictionary() const; + +/*! @function getOutputHandler + @abstract Gets the address of the method designated to handle output + packets for the network controller. + @result Returns a pointer to the outputPacket() method. +*/ + + virtual IOOutputAction getOutputHandler() const; + +/*! @function doEnable + @abstract Makes a synchronized call to enable() through executeCommand(). + @discussion Do not use this method, it may be removed in the future. + See enable(). +*/ + + virtual IOReturn doEnable(IOService * client); + +/*! @function doDisable + @abstract Makes a synchronized call to disable() through executeCommand(). + @discussion Do not use this method, it may be removed in the future. + See disable(). +*/ + + virtual IOReturn doDisable(IOService * client); + +/*! @function getCommandGate + @abstract Gets the IOCommandGate object created by IONetworkController. + @discussion When IONetworkController is started, an IOCommandGate object + is instantiated and attached to the workloop returned by getWorkLoop(). + This IOCommandGate object is used internally to synchronize client + commands handled through executeCommand(). Subclasses that need an + IOCommandGate should try to reuse the object returned by this method, + rather than creating a new instance. See IOCommandGate documentation. + @result Returns the IOCommandGate object created by IONetworkController. +*/ + + virtual IOCommandGate * getCommandGate() const; + +/*! @function getHardwareAddress + @abstract Gets the network controller's permanent hardware/station + address. + @discussion This method call is synchronized by the workloop's gate. + @param addr The buffer where the controller's hardware address should + be stored. + @param inOutAddrBytes The size of the address buffer provided by the + client, and replaced by this method with the actual size of + the hardware address in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn getHardwareAddress(void * addr, + UInt32 * inOutAddrBytes) = 0; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the network + controller. + @discussion This method call is synchronized by the workloop's gate. + @param buffer The buffer containing the hardware address provided by + the client. + @param addrBytes The size of the address buffer provided by the + client in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn setHardwareAddress(const void * addr, + UInt32 addrBytes) = 0; + +/*! @function enable + @abstract Handles an enable request from a client. + @discussion This method handles an enable request from a client. A client will call + enable after it has opened the controller, and before it starts to use + the controller to send and to receive packets over the network. The + client object provided is typecasted using OSDynamicCast, and depending + on whether the client is an IOKernelDebugger or an IONetworkInterface, + then an overloaded enable method that takes a more specific argument + type is called. If the client matches neither type, then + kIOReturnBadArgument is returned. A driver has the option of overriding + this base enable method, or the overloaded form. This method call is + synchronized by the workloop's gate. + @param client The client object requesting the enable. + @result Returns the return value from the overloaded enable() method, or + kIOReturnBadArgument if the client type is unknown. +*/ + + virtual IOReturn enable(IOService * client); + +/*! @function disable + @abstract Handles a disable request from a client. + @discussion This method handles a disable request from a client. A client will call + disable if it has previously enabled the controller, and it no longer + needs to transport packets or perform I/O using the controller. + The client object is typecasted using OSDynamicCast, and depending on + whether the client is an IOKernelDebugger or an IONetworkInterface, + then an overloaded disable method that takes a more specific argument + type is called. If the client matches neither type, then + kIOReturnBadArgument is returned. A driver has the option of overriding + this base disable method, or the overloaded form. This method call is + synchronized by the workloop's gate. + @param client The client object requesting the disable. + @result Returns the return from the overloaded disable() method, or + kIOReturnBadArgument if the client type is unknown. +*/ + + virtual IOReturn disable(IOService * client); + +/*! @function setMaxPacketSize + @abstract A client request to change the maximum packet size. + @discussion This method call is synchronized by the workloop's gate. + @param maxSize The new maximum packet size. + @result Returns kIOReturnUnsupported. Drivers may override this method + and return either kIOReturnSuccess to indicate that the new size + was accepted and is in effect, or an error code to indicate failure. +*/ + + virtual IOReturn setMaxPacketSize(UInt32 maxSize); + +/*! @function getMaxPacketSize + @abstract Gets the maximum packet size supported by the controller. + @param maxSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMaxPacketSize(UInt32 * maxSize) const = 0; + +/*! @function getMinPacketSize + @abstract Gets the minimum packet size supported by the controller. + @param minSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMinPacketSize(UInt32 * minSize) const = 0; + +/*! @function selectMedium + @abstract A client request to change the medium selection. + @discussion This method is called when a client issues a command + for the controller to change its current medium selection. + The implementation must call setSelectedMedium() after the change + has occurred. This method call is synchronized by the workloop's + gate. + @param medium An entry from the published medium dictionary that + represents the selection chosen by the client. + @result Returns kIOReturnUnsupported. Drivers may override this method and + return kIOReturnSuccess if the selection was successful, + or an error code otherwise. +*/ + + virtual IOReturn selectMedium(const IONetworkMedium * medium); + +/*! @function selectMediumWithName + @abstract A client request to change the medium selection. + @discussion This method is called when a client issues a command + for the controller to change its current medium selection. + This implementation will look for an entry in the medium + dictionary published by the driver that is associated with the + key given. If a match is found, then selectMedium() is called to + perform the selection, otherwise an error is reported back to the + client. Subclasses should override selectMedium() and not this + method. This method call is synchronized by the workloop's gate. + @param mediumName An OSSymbol object that describes the name of the + new medium selected by the client. + @result Returns the return from selectMedium() if a matching entry was found + from the medium dictionary. Returns kIOReturnUnsupported if a medium + dictionary does not exist, or kIOReturnBadArgument if the name given + does not match any entry in the medium dictionary. +*/ + + virtual IOReturn selectMediumWithName(const OSSymbol * mediumName); + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the network + controller for the given filter group. + @discussion A subclass must implement this method and report the + set of filters that are supported for the given filter group. + This method call is synchronized by the workloop's gate. + @param group The name of the filter group. + @param filters Pointer to the mask of supported filters returned by + this method. + @result Returns kIOReturnSuccess on success, or an error to indicate a + failure to discover the set of supported filters. +*/ + + virtual IOReturn getPacketFilters(const OSSymbol * group, + UInt32 * filters) const = 0; + +/*! @function enablePacketFilter + @abstract Enables one of the supported packet filters from the + given filter group. + @discussion A client will call this method to enable a supported filter + from the filter group specified. If the client wishes to enable more + than one filter, it must call this method multiple times to enable the + desired set of filters. This method call is synchronized by the + workloop's gate. + @param group The name of the filter group containing the filter to be + enabled. + @param aFilter The filter to enable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the enable request. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn enablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) = 0; + +/*! @function disablePacketFilter + @abstract Disables a packet filter that is currently enabled from the + given filter group. + @discussion After a supported filter has been successfully enabled, + a client can call this method to disable that filter. This method call + is synchronized by the workloop's gate. + @param group The name of the filter group containing the filter to be + disabled. + @param aFilter The filter to disable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the disable request. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn disablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) = 0; + +/*! @function getOutputQueue + @abstract Gets the IOOutputQueue object created by createOutputQueue(). + @result Returns a reference to the output queue object created by + createOutputQueue(). +*/ + + virtual IOOutputQueue * getOutputQueue() const; + +/*! @function getPacketBufferConstraints + @abstract Gets the controller's packet buffer constraints. + @discussion Called by start() to obtain the constraints on the + memory buffer for each mbuf packet allocated through allocatePacket(). + Drivers can override this method to specify the buffer constraints + imposed by their bus master hardware. Note that outbound packets, + those that originate from the network stack, are not currently + subject to the constraints reported here. + @param constraints A pointer to an IOPacketBufferConstraints + structure that this method is expected to initialize. + See IOPacketBufferConstraints structure definition. +*/ + + virtual void getPacketBufferConstraints( + IOPacketBufferConstraints * constraints) const; + +/*! @function allocatePacket + @abstract Allocates a packet with a data buffer that is larger than + or equal to the size specified. + @discussion This method will always return a single mbuf unless the + size requested (plus the alignment padding) is greater than MCLBYTES. + The data buffer for the mbuf (or an mbuf chain) returned is aligned + according to the constraints reported by getPacketBufferConstraints(). + The length fields in each mbuf returned are set by this method, thus + allowing the mbuf to be passed directly to an IOMbufMemoryCursor object + in order to convert the mbuf to a physical address scatter-gather list. + @param size The minimum size of the data buffer for the mbuf + packet allocated. + @result Returns an mbuf packet, or 0 if allocation failed. +*/ + + virtual mbuf_t allocatePacket(UInt32 size); + +/*! @function copyPacket + @abstract Allocates a new packet, containing data copied from an + existing source packet. + @discussion The source packet is not modified by this method. + @param m The source packet. + @param size The number of bytes to copy. If set to 0, then the + entire data buffer from the source packet is copied. + @result Returns a new packet containing the same data as the source packet. +*/ + + virtual mbuf_t copyPacket(const mbuf_t m, UInt32 size = 0); + +/*! @function replacePacket + @abstract Allocates a new packet to replace an existing packet, the + existing packet is then returned. + @param mp A handle to the existing packet. + @param size If size is 0, then the new packet shall have the same buffer + size as the original packet that is being replaced. Otherwise, the new + packet shall have the buffer size specified by this value. + @result If packet allocation was successful, then a replacement will + take place and the original packet will be returned. Otherwise, 0 + is returned, and the original packet will be left untouched. +*/ + + virtual mbuf_t replacePacket(mbuf_t * mp, UInt32 size = 0); + +/*! @function replaceOrCopyPacket + @abstract A helper method that combines the functionality of + copyPacket() and replacePacket() to process a packet containing + a received frame. + @discussion This method will either make a copy or replace the existing + packet, whichever is more time efficient. Packets containing small frames + are copied, otherwise they are replaced. If replaced, then the existing + packet is returned, and a new packet with the same buffer size is created + to take its place. If copied, the existing packet is left intact, while a + copy is returned that will hold a copy of the data from the source packet. + @param mp A handle to the existing packet that may be replaced. + @param length The number of bytes received held in the packet. + Must be greater than zero. + @param replaced Pointer to a return value that is set to true to indicate + that the existing packet was replaced, or false to indicate that the + existing packet was not replaced, and a copy was created. + @result Returns a replacement or a copy of the existing packet, or 0 if packet + allocation failed. +*/ + + virtual mbuf_t replaceOrCopyPacket(mbuf_t * mp, + UInt32 length, + bool * replaced); + + enum { + kDelayFree = 0x01 + }; + +/*! @function freePacket + @abstract Releases the packet given back to the free pool. + @param m The packet to be freed. + @param options When kDelayFree option is set, then the packet + provided to this function will be queued on the free packet queue. + A subsequent call to releaseFreePackets() will release all queued + packets by making a single BSD function call. Without the kDelayFree + option, the packet provided will be released immediately. +*/ + + virtual void freePacket(mbuf_t, IOOptionBits options = 0); + +/*! @function releaseFreePackets + @abstract Releases all packets held in the free packet queue. + @discussion The free packet queue is not protected by a lock. This + function must be called in a single-threaded manner with respect to + all calls to freePacket() with the kDelayFree option set. + @result Returns the number of packets queued and released. +*/ + + virtual UInt32 releaseFreePackets(); + +/*! @enum TCP/IPChecksums + @abstract TCP/IP checksums that may be supported by the + hardware. + @constant kChecksumFamilyTCPIP A value that describes the collection + of TCP/IP checksums. + @constant kChecksumIP An IP header checksum. + @constant kChecksumTCP A TCP checksum that covers the TCP header and TCP + data. + @constant kChecksumUDP A UDP checksum that covers the UDP header and UDP + data. + @constant kChecksumTCPNoPseudoHeader A TCP checksum that covers the TCP + header and the TCP data, but the pseudo header is not included in the + checksum computation. A partial 16-bit checksum value must be provided + to allow the protocol stacks to calculate and verify the final checksum. + This type of checksum is not currently supported on the output path. + @constant kChecksumUDPNoPseudoHeader A UDP checksum that covers the UDP + header and the UDP data, but the pseudo header is not included in the + checksum computation. A partial 16-bit checksum value must be provided + to allow the protocol stacks to calculate and verify the final checksum. + This type of checksum is not currently supported on the output path. + @constant kChecksumTCPSum16 The hardware has a simple checksum engine + that can perform a TCP style ones complement sum of 16-bit words over + a certain range of bytes in a packet. The hardware does not have the + ability to scan for IP or TCP headers, and the driver must pass/get + additional parameter(s) to or from the protocol stack to coordinate + the checksumming effort. +*/ + + enum { + kChecksumFamilyTCPIP = 0x00000001, + kChecksumIP = 0x0001, + kChecksumTCP = 0x0002, + kChecksumUDP = 0x0004, + kChecksumTCPNoPseudoHeader = 0x0100, + kChecksumUDPNoPseudoHeader = 0x0200, + kChecksumTCPSum16 = 0x1000 + }; + +/*! @function getChecksumSupport + @abstract Gets checksums that are supported by the network controller for + the given checksum family. + @discussion A network controller that is capable of inserting and verifying + checksums on output and input packets, should override this method and + advertise its capability in order to assist or offload the software checksum + calculations performed by the protocol stacks. + @param checksumMask A pointer to the mask of supported checksums returned + by this method. + @param checksumFamily A value that specifies the checksum family. + @param isOutput Set to true to query the support for checksum insertion on + output packets, or false to query the support for checksum verification + on input packets. Controllers that have symmetric hardware checksum support + can return a fixed checksum mask value, and ignore this argument. + @result Default return is kIOReturnUnsupported. Controllers that override + this method must return kIOReturnSuccess. Any other return value will be + interpretated as a lack of checksum support, regardless of the value + returned through the first argument. +*/ + + virtual IOReturn getChecksumSupport( UInt32 * checksumMask, + UInt32 checksumFamily, + bool isOutput ); + +/*! @function setChecksumResult + @abstract Encodes a received packet with the checksum result reported + by the hardware. + @discussion A network controller that can verify the checksum(s) for a + received packet, should call this method to encode the result on the + packet, before passing it up towards the protocol stacks. + @param packet An mbuf containing a packet that has been checksummed by + the hardware. + @param checksumFamily A value that specifies the checksum family. + @param resultMask A mask of all checksums that were checked or computed. + Setting a bit implies that the driver is able to report the result of + the checksum computation, by asserting the validity of the checksum, + or by returning a partial checksum value. + @param validMask A mask of all checksums are were computed and verified + by the hardware as valid. Certain types of checksum performed by the + hardware are inheritely incomplete, and therefore should never be marked + as valid. A checksum cannot be marked valid unless it has also been + checked. + @param param0 Optional parameter 0, defaults to 0. + @param param1 Optional parameter 1, defaults to 0. + @result Returns true if the checksum family is valid and the packet has been + encoded with the checksum result provided, false otherwise. +*/ + + virtual bool setChecksumResult( mbuf_t packet, + UInt32 checksumFamily, + UInt32 resultMask, + UInt32 validMask, + UInt32 param0 = 0, + UInt32 param1 = 0 ); + +/*! @function getChecksumDemand + @abstract Fetches the demand for hardware checksum computation and insertion + for the given packet before it is transmitted on the network. + @discussion A network controller that can insert a checksum for output + packets must call this method to obtain the set of checksums that it must + compute, and insert into the appropriate fields in the given output packet. + @param packet An mbuf containing a packet that may be missing one or more + checksums in the specified checksum family. + @param checksumFamily A value that specifies the checksum family. + @param demandMask A mask of all checksums that the hardware must compute + and insert into the appropriate checksum fields in the packet. + @param param0 Optional parameter 0, defaults to 0. + @param param1 Optional parameter 1, defaults to 0. +*/ + + virtual void getChecksumDemand( const mbuf_t packet, + UInt32 checksumFamily, + UInt32 * demandMask, + void * param0 = 0, + void * param1 = 0 ); + +/*! @function publishMediumDictionary + @abstract Publishes a dictionary of IONetworkMedium objects to + advertise the media selection supported by the network controller. + @discussion Called by drivers to publish their medium dictionary. + Each entry in the dictionary is an IONetworkMedium object that + represents a single medium that is supported by the controller. + This method will make a copy of the dictionary provided, then add + the copy to the driver's property table. The dictionary provided + can be released by the caller upon returning from this method. + It is permissible to call this method multiple times, which may be + necessary if the hardware's media capability changes dynamically. + However, if the capability is static, which is often the case, + then a driver will typically call this method only once from + its start() method. + + Several methods depend on the presence of a medium dictionary. + They should be called after the medium dictionary has been + published. Those methods are: + setSelectedMedium() + getSelectedMedium() + getMediumDictionary() + copyMediumDictionary() + + @param mediumDict A dictionary of IONetworkMedium objects. + @result Returns true if the dictionary is valid, and was successfully + exported to the property table, false otherwise. +*/ + + virtual bool publishMediumDictionary(const OSDictionary * mediumDict); + +/*! @function setSelectedMedium + @abstract Designates an entry in the published medium dictionary as + the current selected medium. + @discussion After the driver has configured the hardware to select + one of its supported media types, it must call this method to inform + its parent about the change that has occurred. IONetworkController + will update a property in the registry to reflect the current selection. + @param medium A medium object representing the current selection. + @result Returns true if the property table update was successful, + false if the update failed, or if the medium provided does not match + any entry from the published medium dictionary. +*/ + + virtual bool setSelectedMedium(const IONetworkMedium * medium); + bool setCurrentMedium(const IONetworkMedium * medium); + +/*! @function setLinkStatus + @abstract Reports the link status and the active medium. + @discussion Drivers must call this method when a link change is + detected. IONetworkController will update the link status properties + in the registry, and generate an event to inform the upper layers + about the change. + @param status Link status bits. + See IONetworkMedium for the definition of the link status bits. + @param activeMedium An object in the published medium dictionary + that represents the active medium. This may not be the same as + the selected medium. Set this to 0 if the link is inactive. + @param speed Link speed in units of bits per second. If zero, then + the link speed is taken from the medium object provided. + @param data An OSData containing any additional link parameter that + the driver wishes to publish to the registry. + @result Returns true if all link properties were successfully updated, + false otherwise. +*/ + + virtual bool setLinkStatus( + UInt32 status, + const IONetworkMedium * activeMedium = 0, + UInt64 speed = 0, + OSData * data = 0); + +/*! @function systemWillShutdown + @abstract Handles system shutdown and restart notifications. + @discussion Overrides IOService::systemWillShutdown in order + to notify network clients that the power-managed controller should be disabled. + As a result, drivers can expect their disable method to be called + before system shutdown or restart. This implementation is synchronous and can + block before calling IOService::systemWillShutdown and return. + @param See IOService::systemWillShutdown. +*/ + + virtual void systemWillShutdown( IOOptionBits specifier ); + + /* Override IOService::setAggressiveness() */ + + virtual IOReturn setAggressiveness( + unsigned long type, unsigned long newLevel ); + +protected: + +/*! @function free + @abstract Frees the IONetworkController object. + @discussion Frees the IONetworkController object by releasing all + allocated resources, followed by a call to super::free(). +*/ + + virtual void free(); + +/*! @function registerWithPolicyMaker + @abstract Implemented by controller drivers to register with + the power management policy-maker. + @discussion Drivers that are able to power manage their hardware + should override this method and register with the policy-maker + provided by calling IOService::registerPowerDriver(). + IONetworkController will call this method before the initial + attempt is made to attach a client. + @param policyMaker The policy-maker chosen to manage power for + this network controller. + @result Returns kIOReturnSuccess on success, kIOReturnUnsupported if the + driver does not support power management, or an appropriate error + return code. The default return is kIOReturnUnsupported. */ + + virtual IOReturn registerWithPolicyMaker(IOService * policyMaker); + +/*! @function createWorkLoop + @abstract Method called by IONetworkController prior to the initial + getWorkLoop() call. + @discussion Before IONetworkController calls getWorkLoop() in its + start() method, it will call createWorkLoop() to make sure that a + subclass that wants to create a workloop, will do so before its + first use. + @result Returns true to indicate success, false otherwise. Returning false + will fail IONetworkController::start(). +*/ + + virtual bool createWorkLoop(); + +/*! @function prepare + @abstract Prepares the controller before an IOService is created and + attached as a client. + @discussion This method is called by attachInterface() or + attachDebuggerClient() to prepare the controller before the new client + object is attached. This method will call publishProperties() to publish + controller capabilities and properties that may be used by client objects. + However, publishProperties() will be called only once, even if prepare() + is called multiple times. This method call is synchronized by the + workloop's gate. + @result Returns kIOReturnSuccess on success, or an error code otherwise. + Returning an error will fail the client attach. +*/ + + virtual IOReturn prepare(); + +/*! @function publishProperties + @abstract Publishes controller properties and capabilities. + @discussion Called by IONetworkController to discover controller + properties, and publish them to the property table in the I/O Kit + Registry. This method is called once by prepare(). + @result Returns true if all properties were discovered and published + successfully, false otherwise. Returning false will prevent client + objects from attaching to the controller, since a property that + a client relies upon may be missing. */ + + virtual bool publishProperties(); + +/*! @function getCommandClient + @abstract Gets the command client object. + @discussion Methods called on the workloop context to service a + client request can call this method to get the client object that + initiated the command. + @result Returns the command client. If the caller is not running on the + workloop thread, or if the thread does not have the workloop's gate + closed, then 0 is returned. +*/ + + virtual OSObject * getCommandClient() const; + +/*! @function handleOpen + @abstract Handles a client open. + @discussion This method handles a client open on the controller object. IOService + calls this method with the arbitration lock held. Subclasses + should not override this method. + @param client The client that is attempting to open the controller. + @param options Not used. See IOService. + @param argument Not used. See IOService. + @result Returns true to accept the client open, false to refuse it. +*/ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handles a client close. + @discussion This method handles a close from one of the client objects. IOService + calls this method with the arbitration lock held. Subclasses + should not override this method. + @param client The client that is closing the controller. + @param options Not used. See IOService. +*/ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on the controller. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function enable + @abstract A request from an interface client to enable the controller. + @discussion This method is called by an interface client to enable the controller. + Upon receiving this command, the controller driver must bring up the + hardware and become ready to transmit and receive packets. A driver + should also delay the allocation of most runtime resources until this + method is called in order to conserve system resources. This method call + is synchronized by the workloop's gate. + @param interface The interface client object that requested the enable. + @result Returns kIOReturnUnsupported. Drivers that override this method must + return kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn enable(IONetworkInterface * interface); + +/*! @function disable + @abstract A request from an interface client to disable the controller. + @discussion This method is called by an interface client to disable the controller. + This method should stop the hardware and disable hardware interrupt + sources. Any resources allocated by enable() should also be deallocated. + This method call is synchronized by the workloop's gate. + @param interface The interface object that requested the disable. + @result kIOReturnUnsupported. Drivers that override this method must + return Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn disable(IONetworkInterface * interface); + +/*! @function attachInterface + @abstract Attaches a new interface client object. + @discussion This method creates a new interface object and attaches it to the + controller. The createInterface() method is called to perform + the interface allocation and initialization, followed by a call to + configureInterface() to configure it. Subclasses can override those + two methods to customize the interface client attached. Drivers will + usually call this method from start(), after they are ready to process + client requests. Since most drivers will have a single interface + client, this method will likely be called only once. + @param interface Upon success (return value is true), the + interface object will be written to the handle provided. + @param doRegister If true, then registerService() is called to register + the interface, which will trigger the matching process, and will ultimately + cause the interface to become registered with the data link layer. + Drivers that wish to delay the registration can set doRegister to false, + and call registerService() on the interface object when the controller + becomes ready. This allows the driver to attach an interface without + making its services available to the rest of the system. + @result Returns true on success, false otherwise. +*/ + + virtual bool attachInterface(IONetworkInterface ** interface, + bool doRegister = true); + +/*! @function detachInterface + @abstract Detaches an interface client object. + @discussion This method will verify that the object provided is indeed + an IONetworkInterface instance, and then call its terminate() method. + Note that an interface object will close and detach from its + controller after the data link layer has removed all references to + all data structures exposed by the interface. The interface object + should be released following this call. + @param interface An interface object to be detached and terminated. + @param sync If true, the interface is terminated synchronously. + This may cause this method to block for an indeterminate + amount of time. */ + + virtual void detachInterface(IONetworkInterface * interface, + bool sync = false); + +/*! @function createInterface + @abstract Creates a new network interface object. + @discussion This method is called by attachInterface() to perform + allocation and initialization of a new interface object. A subclass of + IONetworkController must implement this method and return a matching + interface object. For example, IOEthernetController's implementation + will return an IOEthernetInterface object when createInterface() is + called. + @result Returns a newly allocated and initialized interface object. +*/ + + virtual IONetworkInterface * createInterface() = 0; + +/*! @function configureInterface + @abstract Configures a newly created network interface object. + @discussion This method configures an interface object that was created by + createInterface(). Subclasses can override this method to customize + and examine the interface object that will be attached to the + controller as a client. + @param interface The interface object to be configured. + @result Returns true if the operation was successful, false otherwise + (this will cause attachInterface() to fail and return 0). +*/ + + virtual bool configureInterface(IONetworkInterface * interface); + +/*! @function createOutputQueue + @abstract Creates an IOOutputQueue to handle output packet queueing, + and also to resolve contention for the controller's transmitter from + multiple client threads. + @discussion This method is called by start() to create an IOOutputQueue object to + handle output packet queueing. The default implementation will always + return 0, hence no output queue will be created. A driver may override + this method and return a subclass of IOOutputQueue. IONetworkController + will keep a reference to the queue created, and will release this + object when IONetworkController is freed. Also see getOutputQueue(). + @result Returns a newly allocated and initialized IOOutputQueue object. +*/ + + virtual IOOutputQueue * createOutputQueue(); + +/*! @function enable + @abstract An enable request from an IOKernelDebugger client. + @discussion Drivers that provide debugging support may either override + this method and set up the hardware to support the polled-mode send and + receive methods, receivePacket() and sendPacket(), or override the base + enable() and disable() methods that take an IOService argument. + @param debugger The IOKernelDebugger client requesting the enable. + @result Returns kIOReturnSuccess. Drivers must return kIOReturnSuccess + on success, or an error otherwise. +*/ + + virtual IOReturn enable(IOKernelDebugger * debugger); + +/*! @function disable + @abstract A disable request from an IOKernelDebugger client. + @discussion Drivers that provide debugging support may either override + this method to disable support for the polled-mode send and receive + methods, or override the base enable() and disable() methods that + take an IOService argument. + @param debugger The IOKernelDebugger client requesting the disable. + @result Returns kIOReturnSuccess. Drivers must return kIOReturnSuccess + on success, or an error otherwise. +*/ + + virtual IOReturn disable(IOKernelDebugger * debugger); + +/*! @function attachDebuggerClient + @abstract Attaches a new IOKernelDebugger client object. + @discussion This method allocates an IOKernelDebugger object and attaches it as + a client. Having a debugger client implies that the controller + supports kernel debugging, and therefore must implement the two + polled-mode methods that are called by the debugger client. See + sendPacket() and receivePacket(). Only a single debugger client + should be attached to each controller. + @param debuggerP A handle that will return the new + IOKernelDebugger object created. + @result Returns true on success, false otherwise. +*/ + + virtual bool attachDebuggerClient(IOKernelDebugger ** debuggerP); + +/*! @function detachDebuggerClient + @abstract Detaches an IOKernelDebugger client object. + @discussion This method detaches and terminates the IOKernelDebugger client object + provided. A synchronous termination is issued, and this method will + return after the debugger client has been terminated. The debugger + client should be released following this call. + @param debugger The IOKernelDebugger object to be detached and + terminated. If the argument provided is NULL or is not an + IOKernelDebugger, this method will return immediately. +*/ + + virtual void detachDebuggerClient(IOKernelDebugger * debugger); + +/*! @function reserveDebuggerLock + @abstract Takes the global debugger lock. + @discussion This method should not be used. Instead, call the + lock() method provided by IOKernelDebugger. +*/ + + void reserveDebuggerLock(); + +/*! @function releaseDebuggerLock + @abstract Releases the global debugger lock. + @discussion This method should not be used. Instead, call the + unlock() method provided by IOKernelDebugger. +*/ + + void releaseDebuggerLock(); + +/*! @function receivePacket + @abstract Debugger polled-mode receive handler. + @discussion This method must be implemented by a driver that supports + kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + client to poll for an incoming packet when the kernel debugger is active. + This method may be called from the primary interrupt context, and the + implementation must avoid any memory allocation, and must never block. + The receivePacket() method in IONetworkController is used as a placeholder, + it performs no useful action, and should not be called. A driver that + attaches a debugger client must override this method. + @param pkt Address of a receive buffer where the received packet should + be stored. This buffer has room for 1518 bytes. + @param pktSize Address where the number of bytes received must be + recorded. Set this to zero if no packets were received during + the timeout interval. + @param timeout The maximum amount of time in milliseconds to poll for + a packet to arrive before this method must return. +*/ + + virtual void receivePacket(void * pkt, UInt32 * pktSize, UInt32 timeout); + +/*! @function sendPacket + @abstract Debugger polled-mode transmit handler. + @discussion This method must be implemented by a driver that supports + kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + to send an outbound packet only when the kernel debugger is active. + This method may be called from the primary interrupt context, and the + implementation must avoid any memory allocation, and must never block. + The sendPacket() method in IONetworkController is used as a placeholder, + it performs no useful action, and should not be called. A driver that + attaches a debugger client must override this method. + @param pkt Pointer to a transmit buffer containing the packet to be + sent on the network. + @param pktSize The size of the transmit buffer in bytes. +*/ + + virtual void sendPacket(void * pkt, UInt32 pktSize); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkController, 0); + OSMetaClassDeclareReservedUnused( IONetworkController, 1); + OSMetaClassDeclareReservedUnused( IONetworkController, 2); + OSMetaClassDeclareReservedUnused( IONetworkController, 3); + OSMetaClassDeclareReservedUnused( IONetworkController, 4); + OSMetaClassDeclareReservedUnused( IONetworkController, 5); + OSMetaClassDeclareReservedUnused( IONetworkController, 6); + OSMetaClassDeclareReservedUnused( IONetworkController, 7); + OSMetaClassDeclareReservedUnused( IONetworkController, 8); + OSMetaClassDeclareReservedUnused( IONetworkController, 9); + OSMetaClassDeclareReservedUnused( IONetworkController, 10); + OSMetaClassDeclareReservedUnused( IONetworkController, 11); + OSMetaClassDeclareReservedUnused( IONetworkController, 12); + OSMetaClassDeclareReservedUnused( IONetworkController, 13); + OSMetaClassDeclareReservedUnused( IONetworkController, 14); + OSMetaClassDeclareReservedUnused( IONetworkController, 15); + OSMetaClassDeclareReservedUnused( IONetworkController, 16); + OSMetaClassDeclareReservedUnused( IONetworkController, 17); + OSMetaClassDeclareReservedUnused( IONetworkController, 18); + OSMetaClassDeclareReservedUnused( IONetworkController, 19); + OSMetaClassDeclareReservedUnused( IONetworkController, 20); + OSMetaClassDeclareReservedUnused( IONetworkController, 21); + OSMetaClassDeclareReservedUnused( IONetworkController, 22); + OSMetaClassDeclareReservedUnused( IONetworkController, 23); + OSMetaClassDeclareReservedUnused( IONetworkController, 24); + OSMetaClassDeclareReservedUnused( IONetworkController, 25); + OSMetaClassDeclareReservedUnused( IONetworkController, 26); + OSMetaClassDeclareReservedUnused( IONetworkController, 27); + OSMetaClassDeclareReservedUnused( IONetworkController, 28); + OSMetaClassDeclareReservedUnused( IONetworkController, 29); + OSMetaClassDeclareReservedUnused( IONetworkController, 30); + OSMetaClassDeclareReservedUnused( IONetworkController, 31); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IONETWORKCONTROLLER_H */ + diff --git a/i386/include/IOKit/network/.svn/text-base/IONetworkData.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IONetworkData.h.svn-base new file mode 100644 index 0000000..c0d2de4 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IONetworkData.h.svn-base @@ -0,0 +1,477 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKDATA_H +#define _IONETWORKDATA_H + +#define IONetworkParameter IONetworkData // FIXME + +/*! @enum NetworkDataAccessTypes + @abstract Constants that describe access types. + @constant kIONetworkDataAccessTypeRead Read access. + @constant kIONetworkDataAccessTypeWrite Write access. + @constant kIONetworkDataAccessTypeReset Reset access. + @constant kIONetworkDataAccessTypeSerialize Serialization access. +*/ + +enum { + kIONetworkDataAccessTypeRead = 0x01, + kIONetworkDataAccessTypeWrite = 0x02, + kIONetworkDataAccessTypeReset = 0x04, + kIONetworkDataAccessTypeSerialize = 0x08, + kIONetworkDataAccessTypeMask = 0xff +}; + +/*! @define kIONetworkDataBasicAccessTypes + @discussion The default access types supported by an IONetworkData + object. Allow read() and serialize(). */ + +#define kIONetworkDataBasicAccessTypes \ + (kIONetworkDataAccessTypeRead | kIONetworkDataAccessTypeSerialize) + +/*! @enum NetworkDataBufferTypes + @abstract The types of data buffers that can be managed by an IONetworkData object. + @constant kIONetworkDataBufferTypeInternal An internal data buffer + allocated by the init() method. + @constant kIONetworkDataBufferTypeExternal An external (persistent) data + buffer. + @constant kIONetworkDataBufferTypeNone No data buffer. The only useful + action perfomed by an IONetworkData object with this buffer type + is to call the access notification handler. +*/ + +enum { + kIONetworkDataBufferTypeInternal = 0, + kIONetworkDataBufferTypeExternal, + kIONetworkDataBufferTypeNone +}; + +/*! @defined kIONetworkDataBytes + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataBytes property is an OSData that describes + the data buffer of an IONetworkData object. This property is present + only if kIONetworkDataAccessTypeSerialize access is supported. +*/ + +#define kIONetworkDataBytes "Data" + +/*! @defined kIONetworkDataAccessTypes + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataAccessTypes property is an OSNumber that + describes the supported access types of an IONetworkData object. +*/ + +#define kIONetworkDataAccessTypes "Access Types" + +/*! @defined kIONetworkDataSize + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataSize property is an OSNumber that + describes the size of the data buffer of an IONetworkData object. +*/ + +#define kIONetworkDataSize "Size" + +#ifdef KERNEL + +#include +#include + +/*! @class IONetworkData + @abstract An object that manages a fixed-size named buffer. + @discussion An IONetworkData object manages a fixed-size named buffer. + This object provides external access methods that can be used to + access the contents of the data buffer. In addition, serialization + is supported, and therefore this object can be added to a property + table to publish the data object. An unique name must be assigned to + the object during initialization. An OSSymbol key will be created + based on the assigned name, and this key can be used when the object + is added to a dictionary. + + The level of access granted to the access methods can be restricted, + by specifying a set of supported access types when the object is + initialized, or modified later by calling setAccessTypes(). By default, + each IONetworkData object created will support serialization, and will + also allow its data buffer to be read through the read() access method. + + An access notification handler, in the form of a 'C' function, can + be registered to receive a call each time the data buffer is accessed + through an access method. Arguments provided to the handler will identify + the data object and the type of access that triggered the notification. + The handler can therefore perform lazy update of the data buffer until + an interested party tries to read or serialize the data. The notification + handler can also take over the default action performed by the access + methods when the buffer type is set to kIONetworkDataBufferTypeNone. + This will prevent the access methods from accessing the data buffer, + and allow the handler to override the access protocol. + + This object is primarily used by IONetworkInterface to export interface + properties to user space. +*/ + + +class IONetworkData : public OSObject +{ + OSDeclareDefaultStructors( IONetworkData ) + +public: + +/*! @typedef Action + @abstract Defines a C function that may be called by an IONetworkData object + when one of its access methods is called. + @param target The target of the notification. + @param param A parameter that was provided when the notification + handler was registered. + @param data The IONetworkData object being accessed, and the + sender of the notification. + @param accessType A bit will be set indicating the type of access + which triggered the notification. + @param buffer Pointer to the accessor's buffer. Only valid for + read() and write() accesses. + @param bufferSize Pointer to the size of the accessor's buffer. + @param offset An offset from the start of the data buffer to begin + reading or writing. +*/ + + typedef IOReturn (*Action)(void * target, + void * param, + IONetworkData * data, + UInt32 accessType, + void * buffer, + UInt32 * bufferSize, + UInt32 offset); + +protected: + const OSSymbol * _key; // key associated with this object. + UInt32 _access; // supported access types. + void * _buffer; // Data buffer. + UInt32 _bufType; // buffer type + UInt32 _size; // data buffer size. + void * _tapTarget; // target for access notification. + Action _tapAction; // the function to call. + void * _tapParam; // arbitrary notification param. + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +/*! @function free + @abstract Frees the IONetworkData object. +*/ + + virtual void free(); + +/*! @function writeBytes + @abstract Writes to the data buffer with data from a source buffer + provided by the caller. + @param srcBuffer Pointer to a source buffer provided by the caller. + @param srcBufferSize The size of the source buffer. + @param writeOffset A byte offset from the start of the data buffer + to begin writting. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool writeBytes(const void * srcBuffer, + UInt32 srcBufferSize, + UInt32 writeOffset = 0); + +/*! @function readBytes + @abstract Reads from the data buffer and copies the data to a destination + buffer provided by the caller. + @param dstBuffer Pointer to the destination buffer. + @param dstBufferSize Pointer to an integer containing the size of the + destination buffer. And is overwritten by this method with the actual + number of bytes copied to the destination buffer. + @param readOffset A byte offset from the start of the data buffer + to begin reading. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool readBytes(void * dstBuffer, + UInt32 * dstBufferSize, + UInt32 readOffset = 0) const; + +/*! @function clearBuffer + @abstract Clears the data buffer by filling it with zeroes. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool clearBuffer(); + +public: + +/*! @function withInternalBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object with an internal data buffer. + @param name A name to assign to this object. + @param bufferSize The number of bytes to allocate for the internal data + buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * + withInternalBuffer(const char * name, + UInt32 bufferSize, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function withExternalBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object with an external data buffer. + @param name A name to assign to this object. + @param bufferSize The size of the external data buffer. + @param externalBuffer Pointer to the external data buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * + withExternalBuffer(const char * name, + UInt32 bufferSize, + void * externalBuffer, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function withNoBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object without a data buffer. + @discussion The notification handler + must intervene when the IONetworkData is accessed. + @param name A name to assign to this object. + @param bufferSize The size of the phantom data buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * withNoBuffer(const char * name, + UInt32 bufferSize, + UInt32 accessTypes, + void * target, + Action action, + void * param = 0); + +/*! @function init + @abstract Initializes an IONetworkData object. + @param name A name to assign to this object. + @param bufferType The type of buffer associated with this object. + @param bufferSize The size of the data buffer. + @param externalBuffer Pointer to an external data buffer. + @param accessTypes The initial supported access types. + Can be later modified by calling setAccessTypes(). + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(const char * name, + UInt32 bufferType, + UInt32 bufferSize, + void * externalBuffer = 0, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function setAccessTypes + @abstract Sets the types of access that are permitted on the data buffer. + @param types A mask of access types indicating the supported access + types. +*/ + + virtual void setAccessTypes(UInt32 types); + +/*! @function setNotificationTarget + @abstract Registers a C function to handle access notifications sent + from this object. + @discussion A notification is sent by an IONetworkData object to the + registered notification handler, when an access method is called to + modify the contents of the data buffer. + @param target The first parameter passed to the notification handler. + @param action A pointer to a C function that will handle the notification. + If 0, then notification is disabled. + @param param An optional parameter passed to the notification handler. +*/ + + virtual void setNotificationTarget(void * target, + Action action, + void * param = 0); + +/*! @function getBuffer + @abstract Gets a pointer to the data buffer. + @result Returns a pointer to the data buffer. Returns 0 if the buffer type is + kIONetworkDataBufferTypeNone. +*/ + + virtual const void * getBuffer() const; + +/*! @function getBufferType + @abstract Gets the type of data buffer managed by this object. + @result Returns a constant that describes the type of the data buffer. +*/ + + virtual UInt32 getBufferType() const; + +/*! @function getAccessTypes + @abstract Gets the types of data access supported by this object. + @result Returns a mask of supported access types. +*/ + + virtual UInt32 getAccessTypes() const; + +/*! @function getNotificationTarget + @abstract Gets the first parameter that will be passed to the access + notification handler. + @result Returns the first parameter that will be passed to the access notification + handler. +*/ + + virtual void * getNotificationTarget() const; + +/*! @function getNotificationAction + @abstract Gets the C function that was registered to handle access + notifications sent from this object. + @result Returns a pointer to a C function, or 0 if notification is disabled. +*/ + + virtual Action getNotificationAction() const; + +/*! @function getNotificationParameter + @abstract Gets the parameter that will be passed to the access + notification handler. + @result Returns the parameter that will be passed to the access notification + handler. +*/ + + virtual void * getNotificationParameter() const; + +/*! @function getKey + @abstract Gets a unique OSSymbol key associated with this object. + @discussion During initialization, IONetworkData will create an + OSSymbol key based on its assigned name. + @result Returns an OSSymbol key that was generated from the name assigned to + this object. +*/ + + virtual const OSSymbol * getKey() const; + +/*! @function getSize + @abstract Gets the size of the data buffer. + @result Returns the size of the data buffer managed by this object in bytes. +*/ + + virtual UInt32 getSize() const; + +/*! @function reset + @abstract An access method that resets the data buffer. + @discussion This method handles an external request to reset the data buffer. + If notification is enabled, then the notification handler is called + after the data buffer has been cleared. + @result Returns kIOReturnSuccess on success, + kIOReturnNotWritable if reset access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn reset(); + +/*! @function read + @abstract An access method that reads from the data buffer. + @discussion This method handles an external request to read from the data buffer + and copy it to the destination buffer provided by the accessor. + If notification is enabled, then the notification handler is called + before the data buffer is copied to the destination buffer. The + notification handler may use this opportunity to intervene and + to update the contents of the data buffer. + @param dstBuffer Pointer to the destination buffer. + @param dstBufferSize Pointer to an integer containing the size of the + destination buffer. And is overwritten by this method to the actual number + of bytes copied to the destination buffer. + @param readOffset An offset from the start of the source data buffer to + begin reading. + @result Returns kIOReturnSuccess on success, + kIOReturnBadArgument if any of the arguments provided is invalid, + kIOReturnNotReadable if read access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn read(void * dstBuffer, + UInt32 * dstBufferSize, + UInt32 readOffset = 0); + +/*! @function write + @abstract An access method that writes to the data buffer. + @discussion This method handles an external request to write to the data buffer + from a source buffer provided by the accessor. After checking that + the data object supports write accesses, the data buffer is updated + if it exists. Then the registered notification handler is called. + @param srcBuffer Pointer to the source buffer. + @param srcBufferSize The number of bytes to write to the data buffer. + @param writeOffset An offset from the start of the destination data buffer + to begin writing. + @result Returns kIOReturnSuccess on success, + kIOReturnBadArgument if any of the arguments provided is invalid, + kIOReturnNotWritable if write access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn write(void * srcBuffer, + UInt32 srcBufferSize, + UInt32 writeOffset = 0); + +/*! @function serialize + @abstract Serializes the IONetworkData object. + @discussion If notification is enabled, then the notification + handler is called just before the data buffer is serialized. + @param s An OSSerialize object. + @result Returns true on success, false otherwise. +*/ + + virtual bool serialize(OSSerialize * s) const; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkData, 0); + OSMetaClassDeclareReservedUnused( IONetworkData, 1); + OSMetaClassDeclareReservedUnused( IONetworkData, 2); + OSMetaClassDeclareReservedUnused( IONetworkData, 3); +}; + +#endif /* KERNEL */ + +#endif /* !_IONETWORKDATA_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IONetworkInterface.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IONetworkInterface.h.svn-base new file mode 100644 index 0000000..af02364 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IONetworkInterface.h.svn-base @@ -0,0 +1,1104 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKINTERFACE_H +#define _IONETWORKINTERFACE_H + +/*! @defined kIONetworkInterfaceClass + @abstract The name of the IONetworkInterface class. +*/ + +#define kIONetworkInterfaceClass "IONetworkInterface" + +/*! @defined kIONetworkData + @abstract A property of IONetworkInterface + objects. + @discussion The kIONetworkData property has an OSDictionary value and is a container for the + set of IONetworkData objects managed by the interface. + Each entry in the dictionary is a key/value pair consisting of + the network data name, and an OSDictionary describing the + contents of the network data. +*/ + +#define kIONetworkData "IONetworkData" + +/*! @defined kIOInterfaceType + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceType property has an OSNumber value that specifies the type of + network interface that this interface represents. The type + constants are defined in bsd/net/if_types.h. +*/ + +#define kIOInterfaceType "IOInterfaceType" + +/*! @defined kIOMaxTransferUnit + @abstract A property of IONetworkInterface objects. + @discussion The kIOMaxTransferUnit property has an OSNumber value that specifies the maximum + transfer unit for the interface in bytes. +*/ + +#define kIOMaxTransferUnit "IOMaxTransferUnit" + +/*! @defined kIOMediaAddressLength + @abstract A property of IONetworkInterface objects. + @discussion The kIOMediaAddressLength property has an OSNumber value that specifies the size of the + media address in bytes. +*/ + +#define kIOMediaAddressLength "IOMediaAddressLength" + +/*! @defined kIOMediaHeaderLength + @abstract A property of IONetworkInterface objects. + @discussion The kIOMediaHeaderLength property has an OSNumber value that specifies the size of the + media header in bytes. +*/ + +#define kIOMediaHeaderLength "IOMediaHeaderLength" + +/*! @defined kIOInterfaceFlags + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceFlags property has an OSNumber value that specifies the current value + of the interface flags. The flag constants are defined in + bsd/net/if.h. +*/ + +#define kIOInterfaceFlags "IOInterfaceFlags" + +/*! @defined kIOInterfaceExtraFlags + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceExtraFlags property has an OSNumber value that specifies the current + value of the interface extra flags. The extra flag constants are + defined in bsd/net/if.h. +*/ + +#define kIOInterfaceExtraFlags "IOInterfaceExtraFlags" + +/*! @defined kIOInterfaceUnit + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceUnit property has an OSNumber value that describes the unit number + assigned to the interface object. +*/ + +#define kIOInterfaceUnit "IOInterfaceUnit" + +/*! @defined kIOInterfaceState + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceState property has an OSNumber value that describes the current state + of the interface object. This property is not exported to BSD via + the ifnet structure. +*/ + +#define kIOInterfaceState "IOInterfaceState" + +/*! @defined kIOInterfaceNamePrefix + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceNamePrefix property has an OSString value that describes the string + prefix for the BSD name assigned to the interface. +*/ + +#define kIOInterfaceNamePrefix "IOInterfaceNamePrefix" + +/*! @defined kIOPrimaryInterface + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceNamePrefix property has an OSBoolean value that describes whether the + interface is the primary or the built-in network interface. +*/ + +#define kIOPrimaryInterface "IOPrimaryInterface" + +/*! @defined kIOBuiltin + @abstract kIOBuiltin is a property of IONetworkInterface + objects. It has an OSBoolean value. + @discussion The kIOBuiltin property describes whether the + interface is built-in. +*/ + +#define kIOBuiltin "IOBuiltin" + +/*! @defined kIOLocation + @abstract kIOLocation is a property of IONetworkInterface + objects. It has an OSString value. + @discussion The kIOLocation property describes the physical + location of built-in interfaces. +*/ + +#define kIOLocation "IOLocation" + +/*! @enum InterfaceObjectStates + @discussion Constants used to encode the state of the interface object. + @constant kIONetworkInterfaceRegisteredState The interface object has + registered with the data link layer. + @constant kIONetworkInterfaceOpenedState One or more clients have an + open on the interface object. + @constant kIONetworkInterfaceDisabledState The interface is temporarily + unable to service its clients. This will occur when the network + controller that is servicing the interface has entered a low power + state that renders it unusable. +*/ + +enum { + kIONetworkInterfaceRegisteredState = 0x1, + kIONetworkInterfaceOpenedState = 0x2, + kIONetworkInterfaceDisabledState = 0x4 +}; + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include +#include + +class IONetworkController; +class IONetworkStack; +class IOCommandGate; + +/*! @typedef IOOutputAction + @discussion Prototype for an output packet handler that will process + all outbound packets sent to the interface from the data link layer. + An output handler is registered with the interface by calling + registerOutputHandler(). + @param m A packet mbuf. + @param param A parameter for the output request. */ + +typedef UInt32 (OSObject::*IOOutputAction)(mbuf_t, void * param); + +/*! @typedef BPF_FUNC + @discussion Prototype for the BPF tap handler. This will disappear + when the correct DLIL header file is included. */ + +typedef int (*BPF_FUNC)(struct ifnet *, struct mbuf *); + +// Network event types recognized by inputEvent(). +// +enum { + /* DLIL defined event, argument must be a pointer to a + kern_event_msg structure. */ + kIONetworkEventTypeDLIL = 0xff000001, + + /* Link up event, no argument */ + kIONetworkEventTypeLinkUp = 0xff000002, + + /* Link down event, no argument */ + kIONetworkEventTypeLinkDown = 0xff000003, + + /* Wake on LAN support changed, no argument */ + kIONetworkEventWakeOnLANSupportChanged = 0xff000004 +}; + +/*! @class IONetworkInterface + @abstract Abstract class that manages the connection between an IONetworkController and the data link interface layer. + @discussion An IONetworkInterface object manages the connection between + an IONetworkController and the data link interface layer (DLIL). + All interactions between the controller and DLIL must go through an + interface object. Any data structures that are required by DLIL for a + particular interface type shall be allocated and mantained by the + interface object. IONetworkInterface is an abstract class that must be + extended by a concrete subclass to specialize for a particular network + type. + + Although most drivers will allocate a single interface object, + it is possible for multiple interfaces to be attached to a single + controller. This controller driver will be responsible for arbitrating + access among its multiple interface clients. + + IONetworkInterface also maintains a dictionary of IONetworkData + objects containing statistics structures. Controller drivers can + ask for a particular data object by name and update the + statistics counters within directly. This dictionary is added to + the interface's property table and is visible outside of the kernel. +*/ + +class IONetworkInterface : public IOService +{ + OSDeclareAbstractStructors( IONetworkInterface ) + + friend class IONetworkStack; + +private: + IONetworkController * _controller; + ifnet_t _backingIfnet; + IORecursiveLock * _ifLock; + OSSet * _clientSet; + OSNumber * _stateBits; + bpf_packet_func _inputFilterFunc; + bpf_packet_func _outputFilterFunc; + OSObject * _outTarget; + IOOutputAction _outAction; + UInt32 _clientVar[4]; + OSDictionary * _dataDict; + mbuf_t _inputQHead; + mbuf_t _inputQTail; + UInt32 _inputQCount; + + struct ExpansionData { + int unit; + int type; + int mtu; + int flags; + int eflags; + int addrlen; + int hdrlen; + IONetworkStats driverStats; + IONetworkStats lastDriverStats; + struct ifnet_stat_increment_param inputDeltas; + IOLock *detachLock; + char *remote_NMI_pattern; + unsigned int remote_NMI_len; + }; + + ExpansionData * _reserved; + + void _syncFromBackingIfnet() const; + void _syncToBackingIfnet(); + + bool _syncNetworkDataDict(); + bool _setInterfaceProperty(UInt32 value, + UInt32 mask, + UInt32 bytes, + void * addr, + char * name); + + SInt32 syncSIOCSIFMEDIA(IONetworkController * ctlr, struct ifreq * ifr); + SInt32 syncSIOCGIFMEDIA(IONetworkController * ctlr, struct ifreq * ifr, unsigned long cmd); + SInt32 syncSIOCSIFMTU(IONetworkController * ctlr, struct ifreq * ifr); + + static int performGatedCommand(void *, void *, void *, void *, void *); + static errno_t ioctl_shim(ifnet_t ifp, unsigned long cmd, void * data); + static errno_t set_bpf_tap_shim(ifnet_t ifn, bpf_tap_mode mode, bpf_packet_func func); + static int output_shim(ifnet_t ifp, mbuf_t); + void DLIL_INPUT(mbuf_t m_head); + static void detach_shim(ifnet_t ifp); + static void powerChangeHandler(void *, void *, void *); + +public: + +/*! @function isPrimaryInterface + @abstract Queries whether the interface object provided represents + the "primary" network interface for the system. + @result Returns true if the interface provided is the primary inteface, + false otherwise. +*/ + + virtual bool isPrimaryInterface() const; + +/*! @function init + @abstract Initializes an IONetworkInterface object. + @discussion Initializes instance variables, and allocates resources. + @param controller A network controller object that will service + the interface object being initialized. + @result Returns true on success, false otherwise. +*/ + + virtual bool init( IONetworkController * controller ); + +/*! @function isRegistered + @abstract Returns true if the interface has been registered with + the data link layer. + @discussion Once registered, the interface will be assigned a + BSD name (such as en0), and a kIOBSDNameKey property is added to the + property table containing this name. Calling this method performs + the same function as checking for the kIONetworkInterfaceRegisteredState + bit in the value returned by getInterfaceState(). + @result Returns true if interface is registered. Returns false if the data link layer + has no references to this network interface, which implies that either the + interface has yet to attach to the data link layer, or the interface has + been detached. +*/ + + virtual bool isRegistered() const; + +/*! @function getInterfaceState + @abstract Reports the current state of the interface object by returning + the interface state flags. + @result Returns the interface state flags. +*/ + + virtual UInt32 getInterfaceState() const; + +/*! @function matchPropertyTable + @abstract Overrides the implementation in IOService to + implement family-specific matching. + @discussion When the gIOLocationMatchKey property is present in the + dictionary provided, then fail the match unless the kIOBSDNameKey property + is found. This is to prevent a premature match when hunting for a root + device for BSD. The presence of the kIOBSDNameKey property indicates that + the interface has registered with BSD, and is a valid candidate for + matching against the gIOLocationMatchKey property. If the + gIOLocationMatchKey property is absent, then this method will always + return true. + @param table The dictionary of properties to match against. + @param score Pointer to the current driver's probe score, not used. + @result Returns true for a positive match, false otherwise. +*/ + + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + +/*! @function getController + @abstract Returns the provider, an IONetworkController object, that + is servicing this interface object. + @discussion This is the same controller object that was supplied as + an argument to the init() method. + @result Returns the IONetworkController object that is providing service to + this interface object. +*/ + + virtual IONetworkController * getController() const; + +/*! @function inputPacket + @abstract Submits a single packet received from the network to the data link layer. + @discussion This method is called by the network controller to submit a single packet + received from the network to the data link layer. The packet received by this method may be added to an input + queue on the interface object, which the controller can use to postpone + the packet handoff to the upper layers, until all received packets have + been transferred to the input queue. A subsequent call to flushInputQueue(), + will transfer the entire contents of the queue to the data link layer, + by making a single call to dlil_input(). Other methods that can be used + to manage the input queue are flushInputQueue() and clearInputQueue(). + This input queue is not protected by a lock. Access to the queue by the + controller must be serialized, otherwise its use must be avoided. + @param m The mbuf containing the received packet. + @param length Specify the size of the received packet in the mbuf. + The mbuf length fields are updated with this value. If zero, + then the mbuf length fields are not updated. + @param options Options defined by inputPacket() that the caller + can use to specify this method call. + @param param A parameter provided by the caller. Not used by + IONetworkInterface. + @result Returns the number of packets that were submitted to the data link layer, + or 0 if the packet was queued. +*/ + + virtual UInt32 inputPacket(mbuf_t, + UInt32 length = 0, + IOOptionBits options = 0, + void * param = 0); + +/*! @enum InputOptionQueuePacket + @discussion The option bits that can be specified + in the options argument when calling inputPacket(). + @constant kInputOptionQueuePacket Keep the packet provided in the + input packet queue. No packets are sent to the data link layers, + and the caller's thread will not venture outside the interface + object. Calls to inputPacket() must be serialized. +*/ + + enum { + kInputOptionQueuePacket = 0x1 + }; + +/*! @function flushInputQueue + @abstract Sends all packets held in the input queue to the data + link layer. + @discussion Remove all packets from the input queue and + send them to the data link layer by calling dlil_input(). This + method should be used in connection with the inputPacket() method, + to flush the input queue after inputPacket() was used to queue up + some number of received packets. See inputPacket() and clearInputQueue(). + @result Returns the number of packets that were submitted to the data link layer. + May be zero if the queue was empty. +*/ + + virtual UInt32 flushInputQueue(); + +/*! @function clearInputQueue + @abstract Removes and discards all packets in the input queue. + @discussion This method removes all packets from the input queue and + releases them back to the free mbuf pool. Also see flushInputQueue(). + @result Returns the number of packets freed. +*/ + + virtual UInt32 clearInputQueue(); + +/*! @function inputEvent + @abstract Sends an event to the data link layer. + @discussion This method can be used by the network controller to + send an event to the data link layer. + @param type A constant describing the event type. + @param data Data associated with the event. + @result Returns true if the event was delivered, false if the event type + specified is invalid, or if the event delivery was unsuccesful. +*/ + + virtual bool inputEvent(UInt32 type, void * data); + +/*! @function registerOutputHandler + @abstract Registers a target/action to handle output packets. + @discussion The interface object will forward all output packets, + received from the data link layer, to the output handler registered + through this method. The default target and action are set by the init() + method to the controller, and the handler returned by the controller's + getOutputHandler() method. Once the interface becomes registered with + the data link layer, this method will return false and will reject any + further changes. + @param target Target object that implements the output handler. + @param action The function that will process output packets. + @result Returns true if the target/action provided was accepted, + false otherwise. +*/ + + virtual bool registerOutputHandler(OSObject * target, + IOOutputAction action); + +/*! @function getNamePrefix + @abstract Returns a string containing the prefix to use when + creating a BSD name for this interface. + @discussion The BSD name for each interface object is generated by + concatenating a string returned by this method, with an unique + unit number assigned by IONetworkStack. + A concrete subclass of IONetworkInterface must implement this method + and enforce a consistent name for all of its instances. + @result Returns a pointer to a constant C string. +*/ + + virtual const char * getNamePrefix() const = 0; + +/*! @function getInterfaceType + @abstract Gets the interface type. + @discussion This method returns the value in the if_type field in the ifnet structure. + @result Returns a constant defined in bsd/net/if_types.h header file + that describes the interface type. +*/ + + virtual UInt8 getInterfaceType() const; + +/*! @function getMaxTransferUnit + @abstract Gets the maximum transfer unit for this interface. + @discussion This method returns the value in the if_mtu field in the ifnet structure. + @result Returns the interface MTU size in bytes. +*/ + + virtual UInt32 getMaxTransferUnit() const; + +/*! @function getFlags + @abstract Gets the value of the interface flags. + @discussion This method returns the value in the if_flags field in the ifnet structure. + @result Returns the value of the interface flags. +*/ + + virtual UInt16 getFlags() const; + +/*! @function getExtraFlags + @abstract Gets the value of the interface extra flags. + @discussion This method returns the value in the if_eflags field in the ifnet structure. + @result Returns the value of the interface extra flags. +*/ + + virtual UInt32 getExtraFlags() const; + +/*! @function getMediaAddressLength + @abstract Gets the size of the media (MAC-layer) address. + @discussion This method returns the value in the if_addrlen field in the ifnet structure. + @result Returns the size of the media address in bytes. +*/ + + virtual UInt8 getMediaAddressLength() const; + +/*! @function getMediaHeaderLength + @abstract Gets the size of the media header. + @discussion This method returns the value in the if_hdrlen field in the ifnet structure. + @result Returns the size of the media header in bytes. +*/ + + virtual UInt8 getMediaHeaderLength() const; + +/*! @function getUnitNumber + @abstract Gets the unit number assigned to this interface object. + @discussion This method returns the value in the if_unit field in the ifnet structure. + @result Returns the assigned interface unit number. +*/ + + virtual UInt16 getUnitNumber() const; + +/*! @function addNetworkData + @abstract Adds an IONetworkData object to a dictionary managed by + the interface. + @param aData An IONetworkData object to be added to a dictionary + managed by the interface. This object is retained by the dictionary. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool addNetworkData(IONetworkData * aData); + +/*! @function removeNetworkData + @abstract Removes an entry from the IONetworkData dictionary + managed by the interface. + @discussion This method removes an entry from the IONetworkData dictionary + managed by the interface. The removed object is released. + @param aKey A unique OSSymbol identifying the IONetworkData object + to be removed from the dictionary. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool removeNetworkData(const OSSymbol * aKey); + +/*! @function removeNetworkData + @abstract Removes an entry from the IONetworkData dictionary + managed by the interface. + @discussion This method removes an entry from the IONetworkData dictionary + managed by the interface. The removed object is released. + @param aKey A unique string identifying the IONetworkData object + to be removed from the dictionary. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool removeNetworkData(const char * aKey); + +/*! @function getNetworkData + @abstract Gets an IONetworkData object from the interface that is + associated with the given key. + @param aKey The unique string identifying the IONetworkData object to be + returned to caller. + @result Returns a reference to the matching IONetworkData object, + or 0 if no match was found. +*/ + + virtual IONetworkData * getNetworkData(const char * aKey) const; + +/*! @function getNetworkData + @abstract Gets an IONetworkData object from the interface that is + associated with the given key. + @param aKey The unique OSSymbol identifying the IONetworkData object to be + returned to caller. + @result Returns a reference to the matching IONetworkData object, + or 0 if no match was found. +*/ + + virtual IONetworkData * getNetworkData(const OSSymbol * aKey) const; + +/*! @function setProperties + @abstract Handles a request to set network interface properties from + kernel or non-kernel clients. + @discussion For non-kernel clients, the preferred + access mechanism is through a user client connection. + @param properties An OSDictionary containing a collection of + properties. + @result Returns kIOReturnUnsupported if the interface did not + recognize any of the properties provided. Otherwise, the return + code will be kIOReturnSuccess to indicate no errors, or an + IOReturn error code to indicate that an error occurred while + handling one of the properties. +*/ + + virtual IOReturn setProperties( OSObject * properties ); + + // FIXME - Compatibility methods (to be removed) + IONetworkData * getParameter(const char * aKey) const; + bool setExtendedFlags(UInt32 flags, UInt32 clear = 0); + + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + +/*! @function debuggerRegistered + @abstract Tells the IONetworkInterface that this interface will be used + by the debugger. +*/ + void debuggerRegistered(void); + +protected: + +/*! @function setInterfaceType + @abstract Sest the interface type. + @discussion Both the if_type field in the ifnet structure, and the + kIOInterfaceType property are updated with the value provided. + @param type A constant defined in bsd/net/if_types.h header file + that describes the interface type. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setInterfaceType(UInt8 type); + +/*! @function setMaxTransferUnit + @abstract Sets the maximum transfer unit for this interface. + @discussion Both the if_mtu field in the ifnet structure, and the + kIOMaxTransferUnit property are updated with the value provided. + @param mtu The interface MTU size in bytes. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setMaxTransferUnit(UInt32 mtu); + +/*! @function setFlags + @abstract Performs a read-modify-write operation on the current + interface flags value. + @discussion See bsd/net/if.h header file for the definition of the + flag constants. Both the if_flags field in the ifnet structure, and + the kIOInterfaceFlags property are updated with the value provided. + @param flags The bits that should be set. + @param clear The bits that should be cleared. If 0, then non + of the flags are cleared and the result is formed by OR'ing the + original flags value with the new flags. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setFlags(UInt16 flags, UInt16 clear = 0); + +/*! @function setExtraFlags + @abstract Performs a read-modify-write operation on the current + interface extra flags value. + @discussion See bsd/net/if.h header file for the definition of the + extra flag constants. Both the if_eflags field in the ifnet structure, + and the kIOInterfaceExtraFlags property are updated with the value + provided. + @param flags The bits that should be set. + @param flags The bits that should be set. + @param clear The bits that should be cleared. If 0, then non + of the flags are cleared and the result is formed by OR'ing the + original flags with the new flags. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setExtraFlags(UInt32 flags, UInt32 clear = 0); + +/*! @function setMediaAddressLength + @abstract Sets the size of the media (MAC-layer) address. + @discussion Both the if_addrlen field in the ifnet structure, and the + kIOMediaAddressLength property are updated with the value provided. + @param length The size of the media address in bytes. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setMediaAddressLength(UInt8 length); + +/*! @function setMediaHeaderLength + @abstract Sets the size of the media header. + @discussion Both the if_hdrlen field in the ifnet structure, and the + kIOMediaHeaderLength property are updated with the value provided. + @param length The size of the media header in bytes. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setMediaHeaderLength(UInt8 length); + +/*! @function setUnitNumber + @abstract Assigns a unique unit number to this interface. + @discussion This method is called by IONetworkStack before the + interface is registered with the data link layer, to assign a + unique unit number to the interface object. Both the if_unit field + in the ifnet structure, and the kIOInterfaceUnit property are updated + with the value provided. + @param unit The unit number assigned to this interface object. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setUnitNumber(UInt16 unit); + +/*! @function free + @abstract Frees the IONetworkInterface object. + @discussion Resource allocated by init() are released, and + clearInputQueue() is called to ensure that the input queue is empty. +*/ + + virtual void free(); + +/*! @function handleOpen + @abstract Handles a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. Since the controller is opened by the interface + in a lazy fashion, the interface may also perform an open on the + controller before this method returns. If the controller was opened, + then controllerDidOpen() is called to notify interested subclasses. + Subclasses should not override this method. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result Returns true to accept the client open, false otherwise. +*/ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handles a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). +*/ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function lock + @abstract Takes the network interface lock. + @discussion This method takes the recursive lock that protects the interface + state. All updates to the interface state and to the ifnet structure + must be performed while holding this lock. This call must be balanced + by a subsequent call to unlock(). +*/ + + virtual void lock(); + +/*! @function unlock + @abstract Releases the network interface lock. + @discussion This method releases the recursive lock that protects the interface + state to balance a previous lock() call. +*/ + + virtual void unlock(); + +/*! @function controllerDidOpen + @abstract Sends a notification that the interface has opened the network + controller. + @discussion This method is called by handleOpen() to notify subclasses that the + controller has been opened. The open on the controller is done when + the interface receives the initial open request from a client. + Subclasses can override this method and inspect the controller before + allowing the client open. The implementation in the subclass must first + call the method in super and check the return value. This method is + called with our arbitration lock held, hence issuing I/O to the + controller must be avoided to eliminate the possibility of a + deadlock. + @param controller The controller that was opened. + @result Must return true in order for handleOpen() to accept + the client open. If the return is false, then the controller will be + closed and the client open will be refused. +*/ + + virtual bool controllerDidOpen(IONetworkController * controller); + +/*! @function controllerWillClose + @abstract Sends a notification that the interface will close the network + controller. + @discussion This method is called by handleClose() after receiving a close from the + last client, and just before the controller is closed. Subclasses + can override this method to perform any cleanup action before the + controller is closed. This method is called with our arbitration lock + held, hence issuing I/O to the controller must be avoided to eliminate + the possibility of a deadlock. + @param controller The controller that is about to be closed. +*/ + + virtual void controllerWillClose(IONetworkController * controller); + +/*! @function performCommand + @abstract Handles an ioctl command sent to the network interface. + @discussion This method handles socket ioctl commands sent to the + network interface from DLIL. + IONetworkInterface handles commands that are common for all network + interface types. A subclass of IONetworkInterface may override this + method to override the command handling in IONetworkInterface, or + to extend the command processing to handle additional commands, + and then call super for any commands not handled in the subclass. + The ioctl commands handled by IONetworkInterface are + SIOCGIFMTU (Get interface MTU size), + SIOCSIFMTU (Set interface MTU size), + SIOCSIFMEDIA (Set media), and + SIOCGIFMEDIA (Get media and link status). + @param controller The controller object. + @param cmd The ioctl command code. + @param arg0 Command argument 0. Generally a pointer to an ifnet structure + associated with the interface. + @param arg1 Command argument 1. + @result Returns a BSD return value defined in bsd/sys/errno.h. +*/ + + virtual SInt32 performCommand(IONetworkController * controller, + unsigned long cmd, + void * arg0, + void * arg1); + +public: + +/*! @function getIfnet + @abstract Gets the ifnet_t allocated by the interface object. + @discussion Reveal the interface's ifnet_t. The ifnet_t is managed + primarily by IONetworkInterface, however sub-classes or drivers + can use this method to get a reference to the ifnet_t object for + interface KPI calls. + @result Returns the ifnet_t object that is attached to the datalink layer. +*/ + + virtual ifnet_t getIfnet() const ; + +protected: + +/*! @function initIfnet + @abstract Initializes the ifnet structure given. + @discussion A concrete subclass must override this method and initialize + the ifnet structure given. The implementation in the subclass must call + super before it returns, to allow IONetworkInterface to complete the + initialization, and to insert the BSD shim functions implemented in + IONetworkInterface to the appropriate function pointer fields in the + ifnet structure. IONetworkInterface will call this method during its + init() method. Subclasses are encouraged to use the ifnet accessor + methods to update the ifnet structure when possible, since this will + ensure that properties in the registry will also be updated to reflect + any changes made. + @param ifp Pointer to an ifnet structure obtained earlier through + the getIfnet() method call. + @result Returns true on success, false otherwise. +*/ + + virtual bool initIfnet(struct ifnet * ifp); + +/*! @function handleClientOpen + @abstract Handles a client open on the interface. + @discussion This method is called by handleOpen() to handle an open from a client object. + Unlike handleOpen(), subclasses may override this method to catch an open + request from a client. This method is called with the arbitration lock held. + @param client The client object requesting the open. + @param options Options passed to IONetworkInterface::handleOpen(). + @param argument Argument passed to IONetworkInterface::handleOpen(). + @result Returns true to accept the client open, false to refuse it. +*/ + + virtual bool handleClientOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClientClose + @abstract Handles a client close on the interface. + @discussion This method is called by handleClose() to handle a close from a client object. + Unlike handleClose(), subclasses may override this method to catch a close + reuqest from a client. This method is called with the arbitration lock held. + @param client The client object requesting the close. + @param options Options passed to IONetworkInterface::handleClose(). +*/ + + virtual void handleClientClose(IOService * client, + IOOptionBits options); + +/*! @function newUserClient + @abstract Creates a connection for a non kernel client. + @discussion This method creates a new IOUserClient to service a connection to a + non kernel client. + @param owningTask The mach task requesting the connection. + @param security_id A token representing the access level for the task. + @param type A constant specifying the type of connection to be created. + An IONetworkUserClient object is created if the type specified is + kIONetworkUserClientTypeID. + @param handler The IOUserClient object returned. + @result Returns kIOReturnSuccess if an IONetworkUserClient was created, + kIOReturnNoMemory for a memory allocation error, or + kIOReturnBadArgument if the type specified is unknown. +*/ + + virtual IOReturn newUserClient(task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler); + +/*! @function setInterfaceState + @abstract Updates the interface object state flags. + @discussion The kIOInterfaceState property is updated with the value + provided. + @param flags The bits that should be set. + @param clear The bits that should be cleared. + @result Returns the resulting interface state flags following any changes + made by this method. +*/ + + virtual UInt32 setInterfaceState( UInt32 set, UInt32 clear = 0 ); + +/*! @function powerStateWillChangeTo + @abstract Handles a notification that the network controller servicing + this interface object is about to transition to a new power state. + @discussion This method will call the controllerWillChangePowerState() method + on the controller's work loop context to prepare for the power state change. + Subclasses should not override this method. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return will always be IOPMAckImplied to indicate that the + preparation for the power change has already completed when this method + returns. +*/ + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function powerStateDidChangeTo + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @discussion This method will call the controllerDidChangePowerState() method + on the controller's work loop context to prepare for the power state change. + Subclasses should not override this method. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return will always be IOPMAckImplied to indicate that the + preparation for the power change has already completed when this method + returns. +*/ + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function controllerWillChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object is about to transition to a new power state. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return value is always kIOReturnSuccess. +*/ + + virtual IOReturn controllerWillChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +/*! @function controllerDidChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return value is always kIOReturnSuccess. +*/ + + virtual IOReturn controllerDidChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +public: + /* Override IOService::willTerminate() */ + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ); + + /* Override IOService::serializeProperties() */ + + virtual bool serializeProperties( OSSerialize * s ) const; + +/*! @function attachToDataLinkLayer + @abstract Attaches the network interface to the BSD data link layer. + @discussion This function is called by the family to attach the network + interface managed by an IONetworkInterface to the BSD data link layer. + This call occurs after the interface initialization and setup, and the + assignment of an interface unit number. The family does not implicitly + close the gate on the network controller's work loop when calling this + function. Prior to the data link attachment, services provided by an + IONetworkInterface will be inaccessible to BSD networking, though the + object can be found in the I/O Kit Registry. Subclasses can override + this function to perform interface specific work. + @param options Options for the attach call. None are currently defined. + @param parameter Parameter for the attach call. Not currently used. + @result Returns kIOReturnSuccess on success. +*/ + + virtual IOReturn attachToDataLinkLayer( IOOptionBits options, + void * parameter ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 0); + +/*! @function detachFromDataLinkLayer + @abstract Detaches the network interface from the BSD data link layer. + @discussion This function is called by the family to detach the network + interface managed by an IONetworkInterface from the BSD data link layer. + This call is made when the interface is terminated, before the last close. + The family does not implicitly close the gate on the network controller's + work loop when calling this function. Subclasses can override this function + to perform additional interface specific work. + @param options Options for the detach call. None are currently defined. + @param parameter Parameter for the detach call. Not currently used. +*/ + + virtual void detachFromDataLinkLayer( IOOptionBits options, + void * parameter ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 1); + +protected: +/*! @function feedInputPacketTap + @abstract Feed received packets to the BPF + @discussion This function is called by the family for each inbound packet + to feed it to the BPF function. Interface classes can override if they + need to provide class specific functionality or modifications to the BPF tap. + @param mbuf Pointer to the packet. +*/ + virtual void feedPacketInputTap(mbuf_t); + + OSMetaClassDeclareReservedUsed( IONetworkInterface, 2); + +/*! @function feedOutputPacketTap + @abstract Feed sent packets to the BPF + @discussion This function is called by the family for each outbound packet + to feed it to the BPF function. Interface classes can override if they + need to provide class specific functionality or modifications to the BPF tap. + @param mbuf Pointer to the packet. +*/ + virtual void feedPacketOutputTap(mbuf_t); + + OSMetaClassDeclareReservedUsed( IONetworkInterface, 3); + + virtual bool initIfnetParams(struct ifnet_init_params *params); + OSMetaClassDeclareReservedUsed( IONetworkInterface, 4); + +public: + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkInterface, 5); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 6); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 7); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 8); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 9); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 10); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 11); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 12); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 13); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 14); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 15); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IONETWORKINTERFACE_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IONetworkMedium.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IONetworkMedium.h.svn-base new file mode 100644 index 0000000..2a64f3d --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IONetworkMedium.h.svn-base @@ -0,0 +1,426 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKMEDIUM_H +#define _IONETWORKMEDIUM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/*! @typedef IOMediumType + @discussion A 32-bit value divided into fields which describes + a single medium type. */ + +typedef UInt32 IOMediumType; + +/*! @defined kIOMediumType + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumType property is an OSNumber object that describes the type of + medium that this object represents. +*/ + +#define kIOMediumType "Type" + +/*! @defined kIOMediumFlags + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumFlags property is an OSNumber object that describes a set of + attributes assigned to the medium. +*/ + +#define kIOMediumFlags "Flags" + +/*! @defined kIOMediumSpeed + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumSpeed property is an OSNumber object that describes the maximum link + speed supported by the medium in bits per second. +*/ + +#define kIOMediumSpeed "Speed" + +/*! @defined kIOMediumIndex + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumIndex property is an OSNumber object that describes an index assigned + by the owner of the medium object. Its interpretation is driver + specific. +*/ + +#define kIOMediumIndex "Index" + +//=========================================================================== +// Medium Type (IOMediumType). +// +// The medium type is encoded by a 32-bit value. The definitions of +// the fields and the encoding for each field is adapted from FreeBSD. +// +// Bits Definition +// ------------------- +// 4-0 medium subtype +// 7-5 network type +// 15-8 network specific options +// 19-16 reserved +// 27-20 common options +// 31-28 instance number + +// Ethernet. +// +enum { + kIOMediumEthernet = IFM_ETHER, + kIOMediumEthernetAuto = ( IFM_AUTO | IFM_ETHER ), + kIOMediumEthernetManual = ( IFM_MANUAL | IFM_ETHER ), + kIOMediumEthernetNone = ( IFM_NONE | IFM_ETHER ), + kIOMediumEthernet10BaseT = ( IFM_10_T | IFM_ETHER ), + kIOMediumEthernet10Base2 = ( IFM_10_2 | IFM_ETHER ), + kIOMediumEthernet10Base5 = ( IFM_10_5 | IFM_ETHER ), + kIOMediumEthernet100BaseTX = ( IFM_100_TX | IFM_ETHER ), + kIOMediumEthernet100BaseFX = ( IFM_100_FX | IFM_ETHER ), + kIOMediumEthernet100BaseT4 = ( IFM_100_T4 | IFM_ETHER ), + kIOMediumEthernet100BaseVG = ( IFM_100_VG | IFM_ETHER ), + kIOMediumEthernet100BaseT2 = ( IFM_100_T2 | IFM_ETHER ), + kIOMediumEthernet1000BaseSX = ( IFM_1000_SX | IFM_ETHER ), + kIOMediumEthernet10BaseSTP = ( IFM_10_STP | IFM_ETHER ), + kIOMediumEthernet10BaseFL = ( IFM_10_FL | IFM_ETHER ), + kIOMediumEthernet1000BaseLX = ( IFM_1000_LX | IFM_ETHER ), + kIOMediumEthernet1000BaseCX = ( IFM_1000_CX | IFM_ETHER ), + kIOMediumEthernet1000BaseTX = ( IFM_1000_T | IFM_ETHER ), //deprecated- use kIOMediumEthernet1000BaseT instead + kIOMediumEthernet1000BaseT = ( IFM_1000_T | IFM_ETHER ), + kIOMediumEthernetHomePNA1 = ( IFM_HPNA_1 | IFM_ETHER ), + kIOMediumEthernet10GBaseSR = ( IFM_10G_SR | IFM_ETHER ), + kIOMediumEthernet10GBaseLR = ( IFM_10G_LR | IFM_ETHER ), + kIOMediumEthernet10GBaseCX4 = ( IFM_10G_CX4 | IFM_ETHER ), + kIOMediumEthernet10GBaseT = ( IFM_10G_T | IFM_ETHER ) +}; + +// IEEE 802.11 Wireless. +// +enum { + kIOMediumIEEE80211 = IFM_IEEE80211, + kIOMediumIEEE80211Auto = ( IFM_AUTO | IFM_IEEE80211 ), + kIOMediumIEEE80211Manual = ( IFM_MANUAL | IFM_IEEE80211 ), + kIOMediumIEEE80211None = ( IFM_NONE | IFM_IEEE80211 ), + kIOMediumIEEE80211FH1 = ( IFM_IEEE80211_FH1 | IFM_IEEE80211 ), + kIOMediumIEEE80211FH2 = ( IFM_IEEE80211_FH2 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS2 = ( IFM_IEEE80211_DS2 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS5 = ( IFM_IEEE80211_DS5 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS11 = ( IFM_IEEE80211_DS11 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS1 = ( IFM_IEEE80211_DS1 | IFM_IEEE80211 ), + kIOMediumIEEE80211OptionAdhoc = IFM_IEEE80211_ADHOC +}; + +// Common options. +// +enum { + kIOMediumOptionFullDuplex = IFM_FDX, + kIOMediumOptionHalfDuplex = IFM_HDX, + kIOMediumOptionFlowControl = IFM_FLOW, + kIOMediumOptionFlag0 = IFM_FLAG0, + kIOMediumOptionFlag1 = IFM_FLAG1, + kIOMediumOptionFlag2 = IFM_FLAG2, + kIOMediumOptionLoopback = IFM_LOOP +}; + +// Medium type masks. +// +#define kIOMediumSubTypeMask IFM_TMASK +#define kIOMediumNetworkTypeMask IFM_NMASK +#define kIOMediumOptionsMask IFM_OMASK +#define kIOMediumCommonOptionsMask IFM_GMASK +#define kIOMediumInstanceShift IFM_ISHIFT +#define kIOMediumInstanceMask IFM_IMASK + +// Medium type field accessors. +// +#define IOMediumGetSubType(x) ((x) & kIOMediumSubTypeMask) +#define IOMediumGetNetworkType(x) ((x) & kIOMediumNetworkMask) +#define IOMediumGetInstance(x) (((x) & kIOMediumInstanceMask) >> \ + kIOMediumInstanceShift) + +//=========================================================================== +// Medium flags. + + +//=========================================================================== +// Link status bits. +// +enum { + kIONetworkLinkValid = IFM_AVALID, // link status is valid + kIONetworkLinkActive = IFM_ACTIVE // link is up/active. +}; + +#ifdef __cplusplus +} +#endif + +//=========================================================================== +// IONetworkMedium class. + +#ifdef KERNEL + +#include +#include + +/*! @class IONetworkMedium + @abstract An object that encapsulates information about a network + medium (i.e. 10Base-T, or 100Base-T Full Duplex). + @discussion The main purpose of + this object is for a network driver to advertise its media capability, + through a collection of IONetworkMedium objects stored in a dictionary + in its property table. IONetworkMedium supports serialization, and will + encode its properties in the form of a dictionary to the serialization + stream when instructed. This will allow a user-space application to + browse the set of media types supported by the controller. +*/ + +class IONetworkMedium : public OSObject +{ + OSDeclareDefaultStructors( IONetworkMedium ) + +protected: + IOMediumType _type; + UInt32 _flags; + UInt64 _speed; + UInt32 _index; + const OSSymbol * _name; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + + +/*! @function free + @abstract Frees the IONetworkMedium object. +*/ + + virtual void free(); + +public: + +/*! @function nameForType + @abstract Creates a name that describes a medium type. + @discussion Given a medium type, creates an OSymbol object that + describes the medium type. There is a 1-to-1 mapping between the + medium type, and the medium name created by this method. The caller + is responsible for releasing the OSSymbol object returned. + @param type A medium type. See IONetworkMedium.h for type encoding. + @result Returns an OSSymbol object is created based on the type provided. +*/ + + static const OSSymbol * nameForType(IOMediumType type); + +/*! @function addMedium + @abstract Adds an IONetworkMedium object to a dictionary. + @discussion A helper function to add an IONetworkMedium object to a + given dictionary. The name of the medium is used as the key for the + new dictionary entry. + @param dict An OSDictionary object where the medium object should be + added as a new entry. + @param medium The IONetworkMedium object to add to the dictionary. + @result Returns true on success, false otherwise. +*/ + + static bool addMedium(OSDictionary * dict, + const IONetworkMedium * medium); + +/*! @function removeMedium + @abstract Removes an IONetworkMedium object from a dictionary. + @discussion A helper function to remove an entry in a dictionary. + @param dict The OSDictionary object where the medium object should be + removed from. + @param medium The name of this medium object is used as the key. +*/ + + static void removeMedium(OSDictionary * dict, + const IONetworkMedium * medium); + +/*! @function getMediumWithType + @abstract Finds a medium object from a dictionary with a given type. + @discussion This method iterates through a dictionary and returns an IONetworkMedium + entry with the given type. An optional mask supplies the don't care bits. + @param dict The dictionary to look for a matching entry. + @param type Search for an entry with this type. + @param mask The don't care bits in IOMediumType. Defaults to 0, which + implies that a perfect match is desired. + @result Returns the first matching IONetworkMedium entry found, + or 0 if no match was found. +*/ + + static IONetworkMedium * getMediumWithType(const OSDictionary * dict, + IOMediumType type, + IOMediumType mask = 0); + +/*! @function getMediumWithIndex + @abstract Finds a medium object from a dictionary with a given index. + @discussion This method iterates through a dictionary and returns an IONetworkMedium + entry with the given index. An optional mask supplies the don't care bits. + @param dict The dictionary to look for a matching entry. + @param index Search for an entry with the given index. + @param mask The don't care bits in index. Defaults to 0, which + implies that a perfect match is desired. + @result Returns the first matching IONetworkMedium entry found, + or 0 if no match was found. +*/ + + static IONetworkMedium * getMediumWithIndex(const OSDictionary * dict, + UInt32 index, + UInt32 mask = 0); + +/*! @function init + @abstract Initializes an IONetworkMedium object. + @param type The medium type, this value is encoded with bits defined in + IONetworkMedium.h. + @param speed The maximum (or the only) link speed supported over this + medium in units of bits per second. + @param flags An optional flag for the medium object. + See IONetworkMedium.h for defined flags. + @param index An optional index number assigned by the owner. + Drivers can use this to store an index to a media table in + the driver, or it may map to a driver-defined media type. + @param name An optional name assigned to this medium object. If 0, + then a name will be created based on the medium type by + calling IONetworkMedium::nameForType(). Since the name of + the medium is used as a key when inserted into a dictionary, + the name chosen must be unique within the scope of the owner. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(IOMediumType type, + UInt64 speed, + UInt32 flags = 0, + UInt32 index = 0, + const char * name = 0); + +/*! @function medium + @abstract Factory method that allocates and initializes an IONetworkMedium object. + @param type The medium type, this value is encoded with bits defined in + IONetworkMedium.h. + @param speed The maximum (or the only) link speed supported over this + medium in units of bits per second. + @param flags An optional flag for the medium object. + See IONetworkMedium.h for defined flags. + @param index An optional index number assigned by the owner. + Drivers can use this to store an index to a media table in + the driver, or it may map to a driver-defined media type. + @param name An optional name assigned to this medium object. If 0, + then a name will be created based on the medium type by + calling IONetworkMedium::nameForType(). Since the name of + the medium is used as a key when inserted into a dictionary, + the name chosen must be unique within the scope of the owner. + @result Returns an IONetworkMedium instance on success, or 0 otherwise. +*/ + + static IONetworkMedium * medium(IOMediumType type, + UInt64 speed, + UInt32 flags = 0, + UInt32 index = 0, + const char * name = 0); + +/*! @function getType + @result Returns the medium type assigned to this medium object. +*/ + + virtual IOMediumType getType() const; + +/*! @function getSpeed + @result Returns the maximum link speed supported by this medium. +*/ + + virtual UInt64 getSpeed() const; + +/*! @function getFlags + @result Returns the medium flags. +*/ + + virtual UInt32 getFlags() const; + +/*! @function getIndex + @result Returns the assigned medium index. +*/ + + virtual UInt32 getIndex() const; + +/*! @function getName + @result Returns the name assigned to this medium object. +*/ + + virtual const OSSymbol * getName() const; + +/*! @function getKey + @result Returns the key to use for this medium object. This key should be + used when this object is added to a dictionary. Same as getName(). +*/ + + virtual const OSSymbol * getKey() const; + +/*! @function isEqualTo + @abstract Tests for equality between two IONetworkMedium objects. + @discussion Two IONetworkMedium objects are considered equal if + they have similar properties assigned to them during initialization. + @param medium An IONetworkMedium to test against the IONetworkMedium + object being called. + @result Returns true if equal, false otherwise. +*/ + + virtual bool isEqualTo(const IONetworkMedium * medium) const; + +/*! @function isEqualTo + @abstract Tests for equality between a IONetworkMedium object and an + OSObject. + @discussion The OSObject is considered equal to the IONetworkMedium + object if the OSObject is an IONetworkMedium, and they have + similar properties assigned to them during initialization. + @param obj An OSObject to test against an IONetworkMedium object. + @result Returns true if equal, false otherwise. +*/ + + virtual bool isEqualTo(const OSMetaClassBase * obj) const; + +/*! @function serialize + @abstract Serializes the IONetworkMedium object. + @discussion A dictionary is created containing the properties + assigned to this medium object, and this dictionary is then + serialized using the OSSerialize object provided. + @param s An OSSerialize object. + @result Returns true on success, false otherwise. +*/ + + virtual bool serialize(OSSerialize * s) const; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkMedium, 0); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 1); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 2); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 3); +}; + +// Translate getKey() to getName(). +// +inline const OSSymbol * IONetworkMedium::getKey() const +{ + return getName(); +} + +#endif /* KERNEL */ + +#endif /* !_IONETWORKMEDIUM_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IONetworkStats.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IONetworkStats.h.svn-base new file mode 100644 index 0000000..f6e6f9f --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IONetworkStats.h.svn-base @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKSTATS_H +#define _IONETWORKSTATS_H + +/*! @header IONetworkStats.h + @discussion Generic network statistics. */ + +//------------------------------------------------------------------------ +// Generic network statistics. Common to all network interfaces. +// +// WARNING: This structure must match the statistics field in +// ifnet->if_data. This structure will overlay a portion of ifnet. + +/*! @typedef IONetworkStats + @discussion Generic network statistics structure. + @field inputPackets count input packets. + @field inputErrors count input errors. + @field outputPackets count output packets. + @field outputErrors count output errors. + @field collisions count collisions on CDMA networks. */ + +typedef struct { + UInt32 inputPackets; + UInt32 inputErrors; + UInt32 outputPackets; + UInt32 outputErrors; + UInt32 collisions; +} IONetworkStats; + +/*! @defined kIONetworkStatsKey + @discussion Defines the name of an IONetworkData that contains + an IONetworkStats. */ + +#define kIONetworkStatsKey "IONetworkStatsKey" + +//------------------------------------------------------------------------ +// Output queue statistics. + +/*! @typedef IOOutputQueueStats + @discussion Statistics recorded by IOOutputQueue objects. + @field capacity queue capacity. + @field size current size of the queue. + @field peakSize peak size of the queue. + @field dropCount number of packets dropped. + @field outputCount number of output packets. + @field retryCount number of retries. + @field stallCount number of queue stalls. */ + +typedef struct { + UInt32 capacity; + UInt32 size; + UInt32 peakSize; + UInt32 dropCount; + UInt32 outputCount; + UInt32 retryCount; + UInt32 stallCount; + UInt32 reserved[4]; +} IOOutputQueueStats; + +/*! @defined kIOOutputQueueStatsKey + @discussion Defines the name of an IONetworkData that contains + an IOOutputQueueStats. */ + +#define kIOOutputQueueStatsKey "IOOutputQueueStatsKey" + +#endif /* !_IONETWORKSTATS_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOOutputQueue.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOOutputQueue.h.svn-base new file mode 100644 index 0000000..cb40702 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOOutputQueue.h.svn-base @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOOUTPUTQUEUE_H +#define _IOOUTPUTQUEUE_H + +#include + +// Forward declarations. +// +struct mbuf; +class IONetworkData; + +// FIXME - We do not want the enqueue/dequeue macros defined in queue.h. +// +#undef enqueue(queue,elt) +#undef dequeue(queue) + +// FIXME - Belongs in IOBasicOutputQueue.h +// +/*! @enum OutputPacketStatus + @abstract The status of the packet sent to the target. + @constant kIOOutputStatusMask Define the status field in the return code. + @constant kIOOutputStatusAccept Packet was accepted by the target. + @constant kIOOutputStatusDropped Packet accepted, but was also dropped. + @constant kIOOutputStatusRetry Target ran out of resources, and is unable + to accept the packet. The ownership of the packet reverts back to the + queue. +*/ + +enum { + kIOOutputStatusMask = 0x00ff, + kIOOutputStatusAccepted = 0x0000, + kIOOutputStatusDropped = 0x0001, + kIOOutputStatusRetry = 0x0002 +}; + +/*! @enum OutputCommands + @abstract A command requested by the target. + @constant kIOOutputCommandMask Define the command field in the return code. + @constant kIOOutputCommandNone No command. + @constant kIOOutputCommandStall A command to stall the queue. +*/ + +enum { + kIOOutputCommandMask = 0xff00, + kIOOutputCommandNone = 0x0000, + kIOOutputCommandStall = 0x0100 +}; + +/*! @enum OutputHandlerReturnCodes + @abstract Common return codes returned by the target's output handler. + @constant kIOReturnOutputSuccess Packet was accepted. + @constant kIOReturnOutputDropped Packet was dropped. + @constant kIOReturnOutputStall Stall the queue and retry the same packet + when the queue is restarted. +*/ + +enum { + kIOReturnOutputSuccess = (kIOOutputStatusAccepted | kIOOutputCommandNone), + kIOReturnOutputDropped = (kIOOutputStatusDropped | kIOOutputCommandNone), + kIOReturnOutputStall = (kIOOutputStatusRetry | kIOOutputCommandStall) +}; + +/*! @class IOOutputQueue + @abstract A packet queue that supports multiple producers and a single + consumer. + @discussion Each producer, or a client thread, will deliver a chain of packets + to the queue. A single consumer will remove packets from the queue one at a + time and forward it to the registered target/action. This object may be used + by an IONetworkController on the output (transmit) side to handle the output + packet flow downstream from an IONetworkInterface, and then call the driver's + output function. IOOutputQueue is an abstract class that provides an interface + for its subclasses. Concrete subclasses will complete the implementation, and + specify the context that the target is called for packets removed from + the queue. +*/ + +class IOOutputQueue : public OSObject +{ + OSDeclareAbstractStructors( IOOutputQueue ) + +private: + + static void runServiceThread(thread_call_param_t, thread_call_param_t); + +protected: + + thread_call_t _callEntry; // callout entry structure. + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + + +/*! @function init + @abstract Initializes an IOOutputQueue object. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(); + +/*! @function free + @abstract Frees the IOOutputQueue object. + @discussion Release allocated resources, then call super::free(). +*/ + + virtual void free(); + +/*! @function scheduleServiceThread + @abstract Schedules a service thread callout. + @discussion This method can be called by service() to schedule + a thread that will call serviceThread() when it starts running. + @param param A parameter to pass to the serviceThread() method. + @result Returns true if a thread callout was scheduled, false otherwise. +*/ + + virtual bool scheduleServiceThread(void * param); + +/*! @function cancelServiceThread + @abstract Cancels any pending service thread callout. + @result Returns true if a previously scheduled thread callout was canceled, + false otherwise. +*/ + + virtual bool cancelServiceThread(); + +/*! @function serviceThread + @abstract Method called by the scheduled service thread when it + starts to run. + @discussion Must be implemented by a subclass that calls + scheduleServiceThread(). The default implementation does nothing. + @param param A parameter that was given to scheduleServiceThread() + when the service thread was scheduled. +*/ + + virtual void serviceThread(void * param); + +public: + +/*! @function start + @abstract Starts up the queue. + @discussion This method is called by the target to start the queue. This will allow + packets to be removed from the queue, then delivered to the target. + @result Returns true if the queue was started successfully, false otherwise. +*/ + + virtual bool start() = 0; + +/*! @function stop + @abstract Stops the queue. + @discussion Stop the queue and prevent it from sending packets to its + target. + @result Returns the previous running state of the queue, + true if the queue was running, false if the queue was already stopped. +*/ + + virtual bool stop() = 0; + +/*! @function service + @abstract Services the queue. + @discussion Manage the queue after it has been started. + @param options Options for the service request. + @result Returns a return value to indicate the service result. +*/ + + virtual bool service(IOOptionBits options = 0) = 0; + +/*! @function flush + @abstract Drops and frees all packets currently held by the queue. + @result Returns the number of packets that were dropped and freed. +*/ + + virtual UInt32 flush() = 0; + +/*! @function setCapacity + @abstract Changes the number of packets that the queue can hold + before it begins to drop excess packets. + @param capacity The new desired capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity) = 0; + +/*! @function getCapacity + @abstract Gets the number of packets that the queue can hold. + @discussion The queue will begin to drop incoming packets when the + size of queue reaches its capacity. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const = 0; + +/*! @function getSize + @abstract Gets the number of packets currently held in the queue. + @result Returns the size of the queue. +*/ + + virtual UInt32 getSize() const = 0; + +/*! @function enqueue + @abstract Adds a packet, or a chain of packets, to the queue. + @discussion This method is called by a client to add a packet, or a chain of packets, + to the queue. A packet is described by an mbuf chain, while a chain + of packets is constructed by linking multiple mbuf chains via the + m_nextpkt field. + @param m A single packet, or a chain of packets. + @param param A parameter provided by the caller. + @result Returns a return code. +*/ + + virtual UInt32 enqueue(mbuf_t m, void * param) = 0; + +/*! @function getOutputHandler + @abstract Returns the address of a function that is designated to handle + incoming packets sent to the queue object. + @result Returns the address of the enqueue() method. +*/ + + virtual IOOutputAction getOutputHandler() const; + +/*! @function getStatisticsData + @abstract Returns an IONetworkData object containing statistics counters + updated by the queue. + @result Returns an IONetworkData object. This implementation will always return + 0. +*/ + + virtual IONetworkData * getStatisticsData() const; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOOutputQueue, 0); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 1); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 2); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 3); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 4); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 5); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 6); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 7); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 8); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 9); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 10); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 11); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 12); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 13); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 14); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 15); +}; + +#endif /* !_IOOUTPUTQUEUE_H */ diff --git a/i386/include/IOKit/network/.svn/text-base/IOPacketQueue.h.svn-base b/i386/include/IOKit/network/.svn/text-base/IOPacketQueue.h.svn-base new file mode 100644 index 0000000..88d8c21 --- /dev/null +++ b/i386/include/IOKit/network/.svn/text-base/IOPacketQueue.h.svn-base @@ -0,0 +1,290 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPACKETQUEUE_H +#define _IOPACKETQUEUE_H + +#include +#include +extern "C" { +#include +} +// Forward declarations. +// +struct mbuf; +struct IOMbufQueue; + +// We do not want the enqueue/dequeue macros defined in queue.h. +// +// #warning queue.h should not be included +#undef enqueue(queue,elt) +#undef dequeue(queue) + +/*! @class IOPacketQueue + @abstract Implements a bounded FIFO queue of mbuf packets. + @discussion Packets are + removed from the head of the queue (dequeue), and new packets are added + to the tail of the queue (enqueue). A spinlock is used to synchronize + access to the queue between methods that have a "lock" prefix. +*/ + +class IOPacketQueue : public OSObject +{ + OSDeclareDefaultStructors( IOPacketQueue ) + +protected: + IOMbufQueue * _queue; // mbuf queue + IOSimpleLock * _lock; // spinlock for synchronized methods + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + +/*! @function free + @abstract Frees the IOPacketQueue object. + @discussion All packets held by the queue are released back to the free + pool, resource are deallocated, then super::free() is called. +*/ + + virtual void free(); + +/*! @var IOPacketQueueDefaultCapacity + @abstract Describes the default capacity of the + queue object. + @discussion The capacity is only observed by the enqueue() method. + Therefore, it is possible for the size of the queue to exceed its + capacity when other methods, such as prepend(), are used to add packets + to the queue. +*/ + + static const UInt32 IOPacketQueueDefaultCapacity = 100; + +public: + +/*! @function withCapacity + @abstract Factory method that constructs and initializes an + IOPacketQueue object. + @param capacity The initial capacity of the queue object. Can be + later changed by calling the setCapacity() method. + @result Returns an IOPacketQueue instance on success, or 0 otherwise. +*/ + + static IOPacketQueue * withCapacity(UInt32 capacity = + IOPacketQueueDefaultCapacity); + +/*! @function initWithCapacity + @abstract Initializes an IOPacketQueue object. + @discussion This method initializes an IOPacketQueue object with the given capacity. + @param capacity The initial capacity of the queue. Can be later changed + by calling the setCapacity() method. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool initWithCapacity(UInt32 capacity = + IOPacketQueueDefaultCapacity); + +/*! @function getSize + @abstract Gets the size of the queue. + @result Returns the number of packets currently held by the queue. +*/ + + virtual UInt32 getSize() const; + +/*! @function setCapacity + @abstract Changes the capacity of the queue. + @param capacity The new capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity); + +/*! @function getCapacity + @abstract Gets the current capacity of the queue. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const; + +/*! @function peek + @abstract Examines the packet at the head of the queue without + removing it from the queue. + @discussion A following call to peek() or dequeue() will return + the same packet. The caller must never modify the mbuf packet returned. + @result Returns the packet at the head of the queue. +*/ + + virtual const mbuf_t peek() const; + +/*! @function prepend + @abstract Adds a chain of packets to the head of the queue. + @param m A chain of packets to add to the head of the queue. +*/ + + virtual void prepend(mbuf_t m); + +/*! @function prepend + @abstract Removes all packets from the specified queue, and adds them + to the head of this queue. + @param queue The source IOPacketQueue object containing the packets to + be transferred. +*/ + + virtual void prepend(IOPacketQueue * queue); + +/*! @function lockPrepend + @abstract Adds a chain of packets to the head of a synchronized queue. + @discussion A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the head of the queue. + @result Always returns true. +*/ + + virtual void lockPrepend(mbuf_t m); + +/*! @function enqueue + @abstract Adds a chain of packets to the tail of the queue. + @discussion Packets are not added if the size of the queue has reached + its capacity. + @param m A chain of packets to add to the tail of the queue. + @result Returns true on success, or false to indicate over-capacity and refusal + to accept the packet chain provided. +*/ + + virtual bool enqueue(mbuf_t m); + +/*! @function enqueue + @abstract Removes all packets from the specified queue, and adds them + to the tail of this queue. + @param queue The source IOPacketQueue object containing the packets to + be transferred. + @result Always returns true. +*/ + + virtual bool enqueue(IOPacketQueue * queue); + +/*! @function enqueueWithDrop + @abstract Adds a chain of packets to the tail of the queue. + @discussion Packets are + dropped if the size of the queue has reached its capacity. + @param m A chain of packets to add to the tail of the queue. + @result Returns the number of packets dropped and freed by the queue. +*/ + + virtual UInt32 enqueueWithDrop(mbuf_t m); + +/*! @function lockEnqueue + @abstract Adds a chain of packets to the tail of a synchronized queue. + @discussion Packets are not added if the size of the queue has reached + its capacity. A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the tail of the queue. + @result Returns true on success, or false to indicate over-capacity and refusal + to accept the packet chain provided. +*/ + + virtual bool lockEnqueue(mbuf_t m); + +/*! @function lockEnqueueWithDrop + @abstract Adds a chain of packets to the tail of a synchronized queue. + @discussion Packets are dropped if the size of the queue has reached its capacity. A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the tail of the queue. + @result Returns the number of packets dropped and freed by the queue. +*/ + + virtual UInt32 lockEnqueueWithDrop(mbuf_t m); + +/*! @function dequeue + @abstract Removes a single packet from the head of the queue. + @result Returns a packet removed from the head of the queue, or NULL if the + queue was empty. +*/ + + virtual mbuf_t dequeue(); + +/*! @function lockDequeue + @abstract Removes a single packet from the head of a synchronized queue. + @discussion A spinlock is used to synchronize access to the queue. + @result Returns a packet removed from the head of the queue, or NULL if the + queue was empty. +*/ + + virtual mbuf_t lockDequeue(); + +/*! @function dequeueAll + @abstract Removes all packets from the queue and returns the head of the + packet chain. + @discussion The size of the queue is cleared to zero. + @result Returns the head of a packet chain linking all packets that were held + in the queue, or NULL if the queue was empty. +*/ + + virtual mbuf_t dequeueAll(); + +/*! @function lockDequeueAll + @abstract Removes all packets from a synchronized queue and returns the + head of the packet chain. + @discussion The size of the queue is cleared to zero. A spinlock is used + to synchronize access to the queue. + @result Returns the head of a packet chain linking all packets that were held + in the queue, or NULL if the queue was empty. +*/ + + virtual mbuf_t lockDequeueAll(); + +/*! @function flush + @abstract Frees all packets currently held in the queue and releases them + back to the free mbuf pool. + @discussion The size of the queue is cleared to zero. + @result Returns the number of packets freed. +*/ + + virtual UInt32 flush(); + +/*! @function lockFlush + @abstract Frees all packets currently held in a synchronized queue and + releases them back to the free mbuf pool. + @discussion The size of the queue is cleared to zero. A spinlock is used + to synchronize access to the queue. + @result Returns the number of packets freed. +*/ + + virtual UInt32 lockFlush(); + + // Virtual Pad functions + OSMetaClassDeclareReservedUnused( IOPacketQueue, 0); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 1); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 2); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 3); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 4); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 5); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 6); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 7); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 8); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 9); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 10); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 11); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 12); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 13); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 14); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 15); +}; + +#endif /* !_IOPACKETQUEUE_H */ diff --git a/i386/include/IOKit/network/IOBasicOutputQueue.h b/i386/include/IOKit/network/IOBasicOutputQueue.h new file mode 100644 index 0000000..3519805 --- /dev/null +++ b/i386/include/IOKit/network/IOBasicOutputQueue.h @@ -0,0 +1,319 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOBASICOUTPUTQUEUE_H +#define _IOBASICOUTPUTQUEUE_H + +#include +#include +#include // FIXME - remove + +struct IOMbufQueue; + +/*! @class IOBasicOutputQueue + @abstract A concrete implementation of an IOOutputQueue. + @discussion This object uses a spinlock to protect the packet queue from multiple producers. + A single producer is promoted to become a consumer when the queue is + not active. Otherwise, the producer will simply queue the packet and + return without blocking. + + The flow of packets from the queue to its target can be controlled + by calling methods such as start(), stop(), or service(). The target + is expected to call those methods from a single threaded context, + i.e. the work loop context in a network driver. In addition, the + target must also return a status for every packet delivered by the + consumer thread. This return value is the only mechanism that the + target can use to manage the queue when it is running on the + consumer thread. +*/ + +class IOBasicOutputQueue : public IOOutputQueue +{ + OSDeclareDefaultStructors( IOBasicOutputQueue ) + +private: + static IOReturn dispatchNetworkDataNotification(void * target, + void * param, + IONetworkData * data, + UInt32 type); + + void dequeue(); + +protected: + OSObject * _target; + IOOutputAction _action; + IOOutputQueueStats * _stats; + IONetworkData * _statsData; + IOSimpleLock * _spinlock; + IOMbufQueue * _inQueue; + IOMbufQueue * _queues[2]; + volatile bool _waitDequeueDone; + volatile UInt32 _state; + volatile UInt32 _serviceCount; + +/*! @function serviceThread + @abstract Provides an implementation for the serviceThread() method + defined in IOOutputQueue. + @discussion This method is called by the scheduled service thread when it + starts to run. The service thread is scheduled by service() + to restart a stalled queue when the kServiceAsync option is given. + @param param A parameter that was given to scheduleServiceThread(). + This parameter is not used. +*/ + + virtual void serviceThread(void * param); + +/*! @function output + @abstract Transfers all packets in the mbuf queue to the target. + @param queue A queue of output packets. + @param state Returns a state bit defined by IOBasicOutputQueue that + declares the new state of the queue following this method call. + A kStateStalled is returned if the queue should stall, otherwise 0 + is returned. +*/ + + virtual void output(IOMbufQueue * queue, UInt32 * state); + +/*! @function free + @abstract Frees the IOBasicOutputQueue object. + @discussion This function releases allocated resources, then call super::free(). +*/ + + virtual void free(); + +/*! @function handleNetworkDataAccess + @abstract Handles an external access to the IONetworkData object + returned by getStatisticsData(). + @param data The IONetworkData object being accessed. + @param type Description of the type of access being performed. + @param param An optional parameter for the handler. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn handleNetworkDataAccess(IONetworkData * data, + UInt32 type, + void * param); + +public: + +/*! @function init + @abstract Initializes an IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue, which is usually a subclass of IONetworkController. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(OSObject * target, + IOOutputAction action, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param capacity The initial capacity of the output queue. + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. +*/ + + static IOBasicOutputQueue * withTarget(IONetworkController * target, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOBasicOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param capacity The initial capacity of the output queue. + @result Returns an IOBasicOutputQueue object on success, or 0 otherwise. +*/ + + static IOBasicOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + UInt32 capacity = 0); + +/*! @function enqueue + @abstract Adds a packet, or a chain of packets, + to the queue. + @discussion This method is called by a client to add a packet, or a chain of packets, + to the queue. A packet is described by an mbuf chain, while a chain + of packets is constructed by linking multiple mbuf chains via the + m_nextpkt field. This method can be called by multiple client + threads. + @param m A single packet, or a chain of packets. + @param param A parameter provided by the caller. + @result Always returns 0. +*/ + + virtual UInt32 enqueue(mbuf_t m, void * param); + +/*! @function start + @abstract Starts up the packet flow between the queue and its target. + @discussion Called by the target to start the queue. This will allow + packets to be removed from the queue, and then delivered to the target. + @result Returns true if the queue was started successfully, false otherwise. */ + + virtual bool start(); + +/*! @function stop + @abstract Stops the packet flow between the queue and its target. + @discussion This method stops the queue and prevents it from sending packets to its + target. This call is synchronous and it may block. After this method + returns, the queue will no longer call the registered target/action, + even as new packets are added to the queue. The queue will continue to + absorb new packets until the size of the queue reaches its capacity. + The registered action must never call stop(), or a deadlock will occur. + @result Returns the previous running state of the queue, + true if the queue was running, false if the queue was already stopped. +*/ + + virtual bool stop(); + +/*! @enum ServiceAsync + @abstract The option bits recognized by service(). + @constant kServiceAsync Set this option to service the queue in + an asynchronous manner. The service() call will not block, but a + scheduling latency will be introduced before the queue is serviced. +*/ + + enum { + kServiceAsync = 0x1 + }; + +/*! @function service + @abstract Services a queue that was stalled by the target. + @discussion A target that stalls the queue must call service() when + it becomes ready to accept more packets. Calling this method when the + queue is not stalled is harmless. + @result Returns true if the queue was stalled and there were packets sitting in + the queue awaiting delivery, false otherwise. +*/ + + virtual bool service(IOOptionBits options = 0); + +/*! @function flush + @abstract Drops and frees all packets currently held by the queue. + @discussion To ensure that all packets are removed from the queue, + stop() should be called prior to flush(), to make sure there are + no packets in-flight and being delivered to the target. + @result Returns the number of packets that were dropped and freed. +*/ + + virtual UInt32 flush(); + +/*! @function setCapacity + @abstract Changes the number of packets that the queue can hold + before it begins to drop excess packets. + @param capacity The new desired capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity); + +/*! @function getCapacity + @abstract Gets the number of packets that the queue can hold. + @discussion The queue will begin to drop incoming packets when the + size of the queue reaches its capacity. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const; + +/*! @function getSize + @abstract Gets the number of packets currently held in the queue. + @result Returns the size of the queue. +*/ + + virtual UInt32 getSize() const; + +/*! @function getDropCount + @abstract Gets the number of packets dropped by the queue. + @result Returns the number of packets dropped due to over-capacity, or by + external calls to the flush() method. +*/ + + virtual UInt32 getDropCount(); + +/*! @function getOutputCount + @abstract Gets the number of packets accepted by the target. + @result Returns the number of times that kIOOutputStatusAccepted is returned by + the target. +*/ + + virtual UInt32 getOutputCount(); + +/*! @function getRetryCount + @abstract Gets the number of instances when the target has refused to + accept the packet provided. + @result Returns the number of times that kIOOutputStatusRetry is returned by the + target. +*/ + + virtual UInt32 getRetryCount(); + +/*! @function getStallCount + @abstract Gets the number of instances when the target has stalled the + queue. + @result Returns the number of times that kIOOutputCommandStall is returned by the + target. +*/ + + virtual UInt32 getStallCount(); + +/*! @enum GetStateBits + @abstract The bits in the value returned by getState(). + @constant kStateRunning Set when the queue is running. Calling start() + and stop() will set or clear this bit. + @constant kStateStalled Set when the queue is stalled by the target. + @constant kStateActive Set when a consumer thread is actively removing + packets from the queue and passing them to the target. +*/ + + enum { + kStateRunning = 0x1, + kStateOutputStalled = 0x2, + kStateOutputActive = 0x4, + kStateOutputServiceMask = 0xff00 + }; + +/*! @function getState + @abstract Gets the state of the queue object. + @result Returns the current state of the queue object. +*/ + + virtual UInt32 getState() const; + +/*! @function getStatisticsData + @abstract Returns an IONetworkData object containing statistics counters + updated by the queue. + @result Returns an IONetworkData object. +*/ + + virtual IONetworkData * getStatisticsData() const; +}; + +#endif /* !_IOBASICOUTPUTQUEUE_H */ diff --git a/i386/include/IOKit/network/IOEthernetController.h b/i386/include/IOKit/network/IOEthernetController.h new file mode 100644 index 0000000..c2f85e7 --- /dev/null +++ b/i386/include/IOKit/network/IOEthernetController.h @@ -0,0 +1,502 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOETHERNETCONTROLLER_H +#define _IOETHERNETCONTROLLER_H + +#include + +/*! @defined kIOEthernetControllerClass + @abstract kIOEthernetControllerClass is the name of the + IOEthernetController class. */ + +#define kIOEthernetControllerClass "IOEthernetController" + +/*! @defined kIOEthernetAddressSize + @abstract The number of bytes in an Ethernet hardware address. */ + +#define kIOEthernetAddressSize 6 + +/*! @defined kIOEthernetMaxPacketSize + @abstract The maximum size of an Ethernet packet, including + the FCS bytes. */ + +#define kIOEthernetMaxPacketSize 1518 + +/*! @defined kIOEthernetMinPacketSize + @abstract The minimum size of an Ethernet packet, including + the FCS bytes. */ + +#define kIOEthernetMinPacketSize 64 + +/*! @defined kIOEthernetCRCSize + @abstract The size in bytes of the 32-bit CRC value appended + to the end of each Ethernet frame. */ + +#define kIOEthernetCRCSize 4 + +/*! @defined kIOEthernetWakeOnLANFilterGroup + @abstract kIOEthernetWakeOnLANFilterGroup describes the name assigned + to the Ethernet Wake-On-LAN filter group. This group represents + wake filters that are supported by the controller. */ + +#define kIOEthernetWakeOnLANFilterGroup "IOEthernetWakeOnLANFilterGroup" + +/*! @defined kIOEthernetDisabledWakeOnLANFilterGroup + @abstract kIOEthernetDisabledWakeOnLANFilterGroup describes the name + assigned to the disabled Ethernet Wake-On-LAN filter group. This + group represents wake filters that are currently disabled. + Membership in this group is dynamic. */ + +#define kIOEthernetDisabledWakeOnLANFilterGroup \ + "IOEthernetDisabledWakeOnLANFilterGroup" + +/*! @enum WakeOnLANFilters. + @abstract All filters in the Wake-on-LAN filter group. + @discussion Each filter listed will respond to a network event that + will trigger a system wake-up. + @constant kIOEthernetWakeOnMagicPacket Reception of a Magic Packet. + @constant kIOEthernetWakeOnPacketAddressMatch Reception of a packet + which passes through any of the address filtering mechanisms based + on its destination Ethernet address. This may include unicast, + broadcast, or multicast addresses depending on the current state + and setting of the corresponding packet filters. */ + +enum { + kIOEthernetWakeOnMagicPacket = 0x00000001, + kIOEthernetWakeOnPacketAddressMatch = 0x00000002 +}; + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +struct IOEthernetAddress { + UInt8 bytes[kIOEthernetAddressSize]; +}; + +/*! @const gIOEthernetWakeOnLANFilterGroup + @discussion gIOEthernetWakeOnLANFilterGroup is an OSSymbol object + that contains the name of the Ethernet Wake-on-LAN filter group + defined by kIOEthernetWakeOnLANFilterGroup. */ + +extern const OSSymbol * gIOEthernetWakeOnLANFilterGroup; + +/*! @const gIOEthernetDisabledWakeOnLANFilterGroup + @discussion gIOEthernetDisabledWakeOnLANFilterGroup is an OSSymbol object + that contains the name of the disabled Ethernet Wake-on-LAN filter group + defined by kIOEthernetDisabledWakeOnLANFilterGroup. */ + +extern const OSSymbol * gIOEthernetDisabledWakeOnLANFilterGroup; + +/*! @class IOEthernetController + @abstract Abstract superclass for Ethernet controllers. + @discussion Ethernet controller drivers should subclass IOEthernetController, and implement + or override the hardware specific methods to create an Ethernet driver. + An interface object (an IOEthernetInterface instance) must be + instantiated by the driver, through attachInterface(), to connect + the controller driver to the data link layer. +*/ + +class IOEthernetController : public IONetworkController +{ + OSDeclareAbstractStructors( IOEthernetController ) + +protected: + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +public: + +/*! @function initialize + @abstract IOEthernetController class initializer. + @discussion Creates global OSSymbol objects that are used as keys. */ + + static void initialize(); + +/*! @function init + @abstract Initializes an IOEthernetController object. + @param properties A dictionary object containing a property table + associated with this instance. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(OSDictionary * properties); + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the Ethernet + controller in the given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. When the filter group specified is + gIONetworkFilterGroup, then this method will return a value formed by + a bitwise OR of kIOPacketFilterUnicast, kIOPacketFilterBroadcast, + kIOPacketFilterMulticast, kIOPacketFilterPromiscuous. Otherwise, the + return value will be set to zero (0). Subclasses must override this + method if their filtering capability differs from what is reported by + this default implementation. This method is called from the workloop + context, and the result is published to the I/O Kit Registry. + @param group The name of the filter group. + @param filters Pointer to the mask of supported filters returned by + this method. + @result Returns kIOReturnSuccess. Drivers that override this + method must return kIOReturnSuccess to indicate success, or an error + return code otherwise. +*/ + + virtual IOReturn getPacketFilters(const OSSymbol * group, + UInt32 * filters) const; + +/*! @function enablePacketFilter + @abstract Enables one of the supported packet filters from the + given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call setMulticastMode() or + setPromiscuousMode() when the multicast or the promiscuous filter is to be + enabled. Requests to disable the Unicast or Broadcast filters are handled + silently, without informing the subclass. Subclasses can override this + method to change this default behavior, or to extend it to handle + additional filter types or filter groups. This method call is synchronized + by the workloop's gate. + @param group The name of the filter group containing the filter to be + enabled. + @param aFilter The filter to enable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the enable request. + @result Returns the value returned by setMulticastMode() or setPromiscuousMode() if + either of those two methods are called. Returns kIOReturnSuccess if the filter + specified is kIOPacketFilterUnicast or kIOPacketFilterBroadcast. + Returns kIOReturnUnsupported if the filter group specified is not + gIONetworkFilterGroup. +*/ + + virtual IOReturn enablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0); + +/*! @function disablePacketFilter + @abstract Disables a packet filter that is currently enabled from the + given filter group. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call setMulticastMode() or + setPromiscuousMode() when the multicast or the promiscuous filter is to be + disabled. Requests to disable the Unicast or Broadcast filters are handled + silently, without informing the subclass. Subclasses can override this + method to change this default behavior, or to extend it to handle + additional filter types or filter groups. This method call is synchronized + by the workloop's gate. + @param group The name of the filter group containing the filter to be + disabled. + @param aFilter The filter to disable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the disable request. + @result Returns the value returned by setMulticastMode() or setPromiscuousMode() if + either of those two methods are called. Returns kIOReturnSuccess if the filter + specified is kIOPacketFilterUnicast or kIOPacketFilterBroadcast. + Returns kIOReturnUnsupported if the filter group specified is not + gIONetworkFilterGroup. +*/ + + virtual IOReturn disablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0); + +/*! @function getHardwareAddress + @abstract Gets the Ethernet controller's station address. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call the overloaded form + IOEthernetController::getHardwareAddress() that subclasses are expected + to override. + @param addr The buffer where the controller's hardware address should + be written. + @param inOutAddrBytes The size of the address buffer provided by the + client, and replaced by this method with the actual size of + the hardware address in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn getHardwareAddress(void * addr, + UInt32 * inOutAddrBytes); + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the Ethernet + controller. + @discussion The default implementation of the abstract method inherited + from IONetworkController. This method will call the overloaded form + IOEthernetController::setHardwareAddress() that subclasses are expected + to override. + @param addr The buffer containing the hardware address provided by + the client. + @param addrBytes The size of the address buffer provided by the + client in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn setHardwareAddress(const void * addr, + UInt32 addrBytes); + +/*! @function getMaxPacketSize + @abstract Gets the maximum packet size supported by the Ethernet + controller, including the frame header and FCS. + @param maxSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMaxPacketSize(UInt32 * maxSize) const; + +/*! @function getMinPacketSize + @abstract Gets the minimum packet size supported by the Ethernet + controller, including the frame header and FCS. + @param minSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMinPacketSize(UInt32 * minSize) const; + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the Ethernet + controller in the network filter group. + @param filters Pointer to the return value containing a mask of + supported filters. + @result Returns kIOReturnSuccess. Drivers that override this + method must return kIOReturnSuccess to indicate success, or an error + return code otherwise. +*/ + + virtual IOReturn getPacketFilters(UInt32 * filters) const; + +/*! @function getHardwareAddress + @abstract Gets the Ethernet controller's permanent station address. + @discussion Ethernet drivers must implement this method, by reading the + address from hardware and writing it to the buffer provided. This method + is called from the workloop context. + @param addrP Pointer to an IOEthernetAddress where the hardware address + should be returned. + @result Returns kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn getHardwareAddress(IOEthernetAddress * addrP) = 0; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the Ethernet + controller. + @discussion This method is called in response to a client command to + change the station address used by the Ethernet controller. Implementation + of this method is optional. This method is called from the workloop context. + @param addrP Pointer to an IOEthernetAddress containing the new station + address. + @result The default implementation will always return kIOReturnUnsupported. + If overridden, drivers must return kIOReturnSuccess on success, or an error + return code otherwise. +*/ + + virtual IOReturn setHardwareAddress(const IOEthernetAddress * addrP); + +/*! @function setMulticastMode + @abstract Enables or disables multicast mode. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the multicast filter + identified by kIOPacketFilterMulticast. This method is called from the + workloop context. + @param active True to enable multicast mode, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setMulticastMode(bool active); + +/*! @function setMulticastList + @abstract Sets the list of multicast addresses a multicast filter + should use to match against the destination address of an incoming frame. + @discussion This method sets the list of multicast addresses that the multicast filter + should use to match against the destination address of an incoming frame. + The frame should be accepted when a match occurs. Called when the multicast group membership of an interface + object is changed. Drivers that support kIOPacketFilterMulticast should + override this method and update the hardware multicast filter using the + list of Ethernet addresses provided. Perfect multicast filtering is + preferred if supported by the hardware, in order to reduce the number of + unwanted packets received. If the number of multicast addresses in the + list exceeds what the hardware is capable of supporting, or if perfect + filtering is not supported, then ideally the hardware should be programmed + to perform imperfect filtering, through some form of hash filtering + mechanism. Only as a last resort should the driver enable reception of + all multicast packets to satisfy this request. This method is called + from the workloop context, and only if the driver reports + kIOPacketFilterMulticast support in getPacketFilters(). + @param addrs An array of Ethernet addresses. This argument must be + ignored if the count argument is 0. + @param count The number of Ethernet addresses in the list. This value + will be zero when the list becomes empty. + @result Returns kIOReturnUnsupported. Drivers must return kIOReturnSuccess to + indicate success, or an error return code otherwise. +*/ + + virtual IOReturn setMulticastList(IOEthernetAddress * addrs, + UInt32 count); + +/*! @function setPromiscuousMode + @abstract Enables or disables promiscuous mode. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the promiscuous + filter identified by kIOPacketFilterPromiscuous. This method is + called from the workloop context. + @param active True to enable promiscuous mode, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setPromiscuousMode(bool active); + +/*! @function setWakeOnMagicPacket + @abstract Enables or disables the wake on Magic Packet support. + @discussion Called by enablePacketFilter() or disablePacketFilter() + when there is a change in the activation state of the Wake-on-LAN + filter identified by kIOEthernetWakeOnMagicPacket. This method is + called from the workloop context. + @param active True to enable support for system wake on reception + of a Magic Packet, false to disable it. + @result Returns kIOReturnUnsupported. If overridden, drivers must return + kIOReturnSuccess on success, or an error return code otherwise. +*/ + + virtual IOReturn setWakeOnMagicPacket(bool active); + +protected: + +/*! @function createInterface + @abstract Creates an IOEthernetInterface object. + @discussion This method allocates and returns a new IOEthernetInterface instance. + A subclass of IONetworkController must implement this method and return + a matching interface object. The implementation in IOEthernetController + will return an IOEthernetInterface object. Subclasses of + IOEthernetController, such as Ethernet controller drivers, will have + little reason to override this implementation. + @result Returns a newly allocated and initialized IOEthernetInterface object. +*/ + + virtual IONetworkInterface * createInterface(); + +/*! @function free + @abstract Frees the IOEthernetController instance. + @discussion This method releases resources, and is + then followed by a call to super::free(). */ + + virtual void free(); + +/*! @function publishProperties + @abstract Publishes Ethernet controller properties and capabilities. + @discussion This method publishes Ethernet controller properties to the property + table. For instance, getHardwareAddress() is called to fetch the + hardware address, and the address is then published to the property + table. This method call is synchronized by the workloop's gate, + and must never be called directly by subclasses. + @result Returns true if all properties and capabilities were discovered, + and published successfully, false otherwise. Returning false will + prevent client objects from attaching to the Ethernet controller + since a property that a client relies upon may be missing. +*/ + + virtual bool publishProperties(); + + /*! @function getVlanTagDemand + @abstract Fetch the demand for hardware vlan tag stuffing + for the given packet before it is transmitted on the network. + @discussion A network controller that can insert 802.1Q vlan tags for output + packets must call this method to obtain vlan tag information that it must + insert into the given output packet. + @param packet A mbuf containing a packet that may require vlan tag stuffing. + @param vlanTag After calling, the low order 16 bits contain the 802.1Q priority and + vlan ID tag in host order. The hi-order 16 bits are currently unused and should be ignored. + @result true if vlanTag has been set and should be used. + false if no vlan tag stuffing is required for this packet. */ + + OSMetaClassDeclareReservedUsed( IOEthernetController, 0); + virtual bool getVlanTagDemand(mbuf_t m, UInt32 *vlanTag); + + /*! @function setVlanTag + @abstract Encode a received packet with the vlan tag result reported + by the hardware. + @discussion A network controller that can strip 802.1Q vlan tag information for a + received packet should call this method to encode the result on the + packet, before passing it up towards the protocol stacks. + @param packet A mbuf containing a packet that has had its 802.1q vlan tag stripped by + the hardware. + @param vlanTag A value in host order that contains the 802.1q vlan tag and priority + in the low order 16 bits. The hi order word is currently unused and should be set to 0. */ + + OSMetaClassDeclareReservedUsed( IOEthernetController, 1); + virtual void setVlanTag(mbuf_t m, UInt32 vlanTag); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOEthernetController, 2); + OSMetaClassDeclareReservedUnused( IOEthernetController, 3); + OSMetaClassDeclareReservedUnused( IOEthernetController, 4); + OSMetaClassDeclareReservedUnused( IOEthernetController, 5); + OSMetaClassDeclareReservedUnused( IOEthernetController, 6); + OSMetaClassDeclareReservedUnused( IOEthernetController, 7); + OSMetaClassDeclareReservedUnused( IOEthernetController, 8); + OSMetaClassDeclareReservedUnused( IOEthernetController, 9); + OSMetaClassDeclareReservedUnused( IOEthernetController, 10); + OSMetaClassDeclareReservedUnused( IOEthernetController, 11); + OSMetaClassDeclareReservedUnused( IOEthernetController, 12); + OSMetaClassDeclareReservedUnused( IOEthernetController, 13); + OSMetaClassDeclareReservedUnused( IOEthernetController, 14); + OSMetaClassDeclareReservedUnused( IOEthernetController, 15); + OSMetaClassDeclareReservedUnused( IOEthernetController, 16); + OSMetaClassDeclareReservedUnused( IOEthernetController, 17); + OSMetaClassDeclareReservedUnused( IOEthernetController, 18); + OSMetaClassDeclareReservedUnused( IOEthernetController, 19); + OSMetaClassDeclareReservedUnused( IOEthernetController, 20); + OSMetaClassDeclareReservedUnused( IOEthernetController, 21); + OSMetaClassDeclareReservedUnused( IOEthernetController, 22); + OSMetaClassDeclareReservedUnused( IOEthernetController, 23); + OSMetaClassDeclareReservedUnused( IOEthernetController, 24); + OSMetaClassDeclareReservedUnused( IOEthernetController, 25); + OSMetaClassDeclareReservedUnused( IOEthernetController, 26); + OSMetaClassDeclareReservedUnused( IOEthernetController, 27); + OSMetaClassDeclareReservedUnused( IOEthernetController, 28); + OSMetaClassDeclareReservedUnused( IOEthernetController, 29); + OSMetaClassDeclareReservedUnused( IOEthernetController, 30); + OSMetaClassDeclareReservedUnused( IOEthernetController, 31); +}; + +/* + * FIXME: remove this. + */ +enum { + kIOEnetPromiscuousModeOff = false, + kIOEnetPromiscuousModeOn = true, + kIOEnetPromiscuousModeAll = true, + kIOEnetMulticastModeOff = false, + kIOEnetMulticastModeFilter = true +}; +typedef bool IOEnetPromiscuousMode; +typedef bool IOEnetMulticastMode; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IOETHERNETCONTROLLER_H */ diff --git a/i386/include/IOKit/network/IOEthernetInterface.h b/i386/include/IOKit/network/IOEthernetInterface.h new file mode 100644 index 0000000..96c7d95 --- /dev/null +++ b/i386/include/IOKit/network/IOEthernetInterface.h @@ -0,0 +1,328 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOETHERNETINTERFACE_H +#define _IOETHERNETINTERFACE_H + +/*! @defined kIOEthernetInterfaceClass + @abstract The name of the + IOEthernetInterface class. +*/ + +#define kIOEthernetInterfaceClass "IOEthernetInterface" + +/*! @defined kIOActivePacketFilters + @abstract A property of IOEthernetInterface objects. + @discussion The kIOActivePacketFilters property has an OSDictionary value that describes the current + set of packet filters that have been successfully activated. Each + entry in the dictionary is a key/value pair consisting of the filter + group name, and an OSNumber describing the set of active filters for + that group. Entries in this dictionary will mirror those in + kIORequiredPacketFilters if the controller has reported success for + all filter change requests from the IOEthernetInterface object. +*/ + +#define kIOActivePacketFilters "IOActivePacketFilters" + +/*! @defined kIORequiredPacketFilters + @abstract A property of IOEthernetInterface objects. + @discussion The kIORequiredPacketFilters property has an OSDictionary value that describes the current + set of required packet filters. Each entry in the dictionary is a + key/value pair consisting of the filter group name, and an OSNumber + describing the set of required filters for that group. +*/ + +#define kIORequiredPacketFilters "IORequiredPacketFilters" + +/*! @defined kIOMulticastAddressList + @abstract A property of IOEthernetInterface objects. + @discussion The kIOMulticastAddressList property is an OSData object that describes the + list of multicast addresses that are being used by the + controller to match against the destination address of an + incoming frame. +*/ + +#define kIOMulticastAddressList "IOMulticastAddressList" +#define kIOMulticastFilterData kIOMulticastAddressList + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include + +/*! @class IOEthernetInterface + @abstract The Ethernet interface object. + @discussion An Ethernet controller driver, + that is a subclass of IOEthernetController, will instantiate an object + of this class when the driver calls the attachInterface() method. + This interface object will then vend an Ethernet interface to DLIL, + and manage the connection between the controller driver and the upper + networking layers. Drivers will seldom need to subclass + IOEthernetInterface. +*/ + +class IOEthernetInterface : public IONetworkInterface +{ + OSDeclareDefaultStructors( IOEthernetInterface ) + +private: + thread_call_t _inputEventThreadCall; // inputEvent() thread call + UInt32 _mcAddrCount; // # of multicast addresses + bool _ctrEnabled; // Is controller enabled? + OSDictionary * _supportedFilters; // Controller's supported filters + OSDictionary * _requiredFilters; // The required filters + OSDictionary * _activeFilters; // Currently active filters + bool _controllerLostPower; // true if controller is unusable + + struct ExpansionData { + UInt32 altMTU; // track the physical mtu of controller + UInt32 publishedFeatureID; // id for published wake packet + uint32_t supportedWakeFilters; // bitmask of supported wake filters + OSNumber * disabledWakeFilters; // OSNumber of disabled wake filters + }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + + IOReturn enableController(IONetworkController * ctr); + IOReturn setupMulticastFilter(IONetworkController * ctr); + + UInt32 getFilters(const OSDictionary * dict, + const OSSymbol * group); + + bool setFilters(OSDictionary * dict, + const OSSymbol * group, + UInt32 filters); + + IOReturn disableFilter(IONetworkController * ctr, + const OSSymbol * group, + UInt32 filter, + IOOptionBits options = 0); + + IOReturn enableFilter(IONetworkController * ctr, + const OSSymbol * group, + UInt32 filter, + IOOptionBits options = 0); + + int syncSIOCSIFFLAGS(IONetworkController * ctr); + int syncSIOCSIFADDR(IONetworkController * ctr); + int syncSIOCADDMULTI(IONetworkController * ctr); + int syncSIOCDELMULTI(IONetworkController * ctr); + int syncSIOCSIFMTU(IONetworkController * ctr, struct ifreq * ifr, bool); + int syncSIOCGIFDEVMTU(IONetworkController * ctr, struct ifreq * ifr); + int syncSIOCSIFLLADDR(IONetworkController * ctr, const char * lladdr, int len); + void _fixupVlanPacket(mbuf_t, u_int16_t, int); + void reportInterfaceWakeFlags(void); + + static void handleEthernetInputEvent(thread_call_param_t param0, thread_call_param_t param1); + static int performGatedCommand(void *, void *, void *, void *, void *); + static IOReturn enableFilter_Wrapper( + IOEthernetInterface *, IONetworkController *, const OSSymbol *, UInt32 , IOOptionBits); + +public: + +/*! @function init + @abstract Initializes an IOEthernetInterface instance. + @discussion Instance variables are initialized, and an arpcom + structure is allocated. + @param controller A network controller object that will service + the interface object being initialized. + @result Returns true on success, false otherwise. +*/ + + virtual bool init( IONetworkController * controller ); + +/*! @function getNamePrefix + @abstract Returns a string containing the prefix to use when + creating a BSD name for this interface. + @discussion The BSD name for each interface object is created by + concatenating a string returned by this method, with an unique + unit number assigned by IONetworkStack. + @result Returns a pointer to a constant C string "en". Therefore, Ethernet + interfaces will be registered with BSD as en0, en1, etc. +*/ + + virtual const char * getNamePrefix() const; + +/*! @function setProperties + @abstract Handles a request to set Ethernet interface properties from + kernel or non-kernel clients. + @discussion For non-kernel clients, the preferred + access mechanism is through a user client connection. + @param properties An OSDictionary containing a collection of + properties. + @result Returns kIOReturnUnsupported if the interface did not + recognize any of the properties provided. Otherwise, the return + code will be kIOReturnSuccess to indicate no errors, or an + IOReturn error code to indicate that an error occurred while + handling one of the properties. +*/ + + virtual IOReturn setProperties( OSObject * properties ); + +protected: + +/*! @function free + @abstract Frees the IOEthernetInterface instance. + @discussion The memory allocated for the arpcom structure is released, + followed by a call to super::free(). +*/ + + virtual void free(); + +/*! @function performCommand + @abstract Handles an ioctl command sent to the Ethernet interface. + @discussion This method handles socket ioctl commands sent to the Ethernet + interface from DLIL. Commands recognized and processed by this method are + SIOCSIFADDR, SIOCSIFFLAGS, SIOCADDMULTI, and SIOCDELMULTI. Other commands + are passed to the superclass. + @param controller The controller object. + @param cmd The ioctl command code. + @param arg0 Command argument 0. Generally a pointer to an ifnet structure + associated with the interface. + @param arg1 Command argument 1. + @result Returns a BSD return value defined in bsd/sys/errno.h. +*/ + + virtual SInt32 performCommand(IONetworkController * controller, + unsigned long cmd, + void * arg0, + void * arg1); + +/*! @function controllerDidOpen + @abstract A notification that the interface has opened the network + controller. + @discussion This method will be called by IONetworkInterface after a + network controller has accepted an open from this interface object. + IOEthernetInterface will first call the implementation in its + superclass, then inspect the controller through properties published + in the registry. This method is called with the arbitration lock held. + @param controller The controller object that was opened. + @result Returns true on success, false otherwise. Returning false will + cause the controller to be closed, and any pending client opens to be + rejected. +*/ + + virtual bool controllerDidOpen(IONetworkController * controller); + +/*! @function controllerWillClose + @abstract A notification that the interface will close the network + controller. + @discussion This method will simply call super to propagate the method + call. This method is called with the arbitration lock held. + @param controller The controller that is about to be closed. +*/ + + virtual void controllerWillClose(IONetworkController * controller); + + +/*! @function controllerWillChangePowerState + @abstract Handles a notification that the network controller + servicing this interface object is about to transition to a new power state. + @discussion If the controller is about to transition to an unusable state, + and it is currently enabled, then the disable() method on the controller is + called. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Always returns kIOReturnSuccess. +*/ + + virtual IOReturn controllerWillChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +/*! @function controllerDidChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @discussion If the controller did transition to a usable state, and it was + previously disabled due to a previous power change, then it is re-enabled. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result Always returns kIOReturnSuccess. +*/ + + virtual IOReturn controllerDidChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +public: + /* Override IONetworkInterface::willTerminate() */ + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ); + + /* Override IONetworkInterface::attachToDataLinkLayer() */ + + virtual IOReturn attachToDataLinkLayer( IOOptionBits options, + void * parameter ); + + /* Override IONetworkInterface::inputEvent() */ + + virtual bool inputEvent( UInt32 type, void * data ); + +protected: + virtual void feedPacketInputTap(mbuf_t); + virtual void feedPacketOutputTap(mbuf_t); + virtual bool initIfnetParams(struct ifnet_init_params *params); + +public: + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 0); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 1); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 2); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 3); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 4); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 5); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 6); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 7); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 8); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 9); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 10); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 11); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 12); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 13); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 14); + OSMetaClassDeclareReservedUnused( IOEthernetInterface, 15); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IOETHERNETINTERFACE_H */ diff --git a/i386/include/IOKit/network/IOEthernetStats.h b/i386/include/IOKit/network/IOEthernetStats.h new file mode 100644 index 0000000..6125c2d --- /dev/null +++ b/i386/include/IOKit/network/IOEthernetStats.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOEthernetStats.h - Ethernet MIB statistics definitions. + * + * HISTORY + */ + +#ifndef _IOETHERNETSTATS_H +#define _IOETHERNETSTATS_H + +/*! @header IOEthernetStats.h + @discussion Ethernet statistics. */ + +//--------------------------------------------------------------------------- +// Ethernet-like statistics group. + +/*! @typedef IODot3StatsEntry + @discussion Ethernet MIB statistics structure. + @field alignmentErrors dot3StatsAlignmentErrors. + @field fcsErrors dot3StatsFCSErrors. + @field singleCollisionFrames dot3StatsSingleCollisionFrames. + @field multipleCollisionFrames dot3StatsMultipleCollisionFrames. + @field sqeTestErrors dot3StatsSQETestErrors. + @field deferredTransmissions dot3StatsDeferredTransmissions. + @field lateCollisions dot3StatsLateCollisions. + @field excessiveCollisions dot3StatsExcessiveCollisions. + @field internalMacTransmitErrors dot3StatsInternalMacTransmitErrors. + @field carrierSenseErrors dot3StatsCarrierSenseErrors. + @field frameTooLongs dot3StatsFrameTooLongs. + @field internalMacReceiveErrors dot3StatsInternalMacReceiveErrors. + @field etherChipSet dot3StatsEtherChipSet. + @field missedFrames dot3StatsMissedFrames (not in RFC1650). + */ + +typedef struct { + UInt32 alignmentErrors; + UInt32 fcsErrors; + UInt32 singleCollisionFrames; + UInt32 multipleCollisionFrames; + UInt32 sqeTestErrors; + UInt32 deferredTransmissions; + UInt32 lateCollisions; + UInt32 excessiveCollisions; + UInt32 internalMacTransmitErrors; + UInt32 carrierSenseErrors; + UInt32 frameTooLongs; + UInt32 internalMacReceiveErrors; + UInt32 etherChipSet; + UInt32 missedFrames; +} IODot3StatsEntry; + +//--------------------------------------------------------------------------- +// Ethernet-like collision statistics group (optional). + +/*! @typedef IODot3CollEntry + @discussion Collision statistics structure. + @field collFrequencies dot3StatsCollFrequencies. */ + +typedef struct { + UInt32 collFrequencies[16]; +} IODot3CollEntry; + +//--------------------------------------------------------------------------- +// Receiver extra statistics group (not defined by RFC 1650). + +/*! @typedef IODot3RxExtraEntry + @discussion Extra receiver statistics not defined by RFC1650. + @field overruns receiver overruns. + @field watchdogTimeouts watchdog timer expirations. + @field frameTooShorts runt frames. + @field collisionErrors frames damages by late collision. + @field phyErrors PHY receive errors. + @field timeouts receiver timeouts. + @field interrupts receiver interrupts. + @field resets receiver resets. + @field resourceErrors receiver resource shortages. + */ + +typedef struct { + UInt32 overruns; + UInt32 watchdogTimeouts; + UInt32 frameTooShorts; + UInt32 collisionErrors; + UInt32 phyErrors; + UInt32 timeouts; + UInt32 interrupts; + UInt32 resets; + UInt32 resourceErrors; + UInt32 reserved[4]; +} IODot3RxExtraEntry; + +//--------------------------------------------------------------------------- +// Transmitter extra statistics group (not defined by RFC 1650). + +/*! @typedef IODot3TxExtraEntry + @discussion Extra transmitter statistics not defined by RFC1650. + @field underruns transmit underruns. + @field jabbers jabber events. + @field phyErrors PHY transmit errors. + @field timeouts transmitter timeouts. + @field interrupts transmitter interrupts. + @field resets transmitter resets. + @field resourceErrors transmitter resource shortages. + */ + +typedef struct { + UInt32 underruns; + UInt32 jabbers; + UInt32 phyErrors; + UInt32 timeouts; + UInt32 interrupts; + UInt32 resets; + UInt32 resourceErrors; + UInt32 reserved[4]; +} IODot3TxExtraEntry; + +//--------------------------------------------------------------------------- +// Aggregate Ethernet statistics. + +/*! @typedef IOEthernetStats + @discussion Aggregate Ethernet statistics structure. + @field dot3StatsEntry IODot3StatsEntry statistics group. + @field dot3CollEntry IODot3CollEntry statistics group. + @field dot3RxExtraEntry IODot3RxExtraEntry statistics group. + @field dot3TxExtraEntry IODot3TxExtraEntry statistics group. + */ + +typedef struct { + IODot3StatsEntry dot3StatsEntry; + IODot3CollEntry dot3CollEntry; + IODot3RxExtraEntry dot3RxExtraEntry; + IODot3TxExtraEntry dot3TxExtraEntry; +} IOEthernetStats; + +/*! @defined kIOEthernetStatsKey + @discussion Defines the name of an IONetworkData that contains + an IOEthernetStats. */ + +#define kIOEthernetStatsKey "IOEthernetStatsKey" + +#endif /* !_IOETHERNETSTATS_H */ diff --git a/i386/include/IOKit/network/IOGatedOutputQueue.h b/i386/include/IOKit/network/IOGatedOutputQueue.h new file mode 100644 index 0000000..48e9f79 --- /dev/null +++ b/i386/include/IOKit/network/IOGatedOutputQueue.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOGATEDOUTPUTQUEUE_H +#define _IOGATEDOUTPUTQUEUE_H + +#include +#include +#include +#include + +/*! @class IOGatedOutputQueue + @abstract An extension of an IOBasicOutputQueue. + @discussion An IOCommandGate + object is created by this queue and added to a work loop as an + event source. All calls to the target by the consumer thread must + occur with the gate closed. Therefore, all calls to the target of + this type of queue will be serialized with any other thread that + runs on the same work loop context. This is useful for network + drivers that have a tight hardware coupling between the transmit + and receive engines, and a single-threaded hardware access model + is desirable. +*/ + +class IOGatedOutputQueue : public IOBasicOutputQueue +{ + OSDeclareDefaultStructors( IOGatedOutputQueue ) + +private: + static void gatedOutput(OSObject * owner, + IOGatedOutputQueue * self, + IOMbufQueue * queue, + UInt32 * state); + + static void restartDeferredOutput(OSObject * owner, + IOInterruptEventSource * sender, + int count); + +protected: + IOCommandGate * _gate; + IOInterruptEventSource * _interruptSrc; + +/*! @function output + @abstract Transfers all packets in the mbuf queue to the target. + @param queue A queue of output packets. + @param state Return a state bit defined by IOBasicOutputQueue that + declares the new state of the queue following this method call. + A kStateStalled is returned if the queue should stall, otherwise 0 + is returned. +*/ + + virtual void output(IOMbufQueue * queue, UInt32 * state); + +/*! @function free + @abstract Frees the IOGatedOutputQueue object. + @discussion Release allocated resources, then call super::free(). */ + + virtual void free(); + +/*! @function output + @abstract Overrides the method inherited from IOOutputQueue. + @result Returns true if a thread was successfully scheduled to service + the queue. +*/ + + virtual bool scheduleServiceThread(void * param); + +public: + +/*! @function init + @abstract Initializes an IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue, and is usually a subclass of IONetworkController. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target An IONetworkController object that will handle packets + removed from the queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. +*/ + + static IOGatedOutputQueue * withTarget(IONetworkController * target, + IOWorkLoop * workloop, + UInt32 capacity = 0); + +/*! @function withTarget + @abstract Factory method that constructs and initializes an + IOGatedOutputQueue object. + @param target The object that will handle packets removed from the + queue. + @param action The function that will handle packets removed from the + queue. + @param workloop A workloop object. An IOCommandGate object is created + and added to this workloop as an event source. + @param capacity The initial capacity of the output queue. + @result Returns an IOGatedOutputQueue object on success, or 0 otherwise. +*/ + + static IOGatedOutputQueue * withTarget(OSObject * target, + IOOutputAction action, + IOWorkLoop * workloop, + UInt32 capacity = 0); +}; + +#endif /* !_IOGATEDOUTPUTQUEUE_H */ diff --git a/i386/include/IOKit/network/IOKernelDebugger.h b/i386/include/IOKit/network/IOKernelDebugger.h new file mode 100644 index 0000000..97fc905 --- /dev/null +++ b/i386/include/IOKit/network/IOKernelDebugger.h @@ -0,0 +1,324 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKERNELDEBUGGER_H +#define _IOKERNELDEBUGGER_H + +#include + +/*! @typedef IODebuggerRxHandler + @discussion Defines the receive handler that must be implemented + by the target to service KDP receive requests. This handler is called + by kdpReceiveDispatcher(). + @param target The target object. + @param buffer KDP receive buffer. The buffer allocated has room for + 1518 bytes. The receive handler must not overflow this buffer. + @param length The amount of data received and placed into the buffer. + Set to 0 if no frame was received during the poll interval. + @param timeout The amount of time to poll in milliseconds while waiting + for a frame to arrive. */ + +typedef void (*IODebuggerRxHandler)( IOService * target, + void * buffer, + UInt32 * length, + UInt32 timeout ); + +/*! @typedef IODebuggerTxHandler + @discussion Defines the transmit handler that must be implemented + by the target to service KDP transmit requests. This handler is called + by kdpTransmitDispatcher(). + @param target The target object. + @param buffer KDP transmit buffer. This buffer contains a KDP frame + to be sent on the network. + @param length The number of bytes in the transmit buffer. */ + +typedef void (*IODebuggerTxHandler)( IOService * target, + void * buffer, + UInt32 length ); + +/*! @typedef IODebuggerLockState + @discussion Defines flags returned by IOKernelDebugger::lock(). + @constant kIODebuggerLockTaken Set if the debugger lock was taken. */ + +typedef enum { + kIODebuggerLockTaken = 0x1 +} IODebuggerLockState; + +/*! @class IOKernelDebugger + @abstract Kernel debugger nub. + @discussion This object interfaces with the KDP + (kernel debugger protocol) module and dispatches KDP requests to its + target (provider). The target, designated as the debugger device, must + implement a pair of handler functions that are called to handle KDP + transmit and receive requests during a debugging session. Only a single + IOKernelDebugger in the system can be active at a given time. The + active IOKernelDebugger is the one that has an IOKDP object attached + as a client. + + The debugger device is usually a subclass of IOEthernetController. + However, any IOService can service an IOKernelDebugger client, + implement the two polled mode handlers, and transport the KDP + packets through a data channel. However, KDP assumes that the + debugger device is an Ethernet interface and therefore it will + always send, and expect to receive, an Ethernet frame. */ + +class IOKernelDebugger : public IOService +{ + OSDeclareDefaultStructors( IOKernelDebugger ) + +protected: + IOService * _target; // target (provider) + IODebuggerTxHandler _txHandler; // target's transmit handler. + IODebuggerRxHandler _rxHandler; // target's receive handler. + IOService * _client; // client that has opened us. + bool _pmDisabled; // true if disabled by PM. + + struct ExpansionData { + thread_call_t activationChangeThreadCall; + UInt32 stateVars[2]; + IONotifier * interfaceNotifier; + }; + + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + +/*! @function kdpReceiveDispatcher + @abstract The KDP receive dispatch function. + @discussion Field KDP receives requests, then dispatches the call to the + registered receiver handler. + @param buffer KDP receive buffer. The buffer allocated by KDP has room + for 1518 bytes. The receive handler must not overflow this buffer. + @param length The amount of data received and placed into the buffer. + Set to 0 if a frame was not received during the poll interval. + @param timeout The amount of time to poll in milliseconds while waiting + for a frame to arrive. +*/ + + static void kdpReceiveDispatcher(void * buffer, + UInt32 * length, + UInt32 timeout); + +/*! @function kdpTransmitDispatcher + @abstract The KDP transmit dispatch function. + @discussion Field KDP transmit requests, then dispatches the call to the + registered transmit handler. + @param buffer KDP transmit buffer. This buffer contains a KDP frame to + be sent on the network. + @param length The number of bytes in the transmit buffer. +*/ + + static void kdpTransmitDispatcher(void * buffer, UInt32 length); + +/*! @function free + @abstract Frees the IOKernelDebugger instance. */ + + virtual void free(); + +/*! @function nullTxHandler + @abstract Null transmit handler. + @discussion This function is registered as the transmit handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled transmit requests from KDP. This function does nothing + useful. +*/ + + static void nullTxHandler( IOService * target, + void * buffer, + UInt32 length ); + +/*! @function nullRxHandler + @abstract Null receive handler. + @discussion This function is registered as the receive handler when an + IOKernelDebugger object surrenders its status as the active debugger nub. + Until another IOKernelDebugger object gets promoted, this function will + handle polled receive requests from KDP. This function does nothing + except to log a warning message. +*/ + + static void nullRxHandler( IOService * target, + void * buffer, + UInt32 * length, + UInt32 timeout ); + +/*! @function registerHandler + @abstract Registers the target and the handler functions. + @discussion This method is called by handleOpen() and handleClose() + to register or unregister the target and its handler functions. + @param target The target object. + @param txHandler The transmit handler function. The null handler is + registered if the argument is zero. + @param rxHandler The receive handler function. The null handler is + registered if the argument is zero. +*/ + + static void registerHandler( IOService * target, + IODebuggerTxHandler txHandler = 0, + IODebuggerRxHandler rxHandler = 0 ); + +/*! @function powerStateWillChangeTo + @abstract Handles notification that the network controller will change + power state. + @discussion If the controller is about to become unusable, then the + controller's handlers are unregistered, and the controller is disabled. + @param flags Describe the capability of the controller in the new power + state. + @param stateNumber The number of the state in the state array that the + controller is switching to. + @param policyMaker The policy maker that manages the controller's + power state. + @result Returns the constant 3000000, to indicate a maximum of 3 seconds for the + preparation to complete, and an acknowledgement delivered to the + policy maker. +*/ + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function powerStateDidChangeTo + @abstract Handles notification that the network controller did change + power state. + @discussion If the controller became usable, then the controller is + re-enabled, and the controller's handlers are re-registered. + @param flags Description of the capability of the controller in the new power + state. + @param stateNumber The number of the state in the state array that the + controller is switching to. + @param policyMaker The policy maker that manages the controller's + power state. + @result Returns the constant 3000000, to indicate a maximum of 3 seconds for the + preparation to complete, and an acknowledgement delivered to the + policy maker. +*/ + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function handleOpen + @abstract Handles a client open. + @discussion This method is called by IOService::open() to handle an + open from a client (IOKDP) with the arbitration lock held. + @param forClient The client (IOKDP) requesting the open. + @param options Options passed to the open() call. Not used. + @param arg A family defined argument passed to the open() call. Not used. + @result Returns true on success, false otherwise. +*/ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + +/*! @function handleClose + @abstract Handles a client close. + @discussion This method is called by IOService::close() to handle a + close from a client with the arbitration lock held. + @param forClient The client (IOKDP) requesting the close. + @param options Options passed to the close() call. Not used. +*/ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on this object. + @discussion This method is called by IOService::isOpen() with the + arbitration lock held. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + static bool interfacePublished( void *target, void *param, IOService *service ); + +public: + +/*! @function lock + @abstract Takes the debugger lock conditionally. + @discussion This method takes the debugger lock if the object given matches the + target registered by registerHandler(). + @param target The target or provider of an IOKernelDebugger object. + @result Returns kIODebuggerLockTaken if the lock was taken, or 0 otherwise. +*/ + + static IODebuggerLockState lock( IOService * target ); + +/*! @function unlock + @abstract Releases the debugger lock. + @discussion This method releases the debugger lock if the kIODebuggerLockTaken flag is + set in the argument. +*/ + + static void unlock( IODebuggerLockState state ); + +/*! @function init + @abstract Initializes an IOKernelDebugger instance. + @param target The target object that implements the debugger handlers. + @param txHandler The target's transmit handler. A pointer to a 'C' function. + @param rxHandler The target's receive handler. A pointer to a 'C' function. + @result Returns true if the instance initialized successfully, false otherwise. +*/ + + virtual bool init( IOService * target, + IODebuggerTxHandler txHandler, + IODebuggerRxHandler rxHandler ); + +/*! @function debugger + @abstract Factory method that performs allocation and initialization + of an IOKernelDebugger object. + @param target The target object that implements the debugger handlers. + @param txHandler The target's transmit handler. A pointer to a 'C' function. + @param rxHandler The target's receive handler. A pointer to a 'C' function. + @result Returns an IOKernelDebugger instance on success, 0 otherwise. +*/ + + static IOKernelDebugger * debugger( IOService * target, + IODebuggerTxHandler txHandler, + IODebuggerRxHandler rxHandler ); + + /* + * Entry point for generic messages delivered from the provider. + */ + + virtual IOReturn message( UInt32 type, IOService * provider, void * arg ); + +/*! @function signalDebugger + @abstract Signal the kernel to enter the debugger when safe. +*/ + static void signalDebugger(void); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 0); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 1); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 2); + OSMetaClassDeclareReservedUnused( IOKernelDebugger, 3); +}; + +// Concise form of the lock()/unlock() static member functions. +// +#define IODebuggerLock IOKernelDebugger::lock +#define IODebuggerUnlock IOKernelDebugger::unlock + +#endif /* !_IOKERNELDEBUGGER_H */ diff --git a/i386/include/IOKit/network/IOMbufMemoryCursor.h b/i386/include/IOKit/network/IOMbufMemoryCursor.h new file mode 100644 index 0000000..4e40173 --- /dev/null +++ b/i386/include/IOKit/network/IOMbufMemoryCursor.h @@ -0,0 +1,381 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H +#define _IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H + +#include + + +/*! @class IOMbufMemoryCursor + @abstract A mechanism to convert mbuf chains to physical addresses. + @discussion The IOMbufMemoryCursor defines the super class that all + specific mbuf cursors must inherit from, but a mbuf cursor can be created + without a specific formal subclass by just providing a segment function to + the initializers. This class performs the task of walking a given + mbuf chain and creating a physical scatter/gather list appropriate for + the target hardware. When necessary, this class may also coalesce + mbuf chains when the generated scatter/gather list exceeds the specified + hardware limit. However, this should be avoided since it exacts a + performance cost. +

+ A driver is expected to create a mbuf cursor and configure it to match the + limitations of it's DMA hardware; for instance the mbuf cursor used by + an Ethernet controller driver may have a maximum physical segment size + of 1520, and allow for up to 6 physical segments. Thus it would create a + mbuf cursor with a maxSegmentSize of 1520 and a maxNumSegments of 6. + The driver may choose to supply an OutputSegmentFunc function to + format the output of each scatter/gather segment to match the + hardware descriptor format, or it may use a subclass of + IOMbufMemoryCursor to generate IOPhysicalSegment segments with + various byte orders. +

+ A driver may also create more than one mbuf cursor, perhaps one + dedicated for the transmit thread, and the other for the receive thread. + This becomes a requirement when the driver is multi-threaded, since the + mbuf cursor maintains state and does not support reentrancy. */ + +class IOMbufMemoryCursor : public IOMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufMemoryCursor) + +protected: + UInt32 maxNumSegments; + UInt32 coalesceCount; + UInt32 packetTooBigErrors; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; + + virtual bool initWithSpecification(OutputSegmentFunc outSeg, + UInt32 maxSegmentSize, + UInt32 maxTransferSize, + UInt32 align); + +public: +/*! @function initWithSpecification + @abstract Primary initializer for the IOMbufMemoryCursor class. + @param outSeg Function to call to output one physical segment. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns true if the inherited classes and this instance initialized + successfully. +*/ + + virtual bool initWithSpecification(OutputSegmentFunc outSeg, + UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function genPhysicalSegments + @abstract Generates a physical scatter/gather list given a mbuf packet. + @discussion Generates a list of physical segments from the given mbuf. + @param packet The mbuf packet. + @param vector Void pointer to base of output physical scatter/gather list. + Always passed directly onto the OutputSegmentFunc without interpretation + by the cursor. + @param maxSegs Maximum number of segments that can be written to segments + array. + @param doCoalesce Set to true to perform coalescing when the required + number of segments exceeds the specified limit, otherwise abort and + return 0. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + virtual UInt32 genPhysicalSegments(mbuf_t packet, void * vector, + UInt32 maxSegs, bool doCoalesce); + +/*! @function getAndResetCoalesceCount + @abstract Returns a count of the total number of mbuf chains coalesced + by genPhysicalSegments(). + @discussion This method returns a count of the total number of mbuf chains coalesced + by genPhysicalSegments(). The counter is then reset to 0. + @result Returns the coalesce count. +*/ + + UInt32 getAndResetCoalesceCount(); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 0); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 1); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 2); + OSMetaClassDeclareReservedUnused( IOMbufMemoryCursor, 3); +}; + + +/*! @class IOMbufNaturalMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the natural byte orientation for the cpu. + @discussion The IOMbufNaturalMemoryCursor would be used when it is too + difficult to implement an OutputSegmentFunc that is more appropriate for + your hardware. This cursor just outputs an array of IOPhysicalSegments. +*/ + +class IOMbufNaturalMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufNaturalMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufNaturalMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufNaturalMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a cpu natural physical scatter/gather list from a given + mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a cpu natural physical scatter/gather list from a given + mbuf. + @discussion Generate a cpu natural physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufBigMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the big endian byte order. + @discussion The IOMbufBigMemoryCursor would be used when the DMA hardware + requires a big endian address and length pair. This cursor outputs an + array of IOPhysicalSegments that are encoded in big-endian format. +*/ + +class IOMbufBigMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufBigMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufBigMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufBigMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a big endian physical scatter/gather list from a given + mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a big endian physical scatter/gather list from a given + mbuf. + @discussion Generate a big endian physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufLittleMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IOPhysicalSegments in the little endian byte order. + @discussion The IOMbufLittleMemoryCursor would be used when the DMA + hardware requires a little endian address and length pair. This cursor + outputs an array of IOPhysicalSegments that are encoded in little endian + format. +*/ + +class IOMbufLittleMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufLittleMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufLittleMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufLittleMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a little endian physical scatter/gather list from a + given mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a little endian physical scatter/gather list from a + given mbuf. + @discussion Generate a little endian physical scatter/gather list from a + given mbuf. Coalesce mbuf chain when the number of segments in the + scatter/gather list exceeds numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IOPhysicalSegments for the output + physical scatter/gather list. + @param numVectorSegments Maximum number of IOPhysicalSegments accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IOPhysicalSegment * vector, + UInt32 numVectorSegments = 0); +}; + +#ifdef __ppc__ + +struct IODBDMADescriptor; + +//=========================================================================== +//=========================================================================== + +/*! @class IOMbufDBDMAMemoryCursor + @abstract An IOMbufMemoryCursor subclass that outputs a vector of + IODBDMADescriptors. +*/ + +class IOMbufDBDMAMemoryCursor : public IOMbufMemoryCursor +{ + OSDeclareDefaultStructors(IOMbufDBDMAMemoryCursor) + +public: + +/*! @function withSpecification + @abstract Factory function that creates and initializes an + IOMbufDBDMAMemoryCursor in one operation. + @discussion See also IOMbufMemoryCursor::initWithSpecification. + @param maxSegmentSize Maximum allowable size for one segment. + @param maxNumSegments Maximum number of segments. + @result Returns a new mbuf cursor if successfully created and initialized, + 0 otherwise. +*/ + + static IOMbufDBDMAMemoryCursor * withSpecification(UInt32 maxSegmentSize, + UInt32 maxNumSegments); + +/*! @function getPhysicalSegments + @abstract Generates a DBDMA descriptor list from a given mbuf. + @param packet The mbuf packet. + @param vector Pointer to an array of IODBDMADescriptor for the output list. + @param numVectorSegments Maximum number of IODBDMADescriptors accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegments(mbuf_t packet, + struct IODBDMADescriptor *vector, + UInt32 numVectorSegments = 0); + +/*! @function getPhysicalSegmentsWithCoalesce + @abstract Generates a DBDMA descriptor list from a given mbuf. + @discussion Generate a DBDMA descriptor list from a given mbuf. + Coalesce mbuf chain when the number of elements in the list exceeds + numVectorSegments. + @param packet The mbuf packet. + @param vector Pointer to an array of IODBDMADescriptor for the output list. + @param numVectorSegments Maximum number of IODBDMADescriptors accepted. + @result Returns the number of segments that were filled in, or + 0 if an error occurred. +*/ + + UInt32 getPhysicalSegmentsWithCoalesce(mbuf_t packet, + struct IODBDMADescriptor * vector, + UInt32 numVectorSegments = 0); +}; + +#endif /* __ppc__ */ + +#endif /* !_IOKIT_NETWORK_IOMBUFMEMORYCURSOR_H */ + diff --git a/i386/include/IOKit/network/IONetworkController.h b/i386/include/IOKit/network/IONetworkController.h new file mode 100644 index 0000000..05b12d3 --- /dev/null +++ b/i386/include/IOKit/network/IONetworkController.h @@ -0,0 +1,1452 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKCONTROLLER_H +#define _IONETWORKCONTROLLER_H + +/*! @defined kIONetworkControllerClass + @abstract The name of the IONetworkController class. */ + +#define kIONetworkControllerClass "IONetworkController" + +/*! @defined kIOVendor + @abstract A property of IONetworkController objects. + @discussion The kIOVendor property is a property of IONetworkController objects. It has an OSString value that describes the vendor of the network controller. */ + +#define kIOVendor "IOVendor" + +/*! @defined kIOModel + @abstract A property of IONetworkController objects. + @discussion The kIOModel property is a property of IONetworkController objects. It has an OSString value that describes the model of the network controller. */ + +#define kIOModel "IOModel" + +/*! @defined kIORevision + @abstract A property of IONetworkController objects. + @discussion The kIORevision property is a property of IONetworkController objects. It has an OSString value that describes the revision level of the network controller. */ + +#define kIORevision "IORevision" + +/*! @defined kIOFeatures + @abstract A property of IONetworkController objects. + @discussion The kIOFeatures property is a property of IONetworkController objects. It has an OSNumber value that describes generic features defined by IONetworkController that are supported by the + network controller. */ + +#define kIOFeatures "IOFeatures" + +/*! @defined kIOMediumDictionary + @abstract A property of IONetworkController objects. + @discussion The kIOMediumDictionary property is a property of IONetworkController + objects. It has an OSDictionary value that is a container for the + collection of IONetworkMedium objects that represent the media + types supported by the network controller. + Each entry in the dictionary is a key/value pair consisting of + the medium name, and a dictionary value that contains the + properties for that medium entry. */ + +#define kIOMediumDictionary "IOMediumDictionary" + +/*! @defined kIODefaultMedium + @abstract A property of IONetworkController objects. + @discussion The kIODefaultMedium property is a property of IONetworkController + objects. It has an OSString value that describes the name of the + default medium. This definition may change or disappear in the + future. */ + +#define kIODefaultMedium "IODefaultMedium" + +/*! @defined kIOSelectedMedium + @abstract A property of IONetworkController objects. + @discussion The kIOSelectedMedium property is a property of IONetworkController + objects. It has an OSSymbol value that describes the name of the + current selected medium. This name can be used as a key into the + medium dictionary to gather additional information about the + selected medium. */ + +#define kIOSelectedMedium "IOSelectedMedium" + +/*! @defined kIOActiveMedium + @abstract A property of IONetworkController objects. + @discussion The kIOActiveMedium property is a property of IONetworkController + objects. It has an OSSymbol value that describes the name of the + active medium. This is the name of the medium where an active + link has been established. This name can be used as a key into + the medium dictionary to gather additional information about the + active medium. */ + +#define kIOActiveMedium "IOActiveMedium" + +/*! @defined kIOLinkSpeed + @abstract A property of IONetworkController objects. + @discussion The kIOLinkSpeed property is a property of IONetworkController + objects. It has an OSNumber value that describes the speed of the + link established over the active medium in bits per second. */ + +#define kIOLinkSpeed "IOLinkSpeed" + +/*! @defined kIOLinkStatus + @abstract A property of IONetworkController objects. + @discussion The kIOLinkStatus property is a property of IONetworkController + objects. It has an OSNumber value that describes the current network + link status. See IONetworkMedium for the definition of the link + status bits. */ + +#define kIOLinkStatus "IOLinkStatus" + +/*! @defined kIOLinkData + @abstract A property of IONetworkController objects. + @discussion The kIOLinkData property is a property of IONetworkController + objects. It has an OSData value that contains additional information + describing the active link that was established. + Its interpretation is not defined. */ + +#define kIOLinkData "IOLinkData" + +/*! @defined kIOPacketFilters + @abstract A property of IONetworkController objects. + @discussion The kIOPacketFilters property is a property of IONetworkController + objects. It has an OSDictionary value that describes the entire + set of packet filters supported by the controller. Each entry + in the dictionary is a key/value pair consisting of the filter + group name, and an OSNumber describing the set of supported + filters for that group. */ + +#define kIOPacketFilters "IOPacketFilters" + +/*! @defined kIOMACAddress + @abstract A property of IONetworkController objects. + @discussion The kIOMACAddress property is a property of IONetworkController + objects. It has an OSData value that describes the hardware + MAC (media access controller) address, or station address, + of the network controller. */ + +#define kIOMACAddress "IOMACAddress" + +/*! @defined kIOMaxPacketSize + @abstract A property of IONetworkController objects. + @discussion The kIOMaxPacketSize property is a property of IONetworkController + objects. It has an OSNumber value that describes the maximum + packet size supported by the controller. */ + +#define kIOMaxPacketSize "IOMaxPacketSize" + +/*! @defined kIOMinPacketSize + @abstract A property of IONetworkController objects. + @discussion The kIOMinPacketSize property is a property of IONetworkController + objects. It has an OSNumber value that describes the minimum + packet size supported by the controller. */ + +#define kIOMinPacketSize "IOMinPacketSize" + +/*! @defined kIONetworkFilterGroup + @abstract The name assigned to the standard network filter group. */ + +#define kIONetworkFilterGroup "IONetworkFilterGroup" + +/*! @enum StandardPacketFilters + @abstract All standard packet filters. + @discussion Each filter will allow the reception of certain class of packets + depending on its destination MAC address. + @constant kIOPacketFilterUnicast Reception of unicast packets. + @constant kIOPacketFilterBroadcast Reception of broadcast packets. + @constant kIOPacketFilterMulticast Reception of multicast packets + addressed to a set of multicast addresses. + @constant kIOPacketFilterMulticastAll Reception of all multicast + packets. + @constant kIOPacketFilterPromiscuous Reception of all packets. + @constant kIOPacketFilterPromiscuousAll Reception of all packets, + including bad packets. */ + +enum { + kIOPacketFilterUnicast = 0x1, + kIOPacketFilterBroadcast = 0x2, + kIOPacketFilterMulticast = 0x10, + kIOPacketFilterMulticastAll = 0x20, + kIOPacketFilterPromiscuous = 0x100, + kIOPacketFilterPromiscuousAll = 0x200 +}; + +/*! @enum NetworkFeatureFlags + @abstract Feature flags returned by the getFeatures() method. + @constant kIONetworkFeatureNoBSDWait Set this bit in the value + returned by getFeatures() to disable the automatic wait for + "IOBSD" resource by the IONetworkController::start() method. + @constant kIONetworkFeaturesHardwareVlan Set this bit in the value + returned by getFeatures() to indicate the controller supports hardware + stripping and stuffing of 802.1q vlan tags. If the controller supports + this feature it must enable it when initializing so that all received + packets delivered to higher layers have the tag stripped. The controller + should use setVlanTag() to provide the tag information out of band. + @constant kIONetworkFeaturesSoftwareVlan Set this bit in the value + returned by getFeatures() to indicate that the controller can support software + based vlan by transmitting and receiving packets 4 bytes longer that normal. + @constant kIONetworkFeatureMultiPages Set this bit if the driver is + capable of handling packets coming down from the network stack that + reside in virtually, but not in physically contiguous span of the + external mbuf clusters. In this case, the data area of a packet in + the external mbuf cluster might cross one or more physical pages that + are disjoint, depending on the interface MTU and the packet size. + Such a use of larger than system page size clusters by the network + stack is done for better system efficiency. Drivers that utilize the + IOMbufNaturalMemoryCursor with the getPhysicalSegmentsWithCoalesce + interfaces and enumerate the list of vectors should set this flag + for possible gain in performance during bulk data transfer. + @constant kIONetworkFeatureTSOIPv4 Set this bit to advertise support + for TCP/IPv4 segmentation offload. + @constant kIONetworkFeatureTSOIPv6 Set this bit to advertise support + for TCP/IPv6 segmentation offload. +*/ + +enum { + kIONetworkFeatureNoBSDWait = 0x01, + kIONetworkFeatureHardwareVlan = 0x02, + kIONetworkFeatureSoftwareVlan = 0x04, + kIONetworkFeatureMultiPages = 0x08, + kIONetworkFeatureTSOIPv4 = 0x10, + kIONetworkFeatureTSOIPv6 = 0x20 +}; + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include + +class IOCommandGate; +class IOOutputQueue; +class IONetworkMedium; + +/*! @typedef IOPacketBufferConstraints + @discussion Constraint parameters, specified by a driver, + for the data buffer in a packet mbuf. This is observed by + allocatePacket() to satisfy the stated requirements. + @field alignStart Starting address byte alignment. + @field alignLength Buffer length byte alignment. */ + +typedef struct { + UInt32 alignStart; + UInt32 alignLength; + UInt32 reserved[6]; +} IOPacketBufferConstraints; + +// Some frequently used alignment constants. +// +enum { + kIOPacketBufferAlign1 = 1, + kIOPacketBufferAlign2 = 2, + kIOPacketBufferAlign4 = 4, + kIOPacketBufferAlign8 = 8, + kIOPacketBufferAlign16 = 16, + kIOPacketBufferAlign32 = 32 +}; + +/*! @const gIONetworkFilterGroup + @discussion gIONetworkFilterGroup is an OSSymbol object that contains + the name of the standard network filter group as defined by + kIONetworkFilterGroup. */ + +extern const OSSymbol * gIONetworkFilterGroup; + +/*! @class IONetworkController + @abstract Implements the framework for a generic + network controller. + @discussion A subclass of IONetworkController must provide + additional functionality specific for a particular networking type. + In addition, the driver must implement (override) a basic set of + hardware dependent methods to create a working driver. + + IONetworkController attaches itself to the data link layer (DLIL) via + an IONetworkInterface object. A controller object without a companion + interface is not accessible to the networking system. The controller + interacts with DLIL by calling methods defined by the interface object. + And conversely, DLIL will issue commands and packets to the controller + through the interface object. + + IONetworkController will create an IOCommandGate and attach this + event source to an IOWorkLoop object. All commands sent from the + interface object are handled through the IOCommandGate object, + which will serialize access to the controller. Outbound packets sent + from the interface to the controller have no implicit serialization. + Drivers must implement an output function that is thread safe, or use + an IOOutputQueue object which will provide a serialization model. + + Note: IONetworkController internally uses some private messaging constants + in the sys_iokit | sub_iokit_networking range defined in + "IONetworkControllerPrivate.h". If you create a client for your controller + (for example an IOUserClient), and it overrides the IOService::message + method, your client may receive these messages. It should ignore these + messages and pass them to super::message() + */ + +class IONetworkController : public IOService +{ + OSDeclareAbstractStructors( IONetworkController ) + +private: + + IOWorkLoop * _workLoop; + IOCommandGate * _cmdGate; + IOOutputQueue * _outputQueue; + OSSet * _clientSet; + OSCollectionIterator * _clientSetIter; + OSObject * _cmdClient; + UInt32 _alignStart; + UInt32 _alignLength; + UInt32 _alignPadding; + bool _propertiesPublished; + IOLock * _mediumLock; + IODebuggerLockState _debugLockState; + SInt32 _debugLockCount; + OSNumber * _linkStatus; + OSNumber * _linkSpeed; + const OSData * _lastLinkData; + const OSSymbol * _lastActiveMediumName; + const OSSymbol * _lastCurrentMediumName; + mbuf_t _freeList; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + + bool _broadcastEvent(UInt32 type, void * data = 0); + + static void debugRxHandler(IOService * handler, + void * buffer, + UInt32 * length, + UInt32 timeout); + + static void debugTxHandler(IOService * handler, + void * buffer, + UInt32 length); + + static IOReturn executeCommandAction(OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3); + + static IOReturn handleCommand(void * target, + void * param0, + void * param1, + void * param2, + void * param3); + +public: + +/*! @function init + @abstract Initializes the IONetworkController object. + @discussion Instance variables are initialized, then super::init() + is called. + @param properties A dictionary object containing a property table + associated with this instance. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(OSDictionary * properties); + +/*! @function start + @abstract Starts the network controller. + @discussion After the controller driver has successfully matched + to a provider, this method is called to start the network controller. + IONetworkController will allocate resources and gather controller + properties in its implementation. No I/O will be performed until + the subclass tries to attach a client object. A driver must override + this method, and call super::start() at the beginning of its own + implementation. Then check the return value to make sure that its + superclass was started successfully before proceeding. Tasks that + are usually performed by a driver's start method are: resource + allocation, hardware initialization, allocation of IOEventSources + and attaching them to a workloop, publishing a medium dictionary, + and finally, attaching an interface object when it is ready to + handle client requests. + @param provider The provider that the controller was matched + (and attached) to. + @result Returns true on success, false otherwise. +*/ + + virtual bool start(IOService * provider); + +/*! @function stop + @abstract Stops the network controller. + @discussion The counterpart of start(). The controller has been + instructed to stop running. The stop() method should release + resources and undo actions performed by the start() method. + Subclasses must override this method and call super::stop() + at the end of its implementation. + @param provider The provider that the controller was matched + (and attached) to. */ + + virtual void stop(IOService * provider); + +/*! @typedef IONetworkController::Action + @discussion Definition of a C function that can be called + through executeCommand(). + @param target The first argument passed to action. + @param param0 Action parameter 0. + @param param1 Action parameter 1. + @param param2 Action parameter 2. + @param param3 Action parameter 3. */ + + typedef IOReturn (*Action)(void * target, void * param0, + void * param1, + void * param2, + void * param3); + +/*! @function executeCommand + @abstract Makes a C function call through the command gate. + @discussion This method makes a call to a C function that will be synchronized + with the workloop thread, and any other threads that are called + with the workloop's gate closed. + @param client The client requesting the action. This parameter is not + passed to the function. + @param action Pointer to a C function to be executed. + @param target The first parameter in the action callout. + @param param0 Action parameter 0. + @param param1 Action parameter 1. + @param param2 Action parameter 2. + @param param3 Action parameter 3. + @result Returns the value returned by the action. +*/ + + virtual IOReturn executeCommand(OSObject * client, + Action action, + void * target, + void * param0 = 0, + void * param1 = 0, + void * param2 = 0, + void * param3 = 0); + +/*! @function outputPacket + @abstract Transmits an output packet. + @discussion If an IOOutputQueue was created by createOutputQueue(), + then this method will be called by the output queue object. + Otherwise, an interface object will call this method directly when + it receives an output packet from the data link layer. + + There is no upper limit on the number of mbufs, hence the number of + memory fragments, in the mbuf chain provided. Drivers must be able to + handle cases when the mbuf count might exceed the limit supported by their + DMA engines, and perform coalescing to copy the various memory fragments + into a lesser number of fragments. This complexity can be hidden from + the driver when an IOMbufMemoryCursor is used, which is able to convert + an mbuf chain into a physical address scatter-gather list that will not + exceed a specified number of physically contiguous memory segments. + See IOMbufMemoryCursor. + + The implementation in IONetworkController performs no useful action + and will drop all packets. A driver must override this method and + process the output packet provided. The implementation in the driver + must not block, since this may cause the network stack to be reentered + from an unsafe point. + @param packet An mbuf chain containing the output packet to be sent on + the network. + @param param A parameter provided by the caller. + @result Returns a return code defined by the caller. +*/ + + virtual UInt32 outputPacket(mbuf_t, void * param); + +/*! @function getFeatures + @abstract Reports generic features supported by the controller and/or + the driver. + @result This method will always return 0. Subclasses may override + this method and return a bit mask of all supported features. */ + + virtual UInt32 getFeatures() const; + +/*! @function newVendorString + @result Returns a string describing the vendor of the network controller. + The caller is responsible for releasing the string object returned. */ + + virtual const OSString * newVendorString() const; + +/*! @function newModelString + @result Returns a string describing the model of the network controller. + The caller is responsible for releasing the string object returned. */ + + virtual const OSString * newModelString() const; + +/*! @function newRevisionString + @result Returns a string describing the hardware revision of the + network controller. The caller is responsible for releasing the + string object returned. */ + + virtual const OSString * newRevisionString() const; + +/*! @function getSelectedMedium + @abstract Gets the current selected medium. + @discussion If the driver has previously called setSelectedMedium() + to indicate its current media selection, then this method will return + that medium object. Otherwise, the driver's property table is + consulted and a default medium property is examined, and the + corresponding entry in the medium dictionary is returned. + @result Returns the current selected medium, the default medium, or 0. +*/ + + virtual const IONetworkMedium * getSelectedMedium() const; + const IONetworkMedium * getCurrentMedium() const; + +/*! @function getMediumDictionary + @abstract Returns the medium dictionary published by the driver. + @discussion Returns the medium dictionary published by the driver + through publishMediumDictionary(). Use copyMediumDictionary() to + create and get a copy of the medium dictionary. + @result Returns the published medium dictionary, or 0 if the driver has not + yet published a medium dictionary through publishMediumDictionary(). +*/ + + virtual const OSDictionary * getMediumDictionary() const; + +/*! @function copyMediumDictionary + @abstract Returns a copy of the medium dictionary published by the + driver. + @discussion The caller is responsible for releasing the dictionary + object returned. Use getMediumDictionary() to get a reference to the + published medium dictionary instead of creating a copy. + @result Returns a copy of the medium dictionary, or 0 if the driver has not + published a medium dictionary through publishMediumDictionary(). +*/ + + virtual OSDictionary * copyMediumDictionary() const; + +/*! @function getOutputHandler + @abstract Gets the address of the method designated to handle output + packets for the network controller. + @result Returns a pointer to the outputPacket() method. +*/ + + virtual IOOutputAction getOutputHandler() const; + +/*! @function doEnable + @abstract Makes a synchronized call to enable() through executeCommand(). + @discussion Do not use this method, it may be removed in the future. + See enable(). +*/ + + virtual IOReturn doEnable(IOService * client); + +/*! @function doDisable + @abstract Makes a synchronized call to disable() through executeCommand(). + @discussion Do not use this method, it may be removed in the future. + See disable(). +*/ + + virtual IOReturn doDisable(IOService * client); + +/*! @function getCommandGate + @abstract Gets the IOCommandGate object created by IONetworkController. + @discussion When IONetworkController is started, an IOCommandGate object + is instantiated and attached to the workloop returned by getWorkLoop(). + This IOCommandGate object is used internally to synchronize client + commands handled through executeCommand(). Subclasses that need an + IOCommandGate should try to reuse the object returned by this method, + rather than creating a new instance. See IOCommandGate documentation. + @result Returns the IOCommandGate object created by IONetworkController. +*/ + + virtual IOCommandGate * getCommandGate() const; + +/*! @function getHardwareAddress + @abstract Gets the network controller's permanent hardware/station + address. + @discussion This method call is synchronized by the workloop's gate. + @param addr The buffer where the controller's hardware address should + be stored. + @param inOutAddrBytes The size of the address buffer provided by the + client, and replaced by this method with the actual size of + the hardware address in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn getHardwareAddress(void * addr, + UInt32 * inOutAddrBytes) = 0; + +/*! @function setHardwareAddress + @abstract Sets or changes the station address used by the network + controller. + @discussion This method call is synchronized by the workloop's gate. + @param buffer The buffer containing the hardware address provided by + the client. + @param addrBytes The size of the address buffer provided by the + client in bytes. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn setHardwareAddress(const void * addr, + UInt32 addrBytes) = 0; + +/*! @function enable + @abstract Handles an enable request from a client. + @discussion This method handles an enable request from a client. A client will call + enable after it has opened the controller, and before it starts to use + the controller to send and to receive packets over the network. The + client object provided is typecasted using OSDynamicCast, and depending + on whether the client is an IOKernelDebugger or an IONetworkInterface, + then an overloaded enable method that takes a more specific argument + type is called. If the client matches neither type, then + kIOReturnBadArgument is returned. A driver has the option of overriding + this base enable method, or the overloaded form. This method call is + synchronized by the workloop's gate. + @param client The client object requesting the enable. + @result Returns the return value from the overloaded enable() method, or + kIOReturnBadArgument if the client type is unknown. +*/ + + virtual IOReturn enable(IOService * client); + +/*! @function disable + @abstract Handles a disable request from a client. + @discussion This method handles a disable request from a client. A client will call + disable if it has previously enabled the controller, and it no longer + needs to transport packets or perform I/O using the controller. + The client object is typecasted using OSDynamicCast, and depending on + whether the client is an IOKernelDebugger or an IONetworkInterface, + then an overloaded disable method that takes a more specific argument + type is called. If the client matches neither type, then + kIOReturnBadArgument is returned. A driver has the option of overriding + this base disable method, or the overloaded form. This method call is + synchronized by the workloop's gate. + @param client The client object requesting the disable. + @result Returns the return from the overloaded disable() method, or + kIOReturnBadArgument if the client type is unknown. +*/ + + virtual IOReturn disable(IOService * client); + +/*! @function setMaxPacketSize + @abstract A client request to change the maximum packet size. + @discussion This method call is synchronized by the workloop's gate. + @param maxSize The new maximum packet size. + @result Returns kIOReturnUnsupported. Drivers may override this method + and return either kIOReturnSuccess to indicate that the new size + was accepted and is in effect, or an error code to indicate failure. +*/ + + virtual IOReturn setMaxPacketSize(UInt32 maxSize); + +/*! @function getMaxPacketSize + @abstract Gets the maximum packet size supported by the controller. + @param maxSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMaxPacketSize(UInt32 * maxSize) const = 0; + +/*! @function getMinPacketSize + @abstract Gets the minimum packet size supported by the controller. + @param minSize Pointer to the return value. + @result Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn getMinPacketSize(UInt32 * minSize) const = 0; + +/*! @function selectMedium + @abstract A client request to change the medium selection. + @discussion This method is called when a client issues a command + for the controller to change its current medium selection. + The implementation must call setSelectedMedium() after the change + has occurred. This method call is synchronized by the workloop's + gate. + @param medium An entry from the published medium dictionary that + represents the selection chosen by the client. + @result Returns kIOReturnUnsupported. Drivers may override this method and + return kIOReturnSuccess if the selection was successful, + or an error code otherwise. +*/ + + virtual IOReturn selectMedium(const IONetworkMedium * medium); + +/*! @function selectMediumWithName + @abstract A client request to change the medium selection. + @discussion This method is called when a client issues a command + for the controller to change its current medium selection. + This implementation will look for an entry in the medium + dictionary published by the driver that is associated with the + key given. If a match is found, then selectMedium() is called to + perform the selection, otherwise an error is reported back to the + client. Subclasses should override selectMedium() and not this + method. This method call is synchronized by the workloop's gate. + @param mediumName An OSSymbol object that describes the name of the + new medium selected by the client. + @result Returns the return from selectMedium() if a matching entry was found + from the medium dictionary. Returns kIOReturnUnsupported if a medium + dictionary does not exist, or kIOReturnBadArgument if the name given + does not match any entry in the medium dictionary. +*/ + + virtual IOReturn selectMediumWithName(const OSSymbol * mediumName); + +/*! @function getPacketFilters + @abstract Gets the set of packet filters supported by the network + controller for the given filter group. + @discussion A subclass must implement this method and report the + set of filters that are supported for the given filter group. + This method call is synchronized by the workloop's gate. + @param group The name of the filter group. + @param filters Pointer to the mask of supported filters returned by + this method. + @result Returns kIOReturnSuccess on success, or an error to indicate a + failure to discover the set of supported filters. +*/ + + virtual IOReturn getPacketFilters(const OSSymbol * group, + UInt32 * filters) const = 0; + +/*! @function enablePacketFilter + @abstract Enables one of the supported packet filters from the + given filter group. + @discussion A client will call this method to enable a supported filter + from the filter group specified. If the client wishes to enable more + than one filter, it must call this method multiple times to enable the + desired set of filters. This method call is synchronized by the + workloop's gate. + @param group The name of the filter group containing the filter to be + enabled. + @param aFilter The filter to enable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the enable request. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn enablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) = 0; + +/*! @function disablePacketFilter + @abstract Disables a packet filter that is currently enabled from the + given filter group. + @discussion After a supported filter has been successfully enabled, + a client can call this method to disable that filter. This method call + is synchronized by the workloop's gate. + @param group The name of the filter group containing the filter to be + disabled. + @param aFilter The filter to disable. + @param enabledFilters All filters currently enabled by the client. + @param options Optional flags for the disable request. + @result Returns kIOReturnSuccess on success, or an error otherwise. +*/ + + virtual IOReturn disablePacketFilter(const OSSymbol * group, + UInt32 aFilter, + UInt32 enabledFilters, + IOOptionBits options = 0) = 0; + +/*! @function getOutputQueue + @abstract Gets the IOOutputQueue object created by createOutputQueue(). + @result Returns a reference to the output queue object created by + createOutputQueue(). +*/ + + virtual IOOutputQueue * getOutputQueue() const; + +/*! @function getPacketBufferConstraints + @abstract Gets the controller's packet buffer constraints. + @discussion Called by start() to obtain the constraints on the + memory buffer for each mbuf packet allocated through allocatePacket(). + Drivers can override this method to specify the buffer constraints + imposed by their bus master hardware. Note that outbound packets, + those that originate from the network stack, are not currently + subject to the constraints reported here. + @param constraints A pointer to an IOPacketBufferConstraints + structure that this method is expected to initialize. + See IOPacketBufferConstraints structure definition. +*/ + + virtual void getPacketBufferConstraints( + IOPacketBufferConstraints * constraints) const; + +/*! @function allocatePacket + @abstract Allocates a packet with a data buffer that is larger than + or equal to the size specified. + @discussion This method will always return a single mbuf unless the + size requested (plus the alignment padding) is greater than MCLBYTES. + The data buffer for the mbuf (or an mbuf chain) returned is aligned + according to the constraints reported by getPacketBufferConstraints(). + The length fields in each mbuf returned are set by this method, thus + allowing the mbuf to be passed directly to an IOMbufMemoryCursor object + in order to convert the mbuf to a physical address scatter-gather list. + @param size The minimum size of the data buffer for the mbuf + packet allocated. + @result Returns an mbuf packet, or 0 if allocation failed. +*/ + + virtual mbuf_t allocatePacket(UInt32 size); + +/*! @function copyPacket + @abstract Allocates a new packet, containing data copied from an + existing source packet. + @discussion The source packet is not modified by this method. + @param m The source packet. + @param size The number of bytes to copy. If set to 0, then the + entire data buffer from the source packet is copied. + @result Returns a new packet containing the same data as the source packet. +*/ + + virtual mbuf_t copyPacket(const mbuf_t m, UInt32 size = 0); + +/*! @function replacePacket + @abstract Allocates a new packet to replace an existing packet, the + existing packet is then returned. + @param mp A handle to the existing packet. + @param size If size is 0, then the new packet shall have the same buffer + size as the original packet that is being replaced. Otherwise, the new + packet shall have the buffer size specified by this value. + @result If packet allocation was successful, then a replacement will + take place and the original packet will be returned. Otherwise, 0 + is returned, and the original packet will be left untouched. +*/ + + virtual mbuf_t replacePacket(mbuf_t * mp, UInt32 size = 0); + +/*! @function replaceOrCopyPacket + @abstract A helper method that combines the functionality of + copyPacket() and replacePacket() to process a packet containing + a received frame. + @discussion This method will either make a copy or replace the existing + packet, whichever is more time efficient. Packets containing small frames + are copied, otherwise they are replaced. If replaced, then the existing + packet is returned, and a new packet with the same buffer size is created + to take its place. If copied, the existing packet is left intact, while a + copy is returned that will hold a copy of the data from the source packet. + @param mp A handle to the existing packet that may be replaced. + @param length The number of bytes received held in the packet. + Must be greater than zero. + @param replaced Pointer to a return value that is set to true to indicate + that the existing packet was replaced, or false to indicate that the + existing packet was not replaced, and a copy was created. + @result Returns a replacement or a copy of the existing packet, or 0 if packet + allocation failed. +*/ + + virtual mbuf_t replaceOrCopyPacket(mbuf_t * mp, + UInt32 length, + bool * replaced); + + enum { + kDelayFree = 0x01 + }; + +/*! @function freePacket + @abstract Releases the packet given back to the free pool. + @param m The packet to be freed. + @param options When kDelayFree option is set, then the packet + provided to this function will be queued on the free packet queue. + A subsequent call to releaseFreePackets() will release all queued + packets by making a single BSD function call. Without the kDelayFree + option, the packet provided will be released immediately. +*/ + + virtual void freePacket(mbuf_t, IOOptionBits options = 0); + +/*! @function releaseFreePackets + @abstract Releases all packets held in the free packet queue. + @discussion The free packet queue is not protected by a lock. This + function must be called in a single-threaded manner with respect to + all calls to freePacket() with the kDelayFree option set. + @result Returns the number of packets queued and released. +*/ + + virtual UInt32 releaseFreePackets(); + +/*! @enum TCP/IPChecksums + @abstract TCP/IP checksums that may be supported by the + hardware. + @constant kChecksumFamilyTCPIP A value that describes the collection + of TCP/IP checksums. + @constant kChecksumIP An IP header checksum. + @constant kChecksumTCP A TCP checksum that covers the TCP header and TCP + data. + @constant kChecksumUDP A UDP checksum that covers the UDP header and UDP + data. + @constant kChecksumTCPNoPseudoHeader A TCP checksum that covers the TCP + header and the TCP data, but the pseudo header is not included in the + checksum computation. A partial 16-bit checksum value must be provided + to allow the protocol stacks to calculate and verify the final checksum. + This type of checksum is not currently supported on the output path. + @constant kChecksumUDPNoPseudoHeader A UDP checksum that covers the UDP + header and the UDP data, but the pseudo header is not included in the + checksum computation. A partial 16-bit checksum value must be provided + to allow the protocol stacks to calculate and verify the final checksum. + This type of checksum is not currently supported on the output path. + @constant kChecksumTCPSum16 The hardware has a simple checksum engine + that can perform a TCP style ones complement sum of 16-bit words over + a certain range of bytes in a packet. The hardware does not have the + ability to scan for IP or TCP headers, and the driver must pass/get + additional parameter(s) to or from the protocol stack to coordinate + the checksumming effort. +*/ + + enum { + kChecksumFamilyTCPIP = 0x00000001, + kChecksumIP = 0x0001, + kChecksumTCP = 0x0002, + kChecksumUDP = 0x0004, + kChecksumTCPNoPseudoHeader = 0x0100, + kChecksumUDPNoPseudoHeader = 0x0200, + kChecksumTCPSum16 = 0x1000 + }; + +/*! @function getChecksumSupport + @abstract Gets checksums that are supported by the network controller for + the given checksum family. + @discussion A network controller that is capable of inserting and verifying + checksums on output and input packets, should override this method and + advertise its capability in order to assist or offload the software checksum + calculations performed by the protocol stacks. + @param checksumMask A pointer to the mask of supported checksums returned + by this method. + @param checksumFamily A value that specifies the checksum family. + @param isOutput Set to true to query the support for checksum insertion on + output packets, or false to query the support for checksum verification + on input packets. Controllers that have symmetric hardware checksum support + can return a fixed checksum mask value, and ignore this argument. + @result Default return is kIOReturnUnsupported. Controllers that override + this method must return kIOReturnSuccess. Any other return value will be + interpretated as a lack of checksum support, regardless of the value + returned through the first argument. +*/ + + virtual IOReturn getChecksumSupport( UInt32 * checksumMask, + UInt32 checksumFamily, + bool isOutput ); + +/*! @function setChecksumResult + @abstract Encodes a received packet with the checksum result reported + by the hardware. + @discussion A network controller that can verify the checksum(s) for a + received packet, should call this method to encode the result on the + packet, before passing it up towards the protocol stacks. + @param packet An mbuf containing a packet that has been checksummed by + the hardware. + @param checksumFamily A value that specifies the checksum family. + @param resultMask A mask of all checksums that were checked or computed. + Setting a bit implies that the driver is able to report the result of + the checksum computation, by asserting the validity of the checksum, + or by returning a partial checksum value. + @param validMask A mask of all checksums are were computed and verified + by the hardware as valid. Certain types of checksum performed by the + hardware are inheritely incomplete, and therefore should never be marked + as valid. A checksum cannot be marked valid unless it has also been + checked. + @param param0 Optional parameter 0, defaults to 0. + @param param1 Optional parameter 1, defaults to 0. + @result Returns true if the checksum family is valid and the packet has been + encoded with the checksum result provided, false otherwise. +*/ + + virtual bool setChecksumResult( mbuf_t packet, + UInt32 checksumFamily, + UInt32 resultMask, + UInt32 validMask, + UInt32 param0 = 0, + UInt32 param1 = 0 ); + +/*! @function getChecksumDemand + @abstract Fetches the demand for hardware checksum computation and insertion + for the given packet before it is transmitted on the network. + @discussion A network controller that can insert a checksum for output + packets must call this method to obtain the set of checksums that it must + compute, and insert into the appropriate fields in the given output packet. + @param packet An mbuf containing a packet that may be missing one or more + checksums in the specified checksum family. + @param checksumFamily A value that specifies the checksum family. + @param demandMask A mask of all checksums that the hardware must compute + and insert into the appropriate checksum fields in the packet. + @param param0 Optional parameter 0, defaults to 0. + @param param1 Optional parameter 1, defaults to 0. +*/ + + virtual void getChecksumDemand( const mbuf_t packet, + UInt32 checksumFamily, + UInt32 * demandMask, + void * param0 = 0, + void * param1 = 0 ); + +/*! @function publishMediumDictionary + @abstract Publishes a dictionary of IONetworkMedium objects to + advertise the media selection supported by the network controller. + @discussion Called by drivers to publish their medium dictionary. + Each entry in the dictionary is an IONetworkMedium object that + represents a single medium that is supported by the controller. + This method will make a copy of the dictionary provided, then add + the copy to the driver's property table. The dictionary provided + can be released by the caller upon returning from this method. + It is permissible to call this method multiple times, which may be + necessary if the hardware's media capability changes dynamically. + However, if the capability is static, which is often the case, + then a driver will typically call this method only once from + its start() method. + + Several methods depend on the presence of a medium dictionary. + They should be called after the medium dictionary has been + published. Those methods are: + setSelectedMedium() + getSelectedMedium() + getMediumDictionary() + copyMediumDictionary() + + @param mediumDict A dictionary of IONetworkMedium objects. + @result Returns true if the dictionary is valid, and was successfully + exported to the property table, false otherwise. +*/ + + virtual bool publishMediumDictionary(const OSDictionary * mediumDict); + +/*! @function setSelectedMedium + @abstract Designates an entry in the published medium dictionary as + the current selected medium. + @discussion After the driver has configured the hardware to select + one of its supported media types, it must call this method to inform + its parent about the change that has occurred. IONetworkController + will update a property in the registry to reflect the current selection. + @param medium A medium object representing the current selection. + @result Returns true if the property table update was successful, + false if the update failed, or if the medium provided does not match + any entry from the published medium dictionary. +*/ + + virtual bool setSelectedMedium(const IONetworkMedium * medium); + bool setCurrentMedium(const IONetworkMedium * medium); + +/*! @function setLinkStatus + @abstract Reports the link status and the active medium. + @discussion Drivers must call this method when a link change is + detected. IONetworkController will update the link status properties + in the registry, and generate an event to inform the upper layers + about the change. + @param status Link status bits. + See IONetworkMedium for the definition of the link status bits. + @param activeMedium An object in the published medium dictionary + that represents the active medium. This may not be the same as + the selected medium. Set this to 0 if the link is inactive. + @param speed Link speed in units of bits per second. If zero, then + the link speed is taken from the medium object provided. + @param data An OSData containing any additional link parameter that + the driver wishes to publish to the registry. + @result Returns true if all link properties were successfully updated, + false otherwise. +*/ + + virtual bool setLinkStatus( + UInt32 status, + const IONetworkMedium * activeMedium = 0, + UInt64 speed = 0, + OSData * data = 0); + +/*! @function systemWillShutdown + @abstract Handles system shutdown and restart notifications. + @discussion Overrides IOService::systemWillShutdown in order + to notify network clients that the power-managed controller should be disabled. + As a result, drivers can expect their disable method to be called + before system shutdown or restart. This implementation is synchronous and can + block before calling IOService::systemWillShutdown and return. + @param See IOService::systemWillShutdown. +*/ + + virtual void systemWillShutdown( IOOptionBits specifier ); + + /* Override IOService::setAggressiveness() */ + + virtual IOReturn setAggressiveness( + unsigned long type, unsigned long newLevel ); + +protected: + +/*! @function free + @abstract Frees the IONetworkController object. + @discussion Frees the IONetworkController object by releasing all + allocated resources, followed by a call to super::free(). +*/ + + virtual void free(); + +/*! @function registerWithPolicyMaker + @abstract Implemented by controller drivers to register with + the power management policy-maker. + @discussion Drivers that are able to power manage their hardware + should override this method and register with the policy-maker + provided by calling IOService::registerPowerDriver(). + IONetworkController will call this method before the initial + attempt is made to attach a client. + @param policyMaker The policy-maker chosen to manage power for + this network controller. + @result Returns kIOReturnSuccess on success, kIOReturnUnsupported if the + driver does not support power management, or an appropriate error + return code. The default return is kIOReturnUnsupported. */ + + virtual IOReturn registerWithPolicyMaker(IOService * policyMaker); + +/*! @function createWorkLoop + @abstract Method called by IONetworkController prior to the initial + getWorkLoop() call. + @discussion Before IONetworkController calls getWorkLoop() in its + start() method, it will call createWorkLoop() to make sure that a + subclass that wants to create a workloop, will do so before its + first use. + @result Returns true to indicate success, false otherwise. Returning false + will fail IONetworkController::start(). +*/ + + virtual bool createWorkLoop(); + +/*! @function prepare + @abstract Prepares the controller before an IOService is created and + attached as a client. + @discussion This method is called by attachInterface() or + attachDebuggerClient() to prepare the controller before the new client + object is attached. This method will call publishProperties() to publish + controller capabilities and properties that may be used by client objects. + However, publishProperties() will be called only once, even if prepare() + is called multiple times. This method call is synchronized by the + workloop's gate. + @result Returns kIOReturnSuccess on success, or an error code otherwise. + Returning an error will fail the client attach. +*/ + + virtual IOReturn prepare(); + +/*! @function publishProperties + @abstract Publishes controller properties and capabilities. + @discussion Called by IONetworkController to discover controller + properties, and publish them to the property table in the I/O Kit + Registry. This method is called once by prepare(). + @result Returns true if all properties were discovered and published + successfully, false otherwise. Returning false will prevent client + objects from attaching to the controller, since a property that + a client relies upon may be missing. */ + + virtual bool publishProperties(); + +/*! @function getCommandClient + @abstract Gets the command client object. + @discussion Methods called on the workloop context to service a + client request can call this method to get the client object that + initiated the command. + @result Returns the command client. If the caller is not running on the + workloop thread, or if the thread does not have the workloop's gate + closed, then 0 is returned. +*/ + + virtual OSObject * getCommandClient() const; + +/*! @function handleOpen + @abstract Handles a client open. + @discussion This method handles a client open on the controller object. IOService + calls this method with the arbitration lock held. Subclasses + should not override this method. + @param client The client that is attempting to open the controller. + @param options Not used. See IOService. + @param argument Not used. See IOService. + @result Returns true to accept the client open, false to refuse it. +*/ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handles a client close. + @discussion This method handles a close from one of the client objects. IOService + calls this method with the arbitration lock held. Subclasses + should not override this method. + @param client The client that is closing the controller. + @param options Not used. See IOService. +*/ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on the controller. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function enable + @abstract A request from an interface client to enable the controller. + @discussion This method is called by an interface client to enable the controller. + Upon receiving this command, the controller driver must bring up the + hardware and become ready to transmit and receive packets. A driver + should also delay the allocation of most runtime resources until this + method is called in order to conserve system resources. This method call + is synchronized by the workloop's gate. + @param interface The interface client object that requested the enable. + @result Returns kIOReturnUnsupported. Drivers that override this method must + return kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn enable(IONetworkInterface * interface); + +/*! @function disable + @abstract A request from an interface client to disable the controller. + @discussion This method is called by an interface client to disable the controller. + This method should stop the hardware and disable hardware interrupt + sources. Any resources allocated by enable() should also be deallocated. + This method call is synchronized by the workloop's gate. + @param interface The interface object that requested the disable. + @result kIOReturnUnsupported. Drivers that override this method must + return Returns kIOReturnSuccess on success, or an error code otherwise. +*/ + + virtual IOReturn disable(IONetworkInterface * interface); + +/*! @function attachInterface + @abstract Attaches a new interface client object. + @discussion This method creates a new interface object and attaches it to the + controller. The createInterface() method is called to perform + the interface allocation and initialization, followed by a call to + configureInterface() to configure it. Subclasses can override those + two methods to customize the interface client attached. Drivers will + usually call this method from start(), after they are ready to process + client requests. Since most drivers will have a single interface + client, this method will likely be called only once. + @param interface Upon success (return value is true), the + interface object will be written to the handle provided. + @param doRegister If true, then registerService() is called to register + the interface, which will trigger the matching process, and will ultimately + cause the interface to become registered with the data link layer. + Drivers that wish to delay the registration can set doRegister to false, + and call registerService() on the interface object when the controller + becomes ready. This allows the driver to attach an interface without + making its services available to the rest of the system. + @result Returns true on success, false otherwise. +*/ + + virtual bool attachInterface(IONetworkInterface ** interface, + bool doRegister = true); + +/*! @function detachInterface + @abstract Detaches an interface client object. + @discussion This method will verify that the object provided is indeed + an IONetworkInterface instance, and then call its terminate() method. + Note that an interface object will close and detach from its + controller after the data link layer has removed all references to + all data structures exposed by the interface. The interface object + should be released following this call. + @param interface An interface object to be detached and terminated. + @param sync If true, the interface is terminated synchronously. + This may cause this method to block for an indeterminate + amount of time. */ + + virtual void detachInterface(IONetworkInterface * interface, + bool sync = false); + +/*! @function createInterface + @abstract Creates a new network interface object. + @discussion This method is called by attachInterface() to perform + allocation and initialization of a new interface object. A subclass of + IONetworkController must implement this method and return a matching + interface object. For example, IOEthernetController's implementation + will return an IOEthernetInterface object when createInterface() is + called. + @result Returns a newly allocated and initialized interface object. +*/ + + virtual IONetworkInterface * createInterface() = 0; + +/*! @function configureInterface + @abstract Configures a newly created network interface object. + @discussion This method configures an interface object that was created by + createInterface(). Subclasses can override this method to customize + and examine the interface object that will be attached to the + controller as a client. + @param interface The interface object to be configured. + @result Returns true if the operation was successful, false otherwise + (this will cause attachInterface() to fail and return 0). +*/ + + virtual bool configureInterface(IONetworkInterface * interface); + +/*! @function createOutputQueue + @abstract Creates an IOOutputQueue to handle output packet queueing, + and also to resolve contention for the controller's transmitter from + multiple client threads. + @discussion This method is called by start() to create an IOOutputQueue object to + handle output packet queueing. The default implementation will always + return 0, hence no output queue will be created. A driver may override + this method and return a subclass of IOOutputQueue. IONetworkController + will keep a reference to the queue created, and will release this + object when IONetworkController is freed. Also see getOutputQueue(). + @result Returns a newly allocated and initialized IOOutputQueue object. +*/ + + virtual IOOutputQueue * createOutputQueue(); + +/*! @function enable + @abstract An enable request from an IOKernelDebugger client. + @discussion Drivers that provide debugging support may either override + this method and set up the hardware to support the polled-mode send and + receive methods, receivePacket() and sendPacket(), or override the base + enable() and disable() methods that take an IOService argument. + @param debugger The IOKernelDebugger client requesting the enable. + @result Returns kIOReturnSuccess. Drivers must return kIOReturnSuccess + on success, or an error otherwise. +*/ + + virtual IOReturn enable(IOKernelDebugger * debugger); + +/*! @function disable + @abstract A disable request from an IOKernelDebugger client. + @discussion Drivers that provide debugging support may either override + this method to disable support for the polled-mode send and receive + methods, or override the base enable() and disable() methods that + take an IOService argument. + @param debugger The IOKernelDebugger client requesting the disable. + @result Returns kIOReturnSuccess. Drivers must return kIOReturnSuccess + on success, or an error otherwise. +*/ + + virtual IOReturn disable(IOKernelDebugger * debugger); + +/*! @function attachDebuggerClient + @abstract Attaches a new IOKernelDebugger client object. + @discussion This method allocates an IOKernelDebugger object and attaches it as + a client. Having a debugger client implies that the controller + supports kernel debugging, and therefore must implement the two + polled-mode methods that are called by the debugger client. See + sendPacket() and receivePacket(). Only a single debugger client + should be attached to each controller. + @param debuggerP A handle that will return the new + IOKernelDebugger object created. + @result Returns true on success, false otherwise. +*/ + + virtual bool attachDebuggerClient(IOKernelDebugger ** debuggerP); + +/*! @function detachDebuggerClient + @abstract Detaches an IOKernelDebugger client object. + @discussion This method detaches and terminates the IOKernelDebugger client object + provided. A synchronous termination is issued, and this method will + return after the debugger client has been terminated. The debugger + client should be released following this call. + @param debugger The IOKernelDebugger object to be detached and + terminated. If the argument provided is NULL or is not an + IOKernelDebugger, this method will return immediately. +*/ + + virtual void detachDebuggerClient(IOKernelDebugger * debugger); + +/*! @function reserveDebuggerLock + @abstract Takes the global debugger lock. + @discussion This method should not be used. Instead, call the + lock() method provided by IOKernelDebugger. +*/ + + void reserveDebuggerLock(); + +/*! @function releaseDebuggerLock + @abstract Releases the global debugger lock. + @discussion This method should not be used. Instead, call the + unlock() method provided by IOKernelDebugger. +*/ + + void releaseDebuggerLock(); + +/*! @function receivePacket + @abstract Debugger polled-mode receive handler. + @discussion This method must be implemented by a driver that supports + kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + client to poll for an incoming packet when the kernel debugger is active. + This method may be called from the primary interrupt context, and the + implementation must avoid any memory allocation, and must never block. + The receivePacket() method in IONetworkController is used as a placeholder, + it performs no useful action, and should not be called. A driver that + attaches a debugger client must override this method. + @param pkt Address of a receive buffer where the received packet should + be stored. This buffer has room for 1518 bytes. + @param pktSize Address where the number of bytes received must be + recorded. Set this to zero if no packets were received during + the timeout interval. + @param timeout The maximum amount of time in milliseconds to poll for + a packet to arrive before this method must return. +*/ + + virtual void receivePacket(void * pkt, UInt32 * pktSize, UInt32 timeout); + +/*! @function sendPacket + @abstract Debugger polled-mode transmit handler. + @discussion This method must be implemented by a driver that supports + kernel debugging. After a debugger client has been attached through + attachDebuggerClient(), this method will be called by the debugger + to send an outbound packet only when the kernel debugger is active. + This method may be called from the primary interrupt context, and the + implementation must avoid any memory allocation, and must never block. + The sendPacket() method in IONetworkController is used as a placeholder, + it performs no useful action, and should not be called. A driver that + attaches a debugger client must override this method. + @param pkt Pointer to a transmit buffer containing the packet to be + sent on the network. + @param pktSize The size of the transmit buffer in bytes. +*/ + + virtual void sendPacket(void * pkt, UInt32 pktSize); + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkController, 0); + OSMetaClassDeclareReservedUnused( IONetworkController, 1); + OSMetaClassDeclareReservedUnused( IONetworkController, 2); + OSMetaClassDeclareReservedUnused( IONetworkController, 3); + OSMetaClassDeclareReservedUnused( IONetworkController, 4); + OSMetaClassDeclareReservedUnused( IONetworkController, 5); + OSMetaClassDeclareReservedUnused( IONetworkController, 6); + OSMetaClassDeclareReservedUnused( IONetworkController, 7); + OSMetaClassDeclareReservedUnused( IONetworkController, 8); + OSMetaClassDeclareReservedUnused( IONetworkController, 9); + OSMetaClassDeclareReservedUnused( IONetworkController, 10); + OSMetaClassDeclareReservedUnused( IONetworkController, 11); + OSMetaClassDeclareReservedUnused( IONetworkController, 12); + OSMetaClassDeclareReservedUnused( IONetworkController, 13); + OSMetaClassDeclareReservedUnused( IONetworkController, 14); + OSMetaClassDeclareReservedUnused( IONetworkController, 15); + OSMetaClassDeclareReservedUnused( IONetworkController, 16); + OSMetaClassDeclareReservedUnused( IONetworkController, 17); + OSMetaClassDeclareReservedUnused( IONetworkController, 18); + OSMetaClassDeclareReservedUnused( IONetworkController, 19); + OSMetaClassDeclareReservedUnused( IONetworkController, 20); + OSMetaClassDeclareReservedUnused( IONetworkController, 21); + OSMetaClassDeclareReservedUnused( IONetworkController, 22); + OSMetaClassDeclareReservedUnused( IONetworkController, 23); + OSMetaClassDeclareReservedUnused( IONetworkController, 24); + OSMetaClassDeclareReservedUnused( IONetworkController, 25); + OSMetaClassDeclareReservedUnused( IONetworkController, 26); + OSMetaClassDeclareReservedUnused( IONetworkController, 27); + OSMetaClassDeclareReservedUnused( IONetworkController, 28); + OSMetaClassDeclareReservedUnused( IONetworkController, 29); + OSMetaClassDeclareReservedUnused( IONetworkController, 30); + OSMetaClassDeclareReservedUnused( IONetworkController, 31); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IONETWORKCONTROLLER_H */ + diff --git a/i386/include/IOKit/network/IONetworkData.h b/i386/include/IOKit/network/IONetworkData.h new file mode 100644 index 0000000..c0d2de4 --- /dev/null +++ b/i386/include/IOKit/network/IONetworkData.h @@ -0,0 +1,477 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKDATA_H +#define _IONETWORKDATA_H + +#define IONetworkParameter IONetworkData // FIXME + +/*! @enum NetworkDataAccessTypes + @abstract Constants that describe access types. + @constant kIONetworkDataAccessTypeRead Read access. + @constant kIONetworkDataAccessTypeWrite Write access. + @constant kIONetworkDataAccessTypeReset Reset access. + @constant kIONetworkDataAccessTypeSerialize Serialization access. +*/ + +enum { + kIONetworkDataAccessTypeRead = 0x01, + kIONetworkDataAccessTypeWrite = 0x02, + kIONetworkDataAccessTypeReset = 0x04, + kIONetworkDataAccessTypeSerialize = 0x08, + kIONetworkDataAccessTypeMask = 0xff +}; + +/*! @define kIONetworkDataBasicAccessTypes + @discussion The default access types supported by an IONetworkData + object. Allow read() and serialize(). */ + +#define kIONetworkDataBasicAccessTypes \ + (kIONetworkDataAccessTypeRead | kIONetworkDataAccessTypeSerialize) + +/*! @enum NetworkDataBufferTypes + @abstract The types of data buffers that can be managed by an IONetworkData object. + @constant kIONetworkDataBufferTypeInternal An internal data buffer + allocated by the init() method. + @constant kIONetworkDataBufferTypeExternal An external (persistent) data + buffer. + @constant kIONetworkDataBufferTypeNone No data buffer. The only useful + action perfomed by an IONetworkData object with this buffer type + is to call the access notification handler. +*/ + +enum { + kIONetworkDataBufferTypeInternal = 0, + kIONetworkDataBufferTypeExternal, + kIONetworkDataBufferTypeNone +}; + +/*! @defined kIONetworkDataBytes + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataBytes property is an OSData that describes + the data buffer of an IONetworkData object. This property is present + only if kIONetworkDataAccessTypeSerialize access is supported. +*/ + +#define kIONetworkDataBytes "Data" + +/*! @defined kIONetworkDataAccessTypes + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataAccessTypes property is an OSNumber that + describes the supported access types of an IONetworkData object. +*/ + +#define kIONetworkDataAccessTypes "Access Types" + +/*! @defined kIONetworkDataSize + @abstract A property of IONetworkData objects. + @discussion The kIONetworkDataSize property is an OSNumber that + describes the size of the data buffer of an IONetworkData object. +*/ + +#define kIONetworkDataSize "Size" + +#ifdef KERNEL + +#include +#include + +/*! @class IONetworkData + @abstract An object that manages a fixed-size named buffer. + @discussion An IONetworkData object manages a fixed-size named buffer. + This object provides external access methods that can be used to + access the contents of the data buffer. In addition, serialization + is supported, and therefore this object can be added to a property + table to publish the data object. An unique name must be assigned to + the object during initialization. An OSSymbol key will be created + based on the assigned name, and this key can be used when the object + is added to a dictionary. + + The level of access granted to the access methods can be restricted, + by specifying a set of supported access types when the object is + initialized, or modified later by calling setAccessTypes(). By default, + each IONetworkData object created will support serialization, and will + also allow its data buffer to be read through the read() access method. + + An access notification handler, in the form of a 'C' function, can + be registered to receive a call each time the data buffer is accessed + through an access method. Arguments provided to the handler will identify + the data object and the type of access that triggered the notification. + The handler can therefore perform lazy update of the data buffer until + an interested party tries to read or serialize the data. The notification + handler can also take over the default action performed by the access + methods when the buffer type is set to kIONetworkDataBufferTypeNone. + This will prevent the access methods from accessing the data buffer, + and allow the handler to override the access protocol. + + This object is primarily used by IONetworkInterface to export interface + properties to user space. +*/ + + +class IONetworkData : public OSObject +{ + OSDeclareDefaultStructors( IONetworkData ) + +public: + +/*! @typedef Action + @abstract Defines a C function that may be called by an IONetworkData object + when one of its access methods is called. + @param target The target of the notification. + @param param A parameter that was provided when the notification + handler was registered. + @param data The IONetworkData object being accessed, and the + sender of the notification. + @param accessType A bit will be set indicating the type of access + which triggered the notification. + @param buffer Pointer to the accessor's buffer. Only valid for + read() and write() accesses. + @param bufferSize Pointer to the size of the accessor's buffer. + @param offset An offset from the start of the data buffer to begin + reading or writing. +*/ + + typedef IOReturn (*Action)(void * target, + void * param, + IONetworkData * data, + UInt32 accessType, + void * buffer, + UInt32 * bufferSize, + UInt32 offset); + +protected: + const OSSymbol * _key; // key associated with this object. + UInt32 _access; // supported access types. + void * _buffer; // Data buffer. + UInt32 _bufType; // buffer type + UInt32 _size; // data buffer size. + void * _tapTarget; // target for access notification. + Action _tapAction; // the function to call. + void * _tapParam; // arbitrary notification param. + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData * _reserved; + + +/*! @function free + @abstract Frees the IONetworkData object. +*/ + + virtual void free(); + +/*! @function writeBytes + @abstract Writes to the data buffer with data from a source buffer + provided by the caller. + @param srcBuffer Pointer to a source buffer provided by the caller. + @param srcBufferSize The size of the source buffer. + @param writeOffset A byte offset from the start of the data buffer + to begin writting. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool writeBytes(const void * srcBuffer, + UInt32 srcBufferSize, + UInt32 writeOffset = 0); + +/*! @function readBytes + @abstract Reads from the data buffer and copies the data to a destination + buffer provided by the caller. + @param dstBuffer Pointer to the destination buffer. + @param dstBufferSize Pointer to an integer containing the size of the + destination buffer. And is overwritten by this method with the actual + number of bytes copied to the destination buffer. + @param readOffset A byte offset from the start of the data buffer + to begin reading. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool readBytes(void * dstBuffer, + UInt32 * dstBufferSize, + UInt32 readOffset = 0) const; + +/*! @function clearBuffer + @abstract Clears the data buffer by filling it with zeroes. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool clearBuffer(); + +public: + +/*! @function withInternalBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object with an internal data buffer. + @param name A name to assign to this object. + @param bufferSize The number of bytes to allocate for the internal data + buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * + withInternalBuffer(const char * name, + UInt32 bufferSize, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function withExternalBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object with an external data buffer. + @param name A name to assign to this object. + @param bufferSize The size of the external data buffer. + @param externalBuffer Pointer to the external data buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * + withExternalBuffer(const char * name, + UInt32 bufferSize, + void * externalBuffer, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function withNoBuffer + @abstract Factory method that constructs and initializes an + IONetworkData object without a data buffer. + @discussion The notification handler + must intervene when the IONetworkData is accessed. + @param name A name to assign to this object. + @param bufferSize The size of the phantom data buffer. + @param accessTypes The initial supported access types. + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns an IONetworkData object on success, or 0 otherwise. +*/ + + static IONetworkData * withNoBuffer(const char * name, + UInt32 bufferSize, + UInt32 accessTypes, + void * target, + Action action, + void * param = 0); + +/*! @function init + @abstract Initializes an IONetworkData object. + @param name A name to assign to this object. + @param bufferType The type of buffer associated with this object. + @param bufferSize The size of the data buffer. + @param externalBuffer Pointer to an external data buffer. + @param accessTypes The initial supported access types. + Can be later modified by calling setAccessTypes(). + @param target The notification target. + @param action The notification action. + @param param A parameter to pass to the notification action. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(const char * name, + UInt32 bufferType, + UInt32 bufferSize, + void * externalBuffer = 0, + UInt32 accessTypes = + kIONetworkDataBasicAccessTypes, + void * target = 0, + Action action = 0, + void * param = 0); + +/*! @function setAccessTypes + @abstract Sets the types of access that are permitted on the data buffer. + @param types A mask of access types indicating the supported access + types. +*/ + + virtual void setAccessTypes(UInt32 types); + +/*! @function setNotificationTarget + @abstract Registers a C function to handle access notifications sent + from this object. + @discussion A notification is sent by an IONetworkData object to the + registered notification handler, when an access method is called to + modify the contents of the data buffer. + @param target The first parameter passed to the notification handler. + @param action A pointer to a C function that will handle the notification. + If 0, then notification is disabled. + @param param An optional parameter passed to the notification handler. +*/ + + virtual void setNotificationTarget(void * target, + Action action, + void * param = 0); + +/*! @function getBuffer + @abstract Gets a pointer to the data buffer. + @result Returns a pointer to the data buffer. Returns 0 if the buffer type is + kIONetworkDataBufferTypeNone. +*/ + + virtual const void * getBuffer() const; + +/*! @function getBufferType + @abstract Gets the type of data buffer managed by this object. + @result Returns a constant that describes the type of the data buffer. +*/ + + virtual UInt32 getBufferType() const; + +/*! @function getAccessTypes + @abstract Gets the types of data access supported by this object. + @result Returns a mask of supported access types. +*/ + + virtual UInt32 getAccessTypes() const; + +/*! @function getNotificationTarget + @abstract Gets the first parameter that will be passed to the access + notification handler. + @result Returns the first parameter that will be passed to the access notification + handler. +*/ + + virtual void * getNotificationTarget() const; + +/*! @function getNotificationAction + @abstract Gets the C function that was registered to handle access + notifications sent from this object. + @result Returns a pointer to a C function, or 0 if notification is disabled. +*/ + + virtual Action getNotificationAction() const; + +/*! @function getNotificationParameter + @abstract Gets the parameter that will be passed to the access + notification handler. + @result Returns the parameter that will be passed to the access notification + handler. +*/ + + virtual void * getNotificationParameter() const; + +/*! @function getKey + @abstract Gets a unique OSSymbol key associated with this object. + @discussion During initialization, IONetworkData will create an + OSSymbol key based on its assigned name. + @result Returns an OSSymbol key that was generated from the name assigned to + this object. +*/ + + virtual const OSSymbol * getKey() const; + +/*! @function getSize + @abstract Gets the size of the data buffer. + @result Returns the size of the data buffer managed by this object in bytes. +*/ + + virtual UInt32 getSize() const; + +/*! @function reset + @abstract An access method that resets the data buffer. + @discussion This method handles an external request to reset the data buffer. + If notification is enabled, then the notification handler is called + after the data buffer has been cleared. + @result Returns kIOReturnSuccess on success, + kIOReturnNotWritable if reset access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn reset(); + +/*! @function read + @abstract An access method that reads from the data buffer. + @discussion This method handles an external request to read from the data buffer + and copy it to the destination buffer provided by the accessor. + If notification is enabled, then the notification handler is called + before the data buffer is copied to the destination buffer. The + notification handler may use this opportunity to intervene and + to update the contents of the data buffer. + @param dstBuffer Pointer to the destination buffer. + @param dstBufferSize Pointer to an integer containing the size of the + destination buffer. And is overwritten by this method to the actual number + of bytes copied to the destination buffer. + @param readOffset An offset from the start of the source data buffer to + begin reading. + @result Returns kIOReturnSuccess on success, + kIOReturnBadArgument if any of the arguments provided is invalid, + kIOReturnNotReadable if read access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn read(void * dstBuffer, + UInt32 * dstBufferSize, + UInt32 readOffset = 0); + +/*! @function write + @abstract An access method that writes to the data buffer. + @discussion This method handles an external request to write to the data buffer + from a source buffer provided by the accessor. After checking that + the data object supports write accesses, the data buffer is updated + if it exists. Then the registered notification handler is called. + @param srcBuffer Pointer to the source buffer. + @param srcBufferSize The number of bytes to write to the data buffer. + @param writeOffset An offset from the start of the destination data buffer + to begin writing. + @result Returns kIOReturnSuccess on success, + kIOReturnBadArgument if any of the arguments provided is invalid, + kIOReturnNotWritable if write access is not permitted, + or an error from the notification handler. +*/ + + virtual IOReturn write(void * srcBuffer, + UInt32 srcBufferSize, + UInt32 writeOffset = 0); + +/*! @function serialize + @abstract Serializes the IONetworkData object. + @discussion If notification is enabled, then the notification + handler is called just before the data buffer is serialized. + @param s An OSSerialize object. + @result Returns true on success, false otherwise. +*/ + + virtual bool serialize(OSSerialize * s) const; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkData, 0); + OSMetaClassDeclareReservedUnused( IONetworkData, 1); + OSMetaClassDeclareReservedUnused( IONetworkData, 2); + OSMetaClassDeclareReservedUnused( IONetworkData, 3); +}; + +#endif /* KERNEL */ + +#endif /* !_IONETWORKDATA_H */ diff --git a/i386/include/IOKit/network/IONetworkInterface.h b/i386/include/IOKit/network/IONetworkInterface.h new file mode 100644 index 0000000..af02364 --- /dev/null +++ b/i386/include/IOKit/network/IONetworkInterface.h @@ -0,0 +1,1104 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKINTERFACE_H +#define _IONETWORKINTERFACE_H + +/*! @defined kIONetworkInterfaceClass + @abstract The name of the IONetworkInterface class. +*/ + +#define kIONetworkInterfaceClass "IONetworkInterface" + +/*! @defined kIONetworkData + @abstract A property of IONetworkInterface + objects. + @discussion The kIONetworkData property has an OSDictionary value and is a container for the + set of IONetworkData objects managed by the interface. + Each entry in the dictionary is a key/value pair consisting of + the network data name, and an OSDictionary describing the + contents of the network data. +*/ + +#define kIONetworkData "IONetworkData" + +/*! @defined kIOInterfaceType + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceType property has an OSNumber value that specifies the type of + network interface that this interface represents. The type + constants are defined in bsd/net/if_types.h. +*/ + +#define kIOInterfaceType "IOInterfaceType" + +/*! @defined kIOMaxTransferUnit + @abstract A property of IONetworkInterface objects. + @discussion The kIOMaxTransferUnit property has an OSNumber value that specifies the maximum + transfer unit for the interface in bytes. +*/ + +#define kIOMaxTransferUnit "IOMaxTransferUnit" + +/*! @defined kIOMediaAddressLength + @abstract A property of IONetworkInterface objects. + @discussion The kIOMediaAddressLength property has an OSNumber value that specifies the size of the + media address in bytes. +*/ + +#define kIOMediaAddressLength "IOMediaAddressLength" + +/*! @defined kIOMediaHeaderLength + @abstract A property of IONetworkInterface objects. + @discussion The kIOMediaHeaderLength property has an OSNumber value that specifies the size of the + media header in bytes. +*/ + +#define kIOMediaHeaderLength "IOMediaHeaderLength" + +/*! @defined kIOInterfaceFlags + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceFlags property has an OSNumber value that specifies the current value + of the interface flags. The flag constants are defined in + bsd/net/if.h. +*/ + +#define kIOInterfaceFlags "IOInterfaceFlags" + +/*! @defined kIOInterfaceExtraFlags + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceExtraFlags property has an OSNumber value that specifies the current + value of the interface extra flags. The extra flag constants are + defined in bsd/net/if.h. +*/ + +#define kIOInterfaceExtraFlags "IOInterfaceExtraFlags" + +/*! @defined kIOInterfaceUnit + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceUnit property has an OSNumber value that describes the unit number + assigned to the interface object. +*/ + +#define kIOInterfaceUnit "IOInterfaceUnit" + +/*! @defined kIOInterfaceState + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceState property has an OSNumber value that describes the current state + of the interface object. This property is not exported to BSD via + the ifnet structure. +*/ + +#define kIOInterfaceState "IOInterfaceState" + +/*! @defined kIOInterfaceNamePrefix + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceNamePrefix property has an OSString value that describes the string + prefix for the BSD name assigned to the interface. +*/ + +#define kIOInterfaceNamePrefix "IOInterfaceNamePrefix" + +/*! @defined kIOPrimaryInterface + @abstract A property of IONetworkInterface objects. + @discussion The kIOInterfaceNamePrefix property has an OSBoolean value that describes whether the + interface is the primary or the built-in network interface. +*/ + +#define kIOPrimaryInterface "IOPrimaryInterface" + +/*! @defined kIOBuiltin + @abstract kIOBuiltin is a property of IONetworkInterface + objects. It has an OSBoolean value. + @discussion The kIOBuiltin property describes whether the + interface is built-in. +*/ + +#define kIOBuiltin "IOBuiltin" + +/*! @defined kIOLocation + @abstract kIOLocation is a property of IONetworkInterface + objects. It has an OSString value. + @discussion The kIOLocation property describes the physical + location of built-in interfaces. +*/ + +#define kIOLocation "IOLocation" + +/*! @enum InterfaceObjectStates + @discussion Constants used to encode the state of the interface object. + @constant kIONetworkInterfaceRegisteredState The interface object has + registered with the data link layer. + @constant kIONetworkInterfaceOpenedState One or more clients have an + open on the interface object. + @constant kIONetworkInterfaceDisabledState The interface is temporarily + unable to service its clients. This will occur when the network + controller that is servicing the interface has entered a low power + state that renders it unusable. +*/ + +enum { + kIONetworkInterfaceRegisteredState = 0x1, + kIONetworkInterfaceOpenedState = 0x2, + kIONetworkInterfaceDisabledState = 0x4 +}; + +/* + * Kernel + */ +#if defined(KERNEL) && defined(__cplusplus) + +#include +#include +#include +#include +#include + +class IONetworkController; +class IONetworkStack; +class IOCommandGate; + +/*! @typedef IOOutputAction + @discussion Prototype for an output packet handler that will process + all outbound packets sent to the interface from the data link layer. + An output handler is registered with the interface by calling + registerOutputHandler(). + @param m A packet mbuf. + @param param A parameter for the output request. */ + +typedef UInt32 (OSObject::*IOOutputAction)(mbuf_t, void * param); + +/*! @typedef BPF_FUNC + @discussion Prototype for the BPF tap handler. This will disappear + when the correct DLIL header file is included. */ + +typedef int (*BPF_FUNC)(struct ifnet *, struct mbuf *); + +// Network event types recognized by inputEvent(). +// +enum { + /* DLIL defined event, argument must be a pointer to a + kern_event_msg structure. */ + kIONetworkEventTypeDLIL = 0xff000001, + + /* Link up event, no argument */ + kIONetworkEventTypeLinkUp = 0xff000002, + + /* Link down event, no argument */ + kIONetworkEventTypeLinkDown = 0xff000003, + + /* Wake on LAN support changed, no argument */ + kIONetworkEventWakeOnLANSupportChanged = 0xff000004 +}; + +/*! @class IONetworkInterface + @abstract Abstract class that manages the connection between an IONetworkController and the data link interface layer. + @discussion An IONetworkInterface object manages the connection between + an IONetworkController and the data link interface layer (DLIL). + All interactions between the controller and DLIL must go through an + interface object. Any data structures that are required by DLIL for a + particular interface type shall be allocated and mantained by the + interface object. IONetworkInterface is an abstract class that must be + extended by a concrete subclass to specialize for a particular network + type. + + Although most drivers will allocate a single interface object, + it is possible for multiple interfaces to be attached to a single + controller. This controller driver will be responsible for arbitrating + access among its multiple interface clients. + + IONetworkInterface also maintains a dictionary of IONetworkData + objects containing statistics structures. Controller drivers can + ask for a particular data object by name and update the + statistics counters within directly. This dictionary is added to + the interface's property table and is visible outside of the kernel. +*/ + +class IONetworkInterface : public IOService +{ + OSDeclareAbstractStructors( IONetworkInterface ) + + friend class IONetworkStack; + +private: + IONetworkController * _controller; + ifnet_t _backingIfnet; + IORecursiveLock * _ifLock; + OSSet * _clientSet; + OSNumber * _stateBits; + bpf_packet_func _inputFilterFunc; + bpf_packet_func _outputFilterFunc; + OSObject * _outTarget; + IOOutputAction _outAction; + UInt32 _clientVar[4]; + OSDictionary * _dataDict; + mbuf_t _inputQHead; + mbuf_t _inputQTail; + UInt32 _inputQCount; + + struct ExpansionData { + int unit; + int type; + int mtu; + int flags; + int eflags; + int addrlen; + int hdrlen; + IONetworkStats driverStats; + IONetworkStats lastDriverStats; + struct ifnet_stat_increment_param inputDeltas; + IOLock *detachLock; + char *remote_NMI_pattern; + unsigned int remote_NMI_len; + }; + + ExpansionData * _reserved; + + void _syncFromBackingIfnet() const; + void _syncToBackingIfnet(); + + bool _syncNetworkDataDict(); + bool _setInterfaceProperty(UInt32 value, + UInt32 mask, + UInt32 bytes, + void * addr, + char * name); + + SInt32 syncSIOCSIFMEDIA(IONetworkController * ctlr, struct ifreq * ifr); + SInt32 syncSIOCGIFMEDIA(IONetworkController * ctlr, struct ifreq * ifr, unsigned long cmd); + SInt32 syncSIOCSIFMTU(IONetworkController * ctlr, struct ifreq * ifr); + + static int performGatedCommand(void *, void *, void *, void *, void *); + static errno_t ioctl_shim(ifnet_t ifp, unsigned long cmd, void * data); + static errno_t set_bpf_tap_shim(ifnet_t ifn, bpf_tap_mode mode, bpf_packet_func func); + static int output_shim(ifnet_t ifp, mbuf_t); + void DLIL_INPUT(mbuf_t m_head); + static void detach_shim(ifnet_t ifp); + static void powerChangeHandler(void *, void *, void *); + +public: + +/*! @function isPrimaryInterface + @abstract Queries whether the interface object provided represents + the "primary" network interface for the system. + @result Returns true if the interface provided is the primary inteface, + false otherwise. +*/ + + virtual bool isPrimaryInterface() const; + +/*! @function init + @abstract Initializes an IONetworkInterface object. + @discussion Initializes instance variables, and allocates resources. + @param controller A network controller object that will service + the interface object being initialized. + @result Returns true on success, false otherwise. +*/ + + virtual bool init( IONetworkController * controller ); + +/*! @function isRegistered + @abstract Returns true if the interface has been registered with + the data link layer. + @discussion Once registered, the interface will be assigned a + BSD name (such as en0), and a kIOBSDNameKey property is added to the + property table containing this name. Calling this method performs + the same function as checking for the kIONetworkInterfaceRegisteredState + bit in the value returned by getInterfaceState(). + @result Returns true if interface is registered. Returns false if the data link layer + has no references to this network interface, which implies that either the + interface has yet to attach to the data link layer, or the interface has + been detached. +*/ + + virtual bool isRegistered() const; + +/*! @function getInterfaceState + @abstract Reports the current state of the interface object by returning + the interface state flags. + @result Returns the interface state flags. +*/ + + virtual UInt32 getInterfaceState() const; + +/*! @function matchPropertyTable + @abstract Overrides the implementation in IOService to + implement family-specific matching. + @discussion When the gIOLocationMatchKey property is present in the + dictionary provided, then fail the match unless the kIOBSDNameKey property + is found. This is to prevent a premature match when hunting for a root + device for BSD. The presence of the kIOBSDNameKey property indicates that + the interface has registered with BSD, and is a valid candidate for + matching against the gIOLocationMatchKey property. If the + gIOLocationMatchKey property is absent, then this method will always + return true. + @param table The dictionary of properties to match against. + @param score Pointer to the current driver's probe score, not used. + @result Returns true for a positive match, false otherwise. +*/ + + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + +/*! @function getController + @abstract Returns the provider, an IONetworkController object, that + is servicing this interface object. + @discussion This is the same controller object that was supplied as + an argument to the init() method. + @result Returns the IONetworkController object that is providing service to + this interface object. +*/ + + virtual IONetworkController * getController() const; + +/*! @function inputPacket + @abstract Submits a single packet received from the network to the data link layer. + @discussion This method is called by the network controller to submit a single packet + received from the network to the data link layer. The packet received by this method may be added to an input + queue on the interface object, which the controller can use to postpone + the packet handoff to the upper layers, until all received packets have + been transferred to the input queue. A subsequent call to flushInputQueue(), + will transfer the entire contents of the queue to the data link layer, + by making a single call to dlil_input(). Other methods that can be used + to manage the input queue are flushInputQueue() and clearInputQueue(). + This input queue is not protected by a lock. Access to the queue by the + controller must be serialized, otherwise its use must be avoided. + @param m The mbuf containing the received packet. + @param length Specify the size of the received packet in the mbuf. + The mbuf length fields are updated with this value. If zero, + then the mbuf length fields are not updated. + @param options Options defined by inputPacket() that the caller + can use to specify this method call. + @param param A parameter provided by the caller. Not used by + IONetworkInterface. + @result Returns the number of packets that were submitted to the data link layer, + or 0 if the packet was queued. +*/ + + virtual UInt32 inputPacket(mbuf_t, + UInt32 length = 0, + IOOptionBits options = 0, + void * param = 0); + +/*! @enum InputOptionQueuePacket + @discussion The option bits that can be specified + in the options argument when calling inputPacket(). + @constant kInputOptionQueuePacket Keep the packet provided in the + input packet queue. No packets are sent to the data link layers, + and the caller's thread will not venture outside the interface + object. Calls to inputPacket() must be serialized. +*/ + + enum { + kInputOptionQueuePacket = 0x1 + }; + +/*! @function flushInputQueue + @abstract Sends all packets held in the input queue to the data + link layer. + @discussion Remove all packets from the input queue and + send them to the data link layer by calling dlil_input(). This + method should be used in connection with the inputPacket() method, + to flush the input queue after inputPacket() was used to queue up + some number of received packets. See inputPacket() and clearInputQueue(). + @result Returns the number of packets that were submitted to the data link layer. + May be zero if the queue was empty. +*/ + + virtual UInt32 flushInputQueue(); + +/*! @function clearInputQueue + @abstract Removes and discards all packets in the input queue. + @discussion This method removes all packets from the input queue and + releases them back to the free mbuf pool. Also see flushInputQueue(). + @result Returns the number of packets freed. +*/ + + virtual UInt32 clearInputQueue(); + +/*! @function inputEvent + @abstract Sends an event to the data link layer. + @discussion This method can be used by the network controller to + send an event to the data link layer. + @param type A constant describing the event type. + @param data Data associated with the event. + @result Returns true if the event was delivered, false if the event type + specified is invalid, or if the event delivery was unsuccesful. +*/ + + virtual bool inputEvent(UInt32 type, void * data); + +/*! @function registerOutputHandler + @abstract Registers a target/action to handle output packets. + @discussion The interface object will forward all output packets, + received from the data link layer, to the output handler registered + through this method. The default target and action are set by the init() + method to the controller, and the handler returned by the controller's + getOutputHandler() method. Once the interface becomes registered with + the data link layer, this method will return false and will reject any + further changes. + @param target Target object that implements the output handler. + @param action The function that will process output packets. + @result Returns true if the target/action provided was accepted, + false otherwise. +*/ + + virtual bool registerOutputHandler(OSObject * target, + IOOutputAction action); + +/*! @function getNamePrefix + @abstract Returns a string containing the prefix to use when + creating a BSD name for this interface. + @discussion The BSD name for each interface object is generated by + concatenating a string returned by this method, with an unique + unit number assigned by IONetworkStack. + A concrete subclass of IONetworkInterface must implement this method + and enforce a consistent name for all of its instances. + @result Returns a pointer to a constant C string. +*/ + + virtual const char * getNamePrefix() const = 0; + +/*! @function getInterfaceType + @abstract Gets the interface type. + @discussion This method returns the value in the if_type field in the ifnet structure. + @result Returns a constant defined in bsd/net/if_types.h header file + that describes the interface type. +*/ + + virtual UInt8 getInterfaceType() const; + +/*! @function getMaxTransferUnit + @abstract Gets the maximum transfer unit for this interface. + @discussion This method returns the value in the if_mtu field in the ifnet structure. + @result Returns the interface MTU size in bytes. +*/ + + virtual UInt32 getMaxTransferUnit() const; + +/*! @function getFlags + @abstract Gets the value of the interface flags. + @discussion This method returns the value in the if_flags field in the ifnet structure. + @result Returns the value of the interface flags. +*/ + + virtual UInt16 getFlags() const; + +/*! @function getExtraFlags + @abstract Gets the value of the interface extra flags. + @discussion This method returns the value in the if_eflags field in the ifnet structure. + @result Returns the value of the interface extra flags. +*/ + + virtual UInt32 getExtraFlags() const; + +/*! @function getMediaAddressLength + @abstract Gets the size of the media (MAC-layer) address. + @discussion This method returns the value in the if_addrlen field in the ifnet structure. + @result Returns the size of the media address in bytes. +*/ + + virtual UInt8 getMediaAddressLength() const; + +/*! @function getMediaHeaderLength + @abstract Gets the size of the media header. + @discussion This method returns the value in the if_hdrlen field in the ifnet structure. + @result Returns the size of the media header in bytes. +*/ + + virtual UInt8 getMediaHeaderLength() const; + +/*! @function getUnitNumber + @abstract Gets the unit number assigned to this interface object. + @discussion This method returns the value in the if_unit field in the ifnet structure. + @result Returns the assigned interface unit number. +*/ + + virtual UInt16 getUnitNumber() const; + +/*! @function addNetworkData + @abstract Adds an IONetworkData object to a dictionary managed by + the interface. + @param aData An IONetworkData object to be added to a dictionary + managed by the interface. This object is retained by the dictionary. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool addNetworkData(IONetworkData * aData); + +/*! @function removeNetworkData + @abstract Removes an entry from the IONetworkData dictionary + managed by the interface. + @discussion This method removes an entry from the IONetworkData dictionary + managed by the interface. The removed object is released. + @param aKey A unique OSSymbol identifying the IONetworkData object + to be removed from the dictionary. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool removeNetworkData(const OSSymbol * aKey); + +/*! @function removeNetworkData + @abstract Removes an entry from the IONetworkData dictionary + managed by the interface. + @discussion This method removes an entry from the IONetworkData dictionary + managed by the interface. The removed object is released. + @param aKey A unique string identifying the IONetworkData object + to be removed from the dictionary. + @result Returns true if the operation was successful, false otherwise. +*/ + + virtual bool removeNetworkData(const char * aKey); + +/*! @function getNetworkData + @abstract Gets an IONetworkData object from the interface that is + associated with the given key. + @param aKey The unique string identifying the IONetworkData object to be + returned to caller. + @result Returns a reference to the matching IONetworkData object, + or 0 if no match was found. +*/ + + virtual IONetworkData * getNetworkData(const char * aKey) const; + +/*! @function getNetworkData + @abstract Gets an IONetworkData object from the interface that is + associated with the given key. + @param aKey The unique OSSymbol identifying the IONetworkData object to be + returned to caller. + @result Returns a reference to the matching IONetworkData object, + or 0 if no match was found. +*/ + + virtual IONetworkData * getNetworkData(const OSSymbol * aKey) const; + +/*! @function setProperties + @abstract Handles a request to set network interface properties from + kernel or non-kernel clients. + @discussion For non-kernel clients, the preferred + access mechanism is through a user client connection. + @param properties An OSDictionary containing a collection of + properties. + @result Returns kIOReturnUnsupported if the interface did not + recognize any of the properties provided. Otherwise, the return + code will be kIOReturnSuccess to indicate no errors, or an + IOReturn error code to indicate that an error occurred while + handling one of the properties. +*/ + + virtual IOReturn setProperties( OSObject * properties ); + + // FIXME - Compatibility methods (to be removed) + IONetworkData * getParameter(const char * aKey) const; + bool setExtendedFlags(UInt32 flags, UInt32 clear = 0); + + virtual IOReturn message( UInt32 type, IOService * provider, void * argument ); + +/*! @function debuggerRegistered + @abstract Tells the IONetworkInterface that this interface will be used + by the debugger. +*/ + void debuggerRegistered(void); + +protected: + +/*! @function setInterfaceType + @abstract Sest the interface type. + @discussion Both the if_type field in the ifnet structure, and the + kIOInterfaceType property are updated with the value provided. + @param type A constant defined in bsd/net/if_types.h header file + that describes the interface type. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setInterfaceType(UInt8 type); + +/*! @function setMaxTransferUnit + @abstract Sets the maximum transfer unit for this interface. + @discussion Both the if_mtu field in the ifnet structure, and the + kIOMaxTransferUnit property are updated with the value provided. + @param mtu The interface MTU size in bytes. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setMaxTransferUnit(UInt32 mtu); + +/*! @function setFlags + @abstract Performs a read-modify-write operation on the current + interface flags value. + @discussion See bsd/net/if.h header file for the definition of the + flag constants. Both the if_flags field in the ifnet structure, and + the kIOInterfaceFlags property are updated with the value provided. + @param flags The bits that should be set. + @param clear The bits that should be cleared. If 0, then non + of the flags are cleared and the result is formed by OR'ing the + original flags value with the new flags. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setFlags(UInt16 flags, UInt16 clear = 0); + +/*! @function setExtraFlags + @abstract Performs a read-modify-write operation on the current + interface extra flags value. + @discussion See bsd/net/if.h header file for the definition of the + extra flag constants. Both the if_eflags field in the ifnet structure, + and the kIOInterfaceExtraFlags property are updated with the value + provided. + @param flags The bits that should be set. + @param flags The bits that should be set. + @param clear The bits that should be cleared. If 0, then non + of the flags are cleared and the result is formed by OR'ing the + original flags with the new flags. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setExtraFlags(UInt32 flags, UInt32 clear = 0); + +/*! @function setMediaAddressLength + @abstract Sets the size of the media (MAC-layer) address. + @discussion Both the if_addrlen field in the ifnet structure, and the + kIOMediaAddressLength property are updated with the value provided. + @param length The size of the media address in bytes. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setMediaAddressLength(UInt8 length); + +/*! @function setMediaHeaderLength + @abstract Sets the size of the media header. + @discussion Both the if_hdrlen field in the ifnet structure, and the + kIOMediaHeaderLength property are updated with the value provided. + @param length The size of the media header in bytes. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setMediaHeaderLength(UInt8 length); + +/*! @function setUnitNumber + @abstract Assigns a unique unit number to this interface. + @discussion This method is called by IONetworkStack before the + interface is registered with the data link layer, to assign a + unique unit number to the interface object. Both the if_unit field + in the ifnet structure, and the kIOInterfaceUnit property are updated + with the value provided. + @param unit The unit number assigned to this interface object. + @result Returns true if the update was successful, false otherwise. +*/ + + virtual bool setUnitNumber(UInt16 unit); + +/*! @function free + @abstract Frees the IONetworkInterface object. + @discussion Resource allocated by init() are released, and + clearInputQueue() is called to ensure that the input queue is empty. +*/ + + virtual void free(); + +/*! @function handleOpen + @abstract Handles a client open on the interface. + @discussion This method is called by IOService::open() with the + arbitration lock held, and must return true to accept the client open. + This method will in turn call handleClientOpen() to qualify the client + requesting the open. Since the controller is opened by the interface + in a lazy fashion, the interface may also perform an open on the + controller before this method returns. If the controller was opened, + then controllerDidOpen() is called to notify interested subclasses. + Subclasses should not override this method. + @param client The client object that requested the open. + @param options Options passed to IOService::open(). + @param argument Argument passed to IOService::open(). + @result Returns true to accept the client open, false otherwise. +*/ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClose + @abstract Handles a client close on the interface. + @discussion This method is called by IOService::close() with the + arbitration lock held. This method will in turn call handleClientClose() + to notify interested subclasses about the client close. If this represents + the last close, then the interface will also close the controller before + this method returns. The controllerWillClose() method will be called before + closing the controller. Subclasses should not override this method. + @param client The client object that requested the close. + @param options Options passed to IOService::close(). +*/ + + virtual void handleClose(IOService * client, IOOptionBits options); + +/*! @function handleIsOpen + @abstract Queries whether a client has an open on the interface. + @discussion This method is always called by IOService with the + arbitration lock held. Subclasses should not override this method. + @result Returns true if the specified client, or any client if none (0) is + specified, presently has an open on this object. +*/ + + virtual bool handleIsOpen(const IOService * client) const; + +/*! @function lock + @abstract Takes the network interface lock. + @discussion This method takes the recursive lock that protects the interface + state. All updates to the interface state and to the ifnet structure + must be performed while holding this lock. This call must be balanced + by a subsequent call to unlock(). +*/ + + virtual void lock(); + +/*! @function unlock + @abstract Releases the network interface lock. + @discussion This method releases the recursive lock that protects the interface + state to balance a previous lock() call. +*/ + + virtual void unlock(); + +/*! @function controllerDidOpen + @abstract Sends a notification that the interface has opened the network + controller. + @discussion This method is called by handleOpen() to notify subclasses that the + controller has been opened. The open on the controller is done when + the interface receives the initial open request from a client. + Subclasses can override this method and inspect the controller before + allowing the client open. The implementation in the subclass must first + call the method in super and check the return value. This method is + called with our arbitration lock held, hence issuing I/O to the + controller must be avoided to eliminate the possibility of a + deadlock. + @param controller The controller that was opened. + @result Must return true in order for handleOpen() to accept + the client open. If the return is false, then the controller will be + closed and the client open will be refused. +*/ + + virtual bool controllerDidOpen(IONetworkController * controller); + +/*! @function controllerWillClose + @abstract Sends a notification that the interface will close the network + controller. + @discussion This method is called by handleClose() after receiving a close from the + last client, and just before the controller is closed. Subclasses + can override this method to perform any cleanup action before the + controller is closed. This method is called with our arbitration lock + held, hence issuing I/O to the controller must be avoided to eliminate + the possibility of a deadlock. + @param controller The controller that is about to be closed. +*/ + + virtual void controllerWillClose(IONetworkController * controller); + +/*! @function performCommand + @abstract Handles an ioctl command sent to the network interface. + @discussion This method handles socket ioctl commands sent to the + network interface from DLIL. + IONetworkInterface handles commands that are common for all network + interface types. A subclass of IONetworkInterface may override this + method to override the command handling in IONetworkInterface, or + to extend the command processing to handle additional commands, + and then call super for any commands not handled in the subclass. + The ioctl commands handled by IONetworkInterface are + SIOCGIFMTU (Get interface MTU size), + SIOCSIFMTU (Set interface MTU size), + SIOCSIFMEDIA (Set media), and + SIOCGIFMEDIA (Get media and link status). + @param controller The controller object. + @param cmd The ioctl command code. + @param arg0 Command argument 0. Generally a pointer to an ifnet structure + associated with the interface. + @param arg1 Command argument 1. + @result Returns a BSD return value defined in bsd/sys/errno.h. +*/ + + virtual SInt32 performCommand(IONetworkController * controller, + unsigned long cmd, + void * arg0, + void * arg1); + +public: + +/*! @function getIfnet + @abstract Gets the ifnet_t allocated by the interface object. + @discussion Reveal the interface's ifnet_t. The ifnet_t is managed + primarily by IONetworkInterface, however sub-classes or drivers + can use this method to get a reference to the ifnet_t object for + interface KPI calls. + @result Returns the ifnet_t object that is attached to the datalink layer. +*/ + + virtual ifnet_t getIfnet() const ; + +protected: + +/*! @function initIfnet + @abstract Initializes the ifnet structure given. + @discussion A concrete subclass must override this method and initialize + the ifnet structure given. The implementation in the subclass must call + super before it returns, to allow IONetworkInterface to complete the + initialization, and to insert the BSD shim functions implemented in + IONetworkInterface to the appropriate function pointer fields in the + ifnet structure. IONetworkInterface will call this method during its + init() method. Subclasses are encouraged to use the ifnet accessor + methods to update the ifnet structure when possible, since this will + ensure that properties in the registry will also be updated to reflect + any changes made. + @param ifp Pointer to an ifnet structure obtained earlier through + the getIfnet() method call. + @result Returns true on success, false otherwise. +*/ + + virtual bool initIfnet(struct ifnet * ifp); + +/*! @function handleClientOpen + @abstract Handles a client open on the interface. + @discussion This method is called by handleOpen() to handle an open from a client object. + Unlike handleOpen(), subclasses may override this method to catch an open + request from a client. This method is called with the arbitration lock held. + @param client The client object requesting the open. + @param options Options passed to IONetworkInterface::handleOpen(). + @param argument Argument passed to IONetworkInterface::handleOpen(). + @result Returns true to accept the client open, false to refuse it. +*/ + + virtual bool handleClientOpen(IOService * client, + IOOptionBits options, + void * argument); + +/*! @function handleClientClose + @abstract Handles a client close on the interface. + @discussion This method is called by handleClose() to handle a close from a client object. + Unlike handleClose(), subclasses may override this method to catch a close + reuqest from a client. This method is called with the arbitration lock held. + @param client The client object requesting the close. + @param options Options passed to IONetworkInterface::handleClose(). +*/ + + virtual void handleClientClose(IOService * client, + IOOptionBits options); + +/*! @function newUserClient + @abstract Creates a connection for a non kernel client. + @discussion This method creates a new IOUserClient to service a connection to a + non kernel client. + @param owningTask The mach task requesting the connection. + @param security_id A token representing the access level for the task. + @param type A constant specifying the type of connection to be created. + An IONetworkUserClient object is created if the type specified is + kIONetworkUserClientTypeID. + @param handler The IOUserClient object returned. + @result Returns kIOReturnSuccess if an IONetworkUserClient was created, + kIOReturnNoMemory for a memory allocation error, or + kIOReturnBadArgument if the type specified is unknown. +*/ + + virtual IOReturn newUserClient(task_t owningTask, + void * security_id, + UInt32 type, + IOUserClient ** handler); + +/*! @function setInterfaceState + @abstract Updates the interface object state flags. + @discussion The kIOInterfaceState property is updated with the value + provided. + @param flags The bits that should be set. + @param clear The bits that should be cleared. + @result Returns the resulting interface state flags following any changes + made by this method. +*/ + + virtual UInt32 setInterfaceState( UInt32 set, UInt32 clear = 0 ); + +/*! @function powerStateWillChangeTo + @abstract Handles a notification that the network controller servicing + this interface object is about to transition to a new power state. + @discussion This method will call the controllerWillChangePowerState() method + on the controller's work loop context to prepare for the power state change. + Subclasses should not override this method. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return will always be IOPMAckImplied to indicate that the + preparation for the power change has already completed when this method + returns. +*/ + + virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function powerStateDidChangeTo + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @discussion This method will call the controllerDidChangePowerState() method + on the controller's work loop context to prepare for the power state change. + Subclasses should not override this method. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return will always be IOPMAckImplied to indicate that the + preparation for the power change has already completed when this method + returns. +*/ + + virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags flags, + unsigned long stateNumber, + IOService * policyMaker ); + +/*! @function controllerWillChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object is about to transition to a new power state. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller is switching to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return value is always kIOReturnSuccess. +*/ + + virtual IOReturn controllerWillChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +/*! @function controllerDidChangePowerState + @abstract Handles a notification that the network controller servicing + this interface object has transitioned to a new power state. + @param controller The network controller object. + @param flags Flags that describe the capability of the controller in the new + power state. + @param stateNumber An index to a state in the network controller's + power state array that the controller has switched to. + @param policyMaker A reference to the network controller's policy-maker, + and is also the originator of this notification. + @result The return value is always kIOReturnSuccess. +*/ + + virtual IOReturn controllerDidChangePowerState( + IONetworkController * controller, + IOPMPowerFlags flags, + UInt32 stateNumber, + IOService * policyMaker); + +public: + /* Override IOService::willTerminate() */ + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ); + + /* Override IOService::serializeProperties() */ + + virtual bool serializeProperties( OSSerialize * s ) const; + +/*! @function attachToDataLinkLayer + @abstract Attaches the network interface to the BSD data link layer. + @discussion This function is called by the family to attach the network + interface managed by an IONetworkInterface to the BSD data link layer. + This call occurs after the interface initialization and setup, and the + assignment of an interface unit number. The family does not implicitly + close the gate on the network controller's work loop when calling this + function. Prior to the data link attachment, services provided by an + IONetworkInterface will be inaccessible to BSD networking, though the + object can be found in the I/O Kit Registry. Subclasses can override + this function to perform interface specific work. + @param options Options for the attach call. None are currently defined. + @param parameter Parameter for the attach call. Not currently used. + @result Returns kIOReturnSuccess on success. +*/ + + virtual IOReturn attachToDataLinkLayer( IOOptionBits options, + void * parameter ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 0); + +/*! @function detachFromDataLinkLayer + @abstract Detaches the network interface from the BSD data link layer. + @discussion This function is called by the family to detach the network + interface managed by an IONetworkInterface from the BSD data link layer. + This call is made when the interface is terminated, before the last close. + The family does not implicitly close the gate on the network controller's + work loop when calling this function. Subclasses can override this function + to perform additional interface specific work. + @param options Options for the detach call. None are currently defined. + @param parameter Parameter for the detach call. Not currently used. +*/ + + virtual void detachFromDataLinkLayer( IOOptionBits options, + void * parameter ); + + OSMetaClassDeclareReservedUsed(IONetworkInterface, 1); + +protected: +/*! @function feedInputPacketTap + @abstract Feed received packets to the BPF + @discussion This function is called by the family for each inbound packet + to feed it to the BPF function. Interface classes can override if they + need to provide class specific functionality or modifications to the BPF tap. + @param mbuf Pointer to the packet. +*/ + virtual void feedPacketInputTap(mbuf_t); + + OSMetaClassDeclareReservedUsed( IONetworkInterface, 2); + +/*! @function feedOutputPacketTap + @abstract Feed sent packets to the BPF + @discussion This function is called by the family for each outbound packet + to feed it to the BPF function. Interface classes can override if they + need to provide class specific functionality or modifications to the BPF tap. + @param mbuf Pointer to the packet. +*/ + virtual void feedPacketOutputTap(mbuf_t); + + OSMetaClassDeclareReservedUsed( IONetworkInterface, 3); + + virtual bool initIfnetParams(struct ifnet_init_params *params); + OSMetaClassDeclareReservedUsed( IONetworkInterface, 4); + +public: + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkInterface, 5); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 6); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 7); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 8); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 9); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 10); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 11); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 12); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 13); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 14); + OSMetaClassDeclareReservedUnused( IONetworkInterface, 15); +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* !_IONETWORKINTERFACE_H */ diff --git a/i386/include/IOKit/network/IONetworkMedium.h b/i386/include/IOKit/network/IONetworkMedium.h new file mode 100644 index 0000000..2a64f3d --- /dev/null +++ b/i386/include/IOKit/network/IONetworkMedium.h @@ -0,0 +1,426 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKMEDIUM_H +#define _IONETWORKMEDIUM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/*! @typedef IOMediumType + @discussion A 32-bit value divided into fields which describes + a single medium type. */ + +typedef UInt32 IOMediumType; + +/*! @defined kIOMediumType + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumType property is an OSNumber object that describes the type of + medium that this object represents. +*/ + +#define kIOMediumType "Type" + +/*! @defined kIOMediumFlags + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumFlags property is an OSNumber object that describes a set of + attributes assigned to the medium. +*/ + +#define kIOMediumFlags "Flags" + +/*! @defined kIOMediumSpeed + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumSpeed property is an OSNumber object that describes the maximum link + speed supported by the medium in bits per second. +*/ + +#define kIOMediumSpeed "Speed" + +/*! @defined kIOMediumIndex + @abstract A property of IONetworkMedium objects. + @discussion The kIOMediumIndex property is an OSNumber object that describes an index assigned + by the owner of the medium object. Its interpretation is driver + specific. +*/ + +#define kIOMediumIndex "Index" + +//=========================================================================== +// Medium Type (IOMediumType). +// +// The medium type is encoded by a 32-bit value. The definitions of +// the fields and the encoding for each field is adapted from FreeBSD. +// +// Bits Definition +// ------------------- +// 4-0 medium subtype +// 7-5 network type +// 15-8 network specific options +// 19-16 reserved +// 27-20 common options +// 31-28 instance number + +// Ethernet. +// +enum { + kIOMediumEthernet = IFM_ETHER, + kIOMediumEthernetAuto = ( IFM_AUTO | IFM_ETHER ), + kIOMediumEthernetManual = ( IFM_MANUAL | IFM_ETHER ), + kIOMediumEthernetNone = ( IFM_NONE | IFM_ETHER ), + kIOMediumEthernet10BaseT = ( IFM_10_T | IFM_ETHER ), + kIOMediumEthernet10Base2 = ( IFM_10_2 | IFM_ETHER ), + kIOMediumEthernet10Base5 = ( IFM_10_5 | IFM_ETHER ), + kIOMediumEthernet100BaseTX = ( IFM_100_TX | IFM_ETHER ), + kIOMediumEthernet100BaseFX = ( IFM_100_FX | IFM_ETHER ), + kIOMediumEthernet100BaseT4 = ( IFM_100_T4 | IFM_ETHER ), + kIOMediumEthernet100BaseVG = ( IFM_100_VG | IFM_ETHER ), + kIOMediumEthernet100BaseT2 = ( IFM_100_T2 | IFM_ETHER ), + kIOMediumEthernet1000BaseSX = ( IFM_1000_SX | IFM_ETHER ), + kIOMediumEthernet10BaseSTP = ( IFM_10_STP | IFM_ETHER ), + kIOMediumEthernet10BaseFL = ( IFM_10_FL | IFM_ETHER ), + kIOMediumEthernet1000BaseLX = ( IFM_1000_LX | IFM_ETHER ), + kIOMediumEthernet1000BaseCX = ( IFM_1000_CX | IFM_ETHER ), + kIOMediumEthernet1000BaseTX = ( IFM_1000_T | IFM_ETHER ), //deprecated- use kIOMediumEthernet1000BaseT instead + kIOMediumEthernet1000BaseT = ( IFM_1000_T | IFM_ETHER ), + kIOMediumEthernetHomePNA1 = ( IFM_HPNA_1 | IFM_ETHER ), + kIOMediumEthernet10GBaseSR = ( IFM_10G_SR | IFM_ETHER ), + kIOMediumEthernet10GBaseLR = ( IFM_10G_LR | IFM_ETHER ), + kIOMediumEthernet10GBaseCX4 = ( IFM_10G_CX4 | IFM_ETHER ), + kIOMediumEthernet10GBaseT = ( IFM_10G_T | IFM_ETHER ) +}; + +// IEEE 802.11 Wireless. +// +enum { + kIOMediumIEEE80211 = IFM_IEEE80211, + kIOMediumIEEE80211Auto = ( IFM_AUTO | IFM_IEEE80211 ), + kIOMediumIEEE80211Manual = ( IFM_MANUAL | IFM_IEEE80211 ), + kIOMediumIEEE80211None = ( IFM_NONE | IFM_IEEE80211 ), + kIOMediumIEEE80211FH1 = ( IFM_IEEE80211_FH1 | IFM_IEEE80211 ), + kIOMediumIEEE80211FH2 = ( IFM_IEEE80211_FH2 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS2 = ( IFM_IEEE80211_DS2 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS5 = ( IFM_IEEE80211_DS5 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS11 = ( IFM_IEEE80211_DS11 | IFM_IEEE80211 ), + kIOMediumIEEE80211DS1 = ( IFM_IEEE80211_DS1 | IFM_IEEE80211 ), + kIOMediumIEEE80211OptionAdhoc = IFM_IEEE80211_ADHOC +}; + +// Common options. +// +enum { + kIOMediumOptionFullDuplex = IFM_FDX, + kIOMediumOptionHalfDuplex = IFM_HDX, + kIOMediumOptionFlowControl = IFM_FLOW, + kIOMediumOptionFlag0 = IFM_FLAG0, + kIOMediumOptionFlag1 = IFM_FLAG1, + kIOMediumOptionFlag2 = IFM_FLAG2, + kIOMediumOptionLoopback = IFM_LOOP +}; + +// Medium type masks. +// +#define kIOMediumSubTypeMask IFM_TMASK +#define kIOMediumNetworkTypeMask IFM_NMASK +#define kIOMediumOptionsMask IFM_OMASK +#define kIOMediumCommonOptionsMask IFM_GMASK +#define kIOMediumInstanceShift IFM_ISHIFT +#define kIOMediumInstanceMask IFM_IMASK + +// Medium type field accessors. +// +#define IOMediumGetSubType(x) ((x) & kIOMediumSubTypeMask) +#define IOMediumGetNetworkType(x) ((x) & kIOMediumNetworkMask) +#define IOMediumGetInstance(x) (((x) & kIOMediumInstanceMask) >> \ + kIOMediumInstanceShift) + +//=========================================================================== +// Medium flags. + + +//=========================================================================== +// Link status bits. +// +enum { + kIONetworkLinkValid = IFM_AVALID, // link status is valid + kIONetworkLinkActive = IFM_ACTIVE // link is up/active. +}; + +#ifdef __cplusplus +} +#endif + +//=========================================================================== +// IONetworkMedium class. + +#ifdef KERNEL + +#include +#include + +/*! @class IONetworkMedium + @abstract An object that encapsulates information about a network + medium (i.e. 10Base-T, or 100Base-T Full Duplex). + @discussion The main purpose of + this object is for a network driver to advertise its media capability, + through a collection of IONetworkMedium objects stored in a dictionary + in its property table. IONetworkMedium supports serialization, and will + encode its properties in the form of a dictionary to the serialization + stream when instructed. This will allow a user-space application to + browse the set of media types supported by the controller. +*/ + +class IONetworkMedium : public OSObject +{ + OSDeclareDefaultStructors( IONetworkMedium ) + +protected: + IOMediumType _type; + UInt32 _flags; + UInt64 _speed; + UInt32 _index; + const OSSymbol * _name; + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + + +/*! @function free + @abstract Frees the IONetworkMedium object. +*/ + + virtual void free(); + +public: + +/*! @function nameForType + @abstract Creates a name that describes a medium type. + @discussion Given a medium type, creates an OSymbol object that + describes the medium type. There is a 1-to-1 mapping between the + medium type, and the medium name created by this method. The caller + is responsible for releasing the OSSymbol object returned. + @param type A medium type. See IONetworkMedium.h for type encoding. + @result Returns an OSSymbol object is created based on the type provided. +*/ + + static const OSSymbol * nameForType(IOMediumType type); + +/*! @function addMedium + @abstract Adds an IONetworkMedium object to a dictionary. + @discussion A helper function to add an IONetworkMedium object to a + given dictionary. The name of the medium is used as the key for the + new dictionary entry. + @param dict An OSDictionary object where the medium object should be + added as a new entry. + @param medium The IONetworkMedium object to add to the dictionary. + @result Returns true on success, false otherwise. +*/ + + static bool addMedium(OSDictionary * dict, + const IONetworkMedium * medium); + +/*! @function removeMedium + @abstract Removes an IONetworkMedium object from a dictionary. + @discussion A helper function to remove an entry in a dictionary. + @param dict The OSDictionary object where the medium object should be + removed from. + @param medium The name of this medium object is used as the key. +*/ + + static void removeMedium(OSDictionary * dict, + const IONetworkMedium * medium); + +/*! @function getMediumWithType + @abstract Finds a medium object from a dictionary with a given type. + @discussion This method iterates through a dictionary and returns an IONetworkMedium + entry with the given type. An optional mask supplies the don't care bits. + @param dict The dictionary to look for a matching entry. + @param type Search for an entry with this type. + @param mask The don't care bits in IOMediumType. Defaults to 0, which + implies that a perfect match is desired. + @result Returns the first matching IONetworkMedium entry found, + or 0 if no match was found. +*/ + + static IONetworkMedium * getMediumWithType(const OSDictionary * dict, + IOMediumType type, + IOMediumType mask = 0); + +/*! @function getMediumWithIndex + @abstract Finds a medium object from a dictionary with a given index. + @discussion This method iterates through a dictionary and returns an IONetworkMedium + entry with the given index. An optional mask supplies the don't care bits. + @param dict The dictionary to look for a matching entry. + @param index Search for an entry with the given index. + @param mask The don't care bits in index. Defaults to 0, which + implies that a perfect match is desired. + @result Returns the first matching IONetworkMedium entry found, + or 0 if no match was found. +*/ + + static IONetworkMedium * getMediumWithIndex(const OSDictionary * dict, + UInt32 index, + UInt32 mask = 0); + +/*! @function init + @abstract Initializes an IONetworkMedium object. + @param type The medium type, this value is encoded with bits defined in + IONetworkMedium.h. + @param speed The maximum (or the only) link speed supported over this + medium in units of bits per second. + @param flags An optional flag for the medium object. + See IONetworkMedium.h for defined flags. + @param index An optional index number assigned by the owner. + Drivers can use this to store an index to a media table in + the driver, or it may map to a driver-defined media type. + @param name An optional name assigned to this medium object. If 0, + then a name will be created based on the medium type by + calling IONetworkMedium::nameForType(). Since the name of + the medium is used as a key when inserted into a dictionary, + the name chosen must be unique within the scope of the owner. + @result Returns true on success, false otherwise. +*/ + + virtual bool init(IOMediumType type, + UInt64 speed, + UInt32 flags = 0, + UInt32 index = 0, + const char * name = 0); + +/*! @function medium + @abstract Factory method that allocates and initializes an IONetworkMedium object. + @param type The medium type, this value is encoded with bits defined in + IONetworkMedium.h. + @param speed The maximum (or the only) link speed supported over this + medium in units of bits per second. + @param flags An optional flag for the medium object. + See IONetworkMedium.h for defined flags. + @param index An optional index number assigned by the owner. + Drivers can use this to store an index to a media table in + the driver, or it may map to a driver-defined media type. + @param name An optional name assigned to this medium object. If 0, + then a name will be created based on the medium type by + calling IONetworkMedium::nameForType(). Since the name of + the medium is used as a key when inserted into a dictionary, + the name chosen must be unique within the scope of the owner. + @result Returns an IONetworkMedium instance on success, or 0 otherwise. +*/ + + static IONetworkMedium * medium(IOMediumType type, + UInt64 speed, + UInt32 flags = 0, + UInt32 index = 0, + const char * name = 0); + +/*! @function getType + @result Returns the medium type assigned to this medium object. +*/ + + virtual IOMediumType getType() const; + +/*! @function getSpeed + @result Returns the maximum link speed supported by this medium. +*/ + + virtual UInt64 getSpeed() const; + +/*! @function getFlags + @result Returns the medium flags. +*/ + + virtual UInt32 getFlags() const; + +/*! @function getIndex + @result Returns the assigned medium index. +*/ + + virtual UInt32 getIndex() const; + +/*! @function getName + @result Returns the name assigned to this medium object. +*/ + + virtual const OSSymbol * getName() const; + +/*! @function getKey + @result Returns the key to use for this medium object. This key should be + used when this object is added to a dictionary. Same as getName(). +*/ + + virtual const OSSymbol * getKey() const; + +/*! @function isEqualTo + @abstract Tests for equality between two IONetworkMedium objects. + @discussion Two IONetworkMedium objects are considered equal if + they have similar properties assigned to them during initialization. + @param medium An IONetworkMedium to test against the IONetworkMedium + object being called. + @result Returns true if equal, false otherwise. +*/ + + virtual bool isEqualTo(const IONetworkMedium * medium) const; + +/*! @function isEqualTo + @abstract Tests for equality between a IONetworkMedium object and an + OSObject. + @discussion The OSObject is considered equal to the IONetworkMedium + object if the OSObject is an IONetworkMedium, and they have + similar properties assigned to them during initialization. + @param obj An OSObject to test against an IONetworkMedium object. + @result Returns true if equal, false otherwise. +*/ + + virtual bool isEqualTo(const OSMetaClassBase * obj) const; + +/*! @function serialize + @abstract Serializes the IONetworkMedium object. + @discussion A dictionary is created containing the properties + assigned to this medium object, and this dictionary is then + serialized using the OSSerialize object provided. + @param s An OSSerialize object. + @result Returns true on success, false otherwise. +*/ + + virtual bool serialize(OSSerialize * s) const; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IONetworkMedium, 0); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 1); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 2); + OSMetaClassDeclareReservedUnused( IONetworkMedium, 3); +}; + +// Translate getKey() to getName(). +// +inline const OSSymbol * IONetworkMedium::getKey() const +{ + return getName(); +} + +#endif /* KERNEL */ + +#endif /* !_IONETWORKMEDIUM_H */ diff --git a/i386/include/IOKit/network/IONetworkStats.h b/i386/include/IOKit/network/IONetworkStats.h new file mode 100644 index 0000000..f6e6f9f --- /dev/null +++ b/i386/include/IOKit/network/IONetworkStats.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IONETWORKSTATS_H +#define _IONETWORKSTATS_H + +/*! @header IONetworkStats.h + @discussion Generic network statistics. */ + +//------------------------------------------------------------------------ +// Generic network statistics. Common to all network interfaces. +// +// WARNING: This structure must match the statistics field in +// ifnet->if_data. This structure will overlay a portion of ifnet. + +/*! @typedef IONetworkStats + @discussion Generic network statistics structure. + @field inputPackets count input packets. + @field inputErrors count input errors. + @field outputPackets count output packets. + @field outputErrors count output errors. + @field collisions count collisions on CDMA networks. */ + +typedef struct { + UInt32 inputPackets; + UInt32 inputErrors; + UInt32 outputPackets; + UInt32 outputErrors; + UInt32 collisions; +} IONetworkStats; + +/*! @defined kIONetworkStatsKey + @discussion Defines the name of an IONetworkData that contains + an IONetworkStats. */ + +#define kIONetworkStatsKey "IONetworkStatsKey" + +//------------------------------------------------------------------------ +// Output queue statistics. + +/*! @typedef IOOutputQueueStats + @discussion Statistics recorded by IOOutputQueue objects. + @field capacity queue capacity. + @field size current size of the queue. + @field peakSize peak size of the queue. + @field dropCount number of packets dropped. + @field outputCount number of output packets. + @field retryCount number of retries. + @field stallCount number of queue stalls. */ + +typedef struct { + UInt32 capacity; + UInt32 size; + UInt32 peakSize; + UInt32 dropCount; + UInt32 outputCount; + UInt32 retryCount; + UInt32 stallCount; + UInt32 reserved[4]; +} IOOutputQueueStats; + +/*! @defined kIOOutputQueueStatsKey + @discussion Defines the name of an IONetworkData that contains + an IOOutputQueueStats. */ + +#define kIOOutputQueueStatsKey "IOOutputQueueStatsKey" + +#endif /* !_IONETWORKSTATS_H */ diff --git a/i386/include/IOKit/network/IOOutputQueue.h b/i386/include/IOKit/network/IOOutputQueue.h new file mode 100644 index 0000000..cb40702 --- /dev/null +++ b/i386/include/IOKit/network/IOOutputQueue.h @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOOUTPUTQUEUE_H +#define _IOOUTPUTQUEUE_H + +#include + +// Forward declarations. +// +struct mbuf; +class IONetworkData; + +// FIXME - We do not want the enqueue/dequeue macros defined in queue.h. +// +#undef enqueue(queue,elt) +#undef dequeue(queue) + +// FIXME - Belongs in IOBasicOutputQueue.h +// +/*! @enum OutputPacketStatus + @abstract The status of the packet sent to the target. + @constant kIOOutputStatusMask Define the status field in the return code. + @constant kIOOutputStatusAccept Packet was accepted by the target. + @constant kIOOutputStatusDropped Packet accepted, but was also dropped. + @constant kIOOutputStatusRetry Target ran out of resources, and is unable + to accept the packet. The ownership of the packet reverts back to the + queue. +*/ + +enum { + kIOOutputStatusMask = 0x00ff, + kIOOutputStatusAccepted = 0x0000, + kIOOutputStatusDropped = 0x0001, + kIOOutputStatusRetry = 0x0002 +}; + +/*! @enum OutputCommands + @abstract A command requested by the target. + @constant kIOOutputCommandMask Define the command field in the return code. + @constant kIOOutputCommandNone No command. + @constant kIOOutputCommandStall A command to stall the queue. +*/ + +enum { + kIOOutputCommandMask = 0xff00, + kIOOutputCommandNone = 0x0000, + kIOOutputCommandStall = 0x0100 +}; + +/*! @enum OutputHandlerReturnCodes + @abstract Common return codes returned by the target's output handler. + @constant kIOReturnOutputSuccess Packet was accepted. + @constant kIOReturnOutputDropped Packet was dropped. + @constant kIOReturnOutputStall Stall the queue and retry the same packet + when the queue is restarted. +*/ + +enum { + kIOReturnOutputSuccess = (kIOOutputStatusAccepted | kIOOutputCommandNone), + kIOReturnOutputDropped = (kIOOutputStatusDropped | kIOOutputCommandNone), + kIOReturnOutputStall = (kIOOutputStatusRetry | kIOOutputCommandStall) +}; + +/*! @class IOOutputQueue + @abstract A packet queue that supports multiple producers and a single + consumer. + @discussion Each producer, or a client thread, will deliver a chain of packets + to the queue. A single consumer will remove packets from the queue one at a + time and forward it to the registered target/action. This object may be used + by an IONetworkController on the output (transmit) side to handle the output + packet flow downstream from an IONetworkInterface, and then call the driver's + output function. IOOutputQueue is an abstract class that provides an interface + for its subclasses. Concrete subclasses will complete the implementation, and + specify the context that the target is called for packets removed from + the queue. +*/ + +class IOOutputQueue : public OSObject +{ + OSDeclareAbstractStructors( IOOutputQueue ) + +private: + + static void runServiceThread(thread_call_param_t, thread_call_param_t); + +protected: + + thread_call_t _callEntry; // callout entry structure. + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + + +/*! @function init + @abstract Initializes an IOOutputQueue object. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool init(); + +/*! @function free + @abstract Frees the IOOutputQueue object. + @discussion Release allocated resources, then call super::free(). +*/ + + virtual void free(); + +/*! @function scheduleServiceThread + @abstract Schedules a service thread callout. + @discussion This method can be called by service() to schedule + a thread that will call serviceThread() when it starts running. + @param param A parameter to pass to the serviceThread() method. + @result Returns true if a thread callout was scheduled, false otherwise. +*/ + + virtual bool scheduleServiceThread(void * param); + +/*! @function cancelServiceThread + @abstract Cancels any pending service thread callout. + @result Returns true if a previously scheduled thread callout was canceled, + false otherwise. +*/ + + virtual bool cancelServiceThread(); + +/*! @function serviceThread + @abstract Method called by the scheduled service thread when it + starts to run. + @discussion Must be implemented by a subclass that calls + scheduleServiceThread(). The default implementation does nothing. + @param param A parameter that was given to scheduleServiceThread() + when the service thread was scheduled. +*/ + + virtual void serviceThread(void * param); + +public: + +/*! @function start + @abstract Starts up the queue. + @discussion This method is called by the target to start the queue. This will allow + packets to be removed from the queue, then delivered to the target. + @result Returns true if the queue was started successfully, false otherwise. +*/ + + virtual bool start() = 0; + +/*! @function stop + @abstract Stops the queue. + @discussion Stop the queue and prevent it from sending packets to its + target. + @result Returns the previous running state of the queue, + true if the queue was running, false if the queue was already stopped. +*/ + + virtual bool stop() = 0; + +/*! @function service + @abstract Services the queue. + @discussion Manage the queue after it has been started. + @param options Options for the service request. + @result Returns a return value to indicate the service result. +*/ + + virtual bool service(IOOptionBits options = 0) = 0; + +/*! @function flush + @abstract Drops and frees all packets currently held by the queue. + @result Returns the number of packets that were dropped and freed. +*/ + + virtual UInt32 flush() = 0; + +/*! @function setCapacity + @abstract Changes the number of packets that the queue can hold + before it begins to drop excess packets. + @param capacity The new desired capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity) = 0; + +/*! @function getCapacity + @abstract Gets the number of packets that the queue can hold. + @discussion The queue will begin to drop incoming packets when the + size of queue reaches its capacity. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const = 0; + +/*! @function getSize + @abstract Gets the number of packets currently held in the queue. + @result Returns the size of the queue. +*/ + + virtual UInt32 getSize() const = 0; + +/*! @function enqueue + @abstract Adds a packet, or a chain of packets, to the queue. + @discussion This method is called by a client to add a packet, or a chain of packets, + to the queue. A packet is described by an mbuf chain, while a chain + of packets is constructed by linking multiple mbuf chains via the + m_nextpkt field. + @param m A single packet, or a chain of packets. + @param param A parameter provided by the caller. + @result Returns a return code. +*/ + + virtual UInt32 enqueue(mbuf_t m, void * param) = 0; + +/*! @function getOutputHandler + @abstract Returns the address of a function that is designated to handle + incoming packets sent to the queue object. + @result Returns the address of the enqueue() method. +*/ + + virtual IOOutputAction getOutputHandler() const; + +/*! @function getStatisticsData + @abstract Returns an IONetworkData object containing statistics counters + updated by the queue. + @result Returns an IONetworkData object. This implementation will always return + 0. +*/ + + virtual IONetworkData * getStatisticsData() const; + + // Virtual function padding + OSMetaClassDeclareReservedUnused( IOOutputQueue, 0); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 1); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 2); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 3); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 4); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 5); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 6); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 7); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 8); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 9); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 10); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 11); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 12); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 13); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 14); + OSMetaClassDeclareReservedUnused( IOOutputQueue, 15); +}; + +#endif /* !_IOOUTPUTQUEUE_H */ diff --git a/i386/include/IOKit/network/IOPacketQueue.h b/i386/include/IOKit/network/IOPacketQueue.h new file mode 100644 index 0000000..88d8c21 --- /dev/null +++ b/i386/include/IOKit/network/IOPacketQueue.h @@ -0,0 +1,290 @@ +/* + * Copyright (c) 1998-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPACKETQUEUE_H +#define _IOPACKETQUEUE_H + +#include +#include +extern "C" { +#include +} +// Forward declarations. +// +struct mbuf; +struct IOMbufQueue; + +// We do not want the enqueue/dequeue macros defined in queue.h. +// +// #warning queue.h should not be included +#undef enqueue(queue,elt) +#undef dequeue(queue) + +/*! @class IOPacketQueue + @abstract Implements a bounded FIFO queue of mbuf packets. + @discussion Packets are + removed from the head of the queue (dequeue), and new packets are added + to the tail of the queue (enqueue). A spinlock is used to synchronize + access to the queue between methods that have a "lock" prefix. +*/ + +class IOPacketQueue : public OSObject +{ + OSDeclareDefaultStructors( IOPacketQueue ) + +protected: + IOMbufQueue * _queue; // mbuf queue + IOSimpleLock * _lock; // spinlock for synchronized methods + + struct ExpansionData { }; + /*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *_reserved; + +/*! @function free + @abstract Frees the IOPacketQueue object. + @discussion All packets held by the queue are released back to the free + pool, resource are deallocated, then super::free() is called. +*/ + + virtual void free(); + +/*! @var IOPacketQueueDefaultCapacity + @abstract Describes the default capacity of the + queue object. + @discussion The capacity is only observed by the enqueue() method. + Therefore, it is possible for the size of the queue to exceed its + capacity when other methods, such as prepend(), are used to add packets + to the queue. +*/ + + static const UInt32 IOPacketQueueDefaultCapacity = 100; + +public: + +/*! @function withCapacity + @abstract Factory method that constructs and initializes an + IOPacketQueue object. + @param capacity The initial capacity of the queue object. Can be + later changed by calling the setCapacity() method. + @result Returns an IOPacketQueue instance on success, or 0 otherwise. +*/ + + static IOPacketQueue * withCapacity(UInt32 capacity = + IOPacketQueueDefaultCapacity); + +/*! @function initWithCapacity + @abstract Initializes an IOPacketQueue object. + @discussion This method initializes an IOPacketQueue object with the given capacity. + @param capacity The initial capacity of the queue. Can be later changed + by calling the setCapacity() method. + @result Returns true if initialized successfully, false otherwise. +*/ + + virtual bool initWithCapacity(UInt32 capacity = + IOPacketQueueDefaultCapacity); + +/*! @function getSize + @abstract Gets the size of the queue. + @result Returns the number of packets currently held by the queue. +*/ + + virtual UInt32 getSize() const; + +/*! @function setCapacity + @abstract Changes the capacity of the queue. + @param capacity The new capacity. + @result Returns true if the new capacity was accepted, false otherwise. +*/ + + virtual bool setCapacity(UInt32 capacity); + +/*! @function getCapacity + @abstract Gets the current capacity of the queue. + @result Returns the current queue capacity. +*/ + + virtual UInt32 getCapacity() const; + +/*! @function peek + @abstract Examines the packet at the head of the queue without + removing it from the queue. + @discussion A following call to peek() or dequeue() will return + the same packet. The caller must never modify the mbuf packet returned. + @result Returns the packet at the head of the queue. +*/ + + virtual const mbuf_t peek() const; + +/*! @function prepend + @abstract Adds a chain of packets to the head of the queue. + @param m A chain of packets to add to the head of the queue. +*/ + + virtual void prepend(mbuf_t m); + +/*! @function prepend + @abstract Removes all packets from the specified queue, and adds them + to the head of this queue. + @param queue The source IOPacketQueue object containing the packets to + be transferred. +*/ + + virtual void prepend(IOPacketQueue * queue); + +/*! @function lockPrepend + @abstract Adds a chain of packets to the head of a synchronized queue. + @discussion A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the head of the queue. + @result Always returns true. +*/ + + virtual void lockPrepend(mbuf_t m); + +/*! @function enqueue + @abstract Adds a chain of packets to the tail of the queue. + @discussion Packets are not added if the size of the queue has reached + its capacity. + @param m A chain of packets to add to the tail of the queue. + @result Returns true on success, or false to indicate over-capacity and refusal + to accept the packet chain provided. +*/ + + virtual bool enqueue(mbuf_t m); + +/*! @function enqueue + @abstract Removes all packets from the specified queue, and adds them + to the tail of this queue. + @param queue The source IOPacketQueue object containing the packets to + be transferred. + @result Always returns true. +*/ + + virtual bool enqueue(IOPacketQueue * queue); + +/*! @function enqueueWithDrop + @abstract Adds a chain of packets to the tail of the queue. + @discussion Packets are + dropped if the size of the queue has reached its capacity. + @param m A chain of packets to add to the tail of the queue. + @result Returns the number of packets dropped and freed by the queue. +*/ + + virtual UInt32 enqueueWithDrop(mbuf_t m); + +/*! @function lockEnqueue + @abstract Adds a chain of packets to the tail of a synchronized queue. + @discussion Packets are not added if the size of the queue has reached + its capacity. A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the tail of the queue. + @result Returns true on success, or false to indicate over-capacity and refusal + to accept the packet chain provided. +*/ + + virtual bool lockEnqueue(mbuf_t m); + +/*! @function lockEnqueueWithDrop + @abstract Adds a chain of packets to the tail of a synchronized queue. + @discussion Packets are dropped if the size of the queue has reached its capacity. A spinlock is used to synchronize access to the queue. + @param m A chain of packets to add to the tail of the queue. + @result Returns the number of packets dropped and freed by the queue. +*/ + + virtual UInt32 lockEnqueueWithDrop(mbuf_t m); + +/*! @function dequeue + @abstract Removes a single packet from the head of the queue. + @result Returns a packet removed from the head of the queue, or NULL if the + queue was empty. +*/ + + virtual mbuf_t dequeue(); + +/*! @function lockDequeue + @abstract Removes a single packet from the head of a synchronized queue. + @discussion A spinlock is used to synchronize access to the queue. + @result Returns a packet removed from the head of the queue, or NULL if the + queue was empty. +*/ + + virtual mbuf_t lockDequeue(); + +/*! @function dequeueAll + @abstract Removes all packets from the queue and returns the head of the + packet chain. + @discussion The size of the queue is cleared to zero. + @result Returns the head of a packet chain linking all packets that were held + in the queue, or NULL if the queue was empty. +*/ + + virtual mbuf_t dequeueAll(); + +/*! @function lockDequeueAll + @abstract Removes all packets from a synchronized queue and returns the + head of the packet chain. + @discussion The size of the queue is cleared to zero. A spinlock is used + to synchronize access to the queue. + @result Returns the head of a packet chain linking all packets that were held + in the queue, or NULL if the queue was empty. +*/ + + virtual mbuf_t lockDequeueAll(); + +/*! @function flush + @abstract Frees all packets currently held in the queue and releases them + back to the free mbuf pool. + @discussion The size of the queue is cleared to zero. + @result Returns the number of packets freed. +*/ + + virtual UInt32 flush(); + +/*! @function lockFlush + @abstract Frees all packets currently held in a synchronized queue and + releases them back to the free mbuf pool. + @discussion The size of the queue is cleared to zero. A spinlock is used + to synchronize access to the queue. + @result Returns the number of packets freed. +*/ + + virtual UInt32 lockFlush(); + + // Virtual Pad functions + OSMetaClassDeclareReservedUnused( IOPacketQueue, 0); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 1); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 2); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 3); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 4); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 5); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 6); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 7); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 8); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 9); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 10); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 11); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 12); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 13); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 14); + OSMetaClassDeclareReservedUnused( IOPacketQueue, 15); +}; + +#endif /* !_IOPACKETQUEUE_H */ diff --git a/i386/include/IOKit/nvram/.svn/all-wcprops b/i386/include/IOKit/nvram/.svn/all-wcprops new file mode 100644 index 0000000..c4ffea7 --- /dev/null +++ b/i386/include/IOKit/nvram/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/nvram +END +IONVRAMController.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/nvram/IONVRAMController.h +END diff --git a/i386/include/IOKit/nvram/.svn/entries b/i386/include/IOKit/nvram/.svn/entries new file mode 100644 index 0000000..235e8fa --- /dev/null +++ b/i386/include/IOKit/nvram/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/nvram +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IONVRAMController.h +file + + + + +2013-08-27T23:54:12.000000Z +49086a9f2ffaf58c32a02f39becfeed2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1842 + diff --git a/i386/include/IOKit/nvram/.svn/text-base/IONVRAMController.h.svn-base b/i386/include/IOKit/nvram/.svn/text-base/IONVRAMController.h.svn-base new file mode 100644 index 0000000..307d666 --- /dev/null +++ b/i386/include/IOKit/nvram/.svn/text-base/IONVRAMController.h.svn-base @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IONVRAMCONTROLLER_H +#define _IOKIT_IONVRAMCONTROLLER_H + +#include + +class IONVRAMController: public IOService +{ + OSDeclareAbstractStructors(IONVRAMController); + +public: + virtual bool start(IOService *provider); + + virtual void sync(void); + + virtual IOReturn read(IOByteCount offset, UInt8 *buffer, + IOByteCount length) = 0; + virtual IOReturn write(IOByteCount offset, UInt8 *buffer, + IOByteCount length) = 0; +}; + +#endif /* !_IOKIT_IONVRAMCONTROLLER_H */ diff --git a/i386/include/IOKit/nvram/IONVRAMController.h b/i386/include/IOKit/nvram/IONVRAMController.h new file mode 100644 index 0000000..307d666 --- /dev/null +++ b/i386/include/IOKit/nvram/IONVRAMController.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IONVRAMCONTROLLER_H +#define _IOKIT_IONVRAMCONTROLLER_H + +#include + +class IONVRAMController: public IOService +{ + OSDeclareAbstractStructors(IONVRAMController); + +public: + virtual bool start(IOService *provider); + + virtual void sync(void); + + virtual IOReturn read(IOByteCount offset, UInt8 *buffer, + IOByteCount length) = 0; + virtual IOReturn write(IOByteCount offset, UInt8 *buffer, + IOByteCount length) = 0; +}; + +#endif /* !_IOKIT_IONVRAMCONTROLLER_H */ diff --git a/i386/include/IOKit/pci/.svn/all-wcprops b/i386/include/IOKit/pci/.svn/all-wcprops new file mode 100644 index 0000000..a8d5d97 --- /dev/null +++ b/i386/include/IOKit/pci/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pci +END +IOAGPDevice.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pci/IOAGPDevice.h +END +IOPCIBridge.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pci/IOPCIBridge.h +END +IOPCIDevice.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pci/IOPCIDevice.h +END diff --git a/i386/include/IOKit/pci/.svn/entries b/i386/include/IOKit/pci/.svn/entries new file mode 100644 index 0000000..b433b4b --- /dev/null +++ b/i386/include/IOKit/pci/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/pci +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOAGPDevice.h +file + + + + +2013-08-27T23:54:16.000000Z +6914eb3aa64cbfbe5c135e1e97e4230d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9741 + +IOPCIBridge.h +file + + + + +2013-08-27T23:54:16.000000Z +fc8617495b2fbe44ed5ed7c2dfff140f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14371 + +IOPCIDevice.h +file + + + + +2013-08-27T23:54:16.000000Z +d1757b103f7517ee8be58098b4df5312 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34568 + diff --git a/i386/include/IOKit/pci/.svn/text-base/IOAGPDevice.h.svn-base b/i386/include/IOKit/pci/.svn/text-base/IOAGPDevice.h.svn-base new file mode 100644 index 0000000..c3a7d90 --- /dev/null +++ b/i386/include/IOKit/pci/.svn/text-base/IOAGPDevice.h.svn-base @@ -0,0 +1,222 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOAGPDEVICE_H +#define _IOKIT_IOAGPDEVICE_H + +#include +#include + +/* Definitions of AGP config registers */ +enum { + kIOPCIConfigAGPStatusOffset = 4, + kIOPCIConfigAGPCommandOffset = 8 +}; + +/* Definitions of AGP Command & Status registers */ +enum { + kIOAGPRequestQueueMask = 0xff000000, + kIOAGPSideBandAddresssing = 0x00000200, + kIOAGPEnable = 0x00000100, + kIOAGP4GbAddressing = 0x00000020, + kIOAGPFastWrite = 0x00000010, + kIOAGP4xDataRate = 0x00000004, + kIOAGP2xDataRate = 0x00000002, + kIOAGP1xDataRate = 0x00000001 +}; + +enum { + kIOAGPGartInvalidate = 0x00000001 +}; + +// getAGPStatus() defines +enum { + kIOAGPDefaultStatus = 0 +}; +enum { + kIOAGPIdle = 0x00000001, + kIOAGPInvalidGARTEntry = 0x00000002, + kIOAGPAccessOutOfRange = 0x00000004 +}; + +#define kIOAGPBusFlagsKey "IOAGPFlags" +enum { + // the AGP target must be idle before invalidating its gart tlb + kIOAGPGartIdleInvalidate = 0x00000001, + + // the AGP target cannot handle operations that cross page boundaries + kIOAGPDisablePageSpans = 0x00000002, + + // the AGP target cannot handle master -> target AGP writes + kIOAGPDisableAGPWrites = 0x00000004, + + // the AGP target cannot handle target -> master PCI reads + kIOAGPDisablePCIReads = 0x00000008, + + // the AGP target cannot handle master -> target PCI writes + kIOAGPDisablePCIWrites = 0x00000010, + + // the AGP target cannot handle all unaligned transactions + kIOAGPDisableUnaligned = 0x00000020, + + kIOAGPDisableFeature6 = 0x00000040, + kIOAGPDisableFeature7 = 0x00000080, + kIOAGPDisableFeature8 = 0x00000100, + kIOAGPDisableFeature9 = 0x00000200 +}; + +// masterState +enum { + kIOAGPStateEnabled = 0x00000001, + kIOAGPStateEnablePending = 0x00010000 +}; + + +/*! @class IOAGPDevice + @abstract An IOService class representing an AGP master device. + @discussion The discovery of an AGP master device by the PCI bus family results in an instance of the IOAGPDevice being created and published. It provides services specific to AGP, in addition to the PCI services supplied by its superclass IOPCIDevice. +*/ + +class IOAGPDevice : public IOPCIDevice +{ + OSDeclareDefaultStructors(IOAGPDevice) + +protected: + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. +*/ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +public: + UInt32 masterState; + UInt8 masterAGPRegisters; + +/*! @function createAGPSpace + @abstract Allocates the AGP space, and enables AGP transactions on the master and slave. + @discussion This method should be called by the driver for the AGP master device to set the size of the space and enable AGP transactions. It will destroy any AGP space currently allocated. + @param options No options are currently defined, pass zero. + @param address The physical range allocated for the AGP space is passed back to the caller. + @param length An in/out parameter - the caller sets the devices maximum AGP addressing and the actual size created is passed back. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn createAGPSpace( IOOptionBits options, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + +/*! @function destroyAGPSpace + @abstract Destroys the AGP space, and disables AGP transactions on the master and slave. + @discussion This method should be called by the driver to shutdown AGP transactions and release resources. +*/ + + virtual IOReturn destroyAGPSpace( void ); + +/*! @function getAGPRangeAllocator + @abstract Accessor to obtain the AGP range allocator. + @discussion To allocate ranges in AGP space, obtain a range allocator for the space with this method. It is retained while the space is created (until destroyAGPSpace is called) and should not be released by the caller. + @result Returns a pointer to the range allocator for the AGP space. +*/ + + virtual IORangeAllocator * getAGPRangeAllocator( void ); + +/*! @function getAGPStatus + @abstract Returns the current state of the AGP bus. + @discussion Returns state bits for the AGP bus. Only one type of status is currently defined. + @param which Type of status - only kIOAGPDefaultStatus is currently valid. + @result Returns mask of status bits for the AGP bus. +*/ + + virtual IOOptionBits getAGPStatus( IOOptionBits which = kIOAGPDefaultStatus ); + +/*! @function commitAGPMemory + @abstract Makes memory addressable by AGP transactions. + @discussion Makes the memory described by the IOMemoryDescriptor object addressable by AGP by entering its pages into the GART array, given an offset into AGP space supplied by the caller (usually allocated by the AGP range allocator). It is the caller's responsibility to prepare non-kernel pageable memory before calling this method, with IOMemoryDescriptor::prepare. + @param memory A IOMemoryDescriptor object describing the memory to add to the GART. + @param agpOffset An offset into AGP space that the caller has allocated - usually allocated by the AGP range allocator. + @param options Pass kIOAGPGartInvalidate if the AGP target should invalidate any GART TLB. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn commitAGPMemory( IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options = 0 ); + +/*! @function releaseAGPMemory + @abstract Releases memory addressable by AGP transactions. + @discussion Makes the memory described by the IOMemoryDescriptor object unaddressable by AGP by removing its pages from the GART array, given an offset into AGP space supplied by the caller (usually allocated by the AGP range allocator). It is the caller's responsibility to complete non-kernel pageable memory before calling this method, with IOMemoryDescriptor::complete. + @param memory A IOMemoryDescriptor object describing the memory to remove from the GART. + @param agpOffset An offset into AGP space that the caller has allocated - usually allocated by the AGP range allocator. + @param options Pass kIOAGPGartInvalidate if the AGP target should invalidate any GART TLB. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn releaseAGPMemory( IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options = 0 ); + + virtual IOReturn resetAGP( IOOptionBits options = 0 ); + +/*! @function getAGPSpace + @abstract Returns the allocated AGP space. + @discussion This method can be called by the driver for the AGP master device to retrieve the physical address and size of the space created with createAGPSpace. + @param address The physical range allocated for the AGP space is passed back to the caller. Zero may be passed if the address is not needed by the caller. + @param length The size of the the AGP space created is passed back. Zero may be passed if the length is not needed by the caller. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn getAGPSpace( IOPhysicalAddress * address, + IOPhysicalLength * length ); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOAGPDevice, 0); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 1); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 2); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 3); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 4); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 5); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 6); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 7); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 8); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 9); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 10); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 11); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 12); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 13); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 14); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 15); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 16); +}; + +#endif /* ! _IOKIT_IOAGPDEVICE_H */ diff --git a/i386/include/IOKit/pci/.svn/text-base/IOPCIBridge.h.svn-base b/i386/include/IOKit/pci/.svn/text-base/IOPCIBridge.h.svn-base new file mode 100644 index 0000000..2fac052 --- /dev/null +++ b/i386/include/IOKit/pci/.svn/text-base/IOPCIBridge.h.svn-base @@ -0,0 +1,381 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPCIBRIDGE_H +#define _IOKIT_IOPCIBRIDGE_H + +#include +#include +#include +#include + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef uint64_t IOPCIScalar; + +struct IOPCIRange +{ + IOPCIScalar start; + IOPCIScalar size; + IOPCIScalar alignment; + UInt32 type; + UInt32 flags; + struct IOPCIRange * next; + struct IOPCIRange * nextSubRange; + struct IOPCIRange * subRange; +}; + +enum { + kIOPCIResourceTypeMemory = 0, + kIOPCIResourceTypePrefetchMemory, + kIOPCIResourceTypeIO, + kIOPCIResourceTypeBusNumber, + kIOPCIResourceTypeCount +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + @class IOPCIBridge + @abstract Base class for all PCI bridge drivers. +*/ +class IOPCIConfigurator; +class IOPCIDevice; + +class IOPCIBridge : public IOService +{ + friend class IOPCIDevice; + friend class IOPCIConfigurator; + + OSDeclareAbstractStructors(IOPCIBridge) + +private: + static void initialize(void); + IORegistryEntry * findMatching( OSIterator * in, IOPCIAddressSpace space ); + virtual bool isDTNub( IOPCIDevice * nub ); + bool checkProperties( IOPCIDevice * entry ); + + void removeDevice( IOPCIDevice * device, IOOptionBits options = 0 ); + IOReturn restoreMachineState( IOOptionBits options = 0); + IOReturn _restoreDeviceState( IOPCIDevice * device, IOOptionBits options ); + IOReturn resolveLegacyInterrupts( IOService * provider, IOPCIDevice * nub ); + IOReturn resolveMSIInterrupts ( IOService * provider, IOPCIDevice * nub ); + +protected: + static void nvLocation( IORegistryEntry * entry, + UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum ); + static SInt32 compareAddressCell( UInt32 cellCount, UInt32 cleft[], UInt32 cright[] ); + void checkTerminateChildren(IOService * bridgeDevice, bool eject); + IOReturn setDeviceASPMBits(IOPCIDevice * device, IOOptionBits state); + + IORangeAllocator * bridgeMemoryRanges; + IORangeAllocator * bridgeIORanges; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOPCIBridge in the future. +*/ + struct ExpansionData + { + friend class IOPCIConfigurator; + IORangeAllocator * cardBusMemoryRanges; + IOPCIRange * rangeLists[kIOPCIResourceTypeCount]; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +protected: +public: + virtual void probeBus( IOService * provider, UInt8 busNum ); + + virtual UInt8 firstBusNum( void ); + virtual UInt8 lastBusNum( void ); + + virtual void spaceFromProperties( OSDictionary * propTable, + IOPCIAddressSpace * space ); + virtual OSDictionary * constructProperties( IOPCIAddressSpace space ); + + virtual IOPCIDevice * createNub( OSDictionary * from ); + + virtual bool initializeNub( IOPCIDevice * nub, OSDictionary * from ); + + virtual bool publishNub( IOPCIDevice * nub, UInt32 index ); + + virtual bool addBridgeMemoryRange( IOPhysicalAddress start, + IOPhysicalLength length, bool host ); + + virtual bool addBridgeIORange( IOByteCount start, IOByteCount length ); + + virtual bool constructRange( IOPCIAddressSpace * flags, + IOPhysicalAddress phys, IOPhysicalLength len, + OSArray * array ); + + virtual bool matchNubWithPropertyTable( IOService * nub, + OSDictionary * propertyTable, + SInt32 * score ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual bool pciMatchNub( IOPCIDevice * nub, + OSDictionary * table, SInt32 * score); + + virtual bool matchKeys( IOPCIDevice * nub, const char * keys, + UInt32 defaultMask, UInt8 regNum ); + + virtual IOReturn getNubResources( IOService * nub ); + + virtual IOReturn getNubAddressing( IOPCIDevice * nub ); + + virtual IOReturn getDTNubAddressing( IOPCIDevice * nub ); + +public: + virtual void free( void ); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual bool configure( IOService * provider ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual IODeviceMemory * ioDeviceMemory( void ) = 0; + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ) = 0; + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ) = 0; + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ) = 0; + + virtual IOPCIAddressSpace getBridgeSpace( void ) = 0; + + virtual UInt32 findPCICapability( IOPCIAddressSpace space, + UInt8 capabilityID, UInt8 * offset = 0 ); + + virtual IOReturn setDevicePowerState( IOPCIDevice * device, + unsigned long whatToDo ); + virtual IOReturn saveDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ); + virtual IOReturn restoreDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual IOReturn createAGPSpace( IOAGPDevice * master, + IOOptionBits options, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + + virtual IOReturn destroyAGPSpace( IOAGPDevice * master ); + + virtual IORangeAllocator * getAGPRangeAllocator( IOAGPDevice * master ); + + virtual IOOptionBits getAGPStatus( IOAGPDevice * master, + IOOptionBits options = 0 ); + virtual IOReturn resetAGPDevice( IOAGPDevice * master, + IOOptionBits options = 0 ); + + virtual IOReturn getAGPSpace( IOAGPDevice * master, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + + virtual IOReturn commitAGPMemory( IOAGPDevice * master, + IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options ); + + virtual IOReturn releaseAGPMemory( IOAGPDevice * master, + IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options ); + +protected: + OSMetaClassDeclareReservedUsed(IOPCIBridge, 0); + virtual bool addBridgePrefetchableMemoryRange( IOPhysicalAddress start, + IOPhysicalLength length, + bool host ); + + OSMetaClassDeclareReservedUsed(IOPCIBridge, 1); + virtual UInt32 extendedFindPCICapability( IOPCIAddressSpace space, + UInt32 capabilityID, IOByteCount * offset = 0 ); + + OSMetaClassDeclareReservedUsed(IOPCIBridge, 2); + virtual IOReturn setDeviceASPMState(IOPCIDevice * device, + IOService * client, IOOptionBits state); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCIBridge, 3); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 4); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 5); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 6); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 7); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 8); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 9); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 10); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 11); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 12); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 13); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 14); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 15); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 16); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 17); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 18); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 19); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 20); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 21); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 22); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 23); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 24); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 25); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 26); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 27); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 28); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 29); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 30); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 31); + + + +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kIOPCIBridgeRegs (32) +/*! + @class IOPCI2PCIBridge + @abstract Base class for all PCI-to-PCI bridge drivers. +*/ + +class IOPCI2PCIBridge : public IOPCIBridge +{ + OSDeclareDefaultStructors(IOPCI2PCIBridge) + +private: + + IOPCIDevice * bridgeDevice; + UInt32 bridgeState[kIOPCIBridgeRegs]; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData + { + // /hotp + IOByteCount xpressCapability; + IOFilterInterruptEventSource * bridgeInterruptSource; + IOWorkLoop * workLoop; + uint32_t hotplugCount; + uint8_t presence; + uint8_t waitingLinkEnable; + uint8_t linkChangeOnly; + uint8_t interruptEnablePending; + uint8_t __reserved[4]; + // hotp/ + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; +public: + + virtual UInt8 firstBusNum( void ); + virtual UInt8 lastBusNum( void ); + +public: + virtual void free(); + + virtual bool serializeProperties( OSSerialize * serialize ) const; + + virtual IOService * probe( IOService * provider, + SInt32 * score ); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual bool configure( IOService * provider ); + + virtual void probeBus( IOService * provider, UInt8 busNum ); + + virtual IOReturn requestProbe( IOOptionBits options ); + + virtual void saveBridgeState( void ); + + virtual void restoreBridgeState( void ); + + IOReturn setPowerState( unsigned long powerState, + IOService * whatDevice ); + + virtual bool publishNub( IOPCIDevice * nub, UInt32 index ); + + virtual IODeviceMemory * ioDeviceMemory( void ); + + virtual IOPCIAddressSpace getBridgeSpace( void ); + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ); + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ); + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ); + + virtual IOReturn setDeviceASPMState(IOPCIDevice * device, + IOService * client, IOOptionBits state); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 0); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 1); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 2); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 3); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 4); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 5); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 6); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 7); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 8); + +protected: + bool filterInterrupt( IOFilterInterruptEventSource * source); + + void handleInterrupt( IOInterruptEventSource * source, + int count ); + +}; + +#endif /* ! _IOKIT_IOPCIBRIDGE_H */ diff --git a/i386/include/IOKit/pci/.svn/text-base/IOPCIDevice.h.svn-base b/i386/include/IOKit/pci/.svn/text-base/IOPCIDevice.h.svn-base new file mode 100644 index 0000000..d031a06 --- /dev/null +++ b/i386/include/IOKit/pci/.svn/text-base/IOPCIDevice.h.svn-base @@ -0,0 +1,673 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOPCIDEVICE_H +#define _IOKIT_IOPCIDEVICE_H + +#include + +/* Definitions of PCI Config Registers */ +enum { + kIOPCIConfigVendorID = 0x00, + kIOPCIConfigDeviceID = 0x02, + kIOPCIConfigCommand = 0x04, + kIOPCIConfigStatus = 0x06, + kIOPCIConfigRevisionID = 0x08, + kIOPCIConfigClassCode = 0x09, + kIOPCIConfigCacheLineSize = 0x0C, + kIOPCIConfigLatencyTimer = 0x0D, + kIOPCIConfigHeaderType = 0x0E, + kIOPCIConfigBIST = 0x0F, + kIOPCIConfigBaseAddress0 = 0x10, + kIOPCIConfigBaseAddress1 = 0x14, + kIOPCIConfigBaseAddress2 = 0x18, + kIOPCIConfigBaseAddress3 = 0x1C, + kIOPCIConfigBaseAddress4 = 0x20, + kIOPCIConfigBaseAddress5 = 0x24, + kIOPCIConfigCardBusCISPtr = 0x28, + kIOPCIConfigSubSystemVendorID = 0x2C, + kIOPCIConfigSubSystemID = 0x2E, + kIOPCIConfigExpansionROMBase = 0x30, + kIOPCIConfigCapabilitiesPtr = 0x34, + kIOPCIConfigInterruptLine = 0x3C, + kIOPCIConfigInterruptPin = 0x3D, + kIOPCIConfigMinimumGrant = 0x3E, + kIOPCIConfigMaximumLatency = 0x3F +}; + +/* Definitions of Capabilities PCI Config Register */ +enum { + kIOPCICapabilityIDOffset = 0x00, + kIOPCINextCapabilityOffset = 0x01, + + kIOPCIPowerManagementCapability = 0x01, + kIOPCIAGPCapability = 0x02, + kIOPCIVitalProductDataCapability = 0x03, + kIOPCISlotIDCapability = 0x04, + kIOPCIMSICapability = 0x05, + kIOPCICPCIHotswapCapability = 0x06, + kIOPCIPCIXCapability = 0x07, + kIOPCILDTCapability = 0x08, + kIOPCIVendorSpecificCapability = 0x09, + kIOPCIDebugPortCapability = 0x0a, + kIOPCICPCIResourceControlCapability = 0x0b, + kIOPCIHotplugCapability = 0x0c, + kIOPCIAGP8Capability = 0x0e, + kIOPCISecureCapability = 0x0f, + kIOPCIPCIExpressCapability = 0x10, + kIOPCIMSIXCapability = 0x11, + + kIOPCIExpressErrorReportingCapability = -1UL, + kIOPCIExpressVirtualChannelCapability = -2UL, + kIOPCIExpressDeviceSerialNumberCapability = -3UL, + kIOPCIExpressPowerBudgetCapability = -4UL +}; + +/* Space definitions */ +enum { + kIOPCIConfigSpace = 0, + kIOPCIIOSpace = 1, + kIOPCI32BitMemorySpace = 2, + kIOPCI64BitMemorySpace = 3 +}; + +/* Command register definitions */ +enum { + kIOPCICommandIOSpace = 0x0001, + kIOPCICommandMemorySpace = 0x0002, + kIOPCICommandBusMaster = 0x0004, + kIOPCICommandSpecialCycles = 0x0008, + kIOPCICommandMemWrInvalidate = 0x0010, + kIOPCICommandPaletteSnoop = 0x0020, + kIOPCICommandParityError = 0x0040, + kIOPCICommandAddressStepping = 0x0080, + kIOPCICommandSERR = 0x0100, + kIOPCICommandFastBack2Back = 0x0200, + kIOPCICommandInterruptDisable = 0x0400 +}; + +/* Status register definitions */ +enum { + kIOPCIStatusCapabilities = 0x0010, + kIOPCIStatusPCI66 = 0x0020, + kIOPCIStatusUDF = 0x0040, + kIOPCIStatusFastBack2Back = 0x0080, + kIOPCIStatusDevSel0 = 0x0000, + kIOPCIStatusDevSel1 = 0x0200, + kIOPCIStatusDevSel2 = 0x0400, + kIOPCIStatusDevSel3 = 0x0600, + kIOPCIStatusTargetAbortCapable = 0x0800, + kIOPCIStatusTargetAbortActive = 0x1000, + kIOPCIStatusMasterAbortActive = 0x2000, + kIOPCIStatusSERRActive = 0x4000, + kIOPCIStatusParityErrActive = 0x8000 +}; + +// constants which are part of the PCI Bus Power Management Spec. +enum +{ + // capabilities bits in the 16 bit capabilities register + kPCIPMCPMESupportFromD3Cold = 0x8000, + kPCIPMCPMESupportFromD3Hot = 0x4000, + kPCIPMCPMESupportFromD2 = 0x2000, + kPCIPMCPMESupportFromD1 = 0x1000, + kPCIPMCPMESupportFromD0 = 0x0800, + kPCIPMCD2Support = 0x0400, + kPCIPMCD1Support = 0x0200, + + kPCIPMCD3Support = 0x0001 +}; + +enum +{ + // bits in the power management control/status register + kPCIPMCSPMEStatus = 0x8000, + kPCIPMCSPMEEnable = 0x0100, + kPCIPMCSPowerStateMask = 0x0003, + kPCIPMCSPowerStateD3 = 0x0003, + kPCIPMCSPowerStateD2 = 0x0002, + kPCIPMCSPowerStateD1 = 0x0001, + kPCIPMCSPowerStateD0 = 0x0000, + + kPCIPMCSDefaultEnableBits = (~(IOOptionBits)0) +}; + +union IOPCIAddressSpace { + UInt32 bits; + struct { +#if __BIG_ENDIAN__ + unsigned int reloc:1; + unsigned int prefetch:1; + unsigned int t:1; + unsigned int resv:3; + unsigned int space:2; + unsigned int busNum:8; + unsigned int deviceNum:5; + unsigned int functionNum:3; + unsigned int registerNum:8; +#elif __LITTLE_ENDIAN__ + unsigned int registerNum:8; + unsigned int functionNum:3; + unsigned int deviceNum:5; + unsigned int busNum:8; + unsigned int space:2; + unsigned int resv:3; + unsigned int t:1; + unsigned int prefetch:1; + unsigned int reloc:1; +#endif + } s; + struct { +#if __BIG_ENDIAN__ + unsigned int resv:4; + unsigned int registerNumExtended:4; + unsigned int busNum:8; + unsigned int deviceNum:5; + unsigned int functionNum:3; + unsigned int registerNum:8; +#elif __LITTLE_ENDIAN__ + unsigned int registerNum:8; + unsigned int functionNum:3; + unsigned int deviceNum:5; + unsigned int busNum:8; + unsigned int registerNumExtended:4; + unsigned int resv:4; +#endif + } es; +}; + +struct IOPCIPhysicalAddress { + IOPCIAddressSpace physHi; + UInt32 physMid; + UInt32 physLo; + UInt32 lengthHi; + UInt32 lengthLo; +}; + +// IOPCIDevice matching property names +#define kIOPCIMatchKey "IOPCIMatch" +#define kIOPCIPrimaryMatchKey "IOPCIPrimaryMatch" +#define kIOPCISecondaryMatchKey "IOPCISecondaryMatch" +#define kIOPCIClassMatchKey "IOPCIClassMatch" + +// property to control PCI default config space save on sleep +#define kIOPMPCIConfigSpaceVolatileKey "IOPMPCIConfigSpaceVolatile" + +// pci express link status +#define kIOPCIExpressLinkStatusKey "IOPCIExpressLinkStatus" +// pci express link capabilities +#define kIOPCIExpressLinkCapabilitiesKey "IOPCIExpressLinkCapabilities" + +#ifndef kIOPlatformDeviceASPMEnableKey +#define kIOPlatformDeviceASPMEnableKey "IOPlatformDeviceASPMEnable" +#endif + +#ifndef kIOPCIDeviceASPMSupportedKey +#define kIOPCIDeviceASPMSupportedKey "pci-aspm-supported" +#endif + +#define kIOPCIPMEOptionsKey "IOPCIPMEOptions" + + +enum { + kIOPCIDevicePowerStateCount = 3, + kIOPCIDeviceOffState = 0, + kIOPCIDeviceDozeState = 1, + kIOPCIDeviceOnState = 2, +}; + +enum +{ + // bits getInterruptType result + kIOInterruptTypePCIMessaged = 0x00010000 +}; + +class IOPCIBridge; +class IOPCI2PCIBridge; +class IOPCIMessagedInterruptController; + +/*! @class IOPCIDevice : public IOService + @abstract An IOService class representing a PCI device. + @discussion The discovery of a PCI device by the PCI bus family results in an instance of the IOPCIDevice being created and published. It provides services for looking up and mapping memory mapped hardware, and access to the PCI configuration and I/O spaces. + +

Matching Supported by IOPCIDevice

+ +Two types of matching are available, OpenFirmware name matching and PCI register matching. Currently, only one of these two matching schemes can be used in the same property table. + +

OpenFirmware Name Matching

+ +IOService performs matching based on the IONameMatch property (see IOService). IOPCIDevices created with OpenFirmware device tree entries will name match based on the standard OpenFirmware name matching properties. + +

PCI Register Matching

+ +A PCI device driver can also match on the values of certain config space registers. + +In each case, several matching values can be specified, and an optional mask for the value of the config space register may follow the value, preceded by an '&' character. +
+
+ kIOPCIMatchKey, "IOPCIMatch" +
+The kIOPCIMatchKey property matches the vendor and device ID (0x00) register, or the subsystem register (0x2c). +
+
+ kIOPCIPrimaryMatchKey, "IOPCIPrimaryMatch" +
+The kIOPCIPrimaryMatchKey property matches the vendor and device ID (0x00) register. +
+
+ kIOPCISecondaryMatchKey, "IOPCISecondaryMatch" +
+The kIOPCISecondaryMatchKey property matches the subsystem register (0x2c). +
+
+ kIOPCIClassMatchKey, "IOPCIClassMatch" +
+The kIOPCIClassMatchKey property matches the class code register (0x08). The default mask for this register is 0xffffff00. +
+
+Examples: +
+
+ <key>IOPCIMatch</key>
+ <string>0x00261011</string> +
+Matches a device whose vendor ID is 0x1011, and device ID is 0x0026, including subsystem IDs. +
+
+ <key>IOPCIMatch</key>
+ <string>0x00789004&0x00ffffff 0x78009004&0x0xff00ffff</string> +
+Matches with any device with a vendor ID of 0x9004, and a device ID of 0xzz78 or 0x78zz, where 'z' is don't care. +
+
+ <key>IOPCIClassMatch</key>
+ <string>0x02000000&0xffff0000</string> +
+
+Matches a device whose class code is 0x0200zz, an ethernet device. + +*/ + +class IOPCIDevice : public IOService +{ + OSDeclareDefaultStructors(IOPCIDevice) + + friend class IOPCIBridge; + friend class IOPCI2PCIBridge; + friend class IOPCIMessagedInterruptController; + +protected: + IOPCIBridge * parent; + IOMemoryMap * ioMap; + OSObject * slotNameProperty; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + struct IOPCIDeviceExpansionData * reserved; + +public: + IOPCIAddressSpace space; + UInt32 * savedConfig; + +public: + /* IOService/IORegistryEntry methods */ + + virtual bool init( OSDictionary * propTable ); + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ); + virtual void free(); + virtual bool attach( IOService * provider ); + virtual void detach( IOService * provider ); + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + virtual IOReturn powerStateWillChangeTo (IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService* whatDevice); + virtual IOReturn setPowerState( unsigned long, IOService * ); + + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + virtual IOService * matchLocation( IOService * client ); + virtual IOReturn getResources( void ); + virtual IOReturn setProperties(OSObject * properties); + virtual IOReturn callPlatformFunction(const OSSymbol * functionName, + bool waitForFunction, + void * p1, void * p2, + void * p3, void * p4); + virtual IOReturn callPlatformFunction(const char * functionName, + bool waitForFunction, + void * p1, void * p2, + void * p3, void * p4); + + /* Config space accessors */ + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ); + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ); + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ); + +/*! @function configRead32 + @abstract Reads a 32-bit value from the PCI device's configuration space. + @discussion This method reads a 32-bit configuration space register on the device and returns its value. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @result An 32-bit value in host byte order (big endian on PPC). */ + + virtual UInt32 configRead32( UInt8 offset ); + +/*! @function configRead16 + @abstract Reads a 16-bit value from the PCI device's configuration space. + @discussion This method reads a 16-bit configuration space register on the device and returns its value. + @param offset An 8-bit offset into configuration space, of which bit 0 is ignored. + @result An 16-bit value in host byte order (big endian on PPC). */ + + virtual UInt16 configRead16( UInt8 offset ); + +/*! @function configRead8 + @abstract Reads a 8-bit value from the PCI device's configuration space. + @discussion This method reads a 8-bit configuration space register on the device and returns its value. + @param offset An 8-bit offset into configuration space. + @result An 8-bit value. */ + + virtual UInt8 configRead8( UInt8 offset ); + +/*! @function configWrite32 + @abstract Writes a 32-bit value to the PCI device's configuration space. + @discussion This method write a 32-bit value to a configuration space register on the device. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @param data An 32-bit value to be written in host byte order (big endian on PPC). */ + + virtual void configWrite32( UInt8 offset, UInt32 data ); + +/*! @function configWrite16 + @abstract Writes a 16-bit value to the PCI device's configuration space. + @discussion This method write a 16-bit value to a configuration space register on the device. + @param offset An 8-bit offset into configuration space, of which bit 0 is ignored. + @param data An 16-bit value to be written in host byte order (big endian on PPC). */ + + virtual void configWrite16( UInt8 offset, UInt16 data ); + +/*! @function configWrite8 + @abstract Writes a 8-bit value to the PCI device's configuration space. + @discussion This method write a 8-bit value to a configuration space register on the device. + @param offset An 8-bit offset into configuration space. + @param data An 8-bit value to be written. */ + + virtual void configWrite8( UInt8 offset, UInt8 data ); + + virtual IOReturn saveDeviceState( IOOptionBits options = 0 ); + virtual IOReturn restoreDeviceState( IOOptionBits options = 0 ); + +/*! @function setConfigBits + @abstract Sets masked bits in a configuration space register. + @discussion This method sets masked bits in a configuration space register on the device by reading and writing the register. The value of the masked bits before the write is returned. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @param mask An 32-bit mask indicating which bits in the value parameter are valid. + @param data An 32-bit value to be written in host byte order (big endian on PPC). + @result The value of the register masked with the mask before the write. */ + + virtual UInt32 setConfigBits( UInt8 offset, UInt32 mask, UInt32 value ); + +/*! @function setMemoryEnable + @abstract Sets the device's memory space response. + @discussion This method sets the memory space response bit in the device's command config space register to the passed value, and returns the previous state of the enable. + @param enable True or false to enable or disable the memory space response. + @result True if the memory space response was previously enabled, false otherwise. */ + + virtual bool setMemoryEnable( bool enable ); + +/*! @function setIOEnable + @abstract Sets the device's I/O space response. + @discussion This method sets the I/O space response bit in the device's command config space register to the passed value, and returns the previous state of the enable. The exclusive option allows only one exclusive device on the bus to be enabled concurrently, this should be only for temporary access. + @param enable True or false to enable or disable the I/O space response. + @param exclusive If true, only one setIOEnable with the exclusive flag set will be allowed at a time on the bus, this should be only for temporary access. + @result True if the I/O space response was previously enabled, false otherwise. */ + + virtual bool setIOEnable( bool enable, bool exclusive = false ); + +/*! @function setBusMasterEnable + @abstract Sets the device's bus master enable. + @discussion This method sets the bus master enable bit in the device's command config space register to the passed value, and returns the previous state of the enable. + @param enable True or false to enable or disable bus mastering. + @result True if bus mastering was previously enabled, false otherwise. */ + + virtual bool setBusMasterEnable( bool enable ); + +/*! @function findPCICapability + @abstract Search configuration space for a PCI capability register. + @discussion This method searches the device's config space for a PCI capability register matching the passed capability ID, if the device supports PCI capabilities. To search for PCI Express extended capabilities or for multiple capablities with the same ID, use the extendedFindPCICapability() method. + @param capabilityID An 8-bit PCI capability ID. + @param offset An optional pointer to return the offset into config space where the capability was found. + @result The 32-bit value of the capability register if one was found, zero otherwise. */ + + virtual UInt32 findPCICapability( UInt8 capabilityID, UInt8 * offset = 0 ); + +/*! @function getBusNumber + @abstract Accessor to return the PCI device's assigned bus number. + @discussion This method is an accessor to return the PCI device's assigned bus number. + @result The 8-bit value of device's PCI bus number. */ + + virtual UInt8 getBusNumber( void ); + +/*! @function getDeviceNumber + @abstract Accessor to return the PCI device's device number. + @discussion This method is an accessor to return the PCI device's device number. + @result The 5-bit value of device's device number. */ + + virtual UInt8 getDeviceNumber( void ); + +/*! @function getFunctionNumber + @abstract Accessor to return the PCI device's function number. + @discussion This method is an accessor to return the PCI device's function number. + @result The 3-bit value of device's function number. */ + + virtual UInt8 getFunctionNumber( void ); + + /* Device memory accessors */ + +/*! @function getDeviceMemoryWithRegister + @abstract Returns an instance of IODeviceMemory representing one of the device's memory mapped ranges. + @discussion This method will return a pointer to an instance of IODeviceMemory for the physical memory range that was assigned to the configuration space base address register passed in. It is analogous to IOService::getDeviceMemoryWithIndex. + @param reg The 8-bit configuration space register that is the base address register for the desired range. + @result A pointer to an instance of IODeviceMemory, or zero no such range was found. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. */ + + virtual IODeviceMemory * getDeviceMemoryWithRegister( UInt8 reg ); + +/*! @function mapDeviceMemoryWithRegister + @abstract Maps a physical range of the device. + @discussion This method will create a mapping for the IODeviceMemory for the physical memory range that was assigned to the configuration space base address register passed in, with IODeviceMemory::map(options). The mapping is represented by the returned instance of IOMemoryMap, which should not be released until the mapping is no longer required. This method is analogous to IOService::mapDeviceMemoryWithIndex. + @param reg The 8-bit configuration space register that is the base address register for the desired range. + @param options Options to be passed to the IOMemoryDescriptor::map() method. + @result An instance of IOMemoryMap, or zero if the index is beyond the count available. The mapping should be released only when access to it is no longer required. */ + + virtual IOMemoryMap * mapDeviceMemoryWithRegister( UInt8 reg, + IOOptionBits options = 0 ); + +/*! @function ioDeviceMemory + @abstract Accessor to the I/O space aperture for the bus. + @discussion This method will return a reference to the IODeviceMemory for the I/O aperture of the bus the device is on. + @result A pointer to an IODeviceMemory object for the I/O aperture. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. */ + + virtual IODeviceMemory * ioDeviceMemory( void ); + + /* I/O space accessors */ + +/*! @function ioWrite32 + @abstract Writes a 32-bit value to an I/O space aperture. + @discussion This method will write a 32-bit value to a 4 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite32( UInt16 offset, UInt32 value, + IOMemoryMap * map = 0 ); + +/*! @function ioWrite16 + @abstract Writes a 16-bit value to an I/O space aperture. + @discussion This method will write a 16-bit value to a 2 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite16( UInt16 offset, UInt16 value, + IOMemoryMap * map = 0 ); + +/*! @function ioWrite8 + @abstract Writes a 8-bit value to an I/O space aperture. + @discussion This method will write a 8-bit value to an offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite8( UInt16 offset, UInt8 value, + IOMemoryMap * map = 0 ); + +/*! @function ioRead32 + @abstract Reads a 32-bit value from an I/O space aperture. + @discussion This method will read a 32-bit value from a 4 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read in host byte order (big endian on PPC). */ + + virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 ); + +/*! @function ioRead16 + @abstract Reads a 16-bit value from an I/O space aperture. + @discussion This method will read a 16-bit value from a 2 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read in host byte order (big endian on PPC). */ + + virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 ); + +/*! @function ioRead8 + @abstract Reads a 8-bit value from an I/O space aperture. + @discussion This method will read a 8-bit value from an offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read. */ + + virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 ); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 0); +/*! @function hasPCIPowerManagement + @abstract determine whether or not the device supports PCI Bus Power Management. + @discussion This method will look at the device's capabilties registers and determine whether or not the device supports the PCI BUS Power Management Specification. + @param state(optional) Check for support of a specific state (e.g. kPCIPMCPMESupportFromD3Cold). If state is not suuplied or is 0, then check for a property in the registry which tells which state the hardware expects the device to go to during sleep. + @result true if the specified state is supported */ + virtual bool hasPCIPowerManagement(IOOptionBits state = 0); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 1); +/*! @function enablePCIPowerManagement + @abstract enable PCI power management for sleep state + @discussion This method will enable PCI Bus Powermanagement when going to sleep mode. + @param state(optional) Enables PCI Power Management by placing the function in the given state (e.g. kPCIPMCSPowerStateD3). If state is not specified or is 0xffffffff, then the IOPCIDevice determines the desired state. If state is kPCIPMCSPowerStateD0 (0) then PCI Power Management is disabled. + @result kIOReturnSuccess if there were no errors */ + virtual IOReturn enablePCIPowerManagement(IOOptionBits state = 0xffffffff); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 2); +/*! @function extendedFindPCICapability + @abstract Search configuration space for a PCI capability register. + @discussion This method searches the device's config space for a PCI capability register matching the passed capability ID, if the device supports PCI capabilities. + @param capabilityID A PCI capability ID. PCI Express devices may support extended capabilities in config space starting at offset 0x100. To search this space, the ID passed should be the negated value of the PCI-SIG assigned ID for the extended capability. + @param offset An optional in/out parameter to return the offset into config space where the capability was found, and to set the start point of the next search. Initialize the offset to zero before the first call to extendedFindPCICapability() and subsequent calls will find all capabilty blocks that may exist on the device with the same ID. + @result The 32-bit value of the capability register if one was found, zero otherwise. */ + + virtual UInt32 extendedFindPCICapability( UInt32 capabilityID, IOByteCount * offset = 0 ); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCIDevice, 3); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 4); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 5); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 6); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 7); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 8); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 9); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 10); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 11); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 12); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 13); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 14); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 15); + +public: + +/*! @function extendedConfigRead32 + @abstract Reads a 32-bit value from the PCI device's configuration space. + @discussion This method reads a 32-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space, of which bits 0-1 are ignored. + @result An 32-bit value in host byte order (big endian on PPC). */ + + UInt32 extendedConfigRead32( IOByteCount offset ); + +/*! @function extendedConfigRead16 + @abstract Reads a 16-bit value from the PCI device's configuration space. + @discussion This method reads a 16-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space, of which bit 0 is ignored. + @result An 16-bit value in host byte order (big endian on PPC). */ + + UInt16 extendedConfigRead16( IOByteCount offset ); + +/*! @function extendedConfigRead8 + @abstract Reads a 8-bit value from the PCI device's configuration space. + @discussion This method reads a 8-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space. + @result An 8-bit value. */ + + UInt8 extendedConfigRead8( IOByteCount offset ); + +/*! @function extendedConfigWrite32 + @abstract Writes a 32-bit value to the PCI device's configuration space. + @discussion This method writes a 32-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space, of which bits 0-1 are ignored. + @param data An 32-bit value to be written in host byte order (big endian on PPC). */ + + void extendedConfigWrite32( IOByteCount offset, UInt32 data ); + +/*! @function extendedConfigWrite16 + @abstract Writes a 16-bit value to the PCI device's configuration space. + @discussion This method writes a 16-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space, of which bit 0 is ignored. + @param data An 16-bit value to be written in host byte order (big endian on PPC). */ + + void extendedConfigWrite16( IOByteCount offset, UInt16 data ); + +/*! @function extendedConfigWrite8 + @abstract Writes a 8-bit value to the PCI device's configuration space. + @discussion This method writes a 8-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space. + @param data An 8-bit value to be written. */ + + void extendedConfigWrite8( IOByteCount offset, UInt8 data ); +}; + +#endif /* ! _IOKIT_IOPCIDEVICE_H */ + diff --git a/i386/include/IOKit/pci/IOAGPDevice.h b/i386/include/IOKit/pci/IOAGPDevice.h new file mode 100644 index 0000000..c3a7d90 --- /dev/null +++ b/i386/include/IOKit/pci/IOAGPDevice.h @@ -0,0 +1,222 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOAGPDEVICE_H +#define _IOKIT_IOAGPDEVICE_H + +#include +#include + +/* Definitions of AGP config registers */ +enum { + kIOPCIConfigAGPStatusOffset = 4, + kIOPCIConfigAGPCommandOffset = 8 +}; + +/* Definitions of AGP Command & Status registers */ +enum { + kIOAGPRequestQueueMask = 0xff000000, + kIOAGPSideBandAddresssing = 0x00000200, + kIOAGPEnable = 0x00000100, + kIOAGP4GbAddressing = 0x00000020, + kIOAGPFastWrite = 0x00000010, + kIOAGP4xDataRate = 0x00000004, + kIOAGP2xDataRate = 0x00000002, + kIOAGP1xDataRate = 0x00000001 +}; + +enum { + kIOAGPGartInvalidate = 0x00000001 +}; + +// getAGPStatus() defines +enum { + kIOAGPDefaultStatus = 0 +}; +enum { + kIOAGPIdle = 0x00000001, + kIOAGPInvalidGARTEntry = 0x00000002, + kIOAGPAccessOutOfRange = 0x00000004 +}; + +#define kIOAGPBusFlagsKey "IOAGPFlags" +enum { + // the AGP target must be idle before invalidating its gart tlb + kIOAGPGartIdleInvalidate = 0x00000001, + + // the AGP target cannot handle operations that cross page boundaries + kIOAGPDisablePageSpans = 0x00000002, + + // the AGP target cannot handle master -> target AGP writes + kIOAGPDisableAGPWrites = 0x00000004, + + // the AGP target cannot handle target -> master PCI reads + kIOAGPDisablePCIReads = 0x00000008, + + // the AGP target cannot handle master -> target PCI writes + kIOAGPDisablePCIWrites = 0x00000010, + + // the AGP target cannot handle all unaligned transactions + kIOAGPDisableUnaligned = 0x00000020, + + kIOAGPDisableFeature6 = 0x00000040, + kIOAGPDisableFeature7 = 0x00000080, + kIOAGPDisableFeature8 = 0x00000100, + kIOAGPDisableFeature9 = 0x00000200 +}; + +// masterState +enum { + kIOAGPStateEnabled = 0x00000001, + kIOAGPStateEnablePending = 0x00010000 +}; + + +/*! @class IOAGPDevice + @abstract An IOService class representing an AGP master device. + @discussion The discovery of an AGP master device by the PCI bus family results in an instance of the IOAGPDevice being created and published. It provides services specific to AGP, in addition to the PCI services supplied by its superclass IOPCIDevice. +*/ + +class IOAGPDevice : public IOPCIDevice +{ + OSDeclareDefaultStructors(IOAGPDevice) + +protected: + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. +*/ + struct ExpansionData { }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +public: + UInt32 masterState; + UInt8 masterAGPRegisters; + +/*! @function createAGPSpace + @abstract Allocates the AGP space, and enables AGP transactions on the master and slave. + @discussion This method should be called by the driver for the AGP master device to set the size of the space and enable AGP transactions. It will destroy any AGP space currently allocated. + @param options No options are currently defined, pass zero. + @param address The physical range allocated for the AGP space is passed back to the caller. + @param length An in/out parameter - the caller sets the devices maximum AGP addressing and the actual size created is passed back. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn createAGPSpace( IOOptionBits options, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + +/*! @function destroyAGPSpace + @abstract Destroys the AGP space, and disables AGP transactions on the master and slave. + @discussion This method should be called by the driver to shutdown AGP transactions and release resources. +*/ + + virtual IOReturn destroyAGPSpace( void ); + +/*! @function getAGPRangeAllocator + @abstract Accessor to obtain the AGP range allocator. + @discussion To allocate ranges in AGP space, obtain a range allocator for the space with this method. It is retained while the space is created (until destroyAGPSpace is called) and should not be released by the caller. + @result Returns a pointer to the range allocator for the AGP space. +*/ + + virtual IORangeAllocator * getAGPRangeAllocator( void ); + +/*! @function getAGPStatus + @abstract Returns the current state of the AGP bus. + @discussion Returns state bits for the AGP bus. Only one type of status is currently defined. + @param which Type of status - only kIOAGPDefaultStatus is currently valid. + @result Returns mask of status bits for the AGP bus. +*/ + + virtual IOOptionBits getAGPStatus( IOOptionBits which = kIOAGPDefaultStatus ); + +/*! @function commitAGPMemory + @abstract Makes memory addressable by AGP transactions. + @discussion Makes the memory described by the IOMemoryDescriptor object addressable by AGP by entering its pages into the GART array, given an offset into AGP space supplied by the caller (usually allocated by the AGP range allocator). It is the caller's responsibility to prepare non-kernel pageable memory before calling this method, with IOMemoryDescriptor::prepare. + @param memory A IOMemoryDescriptor object describing the memory to add to the GART. + @param agpOffset An offset into AGP space that the caller has allocated - usually allocated by the AGP range allocator. + @param options Pass kIOAGPGartInvalidate if the AGP target should invalidate any GART TLB. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn commitAGPMemory( IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options = 0 ); + +/*! @function releaseAGPMemory + @abstract Releases memory addressable by AGP transactions. + @discussion Makes the memory described by the IOMemoryDescriptor object unaddressable by AGP by removing its pages from the GART array, given an offset into AGP space supplied by the caller (usually allocated by the AGP range allocator). It is the caller's responsibility to complete non-kernel pageable memory before calling this method, with IOMemoryDescriptor::complete. + @param memory A IOMemoryDescriptor object describing the memory to remove from the GART. + @param agpOffset An offset into AGP space that the caller has allocated - usually allocated by the AGP range allocator. + @param options Pass kIOAGPGartInvalidate if the AGP target should invalidate any GART TLB. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn releaseAGPMemory( IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options = 0 ); + + virtual IOReturn resetAGP( IOOptionBits options = 0 ); + +/*! @function getAGPSpace + @abstract Returns the allocated AGP space. + @discussion This method can be called by the driver for the AGP master device to retrieve the physical address and size of the space created with createAGPSpace. + @param address The physical range allocated for the AGP space is passed back to the caller. Zero may be passed if the address is not needed by the caller. + @param length The size of the the AGP space created is passed back. Zero may be passed if the length is not needed by the caller. + @result Returns an IOReturn code indicating success or failure. +*/ + + virtual IOReturn getAGPSpace( IOPhysicalAddress * address, + IOPhysicalLength * length ); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOAGPDevice, 0); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 1); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 2); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 3); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 4); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 5); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 6); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 7); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 8); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 9); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 10); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 11); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 12); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 13); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 14); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 15); + OSMetaClassDeclareReservedUnused(IOAGPDevice, 16); +}; + +#endif /* ! _IOKIT_IOAGPDEVICE_H */ diff --git a/i386/include/IOKit/pci/IOPCIBridge.h b/i386/include/IOKit/pci/IOPCIBridge.h new file mode 100644 index 0000000..2fac052 --- /dev/null +++ b/i386/include/IOKit/pci/IOPCIBridge.h @@ -0,0 +1,381 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPCIBRIDGE_H +#define _IOKIT_IOPCIBRIDGE_H + +#include +#include +#include +#include + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +typedef uint64_t IOPCIScalar; + +struct IOPCIRange +{ + IOPCIScalar start; + IOPCIScalar size; + IOPCIScalar alignment; + UInt32 type; + UInt32 flags; + struct IOPCIRange * next; + struct IOPCIRange * nextSubRange; + struct IOPCIRange * subRange; +}; + +enum { + kIOPCIResourceTypeMemory = 0, + kIOPCIResourceTypePrefetchMemory, + kIOPCIResourceTypeIO, + kIOPCIResourceTypeBusNumber, + kIOPCIResourceTypeCount +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/*! + @class IOPCIBridge + @abstract Base class for all PCI bridge drivers. +*/ +class IOPCIConfigurator; +class IOPCIDevice; + +class IOPCIBridge : public IOService +{ + friend class IOPCIDevice; + friend class IOPCIConfigurator; + + OSDeclareAbstractStructors(IOPCIBridge) + +private: + static void initialize(void); + IORegistryEntry * findMatching( OSIterator * in, IOPCIAddressSpace space ); + virtual bool isDTNub( IOPCIDevice * nub ); + bool checkProperties( IOPCIDevice * entry ); + + void removeDevice( IOPCIDevice * device, IOOptionBits options = 0 ); + IOReturn restoreMachineState( IOOptionBits options = 0); + IOReturn _restoreDeviceState( IOPCIDevice * device, IOOptionBits options ); + IOReturn resolveLegacyInterrupts( IOService * provider, IOPCIDevice * nub ); + IOReturn resolveMSIInterrupts ( IOService * provider, IOPCIDevice * nub ); + +protected: + static void nvLocation( IORegistryEntry * entry, + UInt8 * busNum, UInt8 * deviceNum, UInt8 * functionNum ); + static SInt32 compareAddressCell( UInt32 cellCount, UInt32 cleft[], UInt32 cright[] ); + void checkTerminateChildren(IOService * bridgeDevice, bool eject); + IOReturn setDeviceASPMBits(IOPCIDevice * device, IOOptionBits state); + + IORangeAllocator * bridgeMemoryRanges; + IORangeAllocator * bridgeIORanges; + +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOPCIBridge in the future. +*/ + struct ExpansionData + { + friend class IOPCIConfigurator; + IORangeAllocator * cardBusMemoryRanges; + IOPCIRange * rangeLists[kIOPCIResourceTypeCount]; + }; + +/*! @var reserved + Reserved for future use. (Internal use only) +*/ + ExpansionData *reserved; + +protected: +public: + virtual void probeBus( IOService * provider, UInt8 busNum ); + + virtual UInt8 firstBusNum( void ); + virtual UInt8 lastBusNum( void ); + + virtual void spaceFromProperties( OSDictionary * propTable, + IOPCIAddressSpace * space ); + virtual OSDictionary * constructProperties( IOPCIAddressSpace space ); + + virtual IOPCIDevice * createNub( OSDictionary * from ); + + virtual bool initializeNub( IOPCIDevice * nub, OSDictionary * from ); + + virtual bool publishNub( IOPCIDevice * nub, UInt32 index ); + + virtual bool addBridgeMemoryRange( IOPhysicalAddress start, + IOPhysicalLength length, bool host ); + + virtual bool addBridgeIORange( IOByteCount start, IOByteCount length ); + + virtual bool constructRange( IOPCIAddressSpace * flags, + IOPhysicalAddress phys, IOPhysicalLength len, + OSArray * array ); + + virtual bool matchNubWithPropertyTable( IOService * nub, + OSDictionary * propertyTable, + SInt32 * score ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual bool pciMatchNub( IOPCIDevice * nub, + OSDictionary * table, SInt32 * score); + + virtual bool matchKeys( IOPCIDevice * nub, const char * keys, + UInt32 defaultMask, UInt8 regNum ); + + virtual IOReturn getNubResources( IOService * nub ); + + virtual IOReturn getNubAddressing( IOPCIDevice * nub ); + + virtual IOReturn getDTNubAddressing( IOPCIDevice * nub ); + +public: + virtual void free( void ); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual bool configure( IOService * provider ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual IODeviceMemory * ioDeviceMemory( void ) = 0; + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ) = 0; + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ) = 0; + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ) = 0; + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ) = 0; + + virtual IOPCIAddressSpace getBridgeSpace( void ) = 0; + + virtual UInt32 findPCICapability( IOPCIAddressSpace space, + UInt8 capabilityID, UInt8 * offset = 0 ); + + virtual IOReturn setDevicePowerState( IOPCIDevice * device, + unsigned long whatToDo ); + virtual IOReturn saveDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ); + virtual IOReturn restoreDeviceState( IOPCIDevice * device, + IOOptionBits options = 0 ); + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + virtual IOReturn createAGPSpace( IOAGPDevice * master, + IOOptionBits options, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + + virtual IOReturn destroyAGPSpace( IOAGPDevice * master ); + + virtual IORangeAllocator * getAGPRangeAllocator( IOAGPDevice * master ); + + virtual IOOptionBits getAGPStatus( IOAGPDevice * master, + IOOptionBits options = 0 ); + virtual IOReturn resetAGPDevice( IOAGPDevice * master, + IOOptionBits options = 0 ); + + virtual IOReturn getAGPSpace( IOAGPDevice * master, + IOPhysicalAddress * address, + IOPhysicalLength * length ); + + virtual IOReturn commitAGPMemory( IOAGPDevice * master, + IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options ); + + virtual IOReturn releaseAGPMemory( IOAGPDevice * master, + IOMemoryDescriptor * memory, + IOByteCount agpOffset, + IOOptionBits options ); + +protected: + OSMetaClassDeclareReservedUsed(IOPCIBridge, 0); + virtual bool addBridgePrefetchableMemoryRange( IOPhysicalAddress start, + IOPhysicalLength length, + bool host ); + + OSMetaClassDeclareReservedUsed(IOPCIBridge, 1); + virtual UInt32 extendedFindPCICapability( IOPCIAddressSpace space, + UInt32 capabilityID, IOByteCount * offset = 0 ); + + OSMetaClassDeclareReservedUsed(IOPCIBridge, 2); + virtual IOReturn setDeviceASPMState(IOPCIDevice * device, + IOService * client, IOOptionBits state); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCIBridge, 3); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 4); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 5); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 6); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 7); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 8); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 9); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 10); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 11); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 12); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 13); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 14); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 15); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 16); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 17); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 18); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 19); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 20); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 21); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 22); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 23); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 24); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 25); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 26); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 27); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 28); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 29); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 30); + OSMetaClassDeclareReservedUnused(IOPCIBridge, 31); + + + +}; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define kIOPCIBridgeRegs (32) +/*! + @class IOPCI2PCIBridge + @abstract Base class for all PCI-to-PCI bridge drivers. +*/ + +class IOPCI2PCIBridge : public IOPCIBridge +{ + OSDeclareDefaultStructors(IOPCI2PCIBridge) + +private: + + IOPCIDevice * bridgeDevice; + UInt32 bridgeState[kIOPCIBridgeRegs]; + +protected: +/*! @struct ExpansionData + @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future. + */ + struct ExpansionData + { + // /hotp + IOByteCount xpressCapability; + IOFilterInterruptEventSource * bridgeInterruptSource; + IOWorkLoop * workLoop; + uint32_t hotplugCount; + uint8_t presence; + uint8_t waitingLinkEnable; + uint8_t linkChangeOnly; + uint8_t interruptEnablePending; + uint8_t __reserved[4]; + // hotp/ + }; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + ExpansionData *reserved; +public: + + virtual UInt8 firstBusNum( void ); + virtual UInt8 lastBusNum( void ); + +public: + virtual void free(); + + virtual bool serializeProperties( OSSerialize * serialize ) const; + + virtual IOService * probe( IOService * provider, + SInt32 * score ); + + virtual bool start( IOService * provider ); + + virtual void stop( IOService * provider ); + + virtual bool configure( IOService * provider ); + + virtual void probeBus( IOService * provider, UInt8 busNum ); + + virtual IOReturn requestProbe( IOOptionBits options ); + + virtual void saveBridgeState( void ); + + virtual void restoreBridgeState( void ); + + IOReturn setPowerState( unsigned long powerState, + IOService * whatDevice ); + + virtual bool publishNub( IOPCIDevice * nub, UInt32 index ); + + virtual IODeviceMemory * ioDeviceMemory( void ); + + virtual IOPCIAddressSpace getBridgeSpace( void ); + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ); + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ); + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ); + + virtual IOReturn setDeviceASPMState(IOPCIDevice * device, + IOService * client, IOOptionBits state); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 0); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 1); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 2); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 3); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 4); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 5); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 6); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 7); + OSMetaClassDeclareReservedUnused(IOPCI2PCIBridge, 8); + +protected: + bool filterInterrupt( IOFilterInterruptEventSource * source); + + void handleInterrupt( IOInterruptEventSource * source, + int count ); + +}; + +#endif /* ! _IOKIT_IOPCIBRIDGE_H */ diff --git a/i386/include/IOKit/pci/IOPCIDevice.h b/i386/include/IOKit/pci/IOPCIDevice.h new file mode 100644 index 0000000..d031a06 --- /dev/null +++ b/i386/include/IOKit/pci/IOPCIDevice.h @@ -0,0 +1,673 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOPCIDEVICE_H +#define _IOKIT_IOPCIDEVICE_H + +#include + +/* Definitions of PCI Config Registers */ +enum { + kIOPCIConfigVendorID = 0x00, + kIOPCIConfigDeviceID = 0x02, + kIOPCIConfigCommand = 0x04, + kIOPCIConfigStatus = 0x06, + kIOPCIConfigRevisionID = 0x08, + kIOPCIConfigClassCode = 0x09, + kIOPCIConfigCacheLineSize = 0x0C, + kIOPCIConfigLatencyTimer = 0x0D, + kIOPCIConfigHeaderType = 0x0E, + kIOPCIConfigBIST = 0x0F, + kIOPCIConfigBaseAddress0 = 0x10, + kIOPCIConfigBaseAddress1 = 0x14, + kIOPCIConfigBaseAddress2 = 0x18, + kIOPCIConfigBaseAddress3 = 0x1C, + kIOPCIConfigBaseAddress4 = 0x20, + kIOPCIConfigBaseAddress5 = 0x24, + kIOPCIConfigCardBusCISPtr = 0x28, + kIOPCIConfigSubSystemVendorID = 0x2C, + kIOPCIConfigSubSystemID = 0x2E, + kIOPCIConfigExpansionROMBase = 0x30, + kIOPCIConfigCapabilitiesPtr = 0x34, + kIOPCIConfigInterruptLine = 0x3C, + kIOPCIConfigInterruptPin = 0x3D, + kIOPCIConfigMinimumGrant = 0x3E, + kIOPCIConfigMaximumLatency = 0x3F +}; + +/* Definitions of Capabilities PCI Config Register */ +enum { + kIOPCICapabilityIDOffset = 0x00, + kIOPCINextCapabilityOffset = 0x01, + + kIOPCIPowerManagementCapability = 0x01, + kIOPCIAGPCapability = 0x02, + kIOPCIVitalProductDataCapability = 0x03, + kIOPCISlotIDCapability = 0x04, + kIOPCIMSICapability = 0x05, + kIOPCICPCIHotswapCapability = 0x06, + kIOPCIPCIXCapability = 0x07, + kIOPCILDTCapability = 0x08, + kIOPCIVendorSpecificCapability = 0x09, + kIOPCIDebugPortCapability = 0x0a, + kIOPCICPCIResourceControlCapability = 0x0b, + kIOPCIHotplugCapability = 0x0c, + kIOPCIAGP8Capability = 0x0e, + kIOPCISecureCapability = 0x0f, + kIOPCIPCIExpressCapability = 0x10, + kIOPCIMSIXCapability = 0x11, + + kIOPCIExpressErrorReportingCapability = -1UL, + kIOPCIExpressVirtualChannelCapability = -2UL, + kIOPCIExpressDeviceSerialNumberCapability = -3UL, + kIOPCIExpressPowerBudgetCapability = -4UL +}; + +/* Space definitions */ +enum { + kIOPCIConfigSpace = 0, + kIOPCIIOSpace = 1, + kIOPCI32BitMemorySpace = 2, + kIOPCI64BitMemorySpace = 3 +}; + +/* Command register definitions */ +enum { + kIOPCICommandIOSpace = 0x0001, + kIOPCICommandMemorySpace = 0x0002, + kIOPCICommandBusMaster = 0x0004, + kIOPCICommandSpecialCycles = 0x0008, + kIOPCICommandMemWrInvalidate = 0x0010, + kIOPCICommandPaletteSnoop = 0x0020, + kIOPCICommandParityError = 0x0040, + kIOPCICommandAddressStepping = 0x0080, + kIOPCICommandSERR = 0x0100, + kIOPCICommandFastBack2Back = 0x0200, + kIOPCICommandInterruptDisable = 0x0400 +}; + +/* Status register definitions */ +enum { + kIOPCIStatusCapabilities = 0x0010, + kIOPCIStatusPCI66 = 0x0020, + kIOPCIStatusUDF = 0x0040, + kIOPCIStatusFastBack2Back = 0x0080, + kIOPCIStatusDevSel0 = 0x0000, + kIOPCIStatusDevSel1 = 0x0200, + kIOPCIStatusDevSel2 = 0x0400, + kIOPCIStatusDevSel3 = 0x0600, + kIOPCIStatusTargetAbortCapable = 0x0800, + kIOPCIStatusTargetAbortActive = 0x1000, + kIOPCIStatusMasterAbortActive = 0x2000, + kIOPCIStatusSERRActive = 0x4000, + kIOPCIStatusParityErrActive = 0x8000 +}; + +// constants which are part of the PCI Bus Power Management Spec. +enum +{ + // capabilities bits in the 16 bit capabilities register + kPCIPMCPMESupportFromD3Cold = 0x8000, + kPCIPMCPMESupportFromD3Hot = 0x4000, + kPCIPMCPMESupportFromD2 = 0x2000, + kPCIPMCPMESupportFromD1 = 0x1000, + kPCIPMCPMESupportFromD0 = 0x0800, + kPCIPMCD2Support = 0x0400, + kPCIPMCD1Support = 0x0200, + + kPCIPMCD3Support = 0x0001 +}; + +enum +{ + // bits in the power management control/status register + kPCIPMCSPMEStatus = 0x8000, + kPCIPMCSPMEEnable = 0x0100, + kPCIPMCSPowerStateMask = 0x0003, + kPCIPMCSPowerStateD3 = 0x0003, + kPCIPMCSPowerStateD2 = 0x0002, + kPCIPMCSPowerStateD1 = 0x0001, + kPCIPMCSPowerStateD0 = 0x0000, + + kPCIPMCSDefaultEnableBits = (~(IOOptionBits)0) +}; + +union IOPCIAddressSpace { + UInt32 bits; + struct { +#if __BIG_ENDIAN__ + unsigned int reloc:1; + unsigned int prefetch:1; + unsigned int t:1; + unsigned int resv:3; + unsigned int space:2; + unsigned int busNum:8; + unsigned int deviceNum:5; + unsigned int functionNum:3; + unsigned int registerNum:8; +#elif __LITTLE_ENDIAN__ + unsigned int registerNum:8; + unsigned int functionNum:3; + unsigned int deviceNum:5; + unsigned int busNum:8; + unsigned int space:2; + unsigned int resv:3; + unsigned int t:1; + unsigned int prefetch:1; + unsigned int reloc:1; +#endif + } s; + struct { +#if __BIG_ENDIAN__ + unsigned int resv:4; + unsigned int registerNumExtended:4; + unsigned int busNum:8; + unsigned int deviceNum:5; + unsigned int functionNum:3; + unsigned int registerNum:8; +#elif __LITTLE_ENDIAN__ + unsigned int registerNum:8; + unsigned int functionNum:3; + unsigned int deviceNum:5; + unsigned int busNum:8; + unsigned int registerNumExtended:4; + unsigned int resv:4; +#endif + } es; +}; + +struct IOPCIPhysicalAddress { + IOPCIAddressSpace physHi; + UInt32 physMid; + UInt32 physLo; + UInt32 lengthHi; + UInt32 lengthLo; +}; + +// IOPCIDevice matching property names +#define kIOPCIMatchKey "IOPCIMatch" +#define kIOPCIPrimaryMatchKey "IOPCIPrimaryMatch" +#define kIOPCISecondaryMatchKey "IOPCISecondaryMatch" +#define kIOPCIClassMatchKey "IOPCIClassMatch" + +// property to control PCI default config space save on sleep +#define kIOPMPCIConfigSpaceVolatileKey "IOPMPCIConfigSpaceVolatile" + +// pci express link status +#define kIOPCIExpressLinkStatusKey "IOPCIExpressLinkStatus" +// pci express link capabilities +#define kIOPCIExpressLinkCapabilitiesKey "IOPCIExpressLinkCapabilities" + +#ifndef kIOPlatformDeviceASPMEnableKey +#define kIOPlatformDeviceASPMEnableKey "IOPlatformDeviceASPMEnable" +#endif + +#ifndef kIOPCIDeviceASPMSupportedKey +#define kIOPCIDeviceASPMSupportedKey "pci-aspm-supported" +#endif + +#define kIOPCIPMEOptionsKey "IOPCIPMEOptions" + + +enum { + kIOPCIDevicePowerStateCount = 3, + kIOPCIDeviceOffState = 0, + kIOPCIDeviceDozeState = 1, + kIOPCIDeviceOnState = 2, +}; + +enum +{ + // bits getInterruptType result + kIOInterruptTypePCIMessaged = 0x00010000 +}; + +class IOPCIBridge; +class IOPCI2PCIBridge; +class IOPCIMessagedInterruptController; + +/*! @class IOPCIDevice : public IOService + @abstract An IOService class representing a PCI device. + @discussion The discovery of a PCI device by the PCI bus family results in an instance of the IOPCIDevice being created and published. It provides services for looking up and mapping memory mapped hardware, and access to the PCI configuration and I/O spaces. + +

Matching Supported by IOPCIDevice

+ +Two types of matching are available, OpenFirmware name matching and PCI register matching. Currently, only one of these two matching schemes can be used in the same property table. + +

OpenFirmware Name Matching

+ +IOService performs matching based on the IONameMatch property (see IOService). IOPCIDevices created with OpenFirmware device tree entries will name match based on the standard OpenFirmware name matching properties. + +

PCI Register Matching

+ +A PCI device driver can also match on the values of certain config space registers. + +In each case, several matching values can be specified, and an optional mask for the value of the config space register may follow the value, preceded by an '&' character. +
+
+ kIOPCIMatchKey, "IOPCIMatch" +
+The kIOPCIMatchKey property matches the vendor and device ID (0x00) register, or the subsystem register (0x2c). +
+
+ kIOPCIPrimaryMatchKey, "IOPCIPrimaryMatch" +
+The kIOPCIPrimaryMatchKey property matches the vendor and device ID (0x00) register. +
+
+ kIOPCISecondaryMatchKey, "IOPCISecondaryMatch" +
+The kIOPCISecondaryMatchKey property matches the subsystem register (0x2c). +
+
+ kIOPCIClassMatchKey, "IOPCIClassMatch" +
+The kIOPCIClassMatchKey property matches the class code register (0x08). The default mask for this register is 0xffffff00. +
+
+Examples: +
+
+ <key>IOPCIMatch</key>
+ <string>0x00261011</string> +
+Matches a device whose vendor ID is 0x1011, and device ID is 0x0026, including subsystem IDs. +
+
+ <key>IOPCIMatch</key>
+ <string>0x00789004&0x00ffffff 0x78009004&0x0xff00ffff</string> +
+Matches with any device with a vendor ID of 0x9004, and a device ID of 0xzz78 or 0x78zz, where 'z' is don't care. +
+
+ <key>IOPCIClassMatch</key>
+ <string>0x02000000&0xffff0000</string> +
+
+Matches a device whose class code is 0x0200zz, an ethernet device. + +*/ + +class IOPCIDevice : public IOService +{ + OSDeclareDefaultStructors(IOPCIDevice) + + friend class IOPCIBridge; + friend class IOPCI2PCIBridge; + friend class IOPCIMessagedInterruptController; + +protected: + IOPCIBridge * parent; + IOMemoryMap * ioMap; + OSObject * slotNameProperty; + +/*! @var reserved + Reserved for future use. (Internal use only) */ + struct IOPCIDeviceExpansionData * reserved; + +public: + IOPCIAddressSpace space; + UInt32 * savedConfig; + +public: + /* IOService/IORegistryEntry methods */ + + virtual bool init( OSDictionary * propTable ); + virtual bool init( IORegistryEntry * from, + const IORegistryPlane * inPlane ); + virtual void free(); + virtual bool attach( IOService * provider ); + virtual void detach( IOService * provider ); + + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + virtual IOReturn powerStateWillChangeTo (IOPMPowerFlags capabilities, + unsigned long stateNumber, + IOService* whatDevice); + virtual IOReturn setPowerState( unsigned long, IOService * ); + + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + virtual bool matchPropertyTable( OSDictionary * table, + SInt32 * score ); + virtual IOService * matchLocation( IOService * client ); + virtual IOReturn getResources( void ); + virtual IOReturn setProperties(OSObject * properties); + virtual IOReturn callPlatformFunction(const OSSymbol * functionName, + bool waitForFunction, + void * p1, void * p2, + void * p3, void * p4); + virtual IOReturn callPlatformFunction(const char * functionName, + bool waitForFunction, + void * p1, void * p2, + void * p3, void * p4); + + /* Config space accessors */ + + virtual UInt32 configRead32( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite32( IOPCIAddressSpace space, + UInt8 offset, UInt32 data ); + virtual UInt16 configRead16( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite16( IOPCIAddressSpace space, + UInt8 offset, UInt16 data ); + virtual UInt8 configRead8( IOPCIAddressSpace space, UInt8 offset ); + virtual void configWrite8( IOPCIAddressSpace space, + UInt8 offset, UInt8 data ); + +/*! @function configRead32 + @abstract Reads a 32-bit value from the PCI device's configuration space. + @discussion This method reads a 32-bit configuration space register on the device and returns its value. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @result An 32-bit value in host byte order (big endian on PPC). */ + + virtual UInt32 configRead32( UInt8 offset ); + +/*! @function configRead16 + @abstract Reads a 16-bit value from the PCI device's configuration space. + @discussion This method reads a 16-bit configuration space register on the device and returns its value. + @param offset An 8-bit offset into configuration space, of which bit 0 is ignored. + @result An 16-bit value in host byte order (big endian on PPC). */ + + virtual UInt16 configRead16( UInt8 offset ); + +/*! @function configRead8 + @abstract Reads a 8-bit value from the PCI device's configuration space. + @discussion This method reads a 8-bit configuration space register on the device and returns its value. + @param offset An 8-bit offset into configuration space. + @result An 8-bit value. */ + + virtual UInt8 configRead8( UInt8 offset ); + +/*! @function configWrite32 + @abstract Writes a 32-bit value to the PCI device's configuration space. + @discussion This method write a 32-bit value to a configuration space register on the device. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @param data An 32-bit value to be written in host byte order (big endian on PPC). */ + + virtual void configWrite32( UInt8 offset, UInt32 data ); + +/*! @function configWrite16 + @abstract Writes a 16-bit value to the PCI device's configuration space. + @discussion This method write a 16-bit value to a configuration space register on the device. + @param offset An 8-bit offset into configuration space, of which bit 0 is ignored. + @param data An 16-bit value to be written in host byte order (big endian on PPC). */ + + virtual void configWrite16( UInt8 offset, UInt16 data ); + +/*! @function configWrite8 + @abstract Writes a 8-bit value to the PCI device's configuration space. + @discussion This method write a 8-bit value to a configuration space register on the device. + @param offset An 8-bit offset into configuration space. + @param data An 8-bit value to be written. */ + + virtual void configWrite8( UInt8 offset, UInt8 data ); + + virtual IOReturn saveDeviceState( IOOptionBits options = 0 ); + virtual IOReturn restoreDeviceState( IOOptionBits options = 0 ); + +/*! @function setConfigBits + @abstract Sets masked bits in a configuration space register. + @discussion This method sets masked bits in a configuration space register on the device by reading and writing the register. The value of the masked bits before the write is returned. + @param offset An 8-bit offset into configuration space, of which bits 0-1 are ignored. + @param mask An 32-bit mask indicating which bits in the value parameter are valid. + @param data An 32-bit value to be written in host byte order (big endian on PPC). + @result The value of the register masked with the mask before the write. */ + + virtual UInt32 setConfigBits( UInt8 offset, UInt32 mask, UInt32 value ); + +/*! @function setMemoryEnable + @abstract Sets the device's memory space response. + @discussion This method sets the memory space response bit in the device's command config space register to the passed value, and returns the previous state of the enable. + @param enable True or false to enable or disable the memory space response. + @result True if the memory space response was previously enabled, false otherwise. */ + + virtual bool setMemoryEnable( bool enable ); + +/*! @function setIOEnable + @abstract Sets the device's I/O space response. + @discussion This method sets the I/O space response bit in the device's command config space register to the passed value, and returns the previous state of the enable. The exclusive option allows only one exclusive device on the bus to be enabled concurrently, this should be only for temporary access. + @param enable True or false to enable or disable the I/O space response. + @param exclusive If true, only one setIOEnable with the exclusive flag set will be allowed at a time on the bus, this should be only for temporary access. + @result True if the I/O space response was previously enabled, false otherwise. */ + + virtual bool setIOEnable( bool enable, bool exclusive = false ); + +/*! @function setBusMasterEnable + @abstract Sets the device's bus master enable. + @discussion This method sets the bus master enable bit in the device's command config space register to the passed value, and returns the previous state of the enable. + @param enable True or false to enable or disable bus mastering. + @result True if bus mastering was previously enabled, false otherwise. */ + + virtual bool setBusMasterEnable( bool enable ); + +/*! @function findPCICapability + @abstract Search configuration space for a PCI capability register. + @discussion This method searches the device's config space for a PCI capability register matching the passed capability ID, if the device supports PCI capabilities. To search for PCI Express extended capabilities or for multiple capablities with the same ID, use the extendedFindPCICapability() method. + @param capabilityID An 8-bit PCI capability ID. + @param offset An optional pointer to return the offset into config space where the capability was found. + @result The 32-bit value of the capability register if one was found, zero otherwise. */ + + virtual UInt32 findPCICapability( UInt8 capabilityID, UInt8 * offset = 0 ); + +/*! @function getBusNumber + @abstract Accessor to return the PCI device's assigned bus number. + @discussion This method is an accessor to return the PCI device's assigned bus number. + @result The 8-bit value of device's PCI bus number. */ + + virtual UInt8 getBusNumber( void ); + +/*! @function getDeviceNumber + @abstract Accessor to return the PCI device's device number. + @discussion This method is an accessor to return the PCI device's device number. + @result The 5-bit value of device's device number. */ + + virtual UInt8 getDeviceNumber( void ); + +/*! @function getFunctionNumber + @abstract Accessor to return the PCI device's function number. + @discussion This method is an accessor to return the PCI device's function number. + @result The 3-bit value of device's function number. */ + + virtual UInt8 getFunctionNumber( void ); + + /* Device memory accessors */ + +/*! @function getDeviceMemoryWithRegister + @abstract Returns an instance of IODeviceMemory representing one of the device's memory mapped ranges. + @discussion This method will return a pointer to an instance of IODeviceMemory for the physical memory range that was assigned to the configuration space base address register passed in. It is analogous to IOService::getDeviceMemoryWithIndex. + @param reg The 8-bit configuration space register that is the base address register for the desired range. + @result A pointer to an instance of IODeviceMemory, or zero no such range was found. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. */ + + virtual IODeviceMemory * getDeviceMemoryWithRegister( UInt8 reg ); + +/*! @function mapDeviceMemoryWithRegister + @abstract Maps a physical range of the device. + @discussion This method will create a mapping for the IODeviceMemory for the physical memory range that was assigned to the configuration space base address register passed in, with IODeviceMemory::map(options). The mapping is represented by the returned instance of IOMemoryMap, which should not be released until the mapping is no longer required. This method is analogous to IOService::mapDeviceMemoryWithIndex. + @param reg The 8-bit configuration space register that is the base address register for the desired range. + @param options Options to be passed to the IOMemoryDescriptor::map() method. + @result An instance of IOMemoryMap, or zero if the index is beyond the count available. The mapping should be released only when access to it is no longer required. */ + + virtual IOMemoryMap * mapDeviceMemoryWithRegister( UInt8 reg, + IOOptionBits options = 0 ); + +/*! @function ioDeviceMemory + @abstract Accessor to the I/O space aperture for the bus. + @discussion This method will return a reference to the IODeviceMemory for the I/O aperture of the bus the device is on. + @result A pointer to an IODeviceMemory object for the I/O aperture. The IODeviceMemory is retained by the provider, so is valid while attached, or while any mappings to it exist. It should not be released by the caller. */ + + virtual IODeviceMemory * ioDeviceMemory( void ); + + /* I/O space accessors */ + +/*! @function ioWrite32 + @abstract Writes a 32-bit value to an I/O space aperture. + @discussion This method will write a 32-bit value to a 4 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite32( UInt16 offset, UInt32 value, + IOMemoryMap * map = 0 ); + +/*! @function ioWrite16 + @abstract Writes a 16-bit value to an I/O space aperture. + @discussion This method will write a 16-bit value to a 2 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite16( UInt16 offset, UInt16 value, + IOMemoryMap * map = 0 ); + +/*! @function ioWrite8 + @abstract Writes a 8-bit value to an I/O space aperture. + @discussion This method will write a 8-bit value to an offset in an I/O space aperture. If a map object is passed in, the value is written relative to it, otherwise to the value is written relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param value The value to be written in host byte order (big endian on PPC). + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. */ + + virtual void ioWrite8( UInt16 offset, UInt8 value, + IOMemoryMap * map = 0 ); + +/*! @function ioRead32 + @abstract Reads a 32-bit value from an I/O space aperture. + @discussion This method will read a 32-bit value from a 4 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read in host byte order (big endian on PPC). */ + + virtual UInt32 ioRead32( UInt16 offset, IOMemoryMap * map = 0 ); + +/*! @function ioRead16 + @abstract Reads a 16-bit value from an I/O space aperture. + @discussion This method will read a 16-bit value from a 2 byte aligned offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read in host byte order (big endian on PPC). */ + + virtual UInt16 ioRead16( UInt16 offset, IOMemoryMap * map = 0 ); + +/*! @function ioRead8 + @abstract Reads a 8-bit value from an I/O space aperture. + @discussion This method will read a 8-bit value from an offset in an I/O space aperture. If a map object is passed in, the value is read relative to it, otherwise to the value is read relative to the I/O space aperture for the bus. This function encapsulates the differences between architectures in generating I/O space operations. An eieio instruction is included on PPC. + @param offset An offset into a bus or device's I/O space aperture. + @param map If the offset is relative to the beginning of a device's aperture, an IOMemoryMap object for that object should be passed in. Otherwise, passing zero will write the value relative to the beginning of the bus' I/O space. + @result The value read. */ + + virtual UInt8 ioRead8( UInt16 offset, IOMemoryMap * map = 0 ); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 0); +/*! @function hasPCIPowerManagement + @abstract determine whether or not the device supports PCI Bus Power Management. + @discussion This method will look at the device's capabilties registers and determine whether or not the device supports the PCI BUS Power Management Specification. + @param state(optional) Check for support of a specific state (e.g. kPCIPMCPMESupportFromD3Cold). If state is not suuplied or is 0, then check for a property in the registry which tells which state the hardware expects the device to go to during sleep. + @result true if the specified state is supported */ + virtual bool hasPCIPowerManagement(IOOptionBits state = 0); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 1); +/*! @function enablePCIPowerManagement + @abstract enable PCI power management for sleep state + @discussion This method will enable PCI Bus Powermanagement when going to sleep mode. + @param state(optional) Enables PCI Power Management by placing the function in the given state (e.g. kPCIPMCSPowerStateD3). If state is not specified or is 0xffffffff, then the IOPCIDevice determines the desired state. If state is kPCIPMCSPowerStateD0 (0) then PCI Power Management is disabled. + @result kIOReturnSuccess if there were no errors */ + virtual IOReturn enablePCIPowerManagement(IOOptionBits state = 0xffffffff); + + OSMetaClassDeclareReservedUsed(IOPCIDevice, 2); +/*! @function extendedFindPCICapability + @abstract Search configuration space for a PCI capability register. + @discussion This method searches the device's config space for a PCI capability register matching the passed capability ID, if the device supports PCI capabilities. + @param capabilityID A PCI capability ID. PCI Express devices may support extended capabilities in config space starting at offset 0x100. To search this space, the ID passed should be the negated value of the PCI-SIG assigned ID for the extended capability. + @param offset An optional in/out parameter to return the offset into config space where the capability was found, and to set the start point of the next search. Initialize the offset to zero before the first call to extendedFindPCICapability() and subsequent calls will find all capabilty blocks that may exist on the device with the same ID. + @result The 32-bit value of the capability register if one was found, zero otherwise. */ + + virtual UInt32 extendedFindPCICapability( UInt32 capabilityID, IOByteCount * offset = 0 ); + + // Unused Padding + OSMetaClassDeclareReservedUnused(IOPCIDevice, 3); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 4); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 5); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 6); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 7); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 8); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 9); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 10); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 11); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 12); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 13); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 14); + OSMetaClassDeclareReservedUnused(IOPCIDevice, 15); + +public: + +/*! @function extendedConfigRead32 + @abstract Reads a 32-bit value from the PCI device's configuration space. + @discussion This method reads a 32-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space, of which bits 0-1 are ignored. + @result An 32-bit value in host byte order (big endian on PPC). */ + + UInt32 extendedConfigRead32( IOByteCount offset ); + +/*! @function extendedConfigRead16 + @abstract Reads a 16-bit value from the PCI device's configuration space. + @discussion This method reads a 16-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space, of which bit 0 is ignored. + @result An 16-bit value in host byte order (big endian on PPC). */ + + UInt16 extendedConfigRead16( IOByteCount offset ); + +/*! @function extendedConfigRead8 + @abstract Reads a 8-bit value from the PCI device's configuration space. + @discussion This method reads a 8-bit configuration space register on the device and returns its value. + @param offset A byte offset into configuration space. + @result An 8-bit value. */ + + UInt8 extendedConfigRead8( IOByteCount offset ); + +/*! @function extendedConfigWrite32 + @abstract Writes a 32-bit value to the PCI device's configuration space. + @discussion This method writes a 32-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space, of which bits 0-1 are ignored. + @param data An 32-bit value to be written in host byte order (big endian on PPC). */ + + void extendedConfigWrite32( IOByteCount offset, UInt32 data ); + +/*! @function extendedConfigWrite16 + @abstract Writes a 16-bit value to the PCI device's configuration space. + @discussion This method writes a 16-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space, of which bit 0 is ignored. + @param data An 16-bit value to be written in host byte order (big endian on PPC). */ + + void extendedConfigWrite16( IOByteCount offset, UInt16 data ); + +/*! @function extendedConfigWrite8 + @abstract Writes a 8-bit value to the PCI device's configuration space. + @discussion This method writes a 8-bit value to a configuration space register on the device. + @param offset A byte offset into configuration space. + @param data An 8-bit value to be written. */ + + void extendedConfigWrite8( IOByteCount offset, UInt8 data ); +}; + +#endif /* ! _IOKIT_IOPCIDEVICE_H */ + diff --git a/i386/include/IOKit/platform/.svn/all-wcprops b/i386/include/IOKit/platform/.svn/all-wcprops new file mode 100644 index 0000000..4733bb3 --- /dev/null +++ b/i386/include/IOKit/platform/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/platform +END +AppleMacIO.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/platform/AppleMacIO.h +END +AppleMacIODevice.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/platform/AppleMacIODevice.h +END +ApplePlatformExpert.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/platform/ApplePlatformExpert.h +END +AppleNMI.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/platform/AppleNMI.h +END diff --git a/i386/include/IOKit/platform/.svn/entries b/i386/include/IOKit/platform/.svn/entries new file mode 100644 index 0000000..4dbbd48 --- /dev/null +++ b/i386/include/IOKit/platform/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/platform +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +AppleMacIO.h +file + + + + +2013-08-27T23:54:20.000000Z +e9614e104fdb0969eeaab8f5878c15db +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2553 + +AppleMacIODevice.h +file + + + + +2013-08-27T23:54:20.000000Z +da33d4bcb4363ccb7d832f9b7019b3c9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2153 + +ApplePlatformExpert.h +file + + + + +2013-08-27T23:54:20.000000Z +227f5a69a8d7c83855c4dff7a0bdd68f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2744 + +AppleNMI.h +file + + + + +2013-08-27T23:54:20.000000Z +65ddf2ae2939f64b26b164cf5301970c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2542 + diff --git a/i386/include/IOKit/platform/.svn/text-base/AppleMacIO.h.svn-base b/i386/include/IOKit/platform/.svn/text-base/AppleMacIO.h.svn-base new file mode 100644 index 0000000..ae12eca --- /dev/null +++ b/i386/include/IOKit/platform/.svn/text-base/AppleMacIO.h.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEMACIO_H +#define _IOKIT_APPLEMACIO_H + +#include + +#include + +class AppleMacIO : public IOService +{ + OSDeclareAbstractStructors(AppleMacIO); + + IOService * fNub; + IOMemoryMap * fMemory; + + struct ExpansionData { }; + ExpansionData *fReserved; + +protected: + virtual bool selfTest( void ); + +public: + virtual bool start( IOService * provider ); + + virtual IOService * createNub( IORegistryEntry * from ); + + virtual void processNub( IOService * nub ); + + virtual void publishBelow( IORegistryEntry * root ); + + virtual const char * deleteList( void ); + virtual const char * excludeList( void ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual IOReturn getNubResources( IOService * nub ); + + OSMetaClassDeclareReservedUnused(AppleMacIO, 0); + OSMetaClassDeclareReservedUnused(AppleMacIO, 1); + OSMetaClassDeclareReservedUnused(AppleMacIO, 2); + OSMetaClassDeclareReservedUnused(AppleMacIO, 3); +}; + +#endif /* ! _IOKIT_APPLEMACIO_H */ diff --git a/i386/include/IOKit/platform/.svn/text-base/AppleMacIODevice.h.svn-base b/i386/include/IOKit/platform/.svn/text-base/AppleMacIODevice.h.svn-base new file mode 100644 index 0000000..8d033fd --- /dev/null +++ b/i386/include/IOKit/platform/.svn/text-base/AppleMacIODevice.h.svn-base @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEMACIODEVICE_H +#define _IOKIT_APPLEMACIODEVICE_H + +#include + +class AppleMacIODevice : public IOService +{ + OSDeclareDefaultStructors(AppleMacIODevice); + +private: + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + virtual IOService *matchLocation(IOService *client); + virtual IOReturn getResources( void ); + + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 0); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 1); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 2); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 3); +}; + +#endif /* ! _IOKIT_APPLEMACIODEVICE_H */ diff --git a/i386/include/IOKit/platform/.svn/text-base/AppleNMI.h.svn-base b/i386/include/IOKit/platform/.svn/text-base/AppleNMI.h.svn-base new file mode 100644 index 0000000..14cd1ed --- /dev/null +++ b/i386/include/IOKit/platform/.svn/text-base/AppleNMI.h.svn-base @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-9 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + +#ifndef _IOKIT_APPLENMI_H +#define _IOKIT_APPLENMI_H + +#include +#include + +// NMI Interrupt Constants +enum +{ + kExtInt9_NMIIntSource = 0x800506E0, + kNMIIntLevelMask = 0x00004000, + kNMIIntMask = 0x00000080 +}; + + +class AppleNMI : public IOService +{ + OSDeclareDefaultStructors(AppleNMI); + +private: + bool enable_debugger; + bool mask_NMI; + + struct ExpansionData { }; + ExpansionData * reserved; // Reserved for future use + +public: + IOService *rootDomain; + virtual bool start(IOService *provider); + virtual IOReturn initNMI(IOInterruptController *parentController, OSData *parentSource); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, int source); + + // Power handling methods: + virtual IOReturn powerStateWillChangeTo(IOPMPowerFlags, unsigned long, IOService*); + + OSMetaClassDeclareReservedUnused(AppleNMI, 0); + OSMetaClassDeclareReservedUnused(AppleNMI, 1); + OSMetaClassDeclareReservedUnused(AppleNMI, 2); + OSMetaClassDeclareReservedUnused(AppleNMI, 3); +}; + +#endif /* ! _IOKIT_APPLENMI_H */ diff --git a/i386/include/IOKit/platform/.svn/text-base/ApplePlatformExpert.h.svn-base b/i386/include/IOKit/platform/.svn/text-base/ApplePlatformExpert.h.svn-base new file mode 100644 index 0000000..59728d2 --- /dev/null +++ b/i386/include/IOKit/platform/.svn/text-base/ApplePlatformExpert.h.svn-base @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEPLATFORM_H +#define _IOKIT_APPLEPLATFORM_H + +#include + +enum { + kBootROMTypeOldWorld = 0, + kBootROMTypeNewWorld +}; + +enum { + kChipSetTypePowerSurge = 0, + kChipSetTypePowerStar, + kChipSetTypeGossamer, + kChipSetTypePowerExpress, + kChipSetTypeCore99, + kChipSetTypeCore2001 +}; + +enum { + kMachineTypeUnknown = 0 +}; + +extern const OSSymbol *gGetDefaultBusSpeedsKey; + +class ApplePlatformExpert : public IODTPlatformExpert +{ + OSDeclareAbstractStructors(ApplePlatformExpert); + +private: + SInt32 _timeToGMT; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool start( IOService * provider ); + virtual bool configure( IOService * provider ); + virtual const char * deleteList( void ); + virtual const char * excludeList( void ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual long getGMTTimeOfDay(void); + virtual void setGMTTimeOfDay(long secs); + + virtual bool getMachineName(char *name, int maxLength); + + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 0); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 1); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 2); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 3); +}; + + +#endif /* ! _IOKIT_APPLEPLATFORM_H */ diff --git a/i386/include/IOKit/platform/AppleMacIO.h b/i386/include/IOKit/platform/AppleMacIO.h new file mode 100644 index 0000000..ae12eca --- /dev/null +++ b/i386/include/IOKit/platform/AppleMacIO.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEMACIO_H +#define _IOKIT_APPLEMACIO_H + +#include + +#include + +class AppleMacIO : public IOService +{ + OSDeclareAbstractStructors(AppleMacIO); + + IOService * fNub; + IOMemoryMap * fMemory; + + struct ExpansionData { }; + ExpansionData *fReserved; + +protected: + virtual bool selfTest( void ); + +public: + virtual bool start( IOService * provider ); + + virtual IOService * createNub( IORegistryEntry * from ); + + virtual void processNub( IOService * nub ); + + virtual void publishBelow( IORegistryEntry * root ); + + virtual const char * deleteList( void ); + virtual const char * excludeList( void ); + + virtual bool compareNubName( const IOService * nub, OSString * name, + OSString ** matched = 0 ) const; + + virtual IOReturn getNubResources( IOService * nub ); + + OSMetaClassDeclareReservedUnused(AppleMacIO, 0); + OSMetaClassDeclareReservedUnused(AppleMacIO, 1); + OSMetaClassDeclareReservedUnused(AppleMacIO, 2); + OSMetaClassDeclareReservedUnused(AppleMacIO, 3); +}; + +#endif /* ! _IOKIT_APPLEMACIO_H */ diff --git a/i386/include/IOKit/platform/AppleMacIODevice.h b/i386/include/IOKit/platform/AppleMacIODevice.h new file mode 100644 index 0000000..8d033fd --- /dev/null +++ b/i386/include/IOKit/platform/AppleMacIODevice.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEMACIODEVICE_H +#define _IOKIT_APPLEMACIODEVICE_H + +#include + +class AppleMacIODevice : public IOService +{ + OSDeclareDefaultStructors(AppleMacIODevice); + +private: + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool compareName( OSString * name, OSString ** matched = 0 ) const; + virtual IOService *matchLocation(IOService *client); + virtual IOReturn getResources( void ); + + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 0); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 1); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 2); + OSMetaClassDeclareReservedUnused(AppleMacIODevice, 3); +}; + +#endif /* ! _IOKIT_APPLEMACIODEVICE_H */ diff --git a/i386/include/IOKit/platform/AppleNMI.h b/i386/include/IOKit/platform/AppleNMI.h new file mode 100644 index 0000000..14cd1ed --- /dev/null +++ b/i386/include/IOKit/platform/AppleNMI.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-9 Apple Computer, Inc. All rights reserved. + * + * DRI: Josh de Cesare + * + */ + +#ifndef _IOKIT_APPLENMI_H +#define _IOKIT_APPLENMI_H + +#include +#include + +// NMI Interrupt Constants +enum +{ + kExtInt9_NMIIntSource = 0x800506E0, + kNMIIntLevelMask = 0x00004000, + kNMIIntMask = 0x00000080 +}; + + +class AppleNMI : public IOService +{ + OSDeclareDefaultStructors(AppleNMI); + +private: + bool enable_debugger; + bool mask_NMI; + + struct ExpansionData { }; + ExpansionData * reserved; // Reserved for future use + +public: + IOService *rootDomain; + virtual bool start(IOService *provider); + virtual IOReturn initNMI(IOInterruptController *parentController, OSData *parentSource); + virtual IOReturn handleInterrupt(void *refCon, IOService *nub, int source); + + // Power handling methods: + virtual IOReturn powerStateWillChangeTo(IOPMPowerFlags, unsigned long, IOService*); + + OSMetaClassDeclareReservedUnused(AppleNMI, 0); + OSMetaClassDeclareReservedUnused(AppleNMI, 1); + OSMetaClassDeclareReservedUnused(AppleNMI, 2); + OSMetaClassDeclareReservedUnused(AppleNMI, 3); +}; + +#endif /* ! _IOKIT_APPLENMI_H */ diff --git a/i386/include/IOKit/platform/ApplePlatformExpert.h b/i386/include/IOKit/platform/ApplePlatformExpert.h new file mode 100644 index 0000000..59728d2 --- /dev/null +++ b/i386/include/IOKit/platform/ApplePlatformExpert.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_APPLEPLATFORM_H +#define _IOKIT_APPLEPLATFORM_H + +#include + +enum { + kBootROMTypeOldWorld = 0, + kBootROMTypeNewWorld +}; + +enum { + kChipSetTypePowerSurge = 0, + kChipSetTypePowerStar, + kChipSetTypeGossamer, + kChipSetTypePowerExpress, + kChipSetTypeCore99, + kChipSetTypeCore2001 +}; + +enum { + kMachineTypeUnknown = 0 +}; + +extern const OSSymbol *gGetDefaultBusSpeedsKey; + +class ApplePlatformExpert : public IODTPlatformExpert +{ + OSDeclareAbstractStructors(ApplePlatformExpert); + +private: + SInt32 _timeToGMT; + + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool start( IOService * provider ); + virtual bool configure( IOService * provider ); + virtual const char * deleteList( void ); + virtual const char * excludeList( void ); + + virtual void registerNVRAMController( IONVRAMController * nvram ); + + virtual long getGMTTimeOfDay(void); + virtual void setGMTTimeOfDay(long secs); + + virtual bool getMachineName(char *name, int maxLength); + + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 0); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 1); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 2); + OSMetaClassDeclareReservedUnused(ApplePlatformExpert, 3); +}; + + +#endif /* ! _IOKIT_APPLEPLATFORM_H */ diff --git a/i386/include/IOKit/power/.svn/all-wcprops b/i386/include/IOKit/power/.svn/all-wcprops new file mode 100644 index 0000000..6511ce4 --- /dev/null +++ b/i386/include/IOKit/power/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/power +END +IOPwrController.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/power/IOPwrController.h +END diff --git a/i386/include/IOKit/power/.svn/entries b/i386/include/IOKit/power/.svn/entries new file mode 100644 index 0000000..35d1fff --- /dev/null +++ b/i386/include/IOKit/power/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/power +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOPwrController.h +file + + + + +2013-08-27T23:54:18.000000Z +9c95987a30b51b9e00dd6f7400e645fb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1513 + diff --git a/i386/include/IOKit/power/.svn/text-base/IOPwrController.h.svn-base b/i386/include/IOKit/power/.svn/text-base/IOPwrController.h.svn-base new file mode 100644 index 0000000..709a0fb --- /dev/null +++ b/i386/include/IOKit/power/.svn/text-base/IOPwrController.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * 24 Nov 1998 suurballe Created. + */ + +#include + +class IOPwrController: public IOService +{ +OSDeclareAbstractStructors(IOPwrController) + +public: + +}; + diff --git a/i386/include/IOKit/power/IOPwrController.h b/i386/include/IOKit/power/IOPwrController.h new file mode 100644 index 0000000..709a0fb --- /dev/null +++ b/i386/include/IOKit/power/IOPwrController.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * 24 Nov 1998 suurballe Created. + */ + +#include + +class IOPwrController: public IOService +{ +OSDeclareAbstractStructors(IOPwrController) + +public: + +}; + diff --git a/i386/include/IOKit/ppc/.svn/all-wcprops b/i386/include/IOKit/ppc/.svn/all-wcprops new file mode 100644 index 0000000..bddc1b1 --- /dev/null +++ b/i386/include/IOKit/ppc/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ppc +END +IODBDMA.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/ppc/IODBDMA.h +END diff --git a/i386/include/IOKit/ppc/.svn/entries b/i386/include/IOKit/ppc/.svn/entries new file mode 100644 index 0000000..b7014a2 --- /dev/null +++ b/i386/include/IOKit/ppc/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/ppc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IODBDMA.h +file + + + + +2013-08-27T23:54:20.000000Z +15a4a0c26bd1a9295d2de0f0544051f1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12529 + diff --git a/i386/include/IOKit/ppc/.svn/text-base/IODBDMA.h.svn-base b/i386/include/IOKit/ppc/.svn/text-base/IODBDMA.h.svn-base new file mode 100644 index 0000000..afe1337 --- /dev/null +++ b/i386/include/IOKit/ppc/.svn/text-base/IODBDMA.h.svn-base @@ -0,0 +1,367 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * + * HISTORY + * + * Simon Douglas 10 Nov 97 + * - first checked in, mostly from MacOS DBDMA.i, machdep/ppc/dbdma.h + * but use byte reverse ops. + */ + +#ifndef _IODBDMA_H_ +#define _IODBDMA_H_ + +#include +#include + + +/* DBDMA definitions */ + +struct IODBDMAChannelRegisters { + volatile unsigned long channelControl; + volatile unsigned long channelStatus; + volatile unsigned long commandPtrHi; /* implementation optional*/ + volatile unsigned long commandPtrLo; + volatile unsigned long interruptSelect; /* implementation optional*/ + volatile unsigned long branchSelect; /* implementation optional*/ + volatile unsigned long waitSelect; /* implementation optional*/ + volatile unsigned long transferModes; /* implementation optional*/ + volatile unsigned long data2PtrHi; /* implementation optional*/ + volatile unsigned long data2PtrLo; /* implementation optional*/ + + volatile unsigned long reserved1; + volatile unsigned long addressHi; /* implementation optional*/ + volatile unsigned long reserved2[4]; + volatile unsigned long unimplemented[16]; + +/* This structure must remain fully padded to 256 bytes.*/ + volatile unsigned long undefined[32]; +}; +typedef struct IODBDMAChannelRegisters IODBDMAChannelRegisters; + +/* These constants define the DB-DMA channel control words and status flags.*/ + +enum { + kdbdmaRun = 0x00008000, + kdbdmaPause = 0x00004000, + kdbdmaFlush = 0x00002000, + kdbdmaWake = 0x00001000, + kdbdmaDead = 0x00000800, + kdbdmaActive = 0x00000400, + kdbdmaBt = 0x00000100, + kdbdmaS7 = 0x00000080, + kdbdmaS6 = 0x00000040, + kdbdmaS5 = 0x00000020, + kdbdmaS4 = 0x00000010, + kdbdmaS3 = 0x00000008, + kdbdmaS2 = 0x00000004, + kdbdmaS1 = 0x00000002, + kdbdmaS0 = 0x00000001 +}; + + +#define IOSetDBDMAChannelControlBits(mask) ( ((mask) | (mask) << 16) ) +#define IOClearDBDMAChannelControlBits(mask) ( (mask) << 16) + + +/* This structure defines the DB-DMA channel command descriptor.*/ + +/* + *** WARNING: Endian-ness issues must be considered when performing load/store! *** +*/ + +struct IODBDMADescriptor { + unsigned long operation; /* cmd || key || i || b || w || reqCount*/ + unsigned long address; + volatile unsigned long cmdDep; + volatile unsigned long result; /* xferStatus || resCount*/ +}; +typedef struct IODBDMADescriptor IODBDMADescriptor; + +/* These constants define the DB-DMA channel command operations and modifiers.*/ + + +enum { +/* Command.cmd operations*/ + kdbdmaOutputMore = 0, + kdbdmaOutputLast = 1, + kdbdmaInputMore = 2, + kdbdmaInputLast = 3, + kdbdmaStoreQuad = 4, + kdbdmaLoadQuad = 5, + kdbdmaNop = 6, + kdbdmaStop = 7 +}; + + +enum { +/* Command.key modifiers (choose one for INPUT, OUTPUT, LOAD, and STORE)*/ + kdbdmaKeyStream0 = 0, /* default modifier*/ + kdbdmaKeyStream1 = 1, + kdbdmaKeyStream2 = 2, + kdbdmaKeyStream3 = 3, + kdbdmaKeyRegs = 5, + kdbdmaKeySystem = 6, + kdbdmaKeyDevice = 7, + + kdbdmaIntNever = 0, /* default modifier*/ + kdbdmaIntIfTrue = 1, + kdbdmaIntIfFalse = 2, + kdbdmaIntAlways = 3, + + kdbdmaBranchNever = 0, /* default modifier*/ + kdbdmaBranchIfTrue = 1, + kdbdmaBranchIfFalse = 2, + kdbdmaBranchAlways = 3, + + kdbdmaWaitNever = 0, /* default modifier*/ + kdbdmaWaitIfTrue = 1, + kdbdmaWaitIfFalse = 2, + kdbdmaWaitAlways = 3, + + kdbdmaCommandMask = (long)0xFFFF0000, + kdbdmaReqCountMask = 0x0000FFFF +}; + + +/* These constants define the DB-DMA channel command results.*/ + +enum { + /* result masks*/ + kdbdmaStatusRun = kdbdmaRun << 16, + kdbdmaStatusPause = kdbdmaPause << 16, + kdbdmaStatusFlush = kdbdmaFlush << 16, + kdbdmaStatusWake = kdbdmaWake << 16, + kdbdmaStatusDead = kdbdmaDead << 16, + kdbdmaStatusActive = kdbdmaActive << 16, + kdbdmaStatusBt = kdbdmaBt << 16, + kdbdmaStatusS7 = kdbdmaS7 << 16, + kdbdmaStatusS6 = kdbdmaS6 << 16, + kdbdmaStatusS5 = kdbdmaS5 << 16, + kdbdmaStatusS4 = kdbdmaS4 << 16, + kdbdmaStatusS3 = kdbdmaS3 << 16, + kdbdmaStatusS2 = kdbdmaS2 << 16, + kdbdmaStatusS1 = kdbdmaS1 << 16, + kdbdmaStatusS0 = kdbdmaS0 << 16, + kdbdmaResCountMask = 0x0000FFFF, + kdbdmaXferStatusMask = 0xFFFF0000 +}; + + +/* These macros are are IODBDMAChannelRegisters accessor functions. */ + +#define IOSetDBDMAChannelRegister(registerSetPtr,field,value) \ +OSWriteSwapInt32(registerSetPtr,offsetof(IODBDMAChannelRegisters,field),value) + +#define IOGetDBDMAChannelRegister(registerSetPtr, field) \ +OSReadSwapInt32(registerSetPtr,offsetof(IODBDMAChannelRegisters, field)) + + +/* void IOSetDBDMAChannelControl (IODBDMAChannelRegisters *registerSetPtr, unsigned long ctlValue); */ + +#define IOSetDBDMAChannelControl(registerSetPtr,ctlValue) \ +do { \ + eieio(); \ + IOSetDBDMAChannelRegister(registerSetPtr,channelControl,ctlValue); \ + eieio(); \ +} while(0) + +/* unsigned long IOGetDBDMAChannelStatus (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMAChannelStatus(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,channelStatus) + +/* unsigned long IOGetDBDMACommandPtr (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMACommandPtr(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,commandPtrLo) + +/* void IOSetDBDMACommandPtr (IODBDMAChannelRegisters *registerSetPtr, unsigned long cclPtr); */ + +#define IOSetDBDMACommandPtr(registerSetPtr,cclPtr) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,commandPtrHi,0); \ + eieio(); \ + IOSetDBDMAChannelRegister(registerSetPtr,commandPtrLo,cclPtr); \ + eieio(); \ +} while(0) + + +/* unsigned long IOGetDBDMAInterruptSelect (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMAInterruptSelect(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,interruptSelect) + +/* void IOSetDBDMAInterruptSelect (IODBDMAChannelRegisters *registerSetPtr, unsigned long intSelValue); */ + +#define IOSetDBDMAInterruptSelect(registerSetPtr,intSelValue) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,interruptSelect,intSelValue); \ + eieio(); \ +} while(0) + +/* unsigned long IOGetDBDMABranchSelect (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMABranchSelect(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,branchSelect) + +/* void IOSetDBDMABranchSelect (IODBDMAChannelRegisters *registerSetPtr, unsigned long braSelValue); */ + +#define IOSetDBDMABranchSelect(registerSetPtr,braSelValue) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,branchSelect,braSelValue); \ + eieio(); \ +} while(0) + +/* unsigned long IOGetDBDMAWaitSelect (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMAWaitSelect(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,waitSelect) + +/* void IOSetDBDMAWaitSelect (IODBDMAChannelRegisters *registerSetPtr, unsigned long waitSelValue); */ + +#define IOSetDBDMAWaitSelect(registerSetPtr,waitSelValue) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,waitSelect,waitSelValue); \ + eieio(); \ +} while(0) + + +/* These macros are IODBDMADescriptor accessor functions. */ + +#define IOSetDBDMADescriptor(descPtr,field,value) \ +OSWriteSwapInt32( descPtr, offsetof( IODBDMADescriptor, field), value) + +#define IOGetDBDMADescriptor(descPtr,field) \ +OSReadSwapInt32( descPtr, offsetof( IODBDMADescriptor, field)) + +#define IOMakeDBDMAOperation(cmd,key,interrupt,branch,wait,count) \ + ( ((cmd) << 28) | ((key) << 24) | ((interrupt) << 20) \ + | ((branch) << 18) | ( (wait) << 16) | (count) ) + +/* void IOMakeDBDMADescriptor (IODBDMADescriptor *descPtr, + unsigned long cmd, + unsigned long key, + unsigned long interrupt, + unsigned long branch, + unsigned long wait, + unsigned long count, + unsigned long addr); */ + +#define IOMakeDBDMADescriptor(descPtr,cmd,key,interrupt,branch,wait,count,addr)\ +do { \ + IOSetDBDMADescriptor(descPtr, address, addr); \ + IOSetDBDMADescriptor(descPtr, cmdDep, 0); \ + IOSetDBDMADescriptor(descPtr, result, 0); \ + eieio(); \ + IOSetDBDMADescriptor(descPtr, operation, \ + IOMakeDBDMAOperation(cmd,key,interrupt,branch,wait,count)); \ + eieio(); \ +} while(0) + +/* void IOMakeDBDMADescriptorDep (IODBDMADescriptor *descPtr, + unsigned long cmd, + unsigned long key, + unsigned long interrupt, + unsigned long branch, + unsigned long wait, + unsigned long count, + unsigned long addr, + unsigned long dep); */ + +#define IOMakeDBDMADescriptorDep(descPtr,cmd,key,interrupt,branch,wait,count,addr,dep) \ +do { \ + IOSetDBDMADescriptor(descPtr, address, addr); \ + IOSetDBDMADescriptor(descPtr, cmdDep, dep); \ + IOSetDBDMADescriptor(descPtr, result, 0); \ + eieio(); \ + IOSetDBDMADescriptor(descPtr, operation, \ + IOMakeDBDMAOperation(cmd, key, interrupt, branch, wait, count)); \ + eieio(); \ +} while(0) + +/* Field accessors - NOTE: unsynchronized */ + +/* unsigned long IOGetDBDMAOperation (IODBDMADescriptor *descPtr) */ + +#define IOGetCCOperation(descPtr) \ + IOGetDBDMADescriptor(descPtr,operation) + +/* void IOSetCCOperation (IODBDMADescriptor *descPtr, unsigned long operationValue) */ + +#define IOSetCCOperation(descPtr,operationValue) \ + IOSetDBDMADescriptor(descPtr,operation,operationValue) + +/* unsigned long IOGetCCAddress (IODBDMADescriptor *descPtr) */ + +#define IOGetCCAddress(descPtr) \ + IOGetDBDMADescriptor(descPtr,address) + +/* void IOSetCCAddress (IODBDMADescriptor *descPtr, unsigned long addressValue) */ + +#define IOSetCCAddress(descPtr,addressValue) \ + IOSetDBDMADescriptor(descPtr,address, addressValue) + +/* unsigned long IOGetCCCmdDep (IODBDMADescriptor *descPtr) */ + +#define IOGetCCCmdDep(descPtr) \ + IOGetDBDMADescriptor(descPtr,cmdDep) + +/* void IOSetCCCmdDep (IODBDMADescriptor *descPtr, unsigned long cmdDepValue) */ + +#define IOSetCCCmdDep(descPtr,cmdDepValue) \ + IOSetDBDMADescriptor(descPtr,cmdDep,cmdDepValue) + +/* unsigned long IOGetCCResult (IODBDMADescriptor *descPtr) */ + +#define IOGetCCResult(descPtr) \ + IOGetDBDMADescriptor(descPtr,result) + +/* void IOSetCCResult (IODBDMADescriptor *descPtr, unsigned long resultValue) */ + +#define IOSetCCResult(descPtr,resultValue) \ + IOSetDBDMADescriptor(descPtr,result,resultValue) + + +/* DBDMA routines */ + +extern void IODBDMAStart( volatile IODBDMAChannelRegisters *registerSetPtr, volatile IODBDMADescriptor *physicalDescPtr); +extern void IODBDMAStop( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAFlush( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAReset( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAContinue( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAPause( volatile IODBDMAChannelRegisters *registerSetPtr); + +extern IOReturn IOAllocatePhysicallyContiguousMemory( unsigned int size, unsigned int options, + IOVirtualAddress * logical, IOPhysicalAddress * physical ); +extern IOReturn IOFreePhysicallyContiguousMemory( IOVirtualAddress * logical, unsigned int size); + +#endif /* !defined(_IODBDMA_H_) */ diff --git a/i386/include/IOKit/ppc/IODBDMA.h b/i386/include/IOKit/ppc/IODBDMA.h new file mode 100644 index 0000000..afe1337 --- /dev/null +++ b/i386/include/IOKit/ppc/IODBDMA.h @@ -0,0 +1,367 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * + * HISTORY + * + * Simon Douglas 10 Nov 97 + * - first checked in, mostly from MacOS DBDMA.i, machdep/ppc/dbdma.h + * but use byte reverse ops. + */ + +#ifndef _IODBDMA_H_ +#define _IODBDMA_H_ + +#include +#include + + +/* DBDMA definitions */ + +struct IODBDMAChannelRegisters { + volatile unsigned long channelControl; + volatile unsigned long channelStatus; + volatile unsigned long commandPtrHi; /* implementation optional*/ + volatile unsigned long commandPtrLo; + volatile unsigned long interruptSelect; /* implementation optional*/ + volatile unsigned long branchSelect; /* implementation optional*/ + volatile unsigned long waitSelect; /* implementation optional*/ + volatile unsigned long transferModes; /* implementation optional*/ + volatile unsigned long data2PtrHi; /* implementation optional*/ + volatile unsigned long data2PtrLo; /* implementation optional*/ + + volatile unsigned long reserved1; + volatile unsigned long addressHi; /* implementation optional*/ + volatile unsigned long reserved2[4]; + volatile unsigned long unimplemented[16]; + +/* This structure must remain fully padded to 256 bytes.*/ + volatile unsigned long undefined[32]; +}; +typedef struct IODBDMAChannelRegisters IODBDMAChannelRegisters; + +/* These constants define the DB-DMA channel control words and status flags.*/ + +enum { + kdbdmaRun = 0x00008000, + kdbdmaPause = 0x00004000, + kdbdmaFlush = 0x00002000, + kdbdmaWake = 0x00001000, + kdbdmaDead = 0x00000800, + kdbdmaActive = 0x00000400, + kdbdmaBt = 0x00000100, + kdbdmaS7 = 0x00000080, + kdbdmaS6 = 0x00000040, + kdbdmaS5 = 0x00000020, + kdbdmaS4 = 0x00000010, + kdbdmaS3 = 0x00000008, + kdbdmaS2 = 0x00000004, + kdbdmaS1 = 0x00000002, + kdbdmaS0 = 0x00000001 +}; + + +#define IOSetDBDMAChannelControlBits(mask) ( ((mask) | (mask) << 16) ) +#define IOClearDBDMAChannelControlBits(mask) ( (mask) << 16) + + +/* This structure defines the DB-DMA channel command descriptor.*/ + +/* + *** WARNING: Endian-ness issues must be considered when performing load/store! *** +*/ + +struct IODBDMADescriptor { + unsigned long operation; /* cmd || key || i || b || w || reqCount*/ + unsigned long address; + volatile unsigned long cmdDep; + volatile unsigned long result; /* xferStatus || resCount*/ +}; +typedef struct IODBDMADescriptor IODBDMADescriptor; + +/* These constants define the DB-DMA channel command operations and modifiers.*/ + + +enum { +/* Command.cmd operations*/ + kdbdmaOutputMore = 0, + kdbdmaOutputLast = 1, + kdbdmaInputMore = 2, + kdbdmaInputLast = 3, + kdbdmaStoreQuad = 4, + kdbdmaLoadQuad = 5, + kdbdmaNop = 6, + kdbdmaStop = 7 +}; + + +enum { +/* Command.key modifiers (choose one for INPUT, OUTPUT, LOAD, and STORE)*/ + kdbdmaKeyStream0 = 0, /* default modifier*/ + kdbdmaKeyStream1 = 1, + kdbdmaKeyStream2 = 2, + kdbdmaKeyStream3 = 3, + kdbdmaKeyRegs = 5, + kdbdmaKeySystem = 6, + kdbdmaKeyDevice = 7, + + kdbdmaIntNever = 0, /* default modifier*/ + kdbdmaIntIfTrue = 1, + kdbdmaIntIfFalse = 2, + kdbdmaIntAlways = 3, + + kdbdmaBranchNever = 0, /* default modifier*/ + kdbdmaBranchIfTrue = 1, + kdbdmaBranchIfFalse = 2, + kdbdmaBranchAlways = 3, + + kdbdmaWaitNever = 0, /* default modifier*/ + kdbdmaWaitIfTrue = 1, + kdbdmaWaitIfFalse = 2, + kdbdmaWaitAlways = 3, + + kdbdmaCommandMask = (long)0xFFFF0000, + kdbdmaReqCountMask = 0x0000FFFF +}; + + +/* These constants define the DB-DMA channel command results.*/ + +enum { + /* result masks*/ + kdbdmaStatusRun = kdbdmaRun << 16, + kdbdmaStatusPause = kdbdmaPause << 16, + kdbdmaStatusFlush = kdbdmaFlush << 16, + kdbdmaStatusWake = kdbdmaWake << 16, + kdbdmaStatusDead = kdbdmaDead << 16, + kdbdmaStatusActive = kdbdmaActive << 16, + kdbdmaStatusBt = kdbdmaBt << 16, + kdbdmaStatusS7 = kdbdmaS7 << 16, + kdbdmaStatusS6 = kdbdmaS6 << 16, + kdbdmaStatusS5 = kdbdmaS5 << 16, + kdbdmaStatusS4 = kdbdmaS4 << 16, + kdbdmaStatusS3 = kdbdmaS3 << 16, + kdbdmaStatusS2 = kdbdmaS2 << 16, + kdbdmaStatusS1 = kdbdmaS1 << 16, + kdbdmaStatusS0 = kdbdmaS0 << 16, + kdbdmaResCountMask = 0x0000FFFF, + kdbdmaXferStatusMask = 0xFFFF0000 +}; + + +/* These macros are are IODBDMAChannelRegisters accessor functions. */ + +#define IOSetDBDMAChannelRegister(registerSetPtr,field,value) \ +OSWriteSwapInt32(registerSetPtr,offsetof(IODBDMAChannelRegisters,field),value) + +#define IOGetDBDMAChannelRegister(registerSetPtr, field) \ +OSReadSwapInt32(registerSetPtr,offsetof(IODBDMAChannelRegisters, field)) + + +/* void IOSetDBDMAChannelControl (IODBDMAChannelRegisters *registerSetPtr, unsigned long ctlValue); */ + +#define IOSetDBDMAChannelControl(registerSetPtr,ctlValue) \ +do { \ + eieio(); \ + IOSetDBDMAChannelRegister(registerSetPtr,channelControl,ctlValue); \ + eieio(); \ +} while(0) + +/* unsigned long IOGetDBDMAChannelStatus (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMAChannelStatus(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,channelStatus) + +/* unsigned long IOGetDBDMACommandPtr (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMACommandPtr(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,commandPtrLo) + +/* void IOSetDBDMACommandPtr (IODBDMAChannelRegisters *registerSetPtr, unsigned long cclPtr); */ + +#define IOSetDBDMACommandPtr(registerSetPtr,cclPtr) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,commandPtrHi,0); \ + eieio(); \ + IOSetDBDMAChannelRegister(registerSetPtr,commandPtrLo,cclPtr); \ + eieio(); \ +} while(0) + + +/* unsigned long IOGetDBDMAInterruptSelect (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMAInterruptSelect(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,interruptSelect) + +/* void IOSetDBDMAInterruptSelect (IODBDMAChannelRegisters *registerSetPtr, unsigned long intSelValue); */ + +#define IOSetDBDMAInterruptSelect(registerSetPtr,intSelValue) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,interruptSelect,intSelValue); \ + eieio(); \ +} while(0) + +/* unsigned long IOGetDBDMABranchSelect (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMABranchSelect(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,branchSelect) + +/* void IOSetDBDMABranchSelect (IODBDMAChannelRegisters *registerSetPtr, unsigned long braSelValue); */ + +#define IOSetDBDMABranchSelect(registerSetPtr,braSelValue) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,branchSelect,braSelValue); \ + eieio(); \ +} while(0) + +/* unsigned long IOGetDBDMAWaitSelect (IODBDMAChannelRegisters *registerSetPtr); */ + +#define IOGetDBDMAWaitSelect(registerSetPtr) \ + IOGetDBDMAChannelRegister(registerSetPtr,waitSelect) + +/* void IOSetDBDMAWaitSelect (IODBDMAChannelRegisters *registerSetPtr, unsigned long waitSelValue); */ + +#define IOSetDBDMAWaitSelect(registerSetPtr,waitSelValue) \ +do { \ + IOSetDBDMAChannelRegister(registerSetPtr,waitSelect,waitSelValue); \ + eieio(); \ +} while(0) + + +/* These macros are IODBDMADescriptor accessor functions. */ + +#define IOSetDBDMADescriptor(descPtr,field,value) \ +OSWriteSwapInt32( descPtr, offsetof( IODBDMADescriptor, field), value) + +#define IOGetDBDMADescriptor(descPtr,field) \ +OSReadSwapInt32( descPtr, offsetof( IODBDMADescriptor, field)) + +#define IOMakeDBDMAOperation(cmd,key,interrupt,branch,wait,count) \ + ( ((cmd) << 28) | ((key) << 24) | ((interrupt) << 20) \ + | ((branch) << 18) | ( (wait) << 16) | (count) ) + +/* void IOMakeDBDMADescriptor (IODBDMADescriptor *descPtr, + unsigned long cmd, + unsigned long key, + unsigned long interrupt, + unsigned long branch, + unsigned long wait, + unsigned long count, + unsigned long addr); */ + +#define IOMakeDBDMADescriptor(descPtr,cmd,key,interrupt,branch,wait,count,addr)\ +do { \ + IOSetDBDMADescriptor(descPtr, address, addr); \ + IOSetDBDMADescriptor(descPtr, cmdDep, 0); \ + IOSetDBDMADescriptor(descPtr, result, 0); \ + eieio(); \ + IOSetDBDMADescriptor(descPtr, operation, \ + IOMakeDBDMAOperation(cmd,key,interrupt,branch,wait,count)); \ + eieio(); \ +} while(0) + +/* void IOMakeDBDMADescriptorDep (IODBDMADescriptor *descPtr, + unsigned long cmd, + unsigned long key, + unsigned long interrupt, + unsigned long branch, + unsigned long wait, + unsigned long count, + unsigned long addr, + unsigned long dep); */ + +#define IOMakeDBDMADescriptorDep(descPtr,cmd,key,interrupt,branch,wait,count,addr,dep) \ +do { \ + IOSetDBDMADescriptor(descPtr, address, addr); \ + IOSetDBDMADescriptor(descPtr, cmdDep, dep); \ + IOSetDBDMADescriptor(descPtr, result, 0); \ + eieio(); \ + IOSetDBDMADescriptor(descPtr, operation, \ + IOMakeDBDMAOperation(cmd, key, interrupt, branch, wait, count)); \ + eieio(); \ +} while(0) + +/* Field accessors - NOTE: unsynchronized */ + +/* unsigned long IOGetDBDMAOperation (IODBDMADescriptor *descPtr) */ + +#define IOGetCCOperation(descPtr) \ + IOGetDBDMADescriptor(descPtr,operation) + +/* void IOSetCCOperation (IODBDMADescriptor *descPtr, unsigned long operationValue) */ + +#define IOSetCCOperation(descPtr,operationValue) \ + IOSetDBDMADescriptor(descPtr,operation,operationValue) + +/* unsigned long IOGetCCAddress (IODBDMADescriptor *descPtr) */ + +#define IOGetCCAddress(descPtr) \ + IOGetDBDMADescriptor(descPtr,address) + +/* void IOSetCCAddress (IODBDMADescriptor *descPtr, unsigned long addressValue) */ + +#define IOSetCCAddress(descPtr,addressValue) \ + IOSetDBDMADescriptor(descPtr,address, addressValue) + +/* unsigned long IOGetCCCmdDep (IODBDMADescriptor *descPtr) */ + +#define IOGetCCCmdDep(descPtr) \ + IOGetDBDMADescriptor(descPtr,cmdDep) + +/* void IOSetCCCmdDep (IODBDMADescriptor *descPtr, unsigned long cmdDepValue) */ + +#define IOSetCCCmdDep(descPtr,cmdDepValue) \ + IOSetDBDMADescriptor(descPtr,cmdDep,cmdDepValue) + +/* unsigned long IOGetCCResult (IODBDMADescriptor *descPtr) */ + +#define IOGetCCResult(descPtr) \ + IOGetDBDMADescriptor(descPtr,result) + +/* void IOSetCCResult (IODBDMADescriptor *descPtr, unsigned long resultValue) */ + +#define IOSetCCResult(descPtr,resultValue) \ + IOSetDBDMADescriptor(descPtr,result,resultValue) + + +/* DBDMA routines */ + +extern void IODBDMAStart( volatile IODBDMAChannelRegisters *registerSetPtr, volatile IODBDMADescriptor *physicalDescPtr); +extern void IODBDMAStop( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAFlush( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAReset( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAContinue( volatile IODBDMAChannelRegisters *registerSetPtr); +extern void IODBDMAPause( volatile IODBDMAChannelRegisters *registerSetPtr); + +extern IOReturn IOAllocatePhysicallyContiguousMemory( unsigned int size, unsigned int options, + IOVirtualAddress * logical, IOPhysicalAddress * physical ); +extern IOReturn IOFreePhysicallyContiguousMemory( IOVirtualAddress * logical, unsigned int size); + +#endif /* !defined(_IODBDMA_H_) */ diff --git a/i386/include/IOKit/pwr_mgt/.svn/all-wcprops b/i386/include/IOKit/pwr_mgt/.svn/all-wcprops new file mode 100644 index 0000000..0d00094 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/all-wcprops @@ -0,0 +1,59 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt +END +RootDomain.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/RootDomain.h +END +IOPMLibDefs.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPMLibDefs.h +END +IOPMPowerSourceList.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPMPowerSourceList.h +END +IOPMPrivate.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPMPrivate.h +END +IOPMPowerSource.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPMPowerSource.h +END +IOPMpowerState.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPMpowerState.h +END +IOPM.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPM.h +END +IOPowerConnection.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPowerConnection.h +END +IOPMDeprecated.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/pwr_mgt/IOPMDeprecated.h +END diff --git a/i386/include/IOKit/pwr_mgt/.svn/entries b/i386/include/IOKit/pwr_mgt/.svn/entries new file mode 100644 index 0000000..4a57a5c --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/entries @@ -0,0 +1,334 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/pwr_mgt +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +RootDomain.h +file + + + + +2013-08-27T23:54:16.000000Z +bdf4cb75458bc85f1bbb7f9d25e0b25b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10815 + +IOPMLibDefs.h +file + + + + +2013-08-27T23:54:16.000000Z +2f6d1ceef422ff8f504e009c9554720b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1762 + +IOPMPowerSourceList.h +file + + + + +2013-08-27T23:54:16.000000Z +ba4d08c61820252a5ed6241fd8b3c13a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2024 + +IOPMPrivate.h +file + + + + +2013-08-27T23:54:16.000000Z +875e737556ada49d86b951e79209bc3a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11099 + +IOPMPowerSource.h +file + + + + +2013-08-27T23:54:16.000000Z +8ec726b34101aecbd930216a9d944510 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9439 + +IOPMpowerState.h +file + + + + +2013-08-27T23:54:16.000000Z +eb4e9833e8dc27f552ed3fa7704a0b8d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3760 + +IOPM.h +file + + + + +2013-08-27T23:54:16.000000Z +6e0b70a4a16a7c280dcfbe0c99e1c06c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +27180 + +IOPowerConnection.h +file + + + + +2013-08-27T23:54:16.000000Z +05e49f8d6c51a982ce29d3e16cb0c161 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6011 + +IOPMDeprecated.h +file + + + + +2013-08-27T23:54:16.000000Z +ebebd77a291987f315e9719e9f1f53e9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9112 + diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPM.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPM.h.svn-base new file mode 100644 index 0000000..7d78225 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPM.h.svn-base @@ -0,0 +1,654 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOPM_H +#define _IOKIT_IOPM_H + +#include +#include +#include + +#ifdef __ppc__ +#include +#endif + +/*! @header IOPM.h + @abstract Defines power management constants and keys used by both in-kernel and user space power management. + @discussion IOPM.h defines a range of power management constants used in several in-kernel and user space APIs. Most significantly, the IOPMPowerFlags used to specify the fields of an IOPMPowerState struct are defined here. + + Most of the constants defined in IOPM.h are deprecated or for Apple internal use only, and are not elaborated on in headerdoc. +*/ + +enum { + kIOPMMaxPowerStates = 10, + IOPMMaxPowerStates = kIOPMMaxPowerStates +}; + +/*! @enum IOPMPowerFlags + @abstract Bits are used in defining capabilityFlags, inputPowerRequirements, and outputPowerCharacter in the IOPMPowerState structure. + @discussion These bits may be bitwise-OR'd together in the IOPMPowerState capabilityFlags field, the outputPowerCharacter field, and/or the inputPowerRequirement field. + + The comments clearly mark whether each flag should be used in the capabilityFlags field, outputPowerCharacter field, and inputPowerRequirement field, or all three. + + The value of capabilityFlags, inputPowerRequirement or outputPowerCharacter may be 0. Most drivers implement their 'OFF' state, used when asleep, by defininf each of the 3 fields as 0. + + The bits listed below are only the most common bits used to define a device's power states. Your device's IO family may require that your device specify other input or output power flags to interact properly. Consult family-specific documentation to determine if your IOPower plane parents or children require other power flags; they probably don't. + + @constant kIOPMPowerOn Indicates the device is on, requires power, and provides power. Useful as a: Capability, InputPowerRequirement, OutputPowerCharacter + + @constant kIOPMDeviceUsable Indicates the device is usable in this state. Useful only as a Capability + + @constant kIOPMLowPower + Indicates device is in a low power state. May be bitwis-OR'd together + with kIOPMDeviceUsable flag, to indicate the device is still usable. + + A device with a capability of kIOPMLowPower may: + Require either 0 or kIOPMPowerOn from its power parent + Offer either kIOPMLowPower, kIOPMPowerOn, or 0 (no power at all) + to its power plane children. + + Useful only as a Capability, although USB drivers should consult USB family documentation for other valid circumstances to use the kIOPMLowPower bit. + + @constant kIOPMPreventIdleSleep + In the capability field of a power state, disallows idle system sleep while the device is in that state. + + For example, displays and disks set this capability for their ON power state; since the system may not idle sleep while the display (and thus keyboard or mouse) or the disk is active. + + Useful only as a Capability. + + @constant kIOPMSleepCapability + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + + @constant kIOPMRestartCapability + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + + @constant kIOPMSleep + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + + @constant kIOPMRestart + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. +*/ +typedef unsigned long IOPMPowerFlags; +enum { + kIOPMPowerOn = 0x00000002, + kIOPMDeviceUsable = 0x00008000, + kIOPMLowPower = 0x00010000, + kIOPMPreventIdleSleep = 0x00000040, + kIOPMSleepCapability = 0x00000004, + kIOPMRestartCapability = 0x00000080, + kIOPMSleep = 0x00000001, + kIOPMRestart = 0x00000080 +}; + +/* + * Private IOPMPowerFlags + * + * For Apple use only + * Not for use with non-Apple drivers + * Their behavior is undefined + */ +enum { + kIOPMClockNormal = 0x0004, + kIOPMClockRunning = 0x0008, + kIOPMPreventSystemSleep = 0x0010, + kIOPMDoze = 0x0400, + kIOPMChildClamp = 0x0080, + kIOPMChildClamp2 = 0x0200, + kIOPMNotPowerManaged = 0x0800 +}; + + +/* + * Deprecated IOPMPowerFlags + * Their behavior is undefined when used in IOPMPowerState + * Capability, InputPowerRequirement, or OutputPowerCharacter fields. + */ +enum { + kIOPMMaxPerformance = 0x4000, + kIOPMPassThrough = 0x0100, + kIOPMAuxPowerOn = 0x0020, + kIOPMNotAttainable = 0x0001, + kIOPMContextRetained = 0x2000, + kIOPMConfigRetained = 0x1000, + kIOPMStaticPowerValid = 0x0800, + kIOPMSoftSleep = 0x0400, + kIOPMCapabilitiesMask = kIOPMPowerOn | kIOPMDeviceUsable | + kIOPMMaxPerformance | kIOPMContextRetained | + kIOPMConfigRetained | kIOPMSleepCapability | + kIOPMRestartCapability +}; + +/* + * Support for old names of IOPMPowerFlag constants + */ +enum { + IOPMNotAttainable = kIOPMNotAttainable, + IOPMPowerOn = kIOPMPowerOn, + IOPMClockNormal = kIOPMClockNormal, + IOPMClockRunning = kIOPMClockRunning, + IOPMAuxPowerOn = kIOPMAuxPowerOn, + IOPMDeviceUsable = kIOPMDeviceUsable, + IOPMMaxPerformance = kIOPMMaxPerformance, + IOPMContextRetained = kIOPMContextRetained, + IOPMConfigRetained = kIOPMConfigRetained, + IOPMNotPowerManaged = kIOPMNotPowerManaged, + IOPMSoftSleep = kIOPMSoftSleep +}; + + +enum { + kIOPMNextHigherState = 1, + kIOPMHighestState = 2, + kIOPMNextLowerState = 3, + kIOPMLowestState = 4 +}; + +enum { + IOPMNextHigherState = kIOPMNextHigherState, + IOPMHighestState = kIOPMHighestState, + IOPMNextLowerState = kIOPMNextLowerState, + IOPMLowestState = kIOPMLowestState +}; + +// Internal commands used by power managment command queue +enum { + kIOPMBroadcastAggressiveness = 1, + kIOPMUnidleDevice +}; + +// Power consumption unknown value +enum { + kIOPMUnknown = 0xFFFF +}; + +/******************************************************************************* + * + * Root Domain property keys of interest + * + ******************************************************************************/ + +/* AppleClamshellState + * reflects the state of the clamshell (lid) on a portable. + * It has a boolean value. + * true == clamshell is closed + * false == clamshell is open + * not present == no clamshell on this hardware + */ +#define kAppleClamshellStateKey "AppleClamshellState" + +/* AppleClamshellCausesSleep + * reflects the clamshell close behavior on a portable. + * It has a boolean value. + * true == system will sleep when clamshell is closed + * false == system will not sleep on clamshell close + * (typically external display mode) + * not present == no clamshell on this hardware + */ +#define kAppleClamshellCausesSleepKey "AppleClamshellCausesSleep" + +/* kIOPMSleepWakeUUIDKey + * Key refers to a CFStringRef that will uniquely identify + * a sleep/wake cycle for logging & tracking. + * The key becomes valid at the beginning of a sleep cycle - before we + * initiate any sleep/wake notifications. + * The key becomes invalid at the completion of a system wakeup. The + * property will not be present in the IOPMrootDomain's registry entry + * when it is invalid. + * + * See IOPMrootDomain notification kIOPMMessageSleepWakeUUIDChange + */ + #define kIOPMSleepWakeUUIDKey "SleepWakeUUID" + +/******************************************************************************* + * + * Root Domain general interest messages + * + * Available by registering for interest type 'gIOGeneralInterest' + * on IOPMrootDomain. + * + ******************************************************************************/ + +/* kIOPMMessageClamshellStateChange + * Delivered as a general interest notification on the IOPMrootDomain + * IOPMrootDomain sends this message when state of either AppleClamshellState + * or AppleClamshellCausesSleep changes. If this clamshell change results in + * a sleep, the sleep will initiate soon AFTER delivery of this message. + * The state of both variables is encoded in a bitfield argument sent with + * the message. Check bits 0 and 1 using kClamshellStateBit & kClamshellSleepBit + */ +enum { + kClamshellStateBit = (1 << 0), + kClamshellSleepBit = (1 << 1) +}; + +#define kIOPMMessageClamshellStateChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x100) + +/* kIOPMMessageFeatureChange + * Delivered when the set of supported features ("Supported Features" dictionary + * under IOPMrootDomain registry) changes in some way. Typically addition or + * removal of a supported feature. + * RootDomain passes no argument with this message. + */ +#define kIOPMMessageFeatureChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x110) + +/* kIOPMMessageInflowDisableCancelled + * The battery has drained completely to its "Fully Discharged" state. + * If a user process has disabled battery inflow for battery + * calibration, we forcibly re-enable Inflow at this point. + * If inflow HAS been forcibly re-enabled, bit 0 + * (kInflowForciblyEnabledBit) will be set. + */ +enum { + kInflowForciblyEnabledBit = (1 << 0) +}; + +/* kIOPMMessageInternalBatteryFullyDischarged + * The battery has drained completely to its "Fully Discharged" state. + */ +#define kIOPMMessageInternalBatteryFullyDischarged \ + iokit_family_msg(sub_iokit_powermanagement, 0x120) + +/* kIOPMMessageSystemPowerEventOccurred + * Some major system thermal property has changed, and interested clients may + * modify their behavior. + */ +#define kIOPMMessageSystemPowerEventOccurred \ + iokit_family_msg(sub_iokit_powermanagement, 0x130) + +/* kIOPMMessageSleepWakeUUIDChange + * Either a new SleepWakeUUID has been specified at the beginning of a sleep, + * or we're removing the existing property upon completion of a wakeup. + */ +#define kIOPMMessageSleepWakeUUIDChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x140) + +/* kIOPMMessageSleepWakeUUIDSet + * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when + * a new UUID has been specified. + */ +#define kIOPMMessageSleepWakeUUIDSet ((void *)1) + +/* kIOPMMessageSleepWakeUUIDCleared + * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when + * the current UUID has been removed. + */ +#define kIOPMMessageSleepWakeUUIDCleared ((void *)0) + +/******************************************************************************* + * + * Power commands issued to root domain + * Use with IOPMrootDomain::receivePowerNotification() + * + * These commands are issued from system drivers only: + * ApplePMU, AppleSMU, IOGraphics, AppleACPIFamily + * + ******************************************************************************/ +enum { + kIOPMSleepNow = (1<<0), // put machine to sleep now + kIOPMAllowSleep = (1<<1), // allow idle sleep + kIOPMPreventSleep = (1<<2), // do not allow idle sleep + kIOPMPowerButton = (1<<3), // power button was pressed + kIOPMClamshellClosed = (1<<4), // clamshell was closed + kIOPMPowerEmergency = (1<<5), // battery dangerously low + kIOPMDisableClamshell = (1<<6), // do not sleep on clamshell closure + kIOPMEnableClamshell = (1<<7), // sleep on clamshell closure + kIOPMProcessorSpeedChange = (1<<8), // change the processor speed + kIOPMOverTemp = (1<<9), // system dangerously hot + kIOPMClamshellOpened = (1<<10) // clamshell was opened +}; + + +/******************************************************************************* + * + * Power Management Return Codes + * + ******************************************************************************/ +enum { + kIOPMNoErr = 0, + + // Returned by driver's setPowerState(), powerStateWillChangeTo(), + // powerStateDidChangeTo(), or acknowledgeSetPowerState() to + // implicitly acknowledge power change upon function return. + kIOPMAckImplied = 0, + + // Deprecated + kIOPMWillAckLater = 1, + + // Returned by requestPowerDomainState() to indicate + // unrecognized specification parameter. + kIOPMBadSpecification = 4, + + // Returned by requestPowerDomainState() to indicate + // no power state matches search specification. + kIOPMNoSuchState = 5, + + // Deprecated + kIOPMCannotRaisePower = 6, + + // Deprecated + kIOPMParameterError = 7, + + // Returned when power management state is accessed + // before driver has called PMinit(). + kIOPMNotYetInitialized = 8, + + // And the old constants; deprecated + IOPMNoErr = kIOPMNoErr, + IOPMAckImplied = kIOPMAckImplied, + IOPMWillAckLater = kIOPMWillAckLater, + IOPMBadSpecification = kIOPMBadSpecification, + IOPMNoSuchState = kIOPMNoSuchState, + IOPMCannotRaisePower = kIOPMCannotRaisePower, + IOPMParameterError = kIOPMParameterError, + IOPMNotYetInitialized = kIOPMNotYetInitialized +}; + + +// IOPMPowerSource class descriptive strings +// Power Source state is published as properties to the IORegistry under these +// keys. +#define kIOPMPSExternalConnectedKey "ExternalConnected" +#define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable" +#define kIOPMPSBatteryInstalledKey "BatteryInstalled" +#define kIOPMPSIsChargingKey "IsCharging" +#define kIOPMFullyChargedKey "FullyCharged" +#define kIOPMPSAtWarnLevelKey "AtWarnLevel" +#define kIOPMPSAtCriticalLevelKey "AtCriticalLevel" +#define kIOPMPSCurrentCapacityKey "CurrentCapacity" +#define kIOPMPSMaxCapacityKey "MaxCapacity" +#define kIOPMPSDesignCapacityKey "DesignCapacity" +#define kIOPMPSTimeRemainingKey "TimeRemaining" +#define kIOPMPSAmperageKey "Amperage" +#define kIOPMPSVoltageKey "Voltage" +#define kIOPMPSCycleCountKey "CycleCount" +#define kIOPMPSMaxErrKey "MaxErr" +#define kIOPMPSAdapterInfoKey "AdapterInfo" +#define kIOPMPSLocationKey "Location" +#define kIOPMPSErrorConditionKey "ErrorCondition" +#define kIOPMPSManufacturerKey "Manufacturer" +#define kIOPMPSManufactureDateKey "ManufactureDate" +#define kIOPMPSModelKey "Model" +#define kIOPMPSSerialKey "Serial" +#define kIOPMDeviceNameKey "DeviceName" +#define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo" +#define kIOPMPSBatteryHealthKey "BatteryHealth" +#define kIOPMPSHealthConfidenceKey "HealthConfidence" +#define kIOPMPSCapacityEstimatedKey "CapacityEstimated" +#define kIOPMPSBatteryChargeStatusKey "ChargeStatus" +#define kIOPMPSBatteryTemperatureKey "Temperature" + +// kIOPMPSBatteryChargeStatusKey may have one of the following values, or may have +// no value. If kIOPMBatteryChargeStatusKey has a NULL value (or no value) associated with it +// then charge is proceeding normally. If one of these battery charge status reasons is listed, +// then the charge may have been interrupted. +#define kIOPMBatteryChargeStatusTooHot "HighTemperature" +#define kIOPMBatteryChargeStatusTooCold "LowTemperature" +#define kIOPMBatteryChargeStatusGradient "BatteryTemperatureGradient" + +// Definitions for battery location, in case of multiple batteries. +// A location of 0 is unspecified +// Location is undefined for single battery systems +enum { + kIOPMPSLocationLeft = 1001, + kIOPMPSLocationRight = 1002 +}; + +// Battery quality health types, specified by BatteryHealth and HealthConfidence +// properties in an IOPMPowerSource battery kext. +enum { + kIOPMUndefinedValue = 0, + kIOPMPoorValue = 1, + kIOPMFairValue = 2, + kIOPMGoodValue = 3 +}; + +// Battery's time remaining estimate is invalid this long (seconds) after a wake +#define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds" + +// Battery must wait this long (seconds) after being completely charged before +// the battery is settled. +#define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds" + +// Battery must wait this long (seconds) after being completely discharged +// before the battery is settled. +#define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds" + + +/* CPU Power Management status keys + * Pass as arguments to IOPMrootDomain::systemPowerEventOccurred + * Or as arguments to IOPMSystemPowerEventOccurred() + * Or to decode the dictionary obtained from IOPMCopyCPUPowerStatus() + * These keys reflect restrictions placed on the CPU by the system + * to bring the CPU's power consumption within allowable thermal and + * power constraints. + */ + + +/* kIOPMGraphicsPowerLimitsKey + * The key representing the dictionary of graphics power limits. + * The dictionary contains the other kIOPMCPUPower keys & their associated + * values (e.g. Speed limit, Processor Count, and Schedule limits). + */ +#define kIOPMGraphicsPowerLimitsKey "Graphics_Power_Limits" + +/* kIOPMGraphicsPowerLimitPerformanceKey + * The key representing the percent of overall performance made available + * by the graphics chip as a percentage (integer 0 - 100). + */ +#define kIOPMGraphicsPowerLimitPerformanceKey "Graphics_Power_Performance" + + + +/* kIOPMCPUPowerLimitsKey + * The key representing the dictionary of CPU Power Limits. + * The dictionary contains the other kIOPMCPUPower keys & their associated + * values (e.g. Speed limit, Processor Count, and Schedule limits). + */ +#define kIOPMCPUPowerLimitsKey "CPU_Power_Limits" + +/* kIOPMCPUPowerLimitProcessorSpeedKey defines the speed & voltage limits placed + * on the CPU. + * Represented as a percentage (0-100) of maximum CPU speed. + */ +#define kIOPMCPUPowerLimitProcessorSpeedKey "CPU_Speed_Limit" + +/* kIOPMCPUPowerLimitProcessorCountKey reflects how many, if any, CPUs have been + * taken offline. Represented as an integer number of CPUs (0 - Max CPUs). + */ +#define kIOPMCPUPowerLimitProcessorCountKey "CPU_Available_CPUs" + +/* kIOPMCPUPowerLimitSchedulerTimeKey represents the percentage (0-100) of CPU time + * available. 100% at normal operation. The OS may limit this time for a percentage + * less than 100%. + */ +#define kIOPMCPUPowerLimitSchedulerTimeKey "CPU_Scheduler_Limit" + + +/* Thermal Level Warning Key + * Indicates the thermal constraints placed on the system. This value may + * cause clients to action to consume fewer system resources. + * The value associated with this warning is defined by the platform. + */ +#define kIOPMThermalLevelWarningKey "Thermal_Level_Warning" + +/* Thermal Warning Level values + * kIOPMThermalWarningLevelNormal - under normal operating conditions + * kIOPMThermalWarningLevelDanger - thermal pressure may cause system slowdown + * kIOPMThermalWarningLevelCrisis - thermal conditions may cause imminent shutdown + * + * The platform may define additional thermal levels if necessary. + */ +enum { + kIOPMThermalWarningLevelNormal = 0, + kIOPMThermalWarningLevelDanger = 5, + kIOPMThermalWarningLevelCrisis = 10 +}; + + +// PM Settings Controller setting types +// Settings types used primarily with: +// IOPMrootDomain::registerPMSettingController +// The values are identical to the similarly named keys for use in user space +// PM settings work. Those keys are defined in IOPMLibPrivate.h. +#define kIOPMSettingWakeOnRingKey "Wake On Modem Ring" +#define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss" +#define kIOPMSettingWakeOnACChangeKey "Wake On AC Change" +#define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button" +#define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open" +#define kIOPMSettingReduceBrightnessKey "ReduceBrightness" +#define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim" +#define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds" +#define kIOPMSettingMobileMotionModuleKey "MobileMotionModule" +#define kIOPMSettingGraphicsSwitchKey "GPUSwitch" + +// Setting controlling drivers can register to receive scheduled wake data +// Either in "CF seconds" type, or structured calendar data in a formatted +// IOPMCalendarStruct defined below. +#define kIOPMSettingAutoWakeSecondsKey "wake" +#define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate" +#define kIOPMSettingAutoPowerSecondsKey "poweron" +#define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate" + +// Debug seconds auto wake +// Used by sleep cycling debug tools +#define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep" +#define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown" + +// Maintenance wake calendar. +#define kIOPMSettingMaintenanceWakeCalendarKey "MaintenanceWakeCalendarDate" + +struct IOPMCalendarStruct { + UInt32 year; + UInt8 month; + UInt8 day; + UInt8 hour; + UInt8 minute; + UInt8 second; +}; +typedef struct IOPMCalendarStruct IOPMCalendarStruct; + +// SetAggressiveness types +enum { + kPMGeneralAggressiveness = 0, + kPMMinutesToDim, + kPMMinutesToSpinDown, + kPMMinutesToSleep, + kPMEthernetWakeOnLANSettings, + kPMSetProcessorSpeed, + kPMPowerSource, + kPMMotionSensor, + kPMLastAggressivenessType +}; +#define kMaxType (kPMLastAggressivenessType-1) + +// SetAggressiveness values for the kPMPowerSource aggressiveness type +enum { + kIOPMInternalPower = 1, + kIOPMExternalPower +}; + +#define kIOREMSleepEnabledKey "REMSleepEnabled" + +// Strings for deciphering the dictionary returned from IOPMCopyBatteryInfo +#define kIOBatteryInfoKey "IOBatteryInfo" +#define kIOBatteryCurrentChargeKey "Current" +#define kIOBatteryCapacityKey "Capacity" +#define kIOBatteryFlagsKey "Flags" +#define kIOBatteryVoltageKey "Voltage" +#define kIOBatteryAmperageKey "Amperage" +#define kIOBatteryCycleCountKey "Cycle Count" + +enum { + kIOBatteryInstalled = (1 << 2), + kIOBatteryCharge = (1 << 1), + kIOBatteryChargerConnect = (1 << 0) +}; + + +// Private power management message indicating battery data has changed +// Indicates new data resides in the IORegistry +#define kIOPMMessageBatteryStatusHasChanged iokit_family_msg(sub_iokit_pmu, 0x100) + +// Apple private Legacy messages for re-routing AutoWake and AutoPower messages to the PMU +// through newer user space IOPMSchedulePowerEvent API +#define kIOPMUMessageLegacyAutoWake iokit_family_msg(sub_iokit_pmu, 0x200) +#define kIOPMUMessageLegacyAutoPower iokit_family_msg(sub_iokit_pmu, 0x210) + +// For use with IOPMPowerSource bFlags +#define IOPM_POWER_SOURCE_REV 2 +enum { + kIOPMACInstalled = kIOBatteryChargerConnect, + kIOPMBatteryCharging = kIOBatteryCharge, + kIOPMBatteryInstalled = kIOBatteryInstalled, + kIOPMUPSInstalled = (1<<3), + kIOPMBatteryAtWarn = (1<<4), + kIOPMBatteryDepleted = (1<<5), + kIOPMACnoChargeCapability = (1<<6), // AC adapter cannot charge battery + kIOPMRawLowBattery = (1<<7), // used only by Platform Expert + kIOPMForceLowSpeed = (1<<8), // set by Platfm Expert, chk'd by Pwr Plugin + kIOPMClosedClamshell = (1<<9), // set by PMU - reflects state of the clamshell + kIOPMClamshellStateOnWake = (1<<10) // used only by Platform Expert +}; + + +// ********************************************** +// Internal power management data structures +// ********************************************** + +#if KERNEL && __cplusplus +class IOService; + +enum { + kIOPowerEmergencyLevel = 1000 +}; + +enum { + kIOPMSubclassPolicy, + kIOPMSuperclassPolicy1 +}; + +struct stateChangeNote{ + IOPMPowerFlags stateFlags; + unsigned long stateNum; + void * powerRef; +}; +typedef struct stateChangeNote stateChangeNote; + +struct IOPowerStateChangeNotification { + void * powerRef; + unsigned long returnValue; + unsigned long stateNumber; + IOPMPowerFlags stateFlags; +}; +typedef struct IOPowerStateChangeNotification IOPowerStateChangeNotification; +typedef IOPowerStateChangeNotification sleepWakeNote; +#endif /* KERNEL && __cplusplus */ + +#endif /* ! _IOKIT_IOPM_H */ + diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMDeprecated.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMDeprecated.h.svn-base new file mode 100644 index 0000000..3bee01a --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMDeprecated.h.svn-base @@ -0,0 +1,177 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPMDeprecated_h_ +#define _IOPMDeprecated_h_ + +#ifdef __ppc__ + +// Power events +enum { + kClamshellClosedEventMask = (1<<0), // User closed lid + kDockingBarEventMask = (1<<1), // OBSOLETE + kACPlugEventMask = (1<<2), // User plugged or unplugged adapter + kFrontPanelButtonEventMask = (1<<3), // User hit the front panel button + kBatteryStatusEventMask = (1<<4) // Battery status has changed +}; + +// PUBLIC power management features +// NOTE: this is a direct port from classic, some of these bits +// are obsolete but are included for completeness +enum { + kPMHasWakeupTimerMask = (1<<0), // 1=wake timer is supported + kPMHasSharedModemPortMask = (1<<1), // Not used + kPMHasProcessorCyclingMask = (1<<2), // 1=processor cycling supported + kPMMustProcessorCycleMask = (1<<3), // Not used + kPMHasReducedSpeedMask = (1<<4), // 1=supports reduced processor speed + kPMDynamicSpeedChangeMask = (1<<5), // 1=supports changing processor speed on the fly + kPMHasSCSIDiskModeMask = (1<<6), // 1=supports using machine as SCSI drive + kPMCanGetBatteryTimeMask = (1<<7), // 1=battery time can be calculated + kPMCanWakeupOnRingMask = (1<<8), // 1=machine can wake on modem ring + kPMHasDimmingSupportMask = (1<<9), // 1=has monitor dimming support + kPMHasStartupTimerMask = (1<<10), // 1=can program startup timer + kPMHasChargeNotificationMask = (1<<11), // 1=client can determine charger status/get notifications + kPMHasDimSuspendSupportMask = (1<<12), // 1=can dim diplay to DPMS ('off') state + kPMHasWakeOnNetActivityMask = (1<<13), // 1=supports waking upon receipt of net packet + kPMHasWakeOnLidMask = (1<<14), // 1=can wake upon lid/case opening + kPMCanPowerOffPCIBusMask = (1<<15), // 1=can remove power from PCI bus on sleep + kPMHasDeepSleepMask = (1<<16), // 1=supports deep (hibernation) sleep + kPMHasSleepMask = (1<<17), // 1=machine support low power sleep (ala powerbooks) + kPMSupportsServerModeAPIMask = (1<<18), // 1=supports reboot on AC resume for unexpected power loss + kPMHasUPSIntegrationMask = (1<<19) // 1=supports incorporating UPS devices into power source calcs +}; + +// PRIVATE power management features +// NOTE: this is a direct port from classic, some of these bits +// are obsolete but are included for completeness. +enum { + kPMHasExtdBattInfoMask = (1<<0), // Not used + kPMHasBatteryIDMask = (1<<1), // Not used + kPMCanSwitchPowerMask = (1<<2), // Not used + kPMHasCelsiusCyclingMask = (1<<3), // Not used + kPMHasBatteryPredictionMask = (1<<4), // Not used + kPMHasPowerLevelsMask = (1<<5), // Not used + kPMHasSleepCPUSpeedMask = (1<<6), // Not used + kPMHasBtnIntHandlersMask = (1<<7), // 1=supports individual button interrupt handlers + kPMHasSCSITermPowerMask = (1<<8), // 1=supports SCSI termination power switch + kPMHasADBButtonHandlersMask = (1<<9), // 1=supports button handlers via ADB + kPMHasICTControlMask = (1<<10), // 1=supports ICT control + kPMHasLegacyDesktopSleepMask = (1<<11), // 1=supports 'doze' style sleep + kPMHasDeepIdleMask = (1<<12), // 1=supports Idle2 in hardware + kPMOpenLidPreventsSleepMask = (1<<13), // 1=open case prevent machine from sleeping + kPMClosedLidCausesSleepMask = (1<<14), // 1=case closed (clamshell closed) causes sleep + kPMHasFanControlMask = (1<<15), // 1=machine has software-programmable fan/thermostat controls + kPMHasThermalControlMask = (1<<16), // 1=machine supports thermal monitoring + kPMHasVStepSpeedChangeMask = (1<<17), // 1=machine supports processor voltage/clock change + kPMEnvironEventsPolledMask = (1<<18) // 1=machine doesn't generate pmu env ints, we must poll instead +}; + +// DEFAULT public and private features for machines whose device tree +// does NOT contain this information (pre-Core99). + +// For Cuda-based Desktops + +#define kStdDesktopPMFeatures kPMHasWakeupTimerMask |\ + kPMHasProcessorCyclingMask |\ + kPMHasDimmingSupportMask |\ + kPMHasStartupTimerMask |\ + kPMSupportsServerModeAPIMask |\ + kPMHasUPSIntegrationMask + +#define kStdDesktopPrivPMFeatures kPMHasExtdBattInfoMask |\ + kPMHasICTControlMask |\ + kPMHasLegacyDesktopSleepMask + +#define kStdDesktopNumBatteries 0 + +// For Wallstreet (PowerBook G3 Series 1998) + +#define kWallstreetPMFeatures kPMHasWakeupTimerMask |\ + kPMHasProcessorCyclingMask |\ + kPMHasReducedSpeedMask |\ + kPMDynamicSpeedChangeMask |\ + kPMHasSCSIDiskModeMask |\ + kPMCanGetBatteryTimeMask |\ + kPMHasDimmingSupportMask |\ + kPMHasChargeNotificationMask |\ + kPMHasDimSuspendSupportMask |\ + kPMHasSleepMask + +#define kWallstreetPrivPMFeatures kPMHasExtdBattInfoMask |\ + kPMHasBatteryIDMask |\ + kPMCanSwitchPowerMask |\ + kPMHasADBButtonHandlersMask |\ + kPMHasSCSITermPowerMask |\ + kPMHasICTControlMask |\ + kPMClosedLidCausesSleepMask |\ + kPMEnvironEventsPolledMask + +#define kStdPowerBookPMFeatures kWallstreetPMFeatures +#define kStdPowerBookPrivPMFeatures kWallstreetPrivPMFeatures + +#define kStdPowerBookNumBatteries 2 + +// For 101 (PowerBook G3 Series 1999) + +#define k101PMFeatures kPMHasWakeupTimerMask |\ + kPMHasProcessorCyclingMask |\ + kPMHasReducedSpeedMask |\ + kPMDynamicSpeedChangeMask |\ + kPMHasSCSIDiskModeMask |\ + kPMCanGetBatteryTimeMask |\ + kPMHasDimmingSupportMask |\ + kPMHasChargeNotificationMask |\ + kPMHasDimSuspendSupportMask |\ + kPMHasSleepMask |\ + kPMHasUPSIntegrationMask + +#define k101PrivPMFeatures kPMHasExtdBattInfoMask |\ + kPMHasBatteryIDMask |\ + kPMCanSwitchPowerMask |\ + kPMHasADBButtonHandlersMask |\ + kPMHasSCSITermPowerMask |\ + kPMHasICTControlMask |\ + kPMClosedLidCausesSleepMask |\ + kPMEnvironEventsPolledMask + + +// These flags are deprecated. Use the version with the kIOPM prefix in IOPM.h +enum { + kACInstalled = (1<<0), + kBatteryCharging = (1<<1), + kBatteryInstalled = (1<<2), + kUPSInstalled = (1<<3), + kBatteryAtWarn = (1<<4), + kBatteryDepleted = (1<<5), + kACnoChargeCapability = (1<<6), // AC adapter cannot charge battery + kRawLowBattery = (1<<7), // used only by Platform Expert + kForceLowSpeed = (1<<8) // set by Platfm Expert, chk'd by Pwr Plugin}; +}; + +#endif /* __ppc32 */ +#endif /* _IOPMDeprecated_h_ */ diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMLibDefs.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMLibDefs.h.svn-base new file mode 100644 index 0000000..ff25bf3 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMLibDefs.h.svn-base @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + + +#define kPMSetAggressiveness 0 +#define kPMGetAggressiveness 1 +#define kPMSleepSystem 2 +#define kPMAllowPowerChange 3 +#define kPMCancelPowerChange 4 +#define kPMShutdownSystem 5 +#define kPMRestartSystem 6 +#define kPMSleepSystemOptions 7 +#define kPMSetMaintenanceWakeCalendar 8 + +#define kNumPMMethods 9 diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPowerSource.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPowerSource.h.svn-base new file mode 100644 index 0000000..ed68918 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPowerSource.h.svn-base @@ -0,0 +1,300 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPMPowerSource_h_ +#define _IOPMPowerSource_h_ + +#include +#include +#include +#include +#include + +enum { + kSecondsPerHour = 3600, + kTenMinutesInSeconds = 600 +}; + +/* class IOPMPowerSource + * + * See IOKit/pwr_mgt/IOPM.h for power source keys relevant to this class. These + * report-type keys are required for calls to IOPMPowerSource::setReportables(), + * and they define the IORegistry interface through which data is passed back + * up to the rest of the system. + * + * A subclassing driver that doesn't want to do anything fancy should: + * 1. Subclass IOPMPowerSource + * 3. Install its own battery change notifications or polling routine that can + * converse with actual battery hardware. + * 4. When battery state changes, change the relevant member variables + * through setCurrentCapacity() style accessors. + * 5. Call updateStatus() on itself when all such settings have been updated. + * + * The subclass driver should also initially populate its settings and call + * updateStatus() on launch. + * + * + * Settings + * + * ExternalConnected + * Type: bool + * IORegistry Key: kIOPMPSExternalConnectedKey + * True if computer is drawing external power + * + * ExternalChargeCapable + * Type: bool + * IORegistry Key: kIOPMPSExternalChargeCapableKey + * True if external power is capable of charging internal battery + * + * BatteryInstalled + * Type: bool + * IORegistry Key: kIOPMPSBatteryInstalledKey + * True if a battery is present; false if removed + * + * IsCharging + * Type: bool + * IORegistry Key: kIOPMPSIsChargingKey + * True if battery is charging itself from external power + * + * AtWarnLevel + * Type: bool + * IORegistry Key: kIOPMPSAtWarnLevelKey + * True if draining battery capacity and past warn level + * + * AtCriticalLevel + * Type: bool + * IORegistry Key: kIOPMPSAtCriticalLevelKey + * True if draining battery capacity and past critical level + * + * CurrentCapacity + * MaxCapacity + * Type: unsigned int + * IORegistry Key: kIOPMPSCurrentCapacityKey, kIOPMPSMaxCapacityKey + * Capacity measured in mAh + * + * TimeRemaining + * Type: int + * IORegistry Key: kIOPMPSTimeRemainingKey + * Time remaining measured in minutes + * + * Amperage + * Type: int + * IORegistry Key: kIOPMPSAmperageKey + * Current is measured in mA + * + * Voltage + * Type: unsigned int + * IORegistry Key: kIOPMPSVoltageKey + * Voltage measured in mV + * + * CycleCount + * Type: unsigned int + * IORegistry Key: kIOPMPSCycleCountKey + * Number of charge/discharge cycles + * + * AdapterInfo + * Type: int + * IORegistry Key: kIOPMPSAdapterInfoKey + * Power adapter information + * + * Location + * Type: int + * IORegistry Key: kIOPMPSLocationKey + * Clue about battery's location in machine - Left vs. Right + * + * ErrorCondition + * Type: OSSymbol + * IORegistry Key: kIOPMPSErrorConditionKey + * String describing error state of battery + * + * Manufacturer + * Type: OSSymbol + * IORegistry Key: kIOPMPSManufacturerKey + * String describing battery manufacturer + * + * Manufactured Date + * Type: unsigned 16-bit bitfield + * IORegistry Key: kIOPMPSManufactureDateKey + * Date is published in a bitfield per the Smart Battery Data spec rev 1.1 + * in section 5.1.26 + * Bits 0...4 => day (value 1-31; 5 bits) + * Bits 5...8 => month (value 1-12; 4 bits) + * Bits 9...15 => years since 1980 (value 0-127; 7 bits) + * + * Model + * Type: OSSymbol + * IORegistry Key: kIOPMPSModelKey + * String describing model number + * + * Serial + * Type: OSSymbol + * IORegistry Key: kIOPMPSSerialKey + * String describing serial number or unique info + * The serial number published hear bears no correspondence to the Apple serial + * number printed on each battery. This is a manufacturer serial number with + * no correlation to the printed serial number. + * + * LegacyIOBatteryInfo + * Type: OSDictionary + * IORegistry Key: kIOPMPSLegacyBatteryInfoKey + * Dictionary conforming to the OS X 10.0-10.4 + */ + +class IOPMPowerSource : public IOService +{ + OSDeclareDefaultStructors(IOPMPowerSource) + + friend class IOPMPowerSourceList; + + protected: + +/* bool settingsChangedSinceLastUpdate + * Used by subclasses to determine if any settings have been modified via the + * accessors below since last call to update(). true is settings have changed; + * false otherwise. + */ + bool settingsChangedSinceUpdate; + +/* OSDictionary properties + * Stores power source state + */ + OSDictionary *properties; + + const OSSymbol *externalConnectedKey; + const OSSymbol *externalChargeCapableKey; + const OSSymbol *batteryInstalledKey; + const OSSymbol *chargingKey; + const OSSymbol *warnLevelKey; + const OSSymbol *criticalLevelKey; + const OSSymbol *currentCapacityKey; + const OSSymbol *maxCapacityKey; + const OSSymbol *timeRemainingKey; + const OSSymbol *amperageKey; + const OSSymbol *voltageKey; + const OSSymbol *cycleCountKey; + const OSSymbol *adapterInfoKey; + const OSSymbol *locationKey; + const OSSymbol *errorConditionKey; + const OSSymbol *manufacturerKey; + const OSSymbol *modelKey; + const OSSymbol *serialKey; + const OSSymbol *batteryInfoKey; + + // Tracking for IOPMPowerSourceList + IOPMPowerSource *nextInList; + + public: + +/*! @function powerSource + @abstract Creates a new IOPMPowerSource nub. Must be attached to IORegistry, + and registered by provider. +*/ + static IOPMPowerSource *powerSource(void); + + virtual bool init(void); + + virtual void free(void); + +/*! @function updateStatus + @abstract Must be called by physical battery controller when battery state + has changed significantly. + @discussion The system will not poll this object for battery updates. Rather \ + the battery's controller must call updateStatus() every time state changes \ + and the settings will be relayed to higher levels of power management. \ + The subclassing driver should override this only if the driver needs to add \ + new settings to the base class. +*/ + virtual void updateStatus(void); + +/* Public accessors for battery state + */ + bool externalConnected(void); + bool externalChargeCapable(void); + bool batteryInstalled(void); + bool isCharging(void); + bool atWarnLevel(void); + bool atCriticalLevel(void); + + unsigned int currentCapacity(void); + unsigned int maxCapacity(void); + unsigned int capacityPercentRemaining(void); + int timeRemaining(void); + int amperage(void); + unsigned int voltage(void); + unsigned int cycleCount(void); + int adapterInfo(void); + int location(void); + + OSSymbol *errorCondition(void); + OSSymbol *manufacturer(void); + OSSymbol *model(void); + OSSymbol *serial(void); + OSDictionary *legacyIOBatteryInfo(void); + + OSObject *getPSProperty(const OSSymbol *); + +protected: + +/* Protected "setter" methods for subclasses + * Subclasses should use these setters to modify all battery properties. + * + * Subclasses must follow all property changes with a call to updateStatus() + * to flush settings changes to upper level battery API clients. + * + */ + void setExternalConnected(bool); + void setExternalChargeCapable(bool); + void setBatteryInstalled(bool); + void setIsCharging(bool); + void setAtWarnLevel(bool); + void setAtCriticalLevel(bool); + + void setCurrentCapacity(unsigned int); + void setMaxCapacity(unsigned int); + void setTimeRemaining(int); + void setAmperage(int); + void setVoltage(unsigned int); + void setCycleCount(unsigned int); + void setAdapterInfo(int); + void setLocation(int); + + void setErrorCondition(OSSymbol *); + void setManufacturer(OSSymbol *); + void setModel(OSSymbol *); + void setSerial(OSSymbol *); + void setLegacyIOBatteryInfo(OSDictionary *); + +/* All of these methods funnel through the generic accessor method + setPSProperty. Caller can pass in any arbitrary OSSymbol key, and + that value will be stored in the PM settings dictionary, and relayed + onto the IORegistry at update time. + */ + void setPSProperty(const OSSymbol *, OSObject *); +}; + +#endif diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPowerSourceList.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPowerSourceList.h.svn-base new file mode 100644 index 0000000..cb1c8ea --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPowerSourceList.h.svn-base @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#include +#include + +class IOPMPowerSource; + +class IOPMPowerSourceList : public OSObject +{ + OSDeclareDefaultStructors(IOPMPowerSourceList) + private: + // pointer to first power source in list + IOPMPowerSource *firstItem; + + // how many power sources are in the list + unsigned long length; + + public: + void initialize(void); + void free(void); + + unsigned long numberOfItems(void); + IOReturn addToList(IOPMPowerSource *newPowerSource); + IOReturn removeFromList(IOPMPowerSource *theItem); + + IOPMPowerSource *firstInList(void); + IOPMPowerSource *nextInList(IOPMPowerSource *currentItem); +}; + diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPrivate.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPrivate.h.svn-base new file mode 100644 index 0000000..bf50d78 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMPrivate.h.svn-base @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOPMPRIVATE_H +#define _IOKIT_IOPMPRIVATE_H + +#include + +/*****************************************************************************/ + +// Private power commands issued to root domain +// bits 0-7 in IOPM.h + +enum { + kIOPMSetValue = (1<<16), + // don't sleep on clamshell closure on a portable with AC connected + kIOPMSetDesktopMode = (1<<17), + // set state of AC adaptor connected + kIOPMSetACAdaptorConnected = (1<<18) +}; + +/*****************************************************************************/ +/*****************************************************************************/ + +/* + * PM notification types + */ + +/* @constant kIOPMStateConsoleUserShutdown + * @abstract Notification of GUI shutdown state available to kexts. + * @discussion This type can be passed as arguments to registerPMSettingController() + * to receive callbacks. + */ +#define kIOPMStateConsoleShutdown "ConsoleShutdown" + +/* @enum ShutdownValues + * @abstract Potential values shared with key kIOPMStateConsoleUserShutdown + */ +enum { +/* @constant kIOPMStateConsoleShutdownNone + * @abstract System shutdown (or restart) hasn't started; system is ON. + * @discussion Next state: 2 + */ + kIOPMStateConsoleShutdownNone = 1, +/* @constant kIOPMStateConsoleShutdownPossible + * @abstract User has been presented with the option to shutdown or restart. Shutdown may be cancelled. + * @discussion Next state may be: 1, 4 + */ + kIOPMStateConsoleShutdownPossible = 2, +/* @constant kIOPMStateConsoleShutdownUnderway + * @abstract Shutdown or restart is proceeding. It may still be cancelled. + * @discussion Next state may be: 1, 4. This state is currently unused. + */ + kIOPMStateConsoleShutdownUnderway = 3, +/* @constant kIOPMStateConsoleShutdownCertain + * @abstract Shutdown is in progress and irrevocable. + * @discussion State remains 4 until power is removed from CPU. + */ + kIOPMStateConsoleShutdownCertain = 4 +}; + +/*****************************************************************************/ +/*****************************************************************************/ + +/* PM Statistics - event indices + * These are arguments to IOPMrootDomain::pmStatsRecordEvent(). + */ +enum { + kIOPMStatsHibernateImageWrite = 1, + kIOPMStatsHibernateImageRead, + kIOPMStatsDriversNotify, + kIOPMStatsApplicationNotify, + kIOPMStatsLateDriverAcknowledge, + kIOPMStatsLateAppAcknowledge, + + // To designate if you're specifying the start or stop end of + // each of the above events, do a bitwise OR of the appropriate + // Start/Stop flag and pass the result to IOPMrootDomain to record + // the event. + kIOPMStatsEventStartFlag = (1 << 24), + kIOPMStatsEventStopFlag = (1 << 25) +}; + +// Keys for IOPMrootDomain registry properties +#define kIOPMSleepStatisticsKey "SleepStatistics" +#define kIOPMSleepStatisticsAppsKey "AppStatistics" + +// Application response statistics +#define kIOPMStatsNameKey "Name" +#define kIOPMStatsPIDKey "Pid" +#define kIOPMStatsTimeMSKey "TimeMS" +#define kIOPMStatsApplicationResponseTypeKey "ResponseType" +#define kIOPMStatsMessageTypeKey "MessageType" + +// PM Statistics: potential values for the key kIOPMStatsApplicationResponseTypeKey +// entry in the application results array. +#define kIOPMStatsResponseTimedOut "ResponseTimedOut" +#define kIOPMStatsResponseCancel "ResponseCancel" +#define kIOPMStatsResponseSlow "ResponseSlow" + +typedef struct { + struct bounds{ + uint64_t start; + uint64_t stop; + }; + + struct bounds hibWrite; + struct bounds hibRead; +// bounds driverNotifySleep; +// bounds driverNotifyWake; +// bounds appNotifySleep; +// bounds appNotifyWake; +// OSDictionary *tardyApps; +// OSDictionary *tardyDrivers; +} PMStatsStruct; + +/*****************************************************************************/ + +/* PM RootDomain tracePoints + * + * In the sleep/wake process, we expect the sleep trace points to proceed + * in increasing order. Once sleep begins with code kIOPMTracePointSleepStarted = 0x11, + * we expect sleep to continue in a monotonically increasing order of tracepoints + * to kIOPMTracePointSystemLoginwindowPhase = 0x30. After trace point SystemLoginWindowPhase, + * the system will return to kIOPMTracePointSystemUp = 0x00. + * + * If the trace point decreases (instead of increasing) before reaching kIOPMTracePointSystemUp, + * that indicates that the sleep process was cancelled. The cancel reason shall be indicated + * in the cancel tracepoint. (TBD) + */ + +enum { +/* When kTracePointSystemUp is the latest tracePoint, + the system is awake. It is not asleep, sleeping, or waking. + + * Phase begins: At boot, at completion of wake from sleep, + immediately following kIOPMTracePointSystemLoginwindowPhase. + * Phase ends: When a sleep attempt is initiated. + */ + kIOPMTracePointSystemUp = 0, + +/* When kIOPMTracePointSleepStarted we have just initiated sleep. + + Note: The state prior to kIOPMTracePointSleepStarted may be only one of: + * kIOPMTracePointSystemUp + * kIOPMTracePointSystemLoginwindowPhase or + + * Phase begins: At initiation of system sleep (idle or forced). + * Phase ends: As we start to notify applications of system sleep. + */ + kIOPMTracePointSleepStarted = 0x11, + +/* When kTracePointSystemSleepAppsPhase is the latest tracePoint, + a system sleep has been irrevocably inititated and PM waits + for responses from notified applications. + + * Phase begins: Begin to asynchronously fire kIOMessageSystemWillSleep notifications, + * and in the case of an idle sleep kIOMessageCanSystemSleep as well. + * Phase ends: When we have received all user & interested kernel acknowledgements. + */ + kIOPMTracePointSystemSleepAppsPhase = 0x12, + + +/* When kIOPMTracePointSystemHibernatePhase is the latest tracePoint, + PM is writing the hiernate image to disk. + */ + kIOPMTracePointSystemHibernatePhase = 0x13, + +/* When kTracePointSystemSleepDriversPhase is the latest tracePoint, + PM is iterating the driver tree powering off devices individually. + + * Phase begins: When IOPMrootDomain has received all of its power acknowledgements and begins + * executing IOService::powerDomainWillChangeTo() + * Phase ends: When IOPMrootDomain::powerChangeDone begins executing CPU shutoff code. + */ + kIOPMTracePointSystemSleepDriversPhase = 0x14, + +/* When kTracePointSystemSleepPlatformPhase is the latest tracePoint, + all apps and drivers have notified of sleep. Plotfarm is powering + off CPU; or system is asleep; or low level wakeup is underway. + + Note: If a system is asleep and then loses power, and it does not have a hibernate + image to restore from (e.g. hibernatemode = 0), then OS X may interpret this power + loss as a system crash in the kTracePointSystemSleepPlatformPhase, since the + power loss resembles a hang or crash, and the power being removed by the user. + + * Phase begins: IOPMrootDomain has already shut off drivers, and is now powering off CPU. + * Phase ends: Immediately after CPU's are powered back on during wakeup. + */ + kIOPMTracePointSystemSleepPlatformPhase = 0x15, + +/* When kTracePointSystemWakeDriversPhase is the latest tracePoint, + System CPU is powered, PM is notifying drivers of system wake. + + * Phase begins: CPU's have successfully powered up and OS is executing. + * Phase ends: All drivers have handled power events & acknowledged completion. + IOPMrootDomain is about to deliver kIOMessageSystemHasPoweredOn. + */ + kIOPMTracePointSystemWakeDriversPhase = 0x21, + +/* When kTracePointSystemWakeAppsPhase is the latest tracePoint, + System CPU is powered, PM has powered on each driver. + + * Phase begins: IOPMrootDomain::tellChangeUp before sending asynchronous + kIOMessageSystemHasPoweredOn notifications + * Phase ends: IOPMrootDomain::tellChangeUp after sending asynchronous notifications + */ + kIOPMTracePointSystemWakeAppsPhase = 0x22, + +/* kIOPMTracePointSystemLoginwindowPhase + This phase represents a several minute window after the system has powered on. + Higher levels of system diagnostics are in a heightened state of alert in this phase, + in case any user errors occurred that we could not detect in software. + + This several minute window + + * Phase begins: After IOPMrootDomain sends kIOMessageSystemHasPoweredOn message. + * Phase ends: When loginwindow calls IOPMSleepWakeSetUUID(NULL) the system shall + be considered awake and usable. The next phase shall be kIOPMTracePointSystemUp. + */ + kIOPMTracePointSystemLoginwindowPhase = 0x30 +}; + +/*****************************************************************************/ + +/* +* kIOPMLoginWindowSecurityDebugKey - identifies PM debug data specific to LoginWindow + * for use with IOPMrootDomain. +*/ +#define kIOPMLoginWindowSecurityDebugKey "LoginWindowSecurity" + +// For PM internal use only - key to locate sleep failure results within SCDynamicStore. +#define kIOPMDynamicStoreSleepFailureKey "SleepFailure" + +/*****************************************************************************/ + +// For IOPMLibPrivate.h +#define kIOPMSleepWakeFailureKey "PMFailurePhase" +#define kIOPMSleepWakeFailureCodeKey "PMStatusCode" +#define kIOPMSleepWakeFailureLoginKey "LWFailurePhase" +#define kIOPMSleepWakeFailureUUIDKey "UUID" +#define kIOPMSleepWakeFailureDateKey "Date" + +#endif /* ! _IOKIT_IOPMPRIVATE_H */ + diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMpowerState.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMpowerState.h.svn-base new file mode 100644 index 0000000..f7f4c8a --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPMpowerState.h.svn-base @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#include + +/*! @header IOPMpowerState.h + @abstract Defines the struct IOPMPowerState that power managed drivers should use to describe their power states. +*/ + +/*! @struct IOPMPowerState + @abstract Describes a device's power state. + @discussion To take part in system power management, drivers should define an array of 2 or more power states and pass it to kernel power management through IOService::registerPowerDriver. + @field version Defines version number of this struct. Just use the value "1" when defining an IOPMPowerState. + @field capabilityFlags Describes the capability of the device in this state. + @field outputPowerCharacter Describes the power provided in this state. + @field inputPowerRequirement Describes the input power required in this state. + @field staticPower Describes average consumption in milliwatts. Unused; drivers may specify 0. + @field unbudgetedPower Describes additional consumption from separate power supply (milliWatts). Unused; drivers may specify 0. + @field powerToAttain Describes dditional power to attain this state from next lower state (in milliWatts). Unused; drivers may specify 0. + @field timeToAttain Describes time required to enter this state from next lower state (in microseconds). Unused; drivers may specify 0. + @field settleUpTime Describes settle time required after entering this state from next lower state (microseconds). Unused; drivers may specify 0. + @field timeToLower Describes time required to enter next lower state from this one (microseconds). Unused; drivers may specify 0. + @field settleDownTime Settle time required after entering next lower state from this state (microseconds). Unused; drivers may specify 0. + @field powerDomainBudget Describes power in milliWatts a domain in this state can deliver to its children. Unused; drivers may specify 0. +} +*/ + +struct IOPMPowerState +{ + unsigned long version; + IOPMPowerFlags capabilityFlags; + IOPMPowerFlags outputPowerCharacter; + IOPMPowerFlags inputPowerRequirement; + unsigned long staticPower; + unsigned long unbudgetedPower; + unsigned long powerToAttain; + unsigned long timeToAttain; + unsigned long settleUpTime; + unsigned long timeToLower; + unsigned long settleDownTime; + unsigned long powerDomainBudget; +}; + +typedef struct IOPMPowerState IOPMPowerState; + +enum { + kIOPMPowerStateVersion1 = 1 +}; diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPowerConnection.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPowerConnection.h.svn-base new file mode 100644 index 0000000..179035b --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/IOPowerConnection.h.svn-base @@ -0,0 +1,159 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPOWERCONNECTION_H +#define _IOKIT_IOPOWERCONNECTION_H + +#include +#include + +class IOPowerConnection : public IOService +{ + OSDeclareDefaultStructors(IOPowerConnection) + +protected: + /*! @field parentKnowsState true: parent knows state of its domain + used by child */ + bool stateKnown; + /*! @field currentPowerFlags power flags which describe the current state of the power domain + used by child */ + IOPMPowerFlags currentPowerFlags; + /*! @field desiredDomainState state number which corresponds to the child's desire + used by parent */ + unsigned long desiredDomainState; + + /*! @field requestFlag set to true when desiredDomainState is set */ + bool requestFlag; + + /*! @field preventIdleSleepFlag true if child has this bit set in its desired state + used by parent */ + unsigned long preventIdleSleepFlag; + + /*! @field preventSystemSleepFlag true if child has this bit set in its desired state + used by parent */ + unsigned long preventSystemSleepFlag; + + /*! @field awaitingAck true if child has not yet acked our notification + used by parent */ + bool awaitingAck; + + /*! @field readyFlag true if the child has been added as a power child + used by parent */ + bool readyFlag; + +public: + /*! @function setParentKnowsState + @abstract Sets the stateKnown variable. + @discussion Called by the parent when the object is created and called by the child when it discovers that the parent now knows its state. */ + void setParentKnowsState (bool ); + + /*! @function setParentCurrentPowerFlags + @abstract Sets the currentPowerFlags variable. + @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */ + void setParentCurrentPowerFlags (IOPMPowerFlags ); + + /*! @function parentKnowsState + @abstract Returns the stateKnown variable. */ + bool parentKnowsState (void ); + + /*! @function parentCurrentPowerFlags + @abstract Returns the currentPowerFlags variable. */ + IOPMPowerFlags parentCurrentPowerFlags (void ); + + /*! @function setDesiredDomainState + @abstract Sets the desiredDomainState variable. + @discussion Called by the parent. */ + void setDesiredDomainState (unsigned long ); + + /*! @function getDesiredDomainState + @abstract Returns the desiredDomainState variable. + @discussion Called by the parent. */ + unsigned long getDesiredDomainState ( void ); + + /*! @function setChildHasRequestedPower + @abstract Set the flag that says that the child has called requestPowerDomainState. + @discussion Called by the parent. */ + void setChildHasRequestedPower ( void ); + + + /*! @function childHasRequestedPower + @abstract Return the flag that says whether the child has called requestPowerDomainState. + @discussion Called by the PCI Aux Power Supply Driver to see if a device driver + is power managed. */ + bool childHasRequestedPower ( void ); + + /*! @function setPreventIdleSleepFlag + @abstract Sets the preventIdleSleepFlag variable. + @discussion Called by the parent. */ + void setPreventIdleSleepFlag (unsigned long ); + + /*! @function getPreventIdleSleepFlag + @abstract Returns the preventIdleSleepFlag variable. + @discussion Called by the parent. */ + bool getPreventIdleSleepFlag ( void ); + + /*! @function setPreventSystemSleepFlag + @abstract Sets the preventSystemSleepFlag variable. + @discussion Called by the parent. */ + void setPreventSystemSleepFlag (unsigned long ); + + /*! @function getPreventSystemSleepFlag + @abstract Returns the preventSystemSleepFlag variable. + @discussion Called by the parent. */ + bool getPreventSystemSleepFlag ( void ); + + /*! @function setAwaitingAck + @abstract Sets the awaitingAck variable. + @discussion Called by the parent. */ + void setAwaitingAck ( bool ); + + /*! @function getAwaitingAck + @abstract Returns the awaitingAck variable. + @discussion Called by the parent. */ + bool getAwaitingAck ( void ); + + /*! @function setReadyFlag + @abstract Sets the readyFlag variable. + @discussion Called by the parent. */ + void setReadyFlag( bool flag ); + + /*! @function getReadyFlag + @abstract Returns the readyFlag variable. + @discussion Called by the parent. */ + bool getReadyFlag( void ) const; +}; + +#endif /* ! _IOKIT_IOPOWERCONNECTION_H */ + diff --git a/i386/include/IOKit/pwr_mgt/.svn/text-base/RootDomain.h.svn-base b/i386/include/IOKit/pwr_mgt/.svn/text-base/RootDomain.h.svn-base new file mode 100644 index 0000000..6f4ebee --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/.svn/text-base/RootDomain.h.svn-base @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_ROOTDOMAIN_H +#define _IOKIT_ROOTDOMAIN_H + +#include +#include +#include "IOKit/pwr_mgt/IOPMPrivate.h" + + +class IOPMPowerStateQueue; +class RootDomainUserClient; +class PMTraceWorker; + +/* + * Flags for get/setSleepSupported() + */ +enum { + kRootDomainSleepNotSupported = 0x00000000, + kRootDomainSleepSupported = 0x00000001, + kFrameBufferDeepSleepSupported = 0x00000002, + kPCICantSleep = 0x00000004 +}; + +/* + *IOPMrootDomain registry property keys + */ +#define kRootDomainSupportedFeatures "Supported Features" +#define kRootDomainSleepReasonKey "Last Sleep Reason" +#define kRootDomainSleepOptionsKey "Last Sleep Options" +#define kIOPMRootDomainWakeReasonKey "Wake Reason" +#define kIOPMRootDomainWakeTypeKey "Wake Type" +#define kIOPMRootDomainPowerStatusKey "Power Status" + +/* + * Possible sleep reasons found under kRootDomainSleepReasonsKey + */ +#define kIOPMClamshellSleepKey "Clamshell Sleep" +#define kIOPMPowerButtonSleepKey "Power Button Sleep" +#define kIOPMSoftwareSleepKey "Software Sleep" +#define kIOPMOSSwitchHibernationKey "OS Switch Sleep" +#define kIOPMIdleSleepKey "Idle Sleep" +#define kIOPMLowPowerSleepKey "Low Power Sleep" +#define kIOPMThermalEmergencySleepKey "Thermal Emergency Sleep" +#define kIOPMMaintenanceSleepKey "Maintenance Sleep" + +/* + * String constants for communication with PM CPU + */ +#define kIOPMRootDomainLidCloseCString "LidClose" +#define kIOPMRootDomainBatPowerCString "BatPower" + +/* + * Supported Feature bitfields for IOPMrootDomain::publishFeature() + */ +enum { + kIOPMSupportedOnAC = (1<<0), + kIOPMSupportedOnBatt = (1<<1), + kIOPMSupportedOnUPS = (1<<2) +}; + +typedef IOReturn (*IOPMSettingControllerCallback) + (OSObject *target, const OSSymbol *type, + OSObject *val, uintptr_t refcon); + +__BEGIN_DECLS +IONotifier * registerSleepWakeInterest( + IOServiceInterestHandler, void *, void * = 0); + +IONotifier * registerPrioritySleepWakeInterest( + IOServiceInterestHandler handler, + void * self, void * ref = 0); + +IOReturn acknowledgeSleepWakeNotification(void * ); + +IOReturn vetoSleepWakeNotification(void * PMrefcon); +__END_DECLS + +#define IOPM_ROOTDOMAIN_REV 2 + +class IOPMrootDomain: public IOService +{ + OSDeclareFinalStructors(IOPMrootDomain) + +public: + static IOPMrootDomain * construct( void ); + + virtual bool start( IOService * provider ); + virtual IOReturn setAggressiveness( unsigned long, unsigned long ); + virtual IOReturn getAggressiveness( unsigned long, unsigned long * ); + + virtual IOReturn sleepSystem( void ); + IOReturn sleepSystemOptions( OSDictionary *options ); + + virtual IOReturn setProperties( OSObject * ); + +/*! @function systemPowerEventOccurred + @abstract Other drivers may inform IOPMrootDomain of system PM events + @discussion systemPowerEventOccurred is a richer alternative to receivePowerNotification() + Only Apple-owned kexts should have reason to call systemPowerEventOccurred. + @param event An OSSymbol describing the type of power event. + @param value A 32-bit integer value associated with the event. + @param shouldUpdate indicates whether the root domain should send a notification + to interested parties. Pass false if you're calling systemPowerEventOccurred + several times in succession; and pass true only on the last invocatino. + @result kIOReturnSuccess on success */ + + IOReturn systemPowerEventOccurred( + const OSSymbol *event, + uint32_t intValue ); + + IOReturn systemPowerEventOccurred( + const OSSymbol *event, + OSObject *value ); + + virtual IOReturn receivePowerNotification( UInt32 msg ); + + virtual void setSleepSupported( IOOptionBits flags ); + + virtual IOOptionBits getSleepSupported( void ); + + void wakeFromDoze( void ); + + // KEXT driver announces support of power management feature + + void publishFeature( const char *feature ); + + // KEXT driver announces support of power management feature + // And specifies power sources with kIOPMSupportedOn{AC/Batt/UPS} bitfield. + // Returns a unique uint32_t identifier for later removing support for this + // feature. + // NULL is acceptable for uniqueFeatureID for kexts without plans to unload. + + void publishFeature( const char *feature, + uint32_t supportedWhere, + uint32_t *uniqueFeatureID); + + // KEXT driver announces removal of a previously published power management + // feature. Pass 'uniqueFeatureID' returned from publishFeature() + + IOReturn removePublishedFeature( uint32_t removeFeatureID ); + +/*! @function copyPMSetting + @abstract Copy the current value for a PM setting. Returns an OSNumber or + OSData depending on the setting. + @param whichSetting Name of the desired setting. + @result OSObject value if valid, NULL otherwise. */ + + OSObject * copyPMSetting( OSSymbol *whichSetting ); + +/*! @function registerPMSettingController + @abstract Register for callbacks on changes to certain PM settings. + @param settings NULL terminated array of C strings, each string for a PM + setting that the caller is interested in and wants to get callbacks for. + @param callout C function ptr or member function cast as such. + @param target The target of the callback, usually 'this' + @param refcon Will be passed to caller in callback; for caller's use. + @param handle Caller should keep the OSObject * returned here. If non-NULL, + handle will have a retain count of 1 on return. To deregister, pass to + unregisterPMSettingController() + @result kIOReturnSuccess on success. */ + + IOReturn registerPMSettingController( + const OSSymbol *settings[], + IOPMSettingControllerCallback callout, + OSObject *target, + uintptr_t refcon, + OSObject **handle); // out param + +/*! @function registerPMSettingController + @abstract Register for callbacks on changes to certain PM settings. + @param settings NULL terminated array of C strings, each string for a PM + setting that the caller is interested in and wants to get callbacks for. + @param supportedPowerSources bitfield indicating which power sources these + settings are supported for (kIOPMSupportedOnAC, etc.) + @param callout C function ptr or member function cast as such. + @param target The target of the callback, usually 'this' + @param refcon Will be passed to caller in callback; for caller's use. + @param handle Caller should keep the OSObject * returned here. If non-NULL, + handle will have a retain count of 1 on return. To deregister, pass to + unregisterPMSettingController() + @result kIOReturnSuccess on success. */ + + IOReturn registerPMSettingController( + const OSSymbol *settings[], + uint32_t supportedPowerSources, + IOPMSettingControllerCallback callout, + OSObject *target, + uintptr_t refcon, + OSObject **handle); // out param + + virtual IONotifier * registerInterest( + const OSSymbol * typeOfInterest, + IOServiceInterestHandler handler, + void * target, void * ref = 0 ); + + void pmStatsRecordEvent( + int eventIndex, + AbsoluteTime timestamp); + + void pmStatsRecordApplicationResponse( + const OSSymbol *response, + const char *name, + int messageType, + uint32_t delay_ms, + int app_pid); + + virtual IOReturn callPlatformFunction( + const OSSymbol *functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + +private: + virtual IOReturn changePowerStateTo( unsigned long ordinal ); + virtual IOReturn changePowerStateToPriv( unsigned long ordinal ); + virtual IOReturn requestPowerDomainState( IOPMPowerFlags, IOPowerConnection *, unsigned long ); + virtual void powerChangeDone( unsigned long ); + virtual bool tellChangeDown( unsigned long ); + virtual bool askChangeDown( unsigned long ); + virtual void tellChangeUp( unsigned long ); + virtual void tellNoChangeDown( unsigned long ); +}; + + +#endif /* _IOKIT_ROOTDOMAIN_H */ diff --git a/i386/include/IOKit/pwr_mgt/IOPM.h b/i386/include/IOKit/pwr_mgt/IOPM.h new file mode 100644 index 0000000..7d78225 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPM.h @@ -0,0 +1,654 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOPM_H +#define _IOKIT_IOPM_H + +#include +#include +#include + +#ifdef __ppc__ +#include +#endif + +/*! @header IOPM.h + @abstract Defines power management constants and keys used by both in-kernel and user space power management. + @discussion IOPM.h defines a range of power management constants used in several in-kernel and user space APIs. Most significantly, the IOPMPowerFlags used to specify the fields of an IOPMPowerState struct are defined here. + + Most of the constants defined in IOPM.h are deprecated or for Apple internal use only, and are not elaborated on in headerdoc. +*/ + +enum { + kIOPMMaxPowerStates = 10, + IOPMMaxPowerStates = kIOPMMaxPowerStates +}; + +/*! @enum IOPMPowerFlags + @abstract Bits are used in defining capabilityFlags, inputPowerRequirements, and outputPowerCharacter in the IOPMPowerState structure. + @discussion These bits may be bitwise-OR'd together in the IOPMPowerState capabilityFlags field, the outputPowerCharacter field, and/or the inputPowerRequirement field. + + The comments clearly mark whether each flag should be used in the capabilityFlags field, outputPowerCharacter field, and inputPowerRequirement field, or all three. + + The value of capabilityFlags, inputPowerRequirement or outputPowerCharacter may be 0. Most drivers implement their 'OFF' state, used when asleep, by defininf each of the 3 fields as 0. + + The bits listed below are only the most common bits used to define a device's power states. Your device's IO family may require that your device specify other input or output power flags to interact properly. Consult family-specific documentation to determine if your IOPower plane parents or children require other power flags; they probably don't. + + @constant kIOPMPowerOn Indicates the device is on, requires power, and provides power. Useful as a: Capability, InputPowerRequirement, OutputPowerCharacter + + @constant kIOPMDeviceUsable Indicates the device is usable in this state. Useful only as a Capability + + @constant kIOPMLowPower + Indicates device is in a low power state. May be bitwis-OR'd together + with kIOPMDeviceUsable flag, to indicate the device is still usable. + + A device with a capability of kIOPMLowPower may: + Require either 0 or kIOPMPowerOn from its power parent + Offer either kIOPMLowPower, kIOPMPowerOn, or 0 (no power at all) + to its power plane children. + + Useful only as a Capability, although USB drivers should consult USB family documentation for other valid circumstances to use the kIOPMLowPower bit. + + @constant kIOPMPreventIdleSleep + In the capability field of a power state, disallows idle system sleep while the device is in that state. + + For example, displays and disks set this capability for their ON power state; since the system may not idle sleep while the display (and thus keyboard or mouse) or the disk is active. + + Useful only as a Capability. + + @constant kIOPMSleepCapability + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + + @constant kIOPMRestartCapability + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + + @constant kIOPMSleep + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. + + @constant kIOPMRestart + Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. +*/ +typedef unsigned long IOPMPowerFlags; +enum { + kIOPMPowerOn = 0x00000002, + kIOPMDeviceUsable = 0x00008000, + kIOPMLowPower = 0x00010000, + kIOPMPreventIdleSleep = 0x00000040, + kIOPMSleepCapability = 0x00000004, + kIOPMRestartCapability = 0x00000080, + kIOPMSleep = 0x00000001, + kIOPMRestart = 0x00000080 +}; + +/* + * Private IOPMPowerFlags + * + * For Apple use only + * Not for use with non-Apple drivers + * Their behavior is undefined + */ +enum { + kIOPMClockNormal = 0x0004, + kIOPMClockRunning = 0x0008, + kIOPMPreventSystemSleep = 0x0010, + kIOPMDoze = 0x0400, + kIOPMChildClamp = 0x0080, + kIOPMChildClamp2 = 0x0200, + kIOPMNotPowerManaged = 0x0800 +}; + + +/* + * Deprecated IOPMPowerFlags + * Their behavior is undefined when used in IOPMPowerState + * Capability, InputPowerRequirement, or OutputPowerCharacter fields. + */ +enum { + kIOPMMaxPerformance = 0x4000, + kIOPMPassThrough = 0x0100, + kIOPMAuxPowerOn = 0x0020, + kIOPMNotAttainable = 0x0001, + kIOPMContextRetained = 0x2000, + kIOPMConfigRetained = 0x1000, + kIOPMStaticPowerValid = 0x0800, + kIOPMSoftSleep = 0x0400, + kIOPMCapabilitiesMask = kIOPMPowerOn | kIOPMDeviceUsable | + kIOPMMaxPerformance | kIOPMContextRetained | + kIOPMConfigRetained | kIOPMSleepCapability | + kIOPMRestartCapability +}; + +/* + * Support for old names of IOPMPowerFlag constants + */ +enum { + IOPMNotAttainable = kIOPMNotAttainable, + IOPMPowerOn = kIOPMPowerOn, + IOPMClockNormal = kIOPMClockNormal, + IOPMClockRunning = kIOPMClockRunning, + IOPMAuxPowerOn = kIOPMAuxPowerOn, + IOPMDeviceUsable = kIOPMDeviceUsable, + IOPMMaxPerformance = kIOPMMaxPerformance, + IOPMContextRetained = kIOPMContextRetained, + IOPMConfigRetained = kIOPMConfigRetained, + IOPMNotPowerManaged = kIOPMNotPowerManaged, + IOPMSoftSleep = kIOPMSoftSleep +}; + + +enum { + kIOPMNextHigherState = 1, + kIOPMHighestState = 2, + kIOPMNextLowerState = 3, + kIOPMLowestState = 4 +}; + +enum { + IOPMNextHigherState = kIOPMNextHigherState, + IOPMHighestState = kIOPMHighestState, + IOPMNextLowerState = kIOPMNextLowerState, + IOPMLowestState = kIOPMLowestState +}; + +// Internal commands used by power managment command queue +enum { + kIOPMBroadcastAggressiveness = 1, + kIOPMUnidleDevice +}; + +// Power consumption unknown value +enum { + kIOPMUnknown = 0xFFFF +}; + +/******************************************************************************* + * + * Root Domain property keys of interest + * + ******************************************************************************/ + +/* AppleClamshellState + * reflects the state of the clamshell (lid) on a portable. + * It has a boolean value. + * true == clamshell is closed + * false == clamshell is open + * not present == no clamshell on this hardware + */ +#define kAppleClamshellStateKey "AppleClamshellState" + +/* AppleClamshellCausesSleep + * reflects the clamshell close behavior on a portable. + * It has a boolean value. + * true == system will sleep when clamshell is closed + * false == system will not sleep on clamshell close + * (typically external display mode) + * not present == no clamshell on this hardware + */ +#define kAppleClamshellCausesSleepKey "AppleClamshellCausesSleep" + +/* kIOPMSleepWakeUUIDKey + * Key refers to a CFStringRef that will uniquely identify + * a sleep/wake cycle for logging & tracking. + * The key becomes valid at the beginning of a sleep cycle - before we + * initiate any sleep/wake notifications. + * The key becomes invalid at the completion of a system wakeup. The + * property will not be present in the IOPMrootDomain's registry entry + * when it is invalid. + * + * See IOPMrootDomain notification kIOPMMessageSleepWakeUUIDChange + */ + #define kIOPMSleepWakeUUIDKey "SleepWakeUUID" + +/******************************************************************************* + * + * Root Domain general interest messages + * + * Available by registering for interest type 'gIOGeneralInterest' + * on IOPMrootDomain. + * + ******************************************************************************/ + +/* kIOPMMessageClamshellStateChange + * Delivered as a general interest notification on the IOPMrootDomain + * IOPMrootDomain sends this message when state of either AppleClamshellState + * or AppleClamshellCausesSleep changes. If this clamshell change results in + * a sleep, the sleep will initiate soon AFTER delivery of this message. + * The state of both variables is encoded in a bitfield argument sent with + * the message. Check bits 0 and 1 using kClamshellStateBit & kClamshellSleepBit + */ +enum { + kClamshellStateBit = (1 << 0), + kClamshellSleepBit = (1 << 1) +}; + +#define kIOPMMessageClamshellStateChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x100) + +/* kIOPMMessageFeatureChange + * Delivered when the set of supported features ("Supported Features" dictionary + * under IOPMrootDomain registry) changes in some way. Typically addition or + * removal of a supported feature. + * RootDomain passes no argument with this message. + */ +#define kIOPMMessageFeatureChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x110) + +/* kIOPMMessageInflowDisableCancelled + * The battery has drained completely to its "Fully Discharged" state. + * If a user process has disabled battery inflow for battery + * calibration, we forcibly re-enable Inflow at this point. + * If inflow HAS been forcibly re-enabled, bit 0 + * (kInflowForciblyEnabledBit) will be set. + */ +enum { + kInflowForciblyEnabledBit = (1 << 0) +}; + +/* kIOPMMessageInternalBatteryFullyDischarged + * The battery has drained completely to its "Fully Discharged" state. + */ +#define kIOPMMessageInternalBatteryFullyDischarged \ + iokit_family_msg(sub_iokit_powermanagement, 0x120) + +/* kIOPMMessageSystemPowerEventOccurred + * Some major system thermal property has changed, and interested clients may + * modify their behavior. + */ +#define kIOPMMessageSystemPowerEventOccurred \ + iokit_family_msg(sub_iokit_powermanagement, 0x130) + +/* kIOPMMessageSleepWakeUUIDChange + * Either a new SleepWakeUUID has been specified at the beginning of a sleep, + * or we're removing the existing property upon completion of a wakeup. + */ +#define kIOPMMessageSleepWakeUUIDChange \ + iokit_family_msg(sub_iokit_powermanagement, 0x140) + +/* kIOPMMessageSleepWakeUUIDSet + * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when + * a new UUID has been specified. + */ +#define kIOPMMessageSleepWakeUUIDSet ((void *)1) + +/* kIOPMMessageSleepWakeUUIDCleared + * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when + * the current UUID has been removed. + */ +#define kIOPMMessageSleepWakeUUIDCleared ((void *)0) + +/******************************************************************************* + * + * Power commands issued to root domain + * Use with IOPMrootDomain::receivePowerNotification() + * + * These commands are issued from system drivers only: + * ApplePMU, AppleSMU, IOGraphics, AppleACPIFamily + * + ******************************************************************************/ +enum { + kIOPMSleepNow = (1<<0), // put machine to sleep now + kIOPMAllowSleep = (1<<1), // allow idle sleep + kIOPMPreventSleep = (1<<2), // do not allow idle sleep + kIOPMPowerButton = (1<<3), // power button was pressed + kIOPMClamshellClosed = (1<<4), // clamshell was closed + kIOPMPowerEmergency = (1<<5), // battery dangerously low + kIOPMDisableClamshell = (1<<6), // do not sleep on clamshell closure + kIOPMEnableClamshell = (1<<7), // sleep on clamshell closure + kIOPMProcessorSpeedChange = (1<<8), // change the processor speed + kIOPMOverTemp = (1<<9), // system dangerously hot + kIOPMClamshellOpened = (1<<10) // clamshell was opened +}; + + +/******************************************************************************* + * + * Power Management Return Codes + * + ******************************************************************************/ +enum { + kIOPMNoErr = 0, + + // Returned by driver's setPowerState(), powerStateWillChangeTo(), + // powerStateDidChangeTo(), or acknowledgeSetPowerState() to + // implicitly acknowledge power change upon function return. + kIOPMAckImplied = 0, + + // Deprecated + kIOPMWillAckLater = 1, + + // Returned by requestPowerDomainState() to indicate + // unrecognized specification parameter. + kIOPMBadSpecification = 4, + + // Returned by requestPowerDomainState() to indicate + // no power state matches search specification. + kIOPMNoSuchState = 5, + + // Deprecated + kIOPMCannotRaisePower = 6, + + // Deprecated + kIOPMParameterError = 7, + + // Returned when power management state is accessed + // before driver has called PMinit(). + kIOPMNotYetInitialized = 8, + + // And the old constants; deprecated + IOPMNoErr = kIOPMNoErr, + IOPMAckImplied = kIOPMAckImplied, + IOPMWillAckLater = kIOPMWillAckLater, + IOPMBadSpecification = kIOPMBadSpecification, + IOPMNoSuchState = kIOPMNoSuchState, + IOPMCannotRaisePower = kIOPMCannotRaisePower, + IOPMParameterError = kIOPMParameterError, + IOPMNotYetInitialized = kIOPMNotYetInitialized +}; + + +// IOPMPowerSource class descriptive strings +// Power Source state is published as properties to the IORegistry under these +// keys. +#define kIOPMPSExternalConnectedKey "ExternalConnected" +#define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable" +#define kIOPMPSBatteryInstalledKey "BatteryInstalled" +#define kIOPMPSIsChargingKey "IsCharging" +#define kIOPMFullyChargedKey "FullyCharged" +#define kIOPMPSAtWarnLevelKey "AtWarnLevel" +#define kIOPMPSAtCriticalLevelKey "AtCriticalLevel" +#define kIOPMPSCurrentCapacityKey "CurrentCapacity" +#define kIOPMPSMaxCapacityKey "MaxCapacity" +#define kIOPMPSDesignCapacityKey "DesignCapacity" +#define kIOPMPSTimeRemainingKey "TimeRemaining" +#define kIOPMPSAmperageKey "Amperage" +#define kIOPMPSVoltageKey "Voltage" +#define kIOPMPSCycleCountKey "CycleCount" +#define kIOPMPSMaxErrKey "MaxErr" +#define kIOPMPSAdapterInfoKey "AdapterInfo" +#define kIOPMPSLocationKey "Location" +#define kIOPMPSErrorConditionKey "ErrorCondition" +#define kIOPMPSManufacturerKey "Manufacturer" +#define kIOPMPSManufactureDateKey "ManufactureDate" +#define kIOPMPSModelKey "Model" +#define kIOPMPSSerialKey "Serial" +#define kIOPMDeviceNameKey "DeviceName" +#define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo" +#define kIOPMPSBatteryHealthKey "BatteryHealth" +#define kIOPMPSHealthConfidenceKey "HealthConfidence" +#define kIOPMPSCapacityEstimatedKey "CapacityEstimated" +#define kIOPMPSBatteryChargeStatusKey "ChargeStatus" +#define kIOPMPSBatteryTemperatureKey "Temperature" + +// kIOPMPSBatteryChargeStatusKey may have one of the following values, or may have +// no value. If kIOPMBatteryChargeStatusKey has a NULL value (or no value) associated with it +// then charge is proceeding normally. If one of these battery charge status reasons is listed, +// then the charge may have been interrupted. +#define kIOPMBatteryChargeStatusTooHot "HighTemperature" +#define kIOPMBatteryChargeStatusTooCold "LowTemperature" +#define kIOPMBatteryChargeStatusGradient "BatteryTemperatureGradient" + +// Definitions for battery location, in case of multiple batteries. +// A location of 0 is unspecified +// Location is undefined for single battery systems +enum { + kIOPMPSLocationLeft = 1001, + kIOPMPSLocationRight = 1002 +}; + +// Battery quality health types, specified by BatteryHealth and HealthConfidence +// properties in an IOPMPowerSource battery kext. +enum { + kIOPMUndefinedValue = 0, + kIOPMPoorValue = 1, + kIOPMFairValue = 2, + kIOPMGoodValue = 3 +}; + +// Battery's time remaining estimate is invalid this long (seconds) after a wake +#define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds" + +// Battery must wait this long (seconds) after being completely charged before +// the battery is settled. +#define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds" + +// Battery must wait this long (seconds) after being completely discharged +// before the battery is settled. +#define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds" + + +/* CPU Power Management status keys + * Pass as arguments to IOPMrootDomain::systemPowerEventOccurred + * Or as arguments to IOPMSystemPowerEventOccurred() + * Or to decode the dictionary obtained from IOPMCopyCPUPowerStatus() + * These keys reflect restrictions placed on the CPU by the system + * to bring the CPU's power consumption within allowable thermal and + * power constraints. + */ + + +/* kIOPMGraphicsPowerLimitsKey + * The key representing the dictionary of graphics power limits. + * The dictionary contains the other kIOPMCPUPower keys & their associated + * values (e.g. Speed limit, Processor Count, and Schedule limits). + */ +#define kIOPMGraphicsPowerLimitsKey "Graphics_Power_Limits" + +/* kIOPMGraphicsPowerLimitPerformanceKey + * The key representing the percent of overall performance made available + * by the graphics chip as a percentage (integer 0 - 100). + */ +#define kIOPMGraphicsPowerLimitPerformanceKey "Graphics_Power_Performance" + + + +/* kIOPMCPUPowerLimitsKey + * The key representing the dictionary of CPU Power Limits. + * The dictionary contains the other kIOPMCPUPower keys & their associated + * values (e.g. Speed limit, Processor Count, and Schedule limits). + */ +#define kIOPMCPUPowerLimitsKey "CPU_Power_Limits" + +/* kIOPMCPUPowerLimitProcessorSpeedKey defines the speed & voltage limits placed + * on the CPU. + * Represented as a percentage (0-100) of maximum CPU speed. + */ +#define kIOPMCPUPowerLimitProcessorSpeedKey "CPU_Speed_Limit" + +/* kIOPMCPUPowerLimitProcessorCountKey reflects how many, if any, CPUs have been + * taken offline. Represented as an integer number of CPUs (0 - Max CPUs). + */ +#define kIOPMCPUPowerLimitProcessorCountKey "CPU_Available_CPUs" + +/* kIOPMCPUPowerLimitSchedulerTimeKey represents the percentage (0-100) of CPU time + * available. 100% at normal operation. The OS may limit this time for a percentage + * less than 100%. + */ +#define kIOPMCPUPowerLimitSchedulerTimeKey "CPU_Scheduler_Limit" + + +/* Thermal Level Warning Key + * Indicates the thermal constraints placed on the system. This value may + * cause clients to action to consume fewer system resources. + * The value associated with this warning is defined by the platform. + */ +#define kIOPMThermalLevelWarningKey "Thermal_Level_Warning" + +/* Thermal Warning Level values + * kIOPMThermalWarningLevelNormal - under normal operating conditions + * kIOPMThermalWarningLevelDanger - thermal pressure may cause system slowdown + * kIOPMThermalWarningLevelCrisis - thermal conditions may cause imminent shutdown + * + * The platform may define additional thermal levels if necessary. + */ +enum { + kIOPMThermalWarningLevelNormal = 0, + kIOPMThermalWarningLevelDanger = 5, + kIOPMThermalWarningLevelCrisis = 10 +}; + + +// PM Settings Controller setting types +// Settings types used primarily with: +// IOPMrootDomain::registerPMSettingController +// The values are identical to the similarly named keys for use in user space +// PM settings work. Those keys are defined in IOPMLibPrivate.h. +#define kIOPMSettingWakeOnRingKey "Wake On Modem Ring" +#define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss" +#define kIOPMSettingWakeOnACChangeKey "Wake On AC Change" +#define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button" +#define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open" +#define kIOPMSettingReduceBrightnessKey "ReduceBrightness" +#define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim" +#define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds" +#define kIOPMSettingMobileMotionModuleKey "MobileMotionModule" +#define kIOPMSettingGraphicsSwitchKey "GPUSwitch" + +// Setting controlling drivers can register to receive scheduled wake data +// Either in "CF seconds" type, or structured calendar data in a formatted +// IOPMCalendarStruct defined below. +#define kIOPMSettingAutoWakeSecondsKey "wake" +#define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate" +#define kIOPMSettingAutoPowerSecondsKey "poweron" +#define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate" + +// Debug seconds auto wake +// Used by sleep cycling debug tools +#define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep" +#define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown" + +// Maintenance wake calendar. +#define kIOPMSettingMaintenanceWakeCalendarKey "MaintenanceWakeCalendarDate" + +struct IOPMCalendarStruct { + UInt32 year; + UInt8 month; + UInt8 day; + UInt8 hour; + UInt8 minute; + UInt8 second; +}; +typedef struct IOPMCalendarStruct IOPMCalendarStruct; + +// SetAggressiveness types +enum { + kPMGeneralAggressiveness = 0, + kPMMinutesToDim, + kPMMinutesToSpinDown, + kPMMinutesToSleep, + kPMEthernetWakeOnLANSettings, + kPMSetProcessorSpeed, + kPMPowerSource, + kPMMotionSensor, + kPMLastAggressivenessType +}; +#define kMaxType (kPMLastAggressivenessType-1) + +// SetAggressiveness values for the kPMPowerSource aggressiveness type +enum { + kIOPMInternalPower = 1, + kIOPMExternalPower +}; + +#define kIOREMSleepEnabledKey "REMSleepEnabled" + +// Strings for deciphering the dictionary returned from IOPMCopyBatteryInfo +#define kIOBatteryInfoKey "IOBatteryInfo" +#define kIOBatteryCurrentChargeKey "Current" +#define kIOBatteryCapacityKey "Capacity" +#define kIOBatteryFlagsKey "Flags" +#define kIOBatteryVoltageKey "Voltage" +#define kIOBatteryAmperageKey "Amperage" +#define kIOBatteryCycleCountKey "Cycle Count" + +enum { + kIOBatteryInstalled = (1 << 2), + kIOBatteryCharge = (1 << 1), + kIOBatteryChargerConnect = (1 << 0) +}; + + +// Private power management message indicating battery data has changed +// Indicates new data resides in the IORegistry +#define kIOPMMessageBatteryStatusHasChanged iokit_family_msg(sub_iokit_pmu, 0x100) + +// Apple private Legacy messages for re-routing AutoWake and AutoPower messages to the PMU +// through newer user space IOPMSchedulePowerEvent API +#define kIOPMUMessageLegacyAutoWake iokit_family_msg(sub_iokit_pmu, 0x200) +#define kIOPMUMessageLegacyAutoPower iokit_family_msg(sub_iokit_pmu, 0x210) + +// For use with IOPMPowerSource bFlags +#define IOPM_POWER_SOURCE_REV 2 +enum { + kIOPMACInstalled = kIOBatteryChargerConnect, + kIOPMBatteryCharging = kIOBatteryCharge, + kIOPMBatteryInstalled = kIOBatteryInstalled, + kIOPMUPSInstalled = (1<<3), + kIOPMBatteryAtWarn = (1<<4), + kIOPMBatteryDepleted = (1<<5), + kIOPMACnoChargeCapability = (1<<6), // AC adapter cannot charge battery + kIOPMRawLowBattery = (1<<7), // used only by Platform Expert + kIOPMForceLowSpeed = (1<<8), // set by Platfm Expert, chk'd by Pwr Plugin + kIOPMClosedClamshell = (1<<9), // set by PMU - reflects state of the clamshell + kIOPMClamshellStateOnWake = (1<<10) // used only by Platform Expert +}; + + +// ********************************************** +// Internal power management data structures +// ********************************************** + +#if KERNEL && __cplusplus +class IOService; + +enum { + kIOPowerEmergencyLevel = 1000 +}; + +enum { + kIOPMSubclassPolicy, + kIOPMSuperclassPolicy1 +}; + +struct stateChangeNote{ + IOPMPowerFlags stateFlags; + unsigned long stateNum; + void * powerRef; +}; +typedef struct stateChangeNote stateChangeNote; + +struct IOPowerStateChangeNotification { + void * powerRef; + unsigned long returnValue; + unsigned long stateNumber; + IOPMPowerFlags stateFlags; +}; +typedef struct IOPowerStateChangeNotification IOPowerStateChangeNotification; +typedef IOPowerStateChangeNotification sleepWakeNote; +#endif /* KERNEL && __cplusplus */ + +#endif /* ! _IOKIT_IOPM_H */ + diff --git a/i386/include/IOKit/pwr_mgt/IOPMDeprecated.h b/i386/include/IOKit/pwr_mgt/IOPMDeprecated.h new file mode 100644 index 0000000..3bee01a --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPMDeprecated.h @@ -0,0 +1,177 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPMDeprecated_h_ +#define _IOPMDeprecated_h_ + +#ifdef __ppc__ + +// Power events +enum { + kClamshellClosedEventMask = (1<<0), // User closed lid + kDockingBarEventMask = (1<<1), // OBSOLETE + kACPlugEventMask = (1<<2), // User plugged or unplugged adapter + kFrontPanelButtonEventMask = (1<<3), // User hit the front panel button + kBatteryStatusEventMask = (1<<4) // Battery status has changed +}; + +// PUBLIC power management features +// NOTE: this is a direct port from classic, some of these bits +// are obsolete but are included for completeness +enum { + kPMHasWakeupTimerMask = (1<<0), // 1=wake timer is supported + kPMHasSharedModemPortMask = (1<<1), // Not used + kPMHasProcessorCyclingMask = (1<<2), // 1=processor cycling supported + kPMMustProcessorCycleMask = (1<<3), // Not used + kPMHasReducedSpeedMask = (1<<4), // 1=supports reduced processor speed + kPMDynamicSpeedChangeMask = (1<<5), // 1=supports changing processor speed on the fly + kPMHasSCSIDiskModeMask = (1<<6), // 1=supports using machine as SCSI drive + kPMCanGetBatteryTimeMask = (1<<7), // 1=battery time can be calculated + kPMCanWakeupOnRingMask = (1<<8), // 1=machine can wake on modem ring + kPMHasDimmingSupportMask = (1<<9), // 1=has monitor dimming support + kPMHasStartupTimerMask = (1<<10), // 1=can program startup timer + kPMHasChargeNotificationMask = (1<<11), // 1=client can determine charger status/get notifications + kPMHasDimSuspendSupportMask = (1<<12), // 1=can dim diplay to DPMS ('off') state + kPMHasWakeOnNetActivityMask = (1<<13), // 1=supports waking upon receipt of net packet + kPMHasWakeOnLidMask = (1<<14), // 1=can wake upon lid/case opening + kPMCanPowerOffPCIBusMask = (1<<15), // 1=can remove power from PCI bus on sleep + kPMHasDeepSleepMask = (1<<16), // 1=supports deep (hibernation) sleep + kPMHasSleepMask = (1<<17), // 1=machine support low power sleep (ala powerbooks) + kPMSupportsServerModeAPIMask = (1<<18), // 1=supports reboot on AC resume for unexpected power loss + kPMHasUPSIntegrationMask = (1<<19) // 1=supports incorporating UPS devices into power source calcs +}; + +// PRIVATE power management features +// NOTE: this is a direct port from classic, some of these bits +// are obsolete but are included for completeness. +enum { + kPMHasExtdBattInfoMask = (1<<0), // Not used + kPMHasBatteryIDMask = (1<<1), // Not used + kPMCanSwitchPowerMask = (1<<2), // Not used + kPMHasCelsiusCyclingMask = (1<<3), // Not used + kPMHasBatteryPredictionMask = (1<<4), // Not used + kPMHasPowerLevelsMask = (1<<5), // Not used + kPMHasSleepCPUSpeedMask = (1<<6), // Not used + kPMHasBtnIntHandlersMask = (1<<7), // 1=supports individual button interrupt handlers + kPMHasSCSITermPowerMask = (1<<8), // 1=supports SCSI termination power switch + kPMHasADBButtonHandlersMask = (1<<9), // 1=supports button handlers via ADB + kPMHasICTControlMask = (1<<10), // 1=supports ICT control + kPMHasLegacyDesktopSleepMask = (1<<11), // 1=supports 'doze' style sleep + kPMHasDeepIdleMask = (1<<12), // 1=supports Idle2 in hardware + kPMOpenLidPreventsSleepMask = (1<<13), // 1=open case prevent machine from sleeping + kPMClosedLidCausesSleepMask = (1<<14), // 1=case closed (clamshell closed) causes sleep + kPMHasFanControlMask = (1<<15), // 1=machine has software-programmable fan/thermostat controls + kPMHasThermalControlMask = (1<<16), // 1=machine supports thermal monitoring + kPMHasVStepSpeedChangeMask = (1<<17), // 1=machine supports processor voltage/clock change + kPMEnvironEventsPolledMask = (1<<18) // 1=machine doesn't generate pmu env ints, we must poll instead +}; + +// DEFAULT public and private features for machines whose device tree +// does NOT contain this information (pre-Core99). + +// For Cuda-based Desktops + +#define kStdDesktopPMFeatures kPMHasWakeupTimerMask |\ + kPMHasProcessorCyclingMask |\ + kPMHasDimmingSupportMask |\ + kPMHasStartupTimerMask |\ + kPMSupportsServerModeAPIMask |\ + kPMHasUPSIntegrationMask + +#define kStdDesktopPrivPMFeatures kPMHasExtdBattInfoMask |\ + kPMHasICTControlMask |\ + kPMHasLegacyDesktopSleepMask + +#define kStdDesktopNumBatteries 0 + +// For Wallstreet (PowerBook G3 Series 1998) + +#define kWallstreetPMFeatures kPMHasWakeupTimerMask |\ + kPMHasProcessorCyclingMask |\ + kPMHasReducedSpeedMask |\ + kPMDynamicSpeedChangeMask |\ + kPMHasSCSIDiskModeMask |\ + kPMCanGetBatteryTimeMask |\ + kPMHasDimmingSupportMask |\ + kPMHasChargeNotificationMask |\ + kPMHasDimSuspendSupportMask |\ + kPMHasSleepMask + +#define kWallstreetPrivPMFeatures kPMHasExtdBattInfoMask |\ + kPMHasBatteryIDMask |\ + kPMCanSwitchPowerMask |\ + kPMHasADBButtonHandlersMask |\ + kPMHasSCSITermPowerMask |\ + kPMHasICTControlMask |\ + kPMClosedLidCausesSleepMask |\ + kPMEnvironEventsPolledMask + +#define kStdPowerBookPMFeatures kWallstreetPMFeatures +#define kStdPowerBookPrivPMFeatures kWallstreetPrivPMFeatures + +#define kStdPowerBookNumBatteries 2 + +// For 101 (PowerBook G3 Series 1999) + +#define k101PMFeatures kPMHasWakeupTimerMask |\ + kPMHasProcessorCyclingMask |\ + kPMHasReducedSpeedMask |\ + kPMDynamicSpeedChangeMask |\ + kPMHasSCSIDiskModeMask |\ + kPMCanGetBatteryTimeMask |\ + kPMHasDimmingSupportMask |\ + kPMHasChargeNotificationMask |\ + kPMHasDimSuspendSupportMask |\ + kPMHasSleepMask |\ + kPMHasUPSIntegrationMask + +#define k101PrivPMFeatures kPMHasExtdBattInfoMask |\ + kPMHasBatteryIDMask |\ + kPMCanSwitchPowerMask |\ + kPMHasADBButtonHandlersMask |\ + kPMHasSCSITermPowerMask |\ + kPMHasICTControlMask |\ + kPMClosedLidCausesSleepMask |\ + kPMEnvironEventsPolledMask + + +// These flags are deprecated. Use the version with the kIOPM prefix in IOPM.h +enum { + kACInstalled = (1<<0), + kBatteryCharging = (1<<1), + kBatteryInstalled = (1<<2), + kUPSInstalled = (1<<3), + kBatteryAtWarn = (1<<4), + kBatteryDepleted = (1<<5), + kACnoChargeCapability = (1<<6), // AC adapter cannot charge battery + kRawLowBattery = (1<<7), // used only by Platform Expert + kForceLowSpeed = (1<<8) // set by Platfm Expert, chk'd by Pwr Plugin}; +}; + +#endif /* __ppc32 */ +#endif /* _IOPMDeprecated_h_ */ diff --git a/i386/include/IOKit/pwr_mgt/IOPMLibDefs.h b/i386/include/IOKit/pwr_mgt/IOPMLibDefs.h new file mode 100644 index 0000000..ff25bf3 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPMLibDefs.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + + +#define kPMSetAggressiveness 0 +#define kPMGetAggressiveness 1 +#define kPMSleepSystem 2 +#define kPMAllowPowerChange 3 +#define kPMCancelPowerChange 4 +#define kPMShutdownSystem 5 +#define kPMRestartSystem 6 +#define kPMSleepSystemOptions 7 +#define kPMSetMaintenanceWakeCalendar 8 + +#define kNumPMMethods 9 diff --git a/i386/include/IOKit/pwr_mgt/IOPMPowerSource.h b/i386/include/IOKit/pwr_mgt/IOPMPowerSource.h new file mode 100644 index 0000000..ed68918 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPMPowerSource.h @@ -0,0 +1,300 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOPMPowerSource_h_ +#define _IOPMPowerSource_h_ + +#include +#include +#include +#include +#include + +enum { + kSecondsPerHour = 3600, + kTenMinutesInSeconds = 600 +}; + +/* class IOPMPowerSource + * + * See IOKit/pwr_mgt/IOPM.h for power source keys relevant to this class. These + * report-type keys are required for calls to IOPMPowerSource::setReportables(), + * and they define the IORegistry interface through which data is passed back + * up to the rest of the system. + * + * A subclassing driver that doesn't want to do anything fancy should: + * 1. Subclass IOPMPowerSource + * 3. Install its own battery change notifications or polling routine that can + * converse with actual battery hardware. + * 4. When battery state changes, change the relevant member variables + * through setCurrentCapacity() style accessors. + * 5. Call updateStatus() on itself when all such settings have been updated. + * + * The subclass driver should also initially populate its settings and call + * updateStatus() on launch. + * + * + * Settings + * + * ExternalConnected + * Type: bool + * IORegistry Key: kIOPMPSExternalConnectedKey + * True if computer is drawing external power + * + * ExternalChargeCapable + * Type: bool + * IORegistry Key: kIOPMPSExternalChargeCapableKey + * True if external power is capable of charging internal battery + * + * BatteryInstalled + * Type: bool + * IORegistry Key: kIOPMPSBatteryInstalledKey + * True if a battery is present; false if removed + * + * IsCharging + * Type: bool + * IORegistry Key: kIOPMPSIsChargingKey + * True if battery is charging itself from external power + * + * AtWarnLevel + * Type: bool + * IORegistry Key: kIOPMPSAtWarnLevelKey + * True if draining battery capacity and past warn level + * + * AtCriticalLevel + * Type: bool + * IORegistry Key: kIOPMPSAtCriticalLevelKey + * True if draining battery capacity and past critical level + * + * CurrentCapacity + * MaxCapacity + * Type: unsigned int + * IORegistry Key: kIOPMPSCurrentCapacityKey, kIOPMPSMaxCapacityKey + * Capacity measured in mAh + * + * TimeRemaining + * Type: int + * IORegistry Key: kIOPMPSTimeRemainingKey + * Time remaining measured in minutes + * + * Amperage + * Type: int + * IORegistry Key: kIOPMPSAmperageKey + * Current is measured in mA + * + * Voltage + * Type: unsigned int + * IORegistry Key: kIOPMPSVoltageKey + * Voltage measured in mV + * + * CycleCount + * Type: unsigned int + * IORegistry Key: kIOPMPSCycleCountKey + * Number of charge/discharge cycles + * + * AdapterInfo + * Type: int + * IORegistry Key: kIOPMPSAdapterInfoKey + * Power adapter information + * + * Location + * Type: int + * IORegistry Key: kIOPMPSLocationKey + * Clue about battery's location in machine - Left vs. Right + * + * ErrorCondition + * Type: OSSymbol + * IORegistry Key: kIOPMPSErrorConditionKey + * String describing error state of battery + * + * Manufacturer + * Type: OSSymbol + * IORegistry Key: kIOPMPSManufacturerKey + * String describing battery manufacturer + * + * Manufactured Date + * Type: unsigned 16-bit bitfield + * IORegistry Key: kIOPMPSManufactureDateKey + * Date is published in a bitfield per the Smart Battery Data spec rev 1.1 + * in section 5.1.26 + * Bits 0...4 => day (value 1-31; 5 bits) + * Bits 5...8 => month (value 1-12; 4 bits) + * Bits 9...15 => years since 1980 (value 0-127; 7 bits) + * + * Model + * Type: OSSymbol + * IORegistry Key: kIOPMPSModelKey + * String describing model number + * + * Serial + * Type: OSSymbol + * IORegistry Key: kIOPMPSSerialKey + * String describing serial number or unique info + * The serial number published hear bears no correspondence to the Apple serial + * number printed on each battery. This is a manufacturer serial number with + * no correlation to the printed serial number. + * + * LegacyIOBatteryInfo + * Type: OSDictionary + * IORegistry Key: kIOPMPSLegacyBatteryInfoKey + * Dictionary conforming to the OS X 10.0-10.4 + */ + +class IOPMPowerSource : public IOService +{ + OSDeclareDefaultStructors(IOPMPowerSource) + + friend class IOPMPowerSourceList; + + protected: + +/* bool settingsChangedSinceLastUpdate + * Used by subclasses to determine if any settings have been modified via the + * accessors below since last call to update(). true is settings have changed; + * false otherwise. + */ + bool settingsChangedSinceUpdate; + +/* OSDictionary properties + * Stores power source state + */ + OSDictionary *properties; + + const OSSymbol *externalConnectedKey; + const OSSymbol *externalChargeCapableKey; + const OSSymbol *batteryInstalledKey; + const OSSymbol *chargingKey; + const OSSymbol *warnLevelKey; + const OSSymbol *criticalLevelKey; + const OSSymbol *currentCapacityKey; + const OSSymbol *maxCapacityKey; + const OSSymbol *timeRemainingKey; + const OSSymbol *amperageKey; + const OSSymbol *voltageKey; + const OSSymbol *cycleCountKey; + const OSSymbol *adapterInfoKey; + const OSSymbol *locationKey; + const OSSymbol *errorConditionKey; + const OSSymbol *manufacturerKey; + const OSSymbol *modelKey; + const OSSymbol *serialKey; + const OSSymbol *batteryInfoKey; + + // Tracking for IOPMPowerSourceList + IOPMPowerSource *nextInList; + + public: + +/*! @function powerSource + @abstract Creates a new IOPMPowerSource nub. Must be attached to IORegistry, + and registered by provider. +*/ + static IOPMPowerSource *powerSource(void); + + virtual bool init(void); + + virtual void free(void); + +/*! @function updateStatus + @abstract Must be called by physical battery controller when battery state + has changed significantly. + @discussion The system will not poll this object for battery updates. Rather \ + the battery's controller must call updateStatus() every time state changes \ + and the settings will be relayed to higher levels of power management. \ + The subclassing driver should override this only if the driver needs to add \ + new settings to the base class. +*/ + virtual void updateStatus(void); + +/* Public accessors for battery state + */ + bool externalConnected(void); + bool externalChargeCapable(void); + bool batteryInstalled(void); + bool isCharging(void); + bool atWarnLevel(void); + bool atCriticalLevel(void); + + unsigned int currentCapacity(void); + unsigned int maxCapacity(void); + unsigned int capacityPercentRemaining(void); + int timeRemaining(void); + int amperage(void); + unsigned int voltage(void); + unsigned int cycleCount(void); + int adapterInfo(void); + int location(void); + + OSSymbol *errorCondition(void); + OSSymbol *manufacturer(void); + OSSymbol *model(void); + OSSymbol *serial(void); + OSDictionary *legacyIOBatteryInfo(void); + + OSObject *getPSProperty(const OSSymbol *); + +protected: + +/* Protected "setter" methods for subclasses + * Subclasses should use these setters to modify all battery properties. + * + * Subclasses must follow all property changes with a call to updateStatus() + * to flush settings changes to upper level battery API clients. + * + */ + void setExternalConnected(bool); + void setExternalChargeCapable(bool); + void setBatteryInstalled(bool); + void setIsCharging(bool); + void setAtWarnLevel(bool); + void setAtCriticalLevel(bool); + + void setCurrentCapacity(unsigned int); + void setMaxCapacity(unsigned int); + void setTimeRemaining(int); + void setAmperage(int); + void setVoltage(unsigned int); + void setCycleCount(unsigned int); + void setAdapterInfo(int); + void setLocation(int); + + void setErrorCondition(OSSymbol *); + void setManufacturer(OSSymbol *); + void setModel(OSSymbol *); + void setSerial(OSSymbol *); + void setLegacyIOBatteryInfo(OSDictionary *); + +/* All of these methods funnel through the generic accessor method + setPSProperty. Caller can pass in any arbitrary OSSymbol key, and + that value will be stored in the PM settings dictionary, and relayed + onto the IORegistry at update time. + */ + void setPSProperty(const OSSymbol *, OSObject *); +}; + +#endif diff --git a/i386/include/IOKit/pwr_mgt/IOPMPowerSourceList.h b/i386/include/IOKit/pwr_mgt/IOPMPowerSourceList.h new file mode 100644 index 0000000..cb1c8ea --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPMPowerSourceList.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 1998-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#include +#include + +class IOPMPowerSource; + +class IOPMPowerSourceList : public OSObject +{ + OSDeclareDefaultStructors(IOPMPowerSourceList) + private: + // pointer to first power source in list + IOPMPowerSource *firstItem; + + // how many power sources are in the list + unsigned long length; + + public: + void initialize(void); + void free(void); + + unsigned long numberOfItems(void); + IOReturn addToList(IOPMPowerSource *newPowerSource); + IOReturn removeFromList(IOPMPowerSource *theItem); + + IOPMPowerSource *firstInList(void); + IOPMPowerSource *nextInList(IOPMPowerSource *currentItem); +}; + diff --git a/i386/include/IOKit/pwr_mgt/IOPMPrivate.h b/i386/include/IOKit/pwr_mgt/IOPMPrivate.h new file mode 100644 index 0000000..bf50d78 --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPMPrivate.h @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_IOPMPRIVATE_H +#define _IOKIT_IOPMPRIVATE_H + +#include + +/*****************************************************************************/ + +// Private power commands issued to root domain +// bits 0-7 in IOPM.h + +enum { + kIOPMSetValue = (1<<16), + // don't sleep on clamshell closure on a portable with AC connected + kIOPMSetDesktopMode = (1<<17), + // set state of AC adaptor connected + kIOPMSetACAdaptorConnected = (1<<18) +}; + +/*****************************************************************************/ +/*****************************************************************************/ + +/* + * PM notification types + */ + +/* @constant kIOPMStateConsoleUserShutdown + * @abstract Notification of GUI shutdown state available to kexts. + * @discussion This type can be passed as arguments to registerPMSettingController() + * to receive callbacks. + */ +#define kIOPMStateConsoleShutdown "ConsoleShutdown" + +/* @enum ShutdownValues + * @abstract Potential values shared with key kIOPMStateConsoleUserShutdown + */ +enum { +/* @constant kIOPMStateConsoleShutdownNone + * @abstract System shutdown (or restart) hasn't started; system is ON. + * @discussion Next state: 2 + */ + kIOPMStateConsoleShutdownNone = 1, +/* @constant kIOPMStateConsoleShutdownPossible + * @abstract User has been presented with the option to shutdown or restart. Shutdown may be cancelled. + * @discussion Next state may be: 1, 4 + */ + kIOPMStateConsoleShutdownPossible = 2, +/* @constant kIOPMStateConsoleShutdownUnderway + * @abstract Shutdown or restart is proceeding. It may still be cancelled. + * @discussion Next state may be: 1, 4. This state is currently unused. + */ + kIOPMStateConsoleShutdownUnderway = 3, +/* @constant kIOPMStateConsoleShutdownCertain + * @abstract Shutdown is in progress and irrevocable. + * @discussion State remains 4 until power is removed from CPU. + */ + kIOPMStateConsoleShutdownCertain = 4 +}; + +/*****************************************************************************/ +/*****************************************************************************/ + +/* PM Statistics - event indices + * These are arguments to IOPMrootDomain::pmStatsRecordEvent(). + */ +enum { + kIOPMStatsHibernateImageWrite = 1, + kIOPMStatsHibernateImageRead, + kIOPMStatsDriversNotify, + kIOPMStatsApplicationNotify, + kIOPMStatsLateDriverAcknowledge, + kIOPMStatsLateAppAcknowledge, + + // To designate if you're specifying the start or stop end of + // each of the above events, do a bitwise OR of the appropriate + // Start/Stop flag and pass the result to IOPMrootDomain to record + // the event. + kIOPMStatsEventStartFlag = (1 << 24), + kIOPMStatsEventStopFlag = (1 << 25) +}; + +// Keys for IOPMrootDomain registry properties +#define kIOPMSleepStatisticsKey "SleepStatistics" +#define kIOPMSleepStatisticsAppsKey "AppStatistics" + +// Application response statistics +#define kIOPMStatsNameKey "Name" +#define kIOPMStatsPIDKey "Pid" +#define kIOPMStatsTimeMSKey "TimeMS" +#define kIOPMStatsApplicationResponseTypeKey "ResponseType" +#define kIOPMStatsMessageTypeKey "MessageType" + +// PM Statistics: potential values for the key kIOPMStatsApplicationResponseTypeKey +// entry in the application results array. +#define kIOPMStatsResponseTimedOut "ResponseTimedOut" +#define kIOPMStatsResponseCancel "ResponseCancel" +#define kIOPMStatsResponseSlow "ResponseSlow" + +typedef struct { + struct bounds{ + uint64_t start; + uint64_t stop; + }; + + struct bounds hibWrite; + struct bounds hibRead; +// bounds driverNotifySleep; +// bounds driverNotifyWake; +// bounds appNotifySleep; +// bounds appNotifyWake; +// OSDictionary *tardyApps; +// OSDictionary *tardyDrivers; +} PMStatsStruct; + +/*****************************************************************************/ + +/* PM RootDomain tracePoints + * + * In the sleep/wake process, we expect the sleep trace points to proceed + * in increasing order. Once sleep begins with code kIOPMTracePointSleepStarted = 0x11, + * we expect sleep to continue in a monotonically increasing order of tracepoints + * to kIOPMTracePointSystemLoginwindowPhase = 0x30. After trace point SystemLoginWindowPhase, + * the system will return to kIOPMTracePointSystemUp = 0x00. + * + * If the trace point decreases (instead of increasing) before reaching kIOPMTracePointSystemUp, + * that indicates that the sleep process was cancelled. The cancel reason shall be indicated + * in the cancel tracepoint. (TBD) + */ + +enum { +/* When kTracePointSystemUp is the latest tracePoint, + the system is awake. It is not asleep, sleeping, or waking. + + * Phase begins: At boot, at completion of wake from sleep, + immediately following kIOPMTracePointSystemLoginwindowPhase. + * Phase ends: When a sleep attempt is initiated. + */ + kIOPMTracePointSystemUp = 0, + +/* When kIOPMTracePointSleepStarted we have just initiated sleep. + + Note: The state prior to kIOPMTracePointSleepStarted may be only one of: + * kIOPMTracePointSystemUp + * kIOPMTracePointSystemLoginwindowPhase or + + * Phase begins: At initiation of system sleep (idle or forced). + * Phase ends: As we start to notify applications of system sleep. + */ + kIOPMTracePointSleepStarted = 0x11, + +/* When kTracePointSystemSleepAppsPhase is the latest tracePoint, + a system sleep has been irrevocably inititated and PM waits + for responses from notified applications. + + * Phase begins: Begin to asynchronously fire kIOMessageSystemWillSleep notifications, + * and in the case of an idle sleep kIOMessageCanSystemSleep as well. + * Phase ends: When we have received all user & interested kernel acknowledgements. + */ + kIOPMTracePointSystemSleepAppsPhase = 0x12, + + +/* When kIOPMTracePointSystemHibernatePhase is the latest tracePoint, + PM is writing the hiernate image to disk. + */ + kIOPMTracePointSystemHibernatePhase = 0x13, + +/* When kTracePointSystemSleepDriversPhase is the latest tracePoint, + PM is iterating the driver tree powering off devices individually. + + * Phase begins: When IOPMrootDomain has received all of its power acknowledgements and begins + * executing IOService::powerDomainWillChangeTo() + * Phase ends: When IOPMrootDomain::powerChangeDone begins executing CPU shutoff code. + */ + kIOPMTracePointSystemSleepDriversPhase = 0x14, + +/* When kTracePointSystemSleepPlatformPhase is the latest tracePoint, + all apps and drivers have notified of sleep. Plotfarm is powering + off CPU; or system is asleep; or low level wakeup is underway. + + Note: If a system is asleep and then loses power, and it does not have a hibernate + image to restore from (e.g. hibernatemode = 0), then OS X may interpret this power + loss as a system crash in the kTracePointSystemSleepPlatformPhase, since the + power loss resembles a hang or crash, and the power being removed by the user. + + * Phase begins: IOPMrootDomain has already shut off drivers, and is now powering off CPU. + * Phase ends: Immediately after CPU's are powered back on during wakeup. + */ + kIOPMTracePointSystemSleepPlatformPhase = 0x15, + +/* When kTracePointSystemWakeDriversPhase is the latest tracePoint, + System CPU is powered, PM is notifying drivers of system wake. + + * Phase begins: CPU's have successfully powered up and OS is executing. + * Phase ends: All drivers have handled power events & acknowledged completion. + IOPMrootDomain is about to deliver kIOMessageSystemHasPoweredOn. + */ + kIOPMTracePointSystemWakeDriversPhase = 0x21, + +/* When kTracePointSystemWakeAppsPhase is the latest tracePoint, + System CPU is powered, PM has powered on each driver. + + * Phase begins: IOPMrootDomain::tellChangeUp before sending asynchronous + kIOMessageSystemHasPoweredOn notifications + * Phase ends: IOPMrootDomain::tellChangeUp after sending asynchronous notifications + */ + kIOPMTracePointSystemWakeAppsPhase = 0x22, + +/* kIOPMTracePointSystemLoginwindowPhase + This phase represents a several minute window after the system has powered on. + Higher levels of system diagnostics are in a heightened state of alert in this phase, + in case any user errors occurred that we could not detect in software. + + This several minute window + + * Phase begins: After IOPMrootDomain sends kIOMessageSystemHasPoweredOn message. + * Phase ends: When loginwindow calls IOPMSleepWakeSetUUID(NULL) the system shall + be considered awake and usable. The next phase shall be kIOPMTracePointSystemUp. + */ + kIOPMTracePointSystemLoginwindowPhase = 0x30 +}; + +/*****************************************************************************/ + +/* +* kIOPMLoginWindowSecurityDebugKey - identifies PM debug data specific to LoginWindow + * for use with IOPMrootDomain. +*/ +#define kIOPMLoginWindowSecurityDebugKey "LoginWindowSecurity" + +// For PM internal use only - key to locate sleep failure results within SCDynamicStore. +#define kIOPMDynamicStoreSleepFailureKey "SleepFailure" + +/*****************************************************************************/ + +// For IOPMLibPrivate.h +#define kIOPMSleepWakeFailureKey "PMFailurePhase" +#define kIOPMSleepWakeFailureCodeKey "PMStatusCode" +#define kIOPMSleepWakeFailureLoginKey "LWFailurePhase" +#define kIOPMSleepWakeFailureUUIDKey "UUID" +#define kIOPMSleepWakeFailureDateKey "Date" + +#endif /* ! _IOKIT_IOPMPRIVATE_H */ + diff --git a/i386/include/IOKit/pwr_mgt/IOPMpowerState.h b/i386/include/IOKit/pwr_mgt/IOPMpowerState.h new file mode 100644 index 0000000..f7f4c8a --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPMpowerState.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#include + +/*! @header IOPMpowerState.h + @abstract Defines the struct IOPMPowerState that power managed drivers should use to describe their power states. +*/ + +/*! @struct IOPMPowerState + @abstract Describes a device's power state. + @discussion To take part in system power management, drivers should define an array of 2 or more power states and pass it to kernel power management through IOService::registerPowerDriver. + @field version Defines version number of this struct. Just use the value "1" when defining an IOPMPowerState. + @field capabilityFlags Describes the capability of the device in this state. + @field outputPowerCharacter Describes the power provided in this state. + @field inputPowerRequirement Describes the input power required in this state. + @field staticPower Describes average consumption in milliwatts. Unused; drivers may specify 0. + @field unbudgetedPower Describes additional consumption from separate power supply (milliWatts). Unused; drivers may specify 0. + @field powerToAttain Describes dditional power to attain this state from next lower state (in milliWatts). Unused; drivers may specify 0. + @field timeToAttain Describes time required to enter this state from next lower state (in microseconds). Unused; drivers may specify 0. + @field settleUpTime Describes settle time required after entering this state from next lower state (microseconds). Unused; drivers may specify 0. + @field timeToLower Describes time required to enter next lower state from this one (microseconds). Unused; drivers may specify 0. + @field settleDownTime Settle time required after entering next lower state from this state (microseconds). Unused; drivers may specify 0. + @field powerDomainBudget Describes power in milliWatts a domain in this state can deliver to its children. Unused; drivers may specify 0. +} +*/ + +struct IOPMPowerState +{ + unsigned long version; + IOPMPowerFlags capabilityFlags; + IOPMPowerFlags outputPowerCharacter; + IOPMPowerFlags inputPowerRequirement; + unsigned long staticPower; + unsigned long unbudgetedPower; + unsigned long powerToAttain; + unsigned long timeToAttain; + unsigned long settleUpTime; + unsigned long timeToLower; + unsigned long settleDownTime; + unsigned long powerDomainBudget; +}; + +typedef struct IOPMPowerState IOPMPowerState; + +enum { + kIOPMPowerStateVersion1 = 1 +}; diff --git a/i386/include/IOKit/pwr_mgt/IOPowerConnection.h b/i386/include/IOKit/pwr_mgt/IOPowerConnection.h new file mode 100644 index 0000000..179035b --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/IOPowerConnection.h @@ -0,0 +1,159 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + + +#ifndef _IOKIT_IOPOWERCONNECTION_H +#define _IOKIT_IOPOWERCONNECTION_H + +#include +#include + +class IOPowerConnection : public IOService +{ + OSDeclareDefaultStructors(IOPowerConnection) + +protected: + /*! @field parentKnowsState true: parent knows state of its domain + used by child */ + bool stateKnown; + /*! @field currentPowerFlags power flags which describe the current state of the power domain + used by child */ + IOPMPowerFlags currentPowerFlags; + /*! @field desiredDomainState state number which corresponds to the child's desire + used by parent */ + unsigned long desiredDomainState; + + /*! @field requestFlag set to true when desiredDomainState is set */ + bool requestFlag; + + /*! @field preventIdleSleepFlag true if child has this bit set in its desired state + used by parent */ + unsigned long preventIdleSleepFlag; + + /*! @field preventSystemSleepFlag true if child has this bit set in its desired state + used by parent */ + unsigned long preventSystemSleepFlag; + + /*! @field awaitingAck true if child has not yet acked our notification + used by parent */ + bool awaitingAck; + + /*! @field readyFlag true if the child has been added as a power child + used by parent */ + bool readyFlag; + +public: + /*! @function setParentKnowsState + @abstract Sets the stateKnown variable. + @discussion Called by the parent when the object is created and called by the child when it discovers that the parent now knows its state. */ + void setParentKnowsState (bool ); + + /*! @function setParentCurrentPowerFlags + @abstract Sets the currentPowerFlags variable. + @discussion Called by the parent when the object is created and called by the child when it discovers that the parent state is changing. */ + void setParentCurrentPowerFlags (IOPMPowerFlags ); + + /*! @function parentKnowsState + @abstract Returns the stateKnown variable. */ + bool parentKnowsState (void ); + + /*! @function parentCurrentPowerFlags + @abstract Returns the currentPowerFlags variable. */ + IOPMPowerFlags parentCurrentPowerFlags (void ); + + /*! @function setDesiredDomainState + @abstract Sets the desiredDomainState variable. + @discussion Called by the parent. */ + void setDesiredDomainState (unsigned long ); + + /*! @function getDesiredDomainState + @abstract Returns the desiredDomainState variable. + @discussion Called by the parent. */ + unsigned long getDesiredDomainState ( void ); + + /*! @function setChildHasRequestedPower + @abstract Set the flag that says that the child has called requestPowerDomainState. + @discussion Called by the parent. */ + void setChildHasRequestedPower ( void ); + + + /*! @function childHasRequestedPower + @abstract Return the flag that says whether the child has called requestPowerDomainState. + @discussion Called by the PCI Aux Power Supply Driver to see if a device driver + is power managed. */ + bool childHasRequestedPower ( void ); + + /*! @function setPreventIdleSleepFlag + @abstract Sets the preventIdleSleepFlag variable. + @discussion Called by the parent. */ + void setPreventIdleSleepFlag (unsigned long ); + + /*! @function getPreventIdleSleepFlag + @abstract Returns the preventIdleSleepFlag variable. + @discussion Called by the parent. */ + bool getPreventIdleSleepFlag ( void ); + + /*! @function setPreventSystemSleepFlag + @abstract Sets the preventSystemSleepFlag variable. + @discussion Called by the parent. */ + void setPreventSystemSleepFlag (unsigned long ); + + /*! @function getPreventSystemSleepFlag + @abstract Returns the preventSystemSleepFlag variable. + @discussion Called by the parent. */ + bool getPreventSystemSleepFlag ( void ); + + /*! @function setAwaitingAck + @abstract Sets the awaitingAck variable. + @discussion Called by the parent. */ + void setAwaitingAck ( bool ); + + /*! @function getAwaitingAck + @abstract Returns the awaitingAck variable. + @discussion Called by the parent. */ + bool getAwaitingAck ( void ); + + /*! @function setReadyFlag + @abstract Sets the readyFlag variable. + @discussion Called by the parent. */ + void setReadyFlag( bool flag ); + + /*! @function getReadyFlag + @abstract Returns the readyFlag variable. + @discussion Called by the parent. */ + bool getReadyFlag( void ) const; +}; + +#endif /* ! _IOKIT_IOPOWERCONNECTION_H */ + diff --git a/i386/include/IOKit/pwr_mgt/RootDomain.h b/i386/include/IOKit/pwr_mgt/RootDomain.h new file mode 100644 index 0000000..6f4ebee --- /dev/null +++ b/i386/include/IOKit/pwr_mgt/RootDomain.h @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _IOKIT_ROOTDOMAIN_H +#define _IOKIT_ROOTDOMAIN_H + +#include +#include +#include "IOKit/pwr_mgt/IOPMPrivate.h" + + +class IOPMPowerStateQueue; +class RootDomainUserClient; +class PMTraceWorker; + +/* + * Flags for get/setSleepSupported() + */ +enum { + kRootDomainSleepNotSupported = 0x00000000, + kRootDomainSleepSupported = 0x00000001, + kFrameBufferDeepSleepSupported = 0x00000002, + kPCICantSleep = 0x00000004 +}; + +/* + *IOPMrootDomain registry property keys + */ +#define kRootDomainSupportedFeatures "Supported Features" +#define kRootDomainSleepReasonKey "Last Sleep Reason" +#define kRootDomainSleepOptionsKey "Last Sleep Options" +#define kIOPMRootDomainWakeReasonKey "Wake Reason" +#define kIOPMRootDomainWakeTypeKey "Wake Type" +#define kIOPMRootDomainPowerStatusKey "Power Status" + +/* + * Possible sleep reasons found under kRootDomainSleepReasonsKey + */ +#define kIOPMClamshellSleepKey "Clamshell Sleep" +#define kIOPMPowerButtonSleepKey "Power Button Sleep" +#define kIOPMSoftwareSleepKey "Software Sleep" +#define kIOPMOSSwitchHibernationKey "OS Switch Sleep" +#define kIOPMIdleSleepKey "Idle Sleep" +#define kIOPMLowPowerSleepKey "Low Power Sleep" +#define kIOPMThermalEmergencySleepKey "Thermal Emergency Sleep" +#define kIOPMMaintenanceSleepKey "Maintenance Sleep" + +/* + * String constants for communication with PM CPU + */ +#define kIOPMRootDomainLidCloseCString "LidClose" +#define kIOPMRootDomainBatPowerCString "BatPower" + +/* + * Supported Feature bitfields for IOPMrootDomain::publishFeature() + */ +enum { + kIOPMSupportedOnAC = (1<<0), + kIOPMSupportedOnBatt = (1<<1), + kIOPMSupportedOnUPS = (1<<2) +}; + +typedef IOReturn (*IOPMSettingControllerCallback) + (OSObject *target, const OSSymbol *type, + OSObject *val, uintptr_t refcon); + +__BEGIN_DECLS +IONotifier * registerSleepWakeInterest( + IOServiceInterestHandler, void *, void * = 0); + +IONotifier * registerPrioritySleepWakeInterest( + IOServiceInterestHandler handler, + void * self, void * ref = 0); + +IOReturn acknowledgeSleepWakeNotification(void * ); + +IOReturn vetoSleepWakeNotification(void * PMrefcon); +__END_DECLS + +#define IOPM_ROOTDOMAIN_REV 2 + +class IOPMrootDomain: public IOService +{ + OSDeclareFinalStructors(IOPMrootDomain) + +public: + static IOPMrootDomain * construct( void ); + + virtual bool start( IOService * provider ); + virtual IOReturn setAggressiveness( unsigned long, unsigned long ); + virtual IOReturn getAggressiveness( unsigned long, unsigned long * ); + + virtual IOReturn sleepSystem( void ); + IOReturn sleepSystemOptions( OSDictionary *options ); + + virtual IOReturn setProperties( OSObject * ); + +/*! @function systemPowerEventOccurred + @abstract Other drivers may inform IOPMrootDomain of system PM events + @discussion systemPowerEventOccurred is a richer alternative to receivePowerNotification() + Only Apple-owned kexts should have reason to call systemPowerEventOccurred. + @param event An OSSymbol describing the type of power event. + @param value A 32-bit integer value associated with the event. + @param shouldUpdate indicates whether the root domain should send a notification + to interested parties. Pass false if you're calling systemPowerEventOccurred + several times in succession; and pass true only on the last invocatino. + @result kIOReturnSuccess on success */ + + IOReturn systemPowerEventOccurred( + const OSSymbol *event, + uint32_t intValue ); + + IOReturn systemPowerEventOccurred( + const OSSymbol *event, + OSObject *value ); + + virtual IOReturn receivePowerNotification( UInt32 msg ); + + virtual void setSleepSupported( IOOptionBits flags ); + + virtual IOOptionBits getSleepSupported( void ); + + void wakeFromDoze( void ); + + // KEXT driver announces support of power management feature + + void publishFeature( const char *feature ); + + // KEXT driver announces support of power management feature + // And specifies power sources with kIOPMSupportedOn{AC/Batt/UPS} bitfield. + // Returns a unique uint32_t identifier for later removing support for this + // feature. + // NULL is acceptable for uniqueFeatureID for kexts without plans to unload. + + void publishFeature( const char *feature, + uint32_t supportedWhere, + uint32_t *uniqueFeatureID); + + // KEXT driver announces removal of a previously published power management + // feature. Pass 'uniqueFeatureID' returned from publishFeature() + + IOReturn removePublishedFeature( uint32_t removeFeatureID ); + +/*! @function copyPMSetting + @abstract Copy the current value for a PM setting. Returns an OSNumber or + OSData depending on the setting. + @param whichSetting Name of the desired setting. + @result OSObject value if valid, NULL otherwise. */ + + OSObject * copyPMSetting( OSSymbol *whichSetting ); + +/*! @function registerPMSettingController + @abstract Register for callbacks on changes to certain PM settings. + @param settings NULL terminated array of C strings, each string for a PM + setting that the caller is interested in and wants to get callbacks for. + @param callout C function ptr or member function cast as such. + @param target The target of the callback, usually 'this' + @param refcon Will be passed to caller in callback; for caller's use. + @param handle Caller should keep the OSObject * returned here. If non-NULL, + handle will have a retain count of 1 on return. To deregister, pass to + unregisterPMSettingController() + @result kIOReturnSuccess on success. */ + + IOReturn registerPMSettingController( + const OSSymbol *settings[], + IOPMSettingControllerCallback callout, + OSObject *target, + uintptr_t refcon, + OSObject **handle); // out param + +/*! @function registerPMSettingController + @abstract Register for callbacks on changes to certain PM settings. + @param settings NULL terminated array of C strings, each string for a PM + setting that the caller is interested in and wants to get callbacks for. + @param supportedPowerSources bitfield indicating which power sources these + settings are supported for (kIOPMSupportedOnAC, etc.) + @param callout C function ptr or member function cast as such. + @param target The target of the callback, usually 'this' + @param refcon Will be passed to caller in callback; for caller's use. + @param handle Caller should keep the OSObject * returned here. If non-NULL, + handle will have a retain count of 1 on return. To deregister, pass to + unregisterPMSettingController() + @result kIOReturnSuccess on success. */ + + IOReturn registerPMSettingController( + const OSSymbol *settings[], + uint32_t supportedPowerSources, + IOPMSettingControllerCallback callout, + OSObject *target, + uintptr_t refcon, + OSObject **handle); // out param + + virtual IONotifier * registerInterest( + const OSSymbol * typeOfInterest, + IOServiceInterestHandler handler, + void * target, void * ref = 0 ); + + void pmStatsRecordEvent( + int eventIndex, + AbsoluteTime timestamp); + + void pmStatsRecordApplicationResponse( + const OSSymbol *response, + const char *name, + int messageType, + uint32_t delay_ms, + int app_pid); + + virtual IOReturn callPlatformFunction( + const OSSymbol *functionName, + bool waitForFunction, + void *param1, void *param2, + void *param3, void *param4 ); + +private: + virtual IOReturn changePowerStateTo( unsigned long ordinal ); + virtual IOReturn changePowerStateToPriv( unsigned long ordinal ); + virtual IOReturn requestPowerDomainState( IOPMPowerFlags, IOPowerConnection *, unsigned long ); + virtual void powerChangeDone( unsigned long ); + virtual bool tellChangeDown( unsigned long ); + virtual bool askChangeDown( unsigned long ); + virtual void tellChangeUp( unsigned long ); + virtual void tellNoChangeDown( unsigned long ); +}; + + +#endif /* _IOKIT_ROOTDOMAIN_H */ diff --git a/i386/include/IOKit/rtc/.svn/all-wcprops b/i386/include/IOKit/rtc/.svn/all-wcprops new file mode 100644 index 0000000..cb696b8 --- /dev/null +++ b/i386/include/IOKit/rtc/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/rtc +END +IORTCController.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/rtc/IORTCController.h +END diff --git a/i386/include/IOKit/rtc/.svn/entries b/i386/include/IOKit/rtc/.svn/entries new file mode 100644 index 0000000..4544394 --- /dev/null +++ b/i386/include/IOKit/rtc/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/rtc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IORTCController.h +file + + + + +2013-08-27T23:54:20.000000Z +44a0b2efb5c45175a1ba6782cedb471c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1708 + diff --git a/i386/include/IOKit/rtc/.svn/text-base/IORTCController.h.svn-base b/i386/include/IOKit/rtc/.svn/text-base/IORTCController.h.svn-base new file mode 100644 index 0000000..eaf681d --- /dev/null +++ b/i386/include/IOKit/rtc/.svn/text-base/IORTCController.h.svn-base @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * 24 Nov 1998 suurballe Created. + */ + +#include + +typedef void (*RTC_tick_handler)( IOService * ); + + +class IORTCController: public IOService +{ +OSDeclareAbstractStructors(IORTCController) + +public: + +virtual IOReturn getRealTimeClock ( UInt8 * currentTime, IOByteCount * length ) = 0; +virtual IOReturn setRealTimeClock ( UInt8 * newTime ) = 0; +}; + diff --git a/i386/include/IOKit/rtc/IORTCController.h b/i386/include/IOKit/rtc/IORTCController.h new file mode 100644 index 0000000..eaf681d --- /dev/null +++ b/i386/include/IOKit/rtc/IORTCController.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * 24 Nov 1998 suurballe Created. + */ + +#include + +typedef void (*RTC_tick_handler)( IOService * ); + + +class IORTCController: public IOService +{ +OSDeclareAbstractStructors(IORTCController) + +public: + +virtual IOReturn getRealTimeClock ( UInt8 * currentTime, IOByteCount * length ) = 0; +virtual IOReturn setRealTimeClock ( UInt8 * newTime ) = 0; +}; + diff --git a/i386/include/IOKit/sbp2/.svn/all-wcprops b/i386/include/IOKit/sbp2/.svn/all-wcprops new file mode 100644 index 0000000..1f18ebd --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/all-wcprops @@ -0,0 +1,59 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2 +END +IOFireWireSBP2UserClient.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2UserClient.h +END +IOFireWireSBP2LUN.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2LUN.h +END +IOFireWireSBP2ManagementORB.h +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h +END +IOFireWireSerialBusProtocolTransport.h +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h +END +IOFireWireSBP2LSIWorkaroundDescriptor.h +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h +END +IOFireWireSBP2ORB.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2ORB.h +END +IOFireWireSBP2Target.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2Target.h +END +IOFireWireSBP2UserClientCommon.h +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h +END +IOFireWireSBP2Login.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/sbp2/IOFireWireSBP2Login.h +END diff --git a/i386/include/IOKit/sbp2/.svn/entries b/i386/include/IOKit/sbp2/.svn/entries new file mode 100644 index 0000000..6ee6b5c --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/entries @@ -0,0 +1,334 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/sbp2 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOFireWireSBP2UserClient.h +file + + + + +2013-08-27T23:54:16.000000Z +abe67641efef3cf326ce18b1de817d57 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8267 + +IOFireWireSBP2LUN.h +file + + + + +2013-08-27T23:54:16.000000Z +8fab521ac7af386c7d2772a0f69444b3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10404 + +IOFireWireSBP2ManagementORB.h +file + + + + +2013-08-27T23:54:16.000000Z +df7f1948a7790ed3d08f53f0426095f2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11075 + +IOFireWireSerialBusProtocolTransport.h +file + + + + +2013-08-27T23:54:16.000000Z +6e7bdeac9a9690b47e47421abda8d3c1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14111 + +IOFireWireSBP2LSIWorkaroundDescriptor.h +file + + + + +2013-08-27T23:54:16.000000Z +8c4d66f15c56537e975892bec0dd721b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12217 + +IOFireWireSBP2ORB.h +file + + + + +2013-08-27T23:54:16.000000Z +387c5f66e2949189fc62b07fc183c7c3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +21217 + +IOFireWireSBP2Target.h +file + + + + +2013-08-27T23:54:16.000000Z +e7cdf79c998d9b81359b7c6adc3b1881 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7550 + +IOFireWireSBP2UserClientCommon.h +file + + + + +2013-08-27T23:54:16.000000Z +96d96ad9f1106c7237f0485867e3f509 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4524 + +IOFireWireSBP2Login.h +file + + + + +2013-08-27T23:54:16.000000Z +b78759007f3ff7e9e66d595d31ac6cf8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +41499 + diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2LSIWorkaroundDescriptor.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2LSIWorkaroundDescriptor.h.svn-base new file mode 100644 index 0000000..178ef00 --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2LSIWorkaroundDescriptor.h.svn-base @@ -0,0 +1,292 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#if __ppc__ + +/*! + @header IOFireWireSBP2LSIWorkaroundDescriptor + Contains the class definition for IOFireWireSBP2LSIWorkaroundDescriptor. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LSIWORKAROUNDDESCRIPTOR_H +#define _IOKIT_IOFIREWIRESBP2LSIWORKAROUNDDESCRIPTOR_H + +#include + +class IOFireWireSBP2LSIRange; + +/*! + @class IOFireWireSBP2LSIWorkaroundDescriptor + @abstract This is a subclass of IOGeneralMemoryDescriptor. It is designed to work around + a hardware problem in a common SBP2 target. It takes a memory descriptor as + an argument. It retains this descriptor and returns a new one with resegmented + physical segments and potentially some "unfixable" segments double buffered. + + If the transfer will cause data to be sent from the Mac, syncBuffersForOutput + must be called before the transfer. + + If the transfer will cause data to be recieve by the Mac, syncBuffersForInput + must be called after the transfer. + + This class calculates the new segmentation only once when it is created. + Any changes to the structure of the original memory descriptor will render + this one useless. It must be released and a new IOFireWireSBP2LSIWorkaroundDescriptor + can be created. + + LSI Bridge Workaround Algorithm Details + + Goals: + 1. Avoid LSI Logic "< 16 byte" bug - prevent any data packet smaller than 16 bytes + 2. Minimize double-buffering + 3. Support non-multiple-of-512-byte devices, e.g. CD Audio + + Solution: + Write a page table such that the bridge will nor use packets smaller than 16 bytes. + In other words, rearrange the memory descriptor to avoid the bug, and do it such + that the SBP-2 layer will not break up a segment (du ro the 64k-1 limit) and + re-introduces the problem + + SBP-2 defines the kFWSBP2MaxPageClusterSize constant. We simply make sure + none of our segments are larger than this size and SBP-2 will not break them + up when it writes the SBP-2 page table. + + Notes: + - Some double buffering is unavoidable. Discontiguous pages may yield page + fragments at the start or end of the buffer (or both, with non-512x buffers). + solution uses less than 33 bytes of double-buffer per segment in original + memory descriptor. + - If driver must break up IO to meet ATA limit of 255 (250?) blocks, assume + the driver does this at a higher level (before applying workaround). + - It is expected that the original memory descriptor has been prepared (wired) +*/ + +class IOFireWireSBP2LSIWorkaroundDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructors(IOFireWireSBP2LSIWorkaroundDescriptor) + + friend class IOFireWireSBP2LSIRange; + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + bool fFixedCapacity; // for both allocators + + ////////////////////////////////////// + // for range allocator + + OSArray * fPermanentRanges; + UInt32 fAllocatedRangesCount; + + virtual IOReturn rangeAllocatorInitialize( UInt32 rangeCount ); + virtual void rangeAllocatorDeallocateAllRanges( void ); + virtual IOFireWireSBP2LSIRange * rangeAllocatorNewRange( void ); + virtual void rangeAllocatorFree( void ); + + ////////////////////////////////////// + // for buffer allocator + + OSArray * fBufferDescriptors; + UInt32 fPermanentPages; + IOByteCount fAllocatedBytesCount; + + virtual IOReturn bufferAllocatorInitialize( IOByteCount requestedBufferSize ); + virtual void bufferAllocatorDeallocateAllBuffers( void ); + virtual void * bufferAllocatorNewBuffer( IOPhysicalAddress * address ); + virtual void bufferAllocatorFree( void ); + + ////////////////////////////////////// + // for range table allocator + + IOPhysicalRange * fRangeTable; + IOByteCount fRangeTableSize; + + virtual IOReturn rangeTableAllocatorInitialize( UInt32 requestedBufferSize ); + virtual IOPhysicalRange * rangeTableAllocatorNewTable( UInt32 entries ); + virtual void rangeTableAllocatorFree( void ); + + ////////////////////////////////////// + // for workaround + + IOMemoryDescriptor * fOriginalDesc; + OSArray * fRanges; + IOByteCount fOffset; + IOByteCount fLength; + IODirection fDirection; + + + virtual bool initWithCapacity + ( UInt32 permanentRanges, IOByteCount permanentBufferSpace, bool fixedCapacity ); + + virtual void free(); + + virtual IOReturn resetToInitialCapacity( void ); + virtual IOReturn initializeRangesArray( void ); + virtual IOReturn recalculateSmallSegments( void ); + virtual IOReturn splitLargeSegments( void ); + virtual IOReturn resegmentOddLengthSegments( void ); + virtual IOReturn initializeBuffers( void ); + + virtual bool initWithAddress( void * address, /* not supported */ + IOByteCount withLength, + IODirection withDirection ); + + virtual bool initWithAddress( vm_address_t address, /* not supported */ + IOByteCount withLength, + IODirection withDirection, + task_t withTask ); + + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, /* not supported */ + IOByteCount withLength, + IODirection withDirection ); + + virtual bool initWithPhysicalRanges( + IOPhysicalRange * ranges, /* not supported */ + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + + virtual bool initWithRanges( IOVirtualRange * ranges, /* not supported */ + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false ); + +public: + + // static factory methods and intializers + + // + // create a new instance + // + + + /*! + @function withDescriptor + @abstract Creates a new IOFireWireSBP2LSIWorkaroundDescriptor. + @discussion Create a IOFireWireSBP2LSIWorkaroundDescriptor with no permanent capacity then + inits it the given descriptor. This is basicly a short cut for calling + withCapacity( 0, 0, false) and the initWithDescriptor() + @param desc Original memory descriptor. + @param offset Offset of data to "fix" in bytes from beginning of descriptor. + @param len Length of data in bytes to "fix" + @param direction IODirection of data transfer. + @result Returns a new IOFireWireSBP2LSIWorkaroundDescriptor if successful. + */ + + static IOFireWireSBP2LSIWorkaroundDescriptor * withDescriptor + ( IOMemoryDescriptor * desc, IOByteCount offset = 0, + IOByteCount len = 0, IODirection direction = kIODirectionOutIn ); + + // initialize with descriptor + + /*! + @function initWithDescriptor + @abstract Initialize an IOFireWireSBP2LSIWorkaroundDescriptor with the given descriptor. + @discussion Initialize the workaround descriptor with the given descriptor. + @param desc Original memory descriptor. + @param offset Offset of data to "fix" in bytes from beginning of descriptor. + @param len Length of data in bytes to "fix" + @param direction IODirection of data transfer. + @result Returns true if the initialization was successful. + */ + + virtual bool initWithDescriptor( IOMemoryDescriptor * desc, IOByteCount offset = 0, + IOByteCount len = 0, IODirection direction = kIODirectionOutIn ); + + + /////////////////////////////////// + + + /*! + @function withCapacity + @abstract Create a new descriptor with possibly a permanent capacity. + @discussion Create and IOFireWireSBP2LSIWorkaroundDescriptor with a permanent fixed capacity. + You should call initWithDescriptor afterward. permanentRanges is number of ranges to keep + permanently allocated for use by the algorithm. If fixedCapacity is false additional ranges + may be allocated and deallocated dyanmicly if needed. The algorithm may require more or less + ranges than either the original descriptor or the final fixed may decriptor contain. + permanentBufferSpace is the number of bytes of permanent buffer to keep arround. If fixedCapacity + is false additional buffer space may be allocated and deallocated dynamically. permanentBufferSpace + should generally be set to 32 * maximum number of ranges. fixedCapacity is a flag indicating + whether dynamic allocations are allowed. When making decisions about the maximum amount of + buffer space to keep around, it should be noted tha the maximum number of ranges maybe different + from permanentRanges if fixedCapcity is false. + @param permanentRanges Count of permanent ranges. + @param permanentBufferSpace Byte count of permanent buffers. + @param fixedCapacity bool indicating if dynamic allocations can be made. + @result Returns true if the initialization was successful. + */ + + static IOFireWireSBP2LSIWorkaroundDescriptor * withCapacity + ( UInt32 permanentRanges, IOByteCount permanentBufferSpace, bool fixedCapacity ); + + + /////////////////////////////////// + + // + // manipulate buffers for IO + // + + /*! + @function syncBuffersForOutput + @abstract Synchronize the buffers for output. + @discussion Since double buffering may be invovled in the workaround. The driver needs to + indicate when these buffers should be syncronized with the original descriptor. For data + that will be output syncBuffersForOutput should be called before submiting the ORB. + @result Returns kIOReturnSuccess if sync was successful. + */ + + virtual IOReturn syncBuffersForOutput( void ); // call before output + + /*! + @function syncBuffersForInput + @abstract Synchronize the buffers for input. + @discussion Since double buffering may be invovled in the workaround. The driver needs to + indicate when these buffers should be syncronized with the original descriptor. For data + that will be input syncBuffersForOutput should be called after receiving completion status + for the ORB. + @result Returns kIOReturnSuccess if sync was successful. + */ + + virtual IOReturn syncBuffersForInput( void ); // call after input + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 8); + +}; + +#endif + +#endif diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2LUN.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2LUN.h.svn-base new file mode 100644 index 0000000..e6c97de --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2LUN.h.svn-base @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2LUN + Contains the class definition for IOFireWireSBP2LUN. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LUN_H +#define _IOKIT_IOFIREWIRESBP2LUN_H + +#include +#include + +#include + +#include +#include + +class IOFireWireSBP2Target; + +/*! + @class IOFireWireSBP2LUN + @abstract Provider for most drivers. + @discussion IOFireWireSBP2LUN objects are created by IOFireWireSBP2Target objects. Each target may have zero or more IOFireWireSBP2LUN children. The LUN object serves as the matching nub for most drivers and therefore will be the provider for most drivers. It supplies the methods that control the operation of the LUN as a whole. Methods that control the behavior and execution of an SBP2 login session are supplied in a separate IOFireWireSBP2Login object. The LUN can be used to create one of these login objects. + The LUN can also create IOFireWireSBP2ManagementORBs for configuring and appending non-login related management functions. Login related management functions (ie. Login, Logout, Reconnect) are supplied by the IOFireWireSBP2Login. + Finally the LUN can supply a reference to the IOFireWireUnit. This can be useful if a driver wishes to access the standard FireWire APIs. +*/ + +class IOFireWireSBP2LUN : public IOService +{ + OSDeclareDefaultStructors( IOFireWireSBP2LUN ); + + friend class IOFireWireSBP2ManagementORB; + friend class IOFireWireSBP2Login; + friend class IOFireWireSBP2UserClient; + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + //////////////////////////////////////////// + // methods called by friend classes + + // IOFireWireSBP2Login methods + virtual void removeLogin( IOFireWireSBP2Login * login ); + virtual IOFireWireSBP2Target * getTarget( void ); + + // IOFireWireSBP2ManagementORB methods + virtual void clearAllTasksInSet( void ); // assumes caller is on workloop + virtual void removeManagementORB( IOFireWireSBP2ManagementORB * orb ); + + // IOFireWireSBP2UserClient methods + virtual void flushAllManagementORBs( void ); + +public: + + //////////////////////////////////////////// + // IOService overrides + + /*! @function attach + @abstract Attaches an IOService client to a provider in the registry. + @discussion See IOService for discussion. + @param provider The IOService object which will serve as this objects provider. + @result false if the provider is inactive or on a resource failure, otherwise true. + */ + + virtual bool attach( IOService *provider ); + + /*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. */ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + /*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. + */ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + /*! + @function matchPropertyTable + @abstract Implements SBP2 specific matching. + @discussion See IOService for discussion. + @param table The dictionary of properties to be matched against. + @result Returns false if the family considers the matching dictionary does not match in properties it understands, true otherwise. + */ + + virtual bool matchPropertyTable(OSDictionary * table); + +protected: + + //////////////////////////////////////////// + // private fields + + IOFireWireSBP2Target * fProviderTarget; + UInt32 fLUNumber; + OSSet * fLoginSet; + OSIterator * fLoginSetIterator; + IOCommandGate * fGate; + OSSet * fORBSet; + OSIterator * fORBSetIterator; + OSObject * fDiagnostics; + + //////////////////////////////////////////// + // private methods + + // IOService methods + virtual void free( void ); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + // create management orb internals + static IOReturn staticCreateManagementORBAction( OSObject *self, + void * refCon, + void * completion, + void * orb, + void * ); + virtual IOReturn createManagementORBAction( void * refCon, + FWSBP2ManagementCallback completion, + IOFireWireSBP2ManagementORB ** orb ); + + // remove management orb internals + static IOReturn staticRemoveManagementORBAction( OSObject * self, void * orb, + void *, void *, void * ); + virtual IOReturn removeManagementORBAction( IOFireWireSBP2ManagementORB * orb ); + + // flush all management orb internals + static IOReturn staticExecuteFlushAllMgmtORBs( OSObject * self, void *, + void *, void *, void * ); + virtual IOReturn executeFlushAllMgmtORBs( void ); + + // IOFireWireSBP2ManagementORB friend class wrappers + virtual bool initMgmtORBWithLUN( IOFireWireSBP2ManagementORB * orb, IOFireWireSBP2LUN * lun, + void * refCon, + FWSBP2ManagementCallback completion ); + + // IOFireWireSBP2Login friend class wrappers + virtual bool initLoginWithLUN( IOFireWireSBP2Login * login, IOFireWireSBP2LUN * lun ); + virtual void suspendedNotify( void ); + virtual void resumeNotify( void ); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 0); + +public: + + //////////////////////////////////////////// + // client methods + + // getters + + /*! + @function getFireWireUnit + @abstract Returns an IOFireWireUnit object. + @discussion An IOFireWireUnit is the provider of an IOFireWireSBP2Target. In order to + use the base FireWire services you will need a reference to the unit. This method + returns that reference. + @result Returns a pointer to an IOFireWireUnit. + */ + + virtual IOFireWireUnit * getFireWireUnit( void ); + + /*! + @function getLUNumber + @abstract Returns the LUNs number. + @discussion Each LUN has a number to uniquely identify it on a device. This method returns + this value in a UInt32. + @result Returns a UInt32 containing the Logical Unit Number. + */ + + virtual UInt32 getLUNumber( void ); + + // factory methods + + /*! + @function createLogin + @abstract Creates a new IOFireWireSBP2Login object. + @discussion Creates a new IOFireWireSBP2Login object for the LUN. Login objects supply most + of the SBP2 APIs related to login maintenance and Normal Command ORB execution. + @result Returns a pointer to a new IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2Login *createLogin( void ); + + /*! + @function createManagementORB + @abstract Creates a new IOFireWireSBP2ManagementORB object. + @discussion Creates a new IOFireWireSBP2ManagementORB object. Management objects let you + execute commands like QueryLogins, LogicalUnitReset, and AbortTask. These commands are + configured after they are created here. When they are done executing (after a call to submit) + the supplied completion routine will be called with the supplied refcon. Usually this refCon + is the "this" pointer of completion method's object. + @param refCon The refcon passed to the completion routine. + @param completion The completion routine. Called when the ORB finishes execution. + @result Returns a pointer to a new IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2ManagementORB * createManagementORB( void * refCon, FWSBP2ManagementCallback completion ); + +protected: + + static IOReturn staticCreateLogin( OSObject *self, void * login, void *, void *, void * ); + virtual IOReturn createLoginAction( IOFireWireSBP2Login ** login ); + + static IOReturn staticRemoveLoginAction( OSObject *self, void * login, void *, void *, void * ); + virtual IOReturn removeLoginAction( IOFireWireSBP2Login * login ); + +public: + + /*! + @function getDiagnostics + @abstract Debug-only method. + @discussion Returns a reference to the internal diagnostics object when the services are built + in debug mode. Should be a no-op in release builds. + @result Returns a pointer to the diagnostics object (if any). + */ + + virtual OSObject * getDiagnostics( void ); + + virtual bool finalize( IOOptionBits options ); + +protected: + + void terminateNotify( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 8); + +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2Login.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2Login.h.svn-base new file mode 100644 index 0000000..42a838c --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2Login.h.svn-base @@ -0,0 +1,1078 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2Login + Contains the class definition for IOFireWireSBP2Login. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LOGIN_H +#define _IOKIT_IOFIREWIRESBP2LOGIN_H + +#include + +#include + +#include +#include + +// login option flags +enum +{ + kFWSBP2DontSynchronizeMgmtAgent = (1 << 0), + kFWSBP2ExclusiveLogin = (1 << 5) +}; + +// notification events +enum +{ + kFWSBP2NormalCommandStatus = 6, + kFWSBP2NormalCommandTimeout = 7, + kFWSBP2UnsolicitedStatus = 8, + kFWSBP2NormalCommandReset = 9 +}; + +#define kIOMessageFWSBP2ReconnectComplete iokit_fw_err(0x3E8) +#define kIOMessageFWSBP2ReconnectFailed iokit_fw_err(0x3E9) + +/*! + @typedef FWSBP2LoginResponse + @param length Length of login response. + @param loginID Unique id representing this login. + @param commandBlockAgentAddressHi High 32 bits of command block agent address. + @param commandBlockAgentAddressLo Low 32 bits of command block agent address. + @param reserved Reserved. + @param reconnectHold Reconnect timeout encoded as 2^reconnectHold seconds. +*/ + +typedef struct +{ + UInt16 length; + UInt16 loginID; + UInt32 commandBlockAgentAddressHi; + UInt32 commandBlockAgentAddressLo; + UInt16 reserved; + UInt16 reconnectHold; +} FWSBP2LoginResponse, *FWSBP2LoginResponsePtr; + +/*! + @typedef FWSBP2StatusBlock + @param details Src, Resp, D, Len fields of status block format + @param sbpStatus SBP2 specific status + @param orbOffsetHi High 32 bits of address of orb status is for. + @param orbOffsetLo Low 32 bits of address of orb status is for. + @param status[6] Up to 48 bytes of additional data. Length is determined by len field. +*/ + +typedef struct +{ + UInt8 details; + UInt8 sbpStatus; + UInt16 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 status[6]; +} FWSBP2StatusBlock; + +class IOFireWireSBP2LUN; +class IOFireWireSBP2Login; + +// struct sent to login complete handler + +/*! + @typedef FWSBP2LoginCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param loginResponse Pointer to login response struct. + @param statusBlock Pointer to status block buffer. + @param statusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of login attempt + + FWSBP2LoginResponsePtr loginResponse; // pointer to loginResponse buffer + FWSBP2StatusBlock * statusBlock; // pointer to statusBlock buffer + UInt32 statusBlockLength; // size of statusBlock buffer + +} FWSBP2LoginCompleteParams, *FWSBP2LoginCompleteParamsPtr; + +// struct sent to logout complete handler + +/*! + @typedef FWSBP2LogoutCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param statusBlock Pointer to status block buffer. + @param statusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of login attempt + + FWSBP2StatusBlock * statusBlock; // pointer to statusBlock buffer + UInt32 statusBlockLength; // size of statusBlock buffer + +} FWSBP2LogoutCompleteParams, *FWSBP2LogoutCompleteParamsPtr; + +// struct sent with reconnect notification + +/*! + @typedef FWSBP2LogoutCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param reconnectStatusBlock Pointer to status block buffer. + @param reconnectStatusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of reconnect attempt + + void * reconnectStatusBlock; // pointer to statusBlock buffer + UInt32 reconnectStatusBlockLength; // size of statusBlock buffer +} FWSBP2ReconnectParams, *FWSBP2ReconnectParamsPtr; + +// Callback when login and logout commands complete asynchronously + +/*! + @typedef FWSBP2LoginCallback + @param refCon Reference constant supplied when the notification was registered. + @param params Structure containing additional information about the status of the login. +*/ + +typedef void (*FWSBP2LoginCallback)(void * refCon, FWSBP2LoginCompleteParamsPtr params); + +/*! + @typedef FWSBP2LogoutCallback + @param refCon Reference constant supplied when the notification was registered. + @param params Structure containing additional information about the status of the logout. +*/ + +typedef void (*FWSBP2LogoutCallback)(void * refCon, FWSBP2LogoutCompleteParamsPtr params); + +/*! + @typedef FWSBP2StatusCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. +*/ + +typedef void (*FWSBP2StatusCallback)(void * refCon, IOReturn status); + +/*! + @typedef FWSBP2FetchAgentWriteCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. + @param orb Indicates current last orb in chain. +*/ + +typedef void (*FWSBP2FetchAgentWriteCallback)(void * refCon, IOReturn status, IOFireWireSBP2ORB * orb); + +/*! + @typedef FWSBP2NotifyParams + @param notificationEvent Type of event we are being notified of. + @param message buffer containing message. + @param length length of message field. + @param generation FireWire generation value. +*/ + +typedef struct +{ + void * commandObject; + UInt32 notificationEvent; + const void * message; + UInt32 length; + UInt32 generation; +} FWSBP2NotifyParams, *FWSBP2NotifyParamsPtr; + + +/*! + @typedef FWSBP2NotifyCallback + @param refCon Reference constant supplied when the notification was registered. + @param params FWSBP2NotifyParams containing notification information. +*/ + +typedef void (*FWSBP2NotifyCallback)(void * refCon, FWSBP2NotifyParamsPtr params); + +/*! + @class IOFireWireSBP2Login + @abstract Supplies the login maintenance and Normal Command ORB execution portions of the API. + @discussion Supplies APIs for login maintenance and command execution. Drivers can use this + object to create IOFireWireSBP2ORB objects and execute them. Solicited and unsolicited status + callback routines can be registered and the SBP2 services will notify the driver when the + appropriate status arrives. + This class also handles login maintenance. Supplies APIs for logging in and logging out and + attempts to reconnect to the LUN after bus resets. The base FireWire services deliver bus + reset notification via the IOKit message routine. The SBP2 services build on this behavior + and deliver reconnectFailed and reconnectComplete through the message routine as well. +*/ + +class IOFireWireSBP2Login : public OSObject +{ + OSDeclareDefaultStructors( IOFireWireSBP2Login ) + + friend class IOFireWireSBP2ORB; + friend class IOFireWireSBP2LUN; + friend class IOFireWireSBP2UserClient; + +protected: + + // command selectors + enum + { + kLoginCommandIdle = 0, + kLoginCommandDoLogin = 1, + kLoginCommandDoLogout = 2, + kLoginAddORB = 3, + kLoginRemoveORB = 4, + kLoginFetchAgentReset = 5 + }; + + // internal login states + enum + { + kLoginStateIdle = 0, + kLoginStateLoggingIn = 1, + kLoginStateConnected = 2, + kLoginStateReconnect = 3, + kLoginStateLoggingOut = 4, + kLoginStateTerminated = 5 + }; + + // rom keys + enum + { + kUnitCharacteristicsKey = 0x3A, + kManagementAgentOffsetKey = 0x54 + }; + + // sbp2 defs + enum + { + kFWSBP2RequestComplete = 0, + kFWSBP2TransportFailure = 1, + kFWSBP2IllegalRequest = 2, + kFWSBP2VendorDependent = 3 + }; + + enum + { + kFWSBP2NoSense = 0, + kFWSBP2RequestTypeNotSupported = 1, + kFWSBP2SpeedNotSupported = 2, + kFWSBP2PageSizeNotSupported = 3, + kFWSBP2AccessDenied = 4, + kFWSBP2LogicalUnitNotSupported = 5, + kFWSBP2MaxPayloadTooSmall = 6, + kFWSBP2FunctionRejected = 9, + kFWSBP2LoginIDNotRecognized = 10, + kFWSBP2DummyORBCompleted = 11, + kFWSBP2RequestAborted = 12, + kFWSBP2UnspecifiedError = 0xFF + }; + + typedef struct + { + UInt32 password[2]; + UInt32 loginResponseAddressHi; + UInt32 loginResponseAddressLo; + UInt16 options; + UInt16 lun; + UInt16 passwordLength; + UInt16 loginResponseLength; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2LoginORB; + + typedef struct + { + UInt32 reserved1[4]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2ReconnectORB; + + typedef struct + { + UInt32 reserved1[4]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2LogoutORB; + +protected: + + /////////////////////////////////////////////////////////////////// + // private interface methods + + // IOFireWireSBP2LUN methods + virtual void clearAllTasksInSet( void ); + virtual bool initWithLUN( IOFireWireSBP2LUN * lun ); + virtual void suspendedNotify( void ); + virtual void resumeNotify( void ); + + // IOFireWireSBP2ORB methods + virtual IOFireWireUnit * getFireWireUnit( void ); + virtual IOFireWireSBP2LUN * getFireWireLUN( void ); + virtual bool isFetchAgentWriteInProgress( void ); + virtual bool isConnected( void ); + virtual IOReturn removeORB( IOFireWireSBP2ORB * orb ); + virtual IOReturn appendORBImmediate( IOFireWireSBP2ORB * orb ); + virtual IOReturn appendORB( IOFireWireSBP2ORB * orb ); + virtual void sendTimeoutNotification( IOFireWireSBP2ORB * orb ); + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + IOFireWireController * fControl; + IOCommandGate * fGate; + + FWSBP2LoginCallback fLoginCompletionCallback; + void * fLoginCompletionRefCon; + + FWSBP2LogoutCallback fLogoutCompletionCallback; + void * fLogoutCompletionRefCon; + + FWSBP2NotifyCallback fStatusNotifyCallback; + void * fStatusNotifyRefCon; + + FWSBP2NotifyCallback fUnsolicitedStatusNotifyCallback; + void * fUnsolicitedStatusNotifyRefCon; + + UInt32 fLoginFlags; + UInt32 fReconnectTime; + + UInt32 fLoginState; + UInt32 fManagementOffset; + UInt32 fManagementTimeout; + UInt32 fMaxORBSize; + UInt32 fMaxCommandBlockSize; + UInt16 fLoginNodeID; + UInt32 fLoginGeneration; + UInt32 fLoginID; + UInt32 fReconnectHold; + UInt32 fMaxPayloadSize; + void * fRefCon; + + // resources + + FWSBP2LoginORB fLoginORB; + IOFWAddressSpace * fLoginORBAddressSpace; + FWAddress fLoginORBAddress; + + FWSBP2LoginResponse fLoginResponse; + IOFWAddressSpace * fLoginResponseAddressSpace; + FWAddress fLoginResponseAddress; + + FWSBP2ReconnectORB fReconnectORB; + IOFWAddressSpace * fReconnectORBAddressSpace; + FWAddress fReconnectORBAddress; + + FWSBP2StatusBlock fStatusBlock; + IOFWAddressSpace * fStatusBlockAddressSpace; + FWAddress fStatusBlockAddress; + + FWSBP2StatusBlock fReconnectStatusBlock; + IOFWAddressSpace * fReconnectStatusBlockAddressSpace; + FWAddress fReconnectStatusBlockAddress; + + FWSBP2LogoutORB fLogoutORB; + IOFWAddressSpace * fLogoutORBAddressSpace; + FWAddress fLogoutORBAddress; + bool fLogoutPending; + + IOFWWriteCommand * fLoginWriteCommand; + IOMemoryDescriptor * fLoginWriteCommandMemory; + bool fLoginWriteInProgress; + + IOFWWriteCommand * fReconnectWriteCommand; + IOMemoryDescriptor * fReconnectWriteCommandMemory; + bool fReconnectWriteInProgress; + bool fReconnectWriteInterrupted; + + IOFWWriteCommand * fLogoutWriteCommand; + IOMemoryDescriptor * fLogoutWriteCommandMemory; + bool fLogoutWriteInProgress; + + IOFWCommand * fLoginTimeoutCommand; + bool fLoginTimeoutTimerSet; + + IOFWDelayCommand * fReconnectTimeoutCommand; + bool fReconnectTimeoutTimerSet; + + IOFWCommand * fLogoutTimeoutCommand; + bool fLogoutTimeoutTimerSet; + + FWAddress fFetchAgentAddress; + IOMemoryDescriptor * fFetchAgentWriteCommandMemory; + FWAddress fLastORBAddress; + IOFireWireSBP2ORB * fLastORB; + IOFWWriteCommand * fFetchAgentWriteCommand; + bool fFetchAgentWriteCommandInUse; + FWSBP2FetchAgentWriteCallback fFetchAgentWriteCompletion; + void * fFetchAgentWriteRefCon; + IOFireWireSBP2ORB * fORBToWrite; + + OSSet * fORBSet; + OSIterator * fORBSetIterator; + + void * fPasswordBuf; + UInt32 fPasswordLen; + IOFWAddressSpace * fPasswordAddressSpace; + FWAddress fPasswordAddress; + IOMemoryDescriptor * fPasswordDescriptor; + + bool fSuspended; + + UInt32 fLoginRetryDelay; + UInt32 fLoginRetryCount; + UInt32 fLoginRetryMax; + IOFWDelayCommand * fLoginRetryTimeoutCommand; + bool fLoginRetryTimeoutTimerSet; + IOFireWireSBP2Target * fTarget; + + bool fUnsolicitedStatusEnableRequested; + + IOFWDelayCommand * fReconnectRetryTimeoutCommand; + bool fReconnectRetryTimeoutTimerSet; + + int fCriticalSectionCount; + + // init / destroy + virtual IOReturn getUnitInformation( void ); + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // orb add / remove + virtual IOReturn addORB( IOFireWireSBP2ORB * orb ); + static IOReturn staticExecuteAddORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeAddORB( IOFireWireSBP2ORB * orb ); + + static IOReturn staticExecuteRemoveORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeRemoveORB( IOFireWireSBP2ORB * orb ); + + // + // login + // + + static IOReturn staticExecuteLogin( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeLogin( void ); + virtual void abortLogin( void ); + + // login write complete handler + static void loginWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void loginWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // login timeout handler + static void loginTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void loginTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // status block write handler + static UInt32 statusBlockWriteStatic(void *refcon, UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon lockRead); + virtual UInt32 statusBlockWrite( UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon lockRead); + virtual void completeLogin( IOReturn state, const void *buf = NULL, UInt32 len = 0, void * buf2 = NULL ); + + // + // reconnect + // + + virtual void doReconnect( void ); + virtual void restartReconnect( void ); + virtual void startReconnectTimer( void ); + + // reconnect write complete handler + static void reconnectWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void reconnectWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // reconnect timeout handler + static void reconnectTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void reconnectTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // reconnect status block + static UInt32 reconnectStatusBlockWriteStatic(void *refcon, UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, + UInt32 len, const void *buf, IOFWRequestRefCon lockRead); + virtual UInt32 reconnectStatusBlockWrite( UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon lockRead); + + virtual void sendReconnectNotification( UInt32 event ); + virtual void sendReconnectNotificationWithStatusBlock( UInt32 event ); + + // + // logout + // + + static IOReturn staticExecuteLogout( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeLogout( void ); + + // logout write complete handler + static void logoutWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void logoutWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // logout timeout handler + static void logoutTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void logoutTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + virtual void completeLogout( IOReturn state, const void *buf = NULL, UInt32 len = 0); + + // fetch agent write complete handler + static void fetchAgentWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // fetch agent + // + + bool fFetchAgentResetInProgress; + UInt32 fFetchAgentResetBuffer; + FWAddress fFetchAgentResetAddress; + IOFWWriteQuadCommand * fFetchAgentResetCommand; + void * fFetchAgentResetRefCon; + FWSBP2StatusCallback fFetchAgentResetCompletion; + + static IOReturn staticExecuteFetchAgentReset( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeFetchAgentReset( void ); + static void fetchAgentResetCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void fetchAgentResetComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // doorbell + // + + bool fDoorbellInProgress; + bool fDoorbellRingAgain; + UInt32 fDoorbellBuffer; + FWAddress fDoorbellAddress; + IOFWWriteQuadCommand * fDoorbellCommand; + + static IOReturn staticExecuteDoorbell( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeDoorbell( void ); + static void doorbellCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void doorbellComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // enable unsolicited satus + // + + bool fUnsolicitedStatusEnableInProgress; + UInt32 fUnsolicitedStatusEnableBuffer; + FWAddress fUnsolicitedStatusEnableAddress; + IOFWWriteQuadCommand * fUnsolicitedStatusEnableCommand; + + static IOReturn staticExecuteUnsolicitedStatusEnable( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeUnsolicitedStatusEnable( void ); + static void unsolicitedStatusEnableCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void unsolicitedStatusEnableComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // busy timeout stuff + // + + bool fSetBusyTimeoutInProgress; + UInt32 fSetBusyTimeoutBuffer; + FWAddress fSetBusyTimeoutAddress; + IOFWWriteQuadCommand * fSetBusyTimeoutCommand; + + bool fInCriticalSection; + + UInt16 fLocalNodeID; + bool fFastStartSupported; + UInt32 fFastStartOffset; + UInt32 fFastStartMaxPayload; + + UInt32 fUserLoginGeneration; + bool fUserLoginGenerationSet; + + IOFWDelayCommand * fFetchAgentRetryTimerCommand; + bool fFetchAgentRetryTimerSet; + + virtual IOReturn executeSetBusyTimeout( void ); + static void setBusyTimeoutCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void setBusyTimeoutComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + +private: + // IOFireWireSBP2ORB friend class wrappers + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 0); + +protected: + virtual bool initORBWithLogin( IOFireWireSBP2ORB * orb, IOFireWireSBP2Login * login ); + virtual void setNextORBAddress( IOFireWireSBP2ORB * orb, FWAddress address ); + virtual void fetchAgentWriteComplete( IOFireWireSBP2ORB * orb, IOReturn status ); + virtual bool isORBTimerSet( IOFireWireSBP2ORB * orb ); + virtual void cancelORBTimer( IOFireWireSBP2ORB * orb ); + + // IOFireWireSBP2LUN friend class wrappers + virtual void removeLogin( void ); + virtual IOFireWireSBP2Target * getTarget( void ); + + UInt32 fARDMAMax; + bool fPhysicalAccessEnabled; + + bool fLoginStatusReceived; + FWSBP2StatusBlock fLoginStatusBlock; + UInt32 fLoginStatusBlockLen; + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 5); + +public: + + ////////////////////////////// + + /*! + @function createORB + @abstract Creates a new IOFireWireSBP2ORB for this login. + @discussion Create a new IOFireWireSBP2ORB for this login. It can be configured + with it's accessors and executed with submitORB below. + @result Returns a pointer to the new ORB object. + */ + + virtual IOFireWireSBP2ORB * createORB( void ); + + /*! + @function submitORB + @abstract Submits the given orb + @discussion Starts execution of the given ORB. If the ORB is an immediate ORB it's + addresss is written to the fetch agent. If it is a non immediate orb its address + is appended to the last orb of the currently processing chain. The doorbell is not + rung automatically it must be run manually with the ringDoorbell command described below. + @param orb The orb to be executed. + @result Returns kIOReturnSuccess if the ORB has been started successfully. + */ + + virtual IOReturn submitORB( IOFireWireSBP2ORB * orb ); + + // set callbacks + + /*! + @function setStatusNotifyProc + @abstract Sets the callback to be called on normal command status. + @discussion The supplied callback is called when normal command status is recieved, when + a normal command times out, or when a normal command is aborted. + "notificationEvent" in the callback's params will indicate what happened. + It will be set to one of the following values: kFWSBP2NormalCommandReset, kFWSBP2NormalCommandStatus, + or kFWSBP2NormalCommandTimeout. If the event type is kFWSBP2NormalCommandTimeout and "len" is + non-zero then "message" contains the data written to the status block. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2NotifyCallback. + */ + + virtual void setStatusNotifyProc( void * refCon, FWSBP2NotifyCallback callback ); + + /*! + @function getStatusNotifyProc + @abstract Returns the callback to be called on normal command status. + @discussion Returns the refCon and callback address of the status notify callback. + @param refCon output parameter returning the refCon to be passed to the callback. + @param callback output parameter returning the address of the callback. + */ + + virtual void getStatusNotifyProc( void ** refCon, FWSBP2NotifyCallback * callback ); + + /*! + @function setUnsolicitedStatusNotifyProc + @abstract Sets the callback to be called on normal command status. + @discussion The supplied callback is called when unsolicited status is recieved. + "notificationEvent" in the callback's params will indicate what happened. In this + case it will be set to kFWSBP2UnsolicitedStatus. If "len" is + non-zero then "message" contains the data written to the status block. Note: any buffers + returned by callbacks are only valid for the duration of the login and should not have + their contents modified. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2NotifyCallback. + */ + + virtual void setUnsolicitedStatusNotifyProc( void * refCon, FWSBP2NotifyCallback callback ); + + /*! + @function getUnsolicitedStatusNotifyProc + @abstract Returns the callback to be called on unsolicited status. + @discussion Returns the refCon and callback address of the unsolicited status notify callback. + @param refCon output parameter returning the refCon to be passed to the callback. + @param callback output parameter returning the address of the callback. + */ + + virtual void getUnsolicitedStatusNotifyProc( void ** refCon, FWSBP2NotifyCallback * callback ); + + // command handling + + /*! + @function setLoginCompletion + @abstract Sets the callback to be called when a login attempt is complete. + @discussion The supplied callback is called when a login attempt has completed. "status" in the + callback's params should be checked to determine the success or failure of the login attempt. + If "statusBlock" is non-null then login status was written and it has been supplied here. If + the login attempt was successful then the login response will be supplied in the "loginResponse" + buffer. Note: all buffers supplied to callbacks are only valid for the duration of the callback. + Also, you are not to modify the contents of any supplied buffer. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2LoginCallback. + */ + + virtual void setLoginCompletion( void * refCon, FWSBP2LoginCallback completion ); + + /*! + @function submitLogin + @abstract Attempts to login to the LUN. + @discussion This call begins the login process. The login object should be configured prior + to this call. If kIOReturnSuccess is returned from this call then the loginCompletion routine + will be called when the login completes (successfully or unsuccesfully). + @result Returns kIOReturnSuccess login has successlly begun. + */ + + virtual IOReturn submitLogin( void ); + + /*! + @function submitLogout + @abstract Attempts to logout of the LUN. + @discussion This call begins the logout process. If kIOReturnSuccess is returned from this call then + the logoutCompletion routine will be called when the logout completes (successfully or unsuccesfully). + @result Returns kIOReturnSuccess if logout has successfully begun. + */ + + virtual IOReturn submitLogout( void ); + + /*! + @function setLogoutCompletion + @abstract Sets the callback to be called when a logout attempt is complete. + @discussion The supplied callback is called when a logout attempt has completed. "status" in the + callback's params should be checked to determine the success or failure of the logout attempt. + If "statusBlock" is non-null then logout status was written and it has been supplied here. + Note: all buffers supplied to callbacks are only valid for the duration of the callback. + Also, you are not to modify the contents of any supplied buffer. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2LogoutCallback. + */ + + virtual void setLogoutCompletion( void * refCon, FWSBP2LogoutCallback completion ); + + /*! + @function setFetchAgentWriteCompletion + @abstract Sets the callback to be called when the fetch agent write completes. + @discussion When an immediate orb is executed with submitORB, it's address is written to a + specific address on the device. This address is called the fetch agent. The device the + reads that orb from the Mac's memory and executes it. With this call you can register to + be called back when this write to the fetch agent completes. The SBP2 services guarantee + that the fetch agent write will be complete before status is reported for an ORB, so for + most drivers this notification is not required. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2FetchAgentWriteCallback. + */ + + virtual void setFetchAgentWriteCompletion( void * refCon, FWSBP2FetchAgentWriteCallback completion ); + + /*! + @function setFetchAgentResetCompletion + @abstract Sets the callback to be called when a fetch agent reset completes. + @discussion The fetch agent state machine on the device can be reset by a write to a specific + register. The SBP2 services offer a utility method to reset the fetch agent. You can register + a callback routine here to be notified when this rest write completes. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2FetchAgentWriteCallback. + */ + + virtual void setFetchAgentResetCompletion( void * refCon, FWSBP2StatusCallback completion ); + + /*! + @function submitFetchAgentReset + @abstract Resets the LUN's fetch agent. + @discussion The fetch agent state machine on the device can be reset by a write to a specific + register. This reset can be intiated by a call to this method. Notification of the completion + of this write can be had by registering a callback with the setFetchAgentResetCompletion method. + @result Returns kIOReturnSuccess if the reset started successfully. + */ + + virtual IOReturn submitFetchAgentReset( void ); + + /*! + @function ringDoorbell + @abstract Rings the doorbell on the LUN. + @discussion Non-immediate appends to the ORB chain may require the fetch agent state machine + to be notified of the new ORB's presence. This is accomplished by writing to the so called + doorbell register. This method begins one of those writes. + @result Returns kIOReturnSuccess if the ring started successfully. + */ + + virtual IOReturn ringDoorbell( void ); + + /*! + @function enableUnsolicitedStatus + @abstract Enables unsolicited status. + @discussion After unsolicited is sent the device will not send any additional unsolicited status + until a specific register is written. This serves as a sort of flow-control for unsolicited status. + After unsolicited status is recieved and processed drivers will want to reenable the delivery + of unsolicted status by a call to this method. + @result Returns kIOReturnSuccess if the status enable write started successfully. + */ + + virtual IOReturn enableUnsolicitedStatus( void ); + + // accessors + + /*! + @function getMaxCommandBlockSize + @abstract Returns the maximum command block size. + @discussion The device publishes an upper limit on the size of command block that it can + accept. That value can be accessed via this method. + @result Returns a UInt32 containing the maximum command block size. + */ + + virtual UInt32 getMaxCommandBlockSize( void ); + + /*! + @function getLoginID + @abstract Returns the current login ID. + @discussion When we successfully login to a device. The device gives us a unique login id. + This is used internally for reconnecting to the device after bus resets and for certain other + management ORBs. Most drivers are probably not interested in this value. + @result Returns a UInt32 containing the current login ID. + */ + + virtual UInt32 getLoginID( void ); + + /*! + @function setLoginFlags + @abstract Sets login configuration flags. + @discussion Configures the login behavior according to the provided flags. Currently two + flags are defined for this API. kFWSBP2ExclusiveLogin sets the exclusive login bit in the + login ORB. kFWSBP2DontSynchronizeMgmtAgent allows simultaneous logins or reconnects to LUNs + with a common management agent (ie LUNs in the same unit directory). + @param loginFlags the login configuration flags. + */ + + virtual void setLoginFlags( UInt32 loginFlags ); + + /*! + @function getLoginFlags + @abstract Returns the currently set login flags. + @discussion Returns the current state of the login flags. Currently there is only one + flag defined for this API. kFWSBP2ExclusiveLogin indicates that the exclusive login bit + should be set in the login ORB. + @result Returns a UInt32 containing the currently set login flags. + */ + + virtual UInt32 getLoginFlags( void ); + + /*! + @function setReconnectTime + @abstract Sets the desired reconnect duration. + @discussion The target and initiator arbitrate the duration of the reconnect timeout. Here + the initiator specifies its desired timeout time in 2^reconnectTime seconds. After a + successful login the device returns the actual timeout value it wishes to use. This value + may be less than the reconnect timeout that the intiator specified if this is all that the + device can support. + @param reconnectTime The desired reconnect timeout encoded as 2^reconnectTime seconds. + */ + + virtual void setReconnectTime( UInt32 reconnectTime ); + + /*! + @function getReconnectTime + @abstract Returns the currently set reconnect time. + @discussion Returns the currently desired initiator reconnect time encoded as 2^time seconds. + @result Returns a UInt32 containing the currently set reconnect time. + */ + + virtual UInt32 getReconnectTime( void ); + + /*! + @function setMaxPayloadSize + @abstract Sets the maximum data transfer length for a normal command ORB. + @discussion Sets the maximum data transfer length for a normal command ORB. This value is + the maximum for all ORBs sent to this LUN. This can be trimmed further on an ORB by ORB basis, + by a similar call in the IOFireWireSBP2ORB itself. + @param reconnectTime The desired maximum payload size in bytes. + */ + + virtual void setMaxPayloadSize( UInt32 maxPayloadSize ); + + /*! + @function getMaxPayloadSize + @abstract Returns the currently set maximum payload size. + @discussion Returns the currently global maximum payload size in bytes. + @result Returns a UInt32 containing the currently set maximum payload size. + */ + + virtual UInt32 getMaxPayloadSize( void ); + + /*! + @function setPassword + @abstract Sets the login password. + @discussion Sets the login password using a buffer and a length. An alternate version exists + that accepts an IOMemoryDescriptor. If the password length is 8 or less the password is copied + directly into the login orb. If the length is greater than 8 the buffer is referenced by address + in the login ORB. In this case the buffer is not copied and should remain allocated for the + duration of the login attempt. + @param buf a pointer to the password buffer. + @param len the length in bytes of the password buffer. + @result Returns kIOReturnSuccess on success. + */ + + virtual IOReturn setPassword( void * buf, UInt32 len ); + + /*! + @function setPassword + @abstract Sets the login password. + @discussion Sets the login password using an IOMemoryDescriptor. An alternate version exists + that accepts a buffer and a length. If the password length is 8 or less the password is copied + directly into the login orb. If the length is greater than 8 the buffer is referenced by address + in the login ORB. + @param memory an IOMemoryDescriptor referencing the password. + @result Returns kIOReturnSuccess on success. + */ + + virtual IOReturn setPassword( IOMemoryDescriptor * memory ); + + + /*! + @function setRefCon + @abstract Sets the login refCon. + @discussion Sets a user defined value on the login that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon( void * refCon ); + + /*! + @function getRefCon + @abstract Returns the refCon set with setRefCon. + @discussion Returns the user defined value previously stored in the login with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual void * getRefCon( void ); + + /*! + @function setBusyTimeoutRegisterValue + @abstract Sets the value to be written to the BUSY_TIMEOUT register. + @discussion 1394-1995 defines a register known as the BUSY_TIMEOUT register. This register + controls the busy retry behavior of your device. The initial value for this register is + 0x00000000. Which means busied transactions will not be retried. Since most devices want + their transactions retired on busy acks, the SBP2 service automatically updates the + BUSY_TIMEOUT register with the value specified here whenever necessary. Most drivers should + set this value to 0x0000000f. + @param timeout desired value of the BUSY_TIMEOUT register. + */ + + virtual void setBusyTimeoutRegisterValue( UInt32 timeout ); + +protected: + + virtual void startORBTimer( IOFireWireSBP2ORB * orb ); + virtual void prepareORBForExecution( IOFireWireSBP2ORB * orb ); + + static IOReturn staticExecuteORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeORB( IOFireWireSBP2ORB * orb ); + +public: + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. When retainCount == when then call free(). + */ + + virtual void release() const; + + /*! + @function setLoginRetryCountAndDelayTime + @abstract Sets login retry behavior. + @discussion Sets login retry behavior. + @param retryCount number of times to retry logins + @param uSecs delay time in microseconds between login retries + */ + + virtual void setLoginRetryCountAndDelayTime( UInt32 retryCount, UInt32 uSecs ); + +protected: + virtual IOReturn initialExecuteLogin( void ); + virtual void startLoginRetryTimer( void ); + virtual void stopLoginRetryTimer( void ); + static void loginRetryTimeoutStatic( void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void loginRetryTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + + virtual void startReconnectRetryTimer( void ); + virtual void stopReconnectRetryTimer( void ); + static void reconnectRetryTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void reconnectRetryTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + virtual bool isORBAppended( IOFireWireSBP2ORB * orb ); + virtual void setORBIsAppended( IOFireWireSBP2ORB * orb, bool state ); + +public: + virtual void setAddressLoForLoginORBAndResponse( UInt32 addressLoORB, UInt32 addresLoResponse ); + + virtual void setLoginGeneration( UInt32 generation ); + virtual void clearLoginGeneration( void ); + +protected: + void startFetchAgentRetryTimer( UInt32 duration ); + void stopFetchAgentRetryTimer( void ); + static void fetchAgentRetryTimerStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + void fetchAgentRetryTimer( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + void terminateNotify( void ); + void processLoginWrite( void ); + +public: + + bool isPhysicalAccessEnabled( void ); + UInt32 getARDMMax( void ); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 8); + + }; + +#endif diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2ManagementORB.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2ManagementORB.h.svn-base new file mode 100644 index 0000000..9455383 --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2ManagementORB.h.svn-base @@ -0,0 +1,345 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2ManagementORB + Contains the class definition for IOFireWireSBP2ManagementORB. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2MANAGEMENTORB_H +#define _IOKIT_IOFIREWIRESBP2MANAGEMENTORB_H + +#include +#include + +#include + +class IOFireWireSBP2LUN; +class IOFireWireSBP2ManagementORB; +class IOFireWireSBP2ORB; + +enum +{ + kFWSBP2QueryLogins = 1, + kFWSBP2AbortTask = 0xb, + kFWSBP2AbortTaskSet = 0xc, + kFWSBP2LogicalUnitReset = 0xe, + kFWSBP2TargetReset = 0xf +}; + +// Callback when management command completes asynchronously + +/*! + @typedef FWSBP2ManagementCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. + @param orb Indicates current orb status is for. +*/ + +typedef void (*FWSBP2ManagementCallback)(void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb); + +/*! + @class IOFireWireSBP2ManagementORB + @abstract Supplies non login related management ORBs. Management ORBs can be executed independent + of a login, if necessary. Management ORBs are created using the IOFireWireSBP2LUN interface. +*/ + +class IOFireWireSBP2ManagementORB : public IOFWCommand +{ + OSDeclareDefaultStructors( IOFireWireSBP2ManagementORB ) + + friend class IOFireWireSBP2LUN; + friend class IOFireWireSBP2UserClient; + +protected: + + //////////////////////////////////////// + // rom keys + + enum + { + kUnitCharacteristicsKey = 0x3A, + kManagementAgentOffsetKey = 0x54 + }; + + //////////////////////////////////////// + // structs + + typedef struct + { + UInt32 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 reserved1[2]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2TaskManagementORB; + + typedef struct + { + UInt32 reserved1[2]; + UInt32 queryResponseAddressHi; + UInt32 queryResponseAddressLo; + UInt16 options; + UInt16 lun; + UInt16 reserved2; + UInt16 queryResponseLength; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2QueryLoginsORB; + + typedef struct + { + UInt8 details; + UInt8 sbpStatus; + UInt16 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 status[6]; + } FWSBP2StatusBlock; + +protected: + + //////////////////////////////////////// + // friend methods + + // IOFireWireSBP2LUN methods + virtual bool initWithLUN( IOFireWireSBP2LUN * lun, + void * refCon, + FWSBP2ManagementCallback completion ); + + // IOFireWireSBP2UserClient methods + virtual void setAsyncCallbackReference( void * asyncRef ); + virtual void getAsyncCallbackReference( void * asyncRef ); + +protected: + + // reserved for future use + struct ExpansionData + { + bool fInCriticalSection; + }; + ExpansionData * fExpansionData; + + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + + UInt32 fManagementOffset; + UInt32 fManagementTimeout; + UInt32 fFunction; + OSObject * fManageeCommand; + + // our orb + FWSBP2TaskManagementORB fManagementORB; + IOFWAddressSpace * fManagementORBAddressSpace; + FWAddress fManagementORBAddress; + + // command to write management agent + IOFWWriteCommand * fWriteCommand; + IOMemoryDescriptor * fWriteCommandMemory; + + // timeout + IOFWCommand * fTimeoutCommand; + bool fTimeoutTimerSet; + + // status block + FWSBP2StatusBlock fStatusBlock; + IOFWAddressSpace * fStatusBlockAddressSpace; + FWAddress fStatusBlockAddress; + + // response buffer + void * fResponseBuf; + UInt32 fResponseLen; + IOFWAddressSpace * fResponseAddressSpace; + FWAddress fResponseAddress; + + // competion routine + FWSBP2ManagementCallback fCompletionCallback; + void * fCompletionRefCon; + + // for user client + OSAsyncReference64 fCallbackAsyncRef; + + IOMemoryMap * fResponseMap; + + bool fCompleting; + + //////////////////////////////////////// + + // init / destroy + virtual IOReturn getUnitInformation( void ); + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // command execution + virtual IOReturn execute( void ); + virtual IOReturn complete( IOReturn state ); + + // write complete handler + static void writeCompleteStatic( void *refcon, + IOReturn status, + IOFireWireNub *device, + IOFWCommand *fwCmd ); + virtual void writeComplete( IOReturn status, + IOFireWireNub *device, + IOFWCommand *fwCmd ); + + // timeout handler + static void handleTimeoutStatic( void *refcon, + IOReturn status, + IOFireWireBus *bus, + IOFWBusCommand *fwCmd ); + virtual void handleTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // status block write handler + static UInt32 statusBlockWriteStatic( void *refcon, + UInt16 nodeID, + IOFWSpeed &speed, + FWAddress addr, + UInt32 len, + const void *buf, + IOFWRequestRefCon lockRead ); + virtual UInt32 statusBlockWrite( UInt16 nodeID, + FWAddress addr, + UInt32 len, + const void *buf, + IOFWRequestRefCon lockRead ); + + // IOFireWireSBP2LUN friend class wrappers + virtual void clearAllTasksInSet( void ); + virtual void removeManagementORB( IOFireWireSBP2ManagementORB * orb ); + +public: + + //////////////////////////////////////// + // client methods + + /*! + @function setCommandFunction + @abstract Sets the function of the management ORB. + @discussion Sets the the function of the management ORB. Legal values are kFWSBP2QueryLogins, + kFWSBP2AbortTask, kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset. + @param function a value indicating the desired management function. + @result Returns kIOReturnSuccess if function was a legal function. + */ + + virtual IOReturn setCommandFunction( UInt32 function ); + + /*! + @function getCommandFunction + @abstract Returns the current function of the management ORB. + @discussion Returns the function of the management ORB. This is the same value that was + set with setCommandFunction. + @result Returns the function of the management ORB. + */ + + virtual UInt32 getCommandFunction( void ); + + /*! + @function setManageeCommand + @abstract Sets the command to be managed by the management ORB. + @discussion All management functions except kFWSBP2QueryLogins require a reference to an ORB of + some sort. kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset require a + reference to the login ORB. kFWSBP2AbortTask requires a reference to the ORB to be aborted. + This method allows you to set the ORB to be managed. + @param command a reference to an IOFireWireSBP2Login or an IOFireWireSBP2ORB. + */ + + virtual void setManageeCommand( OSObject * command ); + + /*! + @function getCommandFunction + @abstract Returns the current managee command of the management ORB. + @discussion Returns the current managee command of the management ORB. This is the same value that was + set with setManageeCommand. + @result Returns the current managee command of the management ORB. + */ + + virtual OSObject* getManageeCommand( void ); + + /*! + @function setResponseBuffer + @abstract Sets the response buffer for the management ORB. + @discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns + a response to its query and needs to write it somewhere. This routine allows you to + specify the location. + @param desc memory descriptor for buffer. + @result Returns kIOReturnSuccess on a success. + */ + + virtual IOReturn setResponseBuffer( IOMemoryDescriptor * desc ); + + /*! + @function setResponseBuffer + @abstract Sets the response buffer for the management ORB. + @discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns + a response to its query and needs to write it somewhere. This routine allows you to + specify the location. + @param buf backing store for buffer + @param len length of buffer. + @result Returns kIOReturnSuccess on a success. + */ + + virtual IOReturn setResponseBuffer( void * buf, UInt32 len ); + + /*! + @function getResponseBuffer + @abstract Returns the response buffer for the management ORB. + @discussion Returns the response buffer set in setResponseBuffer above + @param desc memory descriptor for buffer. + @param buf output parameter for backing store for buffer + @param len output parameter for length of buffer. + */ + + virtual void getResponseBuffer( void ** buf, UInt32 * len ); + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. + @param when When retainCount == when then call free(). + */ + + virtual void release() const; + +protected: + + virtual void setORBToDummy( IOFireWireSBP2ORB * orb ); + + virtual void suspendedNotify(); + +private: + + OSMetaClassDeclareReservedUsed(IOFireWireSBP2ManagementORB, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 8); + +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2ORB.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2ORB.h.svn-base new file mode 100644 index 0000000..5c11593 --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2ORB.h.svn-base @@ -0,0 +1,547 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2ORB + Contains the class definition for IOFireWireSBP2ORB. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2ORB_H +#define _IOKIT_IOFIREWIRESBP2ORB_H + +#include + +#include +#include +#include + +enum +{ + kFWSBP2ConstraintForceDoubleBuffer = (1 << 0) +}; + +// login option flags +enum +{ + kFWSBP2CommandCompleteNotify = (1 << 0), + kFWSBP2CommandTransferDataFromTarget = (1 << 1), + kFWSBP2CommandImmediate = (1 << 2), + + kFWSBP2CommandNormalORB = (1 << 5), + kFWSBP2CommandReservedORB = (1 << 6), + kFWSBP2CommandVendorORB = (1 << 7), + kFWSBP2CommandDummyORB = (1 << 8), + kFWSBP2CommandCheckGeneration = (1 << 9), + + kFWSBP2CommandFixedSize = (1 << 10), + kFWSBP2CommandVirtualORBs = (1 << 11) // handy for debugging +}; + +enum +{ + kFWSBP2MaxPageClusterSize = 0xf000 +}; + +class IOFireWireSBP2ORB; +class IOFireWireSBP2LUN; +class IOFireWireSBP2Login; + +/*! + @class IOFireWireSBP2ORB + @abstract Represents an SBP2 normal command ORB. Supplies the APIs for configuring normal + command ORBs. This includes setting the command block and writing the page tables for I/O. + The ORBs are executed using the submitORB method in IOFireWireSBP2Login. +*/ + +class IOFireWireSBP2ORB : public IOCommand +{ + OSDeclareDefaultStructors( IOFireWireSBP2ORB ) + + friend class IOFireWireSBP2Login; + friend class IOFireWireSBP2ManagementORB; + +protected: + + typedef struct + { + UInt32 nextORBAddressHi; + UInt32 nextORBAddressLo; + UInt32 dataDescriptorHi; + UInt32 dataDescriptorLo; + UInt16 options; + UInt16 dataSize; + UInt32 commandBlock[1]; // will be variable sized + } FWSBP2ORB; + + typedef struct + { + UInt16 segmentLength; + UInt16 segmentBaseAddressHi; + UInt32 segmentBaseAddressLo; + } FWSBP2PTE; + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 8); + +protected: + + virtual void deallocateBufferAddressSpace( void ); + virtual IOReturn allocateTimer( void ); + virtual void deallocateTimer( void ); + + /*! + @function deallocatePageTable + @abstract Frees up memory allocated for the page table. + @discussion Frees all memory associated with the page table. Undoes what allocatePageTable does. + Calling allocatePageTable again will automatically deallocate the existing page table before + allocating a new one, so this method is not used in most cases. + */ + + virtual void deallocatePageTable( void ); + +protected: + + // IOFireWireSBP2Login methods + virtual bool initWithLogin( IOFireWireSBP2Login * login ); + virtual void setNextORBAddress( FWAddress address ); + +public: + + /*! + @function allocatePageTable + @abstract Allocates memory for the page table. + @discussion Page table allocation is handle automatically by the ORB, except if the + kFWSBP2CommandFixedSize flags is set. In this case we will fail to write a page table if we + need more page table space than we have already. This method is exposed so these drivers + can preallocate as much page table as they need. This is useful if your driver is part of + the paging path and cannot allow allocations to occur. + @param entryCount number of entries of page table to be allocated. + */ + + virtual IOReturn allocatePageTable( UInt32 entryCount ); + +protected: + + virtual bool isTimerSet( void ); + virtual void cancelTimer( void ); + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + IOFireWireSBP2Login * fLogin; + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + IOFireWireController * fControl; + IODMACommand * fDMACommand; + void * fUnused2; + + UInt32 fCommandFlags; + UInt32 fMaxPayloadSize; + UInt32 fTimeoutDuration; + UInt32 fGeneration; + UInt64 fRefCon; + + // + // orb + // + + IOMemoryDescriptor * fORBDescriptor; + FWSBP2ORB * fORBBuffer; + + FWAddress fORBPseudoAddress; + IOFWAddressSpace * fORBPseudoAddressSpace; + + IOFWAddressSpace * fORBPhysicalAddressSpace; + FWAddress fORBPhysicalAddress; + + // + // page table + // + + UInt32 fPageTableSize; + IOBufferMemoryDescriptor * fPageTableDescriptor; + + IOFWAddressSpace * fPageTablePhysicalAddressSpace; + FWAddress fPageTablePhysicalAddress; + UInt32 fPageTablePhysicalLength; + + IOFWAddressSpace * fPageTablePseudoAddressSpace; + FWAddress fPageTablePseudoAddress; + + // + // buffers + // + + IOFWAddressSpace * fBufferAddressSpace; + bool fBufferAddressSpaceAllocated; + IOMemoryDescriptor * fBufferDescriptor; + + // + // timer + // + + IOFWDelayCommand * fTimeoutCommand; + bool fTimeoutTimerSet; + + bool fInProgress; + bool fIsAppended; + + UInt32 fFetchAgentWriteRetries; + UInt32 fPTECount; + UInt32 fFetchAgentWriteRetryInterval; + + UInt32 fConstraintOptions; + + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // orb timeout handler + static void orbTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void orbTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // login friend class wrappers + virtual IOFireWireUnit * getFireWireUnit( void ); + virtual IOFireWireSBP2LUN * getFireWireLUN( void ); + virtual void deallocateORB( void ); + virtual IOReturn allocateORB( UInt32 orbSize ); + virtual IOReturn removeORB( IOFireWireSBP2ORB * orb ); + virtual void prepareORBForExecution( void ); + virtual void startTimer( void ); + virtual void sendTimeoutNotification( IOFireWireSBP2ORB * orb ); + +public: + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. + @param when When retainCount == when then call free(). + */ + + virtual void release() const; + + /*! + @function getLogin + @abstract Gets the login associated with this ORB. + @discussion Returns the IOFireWireSBP2Login object associated with this ORB. + @result Returns a pointer to an IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2Login * getLogin( void ); + + /*! + @function setCommandBuffersAsRanges + @abstract Creates a page table from a list of ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. + @param ranges An array of ranges representing the data to be transfered. + @param withCount The number of ranges in the ranges array. + @param withDirection An IODirection indicating the direction of data transfer. + @param withTask The task that these adressses reside in. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + virtual IOReturn setCommandBuffersAsRanges( IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + UInt32 offset = 0, + UInt32 length = 0 ); + /*! + @function setCommandBuffersAsRanges + @abstract Creates a page table from a list of ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. + @param memoryDescriptor IOMemoryDescriptor describe ranges to be written to a page table. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + virtual IOReturn setCommandBuffers( IOMemoryDescriptor * memoryDescriptor, UInt32 offset = 0, + UInt32 length = 0 ); + + + /*! + @function releaseCommandBuffers + @abstract Releases SBP2's reference to the command buffers. + @discussion When you create a page table with one of the variants of setCommandBuffers. + SBP2 holds on to a reference to the buffers until this method is called. This means that + if a command completed and you manipulated the memory descriptor or released the buffers + without calling this method you could leave FW in an inconsistent state. + @result Returns KIOReturnSuccess if the page table was cleared successfully. + */ + + virtual IOReturn releaseCommandBuffers( void ); + + /*! + @function setCommandBlock + @abstract Sets the command block portion of the ORB. + @discussion Copys the data provided in the buffer to the command block portion of the ORB. + @param buffer Pointer to buffer to copy command block from. + @param length Number of bytes of data to copy. + @result Returns KIOReturnSuccess if the command block was updated successfully. + */ + + virtual IOReturn setCommandBlock( void * buffer, UInt32 length ); + + /*! + @function setCommandBlock + @abstract Sets the command block portion of the ORB. + @discussion Copys the data provided in the buffer to the command block portion of the ORB. + @param memory IOMemoryDescriptor representing the command block buffer. + @result Returns KIOReturnSuccess if the command block was updated successfully. + */ + + virtual IOReturn setCommandBlock( IOMemoryDescriptor * memory ); + + /*! + @function getCommandBufferDescriptor + @abstract Returns the memory descriptor representing the command buffer. + @discussion Returns the IOMemoryDescriptor for the data mapped by setCommandBuffer variants. + Works for setCommandBuffersAsRanges too. + @result Returns memory descriptor representing mapped data buffers. + */ + + virtual IOMemoryDescriptor * getCommandBufferDescriptor( void ); + + // accessors + + /*! + @function setCommandFlags + @abstract Sets configuration flags for the ORB. + @discussion Sets the configuration flags for the ORB. These can be any of the following: +

kFWSBP2CommandCompleteNotify - Set the notify bit as specified in SBP2 standard. Set to receive completion/timeout notification on this ORB. You almost always want to set this.

+

kFWSBP2CommandTransferDataFromTarget - Transfer direction as specified in SBP2 standard. Set if data is to be written by the device into the host's memory.

+

kFWSBP2CommandImmediate - Immediate Append. ORB address will be written to fetch agent and not chained. It is only legal to have one immediate ORB in progress at a time.

+

kFWSBP2CommandNormalORB - ORB format 0 - Format specified by SBP2 standard. Set this for most ORBs.

+

kFWSBP2CommandReservedORB - ORB format 1 - Format reserved by SBP2 standard for future standardization.

+

kFWSBP2CommandVendorORB - ORB format 2 - Format specified by SBP2 standard for vendor dependent ORBs.

+

kFWSBP2CommandDummyORB - ORB format 3 - Format specified by SBP2 standard for dummy ORBs.

+

kFWSBP2CommandCheckGeneration - If set upon submitORB, the ORB will only be appended if generation set with setCommandGeneration() matches the current generation. Pretty much all SBP2 drivers need sophisticated logic to track login state, so this is generally not used.

+

kFWSBP2CommandFixedSize - Do not allocate more memory for page table if needed. If there is not enough space in the currently allocated page table, the setCommandBuffers call will fail. This is important to set if your device is the backing store, as we don't want to cause memory allocations on the paging path.

+

kFWSBP2CommandVirtualORBs - Normally ORBs are backed by physical address spaces. Setting this flag makes this ORB backed by a pseudo address space. This can make ORBs easier to see in a bus trace. Virtual ORBs will have an address in the form of ffcX.XXXX.0000.0000. Pseudo address space backed ORBs are slower, so you won't want to set for deployment builds.

+ @param flags The flags to be set. + */ + + virtual void setCommandFlags( UInt32 flags ); + + /*! + @function getCommandFlags + @abstract Sets configuration flags for the ORB. + @discussion Returns the current configuration flags set on this ORB. + @result Return The current ORB flags. + */ + + virtual UInt32 getCommandFlags( void ); + + /*! + @function setMaxPayloadSize + @abstract Sets max payload size for the ORB. + @discussion This sets the maximum payload size for this ORB only. This size is clipped by + the global max payload size set in the login object. + @param maxPayloadSize The maximum payload size in bytes. + */ + + virtual void setMaxPayloadSize( UInt32 maxPayloadSize ); + + /*! + @function getMaxPayloadSize + @abstract Gets max payload size for the ORB. + @discussion This gets the maximum payload size for this ORB only. + @result Returns the maximum payload size in bytes. + */ + + virtual UInt32 getMaxPayloadSize( void ); + + /*! + @function setCommandTimeout + @abstract Sets the timeout of the ORB. + @discussion This sets the timeout for the ORB in milliseconds. Note that ORBs without timeouts + can be "lost." You will obviously not recieve timeout notification for timeouts of zero. But + perhaps less obviously you will not recieve orb reset notification, which is really a sort of + accelerated timeout notification for bus reset situations. + @param timeout The timeout duration in milliseconds. + */ + + virtual void setCommandTimeout( UInt32 timeout ); + + /*! + @function getCommandTimeout + @abstract Gets the timeout of the ORB. + @discussion This method gets the timeout for this ORB in milliseconds. + @result Returns the timeout for the orb in milliseconds. + */ + + virtual UInt32 getCommandTimeout( void ); + + + /*! + @function setCommandGeneration + @abstract Sets the command generation. + @discussion This sets the bus generation this ORB should be appended in. It is only meaningful + when combined with the kFWSBP2CommandCheckGeneration flags above. + @param gen The bus generation for command execution. + */ + + virtual void setCommandGeneration( UInt32 gen ); + + /*! + @function getCommandGeneration + @abstract Gets the command generation. + @discussion This gets the bus generation this ORB should be appended in. + @result Returns the bus generation for command execution. + */ + + virtual UInt32 getCommandGeneration( void ); + + /*! + @function setRefCon + @abstract Sets the ORB refCon. + @discussion Sets a user defined value on the ORB that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon( void * refCon ); + + /*! + @function getRefCon + @abstract Returns the refCon set with setRefCon. + @discussion Returns the user defined value previously stored in the ORB with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual void * getRefCon( void ); + +protected: + + virtual void setToDummy( void ); + +public: + /*! + @function getORBAddress + @abstract Returns the FireWire address of this ORB. + @discussion Returns the FireWire bus address of this ORB. This is not the same as the Macintosh + address for the IOFireWireSBP2ORB. + @result Returns the FireWire address of this ORB. + */ + + virtual void getORBAddress( FWAddress * address ); + +protected: + + virtual bool isAppended( void ); + virtual void setIsAppended( bool state ); + virtual UInt32 getFetchAgentWriteRetries( void ); + virtual void setFetchAgentWriteRetries( UInt32 retries ); + + virtual void prepareFastStartPacket( IOBufferMemoryDescriptor * descriptor ); + + UInt32 getFetchAgentWriteRetryInterval( void ); + void setFetchAgentWriteRetryInterval( UInt32 interval ); + + IOReturn completeBufferAddressSpace( void ); + IOReturn prepareBufferAddressSpace( IOMemoryDescriptor * memoryDescriptor ); + +public: + + /*! + @function setBufferConstraints + @abstract Configures page table generation parameters + @discussion Sets the maximums size of any page table segment and the required alignemnt. Double buffering + may be used to satisfy these constraints. The only supported option is kFWSBP2ConstraintForceDoubleBuffer which + forces a page aligned double buffering of the entire descriptor. + @result May return an error if there is a problem allocating the underlying resources or if buffers are currently attached. + */ + + IOReturn setBufferConstraints( UInt64 maxSegmentSize, UInt32 alignment, UInt32 options = 0); + + + /*! + @function setCommandBuffersAsRanges64 + @abstract Creates a page table from a list of 64 bit ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. This is a 64 bit compatible version of setCommandBuffersAsRanges. + @param ranges An array of ranges representing the data to be transfered. + @param withCount The number of ranges in the ranges array. + @param withDirection An IODirection indicating the direction of data transfer. + @param withTask The task that these adressses reside in. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + IOReturn setCommandBuffersAsRanges64( IOAddressRange * ranges, + uint64_t withCount, + IODirection withDirection, + task_t withTask, + uint64_t offset = 0, + uint64_t length = 0); + + /*! + @function setRefCon64 + @abstract Sets the ORB refCon as a 64 bit value. + @discussion Sets a user defined value on the ORB that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon64( UInt64 refCon ); + + /*! + @function getRefCon64 + @abstract Returns the 64 bit refCon set with setRefCon64. + @discussion Returns the user defined value previously stored in the ORB with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual UInt64 getRefCon64( void ); + +protected: + + UInt32 calculateTransferSizeLog( bool * clipping ); + + +}; + +#endif diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2Target.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2Target.h.svn-base new file mode 100644 index 0000000..4288ce9 --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2Target.h.svn-base @@ -0,0 +1,224 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2Target + Contains the class definition for IOFireWireSBP2Target. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2TARGET_H +#define _IOKIT_IOFIREWIRESBP2TARGET_H + +#include +#include + +enum +{ + kIOFWSBP2FailsOnAckBusy = (1 << 0), + kIOFWSBP2FailsOnBusResetsDuringIO = (1 << 1), + kIOFWSBP2DontUsePTPacketLimit = (1 << 2) +}; + +/*! + @class IOFireWireSBP2Target + @abstract Serves as bridge between IOFireWireUnit and IOFireWireLUN. + @discussion Matches against IOFireWireUnits supporting the SBP2 protocol. Creates IOFireWireSBP2LUN nubs for matching. Most drivers will match against an IOFireWireSBP2LUN, but matching against an IOFireWireSBP2Target is also supported. This can be useful in cases where a single driver wishes to + control all LUNs on a device. Support for this technique is minimal, however, and the driver will be + required to discover it's LUNs through the registry. +*/ + +class IOFireWireSBP2Target : public IOService +{ + OSDeclareDefaultStructors(IOFireWireSBP2Target); + +protected: + + ///////////////////////////////////////// + // rom keys + + enum + { + kCmdSpecIDKey = 0x38, + kCmdSetKey = 0x39, + kSoftwareRevKey = 0x3b, + kFirmwareRevKey = 0x3c, + kLUNKey = 0x14, + kLUNDirectoryKey = 0xd4, + kManagementAgentOffsetKey = 0x54, + kUnitCharacteristicsKey = 0x3A, + kRevisionKey = 0x21, + kFastStartKey = 0x3E + }; + + typedef struct + { + UInt32 cmdSpecID; + UInt32 cmdSet; + UInt32 vendorID; + UInt32 softwareRev; + UInt32 firmwareRev; + UInt32 lun; + UInt32 devType; + UInt32 unitCharacteristics; + UInt32 managementOffset; + UInt32 revision; + bool fastStartSupported; + UInt32 fastStart; + } LUNInfo; + + // reserved for future use + struct ExpansionData + { + bool fStarted; + OSArray * fPendingMgtAgentCommands ; + UInt32 fNumberPendingMgtAgentOrbs; + UInt32 fNumLUNs; + }; + ExpansionData * fExpansionData; + + ///////////////////////////////////////// + // private fields + + bool fOpenFromTarget; + UInt32 fOpenFromLUNCount; + IOFireWireUnit * fProviderUnit; + UInt32 fFlags; + + IOFireWireController * fControl; + + UInt32 fIOCriticalSectionCount; + + ///////////////////////////////////////// + // private internals + + virtual void free( void ); + virtual IOReturn message( UInt32 type, + IOService * provider, + void * argument = 0); + + virtual void scanForLUNs( void ); + IOReturn createLUN( LUNInfo * info ); + +public: + + ///////////////////////////////////////// + // public methods + + /*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. */ + + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ); + + /*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. + */ + + virtual void handleClose( IOService * forClient, IOOptionBits options ); + + /*! + @function handleIsOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + @result Returns true if the specific, or any, client has the IOService open. + */ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + /*! + @function start + @abstract During an IOService instantiation, the start method is called when the IOService has been selected to run on the provider. + @discussion See IOService for discussion. + @result Return true if the start was successful, false otherwise (which will cause the instance to be detached and usually freed). + */ + + virtual bool start( IOService *provider ); + + /*! + @function stop + @abstract During an IOService termination, the stop method is called in its clients before they are detached & it is destroyed. + @discussion See IOService for discussion. + */ + + virtual void stop( IOService *provider ); + + /*! + @function getFireWireUnit + @abstract Returns an IOFireWireUnit object. + @discussion An IOFireWireUnit is the provider of an IOFireWireSBP2Target. In order to use the base FireWire services + you will need a reference to the unit. This method returns that reference. + @result Returns a pointer to an IOFireWireUnit. + */ + + virtual IOFireWireUnit * getFireWireUnit( void ); + + /*! + @function matchPropertyTable + @abstract Implements SBP2 specific matching. + @discussion See IOService for discussion. + @param table The dictionary of properties to be matched against. + @result Returns false if the family considers the matching dictionary does not match in properties it understands, true otherwise. + */ + + virtual bool matchPropertyTable( OSDictionary * table ); + + virtual void setTargetFlags( UInt32 flags ); + virtual UInt32 getTargetFlags( void ); + +protected: + virtual void configurePhysicalFilter( void ); + +public: + virtual void clearTargetFlags( UInt32 flags ); + virtual IOReturn beginIOCriticalSection( void ); + virtual void endIOCriticalSection( void ); + + virtual bool finalize( IOOptionBits options ); + + IOReturn synchMgmtAgentAccess( IOFWCommand * mgmtOrbCommand ); + void completeMgmtAgentAccess( ); + void clearMgmtAgentAccess( ); + void cancelMgmtAgentAccess( IOFWCommand * mgmtOrbCommand ); + +protected: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 8); + +}; + +#endif diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2UserClient.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2UserClient.h.svn-base new file mode 100644 index 0000000..939dbf0 --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2UserClient.h.svn-base @@ -0,0 +1,186 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIRESBP2USERCLIENT_H +#define _IOKIT_IOFIREWIRESBP2USERCLIENT_H + +#include + +#define FIREWIREPRIVATE +#include +#undef FIREWIREPRIVATE + +#include + +#include +#include + +class IOFireWireSBP2UserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOFireWireSBP2UserClient) + +protected: + + bool fOpened; + bool fStarted; + IOFireWireSBP2Login * fLogin; + task_t fTask; + + IOFireWireSBP2LUN * fProviderLUN; + OSAsyncReference64 fMessageCallbackAsyncRef; + OSAsyncReference64 fLoginCallbackAsyncRef; + OSAsyncReference64 fLogoutCallbackAsyncRef; + OSAsyncReference64 fUnsolicitedStatusNotifyAsyncRef; + OSAsyncReference64 fStatusNotifyAsyncRef; + OSAsyncReference64 fFetchAgentResetAsyncRef; + OSAsyncReference64 fFetchAgentWriteAsyncRef; + + IOFWUserObjectExporter * fExporter; + + IOFireWireLib::UserObjectHandle fSessionRef; + + virtual IOReturn externalMethod( uint32_t selector, + IOExternalMethodArguments * args, + IOExternalMethodDispatch * dispatch, + OSObject * target, + void * reference ); +public: + + virtual bool initWithTask( task_t owningTask, void * securityToken, UInt32 type, OSDictionary * properties ); + virtual void free (); + + virtual bool start( IOService * provider ); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + // IOFireWireSBP2ManagementORB friend class wrappers + virtual void flushAllManagementORBs( void ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2LUN + + IOReturn open( IOExternalMethodArguments * arguments ); + IOReturn openWithSessionRef( IOExternalMethodArguments * arguments ); + IOReturn getSessionRef( IOExternalMethodArguments * arguments ); + IOReturn close( IOExternalMethodArguments * arguments ); + + // callbacks + IOReturn setMessageCallback( IOExternalMethodArguments * arguments ); + virtual IOReturn message( UInt32 type, IOService * provider, void * arg ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2Login + + IOReturn setLoginCallback( IOExternalMethodArguments * arguments ); + IOReturn setLogoutCallback( IOExternalMethodArguments * arguments ); + IOReturn setUnsolicitedStatusNotify( IOExternalMethodArguments * arguments ); + IOReturn setStatusNotify( IOExternalMethodArguments * arguments ); + IOReturn createLogin( IOExternalMethodArguments * arguments ); + IOReturn releaseLogin( IOExternalMethodArguments * arguments ); + IOReturn submitLogin( IOExternalMethodArguments * arguments ); + IOReturn submitLogout( IOExternalMethodArguments * arguments ); + IOReturn setLoginFlags( IOExternalMethodArguments * arguments ); + IOReturn getMaxCommandBlockSize( IOExternalMethodArguments * arguments ); + IOReturn getLoginID( IOExternalMethodArguments * arguments ); + IOReturn setReconnectTime( IOExternalMethodArguments * arguments ); + IOReturn setMaxPayloadSize( IOExternalMethodArguments * arguments ); + + IOReturn submitFetchAgentReset( IOExternalMethodArguments * arguments ); + IOReturn setFetchAgentWriteCompletion( IOExternalMethodArguments * arguments ); + IOReturn ringDoorbell( IOExternalMethodArguments * arguments ); + IOReturn enableUnsolicitedStatus( IOExternalMethodArguments * arguments ); + IOReturn setBusyTimeoutRegisterValue( IOExternalMethodArguments * arguments ); + IOReturn setPassword( IOExternalMethodArguments * arguments ); + + // callbacks + + static void staticLoginCallback( void * refCon, FWSBP2LoginCompleteParamsPtr params ); + virtual void loginCallback( FWSBP2LoginCompleteParamsPtr params ); + + static void staticLogoutCallback( void * refCon, FWSBP2LogoutCompleteParamsPtr params ); + virtual void logoutCallback( FWSBP2LogoutCompleteParamsPtr params ); + + static void staticStatusNotify( void * refCon, FWSBP2NotifyParams * params ); + virtual void statusNotify( FWSBP2NotifyParams * params ); + + static void staticUnsolicitedNotify( void * refCon, FWSBP2NotifyParams * params ); + virtual void unsolicitedNotify( FWSBP2NotifyParams * params ); + + static void staticFetchAgentWriteComplete( void * refCon, IOReturn status, IOFireWireSBP2ORB * orb ); + virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireSBP2ORB * orb ); + + static void staticFetchAgentResetComplete( void * refCon, IOReturn status ); + virtual void fetchAgentResetComplete( IOReturn status ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2ORB + + IOReturn createORB( IOExternalMethodArguments * arguments ); + IOReturn releaseORB( IOExternalMethodArguments * arguments ); + IOReturn submitORB( IOExternalMethodArguments * arguments ); + IOReturn setCommandFlags( IOExternalMethodArguments * arguments ); + IOReturn setORBRefCon( IOExternalMethodArguments * arguments ); + IOReturn setMaxORBPayloadSize( IOExternalMethodArguments * arguments ); + IOReturn setCommandTimeout( IOExternalMethodArguments * arguments ); + IOReturn setCommandGeneration( IOExternalMethodArguments * arguments ); + IOReturn setToDummy( IOExternalMethodArguments * arguments ); + IOReturn setCommandBuffersAsRanges( IOExternalMethodArguments * arguments ); + IOReturn releaseCommandBuffers( IOExternalMethodArguments * arguments ); + IOReturn setCommandBlock( IOExternalMethodArguments * arguments ); + + // LSI workaround + IOReturn LSIWorkaroundSetCommandBuffersAsRanges( IOExternalMethodArguments * arguments ); + IOReturn LSIWorkaroundSyncBuffersForOutput( IOExternalMethodArguments * arguments ); + IOReturn LSIWorkaroundSyncBuffersForInput( IOExternalMethodArguments * arguments ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2MgmtORB + + IOReturn createMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn releaseMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBCallback( IOExternalMethodArguments * arguments ); + IOReturn submitMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBCommandFunction( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBManageeORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBManageeLogin( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBResponseBuffer( IOExternalMethodArguments * arguments ); + + // callbacks + static void staticMgmtORBCallback( void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb ); + virtual void mgmtORBCallback( IOReturn status, IOFireWireSBP2ManagementORB * orb ); + + // IOFireWireSBP2MgmtORB friend class wrappers + virtual void setMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); + virtual void getMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); + + uint32_t checkScalarInputCount; + uint32_t checkStructureInputSize; + uint32_t checkScalarOutputCount; + uint32_t checkStructureOutputSize; + + IOReturn checkArguments( IOExternalMethodArguments * args, uint32_t scalarInCount, uint32_t structInCount, + uint32_t scalarOutCount, uint32_t structOutCount ); + +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2UserClientCommon.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2UserClientCommon.h.svn-base new file mode 100644 index 0000000..cb114ba --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSBP2UserClientCommon.h.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIRESBP2USERCLIENTCOMMON_H_ +#define _IOKIT_IOFIREWIRESBP2USERCLIENTCOMMON_H_ + +#define kIOFireWireSBP2LibConnection 12 + +enum IOFWSBP2UserClientCommandCodes { + kIOFWSBP2UserClientOpen, // kIOUCScalarIScalarO 0,0 + kIOFWSBP2UserClientClose, // kIOUCScalarIScalarO 0,0 + kIOFWSBP2UserClientCreateLogin, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseLogin, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitLogin, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitLogout, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetLoginFlags, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientGetMaxCommandBlockSize, // kIOUCScalarIScalarO 1,1 + kIOFWSBP2UserClientGetLoginID, // kIOUCScalarIScalarO 1,1 + kIOFWSBP2UserClientSetReconnectTime, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetMaxPayloadSize, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientCreateORB, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandFlags, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetMaxORBPayloadSize, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetCommandTimeout, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetCommandGeneration, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetToDummy, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandBuffersAsRanges, // kIOUCScalarIScalarO 6,0 + kIOFWSBP2UserClientReleaseCommandBuffers, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandBlock, // kIOUCScalarIScalarO 3,0 + kIOFWSBP2UserClientCreateMgmtORB, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseMgmtORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitMgmtORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientMgmtORBSetCommandFunction, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetManageeORB, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetManageeLogin, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetResponseBuffer, // kIOUCScalarIScalarO 3,0 + kIOFWSBP2UserClientLSIWorkaroundSetCommandBuffersAsRanges, // kIOUCScalarIScalarO 6,0 + kIOFWSBP2UserClientMgmtORBLSIWorkaroundSyncBuffersForOutput, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientMgmtORBLSIWorkaroundSyncBuffersForInput, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientOpenWithSessionRef, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientGetSessionRef, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientRingDoorbell, // kIOUCScalarIScalarO 1, 0 + kIOFWSBP2UserClientEnableUnsolicitedStatus, // kIOUCScalarIScalarO 1, 0 + kIOFWSBP2UserClientSetBusyTimeoutRegisterValue, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetORBRefCon, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetPassword, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSetMessageCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetLoginCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetLogoutCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetUnsolicitedStatusNotify, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetStatusNotify, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetMgmtORBCallback, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSubmitFetchAgentReset, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSetFetchAgentWriteCompletion, // kIOUCScalarIScalaO 2, 0 + kIOFWSBP2UserClientNumCommands +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSerialBusProtocolTransport.h.svn-base b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSerialBusProtocolTransport.h.svn-base new file mode 100644 index 0000000..53e6195 --- /dev/null +++ b/i386/include/IOKit/sbp2/.svn/text-base/IOFireWireSerialBusProtocolTransport.h.svn-base @@ -0,0 +1,449 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/*! + @header IOFireWireSerialBusProtocolTransport + Contains the class definition for IOFireWireSerialBusProtocolTransport. +*/ + + +#ifndef _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ +#define _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ + + +#include +#include +#include +#include +#include +#include +#include + +#include + +/*! + @class IOFireWireSerialBusProtocolTransport + @abstract SCSI Protocol Driver Family for FireWire SBP2 Devices. + @discussion IOFireWireSerialBusProtocolTransport contains all the bus specific support for FireWire + SBP2 compliant devices. To add vendor specific features or workarounds you will sub-class the appropriate + methods of this family. +*/ + +class IOFireWireSerialBusProtocolTransport : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOFireWireSerialBusProtocolTransport ) + +private: + + IOFireWireUnit * fUnit; + IOFireWireSBP2LUN * fSBPTarget; + IOFireWireSBP2Login * fLogin; + IOFireWireSBP2ORB * fORB; + IOFireWireSBP2ManagementORB * fLUNResetORB; + + // /!\ WARNING! NOT USED left behind for legacy binary reasons + IOSimpleLock * fQueueLock; + + UInt32 fLoginRetryCount; + bool fDeferRegisterService; + bool fNeedLogin; + + // /!\ WARNING! NOT USED left behind for legacy binary reasons + bool fPhysicallyConnected; + + static void + StatusNotifyStatic ( void * refCon, FWSBP2NotifyParamsPtr params ); + + static void + UnsolicitedStatusNotifyStatic ( void * refCon, + FWSBP2NotifyParamsPtr params ); + + static void + LunResetCompleteStatic ( void * refCon, + IOReturn status, + IOFireWireSBP2ManagementORB * orb ); + + static void + FetchAgentResetCompleteStatic ( void * refcon, + IOReturn status ); + + static IOReturn + ConnectToDeviceStatic ( OSObject * refCon, void *, void *, void *, void * ); + + virtual void + FetchAgentResetComplete ( IOReturn status ); + + static void LoginCompletionStatic ( void * refCon, FWSBP2LoginCompleteParams * params ); + + static void + LogoutCompletionStatic ( void * refCon, FWSBP2LogoutCompleteParams * params ); + + /*! + @function CoalesceSenseData + @abstract CoalesceSenseData convert a SBP-2 status block into a SPC-2 sense block. + @discussion CoalesceSenseData pulls the appropriate bits out of the SBP2 sense block + as defined in SBP-2 Annex B section B.2 and dynamically builds a sense data block as + defined in SPC-2 section 7.23.2. + */ + + SCSITaskStatus + CoalesceSenseData ( FWSBP2StatusBlock * sourceData, + UInt8 quadletCount, + SCSI_Sense_Data * targetData ); + + virtual void ConnectToDevice ( void ); + + virtual void DisconnectFromDevice ( void ); + + virtual bool IsDeviceCPUInDiskMode ( void ); + +protected: + + /*! + @function AllocateResources + @abstract Allocate Resources. + @discussion Called from start method to allocate needed resources. + */ + + virtual IOReturn AllocateResources ( void ); + + /*! + @function DeallocateResources + @abstract Deallocate Resources. + @discussion Called from cleanUp method to deallocate resources. + */ + + virtual void DeallocateResources ( void ); + + enum SBP2LoginState + { + kFirstTimeLoggingInState, + kLogginSucceededState, + kLogginFailedState + }; + + /*! + @typedef SBP2ClientOrbData + @param orb IOFireWireSBP2ORB for request. + @param scsiTask SCSITaskIdentifier of request. + @param serviceResponse SCSIServiceResponse of request. + @param taskStatus SCSITaskStatus of request. + @discussion This structure is stuffed into the refcon so we can associate which + IOFireWireSBP2ORB and SCSITaskIdentifier is completing. + */ + + typedef struct { + IOFireWireSBP2ORB * orb; + SCSITaskIdentifier scsiTask; + SCSIServiceResponse serviceResponse; + SCSITaskStatus taskStatus; + IOBufferMemoryDescriptor * quadletAlignedBuffer; + } SBP2ClientOrbData; + + static const UInt32 kDefaultBusyTimeoutValue = 0x0000000F; + static const UInt64 kMaxFireWireLUN = 0xFFFF; + static const UInt32 kMaxFireWirePayload = 4096; + static const UInt32 kMaxLoginRetryCount = 8; + static const UInt32 kMaxReconnectCount = 128; + static const UInt32 kCSRModelInfoKey = 0x17; + + UInt32 fReconnectCount; + bool fLoggedIn; + + // binary compatibility instance variable expansion + struct ExpansionData + { + IOCommandPool * fCommandPool; + IOCommandPool * fSubmitQueue; + SBP2LoginState fLoginState; + bool fLUNResetPathFlag; + int fLUNResetCount; + bool fAlwaysSetSenseData; + bool fAutonomousSpinDownWorkAround; + }; + + ExpansionData * reserved; + + bool fObjectIsOpen; + + /*! + @function CommandORBAccessor + @abstract accessor function for fORB. + @discussion xxx. + */ + + IOFireWireSBP2ORB * CommandORBAccessor ( void ); + + /*! + @function SBP2LoginAccessor + @abstract accessor function for fLogin. + @discussion xxx. + */ + + IOFireWireSBP2Login * SBP2LoginAccessor ( void ); + + virtual IOReturn + message ( UInt32 type, IOService * provider, void * argument = 0 ); + + /*! + @function SendSCSICommand + @abstract Prepare and send a SCSI command to the device. + @discussion The incoming SCSITaskIdentifier gets turned into a IOFireWireSBP2ORB + and is submitted to the SBP2 layer. See IOSCSIProtocolServices.h for more details + regarding SendSCSICommand. Also see IOFireWireSBP2Lib.h for details regarding the + IOFireWireSBP2ORB structure and the submitORB method. + @result If the command was sent to the device and is pending completion, the + subclass should return true and return back the kSCSIServiceResponse_Request_In_Process response. + If the command completes immediately with an error, the subclass will return true + and return back the appropriate status. If the subclass is currently processing all the + commands it can, the subclass will return false and the command will be resent next time + CommandCompleted is called. + */ + + virtual bool + SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + /*! + @function SetCommandBuffers + @abstract Method to set orb's buffers. + @discussion This method was added so that subclasses can override and massage buffers as + needed. The default simply calls setCommandBuffers. See IOFireWireSBP2Lib.h for details + regarding the setCommandBuffers method. + @result xxx. + */ + + virtual IOReturn + SetCommandBuffers ( IOFireWireSBP2ORB * orb, SCSITaskIdentifier request ); + + /*! + @function CompleteSCSITask + @abstract This qualifies and sets appropriate data then calls CommandCompleted. + @discussion See IOSCSIProtocolServices.h for more details + regarding CommandCompleted. + */ + + virtual void + CompleteSCSITask ( IOFireWireSBP2ORB * orb ); + + /*! + @function AbortSCSICommand + @abstract This method is intended to abort an in progress SCSI Task. + @discussion Currently not implemented in super class. This is a stub method for adding + the abort command in the near future. + @result See SCSITask.h for SCSIServiceResponse codes. + */ + + virtual SCSIServiceResponse + AbortSCSICommand ( SCSITaskIdentifier request ); + + /*! + @function StatusNotify + @abstract This is our handler for status. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2NotifyParams + structure that is passed in to the completion.. + */ + + virtual void + StatusNotify ( FWSBP2NotifyParams * params ); + + /*! + @function SetValidAutoSenseData + @abstract Set the auto sense data that was returned for a given SCSI Task. + @discussion SetValidAutoSenseData is called to qualify sense data that is copied to the + client via the SetAutoSenseData method. See IOSCSIProtocolServices.h for more details + regarding SetAutoSenseData. + */ + + void + SetValidAutoSenseData ( SBP2ClientOrbData * clientData, + FWSBP2StatusBlock * statusBlock, + SCSI_Sense_Data * targetData ); + + /*! + @function UnsolicitedStatusNotify + @abstract This is our handler for unsolicited status. + @discussion After we have parsed and handled the unsolicited status we call + enableUnsolicitedStatus. See IOFireWireSBP2Lib.h for details regarding the + enableUnsolicitedStatus method. + */ + + virtual void + UnsolicitedStatusNotify ( FWSBP2NotifyParamsPtr params ); + + /*! + @function LoginCompletion + @abstract Completion routine for login complete. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams + structure that is passed in to the completion. + */ + + virtual void + LoginCompletion ( FWSBP2LoginCompleteParams * params ); + + /*! + @function LogoutCompletion + @abstract Completion routine for logout complete. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams + structure that is passed in to the completion. + */ + + virtual void + LogoutCompletion ( FWSBP2LogoutCompleteParams * params ); + + /*! + @function IsProtocolServiceSupported + @abstract Determine is specified feature is supported by the protocol layer. + @discussion If the service has a value that must be returned, it will be returned in the + serviceValue output parameter. See IOSCSIProtocolServices.h for more details regarding + IsProtocolServiceSupported. + @result Will return true if the specified feature is supported by the protocol layer. + */ + + virtual bool + IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + /*! + @function HandleProtocolServiceFeature + @abstract Handle specified feature supported by the protocol layer. + @discussion See IOSCSIProtocolServices.h for more details regarding HandleProtocolServiceFeature. + @result Will return true if the specified feature is supported by the protocol layer. + */ + + virtual bool + HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + /*! + @function LunResetComplete + @abstract Callback to submit Fetch Agent Reset. + @discussion See IOFireWireSBP2Lib.h for details regarding the submitFetchAgentReset + method. + */ + + virtual void + LunResetComplete ( IOReturn status, IOFireWireSBP2ManagementORB * orb ); + +public: + + /*! + @function init + @abstract See IOService for discussion. + @discussion Setup and prime class into known state. + */ + + bool init ( OSDictionary * propTable ); + + /*! + @function start + @discussion See IOService for discussion. + @result Return true if the start was successful, false otherwise ( which will + cause the instance to be detached and usually freed ). + */ + + virtual bool start ( IOService * provider ); + + /*! + @function cleanUp + @abstract cleanUp is called to tear down IOFireWireSerialBusProtocolTransport. + @discussion cleanUp is called when we receive a kIOFWMessageServiceIsRequestingClose + message or if we fail our initialization. + */ + + virtual void cleanUp ( void ); + + /*! + @function finalize + @abstract See IOService for discussion. + @result Returns true. + */ + + virtual bool finalize ( IOOptionBits options ); + + /*! + @function free + @discussion See IOService for discussion. + @result none. + */ + + virtual void free ( void ); + +protected: + + virtual IOReturn login ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 1 ); + + virtual IOReturn submitLogin ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 2 ); + + virtual void loginLost ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 3 ); + + void loginSuspended ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 4 ); + + virtual void loginResumed ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 5 ); + + static IOReturn CriticalOrbSubmissionStatic ( + OSObject * refCon, + void * val1, + void * val2, + void * val3, + void * val4 ); + + /*! + @function CriticalOrbSubmission + @abstract xxx. + @discussion xxx. + @result none. + */ + + void + CriticalOrbSubmission ( + IOFireWireSBP2ORB * orb, + SCSITaskIdentifier request ); + + virtual void submitOrbFromQueue ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 6 ); + +private: + + // binary compatibility reserved method space + + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 7 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 8 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 9 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 10 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 11 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 12 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 13 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 14 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 15 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 16 ); + +}; + +#endif /* _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ */ \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h b/i386/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h new file mode 100644 index 0000000..178ef00 --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h @@ -0,0 +1,292 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#if __ppc__ + +/*! + @header IOFireWireSBP2LSIWorkaroundDescriptor + Contains the class definition for IOFireWireSBP2LSIWorkaroundDescriptor. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LSIWORKAROUNDDESCRIPTOR_H +#define _IOKIT_IOFIREWIRESBP2LSIWORKAROUNDDESCRIPTOR_H + +#include + +class IOFireWireSBP2LSIRange; + +/*! + @class IOFireWireSBP2LSIWorkaroundDescriptor + @abstract This is a subclass of IOGeneralMemoryDescriptor. It is designed to work around + a hardware problem in a common SBP2 target. It takes a memory descriptor as + an argument. It retains this descriptor and returns a new one with resegmented + physical segments and potentially some "unfixable" segments double buffered. + + If the transfer will cause data to be sent from the Mac, syncBuffersForOutput + must be called before the transfer. + + If the transfer will cause data to be recieve by the Mac, syncBuffersForInput + must be called after the transfer. + + This class calculates the new segmentation only once when it is created. + Any changes to the structure of the original memory descriptor will render + this one useless. It must be released and a new IOFireWireSBP2LSIWorkaroundDescriptor + can be created. + + LSI Bridge Workaround Algorithm Details + + Goals: + 1. Avoid LSI Logic "< 16 byte" bug - prevent any data packet smaller than 16 bytes + 2. Minimize double-buffering + 3. Support non-multiple-of-512-byte devices, e.g. CD Audio + + Solution: + Write a page table such that the bridge will nor use packets smaller than 16 bytes. + In other words, rearrange the memory descriptor to avoid the bug, and do it such + that the SBP-2 layer will not break up a segment (du ro the 64k-1 limit) and + re-introduces the problem + + SBP-2 defines the kFWSBP2MaxPageClusterSize constant. We simply make sure + none of our segments are larger than this size and SBP-2 will not break them + up when it writes the SBP-2 page table. + + Notes: + - Some double buffering is unavoidable. Discontiguous pages may yield page + fragments at the start or end of the buffer (or both, with non-512x buffers). + solution uses less than 33 bytes of double-buffer per segment in original + memory descriptor. + - If driver must break up IO to meet ATA limit of 255 (250?) blocks, assume + the driver does this at a higher level (before applying workaround). + - It is expected that the original memory descriptor has been prepared (wired) +*/ + +class IOFireWireSBP2LSIWorkaroundDescriptor : public IOGeneralMemoryDescriptor +{ + OSDeclareDefaultStructors(IOFireWireSBP2LSIWorkaroundDescriptor) + + friend class IOFireWireSBP2LSIRange; + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + bool fFixedCapacity; // for both allocators + + ////////////////////////////////////// + // for range allocator + + OSArray * fPermanentRanges; + UInt32 fAllocatedRangesCount; + + virtual IOReturn rangeAllocatorInitialize( UInt32 rangeCount ); + virtual void rangeAllocatorDeallocateAllRanges( void ); + virtual IOFireWireSBP2LSIRange * rangeAllocatorNewRange( void ); + virtual void rangeAllocatorFree( void ); + + ////////////////////////////////////// + // for buffer allocator + + OSArray * fBufferDescriptors; + UInt32 fPermanentPages; + IOByteCount fAllocatedBytesCount; + + virtual IOReturn bufferAllocatorInitialize( IOByteCount requestedBufferSize ); + virtual void bufferAllocatorDeallocateAllBuffers( void ); + virtual void * bufferAllocatorNewBuffer( IOPhysicalAddress * address ); + virtual void bufferAllocatorFree( void ); + + ////////////////////////////////////// + // for range table allocator + + IOPhysicalRange * fRangeTable; + IOByteCount fRangeTableSize; + + virtual IOReturn rangeTableAllocatorInitialize( UInt32 requestedBufferSize ); + virtual IOPhysicalRange * rangeTableAllocatorNewTable( UInt32 entries ); + virtual void rangeTableAllocatorFree( void ); + + ////////////////////////////////////// + // for workaround + + IOMemoryDescriptor * fOriginalDesc; + OSArray * fRanges; + IOByteCount fOffset; + IOByteCount fLength; + IODirection fDirection; + + + virtual bool initWithCapacity + ( UInt32 permanentRanges, IOByteCount permanentBufferSpace, bool fixedCapacity ); + + virtual void free(); + + virtual IOReturn resetToInitialCapacity( void ); + virtual IOReturn initializeRangesArray( void ); + virtual IOReturn recalculateSmallSegments( void ); + virtual IOReturn splitLargeSegments( void ); + virtual IOReturn resegmentOddLengthSegments( void ); + virtual IOReturn initializeBuffers( void ); + + virtual bool initWithAddress( void * address, /* not supported */ + IOByteCount withLength, + IODirection withDirection ); + + virtual bool initWithAddress( vm_address_t address, /* not supported */ + IOByteCount withLength, + IODirection withDirection, + task_t withTask ); + + virtual bool initWithPhysicalAddress( + IOPhysicalAddress address, /* not supported */ + IOByteCount withLength, + IODirection withDirection ); + + virtual bool initWithPhysicalRanges( + IOPhysicalRange * ranges, /* not supported */ + UInt32 withCount, + IODirection withDirection, + bool asReference = false ); + + virtual bool initWithRanges( IOVirtualRange * ranges, /* not supported */ + UInt32 withCount, + IODirection withDirection, + task_t withTask, + bool asReference = false ); + +public: + + // static factory methods and intializers + + // + // create a new instance + // + + + /*! + @function withDescriptor + @abstract Creates a new IOFireWireSBP2LSIWorkaroundDescriptor. + @discussion Create a IOFireWireSBP2LSIWorkaroundDescriptor with no permanent capacity then + inits it the given descriptor. This is basicly a short cut for calling + withCapacity( 0, 0, false) and the initWithDescriptor() + @param desc Original memory descriptor. + @param offset Offset of data to "fix" in bytes from beginning of descriptor. + @param len Length of data in bytes to "fix" + @param direction IODirection of data transfer. + @result Returns a new IOFireWireSBP2LSIWorkaroundDescriptor if successful. + */ + + static IOFireWireSBP2LSIWorkaroundDescriptor * withDescriptor + ( IOMemoryDescriptor * desc, IOByteCount offset = 0, + IOByteCount len = 0, IODirection direction = kIODirectionOutIn ); + + // initialize with descriptor + + /*! + @function initWithDescriptor + @abstract Initialize an IOFireWireSBP2LSIWorkaroundDescriptor with the given descriptor. + @discussion Initialize the workaround descriptor with the given descriptor. + @param desc Original memory descriptor. + @param offset Offset of data to "fix" in bytes from beginning of descriptor. + @param len Length of data in bytes to "fix" + @param direction IODirection of data transfer. + @result Returns true if the initialization was successful. + */ + + virtual bool initWithDescriptor( IOMemoryDescriptor * desc, IOByteCount offset = 0, + IOByteCount len = 0, IODirection direction = kIODirectionOutIn ); + + + /////////////////////////////////// + + + /*! + @function withCapacity + @abstract Create a new descriptor with possibly a permanent capacity. + @discussion Create and IOFireWireSBP2LSIWorkaroundDescriptor with a permanent fixed capacity. + You should call initWithDescriptor afterward. permanentRanges is number of ranges to keep + permanently allocated for use by the algorithm. If fixedCapacity is false additional ranges + may be allocated and deallocated dyanmicly if needed. The algorithm may require more or less + ranges than either the original descriptor or the final fixed may decriptor contain. + permanentBufferSpace is the number of bytes of permanent buffer to keep arround. If fixedCapacity + is false additional buffer space may be allocated and deallocated dynamically. permanentBufferSpace + should generally be set to 32 * maximum number of ranges. fixedCapacity is a flag indicating + whether dynamic allocations are allowed. When making decisions about the maximum amount of + buffer space to keep around, it should be noted tha the maximum number of ranges maybe different + from permanentRanges if fixedCapcity is false. + @param permanentRanges Count of permanent ranges. + @param permanentBufferSpace Byte count of permanent buffers. + @param fixedCapacity bool indicating if dynamic allocations can be made. + @result Returns true if the initialization was successful. + */ + + static IOFireWireSBP2LSIWorkaroundDescriptor * withCapacity + ( UInt32 permanentRanges, IOByteCount permanentBufferSpace, bool fixedCapacity ); + + + /////////////////////////////////// + + // + // manipulate buffers for IO + // + + /*! + @function syncBuffersForOutput + @abstract Synchronize the buffers for output. + @discussion Since double buffering may be invovled in the workaround. The driver needs to + indicate when these buffers should be syncronized with the original descriptor. For data + that will be output syncBuffersForOutput should be called before submiting the ORB. + @result Returns kIOReturnSuccess if sync was successful. + */ + + virtual IOReturn syncBuffersForOutput( void ); // call before output + + /*! + @function syncBuffersForInput + @abstract Synchronize the buffers for input. + @discussion Since double buffering may be invovled in the workaround. The driver needs to + indicate when these buffers should be syncronized with the original descriptor. For data + that will be input syncBuffersForOutput should be called after receiving completion status + for the ORB. + @result Returns kIOReturnSuccess if sync was successful. + */ + + virtual IOReturn syncBuffersForInput( void ); // call after input + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LSIWorkaroundDescriptor, 8); + +}; + +#endif + +#endif diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2LUN.h b/i386/include/IOKit/sbp2/IOFireWireSBP2LUN.h new file mode 100644 index 0000000..e6c97de --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2LUN.h @@ -0,0 +1,270 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2LUN + Contains the class definition for IOFireWireSBP2LUN. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LUN_H +#define _IOKIT_IOFIREWIRESBP2LUN_H + +#include +#include + +#include + +#include +#include + +class IOFireWireSBP2Target; + +/*! + @class IOFireWireSBP2LUN + @abstract Provider for most drivers. + @discussion IOFireWireSBP2LUN objects are created by IOFireWireSBP2Target objects. Each target may have zero or more IOFireWireSBP2LUN children. The LUN object serves as the matching nub for most drivers and therefore will be the provider for most drivers. It supplies the methods that control the operation of the LUN as a whole. Methods that control the behavior and execution of an SBP2 login session are supplied in a separate IOFireWireSBP2Login object. The LUN can be used to create one of these login objects. + The LUN can also create IOFireWireSBP2ManagementORBs for configuring and appending non-login related management functions. Login related management functions (ie. Login, Logout, Reconnect) are supplied by the IOFireWireSBP2Login. + Finally the LUN can supply a reference to the IOFireWireUnit. This can be useful if a driver wishes to access the standard FireWire APIs. +*/ + +class IOFireWireSBP2LUN : public IOService +{ + OSDeclareDefaultStructors( IOFireWireSBP2LUN ); + + friend class IOFireWireSBP2ManagementORB; + friend class IOFireWireSBP2Login; + friend class IOFireWireSBP2UserClient; + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + //////////////////////////////////////////// + // methods called by friend classes + + // IOFireWireSBP2Login methods + virtual void removeLogin( IOFireWireSBP2Login * login ); + virtual IOFireWireSBP2Target * getTarget( void ); + + // IOFireWireSBP2ManagementORB methods + virtual void clearAllTasksInSet( void ); // assumes caller is on workloop + virtual void removeManagementORB( IOFireWireSBP2ManagementORB * orb ); + + // IOFireWireSBP2UserClient methods + virtual void flushAllManagementORBs( void ); + +public: + + //////////////////////////////////////////// + // IOService overrides + + /*! @function attach + @abstract Attaches an IOService client to a provider in the registry. + @discussion See IOService for discussion. + @param provider The IOService object which will serve as this objects provider. + @result false if the provider is inactive or on a resource failure, otherwise true. + */ + + virtual bool attach( IOService *provider ); + + /*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. */ + + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + /*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. + */ + + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + /*! + @function matchPropertyTable + @abstract Implements SBP2 specific matching. + @discussion See IOService for discussion. + @param table The dictionary of properties to be matched against. + @result Returns false if the family considers the matching dictionary does not match in properties it understands, true otherwise. + */ + + virtual bool matchPropertyTable(OSDictionary * table); + +protected: + + //////////////////////////////////////////// + // private fields + + IOFireWireSBP2Target * fProviderTarget; + UInt32 fLUNumber; + OSSet * fLoginSet; + OSIterator * fLoginSetIterator; + IOCommandGate * fGate; + OSSet * fORBSet; + OSIterator * fORBSetIterator; + OSObject * fDiagnostics; + + //////////////////////////////////////////// + // private methods + + // IOService methods + virtual void free( void ); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + // create management orb internals + static IOReturn staticCreateManagementORBAction( OSObject *self, + void * refCon, + void * completion, + void * orb, + void * ); + virtual IOReturn createManagementORBAction( void * refCon, + FWSBP2ManagementCallback completion, + IOFireWireSBP2ManagementORB ** orb ); + + // remove management orb internals + static IOReturn staticRemoveManagementORBAction( OSObject * self, void * orb, + void *, void *, void * ); + virtual IOReturn removeManagementORBAction( IOFireWireSBP2ManagementORB * orb ); + + // flush all management orb internals + static IOReturn staticExecuteFlushAllMgmtORBs( OSObject * self, void *, + void *, void *, void * ); + virtual IOReturn executeFlushAllMgmtORBs( void ); + + // IOFireWireSBP2ManagementORB friend class wrappers + virtual bool initMgmtORBWithLUN( IOFireWireSBP2ManagementORB * orb, IOFireWireSBP2LUN * lun, + void * refCon, + FWSBP2ManagementCallback completion ); + + // IOFireWireSBP2Login friend class wrappers + virtual bool initLoginWithLUN( IOFireWireSBP2Login * login, IOFireWireSBP2LUN * lun ); + virtual void suspendedNotify( void ); + virtual void resumeNotify( void ); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 0); + +public: + + //////////////////////////////////////////// + // client methods + + // getters + + /*! + @function getFireWireUnit + @abstract Returns an IOFireWireUnit object. + @discussion An IOFireWireUnit is the provider of an IOFireWireSBP2Target. In order to + use the base FireWire services you will need a reference to the unit. This method + returns that reference. + @result Returns a pointer to an IOFireWireUnit. + */ + + virtual IOFireWireUnit * getFireWireUnit( void ); + + /*! + @function getLUNumber + @abstract Returns the LUNs number. + @discussion Each LUN has a number to uniquely identify it on a device. This method returns + this value in a UInt32. + @result Returns a UInt32 containing the Logical Unit Number. + */ + + virtual UInt32 getLUNumber( void ); + + // factory methods + + /*! + @function createLogin + @abstract Creates a new IOFireWireSBP2Login object. + @discussion Creates a new IOFireWireSBP2Login object for the LUN. Login objects supply most + of the SBP2 APIs related to login maintenance and Normal Command ORB execution. + @result Returns a pointer to a new IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2Login *createLogin( void ); + + /*! + @function createManagementORB + @abstract Creates a new IOFireWireSBP2ManagementORB object. + @discussion Creates a new IOFireWireSBP2ManagementORB object. Management objects let you + execute commands like QueryLogins, LogicalUnitReset, and AbortTask. These commands are + configured after they are created here. When they are done executing (after a call to submit) + the supplied completion routine will be called with the supplied refcon. Usually this refCon + is the "this" pointer of completion method's object. + @param refCon The refcon passed to the completion routine. + @param completion The completion routine. Called when the ORB finishes execution. + @result Returns a pointer to a new IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2ManagementORB * createManagementORB( void * refCon, FWSBP2ManagementCallback completion ); + +protected: + + static IOReturn staticCreateLogin( OSObject *self, void * login, void *, void *, void * ); + virtual IOReturn createLoginAction( IOFireWireSBP2Login ** login ); + + static IOReturn staticRemoveLoginAction( OSObject *self, void * login, void *, void *, void * ); + virtual IOReturn removeLoginAction( IOFireWireSBP2Login * login ); + +public: + + /*! + @function getDiagnostics + @abstract Debug-only method. + @discussion Returns a reference to the internal diagnostics object when the services are built + in debug mode. Should be a no-op in release builds. + @result Returns a pointer to the diagnostics object (if any). + */ + + virtual OSObject * getDiagnostics( void ); + + virtual bool finalize( IOOptionBits options ); + +protected: + + void terminateNotify( void ); + +private: + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2LUN, 8); + +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2Login.h b/i386/include/IOKit/sbp2/IOFireWireSBP2Login.h new file mode 100644 index 0000000..42a838c --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2Login.h @@ -0,0 +1,1078 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2Login + Contains the class definition for IOFireWireSBP2Login. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2LOGIN_H +#define _IOKIT_IOFIREWIRESBP2LOGIN_H + +#include + +#include + +#include +#include + +// login option flags +enum +{ + kFWSBP2DontSynchronizeMgmtAgent = (1 << 0), + kFWSBP2ExclusiveLogin = (1 << 5) +}; + +// notification events +enum +{ + kFWSBP2NormalCommandStatus = 6, + kFWSBP2NormalCommandTimeout = 7, + kFWSBP2UnsolicitedStatus = 8, + kFWSBP2NormalCommandReset = 9 +}; + +#define kIOMessageFWSBP2ReconnectComplete iokit_fw_err(0x3E8) +#define kIOMessageFWSBP2ReconnectFailed iokit_fw_err(0x3E9) + +/*! + @typedef FWSBP2LoginResponse + @param length Length of login response. + @param loginID Unique id representing this login. + @param commandBlockAgentAddressHi High 32 bits of command block agent address. + @param commandBlockAgentAddressLo Low 32 bits of command block agent address. + @param reserved Reserved. + @param reconnectHold Reconnect timeout encoded as 2^reconnectHold seconds. +*/ + +typedef struct +{ + UInt16 length; + UInt16 loginID; + UInt32 commandBlockAgentAddressHi; + UInt32 commandBlockAgentAddressLo; + UInt16 reserved; + UInt16 reconnectHold; +} FWSBP2LoginResponse, *FWSBP2LoginResponsePtr; + +/*! + @typedef FWSBP2StatusBlock + @param details Src, Resp, D, Len fields of status block format + @param sbpStatus SBP2 specific status + @param orbOffsetHi High 32 bits of address of orb status is for. + @param orbOffsetLo Low 32 bits of address of orb status is for. + @param status[6] Up to 48 bytes of additional data. Length is determined by len field. +*/ + +typedef struct +{ + UInt8 details; + UInt8 sbpStatus; + UInt16 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 status[6]; +} FWSBP2StatusBlock; + +class IOFireWireSBP2LUN; +class IOFireWireSBP2Login; + +// struct sent to login complete handler + +/*! + @typedef FWSBP2LoginCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param loginResponse Pointer to login response struct. + @param statusBlock Pointer to status block buffer. + @param statusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of login attempt + + FWSBP2LoginResponsePtr loginResponse; // pointer to loginResponse buffer + FWSBP2StatusBlock * statusBlock; // pointer to statusBlock buffer + UInt32 statusBlockLength; // size of statusBlock buffer + +} FWSBP2LoginCompleteParams, *FWSBP2LoginCompleteParamsPtr; + +// struct sent to logout complete handler + +/*! + @typedef FWSBP2LogoutCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param statusBlock Pointer to status block buffer. + @param statusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of login attempt + + FWSBP2StatusBlock * statusBlock; // pointer to statusBlock buffer + UInt32 statusBlockLength; // size of statusBlock buffer + +} FWSBP2LogoutCompleteParams, *FWSBP2LogoutCompleteParamsPtr; + +// struct sent with reconnect notification + +/*! + @typedef FWSBP2LogoutCompleteParams + @param login Pointer to IOFireWireSBP2Login object. + @param generation FireWire generation value. + @param status Status of login attempt. + @param reconnectStatusBlock Pointer to status block buffer. + @param reconnectStatusBlockLength Length of entire status block. +*/ + +typedef struct +{ + IOFireWireSBP2Login * login; // login object this param is sent from + UInt32 generation; // generation this login was attempted in + + IOReturn status; // status of reconnect attempt + + void * reconnectStatusBlock; // pointer to statusBlock buffer + UInt32 reconnectStatusBlockLength; // size of statusBlock buffer +} FWSBP2ReconnectParams, *FWSBP2ReconnectParamsPtr; + +// Callback when login and logout commands complete asynchronously + +/*! + @typedef FWSBP2LoginCallback + @param refCon Reference constant supplied when the notification was registered. + @param params Structure containing additional information about the status of the login. +*/ + +typedef void (*FWSBP2LoginCallback)(void * refCon, FWSBP2LoginCompleteParamsPtr params); + +/*! + @typedef FWSBP2LogoutCallback + @param refCon Reference constant supplied when the notification was registered. + @param params Structure containing additional information about the status of the logout. +*/ + +typedef void (*FWSBP2LogoutCallback)(void * refCon, FWSBP2LogoutCompleteParamsPtr params); + +/*! + @typedef FWSBP2StatusCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. +*/ + +typedef void (*FWSBP2StatusCallback)(void * refCon, IOReturn status); + +/*! + @typedef FWSBP2FetchAgentWriteCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. + @param orb Indicates current last orb in chain. +*/ + +typedef void (*FWSBP2FetchAgentWriteCallback)(void * refCon, IOReturn status, IOFireWireSBP2ORB * orb); + +/*! + @typedef FWSBP2NotifyParams + @param notificationEvent Type of event we are being notified of. + @param message buffer containing message. + @param length length of message field. + @param generation FireWire generation value. +*/ + +typedef struct +{ + void * commandObject; + UInt32 notificationEvent; + const void * message; + UInt32 length; + UInt32 generation; +} FWSBP2NotifyParams, *FWSBP2NotifyParamsPtr; + + +/*! + @typedef FWSBP2NotifyCallback + @param refCon Reference constant supplied when the notification was registered. + @param params FWSBP2NotifyParams containing notification information. +*/ + +typedef void (*FWSBP2NotifyCallback)(void * refCon, FWSBP2NotifyParamsPtr params); + +/*! + @class IOFireWireSBP2Login + @abstract Supplies the login maintenance and Normal Command ORB execution portions of the API. + @discussion Supplies APIs for login maintenance and command execution. Drivers can use this + object to create IOFireWireSBP2ORB objects and execute them. Solicited and unsolicited status + callback routines can be registered and the SBP2 services will notify the driver when the + appropriate status arrives. + This class also handles login maintenance. Supplies APIs for logging in and logging out and + attempts to reconnect to the LUN after bus resets. The base FireWire services deliver bus + reset notification via the IOKit message routine. The SBP2 services build on this behavior + and deliver reconnectFailed and reconnectComplete through the message routine as well. +*/ + +class IOFireWireSBP2Login : public OSObject +{ + OSDeclareDefaultStructors( IOFireWireSBP2Login ) + + friend class IOFireWireSBP2ORB; + friend class IOFireWireSBP2LUN; + friend class IOFireWireSBP2UserClient; + +protected: + + // command selectors + enum + { + kLoginCommandIdle = 0, + kLoginCommandDoLogin = 1, + kLoginCommandDoLogout = 2, + kLoginAddORB = 3, + kLoginRemoveORB = 4, + kLoginFetchAgentReset = 5 + }; + + // internal login states + enum + { + kLoginStateIdle = 0, + kLoginStateLoggingIn = 1, + kLoginStateConnected = 2, + kLoginStateReconnect = 3, + kLoginStateLoggingOut = 4, + kLoginStateTerminated = 5 + }; + + // rom keys + enum + { + kUnitCharacteristicsKey = 0x3A, + kManagementAgentOffsetKey = 0x54 + }; + + // sbp2 defs + enum + { + kFWSBP2RequestComplete = 0, + kFWSBP2TransportFailure = 1, + kFWSBP2IllegalRequest = 2, + kFWSBP2VendorDependent = 3 + }; + + enum + { + kFWSBP2NoSense = 0, + kFWSBP2RequestTypeNotSupported = 1, + kFWSBP2SpeedNotSupported = 2, + kFWSBP2PageSizeNotSupported = 3, + kFWSBP2AccessDenied = 4, + kFWSBP2LogicalUnitNotSupported = 5, + kFWSBP2MaxPayloadTooSmall = 6, + kFWSBP2FunctionRejected = 9, + kFWSBP2LoginIDNotRecognized = 10, + kFWSBP2DummyORBCompleted = 11, + kFWSBP2RequestAborted = 12, + kFWSBP2UnspecifiedError = 0xFF + }; + + typedef struct + { + UInt32 password[2]; + UInt32 loginResponseAddressHi; + UInt32 loginResponseAddressLo; + UInt16 options; + UInt16 lun; + UInt16 passwordLength; + UInt16 loginResponseLength; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2LoginORB; + + typedef struct + { + UInt32 reserved1[4]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2ReconnectORB; + + typedef struct + { + UInt32 reserved1[4]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2LogoutORB; + +protected: + + /////////////////////////////////////////////////////////////////// + // private interface methods + + // IOFireWireSBP2LUN methods + virtual void clearAllTasksInSet( void ); + virtual bool initWithLUN( IOFireWireSBP2LUN * lun ); + virtual void suspendedNotify( void ); + virtual void resumeNotify( void ); + + // IOFireWireSBP2ORB methods + virtual IOFireWireUnit * getFireWireUnit( void ); + virtual IOFireWireSBP2LUN * getFireWireLUN( void ); + virtual bool isFetchAgentWriteInProgress( void ); + virtual bool isConnected( void ); + virtual IOReturn removeORB( IOFireWireSBP2ORB * orb ); + virtual IOReturn appendORBImmediate( IOFireWireSBP2ORB * orb ); + virtual IOReturn appendORB( IOFireWireSBP2ORB * orb ); + virtual void sendTimeoutNotification( IOFireWireSBP2ORB * orb ); + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + IOFireWireController * fControl; + IOCommandGate * fGate; + + FWSBP2LoginCallback fLoginCompletionCallback; + void * fLoginCompletionRefCon; + + FWSBP2LogoutCallback fLogoutCompletionCallback; + void * fLogoutCompletionRefCon; + + FWSBP2NotifyCallback fStatusNotifyCallback; + void * fStatusNotifyRefCon; + + FWSBP2NotifyCallback fUnsolicitedStatusNotifyCallback; + void * fUnsolicitedStatusNotifyRefCon; + + UInt32 fLoginFlags; + UInt32 fReconnectTime; + + UInt32 fLoginState; + UInt32 fManagementOffset; + UInt32 fManagementTimeout; + UInt32 fMaxORBSize; + UInt32 fMaxCommandBlockSize; + UInt16 fLoginNodeID; + UInt32 fLoginGeneration; + UInt32 fLoginID; + UInt32 fReconnectHold; + UInt32 fMaxPayloadSize; + void * fRefCon; + + // resources + + FWSBP2LoginORB fLoginORB; + IOFWAddressSpace * fLoginORBAddressSpace; + FWAddress fLoginORBAddress; + + FWSBP2LoginResponse fLoginResponse; + IOFWAddressSpace * fLoginResponseAddressSpace; + FWAddress fLoginResponseAddress; + + FWSBP2ReconnectORB fReconnectORB; + IOFWAddressSpace * fReconnectORBAddressSpace; + FWAddress fReconnectORBAddress; + + FWSBP2StatusBlock fStatusBlock; + IOFWAddressSpace * fStatusBlockAddressSpace; + FWAddress fStatusBlockAddress; + + FWSBP2StatusBlock fReconnectStatusBlock; + IOFWAddressSpace * fReconnectStatusBlockAddressSpace; + FWAddress fReconnectStatusBlockAddress; + + FWSBP2LogoutORB fLogoutORB; + IOFWAddressSpace * fLogoutORBAddressSpace; + FWAddress fLogoutORBAddress; + bool fLogoutPending; + + IOFWWriteCommand * fLoginWriteCommand; + IOMemoryDescriptor * fLoginWriteCommandMemory; + bool fLoginWriteInProgress; + + IOFWWriteCommand * fReconnectWriteCommand; + IOMemoryDescriptor * fReconnectWriteCommandMemory; + bool fReconnectWriteInProgress; + bool fReconnectWriteInterrupted; + + IOFWWriteCommand * fLogoutWriteCommand; + IOMemoryDescriptor * fLogoutWriteCommandMemory; + bool fLogoutWriteInProgress; + + IOFWCommand * fLoginTimeoutCommand; + bool fLoginTimeoutTimerSet; + + IOFWDelayCommand * fReconnectTimeoutCommand; + bool fReconnectTimeoutTimerSet; + + IOFWCommand * fLogoutTimeoutCommand; + bool fLogoutTimeoutTimerSet; + + FWAddress fFetchAgentAddress; + IOMemoryDescriptor * fFetchAgentWriteCommandMemory; + FWAddress fLastORBAddress; + IOFireWireSBP2ORB * fLastORB; + IOFWWriteCommand * fFetchAgentWriteCommand; + bool fFetchAgentWriteCommandInUse; + FWSBP2FetchAgentWriteCallback fFetchAgentWriteCompletion; + void * fFetchAgentWriteRefCon; + IOFireWireSBP2ORB * fORBToWrite; + + OSSet * fORBSet; + OSIterator * fORBSetIterator; + + void * fPasswordBuf; + UInt32 fPasswordLen; + IOFWAddressSpace * fPasswordAddressSpace; + FWAddress fPasswordAddress; + IOMemoryDescriptor * fPasswordDescriptor; + + bool fSuspended; + + UInt32 fLoginRetryDelay; + UInt32 fLoginRetryCount; + UInt32 fLoginRetryMax; + IOFWDelayCommand * fLoginRetryTimeoutCommand; + bool fLoginRetryTimeoutTimerSet; + IOFireWireSBP2Target * fTarget; + + bool fUnsolicitedStatusEnableRequested; + + IOFWDelayCommand * fReconnectRetryTimeoutCommand; + bool fReconnectRetryTimeoutTimerSet; + + int fCriticalSectionCount; + + // init / destroy + virtual IOReturn getUnitInformation( void ); + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // orb add / remove + virtual IOReturn addORB( IOFireWireSBP2ORB * orb ); + static IOReturn staticExecuteAddORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeAddORB( IOFireWireSBP2ORB * orb ); + + static IOReturn staticExecuteRemoveORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeRemoveORB( IOFireWireSBP2ORB * orb ); + + // + // login + // + + static IOReturn staticExecuteLogin( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeLogin( void ); + virtual void abortLogin( void ); + + // login write complete handler + static void loginWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void loginWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // login timeout handler + static void loginTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void loginTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // status block write handler + static UInt32 statusBlockWriteStatic(void *refcon, UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon lockRead); + virtual UInt32 statusBlockWrite( UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, const void *buf, IOFWRequestRefCon lockRead); + virtual void completeLogin( IOReturn state, const void *buf = NULL, UInt32 len = 0, void * buf2 = NULL ); + + // + // reconnect + // + + virtual void doReconnect( void ); + virtual void restartReconnect( void ); + virtual void startReconnectTimer( void ); + + // reconnect write complete handler + static void reconnectWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void reconnectWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // reconnect timeout handler + static void reconnectTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void reconnectTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // reconnect status block + static UInt32 reconnectStatusBlockWriteStatic(void *refcon, UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, + UInt32 len, const void *buf, IOFWRequestRefCon lockRead); + virtual UInt32 reconnectStatusBlockWrite( UInt16 nodeID, IOFWSpeed &speed, FWAddress addr, UInt32 len, + const void *buf, IOFWRequestRefCon lockRead); + + virtual void sendReconnectNotification( UInt32 event ); + virtual void sendReconnectNotificationWithStatusBlock( UInt32 event ); + + // + // logout + // + + static IOReturn staticExecuteLogout( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeLogout( void ); + + // logout write complete handler + static void logoutWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void logoutWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // logout timeout handler + static void logoutTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void logoutTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + virtual void completeLogout( IOReturn state, const void *buf = NULL, UInt32 len = 0); + + // fetch agent write complete handler + static void fetchAgentWriteCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // fetch agent + // + + bool fFetchAgentResetInProgress; + UInt32 fFetchAgentResetBuffer; + FWAddress fFetchAgentResetAddress; + IOFWWriteQuadCommand * fFetchAgentResetCommand; + void * fFetchAgentResetRefCon; + FWSBP2StatusCallback fFetchAgentResetCompletion; + + static IOReturn staticExecuteFetchAgentReset( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeFetchAgentReset( void ); + static void fetchAgentResetCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void fetchAgentResetComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // doorbell + // + + bool fDoorbellInProgress; + bool fDoorbellRingAgain; + UInt32 fDoorbellBuffer; + FWAddress fDoorbellAddress; + IOFWWriteQuadCommand * fDoorbellCommand; + + static IOReturn staticExecuteDoorbell( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeDoorbell( void ); + static void doorbellCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void doorbellComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // enable unsolicited satus + // + + bool fUnsolicitedStatusEnableInProgress; + UInt32 fUnsolicitedStatusEnableBuffer; + FWAddress fUnsolicitedStatusEnableAddress; + IOFWWriteQuadCommand * fUnsolicitedStatusEnableCommand; + + static IOReturn staticExecuteUnsolicitedStatusEnable( OSObject *self, void *, void *, void *, void * ); + virtual IOReturn executeUnsolicitedStatusEnable( void ); + static void unsolicitedStatusEnableCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void unsolicitedStatusEnableComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + + // + // busy timeout stuff + // + + bool fSetBusyTimeoutInProgress; + UInt32 fSetBusyTimeoutBuffer; + FWAddress fSetBusyTimeoutAddress; + IOFWWriteQuadCommand * fSetBusyTimeoutCommand; + + bool fInCriticalSection; + + UInt16 fLocalNodeID; + bool fFastStartSupported; + UInt32 fFastStartOffset; + UInt32 fFastStartMaxPayload; + + UInt32 fUserLoginGeneration; + bool fUserLoginGenerationSet; + + IOFWDelayCommand * fFetchAgentRetryTimerCommand; + bool fFetchAgentRetryTimerSet; + + virtual IOReturn executeSetBusyTimeout( void ); + static void setBusyTimeoutCompleteStatic( void *refcon, IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + virtual void setBusyTimeoutComplete( IOReturn status, IOFireWireNub *device, IOFWCommand *fwCmd ); + +private: + // IOFireWireSBP2ORB friend class wrappers + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 0); + +protected: + virtual bool initORBWithLogin( IOFireWireSBP2ORB * orb, IOFireWireSBP2Login * login ); + virtual void setNextORBAddress( IOFireWireSBP2ORB * orb, FWAddress address ); + virtual void fetchAgentWriteComplete( IOFireWireSBP2ORB * orb, IOReturn status ); + virtual bool isORBTimerSet( IOFireWireSBP2ORB * orb ); + virtual void cancelORBTimer( IOFireWireSBP2ORB * orb ); + + // IOFireWireSBP2LUN friend class wrappers + virtual void removeLogin( void ); + virtual IOFireWireSBP2Target * getTarget( void ); + + UInt32 fARDMAMax; + bool fPhysicalAccessEnabled; + + bool fLoginStatusReceived; + FWSBP2StatusBlock fLoginStatusBlock; + UInt32 fLoginStatusBlockLen; + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 5); + +public: + + ////////////////////////////// + + /*! + @function createORB + @abstract Creates a new IOFireWireSBP2ORB for this login. + @discussion Create a new IOFireWireSBP2ORB for this login. It can be configured + with it's accessors and executed with submitORB below. + @result Returns a pointer to the new ORB object. + */ + + virtual IOFireWireSBP2ORB * createORB( void ); + + /*! + @function submitORB + @abstract Submits the given orb + @discussion Starts execution of the given ORB. If the ORB is an immediate ORB it's + addresss is written to the fetch agent. If it is a non immediate orb its address + is appended to the last orb of the currently processing chain. The doorbell is not + rung automatically it must be run manually with the ringDoorbell command described below. + @param orb The orb to be executed. + @result Returns kIOReturnSuccess if the ORB has been started successfully. + */ + + virtual IOReturn submitORB( IOFireWireSBP2ORB * orb ); + + // set callbacks + + /*! + @function setStatusNotifyProc + @abstract Sets the callback to be called on normal command status. + @discussion The supplied callback is called when normal command status is recieved, when + a normal command times out, or when a normal command is aborted. + "notificationEvent" in the callback's params will indicate what happened. + It will be set to one of the following values: kFWSBP2NormalCommandReset, kFWSBP2NormalCommandStatus, + or kFWSBP2NormalCommandTimeout. If the event type is kFWSBP2NormalCommandTimeout and "len" is + non-zero then "message" contains the data written to the status block. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2NotifyCallback. + */ + + virtual void setStatusNotifyProc( void * refCon, FWSBP2NotifyCallback callback ); + + /*! + @function getStatusNotifyProc + @abstract Returns the callback to be called on normal command status. + @discussion Returns the refCon and callback address of the status notify callback. + @param refCon output parameter returning the refCon to be passed to the callback. + @param callback output parameter returning the address of the callback. + */ + + virtual void getStatusNotifyProc( void ** refCon, FWSBP2NotifyCallback * callback ); + + /*! + @function setUnsolicitedStatusNotifyProc + @abstract Sets the callback to be called on normal command status. + @discussion The supplied callback is called when unsolicited status is recieved. + "notificationEvent" in the callback's params will indicate what happened. In this + case it will be set to kFWSBP2UnsolicitedStatus. If "len" is + non-zero then "message" contains the data written to the status block. Note: any buffers + returned by callbacks are only valid for the duration of the login and should not have + their contents modified. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2NotifyCallback. + */ + + virtual void setUnsolicitedStatusNotifyProc( void * refCon, FWSBP2NotifyCallback callback ); + + /*! + @function getUnsolicitedStatusNotifyProc + @abstract Returns the callback to be called on unsolicited status. + @discussion Returns the refCon and callback address of the unsolicited status notify callback. + @param refCon output parameter returning the refCon to be passed to the callback. + @param callback output parameter returning the address of the callback. + */ + + virtual void getUnsolicitedStatusNotifyProc( void ** refCon, FWSBP2NotifyCallback * callback ); + + // command handling + + /*! + @function setLoginCompletion + @abstract Sets the callback to be called when a login attempt is complete. + @discussion The supplied callback is called when a login attempt has completed. "status" in the + callback's params should be checked to determine the success or failure of the login attempt. + If "statusBlock" is non-null then login status was written and it has been supplied here. If + the login attempt was successful then the login response will be supplied in the "loginResponse" + buffer. Note: all buffers supplied to callbacks are only valid for the duration of the callback. + Also, you are not to modify the contents of any supplied buffer. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2LoginCallback. + */ + + virtual void setLoginCompletion( void * refCon, FWSBP2LoginCallback completion ); + + /*! + @function submitLogin + @abstract Attempts to login to the LUN. + @discussion This call begins the login process. The login object should be configured prior + to this call. If kIOReturnSuccess is returned from this call then the loginCompletion routine + will be called when the login completes (successfully or unsuccesfully). + @result Returns kIOReturnSuccess login has successlly begun. + */ + + virtual IOReturn submitLogin( void ); + + /*! + @function submitLogout + @abstract Attempts to logout of the LUN. + @discussion This call begins the logout process. If kIOReturnSuccess is returned from this call then + the logoutCompletion routine will be called when the logout completes (successfully or unsuccesfully). + @result Returns kIOReturnSuccess if logout has successfully begun. + */ + + virtual IOReturn submitLogout( void ); + + /*! + @function setLogoutCompletion + @abstract Sets the callback to be called when a logout attempt is complete. + @discussion The supplied callback is called when a logout attempt has completed. "status" in the + callback's params should be checked to determine the success or failure of the logout attempt. + If "statusBlock" is non-null then logout status was written and it has been supplied here. + Note: all buffers supplied to callbacks are only valid for the duration of the callback. + Also, you are not to modify the contents of any supplied buffer. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2LogoutCallback. + */ + + virtual void setLogoutCompletion( void * refCon, FWSBP2LogoutCallback completion ); + + /*! + @function setFetchAgentWriteCompletion + @abstract Sets the callback to be called when the fetch agent write completes. + @discussion When an immediate orb is executed with submitORB, it's address is written to a + specific address on the device. This address is called the fetch agent. The device the + reads that orb from the Mac's memory and executes it. With this call you can register to + be called back when this write to the fetch agent completes. The SBP2 services guarantee + that the fetch agent write will be complete before status is reported for an ORB, so for + most drivers this notification is not required. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2FetchAgentWriteCallback. + */ + + virtual void setFetchAgentWriteCompletion( void * refCon, FWSBP2FetchAgentWriteCallback completion ); + + /*! + @function setFetchAgentResetCompletion + @abstract Sets the callback to be called when a fetch agent reset completes. + @discussion The fetch agent state machine on the device can be reset by a write to a specific + register. The SBP2 services offer a utility method to reset the fetch agent. You can register + a callback routine here to be notified when this rest write completes. + @param refCon refCon passed to callback. + @param callback address of callback method of type FWSBP2FetchAgentWriteCallback. + */ + + virtual void setFetchAgentResetCompletion( void * refCon, FWSBP2StatusCallback completion ); + + /*! + @function submitFetchAgentReset + @abstract Resets the LUN's fetch agent. + @discussion The fetch agent state machine on the device can be reset by a write to a specific + register. This reset can be intiated by a call to this method. Notification of the completion + of this write can be had by registering a callback with the setFetchAgentResetCompletion method. + @result Returns kIOReturnSuccess if the reset started successfully. + */ + + virtual IOReturn submitFetchAgentReset( void ); + + /*! + @function ringDoorbell + @abstract Rings the doorbell on the LUN. + @discussion Non-immediate appends to the ORB chain may require the fetch agent state machine + to be notified of the new ORB's presence. This is accomplished by writing to the so called + doorbell register. This method begins one of those writes. + @result Returns kIOReturnSuccess if the ring started successfully. + */ + + virtual IOReturn ringDoorbell( void ); + + /*! + @function enableUnsolicitedStatus + @abstract Enables unsolicited status. + @discussion After unsolicited is sent the device will not send any additional unsolicited status + until a specific register is written. This serves as a sort of flow-control for unsolicited status. + After unsolicited status is recieved and processed drivers will want to reenable the delivery + of unsolicted status by a call to this method. + @result Returns kIOReturnSuccess if the status enable write started successfully. + */ + + virtual IOReturn enableUnsolicitedStatus( void ); + + // accessors + + /*! + @function getMaxCommandBlockSize + @abstract Returns the maximum command block size. + @discussion The device publishes an upper limit on the size of command block that it can + accept. That value can be accessed via this method. + @result Returns a UInt32 containing the maximum command block size. + */ + + virtual UInt32 getMaxCommandBlockSize( void ); + + /*! + @function getLoginID + @abstract Returns the current login ID. + @discussion When we successfully login to a device. The device gives us a unique login id. + This is used internally for reconnecting to the device after bus resets and for certain other + management ORBs. Most drivers are probably not interested in this value. + @result Returns a UInt32 containing the current login ID. + */ + + virtual UInt32 getLoginID( void ); + + /*! + @function setLoginFlags + @abstract Sets login configuration flags. + @discussion Configures the login behavior according to the provided flags. Currently two + flags are defined for this API. kFWSBP2ExclusiveLogin sets the exclusive login bit in the + login ORB. kFWSBP2DontSynchronizeMgmtAgent allows simultaneous logins or reconnects to LUNs + with a common management agent (ie LUNs in the same unit directory). + @param loginFlags the login configuration flags. + */ + + virtual void setLoginFlags( UInt32 loginFlags ); + + /*! + @function getLoginFlags + @abstract Returns the currently set login flags. + @discussion Returns the current state of the login flags. Currently there is only one + flag defined for this API. kFWSBP2ExclusiveLogin indicates that the exclusive login bit + should be set in the login ORB. + @result Returns a UInt32 containing the currently set login flags. + */ + + virtual UInt32 getLoginFlags( void ); + + /*! + @function setReconnectTime + @abstract Sets the desired reconnect duration. + @discussion The target and initiator arbitrate the duration of the reconnect timeout. Here + the initiator specifies its desired timeout time in 2^reconnectTime seconds. After a + successful login the device returns the actual timeout value it wishes to use. This value + may be less than the reconnect timeout that the intiator specified if this is all that the + device can support. + @param reconnectTime The desired reconnect timeout encoded as 2^reconnectTime seconds. + */ + + virtual void setReconnectTime( UInt32 reconnectTime ); + + /*! + @function getReconnectTime + @abstract Returns the currently set reconnect time. + @discussion Returns the currently desired initiator reconnect time encoded as 2^time seconds. + @result Returns a UInt32 containing the currently set reconnect time. + */ + + virtual UInt32 getReconnectTime( void ); + + /*! + @function setMaxPayloadSize + @abstract Sets the maximum data transfer length for a normal command ORB. + @discussion Sets the maximum data transfer length for a normal command ORB. This value is + the maximum for all ORBs sent to this LUN. This can be trimmed further on an ORB by ORB basis, + by a similar call in the IOFireWireSBP2ORB itself. + @param reconnectTime The desired maximum payload size in bytes. + */ + + virtual void setMaxPayloadSize( UInt32 maxPayloadSize ); + + /*! + @function getMaxPayloadSize + @abstract Returns the currently set maximum payload size. + @discussion Returns the currently global maximum payload size in bytes. + @result Returns a UInt32 containing the currently set maximum payload size. + */ + + virtual UInt32 getMaxPayloadSize( void ); + + /*! + @function setPassword + @abstract Sets the login password. + @discussion Sets the login password using a buffer and a length. An alternate version exists + that accepts an IOMemoryDescriptor. If the password length is 8 or less the password is copied + directly into the login orb. If the length is greater than 8 the buffer is referenced by address + in the login ORB. In this case the buffer is not copied and should remain allocated for the + duration of the login attempt. + @param buf a pointer to the password buffer. + @param len the length in bytes of the password buffer. + @result Returns kIOReturnSuccess on success. + */ + + virtual IOReturn setPassword( void * buf, UInt32 len ); + + /*! + @function setPassword + @abstract Sets the login password. + @discussion Sets the login password using an IOMemoryDescriptor. An alternate version exists + that accepts a buffer and a length. If the password length is 8 or less the password is copied + directly into the login orb. If the length is greater than 8 the buffer is referenced by address + in the login ORB. + @param memory an IOMemoryDescriptor referencing the password. + @result Returns kIOReturnSuccess on success. + */ + + virtual IOReturn setPassword( IOMemoryDescriptor * memory ); + + + /*! + @function setRefCon + @abstract Sets the login refCon. + @discussion Sets a user defined value on the login that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon( void * refCon ); + + /*! + @function getRefCon + @abstract Returns the refCon set with setRefCon. + @discussion Returns the user defined value previously stored in the login with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual void * getRefCon( void ); + + /*! + @function setBusyTimeoutRegisterValue + @abstract Sets the value to be written to the BUSY_TIMEOUT register. + @discussion 1394-1995 defines a register known as the BUSY_TIMEOUT register. This register + controls the busy retry behavior of your device. The initial value for this register is + 0x00000000. Which means busied transactions will not be retried. Since most devices want + their transactions retired on busy acks, the SBP2 service automatically updates the + BUSY_TIMEOUT register with the value specified here whenever necessary. Most drivers should + set this value to 0x0000000f. + @param timeout desired value of the BUSY_TIMEOUT register. + */ + + virtual void setBusyTimeoutRegisterValue( UInt32 timeout ); + +protected: + + virtual void startORBTimer( IOFireWireSBP2ORB * orb ); + virtual void prepareORBForExecution( IOFireWireSBP2ORB * orb ); + + static IOReturn staticExecuteORB( OSObject *self, void * orb, void *, void *, void * ); + virtual IOReturn executeORB( IOFireWireSBP2ORB * orb ); + +public: + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. When retainCount == when then call free(). + */ + + virtual void release() const; + + /*! + @function setLoginRetryCountAndDelayTime + @abstract Sets login retry behavior. + @discussion Sets login retry behavior. + @param retryCount number of times to retry logins + @param uSecs delay time in microseconds between login retries + */ + + virtual void setLoginRetryCountAndDelayTime( UInt32 retryCount, UInt32 uSecs ); + +protected: + virtual IOReturn initialExecuteLogin( void ); + virtual void startLoginRetryTimer( void ); + virtual void stopLoginRetryTimer( void ); + static void loginRetryTimeoutStatic( void *refcon, IOReturn status, + IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void loginRetryTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd); + + virtual void startReconnectRetryTimer( void ); + virtual void stopReconnectRetryTimer( void ); + static void reconnectRetryTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void reconnectRetryTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + virtual bool isORBAppended( IOFireWireSBP2ORB * orb ); + virtual void setORBIsAppended( IOFireWireSBP2ORB * orb, bool state ); + +public: + virtual void setAddressLoForLoginORBAndResponse( UInt32 addressLoORB, UInt32 addresLoResponse ); + + virtual void setLoginGeneration( UInt32 generation ); + virtual void clearLoginGeneration( void ); + +protected: + void startFetchAgentRetryTimer( UInt32 duration ); + void stopFetchAgentRetryTimer( void ); + static void fetchAgentRetryTimerStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + void fetchAgentRetryTimer( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + void terminateNotify( void ); + void processLoginWrite( void ); + +public: + + bool isPhysicalAccessEnabled( void ); + UInt32 getARDMMax( void ); + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Login, 8); + + }; + +#endif diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h b/i386/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h new file mode 100644 index 0000000..9455383 --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2ManagementORB.h @@ -0,0 +1,345 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2ManagementORB + Contains the class definition for IOFireWireSBP2ManagementORB. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2MANAGEMENTORB_H +#define _IOKIT_IOFIREWIRESBP2MANAGEMENTORB_H + +#include +#include + +#include + +class IOFireWireSBP2LUN; +class IOFireWireSBP2ManagementORB; +class IOFireWireSBP2ORB; + +enum +{ + kFWSBP2QueryLogins = 1, + kFWSBP2AbortTask = 0xb, + kFWSBP2AbortTaskSet = 0xc, + kFWSBP2LogicalUnitReset = 0xe, + kFWSBP2TargetReset = 0xf +}; + +// Callback when management command completes asynchronously + +/*! + @typedef FWSBP2ManagementCallback + @param refCon Reference constant supplied when the notification was registered. + @param status Indicates success or failure of operation. + @param orb Indicates current orb status is for. +*/ + +typedef void (*FWSBP2ManagementCallback)(void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb); + +/*! + @class IOFireWireSBP2ManagementORB + @abstract Supplies non login related management ORBs. Management ORBs can be executed independent + of a login, if necessary. Management ORBs are created using the IOFireWireSBP2LUN interface. +*/ + +class IOFireWireSBP2ManagementORB : public IOFWCommand +{ + OSDeclareDefaultStructors( IOFireWireSBP2ManagementORB ) + + friend class IOFireWireSBP2LUN; + friend class IOFireWireSBP2UserClient; + +protected: + + //////////////////////////////////////// + // rom keys + + enum + { + kUnitCharacteristicsKey = 0x3A, + kManagementAgentOffsetKey = 0x54 + }; + + //////////////////////////////////////// + // structs + + typedef struct + { + UInt32 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 reserved1[2]; + UInt16 options; + UInt16 loginID; + UInt32 reserved2; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2TaskManagementORB; + + typedef struct + { + UInt32 reserved1[2]; + UInt32 queryResponseAddressHi; + UInt32 queryResponseAddressLo; + UInt16 options; + UInt16 lun; + UInt16 reserved2; + UInt16 queryResponseLength; + UInt32 statusFIFOAddressHi; + UInt32 statusFIFOAddressLo; + } FWSBP2QueryLoginsORB; + + typedef struct + { + UInt8 details; + UInt8 sbpStatus; + UInt16 orbOffsetHi; + UInt32 orbOffsetLo; + UInt32 status[6]; + } FWSBP2StatusBlock; + +protected: + + //////////////////////////////////////// + // friend methods + + // IOFireWireSBP2LUN methods + virtual bool initWithLUN( IOFireWireSBP2LUN * lun, + void * refCon, + FWSBP2ManagementCallback completion ); + + // IOFireWireSBP2UserClient methods + virtual void setAsyncCallbackReference( void * asyncRef ); + virtual void getAsyncCallbackReference( void * asyncRef ); + +protected: + + // reserved for future use + struct ExpansionData + { + bool fInCriticalSection; + }; + ExpansionData * fExpansionData; + + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + + UInt32 fManagementOffset; + UInt32 fManagementTimeout; + UInt32 fFunction; + OSObject * fManageeCommand; + + // our orb + FWSBP2TaskManagementORB fManagementORB; + IOFWAddressSpace * fManagementORBAddressSpace; + FWAddress fManagementORBAddress; + + // command to write management agent + IOFWWriteCommand * fWriteCommand; + IOMemoryDescriptor * fWriteCommandMemory; + + // timeout + IOFWCommand * fTimeoutCommand; + bool fTimeoutTimerSet; + + // status block + FWSBP2StatusBlock fStatusBlock; + IOFWAddressSpace * fStatusBlockAddressSpace; + FWAddress fStatusBlockAddress; + + // response buffer + void * fResponseBuf; + UInt32 fResponseLen; + IOFWAddressSpace * fResponseAddressSpace; + FWAddress fResponseAddress; + + // competion routine + FWSBP2ManagementCallback fCompletionCallback; + void * fCompletionRefCon; + + // for user client + OSAsyncReference64 fCallbackAsyncRef; + + IOMemoryMap * fResponseMap; + + bool fCompleting; + + //////////////////////////////////////// + + // init / destroy + virtual IOReturn getUnitInformation( void ); + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // command execution + virtual IOReturn execute( void ); + virtual IOReturn complete( IOReturn state ); + + // write complete handler + static void writeCompleteStatic( void *refcon, + IOReturn status, + IOFireWireNub *device, + IOFWCommand *fwCmd ); + virtual void writeComplete( IOReturn status, + IOFireWireNub *device, + IOFWCommand *fwCmd ); + + // timeout handler + static void handleTimeoutStatic( void *refcon, + IOReturn status, + IOFireWireBus *bus, + IOFWBusCommand *fwCmd ); + virtual void handleTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // status block write handler + static UInt32 statusBlockWriteStatic( void *refcon, + UInt16 nodeID, + IOFWSpeed &speed, + FWAddress addr, + UInt32 len, + const void *buf, + IOFWRequestRefCon lockRead ); + virtual UInt32 statusBlockWrite( UInt16 nodeID, + FWAddress addr, + UInt32 len, + const void *buf, + IOFWRequestRefCon lockRead ); + + // IOFireWireSBP2LUN friend class wrappers + virtual void clearAllTasksInSet( void ); + virtual void removeManagementORB( IOFireWireSBP2ManagementORB * orb ); + +public: + + //////////////////////////////////////// + // client methods + + /*! + @function setCommandFunction + @abstract Sets the function of the management ORB. + @discussion Sets the the function of the management ORB. Legal values are kFWSBP2QueryLogins, + kFWSBP2AbortTask, kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset. + @param function a value indicating the desired management function. + @result Returns kIOReturnSuccess if function was a legal function. + */ + + virtual IOReturn setCommandFunction( UInt32 function ); + + /*! + @function getCommandFunction + @abstract Returns the current function of the management ORB. + @discussion Returns the function of the management ORB. This is the same value that was + set with setCommandFunction. + @result Returns the function of the management ORB. + */ + + virtual UInt32 getCommandFunction( void ); + + /*! + @function setManageeCommand + @abstract Sets the command to be managed by the management ORB. + @discussion All management functions except kFWSBP2QueryLogins require a reference to an ORB of + some sort. kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset require a + reference to the login ORB. kFWSBP2AbortTask requires a reference to the ORB to be aborted. + This method allows you to set the ORB to be managed. + @param command a reference to an IOFireWireSBP2Login or an IOFireWireSBP2ORB. + */ + + virtual void setManageeCommand( OSObject * command ); + + /*! + @function getCommandFunction + @abstract Returns the current managee command of the management ORB. + @discussion Returns the current managee command of the management ORB. This is the same value that was + set with setManageeCommand. + @result Returns the current managee command of the management ORB. + */ + + virtual OSObject* getManageeCommand( void ); + + /*! + @function setResponseBuffer + @abstract Sets the response buffer for the management ORB. + @discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns + a response to its query and needs to write it somewhere. This routine allows you to + specify the location. + @param desc memory descriptor for buffer. + @result Returns kIOReturnSuccess on a success. + */ + + virtual IOReturn setResponseBuffer( IOMemoryDescriptor * desc ); + + /*! + @function setResponseBuffer + @abstract Sets the response buffer for the management ORB. + @discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns + a response to its query and needs to write it somewhere. This routine allows you to + specify the location. + @param buf backing store for buffer + @param len length of buffer. + @result Returns kIOReturnSuccess on a success. + */ + + virtual IOReturn setResponseBuffer( void * buf, UInt32 len ); + + /*! + @function getResponseBuffer + @abstract Returns the response buffer for the management ORB. + @discussion Returns the response buffer set in setResponseBuffer above + @param desc memory descriptor for buffer. + @param buf output parameter for backing store for buffer + @param len output parameter for length of buffer. + */ + + virtual void getResponseBuffer( void ** buf, UInt32 * len ); + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. + @param when When retainCount == when then call free(). + */ + + virtual void release() const; + +protected: + + virtual void setORBToDummy( IOFireWireSBP2ORB * orb ); + + virtual void suspendedNotify(); + +private: + + OSMetaClassDeclareReservedUsed(IOFireWireSBP2ManagementORB, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ManagementORB, 8); + +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2ORB.h b/i386/include/IOKit/sbp2/IOFireWireSBP2ORB.h new file mode 100644 index 0000000..5c11593 --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2ORB.h @@ -0,0 +1,547 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2ORB + Contains the class definition for IOFireWireSBP2ORB. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2ORB_H +#define _IOKIT_IOFIREWIRESBP2ORB_H + +#include + +#include +#include +#include + +enum +{ + kFWSBP2ConstraintForceDoubleBuffer = (1 << 0) +}; + +// login option flags +enum +{ + kFWSBP2CommandCompleteNotify = (1 << 0), + kFWSBP2CommandTransferDataFromTarget = (1 << 1), + kFWSBP2CommandImmediate = (1 << 2), + + kFWSBP2CommandNormalORB = (1 << 5), + kFWSBP2CommandReservedORB = (1 << 6), + kFWSBP2CommandVendorORB = (1 << 7), + kFWSBP2CommandDummyORB = (1 << 8), + kFWSBP2CommandCheckGeneration = (1 << 9), + + kFWSBP2CommandFixedSize = (1 << 10), + kFWSBP2CommandVirtualORBs = (1 << 11) // handy for debugging +}; + +enum +{ + kFWSBP2MaxPageClusterSize = 0xf000 +}; + +class IOFireWireSBP2ORB; +class IOFireWireSBP2LUN; +class IOFireWireSBP2Login; + +/*! + @class IOFireWireSBP2ORB + @abstract Represents an SBP2 normal command ORB. Supplies the APIs for configuring normal + command ORBs. This includes setting the command block and writing the page tables for I/O. + The ORBs are executed using the submitORB method in IOFireWireSBP2Login. +*/ + +class IOFireWireSBP2ORB : public IOCommand +{ + OSDeclareDefaultStructors( IOFireWireSBP2ORB ) + + friend class IOFireWireSBP2Login; + friend class IOFireWireSBP2ManagementORB; + +protected: + + typedef struct + { + UInt32 nextORBAddressHi; + UInt32 nextORBAddressLo; + UInt32 dataDescriptorHi; + UInt32 dataDescriptorLo; + UInt16 options; + UInt16 dataSize; + UInt32 commandBlock[1]; // will be variable sized + } FWSBP2ORB; + + typedef struct + { + UInt16 segmentLength; + UInt16 segmentBaseAddressHi; + UInt32 segmentBaseAddressLo; + } FWSBP2PTE; + +private: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2ORB, 8); + +protected: + + virtual void deallocateBufferAddressSpace( void ); + virtual IOReturn allocateTimer( void ); + virtual void deallocateTimer( void ); + + /*! + @function deallocatePageTable + @abstract Frees up memory allocated for the page table. + @discussion Frees all memory associated with the page table. Undoes what allocatePageTable does. + Calling allocatePageTable again will automatically deallocate the existing page table before + allocating a new one, so this method is not used in most cases. + */ + + virtual void deallocatePageTable( void ); + +protected: + + // IOFireWireSBP2Login methods + virtual bool initWithLogin( IOFireWireSBP2Login * login ); + virtual void setNextORBAddress( FWAddress address ); + +public: + + /*! + @function allocatePageTable + @abstract Allocates memory for the page table. + @discussion Page table allocation is handle automatically by the ORB, except if the + kFWSBP2CommandFixedSize flags is set. In this case we will fail to write a page table if we + need more page table space than we have already. This method is exposed so these drivers + can preallocate as much page table as they need. This is useful if your driver is part of + the paging path and cannot allow allocations to occur. + @param entryCount number of entries of page table to be allocated. + */ + + virtual IOReturn allocatePageTable( UInt32 entryCount ); + +protected: + + virtual bool isTimerSet( void ); + virtual void cancelTimer( void ); + +protected: + + // reserved for future use + struct ExpansionData { }; + ExpansionData *reserved; + + IOFireWireSBP2Login * fLogin; + IOFireWireSBP2LUN * fLUN; + IOFireWireUnit * fUnit; + IOFireWireController * fControl; + IODMACommand * fDMACommand; + void * fUnused2; + + UInt32 fCommandFlags; + UInt32 fMaxPayloadSize; + UInt32 fTimeoutDuration; + UInt32 fGeneration; + UInt64 fRefCon; + + // + // orb + // + + IOMemoryDescriptor * fORBDescriptor; + FWSBP2ORB * fORBBuffer; + + FWAddress fORBPseudoAddress; + IOFWAddressSpace * fORBPseudoAddressSpace; + + IOFWAddressSpace * fORBPhysicalAddressSpace; + FWAddress fORBPhysicalAddress; + + // + // page table + // + + UInt32 fPageTableSize; + IOBufferMemoryDescriptor * fPageTableDescriptor; + + IOFWAddressSpace * fPageTablePhysicalAddressSpace; + FWAddress fPageTablePhysicalAddress; + UInt32 fPageTablePhysicalLength; + + IOFWAddressSpace * fPageTablePseudoAddressSpace; + FWAddress fPageTablePseudoAddress; + + // + // buffers + // + + IOFWAddressSpace * fBufferAddressSpace; + bool fBufferAddressSpaceAllocated; + IOMemoryDescriptor * fBufferDescriptor; + + // + // timer + // + + IOFWDelayCommand * fTimeoutCommand; + bool fTimeoutTimerSet; + + bool fInProgress; + bool fIsAppended; + + UInt32 fFetchAgentWriteRetries; + UInt32 fPTECount; + UInt32 fFetchAgentWriteRetryInterval; + + UInt32 fConstraintOptions; + + virtual IOReturn allocateResources( void ); + virtual void free( void ); + + // orb timeout handler + static void orbTimeoutStatic( void *refcon, IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + virtual void orbTimeout( IOReturn status, IOFireWireBus *bus, IOFWBusCommand *fwCmd ); + + // login friend class wrappers + virtual IOFireWireUnit * getFireWireUnit( void ); + virtual IOFireWireSBP2LUN * getFireWireLUN( void ); + virtual void deallocateORB( void ); + virtual IOReturn allocateORB( UInt32 orbSize ); + virtual IOReturn removeORB( IOFireWireSBP2ORB * orb ); + virtual void prepareORBForExecution( void ); + virtual void startTimer( void ); + virtual void sendTimeoutNotification( IOFireWireSBP2ORB * orb ); + +public: + + /*! + @function release + @abstract Primary implementation of the release mechanism. + @discussion See OSObject.h for more information. + @param when When retainCount == when then call free(). + */ + + virtual void release() const; + + /*! + @function getLogin + @abstract Gets the login associated with this ORB. + @discussion Returns the IOFireWireSBP2Login object associated with this ORB. + @result Returns a pointer to an IOFireWireSBP2Login. + */ + + virtual IOFireWireSBP2Login * getLogin( void ); + + /*! + @function setCommandBuffersAsRanges + @abstract Creates a page table from a list of ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. + @param ranges An array of ranges representing the data to be transfered. + @param withCount The number of ranges in the ranges array. + @param withDirection An IODirection indicating the direction of data transfer. + @param withTask The task that these adressses reside in. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + virtual IOReturn setCommandBuffersAsRanges( IOVirtualRange * ranges, + UInt32 withCount, + IODirection withDirection, + task_t withTask, + UInt32 offset = 0, + UInt32 length = 0 ); + /*! + @function setCommandBuffersAsRanges + @abstract Creates a page table from a list of ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. + @param memoryDescriptor IOMemoryDescriptor describe ranges to be written to a page table. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + virtual IOReturn setCommandBuffers( IOMemoryDescriptor * memoryDescriptor, UInt32 offset = 0, + UInt32 length = 0 ); + + + /*! + @function releaseCommandBuffers + @abstract Releases SBP2's reference to the command buffers. + @discussion When you create a page table with one of the variants of setCommandBuffers. + SBP2 holds on to a reference to the buffers until this method is called. This means that + if a command completed and you manipulated the memory descriptor or released the buffers + without calling this method you could leave FW in an inconsistent state. + @result Returns KIOReturnSuccess if the page table was cleared successfully. + */ + + virtual IOReturn releaseCommandBuffers( void ); + + /*! + @function setCommandBlock + @abstract Sets the command block portion of the ORB. + @discussion Copys the data provided in the buffer to the command block portion of the ORB. + @param buffer Pointer to buffer to copy command block from. + @param length Number of bytes of data to copy. + @result Returns KIOReturnSuccess if the command block was updated successfully. + */ + + virtual IOReturn setCommandBlock( void * buffer, UInt32 length ); + + /*! + @function setCommandBlock + @abstract Sets the command block portion of the ORB. + @discussion Copys the data provided in the buffer to the command block portion of the ORB. + @param memory IOMemoryDescriptor representing the command block buffer. + @result Returns KIOReturnSuccess if the command block was updated successfully. + */ + + virtual IOReturn setCommandBlock( IOMemoryDescriptor * memory ); + + /*! + @function getCommandBufferDescriptor + @abstract Returns the memory descriptor representing the command buffer. + @discussion Returns the IOMemoryDescriptor for the data mapped by setCommandBuffer variants. + Works for setCommandBuffersAsRanges too. + @result Returns memory descriptor representing mapped data buffers. + */ + + virtual IOMemoryDescriptor * getCommandBufferDescriptor( void ); + + // accessors + + /*! + @function setCommandFlags + @abstract Sets configuration flags for the ORB. + @discussion Sets the configuration flags for the ORB. These can be any of the following: +

kFWSBP2CommandCompleteNotify - Set the notify bit as specified in SBP2 standard. Set to receive completion/timeout notification on this ORB. You almost always want to set this.

+

kFWSBP2CommandTransferDataFromTarget - Transfer direction as specified in SBP2 standard. Set if data is to be written by the device into the host's memory.

+

kFWSBP2CommandImmediate - Immediate Append. ORB address will be written to fetch agent and not chained. It is only legal to have one immediate ORB in progress at a time.

+

kFWSBP2CommandNormalORB - ORB format 0 - Format specified by SBP2 standard. Set this for most ORBs.

+

kFWSBP2CommandReservedORB - ORB format 1 - Format reserved by SBP2 standard for future standardization.

+

kFWSBP2CommandVendorORB - ORB format 2 - Format specified by SBP2 standard for vendor dependent ORBs.

+

kFWSBP2CommandDummyORB - ORB format 3 - Format specified by SBP2 standard for dummy ORBs.

+

kFWSBP2CommandCheckGeneration - If set upon submitORB, the ORB will only be appended if generation set with setCommandGeneration() matches the current generation. Pretty much all SBP2 drivers need sophisticated logic to track login state, so this is generally not used.

+

kFWSBP2CommandFixedSize - Do not allocate more memory for page table if needed. If there is not enough space in the currently allocated page table, the setCommandBuffers call will fail. This is important to set if your device is the backing store, as we don't want to cause memory allocations on the paging path.

+

kFWSBP2CommandVirtualORBs - Normally ORBs are backed by physical address spaces. Setting this flag makes this ORB backed by a pseudo address space. This can make ORBs easier to see in a bus trace. Virtual ORBs will have an address in the form of ffcX.XXXX.0000.0000. Pseudo address space backed ORBs are slower, so you won't want to set for deployment builds.

+ @param flags The flags to be set. + */ + + virtual void setCommandFlags( UInt32 flags ); + + /*! + @function getCommandFlags + @abstract Sets configuration flags for the ORB. + @discussion Returns the current configuration flags set on this ORB. + @result Return The current ORB flags. + */ + + virtual UInt32 getCommandFlags( void ); + + /*! + @function setMaxPayloadSize + @abstract Sets max payload size for the ORB. + @discussion This sets the maximum payload size for this ORB only. This size is clipped by + the global max payload size set in the login object. + @param maxPayloadSize The maximum payload size in bytes. + */ + + virtual void setMaxPayloadSize( UInt32 maxPayloadSize ); + + /*! + @function getMaxPayloadSize + @abstract Gets max payload size for the ORB. + @discussion This gets the maximum payload size for this ORB only. + @result Returns the maximum payload size in bytes. + */ + + virtual UInt32 getMaxPayloadSize( void ); + + /*! + @function setCommandTimeout + @abstract Sets the timeout of the ORB. + @discussion This sets the timeout for the ORB in milliseconds. Note that ORBs without timeouts + can be "lost." You will obviously not recieve timeout notification for timeouts of zero. But + perhaps less obviously you will not recieve orb reset notification, which is really a sort of + accelerated timeout notification for bus reset situations. + @param timeout The timeout duration in milliseconds. + */ + + virtual void setCommandTimeout( UInt32 timeout ); + + /*! + @function getCommandTimeout + @abstract Gets the timeout of the ORB. + @discussion This method gets the timeout for this ORB in milliseconds. + @result Returns the timeout for the orb in milliseconds. + */ + + virtual UInt32 getCommandTimeout( void ); + + + /*! + @function setCommandGeneration + @abstract Sets the command generation. + @discussion This sets the bus generation this ORB should be appended in. It is only meaningful + when combined with the kFWSBP2CommandCheckGeneration flags above. + @param gen The bus generation for command execution. + */ + + virtual void setCommandGeneration( UInt32 gen ); + + /*! + @function getCommandGeneration + @abstract Gets the command generation. + @discussion This gets the bus generation this ORB should be appended in. + @result Returns the bus generation for command execution. + */ + + virtual UInt32 getCommandGeneration( void ); + + /*! + @function setRefCon + @abstract Sets the ORB refCon. + @discussion Sets a user defined value on the ORB that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon( void * refCon ); + + /*! + @function getRefCon + @abstract Returns the refCon set with setRefCon. + @discussion Returns the user defined value previously stored in the ORB with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual void * getRefCon( void ); + +protected: + + virtual void setToDummy( void ); + +public: + /*! + @function getORBAddress + @abstract Returns the FireWire address of this ORB. + @discussion Returns the FireWire bus address of this ORB. This is not the same as the Macintosh + address for the IOFireWireSBP2ORB. + @result Returns the FireWire address of this ORB. + */ + + virtual void getORBAddress( FWAddress * address ); + +protected: + + virtual bool isAppended( void ); + virtual void setIsAppended( bool state ); + virtual UInt32 getFetchAgentWriteRetries( void ); + virtual void setFetchAgentWriteRetries( UInt32 retries ); + + virtual void prepareFastStartPacket( IOBufferMemoryDescriptor * descriptor ); + + UInt32 getFetchAgentWriteRetryInterval( void ); + void setFetchAgentWriteRetryInterval( UInt32 interval ); + + IOReturn completeBufferAddressSpace( void ); + IOReturn prepareBufferAddressSpace( IOMemoryDescriptor * memoryDescriptor ); + +public: + + /*! + @function setBufferConstraints + @abstract Configures page table generation parameters + @discussion Sets the maximums size of any page table segment and the required alignemnt. Double buffering + may be used to satisfy these constraints. The only supported option is kFWSBP2ConstraintForceDoubleBuffer which + forces a page aligned double buffering of the entire descriptor. + @result May return an error if there is a problem allocating the underlying resources or if buffers are currently attached. + */ + + IOReturn setBufferConstraints( UInt64 maxSegmentSize, UInt32 alignment, UInt32 options = 0); + + + /*! + @function setCommandBuffersAsRanges64 + @abstract Creates a page table from a list of 64 bit ranges. + @discussion Creates a page table with the given parameters. Any addresses mapped by this method + must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. + The SBP2 services do not release references to the command buffers just because the command + has completed. This is a 64 bit compatible version of setCommandBuffersAsRanges. + @param ranges An array of ranges representing the data to be transfered. + @param withCount The number of ranges in the ranges array. + @param withDirection An IODirection indicating the direction of data transfer. + @param withTask The task that these adressses reside in. + @param offset Offset in bytes into data to begin writing table at. + @param length Number of bytes of data to map from offset. + @result Returns KIOReturnSuccess if the page table was written successfully. + */ + + IOReturn setCommandBuffersAsRanges64( IOAddressRange * ranges, + uint64_t withCount, + IODirection withDirection, + task_t withTask, + uint64_t offset = 0, + uint64_t length = 0); + + /*! + @function setRefCon64 + @abstract Sets the ORB refCon as a 64 bit value. + @discussion Sets a user defined value on the ORB that can be retrieved later with the + method getRefCon. + @param refCon a user defined value. + */ + + virtual void setRefCon64( UInt64 refCon ); + + /*! + @function getRefCon64 + @abstract Returns the 64 bit refCon set with setRefCon64. + @discussion Returns the user defined value previously stored in the ORB with setRefCon. + @result Returns the previously stored user defined value. + */ + + virtual UInt64 getRefCon64( void ); + +protected: + + UInt32 calculateTransferSizeLog( bool * clipping ); + + +}; + +#endif diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2Target.h b/i386/include/IOKit/sbp2/IOFireWireSBP2Target.h new file mode 100644 index 0000000..4288ce9 --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2Target.h @@ -0,0 +1,224 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOFireWireSBP2Target + Contains the class definition for IOFireWireSBP2Target. +*/ + +#ifndef _IOKIT_IOFIREWIRESBP2TARGET_H +#define _IOKIT_IOFIREWIRESBP2TARGET_H + +#include +#include + +enum +{ + kIOFWSBP2FailsOnAckBusy = (1 << 0), + kIOFWSBP2FailsOnBusResetsDuringIO = (1 << 1), + kIOFWSBP2DontUsePTPacketLimit = (1 << 2) +}; + +/*! + @class IOFireWireSBP2Target + @abstract Serves as bridge between IOFireWireUnit and IOFireWireLUN. + @discussion Matches against IOFireWireUnits supporting the SBP2 protocol. Creates IOFireWireSBP2LUN nubs for matching. Most drivers will match against an IOFireWireSBP2LUN, but matching against an IOFireWireSBP2Target is also supported. This can be useful in cases where a single driver wishes to + control all LUNs on a device. Support for this technique is minimal, however, and the driver will be + required to discover it's LUNs through the registry. +*/ + +class IOFireWireSBP2Target : public IOService +{ + OSDeclareDefaultStructors(IOFireWireSBP2Target); + +protected: + + ///////////////////////////////////////// + // rom keys + + enum + { + kCmdSpecIDKey = 0x38, + kCmdSetKey = 0x39, + kSoftwareRevKey = 0x3b, + kFirmwareRevKey = 0x3c, + kLUNKey = 0x14, + kLUNDirectoryKey = 0xd4, + kManagementAgentOffsetKey = 0x54, + kUnitCharacteristicsKey = 0x3A, + kRevisionKey = 0x21, + kFastStartKey = 0x3E + }; + + typedef struct + { + UInt32 cmdSpecID; + UInt32 cmdSet; + UInt32 vendorID; + UInt32 softwareRev; + UInt32 firmwareRev; + UInt32 lun; + UInt32 devType; + UInt32 unitCharacteristics; + UInt32 managementOffset; + UInt32 revision; + bool fastStartSupported; + UInt32 fastStart; + } LUNInfo; + + // reserved for future use + struct ExpansionData + { + bool fStarted; + OSArray * fPendingMgtAgentCommands ; + UInt32 fNumberPendingMgtAgentOrbs; + UInt32 fNumLUNs; + }; + ExpansionData * fExpansionData; + + ///////////////////////////////////////// + // private fields + + bool fOpenFromTarget; + UInt32 fOpenFromLUNCount; + IOFireWireUnit * fProviderUnit; + UInt32 fFlags; + + IOFireWireController * fControl; + + UInt32 fIOCriticalSectionCount; + + ///////////////////////////////////////// + // private internals + + virtual void free( void ); + virtual IOReturn message( UInt32 type, + IOService * provider, + void * argument = 0); + + virtual void scanForLUNs( void ); + IOReturn createLUN( LUNInfo * info ); + +public: + + ///////////////////////////////////////// + // public methods + + /*! @function handleOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the open. + @param options Options for the open, may be interpreted by the implementor of handleOpen. + @result Return true if the open was successful, false otherwise. */ + + virtual bool handleOpen( IOService * forClient, IOOptionBits options, void * arg ); + + /*! + @function handleClose + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient Designates the client of the provider requesting the close. + @param options Options for the close, may be interpreted by the implementor of handleOpen. + */ + + virtual void handleClose( IOService * forClient, IOOptionBits options ); + + /*! + @function handleIsOpen + @abstract Overrideable method to control the open / close behaviour of an IOService. + @discussion See IOService for discussion. + @param forClient If non-zero, isOpen returns the open state for that client. If zero is passed, isOpen returns the open state for all clients. + @result Returns true if the specific, or any, client has the IOService open. + */ + + virtual bool handleIsOpen( const IOService * forClient ) const; + + /*! + @function start + @abstract During an IOService instantiation, the start method is called when the IOService has been selected to run on the provider. + @discussion See IOService for discussion. + @result Return true if the start was successful, false otherwise (which will cause the instance to be detached and usually freed). + */ + + virtual bool start( IOService *provider ); + + /*! + @function stop + @abstract During an IOService termination, the stop method is called in its clients before they are detached & it is destroyed. + @discussion See IOService for discussion. + */ + + virtual void stop( IOService *provider ); + + /*! + @function getFireWireUnit + @abstract Returns an IOFireWireUnit object. + @discussion An IOFireWireUnit is the provider of an IOFireWireSBP2Target. In order to use the base FireWire services + you will need a reference to the unit. This method returns that reference. + @result Returns a pointer to an IOFireWireUnit. + */ + + virtual IOFireWireUnit * getFireWireUnit( void ); + + /*! + @function matchPropertyTable + @abstract Implements SBP2 specific matching. + @discussion See IOService for discussion. + @param table The dictionary of properties to be matched against. + @result Returns false if the family considers the matching dictionary does not match in properties it understands, true otherwise. + */ + + virtual bool matchPropertyTable( OSDictionary * table ); + + virtual void setTargetFlags( UInt32 flags ); + virtual UInt32 getTargetFlags( void ); + +protected: + virtual void configurePhysicalFilter( void ); + +public: + virtual void clearTargetFlags( UInt32 flags ); + virtual IOReturn beginIOCriticalSection( void ); + virtual void endIOCriticalSection( void ); + + virtual bool finalize( IOOptionBits options ); + + IOReturn synchMgmtAgentAccess( IOFWCommand * mgmtOrbCommand ); + void completeMgmtAgentAccess( ); + void clearMgmtAgentAccess( ); + void cancelMgmtAgentAccess( IOFWCommand * mgmtOrbCommand ); + +protected: + + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 0); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 1); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 2); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 3); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 4); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 5); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 6); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 7); + OSMetaClassDeclareReservedUnused(IOFireWireSBP2Target, 8); + +}; + +#endif diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2UserClient.h b/i386/include/IOKit/sbp2/IOFireWireSBP2UserClient.h new file mode 100644 index 0000000..939dbf0 --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2UserClient.h @@ -0,0 +1,186 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIRESBP2USERCLIENT_H +#define _IOKIT_IOFIREWIRESBP2USERCLIENT_H + +#include + +#define FIREWIREPRIVATE +#include +#undef FIREWIREPRIVATE + +#include + +#include +#include + +class IOFireWireSBP2UserClient : public IOUserClient +{ + OSDeclareDefaultStructors(IOFireWireSBP2UserClient) + +protected: + + bool fOpened; + bool fStarted; + IOFireWireSBP2Login * fLogin; + task_t fTask; + + IOFireWireSBP2LUN * fProviderLUN; + OSAsyncReference64 fMessageCallbackAsyncRef; + OSAsyncReference64 fLoginCallbackAsyncRef; + OSAsyncReference64 fLogoutCallbackAsyncRef; + OSAsyncReference64 fUnsolicitedStatusNotifyAsyncRef; + OSAsyncReference64 fStatusNotifyAsyncRef; + OSAsyncReference64 fFetchAgentResetAsyncRef; + OSAsyncReference64 fFetchAgentWriteAsyncRef; + + IOFWUserObjectExporter * fExporter; + + IOFireWireLib::UserObjectHandle fSessionRef; + + virtual IOReturn externalMethod( uint32_t selector, + IOExternalMethodArguments * args, + IOExternalMethodDispatch * dispatch, + OSObject * target, + void * reference ); +public: + + virtual bool initWithTask( task_t owningTask, void * securityToken, UInt32 type, OSDictionary * properties ); + virtual void free (); + + virtual bool start( IOService * provider ); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + // IOFireWireSBP2ManagementORB friend class wrappers + virtual void flushAllManagementORBs( void ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2LUN + + IOReturn open( IOExternalMethodArguments * arguments ); + IOReturn openWithSessionRef( IOExternalMethodArguments * arguments ); + IOReturn getSessionRef( IOExternalMethodArguments * arguments ); + IOReturn close( IOExternalMethodArguments * arguments ); + + // callbacks + IOReturn setMessageCallback( IOExternalMethodArguments * arguments ); + virtual IOReturn message( UInt32 type, IOService * provider, void * arg ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2Login + + IOReturn setLoginCallback( IOExternalMethodArguments * arguments ); + IOReturn setLogoutCallback( IOExternalMethodArguments * arguments ); + IOReturn setUnsolicitedStatusNotify( IOExternalMethodArguments * arguments ); + IOReturn setStatusNotify( IOExternalMethodArguments * arguments ); + IOReturn createLogin( IOExternalMethodArguments * arguments ); + IOReturn releaseLogin( IOExternalMethodArguments * arguments ); + IOReturn submitLogin( IOExternalMethodArguments * arguments ); + IOReturn submitLogout( IOExternalMethodArguments * arguments ); + IOReturn setLoginFlags( IOExternalMethodArguments * arguments ); + IOReturn getMaxCommandBlockSize( IOExternalMethodArguments * arguments ); + IOReturn getLoginID( IOExternalMethodArguments * arguments ); + IOReturn setReconnectTime( IOExternalMethodArguments * arguments ); + IOReturn setMaxPayloadSize( IOExternalMethodArguments * arguments ); + + IOReturn submitFetchAgentReset( IOExternalMethodArguments * arguments ); + IOReturn setFetchAgentWriteCompletion( IOExternalMethodArguments * arguments ); + IOReturn ringDoorbell( IOExternalMethodArguments * arguments ); + IOReturn enableUnsolicitedStatus( IOExternalMethodArguments * arguments ); + IOReturn setBusyTimeoutRegisterValue( IOExternalMethodArguments * arguments ); + IOReturn setPassword( IOExternalMethodArguments * arguments ); + + // callbacks + + static void staticLoginCallback( void * refCon, FWSBP2LoginCompleteParamsPtr params ); + virtual void loginCallback( FWSBP2LoginCompleteParamsPtr params ); + + static void staticLogoutCallback( void * refCon, FWSBP2LogoutCompleteParamsPtr params ); + virtual void logoutCallback( FWSBP2LogoutCompleteParamsPtr params ); + + static void staticStatusNotify( void * refCon, FWSBP2NotifyParams * params ); + virtual void statusNotify( FWSBP2NotifyParams * params ); + + static void staticUnsolicitedNotify( void * refCon, FWSBP2NotifyParams * params ); + virtual void unsolicitedNotify( FWSBP2NotifyParams * params ); + + static void staticFetchAgentWriteComplete( void * refCon, IOReturn status, IOFireWireSBP2ORB * orb ); + virtual void fetchAgentWriteComplete( IOReturn status, IOFireWireSBP2ORB * orb ); + + static void staticFetchAgentResetComplete( void * refCon, IOReturn status ); + virtual void fetchAgentResetComplete( IOReturn status ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2ORB + + IOReturn createORB( IOExternalMethodArguments * arguments ); + IOReturn releaseORB( IOExternalMethodArguments * arguments ); + IOReturn submitORB( IOExternalMethodArguments * arguments ); + IOReturn setCommandFlags( IOExternalMethodArguments * arguments ); + IOReturn setORBRefCon( IOExternalMethodArguments * arguments ); + IOReturn setMaxORBPayloadSize( IOExternalMethodArguments * arguments ); + IOReturn setCommandTimeout( IOExternalMethodArguments * arguments ); + IOReturn setCommandGeneration( IOExternalMethodArguments * arguments ); + IOReturn setToDummy( IOExternalMethodArguments * arguments ); + IOReturn setCommandBuffersAsRanges( IOExternalMethodArguments * arguments ); + IOReturn releaseCommandBuffers( IOExternalMethodArguments * arguments ); + IOReturn setCommandBlock( IOExternalMethodArguments * arguments ); + + // LSI workaround + IOReturn LSIWorkaroundSetCommandBuffersAsRanges( IOExternalMethodArguments * arguments ); + IOReturn LSIWorkaroundSyncBuffersForOutput( IOExternalMethodArguments * arguments ); + IOReturn LSIWorkaroundSyncBuffersForInput( IOExternalMethodArguments * arguments ); + + ///////////////////////////////////////////////// + // IOFireWireSBP2MgmtORB + + IOReturn createMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn releaseMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBCallback( IOExternalMethodArguments * arguments ); + IOReturn submitMgmtORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBCommandFunction( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBManageeORB( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBManageeLogin( IOExternalMethodArguments * arguments ); + IOReturn setMgmtORBResponseBuffer( IOExternalMethodArguments * arguments ); + + // callbacks + static void staticMgmtORBCallback( void * refCon, IOReturn status, IOFireWireSBP2ManagementORB * orb ); + virtual void mgmtORBCallback( IOReturn status, IOFireWireSBP2ManagementORB * orb ); + + // IOFireWireSBP2MgmtORB friend class wrappers + virtual void setMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); + virtual void getMgmtORBAsyncCallbackReference( IOFireWireSBP2ManagementORB * orb, void * asyncRef ); + + uint32_t checkScalarInputCount; + uint32_t checkStructureInputSize; + uint32_t checkScalarOutputCount; + uint32_t checkStructureOutputSize; + + IOReturn checkArguments( IOExternalMethodArguments * args, uint32_t scalarInCount, uint32_t structInCount, + uint32_t scalarOutCount, uint32_t structOutCount ); + +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h b/i386/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h new file mode 100644 index 0000000..cb114ba --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSBP2UserClientCommon.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOFIREWIRESBP2USERCLIENTCOMMON_H_ +#define _IOKIT_IOFIREWIRESBP2USERCLIENTCOMMON_H_ + +#define kIOFireWireSBP2LibConnection 12 + +enum IOFWSBP2UserClientCommandCodes { + kIOFWSBP2UserClientOpen, // kIOUCScalarIScalarO 0,0 + kIOFWSBP2UserClientClose, // kIOUCScalarIScalarO 0,0 + kIOFWSBP2UserClientCreateLogin, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseLogin, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitLogin, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitLogout, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetLoginFlags, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientGetMaxCommandBlockSize, // kIOUCScalarIScalarO 1,1 + kIOFWSBP2UserClientGetLoginID, // kIOUCScalarIScalarO 1,1 + kIOFWSBP2UserClientSetReconnectTime, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetMaxPayloadSize, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientCreateORB, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandFlags, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetMaxORBPayloadSize, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetCommandTimeout, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetCommandGeneration, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientSetToDummy, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandBuffersAsRanges, // kIOUCScalarIScalarO 6,0 + kIOFWSBP2UserClientReleaseCommandBuffers, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSetCommandBlock, // kIOUCScalarIScalarO 3,0 + kIOFWSBP2UserClientCreateMgmtORB, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientReleaseMgmtORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientSubmitMgmtORB, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientMgmtORBSetCommandFunction, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetManageeORB, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetManageeLogin, // kIOUCScalarIScalarO 2,0 + kIOFWSBP2UserClientMgmtORBSetResponseBuffer, // kIOUCScalarIScalarO 3,0 + kIOFWSBP2UserClientLSIWorkaroundSetCommandBuffersAsRanges, // kIOUCScalarIScalarO 6,0 + kIOFWSBP2UserClientMgmtORBLSIWorkaroundSyncBuffersForOutput, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientMgmtORBLSIWorkaroundSyncBuffersForInput, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientOpenWithSessionRef, // kIOUCScalarIScalarO 1,0 + kIOFWSBP2UserClientGetSessionRef, // kIOUCScalarIScalarO 0,1 + kIOFWSBP2UserClientRingDoorbell, // kIOUCScalarIScalarO 1, 0 + kIOFWSBP2UserClientEnableUnsolicitedStatus, // kIOUCScalarIScalarO 1, 0 + kIOFWSBP2UserClientSetBusyTimeoutRegisterValue, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetORBRefCon, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetPassword, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSetMessageCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetLoginCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetLogoutCallback, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetUnsolicitedStatusNotify, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetStatusNotify, // kIOUCScalarIScalarO 2, 0 + kIOFWSBP2UserClientSetMgmtORBCallback, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSubmitFetchAgentReset, // kIOUCScalarIScalarO 3, 0 + kIOFWSBP2UserClientSetFetchAgentWriteCompletion, // kIOUCScalarIScalaO 2, 0 + kIOFWSBP2UserClientNumCommands +}; + +#endif \ No newline at end of file diff --git a/i386/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h b/i386/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h new file mode 100644 index 0000000..53e6195 --- /dev/null +++ b/i386/include/IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h @@ -0,0 +1,449 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/*! + @header IOFireWireSerialBusProtocolTransport + Contains the class definition for IOFireWireSerialBusProtocolTransport. +*/ + + +#ifndef _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ +#define _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ + + +#include +#include +#include +#include +#include +#include +#include + +#include + +/*! + @class IOFireWireSerialBusProtocolTransport + @abstract SCSI Protocol Driver Family for FireWire SBP2 Devices. + @discussion IOFireWireSerialBusProtocolTransport contains all the bus specific support for FireWire + SBP2 compliant devices. To add vendor specific features or workarounds you will sub-class the appropriate + methods of this family. +*/ + +class IOFireWireSerialBusProtocolTransport : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOFireWireSerialBusProtocolTransport ) + +private: + + IOFireWireUnit * fUnit; + IOFireWireSBP2LUN * fSBPTarget; + IOFireWireSBP2Login * fLogin; + IOFireWireSBP2ORB * fORB; + IOFireWireSBP2ManagementORB * fLUNResetORB; + + // /!\ WARNING! NOT USED left behind for legacy binary reasons + IOSimpleLock * fQueueLock; + + UInt32 fLoginRetryCount; + bool fDeferRegisterService; + bool fNeedLogin; + + // /!\ WARNING! NOT USED left behind for legacy binary reasons + bool fPhysicallyConnected; + + static void + StatusNotifyStatic ( void * refCon, FWSBP2NotifyParamsPtr params ); + + static void + UnsolicitedStatusNotifyStatic ( void * refCon, + FWSBP2NotifyParamsPtr params ); + + static void + LunResetCompleteStatic ( void * refCon, + IOReturn status, + IOFireWireSBP2ManagementORB * orb ); + + static void + FetchAgentResetCompleteStatic ( void * refcon, + IOReturn status ); + + static IOReturn + ConnectToDeviceStatic ( OSObject * refCon, void *, void *, void *, void * ); + + virtual void + FetchAgentResetComplete ( IOReturn status ); + + static void LoginCompletionStatic ( void * refCon, FWSBP2LoginCompleteParams * params ); + + static void + LogoutCompletionStatic ( void * refCon, FWSBP2LogoutCompleteParams * params ); + + /*! + @function CoalesceSenseData + @abstract CoalesceSenseData convert a SBP-2 status block into a SPC-2 sense block. + @discussion CoalesceSenseData pulls the appropriate bits out of the SBP2 sense block + as defined in SBP-2 Annex B section B.2 and dynamically builds a sense data block as + defined in SPC-2 section 7.23.2. + */ + + SCSITaskStatus + CoalesceSenseData ( FWSBP2StatusBlock * sourceData, + UInt8 quadletCount, + SCSI_Sense_Data * targetData ); + + virtual void ConnectToDevice ( void ); + + virtual void DisconnectFromDevice ( void ); + + virtual bool IsDeviceCPUInDiskMode ( void ); + +protected: + + /*! + @function AllocateResources + @abstract Allocate Resources. + @discussion Called from start method to allocate needed resources. + */ + + virtual IOReturn AllocateResources ( void ); + + /*! + @function DeallocateResources + @abstract Deallocate Resources. + @discussion Called from cleanUp method to deallocate resources. + */ + + virtual void DeallocateResources ( void ); + + enum SBP2LoginState + { + kFirstTimeLoggingInState, + kLogginSucceededState, + kLogginFailedState + }; + + /*! + @typedef SBP2ClientOrbData + @param orb IOFireWireSBP2ORB for request. + @param scsiTask SCSITaskIdentifier of request. + @param serviceResponse SCSIServiceResponse of request. + @param taskStatus SCSITaskStatus of request. + @discussion This structure is stuffed into the refcon so we can associate which + IOFireWireSBP2ORB and SCSITaskIdentifier is completing. + */ + + typedef struct { + IOFireWireSBP2ORB * orb; + SCSITaskIdentifier scsiTask; + SCSIServiceResponse serviceResponse; + SCSITaskStatus taskStatus; + IOBufferMemoryDescriptor * quadletAlignedBuffer; + } SBP2ClientOrbData; + + static const UInt32 kDefaultBusyTimeoutValue = 0x0000000F; + static const UInt64 kMaxFireWireLUN = 0xFFFF; + static const UInt32 kMaxFireWirePayload = 4096; + static const UInt32 kMaxLoginRetryCount = 8; + static const UInt32 kMaxReconnectCount = 128; + static const UInt32 kCSRModelInfoKey = 0x17; + + UInt32 fReconnectCount; + bool fLoggedIn; + + // binary compatibility instance variable expansion + struct ExpansionData + { + IOCommandPool * fCommandPool; + IOCommandPool * fSubmitQueue; + SBP2LoginState fLoginState; + bool fLUNResetPathFlag; + int fLUNResetCount; + bool fAlwaysSetSenseData; + bool fAutonomousSpinDownWorkAround; + }; + + ExpansionData * reserved; + + bool fObjectIsOpen; + + /*! + @function CommandORBAccessor + @abstract accessor function for fORB. + @discussion xxx. + */ + + IOFireWireSBP2ORB * CommandORBAccessor ( void ); + + /*! + @function SBP2LoginAccessor + @abstract accessor function for fLogin. + @discussion xxx. + */ + + IOFireWireSBP2Login * SBP2LoginAccessor ( void ); + + virtual IOReturn + message ( UInt32 type, IOService * provider, void * argument = 0 ); + + /*! + @function SendSCSICommand + @abstract Prepare and send a SCSI command to the device. + @discussion The incoming SCSITaskIdentifier gets turned into a IOFireWireSBP2ORB + and is submitted to the SBP2 layer. See IOSCSIProtocolServices.h for more details + regarding SendSCSICommand. Also see IOFireWireSBP2Lib.h for details regarding the + IOFireWireSBP2ORB structure and the submitORB method. + @result If the command was sent to the device and is pending completion, the + subclass should return true and return back the kSCSIServiceResponse_Request_In_Process response. + If the command completes immediately with an error, the subclass will return true + and return back the appropriate status. If the subclass is currently processing all the + commands it can, the subclass will return false and the command will be resent next time + CommandCompleted is called. + */ + + virtual bool + SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + /*! + @function SetCommandBuffers + @abstract Method to set orb's buffers. + @discussion This method was added so that subclasses can override and massage buffers as + needed. The default simply calls setCommandBuffers. See IOFireWireSBP2Lib.h for details + regarding the setCommandBuffers method. + @result xxx. + */ + + virtual IOReturn + SetCommandBuffers ( IOFireWireSBP2ORB * orb, SCSITaskIdentifier request ); + + /*! + @function CompleteSCSITask + @abstract This qualifies and sets appropriate data then calls CommandCompleted. + @discussion See IOSCSIProtocolServices.h for more details + regarding CommandCompleted. + */ + + virtual void + CompleteSCSITask ( IOFireWireSBP2ORB * orb ); + + /*! + @function AbortSCSICommand + @abstract This method is intended to abort an in progress SCSI Task. + @discussion Currently not implemented in super class. This is a stub method for adding + the abort command in the near future. + @result See SCSITask.h for SCSIServiceResponse codes. + */ + + virtual SCSIServiceResponse + AbortSCSICommand ( SCSITaskIdentifier request ); + + /*! + @function StatusNotify + @abstract This is our handler for status. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2NotifyParams + structure that is passed in to the completion.. + */ + + virtual void + StatusNotify ( FWSBP2NotifyParams * params ); + + /*! + @function SetValidAutoSenseData + @abstract Set the auto sense data that was returned for a given SCSI Task. + @discussion SetValidAutoSenseData is called to qualify sense data that is copied to the + client via the SetAutoSenseData method. See IOSCSIProtocolServices.h for more details + regarding SetAutoSenseData. + */ + + void + SetValidAutoSenseData ( SBP2ClientOrbData * clientData, + FWSBP2StatusBlock * statusBlock, + SCSI_Sense_Data * targetData ); + + /*! + @function UnsolicitedStatusNotify + @abstract This is our handler for unsolicited status. + @discussion After we have parsed and handled the unsolicited status we call + enableUnsolicitedStatus. See IOFireWireSBP2Lib.h for details regarding the + enableUnsolicitedStatus method. + */ + + virtual void + UnsolicitedStatusNotify ( FWSBP2NotifyParamsPtr params ); + + /*! + @function LoginCompletion + @abstract Completion routine for login complete. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams + structure that is passed in to the completion. + */ + + virtual void + LoginCompletion ( FWSBP2LoginCompleteParams * params ); + + /*! + @function LogoutCompletion + @abstract Completion routine for logout complete. + @discussion See IOFireWireSBP2Lib.h for details regarding the FWSBP2LogoutCompleteParams + structure that is passed in to the completion. + */ + + virtual void + LogoutCompletion ( FWSBP2LogoutCompleteParams * params ); + + /*! + @function IsProtocolServiceSupported + @abstract Determine is specified feature is supported by the protocol layer. + @discussion If the service has a value that must be returned, it will be returned in the + serviceValue output parameter. See IOSCSIProtocolServices.h for more details regarding + IsProtocolServiceSupported. + @result Will return true if the specified feature is supported by the protocol layer. + */ + + virtual bool + IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + /*! + @function HandleProtocolServiceFeature + @abstract Handle specified feature supported by the protocol layer. + @discussion See IOSCSIProtocolServices.h for more details regarding HandleProtocolServiceFeature. + @result Will return true if the specified feature is supported by the protocol layer. + */ + + virtual bool + HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + /*! + @function LunResetComplete + @abstract Callback to submit Fetch Agent Reset. + @discussion See IOFireWireSBP2Lib.h for details regarding the submitFetchAgentReset + method. + */ + + virtual void + LunResetComplete ( IOReturn status, IOFireWireSBP2ManagementORB * orb ); + +public: + + /*! + @function init + @abstract See IOService for discussion. + @discussion Setup and prime class into known state. + */ + + bool init ( OSDictionary * propTable ); + + /*! + @function start + @discussion See IOService for discussion. + @result Return true if the start was successful, false otherwise ( which will + cause the instance to be detached and usually freed ). + */ + + virtual bool start ( IOService * provider ); + + /*! + @function cleanUp + @abstract cleanUp is called to tear down IOFireWireSerialBusProtocolTransport. + @discussion cleanUp is called when we receive a kIOFWMessageServiceIsRequestingClose + message or if we fail our initialization. + */ + + virtual void cleanUp ( void ); + + /*! + @function finalize + @abstract See IOService for discussion. + @result Returns true. + */ + + virtual bool finalize ( IOOptionBits options ); + + /*! + @function free + @discussion See IOService for discussion. + @result none. + */ + + virtual void free ( void ); + +protected: + + virtual IOReturn login ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 1 ); + + virtual IOReturn submitLogin ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 2 ); + + virtual void loginLost ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 3 ); + + void loginSuspended ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 4 ); + + virtual void loginResumed ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 5 ); + + static IOReturn CriticalOrbSubmissionStatic ( + OSObject * refCon, + void * val1, + void * val2, + void * val3, + void * val4 ); + + /*! + @function CriticalOrbSubmission + @abstract xxx. + @discussion xxx. + @result none. + */ + + void + CriticalOrbSubmission ( + IOFireWireSBP2ORB * orb, + SCSITaskIdentifier request ); + + virtual void submitOrbFromQueue ( void ); + OSMetaClassDeclareReservedUsed ( IOFireWireSerialBusProtocolTransport, 6 ); + +private: + + // binary compatibility reserved method space + + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 7 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 8 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 9 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 10 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 11 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 12 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 13 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 14 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 15 ); + OSMetaClassDeclareReservedUnused ( IOFireWireSerialBusProtocolTransport, 16 ); + +}; + +#endif /* _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_H_ */ \ No newline at end of file diff --git a/i386/include/IOKit/scsi/.svn/all-wcprops b/i386/include/IOKit/scsi/.svn/all-wcprops new file mode 100644 index 0000000..6a704ef --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/all-wcprops @@ -0,0 +1,155 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi +END +IOSCSIPeripheralDeviceNub.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h +END +IOSCSIProtocolInterface.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIProtocolInterface.h +END +IOSCSIPeripheralDeviceType05.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h +END +SCSICommandDefinitions.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICommandDefinitions.h +END +IOSCSIPeripheralDeviceType07.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h +END +IOSCSIPrimaryCommandsDevice.h +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h +END +SCSICmds_REPORT_LUNS_Definitions.h +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h +END +SCSICommandOperationCodes.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICommandOperationCodes.h +END +IOSCSIReducedBlockCommandsDevice.h +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h +END +IOSCSIMultimediaCommandsDevice.h +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h +END +IOSCSIBlockCommandsDevice.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h +END +SCSIPort.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSIPort.h +END +SCSICmds_MODE_Definitions.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICmds_MODE_Definitions.h +END +IODVDServices.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IODVDServices.h +END +SCSICmds_READ_CAPACITY_Definitions.h +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h +END +IOBlockStorageServices.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOBlockStorageServices.h +END +IOSCSIPeripheralDeviceType0E.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h +END +SCSICmds_REQUEST_SENSE_Defs.h +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h +END +IOSCSIProtocolServices.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIProtocolServices.h +END +IOBDServices.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOBDServices.h +END +IOReducedBlockServices.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOReducedBlockServices.h +END +SCSICmds_INQUIRY_Definitions.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h +END +SCSITask.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/SCSITask.h +END +IOCompactDiscServices.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOCompactDiscServices.h +END +IOSCSIPeripheralDeviceType00.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h +END diff --git a/i386/include/IOKit/scsi/.svn/entries b/i386/include/IOKit/scsi/.svn/entries new file mode 100644 index 0000000..1281e2a --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/entries @@ -0,0 +1,881 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/scsi +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOSCSIPeripheralDeviceNub.h +file + + + + +2013-08-27T23:54:31.000000Z +41004b82709f5c563fa2c10264853dd1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8628 + +IOSCSIProtocolInterface.h +file + + + + +2013-08-27T23:54:31.000000Z +3dc4c00e753dcf3fd49d0cfdac02faef +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +35912 + +IOSCSIPeripheralDeviceType05.h +file + + + + +2013-08-27T23:54:31.000000Z +7943859208badb3751dbf4ffea748f66 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2852 + +SCSICommandDefinitions.h +file + + + + +2013-08-27T23:54:31.000000Z +6d33c5041ea6862346397f9e30a91dbd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12845 + +IOSCSIPeripheralDeviceType07.h +file + + + + +2013-08-27T23:54:31.000000Z +0e53abdb3759ef029098176c7b372012 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2792 + +IOSCSIPrimaryCommandsDevice.h +file + + + + +2013-08-27T23:54:31.000000Z +fbc3c7570862069f2faeb236d5b2ff80 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +28729 + +SCSICmds_REPORT_LUNS_Definitions.h +file + + + + +2013-08-27T23:54:31.000000Z +cbb458517cee16286d9b71b82ff8ca70 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4122 + +SCSICommandOperationCodes.h +file + + + + +2013-08-27T23:54:31.000000Z +f9c55b591e06c0fc73a8f0c46850d142 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +51055 + +IOSCSIReducedBlockCommandsDevice.h +file + + + + +2013-08-27T23:54:31.000000Z +7e8c5ee237fa3d53e59c8742aa21ec29 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15569 + +spi +dir + +IOSCSIMultimediaCommandsDevice.h +file + + + + +2013-08-27T23:54:31.000000Z +c4523e2a816d92b1a21bab51e554f3c3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +37497 + +IOSCSIBlockCommandsDevice.h +file + + + + +2013-08-27T23:54:31.000000Z +9524329c076b5320b814e3c7e4c8af9a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +38443 + +SCSIPort.h +file + + + + +2013-08-27T23:54:31.000000Z +3023213196d2d300e6427aed35b87293 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2037 + +SCSICmds_MODE_Definitions.h +file + + + + +2013-08-27T23:54:31.000000Z +6bba8330f0f798e8a696d1b9aa84dcfc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14817 + +IODVDServices.h +file + + + + +2013-08-27T23:54:31.000000Z +81e92ebecd5deed264767c5a704c1f31 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8553 + +IOBlockStorageServices.h +file + + + + +2013-08-27T23:54:31.000000Z +f8ceba9851285be5ab564838e387d3b2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5384 + +SCSICmds_READ_CAPACITY_Definitions.h +file + + + + +2013-08-27T23:54:31.000000Z +b023866fc55360a68903eeb70772e116 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3642 + +IOSCSIPeripheralDeviceType0E.h +file + + + + +2013-08-27T23:54:31.000000Z +b6fa75f60eb13eeb00333a44a40eddff +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2909 + +SCSICmds_REQUEST_SENSE_Defs.h +file + + + + +2013-08-27T23:54:31.000000Z +2195af654461960fd9c521835ae05059 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7152 + +IOSCSIProtocolServices.h +file + + + + +2013-08-27T23:54:31.000000Z +8a1ac65d04de801e378c58362ff162bc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15109 + +IOBDServices.h +file + + + + +2013-08-27T23:54:31.000000Z +75fa500daf479f56138fa835c1f7647e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8045 + +IOReducedBlockServices.h +file + + + + +2013-08-27T23:54:31.000000Z +3dc85f77ebd728e36274c154c0640593 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5077 + +SCSICmds_INQUIRY_Definitions.h +file + + + + +2013-08-27T23:54:31.000000Z +ca84e5d42cea279808d672eb093d3594 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +29732 + +SCSITask.h +file + + + + +2013-08-27T23:54:31.000000Z +b9a85db4a5adf25cab94ad27fdb533b5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14455 + +IOCompactDiscServices.h +file + + + + +2013-08-27T23:54:31.000000Z +c61102d918a2bc4d6211ecc704a97c55 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7947 + +IOSCSIPeripheralDeviceType00.h +file + + + + +2013-08-27T23:54:31.000000Z +81de59f70dd7471492d42f58c176a6f0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3475 + diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOBDServices.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOBDServices.h.svn-base new file mode 100644 index 0000000..70482d7 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOBDServices.h.svn-base @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_BD_SERVICES_H_ +#define _IOKIT_IO_BD_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +class IOMemoryDescriptor; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOBDServices : public IOBDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOBDServices ) + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ); + + // Reserve space for future expansion. + struct IOBDServicesExpansionData { }; + IOBDServicesExpansionData * fIOBDServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ); + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn readMCN ( CDMCN mcn); + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ); + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ); + + /* DVD Specific */ + virtual UInt32 getMediaType ( void ); + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn sendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn readDVDStructure ( IOMemoryDescriptor * buffer, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + /* BD Specific */ + virtual IOReturn readDiscStructure ( IOMemoryDescriptor * buffer, + UInt8 structureFormat, + UInt32 logicalBlockAddress, + UInt8 layer, + UInt8 agid, + UInt8 mediaType ); + + /* 10.6.0 */ + virtual IOReturn requestIdle ( void ); + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + virtual IOReturn setProperties ( OSObject * properties ); + + /* User Client Specific */ + virtual bool start ( IOService * provider ); + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ); + virtual void handleClose ( IOService * client, IOOptionBits options ); + virtual bool handleIsOpen ( const IOService * client ) const; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + + /* Added with 10.5 */ + virtual IOReturn splitTrack ( UInt32 address ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOBDServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_BD_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOBlockStorageServices.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOBlockStorageServices.h.svn-base new file mode 100644 index 0000000..d62a02b --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOBlockStorageServices.h.svn-base @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ +#define _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOBlockStorageServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOBlockStorageServices ) + +private: + + bool fMediaChanged; /* DEPRECATED */ + bool fMediaPresent; + +protected: + + IOSCSIBlockCommandsDevice * fProvider; + + UInt64 fMaxReadBlocks; + UInt64 fMaxWriteBlocks; + + virtual bool attach ( IOService * provider ); + virtual void detach ( IOService * provider ); + virtual IOReturn newUserClient ( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ); + + // Reserve space for future expansion. + struct IOBlockStorageServicesExpansionData { }; + IOBlockStorageServicesExpansionData * fIOBlockStorageServicesReserved; + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOCompactDiscServices.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOCompactDiscServices.h.svn-base new file mode 100644 index 0000000..a9d4a31 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOCompactDiscServices.h.svn-base @@ -0,0 +1,230 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_COMPACT_DISC_SERVICES_H_ +#define _IOKIT_IO_COMPACT_DISC_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +class IOMemoryDescriptor; + +// Use this switch to turn off the data cache. +#define _USE_DATA_CACHING_ 1 + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOCompactDiscServices : public IOCDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOCompactDiscServices ) + +#if (_USE_DATA_CACHING_) + // Data Cache members + bool fUseDataCache; // Indicates if cache should be used. This + // will be set to false if all the necessary support + // for the data cache could not be allocated or + // initialized. + UInt8 * fDataCacheStorage; // Storage space for the cache + UInt32 fDataCacheStartBlock; // Starting block of the data in the cache. + UInt32 fDataCacheBlockCount; // Number of contiguous blocks in the cache + // starting with fDataCacheStartBlock. A value of + // zero in this member indicates that all data + // in the cache is invalid. + + IOSimpleLock * fDataCacheLock; // This is the lock for preventing multiple access + // while manipulating the data cache. +#endif + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ); + + // Reserve space for future expansion. + struct IOCompactDiscServicesExpansionData { }; + IOCompactDiscServicesExpansionData * fIOCompactDiscServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ); + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn readMCN ( CDMCN mcn); + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ); + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual UInt32 getMediaType ( void ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ); + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + virtual IOReturn setProperties ( OSObject * properties ); + + /* User Client Specific */ + virtual bool start ( IOService * provider ); + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ); + virtual void handleClose ( IOService * client, IOOptionBits options ); + virtual bool handleIsOpen ( const IOService * client ) const; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMPACT_DISC_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IODVDServices.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IODVDServices.h.svn-base new file mode 100644 index 0000000..8dccb17 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IODVDServices.h.svn-base @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_DVD_SERVICES_H_ +#define _IOKIT_IO_DVD_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include + +// Generic IOKit storage related headers +#include +#include + +// SCSI Architecture Model Family includes +#include + +class IOMemoryDescriptor; + +// Use this switch to turn off the data cache. +#define _DVD_USE_DATA_CACHING_ 1 + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IODVDServices : public IODVDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IODVDServices ) + +#if (_DVD_USE_DATA_CACHING_) + // Data Cache members + bool fUseDataCache; // Indicates if cache should be used. This + // will be set to false if all the necessary support + // for the data cache could not be allocated or + // initialized. + UInt8 * fDataCacheStorage; // Storage space for the cache + UInt32 fDataCacheStartBlock; // Starting block of the data in the cache. + UInt32 fDataCacheBlockCount; // Number of contiguous blocks in the cache + // starting with fDataCacheStartBlock. A value of + // zero in this member indicates that all data + // in the cache is invalid. + + IOSimpleLock * fDataCacheLock; // This is the lock for preventing multiple access + // while manipulating the data cache. +#endif + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ); + + // Reserve space for future expansion. + struct IODVDServicesExpansionData { }; + IODVDServicesExpansionData * fIODVDServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ); + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn readMCN ( CDMCN mcn); + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ); + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ); + + /* DVD Specific */ + virtual UInt32 getMediaType ( void ); + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn sendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn readDVDStructure ( IOMemoryDescriptor * buffer, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + /* 10.6.0 */ + virtual IOReturn requestIdle ( void ); + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + virtual IOReturn setProperties ( OSObject * properties ); + + /* User Client Specific */ + virtual bool start ( IOService * provider ); + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ); + virtual void handleClose ( IOService * client, IOOptionBits options ); + virtual bool handleIsOpen ( const IOService * client ) const; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IODVDServices, 1 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 2 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 3 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 4 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 5 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 6 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 7 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_DVD_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOReducedBlockServices.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOReducedBlockServices.h.svn-base new file mode 100644 index 0000000..87ad8ed --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOReducedBlockServices.h.svn-base @@ -0,0 +1,147 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ +#define _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// Generic IOKit related headers +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOReducedBlockServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOReducedBlockServices ) + + +protected: + // Reserve space for future expansion. + struct IOReducedBlockServicesExpansionData { }; + IOReducedBlockServicesExpansionData * fIOReducedBlockServicesReserved; + + IOSCSIPeripheralDeviceType0E * fProvider; + + virtual bool attach ( IOService * provider ); + virtual void detach ( IOService * provider ); + + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIBlockCommandsDevice.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIBlockCommandsDevice.h.svn-base new file mode 100644 index 0000000..2cb4a6d --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIBlockCommandsDevice.h.svn-base @@ -0,0 +1,1146 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// SBC power states as defined in T10:996D SCSI Block Commands - 3 (SBC-3) +// Revision 8c, November 13, 1997, pages 10-11. +enum +{ + kSBCPowerStateSystemSleep = 0, + kSBCPowerStateSleep = 1, + kSBCPowerStateStandby = 2, + kSBCPowerStateIdle = 3, + kSBCPowerStateActive = 4, + kSBCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include +#include +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + + +// Forward declaration for the SCSIBlockCommands that is used internally by the +// IOSCSIBlockCommandsDevice class. +class SCSIBlockCommands; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIBlockCommandsDevice ) + +private: + + +#ifndef __LP64__ + + SCSIBlockCommands * fSCSIBlockCommandObject; + SCSIBlockCommands * GetSCSIBlockCommandObject ( void ); + +#endif /* !__LP64__ */ + + IOReturn GetWriteCacheState ( IOMemoryDescriptor * buffer, + UInt8 modePageControlValue ); + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIBlockCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fWriteCacheEnabled; + bool fDeviceIsShared; + UInt64 fMediumBlockCount64; + bool fDeviceHasSATTranslation; + bool fProtocolSpecificPowerControl; + bool fRequiresEjectWithStartStopUnit; + }; + IOSCSIBlockCommandsDeviceExpansionData * fIOSCSIBlockCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIBlockCommandsDeviceReserved->fPowerDownNotifier + #define fWriteCacheEnabled fIOSCSIBlockCommandsDeviceReserved->fWriteCacheEnabled + + // The fDeviceIsShared is used to indicate whether this device exists on a Physical + // Interconnect that allows multiple initiators to access it. This is used mainly + // by the power management code to not send power state related START_STOP_UNIT + // commands to the device. + // The fDeviceIsShared value is also used to prevent power state commands from being + // sent to manual eject device since these devices behave better when allowed to + // manage their own power. + #define fDeviceIsShared fIOSCSIBlockCommandsDeviceReserved->fDeviceIsShared + + // The fMediumBlockCount64 provides support for 64 bit LBAs and + // replaces fMediumBlockCount which only supports 32 bits. + // This value should not be directly accessed and instead the member routine + // ReportMediumTotalBlockCount() should be used to retrieve it and the member routine + // SetMediumCharacteristics() should be used to set it. + #define fMediumBlockCount64 fIOSCSIBlockCommandsDeviceReserved->fMediumBlockCount64 + + #define fDeviceHasSATTranslation fIOSCSIBlockCommandsDeviceReserved->fDeviceHasSATTranslation + + // Device support protocol specific power off + #define fProtocolSpecificPowerControl fIOSCSIBlockCommandsDeviceReserved->fProtocolSpecificPowerControl + + // Device requires START_STOP_UNIT for ejects, regardless if PREVENT_ALLOW_MEIDUMREMOVAL + // failed. + #define fRequiresEjectWithStartStopUnit fIOSCSIBlockCommandsDeviceReserved->fRequiresEjectWithStartStopUnit + +private: + /* OBSOLETE. Use IOSCSIPrimaryCommandsDevice::Get/SetANSIVersion */ + UInt8 fANSIVersion; + +protected: + // ---- Device Characteristics ---- + bool fMediaIsRemovable; + + // ---- Medium Characteristics ---- + bool fMediumPresent; + +private: + // The byte count of each physical block on the medium. + // This value should not be directly accessed and instead the member routine + // ReportMediumBlockSize() should be used to retrieve it and the member routine + // SetMediumCharacteristics() should be used to set it. + UInt32 fMediumBlockSize; + + // The total number of blocks of fMediumBlockSize on the medium. + // OBSOLETE. Use fMediumBlockCount64 instead which allows for support of + // devices that have 33 through 64 bit LBA values. + UInt32 fMediumBlockCount; + +protected: + // Whether the installed medium is protected from writes + bool fMediumIsWriteProtected; + + // Whether user removal of medium has been prevented + bool fMediumRemovalPrevented; + + // Indicates whether this is a known manual eject device + bool fKnownManualEject; + + // Polling thread variables + thread_call_t fPollingThread; + UInt32 fPollingMode; + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + // ---- Methods for controlling the current state of device support ---- + virtual bool InitializeDeviceSupport ( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport ( void ); + virtual void ResumeDeviceSupport ( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport ( void ); + + virtual void free ( void ); + +#ifndef __LP64__ + + // This method will retrieve the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the subclasses base command set object. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + + virtual bool CreateCommandSetObjects ( void ); + virtual void FreeCommandSetObjects ( void ); + +#endif /* !__LP64__ */ + + virtual bool ClearNotReadyStatus ( void ); + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + + // ---- Methods used for controlling the polling thread ---- + virtual void ProcessPoll ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + + // Main and support methods for polling for new Media + virtual void PollForNewMedia ( void ); + virtual bool DetermineMediaPresence ( void ); + virtual bool PreventMediumRemoval ( void ); + virtual bool DetermineMediumCapacity ( + UInt64 * blockSize, + UInt64 * blockCount ); + virtual bool DetermineMediumWriteProtectState ( void ); + + // Main and support methods for polling for Media removal + virtual void PollForMediaRemoval ( void ); + + // ---- Methods used for handling medium characteristics ---- + + // OBSOLETE - Use the version compatible with 64 bit LBAs instead. + virtual void SetMediumCharacteristics ( + UInt32 blockSize, + UInt32 blockCount ); + + void SetMediumCharacteristics ( + UInt64 blockSize, + UInt64 blockCount ); + + virtual void ResetMediumCharacteristics ( void ); + + virtual IOReturn IssueRead ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + virtual IOReturn IssueWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ); + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ); + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // The TicklePowerManager method is called to tell the power manager that + // the device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ); + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the + // command gate and can change member variables safely without + // multi-threading issues. It's main purpose is to call the superclass' + // HandleCheckPowerState ( UInt32 maxPowerState ) with the max power state + // the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The VerifyMediumPresence method is called to see if the medium which we + // anticipated being there is still there. + virtual bool VerifyMediumPresence ( void ); + +public: + + static void sProcessPoll ( void * pdtDriver, void * refCon ); + + // ---- Methods for controlling the device ---- + virtual IOReturn SyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize ); + + virtual IOReturn AsyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + void * clientData ); + + IOReturn GetWriteCacheState ( bool * enabled ); + IOReturn SetWriteCacheState ( bool enabled ); + void DetermineMediumGeometry ( void ); + + // ---- Methods for controlling medium state ---- + virtual IOReturn EjectTheMedium ( void ); + virtual IOReturn LockUnlockMedium ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + + // ---- Methods for controlling media format ---- + virtual IOReturn FormatMedium ( + UInt64 blockCount, + UInt64 blockSize ); + virtual UInt32 GetFormatCapacities ( + UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + // ---- Query methods to report device characteristics ---- + + // Report the maximum number of blocks that the device can handle per + // read or write. A value of 0 (zero) indicates there is no limit aside + // from the size of the method's return parameter. + virtual UInt64 ReportDeviceMaxBlocksReadTransfer ( void ); + virtual UInt64 ReportDeviceMaxBlocksWriteTransfer ( void ); + + // Report whether the device supports removal of the media. + virtual bool ReportDeviceMediaRemovability ( void ); + + // ---- Query methods to report installed medium characteristics ---- + virtual UInt64 ReportMediumBlockSize ( void ); + virtual UInt64 ReportMediumTotalBlockCount ( void ); + virtual bool ReportMediumWriteProtection ( void ); + + +protected: + + +#ifndef __LP64__ + + // Command methods to access all commands available to SBC based devices. + virtual bool ERASE_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit ERA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool ERASE_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit ERA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount defectListSize, + SCSICmdField1Bit FMTDATA, + SCSICmdField1Bit CMPLST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField1Byte VENDOR_SPECIFIC, + SCSICmdField2Byte INTERLEAVE, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 Section 5.41 + bool FORMAT_UNIT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount defectListSize, + SCSICmdField1Bit FMTPINFO, + SCSICmdField1Bit RTO_REQ, + SCSICmdField1Bit LONGLIST, + SCSICmdField1Bit FMTDATA, + SCSICmdField1Bit CMPLST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField1Byte VENDOR_SPECIFIC, + SCSICmdField1Byte CONTROL ); + + virtual bool LOCK_UNLOCK_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit LOCK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.5 + bool LOCK_UNLOCK_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit LOCK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + bool LOCK_UNLOCK_CACHE_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit LOCK, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + virtual bool MEDIUM_SCAN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit WBS, + SCSICmdField1Bit ASA, + SCSICmdField1Bit PSD, + SCSICmdField1Bit PRA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PREFETCH ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.7 + bool PREFETCH ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool PREFETCH_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField21Bit LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.10 + bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.11 + bool READ_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + bool READ_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + bool READ_CAPACITY_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool READ_DEFECT_DATA_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PLIST, + SCSICmdField1Bit GLIST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_DEFECT_DATA_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PLIST, + SCSICmdField1Bit GLIST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_GENERATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_LONG ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CORRCT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte BYTE_TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool READ_LONG_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte BYTE_TRANSFER_LENGTH, + SCSICmdField1Bit CORRCT, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_UPDATED_BLOCK_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit LATEST, + SCSICmdField15Bit GENERATION_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool REASSIGN_BLOCKS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.20 + bool REASSIGN_BLOCKS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit LONGLBA, + SCSICmdField1Bit LONGLIST, + SCSICmdField1Byte CONTROL ); + + virtual bool REBUILD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit INTDATA, + SCSICmdField2Bit PORT_CONTROL, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte REBUILD_LENGTH, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REGENERATE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit INTDATA, + SCSICmdField2Bit PORT_CONTROL, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte REBUILD_LENGTH, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REZERO_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + + virtual bool SEARCH_DATA_EQUAL_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit INVERT, + SCSICmdField1Bit SPNDAT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS_TO_SEARCH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEARCH_DATA_HIGH_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit INVERT, + SCSICmdField1Bit SPNDAT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS_TO_SEARCH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEARCH_DATA_LOW_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit INVERT, + SCSICmdField1Bit SPNDAT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS_TO_SEARCH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEEK_6 ( + SCSITaskIdentifier request, + SCSICmdField21Bit LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool SEEK_10 ( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_LIMITS_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RDINH, + SCSICmdField1Bit WRINH, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_LIMITS_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RDINH, + SCSICmdField1Bit WRINH, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START, + SCSICmdField1Byte CONTROL ); + + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.22 + bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit SYNC_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + bool SYNCRONIZE_CACHE_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit SYNC_NV, + SCSICmdField1Bit IMMED, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool UPDATE_BLOCK ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool VERIFY_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BLKVFY, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.24 + bool VERIFY_10 ( + SCSITaskIdentifier request, + SCSICmdField3Bit VRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool VERIFY_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BLKVFY, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.25 + bool VERIFY_12 ( + SCSITaskIdentifier request, + SCSICmdField3Bit VRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField4Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool VERIFY_16 ( + SCSITaskIdentifier request, + SCSICmdField3Bit VRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte VERIFICATION_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField2Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.29 + bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.30 + bool WRITE_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool WRITE_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit EBP, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.33 + bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_AND_VERIFY_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit EBP, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.34 + bool WRITE_AND_VERIFY_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + bool WRITE_AND_VERIFY_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + + virtual bool WRITE_LONG ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool WRITE_LONG_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Bit CORRCT, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_SAME ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PBDATA, + SCSICmdField1Bit LBDATA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.39 + bool WRITE_SAME ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit PBDATA, + SCSICmdField1Bit LBDATA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool WRITE_SAME_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit PBDATA, + SCSICmdField1Bit LBDATA, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool XDREAD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.42 + bool XDREAD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit XORPINFO, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool XDWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.43 + bool XDWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool XDWRITE_EXTENDED ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit TABLE_ADDRESS, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField2Bit PORT_CONTROL, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte SECONDARY_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte SECONDARY_ADDRESS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.46 + bool XDWRITEREAD_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField1Bit FUA_NV, + SCSICmdField1Bit XORPINFO, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool XPWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.48 + bool XPWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField1Bit XORPINFO, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 1 ); + +public: + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 2 ); + +protected: + + virtual void SetMediumIcon ( void ); + + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 3 ); + +protected: + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + + /* Added with 10.6.0 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 4 ); + +public: + + virtual IOReturn AsyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + IOStorageAttributes * attributes, + void * clientData ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIMultimediaCommandsDevice.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIMultimediaCommandsDevice.h.svn-base new file mode 100644 index 0000000..f812a39 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIMultimediaCommandsDevice.h.svn-base @@ -0,0 +1,1057 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ + +#if KERNEL +#include +#else +#include +#endif + +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +// Message constants +#define kIOMessageTrayStateChange 0x69000035 +#define kIOMessageTrayStateHasChanged kIOMessageTrayStateChange // DEPRECATED, use kIOMessageTrayStateChange instead + +// Message values for kIOMessageTrayStateChange +enum +{ + kMessageTrayStateChangeRequestAccepted = 0, + kMessageTrayStateChangeRequestRejected = 1 +}; + +#define kIOMessageMediaAccessChange 0x69000036 + +// Message values for kIOMessageMediaAccessChange +enum +{ + kMessageDeterminingMediaPresence = 0, + kMessageFoundMedia = 1, + kMessageMediaTypeDetermined = 2 +}; + +// IOKit property keys and constants +#define kIOPropertySupportedCDFeatures kIOPropertySupportedCDFeaturesKey +#define kIOPropertySupportedDVDFeatures kIOPropertySupportedDVDFeaturesKey +#define kIOPropertySupportedBDFeatures kIOPropertySupportedBDFeaturesKey +#define kIOPropertyLowPowerPolling "Low Power Polling" + +typedef UInt32 CDFeatures; +enum +{ + kCDFeaturesAnalogAudioBit = 0, // Analog Audio playback + kCDFeaturesReadStructuresBit = 1, // CD-ROM + kCDFeaturesWriteOnceBit = 2, // CD-R + kCDFeaturesReWriteableBit = 3, // CD-R/W + kCDFeaturesCDDAStreamAccurateBit = 4, // CD-DA stream accurate + kCDFeaturesPacketWriteBit = 5, // Packet Writing + kCDFeaturesTAOWriteBit = 6, // CD Track At Once + kCDFeaturesSAOWriteBit = 7, // CD Mastering - Session At Once + kCDFeaturesRawWriteBit = 8, // CD Mastering - Raw + kCDFeaturesTestWriteBit = 9, // CD Mastering/TAO - Test Write + kCDFeaturesBUFWriteBit = 10 // CD Mastering/TAO - Buffer Underrun Free +}; + +enum +{ + kCDFeaturesAnalogAudioMask = (1 << kCDFeaturesAnalogAudioBit), + kCDFeaturesReadStructuresMask = (1 << kCDFeaturesReadStructuresBit), + kCDFeaturesWriteOnceMask = (1 << kCDFeaturesWriteOnceBit), + kCDFeaturesReWriteableMask = (1 << kCDFeaturesReWriteableBit), + kCDFeaturesCDDAStreamAccurateMask = (1 << kCDFeaturesCDDAStreamAccurateBit), + kCDFeaturesPacketWriteMask = (1 << kCDFeaturesPacketWriteBit), + kCDFeaturesTAOWriteMask = (1 << kCDFeaturesTAOWriteBit), + kCDFeaturesSAOWriteMask = (1 << kCDFeaturesSAOWriteBit), + kCDFeaturesRawWriteMask = (1 << kCDFeaturesRawWriteBit), + kCDFeaturesTestWriteMask = (1 << kCDFeaturesTestWriteBit), + kCDFeaturesBUFWriteMask = (1 << kCDFeaturesBUFWriteBit) +}; + +typedef UInt32 DVDFeatures; +enum +{ + kDVDFeaturesCSSBit = 0, // DVD-CSS + kDVDFeaturesReadStructuresBit = 1, // DVD-ROM + kDVDFeaturesWriteOnceBit = 2, // DVD-R + kDVDFeaturesRandomWriteableBit = 3, // DVD-RAM + kDVDFeaturesReWriteableBit = 4, // DVD-RW + kDVDFeaturesTestWriteBit = 5, // DVD-R Write - Test Write + kDVDFeaturesBUFWriteBit = 6, // DVD-R Write - Buffer Underrun Free + kDVDFeaturesPlusRBit = 7, // DVD+R + kDVDFeaturesPlusRWBit = 8, // DVD+RW (implies backgound format support) + kDVDFeaturesHDReadBit = 9, // HD DVD-ROM + kDVDFeaturesHDRBit = 10, // HD DVD-R + kDVDFeaturesHDRAMBit = 11, // HD DVD-RAM + kDVDFeaturesHDRWBit = 12 // HD DVD-RW +}; + +enum +{ + kDVDFeaturesCSSMask = (1 << kDVDFeaturesCSSBit), + kDVDFeaturesReadStructuresMask = (1 << kDVDFeaturesReadStructuresBit), + kDVDFeaturesWriteOnceMask = (1 << kDVDFeaturesWriteOnceBit), + kDVDFeaturesRandomWriteableMask = (1 << kDVDFeaturesRandomWriteableBit), + kDVDFeaturesReWriteableMask = (1 << kDVDFeaturesReWriteableBit), + kDVDFeaturesTestWriteMask = (1 << kDVDFeaturesTestWriteBit), + kDVDFeaturesBUFWriteMask = (1 << kDVDFeaturesBUFWriteBit), + kDVDFeaturesPlusRMask = (1 << kDVDFeaturesPlusRBit), + kDVDFeaturesPlusRWMask = (1 << kDVDFeaturesPlusRWBit), + kDVDFeaturesHDReadMask = (1 << kDVDFeaturesHDReadBit), + kDVDFeaturesHDRMask = (1 << kDVDFeaturesHDRBit), + kDVDFeaturesHDRAMMask = (1 << kDVDFeaturesHDRAMBit), + kDVDFeaturesHDRWMask = (1 << kDVDFeaturesHDRWBit) +}; + +typedef UInt32 BDFeatures; +enum +{ + kBDFeaturesReadBit = 0, // BD-ROM + kBDFeaturesWriteBit = 1 // BD-R / BD-RE +}; + +enum +{ + kBDFeaturesReadMask = (1 << kBDFeaturesReadBit), + kBDFeaturesWriteMask = (1 << kBDFeaturesWriteBit) +}; + +enum +{ + kDiscStatusEmpty = 0, + kDiscStatusIncomplete = 1, + kDiscStatusComplete = 2, + kDiscStatusOther = 3, + kDiscStatusMask = 0x03, + kDiscStatusErasableMask = 0x10 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + +// MMC power states as defined in T10:1228D SCSI Multimedia Commands - 2 (MMC-2) +// Revision 11a, August 30, 1999, page 312 (Annex F). +enum +{ + kMMCPowerStateSystemSleep = 0, + kMMCPowerStateSleep = 1, + kMMCPowerStateStandby = 2, + kMMCPowerStateIdle = 3, + kMMCPowerStateActive = 4, + kMMCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include + +// Generic IOKit storage related headers +#include +#include +#include + +// SCSI Architecture Model Family includes +#include + +// Forward definitions for internal use only classes +class SCSIMultimediaCommands; +class SCSIBlockCommands; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIMultimediaCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIMultimediaCommandsDevice ) + +private: + +#ifndef __LP64__ + + SCSIMultimediaCommands * fSCSIMultimediaCommandObject; + SCSIMultimediaCommands * GetSCSIMultimediaCommandObject ( void ); + + SCSIBlockCommands * fSCSIBlockCommandObject; /* OBSOLETE */ + SCSIBlockCommands * GetSCSIBlockCommandObject ( void ); /* OBSOLETE */ + +#endif /* !__LP64__ */ + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIMultimediaCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fDeviceSupportsPowerOff; + BDFeatures fSupportedBDFeatures; + bool fDeviceSupportsAsyncNotification; + bool fDeviceSupportsFastSpindown; + UInt8 fCDLoadingMechanism; + }; + IOSCSIMultimediaCommandsDeviceExpansionData * fIOSCSIMultimediaCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIMultimediaCommandsDeviceReserved->fPowerDownNotifier + #define fDeviceSupportsPowerOff fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsPowerOff + #define fSupportedBDFeatures fIOSCSIMultimediaCommandsDeviceReserved->fSupportedBDFeatures + #define fDeviceSupportsAsyncNotification fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsAsyncNotification + #define fDeviceSupportsFastSpindown fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsFastSpindown + #define fCDLoadingMechanism fIOSCSIMultimediaCommandsDeviceReserved->fCDLoadingMechanism + +#ifndef __LP64__ + + // This method will retreive the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the subclasses base command set object. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + +#endif /* !__LP64__ */ + + CDFeatures fSupportedCDFeatures; + DVDFeatures fSupportedDVDFeatures; + + UInt16 fCurrentDiscSpeed; + bool fMediaChanged; + bool fMediaPresent; + + // The byte count of each physical block on the media. + UInt32 fMediaBlockSize; + + // The total number of blocks of fMediaBlockSize on the media. + UInt32 fMediaBlockCount; + + // Flags used to indicate device feature + bool fMediaIsRemovable; + bool fMediaIsWriteProtected; + UInt32 fMediaType; + + thread_call_t fPollingThread; + bool fDeviceSupportsLowPowerPolling; + bool fLowPowerPollingEnabled; + UInt32 fPollingMode; + + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + virtual IOReturn setProperties ( OSObject * properties ); + + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + virtual IOReturn DetermineIfMediaIsRemovable ( void ); + virtual IOReturn DetermineDeviceFeatures ( void ); + virtual void DetermineMediaType ( void ); + virtual bool CheckForDVDMediaType ( void ); + virtual bool CheckForCDMediaType ( void ); + virtual void PollForMedia ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + virtual void CheckWriteProtection ( void ); + virtual bool ClearNotReadyStatus ( void ); + + virtual IOReturn GetDeviceConfiguration ( void ); + virtual IOReturn GetDeviceConfigurationSize ( UInt32 * size ); + virtual IOReturn ParseFeatureList ( UInt32 numProfiles, UInt8 * firstFeaturePtr ); + + virtual IOReturn GetMechanicalCapabilities ( void ); + virtual IOReturn GetMechanicalCapabilitiesSize ( UInt32 * size ); + virtual IOReturn ParseMechanicalCapabilities ( UInt8 * mechanicalCapabilitiesPtr ); + + virtual IOReturn CheckForLowPowerPollingSupport ( void ); + virtual IOReturn GetCurrentPowerStateOfDrive ( UInt32 * powerState ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + void * clientData, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + void * clientData, + UInt64 startBlock, + UInt64 blockCount ); + + virtual void SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount ); + virtual void ResetMediaCharacteristics ( void ); + + UInt8 ConvertBCDToHex ( UInt8 binaryCodedDigit ); + + // ------ User Client Support ------ + + virtual IOReturn HandleSetUserClientExclusivityState ( IOService * userClient, bool state ); + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ); + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ); + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // The TicklePowerManager method is called to tell the power manager that the + // device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ); + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The CheckMediaPresence method is called to see if the media which we + // anticipated being there is still there. + virtual bool CheckMediaPresence ( void ); + + virtual bool InitializeDeviceSupport ( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport ( void ); + virtual void ResumeDeviceSupport ( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport ( void ); + + virtual void free ( void ); + +#ifndef __LP64__ + + virtual bool CreateCommandSetObjects ( void ); + virtual void FreeCommandSetObjects ( void ); + +#endif /* !__LP64__ */ + + virtual IOReturn VerifyDeviceState ( void ); + + +public: + + virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes ); + + virtual IOReturn SyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn AsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + void * clientData ); + + virtual IOReturn EjectTheMedia ( void ); + virtual IOReturn GetTrayState ( UInt8 * trayState ); + virtual IOReturn SetTrayState ( UInt8 trayState ); + virtual IOReturn FormatMedia ( UInt64 byteCapacity ); + virtual UInt32 GetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + virtual IOReturn LockUnlockMedia ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + virtual IOReturn ReportBlockSize ( UInt64 * blockSize ); + virtual IOReturn ReportEjectability ( bool * isEjectable ); + virtual IOReturn ReportLockability ( bool * isLockable ); + virtual IOReturn ReportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + virtual IOReturn ReportMaxReadTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMaxValidBlock ( UInt64 * maxBlock ); + virtual IOReturn ReportMaxWriteTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMediaState ( bool * mediaPresent, + bool * changed ); + virtual IOReturn ReportRemovability ( bool * isRemovable ); + virtual IOReturn ReportWriteProtection ( bool * isWriteProtected ); + + static void sPollForMedia ( void * pdtDriver, void * refCon ); + + /* CD Specific */ + virtual IOReturn SetMediaAccessSpeed ( UInt16 kilobytesPerSecond ); + + virtual IOReturn GetMediaAccessSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn AsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + void * clientData ); + + virtual IOReturn ReadISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn ReadMCN ( CDMCN mcn); + + virtual IOReturn ReadTOC ( IOMemoryDescriptor * buffer ); + +#ifndef __LP64__ + + virtual IOReturn AudioPause ( bool pause ); + + virtual IOReturn AudioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn AudioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn AudioStop ( void ); + + virtual IOReturn GetAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn GetAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn SetAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + +#endif /* !__LP64__ */ + + /* DVD Specific */ + virtual UInt32 GetMediaType ( void ); + + virtual IOReturn ReportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn SendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn ReadDVDStructure ( IOMemoryDescriptor * buffer, + const UInt32 length, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + // The block size decoding for Read CD and Read CD MSF as defined in table 255 + bool GetBlockSize ( + UInt32 * requestedByteCount, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS ); + + SCSICmdField4Byte ConvertMSFToLBA ( SCSICmdField3Byte MSF ); + +#ifndef __LP64__ + + // Command methods to access all commands available to MMC based devices. + // The BLANK command as defined in section 6.1.1 + virtual bool BLANK ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField3Bit BLANKING_TYPE, + SCSICmdField4Byte START_ADDRESS_TRACK_NUMBER, + SCSICmdField1Byte CONTROL ); + + // The CLOSE TRACK/SESSION command as defined in section 6.1.2 + virtual bool CLOSE_TRACK_SESSION ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit SESSION, + SCSICmdField1Bit TRACK, + SCSICmdField2Byte TRACK_NUMBER, + SCSICmdField1Byte CONTROL ); + + // The FORMAT UNIT command as defined in section 6.1.3 + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount parameterListSize, + SCSICmdField1Bit FMT_DATA, + SCSICmdField1Bit CMP_LIST, + SCSICmdField3Bit FORMAT_CODE, + SCSICmdField2Byte INTERLEAVE_VALUE, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + + // The GET CONFIGURATION command as defined in section 6.1.4 + virtual bool GET_CONFIGURATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit RT, + SCSICmdField2Byte STARTING_FEATURE_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The GET EVENT/STATUS NOTIFICATION command as defined in section 6.1.5 + virtual bool GET_EVENT_STATUS_NOTIFICATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit IMMED, + SCSICmdField1Byte NOTIFICATION_CLASS_REQUEST, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The GET PERFORMANCE command as defined in section 6.1.6 + virtual bool GET_PERFORMANCE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit TOLERANCE, + SCSICmdField1Bit WRITE, + SCSICmdField2Bit EXCEPT, + SCSICmdField4Byte STARTING_LBA, + SCSICmdField2Byte MAXIMUM_NUMBER_OF_DESCRIPTORS, + SCSICmdField1Byte CONTROL ); + + // The LOAD/UNLOAD MEDIUM command as defined in section 6.1.7 + virtual bool LOAD_UNLOAD_MEDIUM ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit LO_UNLO, + SCSICmdField1Bit START, + SCSICmdField1Byte SLOT, + SCSICmdField1Byte CONTROL ); + + // The MECHANISM STATUS command as defined in section 6.1.8 + virtual bool MECHANISM_STATUS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + // The PAUSE/RESUME command as defined in section 6.1.9 + virtual bool PAUSE_RESUME ( + SCSITaskIdentifier request, + SCSICmdField1Bit RESUME, + SCSICmdField1Byte CONTROL ); + + // The PLAY AUDIO (10) command as defined in section 6.1.10 + virtual bool PLAY_AUDIO_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte PLAY_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The PLAY AUDIO (12) command as defined in section 6.1.11 + virtual bool PLAY_AUDIO_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte PLAY_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The PLAY AUDIO MSF command as defined in section 6.1.12 + virtual bool PLAY_AUDIO_MSF ( + SCSITaskIdentifier request, + SCSICmdField3Byte STARTING_MSF, + SCSICmdField3Byte ENDING_MSF, + SCSICmdField1Byte CONTROL ); + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The PLAY CD command as defined in section 6.1.13 + virtual bool PLAY_CD ( + SCSITaskIdentifier request, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit CMSF, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte PLAY_LENGTH_IN_BLOCKS, + SCSICmdField1Bit SPEED, + SCSICmdField1Bit PORT2, + SCSICmdField1Bit PORT1, + SCSICmdField1Bit COMPOSITE, + SCSICmdField1Bit AUDIO, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT *******************/ + +#endif /* !__LP64__ */ + + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The READ BUFFER CAPACITY command as defined in section 6.1.14 + virtual bool READ_BUFFER_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT *******************/ + +#endif /* !__LP64__ */ + + // The READ CD command as defined in section 6.1.15 + virtual bool READ_CD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS, + SCSICmdField1Byte CONTROL ); + + // The READ CD MSF command as defined in section 6.1.16 + virtual bool READ_CD_MSF ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField3Byte STARTING_MSF, + SCSICmdField3Byte ENDING_MSF, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS, + SCSICmdField1Byte CONTROL ); + + // The READ CAPACITY command as defined in section 6.1.17 + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + // The READ DISC INFORMATION command as defined in section 6.1.18 + virtual bool READ_DISC_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ DVD STRUCTURE command as defined in section 6.1.19 + virtual bool READ_DVD_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ADDRESS, + SCSICmdField1Byte LAYER_NUMBER, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField1Byte CONTROL ); + + // The READ FORMAT CAPACITIES command as defined in section 6.1.20 + virtual bool READ_FORMAT_CAPACITIES ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The READ HEADER command as defined in section 6.1.21 + virtual bool READ_HEADER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The READ MASTER CUE command as defined in section 6.1.22 + virtual bool READ_MASTER_CUE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte SHEET_NUMBER, + SCSICmdField3Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + +#endif /* !__LP64__ */ + + // The READ SUB-CHANNEL command as defined in section 6.1.23 + virtual bool READ_SUB_CHANNEL ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField1Bit SUBQ, + SCSICmdField1Byte SUB_CHANNEL_PARAMETER_LIST, + SCSICmdField1Byte TRACK_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ TOC/PMA/ATIP command as defined in section 6.1.24/25 + virtual bool READ_TOC_PMA_ATIP ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField4Bit FORMAT, + SCSICmdField1Byte TRACK_SESSION_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ TRACK INFORMATION command as defined in section 6.1.26 + virtual bool READ_TRACK_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit ADDRESS_NUMBER_TYPE, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS_TRACK_SESSION_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The REPAIR TRACK command as defined in section 6.1.27 + virtual bool REPAIR_TRACK ( + SCSITaskIdentifier request, + SCSICmdField2Byte TRACK_NUMBER, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + // The REPORT KEY command as defined in section 6.1.28 + virtual bool REPORT_KEY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + // The RESERVE TRACK command as defined in section 6.1.29 + virtual bool RESERVE_TRACK ( + SCSITaskIdentifier request, + SCSICmdField4Byte RESERVATION_SIZE, + SCSICmdField1Byte CONTROL ); + + // The SCAN command as defined in section 6.1.30 + virtual bool SCAN ( + SCSITaskIdentifier request, + SCSICmdField1Bit DIRECT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte SCAN_STARTING_ADDRESS_FIELD, + SCSICmdField2Bit TYPE, + SCSICmdField1Byte CONTROL ); + + // The SEND CUE SHEET command as defined in section 6.1.31 + virtual bool SEND_CUE_SHEET ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Byte CUE_SHEET_SIZE, + SCSICmdField1Byte CONTROL ); + + // The SEND DVD STRUCTURE command as defined in section 6.1.32 + virtual bool SEND_DVD_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte STRUCTURE_DATA_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The SEND EVENT command as defined in section 6.1.33 + virtual bool SEND_EVENT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit IMMED, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The SEND KEY command as defined in section 6.1.34 + virtual bool SEND_KEY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + // The SEND OPC INFORMATION command as defined in section 6.1.35 + virtual bool SEND_OPC_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DO_OPC, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); +#endif /* !__LP64__ */ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The SET CD SPEED command as defined in section 6.1.36 + virtual bool SET_CD_SPEED ( + SCSITaskIdentifier request, + SCSICmdField2Byte LOGICAL_UNIT_READ_SPEED, + SCSICmdField2Byte LOGICAL_UNIT_WRITE_SPEED, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + // The SET READ AHEAD command as defined in section 6.1.37 + virtual bool SET_READ_AHEAD ( + SCSITaskIdentifier request, + SCSICmdField4Byte TRIGGER_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte READ_AHEAD_LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + // The SET STREAMING command as defined in section 6.1.38 + virtual bool SET_STREAMING ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + // The STOP PLAY/SCAN command as defined in section 6.1.39 + virtual bool STOP_PLAY_SCAN ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + // The SYNCHRONIZE CACHE command as defined in section 6.1.40 + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // The WRITE (10) command as defined in section 6.1.41 + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The WRITE AND VERIFY (10) command as defined in section 6.1.42 + virtual bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYT_CHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 1 ); + + virtual IOReturn ReadTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt32 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 2 ); + + virtual IOReturn ReadDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 3 ); + + virtual IOReturn ReadTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 4 ); + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 5 ); + + +protected: + + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + +public: + + + /* Added with 10.5 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 6 ); + + virtual IOReturn ReadDiscStructure ( IOMemoryDescriptor * buffer, + const UInt32 length, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid, + const UInt8 mediaType ); + + + bool CheckForBDMediaType ( void ); + + + bool READ_DISC_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MEDIA_TYPE, + SCSICmdField4Byte ADDRESS, + SCSICmdField1Byte LAYER_NUMBER, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField1Byte CONTROL ); + + + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 7 ); + + virtual IOReturn ReserveTrack ( UInt8 reservationType, + UInt8 reservationFormat, + UInt64 ReservationParameter ); + + + bool RESERVE_TRACK_V2 ( SCSITaskIdentifier request, + SCSICmdField1Bit RMZ, + SCSICmdField1Bit ARSV, + SCSICmdField7Byte RESERVATION_PARAMETER, + SCSICmdField1Byte CONTROL ); + + + bool REPORT_KEY_V2 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + + bool SEND_KEY_V2 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + +protected: + + + void SetPollingMode ( UInt32 newPollingMode ); + + +public: + + + /* 10.6.0 */ + + IOReturn RequestIdle ( void ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceNub.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceNub.h.svn-base new file mode 100644 index 0000000..f88a1e9 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceNub.h.svn-base @@ -0,0 +1,233 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Probe score values +enum +{ + kPeripheralDeviceTypeNoMatch = 0, + kDefaultProbeRanking = 5000, + kFirstOrderRanking = 10000, + kSecondOrderRanking = 15000, + kThirdOrderRanking = 20000 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include +#include + +// SCSI Architecture Model Family includes +#include + + +// Forward definitions for internal use only classes. +class SCSIPrimaryCommands; + +//----------------------------------------------------------------------------- +// Class Declarations +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceNub : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceNub ) + +private: + + static bool sCompareIOProperty ( + IOService * object, + OSDictionary * table, + char * propertyKeyName, + bool * matches ); + + static void TaskCallback ( SCSITaskIdentifier completedTask ); + void TaskCompletion ( SCSITaskIdentifier completedTask ); + + static IOReturn sWaitForTask ( void * object, SCSITask * request ); + IOReturn GatedWaitForTask ( SCSITask * request ); + +protected: + + SCSIServiceResponse SendTask ( SCSITask * request ); + + bool InterrogateDevice ( void ); + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceNubExpansionData { }; + IOSCSIPeripheralDeviceNubExpansionData * fIOSCSIPeripheralDeviceNubReserved; + + IOSCSIProtocolInterface * fProvider; +#ifndef __LP64__ + SCSIPrimaryCommands * fSCSIPrimaryCommandObject; +#endif + UInt8 fDefaultInquiryCount; + + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + // We override this method in order to NOT do power management + virtual void InitializePowerManagement ( IOService * provider ); + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void free ( void ); + + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ); + + virtual bool matchPropertyTable ( OSDictionary * table, + SInt32 * score ); + + // The ExecuteCommand method will take a SCSITask object and transport + // it across the physical wires to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + virtual SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + virtual SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse TargetReset ( void ); + + // ************* Obsoleted Member Routine **************** + // The AbortCommand method is replaced by the AbortTask Management function and + // should no longer be called. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier abortTask ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 16 ); + +}; + + + +class IOSCSILogicalUnitNub : public IOSCSIPeripheralDeviceNub +{ + + OSDeclareDefaultStructors ( IOSCSILogicalUnitNub ) + +private: + + UInt8 fLogicalUnitNumber; + +protected: + + // Reserve space for future expansion. + struct IOSCSILogicalUnitNubExpansionData { }; + IOSCSILogicalUnitNubExpansionData * fIOSCSILogicalUnitNubReserved; + +public: + + virtual bool start ( IOService * provider ); + + virtual void SetLogicalUnitNumber ( UInt8 newLUN ); + + UInt8 GetLogicalUnitNumber ( void ); + + // The ExecuteCommand method will take a SCSITask object and transport + // it across the physical wires to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ); + + // The AbortCommand method will abort the indicated SCSI Task object, + // if it is possible and the SCSI Task has not already completed. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier abortTask ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType00.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType00.h.svn-base new file mode 100644 index 0000000..34fdb18 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType00.h.svn-base @@ -0,0 +1,102 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType00 : public IOSCSIBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType00 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType00ExpansionData + { + OSSet * fClients; + }; + IOSCSIPeripheralDeviceType00ExpansionData * fIOSCSIPeripheralDeviceType00Reserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void free ( void ); + + virtual bool handleOpen ( + IOService * client, + IOOptionBits options, + void * access ); + + virtual void handleClose ( + IOService * client, + IOOptionBits options ); + + virtual bool handleIsOpen ( const IOService * client ) const; + + virtual IOReturn newUserClient ( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ); + virtual void CreateStorageServiceNub ( void ); + + virtual char * GetVendorString ( void ); + virtual char * GetProductString ( void ); + virtual char * GetRevisionString ( void ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType05.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType05.h.svn-base new file mode 100644 index 0000000..22066f0 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType05.h.svn-base @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType05 : public IOSCSIMultimediaCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType05 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType05ExpansionData { }; + IOSCSIPeripheralDeviceType05ExpansionData * fIOSCSIPeripheralDeviceType05Reserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType07.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType07.h.svn-base new file mode 100644 index 0000000..661136d --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType07.h.svn-base @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType07 : public IOSCSIBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType07 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType07ExpansionData { }; + IOSCSIPeripheralDeviceType07ExpansionData * fIOSCSIPeripheralDeviceType07Reserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType0E.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType0E.h.svn-base new file mode 100644 index 0000000..cc9ec06 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPeripheralDeviceType0E.h.svn-base @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType0E : public IOSCSIReducedBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType0E ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType0EExpansionData { }; + IOSCSIPeripheralDeviceType0EExpansionData * fIOSCSIPeripheralDeviceType0EReserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPrimaryCommandsDevice.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPrimaryCommandsDevice.h.svn-base new file mode 100644 index 0000000..ba0f1a0 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIPrimaryCommandsDevice.h.svn-base @@ -0,0 +1,805 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include +#include +#include +#include + +// SCSI Architecture Model Family includes +#include +#include +#include +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Notification messages +enum +{ + kSCSIServicesNotification_Suspend = 0x69000080, + kSCSIServicesNotification_Resume = 0x69000090 +}; + + +// Timeout values +enum +{ + kOneSecondTimeoutInMS = 1000, + kTenSecondTimeoutInMS = 10 * kOneSecondTimeoutInMS, + kThirtySecondTimeoutInMS = 30 * kOneSecondTimeoutInMS, + kFortyFiveSecondTimeoutInMS = 45 * kOneSecondTimeoutInMS +}; + +// Mode page values for page control field +enum +{ + kModePageControlCurrentValues = 0x00, + kModePageControlChangeableValues = 0x01, + kModePageControlDefaultValues = 0x02, + kModePageControlSavedValues = 0x03 +}; + +// The command should be tried 5 times. The original attempt +// plus 4 retries. +#define kDefaultRetryCount 4 + +// Forward declarations for internal use only classes +class SCSIPrimaryCommands; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPrimaryCommandsDevice : public IOSCSIProtocolInterface +{ + + OSDeclareAbstractStructors ( IOSCSIPrimaryCommandsDevice ) + +private: + +#ifndef __LP64__ + SCSIPrimaryCommands * fSCSIPrimaryCommandObject; +#endif + + IOSCSIProtocolInterface * fProtocolDriver; + + // The fProtocolAccessEnabled member variable indicates whether + // requests coming from the client can be sent to the device. + // This will be set to true after the Protocol Service driver is successfully + // opened and before the call to InitializeDeviceSupport and set to false before + // TerminateDeviceSupport is called. + bool fProtocolAccessEnabled; + + // The fDeviceAccessEnabled member variable indicates whether + // requests coming from the client can be sent to the device. + // This will be set to true after InitializeDeviceSupport is called and + // set to false before StopDeviceSupport is called. + bool fDeviceAccessEnabled; + bool fDeviceAccessSuspended; + + static bool ServerKeyswitchCallback ( void * target, + void * refCon, + IOService * newService ); + + static void TaskCallback ( SCSITaskIdentifier completedTask ); + void TaskCompletion ( SCSITaskIdentifier completedTask ); + + static IOReturn sWaitForTask ( void * object, SCSITaskIdentifier request ); + IOReturn GatedWaitForTask ( SCSITaskIdentifier request ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIPrimaryCommandsDeviceExpansionData + { + IONotifier * fKeySwitchNotifier; + UInt8 fANSIVersion; + UInt32 fReadTimeoutDuration; + UInt32 fWriteTimeoutDuration; + bool fCMDQUE; + SCSITaggedTaskIdentifier fTaskID; + IOSimpleLock * fTaskIDLock; + UInt32 fRetryCount; + }; + IOSCSIPrimaryCommandsDeviceExpansionData * fIOSCSIPrimaryCommandsDeviceReserved; + + #define fReadTimeoutDuration fIOSCSIPrimaryCommandsDeviceReserved->fReadTimeoutDuration + #define fWriteTimeoutDuration fIOSCSIPrimaryCommandsDeviceReserved->fWriteTimeoutDuration + #define fRetryCount fIOSCSIPrimaryCommandsDeviceReserved->fRetryCount + + + UInt8 fDefaultInquiryCount; + OSDictionary * fDeviceCharacteristicsDictionary; + UInt32 fNumCommandsOutstanding; + + virtual void free ( void ); + void SetANSIVersion ( UInt8 ); + void SetCMDQUE ( bool value ); + IOReturn GetModeSense ( + IOMemoryDescriptor * dataBuffer, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + bool * use10ByteModeSense ); + bool RetrieveINQUIRYData ( + UInt8 EVPD, + UInt8 inquiryPage, + UInt8 * inquiryBuffer, + UInt16 * dataSize ); + + // This flag is set if the device responds to a MODE_SENSE_10 command + // with the page code set to 0x1A (Power Conditions Mode Page) + bool fDeviceSupportsPowerConditions; + + // This method will retreive the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the base command set object of the subclass. + +#ifndef __LP64__ + + // ------ DEPRECATED API ---------- + // This should no longer be called by subclasses as the command builder + // objects will be removed in a later release. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + + // This method is called by the start method to create all the command + // objects needed by the class. For subclasses, this will be overridden + // to create its needed command set objects. + virtual bool CreateCommandSetObjects ( void ); + + // This method is called by the free method to free all the command + // objects needed by the class. For subclasses, this will be overridden + // to free its needed command set objects. + virtual void FreeCommandSetObjects ( void ); + +#endif + + + // This method is called by the start method to obtain information from + // the device with regards to whether it supports the power conditions mode page. + virtual void CheckPowerConditionsModePage ( void ); + + // This will return back the Protocol driver that is used to + // send service requests to the device. + virtual IOSCSIProtocolInterface * GetProtocolDriver ( void ); + + // This will get a new SCSITask for the caller + virtual SCSITaskIdentifier GetSCSITask ( void ); + + // This will release a SCSITask (eventually return it to a pool) + virtual void ReleaseSCSITask ( SCSITaskIdentifier request ); + + // This will return a unique value for the tagged task identifier + SCSITaggedTaskIdentifier GetUniqueTagID ( void ); + + // Call for executing the command synchronously + SCSIServiceResponse SendCommand ( + SCSITaskIdentifier request, + UInt32 timeoutDuration ); + + // Call for executing the command asycnchronously + void SendCommand ( + SCSITaskIdentifier request, + UInt32 timeoutDuration, + SCSITaskCompletion taskCompletion ); + + + virtual bool InitializeDeviceSupport ( void ) = 0; + virtual void StartDeviceSupport ( void ) = 0; + virtual void SuspendDeviceSupport ( void ) = 0; + virtual void ResumeDeviceSupport ( void ) = 0; + virtual void StopDeviceSupport ( void ) = 0; + virtual void TerminateDeviceSupport ( void ) = 0; + virtual UInt32 GetNumberOfPowerStateTransitions ( void ) = 0; + + virtual IOReturn VerifyDeviceState ( void ); + // Called to clear any power-on/reset status in the drive + virtual bool ClearPowerOnReset ( void ); + virtual bool ClearNotReadyStatus ( void ) = 0; + + bool IsProtocolAccessEnabled ( void ); + bool IsDeviceAccessEnabled ( void ); + bool IsDeviceAccessSuspended ( void ); + + // Accessors for saving and retrieving data from an SCSITask object. + bool ResetForNewTask( + SCSITaskIdentifier request ); + bool SetTaskAttribute ( + SCSITaskIdentifier request, + SCSITaskAttribute newAttribute ); + SCSITaskAttribute GetTaskAttribute ( + SCSITaskIdentifier request ); + bool SetTaggedTaskIdentifier ( + SCSITaskIdentifier request, + SCSITaggedTaskIdentifier taggedTaskIdentifier ); + SCSITaggedTaskIdentifier GetTaggedTaskIdentifier ( + SCSITaskIdentifier request ); + bool SetTaskState ( + SCSITaskIdentifier request, + SCSITaskState newTaskState ); + SCSITaskState GetTaskState ( + SCSITaskIdentifier request ); + bool SetTaskStatus ( + SCSITaskIdentifier request, + SCSITaskStatus newStatus ); + SCSITaskStatus GetTaskStatus ( + SCSITaskIdentifier request ); + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5 ); + + // Populate the 10 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9 ); + + // Populate the 12 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9, + UInt8 cdbByte10, + UInt8 cdbByte11 ); + + // Populate the 16 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9, + UInt8 cdbByte10, + UInt8 cdbByte11, + UInt8 cdbByte12, + UInt8 cdbByte13, + UInt8 cdbByte14, + UInt8 cdbByte15 ); + + bool SetDataTransferDirection ( + SCSITaskIdentifier request, + UInt8 newDirection ); + UInt8 GetDataTransferDirection ( + SCSITaskIdentifier request ); + bool SetRequestedDataTransferCount ( + SCSITaskIdentifier request, + UInt64 newRequestedCount ); + UInt64 GetRequestedDataTransferCount ( + SCSITaskIdentifier request ); + bool SetRealizedDataTransferCount ( + SCSITaskIdentifier request, + UInt64 newRealizedDataCount ); + UInt64 GetRealizedDataTransferCount ( + SCSITaskIdentifier request ); + bool SetDataBuffer ( + SCSITaskIdentifier request, + IOMemoryDescriptor * newBuffer ); + IOMemoryDescriptor * GetDataBuffer ( + SCSITaskIdentifier request ); + bool SetTimeoutDuration ( + SCSITaskIdentifier request, + UInt32 newTimeout ); + UInt32 GetTimeoutDuration ( + SCSITaskIdentifier request ); + bool SetTaskCompletionCallback ( + SCSITaskIdentifier request, + SCSITaskCompletion newCallback ); + void TaskCompletedNotification ( + SCSITaskIdentifier request ); + + bool SetServiceResponse ( + SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse ); + SCSIServiceResponse GetServiceResponse ( + SCSITaskIdentifier request ); + bool SetAutosenseCommand ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5 ); + bool GetAutoSenseData ( + SCSITaskIdentifier request, + SCSI_Sense_Data * senseData ); // DEPRECATED, use below function instead + bool GetAutoSenseData ( + SCSITaskIdentifier request, + SCSI_Sense_Data * senseData, + UInt8 senseDataSize ); + UInt8 GetAutoSenseDataSize ( + SCSITaskIdentifier request ); + + bool SetApplicationLayerReference ( + SCSITaskIdentifier request, + void * newReferenceValue ); + void * GetApplicationLayerReference ( + SCSITaskIdentifier request ); + + void IncrementOutstandingCommandsCount ( void ); + static void sIncrementOutstandingCommandsCount ( + IOSCSIPrimaryCommandsDevice * self ); + virtual void HandleIncrementOutstandingCommandsCount ( void ); + + + // This static member routine provides a mechanism for retrieving a pointer to + // the object that is claimed as the owner of the specified SCSITask. + static OSObject * sGetOwnerForTask ( SCSITaskIdentifier request ); + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ); + + // The setAgressiveness method is called by the power manager + // to notify us of certain power management settings. We override + // this method in order to catch the kPMMinutesToSpinDown message + // in order to set our idle timer. + virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes ); + + // Methods for getting device information strings + virtual char * GetVendorString ( void ); + virtual char * GetProductString ( void ); + virtual char * GetRevisionString ( void ); + OSDictionary * GetProtocolCharacteristicsDictionary ( void ); + OSDictionary * GetDeviceCharacteristicsDictionary ( void ); + UInt8 GetANSIVersion ( void ); + bool GetCMDQUE ( void ); + OSString * MapINQUIRYDataToIconFile ( void ); + UInt32 GetRetryCount ( void ); + + // -- SCSI Protocol Interface Methods -- + // The ExecuteCommand method will take a SCSI Task and transport + // it across the physical wire(s) to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ); + + SCSIServiceResponse TargetReset ( void ); + + // The AbortCommand method will abort the indicated SCSI Task, + // if it is possible and the task has not already completed. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( + SCSIProtocolFeature feature, + void * serviceValue ); + + // The HandleProtocolServiceFeature will return true if the specified feature could + // be handled properly by the protocol layer. + virtual bool HandleProtocolServiceFeature ( + SCSIProtocolFeature feature, + void * serviceValue ); + + // Utility methods for use by all peripheral device objects. + + // isParameterValid are used to validate that the parameter passed into + // the command methods are of the correct value. + + // Validate Parameter used for 1 bit to 1 byte paramaters + bool IsParameterValid ( + SCSICmdField1Byte param, + SCSICmdField1Byte mask ); + + // Validate Parameter used for 9 bit to 2 byte paramaters + bool IsParameterValid ( + SCSICmdField2Byte param, + SCSICmdField2Byte mask ); + + // Validate Parameter used for 17 bit to 4 byte paramaters + bool IsParameterValid ( + SCSICmdField4Byte param, + SCSICmdField4Byte mask ); + + // Validate Parameter used for 33 bit to 8 byte paramaters + bool IsParameterValid ( + SCSICmdField8Byte param, + SCSICmdField8Byte mask ); + + + bool IsMemoryDescriptorValid ( + IOMemoryDescriptor * dataBuffer ); + + bool IsMemoryDescriptorValid ( + IOMemoryDescriptor * dataBuffer, + UInt64 requiredSize ); + +#ifndef __LP64__ + + // SCSI Primary command implementations + virtual bool CHANGE_DEFINITION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit SAVE, + SCSICmdField7Bit DEFINITION_PARAMETER, + SCSICmdField1Byte PARAMETER_DATA_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool COMPARE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PAD, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool COPY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PAD, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool COPY_AND_VERIFY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit PAD, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool EXTENDED_COPY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CMDDT, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool LOG_SELECT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PCR, + SCSICmdField1Bit SP, + SCSICmdField2Bit PC, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool LOG_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PPC, + SCSICmdField1Bit SP, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte PARAMETER_POINTER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SELECT_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField1Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SELECT_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SENSE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SENSE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit LLBAA, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PERSISTENT_RESERVE_IN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PERSISTENT_RESERVE_OUT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Bit SCOPE, + SCSICmdField4Bit TYPE, + SCSICmdField1Byte CONTROL ); + + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( + SCSITaskIdentifier request, + SCSICmdField2Bit PREVENT, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RECEIVE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RECEIVE_DIAGNOSTICS_RESULTS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PCV, + SCSICmdField1Byte PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RELEASE_6 ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RELEASE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool RELEASE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RELEASE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool REPORT_DEVICE_IDENTIFIER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REPORT_LUNS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REQUEST_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RESERVE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RESERVE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool RESERVE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RESERVE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool SEND ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit AER, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEND_DIAGNOSTICS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit SELF_TEST_CODE, + SCSICmdField1Bit PF, + SCSICmdField1Bit SELF_TEST, + SCSICmdField1Bit DEVOFFL, + SCSICmdField1Bit UNITOFFL, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_DEVICE_IDENTIFIER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool TEST_UNIT_READY ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The SPC-3 INQUIRY command as defined in section 6.4.1 of SPC-3. + bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIProtocolInterface.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIProtocolInterface.h.svn-base new file mode 100644 index 0000000..bb74ce4 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIProtocolInterface.h.svn-base @@ -0,0 +1,854 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ +#define _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ + + +/*! @header SCSI Protocol Interface + @discussion + This file contains definitions for the IOSCSIProtocolInterface class, + SCSI Protocol Features used by this interface, and additional constants + used by this interface. +*/ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +/* +SCSI Device Characteristics - Defined between SCSI Application Layer and + SCSI Protocol Layer only. +*/ + +/*! +@constant kIOPropertySCSIDeviceCharacteristicsKey +@discussion +This key is used to define SCSI Device Characteristics for a particular device. +It is the key for the dictionary containing the keys of characteristics. These keys +are only defined between the SCSI Protocol Layer and the SCSI Applicaiton Layer. Some +properties may be copied from this dictionary to the more generic Device Characteristics +or Protocol Characteristics dictionaries. +*/ +#define kIOPropertySCSIDeviceCharacteristicsKey "SCSI Device Characteristics" + +/*! +@constant kIOPropertySCSIInquiryLengthKey +@discussion +This key is used to define a default INQUIRY length to issue to the device. The +value is a UInt32 corresponding to the number of bytes to request in the INQUIRY +command. +*/ +#define kIOPropertySCSIInquiryLengthKey "Inquiry Length" + +/*! +@constant kIOPropertySCSIManualEjectKey +@discussion +This key is used to indicate that the device is known to be a manual ejectable media +device. This property overrides all of the driver checks for determining this capability. +This property is a string, although if it exists it should always be true. +*/ +#define kIOPropertySCSIManualEjectKey "Manual Eject" + +/*! +@constant kIOPropertyReadTimeOutDurationKey +@discussion +This key is used to define the Read Time Out for a particular device. +This property overrides all of the protocol defaults. +This property is a value, in milliseconds. +*/ +#define kIOPropertyReadTimeOutDurationKey "Read Time Out Duration" + +/*! +@constant kIOPropertyWriteTimeOutDurationKey +@discussion +This key is used to define the Write Time Out for a particular device. +This property overrides all of the protocol defaults. +This property is a value, in milliseconds. +*/ +#define kIOPropertyWriteTimeOutDurationKey "Write Time Out Duration" + +/*! +@constant kIOPropertyRetryCountKey +@discussion +This key is used to define the number of Read/Write retries for a particular device. +This property overrides all of the protocol defaults. +The value is a UInt32 corresponding to the number of retries. +*/ +#define kIOPropertyRetryCountKey "Retry Count" + +/*! + @constant kIOPropertyAutonomousSpinDownKey + @discussion + This key is used to indicate that the device is known to have its own internal logic + for idle disk spin down. This key is used to mark device which respon poorly to our + efforts to manually spin down or spin up the device when it is already in the desired + state. + */ +#define kIOPropertyAutonomousSpinDownKey "Autonomous Spin Down" + +/*! + @constant kIOPropertyEjectRequireStartStopUnitKey + @discussion + This key is used to indicate that while the device may have failed PREVENT_ALLOW_MEDIUM + REMOVAL it still requires a START_STOP_UNIT to eject/unload media. + */ +#define kIOPropertyEjectRequireStartStopUnitKey "Eject Requires START_STOP_UNIT" + +#if defined(KERNEL) && defined(__cplusplus) + + +/*! +@constant kCFBundleIdentifierKey +@discussion +Property key for CFBundleIdentifier. +*/ +#define kCFBundleIdentifierKey "CFBundleIdentifier" + +/*! +@constant kIOSCSIArchitectureBundleIdentifierKey +@discussion +IOSCSIArchitectureModelFamily's CFBundle identifier. +*/ +#define kIOSCSIArchitectureBundleIdentifierKey "com.apple.iokit.IOSCSIArchitectureModelFamily" + + +// General kernel headers +#include + +// General IOKit headers +#include +#include +#include +#include + +// SCSI Architecture Model Family includes +#include + + +/*! +@enum SCSI Protocol Interface Device Notification values +@discussion +Message values for SCSI Protocol Interface Device Notifications. +@constant kSCSIProtocolNotification_DeviceRemoved +Private message sent between a SCSI protocol service provider and +SCSI application layer driver to indicate device removal. +@constant kSCSIProtocolNotification_VerifyDeviceState +Private message sent between a SCSI protocol service provider and +SCSI application layer driver to indicate device state may have +changed and the device state should be re-verified by the SCSI +Application Layer driver. An example would be a bus reset which clears +the tray locking state of an ATAPI device. +@constant kSCSIServicesNotification_ExclusivityChanged +Message sent when a change in exclusivity state occurs. Usually in +response to acquiring/releasing exclusive access to a device via a user client. +*/ +enum +{ + kSCSIProtocolNotification_DeviceRemoved = 0x69000010, + kSCSIProtocolNotification_VerifyDeviceState = 0x69000020, + kSCSIServicesNotification_ExclusivityChanged = 0x69000030 +}; + + +/*! +@typedef SCSIProtocolFeature +@discussion +Typedef for SCSIProtocolFeature, a 32-bit quantity. +*/ +typedef UInt32 SCSIProtocolFeature; + +/*! +@enum SCSI Protocol Features +@discussion +The list of SCSI Protocol Features currently supported. +*/ +enum +{ + + /*! + @constant kSCSIProtocolFeature_ACA Not yet used. + */ + kSCSIProtocolFeature_ACA = 1, + + /*! + @constant kSCSIProtocolFeature_CPUInDiskMode Used to determine + if the SCSI Protocol Services Driver supports a CPU which is in + target disk mode. + */ + kSCSIProtocolFeature_CPUInDiskMode = 2, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPolling Used + to determine if the SCSI Protocol Services Driver supports + protocol specific polling for media. This is used for low-power + polling specifically for ATAPI devices on ATA buses + */ + kSCSIProtocolFeature_ProtocolSpecificPolling = 3, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificSleepCommand Used + to determine if the SCSI Protocol Services Driver supports + protocol specific sleep commands to a drive. This is used for + sleeping drives specifically ATAPI devices on ATA buses. + */ + kSCSIProtocolFeature_ProtocolSpecificSleepCommand = 4, + + /*! + @constant kSCSIProtocolFeature_GetMaximumLogicalUnitNumber If + the SCSI Protocol Services Driver supports logical units, it will + report the maximum addressable ID that it supports in the UInt32 pointer + that is passed in as the serviceValue. If only one unit is supported, + the driver should return false for this query. + */ + kSCSIProtocolFeature_GetMaximumLogicalUnitNumber = 5, + + /*! + @constant kSCSIProtocolFeature_MaximumReadBlockTransferCount If + the SCSI Protocol Services Driver has a maximum number of + blocks that can be transfered in a read request, it will return + true to this query and return the block count in the UInt32 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumReadBlockTransferCount = 6, + + /*! + @constant kSCSIProtocolFeature_MaximumWriteBlockTransferCount If + the SCSI Protocol Services Driver has a maximum number of + blocks that can be transferred in a write request, it will return + true to this query and return the block count in the UInt32 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumWriteBlockTransferCount = 7, + + /*! + @constant kSCSIProtocolFeature_MaximumReadTransferByteCount If + the SCSI Protocol Services Driver has a maximum byte count + that can be transferred in a read request, it will return + true to this query and return the byte count in the UInt64 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumReadTransferByteCount = 8, + + /*! + @constant kSCSIProtocolFeature_MaximumWriteTransferByteCount If + the SCSI Protocol Services Driver has a maximum byte count + that can be transferred in a write request, it will return + true to this query and return the byte count in the UInt64 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumWriteTransferByteCount = 9, + + /*! + @constant kSCSIProtocolFeature_SubmitDefaultInquiryData If + the SCSI Protocol Services Driver needs any extra information to + make any negotiation settings from the standard INQUIRY data, this + will be called to set that appropriately. The serviceValue will + point to a SCSICmd_INQUIRY_StandardData buffer. The size + of the buffer depends on the SCSI Device Characteristics + dictionary for the device or bus. If there is no + kIOPropertySCSIInquiryLengthKey value set in the dictionary + or if it doesn't exist, then the size of the data will be + the size of the full amount of Inquiry retrieved from the device. + */ + kSCSIProtocolFeature_SubmitDefaultInquiryData = 10, + + /*! + @constant kSCSIProtocolFeature_ProtocolAlwaysReportsAutosenseData If + the SCSI Protocol Services Driver always reports available + autosense data when a kSCSITaskStatus_CHECK_CONDITION is set, + then the protocol layer should return true. E.g. FireWire + transport drivers should respond true to this. + */ + kSCSIProtocolFeature_ProtocolAlwaysReportsAutosenseData = 11, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPowerOff If + the SCSI Protocol Services Driver supports removing the power + to the drive, then the protocol layer should return true. This is + used for aggressive power management, specifically for ATAPI + devices on ATA buses. + */ + kSCSIProtocolFeature_ProtocolSpecificPowerOff = 12, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPowerControl + Used to determine if the SCSI Protocol Services Driver supports + switching the power to the drive on and off. This is used for aggressive + power management, specifically for SATAPI devices on AHCI buses. + */ + kSCSIProtocolFeature_ProtocolSpecificPowerControl = 13, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificAsyncNotification + Used to determine if the SCSI Protocol Services Driver supports + asynchronous notifications from the drive. This is used to prevent + polling for media, specifically for SATAPI devices on AHCI buses. + */ + kSCSIProtocolFeature_ProtocolSpecificAsyncNotification = 14 + +}; + + +/*! +@typedef SCSIProtocolPowerState +@discussion +Typedef for SCSIProtocolPowerState, a 32-bit quantity. +*/ +typedef UInt32 SCSIProtocolPowerState; + +/*! +@enum SCSI Protocol Power States +@discussion +The list of SCSI Protocol Power States. +*/ +enum +{ + /*! + @constant kSCSIProtocolPowerStateOff + Off power state. + */ + kSCSIProtocolPowerStateOff = 0, + + /*! + @constant kSCSIProtocolPowerStateOn + On power state. + */ + kSCSIProtocolPowerStateOn = 1 +}; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +/*! +@class IOSCSIProtocolInterface +@superclass IOService +@discussion +This class defines the public SCSI Protocol Layer API for any class that +provides Protocol services or needs to provide the Protocol Service API +for passing service requests to a Protocol Service driver. +*/ +class IOSCSIProtocolInterface : public IOService +{ + + OSDeclareAbstractStructors ( IOSCSIProtocolInterface ) + +public: + + /*! + @function start + @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + @discussion See IOService.h for details. + @result true if the start was successful; false otherwise (which will cause the instance to be detached and usually freed). + */ + virtual bool start ( IOService * provider ); + + /*! + @function free + @abstract Called to release all resources held by the object. + @discussion Release all resources held by the object, then call super::free(). + */ + virtual void free ( void ); + + /*! + @function willTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent before recursing up the stack, in root-to-leaf order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate(). + @result true. + */ + virtual bool willTerminate ( IOService * provider, IOOptionBits options ); + + /*! + @function GetUserClientExclusivityState + @abstract Gets the current exclusivity state of the user client. + @discussion The GetUserClientExclusivityState() method is called by the SCSITaskUserClient + to determine if any user client is holding exclusive access at the current time. This is simply + a preflight check and a return value of false does not guarantee that a subsequent + call to SetUserClientExclusivityState() will return successfully. + @result true if a user client is in exclusive control of the device, false otherwise. + */ + virtual bool GetUserClientExclusivityState ( void ); + + /*! + @function SetUserClientExclusivityState + @abstract Sets the current exclusivity state of the user client. + @discussion The SetUserClientExclusivityState() method is called by the SCSITaskUserClient + to set the exclusive access mode. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state Exclusivity state. true means exclusive access is desired, false + means exclusive access is being released. + @result A valid IOReturn code indicating success or the type of failure. + */ + virtual IOReturn SetUserClientExclusivityState ( IOService * userClient, bool state ); + + + /*! + @function initialPowerStateForDomainState + @abstract Determines which power state a device is in, given the current power domain state. + @discussion Power management calls this method once, when the driver is initializing power management. + Subclasses should not need to override this method. + @param flags Flags that describe the character of "domain power"; they represent the outputPowerCharacter field of a state in the power domain's power state array. + @result A state number. + */ + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags flags ); + + /*! + @function setPowerState + @abstract Requests a power managed driver to change the power state of its device. + @discussion Requests a power managed driver to change the power state of its device. Most subclasses + of IOSCSIProtocolInterface have class-specific mechanisms and should not override this routine. + See IOSCSIProtocolServices.h, IOSCSIBlockCommandsDevice.h, IOSCSIReducedBlockCommandsDevice.h, and + IOSCSIMultimediaCommandsDevice.h for more information about power management changes. + Subclasses should not need to override this method. + @param powerStateOrdinal The number in the power state array to which the drive is being instructed to change. + @param whichDevice A pointer to the power management object which registered to manage power for this device. + The whichDevice field is not pertinent to us since the driver is both the "policy maker" for the device, + and the "policy implementor" for the device. + @result See IOService.h for details. + */ + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService * whichDevice ); + + /*! + @function IsPowerManagementIntialized + @abstract Called to determine if power management is initialized. + @discussion Called to determine if power management is initialized. + Subclasses should not need to override this method. + @result true if power management has been initialized, false otherwise. + */ + virtual bool IsPowerManagementIntialized ( void ); + + /*! + @function CheckPowerState + @abstract Called by clients to ensure device is in correct power state before issuing I/O. + @discussion Called by clients to ensure device is in correct power state before issuing I/O. + If the device is not ready to handle such requests, it gives the driver a chance to block the + thread until the device is ready. Subclasses should not need to override this method. + */ + virtual void CheckPowerState ( void ); + + /*! + @function ExecuteCommand + @abstract Called to send a SCSITask and transport it across the physical wire(s) to the device. + @discussion Called to send a SCSITask and transport it across the physical wire(s) to the device. + Subclasses internal to IOSCSIArchitectureModelFamily will need to override this method. Third + party subclasses should not need to override this method. + @param request A valid SCSITaskIdentifier representing the task to transport across the wire(s). + */ + virtual void ExecuteCommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function AbortCommand + @abstract Obsolete. Do not use this method. + @discussion Obsolete. Do not use this method. + */ + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function IsProtocolServiceSupported + @abstract This method is called to query for support of a protocol specific service feature. + @discussion This method is called to query for support of a protocol specific service feature. + Subclasses of IOSCSIProtocolServices should override this method. + @param feature A valid SCSIProtocolFeature. See enums for SCSIProtocolFeature. + @param serviceValue A pointer to a structure/value that is used in conjunction with the feature + requested. See enums for SCSIProtocolFeature. NB: This parameter may be NULL for certain + feature requests. + @result true if the feature is supported, false otherwise. + */ + virtual bool IsProtocolServiceSupported ( + SCSIProtocolFeature feature, + void * serviceValue ) = 0; + + /*! + @function HandleProtocolServiceFeature + @abstract This method is called to enact support of a protocol specific service feature. + @discussion This method is called to enact support of a protocol specific service feature. + Subclasses of IOSCSIProtocolServices should override this method. + @param feature A valid SCSIProtocolFeature. See enums for SCSIProtocolFeature. + @param serviceValue A pointer to a structure/value that is used in conjunction with the feature + requested. See enums for SCSIProtocolFeature. NB: This parameter may be NULL for certain + feature requests. + @result true if the service feature request succeeded, false otherwise. + */ + virtual bool HandleProtocolServiceFeature ( + SCSIProtocolFeature feature, + void * serviceValue ) = 0; + +protected: + + // Reserve space for future expansion. + struct IOSCSIProtocolInterfaceExpansionData + { + IOWorkLoop * fWorkLoop; + }; + IOSCSIProtocolInterfaceExpansionData * fIOSCSIProtocolInterfaceReserved; + + // ------ Power Management Support ------ + + thread_call_t fPowerManagementThread; + IOCommandGate * fCommandGate; + UInt32 fCurrentPowerState; + UInt32 fProposedPowerState; + bool fPowerTransitionInProgress; + bool fPowerAckInProgress; + bool fPowerManagementInitialized; + + /*! + @function GetCommandGate + @abstract Accessor method to obtain the IOCommandGate. + @discussion Accessor method to obtain the IOCommandGate. + @result The IOCommandGate for this instance. May return NULL. + */ + IOCommandGate * GetCommandGate ( void ); + + /*! + @function InitializePowerManagement + @abstract This method is called to initialize power management. + @discussion This method is called to initialize power management. It will call PMinit(), joinPMTree(), + setIdleTimerPeriod(), and makeUsable(). This method does not call registerPowerDriver(). + Subclasses may override this method to change the behavior (such as the number of power states). + @param provider The power management provider (i.e. the provider to attach to in the PowerManagement + tree). This may be a device that is not in the PM Tree itself, in which case, the IOService plane + is traversed towards the root node in an effort to find a node in the PM Tree. + */ + virtual void InitializePowerManagement ( IOService * provider ); + + /*! + @function GetInitialPowerState + @abstract This method is called to obtain the initial power state of the device (usually the highest). + @discussion This method is called to obtain the initial power state of the device (usually the highest). + Subclasses must override this method. + @result A power state ordinal. + */ + virtual UInt32 GetInitialPowerState ( void ) = 0; + + /*! + @function finalize + @abstract Finalizes the destruction of an IOService object. + @discussion See IOService.h + Subclasses may override this method, but should call super::finalize(). + @result true. + */ + virtual bool finalize ( IOOptionBits options ); + + /*! + @function sHandleSetPowerState + @abstract The sHandleSetPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sHandleSetPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param powerStateOrdinal The power state to which device shall be changed. + @result A valid IOReturn code indicating success or failure. + */ + static IOReturn sHandleSetPowerState ( IOSCSIProtocolInterface * self, UInt32 powerStateOrdinal ); + + /*! + @function sGetPowerTransistionInProgress + @abstract The sGetPowerTransistionInProgress method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sGetPowerTransistionInProgress method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @result true if a power state is in progress, otherwise false. + */ + static bool sGetPowerTransistionInProgress ( IOSCSIProtocolInterface * self ); + + /*! + @function HandleSetPowerState + @abstract The HandleSetPowerState method is called by the glue code and is on the + serialized side of the command gate. + @discussion The HandleSetPowerState method is called by the glue code and is on the + serialized side of the command gate. This allows us to touch any member + variables as necessary without any multi-threading issues. + Subclasses may override this method to change behavior. Third party subclasses + should not need to override this method, but may. + @param powerStateOrdinal The power state to which device shall be changed. + */ + virtual void HandleSetPowerState ( UInt32 powerStateOrdinal ); + + /*! + @function sPowerManagement + @abstract The sPowerManagement method is a static C-function which is called using + mach's thread_call API. It guarantees us a thread of execution which is + different than the power management thread and the workloop thread on which + we can issue commands to the device synchronously or asynchronously without + worrying about deadlocks. It calls through to HandlePowerChange, which is + a state machine used to direct power management. + @discussion The sPowerManagement method is a static C-function which is called using + mach's thread_call API. It guarantees us a thread of execution which is + different than the power management thread and the workloop thread on which + we can issue commands to the device synchronously or asynchronously without + worrying about deadlocks. It calls through to HandlePowerChange, which is + a state machine used to direct power management. + @param whichDevice The 'this' pointer. + */ + static void sPowerManagement ( thread_call_param_t whichDevice ); + + /*! + @function HandlePowerChange + @abstract The HandlePowerChange method is pure virtual and is left to each protocol or + application layer driver to implement. It is guaranteed to be called on its + own thread of execution and can make synchronous or asynchronous calls. + @discussion The HandlePowerChange method is pure virtual and is left to each protocol or + application layer driver to implement. It is guaranteed to be called on its + own thread of execution and can make synchronous or asynchronous calls. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void HandlePowerChange ( void ) = 0; + + /*! + @function sHandleCheckPowerState + @abstract The sHandleCheckPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sHandleCheckPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + */ + static void sHandleCheckPowerState ( IOSCSIProtocolInterface * self ); + + /*! + @function HandleCheckPowerState(void) + @abstract The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + @discussion The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void HandleCheckPowerState ( void ) = 0; + + /*! + @function HandleCheckPowerState(UInt32 maxPowerState) + @abstract The HandleCheckPowerState(UInt32 maxPowerState) method is called by + the subclasses and is passed the maxPowerState number given to the power + manager at initialization time. This guarantees the threads block until that + power state has been achieved. + @discussion The HandleCheckPowerState(UInt32 maxPowerState) method is called by + the subclasses and is passed the maxPowerState number given to the power + manager at initialization time. This guarantees the threads block until that + power state has been achieved. + @param maxPowerState The maximum power state in the power state array. + */ + void HandleCheckPowerState ( UInt32 maxPowerState ); + + /*! + @function TicklePowerManager(void) + @abstract The TicklePowerManager(void) method is called by CheckPowerState and + sends an activity tickle to the power manager so that the idle timer is + reset. + @discussion The TicklePowerManager(void) method is called by CheckPowerState and + sends an activity tickle to the power manager so that the idle timer is + reset. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void TicklePowerManager ( void ) = 0; + + /*! + @function TicklePowerManager(UInt32 maxPowerState) + @abstract The TicklePowerManager(UInt32 maxPowerState) method is a convenience + function which can be called by subclasses in TicklePowerManager (void) + in order to tell the power manager to reset idle timer or bring the device + into the requested state. It returns whatever is returned by activityTickle + (true if device is in the requested state, false if it is not). + @discussion The TicklePowerManager(UInt32 maxPowerState) method is a convenience + function which can be called by subclasses in TicklePowerManager(void) + in order to tell the power manager to reset idle timer or bring the device + into the requested state. It returns whatever is returned by activityTickle + (true if device is in the requested state, false if it is not). + @param maxPowerState The maximum power state in the power state array. + @result The result of the call to activityTickle(). See IOService.h for details. + */ + bool TicklePowerManager ( UInt32 maxPowerState ); + + // ------ User Client Support ------ + + bool fUserClientExclusiveControlled; + IOService * fUserClient; + + /*! + @function sGetUserClientExclusivityState + @abstract The sGetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sGetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param state A pointer to a bool in which the state should be set. + */ + static void sGetUserClientExclusivityState ( IOSCSIProtocolInterface * self, bool * state ); + + /*! + @function sSetUserClientExclusivityState + @abstract The sSetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sSetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param result A pointer to an IOReturn for the resulting status. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state A bool indicating the desired state to set. + */ + static void sSetUserClientExclusivityState ( IOSCSIProtocolInterface * self, IOReturn * result, IOService * userClient, bool state ); + + /*! + @function HandleGetUserClientExclusivityState + @abstract Gets the current exclusivity state of the user client. + @discussion The HandleGetUserClientExclusivityState() method is called on the serialized side + of the command gate to determine if any user client is holding exclusive access at the current + time. See discussion for GetUserClientExclusivityState(). + Subclasses may override this method to alter default behavior. Third party subclasses should + not need to override this method. + @result true if a user client is in exclusive control of the device, false otherwise. + */ + virtual bool HandleGetUserClientExclusivityState ( void ); + + /*! + @function HandleSetUserClientExclusivityState + @abstract Sets the current exclusivity state of the user client. + @discussion The HandleSetUserClientExclusivityState() method is called on the serialized side + of the command gate to set the exclusive access mode. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state Exclusivity state. true means exclusive access is desired, false + means exclusive access is being released. + @result A valid IOReturn code indicating success or the type of failure. + */ + virtual IOReturn HandleSetUserClientExclusivityState ( IOService * userClient, bool state ); + +public: + + // ------- SCSI Architecture Model Task Management Functions ------ + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 1 ); + /*! + @function AbortTask + @abstract Aborts a task based on the Logical Unit and tagged task identifier. + @discussion Aborts a task based on the Logical Unit and tagged task identifier. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @param theTag A valid SCSITaggedTaskIdentifier representing an outstanding SCSITask. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 2 ); + /*! + @function AbortTaskSet + @abstract Aborts a task set based on the Logical Unit. + @discussion Aborts a task set based on the Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 3 ); + /*! + @function ClearACA + @abstract Clears an Auto-Contingent Allegiance (ACA) for the specified Logical Unit. + @discussion Clears an Auto-Contingent Allegiance (ACA) for the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 4 ); + /*! + @function ClearTaskSet + @abstract Clears a task set for the specified Logical Unit. + @discussion Clears a task set for the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 5 ); + /*! + @function LogicalUnitReset + @abstract Resets the specified Logical Unit. + @discussion Resets the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 6 ); + + /*! + @function TargetReset + @abstract Resets the target device. + @discussion Resets the target device. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse TargetReset ( void ) = 0; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIProtocolServices.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIProtocolServices.h.svn-base new file mode 100644 index 0000000..6b9df79 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIProtocolServices.h.svn-base @@ -0,0 +1,362 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ +#define _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// Mach includes +#include + +// General IOKit headers +#include +#include + +// SCSI Architecture Model Family includes +#include +#include +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Power Management values +enum +{ + kSCSIProtocolLayerPowerStateOff = 0, + kSCSIProtocolLayerPowerStateOn = 1, + kSCSIProtocolLayerNumDefaultStates = 2 +}; + +// Forward definitions of internal use only classes +class SCSITask; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIProtocolServices : public IOSCSIProtocolInterface +{ + + OSDeclareAbstractStructors ( IOSCSIProtocolServices ) + +private: + + // The head pointer for the queue of waiting SCSI Tasks. + SCSITask * fSCSITaskQueueHead; /* OBSOLETE */ + + // This is the lock for preventing multiple access while + // manipulating the SCSI Task queue. + IOSimpleLock * fQueueLock; + + // The internal flag to indicate whether service requests should be + // executed or immediately errored, such as when a device is removed. + bool fAllowServiceRequests; + +protected: + + // Reserve space for future expansion. + struct IOSCSIProtocolServicesExpansionData + { + // For internal use only. Do not use. + UInt32 fSemaphore; + bool fRequiresAutosenseDescriptor; + SCSITaskCompletion fCompletionRoutine; + queue_head_t fTaskQueueHead; + queue_head_t fAutoSenseQueueHead; + }; + IOSCSIProtocolServicesExpansionData * fIOSCSIProtocolServicesReserved; + + // ---- Protocol transport methods overridden by each subclass ---- + + // Send a SCSI Command to the device. If the command was sent to the + // device and is pending completion, the subclass should return true and + // return back the kSCSIServiceResponse_Request_In_Process response. + // If the command completes immediately with an error, the subclass will + // return true and return back the appropriate status. + // if the subclass is currently processing all the commands it can, the + // subclass will return false and the command will be resent next time + // CommandCompleted is called. + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ) = 0; + + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ) = 0; + + // ---- Command completion notification method --------- + // Subclasses will call this inherited method when the command + // executed by SendSCSICommand has completed. + // The subclasses will return a service response that is derived + // from protocol specific status information and as specified in + // the specification for that protocol. + // If the service response is kSCSIServiceResponse_TASK_COMPLETE, + // the subclass will also return a SCSI status value. + void CommandCompleted ( SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + // ---- Utility methods for accessing SCSITask attributes ---- + // Method for retreiving the attribute for a task. + SCSITaskAttribute GetTaskAttribute ( SCSITaskIdentifier request ); + + bool SetTaskState ( SCSITaskIdentifier request, + SCSITaskState newTaskState ); + SCSITaskState GetTaskState ( SCSITaskIdentifier request ); + + UInt8 GetLogicalUnitNumber ( SCSITaskIdentifier request ); + + // Method to determine the size of the command descriptor block. + UInt8 GetCommandDescriptorBlockSize ( SCSITaskIdentifier request ); + + // This will always return the define max CDB size. If the Protocol Layer + // driver only supports a smaller size CDB, it will have to create a local + // SCSICommandDescriptorBlock variable to get the CDB data and then + // transfer the needed bytes from there. + bool GetCommandDescriptorBlock ( SCSITaskIdentifier request, + SCSICommandDescriptorBlock * cdbData ); + + // Get the transfer direction for the request. + UInt8 GetDataTransferDirection ( SCSITaskIdentifier request ); + + UInt64 GetRequestedDataTransferCount ( SCSITaskIdentifier request ); + + bool SetRealizedDataTransferCount ( SCSITaskIdentifier request, + UInt64 newRealizedDataCount ); + + UInt64 GetRealizedDataTransferCount ( SCSITaskIdentifier request ); + + IOMemoryDescriptor * GetDataBuffer ( SCSITaskIdentifier request ); + + UInt64 GetDataBufferOffset ( SCSITaskIdentifier request ); + + UInt32 GetTimeoutDuration ( SCSITaskIdentifier request ); + + UInt64 GetAutosenseRequestedDataTransferCount ( SCSITaskIdentifier request ); + + // Set the auto sense data that was returned for the SCSI Task. + // A return value of true indicates that the data was copied to the member + // sense data structure, false indicates that the data could not be copied. + bool SetAutoSenseData ( SCSITaskIdentifier request, + SCSI_Sense_Data * senseData ); // DEPRECATED, use the one on the line below. + + bool SetAutoSenseData ( SCSITaskIdentifier request, + SCSI_Sense_Data * senseData, + UInt8 senseDataSize ); + + void EnsureAutosenseDescriptorExists ( SCSITaskIdentifier request ); + + bool SetProtocolLayerReference ( + SCSITaskIdentifier request, + void * newReferenceValue ); + void * GetProtocolLayerReference ( SCSITaskIdentifier request ); + + + bool SetTaskExecutionMode ( + SCSITaskIdentifier request, + SCSITaskMode newTaskMode ); + SCSITaskMode GetTaskExecutionMode ( SCSITaskIdentifier request ); + + // ---- Method calls for messaging device connectedness ---- + void SendNotification_DeviceRemoved ( void ); + + void SendNotification_VerifyDeviceState ( void ); + + // -- SCSI Task Queue Management Methods -- + // Following are the commands used to manipulate the queue of pending SCSI Tasks. + + // Add the SCSI Task to the queue. The Task's Attribute determines where in + // the queue the Task is placed. + void AddSCSITaskToQueue ( SCSITaskIdentifier request ); + + // Add the SCSI Task to the head of the queue. This is used when the task + // has been removed from the head of the queue, but the subclass indicates + // that it can not yet process this task. + void AddSCSITaskToHeadOfQueue ( SCSITask * request ); + + // Remove the next SCSI Task for the queue and return it. + SCSITask * RetrieveNextSCSITaskFromQueue ( void ); + + // Check to see if the SCSI Task resides in the queue and abort it if it does. + bool AbortSCSITaskFromQueue ( SCSITask * request ); + + // Methods for sending and completing SCSI tasks + void SendSCSITasksFromQueue ( void ); + + void RejectSCSITasksCurrentlyQueued ( void ); + + void ProcessCompletedTask ( SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + void RejectTask ( SCSITaskIdentifier request ); + + // ------ Power Management Support ------ + + // The InitializePowerManagement method is called to initialize power management. + // In the protocol services layer, this method calls the protocol interface layer + // to initialize power management state variables and then registers the protocol + // layer driver with the power manager with two(2) states, ON and OFF. + virtual void InitializePowerManagement ( IOService * provider ); + + // The GetInitialPowerState method is called once, right after InitializePowerManagement() + // in order to determine what state the device is initially in at startup time (usually + // the highest power mode). + virtual UInt32 GetInitialPowerState ( void ); + + // The HandlePowerChange method is pure virtual and is left to each protocol or + // application layer driver to implement. It is guaranteed to be called on its + // own thread of execution and can make synchronous or asynchronous calls. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The TicklePowerManager ( void ) method is called by CheckPowerState and + // sends an activity tickle to the power manager so that the idle timer is + // reset. + virtual void TicklePowerManager ( void ); + + // The HandlePowerOff method is called to do any bus specific activity + // necessary before shutting down and going to sleep. + virtual IOReturn HandlePowerOff ( void ); + + // The HandlePowerOn method is called to do any bus specific activity + // necessary to recover from power-on/wake from sleep (e.g. bus reset on ATAPI) + virtual IOReturn HandlePowerOn ( void ); + +public: + + virtual bool start ( IOService * provider ); + virtual void free ( void ); + + void RegisterSCSITaskCompletionRoutine ( SCSITaskCompletion completion ); + + // ------- SCSI Architecture Model Task Management Functions ------ + // The ExecuteCommand method will take a SCSI Task and transport + // it across the physical wire(s) to the device + void ExecuteCommand ( SCSITaskIdentifier request ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ); + + SCSIServiceResponse TargetReset ( void ); + + // ************* Obsoleted Member Routine **************** + // The AbortCommand method is replaced by the AbortTask Management function and + // should no longer be called. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ); + + + // ---- Method used for determining protocol or physical interconnect characteristics. ---- + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ) = 0; + + // The HandleProtocolServiceFeature instructs the Protocol Services driver to perform the necessary + // tasks for the indicated feature. + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ) = 0; + +protected: + + // ----- Protocol Services Driver request handlers for Task Management functions ----- + // These should be abstract so that every Protocol Services Driver would have to + // override them, but since they are new member routines, this class will provide + // a default implementation. + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 1 ); + virtual SCSIServiceResponse HandleAbortTask ( + UInt8 theLogicalUnit, + SCSITaggedTaskIdentifier theTag ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 2 ); + virtual SCSIServiceResponse HandleAbortTaskSet ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 3 ); + virtual SCSIServiceResponse HandleClearACA ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 4 ); + virtual SCSIServiceResponse HandleClearTaskSet ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 5 ); + virtual SCSIServiceResponse HandleLogicalUnitReset ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 6 ); + // The HandleTargetReset member routine requests that the Protocol Services Driver + // perform the necessary steps detailed in the specification that defines the + // protocol the driver represents for the TargetReset management function. + virtual SCSIServiceResponse HandleTargetReset ( void ); + + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 7 ); + // The CreateSCSITargetDevice member routine will create the appropriate object + // to represent the Target portion of a SCSI Device. This object is responsible + // for managing the Target functions of the SCSI Device including the Task Manager and + // Logical Units. + // If the SCSITargetDevice object was successfully created, a true value will be + // returned, otherwisw, this will return false. + virtual bool CreateSCSITargetDevice ( void ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/IOSCSIReducedBlockCommandsDevice.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIReducedBlockCommandsDevice.h.svn-base new file mode 100644 index 0000000..955fd6e --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/IOSCSIReducedBlockCommandsDevice.h.svn-base @@ -0,0 +1,438 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include +#include + +// Generic IOKit storage related headers +#include + +// SCSI Architecture Model Family includes +#include + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +// RBC power states as defined in T10:1240D SCSI Reduced Block Commands (RBC) +// Revision 10a, August 18, 1999, page 13. +enum +{ + kRBCPowerStateSystemSleep = 0, + kRBCPowerStateSleep = 1, + kRBCPowerStateStandby = 2, + kRBCPowerStateIdle = 3, + kRBCPowerStateActive = 4, + kRBCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + +#define kCapacityDataBufferSize 8 + +// Forward declaration for the SCSIReducedBlockCommands that is used internally by the +// IOSCSIReducedBlockCommandsDevice class. +class SCSIReducedBlockCommands; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIReducedBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIReducedBlockCommandsDevice ); + +private: + +#ifndef __LP64__ + + SCSIReducedBlockCommands * fSCSIReducedBlockCommandObject; + SCSIReducedBlockCommands * GetSCSIReducedBlockCommandObject ( void ); + +#endif /* !__LP64__ */ + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIReducedBlockCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fMediumRemovalPrevented; + bool fKnownManualEject; + UInt32 fPollingMode; + bool fProtocolSpecificPowerControl; + }; + IOSCSIReducedBlockCommandsDeviceExpansionData * fIOSCSIReducedBlockCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIReducedBlockCommandsDeviceReserved->fPowerDownNotifier + #define fMediumRemovalPrevented fIOSCSIReducedBlockCommandsDeviceReserved->fMediumRemovalPrevented + #define fKnownManualEject fIOSCSIReducedBlockCommandsDeviceReserved->fKnownManualEject + #define fPollingMode fIOSCSIReducedBlockCommandsDeviceReserved->fPollingMode + #define fProtocolSpecificPowerControl fIOSCSIReducedBlockCommandsDeviceReserved->fProtocolSpecificPowerControl + + bool fMediaChanged; + bool fMediaPresent; + + // The byte count of each physical block on the media. + UInt32 fMediaBlockSize; + + // The total number of blocks of mediaBlockSize on the media. + UInt32 fMediaBlockCount; + + // Flags used to indicate device feature + bool fMediaIsRemovable; + bool fMediaIsWriteProtected; + + thread_call_t fPollingThread; + + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + virtual void PollForMedia ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + virtual void CheckWriteProtection ( void ); + virtual void SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount ); + virtual void ResetMediaCharacteristics ( void ); + virtual bool ClearNotReadyStatus ( void ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor* buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + +#ifndef __LP64__ + + // This method will retreive the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the subclasses base command set object. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + +#endif /* !__LP64__ */ + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ); + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ); + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // The TicklePowerManager method is called to tell the power manager that the + // device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ); + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The CheckMediaPresence method is called to see if the media which we + // anticipated being there is still there. + virtual bool CheckMediaPresence ( void ); + + virtual bool InitializeDeviceSupport ( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport ( void ); + virtual void ResumeDeviceSupport ( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport ( void ); + + virtual void free ( void ); + +#ifndef __LP64__ + + virtual bool CreateCommandSetObjects ( void ); + virtual void FreeCommandSetObjects ( void ); + +#endif /* !__LP64__ */ + +public: + + virtual IOReturn SyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn AsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + void * clientData ); + + + virtual IOReturn EjectTheMedia ( void ); + virtual IOReturn FormatMedia ( UInt64 byteCapacity ); + virtual UInt32 GetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + virtual IOReturn LockUnlockMedia ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + virtual IOReturn ReportBlockSize ( UInt64 * blockSize ); + virtual IOReturn ReportEjectability ( bool * isEjectable ); + virtual IOReturn ReportLockability ( bool * isLockable ); + virtual IOReturn ReportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + virtual IOReturn ReportMaxReadTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMaxValidBlock ( UInt64 * maxBlock ); + virtual IOReturn ReportMaxWriteTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMediaState ( bool * mediaPresent, + bool * changed ); + virtual IOReturn ReportRemovability ( bool * isRemovable ); + virtual IOReturn ReportWriteProtection ( bool * isWriteProtected ); + + static void sPollForMedia ( void * pdtDriver, void * refCon ); + + +protected: + + + // The FORMAT_UNIT command as defined in section 5.1 + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit PROGRESS, + SCSICmdField1Bit PERCENT_TIME, + SCSICmdField1Bit INCREMENT ); + + // The INQUIRY command as defined in SPC-2 w/o CONTROL byte + virtual bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CMDDT, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + // The MODE_SELECT(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool MODE_SELECT_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField1Byte PARAMETER_LIST_LENGTH ); + + // The MODE_SENSE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool MODE_SENSE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + // The PERSISTENT_RESERVE_IN command as defined in SPC-2 w/o CONTROL byte + virtual bool PERSISTENT_RESERVE_IN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField2Byte ALLOCATION_LENGTH ); + + // The PERSISTENT_RESERVE_OUT command as defined in SPC-2 w/o CONTROL byte + virtual bool PERSISTENT_RESERVE_OUT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Bit SCOPE, + SCSICmdField4Bit TYPE ); + + // The PREVENT_ALLOW_MEDIUM_REMOVAL command as defined in SPC-2 w/o CONTROL byte + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( + SCSITaskIdentifier request, + SCSICmdField2Bit PREVENT ); + + // The READ_10 command as defined in section 5.2 + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + // The READ_CAPACITY command as defined in section 5.3 + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer ); + + // The RELEASE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool RELEASE_6 ( + SCSITaskIdentifier request ); + + // The REQUEST_SENSE command as defined in SPC-2 w/o CONTROL byte + virtual bool REQUEST_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + // The RESERVE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool RESERVE_6 ( + SCSITaskIdentifier request ); + + // The START_STOP_UNIT command as defined in section 5.4 + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LEOJ, + SCSICmdField1Bit START ); + + // The SYNCRONIZE_CACHE command as defined in section 5.5 + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request ); + + // The TEST_UNIT_READY command as defined in SPC-2 w/o CONTROL byte + virtual bool TEST_UNIT_READY ( + SCSITaskIdentifier request ); + + // The VERIFY command as defined in section 5.7 + virtual bool VERIFY ( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH ); + + // The WRITE_10 command as defined in section 5.6 + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit FUA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + // The WRITE_BUFFER command as defined in SPC-2 w/o CONTROL byte + virtual bool WRITE_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte PARAMETER_LIST_LENGTH ); + + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 1 ); + +public: + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 2 ); + +protected: + + virtual void SetMediaIcon ( void ); + + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 3 ); + +protected: + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_INQUIRY_Definitions.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_INQUIRY_Definitions.h.svn-base new file mode 100644 index 0000000..55a6a4c --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_INQUIRY_Definitions.h.svn-base @@ -0,0 +1,923 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_INQUIRY_H_ +#define _IOKIT_SCSI_CMDS_INQUIRY_H_ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Inquiry Definitions + @discussion + This file contains all definitions for the data returned from + the INQUIRY (0x12) command. +*/ + + +/*! + * @enum Payload sizes + * @discussion + * Definitions for sizes related to the INQUIRY data. + * @constant kINQUIRY_StandardDataHeaderSize + * INQUIRY data header size. + * @constant kINQUIRY_MaximumDataSize + * Maximum size for INQUIRY data. +*/ +enum +{ + kINQUIRY_StandardDataHeaderSize = 5, + kINQUIRY_MaximumDataSize = 255 +}; + + +/*! +@enum INQUIRY field sizes +@discussion +Sizes for some of the inquiry data fields. +@constant kINQUIRY_VENDOR_IDENTIFICATION_Length +Size of VENDOR_IDENTIFICATION field. +@constant kINQUIRY_PRODUCT_IDENTIFICATION_Length +Size of PRODUCT_IDENTIFICATION field. +@constant kINQUIRY_PRODUCT_REVISION_LEVEL_Length +Size of PRODUCT_REVISION_LEVEL field. +*/ +enum +{ + kINQUIRY_VENDOR_IDENTIFICATION_Length = 8, + kINQUIRY_PRODUCT_IDENTIFICATION_Length = 16, + kINQUIRY_PRODUCT_REVISION_LEVEL_Length = 4 +}; + + +/*! +@struct SCSICmd_INQUIRY_StandardData +@discussion +This structure defines the format of the required standard data that is +returned for the INQUIRY command. This is the data that is required to +be returned from all devices. +*/ +typedef struct SCSICmd_INQUIRY_StandardData +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 RMB; // 7 = removable + UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. + UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. (SPC-3 obsoletes AERC) + // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. + UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data + UInt8 SCCSReserved; // SCC-2 device flag and reserved fields (SPC-3 adds PROTECT 3PC TPGS, and ACC) + UInt8 flags1; // First byte of support flags (See SPC-3 section 6.4.2) + UInt8 flags2; // Second byte of support flags (Byte 7) (See SPC-3 section 6.4.2) + char VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + char PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + char PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; +} SCSICmd_INQUIRY_StandardData; +typedef SCSICmd_INQUIRY_StandardData * SCSICmd_INQUIRY_StandardDataPtr; + + +/*! +@struct SCSICmd_INQUIRY_StandardDataAll +@discussion +This structure defines the all of the fields that can be returned in +repsonse to the INQUIRy request for the standard data. There is no +requirement as to how much of the additional data must be returned by a device. +*/ +typedef struct SCSICmd_INQUIRY_StandardDataAll +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 RMB; // 7 = removable + UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. + UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. + // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. + UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data + UInt8 SCCSReserved; // SCC-2 device flag and reserved fields + UInt8 flags1; // First byte of support flags (Byte 6) + UInt8 flags2; // Second byte of support flags (Byte 7) + char VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + char PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + char PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; + + // Following is the optional data that may be returned by a device. + UInt8 VendorSpecific1[20]; + UInt8 flags3; // Third byte of support flags, mainly SPI-3 (Byte 56) + UInt8 Reserved1; + UInt16 VERSION_DESCRIPTOR[8]; + UInt8 Reserved2[22]; + UInt8 VendorSpecific2[160]; +} SCSICmd_INQUIRY_StandardDataAll; + + +/*! +@enum Peripheral Qualifier +@discussion +Inquiry Peripheral Qualifier definitions +@constant kINQUIRY_PERIPHERAL_QUALIFIER_Connected +Peripheral Device is connected. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected +Peripheral Device is supported, but not connected. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported +Peripheral Device is not supported. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_Mask +Mask to use for PERIPHERAL_DEVICE_TYPE field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_QUALIFIER_Connected = 0x00, + kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected = 0x20, + kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported = 0x60, + kINQUIRY_PERIPHERAL_QUALIFIER_Mask = 0xE0 +}; + + +/*! +@enum Peripheral Device types +@discussion +Inquiry Peripheral Device type definitions +@constant kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice +Sequential Access (Tape) SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice +SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice +SPC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice +MMC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device +SCSI2 Device. +@constant kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice +SMC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice +Comms SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device +SCC2 Device. +@constant kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice +SES Device. +@constant kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice +RBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice +OCRW Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice +OSD device. +@constant kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface +Automation Drive Interface device. +@constant kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit +Well known logical unit. +@constant kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType +Unknown or no device. +@constant kINQUIRY_PERIPHERAL_TYPE_Mask +Mask to use for PERIPHERAL_DEVICE_TYPE field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice = 0x00, + kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice = 0x01, + kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice = 0x02, + kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice = 0x03, + kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice = 0x04, + kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice = 0x05, + kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device = 0x06, + kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice = 0x07, + kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice = 0x08, + kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice = 0x09, + /* 0x0A - 0x0B ASC IT8 Graphic Arts Prepress Devices */ + kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device = 0x0C, + kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice = 0x0D, + kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice = 0x0E, + kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice = 0x0F, + /* 0x10 - 0x1E Reserved Device Types */ + kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice = 0x11, + kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface = 0x12, + kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit = 0x1E, + kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType = 0x1F, + + + kINQUIRY_PERIPHERAL_TYPE_Mask = 0x1F +}; + + +/*! +@enum Removable Bit field definitions +@discussion +Inquiry Removable Bit field definitions +@constant kINQUIRY_PERIPHERAL_RMB_MediumFixed +Medium type is fixed disk. +@constant kINQUIRY_PERIPHERAL_RMB_MediumRemovable +Medium type is removable disk. +@constant kINQUIRY_PERIPHERAL_RMB_BitMask +Mask to use for RMB field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_RMB_MediumFixed = 0x00, + kINQUIRY_PERIPHERAL_RMB_MediumRemovable = 0x80, + kINQUIRY_PERIPHERAL_RMB_BitMask = 0x80 +}; + + +/*! +@enum Version field definitions +@discussion +Definitions for bits/masks in the INQUIRY Version field. +@constant kINQUIRY_ISO_IEC_VERSION_Mask +Mask for valid bits for ISO/IEC Version. +@constant kINQUIRY_ECMA_VERSION_Mask +Mask for valid bits for ECMA Version. +@constant kINQUIRY_ANSI_VERSION_NoClaimedConformance +No ANSI conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_1_Compliant +SCSI-1 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_2_Compliant +SCSI-2 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant +SPC conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant +SPC-2 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant +SPC-3 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_Mask +Mask for valid bits for ANSI Version. +*/ +enum +{ + kINQUIRY_ISO_IEC_VERSION_Mask = 0xC0, + + kINQUIRY_ECMA_VERSION_Mask = 0x38, + + kINQUIRY_ANSI_VERSION_NoClaimedConformance = 0x00, + kINQUIRY_ANSI_VERSION_SCSI_1_Compliant = 0x01, + kINQUIRY_ANSI_VERSION_SCSI_2_Compliant = 0x02, + kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant = 0x03, + kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant = 0x04, + kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant = 0x05, + kINQUIRY_ANSI_VERSION_Mask = 0x07 +}; + + +/*! +@enum Response Data Format field definitions +@discussion +Definitions for bits/masks in the INQUIRY RESPONSE_DATA_FORMAT field. +@constant kINQUIRY_Byte3_HISUP_Bit +HISUP bit definition. +@constant kINQUIRY_Byte3_NORMACA_Bit +NORMACA bit definition. +@constant kINQUIRY_Byte3_AERC_Bit +AERC bit definition. +@constant kINQUIRY_RESPONSE_DATA_FORMAT_Mask +Mask for valid bits for RESPONSE_DATA_FORMAT. +@constant kINQUIRY_Byte3_HISUP_Mask +Mask to use to test the HISUP bit. +@constant kINQUIRY_Byte3_NORMACA_Mask +Mask to use to test the NORMACA bit. +@constant kINQUIRY_Byte3_AERC_Mask +Mask to use to test the AERC bit. +*/ +enum +{ + // Bit definitions + // Bits 0-3: RESPONSE DATA FORMAT + kINQUIRY_Byte3_HISUP_Bit = 4, + kINQUIRY_Byte3_NORMACA_Bit = 5, + // Bit 6 is Obsolete + kINQUIRY_Byte3_AERC_Bit = 7, + + // Masks + kINQUIRY_RESPONSE_DATA_FORMAT_Mask = 0x0F, // Bits 0-3 + kINQUIRY_Byte3_HISUP_Mask = (1 << kINQUIRY_Byte3_HISUP_Bit), + kINQUIRY_Byte3_NORMACA_Mask = (1 << kINQUIRY_Byte3_NORMACA_Bit), + // Bit 6 is Obsolete + kINQUIRY_Byte3_AERC_Mask = (1 << kINQUIRY_Byte3_AERC_Bit) +}; + + +/*! +@enum SCCS field definitions +@discussion +Definitions for bits/masks in the INQUIRY SCCSReserved field. +@constant kINQUIRY_Byte5_SCCS_Bit +SCCS bit definition. +@constant kINQUIRY_Byte5_ACC_Bit +ACC bit definition. +@constant kINQUIRY_Byte5_3PC_Bit +3PC bit definition. +@constant kINQUIRY_Byte5_PROTECT_Bit +PROTECT bit definition. +@constant kINQUIRY_Byte5_SCCS_Mask +Mask to use to test the SCCS bit. +@constant kINQUIRY_Byte5_ACC_Mask +Mask to use to test the ACC bit. +@constant kINQUIRY_Byte5_TPGS_Mask +Mask to use for the TPGS bits. +@constant kINQUIRY_Byte5_3PC_Mask +Mask to use to test the 3PC bit. +@constant kINQUIRY_Byte5_PROTECT_Mask +Mask to use to test the PROTECT bit. +*/ +enum +{ + // Bit definitions + kINQUIRY_Byte5_SCCS_Bit = 7, + kINQUIRY_Byte5_ACC_Bit = 6, + // Bits 4-5: TPGS + kINQUIRY_Byte5_3PC_Bit = 3, + // Bits 1-2: Reserved + kINQUIRY_Byte5_PROTECT_Bit = 0, + + // Masks + kINQUIRY_Byte5_SCCS_Mask = (1 << kINQUIRY_Byte5_SCCS_Bit), + kINQUIRY_Byte5_ACC_Mask = (1 << kINQUIRY_Byte5_ACC_Bit), + kINQUIRY_Byte5_TPGS_Mask = 0x18, + kINQUIRY_Byte5_3PC_Mask = (1 << kINQUIRY_Byte5_3PC_Bit), + // Bits 1-2: Reserved + kINQUIRY_Byte5_PROTECT_Mask = (1 << kINQUIRY_Byte5_PROTECT_Bit) +}; + + +/*! +@enum flags1 field definitions +@discussion +Definitions for bits/masks in the INQUIRY flags1 field. +@constant kINQUIRY_Byte6_ADDR16_Bit +ADDR16 bit definition. +@constant kINQUIRY_Byte6_MCHNGR_Bit +MCHNGR bit definition. +@constant kINQUIRY_Byte6_MULTIP_Bit +MULTIP bit definition. +@constant kINQUIRY_Byte6_VS_Bit +VS bit definition. +@constant kINQUIRY_Byte6_ENCSERV_Bit +ENCSERV bit definition. +@constant kINQUIRY_Byte6_BQUE_Bit +BQUE bit definition. +@constant kINQUIRY_Byte6_ADDR16_Mask +Mask to use to test the ADDR16 bit. +@constant kINQUIRY_Byte6_MCHNGR_Mask +Mask to use to test the MCHNGR bit. +@constant kINQUIRY_Byte6_MULTIP_Mask +Mask to use to test the MULTIP bit. +@constant kINQUIRY_Byte6_VS_Mask +Mask to use to test the VS bit. +@constant kINQUIRY_Byte6_ENCSERV_Mask +Mask to use to test the ENCSERV bit. +@constant kINQUIRY_Byte6_BQUE_Mask +Mask to use to test the BQUE bit. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte6_Offset = 6, + + // Bit definitions + kINQUIRY_Byte6_ADDR16_Bit = 0, // SPI Specific + // Bit 1 is Obsolete + // Bit 2 is Obsolete + kINQUIRY_Byte6_MCHNGR_Bit = 3, + kINQUIRY_Byte6_MULTIP_Bit = 4, + kINQUIRY_Byte6_VS_Bit = 5, + kINQUIRY_Byte6_ENCSERV_Bit = 6, + kINQUIRY_Byte6_BQUE_Bit = 7, + + // Masks + kINQUIRY_Byte6_ADDR16_Mask = (1 << kINQUIRY_Byte6_ADDR16_Bit), // SPI Specific + // Bit 1 is Obsolete + // Bit 2 is Obsolete + kINQUIRY_Byte6_MCHNGR_Mask = (1 << kINQUIRY_Byte6_MCHNGR_Bit), + kINQUIRY_Byte6_MULTIP_Mask = (1 << kINQUIRY_Byte6_MULTIP_Bit), + kINQUIRY_Byte6_VS_Mask = (1 << kINQUIRY_Byte6_VS_Bit), + kINQUIRY_Byte6_ENCSERV_Mask = (1 << kINQUIRY_Byte6_ENCSERV_Bit), + kINQUIRY_Byte6_BQUE_Mask = (1 << kINQUIRY_Byte6_BQUE_Bit) +}; + + +/*! +@enum flags2 field definitions +@discussion +Definitions for bits/masks in the INQUIRY flags2 field. +@constant kINQUIRY_Byte7_VS_Bit +VS bit definition. +@constant kINQUIRY_Byte7_CMDQUE_Bit +CMDQUE bit definition. +@constant kINQUIRY_Byte7_TRANDIS_Bit +TRANDIS bit definition. +@constant kINQUIRY_Byte7_LINKED_Bit +LINKED bit definition. +@constant kINQUIRY_Byte7_SYNC_Bit +SYNC bit definition. +@constant kINQUIRY_Byte7_WBUS16_Bit +WBUS16 bit definition. +@constant kINQUIRY_Byte7_RELADR_Bit +RELADR bit definition. +@constant kINQUIRY_Byte7_VS_Mask +Mask to use to test the VS bit. +@constant kINQUIRY_Byte7_CMDQUE_Mask +Mask to use to test the CMDQUE bit. +@constant kINQUIRY_Byte7_TRANDIS_Mask +Mask to use to test the TRANDIS bit. +@constant kINQUIRY_Byte7_LINKED_Mask +Mask to use to test the LINKED bit. +@constant kINQUIRY_Byte7_SYNC_Mask +Mask to use to test the SYNC bit. +@constant kINQUIRY_Byte7_WBUS16_Mask +Mask to use to test the WBUS16 bit. +@constant kINQUIRY_Byte7_RELADR_Mask +Mask to use to test the RELADR bit. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte7_Offset = 7, + + // Bit definitions + kINQUIRY_Byte7_VS_Bit = 0, + kINQUIRY_Byte7_CMDQUE_Bit = 1, + kINQUIRY_Byte7_TRANDIS_Bit = 2, // SPI Specific + kINQUIRY_Byte7_LINKED_Bit = 3, + kINQUIRY_Byte7_SYNC_Bit = 4, // SPI Specific + kINQUIRY_Byte7_WBUS16_Bit = 5, // SPI Specific + // Bit 6 is Obsolete + kINQUIRY_Byte7_RELADR_Bit = 7, + + // Masks + kINQUIRY_Byte7_VS_Mask = (1 << kINQUIRY_Byte7_VS_Bit), + kINQUIRY_Byte7_CMDQUE_Mask = (1 << kINQUIRY_Byte7_CMDQUE_Bit), + kINQUIRY_Byte7_TRANDIS_Mask = (1 << kINQUIRY_Byte7_TRANDIS_Bit),// SPI Specific + kINQUIRY_Byte7_LINKED_Mask = (1 << kINQUIRY_Byte7_LINKED_Bit), + kINQUIRY_Byte7_SYNC_Mask = (1 << kINQUIRY_Byte7_SYNC_Bit), // SPI Specific + kINQUIRY_Byte7_WBUS16_Mask = (1 << kINQUIRY_Byte7_WBUS16_Bit), // SPI Specific + // Bit 6 is Obsolete + kINQUIRY_Byte7_RELADR_Mask = (1 << kINQUIRY_Byte7_RELADR_Bit) +}; + + +/*! +@enum Byte 56 features field definitions +@discussion +Definitions for bits/masks in the INQUIRY Byte 56 field. +Inquiry Byte 56 features (for devices that report an ANSI VERSION of +kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant or later). +These are SPI-3 Specific. +@constant kINQUIRY_Byte56_IUS_Bit +IUS bit definition. +@constant kINQUIRY_Byte56_QAS_Bit +QAS bit definition. +@constant kINQUIRY_Byte56_IUS_Mask +Mask to use to test the IUS bit. +@constant kINQUIRY_Byte56_QAS_Mask +Mask to use to test the QAS bit. +@constant kINQUIRY_Byte56_CLOCKING_Mask +Mask to use to test CLOCKING bits. +@constant kINQUIRY_Byte56_CLOCKING_ONLY_ST +Single-transition clocking only. +@constant kINQUIRY_Byte56_CLOCKING_ONLY_DT +Double-transition clocking only. +@constant kINQUIRY_Byte56_CLOCKING_ST_AND_DT +Single-transition and double-transition clocking. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte56_Offset = 56, + + // Bit definitions + kINQUIRY_Byte56_IUS_Bit = 0, + kINQUIRY_Byte56_QAS_Bit = 1, + // Bits 2 and 3 are the CLOCKING bits + // All other bits are reserved + + kINQUIRY_Byte56_IUS_Mask = (1 << kINQUIRY_Byte56_IUS_Bit), + kINQUIRY_Byte56_QAS_Mask = (1 << kINQUIRY_Byte56_QAS_Bit), + kINQUIRY_Byte56_CLOCKING_Mask = 0x0C, + + // Definitions for the CLOCKING bits + kINQUIRY_Byte56_CLOCKING_ONLY_ST = 0x00, + kINQUIRY_Byte56_CLOCKING_ONLY_DT = 0x04, + // kINQUIRY_Byte56_CLOCKING_RESERVED = 0x08, + kINQUIRY_Byte56_CLOCKING_ST_AND_DT = 0x0C +}; + + +/*! +@define kINQUIRY_VERSION_DESCRIPTOR_MaxCount +Maximum number of INQUIRY version descriptors supported. +*/ +#define kINQUIRY_VERSION_DESCRIPTOR_MaxCount 8 + + +/*! +@enum kINQUIRY_VERSION_DESCRIPTOR_SAT +SAT specification version descriptor. +*/ +enum +{ + kINQUIRY_VERSION_DESCRIPTOR_SAT = 0x1EA0 +}; + + +/* +IORegistry property names for information derived from the Inquiry data. +The Peripheral Device Type is the only property that the +generic Logical Unit Drivers will use to match. These properties are +listed in order of matching priority. First is the Peripheral Device Type. +Second is the Vendor Identification. Third is the Product Identification. +Last is the Product Revision Level. To match a particular product, you would +specify the Peripheral Device Type, Vendor Identification, and Product +Identification. To restrict the match to a particular firmware revision, you +would add the Product Revision Level. To not match on a particular product, +but on a particular vendor's products, you would only include the +Peripheral Device Type and the Vendor Identification. +*/ + +/*! +@define kIOPropertySCSIPeripheralDeviceType +SCSI Peripheral Device Type as reported in the INQUIRY data. +*/ +#define kIOPropertySCSIPeripheralDeviceType "Peripheral Device Type" + +/*! +@define kIOPropertySCSIPeripheralDeviceTypeSize +Size of the kIOPropertySCSIPeripheralDeviceType key. +*/ +#define kIOPropertySCSIPeripheralDeviceTypeSize 8 + +/* These properties are listed in order of matching priority */ + +/*! +@define kIOPropertySCSIVendorIdentification +Vendor ID as reported in the INQUIRY data. Additional space characters (0x20) +are truncated. +*/ +#define kIOPropertySCSIVendorIdentification "Vendor Identification" + +/*! +@define kIOPropertySCSIProductIdentification +Product ID as reported in the INQUIRY data. Additional space characters (0x20) +are truncated. +*/ +#define kIOPropertySCSIProductIdentification "Product Identification" + +/*! +@define kIOPropertySCSIProductRevisionLevel +Product Revision Level as reported in the INQUIRY data. +*/ +#define kIOPropertySCSIProductRevisionLevel "Product Revision Level" + + +/*! +@enum INQUIRY Page Codes +@discussion INQUIRY Page Codes to be used when EVPD is set in the +INQUIRY command. +@constant kINQUIRY_Page00_PageCode +Page Code 00h. +@constant kINQUIRY_Page80_PageCode +Page Code 80h. +@constant kINQUIRY_Page83_PageCode +Page Code 83h. +@constant kINQUIRY_Page89_PageCode +Page Code 89h. +*/ +enum +{ + kINQUIRY_Page00_PageCode = 0x00, + kINQUIRY_Page80_PageCode = 0x80, + kINQUIRY_Page83_PageCode = 0x83, + kINQUIRY_Page89_PageCode = 0x89 +}; + + +/*! +@struct SCSICmd_INQUIRY_Page00_Header +@discussion INQUIRY Page 00h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page00_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 00h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page00_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page80_Header +@discussion INQUIRY Page 80h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page80_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 80h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes + UInt8 PRODUCT_SERIAL_NUMBER; // 4-n +} SCSICmd_INQUIRY_Page80_Header; + + +/*! +@define kIOPropertySCSIINQUIRYUnitSerialNumber +Key that describes the INQUIRY Unit Serial Number in the IORegistry. +*/ +#define kIOPropertySCSIINQUIRYUnitSerialNumber "INQUIRY Unit Serial Number" + + +/*! +@struct SCSICmd_INQUIRY_Page83_Header +@discussion INQUIRY Page 83h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 83h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page83_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page83_Header_SPC_16 +@discussion INQUIRY Page 83h Header used with the 16 byte INQUIRY command. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Header_SPC_16 +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 83h + UInt16 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page83_Header_SPC_16; + + +/*! +@struct SCSICmd_INQUIRY_Page83_Identification_Descriptor +@discussion INQUIRY Page 83h Identification Descriptor. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Identification_Descriptor +{ + UInt8 CODE_SET; // 7-4 = Protocol Identifier. 3-0 = Code Set + UInt8 IDENTIFIER_TYPE; // 7 = PIV 5-4 = ASSOCIATION 3-0 = Identifier + UInt8 RESERVED; + UInt8 IDENTIFIER_LENGTH; + UInt8 IDENTIFIER; +} SCSICmd_INQUIRY_Page83_Identification_Descriptor; + + +/*! +@enum INQUIRY Page 83h Code Set +@discussion +Definitions for the Code Set field. +@constant kINQUIRY_Page83_CodeSetBinaryData +The identifier contains binary data. +@constant kINQUIRY_Page83_CodeSetASCIIData +The identifier contains ASCII data. +@constant kINQUIRY_Page83_CodeSetUTF8Data +The identifier contains UTF-8 data. +*/ +enum +{ + kINQUIRY_Page83_CodeSetReserved = 0x0, + kINQUIRY_Page83_CodeSetBinaryData = 0x1, + kINQUIRY_Page83_CodeSetASCIIData = 0x2, + kINQUIRY_Page83_CodeSetUTF8Data = 0x3, + // 0x4 - 0xF reserved + kINQUIRY_Page83_CodeSetMask = 0xF +}; + + +/*! +@enum INQUIRY Page 83h Association +@discussion +Definitions for the Association field. +@constant kINQUIRY_Page83_AssociationLogicalUnit +Association of the identifier is with the logical unit. +@constant kINQUIRY_Page83_AssociationDevice +Association of the identifier is with the device (same as logical unit in SPC-2). +@constant kINQUIRY_Page83_AssociationTargetPort +Association of the identifier is with the target port. +@constant kINQUIRY_Page83_AssociationTargetDevice +Association of the identifier is with the target device (i.e. all ports). +@constant kINQUIRY_Page83_AssociationMask +Mask to use to determine association. +*/ +enum +{ + // SPC-3 - Association is changed to be specific to + // Logical Units + kINQUIRY_Page83_AssociationLogicalUnit = 0x00, + + // Backwards compatibility for SPC-2 + kINQUIRY_Page83_AssociationDevice = kINQUIRY_Page83_AssociationLogicalUnit, + + // Association is related to a Target Port + kINQUIRY_Page83_AssociationTargetPort = 0x10, + + // SPC-3 - Added as specific association to + // a Target device. + kINQUIRY_Page83_AssociationTargetDevice = 0x20, + + kINQUIRY_Page83_AssociationMask = 0x30 +}; + + +/*! +@enum INQUIRY Page 83h Identifier Type +@discussion +Definitions for the Identifier Type field. +@constant kINQUIRY_Page83_IdentifierTypeUndefined +Undefined Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeVendorID +Vendor Specific Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 +EUI-64 Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeNAAIdentifier +NAA Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier +Relative Target Port Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeTargetPortGroup +Target Port Group Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup +Logical Unit Group Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier +MD5 Logical Unit Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeSCSINameString +SCSI Name String Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeMask +Mask to use to determine association. +@constant kINQUIRY_Page83_ProtocolIdentifierValidBit +PIV Bit definition. +@constant kINQUIRY_Page83_ProtocolIdentifierValidMask +Mask to use to determine if PIV is set. +*/ +enum +{ + kINQUIRY_Page83_IdentifierTypeUndefined = 0, + kINQUIRY_Page83_IdentifierTypeVendorID = 1, + kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 = 2, + kINQUIRY_Page83_IdentifierTypeNAAIdentifier = 3, + kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier = 4, + kINQUIRY_Page83_IdentifierTypeTargetPortGroup = 5, + kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup = 6, + kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier = 7, + kINQUIRY_Page83_IdentifierTypeSCSINameString = 8, + // 0x9 - 0xF Reserved + + kINQUIRY_Page83_IdentifierTypeMask = 0xF, + + kINQUIRY_Page83_ProtocolIdentifierValidBit = 7, + kINQUIRY_Page83_ProtocolIdentifierValidMask = (1 << kINQUIRY_Page83_ProtocolIdentifierValidBit) + +}; + +// Backwards compatibility +#define kINQUIRY_Page83_IdentifierTypeFCNameIdentifier kINQUIRY_Page83_IdentifierTypeNAAIdentifier + + +/*! +@enum Protocol Identifier values +@discussion +Definitions for the protocol identifier values. +@constant kSCSIProtocolIdentifier_FibreChannel +FibreChannel Protocol Identifier. +@constant kSCSIProtocolIdentifier_ParallelSCSI +Parallel SCSI Protocol Identifier. +@constant kSCSIProtocolIdentifier_SSA +SSA Protocol Identifier. +@constant kSCSIProtocolIdentifier_FireWire +FireWire (IEEE-1394) Protocol Identifier. +@constant kSCSIProtocolIdentifier_RDMA +RDMA Protocol Identifier. +@constant kSCSIProtocolIdentifier_iSCSI +iSCSI Protocol Identifier. +@constant kSCSIProtocolIdentifier_SAS +SAS Protocol Identifier. +@constant kSCSIProtocolIdentifier_ADT +ADT Protocol Identifier. +@constant kSCSIProtocolIdentifier_ATAPI +ATAPI Protocol Identifier. +@constant kSCSIProtocolIdentifier_None +No Protocol Identifier. +*/ +enum +{ + kSCSIProtocolIdentifier_FibreChannel = 0, + kSCSIProtocolIdentifier_ParallelSCSI = 1, + kSCSIProtocolIdentifier_SSA = 2, + kSCSIProtocolIdentifier_FireWire = 3, + kSCSIProtocolIdentifier_RDMA = 4, + kSCSIProtocolIdentifier_iSCSI = 5, + kSCSIProtocolIdentifier_SAS = 6, + kSCSIProtocolIdentifier_ADT = 7, + kSCSIProtocolIdentifier_ATAPI = 8, + // 0x9-0xE Reserved + kSCSIProtocolIdentifier_None = 0xF +}; + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdentification +Device Identification key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdentification "INQUIRY Device Identification" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdCodeSet +Code Set type key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdCodeSet "Code Set" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdType +Identifier Type key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdType "Identifier Type" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdAssociation +Association key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdAssociation "Association" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdentifier +Identifier key (data or string). +*/ +#define kIOPropertySCSIINQUIRYDeviceIdentifier "Identifier" + + +/*! +@struct SCSICmd_INQUIRY_Page89_Data +@discussion INQUIRY Page 89h data as defined in the SAT 1.0 +specification. This section contians all structures and +definitions used by the INQUIRY command in response to a request +for page 89h - ATA information VPD Page. +*/ +typedef struct SCSICmd_INQUIRY_Page89_Data +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 89h + UInt16 PAGE_LENGTH; // Must be equal to 238h + UInt32 Reserved; + UInt8 SAT_VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + UInt8 SAT_PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + UInt8 SAT_PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; + UInt8 ATA_DEVICE_SIGNATURE[20]; + UInt8 COMMAND_CODE; + UInt8 Reserved2[3]; + UInt8 IDENTIFY_DATA[512]; +} SCSICmd_INQUIRY_Page89_Data; + + +/*! +@define kIOPropertySATVendorIdentification +Vendor Identification of the SATL. +*/ +#define kIOPropertySATVendorIdentification "SAT Vendor Identification" + + +/*! +@define kIOPropertySATProductIdentification +Product Identification of the SATL. +*/ +#define kIOPropertySATProductIdentification "SAT Product Identification" + + +/*! +@define kIOPropertySATProductRevisonLevel +Product Revision Level of the SATL. +*/ +#define kIOPropertySATProductRevisonLevel "SAT Product Revision Level" + + +#endif /* _IOKIT_SCSI_CMDS_INQUIRY_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_MODE_Definitions.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_MODE_Definitions.h.svn-base new file mode 100644 index 0000000..8d9c250 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_MODE_Definitions.h.svn-base @@ -0,0 +1,559 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ +#define _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the MODE_SENSE_6 and MODE_SENSE_10 commands. +*/ + +#pragma pack(1) + +/*! +@struct SPCModeParameterHeader6 +@discussion +Mode Parameter Header for the MODE_SENSE_6 command. +*/ +typedef struct SPCModeParameterHeader6 +{ + UInt8 MODE_DATA_LENGTH; + UInt8 MEDIUM_TYPE; + UInt8 DEVICE_SPECIFIC_PARAMETER; + UInt8 BLOCK_DESCRIPTOR_LENGTH; +} SPCModeParameterHeader6; + + +/*! +@struct SPCModeParameterHeader10 +@discussion +Mode Parameter Header for the MODE_SENSE_10 command. +*/ +typedef struct SPCModeParameterHeader10 +{ + UInt16 MODE_DATA_LENGTH; + UInt8 MEDIUM_TYPE; + UInt8 DEVICE_SPECIFIC_PARAMETER; + UInt8 LONGLBA; + UInt8 RESERVED; + UInt16 BLOCK_DESCRIPTOR_LENGTH; +} SPCModeParameterHeader10; + + +/*! +@enum Long LBA Bitfield definitions +@discussion +Long LBA Bitfield definitions for Mode Parameter Header +for MODE_SENSE_10 command. +@constant kModeSenseParameterHeader10_LongLBABit +Bit to indicate Long LBA block descriptors follow. +@constant kModeSenseParameterHeader10_LongLBAMask +Mask to test for kModeSenseParameterHeader10_LongLBABit. +*/ +enum +{ + kModeSenseParameterHeader10_LongLBABit = 0, + kModeSenseParameterHeader10_LongLBAMask = (1 << kModeSenseParameterHeader10_LongLBABit), +}; + + +/*! +@enum Device Specific Parameter Bitfield definitions +@discussion +SBC definitions for Device Specific Parameter in the +Mode Sense Header Block. +@constant kModeSenseSBCDeviceSpecific_DPOFUABit +Bit to indicate DPO and FUA bits are accepted by the device server. +@constant kModeSenseSBCDeviceSpecific_WriteProtectBit +Bit to indicate medium is write protected. +@constant kModeSenseSBCDeviceSpecific_DPOFUAMask +Mask to test for kModeSenseSBCDeviceSpecific_DPOFUABit. +@constant kModeSenseSBCDeviceSpecific_WriteProtectMask +Mask to test for kModeSenseSBCDeviceSpecific_WriteProtectBit. +*/ +enum +{ + kModeSenseSBCDeviceSpecific_DPOFUABit = 4, + kModeSenseSBCDeviceSpecific_WriteProtectBit = 7, + kModeSenseSBCDeviceSpecific_DPOFUAMask = (1 << kModeSenseSBCDeviceSpecific_DPOFUABit), + kModeSenseSBCDeviceSpecific_WriteProtectMask = (1 << kModeSenseSBCDeviceSpecific_WriteProtectBit) +}; + + +/*! +@struct ModeParameterBlockDescriptor +@discussion +General mode parameter block descriptor. +*/ +typedef struct ModeParameterBlockDescriptor +{ + UInt8 DENSITY_CODE; + UInt8 NUMBER_OF_BLOCKS[3]; + UInt8 RESERVED; + UInt8 BLOCK_LENGTH[3]; +} ModeParameterBlockDescriptor; + + +/*! +@struct DASDModeParameterBlockDescriptor +@discussion +Direct Access Storage Device mode parameter block descriptor. +*/ +typedef struct DASDModeParameterBlockDescriptor +{ + UInt32 NUMBER_OF_BLOCKS; + UInt8 DENSITY_CODE; + UInt8 BLOCK_LENGTH[3]; +} DASDModeParameterBlockDescriptor; + + +/*! +@struct LongLBAModeParameterBlockDescriptor +@discussion +Long LBA mode parameter block descriptor. +*/ +typedef struct LongLBAModeParameterBlockDescriptor +{ + UInt64 NUMBER_OF_BLOCKS; + UInt8 DENSITY_CODE; + UInt8 RESERVED[3]; + UInt32 BLOCK_LENGTH; +} LongLBAModeParameterBlockDescriptor; + + +/*! +@struct ModePageFormatHeader +@discussion +Mode Page format header. +*/ +typedef struct ModePageFormatHeader +{ + UInt8 PS_PAGE_CODE; + UInt8 PAGE_LENGTH; +} ModePageFormatHeader; + + +/*! +@enum Mode Page Format bit definitions +@discussion +Mode Page Format bit definitions. +@constant kModePageFormat_PS_Bit +Bit to indicate Parameters Saveable. +@constant kModePageFormat_PAGE_CODE_Mask +Mask to obtain the PAGE_CODE from the PS_PAGE_CODE field. +@constant kModePageFormat_PS_Mask +Mask to test for kModePageFormat_PS_Bit. +*/ +enum +{ + kModePageFormat_PS_Bit = 7, + + kModePageFormat_PAGE_CODE_Mask = 0x3F, + kModePageFormat_PS_Mask = (1 << kModePageFormat_PS_Bit) +}; + + +#if 0 +#pragma mark - +#pragma mark SPC Mode Pages +#pragma mark - +#endif + + +/*! +@enum SPC Mode Pages +@discussion +SPC Mode Page definitions. +@constant kSPCModePagePowerConditionCode +Power Conditions Mode Page value. +@constant kSPCModePageAllPagesCode +All Mode Pages value. +*/ +enum +{ + kSPCModePagePowerConditionCode = 0x1A, + kSPCModePageAllPagesCode = 0x3F +}; + +/*! +@struct SPCModePagePowerCondition +@discussion +Power Conditions Mode Page (PAGE CODE 0x1A) format. +*/ +typedef struct SPCModePagePowerCondition +{ + ModePageFormatHeader header; + UInt8 RESERVED; + UInt8 IDLE_STANDBY; + UInt32 IDLE_CONDITION_TIMER; + UInt32 STANDBY_CONDITION_TIMER; +} SPCModePagePowerCondition; + + +#if 0 +#pragma mark - +#pragma mark 0x00 SBC Direct Access Mode Pages +#pragma mark - +#endif + + +/*! +@enum SBC Mode Pages +@discussion +SBC Mode Page definitions. +@constant kSBCModePageFormatDeviceCode +Format Device Mode Page value. +@constant kSBCModePageRigidDiskGeometryCode +Rigid Disk Geometry Page value. +@constant kSBCModePageFlexibleDiskCode +Flexible Disk Page value. +@constant kSBCModePageCachingCode +Caching Page value. +*/ +enum +{ + kSBCModePageFormatDeviceCode = 0x03, + kSBCModePageRigidDiskGeometryCode = 0x04, + kSBCModePageFlexibleDiskCode = 0x05, + kSBCModePageCachingCode = 0x08 +}; + + +/*! +@struct SBCModePageFormatDevice +@discussion +Format Device Mode Page (PAGE CODE 0x03) format. +*/ +typedef struct SBCModePageFormatDevice +{ + ModePageFormatHeader header; + UInt16 TRACKS_PER_ZONE; + UInt16 ALTERNATE_SECTORS_PER_ZONE; + UInt16 ALTERNATE_TRACKS_PER_ZONE; + UInt16 ALTERNATE_TRACKS_PER_LOGICAL_UNIT; + UInt16 SECTORS_PER_TRACK; + UInt16 DATA_BYTES_PER_PHYSICAL_SECTOR; + UInt16 INTERLEAVE; + UInt16 TRACK_SKEW_FACTOR; + UInt16 CYLINDER_SKEW_FACTOR; + UInt8 SSEC_HSEC_RMB_SURF; + UInt8 RESERVED[3]; +} SBCModePageFormatDevice; + + +/*! +@struct SBCModePageRigidDiskGeometry +@discussion +Rigid Disk Geometry Mode Page (PAGE CODE 0x04) format. +*/ +typedef struct SBCModePageRigidDiskGeometry +{ + ModePageFormatHeader header; + UInt8 NUMBER_OF_CYLINDERS[3]; + UInt8 NUMBER_OF_HEADS; + UInt8 STARTING_CYLINDER_WRITE_PRECOMPENSATION[3]; + UInt8 STARTING_CYLINDER_REDUCED_WRITE_CURRENT[3]; + UInt16 DEVICE_STEP_RATE; + UInt8 LANDING_ZONE_CYLINDER[3]; + UInt8 RPL; + UInt8 ROTATIONAL_OFFSET; + UInt8 RESERVED; + UInt16 MEDIUM_ROTATION_RATE; + UInt8 RESERVED1[2]; +} SBCModePageRigidDiskGeometry; + + +/*! +@enum Rigid Disk Geometry bitfields +@discussion +Bit field masks for Rigid Disk Geometry structure fields. +@constant kSBCModePageRigidDiskGeometry_RPL_Mask +Mask for use with the RPL field. +*/ +enum +{ + kSBCModePageRigidDiskGeometry_RPL_Mask = 0x03 +}; + + +/*! +@struct SBCModePageFlexibleDisk +@discussion +Flexible Disk Mode Page (PAGE CODE 0x05) format. +*/ +typedef struct SBCModePageFlexibleDisk +{ + ModePageFormatHeader header; + UInt16 TRANSFER_RATE; + UInt8 NUMBER_OF_HEADS; + UInt8 SECTORS_PER_TRACK; + UInt16 DATA_BYTES_PER_SECTOR; + UInt16 NUMBER_OF_CYLINDERS; + UInt16 STARTING_CYLINDER_WRITE_PRECOMPENSATION; + UInt16 STARTING_CYLINDER_REDUCED_WRITE_CURRENT; + UInt16 DEVICE_STEP_RATE; + UInt8 DEVICE_STEP_PULSE_WIDTH; + UInt16 HEAD_SETTLE_DELAY; + UInt8 MOTOR_ON_DELAY; + UInt8 MOTOR_OFF_DELAY; + UInt8 TRDY_SSN_MO; + UInt8 SPC; + UInt8 WRITE_COMPENSATION; + UInt8 HEAD_LOAD_DELAY; + UInt8 HEAD_UNLOAD_DELAY; + UInt8 PIN_34_PIN_2; + UInt8 PIN_4_PIN_1; + UInt16 MEDIUM_ROTATION_RATE; + UInt8 RESERVED[2]; +} SBCModePageFlexibleDisk; + + +/*! +@enum TRDY_SSN_MO bitfields +@discussion +Bit field definitions and masks for Flexible Disk TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_MO_Bit +MO Bit definition. +@constant kSBCModePageFlexibleDisk_SSN_Bit +SSN Bit definition. +@constant kSBCModePageFlexibleDisk_TRDY_Bit +TRDY Bit definition. +@constant kSBCModePageFlexibleDisk_MO_Mask +Mask for use with TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_SSN_Mask +Mask for use with TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_TRDY_Mask +Mask for use with TRDY_SSN_MO field. +*/ +enum +{ + // Bits 0:4 Reserved + kSBCModePageFlexibleDisk_MO_Bit = 5, + kSBCModePageFlexibleDisk_SSN_Bit = 6, + kSBCModePageFlexibleDisk_TRDY_Bit = 7, + + kSBCModePageFlexibleDisk_MO_Mask = (1 << kSBCModePageFlexibleDisk_MO_Bit), + kSBCModePageFlexibleDisk_SSN_Mask = (1 << kSBCModePageFlexibleDisk_SSN_Bit), + kSBCModePageFlexibleDisk_TRDY_Mask = (1 << kSBCModePageFlexibleDisk_TRDY_Bit) +}; + + +/*! +@enum SPC bitfields +@discussion +Bit field definitions and masks for Flexible Disk SPC field. +@constant kSBCModePageFlexibleDisk_SPC_Mask +Mask for use with SPC field. +*/ +enum +{ + kSBCModePageFlexibleDisk_SPC_Mask = 0x0F +}; + + +/*! +@enum PIN_34_PIN_2 bitfields +@discussion +Bit field definitions and masks for Flexible Disk PIN_34_PIN_2 field. +@constant kSBCModePageFlexibleDisk_PIN_2_Mask +Mask for use with PIN_34_PIN_2 field. +@constant kSBCModePageFlexibleDisk_PIN_34_Mask +Mask for use with PIN_34_PIN_2 field. +*/ +enum +{ + kSBCModePageFlexibleDisk_PIN_2_Mask = 0x0F, + kSBCModePageFlexibleDisk_PIN_34_Mask = 0xF0 +}; + + +/*! +@enum PIN_4_PIN_1 bitfields +@discussion +Bit field definitions and masks for Flexible Disk PIN_4_PIN_1 field. +@constant kSBCModePageFlexibleDisk_PIN_1_Mask +Mask for use with PIN_4_PIN_1 field. +@constant kSBCModePageFlexibleDisk_PIN_4_Mask +Mask for use with PIN_4_PIN_1 field. +*/ +enum +{ + kSBCModePageFlexibleDisk_PIN_1_Mask = 0x0F, + kSBCModePageFlexibleDisk_PIN_4_Mask = 0xF0 +}; + + +/*! +@struct SBCModePageCaching +@discussion +Caching Mode Page (PAGE CODE 0x08) format. +*/ +typedef struct SBCModePageCaching +{ + ModePageFormatHeader header; + UInt8 flags; + UInt8 DEMAND_READ_WRITE_RETENTION_PRIORITY; + UInt16 DISABLE_PREFETCH_TRANSFER_LENGTH; + UInt16 MINIMUM_PREFETCH; + UInt16 MAXIMUM_PREFETCH; + UInt16 MAXIMUM_PREFETCH_CEILING; + UInt8 flags2; + UInt8 NUMBER_OF_CACHE_SEGMENTS; + UInt16 CACHE_SEGMENT_SIZE; + UInt8 RESERVED; + UInt8 NON_CACHE_SEGMENT_SIZE[3]; +} SBCModePageCaching; + + +/*! +@enum Caching flags bitfields +@discussion +Bit field definitions and masks for Caching flags field. +@constant kSBCModePageCaching_RCD_Bit +RCD Bit definition. +@constant kSBCModePageCaching_MF_Bit +MF Bit definition. +@constant kSBCModePageCaching_WCE_Bit +WCE Bit definition. +@constant kSBCModePageCaching_SIZE_Bit +SIZE Bit definition. +@constant kSBCModePageCaching_DISC_Bit +DISC Bit definition. +@constant kSBCModePageCaching_CAP_Bit +CAP Bit definition. +@constant kSBCModePageCaching_ABPF_Bit +ABPF Bit definition. +@constant kSBCModePageCaching_IC_Bit +IC Bit definition. +@constant kSBCModePageCaching_RCD_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_MF_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_WCE_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_SIZE_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_DISC_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_CAP_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_ABPF_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_IC_Mask +Mask for use with flags field. +*/ +enum +{ + kSBCModePageCaching_RCD_Bit = 0, + kSBCModePageCaching_MF_Bit = 1, + kSBCModePageCaching_WCE_Bit = 2, + kSBCModePageCaching_SIZE_Bit = 3, + kSBCModePageCaching_DISC_Bit = 4, + kSBCModePageCaching_CAP_Bit = 5, + kSBCModePageCaching_ABPF_Bit = 6, + kSBCModePageCaching_IC_Bit = 7, + + kSBCModePageCaching_RCD_Mask = (1 << kSBCModePageCaching_RCD_Bit), + kSBCModePageCaching_MF_Mask = (1 << kSBCModePageCaching_MF_Bit), + kSBCModePageCaching_WCE_Mask = (1 << kSBCModePageCaching_WCE_Bit), + kSBCModePageCaching_SIZE_Mask = (1 << kSBCModePageCaching_SIZE_Bit), + kSBCModePageCaching_DISC_Mask = (1 << kSBCModePageCaching_DISC_Bit), + kSBCModePageCaching_CAP_Mask = (1 << kSBCModePageCaching_CAP_Bit), + kSBCModePageCaching_ABPF_Mask = (1 << kSBCModePageCaching_ABPF_Bit), + kSBCModePageCaching_IC_Mask = (1 << kSBCModePageCaching_IC_Bit) +}; + + +/*! +@enum Demand Read/Write Retention masks +@discussion +Demand Read/Write Retention masks. +@constant kSBCModePageCaching_DEMAND_WRITE_Mask +Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. +@constant kSBCModePageCaching_DEMAND_READ_Mask +Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. +*/ +enum +{ + kSBCModePageCaching_DEMAND_WRITE_Mask = 0x00FF, + kSBCModePageCaching_DEMAND_READ_Mask = 0xFF00 +}; + +/*! +@enum Caching flags2 bitfields +@discussion +Bit field definitions and masks for Caching flags2 field. +@constant kSBCModePageCaching_VS1_Bit +VS1 Bit definition. +@constant kSBCModePageCaching_VS2_Bit +VS2 Bit definition. +@constant kSBCModePageCaching_DRA_Bit +DRA Bit definition. +@constant kSBCModePageCaching_LBCSS_Bit +LBCSS Bit definition. +@constant kSBCModePageCaching_FSW_Bit +FSW Bit definition. +@constant kSBCModePageCaching_VS1_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_VS2_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_DRA_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_LBCSS_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_FSW_Mask +Mask for use with flags2 field. +*/ +enum +{ + // Bits 0:2 Reserved + kSBCModePageCaching_VS1_Bit = 3, + kSBCModePageCaching_VS2_Bit = 4, + kSBCModePageCaching_DRA_Bit = 5, + kSBCModePageCaching_LBCSS_Bit = 6, + kSBCModePageCaching_FSW_Bit = 7, + + kSBCModePageCaching_VS1_Mask = (1 << kSBCModePageCaching_VS1_Bit), + kSBCModePageCaching_VS2_Mask = (1 << kSBCModePageCaching_VS2_Bit), + kSBCModePageCaching_DRA_Mask = (1 << kSBCModePageCaching_DRA_Bit), + kSBCModePageCaching_LBCSS_Mask = (1 << kSBCModePageCaching_LBCSS_Bit), + kSBCModePageCaching_FSW_Mask = (1 << kSBCModePageCaching_FSW_Bit) +}; + +#pragma options align=reset + +#endif /* _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_READ_CAPACITY_Definitions.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_READ_CAPACITY_Definitions.h.svn-base new file mode 100644 index 0000000..59abde3 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_READ_CAPACITY_Definitions.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ +#define _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the READ CAPACITY 10 (0x25) and READ CAPACITY 16 (0x9E) commands. +*/ + +/*! +@enum READ CAPACITY Payload Sizes +@discussion +Sizes of the payload for the READ CAPACITY 10 and +READ CAPACITY 16 commands. +@constant kREPORT_CAPACITY_DataSize +Data size for a READ_CAPACITY command. +@constant kREPORT_CAPACITY_16_DataSize +Data size for a READ_CAPACITY_16 command. +*/ +enum +{ + kREPORT_CAPACITY_DataSize = 8, + kREPORT_CAPACITY_16_DataSize = 32 +}; + + +/*! +@constant kREPORT_CAPACITY_MaximumLBA +@discussion +Maximum LBA supported via READ CAPACITY 10 command. +*/ +#define kREPORT_CAPACITY_MaximumLBA 0xFFFFFFFFUL + + +/*! +@constant kREPORT_CAPACITY_16_MaximumLBA +@discussion +Maximum LBA supported via READ CAPACITY 16 command. +*/ +#define kREPORT_CAPACITY_16_MaximumLBA 0xFFFFFFFFFFFFFFFFULL + + +/*! +@struct SCSI_Capacity_Data +@discussion +Capacity return structure for READ CAPACITY 10 command. +*/ +typedef struct SCSI_Capacity_Data +{ + UInt32 RETURNED_LOGICAL_BLOCK_ADDRESS; + UInt32 BLOCK_LENGTH_IN_BYTES; +} SCSI_Capacity_Data; + + +/*! +@struct SCSI_Capacity_Data_Long +@discussion +Capacity return structure for READ CAPACITY 16 command. +*/ +typedef struct SCSI_Capacity_Data_Long +{ + UInt64 RETURNED_LOGICAL_BLOCK_ADDRESS; + UInt32 BLOCK_LENGTH_IN_BYTES; + UInt8 RTO_EN_PROT_EN; + UInt8 Reserved[19]; +} SCSI_Capacity_Data_Long; + + +/*! +@enum RTO_EN definitions +@discussion +Values for the REFERENCE TAG OWN (RTO_EN) bit in the +READ CAPACITY Long Data structure. +@constant kREAD_CAPACITY_RTO_Enabled +Reference Tag Own enabled. +@constant kREAD_CAPACITY_RTO_Disabled +Reference Tag Own disabled. +@constant kREAD_CAPACITY_RTO_Mask +Mask to use when checking the RTO_EN_PROT_EN field. +*/ +enum +{ + kREAD_CAPACITY_RTO_Enabled = 0x02, + kREAD_CAPACITY_RTO_Disabled = 0x00, + kREAD_CAPACITY_RTO_Mask = 0x02 +}; + + +/*! +@enum PROTECTION INFORMATION definitions +@discussion +Values for the PROTECTION INFORMATION (PROT_EN) bit in the +READ CAPACITY Long Data structure. +@constant kREAD_CAPACITY_PROT_Enabled +Protection Information enabled. +@constant kREAD_CAPACITY_PROT_Disabled +Protection Information disabled. +@constant kREAD_CAPACITY_PROT_Mask +Mask to use when checking the RTO_EN_PROT_EN field. +*/ + +enum +{ + kREAD_CAPACITY_PROT_Enabled = 0x01, + kREAD_CAPACITY_PROT_Disabled = 0x00, + kREAD_CAPACITY_PROT_Mask = 0x01 +}; + + +#endif /* _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_REPORT_LUNS_Definitions.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_REPORT_LUNS_Definitions.h.svn-base new file mode 100644 index 0000000..6616e84 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_REPORT_LUNS_Definitions.h.svn-base @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2004-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ +#define _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the REPORT_LUNS (0xA0) command. +*/ + + +/*! +@struct SCSICmd_REPORT_LUNS_LUN_ENTRY +@discussion +This structure represents a single LUN entry in a LUN list +returned via the REPORT_LUNS command. +*/ +typedef struct SCSICmd_REPORT_LUNS_LUN_ENTRY +{ + UInt16 FIRST_LEVEL_ADDRESSING; + UInt16 SECOND_LEVEL_ADDRESSING; + UInt16 THIRD_LEVEL_ADDRESSING; + UInt16 FOURTH_LEVEL_ADDRESSING; +} SCSICmd_REPORT_LUNS_LUN_ENTRY; + + +/*! +@constant kREPORT_LUNS_HeaderSize +@discussion +Size of the REPORT_LUNS header as defined in the SPC-3 specification. +*/ +#define kREPORT_LUNS_HeaderSize 8 + +/*! +@enum REPORT_LUNS addressing methods. +@discussion +REPORT_LUNS addressing methods described in +SAM-2 documents. +@constant kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE +Peripheral Device Addressing Method. +@constant kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC +Device Type Specific Addressing Method. +@constant kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT +Logical Unit Specific Addressing Method. +@constant kREPORT_LUNS_ADDRESS_METHOD_OFFSET +Offset to the address method data. +*/ +enum +{ + kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE = 0, + kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC = 1, + kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT = 2, + // Reserved [3] + kREPORT_LUNS_ADDRESS_METHOD_OFFSET = 14 +}; + + +/*! +@struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING +@discussion +This structure represents a LUN Addressing scheme. +*/ +typedef struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING +{ +#ifdef __LITTLE_ENDIAN__ + UInt16 LUN : 5; + UInt16 BUS_NUMBER : 3; + UInt16 TARGET : 6; + UInt16 reserved2 : 1; + UInt16 reserved : 1; +#else /* !__LITTLE_ENDIAN__ */ + UInt16 reserved : 1; + UInt16 reserved2 : 1; + UInt16 TARGET : 6; + UInt16 BUS_NUMBER : 3; + UInt16 LUN : 5; +#endif /* !__LITTLE_ENDIAN__ */ +} REPORT_LUNS_LOGICAL_UNIT_ADDRESSING; + + +/*! +@struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING +@discussion +This structure represents a Peripheral Device Addressing scheme. +*/ +typedef struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING +{ +#ifdef __LITTLE_ENDIAN__ + UInt16 TARGET_LUN : 8; + UInt16 BUS_IDENTIFIER : 6; + UInt16 reserved2 : 1; + UInt16 reserved : 1; +#else /* !__LITTLE_ENDIAN__ */ + UInt16 reserved : 1; + UInt16 reserved2 : 1; + UInt16 BUS_IDENTIFIER : 6; + UInt16 TARGET_LUN : 8; +#endif /* !__LITTLE_ENDIAN__ */ +} REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING; + + +/*! +@struct SCSICmd_REPORT_LUNS_Header +@discussion +This structure defines the format of the data that is returned for +the REPORT_LUNS command. +*/ +typedef struct SCSICmd_REPORT_LUNS_Header +{ + UInt32 LUN_LIST_LENGTH; // LUN list length in bytes. + UInt32 RESERVED; + SCSICmd_REPORT_LUNS_LUN_ENTRY LUN[1]; // Variable length list. Must have at least LUN 0 if +} SCSICmd_REPORT_LUNS_Header; // Target supports REPORT_LUNS command. + + +#endif /* _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_REQUEST_SENSE_Defs.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_REQUEST_SENSE_Defs.h.svn-base new file mode 100644 index 0000000..8cfabb0 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICmds_REQUEST_SENSE_Defs.h.svn-base @@ -0,0 +1,234 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ +#define _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the REQUEST SENSE (0x03) command and from auto sense on protocols + that support it. +*/ + + +/*! +@enum kSenseDefaultSize +@discussion +The default size for SCSI Request Sense data. +*/ +enum +{ + kSenseDefaultSize = 18 +}; + + +/*! +@struct SCSI_Sense_Data +@discussion +The basic SCSI Request Sense data structure. +*/ +typedef struct SCSI_Sense_Data +{ + UInt8 VALID_RESPONSE_CODE; // 7 = Valid. 6-0 = Response Code. + UInt8 SEGMENT_NUMBER; // Segment number + UInt8 SENSE_KEY; // 7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY. + UInt8 INFORMATION_1; // INFORMATION. + UInt8 INFORMATION_2; // INFORMATION. + UInt8 INFORMATION_3; // INFORMATION. + UInt8 INFORMATION_4; // INFORMATION. + UInt8 ADDITIONAL_SENSE_LENGTH; // Number of additional bytes available in sense data + UInt8 COMMAND_SPECIFIC_INFORMATION_1; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_2; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_3; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_4; // Command Specific Information + UInt8 ADDITIONAL_SENSE_CODE; // Additional Sense Code + UInt8 ADDITIONAL_SENSE_CODE_QUALIFIER; // Additional Sense Code Qualifier + UInt8 FIELD_REPLACEABLE_UNIT_CODE; // Field Replaceable Unit Code + UInt8 SKSV_SENSE_KEY_SPECIFIC_MSB; // 7 = Sense Key Specific Valid bit, 6-0 Sense Key Specific MSB + UInt8 SENSE_KEY_SPECIFIC_MID; // Sense Key Specific Middle + UInt8 SENSE_KEY_SPECIFIC_LSB; // Sense Key Specific LSB +} SCSI_Sense_Data; + + +/*! +@enum Sense Valid +@discussion +Masks to use to determine if sense data is valid or not. +@constant kSENSE_DATA_VALID +Sense data is valid. +@constant kSENSE_NOT_DATA_VALID +Sense data is not valid. +@constant kSENSE_DATA_VALID_Mask +Validity mask to use when checking the VALID_RESPONSE_CODE field. +*/ +enum +{ + kSENSE_DATA_VALID = 0x80, + kSENSE_NOT_DATA_VALID = 0x00, + kSENSE_DATA_VALID_Mask = 0x80 +}; + + +/*! +@enum Sense Response Codes +@discussion +Masks and values to determine the Response Code. +@constant kSENSE_RESPONSE_CODE_Current_Errors +Response code indicating current errors are reported. +@constant kSENSE_RESPONSE_CODE_Deferred_Errors +Response code indicating deferred errors are reported. +@constant kSENSE_RESPONSE_CODE_Mask +Mask to use when checking the VALID_RESPONSE_CODE field. +*/ +enum +{ + kSENSE_RESPONSE_CODE_Current_Errors = 0x70, + kSENSE_RESPONSE_CODE_Deferred_Errors = 0x71, + kSENSE_RESPONSE_CODE_Mask = 0x7F +}; + + +/*! +@enum FILEMARK bit field definitions +@discussion +Masks and values to determine the FileMark bit field. +@constant kSENSE_FILEMARK_Set +Filemark bit is set. +@constant kSENSE_FILEMARK_Not_Set +Filemark bit is not set. +@constant kSENSE_FILEMARK_Mask +Mask to use when checking the SENSE_KEY field for the FILEMARK bit. +*/ +enum +{ + kSENSE_FILEMARK_Set = 0x80, + kSENSE_FILEMARK_Not_Set = 0x00, + kSENSE_FILEMARK_Mask = 0x80 +}; + + +/*! +@enum EOM bit field definitions +@discussion +Masks and values to determine the End Of Medium bit field. +@constant kSENSE_EOM_Set +End Of Medium bit is set. +@constant kSENSE_EOM_Not_Set +End Of Medium bit is not set. +@constant kSENSE_EOM_Mask +Mask to use when checking the SENSE_KEY field for the EOM bit. +*/ +enum +{ + kSENSE_EOM_Set = 0x40, + kSENSE_EOM_Not_Set = 0x00, + kSENSE_EOM_Mask = 0x40 +}; + + +/*! +@enum ILI bit field definitions +@discussion +Masks and values to determine the Incorrect Length Indicator bit field. +@constant kSENSE_ILI_Set +Incorrect Length Indicator bit is set. +@constant kSENSE_ILI_Not_Set +Incorrect Length Indicator bit is not set. +@constant kSENSE_ILI_Mask +Mask to use when checking the SENSE_KEY field for the ILI bit. +*/ +enum +{ + kSENSE_ILI_Set = 0x20, + kSENSE_ILI_Not_Set = 0x00, + kSENSE_ILI_Mask = 0x20 +}; + + +/*! +@enum Sense Key definitions +@discussion +Masks and values to determine the SENSE_KEY. +@constant kSENSE_KEY_NO_SENSE +No sense data is present. +@constant kSENSE_KEY_RECOVERED_ERROR +A recovered error has occurred. +@constant kSENSE_KEY_NOT_READY +Device server is not ready. +@constant kSENSE_KEY_MEDIUM_ERROR +Device server detected a medium error. +@constant kSENSE_KEY_HARDWARE_ERROR +Device server detected a hardware error. +@constant kSENSE_KEY_ILLEGAL_REQUEST +Device server detected an illegal request. +@constant kSENSE_KEY_UNIT_ATTENTION +Device server indicates a unit attention condition. +@constant kSENSE_KEY_DATA_PROTECT +Device server indicates a data protect condition. +@constant kSENSE_KEY_BLANK_CHECK +Device server indicates a blank check condition. +@constant kSENSE_KEY_VENDOR_SPECIFIC +Device server indicates a vendor specific condition. +@constant kSENSE_KEY_COPY_ABORTED +Device server indicates a copy aborted condition. +@constant kSENSE_KEY_ABORTED_COMMAND +Device server indicates an aborted command condition. +@constant kSENSE_KEY_VOLUME_OVERFLOW +Device server indicates a volume overflow condition. +@constant kSENSE_KEY_MISCOMPARE +Device server indicates a miscompare condition. +@constant kSENSE_KEY_Mask +Mask to use when checking the SENSE_KEY field for the SENSE_KEY value. +*/ +enum +{ + kSENSE_KEY_NO_SENSE = 0x00, + kSENSE_KEY_RECOVERED_ERROR = 0x01, + kSENSE_KEY_NOT_READY = 0x02, + kSENSE_KEY_MEDIUM_ERROR = 0x03, + kSENSE_KEY_HARDWARE_ERROR = 0x04, + kSENSE_KEY_ILLEGAL_REQUEST = 0x05, + kSENSE_KEY_UNIT_ATTENTION = 0x06, + kSENSE_KEY_DATA_PROTECT = 0x07, + kSENSE_KEY_BLANK_CHECK = 0x08, + kSENSE_KEY_VENDOR_SPECIFIC = 0x09, + kSENSE_KEY_COPY_ABORTED = 0x0A, + kSENSE_KEY_ABORTED_COMMAND = 0x0B, + /* SENSE KEY 0x0C is obsoleted */ + kSENSE_KEY_VOLUME_OVERFLOW = 0x0D, + kSENSE_KEY_MISCOMPARE = 0x0E, + /* SENSE KEY 0x0F is reserved */ + kSENSE_KEY_Mask = 0x0F +}; + + +#endif /* _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICommandDefinitions.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICommandDefinitions.h.svn-base new file mode 100644 index 0000000..d33aed6 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICommandDefinitions.h.svn-base @@ -0,0 +1,479 @@ +/* + * Copyright (c) 2001-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ +#define _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ + + +#if KERNEL +#include +#else +#include +#endif + + +/*! @header SCSICommandDefinitions + @discussion + This file contains all the definitions for types and constants that are + used by the command set classes for building CDBs. The field type + definitions are used for the parameters passed to a method that builds and + sends any SCSI defined command to clearly identify the type of value + expected for a parameter. + + The command methods will then use the appropriate mask to verify that the + value passed into a parameter is of the specified type. + + Currently only types and masks are defined for 8 bytes and smaller fields. + If a command is defined that uses a larger field, these should be expanded + to include those sizes. +*/ + +#pragma mark Field Type Definitions +/* These are the type definitions used for the parameters of methods that + * build and send Command Descriptor Blocks. + */ + +/* 1 Byte or smaller fields. */ + +/*! @typedef SCSICmdField1Bit */ +typedef UInt8 SCSICmdField1Bit; + +/*! @typedef SCSICmdField2Bit */ +typedef UInt8 SCSICmdField2Bit; + +/*! @typedef SCSICmdField3Bit */ +typedef UInt8 SCSICmdField3Bit; + +/*! @typedef SCSICmdField4Bit */ +typedef UInt8 SCSICmdField4Bit; + +/*! @typedef SCSICmdField5Bit */ +typedef UInt8 SCSICmdField5Bit; + +/*! @typedef SCSICmdField6Bit */ +typedef UInt8 SCSICmdField6Bit; + +/*! @typedef SCSICmdField7Bit */ +typedef UInt8 SCSICmdField7Bit; + +/*! @typedef SCSICmdField1Byte */ +typedef UInt8 SCSICmdField1Byte; + +/* 2 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField9Bit */ +typedef UInt16 SCSICmdField9Bit; + +/*! @typedef SCSICmdField10Bit */ +typedef UInt16 SCSICmdField10Bit; + +/*! @typedef SCSICmdField11Bit */ +typedef UInt16 SCSICmdField11Bit; + +/*! @typedef SCSICmdField12Bit */ +typedef UInt16 SCSICmdField12Bit; + +/*! @typedef SCSICmdField13Bit */ +typedef UInt16 SCSICmdField13Bit; + +/*! @typedef SCSICmdField14Bit */ +typedef UInt16 SCSICmdField14Bit; + +/*! @typedef SCSICmdField15Bit */ +typedef UInt16 SCSICmdField15Bit; + +/*! @typedef SCSICmdField2Byte */ +typedef UInt16 SCSICmdField2Byte; + +/* 3 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField17Bit */ +typedef UInt32 SCSICmdField17Bit; + +/*! @typedef SCSICmdField18Bit */ +typedef UInt32 SCSICmdField18Bit; + +/*! @typedef SCSICmdField19Bit */ +typedef UInt32 SCSICmdField19Bit; + +/*! @typedef SCSICmdField20Bit */ +typedef UInt32 SCSICmdField20Bit; + +/*! @typedef SCSICmdField21Bit */ +typedef UInt32 SCSICmdField21Bit; + +/*! @typedef SCSICmdField22Bit */ +typedef UInt32 SCSICmdField22Bit; + +/*! @typedef SCSICmdField23Bit */ +typedef UInt32 SCSICmdField23Bit; + +/*! @typedef SCSICmdField3Byte */ +typedef UInt32 SCSICmdField3Byte; + +/* 4 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField25Bit */ +typedef UInt32 SCSICmdField25Bit; + +/*! @typedef SCSICmdField26Bit */ +typedef UInt32 SCSICmdField26Bit; + +/*! @typedef SCSICmdField27Bit */ +typedef UInt32 SCSICmdField27Bit; + +/*! @typedef SCSICmdField28Bit */ +typedef UInt32 SCSICmdField28Bit; + +/*! @typedef SCSICmdField29Bit */ +typedef UInt32 SCSICmdField29Bit; + +/*! @typedef SCSICmdField30Bit */ +typedef UInt32 SCSICmdField30Bit; + +/*! @typedef SCSICmdField31Bit */ +typedef UInt32 SCSICmdField31Bit; + +/*! @typedef SCSICmdField4Byte */ +typedef UInt32 SCSICmdField4Byte; + +/* 5 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField33Bit */ +typedef UInt64 SCSICmdField33Bit; + +/*! @typedef SCSICmdField34Bit */ +typedef UInt64 SCSICmdField34Bit; + +/*! @typedef SCSICmdField35Bit */ +typedef UInt64 SCSICmdField35Bit; + +/*! @typedef SCSICmdField36Bit */ +typedef UInt64 SCSICmdField36Bit; + +/*! @typedef SCSICmdField37Bit */ +typedef UInt64 SCSICmdField37Bit; + +/*! @typedef SCSICmdField38Bit */ +typedef UInt64 SCSICmdField38Bit; + +/*! @typedef SCSICmdField39Bit */ +typedef UInt64 SCSICmdField39Bit; + +/*! @typedef SCSICmdField5Byte */ +typedef UInt64 SCSICmdField5Byte; + +/* 6 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField41Bit */ +typedef UInt64 SCSICmdField41Bit; + +/*! @typedef SCSICmdField42Bit */ +typedef UInt64 SCSICmdField42Bit; + +/*! @typedef SCSICmdField43Bit */ +typedef UInt64 SCSICmdField43Bit; + +/*! @typedef SCSICmdField44Bit */ +typedef UInt64 SCSICmdField44Bit; + +/*! @typedef SCSICmdField45Bit */ +typedef UInt64 SCSICmdField45Bit; + +/*! @typedef SCSICmdField46Bit */ +typedef UInt64 SCSICmdField46Bit; + +/*! @typedef SCSICmdField47Bit */ +typedef UInt64 SCSICmdField47Bit; + +/*! @typedef SCSICmdField6Byte */ +typedef UInt64 SCSICmdField6Byte; + +/* 7 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField49Bit */ +typedef UInt64 SCSICmdField49Bit; + +/*! @typedef SCSICmdField50Bit */ +typedef UInt64 SCSICmdField50Bit; + +/*! @typedef SCSICmdField51Bit */ +typedef UInt64 SCSICmdField51Bit; + +/*! @typedef SCSICmdField52Bit */ +typedef UInt64 SCSICmdField52Bit; + +/*! @typedef SCSICmdField53Bit */ +typedef UInt64 SCSICmdField53Bit; + +/*! @typedef SCSICmdField54Bit */ +typedef UInt64 SCSICmdField54Bit; + +/*! @typedef SCSICmdField55Bit */ +typedef UInt64 SCSICmdField55Bit; + +/*! @typedef SCSICmdField7Byte */ +typedef UInt64 SCSICmdField7Byte; + +/* 8 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField57Bit */ +typedef UInt64 SCSICmdField57Bit; + +/*! @typedef SCSICmdField58Bit */ +typedef UInt64 SCSICmdField58Bit; + +/*! @typedef SCSICmdField59Bit */ +typedef UInt64 SCSICmdField59Bit; + +/*! @typedef SCSICmdField60Bit */ +typedef UInt64 SCSICmdField60Bit; + +/*! @typedef SCSICmdField61Bit */ +typedef UInt64 SCSICmdField61Bit; + +/*! @typedef SCSICmdField62Bit */ +typedef UInt64 SCSICmdField62Bit; + +/*! @typedef SCSICmdField63Bit */ +typedef UInt64 SCSICmdField63Bit; + +/*! @typedef SCSICmdField8Byte */ +typedef UInt64 SCSICmdField8Byte; + + +#pragma mark Field Mask Definitions +/* These are masks that are used to verify that the values passed into the + * parameters for the fields are not larger than the field size. + * + * NB: These have changed from enums to #define since enums greater than + * 32 bits in size are not well-defined in C99. + */ + +/* 1 Byte or smaller fields. */ + +/*! @constant kSCSICmdFieldMask1Bit */ +#define kSCSICmdFieldMask1Bit 0x01 + +/*! @constant kSCSICmdFieldMask2Bit */ +#define kSCSICmdFieldMask2Bit 0x03 + +/*! @constant kSCSICmdFieldMask3Bit */ +#define kSCSICmdFieldMask3Bit 0x07 + +/*! @constant kSCSICmdFieldMask4Bit */ +#define kSCSICmdFieldMask4Bit 0x0F + +/*! @constant kSCSICmdFieldMask5Bit */ +#define kSCSICmdFieldMask5Bit 0x1F + +/*! @constant kSCSICmdFieldMask6Bit */ +#define kSCSICmdFieldMask6Bit 0x3F + +/*! @constant kSCSICmdFieldMask7Bit */ +#define kSCSICmdFieldMask7Bit 0x7F + +#define kSCSICmdFieldMask1Byte 0xFF + +/* 2 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask9Bit */ +#define kSCSICmdFieldMask9Bit 0x01FF + +/*! @constant kSCSICmdFieldMask10Bit */ +#define kSCSICmdFieldMask10Bit 0x03FF + +/*! @constant kSCSICmdFieldMask11Bit */ +#define kSCSICmdFieldMask11Bit 0x07FF + +/*! @constant kSCSICmdFieldMask12Bit */ +#define kSCSICmdFieldMask12Bit 0x0FFF + +/*! @constant kSCSICmdFieldMask13Bit */ +#define kSCSICmdFieldMask13Bit 0x1FFF + +/*! @constant kSCSICmdFieldMask14Bit */ +#define kSCSICmdFieldMask14Bit 0x3FFF + +/*! @constant kSCSICmdFieldMask15Bit */ +#define kSCSICmdFieldMask15Bit 0x7FFF + +/*! @constant kSCSICmdFieldMask2Byte */ +#define kSCSICmdFieldMask2Byte 0xFFFF + +/* 3 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask17Bit */ +#define kSCSICmdFieldMask17Bit 0x01FFFF + +/*! @constant kSCSICmdFieldMask18Bit */ +#define kSCSICmdFieldMask18Bit 0x03FFFF + +/*! @constant kSCSICmdFieldMask19Bit */ +#define kSCSICmdFieldMask19Bit 0x07FFFF + +/*! @constant kSCSICmdFieldMask20Bit */ +#define kSCSICmdFieldMask20Bit 0x0FFFFF + +/*! @constant kSCSICmdFieldMask21Bit */ +#define kSCSICmdFieldMask21Bit 0x1FFFFF + +/*! @constant kSCSICmdFieldMask22Bit */ +#define kSCSICmdFieldMask22Bit 0x3FFFFF + +/*! @constant kSCSICmdFieldMask23Bit */ +#define kSCSICmdFieldMask23Bit 0x7FFFFF + +/*! @constant kSCSICmdFieldMask3Byte */ +#define kSCSICmdFieldMask3Byte 0xFFFFFF + +/* 4 Bytes or smaller fields. */ +/*! @constant kSCSICmdFieldMask25Bit */ +#define kSCSICmdFieldMask25Bit 0x01FFFFFFUL + +/*! @constant kSCSICmdFieldMask26Bit */ +#define kSCSICmdFieldMask26Bit 0x03FFFFFFUL + +/*! @constant kSCSICmdFieldMask27Bit */ +#define kSCSICmdFieldMask27Bit 0x07FFFFFFUL + +/*! @constant kSCSICmdFieldMask28Bit */ +#define kSCSICmdFieldMask28Bit 0x0FFFFFFFUL + +/*! @constant kSCSICmdFieldMask29Bit */ +#define kSCSICmdFieldMask29Bit 0x1FFFFFFFUL + +/*! @constant kSCSICmdFieldMask30Bit */ +#define kSCSICmdFieldMask30Bit 0x3FFFFFFFUL + +/*! @constant kSCSICmdFieldMask31Bit */ +#define kSCSICmdFieldMask31Bit 0x7FFFFFFFUL + +/*! @constant kSCSICmdFieldMask4Byte */ +#define kSCSICmdFieldMask4Byte 0xFFFFFFFFUL + +/* 5 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask33Bit */ +#define kSCSICmdFieldMask33Bit 0x01FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask34Bit */ +#define kSCSICmdFieldMask34Bit 0x03FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask35Bit */ +#define kSCSICmdFieldMask35Bit 0x07FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask36Bit */ +#define kSCSICmdFieldMask36Bit 0x0FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask37Bit */ +#define kSCSICmdFieldMask37Bit 0x1FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask38Bit */ +#define kSCSICmdFieldMask38Bit 0x3FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask39Bit */ +#define kSCSICmdFieldMask39Bit 0x7FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask5Byte */ +#define kSCSICmdFieldMask5Byte 0xFFFFFFFFFFULL + +/* 6 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask41Bit */ +#define kSCSICmdFieldMask41Bit 0x01FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask42Bit */ +#define kSCSICmdFieldMask42Bit 0x03FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask43Bit */ +#define kSCSICmdFieldMask43Bit 0x07FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask44Bit */ +#define kSCSICmdFieldMask44Bit 0x0FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask45Bit */ +#define kSCSICmdFieldMask45Bit 0x1FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask46Bit */ +#define kSCSICmdFieldMask46Bit 0x3FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask47Bit */ +#define kSCSICmdFieldMask47Bit 0x7FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask6Byte */ +#define kSCSICmdFieldMask6Byte 0xFFFFFFFFFFFFULL + +/* 7 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask49Bit */ +#define kSCSICmdFieldMask49Bit 0x01FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask50Bit */ +#define kSCSICmdFieldMask50Bit 0x03FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask51Bit */ +#define kSCSICmdFieldMask51Bit 0x07FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask52Bit */ +#define kSCSICmdFieldMask52Bit 0x0FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask53Bit */ +#define kSCSICmdFieldMask53Bit 0x1FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask54Bit */ +#define kSCSICmdFieldMask54Bit 0x3FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask55Bit */ +#define kSCSICmdFieldMask55Bit 0x7FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask7Byte */ +#define kSCSICmdFieldMask7Byte 0xFFFFFFFFFFFFFFULL + +/* 8 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask57Bit */ +#define kSCSICmdFieldMask57Bit 0x01FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask58Bit */ +#define kSCSICmdFieldMask58Bit 0x03FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask59Bit */ +#define kSCSICmdFieldMask59Bit 0x07FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask60Bit */ +#define kSCSICmdFieldMask60Bit 0x0FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask61Bit */ +#define kSCSICmdFieldMask61Bit 0x1FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask62Bit */ +#define kSCSICmdFieldMask62Bit 0x3FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask63Bit */ +#define kSCSICmdFieldMask63Bit 0x7FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask8Byte */ +#define kSCSICmdFieldMask8Byte 0xFFFFFFFFFFFFFFFFULL + +#endif /* _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSICommandOperationCodes.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSICommandOperationCodes.h.svn-base new file mode 100644 index 0000000..21d9d1e --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSICommandOperationCodes.h.svn-base @@ -0,0 +1,941 @@ +/* + * Copyright (c) 2001-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SCSI_COMMAND_OPERATION_CODES_H_ +#define _SCSI_COMMAND_OPERATION_CODES_H_ + +#pragma mark About this file +/* This file contains the operation code definitions for all commands defined + * by the SCSI specifications. The commands are listed in three formats: + * 1) All commands are listed in alphabetical order. This list is the live + * enumeration for all of the command constants. + * 2) The commands are listed in ascending numerical order. + * 3) The commands are grouped by Peripheral Device Type. + * + * In the command listings by Peripheral Device Type, there will be a comment + * following each command. This comment indentifies the section of the related + * specification where the commands is defined and the requirement type of the + * command, Mandatory or Optional. + * If a specification redefines an optional command from SPC as mandatory, + * the command will be relisted in the Peripheral Device Type command list with + * the mandatory tag next to it. + * All commands that are listed in SPC as Device Type Specifc will be relisted + * as a comment in all specifications lists that support that command with the + * appropriate Mandatory or Optional tag for that specification. + * + * The section number and the requirement type of the command are based on the + * version of the specification listed in the header comment for the Peripheral + * Device Type. This data is provided for informational purposes only. The + * specification document and version that the device adheres to as indicated + * by the data returned in response to the INQUIRY command should be used as + * the authorative source for supported and required behavior of the device. + * + * The SPC set is listed before all other Peripheral Device Type commands as + * this is the base document from which all of the other documents are derived. + * + * The Peripheral Device Types and associated command sets as defined by SPC-2, + * section 7.4.1 are as follows: + * Peripheral Device Type Associated Command Specification + * ------------------------------------ ----------------------------------- + * 0x00 Direct Access Device SBC - SCSI-3 Block Commands + * 0x01 Sequential Access Device SSC - SCSI-3 Stream Commands + * 0x02 Printer Device SSC - SCSI-3 Stream Commands + * 0x03 Processor Device SPC - SCSI Primary Commands-2 + * 0x04 Write Once Device SBC - SCSI-3 Block Commands + * 0x05 CD-ROM Device MMC - SCSI Multimedia Commands-2 + * 0x06 Scanner Device SGC - SCSI-3 Graphics Commands + * 0x07 Optical Memory Device SBC - SCSI-3 Block Commands + * 0x08 Medium Changer Device SMC - SCSI-3 Medium Changer Cmds + * 0x09 Communications Device SSC - SCSI-3 Stream Commands + * 0x0A - 0x0B Graphic Arts Prepress Dev ASC IT8 + * 0x0C Storage Array Controller Device SCC-2 - SCSI Controller Commands-2 + * 0x0D Enclosure Services SES - SCSI-3 Enclosure Services + * 0x0E Simplified Direct Access Device RBC - SCSI Reduced Block Commands + * 0x0F Optical Card Reader/Writer Device OCRW - SCSI Specification for + * Optical Card Reader/Writer + * 0x10 Reserved No command specification + * 0x11 Object-Based Storage Device OSD - SCSI Object Based Storage + * Device Commands + * 0x12 - 0x14 Reserved No command specification + * 0x15 Multimedia Media Access Engine RMC - Reduced Multimedia Commands + * 0x16 - 0x1E Reserved No command specification + * 0x1F Unknown or No Device No command specification + */ + +#pragma mark - +#pragma mark Command Definitions by Name +/* All SCSI Commands listed in alphabetical order. These are the live + * definitions of the commands. All other command lists are informative. + */ +enum +{ + kSCSICmd_ACCESS_CONTROL_IN = 0x86, + kSCSICmd_ACCESS_CONTROL_OUT = 0x87, + kSCSICmd_BLANK = 0xA1, + kSCSICmd_CHANGE_DEFINITION = 0x40, + kSCSICmd_CLOSE_TRACK_SESSION = 0x5B, + kSCSICmd_COMPARE = 0x39, + kSCSICmd_COPY = 0x18, + kSCSICmd_COPY_AND_VERIFY = 0x3A, + kSCSICmd_ERASE_10 = 0x2C, + kSCSICmd_ERASE_12 = 0xAC, + kSCSICmd_EXTENDED_COPY = 0x83, + kSCSICmd_FORMAT_UNIT = 0x04, + kSCSICmd_GET_CONFIGURATION = 0x46, + kSCSICmd_GET_EVENT_STATUS_NOTIFICATION = 0x4A, + kSCSICmd_GET_PERFORMANCE = 0xAC, + kSCSICmd_INQUIRY = 0x12, + kSCSICmd_LOAD_UNLOAD_MEDIUM = 0xA6, + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, + kSCSICmd_LOCK_UNLOCK_CACHE_16 = 0x92, + kSCSICmd_LOG_SELECT = 0x4C, + kSCSICmd_LOG_SENSE = 0x4D, + kSCSICmd_MAINTENANCE_IN = 0xA3, + kSCSICmd_MAINTENANCE_OUT = 0xA4, + kSCSICmd_MECHANISM_STATUS = 0xBD, + kSCSICmd_MEDIUM_SCAN = 0x38, + kSCSICmd_MODE_SELECT_6 = 0x15, + kSCSICmd_MODE_SELECT_10 = 0x55, + kSCSICmd_MODE_SENSE_6 = 0x1A, + kSCSICmd_MODE_SENSE_10 = 0x5A, + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, + kSCSICmd_PAUSE_RESUME = 0x4B, + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, + kSCSICmd_PLAY_AUDIO_10 = 0x45, + kSCSICmd_PLAY_AUDIO_12 = 0xA5, + kSCSICmd_PLAY_AUDIO_MSF = 0x47, + kSCSICmd_PLAY_AUDIO_TRACK_INDEX = 0x48, + kSCSICmd_PLAY_CD = 0xBC, + kSCSICmd_PLAY_RELATIVE_10 = 0x49, + kSCSICmd_PLAY_RELATIVE_12 = 0xA9, + kSCSICmd_PREFETCH = 0x34, + kSCSICmd_PREFETCH_16 = 0x90, + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, + kSCSICmd_READ_6 = 0x08, + kSCSICmd_READ_10 = 0x28, + kSCSICmd_READ_12 = 0xA8, + kSCSICmd_READ_16 = 0x88, + kSCSICmd_READ_ATTRIBUTE = 0x8C, + kSCSICmd_READ_BUFFER = 0x3C, + kSCSICmd_READ_BUFFER_CAPACITY = 0x5C, + kSCSICmd_READ_CAPACITY = 0x25, + kSCSICmd_READ_CD = 0xBE, + kSCSICmd_READ_CD_MSF = 0xB9, + kSCSICmd_READ_DEFECT_DATA_10 = 0x37, + kSCSICmd_READ_DEFECT_DATA_12 = 0xB7, + kSCSICmd_READ_DISC_INFORMATION = 0x51, + kSCSICmd_READ_DVD_STRUCTURE = 0xAD, + kSCSICmd_READ_DISC_STRUCTURE = 0xAD, + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, + kSCSICmd_READ_FORMAT_CAPACITIES = 0x23, + kSCSICmd_READ_GENERATION = 0x29, + kSCSICmd_READ_HEADER = 0x44, + kSCSICmd_READ_LONG = 0x3E, + kSCSICmd_READ_MASTER_CUE = 0x59, + kSCSICmd_READ_SUB_CHANNEL = 0x42, + kSCSICmd_READ_TOC_PMA_ATIP = 0x43, + kSCSICmd_READ_TRACK_INFORMATION = 0x52, + kSCSICmd_READ_UPDATED_BLOCK_10 = 0x2D, + kSCSICmd_REASSIGN_BLOCKS = 0x07, + kSCSICmd_REBUILD = 0x81, + kSCSICmd_RECEIVE = 0x08, + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, + kSCSICmd_REDUNDANCY_GROUP_IN = 0xBA, + kSCSICmd_REDUNDANCY_GROUP_OUT = 0xBB, + kSCSICmd_REGENERATE = 0x82, + kSCSICmd_RELEASE_6 = 0x17, + kSCSICmd_RELEASE_10 = 0x57, + kSCSICmd_REPAIR_TRACK = 0x58, + kSCSICmd_REPORT_DEVICE_IDENTIFIER = 0xA3, + kSCSICmd_REPORT_KEY = 0xA4, + kSCSICmd_REPORT_LUNS = 0xA0, + kSCSICmd_REQUEST_SENSE = 0x03, + kSCSICmd_RESERVE_6 = 0x16, + kSCSICmd_RESERVE_10 = 0x56, + kSCSICmd_RESERVE_TRACK = 0x53, + kSCSICmd_REZERO_UNIT = 0x01, + kSCSICmd_SCAN_MMC = 0xBA, + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, + kSCSICmd_SEEK_6 = 0x0B, + kSCSICmd_SEEK_10 = 0x2B, + kSCSICmd_SEND = 0x0A, + kSCSICmd_SEND_CUE_SHEET = 0x5D, + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, + kSCSICmd_SEND_DVD_STRUCTURE = 0xBF, + kSCSICmd_SEND_EVENT = 0xA2, + kSCSICmd_SEND_KEY = 0xA3, + kSCSICmd_SEND_OPC_INFORMATION = 0x54, + kSCSICmd_SERVICE_ACTION_IN = 0x9E, + kSCSICmd_SERVICE_ACTION_OUT = 0x9F, + kSCSICmd_SET_CD_SPEED = 0xBB, + kSCSICmd_SET_DEVICE_IDENTIFIER = 0xA4, + kSCSICmd_SET_LIMITS_10 = 0x33, + kSCSICmd_SET_LIMITS_12 = 0xB3, + kSCSICmd_SET_READ_AHEAD = 0xA7, + kSCSICmd_SET_STREAMING = 0xB6, + kSCSICmd_SPARE_IN = 0xBC, + kSCSICmd_SPARE_OUT = 0xBD, + kSCSICmd_START_STOP_UNIT = 0x1B, + kSCSICmd_STOP_PLAY_SCAN = 0x4E, + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, + kSCSICmd_SYNCHRONIZE_CACHE_16 = 0x91, + kSCSICmd_TEST_UNIT_READY = 0x00, + kSCSICmd_UPDATE_BLOCK = 0x3D, + kSCSICmd_VERIFY_10 = 0x2F, + kSCSICmd_VERIFY_12 = 0xAF, + kSCSICmd_VERIFY_16 = 0x8F, + kSCSICmd_VOLUME_SET_IN = 0xBE, + kSCSICmd_VOLUME_SET_OUT = 0xBF, + kSCSICmd_WRITE_6 = 0x0A, + kSCSICmd_WRITE_10 = 0x2A, + kSCSICmd_WRITE_12 = 0xAA, + kSCSICmd_WRITE_16 = 0x8A, + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, + kSCSICmd_WRITE_AND_VERIFY_16 = 0x8E, + kSCSICmd_WRITE_ATTRIBUTE = 0x8D, + kSCSICmd_WRITE_BUFFER = 0x3B, + kSCSICmd_WRITE_LONG = 0x3F, + kSCSICmd_WRITE_SAME = 0x41, + kSCSICmd_WRITE_SAME_16 = 0x93, + kSCSICmd_XDREAD = 0x52, + kSCSICmd_XDWRITE = 0x50, + kSCSICmd_XDWRITE_EXTENDED = 0x80, + kSCSICmd_XDWRITEREAD_10 = 0x53, + kSCSICmd_XPWRITE = 0x51, + + kSCSICmdVariableLengthCDB = 0x7F +}; + +/* Service Action Definitions for the Variable Length CDB (7Fh) command */ +enum +{ + kSCSIServiceAction_READ_32 = 0x0009, + kSCSIServiceAction_VERIFY_32 = 0x000A, + kSCSIServiceAction_WRITE_32 = 0x000B, + kSCSIServiceAction_WRITE_AND_VERIFY_32 = 0x000C, + kSCSIServiceAction_WRITE_SAME_32 = 0x000D, + kSCSIServiceAction_XDREAD_32 = 0x0003, + kSCSIServiceAction_XDWRITE_32 = 0x0004, + kSCSIServiceAction_XDWRITEREAD_32 = 0x0007, + kSCSIServiceAction_XPWRITE_32 = 0x0006 +}; + +/* Service Action Definitions for the MAINTENANCE IN (A3h) command */ +enum +{ + kSCSIServiceAction_REPORT_ALIASES = 0x0B, + kSCSIServiceAction_REPORT_DEVICE_IDENTIFIER = 0x05, + kSCSIServiceAction_REPORT_PRIORITY = 0x0E, + kSCSIServiceAction_REPORT_SUPPORTED_OPERATION_CODES = 0x0C, + kSCSIServiceAction_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS = 0x0D, + kSCSIServiceAction_REPORT_TARGET_PORT_GROUPS = 0x0A +}; + +/* Service Action Definitions for the MAINTENANCE OUT (A4h) command */ +enum +{ + kSCSIServiceAction_CHANGE_ALIASES = 0x0B, + kSCSIServiceAction_SET_DEVICE_IDENTIFIER = 0x06, + kSCSIServiceAction_SET_PRIORITY = 0x0E, + kSCSIServiceAction_SET_TARGET_PORT_GROUPS = 0x0A +}; + +/* Service Action Definitions for the SERVICE ACTION IN (9Eh) command */ +enum +{ + kSCSIServiceAction_READ_CAPACITY_16 = 0x10, + kSCSIServiceAction_READ_LONG_16 = 0x11 +}; + +/* Service Action Definitions for the SERVICE ACTION OUT (9Fh) command */ +enum +{ + kSCSIServiceAction_WRITE_LONG_16 = 0x11 +}; + +#pragma mark - +#pragma mark Command Definitions by Number +#if 0 +enum +{ +}; +#endif + + +#pragma mark - +#pragma mark All Types SPC Commands +/* Commands defined by the T10:1236-D SCSI Primary Commands-2 (SPC-2) + * command specification. The definitions and section numbers are based on + * section 7 of the revision 18, 21 May 2000 version of the specification. + * + * These commands are defined for all devices. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* Sec. 7.2: Optional */ + kSCSICmd_COPY = 0x18, /* Sec. 7.3: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* Sec. 7.4: Optional */ + kSCSICmd_EXTENDED_COPY = 0x83, /* Sec. 7.5: Optional */ + kSCSICmd_INQUIRY = 0x12, /* Sec. 7.6: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* Sec. 7.7: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* Sec. 7.8: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Sec. 7.9: Device Type + * Specific */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Sec. 7.10: Device Type + * Specific */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Sec. 7.11: Device Type + * Specific */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Sec. 7.12: Device Type + * Specific */ + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* Defined in SMC */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Sec. 7.13: Device Type + * Specific */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Sec. 7.14: Device Type + * Specific */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* Sec. 7.15: Device Type + * Specific */ + kSCSICmd_READ_BUFFER = 0x3C, /* Sec. 7.16: Optional */ + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* Defined in SMC */ + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, /* Sec. 7.17: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Sec. 7.18: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Sec. 7.19: Device Type + * Specific */ + kSCSICmd_RELEASE_6 = 0x17, /* Sec. 7.20: Device Type + * Specific */ + kSCSICmd_REPORT_DEVICE_IDENTIFIER = 0xA3, /* Sec. 7.21: Optional */ + kSCSICmd_REPORT_LUNS = 0xA0, /* Sec. 7.22: Mandatory for + * LUN Supporting devices*/ + kSCSICmd_REQUEST_SENSE = 0x03, /* Sec. 7.23: Device Type + * Specific */ + kSCSICmd_RESERVE_10 = 0x56, /* Sec. 7.24: Device Type + * Specific */ + kSCSICmd_RESERVE_6 = 0x16, /* Sec. 7.25: Device Type + * Specific */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Sec. 7.26: Optional */ + kSCSICmd_SET_DEVICE_IDENTIFIER = 0xA4, /* Sec. 7.27: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* Sec. 7.28: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Sec. 7.29: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x00 SBC Direct Access Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) command + * specification. The definitions and section numbers are based on section 6.1 + * of the revision 8c, 13 November 1997 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional*/ + kSCSICmd_FORMAT_UNIT = 0x04, /* Sec. 6.1.1: Mandatory */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, /* Sec. 6.1.2: Optional */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* SMC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PREFETCH = 0x34, /* Sec. 6.1.3: Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSCSICmd_READ_6 = 0x08, /* Sec. 6.1.4: Mandatory */ + kSCSICmd_READ_10 = 0x28, /* Sec. 6.1.5: Mandatory */ + kSCSICmd_READ_12 = 0xA8, /* Sec. 6.2.4: Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_READ_CAPACITY = 0x25, /* Sec. 6.1.6: Mandatory */ + kSCSICmd_READ_DEFECT_DATA_10 = 0x37, /* Sec. 6.1.7: Optional */ + kSCSICmd_READ_DEFECT_DATA_12 = 0xB7, /* Sec. 6.2.5: Optional */ + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* SMC: Optional */ + kSCSICmd_READ_GENERATION = 0x29, /* Sec. 6.2.6: Optional */ + kSCSICmd_READ_LONG = 0x3E, /* Sec. 6.1.8: Optional */ + kSCSICmd_READ_UPDATED_BLOCK_10 = 0x2D, /* Sec. 6.2.7: Optional */ + kSCSICmd_REASSIGN_BLOCKS = 0x07, /* Sec. 6.1.9: Optional */ + kSCSICmd_REBUILD = 0x81, /* Sec. 6.1.10: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_REGENERATE = 0x82, /* Sec. 6.1.11: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REPORT_LUNS = 0xA0, /* SPC: Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_REZERO_UNIT = 0x01, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSCSICmd_SEEK_6 = 0x0B, /* Obsolete */ + kSCSICmd_SEEK_10 = 0x2B, /* Sec. 6.1.12: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SET_LIMITS_10 = 0x33, /* Sec. 6.1.13: Optional */ + kSCSICmd_SET_LIMITS_12 = 0xB3, /* Sec. 6.2.8: Optional */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Sec. 6.1.14: Optional */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.15: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_UPDATE_BLOCK = 0x3D, /* Sec. 6.2.9: Optional */ + kSCSICmd_VERIFY_10 = 0x2F, /* Sec. 6.1.16: Optional */ + kSCSICmd_WRITE_6 = 0x0A, /* Sec. 6.1.17: Optional */ + kSCSICmd_WRITE_10 = 0x2A, /* Sec. 6.1.18: Optional */ + kSCSICmd_WRITE_12 = 0xAA, /* Sec. 6.2.13: Optional */ + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.1.19: Optional */ + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, /* Sec. 6.2.15: Optional */ + kSCSICmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSCSICmd_WRITE_LONG = 0x3F, /* Sec. 6.1.20: Optional */ + kSCSICmd_WRITE_SAME = 0x41, /* Sec. 6.1.21: Optional */ + kSCSICmd_XDREAD = 0x52, /* Sec. 6.1.22: Optional */ + kSCSICmd_XDWRITE = 0x50, /* Sec. 6.1.23: Optional */ + kSCSICmd_XDWRITE_EXTENDED = 0x80, /* Sec. 6.1.24: Optional */ + kSCSICmd_XPWRITE = 0x51 /* Sec. 6.1.25: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x01 SSC Sequential Access Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) command + * specification. The definitions and section numbers are based on section 5 + * of the revision 22, January 1, 2000 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_ERASE = 0x19, /* Sec. 5.3.1: Mandatory */ + kSCSICmd_FORMAT_MEDIUM = 0x04, /* Sec. 5.3.2: Optional */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOAD_UNLOAD = 0x1B, /* Sec. 5.3.3: Optional */ + kSCSICmd_LOCATE = 0x2B, /* Sec. 5.3.4: Optional */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_MOVE_MEDIUM = 0xA5, /* SMC: Optional */ + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* SMC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSCSICmd_READ_6 = 0x08, /* Sec. 5.3.5: Mandatory */ + kSCSICmd_READ_BLOCK_LIMITS = 0x05, /* Sec. 5.3.6: Mandatory */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_READ_ELEMENT_STATUS = 0xB8, /* SMC: Optional */ + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* SMC: Optional */ + kSCSICmd_READ_POSITION = 0x34, /* Sec. 5.3.7: Mandatory */ + kSCSICmd_READ_REVERSE = 0x0F, /* Sec. 5.3.8: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RECOVER_BUFFERED_DATA = 0x14, /* Sec. 5.3.9: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REPORT_DENSITY_SUPPORT = 0x44, /* Sec. 5.3.10: Mandatory*/ + kSCSICmd_REPORT_LUNS = 0xA0, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_REWIND = 0x01, /* Sec. 5.3.11: Mandatory*/ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SPACE = 0x11, /* Sec. 5.3.12: Mandatory*/ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_VERIFY_6 = 0x13, /* Sec. 5.3.13: Optional */ + kSCSICmd_WRITE_6 = 0x0A, /* Sec. 5.3.14: Mandatory*/ + kSCSICmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSCSICmd_WRITE_FILEMARKS = 0x10 /* Sec. 5.3.15: Mandatory*/ +}; +#endif + +#pragma mark - +#pragma mark 0x02 SSC Printer Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) command + * specification. The definitions and section numbers are based on section 6 + * of the revision 22, January 1, 2000 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_FORMAT = 0x04, /* Sec. 6.2.1: Optional */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PRINT = 0x0A, /* Sec. 6.2.2: Mandatory */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RECOVER_BUFFERED_DATA = 0x14, /* Sec. 6.2.3: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REPORT_LUNS = 0xA0, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SLEW_AND_PRINT = 0x0B, /* Sec. 6.2.4: Optional */ + kSCSICmd_STOP_PRINT = 0x1B, /* Sec. 6.2.5: Optional */ + kSCSICmd_SYNCHRONIZE_BUFFER = 0x10, /* Sec. 6.2.6: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* SPC: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x03 SPC Processor Commands +/* Commands defined by the T10:1236-D SCSI Primary Commands-2 (SPC-2) + * command specification. The definitions and section numbers are based on + * section 9 of the revision 18, 21 May 2000 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* Sec. 7.2: Optional */ + kSCSICmd_COPY = 0x18, /* Sec. 7.3: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* Sec. 7.4: Optional */ + kSCSICmd_EXTENDED_COPY = 0x83, /* Sec. 7.5: Optional */ + kSCSICmd_INQUIRY = 0x12, /* Sec. 7.6: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* Sec. 7.7: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* Sec. 7.8: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Sec. 7.13: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Sec. 7.14: Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* Sec. 7.16: Optional */ + kSCSICmd_RECEIVE = 0x08, /* Sec. 9.2: Optional */ + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, /* Sec. 7.17: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Sec. 7.18: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Sec. 7.19: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* Sec. 7.20: Optional */ + kSCSICmd_REPORT_LUNS = 0xA0, /* Sec. 7.22: Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Sec. 7.23: Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* Sec. 7.24: Optional */ + kSCSICmd_RESERVE_6 = 0x16, /* Sec. 7.25: Optional */ + kSCSICmd_SEND = 0x0A, /* Sec. 9.3: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Sec. 7.26: Mandatory */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* Sec. 7.27: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Sec. 7.29: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x04 SBC Write Once Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) command + * specification. The definitions and section numbers are based on section 6.3 + * of the revision 8c, 13 November 1997 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* SPC: Optional */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional*/ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, /* Sec. 6.1.2: Optional */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MEDIUM_SCAN = 0x38, /* Sec. 6.2.3: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_MOVE_MEDIUM = 0xA5, /* SMC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PREFETCH = 0x34, /* Sec. 6.1.3: Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSCSICmd_READ_6 = 0x08, /* Sec. 6.1.4: Optional */ + kSCSICmd_READ_10 = 0x28, /* Sec. 6.1.5: Mandatory */ + kSCSICmd_READ_12 = 0xA8, /* Sec. 6.2.4: Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_READ_CAPACITY = 0x25, /* Sec. 6.1.6: Mandatory */ + kSCSICmd_READ_ELEMENT_STATUS = 0xB8, /* SMC: Optional */ + kSCSICmd_READ_LONG = 0x3E, /* Sec. 6.1.8: Optional */ + kSCSICmd_REASSIGN_BLOCKS = 0x07, /* Sec. 6.1.9: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_REZERO_UNIT = 0x01, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, /* Obsolete */ + kSCSICmd_SEEK_6 = 0x0B, /* Obsolete */ + kSCSICmd_SEEK_10 = 0x2B, /* Sec. 6.1.12: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SET_LIMITS_10 = 0x33, /* Sec. 6.1.13: Optional */ + kSCSICmd_SET_LIMITS_12 = 0xB3, /* Sec. 6.2.8: Optional */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Sec. 6.1.14: Optional */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.15: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_VERIFY_10 = 0x2F, /* Sec. 6.2.10: Optional */ + kSCSICmd_VERIFY_12 = 0xAF, /* Sec. 6.2.11: Optional */ + kSCSICmd_WRITE_6 = 0x0A, /* Sec. 6.1.17: Optional */ + kSCSICmd_WRITE_10 = 0x2A, /* Sec. 6.2.10: Mandatory*/ + kSCSICmd_WRITE_12 = 0xAA, /* Sec. 6.2.13: Optional */ + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.2.14: Optional */ + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, /* Sec. 6.2.15: Optional */ + kSCSICmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSCSICmd_WRITE_LONG = 0x3F /* Sec. 6.1.20: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x05 MMC CD-ROM Commands +/* Commands defined by the T10:1363-D SCSI Multimedia Commands-3 (MMC-3) + * specification. The definitions and section numbers are based on section 6.1 + * of the revision 01, March 03, 2000 version of the specification. + * + * NOTE: The comments following each command may not be accurate. These are + * not from the MMC-3 specification, but have been derived from the SCSI-2 and + * original MMC specifications. Unlike the other SCSI command specifications, + * MMC-2 and MMC-3 do not provide a command requirement type and therefore does + * not relist the SPC commands with these requirements as they apply to MMC + * devices. The MMC-2 and MMC-3 specifications also refer back to the SBC + * specification which seems invalid since MMC devices do not represent a + * Peripheral Device Type defined by SBC. It is assumed that the SBC + * references refer to the Peripheral Device Type 0x00 - Direct Access Commands + * definitions from that specification. + */ +#if 0 +enum +{ + kSCSICmd_BLANK = 0xA1, /* Sec. 6.1.1: */ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_CLOSE_TRACK_SESSION = 0x5B, /* Sec. 6.1.2: */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_ERASE = 0x2C, /* SBC: */ + kSCSICmd_FORMAT_UNIT = 0x04, /* Sec. 6.1.3: */ + kSCSICmd_GET_CONFIGURATION = 0x46, /* Sec. 6.1.4: */ + kSCSICmd_GET_EVENT_STATUS_NOTIFICATION = 0x4A, /* Sec. 6.1.5: */ + kSCSICmd_GET_PERFORMANCE = 0xAC, /* Sec. 6.1.6: */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOAD_UNLOAD_MEDIUM = 0xA6, /* Sec. 6.1.7: */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MECHANISM_STATUS = 0xBD, /* Sec. 6.1.8: */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Mandatory */ + kSCSICmd_PAUSE_RESUME = 0x4B, /* Sec. 6.1.9: */ + kSCSICmd_PLAY_AUDIO_10 = 0x45, /* Sec. 6.1.10: */ + kSCSICmd_PLAY_AUDIO_12 = 0xA5, /* Sec. 6.1.11: */ + kSCSICmd_PLAY_AUDIO_MSF = 0x47, /* Sec. 6.1.12: */ + kSCSICmd_PLAY_AUDIO_TRACK_INDEX = 0x48, /* Obsolete */ + kSCSICmd_PLAY_CD = 0xBC, /* Sec. 6.1.13: */ + kSCSICmd_PLAY_RELATIVE_10 = 0x49, /* Obsolete */ + kSCSICmd_PLAY_RELATIVE_12 = 0xA9, /* Obsolete */ + kSCSICmd_PREFETCH = 0x34, /* Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* Optional */ + kSCSICmd_READ_6 = 0x08, /* Optional */ + kSCSICmd_READ_10 = 0x28, /* Mandatory */ + kSCSICmd_READ_12 = 0xA8, /* Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* Optional */ + kSCSICmd_READ_BUFFER_CAPACITY = 0x5C, /* Sec. 6.1.15: */ + kSCSICmd_READ_CD = 0xBE, /* Sec. 6.1.16: */ + kSCSICmd_READ_CD_MSF = 0xB9, /* Sec. 6.1.17: */ + kSCSICmd_READ_CAPACITY = 0x25, /* Sec. 6.1.18: */ + kSCSICmd_READ_DISC_INFORMATION = 0x51, /* Sec. 6.1.19: */ + kSCSICmd_READ_DVD_STRUCTURE = 0xAD, /* Sec. 6.1.20: */ + kSCSICmd_READ_DISC_STRUCTURE = 0xAD, /* Sec. 6.1.20: */ + kSCSICmd_READ_FORMAT_CAPACITIES = 0x23, /* Sec. 6.1.21: */ + kSCSICmd_READ_HEADER = 0x44, /* Sec. 6.1.22: */ + kSCSICmd_READ_LONG = 0x3E, /* Optional */ + kSCSICmd_READ_MASTER_CUE = 0x59, /* Sec. 6.1.23: */ + kSCSICmd_READ_SUB_CHANNEL = 0x42, /* Sec. 6.1.24: */ + kSCSICmd_READ_TOC_PMA_ATIP = 0x43, /* Sec. 6.1.25: */ + kSCSICmd_READ_TRACK_INFORMATION = 0x52, /* Sec. 6.1.27: */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* Mandatory */ + kSCSICmd_RELEASE_10 = 0x57, /* Optional */ + kSCSICmd_REPAIR_TRACK = 0x58, /* Sec. 6.1.28: */ + kSCSICmd_REPORT_KEY = 0xA4, /* Sec. 6.1.29: */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* Optional */ + kSCSICmd_RESERVE_TRACK = 0x53, /* Sec. 6.1.30: */ + kSCSICmd_SCAN_MMC = 0xBA, /* Sec. 6.1.31: */ + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, /* Obsolete */ + kSCSICmd_SEEK_6 = 0x0B, /* Obsolete */ + kSCSICmd_SEEK_10 = 0x2B, /* SBC: */ + kSCSICmd_SEND_CUE_SHEET = 0x5D, /* Sec. 6.1.32: */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Mandatory */ + kSCSICmd_SEND_DVD_STRUCTURE = 0xBF, /* Sec. 6.1.33: */ + kSCSICmd_SEND_EVENT = 0xA2, /* Sec. 6.1.34: */ + kSCSICmd_SEND_KEY = 0xA3, /* Sec. 6.1.35: */ + kSCSICmd_SEND_OPC_INFORMATION = 0x54, /* Sec. 6.1.36: */ + kSCSICmd_SET_CD_SPEED = 0xBB, /* Sec. 6.1.37: */ + kSCSICmd_SET_LIMITS_10 = 0x33, /* Optional */ + kSCSICmd_SET_LIMITS_12 = 0xB3, /* Optional */ + kSCSICmd_SET_READ_AHEAD = 0xA7, /* Sec. 6.1.38: */ + kSCSICmd_SET_STREAMING = 0xB6, /* Sec. 6.1.39: */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Optional */ + kSCSICmd_STOP_PLAY_SCAN = 0x4E, /* Sec. 6.1.40: */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.41: */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* Mandatory */ + kSCSICmd_VERIFY_10 = 0x2F, /* Optional */ + kSCSICmd_VERIFY_12 = 0xAF, /* Optional */ + kSCSICmd_WRITE_10 = 0x2A, /* Sec. 6.1.42: */ + kSCSICmd_WRITE_12 = 0xAA, /* Sec. 6.1.43: */ + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.1.44: */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x06 SGC Scanner Commands +/* Commands defined by the T10:998-D SCSI-3 Graphics Commands (SGC) + * specification. The definitions and section numbers are based on section 6 + * of the revision 0, April 1995 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* SPC: Optional */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_GET_DATA_BUFFER_STATUS = 0x34, /* Sec. 6.1.1: Optional */ + kSCSICmd_GET_WINDOW = 0x25, /* Sec. 6.1.2: Optional */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_OBJECT_POSITION = 0x31, /* Sec. 6.1.3: Optional */ + kSCSICmd_PORT_STATUS = 0x11, /* SPC (??): Mandatory + * for dual port devices */ + kSCSICmd_READ = 0x28, /* Sec. 6.1.4: Mandatory */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSCSICmd_SCAN = 0x1B, /* Sec. 6.1.5: Optional */ + kSCSICmd_SEND = 0x1B, /* Sec. 6.1.6: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SET_WINDOW = 0x24, /* Sec. 6.1.7: Mandatory */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* SPC: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x07 SBC Optical Media Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) + * (revision 8c, 13 November 1998) command specification. + */ + +#pragma mark - +#pragma mark 0x08 SMC Medium Changer Commands +/* Commands defined by the T10:1228-D SCSI-3 Medium Changer Commands-2 (SMC-2) + * (revision 0, March 16, 2000) command specification. + */ +#if 0 +enum +{ + /* Commands For Independent Medium Changers */ + kSCSICmd_EXCHANGE_MEDIUM = 0xA6, /* Optional */ + kSCSICmd_INITIALIZE_ELEMENT_STATUS = 0x07, /* Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCSICmd_MOVE_MEDIUM = 0xA5, /* Mandatory */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCSICmd_POSITION_TO_ELEMENT = 0x2B, /* Optional */ + kSCSICmd_READ_ELEMENT_STATUS = 0xB8, /* Mandatory */ + kSCSICmd_RELEASE_ELEMENT_6 = 0x16, /* Optional */ + kSCSICmd_RELEASE_ELEMENT_10 = 0x56, /* Optional */ + kSCSICmd_REQUEST_VOLUME_ELEMENT_ADDRESS = 0xB5, /* Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_ELEMENT_6 = 0x16, /* Optional */ + kSCSICmd_RESERVE_ELEMENT_10 = 0x56 /* Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x09 SSC Communications Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) + * (revision 22, January 1, 2000) command specification. + */ + +#pragma mark - +#pragma mark 0x0A ASC IT8 Prepress Commands +#pragma mark 0x0B ASC IT8 Prepress Commands +/* Commands defined by the ASC IT8 specification + * (revision xx, month day, year) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x0C SCC Array Controller Commands +/* Commands defined by the ANSI NCITS.318-199x SCSI Controller + * Commands (SCC-2) ratified command specification. + */ +#if 0 +enum +{ + kSCSICmd_MAINTENANCE_IN = 0xA3, /* Mandatory */ + kSCSICmd_MAINTENANCE_OUT = 0xA4, /* Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCSICmd_PORT_STATUS = 0x1F, /* Optional */ + kSCSICmd_REDUNDANCY_GROUP_IN = 0xBA, /* Mandatory */ + kSCSICmd_REDUNDANCY_GROUP_OUT = 0xBB, /* Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Optional */ + kSCSICmd_REPORT_LUNS = 0xA0, /* Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* Optional*/ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Optional */ + kSCSICmd_SPARE_IN = 0xBC, /* Mandatory */ + kSCSICmd_SPARE_OUT = 0xBD /* Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x0D SES Enclosure Services Commands +/* Commands defined by the T10:1212-D SCSI-3 Enclosure Services (SES) + * (revision 8b, February 11, 1998) command specification. + */ +#if 0 +enum +{ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x17, /* Mandatory */ + kSCSICmd_RELEASE_6 = 0x17, /* Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D /* Mandatory */ +}; +#endif + +#pragma mark - +#pragma mark 0x0E RBC Reduced Block Commands +/* Commands defined by the T10:1240-D Reduced Block Commands (RBC) + * (revision 10a, August 18, 1999) command specification. + */ +#if 0 +enum +{ + kSCSICmd_FORMAT_UNIT = 0x04, /* Optional */ + kSCSICmd_READ_10 = 0x28, /* Mandatory */ + kSCSICmd_READ_CAPACITY = 0x25, /* Mandatory */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Mandatory */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Optional */ + kSCSICmd_VERIFY_10 = 0x2F, /* Mandatory */ + kSCSICmd_WRITE_10 = 0x2A, /* Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Mandatory for fixed media + * Optional for removable */ +}; +#endif + +#pragma mark - +#pragma mark 0x0F OCRW Optical Card Commands +/* Commands defined by the ISO/IEC 14776-381 SCSI Specification for + * Optical Card Reader/Writer (OCRW) ratified command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x11 OSD Object-based Storage Commands +/* Commands defined by the T10:1355-D Object-based Storage Commands (OSD) + * (revision 1, 18 May 2000) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x15 RMC Simplified Multimedia Commands +/* Commands defined by the T10:1364-D Reduced Multimedia Commands (RMC) + * (revision 1, November 11, 1999) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#endif /* _SCSI_COMMAND_OPERATION_CODES_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSIPort.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSIPort.h.svn-base new file mode 100644 index 0000000..8eefbeb --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSIPort.h.svn-base @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_PORTS_H_ +#define _IOKIT_SCSI_PORTS_H_ + + +/*! @header SCSIPort + @discussion + This file contains all the definitions for SCSIPort notifications and status. +*/ + + +/*! +@enum kSCSIPort_NotificationStatusChange +@discussion +Message definition to be used with the messageClients +call to inform of a change in port status. +*/ +enum +{ + kSCSIPort_NotificationStatusChange = 0x68000001 +}; + + +/*! @typedef SCSIPortStatus + @abstract 32-bit number to represent a SCSIPortStatus. + @discussion Type for SCSIPortStatus. +*/ + +typedef UInt32 SCSIPortStatus; + +/*! @enum SCSI Port Status Values + @discussion Definitions for the possible port status values +*/ +enum +{ + /*! + @constant kSCSIPort_StatusOnline + The port is online. + */ + kSCSIPort_StatusOnline = 0, + + /*! + @constant kSCSIPort_StatusOffline + The port is offline (e.g. unplugged cable). + */ + kSCSIPort_StatusOffline = 1, + + /*! + @constant kSCSIPort_StatusFailure + Driver has detected unrecoverable port failure (e.g. hardware port failure) + */ + kSCSIPort_StatusFailure = 2 +}; + +#endif /* _IOKIT_SCSI_PORTS_H_ */ diff --git a/i386/include/IOKit/scsi/.svn/text-base/SCSITask.h.svn-base b/i386/include/IOKit/scsi/.svn/text-base/SCSITask.h.svn-base new file mode 100644 index 0000000..154c187 --- /dev/null +++ b/i386/include/IOKit/scsi/.svn/text-base/SCSITask.h.svn-base @@ -0,0 +1,456 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_SCSI_TASK_H_ +#define _IOKIT_SCSI_TASK_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSITask +SCSITask typedefs and constants used inside the kernel and user space. + +Note that the SCSITaskIdentifier is an opaque object and that directly +casting the SCSITaskIdentifier to any other type is discouraged. The SCSITask +implementation changes when necessary to accomodate architectural changes, +performance improvements, and bug fixes. + +Device and protocol layer drivers that need to access information +contained in a SCSITask should use the appropriate accessor methods in +IOSCSIPrimaryCommandsDevice.h or IOSCSIProtocolServices.h +*/ + + +/*! @typedef SCSIDeviceIdentifier + @abstract 64-bit number to represent a SCSI Device. + @discussion If the identifier can either be that of an initiator or a target, + SCSIDeviceIdentifier should be used. +*/ + +typedef UInt64 SCSIDeviceIdentifier; + +/*! @typedef SCSITargetIdentifier + @abstract 64-bit number to represent a SCSI Target Device. + @discussion If the identifier is for a target only and not an initiator, then + SCSITargetIdentifier should be used. +*/ + +typedef SCSIDeviceIdentifier SCSITargetIdentifier; + +/*! @typedef SCSIInitiatorIdentifier + @abstract 64-bit number to represent a SCSI Initiator Device. + @discussion If the identifier is for an initiator only and not a target, then + SCSIInitiatorIdentifier should be used. +*/ + +typedef SCSIDeviceIdentifier SCSIInitiatorIdentifier; + +/*! @typedef SCSILogicalUnitNumber + @abstract 64-bit number to represent a logical unit. + @discussion 64-bit number to represent a logical unit. +*/ + +typedef UInt64 SCSILogicalUnitNumber; + +/*! @typedef SCSITaggedTaskIdentifier + @abstract 64-bit number to represent a unique task identifier. + @discussion The Tagged Task Identifier is used when a Task has a Task Attribute other + than SIMPLE. The SCSI Application Layer client that controls the Logical + Unit for which a Task is intended is required to guarantee that the Task + Tag Identifier is unique. Zero cannot be used a a Tag value as this is used + to when a Tagged Task Identifier value is needed for a Task with a SIMPLE + attribute. +*/ + +typedef UInt64 SCSITaggedTaskIdentifier; + +/*! + @enum Untagged Task Identifier + @discussion The Untagged Task Identifier is used to indicate no unique tag + is associated with the Task. + @constant kSCSIUntaggedTaskIdentifier This value means the task is untagged. + */ + +enum +{ + kSCSIUntaggedTaskIdentifier = 0 +}; + +/*! + @typedef SCSITaskAttribute + @abstract Attributes for task delivery. + @discussion The Task Attribute defines how this task should be managed + when determing order for queueing and submission to the + appropriate device server. The Task Attribute is set by the SCSI + Application Layer and cannot be modified by the SCSI Protocol Layer. + @constant kSCSITask_SIMPLE The task has a simple attribute. + @constant kSCSITask_ORDERED The task has an ordered attribute. + @constant kSCSITask_HEAD_OF_QUEUE The task has a head-of-queue attribute. + @constant kSCSITask_ACA The task has an auto-contingent-allegiance attribute. + */ + +typedef enum SCSITaskAttribute +{ + kSCSITask_SIMPLE = 0, + kSCSITask_ORDERED = 1, + kSCSITask_HEAD_OF_QUEUE = 2, + kSCSITask_ACA = 3 +} SCSITaskAttribute; + +/*! + @typedef SCSITaskState + @abstract Attributes for task state. + @discussion The Task State represents the current state of the task. + The state is set to NEW_TASK when the task is created. The SCSI Protocol + Layer will then adjust the state as the task is queued and during + execution. The SCSI Application Layer can examine the state to monitor + the progress of a task. The Task State can only be modified by the SCSI + Protocol Layer. The SCSI Application Layer can only read the state. + @constant kSCSITaskState_NEW_TASK The task state is new task. + @constant kSCSITaskState_ENABLED The task is enabled and queued. + @constant kSCSITaskState_BLOCKED The task is blocked. + @constant kSCSITaskState_DORMANT The task is dormant. + @constant kSCSITaskState_ENDED The task is complete. + */ + +typedef enum SCSITaskState +{ + kSCSITaskState_NEW_TASK = 0, + kSCSITaskState_ENABLED = 1, + kSCSITaskState_BLOCKED = 2, + kSCSITaskState_DORMANT = 3, + kSCSITaskState_ENDED = 4 +} SCSITaskState; + + +/*! + @typedef SCSIServiceResponse + @abstract Attributes for task service response. + @discussion The Service Response represents the execution status of + a service request made to a Protocol Services Driver. The Service + Response can only be modified by the SCSI Protocol Layer. The SCSI + Application Layer can only read the state. + */ + +typedef enum SCSIServiceResponse +{ + /*! + @constant kSCSIServiceResponse_Request_In_Process + Not defined in SAM specification, but is a service response used + for asynchronous commands that are not yet completed. + */ + kSCSIServiceResponse_Request_In_Process = 0, + + /*! + @constant kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE + The service request failed because of a delivery or target failure. + */ + kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE = 1, + + /*! + @constant kSCSIServiceResponse_TASK_COMPLETE + The task completed. + */ + kSCSIServiceResponse_TASK_COMPLETE = 2, + + /*! + @constant kSCSIServiceResponse_LINK_COMMAND_COMPLETE + The linked command completed. + */ + kSCSIServiceResponse_LINK_COMMAND_COMPLETE = 3, + + /*! + @constant kSCSIServiceResponse_FUNCTION_COMPLETE + The task management function completed. + */ + kSCSIServiceResponse_FUNCTION_COMPLETE = 4, + + /*! + @constant kSCSIServiceResponse_FUNCTION_REJECTED + The task management function was rejected. + */ + kSCSIServiceResponse_FUNCTION_REJECTED = 5 +} SCSIServiceResponse; + +/*! + @typedef SCSITaskStatus + @abstract Attributes for task status. + @discussion The Task Status represents the completion status + of the task which provides the SCSI Application Layer with + additional information about how to procede in handling a + completed task. + + The SCSI Architecture Model specification only defines task + status values for when a task completes with a service response + of either TASK_COMPLETED or LINK_COMMAND_COMPLETE. + + Since additional information will aid in error recovery when + a task fails to be completed by a device due to a service + response of kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE, + additional values have been defined that can be returned by the + SCSI Protocol Layer to inform the SCSI Application Layer of the + cause of the delivery failure. + + The Task Status can only be modified by the SCSI Protocol Layer. + The SCSI Application Layer can only read the status +*/ +typedef enum SCSITaskStatus +{ + + /*! + @constant kSCSITaskStatus_GOOD + The task completed with a status of GOOD. + */ + + kSCSITaskStatus_GOOD = 0x00, + + /*! + @constant kSCSITaskStatus_CHECK_CONDITION + The task completed with a status of CHECK_CONDITION. Additional + information about the condition should be available in the sense data. + */ + + kSCSITaskStatus_CHECK_CONDITION = 0x02, + + /*! + @constant kSCSITaskStatus_CONDITION_MET + The task completed with a status of CONDITION_MET. + */ + + kSCSITaskStatus_CONDITION_MET = 0x04, + + /*! + @constant kSCSITaskStatus_BUSY + The task completed with a status of BUSY. The device server might need + time to process a request and a delay may be required. + */ + kSCSITaskStatus_BUSY = 0x08, + + /*! + @constant kSCSITaskStatus_INTERMEDIATE + The task completed with a status of INTERMEDIATE. + */ + kSCSITaskStatus_INTERMEDIATE = 0x10, + + /*! + @constant kSCSITaskStatus_INTERMEDIATE_CONDITION_MET + The task completed with a status of INTERMEDIATE_CONDITION_MET. + */ + kSCSITaskStatus_INTERMEDIATE_CONDITION_MET = 0x14, + + /*! + @constant kSCSITaskStatus_RESERVATION_CONFLICT + The task completed with a status of RESERVATION_CONFLICT. + */ + kSCSITaskStatus_RESERVATION_CONFLICT = 0x18, + + /*! + @constant kSCSITaskStatus_TASK_SET_FULL + The task completed with a status of TASK_SET_FULL. The device server + may need to complete a task before the initiator sends another. + */ + kSCSITaskStatus_TASK_SET_FULL = 0x28, + + /*! + @constant kSCSITaskStatus_ACA_ACTIVE + The task completed with a status of ACA_ACTIVE. The device server may + need the initiator to clear the Auto-Contingent Allegiance condition + before it will respond to new commands. + */ + kSCSITaskStatus_ACA_ACTIVE = 0x30, + + /*! + @constant kSCSITaskStatus_TaskTimeoutOccurred + If a task is aborted by the SCSI Protocol Layer due to it exceeding + the timeout value specified by the task, the task status shall be + set to kSCSITaskStatus_TaskTimeoutOccurred. + */ + + kSCSITaskStatus_TaskTimeoutOccurred = 0x01, + + /*! + @constant kSCSITaskStatus_ProtocolTimeoutOccurred + If a task is aborted by the SCSI Protocol Layer due to it exceeding a + timeout value specified by the support for the protocol or a related + specification, the task status shall be set to + kSCSITaskStatus_ProtocolTimeoutOccurred. + */ + + kSCSITaskStatus_ProtocolTimeoutOccurred = 0x02, + + /*! + @constant kSCSITaskStatus_DeviceNotResponding + If a task is unable to be delivered due to a failure of the device not + accepting the task or the device acknowledging the attempt to send it the + device the task status shall be set to kSCSITaskStatus_DeviceNotResponding. + This will allow the SCSI Application driver to perform the necessary steps + to try to recover the device. This shall only be reported after the SCSI + Protocol Layer driver has attempted all protocol specific attempts to recover + the device. + */ + + kSCSITaskStatus_DeviceNotResponding = 0x03, + + /*! + @constant kSCSITaskStatus_DeviceNotPresent + If the task is unable to be delivered because the device has been + detached, the task status shall be set to kSCSITaskStatus_DeviceNotPresent. + This will allow the SCSI Application Layer to halt the sending of tasks + to the device and, if supported, perform any device failover or system + cleanup. + */ + kSCSITaskStatus_DeviceNotPresent = 0x04, + + /*! + @constant kSCSITaskStatus_DeliveryFailure + If the task is unable to be + delivered to the device due to a failure in the SCSI Protocol Layer, + such as a bus reset or communications error, but the device is is + known to be functioning properly, the task status shall be set to + kSCSITaskStatus_DeliveryFailure. This can also be reported if the + task could not be delivered due to a protocol error that has since + been corrected. + */ + kSCSITaskStatus_DeliveryFailure = 0x05, + + /*! + @constant kSCSITaskStatus_No_Status + This status is not defined by + the SCSI specifications, but is here to provide a status that can + be returned in cases where there is not status available from the + device or protocol, for example, when the service response is + neither TASK_COMPLETED nor LINK_COMMAND_COMPLETE or when the + service response is SERVICE_DELIVERY_OR_TARGET_FAILURE and the + reason for failure could not be determined. + */ + kSCSITaskStatus_No_Status = 0xFF +} SCSITaskStatus; + +/*! + @enum Command Descriptor Block Size + @discussion Command Descriptor Block Size constants. +*/ +enum +{ + /*! + @constant kSCSICDBSize_Maximum This is the largest size a Command Descriptor + Block can be as specified in SPC-2. + */ + kSCSICDBSize_Maximum = 16, + + /*! + @constant kSCSICDBSize_6Byte Use this for a 6-byte CDB. + */ + kSCSICDBSize_6Byte = 6, + + /*! + @constant kSCSICDBSize_10Byte Use this for a 10-byte CDB. + */ + kSCSICDBSize_10Byte = 10, + + /*! + @constant kSCSICDBSize_12Byte Use this for a 12-byte CDB. + */ + kSCSICDBSize_12Byte = 12, + + /*! + @constant kSCSICDBSize_16Byte Use this for a 16-byte CDB. + */ + kSCSICDBSize_16Byte = 16 +}; + +typedef UInt8 SCSICommandDescriptorBlock[kSCSICDBSize_Maximum]; + +/*! + @enum Data Transfer Direction + @discussion DataTransferDirection constants. +*/ +enum +{ + /*! + @constant kSCSIDataTransfer_NoDataTransfer Use this for tasks + that transfer no data. + */ + kSCSIDataTransfer_NoDataTransfer = 0x00, + + /*! + @constant kSCSIDataTransfer_FromInitiatorToTarget Use this for tasks that transfer + data from the initiator to the target. + */ + kSCSIDataTransfer_FromInitiatorToTarget = 0x01, + + /*! + @constant kSCSIDataTransfer_FromTargetToInitiator Use this for tasks that transfer + data from the target to the initiator. + */ + kSCSIDataTransfer_FromTargetToInitiator = 0x02 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + +/* Libkern includes */ +#include <libkern/c++/OSObject.h> + + +/*! + @enum SCSITaskMode + @discussion The SCSI Task mode is used by the SCSI + Protocol Layer to indicate what mode the task is executing. +*/ +typedef enum SCSITaskMode +{ + kSCSITaskMode_CommandExecution = 1, + kSCSITaskMode_Autosense = 2 +} SCSITaskMode; + +/*! + @typedef SCSITaskIdentifier + @discussion This is an opaque object that represents a task. + This is used so that drivers for both the SCSI Protocol Layer + and the SCSI Application Layer cannot modify the SCSITask object + directly but must instead use the inherited methods to do so. This + allows the implementation of SCSITask to change without directly + impacting device and protocol layer drivers. In addition, it + prevents changing of properties that are not allowed to be + changed by a given layer. +*/ +typedef OSObject * SCSITaskIdentifier; + + +/*! + @typedef SCSITaskCompletion + @discussion This is the typedef for completion routines that + work with SCSITaskIdentifiers. +*/ +typedef void ( *SCSITaskCompletion )( SCSITaskIdentifier completedTask ); + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_SCSI_TASK_H_ */ diff --git a/i386/include/IOKit/scsi/IOBDServices.h b/i386/include/IOKit/scsi/IOBDServices.h new file mode 100644 index 0000000..70482d7 --- /dev/null +++ b/i386/include/IOKit/scsi/IOBDServices.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_BD_SERVICES_H_ +#define _IOKIT_IO_BD_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include <IOKit/IOTypes.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOBDTypes.h> +#include <IOKit/storage/IOBDBlockStorageDevice.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPeripheralDeviceType05.h> + +class IOMemoryDescriptor; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOBDServices : public IOBDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOBDServices ) + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ); + + // Reserve space for future expansion. + struct IOBDServicesExpansionData { }; + IOBDServicesExpansionData * fIOBDServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ); + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn readMCN ( CDMCN mcn); + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ); + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ); + + /* DVD Specific */ + virtual UInt32 getMediaType ( void ); + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn sendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn readDVDStructure ( IOMemoryDescriptor * buffer, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + /* BD Specific */ + virtual IOReturn readDiscStructure ( IOMemoryDescriptor * buffer, + UInt8 structureFormat, + UInt32 logicalBlockAddress, + UInt8 layer, + UInt8 agid, + UInt8 mediaType ); + + /* 10.6.0 */ + virtual IOReturn requestIdle ( void ); + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + virtual IOReturn setProperties ( OSObject * properties ); + + /* User Client Specific */ + virtual bool start ( IOService * provider ); + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ); + virtual void handleClose ( IOService * client, IOOptionBits options ); + virtual bool handleIsOpen ( const IOService * client ) const; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + + /* Added with 10.5 */ + virtual IOReturn splitTrack ( UInt32 address ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOBDServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOBDServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_BD_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/IOBlockStorageServices.h b/i386/include/IOKit/scsi/IOBlockStorageServices.h new file mode 100644 index 0000000..d62a02b --- /dev/null +++ b/i386/include/IOKit/scsi/IOBlockStorageServices.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ +#define _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include <IOKit/IOTypes.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOBlockStorageDevice.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIBlockCommandsDevice.h> + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOBlockStorageServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOBlockStorageServices ) + +private: + + bool fMediaChanged; /* DEPRECATED */ + bool fMediaPresent; + +protected: + + IOSCSIBlockCommandsDevice * fProvider; + + UInt64 fMaxReadBlocks; + UInt64 fMaxWriteBlocks; + + virtual bool attach ( IOService * provider ); + virtual void detach ( IOService * provider ); + virtual IOReturn newUserClient ( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ); + + // Reserve space for future expansion. + struct IOBlockStorageServicesExpansionData { }; + IOBlockStorageServicesExpansionData * fIOBlockStorageServicesReserved; + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/IOCompactDiscServices.h b/i386/include/IOKit/scsi/IOCompactDiscServices.h new file mode 100644 index 0000000..a9d4a31 --- /dev/null +++ b/i386/include/IOKit/scsi/IOCompactDiscServices.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_COMPACT_DISC_SERVICES_H_ +#define _IOKIT_IO_COMPACT_DISC_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include <IOKit/IOTypes.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOCDTypes.h> +#include <IOKit/storage/IOCDBlockStorageDevice.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPeripheralDeviceType05.h> + +class IOMemoryDescriptor; + +// Use this switch to turn off the data cache. +#define _USE_DATA_CACHING_ 1 + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOCompactDiscServices : public IOCDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOCompactDiscServices ) + +#if (_USE_DATA_CACHING_) + // Data Cache members + bool fUseDataCache; // Indicates if cache should be used. This + // will be set to false if all the necessary support + // for the data cache could not be allocated or + // initialized. + UInt8 * fDataCacheStorage; // Storage space for the cache + UInt32 fDataCacheStartBlock; // Starting block of the data in the cache. + UInt32 fDataCacheBlockCount; // Number of contiguous blocks in the cache + // starting with fDataCacheStartBlock. A value of + // zero in this member indicates that all data + // in the cache is invalid. + + IOSimpleLock * fDataCacheLock; // This is the lock for preventing multiple access + // while manipulating the data cache. +#endif + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ); + + // Reserve space for future expansion. + struct IOCompactDiscServicesExpansionData { }; + IOCompactDiscServicesExpansionData * fIOCompactDiscServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ); + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn readMCN ( CDMCN mcn); + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ); + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual UInt32 getMediaType ( void ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ); + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + virtual IOReturn setProperties ( OSObject * properties ); + + /* User Client Specific */ + virtual bool start ( IOService * provider ); + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ); + virtual void handleClose ( IOService * client, IOOptionBits options ); + virtual bool handleIsOpen ( const IOService * client ) const; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_COMPACT_DISC_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/IODVDServices.h b/i386/include/IOKit/scsi/IODVDServices.h new file mode 100644 index 0000000..8dccb17 --- /dev/null +++ b/i386/include/IOKit/scsi/IODVDServices.h @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_DVD_SERVICES_H_ +#define _IOKIT_IO_DVD_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// IOKit includes +#include <IOKit/IOTypes.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IODVDTypes.h> +#include <IOKit/storage/IODVDBlockStorageDevice.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPeripheralDeviceType05.h> + +class IOMemoryDescriptor; + +// Use this switch to turn off the data cache. +#define _DVD_USE_DATA_CACHING_ 1 + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IODVDServices : public IODVDBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IODVDServices ) + +#if (_DVD_USE_DATA_CACHING_) + // Data Cache members + bool fUseDataCache; // Indicates if cache should be used. This + // will be set to false if all the necessary support + // for the data cache could not be allocated or + // initialized. + UInt8 * fDataCacheStorage; // Storage space for the cache + UInt32 fDataCacheStartBlock; // Starting block of the data in the cache. + UInt32 fDataCacheBlockCount; // Number of contiguous blocks in the cache + // starting with fDataCacheStartBlock. A value of + // zero in this member indicates that all data + // in the cache is invalid. + + IOSimpleLock * fDataCacheLock; // This is the lock for preventing multiple access + // while manipulating the data cache. +#endif + +protected: + + OSSet * fClients; + IOSCSIPeripheralDeviceType05 * fProvider; + + virtual void free ( void ); + + // Reserve space for future expansion. + struct IODVDServicesExpansionData { }; + IODVDServicesExpansionData * fIODVDServicesReserved; + +public: + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + /* CD Specific */ + virtual IOReturn doAsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion ); + + virtual IOReturn readISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn readMCN ( CDMCN mcn); + + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer ); + + virtual IOReturn audioPause ( bool pause ); + + virtual IOReturn audioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn audioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn audioStop ( void ); + + virtual IOReturn getAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + + virtual IOReturn getSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn setSpeed ( UInt16 kilobytesPerSecond ); + + /* DVD Specific */ + virtual UInt32 getMediaType ( void ); + + virtual IOReturn reportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn sendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn readDVDStructure ( IOMemoryDescriptor * buffer, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + /* 10.6.0 */ + virtual IOReturn requestIdle ( void ); + + /* System Specific */ + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + virtual IOReturn setProperties ( OSObject * properties ); + + /* User Client Specific */ + virtual bool start ( IOService * provider ); + virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access ); + + virtual bool handleOpen ( IOService * client, IOOptionBits options, void * access ); + virtual void handleClose ( IOService * client, IOOptionBits options ); + virtual bool handleIsOpen ( const IOService * client ) const; + + /* Added with 10.1.3 */ + virtual IOReturn readTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt8 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + virtual IOReturn readTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IODVDServices, 1 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 2 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 3 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 4 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 5 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 6 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 7 ); + OSMetaClassDeclareReservedUnused ( IODVDServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_DVD_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/IOReducedBlockServices.h b/i386/include/IOKit/scsi/IOReducedBlockServices.h new file mode 100644 index 0000000..87ad8ed --- /dev/null +++ b/i386/include/IOKit/scsi/IOReducedBlockServices.h @@ -0,0 +1,147 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ +#define _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// Generic IOKit related headers +#include <IOKit/IOTypes.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOBlockStorageDevice.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPeripheralDeviceType0E.h> + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOReducedBlockServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOReducedBlockServices ) + + +protected: + // Reserve space for future expansion. + struct IOReducedBlockServicesExpansionData { }; + IOReducedBlockServicesExpansionData * fIOReducedBlockServicesReserved; + + IOSCSIPeripheralDeviceType0E * fProvider; + + virtual bool attach ( IOService * provider ); + virtual void detach ( IOService * provider ); + + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 1 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 2 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 3 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 4 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 5 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 6 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 7 ); + OSMetaClassDeclareReservedUnused ( IOReducedBlockServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_REDUCED_BLOCK_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h b/i386/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h new file mode 100644 index 0000000..2cb4a6d --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIBlockCommandsDevice.h @@ -0,0 +1,1146 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// SBC power states as defined in T10:996D SCSI Block Commands - 3 (SBC-3) +// Revision 8c, November 13, 1997, pages 10-11. +enum +{ + kSBCPowerStateSystemSleep = 0, + kSBCPowerStateSleep = 1, + kSBCPowerStateStandby = 2, + kSBCPowerStateIdle = 3, + kSBCPowerStateActive = 4, + kSBCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOService.h> +#include <IOKit/IOUserClient.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOStorage.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPrimaryCommandsDevice.h> + + +// Forward declaration for the SCSIBlockCommands that is used internally by the +// IOSCSIBlockCommandsDevice class. +class SCSIBlockCommands; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIBlockCommandsDevice ) + +private: + + +#ifndef __LP64__ + + SCSIBlockCommands * fSCSIBlockCommandObject; + SCSIBlockCommands * GetSCSIBlockCommandObject ( void ); + +#endif /* !__LP64__ */ + + IOReturn GetWriteCacheState ( IOMemoryDescriptor * buffer, + UInt8 modePageControlValue ); + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIBlockCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fWriteCacheEnabled; + bool fDeviceIsShared; + UInt64 fMediumBlockCount64; + bool fDeviceHasSATTranslation; + bool fProtocolSpecificPowerControl; + bool fRequiresEjectWithStartStopUnit; + }; + IOSCSIBlockCommandsDeviceExpansionData * fIOSCSIBlockCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIBlockCommandsDeviceReserved->fPowerDownNotifier + #define fWriteCacheEnabled fIOSCSIBlockCommandsDeviceReserved->fWriteCacheEnabled + + // The fDeviceIsShared is used to indicate whether this device exists on a Physical + // Interconnect that allows multiple initiators to access it. This is used mainly + // by the power management code to not send power state related START_STOP_UNIT + // commands to the device. + // The fDeviceIsShared value is also used to prevent power state commands from being + // sent to manual eject device since these devices behave better when allowed to + // manage their own power. + #define fDeviceIsShared fIOSCSIBlockCommandsDeviceReserved->fDeviceIsShared + + // The fMediumBlockCount64 provides support for 64 bit LBAs and + // replaces fMediumBlockCount which only supports 32 bits. + // This value should not be directly accessed and instead the member routine + // ReportMediumTotalBlockCount() should be used to retrieve it and the member routine + // SetMediumCharacteristics() should be used to set it. + #define fMediumBlockCount64 fIOSCSIBlockCommandsDeviceReserved->fMediumBlockCount64 + + #define fDeviceHasSATTranslation fIOSCSIBlockCommandsDeviceReserved->fDeviceHasSATTranslation + + // Device support protocol specific power off + #define fProtocolSpecificPowerControl fIOSCSIBlockCommandsDeviceReserved->fProtocolSpecificPowerControl + + // Device requires START_STOP_UNIT for ejects, regardless if PREVENT_ALLOW_MEIDUMREMOVAL + // failed. + #define fRequiresEjectWithStartStopUnit fIOSCSIBlockCommandsDeviceReserved->fRequiresEjectWithStartStopUnit + +private: + /* OBSOLETE. Use IOSCSIPrimaryCommandsDevice::Get/SetANSIVersion */ + UInt8 fANSIVersion; + +protected: + // ---- Device Characteristics ---- + bool fMediaIsRemovable; + + // ---- Medium Characteristics ---- + bool fMediumPresent; + +private: + // The byte count of each physical block on the medium. + // This value should not be directly accessed and instead the member routine + // ReportMediumBlockSize() should be used to retrieve it and the member routine + // SetMediumCharacteristics() should be used to set it. + UInt32 fMediumBlockSize; + + // The total number of blocks of fMediumBlockSize on the medium. + // OBSOLETE. Use fMediumBlockCount64 instead which allows for support of + // devices that have 33 through 64 bit LBA values. + UInt32 fMediumBlockCount; + +protected: + // Whether the installed medium is protected from writes + bool fMediumIsWriteProtected; + + // Whether user removal of medium has been prevented + bool fMediumRemovalPrevented; + + // Indicates whether this is a known manual eject device + bool fKnownManualEject; + + // Polling thread variables + thread_call_t fPollingThread; + UInt32 fPollingMode; + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + // ---- Methods for controlling the current state of device support ---- + virtual bool InitializeDeviceSupport ( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport ( void ); + virtual void ResumeDeviceSupport ( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport ( void ); + + virtual void free ( void ); + +#ifndef __LP64__ + + // This method will retrieve the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the subclasses base command set object. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + + virtual bool CreateCommandSetObjects ( void ); + virtual void FreeCommandSetObjects ( void ); + +#endif /* !__LP64__ */ + + virtual bool ClearNotReadyStatus ( void ); + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + + // ---- Methods used for controlling the polling thread ---- + virtual void ProcessPoll ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + + // Main and support methods for polling for new Media + virtual void PollForNewMedia ( void ); + virtual bool DetermineMediaPresence ( void ); + virtual bool PreventMediumRemoval ( void ); + virtual bool DetermineMediumCapacity ( + UInt64 * blockSize, + UInt64 * blockCount ); + virtual bool DetermineMediumWriteProtectState ( void ); + + // Main and support methods for polling for Media removal + virtual void PollForMediaRemoval ( void ); + + // ---- Methods used for handling medium characteristics ---- + + // OBSOLETE - Use the version compatible with 64 bit LBAs instead. + virtual void SetMediumCharacteristics ( + UInt32 blockSize, + UInt32 blockCount ); + + void SetMediumCharacteristics ( + UInt64 blockSize, + UInt64 blockCount ); + + virtual void ResetMediumCharacteristics ( void ); + + virtual IOReturn IssueRead ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + virtual IOReturn IssueWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ); + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ); + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // The TicklePowerManager method is called to tell the power manager that + // the device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ); + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the + // command gate and can change member variables safely without + // multi-threading issues. It's main purpose is to call the superclass' + // HandleCheckPowerState ( UInt32 maxPowerState ) with the max power state + // the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The VerifyMediumPresence method is called to see if the medium which we + // anticipated being there is still there. + virtual bool VerifyMediumPresence ( void ); + +public: + + static void sProcessPoll ( void * pdtDriver, void * refCon ); + + // ---- Methods for controlling the device ---- + virtual IOReturn SyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize ); + + virtual IOReturn AsyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + void * clientData ); + + IOReturn GetWriteCacheState ( bool * enabled ); + IOReturn SetWriteCacheState ( bool enabled ); + void DetermineMediumGeometry ( void ); + + // ---- Methods for controlling medium state ---- + virtual IOReturn EjectTheMedium ( void ); + virtual IOReturn LockUnlockMedium ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + + // ---- Methods for controlling media format ---- + virtual IOReturn FormatMedium ( + UInt64 blockCount, + UInt64 blockSize ); + virtual UInt32 GetFormatCapacities ( + UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + // ---- Query methods to report device characteristics ---- + + // Report the maximum number of blocks that the device can handle per + // read or write. A value of 0 (zero) indicates there is no limit aside + // from the size of the method's return parameter. + virtual UInt64 ReportDeviceMaxBlocksReadTransfer ( void ); + virtual UInt64 ReportDeviceMaxBlocksWriteTransfer ( void ); + + // Report whether the device supports removal of the media. + virtual bool ReportDeviceMediaRemovability ( void ); + + // ---- Query methods to report installed medium characteristics ---- + virtual UInt64 ReportMediumBlockSize ( void ); + virtual UInt64 ReportMediumTotalBlockCount ( void ); + virtual bool ReportMediumWriteProtection ( void ); + + +protected: + + +#ifndef __LP64__ + + // Command methods to access all commands available to SBC based devices. + virtual bool ERASE_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit ERA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool ERASE_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit ERA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount defectListSize, + SCSICmdField1Bit FMTDATA, + SCSICmdField1Bit CMPLST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField1Byte VENDOR_SPECIFIC, + SCSICmdField2Byte INTERLEAVE, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 Section 5.41 + bool FORMAT_UNIT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount defectListSize, + SCSICmdField1Bit FMTPINFO, + SCSICmdField1Bit RTO_REQ, + SCSICmdField1Bit LONGLIST, + SCSICmdField1Bit FMTDATA, + SCSICmdField1Bit CMPLST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField1Byte VENDOR_SPECIFIC, + SCSICmdField1Byte CONTROL ); + + virtual bool LOCK_UNLOCK_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit LOCK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.5 + bool LOCK_UNLOCK_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit LOCK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + bool LOCK_UNLOCK_CACHE_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit LOCK, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + virtual bool MEDIUM_SCAN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit WBS, + SCSICmdField1Bit ASA, + SCSICmdField1Bit PSD, + SCSICmdField1Bit PRA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PREFETCH ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.7 + bool PREFETCH ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool PREFETCH_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField21Bit LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.10 + bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.11 + bool READ_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + bool READ_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit RDPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + bool READ_CAPACITY_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool READ_DEFECT_DATA_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PLIST, + SCSICmdField1Bit GLIST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_DEFECT_DATA_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PLIST, + SCSICmdField1Bit GLIST, + SCSICmdField3Bit DEFECT_LIST_FORMAT, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_GENERATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_LONG ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CORRCT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte BYTE_TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool READ_LONG_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte BYTE_TRANSFER_LENGTH, + SCSICmdField1Bit CORRCT, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_UPDATED_BLOCK_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit LATEST, + SCSICmdField15Bit GENERATION_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool REASSIGN_BLOCKS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.20 + bool REASSIGN_BLOCKS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit LONGLBA, + SCSICmdField1Bit LONGLIST, + SCSICmdField1Byte CONTROL ); + + virtual bool REBUILD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit INTDATA, + SCSICmdField2Bit PORT_CONTROL, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte REBUILD_LENGTH, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REGENERATE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit INTDATA, + SCSICmdField2Bit PORT_CONTROL, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte REBUILD_LENGTH, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REZERO_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + + virtual bool SEARCH_DATA_EQUAL_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit INVERT, + SCSICmdField1Bit SPNDAT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS_TO_SEARCH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEARCH_DATA_HIGH_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit INVERT, + SCSICmdField1Bit SPNDAT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS_TO_SEARCH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEARCH_DATA_LOW_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit INVERT, + SCSICmdField1Bit SPNDAT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS_TO_SEARCH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEEK_6 ( + SCSITaskIdentifier request, + SCSICmdField21Bit LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool SEEK_10 ( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_LIMITS_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RDINH, + SCSICmdField1Bit WRINH, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_LIMITS_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RDINH, + SCSICmdField1Bit WRINH, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START, + SCSICmdField1Byte CONTROL ); + + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.22 + bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit SYNC_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + bool SYNCRONIZE_CACHE_16 ( + SCSITaskIdentifier request, + SCSICmdField1Bit SYNC_NV, + SCSICmdField1Bit IMMED, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte NUMBER_OF_BLOCKS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool UPDATE_BLOCK ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + virtual bool VERIFY_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BLKVFY, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.24 + bool VERIFY_10 ( + SCSITaskIdentifier request, + SCSICmdField3Bit VRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool VERIFY_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BLKVFY, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.25 + bool VERIFY_12 ( + SCSITaskIdentifier request, + SCSICmdField3Bit VRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField4Byte VERIFICATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool VERIFY_16 ( + SCSITaskIdentifier request, + SCSICmdField3Bit VRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte VERIFICATION_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField2Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.29 + bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.30 + bool WRITE_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool WRITE_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit EBP, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.33 + bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_AND_VERIFY_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit EBP, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.34 + bool WRITE_AND_VERIFY_12 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + bool WRITE_AND_VERIFY_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + + virtual bool WRITE_LONG ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool WRITE_LONG_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Bit CORRCT, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_SAME ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PBDATA, + SCSICmdField1Bit LBDATA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.39 + bool WRITE_SAME ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit PBDATA, + SCSICmdField1Bit LBDATA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + bool WRITE_SAME_16 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit PBDATA, + SCSICmdField1Bit LBDATA, + SCSICmdField8Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField1Byte CONTROL ); + + virtual bool XDREAD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.42 + bool XDREAD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit XORPINFO, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool XDWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.43 + bool XDWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField1Bit FUA_NV, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool XDWRITE_EXTENDED ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit TABLE_ADDRESS, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField2Bit PORT_CONTROL, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte SECONDARY_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte SECONDARY_ADDRESS, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.46 + bool XDWRITEREAD_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit WRPROTECT, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit DISABLE_WRITE, + SCSICmdField1Bit FUA_NV, + SCSICmdField1Bit XORPINFO, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool XPWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // Defined in SBC-2 section 5.48 + bool XPWRITE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit FUA_NV, + SCSICmdField1Bit XORPINFO, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField5Bit GROUP_NUMBER, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* __LP64__ */ + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 1 ); + +public: + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 2 ); + +protected: + + virtual void SetMediumIcon ( void ); + + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 3 ); + +protected: + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + + /* Added with 10.6.0 */ + OSMetaClassDeclareReservedUsed ( IOSCSIBlockCommandsDevice, 4 ); + +public: + + virtual IOReturn AsyncReadWrite ( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + IOStorageAttributes * attributes, + void * clientData ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIBlockCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_BLOCK_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h b/i386/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h new file mode 100644 index 0000000..f812a39 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIMultimediaCommandsDevice.h @@ -0,0 +1,1057 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + +#include <IOKit/storage/IOStorageDeviceCharacteristics.h> + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +// Message constants +#define kIOMessageTrayStateChange 0x69000035 +#define kIOMessageTrayStateHasChanged kIOMessageTrayStateChange // DEPRECATED, use kIOMessageTrayStateChange instead + +// Message values for kIOMessageTrayStateChange +enum +{ + kMessageTrayStateChangeRequestAccepted = 0, + kMessageTrayStateChangeRequestRejected = 1 +}; + +#define kIOMessageMediaAccessChange 0x69000036 + +// Message values for kIOMessageMediaAccessChange +enum +{ + kMessageDeterminingMediaPresence = 0, + kMessageFoundMedia = 1, + kMessageMediaTypeDetermined = 2 +}; + +// IOKit property keys and constants +#define kIOPropertySupportedCDFeatures kIOPropertySupportedCDFeaturesKey +#define kIOPropertySupportedDVDFeatures kIOPropertySupportedDVDFeaturesKey +#define kIOPropertySupportedBDFeatures kIOPropertySupportedBDFeaturesKey +#define kIOPropertyLowPowerPolling "Low Power Polling" + +typedef UInt32 CDFeatures; +enum +{ + kCDFeaturesAnalogAudioBit = 0, // Analog Audio playback + kCDFeaturesReadStructuresBit = 1, // CD-ROM + kCDFeaturesWriteOnceBit = 2, // CD-R + kCDFeaturesReWriteableBit = 3, // CD-R/W + kCDFeaturesCDDAStreamAccurateBit = 4, // CD-DA stream accurate + kCDFeaturesPacketWriteBit = 5, // Packet Writing + kCDFeaturesTAOWriteBit = 6, // CD Track At Once + kCDFeaturesSAOWriteBit = 7, // CD Mastering - Session At Once + kCDFeaturesRawWriteBit = 8, // CD Mastering - Raw + kCDFeaturesTestWriteBit = 9, // CD Mastering/TAO - Test Write + kCDFeaturesBUFWriteBit = 10 // CD Mastering/TAO - Buffer Underrun Free +}; + +enum +{ + kCDFeaturesAnalogAudioMask = (1 << kCDFeaturesAnalogAudioBit), + kCDFeaturesReadStructuresMask = (1 << kCDFeaturesReadStructuresBit), + kCDFeaturesWriteOnceMask = (1 << kCDFeaturesWriteOnceBit), + kCDFeaturesReWriteableMask = (1 << kCDFeaturesReWriteableBit), + kCDFeaturesCDDAStreamAccurateMask = (1 << kCDFeaturesCDDAStreamAccurateBit), + kCDFeaturesPacketWriteMask = (1 << kCDFeaturesPacketWriteBit), + kCDFeaturesTAOWriteMask = (1 << kCDFeaturesTAOWriteBit), + kCDFeaturesSAOWriteMask = (1 << kCDFeaturesSAOWriteBit), + kCDFeaturesRawWriteMask = (1 << kCDFeaturesRawWriteBit), + kCDFeaturesTestWriteMask = (1 << kCDFeaturesTestWriteBit), + kCDFeaturesBUFWriteMask = (1 << kCDFeaturesBUFWriteBit) +}; + +typedef UInt32 DVDFeatures; +enum +{ + kDVDFeaturesCSSBit = 0, // DVD-CSS + kDVDFeaturesReadStructuresBit = 1, // DVD-ROM + kDVDFeaturesWriteOnceBit = 2, // DVD-R + kDVDFeaturesRandomWriteableBit = 3, // DVD-RAM + kDVDFeaturesReWriteableBit = 4, // DVD-RW + kDVDFeaturesTestWriteBit = 5, // DVD-R Write - Test Write + kDVDFeaturesBUFWriteBit = 6, // DVD-R Write - Buffer Underrun Free + kDVDFeaturesPlusRBit = 7, // DVD+R + kDVDFeaturesPlusRWBit = 8, // DVD+RW (implies backgound format support) + kDVDFeaturesHDReadBit = 9, // HD DVD-ROM + kDVDFeaturesHDRBit = 10, // HD DVD-R + kDVDFeaturesHDRAMBit = 11, // HD DVD-RAM + kDVDFeaturesHDRWBit = 12 // HD DVD-RW +}; + +enum +{ + kDVDFeaturesCSSMask = (1 << kDVDFeaturesCSSBit), + kDVDFeaturesReadStructuresMask = (1 << kDVDFeaturesReadStructuresBit), + kDVDFeaturesWriteOnceMask = (1 << kDVDFeaturesWriteOnceBit), + kDVDFeaturesRandomWriteableMask = (1 << kDVDFeaturesRandomWriteableBit), + kDVDFeaturesReWriteableMask = (1 << kDVDFeaturesReWriteableBit), + kDVDFeaturesTestWriteMask = (1 << kDVDFeaturesTestWriteBit), + kDVDFeaturesBUFWriteMask = (1 << kDVDFeaturesBUFWriteBit), + kDVDFeaturesPlusRMask = (1 << kDVDFeaturesPlusRBit), + kDVDFeaturesPlusRWMask = (1 << kDVDFeaturesPlusRWBit), + kDVDFeaturesHDReadMask = (1 << kDVDFeaturesHDReadBit), + kDVDFeaturesHDRMask = (1 << kDVDFeaturesHDRBit), + kDVDFeaturesHDRAMMask = (1 << kDVDFeaturesHDRAMBit), + kDVDFeaturesHDRWMask = (1 << kDVDFeaturesHDRWBit) +}; + +typedef UInt32 BDFeatures; +enum +{ + kBDFeaturesReadBit = 0, // BD-ROM + kBDFeaturesWriteBit = 1 // BD-R / BD-RE +}; + +enum +{ + kBDFeaturesReadMask = (1 << kBDFeaturesReadBit), + kBDFeaturesWriteMask = (1 << kBDFeaturesWriteBit) +}; + +enum +{ + kDiscStatusEmpty = 0, + kDiscStatusIncomplete = 1, + kDiscStatusComplete = 2, + kDiscStatusOther = 3, + kDiscStatusMask = 0x03, + kDiscStatusErasableMask = 0x10 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + +// MMC power states as defined in T10:1228D SCSI Multimedia Commands - 2 (MMC-2) +// Revision 11a, August 30, 1999, page 312 (Annex F). +enum +{ + kMMCPowerStateSystemSleep = 0, + kMMCPowerStateSleep = 1, + kMMCPowerStateStandby = 2, + kMMCPowerStateIdle = 3, + kMMCPowerStateActive = 4, + kMMCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOMemoryDescriptor.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOStorage.h> +#include <IOKit/storage/IOCDTypes.h> +#include <IOKit/storage/IODVDTypes.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPrimaryCommandsDevice.h> + +// Forward definitions for internal use only classes +class SCSIMultimediaCommands; +class SCSIBlockCommands; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIMultimediaCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIMultimediaCommandsDevice ) + +private: + +#ifndef __LP64__ + + SCSIMultimediaCommands * fSCSIMultimediaCommandObject; + SCSIMultimediaCommands * GetSCSIMultimediaCommandObject ( void ); + + SCSIBlockCommands * fSCSIBlockCommandObject; /* OBSOLETE */ + SCSIBlockCommands * GetSCSIBlockCommandObject ( void ); /* OBSOLETE */ + +#endif /* !__LP64__ */ + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIMultimediaCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fDeviceSupportsPowerOff; + BDFeatures fSupportedBDFeatures; + bool fDeviceSupportsAsyncNotification; + bool fDeviceSupportsFastSpindown; + UInt8 fCDLoadingMechanism; + }; + IOSCSIMultimediaCommandsDeviceExpansionData * fIOSCSIMultimediaCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIMultimediaCommandsDeviceReserved->fPowerDownNotifier + #define fDeviceSupportsPowerOff fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsPowerOff + #define fSupportedBDFeatures fIOSCSIMultimediaCommandsDeviceReserved->fSupportedBDFeatures + #define fDeviceSupportsAsyncNotification fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsAsyncNotification + #define fDeviceSupportsFastSpindown fIOSCSIMultimediaCommandsDeviceReserved->fDeviceSupportsFastSpindown + #define fCDLoadingMechanism fIOSCSIMultimediaCommandsDeviceReserved->fCDLoadingMechanism + +#ifndef __LP64__ + + // This method will retreive the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the subclasses base command set object. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + +#endif /* !__LP64__ */ + + CDFeatures fSupportedCDFeatures; + DVDFeatures fSupportedDVDFeatures; + + UInt16 fCurrentDiscSpeed; + bool fMediaChanged; + bool fMediaPresent; + + // The byte count of each physical block on the media. + UInt32 fMediaBlockSize; + + // The total number of blocks of fMediaBlockSize on the media. + UInt32 fMediaBlockCount; + + // Flags used to indicate device feature + bool fMediaIsRemovable; + bool fMediaIsWriteProtected; + UInt32 fMediaType; + + thread_call_t fPollingThread; + bool fDeviceSupportsLowPowerPolling; + bool fLowPowerPollingEnabled; + UInt32 fPollingMode; + + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + virtual IOReturn setProperties ( OSObject * properties ); + + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + virtual IOReturn DetermineIfMediaIsRemovable ( void ); + virtual IOReturn DetermineDeviceFeatures ( void ); + virtual void DetermineMediaType ( void ); + virtual bool CheckForDVDMediaType ( void ); + virtual bool CheckForCDMediaType ( void ); + virtual void PollForMedia ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + virtual void CheckWriteProtection ( void ); + virtual bool ClearNotReadyStatus ( void ); + + virtual IOReturn GetDeviceConfiguration ( void ); + virtual IOReturn GetDeviceConfigurationSize ( UInt32 * size ); + virtual IOReturn ParseFeatureList ( UInt32 numProfiles, UInt8 * firstFeaturePtr ); + + virtual IOReturn GetMechanicalCapabilities ( void ); + virtual IOReturn GetMechanicalCapabilitiesSize ( UInt32 * size ); + virtual IOReturn ParseMechanicalCapabilities ( UInt8 * mechanicalCapabilitiesPtr ); + + virtual IOReturn CheckForLowPowerPollingSupport ( void ); + virtual IOReturn GetCurrentPowerStateOfDrive ( UInt32 * powerState ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + void * clientData, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + void * clientData, + UInt64 startBlock, + UInt64 blockCount ); + + virtual void SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount ); + virtual void ResetMediaCharacteristics ( void ); + + UInt8 ConvertBCDToHex ( UInt8 binaryCodedDigit ); + + // ------ User Client Support ------ + + virtual IOReturn HandleSetUserClientExclusivityState ( IOService * userClient, bool state ); + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ); + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ); + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // The TicklePowerManager method is called to tell the power manager that the + // device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ); + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The CheckMediaPresence method is called to see if the media which we + // anticipated being there is still there. + virtual bool CheckMediaPresence ( void ); + + virtual bool InitializeDeviceSupport ( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport ( void ); + virtual void ResumeDeviceSupport ( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport ( void ); + + virtual void free ( void ); + +#ifndef __LP64__ + + virtual bool CreateCommandSetObjects ( void ); + virtual void FreeCommandSetObjects ( void ); + +#endif /* !__LP64__ */ + + virtual IOReturn VerifyDeviceState ( void ); + + +public: + + virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes ); + + virtual IOReturn SyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn AsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + void * clientData ); + + virtual IOReturn EjectTheMedia ( void ); + virtual IOReturn GetTrayState ( UInt8 * trayState ); + virtual IOReturn SetTrayState ( UInt8 trayState ); + virtual IOReturn FormatMedia ( UInt64 byteCapacity ); + virtual UInt32 GetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + virtual IOReturn LockUnlockMedia ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + virtual IOReturn ReportBlockSize ( UInt64 * blockSize ); + virtual IOReturn ReportEjectability ( bool * isEjectable ); + virtual IOReturn ReportLockability ( bool * isLockable ); + virtual IOReturn ReportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + virtual IOReturn ReportMaxReadTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMaxValidBlock ( UInt64 * maxBlock ); + virtual IOReturn ReportMaxWriteTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMediaState ( bool * mediaPresent, + bool * changed ); + virtual IOReturn ReportRemovability ( bool * isRemovable ); + virtual IOReturn ReportWriteProtection ( bool * isWriteProtected ); + + static void sPollForMedia ( void * pdtDriver, void * refCon ); + + /* CD Specific */ + virtual IOReturn SetMediaAccessSpeed ( UInt16 kilobytesPerSecond ); + + virtual IOReturn GetMediaAccessSpeed ( UInt16 * kilobytesPerSecond ); + + virtual IOReturn AsyncReadCD ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + CDSectorArea sectorArea, + CDSectorType sectorType, + void * clientData ); + + virtual IOReturn ReadISRC ( UInt8 track, CDISRC isrc ); + + virtual IOReturn ReadMCN ( CDMCN mcn); + + virtual IOReturn ReadTOC ( IOMemoryDescriptor * buffer ); + +#ifndef __LP64__ + + virtual IOReturn AudioPause ( bool pause ); + + virtual IOReturn AudioPlay ( CDMSF timeStart, CDMSF timeStop ); + + virtual IOReturn AudioScan ( CDMSF timeStart, bool reverse ); + + virtual IOReturn AudioStop ( void ); + + virtual IOReturn GetAudioStatus ( CDAudioStatus * status ); + + virtual IOReturn GetAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume ); + + virtual IOReturn SetAudioVolume ( UInt8 leftVolume, UInt8 rightVolume ); + +#endif /* !__LP64__ */ + + /* DVD Specific */ + virtual UInt32 GetMediaType ( void ); + + virtual IOReturn ReportKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 lba, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn SendKey ( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 agid, + const DVDKeyFormat keyFormat ); + + virtual IOReturn ReadDVDStructure ( IOMemoryDescriptor * buffer, + const UInt32 length, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid ); + + // The block size decoding for Read CD and Read CD MSF as defined in table 255 + bool GetBlockSize ( + UInt32 * requestedByteCount, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS ); + + SCSICmdField4Byte ConvertMSFToLBA ( SCSICmdField3Byte MSF ); + +#ifndef __LP64__ + + // Command methods to access all commands available to MMC based devices. + // The BLANK command as defined in section 6.1.1 + virtual bool BLANK ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField3Bit BLANKING_TYPE, + SCSICmdField4Byte START_ADDRESS_TRACK_NUMBER, + SCSICmdField1Byte CONTROL ); + + // The CLOSE TRACK/SESSION command as defined in section 6.1.2 + virtual bool CLOSE_TRACK_SESSION ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit SESSION, + SCSICmdField1Bit TRACK, + SCSICmdField2Byte TRACK_NUMBER, + SCSICmdField1Byte CONTROL ); + + // The FORMAT UNIT command as defined in section 6.1.3 + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount parameterListSize, + SCSICmdField1Bit FMT_DATA, + SCSICmdField1Bit CMP_LIST, + SCSICmdField3Bit FORMAT_CODE, + SCSICmdField2Byte INTERLEAVE_VALUE, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + + // The GET CONFIGURATION command as defined in section 6.1.4 + virtual bool GET_CONFIGURATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit RT, + SCSICmdField2Byte STARTING_FEATURE_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The GET EVENT/STATUS NOTIFICATION command as defined in section 6.1.5 + virtual bool GET_EVENT_STATUS_NOTIFICATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit IMMED, + SCSICmdField1Byte NOTIFICATION_CLASS_REQUEST, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The GET PERFORMANCE command as defined in section 6.1.6 + virtual bool GET_PERFORMANCE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit TOLERANCE, + SCSICmdField1Bit WRITE, + SCSICmdField2Bit EXCEPT, + SCSICmdField4Byte STARTING_LBA, + SCSICmdField2Byte MAXIMUM_NUMBER_OF_DESCRIPTORS, + SCSICmdField1Byte CONTROL ); + + // The LOAD/UNLOAD MEDIUM command as defined in section 6.1.7 + virtual bool LOAD_UNLOAD_MEDIUM ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit LO_UNLO, + SCSICmdField1Bit START, + SCSICmdField1Byte SLOT, + SCSICmdField1Byte CONTROL ); + + // The MECHANISM STATUS command as defined in section 6.1.8 + virtual bool MECHANISM_STATUS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + // The PAUSE/RESUME command as defined in section 6.1.9 + virtual bool PAUSE_RESUME ( + SCSITaskIdentifier request, + SCSICmdField1Bit RESUME, + SCSICmdField1Byte CONTROL ); + + // The PLAY AUDIO (10) command as defined in section 6.1.10 + virtual bool PLAY_AUDIO_10 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte PLAY_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The PLAY AUDIO (12) command as defined in section 6.1.11 + virtual bool PLAY_AUDIO_12 ( + SCSITaskIdentifier request, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte PLAY_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The PLAY AUDIO MSF command as defined in section 6.1.12 + virtual bool PLAY_AUDIO_MSF ( + SCSITaskIdentifier request, + SCSICmdField3Byte STARTING_MSF, + SCSICmdField3Byte ENDING_MSF, + SCSICmdField1Byte CONTROL ); + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The PLAY CD command as defined in section 6.1.13 + virtual bool PLAY_CD ( + SCSITaskIdentifier request, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit CMSF, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte PLAY_LENGTH_IN_BLOCKS, + SCSICmdField1Bit SPEED, + SCSICmdField1Bit PORT2, + SCSICmdField1Bit PORT1, + SCSICmdField1Bit COMPOSITE, + SCSICmdField1Bit AUDIO, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT *******************/ + +#endif /* !__LP64__ */ + + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The READ BUFFER CAPACITY command as defined in section 6.1.14 + virtual bool READ_BUFFER_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT *******************/ + +#endif /* !__LP64__ */ + + // The READ CD command as defined in section 6.1.15 + virtual bool READ_CD ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte STARTING_LOGICAL_BLOCK_ADDRESS, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS, + SCSICmdField1Byte CONTROL ); + + // The READ CD MSF command as defined in section 6.1.16 + virtual bool READ_CD_MSF ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit EXPECTED_SECTOR_TYPE, + SCSICmdField3Byte STARTING_MSF, + SCSICmdField3Byte ENDING_MSF, + SCSICmdField1Bit SYNC, + SCSICmdField2Bit HEADER_CODES, + SCSICmdField1Bit USER_DATA, + SCSICmdField1Bit EDC_ECC, + SCSICmdField2Bit ERROR_FIELD, + SCSICmdField3Bit SUBCHANNEL_SELECTION_BITS, + SCSICmdField1Byte CONTROL ); + + // The READ CAPACITY command as defined in section 6.1.17 + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI, + SCSICmdField1Byte CONTROL ); + + // The READ DISC INFORMATION command as defined in section 6.1.18 + virtual bool READ_DISC_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ DVD STRUCTURE command as defined in section 6.1.19 + virtual bool READ_DVD_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ADDRESS, + SCSICmdField1Byte LAYER_NUMBER, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField1Byte CONTROL ); + + // The READ FORMAT CAPACITIES command as defined in section 6.1.20 + virtual bool READ_FORMAT_CAPACITIES ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The READ HEADER command as defined in section 6.1.21 + virtual bool READ_HEADER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The READ MASTER CUE command as defined in section 6.1.22 + virtual bool READ_MASTER_CUE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte SHEET_NUMBER, + SCSICmdField3Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + +#endif /* !__LP64__ */ + + // The READ SUB-CHANNEL command as defined in section 6.1.23 + virtual bool READ_SUB_CHANNEL ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField1Bit SUBQ, + SCSICmdField1Byte SUB_CHANNEL_PARAMETER_LIST, + SCSICmdField1Byte TRACK_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ TOC/PMA/ATIP command as defined in section 6.1.24/25 + virtual bool READ_TOC_PMA_ATIP ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit MSF, + SCSICmdField4Bit FORMAT, + SCSICmdField1Byte TRACK_SESSION_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The READ TRACK INFORMATION command as defined in section 6.1.26 + virtual bool READ_TRACK_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Bit ADDRESS_NUMBER_TYPE, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS_TRACK_SESSION_NUMBER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The REPAIR TRACK command as defined in section 6.1.27 + virtual bool REPAIR_TRACK ( + SCSITaskIdentifier request, + SCSICmdField2Byte TRACK_NUMBER, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + // The REPORT KEY command as defined in section 6.1.28 + virtual bool REPORT_KEY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + // The RESERVE TRACK command as defined in section 6.1.29 + virtual bool RESERVE_TRACK ( + SCSITaskIdentifier request, + SCSICmdField4Byte RESERVATION_SIZE, + SCSICmdField1Byte CONTROL ); + + // The SCAN command as defined in section 6.1.30 + virtual bool SCAN ( + SCSITaskIdentifier request, + SCSICmdField1Bit DIRECT, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte SCAN_STARTING_ADDRESS_FIELD, + SCSICmdField2Bit TYPE, + SCSICmdField1Byte CONTROL ); + + // The SEND CUE SHEET command as defined in section 6.1.31 + virtual bool SEND_CUE_SHEET ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Byte CUE_SHEET_SIZE, + SCSICmdField1Byte CONTROL ); + + // The SEND DVD STRUCTURE command as defined in section 6.1.32 + virtual bool SEND_DVD_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte STRUCTURE_DATA_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The SEND EVENT command as defined in section 6.1.33 + virtual bool SEND_EVENT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit IMMED, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The SEND KEY command as defined in section 6.1.34 + virtual bool SEND_KEY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + // The SEND OPC INFORMATION command as defined in section 6.1.35 + virtual bool SEND_OPC_INFORMATION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DO_OPC, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); +#endif /* !__LP64__ */ + + /*********************** LEGACY COMMAND SUPPORT ***********************/ + // The SET CD SPEED command as defined in section 6.1.36 + virtual bool SET_CD_SPEED ( + SCSITaskIdentifier request, + SCSICmdField2Byte LOGICAL_UNIT_READ_SPEED, + SCSICmdField2Byte LOGICAL_UNIT_WRITE_SPEED, + SCSICmdField1Byte CONTROL ); + /*********************** END LEGACY COMMAND SUPPORT ***********************/ + + // The SET READ AHEAD command as defined in section 6.1.37 + virtual bool SET_READ_AHEAD ( + SCSITaskIdentifier request, + SCSICmdField4Byte TRIGGER_LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte READ_AHEAD_LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte CONTROL ); + + // The SET STREAMING command as defined in section 6.1.38 + virtual bool SET_STREAMING ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + // The STOP PLAY/SCAN command as defined in section 6.1.39 + virtual bool STOP_PLAY_SCAN ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + // The SYNCHRONIZE CACHE command as defined in section 6.1.40 + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte NUMBER_OF_BLOCKS, + SCSICmdField1Byte CONTROL ); + + // The WRITE (10) command as defined in section 6.1.41 + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The WRITE AND VERIFY (10) command as defined in section 6.1.42 + virtual bool WRITE_AND_VERIFY_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYT_CHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 1 ); + + virtual IOReturn ReadTOC ( IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 msf, + UInt32 trackSessionNumber, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 2 ); + + virtual IOReturn ReadDiscInfo ( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); + + /* Added with 10.1.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 3 ); + + virtual IOReturn ReadTrackInfo ( IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount ); + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 4 ); + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 5 ); + + +protected: + + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + +public: + + + /* Added with 10.5 */ + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 6 ); + + virtual IOReturn ReadDiscStructure ( IOMemoryDescriptor * buffer, + const UInt32 length, + const UInt8 structureFormat, + const UInt32 logicalBlockAddress, + const UInt8 layer, + const UInt8 agid, + const UInt8 mediaType ); + + + bool CheckForBDMediaType ( void ); + + + bool READ_DISC_STRUCTURE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MEDIA_TYPE, + SCSICmdField4Byte ADDRESS, + SCSICmdField1Byte LAYER_NUMBER, + SCSICmdField1Byte FORMAT, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField1Byte CONTROL ); + + + OSMetaClassDeclareReservedUsed ( IOSCSIMultimediaCommandsDevice, 7 ); + + virtual IOReturn ReserveTrack ( UInt8 reservationType, + UInt8 reservationFormat, + UInt64 ReservationParameter ); + + + bool RESERVE_TRACK_V2 ( SCSITaskIdentifier request, + SCSICmdField1Bit RMZ, + SCSICmdField1Bit ARSV, + SCSICmdField7Byte RESERVATION_PARAMETER, + SCSICmdField1Byte CONTROL ); + + + bool REPORT_KEY_V2 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + + bool SEND_KEY_V2 ( SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte KEY_CLASS, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField2Bit AGID, + SCSICmdField6Bit KEY_FORMAT, + SCSICmdField1Byte CONTROL ); + + +protected: + + + void SetPollingMode ( UInt32 newPollingMode ); + + +public: + + + /* 10.6.0 */ + + IOReturn RequestIdle ( void ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIMultimediaCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_MULTIMEDIA_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h new file mode 100644 index 0000000..f88a1e9 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceNub.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Probe score values +enum +{ + kPeripheralDeviceTypeNoMatch = 0, + kDefaultProbeRanking = 5000, + kFirstOrderRanking = 10000, + kSecondOrderRanking = 15000, + kThirdOrderRanking = 20000 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOService.h> +#include <IOKit/IOSyncer.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIProtocolServices.h> + + +// Forward definitions for internal use only classes. +class SCSIPrimaryCommands; + +//----------------------------------------------------------------------------- +// Class Declarations +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceNub : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceNub ) + +private: + + static bool sCompareIOProperty ( + IOService * object, + OSDictionary * table, + char * propertyKeyName, + bool * matches ); + + static void TaskCallback ( SCSITaskIdentifier completedTask ); + void TaskCompletion ( SCSITaskIdentifier completedTask ); + + static IOReturn sWaitForTask ( void * object, SCSITask * request ); + IOReturn GatedWaitForTask ( SCSITask * request ); + +protected: + + SCSIServiceResponse SendTask ( SCSITask * request ); + + bool InterrogateDevice ( void ); + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceNubExpansionData { }; + IOSCSIPeripheralDeviceNubExpansionData * fIOSCSIPeripheralDeviceNubReserved; + + IOSCSIProtocolInterface * fProvider; +#ifndef __LP64__ + SCSIPrimaryCommands * fSCSIPrimaryCommandObject; +#endif + UInt8 fDefaultInquiryCount; + + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + // We override this method in order to NOT do power management + virtual void InitializePowerManagement ( IOService * provider ); + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void free ( void ); + + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ); + + virtual bool matchPropertyTable ( OSDictionary * table, + SInt32 * score ); + + // The ExecuteCommand method will take a SCSITask object and transport + // it across the physical wires to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + virtual SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + virtual SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ); + + virtual SCSIServiceResponse TargetReset ( void ); + + // ************* Obsoleted Member Routine **************** + // The AbortCommand method is replaced by the AbortTask Management function and + // should no longer be called. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier abortTask ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 16 ); + +}; + + + +class IOSCSILogicalUnitNub : public IOSCSIPeripheralDeviceNub +{ + + OSDeclareDefaultStructors ( IOSCSILogicalUnitNub ) + +private: + + UInt8 fLogicalUnitNumber; + +protected: + + // Reserve space for future expansion. + struct IOSCSILogicalUnitNubExpansionData { }; + IOSCSILogicalUnitNubExpansionData * fIOSCSILogicalUnitNubReserved; + +public: + + virtual bool start ( IOService * provider ); + + virtual void SetLogicalUnitNumber ( UInt8 newLUN ); + + UInt8 GetLogicalUnitNumber ( void ); + + // The ExecuteCommand method will take a SCSITask object and transport + // it across the physical wires to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ); + + // The AbortCommand method will abort the indicated SCSI Task object, + // if it is possible and the SCSI Task has not already completed. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier abortTask ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h new file mode 100644 index 0000000..34fdb18 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType00.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIBlockCommandsDevice.h> + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType00 : public IOSCSIBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType00 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType00ExpansionData + { + OSSet * fClients; + }; + IOSCSIPeripheralDeviceType00ExpansionData * fIOSCSIPeripheralDeviceType00Reserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void free ( void ); + + virtual bool handleOpen ( + IOService * client, + IOOptionBits options, + void * access ); + + virtual void handleClose ( + IOService * client, + IOOptionBits options ); + + virtual bool handleIsOpen ( const IOService * client ) const; + + virtual IOReturn newUserClient ( + task_t owningTask, + void * securityID, + UInt32 type, + OSDictionary * properties, + IOUserClient ** handler ); + virtual void CreateStorageServiceNub ( void ); + + virtual char * GetVendorString ( void ); + virtual char * GetProductString ( void ); + virtual char * GetRevisionString ( void ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType00, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_OO_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h new file mode 100644 index 0000000..22066f0 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType05.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType05 : public IOSCSIMultimediaCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType05 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType05ExpansionData { }; + IOSCSIPeripheralDeviceType05ExpansionData * fIOSCSIPeripheralDeviceType05Reserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType05, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_05_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h new file mode 100644 index 0000000..661136d --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType07.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIBlockCommandsDevice.h> + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType07 : public IOSCSIBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType07 ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType07ExpansionData { }; + IOSCSIPeripheralDeviceType07ExpansionData * fIOSCSIPeripheralDeviceType07Reserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType07, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_07_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h new file mode 100644 index 0000000..cc9ec06 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIPeripheralDeviceType0E.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ +#define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include <IOKit/IOLib.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h> + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPeripheralDeviceType0E : public IOSCSIReducedBlockCommandsDevice +{ + + OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceType0E ) + +protected: + + // Reserve space for future expansion. + struct IOSCSIPeripheralDeviceType0EExpansionData { }; + IOSCSIPeripheralDeviceType0EExpansionData * fIOSCSIPeripheralDeviceType0EReserved; + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceType0E, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_TYPE_0E_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h b/i386/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h new file mode 100644 index 0000000..ba0f1a0 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIPrimaryCommandsDevice.h @@ -0,0 +1,805 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOService.h> +#include <IOKit/IOReturn.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOSyncer.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/SCSICommandDefinitions.h> +#include <IOKit/scsi/SCSICmds_INQUIRY_Definitions.h> +#include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h> +#include <IOKit/scsi/IOSCSIProtocolInterface.h> + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Notification messages +enum +{ + kSCSIServicesNotification_Suspend = 0x69000080, + kSCSIServicesNotification_Resume = 0x69000090 +}; + + +// Timeout values +enum +{ + kOneSecondTimeoutInMS = 1000, + kTenSecondTimeoutInMS = 10 * kOneSecondTimeoutInMS, + kThirtySecondTimeoutInMS = 30 * kOneSecondTimeoutInMS, + kFortyFiveSecondTimeoutInMS = 45 * kOneSecondTimeoutInMS +}; + +// Mode page values for page control field +enum +{ + kModePageControlCurrentValues = 0x00, + kModePageControlChangeableValues = 0x01, + kModePageControlDefaultValues = 0x02, + kModePageControlSavedValues = 0x03 +}; + +// The command should be tried 5 times. The original attempt +// plus 4 retries. +#define kDefaultRetryCount 4 + +// Forward declarations for internal use only classes +class SCSIPrimaryCommands; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIPrimaryCommandsDevice : public IOSCSIProtocolInterface +{ + + OSDeclareAbstractStructors ( IOSCSIPrimaryCommandsDevice ) + +private: + +#ifndef __LP64__ + SCSIPrimaryCommands * fSCSIPrimaryCommandObject; +#endif + + IOSCSIProtocolInterface * fProtocolDriver; + + // The fProtocolAccessEnabled member variable indicates whether + // requests coming from the client can be sent to the device. + // This will be set to true after the Protocol Service driver is successfully + // opened and before the call to InitializeDeviceSupport and set to false before + // TerminateDeviceSupport is called. + bool fProtocolAccessEnabled; + + // The fDeviceAccessEnabled member variable indicates whether + // requests coming from the client can be sent to the device. + // This will be set to true after InitializeDeviceSupport is called and + // set to false before StopDeviceSupport is called. + bool fDeviceAccessEnabled; + bool fDeviceAccessSuspended; + + static bool ServerKeyswitchCallback ( void * target, + void * refCon, + IOService * newService ); + + static void TaskCallback ( SCSITaskIdentifier completedTask ); + void TaskCompletion ( SCSITaskIdentifier completedTask ); + + static IOReturn sWaitForTask ( void * object, SCSITaskIdentifier request ); + IOReturn GatedWaitForTask ( SCSITaskIdentifier request ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIPrimaryCommandsDeviceExpansionData + { + IONotifier * fKeySwitchNotifier; + UInt8 fANSIVersion; + UInt32 fReadTimeoutDuration; + UInt32 fWriteTimeoutDuration; + bool fCMDQUE; + SCSITaggedTaskIdentifier fTaskID; + IOSimpleLock * fTaskIDLock; + UInt32 fRetryCount; + }; + IOSCSIPrimaryCommandsDeviceExpansionData * fIOSCSIPrimaryCommandsDeviceReserved; + + #define fReadTimeoutDuration fIOSCSIPrimaryCommandsDeviceReserved->fReadTimeoutDuration + #define fWriteTimeoutDuration fIOSCSIPrimaryCommandsDeviceReserved->fWriteTimeoutDuration + #define fRetryCount fIOSCSIPrimaryCommandsDeviceReserved->fRetryCount + + + UInt8 fDefaultInquiryCount; + OSDictionary * fDeviceCharacteristicsDictionary; + UInt32 fNumCommandsOutstanding; + + virtual void free ( void ); + void SetANSIVersion ( UInt8 ); + void SetCMDQUE ( bool value ); + IOReturn GetModeSense ( + IOMemoryDescriptor * dataBuffer, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + bool * use10ByteModeSense ); + bool RetrieveINQUIRYData ( + UInt8 EVPD, + UInt8 inquiryPage, + UInt8 * inquiryBuffer, + UInt16 * dataSize ); + + // This flag is set if the device responds to a MODE_SENSE_10 command + // with the page code set to 0x1A (Power Conditions Mode Page) + bool fDeviceSupportsPowerConditions; + + // This method will retreive the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the base command set object of the subclass. + +#ifndef __LP64__ + + // ------ DEPRECATED API ---------- + // This should no longer be called by subclasses as the command builder + // objects will be removed in a later release. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + + // This method is called by the start method to create all the command + // objects needed by the class. For subclasses, this will be overridden + // to create its needed command set objects. + virtual bool CreateCommandSetObjects ( void ); + + // This method is called by the free method to free all the command + // objects needed by the class. For subclasses, this will be overridden + // to free its needed command set objects. + virtual void FreeCommandSetObjects ( void ); + +#endif + + + // This method is called by the start method to obtain information from + // the device with regards to whether it supports the power conditions mode page. + virtual void CheckPowerConditionsModePage ( void ); + + // This will return back the Protocol driver that is used to + // send service requests to the device. + virtual IOSCSIProtocolInterface * GetProtocolDriver ( void ); + + // This will get a new SCSITask for the caller + virtual SCSITaskIdentifier GetSCSITask ( void ); + + // This will release a SCSITask (eventually return it to a pool) + virtual void ReleaseSCSITask ( SCSITaskIdentifier request ); + + // This will return a unique value for the tagged task identifier + SCSITaggedTaskIdentifier GetUniqueTagID ( void ); + + // Call for executing the command synchronously + SCSIServiceResponse SendCommand ( + SCSITaskIdentifier request, + UInt32 timeoutDuration ); + + // Call for executing the command asycnchronously + void SendCommand ( + SCSITaskIdentifier request, + UInt32 timeoutDuration, + SCSITaskCompletion taskCompletion ); + + + virtual bool InitializeDeviceSupport ( void ) = 0; + virtual void StartDeviceSupport ( void ) = 0; + virtual void SuspendDeviceSupport ( void ) = 0; + virtual void ResumeDeviceSupport ( void ) = 0; + virtual void StopDeviceSupport ( void ) = 0; + virtual void TerminateDeviceSupport ( void ) = 0; + virtual UInt32 GetNumberOfPowerStateTransitions ( void ) = 0; + + virtual IOReturn VerifyDeviceState ( void ); + // Called to clear any power-on/reset status in the drive + virtual bool ClearPowerOnReset ( void ); + virtual bool ClearNotReadyStatus ( void ) = 0; + + bool IsProtocolAccessEnabled ( void ); + bool IsDeviceAccessEnabled ( void ); + bool IsDeviceAccessSuspended ( void ); + + // Accessors for saving and retrieving data from an SCSITask object. + bool ResetForNewTask( + SCSITaskIdentifier request ); + bool SetTaskAttribute ( + SCSITaskIdentifier request, + SCSITaskAttribute newAttribute ); + SCSITaskAttribute GetTaskAttribute ( + SCSITaskIdentifier request ); + bool SetTaggedTaskIdentifier ( + SCSITaskIdentifier request, + SCSITaggedTaskIdentifier taggedTaskIdentifier ); + SCSITaggedTaskIdentifier GetTaggedTaskIdentifier ( + SCSITaskIdentifier request ); + bool SetTaskState ( + SCSITaskIdentifier request, + SCSITaskState newTaskState ); + SCSITaskState GetTaskState ( + SCSITaskIdentifier request ); + bool SetTaskStatus ( + SCSITaskIdentifier request, + SCSITaskStatus newStatus ); + SCSITaskStatus GetTaskStatus ( + SCSITaskIdentifier request ); + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5 ); + + // Populate the 10 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9 ); + + // Populate the 12 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9, + UInt8 cdbByte10, + UInt8 cdbByte11 ); + + // Populate the 16 Byte Command Descriptor Block + bool SetCommandDescriptorBlock ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5, + UInt8 cdbByte6, + UInt8 cdbByte7, + UInt8 cdbByte8, + UInt8 cdbByte9, + UInt8 cdbByte10, + UInt8 cdbByte11, + UInt8 cdbByte12, + UInt8 cdbByte13, + UInt8 cdbByte14, + UInt8 cdbByte15 ); + + bool SetDataTransferDirection ( + SCSITaskIdentifier request, + UInt8 newDirection ); + UInt8 GetDataTransferDirection ( + SCSITaskIdentifier request ); + bool SetRequestedDataTransferCount ( + SCSITaskIdentifier request, + UInt64 newRequestedCount ); + UInt64 GetRequestedDataTransferCount ( + SCSITaskIdentifier request ); + bool SetRealizedDataTransferCount ( + SCSITaskIdentifier request, + UInt64 newRealizedDataCount ); + UInt64 GetRealizedDataTransferCount ( + SCSITaskIdentifier request ); + bool SetDataBuffer ( + SCSITaskIdentifier request, + IOMemoryDescriptor * newBuffer ); + IOMemoryDescriptor * GetDataBuffer ( + SCSITaskIdentifier request ); + bool SetTimeoutDuration ( + SCSITaskIdentifier request, + UInt32 newTimeout ); + UInt32 GetTimeoutDuration ( + SCSITaskIdentifier request ); + bool SetTaskCompletionCallback ( + SCSITaskIdentifier request, + SCSITaskCompletion newCallback ); + void TaskCompletedNotification ( + SCSITaskIdentifier request ); + + bool SetServiceResponse ( + SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse ); + SCSIServiceResponse GetServiceResponse ( + SCSITaskIdentifier request ); + bool SetAutosenseCommand ( + SCSITaskIdentifier request, + UInt8 cdbByte0, + UInt8 cdbByte1, + UInt8 cdbByte2, + UInt8 cdbByte3, + UInt8 cdbByte4, + UInt8 cdbByte5 ); + bool GetAutoSenseData ( + SCSITaskIdentifier request, + SCSI_Sense_Data * senseData ); // DEPRECATED, use below function instead + bool GetAutoSenseData ( + SCSITaskIdentifier request, + SCSI_Sense_Data * senseData, + UInt8 senseDataSize ); + UInt8 GetAutoSenseDataSize ( + SCSITaskIdentifier request ); + + bool SetApplicationLayerReference ( + SCSITaskIdentifier request, + void * newReferenceValue ); + void * GetApplicationLayerReference ( + SCSITaskIdentifier request ); + + void IncrementOutstandingCommandsCount ( void ); + static void sIncrementOutstandingCommandsCount ( + IOSCSIPrimaryCommandsDevice * self ); + virtual void HandleIncrementOutstandingCommandsCount ( void ); + + + // This static member routine provides a mechanism for retrieving a pointer to + // the object that is claimed as the owner of the specified SCSITask. + static OSObject * sGetOwnerForTask ( SCSITaskIdentifier request ); + +public: + + bool init ( OSDictionary * propTable ); + virtual bool start ( IOService * provider ); + virtual void stop ( IOService * provider ); + virtual IOReturn message ( UInt32 type, IOService * nub, void * arg ); + + // The setAgressiveness method is called by the power manager + // to notify us of certain power management settings. We override + // this method in order to catch the kPMMinutesToSpinDown message + // in order to set our idle timer. + virtual IOReturn setAggressiveness ( unsigned long type, unsigned long minutes ); + + // Methods for getting device information strings + virtual char * GetVendorString ( void ); + virtual char * GetProductString ( void ); + virtual char * GetRevisionString ( void ); + OSDictionary * GetProtocolCharacteristicsDictionary ( void ); + OSDictionary * GetDeviceCharacteristicsDictionary ( void ); + UInt8 GetANSIVersion ( void ); + bool GetCMDQUE ( void ); + OSString * MapINQUIRYDataToIconFile ( void ); + UInt32 GetRetryCount ( void ); + + // -- SCSI Protocol Interface Methods -- + // The ExecuteCommand method will take a SCSI Task and transport + // it across the physical wire(s) to the device + virtual void ExecuteCommand ( SCSITaskIdentifier request ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ); + + SCSIServiceResponse TargetReset ( void ); + + // The AbortCommand method will abort the indicated SCSI Task, + // if it is possible and the task has not already completed. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( + SCSIProtocolFeature feature, + void * serviceValue ); + + // The HandleProtocolServiceFeature will return true if the specified feature could + // be handled properly by the protocol layer. + virtual bool HandleProtocolServiceFeature ( + SCSIProtocolFeature feature, + void * serviceValue ); + + // Utility methods for use by all peripheral device objects. + + // isParameterValid are used to validate that the parameter passed into + // the command methods are of the correct value. + + // Validate Parameter used for 1 bit to 1 byte paramaters + bool IsParameterValid ( + SCSICmdField1Byte param, + SCSICmdField1Byte mask ); + + // Validate Parameter used for 9 bit to 2 byte paramaters + bool IsParameterValid ( + SCSICmdField2Byte param, + SCSICmdField2Byte mask ); + + // Validate Parameter used for 17 bit to 4 byte paramaters + bool IsParameterValid ( + SCSICmdField4Byte param, + SCSICmdField4Byte mask ); + + // Validate Parameter used for 33 bit to 8 byte paramaters + bool IsParameterValid ( + SCSICmdField8Byte param, + SCSICmdField8Byte mask ); + + + bool IsMemoryDescriptorValid ( + IOMemoryDescriptor * dataBuffer ); + + bool IsMemoryDescriptorValid ( + IOMemoryDescriptor * dataBuffer, + UInt64 requiredSize ); + +#ifndef __LP64__ + + // SCSI Primary command implementations + virtual bool CHANGE_DEFINITION ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit SAVE, + SCSICmdField7Bit DEFINITION_PARAMETER, + SCSICmdField1Byte PARAMETER_DATA_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool COMPARE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PAD, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool COPY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PAD, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool COPY_AND_VERIFY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit PAD, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool EXTENDED_COPY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CMDDT, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool LOG_SELECT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PCR, + SCSICmdField1Bit SP, + SCSICmdField2Bit PC, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool LOG_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PPC, + SCSICmdField1Bit SP, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte PARAMETER_POINTER, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SELECT_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField1Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SELECT_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SENSE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool MODE_SENSE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit LLBAA, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PERSISTENT_RESERVE_IN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool PERSISTENT_RESERVE_OUT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Bit SCOPE, + SCSICmdField4Bit TYPE, + SCSICmdField1Byte CONTROL ); + + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( + SCSITaskIdentifier request, + SCSICmdField2Bit PREVENT, + SCSICmdField1Byte CONTROL ); + + virtual bool READ_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RECEIVE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RECEIVE_DIAGNOSTICS_RESULTS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PCV, + SCSICmdField1Byte PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RELEASE_6 ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RELEASE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool RELEASE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RELEASE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool REPORT_DEVICE_IDENTIFIER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REPORT_LUNS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool REQUEST_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool RESERVE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RESERVE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool RESERVE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#ifndef __LP64__ + + virtual bool RESERVE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit THRDPTY, + SCSICmdField1Bit LONGID, + SCSICmdField1Bit EXTENT, + SCSICmdField1Byte RESERVATION_IDENTIFICATION, + SCSICmdField1Byte THIRD_PARTY_DEVICE_ID, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + +#endif /* !__LP64__ */ + + virtual bool SEND ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit AER, + SCSICmdField3Byte TRANSFER_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SEND_DIAGNOSTICS ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField3Bit SELF_TEST_CODE, + SCSICmdField1Bit PF, + SCSICmdField1Bit SELF_TEST, + SCSICmdField1Bit DEVOFFL, + SCSICmdField1Bit UNITOFFL, + SCSICmdField2Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool SET_DEVICE_IDENTIFIER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + virtual bool TEST_UNIT_READY ( + SCSITaskIdentifier request, + SCSICmdField1Byte CONTROL ); + + virtual bool WRITE_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte PARAMETER_LIST_LENGTH, + SCSICmdField1Byte CONTROL ); + + // The SPC-3 INQUIRY command as defined in section 6.4.1 of SPC-3. + bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_CODE, + SCSICmdField2Byte ALLOCATION_LENGTH, + SCSICmdField1Byte CONTROL ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 1 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 2 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIPrimaryCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PRIMARY_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIProtocolInterface.h b/i386/include/IOKit/scsi/IOSCSIProtocolInterface.h new file mode 100644 index 0000000..bb74ce4 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIProtocolInterface.h @@ -0,0 +1,854 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ +#define _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ + + +/*! @header SCSI Protocol Interface + @discussion + This file contains definitions for the IOSCSIProtocolInterface class, + SCSI Protocol Features used by this interface, and additional constants + used by this interface. +*/ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#include <IOKit/storage/IOStorageDeviceCharacteristics.h> + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +/* +SCSI Device Characteristics - Defined between SCSI Application Layer and + SCSI Protocol Layer only. +*/ + +/*! +@constant kIOPropertySCSIDeviceCharacteristicsKey +@discussion +This key is used to define SCSI Device Characteristics for a particular device. +It is the key for the dictionary containing the keys of characteristics. These keys +are only defined between the SCSI Protocol Layer and the SCSI Applicaiton Layer. Some +properties may be copied from this dictionary to the more generic Device Characteristics +or Protocol Characteristics dictionaries. +*/ +#define kIOPropertySCSIDeviceCharacteristicsKey "SCSI Device Characteristics" + +/*! +@constant kIOPropertySCSIInquiryLengthKey +@discussion +This key is used to define a default INQUIRY length to issue to the device. The +value is a UInt32 corresponding to the number of bytes to request in the INQUIRY +command. +*/ +#define kIOPropertySCSIInquiryLengthKey "Inquiry Length" + +/*! +@constant kIOPropertySCSIManualEjectKey +@discussion +This key is used to indicate that the device is known to be a manual ejectable media +device. This property overrides all of the driver checks for determining this capability. +This property is a string, although if it exists it should always be true. +*/ +#define kIOPropertySCSIManualEjectKey "Manual Eject" + +/*! +@constant kIOPropertyReadTimeOutDurationKey +@discussion +This key is used to define the Read Time Out for a particular device. +This property overrides all of the protocol defaults. +This property is a value, in milliseconds. +*/ +#define kIOPropertyReadTimeOutDurationKey "Read Time Out Duration" + +/*! +@constant kIOPropertyWriteTimeOutDurationKey +@discussion +This key is used to define the Write Time Out for a particular device. +This property overrides all of the protocol defaults. +This property is a value, in milliseconds. +*/ +#define kIOPropertyWriteTimeOutDurationKey "Write Time Out Duration" + +/*! +@constant kIOPropertyRetryCountKey +@discussion +This key is used to define the number of Read/Write retries for a particular device. +This property overrides all of the protocol defaults. +The value is a UInt32 corresponding to the number of retries. +*/ +#define kIOPropertyRetryCountKey "Retry Count" + +/*! + @constant kIOPropertyAutonomousSpinDownKey + @discussion + This key is used to indicate that the device is known to have its own internal logic + for idle disk spin down. This key is used to mark device which respon poorly to our + efforts to manually spin down or spin up the device when it is already in the desired + state. + */ +#define kIOPropertyAutonomousSpinDownKey "Autonomous Spin Down" + +/*! + @constant kIOPropertyEjectRequireStartStopUnitKey + @discussion + This key is used to indicate that while the device may have failed PREVENT_ALLOW_MEDIUM + REMOVAL it still requires a START_STOP_UNIT to eject/unload media. + */ +#define kIOPropertyEjectRequireStartStopUnitKey "Eject Requires START_STOP_UNIT" + +#if defined(KERNEL) && defined(__cplusplus) + + +/*! +@constant kCFBundleIdentifierKey +@discussion +Property key for CFBundleIdentifier. +*/ +#define kCFBundleIdentifierKey "CFBundleIdentifier" + +/*! +@constant kIOSCSIArchitectureBundleIdentifierKey +@discussion +IOSCSIArchitectureModelFamily's CFBundle identifier. +*/ +#define kIOSCSIArchitectureBundleIdentifierKey "com.apple.iokit.IOSCSIArchitectureModelFamily" + + +// General kernel headers +#include <kern/thread.h> + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOService.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IOWorkLoop.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/SCSITask.h> + + +/*! +@enum SCSI Protocol Interface Device Notification values +@discussion +Message values for SCSI Protocol Interface Device Notifications. +@constant kSCSIProtocolNotification_DeviceRemoved +Private message sent between a SCSI protocol service provider and +SCSI application layer driver to indicate device removal. +@constant kSCSIProtocolNotification_VerifyDeviceState +Private message sent between a SCSI protocol service provider and +SCSI application layer driver to indicate device state may have +changed and the device state should be re-verified by the SCSI +Application Layer driver. An example would be a bus reset which clears +the tray locking state of an ATAPI device. +@constant kSCSIServicesNotification_ExclusivityChanged +Message sent when a change in exclusivity state occurs. Usually in +response to acquiring/releasing exclusive access to a device via a user client. +*/ +enum +{ + kSCSIProtocolNotification_DeviceRemoved = 0x69000010, + kSCSIProtocolNotification_VerifyDeviceState = 0x69000020, + kSCSIServicesNotification_ExclusivityChanged = 0x69000030 +}; + + +/*! +@typedef SCSIProtocolFeature +@discussion +Typedef for SCSIProtocolFeature, a 32-bit quantity. +*/ +typedef UInt32 SCSIProtocolFeature; + +/*! +@enum SCSI Protocol Features +@discussion +The list of SCSI Protocol Features currently supported. +*/ +enum +{ + + /*! + @constant kSCSIProtocolFeature_ACA Not yet used. + */ + kSCSIProtocolFeature_ACA = 1, + + /*! + @constant kSCSIProtocolFeature_CPUInDiskMode Used to determine + if the SCSI Protocol Services Driver supports a CPU which is in + target disk mode. + */ + kSCSIProtocolFeature_CPUInDiskMode = 2, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPolling Used + to determine if the SCSI Protocol Services Driver supports + protocol specific polling for media. This is used for low-power + polling specifically for ATAPI devices on ATA buses + */ + kSCSIProtocolFeature_ProtocolSpecificPolling = 3, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificSleepCommand Used + to determine if the SCSI Protocol Services Driver supports + protocol specific sleep commands to a drive. This is used for + sleeping drives specifically ATAPI devices on ATA buses. + */ + kSCSIProtocolFeature_ProtocolSpecificSleepCommand = 4, + + /*! + @constant kSCSIProtocolFeature_GetMaximumLogicalUnitNumber If + the SCSI Protocol Services Driver supports logical units, it will + report the maximum addressable ID that it supports in the UInt32 pointer + that is passed in as the serviceValue. If only one unit is supported, + the driver should return false for this query. + */ + kSCSIProtocolFeature_GetMaximumLogicalUnitNumber = 5, + + /*! + @constant kSCSIProtocolFeature_MaximumReadBlockTransferCount If + the SCSI Protocol Services Driver has a maximum number of + blocks that can be transfered in a read request, it will return + true to this query and return the block count in the UInt32 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumReadBlockTransferCount = 6, + + /*! + @constant kSCSIProtocolFeature_MaximumWriteBlockTransferCount If + the SCSI Protocol Services Driver has a maximum number of + blocks that can be transferred in a write request, it will return + true to this query and return the block count in the UInt32 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumWriteBlockTransferCount = 7, + + /*! + @constant kSCSIProtocolFeature_MaximumReadTransferByteCount If + the SCSI Protocol Services Driver has a maximum byte count + that can be transferred in a read request, it will return + true to this query and return the byte count in the UInt64 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumReadTransferByteCount = 8, + + /*! + @constant kSCSIProtocolFeature_MaximumWriteTransferByteCount If + the SCSI Protocol Services Driver has a maximum byte count + that can be transferred in a write request, it will return + true to this query and return the byte count in the UInt64 pointer + that is passed in as the serviceValue. + */ + kSCSIProtocolFeature_MaximumWriteTransferByteCount = 9, + + /*! + @constant kSCSIProtocolFeature_SubmitDefaultInquiryData If + the SCSI Protocol Services Driver needs any extra information to + make any negotiation settings from the standard INQUIRY data, this + will be called to set that appropriately. The serviceValue will + point to a SCSICmd_INQUIRY_StandardData buffer. The size + of the buffer depends on the SCSI Device Characteristics + dictionary for the device or bus. If there is no + kIOPropertySCSIInquiryLengthKey value set in the dictionary + or if it doesn't exist, then the size of the data will be + the size of the full amount of Inquiry retrieved from the device. + */ + kSCSIProtocolFeature_SubmitDefaultInquiryData = 10, + + /*! + @constant kSCSIProtocolFeature_ProtocolAlwaysReportsAutosenseData If + the SCSI Protocol Services Driver always reports available + autosense data when a kSCSITaskStatus_CHECK_CONDITION is set, + then the protocol layer should return true. E.g. FireWire + transport drivers should respond true to this. + */ + kSCSIProtocolFeature_ProtocolAlwaysReportsAutosenseData = 11, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPowerOff If + the SCSI Protocol Services Driver supports removing the power + to the drive, then the protocol layer should return true. This is + used for aggressive power management, specifically for ATAPI + devices on ATA buses. + */ + kSCSIProtocolFeature_ProtocolSpecificPowerOff = 12, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificPowerControl + Used to determine if the SCSI Protocol Services Driver supports + switching the power to the drive on and off. This is used for aggressive + power management, specifically for SATAPI devices on AHCI buses. + */ + kSCSIProtocolFeature_ProtocolSpecificPowerControl = 13, + + /*! + @constant kSCSIProtocolFeature_ProtocolSpecificAsyncNotification + Used to determine if the SCSI Protocol Services Driver supports + asynchronous notifications from the drive. This is used to prevent + polling for media, specifically for SATAPI devices on AHCI buses. + */ + kSCSIProtocolFeature_ProtocolSpecificAsyncNotification = 14 + +}; + + +/*! +@typedef SCSIProtocolPowerState +@discussion +Typedef for SCSIProtocolPowerState, a 32-bit quantity. +*/ +typedef UInt32 SCSIProtocolPowerState; + +/*! +@enum SCSI Protocol Power States +@discussion +The list of SCSI Protocol Power States. +*/ +enum +{ + /*! + @constant kSCSIProtocolPowerStateOff + Off power state. + */ + kSCSIProtocolPowerStateOff = 0, + + /*! + @constant kSCSIProtocolPowerStateOn + On power state. + */ + kSCSIProtocolPowerStateOn = 1 +}; + + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +/*! +@class IOSCSIProtocolInterface +@superclass IOService +@discussion +This class defines the public SCSI Protocol Layer API for any class that +provides Protocol services or needs to provide the Protocol Service API +for passing service requests to a Protocol Service driver. +*/ +class IOSCSIProtocolInterface : public IOService +{ + + OSDeclareAbstractStructors ( IOSCSIProtocolInterface ) + +public: + + /*! + @function start + @abstract During an IOService object's instantiation, starts the IOService object that has been selected to run on the provider. + @discussion See IOService.h for details. + @result <code>true</code> if the start was successful; <code>false</code> otherwise (which will cause the instance to be detached and usually freed). + */ + virtual bool start ( IOService * provider ); + + /*! + @function free + @abstract Called to release all resources held by the object. + @discussion Release all resources held by the object, then call super::free(). + */ + virtual void free ( void ); + + /*! + @function willTerminate + @abstract Passes a termination up the stack. + @discussion Notification that a provider has been terminated, sent before recursing up the stack, in root-to-leaf order. + @param provider The terminated provider of this object. + @param options Options originally passed to terminate(). + @result <code>true</code>. + */ + virtual bool willTerminate ( IOService * provider, IOOptionBits options ); + + /*! + @function GetUserClientExclusivityState + @abstract Gets the current exclusivity state of the user client. + @discussion The GetUserClientExclusivityState() method is called by the SCSITaskUserClient + to determine if any user client is holding exclusive access at the current time. This is simply + a preflight check and a return value of <code>false</code> does not guarantee that a subsequent + call to SetUserClientExclusivityState() will return successfully. + @result <code>true</code> if a user client is in exclusive control of the device, <code>false</code> otherwise. + */ + virtual bool GetUserClientExclusivityState ( void ); + + /*! + @function SetUserClientExclusivityState + @abstract Sets the current exclusivity state of the user client. + @discussion The SetUserClientExclusivityState() method is called by the SCSITaskUserClient + to set the exclusive access mode. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state Exclusivity state. <code>true</code> means exclusive access is desired, <code>false</code> + means exclusive access is being released. + @result A valid IOReturn code indicating success or the type of failure. + */ + virtual IOReturn SetUserClientExclusivityState ( IOService * userClient, bool state ); + + + /*! + @function initialPowerStateForDomainState + @abstract Determines which power state a device is in, given the current power domain state. + @discussion Power management calls this method once, when the driver is initializing power management. + Subclasses should not need to override this method. + @param flags Flags that describe the character of "domain power"; they represent the <code>outputPowerCharacter</code> field of a state in the power domain's power state array. + @result A state number. + */ + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags flags ); + + /*! + @function setPowerState + @abstract Requests a power managed driver to change the power state of its device. + @discussion Requests a power managed driver to change the power state of its device. Most subclasses + of IOSCSIProtocolInterface have class-specific mechanisms and should not override this routine. + See IOSCSIProtocolServices.h, IOSCSIBlockCommandsDevice.h, IOSCSIReducedBlockCommandsDevice.h, and + IOSCSIMultimediaCommandsDevice.h for more information about power management changes. + Subclasses should not need to override this method. + @param powerStateOrdinal The number in the power state array to which the drive is being instructed to change. + @param whichDevice A pointer to the power management object which registered to manage power for this device. + The whichDevice field is not pertinent to us since the driver is both the "policy maker" for the device, + and the "policy implementor" for the device. + @result See IOService.h for details. + */ + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService * whichDevice ); + + /*! + @function IsPowerManagementIntialized + @abstract Called to determine if power management is initialized. + @discussion Called to determine if power management is initialized. + Subclasses should not need to override this method. + @result <code>true</code> if power management has been initialized, <code>false</code> otherwise. + */ + virtual bool IsPowerManagementIntialized ( void ); + + /*! + @function CheckPowerState + @abstract Called by clients to ensure device is in correct power state before issuing I/O. + @discussion Called by clients to ensure device is in correct power state before issuing I/O. + If the device is not ready to handle such requests, it gives the driver a chance to block the + thread until the device is ready. Subclasses should not need to override this method. + */ + virtual void CheckPowerState ( void ); + + /*! + @function ExecuteCommand + @abstract Called to send a SCSITask and transport it across the physical wire(s) to the device. + @discussion Called to send a SCSITask and transport it across the physical wire(s) to the device. + Subclasses internal to IOSCSIArchitectureModelFamily will need to override this method. Third + party subclasses should not need to override this method. + @param request A valid SCSITaskIdentifier representing the task to transport across the wire(s). + */ + virtual void ExecuteCommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function AbortCommand + @abstract Obsolete. Do not use this method. + @discussion Obsolete. Do not use this method. + */ + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ) = 0; + + /*! + @function IsProtocolServiceSupported + @abstract This method is called to query for support of a protocol specific service feature. + @discussion This method is called to query for support of a protocol specific service feature. + Subclasses of IOSCSIProtocolServices should override this method. + @param feature A valid SCSIProtocolFeature. See enums for SCSIProtocolFeature. + @param serviceValue A pointer to a structure/value that is used in conjunction with the feature + requested. See enums for SCSIProtocolFeature. NB: This parameter may be NULL for certain + feature requests. + @result <code>true</code> if the feature is supported, <code>false</code> otherwise. + */ + virtual bool IsProtocolServiceSupported ( + SCSIProtocolFeature feature, + void * serviceValue ) = 0; + + /*! + @function HandleProtocolServiceFeature + @abstract This method is called to enact support of a protocol specific service feature. + @discussion This method is called to enact support of a protocol specific service feature. + Subclasses of IOSCSIProtocolServices should override this method. + @param feature A valid SCSIProtocolFeature. See enums for SCSIProtocolFeature. + @param serviceValue A pointer to a structure/value that is used in conjunction with the feature + requested. See enums for SCSIProtocolFeature. NB: This parameter may be NULL for certain + feature requests. + @result <code>true</code> if the service feature request succeeded, <code>false</code> otherwise. + */ + virtual bool HandleProtocolServiceFeature ( + SCSIProtocolFeature feature, + void * serviceValue ) = 0; + +protected: + + // Reserve space for future expansion. + struct IOSCSIProtocolInterfaceExpansionData + { + IOWorkLoop * fWorkLoop; + }; + IOSCSIProtocolInterfaceExpansionData * fIOSCSIProtocolInterfaceReserved; + + // ------ Power Management Support ------ + + thread_call_t fPowerManagementThread; + IOCommandGate * fCommandGate; + UInt32 fCurrentPowerState; + UInt32 fProposedPowerState; + bool fPowerTransitionInProgress; + bool fPowerAckInProgress; + bool fPowerManagementInitialized; + + /*! + @function GetCommandGate + @abstract Accessor method to obtain the IOCommandGate. + @discussion Accessor method to obtain the IOCommandGate. + @result The IOCommandGate for this instance. May return NULL. + */ + IOCommandGate * GetCommandGate ( void ); + + /*! + @function InitializePowerManagement + @abstract This method is called to initialize power management. + @discussion This method is called to initialize power management. It will call PMinit(), joinPMTree(), + setIdleTimerPeriod(), and makeUsable(). This method does not call registerPowerDriver(). + Subclasses may override this method to change the behavior (such as the number of power states). + @param provider The power management provider (i.e. the provider to attach to in the PowerManagement + tree). This may be a device that is not in the PM Tree itself, in which case, the IOService plane + is traversed towards the root node in an effort to find a node in the PM Tree. + */ + virtual void InitializePowerManagement ( IOService * provider ); + + /*! + @function GetInitialPowerState + @abstract This method is called to obtain the initial power state of the device (usually the highest). + @discussion This method is called to obtain the initial power state of the device (usually the highest). + Subclasses must override this method. + @result A power state ordinal. + */ + virtual UInt32 GetInitialPowerState ( void ) = 0; + + /*! + @function finalize + @abstract Finalizes the destruction of an IOService object. + @discussion See IOService.h + Subclasses may override this method, but should call super::finalize(). + @result <code>true</code>. + */ + virtual bool finalize ( IOOptionBits options ); + + /*! + @function sHandleSetPowerState + @abstract The sHandleSetPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sHandleSetPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param powerStateOrdinal The power state to which device shall be changed. + @result A valid IOReturn code indicating success or failure. + */ + static IOReturn sHandleSetPowerState ( IOSCSIProtocolInterface * self, UInt32 powerStateOrdinal ); + + /*! + @function sGetPowerTransistionInProgress + @abstract The sGetPowerTransistionInProgress method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sGetPowerTransistionInProgress method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @result <code>true</code> if a power state is in progress, otherwise <code>false</code>. + */ + static bool sGetPowerTransistionInProgress ( IOSCSIProtocolInterface * self ); + + /*! + @function HandleSetPowerState + @abstract The HandleSetPowerState method is called by the glue code and is on the + serialized side of the command gate. + @discussion The HandleSetPowerState method is called by the glue code and is on the + serialized side of the command gate. This allows us to touch any member + variables as necessary without any multi-threading issues. + Subclasses may override this method to change behavior. Third party subclasses + should not need to override this method, but may. + @param powerStateOrdinal The power state to which device shall be changed. + */ + virtual void HandleSetPowerState ( UInt32 powerStateOrdinal ); + + /*! + @function sPowerManagement + @abstract The sPowerManagement method is a static C-function which is called using + mach's thread_call API. It guarantees us a thread of execution which is + different than the power management thread and the workloop thread on which + we can issue commands to the device synchronously or asynchronously without + worrying about deadlocks. It calls through to HandlePowerChange, which is + a state machine used to direct power management. + @discussion The sPowerManagement method is a static C-function which is called using + mach's thread_call API. It guarantees us a thread of execution which is + different than the power management thread and the workloop thread on which + we can issue commands to the device synchronously or asynchronously without + worrying about deadlocks. It calls through to HandlePowerChange, which is + a state machine used to direct power management. + @param whichDevice The 'this' pointer. + */ + static void sPowerManagement ( thread_call_param_t whichDevice ); + + /*! + @function HandlePowerChange + @abstract The HandlePowerChange method is pure virtual and is left to each protocol or + application layer driver to implement. It is guaranteed to be called on its + own thread of execution and can make synchronous or asynchronous calls. + @discussion The HandlePowerChange method is pure virtual and is left to each protocol or + application layer driver to implement. It is guaranteed to be called on its + own thread of execution and can make synchronous or asynchronous calls. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void HandlePowerChange ( void ) = 0; + + /*! + @function sHandleCheckPowerState + @abstract The sHandleCheckPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sHandleCheckPowerState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + */ + static void sHandleCheckPowerState ( IOSCSIProtocolInterface * self ); + + /*! + @function HandleCheckPowerState(void) + @abstract The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + @discussion The HandleCheckPowerState (void) method is on the serialized side of the command + gate and can change member variables safely without multi-threading issues. + It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + with the max power state the class registered with. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void HandleCheckPowerState ( void ) = 0; + + /*! + @function HandleCheckPowerState(UInt32 maxPowerState) + @abstract The HandleCheckPowerState(UInt32 maxPowerState) method is called by + the subclasses and is passed the maxPowerState number given to the power + manager at initialization time. This guarantees the threads block until that + power state has been achieved. + @discussion The HandleCheckPowerState(UInt32 maxPowerState) method is called by + the subclasses and is passed the maxPowerState number given to the power + manager at initialization time. This guarantees the threads block until that + power state has been achieved. + @param maxPowerState The maximum power state in the power state array. + */ + void HandleCheckPowerState ( UInt32 maxPowerState ); + + /*! + @function TicklePowerManager(void) + @abstract The TicklePowerManager(void) method is called by CheckPowerState and + sends an activity tickle to the power manager so that the idle timer is + reset. + @discussion The TicklePowerManager(void) method is called by CheckPowerState and + sends an activity tickle to the power manager so that the idle timer is + reset. + Subclasses must override this method. Third party subclasses shouldn't need to override + this method but can to alter the default behavior. + */ + virtual void TicklePowerManager ( void ) = 0; + + /*! + @function TicklePowerManager(UInt32 maxPowerState) + @abstract The TicklePowerManager(UInt32 maxPowerState) method is a convenience + function which can be called by subclasses in TicklePowerManager (void) + in order to tell the power manager to reset idle timer or bring the device + into the requested state. It returns whatever is returned by activityTickle + (true if device is in the requested state, false if it is not). + @discussion The TicklePowerManager(UInt32 maxPowerState) method is a convenience + function which can be called by subclasses in TicklePowerManager(void) + in order to tell the power manager to reset idle timer or bring the device + into the requested state. It returns whatever is returned by activityTickle + (true if device is in the requested state, false if it is not). + @param maxPowerState The maximum power state in the power state array. + @result The result of the call to activityTickle(). See IOService.h for details. + */ + bool TicklePowerManager ( UInt32 maxPowerState ); + + // ------ User Client Support ------ + + bool fUserClientExclusiveControlled; + IOService * fUserClient; + + /*! + @function sGetUserClientExclusivityState + @abstract The sGetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sGetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param state A pointer to a bool in which the state should be set. + */ + static void sGetUserClientExclusivityState ( IOSCSIProtocolInterface * self, bool * state ); + + /*! + @function sSetUserClientExclusivityState + @abstract The sSetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @discussion The sSetUserClientExclusivityState method is a static function used as C->C++ glue + for going behind the command gate. + @param self The 'this' pointer for the class. + @param result A pointer to an IOReturn for the resulting status. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state A bool indicating the desired state to set. + */ + static void sSetUserClientExclusivityState ( IOSCSIProtocolInterface * self, IOReturn * result, IOService * userClient, bool state ); + + /*! + @function HandleGetUserClientExclusivityState + @abstract Gets the current exclusivity state of the user client. + @discussion The HandleGetUserClientExclusivityState() method is called on the serialized side + of the command gate to determine if any user client is holding exclusive access at the current + time. See discussion for GetUserClientExclusivityState(). + Subclasses may override this method to alter default behavior. Third party subclasses should + not need to override this method. + @result <code>true</code> if a user client is in exclusive control of the device, <code>false</code> otherwise. + */ + virtual bool HandleGetUserClientExclusivityState ( void ); + + /*! + @function HandleSetUserClientExclusivityState + @abstract Sets the current exclusivity state of the user client. + @discussion The HandleSetUserClientExclusivityState() method is called on the serialized side + of the command gate to set the exclusive access mode. + @param userClient The instance of SCSITaskUserClient for which to change exclusivity state. + @param state Exclusivity state. <code>true</code> means exclusive access is desired, <code>false</code> + means exclusive access is being released. + @result A valid IOReturn code indicating success or the type of failure. + */ + virtual IOReturn HandleSetUserClientExclusivityState ( IOService * userClient, bool state ); + +public: + + // ------- SCSI Architecture Model Task Management Functions ------ + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 1 ); + /*! + @function AbortTask + @abstract Aborts a task based on the Logical Unit and tagged task identifier. + @discussion Aborts a task based on the Logical Unit and tagged task identifier. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @param theTag A valid SCSITaggedTaskIdentifier representing an outstanding SCSITask. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 2 ); + /*! + @function AbortTaskSet + @abstract Aborts a task set based on the Logical Unit. + @discussion Aborts a task set based on the Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 3 ); + /*! + @function ClearACA + @abstract Clears an Auto-Contingent Allegiance (ACA) for the specified Logical Unit. + @discussion Clears an Auto-Contingent Allegiance (ACA) for the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 4 ); + /*! + @function ClearTaskSet + @abstract Clears a task set for the specified Logical Unit. + @discussion Clears a task set for the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 5 ); + /*! + @function LogicalUnitReset + @abstract Resets the specified Logical Unit. + @discussion Resets the specified Logical Unit. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @param theLogicalUnit This value should be zero unless the device driver is + more complex and managing multiple Logical Units. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ) = 0; + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolInterface, 6 ); + + /*! + @function TargetReset + @abstract Resets the target device. + @discussion Resets the target device. + Subclasses must override this method. Third party subclasses should not need to override + this method. + @result A valid SCSIServiceResponse code. + */ + virtual SCSIServiceResponse TargetReset ( void ) = 0; + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolInterface, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PROTOCOL_INTERFACE_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIProtocolServices.h b/i386/include/IOKit/scsi/IOSCSIProtocolServices.h new file mode 100644 index 0000000..6b9df79 --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIProtocolServices.h @@ -0,0 +1,362 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ +#define _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// Mach includes +#include <kern/queue.h> + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOCommandGate.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/SCSITask.h> +#include <IOKit/scsi/IOSCSIProtocolInterface.h> +#include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h> + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +// Power Management values +enum +{ + kSCSIProtocolLayerPowerStateOff = 0, + kSCSIProtocolLayerPowerStateOn = 1, + kSCSIProtocolLayerNumDefaultStates = 2 +}; + +// Forward definitions of internal use only classes +class SCSITask; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIProtocolServices : public IOSCSIProtocolInterface +{ + + OSDeclareAbstractStructors ( IOSCSIProtocolServices ) + +private: + + // The head pointer for the queue of waiting SCSI Tasks. + SCSITask * fSCSITaskQueueHead; /* OBSOLETE */ + + // This is the lock for preventing multiple access while + // manipulating the SCSI Task queue. + IOSimpleLock * fQueueLock; + + // The internal flag to indicate whether service requests should be + // executed or immediately errored, such as when a device is removed. + bool fAllowServiceRequests; + +protected: + + // Reserve space for future expansion. + struct IOSCSIProtocolServicesExpansionData + { + // For internal use only. Do not use. + UInt32 fSemaphore; + bool fRequiresAutosenseDescriptor; + SCSITaskCompletion fCompletionRoutine; + queue_head_t fTaskQueueHead; + queue_head_t fAutoSenseQueueHead; + }; + IOSCSIProtocolServicesExpansionData * fIOSCSIProtocolServicesReserved; + + // ---- Protocol transport methods overridden by each subclass ---- + + // Send a SCSI Command to the device. If the command was sent to the + // device and is pending completion, the subclass should return true and + // return back the kSCSIServiceResponse_Request_In_Process response. + // If the command completes immediately with an error, the subclass will + // return true and return back the appropriate status. + // if the subclass is currently processing all the commands it can, the + // subclass will return false and the command will be resent next time + // CommandCompleted is called. + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ) = 0; + + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ) = 0; + + // ---- Command completion notification method --------- + // Subclasses will call this inherited method when the command + // executed by SendSCSICommand has completed. + // The subclasses will return a service response that is derived + // from protocol specific status information and as specified in + // the specification for that protocol. + // If the service response is kSCSIServiceResponse_TASK_COMPLETE, + // the subclass will also return a SCSI status value. + void CommandCompleted ( SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + // ---- Utility methods for accessing SCSITask attributes ---- + // Method for retreiving the attribute for a task. + SCSITaskAttribute GetTaskAttribute ( SCSITaskIdentifier request ); + + bool SetTaskState ( SCSITaskIdentifier request, + SCSITaskState newTaskState ); + SCSITaskState GetTaskState ( SCSITaskIdentifier request ); + + UInt8 GetLogicalUnitNumber ( SCSITaskIdentifier request ); + + // Method to determine the size of the command descriptor block. + UInt8 GetCommandDescriptorBlockSize ( SCSITaskIdentifier request ); + + // This will always return the define max CDB size. If the Protocol Layer + // driver only supports a smaller size CDB, it will have to create a local + // SCSICommandDescriptorBlock variable to get the CDB data and then + // transfer the needed bytes from there. + bool GetCommandDescriptorBlock ( SCSITaskIdentifier request, + SCSICommandDescriptorBlock * cdbData ); + + // Get the transfer direction for the request. + UInt8 GetDataTransferDirection ( SCSITaskIdentifier request ); + + UInt64 GetRequestedDataTransferCount ( SCSITaskIdentifier request ); + + bool SetRealizedDataTransferCount ( SCSITaskIdentifier request, + UInt64 newRealizedDataCount ); + + UInt64 GetRealizedDataTransferCount ( SCSITaskIdentifier request ); + + IOMemoryDescriptor * GetDataBuffer ( SCSITaskIdentifier request ); + + UInt64 GetDataBufferOffset ( SCSITaskIdentifier request ); + + UInt32 GetTimeoutDuration ( SCSITaskIdentifier request ); + + UInt64 GetAutosenseRequestedDataTransferCount ( SCSITaskIdentifier request ); + + // Set the auto sense data that was returned for the SCSI Task. + // A return value of true indicates that the data was copied to the member + // sense data structure, false indicates that the data could not be copied. + bool SetAutoSenseData ( SCSITaskIdentifier request, + SCSI_Sense_Data * senseData ); // DEPRECATED, use the one on the line below. + + bool SetAutoSenseData ( SCSITaskIdentifier request, + SCSI_Sense_Data * senseData, + UInt8 senseDataSize ); + + void EnsureAutosenseDescriptorExists ( SCSITaskIdentifier request ); + + bool SetProtocolLayerReference ( + SCSITaskIdentifier request, + void * newReferenceValue ); + void * GetProtocolLayerReference ( SCSITaskIdentifier request ); + + + bool SetTaskExecutionMode ( + SCSITaskIdentifier request, + SCSITaskMode newTaskMode ); + SCSITaskMode GetTaskExecutionMode ( SCSITaskIdentifier request ); + + // ---- Method calls for messaging device connectedness ---- + void SendNotification_DeviceRemoved ( void ); + + void SendNotification_VerifyDeviceState ( void ); + + // -- SCSI Task Queue Management Methods -- + // Following are the commands used to manipulate the queue of pending SCSI Tasks. + + // Add the SCSI Task to the queue. The Task's Attribute determines where in + // the queue the Task is placed. + void AddSCSITaskToQueue ( SCSITaskIdentifier request ); + + // Add the SCSI Task to the head of the queue. This is used when the task + // has been removed from the head of the queue, but the subclass indicates + // that it can not yet process this task. + void AddSCSITaskToHeadOfQueue ( SCSITask * request ); + + // Remove the next SCSI Task for the queue and return it. + SCSITask * RetrieveNextSCSITaskFromQueue ( void ); + + // Check to see if the SCSI Task resides in the queue and abort it if it does. + bool AbortSCSITaskFromQueue ( SCSITask * request ); + + // Methods for sending and completing SCSI tasks + void SendSCSITasksFromQueue ( void ); + + void RejectSCSITasksCurrentlyQueued ( void ); + + void ProcessCompletedTask ( SCSITaskIdentifier request, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + void RejectTask ( SCSITaskIdentifier request ); + + // ------ Power Management Support ------ + + // The InitializePowerManagement method is called to initialize power management. + // In the protocol services layer, this method calls the protocol interface layer + // to initialize power management state variables and then registers the protocol + // layer driver with the power manager with two(2) states, ON and OFF. + virtual void InitializePowerManagement ( IOService * provider ); + + // The GetInitialPowerState method is called once, right after InitializePowerManagement() + // in order to determine what state the device is initially in at startup time (usually + // the highest power mode). + virtual UInt32 GetInitialPowerState ( void ); + + // The HandlePowerChange method is pure virtual and is left to each protocol or + // application layer driver to implement. It is guaranteed to be called on its + // own thread of execution and can make synchronous or asynchronous calls. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The TicklePowerManager ( void ) method is called by CheckPowerState and + // sends an activity tickle to the power manager so that the idle timer is + // reset. + virtual void TicklePowerManager ( void ); + + // The HandlePowerOff method is called to do any bus specific activity + // necessary before shutting down and going to sleep. + virtual IOReturn HandlePowerOff ( void ); + + // The HandlePowerOn method is called to do any bus specific activity + // necessary to recover from power-on/wake from sleep (e.g. bus reset on ATAPI) + virtual IOReturn HandlePowerOn ( void ); + +public: + + virtual bool start ( IOService * provider ); + virtual void free ( void ); + + void RegisterSCSITaskCompletionRoutine ( SCSITaskCompletion completion ); + + // ------- SCSI Architecture Model Task Management Functions ------ + // The ExecuteCommand method will take a SCSI Task and transport + // it across the physical wire(s) to the device + void ExecuteCommand ( SCSITaskIdentifier request ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a specific task be aborted. + SCSIServiceResponse AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag ); + + // The Task Management function to allow the SCSI Application Layer client to request + // that a all tasks curerntly in the task set be aborted. + SCSIServiceResponse AbortTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearACA ( UInt8 theLogicalUnit ); + + SCSIServiceResponse ClearTaskSet ( UInt8 theLogicalUnit ); + + SCSIServiceResponse LogicalUnitReset ( UInt8 theLogicalUnit ); + + SCSIServiceResponse TargetReset ( void ); + + // ************* Obsoleted Member Routine **************** + // The AbortCommand method is replaced by the AbortTask Management function and + // should no longer be called. + virtual SCSIServiceResponse AbortCommand ( SCSITaskIdentifier request ); + + + // ---- Method used for determining protocol or physical interconnect characteristics. ---- + // The IsProtocolServiceSupported will return true if the specified + // feature is supported by the protocol layer. If the service has a value that must be + // returned, it will be returned in the serviceValue output parameter. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ) = 0; + + // The HandleProtocolServiceFeature instructs the Protocol Services driver to perform the necessary + // tasks for the indicated feature. + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ) = 0; + +protected: + + // ----- Protocol Services Driver request handlers for Task Management functions ----- + // These should be abstract so that every Protocol Services Driver would have to + // override them, but since they are new member routines, this class will provide + // a default implementation. + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 1 ); + virtual SCSIServiceResponse HandleAbortTask ( + UInt8 theLogicalUnit, + SCSITaggedTaskIdentifier theTag ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 2 ); + virtual SCSIServiceResponse HandleAbortTaskSet ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 3 ); + virtual SCSIServiceResponse HandleClearACA ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 4 ); + virtual SCSIServiceResponse HandleClearTaskSet ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 5 ); + virtual SCSIServiceResponse HandleLogicalUnitReset ( + UInt8 theLogicalUnit ); + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 6 ); + // The HandleTargetReset member routine requests that the Protocol Services Driver + // perform the necessary steps detailed in the specification that defines the + // protocol the driver represents for the TargetReset management function. + virtual SCSIServiceResponse HandleTargetReset ( void ); + + + OSMetaClassDeclareReservedUsed ( IOSCSIProtocolServices, 7 ); + // The CreateSCSITargetDevice member routine will create the appropriate object + // to represent the Target portion of a SCSI Device. This object is responsible + // for managing the Target functions of the SCSI Device including the Task Manager and + // Logical Units. + // If the SCSITargetDevice object was successfully created, a true value will be + // returned, otherwisw, this will return false. + virtual bool CreateSCSITargetDevice ( void ); + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIProtocolServices, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_PROTOCOL_SERVICES_H_ */ diff --git a/i386/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h b/i386/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h new file mode 100644 index 0000000..955fd6e --- /dev/null +++ b/i386/include/IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h @@ -0,0 +1,438 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ +#define _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ + +#if defined(KERNEL) && defined(__cplusplus) + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit headers +#include <IOKit/IOLib.h> +#include <IOKit/IOMemoryDescriptor.h> + +// Generic IOKit storage related headers +#include <IOKit/storage/IOStorage.h> + +// SCSI Architecture Model Family includes +#include <IOKit/scsi/IOSCSIPrimaryCommandsDevice.h> + + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +// RBC power states as defined in T10:1240D SCSI Reduced Block Commands (RBC) +// Revision 10a, August 18, 1999, page 13. +enum +{ + kRBCPowerStateSystemSleep = 0, + kRBCPowerStateSleep = 1, + kRBCPowerStateStandby = 2, + kRBCPowerStateIdle = 3, + kRBCPowerStateActive = 4, + kRBCNumPowerStates = 5 +}; + +enum +{ + kMediaStateUnlocked = 0, + kMediaStateLocked = 1 +}; + +#define kCapacityDataBufferSize 8 + +// Forward declaration for the SCSIReducedBlockCommands that is used internally by the +// IOSCSIReducedBlockCommandsDevice class. +class SCSIReducedBlockCommands; + +//----------------------------------------------------------------------------- +// Class Declaration +//----------------------------------------------------------------------------- + +class IOSCSIReducedBlockCommandsDevice : public IOSCSIPrimaryCommandsDevice +{ + + OSDeclareAbstractStructors ( IOSCSIReducedBlockCommandsDevice ); + +private: + +#ifndef __LP64__ + + SCSIReducedBlockCommands * fSCSIReducedBlockCommandObject; + SCSIReducedBlockCommands * GetSCSIReducedBlockCommandObject ( void ); + +#endif /* !__LP64__ */ + + static void AsyncReadWriteComplete ( SCSITaskIdentifier completedTask ); + +protected: + + // Reserve space for future expansion. + struct IOSCSIReducedBlockCommandsDeviceExpansionData + { + IONotifier * fPowerDownNotifier; + bool fMediumRemovalPrevented; + bool fKnownManualEject; + UInt32 fPollingMode; + bool fProtocolSpecificPowerControl; + }; + IOSCSIReducedBlockCommandsDeviceExpansionData * fIOSCSIReducedBlockCommandsDeviceReserved; + + #define fPowerDownNotifier fIOSCSIReducedBlockCommandsDeviceReserved->fPowerDownNotifier + #define fMediumRemovalPrevented fIOSCSIReducedBlockCommandsDeviceReserved->fMediumRemovalPrevented + #define fKnownManualEject fIOSCSIReducedBlockCommandsDeviceReserved->fKnownManualEject + #define fPollingMode fIOSCSIReducedBlockCommandsDeviceReserved->fPollingMode + #define fProtocolSpecificPowerControl fIOSCSIReducedBlockCommandsDeviceReserved->fProtocolSpecificPowerControl + + bool fMediaChanged; + bool fMediaPresent; + + // The byte count of each physical block on the media. + UInt32 fMediaBlockSize; + + // The total number of blocks of mediaBlockSize on the media. + UInt32 fMediaBlockCount; + + // Flags used to indicate device feature + bool fMediaIsRemovable; + bool fMediaIsWriteProtected; + + thread_call_t fPollingThread; + + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + virtual void CreateStorageServiceNub ( void ); + virtual bool DetermineDeviceCharacteristics ( void ); + virtual void PollForMedia ( void ); + virtual void EnablePolling ( void ); + virtual void DisablePolling ( void ); + virtual void CheckWriteProtection ( void ); + virtual void SetMediaCharacteristics ( UInt32 blockSize, UInt32 blockCount ); + virtual void ResetMediaCharacteristics ( void ); + virtual bool ClearNotReadyStatus ( void ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor* buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + virtual IOReturn IssueWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + +#ifndef __LP64__ + + // This method will retreive the SCSI Primary Command Set object for + // the class. For subclasses, this will be overridden using a + // dynamic cast on the subclasses base command set object. + virtual SCSIPrimaryCommands * GetSCSIPrimaryCommandObject ( void ); + +#endif /* !__LP64__ */ + + // ----- Power Management Support ------ + + // We override this method to set our power states and register ourselves + // as a power policy maker. + virtual void InitializePowerManagement ( IOService * provider ); + + // We override this method so that when we register for power management, + // we go to our active power state (which the drive is definitely in + // at startup time). + virtual UInt32 GetInitialPowerState ( void ); + + // We override this method in order to provide the number of transitions + // from Fully active to Sleep state so that the idle timer can be adjusted + // to the appropriate time period based on the disk spindown time set in + // the Energy Saver prefs panel. + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // The TicklePowerManager method is called to tell the power manager that the + // device needs to be in a certain power state to handle requests. + virtual void TicklePowerManager ( void ); + + // The HandlePowerChange method is the state machine for power management. + // It is guaranteed to be on its own thread of execution (different from + // the power manager thread AND the workloop thread. This routine can + // send sync or async calls to the drive without worrying about threading + // issues. + virtual void HandlePowerChange ( void ); + + // The HandleCheckPowerState (void) method is on the serialized side of the command + // gate and can change member variables safely without multi-threading issues. + // It's main purpose is to call the superclass' HandleCheckPowerState ( UInt32 maxPowerState ) + // with the max power state the class registered with. + virtual void HandleCheckPowerState ( void ); + + // The CheckMediaPresence method is called to see if the media which we + // anticipated being there is still there. + virtual bool CheckMediaPresence ( void ); + + virtual bool InitializeDeviceSupport ( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport ( void ); + virtual void ResumeDeviceSupport ( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport ( void ); + + virtual void free ( void ); + +#ifndef __LP64__ + + virtual bool CreateCommandSetObjects ( void ); + virtual void FreeCommandSetObjects ( void ); + +#endif /* !__LP64__ */ + +public: + + virtual IOReturn SyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn AsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + void * clientData ); + + + virtual IOReturn EjectTheMedia ( void ); + virtual IOReturn FormatMedia ( UInt64 byteCapacity ); + virtual UInt32 GetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + virtual IOReturn LockUnlockMedia ( bool doLock ); + virtual IOReturn SynchronizeCache ( void ); + virtual IOReturn ReportBlockSize ( UInt64 * blockSize ); + virtual IOReturn ReportEjectability ( bool * isEjectable ); + virtual IOReturn ReportLockability ( bool * isLockable ); + virtual IOReturn ReportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + virtual IOReturn ReportMaxReadTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMaxValidBlock ( UInt64 * maxBlock ); + virtual IOReturn ReportMaxWriteTransfer ( UInt64 blockSize, + UInt64 * max ); + virtual IOReturn ReportMediaState ( bool * mediaPresent, + bool * changed ); + virtual IOReturn ReportRemovability ( bool * isRemovable ); + virtual IOReturn ReportWriteProtection ( bool * isWriteProtected ); + + static void sPollForMedia ( void * pdtDriver, void * refCon ); + + +protected: + + + // The FORMAT_UNIT command as defined in section 5.1 + virtual bool FORMAT_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit PROGRESS, + SCSICmdField1Bit PERCENT_TIME, + SCSICmdField1Bit INCREMENT ); + + // The INQUIRY command as defined in SPC-2 w/o CONTROL byte + virtual bool INQUIRY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit CMDDT, + SCSICmdField1Bit EVPD, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + // The MODE_SELECT(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool MODE_SELECT_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField1Byte PARAMETER_LIST_LENGTH ); + + // The MODE_SENSE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool MODE_SENSE_6 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + // The PERSISTENT_RESERVE_IN command as defined in SPC-2 w/o CONTROL byte + virtual bool PERSISTENT_RESERVE_IN ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField2Byte ALLOCATION_LENGTH ); + + // The PERSISTENT_RESERVE_OUT command as defined in SPC-2 w/o CONTROL byte + virtual bool PERSISTENT_RESERVE_OUT ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField5Bit SERVICE_ACTION, + SCSICmdField4Bit SCOPE, + SCSICmdField4Bit TYPE ); + + // The PREVENT_ALLOW_MEDIUM_REMOVAL command as defined in SPC-2 w/o CONTROL byte + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL ( + SCSITaskIdentifier request, + SCSICmdField2Bit PREVENT ); + + // The READ_10 command as defined in section 5.2 + virtual bool READ_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + // The READ_CAPACITY command as defined in section 5.3 + virtual bool READ_CAPACITY ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer ); + + // The RELEASE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool RELEASE_6 ( + SCSITaskIdentifier request ); + + // The REQUEST_SENSE command as defined in SPC-2 w/o CONTROL byte + virtual bool REQUEST_SENSE ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + // The RESERVE(6) command as defined in SPC-2 w/o CONTROL byte + virtual bool RESERVE_6 ( + SCSITaskIdentifier request ); + + // The START_STOP_UNIT command as defined in section 5.4 + virtual bool START_STOP_UNIT ( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField4Bit POWER_CONDITIONS, + SCSICmdField1Bit LEOJ, + SCSICmdField1Bit START ); + + // The SYNCRONIZE_CACHE command as defined in section 5.5 + virtual bool SYNCHRONIZE_CACHE ( + SCSITaskIdentifier request ); + + // The TEST_UNIT_READY command as defined in SPC-2 w/o CONTROL byte + virtual bool TEST_UNIT_READY ( + SCSITaskIdentifier request ); + + // The VERIFY command as defined in section 5.7 + virtual bool VERIFY ( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH ); + + // The WRITE_10 command as defined in section 5.6 + virtual bool WRITE_10 ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit FUA, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + // The WRITE_BUFFER command as defined in SPC-2 w/o CONTROL byte + virtual bool WRITE_BUFFER ( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField4Bit MODE, + SCSICmdField1Byte BUFFER_ID, + SCSICmdField3Byte BUFFER_OFFSET, + SCSICmdField3Byte PARAMETER_LIST_LENGTH ); + + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 1 ); + +public: + + virtual IOReturn PowerDownHandler ( void * refCon, + UInt32 messageType, + IOService * provider, + void * messageArgument, + vm_size_t argSize ); + + + /* Added with 10.2 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 2 ); + +protected: + + virtual void SetMediaIcon ( void ); + + + /* Added with 10.3.3 */ + OSMetaClassDeclareReservedUsed ( IOSCSIReducedBlockCommandsDevice, 3 ); + +protected: + + virtual void AsyncReadWriteCompletion ( SCSITaskIdentifier completedTask ); + + +private: + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 8 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 9 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 10 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 11 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 12 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIReducedBlockCommandsDevice, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_SCSI_REDUCED_BLOCK_COMMANDS_DEVICE_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h b/i386/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h new file mode 100644 index 0000000..55a6a4c --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICmds_INQUIRY_Definitions.h @@ -0,0 +1,923 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_INQUIRY_H_ +#define _IOKIT_SCSI_CMDS_INQUIRY_H_ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSI Inquiry Definitions + @discussion + This file contains all definitions for the data returned from + the INQUIRY (0x12) command. +*/ + + +/*! + * @enum Payload sizes + * @discussion + * Definitions for sizes related to the INQUIRY data. + * @constant kINQUIRY_StandardDataHeaderSize + * INQUIRY data header size. + * @constant kINQUIRY_MaximumDataSize + * Maximum size for INQUIRY data. +*/ +enum +{ + kINQUIRY_StandardDataHeaderSize = 5, + kINQUIRY_MaximumDataSize = 255 +}; + + +/*! +@enum INQUIRY field sizes +@discussion +Sizes for some of the inquiry data fields. +@constant kINQUIRY_VENDOR_IDENTIFICATION_Length +Size of VENDOR_IDENTIFICATION field. +@constant kINQUIRY_PRODUCT_IDENTIFICATION_Length +Size of PRODUCT_IDENTIFICATION field. +@constant kINQUIRY_PRODUCT_REVISION_LEVEL_Length +Size of PRODUCT_REVISION_LEVEL field. +*/ +enum +{ + kINQUIRY_VENDOR_IDENTIFICATION_Length = 8, + kINQUIRY_PRODUCT_IDENTIFICATION_Length = 16, + kINQUIRY_PRODUCT_REVISION_LEVEL_Length = 4 +}; + + +/*! +@struct SCSICmd_INQUIRY_StandardData +@discussion +This structure defines the format of the required standard data that is +returned for the INQUIRY command. This is the data that is required to +be returned from all devices. +*/ +typedef struct SCSICmd_INQUIRY_StandardData +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 RMB; // 7 = removable + UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. + UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. (SPC-3 obsoletes AERC) + // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. + UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data + UInt8 SCCSReserved; // SCC-2 device flag and reserved fields (SPC-3 adds PROTECT 3PC TPGS, and ACC) + UInt8 flags1; // First byte of support flags (See SPC-3 section 6.4.2) + UInt8 flags2; // Second byte of support flags (Byte 7) (See SPC-3 section 6.4.2) + char VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + char PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + char PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; +} SCSICmd_INQUIRY_StandardData; +typedef SCSICmd_INQUIRY_StandardData * SCSICmd_INQUIRY_StandardDataPtr; + + +/*! +@struct SCSICmd_INQUIRY_StandardDataAll +@discussion +This structure defines the all of the fields that can be returned in +repsonse to the INQUIRy request for the standard data. There is no +requirement as to how much of the additional data must be returned by a device. +*/ +typedef struct SCSICmd_INQUIRY_StandardDataAll +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 RMB; // 7 = removable + UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. + UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. + // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. + UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data + UInt8 SCCSReserved; // SCC-2 device flag and reserved fields + UInt8 flags1; // First byte of support flags (Byte 6) + UInt8 flags2; // Second byte of support flags (Byte 7) + char VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + char PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + char PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; + + // Following is the optional data that may be returned by a device. + UInt8 VendorSpecific1[20]; + UInt8 flags3; // Third byte of support flags, mainly SPI-3 (Byte 56) + UInt8 Reserved1; + UInt16 VERSION_DESCRIPTOR[8]; + UInt8 Reserved2[22]; + UInt8 VendorSpecific2[160]; +} SCSICmd_INQUIRY_StandardDataAll; + + +/*! +@enum Peripheral Qualifier +@discussion +Inquiry Peripheral Qualifier definitions +@constant kINQUIRY_PERIPHERAL_QUALIFIER_Connected +Peripheral Device is connected. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected +Peripheral Device is supported, but not connected. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported +Peripheral Device is not supported. +@constant kINQUIRY_PERIPHERAL_QUALIFIER_Mask +Mask to use for PERIPHERAL_DEVICE_TYPE field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_QUALIFIER_Connected = 0x00, + kINQUIRY_PERIPHERAL_QUALIFIER_SupportedButNotConnected = 0x20, + kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported = 0x60, + kINQUIRY_PERIPHERAL_QUALIFIER_Mask = 0xE0 +}; + + +/*! +@enum Peripheral Device types +@discussion +Inquiry Peripheral Device type definitions +@constant kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice +Sequential Access (Tape) SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice +SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice +SPC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice +MMC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device +SCSI2 Device. +@constant kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice +SBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice +SMC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice +Comms SSC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device +SCC2 Device. +@constant kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice +SES Device. +@constant kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice +RBC Device. +@constant kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice +OCRW Device. +@constant kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice +OSD device. +@constant kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface +Automation Drive Interface device. +@constant kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit +Well known logical unit. +@constant kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType +Unknown or no device. +@constant kINQUIRY_PERIPHERAL_TYPE_Mask +Mask to use for PERIPHERAL_DEVICE_TYPE field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice = 0x00, + kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice = 0x01, + kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice = 0x02, + kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice = 0x03, + kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice = 0x04, + kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice = 0x05, + kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device = 0x06, + kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice = 0x07, + kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice = 0x08, + kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice = 0x09, + /* 0x0A - 0x0B ASC IT8 Graphic Arts Prepress Devices */ + kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device = 0x0C, + kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice = 0x0D, + kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice = 0x0E, + kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice = 0x0F, + /* 0x10 - 0x1E Reserved Device Types */ + kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice = 0x11, + kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface = 0x12, + kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit = 0x1E, + kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType = 0x1F, + + + kINQUIRY_PERIPHERAL_TYPE_Mask = 0x1F +}; + + +/*! +@enum Removable Bit field definitions +@discussion +Inquiry Removable Bit field definitions +@constant kINQUIRY_PERIPHERAL_RMB_MediumFixed +Medium type is fixed disk. +@constant kINQUIRY_PERIPHERAL_RMB_MediumRemovable +Medium type is removable disk. +@constant kINQUIRY_PERIPHERAL_RMB_BitMask +Mask to use for RMB field. +*/ +enum +{ + kINQUIRY_PERIPHERAL_RMB_MediumFixed = 0x00, + kINQUIRY_PERIPHERAL_RMB_MediumRemovable = 0x80, + kINQUIRY_PERIPHERAL_RMB_BitMask = 0x80 +}; + + +/*! +@enum Version field definitions +@discussion +Definitions for bits/masks in the INQUIRY Version field. +@constant kINQUIRY_ISO_IEC_VERSION_Mask +Mask for valid bits for ISO/IEC Version. +@constant kINQUIRY_ECMA_VERSION_Mask +Mask for valid bits for ECMA Version. +@constant kINQUIRY_ANSI_VERSION_NoClaimedConformance +No ANSI conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_1_Compliant +SCSI-1 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_2_Compliant +SCSI-2 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant +SPC conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant +SPC-2 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant +SPC-3 conformance claimed by the device server. +@constant kINQUIRY_ANSI_VERSION_Mask +Mask for valid bits for ANSI Version. +*/ +enum +{ + kINQUIRY_ISO_IEC_VERSION_Mask = 0xC0, + + kINQUIRY_ECMA_VERSION_Mask = 0x38, + + kINQUIRY_ANSI_VERSION_NoClaimedConformance = 0x00, + kINQUIRY_ANSI_VERSION_SCSI_1_Compliant = 0x01, + kINQUIRY_ANSI_VERSION_SCSI_2_Compliant = 0x02, + kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant = 0x03, + kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant = 0x04, + kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant = 0x05, + kINQUIRY_ANSI_VERSION_Mask = 0x07 +}; + + +/*! +@enum Response Data Format field definitions +@discussion +Definitions for bits/masks in the INQUIRY RESPONSE_DATA_FORMAT field. +@constant kINQUIRY_Byte3_HISUP_Bit +HISUP bit definition. +@constant kINQUIRY_Byte3_NORMACA_Bit +NORMACA bit definition. +@constant kINQUIRY_Byte3_AERC_Bit +AERC bit definition. +@constant kINQUIRY_RESPONSE_DATA_FORMAT_Mask +Mask for valid bits for RESPONSE_DATA_FORMAT. +@constant kINQUIRY_Byte3_HISUP_Mask +Mask to use to test the HISUP bit. +@constant kINQUIRY_Byte3_NORMACA_Mask +Mask to use to test the NORMACA bit. +@constant kINQUIRY_Byte3_AERC_Mask +Mask to use to test the AERC bit. +*/ +enum +{ + // Bit definitions + // Bits 0-3: RESPONSE DATA FORMAT + kINQUIRY_Byte3_HISUP_Bit = 4, + kINQUIRY_Byte3_NORMACA_Bit = 5, + // Bit 6 is Obsolete + kINQUIRY_Byte3_AERC_Bit = 7, + + // Masks + kINQUIRY_RESPONSE_DATA_FORMAT_Mask = 0x0F, // Bits 0-3 + kINQUIRY_Byte3_HISUP_Mask = (1 << kINQUIRY_Byte3_HISUP_Bit), + kINQUIRY_Byte3_NORMACA_Mask = (1 << kINQUIRY_Byte3_NORMACA_Bit), + // Bit 6 is Obsolete + kINQUIRY_Byte3_AERC_Mask = (1 << kINQUIRY_Byte3_AERC_Bit) +}; + + +/*! +@enum SCCS field definitions +@discussion +Definitions for bits/masks in the INQUIRY SCCSReserved field. +@constant kINQUIRY_Byte5_SCCS_Bit +SCCS bit definition. +@constant kINQUIRY_Byte5_ACC_Bit +ACC bit definition. +@constant kINQUIRY_Byte5_3PC_Bit +3PC bit definition. +@constant kINQUIRY_Byte5_PROTECT_Bit +PROTECT bit definition. +@constant kINQUIRY_Byte5_SCCS_Mask +Mask to use to test the SCCS bit. +@constant kINQUIRY_Byte5_ACC_Mask +Mask to use to test the ACC bit. +@constant kINQUIRY_Byte5_TPGS_Mask +Mask to use for the TPGS bits. +@constant kINQUIRY_Byte5_3PC_Mask +Mask to use to test the 3PC bit. +@constant kINQUIRY_Byte5_PROTECT_Mask +Mask to use to test the PROTECT bit. +*/ +enum +{ + // Bit definitions + kINQUIRY_Byte5_SCCS_Bit = 7, + kINQUIRY_Byte5_ACC_Bit = 6, + // Bits 4-5: TPGS + kINQUIRY_Byte5_3PC_Bit = 3, + // Bits 1-2: Reserved + kINQUIRY_Byte5_PROTECT_Bit = 0, + + // Masks + kINQUIRY_Byte5_SCCS_Mask = (1 << kINQUIRY_Byte5_SCCS_Bit), + kINQUIRY_Byte5_ACC_Mask = (1 << kINQUIRY_Byte5_ACC_Bit), + kINQUIRY_Byte5_TPGS_Mask = 0x18, + kINQUIRY_Byte5_3PC_Mask = (1 << kINQUIRY_Byte5_3PC_Bit), + // Bits 1-2: Reserved + kINQUIRY_Byte5_PROTECT_Mask = (1 << kINQUIRY_Byte5_PROTECT_Bit) +}; + + +/*! +@enum flags1 field definitions +@discussion +Definitions for bits/masks in the INQUIRY flags1 field. +@constant kINQUIRY_Byte6_ADDR16_Bit +ADDR16 bit definition. +@constant kINQUIRY_Byte6_MCHNGR_Bit +MCHNGR bit definition. +@constant kINQUIRY_Byte6_MULTIP_Bit +MULTIP bit definition. +@constant kINQUIRY_Byte6_VS_Bit +VS bit definition. +@constant kINQUIRY_Byte6_ENCSERV_Bit +ENCSERV bit definition. +@constant kINQUIRY_Byte6_BQUE_Bit +BQUE bit definition. +@constant kINQUIRY_Byte6_ADDR16_Mask +Mask to use to test the ADDR16 bit. +@constant kINQUIRY_Byte6_MCHNGR_Mask +Mask to use to test the MCHNGR bit. +@constant kINQUIRY_Byte6_MULTIP_Mask +Mask to use to test the MULTIP bit. +@constant kINQUIRY_Byte6_VS_Mask +Mask to use to test the VS bit. +@constant kINQUIRY_Byte6_ENCSERV_Mask +Mask to use to test the ENCSERV bit. +@constant kINQUIRY_Byte6_BQUE_Mask +Mask to use to test the BQUE bit. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte6_Offset = 6, + + // Bit definitions + kINQUIRY_Byte6_ADDR16_Bit = 0, // SPI Specific + // Bit 1 is Obsolete + // Bit 2 is Obsolete + kINQUIRY_Byte6_MCHNGR_Bit = 3, + kINQUIRY_Byte6_MULTIP_Bit = 4, + kINQUIRY_Byte6_VS_Bit = 5, + kINQUIRY_Byte6_ENCSERV_Bit = 6, + kINQUIRY_Byte6_BQUE_Bit = 7, + + // Masks + kINQUIRY_Byte6_ADDR16_Mask = (1 << kINQUIRY_Byte6_ADDR16_Bit), // SPI Specific + // Bit 1 is Obsolete + // Bit 2 is Obsolete + kINQUIRY_Byte6_MCHNGR_Mask = (1 << kINQUIRY_Byte6_MCHNGR_Bit), + kINQUIRY_Byte6_MULTIP_Mask = (1 << kINQUIRY_Byte6_MULTIP_Bit), + kINQUIRY_Byte6_VS_Mask = (1 << kINQUIRY_Byte6_VS_Bit), + kINQUIRY_Byte6_ENCSERV_Mask = (1 << kINQUIRY_Byte6_ENCSERV_Bit), + kINQUIRY_Byte6_BQUE_Mask = (1 << kINQUIRY_Byte6_BQUE_Bit) +}; + + +/*! +@enum flags2 field definitions +@discussion +Definitions for bits/masks in the INQUIRY flags2 field. +@constant kINQUIRY_Byte7_VS_Bit +VS bit definition. +@constant kINQUIRY_Byte7_CMDQUE_Bit +CMDQUE bit definition. +@constant kINQUIRY_Byte7_TRANDIS_Bit +TRANDIS bit definition. +@constant kINQUIRY_Byte7_LINKED_Bit +LINKED bit definition. +@constant kINQUIRY_Byte7_SYNC_Bit +SYNC bit definition. +@constant kINQUIRY_Byte7_WBUS16_Bit +WBUS16 bit definition. +@constant kINQUIRY_Byte7_RELADR_Bit +RELADR bit definition. +@constant kINQUIRY_Byte7_VS_Mask +Mask to use to test the VS bit. +@constant kINQUIRY_Byte7_CMDQUE_Mask +Mask to use to test the CMDQUE bit. +@constant kINQUIRY_Byte7_TRANDIS_Mask +Mask to use to test the TRANDIS bit. +@constant kINQUIRY_Byte7_LINKED_Mask +Mask to use to test the LINKED bit. +@constant kINQUIRY_Byte7_SYNC_Mask +Mask to use to test the SYNC bit. +@constant kINQUIRY_Byte7_WBUS16_Mask +Mask to use to test the WBUS16 bit. +@constant kINQUIRY_Byte7_RELADR_Mask +Mask to use to test the RELADR bit. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte7_Offset = 7, + + // Bit definitions + kINQUIRY_Byte7_VS_Bit = 0, + kINQUIRY_Byte7_CMDQUE_Bit = 1, + kINQUIRY_Byte7_TRANDIS_Bit = 2, // SPI Specific + kINQUIRY_Byte7_LINKED_Bit = 3, + kINQUIRY_Byte7_SYNC_Bit = 4, // SPI Specific + kINQUIRY_Byte7_WBUS16_Bit = 5, // SPI Specific + // Bit 6 is Obsolete + kINQUIRY_Byte7_RELADR_Bit = 7, + + // Masks + kINQUIRY_Byte7_VS_Mask = (1 << kINQUIRY_Byte7_VS_Bit), + kINQUIRY_Byte7_CMDQUE_Mask = (1 << kINQUIRY_Byte7_CMDQUE_Bit), + kINQUIRY_Byte7_TRANDIS_Mask = (1 << kINQUIRY_Byte7_TRANDIS_Bit),// SPI Specific + kINQUIRY_Byte7_LINKED_Mask = (1 << kINQUIRY_Byte7_LINKED_Bit), + kINQUIRY_Byte7_SYNC_Mask = (1 << kINQUIRY_Byte7_SYNC_Bit), // SPI Specific + kINQUIRY_Byte7_WBUS16_Mask = (1 << kINQUIRY_Byte7_WBUS16_Bit), // SPI Specific + // Bit 6 is Obsolete + kINQUIRY_Byte7_RELADR_Mask = (1 << kINQUIRY_Byte7_RELADR_Bit) +}; + + +/*! +@enum Byte 56 features field definitions +@discussion +Definitions for bits/masks in the INQUIRY Byte 56 field. +Inquiry Byte 56 features (for devices that report an ANSI VERSION of +kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant or later). +These are SPI-3 Specific. +@constant kINQUIRY_Byte56_IUS_Bit +IUS bit definition. +@constant kINQUIRY_Byte56_QAS_Bit +QAS bit definition. +@constant kINQUIRY_Byte56_IUS_Mask +Mask to use to test the IUS bit. +@constant kINQUIRY_Byte56_QAS_Mask +Mask to use to test the QAS bit. +@constant kINQUIRY_Byte56_CLOCKING_Mask +Mask to use to test CLOCKING bits. +@constant kINQUIRY_Byte56_CLOCKING_ONLY_ST +Single-transition clocking only. +@constant kINQUIRY_Byte56_CLOCKING_ONLY_DT +Double-transition clocking only. +@constant kINQUIRY_Byte56_CLOCKING_ST_AND_DT +Single-transition and double-transition clocking. +*/ +enum +{ + // Byte offset + kINQUIRY_Byte56_Offset = 56, + + // Bit definitions + kINQUIRY_Byte56_IUS_Bit = 0, + kINQUIRY_Byte56_QAS_Bit = 1, + // Bits 2 and 3 are the CLOCKING bits + // All other bits are reserved + + kINQUIRY_Byte56_IUS_Mask = (1 << kINQUIRY_Byte56_IUS_Bit), + kINQUIRY_Byte56_QAS_Mask = (1 << kINQUIRY_Byte56_QAS_Bit), + kINQUIRY_Byte56_CLOCKING_Mask = 0x0C, + + // Definitions for the CLOCKING bits + kINQUIRY_Byte56_CLOCKING_ONLY_ST = 0x00, + kINQUIRY_Byte56_CLOCKING_ONLY_DT = 0x04, + // kINQUIRY_Byte56_CLOCKING_RESERVED = 0x08, + kINQUIRY_Byte56_CLOCKING_ST_AND_DT = 0x0C +}; + + +/*! +@define kINQUIRY_VERSION_DESCRIPTOR_MaxCount +Maximum number of INQUIRY version descriptors supported. +*/ +#define kINQUIRY_VERSION_DESCRIPTOR_MaxCount 8 + + +/*! +@enum kINQUIRY_VERSION_DESCRIPTOR_SAT +SAT specification version descriptor. +*/ +enum +{ + kINQUIRY_VERSION_DESCRIPTOR_SAT = 0x1EA0 +}; + + +/* +IORegistry property names for information derived from the Inquiry data. +The Peripheral Device Type is the only property that the +generic Logical Unit Drivers will use to match. These properties are +listed in order of matching priority. First is the Peripheral Device Type. +Second is the Vendor Identification. Third is the Product Identification. +Last is the Product Revision Level. To match a particular product, you would +specify the Peripheral Device Type, Vendor Identification, and Product +Identification. To restrict the match to a particular firmware revision, you +would add the Product Revision Level. To not match on a particular product, +but on a particular vendor's products, you would only include the +Peripheral Device Type and the Vendor Identification. +*/ + +/*! +@define kIOPropertySCSIPeripheralDeviceType +SCSI Peripheral Device Type as reported in the INQUIRY data. +*/ +#define kIOPropertySCSIPeripheralDeviceType "Peripheral Device Type" + +/*! +@define kIOPropertySCSIPeripheralDeviceTypeSize +Size of the kIOPropertySCSIPeripheralDeviceType key. +*/ +#define kIOPropertySCSIPeripheralDeviceTypeSize 8 + +/* These properties are listed in order of matching priority */ + +/*! +@define kIOPropertySCSIVendorIdentification +Vendor ID as reported in the INQUIRY data. Additional space characters (0x20) +are truncated. +*/ +#define kIOPropertySCSIVendorIdentification "Vendor Identification" + +/*! +@define kIOPropertySCSIProductIdentification +Product ID as reported in the INQUIRY data. Additional space characters (0x20) +are truncated. +*/ +#define kIOPropertySCSIProductIdentification "Product Identification" + +/*! +@define kIOPropertySCSIProductRevisionLevel +Product Revision Level as reported in the INQUIRY data. +*/ +#define kIOPropertySCSIProductRevisionLevel "Product Revision Level" + + +/*! +@enum INQUIRY Page Codes +@discussion INQUIRY Page Codes to be used when EVPD is set in the +INQUIRY command. +@constant kINQUIRY_Page00_PageCode +Page Code 00h. +@constant kINQUIRY_Page80_PageCode +Page Code 80h. +@constant kINQUIRY_Page83_PageCode +Page Code 83h. +@constant kINQUIRY_Page89_PageCode +Page Code 89h. +*/ +enum +{ + kINQUIRY_Page00_PageCode = 0x00, + kINQUIRY_Page80_PageCode = 0x80, + kINQUIRY_Page83_PageCode = 0x83, + kINQUIRY_Page89_PageCode = 0x89 +}; + + +/*! +@struct SCSICmd_INQUIRY_Page00_Header +@discussion INQUIRY Page 00h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page00_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 00h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page00_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page80_Header +@discussion INQUIRY Page 80h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page80_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 80h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes + UInt8 PRODUCT_SERIAL_NUMBER; // 4-n +} SCSICmd_INQUIRY_Page80_Header; + + +/*! +@define kIOPropertySCSIINQUIRYUnitSerialNumber +Key that describes the INQUIRY Unit Serial Number in the IORegistry. +*/ +#define kIOPropertySCSIINQUIRYUnitSerialNumber "INQUIRY Unit Serial Number" + + +/*! +@struct SCSICmd_INQUIRY_Page83_Header +@discussion INQUIRY Page 83h Header. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Header +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 83h + UInt8 RESERVED; // reserved field + UInt8 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page83_Header; + + +/*! +@struct SCSICmd_INQUIRY_Page83_Header_SPC_16 +@discussion INQUIRY Page 83h Header used with the 16 byte INQUIRY command. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Header_SPC_16 +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 83h + UInt16 PAGE_LENGTH; // n-3 bytes +} SCSICmd_INQUIRY_Page83_Header_SPC_16; + + +/*! +@struct SCSICmd_INQUIRY_Page83_Identification_Descriptor +@discussion INQUIRY Page 83h Identification Descriptor. +*/ +typedef struct SCSICmd_INQUIRY_Page83_Identification_Descriptor +{ + UInt8 CODE_SET; // 7-4 = Protocol Identifier. 3-0 = Code Set + UInt8 IDENTIFIER_TYPE; // 7 = PIV 5-4 = ASSOCIATION 3-0 = Identifier + UInt8 RESERVED; + UInt8 IDENTIFIER_LENGTH; + UInt8 IDENTIFIER; +} SCSICmd_INQUIRY_Page83_Identification_Descriptor; + + +/*! +@enum INQUIRY Page 83h Code Set +@discussion +Definitions for the Code Set field. +@constant kINQUIRY_Page83_CodeSetBinaryData +The identifier contains binary data. +@constant kINQUIRY_Page83_CodeSetASCIIData +The identifier contains ASCII data. +@constant kINQUIRY_Page83_CodeSetUTF8Data +The identifier contains UTF-8 data. +*/ +enum +{ + kINQUIRY_Page83_CodeSetReserved = 0x0, + kINQUIRY_Page83_CodeSetBinaryData = 0x1, + kINQUIRY_Page83_CodeSetASCIIData = 0x2, + kINQUIRY_Page83_CodeSetUTF8Data = 0x3, + // 0x4 - 0xF reserved + kINQUIRY_Page83_CodeSetMask = 0xF +}; + + +/*! +@enum INQUIRY Page 83h Association +@discussion +Definitions for the Association field. +@constant kINQUIRY_Page83_AssociationLogicalUnit +Association of the identifier is with the logical unit. +@constant kINQUIRY_Page83_AssociationDevice +Association of the identifier is with the device (same as logical unit in SPC-2). +@constant kINQUIRY_Page83_AssociationTargetPort +Association of the identifier is with the target port. +@constant kINQUIRY_Page83_AssociationTargetDevice +Association of the identifier is with the target device (i.e. all ports). +@constant kINQUIRY_Page83_AssociationMask +Mask to use to determine association. +*/ +enum +{ + // SPC-3 - Association is changed to be specific to + // Logical Units + kINQUIRY_Page83_AssociationLogicalUnit = 0x00, + + // Backwards compatibility for SPC-2 + kINQUIRY_Page83_AssociationDevice = kINQUIRY_Page83_AssociationLogicalUnit, + + // Association is related to a Target Port + kINQUIRY_Page83_AssociationTargetPort = 0x10, + + // SPC-3 - Added as specific association to + // a Target device. + kINQUIRY_Page83_AssociationTargetDevice = 0x20, + + kINQUIRY_Page83_AssociationMask = 0x30 +}; + + +/*! +@enum INQUIRY Page 83h Identifier Type +@discussion +Definitions for the Identifier Type field. +@constant kINQUIRY_Page83_IdentifierTypeUndefined +Undefined Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeVendorID +Vendor Specific Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 +EUI-64 Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeNAAIdentifier +NAA Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier +Relative Target Port Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeTargetPortGroup +Target Port Group Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup +Logical Unit Group Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier +MD5 Logical Unit Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeSCSINameString +SCSI Name String Identifier Type. +@constant kINQUIRY_Page83_IdentifierTypeMask +Mask to use to determine association. +@constant kINQUIRY_Page83_ProtocolIdentifierValidBit +PIV Bit definition. +@constant kINQUIRY_Page83_ProtocolIdentifierValidMask +Mask to use to determine if PIV is set. +*/ +enum +{ + kINQUIRY_Page83_IdentifierTypeUndefined = 0, + kINQUIRY_Page83_IdentifierTypeVendorID = 1, + kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 = 2, + kINQUIRY_Page83_IdentifierTypeNAAIdentifier = 3, + kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier = 4, + kINQUIRY_Page83_IdentifierTypeTargetPortGroup = 5, + kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup = 6, + kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier = 7, + kINQUIRY_Page83_IdentifierTypeSCSINameString = 8, + // 0x9 - 0xF Reserved + + kINQUIRY_Page83_IdentifierTypeMask = 0xF, + + kINQUIRY_Page83_ProtocolIdentifierValidBit = 7, + kINQUIRY_Page83_ProtocolIdentifierValidMask = (1 << kINQUIRY_Page83_ProtocolIdentifierValidBit) + +}; + +// Backwards compatibility +#define kINQUIRY_Page83_IdentifierTypeFCNameIdentifier kINQUIRY_Page83_IdentifierTypeNAAIdentifier + + +/*! +@enum Protocol Identifier values +@discussion +Definitions for the protocol identifier values. +@constant kSCSIProtocolIdentifier_FibreChannel +FibreChannel Protocol Identifier. +@constant kSCSIProtocolIdentifier_ParallelSCSI +Parallel SCSI Protocol Identifier. +@constant kSCSIProtocolIdentifier_SSA +SSA Protocol Identifier. +@constant kSCSIProtocolIdentifier_FireWire +FireWire (IEEE-1394) Protocol Identifier. +@constant kSCSIProtocolIdentifier_RDMA +RDMA Protocol Identifier. +@constant kSCSIProtocolIdentifier_iSCSI +iSCSI Protocol Identifier. +@constant kSCSIProtocolIdentifier_SAS +SAS Protocol Identifier. +@constant kSCSIProtocolIdentifier_ADT +ADT Protocol Identifier. +@constant kSCSIProtocolIdentifier_ATAPI +ATAPI Protocol Identifier. +@constant kSCSIProtocolIdentifier_None +No Protocol Identifier. +*/ +enum +{ + kSCSIProtocolIdentifier_FibreChannel = 0, + kSCSIProtocolIdentifier_ParallelSCSI = 1, + kSCSIProtocolIdentifier_SSA = 2, + kSCSIProtocolIdentifier_FireWire = 3, + kSCSIProtocolIdentifier_RDMA = 4, + kSCSIProtocolIdentifier_iSCSI = 5, + kSCSIProtocolIdentifier_SAS = 6, + kSCSIProtocolIdentifier_ADT = 7, + kSCSIProtocolIdentifier_ATAPI = 8, + // 0x9-0xE Reserved + kSCSIProtocolIdentifier_None = 0xF +}; + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdentification +Device Identification key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdentification "INQUIRY Device Identification" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdCodeSet +Code Set type key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdCodeSet "Code Set" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdType +Identifier Type key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdType "Identifier Type" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdAssociation +Association key. +*/ +#define kIOPropertySCSIINQUIRYDeviceIdAssociation "Association" + + +/*! +@define kIOPropertySCSIINQUIRYDeviceIdentifier +Identifier key (data or string). +*/ +#define kIOPropertySCSIINQUIRYDeviceIdentifier "Identifier" + + +/*! +@struct SCSICmd_INQUIRY_Page89_Data +@discussion INQUIRY Page 89h data as defined in the SAT 1.0 +specification. This section contians all structures and +definitions used by the INQUIRY command in response to a request +for page 89h - ATA information VPD Page. +*/ +typedef struct SCSICmd_INQUIRY_Page89_Data +{ + UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. + UInt8 PAGE_CODE; // Must be equal to 89h + UInt16 PAGE_LENGTH; // Must be equal to 238h + UInt32 Reserved; + UInt8 SAT_VENDOR_IDENTIFICATION[kINQUIRY_VENDOR_IDENTIFICATION_Length]; + UInt8 SAT_PRODUCT_IDENTIFICATION[kINQUIRY_PRODUCT_IDENTIFICATION_Length]; + UInt8 SAT_PRODUCT_REVISION_LEVEL[kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; + UInt8 ATA_DEVICE_SIGNATURE[20]; + UInt8 COMMAND_CODE; + UInt8 Reserved2[3]; + UInt8 IDENTIFY_DATA[512]; +} SCSICmd_INQUIRY_Page89_Data; + + +/*! +@define kIOPropertySATVendorIdentification +Vendor Identification of the SATL. +*/ +#define kIOPropertySATVendorIdentification "SAT Vendor Identification" + + +/*! +@define kIOPropertySATProductIdentification +Product Identification of the SATL. +*/ +#define kIOPropertySATProductIdentification "SAT Product Identification" + + +/*! +@define kIOPropertySATProductRevisonLevel +Product Revision Level of the SATL. +*/ +#define kIOPropertySATProductRevisonLevel "SAT Product Revision Level" + + +#endif /* _IOKIT_SCSI_CMDS_INQUIRY_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICmds_MODE_Definitions.h b/i386/include/IOKit/scsi/SCSICmds_MODE_Definitions.h new file mode 100644 index 0000000..8d9c250 --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICmds_MODE_Definitions.h @@ -0,0 +1,559 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ +#define _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the MODE_SENSE_6 and MODE_SENSE_10 commands. +*/ + +#pragma pack(1) + +/*! +@struct SPCModeParameterHeader6 +@discussion +Mode Parameter Header for the MODE_SENSE_6 command. +*/ +typedef struct SPCModeParameterHeader6 +{ + UInt8 MODE_DATA_LENGTH; + UInt8 MEDIUM_TYPE; + UInt8 DEVICE_SPECIFIC_PARAMETER; + UInt8 BLOCK_DESCRIPTOR_LENGTH; +} SPCModeParameterHeader6; + + +/*! +@struct SPCModeParameterHeader10 +@discussion +Mode Parameter Header for the MODE_SENSE_10 command. +*/ +typedef struct SPCModeParameterHeader10 +{ + UInt16 MODE_DATA_LENGTH; + UInt8 MEDIUM_TYPE; + UInt8 DEVICE_SPECIFIC_PARAMETER; + UInt8 LONGLBA; + UInt8 RESERVED; + UInt16 BLOCK_DESCRIPTOR_LENGTH; +} SPCModeParameterHeader10; + + +/*! +@enum Long LBA Bitfield definitions +@discussion +Long LBA Bitfield definitions for Mode Parameter Header +for MODE_SENSE_10 command. +@constant kModeSenseParameterHeader10_LongLBABit +Bit to indicate Long LBA block descriptors follow. +@constant kModeSenseParameterHeader10_LongLBAMask +Mask to test for kModeSenseParameterHeader10_LongLBABit. +*/ +enum +{ + kModeSenseParameterHeader10_LongLBABit = 0, + kModeSenseParameterHeader10_LongLBAMask = (1 << kModeSenseParameterHeader10_LongLBABit), +}; + + +/*! +@enum Device Specific Parameter Bitfield definitions +@discussion +SBC definitions for Device Specific Parameter in the +Mode Sense Header Block. +@constant kModeSenseSBCDeviceSpecific_DPOFUABit +Bit to indicate DPO and FUA bits are accepted by the device server. +@constant kModeSenseSBCDeviceSpecific_WriteProtectBit +Bit to indicate medium is write protected. +@constant kModeSenseSBCDeviceSpecific_DPOFUAMask +Mask to test for kModeSenseSBCDeviceSpecific_DPOFUABit. +@constant kModeSenseSBCDeviceSpecific_WriteProtectMask +Mask to test for kModeSenseSBCDeviceSpecific_WriteProtectBit. +*/ +enum +{ + kModeSenseSBCDeviceSpecific_DPOFUABit = 4, + kModeSenseSBCDeviceSpecific_WriteProtectBit = 7, + kModeSenseSBCDeviceSpecific_DPOFUAMask = (1 << kModeSenseSBCDeviceSpecific_DPOFUABit), + kModeSenseSBCDeviceSpecific_WriteProtectMask = (1 << kModeSenseSBCDeviceSpecific_WriteProtectBit) +}; + + +/*! +@struct ModeParameterBlockDescriptor +@discussion +General mode parameter block descriptor. +*/ +typedef struct ModeParameterBlockDescriptor +{ + UInt8 DENSITY_CODE; + UInt8 NUMBER_OF_BLOCKS[3]; + UInt8 RESERVED; + UInt8 BLOCK_LENGTH[3]; +} ModeParameterBlockDescriptor; + + +/*! +@struct DASDModeParameterBlockDescriptor +@discussion +Direct Access Storage Device mode parameter block descriptor. +*/ +typedef struct DASDModeParameterBlockDescriptor +{ + UInt32 NUMBER_OF_BLOCKS; + UInt8 DENSITY_CODE; + UInt8 BLOCK_LENGTH[3]; +} DASDModeParameterBlockDescriptor; + + +/*! +@struct LongLBAModeParameterBlockDescriptor +@discussion +Long LBA mode parameter block descriptor. +*/ +typedef struct LongLBAModeParameterBlockDescriptor +{ + UInt64 NUMBER_OF_BLOCKS; + UInt8 DENSITY_CODE; + UInt8 RESERVED[3]; + UInt32 BLOCK_LENGTH; +} LongLBAModeParameterBlockDescriptor; + + +/*! +@struct ModePageFormatHeader +@discussion +Mode Page format header. +*/ +typedef struct ModePageFormatHeader +{ + UInt8 PS_PAGE_CODE; + UInt8 PAGE_LENGTH; +} ModePageFormatHeader; + + +/*! +@enum Mode Page Format bit definitions +@discussion +Mode Page Format bit definitions. +@constant kModePageFormat_PS_Bit +Bit to indicate Parameters Saveable. +@constant kModePageFormat_PAGE_CODE_Mask +Mask to obtain the PAGE_CODE from the PS_PAGE_CODE field. +@constant kModePageFormat_PS_Mask +Mask to test for kModePageFormat_PS_Bit. +*/ +enum +{ + kModePageFormat_PS_Bit = 7, + + kModePageFormat_PAGE_CODE_Mask = 0x3F, + kModePageFormat_PS_Mask = (1 << kModePageFormat_PS_Bit) +}; + + +#if 0 +#pragma mark - +#pragma mark SPC Mode Pages +#pragma mark - +#endif + + +/*! +@enum SPC Mode Pages +@discussion +SPC Mode Page definitions. +@constant kSPCModePagePowerConditionCode +Power Conditions Mode Page value. +@constant kSPCModePageAllPagesCode +All Mode Pages value. +*/ +enum +{ + kSPCModePagePowerConditionCode = 0x1A, + kSPCModePageAllPagesCode = 0x3F +}; + +/*! +@struct SPCModePagePowerCondition +@discussion +Power Conditions Mode Page (PAGE CODE 0x1A) format. +*/ +typedef struct SPCModePagePowerCondition +{ + ModePageFormatHeader header; + UInt8 RESERVED; + UInt8 IDLE_STANDBY; + UInt32 IDLE_CONDITION_TIMER; + UInt32 STANDBY_CONDITION_TIMER; +} SPCModePagePowerCondition; + + +#if 0 +#pragma mark - +#pragma mark 0x00 SBC Direct Access Mode Pages +#pragma mark - +#endif + + +/*! +@enum SBC Mode Pages +@discussion +SBC Mode Page definitions. +@constant kSBCModePageFormatDeviceCode +Format Device Mode Page value. +@constant kSBCModePageRigidDiskGeometryCode +Rigid Disk Geometry Page value. +@constant kSBCModePageFlexibleDiskCode +Flexible Disk Page value. +@constant kSBCModePageCachingCode +Caching Page value. +*/ +enum +{ + kSBCModePageFormatDeviceCode = 0x03, + kSBCModePageRigidDiskGeometryCode = 0x04, + kSBCModePageFlexibleDiskCode = 0x05, + kSBCModePageCachingCode = 0x08 +}; + + +/*! +@struct SBCModePageFormatDevice +@discussion +Format Device Mode Page (PAGE CODE 0x03) format. +*/ +typedef struct SBCModePageFormatDevice +{ + ModePageFormatHeader header; + UInt16 TRACKS_PER_ZONE; + UInt16 ALTERNATE_SECTORS_PER_ZONE; + UInt16 ALTERNATE_TRACKS_PER_ZONE; + UInt16 ALTERNATE_TRACKS_PER_LOGICAL_UNIT; + UInt16 SECTORS_PER_TRACK; + UInt16 DATA_BYTES_PER_PHYSICAL_SECTOR; + UInt16 INTERLEAVE; + UInt16 TRACK_SKEW_FACTOR; + UInt16 CYLINDER_SKEW_FACTOR; + UInt8 SSEC_HSEC_RMB_SURF; + UInt8 RESERVED[3]; +} SBCModePageFormatDevice; + + +/*! +@struct SBCModePageRigidDiskGeometry +@discussion +Rigid Disk Geometry Mode Page (PAGE CODE 0x04) format. +*/ +typedef struct SBCModePageRigidDiskGeometry +{ + ModePageFormatHeader header; + UInt8 NUMBER_OF_CYLINDERS[3]; + UInt8 NUMBER_OF_HEADS; + UInt8 STARTING_CYLINDER_WRITE_PRECOMPENSATION[3]; + UInt8 STARTING_CYLINDER_REDUCED_WRITE_CURRENT[3]; + UInt16 DEVICE_STEP_RATE; + UInt8 LANDING_ZONE_CYLINDER[3]; + UInt8 RPL; + UInt8 ROTATIONAL_OFFSET; + UInt8 RESERVED; + UInt16 MEDIUM_ROTATION_RATE; + UInt8 RESERVED1[2]; +} SBCModePageRigidDiskGeometry; + + +/*! +@enum Rigid Disk Geometry bitfields +@discussion +Bit field masks for Rigid Disk Geometry structure fields. +@constant kSBCModePageRigidDiskGeometry_RPL_Mask +Mask for use with the RPL field. +*/ +enum +{ + kSBCModePageRigidDiskGeometry_RPL_Mask = 0x03 +}; + + +/*! +@struct SBCModePageFlexibleDisk +@discussion +Flexible Disk Mode Page (PAGE CODE 0x05) format. +*/ +typedef struct SBCModePageFlexibleDisk +{ + ModePageFormatHeader header; + UInt16 TRANSFER_RATE; + UInt8 NUMBER_OF_HEADS; + UInt8 SECTORS_PER_TRACK; + UInt16 DATA_BYTES_PER_SECTOR; + UInt16 NUMBER_OF_CYLINDERS; + UInt16 STARTING_CYLINDER_WRITE_PRECOMPENSATION; + UInt16 STARTING_CYLINDER_REDUCED_WRITE_CURRENT; + UInt16 DEVICE_STEP_RATE; + UInt8 DEVICE_STEP_PULSE_WIDTH; + UInt16 HEAD_SETTLE_DELAY; + UInt8 MOTOR_ON_DELAY; + UInt8 MOTOR_OFF_DELAY; + UInt8 TRDY_SSN_MO; + UInt8 SPC; + UInt8 WRITE_COMPENSATION; + UInt8 HEAD_LOAD_DELAY; + UInt8 HEAD_UNLOAD_DELAY; + UInt8 PIN_34_PIN_2; + UInt8 PIN_4_PIN_1; + UInt16 MEDIUM_ROTATION_RATE; + UInt8 RESERVED[2]; +} SBCModePageFlexibleDisk; + + +/*! +@enum TRDY_SSN_MO bitfields +@discussion +Bit field definitions and masks for Flexible Disk TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_MO_Bit +MO Bit definition. +@constant kSBCModePageFlexibleDisk_SSN_Bit +SSN Bit definition. +@constant kSBCModePageFlexibleDisk_TRDY_Bit +TRDY Bit definition. +@constant kSBCModePageFlexibleDisk_MO_Mask +Mask for use with TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_SSN_Mask +Mask for use with TRDY_SSN_MO field. +@constant kSBCModePageFlexibleDisk_TRDY_Mask +Mask for use with TRDY_SSN_MO field. +*/ +enum +{ + // Bits 0:4 Reserved + kSBCModePageFlexibleDisk_MO_Bit = 5, + kSBCModePageFlexibleDisk_SSN_Bit = 6, + kSBCModePageFlexibleDisk_TRDY_Bit = 7, + + kSBCModePageFlexibleDisk_MO_Mask = (1 << kSBCModePageFlexibleDisk_MO_Bit), + kSBCModePageFlexibleDisk_SSN_Mask = (1 << kSBCModePageFlexibleDisk_SSN_Bit), + kSBCModePageFlexibleDisk_TRDY_Mask = (1 << kSBCModePageFlexibleDisk_TRDY_Bit) +}; + + +/*! +@enum SPC bitfields +@discussion +Bit field definitions and masks for Flexible Disk SPC field. +@constant kSBCModePageFlexibleDisk_SPC_Mask +Mask for use with SPC field. +*/ +enum +{ + kSBCModePageFlexibleDisk_SPC_Mask = 0x0F +}; + + +/*! +@enum PIN_34_PIN_2 bitfields +@discussion +Bit field definitions and masks for Flexible Disk PIN_34_PIN_2 field. +@constant kSBCModePageFlexibleDisk_PIN_2_Mask +Mask for use with PIN_34_PIN_2 field. +@constant kSBCModePageFlexibleDisk_PIN_34_Mask +Mask for use with PIN_34_PIN_2 field. +*/ +enum +{ + kSBCModePageFlexibleDisk_PIN_2_Mask = 0x0F, + kSBCModePageFlexibleDisk_PIN_34_Mask = 0xF0 +}; + + +/*! +@enum PIN_4_PIN_1 bitfields +@discussion +Bit field definitions and masks for Flexible Disk PIN_4_PIN_1 field. +@constant kSBCModePageFlexibleDisk_PIN_1_Mask +Mask for use with PIN_4_PIN_1 field. +@constant kSBCModePageFlexibleDisk_PIN_4_Mask +Mask for use with PIN_4_PIN_1 field. +*/ +enum +{ + kSBCModePageFlexibleDisk_PIN_1_Mask = 0x0F, + kSBCModePageFlexibleDisk_PIN_4_Mask = 0xF0 +}; + + +/*! +@struct SBCModePageCaching +@discussion +Caching Mode Page (PAGE CODE 0x08) format. +*/ +typedef struct SBCModePageCaching +{ + ModePageFormatHeader header; + UInt8 flags; + UInt8 DEMAND_READ_WRITE_RETENTION_PRIORITY; + UInt16 DISABLE_PREFETCH_TRANSFER_LENGTH; + UInt16 MINIMUM_PREFETCH; + UInt16 MAXIMUM_PREFETCH; + UInt16 MAXIMUM_PREFETCH_CEILING; + UInt8 flags2; + UInt8 NUMBER_OF_CACHE_SEGMENTS; + UInt16 CACHE_SEGMENT_SIZE; + UInt8 RESERVED; + UInt8 NON_CACHE_SEGMENT_SIZE[3]; +} SBCModePageCaching; + + +/*! +@enum Caching flags bitfields +@discussion +Bit field definitions and masks for Caching flags field. +@constant kSBCModePageCaching_RCD_Bit +RCD Bit definition. +@constant kSBCModePageCaching_MF_Bit +MF Bit definition. +@constant kSBCModePageCaching_WCE_Bit +WCE Bit definition. +@constant kSBCModePageCaching_SIZE_Bit +SIZE Bit definition. +@constant kSBCModePageCaching_DISC_Bit +DISC Bit definition. +@constant kSBCModePageCaching_CAP_Bit +CAP Bit definition. +@constant kSBCModePageCaching_ABPF_Bit +ABPF Bit definition. +@constant kSBCModePageCaching_IC_Bit +IC Bit definition. +@constant kSBCModePageCaching_RCD_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_MF_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_WCE_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_SIZE_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_DISC_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_CAP_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_ABPF_Mask +Mask for use with flags field. +@constant kSBCModePageCaching_IC_Mask +Mask for use with flags field. +*/ +enum +{ + kSBCModePageCaching_RCD_Bit = 0, + kSBCModePageCaching_MF_Bit = 1, + kSBCModePageCaching_WCE_Bit = 2, + kSBCModePageCaching_SIZE_Bit = 3, + kSBCModePageCaching_DISC_Bit = 4, + kSBCModePageCaching_CAP_Bit = 5, + kSBCModePageCaching_ABPF_Bit = 6, + kSBCModePageCaching_IC_Bit = 7, + + kSBCModePageCaching_RCD_Mask = (1 << kSBCModePageCaching_RCD_Bit), + kSBCModePageCaching_MF_Mask = (1 << kSBCModePageCaching_MF_Bit), + kSBCModePageCaching_WCE_Mask = (1 << kSBCModePageCaching_WCE_Bit), + kSBCModePageCaching_SIZE_Mask = (1 << kSBCModePageCaching_SIZE_Bit), + kSBCModePageCaching_DISC_Mask = (1 << kSBCModePageCaching_DISC_Bit), + kSBCModePageCaching_CAP_Mask = (1 << kSBCModePageCaching_CAP_Bit), + kSBCModePageCaching_ABPF_Mask = (1 << kSBCModePageCaching_ABPF_Bit), + kSBCModePageCaching_IC_Mask = (1 << kSBCModePageCaching_IC_Bit) +}; + + +/*! +@enum Demand Read/Write Retention masks +@discussion +Demand Read/Write Retention masks. +@constant kSBCModePageCaching_DEMAND_WRITE_Mask +Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. +@constant kSBCModePageCaching_DEMAND_READ_Mask +Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. +*/ +enum +{ + kSBCModePageCaching_DEMAND_WRITE_Mask = 0x00FF, + kSBCModePageCaching_DEMAND_READ_Mask = 0xFF00 +}; + +/*! +@enum Caching flags2 bitfields +@discussion +Bit field definitions and masks for Caching flags2 field. +@constant kSBCModePageCaching_VS1_Bit +VS1 Bit definition. +@constant kSBCModePageCaching_VS2_Bit +VS2 Bit definition. +@constant kSBCModePageCaching_DRA_Bit +DRA Bit definition. +@constant kSBCModePageCaching_LBCSS_Bit +LBCSS Bit definition. +@constant kSBCModePageCaching_FSW_Bit +FSW Bit definition. +@constant kSBCModePageCaching_VS1_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_VS2_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_DRA_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_LBCSS_Mask +Mask for use with flags2 field. +@constant kSBCModePageCaching_FSW_Mask +Mask for use with flags2 field. +*/ +enum +{ + // Bits 0:2 Reserved + kSBCModePageCaching_VS1_Bit = 3, + kSBCModePageCaching_VS2_Bit = 4, + kSBCModePageCaching_DRA_Bit = 5, + kSBCModePageCaching_LBCSS_Bit = 6, + kSBCModePageCaching_FSW_Bit = 7, + + kSBCModePageCaching_VS1_Mask = (1 << kSBCModePageCaching_VS1_Bit), + kSBCModePageCaching_VS2_Mask = (1 << kSBCModePageCaching_VS2_Bit), + kSBCModePageCaching_DRA_Mask = (1 << kSBCModePageCaching_DRA_Bit), + kSBCModePageCaching_LBCSS_Mask = (1 << kSBCModePageCaching_LBCSS_Bit), + kSBCModePageCaching_FSW_Mask = (1 << kSBCModePageCaching_FSW_Bit) +}; + +#pragma options align=reset + +#endif /* _IOKIT_SCSI_CMDS_MODE_DEFINITIONS_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h b/i386/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h new file mode 100644 index 0000000..59abde3 --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ +#define _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the READ CAPACITY 10 (0x25) and READ CAPACITY 16 (0x9E) commands. +*/ + +/*! +@enum READ CAPACITY Payload Sizes +@discussion +Sizes of the payload for the READ CAPACITY 10 and +READ CAPACITY 16 commands. +@constant kREPORT_CAPACITY_DataSize +Data size for a READ_CAPACITY command. +@constant kREPORT_CAPACITY_16_DataSize +Data size for a READ_CAPACITY_16 command. +*/ +enum +{ + kREPORT_CAPACITY_DataSize = 8, + kREPORT_CAPACITY_16_DataSize = 32 +}; + + +/*! +@constant kREPORT_CAPACITY_MaximumLBA +@discussion +Maximum LBA supported via READ CAPACITY 10 command. +*/ +#define kREPORT_CAPACITY_MaximumLBA 0xFFFFFFFFUL + + +/*! +@constant kREPORT_CAPACITY_16_MaximumLBA +@discussion +Maximum LBA supported via READ CAPACITY 16 command. +*/ +#define kREPORT_CAPACITY_16_MaximumLBA 0xFFFFFFFFFFFFFFFFULL + + +/*! +@struct SCSI_Capacity_Data +@discussion +Capacity return structure for READ CAPACITY 10 command. +*/ +typedef struct SCSI_Capacity_Data +{ + UInt32 RETURNED_LOGICAL_BLOCK_ADDRESS; + UInt32 BLOCK_LENGTH_IN_BYTES; +} SCSI_Capacity_Data; + + +/*! +@struct SCSI_Capacity_Data_Long +@discussion +Capacity return structure for READ CAPACITY 16 command. +*/ +typedef struct SCSI_Capacity_Data_Long +{ + UInt64 RETURNED_LOGICAL_BLOCK_ADDRESS; + UInt32 BLOCK_LENGTH_IN_BYTES; + UInt8 RTO_EN_PROT_EN; + UInt8 Reserved[19]; +} SCSI_Capacity_Data_Long; + + +/*! +@enum RTO_EN definitions +@discussion +Values for the REFERENCE TAG OWN (RTO_EN) bit in the +READ CAPACITY Long Data structure. +@constant kREAD_CAPACITY_RTO_Enabled +Reference Tag Own enabled. +@constant kREAD_CAPACITY_RTO_Disabled +Reference Tag Own disabled. +@constant kREAD_CAPACITY_RTO_Mask +Mask to use when checking the RTO_EN_PROT_EN field. +*/ +enum +{ + kREAD_CAPACITY_RTO_Enabled = 0x02, + kREAD_CAPACITY_RTO_Disabled = 0x00, + kREAD_CAPACITY_RTO_Mask = 0x02 +}; + + +/*! +@enum PROTECTION INFORMATION definitions +@discussion +Values for the PROTECTION INFORMATION (PROT_EN) bit in the +READ CAPACITY Long Data structure. +@constant kREAD_CAPACITY_PROT_Enabled +Protection Information enabled. +@constant kREAD_CAPACITY_PROT_Disabled +Protection Information disabled. +@constant kREAD_CAPACITY_PROT_Mask +Mask to use when checking the RTO_EN_PROT_EN field. +*/ + +enum +{ + kREAD_CAPACITY_PROT_Enabled = 0x01, + kREAD_CAPACITY_PROT_Disabled = 0x00, + kREAD_CAPACITY_PROT_Mask = 0x01 +}; + + +#endif /* _IOKIT_SCSI_CMDS_READ_CAPACITY_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h b/i386/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h new file mode 100644 index 0000000..6616e84 --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2004-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ +#define _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the REPORT_LUNS (0xA0) command. +*/ + + +/*! +@struct SCSICmd_REPORT_LUNS_LUN_ENTRY +@discussion +This structure represents a single LUN entry in a LUN list +returned via the REPORT_LUNS command. +*/ +typedef struct SCSICmd_REPORT_LUNS_LUN_ENTRY +{ + UInt16 FIRST_LEVEL_ADDRESSING; + UInt16 SECOND_LEVEL_ADDRESSING; + UInt16 THIRD_LEVEL_ADDRESSING; + UInt16 FOURTH_LEVEL_ADDRESSING; +} SCSICmd_REPORT_LUNS_LUN_ENTRY; + + +/*! +@constant kREPORT_LUNS_HeaderSize +@discussion +Size of the REPORT_LUNS header as defined in the SPC-3 specification. +*/ +#define kREPORT_LUNS_HeaderSize 8 + +/*! +@enum REPORT_LUNS addressing methods. +@discussion +REPORT_LUNS addressing methods described in +SAM-2 documents. +@constant kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE +Peripheral Device Addressing Method. +@constant kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC +Device Type Specific Addressing Method. +@constant kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT +Logical Unit Specific Addressing Method. +@constant kREPORT_LUNS_ADDRESS_METHOD_OFFSET +Offset to the address method data. +*/ +enum +{ + kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE = 0, + kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC = 1, + kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT = 2, + // Reserved [3] + kREPORT_LUNS_ADDRESS_METHOD_OFFSET = 14 +}; + + +/*! +@struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING +@discussion +This structure represents a LUN Addressing scheme. +*/ +typedef struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING +{ +#ifdef __LITTLE_ENDIAN__ + UInt16 LUN : 5; + UInt16 BUS_NUMBER : 3; + UInt16 TARGET : 6; + UInt16 reserved2 : 1; + UInt16 reserved : 1; +#else /* !__LITTLE_ENDIAN__ */ + UInt16 reserved : 1; + UInt16 reserved2 : 1; + UInt16 TARGET : 6; + UInt16 BUS_NUMBER : 3; + UInt16 LUN : 5; +#endif /* !__LITTLE_ENDIAN__ */ +} REPORT_LUNS_LOGICAL_UNIT_ADDRESSING; + + +/*! +@struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING +@discussion +This structure represents a Peripheral Device Addressing scheme. +*/ +typedef struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING +{ +#ifdef __LITTLE_ENDIAN__ + UInt16 TARGET_LUN : 8; + UInt16 BUS_IDENTIFIER : 6; + UInt16 reserved2 : 1; + UInt16 reserved : 1; +#else /* !__LITTLE_ENDIAN__ */ + UInt16 reserved : 1; + UInt16 reserved2 : 1; + UInt16 BUS_IDENTIFIER : 6; + UInt16 TARGET_LUN : 8; +#endif /* !__LITTLE_ENDIAN__ */ +} REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING; + + +/*! +@struct SCSICmd_REPORT_LUNS_Header +@discussion +This structure defines the format of the data that is returned for +the REPORT_LUNS command. +*/ +typedef struct SCSICmd_REPORT_LUNS_Header +{ + UInt32 LUN_LIST_LENGTH; // LUN list length in bytes. + UInt32 RESERVED; + SCSICmd_REPORT_LUNS_LUN_ENTRY LUN[1]; // Variable length list. Must have at least LUN 0 if +} SCSICmd_REPORT_LUNS_Header; // Target supports REPORT_LUNS command. + + +#endif /* _IOKIT_SCSI_CMDS_REPORT_LUNS_DEFINITIONS_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h b/i386/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h new file mode 100644 index 0000000..8cfabb0 --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h @@ -0,0 +1,234 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ +#define _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSI Request Sense Definitions + @discussion + This file contains all definitions for the data returned from + the REQUEST SENSE (0x03) command and from auto sense on protocols + that support it. +*/ + + +/*! +@enum kSenseDefaultSize +@discussion +The default size for SCSI Request Sense data. +*/ +enum +{ + kSenseDefaultSize = 18 +}; + + +/*! +@struct SCSI_Sense_Data +@discussion +The basic SCSI Request Sense data structure. +*/ +typedef struct SCSI_Sense_Data +{ + UInt8 VALID_RESPONSE_CODE; // 7 = Valid. 6-0 = Response Code. + UInt8 SEGMENT_NUMBER; // Segment number + UInt8 SENSE_KEY; // 7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY. + UInt8 INFORMATION_1; // INFORMATION. + UInt8 INFORMATION_2; // INFORMATION. + UInt8 INFORMATION_3; // INFORMATION. + UInt8 INFORMATION_4; // INFORMATION. + UInt8 ADDITIONAL_SENSE_LENGTH; // Number of additional bytes available in sense data + UInt8 COMMAND_SPECIFIC_INFORMATION_1; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_2; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_3; // Command Specific Information + UInt8 COMMAND_SPECIFIC_INFORMATION_4; // Command Specific Information + UInt8 ADDITIONAL_SENSE_CODE; // Additional Sense Code + UInt8 ADDITIONAL_SENSE_CODE_QUALIFIER; // Additional Sense Code Qualifier + UInt8 FIELD_REPLACEABLE_UNIT_CODE; // Field Replaceable Unit Code + UInt8 SKSV_SENSE_KEY_SPECIFIC_MSB; // 7 = Sense Key Specific Valid bit, 6-0 Sense Key Specific MSB + UInt8 SENSE_KEY_SPECIFIC_MID; // Sense Key Specific Middle + UInt8 SENSE_KEY_SPECIFIC_LSB; // Sense Key Specific LSB +} SCSI_Sense_Data; + + +/*! +@enum Sense Valid +@discussion +Masks to use to determine if sense data is valid or not. +@constant kSENSE_DATA_VALID +Sense data is valid. +@constant kSENSE_NOT_DATA_VALID +Sense data is not valid. +@constant kSENSE_DATA_VALID_Mask +Validity mask to use when checking the VALID_RESPONSE_CODE field. +*/ +enum +{ + kSENSE_DATA_VALID = 0x80, + kSENSE_NOT_DATA_VALID = 0x00, + kSENSE_DATA_VALID_Mask = 0x80 +}; + + +/*! +@enum Sense Response Codes +@discussion +Masks and values to determine the Response Code. +@constant kSENSE_RESPONSE_CODE_Current_Errors +Response code indicating current errors are reported. +@constant kSENSE_RESPONSE_CODE_Deferred_Errors +Response code indicating deferred errors are reported. +@constant kSENSE_RESPONSE_CODE_Mask +Mask to use when checking the VALID_RESPONSE_CODE field. +*/ +enum +{ + kSENSE_RESPONSE_CODE_Current_Errors = 0x70, + kSENSE_RESPONSE_CODE_Deferred_Errors = 0x71, + kSENSE_RESPONSE_CODE_Mask = 0x7F +}; + + +/*! +@enum FILEMARK bit field definitions +@discussion +Masks and values to determine the FileMark bit field. +@constant kSENSE_FILEMARK_Set +Filemark bit is set. +@constant kSENSE_FILEMARK_Not_Set +Filemark bit is not set. +@constant kSENSE_FILEMARK_Mask +Mask to use when checking the SENSE_KEY field for the FILEMARK bit. +*/ +enum +{ + kSENSE_FILEMARK_Set = 0x80, + kSENSE_FILEMARK_Not_Set = 0x00, + kSENSE_FILEMARK_Mask = 0x80 +}; + + +/*! +@enum EOM bit field definitions +@discussion +Masks and values to determine the End Of Medium bit field. +@constant kSENSE_EOM_Set +End Of Medium bit is set. +@constant kSENSE_EOM_Not_Set +End Of Medium bit is not set. +@constant kSENSE_EOM_Mask +Mask to use when checking the SENSE_KEY field for the EOM bit. +*/ +enum +{ + kSENSE_EOM_Set = 0x40, + kSENSE_EOM_Not_Set = 0x00, + kSENSE_EOM_Mask = 0x40 +}; + + +/*! +@enum ILI bit field definitions +@discussion +Masks and values to determine the Incorrect Length Indicator bit field. +@constant kSENSE_ILI_Set +Incorrect Length Indicator bit is set. +@constant kSENSE_ILI_Not_Set +Incorrect Length Indicator bit is not set. +@constant kSENSE_ILI_Mask +Mask to use when checking the SENSE_KEY field for the ILI bit. +*/ +enum +{ + kSENSE_ILI_Set = 0x20, + kSENSE_ILI_Not_Set = 0x00, + kSENSE_ILI_Mask = 0x20 +}; + + +/*! +@enum Sense Key definitions +@discussion +Masks and values to determine the SENSE_KEY. +@constant kSENSE_KEY_NO_SENSE +No sense data is present. +@constant kSENSE_KEY_RECOVERED_ERROR +A recovered error has occurred. +@constant kSENSE_KEY_NOT_READY +Device server is not ready. +@constant kSENSE_KEY_MEDIUM_ERROR +Device server detected a medium error. +@constant kSENSE_KEY_HARDWARE_ERROR +Device server detected a hardware error. +@constant kSENSE_KEY_ILLEGAL_REQUEST +Device server detected an illegal request. +@constant kSENSE_KEY_UNIT_ATTENTION +Device server indicates a unit attention condition. +@constant kSENSE_KEY_DATA_PROTECT +Device server indicates a data protect condition. +@constant kSENSE_KEY_BLANK_CHECK +Device server indicates a blank check condition. +@constant kSENSE_KEY_VENDOR_SPECIFIC +Device server indicates a vendor specific condition. +@constant kSENSE_KEY_COPY_ABORTED +Device server indicates a copy aborted condition. +@constant kSENSE_KEY_ABORTED_COMMAND +Device server indicates an aborted command condition. +@constant kSENSE_KEY_VOLUME_OVERFLOW +Device server indicates a volume overflow condition. +@constant kSENSE_KEY_MISCOMPARE +Device server indicates a miscompare condition. +@constant kSENSE_KEY_Mask +Mask to use when checking the SENSE_KEY field for the SENSE_KEY value. +*/ +enum +{ + kSENSE_KEY_NO_SENSE = 0x00, + kSENSE_KEY_RECOVERED_ERROR = 0x01, + kSENSE_KEY_NOT_READY = 0x02, + kSENSE_KEY_MEDIUM_ERROR = 0x03, + kSENSE_KEY_HARDWARE_ERROR = 0x04, + kSENSE_KEY_ILLEGAL_REQUEST = 0x05, + kSENSE_KEY_UNIT_ATTENTION = 0x06, + kSENSE_KEY_DATA_PROTECT = 0x07, + kSENSE_KEY_BLANK_CHECK = 0x08, + kSENSE_KEY_VENDOR_SPECIFIC = 0x09, + kSENSE_KEY_COPY_ABORTED = 0x0A, + kSENSE_KEY_ABORTED_COMMAND = 0x0B, + /* SENSE KEY 0x0C is obsoleted */ + kSENSE_KEY_VOLUME_OVERFLOW = 0x0D, + kSENSE_KEY_MISCOMPARE = 0x0E, + /* SENSE KEY 0x0F is reserved */ + kSENSE_KEY_Mask = 0x0F +}; + + +#endif /* _IOKIT_SCSI_CMDS_REQUEST_SENSE_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICommandDefinitions.h b/i386/include/IOKit/scsi/SCSICommandDefinitions.h new file mode 100644 index 0000000..d33aed6 --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICommandDefinitions.h @@ -0,0 +1,479 @@ +/* + * Copyright (c) 2001-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ +#define _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSICommandDefinitions + @discussion + This file contains all the definitions for types and constants that are + used by the command set classes for building CDBs. The field type + definitions are used for the parameters passed to a method that builds and + sends any SCSI defined command to clearly identify the type of value + expected for a parameter. + + The command methods will then use the appropriate mask to verify that the + value passed into a parameter is of the specified type. + + Currently only types and masks are defined for 8 bytes and smaller fields. + If a command is defined that uses a larger field, these should be expanded + to include those sizes. +*/ + +#pragma mark Field Type Definitions +/* These are the type definitions used for the parameters of methods that + * build and send Command Descriptor Blocks. + */ + +/* 1 Byte or smaller fields. */ + +/*! @typedef SCSICmdField1Bit */ +typedef UInt8 SCSICmdField1Bit; + +/*! @typedef SCSICmdField2Bit */ +typedef UInt8 SCSICmdField2Bit; + +/*! @typedef SCSICmdField3Bit */ +typedef UInt8 SCSICmdField3Bit; + +/*! @typedef SCSICmdField4Bit */ +typedef UInt8 SCSICmdField4Bit; + +/*! @typedef SCSICmdField5Bit */ +typedef UInt8 SCSICmdField5Bit; + +/*! @typedef SCSICmdField6Bit */ +typedef UInt8 SCSICmdField6Bit; + +/*! @typedef SCSICmdField7Bit */ +typedef UInt8 SCSICmdField7Bit; + +/*! @typedef SCSICmdField1Byte */ +typedef UInt8 SCSICmdField1Byte; + +/* 2 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField9Bit */ +typedef UInt16 SCSICmdField9Bit; + +/*! @typedef SCSICmdField10Bit */ +typedef UInt16 SCSICmdField10Bit; + +/*! @typedef SCSICmdField11Bit */ +typedef UInt16 SCSICmdField11Bit; + +/*! @typedef SCSICmdField12Bit */ +typedef UInt16 SCSICmdField12Bit; + +/*! @typedef SCSICmdField13Bit */ +typedef UInt16 SCSICmdField13Bit; + +/*! @typedef SCSICmdField14Bit */ +typedef UInt16 SCSICmdField14Bit; + +/*! @typedef SCSICmdField15Bit */ +typedef UInt16 SCSICmdField15Bit; + +/*! @typedef SCSICmdField2Byte */ +typedef UInt16 SCSICmdField2Byte; + +/* 3 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField17Bit */ +typedef UInt32 SCSICmdField17Bit; + +/*! @typedef SCSICmdField18Bit */ +typedef UInt32 SCSICmdField18Bit; + +/*! @typedef SCSICmdField19Bit */ +typedef UInt32 SCSICmdField19Bit; + +/*! @typedef SCSICmdField20Bit */ +typedef UInt32 SCSICmdField20Bit; + +/*! @typedef SCSICmdField21Bit */ +typedef UInt32 SCSICmdField21Bit; + +/*! @typedef SCSICmdField22Bit */ +typedef UInt32 SCSICmdField22Bit; + +/*! @typedef SCSICmdField23Bit */ +typedef UInt32 SCSICmdField23Bit; + +/*! @typedef SCSICmdField3Byte */ +typedef UInt32 SCSICmdField3Byte; + +/* 4 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField25Bit */ +typedef UInt32 SCSICmdField25Bit; + +/*! @typedef SCSICmdField26Bit */ +typedef UInt32 SCSICmdField26Bit; + +/*! @typedef SCSICmdField27Bit */ +typedef UInt32 SCSICmdField27Bit; + +/*! @typedef SCSICmdField28Bit */ +typedef UInt32 SCSICmdField28Bit; + +/*! @typedef SCSICmdField29Bit */ +typedef UInt32 SCSICmdField29Bit; + +/*! @typedef SCSICmdField30Bit */ +typedef UInt32 SCSICmdField30Bit; + +/*! @typedef SCSICmdField31Bit */ +typedef UInt32 SCSICmdField31Bit; + +/*! @typedef SCSICmdField4Byte */ +typedef UInt32 SCSICmdField4Byte; + +/* 5 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField33Bit */ +typedef UInt64 SCSICmdField33Bit; + +/*! @typedef SCSICmdField34Bit */ +typedef UInt64 SCSICmdField34Bit; + +/*! @typedef SCSICmdField35Bit */ +typedef UInt64 SCSICmdField35Bit; + +/*! @typedef SCSICmdField36Bit */ +typedef UInt64 SCSICmdField36Bit; + +/*! @typedef SCSICmdField37Bit */ +typedef UInt64 SCSICmdField37Bit; + +/*! @typedef SCSICmdField38Bit */ +typedef UInt64 SCSICmdField38Bit; + +/*! @typedef SCSICmdField39Bit */ +typedef UInt64 SCSICmdField39Bit; + +/*! @typedef SCSICmdField5Byte */ +typedef UInt64 SCSICmdField5Byte; + +/* 6 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField41Bit */ +typedef UInt64 SCSICmdField41Bit; + +/*! @typedef SCSICmdField42Bit */ +typedef UInt64 SCSICmdField42Bit; + +/*! @typedef SCSICmdField43Bit */ +typedef UInt64 SCSICmdField43Bit; + +/*! @typedef SCSICmdField44Bit */ +typedef UInt64 SCSICmdField44Bit; + +/*! @typedef SCSICmdField45Bit */ +typedef UInt64 SCSICmdField45Bit; + +/*! @typedef SCSICmdField46Bit */ +typedef UInt64 SCSICmdField46Bit; + +/*! @typedef SCSICmdField47Bit */ +typedef UInt64 SCSICmdField47Bit; + +/*! @typedef SCSICmdField6Byte */ +typedef UInt64 SCSICmdField6Byte; + +/* 7 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField49Bit */ +typedef UInt64 SCSICmdField49Bit; + +/*! @typedef SCSICmdField50Bit */ +typedef UInt64 SCSICmdField50Bit; + +/*! @typedef SCSICmdField51Bit */ +typedef UInt64 SCSICmdField51Bit; + +/*! @typedef SCSICmdField52Bit */ +typedef UInt64 SCSICmdField52Bit; + +/*! @typedef SCSICmdField53Bit */ +typedef UInt64 SCSICmdField53Bit; + +/*! @typedef SCSICmdField54Bit */ +typedef UInt64 SCSICmdField54Bit; + +/*! @typedef SCSICmdField55Bit */ +typedef UInt64 SCSICmdField55Bit; + +/*! @typedef SCSICmdField7Byte */ +typedef UInt64 SCSICmdField7Byte; + +/* 8 Bytes or smaller fields. */ + +/*! @typedef SCSICmdField57Bit */ +typedef UInt64 SCSICmdField57Bit; + +/*! @typedef SCSICmdField58Bit */ +typedef UInt64 SCSICmdField58Bit; + +/*! @typedef SCSICmdField59Bit */ +typedef UInt64 SCSICmdField59Bit; + +/*! @typedef SCSICmdField60Bit */ +typedef UInt64 SCSICmdField60Bit; + +/*! @typedef SCSICmdField61Bit */ +typedef UInt64 SCSICmdField61Bit; + +/*! @typedef SCSICmdField62Bit */ +typedef UInt64 SCSICmdField62Bit; + +/*! @typedef SCSICmdField63Bit */ +typedef UInt64 SCSICmdField63Bit; + +/*! @typedef SCSICmdField8Byte */ +typedef UInt64 SCSICmdField8Byte; + + +#pragma mark Field Mask Definitions +/* These are masks that are used to verify that the values passed into the + * parameters for the fields are not larger than the field size. + * + * NB: These have changed from enums to #define since enums greater than + * 32 bits in size are not well-defined in C99. + */ + +/* 1 Byte or smaller fields. */ + +/*! @constant kSCSICmdFieldMask1Bit */ +#define kSCSICmdFieldMask1Bit 0x01 + +/*! @constant kSCSICmdFieldMask2Bit */ +#define kSCSICmdFieldMask2Bit 0x03 + +/*! @constant kSCSICmdFieldMask3Bit */ +#define kSCSICmdFieldMask3Bit 0x07 + +/*! @constant kSCSICmdFieldMask4Bit */ +#define kSCSICmdFieldMask4Bit 0x0F + +/*! @constant kSCSICmdFieldMask5Bit */ +#define kSCSICmdFieldMask5Bit 0x1F + +/*! @constant kSCSICmdFieldMask6Bit */ +#define kSCSICmdFieldMask6Bit 0x3F + +/*! @constant kSCSICmdFieldMask7Bit */ +#define kSCSICmdFieldMask7Bit 0x7F + +#define kSCSICmdFieldMask1Byte 0xFF + +/* 2 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask9Bit */ +#define kSCSICmdFieldMask9Bit 0x01FF + +/*! @constant kSCSICmdFieldMask10Bit */ +#define kSCSICmdFieldMask10Bit 0x03FF + +/*! @constant kSCSICmdFieldMask11Bit */ +#define kSCSICmdFieldMask11Bit 0x07FF + +/*! @constant kSCSICmdFieldMask12Bit */ +#define kSCSICmdFieldMask12Bit 0x0FFF + +/*! @constant kSCSICmdFieldMask13Bit */ +#define kSCSICmdFieldMask13Bit 0x1FFF + +/*! @constant kSCSICmdFieldMask14Bit */ +#define kSCSICmdFieldMask14Bit 0x3FFF + +/*! @constant kSCSICmdFieldMask15Bit */ +#define kSCSICmdFieldMask15Bit 0x7FFF + +/*! @constant kSCSICmdFieldMask2Byte */ +#define kSCSICmdFieldMask2Byte 0xFFFF + +/* 3 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask17Bit */ +#define kSCSICmdFieldMask17Bit 0x01FFFF + +/*! @constant kSCSICmdFieldMask18Bit */ +#define kSCSICmdFieldMask18Bit 0x03FFFF + +/*! @constant kSCSICmdFieldMask19Bit */ +#define kSCSICmdFieldMask19Bit 0x07FFFF + +/*! @constant kSCSICmdFieldMask20Bit */ +#define kSCSICmdFieldMask20Bit 0x0FFFFF + +/*! @constant kSCSICmdFieldMask21Bit */ +#define kSCSICmdFieldMask21Bit 0x1FFFFF + +/*! @constant kSCSICmdFieldMask22Bit */ +#define kSCSICmdFieldMask22Bit 0x3FFFFF + +/*! @constant kSCSICmdFieldMask23Bit */ +#define kSCSICmdFieldMask23Bit 0x7FFFFF + +/*! @constant kSCSICmdFieldMask3Byte */ +#define kSCSICmdFieldMask3Byte 0xFFFFFF + +/* 4 Bytes or smaller fields. */ +/*! @constant kSCSICmdFieldMask25Bit */ +#define kSCSICmdFieldMask25Bit 0x01FFFFFFUL + +/*! @constant kSCSICmdFieldMask26Bit */ +#define kSCSICmdFieldMask26Bit 0x03FFFFFFUL + +/*! @constant kSCSICmdFieldMask27Bit */ +#define kSCSICmdFieldMask27Bit 0x07FFFFFFUL + +/*! @constant kSCSICmdFieldMask28Bit */ +#define kSCSICmdFieldMask28Bit 0x0FFFFFFFUL + +/*! @constant kSCSICmdFieldMask29Bit */ +#define kSCSICmdFieldMask29Bit 0x1FFFFFFFUL + +/*! @constant kSCSICmdFieldMask30Bit */ +#define kSCSICmdFieldMask30Bit 0x3FFFFFFFUL + +/*! @constant kSCSICmdFieldMask31Bit */ +#define kSCSICmdFieldMask31Bit 0x7FFFFFFFUL + +/*! @constant kSCSICmdFieldMask4Byte */ +#define kSCSICmdFieldMask4Byte 0xFFFFFFFFUL + +/* 5 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask33Bit */ +#define kSCSICmdFieldMask33Bit 0x01FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask34Bit */ +#define kSCSICmdFieldMask34Bit 0x03FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask35Bit */ +#define kSCSICmdFieldMask35Bit 0x07FFFFFFFFULL + +/*! @constant kSCSICmdFieldMask36Bit */ +#define kSCSICmdFieldMask36Bit 0x0FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask37Bit */ +#define kSCSICmdFieldMask37Bit 0x1FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask38Bit */ +#define kSCSICmdFieldMask38Bit 0x3FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask39Bit */ +#define kSCSICmdFieldMask39Bit 0x7FFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask5Byte */ +#define kSCSICmdFieldMask5Byte 0xFFFFFFFFFFULL + +/* 6 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask41Bit */ +#define kSCSICmdFieldMask41Bit 0x01FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask42Bit */ +#define kSCSICmdFieldMask42Bit 0x03FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask43Bit */ +#define kSCSICmdFieldMask43Bit 0x07FFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask44Bit */ +#define kSCSICmdFieldMask44Bit 0x0FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask45Bit */ +#define kSCSICmdFieldMask45Bit 0x1FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask46Bit */ +#define kSCSICmdFieldMask46Bit 0x3FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask47Bit */ +#define kSCSICmdFieldMask47Bit 0x7FFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask6Byte */ +#define kSCSICmdFieldMask6Byte 0xFFFFFFFFFFFFULL + +/* 7 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask49Bit */ +#define kSCSICmdFieldMask49Bit 0x01FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask50Bit */ +#define kSCSICmdFieldMask50Bit 0x03FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask51Bit */ +#define kSCSICmdFieldMask51Bit 0x07FFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask52Bit */ +#define kSCSICmdFieldMask52Bit 0x0FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask53Bit */ +#define kSCSICmdFieldMask53Bit 0x1FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask54Bit */ +#define kSCSICmdFieldMask54Bit 0x3FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask55Bit */ +#define kSCSICmdFieldMask55Bit 0x7FFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask7Byte */ +#define kSCSICmdFieldMask7Byte 0xFFFFFFFFFFFFFFULL + +/* 8 Bytes or smaller fields. */ + +/*! @constant kSCSICmdFieldMask57Bit */ +#define kSCSICmdFieldMask57Bit 0x01FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask58Bit */ +#define kSCSICmdFieldMask58Bit 0x03FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask59Bit */ +#define kSCSICmdFieldMask59Bit 0x07FFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask60Bit */ +#define kSCSICmdFieldMask60Bit 0x0FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask61Bit */ +#define kSCSICmdFieldMask61Bit 0x1FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask62Bit */ +#define kSCSICmdFieldMask62Bit 0x3FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask63Bit */ +#define kSCSICmdFieldMask63Bit 0x7FFFFFFFFFFFFFFFULL + +/*! @constant kSCSICmdFieldMask8Byte */ +#define kSCSICmdFieldMask8Byte 0xFFFFFFFFFFFFFFFFULL + +#endif /* _IOKIT_SCSI_COMMAND_DEFINITIONS_H_ */ diff --git a/i386/include/IOKit/scsi/SCSICommandOperationCodes.h b/i386/include/IOKit/scsi/SCSICommandOperationCodes.h new file mode 100644 index 0000000..21d9d1e --- /dev/null +++ b/i386/include/IOKit/scsi/SCSICommandOperationCodes.h @@ -0,0 +1,941 @@ +/* + * Copyright (c) 2001-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SCSI_COMMAND_OPERATION_CODES_H_ +#define _SCSI_COMMAND_OPERATION_CODES_H_ + +#pragma mark About this file +/* This file contains the operation code definitions for all commands defined + * by the SCSI specifications. The commands are listed in three formats: + * 1) All commands are listed in alphabetical order. This list is the live + * enumeration for all of the command constants. + * 2) The commands are listed in ascending numerical order. + * 3) The commands are grouped by Peripheral Device Type. + * + * In the command listings by Peripheral Device Type, there will be a comment + * following each command. This comment indentifies the section of the related + * specification where the commands is defined and the requirement type of the + * command, Mandatory or Optional. + * If a specification redefines an optional command from SPC as mandatory, + * the command will be relisted in the Peripheral Device Type command list with + * the mandatory tag next to it. + * All commands that are listed in SPC as Device Type Specifc will be relisted + * as a comment in all specifications lists that support that command with the + * appropriate Mandatory or Optional tag for that specification. + * + * The section number and the requirement type of the command are based on the + * version of the specification listed in the header comment for the Peripheral + * Device Type. This data is provided for informational purposes only. The + * specification document and version that the device adheres to as indicated + * by the data returned in response to the INQUIRY command should be used as + * the authorative source for supported and required behavior of the device. + * + * The SPC set is listed before all other Peripheral Device Type commands as + * this is the base document from which all of the other documents are derived. + * + * The Peripheral Device Types and associated command sets as defined by SPC-2, + * section 7.4.1 are as follows: + * Peripheral Device Type Associated Command Specification + * ------------------------------------ ----------------------------------- + * 0x00 Direct Access Device SBC - SCSI-3 Block Commands + * 0x01 Sequential Access Device SSC - SCSI-3 Stream Commands + * 0x02 Printer Device SSC - SCSI-3 Stream Commands + * 0x03 Processor Device SPC - SCSI Primary Commands-2 + * 0x04 Write Once Device SBC - SCSI-3 Block Commands + * 0x05 CD-ROM Device MMC - SCSI Multimedia Commands-2 + * 0x06 Scanner Device SGC - SCSI-3 Graphics Commands + * 0x07 Optical Memory Device SBC - SCSI-3 Block Commands + * 0x08 Medium Changer Device SMC - SCSI-3 Medium Changer Cmds + * 0x09 Communications Device SSC - SCSI-3 Stream Commands + * 0x0A - 0x0B Graphic Arts Prepress Dev ASC IT8 + * 0x0C Storage Array Controller Device SCC-2 - SCSI Controller Commands-2 + * 0x0D Enclosure Services SES - SCSI-3 Enclosure Services + * 0x0E Simplified Direct Access Device RBC - SCSI Reduced Block Commands + * 0x0F Optical Card Reader/Writer Device OCRW - SCSI Specification for + * Optical Card Reader/Writer + * 0x10 Reserved No command specification + * 0x11 Object-Based Storage Device OSD - SCSI Object Based Storage + * Device Commands + * 0x12 - 0x14 Reserved No command specification + * 0x15 Multimedia Media Access Engine RMC - Reduced Multimedia Commands + * 0x16 - 0x1E Reserved No command specification + * 0x1F Unknown or No Device No command specification + */ + +#pragma mark - +#pragma mark Command Definitions by Name +/* All SCSI Commands listed in alphabetical order. These are the live + * definitions of the commands. All other command lists are informative. + */ +enum +{ + kSCSICmd_ACCESS_CONTROL_IN = 0x86, + kSCSICmd_ACCESS_CONTROL_OUT = 0x87, + kSCSICmd_BLANK = 0xA1, + kSCSICmd_CHANGE_DEFINITION = 0x40, + kSCSICmd_CLOSE_TRACK_SESSION = 0x5B, + kSCSICmd_COMPARE = 0x39, + kSCSICmd_COPY = 0x18, + kSCSICmd_COPY_AND_VERIFY = 0x3A, + kSCSICmd_ERASE_10 = 0x2C, + kSCSICmd_ERASE_12 = 0xAC, + kSCSICmd_EXTENDED_COPY = 0x83, + kSCSICmd_FORMAT_UNIT = 0x04, + kSCSICmd_GET_CONFIGURATION = 0x46, + kSCSICmd_GET_EVENT_STATUS_NOTIFICATION = 0x4A, + kSCSICmd_GET_PERFORMANCE = 0xAC, + kSCSICmd_INQUIRY = 0x12, + kSCSICmd_LOAD_UNLOAD_MEDIUM = 0xA6, + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, + kSCSICmd_LOCK_UNLOCK_CACHE_16 = 0x92, + kSCSICmd_LOG_SELECT = 0x4C, + kSCSICmd_LOG_SENSE = 0x4D, + kSCSICmd_MAINTENANCE_IN = 0xA3, + kSCSICmd_MAINTENANCE_OUT = 0xA4, + kSCSICmd_MECHANISM_STATUS = 0xBD, + kSCSICmd_MEDIUM_SCAN = 0x38, + kSCSICmd_MODE_SELECT_6 = 0x15, + kSCSICmd_MODE_SELECT_10 = 0x55, + kSCSICmd_MODE_SENSE_6 = 0x1A, + kSCSICmd_MODE_SENSE_10 = 0x5A, + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, + kSCSICmd_PAUSE_RESUME = 0x4B, + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, + kSCSICmd_PLAY_AUDIO_10 = 0x45, + kSCSICmd_PLAY_AUDIO_12 = 0xA5, + kSCSICmd_PLAY_AUDIO_MSF = 0x47, + kSCSICmd_PLAY_AUDIO_TRACK_INDEX = 0x48, + kSCSICmd_PLAY_CD = 0xBC, + kSCSICmd_PLAY_RELATIVE_10 = 0x49, + kSCSICmd_PLAY_RELATIVE_12 = 0xA9, + kSCSICmd_PREFETCH = 0x34, + kSCSICmd_PREFETCH_16 = 0x90, + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, + kSCSICmd_READ_6 = 0x08, + kSCSICmd_READ_10 = 0x28, + kSCSICmd_READ_12 = 0xA8, + kSCSICmd_READ_16 = 0x88, + kSCSICmd_READ_ATTRIBUTE = 0x8C, + kSCSICmd_READ_BUFFER = 0x3C, + kSCSICmd_READ_BUFFER_CAPACITY = 0x5C, + kSCSICmd_READ_CAPACITY = 0x25, + kSCSICmd_READ_CD = 0xBE, + kSCSICmd_READ_CD_MSF = 0xB9, + kSCSICmd_READ_DEFECT_DATA_10 = 0x37, + kSCSICmd_READ_DEFECT_DATA_12 = 0xB7, + kSCSICmd_READ_DISC_INFORMATION = 0x51, + kSCSICmd_READ_DVD_STRUCTURE = 0xAD, + kSCSICmd_READ_DISC_STRUCTURE = 0xAD, + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, + kSCSICmd_READ_FORMAT_CAPACITIES = 0x23, + kSCSICmd_READ_GENERATION = 0x29, + kSCSICmd_READ_HEADER = 0x44, + kSCSICmd_READ_LONG = 0x3E, + kSCSICmd_READ_MASTER_CUE = 0x59, + kSCSICmd_READ_SUB_CHANNEL = 0x42, + kSCSICmd_READ_TOC_PMA_ATIP = 0x43, + kSCSICmd_READ_TRACK_INFORMATION = 0x52, + kSCSICmd_READ_UPDATED_BLOCK_10 = 0x2D, + kSCSICmd_REASSIGN_BLOCKS = 0x07, + kSCSICmd_REBUILD = 0x81, + kSCSICmd_RECEIVE = 0x08, + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, + kSCSICmd_REDUNDANCY_GROUP_IN = 0xBA, + kSCSICmd_REDUNDANCY_GROUP_OUT = 0xBB, + kSCSICmd_REGENERATE = 0x82, + kSCSICmd_RELEASE_6 = 0x17, + kSCSICmd_RELEASE_10 = 0x57, + kSCSICmd_REPAIR_TRACK = 0x58, + kSCSICmd_REPORT_DEVICE_IDENTIFIER = 0xA3, + kSCSICmd_REPORT_KEY = 0xA4, + kSCSICmd_REPORT_LUNS = 0xA0, + kSCSICmd_REQUEST_SENSE = 0x03, + kSCSICmd_RESERVE_6 = 0x16, + kSCSICmd_RESERVE_10 = 0x56, + kSCSICmd_RESERVE_TRACK = 0x53, + kSCSICmd_REZERO_UNIT = 0x01, + kSCSICmd_SCAN_MMC = 0xBA, + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, + kSCSICmd_SEEK_6 = 0x0B, + kSCSICmd_SEEK_10 = 0x2B, + kSCSICmd_SEND = 0x0A, + kSCSICmd_SEND_CUE_SHEET = 0x5D, + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, + kSCSICmd_SEND_DVD_STRUCTURE = 0xBF, + kSCSICmd_SEND_EVENT = 0xA2, + kSCSICmd_SEND_KEY = 0xA3, + kSCSICmd_SEND_OPC_INFORMATION = 0x54, + kSCSICmd_SERVICE_ACTION_IN = 0x9E, + kSCSICmd_SERVICE_ACTION_OUT = 0x9F, + kSCSICmd_SET_CD_SPEED = 0xBB, + kSCSICmd_SET_DEVICE_IDENTIFIER = 0xA4, + kSCSICmd_SET_LIMITS_10 = 0x33, + kSCSICmd_SET_LIMITS_12 = 0xB3, + kSCSICmd_SET_READ_AHEAD = 0xA7, + kSCSICmd_SET_STREAMING = 0xB6, + kSCSICmd_SPARE_IN = 0xBC, + kSCSICmd_SPARE_OUT = 0xBD, + kSCSICmd_START_STOP_UNIT = 0x1B, + kSCSICmd_STOP_PLAY_SCAN = 0x4E, + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, + kSCSICmd_SYNCHRONIZE_CACHE_16 = 0x91, + kSCSICmd_TEST_UNIT_READY = 0x00, + kSCSICmd_UPDATE_BLOCK = 0x3D, + kSCSICmd_VERIFY_10 = 0x2F, + kSCSICmd_VERIFY_12 = 0xAF, + kSCSICmd_VERIFY_16 = 0x8F, + kSCSICmd_VOLUME_SET_IN = 0xBE, + kSCSICmd_VOLUME_SET_OUT = 0xBF, + kSCSICmd_WRITE_6 = 0x0A, + kSCSICmd_WRITE_10 = 0x2A, + kSCSICmd_WRITE_12 = 0xAA, + kSCSICmd_WRITE_16 = 0x8A, + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, + kSCSICmd_WRITE_AND_VERIFY_16 = 0x8E, + kSCSICmd_WRITE_ATTRIBUTE = 0x8D, + kSCSICmd_WRITE_BUFFER = 0x3B, + kSCSICmd_WRITE_LONG = 0x3F, + kSCSICmd_WRITE_SAME = 0x41, + kSCSICmd_WRITE_SAME_16 = 0x93, + kSCSICmd_XDREAD = 0x52, + kSCSICmd_XDWRITE = 0x50, + kSCSICmd_XDWRITE_EXTENDED = 0x80, + kSCSICmd_XDWRITEREAD_10 = 0x53, + kSCSICmd_XPWRITE = 0x51, + + kSCSICmdVariableLengthCDB = 0x7F +}; + +/* Service Action Definitions for the Variable Length CDB (7Fh) command */ +enum +{ + kSCSIServiceAction_READ_32 = 0x0009, + kSCSIServiceAction_VERIFY_32 = 0x000A, + kSCSIServiceAction_WRITE_32 = 0x000B, + kSCSIServiceAction_WRITE_AND_VERIFY_32 = 0x000C, + kSCSIServiceAction_WRITE_SAME_32 = 0x000D, + kSCSIServiceAction_XDREAD_32 = 0x0003, + kSCSIServiceAction_XDWRITE_32 = 0x0004, + kSCSIServiceAction_XDWRITEREAD_32 = 0x0007, + kSCSIServiceAction_XPWRITE_32 = 0x0006 +}; + +/* Service Action Definitions for the MAINTENANCE IN (A3h) command */ +enum +{ + kSCSIServiceAction_REPORT_ALIASES = 0x0B, + kSCSIServiceAction_REPORT_DEVICE_IDENTIFIER = 0x05, + kSCSIServiceAction_REPORT_PRIORITY = 0x0E, + kSCSIServiceAction_REPORT_SUPPORTED_OPERATION_CODES = 0x0C, + kSCSIServiceAction_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS = 0x0D, + kSCSIServiceAction_REPORT_TARGET_PORT_GROUPS = 0x0A +}; + +/* Service Action Definitions for the MAINTENANCE OUT (A4h) command */ +enum +{ + kSCSIServiceAction_CHANGE_ALIASES = 0x0B, + kSCSIServiceAction_SET_DEVICE_IDENTIFIER = 0x06, + kSCSIServiceAction_SET_PRIORITY = 0x0E, + kSCSIServiceAction_SET_TARGET_PORT_GROUPS = 0x0A +}; + +/* Service Action Definitions for the SERVICE ACTION IN (9Eh) command */ +enum +{ + kSCSIServiceAction_READ_CAPACITY_16 = 0x10, + kSCSIServiceAction_READ_LONG_16 = 0x11 +}; + +/* Service Action Definitions for the SERVICE ACTION OUT (9Fh) command */ +enum +{ + kSCSIServiceAction_WRITE_LONG_16 = 0x11 +}; + +#pragma mark - +#pragma mark Command Definitions by Number +#if 0 +enum +{ +}; +#endif + + +#pragma mark - +#pragma mark All Types SPC Commands +/* Commands defined by the T10:1236-D SCSI Primary Commands-2 (SPC-2) + * command specification. The definitions and section numbers are based on + * section 7 of the revision 18, 21 May 2000 version of the specification. + * + * These commands are defined for all devices. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* Sec. 7.2: Optional */ + kSCSICmd_COPY = 0x18, /* Sec. 7.3: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* Sec. 7.4: Optional */ + kSCSICmd_EXTENDED_COPY = 0x83, /* Sec. 7.5: Optional */ + kSCSICmd_INQUIRY = 0x12, /* Sec. 7.6: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* Sec. 7.7: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* Sec. 7.8: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Sec. 7.9: Device Type + * Specific */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Sec. 7.10: Device Type + * Specific */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Sec. 7.11: Device Type + * Specific */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Sec. 7.12: Device Type + * Specific */ + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* Defined in SMC */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Sec. 7.13: Device Type + * Specific */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Sec. 7.14: Device Type + * Specific */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* Sec. 7.15: Device Type + * Specific */ + kSCSICmd_READ_BUFFER = 0x3C, /* Sec. 7.16: Optional */ + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* Defined in SMC */ + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, /* Sec. 7.17: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Sec. 7.18: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Sec. 7.19: Device Type + * Specific */ + kSCSICmd_RELEASE_6 = 0x17, /* Sec. 7.20: Device Type + * Specific */ + kSCSICmd_REPORT_DEVICE_IDENTIFIER = 0xA3, /* Sec. 7.21: Optional */ + kSCSICmd_REPORT_LUNS = 0xA0, /* Sec. 7.22: Mandatory for + * LUN Supporting devices*/ + kSCSICmd_REQUEST_SENSE = 0x03, /* Sec. 7.23: Device Type + * Specific */ + kSCSICmd_RESERVE_10 = 0x56, /* Sec. 7.24: Device Type + * Specific */ + kSCSICmd_RESERVE_6 = 0x16, /* Sec. 7.25: Device Type + * Specific */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Sec. 7.26: Optional */ + kSCSICmd_SET_DEVICE_IDENTIFIER = 0xA4, /* Sec. 7.27: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* Sec. 7.28: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Sec. 7.29: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x00 SBC Direct Access Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) command + * specification. The definitions and section numbers are based on section 6.1 + * of the revision 8c, 13 November 1997 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional*/ + kSCSICmd_FORMAT_UNIT = 0x04, /* Sec. 6.1.1: Mandatory */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, /* Sec. 6.1.2: Optional */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* SMC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PREFETCH = 0x34, /* Sec. 6.1.3: Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSCSICmd_READ_6 = 0x08, /* Sec. 6.1.4: Mandatory */ + kSCSICmd_READ_10 = 0x28, /* Sec. 6.1.5: Mandatory */ + kSCSICmd_READ_12 = 0xA8, /* Sec. 6.2.4: Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_READ_CAPACITY = 0x25, /* Sec. 6.1.6: Mandatory */ + kSCSICmd_READ_DEFECT_DATA_10 = 0x37, /* Sec. 6.1.7: Optional */ + kSCSICmd_READ_DEFECT_DATA_12 = 0xB7, /* Sec. 6.2.5: Optional */ + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* SMC: Optional */ + kSCSICmd_READ_GENERATION = 0x29, /* Sec. 6.2.6: Optional */ + kSCSICmd_READ_LONG = 0x3E, /* Sec. 6.1.8: Optional */ + kSCSICmd_READ_UPDATED_BLOCK_10 = 0x2D, /* Sec. 6.2.7: Optional */ + kSCSICmd_REASSIGN_BLOCKS = 0x07, /* Sec. 6.1.9: Optional */ + kSCSICmd_REBUILD = 0x81, /* Sec. 6.1.10: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_REGENERATE = 0x82, /* Sec. 6.1.11: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REPORT_LUNS = 0xA0, /* SPC: Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_REZERO_UNIT = 0x01, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSCSICmd_SEEK_6 = 0x0B, /* Obsolete */ + kSCSICmd_SEEK_10 = 0x2B, /* Sec. 6.1.12: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SET_LIMITS_10 = 0x33, /* Sec. 6.1.13: Optional */ + kSCSICmd_SET_LIMITS_12 = 0xB3, /* Sec. 6.2.8: Optional */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Sec. 6.1.14: Optional */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.15: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_UPDATE_BLOCK = 0x3D, /* Sec. 6.2.9: Optional */ + kSCSICmd_VERIFY_10 = 0x2F, /* Sec. 6.1.16: Optional */ + kSCSICmd_WRITE_6 = 0x0A, /* Sec. 6.1.17: Optional */ + kSCSICmd_WRITE_10 = 0x2A, /* Sec. 6.1.18: Optional */ + kSCSICmd_WRITE_12 = 0xAA, /* Sec. 6.2.13: Optional */ + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.1.19: Optional */ + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, /* Sec. 6.2.15: Optional */ + kSCSICmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSCSICmd_WRITE_LONG = 0x3F, /* Sec. 6.1.20: Optional */ + kSCSICmd_WRITE_SAME = 0x41, /* Sec. 6.1.21: Optional */ + kSCSICmd_XDREAD = 0x52, /* Sec. 6.1.22: Optional */ + kSCSICmd_XDWRITE = 0x50, /* Sec. 6.1.23: Optional */ + kSCSICmd_XDWRITE_EXTENDED = 0x80, /* Sec. 6.1.24: Optional */ + kSCSICmd_XPWRITE = 0x51 /* Sec. 6.1.25: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x01 SSC Sequential Access Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) command + * specification. The definitions and section numbers are based on section 5 + * of the revision 22, January 1, 2000 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_ERASE = 0x19, /* Sec. 5.3.1: Mandatory */ + kSCSICmd_FORMAT_MEDIUM = 0x04, /* Sec. 5.3.2: Optional */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOAD_UNLOAD = 0x1B, /* Sec. 5.3.3: Optional */ + kSCSICmd_LOCATE = 0x2B, /* Sec. 5.3.4: Optional */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_MOVE_MEDIUM = 0xA5, /* SMC: Optional */ + kSCSICmd_MOVE_MEDIUM_ATTACHED = 0xA7, /* SMC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSCSICmd_READ_6 = 0x08, /* Sec. 5.3.5: Mandatory */ + kSCSICmd_READ_BLOCK_LIMITS = 0x05, /* Sec. 5.3.6: Mandatory */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_READ_ELEMENT_STATUS = 0xB8, /* SMC: Optional */ + kSCSICmd_READ_ELEMENT_STATUS_ATTACHED = 0xB4, /* SMC: Optional */ + kSCSICmd_READ_POSITION = 0x34, /* Sec. 5.3.7: Mandatory */ + kSCSICmd_READ_REVERSE = 0x0F, /* Sec. 5.3.8: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RECOVER_BUFFERED_DATA = 0x14, /* Sec. 5.3.9: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REPORT_DENSITY_SUPPORT = 0x44, /* Sec. 5.3.10: Mandatory*/ + kSCSICmd_REPORT_LUNS = 0xA0, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_REWIND = 0x01, /* Sec. 5.3.11: Mandatory*/ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SPACE = 0x11, /* Sec. 5.3.12: Mandatory*/ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_VERIFY_6 = 0x13, /* Sec. 5.3.13: Optional */ + kSCSICmd_WRITE_6 = 0x0A, /* Sec. 5.3.14: Mandatory*/ + kSCSICmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSCSICmd_WRITE_FILEMARKS = 0x10 /* Sec. 5.3.15: Mandatory*/ +}; +#endif + +#pragma mark - +#pragma mark 0x02 SSC Printer Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) command + * specification. The definitions and section numbers are based on section 6 + * of the revision 22, January 1, 2000 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_FORMAT = 0x04, /* Sec. 6.2.1: Optional */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PRINT = 0x0A, /* Sec. 6.2.2: Mandatory */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RECOVER_BUFFERED_DATA = 0x14, /* Sec. 6.2.3: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REPORT_LUNS = 0xA0, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SLEW_AND_PRINT = 0x0B, /* Sec. 6.2.4: Optional */ + kSCSICmd_STOP_PRINT = 0x1B, /* Sec. 6.2.5: Optional */ + kSCSICmd_SYNCHRONIZE_BUFFER = 0x10, /* Sec. 6.2.6: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* SPC: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x03 SPC Processor Commands +/* Commands defined by the T10:1236-D SCSI Primary Commands-2 (SPC-2) + * command specification. The definitions and section numbers are based on + * section 9 of the revision 18, 21 May 2000 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_COMPARE = 0x39, /* Sec. 7.2: Optional */ + kSCSICmd_COPY = 0x18, /* Sec. 7.3: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* Sec. 7.4: Optional */ + kSCSICmd_EXTENDED_COPY = 0x83, /* Sec. 7.5: Optional */ + kSCSICmd_INQUIRY = 0x12, /* Sec. 7.6: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* Sec. 7.7: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* Sec. 7.8: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Sec. 7.13: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Sec. 7.14: Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* Sec. 7.16: Optional */ + kSCSICmd_RECEIVE = 0x08, /* Sec. 9.2: Optional */ + kSCSICmd_RECEIVE_COPY_RESULTS = 0x84, /* Sec. 7.17: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Sec. 7.18: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Sec. 7.19: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* Sec. 7.20: Optional */ + kSCSICmd_REPORT_LUNS = 0xA0, /* Sec. 7.22: Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Sec. 7.23: Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* Sec. 7.24: Optional */ + kSCSICmd_RESERVE_6 = 0x16, /* Sec. 7.25: Optional */ + kSCSICmd_SEND = 0x0A, /* Sec. 9.3: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Sec. 7.26: Mandatory */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* Sec. 7.27: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Sec. 7.29: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x04 SBC Write Once Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) command + * specification. The definitions and section numbers are based on section 6.3 + * of the revision 8c, 13 November 1997 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* SPC: Optional */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional*/ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOCK_UNLOCK_CACHE = 0x36, /* Sec. 6.1.2: Optional */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MEDIUM_SCAN = 0x38, /* Sec. 6.2.3: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_MOVE_MEDIUM = 0xA5, /* SMC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* SPC: Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* SPC: Optional */ + kSCSICmd_PREFETCH = 0x34, /* Sec. 6.1.3: Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* SPC: Optional */ + kSCSICmd_READ_6 = 0x08, /* Sec. 6.1.4: Optional */ + kSCSICmd_READ_10 = 0x28, /* Sec. 6.1.5: Mandatory */ + kSCSICmd_READ_12 = 0xA8, /* Sec. 6.2.4: Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_READ_CAPACITY = 0x25, /* Sec. 6.1.6: Mandatory */ + kSCSICmd_READ_ELEMENT_STATUS = 0xB8, /* SMC: Optional */ + kSCSICmd_READ_LONG = 0x3E, /* Sec. 6.1.8: Optional */ + kSCSICmd_REASSIGN_BLOCKS = 0x07, /* Sec. 6.1.9: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* SPC: Mandatory */ + kSCSICmd_REZERO_UNIT = 0x01, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, /* Obsolete */ + kSCSICmd_SEEK_6 = 0x0B, /* Obsolete */ + kSCSICmd_SEEK_10 = 0x2B, /* Sec. 6.1.12: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SET_LIMITS_10 = 0x33, /* Sec. 6.1.13: Optional */ + kSCSICmd_SET_LIMITS_12 = 0xB3, /* Sec. 6.2.8: Optional */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Sec. 6.1.14: Optional */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.15: Optional */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_VERIFY_10 = 0x2F, /* Sec. 6.2.10: Optional */ + kSCSICmd_VERIFY_12 = 0xAF, /* Sec. 6.2.11: Optional */ + kSCSICmd_WRITE_6 = 0x0A, /* Sec. 6.1.17: Optional */ + kSCSICmd_WRITE_10 = 0x2A, /* Sec. 6.2.10: Mandatory*/ + kSCSICmd_WRITE_12 = 0xAA, /* Sec. 6.2.13: Optional */ + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.2.14: Optional */ + kSCSICmd_WRITE_AND_VERIFY_12 = 0xAE, /* Sec. 6.2.15: Optional */ + kSCSICmd_WRITE_BUFFER = 0x3B, /* SPC: Optional */ + kSCSICmd_WRITE_LONG = 0x3F /* Sec. 6.1.20: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x05 MMC CD-ROM Commands +/* Commands defined by the T10:1363-D SCSI Multimedia Commands-3 (MMC-3) + * specification. The definitions and section numbers are based on section 6.1 + * of the revision 01, March 03, 2000 version of the specification. + * + * NOTE: The comments following each command may not be accurate. These are + * not from the MMC-3 specification, but have been derived from the SCSI-2 and + * original MMC specifications. Unlike the other SCSI command specifications, + * MMC-2 and MMC-3 do not provide a command requirement type and therefore does + * not relist the SPC commands with these requirements as they apply to MMC + * devices. The MMC-2 and MMC-3 specifications also refer back to the SBC + * specification which seems invalid since MMC devices do not represent a + * Peripheral Device Type defined by SBC. It is assumed that the SBC + * references refer to the Peripheral Device Type 0x00 - Direct Access Commands + * definitions from that specification. + */ +#if 0 +enum +{ + kSCSICmd_BLANK = 0xA1, /* Sec. 6.1.1: */ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* Obsolete */ + kSCSICmd_CLOSE_TRACK_SESSION = 0x5B, /* Sec. 6.1.2: */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_ERASE = 0x2C, /* SBC: */ + kSCSICmd_FORMAT_UNIT = 0x04, /* Sec. 6.1.3: */ + kSCSICmd_GET_CONFIGURATION = 0x46, /* Sec. 6.1.4: */ + kSCSICmd_GET_EVENT_STATUS_NOTIFICATION = 0x4A, /* Sec. 6.1.5: */ + kSCSICmd_GET_PERFORMANCE = 0xAC, /* Sec. 6.1.6: */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOAD_UNLOAD_MEDIUM = 0xA6, /* Sec. 6.1.7: */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MECHANISM_STATUS = 0xBD, /* Sec. 6.1.8: */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Mandatory */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Mandatory */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Mandatory */ + kSCSICmd_PAUSE_RESUME = 0x4B, /* Sec. 6.1.9: */ + kSCSICmd_PLAY_AUDIO_10 = 0x45, /* Sec. 6.1.10: */ + kSCSICmd_PLAY_AUDIO_12 = 0xA5, /* Sec. 6.1.11: */ + kSCSICmd_PLAY_AUDIO_MSF = 0x47, /* Sec. 6.1.12: */ + kSCSICmd_PLAY_AUDIO_TRACK_INDEX = 0x48, /* Obsolete */ + kSCSICmd_PLAY_CD = 0xBC, /* Sec. 6.1.13: */ + kSCSICmd_PLAY_RELATIVE_10 = 0x49, /* Obsolete */ + kSCSICmd_PLAY_RELATIVE_12 = 0xA9, /* Obsolete */ + kSCSICmd_PREFETCH = 0x34, /* Optional */ + kSCSICmd_PREVENT_ALLOW_MEDIUM_REMOVAL = 0x1E, /* Optional */ + kSCSICmd_READ_6 = 0x08, /* Optional */ + kSCSICmd_READ_10 = 0x28, /* Mandatory */ + kSCSICmd_READ_12 = 0xA8, /* Optional */ + kSCSICmd_READ_BUFFER = 0x3C, /* Optional */ + kSCSICmd_READ_BUFFER_CAPACITY = 0x5C, /* Sec. 6.1.15: */ + kSCSICmd_READ_CD = 0xBE, /* Sec. 6.1.16: */ + kSCSICmd_READ_CD_MSF = 0xB9, /* Sec. 6.1.17: */ + kSCSICmd_READ_CAPACITY = 0x25, /* Sec. 6.1.18: */ + kSCSICmd_READ_DISC_INFORMATION = 0x51, /* Sec. 6.1.19: */ + kSCSICmd_READ_DVD_STRUCTURE = 0xAD, /* Sec. 6.1.20: */ + kSCSICmd_READ_DISC_STRUCTURE = 0xAD, /* Sec. 6.1.20: */ + kSCSICmd_READ_FORMAT_CAPACITIES = 0x23, /* Sec. 6.1.21: */ + kSCSICmd_READ_HEADER = 0x44, /* Sec. 6.1.22: */ + kSCSICmd_READ_LONG = 0x3E, /* Optional */ + kSCSICmd_READ_MASTER_CUE = 0x59, /* Sec. 6.1.23: */ + kSCSICmd_READ_SUB_CHANNEL = 0x42, /* Sec. 6.1.24: */ + kSCSICmd_READ_TOC_PMA_ATIP = 0x43, /* Sec. 6.1.25: */ + kSCSICmd_READ_TRACK_INFORMATION = 0x52, /* Sec. 6.1.27: */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* Mandatory */ + kSCSICmd_RELEASE_10 = 0x57, /* Optional */ + kSCSICmd_REPAIR_TRACK = 0x58, /* Sec. 6.1.28: */ + kSCSICmd_REPORT_KEY = 0xA4, /* Sec. 6.1.29: */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* Mandatory */ + kSCSICmd_RESERVE_10 = 0x56, /* Optional */ + kSCSICmd_RESERVE_TRACK = 0x53, /* Sec. 6.1.30: */ + kSCSICmd_SCAN_MMC = 0xBA, /* Sec. 6.1.31: */ + kSCSICmd_SEARCH_DATA_EQUAL_10 = 0x31, /* Obsolete */ + kSCSICmd_SEARCH_DATA_EQUAL_12 = 0xB1, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_10 = 0x30, /* Obsolete */ + kSCSICmd_SEARCH_DATA_HIGH_12 = 0xB0, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_10 = 0x32, /* Obsolete */ + kSCSICmd_SEARCH_DATA_LOW_12 = 0xB2, /* Obsolete */ + kSCSICmd_SEEK_6 = 0x0B, /* Obsolete */ + kSCSICmd_SEEK_10 = 0x2B, /* SBC: */ + kSCSICmd_SEND_CUE_SHEET = 0x5D, /* Sec. 6.1.32: */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Mandatory */ + kSCSICmd_SEND_DVD_STRUCTURE = 0xBF, /* Sec. 6.1.33: */ + kSCSICmd_SEND_EVENT = 0xA2, /* Sec. 6.1.34: */ + kSCSICmd_SEND_KEY = 0xA3, /* Sec. 6.1.35: */ + kSCSICmd_SEND_OPC_INFORMATION = 0x54, /* Sec. 6.1.36: */ + kSCSICmd_SET_CD_SPEED = 0xBB, /* Sec. 6.1.37: */ + kSCSICmd_SET_LIMITS_10 = 0x33, /* Optional */ + kSCSICmd_SET_LIMITS_12 = 0xB3, /* Optional */ + kSCSICmd_SET_READ_AHEAD = 0xA7, /* Sec. 6.1.38: */ + kSCSICmd_SET_STREAMING = 0xB6, /* Sec. 6.1.39: */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Optional */ + kSCSICmd_STOP_PLAY_SCAN = 0x4E, /* Sec. 6.1.40: */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Sec. 6.1.41: */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* Mandatory */ + kSCSICmd_VERIFY_10 = 0x2F, /* Optional */ + kSCSICmd_VERIFY_12 = 0xAF, /* Optional */ + kSCSICmd_WRITE_10 = 0x2A, /* Sec. 6.1.42: */ + kSCSICmd_WRITE_12 = 0xAA, /* Sec. 6.1.43: */ + kSCSICmd_WRITE_AND_VERIFY_10 = 0x2E, /* Sec. 6.1.44: */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x06 SGC Scanner Commands +/* Commands defined by the T10:998-D SCSI-3 Graphics Commands (SGC) + * specification. The definitions and section numbers are based on section 6 + * of the revision 0, April 1995 version of the specification. + */ +#if 0 +enum +{ + kSCSICmd_CHANGE_DEFINITION = 0x40, /* SPC: Optional */ + kSCSICmd_COMPARE = 0x39, /* SPC: Optional */ + kSCSICmd_COPY = 0x18, /* SPC: Optional */ + kSCSICmd_COPY_AND_VERIFY = 0x3A, /* SPC: Optional */ + kSCSICmd_GET_DATA_BUFFER_STATUS = 0x34, /* Sec. 6.1.1: Optional */ + kSCSICmd_GET_WINDOW = 0x25, /* Sec. 6.1.2: Optional */ + kSCSICmd_INQUIRY = 0x12, /* SPC: Mandatory */ + kSCSICmd_LOG_SELECT = 0x4C, /* SPC: Optional */ + kSCSICmd_LOG_SENSE = 0x4D, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* SPC: Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* SPC: Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* SPC: Optional */ + kSCSICmd_OBJECT_POSITION = 0x31, /* Sec. 6.1.3: Optional */ + kSCSICmd_PORT_STATUS = 0x11, /* SPC (??): Mandatory + * for dual port devices */ + kSCSICmd_READ = 0x28, /* Sec. 6.1.4: Mandatory */ + kSCSICmd_READ_BUFFER = 0x3C, /* SPC: Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x1C, /* SPC: Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* SPC: Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* SPC: Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* SPC: Mandatory */ + kSCSICmd_SCAN = 0x1B, /* Sec. 6.1.5: Optional */ + kSCSICmd_SEND = 0x1B, /* Sec. 6.1.6: Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* SPC: Mandatory */ + kSCSICmd_SET_WINDOW = 0x24, /* Sec. 6.1.7: Mandatory */ + kSCSICmd_TEST_UNIT_READY = 0x00, /* SPC: Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* SPC: Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x07 SBC Optical Media Commands +/* Commands defined by the T10:990-D SCSI-3 Block Commands (SBC) + * (revision 8c, 13 November 1998) command specification. + */ + +#pragma mark - +#pragma mark 0x08 SMC Medium Changer Commands +/* Commands defined by the T10:1228-D SCSI-3 Medium Changer Commands-2 (SMC-2) + * (revision 0, March 16, 2000) command specification. + */ +#if 0 +enum +{ + /* Commands For Independent Medium Changers */ + kSCSICmd_EXCHANGE_MEDIUM = 0xA6, /* Optional */ + kSCSICmd_INITIALIZE_ELEMENT_STATUS = 0x07, /* Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCSICmd_MOVE_MEDIUM = 0xA5, /* Mandatory */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCSICmd_POSITION_TO_ELEMENT = 0x2B, /* Optional */ + kSCSICmd_READ_ELEMENT_STATUS = 0xB8, /* Mandatory */ + kSCSICmd_RELEASE_ELEMENT_6 = 0x16, /* Optional */ + kSCSICmd_RELEASE_ELEMENT_10 = 0x56, /* Optional */ + kSCSICmd_REQUEST_VOLUME_ELEMENT_ADDRESS = 0xB5, /* Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_ELEMENT_6 = 0x16, /* Optional */ + kSCSICmd_RESERVE_ELEMENT_10 = 0x56 /* Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x09 SSC Communications Commands +/* Commands defined by the T10:997-D SCSI-3 Stream Commands (SSC) + * (revision 22, January 1, 2000) command specification. + */ + +#pragma mark - +#pragma mark 0x0A ASC IT8 Prepress Commands +#pragma mark 0x0B ASC IT8 Prepress Commands +/* Commands defined by the ASC IT8 <title goes here> specification + * (revision xx, month day, year) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x0C SCC Array Controller Commands +/* Commands defined by the ANSI NCITS.318-199x SCSI Controller + * Commands (SCC-2) ratified command specification. + */ +#if 0 +enum +{ + kSCSICmd_MAINTENANCE_IN = 0xA3, /* Mandatory */ + kSCSICmd_MAINTENANCE_OUT = 0xA4, /* Optional */ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCSICmd_PORT_STATUS = 0x1F, /* Optional */ + kSCSICmd_REDUNDANCY_GROUP_IN = 0xBA, /* Mandatory */ + kSCSICmd_REDUNDANCY_GROUP_OUT = 0xBB, /* Optional */ + kSCSICmd_RELEASE_6 = 0x17, /* Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Optional */ + kSCSICmd_REPORT_LUNS = 0xA0, /* Mandatory */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* Optional*/ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D, /* Optional */ + kSCSICmd_SPARE_IN = 0xBC, /* Mandatory */ + kSCSICmd_SPARE_OUT = 0xBD /* Optional */ +}; +#endif + +#pragma mark - +#pragma mark 0x0D SES Enclosure Services Commands +/* Commands defined by the T10:1212-D SCSI-3 Enclosure Services (SES) + * (revision 8b, February 11, 1998) command specification. + */ +#if 0 +enum +{ + kSCSICmd_MODE_SELECT_6 = 0x15, /* Optional */ + kSCSICmd_MODE_SELECT_10 = 0x55, /* Optional */ + kSCSICmd_MODE_SENSE_6 = 0x1A, /* Optional */ + kSCSICmd_MODE_SENSE_10 = 0x5A, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_IN = 0x5E, /* Optional */ + kSCSICmd_PERSISTENT_RESERVE_OUT = 0x5F, /* Optional */ + kSCSICmd_RECEIVE_DIAGNOSTICS_RESULTS = 0x17, /* Mandatory */ + kSCSICmd_RELEASE_6 = 0x17, /* Optional */ + kSCSICmd_RELEASE_10 = 0x57, /* Optional */ + kSCSICmd_REQUEST_SENSE = 0x03, /* Mandatory */ + kSCSICmd_RESERVE_6 = 0x16, /* Optional */ + kSCSICmd_RESERVE_10 = 0x56, /* Optional */ + kSCSICmd_SEND_DIAGNOSTICS = 0x1D /* Mandatory */ +}; +#endif + +#pragma mark - +#pragma mark 0x0E RBC Reduced Block Commands +/* Commands defined by the T10:1240-D Reduced Block Commands (RBC) + * (revision 10a, August 18, 1999) command specification. + */ +#if 0 +enum +{ + kSCSICmd_FORMAT_UNIT = 0x04, /* Optional */ + kSCSICmd_READ_10 = 0x28, /* Mandatory */ + kSCSICmd_READ_CAPACITY = 0x25, /* Mandatory */ + kSCSICmd_START_STOP_UNIT = 0x1B, /* Mandatory */ + kSCSICmd_SYNCHRONIZE_CACHE = 0x35, /* Optional */ + kSCSICmd_VERIFY_10 = 0x2F, /* Mandatory */ + kSCSICmd_WRITE_10 = 0x2A, /* Mandatory */ + kSCSICmd_WRITE_BUFFER = 0x3B /* Mandatory for fixed media + * Optional for removable */ +}; +#endif + +#pragma mark - +#pragma mark 0x0F OCRW Optical Card Commands +/* Commands defined by the ISO/IEC 14776-381 SCSI Specification for + * Optical Card Reader/Writer (OCRW) ratified command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x11 OSD Object-based Storage Commands +/* Commands defined by the T10:1355-D Object-based Storage Commands (OSD) + * (revision 1, 18 May 2000) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#pragma mark - +#pragma mark 0x15 RMC Simplified Multimedia Commands +/* Commands defined by the T10:1364-D Reduced Multimedia Commands (RMC) + * (revision 1, November 11, 1999) command specification. + */ +#if 0 +enum +{ +}; +#endif + +#endif /* _SCSI_COMMAND_OPERATION_CODES_H_ */ diff --git a/i386/include/IOKit/scsi/SCSIPort.h b/i386/include/IOKit/scsi/SCSIPort.h new file mode 100644 index 0000000..8eefbeb --- /dev/null +++ b/i386/include/IOKit/scsi/SCSIPort.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2004-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_SCSI_PORTS_H_ +#define _IOKIT_SCSI_PORTS_H_ + + +/*! @header SCSIPort + @discussion + This file contains all the definitions for SCSIPort notifications and status. +*/ + + +/*! +@enum kSCSIPort_NotificationStatusChange +@discussion +Message definition to be used with the messageClients +call to inform of a change in port status. +*/ +enum +{ + kSCSIPort_NotificationStatusChange = 0x68000001 +}; + + +/*! @typedef SCSIPortStatus + @abstract 32-bit number to represent a SCSIPortStatus. + @discussion Type for SCSIPortStatus. +*/ + +typedef UInt32 SCSIPortStatus; + +/*! @enum SCSI Port Status Values + @discussion Definitions for the possible port status values +*/ +enum +{ + /*! + @constant kSCSIPort_StatusOnline + The port is online. + */ + kSCSIPort_StatusOnline = 0, + + /*! + @constant kSCSIPort_StatusOffline + The port is offline (e.g. unplugged cable). + */ + kSCSIPort_StatusOffline = 1, + + /*! + @constant kSCSIPort_StatusFailure + Driver has detected unrecoverable port failure (e.g. hardware port failure) + */ + kSCSIPort_StatusFailure = 2 +}; + +#endif /* _IOKIT_SCSI_PORTS_H_ */ diff --git a/i386/include/IOKit/scsi/SCSITask.h b/i386/include/IOKit/scsi/SCSITask.h new file mode 100644 index 0000000..154c187 --- /dev/null +++ b/i386/include/IOKit/scsi/SCSITask.h @@ -0,0 +1,456 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_SCSI_TASK_H_ +#define _IOKIT_SCSI_TASK_H_ + + +#if KERNEL +#include <IOKit/IOTypes.h> +#else +#include <CoreFoundation/CoreFoundation.h> +#endif + + +/*! @header SCSITask +SCSITask typedefs and constants used inside the kernel and user space. + +Note that the SCSITaskIdentifier is an opaque object and that directly +casting the SCSITaskIdentifier to any other type is discouraged. The SCSITask +implementation changes when necessary to accomodate architectural changes, +performance improvements, and bug fixes. + +Device and protocol layer drivers that need to access information +contained in a SCSITask should use the appropriate accessor methods in +IOSCSIPrimaryCommandsDevice.h or IOSCSIProtocolServices.h +*/ + + +/*! @typedef SCSIDeviceIdentifier + @abstract 64-bit number to represent a SCSI Device. + @discussion If the identifier can either be that of an initiator or a target, + SCSIDeviceIdentifier should be used. +*/ + +typedef UInt64 SCSIDeviceIdentifier; + +/*! @typedef SCSITargetIdentifier + @abstract 64-bit number to represent a SCSI Target Device. + @discussion If the identifier is for a target only and not an initiator, then + SCSITargetIdentifier should be used. +*/ + +typedef SCSIDeviceIdentifier SCSITargetIdentifier; + +/*! @typedef SCSIInitiatorIdentifier + @abstract 64-bit number to represent a SCSI Initiator Device. + @discussion If the identifier is for an initiator only and not a target, then + SCSIInitiatorIdentifier should be used. +*/ + +typedef SCSIDeviceIdentifier SCSIInitiatorIdentifier; + +/*! @typedef SCSILogicalUnitNumber + @abstract 64-bit number to represent a logical unit. + @discussion 64-bit number to represent a logical unit. +*/ + +typedef UInt64 SCSILogicalUnitNumber; + +/*! @typedef SCSITaggedTaskIdentifier + @abstract 64-bit number to represent a unique task identifier. + @discussion The Tagged Task Identifier is used when a Task has a Task Attribute other + than SIMPLE. The SCSI Application Layer client that controls the Logical + Unit for which a Task is intended is required to guarantee that the Task + Tag Identifier is unique. Zero cannot be used a a Tag value as this is used + to when a Tagged Task Identifier value is needed for a Task with a SIMPLE + attribute. +*/ + +typedef UInt64 SCSITaggedTaskIdentifier; + +/*! + @enum Untagged Task Identifier + @discussion The Untagged Task Identifier is used to indicate no unique tag + is associated with the Task. + @constant kSCSIUntaggedTaskIdentifier This value means the task is untagged. + */ + +enum +{ + kSCSIUntaggedTaskIdentifier = 0 +}; + +/*! + @typedef SCSITaskAttribute + @abstract Attributes for task delivery. + @discussion The Task Attribute defines how this task should be managed + when determing order for queueing and submission to the + appropriate device server. The Task Attribute is set by the SCSI + Application Layer and cannot be modified by the SCSI Protocol Layer. + @constant kSCSITask_SIMPLE The task has a simple attribute. + @constant kSCSITask_ORDERED The task has an ordered attribute. + @constant kSCSITask_HEAD_OF_QUEUE The task has a head-of-queue attribute. + @constant kSCSITask_ACA The task has an auto-contingent-allegiance attribute. + */ + +typedef enum SCSITaskAttribute +{ + kSCSITask_SIMPLE = 0, + kSCSITask_ORDERED = 1, + kSCSITask_HEAD_OF_QUEUE = 2, + kSCSITask_ACA = 3 +} SCSITaskAttribute; + +/*! + @typedef SCSITaskState + @abstract Attributes for task state. + @discussion The Task State represents the current state of the task. + The state is set to NEW_TASK when the task is created. The SCSI Protocol + Layer will then adjust the state as the task is queued and during + execution. The SCSI Application Layer can examine the state to monitor + the progress of a task. The Task State can only be modified by the SCSI + Protocol Layer. The SCSI Application Layer can only read the state. + @constant kSCSITaskState_NEW_TASK The task state is new task. + @constant kSCSITaskState_ENABLED The task is enabled and queued. + @constant kSCSITaskState_BLOCKED The task is blocked. + @constant kSCSITaskState_DORMANT The task is dormant. + @constant kSCSITaskState_ENDED The task is complete. + */ + +typedef enum SCSITaskState +{ + kSCSITaskState_NEW_TASK = 0, + kSCSITaskState_ENABLED = 1, + kSCSITaskState_BLOCKED = 2, + kSCSITaskState_DORMANT = 3, + kSCSITaskState_ENDED = 4 +} SCSITaskState; + + +/*! + @typedef SCSIServiceResponse + @abstract Attributes for task service response. + @discussion The Service Response represents the execution status of + a service request made to a Protocol Services Driver. The Service + Response can only be modified by the SCSI Protocol Layer. The SCSI + Application Layer can only read the state. + */ + +typedef enum SCSIServiceResponse +{ + /*! + @constant kSCSIServiceResponse_Request_In_Process + Not defined in SAM specification, but is a service response used + for asynchronous commands that are not yet completed. + */ + kSCSIServiceResponse_Request_In_Process = 0, + + /*! + @constant kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE + The service request failed because of a delivery or target failure. + */ + kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE = 1, + + /*! + @constant kSCSIServiceResponse_TASK_COMPLETE + The task completed. + */ + kSCSIServiceResponse_TASK_COMPLETE = 2, + + /*! + @constant kSCSIServiceResponse_LINK_COMMAND_COMPLETE + The linked command completed. + */ + kSCSIServiceResponse_LINK_COMMAND_COMPLETE = 3, + + /*! + @constant kSCSIServiceResponse_FUNCTION_COMPLETE + The task management function completed. + */ + kSCSIServiceResponse_FUNCTION_COMPLETE = 4, + + /*! + @constant kSCSIServiceResponse_FUNCTION_REJECTED + The task management function was rejected. + */ + kSCSIServiceResponse_FUNCTION_REJECTED = 5 +} SCSIServiceResponse; + +/*! + @typedef SCSITaskStatus + @abstract Attributes for task status. + @discussion The Task Status represents the completion status + of the task which provides the SCSI Application Layer with + additional information about how to procede in handling a + completed task. + + The SCSI Architecture Model specification only defines task + status values for when a task completes with a service response + of either TASK_COMPLETED or LINK_COMMAND_COMPLETE. + + Since additional information will aid in error recovery when + a task fails to be completed by a device due to a service + response of kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE, + additional values have been defined that can be returned by the + SCSI Protocol Layer to inform the SCSI Application Layer of the + cause of the delivery failure. + + The Task Status can only be modified by the SCSI Protocol Layer. + The SCSI Application Layer can only read the status +*/ +typedef enum SCSITaskStatus +{ + + /*! + @constant kSCSITaskStatus_GOOD + The task completed with a status of GOOD. + */ + + kSCSITaskStatus_GOOD = 0x00, + + /*! + @constant kSCSITaskStatus_CHECK_CONDITION + The task completed with a status of CHECK_CONDITION. Additional + information about the condition should be available in the sense data. + */ + + kSCSITaskStatus_CHECK_CONDITION = 0x02, + + /*! + @constant kSCSITaskStatus_CONDITION_MET + The task completed with a status of CONDITION_MET. + */ + + kSCSITaskStatus_CONDITION_MET = 0x04, + + /*! + @constant kSCSITaskStatus_BUSY + The task completed with a status of BUSY. The device server might need + time to process a request and a delay may be required. + */ + kSCSITaskStatus_BUSY = 0x08, + + /*! + @constant kSCSITaskStatus_INTERMEDIATE + The task completed with a status of INTERMEDIATE. + */ + kSCSITaskStatus_INTERMEDIATE = 0x10, + + /*! + @constant kSCSITaskStatus_INTERMEDIATE_CONDITION_MET + The task completed with a status of INTERMEDIATE_CONDITION_MET. + */ + kSCSITaskStatus_INTERMEDIATE_CONDITION_MET = 0x14, + + /*! + @constant kSCSITaskStatus_RESERVATION_CONFLICT + The task completed with a status of RESERVATION_CONFLICT. + */ + kSCSITaskStatus_RESERVATION_CONFLICT = 0x18, + + /*! + @constant kSCSITaskStatus_TASK_SET_FULL + The task completed with a status of TASK_SET_FULL. The device server + may need to complete a task before the initiator sends another. + */ + kSCSITaskStatus_TASK_SET_FULL = 0x28, + + /*! + @constant kSCSITaskStatus_ACA_ACTIVE + The task completed with a status of ACA_ACTIVE. The device server may + need the initiator to clear the Auto-Contingent Allegiance condition + before it will respond to new commands. + */ + kSCSITaskStatus_ACA_ACTIVE = 0x30, + + /*! + @constant kSCSITaskStatus_TaskTimeoutOccurred + If a task is aborted by the SCSI Protocol Layer due to it exceeding + the timeout value specified by the task, the task status shall be + set to kSCSITaskStatus_TaskTimeoutOccurred. + */ + + kSCSITaskStatus_TaskTimeoutOccurred = 0x01, + + /*! + @constant kSCSITaskStatus_ProtocolTimeoutOccurred + If a task is aborted by the SCSI Protocol Layer due to it exceeding a + timeout value specified by the support for the protocol or a related + specification, the task status shall be set to + kSCSITaskStatus_ProtocolTimeoutOccurred. + */ + + kSCSITaskStatus_ProtocolTimeoutOccurred = 0x02, + + /*! + @constant kSCSITaskStatus_DeviceNotResponding + If a task is unable to be delivered due to a failure of the device not + accepting the task or the device acknowledging the attempt to send it the + device the task status shall be set to kSCSITaskStatus_DeviceNotResponding. + This will allow the SCSI Application driver to perform the necessary steps + to try to recover the device. This shall only be reported after the SCSI + Protocol Layer driver has attempted all protocol specific attempts to recover + the device. + */ + + kSCSITaskStatus_DeviceNotResponding = 0x03, + + /*! + @constant kSCSITaskStatus_DeviceNotPresent + If the task is unable to be delivered because the device has been + detached, the task status shall be set to kSCSITaskStatus_DeviceNotPresent. + This will allow the SCSI Application Layer to halt the sending of tasks + to the device and, if supported, perform any device failover or system + cleanup. + */ + kSCSITaskStatus_DeviceNotPresent = 0x04, + + /*! + @constant kSCSITaskStatus_DeliveryFailure + If the task is unable to be + delivered to the device due to a failure in the SCSI Protocol Layer, + such as a bus reset or communications error, but the device is is + known to be functioning properly, the task status shall be set to + kSCSITaskStatus_DeliveryFailure. This can also be reported if the + task could not be delivered due to a protocol error that has since + been corrected. + */ + kSCSITaskStatus_DeliveryFailure = 0x05, + + /*! + @constant kSCSITaskStatus_No_Status + This status is not defined by + the SCSI specifications, but is here to provide a status that can + be returned in cases where there is not status available from the + device or protocol, for example, when the service response is + neither TASK_COMPLETED nor LINK_COMMAND_COMPLETE or when the + service response is SERVICE_DELIVERY_OR_TARGET_FAILURE and the + reason for failure could not be determined. + */ + kSCSITaskStatus_No_Status = 0xFF +} SCSITaskStatus; + +/*! + @enum Command Descriptor Block Size + @discussion Command Descriptor Block Size constants. +*/ +enum +{ + /*! + @constant kSCSICDBSize_Maximum This is the largest size a Command Descriptor + Block can be as specified in SPC-2. + */ + kSCSICDBSize_Maximum = 16, + + /*! + @constant kSCSICDBSize_6Byte Use this for a 6-byte CDB. + */ + kSCSICDBSize_6Byte = 6, + + /*! + @constant kSCSICDBSize_10Byte Use this for a 10-byte CDB. + */ + kSCSICDBSize_10Byte = 10, + + /*! + @constant kSCSICDBSize_12Byte Use this for a 12-byte CDB. + */ + kSCSICDBSize_12Byte = 12, + + /*! + @constant kSCSICDBSize_16Byte Use this for a 16-byte CDB. + */ + kSCSICDBSize_16Byte = 16 +}; + +typedef UInt8 SCSICommandDescriptorBlock[kSCSICDBSize_Maximum]; + +/*! + @enum Data Transfer Direction + @discussion DataTransferDirection constants. +*/ +enum +{ + /*! + @constant kSCSIDataTransfer_NoDataTransfer Use this for tasks + that transfer no data. + */ + kSCSIDataTransfer_NoDataTransfer = 0x00, + + /*! + @constant kSCSIDataTransfer_FromInitiatorToTarget Use this for tasks that transfer + data from the initiator to the target. + */ + kSCSIDataTransfer_FromInitiatorToTarget = 0x01, + + /*! + @constant kSCSIDataTransfer_FromTargetToInitiator Use this for tasks that transfer + data from the target to the initiator. + */ + kSCSIDataTransfer_FromTargetToInitiator = 0x02 +}; + + +#if defined(KERNEL) && defined(__cplusplus) + +/* Libkern includes */ +#include <libkern/c++/OSObject.h> + + +/*! + @enum SCSITaskMode + @discussion The SCSI Task mode is used by the SCSI + Protocol Layer to indicate what mode the task is executing. +*/ +typedef enum SCSITaskMode +{ + kSCSITaskMode_CommandExecution = 1, + kSCSITaskMode_Autosense = 2 +} SCSITaskMode; + +/*! + @typedef SCSITaskIdentifier + @discussion This is an opaque object that represents a task. + This is used so that drivers for both the SCSI Protocol Layer + and the SCSI Application Layer cannot modify the SCSITask object + directly but must instead use the inherited methods to do so. This + allows the implementation of SCSITask to change without directly + impacting device and protocol layer drivers. In addition, it + prevents changing of properties that are not allowed to be + changed by a given layer. +*/ +typedef OSObject * SCSITaskIdentifier; + + +/*! + @typedef SCSITaskCompletion + @discussion This is the typedef for completion routines that + work with SCSITaskIdentifiers. +*/ +typedef void ( *SCSITaskCompletion )( SCSITaskIdentifier completedTask ); + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_SCSI_TASK_H_ */ diff --git a/i386/include/IOKit/scsi/spi/.svn/all-wcprops b/i386/include/IOKit/scsi/spi/.svn/all-wcprops new file mode 100644 index 0000000..cbd1954 --- /dev/null +++ b/i386/include/IOKit/scsi/spi/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/spi +END +IOSCSIParallelInterfaceController.h +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h +END diff --git a/i386/include/IOKit/scsi/spi/.svn/entries b/i386/include/IOKit/scsi/spi/.svn/entries new file mode 100644 index 0000000..fc7fffc --- /dev/null +++ b/i386/include/IOKit/scsi/spi/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/scsi/spi +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOSCSIParallelInterfaceController.h +file + + + + +2013-08-27T23:54:30.000000Z +bce86d456d916867cf05e6e916d27b7f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +59066 + diff --git a/i386/include/IOKit/scsi/spi/.svn/text-base/IOSCSIParallelInterfaceController.h.svn-base b/i386/include/IOKit/scsi/spi/.svn/text-base/IOSCSIParallelInterfaceController.h.svn-base new file mode 100644 index 0000000..0bd7981 --- /dev/null +++ b/i386/include/IOKit/scsi/spi/.svn/text-base/IOSCSIParallelInterfaceController.h.svn-base @@ -0,0 +1,1568 @@ +/* + * Copyright (c) 2002-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ +#define __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ + + + /*! + @header IOSCSIParallelInterfaceController + The IOSCSIParallelInterfaceController class and the associated HBA child + class is responsible for the management of all related hardware. This + includes the onboard HBA controller chip and the physical state of the + bus. These classes are not responsible for any of the management of + the SCSI Devices on the bus with the exception of maintaining the queue that + holds the objects representing those SCSI Devices. +*/ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit includes +#include <IOKit/IOService.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IODMACommand.h> +#include <IOKit/IOInterruptEventSource.h> +#include <IOKit/IOFilterInterruptEventSource.h> +#include <IOKit/IOTimerEventSource.h> +#include <IOKit/IOCommandPool.h> + +// IOKit SCSI ArchitectureModel Family includes +#include <IOKit/scsi/SCSITask.h> +#include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h> +#include <IOKit/scsi/SCSIPort.h> + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +#define kIOPropertySCSIDeviceFeaturesKey "SCSI Device Features" +#define kIOPropertySCSI_I_T_NexusFeaturesKey "SCSI I_T Nexus Features" + +// This is the alignment mask used when allocating per-task HBA data. It allows +// the HBA to declare whether or not it supports 64-bit addressability and what the +// minimum byte alignment is for the data. E.g. By specifying 0x0000FFFFFFFFFFFEULL, +// the controller would be indicating that it supports 48-bits of addressability, but +// at a minimum of being 2-byte aligned. +#define kIOMinimumHBADataAlignmentMaskKey "HBA Data Alignment" + +// The Feature Selectors used to identify features of the SCSI Parallel +// Interface. These are used by the DoesHBASupportSCSIParallelFeature +// to report whether the HBA supports a given SCSI Parallel Interface +// feature and are used for requesting negotiation and reporting negotiation +// results between the controller and the device. + +// When the DoesHBASupportSCSIParallelFeature() member routine of the controller +// child class is called, it will return true if the HBA that it controls +// supports the specified SCSIParallelFeature or false if it does not. +typedef enum SCSIParallelFeature +{ + // The selector for support of Wide Data Transfers. Only Wide16 is supported + // as Wide32 has been obsoleted by the SPI-3 specification. + kSCSIParallelFeature_WideDataTransfer = 0, + + // The selector for support of Synchronous Data Transfers. + kSCSIParallelFeature_SynchronousDataTransfer = 1, + + // The selector for support of Quick Arbitration and Selection (QAS). + kSCSIParallelFeature_QuickArbitrationAndSelection = 2, + + // The selector for support of Double Transition (DT) data transfers. + kSCSIParallelFeature_DoubleTransitionDataTransfers = 3, + + // The selector for SPI Information Unit (IU) transfers. + kSCSIParallelFeature_InformationUnitTransfers = 4, + + // Since the Feature selectors are zero base, this will always have the + // correct total. + kSCSIParallelFeature_TotalFeatureCount +} SCSIParallelFeature; + + +typedef enum SCSIParallelFeatureRequest +{ + // This selector indicates that current negotiation + // should be used. + kSCSIParallelFeature_NoNegotiation = 0, + + // This selector indicates that the controller + // should attempt negotiation for the feature + kSCSIParallelFeature_AttemptNegotiation = 1, + + // This selector indicates that the controller + // should clear any negotiation for the feature + kSCSIParallelFeature_ClearNegotiation = 2 +}; + +typedef enum SCSIParallelFeatureResult +{ + kSCSIParallelFeature_NegotitiationUnchanged = 0, + kSCSIParallelFeature_NegotitiationCleared = 1, + kSCSIParallelFeature_NegotitiationSuccess = 2 +}; + + +// The SCSI Message Codes used for MESSAGE IN and MESSAGE OUT phases. +enum SCSIParallelMessages +{ + // Link Control Messages + kSCSIParallelMessage_TASK_COMPLETE = 0x00, + kSCSIParallelMessage_EXTENDED_MESSAGE = 0x01, + kSCSIParallelMessage_SAVE_DATA_POINTER = 0x02, + kSCSIParallelMessage_RESTORE_POINTERS = 0x03, + kSCSIParallelMessage_DISCONNECT = 0x04, + kSCSIParallelMessage_INITIATOR_DETECTED_ERROR = 0x05, + kSCSIParallelMessage_MESSAGE_REJECT = 0x07, + kSCSIParallelMessage_NO_OPERATION = 0x08, + kSCSIParallelMessage_MESSAGE_PARITY_ERROR = 0x09, + kSCSIParallelMessage_IGNORE_WIDE_RESIDUE = 0x23, + kSCSIParallelMessage_QAS_REQUEST = 0x55, + kSCSIParallelMessage_IDENTIFY = 0x80, + + // The Message Codes used in the EXTENDED_MESSAGE message. + kSCSIParallelMessage_MODIFY_DATA_POINTER = 0x00, + kSCSIParallelMessage_SYNCHONOUS_DATA_TRANSFER_REQUEST = 0x01, + // Reserved = 0x02 + kSCSIParallelMessage_WIDE_DATA_TRANSFER_REQUEST = 0x03, + kSCSIParallelMessage_PARALLEL_PROTOCOL_REQUEST = 0x04, + // Reserved = 0x05 through 0xFF + + // Task Attribute Message Codes + kSCSIParallelMessage_ACA = 0x24, + kSCSIParallelMessage_HEAD_OF_QUEUE = 0x21, + kSCSIParallelMessage_LINKED_COMMAND_COMPLETE = 0x0A, + kSCSIParallelMessage_ORDERED = 0x22, + kSCSIParallelMessage_SIMPLE = 0x20, + + // Task Management Message Codes + kSCSIParallelMessage_ABORT_TASK = 0x0D, + kSCSIParallelMessage_ABORT_TASK_SET = 0x06, + kSCSIParallelMessage_CLEAR_ACA = 0x16, + kSCSIParallelMessage_CLEAR_TASK_SET = 0x0E, + kSCSIParallelMessage_LOGICAL_UNIT_RESET = 0x17, + kSCSIParallelMessage_TARGET_RESET = 0x0C +}; + +enum +{ + kSCSIParallelTaskControllerIDQueueHead = 0 +}; + +// Notifications +enum +{ + kSCSIControllerNotificationBusReset = 0x68000000 +}; + +// Forward declaration for the internally used Parallel Device object. +class IOSCSIParallelInterfaceDevice; + +// This is the identifier that is used to specify a given parallel Task. +typedef OSObject * SCSIParallelTaskIdentifier; + + +//----------------------------------------------------------------------------- +// Class Declarations +//----------------------------------------------------------------------------- + +/*! @class IOSCSIParallelInterfaceController + @abstract Class that represents a SCSI Host Bus Adapter. + @discussion Class that represents a SCSI Host Bus Adapter. +*/ +class IOSCSIParallelInterfaceController : public IOService +{ + + OSDeclareAbstractStructors ( IOSCSIParallelInterfaceController ) + +#if 0 +#pragma mark - +#pragma mark Client API +#endif + + +public: + + /*! + @function GetSCSIParallelTask + @abstract Method to allow the client to get a SCSIParallelTask + @discussion Get a SCSIParallelTask from the controller so that a request + can be issued to the HBA driver. + @param blockForCommand If the blockForCommand parameter is set to false + and there are no free SCSIParallelTasks, this method will return NULL, + otherwise it will wait for one to become available before returning. + @result If there is a SCSI Parallel Task available, a reference to it + will be returned. + */ + + SCSIParallelTaskIdentifier GetSCSIParallelTask ( bool blockForCommand ); + + /*! + @function FreeSCSIParallelTask + @abstract Method to allow the client to release a SCSIParallelTask + @discussion The FreeSCSIParallelTask method is called by the client when + a SCSIParallelTask has been completed and the associated returnTask + needs to be returned to the pool. + @param returnTask is a reference to the SCSIParallelTaskIdentifier to be + returned. + */ + + void FreeSCSIParallelTask ( SCSIParallelTaskIdentifier returnTask ); + + /*! + @function FindTaskForAddress + @abstract Find a task for a given Task Address, if one exists. + @discussion If a valid Tagged Task Identifier is specified, this method + will return the task specified by the Tagged Task Address if one is + found, or else NULL will be returned. If zero is used as the Tagged + Task Identifier, then this routine will search for an outstanding task + based on the Untagged Task Address and return the task or else, if one + is not found, return NULL. + @param theT is the Target component of the I_T_L or I_T_L_Q nexus. + @param theL is the Logical Unit component of the I_T_L or I_T_L_Q nexus. + @param theQ is the Queue Tag component of the I_T_L_Q nexus. If this is + an I_T_L nexus, then the kSCSIUntaggedTaskIdentifier constant should be + used for theQ. + @result returns a valid SCSIParallelTaskIdentifier or NULL if none + found. + */ + + SCSIParallelTaskIdentifier FindTaskForAddress ( + SCSIDeviceIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ ); + + + /*! + @function FindTaskForControllerIdentifier + @abstract Find a task for a given Target and Controller Task Identifier + @discussion Allows the controller child class to find an outstanding task + for a specified target and controller task identifier + @param theTarget is the Target that the task . + @param theIdentifier is the controller task identifier set using the SCSI + Parallel Task's SetControllerTaskIdentifier() method. + @result returns a valid SCSIParallelTaskIdentifier or NULL if none + found. + */ + + SCSIParallelTaskIdentifier FindTaskForControllerIdentifier ( + SCSIDeviceIdentifier theTarget, + UInt64 theIdentifier ); + + + /*! + @function ExecuteParallelTask + @abstract Submit a SCSIParallelTask for execution. + @discussion The ExecuteParallelTask call is made by the client to submit + a SCSIParallelTask for execution. + @param parallelRequest is a reference to the SCSIParallelTaskIdentifier + to be executed. + @result is an appropriate SCSIServiceResponse which are defined in the + file <IOKit/scsi/SCSITask.h>. + */ + + SCSIServiceResponse ExecuteParallelTask ( + SCSIParallelTaskIdentifier parallelRequest ); + + // --- Public API methods provided by HBA child classes ---- + + /*! + @function ReportHBAHighestLogicalUnitNumber + @abstract Gets the Highest Logical Unit Number. + @discussion This method is used to query the HBA child class to + determine what the highest Logical Unit Number that the controller can + address. + @result returns a valid 64-bit logical unit number. + */ + + virtual SCSILogicalUnitNumber ReportHBAHighestLogicalUnitNumber ( void ) = 0; + + /*! + @function DoesHBASupportSCSIParallelFeature + @abstract Queries the HBA child class to determine if it supports a + specific SPI feature. + @discussion Queries the HBA child class to determine if it supports the + specified feature as defined by the SCSI Parallel Interconnect + specifications. + @result Returns true if requested feature is supported. + */ + + virtual bool DoesHBASupportSCSIParallelFeature ( + SCSIParallelFeature theFeature ) = 0; + + /*! + @function InitializeTargetForID + @abstract Called to initialize a target device. + @discussion This method will be called to initialize a target device in + a single-threaded manner. The HBA can use this method to probe the + target or do anything else necessary before the device object is + registered with IOKit for matching. + @result Returns true if the target was successfully initialized. + */ + + virtual bool InitializeTargetForID ( + SCSITargetIdentifier targetID ) = 0; + + // The SCSI Task Management Functions as defined in the SCSI Architecture + // Model - 2 (SAM-2) specification. These are used by the client to request + // the specified function. The controller can complete these immmediately + // by returning the appropriate SCSIServiceResponse, or these can be completed + // asyncronously by the controller returning a SCSIServiceResponse of + // kSCSIServiceResponse_Request_In_Process and then calling the appropriate + // function complete member routine listed in the child class API section. + + virtual SCSIServiceResponse AbortTaskRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ ) = 0; + + virtual SCSIServiceResponse AbortTaskSetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse ClearACARequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse ClearTaskSetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse LogicalUnitResetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse TargetResetRequest ( + SCSITargetIdentifier theT ) = 0; + + + + /*! + @function DoesHBAPerformAutoSense + @abstract Queries the HBA child class to determine if it automatically + performs AutoSense and provides AutoSense data for each I/O. If the HBA + allocates space for AutoSense in its HBA specific data region on a per + task basis, the HBA should respond true. + @discussion Queries the HBA child class to determine if it automatically + performs AutoSense and provides AutoSense data for each I/O. If the HBA + allocates space for AutoSense in its HBA specific data region on a per + task basis, the HBA should respond true. + @result Return true if HBA performs AutoSense into its own private data + buffer. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 1 ); + + virtual bool DoesHBAPerformAutoSense ( void ); + + /*! + @function ReportHBAConstraints + @abstract Called to report the I/O constraints for this controller. + A list of valid keys includes: + kIOMaximumSegmentCountReadKey, (required) + kIOMaximumSegmentCountWriteKey, (required) + kIOMaximumSegmentByteCountReadKey, (required) + kIOMaximumSegmentByteCountWriteKey, (required) + kIOMinimumSegmentAlignmentByteCountKey, (required) + kIOMaximumSegmentAddressableBitCountKey, (required) + kIOMinimumHBADataAlignmentMaskKey (required). + NB: These keys and their values are described in this header and <IOKit/IOKitKeys.h> + @param constraints. An OSDictionary object used to aggregate the key/value pairs. + Subclasses must set the required keys if they override this method. If a subclass does + not provide the required keys, the system will panic. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 2 ); + + virtual void ReportHBAConstraints ( OSDictionary * constraints ); + + // Padding for the Client API + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 8 ); + + +#if 0 +#pragma mark - +#pragma mark Child Class API +#endif + + +protected: + + // ---- Target Creation and Destruction methods --- + + /*! + @function CreateTargetForID + @abstract Method to perform device creation. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; + otherwise, the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device creation and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + @result returns true if successful. + */ + + bool CreateTargetForID ( SCSIDeviceIdentifier targetID ); + + /*! + @function CreateTargetForID + @abstract Method to perform device creation. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; + otherwise, the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device creation and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + @param properties A dictionary of properties to associate with the device + upon creation. The list of valid property keys is as follows: + kIOPropertySASAddressKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + These keys are defined in + <IOKit/storage/IOStorageProtocolCharacteristics.h> and the values + associated with these keys must be of the proper type/size, + or the target creation will not succeed. + @result returns true if successful. + */ + + bool CreateTargetForID ( SCSIDeviceIdentifier targetID, + OSDictionary * properties ); + + /*! + @function DestroyTargetForID + @abstract Method to perform device destruction. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; otherwise, + the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device destruction and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + */ + + void DestroyTargetForID ( SCSIDeviceIdentifier targetID ); + + /*! + @function GetTargetForID + @abstract Accessor for getting pointer to IOSCSIParallelInterfaceDevice. + @param targetID SCSIDeviceIdentifier of desired targetID. + @result returns pointer to IOSCSIParallelInterfaceDevice or NULL if not + found. + */ + + IOSCSIParallelInterfaceDevice * GetTargetForID ( + SCSIDeviceIdentifier targetID ); + + /*! + @function SetTargetProperty + @abstract Accessor for setting a property for a specific target. + @param device A pointer to a valid IOSCSIParallelInterfaceDevice. + @param key A pointer to a valid OSString object which represents the key. + A list of valid keys includes: + kIOPropertySASAddressKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + NB: These keys and their values are described in <IOKit/storage/IOStorageProtocolCharacteristics.h> + @param value Pointer to an OSObject (one of type OSData, OSString, etc.) + which represents the value for the property. The value must be of the proper type + and size for the specified key. + @result returns true if identifier was properly set, otherwise false. + */ + + bool SetTargetProperty ( SCSIDeviceIdentifier targetID, + const char * key, + OSObject * value ); + + /*! + @function RemoveTargetProperty + @abstract Accessor for removing a property from a specific target. + @param device A pointer to a valid IOSCSIParallelInterfaceDevice. + @param key A pointer to a valid OSString object which represents the key. + */ + + void RemoveTargetProperty ( SCSIDeviceIdentifier targetID, + const char * key ); + + // ---- Methods for HBA specifics. ---- + + /*! + @function SetHBAProperty + @abstract Accessor for setting a property for this object. + @param key A pointer to a valid OSString object which represents the key. + A list of valid keys includes: + kIOPropertyVendorNameKey, + kIOPropertyProductNameKey, + kIOPropertyProductRevisionLevelKey, + kIOPropertyPortDescriptionKey, + kIOPropertyPortSpeedKey, + kIOPropertyPortTopologyKey, + kIOPropertySCSIParallelSignalingTypeKey, + kIOPropertyFibreChannelCableDescriptionKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + NB: These keys and their values are described in <IOKit/storage/IOStorageDeviceCharacteristics.h> + and <IOKit/storage/IOStorageProtocolCharacteristics.h> + @param value Pointer to an OSObject (one of type OSData, OSString, etc.) + which represents the value for the property. The value must be of the proper type, + and/or size for the specified key. + @result returns true if identifier was properly set, otherwise false. + */ + + bool SetHBAProperty ( const char * key, + OSObject * value ); + + /*! + @function RemoveHBAProperty + @abstract Accessor for removing a property for this object. + @param key A pointer to a valid OSString object which represents the key. + See the SetHBAProperty() method for a list of valid keys. + */ + + void RemoveHBAProperty ( const char * key ); + + // These methods will not be called before the InitializeController() call, + // and will not be called after the TerminateController() call. But in the + // interval between those calls, they shall report the correct requested + // information. They are implemented as seperate pure virtual methods + // instead of a selector driven method because the HBA child class is + // required to report this information. + + /*! + @function ReportInitiatorIdentifier + @abstract Get the SCSI Device Identifier for the HBA. + @discussion This method will be called to determine the SCSI Device + Identifier that the Initiator has assigned for this HBA. + @result returns SCSIInitiatorIdentifier. + */ + + virtual SCSIInitiatorIdentifier ReportInitiatorIdentifier ( void ) = 0; + + /*! + @function ReportHighestSupportedDeviceID + @abstract Get the highest supported SCSI Device Identifier. + @discussion This method will be called to determine the value of the + highest SCSI Device Identifier supported by the HBA. This value will be + used to determine the last ID to process. + @result returns highest SCSIDeviceIdentifier + */ + + virtual SCSIDeviceIdentifier ReportHighestSupportedDeviceID ( void ) = 0; + + /*! + @function ReportMaximumTaskCount + @abstract Report Maximum Task Count + @discussion This method will be called to retrieve the maximum number of + outstanding tasks the HBA can process. This number must be greater than + zero or the controller driver will fail to match and load. + @result returns maximum (non-zero) task count. + */ + + virtual UInt32 ReportMaximumTaskCount ( void ) = 0; + + /*! + @function ReportHBASpecificTaskDataSize + @abstract Determine memory needed for HBA Task specific use. + @discussion This method is used to retrieve the amount of memory that + will be allocated in the SCSI Parallel Task for HBA specific use. + @result returns memory required in bytes + */ + + virtual UInt32 ReportHBASpecificTaskDataSize ( void ) = 0; + + /*! + @function ReportHBASpecificDeviceDataSize + @abstract Determine memory needed for HBA Device specific use. + @discussion This method is used to retrieve the amount of memory that + will be allocated in the SCSI Parallel Device for HBA specific use. + @result returns memory required in bytes + */ + + virtual UInt32 ReportHBASpecificDeviceDataSize ( void ) = 0; + + /*! + @function DoesHBAPerformDeviceManagement + @abstract Determine if HBA will manage devices. + @discussion This method is used to determine if the HBA will manage + target device creation and destruction. + @result return true means objects for target devices will only be + created when the child class calls the CreateTargetForID method. + */ + + virtual bool DoesHBAPerformDeviceManagement ( void ) = 0; + + // ---- Initialize and Terminate methods for the subclass to implement ----- + // The subclass shall not override the IOKit init and terminate methods, + // but shall instead rely on these methods for initialization and + // termination. + + // This is done to allow for this superclass to manage all IOKit specifics + // and to require only a Family specific API to be implemented by the + // subclass drivers. + + /*! + @function InitializeController + @abstract Called to initialize the controller + @discussion It is guaranteed that the InitializeController() will only be + called once per instantiation. The InitializeController() methods allows + the subclass driver to do all the necessary initialization required by + the hardware before it is able to accept requests to execute. All + necessary allocation of resources should be made during this method + call. This is the first method that will be called in the subclass. + @result return true means that initialization was successful. + */ + + virtual bool InitializeController ( void ) = 0; + + /*! + @function TerminateController + @abstract Called to terminate the controller + @discussion It is guaranteed that the TerminateController() will only be + called once and only after the InitializeController() method and only if + true was returned in response to the InitializeController() method. + The TerminateController() method allows the subclass to release all + resources that were acquired for operation of the hardware and shutdown + all hardware services. + This is the last method of the subclass that will be called before the + class is destroyed. + */ + + virtual void TerminateController ( void ) = 0; + + // ---- Start and Stop methods for the subclass ---- + + /*! + @function StartController + @abstract Called to start the controller + @discussion The StartController will always be called before any + requests are sent to the driver for execution. This method is called + after an initialize to start the services provided by the specific HBA + driver or called after a StopController call to restart those services. + After this call completes, all services provided by the HBA driver are + available to the client. + @result return true means that start was successful. + */ + + virtual bool StartController ( void ) = 0; + + /*! + @function StopController + @abstract Called to stop the controller + @discussion The StopController method will be called any time that the + system wants the card to stop accepting requests. ( See StartController + discussion ). The subclass should disable the hardware interrupt for + the particular controller (if possible) in this method. + */ + + virtual void StopController ( void ) = 0; + + // ---- Suspend and Resume Methods for the subclass ---- + + /*! + @function SuspendServices + @abstract Called to suspend controller services + @discussion Method will be called when the system wants to suspend the + services that are provided by the HBA driver. This call is not a reset + and the driver shall retain all state data between this so that if a + ResumeServices call is received, the driver can continue providing + services without a visible difference to the client. The driver may + receive multiple SuspendServices calls without receiving a + ResumeServices call and should ignore any after the first until a + ResumeServices call is received. + */ + + virtual void SuspendServices ( void ); + + /*! + @function ResumeServices + @abstract Called to resume controller services + @discussion Method that will be called to resume services + provided by the driver. ( See SuspendServices discussion ) + */ + + virtual void ResumeServices ( void ); + + /*! + @function HandleInterruptRequest + @abstract Handle Interrupt Request + @discussion The HandleInterruptRequest is used to notify an HBA + specific subclass that an interrupt request needs to be serviced. It is + called on the workloop (it holds the gate) at secondary interrupt level. + */ + + virtual void HandleInterruptRequest ( void ) = 0; + + /*! + @function EnableInterrupt + @abstract Enable Interrupt + @discussion Method that the HBA child class can call to enable + the associated IOInterruptEventSource. + */ + + void EnableInterrupt ( void ); + + /*! + @function DisableInterrupt + @abstract Disable Interrupt + @discussion Method that the HBA child class can call to disable + the associated IOInterruptEventSource. + */ + + void DisableInterrupt ( void ); + + /*! + @function SignalInterrupt + @abstract Signals that an interrupt has occurred. + @discussion Subclasses of IOSCSIParallelInterfaceController + should call this method in order to get the secondary interrupt + thread scheduled if and only if they will be returning false from + their overriden FilterInterruptRequest() method. See the + discussion for the FilterInterruptRequest() method for more + details. + + NOTE: This method should only be called from within the + FilterInterruptRequest() method and at no other time. + + Available in 10.3.3 or later. + + */ + + void SignalInterrupt ( void ); + + /*! + @function ProcessParallelTask + @abstract Called by client to process a parallel task. + @discussion This method is called to process a parallel task (i.e. put + the command on the bus). The HBA specific sublcass must implement this + method. + @param parallelRequest A valid SCSIParallelTaskIdentifier. + @result serviceResponse (see <IOKit/scsi/SCSITask.h>) + */ + + virtual SCSIServiceResponse ProcessParallelTask ( + SCSIParallelTaskIdentifier parallelRequest ) = 0; + + /*! + @function CompleteParallelTask + @abstract Parallel Task Completion + @discussion The HBA specific sublcass inherits the CompleteParallelTask() + method which shall be called when the HBA has completed the processing + of a parallel task. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param completionStatus The status of the SCSI bus. + @param serviceResponse (see <IOKit/scsi/SCSITask.h>) + */ + + void CompleteParallelTask ( + SCSIParallelTaskIdentifier parallelRequest, + SCSITaskStatus completionStatus, + SCSIServiceResponse serviceResponse ); + + + // Completion routines for the SCSI Task Management functions as described + // in the SCSI ArchitectureModel - 2 (SAM-2) specification. Each of these + // correspond to a client request for the specific Task Management functions. + // If the Controller Child Class completed the request by returning a + // SCSIServiceResponse of anything other than kSCSIServiceResponse_Request_In_Process, + // then the controller class does not need to call the completion member routine. + // If the controller did not complete the request immediately, then it will + // need to call the appropriate completion member routine listed here. + void CompleteAbortTask ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ, + SCSIServiceResponse serviceResponse ); + + void CompleteAbortTaskSet ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteClearACA ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteClearTaskSet ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteLogicalUnitReset ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteTargetReset ( + SCSITargetIdentifier theT, + SCSIServiceResponse serviceResponse ); + + /*! + @function NotifyClientsOfBusReset + @abstract Method called to notify clients that a bus reset has occurred. + @discussion This method is used by the HBA child class to inform the + parent class and any clients that a bus reset has occurred. + */ + + void NotifyClientsOfBusReset ( void ); + + /*! + @function NotifyClientsOfPortStatusChange + @abstract Method called to notify clients of port status change events. + @discussion This method is used by the HBA child class to inform the + parent class and any clients that a port has changed status. + */ + + void NotifyClientsOfPortStatusChange ( SCSIPortStatus newStatus ); + + /*! + @function GetSCSIDomainIdentifier + @abstract Accessor method to get the SCSI Domain Identifier. + @discussion Accessor method to get the SCSI Domain Identifier. + @result returns SCSI Domain Identifier. + */ + + SInt32 GetSCSIDomainIdentifier ( void ); + + /*! + @function GetProvider + @abstract Accessor method to get the IOService which is the controller's + provider. + @discussion Accessor method to get the IOService which is the + controller's provider. + @result returns pointer to IOService. + */ + + IOService * GetProvider ( void ); + + /*! + @function GetWorkLoop + @abstract Accessor method to get the IOWorkLoop associated with this + HBA. + @discussion Accessor method to get the IOWorkLoop associated with this + HBA. + @result returns pointer to IOWorkLoop. + */ + + IOWorkLoop * GetWorkLoop ( void ) const; + + /*! + @function GetCommandGate + @abstract Accessor to get an IOCommandGate associated with the workloop. + @discussion Accessor to get an IOCommandGate associated with the + workloop. + @result returns pointer to IOCommandGate. + */ + + IOCommandGate * GetCommandGate ( void ); + + // ---- SCSI Parallel Task Object Accessors ---- + + /*! + @function GetSCSITaskIdentifier + @abstract Method to retrieve a SCSITaskIdentifier from a valid + SCSIParallelTaskIdentifier. + @discussion Method to retrieve a SCSITaskIdentifier from a valid + SCSIParallelTaskIdentifier. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns SCSITaskIdentifier that represents the original request + from the SCSI Application Layer client. + */ + + SCSITaskIdentifier GetSCSITaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTargetIdentifier + @abstract Method to get the SCSITargetIdentifier associated with a + request. + @discussion Method to get the SCSITargetIdentifier associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns SCSITargetIdentifier + */ + + SCSITargetIdentifier GetTargetIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + // ---- Methods for Accessing data in the client's SCSI Task Object ---- + // Method to retrieve the LUN that identifies the Logical Unit whose Task + // Set to which this task is to be added. + + /*! + @function GetLogicalUnitNumber + @abstract Method to get the logical unit number associated with a + request. + @discussion Method to get the logical unit number associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns a valid 64-bit logical unit number. + */ + + SCSILogicalUnitNumber GetLogicalUnitNumber ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTaggedTaskIdentifier + @abstract Method to retrieve the SCSI Tagged Task Identifier of the + task. If the returned value is equal to kSCSIUntaggedTaskIdentifier, + then this task is untagged. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an SCSITaskAttribute value. + */ + + SCSITaggedTaskIdentifier GetTaggedTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTaskAttribute + @abstract Method to retrieve the SCSI Task Attribute of the task + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an SCSITaskAttribute value. + */ + + SCSITaskAttribute GetTaskAttribute ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetCommandDescriptorBlockSize + @abstract Method to retrieve the size of the SCSI Command Descriptor + Block (CDB). + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns the size of the SCSI Command Descriptor Block in bytes. + */ + + UInt8 GetCommandDescriptorBlockSize ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetCommandDescriptorBlock + @abstract Method to retrieve the SCSI Command Descriptor Block (CDB). + @discussion This will always return a 16 Byte CDB. If the Protocol Layer + driver does not support 16 Byte CDBs, it will have to create a local + SCSICommandDescriptorBlock variable to get the CDB data and then + transfer the needed bytes from there. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param cdbData is a SCSICommandDescriptorBlock pointer to 16 byte CDB + @result returns true if data was copied to cdbData pointer + */ + + bool GetCommandDescriptorBlock ( + SCSIParallelTaskIdentifier parallelTask, + SCSICommandDescriptorBlock * cdbData ); + + /*! + @function GetDataTransferDirection + @abstract Retrieves the data transfer direction for any data associated + with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result One of the valid data transfer directions described in + <IOKit/scsi/SCSITask.h> + */ + + UInt8 GetDataTransferDirection ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetRequestedDataTransferCount + @abstract Retrieves the requested data transfer count for any data + associated with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result The requested data transfer count in bytes. + */ + + UInt64 GetRequestedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetRealizedDataTransferCount + @abstract Retrieves the realized data transfer count for any data + associated with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result The realized data transfer count in bytes. + */ + + UInt64 GetRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function SetRealizedDataTransferCount + @abstract Sets the realized data transfer count in bytes. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param realizedTransferCountInBytes is the number of bytes actually + transferred. + @result true means the data transfer count was successfully set. + */ + + bool SetRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 realizedTransferCountInBytes ); + + /*! + @function IncrementRealizedDataTransferCount + @abstract Increments the realized data transfer count. This method is + helpful for when the HBA has to do multiple passes of DMA because there + are more scatter-gather elements than it can process in one pass. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param realizedTransferCountInBytes is the number of bytes to add to the + realized data count for the task. + */ + + void IncrementRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 realizedTransferCountInBytes ); + + /*! + @function GetDataBuffer + @abstract Method to retrieve client buffer from the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IOMemoryDescriptor which represents the + buffer. + */ + + IOMemoryDescriptor * GetDataBuffer ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetDataBufferOffset + @abstract Method to retrieve offset into client buffer at which to start + processing. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns offset in bytes + */ + + UInt64 GetDataBufferOffset ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetDMACommand + @abstract Method to retrieve a pointer to an IODMACommand from the request. + @discussion For devices utilizing DMA, the IODMACommand object should be + obtained via GetDMACommand(). The subclass is responsible for calling prepare() + on the IODMACommand object using the proper offset obtained via GetDataBufferOffset() + and correct size obtained via GetRequestedDataTransferCount(). The subclass + is further responsible for calling complete() on the IODMACommand object once + all DMA operations have finished. + NB: Subclasses should not call IODMACommand::setMemoryDescriptor(). + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IODMACommand which is used in conjunction + with the task. + */ + + IODMACommand * GetDMACommand ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTimeoutDuration + @abstract Method to retrieve the timeout duration in milliseconds for a + request. + @discussion Method to retrieve the timeout duration in milliseconds for + a request. A value of zero represents an infinite timeout, or on + hardware where infinite timeouts are not possible, substitute the + longest timeout possible. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns timeout duration in milliseconds + */ + + UInt32 GetTimeoutDuration ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function SetAutoSenseData + @abstract Method to set the auto sense data buffer associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param newSensedata pointer to auto sense data buffer + @result returns true if data in newSenseData was succesfully into the + task object + */ + + bool SetAutoSenseData ( + SCSIParallelTaskIdentifier parallelTask, + SCSI_Sense_Data * newSenseData, + UInt8 senseDataSize ); + + /*! + @function GetAutoSenseData + @abstract Method to retrieve auto sense data buffer associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param receivingBuffer pointer to auto sense data buffer + @result returns true if successfully copied data into receivingBuffer + */ + + bool GetAutoSenseData ( + SCSIParallelTaskIdentifier parallelTask, + SCSI_Sense_Data * receivingBuffer, + UInt8 senseDataSize ); + + /*! + @function GetAutoSenseDataSize + @abstract Method to retrieve auto sense data buffer size associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns Size of auto sense data buffer. + */ + + UInt8 GetAutoSenseDataSize ( + SCSIParallelTaskIdentifier parallelTask ); + + + /*! + @function GetSCSIParallelFeatureNegotiation + @abstract Method to retrieve the requested value for negotiation of the. + @discussion Query as to whether the SCSI Parallel Device object has + negotiated wide data transfers. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result A valid SCSIParallelFeatureControl. + */ + + SCSIParallelFeatureRequest GetSCSIParallelFeatureNegotiation ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature ); + + /*! + @function GetSCSIParallelFeatureNegotiationCount + @abstract Method to retrieve the number of requested negotiations. + @discussion Query as to the number of SCSI Parallel Features that are + requested to either be negotitated or cleared. These are all features + that are set to either kSCSIParallelFeature_AttemptNegotiation or + kSCSIParallelFeature_ClearNegotiation. If the return value is zero, + then all features are set to kSCSIParallelFeature_NoNegotiation + and all feature negotiations are to remain as they currently exist. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an unsigned integer up to 64 bits in size. + */ + + UInt64 GetSCSIParallelFeatureNegotiationCount ( + SCSIParallelTaskIdentifier parallelTask); + + /*! + @function SetSCSIParallelFeatureNegotiationResult + @abstract Method to set the wide data transfer negotiation result. + @discussion Method to set the wide data transfer negotiation result. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param requestedFeature The SCSIParallelFeature that the has been set to + newResult. + @param newResult A valid SCSIParallelFeatureResult value. + */ + + void SetSCSIParallelFeatureNegotiationResult ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature, + SCSIParallelFeatureResult newResult ); + + /*! + @function GetSCSIParallelFeatureNegotiationResult + @abstract Method to retrieve the result of any wide transfer + negotiations. + @discussion Query as to whether the SCSI Parallel Controller object has + negotiated wide data transfers. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result A valid SCSIParallelFeatureResult. + */ + + SCSIParallelFeatureResult GetSCSIParallelFeatureNegotiationResult ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature ); + + /*! + @function GetSCSIParallelFeatureNegotiationResultCount + @abstract Method to retrieve the number of changed negotiations. + @discussion Query as to the number of SCSI Parallel Features that have + been changed to either negotitated or cleared. These are all features + that are set to either kSCSIParallelFeature_NegotitiationCleared or + kSCSIParallelFeature_NegotitiationSuccess. If the return value is zero, + then all features are set to kSCSIParallelFeature_NegotitiationUnchanged. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an unsigned integer up to 64 bits in size. + */ + + UInt64 GetSCSIParallelFeatureNegotiationResultCount ( + SCSIParallelTaskIdentifier parallelTask); + + // Controller Task Identifier related member routines + + /*! + @function SetControllerTaskIdentifier + @abstract Method to set the Controller Task Identifier. + @discussion This method allows the Controller Child Class + driver to set a unique identifier to associate with the specified + SCSI Parallel Task. This identifier is designed to be used by + controllers that do not have access to the LUN and Tag information + when notified by the HBA that a request has completed. + If the kSCSIParallelTaskControllerIDQueueHead is used, this + member routine will return the first Task on the queue. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param newIdentifier unsigned 64 bit integer token. + @result none + */ + + void SetControllerTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 newIdentifier ); + + UInt64 GetControllerTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask); + + + // The HBA Data related fields + + /*! + @function GetHBADataSize + @abstract Method to retrieve the HBA Data Size in bytes. + @discussion Method to retrieve the HBA Data Size in bytes. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns HBA Data size in bytes. + */ + + UInt32 GetHBADataSize ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetHBADataPointer + @abstract Method to retrieve the HBA Data pointer. + @discussion Method to retrieve the HBA Data pointer. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to buffer for HBA specific data, NULL if + none found or GetHBADataSize() returns zero. + */ + + void * GetHBADataPointer ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetHBADataDescriptor + @abstract Method to retrieve the IOMemoryDescriptor associated with + the HBA Data. + @discussion Method to retrieve the IOMemoryDescriptor associated with + the HBA Data. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IOMemoryDescriptor that wraps the HBA + specific data buffer, NULL if none found or GetHBADataSize() returns zero. + */ + + IOMemoryDescriptor * GetHBADataDescriptor ( + SCSIParallelTaskIdentifier parallelTask ); + + // ---- SCSI Parallel Device Object Accessors ---- + + // The HBA Data related fields + + /*! + @function GetHBATargetDataSize + @abstract Method to retrieve the HBA Data Size in bytes. + @discussion Method to retrieve the HBA Data Size in bytes. + @param targetDevice A valid SCSITargetIdentifier. + @result returns HBA Data size in bytes. + */ + + UInt32 GetHBATargetDataSize ( SCSITargetIdentifier targetID ); + + /*! + @function GetHBATargetDataPointer + @abstract Method to retrieve the HBA Data pointer. + @discussion Method to retrieve the HBA Data pointer. + @param targetDevice A valid SCSITargetIdentifier. + @result returns pointer to buffer for HBA specific data, NULL if + none found or GetHBADataSize is zero. + */ + + void * GetHBATargetDataPointer ( SCSITargetIdentifier targetID ); + + +#if 0 +#pragma mark - +#pragma mark Additional Child Class APIs +#endif + + + // ---- Timeout Related Methods ---- + + /*! + @function SetTimeoutForTask + @abstract Method to set the timeout duration in milliseconds for a + request. + @discussion Method to set the timeout duration in milliseconds for a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param timeoutOverride A timeout value in milliseconds in case the + HBA driver wishes to override the default value provided in the + parallelTask. + */ + + void SetTimeoutForTask ( SCSIParallelTaskIdentifier parallelTask, + UInt32 timeoutOverride = 0 ); + + /*! + @function HandleTimeout + @abstract Method to handle command timeouts. + @discussion Method to handle command timeouts. This should + be overridden by the child class in order to clean up HBA + specific structures after a timeout has occurred. This method + is called on the workloop (it holds the gate). + @param parallelRequest A valid SCSIParallelTaskIdentifier. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 9 ); + + virtual void HandleTimeout ( + SCSIParallelTaskIdentifier parallelRequest ); + + + // ---- Filter Interrupt ---- + + /*! + @function FilterInterruptRequest + @abstract Filter method called at primary interrupt time. + @discussion Filter method called at primary interrupt time. + This should only be overridden by the child class in order + to determine if an interrupt occurred for this controller instance. + Since all work occurs at primary interrupt time, this routine + should be quick and efficient and defer as much processing as + possible to the HandleInterruptRequest() method. + + NOTE: Unlike the HandleInterruptRequest() and HandleTimeout() + methods, FilterInterruptRequest() is NOT called with the + workloop lock held. + + If the value returned by FilterInterruptRequest() is true, the + secondary interrupt thread will be scheduled and the hardware + interrupt line will be disabled. If the controller instance shares + that interrupt line with other devices, it can cause large + interrupt latencies. If the controller instance can disable the + interrupt in the chip itself, the following can be done to reduce + interrupt latencies: + + - Interrupt occurs + - FilterInterruptRequest() method is called. + - If the interrupt is not for this controller, return false + immediately. + - If the interrupt is for this controller, and the controller + can disable interrupts for this chip, the controller should + disable the interrupts for this chip, call SignalInterrupt(), + and return false. This causes the secondary interrupt thread + to get scheduled, yet does not disable the interrupt line for + all devices tied to that interrupt. This effectively allows + other devices to process their interrrupts, thus reducing + interrupt latency for those devices. + - HandleInterruptRequest() method is called. + - Controller processes interrupt and completes I/O requests. + - Controller re-enables interrupts for the device. + + NOTE: If you use this approach, the interrupting condition MUST be + cleared from the hardware, otherwise an infinite process interrupt + loop will occur. + + If the controller cannot disable interrupts on the chip, it should + simply return true if an interrupt has occurred for its device. + + @result True if the hardware interrupt line should be disabled, + otherwise false. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 10 ); + + virtual bool FilterInterruptRequest ( void ); + + /*! + @function InitializeDMASpecification + @abstract Called to initialize an IODMACommand with a DMA specification. + @param command A pointer to a valid IODMACommand object. Subclasses + should override this method and call IODMACommand::initWithSpecification() + supplying the proper arguments to that method based on the DMA strategy. + @result boolean value indicating success or failure. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 11 ); + + virtual bool InitializeDMASpecification ( IODMACommand * command ); + + /*! + @function CreateDeviceInterrupt + @abstract Called to create an IOInterruptEventSource for the device. Subclasses + may wish to use a different interrupt index than 0 (e.g. for using PCI Message + Signaled Interrupts) or might not need an interrupt at all (virtual HBA). + @param action A pointer to the action routine that should be passed to either + IOInterruptEventSource::interruptEventSource() or + IOFilterInterruptEventSource::filterInterruptEventSource as the method to call + when an interrupt occurs for the device (sometimes called the "deferred procedure call" + or the "secondary context method". By passing this routine along, it will + properly wire up the HandleInterruptRequest() method you should override to handle + interrupts. + @param filter A pointer to the filter routine that should be passed to + IOFilterInterruptEventSource::filterInterruptEventSource as the method to call + at primary interrupt time when an interrupt occurs for the device. + By passing this routine along, it will properly wire up the + FilterInterruptRequest() method you may override to handle primary interrupts. + @result IOInterruptEventSource. May return NULL if and only if there is no + hardware interrupt associated with this device. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 12 ); + + virtual IOInterruptEventSource * CreateDeviceInterrupt ( + IOInterruptEventSource::Action action, + IOFilterInterruptEventSource::Filter filter, + IOService * provider ); + + // Padding for the Child Class API + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 16 ); + + +#if 0 +#pragma mark - +#pragma mark Internal Use Only +#endif + +private: + + // binary compatibility instance variable expansion + struct ExpansionData { }; + ExpansionData * fIOSCSIParallelInterfaceControllerExpansionData; + + IOService * fProvider; + OSSet * fClients; + + static SInt32 fSCSIParallelDomainCount; + SInt32 fSCSIDomainIdentifier; + + // The HBA attributes + SCSIInitiatorIdentifier fInitiatorIdentifier; + + // The maximum SCSI Device Identifier support by the HBA + // This is retreived from the child class via the + SCSIDeviceIdentifier fHighestSupportedDeviceID; + + // The total number of tasks that the HBA can proccess at a time. + // This is retrieved from the child class via ReportMaximumTaskCount + UInt32 fSupportedTaskCount; + + // The Number of requests that are currently outstanding for the current + // instantiation. + UInt16 fOutstandingRequests; + + // The member variable to indicate if the current instantiation has been + // succesfully intialized. + bool fHBAHasBeenInitialized; + + // The member variable to indicate if the current instantiation is running. + // A true means that the last or only Start call made was successful. A + // false value means that either a successful Start has not been made or a + // Stop call has been made. + bool fHBACanAcceptClientRequests; + + // The pool for the available SCSI Parallel Task objects + IOCommandPool * fParallelTaskPool; + + // WorkLoop variables + IOWorkLoop * fWorkLoop; + IOTimerEventSource * fTimerEvent; + IOInterruptEventSource * fDispatchEvent; + + IOCommandGate * fControllerGate; + + bool AllocateSCSIParallelTasks ( void ); + void DeallocateSCSIParallelTasks ( void ); + + IOWorkLoop * getWorkLoop ( void ) const; + bool CreateWorkLoop ( IOService * provider ); + void ReleaseWorkLoop ( void ); + + // SCSI Parallel Device List + // The SCSI Parallel Device List will consist of 16 elements to represent + // identifiers that end in 0h through Fh. Each array element will point + // to a device object that represents the beginning of a linked list of + // device objects. By using an array of linked lists, the traversal time + // to find an object on a bus that supports a large number of devices, such + // as Fibre Channel, will be significantly lower than having to walk a list + // that is comprised of all devices on the bus. For parallel wide and + // narrow busses, which support 16 and 8 devices respectively, this will act + // like a simple array of device objects. + enum + { + kSCSIParallelDeviceListArrayCount = 16, + kSCSIParallelDeviceListIndexMask = 0x0F + }; + + IOSimpleLock * fDeviceLock; + IOSCSIParallelInterfaceDevice * + fParallelDeviceList[kSCSIParallelDeviceListArrayCount]; + + void InitializeDeviceList ( void ); + void AddDeviceToTargetList ( + IOSCSIParallelInterfaceDevice * newDevice ); + void RemoveDeviceFromTargetList ( + IOSCSIParallelInterfaceDevice * victimDevice ); + + // The Interrupt Service Routine for the controller. + static void ServiceInterrupt ( + OSObject * theObject, + IOInterruptEventSource * theSource, + int count ); + + static void TimeoutOccurred ( OSObject * owner, IOTimerEventSource * sender ); + + static bool FilterInterrupt ( + OSObject * theObject, + IOFilterInterruptEventSource * theSource ); + + // IOService support methods + // These shall not be overridden by the HBA child classes. + bool start ( IOService * provider ); + void stop ( IOService * provider ); + + +protected: + + // These may be overriden by the HBA child classes if necessary, but should + // call the superclass implementation. + virtual bool handleOpen ( + IOService * client, + IOOptionBits options, + void * arg ); + + virtual void handleClose ( + IOService * client, + IOOptionBits options ); + + virtual bool handleIsOpen ( + const IOService * client ) const; + + virtual bool willTerminate ( IOService * provider, IOOptionBits options ); + virtual bool didTerminate ( IOService * provider, IOOptionBits options, bool * defer ); + +}; + + +#endif /* __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ */ \ No newline at end of file diff --git a/i386/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h b/i386/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h new file mode 100644 index 0000000..0bd7981 --- /dev/null +++ b/i386/include/IOKit/scsi/spi/IOSCSIParallelInterfaceController.h @@ -0,0 +1,1568 @@ +/* + * Copyright (c) 2002-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ +#define __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ + + + /*! + @header IOSCSIParallelInterfaceController + The IOSCSIParallelInterfaceController class and the associated HBA child + class is responsible for the management of all related hardware. This + includes the onboard HBA controller chip and the physical state of the + bus. These classes are not responsible for any of the management of + the SCSI Devices on the bus with the exception of maintaining the queue that + holds the objects representing those SCSI Devices. +*/ + + +//----------------------------------------------------------------------------- +// Includes +//----------------------------------------------------------------------------- + +// General IOKit includes +#include <IOKit/IOService.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IODMACommand.h> +#include <IOKit/IOInterruptEventSource.h> +#include <IOKit/IOFilterInterruptEventSource.h> +#include <IOKit/IOTimerEventSource.h> +#include <IOKit/IOCommandPool.h> + +// IOKit SCSI ArchitectureModel Family includes +#include <IOKit/scsi/SCSITask.h> +#include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h> +#include <IOKit/scsi/SCSIPort.h> + +//----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + + +#define kIOPropertySCSIDeviceFeaturesKey "SCSI Device Features" +#define kIOPropertySCSI_I_T_NexusFeaturesKey "SCSI I_T Nexus Features" + +// This is the alignment mask used when allocating per-task HBA data. It allows +// the HBA to declare whether or not it supports 64-bit addressability and what the +// minimum byte alignment is for the data. E.g. By specifying 0x0000FFFFFFFFFFFEULL, +// the controller would be indicating that it supports 48-bits of addressability, but +// at a minimum of being 2-byte aligned. +#define kIOMinimumHBADataAlignmentMaskKey "HBA Data Alignment" + +// The Feature Selectors used to identify features of the SCSI Parallel +// Interface. These are used by the DoesHBASupportSCSIParallelFeature +// to report whether the HBA supports a given SCSI Parallel Interface +// feature and are used for requesting negotiation and reporting negotiation +// results between the controller and the device. + +// When the DoesHBASupportSCSIParallelFeature() member routine of the controller +// child class is called, it will return true if the HBA that it controls +// supports the specified SCSIParallelFeature or false if it does not. +typedef enum SCSIParallelFeature +{ + // The selector for support of Wide Data Transfers. Only Wide16 is supported + // as Wide32 has been obsoleted by the SPI-3 specification. + kSCSIParallelFeature_WideDataTransfer = 0, + + // The selector for support of Synchronous Data Transfers. + kSCSIParallelFeature_SynchronousDataTransfer = 1, + + // The selector for support of Quick Arbitration and Selection (QAS). + kSCSIParallelFeature_QuickArbitrationAndSelection = 2, + + // The selector for support of Double Transition (DT) data transfers. + kSCSIParallelFeature_DoubleTransitionDataTransfers = 3, + + // The selector for SPI Information Unit (IU) transfers. + kSCSIParallelFeature_InformationUnitTransfers = 4, + + // Since the Feature selectors are zero base, this will always have the + // correct total. + kSCSIParallelFeature_TotalFeatureCount +} SCSIParallelFeature; + + +typedef enum SCSIParallelFeatureRequest +{ + // This selector indicates that current negotiation + // should be used. + kSCSIParallelFeature_NoNegotiation = 0, + + // This selector indicates that the controller + // should attempt negotiation for the feature + kSCSIParallelFeature_AttemptNegotiation = 1, + + // This selector indicates that the controller + // should clear any negotiation for the feature + kSCSIParallelFeature_ClearNegotiation = 2 +}; + +typedef enum SCSIParallelFeatureResult +{ + kSCSIParallelFeature_NegotitiationUnchanged = 0, + kSCSIParallelFeature_NegotitiationCleared = 1, + kSCSIParallelFeature_NegotitiationSuccess = 2 +}; + + +// The SCSI Message Codes used for MESSAGE IN and MESSAGE OUT phases. +enum SCSIParallelMessages +{ + // Link Control Messages + kSCSIParallelMessage_TASK_COMPLETE = 0x00, + kSCSIParallelMessage_EXTENDED_MESSAGE = 0x01, + kSCSIParallelMessage_SAVE_DATA_POINTER = 0x02, + kSCSIParallelMessage_RESTORE_POINTERS = 0x03, + kSCSIParallelMessage_DISCONNECT = 0x04, + kSCSIParallelMessage_INITIATOR_DETECTED_ERROR = 0x05, + kSCSIParallelMessage_MESSAGE_REJECT = 0x07, + kSCSIParallelMessage_NO_OPERATION = 0x08, + kSCSIParallelMessage_MESSAGE_PARITY_ERROR = 0x09, + kSCSIParallelMessage_IGNORE_WIDE_RESIDUE = 0x23, + kSCSIParallelMessage_QAS_REQUEST = 0x55, + kSCSIParallelMessage_IDENTIFY = 0x80, + + // The Message Codes used in the EXTENDED_MESSAGE message. + kSCSIParallelMessage_MODIFY_DATA_POINTER = 0x00, + kSCSIParallelMessage_SYNCHONOUS_DATA_TRANSFER_REQUEST = 0x01, + // Reserved = 0x02 + kSCSIParallelMessage_WIDE_DATA_TRANSFER_REQUEST = 0x03, + kSCSIParallelMessage_PARALLEL_PROTOCOL_REQUEST = 0x04, + // Reserved = 0x05 through 0xFF + + // Task Attribute Message Codes + kSCSIParallelMessage_ACA = 0x24, + kSCSIParallelMessage_HEAD_OF_QUEUE = 0x21, + kSCSIParallelMessage_LINKED_COMMAND_COMPLETE = 0x0A, + kSCSIParallelMessage_ORDERED = 0x22, + kSCSIParallelMessage_SIMPLE = 0x20, + + // Task Management Message Codes + kSCSIParallelMessage_ABORT_TASK = 0x0D, + kSCSIParallelMessage_ABORT_TASK_SET = 0x06, + kSCSIParallelMessage_CLEAR_ACA = 0x16, + kSCSIParallelMessage_CLEAR_TASK_SET = 0x0E, + kSCSIParallelMessage_LOGICAL_UNIT_RESET = 0x17, + kSCSIParallelMessage_TARGET_RESET = 0x0C +}; + +enum +{ + kSCSIParallelTaskControllerIDQueueHead = 0 +}; + +// Notifications +enum +{ + kSCSIControllerNotificationBusReset = 0x68000000 +}; + +// Forward declaration for the internally used Parallel Device object. +class IOSCSIParallelInterfaceDevice; + +// This is the identifier that is used to specify a given parallel Task. +typedef OSObject * SCSIParallelTaskIdentifier; + + +//----------------------------------------------------------------------------- +// Class Declarations +//----------------------------------------------------------------------------- + +/*! @class IOSCSIParallelInterfaceController + @abstract Class that represents a SCSI Host Bus Adapter. + @discussion Class that represents a SCSI Host Bus Adapter. +*/ +class IOSCSIParallelInterfaceController : public IOService +{ + + OSDeclareAbstractStructors ( IOSCSIParallelInterfaceController ) + +#if 0 +#pragma mark - +#pragma mark Client API +#endif + + +public: + + /*! + @function GetSCSIParallelTask + @abstract Method to allow the client to get a SCSIParallelTask + @discussion Get a SCSIParallelTask from the controller so that a request + can be issued to the HBA driver. + @param blockForCommand If the blockForCommand parameter is set to false + and there are no free SCSIParallelTasks, this method will return NULL, + otherwise it will wait for one to become available before returning. + @result If there is a SCSI Parallel Task available, a reference to it + will be returned. + */ + + SCSIParallelTaskIdentifier GetSCSIParallelTask ( bool blockForCommand ); + + /*! + @function FreeSCSIParallelTask + @abstract Method to allow the client to release a SCSIParallelTask + @discussion The FreeSCSIParallelTask method is called by the client when + a SCSIParallelTask has been completed and the associated returnTask + needs to be returned to the pool. + @param returnTask is a reference to the SCSIParallelTaskIdentifier to be + returned. + */ + + void FreeSCSIParallelTask ( SCSIParallelTaskIdentifier returnTask ); + + /*! + @function FindTaskForAddress + @abstract Find a task for a given Task Address, if one exists. + @discussion If a valid Tagged Task Identifier is specified, this method + will return the task specified by the Tagged Task Address if one is + found, or else NULL will be returned. If zero is used as the Tagged + Task Identifier, then this routine will search for an outstanding task + based on the Untagged Task Address and return the task or else, if one + is not found, return NULL. + @param theT is the Target component of the I_T_L or I_T_L_Q nexus. + @param theL is the Logical Unit component of the I_T_L or I_T_L_Q nexus. + @param theQ is the Queue Tag component of the I_T_L_Q nexus. If this is + an I_T_L nexus, then the kSCSIUntaggedTaskIdentifier constant should be + used for theQ. + @result returns a valid SCSIParallelTaskIdentifier or NULL if none + found. + */ + + SCSIParallelTaskIdentifier FindTaskForAddress ( + SCSIDeviceIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ ); + + + /*! + @function FindTaskForControllerIdentifier + @abstract Find a task for a given Target and Controller Task Identifier + @discussion Allows the controller child class to find an outstanding task + for a specified target and controller task identifier + @param theTarget is the Target that the task . + @param theIdentifier is the controller task identifier set using the SCSI + Parallel Task's SetControllerTaskIdentifier() method. + @result returns a valid SCSIParallelTaskIdentifier or NULL if none + found. + */ + + SCSIParallelTaskIdentifier FindTaskForControllerIdentifier ( + SCSIDeviceIdentifier theTarget, + UInt64 theIdentifier ); + + + /*! + @function ExecuteParallelTask + @abstract Submit a SCSIParallelTask for execution. + @discussion The ExecuteParallelTask call is made by the client to submit + a SCSIParallelTask for execution. + @param parallelRequest is a reference to the SCSIParallelTaskIdentifier + to be executed. + @result is an appropriate SCSIServiceResponse which are defined in the + file <IOKit/scsi/SCSITask.h>. + */ + + SCSIServiceResponse ExecuteParallelTask ( + SCSIParallelTaskIdentifier parallelRequest ); + + // --- Public API methods provided by HBA child classes ---- + + /*! + @function ReportHBAHighestLogicalUnitNumber + @abstract Gets the Highest Logical Unit Number. + @discussion This method is used to query the HBA child class to + determine what the highest Logical Unit Number that the controller can + address. + @result returns a valid 64-bit logical unit number. + */ + + virtual SCSILogicalUnitNumber ReportHBAHighestLogicalUnitNumber ( void ) = 0; + + /*! + @function DoesHBASupportSCSIParallelFeature + @abstract Queries the HBA child class to determine if it supports a + specific SPI feature. + @discussion Queries the HBA child class to determine if it supports the + specified feature as defined by the SCSI Parallel Interconnect + specifications. + @result Returns true if requested feature is supported. + */ + + virtual bool DoesHBASupportSCSIParallelFeature ( + SCSIParallelFeature theFeature ) = 0; + + /*! + @function InitializeTargetForID + @abstract Called to initialize a target device. + @discussion This method will be called to initialize a target device in + a single-threaded manner. The HBA can use this method to probe the + target or do anything else necessary before the device object is + registered with IOKit for matching. + @result Returns true if the target was successfully initialized. + */ + + virtual bool InitializeTargetForID ( + SCSITargetIdentifier targetID ) = 0; + + // The SCSI Task Management Functions as defined in the SCSI Architecture + // Model - 2 (SAM-2) specification. These are used by the client to request + // the specified function. The controller can complete these immmediately + // by returning the appropriate SCSIServiceResponse, or these can be completed + // asyncronously by the controller returning a SCSIServiceResponse of + // kSCSIServiceResponse_Request_In_Process and then calling the appropriate + // function complete member routine listed in the child class API section. + + virtual SCSIServiceResponse AbortTaskRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ ) = 0; + + virtual SCSIServiceResponse AbortTaskSetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse ClearACARequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse ClearTaskSetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse LogicalUnitResetRequest ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL ) = 0; + + virtual SCSIServiceResponse TargetResetRequest ( + SCSITargetIdentifier theT ) = 0; + + + + /*! + @function DoesHBAPerformAutoSense + @abstract Queries the HBA child class to determine if it automatically + performs AutoSense and provides AutoSense data for each I/O. If the HBA + allocates space for AutoSense in its HBA specific data region on a per + task basis, the HBA should respond true. + @discussion Queries the HBA child class to determine if it automatically + performs AutoSense and provides AutoSense data for each I/O. If the HBA + allocates space for AutoSense in its HBA specific data region on a per + task basis, the HBA should respond true. + @result Return true if HBA performs AutoSense into its own private data + buffer. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 1 ); + + virtual bool DoesHBAPerformAutoSense ( void ); + + /*! + @function ReportHBAConstraints + @abstract Called to report the I/O constraints for this controller. + A list of valid keys includes: + kIOMaximumSegmentCountReadKey, (required) + kIOMaximumSegmentCountWriteKey, (required) + kIOMaximumSegmentByteCountReadKey, (required) + kIOMaximumSegmentByteCountWriteKey, (required) + kIOMinimumSegmentAlignmentByteCountKey, (required) + kIOMaximumSegmentAddressableBitCountKey, (required) + kIOMinimumHBADataAlignmentMaskKey (required). + NB: These keys and their values are described in this header and <IOKit/IOKitKeys.h> + @param constraints. An OSDictionary object used to aggregate the key/value pairs. + Subclasses must set the required keys if they override this method. If a subclass does + not provide the required keys, the system will panic. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 2 ); + + virtual void ReportHBAConstraints ( OSDictionary * constraints ); + + // Padding for the Client API + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 3 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 4 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 5 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 6 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 7 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 8 ); + + +#if 0 +#pragma mark - +#pragma mark Child Class API +#endif + + +protected: + + // ---- Target Creation and Destruction methods --- + + /*! + @function CreateTargetForID + @abstract Method to perform device creation. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; + otherwise, the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device creation and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + @result returns true if successful. + */ + + bool CreateTargetForID ( SCSIDeviceIdentifier targetID ); + + /*! + @function CreateTargetForID + @abstract Method to perform device creation. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; + otherwise, the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device creation and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + @param properties A dictionary of properties to associate with the device + upon creation. The list of valid property keys is as follows: + kIOPropertySASAddressKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + These keys are defined in + <IOKit/storage/IOStorageProtocolCharacteristics.h> and the values + associated with these keys must be of the proper type/size, + or the target creation will not succeed. + @result returns true if successful. + */ + + bool CreateTargetForID ( SCSIDeviceIdentifier targetID, + OSDictionary * properties ); + + /*! + @function DestroyTargetForID + @abstract Method to perform device destruction. + @discussion For HBA child classes that report true to the + DoesHBAPerformDeviceManagement() method, the child class will be + responsible for all device management by using these methods; otherwise, + the superclass will be responsible for all device management. + This method must be used to perform SCSI Parallel Device destruction and + cannot be overridden. + @param targetID SCSIDeviceIdentifier of desired targetID. + */ + + void DestroyTargetForID ( SCSIDeviceIdentifier targetID ); + + /*! + @function GetTargetForID + @abstract Accessor for getting pointer to IOSCSIParallelInterfaceDevice. + @param targetID SCSIDeviceIdentifier of desired targetID. + @result returns pointer to IOSCSIParallelInterfaceDevice or NULL if not + found. + */ + + IOSCSIParallelInterfaceDevice * GetTargetForID ( + SCSIDeviceIdentifier targetID ); + + /*! + @function SetTargetProperty + @abstract Accessor for setting a property for a specific target. + @param device A pointer to a valid IOSCSIParallelInterfaceDevice. + @param key A pointer to a valid OSString object which represents the key. + A list of valid keys includes: + kIOPropertySASAddressKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + NB: These keys and their values are described in <IOKit/storage/IOStorageProtocolCharacteristics.h> + @param value Pointer to an OSObject (one of type OSData, OSString, etc.) + which represents the value for the property. The value must be of the proper type + and size for the specified key. + @result returns true if identifier was properly set, otherwise false. + */ + + bool SetTargetProperty ( SCSIDeviceIdentifier targetID, + const char * key, + OSObject * value ); + + /*! + @function RemoveTargetProperty + @abstract Accessor for removing a property from a specific target. + @param device A pointer to a valid IOSCSIParallelInterfaceDevice. + @param key A pointer to a valid OSString object which represents the key. + */ + + void RemoveTargetProperty ( SCSIDeviceIdentifier targetID, + const char * key ); + + // ---- Methods for HBA specifics. ---- + + /*! + @function SetHBAProperty + @abstract Accessor for setting a property for this object. + @param key A pointer to a valid OSString object which represents the key. + A list of valid keys includes: + kIOPropertyVendorNameKey, + kIOPropertyProductNameKey, + kIOPropertyProductRevisionLevelKey, + kIOPropertyPortDescriptionKey, + kIOPropertyPortSpeedKey, + kIOPropertyPortTopologyKey, + kIOPropertySCSIParallelSignalingTypeKey, + kIOPropertyFibreChannelCableDescriptionKey, + kIOPropertyFibreChannelNodeWorldWideNameKey, + kIOPropertyFibreChannelPortWorldWideNameKey, + kIOPropertyFibreChannelAddressIdentifierKey, and + kIOPropertyFibreChannelALPAKey. + NB: These keys and their values are described in <IOKit/storage/IOStorageDeviceCharacteristics.h> + and <IOKit/storage/IOStorageProtocolCharacteristics.h> + @param value Pointer to an OSObject (one of type OSData, OSString, etc.) + which represents the value for the property. The value must be of the proper type, + and/or size for the specified key. + @result returns true if identifier was properly set, otherwise false. + */ + + bool SetHBAProperty ( const char * key, + OSObject * value ); + + /*! + @function RemoveHBAProperty + @abstract Accessor for removing a property for this object. + @param key A pointer to a valid OSString object which represents the key. + See the SetHBAProperty() method for a list of valid keys. + */ + + void RemoveHBAProperty ( const char * key ); + + // These methods will not be called before the InitializeController() call, + // and will not be called after the TerminateController() call. But in the + // interval between those calls, they shall report the correct requested + // information. They are implemented as seperate pure virtual methods + // instead of a selector driven method because the HBA child class is + // required to report this information. + + /*! + @function ReportInitiatorIdentifier + @abstract Get the SCSI Device Identifier for the HBA. + @discussion This method will be called to determine the SCSI Device + Identifier that the Initiator has assigned for this HBA. + @result returns SCSIInitiatorIdentifier. + */ + + virtual SCSIInitiatorIdentifier ReportInitiatorIdentifier ( void ) = 0; + + /*! + @function ReportHighestSupportedDeviceID + @abstract Get the highest supported SCSI Device Identifier. + @discussion This method will be called to determine the value of the + highest SCSI Device Identifier supported by the HBA. This value will be + used to determine the last ID to process. + @result returns highest SCSIDeviceIdentifier + */ + + virtual SCSIDeviceIdentifier ReportHighestSupportedDeviceID ( void ) = 0; + + /*! + @function ReportMaximumTaskCount + @abstract Report Maximum Task Count + @discussion This method will be called to retrieve the maximum number of + outstanding tasks the HBA can process. This number must be greater than + zero or the controller driver will fail to match and load. + @result returns maximum (non-zero) task count. + */ + + virtual UInt32 ReportMaximumTaskCount ( void ) = 0; + + /*! + @function ReportHBASpecificTaskDataSize + @abstract Determine memory needed for HBA Task specific use. + @discussion This method is used to retrieve the amount of memory that + will be allocated in the SCSI Parallel Task for HBA specific use. + @result returns memory required in bytes + */ + + virtual UInt32 ReportHBASpecificTaskDataSize ( void ) = 0; + + /*! + @function ReportHBASpecificDeviceDataSize + @abstract Determine memory needed for HBA Device specific use. + @discussion This method is used to retrieve the amount of memory that + will be allocated in the SCSI Parallel Device for HBA specific use. + @result returns memory required in bytes + */ + + virtual UInt32 ReportHBASpecificDeviceDataSize ( void ) = 0; + + /*! + @function DoesHBAPerformDeviceManagement + @abstract Determine if HBA will manage devices. + @discussion This method is used to determine if the HBA will manage + target device creation and destruction. + @result return true means objects for target devices will only be + created when the child class calls the CreateTargetForID method. + */ + + virtual bool DoesHBAPerformDeviceManagement ( void ) = 0; + + // ---- Initialize and Terminate methods for the subclass to implement ----- + // The subclass shall not override the IOKit init and terminate methods, + // but shall instead rely on these methods for initialization and + // termination. + + // This is done to allow for this superclass to manage all IOKit specifics + // and to require only a Family specific API to be implemented by the + // subclass drivers. + + /*! + @function InitializeController + @abstract Called to initialize the controller + @discussion It is guaranteed that the InitializeController() will only be + called once per instantiation. The InitializeController() methods allows + the subclass driver to do all the necessary initialization required by + the hardware before it is able to accept requests to execute. All + necessary allocation of resources should be made during this method + call. This is the first method that will be called in the subclass. + @result return true means that initialization was successful. + */ + + virtual bool InitializeController ( void ) = 0; + + /*! + @function TerminateController + @abstract Called to terminate the controller + @discussion It is guaranteed that the TerminateController() will only be + called once and only after the InitializeController() method and only if + true was returned in response to the InitializeController() method. + The TerminateController() method allows the subclass to release all + resources that were acquired for operation of the hardware and shutdown + all hardware services. + This is the last method of the subclass that will be called before the + class is destroyed. + */ + + virtual void TerminateController ( void ) = 0; + + // ---- Start and Stop methods for the subclass ---- + + /*! + @function StartController + @abstract Called to start the controller + @discussion The StartController will always be called before any + requests are sent to the driver for execution. This method is called + after an initialize to start the services provided by the specific HBA + driver or called after a StopController call to restart those services. + After this call completes, all services provided by the HBA driver are + available to the client. + @result return true means that start was successful. + */ + + virtual bool StartController ( void ) = 0; + + /*! + @function StopController + @abstract Called to stop the controller + @discussion The StopController method will be called any time that the + system wants the card to stop accepting requests. ( See StartController + discussion ). The subclass should disable the hardware interrupt for + the particular controller (if possible) in this method. + */ + + virtual void StopController ( void ) = 0; + + // ---- Suspend and Resume Methods for the subclass ---- + + /*! + @function SuspendServices + @abstract Called to suspend controller services + @discussion Method will be called when the system wants to suspend the + services that are provided by the HBA driver. This call is not a reset + and the driver shall retain all state data between this so that if a + ResumeServices call is received, the driver can continue providing + services without a visible difference to the client. The driver may + receive multiple SuspendServices calls without receiving a + ResumeServices call and should ignore any after the first until a + ResumeServices call is received. + */ + + virtual void SuspendServices ( void ); + + /*! + @function ResumeServices + @abstract Called to resume controller services + @discussion Method that will be called to resume services + provided by the driver. ( See SuspendServices discussion ) + */ + + virtual void ResumeServices ( void ); + + /*! + @function HandleInterruptRequest + @abstract Handle Interrupt Request + @discussion The HandleInterruptRequest is used to notify an HBA + specific subclass that an interrupt request needs to be serviced. It is + called on the workloop (it holds the gate) at secondary interrupt level. + */ + + virtual void HandleInterruptRequest ( void ) = 0; + + /*! + @function EnableInterrupt + @abstract Enable Interrupt + @discussion Method that the HBA child class can call to enable + the associated IOInterruptEventSource. + */ + + void EnableInterrupt ( void ); + + /*! + @function DisableInterrupt + @abstract Disable Interrupt + @discussion Method that the HBA child class can call to disable + the associated IOInterruptEventSource. + */ + + void DisableInterrupt ( void ); + + /*! + @function SignalInterrupt + @abstract Signals that an interrupt has occurred. + @discussion Subclasses of IOSCSIParallelInterfaceController + should call this method in order to get the secondary interrupt + thread scheduled if and only if they will be returning false from + their overriden FilterInterruptRequest() method. See the + discussion for the FilterInterruptRequest() method for more + details. + + NOTE: This method should only be called from within the + FilterInterruptRequest() method and at no other time. + + Available in 10.3.3 or later. + + */ + + void SignalInterrupt ( void ); + + /*! + @function ProcessParallelTask + @abstract Called by client to process a parallel task. + @discussion This method is called to process a parallel task (i.e. put + the command on the bus). The HBA specific sublcass must implement this + method. + @param parallelRequest A valid SCSIParallelTaskIdentifier. + @result serviceResponse (see <IOKit/scsi/SCSITask.h>) + */ + + virtual SCSIServiceResponse ProcessParallelTask ( + SCSIParallelTaskIdentifier parallelRequest ) = 0; + + /*! + @function CompleteParallelTask + @abstract Parallel Task Completion + @discussion The HBA specific sublcass inherits the CompleteParallelTask() + method which shall be called when the HBA has completed the processing + of a parallel task. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param completionStatus The status of the SCSI bus. + @param serviceResponse (see <IOKit/scsi/SCSITask.h>) + */ + + void CompleteParallelTask ( + SCSIParallelTaskIdentifier parallelRequest, + SCSITaskStatus completionStatus, + SCSIServiceResponse serviceResponse ); + + + // Completion routines for the SCSI Task Management functions as described + // in the SCSI ArchitectureModel - 2 (SAM-2) specification. Each of these + // correspond to a client request for the specific Task Management functions. + // If the Controller Child Class completed the request by returning a + // SCSIServiceResponse of anything other than kSCSIServiceResponse_Request_In_Process, + // then the controller class does not need to call the completion member routine. + // If the controller did not complete the request immediately, then it will + // need to call the appropriate completion member routine listed here. + void CompleteAbortTask ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSITaggedTaskIdentifier theQ, + SCSIServiceResponse serviceResponse ); + + void CompleteAbortTaskSet ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteClearACA ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteClearTaskSet ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteLogicalUnitReset ( + SCSITargetIdentifier theT, + SCSILogicalUnitNumber theL, + SCSIServiceResponse serviceResponse ); + + void CompleteTargetReset ( + SCSITargetIdentifier theT, + SCSIServiceResponse serviceResponse ); + + /*! + @function NotifyClientsOfBusReset + @abstract Method called to notify clients that a bus reset has occurred. + @discussion This method is used by the HBA child class to inform the + parent class and any clients that a bus reset has occurred. + */ + + void NotifyClientsOfBusReset ( void ); + + /*! + @function NotifyClientsOfPortStatusChange + @abstract Method called to notify clients of port status change events. + @discussion This method is used by the HBA child class to inform the + parent class and any clients that a port has changed status. + */ + + void NotifyClientsOfPortStatusChange ( SCSIPortStatus newStatus ); + + /*! + @function GetSCSIDomainIdentifier + @abstract Accessor method to get the SCSI Domain Identifier. + @discussion Accessor method to get the SCSI Domain Identifier. + @result returns SCSI Domain Identifier. + */ + + SInt32 GetSCSIDomainIdentifier ( void ); + + /*! + @function GetProvider + @abstract Accessor method to get the IOService which is the controller's + provider. + @discussion Accessor method to get the IOService which is the + controller's provider. + @result returns pointer to IOService. + */ + + IOService * GetProvider ( void ); + + /*! + @function GetWorkLoop + @abstract Accessor method to get the IOWorkLoop associated with this + HBA. + @discussion Accessor method to get the IOWorkLoop associated with this + HBA. + @result returns pointer to IOWorkLoop. + */ + + IOWorkLoop * GetWorkLoop ( void ) const; + + /*! + @function GetCommandGate + @abstract Accessor to get an IOCommandGate associated with the workloop. + @discussion Accessor to get an IOCommandGate associated with the + workloop. + @result returns pointer to IOCommandGate. + */ + + IOCommandGate * GetCommandGate ( void ); + + // ---- SCSI Parallel Task Object Accessors ---- + + /*! + @function GetSCSITaskIdentifier + @abstract Method to retrieve a SCSITaskIdentifier from a valid + SCSIParallelTaskIdentifier. + @discussion Method to retrieve a SCSITaskIdentifier from a valid + SCSIParallelTaskIdentifier. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns SCSITaskIdentifier that represents the original request + from the SCSI Application Layer client. + */ + + SCSITaskIdentifier GetSCSITaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTargetIdentifier + @abstract Method to get the SCSITargetIdentifier associated with a + request. + @discussion Method to get the SCSITargetIdentifier associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns SCSITargetIdentifier + */ + + SCSITargetIdentifier GetTargetIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + // ---- Methods for Accessing data in the client's SCSI Task Object ---- + // Method to retrieve the LUN that identifies the Logical Unit whose Task + // Set to which this task is to be added. + + /*! + @function GetLogicalUnitNumber + @abstract Method to get the logical unit number associated with a + request. + @discussion Method to get the logical unit number associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns a valid 64-bit logical unit number. + */ + + SCSILogicalUnitNumber GetLogicalUnitNumber ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTaggedTaskIdentifier + @abstract Method to retrieve the SCSI Tagged Task Identifier of the + task. If the returned value is equal to kSCSIUntaggedTaskIdentifier, + then this task is untagged. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an SCSITaskAttribute value. + */ + + SCSITaggedTaskIdentifier GetTaggedTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTaskAttribute + @abstract Method to retrieve the SCSI Task Attribute of the task + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an SCSITaskAttribute value. + */ + + SCSITaskAttribute GetTaskAttribute ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetCommandDescriptorBlockSize + @abstract Method to retrieve the size of the SCSI Command Descriptor + Block (CDB). + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns the size of the SCSI Command Descriptor Block in bytes. + */ + + UInt8 GetCommandDescriptorBlockSize ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetCommandDescriptorBlock + @abstract Method to retrieve the SCSI Command Descriptor Block (CDB). + @discussion This will always return a 16 Byte CDB. If the Protocol Layer + driver does not support 16 Byte CDBs, it will have to create a local + SCSICommandDescriptorBlock variable to get the CDB data and then + transfer the needed bytes from there. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param cdbData is a SCSICommandDescriptorBlock pointer to 16 byte CDB + @result returns true if data was copied to cdbData pointer + */ + + bool GetCommandDescriptorBlock ( + SCSIParallelTaskIdentifier parallelTask, + SCSICommandDescriptorBlock * cdbData ); + + /*! + @function GetDataTransferDirection + @abstract Retrieves the data transfer direction for any data associated + with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result One of the valid data transfer directions described in + <IOKit/scsi/SCSITask.h> + */ + + UInt8 GetDataTransferDirection ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetRequestedDataTransferCount + @abstract Retrieves the requested data transfer count for any data + associated with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result The requested data transfer count in bytes. + */ + + UInt64 GetRequestedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetRealizedDataTransferCount + @abstract Retrieves the realized data transfer count for any data + associated with the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result The realized data transfer count in bytes. + */ + + UInt64 GetRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function SetRealizedDataTransferCount + @abstract Sets the realized data transfer count in bytes. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param realizedTransferCountInBytes is the number of bytes actually + transferred. + @result true means the data transfer count was successfully set. + */ + + bool SetRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 realizedTransferCountInBytes ); + + /*! + @function IncrementRealizedDataTransferCount + @abstract Increments the realized data transfer count. This method is + helpful for when the HBA has to do multiple passes of DMA because there + are more scatter-gather elements than it can process in one pass. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param realizedTransferCountInBytes is the number of bytes to add to the + realized data count for the task. + */ + + void IncrementRealizedDataTransferCount ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 realizedTransferCountInBytes ); + + /*! + @function GetDataBuffer + @abstract Method to retrieve client buffer from the request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IOMemoryDescriptor which represents the + buffer. + */ + + IOMemoryDescriptor * GetDataBuffer ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetDataBufferOffset + @abstract Method to retrieve offset into client buffer at which to start + processing. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns offset in bytes + */ + + UInt64 GetDataBufferOffset ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetDMACommand + @abstract Method to retrieve a pointer to an IODMACommand from the request. + @discussion For devices utilizing DMA, the IODMACommand object should be + obtained via GetDMACommand(). The subclass is responsible for calling prepare() + on the IODMACommand object using the proper offset obtained via GetDataBufferOffset() + and correct size obtained via GetRequestedDataTransferCount(). The subclass + is further responsible for calling complete() on the IODMACommand object once + all DMA operations have finished. + NB: Subclasses should not call IODMACommand::setMemoryDescriptor(). + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IODMACommand which is used in conjunction + with the task. + */ + + IODMACommand * GetDMACommand ( + SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetTimeoutDuration + @abstract Method to retrieve the timeout duration in milliseconds for a + request. + @discussion Method to retrieve the timeout duration in milliseconds for + a request. A value of zero represents an infinite timeout, or on + hardware where infinite timeouts are not possible, substitute the + longest timeout possible. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns timeout duration in milliseconds + */ + + UInt32 GetTimeoutDuration ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function SetAutoSenseData + @abstract Method to set the auto sense data buffer associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param newSensedata pointer to auto sense data buffer + @result returns true if data in newSenseData was succesfully into the + task object + */ + + bool SetAutoSenseData ( + SCSIParallelTaskIdentifier parallelTask, + SCSI_Sense_Data * newSenseData, + UInt8 senseDataSize ); + + /*! + @function GetAutoSenseData + @abstract Method to retrieve auto sense data buffer associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param receivingBuffer pointer to auto sense data buffer + @result returns true if successfully copied data into receivingBuffer + */ + + bool GetAutoSenseData ( + SCSIParallelTaskIdentifier parallelTask, + SCSI_Sense_Data * receivingBuffer, + UInt8 senseDataSize ); + + /*! + @function GetAutoSenseDataSize + @abstract Method to retrieve auto sense data buffer size associated with a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns Size of auto sense data buffer. + */ + + UInt8 GetAutoSenseDataSize ( + SCSIParallelTaskIdentifier parallelTask ); + + + /*! + @function GetSCSIParallelFeatureNegotiation + @abstract Method to retrieve the requested value for negotiation of the. + @discussion Query as to whether the SCSI Parallel Device object has + negotiated wide data transfers. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result A valid SCSIParallelFeatureControl. + */ + + SCSIParallelFeatureRequest GetSCSIParallelFeatureNegotiation ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature ); + + /*! + @function GetSCSIParallelFeatureNegotiationCount + @abstract Method to retrieve the number of requested negotiations. + @discussion Query as to the number of SCSI Parallel Features that are + requested to either be negotitated or cleared. These are all features + that are set to either kSCSIParallelFeature_AttemptNegotiation or + kSCSIParallelFeature_ClearNegotiation. If the return value is zero, + then all features are set to kSCSIParallelFeature_NoNegotiation + and all feature negotiations are to remain as they currently exist. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an unsigned integer up to 64 bits in size. + */ + + UInt64 GetSCSIParallelFeatureNegotiationCount ( + SCSIParallelTaskIdentifier parallelTask); + + /*! + @function SetSCSIParallelFeatureNegotiationResult + @abstract Method to set the wide data transfer negotiation result. + @discussion Method to set the wide data transfer negotiation result. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param requestedFeature The SCSIParallelFeature that the has been set to + newResult. + @param newResult A valid SCSIParallelFeatureResult value. + */ + + void SetSCSIParallelFeatureNegotiationResult ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature, + SCSIParallelFeatureResult newResult ); + + /*! + @function GetSCSIParallelFeatureNegotiationResult + @abstract Method to retrieve the result of any wide transfer + negotiations. + @discussion Query as to whether the SCSI Parallel Controller object has + negotiated wide data transfers. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result A valid SCSIParallelFeatureResult. + */ + + SCSIParallelFeatureResult GetSCSIParallelFeatureNegotiationResult ( + SCSIParallelTaskIdentifier parallelTask, + SCSIParallelFeature requestedFeature ); + + /*! + @function GetSCSIParallelFeatureNegotiationResultCount + @abstract Method to retrieve the number of changed negotiations. + @discussion Query as to the number of SCSI Parallel Features that have + been changed to either negotitated or cleared. These are all features + that are set to either kSCSIParallelFeature_NegotitiationCleared or + kSCSIParallelFeature_NegotitiationSuccess. If the return value is zero, + then all features are set to kSCSIParallelFeature_NegotitiationUnchanged. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result an unsigned integer up to 64 bits in size. + */ + + UInt64 GetSCSIParallelFeatureNegotiationResultCount ( + SCSIParallelTaskIdentifier parallelTask); + + // Controller Task Identifier related member routines + + /*! + @function SetControllerTaskIdentifier + @abstract Method to set the Controller Task Identifier. + @discussion This method allows the Controller Child Class + driver to set a unique identifier to associate with the specified + SCSI Parallel Task. This identifier is designed to be used by + controllers that do not have access to the LUN and Tag information + when notified by the HBA that a request has completed. + If the kSCSIParallelTaskControllerIDQueueHead is used, this + member routine will return the first Task on the queue. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param newIdentifier unsigned 64 bit integer token. + @result none + */ + + void SetControllerTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask, + UInt64 newIdentifier ); + + UInt64 GetControllerTaskIdentifier ( + SCSIParallelTaskIdentifier parallelTask); + + + // The HBA Data related fields + + /*! + @function GetHBADataSize + @abstract Method to retrieve the HBA Data Size in bytes. + @discussion Method to retrieve the HBA Data Size in bytes. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns HBA Data size in bytes. + */ + + UInt32 GetHBADataSize ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetHBADataPointer + @abstract Method to retrieve the HBA Data pointer. + @discussion Method to retrieve the HBA Data pointer. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to buffer for HBA specific data, NULL if + none found or GetHBADataSize() returns zero. + */ + + void * GetHBADataPointer ( SCSIParallelTaskIdentifier parallelTask ); + + /*! + @function GetHBADataDescriptor + @abstract Method to retrieve the IOMemoryDescriptor associated with + the HBA Data. + @discussion Method to retrieve the IOMemoryDescriptor associated with + the HBA Data. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @result returns pointer to an IOMemoryDescriptor that wraps the HBA + specific data buffer, NULL if none found or GetHBADataSize() returns zero. + */ + + IOMemoryDescriptor * GetHBADataDescriptor ( + SCSIParallelTaskIdentifier parallelTask ); + + // ---- SCSI Parallel Device Object Accessors ---- + + // The HBA Data related fields + + /*! + @function GetHBATargetDataSize + @abstract Method to retrieve the HBA Data Size in bytes. + @discussion Method to retrieve the HBA Data Size in bytes. + @param targetDevice A valid SCSITargetIdentifier. + @result returns HBA Data size in bytes. + */ + + UInt32 GetHBATargetDataSize ( SCSITargetIdentifier targetID ); + + /*! + @function GetHBATargetDataPointer + @abstract Method to retrieve the HBA Data pointer. + @discussion Method to retrieve the HBA Data pointer. + @param targetDevice A valid SCSITargetIdentifier. + @result returns pointer to buffer for HBA specific data, NULL if + none found or GetHBADataSize is zero. + */ + + void * GetHBATargetDataPointer ( SCSITargetIdentifier targetID ); + + +#if 0 +#pragma mark - +#pragma mark Additional Child Class APIs +#endif + + + // ---- Timeout Related Methods ---- + + /*! + @function SetTimeoutForTask + @abstract Method to set the timeout duration in milliseconds for a + request. + @discussion Method to set the timeout duration in milliseconds for a + request. + @param parallelTask A valid SCSIParallelTaskIdentifier. + @param timeoutOverride A timeout value in milliseconds in case the + HBA driver wishes to override the default value provided in the + parallelTask. + */ + + void SetTimeoutForTask ( SCSIParallelTaskIdentifier parallelTask, + UInt32 timeoutOverride = 0 ); + + /*! + @function HandleTimeout + @abstract Method to handle command timeouts. + @discussion Method to handle command timeouts. This should + be overridden by the child class in order to clean up HBA + specific structures after a timeout has occurred. This method + is called on the workloop (it holds the gate). + @param parallelRequest A valid SCSIParallelTaskIdentifier. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 9 ); + + virtual void HandleTimeout ( + SCSIParallelTaskIdentifier parallelRequest ); + + + // ---- Filter Interrupt ---- + + /*! + @function FilterInterruptRequest + @abstract Filter method called at primary interrupt time. + @discussion Filter method called at primary interrupt time. + This should only be overridden by the child class in order + to determine if an interrupt occurred for this controller instance. + Since all work occurs at primary interrupt time, this routine + should be quick and efficient and defer as much processing as + possible to the HandleInterruptRequest() method. + + NOTE: Unlike the HandleInterruptRequest() and HandleTimeout() + methods, FilterInterruptRequest() is NOT called with the + workloop lock held. + + If the value returned by FilterInterruptRequest() is true, the + secondary interrupt thread will be scheduled and the hardware + interrupt line will be disabled. If the controller instance shares + that interrupt line with other devices, it can cause large + interrupt latencies. If the controller instance can disable the + interrupt in the chip itself, the following can be done to reduce + interrupt latencies: + + - Interrupt occurs + - FilterInterruptRequest() method is called. + - If the interrupt is not for this controller, return false + immediately. + - If the interrupt is for this controller, and the controller + can disable interrupts for this chip, the controller should + disable the interrupts for this chip, call SignalInterrupt(), + and return false. This causes the secondary interrupt thread + to get scheduled, yet does not disable the interrupt line for + all devices tied to that interrupt. This effectively allows + other devices to process their interrrupts, thus reducing + interrupt latency for those devices. + - HandleInterruptRequest() method is called. + - Controller processes interrupt and completes I/O requests. + - Controller re-enables interrupts for the device. + + NOTE: If you use this approach, the interrupting condition MUST be + cleared from the hardware, otherwise an infinite process interrupt + loop will occur. + + If the controller cannot disable interrupts on the chip, it should + simply return true if an interrupt has occurred for its device. + + @result True if the hardware interrupt line should be disabled, + otherwise false. + */ + + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 10 ); + + virtual bool FilterInterruptRequest ( void ); + + /*! + @function InitializeDMASpecification + @abstract Called to initialize an IODMACommand with a DMA specification. + @param command A pointer to a valid IODMACommand object. Subclasses + should override this method and call IODMACommand::initWithSpecification() + supplying the proper arguments to that method based on the DMA strategy. + @result boolean value indicating success or failure. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 11 ); + + virtual bool InitializeDMASpecification ( IODMACommand * command ); + + /*! + @function CreateDeviceInterrupt + @abstract Called to create an IOInterruptEventSource for the device. Subclasses + may wish to use a different interrupt index than 0 (e.g. for using PCI Message + Signaled Interrupts) or might not need an interrupt at all (virtual HBA). + @param action A pointer to the action routine that should be passed to either + IOInterruptEventSource::interruptEventSource() or + IOFilterInterruptEventSource::filterInterruptEventSource as the method to call + when an interrupt occurs for the device (sometimes called the "deferred procedure call" + or the "secondary context method". By passing this routine along, it will + properly wire up the HandleInterruptRequest() method you should override to handle + interrupts. + @param filter A pointer to the filter routine that should be passed to + IOFilterInterruptEventSource::filterInterruptEventSource as the method to call + at primary interrupt time when an interrupt occurs for the device. + By passing this routine along, it will properly wire up the + FilterInterruptRequest() method you may override to handle primary interrupts. + @result IOInterruptEventSource. May return NULL if and only if there is no + hardware interrupt associated with this device. + */ + OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 12 ); + + virtual IOInterruptEventSource * CreateDeviceInterrupt ( + IOInterruptEventSource::Action action, + IOFilterInterruptEventSource::Filter filter, + IOService * provider ); + + // Padding for the Child Class API + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 13 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 14 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 15 ); + OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 16 ); + + +#if 0 +#pragma mark - +#pragma mark Internal Use Only +#endif + +private: + + // binary compatibility instance variable expansion + struct ExpansionData { }; + ExpansionData * fIOSCSIParallelInterfaceControllerExpansionData; + + IOService * fProvider; + OSSet * fClients; + + static SInt32 fSCSIParallelDomainCount; + SInt32 fSCSIDomainIdentifier; + + // The HBA attributes + SCSIInitiatorIdentifier fInitiatorIdentifier; + + // The maximum SCSI Device Identifier support by the HBA + // This is retreived from the child class via the + SCSIDeviceIdentifier fHighestSupportedDeviceID; + + // The total number of tasks that the HBA can proccess at a time. + // This is retrieved from the child class via ReportMaximumTaskCount + UInt32 fSupportedTaskCount; + + // The Number of requests that are currently outstanding for the current + // instantiation. + UInt16 fOutstandingRequests; + + // The member variable to indicate if the current instantiation has been + // succesfully intialized. + bool fHBAHasBeenInitialized; + + // The member variable to indicate if the current instantiation is running. + // A true means that the last or only Start call made was successful. A + // false value means that either a successful Start has not been made or a + // Stop call has been made. + bool fHBACanAcceptClientRequests; + + // The pool for the available SCSI Parallel Task objects + IOCommandPool * fParallelTaskPool; + + // WorkLoop variables + IOWorkLoop * fWorkLoop; + IOTimerEventSource * fTimerEvent; + IOInterruptEventSource * fDispatchEvent; + + IOCommandGate * fControllerGate; + + bool AllocateSCSIParallelTasks ( void ); + void DeallocateSCSIParallelTasks ( void ); + + IOWorkLoop * getWorkLoop ( void ) const; + bool CreateWorkLoop ( IOService * provider ); + void ReleaseWorkLoop ( void ); + + // SCSI Parallel Device List + // The SCSI Parallel Device List will consist of 16 elements to represent + // identifiers that end in 0h through Fh. Each array element will point + // to a device object that represents the beginning of a linked list of + // device objects. By using an array of linked lists, the traversal time + // to find an object on a bus that supports a large number of devices, such + // as Fibre Channel, will be significantly lower than having to walk a list + // that is comprised of all devices on the bus. For parallel wide and + // narrow busses, which support 16 and 8 devices respectively, this will act + // like a simple array of device objects. + enum + { + kSCSIParallelDeviceListArrayCount = 16, + kSCSIParallelDeviceListIndexMask = 0x0F + }; + + IOSimpleLock * fDeviceLock; + IOSCSIParallelInterfaceDevice * + fParallelDeviceList[kSCSIParallelDeviceListArrayCount]; + + void InitializeDeviceList ( void ); + void AddDeviceToTargetList ( + IOSCSIParallelInterfaceDevice * newDevice ); + void RemoveDeviceFromTargetList ( + IOSCSIParallelInterfaceDevice * victimDevice ); + + // The Interrupt Service Routine for the controller. + static void ServiceInterrupt ( + OSObject * theObject, + IOInterruptEventSource * theSource, + int count ); + + static void TimeoutOccurred ( OSObject * owner, IOTimerEventSource * sender ); + + static bool FilterInterrupt ( + OSObject * theObject, + IOFilterInterruptEventSource * theSource ); + + // IOService support methods + // These shall not be overridden by the HBA child classes. + bool start ( IOService * provider ); + void stop ( IOService * provider ); + + +protected: + + // These may be overriden by the HBA child classes if necessary, but should + // call the superclass implementation. + virtual bool handleOpen ( + IOService * client, + IOOptionBits options, + void * arg ); + + virtual void handleClose ( + IOService * client, + IOOptionBits options ); + + virtual bool handleIsOpen ( + const IOService * client ) const; + + virtual bool willTerminate ( IOService * provider, IOOptionBits options ); + virtual bool didTerminate ( IOService * provider, IOOptionBits options, bool * defer ); + +}; + + +#endif /* __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ */ \ No newline at end of file diff --git a/i386/include/IOKit/serial/.svn/all-wcprops b/i386/include/IOKit/serial/.svn/all-wcprops new file mode 100644 index 0000000..3b99f03 --- /dev/null +++ b/i386/include/IOKit/serial/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/serial +END +IORS232SerialStreamSync.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/serial/IORS232SerialStreamSync.h +END +IOSerialDriverSync.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/serial/IOSerialDriverSync.h +END +IOSerialStreamSync.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/serial/IOSerialStreamSync.h +END +IOModemSerialStreamSync.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/serial/IOModemSerialStreamSync.h +END +IOSerialKeys.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/serial/IOSerialKeys.h +END diff --git a/i386/include/IOKit/serial/.svn/entries b/i386/include/IOKit/serial/.svn/entries new file mode 100644 index 0000000..45174e5 --- /dev/null +++ b/i386/include/IOKit/serial/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/serial +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IORS232SerialStreamSync.h +file + + + + +2013-08-27T23:54:12.000000Z +0c2a5b36af70b8a5fc48f9f984e42b8f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7628 + +IOSerialDriverSync.h +file + + + + +2013-08-27T23:54:12.000000Z +1de76939037928e06b59a471b77174ea +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3579 + +IOSerialStreamSync.h +file + + + + +2013-08-27T23:54:12.000000Z +91e7b9256b39f31244ba4cfa14404a6c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11947 + +IOModemSerialStreamSync.h +file + + + + +2013-08-27T23:54:12.000000Z +9ef1d5116b75c1c73a3ccb151f3eec13 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1425 + +IOSerialKeys.h +file + + + + +2013-08-27T23:54:12.000000Z +85af242f0159d91cac30a3e340bb7ffb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2856 + diff --git a/i386/include/IOKit/serial/.svn/text-base/IOModemSerialStreamSync.h.svn-base b/i386/include/IOKit/serial/.svn/text-base/IOModemSerialStreamSync.h.svn-base new file mode 100644 index 0000000..be75287 --- /dev/null +++ b/i386/include/IOKit/serial/.svn/text-base/IOModemSerialStreamSync.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOModemSerialStreamSync.h + * This file contains Modem specific extensions to the IOSerialStreamSync class. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +#ifndef _SERIAL_IOMODEMSERIALSTREAMSYNC_H +#define _SERIAL_IOMODEMSERIALSTREAMSYNC_H + +#include <IOKit/serial/IOSerialStreamSync.h> + +class IOModemSerialStreamSync : public IOSerialStreamSync +{ + OSDeclareDefaultStructors(IOModemSerialStreamSync) +}; + +#endif /* !_SERIAL_IOMODEMSERIALSTREAMSYNC_H */ + diff --git a/i386/include/IOKit/serial/.svn/text-base/IORS232SerialStreamSync.h.svn-base b/i386/include/IOKit/serial/.svn/text-base/IORS232SerialStreamSync.h.svn-base new file mode 100644 index 0000000..15d520a --- /dev/null +++ b/i386/include/IOKit/serial/.svn/text-base/IORS232SerialStreamSync.h.svn-base @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * IORS232SerialStreamSync.h + * This file contains RS232 specific extensions to the IOSerialStreamSync class. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + */ + +#ifndef _SERIAL_IORS232SERIALSTREAMSYNC_H +#define _SERIAL_IORS232SERIALSTREAMSYNC_H + +#include <sys/ioctl.h> +#include <IOKit/serial/IOSerialStreamSync.h> + +/* + * Extra events for RS232 based PortDevices + */ + +#define PD_RS232_E_RX_LINE_BREAK (PD_DATA_VOID|PD_OP(63)) // line break was received +#define PD_RS232_E_LINE_BREAK (PD_DATA_BYTE|PD_OP(62)) // BOOL set/clear line break + +#define PD_RS232_E_RX_STOP_BITS (PD_DATA_LONG|PD_OP(61)) // half stop bits +#define PD_RS232_E_STOP_BITS (PD_DATA_LONG|PD_OP(60)) // half stop bits + +#define PD_RS232_E_XON_BYTE (PD_DATA_BYTE|PD_OP(59)) // The XON char for TX&RX +#define PD_RS232_E_XOFF_BYTE (PD_DATA_BYTE|PD_OP(58)) // The XOFF char for TX&RX + +#define PD_RS232_E_MIN_LATENCY (PD_DATA_BYTE|PD_OP(57)) // BOOL true if low latency req + +/* + * RS232 Parity stuff, used with the DATA_INTEGRITY event + */ +#define PD_RS232_PARITY_DEFAULT 0 // Valid only for RX, means follow TX +#define PD_RS232_PARITY_NONE 1 // No Parity bit inserted or expected +#define PD_RS232_PARITY_ODD 2 // Odd Parity bit inserted or expected +#define PD_RS232_PARITY_EVEN 3 // Even Parity bit inserted or expected +#define PD_RS232_PARITY_MARK 4 // Mark inserted or expected +#define PD_RS232_PARITY_SPACE 5 // Space inserted or expected +#define PD_RS232_PARITY_ANY 6 // Valid only for RX, means discard parity + +/* + * RS232 Flow Control specifiers, used with the FLOW_CONTROL event + * NB. The XON character is set with FLOW_START_DATA + * and the XOFF character is set with FLOW_STOP_DATA. + * + * Signal Name Direction + * RFR Ready For Receive Output generated by UART + * RTS Ready To Send (alias of RFR) Output generated by UART + * CTS Clear To Send Input sensed by UART + * DTR Data Terminal Ready Output generated by UART + * DSR Data Set Ready Input sensed by UART + * TXO XON/XOFF/XANY protocol Characters received by UART + * RXO XON/XOFF protocol Characters transmitted by UART + * DCD Data Carrier Detect Input sensed by UART + */ + +/* + * RS232 State Word extensions, based on <bsd/sys/ioctl.h> + * Also the 'current state' bits for enq/deq of Flow Control event + */ +#define PD_RS232_S_MASK 0x0000ffffUL +#define PD_RS232_S_SHIFT 0 // to align State bits for enq/deq event +#define PD_RS232_D_MASK 0xffff0000UL +#define PD_RS232_D_SHIFT 16 // to align Delta bits for enq/deq event +#define PD_RS232_A_MASK 0x0000ffffUL +#define PD_RS232_A_SHIFT 0 // to align Auto bits for req/exec event +#define PD_RS232_N_MASK 0xffff0000UL +#define PD_RS232_N_SHIFT 16 // to align Notify bits for req/exec event + +#define PD_RS232_S_LE TIOCM_LE // line enable +#define PD_RS232_S_DTR TIOCM_DTR // data terminal ready +#define PD_RS232_S_RTS TIOCM_RTS // request to send +#define PD_RS232_S_RFR PD_RS232_S_RTS // ready for receive +#define PD_RS232_S_TXO TIOCM_ST // TX XON/XOFF +#define PD_RS232_S_RXO TIOCM_SR // RX XON/XOFF +#define PD_RS232_S_CTS TIOCM_CTS // clear to send +#define PD_RS232_S_CAR TIOCM_CAR // carrier detect +#define PD_RS232_S_DCD PD_RS232_S_CAR +#define PD_RS232_S_RNG TIOCM_RNG // ring +#define PD_RS232_S_RI PD_RS232_S_RNG +#define PD_RS232_S_DSR TIOCM_DSR // data set ready + +#define PD_RS232_S_BRK 0x00000800UL // break active Extension to TIOCM +#define PD_RS232_S_LOOP 0x00001000UL // LOOP back Extension to TIOCM +#define PD_RS232_S_TXQ 0x00002000UL // User flowcontrol bit +#define PD_RS232_S_RXQ 0x00004000UL // User flowcontrol bit + +// The 'delta' bits for enq/deq of Flow Control event +#define PD_RS232_D_LE (PD_RS232_S_LE << PD_RS232_D_SHIFT) +#define PD_RS232_D_DTR (PD_RS232_S_DTR << PD_RS232_D_SHIFT) +#define PD_RS232_D_RTS (PD_RS232_S_RTS << PD_RS232_D_SHIFT) +#define PD_RS232_D_RFR (PD_RS232_S_RFR << PD_RS232_D_SHIFT) +#define PD_RS232_D_TXO (PD_RS232_S_TXO << PD_RS232_D_SHIFT) +#define PD_RS232_D_RXO (PD_RS232_S_RXO << PD_RS232_D_SHIFT) +#define PD_RS232_D_CTS (PD_RS232_S_CTS << PD_RS232_D_SHIFT) +#define PD_RS232_D_CAR (PD_RS232_S_CAR << PD_RS232_D_SHIFT) +#define PD_RS232_D_DCD (PD_RS232_S_DCD << PD_RS232_D_SHIFT) +#define PD_RS232_D_RNG (PD_RS232_S_RNG << PD_RS232_D_SHIFT) +#define PD_RS232_D_RI (PD_RS232_S_RI << PD_RS232_D_SHIFT) +#define PD_RS232_D_DSR (PD_RS232_S_DSR << PD_RS232_D_SHIFT) + +#define PD_RS232_D_BRK (PD_RS232_S_BRK << PD_RS232_D_SHIFT) +#define PD_RS232_D_LOOP (PD_RS232_S_LOOP << PD_RS232_D_SHIFT) +#define PD_RS232_D_TXQ (PD_RS232_S_TXQ << PD_RS232_D_SHIFT) +#define PD_RS232_D_RXQ (PD_RS232_S_RXQ << PD_RS232_D_SHIFT) + +// The 'auto' bits for exec/req of Flow Control event +#define PD_RS232_A_LE PD_RS232_S_LE +#define PD_RS232_A_DTR PD_RS232_S_DTR +#define PD_RS232_A_RTS PD_RS232_S_RTS +#define PD_RS232_A_RFR PD_RS232_S_RFR +#define PD_RS232_A_TXO PD_RS232_S_TXO +#define PD_RS232_A_RXO PD_RS232_S_RXO +#define PD_RS232_A_CTS PD_RS232_S_CTS +#define PD_RS232_A_CAR PD_RS232_S_CAR +#define PD_RS232_A_DCD PD_RS232_S_DCD +#define PD_RS232_A_RNG PD_RS232_S_RNG +#define PD_RS232_A_RI PD_RS232_S_RI +#define PD_RS232_A_DSR PD_RS232_S_DSR +#define PD_RS232_A_XANY 0x00000400 // changes _A_TXO from XON/XOFF to XANY/XOFF +#define PD_RS232_A_BRK PD_RS232_S_BRK +#define PD_RS232_A_LOOP PD_RS232_S_LOOP +#define PD_RS232_A_TXQ PD_RS232_S_TXQ +#define PD_RS232_A_RXQ PD_RS232_S_RXQ + +// The 'notify' bits for exec/req of Flow Control event +#define PD_RS232_N_LE (PD_RS232_S_LE << PD_RS232_N_SHIFT) +#define PD_RS232_N_DTR (PD_RS232_S_DTR << PD_RS232_N_SHIFT) +#define PD_RS232_N_RTS (PD_RS232_S_RTS << PD_RS232_N_SHIFT) +#define PD_RS232_N_RFR (PD_RS232_S_RFR << PD_RS232_N_SHIFT) +#define PD_RS232_N_TXO (PD_RS232_S_TXO << PD_RS232_N_SHIFT) +#define PD_RS232_N_RXO (PD_RS232_S_RXO << PD_RS232_N_SHIFT) +#define PD_RS232_N_CTS (PD_RS232_S_CTS << PD_RS232_N_SHIFT) +#define PD_RS232_N_CAR (PD_RS232_S_CAR << PD_RS232_N_SHIFT) +#define PD_RS232_N_DCD (PD_RS232_S_DCD << PD_RS232_N_SHIFT) +#define PD_RS232_N_RNG (PD_RS232_S_RNG << PD_RS232_N_SHIFT) +#define PD_RS232_N_RI (PD_RS232_S_RI << PD_RS232_N_SHIFT) +#define PD_RS232_N_DSR (PD_RS232_S_DSR << PD_RS232_N_SHIFT) + +#define PD_RS232_N_BRK (PD_RS232_S_BRK << PD_RS232_N_SHIFT) +#define PD_RS232_N_LOOP (PD_RS232_S_LOOP << PD_RS232_N_SHIFT) +#define PD_RS232_N_TXQ (PD_RS232_S_TXQ << PD_RS232_N_SHIFT) +#define PD_RS232_N_RXQ (PD_RS232_S_RXQ << PD_RS232_N_SHIFT) + +class IORS232SerialStreamSync : public IOSerialStreamSync +{ + OSDeclareDefaultStructors(IORS232SerialStreamSync) +}; + +#endif /* !_SERIAL_IORS232SERIALSTREAMSYNC_H */ + diff --git a/i386/include/IOKit/serial/.svn/text-base/IOSerialDriverSync.h.svn-base b/i386/include/IOKit/serial/.svn/text-base/IOSerialDriverSync.h.svn-base new file mode 100644 index 0000000..92f69df --- /dev/null +++ b/i386/include/IOKit/serial/.svn/text-base/IOSerialDriverSync.h.svn-base @@ -0,0 +1,91 @@ +/* + *Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + *@APPLE_LICENSE_HEADER_START@ + * + *The contents of this file constitute Original Code as defined in and + *are subject to the Apple Public Source License Version 1.1 (the + *"License"). You may not use this file except in compliance with the + *License. Please obtain a copy of the License at + *http://www.apple.com/publicsource and read it before using this file. + * + *This Original Code and all software distributed under the License are + *distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + *EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + *INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + *License for the specific language governing rights and limitations + *under the License. + * + *@APPLE_LICENSE_HEADER_END@ + */ + +/* + * IOSerialDriverSync.h + * This file contains the abstract parent class for any IOSerialDriver + * interface, which is a generic serial interface, designed for devices + * that do character oriented transfers (async) rather than block or + * packet transfers. Most notably RS-232, Printer, Mouse, and Keyboard + * type devices. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + */ + +#ifndef _SERIAL_IOSERIALDRIVERSYNC_H +#define _SERIAL_IOSERIALDRIVERSYNC_H + +#include <IOKit/IOService.h> + +class IOSerialDriverSync : public IOService +{ + OSDeclareAbstractStructors(IOSerialDriverSync); + +public: + virtual IOReturn acquirePort(bool sleep, void *refCon) = 0; + + virtual IOReturn releasePort(void *refCon) = 0; + + virtual IOReturn setState(UInt32 state, UInt32 mask, void *refCon) = 0; + + virtual UInt32 getState(void *refCon) = 0; + + virtual IOReturn watchState(UInt32 *state, UInt32 mask, void *refCon) = 0; + + virtual UInt32 nextEvent(void *refCon) = 0; + + virtual IOReturn executeEvent(UInt32 event, UInt32 data, void *refCon) = 0; + + virtual IOReturn requestEvent(UInt32 event, UInt32 *data, void *refCon) = 0; + + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, + bool sleep, void *refCon) = 0; + + virtual IOReturn dequeueEvent(UInt32 *event, UInt32 *data, + bool sleep, void *refCon) = 0; + + virtual IOReturn enqueueData(UInt8 *buffer, UInt32 size, UInt32 *count, + bool sleep, void *refCon) = 0; + + virtual IOReturn dequeueData(UInt8 *buffer, UInt32 size, UInt32 *count, + UInt32 min, void *refCon) = 0; + +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 0); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 1); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 2); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 3); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 4); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 5); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 6); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 7); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 8); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 9); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 10); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 11); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 12); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 13); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 14); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 15); + +}; + +#endif /* !_SERIAL_IOSERIALDRIVERSYNC_H */ diff --git a/i386/include/IOKit/serial/.svn/text-base/IOSerialKeys.h.svn-base b/i386/include/IOKit/serial/.svn/text-base/IOSerialKeys.h.svn-base new file mode 100644 index 0000000..9538a24 --- /dev/null +++ b/i386/include/IOKit/serial/.svn/text-base/IOSerialKeys.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOSerialKeys.h + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +/* +Sample Matching dictionary +{ + IOProviderClass = kIOSerialBSDServiceValue; + kIOSerialBSDTypeKey = kIOSerialBSDAllTypes + | kIOSerialBSDModemType + | kIOSerialBSDRS232Type; + kIOTTYDeviceKey = <Raw Unique Device Name>; + kIOTTYBaseNameKey = <Raw Unique Device Name>; + kIOTTYSuffixKey = <Raw Unique Device Name>; + kIOCalloutDeviceKey = <Callout Device Name>; + kIODialinDeviceKey = <Dialin Device Name>; +} + +Note only the IOProviderClass is mandatory. The other keys allow the searcher to reduce the size of the set of matching devices. +*/ + +/* Service Matching That is the 'IOProviderClass' */ +#define kIOSerialBSDServiceValue "IOSerialBSDClient" + +/* Matching keys */ +#define kIOSerialBSDTypeKey "IOSerialBSDClientType" + +/* Currently possible kIOSerialBSDTypeKey values. */ +#define kIOSerialBSDAllTypes "IOSerialStream" +#define kIOSerialBSDModemType "IOModemSerialStream" +#define kIOSerialBSDRS232Type "IORS232SerialStream" + +// Properties that resolve to a /dev device node to open for +// a particular service +#define kIOTTYDeviceKey "IOTTYDevice" +#define kIOTTYBaseNameKey "IOTTYBaseName" +#define kIOTTYSuffixKey "IOTTYSuffix" + +#define kIOCalloutDeviceKey "IOCalloutDevice" +#define kIODialinDeviceKey "IODialinDevice" + +// Property 'ioctl' wait for the tty device to go idle. +#define kIOTTYWaitForIdleKey "IOTTYWaitForIdle" + +#if KERNEL +extern const OSSymbol *gIOSerialBSDServiceValue; +extern const OSSymbol *gIOSerialBSDTypeKey; +extern const OSSymbol *gIOSerialBSDAllTypes; +extern const OSSymbol *gIOSerialBSDModemType; +extern const OSSymbol *gIOSerialBSDRS232Type; +extern const OSSymbol *gIOTTYDeviceKey; +extern const OSSymbol *gIOTTYBaseNameKey; +extern const OSSymbol *gIOTTYSuffixKey; +extern const OSSymbol *gIOCalloutDeviceKey; +extern const OSSymbol *gIODialinDeviceKey; +#endif /* KERNEL */ diff --git a/i386/include/IOKit/serial/.svn/text-base/IOSerialStreamSync.h.svn-base b/i386/include/IOKit/serial/.svn/text-base/IOSerialStreamSync.h.svn-base new file mode 100644 index 0000000..b654adb --- /dev/null +++ b/i386/include/IOKit/serial/.svn/text-base/IOSerialStreamSync.h.svn-base @@ -0,0 +1,275 @@ +/* + *Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + *@APPLE_LICENSE_HEADER_START@ + * + *The contents of this file constitute Original Code as defined in and + *are subject to the Apple Public Source License Version 1.1 (the + *"License"). You may not use this file except in compliance with the + *License. Please obtain a copy of the License at + *http://www.apple.com/publicsource and read it before using this file. + * + *This Original Code and all software distributed under the License are + *distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + *EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + *INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + *License for the specific language governing rights and limitations + *under the License. + * + *@APPLE_LICENSE_HEADER_END@ + */ +/* + * IOSerialStreamSync.h + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +#ifndef _SERIAL_IOSERIALSTREAMSYNC_H +#define _SERIAL_IOSERIALSTREAMSYNC_H + +#include <IOKit/IOService.h> + +#ifdef __LP64__ + +#define PD_DATA_MASK 0x03U +#define PD_DATA_VOID 0x00U +#define PD_DATA_BYTE 0x01U +#define PD_DATA_WORD 0x02U +#define PD_DATA_LONG 0x03U + +#else + +#define PD_DATA_MASK 0x03UL +#define PD_DATA_VOID 0x00UL +#define PD_DATA_BYTE 0x01UL +#define PD_DATA_WORD 0x02UL +#define PD_DATA_LONG 0x03UL + +#endif + +#define PD_OP(x) ((x) << 2) +#define PD_E_MASK (~PD_DATA_MASK) + +/* General Command & Status events */ +#define PD_E_EOQ (PD_DATA_VOID|PD_OP( 0)) // Always nextEvent on empty queue +#define PD_E_ACTIVE (PD_DATA_BYTE|PD_OP( 1)) // BOOL start/shutdown chip + +/* Queue management events - all units are multiples of characters + *based on the current character size + */ +#define PD_E_TXQ_SIZE (PD_DATA_LONG|PD_OP( 2)) +#define PD_E_RXQ_SIZE (PD_DATA_LONG|PD_OP( 3)) +#define PD_E_TXQ_LOW_WATER (PD_DATA_LONG|PD_OP( 4)) +#define PD_E_RXQ_LOW_WATER (PD_DATA_LONG|PD_OP( 5)) +#define PD_E_TXQ_HIGH_WATER (PD_DATA_LONG|PD_OP( 6)) +#define PD_E_RXQ_HIGH_WATER (PD_DATA_LONG|PD_OP( 7)) +#define PD_E_TXQ_AVAILABLE (PD_DATA_LONG|PD_OP( 8)) +#define PD_E_RXQ_AVAILABLE (PD_DATA_LONG|PD_OP( 9)) +#define PD_E_TXQ_FLUSH (PD_DATA_VOID|PD_OP(10)) +#define PD_E_RXQ_FLUSH (PD_DATA_LONG|PD_OP(11)) + +/* port & link characteristics - units are half bits */ +#define PD_E_DATA_RATE (PD_DATA_LONG|PD_OP(12)) // raw bits of symbols per second +#define PD_E_RX_DATA_RATE (PD_DATA_LONG|PD_OP(13)) +#define PD_E_DATA_SIZE (PD_DATA_LONG|PD_OP(14)) // raw bits per symbol +#define PD_E_RX_DATA_SIZE (PD_DATA_LONG|PD_OP(15)) +#define PD_E_DATA_INTEGRITY (PD_DATA_LONG|PD_OP(16)) // parity or ECC method +#define PD_E_RX_DATA_INTEGRITY (PD_DATA_LONG|PD_OP(17)) +#define PD_E_EXTERNAL_CLOCK_MODE (PD_DATA_LONG|PD_OP(28)) // multiplier between clock and data rates + +/* timeout events */ +#define PD_E_DELAY (PD_DATA_LONG|PD_OP(18)) // inter-character delay (us) +#define PD_E_DATA_LATENCY (PD_DATA_LONG|PD_OP(19)) // A dequeueData Latency timeout + // rcs Secondary Timer mainly to fix performance + // problems with MIDI and IRDA drivers. + // Midi and Irda drivers will issue an IOCTL + // call with this as the selector and + // the Data as the value they want the rate set + // to (Typically 1 for IrDA devices) +#define PD_E_FLOW_CONTROL (PD_DATA_LONG|PD_OP(20)) // enable/disable each flow mechanism + +/* I/O events */ +#define PD_E_VALID_DATA (PD_DATA_VOID|PD_OP(21)) // A valid frame was received +#define PD_E_VALID_DATA_BYTE (PD_DATA_BYTE|PD_E_VALID_DATA) +#define PD_E_VALID_DATA_WORD (PD_DATA_WORD|PD_E_VALID_DATA) +#define PD_E_VALID_DATA_LONG (PD_DATA_LONG|PD_E_VALID_DATA) + +#define PD_E_SPECIAL (PD_DATA_VOID|PD_OP(22)) // valid data received with 'special' value +#define PD_E_SPECIAL_BYTE (PD_DATA_BYTE|PD_E_SPECIAL) +#define PD_E_SPECIAL_WORD (PD_DATA_WORD|PD_E_SPECIAL) +#define PD_E_SPECIAL_LONG (PD_DATA_LONG|PD_E_SPECIAL) + +#define PD_E_FRAMING_ERROR (PD_DATA_VOID|PD_OP(23)) // Failure occured assembling frame +#define PD_E_FRAMING_BYTE (PD_DATA_BYTE|PD_E_FRAMING_ERROR) +#define PD_E_FRAMING_WORD (PD_DATA_WORD|PD_E_FRAMING_ERROR) +#define PD_E_FRAMING_LONG (PD_DATA_LONG|PD_E_FRAMING_ERROR) + +#define PD_E_INTEGRITY_ERROR (PD_DATA_VOID|PD_OP(24)) // An uncorrectable frame was received +#define PD_E_INTEGRITY_BYTE (PD_DATA_BYTE|PD_E_INTEGRITY_ERROR) +#define PD_E_INTEGRITY_WORD (PD_DATA_WORD|PD_E_INTEGRITY_ERROR) +#define PD_E_INTEGRITY_LONG (PD_DATA_LONG|PD_E_INTEGRITY_ERROR) + +#define PD_E_INTEGRITY_WARNING (PD_DATA_VOID|PD_OP(25)) // A correctable frame was received +#define PD_E_HW_OVERRUN_ERROR (PD_DATA_VOID|PD_OP(26)) // Hardware's buffer overflowed, data lost +#define PD_E_SW_OVERRUN_ERROR (PD_DATA_VOID|PD_OP(27)) // Driver's buffer overflowed, data lost + +/* + *The variables below make up the bits returned + *by the State methods:- getState, setState, watchState + */ +#define PD_S_MASK 0xffff0000UL +#define PD_S_RX_OFFSET 7 + +#define PD_S_ACQUIRED 0x80000000UL +#define PD_S_ACTIVE 0x40000000UL + +#define PD_S_TX_ENABLE 0x20000000UL +#define PD_S_TX_BUSY 0x10000000UL +#define PD_S_TX_EVENT 0x08000000UL +#define PD_S_TXQ_EMPTY 0x04000000UL +#define PD_S_TXQ_LOW_WATER 0x02000000UL +#define PD_S_TXQ_HIGH_WATER 0x01000000UL +#define PD_S_TXQ_FULL 0x00800000UL +#define PD_S_TXQ_MASK ( PD_S_TXQ_EMPTY | PD_S_TXQ_LOW_WATER \ + | PD_S_TXQ_FULL | PD_S_TXQ_HIGH_WATER ) + +#define PD_S_RX_ENABLE (PD_S_TX_ENABLE >> PD_S_RX_OFFSET) +#define PD_S_RX_BUSY (PD_S_TX_BUSY >> PD_S_RX_OFFSET) +#define PD_S_RX_EVENT (PD_S_TX_EVENT >> PD_S_RX_OFFSET) +#define PD_S_RXQ_EMPTY (PD_S_TXQ_EMPTY >> PD_S_RX_OFFSET) +#define PD_S_RXQ_LOW_WATER (PD_S_TXQ_LOW_WATER >> PD_S_RX_OFFSET) +#define PD_S_RXQ_HIGH_WATER (PD_S_TXQ_HIGH_WATER >> PD_S_RX_OFFSET) +#define PD_S_RXQ_FULL (PD_S_TXQ_FULL >> PD_S_RX_OFFSET) +#define PD_S_RXQ_MASK (PD_S_TXQ_MASK >> PD_S_RX_OFFSET) + +class IOSerialDriverSync; +class IOSerialStreamSync : public IOService +{ + OSDeclareDefaultStructors(IOSerialStreamSync); + +protected: + IOSerialDriverSync *fProvider; + void *fRefCon; + +public: + /* acquire tests and sets the state of the port object. If the port was + *available, then the state is set to busy, and kIOReturnSuccess is returned. + *If the port was already busy and sleep is YES, then the thread will sleep + *until the port is freed, then re-attempts the acquire. If the port was + *already busy and sleep in NO, then kIOReturnExclusiveAccess is returned. + */ + virtual IOReturn acquirePort(bool sleep); + + /* release sets the state of the port object to available and wakes up any + *threads sleeping for access to this port. It will return kIOReturnSuccess + *if the port was in a busy state, and kIOReturnNotOpen if it was available. + */ + virtual IOReturn releasePort(); + + /* + *Set the state for the port device. + */ + virtual IOReturn setState(UInt32 state, UInt32 mask); + + /* + *Get the state for the port device. + */ + virtual UInt32 getState(); + + /* + *Wait for the at least one of the state bits defined in mask to be equal + *to the value defined in state. + *Check on entry then sleep until necessary. + */ + virtual IOReturn watchState(UInt32 *state, UInt32 mask); + + /* nextEvent returns the type of the next event on the RX queue. If no + *events are present on the RX queue, then EOQ is returned. + */ + virtual UInt32 nextEvent(); + + /* executeEvent causes the specified event to be processed immediately. + *This is primarily used for channel control commands like START & STOP + */ + virtual IOReturn executeEvent(UInt32 event, UInt32 data); + + /* requestEvent processes the specified event as an immediate request and + *returns the results in data. This is primarily used for getting link + *status information and verifying baud rate and such. + */ + virtual IOReturn requestEvent(UInt32 event, UInt32 *data); + + /* enqueueEvent will place the specified event into the TX queue. The + *sleep argument allows the caller to specify the enqueueEvent's + *behaviour when the TX queue is full. If sleep is true, then this + *method will sleep until the event is enqueued. If sleep is false, + *then enqueueEvent will immediatly return kIOReturnNoResources. + */ + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, bool sleep); + + /* dequeueEvent will remove the oldest event from the RX queue and return + *it in event & data. The sleep argument defines the behaviour if the RX + *queue is empty. If sleep is true, then this method will sleep until an + *event is available. If sleep is false, then an EOQ event will be + *returned. In either case kIOReturnSuccess is returned. + */ + virtual IOReturn dequeueEvent(UInt32 *event, UInt32 *data, bool sleep); + + /* enqueueData will attempt to copy data from the specified buffer to the + *TX queue as a sequence of VALID_DATA events. The argument bufferSize + *specifies the number of bytes to be sent. The actual number of bytes + *transferred is returned in transferCount. If sleep is true, then this + *method will sleep until all bytes can be transferred. If sleep is + *false, then as many bytes as possible will be copied to the TX queue. + */ + virtual IOReturn enqueueData(UInt8 *buffer, UInt32 size, UInt32 *count, bool sleep ); + + /* dequeueData will attempt to copy data from the RX queue to the specified + *buffer. No more than bufferSize VALID_DATA events will be transferred. + *In other words, copying will continue until either a non-data event is + *encountered or the transfer buffer is full. The actual number of bytes + *transferred is returned in transferCount. + * + *The sleep semantics of this method are slightly more complicated than + *other methods in this API: Basically, this method will continue to + *sleep until either minCount characters have been received or a non + *data event is next in the RX queue. If minCount is zero, then this + *method never sleeps and will return immediatly if the queue is empty. + * + *The latency parameter specifies the maximum amount of time that should + *pass after the first character is available before the routine returns. + *This allows the caller to specify a 'packet' timeout. The unit of the + *latency parameter is microseconds, though the exact delay may vary + *depending on the granularity of the timeout services available to the + *driver. + */ + virtual IOReturn dequeueData(UInt8 *buffer, UInt32 size, UInt32 *count, UInt32 min); + + /* Internal for IOSerialDriver only */ + virtual bool init(OSDictionary *dictionary = 0, void *refCon = 0); + virtual bool attach(IOService *provider); + void *getRefCon() const { return fRefCon; } + +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 0); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 1); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 2); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 3); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 4); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 5); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 6); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 7); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 8); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 9); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 10); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 11); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 12); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 13); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 14); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 15); +}; + +#endif /* !_SERIAL_IOSERIALSTREAMSYNC_H */ + + diff --git a/i386/include/IOKit/serial/IOModemSerialStreamSync.h b/i386/include/IOKit/serial/IOModemSerialStreamSync.h new file mode 100644 index 0000000..be75287 --- /dev/null +++ b/i386/include/IOKit/serial/IOModemSerialStreamSync.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * IOModemSerialStreamSync.h + * This file contains Modem specific extensions to the IOSerialStreamSync class. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +#ifndef _SERIAL_IOMODEMSERIALSTREAMSYNC_H +#define _SERIAL_IOMODEMSERIALSTREAMSYNC_H + +#include <IOKit/serial/IOSerialStreamSync.h> + +class IOModemSerialStreamSync : public IOSerialStreamSync +{ + OSDeclareDefaultStructors(IOModemSerialStreamSync) +}; + +#endif /* !_SERIAL_IOMODEMSERIALSTREAMSYNC_H */ + diff --git a/i386/include/IOKit/serial/IORS232SerialStreamSync.h b/i386/include/IOKit/serial/IORS232SerialStreamSync.h new file mode 100644 index 0000000..15d520a --- /dev/null +++ b/i386/include/IOKit/serial/IORS232SerialStreamSync.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * IORS232SerialStreamSync.h + * This file contains RS232 specific extensions to the IOSerialStreamSync class. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + */ + +#ifndef _SERIAL_IORS232SERIALSTREAMSYNC_H +#define _SERIAL_IORS232SERIALSTREAMSYNC_H + +#include <sys/ioctl.h> +#include <IOKit/serial/IOSerialStreamSync.h> + +/* + * Extra events for RS232 based PortDevices + */ + +#define PD_RS232_E_RX_LINE_BREAK (PD_DATA_VOID|PD_OP(63)) // line break was received +#define PD_RS232_E_LINE_BREAK (PD_DATA_BYTE|PD_OP(62)) // BOOL set/clear line break + +#define PD_RS232_E_RX_STOP_BITS (PD_DATA_LONG|PD_OP(61)) // half stop bits +#define PD_RS232_E_STOP_BITS (PD_DATA_LONG|PD_OP(60)) // half stop bits + +#define PD_RS232_E_XON_BYTE (PD_DATA_BYTE|PD_OP(59)) // The XON char for TX&RX +#define PD_RS232_E_XOFF_BYTE (PD_DATA_BYTE|PD_OP(58)) // The XOFF char for TX&RX + +#define PD_RS232_E_MIN_LATENCY (PD_DATA_BYTE|PD_OP(57)) // BOOL true if low latency req + +/* + * RS232 Parity stuff, used with the DATA_INTEGRITY event + */ +#define PD_RS232_PARITY_DEFAULT 0 // Valid only for RX, means follow TX +#define PD_RS232_PARITY_NONE 1 // No Parity bit inserted or expected +#define PD_RS232_PARITY_ODD 2 // Odd Parity bit inserted or expected +#define PD_RS232_PARITY_EVEN 3 // Even Parity bit inserted or expected +#define PD_RS232_PARITY_MARK 4 // Mark inserted or expected +#define PD_RS232_PARITY_SPACE 5 // Space inserted or expected +#define PD_RS232_PARITY_ANY 6 // Valid only for RX, means discard parity + +/* + * RS232 Flow Control specifiers, used with the FLOW_CONTROL event + * NB. The XON character is set with FLOW_START_DATA + * and the XOFF character is set with FLOW_STOP_DATA. + * + * Signal Name Direction + * RFR Ready For Receive Output generated by UART + * RTS Ready To Send (alias of RFR) Output generated by UART + * CTS Clear To Send Input sensed by UART + * DTR Data Terminal Ready Output generated by UART + * DSR Data Set Ready Input sensed by UART + * TXO XON/XOFF/XANY protocol Characters received by UART + * RXO XON/XOFF protocol Characters transmitted by UART + * DCD Data Carrier Detect Input sensed by UART + */ + +/* + * RS232 State Word extensions, based on <bsd/sys/ioctl.h> + * Also the 'current state' bits for enq/deq of Flow Control event + */ +#define PD_RS232_S_MASK 0x0000ffffUL +#define PD_RS232_S_SHIFT 0 // to align State bits for enq/deq event +#define PD_RS232_D_MASK 0xffff0000UL +#define PD_RS232_D_SHIFT 16 // to align Delta bits for enq/deq event +#define PD_RS232_A_MASK 0x0000ffffUL +#define PD_RS232_A_SHIFT 0 // to align Auto bits for req/exec event +#define PD_RS232_N_MASK 0xffff0000UL +#define PD_RS232_N_SHIFT 16 // to align Notify bits for req/exec event + +#define PD_RS232_S_LE TIOCM_LE // line enable +#define PD_RS232_S_DTR TIOCM_DTR // data terminal ready +#define PD_RS232_S_RTS TIOCM_RTS // request to send +#define PD_RS232_S_RFR PD_RS232_S_RTS // ready for receive +#define PD_RS232_S_TXO TIOCM_ST // TX XON/XOFF +#define PD_RS232_S_RXO TIOCM_SR // RX XON/XOFF +#define PD_RS232_S_CTS TIOCM_CTS // clear to send +#define PD_RS232_S_CAR TIOCM_CAR // carrier detect +#define PD_RS232_S_DCD PD_RS232_S_CAR +#define PD_RS232_S_RNG TIOCM_RNG // ring +#define PD_RS232_S_RI PD_RS232_S_RNG +#define PD_RS232_S_DSR TIOCM_DSR // data set ready + +#define PD_RS232_S_BRK 0x00000800UL // break active Extension to TIOCM +#define PD_RS232_S_LOOP 0x00001000UL // LOOP back Extension to TIOCM +#define PD_RS232_S_TXQ 0x00002000UL // User flowcontrol bit +#define PD_RS232_S_RXQ 0x00004000UL // User flowcontrol bit + +// The 'delta' bits for enq/deq of Flow Control event +#define PD_RS232_D_LE (PD_RS232_S_LE << PD_RS232_D_SHIFT) +#define PD_RS232_D_DTR (PD_RS232_S_DTR << PD_RS232_D_SHIFT) +#define PD_RS232_D_RTS (PD_RS232_S_RTS << PD_RS232_D_SHIFT) +#define PD_RS232_D_RFR (PD_RS232_S_RFR << PD_RS232_D_SHIFT) +#define PD_RS232_D_TXO (PD_RS232_S_TXO << PD_RS232_D_SHIFT) +#define PD_RS232_D_RXO (PD_RS232_S_RXO << PD_RS232_D_SHIFT) +#define PD_RS232_D_CTS (PD_RS232_S_CTS << PD_RS232_D_SHIFT) +#define PD_RS232_D_CAR (PD_RS232_S_CAR << PD_RS232_D_SHIFT) +#define PD_RS232_D_DCD (PD_RS232_S_DCD << PD_RS232_D_SHIFT) +#define PD_RS232_D_RNG (PD_RS232_S_RNG << PD_RS232_D_SHIFT) +#define PD_RS232_D_RI (PD_RS232_S_RI << PD_RS232_D_SHIFT) +#define PD_RS232_D_DSR (PD_RS232_S_DSR << PD_RS232_D_SHIFT) + +#define PD_RS232_D_BRK (PD_RS232_S_BRK << PD_RS232_D_SHIFT) +#define PD_RS232_D_LOOP (PD_RS232_S_LOOP << PD_RS232_D_SHIFT) +#define PD_RS232_D_TXQ (PD_RS232_S_TXQ << PD_RS232_D_SHIFT) +#define PD_RS232_D_RXQ (PD_RS232_S_RXQ << PD_RS232_D_SHIFT) + +// The 'auto' bits for exec/req of Flow Control event +#define PD_RS232_A_LE PD_RS232_S_LE +#define PD_RS232_A_DTR PD_RS232_S_DTR +#define PD_RS232_A_RTS PD_RS232_S_RTS +#define PD_RS232_A_RFR PD_RS232_S_RFR +#define PD_RS232_A_TXO PD_RS232_S_TXO +#define PD_RS232_A_RXO PD_RS232_S_RXO +#define PD_RS232_A_CTS PD_RS232_S_CTS +#define PD_RS232_A_CAR PD_RS232_S_CAR +#define PD_RS232_A_DCD PD_RS232_S_DCD +#define PD_RS232_A_RNG PD_RS232_S_RNG +#define PD_RS232_A_RI PD_RS232_S_RI +#define PD_RS232_A_DSR PD_RS232_S_DSR +#define PD_RS232_A_XANY 0x00000400 // changes _A_TXO from XON/XOFF to XANY/XOFF +#define PD_RS232_A_BRK PD_RS232_S_BRK +#define PD_RS232_A_LOOP PD_RS232_S_LOOP +#define PD_RS232_A_TXQ PD_RS232_S_TXQ +#define PD_RS232_A_RXQ PD_RS232_S_RXQ + +// The 'notify' bits for exec/req of Flow Control event +#define PD_RS232_N_LE (PD_RS232_S_LE << PD_RS232_N_SHIFT) +#define PD_RS232_N_DTR (PD_RS232_S_DTR << PD_RS232_N_SHIFT) +#define PD_RS232_N_RTS (PD_RS232_S_RTS << PD_RS232_N_SHIFT) +#define PD_RS232_N_RFR (PD_RS232_S_RFR << PD_RS232_N_SHIFT) +#define PD_RS232_N_TXO (PD_RS232_S_TXO << PD_RS232_N_SHIFT) +#define PD_RS232_N_RXO (PD_RS232_S_RXO << PD_RS232_N_SHIFT) +#define PD_RS232_N_CTS (PD_RS232_S_CTS << PD_RS232_N_SHIFT) +#define PD_RS232_N_CAR (PD_RS232_S_CAR << PD_RS232_N_SHIFT) +#define PD_RS232_N_DCD (PD_RS232_S_DCD << PD_RS232_N_SHIFT) +#define PD_RS232_N_RNG (PD_RS232_S_RNG << PD_RS232_N_SHIFT) +#define PD_RS232_N_RI (PD_RS232_S_RI << PD_RS232_N_SHIFT) +#define PD_RS232_N_DSR (PD_RS232_S_DSR << PD_RS232_N_SHIFT) + +#define PD_RS232_N_BRK (PD_RS232_S_BRK << PD_RS232_N_SHIFT) +#define PD_RS232_N_LOOP (PD_RS232_S_LOOP << PD_RS232_N_SHIFT) +#define PD_RS232_N_TXQ (PD_RS232_S_TXQ << PD_RS232_N_SHIFT) +#define PD_RS232_N_RXQ (PD_RS232_S_RXQ << PD_RS232_N_SHIFT) + +class IORS232SerialStreamSync : public IOSerialStreamSync +{ + OSDeclareDefaultStructors(IORS232SerialStreamSync) +}; + +#endif /* !_SERIAL_IORS232SERIALSTREAMSYNC_H */ + diff --git a/i386/include/IOKit/serial/IOSerialDriverSync.h b/i386/include/IOKit/serial/IOSerialDriverSync.h new file mode 100644 index 0000000..92f69df --- /dev/null +++ b/i386/include/IOKit/serial/IOSerialDriverSync.h @@ -0,0 +1,91 @@ +/* + *Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + *@APPLE_LICENSE_HEADER_START@ + * + *The contents of this file constitute Original Code as defined in and + *are subject to the Apple Public Source License Version 1.1 (the + *"License"). You may not use this file except in compliance with the + *License. Please obtain a copy of the License at + *http://www.apple.com/publicsource and read it before using this file. + * + *This Original Code and all software distributed under the License are + *distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + *EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + *INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + *License for the specific language governing rights and limitations + *under the License. + * + *@APPLE_LICENSE_HEADER_END@ + */ + +/* + * IOSerialDriverSync.h + * This file contains the abstract parent class for any IOSerialDriver + * interface, which is a generic serial interface, designed for devices + * that do character oriented transfers (async) rather than block or + * packet transfers. Most notably RS-232, Printer, Mouse, and Keyboard + * type devices. + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + */ + +#ifndef _SERIAL_IOSERIALDRIVERSYNC_H +#define _SERIAL_IOSERIALDRIVERSYNC_H + +#include <IOKit/IOService.h> + +class IOSerialDriverSync : public IOService +{ + OSDeclareAbstractStructors(IOSerialDriverSync); + +public: + virtual IOReturn acquirePort(bool sleep, void *refCon) = 0; + + virtual IOReturn releasePort(void *refCon) = 0; + + virtual IOReturn setState(UInt32 state, UInt32 mask, void *refCon) = 0; + + virtual UInt32 getState(void *refCon) = 0; + + virtual IOReturn watchState(UInt32 *state, UInt32 mask, void *refCon) = 0; + + virtual UInt32 nextEvent(void *refCon) = 0; + + virtual IOReturn executeEvent(UInt32 event, UInt32 data, void *refCon) = 0; + + virtual IOReturn requestEvent(UInt32 event, UInt32 *data, void *refCon) = 0; + + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, + bool sleep, void *refCon) = 0; + + virtual IOReturn dequeueEvent(UInt32 *event, UInt32 *data, + bool sleep, void *refCon) = 0; + + virtual IOReturn enqueueData(UInt8 *buffer, UInt32 size, UInt32 *count, + bool sleep, void *refCon) = 0; + + virtual IOReturn dequeueData(UInt8 *buffer, UInt32 size, UInt32 *count, + UInt32 min, void *refCon) = 0; + +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 0); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 1); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 2); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 3); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 4); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 5); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 6); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 7); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 8); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 9); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 10); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 11); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 12); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 13); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 14); +OSMetaClassDeclareReservedUnused(IOSerialDriverSync, 15); + +}; + +#endif /* !_SERIAL_IOSERIALDRIVERSYNC_H */ diff --git a/i386/include/IOKit/serial/IOSerialKeys.h b/i386/include/IOKit/serial/IOSerialKeys.h new file mode 100644 index 0000000..9538a24 --- /dev/null +++ b/i386/include/IOKit/serial/IOSerialKeys.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOSerialKeys.h + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +/* +Sample Matching dictionary +{ + IOProviderClass = kIOSerialBSDServiceValue; + kIOSerialBSDTypeKey = kIOSerialBSDAllTypes + | kIOSerialBSDModemType + | kIOSerialBSDRS232Type; + kIOTTYDeviceKey = <Raw Unique Device Name>; + kIOTTYBaseNameKey = <Raw Unique Device Name>; + kIOTTYSuffixKey = <Raw Unique Device Name>; + kIOCalloutDeviceKey = <Callout Device Name>; + kIODialinDeviceKey = <Dialin Device Name>; +} + +Note only the IOProviderClass is mandatory. The other keys allow the searcher to reduce the size of the set of matching devices. +*/ + +/* Service Matching That is the 'IOProviderClass' */ +#define kIOSerialBSDServiceValue "IOSerialBSDClient" + +/* Matching keys */ +#define kIOSerialBSDTypeKey "IOSerialBSDClientType" + +/* Currently possible kIOSerialBSDTypeKey values. */ +#define kIOSerialBSDAllTypes "IOSerialStream" +#define kIOSerialBSDModemType "IOModemSerialStream" +#define kIOSerialBSDRS232Type "IORS232SerialStream" + +// Properties that resolve to a /dev device node to open for +// a particular service +#define kIOTTYDeviceKey "IOTTYDevice" +#define kIOTTYBaseNameKey "IOTTYBaseName" +#define kIOTTYSuffixKey "IOTTYSuffix" + +#define kIOCalloutDeviceKey "IOCalloutDevice" +#define kIODialinDeviceKey "IODialinDevice" + +// Property 'ioctl' wait for the tty device to go idle. +#define kIOTTYWaitForIdleKey "IOTTYWaitForIdle" + +#if KERNEL +extern const OSSymbol *gIOSerialBSDServiceValue; +extern const OSSymbol *gIOSerialBSDTypeKey; +extern const OSSymbol *gIOSerialBSDAllTypes; +extern const OSSymbol *gIOSerialBSDModemType; +extern const OSSymbol *gIOSerialBSDRS232Type; +extern const OSSymbol *gIOTTYDeviceKey; +extern const OSSymbol *gIOTTYBaseNameKey; +extern const OSSymbol *gIOTTYSuffixKey; +extern const OSSymbol *gIOCalloutDeviceKey; +extern const OSSymbol *gIODialinDeviceKey; +#endif /* KERNEL */ diff --git a/i386/include/IOKit/serial/IOSerialStreamSync.h b/i386/include/IOKit/serial/IOSerialStreamSync.h new file mode 100644 index 0000000..b654adb --- /dev/null +++ b/i386/include/IOKit/serial/IOSerialStreamSync.h @@ -0,0 +1,275 @@ +/* + *Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + *@APPLE_LICENSE_HEADER_START@ + * + *The contents of this file constitute Original Code as defined in and + *are subject to the Apple Public Source License Version 1.1 (the + *"License"). You may not use this file except in compliance with the + *License. Please obtain a copy of the License at + *http://www.apple.com/publicsource and read it before using this file. + * + *This Original Code and all software distributed under the License are + *distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + *EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + *INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + *License for the specific language governing rights and limitations + *under the License. + * + *@APPLE_LICENSE_HEADER_END@ + */ +/* + * IOSerialStreamSync.h + * + * 2000-10-21 gvdl Initial real change to IOKit serial family. + * + */ + +#ifndef _SERIAL_IOSERIALSTREAMSYNC_H +#define _SERIAL_IOSERIALSTREAMSYNC_H + +#include <IOKit/IOService.h> + +#ifdef __LP64__ + +#define PD_DATA_MASK 0x03U +#define PD_DATA_VOID 0x00U +#define PD_DATA_BYTE 0x01U +#define PD_DATA_WORD 0x02U +#define PD_DATA_LONG 0x03U + +#else + +#define PD_DATA_MASK 0x03UL +#define PD_DATA_VOID 0x00UL +#define PD_DATA_BYTE 0x01UL +#define PD_DATA_WORD 0x02UL +#define PD_DATA_LONG 0x03UL + +#endif + +#define PD_OP(x) ((x) << 2) +#define PD_E_MASK (~PD_DATA_MASK) + +/* General Command & Status events */ +#define PD_E_EOQ (PD_DATA_VOID|PD_OP( 0)) // Always nextEvent on empty queue +#define PD_E_ACTIVE (PD_DATA_BYTE|PD_OP( 1)) // BOOL start/shutdown chip + +/* Queue management events - all units are multiples of characters + *based on the current character size + */ +#define PD_E_TXQ_SIZE (PD_DATA_LONG|PD_OP( 2)) +#define PD_E_RXQ_SIZE (PD_DATA_LONG|PD_OP( 3)) +#define PD_E_TXQ_LOW_WATER (PD_DATA_LONG|PD_OP( 4)) +#define PD_E_RXQ_LOW_WATER (PD_DATA_LONG|PD_OP( 5)) +#define PD_E_TXQ_HIGH_WATER (PD_DATA_LONG|PD_OP( 6)) +#define PD_E_RXQ_HIGH_WATER (PD_DATA_LONG|PD_OP( 7)) +#define PD_E_TXQ_AVAILABLE (PD_DATA_LONG|PD_OP( 8)) +#define PD_E_RXQ_AVAILABLE (PD_DATA_LONG|PD_OP( 9)) +#define PD_E_TXQ_FLUSH (PD_DATA_VOID|PD_OP(10)) +#define PD_E_RXQ_FLUSH (PD_DATA_LONG|PD_OP(11)) + +/* port & link characteristics - units are half bits */ +#define PD_E_DATA_RATE (PD_DATA_LONG|PD_OP(12)) // raw bits of symbols per second +#define PD_E_RX_DATA_RATE (PD_DATA_LONG|PD_OP(13)) +#define PD_E_DATA_SIZE (PD_DATA_LONG|PD_OP(14)) // raw bits per symbol +#define PD_E_RX_DATA_SIZE (PD_DATA_LONG|PD_OP(15)) +#define PD_E_DATA_INTEGRITY (PD_DATA_LONG|PD_OP(16)) // parity or ECC method +#define PD_E_RX_DATA_INTEGRITY (PD_DATA_LONG|PD_OP(17)) +#define PD_E_EXTERNAL_CLOCK_MODE (PD_DATA_LONG|PD_OP(28)) // multiplier between clock and data rates + +/* timeout events */ +#define PD_E_DELAY (PD_DATA_LONG|PD_OP(18)) // inter-character delay (us) +#define PD_E_DATA_LATENCY (PD_DATA_LONG|PD_OP(19)) // A dequeueData Latency timeout + // rcs Secondary Timer mainly to fix performance + // problems with MIDI and IRDA drivers. + // Midi and Irda drivers will issue an IOCTL + // call with this as the selector and + // the Data as the value they want the rate set + // to (Typically 1 for IrDA devices) +#define PD_E_FLOW_CONTROL (PD_DATA_LONG|PD_OP(20)) // enable/disable each flow mechanism + +/* I/O events */ +#define PD_E_VALID_DATA (PD_DATA_VOID|PD_OP(21)) // A valid frame was received +#define PD_E_VALID_DATA_BYTE (PD_DATA_BYTE|PD_E_VALID_DATA) +#define PD_E_VALID_DATA_WORD (PD_DATA_WORD|PD_E_VALID_DATA) +#define PD_E_VALID_DATA_LONG (PD_DATA_LONG|PD_E_VALID_DATA) + +#define PD_E_SPECIAL (PD_DATA_VOID|PD_OP(22)) // valid data received with 'special' value +#define PD_E_SPECIAL_BYTE (PD_DATA_BYTE|PD_E_SPECIAL) +#define PD_E_SPECIAL_WORD (PD_DATA_WORD|PD_E_SPECIAL) +#define PD_E_SPECIAL_LONG (PD_DATA_LONG|PD_E_SPECIAL) + +#define PD_E_FRAMING_ERROR (PD_DATA_VOID|PD_OP(23)) // Failure occured assembling frame +#define PD_E_FRAMING_BYTE (PD_DATA_BYTE|PD_E_FRAMING_ERROR) +#define PD_E_FRAMING_WORD (PD_DATA_WORD|PD_E_FRAMING_ERROR) +#define PD_E_FRAMING_LONG (PD_DATA_LONG|PD_E_FRAMING_ERROR) + +#define PD_E_INTEGRITY_ERROR (PD_DATA_VOID|PD_OP(24)) // An uncorrectable frame was received +#define PD_E_INTEGRITY_BYTE (PD_DATA_BYTE|PD_E_INTEGRITY_ERROR) +#define PD_E_INTEGRITY_WORD (PD_DATA_WORD|PD_E_INTEGRITY_ERROR) +#define PD_E_INTEGRITY_LONG (PD_DATA_LONG|PD_E_INTEGRITY_ERROR) + +#define PD_E_INTEGRITY_WARNING (PD_DATA_VOID|PD_OP(25)) // A correctable frame was received +#define PD_E_HW_OVERRUN_ERROR (PD_DATA_VOID|PD_OP(26)) // Hardware's buffer overflowed, data lost +#define PD_E_SW_OVERRUN_ERROR (PD_DATA_VOID|PD_OP(27)) // Driver's buffer overflowed, data lost + +/* + *The variables below make up the bits returned + *by the State methods:- getState, setState, watchState + */ +#define PD_S_MASK 0xffff0000UL +#define PD_S_RX_OFFSET 7 + +#define PD_S_ACQUIRED 0x80000000UL +#define PD_S_ACTIVE 0x40000000UL + +#define PD_S_TX_ENABLE 0x20000000UL +#define PD_S_TX_BUSY 0x10000000UL +#define PD_S_TX_EVENT 0x08000000UL +#define PD_S_TXQ_EMPTY 0x04000000UL +#define PD_S_TXQ_LOW_WATER 0x02000000UL +#define PD_S_TXQ_HIGH_WATER 0x01000000UL +#define PD_S_TXQ_FULL 0x00800000UL +#define PD_S_TXQ_MASK ( PD_S_TXQ_EMPTY | PD_S_TXQ_LOW_WATER \ + | PD_S_TXQ_FULL | PD_S_TXQ_HIGH_WATER ) + +#define PD_S_RX_ENABLE (PD_S_TX_ENABLE >> PD_S_RX_OFFSET) +#define PD_S_RX_BUSY (PD_S_TX_BUSY >> PD_S_RX_OFFSET) +#define PD_S_RX_EVENT (PD_S_TX_EVENT >> PD_S_RX_OFFSET) +#define PD_S_RXQ_EMPTY (PD_S_TXQ_EMPTY >> PD_S_RX_OFFSET) +#define PD_S_RXQ_LOW_WATER (PD_S_TXQ_LOW_WATER >> PD_S_RX_OFFSET) +#define PD_S_RXQ_HIGH_WATER (PD_S_TXQ_HIGH_WATER >> PD_S_RX_OFFSET) +#define PD_S_RXQ_FULL (PD_S_TXQ_FULL >> PD_S_RX_OFFSET) +#define PD_S_RXQ_MASK (PD_S_TXQ_MASK >> PD_S_RX_OFFSET) + +class IOSerialDriverSync; +class IOSerialStreamSync : public IOService +{ + OSDeclareDefaultStructors(IOSerialStreamSync); + +protected: + IOSerialDriverSync *fProvider; + void *fRefCon; + +public: + /* acquire tests and sets the state of the port object. If the port was + *available, then the state is set to busy, and kIOReturnSuccess is returned. + *If the port was already busy and sleep is YES, then the thread will sleep + *until the port is freed, then re-attempts the acquire. If the port was + *already busy and sleep in NO, then kIOReturnExclusiveAccess is returned. + */ + virtual IOReturn acquirePort(bool sleep); + + /* release sets the state of the port object to available and wakes up any + *threads sleeping for access to this port. It will return kIOReturnSuccess + *if the port was in a busy state, and kIOReturnNotOpen if it was available. + */ + virtual IOReturn releasePort(); + + /* + *Set the state for the port device. + */ + virtual IOReturn setState(UInt32 state, UInt32 mask); + + /* + *Get the state for the port device. + */ + virtual UInt32 getState(); + + /* + *Wait for the at least one of the state bits defined in mask to be equal + *to the value defined in state. + *Check on entry then sleep until necessary. + */ + virtual IOReturn watchState(UInt32 *state, UInt32 mask); + + /* nextEvent returns the type of the next event on the RX queue. If no + *events are present on the RX queue, then EOQ is returned. + */ + virtual UInt32 nextEvent(); + + /* executeEvent causes the specified event to be processed immediately. + *This is primarily used for channel control commands like START & STOP + */ + virtual IOReturn executeEvent(UInt32 event, UInt32 data); + + /* requestEvent processes the specified event as an immediate request and + *returns the results in data. This is primarily used for getting link + *status information and verifying baud rate and such. + */ + virtual IOReturn requestEvent(UInt32 event, UInt32 *data); + + /* enqueueEvent will place the specified event into the TX queue. The + *sleep argument allows the caller to specify the enqueueEvent's + *behaviour when the TX queue is full. If sleep is true, then this + *method will sleep until the event is enqueued. If sleep is false, + *then enqueueEvent will immediatly return kIOReturnNoResources. + */ + virtual IOReturn enqueueEvent(UInt32 event, UInt32 data, bool sleep); + + /* dequeueEvent will remove the oldest event from the RX queue and return + *it in event & data. The sleep argument defines the behaviour if the RX + *queue is empty. If sleep is true, then this method will sleep until an + *event is available. If sleep is false, then an EOQ event will be + *returned. In either case kIOReturnSuccess is returned. + */ + virtual IOReturn dequeueEvent(UInt32 *event, UInt32 *data, bool sleep); + + /* enqueueData will attempt to copy data from the specified buffer to the + *TX queue as a sequence of VALID_DATA events. The argument bufferSize + *specifies the number of bytes to be sent. The actual number of bytes + *transferred is returned in transferCount. If sleep is true, then this + *method will sleep until all bytes can be transferred. If sleep is + *false, then as many bytes as possible will be copied to the TX queue. + */ + virtual IOReturn enqueueData(UInt8 *buffer, UInt32 size, UInt32 *count, bool sleep ); + + /* dequeueData will attempt to copy data from the RX queue to the specified + *buffer. No more than bufferSize VALID_DATA events will be transferred. + *In other words, copying will continue until either a non-data event is + *encountered or the transfer buffer is full. The actual number of bytes + *transferred is returned in transferCount. + * + *The sleep semantics of this method are slightly more complicated than + *other methods in this API: Basically, this method will continue to + *sleep until either minCount characters have been received or a non + *data event is next in the RX queue. If minCount is zero, then this + *method never sleeps and will return immediatly if the queue is empty. + * + *The latency parameter specifies the maximum amount of time that should + *pass after the first character is available before the routine returns. + *This allows the caller to specify a 'packet' timeout. The unit of the + *latency parameter is microseconds, though the exact delay may vary + *depending on the granularity of the timeout services available to the + *driver. + */ + virtual IOReturn dequeueData(UInt8 *buffer, UInt32 size, UInt32 *count, UInt32 min); + + /* Internal for IOSerialDriver only */ + virtual bool init(OSDictionary *dictionary = 0, void *refCon = 0); + virtual bool attach(IOService *provider); + void *getRefCon() const { return fRefCon; } + +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 0); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 1); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 2); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 3); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 4); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 5); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 6); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 7); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 8); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 9); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 10); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 11); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 12); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 13); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 14); +OSMetaClassDeclareReservedUnused(IOSerialStreamSync, 15); +}; + +#endif /* !_SERIAL_IOSERIALSTREAMSYNC_H */ + + diff --git a/i386/include/IOKit/storage/.svn/all-wcprops b/i386/include/IOKit/storage/.svn/all-wcprops new file mode 100644 index 0000000..fd34a98 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/all-wcprops @@ -0,0 +1,185 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage +END +IOBDBlockStorageDriver.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBDBlockStorageDriver.h +END +IOCDBlockStorageDriver.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOCDBlockStorageDriver.h +END +IODVDTypes.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IODVDTypes.h +END +IOStorage.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOStorage.h +END +IOCDPartitionScheme.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOCDPartitionScheme.h +END +IOBDBlockStorageDevice.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBDBlockStorageDevice.h +END +IODVDMediaBSDClient.h +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IODVDMediaBSDClient.h +END +IOCDBlockStorageDevice.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOCDBlockStorageDevice.h +END +IOGUIDPartitionScheme.h +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOGUIDPartitionScheme.h +END +IOMediaBSDClient.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOMediaBSDClient.h +END +IOBDTypes.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBDTypes.h +END +IOFilterScheme.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOFilterScheme.h +END +IOCDTypes.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOCDTypes.h +END +IOBDMediaBSDClient.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBDMediaBSDClient.h +END +IODVDMedia.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IODVDMedia.h +END +IOCDMediaBSDClient.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOCDMediaBSDClient.h +END +IOFDiskPartitionScheme.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOFDiskPartitionScheme.h +END +IOMedia.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOMedia.h +END +IOApplePartitionScheme.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOApplePartitionScheme.h +END +IOStorageDeviceCharacteristics.h +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOStorageDeviceCharacteristics.h +END +IOStorageProtocolCharacteristics.h +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOStorageProtocolCharacteristics.h +END +IOBDMedia.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBDMedia.h +END +IOCDMedia.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOCDMedia.h +END +IOAppleLabelScheme.h +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOAppleLabelScheme.h +END +IODVDBlockStorageDriver.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IODVDBlockStorageDriver.h +END +IOBlockStorageDriver.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBlockStorageDriver.h +END +IODVDBlockStorageDevice.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IODVDBlockStorageDevice.h +END +IOFireWireStorageCharacteristics.h +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOFireWireStorageCharacteristics.h +END +IOPartitionScheme.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOPartitionScheme.h +END +IOBlockStorageDevice.h +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/IOBlockStorageDevice.h +END diff --git a/i386/include/IOKit/storage/.svn/entries b/i386/include/IOKit/storage/.svn/entries new file mode 100644 index 0000000..2f1d078 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/entries @@ -0,0 +1,1051 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/storage +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IODVDTypes.h +file + + + + +2013-08-27T23:54:15.000000Z +e483ef56f42ffa0797fc8f07728e977b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10778 + +IOCDBlockStorageDriver.h +file + + + + +2013-08-27T23:54:15.000000Z +7e573eee203505f040b6c91952fd27ed +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1784 + +IOStorage.h +file + + + + +2013-08-27T23:54:15.000000Z +6861395312a6c4d8504025439259a31d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6542 + +IOCDBlockStorageDevice.h +file + + + + +2013-08-27T23:54:15.000000Z +be4d88548b1a690ae872cd2bf28b314f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1824 + +IOMediaBSDClient.h +file + + + + +2013-08-27T23:54:15.000000Z +a223d0e3c33fa4525eed3f70692b2d17 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1089 + +IOBDMediaBSDClient.h +file + + + + +2013-08-27T23:54:15.000000Z +a69c6652c046f1a8e2f067ee0e24abc3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5362 + +IODVDMedia.h +file + + + + +2013-08-27T23:54:15.000000Z +ae6b1b0b9061f9a228168c7e85b9c301 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11327 + +IOApplePartitionScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +a056bad5bd21b62813749928b63112e8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5490 + +IOBlockStorageDriver.h +file + + + + +2013-08-27T23:54:15.000000Z +91aa9b08fb435bcbe41cd3c05ac1c928 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8744 + +IOPartitionScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +0860e541b3aff31008ce2090fb58f93a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13964 + +IOBlockStorageDevice.h +file + + + + +2013-08-27T23:54:15.000000Z +6f8ecd4d8450d6756ab68814db44e1ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2369 + +IOBDBlockStorageDriver.h +file + + + + +2013-08-27T23:54:15.000000Z +7cf5b5bb3b93251c88ce55e0df8066a8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6051 + +IODVDMediaBSDClient.h +file + + + + +2013-08-27T23:54:15.000000Z +08191d1ae4cc6a238b9316ab3b38b716 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5926 + +IOBDBlockStorageDevice.h +file + + + + +2013-08-27T23:54:15.000000Z +2c1c0ef6332409dae6b2795d999febbd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5189 + +IOCDPartitionScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +844d9d0d2381539689b148fd89410116 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8152 + +IOGUIDPartitionScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +530816f5541c8445445c5fea0f26732f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2402 + +IOFilterScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +e33b7cb7900db1f675747ebcce9eabac +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11039 + +IOBDTypes.h +file + + + + +2013-08-27T23:54:15.000000Z +f925111d2be6068af39a1455b650c50e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3423 + +IOCDTypes.h +file + + + + +2013-08-27T23:54:15.000000Z +568a8b5033fcc89b9bf5e2f5477f3898 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12304 + +IOCDMediaBSDClient.h +file + + + + +2013-08-27T23:54:15.000000Z +a923162dc13ec3c65bf9a8630545768b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6004 + +IOMedia.h +file + + + + +2013-08-27T23:54:15.000000Z +81f4dba74563d2f012e1f1132ff141e5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6890 + +IOFDiskPartitionScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +f9744ba40c80f31b76dd1dffad9efd77 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4057 + +IOStorageDeviceCharacteristics.h +file + + + + +2013-08-27T23:54:15.000000Z +8684062918e25591b2a0428cee9832b2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14734 + +IOStorageProtocolCharacteristics.h +file + + + + +2013-08-27T23:54:15.000000Z +325514be8136f0b9e64be88e35e9fe8d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +40195 + +IOBDMedia.h +file + + + + +2013-08-27T23:54:15.000000Z +1ebd0da1f4d15c3942b7afad837f8401 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9148 + +IOAppleLabelScheme.h +file + + + + +2013-08-27T23:54:15.000000Z +5694e06bb45c5a8e4be155f216878cc8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5461 + +IOCDMedia.h +file + + + + +2013-08-27T23:54:15.000000Z +6678a0743a966704a1b36bc02b9d5703 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +21272 + +ata +dir + +IODVDBlockStorageDriver.h +file + + + + +2013-08-27T23:54:15.000000Z +e4adcc63709c7d75558955fb8607ba2d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9113 + +IOFireWireStorageCharacteristics.h +file + + + + +2013-08-27T23:54:15.000000Z +c2f19d1a81610ee239cb252b99f75f74 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2057 + +IODVDBlockStorageDevice.h +file + + + + +2013-08-27T23:54:15.000000Z +c7b8a53c5a82f8f283d2da92e6d3f903 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5839 + diff --git a/i386/include/IOKit/storage/.svn/text-base/IOAppleLabelScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOAppleLabelScheme.h.svn-base new file mode 100644 index 0000000..6e290a4 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOAppleLabelScheme.h.svn-base @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOAppleLabelScheme class definition. + */ + +#ifndef _IOAPPLELABELSCHEME_H +#define _IOAPPLELABELSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOAppleLabelSchemeClass is the name of the IOAppleLabelScheme class. + */ + +#define kIOAppleLabelSchemeClass "IOAppleLabelScheme" + +/* + * Apple Label Scheme Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Label scheme. */ + +struct applelabel +{ + uint8_t al_boot0[416]; /* (reserved for boot area) */ + uint16_t al_magic; /* (the magic number) */ + uint16_t al_type; /* (label type) */ + uint32_t al_flags; /* (generic flags) */ + uint64_t al_offset; /* (offset of property area, bytes) */ + uint32_t al_size; /* (size of property area, bytes) */ + uint32_t al_checksum; /* (checksum of property area) */ + uint8_t al_boot1[72]; /* (reserved for boot area) */ +}; + +/* Label scheme signature (al_magic). */ + +#define AL_MAGIC 0x414C + +/* Label scheme version (al_type). */ + +#define AL_TYPE_DEFAULT 0x0000 + +/* Label scheme flags (al_flags). */ + +#define AL_FLAG_DEFAULT 0x00000000 + +#pragma pack(pop) /* (reset to default struct packing) */ + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOFilterScheme.h> + +/* + * Class + */ + +class IOAppleLabelScheme : public IOFilterScheme +{ + OSDeclareDefaultStructors(IOAppleLabelScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + IOMedia * _content; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + /* + * Scan the provider media for an Apple label scheme. + */ + + virtual IOMedia * scan(SInt32 * score); + + /* + * Ask whether the given content appears to be corrupt. + */ + + virtual bool isContentCorrupt(OSDictionary * properties); + + /* + * Ask whether the given content appears to be invalid. + */ + + virtual bool isContentInvalid(OSDictionary * properties); + + /* + * Instantiate a new media object to represent the given content. + */ + + virtual IOMedia * instantiateMediaObject(OSDictionary * properties); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject(OSDictionary * properties); + + /* + * Attach the given media object to the device tree plane. + */ + + virtual bool attachMediaObjectToDeviceTree(IOMedia * media); + + /* + * Detach the given media object from the device tree plane. + */ + + virtual void detachMediaObjectFromDeviceTree(IOMedia * media); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /* + * Determine whether the provider media contains an Apple label scheme. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score); + + /* + * Publish the new media object which represents our content. + */ + + virtual bool start(IOService * provider); + + /* + * Clean up after the media object we published before terminating. + */ + + virtual void stop(IOService * provider); + + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 0); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 1); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 2); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 3); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 4); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 5); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 6); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 7); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 8); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 9); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 10); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 11); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 12); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 13); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 14); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOAPPLELABELSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOApplePartitionScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOApplePartitionScheme.h.svn-base new file mode 100644 index 0000000..ace1f3b --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOApplePartitionScheme.h.svn-base @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOApplePartitionScheme class definition. + */ + +#ifndef _IOAPPLEPARTITIONSCHEME_H +#define _IOAPPLEPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOApplePartitionSchemeClass is the name of the IOApplePartitionScheme class. + */ + +#define kIOApplePartitionSchemeClass "IOApplePartitionScheme" + +/* + * Apple Partition Map Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Structure constants. */ + +#define DPISTRLEN 32 + +/* Partition map entry, as found in blocks 1 to dpme_map_entries of the disk. */ + +typedef struct dpme +{ + UInt16 dpme_signature; /* (unique value for partition entry, 'PM') */ + UInt16 dpme_reserved_1; /* (reserved for future use) */ + UInt32 dpme_map_entries; /* (number of partition entries) */ + UInt32 dpme_pblock_start; /* (physical block start of partition) */ + UInt32 dpme_pblocks; /* (physical block count of partition) */ + char dpme_name[DPISTRLEN]; /* (name of partition) */ + char dpme_type[DPISTRLEN]; /* (type of partition, eg. Apple_HFS) */ + UInt32 dpme_lblock_start; /* (logical block start of partition) */ + UInt32 dpme_lblocks; /* (logical block count of partition) */ + UInt32 dpme_flags; /* (partition flags, see defines below) */ + UInt32 dpme_boot_block; /* (logical block start of boot code) */ + UInt32 dpme_boot_bytes; /* (byte count of boot code) */ + UInt32 dpme_load_addr; /* (load address in memory of boot code) */ + UInt32 dpme_load_addr_2; /* (reserved for future use) */ + UInt32 dpme_goto_addr; /* (jump address in memory of boot code) */ + UInt32 dpme_goto_addr_2; /* (reserved for future use) */ + UInt32 dpme_checksum; /* (checksum of boot code) */ + UInt8 dpme_process_id[16]; /* (processor type) */ + UInt32 dpme_reserved_2[32]; /* (reserved for future use) */ + UInt32 dpme_reserved_3[62]; /* (reserved for future use) */ +} DPME; + +/* Driver descriptor map entry. */ + +typedef struct DDMap +{ + UInt32 ddBlock; /* (driver's block start, sbBlkSize-blocks) */ + UInt16 ddSize; /* (driver's block count, 512-blocks) */ + UInt16 ddType; /* (driver's system type) */ +} DDMap; + +/* Driver descriptor map, as found in block zero of the disk. */ + +typedef struct Block0 +{ + UInt16 sbSig; /* (unique value for block zero, 'ER') */ + UInt16 sbBlkSize; /* (block size for this device) */ + UInt32 sbBlkCount; /* (block count for this device) */ + UInt16 sbDevType; /* (device type) */ + UInt16 sbDevId; /* (device id) */ + UInt32 sbDrvrData; /* (driver data) */ + UInt16 sbDrvrCount; /* (driver descriptor count) */ + DDMap sbDrvrMap[8]; /* (driver descriptor table) */ + UInt8 sbReserved[430]; /* (reserved for future use) */ +} Block0; + +/* Partition map signature (sbSig). */ + +#define BLOCK0_SIGNATURE 0x4552 + +/* Partition map entry signature (dpme_signature). */ + +#define DPME_SIGNATURE 0x504D + +/* Partition map entry flags (dpme_flags). */ + +#define DPME_FLAGS_VALID 0x00000001 /* (bit 0) */ +#define DPME_FLAGS_ALLOCATED 0x00000002 /* (bit 1) */ +#define DPME_FLAGS_IN_USE 0x00000004 /* (bit 2) */ +#define DPME_FLAGS_BOOTABLE 0x00000008 /* (bit 3) */ +#define DPME_FLAGS_READABLE 0x00000010 /* (bit 4) */ +#define DPME_FLAGS_WRITABLE 0x00000020 /* (bit 5) */ +#define DPME_FLAGS_OS_PIC_CODE 0x00000040 /* (bit 6) */ +#define DPME_FLAGS_OS_SPECIFIC_2 0x00000080 /* (bit 7) */ +#define DPME_FLAGS_OS_SPECIFIC_1 0x00000100 /* (bit 8) */ +#define DPME_FLAGS_RESERVED_2 0xFFFFFE00 /* (bit 9..31) */ + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* !_IOAPPLEPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBDBlockStorageDevice.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBDBlockStorageDevice.h.svn-base new file mode 100644 index 0000000..66a09d7 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBDBlockStorageDevice.h.svn-base @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDBlockStorageDevice + * @abstract + * This header contains the IOBDBlockStorageDevice class definition. + */ + +#ifndef _IOBDBLOCKSTORAGEDEVICE_H +#define _IOBDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IOBDTypes.h> + +/*! + * @defined kIOBDBlockStorageDeviceClass + * @abstract + * kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. + * @discussion + * kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. + */ + +#define kIOBDBlockStorageDeviceClass "IOBDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeBD "BD" + +/*! + * @class + * IOBDBlockStorageDevice + * @abstract + * The IOBDBlockStorageDevice class is a generic BD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic BD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD APIs, DVD APIs, and all + * necessary new low-level BD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IOBDBlockStorageDevice : public IODVDBlockStorageDevice +{ + OSDeclareAbstractStructors(IOBDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /*! + * @function init + * @discussion + * Initialize this object's minimal state. + * @param properties + * Substitute property table for this object (optional). + * @result + * Returns true on success, false otherwise. + */ + + virtual bool init(OSDictionary * properties); + + /*! + * @function readDiscStructure + * @discussion + * Issue an MMC READ DISC STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param type + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscStructure( IOMemoryDescriptor * buffer, + UInt8 format, + UInt32 address, + UInt8 layer, + UInt8 grantID, + UInt8 type ) = 0; + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address) = 0; + + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 0); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBDBlockStorageDriver.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBDBlockStorageDriver.h.svn-base new file mode 100644 index 0000000..199218c --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBDBlockStorageDriver.h.svn-base @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDBlockStorageDriver + * @abstract + * This header contains the IOBDBlockStorageDriver class definition. + * @discussion + * This class implements BD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IOBDBLOCKSTORAGEDRIVER_H +#define _IOBDBLOCKSTORAGEDRIVER_H + +#include <IOKit/storage/IOBDBlockStorageDevice.h> +#include <IOKit/storage/IODVDBlockStorageDriver.h> + +/*! + * @defined kIOBDBlockStorageDriverClass + * @abstract + * kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class. + * @discussion + * kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class. + */ + +#define kIOBDBlockStorageDriverClass "IOBDBlockStorageDriver" + +/*! + * @class + * IOBDBlockStorageDriver + * @abstract + * Generic BD Driver. + * @discussion + * Storage drivers are split into two parts: the Generic Driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the Generic Driver level are translated into a series of generic + * device operations. These operations are passed via the Device Nub + * to a Transport Driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its Transport Driver would issue a Mode Sense command to + * extract the write-protection status bit. The Transport Driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the Transport Driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IOBDBlockStorageDriver class is a subclass + * of IODVDBlockStorageDriver, adding BD functions. Similarly, the Transport Driver + * IOBDBlockStorageDevice is a subclass of IODVDBlockStorageDevice, adding BD + * functions. +*/ + +class IOBDBlockStorageDriver : public IODVDBlockStorageDriver +{ + OSDeclareDefaultStructors(IOBDBlockStorageDriver) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /* Overrides of IODVDBlockStorageDriver. */ + + virtual IOReturn acceptNewMedia(void); + + /* End of IODVDBlockStorageDriver overrides. */ + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBDBlockStorageDevice * getProvider() const; + + /* Overrides of IODVDBlockStorageDriver: */ + + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); + + /* End of IODVDBlockStorageDriver overrides. */ + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address); + + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 0); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 15); +}; + +#endif /* !_IOBDBLOCKSTORAGEDRIVER_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBDMedia.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBDMedia.h.svn-base new file mode 100644 index 0000000..e204a1e --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBDMedia.h.svn-base @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDMedia + * @abstract + * This header contains the IOBDMedia class definition. + */ + +#ifndef _IOBDMEDIA_H +#define _IOBDMEDIA_H + +/*! + * @defined kIOBDMediaClass + * @abstract + * kIOBDMediaClass is the name of the IOBDMedia class. + * @discussion + * kIOBDMediaClass is the name of the IOBDMedia class. + */ + +#define kIOBDMediaClass "IOBDMedia" + +/*! + * @defined kIOBDMediaTypeKey + * @abstract + * kIOBDMediaTypeKey is a property of IOBDMedia objects. It has an OSString + * value. + * @discussion + * The kIOBDMediaTypeKey property identifies the BD media type (BD-ROM, BD-R, + * BD-RE, etc). See the kIOBDMediaType contants for possible values. + */ + +#define kIOBDMediaTypeKey "Type" + +/*! + * @defined kIOBDMediaTypeROM + * The kIOBDMediaTypeKey constant for BD-ROM media. + */ + +#define kIOBDMediaTypeROM "BD-ROM" + +/*! + * @defined kIOBDMediaTypeR + * The kIOBDMediaTypeKey constant for BD-R media. + */ + +#define kIOBDMediaTypeR "BD-R" + +/*! + * @defined kIOBDMediaTypeRE + * The kIOBDMediaTypeKey constant for BD-RE media. + */ + +#define kIOBDMediaTypeRE "BD-RE" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IOBDMedia + * @abstract + * The IOBDMedia class is a random-access disk device abstraction for BDs. + * @discussion + * The IOBDMedia class is a random-access disk device abstraction for BDs. + */ + +class IOBDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IOBDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function reportKey + * @discussion + * Issue an MMC REPORT KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param address + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt32 address, + UInt8 grantID, + UInt8 format ); + + /*! + * @function sendKey + * @discussion + * Issue an MMC SEND KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn sendKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt8 grantID, + UInt8 format ); + + /*! + * @function readStructure + * @discussion + * Issue an MMC READ DISC STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readStructure( IOMemoryDescriptor * buffer, + UInt8 format, + UInt32 address, + UInt8 layer, + UInt8 grantID ); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kBDSpeedMin specifies the minimum speed for all BD media (1X). + * kBDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kBDSpeedMin specifies the minimum speed for all BD media (1X). + * kBDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param type + * Reserved for future use. Set to zero. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer, + UInt8 type, + UInt16 * actualByteCount ); + + /*! + * @function readTrackInfo + * @discussion + * Issue an MMC READ TRACK INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param open + * Reserved for future use. Set to zero. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTrackInfo( IOMemoryDescriptor * buffer, + UInt32 address, + UInt8 addressType, + UInt8 open, + UInt16 * actualByteCount ); + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address); + + OSMetaClassDeclareReservedUnused(IOBDMedia, 0); + OSMetaClassDeclareReservedUnused(IOBDMedia, 1); + OSMetaClassDeclareReservedUnused(IOBDMedia, 2); + OSMetaClassDeclareReservedUnused(IOBDMedia, 3); + OSMetaClassDeclareReservedUnused(IOBDMedia, 4); + OSMetaClassDeclareReservedUnused(IOBDMedia, 5); + OSMetaClassDeclareReservedUnused(IOBDMedia, 6); + OSMetaClassDeclareReservedUnused(IOBDMedia, 7); + OSMetaClassDeclareReservedUnused(IOBDMedia, 8); + OSMetaClassDeclareReservedUnused(IOBDMedia, 9); + OSMetaClassDeclareReservedUnused(IOBDMedia, 10); + OSMetaClassDeclareReservedUnused(IOBDMedia, 11); + OSMetaClassDeclareReservedUnused(IOBDMedia, 12); + OSMetaClassDeclareReservedUnused(IOBDMedia, 13); + OSMetaClassDeclareReservedUnused(IOBDMedia, 14); + OSMetaClassDeclareReservedUnused(IOBDMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDMEDIA_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBDMediaBSDClient.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBDMediaBSDClient.h.svn-base new file mode 100644 index 0000000..ee356f5 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBDMediaBSDClient.h.svn-base @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOBDMEDIABSDCLIENT_H +#define _IOBDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> +#include <sys/types.h> + +#include <IOKit/storage/IOBDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCBDREADSTRUCTURE see IOBDMedia::readStructure() in IOBDMedia.h + * + * DKIOCBDREADDISCINFO see IOBDMedia::readDiscInfo() in IOBDMedia.h + * DKIOCBDREADTRACKINFO see IOBDMedia::readTrackInfo() in IOBDMedia.h + * + * DKIOCBDREPORTKEY see IOBDMedia::reportKey() in IOBDMedia.h + * DKIOCBDSENDKEY see IOBDMedia::sendKey() in IOBDMedia.h + * + * DKIOCBDGETSPEED see IOBDMedia::getSpeed() in IOBDMedia.h + * DKIOCBDSETSPEED see IOBDMedia::setSpeed() in IOBDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint8_t format; + + uint8_t reserved0008[3]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + uint8_t layer; + + uint8_t reserved0080[4]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_read_structure_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[2]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_report_key_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[6]; /* reserved, clear to zero */ + + uint8_t grantID; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_send_key_t; + +typedef struct +{ + uint8_t reserved0000[14]; /* reserved, clear to zero */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_bd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_bd_read_track_info_t; + +#define DKIOCBDREADSTRUCTURE _IOW('d', 160, dk_bd_read_structure_t) +#define DKIOCBDREPORTKEY _IOW('d', 161, dk_bd_report_key_t) +#define DKIOCBDSENDKEY _IOW('d', 162, dk_bd_send_key_t) + +#define DKIOCBDGETSPEED _IOR('d', 163, uint16_t) +#define DKIOCBDSETSPEED _IOW('d', 163, uint16_t) + +#define DKIOCBDREADDISCINFO _IOWR('d', 164, dk_bd_read_disc_info_t) +#define DKIOCBDREADTRACKINFO _IOWR('d', 165, dk_bd_read_track_info_t) + +#define DKIOCBDSPLITTRACK _IOW('d', 166, uint32_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IOBDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IOBDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IOBDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOBDMedia * getProvider() const; + + /* + * Process a BD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBDTypes.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBDTypes.h.svn-base new file mode 100644 index 0000000..f5b7927 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBDTypes.h.svn-base @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _BDTYPES_H +#define _BDTYPES_H + +#include <IOKit/IOTypes.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Media Types + */ + +enum +{ + kBDMediaTypeUnknown = 0x0300, + kBDMediaTypeROM = 0x0302, /* BD-ROM */ + kBDMediaTypeRE = 0x0303, /* BD-RE */ + kBDMediaTypeR = 0x0304, /* BD-R */ + + kBDMediaTypeMin = 0x0300, + kBDMediaTypeMax = 0x03FF +}; + +typedef UInt32 BDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kBDSpeedMin 0x1126 +#define kBDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +// Read Disc Information Format +struct BDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastSession:2; + UInt8 erasable:1; + UInt8 dataType:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 dataType:3; + UInt8 erasable:1; + UInt8 stateOfLastSession:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2; + UInt8 numberOfSessionsLSB; + UInt8 firstTrackNumberInLastSessionLSB; + UInt8 lastTrackNumberInLastSessionLSB; + UInt8 reserved4[2]; + UInt8 numberOfSessionsMSB; + UInt8 firstTrackNumberInLastSessionMSB; + UInt8 lastTrackNumberInLastSessionMSB; + UInt8 reserved6[22]; +}; +typedef struct BDDiscInfo BDDiscInfo; + +// Read Track Information Format +struct BDTrackInfo +{ + UInt16 dataLength; + UInt8 trackNumberLSB; + UInt8 sessionNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved2:5; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 reserved4:6; + UInt8 blank:1; + UInt8 reservedTrack:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 reserved2:5; + + UInt8 reservedTrack:1; + UInt8 blank:1; + UInt8 reserved4:6; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 trackStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 clusterSize; + UInt32 trackSize; + UInt32 lastRecordedAddress; + UInt8 trackNumberMSB; + UInt8 sessionNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct BDTrackInfo BDTrackInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _BDTYPES_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBlockStorageDevice.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBlockStorageDevice.h.svn-base new file mode 100644 index 0000000..bbec146 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBlockStorageDevice.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBlockStorageDevice + * @abstract + * This header contains the IOBlockStorageDevice class definition. + */ + +#ifndef _IOBLOCKSTORAGEDEVICE_H +#define _IOBLOCKSTORAGEDEVICE_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOStorageDeviceCharacteristics.h> + +/*! + * @defined kIOBlockStorageDeviceClass + * @abstract + * The name of the IOBlockStorageDevice class. + */ + +#define kIOBlockStorageDeviceClass "IOBlockStorageDevice" + +/*! + * @defined kIOBlockStorageDeviceWriteCacheStateKey + * @abstract + * The name of the property used to get or set the write cache state of the + * block storage device. + */ +#define kIOBlockStorageDeviceWriteCacheStateKey "WriteCacheState" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOMessage.h> +#include <IOKit/IOService.h> +#include <IOKit/storage/IOMedia.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +/*! + * @defined kIOBlockStorageDeviceTypeKey + * @abstract The name of the property tested for nub type matching by the generic block + * storage driver. + */ +#define kIOBlockStorageDeviceTypeKey "device-type" +/*! + * @defined kIOBlockStorageDeviceTypeGeneric + * @abstract A character string used for nub matching. + */ +#define kIOBlockStorageDeviceTypeGeneric "Generic" + + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOBlockStorageDriver.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOBlockStorageDriver.h.svn-base new file mode 100644 index 0000000..24ac3c2 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOBlockStorageDriver.h.svn-base @@ -0,0 +1,245 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBlockStorageDriver + * @abstract + * This header contains the IOBlockStorageDriver class definition. + */ + +#ifndef _IOBLOCKSTORAGEDRIVER_H +#define _IOBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOBlockStorageDriverClass + * @abstract + * The name of the IOBlockStorageDriver class. + */ + +#define kIOBlockStorageDriverClass "IOBlockStorageDriver" + +/*! + * @defined kIOBlockStorageDriverStatisticsKey + * @abstract + * Holds a table of numeric values describing the driver's + * operating statistics. + * @discussion + * This property holds a table of numeric values describing the driver's + * operating statistics. The table is an OSDictionary, where each entry + * describes one given statistic. + */ + +#define kIOBlockStorageDriverStatisticsKey "Statistics" + +/*! + * @defined kIOBlockStorageDriverStatisticsBytesReadKey + * @abstract + * Describes the number of bytes read since the block storage + * driver was instantiated. + * @discussion + * This property describes the number of bytes read since the block storage + * driver was instantiated. It is one of the statistic entries listed under + * the top-level kIOBlockStorageDriverStatisticsKey property table. It has + * an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsBytesReadKey "Bytes (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsBytesWrittenKey + * @abstract + * Describes the number of bytes written since the block storage + * driver was instantiated. + * @discussion + * This property describes the number of bytes written since the block storage + * driver was instantiated. It is one of the statistic entries listed under the + * top-level kIOBlockStorageDriverStatisticsKey property table. It has an + * OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsBytesWrittenKey "Bytes (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadErrorsKey + * @abstract + * Describes the number of read errors encountered since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of read errors encountered since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadErrorsKey "Errors (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWriteErrorsKey + * @abstract + * Describes the number of write errors encountered since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of write errors encountered since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWriteErrorsKey "Errors (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsLatentReadTimeKey + * @abstract + * Describes the number of nanoseconds of latency during reads + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds of latency during reads + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsLatentReadTimeKey "Latency Time (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsLatentWriteTimeKey + * @abstract + * Describes the number of nanoseconds of latency during writes + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds of latency during writes + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsLatentWriteTimeKey "Latency Time (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadsKey + * @abstract + * Describes the number of read operations processed since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of read operations processed since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadsKey "Operations (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWritesKey + * @abstract + * Describes the number of write operations processed since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of write operations processed since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWritesKey "Operations (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadRetriesKey + * @abstract + * Describes the number of read retries required since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of read retries required since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadRetriesKey "Retries (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWriteRetriesKey + * @abstract + * Describes the number of write retries required since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of write retries required since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWriteRetriesKey "Retries (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsTotalReadTimeKey + * @abstract + * Describes the number of nanoseconds spent performing reads + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds spent performing reads + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsTotalReadTimeKey "Total Time (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsTotalWriteTimeKey + * @abstract + * Describes the number of nanoseconds spent performing writes + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds spent performing writes + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsTotalWriteTimeKey "Total Time (Write)" + +/*! + * @enum IOMediaState + * @abstract + * The different states that getMediaState() can report. + * @constant kIOMediaStateOffline + * Media is not available. + * @constant kIOMediaStateOnline + * Media is available and ready for operations. + * @constant kIOMediaStateBusy + * Media is available, but not ready for operations. + */ + +enum +{ + kIOMediaStateOffline = 0, + kIOMediaStateOnline = 1, + kIOMediaStateBusy = 2 +}; + +typedef UInt32 IOMediaState; + +#endif /* !_IOBLOCKSTORAGEDRIVER_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOCDBlockStorageDevice.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOCDBlockStorageDevice.h.svn-base new file mode 100644 index 0000000..706da40 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOCDBlockStorageDevice.h.svn-base @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDBlockStorageDevice + * @abstract + * This header contains the IOCDBlockStorageDevice class definition. + */ + +#ifndef _IOCDBLOCKSTORAGEDEVICE_H +#define _IOCDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IOCDTypes.h> + +/*! + * @defined kIOCDBlockStorageDeviceClass + * @abstract + * kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. + * @discussion + * kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. + */ + +#define kIOCDBlockStorageDeviceClass "IOCDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeCDROM "CDROM" + + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOCDBlockStorageDriver.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOCDBlockStorageDriver.h.svn-base new file mode 100644 index 0000000..f88a406 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOCDBlockStorageDriver.h.svn-base @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOCDBlockStorageDriver.h + * + * This class implements CD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IOCDBLOCKSTORAGEDRIVER_H +#define _IOCDBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOCDBlockStorageDevice.h> +#include <IOKit/storage/IOCDTypes.h> +#include <IOKit/storage/IOBlockStorageDriver.h> + +/*! + * @defined kIOCDBlockStorageDriverClass + * @abstract + * kIOCDBlockStorageDriverClass is the name of the IOCDBlockStorageDriver class. + * @discussion + * kIOCDBlockStorageDriverClass is the name of the IOCDBlockStorageDriver class. + */ + +#define kIOCDBlockStorageDriverClass "IOCDBlockStorageDriver" + +#endif diff --git a/i386/include/IOKit/storage/.svn/text-base/IOCDMedia.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOCDMedia.h.svn-base new file mode 100644 index 0000000..85ad72d --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOCDMedia.h.svn-base @@ -0,0 +1,553 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDMedia + * @abstract + * This header contains the IOCDMedia class definition. + */ + +#ifndef _IOCDMEDIA_H +#define _IOCDMEDIA_H + +/*! + * @defined kIOCDMediaClass + * @abstract + * kIOCDMediaClass is the name of the IOCDMedia class. + * @discussion + * kIOCDMediaClass is the name of the IOCDMedia class. + */ + +#define kIOCDMediaClass "IOCDMedia" + +/*! + * @defined kIOCDMediaTOCKey + * @abstract + * kIOCDMediaTOCKey is a property of IOCDMedia objects. It has an OSData value + * and a CDTOC structure. + * @discussion + * The kIOCDMediaTOCKey property contains the CD's full table of contents, + * formatted as a CDTOC structure. The CDTOC structure is same as what is + * returned by a READ TOC command, format 0x02. All fields in the TOC are + * guaranteed to be binary-encoded (no BCD-encoded numbers are ever passed). + */ + +#define kIOCDMediaTOCKey "TOC" + +/*! + * @defined kIOCDMediaTypeKey + * @abstract + * kIOCDMediaTypeKey is a property of IOCDMedia objects. It has an OSString + * value. + * @discussion + * The kIOCDMediaTypeKey property identifies the CD media type (CD-ROM, CD-R, + * CD-RW, etc). See the kIOCDMediaType contants for possible values. + */ + +#define kIOCDMediaTypeKey "Type" + +/*! + * @defined kIOCDMediaTypeROM + * The kIOCDMediaTypeKey constant for CD-ROM media (inclusive of the CD-I, + * CD-ROM XA, and CD Audio standards, and mixed mode combinations thereof). + */ + +#define kIOCDMediaTypeROM "CD-ROM" + +/*! + * @defined kIOCDMediaTypeR + * The kIOCDMediaTypeKey constant for CD Recordable (CD-R) media. + */ + +#define kIOCDMediaTypeR "CD-R" + +/*! + * @defined kIOCDMediaTypeRW + * The kIOCDMediaTypeKey constant for CD ReWritable (CD-RW) media. + */ + +#define kIOCDMediaTypeRW "CD-RW" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IOCDMedia + * @abstract + * The IOCDMedia class is a random-access disk device abstraction for CDs. + * @discussion + * The IOCDMedia class is a random-access disk device abstraction for CDs. It + * extends the IOMedia class by implementing special CD APIs, such as readCD, + * and publishing the TOC as a property of the IOCDMedia object. + */ + +class IOCDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IOCDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOCDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOCDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function readCD + * @discussion + * Read data from the CD media object at the specified byte offset into the + * specified buffer, asynchronously. Special areas of the CD sector can be + * read via this method, such as the header and subchannel data. When the + * read completes, the caller will be notified via the specified completion + * action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to read. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. The data transfer is terminated as soon as + * data is encountered that does not match the expected type. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + +#ifdef __LP64__ + virtual void readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); +#else /* !__LP64__ */ + virtual void readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion); +#endif /* !__LP64__ */ + + /*! + * @function readCD + * @discussion + * Read data from the CD media object at the specified byte offset into the + * specified buffer, synchronously. Special areas of the CD sector can be + * read via this method, such as the header and subchannel data. When the + * read completes, this method will return to the caller. The actual byte + * count field is optional. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to read. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. The data transfer is terminated as soon as + * data is encountered that does not match the expected type. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + +#ifdef __LP64__ + virtual IOReturn readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); +#else /* !__LP64__ */ + virtual IOReturn readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + UInt64 * actualByteCount = 0); +#endif /* !__LP64__ */ + + /*! + * @function readISRC + * @discussion + * Read the International Standard Recording Code for the specified track. + * @param track + * Track number from which to read the ISRC. + * @param isrc + * Buffer for the ISRC data. Buffer contents will be zero-terminated. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn readISRC(UInt8 track, CDISRC isrc); + + /*! + * @function readMCN + * @discussion + * Read the Media Catalog Number (also known as the Universal Product Code). + * @param mcn + * Buffer for the MCN data. Buffer contents will be zero-terminated. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn readMCN(CDMCN mcn); + + /*! + * @function getTOC + * @discussion + * Get the full Table Of Contents. + * + * All CDTOC fields passed across I/O Kit APIs are guaranteed to be + * binary-encoded (no BCD-encoded numbers are ever passed). + * @result + * Returns a pointer to the TOC buffer (do not deallocate). + */ + + virtual CDTOC * getTOC(); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kCDSpeedMin specifies the minimum speed for all CD media (1X). + * kCDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kCDSpeedMin specifies the minimum speed for all CD media (1X). + * kCDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function readTOC + * @discussion + * Issue an MMC READ TOC/PMA/ATIP command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param formatAsTime + * As documented by MMC. + * @param trackOrSessionNumber + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTOC(IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 formatAsTime, + UInt8 trackOrSessionNumber, + UInt16 * actualByteCount); /* 10.1.3 */ + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo(IOMemoryDescriptor * buffer, + UInt16 * actualByteCount); /* 10.1.3 */ + + /*! + * @function readTrackInfo + * @discussion + * Issue an MMC READ TRACK INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTrackInfo(IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount); /* 10.1.3 */ + + /* + * @function writeCD + * @discussion + * Write data into the CD media object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to write. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + +#ifdef __LP64__ + virtual void writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); +#else /* !__LP64__ */ + virtual void writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion); /* 10.2.0 */ +#endif /* !__LP64__ */ + + /* + * @function writeCD + * @discussion + * Write data into the CD media object at the specified byte offset from the + * specified buffer, synchronously. When the write completes, this method + * will return to the caller. The actual byte count field is optional. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to write. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + +#ifdef __LP64__ + virtual IOReturn writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); +#else /* !__LP64__ */ + virtual IOReturn writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + UInt64 * actualByteCount = 0); /* 10.2.0 */ +#endif /* !__LP64__ */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOCDMedia, 0); + OSMetaClassDeclareReservedUnused(IOCDMedia, 1); + OSMetaClassDeclareReservedUnused(IOCDMedia, 2); + OSMetaClassDeclareReservedUnused(IOCDMedia, 3); + OSMetaClassDeclareReservedUnused(IOCDMedia, 4); + OSMetaClassDeclareReservedUnused(IOCDMedia, 5); + OSMetaClassDeclareReservedUnused(IOCDMedia, 6); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOCDMedia, 0); + OSMetaClassDeclareReservedUsed(IOCDMedia, 1); + OSMetaClassDeclareReservedUsed(IOCDMedia, 2); + OSMetaClassDeclareReservedUsed(IOCDMedia, 3); + OSMetaClassDeclareReservedUsed(IOCDMedia, 4); + OSMetaClassDeclareReservedUsed(IOCDMedia, 5); + OSMetaClassDeclareReservedUsed(IOCDMedia, 6); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOCDMedia, 7); + OSMetaClassDeclareReservedUnused(IOCDMedia, 8); + OSMetaClassDeclareReservedUnused(IOCDMedia, 9); + OSMetaClassDeclareReservedUnused(IOCDMedia, 10); + OSMetaClassDeclareReservedUnused(IOCDMedia, 11); + OSMetaClassDeclareReservedUnused(IOCDMedia, 12); + OSMetaClassDeclareReservedUnused(IOCDMedia, 13); + OSMetaClassDeclareReservedUnused(IOCDMedia, 14); + OSMetaClassDeclareReservedUnused(IOCDMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDMEDIA_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOCDMediaBSDClient.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOCDMediaBSDClient.h.svn-base new file mode 100644 index 0000000..ce31863 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOCDMediaBSDClient.h.svn-base @@ -0,0 +1,199 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOCDMEDIABSDCLIENT_H +#define _IOCDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> + +#include <IOKit/storage/IOCDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCCDREAD see IOCDMedia::readCD() in IOCDMedia.h + * DKIOCCDREADTOC see IOCDMedia::readTOC() in IOCDMedia.h + * + * DKIOCCDREADDISCINFO see IOCDMedia::readDiscInfo() in IOCDMedia.h + * DKIOCCDREADTRACKINFO see IOCDMedia::readTrackInfo() in IOCDMedia.h + * + * DKIOCCDREADISRC see IOCDMedia::readISRC() in IOCDMedia.h + * DKIOCCDREADMCN see IOCDMedia::readMCN() in IOCDMedia.h + * + * DKIOCCDGETSPEED see IOCDMedia::getSpeed() in IOCDMedia.h + * DKIOCCDSETSPEED see IOCDMedia::setSpeed() in IOCDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint64_t offset; + + uint8_t sectorArea; + uint8_t sectorType; + +#ifdef __LP64__ + uint8_t reserved0080[10]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0080[6]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint32_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_t; + +typedef struct +{ + CDISRC isrc; + uint8_t track; + + uint8_t reserved0112[2]; /* reserved, clear to zero */ +} dk_cd_read_isrc_t; + +typedef struct +{ + CDMCN mcn; + + uint8_t reserved0112[2]; /* reserved, clear to zero */ +} dk_cd_read_mcn_t; + +typedef struct +{ + uint8_t format; + uint8_t formatAsTime; + + uint8_t reserved0016[5]; /* reserved, clear to zero */ + + union + { + uint8_t session; + uint8_t track; + } address; + +#ifdef __LP64__ + uint8_t reserved0064[6]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0064[2]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_toc_t; + +typedef struct +{ +#ifdef __LP64__ + uint8_t reserved0000[14]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0000[10]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_track_info_t; + +#define DKIOCCDREAD _IOWR('d', 96, dk_cd_read_t) + +#define DKIOCCDREADISRC _IOWR('d', 97, dk_cd_read_isrc_t) +#define DKIOCCDREADMCN _IOWR('d', 98, dk_cd_read_mcn_t) + +#define DKIOCCDGETSPEED _IOR('d', 99, uint16_t) +#define DKIOCCDSETSPEED _IOW('d', 99, uint16_t) + +#define DKIOCCDREADTOC _IOWR('d', 100, dk_cd_read_toc_t) + +#define DKIOCCDREADDISCINFO _IOWR('d', 101, dk_cd_read_disc_info_t) +#define DKIOCCDREADTRACKINFO _IOWR('d', 102, dk_cd_read_track_info_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IOCDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IOCDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IOCDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOCDMedia * getProvider() const; + + /* + * Process a CD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOCDPartitionScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOCDPartitionScheme.h.svn-base new file mode 100644 index 0000000..1ff58c4 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOCDPartitionScheme.h.svn-base @@ -0,0 +1,226 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDPartitionScheme + * @abstract + * This header contains the IOCDPartitionScheme class definition. + */ + +#ifndef _IOCDPARTITIONSCHEME_H +#define _IOCDPARTITIONSCHEME_H + +#include <IOKit/storage/IOCDTypes.h> + +/*! + * @defined kIOCDPartitionSchemeClass + * @abstract + * kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class. + * @discussion + * kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class. + */ + +#define kIOCDPartitionSchemeClass "IOCDPartitionScheme" + +/*! + * @defined kIOMediaSessionIDKey + * @abstract + * kIOMediaSessionIDKey is property of IOMedia objects. It has an OSNumber + * value. + * @discussion + * The kIOMediaSessionIDKey property is placed into each IOMedia instance + * created by the CD partition scheme. It identifies the session number + * the track was recorded on. + */ + +#define kIOMediaSessionIDKey "Session ID" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IOPartitionScheme.h> + +/* + * Class + */ + +class IOCDPartitionScheme : public IOPartitionScheme +{ + OSDeclareDefaultStructors(IOCDPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + OSSet * _partitions; /* (set of media objects representing partitions) */ + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + /* + * Scan the provider media for CD partitions (in TOC). Returns the set + * of media objects representing each of the partitions (the retain for + * the set is passed to the caller), or null should no CD partitions be + * found. The default probe score can be adjusted up or down, based on + * the confidence of the scan. + */ + + virtual OSSet * scan(SInt32 * score); + + /* + * Ask whether the given partition appears to be corrupt. A partition that + * is corrupt will cause the failure of the CD partition scheme altogether. + */ + + virtual bool isPartitionCorrupt( CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Ask whether the given partition appears to be invalid. A partition that + * is invalid will cause it to be skipped in the scan, but will not cause a + * failure of the CD partition scheme. + */ + + virtual bool isPartitionInvalid( CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Instantiate a new media object to represent the given partition. + */ + + virtual IOMedia * instantiateMediaObject( + CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject( + CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /* + * Scan the provider media for CD partitions. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score); + + /* + * Determine whether the provider media contains CD partitions. + */ + + virtual bool start(IOService * provider); + + /* + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For the CD partition scheme, we convert the read from a partition + * object into the appropriate readCD command to our provider media. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For the CD partition scheme, we convert the write from a partition + * object into the appropriate writeCD command to our provider media. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- IOCDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOCDMedia * getProvider() const; + + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOCDTypes.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOCDTypes.h.svn-base new file mode 100644 index 0000000..6b1af29 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOCDTypes.h.svn-base @@ -0,0 +1,492 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOCDTYPES_H +#define _IOCDTYPES_H + +#include <IOKit/IOTypes.h> +#include <libkern/OSByteOrder.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Minutes, Seconds, Frames (M:S:F) + * + * All M:S:F values passed across I/O Kit APIs are guaranteed to be + * binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +typedef struct +{ + UInt8 minute; + UInt8 second; + UInt8 frame; +} CDMSF; + +/* + * Media Catalogue Numbers (MCN), International Standard Recording Codes (ISRC) + * + * All MCN and ISRC values passed across I/O Kit APIs are guaranteed + * to have a zero-terminating byte, for convenient use as C strings. + */ + +#define kCDMCNMaxLength 13 +#define kCDISRCMaxLength 12 + +typedef char CDMCN [kCDMCNMaxLength + 1]; +typedef char CDISRC[kCDISRCMaxLength + 1]; + +/* + * Audio Status + * + * All CDAudioStatus fields passed across I/O Kit APIs are guaranteed to + * be binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +#define kCDAudioStatusUnsupported 0x00 +#define kCDAudioStatusActive 0x11 +#define kCDAudioStatusPaused 0x12 +#define kCDAudioStatusSuccess 0x13 +#define kCDAudioStatusFailure 0x14 +#define kCDAudioStatusNone 0x15 + +typedef struct +{ + UInt8 status; + struct + { + CDMSF time; + struct + { + UInt8 index; + UInt8 number; + CDMSF time; + } track; + } position; +} CDAudioStatus; + +/* + * Table Of Contents + * + * All CDTOC fields passed across I/O Kit APIs are guaranteed to be + * binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +typedef struct +{ + UInt8 session; +#ifdef __LITTLE_ENDIAN__ + UInt8 control:4, adr:4; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 adr:4, control:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 tno; + UInt8 point; + CDMSF address; + UInt8 zero; + CDMSF p; +} CDTOCDescriptor; + +typedef struct +{ + UInt16 length; + UInt8 sessionFirst; + UInt8 sessionLast; + CDTOCDescriptor descriptors[0]; +} CDTOC; + +/* + * Table Of Contents Descriptor Count Convenience Function + */ + +static inline UInt32 CDTOCGetDescriptorCount(CDTOC * toc) +{ + UInt32 tocSize = OSSwapBigToHostInt16(toc->length) + (UInt32) sizeof(toc->length); + + return (tocSize < (UInt32) sizeof(CDTOC)) ? 0 : + (tocSize - (UInt32) sizeof(CDTOC)) / (UInt32) sizeof(CDTOCDescriptor); +} + +/* + * M:S:F To LBA Convenience Function + */ + +static inline UInt32 CDConvertMSFToLBA(CDMSF msf) +{ + return (((msf.minute * 60U) + msf.second) * 75U) + msf.frame - 150U; +} + +/* + * M:S:F To Clipped LBA Convenience Function + */ + +static inline UInt32 CDConvertMSFToClippedLBA(CDMSF msf) +{ + return (msf.minute == 0 && msf.second <= 1) ? 0 : CDConvertMSFToLBA(msf); +} + +/* + * LBA To M:S:F Convenience Function + */ + +static inline CDMSF CDConvertLBAToMSF(UInt32 lba) +{ + CDMSF msf; + + lba += 150; + msf.minute = (lba / (75 * 60)); + msf.second = (lba % (75 * 60)) / 75; + msf.frame = (lba % (75 )); + + return msf; +} + +/* + * Track Number To M:S:F Convenience Function + * + * The CDTOC structure is assumed to be complete, that is, none of + * the descriptors are missing or clipped due to an insufficiently + * sized buffer holding the CDTOC contents. + */ + +static inline CDMSF CDConvertTrackNumberToMSF(UInt8 track, CDTOC * toc) +{ + UInt32 count = CDTOCGetDescriptorCount(toc); + UInt32 i; + CDMSF msf = { 0xFF, 0xFF, 0xFF }; + + for (i = 0; i < count; i++) + { + if (toc->descriptors[i].point == track && toc->descriptors[i].adr == 1) + { + msf = toc->descriptors[i].p; + break; + } + } + + return msf; +} + +/* + * Sector Areas, Sector Types + * + * Bytes Per Type CDDA Mode1 Mode2 Mode2Form1 Mode2Form2 + * Per Area +----------+----------+----------+----------+----------+ + * Sync | 0 | 12 | 12 | 12 | 12 | + * Header | 0 | 4 | 4 | 4 | 4 | + * SubHeader | 0 | 0 | 0 | 8 | 8 | + * User | 2352 | 2048 | 2336 | 2048 | 2328 | + * Auxiliary | 0 | 288 | 0 | 280 | 0 | + * ErrorFlags | 294 | 294 | 294 | 294 | 294 | + * SubChannel | 96 | 96 | 96 | 96 | 96 | + * SubChannelQ | 16 | 16 | 16 | 16 | 16 | + * +----------+----------+----------+----------+----------+ + */ + +typedef enum +{ + kCDSectorAreaSync = 0x80, + kCDSectorAreaHeader = 0x20, + kCDSectorAreaSubHeader = 0x40, + kCDSectorAreaUser = 0x10, + kCDSectorAreaAuxiliary = 0x08, + kCDSectorAreaErrorFlags = 0x02, + kCDSectorAreaSubChannel = 0x01, + kCDSectorAreaSubChannelQ = 0x04 +} CDSectorArea; + +typedef enum +{ + kCDSectorTypeUnknown = 0x00, + kCDSectorTypeCDDA = 0x01, + kCDSectorTypeMode1 = 0x02, + kCDSectorTypeMode2 = 0x03, + kCDSectorTypeMode2Form1 = 0x04, + kCDSectorTypeMode2Form2 = 0x05, + kCDSectorTypeCount = 0x06 +} CDSectorType; + +typedef enum +{ + kCDSectorSizeCDDA = 2352, + kCDSectorSizeMode1 = 2048, + kCDSectorSizeMode2 = 2336, + kCDSectorSizeMode2Form1 = 2048, + kCDSectorSizeMode2Form2 = 2328, + kCDSectorSizeWhole = 2352 +} CDSectorSize; + +/* + * Media Types + */ + +typedef enum +{ + kCDMediaTypeUnknown = 0x0100, + kCDMediaTypeROM = 0x0102, /* CD-ROM */ + kCDMediaTypeR = 0x0104, /* CD-R */ + kCDMediaTypeRW = 0x0105, /* CD-RW */ + + kCDMediaTypeMin = 0x0100, + kCDMediaTypeMax = 0x01FF +}; + +typedef UInt32 CDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kCDSpeedMin 0x00B0 +#define kCDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +// Read Table Of Contents Format Types +typedef UInt8 CDTOCFormat; +enum +{ + kCDTOCFormatTOC = 0x02, // CDTOC + kCDTOCFormatPMA = 0x03, // CDPMA + kCDTOCFormatATIP = 0x04, // CDATIP + kCDTOCFormatTEXT = 0x05 // CDTEXT +}; + +// Read Table Of Contents Format 0x03 +struct CDPMADescriptor +{ + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 control:4, adr:4; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 adr:4, control:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 tno; + UInt8 point; + CDMSF address; + UInt8 zero; + CDMSF p; +}; +typedef struct CDPMADescriptor CDPMADescriptor; + +struct CDPMA +{ + UInt16 dataLength; + UInt8 reserved; + UInt8 reserved2; + CDPMADescriptor descriptors[0]; +}; +typedef struct CDPMA CDPMA; + +// Read Table Of Contents Format 0x04 +struct CDATIP +{ + UInt16 dataLength; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 referenceSpeed:3; + UInt8 reserved3:1; + UInt8 indicativeTargetWritingPower:3; + UInt8 reserved2:1; + + UInt8 reserved5:6; + UInt8 unrestrictedUse:1; + UInt8 reserved4:1; + + UInt8 a3Valid:1; + UInt8 a2Valid:1; + UInt8 a1Valid:1; + UInt8 discSubType:3; + UInt8 discType:1; + UInt8 reserved6:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2:1; + UInt8 indicativeTargetWritingPower:3; + UInt8 reserved3:1; + UInt8 referenceSpeed:3; + + UInt8 reserved4:1; + UInt8 unrestrictedUse:1; + UInt8 reserved5:6; + + UInt8 reserved6:1; + UInt8 discType:1; + UInt8 discSubType:3; + UInt8 a1Valid:1; + UInt8 a2Valid:1; + UInt8 a3Valid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved7; + CDMSF startTimeOfLeadIn; + UInt8 reserved8; + CDMSF lastPossibleStartTimeOfLeadOut; + UInt8 reserved9; + UInt8 a1[3]; + UInt8 reserved10; + UInt8 a2[3]; + UInt8 reserved11; + UInt8 a3[3]; + UInt8 reserved12; +}; +typedef struct CDATIP CDATIP; + +// Read Table Of Contents Format 0x05 +struct CDTEXTDescriptor +{ + UInt8 packType; + UInt8 trackNumber; + UInt8 sequenceNumber; +#ifdef __LITTLE_ENDIAN__ + UInt8 characterPosition:4; + UInt8 blockNumber:3; + UInt8 doubleByteCharacterCode:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 doubleByteCharacterCode:1; + UInt8 blockNumber:3; + UInt8 characterPosition:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 textData[12]; + UInt8 reserved[2]; +}; +typedef struct CDTEXTDescriptor CDTEXTDescriptor; + +struct CDTEXT +{ + UInt16 dataLength; + UInt8 reserved; + UInt8 reserved2; + CDTEXTDescriptor descriptors[0]; +}; +typedef struct CDTEXT CDTEXT; + +// Read Disc Information Format +struct CDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastSession:2; + UInt8 erasable:1; + UInt8 reserved:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved:3; + UInt8 erasable:1; + UInt8 stateOfLastSession:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 numberOfFirstTrack; + UInt8 numberOfSessionsLSB; + UInt8 firstTrackNumberInLastSessionLSB; + UInt8 lastTrackNumberInLastSessionLSB; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved3:5; + UInt8 unrestrictedUse:1; + UInt8 discBarCodeValid:1; + UInt8 discIdentificationValid:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 discIdentificationValid:1; + UInt8 discBarCodeValid:1; + UInt8 unrestrictedUse:1; + UInt8 reserved3:5; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 discType; + UInt8 numberOfSessionsMSB; + UInt8 firstTrackNumberInLastSessionMSB; + UInt8 lastTrackNumberInLastSessionMSB; + UInt32 discIdentification; + UInt8 reserved7; + CDMSF lastSessionLeadInStartTime; + UInt8 reserved8; + CDMSF lastPossibleStartTimeOfLeadOut; + UInt8 discBarCode[8]; + UInt8 reserved9; + UInt8 numberOfOPCTableEntries; + UInt8 opcTableEntries[0]; +}; +typedef struct CDDiscInfo CDDiscInfo; + +// Read Track Information Address Types +typedef UInt8 CDTrackInfoAddressType; +enum +{ + kCDTrackInfoAddressTypeLBA = 0x00, + kCDTrackInfoAddressTypeTrackNumber = 0x01, + kCDTrackInfoAddressTypeSessionNumber = 0x02, +}; + +// Read Track Information Format +struct CDTrackInfo +{ + UInt16 dataLength; + UInt8 trackNumberLSB; + UInt8 sessionNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 trackMode:4; + UInt8 copy:1; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 dataMode:4; + UInt8 fixedPacket:1; + UInt8 packet:1; + UInt8 blank:1; + UInt8 reservedTrack:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 copy:1; + UInt8 trackMode:4; + + UInt8 reservedTrack:1; + UInt8 blank:1; + UInt8 packet:1; + UInt8 fixedPacket:1; + UInt8 dataMode:4; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 trackStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 fixedPacketSize; + UInt32 trackSize; + UInt32 lastRecordedAddress; + UInt8 trackNumberMSB; + UInt8 sessionNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct CDTrackInfo CDTrackInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _IOCDTYPES_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IODVDBlockStorageDevice.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IODVDBlockStorageDevice.h.svn-base new file mode 100644 index 0000000..161651c --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IODVDBlockStorageDevice.h.svn-base @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IODVDBlockStorageDevice + * @abstract + * This header contains the IODVDBlockStorageDevice class definition. + */ + +#ifndef _IODVDBLOCKSTORAGEDEVICE_H +#define _IODVDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IODVDTypes.h> + +/*! + * @defined kIODVDBlockStorageDeviceClass + * @abstract + * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. + * @discussion + * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. + */ + +#define kIODVDBlockStorageDeviceClass "IODVDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeDVD "DVD" + +/*! + * @class + * IODVDBlockStorageDevice : public IOCDBlockStorageDevice + * @abstract + * The IODVDBlockStorageDevice class is a generic DVD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic DVD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD APIs and all + * necessary new low-level DVD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IODVDBlockStorageDevice : public IOCDBlockStorageDevice { + + OSDeclareAbstractStructors(IODVDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* Overrides from IORegistryEntry */ + + virtual bool init(OSDictionary * properties); + + /* New APIs for DVD */ + + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat) = 0; + + virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt8 agid,const DVDKeyFormat keyFormat) = 0; + +#ifdef __LP64__ + virtual IOReturn readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid) = 0; +#else /* !__LP64__ */ + virtual IOReturn readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); /* 10.1.0 */ +#endif /* !__LP64__ */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 0); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IODVDBlockStorageDevice, 0); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 15); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 16); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 17); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 18); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 19); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 20); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 21); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 22); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 23); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 24); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 25); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 26); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 27); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 28); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 29); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 30); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IODVDBlockStorageDriver.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IODVDBlockStorageDriver.h.svn-base new file mode 100644 index 0000000..d9471f6 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IODVDBlockStorageDriver.h.svn-base @@ -0,0 +1,219 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IODVDBlockStorageDriver.h + * + * This class implements DVD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IODVDBLOCKSTORAGEDRIVER_H +#define _IODVDBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOCDBlockStorageDriver.h> +#include <IOKit/storage/IODVDBlockStorageDevice.h> +#include <IOKit/storage/IODVDTypes.h> + +/*! + * @defined kIODVDBlockStorageDriverClass + * @abstract + * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class. + * @discussion + * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class. + */ + +#define kIODVDBlockStorageDriverClass "IODVDBlockStorageDriver" + +class IODVDBlockStorageDevice; + +/*! + * @class + * IODVDBlockStorageDriver : public IOCDBlockStorageDriver + * @abstract + * Generic DVD Driver. + * @discussion + * Storage drivers are split into two parts: the Generic Driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the Generic Driver level are translated into a series of generic + * device operations. These operations are passed via the Device Nub + * to a Transport Driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its Transport Driver would issue a Mode Sense command to + * extract the write-protection status bit. The Transport Driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the Transport Driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IODVDBlockStorageDriver class is a subclass + * of IOCDBlockStorageDriver, adding DVD functions. Similarly, the Transport Driver + * IODVDBlockStorageDevice is a subclass of IOCDBlockStorageDevice, adding DVD + * functions. +*/ + +class IODVDBlockStorageDriver : public IOCDBlockStorageDriver { + + OSDeclareDefaultStructors(IODVDBlockStorageDriver) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /* Overrides of IOCDBlockStorageDriver. */ + + virtual IOReturn acceptNewMedia(void); + + /* End of IOCDBlockStorageDriver overrides. */ + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IODVDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IODVDBlockStorageDevice * getProvider() const; + + /* Overrides of IOCDBlockStorageDriver: */ + + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + + /* End of IOCDBlockStorageDriver overrides. */ + + /*! + * @function reportKey + * @abstract + * Get key info from the DVD drive. + * @discussion + * This function handles the getting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param lba + * As documented by MtFuji. + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat); + + /*! + * @function sendKey + * @abstract + * Send key info to the DVD drive. + * @discussion + * This function handles the setting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt8 agid,const DVDKeyFormat keyFormat); + + /*! + * @function readStructure + * @abstract + * Get control structures from the DVD media. + * @discussion + * This function handles the getting of control structure data for the media. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param format + * As documented by MtFuji. See DVDStructureFormat. + * @param address + * As documented by MtFuji. + * @param layer + * As documented by MtFuji. + * @param agid + * As documented by MtFuji. + */ + virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); /* 10.1.0 */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 0); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IODVDBlockStorageDriver, 0); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 15); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 16); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 17); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 18); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 19); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 20); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 21); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 22); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 23); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 24); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 25); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 26); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 27); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 28); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 29); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 30); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 31); +}; +#endif diff --git a/i386/include/IOKit/storage/.svn/text-base/IODVDMedia.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IODVDMedia.h.svn-base new file mode 100644 index 0000000..02119c3 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IODVDMedia.h.svn-base @@ -0,0 +1,357 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IODVDMedia + * @abstract + * This header contains the IODVDMedia class definition. + */ + +#ifndef _IODVDMEDIA_H +#define _IODVDMEDIA_H + +/*! + * @defined kIODVDMediaClass + * @abstract + * kIODVDMediaClass is the name of the IODVDMedia class. + * @discussion + * kIODVDMediaClass is the name of the IODVDMedia class. + */ + +#define kIODVDMediaClass "IODVDMedia" + +/*! + * @defined kIODVDMediaTypeKey + * @abstract + * kIODVDMediaTypeKey is a property of IODVDMedia objects. It has an OSString + * value. + * @discussion + * The kIODVDMediaTypeKey property identifies the DVD media type (DVD-ROM, + * DVD-R, DVD-RW, DVD+RW, DVD-RAM, etc). See the kIODVDMediaType contants + * for possible values. + */ + +#define kIODVDMediaTypeKey "Type" + +/*! + * @defined kIODVDMediaTypeROM + * The kIODVDMediaTypeKey constant for DVD-ROM media. + */ + +#define kIODVDMediaTypeROM "DVD-ROM" + +/*! + * @defined kIODVDMediaTypeR + * The kIODVDMediaTypeKey constant for DVD Recordable (DVD-R) media. + */ + +#define kIODVDMediaTypeR "DVD-R" + +/*! + * @defined kIODVDMediaTypeRW + * The kIODVDMediaTypeKey constant for DVD ReWritable (DVD-RW) media. + */ + +#define kIODVDMediaTypeRW "DVD-RW" + +/*! + * @defined kIODVDMediaTypePlusR + * The kIODVDMediaTypeKey constant for DVD "Plus" Recordable (DVD+R) media. + */ + +#define kIODVDMediaTypePlusR "DVD+R" + +/*! + * @defined kIODVDMediaTypePlusRW + * The kIODVDMediaTypeKey constant for DVD "Plus" ReWritable (DVD+RW) media. + */ + +#define kIODVDMediaTypePlusRW "DVD+RW" + +/*! + * @defined kIODVDMediaTypeRAM + * The kIODVDMediaTypeKey constant for DVD-RAM media. + */ + +#define kIODVDMediaTypeRAM "DVD-RAM" + +/*! + * @defined kIODVDMediaTypeHDROM + * The kIODVDMediaTypeKey constant for HD DVD-ROM media. + */ + +#define kIODVDMediaTypeHDROM "HD DVD-ROM" + +/*! + * @defined kIODVDMediaTypeHDR + * The kIODVDMediaTypeKey constant for HD DVD Recordable (HD DVD-R) media. + */ + +#define kIODVDMediaTypeHDR "HD DVD-R" + +/*! + * @defined kIODVDMediaTypeHDRW + * The kIODVDMediaTypeKey constant for HD DVD ReWritable (HD DVD-RW) media. + */ + +#define kIODVDMediaTypeHDRW "HD DVD-RW" + +/*! + * @defined kIODVDMediaTypeHDRAM + * The kIODVDMediaTypeKey constant for HD DVD-RAM media. + */ + +#define kIODVDMediaTypeHDRAM "HD DVD-RAM" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IODVDMedia + * @abstract + * The IODVDMedia class is a random-access disk device abstraction for DVDs. + * @discussion + * The IODVDMedia class is a random-access disk device abstraction for DVDs. + */ + +class IODVDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IODVDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IODVDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IODVDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function reportKey + * @discussion + * Issue an MMC REPORT KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. Pass null for the kDVDKeyFormatAGID_Invalidate format + * case. + * @param keyClass + * As documented by MMC. + * @param address + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 address, + const UInt8 grantID, + const DVDKeyFormat format ); /* 10.1.0 */ + + /*! + * @function sendKey + * @discussion + * Issue an MMC SEND KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. Pass null for the kDVDKeyFormatAGID_Invalidate format + * case. + * @param keyClass + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn sendKey( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 grantID, + const DVDKeyFormat format ); /* 10.1.0 */ + + /*! + * @function readStructure + * @discussion + * Issue an MMC READ DVD STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readStructure( IOMemoryDescriptor * buffer, + const DVDStructureFormat format, + const UInt32 address, + const UInt8 layer, + const UInt8 grantID ); /* 10.1.0 */ + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kDVDSpeedMin specifies the minimum speed for all DVD media (1X). + * kDVDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kDVDSpeedMin specifies the minimum speed for all DVD media (1X). + * kDVDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); /* 10.2.0 */ + + /*! + * @function readRZoneInfo + * @discussion + * Issue an MMC READ RZONE INFORMATION (READ TRACK INFORMATION) command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readRZoneInfo( IOMemoryDescriptor * buffer, + UInt32 address, + DVDRZoneInfoAddressType addressType, + UInt16 * actualByteCount ); /* 10.2.0 */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IODVDMedia, 0); + OSMetaClassDeclareReservedUnused(IODVDMedia, 1); + OSMetaClassDeclareReservedUnused(IODVDMedia, 2); + OSMetaClassDeclareReservedUnused(IODVDMedia, 3); + OSMetaClassDeclareReservedUnused(IODVDMedia, 4); + OSMetaClassDeclareReservedUnused(IODVDMedia, 5); + OSMetaClassDeclareReservedUnused(IODVDMedia, 6); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IODVDMedia, 0); + OSMetaClassDeclareReservedUsed(IODVDMedia, 1); + OSMetaClassDeclareReservedUsed(IODVDMedia, 2); + OSMetaClassDeclareReservedUsed(IODVDMedia, 3); + OSMetaClassDeclareReservedUsed(IODVDMedia, 4); + OSMetaClassDeclareReservedUsed(IODVDMedia, 5); + OSMetaClassDeclareReservedUsed(IODVDMedia, 6); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IODVDMedia, 7); + OSMetaClassDeclareReservedUnused(IODVDMedia, 8); + OSMetaClassDeclareReservedUnused(IODVDMedia, 9); + OSMetaClassDeclareReservedUnused(IODVDMedia, 10); + OSMetaClassDeclareReservedUnused(IODVDMedia, 11); + OSMetaClassDeclareReservedUnused(IODVDMedia, 12); + OSMetaClassDeclareReservedUnused(IODVDMedia, 13); + OSMetaClassDeclareReservedUnused(IODVDMedia, 14); + OSMetaClassDeclareReservedUnused(IODVDMedia, 15); + OSMetaClassDeclareReservedUnused(IODVDMedia, 16); + OSMetaClassDeclareReservedUnused(IODVDMedia, 17); + OSMetaClassDeclareReservedUnused(IODVDMedia, 18); + OSMetaClassDeclareReservedUnused(IODVDMedia, 19); + OSMetaClassDeclareReservedUnused(IODVDMedia, 20); + OSMetaClassDeclareReservedUnused(IODVDMedia, 21); + OSMetaClassDeclareReservedUnused(IODVDMedia, 22); + OSMetaClassDeclareReservedUnused(IODVDMedia, 23); + OSMetaClassDeclareReservedUnused(IODVDMedia, 24); + OSMetaClassDeclareReservedUnused(IODVDMedia, 25); + OSMetaClassDeclareReservedUnused(IODVDMedia, 26); + OSMetaClassDeclareReservedUnused(IODVDMedia, 27); + OSMetaClassDeclareReservedUnused(IODVDMedia, 28); + OSMetaClassDeclareReservedUnused(IODVDMedia, 29); + OSMetaClassDeclareReservedUnused(IODVDMedia, 30); + OSMetaClassDeclareReservedUnused(IODVDMedia, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDMEDIA_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IODVDMediaBSDClient.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IODVDMediaBSDClient.h.svn-base new file mode 100644 index 0000000..2258bf6 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IODVDMediaBSDClient.h.svn-base @@ -0,0 +1,197 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IODVDMEDIABSDCLIENT_H +#define _IODVDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> + +#include <IOKit/storage/IODVDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCDVDREADSTRUCTURE see IODVDMedia::readStructure() in IODVDMedia.h + * + * DKIOCDVDREADDISCINFO see IODVDMedia::readDiscInfo() in IODVDMedia.h + * DKIOCDVDREADRZONEINFO see IODVDMedia::readRZoneInfo() in IODVDMedia.h + * + * DKIOCDVDREPORTKEY see IODVDMedia::reportKey() in IODVDMedia.h + * DKIOCDVDSENDKEY see IODVDMedia::sendKey() in IODVDMedia.h + * + * DKIOCDVDGETSPEED see IODVDMedia::getSpeed() in IODVDMedia.h + * DKIOCDVDSETSPEED see IODVDMedia::setSpeed() in IODVDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint8_t format; + + uint8_t reserved0008[3]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + uint8_t layer; + +#ifdef __LP64__ + uint8_t reserved0080[4]; /* reserved, clear to zero */ +#endif /* __LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_read_structure_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[2]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_report_key_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[6]; /* reserved, clear to zero */ + + uint8_t grantID; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_send_key_t; + +typedef struct +{ +#ifdef __LP64__ + uint8_t reserved0000[14]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0000[10]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_dvd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_dvd_read_rzone_info_t; + +#define DKIOCDVDREADSTRUCTURE _IOW('d', 128, dk_dvd_read_structure_t) +#define DKIOCDVDREPORTKEY _IOW('d', 129, dk_dvd_report_key_t) +#define DKIOCDVDSENDKEY _IOW('d', 130, dk_dvd_send_key_t) + +#define DKIOCDVDGETSPEED _IOR('d', 131, uint16_t) +#define DKIOCDVDSETSPEED _IOW('d', 131, uint16_t) + +#define DKIOCDVDREADDISCINFO _IOWR('d', 132, dk_dvd_read_disc_info_t) +#define DKIOCDVDREADRZONEINFO _IOWR('d', 133, dk_dvd_read_rzone_info_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IODVDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IODVDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IODVDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IODVDMedia * getProvider() const; + + /* + * Process a DVD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IODVDTypes.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IODVDTypes.h.svn-base new file mode 100644 index 0000000..039b8fb --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IODVDTypes.h.svn-base @@ -0,0 +1,451 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IODVDTYPES_H +#define _IODVDTYPES_H + +#include <IOKit/IOTypes.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Media Types + */ + +enum +{ + kDVDMediaTypeUnknown = 0x0200, + kDVDMediaTypeROM = 0x0202, /* DVD-ROM */ + kDVDMediaTypeRAM = 0x0203, /* DVD-RAM */ + kDVDMediaTypeR = 0x0204, /* DVD-R */ + kDVDMediaTypeRW = 0x0205, /* DVD-RW */ + kDVDMediaTypePlusRW = 0x0206, /* DVD+RW */ + kDVDMediaTypePlusR = 0x0207, /* DVD+R */ + kDVDMediaTypeHDROM = 0x0212, /* HD DVD-ROM */ + kDVDMediaTypeHDRAM = 0x0213, /* HD DVD-RAM */ + kDVDMediaTypeHDR = 0x0214, /* HD DVD-R */ + kDVDMediaTypeHDRW = 0x0215, /* HD DVD-RW */ + + kDVDMediaTypeMin = 0x0200, + kDVDMediaTypeMax = 0x02FF +}; + +typedef UInt32 DVDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kDVDSpeedMin 0x0546 +#define kDVDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +typedef UInt8 DVDCPRMRegionCode; +enum +{ + kDVDCPRMRegion1 = 0xFE, + kDVDCPRMRegion2 = 0xFD, + kDVDCPRMRegion3 = 0xFB, + kDVDCPRMRegion4 = 0xF7, + kDVDCPRMRegion5 = 0xEF, + kDVDCPRMRegion6 = 0xDF +}; + +typedef UInt8 DVDRegionalPlaybackControlScheme; +enum +{ + kDVDRegionalPlaybackControlSchemePhase1 = 0x00, + kDVDRegionalPlaybackControlSchemePhase2 = 0x01 +}; + +typedef UInt8 DVDBookType; +enum +{ + kDVDBookTypeROM = 0x0, + kDVDBookTypeRAM = 0x1, + kDVDBookTypeR = 0x2, + kDVDBookTypeRW = 0x3, + kDVDBookTypeHDROM = 0x4, + kDVDBookTypeHDRAM = 0x5, + kDVDBookTypeHDR = 0x6, + kDVDBookTypeHDRW = 0x7, + kDVDBookTypePlusRW = 0x9, + kDVDBookTypePlusR = 0xA, + kDVDBookTypePlusRWDoubleLayer = 0xD, + kDVDBookTypePlusRDoubleLayer = 0xE +}; + +#ifdef __LP64__ +typedef UInt8 DVDKeyClass; +enum +#else /* !__LP64__ */ +enum DVDKeyClass +#endif /* !__LP64__ */ +{ + kDVDKeyClassCSS_CPPM_CPRM = 0x00, + kDVDKeyClassRSSA = 0x01 +}; +#ifndef __LP64__ +typedef enum DVDKeyClass DVDKeyClass; +#endif /* !__LP64__ */ + +#ifdef __LP64__ +typedef UInt8 DVDKeyFormat; +enum +#else /* !__LP64__ */ +enum DVDKeyFormat +#endif /* !__LP64__ */ +{ + kDVDKeyFormatAGID_CSS = 0x00, + kDVDKeyFormatChallengeKey = 0x01, + kDVDKeyFormatKey1 = 0x02, + kDVDKeyFormatKey2 = 0x03, + kDVDKeyFormatTitleKey = 0x04, + kDVDKeyFormatASF = 0x05, + kDVDKeyFormatSetRegion = 0x06, + kDVDKeyFormatRegionState = 0x08, + kDVDKeyFormatAGID_CSS2 = 0x10, + kDVDKeyFormatAGID_CPRM = 0x11, + kDVDKeyFormatAGID_Invalidate = 0x3F +}; +#ifndef __LP64__ +typedef enum DVDKeyFormat DVDKeyFormat; +#endif /* !__LP64__ */ + +typedef UInt8 DVDStructureFormat; +enum +{ + kDVDStructureFormatPhysicalFormatInfo = 0x00, + kDVDStructureFormatCopyrightInfo = 0x01, + kDVDStructureFormatDiscKeyInfo = 0x02, + // skip BCA + kDVDStructureFormatManufacturingInfo = 0x04 +}; + +// Read DVD Structures Format 0x00 +struct DVDPhysicalFormatInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + // Byte 0 + UInt8 partVersion:4; + UInt8 bookType:4; + + // Byte 1 + UInt8 minimumRate:4; + UInt8 discSize:4; + + // Byte 2 + UInt8 layerType:4; + UInt8 trackPath:1; + UInt8 numberOfLayers:2; + UInt8 reserved2:1; + + // Byte 3 + UInt8 trackDensity:4; + UInt8 linearDensity:4; +#else /* !__LITTLE_ENDIAN__ */ + // Byte 0 + UInt8 bookType:4; + UInt8 partVersion:4; + + // Byte 1 + UInt8 discSize:4; + UInt8 minimumRate:4; + + // Byte 2 + UInt8 reserved2:1; + UInt8 numberOfLayers:2; + UInt8 trackPath:1; + UInt8 layerType:4; + + // Byte 3 + UInt8 linearDensity:4; + UInt8 trackDensity:4; +#endif /* !__LITTLE_ENDIAN__ */ + + // Bytes 4-15 + UInt8 zero1; // always 0x00 + UInt8 startingPhysicalSectorNumberOfDataArea[3]; + UInt8 zero2; // always 0x00 + UInt8 endPhysicalSectorNumberOfDataArea[3]; + UInt8 zero3; // always 0x00 + UInt8 endSectorNumberInLayerZero[3]; + + // Byte 16 +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved1:7; + UInt8 bcaFlag:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 bcaFlag:1; + UInt8 reserved1:7; +#endif /* !__LITTLE_ENDIAN__ */ + + // Bytes 17-2047 + UInt8 mediaSpecific[2031]; +}; +typedef struct DVDPhysicalFormatInfo DVDPhysicalFormatInfo; + +// Read DVD Structures Format 0x01 +struct DVDCopyrightInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 copyrightProtectionSystemType; + DVDCPRMRegionCode regionMask; + UInt8 reserved2[2]; +}; +typedef struct DVDCopyrightInfo DVDCopyrightInfo; + +// Read DVD Structures Format 0x02 +struct DVDDiscKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 discKeyStructures[2048]; +}; +typedef struct DVDDiscKeyInfo DVDDiscKeyInfo; + +// Read DVD Structures Format 0x04 +struct DVDManufacturingInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 discManufacturingInfo[2048]; +}; +typedef struct DVDManufacturingInfo DVDManufacturingInfo; + +// ReportKey Format 0x00 +struct DVDAuthenticationGrantIDInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 reserved2[3]; +#ifdef __LITTLE_ENDIAN__ + UInt8 reservedBits:6; + UInt8 grantID:2; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 grantID:2; + UInt8 reservedBits:6; +#endif /* !__LITTLE_ENDIAN__ */ +}; +typedef struct DVDAuthenticationGrantIDInfo DVDAuthenticationGrantIDInfo; + +// ReportKey and SendKey Format 0x01 +struct DVDChallengeKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 challengeKeyValue[10]; + UInt8 reserved2[2]; +}; +typedef struct DVDChallengeKeyInfo DVDChallengeKeyInfo; + +// ReportKey Format 0x02 +struct DVDKey1Info +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 key1Value[5]; + UInt8 reserved2[3]; +}; +typedef struct DVDKey1Info DVDKey1Info; + +// SendKey Format 0x03 +struct DVDKey2Info +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 key2Value[5]; + UInt8 reserved2[3]; +}; +typedef struct DVDKey2Info DVDKey2Info; + +// ReportKey Format 0x04 +struct DVDTitleKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 CP_MOD:4; + UInt8 CGMS:2; + UInt8 CP_SEC:1; + UInt8 CPM:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 CPM:1; + UInt8 CP_SEC:1; + UInt8 CGMS:2; + UInt8 CP_MOD:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 titleKeyValue[5]; + UInt8 reserved2[2]; +}; +typedef struct DVDTitleKeyInfo DVDTitleKeyInfo; + +// ReportKey Format 0x05 +struct DVDAuthenticationSuccessFlagInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 reserved2[3]; +#ifdef __LITTLE_ENDIAN__ + UInt8 successFlag:1; + UInt8 reservedBits:7; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reservedBits:7; + UInt8 successFlag:1; +#endif /* !__LITTLE_ENDIAN__ */ +}; +typedef struct DVDAuthenticationSuccessFlagInfo DVDAuthenticationSuccessFlagInfo; + +// ReportKey Format 0x08 +struct DVDRegionPlaybackControlInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 numberUserResets:3; + UInt8 numberVendorResets:3; + UInt8 typeCode:2; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 typeCode:2; + UInt8 numberVendorResets:3; + UInt8 numberUserResets:3; +#endif /* !__LITTLE_ENDIAN__ */ + DVDCPRMRegionCode driveRegion; + DVDRegionalPlaybackControlScheme rpcScheme; + UInt8 reserved2; +}; +typedef struct DVDRegionPlaybackControlInfo DVDRegionPlaybackControlInfo; + +// Read Disc Information Format +struct DVDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastBorder:2; + UInt8 erasable:1; + UInt8 reserved:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved:3; + UInt8 erasable:1; + UInt8 stateOfLastBorder:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2; + UInt8 numberOfBordersLSB; + UInt8 firstRZoneNumberInLastBorderLSB; + UInt8 lastRZoneNumberInLastBorderLSB; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved3:5; + UInt8 unrestrictedUse:1; + UInt8 discBarCodeValid:1; + UInt8 reserved4:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved4:1; + UInt8 discBarCodeValid:1; + UInt8 unrestrictedUse:1; + UInt8 reserved3:5; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved5; + UInt8 numberOfBordersMSB; + UInt8 firstRZoneNumberInLastBorderMSB; + UInt8 lastRZoneNumberInLastBorderMSB; + UInt8 reserved6[4]; + UInt8 reserved7[4]; + UInt8 reserved8[4]; + UInt8 discBarCode[8]; + UInt8 reserved9; + UInt8 numberOfOPCTableEntries; + UInt8 opcTableEntries[0]; +}; +typedef struct DVDDiscInfo DVDDiscInfo; + +// Read RZone Information Address Types +typedef UInt8 DVDRZoneInfoAddressType; +enum +{ + kDVDRZoneInfoAddressTypeLBA = 0x00, + kDVDRZoneInfoAddressTypeRZoneNumber = 0x01, + kDVDRZoneInfoAddressTypeBorderNumber = 0x02, +}; + +// Read RZone Information Format +struct DVDRZoneInfo +{ + UInt16 dataLength; + UInt8 rzoneNumberLSB; + UInt8 borderNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved2:4; + UInt8 copy:1; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 reserved4:4; + UInt8 restrictedOverwrite:1; + UInt8 incremental:1; + UInt8 blank:1; + UInt8 reservedRZone:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 copy:1; + UInt8 reserved2:4; + + UInt8 reservedRZone:1; + UInt8 blank:1; + UInt8 incremental:1; + UInt8 restrictedOverwrite:1; + UInt8 reserved4:4; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 rzoneStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 blockingFactor; + UInt32 rzoneSize; + UInt32 lastRecordedAddress; + UInt8 rzoneNumberMSB; + UInt8 borderNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct DVDRZoneInfo DVDRZoneInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _IODVDTYPES_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOFDiskPartitionScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOFDiskPartitionScheme.h.svn-base new file mode 100644 index 0000000..7f96255 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOFDiskPartitionScheme.h.svn-base @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOFDiskPartitionScheme class definition. + */ + +#ifndef _IOFDISKPARTITIONSCHEME_H +#define _IOFDISKPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOFDiskPartitionSchemeClass is the name of the IOFDiskPartitionScheme class. + */ + +#define kIOFDiskPartitionSchemeClass "IOFDiskPartitionScheme" + +/* + * FDisk Partition Map Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Structure constants. */ + +#define DISK_BLK0SZ sizeof(struct disk_blk0) /* (size of partition map) */ +#define DISK_BOOTSZ 446 /* (size of boot code in map) */ +#define DISK_NPART 4 /* (number of entries in map) */ + +/* Partition map entry. */ + +struct fdisk_part +{ + UInt8 bootid; /* (is active boot partition?) */ + UInt8 beghead; /* (beginning head) */ + UInt8 begsect; /* (beginning sector; beginning cylinder, high 2 bits) */ + UInt8 begcyl; /* (beginning cylinder, low 8 bits) */ + UInt8 systid; /* (type) */ + UInt8 endhead; /* (ending head) */ + UInt8 endsect; /* (ending sector; ending cylinder, high 2 bits) */ + UInt8 endcyl; /* (ending cylinder, low 8 bits) */ + UInt32 relsect; /* (block start) */ + UInt32 numsect; /* (block count) */ +}; + +/* Partition map, as found in block zero of the disk (or extended partition). */ + +struct disk_blk0 +{ + UInt8 bootcode[DISK_BOOTSZ]; /* (boot code) */ + struct fdisk_part parts[DISK_NPART]; /* (partition entries) */ + UInt16 signature; /* (unique signature for map) */ +}; + +/* Partition map signature (signature). */ + +#define DISK_SIGNATURE 0xAA55 + +/* Partition map entry types (systid). */ + +#define FDISK_PARTITION_TYPE_01 "DOS_FAT_12" +#define FDISK_PARTITION_TYPE_04 "DOS_FAT_16_S" +#define FDISK_PARTITION_TYPE_06 "DOS_FAT_16" +#define FDISK_PARTITION_TYPE_07 "Windows_NTFS" +#define FDISK_PARTITION_TYPE_0B "DOS_FAT_32" +#define FDISK_PARTITION_TYPE_0C "Windows_FAT_32" +#define FDISK_PARTITION_TYPE_0E "Windows_FAT_16" +#define FDISK_PARTITION_TYPE_42 "Windows_LDM" +#define FDISK_PARTITION_TYPE_82 "Linux_Swap" +#define FDISK_PARTITION_TYPE_83 "Linux" +#define FDISK_PARTITION_TYPE_8E "Linux_LVM" +#define FDISK_PARTITION_TYPE_A5 "FreeBSD" +#define FDISK_PARTITION_TYPE_A6 "OpenBSD" +#define FDISK_PARTITION_TYPE_A7 "Apple_Rhapsody_UFS" +#define FDISK_PARTITION_TYPE_A8 "Apple_UFS" +#define FDISK_PARTITION_TYPE_A9 "NetBSD" +#define FDISK_PARTITION_TYPE_AB "Apple_Boot" +#define FDISK_PARTITION_TYPE_AE "Apple_Encrypted" +#define FDISK_PARTITION_TYPE_AF "Apple_HFS" +#define FDISK_PARTITION_TYPE_FD "Linux_RAID" + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* !_IOFDISKPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOFilterScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOFilterScheme.h.svn-base new file mode 100644 index 0000000..406b596 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOFilterScheme.h.svn-base @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOFilterScheme + * @abstract + * This header contains the IOFilterScheme class definition. + */ + +#ifndef _IOFILTERSCHEME_H +#define _IOFILTERSCHEME_H + +/*! + * @defined kIOFilterSchemeClass + * @abstract + * The name of the IOFilterScheme class. + * @discussion + * kIOFilterSchemeClass is the name of the IOFilterScheme class. + */ + +#define kIOFilterSchemeClass "IOFilterScheme" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOFilterScheme + * @abstract + * The common base class for all filter scheme + * objects. + * @discussion + * The IOFilterScheme class is the common base class for all filter scheme + * objects. It extends the IOStorage class by implementing the appropriate + * open and close semantics for filter objects (standard semantics are act + * as a relay for incoming opens, producing one outgoing open for each + * incoming open). It also implements the default read and write semantics, + * which pass all reads and writes through to the provider media unprocessed. + * For simple schemes, the default behavior is sufficient. More complex + * filter schemes such as RAID will want to do extra processing for reads + * and writes. + */ + +class IOFilterScheme : public IOStorage +{ + OSDeclareDefaultStructors(IOFilterScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access); + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options); + +public: + + using IOStorage::read; + using IOStorage::write; + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For simple filter schemes, the default behavior is to simply pass the + * read through to the provider media. More complex filter schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For simple filter schemes, the default behavior is to simply pass the + * write through to the provider media. More complex filter schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function synchronizeCache + * @discussion + * Flush the cached data in the storage object, if any, synchronously. + * @param client + * Client requesting the cache synchronization. + * @result + * Returns the status of the cache synchronization. + */ + + virtual IOReturn synchronizeCache(IOService * client); + + /*! + * @function discard + * @discussion + * Delete unused data from the storage object at the specified byte offset, + * synchronously. + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. + * @param byteCount + * Size of the operation. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn discard(IOService * client, + UInt64 byteStart, + UInt64 byteCount); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- an IOMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const; + + OSMetaClassDeclareReservedUnused(IOFilterScheme, 0); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 1); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 2); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 3); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 4); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 5); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 6); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 7); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 8); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 9); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 10); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 11); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 12); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 13); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 14); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 15); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 16); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 17); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 18); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 19); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 20); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 21); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 22); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 23); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 24); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 25); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 26); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 27); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 28); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 29); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 30); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOFILTERSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOFireWireStorageCharacteristics.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOFireWireStorageCharacteristics.h.svn-base new file mode 100644 index 0000000..710f29f --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOFireWireStorageCharacteristics.h.svn-base @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ +#define _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ + +// +// Bridge Characteristics - Characteristics defined for FireWire bridges. +// + +/*! +@defined kIOPropertyBridgeCharacteristicsKey +@discussion This key is used to define Bridge Characteristics for a particular +devices's bridge chipset. It has an associated dictionary which lists the +bridge characteristics. + +Requirement: Optional + +Example: +<pre> +@textblock +<dict> + <key>Bridge Characteristics</key> + <dict> + <key>Bridge Vendor Name</key> + <string>Oxford Semiconductor</string> + <key>Bridge Model Name</key> + <string>FW911</string> + <key>Bridge Revision Level</key> + <string>3.7</string> + </dict> +</dict> +@/textblock +</pre> +*/ + +#define kIOPropertyBridgeCharacteristicsKey "Bridge Characteristics" +#define kIOPropertyBridgeVendorNameKey "Bridge Vendor Name" +#define kIOPropertyBridgeModelNameKey "Bridge Model Name" +#define kIOPropertyBridgeRevisionLevelKey "Bridge Revision Level" + +#endif /* _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ */ \ No newline at end of file diff --git a/i386/include/IOKit/storage/.svn/text-base/IOGUIDPartitionScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOGUIDPartitionScheme.h.svn-base new file mode 100644 index 0000000..3e197d0 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOGUIDPartitionScheme.h.svn-base @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOGUIDPartitionScheme class definition. + */ + +#ifndef _IOGUIDPARTITIONSCHEME_H +#define _IOGUIDPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +typedef unsigned char uuid_t[16]; +/* + * kIOGUIDPartitionSchemeClass is the name of the IOGUIDPartitionScheme class. + */ + +#define kIOGUIDPartitionSchemeClass "IOGUIDPartitionScheme" + + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Partition map. */ + +struct gpt_hdr +{ + uint8_t hdr_sig[8]; + uint32_t hdr_revision; + uint32_t hdr_size; + uint32_t hdr_crc_self; + uint32_t __reserved; + uint64_t hdr_lba_self; + uint64_t hdr_lba_alt; + uint64_t hdr_lba_start; + uint64_t hdr_lba_end; + uuid_t hdr_uuid; + uint64_t hdr_lba_table; + uint32_t hdr_entries; + uint32_t hdr_entsz; + uint32_t hdr_crc_table; + uint32_t padding; +}; + +/* Partition map entry. */ + +struct gpt_ent +{ + uuid_t ent_type; + uuid_t ent_uuid; + uint64_t ent_lba_start; + uint64_t ent_lba_end; + uint64_t ent_attr; + uint16_t ent_name[36]; +}; + +/* Partition map signature (hdr_sig). */ + +#define GPT_HDR_SIG "EFI PART" + +/* Partition map version (hdr_revision). */ + +#define GPT_HDR_REVISION 0x00010000 + +/* Partition map entry flags (ent_attr). */ + +#define GPT_ENT_ATTR_PLATFORM 0x00000001 + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* !_IOGUIDPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOMedia.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOMedia.h.svn-base new file mode 100644 index 0000000..64052ec --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOMedia.h.svn-base @@ -0,0 +1,231 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOMedia + * @abstract + * This header contains the IOMedia class definition. + */ + +#ifndef _IOMEDIA_H +#define _IOMEDIA_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOMediaClass + * @abstract + * The name of the IOMedia class. + */ + +#define kIOMediaClass "IOMedia" + +/*! + * @defined kIOMediaContentKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaContentKey property has an OSString + * value and contains a description of the media's + * contents. The description is the same as the hint at the time of the + * object's creation, but it is possible that the description has been overridden + * by a client (which has probed the media and identified the content correctly) + * of the media object. It is more accurate than the hint for this reason. The + * string is formed in the likeness of Apple's "Apple_HFS" strings or in the + * likeness of a UUID. + */ + +#define kIOMediaContentKey "Content" + +/*! + * @defined kIOMediaContentHintKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaContentHintKey property has an OSString + * value and contains a hint of the media's contents. + * The hint is set at the time of the object's creation, should the creator have + * a clue as to what it may contain. The hint string does not change for the + * lifetime of the object and is formed in the likeness of Apple's "Apple_HFS" + * strings or in the likeness of a UUID. + */ + +#define kIOMediaContentHintKey "Content Hint" + +/*! + * @defined kIOMediaEjectableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaEjectableKey property has an OSBoolean + * value and describes whether the media is ejectable + * from the drive mechanism under software control. Implies IOMediaRemovable + * is also true. + */ + +#define kIOMediaEjectableKey "Ejectable" + +/*! + * @defined kIOMediaLeafKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaLeafKey property has an OSBoolean value and describes whether the media is a leaf, that is, + * it is the deepest media object in this branch of the I/O Registry. + */ + +#define kIOMediaLeafKey "Leaf" + +/*! + * @defined kIOMediaOpenKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaOpenKey property has an OSBoolean value and describes whether + * a client presently has an open on this media. + */ + +#define kIOMediaOpenKey "Open" + +/*! + * @defined kIOMediaPreferredBlockSizeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaPreferredBlockSizeKey property has an + * OSNumber value and describes the media's natural + * block size in bytes. This information is useful to clients that want to + * optimize access to the media. + */ + +#define kIOMediaPreferredBlockSizeKey "Preferred Block Size" + +/*! + * @defined kIOMediaRemovableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaRemovableKey property has an OSBoolean + * value and describes whether the media is removable + * from the drive mechanism. + */ + +#define kIOMediaRemovableKey "Removable" + +/*! + * @defined kIOMediaSizeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaSizeKey property has an OSNumber value and describes the total length of the media in + * bytes. + */ + +#define kIOMediaSizeKey "Size" + +/*! + * @defined kIOMediaUUIDKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaUUIDKey property has an OSString value and contains a persistent + * Universal Unique Identifier for the media if such an identifier is available. + */ + +#define kIOMediaUUIDKey "UUID" + +/*! + * @defined kIOMediaWholeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaWholeKey property has an OSBoolean + * value and describes whether the media is whole, that is, + * it represents the whole disk (the physical disk, or a virtual replica + * thereof). + */ + +#define kIOMediaWholeKey "Whole" + +/*! + * @defined kIOMediaWritableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaWritableKey property has an OSBoolean + * value and describes whether the media is writable. + */ + +#define kIOMediaWritableKey "Writable" + +/*! + * @defined kIOMediaContentMaskKey + * @abstract + * A property of IOMedia clients. + * @discussion + * The kIOMediaContentMaskKey property has an OSString + * value and must exist in all IOMedia clients that + * drive new content (that is, produce new media objects). When the client + * matches against the provider media, the value of the client's + * kIOMediaContentMaskKey property is used to replace the provider's + * kIOMediaContentKey property. + */ + +#define kIOMediaContentMaskKey "Content Mask" + +/*! + * @defined kIOMediaIconKey + * @abstract + * A property of any object in the media stack. + * @discussion + * kIOMediaIconKey is a property of any object in the media stack that wishes + * to override the default icon shown for the media objects in the stack. It + * is usually defined in a provider object below the media object. It has an + * OSDictionary value, with properties identical to the kIOIconKey definition, + * that is, kCFBundleIdentifierKey and kIOBundleResourceFileKey. + */ + +#define kIOMediaIconKey "IOMediaIcon" + +/*! + * @enum IOMediaAttributeMask + * @discussion + * The IOMediaAttributeMask bit mask describes various attributes of + * the media object, such as its ejectability and its removability. + * @constant kIOMediaAttributeEjectableMask + * Indicates whether the media is ejectable from the drive mechanism + * under software control. Implies kIOMediaAttributeRemovableMask. + * @constant kIOMediaAttributeRemovableMask + * Indicates whether the media is removable from the drive mechanism. + */ + +enum +{ + kIOMediaAttributeEjectableMask = 0x00000001, + kIOMediaAttributeRemovableMask = 0x00000002, + kIOMediaAttributeReservedMask = 0xFFFFFFFC +}; + +typedef UInt32 IOMediaAttributeMask; + +#endif /* !_IOMEDIA_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOMediaBSDClient.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOMediaBSDClient.h.svn-base new file mode 100644 index 0000000..56a3117 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOMediaBSDClient.h.svn-base @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOMEDIABSDCLIENT_H +#define _IOMEDIABSDCLIENT_H + +#include <sys/disk.h> + +#endif /* !_IOMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOPartitionScheme.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOPartitionScheme.h.svn-base new file mode 100644 index 0000000..7a1de37 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOPartitionScheme.h.svn-base @@ -0,0 +1,373 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOPartitionScheme + * @abstract + * This header contains the IOPartitionScheme class definition. + */ + +#ifndef _IOPARTITIONSCHEME_H +#define _IOPARTITIONSCHEME_H + +/*! + * @defined kIOPartitionSchemeClass + * @abstract + * The name of the IOPartitionScheme class. + * @discussion + * kIOPartitionSchemeClass is the name of the IOPartitionScheme class. + */ + +#define kIOPartitionSchemeClass "IOPartitionScheme" + +/*! + * @defined kIOMediaLiveKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaLiveKey property has an OSBoolean + * value and is placed into an IOMedia instance + * created via the partition scheme. It describes whether the + * partition is live, that is, it is up-to-date with respect + * to the on-disk partition table. + */ + +#define kIOMediaLiveKey "Live" + +/*! + * @defined kIOMediaPartitionIDKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaPartitionIDKey property has an OSNumber + * value and is placed into an IOMedia instance + * created via the partition scheme. It is an ID that differentiates one + * partition from the other (within a given scheme). It is typically an index + * into the on-disk partition table. + */ + +#define kIOMediaPartitionIDKey "Partition ID" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOPartitionScheme + * @abstract + * The common base class for all partition scheme + * objects. + * @discussion + * The IOPartitionScheme class is the common base class for all partition scheme + * objects. It extends the IOStorage class by implementing the appropriate open + * and close semantics for partition objects (standard semantics are to act as a + * multiplexor for incoming opens, producing one outgoing open with the correct + * access). It also implements the default read and write semantics, which pass + * all reads and writes through to the provider media unprocessed. For simple + * schemes, the default behavior is sufficient. More complex partition schemes + * such as RAID will want to do extra processing for reads and writes. + */ + +class IOPartitionScheme : public IOStorage +{ + OSDeclareDefaultStructors(IOPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + IOStorageAccess _openLevel; + OSSet * _openReaders; + OSSet * _openReaderWriters; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(); + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access); + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options); + + /* + * Attach the given media object to the device tree plane. + */ + +#ifdef __LP64__ + virtual bool attachMediaObjectToDeviceTree(IOMedia * media); +#else /* !__LP64__ */ + virtual bool attachMediaObjectToDeviceTree(IOMedia * media, + IOOptionBits options = 0); /* 10.5.0 */ +#endif /* !__LP64__ */ + + /* + * Detach the given media object from the device tree plane. + */ + +#ifdef __LP64__ + virtual void detachMediaObjectFromDeviceTree(IOMedia * media); +#else /* !__LP64__ */ + virtual void detachMediaObjectFromDeviceTree(IOMedia * media, + IOOptionBits options = 0); /* 10.5.0 */ +#endif /* !__LP64__ */ + + /* + * Updates a set of existing partitions, represented by partitionsOld, + * with possible updates from a rescan of the disk, represented by + * partitionsNew. It returns a new set of partitions with the results, + * removing partitions from partitionsOld where applicable, adding + * partitions from partitionsNew where applicable, and folding in property + * changes to partitions from partitionsNew into partitionsOld where + * applicable. + */ + + virtual OSSet * juxtaposeMediaObjects(OSSet * partitionsOld, + OSSet * partitionsNew); /* 10.5.0 */ + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For simple partition schemes, the default behavior is to simply pass the + * read through to the provider media. More complex partition schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For simple partition schemes, the default behavior is to simply pass the + * write through to the provider media. More complex partition schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function synchronizeCache + * @discussion + * Flush the cached data in the storage object, if any, synchronously. + * @param client + * Client requesting the cache synchronization. + * @result + * Returns the status of the cache synchronization. + */ + + virtual IOReturn synchronizeCache(IOService * client); + + /*! + * @function discard + * @discussion + * Delete unused data from the storage object at the specified byte offset, + * synchronously. + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. + * @param byteCount + * Size of the operation. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn discard(IOService * client, + UInt64 byteStart, + UInt64 byteCount); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- an IOMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const; + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 2); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOPartitionScheme, 0); + OSMetaClassDeclareReservedUsed(IOPartitionScheme, 1); + OSMetaClassDeclareReservedUsed(IOPartitionScheme, 2); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 15); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 16); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 17); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 18); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 19); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 20); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 21); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 22); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 23); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 24); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 25); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 26); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 27); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 28); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 29); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 30); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOStorage.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOStorage.h.svn-base new file mode 100644 index 0000000..d5725c2 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOStorage.h.svn-base @@ -0,0 +1,217 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOStorage + * @abstract + * This header contains the IOStorage class definition. + */ + +#ifndef _IOSTORAGE_H +#define _IOSTORAGE_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOStorageClass + * @abstract + * The name of the IOStorage class. + */ + +#define kIOStorageClass "IOStorage" + +/*! + * @defined kIOStorageCategory + * @abstract + * kIOStorageCategory is a value for IOService's kIOMatchCategoryKey property. + * @discussion + * The kIOStorageCategory value is the standard value for the IOService property + * kIOMatchCategoryKey ("IOMatchCategory") for all storage drivers. All storage + * objects that expect to drive new content (that is, produce new media objects) + * are expected to compete within the kIOStorageCategory namespace. + * + * See the IOService documentation for more information on match categories. + */ + +#define kIOStorageCategory "IOStorage" /* (as IOMatchCategory) */ + +/*! + * @defined kIOStorageFeaturesKey + * @abstract + * A property of any object in the storage stack. + * @discussion + * kIOStorageFeaturesKey is a property of any object in the storage stack that + * wishes to express support of additional features, such as Force Unit Access. + * It is typically defined in the device object below the block storage driver + * object. It has an OSDictionary value, where each entry describes one given + * feature. + */ + +#define kIOStorageFeaturesKey "IOStorageFeatures" + +/*! + * @defined kIOStorageFeatureDiscard + * @abstract + * Describes the presence of the Discard feature. + * @discussion + * This property describes the ability of the storage stack to delete unused + * data from the media. It is one of the feature entries listed under the top- + * level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureDiscard "Discard" + +/*! + * @defined kIOStorageFeatureForceUnitAccess + * @abstract + * Describes the presence of the Force Unit Access feature. + * @discussion + * This property describes the ability of the storage stack to force a request + * to access the media. It is one of the feature entries listed under the top- + * level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureForceUnitAccess "Force Unit Access" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/assert.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOService.h> + +/*! + * @enum IOStorageAccess + * @discussion + * The IOStorageAccess enumeration describes the possible access levels for open + * requests. + * @constant kIOStorageAccessNone + * No access is requested; should not be passed to open(). + * @constant kIOStorageAccessReader + * Read-only access is requested. + * @constant kIOStorageAccessReaderWriter + * Read and write access is requested. + * @constant kIOStorageAccessSharedLock + * Shared access is requested. + * @constant kIOStorageAccessExclusiveLock + * Exclusive access is requested. + */ + +enum +{ + kIOStorageAccessNone = 0x00, + kIOStorageAccessReader = 0x01, + kIOStorageAccessReaderWriter = 0x03, + kIOStorageAccessSharedLock = 0x04, + kIOStorageAccessExclusiveLock = 0x08 +}; + +typedef UInt32 IOStorageAccess; + +/*! + * @enum IOStorageOptions + * @discussion + * Options for read and write storage requests. + * @constant kIOStorageOptionForceUnitAccess + * Force the request to access the media. + */ + +enum +{ + kIOStorageOptionNone = 0x00000000, + kIOStorageOptionForceUnitAccess = 0x00000001, + kIOStorageOptionReserved = 0xFFFFFFFE +}; + +typedef UInt32 IOStorageOptions; + +/*! + * @struct IOStorageAttributes + * @discussion + * Attributes of read and write storage requests. + * @field options + * Options for the request. See IOStorageOptions. + * @field reserved + * Reserved for future use. Set to zero. + */ + +struct IOStorageAttributes +{ + IOStorageOptions options; + UInt32 reserved0032; + UInt64 reserved0064; +#ifdef __LP64__ + UInt64 reserved0128; + UInt64 reserved0192; +#endif /* __LP64__ */ +}; + +/*! + * @typedef IOStorageCompletionAction + * @discussion + * The IOStorageCompletionAction declaration describes the C (or C++) completion + * routine that is called once an asynchronous storage operation completes. + * @param target + * Opaque client-supplied pointer (or an instance pointer for a C++ callback). + * @param parameter + * Opaque client-supplied pointer. + * @param status + * Status of the data transfer. + * @param actualByteCount + * Actual number of bytes transferred in the data transfer. + */ + +typedef void (*IOStorageCompletionAction)(void * target, + void * parameter, + IOReturn status, + UInt64 actualByteCount); + +/*! + * @struct IOStorageCompletion + * @discussion + * The IOStorageCompletion structure describes the C (or C++) completion routine + * that is called once an asynchronous storage operation completes. The values + * passed for the target and parameter fields will be passed to the routine when + * it is called. + * @field target + * Opaque client-supplied pointer (or an instance pointer for a C++ callback). + * @field action + * Completion routine to call on completion of the data transfer. + * @field parameter + * Opaque client-supplied pointer. + */ + +struct IOStorageCompletion +{ + void * target; + IOStorageCompletionAction action; + void * parameter; +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOSTORAGE_H */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOStorageDeviceCharacteristics.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOStorageDeviceCharacteristics.h.svn-base new file mode 100644 index 0000000..19a73a2 --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOStorageDeviceCharacteristics.h.svn-base @@ -0,0 +1,659 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ + +#include <IOKit/storage/IOStorageProtocolCharacteristics.h> + +/* + * Device Characteristics - Characteristics defined for devices. + */ + +/*! +@defined kIOPropertyDeviceCharacteristicsKey +@discussion This key is used to define Device Characteristics for a particular +device and it has an associated dictionary which lists the +device characteristics. The device characteristics are Command Set specific +and are listed in the header files for each command set. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyDeviceCharacteristicsKey "Device Characteristics" + + +/*! +@defined kIOPropertyVendorNameKey +@discussion This key is used to define the Vendor Name for a particular device +and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyVendorNameKey "Vendor Name" + + +/*! +@defined kIOPropertyProductNameKey +@discussion This key is used to define the Product Name for a particular device +and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductNameKey "Product Name" + + +/*! +@defined kIOPropertyProductRevisionLevelKey +@discussion This key is used to define the Product Revision Level for a +particular device and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductRevisionLevelKey "Product Revision Level" + + +/*! +@defined kIOPropertyProductSerialNumberKey +@discussion This key is used to define the Product Serial Number for a +particular device and it has an associated data. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Serial Number</key> + <string>123456789</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductSerialNumberKey "Serial Number" + + +/*! +@defined kIOPropertySupportedCDFeaturesKey +@discussion This key is used to define the supported CD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedCDFeaturesKey "CD Features" + + +/*! +@defined kIOPropertySupportedDVDFeaturesKey +@discussion This key is used to define the supported DVD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedDVDFeaturesKey "DVD Features" + + +/*! +@defined kIOPropertySupportedBDFeaturesKey +@discussion This key is used to define the supported BD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + <key>BD Features</key> + <integer>21</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedBDFeaturesKey "BD Features" + + +/*! +@defined kIOPropertyRigidDiskGeometryKey +@discussion This key is used to define a dictionary containing +rigid disk geometry information. + +Requirement: Optional. If a device publishes this dictionary, it +must publish all key/value pairs which are deemed Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyRigidDiskGeometryKey "Rigid Disk Geometry" + + +/*! +@defined kIOPropertySectorCountPerTrackKey +@discussion This key is used to define the number of sectors per +each track for a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySectorCountPerTrackKey "Sector Count per Track" + + +/*! +@defined kIOPropertyHeadCountKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyHeadCountKey "Head Count" + + +/*! +@defined kIOPropertyCylinderCountKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCylinderCountKey "Cylinder Count" + + +/*! +@defined kIOPropertyBytesPerPhysicalSectorKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyBytesPerPhysicalSectorKey "Bytes per Physical Sector" + + +/*! +@defined kIOPropertyPhysicalBlockSizeKey +@discussion This key is used to define the physical block size of a hard disk drive. + +Requirement: Mandatory for hard disk drives with physical block size other than 512 bytes. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Physical Block Size</key> + <integer>4096</integer> + <key>Logical Block Size</key> + <integer>512</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalBlockSizeKey "Physical Block Size" + + +/*! +@defined kIOPropertyLogicalBlockSizeKey +@discussion This key is used to define the logical block size of a hard disk drive. + +Requirement: Mandatory for hard disk drives with logical block size other than 512 bytes +or that does not match its physical block size. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Physical Block Size</key> + <integer>4096</integer> + <key>Logical Block Size</key> + <integer>512</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyLogicalBlockSizeKey "Logical Block Size" + + +/*! +@defined kIOPropertyTargetDiskModeKey +@discussion This key is used to indicate the device is another computer in Target Disk Mode. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Target Disk Mode</key> + <true/> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyTargetDiskModeKey "Target Disk Mode" + + +/*! +@defined kIOPropertyMediumTypeKey +@discussion This key is used to indicate the medium type of the device. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Rotational</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeKey "Medium Type" + + +/*! +@defined kIOPropertyMediumTypeRotationalKey +@discussion This key is used to indicate the medium type of the device is rotational. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Rotational</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeRotationalKey "Rotational" + + +/*! +@defined kIOPropertyMediumTypeSolidStateKey +@discussion This key is used to indicate the medium type of the device is solid state. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Solid State</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeSolidStateKey "Solid State" + + +/*! +@defined kIOPropertyMediumRotationRateKey +@discussion This key is used to indicate the medium rotation rate in RPM of the device. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Rotation Rate</key> + <integer>7200</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumRotationRateKey "Rotation Rate" + + +#endif /* _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ */ diff --git a/i386/include/IOKit/storage/.svn/text-base/IOStorageProtocolCharacteristics.h.svn-base b/i386/include/IOKit/storage/.svn/text-base/IOStorageProtocolCharacteristics.h.svn-base new file mode 100644 index 0000000..18a726f --- /dev/null +++ b/i386/include/IOKit/storage/.svn/text-base/IOStorageProtocolCharacteristics.h.svn-base @@ -0,0 +1,1758 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ + + +/* + * Protocol Characteristics - Characteristics defined for protocols. + */ + + +/*! +@defined kIOPropertyProtocolCharacteristicsKey +@discussion This key is used to define Protocol Characteristics for a particular +protocol and it has an associated dictionary which lists the +protocol characteristics. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATAPI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProtocolCharacteristicsKey "Protocol Characteristics" + + +/*! +@defined kIOPropertySCSIInitiatorIdentifierKey +@discussion An identifier that will uniquely identify this SCSI Initiator for the +SCSI Domain. + +Requirement: Mandatory for SCSI Parallel Interface, SAS, +and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Initiator Identifier</key> + <integer>7</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIInitiatorIdentifierKey "SCSI Initiator Identifier" + + +/*! +@defined kIOPropertySCSIDomainIdentifierKey +@discussion An identifier that will uniquely identify this SCSI Domain for the +Physical Interconnect type. This identifier is only guaranteed to be unique for +any given Physical Interconnect and is not guaranteed to be the same across +restarts or shutdowns. + +Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Domain Identifier</key> + <integer>0</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIDomainIdentifierKey "SCSI Domain Identifier" + + +/*! +@defined kIOPropertySCSITargetIdentifierKey +@discussion This is the SCSI Target Identifier for a given SCSI Target Device. + +Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Target Identifier</key> + <integer>3</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSITargetIdentifierKey "SCSI Target Identifier" + + +/*! +@defined kIOPropertySCSILogicalUnitNumberKey +@discussion This key is the SCSI Logical Unit Number for the device server +controlled by the driver. + +Requirement: Mandatory for SCSI Parallel Interface, SAS, and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Logical Unit Number</key> + <integer>2</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSILogicalUnitNumberKey "SCSI Logical Unit Number" + + +/*! +@defined kIOPropertySASAddressKey +@discussion This key is the unique 64-bit SAS Address for the device server +node located at this port, or for the initiating host port. + +Requirement: Mandatory for SAS. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SAS</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>SAS Address</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SAS Address</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySASAddressKey "SAS Address" + + +/*! +@defined kIOPropertyFibreChannelNodeWorldWideNameKey +@discussion This key is the unique 64-bit World Wide Name for the device server +node located at this port, or for the initiating host port. + +Requirement: Mandatory for Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Node World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Node World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelNodeWorldWideNameKey "Node World Wide Name" + + +/*! +@defined kIOPropertyFibreChannelPortWorldWideNameKey +@discussion This key is the unique 64-bit World Wide Name for the port. + +Requirement: Mandatory for Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Port World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelPortWorldWideNameKey "Port World Wide Name" + + +/*! +@defined kIOPropertyFibreChannelAddressIdentifierKey +@discussion This key is the 24-bit Address Identifier (S_ID or D_ID) as +defined in the FC-FS specification. It contains the address identifier +of the source or destination Nx_Port. + +Note: This value can change. It is not a static value. + +Requirement: Optional (only necessary for Fibre Channel Interface). + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Address Identifier</key> + <data>001122</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Address Identifier</key> + <data>001122</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelAddressIdentifierKey "Address Identifier" + + +/*! +@defined kIOPropertyFibreChannelALPAKey +@discussion This key is the 8-bit Arbitrated Loop Physical Address +(AL_PA) value as defined in the FC-AL-2 specification. + +Note: This value can change. It is not a static value. + +Requirement: Optional (only necessary for Fibre Channel Interface). + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>AL_PA</key> + <data>04</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>AL_PA</key> + <data>04</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelALPAKey "AL_PA" + + +/*! +@defined kIOPropertyPortStatusKey +@discussion This key is associated with the current port +status of the physical link. The port status is either +"Link Established", "No Link Established", or "Link Failed". + +Note: This value can change when the port status changes. It +is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusKey "Port Status" + + +/*! +@defined kIOPropertyPortSpeedKey +@discussion This key is associated with the current port +speed. The port speed can be any valid speed for the interconnect. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedKey "Port Speed" + + +/*! +@defined kIOPropertyPortTopologyKey +@discussion This key is associated with the current port +topology. The port topology can be any valid topology for the interconnect. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (N_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyKey "Port Topology" + + +/*! +@defined kIOPropertyPortDescriptionKey +@discussion This key is associated with an human +readable port description. Examples include +"Channel A", "Port 1", etc. + +Requirement: Optional for all interconnects. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Description</key> + <string>Channel A</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortDescriptionKey "Port Description" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeKey +@discussion This key is associated with the signaling type +used for this SCSI Parallel bus. Valid values include +"High Voltage Differential", "Low Voltage Differential", +and "Single Ended". + +Requirement: Optional for SCSI Parallel Interface. Not +defined for any other physical interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>High Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeKey "SCSI Parallel Signaling Type" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionKey +@discussion This key is associated with the cabling type +used for this Fibre Channel port. Valid values include +"Copper" and "Fiber Optic". + +Requirement: Optional for Fibre Channel Interface. Not +defined for any other physical interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Copper</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionKey "Fibre Channel Cabling Type" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeKey +@discussion This key is used to define the Physical Interconnect to which +a device is attached. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeKey "Physical Interconnect" + + +/*! +@defined kIOPropertyPhysicalInterconnectLocationKey +@discussion This key is used to define the Physical Interconnect +Location. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectLocationKey "Physical Interconnect Location" + + +/*! +@defined kIOPropertySCSIProtocolMultiInitKey +@discussion This protocol characteristics key is used to inform the system +that the protocol supports having multiple devices that act as initiators. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Multiple Initiators</key> + <string>True</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIProtocolMultiInitKey "Multiple Initiators" + + +/* + * Values - Values for the characteristics defined above. + */ + + +/*! +@defined kIOPropertyInternalKey +@discussion This key defines the value of Internal for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is +connected to an internal bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInternalKey "Internal" + + +/*! +@defined kIOPropertyExternalKey +@discussion This key defines the value of External for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is +connected to an external bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyExternalKey "External" + + +/*! +@defined kIOPropertyInternalExternalKey +@discussion This key defines the value of Internal/External for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is connected +to a bus and it is indeterminate whether it is internal or external, +this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal/External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInternalExternalKey "Internal/External" + + +/*! +@defined kIOPropertyInterconnectFileKey +@discussion This key defines the value of File for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is a file +that is being represented as a storage device, this key should be set. + +NOTE: This key should only be used when the Physical Interconnect is set to +Virtual Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>File</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInterconnectFileKey "File" + + +/*! +@defined kIOPropertyInterconnectRAMKey +@discussion This key defines the value of RAM for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is system memory +that is being represented as a storage device, this key should be set. + +NOTE: This key should only be used when the Physical Interconnect is set to +Virtual Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>RAM</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInterconnectRAMKey "RAM" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeATA +@discussion This key defines the value of ATA for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to an ATA bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeATA "ATA" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSerialATA +@discussion This key defines the value of SATA for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SATA bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSerialATA "SATA" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI +@discussion This key defines the value of SAS for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SAS bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SAS</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI "SAS" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeATAPI +@discussion This key defines the value of ATAPI for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to an ATA bus and follows the ATAPI command specification, this key +should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATAPI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeATAPI "ATAPI" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeUSB +@discussion This key defines the value of USB for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a USB port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>USB</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeUSB "USB" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeFireWire +@discussion This key defines the value of USB for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a FireWire port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>FireWire</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeFireWire "FireWire" + + +/*! + @defined kIOPropertyPhysicalInterconnectTypeSecureDigital + @discussion This key defines the value of Secure Digital for the key + kIOPropertyPhysicalInterconnectTypeSecureDigital. If the device is a + connected to a Secure Digital port and follows the Secure Digital + specification, this key should be set. + + Example: + <pre> + @textblock + <dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Secure Digital</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> + </dict> + @/textblock + </pre> + */ +#define kIOPropertyPhysicalInterconnectTypeSecureDigital "Secure Digital" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSCSIParallel +@discussion This key defines the value of SCSI Parallel Interface for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SCSI Parallel port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSCSIParallel "SCSI Parallel Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeFibreChannel +@discussion This key defines the value of Fibre Channel Interface for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a Fibre Channel port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeFibreChannel "Fibre Channel Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeVirtual +@discussion This key defines the value of Virtual Interface for the key +kIOPropertyPhysicalInterconnectTypeVirtual. If the device is being made to look +like a storage device, but is not such in actuality, such as a File or RAM, this +key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>File</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeVirtual "Virtual Interface" + + +/*! +@defined kIOPropertyPortStatusLinkEstablishedKey +@discussion This key defines the value of Link Established for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusLinkEstablishedKey "Link Established" + + +/*! +@defined kIOPropertyPortStatusNoLinkEstablishedKey +@discussion This key defines the value of No Link Established for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>No Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusNoLinkEstablishedKey "No Link Established" + + +/*! +@defined kIOPropertyPortStatusLinkFailedKey +@discussion This key defines the value of Link Failed for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Failed</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusLinkFailedKey "Link Failed" + + +/*! +@defined kIOPropertyPortSpeedAutomaticKey +@discussion This key defines the value of Automatic for the key +kIOPropertyPortSpeedKey. If the speed of the port is automatically +adjusted by the host/device and a definitive speed is not known, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomaticKey "Automatic" + + +/*! +@defined kIOPropertyPortSpeed1GigabitKey +@discussion This key defines the value of 1 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 1 Gigabit +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>1 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed1GigabitKey "1 Gigabit" + +/*! +@defined kIOPropertyPortSpeed1_5GigabitKey +@discussion This key defines the value of 1.5 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 1.5 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>1.5 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed1_5GigabitKey "1.5 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed2GigabitKey +@discussion This key defines the value of 2 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 2 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>2 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed2GigabitKey "2 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed3GigabitKey +@discussion This key defines the value of 3 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 3 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>3 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed3GigabitKey "3 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed4GigabitKey +@discussion This key defines the value of 4 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 4 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>4 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed4GigabitKey "4 Gigabit" + +/*! +@defined kIOPropertyPortSpeed6GigabitKey +@discussion This key defines the value of 6 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 6 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>6 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed6GigabitKey "6 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed8GigabitKey +@discussion This key defines the value of 8 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 8 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>8 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed8GigabitKey "8 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed10GigabitKey +@discussion This key defines the value of 10 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 10 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>10 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed10GigabitKey "10 Gigabit" + + +/*! +@defined kIOPropertyPortSpeedAutomatic1GigabitKey +@discussion This key defines the value of Automatic (1 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +1 Gigabit per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic1GigabitKey "Automatic (1 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic1_5GigabitKey +@discussion This key defines the value of Automatic (1.5 Gigabit) for the key +kIOPropertyPortSpeedKey. If the speed of the port is +1.5 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1.5 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic1_5GigabitKey "Automatic (1.5 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic2GigabitKey +@discussion This key defines the value of Automatic (2 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +2 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (2 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic2GigabitKey "Automatic (2 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic3GigabitKey +@discussion This key defines the value of Automatic (3 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +3 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (3 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic3GigabitKey "Automatic (3 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic4GigabitKey +@discussion This key defines the value of Automatic (4 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +4 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (4 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic4GigabitKey "Automatic (4 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic6GigabitKey +@discussion This key defines the value of Automatic (6 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +6 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (6 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic6GigabitKey "Automatic (6 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic8GigabitKey +@discussion This key defines the value of Automatic (8 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +8 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (8 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic8GigabitKey "Automatic (8 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic10GigabitKey +@discussion This key defines the value of Automatic (10 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +10 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (10 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic10GigabitKey "Automatic (10 Gigabit)" + + +/*! +@defined kIOPropertyPortTopologyAutomaticKey +@discussion This key defines the value of Automatic for the key +kIOPropertyPortTopologyKey. If the topology of the port is automatically +adjusted by the host/device and a definitive topology is not known, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticKey "Automatic" + + +/*! +@defined kIOPropertyPortTopologyNPortKey +@discussion This key defines the value of N_Port for the key +kIOPropertyPortTopologyKey. If the topology of the port is an N_Port, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>N_Port</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyNPortKey "N_Port" + + +/*! +@defined kIOPropertyPortTopologyNLPortKey +@discussion This key defines the value of NL_Port for the key +kIOPropertyPortTopologyKey. If the topology of the port is an NL_Port, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>NL_Port</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyNLPortKey "NL_Port" + + +/*! +@defined kIOPropertyPortTopologyAutomaticNPortKey +@discussion This key defines the value of Automatic (N_Port) for the key +kIOPropertyPortTopologyKey. If the topology of the port is +N_Port and is automatically determined by host software, this +key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (N_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticNPortKey "Automatic (N_Port)" + + +/*! +@defined kIOPropertyPortTopologyAutomaticNLPortKey +@discussion This key defines the value of Automatic (NL_Port) for the key +kIOPropertyPortTopologyKey. If the topology of the port is +NL_Port and is automatically determined by host software, this +key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (NL_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticNLPortKey "Automatic (NL_Port)" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeHVDKey +@discussion This key defines the value of High Voltage Differential for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +High Voltage Differential, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>High Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeHVDKey "High Voltage Differential" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeLVDKey +@discussion This key defines the value of Low Voltage Differential for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +Low Voltage Differential, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>Low Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeLVDKey "Low Voltage Differential" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeSEKey +@discussion This key defines the value of Single Ended for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +Single Ended, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>Single Ended</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeSEKey "Single Ended" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionCopperKey +@discussion This key defines the value of Copper for the key +kIOPropertyFibreChannelCableDescriptionKey. If the cabling is +Copper, this key should be used. + +Requirement: Optional for Fibre Channel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Copper</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionCopperKey "Copper" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionFiberOpticKey +@discussion This key defines the value of Fiber Optic for the key +kIOPropertyFibreChannelCableDescriptionKey. If the cabling is +Fiber Optic, this key should be used. + +Requirement: Optional for Fibre Channel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Fiber Optic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionFiberOpticKey "Fiber Optic" + + +#endif /* _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ */ diff --git a/i386/include/IOKit/storage/IOAppleLabelScheme.h b/i386/include/IOKit/storage/IOAppleLabelScheme.h new file mode 100644 index 0000000..6e290a4 --- /dev/null +++ b/i386/include/IOKit/storage/IOAppleLabelScheme.h @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOAppleLabelScheme class definition. + */ + +#ifndef _IOAPPLELABELSCHEME_H +#define _IOAPPLELABELSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOAppleLabelSchemeClass is the name of the IOAppleLabelScheme class. + */ + +#define kIOAppleLabelSchemeClass "IOAppleLabelScheme" + +/* + * Apple Label Scheme Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Label scheme. */ + +struct applelabel +{ + uint8_t al_boot0[416]; /* (reserved for boot area) */ + uint16_t al_magic; /* (the magic number) */ + uint16_t al_type; /* (label type) */ + uint32_t al_flags; /* (generic flags) */ + uint64_t al_offset; /* (offset of property area, bytes) */ + uint32_t al_size; /* (size of property area, bytes) */ + uint32_t al_checksum; /* (checksum of property area) */ + uint8_t al_boot1[72]; /* (reserved for boot area) */ +}; + +/* Label scheme signature (al_magic). */ + +#define AL_MAGIC 0x414C + +/* Label scheme version (al_type). */ + +#define AL_TYPE_DEFAULT 0x0000 + +/* Label scheme flags (al_flags). */ + +#define AL_FLAG_DEFAULT 0x00000000 + +#pragma pack(pop) /* (reset to default struct packing) */ + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOFilterScheme.h> + +/* + * Class + */ + +class IOAppleLabelScheme : public IOFilterScheme +{ + OSDeclareDefaultStructors(IOAppleLabelScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + IOMedia * _content; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + /* + * Scan the provider media for an Apple label scheme. + */ + + virtual IOMedia * scan(SInt32 * score); + + /* + * Ask whether the given content appears to be corrupt. + */ + + virtual bool isContentCorrupt(OSDictionary * properties); + + /* + * Ask whether the given content appears to be invalid. + */ + + virtual bool isContentInvalid(OSDictionary * properties); + + /* + * Instantiate a new media object to represent the given content. + */ + + virtual IOMedia * instantiateMediaObject(OSDictionary * properties); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject(OSDictionary * properties); + + /* + * Attach the given media object to the device tree plane. + */ + + virtual bool attachMediaObjectToDeviceTree(IOMedia * media); + + /* + * Detach the given media object from the device tree plane. + */ + + virtual void detachMediaObjectFromDeviceTree(IOMedia * media); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /* + * Determine whether the provider media contains an Apple label scheme. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score); + + /* + * Publish the new media object which represents our content. + */ + + virtual bool start(IOService * provider); + + /* + * Clean up after the media object we published before terminating. + */ + + virtual void stop(IOService * provider); + + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 0); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 1); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 2); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 3); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 4); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 5); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 6); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 7); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 8); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 9); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 10); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 11); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 12); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 13); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 14); + OSMetaClassDeclareReservedUnused(IOAppleLabelScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOAPPLELABELSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOApplePartitionScheme.h b/i386/include/IOKit/storage/IOApplePartitionScheme.h new file mode 100644 index 0000000..ace1f3b --- /dev/null +++ b/i386/include/IOKit/storage/IOApplePartitionScheme.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOApplePartitionScheme class definition. + */ + +#ifndef _IOAPPLEPARTITIONSCHEME_H +#define _IOAPPLEPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOApplePartitionSchemeClass is the name of the IOApplePartitionScheme class. + */ + +#define kIOApplePartitionSchemeClass "IOApplePartitionScheme" + +/* + * Apple Partition Map Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Structure constants. */ + +#define DPISTRLEN 32 + +/* Partition map entry, as found in blocks 1 to dpme_map_entries of the disk. */ + +typedef struct dpme +{ + UInt16 dpme_signature; /* (unique value for partition entry, 'PM') */ + UInt16 dpme_reserved_1; /* (reserved for future use) */ + UInt32 dpme_map_entries; /* (number of partition entries) */ + UInt32 dpme_pblock_start; /* (physical block start of partition) */ + UInt32 dpme_pblocks; /* (physical block count of partition) */ + char dpme_name[DPISTRLEN]; /* (name of partition) */ + char dpme_type[DPISTRLEN]; /* (type of partition, eg. Apple_HFS) */ + UInt32 dpme_lblock_start; /* (logical block start of partition) */ + UInt32 dpme_lblocks; /* (logical block count of partition) */ + UInt32 dpme_flags; /* (partition flags, see defines below) */ + UInt32 dpme_boot_block; /* (logical block start of boot code) */ + UInt32 dpme_boot_bytes; /* (byte count of boot code) */ + UInt32 dpme_load_addr; /* (load address in memory of boot code) */ + UInt32 dpme_load_addr_2; /* (reserved for future use) */ + UInt32 dpme_goto_addr; /* (jump address in memory of boot code) */ + UInt32 dpme_goto_addr_2; /* (reserved for future use) */ + UInt32 dpme_checksum; /* (checksum of boot code) */ + UInt8 dpme_process_id[16]; /* (processor type) */ + UInt32 dpme_reserved_2[32]; /* (reserved for future use) */ + UInt32 dpme_reserved_3[62]; /* (reserved for future use) */ +} DPME; + +/* Driver descriptor map entry. */ + +typedef struct DDMap +{ + UInt32 ddBlock; /* (driver's block start, sbBlkSize-blocks) */ + UInt16 ddSize; /* (driver's block count, 512-blocks) */ + UInt16 ddType; /* (driver's system type) */ +} DDMap; + +/* Driver descriptor map, as found in block zero of the disk. */ + +typedef struct Block0 +{ + UInt16 sbSig; /* (unique value for block zero, 'ER') */ + UInt16 sbBlkSize; /* (block size for this device) */ + UInt32 sbBlkCount; /* (block count for this device) */ + UInt16 sbDevType; /* (device type) */ + UInt16 sbDevId; /* (device id) */ + UInt32 sbDrvrData; /* (driver data) */ + UInt16 sbDrvrCount; /* (driver descriptor count) */ + DDMap sbDrvrMap[8]; /* (driver descriptor table) */ + UInt8 sbReserved[430]; /* (reserved for future use) */ +} Block0; + +/* Partition map signature (sbSig). */ + +#define BLOCK0_SIGNATURE 0x4552 + +/* Partition map entry signature (dpme_signature). */ + +#define DPME_SIGNATURE 0x504D + +/* Partition map entry flags (dpme_flags). */ + +#define DPME_FLAGS_VALID 0x00000001 /* (bit 0) */ +#define DPME_FLAGS_ALLOCATED 0x00000002 /* (bit 1) */ +#define DPME_FLAGS_IN_USE 0x00000004 /* (bit 2) */ +#define DPME_FLAGS_BOOTABLE 0x00000008 /* (bit 3) */ +#define DPME_FLAGS_READABLE 0x00000010 /* (bit 4) */ +#define DPME_FLAGS_WRITABLE 0x00000020 /* (bit 5) */ +#define DPME_FLAGS_OS_PIC_CODE 0x00000040 /* (bit 6) */ +#define DPME_FLAGS_OS_SPECIFIC_2 0x00000080 /* (bit 7) */ +#define DPME_FLAGS_OS_SPECIFIC_1 0x00000100 /* (bit 8) */ +#define DPME_FLAGS_RESERVED_2 0xFFFFFE00 /* (bit 9..31) */ + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* !_IOAPPLEPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOBDBlockStorageDevice.h b/i386/include/IOKit/storage/IOBDBlockStorageDevice.h new file mode 100644 index 0000000..66a09d7 --- /dev/null +++ b/i386/include/IOKit/storage/IOBDBlockStorageDevice.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDBlockStorageDevice + * @abstract + * This header contains the IOBDBlockStorageDevice class definition. + */ + +#ifndef _IOBDBLOCKSTORAGEDEVICE_H +#define _IOBDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IOBDTypes.h> + +/*! + * @defined kIOBDBlockStorageDeviceClass + * @abstract + * kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. + * @discussion + * kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. + */ + +#define kIOBDBlockStorageDeviceClass "IOBDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeBD "BD" + +/*! + * @class + * IOBDBlockStorageDevice + * @abstract + * The IOBDBlockStorageDevice class is a generic BD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic BD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD APIs, DVD APIs, and all + * necessary new low-level BD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IOBDBlockStorageDevice : public IODVDBlockStorageDevice +{ + OSDeclareAbstractStructors(IOBDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /*! + * @function init + * @discussion + * Initialize this object's minimal state. + * @param properties + * Substitute property table for this object (optional). + * @result + * Returns true on success, false otherwise. + */ + + virtual bool init(OSDictionary * properties); + + /*! + * @function readDiscStructure + * @discussion + * Issue an MMC READ DISC STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param type + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscStructure( IOMemoryDescriptor * buffer, + UInt8 format, + UInt32 address, + UInt8 layer, + UInt8 grantID, + UInt8 type ) = 0; + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address) = 0; + + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 0); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDevice, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/IOBDBlockStorageDriver.h b/i386/include/IOKit/storage/IOBDBlockStorageDriver.h new file mode 100644 index 0000000..199218c --- /dev/null +++ b/i386/include/IOKit/storage/IOBDBlockStorageDriver.h @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDBlockStorageDriver + * @abstract + * This header contains the IOBDBlockStorageDriver class definition. + * @discussion + * This class implements BD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IOBDBLOCKSTORAGEDRIVER_H +#define _IOBDBLOCKSTORAGEDRIVER_H + +#include <IOKit/storage/IOBDBlockStorageDevice.h> +#include <IOKit/storage/IODVDBlockStorageDriver.h> + +/*! + * @defined kIOBDBlockStorageDriverClass + * @abstract + * kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class. + * @discussion + * kIOBDBlockStorageDriverClass is the name of the IOBDBlockStorageDriver class. + */ + +#define kIOBDBlockStorageDriverClass "IOBDBlockStorageDriver" + +/*! + * @class + * IOBDBlockStorageDriver + * @abstract + * Generic BD Driver. + * @discussion + * Storage drivers are split into two parts: the Generic Driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the Generic Driver level are translated into a series of generic + * device operations. These operations are passed via the Device Nub + * to a Transport Driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its Transport Driver would issue a Mode Sense command to + * extract the write-protection status bit. The Transport Driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the Transport Driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IOBDBlockStorageDriver class is a subclass + * of IODVDBlockStorageDriver, adding BD functions. Similarly, the Transport Driver + * IOBDBlockStorageDevice is a subclass of IODVDBlockStorageDevice, adding BD + * functions. +*/ + +class IOBDBlockStorageDriver : public IODVDBlockStorageDriver +{ + OSDeclareDefaultStructors(IOBDBlockStorageDriver) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /* Overrides of IODVDBlockStorageDriver. */ + + virtual IOReturn acceptNewMedia(void); + + /* End of IODVDBlockStorageDriver overrides. */ + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBDBlockStorageDevice * getProvider() const; + + /* Overrides of IODVDBlockStorageDriver: */ + + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); + + /* End of IODVDBlockStorageDriver overrides. */ + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address); + + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 0); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IOBDBlockStorageDriver, 15); +}; + +#endif /* !_IOBDBLOCKSTORAGEDRIVER_H */ diff --git a/i386/include/IOKit/storage/IOBDMedia.h b/i386/include/IOKit/storage/IOBDMedia.h new file mode 100644 index 0000000..e204a1e --- /dev/null +++ b/i386/include/IOKit/storage/IOBDMedia.h @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBDMedia + * @abstract + * This header contains the IOBDMedia class definition. + */ + +#ifndef _IOBDMEDIA_H +#define _IOBDMEDIA_H + +/*! + * @defined kIOBDMediaClass + * @abstract + * kIOBDMediaClass is the name of the IOBDMedia class. + * @discussion + * kIOBDMediaClass is the name of the IOBDMedia class. + */ + +#define kIOBDMediaClass "IOBDMedia" + +/*! + * @defined kIOBDMediaTypeKey + * @abstract + * kIOBDMediaTypeKey is a property of IOBDMedia objects. It has an OSString + * value. + * @discussion + * The kIOBDMediaTypeKey property identifies the BD media type (BD-ROM, BD-R, + * BD-RE, etc). See the kIOBDMediaType contants for possible values. + */ + +#define kIOBDMediaTypeKey "Type" + +/*! + * @defined kIOBDMediaTypeROM + * The kIOBDMediaTypeKey constant for BD-ROM media. + */ + +#define kIOBDMediaTypeROM "BD-ROM" + +/*! + * @defined kIOBDMediaTypeR + * The kIOBDMediaTypeKey constant for BD-R media. + */ + +#define kIOBDMediaTypeR "BD-R" + +/*! + * @defined kIOBDMediaTypeRE + * The kIOBDMediaTypeKey constant for BD-RE media. + */ + +#define kIOBDMediaTypeRE "BD-RE" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IOBDMedia + * @abstract + * The IOBDMedia class is a random-access disk device abstraction for BDs. + * @discussion + * The IOBDMedia class is a random-access disk device abstraction for BDs. + */ + +class IOBDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IOBDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOBDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOBDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function reportKey + * @discussion + * Issue an MMC REPORT KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param address + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt32 address, + UInt8 grantID, + UInt8 format ); + + /*! + * @function sendKey + * @discussion + * Issue an MMC SEND KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param keyClass + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn sendKey( IOMemoryDescriptor * buffer, + UInt8 keyClass, + UInt8 grantID, + UInt8 format ); + + /*! + * @function readStructure + * @discussion + * Issue an MMC READ DISC STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readStructure( IOMemoryDescriptor * buffer, + UInt8 format, + UInt32 address, + UInt8 layer, + UInt8 grantID ); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kBDSpeedMin specifies the minimum speed for all BD media (1X). + * kBDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kBDSpeedMin specifies the minimum speed for all BD media (1X). + * kBDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param type + * Reserved for future use. Set to zero. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer, + UInt8 type, + UInt16 * actualByteCount ); + + /*! + * @function readTrackInfo + * @discussion + * Issue an MMC READ TRACK INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param open + * Reserved for future use. Set to zero. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTrackInfo( IOMemoryDescriptor * buffer, + UInt32 address, + UInt8 addressType, + UInt8 open, + UInt16 * actualByteCount ); + + /*! + * @function splitTrack + * @discussion + * Issue an MMC RESERVE TRACK command with the ARSV bit. + * @param address + * As documented by MMC. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn splitTrack(UInt32 address); + + OSMetaClassDeclareReservedUnused(IOBDMedia, 0); + OSMetaClassDeclareReservedUnused(IOBDMedia, 1); + OSMetaClassDeclareReservedUnused(IOBDMedia, 2); + OSMetaClassDeclareReservedUnused(IOBDMedia, 3); + OSMetaClassDeclareReservedUnused(IOBDMedia, 4); + OSMetaClassDeclareReservedUnused(IOBDMedia, 5); + OSMetaClassDeclareReservedUnused(IOBDMedia, 6); + OSMetaClassDeclareReservedUnused(IOBDMedia, 7); + OSMetaClassDeclareReservedUnused(IOBDMedia, 8); + OSMetaClassDeclareReservedUnused(IOBDMedia, 9); + OSMetaClassDeclareReservedUnused(IOBDMedia, 10); + OSMetaClassDeclareReservedUnused(IOBDMedia, 11); + OSMetaClassDeclareReservedUnused(IOBDMedia, 12); + OSMetaClassDeclareReservedUnused(IOBDMedia, 13); + OSMetaClassDeclareReservedUnused(IOBDMedia, 14); + OSMetaClassDeclareReservedUnused(IOBDMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDMEDIA_H */ diff --git a/i386/include/IOKit/storage/IOBDMediaBSDClient.h b/i386/include/IOKit/storage/IOBDMediaBSDClient.h new file mode 100644 index 0000000..ee356f5 --- /dev/null +++ b/i386/include/IOKit/storage/IOBDMediaBSDClient.h @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOBDMEDIABSDCLIENT_H +#define _IOBDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> +#include <sys/types.h> + +#include <IOKit/storage/IOBDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCBDREADSTRUCTURE see IOBDMedia::readStructure() in IOBDMedia.h + * + * DKIOCBDREADDISCINFO see IOBDMedia::readDiscInfo() in IOBDMedia.h + * DKIOCBDREADTRACKINFO see IOBDMedia::readTrackInfo() in IOBDMedia.h + * + * DKIOCBDREPORTKEY see IOBDMedia::reportKey() in IOBDMedia.h + * DKIOCBDSENDKEY see IOBDMedia::sendKey() in IOBDMedia.h + * + * DKIOCBDGETSPEED see IOBDMedia::getSpeed() in IOBDMedia.h + * DKIOCBDSETSPEED see IOBDMedia::setSpeed() in IOBDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint8_t format; + + uint8_t reserved0008[3]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + uint8_t layer; + + uint8_t reserved0080[4]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_read_structure_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[2]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_report_key_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[6]; /* reserved, clear to zero */ + + uint8_t grantID; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; + void * buffer; +} dk_bd_send_key_t; + +typedef struct +{ + uint8_t reserved0000[14]; /* reserved, clear to zero */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_bd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + + uint8_t reserved0072[5]; /* reserved, clear to zero */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_bd_read_track_info_t; + +#define DKIOCBDREADSTRUCTURE _IOW('d', 160, dk_bd_read_structure_t) +#define DKIOCBDREPORTKEY _IOW('d', 161, dk_bd_report_key_t) +#define DKIOCBDSENDKEY _IOW('d', 162, dk_bd_send_key_t) + +#define DKIOCBDGETSPEED _IOR('d', 163, uint16_t) +#define DKIOCBDSETSPEED _IOW('d', 163, uint16_t) + +#define DKIOCBDREADDISCINFO _IOWR('d', 164, dk_bd_read_disc_info_t) +#define DKIOCBDREADTRACKINFO _IOWR('d', 165, dk_bd_read_track_info_t) + +#define DKIOCBDSPLITTRACK _IOW('d', 166, uint32_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IOBDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IOBDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IOBDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOBDMedia * getProvider() const; + + /* + * Process a BD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOBDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBDMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/IOBDTypes.h b/i386/include/IOKit/storage/IOBDTypes.h new file mode 100644 index 0000000..f5b7927 --- /dev/null +++ b/i386/include/IOKit/storage/IOBDTypes.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2006-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _BDTYPES_H +#define _BDTYPES_H + +#include <IOKit/IOTypes.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Media Types + */ + +enum +{ + kBDMediaTypeUnknown = 0x0300, + kBDMediaTypeROM = 0x0302, /* BD-ROM */ + kBDMediaTypeRE = 0x0303, /* BD-RE */ + kBDMediaTypeR = 0x0304, /* BD-R */ + + kBDMediaTypeMin = 0x0300, + kBDMediaTypeMax = 0x03FF +}; + +typedef UInt32 BDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kBDSpeedMin 0x1126 +#define kBDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +// Read Disc Information Format +struct BDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastSession:2; + UInt8 erasable:1; + UInt8 dataType:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 dataType:3; + UInt8 erasable:1; + UInt8 stateOfLastSession:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2; + UInt8 numberOfSessionsLSB; + UInt8 firstTrackNumberInLastSessionLSB; + UInt8 lastTrackNumberInLastSessionLSB; + UInt8 reserved4[2]; + UInt8 numberOfSessionsMSB; + UInt8 firstTrackNumberInLastSessionMSB; + UInt8 lastTrackNumberInLastSessionMSB; + UInt8 reserved6[22]; +}; +typedef struct BDDiscInfo BDDiscInfo; + +// Read Track Information Format +struct BDTrackInfo +{ + UInt16 dataLength; + UInt8 trackNumberLSB; + UInt8 sessionNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved2:5; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 reserved4:6; + UInt8 blank:1; + UInt8 reservedTrack:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 reserved2:5; + + UInt8 reservedTrack:1; + UInt8 blank:1; + UInt8 reserved4:6; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 trackStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 clusterSize; + UInt32 trackSize; + UInt32 lastRecordedAddress; + UInt8 trackNumberMSB; + UInt8 sessionNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct BDTrackInfo BDTrackInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _BDTYPES_H */ diff --git a/i386/include/IOKit/storage/IOBlockStorageDevice.h b/i386/include/IOKit/storage/IOBlockStorageDevice.h new file mode 100644 index 0000000..bbec146 --- /dev/null +++ b/i386/include/IOKit/storage/IOBlockStorageDevice.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBlockStorageDevice + * @abstract + * This header contains the IOBlockStorageDevice class definition. + */ + +#ifndef _IOBLOCKSTORAGEDEVICE_H +#define _IOBLOCKSTORAGEDEVICE_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOStorageDeviceCharacteristics.h> + +/*! + * @defined kIOBlockStorageDeviceClass + * @abstract + * The name of the IOBlockStorageDevice class. + */ + +#define kIOBlockStorageDeviceClass "IOBlockStorageDevice" + +/*! + * @defined kIOBlockStorageDeviceWriteCacheStateKey + * @abstract + * The name of the property used to get or set the write cache state of the + * block storage device. + */ +#define kIOBlockStorageDeviceWriteCacheStateKey "WriteCacheState" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOMessage.h> +#include <IOKit/IOService.h> +#include <IOKit/storage/IOMedia.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +/*! + * @defined kIOBlockStorageDeviceTypeKey + * @abstract The name of the property tested for nub type matching by the generic block + * storage driver. + */ +#define kIOBlockStorageDeviceTypeKey "device-type" +/*! + * @defined kIOBlockStorageDeviceTypeGeneric + * @abstract A character string used for nub matching. + */ +#define kIOBlockStorageDeviceTypeGeneric "Generic" + + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/IOBlockStorageDriver.h b/i386/include/IOKit/storage/IOBlockStorageDriver.h new file mode 100644 index 0000000..24ac3c2 --- /dev/null +++ b/i386/include/IOKit/storage/IOBlockStorageDriver.h @@ -0,0 +1,245 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOBlockStorageDriver + * @abstract + * This header contains the IOBlockStorageDriver class definition. + */ + +#ifndef _IOBLOCKSTORAGEDRIVER_H +#define _IOBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOBlockStorageDriverClass + * @abstract + * The name of the IOBlockStorageDriver class. + */ + +#define kIOBlockStorageDriverClass "IOBlockStorageDriver" + +/*! + * @defined kIOBlockStorageDriverStatisticsKey + * @abstract + * Holds a table of numeric values describing the driver's + * operating statistics. + * @discussion + * This property holds a table of numeric values describing the driver's + * operating statistics. The table is an OSDictionary, where each entry + * describes one given statistic. + */ + +#define kIOBlockStorageDriverStatisticsKey "Statistics" + +/*! + * @defined kIOBlockStorageDriverStatisticsBytesReadKey + * @abstract + * Describes the number of bytes read since the block storage + * driver was instantiated. + * @discussion + * This property describes the number of bytes read since the block storage + * driver was instantiated. It is one of the statistic entries listed under + * the top-level kIOBlockStorageDriverStatisticsKey property table. It has + * an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsBytesReadKey "Bytes (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsBytesWrittenKey + * @abstract + * Describes the number of bytes written since the block storage + * driver was instantiated. + * @discussion + * This property describes the number of bytes written since the block storage + * driver was instantiated. It is one of the statistic entries listed under the + * top-level kIOBlockStorageDriverStatisticsKey property table. It has an + * OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsBytesWrittenKey "Bytes (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadErrorsKey + * @abstract + * Describes the number of read errors encountered since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of read errors encountered since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadErrorsKey "Errors (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWriteErrorsKey + * @abstract + * Describes the number of write errors encountered since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of write errors encountered since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWriteErrorsKey "Errors (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsLatentReadTimeKey + * @abstract + * Describes the number of nanoseconds of latency during reads + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds of latency during reads + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsLatentReadTimeKey "Latency Time (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsLatentWriteTimeKey + * @abstract + * Describes the number of nanoseconds of latency during writes + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds of latency during writes + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsLatentWriteTimeKey "Latency Time (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadsKey + * @abstract + * Describes the number of read operations processed since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of read operations processed since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadsKey "Operations (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWritesKey + * @abstract + * Describes the number of write operations processed since the + * block storage driver was instantiated. + * @discussion + * This property describes the number of write operations processed since the + * block storage driver was instantiated. It is one of the statistic entries + * listed under the top-level kIOBlockStorageDriverStatisticsKey property table. + * It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWritesKey "Operations (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsReadRetriesKey + * @abstract + * Describes the number of read retries required since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of read retries required since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsReadRetriesKey "Retries (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsWriteRetriesKey + * @abstract + * Describes the number of write retries required since the block + * storage driver was instantiated. + * @discussion + * This property describes the number of write retries required since the block + * storage driver was instantiated. It is one of the statistic entries listed + * under the top-level kIOBlockStorageDriverStatisticsKey property table. It + * has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsWriteRetriesKey "Retries (Write)" + +/*! + * @defined kIOBlockStorageDriverStatisticsTotalReadTimeKey + * @abstract + * Describes the number of nanoseconds spent performing reads + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds spent performing reads + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsTotalReadTimeKey "Total Time (Read)" + +/*! + * @defined kIOBlockStorageDriverStatisticsTotalWriteTimeKey + * @abstract + * Describes the number of nanoseconds spent performing writes + * since the block storage driver was instantiated. + * @discussion + * This property describes the number of nanoseconds spent performing writes + * since the block storage driver was instantiated. It is one of the statistic + * entries listed under the top-level kIOBlockStorageDriverStatisticsKey + * property table. It has an OSNumber value. + */ + +#define kIOBlockStorageDriverStatisticsTotalWriteTimeKey "Total Time (Write)" + +/*! + * @enum IOMediaState + * @abstract + * The different states that getMediaState() can report. + * @constant kIOMediaStateOffline + * Media is not available. + * @constant kIOMediaStateOnline + * Media is available and ready for operations. + * @constant kIOMediaStateBusy + * Media is available, but not ready for operations. + */ + +enum +{ + kIOMediaStateOffline = 0, + kIOMediaStateOnline = 1, + kIOMediaStateBusy = 2 +}; + +typedef UInt32 IOMediaState; + +#endif /* !_IOBLOCKSTORAGEDRIVER_H */ diff --git a/i386/include/IOKit/storage/IOCDBlockStorageDevice.h b/i386/include/IOKit/storage/IOCDBlockStorageDevice.h new file mode 100644 index 0000000..706da40 --- /dev/null +++ b/i386/include/IOKit/storage/IOCDBlockStorageDevice.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDBlockStorageDevice + * @abstract + * This header contains the IOCDBlockStorageDevice class definition. + */ + +#ifndef _IOCDBLOCKSTORAGEDEVICE_H +#define _IOCDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IOCDTypes.h> + +/*! + * @defined kIOCDBlockStorageDeviceClass + * @abstract + * kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. + * @discussion + * kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. + */ + +#define kIOCDBlockStorageDeviceClass "IOCDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeCDROM "CDROM" + + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/IOCDBlockStorageDriver.h b/i386/include/IOKit/storage/IOCDBlockStorageDriver.h new file mode 100644 index 0000000..f88a406 --- /dev/null +++ b/i386/include/IOKit/storage/IOCDBlockStorageDriver.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IOCDBlockStorageDriver.h + * + * This class implements CD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IOCDBLOCKSTORAGEDRIVER_H +#define _IOCDBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOCDBlockStorageDevice.h> +#include <IOKit/storage/IOCDTypes.h> +#include <IOKit/storage/IOBlockStorageDriver.h> + +/*! + * @defined kIOCDBlockStorageDriverClass + * @abstract + * kIOCDBlockStorageDriverClass is the name of the IOCDBlockStorageDriver class. + * @discussion + * kIOCDBlockStorageDriverClass is the name of the IOCDBlockStorageDriver class. + */ + +#define kIOCDBlockStorageDriverClass "IOCDBlockStorageDriver" + +#endif diff --git a/i386/include/IOKit/storage/IOCDMedia.h b/i386/include/IOKit/storage/IOCDMedia.h new file mode 100644 index 0000000..85ad72d --- /dev/null +++ b/i386/include/IOKit/storage/IOCDMedia.h @@ -0,0 +1,553 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDMedia + * @abstract + * This header contains the IOCDMedia class definition. + */ + +#ifndef _IOCDMEDIA_H +#define _IOCDMEDIA_H + +/*! + * @defined kIOCDMediaClass + * @abstract + * kIOCDMediaClass is the name of the IOCDMedia class. + * @discussion + * kIOCDMediaClass is the name of the IOCDMedia class. + */ + +#define kIOCDMediaClass "IOCDMedia" + +/*! + * @defined kIOCDMediaTOCKey + * @abstract + * kIOCDMediaTOCKey is a property of IOCDMedia objects. It has an OSData value + * and a CDTOC structure. + * @discussion + * The kIOCDMediaTOCKey property contains the CD's full table of contents, + * formatted as a CDTOC structure. The CDTOC structure is same as what is + * returned by a READ TOC command, format 0x02. All fields in the TOC are + * guaranteed to be binary-encoded (no BCD-encoded numbers are ever passed). + */ + +#define kIOCDMediaTOCKey "TOC" + +/*! + * @defined kIOCDMediaTypeKey + * @abstract + * kIOCDMediaTypeKey is a property of IOCDMedia objects. It has an OSString + * value. + * @discussion + * The kIOCDMediaTypeKey property identifies the CD media type (CD-ROM, CD-R, + * CD-RW, etc). See the kIOCDMediaType contants for possible values. + */ + +#define kIOCDMediaTypeKey "Type" + +/*! + * @defined kIOCDMediaTypeROM + * The kIOCDMediaTypeKey constant for CD-ROM media (inclusive of the CD-I, + * CD-ROM XA, and CD Audio standards, and mixed mode combinations thereof). + */ + +#define kIOCDMediaTypeROM "CD-ROM" + +/*! + * @defined kIOCDMediaTypeR + * The kIOCDMediaTypeKey constant for CD Recordable (CD-R) media. + */ + +#define kIOCDMediaTypeR "CD-R" + +/*! + * @defined kIOCDMediaTypeRW + * The kIOCDMediaTypeKey constant for CD ReWritable (CD-RW) media. + */ + +#define kIOCDMediaTypeRW "CD-RW" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IOCDMedia + * @abstract + * The IOCDMedia class is a random-access disk device abstraction for CDs. + * @discussion + * The IOCDMedia class is a random-access disk device abstraction for CDs. It + * extends the IOMedia class by implementing special CD APIs, such as readCD, + * and publishing the TOC as a property of the IOCDMedia object. + */ + +class IOCDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IOCDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IOCDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IOCDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function readCD + * @discussion + * Read data from the CD media object at the specified byte offset into the + * specified buffer, asynchronously. Special areas of the CD sector can be + * read via this method, such as the header and subchannel data. When the + * read completes, the caller will be notified via the specified completion + * action. + * + * The buffer will be retained for the duration of the read. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to read. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. The data transfer is terminated as soon as + * data is encountered that does not match the expected type. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + +#ifdef __LP64__ + virtual void readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); +#else /* !__LP64__ */ + virtual void readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion); +#endif /* !__LP64__ */ + + /*! + * @function readCD + * @discussion + * Read data from the CD media object at the specified byte offset into the + * specified buffer, synchronously. Special areas of the CD sector can be + * read via this method, such as the header and subchannel data. When the + * read completes, this method will return to the caller. The actual byte + * count field is optional. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to read. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. The data transfer is terminated as soon as + * data is encountered that does not match the expected type. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + +#ifdef __LP64__ + virtual IOReturn readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); +#else /* !__LP64__ */ + virtual IOReturn readCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + UInt64 * actualByteCount = 0); +#endif /* !__LP64__ */ + + /*! + * @function readISRC + * @discussion + * Read the International Standard Recording Code for the specified track. + * @param track + * Track number from which to read the ISRC. + * @param isrc + * Buffer for the ISRC data. Buffer contents will be zero-terminated. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn readISRC(UInt8 track, CDISRC isrc); + + /*! + * @function readMCN + * @discussion + * Read the Media Catalog Number (also known as the Universal Product Code). + * @param mcn + * Buffer for the MCN data. Buffer contents will be zero-terminated. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn readMCN(CDMCN mcn); + + /*! + * @function getTOC + * @discussion + * Get the full Table Of Contents. + * + * All CDTOC fields passed across I/O Kit APIs are guaranteed to be + * binary-encoded (no BCD-encoded numbers are ever passed). + * @result + * Returns a pointer to the TOC buffer (do not deallocate). + */ + + virtual CDTOC * getTOC(); + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kCDSpeedMin specifies the minimum speed for all CD media (1X). + * kCDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kCDSpeedMin specifies the minimum speed for all CD media (1X). + * kCDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function readTOC + * @discussion + * Issue an MMC READ TOC/PMA/ATIP command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param formatAsTime + * As documented by MMC. + * @param trackOrSessionNumber + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTOC(IOMemoryDescriptor * buffer, + CDTOCFormat format, + UInt8 formatAsTime, + UInt8 trackOrSessionNumber, + UInt16 * actualByteCount); /* 10.1.3 */ + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo(IOMemoryDescriptor * buffer, + UInt16 * actualByteCount); /* 10.1.3 */ + + /*! + * @function readTrackInfo + * @discussion + * Issue an MMC READ TRACK INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readTrackInfo(IOMemoryDescriptor * buffer, + UInt32 address, + CDTrackInfoAddressType addressType, + UInt16 * actualByteCount); /* 10.1.3 */ + + /* + * @function writeCD + * @discussion + * Write data into the CD media object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to write. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + +#ifdef __LP64__ + virtual void writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); +#else /* !__LP64__ */ + virtual void writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageCompletion completion); /* 10.2.0 */ +#endif /* !__LP64__ */ + + /* + * @function writeCD + * @discussion + * Write data into the CD media object at the specified byte offset from the + * specified buffer, synchronously. When the write completes, this method + * will return to the caller. The actual byte count field is optional. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer (see sectorArea parameter). + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param sectorArea + * Sector area(s) to write. The sum of each area's size defines the natural + * block size of the media for the call. This should be taken into account + * when computing the address of byteStart. See IOCDTypes.h. + * @param sectorType + * Sector type that is expected. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + +#ifdef __LP64__ + virtual IOReturn writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + IOStorageAttributes * attributes = 0, + UInt64 * actualByteCount = 0); +#else /* !__LP64__ */ + virtual IOReturn writeCD(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + CDSectorArea sectorArea, + CDSectorType sectorType, + UInt64 * actualByteCount = 0); /* 10.2.0 */ +#endif /* !__LP64__ */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOCDMedia, 0); + OSMetaClassDeclareReservedUnused(IOCDMedia, 1); + OSMetaClassDeclareReservedUnused(IOCDMedia, 2); + OSMetaClassDeclareReservedUnused(IOCDMedia, 3); + OSMetaClassDeclareReservedUnused(IOCDMedia, 4); + OSMetaClassDeclareReservedUnused(IOCDMedia, 5); + OSMetaClassDeclareReservedUnused(IOCDMedia, 6); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOCDMedia, 0); + OSMetaClassDeclareReservedUsed(IOCDMedia, 1); + OSMetaClassDeclareReservedUsed(IOCDMedia, 2); + OSMetaClassDeclareReservedUsed(IOCDMedia, 3); + OSMetaClassDeclareReservedUsed(IOCDMedia, 4); + OSMetaClassDeclareReservedUsed(IOCDMedia, 5); + OSMetaClassDeclareReservedUsed(IOCDMedia, 6); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOCDMedia, 7); + OSMetaClassDeclareReservedUnused(IOCDMedia, 8); + OSMetaClassDeclareReservedUnused(IOCDMedia, 9); + OSMetaClassDeclareReservedUnused(IOCDMedia, 10); + OSMetaClassDeclareReservedUnused(IOCDMedia, 11); + OSMetaClassDeclareReservedUnused(IOCDMedia, 12); + OSMetaClassDeclareReservedUnused(IOCDMedia, 13); + OSMetaClassDeclareReservedUnused(IOCDMedia, 14); + OSMetaClassDeclareReservedUnused(IOCDMedia, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDMEDIA_H */ diff --git a/i386/include/IOKit/storage/IOCDMediaBSDClient.h b/i386/include/IOKit/storage/IOCDMediaBSDClient.h new file mode 100644 index 0000000..ce31863 --- /dev/null +++ b/i386/include/IOKit/storage/IOCDMediaBSDClient.h @@ -0,0 +1,199 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOCDMEDIABSDCLIENT_H +#define _IOCDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> + +#include <IOKit/storage/IOCDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCCDREAD see IOCDMedia::readCD() in IOCDMedia.h + * DKIOCCDREADTOC see IOCDMedia::readTOC() in IOCDMedia.h + * + * DKIOCCDREADDISCINFO see IOCDMedia::readDiscInfo() in IOCDMedia.h + * DKIOCCDREADTRACKINFO see IOCDMedia::readTrackInfo() in IOCDMedia.h + * + * DKIOCCDREADISRC see IOCDMedia::readISRC() in IOCDMedia.h + * DKIOCCDREADMCN see IOCDMedia::readMCN() in IOCDMedia.h + * + * DKIOCCDGETSPEED see IOCDMedia::getSpeed() in IOCDMedia.h + * DKIOCCDSETSPEED see IOCDMedia::setSpeed() in IOCDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint64_t offset; + + uint8_t sectorArea; + uint8_t sectorType; + +#ifdef __LP64__ + uint8_t reserved0080[10]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0080[6]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint32_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_t; + +typedef struct +{ + CDISRC isrc; + uint8_t track; + + uint8_t reserved0112[2]; /* reserved, clear to zero */ +} dk_cd_read_isrc_t; + +typedef struct +{ + CDMCN mcn; + + uint8_t reserved0112[2]; /* reserved, clear to zero */ +} dk_cd_read_mcn_t; + +typedef struct +{ + uint8_t format; + uint8_t formatAsTime; + + uint8_t reserved0016[5]; /* reserved, clear to zero */ + + union + { + uint8_t session; + uint8_t track; + } address; + +#ifdef __LP64__ + uint8_t reserved0064[6]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0064[2]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_toc_t; + +typedef struct +{ +#ifdef __LP64__ + uint8_t reserved0000[14]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0000[10]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_cd_read_track_info_t; + +#define DKIOCCDREAD _IOWR('d', 96, dk_cd_read_t) + +#define DKIOCCDREADISRC _IOWR('d', 97, dk_cd_read_isrc_t) +#define DKIOCCDREADMCN _IOWR('d', 98, dk_cd_read_mcn_t) + +#define DKIOCCDGETSPEED _IOR('d', 99, uint16_t) +#define DKIOCCDSETSPEED _IOW('d', 99, uint16_t) + +#define DKIOCCDREADTOC _IOWR('d', 100, dk_cd_read_toc_t) + +#define DKIOCCDREADDISCINFO _IOWR('d', 101, dk_cd_read_disc_info_t) +#define DKIOCCDREADTRACKINFO _IOWR('d', 102, dk_cd_read_track_info_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IOCDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IOCDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IOCDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOCDMedia * getProvider() const; + + /* + * Process a CD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IOCDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/IOCDPartitionScheme.h b/i386/include/IOKit/storage/IOCDPartitionScheme.h new file mode 100644 index 0000000..1ff58c4 --- /dev/null +++ b/i386/include/IOKit/storage/IOCDPartitionScheme.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOCDPartitionScheme + * @abstract + * This header contains the IOCDPartitionScheme class definition. + */ + +#ifndef _IOCDPARTITIONSCHEME_H +#define _IOCDPARTITIONSCHEME_H + +#include <IOKit/storage/IOCDTypes.h> + +/*! + * @defined kIOCDPartitionSchemeClass + * @abstract + * kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class. + * @discussion + * kIOCDPartitionSchemeClass is the name of the IOCDPartitionScheme class. + */ + +#define kIOCDPartitionSchemeClass "IOCDPartitionScheme" + +/*! + * @defined kIOMediaSessionIDKey + * @abstract + * kIOMediaSessionIDKey is property of IOMedia objects. It has an OSNumber + * value. + * @discussion + * The kIOMediaSessionIDKey property is placed into each IOMedia instance + * created by the CD partition scheme. It identifies the session number + * the track was recorded on. + */ + +#define kIOMediaSessionIDKey "Session ID" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDMedia.h> +#include <IOKit/storage/IOPartitionScheme.h> + +/* + * Class + */ + +class IOCDPartitionScheme : public IOPartitionScheme +{ + OSDeclareDefaultStructors(IOCDPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + OSSet * _partitions; /* (set of media objects representing partitions) */ + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(void); + + /* + * Scan the provider media for CD partitions (in TOC). Returns the set + * of media objects representing each of the partitions (the retain for + * the set is passed to the caller), or null should no CD partitions be + * found. The default probe score can be adjusted up or down, based on + * the confidence of the scan. + */ + + virtual OSSet * scan(SInt32 * score); + + /* + * Ask whether the given partition appears to be corrupt. A partition that + * is corrupt will cause the failure of the CD partition scheme altogether. + */ + + virtual bool isPartitionCorrupt( CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Ask whether the given partition appears to be invalid. A partition that + * is invalid will cause it to be skipped in the scan, but will not cause a + * failure of the CD partition scheme. + */ + + virtual bool isPartitionInvalid( CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Instantiate a new media object to represent the given partition. + */ + + virtual IOMedia * instantiateMediaObject( + CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + + /* + * Allocate a new media object (called from instantiateMediaObject). + */ + + virtual IOMedia * instantiateDesiredMediaObject( + CDTOCDescriptor * partition, + UInt64 partitionSize, + UInt32 partitionBlockSize, + CDSectorType partitionBlockType, + CDTOC * toc ); + +public: + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /* + * Scan the provider media for CD partitions. + */ + + virtual IOService * probe(IOService * provider, SInt32 * score); + + /* + * Determine whether the provider media contains CD partitions. + */ + + virtual bool start(IOService * provider); + + /* + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For the CD partition scheme, we convert the read from a partition + * object into the appropriate readCD command to our provider media. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For the CD partition scheme, we convert the write from a partition + * object into the appropriate writeCD command to our provider media. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- IOCDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOCDMedia * getProvider() const; + + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 2); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOCDPartitionScheme, 15); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOCDPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOCDTypes.h b/i386/include/IOKit/storage/IOCDTypes.h new file mode 100644 index 0000000..6b1af29 --- /dev/null +++ b/i386/include/IOKit/storage/IOCDTypes.h @@ -0,0 +1,492 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOCDTYPES_H +#define _IOCDTYPES_H + +#include <IOKit/IOTypes.h> +#include <libkern/OSByteOrder.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Minutes, Seconds, Frames (M:S:F) + * + * All M:S:F values passed across I/O Kit APIs are guaranteed to be + * binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +typedef struct +{ + UInt8 minute; + UInt8 second; + UInt8 frame; +} CDMSF; + +/* + * Media Catalogue Numbers (MCN), International Standard Recording Codes (ISRC) + * + * All MCN and ISRC values passed across I/O Kit APIs are guaranteed + * to have a zero-terminating byte, for convenient use as C strings. + */ + +#define kCDMCNMaxLength 13 +#define kCDISRCMaxLength 12 + +typedef char CDMCN [kCDMCNMaxLength + 1]; +typedef char CDISRC[kCDISRCMaxLength + 1]; + +/* + * Audio Status + * + * All CDAudioStatus fields passed across I/O Kit APIs are guaranteed to + * be binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +#define kCDAudioStatusUnsupported 0x00 +#define kCDAudioStatusActive 0x11 +#define kCDAudioStatusPaused 0x12 +#define kCDAudioStatusSuccess 0x13 +#define kCDAudioStatusFailure 0x14 +#define kCDAudioStatusNone 0x15 + +typedef struct +{ + UInt8 status; + struct + { + CDMSF time; + struct + { + UInt8 index; + UInt8 number; + CDMSF time; + } track; + } position; +} CDAudioStatus; + +/* + * Table Of Contents + * + * All CDTOC fields passed across I/O Kit APIs are guaranteed to be + * binary-encoded numbers (no BCD-encoded numbers are ever passed). + */ + +typedef struct +{ + UInt8 session; +#ifdef __LITTLE_ENDIAN__ + UInt8 control:4, adr:4; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 adr:4, control:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 tno; + UInt8 point; + CDMSF address; + UInt8 zero; + CDMSF p; +} CDTOCDescriptor; + +typedef struct +{ + UInt16 length; + UInt8 sessionFirst; + UInt8 sessionLast; + CDTOCDescriptor descriptors[0]; +} CDTOC; + +/* + * Table Of Contents Descriptor Count Convenience Function + */ + +static inline UInt32 CDTOCGetDescriptorCount(CDTOC * toc) +{ + UInt32 tocSize = OSSwapBigToHostInt16(toc->length) + (UInt32) sizeof(toc->length); + + return (tocSize < (UInt32) sizeof(CDTOC)) ? 0 : + (tocSize - (UInt32) sizeof(CDTOC)) / (UInt32) sizeof(CDTOCDescriptor); +} + +/* + * M:S:F To LBA Convenience Function + */ + +static inline UInt32 CDConvertMSFToLBA(CDMSF msf) +{ + return (((msf.minute * 60U) + msf.second) * 75U) + msf.frame - 150U; +} + +/* + * M:S:F To Clipped LBA Convenience Function + */ + +static inline UInt32 CDConvertMSFToClippedLBA(CDMSF msf) +{ + return (msf.minute == 0 && msf.second <= 1) ? 0 : CDConvertMSFToLBA(msf); +} + +/* + * LBA To M:S:F Convenience Function + */ + +static inline CDMSF CDConvertLBAToMSF(UInt32 lba) +{ + CDMSF msf; + + lba += 150; + msf.minute = (lba / (75 * 60)); + msf.second = (lba % (75 * 60)) / 75; + msf.frame = (lba % (75 )); + + return msf; +} + +/* + * Track Number To M:S:F Convenience Function + * + * The CDTOC structure is assumed to be complete, that is, none of + * the descriptors are missing or clipped due to an insufficiently + * sized buffer holding the CDTOC contents. + */ + +static inline CDMSF CDConvertTrackNumberToMSF(UInt8 track, CDTOC * toc) +{ + UInt32 count = CDTOCGetDescriptorCount(toc); + UInt32 i; + CDMSF msf = { 0xFF, 0xFF, 0xFF }; + + for (i = 0; i < count; i++) + { + if (toc->descriptors[i].point == track && toc->descriptors[i].adr == 1) + { + msf = toc->descriptors[i].p; + break; + } + } + + return msf; +} + +/* + * Sector Areas, Sector Types + * + * Bytes Per Type CDDA Mode1 Mode2 Mode2Form1 Mode2Form2 + * Per Area +----------+----------+----------+----------+----------+ + * Sync | 0 | 12 | 12 | 12 | 12 | + * Header | 0 | 4 | 4 | 4 | 4 | + * SubHeader | 0 | 0 | 0 | 8 | 8 | + * User | 2352 | 2048 | 2336 | 2048 | 2328 | + * Auxiliary | 0 | 288 | 0 | 280 | 0 | + * ErrorFlags | 294 | 294 | 294 | 294 | 294 | + * SubChannel | 96 | 96 | 96 | 96 | 96 | + * SubChannelQ | 16 | 16 | 16 | 16 | 16 | + * +----------+----------+----------+----------+----------+ + */ + +typedef enum +{ + kCDSectorAreaSync = 0x80, + kCDSectorAreaHeader = 0x20, + kCDSectorAreaSubHeader = 0x40, + kCDSectorAreaUser = 0x10, + kCDSectorAreaAuxiliary = 0x08, + kCDSectorAreaErrorFlags = 0x02, + kCDSectorAreaSubChannel = 0x01, + kCDSectorAreaSubChannelQ = 0x04 +} CDSectorArea; + +typedef enum +{ + kCDSectorTypeUnknown = 0x00, + kCDSectorTypeCDDA = 0x01, + kCDSectorTypeMode1 = 0x02, + kCDSectorTypeMode2 = 0x03, + kCDSectorTypeMode2Form1 = 0x04, + kCDSectorTypeMode2Form2 = 0x05, + kCDSectorTypeCount = 0x06 +} CDSectorType; + +typedef enum +{ + kCDSectorSizeCDDA = 2352, + kCDSectorSizeMode1 = 2048, + kCDSectorSizeMode2 = 2336, + kCDSectorSizeMode2Form1 = 2048, + kCDSectorSizeMode2Form2 = 2328, + kCDSectorSizeWhole = 2352 +} CDSectorSize; + +/* + * Media Types + */ + +typedef enum +{ + kCDMediaTypeUnknown = 0x0100, + kCDMediaTypeROM = 0x0102, /* CD-ROM */ + kCDMediaTypeR = 0x0104, /* CD-R */ + kCDMediaTypeRW = 0x0105, /* CD-RW */ + + kCDMediaTypeMin = 0x0100, + kCDMediaTypeMax = 0x01FF +}; + +typedef UInt32 CDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kCDSpeedMin 0x00B0 +#define kCDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +// Read Table Of Contents Format Types +typedef UInt8 CDTOCFormat; +enum +{ + kCDTOCFormatTOC = 0x02, // CDTOC + kCDTOCFormatPMA = 0x03, // CDPMA + kCDTOCFormatATIP = 0x04, // CDATIP + kCDTOCFormatTEXT = 0x05 // CDTEXT +}; + +// Read Table Of Contents Format 0x03 +struct CDPMADescriptor +{ + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 control:4, adr:4; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 adr:4, control:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 tno; + UInt8 point; + CDMSF address; + UInt8 zero; + CDMSF p; +}; +typedef struct CDPMADescriptor CDPMADescriptor; + +struct CDPMA +{ + UInt16 dataLength; + UInt8 reserved; + UInt8 reserved2; + CDPMADescriptor descriptors[0]; +}; +typedef struct CDPMA CDPMA; + +// Read Table Of Contents Format 0x04 +struct CDATIP +{ + UInt16 dataLength; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 referenceSpeed:3; + UInt8 reserved3:1; + UInt8 indicativeTargetWritingPower:3; + UInt8 reserved2:1; + + UInt8 reserved5:6; + UInt8 unrestrictedUse:1; + UInt8 reserved4:1; + + UInt8 a3Valid:1; + UInt8 a2Valid:1; + UInt8 a1Valid:1; + UInt8 discSubType:3; + UInt8 discType:1; + UInt8 reserved6:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2:1; + UInt8 indicativeTargetWritingPower:3; + UInt8 reserved3:1; + UInt8 referenceSpeed:3; + + UInt8 reserved4:1; + UInt8 unrestrictedUse:1; + UInt8 reserved5:6; + + UInt8 reserved6:1; + UInt8 discType:1; + UInt8 discSubType:3; + UInt8 a1Valid:1; + UInt8 a2Valid:1; + UInt8 a3Valid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved7; + CDMSF startTimeOfLeadIn; + UInt8 reserved8; + CDMSF lastPossibleStartTimeOfLeadOut; + UInt8 reserved9; + UInt8 a1[3]; + UInt8 reserved10; + UInt8 a2[3]; + UInt8 reserved11; + UInt8 a3[3]; + UInt8 reserved12; +}; +typedef struct CDATIP CDATIP; + +// Read Table Of Contents Format 0x05 +struct CDTEXTDescriptor +{ + UInt8 packType; + UInt8 trackNumber; + UInt8 sequenceNumber; +#ifdef __LITTLE_ENDIAN__ + UInt8 characterPosition:4; + UInt8 blockNumber:3; + UInt8 doubleByteCharacterCode:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 doubleByteCharacterCode:1; + UInt8 blockNumber:3; + UInt8 characterPosition:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 textData[12]; + UInt8 reserved[2]; +}; +typedef struct CDTEXTDescriptor CDTEXTDescriptor; + +struct CDTEXT +{ + UInt16 dataLength; + UInt8 reserved; + UInt8 reserved2; + CDTEXTDescriptor descriptors[0]; +}; +typedef struct CDTEXT CDTEXT; + +// Read Disc Information Format +struct CDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastSession:2; + UInt8 erasable:1; + UInt8 reserved:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved:3; + UInt8 erasable:1; + UInt8 stateOfLastSession:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 numberOfFirstTrack; + UInt8 numberOfSessionsLSB; + UInt8 firstTrackNumberInLastSessionLSB; + UInt8 lastTrackNumberInLastSessionLSB; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved3:5; + UInt8 unrestrictedUse:1; + UInt8 discBarCodeValid:1; + UInt8 discIdentificationValid:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 discIdentificationValid:1; + UInt8 discBarCodeValid:1; + UInt8 unrestrictedUse:1; + UInt8 reserved3:5; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 discType; + UInt8 numberOfSessionsMSB; + UInt8 firstTrackNumberInLastSessionMSB; + UInt8 lastTrackNumberInLastSessionMSB; + UInt32 discIdentification; + UInt8 reserved7; + CDMSF lastSessionLeadInStartTime; + UInt8 reserved8; + CDMSF lastPossibleStartTimeOfLeadOut; + UInt8 discBarCode[8]; + UInt8 reserved9; + UInt8 numberOfOPCTableEntries; + UInt8 opcTableEntries[0]; +}; +typedef struct CDDiscInfo CDDiscInfo; + +// Read Track Information Address Types +typedef UInt8 CDTrackInfoAddressType; +enum +{ + kCDTrackInfoAddressTypeLBA = 0x00, + kCDTrackInfoAddressTypeTrackNumber = 0x01, + kCDTrackInfoAddressTypeSessionNumber = 0x02, +}; + +// Read Track Information Format +struct CDTrackInfo +{ + UInt16 dataLength; + UInt8 trackNumberLSB; + UInt8 sessionNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 trackMode:4; + UInt8 copy:1; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 dataMode:4; + UInt8 fixedPacket:1; + UInt8 packet:1; + UInt8 blank:1; + UInt8 reservedTrack:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 copy:1; + UInt8 trackMode:4; + + UInt8 reservedTrack:1; + UInt8 blank:1; + UInt8 packet:1; + UInt8 fixedPacket:1; + UInt8 dataMode:4; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 trackStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 fixedPacketSize; + UInt32 trackSize; + UInt32 lastRecordedAddress; + UInt8 trackNumberMSB; + UInt8 sessionNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct CDTrackInfo CDTrackInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _IOCDTYPES_H */ diff --git a/i386/include/IOKit/storage/IODVDBlockStorageDevice.h b/i386/include/IOKit/storage/IODVDBlockStorageDevice.h new file mode 100644 index 0000000..161651c --- /dev/null +++ b/i386/include/IOKit/storage/IODVDBlockStorageDevice.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IODVDBlockStorageDevice + * @abstract + * This header contains the IODVDBlockStorageDevice class definition. + */ + +#ifndef _IODVDBLOCKSTORAGEDEVICE_H +#define _IODVDBLOCKSTORAGEDEVICE_H + +#include <IOKit/storage/IODVDTypes.h> + +/*! + * @defined kIODVDBlockStorageDeviceClass + * @abstract + * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. + * @discussion + * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. + */ + +#define kIODVDBlockStorageDeviceClass "IODVDBlockStorageDevice" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOCDBlockStorageDevice.h> + +/* Property used for matching, so the generic driver gets the nub it wants. */ +#define kIOBlockStorageDeviceTypeDVD "DVD" + +/*! + * @class + * IODVDBlockStorageDevice : public IOCDBlockStorageDevice + * @abstract + * The IODVDBlockStorageDevice class is a generic DVD block storage device + * abstraction. + * @discussion + * This class is the protocol for generic DVD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * The APIs are the union of CD APIs and all + * necessary new low-level DVD APIs. + * + * A subclass implements relay methods that translate our requests into + * calls to a protocol- and device-specific provider. + */ + +class IODVDBlockStorageDevice : public IOCDBlockStorageDevice { + + OSDeclareAbstractStructors(IODVDBlockStorageDevice) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* Overrides from IORegistryEntry */ + + virtual bool init(OSDictionary * properties); + + /* New APIs for DVD */ + + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat) = 0; + + virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt8 agid,const DVDKeyFormat keyFormat) = 0; + +#ifdef __LP64__ + virtual IOReturn readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid) = 0; +#else /* !__LP64__ */ + virtual IOReturn readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); /* 10.1.0 */ +#endif /* !__LP64__ */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 0); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IODVDBlockStorageDevice, 0); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 1); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 2); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 3); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 4); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 5); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 6); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 7); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 8); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 9); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 10); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 11); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 12); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 13); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 14); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 15); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 16); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 17); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 18); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 19); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 20); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 21); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 22); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 23); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 24); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 25); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 26); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 27); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 28); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 29); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 30); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDBLOCKSTORAGEDEVICE_H */ diff --git a/i386/include/IOKit/storage/IODVDBlockStorageDriver.h b/i386/include/IOKit/storage/IODVDBlockStorageDriver.h new file mode 100644 index 0000000..d9471f6 --- /dev/null +++ b/i386/include/IOKit/storage/IODVDBlockStorageDriver.h @@ -0,0 +1,219 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * IODVDBlockStorageDriver.h + * + * This class implements DVD functionality, independent of + * the physical connection protocol (e.g. SCSI, ATA, USB). + * + * A protocol-specific provider implements the functionality using an appropriate + * protocol and commands. + */ + +#ifndef _IODVDBLOCKSTORAGEDRIVER_H +#define _IODVDBLOCKSTORAGEDRIVER_H + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOCDBlockStorageDriver.h> +#include <IOKit/storage/IODVDBlockStorageDevice.h> +#include <IOKit/storage/IODVDTypes.h> + +/*! + * @defined kIODVDBlockStorageDriverClass + * @abstract + * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class. + * @discussion + * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class. + */ + +#define kIODVDBlockStorageDriverClass "IODVDBlockStorageDriver" + +class IODVDBlockStorageDevice; + +/*! + * @class + * IODVDBlockStorageDriver : public IOCDBlockStorageDriver + * @abstract + * Generic DVD Driver. + * @discussion + * Storage drivers are split into two parts: the Generic Driver handles + * all generic device issues, independent of the lower-level transport + * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations + * at the Generic Driver level are translated into a series of generic + * device operations. These operations are passed via the Device Nub + * to a Transport Driver, which implements the appropriate + * transport-dependent protocol to execute these operations. + * + * To determine the write-protect state of a device (or media), for + * example, the generic driver would issue a call to the + * Transport Driver's reportWriteProtection method. If this were a SCSI + * device, its Transport Driver would issue a Mode Sense command to + * extract the write-protection status bit. The Transport Driver then + * reports true or false to the generic driver. + * + * The generic driver therefore has no knowledge of, or involvement + * with, the actual commands and mechanisms used to communicate with + * the device. It is expected that the generic driver will rarely, if + * ever, need to be subclassed to handle device idiosyncrasies; rather, + * the Transport Driver should be changed via overrides. + * + * A generic driver could be subclassed to create a different type of + * generic device. The generic driver IODVDBlockStorageDriver class is a subclass + * of IOCDBlockStorageDriver, adding DVD functions. Similarly, the Transport Driver + * IODVDBlockStorageDevice is a subclass of IOCDBlockStorageDevice, adding DVD + * functions. +*/ + +class IODVDBlockStorageDriver : public IOCDBlockStorageDriver { + + OSDeclareDefaultStructors(IODVDBlockStorageDriver) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /* Overrides of IOCDBlockStorageDriver. */ + + virtual IOReturn acceptNewMedia(void); + + /* End of IOCDBlockStorageDriver overrides. */ + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IODVDBlockStorageDevice. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IODVDBlockStorageDevice * getProvider() const; + + /* Overrides of IOCDBlockStorageDriver: */ + + virtual const char * getDeviceTypeName(void); + virtual IOMedia * instantiateDesiredMediaObject(void); + virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize, + UInt32 blockSize,char *mediaName); + + /* End of IOCDBlockStorageDriver overrides. */ + + /*! + * @function reportKey + * @abstract + * Get key info from the DVD drive. + * @discussion + * This function handles the getting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param lba + * As documented by MtFuji. + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat); + + /*! + * @function sendKey + * @abstract + * Send key info to the DVD drive. + * @discussion + * This function handles the setting of key- and encryption-related data for the drive. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param keyClass + * As documented by MtFuji. See DVDKeyClass. + * @param agid + * As documented by MtFuji. + * @param keyFormat + * As documented by MtFuji. See DVDKeyFormat. + */ + virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass, + const UInt8 agid,const DVDKeyFormat keyFormat); + + /*! + * @function readStructure + * @abstract + * Get control structures from the DVD media. + * @discussion + * This function handles the getting of control structure data for the media. + * @param buffer + * A buffer containing information, as documented in the specification + * "MtFuji Commands For Multimedia Devices." + * @param format + * As documented by MtFuji. See DVDStructureFormat. + * @param address + * As documented by MtFuji. + * @param layer + * As documented by MtFuji. + * @param agid + * As documented by MtFuji. + */ + virtual IOReturn readStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format, + const UInt32 address,const UInt8 layer,const UInt8 agid); /* 10.1.0 */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 0); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IODVDBlockStorageDriver, 0); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 1); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 2); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 3); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 4); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 5); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 6); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 7); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 8); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 9); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 10); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 11); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 12); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 13); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 14); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 15); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 16); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 17); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 18); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 19); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 20); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 21); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 22); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 23); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 24); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 25); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 26); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 27); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 28); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 29); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 30); + OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 31); +}; +#endif diff --git a/i386/include/IOKit/storage/IODVDMedia.h b/i386/include/IOKit/storage/IODVDMedia.h new file mode 100644 index 0000000..02119c3 --- /dev/null +++ b/i386/include/IOKit/storage/IODVDMedia.h @@ -0,0 +1,357 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IODVDMedia + * @abstract + * This header contains the IODVDMedia class definition. + */ + +#ifndef _IODVDMEDIA_H +#define _IODVDMEDIA_H + +/*! + * @defined kIODVDMediaClass + * @abstract + * kIODVDMediaClass is the name of the IODVDMedia class. + * @discussion + * kIODVDMediaClass is the name of the IODVDMedia class. + */ + +#define kIODVDMediaClass "IODVDMedia" + +/*! + * @defined kIODVDMediaTypeKey + * @abstract + * kIODVDMediaTypeKey is a property of IODVDMedia objects. It has an OSString + * value. + * @discussion + * The kIODVDMediaTypeKey property identifies the DVD media type (DVD-ROM, + * DVD-R, DVD-RW, DVD+RW, DVD-RAM, etc). See the kIODVDMediaType contants + * for possible values. + */ + +#define kIODVDMediaTypeKey "Type" + +/*! + * @defined kIODVDMediaTypeROM + * The kIODVDMediaTypeKey constant for DVD-ROM media. + */ + +#define kIODVDMediaTypeROM "DVD-ROM" + +/*! + * @defined kIODVDMediaTypeR + * The kIODVDMediaTypeKey constant for DVD Recordable (DVD-R) media. + */ + +#define kIODVDMediaTypeR "DVD-R" + +/*! + * @defined kIODVDMediaTypeRW + * The kIODVDMediaTypeKey constant for DVD ReWritable (DVD-RW) media. + */ + +#define kIODVDMediaTypeRW "DVD-RW" + +/*! + * @defined kIODVDMediaTypePlusR + * The kIODVDMediaTypeKey constant for DVD "Plus" Recordable (DVD+R) media. + */ + +#define kIODVDMediaTypePlusR "DVD+R" + +/*! + * @defined kIODVDMediaTypePlusRW + * The kIODVDMediaTypeKey constant for DVD "Plus" ReWritable (DVD+RW) media. + */ + +#define kIODVDMediaTypePlusRW "DVD+RW" + +/*! + * @defined kIODVDMediaTypeRAM + * The kIODVDMediaTypeKey constant for DVD-RAM media. + */ + +#define kIODVDMediaTypeRAM "DVD-RAM" + +/*! + * @defined kIODVDMediaTypeHDROM + * The kIODVDMediaTypeKey constant for HD DVD-ROM media. + */ + +#define kIODVDMediaTypeHDROM "HD DVD-ROM" + +/*! + * @defined kIODVDMediaTypeHDR + * The kIODVDMediaTypeKey constant for HD DVD Recordable (HD DVD-R) media. + */ + +#define kIODVDMediaTypeHDR "HD DVD-R" + +/*! + * @defined kIODVDMediaTypeHDRW + * The kIODVDMediaTypeKey constant for HD DVD ReWritable (HD DVD-RW) media. + */ + +#define kIODVDMediaTypeHDRW "HD DVD-RW" + +/*! + * @defined kIODVDMediaTypeHDRAM + * The kIODVDMediaTypeKey constant for HD DVD-RAM media. + */ + +#define kIODVDMediaTypeHDRAM "HD DVD-RAM" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDBlockStorageDriver.h> +#include <IOKit/storage/IOMedia.h> + +/*! + * @class IODVDMedia + * @abstract + * The IODVDMedia class is a random-access disk device abstraction for DVDs. + * @discussion + * The IODVDMedia class is a random-access disk device abstraction for DVDs. + */ + +class IODVDMedia : public IOMedia +{ + OSDeclareDefaultStructors(IODVDMedia) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method to + * return a more specific subclass of IOService -- IODVDBlockStorageDriver. + * This method serves simply as a convenience to subclass developers. + */ + + virtual IODVDBlockStorageDriver * getProvider() const; + + /* + * Compare the properties in the supplied table to this object's properties. + */ + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 * score); + + /*! + * @function reportKey + * @discussion + * Issue an MMC REPORT KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. Pass null for the kDVDKeyFormatAGID_Invalidate format + * case. + * @param keyClass + * As documented by MMC. + * @param address + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn reportKey( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt32 address, + const UInt8 grantID, + const DVDKeyFormat format ); /* 10.1.0 */ + + /*! + * @function sendKey + * @discussion + * Issue an MMC SEND KEY command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. Pass null for the kDVDKeyFormatAGID_Invalidate format + * case. + * @param keyClass + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @param format + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn sendKey( IOMemoryDescriptor * buffer, + const DVDKeyClass keyClass, + const UInt8 grantID, + const DVDKeyFormat format ); /* 10.1.0 */ + + /*! + * @function readStructure + * @discussion + * Issue an MMC READ DVD STRUCTURE command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param format + * As documented by MMC. + * @param address + * As documented by MMC. + * @param layer + * As documented by MMC. + * @param grantID + * As documented by MMC. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readStructure( IOMemoryDescriptor * buffer, + const DVDStructureFormat format, + const UInt32 address, + const UInt8 layer, + const UInt8 grantID ); /* 10.1.0 */ + + /*! + * @function getSpeed + * @discussion + * Get the current speed used for data transfers. + * @param kilobytesPerSecond + * Returns the current speed used for data transfers, in kB/s. + * + * kDVDSpeedMin specifies the minimum speed for all DVD media (1X). + * kDVDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn getSpeed(UInt16 * kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function setSpeed + * @discussion + * Set the speed to be used for data transfers. + * @param kilobytesPerSecond + * Speed to be used for data transfers, in kB/s. + * + * kDVDSpeedMin specifies the minimum speed for all DVD media (1X). + * kDVDSpeedMax specifies the maximum speed supported in hardware. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn setSpeed(UInt16 kilobytesPerSecond); /* 10.1.0 */ + + /*! + * @function readDiscInfo + * @discussion + * Issue an MMC READ DISC INFORMATION command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readDiscInfo( IOMemoryDescriptor * buffer, + UInt16 * actualByteCount ); /* 10.2.0 */ + + /*! + * @function readRZoneInfo + * @discussion + * Issue an MMC READ RZONE INFORMATION (READ TRACK INFORMATION) command. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param address + * As documented by MMC. + * @param addressType + * As documented by MMC. + * @param actualByteCount + * Returns the actual number of bytes transferred in the data transfer. + * @result + * Returns the status of the data transfer. + */ + + virtual IOReturn readRZoneInfo( IOMemoryDescriptor * buffer, + UInt32 address, + DVDRZoneInfoAddressType addressType, + UInt16 * actualByteCount ); /* 10.2.0 */ + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IODVDMedia, 0); + OSMetaClassDeclareReservedUnused(IODVDMedia, 1); + OSMetaClassDeclareReservedUnused(IODVDMedia, 2); + OSMetaClassDeclareReservedUnused(IODVDMedia, 3); + OSMetaClassDeclareReservedUnused(IODVDMedia, 4); + OSMetaClassDeclareReservedUnused(IODVDMedia, 5); + OSMetaClassDeclareReservedUnused(IODVDMedia, 6); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IODVDMedia, 0); + OSMetaClassDeclareReservedUsed(IODVDMedia, 1); + OSMetaClassDeclareReservedUsed(IODVDMedia, 2); + OSMetaClassDeclareReservedUsed(IODVDMedia, 3); + OSMetaClassDeclareReservedUsed(IODVDMedia, 4); + OSMetaClassDeclareReservedUsed(IODVDMedia, 5); + OSMetaClassDeclareReservedUsed(IODVDMedia, 6); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IODVDMedia, 7); + OSMetaClassDeclareReservedUnused(IODVDMedia, 8); + OSMetaClassDeclareReservedUnused(IODVDMedia, 9); + OSMetaClassDeclareReservedUnused(IODVDMedia, 10); + OSMetaClassDeclareReservedUnused(IODVDMedia, 11); + OSMetaClassDeclareReservedUnused(IODVDMedia, 12); + OSMetaClassDeclareReservedUnused(IODVDMedia, 13); + OSMetaClassDeclareReservedUnused(IODVDMedia, 14); + OSMetaClassDeclareReservedUnused(IODVDMedia, 15); + OSMetaClassDeclareReservedUnused(IODVDMedia, 16); + OSMetaClassDeclareReservedUnused(IODVDMedia, 17); + OSMetaClassDeclareReservedUnused(IODVDMedia, 18); + OSMetaClassDeclareReservedUnused(IODVDMedia, 19); + OSMetaClassDeclareReservedUnused(IODVDMedia, 20); + OSMetaClassDeclareReservedUnused(IODVDMedia, 21); + OSMetaClassDeclareReservedUnused(IODVDMedia, 22); + OSMetaClassDeclareReservedUnused(IODVDMedia, 23); + OSMetaClassDeclareReservedUnused(IODVDMedia, 24); + OSMetaClassDeclareReservedUnused(IODVDMedia, 25); + OSMetaClassDeclareReservedUnused(IODVDMedia, 26); + OSMetaClassDeclareReservedUnused(IODVDMedia, 27); + OSMetaClassDeclareReservedUnused(IODVDMedia, 28); + OSMetaClassDeclareReservedUnused(IODVDMedia, 29); + OSMetaClassDeclareReservedUnused(IODVDMedia, 30); + OSMetaClassDeclareReservedUnused(IODVDMedia, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDMEDIA_H */ diff --git a/i386/include/IOKit/storage/IODVDMediaBSDClient.h b/i386/include/IOKit/storage/IODVDMediaBSDClient.h new file mode 100644 index 0000000..2258bf6 --- /dev/null +++ b/i386/include/IOKit/storage/IODVDMediaBSDClient.h @@ -0,0 +1,197 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IODVDMEDIABSDCLIENT_H +#define _IODVDMEDIABSDCLIENT_H + +#include <sys/ioctl.h> + +#include <IOKit/storage/IODVDTypes.h> + +/* + * Definitions + * + * ioctl description + * ---------------------------- ------------------------------------------------ + * DKIOCDVDREADSTRUCTURE see IODVDMedia::readStructure() in IODVDMedia.h + * + * DKIOCDVDREADDISCINFO see IODVDMedia::readDiscInfo() in IODVDMedia.h + * DKIOCDVDREADRZONEINFO see IODVDMedia::readRZoneInfo() in IODVDMedia.h + * + * DKIOCDVDREPORTKEY see IODVDMedia::reportKey() in IODVDMedia.h + * DKIOCDVDSENDKEY see IODVDMedia::sendKey() in IODVDMedia.h + * + * DKIOCDVDGETSPEED see IODVDMedia::getSpeed() in IODVDMedia.h + * DKIOCDVDSETSPEED see IODVDMedia::setSpeed() in IODVDMedia.h + * + * in /System/Library/Frameworks/Kernel.framework/Headers/IOKit/storage/ + */ + +typedef struct +{ + uint8_t format; + + uint8_t reserved0008[3]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + uint8_t layer; + +#ifdef __LP64__ + uint8_t reserved0080[4]; /* reserved, clear to zero */ +#endif /* __LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_read_structure_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[2]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t grantID; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_report_key_t; + +typedef struct +{ + uint8_t format; + uint8_t keyClass; + + uint8_t reserved0016[6]; /* reserved, clear to zero */ + + uint8_t grantID; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; + void * buffer; +} dk_dvd_send_key_t; + +typedef struct +{ +#ifdef __LP64__ + uint8_t reserved0000[14]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0000[10]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_dvd_read_disc_info_t; + +typedef struct +{ + uint8_t reserved0000[4]; /* reserved, clear to zero */ + + uint32_t address; + uint8_t addressType; + +#ifdef __LP64__ + uint8_t reserved0072[5]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0072[1]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ + + uint16_t bufferLength; /* actual length on return */ + void * buffer; +} dk_dvd_read_rzone_info_t; + +#define DKIOCDVDREADSTRUCTURE _IOW('d', 128, dk_dvd_read_structure_t) +#define DKIOCDVDREPORTKEY _IOW('d', 129, dk_dvd_report_key_t) +#define DKIOCDVDSENDKEY _IOW('d', 130, dk_dvd_send_key_t) + +#define DKIOCDVDGETSPEED _IOR('d', 131, uint16_t) +#define DKIOCDVDSETSPEED _IOW('d', 131, uint16_t) + +#define DKIOCDVDREADDISCINFO _IOWR('d', 132, dk_dvd_read_disc_info_t) +#define DKIOCDVDREADRZONEINFO _IOWR('d', 133, dk_dvd_read_rzone_info_t) + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IODVDMedia.h> +#include <IOKit/storage/IOMediaBSDClient.h> + +/* + * Class + */ + +class IODVDMediaBSDClient : public IOMediaBSDClient +{ + OSDeclareDefaultStructors(IODVDMediaBSDClient) + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + +public: + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of IOService -- IODVDMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IODVDMedia * getProvider() const; + + /* + * Process a DVD-specific ioctl. + */ + + virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc); + + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 0); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 1); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 2); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 3); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 4); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 5); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 6); + OSMetaClassDeclareReservedUnused(IODVDMediaBSDClient, 7); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IODVDMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/IODVDTypes.h b/i386/include/IOKit/storage/IODVDTypes.h new file mode 100644 index 0000000..039b8fb --- /dev/null +++ b/i386/include/IOKit/storage/IODVDTypes.h @@ -0,0 +1,451 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IODVDTYPES_H +#define _IODVDTYPES_H + +#include <IOKit/IOTypes.h> + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* + * Media Types + */ + +enum +{ + kDVDMediaTypeUnknown = 0x0200, + kDVDMediaTypeROM = 0x0202, /* DVD-ROM */ + kDVDMediaTypeRAM = 0x0203, /* DVD-RAM */ + kDVDMediaTypeR = 0x0204, /* DVD-R */ + kDVDMediaTypeRW = 0x0205, /* DVD-RW */ + kDVDMediaTypePlusRW = 0x0206, /* DVD+RW */ + kDVDMediaTypePlusR = 0x0207, /* DVD+R */ + kDVDMediaTypeHDROM = 0x0212, /* HD DVD-ROM */ + kDVDMediaTypeHDRAM = 0x0213, /* HD DVD-RAM */ + kDVDMediaTypeHDR = 0x0214, /* HD DVD-R */ + kDVDMediaTypeHDRW = 0x0215, /* HD DVD-RW */ + + kDVDMediaTypeMin = 0x0200, + kDVDMediaTypeMax = 0x02FF +}; + +typedef UInt32 DVDMediaType; + +/* + * Media Speed (kB/s) + */ + +#define kDVDSpeedMin 0x0546 +#define kDVDSpeedMax 0xFFFF + +/* + * MMC Formats + */ + +typedef UInt8 DVDCPRMRegionCode; +enum +{ + kDVDCPRMRegion1 = 0xFE, + kDVDCPRMRegion2 = 0xFD, + kDVDCPRMRegion3 = 0xFB, + kDVDCPRMRegion4 = 0xF7, + kDVDCPRMRegion5 = 0xEF, + kDVDCPRMRegion6 = 0xDF +}; + +typedef UInt8 DVDRegionalPlaybackControlScheme; +enum +{ + kDVDRegionalPlaybackControlSchemePhase1 = 0x00, + kDVDRegionalPlaybackControlSchemePhase2 = 0x01 +}; + +typedef UInt8 DVDBookType; +enum +{ + kDVDBookTypeROM = 0x0, + kDVDBookTypeRAM = 0x1, + kDVDBookTypeR = 0x2, + kDVDBookTypeRW = 0x3, + kDVDBookTypeHDROM = 0x4, + kDVDBookTypeHDRAM = 0x5, + kDVDBookTypeHDR = 0x6, + kDVDBookTypeHDRW = 0x7, + kDVDBookTypePlusRW = 0x9, + kDVDBookTypePlusR = 0xA, + kDVDBookTypePlusRWDoubleLayer = 0xD, + kDVDBookTypePlusRDoubleLayer = 0xE +}; + +#ifdef __LP64__ +typedef UInt8 DVDKeyClass; +enum +#else /* !__LP64__ */ +enum DVDKeyClass +#endif /* !__LP64__ */ +{ + kDVDKeyClassCSS_CPPM_CPRM = 0x00, + kDVDKeyClassRSSA = 0x01 +}; +#ifndef __LP64__ +typedef enum DVDKeyClass DVDKeyClass; +#endif /* !__LP64__ */ + +#ifdef __LP64__ +typedef UInt8 DVDKeyFormat; +enum +#else /* !__LP64__ */ +enum DVDKeyFormat +#endif /* !__LP64__ */ +{ + kDVDKeyFormatAGID_CSS = 0x00, + kDVDKeyFormatChallengeKey = 0x01, + kDVDKeyFormatKey1 = 0x02, + kDVDKeyFormatKey2 = 0x03, + kDVDKeyFormatTitleKey = 0x04, + kDVDKeyFormatASF = 0x05, + kDVDKeyFormatSetRegion = 0x06, + kDVDKeyFormatRegionState = 0x08, + kDVDKeyFormatAGID_CSS2 = 0x10, + kDVDKeyFormatAGID_CPRM = 0x11, + kDVDKeyFormatAGID_Invalidate = 0x3F +}; +#ifndef __LP64__ +typedef enum DVDKeyFormat DVDKeyFormat; +#endif /* !__LP64__ */ + +typedef UInt8 DVDStructureFormat; +enum +{ + kDVDStructureFormatPhysicalFormatInfo = 0x00, + kDVDStructureFormatCopyrightInfo = 0x01, + kDVDStructureFormatDiscKeyInfo = 0x02, + // skip BCA + kDVDStructureFormatManufacturingInfo = 0x04 +}; + +// Read DVD Structures Format 0x00 +struct DVDPhysicalFormatInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + // Byte 0 + UInt8 partVersion:4; + UInt8 bookType:4; + + // Byte 1 + UInt8 minimumRate:4; + UInt8 discSize:4; + + // Byte 2 + UInt8 layerType:4; + UInt8 trackPath:1; + UInt8 numberOfLayers:2; + UInt8 reserved2:1; + + // Byte 3 + UInt8 trackDensity:4; + UInt8 linearDensity:4; +#else /* !__LITTLE_ENDIAN__ */ + // Byte 0 + UInt8 bookType:4; + UInt8 partVersion:4; + + // Byte 1 + UInt8 discSize:4; + UInt8 minimumRate:4; + + // Byte 2 + UInt8 reserved2:1; + UInt8 numberOfLayers:2; + UInt8 trackPath:1; + UInt8 layerType:4; + + // Byte 3 + UInt8 linearDensity:4; + UInt8 trackDensity:4; +#endif /* !__LITTLE_ENDIAN__ */ + + // Bytes 4-15 + UInt8 zero1; // always 0x00 + UInt8 startingPhysicalSectorNumberOfDataArea[3]; + UInt8 zero2; // always 0x00 + UInt8 endPhysicalSectorNumberOfDataArea[3]; + UInt8 zero3; // always 0x00 + UInt8 endSectorNumberInLayerZero[3]; + + // Byte 16 +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved1:7; + UInt8 bcaFlag:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 bcaFlag:1; + UInt8 reserved1:7; +#endif /* !__LITTLE_ENDIAN__ */ + + // Bytes 17-2047 + UInt8 mediaSpecific[2031]; +}; +typedef struct DVDPhysicalFormatInfo DVDPhysicalFormatInfo; + +// Read DVD Structures Format 0x01 +struct DVDCopyrightInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 copyrightProtectionSystemType; + DVDCPRMRegionCode regionMask; + UInt8 reserved2[2]; +}; +typedef struct DVDCopyrightInfo DVDCopyrightInfo; + +// Read DVD Structures Format 0x02 +struct DVDDiscKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 discKeyStructures[2048]; +}; +typedef struct DVDDiscKeyInfo DVDDiscKeyInfo; + +// Read DVD Structures Format 0x04 +struct DVDManufacturingInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 discManufacturingInfo[2048]; +}; +typedef struct DVDManufacturingInfo DVDManufacturingInfo; + +// ReportKey Format 0x00 +struct DVDAuthenticationGrantIDInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 reserved2[3]; +#ifdef __LITTLE_ENDIAN__ + UInt8 reservedBits:6; + UInt8 grantID:2; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 grantID:2; + UInt8 reservedBits:6; +#endif /* !__LITTLE_ENDIAN__ */ +}; +typedef struct DVDAuthenticationGrantIDInfo DVDAuthenticationGrantIDInfo; + +// ReportKey and SendKey Format 0x01 +struct DVDChallengeKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 challengeKeyValue[10]; + UInt8 reserved2[2]; +}; +typedef struct DVDChallengeKeyInfo DVDChallengeKeyInfo; + +// ReportKey Format 0x02 +struct DVDKey1Info +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 key1Value[5]; + UInt8 reserved2[3]; +}; +typedef struct DVDKey1Info DVDKey1Info; + +// SendKey Format 0x03 +struct DVDKey2Info +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 key2Value[5]; + UInt8 reserved2[3]; +}; +typedef struct DVDKey2Info DVDKey2Info; + +// ReportKey Format 0x04 +struct DVDTitleKeyInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 CP_MOD:4; + UInt8 CGMS:2; + UInt8 CP_SEC:1; + UInt8 CPM:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 CPM:1; + UInt8 CP_SEC:1; + UInt8 CGMS:2; + UInt8 CP_MOD:4; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 titleKeyValue[5]; + UInt8 reserved2[2]; +}; +typedef struct DVDTitleKeyInfo DVDTitleKeyInfo; + +// ReportKey Format 0x05 +struct DVDAuthenticationSuccessFlagInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; + UInt8 reserved2[3]; +#ifdef __LITTLE_ENDIAN__ + UInt8 successFlag:1; + UInt8 reservedBits:7; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reservedBits:7; + UInt8 successFlag:1; +#endif /* !__LITTLE_ENDIAN__ */ +}; +typedef struct DVDAuthenticationSuccessFlagInfo DVDAuthenticationSuccessFlagInfo; + +// ReportKey Format 0x08 +struct DVDRegionPlaybackControlInfo +{ + UInt8 dataLength[2]; + UInt8 reserved[2]; +#ifdef __LITTLE_ENDIAN__ + UInt8 numberUserResets:3; + UInt8 numberVendorResets:3; + UInt8 typeCode:2; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 typeCode:2; + UInt8 numberVendorResets:3; + UInt8 numberUserResets:3; +#endif /* !__LITTLE_ENDIAN__ */ + DVDCPRMRegionCode driveRegion; + DVDRegionalPlaybackControlScheme rpcScheme; + UInt8 reserved2; +}; +typedef struct DVDRegionPlaybackControlInfo DVDRegionPlaybackControlInfo; + +// Read Disc Information Format +struct DVDDiscInfo +{ + UInt16 dataLength; +#ifdef __LITTLE_ENDIAN__ + UInt8 discStatus:2; + UInt8 stateOfLastBorder:2; + UInt8 erasable:1; + UInt8 reserved:3; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved:3; + UInt8 erasable:1; + UInt8 stateOfLastBorder:2; + UInt8 discStatus:2; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved2; + UInt8 numberOfBordersLSB; + UInt8 firstRZoneNumberInLastBorderLSB; + UInt8 lastRZoneNumberInLastBorderLSB; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved3:5; + UInt8 unrestrictedUse:1; + UInt8 discBarCodeValid:1; + UInt8 reserved4:1; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved4:1; + UInt8 discBarCodeValid:1; + UInt8 unrestrictedUse:1; + UInt8 reserved3:5; +#endif /* !__LITTLE_ENDIAN__ */ + UInt8 reserved5; + UInt8 numberOfBordersMSB; + UInt8 firstRZoneNumberInLastBorderMSB; + UInt8 lastRZoneNumberInLastBorderMSB; + UInt8 reserved6[4]; + UInt8 reserved7[4]; + UInt8 reserved8[4]; + UInt8 discBarCode[8]; + UInt8 reserved9; + UInt8 numberOfOPCTableEntries; + UInt8 opcTableEntries[0]; +}; +typedef struct DVDDiscInfo DVDDiscInfo; + +// Read RZone Information Address Types +typedef UInt8 DVDRZoneInfoAddressType; +enum +{ + kDVDRZoneInfoAddressTypeLBA = 0x00, + kDVDRZoneInfoAddressTypeRZoneNumber = 0x01, + kDVDRZoneInfoAddressTypeBorderNumber = 0x02, +}; + +// Read RZone Information Format +struct DVDRZoneInfo +{ + UInt16 dataLength; + UInt8 rzoneNumberLSB; + UInt8 borderNumberLSB; + UInt8 reserved; +#ifdef __LITTLE_ENDIAN__ + UInt8 reserved2:4; + UInt8 copy:1; + UInt8 damage:1; + UInt8 reserved3:2; + + UInt8 reserved4:4; + UInt8 restrictedOverwrite:1; + UInt8 incremental:1; + UInt8 blank:1; + UInt8 reservedRZone:1; + + UInt8 nextWritableAddressValid:1; + UInt8 lastRecordedAddressValid:1; + UInt8 reserved5:6; +#else /* !__LITTLE_ENDIAN__ */ + UInt8 reserved3:2; + UInt8 damage:1; + UInt8 copy:1; + UInt8 reserved2:4; + + UInt8 reservedRZone:1; + UInt8 blank:1; + UInt8 incremental:1; + UInt8 restrictedOverwrite:1; + UInt8 reserved4:4; + + UInt8 reserved5:6; + UInt8 lastRecordedAddressValid:1; + UInt8 nextWritableAddressValid:1; +#endif /* !__LITTLE_ENDIAN__ */ + UInt32 rzoneStartAddress; + UInt32 nextWritableAddress; + UInt32 freeBlocks; + UInt32 blockingFactor; + UInt32 rzoneSize; + UInt32 lastRecordedAddress; + UInt8 rzoneNumberMSB; + UInt8 borderNumberMSB; + UInt8 reserved6; + UInt8 reserved7; +}; +typedef struct DVDRZoneInfo DVDRZoneInfo; + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* _IODVDTYPES_H */ diff --git a/i386/include/IOKit/storage/IOFDiskPartitionScheme.h b/i386/include/IOKit/storage/IOFDiskPartitionScheme.h new file mode 100644 index 0000000..7f96255 --- /dev/null +++ b/i386/include/IOKit/storage/IOFDiskPartitionScheme.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOFDiskPartitionScheme class definition. + */ + +#ifndef _IOFDISKPARTITIONSCHEME_H +#define _IOFDISKPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +/* + * kIOFDiskPartitionSchemeClass is the name of the IOFDiskPartitionScheme class. + */ + +#define kIOFDiskPartitionSchemeClass "IOFDiskPartitionScheme" + +/* + * FDisk Partition Map Definitions + */ + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Structure constants. */ + +#define DISK_BLK0SZ sizeof(struct disk_blk0) /* (size of partition map) */ +#define DISK_BOOTSZ 446 /* (size of boot code in map) */ +#define DISK_NPART 4 /* (number of entries in map) */ + +/* Partition map entry. */ + +struct fdisk_part +{ + UInt8 bootid; /* (is active boot partition?) */ + UInt8 beghead; /* (beginning head) */ + UInt8 begsect; /* (beginning sector; beginning cylinder, high 2 bits) */ + UInt8 begcyl; /* (beginning cylinder, low 8 bits) */ + UInt8 systid; /* (type) */ + UInt8 endhead; /* (ending head) */ + UInt8 endsect; /* (ending sector; ending cylinder, high 2 bits) */ + UInt8 endcyl; /* (ending cylinder, low 8 bits) */ + UInt32 relsect; /* (block start) */ + UInt32 numsect; /* (block count) */ +}; + +/* Partition map, as found in block zero of the disk (or extended partition). */ + +struct disk_blk0 +{ + UInt8 bootcode[DISK_BOOTSZ]; /* (boot code) */ + struct fdisk_part parts[DISK_NPART]; /* (partition entries) */ + UInt16 signature; /* (unique signature for map) */ +}; + +/* Partition map signature (signature). */ + +#define DISK_SIGNATURE 0xAA55 + +/* Partition map entry types (systid). */ + +#define FDISK_PARTITION_TYPE_01 "DOS_FAT_12" +#define FDISK_PARTITION_TYPE_04 "DOS_FAT_16_S" +#define FDISK_PARTITION_TYPE_06 "DOS_FAT_16" +#define FDISK_PARTITION_TYPE_07 "Windows_NTFS" +#define FDISK_PARTITION_TYPE_0B "DOS_FAT_32" +#define FDISK_PARTITION_TYPE_0C "Windows_FAT_32" +#define FDISK_PARTITION_TYPE_0E "Windows_FAT_16" +#define FDISK_PARTITION_TYPE_42 "Windows_LDM" +#define FDISK_PARTITION_TYPE_82 "Linux_Swap" +#define FDISK_PARTITION_TYPE_83 "Linux" +#define FDISK_PARTITION_TYPE_8E "Linux_LVM" +#define FDISK_PARTITION_TYPE_A5 "FreeBSD" +#define FDISK_PARTITION_TYPE_A6 "OpenBSD" +#define FDISK_PARTITION_TYPE_A7 "Apple_Rhapsody_UFS" +#define FDISK_PARTITION_TYPE_A8 "Apple_UFS" +#define FDISK_PARTITION_TYPE_A9 "NetBSD" +#define FDISK_PARTITION_TYPE_AB "Apple_Boot" +#define FDISK_PARTITION_TYPE_AE "Apple_Encrypted" +#define FDISK_PARTITION_TYPE_AF "Apple_HFS" +#define FDISK_PARTITION_TYPE_FD "Linux_RAID" + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* !_IOFDISKPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOFilterScheme.h b/i386/include/IOKit/storage/IOFilterScheme.h new file mode 100644 index 0000000..406b596 --- /dev/null +++ b/i386/include/IOKit/storage/IOFilterScheme.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOFilterScheme + * @abstract + * This header contains the IOFilterScheme class definition. + */ + +#ifndef _IOFILTERSCHEME_H +#define _IOFILTERSCHEME_H + +/*! + * @defined kIOFilterSchemeClass + * @abstract + * The name of the IOFilterScheme class. + * @discussion + * kIOFilterSchemeClass is the name of the IOFilterScheme class. + */ + +#define kIOFilterSchemeClass "IOFilterScheme" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOFilterScheme + * @abstract + * The common base class for all filter scheme + * objects. + * @discussion + * The IOFilterScheme class is the common base class for all filter scheme + * objects. It extends the IOStorage class by implementing the appropriate + * open and close semantics for filter objects (standard semantics are act + * as a relay for incoming opens, producing one outgoing open for each + * incoming open). It also implements the default read and write semantics, + * which pass all reads and writes through to the provider media unprocessed. + * For simple schemes, the default behavior is sufficient. More complex + * filter schemes such as RAID will want to do extra processing for reads + * and writes. + */ + +class IOFilterScheme : public IOStorage +{ + OSDeclareDefaultStructors(IOFilterScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access); + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options); + +public: + + using IOStorage::read; + using IOStorage::write; + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For simple filter schemes, the default behavior is to simply pass the + * read through to the provider media. More complex filter schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For simple filter schemes, the default behavior is to simply pass the + * write through to the provider media. More complex filter schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function synchronizeCache + * @discussion + * Flush the cached data in the storage object, if any, synchronously. + * @param client + * Client requesting the cache synchronization. + * @result + * Returns the status of the cache synchronization. + */ + + virtual IOReturn synchronizeCache(IOService * client); + + /*! + * @function discard + * @discussion + * Delete unused data from the storage object at the specified byte offset, + * synchronously. + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. + * @param byteCount + * Size of the operation. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn discard(IOService * client, + UInt64 byteStart, + UInt64 byteCount); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- an IOMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const; + + OSMetaClassDeclareReservedUnused(IOFilterScheme, 0); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 1); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 2); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 3); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 4); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 5); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 6); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 7); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 8); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 9); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 10); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 11); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 12); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 13); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 14); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 15); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 16); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 17); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 18); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 19); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 20); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 21); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 22); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 23); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 24); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 25); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 26); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 27); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 28); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 29); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 30); + OSMetaClassDeclareReservedUnused(IOFilterScheme, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOFILTERSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOFireWireStorageCharacteristics.h b/i386/include/IOKit/storage/IOFireWireStorageCharacteristics.h new file mode 100644 index 0000000..710f29f --- /dev/null +++ b/i386/include/IOKit/storage/IOFireWireStorageCharacteristics.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ +#define _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ + +// +// Bridge Characteristics - Characteristics defined for FireWire bridges. +// + +/*! +@defined kIOPropertyBridgeCharacteristicsKey +@discussion This key is used to define Bridge Characteristics for a particular +devices's bridge chipset. It has an associated dictionary which lists the +bridge characteristics. + +Requirement: Optional + +Example: +<pre> +@textblock +<dict> + <key>Bridge Characteristics</key> + <dict> + <key>Bridge Vendor Name</key> + <string>Oxford Semiconductor</string> + <key>Bridge Model Name</key> + <string>FW911</string> + <key>Bridge Revision Level</key> + <string>3.7</string> + </dict> +</dict> +@/textblock +</pre> +*/ + +#define kIOPropertyBridgeCharacteristicsKey "Bridge Characteristics" +#define kIOPropertyBridgeVendorNameKey "Bridge Vendor Name" +#define kIOPropertyBridgeModelNameKey "Bridge Model Name" +#define kIOPropertyBridgeRevisionLevelKey "Bridge Revision Level" + +#endif /* _IOKIT_IO_FIREWIRE_STORAGE_DEVICE_CHARACTERISTICS_H_ */ \ No newline at end of file diff --git a/i386/include/IOKit/storage/IOGUIDPartitionScheme.h b/i386/include/IOKit/storage/IOGUIDPartitionScheme.h new file mode 100644 index 0000000..3e197d0 --- /dev/null +++ b/i386/include/IOKit/storage/IOGUIDPartitionScheme.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * This header contains the IOGUIDPartitionScheme class definition. + */ + +#ifndef _IOGUIDPARTITIONSCHEME_H +#define _IOGUIDPARTITIONSCHEME_H + +#include <IOKit/IOTypes.h> + +typedef unsigned char uuid_t[16]; +/* + * kIOGUIDPartitionSchemeClass is the name of the IOGUIDPartitionScheme class. + */ + +#define kIOGUIDPartitionSchemeClass "IOGUIDPartitionScheme" + + +#pragma pack(push, 1) /* (enable 8-bit struct packing) */ + +/* Partition map. */ + +struct gpt_hdr +{ + uint8_t hdr_sig[8]; + uint32_t hdr_revision; + uint32_t hdr_size; + uint32_t hdr_crc_self; + uint32_t __reserved; + uint64_t hdr_lba_self; + uint64_t hdr_lba_alt; + uint64_t hdr_lba_start; + uint64_t hdr_lba_end; + uuid_t hdr_uuid; + uint64_t hdr_lba_table; + uint32_t hdr_entries; + uint32_t hdr_entsz; + uint32_t hdr_crc_table; + uint32_t padding; +}; + +/* Partition map entry. */ + +struct gpt_ent +{ + uuid_t ent_type; + uuid_t ent_uuid; + uint64_t ent_lba_start; + uint64_t ent_lba_end; + uint64_t ent_attr; + uint16_t ent_name[36]; +}; + +/* Partition map signature (hdr_sig). */ + +#define GPT_HDR_SIG "EFI PART" + +/* Partition map version (hdr_revision). */ + +#define GPT_HDR_REVISION 0x00010000 + +/* Partition map entry flags (ent_attr). */ + +#define GPT_ENT_ATTR_PLATFORM 0x00000001 + +#pragma pack(pop) /* (reset to default struct packing) */ + +#endif /* !_IOGUIDPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOMedia.h b/i386/include/IOKit/storage/IOMedia.h new file mode 100644 index 0000000..64052ec --- /dev/null +++ b/i386/include/IOKit/storage/IOMedia.h @@ -0,0 +1,231 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOMedia + * @abstract + * This header contains the IOMedia class definition. + */ + +#ifndef _IOMEDIA_H +#define _IOMEDIA_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOMediaClass + * @abstract + * The name of the IOMedia class. + */ + +#define kIOMediaClass "IOMedia" + +/*! + * @defined kIOMediaContentKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaContentKey property has an OSString + * value and contains a description of the media's + * contents. The description is the same as the hint at the time of the + * object's creation, but it is possible that the description has been overridden + * by a client (which has probed the media and identified the content correctly) + * of the media object. It is more accurate than the hint for this reason. The + * string is formed in the likeness of Apple's "Apple_HFS" strings or in the + * likeness of a UUID. + */ + +#define kIOMediaContentKey "Content" + +/*! + * @defined kIOMediaContentHintKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaContentHintKey property has an OSString + * value and contains a hint of the media's contents. + * The hint is set at the time of the object's creation, should the creator have + * a clue as to what it may contain. The hint string does not change for the + * lifetime of the object and is formed in the likeness of Apple's "Apple_HFS" + * strings or in the likeness of a UUID. + */ + +#define kIOMediaContentHintKey "Content Hint" + +/*! + * @defined kIOMediaEjectableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaEjectableKey property has an OSBoolean + * value and describes whether the media is ejectable + * from the drive mechanism under software control. Implies IOMediaRemovable + * is also true. + */ + +#define kIOMediaEjectableKey "Ejectable" + +/*! + * @defined kIOMediaLeafKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaLeafKey property has an OSBoolean value and describes whether the media is a leaf, that is, + * it is the deepest media object in this branch of the I/O Registry. + */ + +#define kIOMediaLeafKey "Leaf" + +/*! + * @defined kIOMediaOpenKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaOpenKey property has an OSBoolean value and describes whether + * a client presently has an open on this media. + */ + +#define kIOMediaOpenKey "Open" + +/*! + * @defined kIOMediaPreferredBlockSizeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaPreferredBlockSizeKey property has an + * OSNumber value and describes the media's natural + * block size in bytes. This information is useful to clients that want to + * optimize access to the media. + */ + +#define kIOMediaPreferredBlockSizeKey "Preferred Block Size" + +/*! + * @defined kIOMediaRemovableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaRemovableKey property has an OSBoolean + * value and describes whether the media is removable + * from the drive mechanism. + */ + +#define kIOMediaRemovableKey "Removable" + +/*! + * @defined kIOMediaSizeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaSizeKey property has an OSNumber value and describes the total length of the media in + * bytes. + */ + +#define kIOMediaSizeKey "Size" + +/*! + * @defined kIOMediaUUIDKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaUUIDKey property has an OSString value and contains a persistent + * Universal Unique Identifier for the media if such an identifier is available. + */ + +#define kIOMediaUUIDKey "UUID" + +/*! + * @defined kIOMediaWholeKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaWholeKey property has an OSBoolean + * value and describes whether the media is whole, that is, + * it represents the whole disk (the physical disk, or a virtual replica + * thereof). + */ + +#define kIOMediaWholeKey "Whole" + +/*! + * @defined kIOMediaWritableKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaWritableKey property has an OSBoolean + * value and describes whether the media is writable. + */ + +#define kIOMediaWritableKey "Writable" + +/*! + * @defined kIOMediaContentMaskKey + * @abstract + * A property of IOMedia clients. + * @discussion + * The kIOMediaContentMaskKey property has an OSString + * value and must exist in all IOMedia clients that + * drive new content (that is, produce new media objects). When the client + * matches against the provider media, the value of the client's + * kIOMediaContentMaskKey property is used to replace the provider's + * kIOMediaContentKey property. + */ + +#define kIOMediaContentMaskKey "Content Mask" + +/*! + * @defined kIOMediaIconKey + * @abstract + * A property of any object in the media stack. + * @discussion + * kIOMediaIconKey is a property of any object in the media stack that wishes + * to override the default icon shown for the media objects in the stack. It + * is usually defined in a provider object below the media object. It has an + * OSDictionary value, with properties identical to the kIOIconKey definition, + * that is, kCFBundleIdentifierKey and kIOBundleResourceFileKey. + */ + +#define kIOMediaIconKey "IOMediaIcon" + +/*! + * @enum IOMediaAttributeMask + * @discussion + * The IOMediaAttributeMask bit mask describes various attributes of + * the media object, such as its ejectability and its removability. + * @constant kIOMediaAttributeEjectableMask + * Indicates whether the media is ejectable from the drive mechanism + * under software control. Implies kIOMediaAttributeRemovableMask. + * @constant kIOMediaAttributeRemovableMask + * Indicates whether the media is removable from the drive mechanism. + */ + +enum +{ + kIOMediaAttributeEjectableMask = 0x00000001, + kIOMediaAttributeRemovableMask = 0x00000002, + kIOMediaAttributeReservedMask = 0xFFFFFFFC +}; + +typedef UInt32 IOMediaAttributeMask; + +#endif /* !_IOMEDIA_H */ diff --git a/i386/include/IOKit/storage/IOMediaBSDClient.h b/i386/include/IOKit/storage/IOMediaBSDClient.h new file mode 100644 index 0000000..56a3117 --- /dev/null +++ b/i386/include/IOKit/storage/IOMediaBSDClient.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOMEDIABSDCLIENT_H +#define _IOMEDIABSDCLIENT_H + +#include <sys/disk.h> + +#endif /* !_IOMEDIABSDCLIENT_H */ diff --git a/i386/include/IOKit/storage/IOPartitionScheme.h b/i386/include/IOKit/storage/IOPartitionScheme.h new file mode 100644 index 0000000..7a1de37 --- /dev/null +++ b/i386/include/IOKit/storage/IOPartitionScheme.h @@ -0,0 +1,373 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOPartitionScheme + * @abstract + * This header contains the IOPartitionScheme class definition. + */ + +#ifndef _IOPARTITIONSCHEME_H +#define _IOPARTITIONSCHEME_H + +/*! + * @defined kIOPartitionSchemeClass + * @abstract + * The name of the IOPartitionScheme class. + * @discussion + * kIOPartitionSchemeClass is the name of the IOPartitionScheme class. + */ + +#define kIOPartitionSchemeClass "IOPartitionScheme" + +/*! + * @defined kIOMediaLiveKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaLiveKey property has an OSBoolean + * value and is placed into an IOMedia instance + * created via the partition scheme. It describes whether the + * partition is live, that is, it is up-to-date with respect + * to the on-disk partition table. + */ + +#define kIOMediaLiveKey "Live" + +/*! + * @defined kIOMediaPartitionIDKey + * @abstract + * A property of IOMedia objects. + * @discussion + * The kIOMediaPartitionIDKey property has an OSNumber + * value and is placed into an IOMedia instance + * created via the partition scheme. It is an ID that differentiates one + * partition from the other (within a given scheme). It is typically an index + * into the on-disk partition table. + */ + +#define kIOMediaPartitionIDKey "Partition ID" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/storage/IOMedia.h> +#include <IOKit/storage/IOStorage.h> + +/*! + * @class IOPartitionScheme + * @abstract + * The common base class for all partition scheme + * objects. + * @discussion + * The IOPartitionScheme class is the common base class for all partition scheme + * objects. It extends the IOStorage class by implementing the appropriate open + * and close semantics for partition objects (standard semantics are to act as a + * multiplexor for incoming opens, producing one outgoing open with the correct + * access). It also implements the default read and write semantics, which pass + * all reads and writes through to the provider media unprocessed. For simple + * schemes, the default behavior is sufficient. More complex partition schemes + * such as RAID will want to do extra processing for reads and writes. + */ + +class IOPartitionScheme : public IOStorage +{ + OSDeclareDefaultStructors(IOPartitionScheme); + +protected: + + struct ExpansionData { /* */ }; + ExpansionData * _expansionData; + + IOStorageAccess _openLevel; + OSSet * _openReaders; + OSSet * _openReaderWriters; + + /* + * Free all of this object's outstanding resources. + */ + + virtual void free(); + + /*! + * @function handleOpen + * @discussion + * The handleOpen method grants or denies permission to access this object + * to an interested client. The argument is an IOStorageAccess value that + * specifies the level of access desired -- reader or reader-writer. + * + * This method can be invoked to upgrade or downgrade the access level for + * an existing client as well. The previous access level will prevail for + * upgrades that fail, of course. A downgrade should never fail. If the + * new access level should be the same as the old for a given client, this + * method will do nothing and return success. In all cases, one, singular + * close-per-client is expected for all opens-per-client received. + * + * This implementation replaces the IOService definition of handleOpen(). + * @param client + * Client requesting the open. + * @param options + * Options for the open. Set to zero. + * @param access + * Access level for the open. Set to kIOStorageAccessReader or + * kIOStorageAccessReaderWriter. + * @result + * Returns true if the open was successful, false otherwise. + */ + + virtual bool handleOpen(IOService * client, + IOOptionBits options, + void * access); + + /*! + * @function handleIsOpen + * @discussion + * The handleIsOpen method determines whether the specified client, or any + * client if none is specified, presently has an open on this object. + * + * This implementation replaces the IOService definition of handleIsOpen(). + * @param client + * Client to check the open state of. Set to zero to check the open state + * of all clients. + * @result + * Returns true if the client was (or clients were) open, false otherwise. + */ + + virtual bool handleIsOpen(const IOService * client) const; + + /*! + * @function handleClose + * @discussion + * The handleClose method closes the client's access to this object. + * + * This implementation replaces the IOService definition of handleClose(). + * @param client + * Client requesting the close. + * @param options + * Options for the close. Set to zero. + */ + + virtual void handleClose(IOService * client, IOOptionBits options); + + /* + * Attach the given media object to the device tree plane. + */ + +#ifdef __LP64__ + virtual bool attachMediaObjectToDeviceTree(IOMedia * media); +#else /* !__LP64__ */ + virtual bool attachMediaObjectToDeviceTree(IOMedia * media, + IOOptionBits options = 0); /* 10.5.0 */ +#endif /* !__LP64__ */ + + /* + * Detach the given media object from the device tree plane. + */ + +#ifdef __LP64__ + virtual void detachMediaObjectFromDeviceTree(IOMedia * media); +#else /* !__LP64__ */ + virtual void detachMediaObjectFromDeviceTree(IOMedia * media, + IOOptionBits options = 0); /* 10.5.0 */ +#endif /* !__LP64__ */ + + /* + * Updates a set of existing partitions, represented by partitionsOld, + * with possible updates from a rescan of the disk, represented by + * partitionsNew. It returns a new set of partitions with the results, + * removing partitions from partitionsOld where applicable, adding + * partitions from partitionsNew where applicable, and folding in property + * changes to partitions from partitionsNew into partitionsOld where + * applicable. + */ + + virtual OSSet * juxtaposeMediaObjects(OSSet * partitionsOld, + OSSet * partitionsNew); /* 10.5.0 */ + +public: + + using IOStorage::read; + using IOStorage::write; + + /* + * Initialize this object's minimal state. + */ + + virtual bool init(OSDictionary * properties = 0); + + /*! + * @function read + * @discussion + * Read data from the storage object at the specified byte offset into the + * specified buffer, asynchronously. When the read completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the read. + * + * For simple partition schemes, the default behavior is to simply pass the + * read through to the provider media. More complex partition schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the read. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void read(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function write + * @discussion + * Write data into the storage object at the specified byte offset from the + * specified buffer, asynchronously. When the write completes, the caller + * will be notified via the specified completion action. + * + * The buffer will be retained for the duration of the write. + * + * For simple partition schemes, the default behavior is to simply pass the + * write through to the provider media. More complex partition schemes such + * as RAID will need to do extra processing here. + * @param client + * Client requesting the write. + * @param byteStart + * Starting byte offset for the data transfer. + * @param buffer + * Buffer for the data transfer. The size of the buffer implies the size of + * the data transfer. + * @param attributes + * Attributes of the data transfer. See IOStorageAttributes. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + * @param completion + * Completion routine to call once the data transfer is complete. It is the + * responsibility of the callee to maintain the information for the duration + * of the data transfer, as necessary. + */ + + virtual void write(IOService * client, + UInt64 byteStart, + IOMemoryDescriptor * buffer, + IOStorageAttributes * attributes, + IOStorageCompletion * completion); + + /*! + * @function synchronizeCache + * @discussion + * Flush the cached data in the storage object, if any, synchronously. + * @param client + * Client requesting the cache synchronization. + * @result + * Returns the status of the cache synchronization. + */ + + virtual IOReturn synchronizeCache(IOService * client); + + /*! + * @function discard + * @discussion + * Delete unused data from the storage object at the specified byte offset, + * synchronously. + * @param client + * Client requesting the operation. + * @param byteStart + * Starting byte offset for the operation. + * @param byteCount + * Size of the operation. + * @result + * Returns the status of the operation. + */ + + virtual IOReturn discard(IOService * client, + UInt64 byteStart, + UInt64 byteCount); + + /* + * Obtain this object's provider. We override the superclass's method + * to return a more specific subclass of OSObject -- an IOMedia. This + * method serves simply as a convenience to subclass developers. + */ + + virtual IOMedia * getProvider() const; + +#ifdef __LP64__ + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 0); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 1); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 2); +#else /* !__LP64__ */ + OSMetaClassDeclareReservedUsed(IOPartitionScheme, 0); + OSMetaClassDeclareReservedUsed(IOPartitionScheme, 1); + OSMetaClassDeclareReservedUsed(IOPartitionScheme, 2); +#endif /* !__LP64__ */ + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 3); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 4); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 5); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 6); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 7); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 8); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 9); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 10); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 11); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 12); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 13); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 14); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 15); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 16); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 17); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 18); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 19); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 20); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 21); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 22); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 23); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 24); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 25); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 26); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 27); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 28); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 29); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 30); + OSMetaClassDeclareReservedUnused(IOPartitionScheme, 31); +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOPARTITIONSCHEME_H */ diff --git a/i386/include/IOKit/storage/IOStorage.h b/i386/include/IOKit/storage/IOStorage.h new file mode 100644 index 0000000..d5725c2 --- /dev/null +++ b/i386/include/IOKit/storage/IOStorage.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + * @header IOStorage + * @abstract + * This header contains the IOStorage class definition. + */ + +#ifndef _IOSTORAGE_H +#define _IOSTORAGE_H + +#include <IOKit/IOTypes.h> + +/*! + * @defined kIOStorageClass + * @abstract + * The name of the IOStorage class. + */ + +#define kIOStorageClass "IOStorage" + +/*! + * @defined kIOStorageCategory + * @abstract + * kIOStorageCategory is a value for IOService's kIOMatchCategoryKey property. + * @discussion + * The kIOStorageCategory value is the standard value for the IOService property + * kIOMatchCategoryKey ("IOMatchCategory") for all storage drivers. All storage + * objects that expect to drive new content (that is, produce new media objects) + * are expected to compete within the kIOStorageCategory namespace. + * + * See the IOService documentation for more information on match categories. + */ + +#define kIOStorageCategory "IOStorage" /* (as IOMatchCategory) */ + +/*! + * @defined kIOStorageFeaturesKey + * @abstract + * A property of any object in the storage stack. + * @discussion + * kIOStorageFeaturesKey is a property of any object in the storage stack that + * wishes to express support of additional features, such as Force Unit Access. + * It is typically defined in the device object below the block storage driver + * object. It has an OSDictionary value, where each entry describes one given + * feature. + */ + +#define kIOStorageFeaturesKey "IOStorageFeatures" + +/*! + * @defined kIOStorageFeatureDiscard + * @abstract + * Describes the presence of the Discard feature. + * @discussion + * This property describes the ability of the storage stack to delete unused + * data from the media. It is one of the feature entries listed under the top- + * level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureDiscard "Discard" + +/*! + * @defined kIOStorageFeatureForceUnitAccess + * @abstract + * Describes the presence of the Force Unit Access feature. + * @discussion + * This property describes the ability of the storage stack to force a request + * to access the media. It is one of the feature entries listed under the top- + * level kIOStorageFeaturesKey property table. It has an OSBoolean value. + */ + +#define kIOStorageFeatureForceUnitAccess "Force Unit Access" + +#ifdef KERNEL +#ifdef __cplusplus + +/* + * Kernel + */ + +#include <IOKit/assert.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOService.h> + +/*! + * @enum IOStorageAccess + * @discussion + * The IOStorageAccess enumeration describes the possible access levels for open + * requests. + * @constant kIOStorageAccessNone + * No access is requested; should not be passed to open(). + * @constant kIOStorageAccessReader + * Read-only access is requested. + * @constant kIOStorageAccessReaderWriter + * Read and write access is requested. + * @constant kIOStorageAccessSharedLock + * Shared access is requested. + * @constant kIOStorageAccessExclusiveLock + * Exclusive access is requested. + */ + +enum +{ + kIOStorageAccessNone = 0x00, + kIOStorageAccessReader = 0x01, + kIOStorageAccessReaderWriter = 0x03, + kIOStorageAccessSharedLock = 0x04, + kIOStorageAccessExclusiveLock = 0x08 +}; + +typedef UInt32 IOStorageAccess; + +/*! + * @enum IOStorageOptions + * @discussion + * Options for read and write storage requests. + * @constant kIOStorageOptionForceUnitAccess + * Force the request to access the media. + */ + +enum +{ + kIOStorageOptionNone = 0x00000000, + kIOStorageOptionForceUnitAccess = 0x00000001, + kIOStorageOptionReserved = 0xFFFFFFFE +}; + +typedef UInt32 IOStorageOptions; + +/*! + * @struct IOStorageAttributes + * @discussion + * Attributes of read and write storage requests. + * @field options + * Options for the request. See IOStorageOptions. + * @field reserved + * Reserved for future use. Set to zero. + */ + +struct IOStorageAttributes +{ + IOStorageOptions options; + UInt32 reserved0032; + UInt64 reserved0064; +#ifdef __LP64__ + UInt64 reserved0128; + UInt64 reserved0192; +#endif /* __LP64__ */ +}; + +/*! + * @typedef IOStorageCompletionAction + * @discussion + * The IOStorageCompletionAction declaration describes the C (or C++) completion + * routine that is called once an asynchronous storage operation completes. + * @param target + * Opaque client-supplied pointer (or an instance pointer for a C++ callback). + * @param parameter + * Opaque client-supplied pointer. + * @param status + * Status of the data transfer. + * @param actualByteCount + * Actual number of bytes transferred in the data transfer. + */ + +typedef void (*IOStorageCompletionAction)(void * target, + void * parameter, + IOReturn status, + UInt64 actualByteCount); + +/*! + * @struct IOStorageCompletion + * @discussion + * The IOStorageCompletion structure describes the C (or C++) completion routine + * that is called once an asynchronous storage operation completes. The values + * passed for the target and parameter fields will be passed to the routine when + * it is called. + * @field target + * Opaque client-supplied pointer (or an instance pointer for a C++ callback). + * @field action + * Completion routine to call on completion of the data transfer. + * @field parameter + * Opaque client-supplied pointer. + */ + +struct IOStorageCompletion +{ + void * target; + IOStorageCompletionAction action; + void * parameter; +}; + +#endif /* __cplusplus */ +#endif /* KERNEL */ +#endif /* !_IOSTORAGE_H */ diff --git a/i386/include/IOKit/storage/IOStorageDeviceCharacteristics.h b/i386/include/IOKit/storage/IOStorageDeviceCharacteristics.h new file mode 100644 index 0000000..19a73a2 --- /dev/null +++ b/i386/include/IOKit/storage/IOStorageDeviceCharacteristics.h @@ -0,0 +1,659 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ + +#include <IOKit/storage/IOStorageProtocolCharacteristics.h> + +/* + * Device Characteristics - Characteristics defined for devices. + */ + +/*! +@defined kIOPropertyDeviceCharacteristicsKey +@discussion This key is used to define Device Characteristics for a particular +device and it has an associated dictionary which lists the +device characteristics. The device characteristics are Command Set specific +and are listed in the header files for each command set. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyDeviceCharacteristicsKey "Device Characteristics" + + +/*! +@defined kIOPropertyVendorNameKey +@discussion This key is used to define the Vendor Name for a particular device +and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyVendorNameKey "Vendor Name" + + +/*! +@defined kIOPropertyProductNameKey +@discussion This key is used to define the Product Name for a particular device +and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductNameKey "Product Name" + + +/*! +@defined kIOPropertyProductRevisionLevelKey +@discussion This key is used to define the Product Revision Level for a +particular device and it has an associated string. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductRevisionLevelKey "Product Revision Level" + + +/*! +@defined kIOPropertyProductSerialNumberKey +@discussion This key is used to define the Product Serial Number for a +particular device and it has an associated data. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Serial Number</key> + <string>123456789</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProductSerialNumberKey "Serial Number" + + +/*! +@defined kIOPropertySupportedCDFeaturesKey +@discussion This key is used to define the supported CD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedCDFeaturesKey "CD Features" + + +/*! +@defined kIOPropertySupportedDVDFeaturesKey +@discussion This key is used to define the supported DVD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedDVDFeaturesKey "DVD Features" + + +/*! +@defined kIOPropertySupportedBDFeaturesKey +@discussion This key is used to define the supported BD Features for a +particular optical device and it has an associated bitfield. See +<IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the +bits and associated bitmasks. + +Requirement: Mandatory for optical devices (Peripheral Device Type 05h). + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>SuperDrive</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>CD Features</key> + <integer>1663</integer> + <key>DVD Features</key> + <integer>103</integer> + <key>BD Features</key> + <integer>21</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySupportedBDFeaturesKey "BD Features" + + +/*! +@defined kIOPropertyRigidDiskGeometryKey +@discussion This key is used to define a dictionary containing +rigid disk geometry information. + +Requirement: Optional. If a device publishes this dictionary, it +must publish all key/value pairs which are deemed Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyRigidDiskGeometryKey "Rigid Disk Geometry" + + +/*! +@defined kIOPropertySectorCountPerTrackKey +@discussion This key is used to define the number of sectors per +each track for a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySectorCountPerTrackKey "Sector Count per Track" + + +/*! +@defined kIOPropertyHeadCountKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyHeadCountKey "Head Count" + + +/*! +@defined kIOPropertyCylinderCountKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyCylinderCountKey "Cylinder Count" + + +/*! +@defined kIOPropertyBytesPerPhysicalSectorKey +@discussion This key is used to define the number of heads for +a particular medium. + +Requirement: Mandatory element of the Rigid Disk Geometry dictionary. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Rigid Disk Geometry</key> + <dict> + <key>Sector Count per Track</key> + <integer>12345</integer> + <key>Head Count</key> + <integer>12</integer> + <key>Cylinder Count</key> + <integer>12345</integer> + <key>Bytes per Physical Sector</key> + <integer>512</integer> + </dict> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyBytesPerPhysicalSectorKey "Bytes per Physical Sector" + + +/*! +@defined kIOPropertyPhysicalBlockSizeKey +@discussion This key is used to define the physical block size of a hard disk drive. + +Requirement: Mandatory for hard disk drives with physical block size other than 512 bytes. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Physical Block Size</key> + <integer>4096</integer> + <key>Logical Block Size</key> + <integer>512</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalBlockSizeKey "Physical Block Size" + + +/*! +@defined kIOPropertyLogicalBlockSizeKey +@discussion This key is used to define the logical block size of a hard disk drive. + +Requirement: Mandatory for hard disk drives with logical block size other than 512 bytes +or that does not match its physical block size. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>Apple</string> + <key>Product Name</key> + <string>iPod</string> + <key>Product Revision Level</key> + <string>1.0</string> + <key>Physical Block Size</key> + <integer>4096</integer> + <key>Logical Block Size</key> + <integer>512</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyLogicalBlockSizeKey "Logical Block Size" + + +/*! +@defined kIOPropertyTargetDiskModeKey +@discussion This key is used to indicate the device is another computer in Target Disk Mode. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Target Disk Mode</key> + <true/> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyTargetDiskModeKey "Target Disk Mode" + + +/*! +@defined kIOPropertyMediumTypeKey +@discussion This key is used to indicate the medium type of the device. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Rotational</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeKey "Medium Type" + + +/*! +@defined kIOPropertyMediumTypeRotationalKey +@discussion This key is used to indicate the medium type of the device is rotational. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Rotational</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeRotationalKey "Rotational" + + +/*! +@defined kIOPropertyMediumTypeSolidStateKey +@discussion This key is used to indicate the medium type of the device is solid state. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Medium Type</key> + <string>Solid State</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumTypeSolidStateKey "Solid State" + + +/*! +@defined kIOPropertyMediumRotationRateKey +@discussion This key is used to indicate the medium rotation rate in RPM of the device. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Device Characteristics</key> + <dict> + <key>Vendor Name</key> + <string>AAPL</string> + <key>Product Name</key> + <string>FireWire Target</string> + <key>Product Revision Level</key> + <string>0000</string> + <key>Rotation Rate</key> + <integer>7200</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyMediumRotationRateKey "Rotation Rate" + + +#endif /* _IOKIT_IO_STORAGE_DEVICE_CHARACTERISTICS_H_ */ diff --git a/i386/include/IOKit/storage/IOStorageProtocolCharacteristics.h b/i386/include/IOKit/storage/IOStorageProtocolCharacteristics.h new file mode 100644 index 0000000..18a726f --- /dev/null +++ b/i386/include/IOKit/storage/IOStorageProtocolCharacteristics.h @@ -0,0 +1,1758 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ +#define _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ + + +/* + * Protocol Characteristics - Characteristics defined for protocols. + */ + + +/*! +@defined kIOPropertyProtocolCharacteristicsKey +@discussion This key is used to define Protocol Characteristics for a particular +protocol and it has an associated dictionary which lists the +protocol characteristics. + +Requirement: Mandatory + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATAPI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyProtocolCharacteristicsKey "Protocol Characteristics" + + +/*! +@defined kIOPropertySCSIInitiatorIdentifierKey +@discussion An identifier that will uniquely identify this SCSI Initiator for the +SCSI Domain. + +Requirement: Mandatory for SCSI Parallel Interface, SAS, +and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Initiator Identifier</key> + <integer>7</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIInitiatorIdentifierKey "SCSI Initiator Identifier" + + +/*! +@defined kIOPropertySCSIDomainIdentifierKey +@discussion An identifier that will uniquely identify this SCSI Domain for the +Physical Interconnect type. This identifier is only guaranteed to be unique for +any given Physical Interconnect and is not guaranteed to be the same across +restarts or shutdowns. + +Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Domain Identifier</key> + <integer>0</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIDomainIdentifierKey "SCSI Domain Identifier" + + +/*! +@defined kIOPropertySCSITargetIdentifierKey +@discussion This is the SCSI Target Identifier for a given SCSI Target Device. + +Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Target Identifier</key> + <integer>3</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSITargetIdentifierKey "SCSI Target Identifier" + + +/*! +@defined kIOPropertySCSILogicalUnitNumberKey +@discussion This key is the SCSI Logical Unit Number for the device server +controlled by the driver. + +Requirement: Mandatory for SCSI Parallel Interface, SAS, and Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + <key>SCSI Logical Unit Number</key> + <integer>2</integer> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSILogicalUnitNumberKey "SCSI Logical Unit Number" + + +/*! +@defined kIOPropertySASAddressKey +@discussion This key is the unique 64-bit SAS Address for the device server +node located at this port, or for the initiating host port. + +Requirement: Mandatory for SAS. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SAS</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>SAS Address</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SAS Address</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySASAddressKey "SAS Address" + + +/*! +@defined kIOPropertyFibreChannelNodeWorldWideNameKey +@discussion This key is the unique 64-bit World Wide Name for the device server +node located at this port, or for the initiating host port. + +Requirement: Mandatory for Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Node World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Node World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelNodeWorldWideNameKey "Node World Wide Name" + + +/*! +@defined kIOPropertyFibreChannelPortWorldWideNameKey +@discussion This key is the unique 64-bit World Wide Name for the port. + +Requirement: Mandatory for Fibre Channel Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Port World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port World Wide Name</key> + <data>0011223344556677</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelPortWorldWideNameKey "Port World Wide Name" + + +/*! +@defined kIOPropertyFibreChannelAddressIdentifierKey +@discussion This key is the 24-bit Address Identifier (S_ID or D_ID) as +defined in the FC-FS specification. It contains the address identifier +of the source or destination Nx_Port. + +Note: This value can change. It is not a static value. + +Requirement: Optional (only necessary for Fibre Channel Interface). + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Address Identifier</key> + <data>001122</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Address Identifier</key> + <data>001122</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelAddressIdentifierKey "Address Identifier" + + +/*! +@defined kIOPropertyFibreChannelALPAKey +@discussion This key is the 8-bit Arbitrated Loop Physical Address +(AL_PA) value as defined in the FC-AL-2 specification. + +Note: This value can change. It is not a static value. + +Requirement: Optional (only necessary for Fibre Channel Interface). + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>AL_PA</key> + <data>04</data> + </dict> +</dict> +@/textblock +</pre> + +Example2: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>AL_PA</key> + <data>04</data> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelALPAKey "AL_PA" + + +/*! +@defined kIOPropertyPortStatusKey +@discussion This key is associated with the current port +status of the physical link. The port status is either +"Link Established", "No Link Established", or "Link Failed". + +Note: This value can change when the port status changes. It +is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusKey "Port Status" + + +/*! +@defined kIOPropertyPortSpeedKey +@discussion This key is associated with the current port +speed. The port speed can be any valid speed for the interconnect. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedKey "Port Speed" + + +/*! +@defined kIOPropertyPortTopologyKey +@discussion This key is associated with the current port +topology. The port topology can be any valid topology for the interconnect. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (N_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyKey "Port Topology" + + +/*! +@defined kIOPropertyPortDescriptionKey +@discussion This key is associated with an human +readable port description. Examples include +"Channel A", "Port 1", etc. + +Requirement: Optional for all interconnects. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Description</key> + <string>Channel A</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortDescriptionKey "Port Description" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeKey +@discussion This key is associated with the signaling type +used for this SCSI Parallel bus. Valid values include +"High Voltage Differential", "Low Voltage Differential", +and "Single Ended". + +Requirement: Optional for SCSI Parallel Interface. Not +defined for any other physical interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>High Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeKey "SCSI Parallel Signaling Type" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionKey +@discussion This key is associated with the cabling type +used for this Fibre Channel port. Valid values include +"Copper" and "Fiber Optic". + +Requirement: Optional for Fibre Channel Interface. Not +defined for any other physical interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Copper</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionKey "Fibre Channel Cabling Type" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeKey +@discussion This key is used to define the Physical Interconnect to which +a device is attached. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeKey "Physical Interconnect" + + +/*! +@defined kIOPropertyPhysicalInterconnectLocationKey +@discussion This key is used to define the Physical Interconnect +Location. + +Requirement: Mandatory. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectLocationKey "Physical Interconnect Location" + + +/*! +@defined kIOPropertySCSIProtocolMultiInitKey +@discussion This protocol characteristics key is used to inform the system +that the protocol supports having multiple devices that act as initiators. + +Requirement: Optional. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + <key>Multiple Initiators</key> + <string>True</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIProtocolMultiInitKey "Multiple Initiators" + + +/* + * Values - Values for the characteristics defined above. + */ + + +/*! +@defined kIOPropertyInternalKey +@discussion This key defines the value of Internal for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is +connected to an internal bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInternalKey "Internal" + + +/*! +@defined kIOPropertyExternalKey +@discussion This key defines the value of External for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is +connected to an external bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyExternalKey "External" + + +/*! +@defined kIOPropertyInternalExternalKey +@discussion This key defines the value of Internal/External for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is connected +to a bus and it is indeterminate whether it is internal or external, +this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>Internal/External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInternalExternalKey "Internal/External" + + +/*! +@defined kIOPropertyInterconnectFileKey +@discussion This key defines the value of File for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is a file +that is being represented as a storage device, this key should be set. + +NOTE: This key should only be used when the Physical Interconnect is set to +Virtual Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>File</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInterconnectFileKey "File" + + +/*! +@defined kIOPropertyInterconnectRAMKey +@discussion This key defines the value of RAM for the key +kIOPropertyPhysicalInterconnectLocationKey. If the device is system memory +that is being represented as a storage device, this key should be set. + +NOTE: This key should only be used when the Physical Interconnect is set to +Virtual Interface. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>RAM</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyInterconnectRAMKey "RAM" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeATA +@discussion This key defines the value of ATA for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to an ATA bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeATA "ATA" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSerialATA +@discussion This key defines the value of SATA for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SATA bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SATA</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSerialATA "SATA" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI +@discussion This key defines the value of SAS for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SAS bus, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SAS</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI "SAS" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeATAPI +@discussion This key defines the value of ATAPI for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to an ATA bus and follows the ATAPI command specification, this key +should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>ATAPI</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeATAPI "ATAPI" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeUSB +@discussion This key defines the value of USB for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a USB port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>USB</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeUSB "USB" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeFireWire +@discussion This key defines the value of USB for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a FireWire port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>FireWire</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeFireWire "FireWire" + + +/*! + @defined kIOPropertyPhysicalInterconnectTypeSecureDigital + @discussion This key defines the value of Secure Digital for the key + kIOPropertyPhysicalInterconnectTypeSecureDigital. If the device is a + connected to a Secure Digital port and follows the Secure Digital + specification, this key should be set. + + Example: + <pre> + @textblock + <dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Secure Digital</string> + <key>Physical Interconnect Location</key> + <string>Internal</string> + </dict> + </dict> + @/textblock + </pre> + */ +#define kIOPropertyPhysicalInterconnectTypeSecureDigital "Secure Digital" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeSCSIParallel +@discussion This key defines the value of SCSI Parallel Interface for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a SCSI Parallel port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>SCSI Parallel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeSCSIParallel "SCSI Parallel Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeFibreChannel +@discussion This key defines the value of Fibre Channel Interface for the key +kIOPropertyPhysicalInterconnectTypeKey. If the device is connected +to a Fibre Channel port, this key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Fibre Channel Interface</string> + <key>Physical Interconnect Location</key> + <string>External</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeFibreChannel "Fibre Channel Interface" + + +/*! +@defined kIOPropertyPhysicalInterconnectTypeVirtual +@discussion This key defines the value of Virtual Interface for the key +kIOPropertyPhysicalInterconnectTypeVirtual. If the device is being made to look +like a storage device, but is not such in actuality, such as a File or RAM, this +key should be set. + +Example: +<pre> +@textblock +<dict> + <key>Protocol Characteristics</key> + <dict> + <key>Physical Interconnect</key> + <string>Virtual Interface</string> + <key>Physical Interconnect Location</key> + <string>File</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPhysicalInterconnectTypeVirtual "Virtual Interface" + + +/*! +@defined kIOPropertyPortStatusLinkEstablishedKey +@discussion This key defines the value of Link Established for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusLinkEstablishedKey "Link Established" + + +/*! +@defined kIOPropertyPortStatusNoLinkEstablishedKey +@discussion This key defines the value of No Link Established for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>No Link Established</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusNoLinkEstablishedKey "No Link Established" + + +/*! +@defined kIOPropertyPortStatusLinkFailedKey +@discussion This key defines the value of Link Failed for the key +kIOPropertyPortStatusKey. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Status</key> + <string>Link Failed</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortStatusLinkFailedKey "Link Failed" + + +/*! +@defined kIOPropertyPortSpeedAutomaticKey +@discussion This key defines the value of Automatic for the key +kIOPropertyPortSpeedKey. If the speed of the port is automatically +adjusted by the host/device and a definitive speed is not known, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomaticKey "Automatic" + + +/*! +@defined kIOPropertyPortSpeed1GigabitKey +@discussion This key defines the value of 1 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 1 Gigabit +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>1 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed1GigabitKey "1 Gigabit" + +/*! +@defined kIOPropertyPortSpeed1_5GigabitKey +@discussion This key defines the value of 1.5 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 1.5 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>1.5 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed1_5GigabitKey "1.5 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed2GigabitKey +@discussion This key defines the value of 2 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 2 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>2 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed2GigabitKey "2 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed3GigabitKey +@discussion This key defines the value of 3 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 3 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>3 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed3GigabitKey "3 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed4GigabitKey +@discussion This key defines the value of 4 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 4 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>4 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed4GigabitKey "4 Gigabit" + +/*! +@defined kIOPropertyPortSpeed6GigabitKey +@discussion This key defines the value of 6 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 6 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>6 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed6GigabitKey "6 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed8GigabitKey +@discussion This key defines the value of 8 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 8 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>8 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed8GigabitKey "8 Gigabit" + + +/*! +@defined kIOPropertyPortSpeed10GigabitKey +@discussion This key defines the value of 10 Gigabit for the key +kIOPropertyPortSpeedKey. If the speed of the port is 10 Gigabits +per second and is not automatically determined (i.e. the user +configured the port to be exactly this speed), +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>10 Gigabit</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeed10GigabitKey "10 Gigabit" + + +/*! +@defined kIOPropertyPortSpeedAutomatic1GigabitKey +@discussion This key defines the value of Automatic (1 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +1 Gigabit per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic1GigabitKey "Automatic (1 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic1_5GigabitKey +@discussion This key defines the value of Automatic (1.5 Gigabit) for the key +kIOPropertyPortSpeedKey. If the speed of the port is +1.5 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (1.5 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic1_5GigabitKey "Automatic (1.5 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic2GigabitKey +@discussion This key defines the value of Automatic (2 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +2 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (2 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic2GigabitKey "Automatic (2 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic3GigabitKey +@discussion This key defines the value of Automatic (3 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +3 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (3 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic3GigabitKey "Automatic (3 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic4GigabitKey +@discussion This key defines the value of Automatic (4 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +4 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (4 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic4GigabitKey "Automatic (4 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic6GigabitKey +@discussion This key defines the value of Automatic (6 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +6 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (6 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic6GigabitKey "Automatic (6 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic8GigabitKey +@discussion This key defines the value of Automatic (8 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +8 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (8 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic8GigabitKey "Automatic (8 Gigabit)" + + +/*! +@defined kIOPropertyPortSpeedAutomatic10GigabitKey +@discussion This key defines the value of Automatic (10 Gigabit) +for the key kIOPropertyPortSpeedKey. If the speed of the port is +10 Gigabits per second and is automatically determined by host +software, this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Speed</key> + <string>Automatic (10 Gigabit)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortSpeedAutomatic10GigabitKey "Automatic (10 Gigabit)" + + +/*! +@defined kIOPropertyPortTopologyAutomaticKey +@discussion This key defines the value of Automatic for the key +kIOPropertyPortTopologyKey. If the topology of the port is automatically +adjusted by the host/device and a definitive topology is not known, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticKey "Automatic" + + +/*! +@defined kIOPropertyPortTopologyNPortKey +@discussion This key defines the value of N_Port for the key +kIOPropertyPortTopologyKey. If the topology of the port is an N_Port, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>N_Port</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyNPortKey "N_Port" + + +/*! +@defined kIOPropertyPortTopologyNLPortKey +@discussion This key defines the value of NL_Port for the key +kIOPropertyPortTopologyKey. If the topology of the port is an NL_Port, +this key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>NL_Port</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyNLPortKey "NL_Port" + + +/*! +@defined kIOPropertyPortTopologyAutomaticNPortKey +@discussion This key defines the value of Automatic (N_Port) for the key +kIOPropertyPortTopologyKey. If the topology of the port is +N_Port and is automatically determined by host software, this +key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (N_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticNPortKey "Automatic (N_Port)" + + +/*! +@defined kIOPropertyPortTopologyAutomaticNLPortKey +@discussion This key defines the value of Automatic (NL_Port) for the key +kIOPropertyPortTopologyKey. If the topology of the port is +NL_Port and is automatically determined by host software, this +key should be used. + +Note: This value can change. It is not a static value. + +Requirement: Optional for any interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Port Topology</key> + <string>Automatic (NL_Port)</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyPortTopologyAutomaticNLPortKey "Automatic (NL_Port)" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeHVDKey +@discussion This key defines the value of High Voltage Differential for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +High Voltage Differential, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>High Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeHVDKey "High Voltage Differential" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeLVDKey +@discussion This key defines the value of Low Voltage Differential for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +Low Voltage Differential, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>Low Voltage Differential</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeLVDKey "Low Voltage Differential" + + +/*! +@defined kIOPropertySCSIParallelSignalingTypeSEKey +@discussion This key defines the value of Single Ended for the key +kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is +Single Ended, this key should be used. + +Requirement: Optional for SCSI Parallel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>SCSI Parallel Signaling Type</key> + <string>Single Ended</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertySCSIParallelSignalingTypeSEKey "Single Ended" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionCopperKey +@discussion This key defines the value of Copper for the key +kIOPropertyFibreChannelCableDescriptionKey. If the cabling is +Copper, this key should be used. + +Requirement: Optional for Fibre Channel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Copper</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionCopperKey "Copper" + + +/*! +@defined kIOPropertyFibreChannelCableDescriptionFiberOpticKey +@discussion This key defines the value of Fiber Optic for the key +kIOPropertyFibreChannelCableDescriptionKey. If the cabling is +Fiber Optic, this key should be used. + +Requirement: Optional for Fibre Channel Interface interconnect. + +Example: +<pre> +@textblock +<dict> + <key>Controller Characteristics</key> + <dict> + <key>Fibre Channel Cabling Type</key> + <string>Fiber Optic</string> + </dict> +</dict> +@/textblock +</pre> +*/ +#define kIOPropertyFibreChannelCableDescriptionFiberOpticKey "Fiber Optic" + + +#endif /* _IOKIT_IO_STORAGE_PROTOCOL_CHARACTERISTICS_H_ */ diff --git a/i386/include/IOKit/storage/ata/.svn/all-wcprops b/i386/include/IOKit/storage/ata/.svn/all-wcprops new file mode 100644 index 0000000..c7a10f5 --- /dev/null +++ b/i386/include/IOKit/storage/ata/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/ata +END +IOATAStorageDefines.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/ata/IOATAStorageDefines.h +END +IOATAPIProtocolTransport.h +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/storage/ata/IOATAPIProtocolTransport.h +END diff --git a/i386/include/IOKit/storage/ata/.svn/entries b/i386/include/IOKit/storage/ata/.svn/entries new file mode 100644 index 0000000..e7c3c5a --- /dev/null +++ b/i386/include/IOKit/storage/ata/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/storage/ata +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOATAStorageDefines.h +file + + + + +2013-08-27T23:54:15.000000Z +2636f67bb1c6a3bf217e724e581bbc77 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9421 + +IOATAPIProtocolTransport.h +file + + + + +2013-08-27T23:54:15.000000Z +216442f064c65df79d52e27fa6006097 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14901 + diff --git a/i386/include/IOKit/storage/ata/.svn/text-base/IOATAPIProtocolTransport.h.svn-base b/i386/include/IOKit/storage/ata/.svn/text-base/IOATAPIProtocolTransport.h.svn-base new file mode 100644 index 0000000..3356ae7 --- /dev/null +++ b/i386/include/IOKit/storage/ata/.svn/text-base/IOATAPIProtocolTransport.h.svn-base @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOATAPIProtocolTransport + Contains the class definition for IOATAPIProtocolTransport. +*/ + + +#ifndef _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ +#define _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ + +#define kIOPropertyATAPIMassStorageCharacteristics "ATAPI Mass Storage Characteristics" + +#if defined(KERNEL) && defined(__cplusplus) + +/* General IOKit includes */ +#include <IOKit/IOLib.h> +#include <IOKit/IOMessage.h> +#include <IOKit/IOService.h> +#include <IOKit/IOCommandPool.h> + +/* IOKit ATA Family includes */ +#include <IOKit/ata/IOATADevice.h> +#include <IOKit/ata/IOATATypes.h> + +/* IOKit ATA Storage includes */ +#include <IOKit/storage/ata/IOATAStorageDefines.h> + +/* SCSI Architecture Model Family includes */ +#include <IOKit/scsi/IOSCSIProtocolServices.h> + +// Forward class declaration +class IOATAPIProtocolTransport; + +/*! + @typedef ATAPIClientData + @param cmd IOATACommand for request. + @param self Pointer to the object. + @param scsiTask SCSITaskIdentifier of request. + @discussion This structure is stuffed into the refcon so we can associate which + IOATACommand and SCSITaskIdentifier is completing. +*/ + +struct ATAPIClientData +{ + IOATACommand * cmd; + IOATAPIProtocolTransport * self; + SCSITaskIdentifier scsiTask; +}; +typedef struct ATAPIClientData ATAPIClientData; + + +/*! + @class IOATAPIProtocolTransport + @abstract SCSI Protocol Driver Family for ATAPI Devices. + @discussion IOATAPIProtocolTransport contains all the bus specific support for ATAPI compliant devices. + To add vendor specific features or workarounds you will sub-class the appropriate + methods of this family. +*/ + +class IOATAPIProtocolTransport : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOATAPIProtocolTransport ) + +public: + + // ---- IOService methods overridden ---- + + bool init ( OSDictionary * propTable ); + + // The start method is called to start our services. If the device + // can be controlled by this object, then we return true, else we + // return false. start() is usually used to allocate resources once + // it is determined that the device can be controlled by this object. + virtual bool start ( IOService * provider ); + + // The stop method is called to stop our services. It is primarily + // called for deallocation of resources. + virtual void stop ( IOService * provider ); + + // This method is our last chance to free all resources allocated. + virtual void free ( void ); + + +protected: + + // ---- member variables ---- + + IOATADevice * fATADevice; + ataUnitID fATAUnitID; + ataDeviceType fATADeviceType; + ataSocketType fATASocketType; + atapiConfig fATAPIPacketConfig; + UInt8 fPIOMode; + UInt8 fDMAMode; + UInt8 fUltraDMAMode; + IOCommandGate * fCommandGate; + IOCommandPool * fCommandPool; + IOATACommand * fResetCommand; + IOATACommand * fConfigCommand; + IOATACommand * fIdentifyCommand; + char fRevision[kSizeOfATARevisionString + 1]; + char fModel[kSizeOfATAModelString + 1]; + bool fWakeUpResetOccurred; + bool fPhysicallyConnected; + + // Used for low-power polling support + thread_call_t fPollingThread; + + UInt16 fDeviceIdentifyData[256]; + IOMemoryDescriptor * fDeviceIdentifyBuffer; + bool fResetInProgress; + + // Binary Compatibility instance variable expansion + struct ExpansionData + { + UInt32 fSemaphore; + UInt32 fMediaNotifyValue; + }; + ExpansionData * reserved; + + // ---- IOService methods overridden ---- + + // The message method is used to listen to messages from our provider, the ATA controller. + // It sends messages for bus reset notifications and for device removal (such as MediaBay, + // PC card, etc.) + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument = 0 ); + + // ---- Protocol transport methods overridden ---- + + // Send a SCSI Command to the device. If the command was sent to the + // device and is pending completion, the subclass should return true and + // return back the kSCSIServiceResponse_Request_In_Process response. + // If the command completes immediately with an error, the subclass will + // return true and return back the appropriate status. + // if the subclass is currently processing all the commands it can, the + // subclass will return false and the command will be resent next time + // CommandCompleted is called. + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + // This is a stub - not implemented in upper layer yet. Eventually, there + // will be a way to abort a task or task set and this method will be called. + // It will abort any commands which have not been executed by the ATA controller + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported method will return true if the protocol + // layer supports the specified feature. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + // The HandleProtocolServiceFeature method will return true if the protocol + // layer properly handled the specified feature. + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + // ------ Power Management Support ------ + + // The HandlePowerOff method is called to do any bus specific activity + // necessary before shutting down and going to sleep. + virtual IOReturn HandlePowerOff ( void ); + + // The HandlePowerOn method is called to do any bus specific activity + // necessary to recover from power-on/wake from sleep (e.g. device reset on ATAPI) + virtual IOReturn HandlePowerOn ( void ); + + + // ---- Methods defined by this class ---- + + // Static callback proc for all SCSITask objects, it calls through to + // SCSITaskCallbackFunction. + static void sSCSITaskCallbackProc ( IOATACommand * cmd ); + + // Callback proc for synchronous ATA only type commands. + static void sATACallbackSync ( IOATACommand * cmd ); + + // Callback proc for asynchronous ATAPI resets. + static void sATAPIResetCallback ( IOATACommand * cmd ); + + // Callback proc that does nothing. + static void sATAPIVoidCallback ( IOATACommand * cmd ); + + // State machine for device configuration. + static void sATAPIConfigStateMachine ( IOATACommand * cmd ); + + // Used for low-power polling. + static void sPollStatusRegister ( void * xptDriver, void * refCon ); + + // Static callback for low-power polling. + static void sPollStatusRegisterCallback ( IOATACommand * cmd ); + + // This method is called by the SCSITaskCallbackFunction and it calls the + // inherited CommandCompleted message with the results of the task. + virtual void CompleteSCSITask ( SCSITaskIdentifier scsiTask, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + // The SCSITaskCallbackFunction method is called by the static callback procedure + // to complete SCSITask operations. This method may be subclassed if a device + // workaround is necessary. + virtual void SCSITaskCallbackFunction ( IOATACommand * cmd, + SCSITaskIdentifier scsiTask ); + + // The ReportATAPIDeviceType method returns the ataDeviceType for ATAPI + virtual ataDeviceType ReportATAPIDeviceType ( void ) const; + + // The InspectDevice method is called to inspect the ATA device and verify + // that it is a device which can be controlled by this object + virtual bool InspectDevice ( IOATADevice * ataDevice ); + + // The AllocateATACommandObjects method is called to allocate a pool of + // IOATACommands for general purpose I/O usage. + virtual void AllocateATACommandObjects ( void ); + + // The DeallocateATACommandObjects method is called to deallocate a pool of + // IOATACommands for general purpose I/O usage. + virtual void DeallocateATACommandObjects ( void ); + + // The GetATACommandObject method is called to retrieve a command from + // the pool. Pass true to allow the method to sleep waiting for a command, + // else pass false. If false is passed, there is NO guarantee that a valid + // command will be returned. If true is passed, it IS guaranteed that a + // valid command will be returned, but the thread may be slept waiting for + // those resources. + virtual IOATACommand * GetATACommandObject ( bool okToSleep = true ); + + // The ReturnATACommandObject method is called to return a command to + // the pool. + virtual void ReturnATACommandObject ( IOATACommand * cmd ); + + // The sSwapBytes16 method is used to word-swap the Device Identify data + // on big endian systems. Since all identify data is returned in little endian + // values, it must be word-swapped before inspected. + static void sSwapBytes16 ( UInt8 * buffer, IOByteCount numBytesToSwap ); + + // The sConvertHighestBitToNumber method is used to find the highest bit in a + // word and return a numeric value. This is used to find the highest possible + // values for PIO, DMA, and UltraDMA transfer modes. + static UInt8 sConvertHighestBitToNumber ( UInt16 bitField ); + + // The sSetWakeupResetOccurred method is used to safely set member variables + // behind the command gate. + static void sSetWakeupResetOccurred ( IOATAPIProtocolTransport * driver, + bool resetOccurred ); + + // The sCheckWakeupResetOccur method is used to safely check member variables + // behind the command gate. + static void sCheckWakeupResetOccurred ( IOATAPIProtocolTransport * driver, + bool * resetOccurred ); + + // The DidWakeupResetOccur method is used to safely find out if a reset + // occurred while we were asleep. + virtual bool CheckWakeupResetOccurred ( void ); + + // The WakeupResetOccurred method is used to safely set/clear the reset flag. + virtual void SetWakeupResetOccurred ( bool resetOccurred ); + + // The SetPIOTransferMode method is used to set the programmed input-output (PIO) + // transfer mode. The highest value reported by the device is used. + virtual IOReturn SetPIOTransferMode ( IOATACommand * cmd, bool forceSync ); + + // The SetDMATransferMode method is used to set the direct memory access (DMA) + // transfer mode. The highest value reported by the device is used. + virtual IOReturn SetDMATransferMode ( IOATACommand * cmd, bool forceSync ); + + // The IdentifyAndConfigureATAPIDevice method is called to correctly identify + // and configure an ATAPI device. + virtual IOReturn IdentifyAndConfigureATAPIDevice ( void ); + + // The ConfigureATAPIDevice method is called to correctly configure the ATAPI + // device. It currently configures any PIO/DMA/UDMA transfer modes but may be + // expanded in the future. + virtual IOReturn ConfigureATAPIDevice ( void ); + + // The ReconfigureATAPIDevice method is called to correctly reconfigure the ATAPI + // device after a reset event has occurred (bus reset or device reset). It + // currently reconfigures any PIO/DMA/UDMA transfer modes but may be expanded in + // the future. + virtual IOReturn ReconfigureATAPIDevice ( void ); + + // The IdentifyATAPIDevice method is called to correctly identify the ATAPI + // device. It currently issues the Identify ATAPI Device packet command and + // uses the data to correctly configure the device. + virtual IOReturn IdentifyATAPIDevice ( void ); + + // The ResetATAPIDevice method is called to issue a Device Reset (also known + // as a SOFT RESET). This method will only reset the specified device on the + // bus. + virtual IOReturn ResetATAPIDevice ( void ); + + // The SendATASleepCommand method is called to put an ATAPI drive in sleep + // mode. + virtual IOReturn SendATASleepCommand ( void ); + + // The EnablePollingOfStatusRegister method is called to set up a timer for + // the call to PollStatusRegister. It is called when the SCSI Application Layer + // driver wants to enable low-power polling and after a poll which does not + // see a change in the register status. + virtual void EnablePollingOfStatusRegister ( void ); + + // The DisablePollingOfStatusRegister method is called to cancel any thread + // call which is doing a poll and drop the retain count on the object. + virtual void DisablePollingOfStatusRegister ( void ); + + // The PollStatusRegister method is used to do low-power polling on drives which + // support it. This feature is enabled by the SCSI Application Layer driver. + virtual void PollStatusRegister ( void * refCon ); + + // Callback method for the polling of the status register. + virtual void PollStatusRegisterCallback ( IOATACommand * cmd ); + + // The TurnDrivePowerOff method is called to turn power to the drive OFF + IOReturn TurnDrivePowerOff ( void ); + + IOReturn SendCommand ( IOATACommand * cmd ); + IOReturn GatedWaitForRequest ( void * data ); + +private: + + // Binary Compatibility reserved method space + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 1 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 2 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 3 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 4 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 5 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 6 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 7 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 8 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 9 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 10 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 11 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 12 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 13 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 14 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 15 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ */ \ No newline at end of file diff --git a/i386/include/IOKit/storage/ata/.svn/text-base/IOATAStorageDefines.h.svn-base b/i386/include/IOKit/storage/ata/.svn/text-base/IOATAStorageDefines.h.svn-base new file mode 100644 index 0000000..fdac8b3 --- /dev/null +++ b/i386/include/IOKit/storage/ata/.svn/text-base/IOATAStorageDefines.h.svn-base @@ -0,0 +1,321 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_ATA_STORAGE_DEFINES_H_ +#define _IOKIT_IO_ATA_STORAGE_DEFINES_H_ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Important word offsets in device identify data as + * defined in ATA-5 standard + */ + +enum +{ + kATAIdentifyConfiguration = 0, + kATAIdentifyLogicalCylinderCount = 1, + kATAIdentifyLogicalHeadCount = 3, + kATAIdentifySectorsPerTrack = 6, + kATAIdentifySerialNumber = 10, + kATAIdentifyFirmwareRevision = 23, + kATAIdentifyModelNumber = 27, + kATAIdentifyMultipleSectorCount = 47, + kATAIdentifyDriveCapabilities = 49, + kATAIdentifyDriveCapabilitiesExtended = 50, + kATAIdentifyPIOTiming = 51, + kATAIdentifyExtendedInfoSupport = 53, + kATAIdentifyCurrentCylinders = 54, + kATAIdentifyCurrentHeads = 55, + kATAIdentifyCurrentSectors = 56, + kATAIdentifyCurrentCapacity = 57, + kATAIdentifyCurrentMultipleSectors = 59, + kATAIdentifyLBACapacity = 60, + kATAIdentifySingleWordDMA = 62, + kATAIdentifyMultiWordDMA = 63, + kATAIdentifyAdvancedPIOModes = 64, + kATAIdentifyMinMultiWordDMATime = 65, + kATAIdentifyRecommendedMultiWordDMATime = 66, + kATAIdentifyMinPIOTime = 67, + kATAIdentifyMinPIOTimeWithIORDY = 68, + kATAIdentifyQueueDepth = 75, + kATAIdentifyMajorVersion = 80, + kATAIdentifyMinorVersion = 81, + kATAIdentifyCommandSetSupported = 82, + kATAIdentifyCommandSetSupported2 = 83, + kATAIdentifyCommandExtension1 = 84, + kATAIdentifyCommandExtension2 = 85, + kATAIdentifyCommandsEnabled = 86, + kATAIdentifyCommandsDefault = 87, + kATAIdentifyUltraDMASupported = 88, + kATAIdentifyPhysicalLogicalSectorSize = 106, + kATAIdentifyWordsPerLogicalSector1 = 117, + kATAIdentifyWordsPerLogicalSector2 = 118, + kATAIdentifyLogicalSectorAlignment = 209, + kATAIdentifyIntegrity = 255 +}; + + +/* + * Important bits in device identify data + * as defined in ATA-5 standard + */ + +enum +{ + // Configuration field (word 0) + kFixedDeviceBit = 6, // Fixed disk indicator bit + kRemoveableMediaBit = 7, // Removable media indicator bit + kNonMagneticDriveBit = 15, // Non-magnetic drive indicator bit + + kFixedDeviceMask = (1 << kFixedDeviceBit), // Mask for fixed disk indicator + kRemoveableMediaMask = (1 << kRemoveableMediaBit), // Mask for removable media indicator + kNonMagneticDriveMask = (1 << kNonMagneticDriveBit), // Mask for non-magnetic drive indicator + + // Capabilities field (word 49) + kDMABit = 8, // DMA supported bit + kLBABit = 9, // LBA supported bit + kIORDYDisableBit = 10, // IORDY can be disabled bit + kIORDYBit = 11, // IORDY supported bit + kStandbyTimerBit = 13, // Standby timer supported bit + + kDMASupportedMask = (1 << kDMABit), // Mask for DMA supported + kLBASupportedMask = (1 << kLBABit), // Mask for LBA supported + kDMADisableMask = (1 << kIORDYDisableBit), // Mask for DMA supported + kIORDYSupportedMask = (1 << kIORDYBit), // Mask for IORDY supported + kStandbySupportedMask = (1 << kStandbyTimerBit), // Mask for Standby Timer supported + + // Extensions field (word 53) + kCurFieldsValidBit = 0, // Bit to show words 54-58 are valid + kExtFieldsValidBit = 1, // Bit to show words 64-70 are valid + kCurFieldsValidMask = (1 << kCurFieldsValidBit), // Mask for current fields valid + kExtFieldsValidMask = (1 << kExtFieldsValidBit), // Extension word valid + + // Advanced PIO Transfer Modes field (word 64) + kMode3Bit = 0, // Bit to indicate mode 3 is supported + kMode3Mask = (1 << kMode3Bit), // Mask for mode 3 support + + // Integrity of Identify data (word 255) + kChecksumValidCookie = 0xA5 // Bits 7:0 if device supports feature + +}; + + +/* String size constants */ +enum +{ + kSizeOfATAModelString = 40, + kSizeOfATARevisionString = 8 +}; + +/* ATA Command timeout constants ( in milliseconds ) */ +enum +{ + kATATimeout10Seconds = 10000, + kATATimeout30Seconds = 30000, + kATATimeout45Seconds = 45000, + kATATimeout1Minute = 60000, + kATADefaultTimeout = kATATimeout30Seconds +}; + + +/* Retry constants */ +enum +{ + kATAZeroRetries = 0, + kATADefaultRetries = 4 +}; + +/* max number of blocks supported in ATA transaction */ +enum +{ + kIOATASectorCount8Bit = 8, + kIOATASectorCount16Bit = 16 +}; + +enum +{ + kIOATAMaximumBlockCount8Bit = (1 << kIOATASectorCount8Bit), + kIOATAMaximumBlockCount16Bit = (1 << kIOATASectorCount16Bit), + + // For backwards compatibility + kIOATAMaxBlocksPerXfer = kIOATAMaximumBlockCount8Bit +}; + + + +/* Power Management time constants (in seconds) */ +enum +{ + kSecondsInAMinute = 60, + k5Minutes = 5 * kSecondsInAMinute +}; + +/* Bits for features published in Word 82 of device identify data */ +enum +{ + kATASupportsSMARTBit = 0, + kATASupportsPowerManagementBit = 3, + kATASupportsWriteCacheBit = 5 +}; + +/* Masks for features published in Word 82 of device identify data */ +enum +{ + kATASupportsSMARTMask = (1 << kATASupportsSMARTBit), + kATASupportsPowerManagementMask = (1 << kATASupportsPowerManagementBit), + kATASupportsWriteCacheMask = (1 << kATASupportsWriteCacheBit) +}; + +/* Bits for features published in Word 83 of device identify data */ +enum +{ + kATASupportsCompactFlashBit = 2, + kATASupportsAdvancedPowerManagementBit = 3, + + kATASupports48BitAddressingBit = 10, + + kATASupportsFlushCacheBit = 12, + kATASupportsFlushCacheExtendedBit = 13 +}; + +/* Masks for features published in Word 83 of device identify data */ +enum +{ + kATASupportsCompactFlashMask = (1 << kATASupportsCompactFlashBit), + kATASupportsAdvancedPowerManagementMask = (1 << kATASupportsAdvancedPowerManagementBit), + + kATASupports48BitAddressingMask = (1 << kATASupports48BitAddressingBit), + + kATASupportsFlushCacheMask = (1 << kATASupportsFlushCacheBit), + kATASupportsFlushCacheExtendedMask = (1 << kATASupportsFlushCacheExtendedBit), + + // Mask to ensure data is valid + kIdentifyWordValidationMask = 0xC000, + kIdentifyWordValid = 0x4000 +}; + +/* Bits for features published in Word 84 of device identify data */ +enum +{ + kATAForceUnitAccessFeatureBit = 6, +}; + +/* Masks for features published in Word 84 of device identify data */ +enum +{ + kATAForceUnitAccessFeatureMask = (1 << kATAForceUnitAccessFeatureBit), +}; + +/* Bits for features published in Word 85 of device identify data */ +enum +{ + kATAWriteCacheEnabledBit = 5 +}; + +/* Masks for features published in Word 85 of device identify data */ +enum +{ + kATAWriteCacheEnabledMask = (1 << kATAWriteCacheEnabledBit) +}; + + +/* Bits for features published in Word 106 of device identify data */ +enum +{ + kATAPhysicalLogicalEnabledBit0 = 15, + kATAPhysicalLogicalEnabledBit1 = 14, + kATAMultipleLogicalSectorsBit = 13, + kATAValidLogicalSectorSizeBit = 12 +}; + +/* Masks for features published in Word 106 of device identify data */ +enum +{ + kATAPhysicalLogicalEnabledMask = (1 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1), + kATAPhysicalLogicalEnabledValue = (0 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1), + kATAMultipleLogicalSectorsMask = (1 << kATAMultipleLogicalSectorsBit), + kATAValidLogicalSectorSizeMask = (1 << kATAValidLogicalSectorSizeBit), + kATAPhysicalSectorSizeMask = 0xF, + kATALogicalSectorAlignmentMask = 0x3FFF +}; + +// Property table keys +#define kIOATASupportedFeaturesKey "ATA Features" + +/* ATA supported features */ +enum +{ + kIOATAFeaturePowerManagement = 0x01, /* OBSOLETE */ + kIOATAFeatureWriteCache = 0x02, /* OBSOLETE */ + kIOATAFeatureAdvancedPowerManagement = 0x04, + kIOATAFeatureCompactFlash = 0x08, + kIOATAFeature48BitLBA = 0x10, + kIOATAFeatureSMART = 0x20 +}; + +/* ATA Advanced Power Management settings (valid settings range from 1-254), +the settings below are the more common settings */ +enum +{ + kIOATAMaxPerformance = 0xFE, + kIOATADefaultPerformance = 0x80, + kIOATAMaxPowerSavings = 0x01 +}; + +/* ATA Transfer Mode bit masks */ +enum +{ + kATAEnableUltraDMAModeMask = 0x40, + kATAEnableMultiWordDMAModeMask = 0x20, + kATAEnablePIOModeMask = 0x08 +}; + + +typedef uint32_t ATAOperationType; +enum +{ + kATAOperationTypeRead = 0, + kATAOperationTypeWrite = 1, + kATAOperationTypeFlushCache = 2, + kATAOperationTypeSMART = 3, + kATAOperationTypeConfiguration = 4, + kATAOperationTypePowerManagement = 5, + kATAOperationTypeSMS = 6 +}; + +#if defined(KERNEL) + +typedef struct __ATAIORequest * ATARequestIdentifier; + +#endif // defined(KERNEL) + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IO_ATA_STORAGE_DEFINES_H_ */ diff --git a/i386/include/IOKit/storage/ata/IOATAPIProtocolTransport.h b/i386/include/IOKit/storage/ata/IOATAPIProtocolTransport.h new file mode 100644 index 0000000..3356ae7 --- /dev/null +++ b/i386/include/IOKit/storage/ata/IOATAPIProtocolTransport.h @@ -0,0 +1,365 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*! + @header IOATAPIProtocolTransport + Contains the class definition for IOATAPIProtocolTransport. +*/ + + +#ifndef _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ +#define _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ + +#define kIOPropertyATAPIMassStorageCharacteristics "ATAPI Mass Storage Characteristics" + +#if defined(KERNEL) && defined(__cplusplus) + +/* General IOKit includes */ +#include <IOKit/IOLib.h> +#include <IOKit/IOMessage.h> +#include <IOKit/IOService.h> +#include <IOKit/IOCommandPool.h> + +/* IOKit ATA Family includes */ +#include <IOKit/ata/IOATADevice.h> +#include <IOKit/ata/IOATATypes.h> + +/* IOKit ATA Storage includes */ +#include <IOKit/storage/ata/IOATAStorageDefines.h> + +/* SCSI Architecture Model Family includes */ +#include <IOKit/scsi/IOSCSIProtocolServices.h> + +// Forward class declaration +class IOATAPIProtocolTransport; + +/*! + @typedef ATAPIClientData + @param cmd IOATACommand for request. + @param self Pointer to the object. + @param scsiTask SCSITaskIdentifier of request. + @discussion This structure is stuffed into the refcon so we can associate which + IOATACommand and SCSITaskIdentifier is completing. +*/ + +struct ATAPIClientData +{ + IOATACommand * cmd; + IOATAPIProtocolTransport * self; + SCSITaskIdentifier scsiTask; +}; +typedef struct ATAPIClientData ATAPIClientData; + + +/*! + @class IOATAPIProtocolTransport + @abstract SCSI Protocol Driver Family for ATAPI Devices. + @discussion IOATAPIProtocolTransport contains all the bus specific support for ATAPI compliant devices. + To add vendor specific features or workarounds you will sub-class the appropriate + methods of this family. +*/ + +class IOATAPIProtocolTransport : public IOSCSIProtocolServices +{ + + OSDeclareDefaultStructors ( IOATAPIProtocolTransport ) + +public: + + // ---- IOService methods overridden ---- + + bool init ( OSDictionary * propTable ); + + // The start method is called to start our services. If the device + // can be controlled by this object, then we return true, else we + // return false. start() is usually used to allocate resources once + // it is determined that the device can be controlled by this object. + virtual bool start ( IOService * provider ); + + // The stop method is called to stop our services. It is primarily + // called for deallocation of resources. + virtual void stop ( IOService * provider ); + + // This method is our last chance to free all resources allocated. + virtual void free ( void ); + + +protected: + + // ---- member variables ---- + + IOATADevice * fATADevice; + ataUnitID fATAUnitID; + ataDeviceType fATADeviceType; + ataSocketType fATASocketType; + atapiConfig fATAPIPacketConfig; + UInt8 fPIOMode; + UInt8 fDMAMode; + UInt8 fUltraDMAMode; + IOCommandGate * fCommandGate; + IOCommandPool * fCommandPool; + IOATACommand * fResetCommand; + IOATACommand * fConfigCommand; + IOATACommand * fIdentifyCommand; + char fRevision[kSizeOfATARevisionString + 1]; + char fModel[kSizeOfATAModelString + 1]; + bool fWakeUpResetOccurred; + bool fPhysicallyConnected; + + // Used for low-power polling support + thread_call_t fPollingThread; + + UInt16 fDeviceIdentifyData[256]; + IOMemoryDescriptor * fDeviceIdentifyBuffer; + bool fResetInProgress; + + // Binary Compatibility instance variable expansion + struct ExpansionData + { + UInt32 fSemaphore; + UInt32 fMediaNotifyValue; + }; + ExpansionData * reserved; + + // ---- IOService methods overridden ---- + + // The message method is used to listen to messages from our provider, the ATA controller. + // It sends messages for bus reset notifications and for device removal (such as MediaBay, + // PC card, etc.) + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument = 0 ); + + // ---- Protocol transport methods overridden ---- + + // Send a SCSI Command to the device. If the command was sent to the + // device and is pending completion, the subclass should return true and + // return back the kSCSIServiceResponse_Request_In_Process response. + // If the command completes immediately with an error, the subclass will + // return true and return back the appropriate status. + // if the subclass is currently processing all the commands it can, the + // subclass will return false and the command will be resent next time + // CommandCompleted is called. + virtual bool SendSCSICommand ( SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + // This is a stub - not implemented in upper layer yet. Eventually, there + // will be a way to abort a task or task set and this method will be called. + // It will abort any commands which have not been executed by the ATA controller + virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request ); + + // The IsProtocolServiceSupported method will return true if the protocol + // layer supports the specified feature. + virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue ); + + // The HandleProtocolServiceFeature method will return true if the protocol + // layer properly handled the specified feature. + virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue ); + + // ------ Power Management Support ------ + + // The HandlePowerOff method is called to do any bus specific activity + // necessary before shutting down and going to sleep. + virtual IOReturn HandlePowerOff ( void ); + + // The HandlePowerOn method is called to do any bus specific activity + // necessary to recover from power-on/wake from sleep (e.g. device reset on ATAPI) + virtual IOReturn HandlePowerOn ( void ); + + + // ---- Methods defined by this class ---- + + // Static callback proc for all SCSITask objects, it calls through to + // SCSITaskCallbackFunction. + static void sSCSITaskCallbackProc ( IOATACommand * cmd ); + + // Callback proc for synchronous ATA only type commands. + static void sATACallbackSync ( IOATACommand * cmd ); + + // Callback proc for asynchronous ATAPI resets. + static void sATAPIResetCallback ( IOATACommand * cmd ); + + // Callback proc that does nothing. + static void sATAPIVoidCallback ( IOATACommand * cmd ); + + // State machine for device configuration. + static void sATAPIConfigStateMachine ( IOATACommand * cmd ); + + // Used for low-power polling. + static void sPollStatusRegister ( void * xptDriver, void * refCon ); + + // Static callback for low-power polling. + static void sPollStatusRegisterCallback ( IOATACommand * cmd ); + + // This method is called by the SCSITaskCallbackFunction and it calls the + // inherited CommandCompleted message with the results of the task. + virtual void CompleteSCSITask ( SCSITaskIdentifier scsiTask, + SCSIServiceResponse serviceResponse, + SCSITaskStatus taskStatus ); + + // The SCSITaskCallbackFunction method is called by the static callback procedure + // to complete SCSITask operations. This method may be subclassed if a device + // workaround is necessary. + virtual void SCSITaskCallbackFunction ( IOATACommand * cmd, + SCSITaskIdentifier scsiTask ); + + // The ReportATAPIDeviceType method returns the ataDeviceType for ATAPI + virtual ataDeviceType ReportATAPIDeviceType ( void ) const; + + // The InspectDevice method is called to inspect the ATA device and verify + // that it is a device which can be controlled by this object + virtual bool InspectDevice ( IOATADevice * ataDevice ); + + // The AllocateATACommandObjects method is called to allocate a pool of + // IOATACommands for general purpose I/O usage. + virtual void AllocateATACommandObjects ( void ); + + // The DeallocateATACommandObjects method is called to deallocate a pool of + // IOATACommands for general purpose I/O usage. + virtual void DeallocateATACommandObjects ( void ); + + // The GetATACommandObject method is called to retrieve a command from + // the pool. Pass true to allow the method to sleep waiting for a command, + // else pass false. If false is passed, there is NO guarantee that a valid + // command will be returned. If true is passed, it IS guaranteed that a + // valid command will be returned, but the thread may be slept waiting for + // those resources. + virtual IOATACommand * GetATACommandObject ( bool okToSleep = true ); + + // The ReturnATACommandObject method is called to return a command to + // the pool. + virtual void ReturnATACommandObject ( IOATACommand * cmd ); + + // The sSwapBytes16 method is used to word-swap the Device Identify data + // on big endian systems. Since all identify data is returned in little endian + // values, it must be word-swapped before inspected. + static void sSwapBytes16 ( UInt8 * buffer, IOByteCount numBytesToSwap ); + + // The sConvertHighestBitToNumber method is used to find the highest bit in a + // word and return a numeric value. This is used to find the highest possible + // values for PIO, DMA, and UltraDMA transfer modes. + static UInt8 sConvertHighestBitToNumber ( UInt16 bitField ); + + // The sSetWakeupResetOccurred method is used to safely set member variables + // behind the command gate. + static void sSetWakeupResetOccurred ( IOATAPIProtocolTransport * driver, + bool resetOccurred ); + + // The sCheckWakeupResetOccur method is used to safely check member variables + // behind the command gate. + static void sCheckWakeupResetOccurred ( IOATAPIProtocolTransport * driver, + bool * resetOccurred ); + + // The DidWakeupResetOccur method is used to safely find out if a reset + // occurred while we were asleep. + virtual bool CheckWakeupResetOccurred ( void ); + + // The WakeupResetOccurred method is used to safely set/clear the reset flag. + virtual void SetWakeupResetOccurred ( bool resetOccurred ); + + // The SetPIOTransferMode method is used to set the programmed input-output (PIO) + // transfer mode. The highest value reported by the device is used. + virtual IOReturn SetPIOTransferMode ( IOATACommand * cmd, bool forceSync ); + + // The SetDMATransferMode method is used to set the direct memory access (DMA) + // transfer mode. The highest value reported by the device is used. + virtual IOReturn SetDMATransferMode ( IOATACommand * cmd, bool forceSync ); + + // The IdentifyAndConfigureATAPIDevice method is called to correctly identify + // and configure an ATAPI device. + virtual IOReturn IdentifyAndConfigureATAPIDevice ( void ); + + // The ConfigureATAPIDevice method is called to correctly configure the ATAPI + // device. It currently configures any PIO/DMA/UDMA transfer modes but may be + // expanded in the future. + virtual IOReturn ConfigureATAPIDevice ( void ); + + // The ReconfigureATAPIDevice method is called to correctly reconfigure the ATAPI + // device after a reset event has occurred (bus reset or device reset). It + // currently reconfigures any PIO/DMA/UDMA transfer modes but may be expanded in + // the future. + virtual IOReturn ReconfigureATAPIDevice ( void ); + + // The IdentifyATAPIDevice method is called to correctly identify the ATAPI + // device. It currently issues the Identify ATAPI Device packet command and + // uses the data to correctly configure the device. + virtual IOReturn IdentifyATAPIDevice ( void ); + + // The ResetATAPIDevice method is called to issue a Device Reset (also known + // as a SOFT RESET). This method will only reset the specified device on the + // bus. + virtual IOReturn ResetATAPIDevice ( void ); + + // The SendATASleepCommand method is called to put an ATAPI drive in sleep + // mode. + virtual IOReturn SendATASleepCommand ( void ); + + // The EnablePollingOfStatusRegister method is called to set up a timer for + // the call to PollStatusRegister. It is called when the SCSI Application Layer + // driver wants to enable low-power polling and after a poll which does not + // see a change in the register status. + virtual void EnablePollingOfStatusRegister ( void ); + + // The DisablePollingOfStatusRegister method is called to cancel any thread + // call which is doing a poll and drop the retain count on the object. + virtual void DisablePollingOfStatusRegister ( void ); + + // The PollStatusRegister method is used to do low-power polling on drives which + // support it. This feature is enabled by the SCSI Application Layer driver. + virtual void PollStatusRegister ( void * refCon ); + + // Callback method for the polling of the status register. + virtual void PollStatusRegisterCallback ( IOATACommand * cmd ); + + // The TurnDrivePowerOff method is called to turn power to the drive OFF + IOReturn TurnDrivePowerOff ( void ); + + IOReturn SendCommand ( IOATACommand * cmd ); + IOReturn GatedWaitForRequest ( void * data ); + +private: + + // Binary Compatibility reserved method space + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 1 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 2 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 3 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 4 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 5 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 6 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 7 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 8 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 9 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 10 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 11 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 12 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 13 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 14 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 15 ); + OSMetaClassDeclareReservedUnused ( IOATAPIProtocolTransport, 16 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_IO_ATAPI_PROTOCOL_TRANSPORT_H_ */ \ No newline at end of file diff --git a/i386/include/IOKit/storage/ata/IOATAStorageDefines.h b/i386/include/IOKit/storage/ata/IOATAStorageDefines.h new file mode 100644 index 0000000..fdac8b3 --- /dev/null +++ b/i386/include/IOKit/storage/ata/IOATAStorageDefines.h @@ -0,0 +1,321 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IO_ATA_STORAGE_DEFINES_H_ +#define _IOKIT_IO_ATA_STORAGE_DEFINES_H_ + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Important word offsets in device identify data as + * defined in ATA-5 standard + */ + +enum +{ + kATAIdentifyConfiguration = 0, + kATAIdentifyLogicalCylinderCount = 1, + kATAIdentifyLogicalHeadCount = 3, + kATAIdentifySectorsPerTrack = 6, + kATAIdentifySerialNumber = 10, + kATAIdentifyFirmwareRevision = 23, + kATAIdentifyModelNumber = 27, + kATAIdentifyMultipleSectorCount = 47, + kATAIdentifyDriveCapabilities = 49, + kATAIdentifyDriveCapabilitiesExtended = 50, + kATAIdentifyPIOTiming = 51, + kATAIdentifyExtendedInfoSupport = 53, + kATAIdentifyCurrentCylinders = 54, + kATAIdentifyCurrentHeads = 55, + kATAIdentifyCurrentSectors = 56, + kATAIdentifyCurrentCapacity = 57, + kATAIdentifyCurrentMultipleSectors = 59, + kATAIdentifyLBACapacity = 60, + kATAIdentifySingleWordDMA = 62, + kATAIdentifyMultiWordDMA = 63, + kATAIdentifyAdvancedPIOModes = 64, + kATAIdentifyMinMultiWordDMATime = 65, + kATAIdentifyRecommendedMultiWordDMATime = 66, + kATAIdentifyMinPIOTime = 67, + kATAIdentifyMinPIOTimeWithIORDY = 68, + kATAIdentifyQueueDepth = 75, + kATAIdentifyMajorVersion = 80, + kATAIdentifyMinorVersion = 81, + kATAIdentifyCommandSetSupported = 82, + kATAIdentifyCommandSetSupported2 = 83, + kATAIdentifyCommandExtension1 = 84, + kATAIdentifyCommandExtension2 = 85, + kATAIdentifyCommandsEnabled = 86, + kATAIdentifyCommandsDefault = 87, + kATAIdentifyUltraDMASupported = 88, + kATAIdentifyPhysicalLogicalSectorSize = 106, + kATAIdentifyWordsPerLogicalSector1 = 117, + kATAIdentifyWordsPerLogicalSector2 = 118, + kATAIdentifyLogicalSectorAlignment = 209, + kATAIdentifyIntegrity = 255 +}; + + +/* + * Important bits in device identify data + * as defined in ATA-5 standard + */ + +enum +{ + // Configuration field (word 0) + kFixedDeviceBit = 6, // Fixed disk indicator bit + kRemoveableMediaBit = 7, // Removable media indicator bit + kNonMagneticDriveBit = 15, // Non-magnetic drive indicator bit + + kFixedDeviceMask = (1 << kFixedDeviceBit), // Mask for fixed disk indicator + kRemoveableMediaMask = (1 << kRemoveableMediaBit), // Mask for removable media indicator + kNonMagneticDriveMask = (1 << kNonMagneticDriveBit), // Mask for non-magnetic drive indicator + + // Capabilities field (word 49) + kDMABit = 8, // DMA supported bit + kLBABit = 9, // LBA supported bit + kIORDYDisableBit = 10, // IORDY can be disabled bit + kIORDYBit = 11, // IORDY supported bit + kStandbyTimerBit = 13, // Standby timer supported bit + + kDMASupportedMask = (1 << kDMABit), // Mask for DMA supported + kLBASupportedMask = (1 << kLBABit), // Mask for LBA supported + kDMADisableMask = (1 << kIORDYDisableBit), // Mask for DMA supported + kIORDYSupportedMask = (1 << kIORDYBit), // Mask for IORDY supported + kStandbySupportedMask = (1 << kStandbyTimerBit), // Mask for Standby Timer supported + + // Extensions field (word 53) + kCurFieldsValidBit = 0, // Bit to show words 54-58 are valid + kExtFieldsValidBit = 1, // Bit to show words 64-70 are valid + kCurFieldsValidMask = (1 << kCurFieldsValidBit), // Mask for current fields valid + kExtFieldsValidMask = (1 << kExtFieldsValidBit), // Extension word valid + + // Advanced PIO Transfer Modes field (word 64) + kMode3Bit = 0, // Bit to indicate mode 3 is supported + kMode3Mask = (1 << kMode3Bit), // Mask for mode 3 support + + // Integrity of Identify data (word 255) + kChecksumValidCookie = 0xA5 // Bits 7:0 if device supports feature + +}; + + +/* String size constants */ +enum +{ + kSizeOfATAModelString = 40, + kSizeOfATARevisionString = 8 +}; + +/* ATA Command timeout constants ( in milliseconds ) */ +enum +{ + kATATimeout10Seconds = 10000, + kATATimeout30Seconds = 30000, + kATATimeout45Seconds = 45000, + kATATimeout1Minute = 60000, + kATADefaultTimeout = kATATimeout30Seconds +}; + + +/* Retry constants */ +enum +{ + kATAZeroRetries = 0, + kATADefaultRetries = 4 +}; + +/* max number of blocks supported in ATA transaction */ +enum +{ + kIOATASectorCount8Bit = 8, + kIOATASectorCount16Bit = 16 +}; + +enum +{ + kIOATAMaximumBlockCount8Bit = (1 << kIOATASectorCount8Bit), + kIOATAMaximumBlockCount16Bit = (1 << kIOATASectorCount16Bit), + + // For backwards compatibility + kIOATAMaxBlocksPerXfer = kIOATAMaximumBlockCount8Bit +}; + + + +/* Power Management time constants (in seconds) */ +enum +{ + kSecondsInAMinute = 60, + k5Minutes = 5 * kSecondsInAMinute +}; + +/* Bits for features published in Word 82 of device identify data */ +enum +{ + kATASupportsSMARTBit = 0, + kATASupportsPowerManagementBit = 3, + kATASupportsWriteCacheBit = 5 +}; + +/* Masks for features published in Word 82 of device identify data */ +enum +{ + kATASupportsSMARTMask = (1 << kATASupportsSMARTBit), + kATASupportsPowerManagementMask = (1 << kATASupportsPowerManagementBit), + kATASupportsWriteCacheMask = (1 << kATASupportsWriteCacheBit) +}; + +/* Bits for features published in Word 83 of device identify data */ +enum +{ + kATASupportsCompactFlashBit = 2, + kATASupportsAdvancedPowerManagementBit = 3, + + kATASupports48BitAddressingBit = 10, + + kATASupportsFlushCacheBit = 12, + kATASupportsFlushCacheExtendedBit = 13 +}; + +/* Masks for features published in Word 83 of device identify data */ +enum +{ + kATASupportsCompactFlashMask = (1 << kATASupportsCompactFlashBit), + kATASupportsAdvancedPowerManagementMask = (1 << kATASupportsAdvancedPowerManagementBit), + + kATASupports48BitAddressingMask = (1 << kATASupports48BitAddressingBit), + + kATASupportsFlushCacheMask = (1 << kATASupportsFlushCacheBit), + kATASupportsFlushCacheExtendedMask = (1 << kATASupportsFlushCacheExtendedBit), + + // Mask to ensure data is valid + kIdentifyWordValidationMask = 0xC000, + kIdentifyWordValid = 0x4000 +}; + +/* Bits for features published in Word 84 of device identify data */ +enum +{ + kATAForceUnitAccessFeatureBit = 6, +}; + +/* Masks for features published in Word 84 of device identify data */ +enum +{ + kATAForceUnitAccessFeatureMask = (1 << kATAForceUnitAccessFeatureBit), +}; + +/* Bits for features published in Word 85 of device identify data */ +enum +{ + kATAWriteCacheEnabledBit = 5 +}; + +/* Masks for features published in Word 85 of device identify data */ +enum +{ + kATAWriteCacheEnabledMask = (1 << kATAWriteCacheEnabledBit) +}; + + +/* Bits for features published in Word 106 of device identify data */ +enum +{ + kATAPhysicalLogicalEnabledBit0 = 15, + kATAPhysicalLogicalEnabledBit1 = 14, + kATAMultipleLogicalSectorsBit = 13, + kATAValidLogicalSectorSizeBit = 12 +}; + +/* Masks for features published in Word 106 of device identify data */ +enum +{ + kATAPhysicalLogicalEnabledMask = (1 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1), + kATAPhysicalLogicalEnabledValue = (0 << kATAPhysicalLogicalEnabledBit0) | (1 << kATAPhysicalLogicalEnabledBit1), + kATAMultipleLogicalSectorsMask = (1 << kATAMultipleLogicalSectorsBit), + kATAValidLogicalSectorSizeMask = (1 << kATAValidLogicalSectorSizeBit), + kATAPhysicalSectorSizeMask = 0xF, + kATALogicalSectorAlignmentMask = 0x3FFF +}; + +// Property table keys +#define kIOATASupportedFeaturesKey "ATA Features" + +/* ATA supported features */ +enum +{ + kIOATAFeaturePowerManagement = 0x01, /* OBSOLETE */ + kIOATAFeatureWriteCache = 0x02, /* OBSOLETE */ + kIOATAFeatureAdvancedPowerManagement = 0x04, + kIOATAFeatureCompactFlash = 0x08, + kIOATAFeature48BitLBA = 0x10, + kIOATAFeatureSMART = 0x20 +}; + +/* ATA Advanced Power Management settings (valid settings range from 1-254), +the settings below are the more common settings */ +enum +{ + kIOATAMaxPerformance = 0xFE, + kIOATADefaultPerformance = 0x80, + kIOATAMaxPowerSavings = 0x01 +}; + +/* ATA Transfer Mode bit masks */ +enum +{ + kATAEnableUltraDMAModeMask = 0x40, + kATAEnableMultiWordDMAModeMask = 0x20, + kATAEnablePIOModeMask = 0x08 +}; + + +typedef uint32_t ATAOperationType; +enum +{ + kATAOperationTypeRead = 0, + kATAOperationTypeWrite = 1, + kATAOperationTypeFlushCache = 2, + kATAOperationTypeSMART = 3, + kATAOperationTypeConfiguration = 4, + kATAOperationTypePowerManagement = 5, + kATAOperationTypeSMS = 6 +}; + +#if defined(KERNEL) + +typedef struct __ATAIORequest * ATARequestIdentifier; + +#endif // defined(KERNEL) + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IO_ATA_STORAGE_DEFINES_H_ */ diff --git a/i386/include/IOKit/stream/.svn/all-wcprops b/i386/include/IOKit/stream/.svn/all-wcprops new file mode 100644 index 0000000..778b68c --- /dev/null +++ b/i386/include/IOKit/stream/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/stream +END +IOStreamShared.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/stream/IOStreamShared.h +END +IOStreamUserClient.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/stream/IOStreamUserClient.h +END +IOStream.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/stream/IOStream.h +END +IOStreamFamily.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/stream/IOStreamFamily.h +END diff --git a/i386/include/IOKit/stream/.svn/entries b/i386/include/IOKit/stream/.svn/entries new file mode 100644 index 0000000..a9686d8 --- /dev/null +++ b/i386/include/IOKit/stream/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/stream +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOStreamShared.h +file + + + + +2013-08-27T23:54:12.000000Z +925f10b148830bcae4312aa8a7ee2fea +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4647 + +IOStreamUserClient.h +file + + + + +2013-08-27T23:54:12.000000Z +bdc9cf99229f3972604d4952b63a3aa2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2502 + +IOStream.h +file + + + + +2013-08-27T23:54:12.000000Z +3b670008c3567c9dc3699542b69dca37 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +21734 + +IOStreamFamily.h +file + + + + +2013-08-27T23:54:12.000000Z +f66e1be35cc893be907e91b6bc0f76e7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +256 + diff --git a/i386/include/IOKit/stream/.svn/text-base/IOStream.h.svn-base b/i386/include/IOKit/stream/.svn/text-base/IOStream.h.svn-base new file mode 100644 index 0000000..01efad4 --- /dev/null +++ b/i386/include/IOKit/stream/.svn/text-base/IOStream.h.svn-base @@ -0,0 +1,609 @@ +/* + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined(__IOKIT_IOSTREAM_H) +#define __IOKIT_IOSTREAM_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOUserClient.h> + +#include <IOKit/stream/IOStreamShared.h> + +/*! + @header IOStream.h + Definitions for IOStream family. + */ + +class IOStreamBuffer; + +/*! + @class IOStream + @abstract + A class representing a stream of data buffers passed from kernel to + user space and back again. + @discussion + The IOStream class defines a mechanism for moving buffers of data from + kernel space to user space or vice-versa. The policy for which direction + the data flows and the nature of the data is left up the the implementer + of the driver which uses IOStream. + + Although it is expected that the client of an IOStream will be in user space, + this is not required. + + References to "output" mean "from the IOStream to the user client", and + "input" means "from the user client to the IOStream." + + */ + +class IOStream : public IOService +{ + OSDeclareDefaultStructors(IOStream); + + protected: + OSArray * _buffers; // IOStreamBuffer objects in this stream + + IOItemCount _queueCount; // Number of entries for the queues + + IOMemoryDescriptor * _inputQueueDescriptor; + IOMemoryMap * _inputQueueMap; + + IOMemoryDescriptor * _outputQueueDescriptor; + IOMemoryMap * _outputQueueMap; + + IOStreamBufferQueue * _outputQueue; // Shared memory for buffers out to user space + IOStreamBufferQueue * _inputQueue; // Shared memory for buffers in from user space + + mach_port_t _outputPort; + mach_port_t _inputPort; + + OSArray * _memoryMaps; // Maps for data queues + + IOStreamMode _streamMode; + + public: + + /*! + @functiongroup Creating IOStream objects + */ + + /*! + @function withBuffers + @param mode The initial mode of the stream, either output, input, or input/output. + @param queueLength The nuber of queue entries to reserve in the input and output queue. + Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the stream. + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + */ + + static IOStream *withBuffers(OSArray *buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary *properties = 0); + + virtual bool init(OSDictionary *properties = 0); + + /*! + @function initWithBuffers + @param mode The initial mode of the stream, either output, input, or input/output. + @param queueLength The nuber of queue entries to reserve in the input and output queue. + Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the stream. + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + */ + virtual bool initWithBuffers(OSArray *buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary *properties = 0); + + /*! + @function free + */ + virtual void free(void); + + /*! + @functiongroup Opening and closing streams + */ + + /*! + @function handleOpen + @abstract The handleOpen() method relies on the default IOService behavior + to ensure that + only one client has the stream open at a time. + The shared input and output queues are created at open time. + @param options + @param arg + */ + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + + /*! + @function handleClose + @abstract The handleClose method destroys the shared input and output + queues. + @param options + */ + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + /*! + @functiongroup Managing shared queues + */ + + /*! + @function createQueues + @abstract Creates the shared input and output queues, without regard + to whether the stream is open or not. + Normally this is called by handleOpen(). + @param queueLength + @param options + @result Returns kIOReturnSuccess if the queues were successfully created. + */ + virtual IOReturn createQueues( IOItemCount queueLength = 0, IOOptionBits options = 0 ); + + /*! + @function destroyQueues + @abstract Releases the shared input and output queues. + @result Returns kIOReturnSuccess if the queues were successfully destroyed. + The queues cannot be destroyed while the stream is open by a client. + */ + virtual IOReturn destroyQueues( void ); + + /*! + @function getOutputQueue + @result A pointer to the output IOStreamBufferQueue structure for the stream, + or NULL if the stream is not open and the queue has not been created yet. + */ + virtual IOStreamBufferQueue *getOutputQueue(void); // get shared-memory output queue + + /*! + @function getOutputQueueMemoryDescriptor + @result An IOMemoryDescriptor object repesenting the shared memory + output queue buffer. + */ + virtual IOMemoryDescriptor *getOutputQueueMemoryDescriptor(void); + + /*! + @function getInputQueue + @result A pointer to the input IOStreamBufferQueue structure for the stream, + or NULL if the stream is not open and the queue has not been created yet. + */ + virtual IOStreamBufferQueue *getInputQueue(void); // get shared-memory input queue + + /*! + @function getInputQueueMemoryDescriptor + @result An IOMemoryDescriptor object repesenting the shared memory + input queue buffer. + */ + virtual IOMemoryDescriptor *getInputQueueMemoryDescriptor(void); + + + /*! + @functiongroup Managing buffers in an IOStream + */ + + /*! + @function addBuffer + @abstract Add a buffer to an IOStream. + @param buffer + @discussion + Adds an IOStreamBuffer to an IOStream. It will be added to the end + of the buffer array, so the buffer ID of existing buffers will not change. + */ + virtual IOReturn addBuffer(IOStreamBuffer *buffer); // add a new buffer to the stream + + /*! + @function addBuffers + @param buffers + @result + */ + virtual IOReturn addBuffers(OSArray *buffers); + + /*! + @function removeBuffer + @param buffer A pointer to an IOStreamBuffer object in the stream. + @result Returns kIOReturnSuccess if the buffer was removed, or kIOReturnNotFound + if the buffer was not in this stream. + @abstract + Removes a buffer from the stream. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + */ + virtual IOReturn removeBuffer(IOStreamBuffer *buffer); + + /*! + @function removeBuffer + @param bufferID The ID of the buffer to remove. + @result Returns kIOReturnSuccess if the buffer was removed. + @abstract + Removes a buffer from the stream. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + */ + + virtual IOReturn removeBuffer(IOStreamBufferID bufferID); + + /*! + @function removeAllBuffers + @result + */ + virtual IOReturn removeAllBuffers( void ); + + /*! + @function removeAllBuffers + @result Returns kIOReturnSuccess if all the buffers were successfully + removed. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + + */ + virtual IOItemCount getBufferCount( void ); + + /*! + @function getBuffers + @abstract Get an array containing all the buffers in the stream. + @discussion + Returns an OSArray containing all the buffers in the stream in order of their buffer ID. + */ + virtual OSArray *getBuffers( void ); + + + /*! + @function getBufferWithID + @param bufferID + The ID of the buffer to get. + @result + A pointer to an IOStreamBuffer object, or NULL if the + buffer ID was invalid for this stream. + */ + + virtual IOStreamBuffer *getBufferWithID(IOStreamBufferID bufferID); + + /*! + @functiongroup Managing notification ports + */ + + /*! + @function getInputPort + @abstract Get the Mach port used to receive notifications + from user space that a buffer has been added to the input queue. + */ + virtual mach_port_t getInputPort(void); + + /*! + @function setInputPort + @abstract Set the Mach port used to receive notifications from + user space that a buffer has been added to the input queue. + @param port + + */ + virtual IOReturn setInputPort(mach_port_t port); + + /*! + @function getOutputPort + @abstract Get the Mach port used to send notifications to user space + that a buffer has been added to the output queue. + */ + virtual mach_port_t getOutputPort(void); + + /*! + @function setOutputPort + @abstract Set the Mach port used to send notifications to user space + that a buffer has been added to the output queue. + @param port + */ + virtual IOReturn setOutputPort(mach_port_t port); + + /*! + @function sendOutputNotification + @abstract Send a notification to the user client that data is available + for reading on the output queue. This will result in the user's output + handler being called, if they registered one. + @result Returns kIOReturnSuccess if the notification was successfully sent. + */ + virtual IOReturn sendOutputNotification(void); + + /*! + @functiongroup Queueing and dequeueing buffers + */ + + /*! + @function enqueueOutputBuffer + @abstract A convenience method for enqueueing a buffer. + @param buffer + @param dataOffset + @param dataLength + @param controlOffset + @param controlLength + @result + */ + virtual IOReturn enqueueOutputBuffer(IOStreamBuffer *buffer, + IOByteCount dataOffset = 0, + IOByteCount dataLength = 0, + IOByteCount controlOffset = 0, + IOByteCount controlLength = 0); + + + /*! + @function enqueueOutputEntry + @param entry + @result + */ + virtual IOReturn enqueueOutputEntry( IOStreamBufferQueueEntry *entry ); + + /*! + @function dequeueInputEntry + @param entry + @result + */ + virtual IOReturn dequeueInputEntry( IOStreamBufferQueueEntry *entry ); + + /*! + @functiongroup Managing notifications + */ + + /*! + @function inputCallback + @abstract Input callback function to be implemented by a subclass; + @param token + A 32-bit token value that can be used by convention to communicate + from user space to the stream. The semantics of this value are + defined by the IOStream subclass. + @discussion + The inputCallback() method is called as a result of a fast trap + from user space. It is called on the same thread as the user request, + but the subclass should implement this call as a notification sent + to a workloop so that the request is asynchronous. + */ + virtual void inputCallback( UInt32 token ); + + /*! + @function inputSyncCallback + @abstract Input callback function to be implemented by a subclass. + @param token + A 32-bit token value that can be used by convention to communicate + from user space to the stream. The semantics of this value are + defined by the IOStream subclass. + @discussion + The inputSyncCallback() method is called as a result of a fast trap + from user space. It is called on the same thread as the user request, + so no context switch is necessary. + */ + virtual void inputSyncCallback( UInt32 token ); + + /*! + @functiongroup Stream control + */ + + /*! + @function getStreamMode + @abstract Returns the mode of the stream, either input or output. + @result The mode of the stream, either kIOStreamModeInput + (from user space to kernel space) or the default + kIOStreamModeOutput (from kernel space to user space). + */ + virtual IOStreamMode getStreamMode(void); + + /*! + @function setStreamMode + @abstract Sets the mode of the stream, either input or output. + @discussion Subclasses may define whether it is possible + to change the mode of a stream. + */ + virtual IOReturn setStreamMode(IOStreamMode mode); + + /*! + @function startStream + @abstract Start sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn startStream(void); + + /*! + @function stopStream + @abstract Stop sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully stopped. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn stopStream(void); + + /*! + @function suspendStream + @abstract Temporarily suspend data flow on the stream. + @result Returns kIOReturnSuccess if the stream was successfully suspended. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn suspendStream(void); + + /*! + @functiongroup Managing user clients + */ + + /*! + @function newUserClient + @abstract See the documentation for the IOService method newUserClient. + */ + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + + /* Reserved slots */ + + OSMetaClassDeclareReservedUnused(IOStream, 0); + OSMetaClassDeclareReservedUnused(IOStream, 1); + OSMetaClassDeclareReservedUnused(IOStream, 2); + OSMetaClassDeclareReservedUnused(IOStream, 3); + OSMetaClassDeclareReservedUnused(IOStream, 4); + OSMetaClassDeclareReservedUnused(IOStream, 5); + OSMetaClassDeclareReservedUnused(IOStream, 6); + OSMetaClassDeclareReservedUnused(IOStream, 7); + OSMetaClassDeclareReservedUnused(IOStream, 8); + OSMetaClassDeclareReservedUnused(IOStream, 9); + OSMetaClassDeclareReservedUnused(IOStream, 10); + OSMetaClassDeclareReservedUnused(IOStream, 11); + OSMetaClassDeclareReservedUnused(IOStream, 12); + OSMetaClassDeclareReservedUnused(IOStream, 13); + OSMetaClassDeclareReservedUnused(IOStream, 14); + OSMetaClassDeclareReservedUnused(IOStream, 15); + OSMetaClassDeclareReservedUnused(IOStream, 16); + OSMetaClassDeclareReservedUnused(IOStream, 17); + OSMetaClassDeclareReservedUnused(IOStream, 18); + OSMetaClassDeclareReservedUnused(IOStream, 19); + OSMetaClassDeclareReservedUnused(IOStream, 20); + OSMetaClassDeclareReservedUnused(IOStream, 21); + OSMetaClassDeclareReservedUnused(IOStream, 22); + OSMetaClassDeclareReservedUnused(IOStream, 23); + OSMetaClassDeclareReservedUnused(IOStream, 24); + OSMetaClassDeclareReservedUnused(IOStream, 25); + OSMetaClassDeclareReservedUnused(IOStream, 26); + OSMetaClassDeclareReservedUnused(IOStream, 27); + OSMetaClassDeclareReservedUnused(IOStream, 28); + OSMetaClassDeclareReservedUnused(IOStream, 29); + OSMetaClassDeclareReservedUnused(IOStream, 30); + OSMetaClassDeclareReservedUnused(IOStream, 31); + +}; + + +/*! + @class IOStreamBuffer + A class representing a data buffer that is part of an IOStream. + */ + +class IOStreamBuffer : public OSObject +{ + OSDeclareDefaultStructors(IOStreamBuffer); + +protected: + IOMemoryDescriptor * _dataBuffer; // The data buffer is expected to be filled by hardware. + IOMemoryDescriptor * _controlBuffer; // The control buffer is expected to be defined by the hardware driver. + + IOStreamBufferID _bufferID; // Client handle for this buffer. + + OSArray * _clientMemoryMaps; // Maps for clients who are sharing these buffers. + + SInt32 _clientReferenceCount; // Count of client uses of this buffer. May be negative. + +public: + /*! + @function initWithMemoryDescriptors + */ + virtual bool initWithMemoryDescriptors(IOMemoryDescriptor *dataBuffer, + IOMemoryDescriptor *controlBuffer, + IOStreamBufferID bufferID = 0); + + /*! + @function withMemoryDescriptors + */ + static IOStreamBuffer *withMemoryDescriptors(IOMemoryDescriptor *dataBuffer, + IOMemoryDescriptor *controlBuffer, + IOStreamBufferID bufferID = 0); + + virtual void free(void); + + /*! + @function getBufferID + @abstract Gets the buffer identifier for the IOStreamBuffer object. + @discussion The buffer identifier is unique across all buffers in a stream. + */ + virtual IOStreamBufferID getBufferID(void); + + /*! + @function setBufferID + @abstract Sets the buffer identifier for the IOStreamBuffer object. + */ + + virtual void setBufferID( IOStreamBufferID bufferID ); + + /*! + @function setDataBuffer + @abstract Sets the data buffer for the IOStreamBuffer object. + */ + virtual void setDataBuffer(IOMemoryDescriptor *dataBuffer); + + /*! + @function setControlBuffer + @abstract Sets the control buffer for the IOStreamBuffer object. + */ + virtual void setControlBuffer(IOMemoryDescriptor *controlBuffer); + + /*! + @function getDataBuffer + @result A pointer to the IOMemoryDescriptor for the data buffer. + */ + virtual IOMemoryDescriptor *getDataBuffer(void); + + /*! + @function getControlBuffer + @result A pointer to the IOMemoryDescriptor for the control buffer. + */ + virtual IOMemoryDescriptor *getControlBuffer(void); + + /*! + @function getClientReferenceCount + @result The count of client references to this buffer. It may be positive + or negative, depending on whether the client is sending data into the kernel, + or the kernel is sending data out to the client. + */ + virtual SInt32 getClientReferenceCount( void ); + + /*! + @function sendClientReference + @param offset The offset in the buffer of the data sent to the client. + @param length The length of the data sent to the client. + @result The new client reference count. + @abstract + */ + virtual SInt32 sendClientReference( IOByteCount offset = 0, IOByteCount length = 0 ); + + /*! + @function receiveClientReference + @param offset The offset in the buffer of the data from the client. + @param length The length of the data from the client. + @abstract + */ + virtual SInt32 receiveClientReference( IOByteCount offset = 0, IOByteCount length = 0 ); + + /* Reserved slots */ + + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 0); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 1); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 2); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 3); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 4); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 5); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 6); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 7); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 8); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 9); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 10); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 11); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 12); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 13); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 14); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 15); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 16); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 17); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 18); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 19); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 20); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 21); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 22); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 23); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 24); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 25); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 26); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 27); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 28); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 29); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 30); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 31); + +}; + +#endif /* ! __IOKIT_IOSTREAM_H */ + diff --git a/i386/include/IOKit/stream/.svn/text-base/IOStreamFamily.h.svn-base b/i386/include/IOKit/stream/.svn/text-base/IOStreamFamily.h.svn-base new file mode 100644 index 0000000..a4eb7f0 --- /dev/null +++ b/i386/include/IOKit/stream/.svn/text-base/IOStreamFamily.h.svn-base @@ -0,0 +1,13 @@ +/* + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#ifndef __IOKIT_IOSTREAMFAMILY_H +#define __IOKIT_IOSTREAMFAMILY_H + +#include <IOKit/stream/IOStream.h> +#include <IOKit/stream/IOStreamShared.h> + + +#endif /* !__IOKIT_IOSTREAMFAMILY_H */ diff --git a/i386/include/IOKit/stream/.svn/text-base/IOStreamShared.h.svn-base b/i386/include/IOKit/stream/.svn/text-base/IOStreamShared.h.svn-base new file mode 100644 index 0000000..5b2c0a3 --- /dev/null +++ b/i386/include/IOKit/stream/.svn/text-base/IOStreamShared.h.svn-base @@ -0,0 +1,175 @@ +/* + * IOStreamShared.h + * IOStreamFamily + * + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined(__IOKIT_IOSTREAMSHARED_H) +#define __IOKIT_IOSTREAMSHARED_H + +#include <sys/cdefs.h> + +#include <IOKit/IOTypes.h> + +/*! + @header IOStreamShared.h + IOStream definitions shared between kernel and user space. + */ + +__BEGIN_DECLS + +// Buffer numbers are guaranteed to go from 0 to bufferCount - 1. +/*! + @typedef IOStreamBufferID + */ +typedef UInt32 IOStreamBufferID; +#define kIOStreamBufferIDInvalid (~0) + +// This is the header for the shared-memory queue used to send buffer notifications +// from kernel to user space or vice versa. + +// Queue entry in input or output queue + +#ifdef __cplusplus + +/*! + @struct IOStreamBufferQueueEntry + @field bufferID The ID of the buffer passed in this queue entry. + @field dataLength The length of the valid data in the buffer. + @field reserved Reserved for future use. +*/ + +struct IOStreamBufferQueueEntry { + IOStreamBufferID bufferID; + UInt32 dataOffset; + UInt32 dataLength; + UInt32 controlOffset; + UInt32 controlLength; + UInt32 reserved[3]; +}; + + +/*! + @struct IOStreamBufferQueue + @field entryCount The number of queue entries in the queue. + @field headIndex The index of the next queue slot that will be filled in by the queue writer. + @field tailIndex The index of the next queue slot that can be read by the queue reader. + @field reserved Reserved for future use. + @field queue The array of queue entries. + */ + +struct IOStreamBufferQueue { + UInt32 entryCount; + volatile UInt32 headIndex; + volatile UInt32 tailIndex; + UInt32 reserved; + IOStreamBufferQueueEntry queue[0]; +}; + +#else + +typedef struct __IOStreamBufferQueueEntry { + IOStreamBufferID bufferID; + UInt32 dataOffset; + UInt32 dataLength; + UInt32 controlOffset; + UInt32 controlLength; + UInt32 reserved[3]; +} IOStreamBufferQueueEntry; + +typedef struct __IOStreamBufferQueue { + UInt32 entryCount; + volatile UInt32 headIndex; + volatile UInt32 tailIndex; + UInt32 reserved; + IOStreamBufferQueueEntry queue[0]; +} IOStreamBufferQueue; + +#endif + +/*! + @enum Memory mapping types + @constant kIOStreamMemoryTypeOutputQueue + @constant kIOStreamMemoryTypeInputQueue + @constant kIOStreamMemoryTypeBufferData + @constant kIOStreamMemoryTypeBufferControl + @constant kIOStreamBufferIDMask + @constant kIOStreamMemoryTypeMask + @abstract Memory types used with IOConnectMapMemory(). + */ +enum { + kIOStreamMemoryTypeOutputQueue = 0x10000000, + kIOStreamMemoryTypeInputQueue = 0x20000000, + kIOStreamMemoryTypeBufferData = 0x30000000, + kIOStreamMemoryTypeBufferControl = 0x40000000, + kIOStreamBufferIDMask = 0x0FFFFFFF, + kIOStreamMemoryTypeMask = 0xF0000000 +}; + +/*! + @enum Mach port types + @constant kIOStreamPortTypeOutput + @constant kIOStreamPortTypeInput + @abstract Port types used with IOConnectSetNotificationPort(). + */ +enum { + kIOStreamPortTypeOutput, + kIOStreamPortTypeInput +}; + +/*! + @enum IOStream open options + */ + +enum { + kIOStreamOptionOpenExclusive = 0x00010000, + kIOStreamOptionOpenShared = 0x00020000 +}; + +/*! + @enum User client methods + @constant kIOStreamMethodOpen + @constant kIOStreamMethodClose + @constant kIOStreamMethodStart + @constant kIOStreamMethodStop + @constant kIOStreamMethodSuspend + @constant kIOStreamMethodGetMode + @constant kIOStreamMethodSetMode + + @abstract Client method numbers used with IOConnectMethod...() functions. + */ +enum { + kIOStreamMethodOpen, + kIOStreamMethodClose, + kIOStreamMethodStart, + kIOStreamMethodStop, + kIOStreamMethodSuspend, + kIOStreamMethodGetMode, + kIOStreamMethodSetMode, + kIOStreamMethodGetBufferCount +}; + +/*! + @enum User client traps + @constant kIOStreamEnqueueInputTrap + @constant kIOStreamEnqueueInputSyncTrap + @abstract Client trap numbers used with IOConnectTrap..() functions. + */ +enum { + kIOStreamEnqueueInputTrap, + kIOStreamEnqueueInputSyncTrap +}; + +typedef enum { + kIOStreamModeInput, // From user to kernel space + kIOStreamModeOutput, // From kernel to user space + kIOStreamModeInputOutput // bidirectional +} IOStreamMode; + + +__END_DECLS + +#endif /* ! __IOKIT_IOSTREAMSHARED_H */ + diff --git a/i386/include/IOKit/stream/.svn/text-base/IOStreamUserClient.h.svn-base b/i386/include/IOKit/stream/.svn/text-base/IOStreamUserClient.h.svn-base new file mode 100644 index 0000000..887575a --- /dev/null +++ b/i386/include/IOKit/stream/.svn/text-base/IOStreamUserClient.h.svn-base @@ -0,0 +1,76 @@ +/* + * IOStreamUserClient.h + * IOStreamFamily + * + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined( __IOKIT_IOSTREAMUSERCLIENT_H ) +#define __IOKIT_IOSTREAMUSERCLIENT_H + + +#include <IOKit/IOUserClient.h> + +#include <IOKit/stream/IOStreamShared.h> +#include <IOKit/stream/IOStream.h> + +class IOStreamUserClient : public IOUserClient +{ + OSDeclareDefaultStructors( IOStreamUserClient ) + +protected: + IOStream * _owner; + task_t _task; + +public: + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type, + OSDictionary * properties); + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + virtual IOService * getService( void ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, UInt32 refCon ); + + virtual IOReturn connectClient( IOUserClient * client ); + + virtual IOExternalMethod * getTargetAndMethodForIndex( + IOService ** targetP, UInt32 index ); + + virtual IOExternalTrap * + getTargetAndTrapForIndex( IOService **targetP, UInt32 index ); + + virtual IOReturn clientMemoryForType( UInt32 type, + IOOptionBits * options, + IOMemoryDescriptor ** memory ); + + virtual bool start( IOService * provider ); + + +protected: + virtual IOReturn openMethod( char * dataIn, char * dataOut, + IOByteCount inputSize, IOByteCount * outputSize ); + virtual IOReturn closeMethod( void ); + virtual IOReturn startMethod( void ); + virtual IOReturn stopMethod( void ); + virtual IOReturn suspendMethod( void ); + virtual IOReturn getModeMethod( char * dataOut, + IOByteCount * outputSize ); + virtual IOReturn setModeMethod( char * dataIn, + IOByteCount inputSize ); + virtual IOReturn getBufferCountMethod( char * dataOut, + IOByteCount * outputSize ); + + virtual IOReturn inputTrap( UInt32 token ); + virtual IOReturn inputSyncTrap( UInt32 token ); + +}; + +#endif /* ! __IOKIT_IOSTREAMUSERCLIENT_H */ + diff --git a/i386/include/IOKit/stream/IOStream.h b/i386/include/IOKit/stream/IOStream.h new file mode 100644 index 0000000..01efad4 --- /dev/null +++ b/i386/include/IOKit/stream/IOStream.h @@ -0,0 +1,609 @@ +/* + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined(__IOKIT_IOSTREAM_H) +#define __IOKIT_IOSTREAM_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOUserClient.h> + +#include <IOKit/stream/IOStreamShared.h> + +/*! + @header IOStream.h + Definitions for IOStream family. + */ + +class IOStreamBuffer; + +/*! + @class IOStream + @abstract + A class representing a stream of data buffers passed from kernel to + user space and back again. + @discussion + The IOStream class defines a mechanism for moving buffers of data from + kernel space to user space or vice-versa. The policy for which direction + the data flows and the nature of the data is left up the the implementer + of the driver which uses IOStream. + + Although it is expected that the client of an IOStream will be in user space, + this is not required. + + References to "output" mean "from the IOStream to the user client", and + "input" means "from the user client to the IOStream." + + */ + +class IOStream : public IOService +{ + OSDeclareDefaultStructors(IOStream); + + protected: + OSArray * _buffers; // IOStreamBuffer objects in this stream + + IOItemCount _queueCount; // Number of entries for the queues + + IOMemoryDescriptor * _inputQueueDescriptor; + IOMemoryMap * _inputQueueMap; + + IOMemoryDescriptor * _outputQueueDescriptor; + IOMemoryMap * _outputQueueMap; + + IOStreamBufferQueue * _outputQueue; // Shared memory for buffers out to user space + IOStreamBufferQueue * _inputQueue; // Shared memory for buffers in from user space + + mach_port_t _outputPort; + mach_port_t _inputPort; + + OSArray * _memoryMaps; // Maps for data queues + + IOStreamMode _streamMode; + + public: + + /*! + @functiongroup Creating IOStream objects + */ + + /*! + @function withBuffers + @param mode The initial mode of the stream, either output, input, or input/output. + @param queueLength The nuber of queue entries to reserve in the input and output queue. + Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the stream. + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + */ + + static IOStream *withBuffers(OSArray *buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary *properties = 0); + + virtual bool init(OSDictionary *properties = 0); + + /*! + @function initWithBuffers + @param mode The initial mode of the stream, either output, input, or input/output. + @param queueLength The nuber of queue entries to reserve in the input and output queue. + Zero means to make the queues big enough to accommodate all the buffers at once. + @param properties + A dictionary of properties which will be set on the stream. + @param buffers + An array of IOStreamBuffer objects which will be the buffers for this stream. + */ + virtual bool initWithBuffers(OSArray *buffers, IOStreamMode mode = kIOStreamModeOutput, IOItemCount queueLength = 0, OSDictionary *properties = 0); + + /*! + @function free + */ + virtual void free(void); + + /*! + @functiongroup Opening and closing streams + */ + + /*! + @function handleOpen + @abstract The handleOpen() method relies on the default IOService behavior + to ensure that + only one client has the stream open at a time. + The shared input and output queues are created at open time. + @param options + @param arg + */ + virtual bool handleOpen( IOService * forClient, + IOOptionBits options, + void * arg ); + + /*! + @function handleClose + @abstract The handleClose method destroys the shared input and output + queues. + @param options + */ + virtual void handleClose( IOService * forClient, + IOOptionBits options ); + + /*! + @functiongroup Managing shared queues + */ + + /*! + @function createQueues + @abstract Creates the shared input and output queues, without regard + to whether the stream is open or not. + Normally this is called by handleOpen(). + @param queueLength + @param options + @result Returns kIOReturnSuccess if the queues were successfully created. + */ + virtual IOReturn createQueues( IOItemCount queueLength = 0, IOOptionBits options = 0 ); + + /*! + @function destroyQueues + @abstract Releases the shared input and output queues. + @result Returns kIOReturnSuccess if the queues were successfully destroyed. + The queues cannot be destroyed while the stream is open by a client. + */ + virtual IOReturn destroyQueues( void ); + + /*! + @function getOutputQueue + @result A pointer to the output IOStreamBufferQueue structure for the stream, + or NULL if the stream is not open and the queue has not been created yet. + */ + virtual IOStreamBufferQueue *getOutputQueue(void); // get shared-memory output queue + + /*! + @function getOutputQueueMemoryDescriptor + @result An IOMemoryDescriptor object repesenting the shared memory + output queue buffer. + */ + virtual IOMemoryDescriptor *getOutputQueueMemoryDescriptor(void); + + /*! + @function getInputQueue + @result A pointer to the input IOStreamBufferQueue structure for the stream, + or NULL if the stream is not open and the queue has not been created yet. + */ + virtual IOStreamBufferQueue *getInputQueue(void); // get shared-memory input queue + + /*! + @function getInputQueueMemoryDescriptor + @result An IOMemoryDescriptor object repesenting the shared memory + input queue buffer. + */ + virtual IOMemoryDescriptor *getInputQueueMemoryDescriptor(void); + + + /*! + @functiongroup Managing buffers in an IOStream + */ + + /*! + @function addBuffer + @abstract Add a buffer to an IOStream. + @param buffer + @discussion + Adds an IOStreamBuffer to an IOStream. It will be added to the end + of the buffer array, so the buffer ID of existing buffers will not change. + */ + virtual IOReturn addBuffer(IOStreamBuffer *buffer); // add a new buffer to the stream + + /*! + @function addBuffers + @param buffers + @result + */ + virtual IOReturn addBuffers(OSArray *buffers); + + /*! + @function removeBuffer + @param buffer A pointer to an IOStreamBuffer object in the stream. + @result Returns kIOReturnSuccess if the buffer was removed, or kIOReturnNotFound + if the buffer was not in this stream. + @abstract + Removes a buffer from the stream. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + */ + virtual IOReturn removeBuffer(IOStreamBuffer *buffer); + + /*! + @function removeBuffer + @param bufferID The ID of the buffer to remove. + @result Returns kIOReturnSuccess if the buffer was removed. + @abstract + Removes a buffer from the stream. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + */ + + virtual IOReturn removeBuffer(IOStreamBufferID bufferID); + + /*! + @function removeAllBuffers + @result + */ + virtual IOReturn removeAllBuffers( void ); + + /*! + @function removeAllBuffers + @result Returns kIOReturnSuccess if all the buffers were successfully + removed. Buffers cannot be removed + while the stream is open, as this will change the buffer IDs of existing + buffers. + + */ + virtual IOItemCount getBufferCount( void ); + + /*! + @function getBuffers + @abstract Get an array containing all the buffers in the stream. + @discussion + Returns an OSArray containing all the buffers in the stream in order of their buffer ID. + */ + virtual OSArray *getBuffers( void ); + + + /*! + @function getBufferWithID + @param bufferID + The ID of the buffer to get. + @result + A pointer to an IOStreamBuffer object, or NULL if the + buffer ID was invalid for this stream. + */ + + virtual IOStreamBuffer *getBufferWithID(IOStreamBufferID bufferID); + + /*! + @functiongroup Managing notification ports + */ + + /*! + @function getInputPort + @abstract Get the Mach port used to receive notifications + from user space that a buffer has been added to the input queue. + */ + virtual mach_port_t getInputPort(void); + + /*! + @function setInputPort + @abstract Set the Mach port used to receive notifications from + user space that a buffer has been added to the input queue. + @param port + + */ + virtual IOReturn setInputPort(mach_port_t port); + + /*! + @function getOutputPort + @abstract Get the Mach port used to send notifications to user space + that a buffer has been added to the output queue. + */ + virtual mach_port_t getOutputPort(void); + + /*! + @function setOutputPort + @abstract Set the Mach port used to send notifications to user space + that a buffer has been added to the output queue. + @param port + */ + virtual IOReturn setOutputPort(mach_port_t port); + + /*! + @function sendOutputNotification + @abstract Send a notification to the user client that data is available + for reading on the output queue. This will result in the user's output + handler being called, if they registered one. + @result Returns kIOReturnSuccess if the notification was successfully sent. + */ + virtual IOReturn sendOutputNotification(void); + + /*! + @functiongroup Queueing and dequeueing buffers + */ + + /*! + @function enqueueOutputBuffer + @abstract A convenience method for enqueueing a buffer. + @param buffer + @param dataOffset + @param dataLength + @param controlOffset + @param controlLength + @result + */ + virtual IOReturn enqueueOutputBuffer(IOStreamBuffer *buffer, + IOByteCount dataOffset = 0, + IOByteCount dataLength = 0, + IOByteCount controlOffset = 0, + IOByteCount controlLength = 0); + + + /*! + @function enqueueOutputEntry + @param entry + @result + */ + virtual IOReturn enqueueOutputEntry( IOStreamBufferQueueEntry *entry ); + + /*! + @function dequeueInputEntry + @param entry + @result + */ + virtual IOReturn dequeueInputEntry( IOStreamBufferQueueEntry *entry ); + + /*! + @functiongroup Managing notifications + */ + + /*! + @function inputCallback + @abstract Input callback function to be implemented by a subclass; + @param token + A 32-bit token value that can be used by convention to communicate + from user space to the stream. The semantics of this value are + defined by the IOStream subclass. + @discussion + The inputCallback() method is called as a result of a fast trap + from user space. It is called on the same thread as the user request, + but the subclass should implement this call as a notification sent + to a workloop so that the request is asynchronous. + */ + virtual void inputCallback( UInt32 token ); + + /*! + @function inputSyncCallback + @abstract Input callback function to be implemented by a subclass. + @param token + A 32-bit token value that can be used by convention to communicate + from user space to the stream. The semantics of this value are + defined by the IOStream subclass. + @discussion + The inputSyncCallback() method is called as a result of a fast trap + from user space. It is called on the same thread as the user request, + so no context switch is necessary. + */ + virtual void inputSyncCallback( UInt32 token ); + + /*! + @functiongroup Stream control + */ + + /*! + @function getStreamMode + @abstract Returns the mode of the stream, either input or output. + @result The mode of the stream, either kIOStreamModeInput + (from user space to kernel space) or the default + kIOStreamModeOutput (from kernel space to user space). + */ + virtual IOStreamMode getStreamMode(void); + + /*! + @function setStreamMode + @abstract Sets the mode of the stream, either input or output. + @discussion Subclasses may define whether it is possible + to change the mode of a stream. + */ + virtual IOReturn setStreamMode(IOStreamMode mode); + + /*! + @function startStream + @abstract Start sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully started. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn startStream(void); + + /*! + @function stopStream + @abstract Stop sending data on a stream. + @result Returns kIOReturnSuccess if the stream was successfully stopped. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn stopStream(void); + + /*! + @function suspendStream + @abstract Temporarily suspend data flow on the stream. + @result Returns kIOReturnSuccess if the stream was successfully suspended. + @discussion This must be implemented by a subclass. + */ + virtual IOReturn suspendStream(void); + + /*! + @functiongroup Managing user clients + */ + + /*! + @function newUserClient + @abstract See the documentation for the IOService method newUserClient. + */ + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, OSDictionary * properties, + IOUserClient ** handler ); + + + /* Reserved slots */ + + OSMetaClassDeclareReservedUnused(IOStream, 0); + OSMetaClassDeclareReservedUnused(IOStream, 1); + OSMetaClassDeclareReservedUnused(IOStream, 2); + OSMetaClassDeclareReservedUnused(IOStream, 3); + OSMetaClassDeclareReservedUnused(IOStream, 4); + OSMetaClassDeclareReservedUnused(IOStream, 5); + OSMetaClassDeclareReservedUnused(IOStream, 6); + OSMetaClassDeclareReservedUnused(IOStream, 7); + OSMetaClassDeclareReservedUnused(IOStream, 8); + OSMetaClassDeclareReservedUnused(IOStream, 9); + OSMetaClassDeclareReservedUnused(IOStream, 10); + OSMetaClassDeclareReservedUnused(IOStream, 11); + OSMetaClassDeclareReservedUnused(IOStream, 12); + OSMetaClassDeclareReservedUnused(IOStream, 13); + OSMetaClassDeclareReservedUnused(IOStream, 14); + OSMetaClassDeclareReservedUnused(IOStream, 15); + OSMetaClassDeclareReservedUnused(IOStream, 16); + OSMetaClassDeclareReservedUnused(IOStream, 17); + OSMetaClassDeclareReservedUnused(IOStream, 18); + OSMetaClassDeclareReservedUnused(IOStream, 19); + OSMetaClassDeclareReservedUnused(IOStream, 20); + OSMetaClassDeclareReservedUnused(IOStream, 21); + OSMetaClassDeclareReservedUnused(IOStream, 22); + OSMetaClassDeclareReservedUnused(IOStream, 23); + OSMetaClassDeclareReservedUnused(IOStream, 24); + OSMetaClassDeclareReservedUnused(IOStream, 25); + OSMetaClassDeclareReservedUnused(IOStream, 26); + OSMetaClassDeclareReservedUnused(IOStream, 27); + OSMetaClassDeclareReservedUnused(IOStream, 28); + OSMetaClassDeclareReservedUnused(IOStream, 29); + OSMetaClassDeclareReservedUnused(IOStream, 30); + OSMetaClassDeclareReservedUnused(IOStream, 31); + +}; + + +/*! + @class IOStreamBuffer + A class representing a data buffer that is part of an IOStream. + */ + +class IOStreamBuffer : public OSObject +{ + OSDeclareDefaultStructors(IOStreamBuffer); + +protected: + IOMemoryDescriptor * _dataBuffer; // The data buffer is expected to be filled by hardware. + IOMemoryDescriptor * _controlBuffer; // The control buffer is expected to be defined by the hardware driver. + + IOStreamBufferID _bufferID; // Client handle for this buffer. + + OSArray * _clientMemoryMaps; // Maps for clients who are sharing these buffers. + + SInt32 _clientReferenceCount; // Count of client uses of this buffer. May be negative. + +public: + /*! + @function initWithMemoryDescriptors + */ + virtual bool initWithMemoryDescriptors(IOMemoryDescriptor *dataBuffer, + IOMemoryDescriptor *controlBuffer, + IOStreamBufferID bufferID = 0); + + /*! + @function withMemoryDescriptors + */ + static IOStreamBuffer *withMemoryDescriptors(IOMemoryDescriptor *dataBuffer, + IOMemoryDescriptor *controlBuffer, + IOStreamBufferID bufferID = 0); + + virtual void free(void); + + /*! + @function getBufferID + @abstract Gets the buffer identifier for the IOStreamBuffer object. + @discussion The buffer identifier is unique across all buffers in a stream. + */ + virtual IOStreamBufferID getBufferID(void); + + /*! + @function setBufferID + @abstract Sets the buffer identifier for the IOStreamBuffer object. + */ + + virtual void setBufferID( IOStreamBufferID bufferID ); + + /*! + @function setDataBuffer + @abstract Sets the data buffer for the IOStreamBuffer object. + */ + virtual void setDataBuffer(IOMemoryDescriptor *dataBuffer); + + /*! + @function setControlBuffer + @abstract Sets the control buffer for the IOStreamBuffer object. + */ + virtual void setControlBuffer(IOMemoryDescriptor *controlBuffer); + + /*! + @function getDataBuffer + @result A pointer to the IOMemoryDescriptor for the data buffer. + */ + virtual IOMemoryDescriptor *getDataBuffer(void); + + /*! + @function getControlBuffer + @result A pointer to the IOMemoryDescriptor for the control buffer. + */ + virtual IOMemoryDescriptor *getControlBuffer(void); + + /*! + @function getClientReferenceCount + @result The count of client references to this buffer. It may be positive + or negative, depending on whether the client is sending data into the kernel, + or the kernel is sending data out to the client. + */ + virtual SInt32 getClientReferenceCount( void ); + + /*! + @function sendClientReference + @param offset The offset in the buffer of the data sent to the client. + @param length The length of the data sent to the client. + @result The new client reference count. + @abstract + */ + virtual SInt32 sendClientReference( IOByteCount offset = 0, IOByteCount length = 0 ); + + /*! + @function receiveClientReference + @param offset The offset in the buffer of the data from the client. + @param length The length of the data from the client. + @abstract + */ + virtual SInt32 receiveClientReference( IOByteCount offset = 0, IOByteCount length = 0 ); + + /* Reserved slots */ + + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 0); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 1); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 2); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 3); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 4); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 5); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 6); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 7); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 8); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 9); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 10); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 11); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 12); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 13); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 14); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 15); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 16); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 17); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 18); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 19); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 20); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 21); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 22); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 23); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 24); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 25); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 26); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 27); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 28); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 29); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 30); + OSMetaClassDeclareReservedUnused(IOStreamBuffer, 31); + +}; + +#endif /* ! __IOKIT_IOSTREAM_H */ + diff --git a/i386/include/IOKit/stream/IOStreamFamily.h b/i386/include/IOKit/stream/IOStreamFamily.h new file mode 100644 index 0000000..a4eb7f0 --- /dev/null +++ b/i386/include/IOKit/stream/IOStreamFamily.h @@ -0,0 +1,13 @@ +/* + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#ifndef __IOKIT_IOSTREAMFAMILY_H +#define __IOKIT_IOSTREAMFAMILY_H + +#include <IOKit/stream/IOStream.h> +#include <IOKit/stream/IOStreamShared.h> + + +#endif /* !__IOKIT_IOSTREAMFAMILY_H */ diff --git a/i386/include/IOKit/stream/IOStreamShared.h b/i386/include/IOKit/stream/IOStreamShared.h new file mode 100644 index 0000000..5b2c0a3 --- /dev/null +++ b/i386/include/IOKit/stream/IOStreamShared.h @@ -0,0 +1,175 @@ +/* + * IOStreamShared.h + * IOStreamFamily + * + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined(__IOKIT_IOSTREAMSHARED_H) +#define __IOKIT_IOSTREAMSHARED_H + +#include <sys/cdefs.h> + +#include <IOKit/IOTypes.h> + +/*! + @header IOStreamShared.h + IOStream definitions shared between kernel and user space. + */ + +__BEGIN_DECLS + +// Buffer numbers are guaranteed to go from 0 to bufferCount - 1. +/*! + @typedef IOStreamBufferID + */ +typedef UInt32 IOStreamBufferID; +#define kIOStreamBufferIDInvalid (~0) + +// This is the header for the shared-memory queue used to send buffer notifications +// from kernel to user space or vice versa. + +// Queue entry in input or output queue + +#ifdef __cplusplus + +/*! + @struct IOStreamBufferQueueEntry + @field bufferID The ID of the buffer passed in this queue entry. + @field dataLength The length of the valid data in the buffer. + @field reserved Reserved for future use. +*/ + +struct IOStreamBufferQueueEntry { + IOStreamBufferID bufferID; + UInt32 dataOffset; + UInt32 dataLength; + UInt32 controlOffset; + UInt32 controlLength; + UInt32 reserved[3]; +}; + + +/*! + @struct IOStreamBufferQueue + @field entryCount The number of queue entries in the queue. + @field headIndex The index of the next queue slot that will be filled in by the queue writer. + @field tailIndex The index of the next queue slot that can be read by the queue reader. + @field reserved Reserved for future use. + @field queue The array of queue entries. + */ + +struct IOStreamBufferQueue { + UInt32 entryCount; + volatile UInt32 headIndex; + volatile UInt32 tailIndex; + UInt32 reserved; + IOStreamBufferQueueEntry queue[0]; +}; + +#else + +typedef struct __IOStreamBufferQueueEntry { + IOStreamBufferID bufferID; + UInt32 dataOffset; + UInt32 dataLength; + UInt32 controlOffset; + UInt32 controlLength; + UInt32 reserved[3]; +} IOStreamBufferQueueEntry; + +typedef struct __IOStreamBufferQueue { + UInt32 entryCount; + volatile UInt32 headIndex; + volatile UInt32 tailIndex; + UInt32 reserved; + IOStreamBufferQueueEntry queue[0]; +} IOStreamBufferQueue; + +#endif + +/*! + @enum Memory mapping types + @constant kIOStreamMemoryTypeOutputQueue + @constant kIOStreamMemoryTypeInputQueue + @constant kIOStreamMemoryTypeBufferData + @constant kIOStreamMemoryTypeBufferControl + @constant kIOStreamBufferIDMask + @constant kIOStreamMemoryTypeMask + @abstract Memory types used with IOConnectMapMemory(). + */ +enum { + kIOStreamMemoryTypeOutputQueue = 0x10000000, + kIOStreamMemoryTypeInputQueue = 0x20000000, + kIOStreamMemoryTypeBufferData = 0x30000000, + kIOStreamMemoryTypeBufferControl = 0x40000000, + kIOStreamBufferIDMask = 0x0FFFFFFF, + kIOStreamMemoryTypeMask = 0xF0000000 +}; + +/*! + @enum Mach port types + @constant kIOStreamPortTypeOutput + @constant kIOStreamPortTypeInput + @abstract Port types used with IOConnectSetNotificationPort(). + */ +enum { + kIOStreamPortTypeOutput, + kIOStreamPortTypeInput +}; + +/*! + @enum IOStream open options + */ + +enum { + kIOStreamOptionOpenExclusive = 0x00010000, + kIOStreamOptionOpenShared = 0x00020000 +}; + +/*! + @enum User client methods + @constant kIOStreamMethodOpen + @constant kIOStreamMethodClose + @constant kIOStreamMethodStart + @constant kIOStreamMethodStop + @constant kIOStreamMethodSuspend + @constant kIOStreamMethodGetMode + @constant kIOStreamMethodSetMode + + @abstract Client method numbers used with IOConnectMethod...() functions. + */ +enum { + kIOStreamMethodOpen, + kIOStreamMethodClose, + kIOStreamMethodStart, + kIOStreamMethodStop, + kIOStreamMethodSuspend, + kIOStreamMethodGetMode, + kIOStreamMethodSetMode, + kIOStreamMethodGetBufferCount +}; + +/*! + @enum User client traps + @constant kIOStreamEnqueueInputTrap + @constant kIOStreamEnqueueInputSyncTrap + @abstract Client trap numbers used with IOConnectTrap..() functions. + */ +enum { + kIOStreamEnqueueInputTrap, + kIOStreamEnqueueInputSyncTrap +}; + +typedef enum { + kIOStreamModeInput, // From user to kernel space + kIOStreamModeOutput, // From kernel to user space + kIOStreamModeInputOutput // bidirectional +} IOStreamMode; + + +__END_DECLS + +#endif /* ! __IOKIT_IOSTREAMSHARED_H */ + diff --git a/i386/include/IOKit/stream/IOStreamUserClient.h b/i386/include/IOKit/stream/IOStreamUserClient.h new file mode 100644 index 0000000..887575a --- /dev/null +++ b/i386/include/IOKit/stream/IOStreamUserClient.h @@ -0,0 +1,76 @@ +/* + * IOStreamUserClient.h + * IOStreamFamily + * + * Copyright 2006 Apple Computer, Inc. All rights reserved. + * + */ + +#if !defined( __IOKIT_IOSTREAMUSERCLIENT_H ) +#define __IOKIT_IOSTREAMUSERCLIENT_H + + +#include <IOKit/IOUserClient.h> + +#include <IOKit/stream/IOStreamShared.h> +#include <IOKit/stream/IOStream.h> + +class IOStreamUserClient : public IOUserClient +{ + OSDeclareDefaultStructors( IOStreamUserClient ) + +protected: + IOStream * _owner; + task_t _task; + +public: + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type, + OSDictionary * properties); + virtual bool initWithTask( + task_t owningTask, void * securityToken, UInt32 type); + + virtual IOReturn clientClose( void ); + virtual IOReturn clientDied( void ); + + virtual IOService * getService( void ); + + virtual IOReturn registerNotificationPort( + mach_port_t port, UInt32 type, UInt32 refCon ); + + virtual IOReturn connectClient( IOUserClient * client ); + + virtual IOExternalMethod * getTargetAndMethodForIndex( + IOService ** targetP, UInt32 index ); + + virtual IOExternalTrap * + getTargetAndTrapForIndex( IOService **targetP, UInt32 index ); + + virtual IOReturn clientMemoryForType( UInt32 type, + IOOptionBits * options, + IOMemoryDescriptor ** memory ); + + virtual bool start( IOService * provider ); + + +protected: + virtual IOReturn openMethod( char * dataIn, char * dataOut, + IOByteCount inputSize, IOByteCount * outputSize ); + virtual IOReturn closeMethod( void ); + virtual IOReturn startMethod( void ); + virtual IOReturn stopMethod( void ); + virtual IOReturn suspendMethod( void ); + virtual IOReturn getModeMethod( char * dataOut, + IOByteCount * outputSize ); + virtual IOReturn setModeMethod( char * dataIn, + IOByteCount inputSize ); + virtual IOReturn getBufferCountMethod( char * dataOut, + IOByteCount * outputSize ); + + virtual IOReturn inputTrap( UInt32 token ); + virtual IOReturn inputSyncTrap( UInt32 token ); + +}; + +#endif /* ! __IOKIT_IOSTREAMUSERCLIENT_H */ + diff --git a/i386/include/IOKit/system.h b/i386/include/IOKit/system.h new file mode 100644 index 0000000..7092d59 --- /dev/null +++ b/i386/include/IOKit/system.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1998-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __IOKIT_SYSTEM_H +#define __IOKIT_SYSTEM_H + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#include <mach/mach_types.h> +#include <mach/mach_interface.h> +#include <mach/memory_object_types.h> + +#include <stdarg.h> +#include <stdint.h> +#include <string.h> + +#include <IOKit/assert.h> /* Must be before other includes of kern/assert.h */ + +#include <kern/kern_types.h> +#include <kern/thread.h> +#include <kern/debug.h> +#include <kern/task.h> +#include <kern/sched_prim.h> +#include <kern/locks.h> +#include <kern/queue.h> +#include <kern/ipc_mig.h> +#include <libkern/libkern.h> + + +#ifndef _MISC_PROTOS_H_ +extern void _doprnt( const char *format, va_list *arg, + void (*lputc)(char), int radix ); +#endif + +__END_DECLS + +#endif /* !__IOKIT_SYSTEM_H */ diff --git a/i386/include/IOKit/system_management/.svn/all-wcprops b/i386/include/IOKit/system_management/.svn/all-wcprops new file mode 100644 index 0000000..d5cd78a --- /dev/null +++ b/i386/include/IOKit/system_management/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/system_management +END +IOWatchDogTimer.h +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/system_management/IOWatchDogTimer.h +END diff --git a/i386/include/IOKit/system_management/.svn/entries b/i386/include/IOKit/system_management/.svn/entries new file mode 100644 index 0000000..2ab2e8e --- /dev/null +++ b/i386/include/IOKit/system_management/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/system_management +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +IOWatchDogTimer.h +file + + + + +2013-08-27T23:54:20.000000Z +e2ec51de6352bd52efa9e10f4dcc69f0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2076 + diff --git a/i386/include/IOKit/system_management/.svn/text-base/IOWatchDogTimer.h.svn-base b/i386/include/IOKit/system_management/.svn/text-base/IOWatchDogTimer.h.svn-base new file mode 100644 index 0000000..a89b95b --- /dev/null +++ b/i386/include/IOKit/system_management/.svn/text-base/IOWatchDogTimer.h.svn-base @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOWATCHDOGTIMER_H +#define _IOWATCHDOGTIMER_H + +#include <IOKit/IOService.h> + +class IOWatchDogTimer : public IOService +{ + OSDeclareAbstractStructors(IOWatchDogTimer); + +protected: + IONotifier *notifier; + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool start(IOService *provider); + virtual void stop(IOService *provider); + virtual IOReturn setProperties(OSObject *properties); + virtual void setWatchDogTimer(UInt32 timeOut) = 0; + + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 0); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 1); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 2); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 3); +}; + +#endif /* !_IOWATCHDOGTIMER_H */ diff --git a/i386/include/IOKit/system_management/IOWatchDogTimer.h b/i386/include/IOKit/system_management/IOWatchDogTimer.h new file mode 100644 index 0000000..a89b95b --- /dev/null +++ b/i386/include/IOKit/system_management/IOWatchDogTimer.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _IOWATCHDOGTIMER_H +#define _IOWATCHDOGTIMER_H + +#include <IOKit/IOService.h> + +class IOWatchDogTimer : public IOService +{ + OSDeclareAbstractStructors(IOWatchDogTimer); + +protected: + IONotifier *notifier; + struct ExpansionData { }; + ExpansionData *reserved; + +public: + virtual bool start(IOService *provider); + virtual void stop(IOService *provider); + virtual IOReturn setProperties(OSObject *properties); + virtual void setWatchDogTimer(UInt32 timeOut) = 0; + + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 0); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 1); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 2); + OSMetaClassDeclareReservedUnused(IOWatchDogTimer, 3); +}; + +#endif /* !_IOWATCHDOGTIMER_H */ diff --git a/i386/include/IOKit/usb/.svn/all-wcprops b/i386/include/IOKit/usb/.svn/all-wcprops new file mode 100644 index 0000000..35d3bc2 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/all-wcprops @@ -0,0 +1,155 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb +END +USB.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/USB.h +END +IOUSBControllerListElement.h +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBControllerListElement.h +END +IOUSBBus.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBBus.h +END +IOUSBControllerV2.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBControllerV2.h +END +IOUSBMassStorageUFISubclass.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBMassStorageUFISubclass.h +END +IOUSBControllerV3.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBControllerV3.h +END +IOUSBPipe.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBPipe.h +END +IOUSBHubDevice.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBHubDevice.h +END +IOUSBDevice.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBDevice.h +END +IOUSBInterface.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBInterface.h +END +IOUFIStorageServices.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUFIStorageServices.h +END +IOUSBRootHubDevice.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBRootHubDevice.h +END +USBSpec.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/USBSpec.h +END +USBTracepoints.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/USBTracepoints.h +END +IOUSBWorkLoop.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBWorkLoop.h +END +IOUSBUserClient.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBUserClient.h +END +IOUSBMassStorageClass.h +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBMassStorageClass.h +END +IOUSBHubPolicyMaker.h +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBHubPolicyMaker.h +END +IOUSBCompositeDriver.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBCompositeDriver.h +END +IOUSBCommand.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBCommand.h +END +IOUSBHIDDriver.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBHIDDriver.h +END +IOUSBLog.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBLog.h +END +IOUSBController.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBController.h +END +IOUSBNub.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/IOUSBNub.h +END +USBHub.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/IOKit/usb/USBHub.h +END diff --git a/i386/include/IOKit/usb/.svn/entries b/i386/include/IOKit/usb/.svn/entries new file mode 100644 index 0000000..e10487e --- /dev/null +++ b/i386/include/IOKit/usb/.svn/entries @@ -0,0 +1,878 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/IOKit/usb +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +USB.h +file + + + + +2013-08-27T23:54:30.000000Z +8bf23d0dad1a9225363c787a94ec58bc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +45107 + +IOUSBControllerListElement.h +file + + + + +2013-08-27T23:54:30.000000Z +e919de00cc53e1f24ba901f60aa320e3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4738 + +IOUSBBus.h +file + + + + +2013-08-27T23:54:30.000000Z +ad6cbbbb1af98d5a96673d2b761ba9e5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1183 + +IOUSBControllerV2.h +file + + + + +2013-08-27T23:54:30.000000Z +5883ee016e6e171b318462f148c4d64d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20855 + +IOUSBMassStorageUFISubclass.h +file + + + + +2013-08-27T23:54:30.000000Z +378eb3a378af0fb004606ffed9d9136c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11928 + +IOUSBControllerV3.h +file + + + + +2013-08-27T23:54:30.000000Z +9932d9ac063d5f679fe298271057ead4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12479 + +IOUSBPipe.h +file + + + + +2013-08-27T23:54:30.000000Z +5b768a7a705b59ee7b8165ebb65fbcdf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17471 + +IOUSBHubDevice.h +file + + + + +2013-08-27T23:54:30.000000Z +e2d30f06c2626b944387f533cd6d0828 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10211 + +IOUSBDevice.h +file + + + + +2013-08-27T23:54:30.000000Z +7e6687d8ebc8537c69885481626bcce5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +28373 + +IOUSBInterface.h +file + + + + +2013-08-27T23:54:30.000000Z +59d558e91299bdbcd54eca2005080b56 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12213 + +IOUFIStorageServices.h +file + + + + +2013-08-27T23:54:30.000000Z +60a9064a8b4272e667e4a57281afbb3f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4777 + +IOUSBRootHubDevice.h +file + + + + +2013-08-27T23:54:30.000000Z +4c9f61f93aca3228f4c7556b0056821e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3376 + +USBSpec.h +file + + + + +2013-08-27T23:54:30.000000Z +3136341088b9dbc0e613e3beb7ba1af8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15028 + +USBTracepoints.h +file + + + + +2013-08-27T23:54:30.000000Z +b1631300f3a48e7b698ab3e4baf60dd3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20349 + +IOUSBWorkLoop.h +file + + + + +2013-08-27T23:54:30.000000Z +4b4594c45a9238ed70acee961217da1d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2000 + +IOUSBUserClient.h +file + + + + +2013-08-27T23:54:30.000000Z +f22ed4f18efbd8826acc1a651f368cca +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5331 + +IOUSBMassStorageClass.h +file + + + + +2013-08-27T23:54:30.000000Z +51cb0b7ba0d53f61721664ef0325a539 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17705 + +IOUSBHubPolicyMaker.h +file + + + + +2013-08-27T23:54:30.000000Z +138fe70e48636d05d0b66dfc39842385 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9227 + +IOUSBCompositeDriver.h +file + + + + +2013-08-27T23:54:30.000000Z +1de600100621201d642fb2bb395f9758 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5382 + +IOUSBCommand.h +file + + + + +2013-08-27T23:54:30.000000Z +af982f7c12ee99330cb6ffaa73b32a03 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10859 + +IOUSBHIDDriver.h +file + + + + +2013-08-27T23:54:30.000000Z +1d0f69397c09ecc6c1a685d252418bd6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11853 + +IOUSBLog.h +file + + + + +2013-08-27T23:54:30.000000Z +79f3680f444a5eb350afeec515f05e49 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7979 + +IOUSBController.h +file + + + + +2013-08-27T23:54:30.000000Z +e5238919996dfc66485bb3f01e35de2e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +50775 + +IOUSBNub.h +file + + + + +2013-08-27T23:54:30.000000Z +e436676a1824525edd3ef6f8ee62f088 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2165 + +USBHub.h +file + + + + +2013-08-27T23:54:30.000000Z +7f59dcf439d351c5f6e8b4bb4ecceb9b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7420 + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUFIStorageServices.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUFIStorageServices.h.svn-base new file mode 100644 index 0000000..cac43f4 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUFIStorageServices.h.svn-base @@ -0,0 +1,136 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_UFI_STORAGE_SERVICES_H_ +#define _IOKIT_UFI_STORAGE_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOBlockStorageDevice.h> +#include <IOKit/usb/IOUSBMassStorageUFISubclass.h> + + +class IOUFIStorageServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOUFIStorageServices ) + +private: + bool fMediaChanged; + bool fMediaPresent; + +protected: + + IOUSBMassStorageUFIDevice * fProvider; + + UInt64 fMaxReadBlocks; + UInt64 fMaxWriteBlocks; + + virtual bool attach ( IOService * provider ); + virtual void detach ( IOService * provider ); + + // Reserve space for future expansion. + struct IOUFIStorageServicesExpansionData { }; + IOUFIStorageServicesExpansionData *fIOUFIStorageServicesReserved; + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doSyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 1 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 2 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 3 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 4 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 5 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 6 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 7 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_UFI_STORAGE_SERVICES_H_ */ diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBBus.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBBus.h.svn-base new file mode 100644 index 0000000..a42191a --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBBus.h.svn-base @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBBUS_H +#define _IOKIT_IOUSBBUS_H + +#include <IOKit/IOService.h> + +class IOUSBBus : public IOService +{ + OSDeclareAbstractStructors(IOUSBBus) +}; + +#endif /* ! _IOKIT_IOUSBBUS_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBCommand.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBCommand.h.svn-base new file mode 100644 index 0000000..0f7c36b --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBCommand.h.svn-base @@ -0,0 +1,266 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCOMMAND_H +#define _IOKIT_IOUSBCOMMAND_H + +#include <IOKit/IOCommand.h> +#include <IOKit/IOCommandPool.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IODMACommand.h> +#include <IOKit/usb/USB.h> + +/* + * USB Command + * This is the command block for a USB command to be queued on the + * Command Gate of the WorkLoop. Although the actual work of creating + * the command and enqueueing it is done for them via the deviceRequest, + * read, and write methods, this is the primary way that devices will get + * work done. + * Note: This is private to IOUSBController and should be moved to a + * private header. + */ + +typedef enum { + DEVICE_REQUEST, // Device request using pointer + READ, + WRITE, + CREATE_EP, + DELETE_EP, + DEVICE_REQUEST_DESC, // Device request using descriptor + DEVICE_REQUEST_BUFFERCOMMAND // Device request using a second IOUSBCommand in _bufferCommand +} usbCommand; + + + +/*! + @class IOUSBCommand + @abstract A subclass of IOCommand that is used to add USB specific data. + */ +class IOUSBCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOUSBCommand) + +protected: + usbCommand _selector; + IOUSBDeviceRequestPtr _request; + USBDeviceAddress _address; + UInt8 _endpoint; + UInt8 _direction; + UInt8 _type; + bool _bufferRounding; + IOMemoryDescriptor * _buffer; + IOUSBCompletion _uslCompletion; + IOUSBCompletion _clientCompletion; + UInt32 _dataRemaining; // For Control transfers + UInt8 _stage; // For Control transfers + IOReturn _status; + IOMemoryDescriptor * _origBuffer; + IOUSBCompletion _disjointCompletion; + IOByteCount _dblBufLength; + UInt32 _noDataTimeout; + UInt32 _completionTimeout; + UInt32 _UIMScratch[10]; + + struct ExpansionData + { + IOByteCount _reqCount; + IOMemoryDescriptor *_requestMemoryDescriptor; + IOMemoryDescriptor *_bufferMemoryDescriptor; + bool _multiTransferTransaction; + bool _finalTransferInTransaction; + bool _useTimeStamp; + AbsoluteTime _timeStamp; + bool _isSyncTransfer; // Returns true if the command is used for a synchronous transfer + IODMACommand *_dmaCommand; // used to get memory mapping + IOUSBCommand *_bufferUSBCommand; // points to another IOUSBCommand used for phase 2 of control transactions + IOUSBCommand *_masterUSBCommand; // points from the bufferUSBCommand back to the parent command + }; + ExpansionData * _expansionData; + + // we override these OSObject method in order to allocate and release our expansion data + virtual bool init(); + virtual void free(); + +public: + + // static constructor + static IOUSBCommand * NewCommand(void); + + // Manipulators + void SetSelector(usbCommand sel); + void SetRequest(IOUSBDeviceRequestPtr req); + void SetAddress(USBDeviceAddress addr); + void SetEndpoint(UInt8 ep); + void SetDirection(UInt8 dir); + void SetType(UInt8 type); + void SetBufferRounding(bool br); + void SetBuffer(IOMemoryDescriptor *buf); + void SetUSLCompletion(IOUSBCompletion completion); + void SetClientCompletion(IOUSBCompletion completion); + void SetDataRemaining(UInt32 dr); + void SetStage(UInt8 stage); + void SetStatus(IOReturn stat); + void SetOrigBuffer(IOMemoryDescriptor *buf); + void SetDisjointCompletion(IOUSBCompletion completion); + void SetDblBufLength(IOByteCount len); + void SetNoDataTimeout(UInt32 to); + void SetCompletionTimeout(UInt32 to); + void SetUIMScratch(UInt32 index, UInt32 value); + void SetReqCount(IOByteCount reqCount); + void SetRequestMemoryDescriptor(IOMemoryDescriptor *requestMemoryDescriptor); + void SetBufferMemoryDescriptor(IOMemoryDescriptor *bufferMemoryDescriptor); + void SetMultiTransferTransaction(bool); + void SetFinalTransferInTransaction(bool); + void SetUseTimeStamp(bool); + void SetTimeStamp(AbsoluteTime timeStamp); + void SetIsSyncTransfer(bool); + inline void SetDMACommand(IODMACommand *dmaCommand) { _expansionData->_dmaCommand = dmaCommand; } + void SetBufferUSBCommand(IOUSBCommand *bufferUSBCommand); + + // Accessors + usbCommand GetSelector(void); + IOUSBDeviceRequestPtr GetRequest(void); + USBDeviceAddress GetAddress(void); + UInt8 GetEndpoint(void); + UInt8 GetDirection(void); + UInt8 GetType(void); + bool GetBufferRounding(void); + IOMemoryDescriptor * GetBuffer(void); + IOUSBCompletion GetUSLCompletion(void); + IOUSBCompletion GetClientCompletion(void); + UInt32 GetDataRemaining(void); + UInt8 GetStage(void); + IOReturn GetStatus(void); + IOMemoryDescriptor * GetOrigBuffer(void); + IOUSBCompletion GetDisjointCompletion(void); + IOByteCount GetDblBufLength(void); + UInt32 GetNoDataTimeout(void); + UInt32 GetCompletionTimeout(void); + UInt32 GetUIMScratch(UInt32 index); + IOByteCount GetReqCount(void); + IOMemoryDescriptor * GetRequestMemoryDescriptor(void); + IOMemoryDescriptor * GetBufferMemoryDescriptor(void); + bool GetMultiTransferTransaction(void); + bool GetFinalTransferInTransaction(void); + bool GetUseTimeStamp(void); + AbsoluteTime GetTimeStamp(void); + bool GetIsSyncTransfer(void); + inline IODMACommand * GetDMACommand(void) {return _expansionData->_dmaCommand; } + inline IOUSBCommand * GetBufferUSBCommand(void) {return _expansionData->_bufferUSBCommand; } +}; + + +class IOUSBIsocCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOUSBIsocCommand) + +protected: + usbCommand _selector; + USBDeviceAddress _address; + UInt8 _endpoint; + UInt8 _direction; + IOMemoryDescriptor * _buffer; + IOUSBIsocCompletion _completion; + UInt64 _startFrame; + UInt32 _numFrames; + IOUSBIsocFrame * _frameList; + IOReturn _status; + + struct ExpansionData + { + UInt32 _updateFrequency; + bool _useTimeStamp; + AbsoluteTime _timeStamp; + bool _isSyncTransfer; // Returns true if the command is used for a synchronous transfer + bool _rosettaClient; + IODMACommand * _dmaCommand; + IOUSBIsocCompletion _uslCompletion; + bool _lowLatency; + }; + ExpansionData * _expansionData; + + // we override these OSObject method in order to allocate and release our expansion data + virtual bool init(); + virtual void free(); + +public: + // static constructor + static IOUSBIsocCommand *NewCommand(void); + + // Manipulators + void SetSelector(usbCommand sel) {_selector = sel; } + void SetAddress(USBDeviceAddress addr) {_address = addr; } + void SetEndpoint(UInt8 ep) {_endpoint = ep; } + void SetDirection(UInt8 dir) {_direction = dir; } + void SetBuffer(IOMemoryDescriptor *buf) {_buffer = buf; } + void SetCompletion(IOUSBIsocCompletion completion) {_completion = completion; } + void SetStartFrame(UInt64 sf) {_startFrame = sf; } + void SetNumFrames(UInt32 nf) {_numFrames = nf; } + void SetFrameList(IOUSBIsocFrame *fl) {_frameList = fl; } + void SetStatus(IOReturn stat) {_status = stat; } + void SetUpdateFrequency( UInt32 fr) { _expansionData->_updateFrequency = fr; } + void SetUseTimeStamp(bool useIt) { _expansionData->_useTimeStamp= useIt; } + void SetTimeStamp(AbsoluteTime timeStamp) { _expansionData->_timeStamp= timeStamp; } + void SetIsSyncTransfer(bool isSync) { _expansionData->_isSyncTransfer = isSync; } + void SetRosettaClient(bool isRosetta) { _expansionData->_rosettaClient = isRosetta; } + void SetDMACommand(IODMACommand *dmaCommand) { _expansionData->_dmaCommand = dmaCommand; } + void SetUSLCompletion(IOUSBIsocCompletion completion) { _expansionData->_uslCompletion = completion; } + void SetLowLatency(bool lowLatency) { _expansionData->_lowLatency = lowLatency; } + + // Accessors + usbCommand GetSelector(void) { return _selector; } + USBDeviceAddress GetAddress(void) { return _address; } + UInt8 GetEndpoint(void) { return _endpoint; } + UInt8 GetDirection(void) { return _direction; } + IOMemoryDescriptor * GetBuffer(void) { return _buffer; } + IOUSBIsocCompletion GetCompletion(void) { return _completion; } + UInt64 GetStartFrame(void) { return _startFrame; } + UInt32 GetNumFrames(void) { return _numFrames; } + IOUSBIsocFrame * GetFrameList(void) { return _frameList; } + UInt32 GetUpdateFrequency(void) { return _expansionData->_updateFrequency; } + IOReturn GetStatus(void) { return _status; } + bool GetUseTimeStamp(void) { return _expansionData->_useTimeStamp; } + AbsoluteTime GetTimeStamp(void) { return _expansionData->_timeStamp; } + bool GetIsSyncTransfer(void) { return _expansionData->_isSyncTransfer; } + bool GetIsRosettaClient(void) { return _expansionData->_rosettaClient; } + IODMACommand * GetDMACommand(void) { return _expansionData->_dmaCommand; } + IOUSBIsocCompletion GetUSLCompletion(void) { return _expansionData->_uslCompletion; } + bool GetLowLatency(void) { return _expansionData->_lowLatency; } +}; + +class IOUSBCommandPool : public IOCommandPool +{ + OSDeclareDefaultStructors( IOUSBCommandPool ) + +protected: + virtual IOReturn gatedReturnCommand(IOCommand * command); + virtual IOReturn gatedGetCommand(IOCommand ** command, bool blockForCommand); + +public: + static IOCommandPool * withWorkLoop(IOWorkLoop * inWorkLoop); +}; + + +#endif + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBCompositeDriver.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBCompositeDriver.h.svn-base new file mode 100644 index 0000000..ef72cf4 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBCompositeDriver.h.svn-base @@ -0,0 +1,127 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1998-2006 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCompositeDriver_H +#define _IOKIT_IOUSBCompositeDriver_H + +//================================================================================================ +// +// Headers +// +//================================================================================================ +// +#include <libkern/OSByteOrder.h> +#include <IOKit/IOLib.h> +#include <IOKit/IONotifier.h> +#include <IOKit/IOService.h> +#include <IOKit/IOMessage.h> +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBDevice.h> +#include <IOKit/usb/IOUSBInterface.h> +#include <IOKit/usb/IOUSBLog.h> +#include <IOKit/usb/USB.h> + + +//================================================================================================ +// +// Class Declaration for IOUSBCompositeDriver +// +//================================================================================================ +// +/*! + @class IOUSBCompositeDriver + @abstract Driver that matches to USB composite devices. + @discussion This class can be overriden to provide for specific behaviors. The driver itself essentially + just calls SetConfiguration(). + */ +class IOUSBCompositeDriver : public IOService +{ + OSDeclareDefaultStructors(IOUSBCompositeDriver) + + IOUSBDevice * fDevice; + IONotifier * fNotifier; + bool fExpectingClose; + UInt8 fConfigValue; + UInt8 fConfigbmAttributes; + + struct IOUSBCompositeDriverExpansionData + { + }; + + IOUSBCompositeDriverExpansionData * fIOUSBCompositeExpansionData; + + static IOReturn CompositeDriverInterestHandler( void * target, void * refCon, UInt32 messageType, IOService * provider, void * messageArgument, vm_size_t argSize ); + +public: + + // IOService Methods + // + virtual bool start(IOService * provider); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + + // IOUSBCompositeDriver Methods + // + virtual bool ConfigureDevice(); + virtual IOReturn ReConfigureDevice(); + /*! + @function SetConfiguration + @abstract Call IOUSBDevice to do a SetConfiguration call to the device. + @param configValue The desired configuration value. + @param startInterfaceMatching A boolean specifying whether IOKit should begin the process of finding + matching drivers for the new IOUSBInterface objects. + */ + virtual IOReturn SetConfiguration(UInt8 configValue, bool startInterfaceMatching=true); + + // Getters + // + bool GetExpectingClose() { return fExpectingClose; } + UInt8 GetConfigValue() { return fConfigValue; } + UInt8 GetConfigbmAttributes() { return fConfigbmAttributes; } + IONotifier * GetNotifier() { return fNotifier; } + + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 0); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 1); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 2); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 3); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 4); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 5); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 6); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 7); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 8); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 9); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 10); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 11); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 12); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 13); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 14); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 15); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 16); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 17); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 18); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 19); +}; + +#endif _IOKIT_IOUSBCompositeDriver_H diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBController.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBController.h.svn-base new file mode 100644 index 0000000..18940f2 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBController.h.svn-base @@ -0,0 +1,1073 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCONTROLLER_H +#define _IOKIT_IOUSBCONTROLLER_H + +//================================================================================================ +// +// Headers +// +//================================================================================================ +// +#include <libkern/c++/OSArray.h> + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IODeviceMemory.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IOCommandPool.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/USBHub.h> +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBCommand.h> +#include <IOKit/usb/IOUSBWorkLoop.h> + + +//================================================================================================ +// +// Types and Constants +// +//================================================================================================ +// +enum +{ + kErrataCMDDisableTestMode = (1 << 0), // turn off UHCI test mode + kErrataOnlySinglePageTransfers = (1 << 1), // Don't cross page boundaries in a single transfer + kErrataRetryBufferUnderruns = (1 << 2), // Don't cross page boundaries in a single transfer + kErrataLSHSOpti = (1 << 3), // Don't cross page boundaries in a single transfer + kErrataDisableOvercurrent = (1 << 4), // Always set the NOCP bit in rhDescriptorA register + kErrataLucentSuspendResume = (1 << 5), // Don't allow port suspend at the root hub + kErrataNeedsWatchdogTimer = (1 << 6), // Use Watchdog timer to reset confused controllers + kErrataNeedsPortPowerOff = (1 << 7), // Power off the ports and back on again to clear weird status. + kErrataAgereEHCIAsyncSched = (1 << 8), // needs workaround for Async Sched bug + kErrataNECOHCIIsochWraparound = (1 << 9), // needs workaround for NEC isoch buffer wraparound problem + kErrataNECIncompleteWrite = (1 << 10), // needs workaround for NEC bits not sticking (errata IBB-2UE-00030 Jun 23 2005) + kErrataICH6PowerSequencing = (1 << 11), // needs special power sequencing for early Transition machines + kErrataICH7ISTBuffer = (1 << 12), // buffer for Isochronous Scheduling Threshold + kErrataUHCISupportsOvercurrent = (1 << 13), // UHCI controller supports overcurrent detection + kErrataNeedsOvercurrentDebounce = (1 << 14), // The overcurrent indicator should be debounced by 10ms + kErrataSupportsPortResumeEnable = (1 << 15), // UHCI has resume enable bits at config address 0xC4 + kErrataNoCSonSplitIsoch = (1 << 16), // MCP79 - split iscoh is a little different + kErrataOHCINoGlobalSuspendOnSleep = (1 << 17), // when sleeping, do not put the OHCI controller in SUSPEND state. just leave it Operational with suspended downstream ports + kErrataMissingPortChangeInt = (1 << 18), // sometimes the port change interrupt may be missing + kErrataMCP79IgnoreDisconnect = (1 << 19), // MCP79 - need to ignore a connect/disconnect on wake + kErrataUse32bitEHCI = (1 << 20) , // MCP79 - EHCI should only run with 32 bit DMA addresses + kErrataUHCISupportsResumeDetectOnConnect = (1 << 21), // UHCI controller will generate a ResumeDetect interrupt while in Global Suspend if a device is plugged in + kErrataDontUseCompanionController = (1 << 22) // For systems which will end up being EHCI only +}; + +enum +{ + kUSBWatchdogTimeoutMS = 1000 +}; + + +/*! + @struct + @discussion This table contains the list of errata that are necessary for known problems with particular devices. + The format is vendorID, product ID, lowest revisionID needing errata, highest rev needing errata, errataBits. + The result of all matches is ORed together, so more than one entry may match. + Typically for a given errata a list of revisions that this applies to is supplied. + @field vendID The Vendor ID of the device + @field deviceID Product ID of device + @field revisionLo Lowest product revsion to apply errata to + @field revisionHi Highest product revision to apply errata to + @field errata Bit field flagging which errata to apply to device. +*/ + +struct ErrataListEntryStruct +{ + UInt16 vendID; + UInt16 deviceID; + UInt16 revisionLo; + UInt16 revisionHi; + UInt32 errata; +}; + +typedef struct ErrataListEntryStruct ErrataListEntry, *ErrataListEntryPtr; + + +//================================================================================================ +// +// Routines used to implement synchronous I/O +// +//================================================================================================ +// +void IOUSBSyncCompletion(void *target, void * parameter, IOReturn status, UInt32 bufferSizeRemaining); + +void IOUSBSyncIsoCompletion(void *target, void * parameter, IOReturn status, IOUSBIsocFrame *pFrames); + + +//================================================================================================ +// +// Forward Declarations +// +//================================================================================================ +// +class IOUSBDevice; +class IOUSBLog; +class IOUSBHubDevice; +class IOUSBRootHubDevice; +class IOMemoryDescriptor; + + +//================================================================================================ +// +// IOUSBController Class +// +//================================================================================================ +// +/*! + @class IOUSBController + @abstract Base class for USB hardware driver + @discussion Not many directly useful methods for USB device driver writers, + IOUSBDevice, IOUSBInterface and IOUSBPipe provide more useful abstractions. + The bulk of this class interfaces between IOKit and the low-level UIM, which is + based on the MacOS9 UIM. To impliment a new controller type, subclass + IOUSBController and impiment all the "UIM functions". AppleUSBOHCI + is an example of this implementing all the functions necessary to drive an + OHCI controller. +*/ +class IOUSBController : public IOUSBBus +{ + OSDeclareAbstractStructors(IOUSBController) + friend class IOUSBControllerV2; + friend class IOUSBControllerV3; + +protected: + + IOUSBWorkLoop * _workLoop; + IOCommandGate * _commandGate; + IOUSBRootHubDevice * _rootHubDevice; + UInt32 _devZeroLock; + static UInt32 _busCount; + static bool gUsedBusIDs[256]; + + struct ExpansionData + { + IOCommandPool *freeUSBCommandPool; + IOCommandPool *freeUSBIsocCommandPool; + IOTimerEventSource *watchdogUSBTimer; + bool _terminating; + bool _watchdogTimerActive; + bool _pcCardEjected; // Obsolete + UInt32 _busNumber; + UInt32 _currentSizeOfCommandPool; + UInt32 _currentSizeOfIsocCommandPool; + UInt8 _controllerSpeed; // Controller speed, passed down for splits + thread_call_t _terminatePCCardThread; // Obsolete + bool _addressPending[128]; + SInt32 _activeIsochTransfers; // isochronous transfers in the queue + IOService *_provider; // common name for our provider + bool _controllerCanSleep; // true iff the controller is able to support sleep/wake + bool _needToClose; + UInt32 _isochMaxBusStall; // value (in ns) of the maximum PCI bus stall allowed for Isoch.. + }; + ExpansionData *_expansionData; + + // The following methods do not use and upper case initial letter because they are part of IOKit + // + +public: + virtual bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual bool finalize(IOOptionBits options); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + +protected: + + IOReturn getNubResources( IOService * regEntry ); + + virtual UInt32 GetErrataBits( + UInt16 vendorID, + UInt16 deviceID, + UInt16 revisionID ); + + + static IOReturn DoDeleteEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoAbortEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoClearEPStall( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoCreateEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + static IOReturn DoControlTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoIOTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoIsocTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoLowLatencyIsocTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static void ControlPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void InterruptPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void BulkPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void IsocCompletionHandler( + OSObject * target, + void * parameter, + IOReturn status, + IOUSBIsocFrame *pFrames ); + + static void LowLatencyIsocCompletionHandler( + OSObject * target, + void * parameter, + IOReturn status, + IOUSBLowLatencyIsocFrame *pFrames ); + + static void WatchdogTimer(OSObject *target, IOTimerEventSource *sender); + + // Obsolete + static void TerminatePCCard(OSObject *target); + + static IOReturn ProtectedDevZeroLock(OSObject *target, void* lock, void *, void *, void*); + + + USBDeviceAddress GetNewAddress( void ); + + IOReturn ControlTransaction( IOUSBCommand * command ); + + IOReturn InterruptTransaction( IOUSBCommand * command ); + + IOReturn BulkTransaction( IOUSBCommand * command ); + + IOReturn IsocTransaction( IOUSBIsocCommand * command ); + + IOReturn LowLatencyIsocTransaction( IOUSBIsocCommand * command ); + + void FreeCommand( IOUSBCommand * command ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Invokes the specified completion action of the request. If + // the completion action is unspecified, no action is taken. + void Complete( + IOUSBCompletion completion, + IOReturn status, + UInt32 actualByteCount = 0 ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Invokes the specified completion action of the request. If + // the completion action is unspecified, no action is taken. + void CompleteWithTimeStamp ( + IOUSBCompletionWithTimeStamp completion, + IOReturn status, + UInt32 actualByteCount, + AbsoluteTime timeStamp); + + + + // + // UIM methods + // + +/*! + @function UIMInitialize + @abstract UIM function, initialise the controller and UIM data structures. +*/ + virtual IOReturn UIMInitialize( IOService * provider ) = 0; + +/*! + @function UIMFinalize + @abstract UIM function, finalise the controller and UIM data structures prior to removal. +*/ + virtual IOReturn UIMFinalize() = 0; + + // Control +/*! + @function UIMCreateControlEndpoint + @abstract UIM function, create a control endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param maxPacketSize Maximum packet size of this endpoint + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull +*/ + virtual IOReturn UIMCreateControlEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt16 maxPacketSize, + UInt8 speed) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + void * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + +/*! + @function UIMCreateControlTransfer + @abstract UIM function, Do a transfer on a control endpoint. + This method supercedes the method which takes a void * parameter. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param CBP Memory descriptor describing the buffer to transfer. Will never describe + memory which has disjoint packets. + @param bufferRounding If true, short packets are OK and do not cause an error + @param bufferSize Size of the data to transfer in the data phase. (C + @param direction Specifies direction and PID for transaction. kUSBIn, KUSBOut (DATA PID) or kUSBSetup (SETUP PID). +*/ + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Bulk +/*! + @function UIMCreateBulkEndpoint + @abstract UIM function, create a bulk endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull + @param maxPacketSize Maximum packet size of this endpoint +*/ + virtual IOReturn UIMCreateBulkEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt8 direction, + UInt8 speed, + UInt8 maxPacketSize) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateBulkTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Interrupt +/*! + @function UIMCreateInterruptEndpoint + @abstract UIM function, create an interrupt endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull + @param maxPacketSize Maximum packet size of this endpoint + @param pollingRate The maximum polling interval from the endpoint descriptor. +*/ + virtual IOReturn UIMCreateInterruptEndpoint( + short functionAddress, + short endpointNumber, + UInt8 direction, + short speed, + UInt16 maxPacketSize, + short pollingRate) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateInterruptTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Isoch +/*! + @function UIMCreateIsochEndpoint + @abstract Create an Isochronous endpoint in the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param maxPacketSize Maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMCreateIsochEndpoint( + short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction) = 0; + +/*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param direction Specifies direction for transfer. kUSBIn or KUSBOut. + @param frameStart The frame number in which to start the transactions + @param pBuffer describes memory buffer. + @param frameCount number of frames to do transactions in + @param pFrames Describes transactions in individual frames, gives sizes and reults for transactions. +*/ + virtual IOReturn UIMCreateIsochTransfer( + short functionAddress, + short endpointNumber, + IOUSBIsocCompletion completion, + UInt8 direction, + UInt64 frameStart, + IOMemoryDescriptor * pBuffer, + UInt32 frameCount, + IOUSBIsocFrame *pFrames) = 0; + +/*! + @function UIMAbortEndpoint + @abstract UIM function Abort the specified endpoint, return all transactions queued on it. + @param functionNumber The USB device ID of the device to Abort + @param endpointNumber The endpoint number to Abort + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMAbortEndpoint( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMDeleteEndpoint + @abstract UIM function Delete the specified endpoint, returning all transactions queued on it. + @param functionNumber The USB device ID of the device to Delete + @param endpointNumber The endpoint number to Delete + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMDeleteEndpoint( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMClearEndpointStall + @abstract UIM function Clear stall on the specified endpoint, set data toggle to zero, + return all transactions queued on it. + @param functionNumber The USB device ID of the device to Clear + @param endpointNumber The endpoint number to Clear + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMClearEndpointStall( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMRootHubStatusChange + @abstract UIM function UIMRootHubStatusChange - This method was internal to the UIM (never called by the superclass) until + IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can + still be used internally only. For subclasses of IOUSBControllerV3, however, the meaning has changed + slightly. Now, it is used to determine if there is a status change on the root hub, and if so, it + needs to update the IOUSBControllerV3 instance variable _rootHubStatusChangedBitmap +*/ + virtual void UIMRootHubStatusChange(void) = 0; + + static const IORegistryPlane *gIOUSBPlane; + +public: + + static IOUSBLog *_log; + + IOCommandGate * GetCommandGate(void); + + /*! + @struct Endpoint + Describes an endpoint of a device. + Simply an easier to use version of the endpoint descriptor. + @field descriptor The raw endpoint descriptor. + @field number Endpoint number + @field direction Endpoint direction: kUSBOut, kUSBIn, kUSBAnyDirn + @field transferType Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt + @field maxPacketSize Maximum packet size for endpoint + @field interval Polling interval in milliseconds (only relevent for Interrupt endpoints) + */ + struct Endpoint { + IOUSBEndpointDescriptor * descriptor; + UInt8 number; + UInt8 direction; // in, out + UInt8 transferType; // cntrl, bulk, isoc, int + UInt16 maxPacketSize; + UInt8 interval; + }; + + // Implements IOService::getWorkLoop const member function + virtual IOWorkLoop * getWorkLoop() const; + + /* + * Root hub methods + * Only of interest to the IOUSBRootHubDevice object + */ +/*! + @function GetRootHubDeviceDescriptor + @abstract UIM function, return the device descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for device descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubDeviceDescriptor( IOUSBDeviceDescriptor *desc ) = 0; + +/*! + @function GetRootHubDescriptor + @abstract UIM function, return the hub descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for hub descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubDescriptor( IOUSBHubDescriptor *desc ) = 0; + +/*! + @function SetRootHubDescriptor + @abstract UIM function, optional. Set the hub descriptor data. + As SET_DESCRIPTOR control request for hub descrptor + @param buffer Descriptor data +*/ + virtual IOReturn SetRootHubDescriptor( OSData *buffer ) = 0; + +/*! + @function GetRootHubConfDescriptor + @abstract UIM function, retrun the configuration descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for configuration descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubConfDescriptor( OSData *desc ) = 0; + +/*! + @function GetRootHubStatus + @abstract UIM function, get the status of the root hub. As GET_STATUS control request to device. + @param status Status structure to return +*/ + virtual IOReturn GetRootHubStatus( IOUSBHubStatus *status ) = 0; + +/*! + @function SetRootHubFeature + @abstract UIM function, set feature of root hub, As SET_FEATURE control request. + @param wValue The feature to set, as would be transferred in wValue field of SETUP packet. +*/ + virtual IOReturn SetRootHubFeature( UInt16 wValue ) = 0; + +/*! + @function ClearRootHubFeature + @abstract UIM function, set feature of root hub, As CLEAR_FEATURE control request. + @param wValue The feature to clear, as would be transferred in wValue field of SETUP packet. +*/ + virtual IOReturn ClearRootHubFeature( UInt16 wValue ) = 0; + +/*! + @function GetRootHubPortStatus + @abstract UIM function, get the status of a root hub port. As GET_STATUS control request to the port. + @param status Status structure to return + @param port Port to get status for. +*/ + virtual IOReturn GetRootHubPortStatus( IOUSBHubPortStatus *status, UInt16 port ) = 0; + +/*! + @function SetRootHubPortFeature + @abstract UIM function, set feature of a root hub port, As SET_FEATURE control request to a port. + @param wValue The feature to set, as would be transferred in wValue field of SETUP packet. + @param port Port to set feature for +*/ + virtual IOReturn SetRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0; + +/*! + @function ClearRootHubPortFeature + @abstract UIM function, clear feature of a root hub port, As CLEAR_FEATURE control request to a port. + @param wValue The feature to clear, as would be transferred in wValue field of SETUP packet. + @param port Port to clear feature for +*/ + virtual IOReturn ClearRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0; + +/*! + @function ClearRootHubPortFeature + @abstract UIM function, Impliments GET_BUS_STATE control request, now obsolete. +*/ + virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0; + +/*! + @function SetHubAddress + @abstract UIM function, set the address of the simulated root hub device, as SET_ADDRESS + @param wValue New address for root hub. +*/ + virtual IOReturn SetHubAddress( UInt16 wValue ) = 0; + + + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBHighSpeed or kUSBLowSpeed + @param endpoint description of endpoint to connect to + */ + virtual IOReturn OpenPipe( USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint ); + /*! + @function closePipe + Close a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ClosePipe( USBDeviceAddress address, + Endpoint * endpoint ); + + // Controlling pipe state + /*! + @function abortPipe + Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn AbortPipe( + USBDeviceAddress address, + Endpoint * endpoint ); + /*! + @function resetPipe + Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ResetPipe( USBDeviceAddress address, + Endpoint * endpoint ); + /*! + @function clearPipeStall + Clear a pipe stall. + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ClearPipeStall( USBDeviceAddress address, + Endpoint * endpoint ); + + // Transferring Data + /*! + @function read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion ); + /*! + @function write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion ); + + /*! + @function isocIO + Read from or write to an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn IsocIO( IOMemoryDescriptor * buffer, + UInt64 frameStart, + UInt32 numFrames, + IOUSBIsocFrame * frameList, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBIsocCompletion * completion ); + /*! + @function deviceRequest + Make a control request to the specified endpoint + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + @param address Address of the device on the USB bus + @param epNum endpoint number + */ + virtual IOReturn DeviceRequest( IOUSBDevRequest * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum ); + + virtual IOReturn DeviceRequest( IOUSBDevRequestDesc * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum ); + + /* + * Methods used by the hub driver to initialize a device + */ + /*! + @function AcquireDeviceZero + Get the device zero lock - call this before resetting a device, to ensure there's + only one device with address 0 + */ + virtual IOReturn AcquireDeviceZero( void ); + /*! + @function ReleaseDeviceZero + Release the device zero lock - call this to release the device zero lock, + when there is no longer a device at address 0 + */ + virtual void ReleaseDeviceZero( void ); + + // non-virtual methods + void WaitForReleaseDeviceZero( void ); + IOReturn ConfigureDeviceZero( UInt8 maxPacketSize, UInt8 speed ); + IOReturn GetDeviceZeroDescriptor( IOUSBDeviceDescriptor * desc, UInt16 size ); + IOReturn SetDeviceZeroAddress(USBDeviceAddress address); + IOUSBDevice * MakeDevice(USBDeviceAddress *address); + IOUSBHubDevice * MakeHubDevice(USBDeviceAddress *address); + IOReturn CreateDevice( IOUSBDevice * device, + USBDeviceAddress deviceAddress, + UInt8 maxPacketSize, + UInt8 speed, + UInt32 powerAvailable ); + + /*! + @function GetBandwidthAvailable + Returns the available bandwidth (in bytes) per frame or microframe for + isochronous transfers. + @result maximum number of bytes that a new iso pipe could transfer + per frame given current allocations. + */ + virtual UInt32 GetBandwidthAvailable( void ) = 0; + + /*! + @function GetFrameNumber + Returns the full current frame number. + @result The frame number. + */ + virtual UInt64 GetFrameNumber( void ) = 0; + + /*! + @function GetFrameNumber32 + Returns the least significant 32 bits of the frame number. + @result The lsb 32 bits of the frame number. + */ + virtual UInt32 GetFrameNumber32( void ) = 0; + + // Debugger polled mode + virtual void PollInterrupts( IOUSBCompletionAction safeAction = 0 ) = 0; + + virtual IOReturn PolledRead( + short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize); + + OSMetaClassDeclareReservedUsed(IOUSBController, 0); + virtual void UIMCheckForTimeouts(void); + + OSMetaClassDeclareReservedUsed(IOUSBController, 1); + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCommand* command, + void* CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction); + + OSMetaClassDeclareReservedUsed(IOUSBController, 2); + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCommand* command, + IOMemoryDescriptor* CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction); + + OSMetaClassDeclareReservedUsed(IOUSBController, 3); +/*! + @function UIMCreateBulkTransfer + @abstract UIM function, Do a transfer on a bulk endpoint. + This method supercedes the method which takes multiple parameters. + @param command paramters for transfer. +*/ + virtual IOReturn UIMCreateBulkTransfer(IOUSBCommand* command); + + OSMetaClassDeclareReservedUsed(IOUSBController, 4); +/*! + @function UIMCreateInterruptTransfer + @abstract UIM function, Do a transfer on an interrupt endpoint. + This method supercedes the method which takes multiple parameters. + @param command paramters for transfer. +*/ + virtual IOReturn UIMCreateInterruptTransfer(IOUSBCommand* command); + + /*! + @function deviceRequest + Make a control request to the specified endpoint + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + @param address Address of the device on the USB bus + @param epNum endpoint number + */ + OSMetaClassDeclareReservedUsed(IOUSBController, 5); + virtual IOReturn DeviceRequest( IOUSBDevRequest * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 6); + virtual IOReturn DeviceRequest( IOUSBDevRequestDesc * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + + + OSMetaClassDeclareReservedUsed(IOUSBController, 7); + /*! + @function read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 8); + /*! + @function write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + // this should really not be using a padding slot, since free is in our superclas, but we shipped this way so now we need to leave it. + OSMetaClassDeclareReservedUsed(IOUSBController, 9); + virtual void free(); + +protected: + +/*! + @function UIMRootHubStatusChange(bool) + @abstract UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until + IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can + still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete + (it still needs to be implemented since it is pure virtual) +*/ + OSMetaClassDeclareReservedUsed(IOUSBController, 10); + virtual void UIMRootHubStatusChange( bool abort ) = 0; + +public: + + OSMetaClassDeclareReservedUsed(IOUSBController, 11); + virtual IOReturn CreateRootHubDevice( IOService * provider, IOUSBRootHubDevice ** rootHubDevice); + + OSMetaClassDeclareReservedUsed(IOUSBController, 12); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 13); + /*! + @function Write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 14); + + virtual IOReturn GetRootHubStringDescriptor(UInt8 index, OSData *desc) = 0; + + OSMetaClassDeclareReservedUsed(IOUSBController, 15); + /*! + @function IsocIO + Read from or write to an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param updateFrequency describes how often to update the framelist once the transfer has completed (in ms) + */ + virtual IOReturn IsocIO( IOMemoryDescriptor * buffer, + UInt64 frameStart, + UInt32 numFrames, + IOUSBLowLatencyIsocFrame * frameList, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBLowLatencyIsocCompletion * completion, + UInt32 updateFrequency ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 16); + + /*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param direction Specifies direction for transfer. kUSBIn or KUSBOut. + @param frameStart The frame number in which to start the transactions + @param pBuffer describes memory buffer. + @param frameCount number of frames to do transactions in + @param pFrames Describes transactions in individual frames, gives sizes and reults for transactions. + @param updateFrequency Describes how often we update the frameList parameters (in ms) + */ + virtual IOReturn UIMCreateIsochTransfer( + short functionAddress, + short endpointNumber, + IOUSBIsocCompletion completion, + UInt8 direction, + UInt64 frameStart, + IOMemoryDescriptor * pBuffer, + UInt32 frameCount, + IOUSBLowLatencyIsocFrame *pFrames, + UInt32 updateFrequency); + + + OSMetaClassDeclareReservedUsed(IOUSBController, 17); + virtual IOReturn CheckForDisjointDescriptor(IOUSBCommand *command, UInt16 maxPacketSize); + + /*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param command an IOUSBIsocCommand object with all the necessary information + */ + OSMetaClassDeclareReservedUsed(IOUSBController, 18); + virtual IOReturn UIMCreateIsochTransfer(IOUSBIsocCommand *command); + + // do not use this slot without first checking bug rdar://6022420 + OSMetaClassDeclareReservedUnused(IOUSBController, 19); + +protected: + void IncreaseIsocCommandPool(); + void IncreaseCommandPool(); + void ParsePCILocation(const char *str, int *deviceNum, int *functionNum); + int ValueOfHexDigit(char c); +}; + +#endif /* ! _IOKIT_IOUSBCONTROLLER_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerListElement.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerListElement.h.svn-base new file mode 100644 index 0000000..7351177 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerListElement.h.svn-base @@ -0,0 +1,126 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1998-2007 Apple Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOUSBCONTROLLERLISTELEMENT_H +#define _IOUSBCONTROLLERLISTELEMENT_H + + +#include <libkern/c++/OSObject.h> + +#include <IOKit/IOTypes.h> + +#include <IOKit/usb/USB.h> + + +/*! + @class IOUSBControllerListElement + @abstract Used by the IOUSBController to manage the USB controller lists that are common between EHCI and UHCI. + */ +class IOUSBControllerListElement : public OSObject +{ + OSDeclareDefaultStructors(IOUSBControllerListElement) + +private: + +public: + + virtual void SetPhysicalLink(IOPhysicalAddress next) = 0; + virtual IOPhysicalAddress GetPhysicalLink(void) = 0; + virtual IOPhysicalAddress GetPhysicalAddrWithType(void) = 0; + virtual void print(int level); + + IOPhysicalAddress _sharedPhysical; // phys address of the memory shared with the controller + void * _sharedLogical; // logical address of the above + IOUSBControllerListElement *_logicalNext; // the next element in the list + +}; + + +class IOUSBControllerV2; // needed for a parameter +class IOUSBControllerIsochEndpoint; + +class IOUSBControllerIsochListElement : public IOUSBControllerListElement +{ + OSDeclareDefaultStructors(IOUSBControllerIsochListElement) + +private: + +public: + + virtual void SetPhysicalLink(IOPhysicalAddress next) = 0; + virtual IOPhysicalAddress GetPhysicalLink(void) = 0; + virtual IOPhysicalAddress GetPhysicalAddrWithType(void) = 0; + virtual void print(int level); + + IOUSBControllerIsochEndpoint *_pEndpoint; + IOUSBIsocFrame *_pFrames; + IOUSBIsocCompletion _completion; + Boolean _lowLatency; + bool _requestFromRosettaClient; // True if the request originated from a Rosetta client in user space + UInt8 _framesInTD; // used for HS Isoch only + UInt64 _frameNumber; // frame number for scheduling purposes + UInt32 _frameIndex; // index into the myFrames array + IOUSBControllerIsochListElement *_doneQueueLink; // linkage used by done queue processing + + // pure virtual methods which must be implemented by descendants + virtual IOReturn UpdateFrameList(AbsoluteTime timeStamp) = 0; + virtual IOReturn Deallocate(IOUSBControllerV2 *uim) = 0; +}; + +class IOUSBControllerIsochEndpoint : public OSObject +{ + OSDeclareDefaultStructors(IOUSBControllerIsochEndpoint) + +public: + + virtual bool init(); + + IOUSBControllerIsochEndpoint *nextEP; + IOUSBControllerIsochListElement *toDoList; // ITD or SITD + IOUSBControllerIsochListElement *toDoEnd; // ITD or SITD + IOUSBControllerIsochListElement *doneQueue; // ITD or SITD + IOUSBControllerIsochListElement *doneEnd; // ITD or SITD + IOUSBControllerIsochListElement *deferredQueue; // ITD or SITD + IOUSBControllerIsochListElement *deferredEnd; // ITD or SITD + UInt64 firstAvailableFrame; // next frame available for a transfer on this EP + UInt32 maxPacketSize; + UInt32 activeTDs; // + when added to todo list, - when taken from done queue + UInt32 onToDoList; // + when added to todo list, - when taken from done queue + UInt32 onDoneQueue; // + when added to todo list, - when taken from done queue + volatile SInt32 scheduledTDs; // + when linked onto periodic list, - when unlinked + UInt32 deferredTDs; + UInt32 onProducerQ; + UInt32 onReversedList; + UInt16 inSlot; // where Isoc TDs are being put in the periodic list + short functionAddress; + short endpointNumber; + IOReturn accumulatedStatus; + UInt32 interval; // this is the decoded interval value for HS endpoints and is 1 for FS endpoints + UInt8 direction; + bool aborting; +}; + + +#endif + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerV2.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerV2.h.svn-base new file mode 100644 index 0000000..4d2c306 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerV2.h.svn-base @@ -0,0 +1,374 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCONTROLLERV2_H +#define _IOKIT_IOUSBCONTROLLERV2_H + +#include <IOKit/IODMACommand.h> + +#include <IOKit/usb/IOUSBControllerListElement.h> +#include <IOKit/usb/IOUSBController.h> + +enum +{ + kUSBHSHubCommandAddHub = 1, + kUSBHSHubCommandRemoveHub = 2, + + kUSBHSHubFlagsMultiTT = 1 +}; + + +/*! + @class IOUSBControllerV2 + @abstract subclass of the IOUSBController to provide support for high speed + devices and split transactions. + @discussion The IOUSBController class provide sufficient functionality to + work with full (12Mb/s) and low (1.5Mb/s) devices. IOUSBControllerV2 + introduces the support for high (480Mb/s) speed devices from the + USB 2.0 spec. In particular IOUSBControllerV2 indicates the high + speed hub a full or low speed device is attached to so that split + transactions can be directed to the hub at high speed to be forwarded + to the full or low speed device by the hub. + It also gives support for bulk endoints of greater than 256 bytes. +*/ + +class IOUSBControllerV2 : public IOUSBController +{ + OSDeclareAbstractStructors(IOUSBControllerV2) + +protected: + + // These for keeping track of high speed ancestor to allow controller to do splits. + // + UInt8 _highSpeedHub[128]; + UInt8 _highSpeedPort[128]; + + struct V2ExpansionData { + UInt8 _multiTT[128]; + IOUSBCommand *ClearTTCommand; + IOUSBControllerIsochEndpoint *_isochEPList; // linked list of active Isoch "endpoints" + IOUSBControllerIsochEndpoint *_freeIsochEPList; // linked list of freed Isoch EP data structures + thread_call_t _returnIsochDoneQueueThread; + }; + V2ExpansionData *_v2ExpansionData; + + // Super's expansion data + #define _freeUSBCommandPool _expansionData->freeUSBCommandPool + #define _freeUSBIsocCommandPool _expansionData->freeUSBIsocCommandPool + #define _watchdogUSBTimer _expansionData->watchdogUSBTimer + #define _controllerTerminating _expansionData->_terminating + #define _watchdogTimerActive _expansionData->_watchdogTimerActive + #define _busNumber _expansionData->_busNumber + #define _currentSizeOfCommandPool _expansionData->_currentSizeOfCommandPool + #define _currentSizeOfIsocCommandPool _expansionData->_currentSizeOfIsocCommandPool + #define _controllerSpeed _expansionData->_controllerSpeed + #define _activeIsochTransfers _expansionData->_activeIsochTransfers + + // this class's expansion data + #define _isochEPList _v2ExpansionData->_isochEPList + #define _freeIsochEPList _v2ExpansionData->_freeIsochEPList + #define _returnIsochDoneQueueThread _v2ExpansionData->_returnIsochDoneQueueThread + + virtual bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void free(); + + static IOReturn DoCreateEP(OSObject *owner, + void *arg0, void *arg1, + void *arg2, void *arg3); + + static void clearTTHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + +public: + + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBDeviceSpeedLow, kUSBDeviceSpeedFull or kUSBDeviceSpeedHigh + @param endpoint description of endpoint to connect to + */ + virtual IOReturn OpenPipe( USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint ); + + /*! + @function CreateDevice + @abstract Create a new device as IOUSBController, making a note of the + high speed hub device ID and port number the full/low speed + device is attached to. + @param newDevice new device object to work with + @param deviceAddress USB device ID + @param maxPacketSize max packet size of endpoint zero + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param powerAvailable power available to the device + @param hub USB ID of hub the device is immediatly attached to. (Not necessarily high speed) + @param port port number of port the device is attached to. +*/ + virtual IOReturn CreateDevice( IOUSBDevice *newDevice, + USBDeviceAddress deviceAddress, + UInt8 maxPacketSize, + UInt8 speed, + UInt32 powerAvailable, + USBDeviceAddress hub, + int port); + +/*! + @function ConfigureDeviceZero + @abstract configure pipe zero of device zero, as IOUSBController, but also keeping + note of high speed hub device is attached to. + @param maxPacketSize max packet size for the pipe + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param hub USB ID of hub the device is immediatly attached to. (Not necessarily high speed) + @param port port number of port the device is attached to. +*/ + virtual IOReturn ConfigureDeviceZero(UInt8 maxPacketSize, UInt8 speed, USBDeviceAddress hub, int port); + +/*! + @function UIMCreateControlEndpoint + @abstract Create an endpoint in the controller to do control transactions. + @param functionNumber USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateControlEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt16 maxPacketSize, + UInt8 speed, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateBulkEndpoint + @abstract Create an endpoint in the controller to do bulk transactions. + @param functionNumber USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param direction Direction of data flow. kUSBIn or kUSBOut + @param maxPacketSize maximum packet size of this endpoint + @param speed speed of the device kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateBulkEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt8 direction, + UInt8 speed, + UInt16 maxPacketSize, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateInterruptEndpoint + @abstract Create an endpoint in the controller to do interrupt transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param direction Direction of data flow. kUSBIn or kUSBOut + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param maxPacketSize maximum packet size of this endpoint + @param pollingRate The maximum polling interval from the endpoint descriptor. + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateInterruptEndpoint( + short functionAddress, + short endpointNumber, + UInt8 direction, + short speed, + UInt16 maxPacketSize, + short pollingRate, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateIsochEndpoint + @abstract Create an endpoint in the controller to do Isochronous transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateIsochEndpoint( + short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + + + static void ReturnIsochDoneQueueEntry(OSObject *target, thread_call_param_t endpointPtr); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 0); + virtual IOReturn AddHSHub(USBDeviceAddress highSpeedHub, UInt32 flags); + + static IOReturn DOHSHubMaintenance(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 1); + virtual IOReturn UIMHubMaintenance(USBDeviceAddress highSpeedHub, UInt32 highSpeedPort, UInt32 command, UInt32 flags); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 2); + virtual IOReturn RemoveHSHub(USBDeviceAddress highSpeedHub); + + static IOReturn DOSetTestMode(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 3); + virtual IOReturn SetTestMode(UInt32 mode, UInt32 port); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 4); + virtual IOReturn UIMSetTestMode(UInt32 mode, UInt32 port); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 5); + virtual UInt64 GetMicroFrameNumber( void ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 6); + virtual void ClearTT(USBDeviceAddress addr, UInt8 endpt, Boolean IN); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 7); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn ReadV2( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletionWithTimeStamp * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 8); +/*! + @function UIMCreateIsochEndpoint + @abstract Create an endpoint in the controller to do Isochronous transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to + @param interval The encoded interval value from the endpoint descriptor +*/ + virtual IOReturn UIMCreateIsochEndpoint( short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction, + USBDeviceAddress highSpeedHub, + int highSpeedPort, + UInt8 interval); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 9); + virtual IOUSBControllerIsochEndpoint* AllocateIsochEP(void); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 10); + virtual IOReturn DeallocateIsochEP(IOUSBControllerIsochEndpoint *pEP); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 11); + virtual IOUSBControllerIsochEndpoint* FindIsochronousEndpoint(short functionNumber, short endpointNumber, short direction, IOUSBControllerIsochEndpoint* *pEDBack); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 12); + virtual IOUSBControllerIsochEndpoint* CreateIsochronousEndpoint(short functionNumber, short endpointNumber, short direction); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 13); + virtual void PutTDonToDoList(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 14); + virtual IOUSBControllerIsochListElement *GetTDfromToDoList(IOUSBControllerIsochEndpoint* pED); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 15); + virtual void PutTDonDeferredQueue(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 16); + virtual IOUSBControllerIsochListElement *GetTDfromDeferredQueue(IOUSBControllerIsochEndpoint* pED); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 17); + virtual void PutTDonDoneQueue(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD, bool checkDeferred); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 18); + virtual IOUSBControllerIsochListElement *GetTDfromDoneQueue(IOUSBControllerIsochEndpoint* pED); + + // 7185026 - this is to make this call from behind the gate + static IOReturn GatedGetTDfromDoneQueue(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 19); + virtual void ReturnIsochDoneQueue(IOUSBControllerIsochEndpoint*); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 20); + virtual IODMACommand *GetNewDMACommand(); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 21); + /*! + @function GetLowLatencyOptionsAndPhysicalMask + @abstract Low Latency transfers require that the client have access to the memory after the Isochronous I/O request has already been scheduled. This might be used, for example to fill in outgoing data "just in time." Some controllers, however, may have requirements which need to be followed in order to make sure that the memory buffer isn't moved after the call is made. This call will return an IOOptionBits and mach_vm_address_t which can be used in a call to IOBufferMemoryDescriptor::inTaskWithPhysicalMask which will help meet these requirements. + @param optionBits Pointer to an an IOOptionBits. The only bit which may be returned is kIOMemoryPhysicallyContiguous. Other bits, e.g. direction bits, must be ORd in by the client as needed. This call replaces the old property based method of obtaining this information. + @param physicalMask Pointer to a mach_vm_address_t which should be used in the call to IOBufferMemoryDescriptor::inTaskWithPhysicalMask and will guarantee that when the memory is wired down it will be accessible by both the client and the USB controller at the same time. + @result returns kIOReturnSuccess if the method is implemented by the controller, otherwise kIOReturnUnsupported + */ + virtual IOReturn GetLowLatencyOptionsAndPhysicalMask(IOOptionBits *optionBits, mach_vm_address_t *physicalMask); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 22); + /*! + @function GetFrameNumberWithTime + @abstract Real Time A/V applications send and receive Iscohronous data scheduled on certain USB frame numbers. The clock for these frame numbers is independent of the system clock, and drivers need to synchronize these two clocks. This routine will return a system time which corresponds to the beginning of a USB frame number. It is not necessarily the currrent frame, but it will be a frame in the recent past (within the past minute). The jitter between the start of the USB frame and the system time will be as low as possible, but due to hardware interrupt latencies could be as high as 200 microseconds. + @param frameNumber A pointer to a UInt64 in which to hold the USB frame number corresponding to the given system time. + @param theTime A pointer to an AbsoluteTime corresponding to the system time at the beginning of the given USB frame number. + @result returns kIOReturnSuccess if the method is implemented by the controller, otherwise kIOReturnUnsupported + */ + virtual IOReturn GetFrameNumberWithTime(UInt64* frameNumber, AbsoluteTime *theTime); + + + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 23); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 24); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 25); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 26); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 27); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 28); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 29); + +}; + + +#endif /* ! _IOKIT_IOUSBCONTROLLERV2_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerV3.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerV3.h.svn-base new file mode 100644 index 0000000..22da915 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBControllerV3.h.svn-base @@ -0,0 +1,233 @@ +/* +* Copyright (c) 2007-2008 Apple Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.2 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +* Please see the License for the specific language governing rights and +* limitations under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ + +#ifndef _IOKIT_IOUSBCONTROLLERV3_H +#define _IOKIT_IOUSBCONTROLLERV3_H + +#include <IOKit/pci/IOPCIDevice.h> + +#include <IOKit/usb/IOUSBControllerV2.h> +#include <IOKit/usb/IOUSBHubDevice.h> + +// Constants that define the different power states in the setPowerState call +enum +{ + kUSBPowerStateOff = 0, // controller is reset, nothing is attached + kUSBPowerStateRestart = 1, // same as OFF + kUSBPowerStateSleep = 2, // controller is suspended, preparing to lose main power + kUSBPowerStateLowPower = 3, // controller is suspended, power remains on + kUSBPowerStateOn = 4, // up and running + kUSBNumberBusPowerStates = 5 +}; + +#define kUSBPowerStateStable -1 + +enum +{ + kUSBBusStateReset = 0, // bus is in RESET + kUSBBusStateSuspended = 1, // bus is in SUSPEND mode + kUSBBusStateRunning = 2 // bus is operational +}; + + +// Root Hub things +typedef struct IOUSBRootHubInterruptTransaction +{ + IOMemoryDescriptor * buf; + UInt32 bufLen; + IOUSBCompletion completion; +} IOUSBRootHubInterruptTransaction; + +enum +{ + kIOUSBMaxRootHubTransactions = 2 +}; + + + +/*! + @class IOUSBControllerV3 + @abstract subclass of the IOUSBControllerV2 to provide support for new USB Power Management techniques. + @discussion With Leopard, we are providing more information to USB Device Drivers in the IOPower + tree to allow for more efficient Power Management. This controller class encapulates many of the changes + needed for that, without disturbing third party subclasses of IOUSBController or IOUSBControllerV2 + */ + +class IOUSBControllerV3 : public IOUSBControllerV2 +{ + OSDeclareAbstractStructors(IOUSBControllerV3) + + protected: + // static variable shared by all instances + static uint32_t * _gHibernateState; + + + UInt8 _myBusState; // kUSBBusStateReset, kUSBBusStateSuspended, kUSBBusStateRunning + bool _wakingFromHibernation; // True while the Hibernation Wake thread is active + bool _needToAckPowerDown; // True while we are changing power state due to shutdown/restart + bool _onCardBus; // OBSOLETE + bool _controllerAvailable; // true if we can talk to the controller + SInt32 _powerStateChangingTo; // a power state that we are in the process of changing to, or -1 if we are stable + bool _poweringDown; // true is the controller is powering down because of a systemWillPowerDown message + bool _restarting; // true is the controller is restarting because of a systemWillPowerDown message + unsigned long _myPowerState; // my current state (since getPowerState doesn't always change in time) + IOUSBControllerV3 *_ehciController; // set if I am a companion controller + unsigned long _numPowerStates; // how many power states do I support (defaults to kUSBNumDefaultPowerStates) + IOPMPowerState *_myPowerStates; // my power state array (allocated on the fly) + IOPCIDevice *_device; // my PCI device + + // root hub support + IOTimerEventSource *_rootHubTimer; // timer which fires at the rate of the root hub interrupt endpoint + UInt8 _rootHubPollingRate; // Obsolete -- we need to have it be a uint32_t + UInt8 _rootHubNumPorts; // number of root hub ports - should be 15 or fewer! + UInt16 _rootHubStatusChangedBitmap; // support up to 15 ports for status changes + bool _rootHubTimerActive; // UNUSED + IOUSBRootHubInterruptTransaction _outstandingRHTrans[4]; // Transactions for the Root Hub. We need 2, one for the current transaction and one for the next. This is declared as 4 for binary compatibility + + struct V3ExpansionData { + uint32_t _rootHubPollingRate32; + bool _rootHubTransactionWasAborted; + }; + V3ExpansionData *_v3ExpansionData; + + // IOKit methods + virtual bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ); + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags domainState ); + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual void powerChangeDone ( unsigned long fromState); + virtual void systemWillShutdown( IOOptionBits specifier ); + virtual void free(void); + + // IOUSBController methods + // we override these to deal with methods attempting to go through the workloop while we are in sleep + virtual IOReturn AcquireDeviceZero( void ); + virtual void ReleaseDeviceZero( void ); + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout); + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout); + virtual IOReturn ClosePipe(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn AbortPipe(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn ResetPipe(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn ClearPipeStall(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn Read(IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount); + virtual IOReturn Write(IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount); + virtual IOReturn IsocIO(IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBIsocCompletion *completion ); + virtual IOReturn IsocIO(IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBLowLatencyIsocCompletion *completion, UInt32 updateFrequency ); + + // IOUSBControllerV2 methods + // we override these to deal with methods attempting to go through the workloop while we are in sleep + virtual IOReturn OpenPipe(USBDeviceAddress address, UInt8 speed, Endpoint *endpoint); + virtual IOReturn AddHSHub(USBDeviceAddress highSpeedHub, UInt32 flags); + virtual IOReturn RemoveHSHub(USBDeviceAddress highSpeedHub); + virtual IOReturn SetTestMode(UInt32 mode, UInt32 port); + virtual IOReturn ReadV2(IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletionWithTimeStamp *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount); + + // IOUSBControllerV3 methods + + // these are called through the workloop + static IOReturn DoEnableAddressEndpoints(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3 ); + static IOReturn DoEnableAllEndpoints(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3 ); + static IOReturn GatedPowerChange(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3 ); + + // also on the workloop + static void RootHubTimerFired(OSObject *owner, IOTimerEventSource *sender); + + // subclassable methods + virtual IOReturn CheckForEHCIController(IOService *provider); + virtual IOReturn AllocatePowerStateArray(void); + virtual IOReturn InitForPM(void); + virtual IOReturn CheckPowerModeBeforeGatedCall(char *fromStr); + virtual IOReturn EnableAllEndpoints(bool enable); + virtual IOReturn EnableBusMastering(bool enable); + virtual IOReturn EnsureUsability(void); + virtual IOReturn CheckForRootHubChanges(void); + virtual IOReturn RootHubQueueInterruptRead(IOMemoryDescriptor *buf, UInt32 bufLen, IOUSBCompletion completion); + virtual IOReturn RootHubAbortInterruptRead(void); + virtual IOReturn RootHubStartTimer(UInt8 pollingRate); // Obsolete see RootHubStartTimer32 + virtual IOReturn RootHubStopTimer(void); + + // these methods have a default implementation using some of the virtual methods below + virtual void ControllerOff(void); + virtual void ControllerRestart(void); + virtual void ControllerSleep(void); + virtual void ControllerDoze(void); + virtual void ControllerOn(void); + + // these methods are pure virtual, and need to be implemented in the subclass driver + virtual IOReturn ResetControllerState(void) = 0; + virtual IOReturn RestartControllerFromReset(void) = 0; + virtual IOReturn SaveControllerStateForSleep(void) = 0; + virtual IOReturn RestoreControllerStateFromSleep(void) = 0; + virtual IOReturn DozeController(void) = 0; + virtual IOReturn WakeControllerFromDoze(void) = 0; + virtual IOReturn UIMEnableAddressEndpoints(USBDeviceAddress address, bool enable) = 0; + virtual IOReturn UIMEnableAllEndpoints(bool enable) = 0; + virtual IOReturn EnableInterruptsFromController(bool enable) = 0; + + public: + + // public methods + virtual IOReturn EnableAddressEndpoints(USBDeviceAddress address, bool enable); + virtual bool IsControllerAvailable(void); + virtual IOReturn HandlePowerChange(unsigned long powerStateOrdinal); + virtual UInt32 AllocateExtraRootHubPortPower(UInt32 extraPowerRequested); + virtual void ReturnExtraRootHubPortPower(UInt32 extraPowerReturned); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV3, 0); + virtual IOReturn RootHubStartTimer32(uint32_t pollingRate); + + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 1); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 2); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 3); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 4); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 5); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 6); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 7); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 8); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 9); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 10); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 11); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 12); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 13); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 14); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 15); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 16); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 17); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 18); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 19); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 20); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 21); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 22); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 23); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 24); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 25); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 26); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 27); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 28); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 29); +}; + +#endif // _IOKIT_IOUSBCONTROLLERV3_H \ No newline at end of file diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBDevice.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBDevice.h.svn-base new file mode 100644 index 0000000..58d73a0 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBDevice.h.svn-base @@ -0,0 +1,639 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OPEN_SOURCE__ +/* + * + * $Log: IOUSBDevice.h,v $ + * Revision 1.65 2009/10/18 20:20:37 nano + * Bring in fixes in 390.4.0 QL: 7310698 7301024 7307079 and 7310698 + * + * Revision 1.64.32.4 2009/10/15 21:17:43 nano + * If OverrideAtLocationID does not see a override property, return true + * + * Revision 1.64.32.3.2.1 2009/10/15 21:36:27 nano + * If OverrideAtLocationID does not see a override property, return true + * + * Revision 1.64.32.3 2009/10/14 19:16:15 nano + * Minor name changes + * + * Revision 1.64.32.2 2009/10/14 19:05:21 nano + * 7284477 7293893 Simplify scheme to decide whether we want to override a property for a hub at a particular ID for a particular MacModel. Added a IOUSBDevice API that tells us if we are in the right model and locationID to override a property + * + * Revision 1.64.32.1 2009/10/08 19:55:56 nano + * rdar://7284477 Allow us to overide the config descriptor of a 2514 hub on a K23F + * + * Revision 1.64 2009/09/08 12:28:45 nano + * <rdar://problem/7195788> IOUSBDevice headerdoc comment problem - GetNumConfigs name is wrong, should be GetNumConfigurations + * + * Revision 1.63 2009/05/07 19:43:09 nano + * Move our SnowLeopard branch to TOT + * + * Revision 1.57.84.6 2009/03/13 22:45:11 nano + * Bring in branches to fix 6676089 6675858 6567987 6490273 + * + * Revision 1.57.84.5.4.1 2009/03/11 20:01:56 nano + * rdar://6567987 Do not let a Reset or a ReEnumerate through while the other is executing. + * + * Revision 1.57.84.5 2009/02/26 13:44:32 nano + * Bring in rdar://6536090&6586312 to SL branch + * + * Revision 1.57.84.4.10.1 2009/02/25 00:51:06 rhoads + * change the mechanism of getConfigLock so as to prevent a deadlock + * + * Revision 1.57.84.4 2009/02/13 15:57:33 rhoads + * roll in rdars: 6213394, 6489431, 6513000, 6515115, 6535200, 6567783 + * + * Revision 1.57.84.3.48.3 2009/02/11 19:19:08 rhoads + * add back an expansionData variable to preserve binary compatibility + * + * Revision 1.57.84.3.48.2 2009/02/11 03:05:56 arulchan + * more ::SuspendDevice changes + * + * Revision 1.57.84.3.48.1 2009/01/23 21:34:15 arulchan + * fix for rdar://6213394 + * + * Revision 1.57.84.3 2008/06/16 21:31:16 nano + * Bring in changes from Foxhound 320.2.17 + * + * Revision 1.57.84.2 2008/04/22 22:38:01 nano + * Bring in changes from Foxhound-320.2.9 + * + * Revision 1.60.28.2 2008/05/22 17:36:18 nano + * Fix the reporting of the internal bit for GetDeviceInformation + * + * Revision 1.60.28.1 2008/05/21 17:51:43 nano + * <rdar://problem/5952635> GetDeviceInformation needs some fixes + * + * Revision 1.60 2008/04/18 22:03:28 nano + * Bring in fix for rdar://5874560 + * + * Revision 1.59.4.1 2008/04/18 21:55:55 nano + * <rdar://problem/5874560> Need API to know how much extra power has been allocated + * + * Revision 1.59 2008/04/17 16:56:57 nano + * Bring in branches for rdar://5867990 & rdar://5768343 + * + * Revision 1.58.4.1 2008/04/16 20:26:13 nano + * <rdar://problem/5867990> Add API to allocate sleep current, as well as making sure that we return any extra power if our client dies or our device is terminated without returning it + * + * Revision 1.58 2008/04/14 16:08:38 nano + * Add new APIs for high power and for GetDeviceInformation. + * + * Revision 1.57.126.2 2008/04/13 05:25:40 nano + * Call into PolicyMaker for the GetPortInformation + * + * Revision 1.57.126.1 2008/04/11 22:25:44 nano + * Initial work on new user-client APIs and new IOUSBDevice APIs to return port state information and manage extra power requests, as well as groundwork for calling the policy maker directly from the IOUSBDevice + * + * Revision 1.57 2007/08/07 20:30:36 rhoads + * rolled in a few branches to TOT + * + * Revision 1.56.92.1 2007/08/07 03:43:34 nano + * Bring in more changes for M89 suppport -- like actually use the dang power if the properties are available + * + * Revision 1.56 2007/03/06 12:23:41 rhoads + * roll in 5024412, 5035829, and 5039670 + * + * Revision 1.55.30.1 2007/02/27 16:08:33 rhoads + * some fine tuning of our IOService overrides, including not overriding willTerminate and didTerminate (5024412) + * + * Revision 1.55 2007/01/19 17:58:48 rhoads + * roll in branches for a leopard build + * + * Revision 1.54.30.1 2007/01/17 16:37:02 rhoads + * remove the IOUSBDevice::attach method which is not really useful + * + * Revision 1.54 2006/10/06 04:42:01 rhoads + * roll in branches 4727961, 4758404, 4759810, 4760274, and 4762769 + * + * Revision 1.53.4.1 2006/10/04 16:03:57 rhoads + * better IOUSBHubDevice design + * + */ +#endif + +#ifndef _IOKIT_IOUSBDEVICE_H +#define _IOKIT_IOUSBDEVICE_H + +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBPipe.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> + +#include <kern/thread_call.h> + +// The following are definitions for errata properties needed for different devices. This +// should be but in the dictionary of the IOUSBDevice in question. This can be achieved +// by using the AppleUSBMergeNub class and having an IOProviderMergeProperties dictionary +// with the required properties. + +// This property allows a device to specify a configuration value of 0 in its configuration +// descriptor. This does not follow the spec, but we will allow it in order to get the device +// to work. The property should be a Boolean +// +#define kAllowConfigValueOfZero "kAllowZeroConfigValue" +#define kAllowNumConfigsOfZero "kAllowZeroNumConfigs" + + +class IOUSBController; +class IOUSBControllerV2; +class IOUSBInterface; +class IOUSBHubPolicyMaker; +/*! + @class IOUSBDevice + @abstract The IOService object representing a device on the USB bus. + @discussion This class provides functionality to configure a device and to create + IOUSBInterface objects to represent the interfaces of the device. +*/ + +class IOUSBDevice : public IOUSBNub +{ + friend class IOUSBController; + friend class IOUSBControllerV2; + friend class IOUSBInterface; + friend class IOUSBPipe; + + OSDeclareDefaultStructors(IOUSBDevice) + +protected: + + USBDeviceAddress _address; + IOUSBController * _controller; + IOUSBPipe * _pipeZero; + IOUSBDeviceDescriptor _descriptor; + UInt32 _busPowerAvailable; + UInt8 _speed; + IOUSBEndpointDescriptor _endpointZero; // Fake ep for control pipe + void * _port; // Obsolete, do not use + IOBufferMemoryDescriptor** _configList; + IOUSBInterface** _interfaceList; + UInt8 _currentConfigValue; + UInt8 _numInterfaces; + + struct ExpansionData + { + UInt32 _portNumber; + thread_call_t _doPortResetThread; + IOUSBDevice * _usbPlaneParent; + bool _portResetThreadActive; + bool _allowConfigValueOfZero; + thread_call_t _doPortSuspendThread; + bool _portSuspendThreadActive; + thread_call_t _doPortReEnumerateThread; + bool _resetInProgress; + bool _portHasBeenReset; + IORecursiveLock* _XgetConfigLock; // Obsolete + bool _doneWaiting; // Obsolete + bool _notifiedWhileBooting; // Obsolete + IOWorkLoop * _workLoop; + IOTimerEventSource * _notifierHandlerTimer; + UInt32 _notificationType; + bool _suspendInProgress; + bool _portHasBeenSuspendedOrResumed; + bool _addExtraResetTime; + bool _suspendCommand; + IOCommandGate * _commandGate; + OSSet * _openInterfaces; + bool _resetCommand; + IOReturn _resetError; + IOReturn _suspendError; + thread_call_t _doMessageClientsThread; + IOUSBHubPolicyMaker * _hubPolicyMaker; + UInt32 _sleepPowerAllocated; // how much sleep power we already gave to our client + UInt32 _wakePowerAllocated; // how much extra power during wake did we already give our client + UInt32 _devicePortInfo; + bool _deviceIsInternal; // Will be set if all our upstream hubs are captive (internal to the computer) + bool _deviceIsInternalIsValid; // true if we have already determined whether the device is internal + bool _newGetConfigLock; // new lock, taken within the WL gate, when doing a GetConfig + UInt32 _resetAndReEnumerateLock; // "Lock" to prevent us from doing a reset or a re-enumerate while the other one is in progress + UInt32 _locationID; + }; + ExpansionData * _expansionData; + + const IOUSBConfigurationDescriptor *FindConfig(UInt8 configValue, UInt8 *configIndex=0); + + virtual IOUSBInterface * GetInterface(const IOUSBInterfaceDescriptor *interface); + +public: + virtual IOReturn SetFeature(UInt8 feature); + +protected: + virtual IOReturn GetConfigDescriptor(UInt8 configIndex, void *data, UInt32 len); + + virtual IOReturn GetDeviceDescriptor(IOUSBDeviceDescriptor *desc, UInt32 size); + + virtual bool init(USBDeviceAddress deviceAddress, UInt32 powerAvaiable, UInt8 speed, UInt8 maxPacketSize ); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 *score); + +public: + // IOService methods + virtual bool init( void ); + virtual bool start( IOService *provider ); + virtual bool handleIsOpen(const IOService *forClient) const; + virtual bool handleOpen(IOService *forClient, IOOptionBits options, void *arg); + virtual void handleClose(IOService *forClient, IOOptionBits options); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool terminate( IOOptionBits options = 0 ); + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + virtual void stop( IOService *provider ); + virtual bool finalize(IOOptionBits options); + virtual void free( void ); + + // IOUSBDevice methods + virtual void SetProperties(); + + static IOUSBDevice *NewDevice(void); + + virtual void SetPort(void *port); // Obsolete, do NOT use + + /*! + @function FindNextInterfaceDescriptor + return a pointer to the next interface descriptor within the given full configuration descriptor satisfying the requirements specified, or NULL if there aren't any. + @param configDescIn the configuration descriptor within which to search. obtained from GetFullConfigurationDescriptor(configIndex). use NULL to specify the current configuration's descriptor. + @param intfDesc interface descriptor from which to start the search. NULL for the first interface descriptor in the given configuration descriptor + @param request IOUSBFindInterfaceRequest specifying the desired interface. Not changed. + @param descOut pointer to placeholder for the returned descriptor ptr + @result returns kIOReturnBadArgument if configDesc is not correct, or if configDesc is NULL and the device is not configured, or if intfDesc is not in configDesc. Otherwise returns kIOReturnSuccess or kIOUSBInterfaceNotFound. + */ + virtual IOReturn FindNextInterfaceDescriptor(const IOUSBConfigurationDescriptor *configDescIn, + const IOUSBInterfaceDescriptor *intfDesc, + const IOUSBFindInterfaceRequest *request, + IOUSBInterfaceDescriptor **descOut); + /*! + @function FindNextInterface + return an pointer to an IOUSBInterface object satisfying the requirements specified in request, or NULL if there aren't any. the device + must be configured for there to be any interfaces. + @param current interface to start searching from, NULL to start at the beginning of the device's interface list for the current configuration. + @param request specifies what properties an interface must have to match. + @result Pointer to a matching IOUSBInterface, or NULL if none match. Note: The IOUSBInterface is NOT retained for the caller. If the caller wishes to continue to use the returned object, it should call retain() on that object. + */ + virtual IOUSBInterface *FindNextInterface(IOUSBInterface *current, + IOUSBFindInterfaceRequest *request); + + /*! + @function CreateInterfaceIterator + return an OSIterator to iterate through interfaces satisfying the requirements specified in request. + @param request specifies what properties an interface must have to match. + @result Pointer to an OSIterator. + */ + virtual OSIterator *CreateInterfaceIterator(IOUSBFindInterfaceRequest *request); + + // Get pointer to full config info (cached in device, don't free returned pointer) + /*! + @function GetFullConfigurationDescriptor + return a pointer to all the descriptors for the requested configuration. + @param configIndex The configuration index (not the configuration value) + @result Pointer to the descriptors, which are cached in the IOUSBDevice object. + */ + virtual const IOUSBConfigurationDescriptor *GetFullConfigurationDescriptor(UInt8 configIndex); + + /*! + @function GetConfigurationDescriptor + Copy the specified amount of data for a configuration into the suppled buffer. + @param configValue The configuration value + @param data Buffer to copy data into + @param len number of bytes to copy + */ + virtual IOReturn GetConfigurationDescriptor(UInt8 configValue, void *data, UInt32 len); + + /*! + @function ResetDevice + Reset the device, returning it to the addressed, unconfigured state. + This is useful if a device has got badly confused. Note that the AppleUSBComposite driver will automatically + reconfigure the device if it is a composite device. + */ + virtual IOReturn ResetDevice(); + + /*! + @function SetConfiguration + Do a USB SetConfiguration call to the device. The caller must have the device open() in order to + actually cause a configuration change. If the device is currently configured, all IOUSBInterface objects + associated with the device are freed. After the new configuration has been set, all of its IOUSBInterface objects are + instantiated automatically. + @param forClient The client requesting the configuration change + @param configValue The desired configuration value. + @param startInterfaceMatching A boolean specifying whether IOKit should begin the process of finding + matching drivers for the new IOUSBInterface objects. + */ + virtual IOReturn SetConfiguration(IOService *forClient, UInt8 configValue, bool startInterfaceMatching=true); + + // Access to addressing and cached info + /*! + @function GetAddress + returns the bus address of the device + */ + virtual USBDeviceAddress GetAddress(void); + + /*! + @function GetSpeed + returns the speed of the device + */ + virtual UInt8 GetSpeed(void); + /*! + @function GetBus + returns a pointer to the IOUSBController object for the device + */ + virtual IOUSBController *GetBus(void); + /*! + @function GetBusPowerAvailable + returns the power available to the device, in units of 2mA + */ + virtual UInt32 GetBusPowerAvailable( void ); + /*! + @function GetMaxPacketSize + returns the maximum packet size for endpoint zero (only 8, 16, 32, 64 are valid) + */ + virtual UInt8 GetMaxPacketSize(void); + /*! + @function GetVendorID + returns the Vendor ID of the device + */ + virtual UInt16 GetVendorID(void); + /*! + @function GetProductID + returns the Product ID of the device + */ + virtual UInt16 GetProductID(void); + /*! + @function GetDeviceRelease + returns the DeviceRelease information + */ + virtual UInt16 GetDeviceRelease(void); + /*! + @function GetNumConfigurations + returns the number of configs in the device config descriptor + */ + virtual UInt8 GetNumConfigurations(void); + /*! + @function GetManufacturerStringIndex + returns the index of string descriptor describing manufacturer + */ + virtual UInt8 GetManufacturerStringIndex(void ); + /*! + @function GetProductStringIndex + returns the index of string descriptor describing product + */ + virtual UInt8 GetProductStringIndex(void ); + /*! + @function GetSerialNumberStringIndex + returns the index of string descriptor describing the device's serial number + */ + virtual UInt8 GetSerialNumberStringIndex(void ); + /*! + @function GetPipeZero + returns a pointer to the device's default control pipe + */ + virtual IOUSBPipe * GetPipeZero(void); + + // Deprecated but needed for binary compatibility + virtual IOUSBPipe* MakePipe(const IOUSBEndpointDescriptor *ep); + + // this method is deprecated. use the other DeviceRequest methods + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, + IOUSBCompletion *completion = 0); + + // Same but with a memory descriptor + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, + IOUSBCompletion *completion = 0); + + /*! + @function GetConfiguration + Gets the current configuration from the IOUSBDevice object. Note that this call will send a control + request on the bus to get the current configuration from the physical device. + @param configNum Pointer to place to store configuration value. + */ + virtual IOReturn GetConfiguration(UInt8 *configNumber); + + /*! + @function GetDeviceStatus + Gets the device's status. Note that this sends a control request to the physical device. + @param status Pointer to place to store the status. + */ + virtual IOReturn GetDeviceStatus(USBStatus *status); + + /*! + @function GetStringDescriptor + Get a string descriptor as ASCII, in the specified language (default is US English) + @param index Index of the string descriptor to get. + @param buf Pointer to place to store ASCII string + @param maxLen Size of buffer pointed to by buf + @param lang Language to get string in (default is US English) + */ + virtual IOReturn GetStringDescriptor(UInt8 index, char *buf, int maxLen, UInt16 lang=0x409); + + /*! + @function GetChildLocationID + Get the locationID (UInt32) given the port number and the parent's location + @param parentLocationID locationID for the hub to which this device is attached. + @param port Port number of the hub where this device is attached + */ + virtual UInt32 GetChildLocationID(UInt32 parentLocationID, int port); + + virtual const IOUSBDescriptorHeader* FindNextDescriptor(const void *cur, UInt8 descType); + + virtual void DisplayNotEnoughPowerNotice(); + + // this is a non-virtual function so that we don't have to take up a binary compatibility slot. + UInt16 GetbcdUSB(void); + UInt8 GetProtocol(void); + void SetBusPowerAvailable(UInt32 newPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 0); + /*! + @function DeviceRequest + @abstract execute a control request to the default control pipe (pipe zero) + @param request The parameter block to send to the device + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + + */ + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + /*! + @function DeviceRequest + @abstract execute a control request to the default control pipe (pipe zero) + @param request The parameter block to send to the device (with the pData as an IOMemoryDesriptor) + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + + */ + OSMetaClassDeclareReservedUsed(IOUSBDevice, 1); + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 2); + /*! + @function SuspendDevice + @abstract Instruct the hub to which this device is attached to suspend or resume the port to which the device is attached. + Note that if there are any outstanding transactions on any pipes in the device, those transactions will get returned with a + kIOReturnNotResponding error. + @param suspend Boolean value. true = suspend, false = resume. + */ + virtual IOReturn SuspendDevice( bool suspend); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 3); + /*! + @function ReEnumerateDevice + @abstract Instruct the hub to which this device is attached to reset the port to which this device is attached. This causes the + IOUSBDevice object and any child objects (IOUSBInterface objects or driver objects) to be terminated, and the device to be + completely reenumerated, as if it had been detached and reattached. + @param options Reserved for future use. + */ + virtual IOReturn ReEnumerateDevice( UInt32 options ); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 4); + /*! + @function DisplayUserNotification + @abstract Will use the KUNCUserNotification mechanism to display a notification to the user. + @param notificationType Which notification to display. + */ + virtual void DisplayUserNotification(UInt32 notificationType); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 5); + /*! + @function MakePipe + @abstract build a pipe on a given endpoint + @param ep A description of the endpoint + @param interface The IOUSBInterface object requesting the pipe + returns the desired IOUSBPipe object + */ + virtual IOUSBPipe* MakePipe(const IOUSBEndpointDescriptor *ep, IOUSBInterface *interface); + + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 6); + /*! + @function SetHubParent + @abstract Used by the hub driver to give the nub a pointer to its HubPolicyMaker object + @param hubPolicyMaker The object representing the Hub driver + */ + virtual void SetHubParent(IOUSBHubPolicyMaker *hubParent); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 7); + /*! + @function GetHubParent + @abstract Used by the hub driver to give the nub a pointer to its HubPolicyMaker object + @param hubPolicyMaker The object representing the Hub driver + */ + virtual IOUSBHubPolicyMaker* GetHubParent(); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 8); + /*! + @function GetDeviceInformation + @abstract Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state. + @param requestedPower The desired amount of power that the client wishes to reserve + @result Actual power that was reserved + + */ + virtual IOReturn GetDeviceInformation(UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 9); + /*! + @function RequestExtraPower + @abstract Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA). + @param type Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @param requestedPower Amount of power desired, in mA + @result Amount of power actually reserved, in mA. It can be less than the requested or zero. + + */ + virtual UInt32 RequestExtraPower(UInt32 type, UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 10); + /*! + @function ReturnExtraPower + @abstract Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API. + @param type Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @param returnedPower Amount of power that is no longer needed, in mA + @result If the returnedPower was not previously allocated, an error will be returned. This will include the case for power that was requested for sleep but was returned for wake. + + */ + virtual IOReturn ReturnExtraPower(UInt32 type, UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 11); + /*! + @function GetExtraPowerAllocated + @abstract Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA). + @param type Indicates whether the allocated power was to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @result Amount of power allocated, in mA. + + */ + virtual UInt32 GetExtraPowerAllocated(UInt32 type); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 12); + /*! + @function DoLocationOverrideAndModelMatch + @abstract Will look for a kOverrideIfAtLocationID array proerty with locationID entries and a "MacModel" property. If any of the locationIDs match to the Mac Model, will return true. + If there is no kOverrideAtLocationID property, it will also return true. + @result True if we have a match, false otherwise + */ + virtual bool DoLocationOverrideAndModelMatch(); + + OSMetaClassDeclareReservedUnused(IOUSBDevice, 13); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 14); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 15); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 16); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 17); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 18); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 19); + +private: + + static void ProcessPortResetEntry(OSObject *target); + void ProcessPortReset(void); + + void TerminateInterfaces(void); + + static void ProcessPortReEnumerateEntry(OSObject *target, thread_call_param_t options); + void ProcessPortReEnumerate(UInt32 options); + + static void DoMessageClientsEntry(OSObject *target, thread_call_param_t messageStruct); + void DoMessageClients( void * messageStructPtr); + + static void DisplayUserNotificationForDeviceEntry (OSObject *owner, IOTimerEventSource *sender); + void DisplayUserNotificationForDevice( ); + + UInt32 SimpleUnicodeToUTF8(UInt16 uChar, UInt8 utf8Bytes[4]); + void SwapUniWords (UInt16 **unicodeString, UInt32 uniSize); + + IOReturn TakeGetConfigLock(void); + IOReturn ReleaseGetConfigLock(void); + static IOReturn ChangeGetConfigLock(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); +}; + +#endif /* _IOKIT_IOUSBDEVICE_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBHIDDriver.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBHIDDriver.h.svn-base new file mode 100644 index 0000000..5e76887 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBHIDDriver.h.svn-base @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOUSBHIDDRIVER_H +#define IOUSBHIDDRIVER_H + +#include <IOKit/IOBufferMemoryDescriptor.h> + +#include <IOKit/hid/IOHIDDevice.h> + +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBInterface.h> +#include <IOKit/usb/USB.h> + + +#define ENABLE_HIDREPORT_LOGGING 0 + +// Report types from low level USB: +// from USBSpec.h: +// enum { +// kHIDRtInputReport = 1, +// kHIDRtOutputReport = 2, +// kHIDRtFeatureReport = 3 +// }; +// +// from IOHIDDescriptorParser.h: +// // types of HID reports (input, output, feature) +// enum +// { +// kHIDInputReport = 1, +// kHIDOutputReport, +// kHIDFeatureReport, +// kHIDUnknownReport = 255 +// }; +// +// Report types from high level HID Manager: +// from IOHIDKeys.h: +// enum IOHIDReportType +// { +// kIOHIDReportTypeInput = 0, +// kIOHIDReportTypeOutput, +// kIOHIDReportTypeFeature, +// kIOHIDReportTypeCount +// }; +// +#define HIDMGR2USBREPORTTYPE(x) (x + 1) +#define USB2HIDMGRREPORTTYPE(x) (x - 1) + + +// Note: In other Neptune files, kMaxHIDReportSize was defined as 64. But Ferg & Keithen were unable to +// find that value in the USB HID 1.1 specs. Brent had previously changed it to 256 in the OS 9 HID Driver +// to allow for reports spanning multiple packets. 256 may be no more a hard and fast limit, but it's +// working for now in OS 9. +#define kMaxHIDReportSize 256 // Max packet size = 8 for low speed & 64 for high speed. +#define kHIDDriverRetryCount 3 +#define kUSBHIDReportLoggingLevel "USB HID Report Logging Level" + + +// power states for the driver (awake or suspended) +enum +{ + kUSBHIDPowerStateOff = 0, + kUSBHIDPowerStateRestart = 1, + kUSBHIDPowerStateSleep = 2, // this could be system sleep or idle sleep + kUSBHIDPowerStateLowPower = 3, // this is idling + kUSBHIDPowerStateOn = 4, // this is fully on + kUSBHIDNumberPowerStates = 5 +}; + + +/*! + @class IOUSBHIDDriver + @abstract Driver that matches to USB HID devices. + @discussion This class can be overriden to provide for specific behaviors. + */ +class IOUSBHIDDriver : public IOHIDDevice +{ + OSDeclareDefaultStructors(IOUSBHIDDriver) + + IOUSBInterface * _interface; + IOUSBDevice * _device; + IOUSBPipe * _interruptPipe; + UInt32 _maxReportSize; + IOBufferMemoryDescriptor * _buffer; + IOUSBCompletion _completion; + UInt32 _retryCount; + thread_call_t _deviceDeadCheckThread; + thread_call_t _clearFeatureEndpointHaltThread; + bool _deviceDeadThreadActive; + bool _deviceIsDead; // Should really be called "abort expected" + bool _deviceHasBeenDisconnected; + bool _needToClose; + UInt32 _outstandingIO; + IOCommandGate * _gate; + IOUSBPipe * _interruptOutPipe; + UInt32 _locationID; + IOBufferMemoryDescriptor * _outBuffer; // Obsolete + UInt32 _deviceUsage; // Obsolete + UInt32 _deviceUsagePage; // Obsolete + + struct IOUSBHIDDriverExpansionData + { + IOWorkLoop * _workLoop; + thread_call_t _handleReportThread; + IOService * _rootDomain; + AbsoluteTime _wakeUpTime; + IOUSBCompletionWithTimeStamp _completionWithTimeStamp; + bool _checkForTimeStamp; + UInt32 _msToIgnoreTransactionsAfterWake; + IOTimerEventSource * _suspendPortTimer; + bool _portSuspended; + UInt32 _suspendTimeoutInMS; + UInt8 _interfaceNumber; + bool _logHIDReports; + UInt8 _hidLoggingLevel; + bool _needToClearPipeStall; + SInt32 _queuedReports; + AbsoluteTime _interruptTimeStamp; + bool _powerStateChanging; + unsigned long _myPowerState; + bool _pendingRead; + UInt32 _deviceDeadCheckLock; // "Lock" to prevent us from executing the device dead check while in progress + }; + IOUSBHIDDriverExpansionData *_usbHIDExpansionData; + + static void InterruptReadHandlerEntry(OSObject *target, void *param, IOReturn status, UInt32 bufferSizeRemaining); + static void InterruptReadHandlerWithTimeStampEntry(OSObject *target, void *param, IOReturn status, UInt32 bufferSizeRemaining, AbsoluteTime timeStamp); + void InterruptReadHandler(IOReturn status, UInt32 bufferSizeRemaining, AbsoluteTime timeStamp); + + static void CheckForDeadDeviceEntry(OSObject *target); + void CheckForDeadDevice(); + + static void ClearFeatureEndpointHaltEntry(OSObject *target); + void ClearFeatureEndpointHalt(void); + + static void HandleReportEntry(OSObject *target, thread_call_param_t timeStamp); + void HandleReport(AbsoluteTime timeStamp); + + virtual void processPacket(void *data, UInt32 size); // Obsolete + + static IOReturn ChangeOutstandingIO(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn ClaimPendingRead(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + static void SuspendPortTimer(OSObject *target, IOTimerEventSource *sender); + +public: + + // IOService methods + // + virtual bool init(OSDictionary *properties); + virtual bool start(IOService * provider); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + virtual void stop(IOService * provider); + virtual void free(); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ); + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual void powerChangeDone ( unsigned long fromState); + + + // IOHIDDevice methods + // + virtual bool handleStart(IOService * provider); + virtual void handleStop(IOService * provider); + + virtual IOReturn newReportDescriptor( IOMemoryDescriptor ** descriptor ) const; + + virtual OSString * newTransportString() const; + + virtual OSNumber * newVendorIDNumber() const; + + virtual OSNumber * newProductIDNumber() const; + + virtual OSNumber * newVersionNumber() const; + + virtual OSString * newManufacturerString() const; + + virtual OSString * newProductString() const; + + virtual OSString * newSerialNumberString() const; + + virtual OSNumber * newLocationIDNumber() const; + + virtual OSNumber * newCountryCodeNumber() const; + + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + + // HID driver methods + // + virtual OSString * newIndexedString(UInt8 index) const; + + virtual UInt32 getMaxReportSize(); + + virtual void DecrementOutstandingIO(void); + virtual void IncrementOutstandingIO(void); + virtual IOReturn StartFinalProcessing(); + virtual IOReturn SetIdleMillisecs(UInt16 msecs); + +private: + + IOReturn GetHIDDescriptor(UInt8 inDescriptorType, UInt8 inDescriptorIndex, UInt8 *vOutBuf, UInt32 *vOutSize); + IOReturn GetReport(UInt8 inReportType, UInt8 inReportID, UInt8 *vInBuf, UInt32 *vInSize); + IOReturn SetReport(UInt8 outReportType, UInt8 outReportID, UInt8 *vOutBuf, UInt32 vOutSize); + IOReturn GetIndexedString(UInt8 index, UInt8 *vOutBuf, UInt32 *vOutSize, UInt16 lang = 0x409) const; + IOReturn SetProtocol(UInt32 protocolType); + char GetHexChar(char hexChar); + IOReturn AbortAndSuspend( bool suspend ); + + + +#if ENABLE_HIDREPORT_LOGGING + void LogBufferReport(char *report, UInt32 len); + void LogMemReport(IOMemoryDescriptor * reportBuffer); + char GetHexChar(char hexChar); +#endif + +public: + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 0); + virtual IOReturn RearmInterruptRead(); + + /*! + @function SuspendPort + @abstract Suspends the port for this device or optionally sets a timeout to suspend after a period of inactivity. + @discussion This call can be used to immediately suspend/resume a port or to enable the suspension of the port after a period of inactivity. If called with suspendPort = true (no timeout parameter), the HID driver + will immediately suspend the port, after aborting any outstanding reads on the interrupt pipe. If called with suspendPort = true and timeout != 0, it will suspend the port after the timeout number of ms have + passed without any read completions. If called with suspendPort = false, the port will be immediately resumed and the reads will be re-issued. If a timeout was enabled, it will be cancelled. + @param suspendPort Boolean value. true = suspend the port, false = resume the port. + @param timeoutMS Value in milliseconds If value is non-zero, the port will be suspended after the timeout milliseconds have passed without any read completions. + @result The IOReturn value from the IOUSBDevice::Suspend() call. + */ + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 1); + virtual IOReturn SuspendPort(bool suspendPort, UInt32 timeoutMS = 0); + + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 2); + virtual bool IsPortSuspended(); + + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 3); + virtual void LogMemReport(UInt8 level, IOMemoryDescriptor * reportBuffer, IOByteCount size); + + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 4); + virtual IOReturn InitializeUSBHIDPowerManagement(IOService *provider); + + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 5); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 6); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 7); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 8); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 9); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 10); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 11); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 12); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 13); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 14); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 15); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 16); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 17); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 18); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 19); +}; + +#endif // IOUSBHIDDRIVER_H diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBHubDevice.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBHubDevice.h.svn-base new file mode 100644 index 0000000..91c728c --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBHubDevice.h.svn-base @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OPEN_SOURCE__ +/* + * + * $Log: IOUSBHubDevice.h,v $ + * Revision 1.11 2009/09/12 03:42:16 rhoads + * merge in the changes for the 390.3.4b QL + * + * Revision 1.10.52.1 2009/09/10 18:50:52 nano + * <rdar://problem/7134800> Task: Extra Current support for Ibex Peak RMHs -- look for a property that tells us to ask our USB plane parent for the extra current. This will allow the RMH to pass on the request to it's parent. + * + * Revision 1.10 2009/05/07 19:43:09 nano + * Move our SnowLeopard branch to TOT + * + * Revision 1.6.102.3 2008/06/16 22:02:16 nano + * Bring in changes from Foxound 320.2.19 + * + + * Revision 1.6.102.2 2008/04/22 22:38:01 nano + * Bring in changes from Foxhound-320.2.9 + * + * Revision 1.8.62.2 2008/06/06 21:08:44 nano + * Enable dynamic allocation of power for M89, so we don't reserve it if there isn't a high power device attached + * + * Revision 1.8.62.1 2008/06/06 04:14:32 nano + * Fix SleepCurrent allocation so it will work with hub devices and root hub devices as well as consolidating it across all controllers + * + * Revision 1.8 2008/04/17 16:56:57 nano + * Bring in branches for rdar://5867990 & rdar://5768343 + * + * Revision 1.7.4.1 2008/04/17 15:54:07 nano + * Merged PR-5768343 into this branch and fixed a couple of issues + * + * Revision 1.7.2.1 2008/04/16 00:48:49 ferg + * Bug #: 5768343 + * Add support for hubs with high-power downstream port capability. This is + * controlled by the properties "AAPL,current-available" and "AAPL,current-extra". + * + * Revision 1.7 2008/04/14 16:08:38 nano + * Add new APIs for high power and for GetDeviceInformation. + * + * Revision 1.6.144.1 2008/04/11 22:25:44 nano + * Initial work on new user-client APIs and new IOUSBDevice APIs to return port state information and manage extra power requests, as well as groundwork for calling the policy maker directly from the IOUSBDevice + * + * Revision 1.6 2007/08/01 16:10:18 rhoads + * roll in extra power changes + * + * Revision 1.5.118.1 2007/07/27 16:49:10 rhoads + * merge the extra current stuff into Leopard, and add extra sleep current for self powered hubs + * + * Revision 1.5 2007/01/20 00:47:01 rhoads + * roll in Hub Policy Maker changes + * + * Revision 1.4 2006/12/22 23:05:46 rhoads + * roll in branches 4364835 and 4277683-2 + * + * Revision 1.3.20.3 2007/01/15 19:58:07 rhoads + * saving more changes + * + * Revision 1.3.20.2 2007/01/09 21:55:53 rhoads + * commit some stuff to try to fix a permissions issue + * + * Revision 1.3.20.1 2006/12/18 19:13:56 rhoads + * re-integrate the old branch into TOT + * + * Revision 1.3.12.4 2006/12/18 17:33:48 rhoads + * looking good except for sleep/wake + * + * Revision 1.3.12.3 2006/12/08 05:42:40 rhoads + * mostly working + * + * Revision 1.3.12.2 2006/11/14 22:37:06 rhoads + * more changes with the root hubs + * + * Revision 1.3.12.1 2006/11/07 16:55:52 rhoads + * change to get the IOUSBHubDevice nubs into the IOPower tree + * + * Revision 1.3 2006/10/06 04:42:02 rhoads + * roll in branches 4727961, 4758404, 4759810, 4760274, and 4762769 + * + * Revision 1.2.4.2 2006/10/04 23:01:24 rhoads + * better naming + * + * Revision 1.2.4.1 2006/10/04 16:03:57 rhoads + * better IOUSBHubDevice design + * + */ +#endif + + +#ifndef _IOKIT_IOUSBHUBDEVICE_H +#define _IOKIT_IOUSBHUBDEVICE_H + +#include <IOKit/usb/IOUSBDevice.h> // our superclass + +// forward refeference. we don't include the header file because it would cause a circular reference +class IOUSBHubPolicyMaker; + +enum { + kIOUSBHubDeviceIsRootHub = 0x0001, + kIOUSBHubDeviceIsOnHighSpeedBus = 0x0002, + kIOUSBHubDeviceCanSleep = 0x0004 +}; + +/*! + @class IOUSBHubDevice + @abstract New in MAC OS X 10.5. The IOKit object representing a hub device on the USB bus. It is a subclass of IOUSBDevice. + @discussion With the exception of the IOUSBRootHubDevice objects representing the root hubs, every IOUSBDevice + will have an IOUSBHubDevice as its parent in the IOUSB plane. USB KEXT drivers will have the ability to + query this device for characteristics of the hub into which they are connected. This class will also give a dive driver + the abilty to get an IOService* pointing to the hub driver itself, which can then be used as the parent in the power plane. +*/ + +class IOUSBHubDevice : public IOUSBDevice +{ + friend class IOUSBHubPolicyMaker; + friend class AppleUSBHub; + friend class IOUSBController; // for the "can sleep" characteristic + +private: + OSDeclareDefaultStructors(IOUSBHubDevice) + + UInt32 _myCharacteristics; // bitmap of my characteristics + IOUSBHubPolicyMaker *_myPolicyMaker; // pointer to the policy maker in the IOPower tree for this hub + + struct ExpansionData + { + UInt32 _maxPortCurrent; // maximum current in milliamps per downstream port + UInt32 _totalExtraCurrent; // total amount of current above the spec'ed current per port available (during normal operation) + UInt32 _totalSleepCurrent; // total amount of current that can be drawn during sleep + UInt32 _canRequestExtraPower; // If 0, this hub does not support requesting extra power from its parent, non-zero: how much power we need to request in order to give out _extraPowerForPorts + UInt32 _extraPowerForPorts; // Of the power requested from our parent, how much can we parcel out -- the rest is consumed by voltage drop thru the cable + UInt32 _extraPowerAllocated; // Amount of power that we actually got from our parent + bool _requestFromParent; // True if we are to request the extra power from our parent, without modifying the request. Used for RMHs + }; + ExpansionData *_expansionData; + +protected: + // IOUSBHubDevice methods which will be used by the hub driver (which is also the Policy Maker) + virtual void SetPolicyMaker(IOUSBHubPolicyMaker *policyMaker); + virtual void SetHubCharacteristics(UInt32); + virtual bool InitializeCharacteristics(void); // used at start + +public: + // static constructor + static IOUSBHubDevice *NewHubDevice(void); + + // IOKit methods + virtual bool init(); + virtual bool start( IOService * provider ); + virtual void stop( IOService *provider ); + virtual void free(); + + // public IOUSBHubDevice methods + + void SetTotalSleepCurrent(UInt32 sleepCurrent); + UInt32 GetTotalSleepCurrent(); + + /*! + @function GetPolicyMaker + returns a pointer to the policy maker for the hub, which can be used as the power plane parent. + @result returns an IOUSBHubPolicyMaker* pointing to the policy maker for this hub. returns NULL is no policy maker is active on the hub device. + */ + virtual IOUSBHubPolicyMaker *GetPolicyMaker(void); + + /*! + @function GetHubCharacteristics + returns characteristics of the hub device which might be useful for the driver of a device connected to the hub. + kIOUSBHubDeviceIsRootHub indicates that the hub is a root hub + kIOUSBHubDeviceIsOnHighSpeedBus indicates that the hub is running on a High Speed bus. If this bit is set and kIOUSBHubDeviceIsHighSpeed is clear, then this is a Classic Speed hub running on a High Speed bus, which means that Split Transactions will be used to communicate with downstream devices. + + @result returns a bitmap of characteristics + */ + virtual UInt32 GetHubCharacteristics(); + + /*! + @function GetMaxProvidedPower + returns the maximum amount of power available on any downstream port of this hub + @result the power is returned in milliamps - usually 100ma or 500 ma. + */ + virtual UInt32 GetMaxProvidedPower(); + + /*! + @function RequestProvidedPower + requests power from the hub device + @param requestedPower - the amount of power requested in milliamps (usually 100ma or 500 ma) + @result the amount of power allocated for this driver in milliamps (usually 100ma or 500 ma) + */ + virtual UInt32 RequestProvidedPower(UInt32 requestedPower); + + virtual UInt32 RequestExtraPower(UInt32 requestedPower); + + virtual void ReturnExtraPower(UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 0); + + virtual void InitializeExtraPower(UInt32 maxPortCurrent, UInt32 totalExtraCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 1); + virtual UInt32 RequestSleepPower(UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 2); + virtual void ReturnSleepPower(UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 3); + virtual void SetSleepCurrent(UInt32 sleepCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 4); + virtual UInt32 GetSleepCurrent(); + + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 5); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 6); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 7); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 8); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 9); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 10); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 11); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 12); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 13); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 14); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 15); +}; + +#endif /* _IOKIT_IOUSBROOTHUBDEVICE_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBHubPolicyMaker.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBHubPolicyMaker.h.svn-base new file mode 100644 index 0000000..a0021d3 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBHubPolicyMaker.h.svn-base @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OPEN_SOURCE__ +/* + * + * $Log: IOUSBHubPolicyMaker.h,v $ + * Revision 1.10 2009/05/07 19:43:09 nano + * Move our SnowLeopard branch to TOT + * + * Revision 1.7.72.3 2008/07/23 17:43:32 nano + * <rdar://problem/5939357> IOUSBHIDDriver, IOHIDEventService missing HeaderDoc class declarations + * + * Revision 1.7.72.2 2008/04/22 22:38:01 nano + * Bring in changes from Foxhound-320.2.9 + * + * Revision 1.9 2008/04/17 16:56:57 nano + * Bring in branches for rdar://5867990 & rdar://5768343 + * + * Revision 1.8.4.1 2008/04/16 20:26:15 nano + * <rdar://problem/5867990> Add API to allocate sleep current, as well as making sure that we return any extra power if our client dies or our device is terminated without returning it + * + * Revision 1.8 2008/04/14 16:08:38 nano + * Add new APIs for high power and for GetDeviceInformation. + * + * Revision 1.7.114.1 2008/04/11 22:25:44 nano + * Initial work on new user-client APIs and new IOUSBDevice APIs to return port state information and manage extra power requests, as well as groundwork for calling the policy maker directly from the IOUSBDevice + * + * Revision 1.7 2007/08/17 22:41:11 nano + * Bring in branch that fixes <rdar://problem/5414582> USB not honoring Resume recovery time (hub driver) and adds extra time for iPods + * + * Revision 1.6.30.1 2007/08/16 19:14:02 nano + * ResumeRecovery additions. + * + * Revision 1.6 2007/08/01 16:10:18 rhoads + * roll in extra power changes + * + * Revision 1.5.12.1 2007/07/27 16:49:10 rhoads + * merge the extra current stuff into Leopard, and add extra sleep current for self powered hubs + * + * Revision 1.5 2007/07/20 22:31:22 rhoads + * roll in branch300-3-2 + * + * Revision 1.4.40.1 2007/07/18 18:44:24 rhoads + * this is the 300.3.2g version plus some quieter logs + * + * Revision 1.4.34.2 2007/07/17 06:30:35 rhoads + * more hub chain fixes + * + * Revision 1.4.34.1 2007/07/16 16:45:00 rhoads + * more power management and termination tweaks + * + * Revision 1.4 2007/05/18 01:59:12 rhoads + * roll in 5112084 and 5204170 + * + * Revision 1.3.2.1 2007/05/15 18:23:48 rhoads + * some initial power state bug fixes + * + * Revision 1.3 2007/05/10 22:25:35 rhoads + * roll in branch 5113395 - the last major piece of the new power architecture + * + * Revision 1.2.64.4 2007/04/13 22:34:59 rhoads + * fix restart and shutdown + * + * Revision 1.2.64.3 2007/04/11 23:56:23 rhoads + * first mostly working dozing hub + * + * Revision 1.2.64.2 2007/04/10 02:09:09 rhoads + * got UHCI almost working + * + * Revision 1.2.64.1 2007/04/05 02:57:50 rhoads + * move power management out of AppleUSBHub and into IOUSBHubPolicyMaker + * + * Revision 1.2 2007/01/20 00:47:01 rhoads + * roll in Hub Policy Maker changes + * + * Revision 1.1.2.4 2007/01/18 22:51:08 rhoads + * add some padding + * + * Revision 1.1.2.3 2007/01/15 19:58:07 rhoads + * saving more changes + * + * Revision 1.1.2.2 2007/01/09 23:55:36 rhoads + * working version + * + * Revision 1.1.2.1 2007/01/09 21:57:02 rhoads + * commit some stuff to try to fix a permissions issue + * + * + */ +#endif +#ifndef _IOKIT_IOUSBHUBPOLICYMAKER_H +#define _IOKIT_IOUSBHUBPOLICYMAKER_H + +#include <IOKit/IOService.h> +#include <IOKit/usb/IOUSBController.h> +#include <IOKit/usb/IOUSBHubDevice.h> + + +enum { + kIOUSBHubPowerStateOff = 0, // losing power + kIOUSBHubPowerStateRestart = 1, // reseting bus, but may maintain power + kIOUSBHubPowerStateSleep = 2, // upstream port and all downstream ports suspended (from the top) + kIOUSBHubPowerStateLowPower = 3, // upstream port and all downstream ports suspended (from the bottom) + kIOUSBHubPowerStateOn = 4, // upstream port and at least one downstream port on + kIOUSBHubNumberPowerStates = 5 +}; + +enum { + kHubResumeRecoveryTime = 10, // 10 ms to recover after I resume myself + kPortResumeRecoveryTime = 10 // 10 ms to recover another device +}; + +#define kIOUSBHubPowerStateStable -1 + +/*! + @class IOUSBHubPolicyMaker + @abstract Super class for Hub drivers to incorporate common Power Management code. + */ +class IOUSBHubPolicyMaker : public IOService +{ + OSDeclareAbstractStructors(IOUSBHubPolicyMaker) + +protected: + IOUSBControllerV2 * _bus; + IOUSBHubDevice * _device; // our provider + IOUSBHubDevice * _parentHubDevice; // for non root hub drivers, this is the hub device that my hub device is connected to + bool _isRootHub; // this is a root hub + bool _dozeEnabled; // true if the controller has been enabled to go into doze mode + bool _dontAllowLowPower; // If true, we will not allow the hub to go into low power mode. + bool _dontAllowSleepPower; // If true, we will not allow extra sleep power for a self powered hub. + SInt32 _powerStateChangingTo; // a power state if we are changing to one, or -1 if we are stable + unsigned long _myPowerState; // my current state (since getPowerState doesn't always change in time) + UInt32 _extraPower; // how much extra power we might be able to get from our parent hub + UInt32 _extraPowerRemaining; // how many milliamps we can still give to any one port + UInt32 _hubResumeRecoveryTime; // # of ms that we will wait before issuing any transactions on our port (nominally 10ms) + struct ExpansionData + { + }; + ExpansionData *_expansionData; + +public: + // IOService methods + virtual bool start(IOService * provider); + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual unsigned long powerStateForDomainState ( IOPMPowerFlags domainState ); + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ); + virtual void powerChangeDone ( unsigned long fromState ); + + // public methods which MAY be implemented in subclass + virtual IOReturn EnsureUsability(void); + + // Extra Port Power calls + void AllocateExtraPower(); + IOReturn GetExtraPortPower(UInt32 portNum, UInt32 *extraPower); + IOReturn ReturnExtraPortPower(UInt32 portNum, UInt32 extraPower); + + // virtual methods to be implemented in the controlling driver subclass + virtual bool ConfigureHubDriver(void) = 0; + virtual IOReturn HubPowerChange(unsigned long powerStateOrdinal) = 0; + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 0); + virtual IOReturn GetPortInformation(UInt32 portNum, UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 1); + virtual IOReturn ResetPort(UInt32 portNum); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 2); + virtual IOReturn SuspendPort(UInt32 portNum, bool suspend); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 3); + virtual IOReturn ReEnumeratePort(UInt32 portNum, UInt32 options); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 4); + virtual UInt32 RequestExtraPower(UInt32 portNum, UInt32 type, UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 5); + virtual IOReturn ReturnExtraPower(UInt32 portNum, UInt32 type, UInt32 returnedPower); + + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 6); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 7); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 8); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 9); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 10); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 11); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 12); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 13); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 14); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 15); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 16); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 17); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 18); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 19); +}; + +#endif _IOKIT_IOUSBHUBPOLICYMAKER_H diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBInterface.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBInterface.h.svn-base new file mode 100644 index 0000000..4777e50 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBInterface.h.svn-base @@ -0,0 +1,264 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBINTERFACE_H +#define _IOKIT_IOUSBINTERFACE_H + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBDevice.h> + +/*! + @class IOUSBInterface + @abstract The object representing an interface of a device on the USB bus. + @discussion This class provides functionality to find the pipes of an interface and + to read the descriptors associated with an interface. When an interface is open()ed, + all its pipes are created +*/ +class IOUSBInterface : public IOUSBNub +{ + friend class IOUSBInterfaceUserClientV2; + + OSDeclareDefaultStructors(IOUSBInterface) + +protected: + IOUSBPipe * _pipeList[kUSBMaxPipes]; + const IOUSBConfigurationDescriptor *_configDesc; + const IOUSBInterfaceDescriptor * _interfaceDesc; + IOUSBDevice * _device; + + // these variable are the parsed interface descriptor + UInt8 _bInterfaceNumber; + UInt8 _bAlternateSetting; + UInt8 _bNumEndpoints; + UInt8 _bInterfaceClass; + UInt8 _bInterfaceSubClass; + UInt8 _bInterfaceProtocol; + UInt8 _iInterface; + + struct ExpansionData { + IOCommandGate *_gate; + IOWorkLoop *_workLoop; + bool _needToClose; + IOLock * _pipeObjLock; // Lock to synchronize accesses to our pipeObjects + }; + ExpansionData * _expansionData; + + // private methods + virtual void ClosePipes(void); // close all pipes (except pipe zero) + virtual IOReturn CreatePipes(void); // open all pipes in the current interface/alt interface + virtual void SetProperties(void); // update my property table with the correct properties + +public: + // static methods + static IOUSBInterface *withDescriptors(const IOUSBConfigurationDescriptor *cfDesc, const IOUSBInterfaceDescriptor *ifDesc); + static IOReturn CallSuperOpen(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn CallSuperClose(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static UInt8 hex2char( UInt8 digit ); + + // IOService methods + virtual bool start(IOService * provider); + virtual bool handleOpen(IOService *forClient, IOOptionBits options = 0, void *arg = 0 ); + virtual bool open(IOService *forClient, IOOptionBits options = 0, void *arg = 0 ); + virtual void close(IOService *forClient, IOOptionBits options = 0); + virtual void handleClose(IOService *forClient, IOOptionBits options = 0); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool finalize(IOOptionBits options); + virtual void stop(IOService * provider); + virtual bool terminate( IOOptionBits options = 0 ); + virtual void free(); + + // IOUSBInterface class methods + virtual bool init( const IOUSBConfigurationDescriptor *cfDesc, + const IOUSBInterfaceDescriptor *ifDesc); + /*! + @function FindNextAltInterface + return alternate interface descriptor satisfying the requirements specified in request, or NULL if there aren't any. + request is updated with the properties of the returned interface. + @param current interface descriptor to start searching from, NULL to start at alternate interface 0. + @param request specifies what properties an interface must have to match. + @result Pointer to a matching interface descriptor, or NULL if none match. + */ + virtual const IOUSBInterfaceDescriptor *FindNextAltInterface(const IOUSBInterfaceDescriptor *current, + IOUSBFindInterfaceRequest *request); + + /*! + @function FindNextPipe + Find a pipe of the interface that matches the requirements, either + starting from the beginning of the interface's pipe list or from a specified + pipe. + @param current Pipe to start searching from, NULL to start from beginning of list. + @param request Requirements for pipe to match, updated with the found pipe's + properties. + @result Pointer to the pipe, or NULL if no pipe matches the request. + */ + virtual IOUSBPipe *FindNextPipe(IOUSBPipe *current, IOUSBFindEndpointRequest *request); + + /*! + @function FindNextAssociatedDescriptor + Find the next descriptor of the requested type associated with the interface. + @param current Descriptor to start searching from, NULL to start from beginning of list. + @param type Descriptor type to search for, or kUSBAnyDesc to return any descriptor type. + @result Pointer to the descriptor, or NULL if no matching descriptors found. + */ + virtual const IOUSBDescriptorHeader * FindNextAssociatedDescriptor(const void *current, UInt8 type); + + /*! + @function SetAlternateInterface + Select the specified alternate interface. + @param forClient The client requesting the alternate setting. This client must have the interface open in order to perform the request. + @param alternateSetting Alternate setting (from the alternate interface's interface descriptor). + @result exclusive access error if the interface is not open. otherwise the result of the transaction + */ + virtual IOReturn SetAlternateInterface(IOService *forClient, UInt16 alternateSetting); + + /*! + @function GetPipeObj + returns a handle to the pipe at the corresponding index + @param index value from zero to kUSBMaxPipes-1 + @result The IOUSBPipe object. Note that the client does not own a reference to this pipe, so the client should retain() the IOUSBPipe object if necessary. + */ + virtual IOUSBPipe *GetPipeObj(UInt8 index); + /*! + @function GetConfigValue + returns the device configuration value for the interface + @result The device configuration value. + */ + virtual UInt8 GetConfigValue(); + /*! + @function GetDevice + returns the device the interface is part of. + @result Pointer to the IOUSBDevice object which is the parent of this IOUSBInterface object. + */ + virtual IOUSBDevice *GetDevice(); + /*! + @function GetInterfaceNumber + returns the zero based value identifying the index in the array of concurrent + interfaces supported by the current configuration + @result the interface index + */ + virtual UInt8 GetInterfaceNumber(); + /*! + @function GetAlternateSetting + returns the alternate setting for this interface. + @result the alternate setting + */ + virtual UInt8 GetAlternateSetting(); + /*! + @function GetNumEndpoints + returns the number of endpoints used by this interface (excluding + device endpoint zero. If the value is zero, this interface only + uses endpoint zero. + @result the number of endpoints + */ + virtual UInt8 GetNumEndpoints(); + /*! + @function GetInterfaceClass + returns the class code for this interface (assigned by the USB) + a value of zero is reserved + if the value is FFh, the interface class is vendor-specific + all other values are reserved for assignment by the USB + @result the interface class + */ + virtual UInt8 GetInterfaceClass(); + /*! + @function GetInterfaceSubClass + returns the subclass code (assigned by the USB). + These codes are qualified by the value returned by GetInterfaceClass + @result the interface subclass + */ + virtual UInt8 GetInterfaceSubClass(); + /*! + @function GetInterfaceProtocol + returns the protocol code (assigned by the USB). + @result the interface index + */ + virtual UInt8 GetInterfaceProtocol(); + /*! + @function GetInterfaceStringIndex + returns the index of the string descriptor describing the interface + @result the string index + */ + virtual UInt8 GetInterfaceStringIndex(); + + /*! + @function DeviceRequest + @abstract Sends a control request to the default control pipe in the device (pipe zero) + @param request The parameter block to send to the device + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + */ + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion = 0); + + /*! + @function DeviceRequest + @abstract Sends a control request to the default control pipe in the device (pipe zero) + @param request The parameter block to send to the device (with the pData as an IOMemoryDesriptor) + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + */ + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, IOUSBCompletion *completion = 0); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 *score); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 0); + /*! + @function GetEndpointProperties + @abstract Returns the properties of an endpoint, possibly in an alternate interface. + @param alternateSetting specifies the desired alternate setting + @param endpointNumber specifies the endpoint number + @param direction specifies the direction (kUSBIn, kUSBOut) + @param transferType a pointer to hold the transfer type (kUSBControl, kUSBBulk, etc.) of the endpoint if found. + @param maxPacketSize a pointer to hold the maxPacketSize in the endpoint descriptor. + @param interval a pointer to hold the interval value in the endpoint descriptor. + @result returns kIOReturnSuccess if the endpoint is found, and kIOUSBEndpointNotFound if it is not. + */ + virtual IOReturn GetEndpointProperties(UInt8 alternateSetting, UInt8 endpointNumber, UInt8 direction, UInt8 *transferType, UInt16 *maxPacketSize, UInt8 *interval); + + OSMetaClassDeclareReservedUnused(IOUSBInterface, 1); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 2); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 3); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 4); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 5); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 6); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 7); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 8); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 9); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 10); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 11); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 12); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 13); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 14); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 15); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 16); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 17); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 18); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 19); +}; + +#endif /* _IOKIT_IOUSBINTERFACE_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBLog.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBLog.h.svn-base new file mode 100644 index 0000000..7f8f2a3 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBLog.h.svn-base @@ -0,0 +1,240 @@ +/* + * Copyright 1998-20010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBLOG_H +#define _IOKIT_IOUSBLOG_H + +#include <IOKit/IOService.h> +#include <IOKit/IOLib.h> + + +#ifdef __cplusplus + extern "C" { +#endif + +// USB Specific defines +#define USBLog( LEVEL, ARGS...) KernelDebugLogTag( LEVEL, 'USBF', ## ARGS ) +#define USBError( LEVEL, ARGS...) KernelDebugLogInternal( ( LEVEL ), 'USBF', ## ARGS ) +#define USBStringFromReturn( IORETURN) (IOUSBController::_log)->stringFromReturn( IORETURN ) + + +// Possible Debug levels. If DEBUG_LEVEL is set to DEBUG_LEVEL_PRODUCTION, all debug logs will be +// stripped of the final code. + +#define DEBUG_LEVEL_PRODUCTION 0 +#define DEBUG_LEVEL_DEVELOPMENT 1 +#define DEBUG_LEVEL_ALPHA 2 +#define DEBUG_LEVEL_BETA 3 +#define DEBUG_LEVEL_FINAL DEBUG_LEVEL_PRODUCTION + +// Allow clients to define their own debug level. + +#if ( !defined( DEBUG_LEVEL ) ) + #define DEBUG_LEVEL DEBUG_LEVEL_PRODUCTION +#endif + +// Index for user client methods +// +enum +{ + kUSBControllerUserClientOpen = 0, + kUSBControllerUserClientClose, + kUSBControllerUserClientEnableLogger, + kUSBControllerUserClientSetDebuggingLevel, + kUSBControllerUserClientSetDebuggingType, + kUSBControllerUserClientGetDebuggingLevel, + kUSBControllerUserClientGetDebuggingType, +#ifndef __OPEN_SOURCE__ + kUSBControllerUserClientSetTestMode, + kUSBControllerUserClientReadRegister, + kUSBControllerUserClientWriteRegister, + kUSBControllerUserClientMessageController, +#endif + kNumUSBControllerMethods +}; + +#ifndef __OPEN_SOURCE__ +// Enums for the private kIOUSBMessageController message +enum +{ + kIOUSBMessageControllerDoGPIOReset = 0x00000001 +}; +#endif + +// Info Debug Output Types. + +typedef UInt32 KernelDebuggingOutputType; +enum +{ + kKernelDebugOutputIOLogType = 0x00000001, + kKernelDebugOutputKextLoggerType = 0x00000002 +}; + + +// Info Debug levels. + +typedef UInt32 KernelDebugLevel; +enum +{ + kKernelDebugInfoLevel = 1000, + kKernelDebugRareInfoLevel = 2000, + kKernelDebugAllowedErrorLevel = 3000, + kKernelDebugAssertLevel = 4000, + kKernelDebugRequireLevel = 5000, + kKernelDebugErrorLevel = 6000, + kKernelDebugCriticalErrorLevel = 7000, + kKernelDebugTragicErrorLevel = 8000, + kKernelDebugAnyLevel = 0 +}; + +// Function prototypes. + +void KernelDebugSetLevel( KernelDebugLevel inLevel ); +KernelDebugLevel KernelDebugGetLevel(); +void KernelDebugSetOutputType( KernelDebuggingOutputType inType ); +KernelDebuggingOutputType KernelDebugGetOutputType(); +IOReturn KernelDebugFindKernelLogger(); +void KernelDebugEnable( bool enable ); + +// Yes, you can call this directly. But, why? If you use the macros declared below, such as +// KernelIOLog, you get the benefit of having your logs compiled out when you set the +// DEBUG_LEVEL to production mode and recompile. Dude. Sweet. What's mine say? + +void KernelDebugLogInternal( KernelDebugLevel inLevel, UInt32 inTag, char const *inFormatString, ... ) __attribute__ ((format(printf,3,4)));; +void KernelDebugLogDataInternal( UInt32 inLevel, UInt32 inTag, void *buffer, UInt32 byteCount, bool preBuffer); + +// Handy macros. + +#define REQUIRE_NO_ERR_PRINTF( VALUE, LABEL, ARGS... ) \ + if ( VALUE != kIOReturnSuccess ) \ + { \ + KernelDebugLogInternal( kDebugInfoLevel, 'BluD', ## ARGS ); \ + goto LABEL; \ + } + +#define REQUIRE_PRINTF( TEST, LABEL, ARGS... ) \ + do \ + { \ + if ( !( TEST ) ) \ + { \ + KernelDebugLogInternal( kDebugInfoLevel, 'BluD', ## ARGS ); \ + goto LABEL; \ + } \ + } while( false ) + +// Some macros to call the debugging outputs. We'll strip out the debug logs if we are production code. + +#if DEBUG_LEVEL != DEBUG_LEVEL_PRODUCTION +#define KernelDebugLog( LEVEL, ARGS... ) KernelDebugLogInternal( ( LEVEL ), 'KDbg', ## ARGS ) __attribute__ ((format(printf,1,2))); + #define KernelDebugLogTag( LEVEL, TAG, ARGS... ) KernelDebugLogInternal( ( LEVEL ), ( TAG ), ## ARGS ) + #define KernelDebugLogData( LEVEL, TAG, BUFFER, SIZE, HOLD) KernelDebugLogDataInternal( ( LEVEL ), ( TAG ), ( BUFFER ), ( SIZE ), ( HOLD )) +#else + #define KernelDebugLog( LEVEL, ARGS... ) + #define KernelDebugLogTag( LEVEL, TAG, ARGS... ) + #define KernelDebugLogData( LEVEL, TAG, BUFFER, SIZE, HOLD) +#endif + + +#ifdef __cplusplus + } + +//================================================================================================ +// Forward declarations +//================================================================================================ +class com_apple_iokit_KLogClient; + +//================================================================================================ +// Defines +//================================================================================================ +#define kLogKextName "com_apple_iokit_KLog" +#define MAXUSERS 5 + +//================================================================================================ +// Custom Types +//================================================================================================ + +typedef UInt32 KLogLevel; +typedef UInt32 KLogTag; + +//================================================================================================ +// com_apple_iokit_KLog +//================================================================================================ + +class com_apple_iokit_KLog : public IOService +{ + + OSDeclareDefaultStructors(com_apple_iokit_KLog) + + com_apple_iokit_KLogClient * mClientPtr[MAXUSERS+1]; + + unsigned char * mMsgBuffer; + UInt8 mClientCount; + UInt8 mMsgSize; + bool mErrFlag; + struct timeval * mTimeVal; + IOLock * mLogLock; + +public: + + static com_apple_iokit_KLog * logger; + + virtual bool init(OSDictionary *dictionary = 0); + virtual void free(void); + + virtual IOService * probe(IOService *provider, SInt32 *score); + virtual bool start(IOService *provider); + virtual void stop(IOService *provider); + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, IOUserClient ** handler ); + + virtual SInt8 Log( KLogLevel level, KLogTag tag, const char *format, ... ); + virtual SInt8 vLog( KLogLevel level, KLogTag tag, const char *format, va_list in_va_list ); + + void closeChild(com_apple_iokit_KLogClient *ptr); + void setErr(bool set); + +}; + +#define kMaxStatusBufSize (8*1024) + + +class IOUSBLog : public IOService +{ + OSDeclareAbstractStructors(IOUSBLog) + +private: +public: + virtual bool init( OSDictionary * dictionary = 0 ); + virtual const char * stringFromReturn( IOReturn rtn ); + static IOUSBLog *usblog(); + virtual void AddStatusLevel (UInt32 level, UInt32 ref, char *status, UInt32 value); + virtual void AddStatus(char *message); + virtual void AddStatus(UInt32 level, char *message); + virtual void USBLogPrintf(UInt32 level, char *format,...); + virtual char * strstr(const char *in, const char *str); +}; + + +#endif +#endif /* ! _IOKIT_IOUSBLOG_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBMassStorageClass.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBMassStorageClass.h.svn-base new file mode 100644 index 0000000..02c8557 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBMassStorageClass.h.svn-base @@ -0,0 +1,507 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOUSBMASSSTORAGECLASS_H +#define _IOKIT_IOUSBMASSSTORAGECLASS_H + +// Headers for general IOKit definitions +#include <IOKit/IOLib.h> +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOMessage.h> + +// Headers for USB specific definitions +#include <IOKit/usb/IOUSBInterface.h> +#include <IOKit/usb/IOUSBPipe.h> +#include <IOKit/usb/USBSpec.h> +#include <IOKit/usb/USB.h> + +// Headers for SCSI Protocol support definitions +#include <IOKit/scsi/IOSCSIProtocolServices.h> + +// BSD includes +#include <sys/sysctl.h> + +#define UNUSED(x) ((void)x) + + +#pragma mark - +#pragma mark Vendor Specific Device Support +#define kIOUSBMassStorageCharacteristics "USB Mass Storage Characteristics" +#define kIOUSBMassStoragePreferredSubclass "Preferred Subclass" +#define kIOUSBMassStoragePreferredProtocol "Preferred Protocol" +#define kIOUSBMassStorageResetOnResume "Reset On Resume" +#define kIOUSBMassStorageUseStandardUSBReset "Use Standard USB Reset" +#define kIOUSBKnownCSWTagIssues "Known CSW Tag Issues" +#define kIOUSBMassStorageMaxLogicalUnitNumber "Max Logical Unit Number" +#define kIOPropertyIOUnitKey "IOUnit" +#define kIOUSBMassStorageDoNotMatch "Do Not Match MSC" +#define kIOUSBMassStorageDoNotOperate "Do Not Operate" +#define kIOUSBMassStorageEnableSuspendResumePM "Enable Port Suspend-Resume PM" + +enum +{ + kUSBDAddressLength = 10 +}; + +#pragma mark - +#pragma mark CBI Protocol Strutures +// Structure for the global PB's +struct CBIRequestBlock +{ + SCSITaskIdentifier request; + IOUSBDevRequest cbiDevRequest; + SCSICommandDescriptorBlock cbiCDB; + IOUSBCompletion cbiCompletion; + UInt32 currentState; + IOMemoryDescriptor * cbiPhaseDesc; + UInt8 cbiGetStatusBuffer[2]; // 2 bytes as specified in the USB spec +}; + +typedef struct CBIRequestBlock CBIRequestBlock; + +#pragma mark - +#pragma mark Bulk Only Protocol Structures + +struct StorageBulkOnlyCBW +{ + UInt32 cbwSignature; + UInt32 cbwTag; + UInt32 cbwTransferLength; + UInt8 cbwFlags; + UInt8 cbwLUN; // Bits 0-3: LUN, 4-7: Reserved + UInt8 cbwCDBLength; // Bits 0-4: CDB Length, 5-7: Reserved + UInt8 cbwCDB[16]; +}; + +typedef struct StorageBulkOnlyCBW StorageBulkOnlyCBW; + +struct StorageBulkOnlyCSW +{ + UInt32 cswSignature; + UInt32 cswTag; + UInt32 cswDataResidue; + UInt8 cswStatus; +}; + +typedef struct StorageBulkOnlyCSW StorageBulkOnlyCSW; + +struct BulkOnlyRequestBlock +{ + SCSITaskIdentifier request; + IOUSBCompletion boCompletion; + UInt32 currentState; + StorageBulkOnlyCBW boCBW; + StorageBulkOnlyCSW boCSW; + IOMemoryDescriptor * boPhaseDesc; + UInt8 boGetStatusBuffer[2]; // 2 bytes as specified in the USB spec +}; + +typedef struct BulkOnlyRequestBlock BulkOnlyRequestBlock; + + +#pragma mark - +#pragma mark IOUSBMassStorageClass definition + +class IOUSBMassStorageClass : public IOSCSIProtocolServices +{ + OSDeclareDefaultStructors(IOUSBMassStorageClass) + +private: + // ---- Member variables used by all protocols ---- + // The interface object that provides the driver with access to the + // USB so that it may talk to its device. + IOUSBInterface * fInterface; + + // The pipe objects that the driver uses to transport data through a + // pipe to the appropriate endpoint. + IOUSBPipe * fBulkInPipe; + IOUSBPipe * fBulkOutPipe; + IOUSBPipe * fInterruptPipe; + IOUSBDevRequest fUSBDeviceRequest; + UInt8 fPreferredSubclass; + UInt8 fPreferredProtocol; + + // The maximum Logical Unit Number. This is the highest valid LUN + // that the USB device supports, so if the device only supports one + // LUN, such as CBI and CB, this number will be zero. + UInt8 fMaxLogicalUnitNumber; + + // ---- Member variables used by CBI protocol ---- + bool fCBICommandStructInUse; + + CBIRequestBlock fCBICommandRequestBlock; + + // ---- Member variables used by Bulk Only protocol ---- + // Command tag, this driver just uses a sequential counter that is + // incremented for each CBW that is sent to the device. + UInt32 fBulkOnlyCommandTag; + + bool fBulkOnlyCommandStructInUse; + + // Dedicated CBW and CSW IOMemoryDescriptors are listed in the ExpansionData struct. + + // The Request block that contains all the necessary data for + // transporting a Bulk Only request across the USB. + BulkOnlyRequestBlock fBulkOnlyCommandRequestBlock; + +protected: + // Reserve space for future expansion. + struct ExpansionData + { + bool fResetInProgress; + OSSet * fClients; + IOUSBPipe * fPotentiallyStalledPipe; + bool fUseUSBResetNotBOReset; + bool fAbortCurrentSCSITaskInProgress; + IOMemoryDescriptor * fCBIMemoryDescriptor; + IOMemoryDescriptor * fBulkOnlyCBWMemoryDescriptor; + IOMemoryDescriptor * fBulkOnlyCSWMemoryDescriptor; + bool fDeviceAttached; + bool fWaitingForReconfigurationMessage; + bool fTerminating; + bool fKnownCSWTagMismatchIssues; + bool fPortSuspendResumeForPMEnabled; + bool fPortIsSuspended; + bool fRequiresResetOnResume; + bool fAutonomousSpinDownWorkAround; + UInt8 fConsecutiveResetCount; + bool fClearStallInProgress; /* OBSOLETE */ + bool fTerminationDeferred; + }; + ExpansionData * reserved; + + #define fResetInProgress reserved->fResetInProgress + #define fClients reserved->fClients + #define fPotentiallyStalledPipe reserved->fPotentiallyStalledPipe + #define fUseUSBResetNotBOReset reserved->fUseUSBResetNotBOReset + #define fAbortCurrentSCSITaskInProgress reserved->fAbortCurrentSCSITaskInProgress + #define fCBIMemoryDescriptor reserved->fCBIMemoryDescriptor + #define fBulkOnlyCBWMemoryDescriptor reserved->fBulkOnlyCBWMemoryDescriptor + #define fBulkOnlyCSWMemoryDescriptor reserved->fBulkOnlyCSWMemoryDescriptor + #define fDeviceAttached reserved->fDeviceAttached + #define fWaitingForReconfigurationMessage reserved->fWaitingForReconfigurationMessage + #define fTerminating reserved->fTerminating + #define fKnownCSWTagMismatchIssues reserved->fKnownCSWTagMismatchIssues + #define fPortSuspendResumeForPMEnabled reserved->fPortSuspendResumeForPMEnabled + #define fPortIsSuspended reserved->fPortIsSuspended + #define fRequiresResetOnResume reserved->fRequiresResetOnResume + #define fAutonomousSpinDownWorkAround reserved->fAutonomousSpinDownWorkAround + #define fConsecutiveResetCount reserved->fConsecutiveResetCount + #define fClearStallInProgress reserved->fClearStallInProgress + #define fTerminationDeferred reserved->fTerminationDeferred + + // Enumerated constants used to control various aspects of this + // driver. + + // Enumerations for Mass Storage Class Subclass types + enum + { + kUSBStorageRBCSubclass = 1, + kUSBStorageSFF8020iSubclass = 2, + kUSBStorageQIC157Subclass = 3, + kUSBStorageUFISubclass = 4, + kUSBStorageSFF8070iSubclass = 5, + kUSBStorageSCSITransparentSubclass = 6 + }; + + // The supported USB Mass Storage Class transport protocols. + enum + { + kProtocolControlBulkInterrupt = 0x00, + kProtocolControlBulk = 0x01, + kProtocolBulkOnly = 0x50 + }; + + // ------- Protocol support functions ------------ + // The SendSCSICommand function will take a SCSITask Object and transport + // it across the physical wire(s) to the device + virtual bool SendSCSICommand( + SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + // The AbortSCSICommand function will abort the indicated SCSITask object, + // if it is possible and the SCSITask has not already completed. + virtual SCSIServiceResponse AbortSCSICommand( SCSITaskIdentifier abortTask ); + + virtual bool IsProtocolServiceSupported( + SCSIProtocolFeature feature, + void * serviceValue ); + + virtual bool HandleProtocolServiceFeature( + SCSIProtocolFeature feature, + void * serviceValue ); + + // Methods for retrieving and setting the object for the Interface + IOUSBInterface * GetInterfaceReference( void ); + void SetInterfaceReference( IOUSBInterface * newInterface ); + + UInt8 GetInterfaceSubclass( void ); + UInt8 GetInterfaceProtocol( void ); + + // Methods for retrieving an object for a Pipe. + IOUSBPipe * GetControlPipe( void ); + IOUSBPipe * GetBulkInPipe( void ); + IOUSBPipe * GetBulkOutPipe( void ); + IOUSBPipe * GetInterruptPipe( void ); + + // Methods for getting and setting the maximum LUN of a device. + UInt8 GetMaxLogicalUnitNumber( void ) const; + void SetMaxLogicalUnitNumber( UInt8 maxLUN ); + + virtual void CompleteSCSICommand( + SCSITaskIdentifier request, + IOReturn status ); + + virtual bool BeginProvidedServices( void ); + virtual bool EndProvidedServices( void ); + + // The Protocol specific helper methods for SendSCSICommand + virtual IOReturn SendSCSICommandForCBIProtocol( + SCSITaskIdentifier request ); + + virtual IOReturn SendSCSICommandForBulkOnlyProtocol( + SCSITaskIdentifier request ); + + // The Protocol specific helper methods for AbortSCSICommand + virtual IOReturn AbortSCSICommandForCBIProtocol( + SCSITaskIdentifier abortTask ); + + virtual IOReturn AbortSCSICommandForBulkOnlyProtocol( + SCSITaskIdentifier abortTask ); + + // Helper methods for performing general USB device requests + virtual IOReturn ClearFeatureEndpointStall( + IOUSBPipe * thePipe, + IOUSBCompletion * completion ); + virtual IOReturn GetStatusEndpointStatus( + IOUSBPipe * thePipe, + void * endpointStatus, + IOUSBCompletion * completion ); + + /* All CBI transport related methods. + */ + // All definitions and structures for the CBI Protocol + enum + { + kUSBStorageAutoStatusSize = 2 // Per the USB CBI Protocol + }; + + // Methods for accessing Bulk Only specific member variables. + CBIRequestBlock * GetCBIRequestBlock( void ); + + void ReleaseCBIRequestBlock( + CBIRequestBlock * cbiRequestBlock ); + + // Methods used for CBI/CB command transportation. + static void CBIProtocolUSBCompletionAction( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + + IOReturn CBIProtocolTransferData( + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + IOReturn CBIProtocolReadInterrupt( + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + IOReturn CBIGetStatusEndpointStatus( + IOUSBPipe * targetPipe, + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + IOReturn CBIClearFeatureEndpointStall( + IOUSBPipe * targetPipe, + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + void CBIProtocolCommandCompletion( + CBIRequestBlock * cbiRequestBlock, + IOReturn resultingStatus, + UInt32 bufferSizeRemaining ); + + /* All Bulk Only transport related methods, structures and enums. + */ + // All Bulk Only specific structures and enums. + + // All definitions and structures for the Bulk Only Protocol + // Command Block Wrapper (CBW) + enum + { + // CBW general struture definitions + kCommandBlockWrapperSignature = OSSwapHostToBigConstInt32 ( 'USBC' ), + kByteCountOfCBW = 31, + + // CBW LUN related definitions + kCBWLUNMask = 0x0F, + + kCBWFlagsDataOut = 0x00, + kCBWFlagsDataIn = 0x80 + }; + + // All definitions and structures for the Bulk Only Protocol + // Command Status Wrapper (CSW) + enum + { + // CSW general struture definitions + kCommandStatusWrapperSignature = OSSwapHostToBigConstInt32 ( 'USBS' ), + kByteCountOfCSW = 13, + + // CSW status definitions + kCSWCommandPassedError = 0x00, // No error occurred + kCSWCommandFailedError = 0x01, /* An error occurred (probably a + * bad command or parameter ) */ + kCSWPhaseError = 0x02 /* A transfer was performed in + * the wrong sequence */ + }; + + // Methods for accessing Bulk Only specific member variables. + BulkOnlyRequestBlock * GetBulkOnlyRequestBlock( void ); + + void ReleaseBulkOnlyRequestBlock( + BulkOnlyRequestBlock * boRequestBlock ); + + UInt32 GetNextBulkOnlyCommandTag( void ); + + // Methods for Bulk Only specific utility commands + IOReturn BulkDeviceResetDevice( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + // Methods used for Bulk Only command transportation. + IOReturn BulkOnlySendCBWPacket( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + IOReturn BulkOnlyTransferData( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + IOReturn BulkOnlyReceiveCSWPacket( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + void BulkOnlyExecuteCommandCompletion ( + BulkOnlyRequestBlock * boRequestBlock, + IOReturn resultingStatus, + UInt32 bufferSizeRemaining ); + + static void BulkOnlyUSBCompletionAction ( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + +public: + + bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual void free( void ); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ); + + virtual bool didTerminate( IOService * provider, + IOOptionBits options, + bool * defer ); + + virtual bool handleOpen( IOService * client, + IOOptionBits options, + void * arg ); + + virtual void handleClose( IOService * client, + IOOptionBits options ); + + virtual bool handleIsOpen( const IOService * client ) const; + + virtual IOReturn HandlePowerOn( void ); + +protected: + + static IOReturn sWaitForReset( void * refcon ); + IOReturn GatedWaitForReset( void ); + + static IOReturn sWaitForTaskAbort( void * refcon ); /* OBSOLETE */ + IOReturn GatedWaitForTaskAbort( void ); /* OBSOLETE */ + + static void sResetDevice( void * refcon ); + + static void sAbortCurrentSCSITask( void * refcon ); /* OBSOLETE */ + + OSMetaClassDeclareReservedUsed( IOUSBMassStorageClass, 1 ); + virtual IOReturn StartDeviceRecovery( void ); /* OBSOLETE */ + + OSMetaClassDeclareReservedUsed( IOUSBMassStorageClass, 2 ); + virtual void FinishDeviceRecovery( IOReturn status ); /* OBSOLETE */ + + static void DeviceRecoveryCompletionAction( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); /* OBSOLETE */ + + void ResetDeviceNow( bool waitForReset ); + + void AbortCurrentSCSITask( void ); + + bool IsPhysicalInterconnectLocationInternal ( void ); + + IOReturn SuspendPort ( bool suspend ); + +private: + + void ClearPipeStall ( void ); + + IOReturn AcceptSCSITask ( SCSITaskIdentifier scsiTask, bool * pAccepted ); + + void CheckDeferredTermination ( void ); + + void GatedCompleteSCSICommand ( SCSITaskIdentifier request, SCSIServiceResponse * serviceResponse, SCSITaskStatus * taskStatus ); + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 3 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 4 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 5 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 6 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 7 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 8 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 9 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 10 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 11 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 12 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 13 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 14 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 15 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 16 ); + +}; + + +#endif _IOKIT_IOUSBMASSSTORAGECLASS_H diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBMassStorageUFISubclass.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBMassStorageUFISubclass.h.svn-base new file mode 100644 index 0000000..cbfe3c8 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBMassStorageUFISubclass.h.svn-base @@ -0,0 +1,355 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOUSBMASSSTORAGEUFISUBCLASS_H +#define _IOKIT_IOUSBMASSSTORAGEUFISUBCLASS_H + +// This class' header file +#include <IOKit/usb/IOUSBMassStorageClass.h> +#include <IOKit/scsi/IOSCSIPrimaryCommandsDevice.h> + + +#pragma mark - +#pragma mark IOUSBMassStorageUFIDevice declaration + +class IOUSBMassStorageUFIDevice : public IOSCSIPrimaryCommandsDevice +{ + OSDeclareDefaultStructors(IOUSBMassStorageUFIDevice) + +private: + static void AsyncReadWriteComplete( SCSITaskIdentifier completedTask ); + +protected: + // Reserve space for future expansion. + struct IOUSBMassStorageUFIDeviceExpansionData + { + }; + IOUSBMassStorageUFIDeviceExpansionData *fIOUSBMassStorageUFIDeviceReserved; + + // ---- Medium Characteristics ---- + bool fMediumPresent; + + // The byte count of each physical block on the medium. + UInt32 fMediumBlockSize; + + // The total number of blocks of fMediumBlockSize on the medium. + UInt32 fMediumBlockCount; + + // Whether the installed medium is protected from writes + bool fMediumIsWriteProtected; + + // Polling thread variables + thread_call_t fPollingThread; + UInt32 fPollingMode; + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + // ---- Methods for controlling the current state of device support ---- + virtual bool InitializeDeviceSupport( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport( void ); + virtual void ResumeDeviceSupport( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport( void ); + + // ---- Methods used for misc ---- + virtual bool ClearNotReadyStatus( void ); + virtual void CreateStorageServiceNub( void ); + virtual bool DetermineDeviceCharacteristics( void ); + + // ---- Methods used for controlling the polling thread ---- + virtual void ProcessPoll( void ); + virtual void EnablePolling( void ); + virtual void DisablePolling( void ); + + // ---- Main and support methods for polling for new Media ---- + virtual void PollForNewMedia( void ); + virtual bool DetermineMediaPresence( void ); + virtual bool DetermineMediumCapacity( + UInt64 * blockSize, + UInt64 * blockCount ); + virtual bool DetermineMediumWriteProtectState( void ); + + // ---- Main and support methods for polling for Media removal ---- + virtual void PollForMediaRemoval( void ); + + // ---- Methods used for power managment ---- + virtual UInt32 GetInitialPowerState ( void ); + virtual void InitializePowerManagement ( IOService * provider ); + virtual void HandlePowerChange ( void ); + virtual void HandleCheckPowerState ( void ); + virtual void TicklePowerManager ( void ); + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // ---- Methods used for handling medium characteristics ---- + virtual void SetMediumCharacteristics( + UInt32 blockSize, + UInt32 blockCount ); + + virtual void ResetMediumCharacteristics( void ); + + virtual IOReturn IssueRead( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + + virtual IOReturn IssueWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + +public: + + static void sProcessPoll( void * pdtDriver, void * refCon ); + + // Interface to the UFI Storage Services Driver + // ---- Methods for controlling the device ---- + virtual IOReturn SyncReadWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize ); + + virtual IOReturn AsyncReadWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + void * clientData ); + + // ---- Methods for controlling medium state ---- + virtual IOReturn EjectTheMedium( void ); + + // ---- Methods for controlling media format ---- + virtual IOReturn FormatMedium( + UInt64 blockCount, + UInt64 blockSize ); + virtual UInt32 GetFormatCapacities( + UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + // ---- Query methods to report device characteristics ---- + // Report the maximum number of blocks that the device can handle per + // read or write. A value of 0 (zero) indicates there is no limit aside + // from the size of the method's return parameter. + virtual UInt64 ReportDeviceMaxBlocksReadTransfer( void ); + virtual UInt64 ReportDeviceMaxBlocksWriteTransfer( void ); + + // ---- Query methods to report installed medium characteristics ---- + virtual UInt64 ReportMediumBlockSize( void ); + virtual UInt64 ReportMediumTotalBlockCount( void ); + virtual bool ReportMediumWriteProtection( void ); + + // Methods for getting device information strings + virtual char * GetVendorString( void ); + virtual char * GetProductString( void ); + virtual char * GetRevisionString( void ); + OSDictionary * GetProtocolCharacteristicsDictionary ( void ); + OSDictionary * GetDeviceCharacteristicsDictionary ( void ); + +protected: + // Utility methods used by all SCSI Command Set objects + + // isParameterValid methods are used to validate that the parameter passed into + // the command methods are of the correct value. + + // Validate Parameter used for 1 bit to 1 byte paramaters + bool IsParameterValid( + SCSICmdField1Byte param, + SCSICmdField1Byte mask ); + + // Validate Parameter used for 9 bit to 2 byte paramaters + bool IsParameterValid( + SCSICmdField2Byte param, + SCSICmdField2Byte mask ); + + // Validate Parameter used for 17 bit to 4 byte paramaters + bool IsParameterValid( + SCSICmdField4Byte param, + SCSICmdField4Byte mask ); + + // UFI Required Commands + virtual bool FORMAT_UNIT( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount defectListSize, + SCSICmdField1Byte TRACK_NUMBER, + SCSICmdField2Byte INTERLEAVE ); + + virtual bool INQUIRY( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + virtual bool MODE_SELECT_10( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField2Byte PARAMETER_LIST_LENGTH ); + + virtual bool MODE_SENSE_10( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte PARAMETER_LIST_LENGTH ); + + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL( + SCSITaskIdentifier request, + SCSICmdField1Bit PREVENT ); + + virtual bool READ_10( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + virtual bool READ_12( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH ); + + virtual bool READ_CAPACITY( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI ); + + virtual bool READ_FORMAT_CAPACITIES( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH ); + + virtual bool REQUEST_SENSE( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + virtual bool REZERO_UNIT( + SCSITaskIdentifier request ); + + virtual bool SEEK( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS ); + + virtual bool SEND_DIAGNOSTICS( + SCSITaskIdentifier request, + SCSICmdField1Bit PF, + SCSICmdField1Bit SELF_TEST, + SCSICmdField1Bit DEF_OFL, + SCSICmdField1Bit UNIT_OFL ); + + virtual bool START_STOP_UNIT( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START ); + + virtual bool TEST_UNIT_READY( + SCSITaskIdentifier request ); + + virtual bool VERIFY( + SCSITaskIdentifier request, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH ); + + virtual bool WRITE_10( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + virtual bool WRITE_12( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH ); + + virtual bool WRITE_AND_VERIFY( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); +}; + + +#pragma mark - +#pragma mark IOUSBMassStorageUFISubclass declaration + + +class IOUSBMassStorageUFISubclass : public IOUSBMassStorageClass +{ + OSDeclareDefaultStructors(IOUSBMassStorageUFISubclass) + +protected: + virtual bool BeginProvidedServices( void ); + virtual bool EndProvidedServices( void ); +}; + +#endif _IOKIT_IOUSBMASSSTORAGEUFISUBCLASS_H diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBNub.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBNub.h.svn-base new file mode 100644 index 0000000..a998e5b --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBNub.h.svn-base @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBNUB_H +#define _IOKIT_IOUSBNUB_H + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> + +class IOUSBController; +class IOUSBPipe; + +/*! + @class IOUSBNub + @abstract Super class for for IOUSBDevice and IOUSBInterface. + */ +class IOUSBNub : public IOService +{ + OSDeclareDefaultStructors(IOUSBNub) + +public: + + // IOKit method + virtual void joinPMtree ( IOService * driver ); + + virtual bool USBCompareProperty(OSDictionary * matching, const char * key ); + + bool IsWildCardMatch( OSDictionary * matching, const char * key ); + bool USBComparePropertyWithMask( OSDictionary *matching, const char *key, const char * maskKey ); +}; + +#ifdef __cplusplus +extern "C" { +#endif + +void printDescriptor(const IOUSBDescriptorHeader *desc); +void printDeviceDescriptor(const IOUSBDeviceDescriptor *desc); +void printConfigDescriptor(const IOUSBConfigurationDescriptor *cd); +void printEndpointDescriptor(const IOUSBEndpointDescriptor *ed); +void printInterfaceDescriptor(const IOUSBInterfaceDescriptor *id); + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IOUSBNUB_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBPipe.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBPipe.h.svn-base new file mode 100644 index 0000000..3286b92 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBPipe.h.svn-base @@ -0,0 +1,387 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBPIPE_H +#define _IOKIT_IOUSBPIPE_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBController.h> +#include <IOKit/usb/IOUSBControllerV2.h> + +class IOUSBInterface; + +/*! + @class IOUSBPipe + @abstract The object representing an open pipe for a device. +*/ +class IOUSBPipe : public OSObject +{ + friend class IOUSBInterface; + friend class IOUSBDevice; + + OSDeclareDefaultStructors(IOUSBPipe) + +protected: + + const IOUSBEndpointDescriptor * _descriptor; + IOUSBController::Endpoint _endpoint; // tidied up version of descriptor + IOUSBController * _controller; + USBDeviceAddress _address; + UInt8 _status; // was previously used for status. Now used to detect whether a property exists or not + + struct ExpansionData + { + IOReturn _correctStatus; + IOUSBDevice * _device; // Remember containing device for clearing TTs + UInt8 _speed; + IOUSBInterface * _interface; + bool _crossEndianCompatible; + UInt32 _locationID; + }; + ExpansionData * _expansionData; + + virtual void free(); + + IOReturn ClosePipe(void); + +public: + + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller); + + // The following 2 methods are obsolete + // + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, + IOUSBDevice * device, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, + IOUSBDevice * device, IOUSBController * controller, IOUSBInterface *interface); + + // Controlling pipe state + /*! + @function GetStatus + This method does NOT work. Do not call it. See GetPipeStatus for the correct method. + GetStatus will always return 0. + */ + virtual UInt8 GetStatus(void); + /*! + @function Abort + This method causes all outstanding I/O on a pipe to complete with return code kIOReturnAborted. It clears the halted bit but does NOT clear the + toggle bit on the endpoint in the controller. If you wish to clear the toggle bit, see ClearPipeStall + */ + virtual IOReturn Abort(void); + /*! + @function Reset + This method is identical to ClearPipeStall(false). The use of that API is preferred. + */ + virtual IOReturn Reset(void); + /*! + @function ClearStall + This method is equivalent to ClearPipeStall(false). This method is available before version 1.9. + */ + virtual IOReturn ClearStall(void); + + // + // Transferring Data + // + + // deprecated + virtual IOReturn Read(IOMemoryDescriptor * buffer, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + // deprecated + virtual IOReturn Write(IOMemoryDescriptor * buffer, + IOUSBCompletion * completion = 0); + + // Transfer data over Isochronous pipes + /*! + @function Read + Read from an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, + IOUSBIsocCompletion * completion = 0); + /*! + @function Write + Write to an isochronous endpoint + @param buffer place to get the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, + IOUSBIsocCompletion * completion = 0); + + // Do a control request over a Control pipe, using a memory descriptor + /*! + @function ControlRequest + Make a control request + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + */ + virtual IOReturn ControlRequest(IOUSBDevRequestDesc *request, + IOUSBCompletion *completion = 0); + + // Do a control request over a Control pipe, using a simple buffer + virtual IOReturn ControlRequest(IOUSBDevRequest *request, + IOUSBCompletion *completion = 0); + + /* + * Accessors + */ + /*! + @function GetEndpoint + returns a pointer to the Endpoint structure for the pipe. + */ + virtual const IOUSBController::Endpoint * GetEndpoint(); + /*! + @function GetEndpointDescriptor + returns the endpoint descriptor for the pipe. + */ + virtual const IOUSBEndpointDescriptor * GetEndpointDescriptor(); + /*! + @function GetDirection + returns the direction of the pipe:kUSBOut/kUSBIn for a bulk or interrupt pipe, + kUSBAnyDirn for a control pipe. + */ + virtual UInt8 GetDirection(); + /*! + @function GetType + returns the pipe type: kUSBControl, kUSBBulk or kUSBInterrupt. + */ + virtual UInt8 GetType(); + /*! + @function GetEndpointNumber + returns the endpoint number in the device that the pipe is connected to. + */ + virtual UInt8 GetEndpointNumber(); + virtual USBDeviceAddress GetAddress(); + virtual UInt16 GetMaxPacketSize(); + virtual UInt8 GetInterval(); + + // Transfer data over Bulk pipes with timeouts. + OSMetaClassDeclareReservedUsed(IOUSBPipe, 0); + + // deprecated + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 1); + + // deprecated + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion * completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 2); + // Do a control request over a Control pipe, using a memory descriptor + /*! + @function ControlRequest + Make a control request. + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion describes action to take when the request has been executed + */ + virtual IOReturn ControlRequest(IOUSBDevRequestDesc *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 3); + // Do a control request over a Control pipe, using a simple buffer + virtual IOReturn ControlRequest(IOUSBDevRequest *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 4); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 5); + /*! + @function Write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 6); + /*! + @function GetPipeStatus + Returns the status of the pipe (kIOUSBPipeStalled of the pipe is stalled, else kIOReturnSuccess) + */ + virtual IOReturn GetPipeStatus(void); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 7); + /*! + @function ClearPipeStall + AVAILABLE ONLY IN VERSION 1.9 AND ABOVE + This method causes all outstanding I/O on a pipe to complete with return code kIOUSBTransactionReturned. It also clears both the halted bit and the + toggle bit on the endpoint in the controller. The driver may need to reset the data toggle within the device to avoid losing any data. If the + device correctly handles the ClearFeature(ENDPOINT_HALT) device request, then this API will handle that by sending the correct request to the + device. + @param withDeviceRequest if true, a ClearFeature(ENDPOINT_HALT) is sent to the appropriate endpoint on the device after the transactions on the + controllers endpoint are returned and the toggle bit on the controllers endpoint is cleared. if this parameter is false, then this is equivalent + to the pre-1.9 API. This means that the endpoint on the controller is cleared, but no DeviceRequest is sent to the device's endpoint. + */ + virtual IOReturn ClearPipeStall(bool withDeviceRequest); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 8); + /*! + @function SetPipePolicy + AVAILABLE ONLY IN VERSION 1.9 AND ABOVE + This method allows a driver to change the maxPacketSize of an Isochronous pipe, or the polling interval for an interrupt pipe. There is a limited + amount of bandwidth on any single bus, and isochronous pipes tend to use much of this bandwidth. The driver may know, however, that there + will never be as much bandwidth used as is specified in the pipe's endpoint descriptor. Therefore, the driver may return some of this + bandwidth to the system by using this method. Additionally, if on an open of an IOUSBInterface any of the Isochronous pipes is unable to be + opened because of a lack of bandwidth, the pipe will be created with a bandwidth of zero, and the driver may get some of the limited bandwidth + remaining by using this call. + This method returns kIOReturnBadArgument if the pipe is a bulk on control pipe, or if the maxPacketSize parameter is larger than the amount specified + in the endpoint descriptor. It returns kIOReturnNoBandwidth if the bandwidth requested cannot be allocated. Otherwise it returns kIOReturnSuccess. + @param maxPacketSize specifies the maximum number of bytes to be used in any one millisecond frame by this pipe. The value must be less than or + equal to the maxPacketSize specified in the endpoint descriptor. + @param maxInterval not currently used. reserved for future expansion + + */ + virtual IOReturn SetPipePolicy(UInt16 maxPacketSize, UInt8 maxInterval); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 9); + + // Transfer data over Isochronous pipes and process the frame list at hardware interrupt time + /*! + @function Read + AVAILABLE ONLY IN VERSION 1.9.2 AND ABOVE + Read from an isochronous endpoint and process the IOUSBLowLatencyIsocFrame fields at + hardware interrupt time + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer, result, and time stamp for each frame + @param completion describes action to take when buffer has been filled + @param updateFrequency describes how often (in milliseconds) should the frame list be processed + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, + IOUSBLowLatencyIsocCompletion * completion = 0, UInt32 updateFrequency = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 10); + /*! + @function Write + AVAILABLE ONLY IN VERSION 1.9.2 AND ABOVE + Write to an isochronous endpoint + @param buffer place to get the data to transfer + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Pointer to list of frames indicating bytes to transfer and result for each frame + @param completion describes action to take when buffer has been emptied + @param updateFrequency describes how often (in milliseconds) should the frame list be processed + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, + IOUSBLowLatencyIsocCompletion * completion = 0, UInt32 updateFrequency = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 11); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletionWithTimeStamp * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 12); + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller, IOUSBDevice * device, IOUSBInterface * interface); + + OSMetaClassDeclareReservedUnused(IOUSBPipe, 13); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 14); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 15); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 16); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 17); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 18); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 19); + +}; + +#endif /* _IOKIT_IOUSBPIPE_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBRootHubDevice.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBRootHubDevice.h.svn-base new file mode 100644 index 0000000..19a17c4 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBRootHubDevice.h.svn-base @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBROOTHUBDEVICE_H +#define _IOKIT_IOUSBROOTHUBDEVICE_H + +#include <IOKit/usb/IOUSBHubDevice.h> + +/*! + @class IOUSBRootHubDevice + @abstract The object representing the Root Hub simulation. + */ +class IOUSBRootHubDevice : public IOUSBHubDevice +{ + OSDeclareDefaultStructors(IOUSBRootHubDevice) + +private: + UInt16 configuration; + IOCommandGate *_commandGate; + + // private method which overrides the same method in IOUSBHubDevice + virtual bool InitializeCharacteristics(void); // used at start + + struct ExpansionData + { + IOService * _IOResourcesEntry; + }; + ExpansionData *_expansionData; + +public: + // static methods + static IOUSBRootHubDevice *NewRootHubDevice(void); + static IOReturn GatedDeviceRequest (OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + // IOKit methods + virtual bool init(); + virtual bool start( IOService * provider ); + virtual void stop( IOService *provider ); + virtual void free(); + + // IOUSBHubDevice methods + virtual bool IsRootHub(void); + virtual UInt32 RequestExtraPower(UInt32 requestedPower); + virtual void ReturnExtraPower(UInt32 returnedPower); + + // + virtual UInt32 RequestSleepPower(UInt32 requestedPower); + virtual void ReturnSleepPower(UInt32 returnedPower); + + // a non static but non-virtual function + IOReturn DeviceRequestWorker(IOUSBDevRequest *request, UInt32 noDataTimeout, UInt32 completionTimeout, IOUSBCompletion *completion); + + // IOUSBDevice methods overriden here + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion = 0); + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, UInt32 noDataTimeout, UInt32 completionTimeout, IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 0); + virtual IOReturn GetDeviceInformation(UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 1); + virtual void InitializeExtraPower(UInt32 maxPortCurrent, UInt32 totalExtraCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 2); + virtual void SetSleepCurrent(UInt32 sleepCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 3); + virtual UInt32 GetSleepCurrent(); + + OSMetaClassDeclareReservedUnused(IOUSBRootHubDevice, 4); +}; + +#endif /* _IOKIT_IOUSBROOTHUBDEVICE_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBUserClient.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBUserClient.h.svn-base new file mode 100644 index 0000000..1cd47a8 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBUserClient.h.svn-base @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBUSERCLIENT_H +#define _IOKIT_IOUSBUSERCLIENT_H + +// these are the new User Client method names +enum { + kUSBDeviceUserClientOpen, + kUSBDeviceUserClientClose, + kUSBDeviceUserClientSetConfig, + kUSBDeviceUserClientGetConfig, + kUSBDeviceUserClientGetConfigDescriptor, + kUSBDeviceUserClientGetFrameNumber, + kUSBDeviceUserClientDeviceRequestOut, + kUSBDeviceUserClientDeviceRequestIn, + kUSBDeviceUserClientCreateInterfaceIterator, + kUSBDeviceUserClientResetDevice, + kUSBDeviceUserClientSuspend, + kUSBDeviceUserClientAbortPipeZero, + kUSBDeviceUserClientReEnumerateDevice, + kUSBDeviceUserClientGetMicroFrameNumber, + kUSBDeviceUserClientGetFrameNumberWithTime, + kUSBDeviceUserClientSetAsyncPort, + kUSBDeviceUserClientGetDeviceInformation, + kUSBDeviceUserClientRequestExtraPower, + kUSBDeviceUserClientReturnExtraPower, + kUSBDeviceUserClientGetExtraPowerAllocated, + kIOUSBLibDeviceUserClientNumCommands + }; + +enum { + kUSBInterfaceUserClientOpen, + kUSBInterfaceUserClientClose, + kUSBInterfaceUserClientGetDevice, + kUSBInterfaceUserClientSetAlternateInterface, + kUSBInterfaceUserClientGetFrameNumber, + kUSBInterfaceUserClientGetPipeProperties, + kUSBInterfaceUserClientReadPipe, + kUSBInterfaceUserClientWritePipe, + kUSBInterfaceUserClientGetPipeStatus, + kUSBInterfaceUserClientAbortPipe, + kUSBInterfaceUserClientResetPipe, + kUSBInterfaceUserClientClearPipeStall, + kUSBInterfaceUserClientControlRequestOut, + kUSBInterfaceUserClientControlRequestIn, + kUSBInterfaceUserClientSetPipePolicy, + kUSBInterfaceUserClientGetBandwidthAvailable, + kUSBInterfaceUserClientGetEndpointProperties, + kUSBInterfaceUserClientLowLatencyPrepareBuffer, + kUSBInterfaceUserClientLowLatencyReleaseBuffer, + kUSBInterfaceUserClientGetMicroFrameNumber, + kUSBInterfaceUserClientGetFrameListTime, + kUSBInterfaceUserClientGetFrameNumberWithTime, + kUSBInterfaceUserClientSetAsyncPort, + kUSBInterfaceUserClientReadIsochPipe, + kUSBInterfaceUserClientWriteIsochPipe, + kUSBInterfaceUserClientLowLatencyReadIsochPipe, + kUSBInterfaceUserClientLowLatencyWriteIsochPipe, + kUSBInterfaceUserClientGetConfigDescriptor, + kIOUSBLibInterfaceUserClientNumCommands + }; + + +#if KERNEL +#include <IOKit/IOService.h> +#include <IOKit/IOUserClient.h> +#include <IOKit/usb/USB.h> + +//================================================================================================ +// +// Structure declarations +// +//================================================================================================ +// +typedef struct IOUSBUserClientAsyncParamBlock IOUSBUserClientAsyncParamBlock; + +struct IOUSBUserClientAsyncParamBlock +{ + OSAsyncReference64 fAsyncRef; + uint32_t fAsyncCount; + uint32_t fMax; + IOMemoryDescriptor * fMem; + IOUSBDevRequestDesc req; +}; + +typedef struct IOUSBInterfaceUserClientISOAsyncParamBlock IOUSBInterfaceUserClientISOAsyncParamBlock; +struct IOUSBInterfaceUserClientISOAsyncParamBlock +{ + OSAsyncReference64 fAsyncRef; + uint32_t fAsyncCount; + mach_vm_size_t frameLen; // In bytes + mach_vm_address_t frameBase; // In user task + IOMemoryDescriptor * dataMem; + IOMemoryDescriptor * countMem; + uint64_t numFrames; + IOUSBIsocFrame frames[0]; // Must be the last one +}; + + +//================================================================================================ +// +// This class is used to add an IOProviderMergeProperties dictionary entry to a provider's +// property list, thus providing a tie between hardware and a CFBundle at hardware +// load time. This property usually contains the user client class name and the CFPlugInTypes UUID's +// but it can contain other properties. +// +//================================================================================================ +// +class IOUSBUserClientInit : public IOService +{ + OSDeclareDefaultStructors(IOUSBUserClientInit); + +public: + + virtual bool start(IOService * provider) ; + virtual bool MergeDictionaryIntoProvider(IOService * provider, OSDictionary * mergeDict); + virtual bool MergeDictionaryIntoDictionary(OSDictionary * sourceDictionary, OSDictionary * targetDictionary); +}; + +#endif // KERNEL + +#endif /* ! _IOKIT_IOUSBUSERCLIENT_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/IOUSBWorkLoop.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/IOUSBWorkLoop.h.svn-base new file mode 100644 index 0000000..7630704 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/IOUSBWorkLoop.h.svn-base @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2001-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBWORKLOOP_H +#define _IOKIT_IOUSBWORKLOOP_H + +#include <IOKit/IOWorkLoop.h> + +/*! + @class IOUSBWorkLoop + @abstract Subclass of IOWorkloop that allows the USB stack to more finely control sleep and wake. + */ +class IOUSBWorkLoop : public IOWorkLoop +{ + OSDeclareDefaultStructors(IOUSBWorkLoop) + +protected: + void * fSleepToken; +#ifndef __OPEN_SOURCE__ + lck_grp_t * fLockGroup; +#endif + bool init ( const char * controllerLocation ); + void free ( void ); + + // Overrides to check for sleeping + virtual void closeGate(); + virtual bool tryCloseGate(); + +public: + // Create a workloop + static IOUSBWorkLoop * workLoop(const char * controllerLocation); + + // Put workloop to sleep (Must have gate closed, opens gate if successful) + virtual IOReturn sleep(void *token); + + // Wake workloop up (closes gate if successful) + virtual IOReturn wake(void *token); + + void CloseGate(void); + void OpenGate(void); +}; + +#endif /* ! _IOKIT_IOUSBWORKLOOP_H */ + diff --git a/i386/include/IOKit/usb/.svn/text-base/USB.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/USB.h.svn-base new file mode 100644 index 0000000..8ba12bb --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/USB.h.svn-base @@ -0,0 +1,1076 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _USB_H +#define _USB_H + +#if KERNEL + #include <libkern/OSByteOrder.h> + #include <IOKit/IOMemoryDescriptor.h> +#else + #include <libkern/OSByteOrder.h> +#endif + +#include <IOKit/IOTypes.h> + +#if !defined(__USB__) +# include <IOKit/usb/USBSpec.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + /*! + @header USB.h + @abstract Public Interfaces to the USB implementation in Mac OS X. + @discussion This header file contains definitions and structures that are used in the different USB API's in Mac OS X, both in the kernel and in the user space. + */ + + /*! + @defined Endian conversion definitions + @discussion The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be + formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for + in-kernel use and for user space use. + */ +#define USBToHostWord OSSwapLittleToHostInt16 +#define HostToUSBWord OSSwapHostToLittleInt16 +#define USBToHostLong OSSwapLittleToHostInt32 +#define HostToUSBLong OSSwapHostToLittleInt32 + + /*! + @enum Miscellaneous Constants + @discussion + */ + enum { + kUSBDeviceIDShift = 7, + kUSBMaxDevices = 128, + kUSBMaxDevice = kUSBMaxDevices-1, + kUSBDeviceIDMask = 0x7f, + + kUSBPipeIDMask = 0xf, + kUSBMaxPipes = 32, // In and Out pipes can have same pipe number. + + kUSBInterfaceIDShift = 8, + kUSBMaxInterfaces = 1 << kUSBInterfaceIDShift, + kUSBInterfaceIDMask = kUSBMaxInterfaces-1, + + kUSBEndPtShift = 7, + kUSBDeviceMask = ((1 << kUSBEndPtShift) -1), + + kUSBNoPipeIdx = -1 +}; + +/*! +@enum bRequest Shifts and Masks +@discussion These are used to create the macro to encode the bRequest filed of a Device Request +*/ +enum { + kUSBRqDirnShift = 7, + kUSBRqDirnMask = 1, + + kUSBRqTypeShift = 5, + kUSBRqTypeMask = 3, + + kUSBRqRecipientMask = 0X1F +}; + +/*! +@defined USBmakebmRequestType +@discussion Macro to encode the bRequest field of a Device Request. It is used when constructing an IOUSBDevRequest. +*/ +#define USBmakebmRequestType(direction, type, recipient) \ + ((direction & kUSBRqDirnMask) << kUSBRqDirnShift) | \ + ((type & kUSBRqTypeMask) << kUSBRqTypeShift) | \ + (recipient & kUSBRqRecipientMask) + +/*! +@enum kUSBMaxIsocFrameReqCount +@discussion Maximum size in bytes allowed for one Isochronous frame +*/ +enum { + kUSBMaxFSIsocEndpointReqCount = 1023, // max size (bytes) of any one Isoc frame for 1 FS endpoint + kUSBMaxHSIsocEndpointReqCount = 3072, // max size (bytes) of any one Isoc frame for 1 HS endpoint + kUSBMaxHSIsocFrameCount = 7168 // max size (bytes) of all Isoc transfers in a HS frame +}; + +/*! +@defined EncodeRequest +@discussion Macro that encodes the bRequest and bRequestType fields of a IOUSBDevRequest into a single value. It is useful when one needs +to know what type of request the IOUSBDevRequest encodes and simplifies comparisons. +*/ +#define EncodeRequest(request, direction, type, recipient) \ + (((UInt16)request << 8) + \ + ((UInt16)recipient + \ + ((UInt16)type << kUSBRqTypeShift) + \ + ((UInt16)direction << kUSBRqDirnShift))) + + +/*! +@enum Standard Device Requests +@discussion Encoding of the standard device requests. +<tt> +<pre><b> +bmRequestType bRequest wValue wIndex wLength Data</b> +00000000B CLEAR_FEATURE Feature Zero Zero None (device) +00000001B Feature Interface Zero None (Interface) +00000010B Feature Endpoint Zero None (Endpoint) + +10000000B GET_CONFIGURATION Zero Zero One Configuration +10000000B GET_DESCRIPTOR Type LangID Length Descriptor +10000001B GET_INTERFACE Zero Interface One Alternate + +10000000B GET_STATUS Zero Zero Two status (device) +10000001B Zero Interface Two status (Interface) +10000010B Zero Endpoint Two status (Endpoint) + +00000000B SET_ADDRESS Address Zero Zero None +00000000B SET_CONFIGURATION Configuration Zero Zero None +00000000B SET_DESCRIPTOR Type LangID Length Descriptor + +00000000B SET_FEATURE Feature Zero Zero None (device) +00000001B Feature Interface Zero None (Interface) +00000010B Feature Endpoint Zero None (Endpoint) + +00000001B SET_INTERFACE Alternate Interface Zero None +10000010B SYNCH_FRAME Zero Endpoint Two Frame Number +</pre> +</tt> +*/ +enum { + kClearDeviceFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBDevice), + kClearInterfaceFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBInterface), + kClearEndpointFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBEndpoint), + kGetConfiguration = EncodeRequest(kUSBRqGetConfig, kUSBIn, kUSBStandard, kUSBDevice), + kGetDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBStandard, kUSBDevice), + kGetInterface = EncodeRequest(kUSBRqGetInterface, kUSBIn, kUSBStandard, kUSBInterface), + kGetDeviceStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBDevice), + kGetInterfaceStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBInterface), + kGetEndpointStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBEndpoint), + kSetAddress = EncodeRequest(kUSBRqSetAddress, kUSBOut, kUSBStandard, kUSBDevice), + kSetConfiguration = EncodeRequest(kUSBRqSetConfig, kUSBOut, kUSBStandard, kUSBDevice), + kSetDescriptor = EncodeRequest(kUSBRqSetDescriptor, kUSBOut, kUSBStandard, kUSBDevice), + kSetDeviceFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBDevice), + kSetInterfaceFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBInterface), + kSetEndpointFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBEndpoint), + kSetInterface = EncodeRequest(kUSBRqSetInterface, kUSBOut, kUSBStandard, kUSBInterface), + kSyncFrame = EncodeRequest(kUSBRqSyncFrame, kUSBIn, kUSBStandard, kUSBEndpoint), +}; + +/*! +@defined kCallInterfaceOpenWithGate + @discussion If the USB Device has this property, drivers for any of its interfaces will have their handleOpen method called while holding the workloop gate. + */ +#define kCallInterfaceOpenWithGate "kCallInterfaceOpenWithGate" + +// TYPES + +typedef UInt16 USBDeviceAddress; + +typedef uint32_t USBPhysicalAddress32; + +/*! + @typedef IOUSBIsocFrame + @discussion Structure used to encode information about each isoc frame. + @param frStatus Returns status associated with the frame. + @param frReqCount Input specifiying how many bytes to read or write. + @param frActCount Actual # of bytes transferred. +*/ +typedef struct IOUSBIsocFrame { + IOReturn frStatus; + UInt16 frReqCount; + UInt16 frActCount; +} IOUSBIsocFrame; + + +/*! + @typedef IOUSBLowLatencyIsocFrame + @discussion Structure used to encode information about each isoc frame that is processed + at hardware interrupt time (low latency). + @param frStatus Returns status associated with the frame. + @param frReqCount Input specifiying how many bytes to read or write. + @param frActCount Actual # of bytes transferred. + @param frTimeStamp Time stamp that indicates time when frame was procesed. +*/ +struct IOUSBLowLatencyIsocFrame { + IOReturn frStatus; + UInt16 frReqCount; + UInt16 frActCount; + AbsoluteTime frTimeStamp; +}; +typedef struct IOUSBLowLatencyIsocFrame IOUSBLowLatencyIsocFrame; + +/*! +@typedef IOUSBCompletionAction + @discussion Function called when USB I/O completes. + @param target The target specified in the IOUSBCompletion struct. + @param parameter The parameter specified in the IOUSBCompletion struct. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + */ +typedef void (*IOUSBCompletionAction)( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + +/*! +@typedef IOUSBCompletionActionWithTimeStamp + @discussion Function called when USB I/O completes. + @param target The target specified in the IOUSBCompletion struct. + @param parameter The parameter specified in the IOUSBCompletion struct. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + @param timeStamp Time at which the transaction was processed. + */ +typedef void (*IOUSBCompletionActionWithTimeStamp)( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining, + AbsoluteTime timeStamp); + +/*! + @typedef IOUSBIsocCompletionAction + @discussion Function called when Isochronous USB I/O completes. + @param target The target specified in the IOUSBIsocCompletionn struct. + @param parameter The parameter specified in the IOUSBIsocCompletion struct. + @param status Completion status. + @param pFrames Pointer to the frame list containing the status for each frame transferred. +*/ +typedef void (*IOUSBIsocCompletionAction)( + void * target, + void * parameter, + IOReturn status, + IOUSBIsocFrame *pFrames); + +/*! + @typedef IOUSBLowLatencyIsocCompletionAction + @discussion Function called when Low Latency Isochronous USB I/O completes. + @param target The target specified in the IOUSBLowLatencyIsocCompletion struct. + @param parameter The parameter specified in the IOUSBLowLatencyIsocCompletion struct. + @param status Completion status. + @param pFrames Pointer to the low latency frame list containing the status for each frame transferred. +*/ +typedef void (*IOUSBLowLatencyIsocCompletionAction)( + void * target, + void * parameter, + IOReturn status, + IOUSBLowLatencyIsocFrame *pFrames); + +/*! +@typedef IOUSBCompletion + @discussion Struct specifying action to perform when a USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBCompletion { + void * target; + IOUSBCompletionAction action; + void * parameter; +} IOUSBCompletion; + +/*! +@typedef IOUSBCompletionWithTimeStamp + @discussion Struct specifying action to perform when a USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBCompletionWithTimeStamp { + void * target; + IOUSBCompletionActionWithTimeStamp action; + void * parameter; +} IOUSBCompletionWithTimeStamp; + +/*! + @typedef IOUSBIsocCompletion + @discussion Struct specifying action to perform when an Isochronous USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. +*/ +typedef struct IOUSBIsocCompletion { + void * target; + IOUSBIsocCompletionAction action; + void * parameter; +} IOUSBIsocCompletion; + +/*! + @typedef IOUSBLowLatencyIsocCompletion + @discussion Struct specifying action to perform when an Low Latency Isochronous USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. +*/ +typedef struct IOUSBLowLatencyIsocCompletion { + void * target; + IOUSBLowLatencyIsocCompletionAction action; + void * parameter; +} IOUSBLowLatencyIsocCompletion; + + +/*! +@defined IOUSBFamily error codes +@discussion Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. +*/ +#define iokit_usb_err(return) (sys_iokit|sub_iokit_usb|return) +#define kIOUSBUnknownPipeErr iokit_usb_err(0x61) // 0xe0004061 Pipe ref not recognized +#define kIOUSBTooManyPipesErr iokit_usb_err(0x60) // 0xe0004060 Too many pipes +#define kIOUSBNoAsyncPortErr iokit_usb_err(0x5f) // 0xe000405f no async port +#define kIOUSBNotEnoughPipesErr iokit_usb_err(0x5e) // 0xe000405e not enough pipes in interface +#define kIOUSBNotEnoughPowerErr iokit_usb_err(0x5d) // 0xe000405d not enough power for selected configuration +#define kIOUSBEndpointNotFound iokit_usb_err(0x57) // 0xe0004057 Endpoint Not found +#define kIOUSBConfigNotFound iokit_usb_err(0x56) // 0xe0004056 Configuration Not found +#define kIOUSBTransactionTimeout iokit_usb_err(0x51) // 0xe0004051 Transaction timed out +#define kIOUSBTransactionReturned iokit_usb_err(0x50) // 0xe0004050 The transaction has been returned to the caller +#define kIOUSBPipeStalled iokit_usb_err(0x4f) // 0xe000404f Pipe has stalled, error needs to be cleared +#define kIOUSBInterfaceNotFound iokit_usb_err(0x4e) // 0xe000404e Interface ref not recognized +#define kIOUSBLowLatencyBufferNotPreviouslyAllocated iokit_usb_err(0x4d) // 0xe000404d Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the data buffer) first +#define kIOUSBLowLatencyFrameListNotPreviouslyAllocated iokit_usb_err(0x4c) // 0xe000404c Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the frame list) first +#define kIOUSBHighSpeedSplitError iokit_usb_err(0x4b) // 0xe000404b Error to hub on high speed bus trying to do split transaction +#define kIOUSBSyncRequestOnWLThread iokit_usb_err(0x4a) // 0xe000404a A synchronous USB request was made on the workloop thread (from a callback?). Only async requests are permitted in that case +#define kIOUSBDeviceNotHighSpeed iokit_usb_err(0x49) // 0xe0004049 The device is not a high speed device, so the EHCI driver returns an error +#define kIOUSBDevicePortWasNotSuspended iokit_usb_err(0x50) // 0xe0004050 Port was not suspended + +/*! +@defined IOUSBFamily hardware error codes +@discussion These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. +For the following Completion codes, we return a generic IOKit error instead of a USB specific error. +<tt> +<pre> +Completion Code Error Returned Description +9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size +8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer +5 kIOReturnNotResponding Device Not responding +4 kIOUSBPipeStalled Endpoint returned a STALL PID +</pre> +</tt> +*/ +#define kIOUSBLinkErr iokit_usb_err(0x10) // 0xe0004010 +#define kIOUSBNotSent2Err iokit_usb_err(0x0f) // 0xe000400f Transaction not sent +#define kIOUSBNotSent1Err iokit_usb_err(0x0e) // 0xe000400e Transaction not sent +#define kIOUSBBufferUnderrunErr iokit_usb_err(0x0d) // 0xe000400d Buffer Underrun (Host hardware failure on data out, PCI busy?) +#define kIOUSBBufferOverrunErr iokit_usb_err(0x0c) // 0xe000400c Buffer Overrun (Host hardware failure on data out, PCI busy?) +#define kIOUSBReserved2Err iokit_usb_err(0x0b) // 0xe000400b Reserved +#define kIOUSBReserved1Err iokit_usb_err(0x0a) // 0xe000400a Reserved +#define kIOUSBWrongPIDErr iokit_usb_err(0x07) // 0xe0004007 Pipe stall, Bad or wrong PID +#define kIOUSBPIDCheckErr iokit_usb_err(0x06) // 0xe0004006 Pipe stall, PID CRC error +#define kIOUSBDataToggleErr iokit_usb_err(0x03) // 0xe0004003 Pipe stall, Bad data toggle +#define kIOUSBBitstufErr iokit_usb_err(0x02) // 0xe0004002 Pipe stall, bitstuffing +#define kIOUSBCRCErr iokit_usb_err(0x01) // 0xe0004001 Pipe stall, bad CRC + +/*! +@defined IOUSBFamily message codes +@discussion Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. +*/ +#define iokit_usb_msg(message) (UInt32)(sys_iokit|sub_iokit_usb|message) +#define kIOUSBMessageHubResetPort iokit_usb_msg(0x01) // 0xe0004001 Message sent to a hub to reset a particular port +#define kIOUSBMessageHubSuspendPort iokit_usb_msg(0x02) // 0xe0004002 Message sent to a hub to suspend a particular port +#define kIOUSBMessageHubResumePort iokit_usb_msg(0x03) // 0xe0004003 Message sent to a hub to resume a particular port +#define kIOUSBMessageHubIsDeviceConnected iokit_usb_msg(0x04) // 0xe0004004 Message sent to a hub to inquire whether a particular port has a device connected or not +#define kIOUSBMessageHubIsPortEnabled iokit_usb_msg(0x05) // 0xe0004005 Message sent to a hub to inquire whether a particular port is enabled or not +#define kIOUSBMessageHubReEnumeratePort iokit_usb_msg(0x06) // 0xe0004006 Message sent to a hub to reenumerate the device attached to a particular port +#define kIOUSBMessagePortHasBeenReset iokit_usb_msg(0x0a) // 0xe000400a Message sent to a device indicating that the port it is attached to has been reset +#define kIOUSBMessagePortHasBeenResumed iokit_usb_msg(0x0b) // 0xe000400b Message sent to a device indicating that the port it is attached to has been resumed +#define kIOUSBMessageHubPortClearTT iokit_usb_msg(0x0c) // 0xe000400c Message sent to a hub to clear the transaction translator +#define kIOUSBMessagePortHasBeenSuspended iokit_usb_msg(0x0d) // 0xe000400d Message sent to a device indicating that the port it is attached to has been suspended +#define kIOUSBMessageFromThirdParty iokit_usb_msg(0x0e) // 0xe000400e Message sent from a third party. Uses IOUSBThirdPartyParam to encode the sender's ID +#define kIOUSBMessagePortWasNotSuspended iokit_usb_msg(0x0f) // 0xe000400f Message indicating that the hub driver received a resume request for a port that was not suspended +#define kIOUSBMessageExpressCardCantWake iokit_usb_msg(0x10) // 0xe0004010 Message from a driver to a bus that an express card will disconnect on sleep and thus shouldn't wake +#define kIOUSBMessageCompositeDriverReconfigured iokit_usb_msg(0x11) // 0xe0004011 Message from the composite driver indicating that it has finished re-configuring the device after a reset +#define kIOUSBMessageHubSetPortRecoveryTime iokit_usb_msg(0x12) // 0xe0004012 Message sent to a hub to set the # of ms required when resuming a particular port +#define kIOUSBMessageOvercurrentCondition iokit_usb_msg(0x13) // 0xe0004013 Message sent to the clients of the device's hub parent, when a device causes an overcurrent condition. The message argument contains the locationID of the device +#define kIOUSBMessageNotEnoughPower iokit_usb_msg(0x14) // 0xe0004014 Message sent to the clients of the device's hub parent, when a device causes an low power notice to be displayed. The message argument contains the locationID of the device +#define kIOUSBMessageController iokit_usb_msg(0x15) // 0xe0004015 Generic message sent from controller user client to controllers +#define kIOUSBMessageRootHubWakeEvent iokit_usb_msg(0x16) // 0xe0004016 Message from the HC Wakeup code indicating that a Root Hub port has a wake event + +// Obsolete +// +struct IOUSBMouseData { + UInt16 buttons; + SInt16 XDelta; + SInt16 YDelta; +}; +typedef struct IOUSBMouseData IOUSBMouseData; +typedef IOUSBMouseData * IOUSBMouseDataPtr; + +// Obsolete +// +struct IOUSBKeyboardData { + UInt16 keycount; + UInt16 usbkeycode[32]; +}; +typedef struct IOUSBKeyboardData IOUSBKeyboardData; +typedef IOUSBKeyboardData * IOUSBKeyboardDataPtr; + +// Obsolete +// +union IOUSBHIDData { + IOUSBKeyboardData kbd; + IOUSBMouseData mouse; +}; +typedef union IOUSBHIDData IOUSBHIDData; +typedef IOUSBHIDData * IOUSBHIDDataPtr; + +/*! + @typedef IOUSBDeviceDescriptor + @discussion Descriptor for a USB Device. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBDeviceDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 bcdUSB; + UInt8 bDeviceClass; + UInt8 bDeviceSubClass; + UInt8 bDeviceProtocol; + UInt8 bMaxPacketSize0; + UInt16 idVendor; + UInt16 idProduct; + UInt16 bcdDevice; + UInt8 iManufacturer; + UInt8 iProduct; + UInt8 iSerialNumber; + UInt8 bNumConfigurations; +}; +typedef struct IOUSBDeviceDescriptor IOUSBDeviceDescriptor; +typedef IOUSBDeviceDescriptor * IOUSBDeviceDescriptorPtr; + +/*! + @typedef IOUSBDescriptorHeader + @discussion Standard header used for all USB descriptors. Used to read the length of a descriptor so that we can allocate storage for the whole descriptor later on. +*/ +struct IOUSBDescriptorHeader { + UInt8 bLength; + UInt8 bDescriptorType; +}; +typedef struct IOUSBDescriptorHeader IOUSBDescriptorHeader; +typedef IOUSBDescriptorHeader * IOUSBDescriptorHeaderPtr; + +/*! + @typedef IOUSBConfigurationDescriptor + @discussion Standard USB Configuration Descriptor. It is variable length, so this only specifies the known fields. We use the wTotalLength field to read the whole descriptor. + See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBConfigurationDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 wTotalLength; + UInt8 bNumInterfaces; + UInt8 bConfigurationValue; + UInt8 iConfiguration; + UInt8 bmAttributes; + UInt8 MaxPower; +}; +typedef struct IOUSBConfigurationDescriptor IOUSBConfigurationDescriptor; +typedef IOUSBConfigurationDescriptor * IOUSBConfigurationDescriptorPtr; + +/*! + @typedef IOUSBConfigurationDescHeader + @discussion Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor. +*/ +struct IOUSBConfigurationDescHeader { + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 wTotalLength; +}; +typedef struct IOUSBConfigurationDescHeader IOUSBConfigurationDescHeader; +typedef IOUSBConfigurationDescHeader * IOUSBConfigurationDescHeaderPtr; + +/*! + @typedef IOUSBInterfaceDescriptor + @discussion Descriptor for a USB Interface. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBInterfaceDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bInterfaceNumber; + UInt8 bAlternateSetting; + UInt8 bNumEndpoints; + UInt8 bInterfaceClass; + UInt8 bInterfaceSubClass; + UInt8 bInterfaceProtocol; + UInt8 iInterface; +}; +typedef struct IOUSBInterfaceDescriptor IOUSBInterfaceDescriptor; +typedef IOUSBInterfaceDescriptor * IOUSBInterfaceDescriptorPtr; + +/*! + @typedef IOUSBEndpointDescriptor + @discussion Descriptor for a USB Endpoint. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBEndpointDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bEndpointAddress; + UInt8 bmAttributes; + UInt16 wMaxPacketSize; + UInt8 bInterval; +}; +typedef struct IOUSBEndpointDescriptor IOUSBEndpointDescriptor; +typedef IOUSBEndpointDescriptor * IOUSBEndpointDescriptorPtr; + +enum{addPacketShift = 11}; // Bits for additional packets in maxPacketField. (Table 9-13) +#define mungeMaxPacketSize(w) ((w>1024)?(((w>>(addPacketShift))+1)*(w&((1<<addPacketShift)-1))):w) + +/*! + @typedef IOUSBHIDDescriptor + @discussion USB HID Descriptor. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. (This structure + should have used the #pragma pack(1) compiler directive to get byte alignment. +*/ +struct IOUSBHIDDescriptor { + UInt8 descLen; + UInt8 descType; + UInt16 descVersNum; + UInt8 hidCountryCode; + UInt8 hidNumDescriptors; + UInt8 hidDescriptorType; + UInt8 hidDescriptorLengthLo; + UInt8 hidDescriptorLengthHi; +}; +typedef struct IOUSBHIDDescriptor IOUSBHIDDescriptor; +typedef IOUSBHIDDescriptor *IOUSBHIDDescriptorPtr; + +/*! + @typedef IOUSBHIDReportDesc + @discussion USB HID Report Descriptor header. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. (This structure + should have used the #pragma pack(1) compiler directive to get byte alignment. +*/ +struct IOUSBHIDReportDesc { + UInt8 hidDescriptorType; + UInt8 hidDescriptorLengthLo; + UInt8 hidDescriptorLengthHi; +}; +typedef struct IOUSBHIDReportDesc IOUSBHIDReportDesc; +typedef IOUSBHIDReportDesc * IOUSBHIDReportDescPtr; + +/*! + @typedef IOUSBDeviceQualifierDescriptor + @discussion USB Device Qualifier Descriptor. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +#pragma pack(1) +struct IOUSBDeviceQualifierDescriptor +{ + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 bcdUSB; + UInt8 bDeviceClass; + UInt8 bDeviceSubClass; + UInt8 bDeviceProtocol; + UInt8 bMaxPacketSize0; + UInt8 bNumConfigurations; + UInt8 bReserved; +}; +typedef struct IOUSBDeviceQualifierDescriptor IOUSBDeviceQualifierDescriptor; +typedef IOUSBDeviceQualifierDescriptor * IOUSBDeviceQualifierDescriptorPtr; +#pragma options align=reset + +/*! + @typedef IOUSBDFUDescriptor + @discussion USB Device Firmware Update Descriptor. See the USB Device Firmware Update Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +#pragma pack(1) +struct IOUSBDFUDescriptor +{ + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bmAttributes; + UInt16 wDetachTimeout; + UInt16 wTransferSize; +}; +typedef struct IOUSBDFUDescriptor IOUSBDFUDescriptor; +typedef IOUSBDFUDescriptor * IOUSBDFUDescriptorPtr; + +#pragma options align=reset + +/*! +@typedef IOUSBInterfaceAssociationDescriptor + @discussion USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + */ +#pragma pack(1) +struct IOUSBInterfaceAssociationDescriptor +{ + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bFirstInterface; + UInt8 bInterfaceCount; + UInt8 bFunctionClass; + UInt8 bFunctionSubClass; + UInt8 bFunctionProtocol; + UInt8 iFunction; +}; +typedef struct IOUSBInterfaceAssociationDescriptor IOUSBInterfaceAssociationDescriptor; +typedef IOUSBInterfaceAssociationDescriptor * IOUSBInterfaceAssociationDescriptorPtr; +#pragma options align=reset + +/*! + @typedef USBStatus + @discussion Type used to get a DeviceStatus as a single quantity. +*/ +typedef UInt16 USBStatus; +typedef USBStatus * USBStatusPtr; + +// These constants are obsolete +// +enum { + kIOUSBAnyClass = 0xFFFF, + kIOUSBAnySubClass = 0xFFFF, + kIOUSBAnyProtocol = 0xFFFF, + kIOUSBAnyVendor = 0xFFFF, + kIOUSBAnyProduct = 0xFFFF +}; + +// This structure are obsolete +// +typedef struct IOUSBMatch { + UInt16 usbClass; + UInt16 usbSubClass; + UInt16 usbProtocol; + UInt16 usbVendor; + UInt16 usbProduct; +} IOUSBMatch; + +/*! + @typedef IOUSBFindEndpointRequest + @discussion Struct used to find endpoints of an interface + type and direction are used to match endpoints, + type, direction, maxPacketSize and interval are updated + with the properties of the found endpoint. + @field type Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt, kUSBAnyType. If kUSBAnyType is specified, this field is treated as a don't care. + @field direction Direction of endpoint: kUSBOut, kUSBIn, kUSBAnyDirn. If kUSBAnyDirn is specified, this field is treated as a don't care. + @field maxPacketSize maximum packet size of endpoint. + @field interval Polling interval in mSec for endpoint. +*/ +typedef struct { + UInt8 type; + UInt8 direction; + UInt16 maxPacketSize; + UInt8 interval; +} IOUSBFindEndpointRequest; + +/*! + @struct IOUSBDevRequest + @discussion Parameter block for control requests, using a simple pointer + for the data to be transferred. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred +*/ +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; + UInt32 wLenDone; +} IOUSBDevRequest; +typedef IOUSBDevRequest * IOUSBDeviceRequestPtr; + +/*! + @struct IOUSBDevRequestTO + @discussion Parameter block for control requests with timeouts, using a simple pointer + for the data to be transferred. Same as a IOUSBDevRequest except for the two extra timeout fields. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred + @field noDataTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if no data is transferred in this amount of time, the request will be aborted and returned. + @field completionTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if the entire request is not completed in this amount of time, the request will be aborted and returned +*/ +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; + UInt32 wLenDone; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBDevRequestTO; + +/*! + @enum Default timeout values + @discussion default values used for data and completion timeouts. +*/ +enum +{ + kUSBDefaultControlNoDataTimeoutMS = 5000, + kUSBDefaultControlCompletionTimeoutMS = 0 +}; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +typedef struct +{ + UInt32 pipeRef; + void * buf; + UInt32 size; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBBulkPipeReq; + + +#if KERNEL +/*! + @struct IOUSBDevRequestDesc + @discussion Parameter block for control requests, using a memory descriptor + for the data to be transferred. Only available in the kernel. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to memory descriptor for data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred +*/ +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + IOMemoryDescriptor * pData; + UInt32 wLenDone; +} IOUSBDevRequestDesc; + + +/*! + @enum IOOptionBits + @discussion Parameter passed to an IOService::open() call. + @constant kIOUSBInterfaceOpenAlt Open the alternate interface specified when creating the interface. +*/ +enum { + kIOUSBInterfaceOpenAlt = 0x00010000 +}; + +#endif + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// use a structure because there's a limit of 6 total arguments +// to a user client method. +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; // data pointer + UInt32 wLenDone; // # bytes transferred + UInt8 pipeRef; +} IOUSBDevReqOOL; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; // data pointer + UInt32 wLenDone; // # bytes transferred + UInt8 pipeRef; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBDevReqOOLTO; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// Structure to request isochronous transfer +// +typedef struct { + UInt32 fPipe; + void *fBuffer; + UInt32 fBufSize; + UInt64 fStartFrame; + UInt32 fNumFrames; + IOUSBIsocFrame *fFrameCounts; +} IOUSBIsocStruct; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// Structure to request low latency isochronous transfer +// +struct IOUSBLowLatencyIsocStruct { + UInt32 fPipe; + UInt32 fBufSize; + UInt64 fStartFrame; + UInt32 fNumFrames; + UInt32 fUpdateFrequency; + UInt32 fDataBufferCookie; + UInt32 fDataBufferOffset; + UInt32 fFrameListBufferCookie; + UInt32 fFrameListBufferOffset; +}; + +typedef struct IOUSBLowLatencyIsocStruct IOUSBLowLatencyIsocStruct; + + +/*! + @struct IOUSBGetFrameStruct + @discussion Structure used from user space to return the frame number and a timestamp on when the frame register was read. + @field frame frame number + @field timeStamp AbsoluteTime when the frame was updated +*/ +typedef struct { + UInt64 frame; + AbsoluteTime timeStamp; +} IOUSBGetFrameStruct; + + +/*! + @struct IOUSBFindInterfaceRequest + @discussion Structure used with FindNextInterface. +*/ +typedef struct { + UInt16 bInterfaceClass; // requested class + UInt16 bInterfaceSubClass; // requested subclass + UInt16 bInterfaceProtocol; // requested protocol + UInt16 bAlternateSetting; // requested alt setting +} IOUSBFindInterfaceRequest; + +/*! + @enum kIOUSBFindInterfaceDontCare + @discussion Constant that can be used for the fields of IOUSBFindInterfaceRequest to specify that they should not be matched. +*/ +enum { + kIOUSBFindInterfaceDontCare = 0xFFFF + }; + +/*! + @enum kIOUSBVendorIDAppleComputer + @discussion USB Vendor ID for Apple Computer, Inc. +*/ +enum { + kIOUSBVendorIDAppleComputer = 0x05AC + }; + +/*! + @enum USBDeviceSpeed + @discussion Returns the speed of a particular USB device. + @constant kUSBDeviceSpeedLow The device a low speed device. + @constant kUSBDeviceSpeedFull The device a full speed device. + @constant kUSBDeviceSpeedHigh The device a high speed device. +*/ +enum { + kUSBDeviceSpeedLow = 0, + kUSBDeviceSpeedFull = 1, + kUSBDeviceSpeedHigh = 2 + }; + +/*! + @enum MicrosecondsInFrame + @discussion Returns the number of microseconds in a USB frame. + @constant kUSBFullSpeedMicrosecondsInFrame The device is attached to a bus running at full speed (1 ms / frame). + @constant kUSBHighSpeedMicrosecondsInFrame The device is attached to a bus running at high speed (125 microseconds / frame). +*/ +enum { + kUSBFullSpeedMicrosecondsInFrame = 1000, + kUSBHighSpeedMicrosecondsInFrame = 125 +}; + +// During low latency transfers, the stack will set the frStatus for each frame to this value. A client can check that to see if the transfer has completed. We set the frStatus to a +// valid return code when the transfer completes. +// +enum { + kUSBLowLatencyIsochTransferKey = 'llit' // Set frStatus field of first frame in isoch transfer to designate as low latency + }; + +// This structure is DEPRECATED. See the LowLatencyUserBufferInfoV2 +// +typedef struct LowLatencyUserBufferInfo LowLatencyUserBufferInfo; + +struct LowLatencyUserBufferInfo { + UInt32 cookie; + void * bufferAddress; + IOByteCount bufferSize; + UInt32 bufferType; + Boolean isPrepared; + LowLatencyUserBufferInfo * nextBuffer; +}; + +// This structure is DEPRECATED. See the LowLatencyUserBufferInfoV3 + +typedef struct LowLatencyUserBufferInfoV2 LowLatencyUserBufferInfoV2; + +struct LowLatencyUserBufferInfoV2 +{ + UInt32 cookie; + void * bufferAddress; + IOByteCount bufferSize; + UInt32 bufferType; + Boolean isPrepared; + void * mappedUHCIAddress; + LowLatencyUserBufferInfoV2 * nextBuffer; +}; + + +// This structure is used to pass information for the low latency calls between user space and the kernel. +// +typedef struct LowLatencyUserBufferInfoV3 LowLatencyUserBufferInfoV3; + +struct LowLatencyUserBufferInfoV3 +{ + uint64_t cookie; + mach_vm_address_t bufferAddress; + mach_vm_size_t bufferSize; + uint64_t bufferType; + uint64_t isPrepared; + mach_vm_address_t mappedUHCIAddress; + LowLatencyUserBufferInfoV3 * nextBuffer; +}; + + + /*! + @enum USBLowLatencyBufferType + @discussion Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer(). + @constant kUSBLowLatencyWriteBuffer The buffer will be used to write data out to a device. + @constant kUSBLowLatencyReadBuffer The buffer will be used to read data from a device. + @constant kUSBLowLatencyFrameListBuffer The buffer will be used for a low latency isoch frame list. +*/ +typedef enum { + kUSBLowLatencyWriteBuffer = 0, + kUSBLowLatencyReadBuffer = 1, + kUSBLowLatencyFrameListBuffer = 2 +} USBLowLatencyBufferType; + +// USB User Notification Types +// +enum { + kUSBNoUserNotificationType = 0, + kUSBNotEnoughPowerNotificationType = 1, + kUSBIndividualOverCurrentNotificationType = 2, + kUSBGangOverCurrentNotificationType = 3 +}; + +/*! + @defined Property Definitions + @discussion Useful property names in USB land. +*/ +#define kUSBDevicePropertySpeed "Device Speed" +#define kUSBDevicePropertyBusPowerAvailable "Bus Power Available" +#define kUSBDevicePropertyAddress "USB Address" +#define kUSBDevicePropertyLocationID "locationID" +#define kUSBProductIDMask "idProductMask" +#define kUSBPreferredConfiguration "Preferred Configuration" +#define kUSBSuspendPort "kSuspendPort" +#define kUSBExpressCardCantWake "ExpressCardCantWake" +#define kUSBControllerNeedsContiguousMemoryForIsoch "Need contiguous memory for isoch" +#define kUSBHubDontAllowLowPower "kUSBHubDontAllowLowPower" +#define kUSBDeviceResumeRecoveryTime "kUSBDeviceResumeRecoveryTime" +#define kUSBOutOfSpecMPSOK "Out of spec MPS OK" +#define kConfigurationDescriptorOverride "ConfigurationDescriptorOverride" +#define kOverrideIfAtLocationID "OverrideIfAtLocationID" + +/*! +@enum USBReEnumerateOptions + @discussion Options used when calling ReEnumerateDevice. + @constant kUSBAddExtraResetTimeBit Setting this bit will cause the Hub driver to wait 100ms before addressing the device after the reset following the re-enumeration. + */ +typedef enum { + kUSBAddExtraResetTimeBit = 31, + kUSBAddExtraResetTimeMask = ( 1 << kUSBAddExtraResetTimeBit) +} USBReEnumerateOptions; + +/*! + @enum USBDeviceInformationBits + @discussion GetUSBDeviceInformation will return a unit32_t value with bits set indicating that a particular state is present in the USB device. These bits are described here + + @constant kUSBInformationDeviceIsCaptiveBit The USB device is directly attached to its hub and cannot be removed. + @constant kUSBInformationDeviceIsAttachedToRootHubBit The USB device is directly attached to the root hub + @constant kUSBInformationDeviceIsInternalBit The USB device is internal to the computer (all the hubs it attaches to are captive) + @constant kUSBInformationDeviceIsConnectedBit The USB device is connected to its hub + @constant kUSBInformationDeviceIsEnabledBit The hub port to which the USB device is attached is enabled + @constant kUSBInformationDeviceIsSuspendedBit The hub port to which the USB device is attached is suspended + @constant kUSBInformationDeviceIsInResetBit The hub port to which the USB device is attached is being reset + @constant kUSBInformationDeviceOvercurrentBit The USB device generated an overcurrent + @constant kUSBInformationDevicePortIsInTestModeBit The hub port to which the USB device is attached is in test mode + @constant kUSBInformationDeviceIsRootHub The device is actually the root hub simulation + @constant kUSBInformationRootHubisBuiltIn If this is a root hub simulation and it's built into the machine, this bit is set. If it's on an expansion card, it will be cleared + + */ + typedef enum { + kUSBInformationDeviceIsCaptiveBit = 0, + kUSBInformationDeviceIsAttachedToRootHubBit = 1, + kUSBInformationDeviceIsInternalBit = 2, + kUSBInformationDeviceIsConnectedBit = 3, + kUSBInformationDeviceIsEnabledBit = 4, + kUSBInformationDeviceIsSuspendedBit = 5, + kUSBInformationDeviceIsInResetBit = 6, + kUSBInformationDeviceOvercurrentBit = 7, + kUSBInformationDevicePortIsInTestModeBit = 8, + kUSBInformationDeviceIsRootHub = 9, + kUSBInformationRootHubisBuiltIn = 10, + kUSBInformationDeviceIsRemote = 11, + kUSBInformationDeviceIsCaptiveMask = (1 << kUSBInformationDeviceIsCaptiveBit), + kUSBInformationDeviceIsAttachedToRootHubMask = (1 << kUSBInformationDeviceIsAttachedToRootHubBit), + kUSBInformationDeviceIsInternalMask = (1 << kUSBInformationDeviceIsInternalBit), + kUSBInformationDeviceIsConnectedMask = (1 << kUSBInformationDeviceIsConnectedBit), + kUSBInformationDeviceIsEnabledMask = (1 << kUSBInformationDeviceIsEnabledBit), + kUSBInformationDeviceIsSuspendedMask = (1 << kUSBInformationDeviceIsSuspendedBit), + kUSBInformationDeviceIsInResetMask = (1 << kUSBInformationDeviceIsInResetBit), + kUSBInformationDeviceOvercurrentMask = (1 << kUSBInformationDeviceOvercurrentBit), + kUSBInformationDevicePortIsInTestModeMask = (1 << kUSBInformationDevicePortIsInTestModeBit), + kUSBInformationDeviceIsRootHubMask = (1 << kUSBInformationDeviceIsRootHub), + kUSBInformationRootHubisBuiltInMask = (1 << kUSBInformationRootHubisBuiltIn), + kUSBInformationDeviceIsRemoteMask = (1 << kUSBInformationDeviceIsRemote) + } USBDeviceInformationBits; + + /*! + @enum USBPowerRequestTypes + @discussion Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs. + @constant kUSBPowerDuringSleep The power is to be used during sleep. + @constant kUSBPowerDuringWake The power is to be used while the system is awake (i.e not sleeping) + */ + typedef enum { + kUSBPowerDuringSleep = 0, + kUSBPowerDuringWake = 1 + } USBPowerRequestTypes; + + // Apple specific properties +#define kAppleCurrentAvailable "AAPL,current-available" +#define kAppleCurrentInSleep "AAPL,current-in-sleep" +#define kAppleCurrentExtra "AAPL,current-extra" +#define kAppleInternalUSBDevice "AAPL,device-internal" +#define kUSBBusID "AAPL,bus-id" + + +#ifdef __cplusplus +} +#endif + +#endif /* _USB_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/USBHub.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/USBHub.h.svn-base new file mode 100644 index 0000000..4bbda15 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/USBHub.h.svn-base @@ -0,0 +1,240 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _USBHUB_H +#define _USBHUB_H + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/USBSpec.h> + + /*! + @header USBHub.h + @abstract Constants and definitions used with Hub devices. + @discussion + */ + + /*! + @enum Hub Descriptor Type + @discussion + */ +enum { + kUSBHubDescriptorType = 0x29 +}; + + /*! + @enum HubFeatures + @discussion Used with SET_FEATURE to set hub and port features + */ +enum { + + kUSBHubLocalPowerChangeFeature = 0, /* Hub features */ + kUSBHubOverCurrentChangeFeature = 1, + + kUSBHubPortConnectionFeature = 0, /* port features */ + kUSBHubPortEnableFeature = 1, + kUSBHubPortSuspendFeature = 2, + kUSBHubPortOverCurrentFeature = 3, + kUSBHubPortResetFeature = 4, + kUSBHubPortPowerFeature = 8, + kUSBHubPortLowSpeedFeature = 9, + kUSBHubPortConnectionChangeFeature = 16, + kUSBHubPortEnableChangeFeature = 17, + kUSBHubPortSuspendChangeFeature = 18, + kUSBHubPortOverCurrentChangeFeature = 19, + kUSBHubPortResetChangeFeature = 20, + kUSBHubPortTestFeature = 21, + kUSBHubPortIndicatorFeature = 22 +}; + + /*! + @enum HubPortStatus + @discussion Used to decode the Port Status and Change + */ +enum { + kHubPortConnection = 0x0001, + kHubPortEnabled = 0x0002, + kHubPortSuspend = 0x0004, + kHubPortOverCurrent = 0x0008, + kHubPortBeingReset = 0x0010, + kHubPortPower = 0x0100, + kHubPortLowSpeed = 0x0200, + kHubPortHighSpeed = 0x0400, + kHubPortTestMode = 0x0800, + kHubPortIndicator = 0x1000, + + // these are the bits which cause the hub port state machine to keep moving + kHubPortStateChangeMask = kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset +}; + + + /*! + @enum HubStatus + @discussion Used to decode the Hub Status and Change + */ +enum { + kHubLocalPowerStatus = 1, + kHubOverCurrentIndicator = 2, + kHubLocalPowerStatusChange = 1, + kHubOverCurrentIndicatorChange = 2 +}; + + /*! + @enum HubCharacteristics + @discussion + */ +enum { + kPerPortSwitchingBit = (1 << 0), + kNoPowerSwitchingBit = (1 << 1), + kCompoundDeviceBit = (1 << 2), + kPerPortOverCurrentBit = (1 << 3), + kNoOverCurrentBit = (1 << 4), + + kHubPortIndicatorBit = 7, + kHubPortIndicatorMask = 0x0080 +}; + +/*! +@enum PowerSwitching + @discussion + */ +enum { + kHubSupportsGangPower = 0, + kHubSupportsIndividualPortPower = 1, + kHubPortSetPowerOff = 0, + kHubPortSetPowerOn = 1 +}; + +/*! +@enum PortIndicatorSelectors + @discussion + */ +enum { + kHubPortIndicatorAutomatic = 0, + kHubPortIndicatorAmber, + kHubPortIndicatorGreen, + kHubPortIndicatorOff +}; + +/*! + @enum Root Hub specific + @discussion + */ +enum { + kPrdRootHubApple = 0x8005, // ProductID for classic speed root hubs + kPrdRootHubAppleE = 0x8006, // ProductID for high speed root hubs + kUSBRootHubPollingRate = 32 // Enpoint polling rate interval for root hubs +}; + +/*! +@enum Hub Device Requests +@discussion Encoding of the hub specific standard requests +<tt> +<pre><b> +Request bmRequestType bRequest wValue wIndex wLength Data</b> +ClearHubFeature 0010 0000B CLEAR_FEATURE Feature Zero Zero None +ClearPortFeature 0010 0011B Feature Port Zero None + +GetBusState 1010 0011B GET_STATE Zero Port One Port Bus State + +GetHubDescriptor 1010 0000B GET_DESCRIPTOR Type Zero Length Descriptor + +GetHubStatus 1010 0000B GET_STATUS Zero Zero Four Hub Status +GetPortStatus 1010 0011B Zero Port Four Port Status + +SetHubDescriptor 0010 0000B SET_DESCRIPTOR Type Zero Length Descriptor + +SetHubFeature 0010 0000B SET_FEATURE Feature Zero Zero None +SetPortFeature 0010 0011B Feature Port Zero None +</pre> +</tt> + */ +enum { + kClearHubFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBClass, kUSBDevice), + kClearPortFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBClass, kUSBOther), + kGetPortState = EncodeRequest(kUSBRqGetState, kUSBIn, kUSBClass, kUSBOther), + kGetHubDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBClass, kUSBDevice), + kGetHubStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBClass, kUSBDevice), + kGetPortStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBClass, kUSBOther), + kSetHubDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBOut, kUSBClass, kUSBDevice), + kSetHubFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBClass, kUSBDevice), + kSetPortFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBClass, kUSBOther) +}; + + +/*! + @typedef IOUSBHubDescriptor + @discussion USB Hub Descriptor. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBHubDescriptor { + UInt8 length; + UInt8 hubType; + UInt8 numPorts; + UInt16 characteristics __attribute__((packed)); + UInt8 powerOnToGood; /* Port settling time, in 2ms */ + UInt8 hubCurrent; + /* These are received packed, will have to be unpacked */ + UInt8 removablePortFlags[8]; + UInt8 pwrCtlPortFlags[8]; +}; + +typedef struct IOUSBHubDescriptor IOUSBHubDescriptor; + +/*! + @typedef IOUSBHubStatus + @discussion Used to get the port status and change flags using GetPortStatus() +*/ +struct IOUSBHubStatus { + UInt16 statusFlags; + UInt16 changeFlags; +}; +typedef struct IOUSBHubStatus IOUSBHubStatus; +typedef IOUSBHubStatus * IOUSBHubStatusPtr; + +typedef struct IOUSBHubStatus IOUSBHubPortStatus; + + +/*! + @typedef IOUSBHubPortReEnumerateParam + @discussion Used to specify the port that needs to be reenumerated +*/ +typedef struct IOUSBHubPortReEnumerateParam IOUSBHubPortReEnumerateParam; + +struct IOUSBHubPortReEnumerateParam { + UInt32 portNumber; + UInt32 options; +}; + +typedef struct IOUSBHubPortClearTTParam IOUSBHubPortClearTTParam; + +struct IOUSBHubPortClearTTParam { + UInt32 portNumber; + UInt32 options; +#if 0 + UInt8 deviceAddress; <<0 + UInt8 endpointNum; <<8 + UInt8 endpointType; <<16 // As split transaction. 00 Control, 10 Bulk + UInt8 IN; <<24 // Direction, 1 = IN, 0 = OUT +#endif +}; + +#endif /* _USBHUB_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/USBSpec.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/USBSpec.h.svn-base new file mode 100644 index 0000000..0665819 --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/USBSpec.h.svn-base @@ -0,0 +1,470 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Constants that both OS9 and OSX want to define, and whose values are + * specified by the USB Standard. + * Put in a seperate file so they can be included if the OS9 include file isn't already + * included. + */ +#ifndef _USBSPEC_H +#define _USBSPEC_H + +#ifdef __cplusplus +extern "C" { +#endif + + /*! + @header USBSpec.h + @abstract Constants and definitions of parameters that are used in communcating with USB devices and interfaces. + @discussion + */ + + /*! + @enum Endpoint type + @discussion Used in IOUSBFindEndpointRequest's type field + */ +enum { + kUSBControl = 0, + kUSBIsoc = 1, + kUSBBulk = 2, + kUSBInterrupt = 3, + kUSBAnyType = 0xFF +}; + + /*! + @enum Endpoint direction + @discussion Used in IOUSBFindEndpointRequest's direction field + */ +enum { + kUSBOut = 0, + kUSBIn = 1, + kUSBNone = 2, + kUSBAnyDirn = 3 +}; + + /*! + @enum Device Request Type + @discussion This type is encoded in the bmRequestType field of a Device Request. It specifies the type of request: standard, class or vendor specific. + */ +enum { + kUSBStandard = 0, + kUSBClass = 1, + kUSBVendor = 2 +}; + + /*! + @enum Device Request Recipient + @discussion This recipient is encoded in the bmRequestType field of a Device Request. It specifies the type of recipient for a request: the device, the interface, or an endpoint. + */ +enum { + kUSBDevice = 0, + kUSBInterface = 1, + kUSBEndpoint = 2, + kUSBOther = 3 +}; + + /*! + @enum Device Request + @discussion Specifies values for the bRequest field of a Device Request. + */ +enum { + kUSBRqGetStatus = 0, + kUSBRqClearFeature = 1, + kUSBRqGetState = 2, + kUSBRqSetFeature = 3, + kUSBRqReserved2 = 4, + kUSBRqSetAddress = 5, + kUSBRqGetDescriptor = 6, + kUSBRqSetDescriptor = 7, + kUSBRqGetConfig = 8, + kUSBRqSetConfig = 9, + kUSBRqGetInterface = 10, + kUSBRqSetInterface = 11, + kUSBRqSyncFrame = 12 +}; + + /*! + @enum USB Descriptors + @discussion Specifies values for diffent descriptor types. + */ +enum { + kUSBAnyDesc = 0, // Wildcard for searches + kUSBDeviceDesc = 1, + kUSBConfDesc = 2, + kUSBStringDesc = 3, + kUSBInterfaceDesc = 4, + kUSBEndpointDesc = 5, + kUSBDeviceQualifierDesc = 6, + kUSBOtherSpeedConfDesc = 7, + kUSBInterfacePowerDesc = 8, + kUSBOnTheGoDesc = 9, + kUSDebugDesc = 10, + kUSBInterfaceAssociationDesc = 11, + kUSBHIDDesc = 0x21, + kUSBReportDesc = 0x22, + kUSBPhysicalDesc = 0x23, + kUSBHUBDesc = 0x29 +}; + + /*! + @enum Feature Selectors + @discussion Used with SET/CLEAR_FEATURE requests. + */ +enum { + kUSBFeatureEndpointStall = 0, + kUSBFeatureDeviceRemoteWakeup = 1 +}; + + /*! + @enum USB Power constants + @discussion Constants relating to USB Power. + */ +enum { + kUSB100mAAvailable = 50, + kUSB500mAAvailable = 250, + kUSB100mA = 50, + kUSBAtrBusPowered = 0x80, + kUSBAtrSelfPowered = 0x40, + kUSBAtrRemoteWakeup = 0x20 +}; + + /*! + @enum USB Release constants + @discussion Constants relating to USB releases as found in the bcdUSB field of the Device Descriptor. + */ +enum { + kUSBRel10 = 0x0100, + kUSBRel11 = 0x0110, + kUSBRel20 = 0x0200 +}; + + + /*! + @enum HID requests + @discussion Constants for HID requests. + */ +enum { + kHIDRqGetReport = 1, + kHIDRqGetIdle = 2, + kHIDRqGetProtocol = 3, + kHIDRqSetReport = 9, + kHIDRqSetIdle = 10, + kHIDRqSetProtocol = 11 +}; + + /*! + @enum HID report types + @discussion Constants for the three kinds of HID reports. + */ +enum { + kHIDRtInputReport = 1, + kHIDRtOutputReport = 2, + kHIDRtFeatureReport = 3 +}; + + + /*! + @enum HID Protocol + @discussion Used in the SET_PROTOCOL device request + */ +enum { + kHIDBootProtocolValue = 0, + kHIDReportProtocolValue = 1 +}; + + + +enum { + kUSBCapsLockKey = 0x39, + kUSBNumLockKey = 0x53, + kUSBScrollLockKey = 0x47 +}; + +/*! +@enum Device Class Codes + @discussion Constants for USB Device classes (bDeviceClass). + */ +enum { + kUSBCompositeClass = 0, + kUSBCommClass = 2, // Deprecated + kUSBCommunicationClass = 2, + kUSBHubClass = 9, + kUSBDataClass = 10, + kUSBPersonalHealthcareClass = 15, + kUSBDiagnosticClass = 220, + kUSBWirelessControllerClass = 224, + kUSBMiscellaneousClass = 239, + kUSBApplicationSpecificClass = 254, + kUSBVendorSpecificClass = 255 +}; + +/*! +@enum Interface Class + @discussion Constants for Interface classes (bInterfaceClass). + */ +enum { + kUSBAudioClass = 1, // Deprecated + kUSBAudioInterfaceClass = 1, + + kUSBCommunicationControlInterfaceClass = 2, + kUSBCommunicationDataInterfaceClass = 10, + + kUSBHIDClass = 3, + kUSBHIDInterfaceClass = 3, + + kUSBPhysicalInterfaceClass = 5, + + kUSBImageInterfaceClass = 6, + + kUSBPrintingClass = 7, // Deprecated + kUSBPrintingInterfaceClass = 7, + + kUSBMassStorageClass = 8, // Deprecated + kUSBMassStorageInterfaceClass = 8, + + kUSBChipSmartCardInterfaceClass = 11, + + kUSBContentSecurityInterfaceClass = 13, + + kUSBVideoInterfaceClass = 14, + + kUSBPersonalHealthcareInterfaceClass = 15, + + kUSBDiagnosticDeviceInterfaceClass = 220, + + kUSBWirelessControllerInterfaceClass = 224, + + kUSBApplicationSpecificInterfaceClass = 254, + + kUSBVendorSpecificInterfaceClass = 255 +}; + +// Obsolete +enum { + + kUSBDisplayClass = 4, // Obsolete +}; + +/*! + @enum Interface SubClass + @discussion Constants for USB Interface SubClasses (bInterfaceSubClass). +*/ +enum { + kUSBCompositeSubClass = 0, + + kUSBHubSubClass = 0, + + // For the kUSBAudioInterfaceClass + // + kUSBAudioControlSubClass = 0x01, + kUSBAudioStreamingSubClass = 0x02, + kUSBMIDIStreamingSubClass = 0x03, + + // For the kUSBApplicationSpecificInterfaceClass + // + kUSBDFUSubClass = 0x01, + kUSBIrDABridgeSubClass = 0x02, + kUSBTestMeasurementSubClass = 0x03, + + // For the kUSBMassStorageInterfaceClass + // + kUSBMassStorageRBCSubClass = 0x01, + kUSBMassStorageATAPISubClass = 0x02, + kUSBMassStorageQIC157SubClass = 0x03, + kUSBMassStorageUFISubClass = 0x04, + kUSBMassStorageSFF8070iSubClass = 0x05, + kUSBMassStorageSCSISubClass = 0x06, + + // For the kUSBHIDInterfaceClass + // + kUSBHIDBootInterfaceSubClass = 0x01, + + // For the kUSBCommunicationDataInterfaceClass + // + kUSBCommDirectLineSubClass = 0x01, + kUSBCommAbstractSubClass = 0x02, + kUSBCommTelephoneSubClass = 0x03, + kUSBCommMultiChannelSubClass = 0x04, + kUSBCommCAPISubClass = 0x05, + kUSBCommEthernetNetworkingSubClass = 0x06, + kUSBATMNetworkingSubClass = 0x07, + + // For the kUSBDiagnosticDeviceInterfaceClass + // + kUSBReprogrammableDiagnosticSubClass = 0x01, + + // For the kUSBWirelessControllerInterfaceClass + // + kUSBRFControllerSubClass = 0x01, + + // For the kUSBMiscellaneousClass + // + kUSBCommonClassSubClass = 0x02, + + // For the kUSBVideoInterfaceClass + // + kUSBVideoControlSubClass = 0x01, + kUSBVideoStreamingSubClass = 0x02, + kUSBVideoInterfaceCollectionSubClass = 0x03 + +}; + +/*! +@enum Interface Protocol + @discussion Reported in the bInterfaceProtocol field of the Interface Descriptor. + */ +enum { + + // For kUSBHIDInterfaceClass + // + kHIDNoInterfaceProtocol = 0, + kHIDKeyboardInterfaceProtocol = 1, + kHIDMouseInterfaceProtocol = 2, + kUSBVendorSpecificProtocol = 0xff, + + // For kUSBDiagnosticDeviceInterfaceClass + // + kUSB2ComplianceDeviceProtocol = 0x01, + + // For kUSBWirelessControllerInterfaceClass + // + kUSBBluetoothProgrammingInterfaceProtocol = 0x01, + + // For kUSBMiscellaneousClass + // + KUSBInterfaceAssociationDescriptorProtocol = 0x01 + +}; + + +/*! + @enum DFU Class Attributes + @discussion +*/ +enum { + kUSBDFUAttributesMask = 0x07, + kUSBDFUCanDownloadBit = 0, + kUSBDFUCanUploadBit = 1, + kUSBDFUManifestationTolerantBit = 2 +}; + +/*! + @enum Printer Class Requests + @discussion The bRequest parameter for Printing Class Sepcific Requests + */ +enum { + kUSPrintingClassGetDeviceID = 0, + kUSPrintingClassGePortStatus = 1, + kUSPrintingClassSoftReset = 2 +}; + + /*! +@enum Endpoint Descriptor bits + @discussion Bit definitions for endpoint descriptor fields + */ +enum { + kUSBbEndpointAddressMask = 0x0f, + kUSBbEndpointDirectionBit = 7, + kUSBbEndpointDirectionMask = ( 1 << kUSBbEndpointDirectionBit ), + kUSBEndpointDirectionOut = 0x00, + kUSBEndpointDirectionIn = 0x80, + kUSBEndpointbmAttributesTransferTypeMask = 0x03, + kUSBEndpointbmAttributesSynchronizationTypeMask = 0x0c, + kUSBEndpointbmAttributesSynchronizationTypeShift = 2, + kUSBEndpointbmAttributesUsageTypeMask = 0x30, + kUSBEndpointbmAttributesUsageTypeShift = 4 +}; + + /*! + @defineblock USB Descriptor and IORegistry constants + @discussion Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields + + @define kUSBDeviceClass The field in the USB Device Descriptor corresponding to the device class + @define kUSBDeviceSubClass The field in the USB Device Descriptor corresponding to the device sub class + @define kUSBDeviceProtocol The field in the USB Device Descriptor corresponding to the device protocol + @define kUSBDeviceMaxPacketSize The field in the USB Device Descriptor corresponding to the maximum packet size for endpoint 0 + @define kUSBVendorID The field in the USB Device Descriptor corresponding to the device USB Vendor ID + @define kUSBVendorName Deprecated. Use kUSBVendorID + @define kUSBProductID The field in the USB Device Descriptor corresponding to the device USB Product ID + @define kUSBProductName Deprecated. Use kUSBProductID + @define kUSBDeviceReleaseNumber The field in the USB Device Descriptor corresponding to the device release version + @define kUSBManufacturerStringIndex The field in the USB Device Descriptor corresponding to the index for the manufacturer's string + @define kUSBProductStringIndex The field in the USB Device Descriptor corresponding to the index for the product name's string + @define kUSBSerialNumberStringIndex The field in the USB Device Descriptor corresponding to the index for the serial number's string + @define kUSBDeviceNumConfigs The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBInterfaceNumber The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBAlternateSetting The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBNumEndpoints The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBInterfaceClass The field in the USB Interface Descriptor corresponding to the interface class + @define kUSBInterfaceSubClass The field in the USB Interface Descriptor corresponding to the interface sub class + @define kUSBInterfaceProtocol The field in the USB Interface Descriptor corresponding to the interface protocol + @define kUSBInterfaceStringIndex The field in the USB Interface Descriptor corresponding to the index for the interface name's string + @define kUSBConfigurationValue The field in the USB Interface Descriptor corresponding to the configuration + @define kUSBProductString IORegistry key for the device's USB Product string + @define kUSBVendorString IORegistry key for the device's USB manufacturer string + @define kUSBSerialNumberString IORegistry key for the device's USB serial number string + @define kUSB1284DeviceID IORegistry key for the 1284 Device ID of a printer + + */ +#define kUSBDeviceClass "bDeviceClass" +#define kUSBDeviceSubClass "bDeviceSubClass" +#define kUSBDeviceProtocol "bDeviceProtocol" +#define kUSBDeviceMaxPacketSize "bMaxPacketSize0" +#define kUSBVendorID "idVendor" // good name +#define kUSBVendorName kUSBVendorID // bad name - keep for backward compatibility +#define kUSBProductID "idProduct" // good name +#define kUSBProductName kUSBProductID // bad name - keep for backward compatibility +#define kUSBDeviceReleaseNumber "bcdDevice" +#define kUSBManufacturerStringIndex "iManufacturer" +#define kUSBProductStringIndex "iProduct" +#define kUSBSerialNumberStringIndex "iSerialNumber" +#define kUSBDeviceNumConfigs "bNumConfigurations" +#define kUSBInterfaceNumber "bInterfaceNumber" +#define kUSBAlternateSetting "bAlternateSetting" +#define kUSBNumEndpoints "bNumEndpoints" +#define kUSBInterfaceClass "bInterfaceClass" +#define kUSBInterfaceSubClass "bInterfaceSubClass" +#define kUSBInterfaceProtocol "bInterfaceProtocol" +#define kUSBInterfaceStringIndex "iInterface" +#define kUSBConfigurationValue "bConfigurationValue" +#define kUSBProductString "USB Product Name" +#define kUSBVendorString "USB Vendor Name" +#define kUSBSerialNumberString "USB Serial Number" +#define kUSB1284DeviceID "1284 Device ID" + /*! @/defineblock */ + + /*! + @enum Apple USB Vendor ID + @discussion Apple's vendor ID, assigned by the USB-IF +*/ +enum { + kAppleVendorID = 0x05AC +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _USBSPEC_H */ diff --git a/i386/include/IOKit/usb/.svn/text-base/USBTracepoints.h.svn-base b/i386/include/IOKit/usb/.svn/text-base/USBTracepoints.h.svn-base new file mode 100644 index 0000000..f2fe81e --- /dev/null +++ b/i386/include/IOKit/usb/.svn/text-base/USBTracepoints.h.svn-base @@ -0,0 +1,662 @@ +/* + * Copyright � 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IO_USB_FAMILY_TRACEPOINTS__ +#define __IOKIT_IO_USB_FAMILY_TRACEPOINTS__ + +#include <IOKit/IOTypes.h> + +#include <sys/kdebug.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define USB_SYSCTL "debug.USB" +#define kUSBTypeDebug 'USBD' +#define DEBUG_UNUSED( X ) ( void )( X ) + + extern UInt32 gUSBStackDebugFlags; + + typedef struct USBSysctlArgs + { + uint32_t type; + uint32_t operation; + uint32_t debugFlags; + } USBSysctlArgs; + + enum + { + kUSBOperationGetFlags = 0, + kUSBOperationSetFlags = 1 + }; + + // the following bits/masks are for use in the usb boot args + // e.g. boot-args="usb=0x102" will turn on Trace Points and set the EHCI retry count to 1 + // the bits can also be set with a sysctl call + enum + { + kUSBEnableDebugLoggingBit = 0, // bit 0 currently not used + kUSBEnableTracePointsBit = 1, // bit 1 used to turn on Trace Points when a USB controller first loads + kUSBEnableErrorLogBit = 2, // bit 2 (4) turns level 1 log for errors + kUSBDebugRetryCountShift = 8, // bits 8 and 9 will set the retry count for low level bus transactions + kUSBDebugRetryCountReserved = 9, // must be 1, 2, or 3 (0 is invalid, 3 is the default) + + kUSBEnableDebugLoggingMask = (1 << kUSBEnableDebugLoggingBit), + kUSBEnableTracePointsMask = (1 << kUSBEnableTracePointsBit), + kUSBDebugRetryCountMask = (3 << kUSBDebugRetryCountShift), + kUSBEnableErrorLogMask = (1 << kUSBEnableErrorLogBit) + }; + + + /* Kernel Tracepoints + * + * Kernel tracepoints are a logging mechanism reduces the size of a log-laden binary. + * Codes are placed into a buffer, from the kernel, and picked up by a userspace + * tool that displays a unique log message for each tracepoint. Additionally, each + * tracepoint may contain up-to four 32-bit (may change with LP64) arguments. + * + * To add a tracepoint, use the code below as an example: + * USBTrace( kUSBTController, kTPControllerStart, (uintptr_t)myArgValue ); + * Next, add the corresponding tracepoint code in the USBTracer tool, using + * the existing examples. Avoid using confidential information in the log strings. + * Some functions have a argument counter, to signify which of the function's tracepoints + * are actually being logged. When adding a tracepoint using an existing code, you + * must verify that you increment this argument counter properly. + * + * The trace codes consist of the following: + * + * ---------------------------------------------------------------------- + *| Class (8) | SubClass (8) | USBGroup(6) | Code (8) |Func | + *| DBG_IOKIT | DBG_IOUSB | | |Qual(2)| + * ---------------------------------------------------------------------- + * + * DBG_IOKIT(05h) DBG_IOUSB(2Dh) + * + * See <sys/kdebug.h> and IOTimeStamp.h for more details. + */ + + + // USB groupings (max of 64) + enum + { + // Family groupings + kUSBTController = 0, + kUSBTControllerUserClient = 1, + + kUSBTDevice = 2, + kUSBTDeviceUserClient = 3, + + kUSBTHub = 4, + kUSBTHubPort = 5, + kUSBTHSHubUserClient = 6, + kUSBTHID = 7, + kUSBTPipe = 8, + + kUSBTInterfaceUserClient = 9, + + kUSBTEnumeration = 10, // Tracepoints in various components to debug USB enumeration + + + // UIM groupings + kUSBTUHCI = 11, + kUSBTUHCIUIM = 12, + kUSBTUHCIInterrupts = 13, + + kUSBTOHCI = 14, + kUSBTOHCIInterrupts = 15, + + kUSBTEHCI = 20, + kUSBTEHCIHubInfo = 22, + kUSBTEHCIInterrupts = 23, + + // 30-33 reserved + + // 21-25 reserved + kUSBTHubPolicyMaker = 35, + kUSBTCompositeDriver = 36, + + // Actions + kUSBTOutstandingIO = 42, + + // kUSBAudio + kUSBAudio = 50 + + // 61-63 reserved + }; + + // USB Controller Tracepoints 0x052D0000 - 0x052D03FF + // kUSBTController + enum + { + kTPControllerStart = 1, + kTPControllerControlPacketHandler = 2, + kTPControllerMakeDevice = 3, + kTPControllerMakeHubDevice = 4, + kTPControllerCreateRootHubDevice = 5, + kTPControllerClearTTHandler = 6, + kTPControllerClearTT = 7, + kTPControllerDoCreateEP = 8, + kTPControllerReadV2 = 9, + kTPControllerReturnIsochDoneQueue = 10, + kTPControllersetPowerState = 11, + kTPControllerCheckPowerModeBeforeGatedCall = 12, + kTPControllerGatedPowerChange = 13, + kTPControllerCheckForRootHubChanges = 14, + kTPControllerRootHubQueueInterruptRead = 15, + kTPControllerRootHubTimer = 16, + kTPControllerDisjointCompletion = 17, + kTPControllerCheckForDisjointDescriptor = 18, + kTPControllerRead = 19, + kTPControllerV3Start = 20, + kTPAllocatePowerStateArray = 21, + kTPInitForPM = 22, + kTPIsocIOLL = 23, + kTPIsocIO = 24, + kTPControllerWrite = 25, + kTPCompletionCall = 26, + kTPControlTransaction = 27, + kTPInterruptTransaction = 28, + kTPInterruptTransactionData = 29, + kTPBulkTransaction = 30, + kTPBulkTransactionData = 31, + kTPIsocTransaction = 32, + kTPInterruptPacketHandler = 33, + kTPBulkPacketHandler = 34, + kTPDevZeroLock = 35, + kTPControlPacketHandlerData = 36, + kTPDoIOTransferIntrSync = 37, + kTPDoIOTransferBulkSync = 38, + kTPBulkPacketHandlerData = 39, + kTPInterruptPacketHandlerData = 40 + }; + + // USB Device Tracepoints + // kUSBTDevice + enum + { + kTPDeviceInit = 1, + kTPDeviceMessage = 2, + kTPDeviceResetDevice = 3, + kTPDeviceGetFullConfigurationDescriptor = 4, + kTPDeviceGetDeviceDescriptor = 5, + kTPDeviceGetConfigDescriptor = 6, + kTPDeviceSetConfiguration = 7, + kTPDeviceSetFeature = 8, + kTPDeviceDeviceRequest = 9, + kTPDeviceGetConfiguration = 10, + kTPDeviceGetDeviceStatus = 11, + kTPDeviceSuspendDevice = 12, + kTPDeviceReEnumerateDevice = 13, + kTPDeviceConfigLock = 14 + }; + + // USB Pipe Tracepoints + // kUSBTPipe + enum + { + kTPPipeInitToEndpoint = 1, + kTPBulkPipeRead = 2, + kTPBulkPipeWrite = 3, + kTPIsocPipeRead = 4, + kTPIsocPipeWrite = 5, + kTPIsocPipeReadLL = 6, + kTPIsocPipeWriteLL = 7, + kTPIBulkReadTS = 8, + kTPPipeControlRequest = 9, + kTPPipeControlRequestMemDesc = 10 + }; + + + // USB kUSBTControllerUserClient Tracepoints + // kUSBTControllerUserClient + enum + { + kTPControllerUCStart = 1, + kTPControllerUCOpen = 2, + kTPControllerUCReadRegister = 3, + kTPControllerUCWriteRegister = 4 + }; + + // USB kUSBTDeviceUserClient Tracepoints + // kUSBTDeviceUserClient + enum + { + kTPDeviceUCDeviceRequestIn = 1, + kTPDeviceUCDeviceRequestOut = 2, + kTPDeviceUCChangeOutstandingIO = 3, + kTPDeviceUCGetGatedOutstandingIO = 4, + kTPDeviceUCReqComplete = 5 + }; + + // USB InterfaceUserClient Tracepoints + // kUSBTInterfaceUserClient + enum + { + kTPInterfaceUCReadPipe = 1, + kTPInterfaceUCWritePipe = 2, + kTPInterfaceUCControlRequestOut = 3, + kTPInterfaceUCControlRequestIn = 4, + kTPInterfaceUCDoIsochPipeAsync = 5, + kTPInterfaceUCLowLatencyPrepareBuffer = 6, + kTPInterfaceUCChangeOutstandingIO = 7, + kTPInterfaceUCReqComplete = 8, + kTPInterfaceUCIsoReqComplete = 9, + kTPInterfaceUCLLIsoReqComplete = 10 + }; + + + // USB HSHubUserClient Tracepoints + // kUSBTHSHubUserClient + enum + { + kTPHSHubUCInitWithTask = 1, + kTPHSHubUCStart = 2, + kTPHSHubUCClose = 3, + kTPHSHubUCGetNumberOfPorts = 4, + kTPHSHubUCGetLocationID = 5, + kTPHSHubUCPutPortIntoTestMode = 6, + kTPHSHubUCSupportsIndicators = 7, + kTPHSHubUCSetIndicatorForPort = 8, + kTPHSHubUCGetPortIndicatorControl = 9, + kTPHSHubUCSetIndicatorsToAutomatic = 10, + kTPHSHubUCGetPowerSwitchingMode = 11, + kTPHSHubUCGetPortPower = 12, + kTPHSHubUCSetPortPower = 13, + kTPHSHubUCDisablePwrMgmt = 14 + }; + + // USB Hub Tracepoints + // kUSBTHub + enum + { + kTPHubStart = 1, + kTPHubMessage = 2, + kTPHubWillTerminate = 3, + kTPHubPowerStateWillChangeTo = 4, + kTPHubPowerChangeDone = 5, + kTPHubConfigureHub = 6, + kTPHubCheckPowerPowerRequirements = 7, + kTPHubHubPowerChange = 8, + kTPHubAreAllPortsDisconnectedOrSuspended= 9, + kTPHubSuspendPorts = 10, + kTPHubSetPortFeature = 11, + kTPHubClearPortFeature = 12, + kTPHubDoPortAction = 13, + kTPHubInterruptReadHandler = 14, + kTPHubResetPortZero = 15, + kTPHubProcessStateChanged = 16, + kTPHubRearmInterruptRead = 17, + kTPHubDoDeviceRequest = 18, + kTPHubWaitForPortResumes = 19, + kTPHubResetMyPort = 20, + kTPHubDecrementOutstandingIO = 21, + kTPHubChangeOutstandingIO = 22, + kTPHubChangeRaisedPowerState = 23, + kTPHubChangeOutstandingResumes = 24, + kTPHubEnterTestMode = 25, + kTPHubLeaveTestMode = 26, + kTPHubPutPortIntoTestMode = 27, + kTPHubGetPortIndicatorControl = 28, + kTPHubSetIndicatorsToAutomatic = 29, + kTPHubGetPortPower = 30, + kTPHubEnsureUsability = 31, + kTPHubCheckPowerRequirements = 32, + kTPHubWaitForPowerOn = 33, + kTPHubDoPortActionLock = 34, + kTPHubCheckForDeadDevice = 35 + }; + + // USB HubPort Tracepoints + // kUSBTHubPort + enum + { + kTPHubPortStop = 1, + kTPHubPortAddDevice = 2, + kTPHubPortSuspendPort = 3, + kTPHubPortFatalError = 4, + kTPHubPortAddDeviceResetChangeHandler = 5, + kTPHubPortHandleResetPortHandler = 6, + kTPHubPortDefaultOverCrntChangeHandler = 7, + kTPHubPortDefaultConnectionChangeHandler = 8, + kTPHubPortReleaseDevZeroLock = 9, + kTPHubPortDetachDevice = 10, + kTPHubPortGetDevZeroDescriptorWithRetries = 11, + kTPHubPortDisplayOverCurrentNotice = 12, + kTPHubPortWakeSuspendCommand = 13, + kTPHubPortWaitForSuspendCommand = 14, + kTPHubPortEnablePowerAfterOvercurrent = 15 + }; + + // USB HID Tracepoints + // kUSBTHID + enum + { + kTPHIDStart = 1, + kTPHIDpowerStateWillChangeTo = 2, + kTPHIDsetPowerState = 3, + kTPHIDpowerStateDidChangeTo = 4, + kTPHIDpowerChangeDone = 5, + kTPHIDhandleStart = 6, + kTPHIDClearFeatureEndpointHalt = 7, + kTPHIDHandleReport = 8, + kTPHIDSuspendPort = 9, + kTPHIDAbortAndSuspend = 10, + kTPHIDClaimPendingRead = 11, + kTPHIDChangeOutstandingIO = 12, + kTPHIDRearmInterruptRead = 13, + kTPHIDInitializeUSBHIDPowerManagement = 14, + kTPHIDInterruptRead = 15, + kTPHIDInterruptReadError = 16, + kTPHIDCheckForDeadDevice = 17 + }; + + // USB Enumeration Tracepoints + // kUSBTEnumeration + enum + { + kTPEnumerationProcessStatusChanged = 1, + kTPEnumerationInitialGetPortStatus = 2, + kTPEnumerationCallAddDevice = 3, + kTPEnumerationAddDevice = 4, + kTPEnumerationResetPort = 5, + kTPEnumerationAddDeviceResetChangeHandler = 6, + kTPEnumerationRegisterService = 7, + kTPEnumerationLowSpeedDevice = 8, + kTPEnumerationFullSpeedDevice = 9 + + }; + + // USB UHCI Tracepoints + // kUSBTUHCI + enum + { + kTPUHCIMessage = 1, + kTPUHCIGetFrameNumber = 2, + kTPUHCIScavengeIsocTransactions = 3, + kTPUHCIScavengeQueueHeads = 4, + kTPUHCIAllocateQH = 5, + kTPUHCIRootHubStatusChange = 6, + kTPUHCIRHSuspendPort = 7, + kTPUHCIRHHoldPortReset = 8, + kTPUHCIRHResumePortCompletion = 9, + kTPUHCISuspendController = 10, + KTPUHCIResumeController = 11, + KTPUHCIResetControllerState = 12, + KTPUHCIRestartControllerFromReset = 13, + KTPUHCIEnableInterrupts = 14, + KTPUHCIDozeController = 15, + KTPUHCIWakeFromDoze = 16, + KTPUHCIPowerState = 17, + }; + + + // USB UHCI Tracepoints + // kUSBTUHCIUIM + enum + { + kTPUHCIUIMCreateControlEndpoint = 1, + kTPUHCIUIMCreateBulkEndpoint = 2, + kTPUHCIUIMCreateInterruptEndpoint = 3, + kTPUHCIUIMCreateIsochEndpoint = 4, + kTPUHCIUIMCreateIsochTransfer = 5, + kTPUHCIUIMDeleteEndpoint = 6, + kTPUHCIUIMUnlinkQueueHead = 7, + kTPUHCIUIMCheckForTimeouts = 8, + kTPUHCIUIMReturnOneTransaction = 9, + kTPUHCIUIMAllocateTDChain = 10, + kTPUHCIUIMAddIsochFramesToSchedule = 11, + kTPUHCIUIMAbortIsochEP = 12, + kTPUHCIUIMCreateInterruptTransfer = 13, + kTPUHCIUIMHandleEndpointAbort = 14 + }; + + // USB UHCI Interrupt Tracepoints + // kUSBTUHCIInterrupts + enum + { + kTPUHCIInterruptsGetFrameNumberInternal = 1, + kTPUHCIInterruptsFilterInterrupt = 2, + kTPUHCIInterruptsHandleInterrupt = 3, + kTPUHCIUpdateFrameList = 4 + }; + + // USB EHCI Tracepoints + // kUSBTEHCI + enum + { + kTPEHCIRootHubResetPort = 1, + kTPEHCIRootHubPortEnable = 2, + kTPEHCIRootHubPortSuspend = 3, + // kTPEHCIRootHubStatusChange = 4, + kTPEHCIRHResumePortCompletion = 5, + kTPEHCIUIMFinalize = 6, + kTPEHCIGetFrameNumber32 = 7, + kTPEHCIGetFrameNumber = 8, + kTPEHCIAllocateQH = 9, + kTPEHCIEnableAsyncSchedule = 10, + kTPEHCIDisableAsyncSchedule = 11, + kTPEHCIEnablePeriodicSchedule = 12, + kTPEHCIDisablePeriodicSchedule = 13, + kTPEHCIMessage = 14, + kTPEHCIMakeEmptyEndPoint = 15, + kTPEHCIAllocateTDs = 16, + kTPEHCIMungeECHIStatus = 17, + kTPEHCIScavengeIsocTransactions = 18, + kTPEHCIScavengeAnEndpointQueue = 19, + kTPEHCIScavengeCompletedTransactions = 20, + kTPEHCICreateBulkEndpoint = 21, + kTPEHCICreateBulkTransfer = 22, + + kTPEHCICreateInterruptEndpoint = 24, + kTPEHCICreateIsochEndpoint = 25, + kTPEHCIAbortIsochEP = 26, + kTPEHCIHandleEndpointAbort = 27, + kTPEHCICreateInterruptTransfer = 28, + kTPEHCIUnlinkAsyncEndpoint = 29, + kTPEHCIDeleteEndpoint = 30, + kTPEHCICreateHSIsochTransfer = 31, + kTPEHCICreateSplitIsochTransfer = 32, + kTPEHCICreateIsochTransfer = 33, + kTPEHCIAddIsocFramesToSchedule = 34, + kTPEHCIReturnOneTransaction = 35, + kTPEHCICheckEDListForTimeouts = 36, + kTPEHCISuspendUSBBus = 37, + kTPEHCICheckForTimeouts = 38, + kTPEHCIResumeUSBBus = 39, + kTPEHCIRestartUSBBus = 40, + kTPEHCIResetControllerState = 41, + kTPEHCIDozeController = 42, + kTPEHCIWakeControllerFromDoze = 43, + kTPEHCIEnableInterrupts = 44, + kTPEHCIPowerState = 45, + kTPEHCIStopUSBBus = 46, + kTPEHCIRestartControllerFromReset = 47 + }; + + // USB EHCI Interrupt Tracepoints + // kUSBTEHCIInterrupts + enum + { + kTPEHCIInterruptsPollInterrupts = 1, + kTPEHCIInterruptsPrimaryInterruptFilter = 2, + kTPEHCIUpdateFrameList = 3, + }; + + + // USB EHCI Interrupt Tracepoints + // kUSBTEHCIHubInfo + enum + { + kTPEHCIAvailableIsochBandwidth = 1, + kTPEHCIAllocateIsochBandwidth = 2 + }; + + // USB OHCI Tracepoints + // kUSBTOHCI + enum + { + kTPOHCIInitialize = 1, + kTPOHCICreateGeneralTransfer = 2, + kTPOHCIAbortEndpoint = 3, + kTPOHCIDeleteEndpoint = 4, + kTPOHCIEndpointStall = 5, + kTPOHCICreateIsochTransfer = 6, + kTPOHCIAllocateTD = 7, + kTPOHCIAllocateITD = 8, + kTPOHCIAllocateED = 9, + kTPOHCIProcessCompletedITD = 10, + kTPOHCIReturnTransactions = 11, + kTPOHCIMessage = 12, + KTPOHCISuspendUSBBus = 13, + KTPOHCIResumeUSBBus = 14, + KTPOHCIResetControllerState = 15, + KTPOHCIRestartControllerFromReset = 16, + KTPOHCIEnableInterrupts = 17, + KTPOHCIDozeController = 18, + KTPOHCIWakeControllerFromDoze = 19, + KTPOHCIPowerState = 20, + kTPOHCIDoneQueueCompletion = 21 + }; + + // USB OHCI Interrupt Tracepoints + // kUSBTOHCIInterrupts + enum + { + kTPOHCIInterruptsPollInterrupts = 1, + kTPOHCIInterruptsPrimaryInterruptFilter = 2, + kTPOHCIUpdateFrameList = 3 + }; + + + // USB HubPolicyMaker Tracepoints + // kUSBTHubPolicyMaker + enum + { + kTPSetPowerState = 1 + }; + + // USB CompositeDriver Tracepoints + // kUSBTCompositeDriver + enum + { + kTPCompositeDriverConfigureDevice = 1 + }; + + // USB USB OutstandingIO Tracepoints + // kUSBTOutstandingIO + enum + { + kTPDeviceUCDecrement = 1, + kTPDeviceUCIncrement = 2, + kTPInterfaceUCDecrement = 3, + kTPInterfaceUCIncrement = 4, + kTPHubDecrement = 5, + kTPHubIncrement = 6, + kTPHIDDecrement = 7, + kTPHIDIncrement = 8 + }; + + // USB Audio driver Tracepoints + // kUSBAudio + enum + { + kTPAudioDriverRead = 1, + kTPAudioDriverCoalesceInputSamples = 2, + kTPAudioDriverCoalesceError = 3, + kTPAudioDriverCoalesce = 4, + kTPAudioDriverReadHandler = 5, + kTPAudioDriverCoalesceError2 = 6, + kTPAudioDriverConvertInputSamples = 7 + }; + + // Tracepoint macros. +#define USB_TRACE(USBClass, code, funcQualifier) ( ( ( DBG_IOKIT & 0xFF ) << 24) | ( ( DBG_IOUSB & 0xFF ) << 16 ) | ( ( USBClass & 0x3F ) << 10 ) | ( ( code & 0xFF ) << 2 ) | ( funcQualifier & 0x3 ) ) + +#define kTPAllUSB USB_TRACE ( 0, 0, 0 ) + +#define USB_CONTROLLER_TRACE(code) USB_TRACE( kUSBTController, code, DBG_FUNC_NONE ) +#define USB_CONTROLLER_UC_TRACE(code) USB_TRACE( kUSBTControllerUserClient, code, DBG_FUNC_NONE ) +#define USB_DEVICE_TRACE(code) USB_TRACE( kUSBTDevice, code, DBG_FUNC_NONE ) +#define USB_DEVICE_UC_TRACE(code) USB_TRACE( kUSBTDeviceUserClient, code, DBG_FUNC_NONE ) + +#define USB_HUB_TRACE(code) USB_TRACE( kUSBTHub, code, DBG_FUNC_NONE ) +#define USB_HUB_PORT_TRACE(code) USB_TRACE( kUSBTHubPort, code, DBG_FUNC_NONE ) +#define USB_HUB_UC_TRACE(code) USB_TRACE( kUSBTHSHubUserClient, code, DBG_FUNC_NONE ) +#define USB_HID_TRACE(code) USB_TRACE( kUSBTHID, code, DBG_FUNC_NONE ) +#define USB_PIPE_TRACE(code) USB_TRACE( kUSBTPipe, code, DBG_FUNC_NONE ) + +#define USB_INTERFACE_UC_TRACE(code) USB_TRACE( kUSBTInterfaceUserClient, code, DBG_FUNC_NONE ) + +#define USB_ENUMERATION_TRACE(code) USB_TRACE( kUSBTEnumeration, code, DBG_FUNC_NONE ) + +#define USB_UHCI_TRACE(code) USB_TRACE( kUSBTUHCI, code, DBG_FUNC_NONE ) +#define USB_UHCI_UIM_TRACE(code) USB_TRACE( kUSBTUHCIUIM, code, DBG_FUNC_NONE ) +#define USB_UHCI_INTERRUPTS_TRACE(code) USB_TRACE( kUSBTUHCIInterrupts, code, DBG_FUNC_NONE ) + +#define USB_OHCI_TRACE(code) USB_TRACE( kUSBTOHCI, code, DBG_FUNC_NONE ) +#define USB_OHCI_INTERRUPTS_TRACE(code) USB_TRACE( kUSBTOHCIInterrupts, code, DBG_FUNC_NONE ) + +#define USB_EHCI_TRACE(code) USB_TRACE( kUSBTEHCI, code, DBG_FUNC_NONE ) +#define USB_EHCI_HUBINFO_TRACE(code) USB_TRACE( kUSBTEHCIHubInfo, code, DBG_FUNC_NONE ) +#define USB_EHCI_INTERRUPTS_TRACE(code) USB_TRACE( kUSBTEHCIInterrupts, code, DBG_FUNC_NONE ) + +#define USB_HUB_POLICYMAKER_TRACE(code) USB_TRACE( kUSBTHubPolicyMaker, code, DBG_FUNC_NONE ) +#define USB_COMPOSITE_DRIVER_TRACE(code) USB_TRACE( kUSBTCompositeDriver, code, DBG_FUNC_NONE ) + +#define USB_OUTSTANDING_IO_TRACE(code) USB_TRACE( kUSBTOutstandingIO, code, DBG_FUNC_NONE ) + +#define USB_AUDIO_DRIVER_TRACE(code) USB_TRACE( kUSBAudio, code, DBG_FUNC_NONE ) + +#ifdef KERNEL + +#include <IOKit/IOTimeStamp.h> + +#define USBTrace(USBClass, code, a, b, c, d) { \ + if (gUSBStackDebugFlags & kUSBEnableTracePointsMask) { \ + IOTimeStampConstant( USB_TRACE(USBClass, code, DBG_FUNC_NONE), a, b, c, d ); \ + } \ + } + +#define USBTrace_Start(USBClass, code, a, b, c, d) { \ + if (gUSBStackDebugFlags & kUSBEnableTracePointsMask) { \ + IOTimeStampConstant( USB_TRACE(USBClass, code, DBG_FUNC_START), a, b, c, d ); \ + } \ + } + +#define USBTrace_End(USBClass, code, a, b, c, d) { \ + if (gUSBStackDebugFlags & kUSBEnableTracePointsMask) { \ + IOTimeStampConstant( USB_TRACE(USBClass, code, DBG_FUNC_END), a, b, c, d ); \ + } \ + } + +#endif + + + +#ifdef __cplusplus +} +#endif + + +#endif /* __IOKIT_IO_USB_FAMILY_TRACEPOINTS__ */ diff --git a/i386/include/IOKit/usb/IOUFIStorageServices.h b/i386/include/IOKit/usb/IOUFIStorageServices.h new file mode 100644 index 0000000..cac43f4 --- /dev/null +++ b/i386/include/IOKit/usb/IOUFIStorageServices.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_UFI_STORAGE_SERVICES_H_ +#define _IOKIT_UFI_STORAGE_SERVICES_H_ + +#if defined(KERNEL) && defined(__cplusplus) + +#include <IOKit/IOTypes.h> +#include <IOKit/storage/IOBlockStorageDevice.h> +#include <IOKit/usb/IOUSBMassStorageUFISubclass.h> + + +class IOUFIStorageServices : public IOBlockStorageDevice +{ + + OSDeclareDefaultStructors ( IOUFIStorageServices ) + +private: + bool fMediaChanged; + bool fMediaPresent; + +protected: + + IOUSBMassStorageUFIDevice * fProvider; + + UInt64 fMaxReadBlocks; + UInt64 fMaxWriteBlocks; + + virtual bool attach ( IOService * provider ); + virtual void detach ( IOService * provider ); + + // Reserve space for future expansion. + struct IOUFIStorageServicesExpansionData { }; + IOUFIStorageServicesExpansionData *fIOUFIStorageServicesReserved; + +public: + + virtual IOReturn message ( UInt32 type, IOService * provider, void * argument ); + + static void AsyncReadWriteComplete ( void * clientData, + IOReturn status, + UInt64 actualByteCount ); + + // Deprecated + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks, + IOStorageCompletion completion ); + + virtual IOReturn doAsyncReadWrite ( IOMemoryDescriptor * buffer, + UInt64 block, + UInt64 nblks, + IOStorageAttributes * attributes, + IOStorageCompletion * completion ); + + virtual IOReturn doSyncReadWrite ( IOMemoryDescriptor * buffer, + UInt32 block, + UInt32 nblks ); + + virtual IOReturn doEjectMedia ( void ); + + virtual IOReturn doFormatMedia ( UInt64 byteCapacity ); + + virtual UInt32 doGetFormatCapacities ( UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + virtual IOReturn doLockUnlockMedia ( bool doLock ); + + virtual IOReturn doSynchronizeCache ( void ); + + virtual char * getVendorString ( void ); + + virtual char * getProductString ( void ); + + virtual char * getRevisionString ( void ); + + virtual char * getAdditionalDeviceInfoString ( void ); + + virtual IOReturn reportBlockSize ( UInt64 * blockSize ); + + virtual IOReturn reportEjectability ( bool * isEjectable ); + + virtual IOReturn reportLockability ( bool * isLockable ); + + virtual IOReturn reportMediaState ( bool * mediaPresent, bool * changed ); + + virtual IOReturn reportPollRequirements ( bool * pollIsRequired, + bool * pollIsExpensive ); + + virtual IOReturn reportMaxValidBlock ( UInt64 * maxBlock ); + + virtual IOReturn reportRemovability ( bool * isRemovable ); + + virtual IOReturn reportWriteProtection ( bool * isWriteProtected ); + + virtual IOReturn getWriteCacheState ( bool * enabled ); + + virtual IOReturn setWriteCacheState ( bool enabled ); + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 1 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 2 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 3 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 4 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 5 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 6 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 7 ); + OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 8 ); + +}; + +#endif /* defined(KERNEL) && defined(__cplusplus) */ + +#endif /* _IOKIT_UFI_STORAGE_SERVICES_H_ */ diff --git a/i386/include/IOKit/usb/IOUSBBus.h b/i386/include/IOKit/usb/IOUSBBus.h new file mode 100644 index 0000000..a42191a --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBBus.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBBUS_H +#define _IOKIT_IOUSBBUS_H + +#include <IOKit/IOService.h> + +class IOUSBBus : public IOService +{ + OSDeclareAbstractStructors(IOUSBBus) +}; + +#endif /* ! _IOKIT_IOUSBBUS_H */ + diff --git a/i386/include/IOKit/usb/IOUSBCommand.h b/i386/include/IOKit/usb/IOUSBCommand.h new file mode 100644 index 0000000..0f7c36b --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBCommand.h @@ -0,0 +1,266 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCOMMAND_H +#define _IOKIT_IOUSBCOMMAND_H + +#include <IOKit/IOCommand.h> +#include <IOKit/IOCommandPool.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IODMACommand.h> +#include <IOKit/usb/USB.h> + +/* + * USB Command + * This is the command block for a USB command to be queued on the + * Command Gate of the WorkLoop. Although the actual work of creating + * the command and enqueueing it is done for them via the deviceRequest, + * read, and write methods, this is the primary way that devices will get + * work done. + * Note: This is private to IOUSBController and should be moved to a + * private header. + */ + +typedef enum { + DEVICE_REQUEST, // Device request using pointer + READ, + WRITE, + CREATE_EP, + DELETE_EP, + DEVICE_REQUEST_DESC, // Device request using descriptor + DEVICE_REQUEST_BUFFERCOMMAND // Device request using a second IOUSBCommand in _bufferCommand +} usbCommand; + + + +/*! + @class IOUSBCommand + @abstract A subclass of IOCommand that is used to add USB specific data. + */ +class IOUSBCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOUSBCommand) + +protected: + usbCommand _selector; + IOUSBDeviceRequestPtr _request; + USBDeviceAddress _address; + UInt8 _endpoint; + UInt8 _direction; + UInt8 _type; + bool _bufferRounding; + IOMemoryDescriptor * _buffer; + IOUSBCompletion _uslCompletion; + IOUSBCompletion _clientCompletion; + UInt32 _dataRemaining; // For Control transfers + UInt8 _stage; // For Control transfers + IOReturn _status; + IOMemoryDescriptor * _origBuffer; + IOUSBCompletion _disjointCompletion; + IOByteCount _dblBufLength; + UInt32 _noDataTimeout; + UInt32 _completionTimeout; + UInt32 _UIMScratch[10]; + + struct ExpansionData + { + IOByteCount _reqCount; + IOMemoryDescriptor *_requestMemoryDescriptor; + IOMemoryDescriptor *_bufferMemoryDescriptor; + bool _multiTransferTransaction; + bool _finalTransferInTransaction; + bool _useTimeStamp; + AbsoluteTime _timeStamp; + bool _isSyncTransfer; // Returns true if the command is used for a synchronous transfer + IODMACommand *_dmaCommand; // used to get memory mapping + IOUSBCommand *_bufferUSBCommand; // points to another IOUSBCommand used for phase 2 of control transactions + IOUSBCommand *_masterUSBCommand; // points from the bufferUSBCommand back to the parent command + }; + ExpansionData * _expansionData; + + // we override these OSObject method in order to allocate and release our expansion data + virtual bool init(); + virtual void free(); + +public: + + // static constructor + static IOUSBCommand * NewCommand(void); + + // Manipulators + void SetSelector(usbCommand sel); + void SetRequest(IOUSBDeviceRequestPtr req); + void SetAddress(USBDeviceAddress addr); + void SetEndpoint(UInt8 ep); + void SetDirection(UInt8 dir); + void SetType(UInt8 type); + void SetBufferRounding(bool br); + void SetBuffer(IOMemoryDescriptor *buf); + void SetUSLCompletion(IOUSBCompletion completion); + void SetClientCompletion(IOUSBCompletion completion); + void SetDataRemaining(UInt32 dr); + void SetStage(UInt8 stage); + void SetStatus(IOReturn stat); + void SetOrigBuffer(IOMemoryDescriptor *buf); + void SetDisjointCompletion(IOUSBCompletion completion); + void SetDblBufLength(IOByteCount len); + void SetNoDataTimeout(UInt32 to); + void SetCompletionTimeout(UInt32 to); + void SetUIMScratch(UInt32 index, UInt32 value); + void SetReqCount(IOByteCount reqCount); + void SetRequestMemoryDescriptor(IOMemoryDescriptor *requestMemoryDescriptor); + void SetBufferMemoryDescriptor(IOMemoryDescriptor *bufferMemoryDescriptor); + void SetMultiTransferTransaction(bool); + void SetFinalTransferInTransaction(bool); + void SetUseTimeStamp(bool); + void SetTimeStamp(AbsoluteTime timeStamp); + void SetIsSyncTransfer(bool); + inline void SetDMACommand(IODMACommand *dmaCommand) { _expansionData->_dmaCommand = dmaCommand; } + void SetBufferUSBCommand(IOUSBCommand *bufferUSBCommand); + + // Accessors + usbCommand GetSelector(void); + IOUSBDeviceRequestPtr GetRequest(void); + USBDeviceAddress GetAddress(void); + UInt8 GetEndpoint(void); + UInt8 GetDirection(void); + UInt8 GetType(void); + bool GetBufferRounding(void); + IOMemoryDescriptor * GetBuffer(void); + IOUSBCompletion GetUSLCompletion(void); + IOUSBCompletion GetClientCompletion(void); + UInt32 GetDataRemaining(void); + UInt8 GetStage(void); + IOReturn GetStatus(void); + IOMemoryDescriptor * GetOrigBuffer(void); + IOUSBCompletion GetDisjointCompletion(void); + IOByteCount GetDblBufLength(void); + UInt32 GetNoDataTimeout(void); + UInt32 GetCompletionTimeout(void); + UInt32 GetUIMScratch(UInt32 index); + IOByteCount GetReqCount(void); + IOMemoryDescriptor * GetRequestMemoryDescriptor(void); + IOMemoryDescriptor * GetBufferMemoryDescriptor(void); + bool GetMultiTransferTransaction(void); + bool GetFinalTransferInTransaction(void); + bool GetUseTimeStamp(void); + AbsoluteTime GetTimeStamp(void); + bool GetIsSyncTransfer(void); + inline IODMACommand * GetDMACommand(void) {return _expansionData->_dmaCommand; } + inline IOUSBCommand * GetBufferUSBCommand(void) {return _expansionData->_bufferUSBCommand; } +}; + + +class IOUSBIsocCommand : public IOCommand +{ + OSDeclareAbstractStructors(IOUSBIsocCommand) + +protected: + usbCommand _selector; + USBDeviceAddress _address; + UInt8 _endpoint; + UInt8 _direction; + IOMemoryDescriptor * _buffer; + IOUSBIsocCompletion _completion; + UInt64 _startFrame; + UInt32 _numFrames; + IOUSBIsocFrame * _frameList; + IOReturn _status; + + struct ExpansionData + { + UInt32 _updateFrequency; + bool _useTimeStamp; + AbsoluteTime _timeStamp; + bool _isSyncTransfer; // Returns true if the command is used for a synchronous transfer + bool _rosettaClient; + IODMACommand * _dmaCommand; + IOUSBIsocCompletion _uslCompletion; + bool _lowLatency; + }; + ExpansionData * _expansionData; + + // we override these OSObject method in order to allocate and release our expansion data + virtual bool init(); + virtual void free(); + +public: + // static constructor + static IOUSBIsocCommand *NewCommand(void); + + // Manipulators + void SetSelector(usbCommand sel) {_selector = sel; } + void SetAddress(USBDeviceAddress addr) {_address = addr; } + void SetEndpoint(UInt8 ep) {_endpoint = ep; } + void SetDirection(UInt8 dir) {_direction = dir; } + void SetBuffer(IOMemoryDescriptor *buf) {_buffer = buf; } + void SetCompletion(IOUSBIsocCompletion completion) {_completion = completion; } + void SetStartFrame(UInt64 sf) {_startFrame = sf; } + void SetNumFrames(UInt32 nf) {_numFrames = nf; } + void SetFrameList(IOUSBIsocFrame *fl) {_frameList = fl; } + void SetStatus(IOReturn stat) {_status = stat; } + void SetUpdateFrequency( UInt32 fr) { _expansionData->_updateFrequency = fr; } + void SetUseTimeStamp(bool useIt) { _expansionData->_useTimeStamp= useIt; } + void SetTimeStamp(AbsoluteTime timeStamp) { _expansionData->_timeStamp= timeStamp; } + void SetIsSyncTransfer(bool isSync) { _expansionData->_isSyncTransfer = isSync; } + void SetRosettaClient(bool isRosetta) { _expansionData->_rosettaClient = isRosetta; } + void SetDMACommand(IODMACommand *dmaCommand) { _expansionData->_dmaCommand = dmaCommand; } + void SetUSLCompletion(IOUSBIsocCompletion completion) { _expansionData->_uslCompletion = completion; } + void SetLowLatency(bool lowLatency) { _expansionData->_lowLatency = lowLatency; } + + // Accessors + usbCommand GetSelector(void) { return _selector; } + USBDeviceAddress GetAddress(void) { return _address; } + UInt8 GetEndpoint(void) { return _endpoint; } + UInt8 GetDirection(void) { return _direction; } + IOMemoryDescriptor * GetBuffer(void) { return _buffer; } + IOUSBIsocCompletion GetCompletion(void) { return _completion; } + UInt64 GetStartFrame(void) { return _startFrame; } + UInt32 GetNumFrames(void) { return _numFrames; } + IOUSBIsocFrame * GetFrameList(void) { return _frameList; } + UInt32 GetUpdateFrequency(void) { return _expansionData->_updateFrequency; } + IOReturn GetStatus(void) { return _status; } + bool GetUseTimeStamp(void) { return _expansionData->_useTimeStamp; } + AbsoluteTime GetTimeStamp(void) { return _expansionData->_timeStamp; } + bool GetIsSyncTransfer(void) { return _expansionData->_isSyncTransfer; } + bool GetIsRosettaClient(void) { return _expansionData->_rosettaClient; } + IODMACommand * GetDMACommand(void) { return _expansionData->_dmaCommand; } + IOUSBIsocCompletion GetUSLCompletion(void) { return _expansionData->_uslCompletion; } + bool GetLowLatency(void) { return _expansionData->_lowLatency; } +}; + +class IOUSBCommandPool : public IOCommandPool +{ + OSDeclareDefaultStructors( IOUSBCommandPool ) + +protected: + virtual IOReturn gatedReturnCommand(IOCommand * command); + virtual IOReturn gatedGetCommand(IOCommand ** command, bool blockForCommand); + +public: + static IOCommandPool * withWorkLoop(IOWorkLoop * inWorkLoop); +}; + + +#endif + diff --git a/i386/include/IOKit/usb/IOUSBCompositeDriver.h b/i386/include/IOKit/usb/IOUSBCompositeDriver.h new file mode 100644 index 0000000..ef72cf4 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBCompositeDriver.h @@ -0,0 +1,127 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1998-2006 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCompositeDriver_H +#define _IOKIT_IOUSBCompositeDriver_H + +//================================================================================================ +// +// Headers +// +//================================================================================================ +// +#include <libkern/OSByteOrder.h> +#include <IOKit/IOLib.h> +#include <IOKit/IONotifier.h> +#include <IOKit/IOService.h> +#include <IOKit/IOMessage.h> +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBDevice.h> +#include <IOKit/usb/IOUSBInterface.h> +#include <IOKit/usb/IOUSBLog.h> +#include <IOKit/usb/USB.h> + + +//================================================================================================ +// +// Class Declaration for IOUSBCompositeDriver +// +//================================================================================================ +// +/*! + @class IOUSBCompositeDriver + @abstract Driver that matches to USB composite devices. + @discussion This class can be overriden to provide for specific behaviors. The driver itself essentially + just calls SetConfiguration(). + */ +class IOUSBCompositeDriver : public IOService +{ + OSDeclareDefaultStructors(IOUSBCompositeDriver) + + IOUSBDevice * fDevice; + IONotifier * fNotifier; + bool fExpectingClose; + UInt8 fConfigValue; + UInt8 fConfigbmAttributes; + + struct IOUSBCompositeDriverExpansionData + { + }; + + IOUSBCompositeDriverExpansionData * fIOUSBCompositeExpansionData; + + static IOReturn CompositeDriverInterestHandler( void * target, void * refCon, UInt32 messageType, IOService * provider, void * messageArgument, vm_size_t argSize ); + +public: + + // IOService Methods + // + virtual bool start(IOService * provider); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + + // IOUSBCompositeDriver Methods + // + virtual bool ConfigureDevice(); + virtual IOReturn ReConfigureDevice(); + /*! + @function SetConfiguration + @abstract Call IOUSBDevice to do a SetConfiguration call to the device. + @param configValue The desired configuration value. + @param startInterfaceMatching A boolean specifying whether IOKit should begin the process of finding + matching drivers for the new IOUSBInterface objects. + */ + virtual IOReturn SetConfiguration(UInt8 configValue, bool startInterfaceMatching=true); + + // Getters + // + bool GetExpectingClose() { return fExpectingClose; } + UInt8 GetConfigValue() { return fConfigValue; } + UInt8 GetConfigbmAttributes() { return fConfigbmAttributes; } + IONotifier * GetNotifier() { return fNotifier; } + + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 0); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 1); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 2); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 3); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 4); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 5); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 6); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 7); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 8); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 9); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 10); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 11); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 12); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 13); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 14); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 15); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 16); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 17); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 18); + OSMetaClassDeclareReservedUnused(IOUSBCompositeDriver, 19); +}; + +#endif _IOKIT_IOUSBCompositeDriver_H diff --git a/i386/include/IOKit/usb/IOUSBController.h b/i386/include/IOKit/usb/IOUSBController.h new file mode 100644 index 0000000..18940f2 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBController.h @@ -0,0 +1,1073 @@ +/* + * Copyright (c) 1998-2010 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCONTROLLER_H +#define _IOKIT_IOUSBCONTROLLER_H + +//================================================================================================ +// +// Headers +// +//================================================================================================ +// +#include <libkern/c++/OSArray.h> + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IODeviceMemory.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> +#include <IOKit/IOCommandPool.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/USBHub.h> +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBCommand.h> +#include <IOKit/usb/IOUSBWorkLoop.h> + + +//================================================================================================ +// +// Types and Constants +// +//================================================================================================ +// +enum +{ + kErrataCMDDisableTestMode = (1 << 0), // turn off UHCI test mode + kErrataOnlySinglePageTransfers = (1 << 1), // Don't cross page boundaries in a single transfer + kErrataRetryBufferUnderruns = (1 << 2), // Don't cross page boundaries in a single transfer + kErrataLSHSOpti = (1 << 3), // Don't cross page boundaries in a single transfer + kErrataDisableOvercurrent = (1 << 4), // Always set the NOCP bit in rhDescriptorA register + kErrataLucentSuspendResume = (1 << 5), // Don't allow port suspend at the root hub + kErrataNeedsWatchdogTimer = (1 << 6), // Use Watchdog timer to reset confused controllers + kErrataNeedsPortPowerOff = (1 << 7), // Power off the ports and back on again to clear weird status. + kErrataAgereEHCIAsyncSched = (1 << 8), // needs workaround for Async Sched bug + kErrataNECOHCIIsochWraparound = (1 << 9), // needs workaround for NEC isoch buffer wraparound problem + kErrataNECIncompleteWrite = (1 << 10), // needs workaround for NEC bits not sticking (errata IBB-2UE-00030 Jun 23 2005) + kErrataICH6PowerSequencing = (1 << 11), // needs special power sequencing for early Transition machines + kErrataICH7ISTBuffer = (1 << 12), // buffer for Isochronous Scheduling Threshold + kErrataUHCISupportsOvercurrent = (1 << 13), // UHCI controller supports overcurrent detection + kErrataNeedsOvercurrentDebounce = (1 << 14), // The overcurrent indicator should be debounced by 10ms + kErrataSupportsPortResumeEnable = (1 << 15), // UHCI has resume enable bits at config address 0xC4 + kErrataNoCSonSplitIsoch = (1 << 16), // MCP79 - split iscoh is a little different + kErrataOHCINoGlobalSuspendOnSleep = (1 << 17), // when sleeping, do not put the OHCI controller in SUSPEND state. just leave it Operational with suspended downstream ports + kErrataMissingPortChangeInt = (1 << 18), // sometimes the port change interrupt may be missing + kErrataMCP79IgnoreDisconnect = (1 << 19), // MCP79 - need to ignore a connect/disconnect on wake + kErrataUse32bitEHCI = (1 << 20) , // MCP79 - EHCI should only run with 32 bit DMA addresses + kErrataUHCISupportsResumeDetectOnConnect = (1 << 21), // UHCI controller will generate a ResumeDetect interrupt while in Global Suspend if a device is plugged in + kErrataDontUseCompanionController = (1 << 22) // For systems which will end up being EHCI only +}; + +enum +{ + kUSBWatchdogTimeoutMS = 1000 +}; + + +/*! + @struct + @discussion This table contains the list of errata that are necessary for known problems with particular devices. + The format is vendorID, product ID, lowest revisionID needing errata, highest rev needing errata, errataBits. + The result of all matches is ORed together, so more than one entry may match. + Typically for a given errata a list of revisions that this applies to is supplied. + @field vendID The Vendor ID of the device + @field deviceID Product ID of device + @field revisionLo Lowest product revsion to apply errata to + @field revisionHi Highest product revision to apply errata to + @field errata Bit field flagging which errata to apply to device. +*/ + +struct ErrataListEntryStruct +{ + UInt16 vendID; + UInt16 deviceID; + UInt16 revisionLo; + UInt16 revisionHi; + UInt32 errata; +}; + +typedef struct ErrataListEntryStruct ErrataListEntry, *ErrataListEntryPtr; + + +//================================================================================================ +// +// Routines used to implement synchronous I/O +// +//================================================================================================ +// +void IOUSBSyncCompletion(void *target, void * parameter, IOReturn status, UInt32 bufferSizeRemaining); + +void IOUSBSyncIsoCompletion(void *target, void * parameter, IOReturn status, IOUSBIsocFrame *pFrames); + + +//================================================================================================ +// +// Forward Declarations +// +//================================================================================================ +// +class IOUSBDevice; +class IOUSBLog; +class IOUSBHubDevice; +class IOUSBRootHubDevice; +class IOMemoryDescriptor; + + +//================================================================================================ +// +// IOUSBController Class +// +//================================================================================================ +// +/*! + @class IOUSBController + @abstract Base class for USB hardware driver + @discussion Not many directly useful methods for USB device driver writers, + IOUSBDevice, IOUSBInterface and IOUSBPipe provide more useful abstractions. + The bulk of this class interfaces between IOKit and the low-level UIM, which is + based on the MacOS9 UIM. To impliment a new controller type, subclass + IOUSBController and impiment all the "UIM functions". AppleUSBOHCI + is an example of this implementing all the functions necessary to drive an + OHCI controller. +*/ +class IOUSBController : public IOUSBBus +{ + OSDeclareAbstractStructors(IOUSBController) + friend class IOUSBControllerV2; + friend class IOUSBControllerV3; + +protected: + + IOUSBWorkLoop * _workLoop; + IOCommandGate * _commandGate; + IOUSBRootHubDevice * _rootHubDevice; + UInt32 _devZeroLock; + static UInt32 _busCount; + static bool gUsedBusIDs[256]; + + struct ExpansionData + { + IOCommandPool *freeUSBCommandPool; + IOCommandPool *freeUSBIsocCommandPool; + IOTimerEventSource *watchdogUSBTimer; + bool _terminating; + bool _watchdogTimerActive; + bool _pcCardEjected; // Obsolete + UInt32 _busNumber; + UInt32 _currentSizeOfCommandPool; + UInt32 _currentSizeOfIsocCommandPool; + UInt8 _controllerSpeed; // Controller speed, passed down for splits + thread_call_t _terminatePCCardThread; // Obsolete + bool _addressPending[128]; + SInt32 _activeIsochTransfers; // isochronous transfers in the queue + IOService *_provider; // common name for our provider + bool _controllerCanSleep; // true iff the controller is able to support sleep/wake + bool _needToClose; + UInt32 _isochMaxBusStall; // value (in ns) of the maximum PCI bus stall allowed for Isoch.. + }; + ExpansionData *_expansionData; + + // The following methods do not use and upper case initial letter because they are part of IOKit + // + +public: + virtual bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual bool finalize(IOOptionBits options); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + +protected: + + IOReturn getNubResources( IOService * regEntry ); + + virtual UInt32 GetErrataBits( + UInt16 vendorID, + UInt16 deviceID, + UInt16 revisionID ); + + + static IOReturn DoDeleteEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoAbortEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoClearEPStall( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoCreateEP( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + static IOReturn DoControlTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoIOTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoIsocTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static IOReturn DoLowLatencyIsocTransfer( + OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + static void ControlPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void InterruptPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void BulkPacketHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + + static void IsocCompletionHandler( + OSObject * target, + void * parameter, + IOReturn status, + IOUSBIsocFrame *pFrames ); + + static void LowLatencyIsocCompletionHandler( + OSObject * target, + void * parameter, + IOReturn status, + IOUSBLowLatencyIsocFrame *pFrames ); + + static void WatchdogTimer(OSObject *target, IOTimerEventSource *sender); + + // Obsolete + static void TerminatePCCard(OSObject *target); + + static IOReturn ProtectedDevZeroLock(OSObject *target, void* lock, void *, void *, void*); + + + USBDeviceAddress GetNewAddress( void ); + + IOReturn ControlTransaction( IOUSBCommand * command ); + + IOReturn InterruptTransaction( IOUSBCommand * command ); + + IOReturn BulkTransaction( IOUSBCommand * command ); + + IOReturn IsocTransaction( IOUSBIsocCommand * command ); + + IOReturn LowLatencyIsocTransaction( IOUSBIsocCommand * command ); + + void FreeCommand( IOUSBCommand * command ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Invokes the specified completion action of the request. If + // the completion action is unspecified, no action is taken. + void Complete( + IOUSBCompletion completion, + IOReturn status, + UInt32 actualByteCount = 0 ); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Invokes the specified completion action of the request. If + // the completion action is unspecified, no action is taken. + void CompleteWithTimeStamp ( + IOUSBCompletionWithTimeStamp completion, + IOReturn status, + UInt32 actualByteCount, + AbsoluteTime timeStamp); + + + + // + // UIM methods + // + +/*! + @function UIMInitialize + @abstract UIM function, initialise the controller and UIM data structures. +*/ + virtual IOReturn UIMInitialize( IOService * provider ) = 0; + +/*! + @function UIMFinalize + @abstract UIM function, finalise the controller and UIM data structures prior to removal. +*/ + virtual IOReturn UIMFinalize() = 0; + + // Control +/*! + @function UIMCreateControlEndpoint + @abstract UIM function, create a control endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param maxPacketSize Maximum packet size of this endpoint + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull +*/ + virtual IOReturn UIMCreateControlEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt16 maxPacketSize, + UInt8 speed) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + void * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + +/*! + @function UIMCreateControlTransfer + @abstract UIM function, Do a transfer on a control endpoint. + This method supercedes the method which takes a void * parameter. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param CBP Memory descriptor describing the buffer to transfer. Will never describe + memory which has disjoint packets. + @param bufferRounding If true, short packets are OK and do not cause an error + @param bufferSize Size of the data to transfer in the data phase. (C + @param direction Specifies direction and PID for transaction. kUSBIn, KUSBOut (DATA PID) or kUSBSetup (SETUP PID). +*/ + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Bulk +/*! + @function UIMCreateBulkEndpoint + @abstract UIM function, create a bulk endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull + @param maxPacketSize Maximum packet size of this endpoint +*/ + virtual IOReturn UIMCreateBulkEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt8 direction, + UInt8 speed, + UInt8 maxPacketSize) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateBulkTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Interrupt +/*! + @function UIMCreateInterruptEndpoint + @abstract UIM function, create an interrupt endpoint for the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param speed speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull + @param maxPacketSize Maximum packet size of this endpoint + @param pollingRate The maximum polling interval from the endpoint descriptor. +*/ + virtual IOReturn UIMCreateInterruptEndpoint( + short functionAddress, + short endpointNumber, + UInt8 direction, + short speed, + UInt16 maxPacketSize, + short pollingRate) = 0; + +/* Note: this function has been superceded. */ + virtual IOReturn UIMCreateInterruptTransfer( short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction) = 0; + + // Isoch +/*! + @function UIMCreateIsochEndpoint + @abstract Create an Isochronous endpoint in the controller. + @param functionNumber The USB device ID of the device for this endpoint + @param endpointNumber The endpoint number for this endpoint + @param maxPacketSize Maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMCreateIsochEndpoint( + short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction) = 0; + +/*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param direction Specifies direction for transfer. kUSBIn or KUSBOut. + @param frameStart The frame number in which to start the transactions + @param pBuffer describes memory buffer. + @param frameCount number of frames to do transactions in + @param pFrames Describes transactions in individual frames, gives sizes and reults for transactions. +*/ + virtual IOReturn UIMCreateIsochTransfer( + short functionAddress, + short endpointNumber, + IOUSBIsocCompletion completion, + UInt8 direction, + UInt64 frameStart, + IOMemoryDescriptor * pBuffer, + UInt32 frameCount, + IOUSBIsocFrame *pFrames) = 0; + +/*! + @function UIMAbortEndpoint + @abstract UIM function Abort the specified endpoint, return all transactions queued on it. + @param functionNumber The USB device ID of the device to Abort + @param endpointNumber The endpoint number to Abort + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMAbortEndpoint( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMDeleteEndpoint + @abstract UIM function Delete the specified endpoint, returning all transactions queued on it. + @param functionNumber The USB device ID of the device to Delete + @param endpointNumber The endpoint number to Delete + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMDeleteEndpoint( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMClearEndpointStall + @abstract UIM function Clear stall on the specified endpoint, set data toggle to zero, + return all transactions queued on it. + @param functionNumber The USB device ID of the device to Clear + @param endpointNumber The endpoint number to Clear + @param direction Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut. +*/ + virtual IOReturn UIMClearEndpointStall( + short functionNumber, + short endpointNumber, + short direction) = 0; + +/*! + @function UIMRootHubStatusChange + @abstract UIM function UIMRootHubStatusChange - This method was internal to the UIM (never called by the superclass) until + IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can + still be used internally only. For subclasses of IOUSBControllerV3, however, the meaning has changed + slightly. Now, it is used to determine if there is a status change on the root hub, and if so, it + needs to update the IOUSBControllerV3 instance variable _rootHubStatusChangedBitmap +*/ + virtual void UIMRootHubStatusChange(void) = 0; + + static const IORegistryPlane *gIOUSBPlane; + +public: + + static IOUSBLog *_log; + + IOCommandGate * GetCommandGate(void); + + /*! + @struct Endpoint + Describes an endpoint of a device. + Simply an easier to use version of the endpoint descriptor. + @field descriptor The raw endpoint descriptor. + @field number Endpoint number + @field direction Endpoint direction: kUSBOut, kUSBIn, kUSBAnyDirn + @field transferType Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt + @field maxPacketSize Maximum packet size for endpoint + @field interval Polling interval in milliseconds (only relevent for Interrupt endpoints) + */ + struct Endpoint { + IOUSBEndpointDescriptor * descriptor; + UInt8 number; + UInt8 direction; // in, out + UInt8 transferType; // cntrl, bulk, isoc, int + UInt16 maxPacketSize; + UInt8 interval; + }; + + // Implements IOService::getWorkLoop const member function + virtual IOWorkLoop * getWorkLoop() const; + + /* + * Root hub methods + * Only of interest to the IOUSBRootHubDevice object + */ +/*! + @function GetRootHubDeviceDescriptor + @abstract UIM function, return the device descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for device descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubDeviceDescriptor( IOUSBDeviceDescriptor *desc ) = 0; + +/*! + @function GetRootHubDescriptor + @abstract UIM function, return the hub descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for hub descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubDescriptor( IOUSBHubDescriptor *desc ) = 0; + +/*! + @function SetRootHubDescriptor + @abstract UIM function, optional. Set the hub descriptor data. + As SET_DESCRIPTOR control request for hub descrptor + @param buffer Descriptor data +*/ + virtual IOReturn SetRootHubDescriptor( OSData *buffer ) = 0; + +/*! + @function GetRootHubConfDescriptor + @abstract UIM function, retrun the configuration descriptor of the simulated root hub device + As GET_DESCRIPTOR control request for configuration descrptor + @param desc Descriptor structure to return data in +*/ + virtual IOReturn GetRootHubConfDescriptor( OSData *desc ) = 0; + +/*! + @function GetRootHubStatus + @abstract UIM function, get the status of the root hub. As GET_STATUS control request to device. + @param status Status structure to return +*/ + virtual IOReturn GetRootHubStatus( IOUSBHubStatus *status ) = 0; + +/*! + @function SetRootHubFeature + @abstract UIM function, set feature of root hub, As SET_FEATURE control request. + @param wValue The feature to set, as would be transferred in wValue field of SETUP packet. +*/ + virtual IOReturn SetRootHubFeature( UInt16 wValue ) = 0; + +/*! + @function ClearRootHubFeature + @abstract UIM function, set feature of root hub, As CLEAR_FEATURE control request. + @param wValue The feature to clear, as would be transferred in wValue field of SETUP packet. +*/ + virtual IOReturn ClearRootHubFeature( UInt16 wValue ) = 0; + +/*! + @function GetRootHubPortStatus + @abstract UIM function, get the status of a root hub port. As GET_STATUS control request to the port. + @param status Status structure to return + @param port Port to get status for. +*/ + virtual IOReturn GetRootHubPortStatus( IOUSBHubPortStatus *status, UInt16 port ) = 0; + +/*! + @function SetRootHubPortFeature + @abstract UIM function, set feature of a root hub port, As SET_FEATURE control request to a port. + @param wValue The feature to set, as would be transferred in wValue field of SETUP packet. + @param port Port to set feature for +*/ + virtual IOReturn SetRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0; + +/*! + @function ClearRootHubPortFeature + @abstract UIM function, clear feature of a root hub port, As CLEAR_FEATURE control request to a port. + @param wValue The feature to clear, as would be transferred in wValue field of SETUP packet. + @param port Port to clear feature for +*/ + virtual IOReturn ClearRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0; + +/*! + @function ClearRootHubPortFeature + @abstract UIM function, Impliments GET_BUS_STATE control request, now obsolete. +*/ + virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0; + +/*! + @function SetHubAddress + @abstract UIM function, set the address of the simulated root hub device, as SET_ADDRESS + @param wValue New address for root hub. +*/ + virtual IOReturn SetHubAddress( UInt16 wValue ) = 0; + + + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBHighSpeed or kUSBLowSpeed + @param endpoint description of endpoint to connect to + */ + virtual IOReturn OpenPipe( USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint ); + /*! + @function closePipe + Close a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ClosePipe( USBDeviceAddress address, + Endpoint * endpoint ); + + // Controlling pipe state + /*! + @function abortPipe + Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn AbortPipe( + USBDeviceAddress address, + Endpoint * endpoint ); + /*! + @function resetPipe + Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ResetPipe( USBDeviceAddress address, + Endpoint * endpoint ); + /*! + @function clearPipeStall + Clear a pipe stall. + @param address Address of the device on the USB bus + @param endpoint description of endpoint + */ + virtual IOReturn ClearPipeStall( USBDeviceAddress address, + Endpoint * endpoint ); + + // Transferring Data + /*! + @function read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion ); + /*! + @function write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion ); + + /*! + @function isocIO + Read from or write to an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn IsocIO( IOMemoryDescriptor * buffer, + UInt64 frameStart, + UInt32 numFrames, + IOUSBIsocFrame * frameList, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBIsocCompletion * completion ); + /*! + @function deviceRequest + Make a control request to the specified endpoint + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + @param address Address of the device on the USB bus + @param epNum endpoint number + */ + virtual IOReturn DeviceRequest( IOUSBDevRequest * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum ); + + virtual IOReturn DeviceRequest( IOUSBDevRequestDesc * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum ); + + /* + * Methods used by the hub driver to initialize a device + */ + /*! + @function AcquireDeviceZero + Get the device zero lock - call this before resetting a device, to ensure there's + only one device with address 0 + */ + virtual IOReturn AcquireDeviceZero( void ); + /*! + @function ReleaseDeviceZero + Release the device zero lock - call this to release the device zero lock, + when there is no longer a device at address 0 + */ + virtual void ReleaseDeviceZero( void ); + + // non-virtual methods + void WaitForReleaseDeviceZero( void ); + IOReturn ConfigureDeviceZero( UInt8 maxPacketSize, UInt8 speed ); + IOReturn GetDeviceZeroDescriptor( IOUSBDeviceDescriptor * desc, UInt16 size ); + IOReturn SetDeviceZeroAddress(USBDeviceAddress address); + IOUSBDevice * MakeDevice(USBDeviceAddress *address); + IOUSBHubDevice * MakeHubDevice(USBDeviceAddress *address); + IOReturn CreateDevice( IOUSBDevice * device, + USBDeviceAddress deviceAddress, + UInt8 maxPacketSize, + UInt8 speed, + UInt32 powerAvailable ); + + /*! + @function GetBandwidthAvailable + Returns the available bandwidth (in bytes) per frame or microframe for + isochronous transfers. + @result maximum number of bytes that a new iso pipe could transfer + per frame given current allocations. + */ + virtual UInt32 GetBandwidthAvailable( void ) = 0; + + /*! + @function GetFrameNumber + Returns the full current frame number. + @result The frame number. + */ + virtual UInt64 GetFrameNumber( void ) = 0; + + /*! + @function GetFrameNumber32 + Returns the least significant 32 bits of the frame number. + @result The lsb 32 bits of the frame number. + */ + virtual UInt32 GetFrameNumber32( void ) = 0; + + // Debugger polled mode + virtual void PollInterrupts( IOUSBCompletionAction safeAction = 0 ) = 0; + + virtual IOReturn PolledRead( + short functionNumber, + short endpointNumber, + IOUSBCompletion completion, + IOMemoryDescriptor * CBP, + bool bufferRounding, + UInt32 bufferSize); + + OSMetaClassDeclareReservedUsed(IOUSBController, 0); + virtual void UIMCheckForTimeouts(void); + + OSMetaClassDeclareReservedUsed(IOUSBController, 1); + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCommand* command, + void* CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction); + + OSMetaClassDeclareReservedUsed(IOUSBController, 2); + virtual IOReturn UIMCreateControlTransfer( short functionNumber, + short endpointNumber, + IOUSBCommand* command, + IOMemoryDescriptor* CBP, + bool bufferRounding, + UInt32 bufferSize, + short direction); + + OSMetaClassDeclareReservedUsed(IOUSBController, 3); +/*! + @function UIMCreateBulkTransfer + @abstract UIM function, Do a transfer on a bulk endpoint. + This method supercedes the method which takes multiple parameters. + @param command paramters for transfer. +*/ + virtual IOReturn UIMCreateBulkTransfer(IOUSBCommand* command); + + OSMetaClassDeclareReservedUsed(IOUSBController, 4); +/*! + @function UIMCreateInterruptTransfer + @abstract UIM function, Do a transfer on an interrupt endpoint. + This method supercedes the method which takes multiple parameters. + @param command paramters for transfer. +*/ + virtual IOReturn UIMCreateInterruptTransfer(IOUSBCommand* command); + + /*! + @function deviceRequest + Make a control request to the specified endpoint + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + @param address Address of the device on the USB bus + @param epNum endpoint number + */ + OSMetaClassDeclareReservedUsed(IOUSBController, 5); + virtual IOReturn DeviceRequest( IOUSBDevRequest * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 6); + virtual IOReturn DeviceRequest( IOUSBDevRequestDesc * request, + IOUSBCompletion * completion, + USBDeviceAddress address, + UInt8 epNum, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + + + OSMetaClassDeclareReservedUsed(IOUSBController, 7); + /*! + @function read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 8); + /*! + @function write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout ); + + // this should really not be using a padding slot, since free is in our superclas, but we shipped this way so now we need to leave it. + OSMetaClassDeclareReservedUsed(IOUSBController, 9); + virtual void free(); + +protected: + +/*! + @function UIMRootHubStatusChange(bool) + @abstract UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until + IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can + still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete + (it still needs to be implemented since it is pure virtual) +*/ + OSMetaClassDeclareReservedUsed(IOUSBController, 10); + virtual void UIMRootHubStatusChange( bool abort ) = 0; + +public: + + OSMetaClassDeclareReservedUsed(IOUSBController, 11); + virtual IOReturn CreateRootHubDevice( IOService * provider, IOUSBRootHubDevice ** rootHubDevice); + + OSMetaClassDeclareReservedUsed(IOUSBController, 12); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn Read( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 13); + /*! + @function Write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been emptied + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn Write( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletion * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 14); + + virtual IOReturn GetRootHubStringDescriptor(UInt8 index, OSData *desc) = 0; + + OSMetaClassDeclareReservedUsed(IOUSBController, 15); + /*! + @function IsocIO + Read from or write to an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param updateFrequency describes how often to update the framelist once the transfer has completed (in ms) + */ + virtual IOReturn IsocIO( IOMemoryDescriptor * buffer, + UInt64 frameStart, + UInt32 numFrames, + IOUSBLowLatencyIsocFrame * frameList, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBLowLatencyIsocCompletion * completion, + UInt32 updateFrequency ); + + OSMetaClassDeclareReservedUsed(IOUSBController, 16); + + /*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param functionNumber The USB device ID of the device to perform the transaction with + @param endpointNumber The endpoint number for the transaction + @param completion Action to perform when I/O completes + @param direction Specifies direction for transfer. kUSBIn or KUSBOut. + @param frameStart The frame number in which to start the transactions + @param pBuffer describes memory buffer. + @param frameCount number of frames to do transactions in + @param pFrames Describes transactions in individual frames, gives sizes and reults for transactions. + @param updateFrequency Describes how often we update the frameList parameters (in ms) + */ + virtual IOReturn UIMCreateIsochTransfer( + short functionAddress, + short endpointNumber, + IOUSBIsocCompletion completion, + UInt8 direction, + UInt64 frameStart, + IOMemoryDescriptor * pBuffer, + UInt32 frameCount, + IOUSBLowLatencyIsocFrame *pFrames, + UInt32 updateFrequency); + + + OSMetaClassDeclareReservedUsed(IOUSBController, 17); + virtual IOReturn CheckForDisjointDescriptor(IOUSBCommand *command, UInt16 maxPacketSize); + + /*! + @function UIMCreateIsochTransfer + @abstract UIM function, Do a transfer on an Isocchronous endpoint. + @param command an IOUSBIsocCommand object with all the necessary information + */ + OSMetaClassDeclareReservedUsed(IOUSBController, 18); + virtual IOReturn UIMCreateIsochTransfer(IOUSBIsocCommand *command); + + // do not use this slot without first checking bug rdar://6022420 + OSMetaClassDeclareReservedUnused(IOUSBController, 19); + +protected: + void IncreaseIsocCommandPool(); + void IncreaseCommandPool(); + void ParsePCILocation(const char *str, int *deviceNum, int *functionNum); + int ValueOfHexDigit(char c); +}; + +#endif /* ! _IOKIT_IOUSBCONTROLLER_H */ + diff --git a/i386/include/IOKit/usb/IOUSBControllerListElement.h b/i386/include/IOKit/usb/IOUSBControllerListElement.h new file mode 100644 index 0000000..7351177 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBControllerListElement.h @@ -0,0 +1,126 @@ +/* + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1998-2007 Apple Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOUSBCONTROLLERLISTELEMENT_H +#define _IOUSBCONTROLLERLISTELEMENT_H + + +#include <libkern/c++/OSObject.h> + +#include <IOKit/IOTypes.h> + +#include <IOKit/usb/USB.h> + + +/*! + @class IOUSBControllerListElement + @abstract Used by the IOUSBController to manage the USB controller lists that are common between EHCI and UHCI. + */ +class IOUSBControllerListElement : public OSObject +{ + OSDeclareDefaultStructors(IOUSBControllerListElement) + +private: + +public: + + virtual void SetPhysicalLink(IOPhysicalAddress next) = 0; + virtual IOPhysicalAddress GetPhysicalLink(void) = 0; + virtual IOPhysicalAddress GetPhysicalAddrWithType(void) = 0; + virtual void print(int level); + + IOPhysicalAddress _sharedPhysical; // phys address of the memory shared with the controller + void * _sharedLogical; // logical address of the above + IOUSBControllerListElement *_logicalNext; // the next element in the list + +}; + + +class IOUSBControllerV2; // needed for a parameter +class IOUSBControllerIsochEndpoint; + +class IOUSBControllerIsochListElement : public IOUSBControllerListElement +{ + OSDeclareDefaultStructors(IOUSBControllerIsochListElement) + +private: + +public: + + virtual void SetPhysicalLink(IOPhysicalAddress next) = 0; + virtual IOPhysicalAddress GetPhysicalLink(void) = 0; + virtual IOPhysicalAddress GetPhysicalAddrWithType(void) = 0; + virtual void print(int level); + + IOUSBControllerIsochEndpoint *_pEndpoint; + IOUSBIsocFrame *_pFrames; + IOUSBIsocCompletion _completion; + Boolean _lowLatency; + bool _requestFromRosettaClient; // True if the request originated from a Rosetta client in user space + UInt8 _framesInTD; // used for HS Isoch only + UInt64 _frameNumber; // frame number for scheduling purposes + UInt32 _frameIndex; // index into the myFrames array + IOUSBControllerIsochListElement *_doneQueueLink; // linkage used by done queue processing + + // pure virtual methods which must be implemented by descendants + virtual IOReturn UpdateFrameList(AbsoluteTime timeStamp) = 0; + virtual IOReturn Deallocate(IOUSBControllerV2 *uim) = 0; +}; + +class IOUSBControllerIsochEndpoint : public OSObject +{ + OSDeclareDefaultStructors(IOUSBControllerIsochEndpoint) + +public: + + virtual bool init(); + + IOUSBControllerIsochEndpoint *nextEP; + IOUSBControllerIsochListElement *toDoList; // ITD or SITD + IOUSBControllerIsochListElement *toDoEnd; // ITD or SITD + IOUSBControllerIsochListElement *doneQueue; // ITD or SITD + IOUSBControllerIsochListElement *doneEnd; // ITD or SITD + IOUSBControllerIsochListElement *deferredQueue; // ITD or SITD + IOUSBControllerIsochListElement *deferredEnd; // ITD or SITD + UInt64 firstAvailableFrame; // next frame available for a transfer on this EP + UInt32 maxPacketSize; + UInt32 activeTDs; // + when added to todo list, - when taken from done queue + UInt32 onToDoList; // + when added to todo list, - when taken from done queue + UInt32 onDoneQueue; // + when added to todo list, - when taken from done queue + volatile SInt32 scheduledTDs; // + when linked onto periodic list, - when unlinked + UInt32 deferredTDs; + UInt32 onProducerQ; + UInt32 onReversedList; + UInt16 inSlot; // where Isoc TDs are being put in the periodic list + short functionAddress; + short endpointNumber; + IOReturn accumulatedStatus; + UInt32 interval; // this is the decoded interval value for HS endpoints and is 1 for FS endpoints + UInt8 direction; + bool aborting; +}; + + +#endif + diff --git a/i386/include/IOKit/usb/IOUSBControllerV2.h b/i386/include/IOKit/usb/IOUSBControllerV2.h new file mode 100644 index 0000000..4d2c306 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBControllerV2.h @@ -0,0 +1,374 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBCONTROLLERV2_H +#define _IOKIT_IOUSBCONTROLLERV2_H + +#include <IOKit/IODMACommand.h> + +#include <IOKit/usb/IOUSBControllerListElement.h> +#include <IOKit/usb/IOUSBController.h> + +enum +{ + kUSBHSHubCommandAddHub = 1, + kUSBHSHubCommandRemoveHub = 2, + + kUSBHSHubFlagsMultiTT = 1 +}; + + +/*! + @class IOUSBControllerV2 + @abstract subclass of the IOUSBController to provide support for high speed + devices and split transactions. + @discussion The IOUSBController class provide sufficient functionality to + work with full (12Mb/s) and low (1.5Mb/s) devices. IOUSBControllerV2 + introduces the support for high (480Mb/s) speed devices from the + USB 2.0 spec. In particular IOUSBControllerV2 indicates the high + speed hub a full or low speed device is attached to so that split + transactions can be directed to the hub at high speed to be forwarded + to the full or low speed device by the hub. + It also gives support for bulk endoints of greater than 256 bytes. +*/ + +class IOUSBControllerV2 : public IOUSBController +{ + OSDeclareAbstractStructors(IOUSBControllerV2) + +protected: + + // These for keeping track of high speed ancestor to allow controller to do splits. + // + UInt8 _highSpeedHub[128]; + UInt8 _highSpeedPort[128]; + + struct V2ExpansionData { + UInt8 _multiTT[128]; + IOUSBCommand *ClearTTCommand; + IOUSBControllerIsochEndpoint *_isochEPList; // linked list of active Isoch "endpoints" + IOUSBControllerIsochEndpoint *_freeIsochEPList; // linked list of freed Isoch EP data structures + thread_call_t _returnIsochDoneQueueThread; + }; + V2ExpansionData *_v2ExpansionData; + + // Super's expansion data + #define _freeUSBCommandPool _expansionData->freeUSBCommandPool + #define _freeUSBIsocCommandPool _expansionData->freeUSBIsocCommandPool + #define _watchdogUSBTimer _expansionData->watchdogUSBTimer + #define _controllerTerminating _expansionData->_terminating + #define _watchdogTimerActive _expansionData->_watchdogTimerActive + #define _busNumber _expansionData->_busNumber + #define _currentSizeOfCommandPool _expansionData->_currentSizeOfCommandPool + #define _currentSizeOfIsocCommandPool _expansionData->_currentSizeOfIsocCommandPool + #define _controllerSpeed _expansionData->_controllerSpeed + #define _activeIsochTransfers _expansionData->_activeIsochTransfers + + // this class's expansion data + #define _isochEPList _v2ExpansionData->_isochEPList + #define _freeIsochEPList _v2ExpansionData->_freeIsochEPList + #define _returnIsochDoneQueueThread _v2ExpansionData->_returnIsochDoneQueueThread + + virtual bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void free(); + + static IOReturn DoCreateEP(OSObject *owner, + void *arg0, void *arg1, + void *arg2, void *arg3); + + static void clearTTHandler( + OSObject * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + +public: + + /*! + @function openPipe + Open a pipe to the specified device endpoint + @param address Address of the device on the USB bus + @param speed of the device: kUSBDeviceSpeedLow, kUSBDeviceSpeedFull or kUSBDeviceSpeedHigh + @param endpoint description of endpoint to connect to + */ + virtual IOReturn OpenPipe( USBDeviceAddress address, + UInt8 speed, + Endpoint * endpoint ); + + /*! + @function CreateDevice + @abstract Create a new device as IOUSBController, making a note of the + high speed hub device ID and port number the full/low speed + device is attached to. + @param newDevice new device object to work with + @param deviceAddress USB device ID + @param maxPacketSize max packet size of endpoint zero + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param powerAvailable power available to the device + @param hub USB ID of hub the device is immediatly attached to. (Not necessarily high speed) + @param port port number of port the device is attached to. +*/ + virtual IOReturn CreateDevice( IOUSBDevice *newDevice, + USBDeviceAddress deviceAddress, + UInt8 maxPacketSize, + UInt8 speed, + UInt32 powerAvailable, + USBDeviceAddress hub, + int port); + +/*! + @function ConfigureDeviceZero + @abstract configure pipe zero of device zero, as IOUSBController, but also keeping + note of high speed hub device is attached to. + @param maxPacketSize max packet size for the pipe + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param hub USB ID of hub the device is immediatly attached to. (Not necessarily high speed) + @param port port number of port the device is attached to. +*/ + virtual IOReturn ConfigureDeviceZero(UInt8 maxPacketSize, UInt8 speed, USBDeviceAddress hub, int port); + +/*! + @function UIMCreateControlEndpoint + @abstract Create an endpoint in the controller to do control transactions. + @param functionNumber USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateControlEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt16 maxPacketSize, + UInt8 speed, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateBulkEndpoint + @abstract Create an endpoint in the controller to do bulk transactions. + @param functionNumber USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param direction Direction of data flow. kUSBIn or kUSBOut + @param maxPacketSize maximum packet size of this endpoint + @param speed speed of the device kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateBulkEndpoint( + UInt8 functionNumber, + UInt8 endpointNumber, + UInt8 direction, + UInt8 speed, + UInt16 maxPacketSize, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateInterruptEndpoint + @abstract Create an endpoint in the controller to do interrupt transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param direction Direction of data flow. kUSBIn or kUSBOut + @param speed speed of the device kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh + @param maxPacketSize maximum packet size of this endpoint + @param pollingRate The maximum polling interval from the endpoint descriptor. + @param highSpeedHub If speed is not kUSBDeviceSpeedHigh, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If speed is not kUSBDeviceSpeedHigh, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateInterruptEndpoint( + short functionAddress, + short endpointNumber, + UInt8 direction, + short speed, + UInt16 maxPacketSize, + short pollingRate, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + +/*! + @function UIMCreateIsochEndpoint + @abstract Create an endpoint in the controller to do Isochronous transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to +*/ + virtual IOReturn UIMCreateIsochEndpoint( + short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction, + USBDeviceAddress highSpeedHub, + int highSpeedPort) = 0; + + + static void ReturnIsochDoneQueueEntry(OSObject *target, thread_call_param_t endpointPtr); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 0); + virtual IOReturn AddHSHub(USBDeviceAddress highSpeedHub, UInt32 flags); + + static IOReturn DOHSHubMaintenance(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 1); + virtual IOReturn UIMHubMaintenance(USBDeviceAddress highSpeedHub, UInt32 highSpeedPort, UInt32 command, UInt32 flags); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 2); + virtual IOReturn RemoveHSHub(USBDeviceAddress highSpeedHub); + + static IOReturn DOSetTestMode(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 3); + virtual IOReturn SetTestMode(UInt32 mode, UInt32 port); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 4); + virtual IOReturn UIMSetTestMode(UInt32 mode, UInt32 port); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 5); + virtual UInt64 GetMicroFrameNumber( void ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 6); + virtual void ClearTT(USBDeviceAddress addr, UInt8 endpt, Boolean IN); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 7); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param address Address of the device on the USB bus + @param endpoint description of endpoint + @param completion describes action to take when buffer has been filled + @param noDataTimeout number of milliseconds of no data movement before the request is aborted + @param completionTimeout number of milliseonds after the command is on the bus in which it must complete + @param reqCount number of bytes requested for the transfer (must not be greater than the length of the buffer) + */ + virtual IOReturn ReadV2( IOMemoryDescriptor * buffer, + USBDeviceAddress address, + Endpoint * endpoint, + IOUSBCompletionWithTimeStamp * completion, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount ); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 8); +/*! + @function UIMCreateIsochEndpoint + @abstract Create an endpoint in the controller to do Isochronous transactions. + @param functionAddress USB device ID of device + @param endpointNumber endpoint address of the endpoint in the device + @param maxPacketSize maximum packet size of this endpoint + @param direction Specifies direction for the endpoint. kUSBIn or KUSBOut. + @param highSpeedHub If non zero, this is a full speed device, the address of the high speed hub to + address split transactions to. + @param highSpeedPort If highSpeedHub is non zero, the hub port to address split transactions to + @param interval The encoded interval value from the endpoint descriptor +*/ + virtual IOReturn UIMCreateIsochEndpoint( short functionAddress, + short endpointNumber, + UInt32 maxPacketSize, + UInt8 direction, + USBDeviceAddress highSpeedHub, + int highSpeedPort, + UInt8 interval); + + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 9); + virtual IOUSBControllerIsochEndpoint* AllocateIsochEP(void); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 10); + virtual IOReturn DeallocateIsochEP(IOUSBControllerIsochEndpoint *pEP); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 11); + virtual IOUSBControllerIsochEndpoint* FindIsochronousEndpoint(short functionNumber, short endpointNumber, short direction, IOUSBControllerIsochEndpoint* *pEDBack); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 12); + virtual IOUSBControllerIsochEndpoint* CreateIsochronousEndpoint(short functionNumber, short endpointNumber, short direction); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 13); + virtual void PutTDonToDoList(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 14); + virtual IOUSBControllerIsochListElement *GetTDfromToDoList(IOUSBControllerIsochEndpoint* pED); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 15); + virtual void PutTDonDeferredQueue(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 16); + virtual IOUSBControllerIsochListElement *GetTDfromDeferredQueue(IOUSBControllerIsochEndpoint* pED); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 17); + virtual void PutTDonDoneQueue(IOUSBControllerIsochEndpoint* pED, IOUSBControllerIsochListElement *pTD, bool checkDeferred); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 18); + virtual IOUSBControllerIsochListElement *GetTDfromDoneQueue(IOUSBControllerIsochEndpoint* pED); + + // 7185026 - this is to make this call from behind the gate + static IOReturn GatedGetTDfromDoneQueue(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 19); + virtual void ReturnIsochDoneQueue(IOUSBControllerIsochEndpoint*); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 20); + virtual IODMACommand *GetNewDMACommand(); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 21); + /*! + @function GetLowLatencyOptionsAndPhysicalMask + @abstract Low Latency transfers require that the client have access to the memory after the Isochronous I/O request has already been scheduled. This might be used, for example to fill in outgoing data "just in time." Some controllers, however, may have requirements which need to be followed in order to make sure that the memory buffer isn't moved after the call is made. This call will return an IOOptionBits and mach_vm_address_t which can be used in a call to IOBufferMemoryDescriptor::inTaskWithPhysicalMask which will help meet these requirements. + @param optionBits Pointer to an an IOOptionBits. The only bit which may be returned is kIOMemoryPhysicallyContiguous. Other bits, e.g. direction bits, must be ORd in by the client as needed. This call replaces the old property based method of obtaining this information. + @param physicalMask Pointer to a mach_vm_address_t which should be used in the call to IOBufferMemoryDescriptor::inTaskWithPhysicalMask and will guarantee that when the memory is wired down it will be accessible by both the client and the USB controller at the same time. + @result returns kIOReturnSuccess if the method is implemented by the controller, otherwise kIOReturnUnsupported + */ + virtual IOReturn GetLowLatencyOptionsAndPhysicalMask(IOOptionBits *optionBits, mach_vm_address_t *physicalMask); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV2, 22); + /*! + @function GetFrameNumberWithTime + @abstract Real Time A/V applications send and receive Iscohronous data scheduled on certain USB frame numbers. The clock for these frame numbers is independent of the system clock, and drivers need to synchronize these two clocks. This routine will return a system time which corresponds to the beginning of a USB frame number. It is not necessarily the currrent frame, but it will be a frame in the recent past (within the past minute). The jitter between the start of the USB frame and the system time will be as low as possible, but due to hardware interrupt latencies could be as high as 200 microseconds. + @param frameNumber A pointer to a UInt64 in which to hold the USB frame number corresponding to the given system time. + @param theTime A pointer to an AbsoluteTime corresponding to the system time at the beginning of the given USB frame number. + @result returns kIOReturnSuccess if the method is implemented by the controller, otherwise kIOReturnUnsupported + */ + virtual IOReturn GetFrameNumberWithTime(UInt64* frameNumber, AbsoluteTime *theTime); + + + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 23); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 24); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 25); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 26); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 27); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 28); + OSMetaClassDeclareReservedUnused(IOUSBControllerV2, 29); + +}; + + +#endif /* ! _IOKIT_IOUSBCONTROLLERV2_H */ diff --git a/i386/include/IOKit/usb/IOUSBControllerV3.h b/i386/include/IOKit/usb/IOUSBControllerV3.h new file mode 100644 index 0000000..22da915 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBControllerV3.h @@ -0,0 +1,233 @@ +/* +* Copyright (c) 2007-2008 Apple Inc. All rights reserved. +* +* @APPLE_LICENSE_HEADER_START@ +* +* The contents of this file constitute Original Code as defined in and +* are subject to the Apple Public Source License Version 1.2 (the +* "License"). You may not use this file except in compliance with the +* License. Please obtain a copy of the License at +* http://www.apple.com/publicsource and read it before using this file. +* +* This Original Code and all software distributed under the License are +* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER +* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +* Please see the License for the specific language governing rights and +* limitations under the License. +* +* @APPLE_LICENSE_HEADER_END@ +*/ + +#ifndef _IOKIT_IOUSBCONTROLLERV3_H +#define _IOKIT_IOUSBCONTROLLERV3_H + +#include <IOKit/pci/IOPCIDevice.h> + +#include <IOKit/usb/IOUSBControllerV2.h> +#include <IOKit/usb/IOUSBHubDevice.h> + +// Constants that define the different power states in the setPowerState call +enum +{ + kUSBPowerStateOff = 0, // controller is reset, nothing is attached + kUSBPowerStateRestart = 1, // same as OFF + kUSBPowerStateSleep = 2, // controller is suspended, preparing to lose main power + kUSBPowerStateLowPower = 3, // controller is suspended, power remains on + kUSBPowerStateOn = 4, // up and running + kUSBNumberBusPowerStates = 5 +}; + +#define kUSBPowerStateStable -1 + +enum +{ + kUSBBusStateReset = 0, // bus is in RESET + kUSBBusStateSuspended = 1, // bus is in SUSPEND mode + kUSBBusStateRunning = 2 // bus is operational +}; + + +// Root Hub things +typedef struct IOUSBRootHubInterruptTransaction +{ + IOMemoryDescriptor * buf; + UInt32 bufLen; + IOUSBCompletion completion; +} IOUSBRootHubInterruptTransaction; + +enum +{ + kIOUSBMaxRootHubTransactions = 2 +}; + + + +/*! + @class IOUSBControllerV3 + @abstract subclass of the IOUSBControllerV2 to provide support for new USB Power Management techniques. + @discussion With Leopard, we are providing more information to USB Device Drivers in the IOPower + tree to allow for more efficient Power Management. This controller class encapulates many of the changes + needed for that, without disturbing third party subclasses of IOUSBController or IOUSBControllerV2 + */ + +class IOUSBControllerV3 : public IOUSBControllerV2 +{ + OSDeclareAbstractStructors(IOUSBControllerV3) + + protected: + // static variable shared by all instances + static uint32_t * _gHibernateState; + + + UInt8 _myBusState; // kUSBBusStateReset, kUSBBusStateSuspended, kUSBBusStateRunning + bool _wakingFromHibernation; // True while the Hibernation Wake thread is active + bool _needToAckPowerDown; // True while we are changing power state due to shutdown/restart + bool _onCardBus; // OBSOLETE + bool _controllerAvailable; // true if we can talk to the controller + SInt32 _powerStateChangingTo; // a power state that we are in the process of changing to, or -1 if we are stable + bool _poweringDown; // true is the controller is powering down because of a systemWillPowerDown message + bool _restarting; // true is the controller is restarting because of a systemWillPowerDown message + unsigned long _myPowerState; // my current state (since getPowerState doesn't always change in time) + IOUSBControllerV3 *_ehciController; // set if I am a companion controller + unsigned long _numPowerStates; // how many power states do I support (defaults to kUSBNumDefaultPowerStates) + IOPMPowerState *_myPowerStates; // my power state array (allocated on the fly) + IOPCIDevice *_device; // my PCI device + + // root hub support + IOTimerEventSource *_rootHubTimer; // timer which fires at the rate of the root hub interrupt endpoint + UInt8 _rootHubPollingRate; // Obsolete -- we need to have it be a uint32_t + UInt8 _rootHubNumPorts; // number of root hub ports - should be 15 or fewer! + UInt16 _rootHubStatusChangedBitmap; // support up to 15 ports for status changes + bool _rootHubTimerActive; // UNUSED + IOUSBRootHubInterruptTransaction _outstandingRHTrans[4]; // Transactions for the Root Hub. We need 2, one for the current transaction and one for the next. This is declared as 4 for binary compatibility + + struct V3ExpansionData { + uint32_t _rootHubPollingRate32; + bool _rootHubTransactionWasAborted; + }; + V3ExpansionData *_v3ExpansionData; + + // IOKit methods + virtual bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ); + virtual unsigned long initialPowerStateForDomainState ( IOPMPowerFlags domainState ); + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn setPowerState( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual void powerChangeDone ( unsigned long fromState); + virtual void systemWillShutdown( IOOptionBits specifier ); + virtual void free(void); + + // IOUSBController methods + // we override these to deal with methods attempting to go through the workloop while we are in sleep + virtual IOReturn AcquireDeviceZero( void ); + virtual void ReleaseDeviceZero( void ); + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout); + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout); + virtual IOReturn ClosePipe(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn AbortPipe(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn ResetPipe(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn ClearPipeStall(USBDeviceAddress address, Endpoint *endpoint); + virtual IOReturn Read(IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount); + virtual IOReturn Write(IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount); + virtual IOReturn IsocIO(IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBIsocCompletion *completion ); + virtual IOReturn IsocIO(IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBLowLatencyIsocCompletion *completion, UInt32 updateFrequency ); + + // IOUSBControllerV2 methods + // we override these to deal with methods attempting to go through the workloop while we are in sleep + virtual IOReturn OpenPipe(USBDeviceAddress address, UInt8 speed, Endpoint *endpoint); + virtual IOReturn AddHSHub(USBDeviceAddress highSpeedHub, UInt32 flags); + virtual IOReturn RemoveHSHub(USBDeviceAddress highSpeedHub); + virtual IOReturn SetTestMode(UInt32 mode, UInt32 port); + virtual IOReturn ReadV2(IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletionWithTimeStamp *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount); + + // IOUSBControllerV3 methods + + // these are called through the workloop + static IOReturn DoEnableAddressEndpoints(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3 ); + static IOReturn DoEnableAllEndpoints(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3 ); + static IOReturn GatedPowerChange(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3 ); + + // also on the workloop + static void RootHubTimerFired(OSObject *owner, IOTimerEventSource *sender); + + // subclassable methods + virtual IOReturn CheckForEHCIController(IOService *provider); + virtual IOReturn AllocatePowerStateArray(void); + virtual IOReturn InitForPM(void); + virtual IOReturn CheckPowerModeBeforeGatedCall(char *fromStr); + virtual IOReturn EnableAllEndpoints(bool enable); + virtual IOReturn EnableBusMastering(bool enable); + virtual IOReturn EnsureUsability(void); + virtual IOReturn CheckForRootHubChanges(void); + virtual IOReturn RootHubQueueInterruptRead(IOMemoryDescriptor *buf, UInt32 bufLen, IOUSBCompletion completion); + virtual IOReturn RootHubAbortInterruptRead(void); + virtual IOReturn RootHubStartTimer(UInt8 pollingRate); // Obsolete see RootHubStartTimer32 + virtual IOReturn RootHubStopTimer(void); + + // these methods have a default implementation using some of the virtual methods below + virtual void ControllerOff(void); + virtual void ControllerRestart(void); + virtual void ControllerSleep(void); + virtual void ControllerDoze(void); + virtual void ControllerOn(void); + + // these methods are pure virtual, and need to be implemented in the subclass driver + virtual IOReturn ResetControllerState(void) = 0; + virtual IOReturn RestartControllerFromReset(void) = 0; + virtual IOReturn SaveControllerStateForSleep(void) = 0; + virtual IOReturn RestoreControllerStateFromSleep(void) = 0; + virtual IOReturn DozeController(void) = 0; + virtual IOReturn WakeControllerFromDoze(void) = 0; + virtual IOReturn UIMEnableAddressEndpoints(USBDeviceAddress address, bool enable) = 0; + virtual IOReturn UIMEnableAllEndpoints(bool enable) = 0; + virtual IOReturn EnableInterruptsFromController(bool enable) = 0; + + public: + + // public methods + virtual IOReturn EnableAddressEndpoints(USBDeviceAddress address, bool enable); + virtual bool IsControllerAvailable(void); + virtual IOReturn HandlePowerChange(unsigned long powerStateOrdinal); + virtual UInt32 AllocateExtraRootHubPortPower(UInt32 extraPowerRequested); + virtual void ReturnExtraRootHubPortPower(UInt32 extraPowerReturned); + + OSMetaClassDeclareReservedUsed(IOUSBControllerV3, 0); + virtual IOReturn RootHubStartTimer32(uint32_t pollingRate); + + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 1); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 2); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 3); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 4); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 5); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 6); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 7); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 8); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 9); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 10); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 11); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 12); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 13); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 14); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 15); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 16); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 17); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 18); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 19); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 20); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 21); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 22); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 23); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 24); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 25); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 26); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 27); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 28); + OSMetaClassDeclareReservedUnused(IOUSBControllerV3, 29); +}; + +#endif // _IOKIT_IOUSBCONTROLLERV3_H \ No newline at end of file diff --git a/i386/include/IOKit/usb/IOUSBDevice.h b/i386/include/IOKit/usb/IOUSBDevice.h new file mode 100644 index 0000000..58d73a0 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBDevice.h @@ -0,0 +1,639 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OPEN_SOURCE__ +/* + * + * $Log: IOUSBDevice.h,v $ + * Revision 1.65 2009/10/18 20:20:37 nano + * Bring in fixes in 390.4.0 QL: 7310698 7301024 7307079 and 7310698 + * + * Revision 1.64.32.4 2009/10/15 21:17:43 nano + * If OverrideAtLocationID does not see a override property, return true + * + * Revision 1.64.32.3.2.1 2009/10/15 21:36:27 nano + * If OverrideAtLocationID does not see a override property, return true + * + * Revision 1.64.32.3 2009/10/14 19:16:15 nano + * Minor name changes + * + * Revision 1.64.32.2 2009/10/14 19:05:21 nano + * 7284477 7293893 Simplify scheme to decide whether we want to override a property for a hub at a particular ID for a particular MacModel. Added a IOUSBDevice API that tells us if we are in the right model and locationID to override a property + * + * Revision 1.64.32.1 2009/10/08 19:55:56 nano + * rdar://7284477 Allow us to overide the config descriptor of a 2514 hub on a K23F + * + * Revision 1.64 2009/09/08 12:28:45 nano + * <rdar://problem/7195788> IOUSBDevice headerdoc comment problem - GetNumConfigs name is wrong, should be GetNumConfigurations + * + * Revision 1.63 2009/05/07 19:43:09 nano + * Move our SnowLeopard branch to TOT + * + * Revision 1.57.84.6 2009/03/13 22:45:11 nano + * Bring in branches to fix 6676089 6675858 6567987 6490273 + * + * Revision 1.57.84.5.4.1 2009/03/11 20:01:56 nano + * rdar://6567987 Do not let a Reset or a ReEnumerate through while the other is executing. + * + * Revision 1.57.84.5 2009/02/26 13:44:32 nano + * Bring in rdar://6536090&6586312 to SL branch + * + * Revision 1.57.84.4.10.1 2009/02/25 00:51:06 rhoads + * change the mechanism of getConfigLock so as to prevent a deadlock + * + * Revision 1.57.84.4 2009/02/13 15:57:33 rhoads + * roll in rdars: 6213394, 6489431, 6513000, 6515115, 6535200, 6567783 + * + * Revision 1.57.84.3.48.3 2009/02/11 19:19:08 rhoads + * add back an expansionData variable to preserve binary compatibility + * + * Revision 1.57.84.3.48.2 2009/02/11 03:05:56 arulchan + * more ::SuspendDevice changes + * + * Revision 1.57.84.3.48.1 2009/01/23 21:34:15 arulchan + * fix for rdar://6213394 + * + * Revision 1.57.84.3 2008/06/16 21:31:16 nano + * Bring in changes from Foxhound 320.2.17 + * + * Revision 1.57.84.2 2008/04/22 22:38:01 nano + * Bring in changes from Foxhound-320.2.9 + * + * Revision 1.60.28.2 2008/05/22 17:36:18 nano + * Fix the reporting of the internal bit for GetDeviceInformation + * + * Revision 1.60.28.1 2008/05/21 17:51:43 nano + * <rdar://problem/5952635> GetDeviceInformation needs some fixes + * + * Revision 1.60 2008/04/18 22:03:28 nano + * Bring in fix for rdar://5874560 + * + * Revision 1.59.4.1 2008/04/18 21:55:55 nano + * <rdar://problem/5874560> Need API to know how much extra power has been allocated + * + * Revision 1.59 2008/04/17 16:56:57 nano + * Bring in branches for rdar://5867990 & rdar://5768343 + * + * Revision 1.58.4.1 2008/04/16 20:26:13 nano + * <rdar://problem/5867990> Add API to allocate sleep current, as well as making sure that we return any extra power if our client dies or our device is terminated without returning it + * + * Revision 1.58 2008/04/14 16:08:38 nano + * Add new APIs for high power and for GetDeviceInformation. + * + * Revision 1.57.126.2 2008/04/13 05:25:40 nano + * Call into PolicyMaker for the GetPortInformation + * + * Revision 1.57.126.1 2008/04/11 22:25:44 nano + * Initial work on new user-client APIs and new IOUSBDevice APIs to return port state information and manage extra power requests, as well as groundwork for calling the policy maker directly from the IOUSBDevice + * + * Revision 1.57 2007/08/07 20:30:36 rhoads + * rolled in a few branches to TOT + * + * Revision 1.56.92.1 2007/08/07 03:43:34 nano + * Bring in more changes for M89 suppport -- like actually use the dang power if the properties are available + * + * Revision 1.56 2007/03/06 12:23:41 rhoads + * roll in 5024412, 5035829, and 5039670 + * + * Revision 1.55.30.1 2007/02/27 16:08:33 rhoads + * some fine tuning of our IOService overrides, including not overriding willTerminate and didTerminate (5024412) + * + * Revision 1.55 2007/01/19 17:58:48 rhoads + * roll in branches for a leopard build + * + * Revision 1.54.30.1 2007/01/17 16:37:02 rhoads + * remove the IOUSBDevice::attach method which is not really useful + * + * Revision 1.54 2006/10/06 04:42:01 rhoads + * roll in branches 4727961, 4758404, 4759810, 4760274, and 4762769 + * + * Revision 1.53.4.1 2006/10/04 16:03:57 rhoads + * better IOUSBHubDevice design + * + */ +#endif + +#ifndef _IOKIT_IOUSBDEVICE_H +#define _IOKIT_IOUSBDEVICE_H + +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBPipe.h> +#include <IOKit/IOBufferMemoryDescriptor.h> +#include <IOKit/IOWorkLoop.h> +#include <IOKit/IOCommandGate.h> + +#include <kern/thread_call.h> + +// The following are definitions for errata properties needed for different devices. This +// should be but in the dictionary of the IOUSBDevice in question. This can be achieved +// by using the AppleUSBMergeNub class and having an IOProviderMergeProperties dictionary +// with the required properties. + +// This property allows a device to specify a configuration value of 0 in its configuration +// descriptor. This does not follow the spec, but we will allow it in order to get the device +// to work. The property should be a Boolean +// +#define kAllowConfigValueOfZero "kAllowZeroConfigValue" +#define kAllowNumConfigsOfZero "kAllowZeroNumConfigs" + + +class IOUSBController; +class IOUSBControllerV2; +class IOUSBInterface; +class IOUSBHubPolicyMaker; +/*! + @class IOUSBDevice + @abstract The IOService object representing a device on the USB bus. + @discussion This class provides functionality to configure a device and to create + IOUSBInterface objects to represent the interfaces of the device. +*/ + +class IOUSBDevice : public IOUSBNub +{ + friend class IOUSBController; + friend class IOUSBControllerV2; + friend class IOUSBInterface; + friend class IOUSBPipe; + + OSDeclareDefaultStructors(IOUSBDevice) + +protected: + + USBDeviceAddress _address; + IOUSBController * _controller; + IOUSBPipe * _pipeZero; + IOUSBDeviceDescriptor _descriptor; + UInt32 _busPowerAvailable; + UInt8 _speed; + IOUSBEndpointDescriptor _endpointZero; // Fake ep for control pipe + void * _port; // Obsolete, do not use + IOBufferMemoryDescriptor** _configList; + IOUSBInterface** _interfaceList; + UInt8 _currentConfigValue; + UInt8 _numInterfaces; + + struct ExpansionData + { + UInt32 _portNumber; + thread_call_t _doPortResetThread; + IOUSBDevice * _usbPlaneParent; + bool _portResetThreadActive; + bool _allowConfigValueOfZero; + thread_call_t _doPortSuspendThread; + bool _portSuspendThreadActive; + thread_call_t _doPortReEnumerateThread; + bool _resetInProgress; + bool _portHasBeenReset; + IORecursiveLock* _XgetConfigLock; // Obsolete + bool _doneWaiting; // Obsolete + bool _notifiedWhileBooting; // Obsolete + IOWorkLoop * _workLoop; + IOTimerEventSource * _notifierHandlerTimer; + UInt32 _notificationType; + bool _suspendInProgress; + bool _portHasBeenSuspendedOrResumed; + bool _addExtraResetTime; + bool _suspendCommand; + IOCommandGate * _commandGate; + OSSet * _openInterfaces; + bool _resetCommand; + IOReturn _resetError; + IOReturn _suspendError; + thread_call_t _doMessageClientsThread; + IOUSBHubPolicyMaker * _hubPolicyMaker; + UInt32 _sleepPowerAllocated; // how much sleep power we already gave to our client + UInt32 _wakePowerAllocated; // how much extra power during wake did we already give our client + UInt32 _devicePortInfo; + bool _deviceIsInternal; // Will be set if all our upstream hubs are captive (internal to the computer) + bool _deviceIsInternalIsValid; // true if we have already determined whether the device is internal + bool _newGetConfigLock; // new lock, taken within the WL gate, when doing a GetConfig + UInt32 _resetAndReEnumerateLock; // "Lock" to prevent us from doing a reset or a re-enumerate while the other one is in progress + UInt32 _locationID; + }; + ExpansionData * _expansionData; + + const IOUSBConfigurationDescriptor *FindConfig(UInt8 configValue, UInt8 *configIndex=0); + + virtual IOUSBInterface * GetInterface(const IOUSBInterfaceDescriptor *interface); + +public: + virtual IOReturn SetFeature(UInt8 feature); + +protected: + virtual IOReturn GetConfigDescriptor(UInt8 configIndex, void *data, UInt32 len); + + virtual IOReturn GetDeviceDescriptor(IOUSBDeviceDescriptor *desc, UInt32 size); + + virtual bool init(USBDeviceAddress deviceAddress, UInt32 powerAvaiable, UInt8 speed, UInt8 maxPacketSize ); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 *score); + +public: + // IOService methods + virtual bool init( void ); + virtual bool start( IOService *provider ); + virtual bool handleIsOpen(const IOService *forClient) const; + virtual bool handleOpen(IOService *forClient, IOOptionBits options, void *arg); + virtual void handleClose(IOService *forClient, IOOptionBits options); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool terminate( IOOptionBits options = 0 ); + virtual bool requestTerminate( IOService * provider, IOOptionBits options ); + virtual void stop( IOService *provider ); + virtual bool finalize(IOOptionBits options); + virtual void free( void ); + + // IOUSBDevice methods + virtual void SetProperties(); + + static IOUSBDevice *NewDevice(void); + + virtual void SetPort(void *port); // Obsolete, do NOT use + + /*! + @function FindNextInterfaceDescriptor + return a pointer to the next interface descriptor within the given full configuration descriptor satisfying the requirements specified, or NULL if there aren't any. + @param configDescIn the configuration descriptor within which to search. obtained from GetFullConfigurationDescriptor(configIndex). use NULL to specify the current configuration's descriptor. + @param intfDesc interface descriptor from which to start the search. NULL for the first interface descriptor in the given configuration descriptor + @param request IOUSBFindInterfaceRequest specifying the desired interface. Not changed. + @param descOut pointer to placeholder for the returned descriptor ptr + @result returns kIOReturnBadArgument if configDesc is not correct, or if configDesc is NULL and the device is not configured, or if intfDesc is not in configDesc. Otherwise returns kIOReturnSuccess or kIOUSBInterfaceNotFound. + */ + virtual IOReturn FindNextInterfaceDescriptor(const IOUSBConfigurationDescriptor *configDescIn, + const IOUSBInterfaceDescriptor *intfDesc, + const IOUSBFindInterfaceRequest *request, + IOUSBInterfaceDescriptor **descOut); + /*! + @function FindNextInterface + return an pointer to an IOUSBInterface object satisfying the requirements specified in request, or NULL if there aren't any. the device + must be configured for there to be any interfaces. + @param current interface to start searching from, NULL to start at the beginning of the device's interface list for the current configuration. + @param request specifies what properties an interface must have to match. + @result Pointer to a matching IOUSBInterface, or NULL if none match. Note: The IOUSBInterface is NOT retained for the caller. If the caller wishes to continue to use the returned object, it should call retain() on that object. + */ + virtual IOUSBInterface *FindNextInterface(IOUSBInterface *current, + IOUSBFindInterfaceRequest *request); + + /*! + @function CreateInterfaceIterator + return an OSIterator to iterate through interfaces satisfying the requirements specified in request. + @param request specifies what properties an interface must have to match. + @result Pointer to an OSIterator. + */ + virtual OSIterator *CreateInterfaceIterator(IOUSBFindInterfaceRequest *request); + + // Get pointer to full config info (cached in device, don't free returned pointer) + /*! + @function GetFullConfigurationDescriptor + return a pointer to all the descriptors for the requested configuration. + @param configIndex The configuration index (not the configuration value) + @result Pointer to the descriptors, which are cached in the IOUSBDevice object. + */ + virtual const IOUSBConfigurationDescriptor *GetFullConfigurationDescriptor(UInt8 configIndex); + + /*! + @function GetConfigurationDescriptor + Copy the specified amount of data for a configuration into the suppled buffer. + @param configValue The configuration value + @param data Buffer to copy data into + @param len number of bytes to copy + */ + virtual IOReturn GetConfigurationDescriptor(UInt8 configValue, void *data, UInt32 len); + + /*! + @function ResetDevice + Reset the device, returning it to the addressed, unconfigured state. + This is useful if a device has got badly confused. Note that the AppleUSBComposite driver will automatically + reconfigure the device if it is a composite device. + */ + virtual IOReturn ResetDevice(); + + /*! + @function SetConfiguration + Do a USB SetConfiguration call to the device. The caller must have the device open() in order to + actually cause a configuration change. If the device is currently configured, all IOUSBInterface objects + associated with the device are freed. After the new configuration has been set, all of its IOUSBInterface objects are + instantiated automatically. + @param forClient The client requesting the configuration change + @param configValue The desired configuration value. + @param startInterfaceMatching A boolean specifying whether IOKit should begin the process of finding + matching drivers for the new IOUSBInterface objects. + */ + virtual IOReturn SetConfiguration(IOService *forClient, UInt8 configValue, bool startInterfaceMatching=true); + + // Access to addressing and cached info + /*! + @function GetAddress + returns the bus address of the device + */ + virtual USBDeviceAddress GetAddress(void); + + /*! + @function GetSpeed + returns the speed of the device + */ + virtual UInt8 GetSpeed(void); + /*! + @function GetBus + returns a pointer to the IOUSBController object for the device + */ + virtual IOUSBController *GetBus(void); + /*! + @function GetBusPowerAvailable + returns the power available to the device, in units of 2mA + */ + virtual UInt32 GetBusPowerAvailable( void ); + /*! + @function GetMaxPacketSize + returns the maximum packet size for endpoint zero (only 8, 16, 32, 64 are valid) + */ + virtual UInt8 GetMaxPacketSize(void); + /*! + @function GetVendorID + returns the Vendor ID of the device + */ + virtual UInt16 GetVendorID(void); + /*! + @function GetProductID + returns the Product ID of the device + */ + virtual UInt16 GetProductID(void); + /*! + @function GetDeviceRelease + returns the DeviceRelease information + */ + virtual UInt16 GetDeviceRelease(void); + /*! + @function GetNumConfigurations + returns the number of configs in the device config descriptor + */ + virtual UInt8 GetNumConfigurations(void); + /*! + @function GetManufacturerStringIndex + returns the index of string descriptor describing manufacturer + */ + virtual UInt8 GetManufacturerStringIndex(void ); + /*! + @function GetProductStringIndex + returns the index of string descriptor describing product + */ + virtual UInt8 GetProductStringIndex(void ); + /*! + @function GetSerialNumberStringIndex + returns the index of string descriptor describing the device's serial number + */ + virtual UInt8 GetSerialNumberStringIndex(void ); + /*! + @function GetPipeZero + returns a pointer to the device's default control pipe + */ + virtual IOUSBPipe * GetPipeZero(void); + + // Deprecated but needed for binary compatibility + virtual IOUSBPipe* MakePipe(const IOUSBEndpointDescriptor *ep); + + // this method is deprecated. use the other DeviceRequest methods + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, + IOUSBCompletion *completion = 0); + + // Same but with a memory descriptor + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, + IOUSBCompletion *completion = 0); + + /*! + @function GetConfiguration + Gets the current configuration from the IOUSBDevice object. Note that this call will send a control + request on the bus to get the current configuration from the physical device. + @param configNum Pointer to place to store configuration value. + */ + virtual IOReturn GetConfiguration(UInt8 *configNumber); + + /*! + @function GetDeviceStatus + Gets the device's status. Note that this sends a control request to the physical device. + @param status Pointer to place to store the status. + */ + virtual IOReturn GetDeviceStatus(USBStatus *status); + + /*! + @function GetStringDescriptor + Get a string descriptor as ASCII, in the specified language (default is US English) + @param index Index of the string descriptor to get. + @param buf Pointer to place to store ASCII string + @param maxLen Size of buffer pointed to by buf + @param lang Language to get string in (default is US English) + */ + virtual IOReturn GetStringDescriptor(UInt8 index, char *buf, int maxLen, UInt16 lang=0x409); + + /*! + @function GetChildLocationID + Get the locationID (UInt32) given the port number and the parent's location + @param parentLocationID locationID for the hub to which this device is attached. + @param port Port number of the hub where this device is attached + */ + virtual UInt32 GetChildLocationID(UInt32 parentLocationID, int port); + + virtual const IOUSBDescriptorHeader* FindNextDescriptor(const void *cur, UInt8 descType); + + virtual void DisplayNotEnoughPowerNotice(); + + // this is a non-virtual function so that we don't have to take up a binary compatibility slot. + UInt16 GetbcdUSB(void); + UInt8 GetProtocol(void); + void SetBusPowerAvailable(UInt32 newPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 0); + /*! + @function DeviceRequest + @abstract execute a control request to the default control pipe (pipe zero) + @param request The parameter block to send to the device + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + + */ + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + /*! + @function DeviceRequest + @abstract execute a control request to the default control pipe (pipe zero) + @param request The parameter block to send to the device (with the pData as an IOMemoryDesriptor) + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + + */ + OSMetaClassDeclareReservedUsed(IOUSBDevice, 1); + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 2); + /*! + @function SuspendDevice + @abstract Instruct the hub to which this device is attached to suspend or resume the port to which the device is attached. + Note that if there are any outstanding transactions on any pipes in the device, those transactions will get returned with a + kIOReturnNotResponding error. + @param suspend Boolean value. true = suspend, false = resume. + */ + virtual IOReturn SuspendDevice( bool suspend); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 3); + /*! + @function ReEnumerateDevice + @abstract Instruct the hub to which this device is attached to reset the port to which this device is attached. This causes the + IOUSBDevice object and any child objects (IOUSBInterface objects or driver objects) to be terminated, and the device to be + completely reenumerated, as if it had been detached and reattached. + @param options Reserved for future use. + */ + virtual IOReturn ReEnumerateDevice( UInt32 options ); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 4); + /*! + @function DisplayUserNotification + @abstract Will use the KUNCUserNotification mechanism to display a notification to the user. + @param notificationType Which notification to display. + */ + virtual void DisplayUserNotification(UInt32 notificationType); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 5); + /*! + @function MakePipe + @abstract build a pipe on a given endpoint + @param ep A description of the endpoint + @param interface The IOUSBInterface object requesting the pipe + returns the desired IOUSBPipe object + */ + virtual IOUSBPipe* MakePipe(const IOUSBEndpointDescriptor *ep, IOUSBInterface *interface); + + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 6); + /*! + @function SetHubParent + @abstract Used by the hub driver to give the nub a pointer to its HubPolicyMaker object + @param hubPolicyMaker The object representing the Hub driver + */ + virtual void SetHubParent(IOUSBHubPolicyMaker *hubParent); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 7); + /*! + @function GetHubParent + @abstract Used by the hub driver to give the nub a pointer to its HubPolicyMaker object + @param hubPolicyMaker The object representing the Hub driver + */ + virtual IOUSBHubPolicyMaker* GetHubParent(); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 8); + /*! + @function GetDeviceInformation + @abstract Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state. + @param requestedPower The desired amount of power that the client wishes to reserve + @result Actual power that was reserved + + */ + virtual IOReturn GetDeviceInformation(UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 9); + /*! + @function RequestExtraPower + @abstract Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA). + @param type Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @param requestedPower Amount of power desired, in mA + @result Amount of power actually reserved, in mA. It can be less than the requested or zero. + + */ + virtual UInt32 RequestExtraPower(UInt32 type, UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 10); + /*! + @function ReturnExtraPower + @abstract Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API. + @param type Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @param returnedPower Amount of power that is no longer needed, in mA + @result If the returnedPower was not previously allocated, an error will be returned. This will include the case for power that was requested for sleep but was returned for wake. + + */ + virtual IOReturn ReturnExtraPower(UInt32 type, UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 11); + /*! + @function GetExtraPowerAllocated + @abstract Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA). + @param type Indicates whether the allocated power was to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake) + @result Amount of power allocated, in mA. + + */ + virtual UInt32 GetExtraPowerAllocated(UInt32 type); + + OSMetaClassDeclareReservedUsed(IOUSBDevice, 12); + /*! + @function DoLocationOverrideAndModelMatch + @abstract Will look for a kOverrideIfAtLocationID array proerty with locationID entries and a "MacModel" property. If any of the locationIDs match to the Mac Model, will return true. + If there is no kOverrideAtLocationID property, it will also return true. + @result True if we have a match, false otherwise + */ + virtual bool DoLocationOverrideAndModelMatch(); + + OSMetaClassDeclareReservedUnused(IOUSBDevice, 13); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 14); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 15); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 16); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 17); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 18); + OSMetaClassDeclareReservedUnused(IOUSBDevice, 19); + +private: + + static void ProcessPortResetEntry(OSObject *target); + void ProcessPortReset(void); + + void TerminateInterfaces(void); + + static void ProcessPortReEnumerateEntry(OSObject *target, thread_call_param_t options); + void ProcessPortReEnumerate(UInt32 options); + + static void DoMessageClientsEntry(OSObject *target, thread_call_param_t messageStruct); + void DoMessageClients( void * messageStructPtr); + + static void DisplayUserNotificationForDeviceEntry (OSObject *owner, IOTimerEventSource *sender); + void DisplayUserNotificationForDevice( ); + + UInt32 SimpleUnicodeToUTF8(UInt16 uChar, UInt8 utf8Bytes[4]); + void SwapUniWords (UInt16 **unicodeString, UInt32 uniSize); + + IOReturn TakeGetConfigLock(void); + IOReturn ReleaseGetConfigLock(void); + static IOReturn ChangeGetConfigLock(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); +}; + +#endif /* _IOKIT_IOUSBDEVICE_H */ diff --git a/i386/include/IOKit/usb/IOUSBHIDDriver.h b/i386/include/IOKit/usb/IOUSBHIDDriver.h new file mode 100644 index 0000000..5e76887 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBHIDDriver.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef IOUSBHIDDRIVER_H +#define IOUSBHIDDRIVER_H + +#include <IOKit/IOBufferMemoryDescriptor.h> + +#include <IOKit/hid/IOHIDDevice.h> + +#include <IOKit/usb/IOUSBBus.h> +#include <IOKit/usb/IOUSBInterface.h> +#include <IOKit/usb/USB.h> + + +#define ENABLE_HIDREPORT_LOGGING 0 + +// Report types from low level USB: +// from USBSpec.h: +// enum { +// kHIDRtInputReport = 1, +// kHIDRtOutputReport = 2, +// kHIDRtFeatureReport = 3 +// }; +// +// from IOHIDDescriptorParser.h: +// // types of HID reports (input, output, feature) +// enum +// { +// kHIDInputReport = 1, +// kHIDOutputReport, +// kHIDFeatureReport, +// kHIDUnknownReport = 255 +// }; +// +// Report types from high level HID Manager: +// from IOHIDKeys.h: +// enum IOHIDReportType +// { +// kIOHIDReportTypeInput = 0, +// kIOHIDReportTypeOutput, +// kIOHIDReportTypeFeature, +// kIOHIDReportTypeCount +// }; +// +#define HIDMGR2USBREPORTTYPE(x) (x + 1) +#define USB2HIDMGRREPORTTYPE(x) (x - 1) + + +// Note: In other Neptune files, kMaxHIDReportSize was defined as 64. But Ferg & Keithen were unable to +// find that value in the USB HID 1.1 specs. Brent had previously changed it to 256 in the OS 9 HID Driver +// to allow for reports spanning multiple packets. 256 may be no more a hard and fast limit, but it's +// working for now in OS 9. +#define kMaxHIDReportSize 256 // Max packet size = 8 for low speed & 64 for high speed. +#define kHIDDriverRetryCount 3 +#define kUSBHIDReportLoggingLevel "USB HID Report Logging Level" + + +// power states for the driver (awake or suspended) +enum +{ + kUSBHIDPowerStateOff = 0, + kUSBHIDPowerStateRestart = 1, + kUSBHIDPowerStateSleep = 2, // this could be system sleep or idle sleep + kUSBHIDPowerStateLowPower = 3, // this is idling + kUSBHIDPowerStateOn = 4, // this is fully on + kUSBHIDNumberPowerStates = 5 +}; + + +/*! + @class IOUSBHIDDriver + @abstract Driver that matches to USB HID devices. + @discussion This class can be overriden to provide for specific behaviors. + */ +class IOUSBHIDDriver : public IOHIDDevice +{ + OSDeclareDefaultStructors(IOUSBHIDDriver) + + IOUSBInterface * _interface; + IOUSBDevice * _device; + IOUSBPipe * _interruptPipe; + UInt32 _maxReportSize; + IOBufferMemoryDescriptor * _buffer; + IOUSBCompletion _completion; + UInt32 _retryCount; + thread_call_t _deviceDeadCheckThread; + thread_call_t _clearFeatureEndpointHaltThread; + bool _deviceDeadThreadActive; + bool _deviceIsDead; // Should really be called "abort expected" + bool _deviceHasBeenDisconnected; + bool _needToClose; + UInt32 _outstandingIO; + IOCommandGate * _gate; + IOUSBPipe * _interruptOutPipe; + UInt32 _locationID; + IOBufferMemoryDescriptor * _outBuffer; // Obsolete + UInt32 _deviceUsage; // Obsolete + UInt32 _deviceUsagePage; // Obsolete + + struct IOUSBHIDDriverExpansionData + { + IOWorkLoop * _workLoop; + thread_call_t _handleReportThread; + IOService * _rootDomain; + AbsoluteTime _wakeUpTime; + IOUSBCompletionWithTimeStamp _completionWithTimeStamp; + bool _checkForTimeStamp; + UInt32 _msToIgnoreTransactionsAfterWake; + IOTimerEventSource * _suspendPortTimer; + bool _portSuspended; + UInt32 _suspendTimeoutInMS; + UInt8 _interfaceNumber; + bool _logHIDReports; + UInt8 _hidLoggingLevel; + bool _needToClearPipeStall; + SInt32 _queuedReports; + AbsoluteTime _interruptTimeStamp; + bool _powerStateChanging; + unsigned long _myPowerState; + bool _pendingRead; + UInt32 _deviceDeadCheckLock; // "Lock" to prevent us from executing the device dead check while in progress + }; + IOUSBHIDDriverExpansionData *_usbHIDExpansionData; + + static void InterruptReadHandlerEntry(OSObject *target, void *param, IOReturn status, UInt32 bufferSizeRemaining); + static void InterruptReadHandlerWithTimeStampEntry(OSObject *target, void *param, IOReturn status, UInt32 bufferSizeRemaining, AbsoluteTime timeStamp); + void InterruptReadHandler(IOReturn status, UInt32 bufferSizeRemaining, AbsoluteTime timeStamp); + + static void CheckForDeadDeviceEntry(OSObject *target); + void CheckForDeadDevice(); + + static void ClearFeatureEndpointHaltEntry(OSObject *target); + void ClearFeatureEndpointHalt(void); + + static void HandleReportEntry(OSObject *target, thread_call_param_t timeStamp); + void HandleReport(AbsoluteTime timeStamp); + + virtual void processPacket(void *data, UInt32 size); // Obsolete + + static IOReturn ChangeOutstandingIO(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn ClaimPendingRead(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + + static void SuspendPortTimer(OSObject *target, IOTimerEventSource *sender); + +public: + + // IOService methods + // + virtual bool init(OSDictionary *properties); + virtual bool start(IOService * provider); + virtual bool didTerminate( IOService * provider, IOOptionBits options, bool * defer ); + virtual bool willTerminate( IOService * provider, IOOptionBits options ); + virtual void stop(IOService * provider); + virtual void free(); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ); + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual void powerChangeDone ( unsigned long fromState); + + + // IOHIDDevice methods + // + virtual bool handleStart(IOService * provider); + virtual void handleStop(IOService * provider); + + virtual IOReturn newReportDescriptor( IOMemoryDescriptor ** descriptor ) const; + + virtual OSString * newTransportString() const; + + virtual OSNumber * newVendorIDNumber() const; + + virtual OSNumber * newProductIDNumber() const; + + virtual OSNumber * newVersionNumber() const; + + virtual OSString * newManufacturerString() const; + + virtual OSString * newProductString() const; + + virtual OSString * newSerialNumberString() const; + + virtual OSNumber * newLocationIDNumber() const; + + virtual OSNumber * newCountryCodeNumber() const; + + virtual IOReturn getReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + + virtual IOReturn setReport( IOMemoryDescriptor * report, + IOHIDReportType reportType, + IOOptionBits options = 0 ); + + // HID driver methods + // + virtual OSString * newIndexedString(UInt8 index) const; + + virtual UInt32 getMaxReportSize(); + + virtual void DecrementOutstandingIO(void); + virtual void IncrementOutstandingIO(void); + virtual IOReturn StartFinalProcessing(); + virtual IOReturn SetIdleMillisecs(UInt16 msecs); + +private: + + IOReturn GetHIDDescriptor(UInt8 inDescriptorType, UInt8 inDescriptorIndex, UInt8 *vOutBuf, UInt32 *vOutSize); + IOReturn GetReport(UInt8 inReportType, UInt8 inReportID, UInt8 *vInBuf, UInt32 *vInSize); + IOReturn SetReport(UInt8 outReportType, UInt8 outReportID, UInt8 *vOutBuf, UInt32 vOutSize); + IOReturn GetIndexedString(UInt8 index, UInt8 *vOutBuf, UInt32 *vOutSize, UInt16 lang = 0x409) const; + IOReturn SetProtocol(UInt32 protocolType); + char GetHexChar(char hexChar); + IOReturn AbortAndSuspend( bool suspend ); + + + +#if ENABLE_HIDREPORT_LOGGING + void LogBufferReport(char *report, UInt32 len); + void LogMemReport(IOMemoryDescriptor * reportBuffer); + char GetHexChar(char hexChar); +#endif + +public: + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 0); + virtual IOReturn RearmInterruptRead(); + + /*! + @function SuspendPort + @abstract Suspends the port for this device or optionally sets a timeout to suspend after a period of inactivity. + @discussion This call can be used to immediately suspend/resume a port or to enable the suspension of the port after a period of inactivity. If called with suspendPort = true (no timeout parameter), the HID driver + will immediately suspend the port, after aborting any outstanding reads on the interrupt pipe. If called with suspendPort = true and timeout != 0, it will suspend the port after the timeout number of ms have + passed without any read completions. If called with suspendPort = false, the port will be immediately resumed and the reads will be re-issued. If a timeout was enabled, it will be cancelled. + @param suspendPort Boolean value. true = suspend the port, false = resume the port. + @param timeoutMS Value in milliseconds If value is non-zero, the port will be suspended after the timeout milliseconds have passed without any read completions. + @result The IOReturn value from the IOUSBDevice::Suspend() call. + */ + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 1); + virtual IOReturn SuspendPort(bool suspendPort, UInt32 timeoutMS = 0); + + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 2); + virtual bool IsPortSuspended(); + + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 3); + virtual void LogMemReport(UInt8 level, IOMemoryDescriptor * reportBuffer, IOByteCount size); + + OSMetaClassDeclareReservedUsed(IOUSBHIDDriver, 4); + virtual IOReturn InitializeUSBHIDPowerManagement(IOService *provider); + + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 5); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 6); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 7); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 8); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 9); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 10); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 11); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 12); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 13); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 14); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 15); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 16); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 17); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 18); + OSMetaClassDeclareReservedUnused(IOUSBHIDDriver, 19); +}; + +#endif // IOUSBHIDDRIVER_H diff --git a/i386/include/IOKit/usb/IOUSBHubDevice.h b/i386/include/IOKit/usb/IOUSBHubDevice.h new file mode 100644 index 0000000..91c728c --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBHubDevice.h @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OPEN_SOURCE__ +/* + * + * $Log: IOUSBHubDevice.h,v $ + * Revision 1.11 2009/09/12 03:42:16 rhoads + * merge in the changes for the 390.3.4b QL + * + * Revision 1.10.52.1 2009/09/10 18:50:52 nano + * <rdar://problem/7134800> Task: Extra Current support for Ibex Peak RMHs -- look for a property that tells us to ask our USB plane parent for the extra current. This will allow the RMH to pass on the request to it's parent. + * + * Revision 1.10 2009/05/07 19:43:09 nano + * Move our SnowLeopard branch to TOT + * + * Revision 1.6.102.3 2008/06/16 22:02:16 nano + * Bring in changes from Foxound 320.2.19 + * + + * Revision 1.6.102.2 2008/04/22 22:38:01 nano + * Bring in changes from Foxhound-320.2.9 + * + * Revision 1.8.62.2 2008/06/06 21:08:44 nano + * Enable dynamic allocation of power for M89, so we don't reserve it if there isn't a high power device attached + * + * Revision 1.8.62.1 2008/06/06 04:14:32 nano + * Fix SleepCurrent allocation so it will work with hub devices and root hub devices as well as consolidating it across all controllers + * + * Revision 1.8 2008/04/17 16:56:57 nano + * Bring in branches for rdar://5867990 & rdar://5768343 + * + * Revision 1.7.4.1 2008/04/17 15:54:07 nano + * Merged PR-5768343 into this branch and fixed a couple of issues + * + * Revision 1.7.2.1 2008/04/16 00:48:49 ferg + * Bug #: 5768343 + * Add support for hubs with high-power downstream port capability. This is + * controlled by the properties "AAPL,current-available" and "AAPL,current-extra". + * + * Revision 1.7 2008/04/14 16:08:38 nano + * Add new APIs for high power and for GetDeviceInformation. + * + * Revision 1.6.144.1 2008/04/11 22:25:44 nano + * Initial work on new user-client APIs and new IOUSBDevice APIs to return port state information and manage extra power requests, as well as groundwork for calling the policy maker directly from the IOUSBDevice + * + * Revision 1.6 2007/08/01 16:10:18 rhoads + * roll in extra power changes + * + * Revision 1.5.118.1 2007/07/27 16:49:10 rhoads + * merge the extra current stuff into Leopard, and add extra sleep current for self powered hubs + * + * Revision 1.5 2007/01/20 00:47:01 rhoads + * roll in Hub Policy Maker changes + * + * Revision 1.4 2006/12/22 23:05:46 rhoads + * roll in branches 4364835 and 4277683-2 + * + * Revision 1.3.20.3 2007/01/15 19:58:07 rhoads + * saving more changes + * + * Revision 1.3.20.2 2007/01/09 21:55:53 rhoads + * commit some stuff to try to fix a permissions issue + * + * Revision 1.3.20.1 2006/12/18 19:13:56 rhoads + * re-integrate the old branch into TOT + * + * Revision 1.3.12.4 2006/12/18 17:33:48 rhoads + * looking good except for sleep/wake + * + * Revision 1.3.12.3 2006/12/08 05:42:40 rhoads + * mostly working + * + * Revision 1.3.12.2 2006/11/14 22:37:06 rhoads + * more changes with the root hubs + * + * Revision 1.3.12.1 2006/11/07 16:55:52 rhoads + * change to get the IOUSBHubDevice nubs into the IOPower tree + * + * Revision 1.3 2006/10/06 04:42:02 rhoads + * roll in branches 4727961, 4758404, 4759810, 4760274, and 4762769 + * + * Revision 1.2.4.2 2006/10/04 23:01:24 rhoads + * better naming + * + * Revision 1.2.4.1 2006/10/04 16:03:57 rhoads + * better IOUSBHubDevice design + * + */ +#endif + + +#ifndef _IOKIT_IOUSBHUBDEVICE_H +#define _IOKIT_IOUSBHUBDEVICE_H + +#include <IOKit/usb/IOUSBDevice.h> // our superclass + +// forward refeference. we don't include the header file because it would cause a circular reference +class IOUSBHubPolicyMaker; + +enum { + kIOUSBHubDeviceIsRootHub = 0x0001, + kIOUSBHubDeviceIsOnHighSpeedBus = 0x0002, + kIOUSBHubDeviceCanSleep = 0x0004 +}; + +/*! + @class IOUSBHubDevice + @abstract New in MAC OS X 10.5. The IOKit object representing a hub device on the USB bus. It is a subclass of IOUSBDevice. + @discussion With the exception of the IOUSBRootHubDevice objects representing the root hubs, every IOUSBDevice + will have an IOUSBHubDevice as its parent in the IOUSB plane. USB KEXT drivers will have the ability to + query this device for characteristics of the hub into which they are connected. This class will also give a dive driver + the abilty to get an IOService* pointing to the hub driver itself, which can then be used as the parent in the power plane. +*/ + +class IOUSBHubDevice : public IOUSBDevice +{ + friend class IOUSBHubPolicyMaker; + friend class AppleUSBHub; + friend class IOUSBController; // for the "can sleep" characteristic + +private: + OSDeclareDefaultStructors(IOUSBHubDevice) + + UInt32 _myCharacteristics; // bitmap of my characteristics + IOUSBHubPolicyMaker *_myPolicyMaker; // pointer to the policy maker in the IOPower tree for this hub + + struct ExpansionData + { + UInt32 _maxPortCurrent; // maximum current in milliamps per downstream port + UInt32 _totalExtraCurrent; // total amount of current above the spec'ed current per port available (during normal operation) + UInt32 _totalSleepCurrent; // total amount of current that can be drawn during sleep + UInt32 _canRequestExtraPower; // If 0, this hub does not support requesting extra power from its parent, non-zero: how much power we need to request in order to give out _extraPowerForPorts + UInt32 _extraPowerForPorts; // Of the power requested from our parent, how much can we parcel out -- the rest is consumed by voltage drop thru the cable + UInt32 _extraPowerAllocated; // Amount of power that we actually got from our parent + bool _requestFromParent; // True if we are to request the extra power from our parent, without modifying the request. Used for RMHs + }; + ExpansionData *_expansionData; + +protected: + // IOUSBHubDevice methods which will be used by the hub driver (which is also the Policy Maker) + virtual void SetPolicyMaker(IOUSBHubPolicyMaker *policyMaker); + virtual void SetHubCharacteristics(UInt32); + virtual bool InitializeCharacteristics(void); // used at start + +public: + // static constructor + static IOUSBHubDevice *NewHubDevice(void); + + // IOKit methods + virtual bool init(); + virtual bool start( IOService * provider ); + virtual void stop( IOService *provider ); + virtual void free(); + + // public IOUSBHubDevice methods + + void SetTotalSleepCurrent(UInt32 sleepCurrent); + UInt32 GetTotalSleepCurrent(); + + /*! + @function GetPolicyMaker + returns a pointer to the policy maker for the hub, which can be used as the power plane parent. + @result returns an IOUSBHubPolicyMaker* pointing to the policy maker for this hub. returns NULL is no policy maker is active on the hub device. + */ + virtual IOUSBHubPolicyMaker *GetPolicyMaker(void); + + /*! + @function GetHubCharacteristics + returns characteristics of the hub device which might be useful for the driver of a device connected to the hub. + kIOUSBHubDeviceIsRootHub indicates that the hub is a root hub + kIOUSBHubDeviceIsOnHighSpeedBus indicates that the hub is running on a High Speed bus. If this bit is set and kIOUSBHubDeviceIsHighSpeed is clear, then this is a Classic Speed hub running on a High Speed bus, which means that Split Transactions will be used to communicate with downstream devices. + + @result returns a bitmap of characteristics + */ + virtual UInt32 GetHubCharacteristics(); + + /*! + @function GetMaxProvidedPower + returns the maximum amount of power available on any downstream port of this hub + @result the power is returned in milliamps - usually 100ma or 500 ma. + */ + virtual UInt32 GetMaxProvidedPower(); + + /*! + @function RequestProvidedPower + requests power from the hub device + @param requestedPower - the amount of power requested in milliamps (usually 100ma or 500 ma) + @result the amount of power allocated for this driver in milliamps (usually 100ma or 500 ma) + */ + virtual UInt32 RequestProvidedPower(UInt32 requestedPower); + + virtual UInt32 RequestExtraPower(UInt32 requestedPower); + + virtual void ReturnExtraPower(UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 0); + + virtual void InitializeExtraPower(UInt32 maxPortCurrent, UInt32 totalExtraCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 1); + virtual UInt32 RequestSleepPower(UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 2); + virtual void ReturnSleepPower(UInt32 returnedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 3); + virtual void SetSleepCurrent(UInt32 sleepCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBHubDevice, 4); + virtual UInt32 GetSleepCurrent(); + + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 5); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 6); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 7); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 8); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 9); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 10); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 11); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 12); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 13); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 14); + OSMetaClassDeclareReservedUnused(IOUSBHubDevice, 15); +}; + +#endif /* _IOKIT_IOUSBROOTHUBDEVICE_H */ + diff --git a/i386/include/IOKit/usb/IOUSBHubPolicyMaker.h b/i386/include/IOKit/usb/IOUSBHubPolicyMaker.h new file mode 100644 index 0000000..a0021d3 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBHubPolicyMaker.h @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __OPEN_SOURCE__ +/* + * + * $Log: IOUSBHubPolicyMaker.h,v $ + * Revision 1.10 2009/05/07 19:43:09 nano + * Move our SnowLeopard branch to TOT + * + * Revision 1.7.72.3 2008/07/23 17:43:32 nano + * <rdar://problem/5939357> IOUSBHIDDriver, IOHIDEventService missing HeaderDoc class declarations + * + * Revision 1.7.72.2 2008/04/22 22:38:01 nano + * Bring in changes from Foxhound-320.2.9 + * + * Revision 1.9 2008/04/17 16:56:57 nano + * Bring in branches for rdar://5867990 & rdar://5768343 + * + * Revision 1.8.4.1 2008/04/16 20:26:15 nano + * <rdar://problem/5867990> Add API to allocate sleep current, as well as making sure that we return any extra power if our client dies or our device is terminated without returning it + * + * Revision 1.8 2008/04/14 16:08:38 nano + * Add new APIs for high power and for GetDeviceInformation. + * + * Revision 1.7.114.1 2008/04/11 22:25:44 nano + * Initial work on new user-client APIs and new IOUSBDevice APIs to return port state information and manage extra power requests, as well as groundwork for calling the policy maker directly from the IOUSBDevice + * + * Revision 1.7 2007/08/17 22:41:11 nano + * Bring in branch that fixes <rdar://problem/5414582> USB not honoring Resume recovery time (hub driver) and adds extra time for iPods + * + * Revision 1.6.30.1 2007/08/16 19:14:02 nano + * ResumeRecovery additions. + * + * Revision 1.6 2007/08/01 16:10:18 rhoads + * roll in extra power changes + * + * Revision 1.5.12.1 2007/07/27 16:49:10 rhoads + * merge the extra current stuff into Leopard, and add extra sleep current for self powered hubs + * + * Revision 1.5 2007/07/20 22:31:22 rhoads + * roll in branch300-3-2 + * + * Revision 1.4.40.1 2007/07/18 18:44:24 rhoads + * this is the 300.3.2g version plus some quieter logs + * + * Revision 1.4.34.2 2007/07/17 06:30:35 rhoads + * more hub chain fixes + * + * Revision 1.4.34.1 2007/07/16 16:45:00 rhoads + * more power management and termination tweaks + * + * Revision 1.4 2007/05/18 01:59:12 rhoads + * roll in 5112084 and 5204170 + * + * Revision 1.3.2.1 2007/05/15 18:23:48 rhoads + * some initial power state bug fixes + * + * Revision 1.3 2007/05/10 22:25:35 rhoads + * roll in branch 5113395 - the last major piece of the new power architecture + * + * Revision 1.2.64.4 2007/04/13 22:34:59 rhoads + * fix restart and shutdown + * + * Revision 1.2.64.3 2007/04/11 23:56:23 rhoads + * first mostly working dozing hub + * + * Revision 1.2.64.2 2007/04/10 02:09:09 rhoads + * got UHCI almost working + * + * Revision 1.2.64.1 2007/04/05 02:57:50 rhoads + * move power management out of AppleUSBHub and into IOUSBHubPolicyMaker + * + * Revision 1.2 2007/01/20 00:47:01 rhoads + * roll in Hub Policy Maker changes + * + * Revision 1.1.2.4 2007/01/18 22:51:08 rhoads + * add some padding + * + * Revision 1.1.2.3 2007/01/15 19:58:07 rhoads + * saving more changes + * + * Revision 1.1.2.2 2007/01/09 23:55:36 rhoads + * working version + * + * Revision 1.1.2.1 2007/01/09 21:57:02 rhoads + * commit some stuff to try to fix a permissions issue + * + * + */ +#endif +#ifndef _IOKIT_IOUSBHUBPOLICYMAKER_H +#define _IOKIT_IOUSBHUBPOLICYMAKER_H + +#include <IOKit/IOService.h> +#include <IOKit/usb/IOUSBController.h> +#include <IOKit/usb/IOUSBHubDevice.h> + + +enum { + kIOUSBHubPowerStateOff = 0, // losing power + kIOUSBHubPowerStateRestart = 1, // reseting bus, but may maintain power + kIOUSBHubPowerStateSleep = 2, // upstream port and all downstream ports suspended (from the top) + kIOUSBHubPowerStateLowPower = 3, // upstream port and all downstream ports suspended (from the bottom) + kIOUSBHubPowerStateOn = 4, // upstream port and at least one downstream port on + kIOUSBHubNumberPowerStates = 5 +}; + +enum { + kHubResumeRecoveryTime = 10, // 10 ms to recover after I resume myself + kPortResumeRecoveryTime = 10 // 10 ms to recover another device +}; + +#define kIOUSBHubPowerStateStable -1 + +/*! + @class IOUSBHubPolicyMaker + @abstract Super class for Hub drivers to incorporate common Power Management code. + */ +class IOUSBHubPolicyMaker : public IOService +{ + OSDeclareAbstractStructors(IOUSBHubPolicyMaker) + +protected: + IOUSBControllerV2 * _bus; + IOUSBHubDevice * _device; // our provider + IOUSBHubDevice * _parentHubDevice; // for non root hub drivers, this is the hub device that my hub device is connected to + bool _isRootHub; // this is a root hub + bool _dozeEnabled; // true if the controller has been enabled to go into doze mode + bool _dontAllowLowPower; // If true, we will not allow the hub to go into low power mode. + bool _dontAllowSleepPower; // If true, we will not allow extra sleep power for a self powered hub. + SInt32 _powerStateChangingTo; // a power state if we are changing to one, or -1 if we are stable + unsigned long _myPowerState; // my current state (since getPowerState doesn't always change in time) + UInt32 _extraPower; // how much extra power we might be able to get from our parent hub + UInt32 _extraPowerRemaining; // how many milliamps we can still give to any one port + UInt32 _hubResumeRecoveryTime; // # of ms that we will wait before issuing any transactions on our port (nominally 10ms) + struct ExpansionData + { + }; + ExpansionData *_expansionData; + +public: + // IOService methods + virtual bool start(IOService * provider); + virtual IOReturn powerStateWillChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual unsigned long powerStateForDomainState ( IOPMPowerFlags domainState ); + virtual IOReturn setPowerState ( unsigned long powerStateOrdinal, IOService* whatDevice ); + virtual IOReturn powerStateDidChangeTo ( IOPMPowerFlags capabilities, unsigned long stateNumber, IOService* whatDevice); + virtual unsigned long maxCapabilityForDomainState ( IOPMPowerFlags domainState ); + virtual void powerChangeDone ( unsigned long fromState ); + + // public methods which MAY be implemented in subclass + virtual IOReturn EnsureUsability(void); + + // Extra Port Power calls + void AllocateExtraPower(); + IOReturn GetExtraPortPower(UInt32 portNum, UInt32 *extraPower); + IOReturn ReturnExtraPortPower(UInt32 portNum, UInt32 extraPower); + + // virtual methods to be implemented in the controlling driver subclass + virtual bool ConfigureHubDriver(void) = 0; + virtual IOReturn HubPowerChange(unsigned long powerStateOrdinal) = 0; + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 0); + virtual IOReturn GetPortInformation(UInt32 portNum, UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 1); + virtual IOReturn ResetPort(UInt32 portNum); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 2); + virtual IOReturn SuspendPort(UInt32 portNum, bool suspend); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 3); + virtual IOReturn ReEnumeratePort(UInt32 portNum, UInt32 options); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 4); + virtual UInt32 RequestExtraPower(UInt32 portNum, UInt32 type, UInt32 requestedPower); + + OSMetaClassDeclareReservedUsed(IOUSBHubPolicyMaker, 5); + virtual IOReturn ReturnExtraPower(UInt32 portNum, UInt32 type, UInt32 returnedPower); + + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 6); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 7); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 8); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 9); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 10); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 11); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 12); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 13); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 14); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 15); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 16); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 17); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 18); + OSMetaClassDeclareReservedUnused(IOUSBHubPolicyMaker, 19); +}; + +#endif _IOKIT_IOUSBHUBPOLICYMAKER_H diff --git a/i386/include/IOKit/usb/IOUSBInterface.h b/i386/include/IOKit/usb/IOUSBInterface.h new file mode 100644 index 0000000..4777e50 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBInterface.h @@ -0,0 +1,264 @@ +/* + * Copyright (c) 1998-2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBINTERFACE_H +#define _IOKIT_IOUSBINTERFACE_H + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBNub.h> +#include <IOKit/usb/IOUSBDevice.h> + +/*! + @class IOUSBInterface + @abstract The object representing an interface of a device on the USB bus. + @discussion This class provides functionality to find the pipes of an interface and + to read the descriptors associated with an interface. When an interface is open()ed, + all its pipes are created +*/ +class IOUSBInterface : public IOUSBNub +{ + friend class IOUSBInterfaceUserClientV2; + + OSDeclareDefaultStructors(IOUSBInterface) + +protected: + IOUSBPipe * _pipeList[kUSBMaxPipes]; + const IOUSBConfigurationDescriptor *_configDesc; + const IOUSBInterfaceDescriptor * _interfaceDesc; + IOUSBDevice * _device; + + // these variable are the parsed interface descriptor + UInt8 _bInterfaceNumber; + UInt8 _bAlternateSetting; + UInt8 _bNumEndpoints; + UInt8 _bInterfaceClass; + UInt8 _bInterfaceSubClass; + UInt8 _bInterfaceProtocol; + UInt8 _iInterface; + + struct ExpansionData { + IOCommandGate *_gate; + IOWorkLoop *_workLoop; + bool _needToClose; + IOLock * _pipeObjLock; // Lock to synchronize accesses to our pipeObjects + }; + ExpansionData * _expansionData; + + // private methods + virtual void ClosePipes(void); // close all pipes (except pipe zero) + virtual IOReturn CreatePipes(void); // open all pipes in the current interface/alt interface + virtual void SetProperties(void); // update my property table with the correct properties + +public: + // static methods + static IOUSBInterface *withDescriptors(const IOUSBConfigurationDescriptor *cfDesc, const IOUSBInterfaceDescriptor *ifDesc); + static IOReturn CallSuperOpen(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static IOReturn CallSuperClose(OSObject *target, void *arg0, void *arg1, void *arg2, void *arg3); + static UInt8 hex2char( UInt8 digit ); + + // IOService methods + virtual bool start(IOService * provider); + virtual bool handleOpen(IOService *forClient, IOOptionBits options = 0, void *arg = 0 ); + virtual bool open(IOService *forClient, IOOptionBits options = 0, void *arg = 0 ); + virtual void close(IOService *forClient, IOOptionBits options = 0); + virtual void handleClose(IOService *forClient, IOOptionBits options = 0); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + virtual bool finalize(IOOptionBits options); + virtual void stop(IOService * provider); + virtual bool terminate( IOOptionBits options = 0 ); + virtual void free(); + + // IOUSBInterface class methods + virtual bool init( const IOUSBConfigurationDescriptor *cfDesc, + const IOUSBInterfaceDescriptor *ifDesc); + /*! + @function FindNextAltInterface + return alternate interface descriptor satisfying the requirements specified in request, or NULL if there aren't any. + request is updated with the properties of the returned interface. + @param current interface descriptor to start searching from, NULL to start at alternate interface 0. + @param request specifies what properties an interface must have to match. + @result Pointer to a matching interface descriptor, or NULL if none match. + */ + virtual const IOUSBInterfaceDescriptor *FindNextAltInterface(const IOUSBInterfaceDescriptor *current, + IOUSBFindInterfaceRequest *request); + + /*! + @function FindNextPipe + Find a pipe of the interface that matches the requirements, either + starting from the beginning of the interface's pipe list or from a specified + pipe. + @param current Pipe to start searching from, NULL to start from beginning of list. + @param request Requirements for pipe to match, updated with the found pipe's + properties. + @result Pointer to the pipe, or NULL if no pipe matches the request. + */ + virtual IOUSBPipe *FindNextPipe(IOUSBPipe *current, IOUSBFindEndpointRequest *request); + + /*! + @function FindNextAssociatedDescriptor + Find the next descriptor of the requested type associated with the interface. + @param current Descriptor to start searching from, NULL to start from beginning of list. + @param type Descriptor type to search for, or kUSBAnyDesc to return any descriptor type. + @result Pointer to the descriptor, or NULL if no matching descriptors found. + */ + virtual const IOUSBDescriptorHeader * FindNextAssociatedDescriptor(const void *current, UInt8 type); + + /*! + @function SetAlternateInterface + Select the specified alternate interface. + @param forClient The client requesting the alternate setting. This client must have the interface open in order to perform the request. + @param alternateSetting Alternate setting (from the alternate interface's interface descriptor). + @result exclusive access error if the interface is not open. otherwise the result of the transaction + */ + virtual IOReturn SetAlternateInterface(IOService *forClient, UInt16 alternateSetting); + + /*! + @function GetPipeObj + returns a handle to the pipe at the corresponding index + @param index value from zero to kUSBMaxPipes-1 + @result The IOUSBPipe object. Note that the client does not own a reference to this pipe, so the client should retain() the IOUSBPipe object if necessary. + */ + virtual IOUSBPipe *GetPipeObj(UInt8 index); + /*! + @function GetConfigValue + returns the device configuration value for the interface + @result The device configuration value. + */ + virtual UInt8 GetConfigValue(); + /*! + @function GetDevice + returns the device the interface is part of. + @result Pointer to the IOUSBDevice object which is the parent of this IOUSBInterface object. + */ + virtual IOUSBDevice *GetDevice(); + /*! + @function GetInterfaceNumber + returns the zero based value identifying the index in the array of concurrent + interfaces supported by the current configuration + @result the interface index + */ + virtual UInt8 GetInterfaceNumber(); + /*! + @function GetAlternateSetting + returns the alternate setting for this interface. + @result the alternate setting + */ + virtual UInt8 GetAlternateSetting(); + /*! + @function GetNumEndpoints + returns the number of endpoints used by this interface (excluding + device endpoint zero. If the value is zero, this interface only + uses endpoint zero. + @result the number of endpoints + */ + virtual UInt8 GetNumEndpoints(); + /*! + @function GetInterfaceClass + returns the class code for this interface (assigned by the USB) + a value of zero is reserved + if the value is FFh, the interface class is vendor-specific + all other values are reserved for assignment by the USB + @result the interface class + */ + virtual UInt8 GetInterfaceClass(); + /*! + @function GetInterfaceSubClass + returns the subclass code (assigned by the USB). + These codes are qualified by the value returned by GetInterfaceClass + @result the interface subclass + */ + virtual UInt8 GetInterfaceSubClass(); + /*! + @function GetInterfaceProtocol + returns the protocol code (assigned by the USB). + @result the interface index + */ + virtual UInt8 GetInterfaceProtocol(); + /*! + @function GetInterfaceStringIndex + returns the index of the string descriptor describing the interface + @result the string index + */ + virtual UInt8 GetInterfaceStringIndex(); + + /*! + @function DeviceRequest + @abstract Sends a control request to the default control pipe in the device (pipe zero) + @param request The parameter block to send to the device + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + */ + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion = 0); + + /*! + @function DeviceRequest + @abstract Sends a control request to the default control pipe in the device (pipe zero) + @param request The parameter block to send to the device (with the pData as an IOMemoryDesriptor) + @param completion Function to call when request completes. If omitted then + DeviceRequest() executes synchronously, blocking until the request is complete. If the request is asynchronous, the client must make sure that + the IOUSBDevRequest is not released until the callback has occurred. + */ + virtual IOReturn DeviceRequest(IOUSBDevRequestDesc *request, IOUSBCompletion *completion = 0); + + virtual bool matchPropertyTable(OSDictionary * table, SInt32 *score); + + OSMetaClassDeclareReservedUsed(IOUSBInterface, 0); + /*! + @function GetEndpointProperties + @abstract Returns the properties of an endpoint, possibly in an alternate interface. + @param alternateSetting specifies the desired alternate setting + @param endpointNumber specifies the endpoint number + @param direction specifies the direction (kUSBIn, kUSBOut) + @param transferType a pointer to hold the transfer type (kUSBControl, kUSBBulk, etc.) of the endpoint if found. + @param maxPacketSize a pointer to hold the maxPacketSize in the endpoint descriptor. + @param interval a pointer to hold the interval value in the endpoint descriptor. + @result returns kIOReturnSuccess if the endpoint is found, and kIOUSBEndpointNotFound if it is not. + */ + virtual IOReturn GetEndpointProperties(UInt8 alternateSetting, UInt8 endpointNumber, UInt8 direction, UInt8 *transferType, UInt16 *maxPacketSize, UInt8 *interval); + + OSMetaClassDeclareReservedUnused(IOUSBInterface, 1); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 2); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 3); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 4); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 5); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 6); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 7); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 8); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 9); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 10); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 11); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 12); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 13); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 14); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 15); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 16); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 17); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 18); + OSMetaClassDeclareReservedUnused(IOUSBInterface, 19); +}; + +#endif /* _IOKIT_IOUSBINTERFACE_H */ diff --git a/i386/include/IOKit/usb/IOUSBLog.h b/i386/include/IOKit/usb/IOUSBLog.h new file mode 100644 index 0000000..7f8f2a3 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBLog.h @@ -0,0 +1,240 @@ +/* + * Copyright 1998-20010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBLOG_H +#define _IOKIT_IOUSBLOG_H + +#include <IOKit/IOService.h> +#include <IOKit/IOLib.h> + + +#ifdef __cplusplus + extern "C" { +#endif + +// USB Specific defines +#define USBLog( LEVEL, ARGS...) KernelDebugLogTag( LEVEL, 'USBF', ## ARGS ) +#define USBError( LEVEL, ARGS...) KernelDebugLogInternal( ( LEVEL ), 'USBF', ## ARGS ) +#define USBStringFromReturn( IORETURN) (IOUSBController::_log)->stringFromReturn( IORETURN ) + + +// Possible Debug levels. If DEBUG_LEVEL is set to DEBUG_LEVEL_PRODUCTION, all debug logs will be +// stripped of the final code. + +#define DEBUG_LEVEL_PRODUCTION 0 +#define DEBUG_LEVEL_DEVELOPMENT 1 +#define DEBUG_LEVEL_ALPHA 2 +#define DEBUG_LEVEL_BETA 3 +#define DEBUG_LEVEL_FINAL DEBUG_LEVEL_PRODUCTION + +// Allow clients to define their own debug level. + +#if ( !defined( DEBUG_LEVEL ) ) + #define DEBUG_LEVEL DEBUG_LEVEL_PRODUCTION +#endif + +// Index for user client methods +// +enum +{ + kUSBControllerUserClientOpen = 0, + kUSBControllerUserClientClose, + kUSBControllerUserClientEnableLogger, + kUSBControllerUserClientSetDebuggingLevel, + kUSBControllerUserClientSetDebuggingType, + kUSBControllerUserClientGetDebuggingLevel, + kUSBControllerUserClientGetDebuggingType, +#ifndef __OPEN_SOURCE__ + kUSBControllerUserClientSetTestMode, + kUSBControllerUserClientReadRegister, + kUSBControllerUserClientWriteRegister, + kUSBControllerUserClientMessageController, +#endif + kNumUSBControllerMethods +}; + +#ifndef __OPEN_SOURCE__ +// Enums for the private kIOUSBMessageController message +enum +{ + kIOUSBMessageControllerDoGPIOReset = 0x00000001 +}; +#endif + +// Info Debug Output Types. + +typedef UInt32 KernelDebuggingOutputType; +enum +{ + kKernelDebugOutputIOLogType = 0x00000001, + kKernelDebugOutputKextLoggerType = 0x00000002 +}; + + +// Info Debug levels. + +typedef UInt32 KernelDebugLevel; +enum +{ + kKernelDebugInfoLevel = 1000, + kKernelDebugRareInfoLevel = 2000, + kKernelDebugAllowedErrorLevel = 3000, + kKernelDebugAssertLevel = 4000, + kKernelDebugRequireLevel = 5000, + kKernelDebugErrorLevel = 6000, + kKernelDebugCriticalErrorLevel = 7000, + kKernelDebugTragicErrorLevel = 8000, + kKernelDebugAnyLevel = 0 +}; + +// Function prototypes. + +void KernelDebugSetLevel( KernelDebugLevel inLevel ); +KernelDebugLevel KernelDebugGetLevel(); +void KernelDebugSetOutputType( KernelDebuggingOutputType inType ); +KernelDebuggingOutputType KernelDebugGetOutputType(); +IOReturn KernelDebugFindKernelLogger(); +void KernelDebugEnable( bool enable ); + +// Yes, you can call this directly. But, why? If you use the macros declared below, such as +// KernelIOLog, you get the benefit of having your logs compiled out when you set the +// DEBUG_LEVEL to production mode and recompile. Dude. Sweet. What's mine say? + +void KernelDebugLogInternal( KernelDebugLevel inLevel, UInt32 inTag, char const *inFormatString, ... ) __attribute__ ((format(printf,3,4)));; +void KernelDebugLogDataInternal( UInt32 inLevel, UInt32 inTag, void *buffer, UInt32 byteCount, bool preBuffer); + +// Handy macros. + +#define REQUIRE_NO_ERR_PRINTF( VALUE, LABEL, ARGS... ) \ + if ( VALUE != kIOReturnSuccess ) \ + { \ + KernelDebugLogInternal( kDebugInfoLevel, 'BluD', ## ARGS ); \ + goto LABEL; \ + } + +#define REQUIRE_PRINTF( TEST, LABEL, ARGS... ) \ + do \ + { \ + if ( !( TEST ) ) \ + { \ + KernelDebugLogInternal( kDebugInfoLevel, 'BluD', ## ARGS ); \ + goto LABEL; \ + } \ + } while( false ) + +// Some macros to call the debugging outputs. We'll strip out the debug logs if we are production code. + +#if DEBUG_LEVEL != DEBUG_LEVEL_PRODUCTION +#define KernelDebugLog( LEVEL, ARGS... ) KernelDebugLogInternal( ( LEVEL ), 'KDbg', ## ARGS ) __attribute__ ((format(printf,1,2))); + #define KernelDebugLogTag( LEVEL, TAG, ARGS... ) KernelDebugLogInternal( ( LEVEL ), ( TAG ), ## ARGS ) + #define KernelDebugLogData( LEVEL, TAG, BUFFER, SIZE, HOLD) KernelDebugLogDataInternal( ( LEVEL ), ( TAG ), ( BUFFER ), ( SIZE ), ( HOLD )) +#else + #define KernelDebugLog( LEVEL, ARGS... ) + #define KernelDebugLogTag( LEVEL, TAG, ARGS... ) + #define KernelDebugLogData( LEVEL, TAG, BUFFER, SIZE, HOLD) +#endif + + +#ifdef __cplusplus + } + +//================================================================================================ +// Forward declarations +//================================================================================================ +class com_apple_iokit_KLogClient; + +//================================================================================================ +// Defines +//================================================================================================ +#define kLogKextName "com_apple_iokit_KLog" +#define MAXUSERS 5 + +//================================================================================================ +// Custom Types +//================================================================================================ + +typedef UInt32 KLogLevel; +typedef UInt32 KLogTag; + +//================================================================================================ +// com_apple_iokit_KLog +//================================================================================================ + +class com_apple_iokit_KLog : public IOService +{ + + OSDeclareDefaultStructors(com_apple_iokit_KLog) + + com_apple_iokit_KLogClient * mClientPtr[MAXUSERS+1]; + + unsigned char * mMsgBuffer; + UInt8 mClientCount; + UInt8 mMsgSize; + bool mErrFlag; + struct timeval * mTimeVal; + IOLock * mLogLock; + +public: + + static com_apple_iokit_KLog * logger; + + virtual bool init(OSDictionary *dictionary = 0); + virtual void free(void); + + virtual IOService * probe(IOService *provider, SInt32 *score); + virtual bool start(IOService *provider); + virtual void stop(IOService *provider); + virtual IOReturn newUserClient( task_t owningTask, void * securityID, + UInt32 type, IOUserClient ** handler ); + + virtual SInt8 Log( KLogLevel level, KLogTag tag, const char *format, ... ); + virtual SInt8 vLog( KLogLevel level, KLogTag tag, const char *format, va_list in_va_list ); + + void closeChild(com_apple_iokit_KLogClient *ptr); + void setErr(bool set); + +}; + +#define kMaxStatusBufSize (8*1024) + + +class IOUSBLog : public IOService +{ + OSDeclareAbstractStructors(IOUSBLog) + +private: +public: + virtual bool init( OSDictionary * dictionary = 0 ); + virtual const char * stringFromReturn( IOReturn rtn ); + static IOUSBLog *usblog(); + virtual void AddStatusLevel (UInt32 level, UInt32 ref, char *status, UInt32 value); + virtual void AddStatus(char *message); + virtual void AddStatus(UInt32 level, char *message); + virtual void USBLogPrintf(UInt32 level, char *format,...); + virtual char * strstr(const char *in, const char *str); +}; + + +#endif +#endif /* ! _IOKIT_IOUSBLOG_H */ + diff --git a/i386/include/IOKit/usb/IOUSBMassStorageClass.h b/i386/include/IOKit/usb/IOUSBMassStorageClass.h new file mode 100644 index 0000000..02c8557 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBMassStorageClass.h @@ -0,0 +1,507 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOUSBMASSSTORAGECLASS_H +#define _IOKIT_IOUSBMASSSTORAGECLASS_H + +// Headers for general IOKit definitions +#include <IOKit/IOLib.h> +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> +#include <IOKit/IOMessage.h> + +// Headers for USB specific definitions +#include <IOKit/usb/IOUSBInterface.h> +#include <IOKit/usb/IOUSBPipe.h> +#include <IOKit/usb/USBSpec.h> +#include <IOKit/usb/USB.h> + +// Headers for SCSI Protocol support definitions +#include <IOKit/scsi/IOSCSIProtocolServices.h> + +// BSD includes +#include <sys/sysctl.h> + +#define UNUSED(x) ((void)x) + + +#pragma mark - +#pragma mark Vendor Specific Device Support +#define kIOUSBMassStorageCharacteristics "USB Mass Storage Characteristics" +#define kIOUSBMassStoragePreferredSubclass "Preferred Subclass" +#define kIOUSBMassStoragePreferredProtocol "Preferred Protocol" +#define kIOUSBMassStorageResetOnResume "Reset On Resume" +#define kIOUSBMassStorageUseStandardUSBReset "Use Standard USB Reset" +#define kIOUSBKnownCSWTagIssues "Known CSW Tag Issues" +#define kIOUSBMassStorageMaxLogicalUnitNumber "Max Logical Unit Number" +#define kIOPropertyIOUnitKey "IOUnit" +#define kIOUSBMassStorageDoNotMatch "Do Not Match MSC" +#define kIOUSBMassStorageDoNotOperate "Do Not Operate" +#define kIOUSBMassStorageEnableSuspendResumePM "Enable Port Suspend-Resume PM" + +enum +{ + kUSBDAddressLength = 10 +}; + +#pragma mark - +#pragma mark CBI Protocol Strutures +// Structure for the global PB's +struct CBIRequestBlock +{ + SCSITaskIdentifier request; + IOUSBDevRequest cbiDevRequest; + SCSICommandDescriptorBlock cbiCDB; + IOUSBCompletion cbiCompletion; + UInt32 currentState; + IOMemoryDescriptor * cbiPhaseDesc; + UInt8 cbiGetStatusBuffer[2]; // 2 bytes as specified in the USB spec +}; + +typedef struct CBIRequestBlock CBIRequestBlock; + +#pragma mark - +#pragma mark Bulk Only Protocol Structures + +struct StorageBulkOnlyCBW +{ + UInt32 cbwSignature; + UInt32 cbwTag; + UInt32 cbwTransferLength; + UInt8 cbwFlags; + UInt8 cbwLUN; // Bits 0-3: LUN, 4-7: Reserved + UInt8 cbwCDBLength; // Bits 0-4: CDB Length, 5-7: Reserved + UInt8 cbwCDB[16]; +}; + +typedef struct StorageBulkOnlyCBW StorageBulkOnlyCBW; + +struct StorageBulkOnlyCSW +{ + UInt32 cswSignature; + UInt32 cswTag; + UInt32 cswDataResidue; + UInt8 cswStatus; +}; + +typedef struct StorageBulkOnlyCSW StorageBulkOnlyCSW; + +struct BulkOnlyRequestBlock +{ + SCSITaskIdentifier request; + IOUSBCompletion boCompletion; + UInt32 currentState; + StorageBulkOnlyCBW boCBW; + StorageBulkOnlyCSW boCSW; + IOMemoryDescriptor * boPhaseDesc; + UInt8 boGetStatusBuffer[2]; // 2 bytes as specified in the USB spec +}; + +typedef struct BulkOnlyRequestBlock BulkOnlyRequestBlock; + + +#pragma mark - +#pragma mark IOUSBMassStorageClass definition + +class IOUSBMassStorageClass : public IOSCSIProtocolServices +{ + OSDeclareDefaultStructors(IOUSBMassStorageClass) + +private: + // ---- Member variables used by all protocols ---- + // The interface object that provides the driver with access to the + // USB so that it may talk to its device. + IOUSBInterface * fInterface; + + // The pipe objects that the driver uses to transport data through a + // pipe to the appropriate endpoint. + IOUSBPipe * fBulkInPipe; + IOUSBPipe * fBulkOutPipe; + IOUSBPipe * fInterruptPipe; + IOUSBDevRequest fUSBDeviceRequest; + UInt8 fPreferredSubclass; + UInt8 fPreferredProtocol; + + // The maximum Logical Unit Number. This is the highest valid LUN + // that the USB device supports, so if the device only supports one + // LUN, such as CBI and CB, this number will be zero. + UInt8 fMaxLogicalUnitNumber; + + // ---- Member variables used by CBI protocol ---- + bool fCBICommandStructInUse; + + CBIRequestBlock fCBICommandRequestBlock; + + // ---- Member variables used by Bulk Only protocol ---- + // Command tag, this driver just uses a sequential counter that is + // incremented for each CBW that is sent to the device. + UInt32 fBulkOnlyCommandTag; + + bool fBulkOnlyCommandStructInUse; + + // Dedicated CBW and CSW IOMemoryDescriptors are listed in the ExpansionData struct. + + // The Request block that contains all the necessary data for + // transporting a Bulk Only request across the USB. + BulkOnlyRequestBlock fBulkOnlyCommandRequestBlock; + +protected: + // Reserve space for future expansion. + struct ExpansionData + { + bool fResetInProgress; + OSSet * fClients; + IOUSBPipe * fPotentiallyStalledPipe; + bool fUseUSBResetNotBOReset; + bool fAbortCurrentSCSITaskInProgress; + IOMemoryDescriptor * fCBIMemoryDescriptor; + IOMemoryDescriptor * fBulkOnlyCBWMemoryDescriptor; + IOMemoryDescriptor * fBulkOnlyCSWMemoryDescriptor; + bool fDeviceAttached; + bool fWaitingForReconfigurationMessage; + bool fTerminating; + bool fKnownCSWTagMismatchIssues; + bool fPortSuspendResumeForPMEnabled; + bool fPortIsSuspended; + bool fRequiresResetOnResume; + bool fAutonomousSpinDownWorkAround; + UInt8 fConsecutiveResetCount; + bool fClearStallInProgress; /* OBSOLETE */ + bool fTerminationDeferred; + }; + ExpansionData * reserved; + + #define fResetInProgress reserved->fResetInProgress + #define fClients reserved->fClients + #define fPotentiallyStalledPipe reserved->fPotentiallyStalledPipe + #define fUseUSBResetNotBOReset reserved->fUseUSBResetNotBOReset + #define fAbortCurrentSCSITaskInProgress reserved->fAbortCurrentSCSITaskInProgress + #define fCBIMemoryDescriptor reserved->fCBIMemoryDescriptor + #define fBulkOnlyCBWMemoryDescriptor reserved->fBulkOnlyCBWMemoryDescriptor + #define fBulkOnlyCSWMemoryDescriptor reserved->fBulkOnlyCSWMemoryDescriptor + #define fDeviceAttached reserved->fDeviceAttached + #define fWaitingForReconfigurationMessage reserved->fWaitingForReconfigurationMessage + #define fTerminating reserved->fTerminating + #define fKnownCSWTagMismatchIssues reserved->fKnownCSWTagMismatchIssues + #define fPortSuspendResumeForPMEnabled reserved->fPortSuspendResumeForPMEnabled + #define fPortIsSuspended reserved->fPortIsSuspended + #define fRequiresResetOnResume reserved->fRequiresResetOnResume + #define fAutonomousSpinDownWorkAround reserved->fAutonomousSpinDownWorkAround + #define fConsecutiveResetCount reserved->fConsecutiveResetCount + #define fClearStallInProgress reserved->fClearStallInProgress + #define fTerminationDeferred reserved->fTerminationDeferred + + // Enumerated constants used to control various aspects of this + // driver. + + // Enumerations for Mass Storage Class Subclass types + enum + { + kUSBStorageRBCSubclass = 1, + kUSBStorageSFF8020iSubclass = 2, + kUSBStorageQIC157Subclass = 3, + kUSBStorageUFISubclass = 4, + kUSBStorageSFF8070iSubclass = 5, + kUSBStorageSCSITransparentSubclass = 6 + }; + + // The supported USB Mass Storage Class transport protocols. + enum + { + kProtocolControlBulkInterrupt = 0x00, + kProtocolControlBulk = 0x01, + kProtocolBulkOnly = 0x50 + }; + + // ------- Protocol support functions ------------ + // The SendSCSICommand function will take a SCSITask Object and transport + // it across the physical wire(s) to the device + virtual bool SendSCSICommand( + SCSITaskIdentifier request, + SCSIServiceResponse * serviceResponse, + SCSITaskStatus * taskStatus ); + + // The AbortSCSICommand function will abort the indicated SCSITask object, + // if it is possible and the SCSITask has not already completed. + virtual SCSIServiceResponse AbortSCSICommand( SCSITaskIdentifier abortTask ); + + virtual bool IsProtocolServiceSupported( + SCSIProtocolFeature feature, + void * serviceValue ); + + virtual bool HandleProtocolServiceFeature( + SCSIProtocolFeature feature, + void * serviceValue ); + + // Methods for retrieving and setting the object for the Interface + IOUSBInterface * GetInterfaceReference( void ); + void SetInterfaceReference( IOUSBInterface * newInterface ); + + UInt8 GetInterfaceSubclass( void ); + UInt8 GetInterfaceProtocol( void ); + + // Methods for retrieving an object for a Pipe. + IOUSBPipe * GetControlPipe( void ); + IOUSBPipe * GetBulkInPipe( void ); + IOUSBPipe * GetBulkOutPipe( void ); + IOUSBPipe * GetInterruptPipe( void ); + + // Methods for getting and setting the maximum LUN of a device. + UInt8 GetMaxLogicalUnitNumber( void ) const; + void SetMaxLogicalUnitNumber( UInt8 maxLUN ); + + virtual void CompleteSCSICommand( + SCSITaskIdentifier request, + IOReturn status ); + + virtual bool BeginProvidedServices( void ); + virtual bool EndProvidedServices( void ); + + // The Protocol specific helper methods for SendSCSICommand + virtual IOReturn SendSCSICommandForCBIProtocol( + SCSITaskIdentifier request ); + + virtual IOReturn SendSCSICommandForBulkOnlyProtocol( + SCSITaskIdentifier request ); + + // The Protocol specific helper methods for AbortSCSICommand + virtual IOReturn AbortSCSICommandForCBIProtocol( + SCSITaskIdentifier abortTask ); + + virtual IOReturn AbortSCSICommandForBulkOnlyProtocol( + SCSITaskIdentifier abortTask ); + + // Helper methods for performing general USB device requests + virtual IOReturn ClearFeatureEndpointStall( + IOUSBPipe * thePipe, + IOUSBCompletion * completion ); + virtual IOReturn GetStatusEndpointStatus( + IOUSBPipe * thePipe, + void * endpointStatus, + IOUSBCompletion * completion ); + + /* All CBI transport related methods. + */ + // All definitions and structures for the CBI Protocol + enum + { + kUSBStorageAutoStatusSize = 2 // Per the USB CBI Protocol + }; + + // Methods for accessing Bulk Only specific member variables. + CBIRequestBlock * GetCBIRequestBlock( void ); + + void ReleaseCBIRequestBlock( + CBIRequestBlock * cbiRequestBlock ); + + // Methods used for CBI/CB command transportation. + static void CBIProtocolUSBCompletionAction( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + + IOReturn CBIProtocolTransferData( + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + IOReturn CBIProtocolReadInterrupt( + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + IOReturn CBIGetStatusEndpointStatus( + IOUSBPipe * targetPipe, + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + IOReturn CBIClearFeatureEndpointStall( + IOUSBPipe * targetPipe, + CBIRequestBlock * cbiRequestBlock, + UInt32 nextExecutionState ); + + void CBIProtocolCommandCompletion( + CBIRequestBlock * cbiRequestBlock, + IOReturn resultingStatus, + UInt32 bufferSizeRemaining ); + + /* All Bulk Only transport related methods, structures and enums. + */ + // All Bulk Only specific structures and enums. + + // All definitions and structures for the Bulk Only Protocol + // Command Block Wrapper (CBW) + enum + { + // CBW general struture definitions + kCommandBlockWrapperSignature = OSSwapHostToBigConstInt32 ( 'USBC' ), + kByteCountOfCBW = 31, + + // CBW LUN related definitions + kCBWLUNMask = 0x0F, + + kCBWFlagsDataOut = 0x00, + kCBWFlagsDataIn = 0x80 + }; + + // All definitions and structures for the Bulk Only Protocol + // Command Status Wrapper (CSW) + enum + { + // CSW general struture definitions + kCommandStatusWrapperSignature = OSSwapHostToBigConstInt32 ( 'USBS' ), + kByteCountOfCSW = 13, + + // CSW status definitions + kCSWCommandPassedError = 0x00, // No error occurred + kCSWCommandFailedError = 0x01, /* An error occurred (probably a + * bad command or parameter ) */ + kCSWPhaseError = 0x02 /* A transfer was performed in + * the wrong sequence */ + }; + + // Methods for accessing Bulk Only specific member variables. + BulkOnlyRequestBlock * GetBulkOnlyRequestBlock( void ); + + void ReleaseBulkOnlyRequestBlock( + BulkOnlyRequestBlock * boRequestBlock ); + + UInt32 GetNextBulkOnlyCommandTag( void ); + + // Methods for Bulk Only specific utility commands + IOReturn BulkDeviceResetDevice( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + // Methods used for Bulk Only command transportation. + IOReturn BulkOnlySendCBWPacket( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + IOReturn BulkOnlyTransferData( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + IOReturn BulkOnlyReceiveCSWPacket( + BulkOnlyRequestBlock * boRequestBlock, + UInt32 nextExecutionState ); + + void BulkOnlyExecuteCommandCompletion ( + BulkOnlyRequestBlock * boRequestBlock, + IOReturn resultingStatus, + UInt32 bufferSizeRemaining ); + + static void BulkOnlyUSBCompletionAction ( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); + +public: + + bool init( OSDictionary * propTable ); + virtual bool start( IOService * provider ); + virtual void stop( IOService * provider ); + virtual void free( void ); + virtual IOReturn message( UInt32 type, IOService * provider, void * argument = 0 ); + + virtual bool willTerminate( IOService * provider, + IOOptionBits options ); + + virtual bool didTerminate( IOService * provider, + IOOptionBits options, + bool * defer ); + + virtual bool handleOpen( IOService * client, + IOOptionBits options, + void * arg ); + + virtual void handleClose( IOService * client, + IOOptionBits options ); + + virtual bool handleIsOpen( const IOService * client ) const; + + virtual IOReturn HandlePowerOn( void ); + +protected: + + static IOReturn sWaitForReset( void * refcon ); + IOReturn GatedWaitForReset( void ); + + static IOReturn sWaitForTaskAbort( void * refcon ); /* OBSOLETE */ + IOReturn GatedWaitForTaskAbort( void ); /* OBSOLETE */ + + static void sResetDevice( void * refcon ); + + static void sAbortCurrentSCSITask( void * refcon ); /* OBSOLETE */ + + OSMetaClassDeclareReservedUsed( IOUSBMassStorageClass, 1 ); + virtual IOReturn StartDeviceRecovery( void ); /* OBSOLETE */ + + OSMetaClassDeclareReservedUsed( IOUSBMassStorageClass, 2 ); + virtual void FinishDeviceRecovery( IOReturn status ); /* OBSOLETE */ + + static void DeviceRecoveryCompletionAction( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining ); /* OBSOLETE */ + + void ResetDeviceNow( bool waitForReset ); + + void AbortCurrentSCSITask( void ); + + bool IsPhysicalInterconnectLocationInternal ( void ); + + IOReturn SuspendPort ( bool suspend ); + +private: + + void ClearPipeStall ( void ); + + IOReturn AcceptSCSITask ( SCSITaskIdentifier scsiTask, bool * pAccepted ); + + void CheckDeferredTermination ( void ); + + void GatedCompleteSCSICommand ( SCSITaskIdentifier request, SCSIServiceResponse * serviceResponse, SCSITaskStatus * taskStatus ); + + // Space reserved for future expansion. + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 3 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 4 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 5 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 6 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 7 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 8 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 9 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 10 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 11 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 12 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 13 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 14 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 15 ); + OSMetaClassDeclareReservedUnused( IOUSBMassStorageClass, 16 ); + +}; + + +#endif _IOKIT_IOUSBMASSSTORAGECLASS_H diff --git a/i386/include/IOKit/usb/IOUSBMassStorageUFISubclass.h b/i386/include/IOKit/usb/IOUSBMassStorageUFISubclass.h new file mode 100644 index 0000000..cbfe3c8 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBMassStorageUFISubclass.h @@ -0,0 +1,355 @@ +/* + * Copyright (c) 1998-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef _IOKIT_IOUSBMASSSTORAGEUFISUBCLASS_H +#define _IOKIT_IOUSBMASSSTORAGEUFISUBCLASS_H + +// This class' header file +#include <IOKit/usb/IOUSBMassStorageClass.h> +#include <IOKit/scsi/IOSCSIPrimaryCommandsDevice.h> + + +#pragma mark - +#pragma mark IOUSBMassStorageUFIDevice declaration + +class IOUSBMassStorageUFIDevice : public IOSCSIPrimaryCommandsDevice +{ + OSDeclareDefaultStructors(IOUSBMassStorageUFIDevice) + +private: + static void AsyncReadWriteComplete( SCSITaskIdentifier completedTask ); + +protected: + // Reserve space for future expansion. + struct IOUSBMassStorageUFIDeviceExpansionData + { + }; + IOUSBMassStorageUFIDeviceExpansionData *fIOUSBMassStorageUFIDeviceReserved; + + // ---- Medium Characteristics ---- + bool fMediumPresent; + + // The byte count of each physical block on the medium. + UInt32 fMediumBlockSize; + + // The total number of blocks of fMediumBlockSize on the medium. + UInt32 fMediumBlockCount; + + // Whether the installed medium is protected from writes + bool fMediumIsWriteProtected; + + // Polling thread variables + thread_call_t fPollingThread; + UInt32 fPollingMode; + enum + { + kPollingMode_Suspended = 0, + kPollingMode_NewMedia = 1, + kPollingMode_MediaRemoval = 2 + }; + + // ---- Methods for controlling the current state of device support ---- + virtual bool InitializeDeviceSupport( void ); + virtual void StartDeviceSupport ( void ); + virtual void SuspendDeviceSupport( void ); + virtual void ResumeDeviceSupport( void ); + virtual void StopDeviceSupport ( void ); + virtual void TerminateDeviceSupport( void ); + + // ---- Methods used for misc ---- + virtual bool ClearNotReadyStatus( void ); + virtual void CreateStorageServiceNub( void ); + virtual bool DetermineDeviceCharacteristics( void ); + + // ---- Methods used for controlling the polling thread ---- + virtual void ProcessPoll( void ); + virtual void EnablePolling( void ); + virtual void DisablePolling( void ); + + // ---- Main and support methods for polling for new Media ---- + virtual void PollForNewMedia( void ); + virtual bool DetermineMediaPresence( void ); + virtual bool DetermineMediumCapacity( + UInt64 * blockSize, + UInt64 * blockCount ); + virtual bool DetermineMediumWriteProtectState( void ); + + // ---- Main and support methods for polling for Media removal ---- + virtual void PollForMediaRemoval( void ); + + // ---- Methods used for power managment ---- + virtual UInt32 GetInitialPowerState ( void ); + virtual void InitializePowerManagement ( IOService * provider ); + virtual void HandlePowerChange ( void ); + virtual void HandleCheckPowerState ( void ); + virtual void TicklePowerManager ( void ); + virtual UInt32 GetNumberOfPowerStateTransitions ( void ); + + // ---- Methods used for handling medium characteristics ---- + virtual void SetMediumCharacteristics( + UInt32 blockSize, + UInt32 blockCount ); + + virtual void ResetMediumCharacteristics( void ); + + virtual IOReturn IssueRead( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueRead( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + + + virtual IOReturn IssueWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount ); + + virtual IOReturn IssueWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + void * clientData ); + +public: + + static void sProcessPoll( void * pdtDriver, void * refCon ); + + // Interface to the UFI Storage Services Driver + // ---- Methods for controlling the device ---- + virtual IOReturn SyncReadWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize ); + + virtual IOReturn AsyncReadWrite( + IOMemoryDescriptor * buffer, + UInt64 startBlock, + UInt64 blockCount, + UInt64 blockSize, + void * clientData ); + + // ---- Methods for controlling medium state ---- + virtual IOReturn EjectTheMedium( void ); + + // ---- Methods for controlling media format ---- + virtual IOReturn FormatMedium( + UInt64 blockCount, + UInt64 blockSize ); + virtual UInt32 GetFormatCapacities( + UInt64 * capacities, + UInt32 capacitiesMaxCount ) const; + + // ---- Query methods to report device characteristics ---- + // Report the maximum number of blocks that the device can handle per + // read or write. A value of 0 (zero) indicates there is no limit aside + // from the size of the method's return parameter. + virtual UInt64 ReportDeviceMaxBlocksReadTransfer( void ); + virtual UInt64 ReportDeviceMaxBlocksWriteTransfer( void ); + + // ---- Query methods to report installed medium characteristics ---- + virtual UInt64 ReportMediumBlockSize( void ); + virtual UInt64 ReportMediumTotalBlockCount( void ); + virtual bool ReportMediumWriteProtection( void ); + + // Methods for getting device information strings + virtual char * GetVendorString( void ); + virtual char * GetProductString( void ); + virtual char * GetRevisionString( void ); + OSDictionary * GetProtocolCharacteristicsDictionary ( void ); + OSDictionary * GetDeviceCharacteristicsDictionary ( void ); + +protected: + // Utility methods used by all SCSI Command Set objects + + // isParameterValid methods are used to validate that the parameter passed into + // the command methods are of the correct value. + + // Validate Parameter used for 1 bit to 1 byte paramaters + bool IsParameterValid( + SCSICmdField1Byte param, + SCSICmdField1Byte mask ); + + // Validate Parameter used for 9 bit to 2 byte paramaters + bool IsParameterValid( + SCSICmdField2Byte param, + SCSICmdField2Byte mask ); + + // Validate Parameter used for 17 bit to 4 byte paramaters + bool IsParameterValid( + SCSICmdField4Byte param, + SCSICmdField4Byte mask ); + + // UFI Required Commands + virtual bool FORMAT_UNIT( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + IOByteCount defectListSize, + SCSICmdField1Byte TRACK_NUMBER, + SCSICmdField2Byte INTERLEAVE ); + + virtual bool INQUIRY( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Byte PAGE_OR_OPERATION_CODE, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + virtual bool MODE_SELECT_10( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Bit PF, + SCSICmdField1Bit SP, + SCSICmdField2Byte PARAMETER_LIST_LENGTH ); + + virtual bool MODE_SENSE_10( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Bit DBD, + SCSICmdField2Bit PC, + SCSICmdField6Bit PAGE_CODE, + SCSICmdField2Byte PARAMETER_LIST_LENGTH ); + + virtual bool PREVENT_ALLOW_MEDIUM_REMOVAL( + SCSITaskIdentifier request, + SCSICmdField1Bit PREVENT ); + + virtual bool READ_10( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + virtual bool READ_12( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH ); + + virtual bool READ_CAPACITY( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField1Bit PMI ); + + virtual bool READ_FORMAT_CAPACITIES( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + SCSICmdField2Byte ALLOCATION_LENGTH ); + + virtual bool REQUEST_SENSE( + SCSITaskIdentifier request, + IOMemoryDescriptor *dataBuffer, + SCSICmdField1Byte ALLOCATION_LENGTH ); + + virtual bool REZERO_UNIT( + SCSITaskIdentifier request ); + + virtual bool SEEK( + SCSITaskIdentifier request, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS ); + + virtual bool SEND_DIAGNOSTICS( + SCSITaskIdentifier request, + SCSICmdField1Bit PF, + SCSICmdField1Bit SELF_TEST, + SCSICmdField1Bit DEF_OFL, + SCSICmdField1Bit UNIT_OFL ); + + virtual bool START_STOP_UNIT( + SCSITaskIdentifier request, + SCSICmdField1Bit IMMED, + SCSICmdField1Bit LOEJ, + SCSICmdField1Bit START ); + + virtual bool TEST_UNIT_READY( + SCSITaskIdentifier request ); + + virtual bool VERIFY( + SCSITaskIdentifier request, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte VERIFICATION_LENGTH ); + + virtual bool WRITE_10( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit FUA, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); + + virtual bool WRITE_12( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit EBP, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField4Byte TRANSFER_LENGTH ); + + virtual bool WRITE_AND_VERIFY( + SCSITaskIdentifier request, + IOMemoryDescriptor * dataBuffer, + UInt32 blockSize, + SCSICmdField1Bit DPO, + SCSICmdField1Bit BYTCHK, + SCSICmdField1Bit RELADR, + SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS, + SCSICmdField2Byte TRANSFER_LENGTH ); +}; + + +#pragma mark - +#pragma mark IOUSBMassStorageUFISubclass declaration + + +class IOUSBMassStorageUFISubclass : public IOUSBMassStorageClass +{ + OSDeclareDefaultStructors(IOUSBMassStorageUFISubclass) + +protected: + virtual bool BeginProvidedServices( void ); + virtual bool EndProvidedServices( void ); +}; + +#endif _IOKIT_IOUSBMASSSTORAGEUFISUBCLASS_H diff --git a/i386/include/IOKit/usb/IOUSBNub.h b/i386/include/IOKit/usb/IOUSBNub.h new file mode 100644 index 0000000..a998e5b --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBNub.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBNUB_H +#define _IOKIT_IOUSBNUB_H + +#include <IOKit/IOService.h> +#include <libkern/c++/OSData.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> + +class IOUSBController; +class IOUSBPipe; + +/*! + @class IOUSBNub + @abstract Super class for for IOUSBDevice and IOUSBInterface. + */ +class IOUSBNub : public IOService +{ + OSDeclareDefaultStructors(IOUSBNub) + +public: + + // IOKit method + virtual void joinPMtree ( IOService * driver ); + + virtual bool USBCompareProperty(OSDictionary * matching, const char * key ); + + bool IsWildCardMatch( OSDictionary * matching, const char * key ); + bool USBComparePropertyWithMask( OSDictionary *matching, const char *key, const char * maskKey ); +}; + +#ifdef __cplusplus +extern "C" { +#endif + +void printDescriptor(const IOUSBDescriptorHeader *desc); +void printDeviceDescriptor(const IOUSBDeviceDescriptor *desc); +void printConfigDescriptor(const IOUSBConfigurationDescriptor *cd); +void printEndpointDescriptor(const IOUSBEndpointDescriptor *ed); +void printInterfaceDescriptor(const IOUSBInterfaceDescriptor *id); + +#ifdef __cplusplus +} +#endif + +#endif /* _IOKIT_IOUSBNUB_H */ diff --git a/i386/include/IOKit/usb/IOUSBPipe.h b/i386/include/IOKit/usb/IOUSBPipe.h new file mode 100644 index 0000000..3286b92 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBPipe.h @@ -0,0 +1,387 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.2 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBPIPE_H +#define _IOKIT_IOUSBPIPE_H + +#include <IOKit/IOService.h> +#include <IOKit/IOMemoryDescriptor.h> + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/IOUSBController.h> +#include <IOKit/usb/IOUSBControllerV2.h> + +class IOUSBInterface; + +/*! + @class IOUSBPipe + @abstract The object representing an open pipe for a device. +*/ +class IOUSBPipe : public OSObject +{ + friend class IOUSBInterface; + friend class IOUSBDevice; + + OSDeclareDefaultStructors(IOUSBPipe) + +protected: + + const IOUSBEndpointDescriptor * _descriptor; + IOUSBController::Endpoint _endpoint; // tidied up version of descriptor + IOUSBController * _controller; + USBDeviceAddress _address; + UInt8 _status; // was previously used for status. Now used to detect whether a property exists or not + + struct ExpansionData + { + IOReturn _correctStatus; + IOUSBDevice * _device; // Remember containing device for clearing TTs + UInt8 _speed; + IOUSBInterface * _interface; + bool _crossEndianCompatible; + UInt32 _locationID; + }; + ExpansionData * _expansionData; + + virtual void free(); + + IOReturn ClosePipe(void); + +public: + + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller); + + // The following 2 methods are obsolete + // + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, + IOUSBDevice * device, IOUSBController * controller); + + static IOUSBPipe *ToEndpoint(const IOUSBEndpointDescriptor *endpoint, + IOUSBDevice * device, IOUSBController * controller, IOUSBInterface *interface); + + // Controlling pipe state + /*! + @function GetStatus + This method does NOT work. Do not call it. See GetPipeStatus for the correct method. + GetStatus will always return 0. + */ + virtual UInt8 GetStatus(void); + /*! + @function Abort + This method causes all outstanding I/O on a pipe to complete with return code kIOReturnAborted. It clears the halted bit but does NOT clear the + toggle bit on the endpoint in the controller. If you wish to clear the toggle bit, see ClearPipeStall + */ + virtual IOReturn Abort(void); + /*! + @function Reset + This method is identical to ClearPipeStall(false). The use of that API is preferred. + */ + virtual IOReturn Reset(void); + /*! + @function ClearStall + This method is equivalent to ClearPipeStall(false). This method is available before version 1.9. + */ + virtual IOReturn ClearStall(void); + + // + // Transferring Data + // + + // deprecated + virtual IOReturn Read(IOMemoryDescriptor * buffer, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + // deprecated + virtual IOReturn Write(IOMemoryDescriptor * buffer, + IOUSBCompletion * completion = 0); + + // Transfer data over Isochronous pipes + /*! + @function Read + Read from an isochronous endpoint + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param completion describes action to take when buffer has been filled + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, + IOUSBIsocCompletion * completion = 0); + /*! + @function Write + Write to an isochronous endpoint + @param buffer place to get the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer and result for each frame + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, + IOUSBIsocCompletion * completion = 0); + + // Do a control request over a Control pipe, using a memory descriptor + /*! + @function ControlRequest + Make a control request + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param completion describes action to take when the request has been executed + */ + virtual IOReturn ControlRequest(IOUSBDevRequestDesc *request, + IOUSBCompletion *completion = 0); + + // Do a control request over a Control pipe, using a simple buffer + virtual IOReturn ControlRequest(IOUSBDevRequest *request, + IOUSBCompletion *completion = 0); + + /* + * Accessors + */ + /*! + @function GetEndpoint + returns a pointer to the Endpoint structure for the pipe. + */ + virtual const IOUSBController::Endpoint * GetEndpoint(); + /*! + @function GetEndpointDescriptor + returns the endpoint descriptor for the pipe. + */ + virtual const IOUSBEndpointDescriptor * GetEndpointDescriptor(); + /*! + @function GetDirection + returns the direction of the pipe:kUSBOut/kUSBIn for a bulk or interrupt pipe, + kUSBAnyDirn for a control pipe. + */ + virtual UInt8 GetDirection(); + /*! + @function GetType + returns the pipe type: kUSBControl, kUSBBulk or kUSBInterrupt. + */ + virtual UInt8 GetType(); + /*! + @function GetEndpointNumber + returns the endpoint number in the device that the pipe is connected to. + */ + virtual UInt8 GetEndpointNumber(); + virtual USBDeviceAddress GetAddress(); + virtual UInt16 GetMaxPacketSize(); + virtual UInt8 GetInterval(); + + // Transfer data over Bulk pipes with timeouts. + OSMetaClassDeclareReservedUsed(IOUSBPipe, 0); + + // deprecated + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 1); + + // deprecated + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion * completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 2); + // Do a control request over a Control pipe, using a memory descriptor + /*! + @function ControlRequest + Make a control request. + There are two versions of this method, one uses a simple void * + to point to the data portion of the transfer, the other uses an + IOMemoryDescriptor to point to the data. + @param request parameter block for the control request + @param noDataTimeout Specifies an amount of time (in ms) after which the command will be aborted + if no data has been transferred on the bus. + @param completionTimeout Specifies an amount of time (in ms) after which the command will be aborted if the entire command has + not been completed. + @param completion describes action to take when the request has been executed + */ + virtual IOReturn ControlRequest(IOUSBDevRequestDesc *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 3); + // Do a control request over a Control pipe, using a simple buffer + virtual IOReturn ControlRequest(IOUSBDevRequest *request, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 4); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 5); + /*! + @function Write + Write to an interrupt or bulk endpoint + @param buffer place to get the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been emptied + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletion * completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 6); + /*! + @function GetPipeStatus + Returns the status of the pipe (kIOUSBPipeStalled of the pipe is stalled, else kIOReturnSuccess) + */ + virtual IOReturn GetPipeStatus(void); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 7); + /*! + @function ClearPipeStall + AVAILABLE ONLY IN VERSION 1.9 AND ABOVE + This method causes all outstanding I/O on a pipe to complete with return code kIOUSBTransactionReturned. It also clears both the halted bit and the + toggle bit on the endpoint in the controller. The driver may need to reset the data toggle within the device to avoid losing any data. If the + device correctly handles the ClearFeature(ENDPOINT_HALT) device request, then this API will handle that by sending the correct request to the + device. + @param withDeviceRequest if true, a ClearFeature(ENDPOINT_HALT) is sent to the appropriate endpoint on the device after the transactions on the + controllers endpoint are returned and the toggle bit on the controllers endpoint is cleared. if this parameter is false, then this is equivalent + to the pre-1.9 API. This means that the endpoint on the controller is cleared, but no DeviceRequest is sent to the device's endpoint. + */ + virtual IOReturn ClearPipeStall(bool withDeviceRequest); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 8); + /*! + @function SetPipePolicy + AVAILABLE ONLY IN VERSION 1.9 AND ABOVE + This method allows a driver to change the maxPacketSize of an Isochronous pipe, or the polling interval for an interrupt pipe. There is a limited + amount of bandwidth on any single bus, and isochronous pipes tend to use much of this bandwidth. The driver may know, however, that there + will never be as much bandwidth used as is specified in the pipe's endpoint descriptor. Therefore, the driver may return some of this + bandwidth to the system by using this method. Additionally, if on an open of an IOUSBInterface any of the Isochronous pipes is unable to be + opened because of a lack of bandwidth, the pipe will be created with a bandwidth of zero, and the driver may get some of the limited bandwidth + remaining by using this call. + This method returns kIOReturnBadArgument if the pipe is a bulk on control pipe, or if the maxPacketSize parameter is larger than the amount specified + in the endpoint descriptor. It returns kIOReturnNoBandwidth if the bandwidth requested cannot be allocated. Otherwise it returns kIOReturnSuccess. + @param maxPacketSize specifies the maximum number of bytes to be used in any one millisecond frame by this pipe. The value must be less than or + equal to the maxPacketSize specified in the endpoint descriptor. + @param maxInterval not currently used. reserved for future expansion + + */ + virtual IOReturn SetPipePolicy(UInt16 maxPacketSize, UInt8 maxInterval); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 9); + + // Transfer data over Isochronous pipes and process the frame list at hardware interrupt time + /*! + @function Read + AVAILABLE ONLY IN VERSION 1.9.2 AND ABOVE + Read from an isochronous endpoint and process the IOUSBLowLatencyIsocFrame fields at + hardware interrupt time + @param buffer place to put the transferred data + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Bytes to transfer, result, and time stamp for each frame + @param completion describes action to take when buffer has been filled + @param updateFrequency describes how often (in milliseconds) should the frame list be processed + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, + IOUSBLowLatencyIsocCompletion * completion = 0, UInt32 updateFrequency = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 10); + /*! + @function Write + AVAILABLE ONLY IN VERSION 1.9.2 AND ABOVE + Write to an isochronous endpoint + @param buffer place to get the data to transfer + @param frameStart USB frame number of the frame to start transfer + @param numFrames Number of frames to transfer + @param frameList Pointer to list of frames indicating bytes to transfer and result for each frame + @param completion describes action to take when buffer has been emptied + @param updateFrequency describes how often (in milliseconds) should the frame list be processed + */ + virtual IOReturn Write(IOMemoryDescriptor * buffer, + UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, + IOUSBLowLatencyIsocCompletion * completion = 0, UInt32 updateFrequency = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 11); + /*! + @function Read + Read from an interrupt or bulk endpoint + @param buffer place to put the transferred data + @param noDataTimeout number of milliseconds of no bus activity until transaction times out. Note that if a tranasction times out + the driver software may have to resynchronize the data toggle. See ClearPipeStall. + @param completionTimeout number of milliseconds from the time the transaction is placed on the bus until it times out + @param reqCount requested number of bytes to transfer. must be <= buffer->getLength() + @param completion describes action to take when buffer has been filled + @param bytesRead returns total bytes read for synchronous reads + */ + virtual IOReturn Read(IOMemoryDescriptor * buffer, + UInt32 noDataTimeout, + UInt32 completionTimeout, + IOByteCount reqCount, + IOUSBCompletionWithTimeStamp * completion = 0, + IOByteCount * bytesRead = 0); + + OSMetaClassDeclareReservedUsed(IOUSBPipe, 12); + virtual bool InitToEndpoint(const IOUSBEndpointDescriptor *endpoint, UInt8 speed, + USBDeviceAddress address, IOUSBController * controller, IOUSBDevice * device, IOUSBInterface * interface); + + OSMetaClassDeclareReservedUnused(IOUSBPipe, 13); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 14); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 15); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 16); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 17); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 18); + OSMetaClassDeclareReservedUnused(IOUSBPipe, 19); + +}; + +#endif /* _IOKIT_IOUSBPIPE_H */ diff --git a/i386/include/IOKit/usb/IOUSBRootHubDevice.h b/i386/include/IOKit/usb/IOUSBRootHubDevice.h new file mode 100644 index 0000000..19a17c4 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBRootHubDevice.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBROOTHUBDEVICE_H +#define _IOKIT_IOUSBROOTHUBDEVICE_H + +#include <IOKit/usb/IOUSBHubDevice.h> + +/*! + @class IOUSBRootHubDevice + @abstract The object representing the Root Hub simulation. + */ +class IOUSBRootHubDevice : public IOUSBHubDevice +{ + OSDeclareDefaultStructors(IOUSBRootHubDevice) + +private: + UInt16 configuration; + IOCommandGate *_commandGate; + + // private method which overrides the same method in IOUSBHubDevice + virtual bool InitializeCharacteristics(void); // used at start + + struct ExpansionData + { + IOService * _IOResourcesEntry; + }; + ExpansionData *_expansionData; + +public: + // static methods + static IOUSBRootHubDevice *NewRootHubDevice(void); + static IOReturn GatedDeviceRequest (OSObject * owner, + void * arg0, + void * arg1, + void * arg2, + void * arg3 ); + + // IOKit methods + virtual bool init(); + virtual bool start( IOService * provider ); + virtual void stop( IOService *provider ); + virtual void free(); + + // IOUSBHubDevice methods + virtual bool IsRootHub(void); + virtual UInt32 RequestExtraPower(UInt32 requestedPower); + virtual void ReturnExtraPower(UInt32 returnedPower); + + // + virtual UInt32 RequestSleepPower(UInt32 requestedPower); + virtual void ReturnSleepPower(UInt32 returnedPower); + + // a non static but non-virtual function + IOReturn DeviceRequestWorker(IOUSBDevRequest *request, UInt32 noDataTimeout, UInt32 completionTimeout, IOUSBCompletion *completion); + + // IOUSBDevice methods overriden here + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, IOUSBCompletion *completion = 0); + virtual IOReturn DeviceRequest(IOUSBDevRequest *request, UInt32 noDataTimeout, UInt32 completionTimeout, IOUSBCompletion *completion = 0); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 0); + virtual IOReturn GetDeviceInformation(UInt32 *info); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 1); + virtual void InitializeExtraPower(UInt32 maxPortCurrent, UInt32 totalExtraCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 2); + virtual void SetSleepCurrent(UInt32 sleepCurrent); + + OSMetaClassDeclareReservedUsed(IOUSBRootHubDevice, 3); + virtual UInt32 GetSleepCurrent(); + + OSMetaClassDeclareReservedUnused(IOUSBRootHubDevice, 4); +}; + +#endif /* _IOKIT_IOUSBROOTHUBDEVICE_H */ + diff --git a/i386/include/IOKit/usb/IOUSBUserClient.h b/i386/include/IOKit/usb/IOUSBUserClient.h new file mode 100644 index 0000000..1cd47a8 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBUserClient.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBUSERCLIENT_H +#define _IOKIT_IOUSBUSERCLIENT_H + +// these are the new User Client method names +enum { + kUSBDeviceUserClientOpen, + kUSBDeviceUserClientClose, + kUSBDeviceUserClientSetConfig, + kUSBDeviceUserClientGetConfig, + kUSBDeviceUserClientGetConfigDescriptor, + kUSBDeviceUserClientGetFrameNumber, + kUSBDeviceUserClientDeviceRequestOut, + kUSBDeviceUserClientDeviceRequestIn, + kUSBDeviceUserClientCreateInterfaceIterator, + kUSBDeviceUserClientResetDevice, + kUSBDeviceUserClientSuspend, + kUSBDeviceUserClientAbortPipeZero, + kUSBDeviceUserClientReEnumerateDevice, + kUSBDeviceUserClientGetMicroFrameNumber, + kUSBDeviceUserClientGetFrameNumberWithTime, + kUSBDeviceUserClientSetAsyncPort, + kUSBDeviceUserClientGetDeviceInformation, + kUSBDeviceUserClientRequestExtraPower, + kUSBDeviceUserClientReturnExtraPower, + kUSBDeviceUserClientGetExtraPowerAllocated, + kIOUSBLibDeviceUserClientNumCommands + }; + +enum { + kUSBInterfaceUserClientOpen, + kUSBInterfaceUserClientClose, + kUSBInterfaceUserClientGetDevice, + kUSBInterfaceUserClientSetAlternateInterface, + kUSBInterfaceUserClientGetFrameNumber, + kUSBInterfaceUserClientGetPipeProperties, + kUSBInterfaceUserClientReadPipe, + kUSBInterfaceUserClientWritePipe, + kUSBInterfaceUserClientGetPipeStatus, + kUSBInterfaceUserClientAbortPipe, + kUSBInterfaceUserClientResetPipe, + kUSBInterfaceUserClientClearPipeStall, + kUSBInterfaceUserClientControlRequestOut, + kUSBInterfaceUserClientControlRequestIn, + kUSBInterfaceUserClientSetPipePolicy, + kUSBInterfaceUserClientGetBandwidthAvailable, + kUSBInterfaceUserClientGetEndpointProperties, + kUSBInterfaceUserClientLowLatencyPrepareBuffer, + kUSBInterfaceUserClientLowLatencyReleaseBuffer, + kUSBInterfaceUserClientGetMicroFrameNumber, + kUSBInterfaceUserClientGetFrameListTime, + kUSBInterfaceUserClientGetFrameNumberWithTime, + kUSBInterfaceUserClientSetAsyncPort, + kUSBInterfaceUserClientReadIsochPipe, + kUSBInterfaceUserClientWriteIsochPipe, + kUSBInterfaceUserClientLowLatencyReadIsochPipe, + kUSBInterfaceUserClientLowLatencyWriteIsochPipe, + kUSBInterfaceUserClientGetConfigDescriptor, + kIOUSBLibInterfaceUserClientNumCommands + }; + + +#if KERNEL +#include <IOKit/IOService.h> +#include <IOKit/IOUserClient.h> +#include <IOKit/usb/USB.h> + +//================================================================================================ +// +// Structure declarations +// +//================================================================================================ +// +typedef struct IOUSBUserClientAsyncParamBlock IOUSBUserClientAsyncParamBlock; + +struct IOUSBUserClientAsyncParamBlock +{ + OSAsyncReference64 fAsyncRef; + uint32_t fAsyncCount; + uint32_t fMax; + IOMemoryDescriptor * fMem; + IOUSBDevRequestDesc req; +}; + +typedef struct IOUSBInterfaceUserClientISOAsyncParamBlock IOUSBInterfaceUserClientISOAsyncParamBlock; +struct IOUSBInterfaceUserClientISOAsyncParamBlock +{ + OSAsyncReference64 fAsyncRef; + uint32_t fAsyncCount; + mach_vm_size_t frameLen; // In bytes + mach_vm_address_t frameBase; // In user task + IOMemoryDescriptor * dataMem; + IOMemoryDescriptor * countMem; + uint64_t numFrames; + IOUSBIsocFrame frames[0]; // Must be the last one +}; + + +//================================================================================================ +// +// This class is used to add an IOProviderMergeProperties dictionary entry to a provider's +// property list, thus providing a tie between hardware and a CFBundle at hardware +// load time. This property usually contains the user client class name and the CFPlugInTypes UUID's +// but it can contain other properties. +// +//================================================================================================ +// +class IOUSBUserClientInit : public IOService +{ + OSDeclareDefaultStructors(IOUSBUserClientInit); + +public: + + virtual bool start(IOService * provider) ; + virtual bool MergeDictionaryIntoProvider(IOService * provider, OSDictionary * mergeDict); + virtual bool MergeDictionaryIntoDictionary(OSDictionary * sourceDictionary, OSDictionary * targetDictionary); +}; + +#endif // KERNEL + +#endif /* ! _IOKIT_IOUSBUSERCLIENT_H */ + diff --git a/i386/include/IOKit/usb/IOUSBWorkLoop.h b/i386/include/IOKit/usb/IOUSBWorkLoop.h new file mode 100644 index 0000000..7630704 --- /dev/null +++ b/i386/include/IOKit/usb/IOUSBWorkLoop.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2001-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _IOKIT_IOUSBWORKLOOP_H +#define _IOKIT_IOUSBWORKLOOP_H + +#include <IOKit/IOWorkLoop.h> + +/*! + @class IOUSBWorkLoop + @abstract Subclass of IOWorkloop that allows the USB stack to more finely control sleep and wake. + */ +class IOUSBWorkLoop : public IOWorkLoop +{ + OSDeclareDefaultStructors(IOUSBWorkLoop) + +protected: + void * fSleepToken; +#ifndef __OPEN_SOURCE__ + lck_grp_t * fLockGroup; +#endif + bool init ( const char * controllerLocation ); + void free ( void ); + + // Overrides to check for sleeping + virtual void closeGate(); + virtual bool tryCloseGate(); + +public: + // Create a workloop + static IOUSBWorkLoop * workLoop(const char * controllerLocation); + + // Put workloop to sleep (Must have gate closed, opens gate if successful) + virtual IOReturn sleep(void *token); + + // Wake workloop up (closes gate if successful) + virtual IOReturn wake(void *token); + + void CloseGate(void); + void OpenGate(void); +}; + +#endif /* ! _IOKIT_IOUSBWORKLOOP_H */ + diff --git a/i386/include/IOKit/usb/USB.h b/i386/include/IOKit/usb/USB.h new file mode 100644 index 0000000..8ba12bb --- /dev/null +++ b/i386/include/IOKit/usb/USB.h @@ -0,0 +1,1076 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _USB_H +#define _USB_H + +#if KERNEL + #include <libkern/OSByteOrder.h> + #include <IOKit/IOMemoryDescriptor.h> +#else + #include <libkern/OSByteOrder.h> +#endif + +#include <IOKit/IOTypes.h> + +#if !defined(__USB__) +# include <IOKit/usb/USBSpec.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + /*! + @header USB.h + @abstract Public Interfaces to the USB implementation in Mac OS X. + @discussion This header file contains definitions and structures that are used in the different USB API's in Mac OS X, both in the kernel and in the user space. + */ + + /*! + @defined Endian conversion definitions + @discussion The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be + formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for + in-kernel use and for user space use. + */ +#define USBToHostWord OSSwapLittleToHostInt16 +#define HostToUSBWord OSSwapHostToLittleInt16 +#define USBToHostLong OSSwapLittleToHostInt32 +#define HostToUSBLong OSSwapHostToLittleInt32 + + /*! + @enum Miscellaneous Constants + @discussion + */ + enum { + kUSBDeviceIDShift = 7, + kUSBMaxDevices = 128, + kUSBMaxDevice = kUSBMaxDevices-1, + kUSBDeviceIDMask = 0x7f, + + kUSBPipeIDMask = 0xf, + kUSBMaxPipes = 32, // In and Out pipes can have same pipe number. + + kUSBInterfaceIDShift = 8, + kUSBMaxInterfaces = 1 << kUSBInterfaceIDShift, + kUSBInterfaceIDMask = kUSBMaxInterfaces-1, + + kUSBEndPtShift = 7, + kUSBDeviceMask = ((1 << kUSBEndPtShift) -1), + + kUSBNoPipeIdx = -1 +}; + +/*! +@enum bRequest Shifts and Masks +@discussion These are used to create the macro to encode the bRequest filed of a Device Request +*/ +enum { + kUSBRqDirnShift = 7, + kUSBRqDirnMask = 1, + + kUSBRqTypeShift = 5, + kUSBRqTypeMask = 3, + + kUSBRqRecipientMask = 0X1F +}; + +/*! +@defined USBmakebmRequestType +@discussion Macro to encode the bRequest field of a Device Request. It is used when constructing an IOUSBDevRequest. +*/ +#define USBmakebmRequestType(direction, type, recipient) \ + ((direction & kUSBRqDirnMask) << kUSBRqDirnShift) | \ + ((type & kUSBRqTypeMask) << kUSBRqTypeShift) | \ + (recipient & kUSBRqRecipientMask) + +/*! +@enum kUSBMaxIsocFrameReqCount +@discussion Maximum size in bytes allowed for one Isochronous frame +*/ +enum { + kUSBMaxFSIsocEndpointReqCount = 1023, // max size (bytes) of any one Isoc frame for 1 FS endpoint + kUSBMaxHSIsocEndpointReqCount = 3072, // max size (bytes) of any one Isoc frame for 1 HS endpoint + kUSBMaxHSIsocFrameCount = 7168 // max size (bytes) of all Isoc transfers in a HS frame +}; + +/*! +@defined EncodeRequest +@discussion Macro that encodes the bRequest and bRequestType fields of a IOUSBDevRequest into a single value. It is useful when one needs +to know what type of request the IOUSBDevRequest encodes and simplifies comparisons. +*/ +#define EncodeRequest(request, direction, type, recipient) \ + (((UInt16)request << 8) + \ + ((UInt16)recipient + \ + ((UInt16)type << kUSBRqTypeShift) + \ + ((UInt16)direction << kUSBRqDirnShift))) + + +/*! +@enum Standard Device Requests +@discussion Encoding of the standard device requests. +<tt> +<pre><b> +bmRequestType bRequest wValue wIndex wLength Data</b> +00000000B CLEAR_FEATURE Feature Zero Zero None (device) +00000001B Feature Interface Zero None (Interface) +00000010B Feature Endpoint Zero None (Endpoint) + +10000000B GET_CONFIGURATION Zero Zero One Configuration +10000000B GET_DESCRIPTOR Type LangID Length Descriptor +10000001B GET_INTERFACE Zero Interface One Alternate + +10000000B GET_STATUS Zero Zero Two status (device) +10000001B Zero Interface Two status (Interface) +10000010B Zero Endpoint Two status (Endpoint) + +00000000B SET_ADDRESS Address Zero Zero None +00000000B SET_CONFIGURATION Configuration Zero Zero None +00000000B SET_DESCRIPTOR Type LangID Length Descriptor + +00000000B SET_FEATURE Feature Zero Zero None (device) +00000001B Feature Interface Zero None (Interface) +00000010B Feature Endpoint Zero None (Endpoint) + +00000001B SET_INTERFACE Alternate Interface Zero None +10000010B SYNCH_FRAME Zero Endpoint Two Frame Number +</pre> +</tt> +*/ +enum { + kClearDeviceFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBDevice), + kClearInterfaceFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBInterface), + kClearEndpointFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBEndpoint), + kGetConfiguration = EncodeRequest(kUSBRqGetConfig, kUSBIn, kUSBStandard, kUSBDevice), + kGetDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBStandard, kUSBDevice), + kGetInterface = EncodeRequest(kUSBRqGetInterface, kUSBIn, kUSBStandard, kUSBInterface), + kGetDeviceStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBDevice), + kGetInterfaceStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBInterface), + kGetEndpointStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBEndpoint), + kSetAddress = EncodeRequest(kUSBRqSetAddress, kUSBOut, kUSBStandard, kUSBDevice), + kSetConfiguration = EncodeRequest(kUSBRqSetConfig, kUSBOut, kUSBStandard, kUSBDevice), + kSetDescriptor = EncodeRequest(kUSBRqSetDescriptor, kUSBOut, kUSBStandard, kUSBDevice), + kSetDeviceFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBDevice), + kSetInterfaceFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBInterface), + kSetEndpointFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBEndpoint), + kSetInterface = EncodeRequest(kUSBRqSetInterface, kUSBOut, kUSBStandard, kUSBInterface), + kSyncFrame = EncodeRequest(kUSBRqSyncFrame, kUSBIn, kUSBStandard, kUSBEndpoint), +}; + +/*! +@defined kCallInterfaceOpenWithGate + @discussion If the USB Device has this property, drivers for any of its interfaces will have their handleOpen method called while holding the workloop gate. + */ +#define kCallInterfaceOpenWithGate "kCallInterfaceOpenWithGate" + +// TYPES + +typedef UInt16 USBDeviceAddress; + +typedef uint32_t USBPhysicalAddress32; + +/*! + @typedef IOUSBIsocFrame + @discussion Structure used to encode information about each isoc frame. + @param frStatus Returns status associated with the frame. + @param frReqCount Input specifiying how many bytes to read or write. + @param frActCount Actual # of bytes transferred. +*/ +typedef struct IOUSBIsocFrame { + IOReturn frStatus; + UInt16 frReqCount; + UInt16 frActCount; +} IOUSBIsocFrame; + + +/*! + @typedef IOUSBLowLatencyIsocFrame + @discussion Structure used to encode information about each isoc frame that is processed + at hardware interrupt time (low latency). + @param frStatus Returns status associated with the frame. + @param frReqCount Input specifiying how many bytes to read or write. + @param frActCount Actual # of bytes transferred. + @param frTimeStamp Time stamp that indicates time when frame was procesed. +*/ +struct IOUSBLowLatencyIsocFrame { + IOReturn frStatus; + UInt16 frReqCount; + UInt16 frActCount; + AbsoluteTime frTimeStamp; +}; +typedef struct IOUSBLowLatencyIsocFrame IOUSBLowLatencyIsocFrame; + +/*! +@typedef IOUSBCompletionAction + @discussion Function called when USB I/O completes. + @param target The target specified in the IOUSBCompletion struct. + @param parameter The parameter specified in the IOUSBCompletion struct. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + */ +typedef void (*IOUSBCompletionAction)( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining); + +/*! +@typedef IOUSBCompletionActionWithTimeStamp + @discussion Function called when USB I/O completes. + @param target The target specified in the IOUSBCompletion struct. + @param parameter The parameter specified in the IOUSBCompletion struct. + @param status Completion status. + @param bufferSizeRemaining Bytes left to be transferred. + @param timeStamp Time at which the transaction was processed. + */ +typedef void (*IOUSBCompletionActionWithTimeStamp)( + void * target, + void * parameter, + IOReturn status, + UInt32 bufferSizeRemaining, + AbsoluteTime timeStamp); + +/*! + @typedef IOUSBIsocCompletionAction + @discussion Function called when Isochronous USB I/O completes. + @param target The target specified in the IOUSBIsocCompletionn struct. + @param parameter The parameter specified in the IOUSBIsocCompletion struct. + @param status Completion status. + @param pFrames Pointer to the frame list containing the status for each frame transferred. +*/ +typedef void (*IOUSBIsocCompletionAction)( + void * target, + void * parameter, + IOReturn status, + IOUSBIsocFrame *pFrames); + +/*! + @typedef IOUSBLowLatencyIsocCompletionAction + @discussion Function called when Low Latency Isochronous USB I/O completes. + @param target The target specified in the IOUSBLowLatencyIsocCompletion struct. + @param parameter The parameter specified in the IOUSBLowLatencyIsocCompletion struct. + @param status Completion status. + @param pFrames Pointer to the low latency frame list containing the status for each frame transferred. +*/ +typedef void (*IOUSBLowLatencyIsocCompletionAction)( + void * target, + void * parameter, + IOReturn status, + IOUSBLowLatencyIsocFrame *pFrames); + +/*! +@typedef IOUSBCompletion + @discussion Struct specifying action to perform when a USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBCompletion { + void * target; + IOUSBCompletionAction action; + void * parameter; +} IOUSBCompletion; + +/*! +@typedef IOUSBCompletionWithTimeStamp + @discussion Struct specifying action to perform when a USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. + */ +typedef struct IOUSBCompletionWithTimeStamp { + void * target; + IOUSBCompletionActionWithTimeStamp action; + void * parameter; +} IOUSBCompletionWithTimeStamp; + +/*! + @typedef IOUSBIsocCompletion + @discussion Struct specifying action to perform when an Isochronous USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. +*/ +typedef struct IOUSBIsocCompletion { + void * target; + IOUSBIsocCompletionAction action; + void * parameter; +} IOUSBIsocCompletion; + +/*! + @typedef IOUSBLowLatencyIsocCompletion + @discussion Struct specifying action to perform when an Low Latency Isochronous USB I/O completes. + @param target The target to pass to the action function. + @param action The function to call. + @param parameter The parameter to pass to the action function. +*/ +typedef struct IOUSBLowLatencyIsocCompletion { + void * target; + IOUSBLowLatencyIsocCompletionAction action; + void * parameter; +} IOUSBLowLatencyIsocCompletion; + + +/*! +@defined IOUSBFamily error codes +@discussion Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. +*/ +#define iokit_usb_err(return) (sys_iokit|sub_iokit_usb|return) +#define kIOUSBUnknownPipeErr iokit_usb_err(0x61) // 0xe0004061 Pipe ref not recognized +#define kIOUSBTooManyPipesErr iokit_usb_err(0x60) // 0xe0004060 Too many pipes +#define kIOUSBNoAsyncPortErr iokit_usb_err(0x5f) // 0xe000405f no async port +#define kIOUSBNotEnoughPipesErr iokit_usb_err(0x5e) // 0xe000405e not enough pipes in interface +#define kIOUSBNotEnoughPowerErr iokit_usb_err(0x5d) // 0xe000405d not enough power for selected configuration +#define kIOUSBEndpointNotFound iokit_usb_err(0x57) // 0xe0004057 Endpoint Not found +#define kIOUSBConfigNotFound iokit_usb_err(0x56) // 0xe0004056 Configuration Not found +#define kIOUSBTransactionTimeout iokit_usb_err(0x51) // 0xe0004051 Transaction timed out +#define kIOUSBTransactionReturned iokit_usb_err(0x50) // 0xe0004050 The transaction has been returned to the caller +#define kIOUSBPipeStalled iokit_usb_err(0x4f) // 0xe000404f Pipe has stalled, error needs to be cleared +#define kIOUSBInterfaceNotFound iokit_usb_err(0x4e) // 0xe000404e Interface ref not recognized +#define kIOUSBLowLatencyBufferNotPreviouslyAllocated iokit_usb_err(0x4d) // 0xe000404d Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the data buffer) first +#define kIOUSBLowLatencyFrameListNotPreviouslyAllocated iokit_usb_err(0x4c) // 0xe000404c Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the frame list) first +#define kIOUSBHighSpeedSplitError iokit_usb_err(0x4b) // 0xe000404b Error to hub on high speed bus trying to do split transaction +#define kIOUSBSyncRequestOnWLThread iokit_usb_err(0x4a) // 0xe000404a A synchronous USB request was made on the workloop thread (from a callback?). Only async requests are permitted in that case +#define kIOUSBDeviceNotHighSpeed iokit_usb_err(0x49) // 0xe0004049 The device is not a high speed device, so the EHCI driver returns an error +#define kIOUSBDevicePortWasNotSuspended iokit_usb_err(0x50) // 0xe0004050 Port was not suspended + +/*! +@defined IOUSBFamily hardware error codes +@discussion These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code. +For the following Completion codes, we return a generic IOKit error instead of a USB specific error. +<tt> +<pre> +Completion Code Error Returned Description +9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size +8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer +5 kIOReturnNotResponding Device Not responding +4 kIOUSBPipeStalled Endpoint returned a STALL PID +</pre> +</tt> +*/ +#define kIOUSBLinkErr iokit_usb_err(0x10) // 0xe0004010 +#define kIOUSBNotSent2Err iokit_usb_err(0x0f) // 0xe000400f Transaction not sent +#define kIOUSBNotSent1Err iokit_usb_err(0x0e) // 0xe000400e Transaction not sent +#define kIOUSBBufferUnderrunErr iokit_usb_err(0x0d) // 0xe000400d Buffer Underrun (Host hardware failure on data out, PCI busy?) +#define kIOUSBBufferOverrunErr iokit_usb_err(0x0c) // 0xe000400c Buffer Overrun (Host hardware failure on data out, PCI busy?) +#define kIOUSBReserved2Err iokit_usb_err(0x0b) // 0xe000400b Reserved +#define kIOUSBReserved1Err iokit_usb_err(0x0a) // 0xe000400a Reserved +#define kIOUSBWrongPIDErr iokit_usb_err(0x07) // 0xe0004007 Pipe stall, Bad or wrong PID +#define kIOUSBPIDCheckErr iokit_usb_err(0x06) // 0xe0004006 Pipe stall, PID CRC error +#define kIOUSBDataToggleErr iokit_usb_err(0x03) // 0xe0004003 Pipe stall, Bad data toggle +#define kIOUSBBitstufErr iokit_usb_err(0x02) // 0xe0004002 Pipe stall, bitstuffing +#define kIOUSBCRCErr iokit_usb_err(0x01) // 0xe0004001 Pipe stall, bad CRC + +/*! +@defined IOUSBFamily message codes +@discussion Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. +*/ +#define iokit_usb_msg(message) (UInt32)(sys_iokit|sub_iokit_usb|message) +#define kIOUSBMessageHubResetPort iokit_usb_msg(0x01) // 0xe0004001 Message sent to a hub to reset a particular port +#define kIOUSBMessageHubSuspendPort iokit_usb_msg(0x02) // 0xe0004002 Message sent to a hub to suspend a particular port +#define kIOUSBMessageHubResumePort iokit_usb_msg(0x03) // 0xe0004003 Message sent to a hub to resume a particular port +#define kIOUSBMessageHubIsDeviceConnected iokit_usb_msg(0x04) // 0xe0004004 Message sent to a hub to inquire whether a particular port has a device connected or not +#define kIOUSBMessageHubIsPortEnabled iokit_usb_msg(0x05) // 0xe0004005 Message sent to a hub to inquire whether a particular port is enabled or not +#define kIOUSBMessageHubReEnumeratePort iokit_usb_msg(0x06) // 0xe0004006 Message sent to a hub to reenumerate the device attached to a particular port +#define kIOUSBMessagePortHasBeenReset iokit_usb_msg(0x0a) // 0xe000400a Message sent to a device indicating that the port it is attached to has been reset +#define kIOUSBMessagePortHasBeenResumed iokit_usb_msg(0x0b) // 0xe000400b Message sent to a device indicating that the port it is attached to has been resumed +#define kIOUSBMessageHubPortClearTT iokit_usb_msg(0x0c) // 0xe000400c Message sent to a hub to clear the transaction translator +#define kIOUSBMessagePortHasBeenSuspended iokit_usb_msg(0x0d) // 0xe000400d Message sent to a device indicating that the port it is attached to has been suspended +#define kIOUSBMessageFromThirdParty iokit_usb_msg(0x0e) // 0xe000400e Message sent from a third party. Uses IOUSBThirdPartyParam to encode the sender's ID +#define kIOUSBMessagePortWasNotSuspended iokit_usb_msg(0x0f) // 0xe000400f Message indicating that the hub driver received a resume request for a port that was not suspended +#define kIOUSBMessageExpressCardCantWake iokit_usb_msg(0x10) // 0xe0004010 Message from a driver to a bus that an express card will disconnect on sleep and thus shouldn't wake +#define kIOUSBMessageCompositeDriverReconfigured iokit_usb_msg(0x11) // 0xe0004011 Message from the composite driver indicating that it has finished re-configuring the device after a reset +#define kIOUSBMessageHubSetPortRecoveryTime iokit_usb_msg(0x12) // 0xe0004012 Message sent to a hub to set the # of ms required when resuming a particular port +#define kIOUSBMessageOvercurrentCondition iokit_usb_msg(0x13) // 0xe0004013 Message sent to the clients of the device's hub parent, when a device causes an overcurrent condition. The message argument contains the locationID of the device +#define kIOUSBMessageNotEnoughPower iokit_usb_msg(0x14) // 0xe0004014 Message sent to the clients of the device's hub parent, when a device causes an low power notice to be displayed. The message argument contains the locationID of the device +#define kIOUSBMessageController iokit_usb_msg(0x15) // 0xe0004015 Generic message sent from controller user client to controllers +#define kIOUSBMessageRootHubWakeEvent iokit_usb_msg(0x16) // 0xe0004016 Message from the HC Wakeup code indicating that a Root Hub port has a wake event + +// Obsolete +// +struct IOUSBMouseData { + UInt16 buttons; + SInt16 XDelta; + SInt16 YDelta; +}; +typedef struct IOUSBMouseData IOUSBMouseData; +typedef IOUSBMouseData * IOUSBMouseDataPtr; + +// Obsolete +// +struct IOUSBKeyboardData { + UInt16 keycount; + UInt16 usbkeycode[32]; +}; +typedef struct IOUSBKeyboardData IOUSBKeyboardData; +typedef IOUSBKeyboardData * IOUSBKeyboardDataPtr; + +// Obsolete +// +union IOUSBHIDData { + IOUSBKeyboardData kbd; + IOUSBMouseData mouse; +}; +typedef union IOUSBHIDData IOUSBHIDData; +typedef IOUSBHIDData * IOUSBHIDDataPtr; + +/*! + @typedef IOUSBDeviceDescriptor + @discussion Descriptor for a USB Device. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBDeviceDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 bcdUSB; + UInt8 bDeviceClass; + UInt8 bDeviceSubClass; + UInt8 bDeviceProtocol; + UInt8 bMaxPacketSize0; + UInt16 idVendor; + UInt16 idProduct; + UInt16 bcdDevice; + UInt8 iManufacturer; + UInt8 iProduct; + UInt8 iSerialNumber; + UInt8 bNumConfigurations; +}; +typedef struct IOUSBDeviceDescriptor IOUSBDeviceDescriptor; +typedef IOUSBDeviceDescriptor * IOUSBDeviceDescriptorPtr; + +/*! + @typedef IOUSBDescriptorHeader + @discussion Standard header used for all USB descriptors. Used to read the length of a descriptor so that we can allocate storage for the whole descriptor later on. +*/ +struct IOUSBDescriptorHeader { + UInt8 bLength; + UInt8 bDescriptorType; +}; +typedef struct IOUSBDescriptorHeader IOUSBDescriptorHeader; +typedef IOUSBDescriptorHeader * IOUSBDescriptorHeaderPtr; + +/*! + @typedef IOUSBConfigurationDescriptor + @discussion Standard USB Configuration Descriptor. It is variable length, so this only specifies the known fields. We use the wTotalLength field to read the whole descriptor. + See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBConfigurationDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 wTotalLength; + UInt8 bNumInterfaces; + UInt8 bConfigurationValue; + UInt8 iConfiguration; + UInt8 bmAttributes; + UInt8 MaxPower; +}; +typedef struct IOUSBConfigurationDescriptor IOUSBConfigurationDescriptor; +typedef IOUSBConfigurationDescriptor * IOUSBConfigurationDescriptorPtr; + +/*! + @typedef IOUSBConfigurationDescHeader + @discussion Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor. +*/ +struct IOUSBConfigurationDescHeader { + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 wTotalLength; +}; +typedef struct IOUSBConfigurationDescHeader IOUSBConfigurationDescHeader; +typedef IOUSBConfigurationDescHeader * IOUSBConfigurationDescHeaderPtr; + +/*! + @typedef IOUSBInterfaceDescriptor + @discussion Descriptor for a USB Interface. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBInterfaceDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bInterfaceNumber; + UInt8 bAlternateSetting; + UInt8 bNumEndpoints; + UInt8 bInterfaceClass; + UInt8 bInterfaceSubClass; + UInt8 bInterfaceProtocol; + UInt8 iInterface; +}; +typedef struct IOUSBInterfaceDescriptor IOUSBInterfaceDescriptor; +typedef IOUSBInterfaceDescriptor * IOUSBInterfaceDescriptorPtr; + +/*! + @typedef IOUSBEndpointDescriptor + @discussion Descriptor for a USB Endpoint. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBEndpointDescriptor { + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bEndpointAddress; + UInt8 bmAttributes; + UInt16 wMaxPacketSize; + UInt8 bInterval; +}; +typedef struct IOUSBEndpointDescriptor IOUSBEndpointDescriptor; +typedef IOUSBEndpointDescriptor * IOUSBEndpointDescriptorPtr; + +enum{addPacketShift = 11}; // Bits for additional packets in maxPacketField. (Table 9-13) +#define mungeMaxPacketSize(w) ((w>1024)?(((w>>(addPacketShift))+1)*(w&((1<<addPacketShift)-1))):w) + +/*! + @typedef IOUSBHIDDescriptor + @discussion USB HID Descriptor. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. (This structure + should have used the #pragma pack(1) compiler directive to get byte alignment. +*/ +struct IOUSBHIDDescriptor { + UInt8 descLen; + UInt8 descType; + UInt16 descVersNum; + UInt8 hidCountryCode; + UInt8 hidNumDescriptors; + UInt8 hidDescriptorType; + UInt8 hidDescriptorLengthLo; + UInt8 hidDescriptorLengthHi; +}; +typedef struct IOUSBHIDDescriptor IOUSBHIDDescriptor; +typedef IOUSBHIDDescriptor *IOUSBHIDDescriptorPtr; + +/*! + @typedef IOUSBHIDReportDesc + @discussion USB HID Report Descriptor header. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. (This structure + should have used the #pragma pack(1) compiler directive to get byte alignment. +*/ +struct IOUSBHIDReportDesc { + UInt8 hidDescriptorType; + UInt8 hidDescriptorLengthLo; + UInt8 hidDescriptorLengthHi; +}; +typedef struct IOUSBHIDReportDesc IOUSBHIDReportDesc; +typedef IOUSBHIDReportDesc * IOUSBHIDReportDescPtr; + +/*! + @typedef IOUSBDeviceQualifierDescriptor + @discussion USB Device Qualifier Descriptor. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +#pragma pack(1) +struct IOUSBDeviceQualifierDescriptor +{ + UInt8 bLength; + UInt8 bDescriptorType; + UInt16 bcdUSB; + UInt8 bDeviceClass; + UInt8 bDeviceSubClass; + UInt8 bDeviceProtocol; + UInt8 bMaxPacketSize0; + UInt8 bNumConfigurations; + UInt8 bReserved; +}; +typedef struct IOUSBDeviceQualifierDescriptor IOUSBDeviceQualifierDescriptor; +typedef IOUSBDeviceQualifierDescriptor * IOUSBDeviceQualifierDescriptorPtr; +#pragma options align=reset + +/*! + @typedef IOUSBDFUDescriptor + @discussion USB Device Firmware Update Descriptor. See the USB Device Firmware Update Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +#pragma pack(1) +struct IOUSBDFUDescriptor +{ + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bmAttributes; + UInt16 wDetachTimeout; + UInt16 wTransferSize; +}; +typedef struct IOUSBDFUDescriptor IOUSBDFUDescriptor; +typedef IOUSBDFUDescriptor * IOUSBDFUDescriptorPtr; + +#pragma options align=reset + +/*! +@typedef IOUSBInterfaceAssociationDescriptor + @discussion USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. See the USB Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. + */ +#pragma pack(1) +struct IOUSBInterfaceAssociationDescriptor +{ + UInt8 bLength; + UInt8 bDescriptorType; + UInt8 bFirstInterface; + UInt8 bInterfaceCount; + UInt8 bFunctionClass; + UInt8 bFunctionSubClass; + UInt8 bFunctionProtocol; + UInt8 iFunction; +}; +typedef struct IOUSBInterfaceAssociationDescriptor IOUSBInterfaceAssociationDescriptor; +typedef IOUSBInterfaceAssociationDescriptor * IOUSBInterfaceAssociationDescriptorPtr; +#pragma options align=reset + +/*! + @typedef USBStatus + @discussion Type used to get a DeviceStatus as a single quantity. +*/ +typedef UInt16 USBStatus; +typedef USBStatus * USBStatusPtr; + +// These constants are obsolete +// +enum { + kIOUSBAnyClass = 0xFFFF, + kIOUSBAnySubClass = 0xFFFF, + kIOUSBAnyProtocol = 0xFFFF, + kIOUSBAnyVendor = 0xFFFF, + kIOUSBAnyProduct = 0xFFFF +}; + +// This structure are obsolete +// +typedef struct IOUSBMatch { + UInt16 usbClass; + UInt16 usbSubClass; + UInt16 usbProtocol; + UInt16 usbVendor; + UInt16 usbProduct; +} IOUSBMatch; + +/*! + @typedef IOUSBFindEndpointRequest + @discussion Struct used to find endpoints of an interface + type and direction are used to match endpoints, + type, direction, maxPacketSize and interval are updated + with the properties of the found endpoint. + @field type Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt, kUSBAnyType. If kUSBAnyType is specified, this field is treated as a don't care. + @field direction Direction of endpoint: kUSBOut, kUSBIn, kUSBAnyDirn. If kUSBAnyDirn is specified, this field is treated as a don't care. + @field maxPacketSize maximum packet size of endpoint. + @field interval Polling interval in mSec for endpoint. +*/ +typedef struct { + UInt8 type; + UInt8 direction; + UInt16 maxPacketSize; + UInt8 interval; +} IOUSBFindEndpointRequest; + +/*! + @struct IOUSBDevRequest + @discussion Parameter block for control requests, using a simple pointer + for the data to be transferred. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred +*/ +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; + UInt32 wLenDone; +} IOUSBDevRequest; +typedef IOUSBDevRequest * IOUSBDeviceRequestPtr; + +/*! + @struct IOUSBDevRequestTO + @discussion Parameter block for control requests with timeouts, using a simple pointer + for the data to be transferred. Same as a IOUSBDevRequest except for the two extra timeout fields. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred + @field noDataTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if no data is transferred in this amount of time, the request will be aborted and returned. + @field completionTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if the entire request is not completed in this amount of time, the request will be aborted and returned +*/ +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; + UInt32 wLenDone; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBDevRequestTO; + +/*! + @enum Default timeout values + @discussion default values used for data and completion timeouts. +*/ +enum +{ + kUSBDefaultControlNoDataTimeoutMS = 5000, + kUSBDefaultControlCompletionTimeoutMS = 0 +}; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +typedef struct +{ + UInt32 pipeRef; + void * buf; + UInt32 size; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBBulkPipeReq; + + +#if KERNEL +/*! + @struct IOUSBDevRequestDesc + @discussion Parameter block for control requests, using a memory descriptor + for the data to be transferred. Only available in the kernel. + @field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor + @field bRequest Request code + @field wValue 16 bit parameter for request, host endianess + @field wIndex 16 bit parameter for request, host endianess + @field wLength Length of data part of request, 16 bits, host endianess + @field pData Pointer to memory descriptor for data for request - data returned in bus endianess + @field wLenDone Set by standard completion routine to number of data bytes + actually transferred +*/ +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + IOMemoryDescriptor * pData; + UInt32 wLenDone; +} IOUSBDevRequestDesc; + + +/*! + @enum IOOptionBits + @discussion Parameter passed to an IOService::open() call. + @constant kIOUSBInterfaceOpenAlt Open the alternate interface specified when creating the interface. +*/ +enum { + kIOUSBInterfaceOpenAlt = 0x00010000 +}; + +#endif + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// use a structure because there's a limit of 6 total arguments +// to a user client method. +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; // data pointer + UInt32 wLenDone; // # bytes transferred + UInt8 pipeRef; +} IOUSBDevReqOOL; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +typedef struct { + UInt8 bmRequestType; + UInt8 bRequest; + UInt16 wValue; + UInt16 wIndex; + UInt16 wLength; + void * pData; // data pointer + UInt32 wLenDone; // # bytes transferred + UInt8 pipeRef; + UInt32 noDataTimeout; + UInt32 completionTimeout; +} IOUSBDevReqOOLTO; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// Structure to request isochronous transfer +// +typedef struct { + UInt32 fPipe; + void *fBuffer; + UInt32 fBufSize; + UInt64 fStartFrame; + UInt32 fNumFrames; + IOUSBIsocFrame *fFrameCounts; +} IOUSBIsocStruct; + +// Internal structure to pass parameters between IOUSBLib and UserClient +// +// Structure to request low latency isochronous transfer +// +struct IOUSBLowLatencyIsocStruct { + UInt32 fPipe; + UInt32 fBufSize; + UInt64 fStartFrame; + UInt32 fNumFrames; + UInt32 fUpdateFrequency; + UInt32 fDataBufferCookie; + UInt32 fDataBufferOffset; + UInt32 fFrameListBufferCookie; + UInt32 fFrameListBufferOffset; +}; + +typedef struct IOUSBLowLatencyIsocStruct IOUSBLowLatencyIsocStruct; + + +/*! + @struct IOUSBGetFrameStruct + @discussion Structure used from user space to return the frame number and a timestamp on when the frame register was read. + @field frame frame number + @field timeStamp AbsoluteTime when the frame was updated +*/ +typedef struct { + UInt64 frame; + AbsoluteTime timeStamp; +} IOUSBGetFrameStruct; + + +/*! + @struct IOUSBFindInterfaceRequest + @discussion Structure used with FindNextInterface. +*/ +typedef struct { + UInt16 bInterfaceClass; // requested class + UInt16 bInterfaceSubClass; // requested subclass + UInt16 bInterfaceProtocol; // requested protocol + UInt16 bAlternateSetting; // requested alt setting +} IOUSBFindInterfaceRequest; + +/*! + @enum kIOUSBFindInterfaceDontCare + @discussion Constant that can be used for the fields of IOUSBFindInterfaceRequest to specify that they should not be matched. +*/ +enum { + kIOUSBFindInterfaceDontCare = 0xFFFF + }; + +/*! + @enum kIOUSBVendorIDAppleComputer + @discussion USB Vendor ID for Apple Computer, Inc. +*/ +enum { + kIOUSBVendorIDAppleComputer = 0x05AC + }; + +/*! + @enum USBDeviceSpeed + @discussion Returns the speed of a particular USB device. + @constant kUSBDeviceSpeedLow The device a low speed device. + @constant kUSBDeviceSpeedFull The device a full speed device. + @constant kUSBDeviceSpeedHigh The device a high speed device. +*/ +enum { + kUSBDeviceSpeedLow = 0, + kUSBDeviceSpeedFull = 1, + kUSBDeviceSpeedHigh = 2 + }; + +/*! + @enum MicrosecondsInFrame + @discussion Returns the number of microseconds in a USB frame. + @constant kUSBFullSpeedMicrosecondsInFrame The device is attached to a bus running at full speed (1 ms / frame). + @constant kUSBHighSpeedMicrosecondsInFrame The device is attached to a bus running at high speed (125 microseconds / frame). +*/ +enum { + kUSBFullSpeedMicrosecondsInFrame = 1000, + kUSBHighSpeedMicrosecondsInFrame = 125 +}; + +// During low latency transfers, the stack will set the frStatus for each frame to this value. A client can check that to see if the transfer has completed. We set the frStatus to a +// valid return code when the transfer completes. +// +enum { + kUSBLowLatencyIsochTransferKey = 'llit' // Set frStatus field of first frame in isoch transfer to designate as low latency + }; + +// This structure is DEPRECATED. See the LowLatencyUserBufferInfoV2 +// +typedef struct LowLatencyUserBufferInfo LowLatencyUserBufferInfo; + +struct LowLatencyUserBufferInfo { + UInt32 cookie; + void * bufferAddress; + IOByteCount bufferSize; + UInt32 bufferType; + Boolean isPrepared; + LowLatencyUserBufferInfo * nextBuffer; +}; + +// This structure is DEPRECATED. See the LowLatencyUserBufferInfoV3 + +typedef struct LowLatencyUserBufferInfoV2 LowLatencyUserBufferInfoV2; + +struct LowLatencyUserBufferInfoV2 +{ + UInt32 cookie; + void * bufferAddress; + IOByteCount bufferSize; + UInt32 bufferType; + Boolean isPrepared; + void * mappedUHCIAddress; + LowLatencyUserBufferInfoV2 * nextBuffer; +}; + + +// This structure is used to pass information for the low latency calls between user space and the kernel. +// +typedef struct LowLatencyUserBufferInfoV3 LowLatencyUserBufferInfoV3; + +struct LowLatencyUserBufferInfoV3 +{ + uint64_t cookie; + mach_vm_address_t bufferAddress; + mach_vm_size_t bufferSize; + uint64_t bufferType; + uint64_t isPrepared; + mach_vm_address_t mappedUHCIAddress; + LowLatencyUserBufferInfoV3 * nextBuffer; +}; + + + /*! + @enum USBLowLatencyBufferType + @discussion Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer(). + @constant kUSBLowLatencyWriteBuffer The buffer will be used to write data out to a device. + @constant kUSBLowLatencyReadBuffer The buffer will be used to read data from a device. + @constant kUSBLowLatencyFrameListBuffer The buffer will be used for a low latency isoch frame list. +*/ +typedef enum { + kUSBLowLatencyWriteBuffer = 0, + kUSBLowLatencyReadBuffer = 1, + kUSBLowLatencyFrameListBuffer = 2 +} USBLowLatencyBufferType; + +// USB User Notification Types +// +enum { + kUSBNoUserNotificationType = 0, + kUSBNotEnoughPowerNotificationType = 1, + kUSBIndividualOverCurrentNotificationType = 2, + kUSBGangOverCurrentNotificationType = 3 +}; + +/*! + @defined Property Definitions + @discussion Useful property names in USB land. +*/ +#define kUSBDevicePropertySpeed "Device Speed" +#define kUSBDevicePropertyBusPowerAvailable "Bus Power Available" +#define kUSBDevicePropertyAddress "USB Address" +#define kUSBDevicePropertyLocationID "locationID" +#define kUSBProductIDMask "idProductMask" +#define kUSBPreferredConfiguration "Preferred Configuration" +#define kUSBSuspendPort "kSuspendPort" +#define kUSBExpressCardCantWake "ExpressCardCantWake" +#define kUSBControllerNeedsContiguousMemoryForIsoch "Need contiguous memory for isoch" +#define kUSBHubDontAllowLowPower "kUSBHubDontAllowLowPower" +#define kUSBDeviceResumeRecoveryTime "kUSBDeviceResumeRecoveryTime" +#define kUSBOutOfSpecMPSOK "Out of spec MPS OK" +#define kConfigurationDescriptorOverride "ConfigurationDescriptorOverride" +#define kOverrideIfAtLocationID "OverrideIfAtLocationID" + +/*! +@enum USBReEnumerateOptions + @discussion Options used when calling ReEnumerateDevice. + @constant kUSBAddExtraResetTimeBit Setting this bit will cause the Hub driver to wait 100ms before addressing the device after the reset following the re-enumeration. + */ +typedef enum { + kUSBAddExtraResetTimeBit = 31, + kUSBAddExtraResetTimeMask = ( 1 << kUSBAddExtraResetTimeBit) +} USBReEnumerateOptions; + +/*! + @enum USBDeviceInformationBits + @discussion GetUSBDeviceInformation will return a unit32_t value with bits set indicating that a particular state is present in the USB device. These bits are described here + + @constant kUSBInformationDeviceIsCaptiveBit The USB device is directly attached to its hub and cannot be removed. + @constant kUSBInformationDeviceIsAttachedToRootHubBit The USB device is directly attached to the root hub + @constant kUSBInformationDeviceIsInternalBit The USB device is internal to the computer (all the hubs it attaches to are captive) + @constant kUSBInformationDeviceIsConnectedBit The USB device is connected to its hub + @constant kUSBInformationDeviceIsEnabledBit The hub port to which the USB device is attached is enabled + @constant kUSBInformationDeviceIsSuspendedBit The hub port to which the USB device is attached is suspended + @constant kUSBInformationDeviceIsInResetBit The hub port to which the USB device is attached is being reset + @constant kUSBInformationDeviceOvercurrentBit The USB device generated an overcurrent + @constant kUSBInformationDevicePortIsInTestModeBit The hub port to which the USB device is attached is in test mode + @constant kUSBInformationDeviceIsRootHub The device is actually the root hub simulation + @constant kUSBInformationRootHubisBuiltIn If this is a root hub simulation and it's built into the machine, this bit is set. If it's on an expansion card, it will be cleared + + */ + typedef enum { + kUSBInformationDeviceIsCaptiveBit = 0, + kUSBInformationDeviceIsAttachedToRootHubBit = 1, + kUSBInformationDeviceIsInternalBit = 2, + kUSBInformationDeviceIsConnectedBit = 3, + kUSBInformationDeviceIsEnabledBit = 4, + kUSBInformationDeviceIsSuspendedBit = 5, + kUSBInformationDeviceIsInResetBit = 6, + kUSBInformationDeviceOvercurrentBit = 7, + kUSBInformationDevicePortIsInTestModeBit = 8, + kUSBInformationDeviceIsRootHub = 9, + kUSBInformationRootHubisBuiltIn = 10, + kUSBInformationDeviceIsRemote = 11, + kUSBInformationDeviceIsCaptiveMask = (1 << kUSBInformationDeviceIsCaptiveBit), + kUSBInformationDeviceIsAttachedToRootHubMask = (1 << kUSBInformationDeviceIsAttachedToRootHubBit), + kUSBInformationDeviceIsInternalMask = (1 << kUSBInformationDeviceIsInternalBit), + kUSBInformationDeviceIsConnectedMask = (1 << kUSBInformationDeviceIsConnectedBit), + kUSBInformationDeviceIsEnabledMask = (1 << kUSBInformationDeviceIsEnabledBit), + kUSBInformationDeviceIsSuspendedMask = (1 << kUSBInformationDeviceIsSuspendedBit), + kUSBInformationDeviceIsInResetMask = (1 << kUSBInformationDeviceIsInResetBit), + kUSBInformationDeviceOvercurrentMask = (1 << kUSBInformationDeviceOvercurrentBit), + kUSBInformationDevicePortIsInTestModeMask = (1 << kUSBInformationDevicePortIsInTestModeBit), + kUSBInformationDeviceIsRootHubMask = (1 << kUSBInformationDeviceIsRootHub), + kUSBInformationRootHubisBuiltInMask = (1 << kUSBInformationRootHubisBuiltIn), + kUSBInformationDeviceIsRemoteMask = (1 << kUSBInformationDeviceIsRemote) + } USBDeviceInformationBits; + + /*! + @enum USBPowerRequestTypes + @discussion Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs. + @constant kUSBPowerDuringSleep The power is to be used during sleep. + @constant kUSBPowerDuringWake The power is to be used while the system is awake (i.e not sleeping) + */ + typedef enum { + kUSBPowerDuringSleep = 0, + kUSBPowerDuringWake = 1 + } USBPowerRequestTypes; + + // Apple specific properties +#define kAppleCurrentAvailable "AAPL,current-available" +#define kAppleCurrentInSleep "AAPL,current-in-sleep" +#define kAppleCurrentExtra "AAPL,current-extra" +#define kAppleInternalUSBDevice "AAPL,device-internal" +#define kUSBBusID "AAPL,bus-id" + + +#ifdef __cplusplus +} +#endif + +#endif /* _USB_H */ diff --git a/i386/include/IOKit/usb/USBHub.h b/i386/include/IOKit/usb/USBHub.h new file mode 100644 index 0000000..4bbda15 --- /dev/null +++ b/i386/include/IOKit/usb/USBHub.h @@ -0,0 +1,240 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _USBHUB_H +#define _USBHUB_H + +#include <IOKit/usb/USB.h> +#include <IOKit/usb/USBSpec.h> + + /*! + @header USBHub.h + @abstract Constants and definitions used with Hub devices. + @discussion + */ + + /*! + @enum Hub Descriptor Type + @discussion + */ +enum { + kUSBHubDescriptorType = 0x29 +}; + + /*! + @enum HubFeatures + @discussion Used with SET_FEATURE to set hub and port features + */ +enum { + + kUSBHubLocalPowerChangeFeature = 0, /* Hub features */ + kUSBHubOverCurrentChangeFeature = 1, + + kUSBHubPortConnectionFeature = 0, /* port features */ + kUSBHubPortEnableFeature = 1, + kUSBHubPortSuspendFeature = 2, + kUSBHubPortOverCurrentFeature = 3, + kUSBHubPortResetFeature = 4, + kUSBHubPortPowerFeature = 8, + kUSBHubPortLowSpeedFeature = 9, + kUSBHubPortConnectionChangeFeature = 16, + kUSBHubPortEnableChangeFeature = 17, + kUSBHubPortSuspendChangeFeature = 18, + kUSBHubPortOverCurrentChangeFeature = 19, + kUSBHubPortResetChangeFeature = 20, + kUSBHubPortTestFeature = 21, + kUSBHubPortIndicatorFeature = 22 +}; + + /*! + @enum HubPortStatus + @discussion Used to decode the Port Status and Change + */ +enum { + kHubPortConnection = 0x0001, + kHubPortEnabled = 0x0002, + kHubPortSuspend = 0x0004, + kHubPortOverCurrent = 0x0008, + kHubPortBeingReset = 0x0010, + kHubPortPower = 0x0100, + kHubPortLowSpeed = 0x0200, + kHubPortHighSpeed = 0x0400, + kHubPortTestMode = 0x0800, + kHubPortIndicator = 0x1000, + + // these are the bits which cause the hub port state machine to keep moving + kHubPortStateChangeMask = kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset +}; + + + /*! + @enum HubStatus + @discussion Used to decode the Hub Status and Change + */ +enum { + kHubLocalPowerStatus = 1, + kHubOverCurrentIndicator = 2, + kHubLocalPowerStatusChange = 1, + kHubOverCurrentIndicatorChange = 2 +}; + + /*! + @enum HubCharacteristics + @discussion + */ +enum { + kPerPortSwitchingBit = (1 << 0), + kNoPowerSwitchingBit = (1 << 1), + kCompoundDeviceBit = (1 << 2), + kPerPortOverCurrentBit = (1 << 3), + kNoOverCurrentBit = (1 << 4), + + kHubPortIndicatorBit = 7, + kHubPortIndicatorMask = 0x0080 +}; + +/*! +@enum PowerSwitching + @discussion + */ +enum { + kHubSupportsGangPower = 0, + kHubSupportsIndividualPortPower = 1, + kHubPortSetPowerOff = 0, + kHubPortSetPowerOn = 1 +}; + +/*! +@enum PortIndicatorSelectors + @discussion + */ +enum { + kHubPortIndicatorAutomatic = 0, + kHubPortIndicatorAmber, + kHubPortIndicatorGreen, + kHubPortIndicatorOff +}; + +/*! + @enum Root Hub specific + @discussion + */ +enum { + kPrdRootHubApple = 0x8005, // ProductID for classic speed root hubs + kPrdRootHubAppleE = 0x8006, // ProductID for high speed root hubs + kUSBRootHubPollingRate = 32 // Enpoint polling rate interval for root hubs +}; + +/*! +@enum Hub Device Requests +@discussion Encoding of the hub specific standard requests +<tt> +<pre><b> +Request bmRequestType bRequest wValue wIndex wLength Data</b> +ClearHubFeature 0010 0000B CLEAR_FEATURE Feature Zero Zero None +ClearPortFeature 0010 0011B Feature Port Zero None + +GetBusState 1010 0011B GET_STATE Zero Port One Port Bus State + +GetHubDescriptor 1010 0000B GET_DESCRIPTOR Type Zero Length Descriptor + +GetHubStatus 1010 0000B GET_STATUS Zero Zero Four Hub Status +GetPortStatus 1010 0011B Zero Port Four Port Status + +SetHubDescriptor 0010 0000B SET_DESCRIPTOR Type Zero Length Descriptor + +SetHubFeature 0010 0000B SET_FEATURE Feature Zero Zero None +SetPortFeature 0010 0011B Feature Port Zero None +</pre> +</tt> + */ +enum { + kClearHubFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBClass, kUSBDevice), + kClearPortFeature = EncodeRequest(kUSBRqClearFeature, kUSBOut, kUSBClass, kUSBOther), + kGetPortState = EncodeRequest(kUSBRqGetState, kUSBIn, kUSBClass, kUSBOther), + kGetHubDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBIn, kUSBClass, kUSBDevice), + kGetHubStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBClass, kUSBDevice), + kGetPortStatus = EncodeRequest(kUSBRqGetStatus, kUSBIn, kUSBClass, kUSBOther), + kSetHubDescriptor = EncodeRequest(kUSBRqGetDescriptor, kUSBOut, kUSBClass, kUSBDevice), + kSetHubFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBClass, kUSBDevice), + kSetPortFeature = EncodeRequest(kUSBRqSetFeature, kUSBOut, kUSBClass, kUSBOther) +}; + + +/*! + @typedef IOUSBHubDescriptor + @discussion USB Hub Descriptor. See the USB HID Specification at <a href="http://www.usb.org"TARGET="_blank">http://www.usb.org</a>. +*/ +struct IOUSBHubDescriptor { + UInt8 length; + UInt8 hubType; + UInt8 numPorts; + UInt16 characteristics __attribute__((packed)); + UInt8 powerOnToGood; /* Port settling time, in 2ms */ + UInt8 hubCurrent; + /* These are received packed, will have to be unpacked */ + UInt8 removablePortFlags[8]; + UInt8 pwrCtlPortFlags[8]; +}; + +typedef struct IOUSBHubDescriptor IOUSBHubDescriptor; + +/*! + @typedef IOUSBHubStatus + @discussion Used to get the port status and change flags using GetPortStatus() +*/ +struct IOUSBHubStatus { + UInt16 statusFlags; + UInt16 changeFlags; +}; +typedef struct IOUSBHubStatus IOUSBHubStatus; +typedef IOUSBHubStatus * IOUSBHubStatusPtr; + +typedef struct IOUSBHubStatus IOUSBHubPortStatus; + + +/*! + @typedef IOUSBHubPortReEnumerateParam + @discussion Used to specify the port that needs to be reenumerated +*/ +typedef struct IOUSBHubPortReEnumerateParam IOUSBHubPortReEnumerateParam; + +struct IOUSBHubPortReEnumerateParam { + UInt32 portNumber; + UInt32 options; +}; + +typedef struct IOUSBHubPortClearTTParam IOUSBHubPortClearTTParam; + +struct IOUSBHubPortClearTTParam { + UInt32 portNumber; + UInt32 options; +#if 0 + UInt8 deviceAddress; <<0 + UInt8 endpointNum; <<8 + UInt8 endpointType; <<16 // As split transaction. 00 Control, 10 Bulk + UInt8 IN; <<24 // Direction, 1 = IN, 0 = OUT +#endif +}; + +#endif /* _USBHUB_H */ diff --git a/i386/include/IOKit/usb/USBSpec.h b/i386/include/IOKit/usb/USBSpec.h new file mode 100644 index 0000000..0665819 --- /dev/null +++ b/i386/include/IOKit/usb/USBSpec.h @@ -0,0 +1,470 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Constants that both OS9 and OSX want to define, and whose values are + * specified by the USB Standard. + * Put in a seperate file so they can be included if the OS9 include file isn't already + * included. + */ +#ifndef _USBSPEC_H +#define _USBSPEC_H + +#ifdef __cplusplus +extern "C" { +#endif + + /*! + @header USBSpec.h + @abstract Constants and definitions of parameters that are used in communcating with USB devices and interfaces. + @discussion + */ + + /*! + @enum Endpoint type + @discussion Used in IOUSBFindEndpointRequest's type field + */ +enum { + kUSBControl = 0, + kUSBIsoc = 1, + kUSBBulk = 2, + kUSBInterrupt = 3, + kUSBAnyType = 0xFF +}; + + /*! + @enum Endpoint direction + @discussion Used in IOUSBFindEndpointRequest's direction field + */ +enum { + kUSBOut = 0, + kUSBIn = 1, + kUSBNone = 2, + kUSBAnyDirn = 3 +}; + + /*! + @enum Device Request Type + @discussion This type is encoded in the bmRequestType field of a Device Request. It specifies the type of request: standard, class or vendor specific. + */ +enum { + kUSBStandard = 0, + kUSBClass = 1, + kUSBVendor = 2 +}; + + /*! + @enum Device Request Recipient + @discussion This recipient is encoded in the bmRequestType field of a Device Request. It specifies the type of recipient for a request: the device, the interface, or an endpoint. + */ +enum { + kUSBDevice = 0, + kUSBInterface = 1, + kUSBEndpoint = 2, + kUSBOther = 3 +}; + + /*! + @enum Device Request + @discussion Specifies values for the bRequest field of a Device Request. + */ +enum { + kUSBRqGetStatus = 0, + kUSBRqClearFeature = 1, + kUSBRqGetState = 2, + kUSBRqSetFeature = 3, + kUSBRqReserved2 = 4, + kUSBRqSetAddress = 5, + kUSBRqGetDescriptor = 6, + kUSBRqSetDescriptor = 7, + kUSBRqGetConfig = 8, + kUSBRqSetConfig = 9, + kUSBRqGetInterface = 10, + kUSBRqSetInterface = 11, + kUSBRqSyncFrame = 12 +}; + + /*! + @enum USB Descriptors + @discussion Specifies values for diffent descriptor types. + */ +enum { + kUSBAnyDesc = 0, // Wildcard for searches + kUSBDeviceDesc = 1, + kUSBConfDesc = 2, + kUSBStringDesc = 3, + kUSBInterfaceDesc = 4, + kUSBEndpointDesc = 5, + kUSBDeviceQualifierDesc = 6, + kUSBOtherSpeedConfDesc = 7, + kUSBInterfacePowerDesc = 8, + kUSBOnTheGoDesc = 9, + kUSDebugDesc = 10, + kUSBInterfaceAssociationDesc = 11, + kUSBHIDDesc = 0x21, + kUSBReportDesc = 0x22, + kUSBPhysicalDesc = 0x23, + kUSBHUBDesc = 0x29 +}; + + /*! + @enum Feature Selectors + @discussion Used with SET/CLEAR_FEATURE requests. + */ +enum { + kUSBFeatureEndpointStall = 0, + kUSBFeatureDeviceRemoteWakeup = 1 +}; + + /*! + @enum USB Power constants + @discussion Constants relating to USB Power. + */ +enum { + kUSB100mAAvailable = 50, + kUSB500mAAvailable = 250, + kUSB100mA = 50, + kUSBAtrBusPowered = 0x80, + kUSBAtrSelfPowered = 0x40, + kUSBAtrRemoteWakeup = 0x20 +}; + + /*! + @enum USB Release constants + @discussion Constants relating to USB releases as found in the bcdUSB field of the Device Descriptor. + */ +enum { + kUSBRel10 = 0x0100, + kUSBRel11 = 0x0110, + kUSBRel20 = 0x0200 +}; + + + /*! + @enum HID requests + @discussion Constants for HID requests. + */ +enum { + kHIDRqGetReport = 1, + kHIDRqGetIdle = 2, + kHIDRqGetProtocol = 3, + kHIDRqSetReport = 9, + kHIDRqSetIdle = 10, + kHIDRqSetProtocol = 11 +}; + + /*! + @enum HID report types + @discussion Constants for the three kinds of HID reports. + */ +enum { + kHIDRtInputReport = 1, + kHIDRtOutputReport = 2, + kHIDRtFeatureReport = 3 +}; + + + /*! + @enum HID Protocol + @discussion Used in the SET_PROTOCOL device request + */ +enum { + kHIDBootProtocolValue = 0, + kHIDReportProtocolValue = 1 +}; + + + +enum { + kUSBCapsLockKey = 0x39, + kUSBNumLockKey = 0x53, + kUSBScrollLockKey = 0x47 +}; + +/*! +@enum Device Class Codes + @discussion Constants for USB Device classes (bDeviceClass). + */ +enum { + kUSBCompositeClass = 0, + kUSBCommClass = 2, // Deprecated + kUSBCommunicationClass = 2, + kUSBHubClass = 9, + kUSBDataClass = 10, + kUSBPersonalHealthcareClass = 15, + kUSBDiagnosticClass = 220, + kUSBWirelessControllerClass = 224, + kUSBMiscellaneousClass = 239, + kUSBApplicationSpecificClass = 254, + kUSBVendorSpecificClass = 255 +}; + +/*! +@enum Interface Class + @discussion Constants for Interface classes (bInterfaceClass). + */ +enum { + kUSBAudioClass = 1, // Deprecated + kUSBAudioInterfaceClass = 1, + + kUSBCommunicationControlInterfaceClass = 2, + kUSBCommunicationDataInterfaceClass = 10, + + kUSBHIDClass = 3, + kUSBHIDInterfaceClass = 3, + + kUSBPhysicalInterfaceClass = 5, + + kUSBImageInterfaceClass = 6, + + kUSBPrintingClass = 7, // Deprecated + kUSBPrintingInterfaceClass = 7, + + kUSBMassStorageClass = 8, // Deprecated + kUSBMassStorageInterfaceClass = 8, + + kUSBChipSmartCardInterfaceClass = 11, + + kUSBContentSecurityInterfaceClass = 13, + + kUSBVideoInterfaceClass = 14, + + kUSBPersonalHealthcareInterfaceClass = 15, + + kUSBDiagnosticDeviceInterfaceClass = 220, + + kUSBWirelessControllerInterfaceClass = 224, + + kUSBApplicationSpecificInterfaceClass = 254, + + kUSBVendorSpecificInterfaceClass = 255 +}; + +// Obsolete +enum { + + kUSBDisplayClass = 4, // Obsolete +}; + +/*! + @enum Interface SubClass + @discussion Constants for USB Interface SubClasses (bInterfaceSubClass). +*/ +enum { + kUSBCompositeSubClass = 0, + + kUSBHubSubClass = 0, + + // For the kUSBAudioInterfaceClass + // + kUSBAudioControlSubClass = 0x01, + kUSBAudioStreamingSubClass = 0x02, + kUSBMIDIStreamingSubClass = 0x03, + + // For the kUSBApplicationSpecificInterfaceClass + // + kUSBDFUSubClass = 0x01, + kUSBIrDABridgeSubClass = 0x02, + kUSBTestMeasurementSubClass = 0x03, + + // For the kUSBMassStorageInterfaceClass + // + kUSBMassStorageRBCSubClass = 0x01, + kUSBMassStorageATAPISubClass = 0x02, + kUSBMassStorageQIC157SubClass = 0x03, + kUSBMassStorageUFISubClass = 0x04, + kUSBMassStorageSFF8070iSubClass = 0x05, + kUSBMassStorageSCSISubClass = 0x06, + + // For the kUSBHIDInterfaceClass + // + kUSBHIDBootInterfaceSubClass = 0x01, + + // For the kUSBCommunicationDataInterfaceClass + // + kUSBCommDirectLineSubClass = 0x01, + kUSBCommAbstractSubClass = 0x02, + kUSBCommTelephoneSubClass = 0x03, + kUSBCommMultiChannelSubClass = 0x04, + kUSBCommCAPISubClass = 0x05, + kUSBCommEthernetNetworkingSubClass = 0x06, + kUSBATMNetworkingSubClass = 0x07, + + // For the kUSBDiagnosticDeviceInterfaceClass + // + kUSBReprogrammableDiagnosticSubClass = 0x01, + + // For the kUSBWirelessControllerInterfaceClass + // + kUSBRFControllerSubClass = 0x01, + + // For the kUSBMiscellaneousClass + // + kUSBCommonClassSubClass = 0x02, + + // For the kUSBVideoInterfaceClass + // + kUSBVideoControlSubClass = 0x01, + kUSBVideoStreamingSubClass = 0x02, + kUSBVideoInterfaceCollectionSubClass = 0x03 + +}; + +/*! +@enum Interface Protocol + @discussion Reported in the bInterfaceProtocol field of the Interface Descriptor. + */ +enum { + + // For kUSBHIDInterfaceClass + // + kHIDNoInterfaceProtocol = 0, + kHIDKeyboardInterfaceProtocol = 1, + kHIDMouseInterfaceProtocol = 2, + kUSBVendorSpecificProtocol = 0xff, + + // For kUSBDiagnosticDeviceInterfaceClass + // + kUSB2ComplianceDeviceProtocol = 0x01, + + // For kUSBWirelessControllerInterfaceClass + // + kUSBBluetoothProgrammingInterfaceProtocol = 0x01, + + // For kUSBMiscellaneousClass + // + KUSBInterfaceAssociationDescriptorProtocol = 0x01 + +}; + + +/*! + @enum DFU Class Attributes + @discussion +*/ +enum { + kUSBDFUAttributesMask = 0x07, + kUSBDFUCanDownloadBit = 0, + kUSBDFUCanUploadBit = 1, + kUSBDFUManifestationTolerantBit = 2 +}; + +/*! + @enum Printer Class Requests + @discussion The bRequest parameter for Printing Class Sepcific Requests + */ +enum { + kUSPrintingClassGetDeviceID = 0, + kUSPrintingClassGePortStatus = 1, + kUSPrintingClassSoftReset = 2 +}; + + /*! +@enum Endpoint Descriptor bits + @discussion Bit definitions for endpoint descriptor fields + */ +enum { + kUSBbEndpointAddressMask = 0x0f, + kUSBbEndpointDirectionBit = 7, + kUSBbEndpointDirectionMask = ( 1 << kUSBbEndpointDirectionBit ), + kUSBEndpointDirectionOut = 0x00, + kUSBEndpointDirectionIn = 0x80, + kUSBEndpointbmAttributesTransferTypeMask = 0x03, + kUSBEndpointbmAttributesSynchronizationTypeMask = 0x0c, + kUSBEndpointbmAttributesSynchronizationTypeShift = 2, + kUSBEndpointbmAttributesUsageTypeMask = 0x30, + kUSBEndpointbmAttributesUsageTypeShift = 4 +}; + + /*! + @defineblock USB Descriptor and IORegistry constants + @discussion Various constants used to describe the fields in the various USB Device Descriptors and IORegistry names used for some of those fields + + @define kUSBDeviceClass The field in the USB Device Descriptor corresponding to the device class + @define kUSBDeviceSubClass The field in the USB Device Descriptor corresponding to the device sub class + @define kUSBDeviceProtocol The field in the USB Device Descriptor corresponding to the device protocol + @define kUSBDeviceMaxPacketSize The field in the USB Device Descriptor corresponding to the maximum packet size for endpoint 0 + @define kUSBVendorID The field in the USB Device Descriptor corresponding to the device USB Vendor ID + @define kUSBVendorName Deprecated. Use kUSBVendorID + @define kUSBProductID The field in the USB Device Descriptor corresponding to the device USB Product ID + @define kUSBProductName Deprecated. Use kUSBProductID + @define kUSBDeviceReleaseNumber The field in the USB Device Descriptor corresponding to the device release version + @define kUSBManufacturerStringIndex The field in the USB Device Descriptor corresponding to the index for the manufacturer's string + @define kUSBProductStringIndex The field in the USB Device Descriptor corresponding to the index for the product name's string + @define kUSBSerialNumberStringIndex The field in the USB Device Descriptor corresponding to the index for the serial number's string + @define kUSBDeviceNumConfigs The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBInterfaceNumber The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBAlternateSetting The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBNumEndpoints The field in the USB Configuration Descriptor corresponding to the number of configurations + @define kUSBInterfaceClass The field in the USB Interface Descriptor corresponding to the interface class + @define kUSBInterfaceSubClass The field in the USB Interface Descriptor corresponding to the interface sub class + @define kUSBInterfaceProtocol The field in the USB Interface Descriptor corresponding to the interface protocol + @define kUSBInterfaceStringIndex The field in the USB Interface Descriptor corresponding to the index for the interface name's string + @define kUSBConfigurationValue The field in the USB Interface Descriptor corresponding to the configuration + @define kUSBProductString IORegistry key for the device's USB Product string + @define kUSBVendorString IORegistry key for the device's USB manufacturer string + @define kUSBSerialNumberString IORegistry key for the device's USB serial number string + @define kUSB1284DeviceID IORegistry key for the 1284 Device ID of a printer + + */ +#define kUSBDeviceClass "bDeviceClass" +#define kUSBDeviceSubClass "bDeviceSubClass" +#define kUSBDeviceProtocol "bDeviceProtocol" +#define kUSBDeviceMaxPacketSize "bMaxPacketSize0" +#define kUSBVendorID "idVendor" // good name +#define kUSBVendorName kUSBVendorID // bad name - keep for backward compatibility +#define kUSBProductID "idProduct" // good name +#define kUSBProductName kUSBProductID // bad name - keep for backward compatibility +#define kUSBDeviceReleaseNumber "bcdDevice" +#define kUSBManufacturerStringIndex "iManufacturer" +#define kUSBProductStringIndex "iProduct" +#define kUSBSerialNumberStringIndex "iSerialNumber" +#define kUSBDeviceNumConfigs "bNumConfigurations" +#define kUSBInterfaceNumber "bInterfaceNumber" +#define kUSBAlternateSetting "bAlternateSetting" +#define kUSBNumEndpoints "bNumEndpoints" +#define kUSBInterfaceClass "bInterfaceClass" +#define kUSBInterfaceSubClass "bInterfaceSubClass" +#define kUSBInterfaceProtocol "bInterfaceProtocol" +#define kUSBInterfaceStringIndex "iInterface" +#define kUSBConfigurationValue "bConfigurationValue" +#define kUSBProductString "USB Product Name" +#define kUSBVendorString "USB Vendor Name" +#define kUSBSerialNumberString "USB Serial Number" +#define kUSB1284DeviceID "1284 Device ID" + /*! @/defineblock */ + + /*! + @enum Apple USB Vendor ID + @discussion Apple's vendor ID, assigned by the USB-IF +*/ +enum { + kAppleVendorID = 0x05AC +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _USBSPEC_H */ diff --git a/i386/include/IOKit/usb/USBTracepoints.h b/i386/include/IOKit/usb/USBTracepoints.h new file mode 100644 index 0000000..f2fe81e --- /dev/null +++ b/i386/include/IOKit/usb/USBTracepoints.h @@ -0,0 +1,662 @@ +/* + * Copyright � 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __IOKIT_IO_USB_FAMILY_TRACEPOINTS__ +#define __IOKIT_IO_USB_FAMILY_TRACEPOINTS__ + +#include <IOKit/IOTypes.h> + +#include <sys/kdebug.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define USB_SYSCTL "debug.USB" +#define kUSBTypeDebug 'USBD' +#define DEBUG_UNUSED( X ) ( void )( X ) + + extern UInt32 gUSBStackDebugFlags; + + typedef struct USBSysctlArgs + { + uint32_t type; + uint32_t operation; + uint32_t debugFlags; + } USBSysctlArgs; + + enum + { + kUSBOperationGetFlags = 0, + kUSBOperationSetFlags = 1 + }; + + // the following bits/masks are for use in the usb boot args + // e.g. boot-args="usb=0x102" will turn on Trace Points and set the EHCI retry count to 1 + // the bits can also be set with a sysctl call + enum + { + kUSBEnableDebugLoggingBit = 0, // bit 0 currently not used + kUSBEnableTracePointsBit = 1, // bit 1 used to turn on Trace Points when a USB controller first loads + kUSBEnableErrorLogBit = 2, // bit 2 (4) turns level 1 log for errors + kUSBDebugRetryCountShift = 8, // bits 8 and 9 will set the retry count for low level bus transactions + kUSBDebugRetryCountReserved = 9, // must be 1, 2, or 3 (0 is invalid, 3 is the default) + + kUSBEnableDebugLoggingMask = (1 << kUSBEnableDebugLoggingBit), + kUSBEnableTracePointsMask = (1 << kUSBEnableTracePointsBit), + kUSBDebugRetryCountMask = (3 << kUSBDebugRetryCountShift), + kUSBEnableErrorLogMask = (1 << kUSBEnableErrorLogBit) + }; + + + /* Kernel Tracepoints + * + * Kernel tracepoints are a logging mechanism reduces the size of a log-laden binary. + * Codes are placed into a buffer, from the kernel, and picked up by a userspace + * tool that displays a unique log message for each tracepoint. Additionally, each + * tracepoint may contain up-to four 32-bit (may change with LP64) arguments. + * + * To add a tracepoint, use the code below as an example: + * USBTrace( kUSBTController, kTPControllerStart, (uintptr_t)myArgValue ); + * Next, add the corresponding tracepoint code in the USBTracer tool, using + * the existing examples. Avoid using confidential information in the log strings. + * Some functions have a argument counter, to signify which of the function's tracepoints + * are actually being logged. When adding a tracepoint using an existing code, you + * must verify that you increment this argument counter properly. + * + * The trace codes consist of the following: + * + * ---------------------------------------------------------------------- + *| Class (8) | SubClass (8) | USBGroup(6) | Code (8) |Func | + *| DBG_IOKIT | DBG_IOUSB | | |Qual(2)| + * ---------------------------------------------------------------------- + * + * DBG_IOKIT(05h) DBG_IOUSB(2Dh) + * + * See <sys/kdebug.h> and IOTimeStamp.h for more details. + */ + + + // USB groupings (max of 64) + enum + { + // Family groupings + kUSBTController = 0, + kUSBTControllerUserClient = 1, + + kUSBTDevice = 2, + kUSBTDeviceUserClient = 3, + + kUSBTHub = 4, + kUSBTHubPort = 5, + kUSBTHSHubUserClient = 6, + kUSBTHID = 7, + kUSBTPipe = 8, + + kUSBTInterfaceUserClient = 9, + + kUSBTEnumeration = 10, // Tracepoints in various components to debug USB enumeration + + + // UIM groupings + kUSBTUHCI = 11, + kUSBTUHCIUIM = 12, + kUSBTUHCIInterrupts = 13, + + kUSBTOHCI = 14, + kUSBTOHCIInterrupts = 15, + + kUSBTEHCI = 20, + kUSBTEHCIHubInfo = 22, + kUSBTEHCIInterrupts = 23, + + // 30-33 reserved + + // 21-25 reserved + kUSBTHubPolicyMaker = 35, + kUSBTCompositeDriver = 36, + + // Actions + kUSBTOutstandingIO = 42, + + // kUSBAudio + kUSBAudio = 50 + + // 61-63 reserved + }; + + // USB Controller Tracepoints 0x052D0000 - 0x052D03FF + // kUSBTController + enum + { + kTPControllerStart = 1, + kTPControllerControlPacketHandler = 2, + kTPControllerMakeDevice = 3, + kTPControllerMakeHubDevice = 4, + kTPControllerCreateRootHubDevice = 5, + kTPControllerClearTTHandler = 6, + kTPControllerClearTT = 7, + kTPControllerDoCreateEP = 8, + kTPControllerReadV2 = 9, + kTPControllerReturnIsochDoneQueue = 10, + kTPControllersetPowerState = 11, + kTPControllerCheckPowerModeBeforeGatedCall = 12, + kTPControllerGatedPowerChange = 13, + kTPControllerCheckForRootHubChanges = 14, + kTPControllerRootHubQueueInterruptRead = 15, + kTPControllerRootHubTimer = 16, + kTPControllerDisjointCompletion = 17, + kTPControllerCheckForDisjointDescriptor = 18, + kTPControllerRead = 19, + kTPControllerV3Start = 20, + kTPAllocatePowerStateArray = 21, + kTPInitForPM = 22, + kTPIsocIOLL = 23, + kTPIsocIO = 24, + kTPControllerWrite = 25, + kTPCompletionCall = 26, + kTPControlTransaction = 27, + kTPInterruptTransaction = 28, + kTPInterruptTransactionData = 29, + kTPBulkTransaction = 30, + kTPBulkTransactionData = 31, + kTPIsocTransaction = 32, + kTPInterruptPacketHandler = 33, + kTPBulkPacketHandler = 34, + kTPDevZeroLock = 35, + kTPControlPacketHandlerData = 36, + kTPDoIOTransferIntrSync = 37, + kTPDoIOTransferBulkSync = 38, + kTPBulkPacketHandlerData = 39, + kTPInterruptPacketHandlerData = 40 + }; + + // USB Device Tracepoints + // kUSBTDevice + enum + { + kTPDeviceInit = 1, + kTPDeviceMessage = 2, + kTPDeviceResetDevice = 3, + kTPDeviceGetFullConfigurationDescriptor = 4, + kTPDeviceGetDeviceDescriptor = 5, + kTPDeviceGetConfigDescriptor = 6, + kTPDeviceSetConfiguration = 7, + kTPDeviceSetFeature = 8, + kTPDeviceDeviceRequest = 9, + kTPDeviceGetConfiguration = 10, + kTPDeviceGetDeviceStatus = 11, + kTPDeviceSuspendDevice = 12, + kTPDeviceReEnumerateDevice = 13, + kTPDeviceConfigLock = 14 + }; + + // USB Pipe Tracepoints + // kUSBTPipe + enum + { + kTPPipeInitToEndpoint = 1, + kTPBulkPipeRead = 2, + kTPBulkPipeWrite = 3, + kTPIsocPipeRead = 4, + kTPIsocPipeWrite = 5, + kTPIsocPipeReadLL = 6, + kTPIsocPipeWriteLL = 7, + kTPIBulkReadTS = 8, + kTPPipeControlRequest = 9, + kTPPipeControlRequestMemDesc = 10 + }; + + + // USB kUSBTControllerUserClient Tracepoints + // kUSBTControllerUserClient + enum + { + kTPControllerUCStart = 1, + kTPControllerUCOpen = 2, + kTPControllerUCReadRegister = 3, + kTPControllerUCWriteRegister = 4 + }; + + // USB kUSBTDeviceUserClient Tracepoints + // kUSBTDeviceUserClient + enum + { + kTPDeviceUCDeviceRequestIn = 1, + kTPDeviceUCDeviceRequestOut = 2, + kTPDeviceUCChangeOutstandingIO = 3, + kTPDeviceUCGetGatedOutstandingIO = 4, + kTPDeviceUCReqComplete = 5 + }; + + // USB InterfaceUserClient Tracepoints + // kUSBTInterfaceUserClient + enum + { + kTPInterfaceUCReadPipe = 1, + kTPInterfaceUCWritePipe = 2, + kTPInterfaceUCControlRequestOut = 3, + kTPInterfaceUCControlRequestIn = 4, + kTPInterfaceUCDoIsochPipeAsync = 5, + kTPInterfaceUCLowLatencyPrepareBuffer = 6, + kTPInterfaceUCChangeOutstandingIO = 7, + kTPInterfaceUCReqComplete = 8, + kTPInterfaceUCIsoReqComplete = 9, + kTPInterfaceUCLLIsoReqComplete = 10 + }; + + + // USB HSHubUserClient Tracepoints + // kUSBTHSHubUserClient + enum + { + kTPHSHubUCInitWithTask = 1, + kTPHSHubUCStart = 2, + kTPHSHubUCClose = 3, + kTPHSHubUCGetNumberOfPorts = 4, + kTPHSHubUCGetLocationID = 5, + kTPHSHubUCPutPortIntoTestMode = 6, + kTPHSHubUCSupportsIndicators = 7, + kTPHSHubUCSetIndicatorForPort = 8, + kTPHSHubUCGetPortIndicatorControl = 9, + kTPHSHubUCSetIndicatorsToAutomatic = 10, + kTPHSHubUCGetPowerSwitchingMode = 11, + kTPHSHubUCGetPortPower = 12, + kTPHSHubUCSetPortPower = 13, + kTPHSHubUCDisablePwrMgmt = 14 + }; + + // USB Hub Tracepoints + // kUSBTHub + enum + { + kTPHubStart = 1, + kTPHubMessage = 2, + kTPHubWillTerminate = 3, + kTPHubPowerStateWillChangeTo = 4, + kTPHubPowerChangeDone = 5, + kTPHubConfigureHub = 6, + kTPHubCheckPowerPowerRequirements = 7, + kTPHubHubPowerChange = 8, + kTPHubAreAllPortsDisconnectedOrSuspended= 9, + kTPHubSuspendPorts = 10, + kTPHubSetPortFeature = 11, + kTPHubClearPortFeature = 12, + kTPHubDoPortAction = 13, + kTPHubInterruptReadHandler = 14, + kTPHubResetPortZero = 15, + kTPHubProcessStateChanged = 16, + kTPHubRearmInterruptRead = 17, + kTPHubDoDeviceRequest = 18, + kTPHubWaitForPortResumes = 19, + kTPHubResetMyPort = 20, + kTPHubDecrementOutstandingIO = 21, + kTPHubChangeOutstandingIO = 22, + kTPHubChangeRaisedPowerState = 23, + kTPHubChangeOutstandingResumes = 24, + kTPHubEnterTestMode = 25, + kTPHubLeaveTestMode = 26, + kTPHubPutPortIntoTestMode = 27, + kTPHubGetPortIndicatorControl = 28, + kTPHubSetIndicatorsToAutomatic = 29, + kTPHubGetPortPower = 30, + kTPHubEnsureUsability = 31, + kTPHubCheckPowerRequirements = 32, + kTPHubWaitForPowerOn = 33, + kTPHubDoPortActionLock = 34, + kTPHubCheckForDeadDevice = 35 + }; + + // USB HubPort Tracepoints + // kUSBTHubPort + enum + { + kTPHubPortStop = 1, + kTPHubPortAddDevice = 2, + kTPHubPortSuspendPort = 3, + kTPHubPortFatalError = 4, + kTPHubPortAddDeviceResetChangeHandler = 5, + kTPHubPortHandleResetPortHandler = 6, + kTPHubPortDefaultOverCrntChangeHandler = 7, + kTPHubPortDefaultConnectionChangeHandler = 8, + kTPHubPortReleaseDevZeroLock = 9, + kTPHubPortDetachDevice = 10, + kTPHubPortGetDevZeroDescriptorWithRetries = 11, + kTPHubPortDisplayOverCurrentNotice = 12, + kTPHubPortWakeSuspendCommand = 13, + kTPHubPortWaitForSuspendCommand = 14, + kTPHubPortEnablePowerAfterOvercurrent = 15 + }; + + // USB HID Tracepoints + // kUSBTHID + enum + { + kTPHIDStart = 1, + kTPHIDpowerStateWillChangeTo = 2, + kTPHIDsetPowerState = 3, + kTPHIDpowerStateDidChangeTo = 4, + kTPHIDpowerChangeDone = 5, + kTPHIDhandleStart = 6, + kTPHIDClearFeatureEndpointHalt = 7, + kTPHIDHandleReport = 8, + kTPHIDSuspendPort = 9, + kTPHIDAbortAndSuspend = 10, + kTPHIDClaimPendingRead = 11, + kTPHIDChangeOutstandingIO = 12, + kTPHIDRearmInterruptRead = 13, + kTPHIDInitializeUSBHIDPowerManagement = 14, + kTPHIDInterruptRead = 15, + kTPHIDInterruptReadError = 16, + kTPHIDCheckForDeadDevice = 17 + }; + + // USB Enumeration Tracepoints + // kUSBTEnumeration + enum + { + kTPEnumerationProcessStatusChanged = 1, + kTPEnumerationInitialGetPortStatus = 2, + kTPEnumerationCallAddDevice = 3, + kTPEnumerationAddDevice = 4, + kTPEnumerationResetPort = 5, + kTPEnumerationAddDeviceResetChangeHandler = 6, + kTPEnumerationRegisterService = 7, + kTPEnumerationLowSpeedDevice = 8, + kTPEnumerationFullSpeedDevice = 9 + + }; + + // USB UHCI Tracepoints + // kUSBTUHCI + enum + { + kTPUHCIMessage = 1, + kTPUHCIGetFrameNumber = 2, + kTPUHCIScavengeIsocTransactions = 3, + kTPUHCIScavengeQueueHeads = 4, + kTPUHCIAllocateQH = 5, + kTPUHCIRootHubStatusChange = 6, + kTPUHCIRHSuspendPort = 7, + kTPUHCIRHHoldPortReset = 8, + kTPUHCIRHResumePortCompletion = 9, + kTPUHCISuspendController = 10, + KTPUHCIResumeController = 11, + KTPUHCIResetControllerState = 12, + KTPUHCIRestartControllerFromReset = 13, + KTPUHCIEnableInterrupts = 14, + KTPUHCIDozeController = 15, + KTPUHCIWakeFromDoze = 16, + KTPUHCIPowerState = 17, + }; + + + // USB UHCI Tracepoints + // kUSBTUHCIUIM + enum + { + kTPUHCIUIMCreateControlEndpoint = 1, + kTPUHCIUIMCreateBulkEndpoint = 2, + kTPUHCIUIMCreateInterruptEndpoint = 3, + kTPUHCIUIMCreateIsochEndpoint = 4, + kTPUHCIUIMCreateIsochTransfer = 5, + kTPUHCIUIMDeleteEndpoint = 6, + kTPUHCIUIMUnlinkQueueHead = 7, + kTPUHCIUIMCheckForTimeouts = 8, + kTPUHCIUIMReturnOneTransaction = 9, + kTPUHCIUIMAllocateTDChain = 10, + kTPUHCIUIMAddIsochFramesToSchedule = 11, + kTPUHCIUIMAbortIsochEP = 12, + kTPUHCIUIMCreateInterruptTransfer = 13, + kTPUHCIUIMHandleEndpointAbort = 14 + }; + + // USB UHCI Interrupt Tracepoints + // kUSBTUHCIInterrupts + enum + { + kTPUHCIInterruptsGetFrameNumberInternal = 1, + kTPUHCIInterruptsFilterInterrupt = 2, + kTPUHCIInterruptsHandleInterrupt = 3, + kTPUHCIUpdateFrameList = 4 + }; + + // USB EHCI Tracepoints + // kUSBTEHCI + enum + { + kTPEHCIRootHubResetPort = 1, + kTPEHCIRootHubPortEnable = 2, + kTPEHCIRootHubPortSuspend = 3, + // kTPEHCIRootHubStatusChange = 4, + kTPEHCIRHResumePortCompletion = 5, + kTPEHCIUIMFinalize = 6, + kTPEHCIGetFrameNumber32 = 7, + kTPEHCIGetFrameNumber = 8, + kTPEHCIAllocateQH = 9, + kTPEHCIEnableAsyncSchedule = 10, + kTPEHCIDisableAsyncSchedule = 11, + kTPEHCIEnablePeriodicSchedule = 12, + kTPEHCIDisablePeriodicSchedule = 13, + kTPEHCIMessage = 14, + kTPEHCIMakeEmptyEndPoint = 15, + kTPEHCIAllocateTDs = 16, + kTPEHCIMungeECHIStatus = 17, + kTPEHCIScavengeIsocTransactions = 18, + kTPEHCIScavengeAnEndpointQueue = 19, + kTPEHCIScavengeCompletedTransactions = 20, + kTPEHCICreateBulkEndpoint = 21, + kTPEHCICreateBulkTransfer = 22, + + kTPEHCICreateInterruptEndpoint = 24, + kTPEHCICreateIsochEndpoint = 25, + kTPEHCIAbortIsochEP = 26, + kTPEHCIHandleEndpointAbort = 27, + kTPEHCICreateInterruptTransfer = 28, + kTPEHCIUnlinkAsyncEndpoint = 29, + kTPEHCIDeleteEndpoint = 30, + kTPEHCICreateHSIsochTransfer = 31, + kTPEHCICreateSplitIsochTransfer = 32, + kTPEHCICreateIsochTransfer = 33, + kTPEHCIAddIsocFramesToSchedule = 34, + kTPEHCIReturnOneTransaction = 35, + kTPEHCICheckEDListForTimeouts = 36, + kTPEHCISuspendUSBBus = 37, + kTPEHCICheckForTimeouts = 38, + kTPEHCIResumeUSBBus = 39, + kTPEHCIRestartUSBBus = 40, + kTPEHCIResetControllerState = 41, + kTPEHCIDozeController = 42, + kTPEHCIWakeControllerFromDoze = 43, + kTPEHCIEnableInterrupts = 44, + kTPEHCIPowerState = 45, + kTPEHCIStopUSBBus = 46, + kTPEHCIRestartControllerFromReset = 47 + }; + + // USB EHCI Interrupt Tracepoints + // kUSBTEHCIInterrupts + enum + { + kTPEHCIInterruptsPollInterrupts = 1, + kTPEHCIInterruptsPrimaryInterruptFilter = 2, + kTPEHCIUpdateFrameList = 3, + }; + + + // USB EHCI Interrupt Tracepoints + // kUSBTEHCIHubInfo + enum + { + kTPEHCIAvailableIsochBandwidth = 1, + kTPEHCIAllocateIsochBandwidth = 2 + }; + + // USB OHCI Tracepoints + // kUSBTOHCI + enum + { + kTPOHCIInitialize = 1, + kTPOHCICreateGeneralTransfer = 2, + kTPOHCIAbortEndpoint = 3, + kTPOHCIDeleteEndpoint = 4, + kTPOHCIEndpointStall = 5, + kTPOHCICreateIsochTransfer = 6, + kTPOHCIAllocateTD = 7, + kTPOHCIAllocateITD = 8, + kTPOHCIAllocateED = 9, + kTPOHCIProcessCompletedITD = 10, + kTPOHCIReturnTransactions = 11, + kTPOHCIMessage = 12, + KTPOHCISuspendUSBBus = 13, + KTPOHCIResumeUSBBus = 14, + KTPOHCIResetControllerState = 15, + KTPOHCIRestartControllerFromReset = 16, + KTPOHCIEnableInterrupts = 17, + KTPOHCIDozeController = 18, + KTPOHCIWakeControllerFromDoze = 19, + KTPOHCIPowerState = 20, + kTPOHCIDoneQueueCompletion = 21 + }; + + // USB OHCI Interrupt Tracepoints + // kUSBTOHCIInterrupts + enum + { + kTPOHCIInterruptsPollInterrupts = 1, + kTPOHCIInterruptsPrimaryInterruptFilter = 2, + kTPOHCIUpdateFrameList = 3 + }; + + + // USB HubPolicyMaker Tracepoints + // kUSBTHubPolicyMaker + enum + { + kTPSetPowerState = 1 + }; + + // USB CompositeDriver Tracepoints + // kUSBTCompositeDriver + enum + { + kTPCompositeDriverConfigureDevice = 1 + }; + + // USB USB OutstandingIO Tracepoints + // kUSBTOutstandingIO + enum + { + kTPDeviceUCDecrement = 1, + kTPDeviceUCIncrement = 2, + kTPInterfaceUCDecrement = 3, + kTPInterfaceUCIncrement = 4, + kTPHubDecrement = 5, + kTPHubIncrement = 6, + kTPHIDDecrement = 7, + kTPHIDIncrement = 8 + }; + + // USB Audio driver Tracepoints + // kUSBAudio + enum + { + kTPAudioDriverRead = 1, + kTPAudioDriverCoalesceInputSamples = 2, + kTPAudioDriverCoalesceError = 3, + kTPAudioDriverCoalesce = 4, + kTPAudioDriverReadHandler = 5, + kTPAudioDriverCoalesceError2 = 6, + kTPAudioDriverConvertInputSamples = 7 + }; + + // Tracepoint macros. +#define USB_TRACE(USBClass, code, funcQualifier) ( ( ( DBG_IOKIT & 0xFF ) << 24) | ( ( DBG_IOUSB & 0xFF ) << 16 ) | ( ( USBClass & 0x3F ) << 10 ) | ( ( code & 0xFF ) << 2 ) | ( funcQualifier & 0x3 ) ) + +#define kTPAllUSB USB_TRACE ( 0, 0, 0 ) + +#define USB_CONTROLLER_TRACE(code) USB_TRACE( kUSBTController, code, DBG_FUNC_NONE ) +#define USB_CONTROLLER_UC_TRACE(code) USB_TRACE( kUSBTControllerUserClient, code, DBG_FUNC_NONE ) +#define USB_DEVICE_TRACE(code) USB_TRACE( kUSBTDevice, code, DBG_FUNC_NONE ) +#define USB_DEVICE_UC_TRACE(code) USB_TRACE( kUSBTDeviceUserClient, code, DBG_FUNC_NONE ) + +#define USB_HUB_TRACE(code) USB_TRACE( kUSBTHub, code, DBG_FUNC_NONE ) +#define USB_HUB_PORT_TRACE(code) USB_TRACE( kUSBTHubPort, code, DBG_FUNC_NONE ) +#define USB_HUB_UC_TRACE(code) USB_TRACE( kUSBTHSHubUserClient, code, DBG_FUNC_NONE ) +#define USB_HID_TRACE(code) USB_TRACE( kUSBTHID, code, DBG_FUNC_NONE ) +#define USB_PIPE_TRACE(code) USB_TRACE( kUSBTPipe, code, DBG_FUNC_NONE ) + +#define USB_INTERFACE_UC_TRACE(code) USB_TRACE( kUSBTInterfaceUserClient, code, DBG_FUNC_NONE ) + +#define USB_ENUMERATION_TRACE(code) USB_TRACE( kUSBTEnumeration, code, DBG_FUNC_NONE ) + +#define USB_UHCI_TRACE(code) USB_TRACE( kUSBTUHCI, code, DBG_FUNC_NONE ) +#define USB_UHCI_UIM_TRACE(code) USB_TRACE( kUSBTUHCIUIM, code, DBG_FUNC_NONE ) +#define USB_UHCI_INTERRUPTS_TRACE(code) USB_TRACE( kUSBTUHCIInterrupts, code, DBG_FUNC_NONE ) + +#define USB_OHCI_TRACE(code) USB_TRACE( kUSBTOHCI, code, DBG_FUNC_NONE ) +#define USB_OHCI_INTERRUPTS_TRACE(code) USB_TRACE( kUSBTOHCIInterrupts, code, DBG_FUNC_NONE ) + +#define USB_EHCI_TRACE(code) USB_TRACE( kUSBTEHCI, code, DBG_FUNC_NONE ) +#define USB_EHCI_HUBINFO_TRACE(code) USB_TRACE( kUSBTEHCIHubInfo, code, DBG_FUNC_NONE ) +#define USB_EHCI_INTERRUPTS_TRACE(code) USB_TRACE( kUSBTEHCIInterrupts, code, DBG_FUNC_NONE ) + +#define USB_HUB_POLICYMAKER_TRACE(code) USB_TRACE( kUSBTHubPolicyMaker, code, DBG_FUNC_NONE ) +#define USB_COMPOSITE_DRIVER_TRACE(code) USB_TRACE( kUSBTCompositeDriver, code, DBG_FUNC_NONE ) + +#define USB_OUTSTANDING_IO_TRACE(code) USB_TRACE( kUSBTOutstandingIO, code, DBG_FUNC_NONE ) + +#define USB_AUDIO_DRIVER_TRACE(code) USB_TRACE( kUSBAudio, code, DBG_FUNC_NONE ) + +#ifdef KERNEL + +#include <IOKit/IOTimeStamp.h> + +#define USBTrace(USBClass, code, a, b, c, d) { \ + if (gUSBStackDebugFlags & kUSBEnableTracePointsMask) { \ + IOTimeStampConstant( USB_TRACE(USBClass, code, DBG_FUNC_NONE), a, b, c, d ); \ + } \ + } + +#define USBTrace_Start(USBClass, code, a, b, c, d) { \ + if (gUSBStackDebugFlags & kUSBEnableTracePointsMask) { \ + IOTimeStampConstant( USB_TRACE(USBClass, code, DBG_FUNC_START), a, b, c, d ); \ + } \ + } + +#define USBTrace_End(USBClass, code, a, b, c, d) { \ + if (gUSBStackDebugFlags & kUSBEnableTracePointsMask) { \ + IOTimeStampConstant( USB_TRACE(USBClass, code, DBG_FUNC_END), a, b, c, d ); \ + } \ + } + +#endif + + + +#ifdef __cplusplus +} +#endif + + +#endif /* __IOKIT_IO_USB_FAMILY_TRACEPOINTS__ */ diff --git a/i386/include/_structs.h b/i386/include/_structs.h new file mode 100644 index 0000000..44443b2 --- /dev/null +++ b/i386/include/_structs.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include <sys/_structs.h> + diff --git a/i386/include/_types.h b/i386/include/_types.h new file mode 100644 index 0000000..6340283 --- /dev/null +++ b/i386/include/_types.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2004, 2008, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __TYPES_H_ +#define __TYPES_H_ + +#include <sys/_types.h> + +#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +#define __strfmonlike(fmtarg, firstvararg) \ + __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) +#define __strftimelike(fmtarg) \ + __attribute__((__format__ (__strftime__, fmtarg, 0))) +#else +#define __strfmonlike(fmtarg, firstvararg) +#define __strftimelike(fmtarg) +#endif + +typedef int __darwin_nl_item; +typedef int __darwin_wctrans_t; +#ifdef __LP64__ +typedef __uint32_t __darwin_wctype_t; +#else /* !__LP64__ */ +typedef unsigned long __darwin_wctype_t; +#endif /* __LP64__ */ + +#ifdef __WCHAR_MAX__ +#define __DARWIN_WCHAR_MAX __WCHAR_MAX__ +#else /* ! __WCHAR_MAX__ */ +#define __DARWIN_WCHAR_MAX 0x7fffffff +#endif /* __WCHAR_MAX__ */ + +#if __DARWIN_WCHAR_MAX > 0xffffU +#define __DARWIN_WCHAR_MIN (-0x7fffffff - 1) +#else +#define __DARWIN_WCHAR_MIN 0 +#endif +#define __DARWIN_WEOF ((__darwin_wint_t)-1) + +#ifndef _FORTIFY_SOURCE +# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) +# define _FORTIFY_SOURCE 0 +# else +# define _FORTIFY_SOURCE 2 /* on by default */ +# endif +#endif + +#endif /* __TYPES_H_ */ diff --git a/i386/include/architecture/.svn/all-wcprops b/i386/include/architecture/.svn/all-wcprops new file mode 100644 index 0000000..8e70b71 --- /dev/null +++ b/i386/include/architecture/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture +END +alignment.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/alignment.h +END +byte_order.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/byte_order.h +END diff --git a/i386/include/architecture/.svn/entries b/i386/include/architecture/.svn/entries new file mode 100644 index 0000000..1505bee --- /dev/null +++ b/i386/include/architecture/.svn/entries @@ -0,0 +1,102 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/architecture +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ppc +dir + +alignment.h +file + + + + +2013-08-27T23:54:33.000000Z +0190ac414caefeb1bf9ff77f7517daea +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1451 + +byte_order.h +file + + + + +2013-08-27T23:54:33.000000Z +1a4671fad1ac0d4d9d0e5ccc7472d23b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1218 + +i386 +dir + diff --git a/i386/include/architecture/.svn/text-base/alignment.h.svn-base b/i386/include/architecture/.svn/text-base/alignment.h.svn-base new file mode 100644 index 0000000..3a27fc4 --- /dev/null +++ b/i386/include/architecture/.svn/text-base/alignment.h.svn-base @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1999, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1996 NeXT Software, Inc. + * + * Natural alignment of shorts and longs. + * + * HISTORY + * + * 2 Sept 1992 Brian Raymor at NeXT + * Moved over to architecture. + * 18 August 1992 Jack Greenfield at NeXT + * Created. + */ + + +#if defined (__ppc__) +#include "architecture/ppc/alignment.h" +#elif defined (__i386__) +#include "architecture/i386/alignment.h" +#elif defined (__arm__) +#include "architecture/arm/alignment.h" +#else +#error architecture not supported +#endif + + diff --git a/i386/include/architecture/.svn/text-base/byte_order.h.svn-base b/i386/include/architecture/.svn/text-base/byte_order.h.svn-base new file mode 100644 index 0000000..4542986 --- /dev/null +++ b/i386/include/architecture/.svn/text-base/byte_order.h.svn-base @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Byte ordering conversion. + * + */ + +#ifndef _ARCHITECTURE_BYTE_ORDER_H_ +#define _ARCHITECTURE_BYTE_ORDER_H_ + +#include <libkern/OSByteOrder.h> + + +#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */ diff --git a/i386/include/architecture/alignment.h b/i386/include/architecture/alignment.h new file mode 100644 index 0000000..3a27fc4 --- /dev/null +++ b/i386/include/architecture/alignment.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1999, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1996 NeXT Software, Inc. + * + * Natural alignment of shorts and longs. + * + * HISTORY + * + * 2 Sept 1992 Brian Raymor at NeXT + * Moved over to architecture. + * 18 August 1992 Jack Greenfield at NeXT + * Created. + */ + + +#if defined (__ppc__) +#include "architecture/ppc/alignment.h" +#elif defined (__i386__) +#include "architecture/i386/alignment.h" +#elif defined (__arm__) +#include "architecture/arm/alignment.h" +#else +#error architecture not supported +#endif + + diff --git a/i386/include/architecture/byte_order.h b/i386/include/architecture/byte_order.h new file mode 100644 index 0000000..4542986 --- /dev/null +++ b/i386/include/architecture/byte_order.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Byte ordering conversion. + * + */ + +#ifndef _ARCHITECTURE_BYTE_ORDER_H_ +#define _ARCHITECTURE_BYTE_ORDER_H_ + +#include <libkern/OSByteOrder.h> + + +#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */ diff --git a/i386/include/architecture/i386/.svn/all-wcprops b/i386/include/architecture/i386/.svn/all-wcprops new file mode 100644 index 0000000..8279f9b --- /dev/null +++ b/i386/include/architecture/i386/.svn/all-wcprops @@ -0,0 +1,95 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386 +END +math.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/math.h +END +frame.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/frame.h +END +fpu.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/fpu.h +END +fenv.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/fenv.h +END +byte_order.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/byte_order.h +END +io.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/io.h +END +tss.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/tss.h +END +desc.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/desc.h +END +alignment.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/alignment.h +END +sel.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/sel.h +END +reg_help.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/reg_help.h +END +table.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/table.h +END +pio.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/pio.h +END +cpu.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/cpu.h +END +asm_help.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/i386/asm_help.h +END diff --git a/i386/include/architecture/i386/.svn/entries b/i386/include/architecture/i386/.svn/entries new file mode 100644 index 0000000..a60f611 --- /dev/null +++ b/i386/include/architecture/i386/.svn/entries @@ -0,0 +1,538 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/architecture/i386 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +math.h +file + + + + +2013-08-27T23:54:33.000000Z +bc55a74fec032a66780b4ed5f1391a75 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +24649 + +frame.h +file + + + + +2013-08-27T23:54:33.000000Z +82b93ee871209f4cd29409b8b7a67ad1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3219 + +fpu.h +file + + + + +2013-08-27T23:54:33.000000Z +bef899b22b6d0b4900b26fd4fc7ad355 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3551 + +fenv.h +file + + + + +2013-08-27T23:54:33.000000Z +7986cec8dd321f017f2778f02c83b25c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16515 + +byte_order.h +file + + + + +2013-08-27T23:54:33.000000Z +8f42be8af97b3d4bf3b29982765a7d77 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1169 + +io.h +file + + + + +2013-08-27T23:54:33.000000Z +6be62dc224678164fa1393c69b5f42ac +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1279 + +tss.h +file + + + + +2013-08-27T23:54:33.000000Z +6db46a2d6551dccf3dbdc0bcb72f221b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2676 + +desc.h +file + + + + +2013-08-27T23:54:33.000000Z +1c3fa6f953a15c937e453aa30add03bb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3140 + +alignment.h +file + + + + +2013-08-27T23:54:33.000000Z +45af69d25c1caf560e264ef2a6ae8df6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1852 + +sel.h +file + + + + +2013-08-27T23:54:33.000000Z +51ce5a7a97889cc935aa295c207af7d8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1440 + +reg_help.h +file + + + + +2013-08-27T23:54:33.000000Z +d80e893302817d02407fce764710aa82 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3292 + +table.h +file + + + + +2013-08-27T23:54:33.000000Z +9315a0c691aae9fd802e6ca54ca4e693 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2276 + +pio.h +file + + + + +2013-08-27T23:54:33.000000Z +e547e829472c0d32b0482115362cd22d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3174 + +cpu.h +file + + + + +2013-08-27T23:54:33.000000Z +683720dae764abe4f13eec48f78c758e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1604 + +asm_help.h +file + + + + +2013-08-27T23:54:33.000000Z +453247e046f9833bb802571de0d545a3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9138 + diff --git a/i386/include/architecture/i386/.svn/text-base/alignment.h.svn-base b/i386/include/architecture/i386/.svn/text-base/alignment.h.svn-base new file mode 100644 index 0000000..17dd0ef --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/alignment.h.svn-base @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Natural alignment of shorts and longs (for i386) + * + * HISTORY + * + * 2 Sept 1992 Brian Raymor at NeXT + * Moved over to architecture. + * 18 August 1992 Jack Greenfield at NeXT + * Created. + */ + +#ifndef _ARCH_I386_ALIGNMENT_H_ +#define _ARCH_I386_ALIGNMENT_H_ + +/* + * NOP + */ +__inline__ static unsigned short +get_align_short(void *ivalue) +{ + return *((unsigned short *) ivalue); +} + +__inline__ static unsigned short +put_align_short(unsigned short ivalue, void *ovalue) +{ + return *((unsigned short *) ovalue) = ivalue; +} + +/* + * NOP + */ +__inline__ static unsigned long +get_align_long(void *ivalue) +{ + return *((unsigned long *) ivalue); +} + +__inline__ static unsigned long +put_align_long(unsigned long ivalue, void *ovalue) +{ + return *((unsigned long *) ovalue) = ivalue; +} + +#endif /* _ARCH_I386_ALIGNMENT_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/asm_help.h.svn-base b/i386/include/architecture/i386/.svn/text-base/asm_help.h.svn-base new file mode 100644 index 0000000..0207c1d --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/asm_help.h.svn-base @@ -0,0 +1,398 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. + * + * File: architecture/i386/asm_help.h + * Author: Mike DeMoney, NeXT Computer, Inc. + * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. + * + * This header file defines macros useful when writing assembly code + * for the Intel i386 family processors. + * + * HISTORY + * 10-Mar-92 Bruce Martin (bmartin@next.com) + * Adapted to i386 + * 23-Jan-91 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_I386_ASM_HELP_H_ +#define _ARCH_I386_ASM_HELP_H_ + +#include <architecture/i386/reg_help.h> + + +#ifdef __ASSEMBLER__ + +#define ALIGN \ + .align 2, 0x90 + +#define ROUND_TO_STACK(len) \ + (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) + +#ifdef notdef +#if defined(__i386__) +#define CALL_MCOUNT \ + pushl %ebp ;\ + movl %esp, %ebp ;\ + .data ;\ + 1: .long 0 ;\ + .text ;\ + lea 9b,%edx ;\ + call mcount ;\ + popl %ebp ; +#elif defined(__x86_64__) +#define CALL_MCOUNT \ + pushq %rbp ;\ + movq %rsp, %rbp ;\ + .data ;\ + 1: .quad 0 ;\ + .text ;\ + lea 9b,%r13 ;\ + call mcount ;\ + popq %rbp ; +#endif +#else +#define CALL_MCOUNT +#endif + +/* + * Prologue for functions that may call other functions. Saves + * registers and sets up a C frame. + */ +#if defined(__i386__) +#define NESTED_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 1 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushl %ebp ;\ + movl %esp, %ebp ;\ + subl $__framesize, %esp ;\ + .endif ;\ + pushl %edi ;\ + pushl %esi ;\ + pushl %ebx +#elif defined(__x86_64__) +#define NESTED_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 1 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushq %rbp ;\ + movq %rsp, %rbp ;\ + subq $__framesize, %rsp ;\ + .endif ; +#endif + +/* + * Prologue for functions that do not call other functions. Does not + * save registers (this is the functions responsibility). Does set + * up a C frame. + */ +#if defined(__i386__) +#define LEAF_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 0 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushl %ebp ;\ + movl %esp, %ebp ;\ + subl $__framesize, %esp ;\ + .endif +#elif defined(__x86_64__) +#define LEAF_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 0 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushq %rbp ;\ + movq %rsp, %rbp ;\ + subq $__framesize, %rsp ;\ + .endif +#endif + +/* + * Epilogue for any function. + * + * We assume that all Leaf functions will be responsible for saving any + * local registers they clobber. + */ +#if defined(__i386__) +#define FUNCTION_EPILOGUE \ + .if __nested_function ;\ + popl %ebx ;\ + popl %esi ;\ + popl %edi ;\ + .endif ;\ + .if __framesize ;\ + movl %ebp, %esp ;\ + popl %ebp ;\ + .endif ;\ + ret +#elif defined(__x86_64__) +#define FUNCTION_EPILOGUE \ + .if __framesize ;\ + movq %rbp, %rsp ;\ + popq %rbp ;\ + .endif ;\ + ret +#endif + +/* + * Macros for declaring procedures + * + * Use of these macros allows ctags to have a predictable way + * to find various types of declarations. They also simplify + * inserting appropriate symbol table information. + * + * NOTE: these simple stubs will be replaced with more + * complicated versions once we know what the linker and gdb + * will require as far as register use masks and frame declarations. + * These macros may also be ifdef'ed in the future to contain profiling + * code. + * + */ + +/* + * TEXT -- declare start of text segment + */ +#define TEXT \ + .text + +/* + * DATA -- declare start of data segment + */ +#define DATA \ + .data + +/* + * LEAF -- declare global leaf procedure + * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only + * be jumped to. (A leaf may do an align.) Use a LABEL() if you + * need control to flow into the label. + */ +#define LEAF(name, localvarsize) \ + .globl name ;\ + ALIGN ;\ +name: ;\ + LEAF_FUNCTION_PROLOGUE(localvarsize) + +/* + * X_LEAF -- declare alternate global label for leaf + */ +#define X_LEAF(name, value) \ + .globl name ;\ + .set name,value + +/* + * P_LEAF -- declare private leaf procedure + */ +#define P_LEAF(name, localvarsize) \ + ALIGN ;\ +name: ;\ + LEAF_FUNCTION_PROLOGUE(localvarsize) + +/* + * LABEL -- declare a global code label + * MUST be used (rather than LEAF, NESTED, etc) if control + * "flows into" the label. + */ +#define LABEL(name) \ + .globl name ;\ +name: + +/* + * NESTED -- declare procedure that invokes other procedures + */ +#define NESTED(name, localvarsize) \ + .globl name ;\ + ALIGN ;\ +name: ;\ + NESTED_FUNCTION_PROLOGUE(localvarsize) + +/* + * X_NESTED -- declare alternate global label for nested proc + */ +#define X_NESTED(name, value) \ + .globl name ;\ + .set name,value + +/* + * P_NESTED -- declare private nested procedure + */ +#define P_NESTED(name, localvarsize) \ + ALIGN ;\ +name: ;\ + NESTED_FUNCTION_PROLOGUE(localvarsize) + +/* + * END -- mark end of procedure + */ +#define END(name) \ + FUNCTION_EPILOGUE + + +/* + * Storage definition macros + * The main purpose of these is to allow an easy handle for ctags + */ + +/* + * IMPORT -- import symbol + */ +#define IMPORT(name) \ + .reference name + +/* + * ABS -- declare global absolute symbol + */ +#define ABS(name, value) \ + .globl name ;\ + .set name,value + +/* + * P_ABS -- declare private absolute symbol + */ +#define P_ABS(name, value) \ + .set name,value + +/* + * EXPORT -- declare global label for data + */ +#define EXPORT(name) \ + .globl name ;\ +name: + +/* + * BSS -- declare global zero'ed storage + */ +#define BSS(name,size) \ + .comm name,size + + +/* + * P_BSS -- declare private zero'ed storage + */ +#define P_BSS(name,size) \ + .lcomm name,size + +/* + * dynamic/PIC macros for routines which reference external symbols + */ + +#if defined(__DYNAMIC__) +#if defined(__i386__) +#define PICIFY(var) \ + call 1f ; \ +1: ; \ + popl %edx ; \ + movl L ## var ## __non_lazy_ptr-1b(%edx),%edx +#elif defined(__x86_64__) +#define PICIFY(var) \ + movq var@GOTPCREL(%rip),%r11 +#endif + +#if defined(__i386__) +#define CALL_EXTERN_AGAIN(func) \ + PICIFY(func) ; \ + call *%edx +#elif defined(__x86_64__) +#define CALL_EXTERN_AGAIN(func) \ + call func +#endif + +#if defined(__i386__) +#define NON_LAZY_STUB(var) \ +.section __IMPORT,__pointers,non_lazy_symbol_pointers ; \ +L ## var ## __non_lazy_ptr: ; \ +.indirect_symbol var ; \ +.long 0 ; \ +.text +#elif defined(__x86_64__) +#define NON_LAZY_STUB(var) +#endif + +#define CALL_EXTERN(func) \ + CALL_EXTERN_AGAIN(func) ; \ + NON_LAZY_STUB(func) + +#if defined(__i386__) +#define BRANCH_EXTERN(func) \ + PICIFY(func) ; \ + jmp *%edx ; \ + NON_LAZY_STUB(func) +#elif defined(__x86_64__) +#define BRANCH_EXTERN(func) \ + jmp func +#endif + +#if defined(__i386__) +#define PUSH_EXTERN(var) \ + PICIFY(var) ; \ + movl (%edx),%edx ; \ + pushl %edx ; \ + NON_LAZY_STUB(var) +#endif + +#if defined(__i386__) +#define REG_TO_EXTERN(reg, var) \ + PICIFY(var) ; \ + movl reg, (%edx) ; \ + NON_LAZY_STUB(var) +#elif defined(__x86_64__) +#define REG_TO_EXTERN(reg, var) \ + PICIFY(var) ; \ + mov reg, (%r11) +#endif + +#if defined(__i386__) +#define EXTERN_TO_REG(var, reg) \ + call 1f ; \ +1: ; \ + popl %edx ; \ + movl L ## var ##__non_lazy_ptr-1b(%edx),reg ; \ + NON_LAZY_STUB(var) +#elif defined(__x86_64__) +#define EXTERN_TO_REG(var, reg) \ + PICIFY(var) ; \ + mov (%r11), reg +#endif + +#else +#define BRANCH_EXTERN(func) jmp func +#define PUSH_EXTERN(var) push var +#define CALL_EXTERN(func) call func +#define CALL_EXTERN_AGAIN(func) call func +#if defined(__i386__) +#define REG_TO_EXTERN(reg, var) mov reg, var +#define EXTERN_TO_REG(var, reg) mov $ ## var, reg +#elif defined(__x86_64__) +#define REG_TO_EXTERN(reg, var) mov reg, var ## (%rip) +#define EXTERN_TO_REG(var, reg) mov var ## (%rip), reg +#endif +#endif + +#endif /* __ASSEMBLER__ */ + +#endif /* _ARCH_I386_ASM_HELP_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/byte_order.h.svn-base b/i386/include/architecture/i386/.svn/text-base/byte_order.h.svn-base new file mode 100644 index 0000000..60afd0f --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/byte_order.h.svn-base @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ARCH_I386_BYTE_ORDER_H_ +#define _ARCH_I386_BYTE_ORDER_H_ + +/* + * Maintain source compatibility + */ + +#include <architecture/byte_order.h> + +#endif /* _ARCH_I386_BYTE_ORDER_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/cpu.h.svn-base b/i386/include/architecture/i386/.svn/text-base/cpu.h.svn-base new file mode 100644 index 0000000..c5fc807 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/cpu.h.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Special processor registers. + * + * HISTORY + * + * 5 April 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_CPU_H_ +#define _ARCH_I386_CPU_H_ + +/* + * Control register 0 + */ + +typedef struct _cr0 { + unsigned int pe :1, + mp :1, + em :1, + ts :1, + :1, + ne :1, + :10, + wp :1, + :1, + am :1, + :10, + nw :1, + cd :1, + pg :1; +} cr0_t; + +/* + * Debugging register 6 + */ + +typedef struct _dr6 { + unsigned int b0 :1, + b1 :1, + b2 :1, + b3 :1, + :9, + bd :1, + bs :1, + bt :1, + :16; +} dr6_t; + +#endif /* _ARCH_I386_CPU_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/desc.h.svn-base b/i386/include/architecture/i386/.svn/text-base/desc.h.svn-base new file mode 100644 index 0000000..3997a8a --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/desc.h.svn-base @@ -0,0 +1,150 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Segment descriptors. + * + * HISTORY + * + * 29 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_DESC_H_ +#define _ARCH_I386_DESC_H_ + +/* + * Code segment descriptor. + */ + +typedef struct code_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_CODE_EXEC 0x18 +#define DESC_CODE_READ 0x1a + dpl :2, + present :1; + unsigned char limit16 :4, + :2, + opsz :1, +#define DESC_CODE_16B 0 +#define DESC_CODE_32B 1 + granular:1; +#define DESC_GRAN_BYTE 0 +#define DESC_GRAN_PAGE 1 + unsigned char base24; +} code_desc_t; + +/* + * Data segment descriptor. + */ + +typedef struct data_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_DATA_RONLY 0x10 +#define DESC_DATA_WRITE 0x12 + dpl :2, + present :1; + unsigned char limit16 :4, + :2, + stksz :1, +#define DESC_DATA_16B 0 +#define DESC_DATA_32B 1 + granular:1; + unsigned char base24; +} data_desc_t; + +/* + * LDT segment descriptor. + */ + +typedef struct ldt_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_LDT 0x02 + :2, + present :1; + unsigned char limit16 :4, + :3, + granular:1; + unsigned char base24; +} ldt_desc_t; + +#include <architecture/i386/sel.h> + +/* + * Call gate descriptor. + */ + +typedef struct call_gate { + unsigned short offset00; + sel_t seg; + unsigned int argcnt :5, + :3, + type :5, +#define DESC_CALL_GATE 0x0c + dpl :2, + present :1, + offset16:16; +} call_gate_t; + +/* + * Trap gate descriptor. + */ + +typedef struct trap_gate { + unsigned short offset00; + sel_t seg; + unsigned int :8, + type :5, +#define DESC_TRAP_GATE 0x0f + dpl :2, + present :1, + offset16:16; +} trap_gate_t; + + +/* + * Interrupt gate descriptor. + */ + +typedef struct intr_gate { + unsigned short offset00; + sel_t seg; + unsigned int :8, + type :5, +#define DESC_INTR_GATE 0x0e + dpl :2, + present :1, + offset16:16; +} intr_gate_t; + +#endif /* _ARCH_I386_DESC_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/fenv.h.svn-base b/i386/include/architecture/i386/.svn/text-base/fenv.h.svn-base new file mode 100644 index 0000000..9a50747 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/fenv.h.svn-base @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: fenv.h * +* * +* Contains: typedefs and prototypes for C99 floating point environment. * +* * +*******************************************************************************/ + +#ifndef __FENV__ +#define __FENV__ + +#if defined( __ppc__ ) || defined( __ppc64__ ) + #error Wrong arch. This is Intel only. +#endif + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC fenv +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + A collection of functions designed to provide access to the floating + point environment for numerical programming. It is compliant with + the floating-point requirements in C99. + + Earlier versions of fenv.h were merely "modeled after" C9X. Many of the functions + that formerly returned ints now return void to be standard compliant. + + Note: There are actually two physical floating point environments on x86. There + is the one described by the x87 floating point control and status words, which applies + primarily to calculations done with long double on MacOS X for Intel. There is the + MXCSR which applies primarily to calculations done with scalar float, scalar double + and SSE/SSE2/SSE3. The high level interface, which uses FE_ macros as int arguments + to configure the fexcep_t, returns and works with values that represents the logical + OR of these two sets of flags or masks. That is, if a flag or mask is set in either + environment, it will be set in fexcept_t when the state is read. Likewise, setting + the mask using a fexcep_t will set that mask on both environments. For this reason, + changing the value of the MXCSR state or floating point control/status word state on + your own will make the results of the functions declared in this header undefined. + See below for details about how and when. Exception: you may change the FZ, DAZ, DE + and DM bits in the MXCSR independent of this interface and retain defined behavior, + so long as you do not change the other bits. It is suggested that developers who wish + this level of control access the bits in the fenv_t directly. They are direct copies + of the hardware special purpose registers of similar name. Please consult appropriate + Intel documentation for the processor about the meaning of various bits in each register. + + The file <fenv.h> declares many functions in support of numerical + programming. Programs that test flags or run under + non-default modes must do so under the effect of an enabling + "fenv_access" pragma. +*/ + +/******************************************************************************** +* * +* fenv_t is a type for representing the entire floating-point * +* environment in a single object. * +* * +* fexcept_t is a type for representing the floating-point * +* exception flag state collectively. * +* * +********************************************************************************/ +typedef struct { + unsigned short __control; /* A direct copy of the floaing point control word */ + unsigned short __status; /* A direct copy of the floaing point status word */ + unsigned int __mxcsr; /* A direct copy of the MXCSR */ + char __reserved[8]; /* Reserved for future expansion. */ +} fenv_t; + +typedef unsigned short fexcept_t; + +/* Definitions of floating-point exception macros */ +#define FE_INEXACT 0x0020 +#define FE_UNDERFLOW 0x0010 +#define FE_OVERFLOW 0x0008 +#define FE_DIVBYZERO 0x0004 +#define FE_INVALID 0x0001 +#define FE_ALL_EXCEPT 0x003D + +/* Definitions of rounding direction macros */ +#define FE_TONEAREST 0x0000 +#define FE_DOWNWARD 0x0400 +#define FE_UPWARD 0x0800 +#define FE_TOWARDZERO 0x0C00 + +/* default environment object */ +extern const fenv_t _FE_DFL_ENV; +#define FE_DFL_ENV &_FE_DFL_ENV /* pointer to default environment */ + +/******************************************************************************* +* A environment object that sets to defualt settings and in addition sets the * +* FZ and DAZ bits in the MXCSR, which causes flush-to-zero behavior of * +* denormals. When using this environment, denormals encountered by XMM based * +* calculation (which normally should be all single and double precision scalar * +* floating point calculations, and all SSE/SSE2/SSE3 computation) will be * +* treated as zero. Calculation results that are denormals will also be * +* truncated to zero. This calculation mode is not IEEE-754 compliant, but may * +* prevent lengthy stalls that occur in code that encounters denormals. It is * +* suggested that you do not use this mode unless you have established that * +* denormals are causing trouble for your code. Please use wisely. * +* * +* CAUTION: The math library currently is not architected to do the right * +* thing in the face of DAZ + FZ mode. For example, ceil( +denormal) returns * +* +denormal rather than 1.0 in some versions of MacOS X. In some circumstances * +* this may lead to unexpected application behavior. Use at your own risk. * +* * +* It is not possible to disable denorm stalls on calculation using the x87 FPU.* +*******************************************************************************/ +extern const fenv_t _FE_DFL_DISABLE_SSE_DENORMS_ENV; +#define FE_DFL_DISABLE_SSE_DENORMS_ENV &_FE_DFL_DISABLE_SSE_DENORMS_ENV + +/******************************************************************************* +* The following functions provide high level access to the exception flags.* +* The "int" input argument can be constructed by bitwise ORs of the * +* exception macros: for example: FE_OVERFLOW | FE_INEXACT. * +*******************************************************************************/ + +/******************************************************************************* +* The function "feclearexcept" clears the supported floating point * +* exceptions represented by its argument. * +*******************************************************************************/ + +extern int feclearexcept(int /*excepts*/); + + +/******************************************************************************* +* The function "fegetexceptflag" stores a implementation-defined * +* representation of the states of the floating-point status flags indicated * +* by its integer argument excepts in the object pointed to by the argument, * +* flagp. * +*******************************************************************************/ + +extern int fegetexceptflag(fexcept_t * /*flagp*/, int /*excepts*/); + + +/******************************************************************************* +* The function "feraiseexcept" raises the supported floating-point * +* exceptions represented by its argument. The order in which these * +* floating-point exceptions are raised is unspecified. * +*******************************************************************************/ + +extern int feraiseexcept(int /*excepts*/); + + +/******************************************************************************* +* The function "fesetexceptflag" sets or clears the floating point status * +* flags indicated by the argument excepts to the states stored in the * +* object pointed to by flagp. The value of the *flagp shall have been set * +* by a previous call to fegetexceptflag whose second argument represented * +* at least those floating-point exceptions represented by the argument * +* excepts. This function does not raise floating-point exceptions; it just * +* sets the state of the flags. * +*******************************************************************************/ + +extern int fesetexceptflag(const fexcept_t * /*flagp*/, int /*excepts*/); + + +/******************************************************************************* +* The function "fetestexcept" determines which of the specified subset of * +* the floating-point exception flags are currently set. The excepts * +* argument specifies the floating-point status flags to be queried. This * +* function returns the value of the bitwise OR of the floating-point * +* exception macros corresponding to the currently set floating-point * +* exceptions included in excepts. * +* * +* On MacOS X for Intel, the result is the value of union of the * +* corresponding result from the x87 and SSE floating point states. * +*******************************************************************************/ + +extern int fetestexcept(int /*excepts*/); + + +/******************************************************************************* +* The following functions provide control of rounding direction modes. * +*******************************************************************************/ + +/******************************************************************************* +* The function "fegetround" returns the value of the rounding direction * +* macro which represents the current rounding direction, or a negative * +* if there is no such rounding direction macro or the current rounding * +* direction is not determinable. * +*******************************************************************************/ + +extern int fegetround(void); + + +/******************************************************************************* +* The function "fesetround" establishes the rounding direction represented * +* by its argument "round". If the argument is not equal to the value of a * +* rounding direction macro, the rounding direction is not changed. It * +* returns zero if and only if the argument is equal to a rounding * +* direction macro. * +*******************************************************************************/ + +extern int fesetround(int /*round*/); + + +/******************************************************************************* +* The following functions manage the floating-point environment, exception * +* flags and dynamic modes, as one entity. * +*******************************************************************************/ + +/******************************************************************************* +* The fegetenv function stores the current floating-point enviornment in * +* the object pointed to by envp. * +*******************************************************************************/ +extern int fegetenv(fenv_t * /*envp*/); + +/******************************************************************************* +* The feholdexcept function saves the current floating-point environment in * +* the object pointed to by envp, clears the floating-point status flags, * +* and then installs a non-stop (continue on floating-point exceptions) * +* mode, if available, for all floating-point exceptions. The feholdexcept * +* function returns zero if and only if non-stop floating-point exceptions * +* handling was successfully installed. * +*******************************************************************************/ +extern int feholdexcept(fenv_t * /*envp*/); + +/******************************************************************************* +* The fesetnv function establishes the floating-point environment * +* represented by the object pointed to by envp. The argument envp shall * +* point to an object set by a call to fegetenv or feholdexcept, or equal to * +* a floating-point environment macro -- we define only *FE_DFL_ENV and * +* FE_DISABLE_SSE_DENORMS_ENV -- to be C99 standard compliant and portable * +* to other architectures. Note that fesetnv merely installs the state of * +* the floating-point status flags represented through its argument, and * +* does not raise these floating-point exceptions. * +* * +* On MacOS X for Intel you may test and set the bits in *envp yourself, * +* provided that you conditionalize the code appropriately to preserve * +* portability and you follow the various strictures and suggestions * +* provided by Intel in appropriate processor documentation. Please be aware * +* that because there are two hardware locations for setting and reading * +* floating point environment, this function (and others like it) are not * +* atomic -- that is, for a brief period of time during the function call * +* your new environment will have been applied to one but not both of the * +* floating point engines (x87 and SSE). In addition, the behavior of some * +* higher level interfaces (fegetround) is undefined if the x87 and SSE * +* floating point units rounding modes are configured differently. Please * +* use common sense. * +*******************************************************************************/ +extern int fesetenv(const fenv_t * /*envp*/); + +/******************************************************************************* +* The feupdateenv function saves the currently raised floating-point * +* exceptions in its automatic storage, installs the floating-point * +* environment represented by the object pointed to by envp, and then raises * +* the saved floating-point exceptions. The argument envp shall point to an * +* object set by a call to feholdexcept or fegetenv or equal a * +* floating-point environment macro. * +* * +* Please see the description of feholdexcept for additional ways to create * +* a fenv_t object, which are valid only for MacOS X for Intel. * +*******************************************************************************/ +extern int feupdateenv(const fenv_t * /*envp*/); + + +#ifdef __cplusplus +} +#endif + +#endif /* __FENV__ */ + diff --git a/i386/include/architecture/i386/.svn/text-base/fpu.h.svn-base b/i386/include/architecture/i386/.svn/text-base/fpu.h.svn-base new file mode 100644 index 0000000..29c260b --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/fpu.h.svn-base @@ -0,0 +1,170 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Floating Point unit. + * + * HISTORY + * + * 5 October 1992 ? at NeXT + * Added names to previously unamed fields in the mantissa. + * + * 5 April 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_FPU_H_ +#define _ARCH_I386_FPU_H_ + +/* + * Data register. + */ + +typedef struct fp_data_reg { + unsigned short mant; + unsigned short mant1 :16, + mant2 :16, + mant3 :16; + unsigned short exp :15, + sign :1; +} fp_data_reg_t; + +/* + * Data register stack. + */ + +typedef struct fp_stack { + fp_data_reg_t ST[8]; +} fp_stack_t; + +/* + * Register stack tag word. + */ + +typedef struct fp_tag { + unsigned short tag0 :2, + tag1 :2, + tag2 :2, + tag3 :2, + tag4 :2, + tag5 :2, + tag6 :2, + tag7 :2; +#define FP_TAG_VALID 0 +#define FP_TAG_ZERO 1 +#define FP_TAG_SPEC 2 +#define FP_TAG_EMPTY 3 +} fp_tag_t; + +/* + * Status word. + */ + +typedef struct fp_status { + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + stkflt :1, + errsumm :1, + c0 :1, + c1 :1, + c2 :1, + tos :3, + c3 :1, + busy :1; +} fp_status_t; + +/* + * Control word. + */ + +typedef struct fp_control { + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + :2, + pc :2, +#define FP_PREC_24B 0 +#define FP_PREC_53B 2 +#define FP_PREC_64B 3 + rc :2, +#define FP_RND_NEAR 0 +#define FP_RND_DOWN 1 +#define FP_RND_UP 2 +#define FP_CHOP 3 + /*inf*/ :1, + :3; +} fp_control_t; + +#include <architecture/i386/sel.h> + +/* + * Floating point 'environment' + * used by FSTENV/FLDENV instructions. + */ + +typedef struct fp_env { + fp_control_t control; + unsigned short :16; + fp_status_t status; + unsigned short :16; + fp_tag_t tag; + unsigned short :16; + unsigned int ip; + sel_t cs; + unsigned short opcode; + unsigned int dp; + sel_t ds; + unsigned short :16; +} fp_env_t; + +/* + * Floating point state + * used by FSAVE/FRSTOR instructions. + */ + +/* + * To allow the the common idiom of: + * #define environ (*_NSGetEnviron()) + * to be used these fields were renamed. Old code that that does + * not use this idiom can use the old field names by defining + * _ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ . + */ +typedef struct fp_state { +#if _ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ + fp_env_t environ; + fp_stack_t stack; +#else + fp_env_t fp_environ; + fp_stack_t fp_stack; +#endif +} fp_state_t; + +#endif /* _ARCH_I386_FPU_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/frame.h.svn-base b/i386/include/architecture/i386/.svn/text-base/frame.h.svn-base new file mode 100644 index 0000000..112cbcd --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/frame.h.svn-base @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Processor exception frame. + * + * HISTORY + * + * 31 August 1992 ? at NeXT + * Added v86 mode stuff. + * + * 8 June 1992 ? at NeXT + * Changed name of write field in err_code_t + * which collided with write() in shlib. + * + * 30 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_FRAME_H_ +#define _ARCH_I386_FRAME_H_ + +/* + * Format of the error code + * generated by the hardware + * for certain exceptions. + */ + +typedef union err_code { + struct err_code_normal { + unsigned int ext :1, + tbl :2, +#define ERR_GDT 0 +#define ERR_IDT 1 +#define ERR_LDT 2 + index :13, + :16; + } normal; + struct err_code_pgfault { + unsigned int prot :1, + wrtflt :1, + user :1, + :29; + } pgfault; +} err_code_t; + +#include <architecture/i386/sel.h> + +/* + * The actual hardware exception frame + * is variable in size. An error code is + * only pushed for certain exceptions. + * Previous stack information is only + * pushed for exceptions that cause a + * change in privilege level. The dpl + * field of the saved CS selector can be + * used to determine whether this is the + * case. If the interrupted task was + * executing in v86 mode, then the data + * segment registers are also present in + * the exception frame (in addition to + * previous stack information). This + * case can be determined by examining + * eflags. + */ + +typedef struct except_frame { + err_code_t err; + unsigned int eip; + sel_t cs; + unsigned int :0; + unsigned int eflags; + unsigned int esp; + sel_t ss; + unsigned int :0; + unsigned short v_es; + unsigned int :0; + unsigned short v_ds; + unsigned int :0; + unsigned short v_fs; + unsigned int :0; + unsigned short v_gs; + unsigned int :0; +} except_frame_t; + +/* + * Values in eflags. + */ + +#define EFL_CF 0x00001 +#define EFL_PF 0x00004 +#define EFL_AF 0x00010 +#define EFL_ZF 0x00040 +#define EFL_SF 0x00080 +#define EFL_TF 0x00100 +#define EFL_IF 0x00200 +#define EFL_DF 0x00400 +#define EFL_OF 0x00800 +#define EFL_IOPL 0x03000 +#define EFL_NT 0x04000 +#define EFL_RF 0x10000 +#define EFL_VM 0x20000 +#define EFL_AC 0x40000 + +#define EFL_CLR 0xfff88028 +#define EFL_SET 0x00000002 + +#endif /* _ARCH_I386_FRAME_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/io.h.svn-base b/i386/include/architecture/i386/.svn/text-base/io.h.svn-base new file mode 100644 index 0000000..07021a1 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/io.h.svn-base @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel 386 Family: IO space defines. + * + * HISTORY + * + * 11 August 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_IO_H_ +#define _ARCH_I386_IO_H_ + +typedef unsigned short io_addr_t; +typedef unsigned short io_len_t; + +#endif /* _ARCH_I386_IO_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/math.h.svn-base b/i386/include/architecture/i386/.svn/text-base/math.h.svn-base new file mode 100644 index 0000000..6723ef4 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/math.h.svn-base @@ -0,0 +1,642 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: math.h * +* * +* Contains: typedefs, prototypes, and macros germane to C99 floating point.* +* * +*******************************************************************************/ +#ifndef __MATH__ +#define __MATH__ + +#include "sys/cdefs.h" /* For definition of __DARWIN_UNIX03 et al */ + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** +* Floating point data types * +******************************************************************************/ + +/* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2, + taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may + define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler + must and may define only in float.h). +*/ +#if __FLT_EVAL_METHOD__ == 0 + typedef float float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 1 + typedef double float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1 + typedef long double float_t; + typedef long double double_t; +#else /* __FLT_EVAL_METHOD__ */ + #error "Unsupported value of __FLT_EVAL_METHOD__." +#endif /* __FLT_EVAL_METHOD__ */ + + +#if defined(__GNUC__) + #define HUGE_VAL __builtin_huge_val() + #define HUGE_VALF __builtin_huge_valf() + #define HUGE_VALL __builtin_huge_vall() + #define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */ + #define __MATH_H_ALWAYS_INLINE__ __attribute__ ((always_inline)) +#else + #define HUGE_VAL 1e500 + #define HUGE_VALF 1e50f + #define HUGE_VALL 1e5000L + #define NAN __nan( ) + #define __MATH_H_ALWAYS_INLINE__ +#endif + +#define INFINITY HUGE_VALF + + +/****************************************************************************** +* Taxonomy of floating point data types * +******************************************************************************/ + +#define FP_NAN 1 +#define FP_INFINITE 2 +#define FP_ZERO 3 +#define FP_NORMAL 4 +#define FP_SUBNORMAL 5 +#define FP_SUPERNORMAL 6 /* meaningful only on PowerPC */ + +/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */ +/* For single and double precision, the cost isn't too bad, because we can fall back on higher */ +/* precision hardware, with the necessary range to handle infinite precision products. However, */ +/* expect the long double fma to be at least an order of magnitude slower than a simple multiply */ +/* and an add. */ +#undef FP_FAST_FMA +#undef FP_FAST_FMAF +#undef FP_FAST_FMAL + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 (-2147483647 - 1) +#define FP_ILOGBNAN (-2147483647 - 1) + +/* Bitmasks for the math_errhandling macro. */ +#define MATH_ERRNO 1 /* errno set by math functions. */ +#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ + +#define math_errhandling (__math_errhandling()) +extern unsigned int __math_errhandling ( void ); + +/******************************************************************************** +* * +* Inquiry macros * +* * +* fpclassify Returns one of the FP_ values. * +* isnormal Non-zero if and only if the argument x is normalized. * +* isfinite Non-zero if and only if the argument x is finite. * +* isnan Non-zero if and only if the argument x is a NaN. * +* signbit Non-zero if and only if the sign of the argument x is * +* negative. This includes, NaNs, infinities and zeros. * +* * +********************************************************************************/ + +#define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __fpclassifyd((double)(x)) \ + : __fpclassify ((long double)(x))) + +extern int __fpclassifyf(float ); +extern int __fpclassifyd(double ); +extern int __fpclassify (long double); + +#if defined( __GNUC__ ) && 0 == __FINITE_MATH_ONLY__ + /* Yes, that's right. You only get the fast iswhatever() macros if you do NOT turn on -ffast-math. */ + /* These inline functions require the compiler to be compiling to standard in order to work. */ + /* -ffast-math, among other things, implies that NaNs don't happen. The compiler can in that case */ + /* optimize x != x to be false always, wheras it would be true for NaNs. That breaks __inline_isnan() */ + /* below. */ + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \ + : __inline_isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \ + : __inline_isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \ + : __inline_isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \ + : __inline_isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \ + : __inline_signbit((long double)(x))) + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned int __u[2]; }__u; __u.__f = __x; return (int)(__u.__u[1] >> 31); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; struct{ unsigned int __m[2]; short __sexp; }__p; }__u; __u.__ld = __x; return (int) (((unsigned short) __u.__p.__sexp) >> 15); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + +#else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnormald((double)(x)) \ + : __isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isfinited((double)(x)) \ + : __isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isinfd((double)(x)) \ + : __isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnand((double)(x)) \ + : __isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __signbitd((double)(x)) \ + : __signbitl((long double)(x))) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + extern int __isnormal (long double); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + extern int __isfinite (long double); + + extern int __isinff (float ); + extern int __isinfd (double ); + extern int __isinf (long double); + + extern int __isnanf (float ); + extern int __isnand (double ); + extern int __isnan (long double); + + extern int __signbitf (float ); + extern int __signbitd (double ); + extern int __signbitl (long double); + +#endif + + + +/******************************************************************************** +* * +* Math Functions * +* * +********************************************************************************/ + +extern double acos( double ); +extern float acosf( float ); + +extern double asin( double ); +extern float asinf( float ); + +extern double atan( double ); +extern float atanf( float ); + +extern double atan2( double, double ); +extern float atan2f( float, float ); + +extern double cos( double ); +extern float cosf( float ); + +extern double sin( double ); +extern float sinf( float ); + +extern double tan( double ); +extern float tanf( float ); + +extern double acosh( double ); +extern float acoshf( float ); + +extern double asinh( double ); +extern float asinhf( float ); + +extern double atanh( double ); +extern float atanhf( float ); + +extern double cosh( double ); +extern float coshf( float ); + +extern double sinh( double ); +extern float sinhf( float ); + +extern double tanh( double ); +extern float tanhf( float ); + +extern double exp ( double ); +extern float expf ( float ); + +extern double exp2 ( double ); +extern float exp2f ( float ); + +extern double expm1 ( double ); +extern float expm1f ( float ); + +extern double log ( double ); +extern float logf ( float ); + +extern double log10 ( double ); +extern float log10f ( float ); + +extern double log2 ( double ); +extern float log2f ( float ); + +extern double log1p ( double ); +extern float log1pf ( float ); + +extern double logb ( double ); +extern float logbf ( float ); + +extern double modf ( double, double * ); +extern float modff ( float, float * ); + +extern double ldexp ( double, int ); +extern float ldexpf ( float, int ); + +extern double frexp ( double, int * ); +extern float frexpf ( float, int * ); + +extern int ilogb ( double ); +extern int ilogbf ( float ); + +extern double scalbn ( double, int ); +extern float scalbnf ( float, int ); + +extern double scalbln ( double, long int ); +extern float scalblnf ( float, long int ); + +extern double fabs( double ); +extern float fabsf( float ); + +extern double cbrt( double ); +extern float cbrtf( float ); + +extern double hypot ( double, double ); +extern float hypotf ( float, float ); + +extern double pow ( double, double ); +extern float powf ( float, float ); + +extern double sqrt( double ); +extern float sqrtf( float ); + +extern double erf( double ); +extern float erff( float ); + +extern double erfc( double ); +extern float erfcf( float ); + +/* lgamma and lgammaf are not thread-safe. The thread-safe variants + * lgamma_r and lgammaf_r are available on OS X 10.6 and later. + * + * To use the thread-safe variants, you must define the _REENTRANT symbol. + */ +extern double lgamma( double ); +extern float lgammaf( float ); + +extern double tgamma( double ); +extern float tgammaf( float ); + +extern double ceil ( double ); +extern float ceilf ( float ); + +extern double floor ( double ); +extern float floorf ( float ); + +extern double nearbyint ( double ); +extern float nearbyintf ( float ); + +extern double rint ( double ); +extern float rintf ( float ); + +extern long int lrint ( double ); +extern long int lrintf ( float ); + +extern double round ( double ); +extern float roundf ( float ); + +extern long int lround ( double ); +extern long int lroundf ( float ); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + + /* long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrint ( double ); + extern long long int llrintf ( float ); + + extern long long int llround ( double ); + extern long long int llroundf ( float ); + +#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern double trunc ( double ); +extern float truncf ( float ); + +extern double fmod ( double, double ); +extern float fmodf ( float, float ); + +extern double remainder ( double, double ); +extern float remainderf ( float, float ); + +extern double remquo ( double, double, int * ); +extern float remquof ( float, float, int * ); + +extern double copysign ( double, double ); +extern float copysignf ( float, float ); + +extern double nan( const char * ); +extern float nanf( const char * ); + +extern double nextafter ( double, double ); +extern float nextafterf ( float, float ); + +extern double fdim ( double, double ); +extern float fdimf ( float, float ); + +extern double fmax ( double, double ); +extern float fmaxf ( float, float ); + +extern double fmin ( double, double ); +extern float fminf ( float, float ); + +extern double fma ( double, double, double ); +extern float fmaf ( float, float, float ); + +extern long double acosl(long double); +extern long double asinl(long double); +extern long double atanl(long double); +extern long double atan2l(long double, long double); +extern long double cosl(long double); +extern long double sinl(long double); +extern long double tanl(long double); +extern long double acoshl(long double); +extern long double asinhl(long double); +extern long double atanhl(long double); +extern long double coshl(long double); +extern long double sinhl(long double); +extern long double tanhl(long double); +extern long double expl(long double); +extern long double exp2l(long double); +extern long double expm1l(long double); +extern long double logl(long double); +extern long double log10l(long double); +extern long double log2l(long double); +extern long double log1pl(long double); +extern long double logbl(long double); +extern long double modfl(long double, long double *); +extern long double ldexpl(long double, int); +extern long double frexpl(long double, int *); +extern int ilogbl(long double); +extern long double scalbnl(long double, int); +extern long double scalblnl(long double, long int); +extern long double fabsl(long double); +extern long double cbrtl(long double); +extern long double hypotl(long double, long double); +extern long double powl(long double, long double); +extern long double sqrtl(long double); +extern long double erfl(long double); +extern long double erfcl(long double); + +/* lgammal is not thread-safe. + * The thread-safe variant lgammal_r is available on OS X 10.6 and later. + * + * To use the thread-safe variant, you must define the _REENTRANT symbol. + */ +extern long double lgammal(long double); + +extern long double tgammal(long double); +extern long double ceill(long double); +extern long double floorl(long double); +extern long double nearbyintl(long double); +extern long double rintl(long double); +extern long int lrintl(long double); +extern long double roundl(long double); +extern long int lroundl(long double); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + /* long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrintl(long double); + extern long long int llroundl(long double); +#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern long double truncl(long double); +extern long double fmodl(long double, long double); +extern long double remainderl(long double, long double); +extern long double remquol(long double, long double, int *); +extern long double copysignl(long double, long double); +extern long double nanl(const char *); +extern long double nextafterl(long double, long double); +extern double nexttoward(double, long double); +extern float nexttowardf(float, long double); +extern long double nexttowardl(long double, long double); +extern long double fdiml(long double, long double); +extern long double fmaxl(long double, long double); +extern long double fminl(long double, long double); +extern long double fmal(long double, long double, long double); + +#define isgreater(x, y) __builtin_isgreater ((x),(y)) +#define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y)) +#define isless(x, y) __builtin_isless ((x),(y)) +#define islessequal(x, y) __builtin_islessequal ((x),(y)) +#define islessgreater(x, y) __builtin_islessgreater ((x),(y)) +#define isunordered(x, y) __builtin_isunordered ((x),(y)) + +extern double __inf( void ); +extern float __inff( void ); +extern long double __infl( void ); +extern float __nan( void ); /* 10.3 (and later) must retain in ABI for backward compatability */ + +#if !defined(_ANSI_SOURCE) +extern double j0 ( double ); + +extern double j1 ( double ); + +extern double jn ( int, double ); + +extern double y0 ( double ); + +extern double y1 ( double ); + +extern double yn ( int, double ); + +extern double scalb ( double, double ); + + +#define M_E 2.71828182845904523536028747135266250 /* e */ +#define M_LOG2E 1.44269504088896340735992468100189214 /* log 2e */ +#define M_LOG10E 0.434294481903251827651128918916605082 /* log 10e */ +#define M_LN2 0.693147180559945309417232121458176568 /* log e2 */ +#define M_LN10 2.30258509299404568401799145468436421 /* log e10 */ +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */ +#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */ +#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ +#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */ +#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */ +#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */ +#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ + +#define MAXFLOAT ((float)3.40282346638528860e+38) +extern int signgam; /* required for unix 2003 */ + + +#endif /* !defined(_ANSI_SOURCE) */ + +#if !defined(__NOEXTENSIONS__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define __WANT_EXTENSIONS__ +#endif + +#ifdef __WANT_EXTENSIONS__ + +#define FP_SNAN FP_NAN +#define FP_QNAN FP_NAN + +extern long int rinttol ( double ); /* Legacy API: please use C99 lrint() instead. */ + +extern long int roundtol ( double ); /* Legacy API: please use C99 lround() instead. */ + +/* + * XOPEN/SVID + */ +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) +#if !defined(__cplusplus) +/* used by matherr below */ +struct exception { + int type; + char *name; + double arg1; + double arg2; + double retval; +}; +#endif + +#define HUGE MAXFLOAT + +/* + * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> + * (one may replace the following line by "#include <values.h>") + */ + +#define X_TLOSS 1.41484755040568800000e+16 + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#if !defined( __STRICT_ANSI__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern int finite ( double ); /* Legacy API: please use C99 isfinite() instead. */ + +extern double gamma ( double ); /* Legacy API: please use C99 tgamma() instead. */ + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if !defined(__cplusplus) +extern int matherr ( struct exception * ); +#endif + +/* + * IEEE Test Vector + */ +extern double significand ( double ); + +/* + * BSD math library entry points + */ +extern double drem ( double, double ); /* Legacy API: please use C99 remainder() instead. */ + +/* + * Reentrant version of lgamma; passes signgam back by reference + * as the second argument; user must allocate space for signgam. + */ + +#ifdef _REENTRANT + #include <AvailabilityMacros.h> + // Available on OS X 10.6 and later. + extern float lgammaf_r ( float, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + extern double lgamma_r ( double, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + extern long double lgammal_r ( long double, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; +#endif /* _REENTRANT */ + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#endif /* __WANT_EXTENSIONS__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MATH__ */ diff --git a/i386/include/architecture/i386/.svn/text-base/pio.h.svn-base b/i386/include/architecture/i386/.svn/text-base/pio.h.svn-base new file mode 100644 index 0000000..338f158 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/pio.h.svn-base @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +#ifndef _ARCH_I386_PIO_H_ +#define _ARCH_I386_PIO_H_ + +typedef unsigned short i386_ioport_t; + +#if defined(__GNUC__) +static __inline__ unsigned long inl( + i386_ioport_t port) +{ + unsigned long datum; + __asm__ volatile("inl %w1, %0" : "=a" (datum) : "Nd" (port)); + return(datum); +} + +static __inline__ unsigned short inw( + i386_ioport_t port) +{ + unsigned short datum; + __asm__ volatile("inw %w1, %w0" : "=a" (datum) : "Nd" (port)); + return(datum); +} + +static __inline__ unsigned char inb( + i386_ioport_t port) +{ + unsigned char datum; + __asm__ volatile("inb %w1, %b0" : "=a" (datum) : "Nd" (port)); + return(datum); +} + +static __inline__ void outl( + i386_ioport_t port, + unsigned long datum) +{ + __asm__ volatile("outl %0, %w1" : : "a" (datum), "Nd" (port)); +} + +static __inline__ void outw( + i386_ioport_t port, + unsigned short datum) +{ + __asm__ volatile("outw %w0, %w1" : : "a" (datum), "Nd" (port)); +} + +static __inline__ void outb( + i386_ioport_t port, + unsigned char datum) +{ + __asm__ volatile("outb %b0, %w1" : : "a" (datum), "Nd" (port)); +} +#endif /* defined(__GNUC__) */ +#endif /* _ARCH_I386_PIO_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/reg_help.h.svn-base b/i386/include/architecture/i386/.svn/text-base/reg_help.h.svn-base new file mode 100644 index 0000000..98c18c5 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/reg_help.h.svn-base @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. + * + * File: architecture/i386/reg_help.h + * Author: Mike DeMoney, NeXT Computer, Inc. + * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. + * + * This header file defines cpp macros useful for defining + * machine register and doing machine-level operations. + * + * HISTORY + * 10-Mar-92 Bruce Martin (bmartin@next.com) + * Adapted to i386 + * 23-Jan-91 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_I386_REG_HELP_H_ +#define _ARCH_I386_REG_HELP_H_ + +/* Bitfield definition aid */ +#define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) +#define BIT_WIDTH(pos) (1) /* mostly to record the position */ + +/* Mask creation */ +#define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) +#define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) +#define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) + +/* Register addresses */ +#if __ASSEMBLER__ +# define REG_ADDR(type, addr) (addr) +#else /* __ASSEMBLER__ */ +# define REG_ADDR(type, addr) (*(volatile type *)(addr)) +#endif /* __ASSEMBLER__ */ + +/* Cast a register to be an unsigned */ +#define CONTENTS(foo) (*(unsigned *) &(foo)) + +/* Stack pointer must always be a multiple of 4 */ +#define STACK_INCR 4 +#define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) + +/* STRINGIFY -- perform all possible substitutions, then stringify */ +#define __STR(x) #x /* just a helper macro */ +#define STRINGIFY(x) __STR(x) + +/* + * REG_PAIR_DEF -- define a register pair + * Register pairs are appropriately aligned to allow access via + * ld.d and st.d. + * + * Usage: + * struct foo { + * REG_PAIR_DEF( + * bar_t *, barp, + * afu_t, afu + * ); + * }; + * + * Access to individual entries of the pair is via the REG_PAIR + * macro (below). + */ +#define REG_PAIR_DEF(type0, name0, type1, name1) \ + struct { \ + type0 name0 __attribute__(( aligned(8) )); \ + type1 name1; \ + } name0##_##name1 + +/* + * REG_PAIR -- Macro to define names for accessing individual registers + * of register pairs. + * + * Usage: + * arg0 is first element of pair + * arg1 is second element of pair + * arg2 is desired element of pair + * eg: + * #define foo_barp REG_PAIR(barp, afu, afu) + */ +#define REG_PAIR(name0, name1, the_name) \ + name0##_##name1.the_name + +#endif /* _ARCH_I386_REG_HELP_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/sel.h.svn-base b/i386/include/architecture/i386/.svn/text-base/sel.h.svn-base new file mode 100644 index 0000000..80cb516 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/sel.h.svn-base @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Segment selector. + * + * HISTORY + * + * 29 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_SEL_H_ +#define _ARCH_I386_SEL_H_ + +/* + * Segment selector. + */ + +typedef struct sel { + unsigned short rpl :2, +#define KERN_PRIV 0 +#define USER_PRIV 3 + ti :1, +#define SEL_GDT 0 +#define SEL_LDT 1 + index :13; +} sel_t; + +#define NULL_SEL ((sel_t) { 0, 0, 0 } ) + +#endif /* _ARCH_I386_SEL_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/table.h.svn-base b/i386/include/architecture/i386/.svn/text-base/table.h.svn-base new file mode 100644 index 0000000..3ce1f81 --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/table.h.svn-base @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Descriptor tables. + * + * HISTORY + * + * 30 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_TABLE_H_ +#define _ARCH_I386_TABLE_H_ + +#include <architecture/i386/desc.h> +#include <architecture/i386/tss.h> + +/* + * A totally generic descriptor + * table entry. + */ + +typedef union dt_entry { + code_desc_t code; + data_desc_t data; + ldt_desc_t ldt; + tss_desc_t task_state; + call_gate_t call_gate; + trap_gate_t trap_gate; + intr_gate_t intr_gate; + task_gate_t task_gate; +} dt_entry_t; + +#define DESC_TBL_MAX 8192 + +/* + * Global descriptor table. + */ + +typedef union gdt_entry { + code_desc_t code; + data_desc_t data; + ldt_desc_t ldt; + call_gate_t call_gate; + task_gate_t task_gate; + tss_desc_t task_state; +} gdt_entry_t; + +typedef gdt_entry_t gdt_t; + +/* + * Interrupt descriptor table. + */ + +typedef union idt_entry { + trap_gate_t trap_gate; + intr_gate_t intr_gate; + task_gate_t task_gate; +} idt_entry_t; + +typedef idt_entry_t idt_t; + +/* + * Local descriptor table. + */ + +typedef union ldt_entry { + code_desc_t code; + data_desc_t data; + call_gate_t call_gate; + task_gate_t task_gate; +} ldt_entry_t; + +typedef ldt_entry_t ldt_t; + +#endif /* _ARCH_I386_TABLE_H_ */ diff --git a/i386/include/architecture/i386/.svn/text-base/tss.h.svn-base b/i386/include/architecture/i386/.svn/text-base/tss.h.svn-base new file mode 100644 index 0000000..7f060ec --- /dev/null +++ b/i386/include/architecture/i386/.svn/text-base/tss.h.svn-base @@ -0,0 +1,120 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Task State Segment. + * + * HISTORY + * + * 29 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_TSS_H_ +#define _ARCH_I386_TSS_H_ + +#include <architecture/i386/sel.h> + +/* + * Task State segment. + */ + +typedef struct tss { + sel_t oldtss; + unsigned int :0; + unsigned int esp0; + sel_t ss0; + unsigned int :0; + unsigned int esp1; + sel_t ss1; + unsigned int :0; + unsigned int esp2; + sel_t ss2; + unsigned int :0; + unsigned int cr3; + unsigned int eip; + unsigned int eflags; + unsigned int eax; + unsigned int ecx; + unsigned int edx; + unsigned int ebx; + unsigned int esp; + unsigned int ebp; + unsigned int esi; + unsigned int edi; + sel_t es; + unsigned int :0; + sel_t cs; + unsigned int :0; + sel_t ss; + unsigned int :0; + sel_t ds; + unsigned int :0; + sel_t fs; + unsigned int :0; + sel_t gs; + unsigned int :0; + sel_t ldt; + unsigned int :0; + unsigned int t :1, + :15, + io_bmap :16; +} tss_t; + +#define TSS_SIZE(n) (sizeof (struct tss) + (n)) + +/* + * Task State segment descriptor. + */ + +typedef struct tss_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_TSS 0x09 + dpl :2, + present :1; + unsigned char limit16 :4, + :3, + granular:1; + unsigned char base24; +} tss_desc_t; + +/* + * Task gate descriptor. + */ + +typedef struct task_gate { + unsigned short :16; + sel_t tss; + unsigned int :8, + type :5, +#define DESC_TASK_GATE 0x05 + dpl :2, + present :1, + :0; +} task_gate_t; + +#endif /* _ARCH_I386_TSS_H_ */ diff --git a/i386/include/architecture/i386/alignment.h b/i386/include/architecture/i386/alignment.h new file mode 100644 index 0000000..17dd0ef --- /dev/null +++ b/i386/include/architecture/i386/alignment.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Natural alignment of shorts and longs (for i386) + * + * HISTORY + * + * 2 Sept 1992 Brian Raymor at NeXT + * Moved over to architecture. + * 18 August 1992 Jack Greenfield at NeXT + * Created. + */ + +#ifndef _ARCH_I386_ALIGNMENT_H_ +#define _ARCH_I386_ALIGNMENT_H_ + +/* + * NOP + */ +__inline__ static unsigned short +get_align_short(void *ivalue) +{ + return *((unsigned short *) ivalue); +} + +__inline__ static unsigned short +put_align_short(unsigned short ivalue, void *ovalue) +{ + return *((unsigned short *) ovalue) = ivalue; +} + +/* + * NOP + */ +__inline__ static unsigned long +get_align_long(void *ivalue) +{ + return *((unsigned long *) ivalue); +} + +__inline__ static unsigned long +put_align_long(unsigned long ivalue, void *ovalue) +{ + return *((unsigned long *) ovalue) = ivalue; +} + +#endif /* _ARCH_I386_ALIGNMENT_H_ */ diff --git a/i386/include/architecture/i386/asm_help.h b/i386/include/architecture/i386/asm_help.h new file mode 100644 index 0000000..0207c1d --- /dev/null +++ b/i386/include/architecture/i386/asm_help.h @@ -0,0 +1,398 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. + * + * File: architecture/i386/asm_help.h + * Author: Mike DeMoney, NeXT Computer, Inc. + * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. + * + * This header file defines macros useful when writing assembly code + * for the Intel i386 family processors. + * + * HISTORY + * 10-Mar-92 Bruce Martin (bmartin@next.com) + * Adapted to i386 + * 23-Jan-91 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_I386_ASM_HELP_H_ +#define _ARCH_I386_ASM_HELP_H_ + +#include <architecture/i386/reg_help.h> + + +#ifdef __ASSEMBLER__ + +#define ALIGN \ + .align 2, 0x90 + +#define ROUND_TO_STACK(len) \ + (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) + +#ifdef notdef +#if defined(__i386__) +#define CALL_MCOUNT \ + pushl %ebp ;\ + movl %esp, %ebp ;\ + .data ;\ + 1: .long 0 ;\ + .text ;\ + lea 9b,%edx ;\ + call mcount ;\ + popl %ebp ; +#elif defined(__x86_64__) +#define CALL_MCOUNT \ + pushq %rbp ;\ + movq %rsp, %rbp ;\ + .data ;\ + 1: .quad 0 ;\ + .text ;\ + lea 9b,%r13 ;\ + call mcount ;\ + popq %rbp ; +#endif +#else +#define CALL_MCOUNT +#endif + +/* + * Prologue for functions that may call other functions. Saves + * registers and sets up a C frame. + */ +#if defined(__i386__) +#define NESTED_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 1 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushl %ebp ;\ + movl %esp, %ebp ;\ + subl $__framesize, %esp ;\ + .endif ;\ + pushl %edi ;\ + pushl %esi ;\ + pushl %ebx +#elif defined(__x86_64__) +#define NESTED_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 1 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushq %rbp ;\ + movq %rsp, %rbp ;\ + subq $__framesize, %rsp ;\ + .endif ; +#endif + +/* + * Prologue for functions that do not call other functions. Does not + * save registers (this is the functions responsibility). Does set + * up a C frame. + */ +#if defined(__i386__) +#define LEAF_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 0 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushl %ebp ;\ + movl %esp, %ebp ;\ + subl $__framesize, %esp ;\ + .endif +#elif defined(__x86_64__) +#define LEAF_FUNCTION_PROLOGUE(localvarsize) \ + .set __framesize,ROUND_TO_STACK(localvarsize) ;\ + .set __nested_function, 0 ;\ + CALL_MCOUNT \ + .if __framesize ;\ + pushq %rbp ;\ + movq %rsp, %rbp ;\ + subq $__framesize, %rsp ;\ + .endif +#endif + +/* + * Epilogue for any function. + * + * We assume that all Leaf functions will be responsible for saving any + * local registers they clobber. + */ +#if defined(__i386__) +#define FUNCTION_EPILOGUE \ + .if __nested_function ;\ + popl %ebx ;\ + popl %esi ;\ + popl %edi ;\ + .endif ;\ + .if __framesize ;\ + movl %ebp, %esp ;\ + popl %ebp ;\ + .endif ;\ + ret +#elif defined(__x86_64__) +#define FUNCTION_EPILOGUE \ + .if __framesize ;\ + movq %rbp, %rsp ;\ + popq %rbp ;\ + .endif ;\ + ret +#endif + +/* + * Macros for declaring procedures + * + * Use of these macros allows ctags to have a predictable way + * to find various types of declarations. They also simplify + * inserting appropriate symbol table information. + * + * NOTE: these simple stubs will be replaced with more + * complicated versions once we know what the linker and gdb + * will require as far as register use masks and frame declarations. + * These macros may also be ifdef'ed in the future to contain profiling + * code. + * + */ + +/* + * TEXT -- declare start of text segment + */ +#define TEXT \ + .text + +/* + * DATA -- declare start of data segment + */ +#define DATA \ + .data + +/* + * LEAF -- declare global leaf procedure + * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only + * be jumped to. (A leaf may do an align.) Use a LABEL() if you + * need control to flow into the label. + */ +#define LEAF(name, localvarsize) \ + .globl name ;\ + ALIGN ;\ +name: ;\ + LEAF_FUNCTION_PROLOGUE(localvarsize) + +/* + * X_LEAF -- declare alternate global label for leaf + */ +#define X_LEAF(name, value) \ + .globl name ;\ + .set name,value + +/* + * P_LEAF -- declare private leaf procedure + */ +#define P_LEAF(name, localvarsize) \ + ALIGN ;\ +name: ;\ + LEAF_FUNCTION_PROLOGUE(localvarsize) + +/* + * LABEL -- declare a global code label + * MUST be used (rather than LEAF, NESTED, etc) if control + * "flows into" the label. + */ +#define LABEL(name) \ + .globl name ;\ +name: + +/* + * NESTED -- declare procedure that invokes other procedures + */ +#define NESTED(name, localvarsize) \ + .globl name ;\ + ALIGN ;\ +name: ;\ + NESTED_FUNCTION_PROLOGUE(localvarsize) + +/* + * X_NESTED -- declare alternate global label for nested proc + */ +#define X_NESTED(name, value) \ + .globl name ;\ + .set name,value + +/* + * P_NESTED -- declare private nested procedure + */ +#define P_NESTED(name, localvarsize) \ + ALIGN ;\ +name: ;\ + NESTED_FUNCTION_PROLOGUE(localvarsize) + +/* + * END -- mark end of procedure + */ +#define END(name) \ + FUNCTION_EPILOGUE + + +/* + * Storage definition macros + * The main purpose of these is to allow an easy handle for ctags + */ + +/* + * IMPORT -- import symbol + */ +#define IMPORT(name) \ + .reference name + +/* + * ABS -- declare global absolute symbol + */ +#define ABS(name, value) \ + .globl name ;\ + .set name,value + +/* + * P_ABS -- declare private absolute symbol + */ +#define P_ABS(name, value) \ + .set name,value + +/* + * EXPORT -- declare global label for data + */ +#define EXPORT(name) \ + .globl name ;\ +name: + +/* + * BSS -- declare global zero'ed storage + */ +#define BSS(name,size) \ + .comm name,size + + +/* + * P_BSS -- declare private zero'ed storage + */ +#define P_BSS(name,size) \ + .lcomm name,size + +/* + * dynamic/PIC macros for routines which reference external symbols + */ + +#if defined(__DYNAMIC__) +#if defined(__i386__) +#define PICIFY(var) \ + call 1f ; \ +1: ; \ + popl %edx ; \ + movl L ## var ## __non_lazy_ptr-1b(%edx),%edx +#elif defined(__x86_64__) +#define PICIFY(var) \ + movq var@GOTPCREL(%rip),%r11 +#endif + +#if defined(__i386__) +#define CALL_EXTERN_AGAIN(func) \ + PICIFY(func) ; \ + call *%edx +#elif defined(__x86_64__) +#define CALL_EXTERN_AGAIN(func) \ + call func +#endif + +#if defined(__i386__) +#define NON_LAZY_STUB(var) \ +.section __IMPORT,__pointers,non_lazy_symbol_pointers ; \ +L ## var ## __non_lazy_ptr: ; \ +.indirect_symbol var ; \ +.long 0 ; \ +.text +#elif defined(__x86_64__) +#define NON_LAZY_STUB(var) +#endif + +#define CALL_EXTERN(func) \ + CALL_EXTERN_AGAIN(func) ; \ + NON_LAZY_STUB(func) + +#if defined(__i386__) +#define BRANCH_EXTERN(func) \ + PICIFY(func) ; \ + jmp *%edx ; \ + NON_LAZY_STUB(func) +#elif defined(__x86_64__) +#define BRANCH_EXTERN(func) \ + jmp func +#endif + +#if defined(__i386__) +#define PUSH_EXTERN(var) \ + PICIFY(var) ; \ + movl (%edx),%edx ; \ + pushl %edx ; \ + NON_LAZY_STUB(var) +#endif + +#if defined(__i386__) +#define REG_TO_EXTERN(reg, var) \ + PICIFY(var) ; \ + movl reg, (%edx) ; \ + NON_LAZY_STUB(var) +#elif defined(__x86_64__) +#define REG_TO_EXTERN(reg, var) \ + PICIFY(var) ; \ + mov reg, (%r11) +#endif + +#if defined(__i386__) +#define EXTERN_TO_REG(var, reg) \ + call 1f ; \ +1: ; \ + popl %edx ; \ + movl L ## var ##__non_lazy_ptr-1b(%edx),reg ; \ + NON_LAZY_STUB(var) +#elif defined(__x86_64__) +#define EXTERN_TO_REG(var, reg) \ + PICIFY(var) ; \ + mov (%r11), reg +#endif + +#else +#define BRANCH_EXTERN(func) jmp func +#define PUSH_EXTERN(var) push var +#define CALL_EXTERN(func) call func +#define CALL_EXTERN_AGAIN(func) call func +#if defined(__i386__) +#define REG_TO_EXTERN(reg, var) mov reg, var +#define EXTERN_TO_REG(var, reg) mov $ ## var, reg +#elif defined(__x86_64__) +#define REG_TO_EXTERN(reg, var) mov reg, var ## (%rip) +#define EXTERN_TO_REG(var, reg) mov var ## (%rip), reg +#endif +#endif + +#endif /* __ASSEMBLER__ */ + +#endif /* _ARCH_I386_ASM_HELP_H_ */ diff --git a/i386/include/architecture/i386/byte_order.h b/i386/include/architecture/i386/byte_order.h new file mode 100644 index 0000000..60afd0f --- /dev/null +++ b/i386/include/architecture/i386/byte_order.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _ARCH_I386_BYTE_ORDER_H_ +#define _ARCH_I386_BYTE_ORDER_H_ + +/* + * Maintain source compatibility + */ + +#include <architecture/byte_order.h> + +#endif /* _ARCH_I386_BYTE_ORDER_H_ */ diff --git a/i386/include/architecture/i386/cpu.h b/i386/include/architecture/i386/cpu.h new file mode 100644 index 0000000..c5fc807 --- /dev/null +++ b/i386/include/architecture/i386/cpu.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Special processor registers. + * + * HISTORY + * + * 5 April 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_CPU_H_ +#define _ARCH_I386_CPU_H_ + +/* + * Control register 0 + */ + +typedef struct _cr0 { + unsigned int pe :1, + mp :1, + em :1, + ts :1, + :1, + ne :1, + :10, + wp :1, + :1, + am :1, + :10, + nw :1, + cd :1, + pg :1; +} cr0_t; + +/* + * Debugging register 6 + */ + +typedef struct _dr6 { + unsigned int b0 :1, + b1 :1, + b2 :1, + b3 :1, + :9, + bd :1, + bs :1, + bt :1, + :16; +} dr6_t; + +#endif /* _ARCH_I386_CPU_H_ */ diff --git a/i386/include/architecture/i386/desc.h b/i386/include/architecture/i386/desc.h new file mode 100644 index 0000000..3997a8a --- /dev/null +++ b/i386/include/architecture/i386/desc.h @@ -0,0 +1,150 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Segment descriptors. + * + * HISTORY + * + * 29 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_DESC_H_ +#define _ARCH_I386_DESC_H_ + +/* + * Code segment descriptor. + */ + +typedef struct code_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_CODE_EXEC 0x18 +#define DESC_CODE_READ 0x1a + dpl :2, + present :1; + unsigned char limit16 :4, + :2, + opsz :1, +#define DESC_CODE_16B 0 +#define DESC_CODE_32B 1 + granular:1; +#define DESC_GRAN_BYTE 0 +#define DESC_GRAN_PAGE 1 + unsigned char base24; +} code_desc_t; + +/* + * Data segment descriptor. + */ + +typedef struct data_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_DATA_RONLY 0x10 +#define DESC_DATA_WRITE 0x12 + dpl :2, + present :1; + unsigned char limit16 :4, + :2, + stksz :1, +#define DESC_DATA_16B 0 +#define DESC_DATA_32B 1 + granular:1; + unsigned char base24; +} data_desc_t; + +/* + * LDT segment descriptor. + */ + +typedef struct ldt_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_LDT 0x02 + :2, + present :1; + unsigned char limit16 :4, + :3, + granular:1; + unsigned char base24; +} ldt_desc_t; + +#include <architecture/i386/sel.h> + +/* + * Call gate descriptor. + */ + +typedef struct call_gate { + unsigned short offset00; + sel_t seg; + unsigned int argcnt :5, + :3, + type :5, +#define DESC_CALL_GATE 0x0c + dpl :2, + present :1, + offset16:16; +} call_gate_t; + +/* + * Trap gate descriptor. + */ + +typedef struct trap_gate { + unsigned short offset00; + sel_t seg; + unsigned int :8, + type :5, +#define DESC_TRAP_GATE 0x0f + dpl :2, + present :1, + offset16:16; +} trap_gate_t; + + +/* + * Interrupt gate descriptor. + */ + +typedef struct intr_gate { + unsigned short offset00; + sel_t seg; + unsigned int :8, + type :5, +#define DESC_INTR_GATE 0x0e + dpl :2, + present :1, + offset16:16; +} intr_gate_t; + +#endif /* _ARCH_I386_DESC_H_ */ diff --git a/i386/include/architecture/i386/fenv.h b/i386/include/architecture/i386/fenv.h new file mode 100644 index 0000000..9a50747 --- /dev/null +++ b/i386/include/architecture/i386/fenv.h @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: fenv.h * +* * +* Contains: typedefs and prototypes for C99 floating point environment. * +* * +*******************************************************************************/ + +#ifndef __FENV__ +#define __FENV__ + +#if defined( __ppc__ ) || defined( __ppc64__ ) + #error Wrong arch. This is Intel only. +#endif + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC fenv +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + A collection of functions designed to provide access to the floating + point environment for numerical programming. It is compliant with + the floating-point requirements in C99. + + Earlier versions of fenv.h were merely "modeled after" C9X. Many of the functions + that formerly returned ints now return void to be standard compliant. + + Note: There are actually two physical floating point environments on x86. There + is the one described by the x87 floating point control and status words, which applies + primarily to calculations done with long double on MacOS X for Intel. There is the + MXCSR which applies primarily to calculations done with scalar float, scalar double + and SSE/SSE2/SSE3. The high level interface, which uses FE_ macros as int arguments + to configure the fexcep_t, returns and works with values that represents the logical + OR of these two sets of flags or masks. That is, if a flag or mask is set in either + environment, it will be set in fexcept_t when the state is read. Likewise, setting + the mask using a fexcep_t will set that mask on both environments. For this reason, + changing the value of the MXCSR state or floating point control/status word state on + your own will make the results of the functions declared in this header undefined. + See below for details about how and when. Exception: you may change the FZ, DAZ, DE + and DM bits in the MXCSR independent of this interface and retain defined behavior, + so long as you do not change the other bits. It is suggested that developers who wish + this level of control access the bits in the fenv_t directly. They are direct copies + of the hardware special purpose registers of similar name. Please consult appropriate + Intel documentation for the processor about the meaning of various bits in each register. + + The file <fenv.h> declares many functions in support of numerical + programming. Programs that test flags or run under + non-default modes must do so under the effect of an enabling + "fenv_access" pragma. +*/ + +/******************************************************************************** +* * +* fenv_t is a type for representing the entire floating-point * +* environment in a single object. * +* * +* fexcept_t is a type for representing the floating-point * +* exception flag state collectively. * +* * +********************************************************************************/ +typedef struct { + unsigned short __control; /* A direct copy of the floaing point control word */ + unsigned short __status; /* A direct copy of the floaing point status word */ + unsigned int __mxcsr; /* A direct copy of the MXCSR */ + char __reserved[8]; /* Reserved for future expansion. */ +} fenv_t; + +typedef unsigned short fexcept_t; + +/* Definitions of floating-point exception macros */ +#define FE_INEXACT 0x0020 +#define FE_UNDERFLOW 0x0010 +#define FE_OVERFLOW 0x0008 +#define FE_DIVBYZERO 0x0004 +#define FE_INVALID 0x0001 +#define FE_ALL_EXCEPT 0x003D + +/* Definitions of rounding direction macros */ +#define FE_TONEAREST 0x0000 +#define FE_DOWNWARD 0x0400 +#define FE_UPWARD 0x0800 +#define FE_TOWARDZERO 0x0C00 + +/* default environment object */ +extern const fenv_t _FE_DFL_ENV; +#define FE_DFL_ENV &_FE_DFL_ENV /* pointer to default environment */ + +/******************************************************************************* +* A environment object that sets to defualt settings and in addition sets the * +* FZ and DAZ bits in the MXCSR, which causes flush-to-zero behavior of * +* denormals. When using this environment, denormals encountered by XMM based * +* calculation (which normally should be all single and double precision scalar * +* floating point calculations, and all SSE/SSE2/SSE3 computation) will be * +* treated as zero. Calculation results that are denormals will also be * +* truncated to zero. This calculation mode is not IEEE-754 compliant, but may * +* prevent lengthy stalls that occur in code that encounters denormals. It is * +* suggested that you do not use this mode unless you have established that * +* denormals are causing trouble for your code. Please use wisely. * +* * +* CAUTION: The math library currently is not architected to do the right * +* thing in the face of DAZ + FZ mode. For example, ceil( +denormal) returns * +* +denormal rather than 1.0 in some versions of MacOS X. In some circumstances * +* this may lead to unexpected application behavior. Use at your own risk. * +* * +* It is not possible to disable denorm stalls on calculation using the x87 FPU.* +*******************************************************************************/ +extern const fenv_t _FE_DFL_DISABLE_SSE_DENORMS_ENV; +#define FE_DFL_DISABLE_SSE_DENORMS_ENV &_FE_DFL_DISABLE_SSE_DENORMS_ENV + +/******************************************************************************* +* The following functions provide high level access to the exception flags.* +* The "int" input argument can be constructed by bitwise ORs of the * +* exception macros: for example: FE_OVERFLOW | FE_INEXACT. * +*******************************************************************************/ + +/******************************************************************************* +* The function "feclearexcept" clears the supported floating point * +* exceptions represented by its argument. * +*******************************************************************************/ + +extern int feclearexcept(int /*excepts*/); + + +/******************************************************************************* +* The function "fegetexceptflag" stores a implementation-defined * +* representation of the states of the floating-point status flags indicated * +* by its integer argument excepts in the object pointed to by the argument, * +* flagp. * +*******************************************************************************/ + +extern int fegetexceptflag(fexcept_t * /*flagp*/, int /*excepts*/); + + +/******************************************************************************* +* The function "feraiseexcept" raises the supported floating-point * +* exceptions represented by its argument. The order in which these * +* floating-point exceptions are raised is unspecified. * +*******************************************************************************/ + +extern int feraiseexcept(int /*excepts*/); + + +/******************************************************************************* +* The function "fesetexceptflag" sets or clears the floating point status * +* flags indicated by the argument excepts to the states stored in the * +* object pointed to by flagp. The value of the *flagp shall have been set * +* by a previous call to fegetexceptflag whose second argument represented * +* at least those floating-point exceptions represented by the argument * +* excepts. This function does not raise floating-point exceptions; it just * +* sets the state of the flags. * +*******************************************************************************/ + +extern int fesetexceptflag(const fexcept_t * /*flagp*/, int /*excepts*/); + + +/******************************************************************************* +* The function "fetestexcept" determines which of the specified subset of * +* the floating-point exception flags are currently set. The excepts * +* argument specifies the floating-point status flags to be queried. This * +* function returns the value of the bitwise OR of the floating-point * +* exception macros corresponding to the currently set floating-point * +* exceptions included in excepts. * +* * +* On MacOS X for Intel, the result is the value of union of the * +* corresponding result from the x87 and SSE floating point states. * +*******************************************************************************/ + +extern int fetestexcept(int /*excepts*/); + + +/******************************************************************************* +* The following functions provide control of rounding direction modes. * +*******************************************************************************/ + +/******************************************************************************* +* The function "fegetround" returns the value of the rounding direction * +* macro which represents the current rounding direction, or a negative * +* if there is no such rounding direction macro or the current rounding * +* direction is not determinable. * +*******************************************************************************/ + +extern int fegetround(void); + + +/******************************************************************************* +* The function "fesetround" establishes the rounding direction represented * +* by its argument "round". If the argument is not equal to the value of a * +* rounding direction macro, the rounding direction is not changed. It * +* returns zero if and only if the argument is equal to a rounding * +* direction macro. * +*******************************************************************************/ + +extern int fesetround(int /*round*/); + + +/******************************************************************************* +* The following functions manage the floating-point environment, exception * +* flags and dynamic modes, as one entity. * +*******************************************************************************/ + +/******************************************************************************* +* The fegetenv function stores the current floating-point enviornment in * +* the object pointed to by envp. * +*******************************************************************************/ +extern int fegetenv(fenv_t * /*envp*/); + +/******************************************************************************* +* The feholdexcept function saves the current floating-point environment in * +* the object pointed to by envp, clears the floating-point status flags, * +* and then installs a non-stop (continue on floating-point exceptions) * +* mode, if available, for all floating-point exceptions. The feholdexcept * +* function returns zero if and only if non-stop floating-point exceptions * +* handling was successfully installed. * +*******************************************************************************/ +extern int feholdexcept(fenv_t * /*envp*/); + +/******************************************************************************* +* The fesetnv function establishes the floating-point environment * +* represented by the object pointed to by envp. The argument envp shall * +* point to an object set by a call to fegetenv or feholdexcept, or equal to * +* a floating-point environment macro -- we define only *FE_DFL_ENV and * +* FE_DISABLE_SSE_DENORMS_ENV -- to be C99 standard compliant and portable * +* to other architectures. Note that fesetnv merely installs the state of * +* the floating-point status flags represented through its argument, and * +* does not raise these floating-point exceptions. * +* * +* On MacOS X for Intel you may test and set the bits in *envp yourself, * +* provided that you conditionalize the code appropriately to preserve * +* portability and you follow the various strictures and suggestions * +* provided by Intel in appropriate processor documentation. Please be aware * +* that because there are two hardware locations for setting and reading * +* floating point environment, this function (and others like it) are not * +* atomic -- that is, for a brief period of time during the function call * +* your new environment will have been applied to one but not both of the * +* floating point engines (x87 and SSE). In addition, the behavior of some * +* higher level interfaces (fegetround) is undefined if the x87 and SSE * +* floating point units rounding modes are configured differently. Please * +* use common sense. * +*******************************************************************************/ +extern int fesetenv(const fenv_t * /*envp*/); + +/******************************************************************************* +* The feupdateenv function saves the currently raised floating-point * +* exceptions in its automatic storage, installs the floating-point * +* environment represented by the object pointed to by envp, and then raises * +* the saved floating-point exceptions. The argument envp shall point to an * +* object set by a call to feholdexcept or fegetenv or equal a * +* floating-point environment macro. * +* * +* Please see the description of feholdexcept for additional ways to create * +* a fenv_t object, which are valid only for MacOS X for Intel. * +*******************************************************************************/ +extern int feupdateenv(const fenv_t * /*envp*/); + + +#ifdef __cplusplus +} +#endif + +#endif /* __FENV__ */ + diff --git a/i386/include/architecture/i386/fpu.h b/i386/include/architecture/i386/fpu.h new file mode 100644 index 0000000..29c260b --- /dev/null +++ b/i386/include/architecture/i386/fpu.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Floating Point unit. + * + * HISTORY + * + * 5 October 1992 ? at NeXT + * Added names to previously unamed fields in the mantissa. + * + * 5 April 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_FPU_H_ +#define _ARCH_I386_FPU_H_ + +/* + * Data register. + */ + +typedef struct fp_data_reg { + unsigned short mant; + unsigned short mant1 :16, + mant2 :16, + mant3 :16; + unsigned short exp :15, + sign :1; +} fp_data_reg_t; + +/* + * Data register stack. + */ + +typedef struct fp_stack { + fp_data_reg_t ST[8]; +} fp_stack_t; + +/* + * Register stack tag word. + */ + +typedef struct fp_tag { + unsigned short tag0 :2, + tag1 :2, + tag2 :2, + tag3 :2, + tag4 :2, + tag5 :2, + tag6 :2, + tag7 :2; +#define FP_TAG_VALID 0 +#define FP_TAG_ZERO 1 +#define FP_TAG_SPEC 2 +#define FP_TAG_EMPTY 3 +} fp_tag_t; + +/* + * Status word. + */ + +typedef struct fp_status { + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + stkflt :1, + errsumm :1, + c0 :1, + c1 :1, + c2 :1, + tos :3, + c3 :1, + busy :1; +} fp_status_t; + +/* + * Control word. + */ + +typedef struct fp_control { + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + :2, + pc :2, +#define FP_PREC_24B 0 +#define FP_PREC_53B 2 +#define FP_PREC_64B 3 + rc :2, +#define FP_RND_NEAR 0 +#define FP_RND_DOWN 1 +#define FP_RND_UP 2 +#define FP_CHOP 3 + /*inf*/ :1, + :3; +} fp_control_t; + +#include <architecture/i386/sel.h> + +/* + * Floating point 'environment' + * used by FSTENV/FLDENV instructions. + */ + +typedef struct fp_env { + fp_control_t control; + unsigned short :16; + fp_status_t status; + unsigned short :16; + fp_tag_t tag; + unsigned short :16; + unsigned int ip; + sel_t cs; + unsigned short opcode; + unsigned int dp; + sel_t ds; + unsigned short :16; +} fp_env_t; + +/* + * Floating point state + * used by FSAVE/FRSTOR instructions. + */ + +/* + * To allow the the common idiom of: + * #define environ (*_NSGetEnviron()) + * to be used these fields were renamed. Old code that that does + * not use this idiom can use the old field names by defining + * _ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ . + */ +typedef struct fp_state { +#if _ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ + fp_env_t environ; + fp_stack_t stack; +#else + fp_env_t fp_environ; + fp_stack_t fp_stack; +#endif +} fp_state_t; + +#endif /* _ARCH_I386_FPU_H_ */ diff --git a/i386/include/architecture/i386/frame.h b/i386/include/architecture/i386/frame.h new file mode 100644 index 0000000..112cbcd --- /dev/null +++ b/i386/include/architecture/i386/frame.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Processor exception frame. + * + * HISTORY + * + * 31 August 1992 ? at NeXT + * Added v86 mode stuff. + * + * 8 June 1992 ? at NeXT + * Changed name of write field in err_code_t + * which collided with write() in shlib. + * + * 30 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_FRAME_H_ +#define _ARCH_I386_FRAME_H_ + +/* + * Format of the error code + * generated by the hardware + * for certain exceptions. + */ + +typedef union err_code { + struct err_code_normal { + unsigned int ext :1, + tbl :2, +#define ERR_GDT 0 +#define ERR_IDT 1 +#define ERR_LDT 2 + index :13, + :16; + } normal; + struct err_code_pgfault { + unsigned int prot :1, + wrtflt :1, + user :1, + :29; + } pgfault; +} err_code_t; + +#include <architecture/i386/sel.h> + +/* + * The actual hardware exception frame + * is variable in size. An error code is + * only pushed for certain exceptions. + * Previous stack information is only + * pushed for exceptions that cause a + * change in privilege level. The dpl + * field of the saved CS selector can be + * used to determine whether this is the + * case. If the interrupted task was + * executing in v86 mode, then the data + * segment registers are also present in + * the exception frame (in addition to + * previous stack information). This + * case can be determined by examining + * eflags. + */ + +typedef struct except_frame { + err_code_t err; + unsigned int eip; + sel_t cs; + unsigned int :0; + unsigned int eflags; + unsigned int esp; + sel_t ss; + unsigned int :0; + unsigned short v_es; + unsigned int :0; + unsigned short v_ds; + unsigned int :0; + unsigned short v_fs; + unsigned int :0; + unsigned short v_gs; + unsigned int :0; +} except_frame_t; + +/* + * Values in eflags. + */ + +#define EFL_CF 0x00001 +#define EFL_PF 0x00004 +#define EFL_AF 0x00010 +#define EFL_ZF 0x00040 +#define EFL_SF 0x00080 +#define EFL_TF 0x00100 +#define EFL_IF 0x00200 +#define EFL_DF 0x00400 +#define EFL_OF 0x00800 +#define EFL_IOPL 0x03000 +#define EFL_NT 0x04000 +#define EFL_RF 0x10000 +#define EFL_VM 0x20000 +#define EFL_AC 0x40000 + +#define EFL_CLR 0xfff88028 +#define EFL_SET 0x00000002 + +#endif /* _ARCH_I386_FRAME_H_ */ diff --git a/i386/include/architecture/i386/io.h b/i386/include/architecture/i386/io.h new file mode 100644 index 0000000..07021a1 --- /dev/null +++ b/i386/include/architecture/i386/io.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel 386 Family: IO space defines. + * + * HISTORY + * + * 11 August 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_IO_H_ +#define _ARCH_I386_IO_H_ + +typedef unsigned short io_addr_t; +typedef unsigned short io_len_t; + +#endif /* _ARCH_I386_IO_H_ */ diff --git a/i386/include/architecture/i386/math.h b/i386/include/architecture/i386/math.h new file mode 100644 index 0000000..6723ef4 --- /dev/null +++ b/i386/include/architecture/i386/math.h @@ -0,0 +1,642 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: math.h * +* * +* Contains: typedefs, prototypes, and macros germane to C99 floating point.* +* * +*******************************************************************************/ +#ifndef __MATH__ +#define __MATH__ + +#include "sys/cdefs.h" /* For definition of __DARWIN_UNIX03 et al */ + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** +* Floating point data types * +******************************************************************************/ + +/* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2, + taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may + define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler + must and may define only in float.h). +*/ +#if __FLT_EVAL_METHOD__ == 0 + typedef float float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 1 + typedef double float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1 + typedef long double float_t; + typedef long double double_t; +#else /* __FLT_EVAL_METHOD__ */ + #error "Unsupported value of __FLT_EVAL_METHOD__." +#endif /* __FLT_EVAL_METHOD__ */ + + +#if defined(__GNUC__) + #define HUGE_VAL __builtin_huge_val() + #define HUGE_VALF __builtin_huge_valf() + #define HUGE_VALL __builtin_huge_vall() + #define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */ + #define __MATH_H_ALWAYS_INLINE__ __attribute__ ((always_inline)) +#else + #define HUGE_VAL 1e500 + #define HUGE_VALF 1e50f + #define HUGE_VALL 1e5000L + #define NAN __nan( ) + #define __MATH_H_ALWAYS_INLINE__ +#endif + +#define INFINITY HUGE_VALF + + +/****************************************************************************** +* Taxonomy of floating point data types * +******************************************************************************/ + +#define FP_NAN 1 +#define FP_INFINITE 2 +#define FP_ZERO 3 +#define FP_NORMAL 4 +#define FP_SUBNORMAL 5 +#define FP_SUPERNORMAL 6 /* meaningful only on PowerPC */ + +/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */ +/* For single and double precision, the cost isn't too bad, because we can fall back on higher */ +/* precision hardware, with the necessary range to handle infinite precision products. However, */ +/* expect the long double fma to be at least an order of magnitude slower than a simple multiply */ +/* and an add. */ +#undef FP_FAST_FMA +#undef FP_FAST_FMAF +#undef FP_FAST_FMAL + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 (-2147483647 - 1) +#define FP_ILOGBNAN (-2147483647 - 1) + +/* Bitmasks for the math_errhandling macro. */ +#define MATH_ERRNO 1 /* errno set by math functions. */ +#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ + +#define math_errhandling (__math_errhandling()) +extern unsigned int __math_errhandling ( void ); + +/******************************************************************************** +* * +* Inquiry macros * +* * +* fpclassify Returns one of the FP_ values. * +* isnormal Non-zero if and only if the argument x is normalized. * +* isfinite Non-zero if and only if the argument x is finite. * +* isnan Non-zero if and only if the argument x is a NaN. * +* signbit Non-zero if and only if the sign of the argument x is * +* negative. This includes, NaNs, infinities and zeros. * +* * +********************************************************************************/ + +#define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __fpclassifyd((double)(x)) \ + : __fpclassify ((long double)(x))) + +extern int __fpclassifyf(float ); +extern int __fpclassifyd(double ); +extern int __fpclassify (long double); + +#if defined( __GNUC__ ) && 0 == __FINITE_MATH_ONLY__ + /* Yes, that's right. You only get the fast iswhatever() macros if you do NOT turn on -ffast-math. */ + /* These inline functions require the compiler to be compiling to standard in order to work. */ + /* -ffast-math, among other things, implies that NaNs don't happen. The compiler can in that case */ + /* optimize x != x to be false always, wheras it would be true for NaNs. That breaks __inline_isnan() */ + /* below. */ + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \ + : __inline_isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \ + : __inline_isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \ + : __inline_isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \ + : __inline_isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \ + : __inline_signbit((long double)(x))) + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned int __u[2]; }__u; __u.__f = __x; return (int)(__u.__u[1] >> 31); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; struct{ unsigned int __m[2]; short __sexp; }__p; }__u; __u.__ld = __x; return (int) (((unsigned short) __u.__p.__sexp) >> 15); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + +#else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnormald((double)(x)) \ + : __isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isfinited((double)(x)) \ + : __isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isinfd((double)(x)) \ + : __isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnand((double)(x)) \ + : __isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __signbitd((double)(x)) \ + : __signbitl((long double)(x))) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + extern int __isnormal (long double); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + extern int __isfinite (long double); + + extern int __isinff (float ); + extern int __isinfd (double ); + extern int __isinf (long double); + + extern int __isnanf (float ); + extern int __isnand (double ); + extern int __isnan (long double); + + extern int __signbitf (float ); + extern int __signbitd (double ); + extern int __signbitl (long double); + +#endif + + + +/******************************************************************************** +* * +* Math Functions * +* * +********************************************************************************/ + +extern double acos( double ); +extern float acosf( float ); + +extern double asin( double ); +extern float asinf( float ); + +extern double atan( double ); +extern float atanf( float ); + +extern double atan2( double, double ); +extern float atan2f( float, float ); + +extern double cos( double ); +extern float cosf( float ); + +extern double sin( double ); +extern float sinf( float ); + +extern double tan( double ); +extern float tanf( float ); + +extern double acosh( double ); +extern float acoshf( float ); + +extern double asinh( double ); +extern float asinhf( float ); + +extern double atanh( double ); +extern float atanhf( float ); + +extern double cosh( double ); +extern float coshf( float ); + +extern double sinh( double ); +extern float sinhf( float ); + +extern double tanh( double ); +extern float tanhf( float ); + +extern double exp ( double ); +extern float expf ( float ); + +extern double exp2 ( double ); +extern float exp2f ( float ); + +extern double expm1 ( double ); +extern float expm1f ( float ); + +extern double log ( double ); +extern float logf ( float ); + +extern double log10 ( double ); +extern float log10f ( float ); + +extern double log2 ( double ); +extern float log2f ( float ); + +extern double log1p ( double ); +extern float log1pf ( float ); + +extern double logb ( double ); +extern float logbf ( float ); + +extern double modf ( double, double * ); +extern float modff ( float, float * ); + +extern double ldexp ( double, int ); +extern float ldexpf ( float, int ); + +extern double frexp ( double, int * ); +extern float frexpf ( float, int * ); + +extern int ilogb ( double ); +extern int ilogbf ( float ); + +extern double scalbn ( double, int ); +extern float scalbnf ( float, int ); + +extern double scalbln ( double, long int ); +extern float scalblnf ( float, long int ); + +extern double fabs( double ); +extern float fabsf( float ); + +extern double cbrt( double ); +extern float cbrtf( float ); + +extern double hypot ( double, double ); +extern float hypotf ( float, float ); + +extern double pow ( double, double ); +extern float powf ( float, float ); + +extern double sqrt( double ); +extern float sqrtf( float ); + +extern double erf( double ); +extern float erff( float ); + +extern double erfc( double ); +extern float erfcf( float ); + +/* lgamma and lgammaf are not thread-safe. The thread-safe variants + * lgamma_r and lgammaf_r are available on OS X 10.6 and later. + * + * To use the thread-safe variants, you must define the _REENTRANT symbol. + */ +extern double lgamma( double ); +extern float lgammaf( float ); + +extern double tgamma( double ); +extern float tgammaf( float ); + +extern double ceil ( double ); +extern float ceilf ( float ); + +extern double floor ( double ); +extern float floorf ( float ); + +extern double nearbyint ( double ); +extern float nearbyintf ( float ); + +extern double rint ( double ); +extern float rintf ( float ); + +extern long int lrint ( double ); +extern long int lrintf ( float ); + +extern double round ( double ); +extern float roundf ( float ); + +extern long int lround ( double ); +extern long int lroundf ( float ); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + + /* long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrint ( double ); + extern long long int llrintf ( float ); + + extern long long int llround ( double ); + extern long long int llroundf ( float ); + +#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern double trunc ( double ); +extern float truncf ( float ); + +extern double fmod ( double, double ); +extern float fmodf ( float, float ); + +extern double remainder ( double, double ); +extern float remainderf ( float, float ); + +extern double remquo ( double, double, int * ); +extern float remquof ( float, float, int * ); + +extern double copysign ( double, double ); +extern float copysignf ( float, float ); + +extern double nan( const char * ); +extern float nanf( const char * ); + +extern double nextafter ( double, double ); +extern float nextafterf ( float, float ); + +extern double fdim ( double, double ); +extern float fdimf ( float, float ); + +extern double fmax ( double, double ); +extern float fmaxf ( float, float ); + +extern double fmin ( double, double ); +extern float fminf ( float, float ); + +extern double fma ( double, double, double ); +extern float fmaf ( float, float, float ); + +extern long double acosl(long double); +extern long double asinl(long double); +extern long double atanl(long double); +extern long double atan2l(long double, long double); +extern long double cosl(long double); +extern long double sinl(long double); +extern long double tanl(long double); +extern long double acoshl(long double); +extern long double asinhl(long double); +extern long double atanhl(long double); +extern long double coshl(long double); +extern long double sinhl(long double); +extern long double tanhl(long double); +extern long double expl(long double); +extern long double exp2l(long double); +extern long double expm1l(long double); +extern long double logl(long double); +extern long double log10l(long double); +extern long double log2l(long double); +extern long double log1pl(long double); +extern long double logbl(long double); +extern long double modfl(long double, long double *); +extern long double ldexpl(long double, int); +extern long double frexpl(long double, int *); +extern int ilogbl(long double); +extern long double scalbnl(long double, int); +extern long double scalblnl(long double, long int); +extern long double fabsl(long double); +extern long double cbrtl(long double); +extern long double hypotl(long double, long double); +extern long double powl(long double, long double); +extern long double sqrtl(long double); +extern long double erfl(long double); +extern long double erfcl(long double); + +/* lgammal is not thread-safe. + * The thread-safe variant lgammal_r is available on OS X 10.6 and later. + * + * To use the thread-safe variant, you must define the _REENTRANT symbol. + */ +extern long double lgammal(long double); + +extern long double tgammal(long double); +extern long double ceill(long double); +extern long double floorl(long double); +extern long double nearbyintl(long double); +extern long double rintl(long double); +extern long int lrintl(long double); +extern long double roundl(long double); +extern long int lroundl(long double); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + /* long long is not part of C90. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrintl(long double); + extern long long int llroundl(long double); +#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern long double truncl(long double); +extern long double fmodl(long double, long double); +extern long double remainderl(long double, long double); +extern long double remquol(long double, long double, int *); +extern long double copysignl(long double, long double); +extern long double nanl(const char *); +extern long double nextafterl(long double, long double); +extern double nexttoward(double, long double); +extern float nexttowardf(float, long double); +extern long double nexttowardl(long double, long double); +extern long double fdiml(long double, long double); +extern long double fmaxl(long double, long double); +extern long double fminl(long double, long double); +extern long double fmal(long double, long double, long double); + +#define isgreater(x, y) __builtin_isgreater ((x),(y)) +#define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y)) +#define isless(x, y) __builtin_isless ((x),(y)) +#define islessequal(x, y) __builtin_islessequal ((x),(y)) +#define islessgreater(x, y) __builtin_islessgreater ((x),(y)) +#define isunordered(x, y) __builtin_isunordered ((x),(y)) + +extern double __inf( void ); +extern float __inff( void ); +extern long double __infl( void ); +extern float __nan( void ); /* 10.3 (and later) must retain in ABI for backward compatability */ + +#if !defined(_ANSI_SOURCE) +extern double j0 ( double ); + +extern double j1 ( double ); + +extern double jn ( int, double ); + +extern double y0 ( double ); + +extern double y1 ( double ); + +extern double yn ( int, double ); + +extern double scalb ( double, double ); + + +#define M_E 2.71828182845904523536028747135266250 /* e */ +#define M_LOG2E 1.44269504088896340735992468100189214 /* log 2e */ +#define M_LOG10E 0.434294481903251827651128918916605082 /* log 10e */ +#define M_LN2 0.693147180559945309417232121458176568 /* log e2 */ +#define M_LN10 2.30258509299404568401799145468436421 /* log e10 */ +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */ +#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */ +#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ +#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */ +#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */ +#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */ +#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ + +#define MAXFLOAT ((float)3.40282346638528860e+38) +extern int signgam; /* required for unix 2003 */ + + +#endif /* !defined(_ANSI_SOURCE) */ + +#if !defined(__NOEXTENSIONS__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define __WANT_EXTENSIONS__ +#endif + +#ifdef __WANT_EXTENSIONS__ + +#define FP_SNAN FP_NAN +#define FP_QNAN FP_NAN + +extern long int rinttol ( double ); /* Legacy API: please use C99 lrint() instead. */ + +extern long int roundtol ( double ); /* Legacy API: please use C99 lround() instead. */ + +/* + * XOPEN/SVID + */ +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) +#if !defined(__cplusplus) +/* used by matherr below */ +struct exception { + int type; + char *name; + double arg1; + double arg2; + double retval; +}; +#endif + +#define HUGE MAXFLOAT + +/* + * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> + * (one may replace the following line by "#include <values.h>") + */ + +#define X_TLOSS 1.41484755040568800000e+16 + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#if !defined( __STRICT_ANSI__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern int finite ( double ); /* Legacy API: please use C99 isfinite() instead. */ + +extern double gamma ( double ); /* Legacy API: please use C99 tgamma() instead. */ + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if !defined(__cplusplus) +extern int matherr ( struct exception * ); +#endif + +/* + * IEEE Test Vector + */ +extern double significand ( double ); + +/* + * BSD math library entry points + */ +extern double drem ( double, double ); /* Legacy API: please use C99 remainder() instead. */ + +/* + * Reentrant version of lgamma; passes signgam back by reference + * as the second argument; user must allocate space for signgam. + */ + +#ifdef _REENTRANT + #include <AvailabilityMacros.h> + // Available on OS X 10.6 and later. + extern float lgammaf_r ( float, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + extern double lgamma_r ( double, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + extern long double lgammal_r ( long double, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; +#endif /* _REENTRANT */ + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#endif /* __WANT_EXTENSIONS__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MATH__ */ diff --git a/i386/include/architecture/i386/pio.h b/i386/include/architecture/i386/pio.h new file mode 100644 index 0000000..338f158 --- /dev/null +++ b/i386/include/architecture/i386/pio.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +#ifndef _ARCH_I386_PIO_H_ +#define _ARCH_I386_PIO_H_ + +typedef unsigned short i386_ioport_t; + +#if defined(__GNUC__) +static __inline__ unsigned long inl( + i386_ioport_t port) +{ + unsigned long datum; + __asm__ volatile("inl %w1, %0" : "=a" (datum) : "Nd" (port)); + return(datum); +} + +static __inline__ unsigned short inw( + i386_ioport_t port) +{ + unsigned short datum; + __asm__ volatile("inw %w1, %w0" : "=a" (datum) : "Nd" (port)); + return(datum); +} + +static __inline__ unsigned char inb( + i386_ioport_t port) +{ + unsigned char datum; + __asm__ volatile("inb %w1, %b0" : "=a" (datum) : "Nd" (port)); + return(datum); +} + +static __inline__ void outl( + i386_ioport_t port, + unsigned long datum) +{ + __asm__ volatile("outl %0, %w1" : : "a" (datum), "Nd" (port)); +} + +static __inline__ void outw( + i386_ioport_t port, + unsigned short datum) +{ + __asm__ volatile("outw %w0, %w1" : : "a" (datum), "Nd" (port)); +} + +static __inline__ void outb( + i386_ioport_t port, + unsigned char datum) +{ + __asm__ volatile("outb %b0, %w1" : : "a" (datum), "Nd" (port)); +} +#endif /* defined(__GNUC__) */ +#endif /* _ARCH_I386_PIO_H_ */ diff --git a/i386/include/architecture/i386/reg_help.h b/i386/include/architecture/i386/reg_help.h new file mode 100644 index 0000000..98c18c5 --- /dev/null +++ b/i386/include/architecture/i386/reg_help.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. + * + * File: architecture/i386/reg_help.h + * Author: Mike DeMoney, NeXT Computer, Inc. + * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. + * + * This header file defines cpp macros useful for defining + * machine register and doing machine-level operations. + * + * HISTORY + * 10-Mar-92 Bruce Martin (bmartin@next.com) + * Adapted to i386 + * 23-Jan-91 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_I386_REG_HELP_H_ +#define _ARCH_I386_REG_HELP_H_ + +/* Bitfield definition aid */ +#define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) +#define BIT_WIDTH(pos) (1) /* mostly to record the position */ + +/* Mask creation */ +#define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) +#define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) +#define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) + +/* Register addresses */ +#if __ASSEMBLER__ +# define REG_ADDR(type, addr) (addr) +#else /* __ASSEMBLER__ */ +# define REG_ADDR(type, addr) (*(volatile type *)(addr)) +#endif /* __ASSEMBLER__ */ + +/* Cast a register to be an unsigned */ +#define CONTENTS(foo) (*(unsigned *) &(foo)) + +/* Stack pointer must always be a multiple of 4 */ +#define STACK_INCR 4 +#define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) + +/* STRINGIFY -- perform all possible substitutions, then stringify */ +#define __STR(x) #x /* just a helper macro */ +#define STRINGIFY(x) __STR(x) + +/* + * REG_PAIR_DEF -- define a register pair + * Register pairs are appropriately aligned to allow access via + * ld.d and st.d. + * + * Usage: + * struct foo { + * REG_PAIR_DEF( + * bar_t *, barp, + * afu_t, afu + * ); + * }; + * + * Access to individual entries of the pair is via the REG_PAIR + * macro (below). + */ +#define REG_PAIR_DEF(type0, name0, type1, name1) \ + struct { \ + type0 name0 __attribute__(( aligned(8) )); \ + type1 name1; \ + } name0##_##name1 + +/* + * REG_PAIR -- Macro to define names for accessing individual registers + * of register pairs. + * + * Usage: + * arg0 is first element of pair + * arg1 is second element of pair + * arg2 is desired element of pair + * eg: + * #define foo_barp REG_PAIR(barp, afu, afu) + */ +#define REG_PAIR(name0, name1, the_name) \ + name0##_##name1.the_name + +#endif /* _ARCH_I386_REG_HELP_H_ */ diff --git a/i386/include/architecture/i386/sel.h b/i386/include/architecture/i386/sel.h new file mode 100644 index 0000000..80cb516 --- /dev/null +++ b/i386/include/architecture/i386/sel.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Segment selector. + * + * HISTORY + * + * 29 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_SEL_H_ +#define _ARCH_I386_SEL_H_ + +/* + * Segment selector. + */ + +typedef struct sel { + unsigned short rpl :2, +#define KERN_PRIV 0 +#define USER_PRIV 3 + ti :1, +#define SEL_GDT 0 +#define SEL_LDT 1 + index :13; +} sel_t; + +#define NULL_SEL ((sel_t) { 0, 0, 0 } ) + +#endif /* _ARCH_I386_SEL_H_ */ diff --git a/i386/include/architecture/i386/table.h b/i386/include/architecture/i386/table.h new file mode 100644 index 0000000..3ce1f81 --- /dev/null +++ b/i386/include/architecture/i386/table.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Descriptor tables. + * + * HISTORY + * + * 30 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_TABLE_H_ +#define _ARCH_I386_TABLE_H_ + +#include <architecture/i386/desc.h> +#include <architecture/i386/tss.h> + +/* + * A totally generic descriptor + * table entry. + */ + +typedef union dt_entry { + code_desc_t code; + data_desc_t data; + ldt_desc_t ldt; + tss_desc_t task_state; + call_gate_t call_gate; + trap_gate_t trap_gate; + intr_gate_t intr_gate; + task_gate_t task_gate; +} dt_entry_t; + +#define DESC_TBL_MAX 8192 + +/* + * Global descriptor table. + */ + +typedef union gdt_entry { + code_desc_t code; + data_desc_t data; + ldt_desc_t ldt; + call_gate_t call_gate; + task_gate_t task_gate; + tss_desc_t task_state; +} gdt_entry_t; + +typedef gdt_entry_t gdt_t; + +/* + * Interrupt descriptor table. + */ + +typedef union idt_entry { + trap_gate_t trap_gate; + intr_gate_t intr_gate; + task_gate_t task_gate; +} idt_entry_t; + +typedef idt_entry_t idt_t; + +/* + * Local descriptor table. + */ + +typedef union ldt_entry { + code_desc_t code; + data_desc_t data; + call_gate_t call_gate; + task_gate_t task_gate; +} ldt_entry_t; + +typedef ldt_entry_t ldt_t; + +#endif /* _ARCH_I386_TABLE_H_ */ diff --git a/i386/include/architecture/i386/tss.h b/i386/include/architecture/i386/tss.h new file mode 100644 index 0000000..7f060ec --- /dev/null +++ b/i386/include/architecture/i386/tss.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Intel386 Family: Task State Segment. + * + * HISTORY + * + * 29 March 1992 ? at NeXT + * Created. + */ + +#ifndef _ARCH_I386_TSS_H_ +#define _ARCH_I386_TSS_H_ + +#include <architecture/i386/sel.h> + +/* + * Task State segment. + */ + +typedef struct tss { + sel_t oldtss; + unsigned int :0; + unsigned int esp0; + sel_t ss0; + unsigned int :0; + unsigned int esp1; + sel_t ss1; + unsigned int :0; + unsigned int esp2; + sel_t ss2; + unsigned int :0; + unsigned int cr3; + unsigned int eip; + unsigned int eflags; + unsigned int eax; + unsigned int ecx; + unsigned int edx; + unsigned int ebx; + unsigned int esp; + unsigned int ebp; + unsigned int esi; + unsigned int edi; + sel_t es; + unsigned int :0; + sel_t cs; + unsigned int :0; + sel_t ss; + unsigned int :0; + sel_t ds; + unsigned int :0; + sel_t fs; + unsigned int :0; + sel_t gs; + unsigned int :0; + sel_t ldt; + unsigned int :0; + unsigned int t :1, + :15, + io_bmap :16; +} tss_t; + +#define TSS_SIZE(n) (sizeof (struct tss) + (n)) + +/* + * Task State segment descriptor. + */ + +typedef struct tss_desc { + unsigned short limit00; + unsigned short base00; + unsigned char base16; + unsigned char type :5, +#define DESC_TSS 0x09 + dpl :2, + present :1; + unsigned char limit16 :4, + :3, + granular:1; + unsigned char base24; +} tss_desc_t; + +/* + * Task gate descriptor. + */ + +typedef struct task_gate { + unsigned short :16; + sel_t tss; + unsigned int :8, + type :5, +#define DESC_TASK_GATE 0x05 + dpl :2, + present :1, + :0; +} task_gate_t; + +#endif /* _ARCH_I386_TSS_H_ */ diff --git a/i386/include/architecture/ppc/.svn/all-wcprops b/i386/include/architecture/ppc/.svn/all-wcprops new file mode 100644 index 0000000..99f0921 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/all-wcprops @@ -0,0 +1,77 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc +END +macro_help.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/macro_help.h +END +math.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/math.h +END +pseudo_inst.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/pseudo_inst.h +END +cframe.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/cframe.h +END +alignment.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/alignment.h +END +byte_order.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/byte_order.h +END +fenv.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/fenv.h +END +basic_regs.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/basic_regs.h +END +mode_independent_asm.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/mode_independent_asm.h +END +fp_regs.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/fp_regs.h +END +reg_help.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/reg_help.h +END +asm_help.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/architecture/ppc/asm_help.h +END diff --git a/i386/include/architecture/ppc/.svn/entries b/i386/include/architecture/ppc/.svn/entries new file mode 100644 index 0000000..1bbfd2e --- /dev/null +++ b/i386/include/architecture/ppc/.svn/entries @@ -0,0 +1,436 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/architecture/ppc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +macro_help.h +file + + + + +2013-08-27T23:54:33.000000Z +5ddc41e7c1912ba77554ed002077f68d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1818 + +math.h +file + + + + +2013-08-27T23:54:33.000000Z +c54c81b3bd695a8de58bbf246c2b6876 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +38872 + +pseudo_inst.h +file + + + + +2013-08-27T23:54:33.000000Z +7551ac2cf7583a2fcadd6515ba923b95 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10404 + +cframe.h +file + + + + +2013-08-27T23:54:33.000000Z +387c18f1a1e199d7393ee974aeea49e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2403 + +alignment.h +file + + + + +2013-08-27T23:54:33.000000Z +6e6165269759cc67419b83453fbeb01e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2502 + +byte_order.h +file + + + + +2013-08-27T23:54:33.000000Z +e0639f784798ddd6f3e9cc9e8b9712d2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1063 + +fenv.h +file + + + + +2013-08-27T23:54:33.000000Z +747e23bb0b18ce8d323779c6ebb03b2e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8168 + +basic_regs.h +file + + + + +2013-08-27T23:54:33.000000Z +1ca0f039be387d2359dcb858baec4937 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8303 + +mode_independent_asm.h +file + + + + +2013-08-27T23:54:33.000000Z +601d720663e2166e8e8dd2ee496ed95e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6241 + +fp_regs.h +file + + + + +2013-08-27T23:54:33.000000Z +a6609515ea5f0cd61c4436a15ba05497 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4430 + +reg_help.h +file + + + + +2013-08-27T23:54:33.000000Z +227028fc8e5c2af5c0335c351f19df8e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6378 + +asm_help.h +file + + + + +2013-08-27T23:54:33.000000Z +2f90ef838be45177fea9359616acd9d0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11972 + diff --git a/i386/include/architecture/ppc/.svn/text-base/alignment.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/alignment.h.svn-base new file mode 100644 index 0000000..6fb66e5 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/alignment.h.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1996 NeXT Software, Inc. + * + * File: architecture/ppc/alignment.h + + * Natural alignment of shorts and longs (for ppc) + * + * HISTORY + * + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 2 Sept 1992 Brian Raymor at NeXT + * Moved over to architecture. + * 17 August 1992 Jack Greenfield at NeXT + * Created. + */ + +__inline__ static unsigned short +get_align_short(void *ivalue) +{ + unsigned short ovalue = ((unsigned char *) ivalue)[0]; + + ovalue <<= 8 * sizeof(unsigned char); + return ovalue + ((unsigned char *) ivalue)[1]; +} + +__inline__ static unsigned short +put_align_short(unsigned short ivalue, void *ovalue) +{ + unsigned short *tvalue = &ivalue; + + ((unsigned char *) ovalue)[0] = ((unsigned char *) tvalue)[0]; + ((unsigned char *) ovalue)[1] = ((unsigned char *) tvalue)[1]; + return ivalue; +} + +__inline__ static unsigned long +get_align_long(void *ivalue) +{ + unsigned long ovalue = get_align_short(ivalue); + + ovalue <<= 8 * sizeof(unsigned short); + return ovalue + get_align_short(((unsigned char *) ivalue) + sizeof(short)); +} + +__inline__ static unsigned long +put_align_long(unsigned long ivalue, void *ovalue) +{ + unsigned long *tvalue = &ivalue; + + ((unsigned char *) ovalue)[0] = ((unsigned char *) tvalue)[0]; + ((unsigned char *) ovalue)[1] = ((unsigned char *) tvalue)[1]; + ((unsigned char *) ovalue)[2] = ((unsigned char *) tvalue)[2]; + ((unsigned char *) ovalue)[3] = ((unsigned char *) tvalue)[3]; + return ivalue; +} + diff --git a/i386/include/architecture/ppc/.svn/text-base/asm_help.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/asm_help.h.svn-base new file mode 100644 index 0000000..b045655 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/asm_help.h.svn-base @@ -0,0 +1,451 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/asm_help.h + * Author: Mike DeMoney, NeXT Software, Inc. + * + * This header file defines macros useful when writing assembly code + * for the PowerPC processors. + * r12 is used as the tmp register / PICIFY base. + * + * HISTORY + * 20-May-97 Umesh Vaishampayan (umeshv@apple.com) + * Implemented Dynamic / PIC macros. + * + * 28-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * added ".align" directive to various macros to avoid alignment + * faults. Moved Register Usage #defines to reg_help.h as that's + * where they should have been in the first place. + * Added Dynamic / PIC macroes for routines which refernce external + * symbols. Not implemented fully as yet. + * + * 05-Nov-92 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_PPC_ASM_HELP_H_ +#define _ARCH_PPC_ASM_HELP_H_ + +#include <architecture/ppc/reg_help.h> + +#ifdef __ASSEMBLER__ +/* + * ppc stack frames look like this after procedure prolog has + * been executed: + * + * Higher address: + * ......... + * +-------------------------------+ + * | caller's LR | + * +-------------------------------+ + * | caller's CR | + * +-------------------------------+ + * Caller's SP->| caller's caller's sp | ^^ Caller's Frame ^^ + * +===============================+ vv Called Rtn Frame vv + * | Save Area for | FPF 31 + * .......... + * | Caller's FPF's | FPF n + * +-------------------------------+ + * | Save Area for | GRF 31 + * .......... + * | Caller's GRF's | GRF n + * +-------------------------------+ + * | alignment pad | + * ............ + * | (if necessary) | + * +-------------------------------+ + * | Local | + * ........ + * | Variables | + * +-------------------------------+ + * SP + X -> | aN for FUTURE call | + * +-------------------------------+ + * .......... + * +-------------------------------+ + * SP + 28 -> | a1 for FUTURE call | + * +-------------------------------+ + * SP + 24 -> | a0 for FUTURE call | + * +-------------------------------+ + * SP + 20 -> | caller's TOC | + * +-------------------------------+ + * SP + 16 -> | reserved | + * +-------------------------------+ + * SP + 12 -> | reserved | + * +-------------------------------+ + * SP + 8 -> | LR callee-save for FUTURE call| + * +-------------------------------+ + * SP + 4 -> | CR callee-save for FUTURE call| + * +-------------------------------+ + * SP -> | caller's sp | + * +===============================+ + * Lower address: + * + * NOTE: All state with the exception of LR and CR are saved in the + * called routines frame. LR and CR are saved in the CALLER'S FRAME. + * + * ALSO NOTE: Args to the called routine are found in the caller's frame. + */ + +/* + * ARG(n) -- stack offset to n'th argument + * + * NOTE CAREFULLY! These macros start numbering arguments at 1 (NOT 0) + * The first argument is ARG(1). + * + * ALSO NOTE: This stack offset is only valid if using routine + * DOES NOT alter SP. + * + */ +#define ARG(n) ((((n) - 1) * 4) + 24) + +/* + * Macros for building stack frame according to C calling conventions. + * lr, cr, and sp are saved. + * + * NOTE WELL: localvarsize is in bytes, maxargsout is a count of words, + * grfsaved and fpfsaved is a count of registers. BE SURE TO COUNT + * BOTH FP (r31) AND sN REGISTERS IN THE COUNT OF GRF REGISTERS SAVED! + * This will be TWO more than the N of the highest sN register you + * save: s2 implies you are saving s2, s1, s0, and fp => grfsaved + * should be 4! + * + * FURTHER NOTE: These macros do NOT SAVE GRF or FPF registers. User + * must do that. GRF sN regs should be saved via + * stmw sN,SAVED_GRF_S(N)(sp) + * where N is the highest numbered s* register to be saved. E.g. if + * s0, s1, and s2 are to be saved use: + * stmw s2,SAVED_GRF_S(2)(sp) + * Note that this also saves fp. + * An individual saved grf can be loaded via: + * lwz s2,SAVED_GRF_S(2)(sp) + * Analogous stuff works for fpf's. + * + * NOTE: these simple routines will be replaced with more complicated + * ones once we know what the linker and gdb will require as for as + * register use masks and frame declarations. + * + * Warning: ROUND_TO_STACK is only to be used in assembly language; + * for C usage, use ROUND_FRAME() in reg_help.h. + */ +#define ROUND_TO_STACK(len) \ + (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) + +#define BUILD_FRAME(localvarsize, maxargsout, grfsaved, fpfsaved) \ + .set __argoutsize, ROUND_TO_STACK((maxargsout) * 4) @\ + .if __argoutsize < 32 @\ + .set __argoutsize,32 @\ + .endif @\ + .set __framesize, ROUND_TO_STACK( \ + 24 + __argoutsize + (localvarsize) \ + + 4*(grfsaved) + 8*(fpfsaved)) @\ + .set __grfbase,(__framesize - 4*(grfsaved) - 8*(fpfsaved)) @\ + .set __fpfbase,(__framesize - 8*(fpfsaved)) @\ + mflr r0 @\ + mfcr r12 @\ + stw r0,8(sp) @\ + stw r12,4(sp) @\ + stwu r1,-__framesize(r1) + +/* + * Macros for referencing data in stack frame. + * + * NOTE WELL: ARG's and VAR's start at 1, NOT 0. Why ??? (FIXME) + */ +#define LOCAL_VAR(n) (((n)-1)*4 + __argoutsize + 24) +#define SAVED_GRF_S(n) (__grfbase + ((grfsaved) - (n) - 2) * 4) +#define SAVED_FRF_FS(n) (__fpfbase + ((fpfsaved) - (n) - 1) * 4) +#define ARG_IN(n) (ARG(n) + __framesize) +#define ARG_OUT(n) (ARG(n) + 0) +#define SAVED_FP (__grfbase + ((grfsaved) - 1) * 4) +#define SAVED_LR (__framesize + 8) +#define SAVED_CR (__framesize + 4) + +/* + * Macros for unwinding stack frame. + * NOTE: GRF's and FPF's are NOT RESTORED. User must do this before + * using this macro. + */ +#define RETURN \ + .if __framesize @\ + lwz32 r0,r1,SAVED_LR @\ + lwz32 r12,r1,SAVED_CR @\ + addic sp,r1,__framesize @\ + mtlr r0 @\ + mtcrf 0xff,r12 @\ + blr @\ + .else @\ + blr @\ + .endif + + +/* + * Macros for declaring procedures + * + * Use of these macros allows ctags to have a predictable way + * to find various types of declarations. They also simplify + * inserting appropriate symbol table information. + * + * NOTE: these simple stubs will be replaced with more + * complicated versions once we know what the linker and gdb + * will require as far as register use masks and frame declarations. + * These macros may also be ifdef'ed in the future to contain profiling + * code. + * + * FIXME: Document what makes a leaf a LEAF and a handler a HANDLER. + * (E.g. leaf's have return pc in lr, NESTED's have rpc in offset off + * sp, handlers have rpc in exception frame which is found via exception + * link, etc etc.) + */ + +/* + * TEXT -- declare start of text segment + */ +#define TEXT \ + .text @\ + .align 2 + +/* + * LEAF -- declare global leaf procedure + * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only + * be jumped to. (A leaf may do an align.) Use a LABEL() if you + * need control to flow into the label. + */ +#define LEAF(name) \ + .align 2 @\ + .globl name @\ +name: @\ + .set __framesize,0 + +/* + * X_LEAF -- declare alternate global label for leaf + */ +#define X_LEAF(name, value) \ + .globl name @\ + .set name,value + +/* + * P_LEAF -- declare private leaf procedure + */ +#define P_LEAF(name) \ + .align 2 @\ +name: @\ + .set __framesize,0 + +/* + * LABEL -- declare a global code label + * MUST be used (rather than LEAF, NESTED, etc) if control + * "flows into" the label. + */ +#define LABEL(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * NESTED -- declare procedure that invokes other procedures + */ +#define NESTED(name, localvarsize, maxargsout, grfsaved, fpfsaved)\ + .align 2 @\ + .globl name @\ +name: @\ + BUILD_FRAME(localvarsize, maxargsout, grfsaved, fpfsaved) + +/* + * X_NESTED -- declare alternate global label for nested proc + */ +#define X_NESTED(name, value) \ + .globl name @\ + .set name,value + +/* + * P_NESTED -- declare private nested procedure + */ +#define P_NESTED(name, localvarsize, maxargsout, grfsaved, fpfsaved)\ + .align 2 @\ +name: @\ + BUILD_FRAME(locavarsize, maxargsout, grfsaved, fpfsaved) + +/* + * HANDLER -- declare procedure with exception frame rather than + * standard C frame + */ +#define HANDLER(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * X_HANDLER -- declare alternate name for exception handler + * (Should appear immediately before a HANDLER declaration or + * another X_HANDLER declaration) + */ +#define X_HANDLER(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * P_HANDLER -- declare private handler + */ +#define P_HANDLER(name) \ + .align 2 @\ +name: + +/* + * END -- mark end of procedure + * FIXME: Unimplemented for now. + */ +#define END(name) + +/* + * BL -- call procedure (relative) + */ +#define BL(name) \ + bl name + +/* + * Storage definition macros + * The main purpose of these is to allow an easy handle for ctags + */ + +/* + * IMPORT -- import symbol + */ +#define IMPORT(name) \ + .reference name + +/* + * ABS -- declare global absolute symbol + */ +#define ABS(name, value) \ + .globl name @\ + .set name,value + +/* + * P_ABS -- declare private absolute symbol + */ +#define P_ABS(name, value) \ + .set name,value + +/* + * EXPORT -- declare global label for data + */ +#define EXPORT(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * BSS -- declare global zero'ed storage + */ +#define BSS(name,size) \ + .comm name,size + + +/* + * P_BSS -- declare private zero'ed storage + */ +#define P_BSS(name,size) \ + .lcomm name,size + +/* + * dynamic/PIC macros for routines which reference external symbols + */ +#if defined(__DYNAMIC__) +#define PICIFY_REG r12 + +/* Assume that the lr is saved before calling any of these macros */ +/* using PICIFY() */ + +#define PICIFY(var) \ + mflr r0 @\ + bcl 20,31,1f @\ +1: mflr PICIFY_REG @\ + mtlr r0 @\ + addis PICIFY_REG, PICIFY_REG, ha16(L ## var ## __non_lazy_ptr - 1b) @\ + lwz PICIFY_REG, lo16(L ## var ## __non_lazy_ptr - 1b)(PICIFY_REG) + +#define CALL_EXTERN_AGAIN(var) \ + PICIFY(var) @\ + mtctr PICIFY_REG @\ + mflr r0 @\ + stw r0,8(r1) @\ + stwu r1,-64(r1) @\ + bctrl @\ + addic r1,r1,64 @\ + lwz r0,8(r1) @\ + mtlr r0 + +#define NON_LAZY_STUB(var) \ + .non_lazy_symbol_pointer @\ + .align 2 @\ +L ## var ## __non_lazy_ptr: @\ + .indirect_symbol var @\ + .long 0 @\ + .text @\ + .align 2 + +#define BRANCH_EXTERN(var) \ + PICIFY(var) @\ + mtctr PICIFY_REG @\ + bctr @\ + NON_LAZY_STUB(var) + +#define CALL_EXTERN(var) \ + CALL_EXTERN_AGAIN(var) @\ + NON_LAZY_STUB(var) + +#define REG_TO_EXTERN(reg, var) \ + PICIFY(var) @\ + stw reg, 0(PICIFY_REG) @\ + NON_LAZY_STUB(var) + +#define EXTERN_TO_REG(reg, var) \ + PICIFY(var) @\ + lwz reg, 0(PICIFY_REG) @\ + NON_LAZY_STUB(var) + +#else /* ! __DYNAMIC__ */ +#define TMP_REG r12 +#define BRANCH_EXTERN(var) \ + b var + +#define CALL_EXTERN(var) \ + bl var + +#define CALL_EXTERN_AGAIN(var) \ + CALL_EXTERN(var) + +#define REG_TO_EXTERN(reg, var) \ + lis TMP_REG, ha16(var) @\ + stw reg, lo16(var)(TMP_REG) + +#define EXTERN_TO_REG(reg, var) \ + lis reg, ha16(var) @\ + lwz reg, lo16(var)(reg) + +#endif /* __DYNAMIC__ */ + +#endif /* __ASSEMBLER__ */ +#endif /* _ARCH_PPC_ASM_HELP_H_ */ diff --git a/i386/include/architecture/ppc/.svn/text-base/basic_regs.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/basic_regs.h.svn-base new file mode 100644 index 0000000..91a60a8 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/basic_regs.h.svn-base @@ -0,0 +1,301 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/basic_regs.h + * Author: Doug Mitchell, NeXT Software, Inc. + * + * Basic ppc registers. + * + * HISTORY + * 22-May-97 Umesh Vaishampayan (umeshv@apple.com) + Updated to match MPCFPE32B/AD 1/97 REV. 1 + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 05-Nov-92 Doug Mitchell at NeXT + * Created. + */ + +#ifndef _ARCH_PPC_BASIC_REGS_H_ +#define _ARCH_PPC_BASIC_REGS_H_ + +#include <architecture/ppc/reg_help.h> +#include <architecture/ppc/macro_help.h> + +#if !defined(__ASSEMBLER__) + +/* + * Number of General Purpose registers. + */ +#define PPC_NGP_REGS 32 + +/* + * Common half-word used in Machine State Register and in + * various exception frames. Defined as a macro because the compiler + * will align a struct to a word boundary when used inside another struct. + */ +#define MSR_BITS \ + unsigned ee:BIT_WIDTH(15), /* external intr enable */ \ + pr:BIT_WIDTH(14), /* problem state */ \ + fp:BIT_WIDTH(13), /* floating point avail */ \ + me:BIT_WIDTH(12), /* machine check enable */ \ + fe0:BIT_WIDTH(11), /* fp exception mode 0 */ \ + se:BIT_WIDTH(10), /* single step enable */ \ + be:BIT_WIDTH(9), /* branch trace enable */ \ + fe1:BIT_WIDTH(8), /* fp exception mode 0 */ \ + rsvd1:BIT_WIDTH(7), /* reserved */ \ + ip:BIT_WIDTH(6), /* interrupt prefix */ \ + ir:BIT_WIDTH(5), /* instruction relocate */ \ + dr:BIT_WIDTH(4), /* data relocate */ \ + rsvd2:BITS_WIDTH(3,2), /* reserved */ \ + ri:BIT_WIDTH(1), /* recoverable exception */ \ + le:BIT_WIDTH(0) /* Little-endian mode */ + +/* + * Machine state register. + * Read and written via get_msr() and set_msr() inlines, below. + */ +typedef struct { + unsigned rsvd3:BITS_WIDTH(31,19), // reserved + pow:BIT_WIDTH(18), // Power management enable + rsvd0: BIT_WIDTH(17), // reserved + ile: BIT_WIDTH(16); // exception little endian + + MSR_BITS; // see above +} msr_t; + +/* + * Data Storage Interrupt Status Register (DSISR) + */ +typedef struct { + unsigned dse:BIT_WIDTH(31); // direct-store error + unsigned tnf:BIT_WIDTH(30); // translation not found + unsigned :BITS_WIDTH(29,28); + unsigned pe:BIT_WIDTH(27); // protection error + unsigned dsr:BIT_WIDTH(26); // lwarx/stwcx to direct-store + unsigned rw:BIT_WIDTH(25); // 1 => store, 0 => load + unsigned :BITS_WIDTH(24,23); + unsigned dab:BIT_WIDTH(22); // data address bkpt (601) + unsigned ssf:BIT_WIDTH(21); // seg table search failed + unsigned :BITS_WIDTH(20,0); +} dsisr_t; + +/* + * Instruction Storage Interrupt Status Register (really SRR1) + */ +typedef struct { + unsigned :BIT_WIDTH(31); + unsigned tnf:BIT_WIDTH(30); // translation not found + unsigned :BIT_WIDTH(29); + unsigned dse:BIT_WIDTH(28); // direct-store fetch error + unsigned pe:BIT_WIDTH(27); // protection error + unsigned :BITS_WIDTH(26,22); + unsigned ssf:BIT_WIDTH(21); // seg table search failed + unsigned :BITS_WIDTH(20,16); + MSR_BITS; +} isisr_t; + +/* + * Alignment Interrupt Status Register (really DSISR) + * NOTE: bit numbers in field *names* are in IBM'ese (0 is MSB). + * FIXME: Yuck!!! Double Yuck!!! + */ +typedef struct { + unsigned :BITS_WIDTH(31,20); + unsigned ds3031:BITS_WIDTH(19,18);// bits 30:31 if DS form + unsigned :BIT_WIDTH(17); + unsigned x2930:BITS_WIDTH(16,15); // bits 29:30 if X form + unsigned x25:BIT_WIDTH(14); // bit 25 if X form or + // bit 5 if D or DS form + unsigned x2124:BITS_WIDTH(13,10); // bits 21:24 if X form or + // bits 1:4 if D or DS form + unsigned all615:BITS_WIDTH(9,0); // bits 6:15 of instr + MSR_BITS; +} aisr_t; + +/* + * Program Interrupt Status Register (really SRR1) + */ +typedef struct { + unsigned :BITS_WIDTH(31,21); + unsigned fpee:BIT_WIDTH(20); // floating pt enable exception + unsigned ill:BIT_WIDTH(19); // illegal instruction + unsigned priv:BIT_WIDTH(18); // privileged instruction + unsigned trap:BIT_WIDTH(17); // trap program interrupt + unsigned subseq:BIT_WIDTH(16); // 1 => SRR0 points to + // subsequent instruction + MSR_BITS; +} pisr_t; + +/* + * Condition register. May not be useful in C, let's see... + */ +typedef struct { + unsigned lt:BIT_WIDTH(31), // negative + gt:BIT_WIDTH(30), // positive + eq:BIT_WIDTH(29), // equal to zero + so:BIT_WIDTH(28), // summary overflow + fx:BIT_WIDTH(27), // floating point exception + fex:BIT_WIDTH(26), // fp enabled exception + vx:BIT_WIDTH(25), // fp invalid operation + // exception + ox:BIT_WIDTH(24), // fp overflow exception + rsvd:BITS_WIDTH(23,0); // reserved +} cr_t; + +/* + * Abstract values representing fe0:fe1. + * See get_fp_exc_mode(), below. + */ +typedef enum { + FEM_IGNORE_EXCEP, // ignore exceptions + FEM_IMPR_NONREC, // imprecise nonrecoverable + FEM_IMPR_RECOV, // imprecise recoverable + FEM_PRECISE +} fp_exc_mode_t; + + +/* + * Special purpose registers. + */ + +/* + * Processor version register (special purpose register pvr). + */ +typedef struct { + unsigned version:BITS_WIDTH(31,16), + revision:BITS_WIDTH(15,0); +} pvr_t; + +/* + * Fixed point exception register (special purpose register xer) + */ +typedef struct { + unsigned so:BIT_WIDTH(31), // summary overflow + ov:BIT_WIDTH(30), // overflow + ca:BIT_WIDTH(29), // carry + rsvd1:BITS_WIDTH(28,7), // reserved + byte_count:BITS_WIDTH(6,0); +} xer_t; + +/* + * Inlines and macros to manipulate the above registers. + */ + +/* + * Get/set machine state register. + */ +static __inline__ msr_t +get_msr() +{ + msr_t __msr_tmp; + __asm__ volatile ("mfmsr %0 /* mfmsr */" : "=r" (__msr_tmp)); + return __msr_tmp; +} + +static __inline__ void +set_msr(msr_t msr) +{ + __asm__ volatile ("mtmsr %0 /* mtmsr */ " : : "r" (msr)); +} + +/* + * Determine current fp_exc_mode_t given prog_mode. + */ +static __inline__ fp_exc_mode_t +get_fp_exc_mode(pmr_t pmr) +{ + if(pmr.fe0) + return pmr.fe1 ? FEM_PRECISE : FEM_IMPR_RECOV; + else + return pmr.fe1 ? FEM_IMPR_NONREC : FEM_IGNORE_EXCEP; +} + +/* + * Software definitions for special purpose registers. + * The same register is used as per_cpu data pointer and + * vector base register. This requires that the vector + * table be the first item in the per_cpu table. + */ +#define SR_EXCEPTION_TMP_LR sprg0 +#define SR_EXCEPTION_TMP_CR sprg1 +#define SR_EXCEPTION_TMP_AT sprg2 +#define SR_PER_CPU_DATA sprg3 +#define SR_VBR sprg3 + +/* + * Get/set special purpose registers. + * + * GET_SPR - get SPR by name. + * + * Example usage: + * + * { + * xer_t some_xer; + * + * some_xer = GET_SPR(xer_t, xer); + * ... + * } + * + * This is a strange one. We're creating a list of C expressions within + * a set of curlies; the last expression ("__spr_tmp;") is the return value + * of the statement created by the curlies. + * + */ + +#define GET_SPR(type, spr) \ +({ \ + unsigned __spr_tmp; \ + __asm__ volatile ("mfspr %0, " STRINGIFY(spr) : "=r" (__spr_tmp)); \ + *(type *)&__spr_tmp; \ +}) + +/* + * Example usage of SET_SPR: + * + * { + * xer_t some_xer; + * + * ...set up some_xer... + * SET_SPR(xer, some_xer); + * } + */ +#define SET_SPR(spr, val) \ +MACRO_BEGIN \ + __typeof__ (val) __spr_tmp = (val); \ + __asm__ volatile ("mtspr "STRINGIFY(spr) ", %0" : : "r" (__spr_tmp)); \ +MACRO_END + +/* + * Fully synchronize instruction stream. + */ +static __inline__ void +ppc_sync() +{ + __asm__ volatile ("sync /* sync */" : : ); +} + +#endif /* ! __ASSEMBLER__ */ + +#endif /* _ARCH_PPC_BASIC_REGS_H_ */ + diff --git a/i386/include/architecture/ppc/.svn/text-base/byte_order.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/byte_order.h.svn-base new file mode 100644 index 0000000..c3ffc66 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/byte_order.h.svn-base @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Maintain source compatibility + */ + +#include <architecture/byte_order.h> diff --git a/i386/include/architecture/ppc/.svn/text-base/cframe.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/cframe.h.svn-base new file mode 100644 index 0000000..81de007 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/cframe.h.svn-base @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1991 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/cframe.h + * Author: Mike DeMoney, NeXT Software, Inc. + * + * This include file defines C calling sequence defines + * for ppc port. + * + * HISTORY + * 20-May-97 Umesh Vaishampayan (umeshv@apple.com) + * Added C_RED_ZONE. + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 11-June-91 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_PPC_CFRAME_H_ +#define _ARCH_PPC_CFRAME_H_ + +/* Note that these values are copies of the somewhat more authoritative + * values in <architecture/ppc/mode_independent_asm.h>. We do not + * include that file to avoid breaking legacy clients due to name + * collisions. + * + * Note also that C_ARGSAVE_LEN isn't well defined or useful in PPC. + * Most legacy uses of it are assuming it is the minimum stack frame + * size, which is what we define it to be. + */ +#if defined (__ppc64__) +#define C_ARGSAVE_LEN 64 /* "minimum arg save area" (but see above) */ +#define C_STACK_ALIGN 32 /* stack must be 32 byte aligned */ +#define C_RED_ZONE 320 /* 320 bytes to skip over saved registers */ +#else +#define C_ARGSAVE_LEN 32 /* "minimum arg save area" (but see above) */ +#define C_STACK_ALIGN 16 /* stack must be 16 byte aligned */ +#define C_RED_ZONE 224 /* 224 bytes to skip over saved registers */ +#endif + +#endif /* _ARCH_PPC_CFRAME_H_ */ diff --git a/i386/include/architecture/ppc/.svn/text-base/fenv.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/fenv.h.svn-base new file mode 100644 index 0000000..d047cd2 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/fenv.h.svn-base @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: fenv.h * +* * +* Contains: typedefs and prototypes for C99 floating point environment. * +* * +*******************************************************************************/ + +#ifndef __FENV__ +#define __FENV__ + +#if defined( __i386__ ) || defined( __x86_64__ ) + #error Wrong arch. This is PowerPC only. +#endif + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC fenv +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + A collection of functions designed to provide access to the floating + point environment for numerical programming. It is modeled after + the floating-point requirements in C9X. + + The file <fenv.h> declares many functions in support of numerical + programming. Programs that test flags or run under + non-default modes must do so under the effect of an enabling + "fenv_access" pragma. +*/ + +/******************************************************************************** +* * +* fenv_t is a type for representing the entire floating-point * +* environment in a single object. * +* * +* fexcept_t is a type for representing the floating-point * +* exception flag state collectively. * +* * +********************************************************************************/ +typedef unsigned int fenv_t; +typedef unsigned int fexcept_t; + +/* Definitions of floating-point exception macros */ +#define FE_INEXACT 0x02000000 +#define FE_DIVBYZERO 0x04000000 +#define FE_UNDERFLOW 0x08000000 +#define FE_OVERFLOW 0x10000000 +#define FE_INVALID 0x20000000 +#define FE_ALL_EXCEPT 0x3E000000 + +/* Definitions of rounding direction macros */ +#define FE_TONEAREST 0x00000000 +#define FE_TOWARDZERO 0x00000001 +#define FE_UPWARD 0x00000002 +#define FE_DOWNWARD 0x00000003 + +/* default environment object */ +extern const fenv_t _FE_DFL_ENV; +#define FE_DFL_ENV &_FE_DFL_ENV /* pointer to default environment */ + +/******************************************************************************* +* The following functions provide access to the exception flags. The * +* "int" input argument can be constructed by bitwise ORs of the exception * +* macros: for example: FE_OVERFLOW | FE_INEXACT. * +*******************************************************************************/ + +/******************************************************************************* +* The function "feclearexcept" clears the supported exceptions represented * +* by its argument. * +*******************************************************************************/ + +extern int feclearexcept(int); + + +/******************************************************************************* +* The function "fegetexceptflag" stores a representation of the exception * +* flags indicated by its integer argument through the fexcept_t pointer * +* argument. * +*******************************************************************************/ + +extern int fegetexceptflag(fexcept_t *, int); + + +/******************************************************************************* +* The function "feraiseexcept" raises the supported exceptions * +* represented by its argument. * +*******************************************************************************/ + +extern int feraiseexcept(int); + + +/******************************************************************************* +* The function "fesetexceptflag" sets or clears the exception flags indicated * +* by the its integer argument according to the representation in the * +* object pointed to by the fexcept_t pointer argument. The value of the * +* object must have been set by a previous call to "fegetexceptflag". * +* This function does not raise exceptions; it just sets the state of * +* the flags. * +*******************************************************************************/ + +extern int fesetexceptflag(const fexcept_t *, int); + + +/******************************************************************************* +* The function "fetestexcept" determines which of the specified subset of * +* the exception flags are currently set. The integer argument specifies * +* the exception flags to be queried as a bitwise OR of the exception * +* macros. This function returns the bitwise OR of the exception macros * +* corresponding to the currently set exceptions included in "excepts". * +*******************************************************************************/ + +extern int fetestexcept(int); + + +/******************************************************************************* +* The following functions provide control of rounding direction modes. * +*******************************************************************************/ + +/******************************************************************************* +* The function "fegetround" returns the value of the rounding direction * +* macro which represents the current rounding direction. * +*******************************************************************************/ + +extern int fegetround(void); + + +/******************************************************************************* +* The function "fesetround" establishes the rounding direction represented * +* by its argument. It returns zero if and only if the argument matches * +* a rounding direction macro. If not, the rounding direction is not * +* changed. * +*******************************************************************************/ + +extern int fesetround(int); + + +/******************************************************************************* +* The following functions manage the floating-point environment, exception * +* flags and dynamic modes, as one entity. * +*******************************************************************************/ + +extern int fegetenv(fenv_t *); +extern int feholdexcept(fenv_t *); +extern int fesetenv(const fenv_t *); +extern int feupdateenv(const fenv_t *); + + +#ifdef __cplusplus +} +#endif + +#endif /* __FENV__ */ + diff --git a/i386/include/architecture/ppc/.svn/text-base/fp_regs.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/fp_regs.h.svn-base new file mode 100644 index 0000000..f3202d2 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/fp_regs.h.svn-base @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/fp_regs.h + * Author: Doug Mitchell, NeXT Software, Inc. + * + * ppc floating point registers. + * + * HISTORY + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 05-Nov-92 Doug Mitchell at NeXT + * Created. + */ + +#ifndef _ARCH_PPC_FP_REGS_H_ +#define _ARCH_PPC_FP_REGS_H_ + +#include <architecture/ppc/reg_help.h> + +#if !defined(__ASSEMBLER__) +/* + * Floating point status and control register. + * + * This struct is aligned to an 8-byte boundary because 64-bit + * load/store instructions (lfd/stfd) are used to access it. The + * FPSCR can only be read/written through other FP registers. + */ +typedef struct { + unsigned unused[1] __attribute__(( aligned(8) )); + unsigned fx:BIT_WIDTH(31), // exception summary + fex:BIT_WIDTH(30), // enabled exception summary + vx:BIT_WIDTH(29), // invalid op exception + // summary + ox:BIT_WIDTH(28), // overflow exception + ux:BIT_WIDTH(27), // underflow exception + zx:BIT_WIDTH(26), // divide by zero exception + xx:BIT_WIDTH(25), // inexact exception + vx_snan:BIT_WIDTH(24), // not a number exception + vx_isi:BIT_WIDTH(23), // exception + vx_idi:BIT_WIDTH(22), // exception + vx_zdz:BIT_WIDTH(21), // exception + vx_imz:BIT_WIDTH(20), // exception + vx_xvc:BIT_WIDTH(19), // exception + fr:BIT_WIDTH(18), // fraction rounded + fi:BIT_WIDTH(17), // fraction inexact + class:BIT_WIDTH(16), // class descriptor + fl:BIT_WIDTH(15), // negative + fg:BIT_WIDTH(14), // positive + fe:BIT_WIDTH(13), // equal or zero + fu:BIT_WIDTH(12), // not a number + rsvd1:BIT_WIDTH(11), // reserved + vx_soft:BIT_WIDTH(10), // software request exception + rsvd2:BIT_WIDTH(9), // reserved + vx_cvi:BIT_WIDTH(8), // invalid integer convert + // exception + ve:BIT_WIDTH(7), // invalid op exception enable + oe:BIT_WIDTH(6), // overflow exception enable + ue:BIT_WIDTH(5), // underflow exception enable + ze:BIT_WIDTH(4), // divide by zero exception + // enable + xe:BIT_WIDTH(3), // inexact exception enable + ni:BIT_WIDTH(2), // non-IEEE exception enable + rn:BITS_WIDTH(1,0); // rounding control +} ppc_fp_scr_t; + +/* + * Values for fp_scr_t.rn (rounding control). + */ +typedef enum { + RN_NEAREST = 0, + RN_TOWARD_ZERO = 1, + RN_TOWARD_PLUS = 2, + RN_TOWARD_MINUS = 3 +} ppc_fp_rn_t; + +/* + * ppc_fpf_t -- data types that MAY be in floating point register file + * Actual data types supported is implementation dependent + */ +typedef union { + float f; // 32 bit IEEE single + double d; // 64 bit IEEE double + + /* + * Insure compiler aligns struct appropriately + */ + unsigned x[2] __attribute__(( aligned(8) )); +} ppc_fpf_t; + +/* + * Number of FP registers. + */ +#define PPC_NFP_REGS 32 + +/* + * Read/write FPSCR. + * FIXME - these don't work, you need to go thru a fp register. + */ +typedef union { + double __dbl; + ppc_fp_scr_t __scr; +} __fp_un_t; + +static __inline__ ppc_fp_scr_t +get_fp_scr() +{ + __fp_un_t __fp_un; + + __asm__ volatile ("mffs. %0 /* mffs */" \ + : "=f" (__fp_un.__dbl)); + return (__fp_un.__scr); +} + +static __inline__ void +set_fp_scr(ppc_fp_scr_t fp_scr) +{ + __fp_un_t __fp_un; + + __fp_un.__scr = fp_scr; + __asm__ volatile ("mtfsf 0xff, %0; /* mtfsf */ " \ + : : "f" (__fp_un.__dbl)); +} + +#endif /* ! __ASSEMBLER__ */ + +#endif /* _ARCH_PPC_FP_REGS_H_ */ diff --git a/i386/include/architecture/ppc/.svn/text-base/macro_help.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/macro_help.h.svn-base new file mode 100644 index 0000000..016f1b8 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/macro_help.h.svn-base @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1996 NeXT Software, Inc. + */ +/* + * Mach Operating System + * Copyright (c) 1989 Carnegie-Mellon University + * Copyright (c) 1988 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + * + * File: architecture/ppc/macro_help.h + * + * Provide help in making lint-free macro routines + * + * HISTORY + * + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Created from m98k version. + */ + +#ifndef _ARCH_PPC_MACRO_HELP_H_ +#define _ARCH_PPC_MACRO_HELP_H_ + +#ifndef MACRO_BEGIN +# define MACRO_BEGIN do { +#endif /* MACRO_BEGIN */ + +#ifndef MACRO_END +# define MACRO_END } while (0) +#endif /* MACRO_END */ + +#ifndef MACRO_RETURN +# define MACRO_RETURN if (1) return +#endif /* MACRO_RETURN */ + +#endif /* _ARCH_PPC_MACRO_HELP_H_ */ + diff --git a/i386/include/architecture/ppc/.svn/text-base/math.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/math.h.svn-base new file mode 100644 index 0000000..b0c0652 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/math.h.svn-base @@ -0,0 +1,883 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: math.h * +* * +* Contains: typedefs, prototypes, and macros germane to C99 floating point.* +* * +*******************************************************************************/ +#ifndef __MATH__ +#define __MATH__ + +#include "sys/cdefs.h" /* For definition of __DARWIN_UNIX03 et al */ + +#if (!defined(__WANT_LONG_DOUBLE_FORMAT__)) +#if defined(__APPLE_CC__) && defined(__LONG_DOUBLE_128__) +#define __WANT_LONG_DOUBLE_FORMAT__ 128 +#else +#define __WANT_LONG_DOUBLE_FORMAT__ 64 +#endif +#endif + +#if ( __WANT_LONG_DOUBLE_FORMAT__ - 0L == 128L ) +#define __LIBMLDBL_COMPAT(sym) __asm("_" __STRING(sym) "$LDBL128") +#elif ( __WANT_LONG_DOUBLE_FORMAT__ - 0L == 64L ) +#define __LIBMLDBL_COMPAT(sym) /* NOTHING */ +#else +#define __LIBMLDBL_COMPAT(sym) /* NOTHING */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** +* Floating point data types * +******************************************************************************/ + +/* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2, + taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may + define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler + must and may define only in float.h). +*/ +#if __FLT_EVAL_METHOD__ == 0 + typedef float float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 1 + typedef double float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1 + typedef long double float_t; + typedef long double double_t; +#else /* __FLT_EVAL_METHOD__ */ + #error "Unsupported value of __FLT_EVAL_METHOD__." +#endif /* __FLT_EVAL_METHOD__ */ + + +#if defined(__GNUC__) && ! defined( __XLC__ ) + #define HUGE_VAL __builtin_huge_val() + #define HUGE_VALF __builtin_huge_valf() + #define HUGE_VALL __builtin_huge_vall() + #define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */ + #define __MATH_H_ALWAYS_INLINE__ __attribute__ ((always_inline)) +#else + #define HUGE_VAL 1e500 + #define HUGE_VALF 1e50f + #define HUGE_VALL 1e500L + #define NAN __nan( ) + #define __MATH_H_ALWAYS_INLINE__ +#endif + +#define INFINITY HUGE_VALF + +/****************************************************************************** +* Taxonomy of floating point data types * +******************************************************************************/ + +#define FP_NAN 1 +#define FP_INFINITE 2 +#define FP_ZERO 3 +#define FP_NORMAL 4 +#define FP_SUBNORMAL 5 +#define FP_SUPERNORMAL 6 + +/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */ +#undef FP_FAST_FMA +#undef FP_FAST_FMAF +#undef FP_FAST_FMAL + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 (-2147483647) +#define FP_ILOGBNAN (2147483647) + +/* Bitmasks for the math_errhandling macro. */ +#define MATH_ERRNO 1 /* errno set by math functions. */ +#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ + +#define math_errhandling (__math_errhandling()) +extern unsigned int __math_errhandling ( void ); + +/******************************************************************************** +* * +* Inquiry macros * +* * +* fpclassify Returns one of the FP_ values. * +* isnormal Non-zero if and only if the argument x is normalized. * +* isfinite Non-zero if and only if the argument x is finite. * +* isnan Non-zero if and only if the argument x is a NaN. * +* signbit Non-zero if and only if the sign of the argument x is * +* negative. This includes, NaNs, infinities and zeros. * +* * +********************************************************************************/ + +#if (__WANT_LONG_DOUBLE_FORMAT__ - 0L == 128L) + #define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)x) \ + : sizeof (x) == sizeof(double) ? __fpclassifyd((double)x) \ + : __fpclassify ((long double)x)) + + extern int __fpclassifyf(float ); + extern int __fpclassifyd(double ); + extern int __fpclassify (long double); + + #if defined( __GNUC__ ) && ! defined( __XLC__ ) && 0 == __FINITE_MATH_ONLY__ + /* Yes, that's right. You only get the fast iswhatever() macros if you do NOT turn on -ffast-math. */ + /* These inline functions require the compiler to be compiling to standard in order to work. */ + /* -ffast-math, among other things, implies that NaNs don't happen. The compiler can in that case */ + /* optimize x != x to be false always, wheras it would be true for NaNs. That breaks __inline_isnan() */ + /* below. */ + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \ + : __inline_isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \ + : __inline_isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \ + : __inline_isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \ + : __inline_isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \ + : __inline_signbit((long double)(x))) + + /* Developers who are calling __isnan, __isnormal, __isinf, etc. and now encountering errors are calling private APIs */ + /* that are deprecated. Please use the official C99 sanctioned macros listed above instead. */ + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long __u; }__u; __u.__f = __x; return (int)(__u.__u >> ( 8 * sizeof( __u.__u) - 1)); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; unsigned long __p; }__u; __u.__ld = __x; return (int) (__u.__p >> ( 8 * sizeof( __u.__p) - 1)); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + + #else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnormald((double)(x)) \ + : __isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isfinited((double)(x)) \ + : __isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isinfd((double)(x)) \ + : __isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnand((double)(x)) \ + : __isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __signbitd((double)(x)) \ + : __signbitl((long double)(x))) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + extern int __isnormal (long double); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + extern int __isfinite (long double); + + extern int __isinff (float ); + extern int __isinfd (double ); + extern int __isinf (long double); + + extern int __isnanf (float ); + extern int __isnand (double ); + extern int __isnan (long double); + + extern int __signbitf (float ); + extern int __signbitd (double ); + extern int __signbitl (long double); + + #endif + +#else + #define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)) ) + + extern int __fpclassifyf(float ); + extern int __fpclassifyd(double ); + + #if defined( __GNUC__ ) && ! defined( __XLC__ ) && 0 == __FINITE_MATH_ONLY__ + /* Yes, that's right. You only get the fast iswhatever() macros if you do NOT turn on -ffast-math. */ + /* These inline functions require the compiler to be compiling to standard in order to work. */ + /* -ffast-math, among other things, implies that NaNs don't happen. The compiler can in that case */ + /* optimize x != x to be false always, wheras it would be true for NaNs. That breaks __inline_isnan() */ + /* below. */ + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) : __inline_isnormald((double)(x)) ) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) : __inline_isfinited((double)(x)) ) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) : __inline_isinfd((double)(x)) ) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) : __inline_isnand((double)(x)) ) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) : __inline_signbitd((double)(x)) ) + + /* Developers who are calling __isnan, __isnormal, __isinf, etc. and now encountering errors are calling private APIs */ + /* that are deprecated. Please use the official C99 sanctioned macros listed above instead. */ + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long __u; }__u; __u.__f = __x; return (int)(__u.__u >> ( 8 * sizeof( __u.__u) - 1)); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; unsigned long __p; }__u; __u.__ld = __x; return (int) (__u.__p >> ( 8 * sizeof( __u.__p) - 1)); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + + #else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) : __isnormald((double)(x)) ) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) : __isfinited((double)(x)) ) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) : __isinfd((double)(x)) ) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) : __isnand((double)(x)) ) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) : __signbitd((double)(x)) ) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + + extern int __isinff (float ); + extern int __isinfd (double ); + + extern int __isnanf (float ); + extern int __isnand (double ); + + extern int __signbitf (float ); + extern int __signbitd (double ); + + #endif + +#endif /* __WANT_LONG_DOUBLE_FORMAT__ */ + + +/******************************************************************************** +* * +* Math Functions * +* * +********************************************************************************/ + +extern double acos( double ); +extern float acosf( float ); + +extern double asin( double ); +extern float asinf( float ); + +extern double atan( double ); +extern float atanf( float ); + +extern double atan2( double, double ); +extern float atan2f( float, float ); + +extern double cos( double ); +extern float cosf( float ); + +extern double sin( double ); +extern float sinf( float ); + +extern double tan( double ); +extern float tanf( float ); + +extern double acosh( double ); +extern float acoshf( float ); + +extern double asinh( double ); +extern float asinhf( float ); + +extern double atanh( double ); +extern float atanhf( float ); + +extern double cosh( double ); +extern float coshf( float ); + +extern double sinh( double ); +extern float sinhf( float ); + +extern double tanh( double ); +extern float tanhf( float ); + +extern double exp( double ); +extern float expf( float ); + +extern double exp2( double ); +extern float exp2f( float ); + +extern double expm1( double ); +extern float expm1f( float ); + +extern double log( double ); +extern float logf( float ); + +extern double log10( double ); +extern float log10f( float ); + +extern double log2( double ); +extern float log2f( float ); + +extern double log1p( double ); +extern float log1pf( float ); + +extern double logb( double ); +extern float logbf( float ); + +extern double modf( double, double * ); +extern float modff( float, float * ); + +extern double ldexp( double, int ); +extern float ldexpf( float, int ); + +extern double frexp( double, int * ); +extern float frexpf( float, int * ); + +extern int ilogb( double ); +extern int ilogbf( float ); + +extern double scalbn( double, int ); +extern float scalbnf( float, int ); + +extern double scalbln( double, long int ); +extern float scalblnf( float, long int ); + +extern double fabs( double ); +extern float fabsf( float ); + +extern double cbrt( double ); +extern float cbrtf( float ); + +extern double hypot( double, double ); +extern float hypotf( float, float ); + +extern double pow( double, double ); +extern float powf( float, float ); + +extern double sqrt( double ); +extern float sqrtf( float ); + +extern double erf( double ); +extern float erff( float ); + +extern double erfc( double ); +extern float erfcf( float ); + +extern double lgamma( double ); +extern float lgammaf( float ); + +extern double tgamma( double ); +extern float tgammaf( float ); + +extern double ceil( double ); +extern float ceilf( float ); + +extern double floor( double ); +extern float floorf( float ); + +extern double nearbyint( double ); +extern float nearbyintf( float ); + +extern double rint( double ); +extern float rintf( float ); + +extern long int lrint( double ); +extern long int lrintf( float ); + +extern double round( double ); +extern float roundf( float ); + +extern long int lround( double ); +extern long int lroundf( float ); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + /* C90 doesn't know about long long. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrint( double ); + extern long long int llrintf( float ); + + extern long long int llround( double ); + extern long long int llroundf( float ); +#endif /*#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern double trunc( double ); +extern float truncf( float ); + +extern double fmod( double, double ); +extern float fmodf( float, float ); + +extern double remainder( double, double ); +extern float remainderf( float, float ); + +extern double remquo( double, double, int * ); +extern float remquof( float, float, int * ); + +extern double copysign( double, double ); +extern float copysignf( float, float ); + +extern double nan( const char * ); +extern float nanf( const char * ); + +extern double nextafter( double, double ); +extern float nextafterf( float, float ); + + +extern double fdim( double, double ); +extern float fdimf( float, float ); + +extern double fmax( double, double ); +extern float fmaxf( float, float ); + +extern double fmin( double, double ); +extern float fminf( float, float ); + +extern double fma( double, double, double ); +extern float fmaf( float, float, float ); + +#if ( __WANT_LONG_DOUBLE_FORMAT__ - 0L > 0L ) +extern long double acosl( long double ) __LIBMLDBL_COMPAT(acosl); +extern long double asinl( long double ) __LIBMLDBL_COMPAT(asinl); +extern long double atanl( long double ) __LIBMLDBL_COMPAT(atanl); +extern long double atan2l( long double, long double ) __LIBMLDBL_COMPAT(atan2l); +extern long double cosl( long double ) __LIBMLDBL_COMPAT(cosl); +extern long double sinl( long double ) __LIBMLDBL_COMPAT(sinl); +extern long double tanl( long double ) __LIBMLDBL_COMPAT(tanl); +extern long double acoshl( long double ) __LIBMLDBL_COMPAT(acoshl); +extern long double asinhl( long double ) __LIBMLDBL_COMPAT(asinhl); +extern long double atanhl( long double ) __LIBMLDBL_COMPAT(atanhl); +extern long double coshl( long double ) __LIBMLDBL_COMPAT(coshl); +extern long double sinhl( long double ) __LIBMLDBL_COMPAT(sinhl); +extern long double tanhl( long double ) __LIBMLDBL_COMPAT(tanhl); +extern long double expl( long double ) __LIBMLDBL_COMPAT(expl); +extern long double exp2l( long double ) __LIBMLDBL_COMPAT(exp2l); +extern long double expm1l( long double ) __LIBMLDBL_COMPAT(expm1l); +extern long double logl( long double ) __LIBMLDBL_COMPAT(logl); +extern long double log10l( long double ) __LIBMLDBL_COMPAT(log10l); +extern long double log2l( long double ) __LIBMLDBL_COMPAT(log2l); +extern long double log1pl( long double ) __LIBMLDBL_COMPAT(log1pl); +extern long double logbl( long double ) __LIBMLDBL_COMPAT(logbl); +extern long double modfl( long double, long double * ) __LIBMLDBL_COMPAT(modfl); +extern long double ldexpl( long double, int ) __LIBMLDBL_COMPAT(ldexpl); +extern long double frexpl( long double, int * ) __LIBMLDBL_COMPAT(frexpl); +extern int ilogbl( long double ) __LIBMLDBL_COMPAT(ilogbl); +extern long double scalbnl( long double, int ) __LIBMLDBL_COMPAT(scalbnl); +extern long double scalblnl( long double, long int ) __LIBMLDBL_COMPAT(scalblnl); +extern long double fabsl( long double ) __LIBMLDBL_COMPAT(fabsl); +extern long double cbrtl( long double ) __LIBMLDBL_COMPAT(cbrtl); +extern long double hypotl( long double, long double ) __LIBMLDBL_COMPAT(hypotl); +extern long double powl( long double, long double ) __LIBMLDBL_COMPAT(powl); +extern long double sqrtl( long double ) __LIBMLDBL_COMPAT(sqrtl); +extern long double erfl( long double ) __LIBMLDBL_COMPAT(erfl); +extern long double erfcl( long double ) __LIBMLDBL_COMPAT(erfcl); +extern long double lgammal( long double ) __LIBMLDBL_COMPAT(lgammal); +extern long double tgammal( long double ) __LIBMLDBL_COMPAT(tgammal); +extern long double ceill( long double ) __LIBMLDBL_COMPAT(ceill); +extern long double floorl( long double ) __LIBMLDBL_COMPAT(floorl); +extern long double nearbyintl( long double ) __LIBMLDBL_COMPAT(nearbyintl); +extern long double rintl( long double ) __LIBMLDBL_COMPAT(rintl); +extern long int lrintl( long double ) __LIBMLDBL_COMPAT(lrintl); +extern long double roundl( long double ) __LIBMLDBL_COMPAT(roundl); +extern long int lroundl( long double ) __LIBMLDBL_COMPAT(lroundl); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + /* C90 doesn't know about long long. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrintl( long double ) __LIBMLDBL_COMPAT(llrintl); + extern long long int llroundl( long double ) __LIBMLDBL_COMPAT(llroundl); +#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern long double truncl( long double ) __LIBMLDBL_COMPAT(truncl); +extern long double fmodl( long double, long double) __LIBMLDBL_COMPAT(fmodl); +extern long double remainderl( long double, long double ) __LIBMLDBL_COMPAT(remainderl); +extern long double remquol( long double, long double, int * ) __LIBMLDBL_COMPAT(remquol); +extern long double copysignl( long double, long double ) __LIBMLDBL_COMPAT(copysignl); +extern long double nanl( const char * ) __LIBMLDBL_COMPAT(nanl); +extern long double nextafterl( long double, long double ) __LIBMLDBL_COMPAT(nextafterl); +extern double nexttoward( double, long double ) __LIBMLDBL_COMPAT(nexttoward); +extern float nexttowardf( float, long double ) __LIBMLDBL_COMPAT(nexttowardf); +extern long double nexttowardl( long double, long double ) __LIBMLDBL_COMPAT(nexttowardl); +extern long double fdiml( long double, long double ) __LIBMLDBL_COMPAT(fdiml); +extern long double fmaxl( long double, long double ) __LIBMLDBL_COMPAT(fmaxl); +extern long double fminl( long double, long double ) __LIBMLDBL_COMPAT(fminl); +extern long double fmal( long double, long double, long double ) __LIBMLDBL_COMPAT(fmal); +#endif /* __WANT_LONG_DOUBLE_FORMAT__ */ + +#define isgreater(x, y) __builtin_isgreater ((x),(y)) +#define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y)) +#define isless(x, y) __builtin_isless ((x),(y)) +#define islessequal(x, y) __builtin_islessequal ((x),(y)) +#define islessgreater(x, y) __builtin_islessgreater ((x),(y)) +#define isunordered(x, y) __builtin_isunordered ((x),(y)) + +extern double __inf( void ); +extern float __inff( void ); +extern float __nan( void ); /* 10.3 (and later) must retain in ABI for backward compatability */ + +#if !defined(_ANSI_SOURCE) +extern double j0 ( double ); +extern double j1 ( double ); +extern double jn ( int, double ); + +extern double y0 ( double ); +extern double y1 ( double ); +extern double yn ( int, double ); + +/* + * Scalb Travellers' advisory: + * --------------------------- + * + * Reduction of Information advisory -- This advisory may constitute "too much information". Readers who are easily panicked + * or confused may be needlessly panicked or confused by this advisory. + * + * We are in the process of retiring the legacy scalb. IEEE-754 did not specify what the argument types should be + * for scalb. We guessed scalb(double, int) -- ints are faster to use here -- but our guess and what later standards + * standard eventually settled on did not agree. To be compliant with these standards, our scalb needs to be scalb(double, double). + * Unfortunately, we have a commitment to be binary compatible with old software compiled against scalb(double, int) + * for older operating systems, so the old symbol _scalb must live on in perpetuity in the __ppc__ binary interface to service + * this need. To deal with this problem, we have introduced a new binary symbol _scalb$UNIX2003 and did some magic below + * so that when you now compile against scalb() on a __ppc__ application, you get linked to _scalb$UNIX2003 instead. Thus, + * this constitutes a source level *** API CHANGE *** from scalb( double, int ) to scalb( double, double) on __ppc__ only + * that your source will need to contend with if you compile with this header. On __ppc__, all ints are exactly representable + * as doubles so from an arithmetic standpoint, this should cause no changes arithmetically from parameters of int type, but there + * remains the danger of triggering various compiler warnings that might balloon to more serious problems under -Werror. + * + * On __ppc64__, __i386__ and future archs, scalb has always been scalb( double, double) and will continue to be so. Thus, this change + * will make scalb on all platforms behave identically, with the same parameter types. The change will also eliminate GCC warnings about + * the math.h scalb declaration not matching the gcc4 builtin version. + * + * The intent is that you will "never know" that a change occurred, and your code should "just do the right thing" without modification. + * However, if you would like to sidestep any problems associated with this move, it is suggested that you use the C99 scalbn or scalbln + * or single/long double variants as appropriate instead. Their behavior and type is rigorously defined. There should be no hidden arithmetic + * "gotchas" if you simply replace all legacy calls to scalb with scalbn, since they essentially do the same thing. If you + * decide to take this step, you should exercise due diligence to make sure that scalbn is present in the oldest version of + * MacOS X that you support. Otherwise, your application may fail to load on older systems. C99 support was introduced in MacOS X.3.9. + * + * Use of the symbol _scalb$UNIX2003 should not in itself be construed to mean that scalb$UNIX2003 necessarily is UNIX 2003 compliant. + * UNIX is a registered trademark of The Open Group. + */ + +/* maps to _scalb$UNIX2003 on __ppc__ and _scalb elsewhere */ +#if defined( __ppc__ ) + #if defined( __GNUC__ ) && ! defined( __XLC__ ) && ( ! defined( __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1040 ) + extern double scalb ( double, double ) __asm("_scalb$UNIX2003" ); + #else + extern double scalb ( double , int ); + #endif +#else + extern double scalb ( double, double ); +#endif + +#define M_E 2.71828182845904523536028747135266250 /* e */ +#define M_LOG2E 1.44269504088896340735992468100189214 /* log_2(e) */ +#define M_LOG10E 0.434294481903251827651128918916605082 /* log_10(e) */ +#define M_LN2 0.693147180559945309417232121458176568 /* log_e(2) */ +#define M_LN10 2.30258509299404568401799145468436421 /* log_e(10) */ +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */ +#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */ +#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ +#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */ +#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */ +#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */ +#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ + +#define MAXFLOAT ((float)3.40282346638528860e+38) +extern int signgam; + +#endif /* !defined(_ANSI_SOURCE) */ + +#if !defined(__NOEXTENSIONS__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define __WANT_EXTENSIONS__ +#endif + +#ifdef __WANT_EXTENSIONS__ + +#define FP_SNAN FP_NAN +#define FP_QNAN FP_NAN + +extern long int rinttol ( double ); + +extern long int roundtol ( double ); + +typedef struct __complex_s { + double Real; + double Imag; +} __complex_t; + +/* + * XOPEN/SVID + */ +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) +enum fdversion {_fdlibm_ieee = -1, _fdlibm_svid, _fdlibm_xopen, _fdlibm_posix}; /* Legacy fdlibm constructs */ +#define fdlibm_ieee _fdlibm_ieee +#define fdlibm_svid _fdlibm_svid +#define fdlibm_xopen _fdlibm_xopen +#define fdlibm_posix _fdlibm_posix + +#define _LIB_VERSION_TYPE enum fdversion +#define _LIB_VERSION _fdlib_version + +/* if global variable _LIB_VERSION is not desirable, one may + * change the following to be a constant by: + * #define _LIB_VERSION_TYPE const enum version + * In that case, after one initializes the value _LIB_VERSION (see + * s_lib_version.c) during compile time, it cannot be modified + * in the middle of a program + */ +extern _LIB_VERSION_TYPE _LIB_VERSION; + +#define _IEEE_ fdlibm_ieee +#define _SVID_ fdlibm_svid +#define _XOPEN_ fdlibm_xopen +#define _POSIX_ fdlibm_posix + +#if !defined(__cplusplus) +struct exception { + int type; + char *name; + double arg1; + double arg2; + double retval; +}; +#endif + +#define HUGE MAXFLOAT + +/* + * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> + * (one may replace the following line by "#include <values.h>") + */ + +#define X_TLOSS 1.41484755040568800000e+16 + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#if !defined( __STRICT_ANSI__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +extern int finite ( double ); + +extern double gamma ( double ); + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if !defined(__cplusplus) +extern int matherr ( struct exception * ); +#endif + +/* + * IEEE Test Vector + */ +extern double significand ( double ); + +/* + * BSD math library entry points + */ +extern double drem ( double, double ); + +/* + * Reentrant version of gamma & lgamma; passes signgam back by reference + * as the second argument; user must allocate space for signgam. + */ +#ifdef _REENTRANT +extern double gamma_r ( double, int * ); +extern double lgamma_r ( double, int * ); +#endif /* _REENTRANT */ +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#endif /* __WANT_EXTENSIONS__ */ + +/* + * The following replacements for libm's floor, floorf, ceil, and ceilf are activated + * when the flag "-ffast-math" is passed to the gcc compiler. These functions do not + * distinguish between -0.0 and 0.0, so are not IEC6509 compliant for argument -0.0. + */ +#if defined(__FAST_MATH__) && !defined(__cplusplus) + +#define __FSELS(e,t,f) (((e) >= 0.0f) ? (t) : (f)) +#define __FSEL(e,t,f) (((e) >= 0.0) ? (t) : (f)) + +static __inline__ float __fastmath_floorf( float f ) __attribute__((__always_inline__)); +static __inline__ float __fastmath_floorf( float f ) +{ + float b, c, d, e, g, h, t; + + c = __FSELS( f, -8388608.f, 8388608.f ); b = fabsf( f ); + d = f - c; e = b - 8388608.f; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = f - d; + h = __FSELS( g, 0.0f, 1.0f ); + t = d - h; + return __FSELS( e, f, t ); +} + +static __inline__ float __fastmath_ceilf( float f ) __attribute__((__always_inline__)); +static __inline__ float __fastmath_ceilf( float f ) +{ + float b, c, d, e, g, h, t; + + c = __FSELS( f, -8388608.f, 8388608.f ); b = fabsf( f ); + d = f - c; e = b - 8388608.f; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = d - f; + h = __FSELS( g, 0.0f, 1.0f ); + t = d + h; + return __FSELS( e, f, t ); +} + +static __inline__ double __fastmath_floor( double f ) __attribute__((__always_inline__)); +static __inline__ double __fastmath_floor( double f ) +{ + double b, c, d, e, g, h, t; + + c = __FSEL( f, -4503599627370496., 4503599627370496. ); b = fabs( f ); + d = f - c; e = b - 4503599627370496.; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = f - d; + h = __FSEL( g, 0.0, 1.0 ); + t = d - h; + return __FSEL( e, f, t ); +} + +static __inline__ double __fastmath_ceil( double f ) __attribute__((__always_inline__)); +static __inline__ double __fastmath_ceil( double f ) +{ + double b, c, d, e, g, h, t; + + c = __FSEL( f, -4503599627370496., 4503599627370496. ); b = fabs( f ); + d = f - c; e = b - 4503599627370496.; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = d - f; + h = __FSEL( g, 0.0, 1.0 ); + t = d + h; + return __FSEL( e, f, t ); +} + +#define floorf(x) __fastmath_floorf((x)) +#define ceilf(x) __fastmath_ceilf((x)) +#define floor(x) __fastmath_floor((x)) +#define ceil(x) __fastmath_ceil((x)) + +#endif /* __FAST_MATH__ && !__cplusplus */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MATH__ */ diff --git a/i386/include/architecture/ppc/.svn/text-base/mode_independent_asm.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/mode_independent_asm.h.svn-base new file mode 100644 index 0000000..a5177ce --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/mode_independent_asm.h.svn-base @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _PPC_MODE_INDEPENDENT_ASM_H_ +#define _PPC_MODE_INDEPENDENT_ASM_H_ + + +/* This file facilitates writing mode-independent PPC assembler source, ie + * source which can be built both for 32-bit mode (__ppc__) and 64-bit + * mode (__ppc64__.) + * + * It defines constants such as the number of bytes in a GPR (GPR_BYTES), + * macros to address and call externals (MI_GET_ADDRESS), and a set of mode + * independent PPC assembler pseudo-mnemonics. + * + * The assembler mnemonics map to word operations when building for __ppc__, + * and to doubleword operations when building for __ppc64__. They use "g" to + * stand for either word or doubleword, depending on the target mode. + * + * Although there are certainly other things to be aware of when writing code + * targeted at both 32 and 64-bit mode, using these macros and psuedo-mnemonics + * is surprisingly helpful. + */ + +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#elif defined(__ppc__) +#define MODE_CHOICE(x, y) x +#else +#error undefined architecture +#endif + + +/* The mode-independent "g" mnemonics. */ + +#define cmpg MODE_CHOICE(cmpw, cmpd) +#define cmplg MODE_CHOICE(cmplw, cmpld) +#define cmpgi MODE_CHOICE(cmpwi, cmpdi) +#define cmplgi MODE_CHOICE(cmplwi, cmpldi) +#define srgi MODE_CHOICE(srwi, srdi) +#define srg MODE_CHOICE(srw, srd) +#define sragi MODE_CHOICE(srawi, sradi) +#define slgi MODE_CHOICE(slwi, sldi) +#define rotlgi MODE_CHOICE(rotlwi, rotldi) +#define clrrgi MODE_CHOICE(clrrwi, clrrdi) +#define cntlzg MODE_CHOICE(cntlzw, cntlzd) +#define lg MODE_CHOICE(lwz, ld) +#define stg MODE_CHOICE(stw, std) +#define lgx MODE_CHOICE(lwzx, ldx) +#define stgx MODE_CHOICE(stwx, stdx) +#define lgu MODE_CHOICE(lwzu, ldu) +#define stgu MODE_CHOICE(stwu, stdu) +#define lgux MODE_CHOICE(lwzux, ldux) +#define stgux MODE_CHOICE(stwux, stdux) +#define lgwa MODE_CHOICE(lwz, lwa) + +#define g_long MODE_CHOICE(long, quad) // usage is ".g_long" + + +/* Architectural constants. */ + +#define GPR_BYTES MODE_CHOICE(4,8) // size of a GPR in bytes +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) // log2(GPR_BYTES) + + +/* Stack frame definitions. To keep things simple, we are limited + * to eight arguments and two locals. + */ +#define SF_CRSAVE MODE_CHOICE(4,8) +#define SF_RETURN MODE_CHOICE(8,16) +#define SF_ARG1 MODE_CHOICE(24,48) +#define SF_ARG2 MODE_CHOICE(28,56) +#define SF_ARG3 MODE_CHOICE(32,64) +#define SF_ARG4 MODE_CHOICE(36,72) +#define SF_ARG5 MODE_CHOICE(40,80) +#define SF_ARG6 MODE_CHOICE(44,88) +#define SF_ARG7 MODE_CHOICE(48,96) +#define SF_ARG8 MODE_CHOICE(52,104) +#define SF_LOCAL1 MODE_CHOICE(56,112) +#define SF_LOCAL2 MODE_CHOICE(60,120) +#define SF_SIZE MODE_CHOICE(64,128) + +#define SF_ALIGNMENT MODE_CHOICE(16,32) +#define SF_REDZONE MODE_CHOICE(224,320) + +#define SF_ROUND(x) (((x)+SF_ALIGNMENT-1)&(-SF_ALIGNMENT)) + +#define SF_MINSIZE MODE_CHOICE(64,128) + + +/* WARNING: some clients fall through this macro, so do not attempt + * to optimize by doing an ".align 5" in the macro. Do the 32-byte + * alignment in the .s file, before invoking the macro. + */ +#define MI_ENTRY_POINT(name) \ + .globl name @\ + .text @\ + .align 2 @\ +name: + +#define MI_PUSH_STACK_FRAME \ + mflr r0 @\ + stg r0,SF_RETURN(r1) @\ + stgu r1,-SF_SIZE(r1) + +#define MI_POP_STACK_FRAME_AND_RETURN \ + lg r0,SF_RETURN+SF_SIZE(r1) @\ + addi r1,r1,SF_SIZE @\ + mtlr r0 @\ + blr + + +/* MI_GET_ADDRESS(reg,var) is the basic primitive to address data or code. + * It works both in 32 and 64-bit mode, and with static and dynamic + * code generation. Note however that it can be invoked at most once per + * symbol, since it always creates a non_lazy_ptr in dynamic mode. + * Save the address for re-use, rather than invoking the macro again. + */ +#if defined(__DYNAMIC__) +#define MI_GET_ADDRESS(reg,var) \ + mflr r0 @\ + bcl 20,31,1f @\ +1: mflr reg @\ + mtlr r0 @\ + addis reg,reg,ha16(L ## var ## __non_lazy_ptr - 1b) @\ + lg reg,lo16(L ## var ## __non_lazy_ptr - 1b)(reg) @\ + .non_lazy_symbol_pointer @\ + .align LOG2_GPR_BYTES @\ + .indirect_symbol var @\ +L ## var ## __non_lazy_ptr: @\ + .g_long 0 @\ + .text @\ + .align 2 +#else /* ! __DYNAMIC__ */ +#define MI_GET_ADDRESS(reg,var) \ + lis reg,hi16(var) @\ + ori reg,reg,lo16(var) +#endif + + +/* MI_CALL_EXTERNAL(var) */ + +#if defined(__DYNAMIC__) +#define MI_CALL_EXTERNAL(var) \ + MI_GET_ADDRESS(r12,var) @\ + mtctr r12 @\ + bctrl +#else /* ! __DYNAMIC__ */ +#define MI_CALL_EXTERNAL(var) \ + bl var +#endif + + +/* MI_BRANCH_EXTERNAL(var) */ + +#if defined(__DYNAMIC__) +#define MI_BRANCH_EXTERNAL(var) \ + MI_GET_ADDRESS(r12,var) @\ + mtctr r12 @\ + bctr +#else /* ! __DYNAMIC__ */ +#define MI_BRANCH_EXTERNAL(var) \ + b var +#endif + + +#endif /* _PPC_MODE_INDEPENDENT_ASM_H_ */ diff --git a/i386/include/architecture/ppc/.svn/text-base/pseudo_inst.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/pseudo_inst.h.svn-base new file mode 100644 index 0000000..d22c3f3 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/pseudo_inst.h.svn-base @@ -0,0 +1,447 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/pseudo_inst.h + * Author: Mike DeMoney + * + * This header file defines assembler pseudo-instruction macros for + * for the ppc. + * + * NOTE: This is obviously only useful to include in assembly + * code source. + * + * ALSO NOTE: These macros don't attempt to be 64-bit compatable + * + * HISTORY + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 05-Nov-92 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_PPC_PSEUDO_INST_H_ +#define _ARCH_PPC_PSEUDO_INST_H_ + +#include <architecture/ppc/reg_help.h> +#include <architecture/ppc/asm_help.h> + +#ifdef __ASSEMBLER__ + +/* + * Pseudo instruction definitions + */ + +/* + * Macro package initialization + */ + .set __no_at,0 /* allow at by default */ + +/* + * .at_off -- disable use of at by macros + * .at_on -- enable use of at by macros + */ +.macro .at_off + .set __no_at,1 +.endmacro + +.macro .at_on + .set __no_at,0 +.endmacro + +/* + * li32 rD,IMMED + * + * Load 32-bit immediate into rD + * FIXME: Need a way to undefine built-in macro for this. + */ +.macro li32 // li32 rD,immed +.if $n != 2 + .abort "invalid operands of li32" +.endif +.abs __is_abs,$1 +.if !__is_abs + addis $0,0,hi16($1) + ori $0,$0,lo16($1) +.elseif $1 == 0 + addi $0,0,0 +.elseif ($1 & 0xffff) == 0 + addis $0,0,hi16($1) +.elseif ($1 & 0xffff8000) == 0 + addi $0,0,$1 +.elseif ($1 & 0xffff8000) == 0xffff8000 + addi $0,0,$1 +.else + addis $0,0,hi16($1) + ori $0,$0,lo16($1) +.endif +.endmacro + + +/* + * andi32. rD,rS1,IMMED + * + * Perform "andi." with (possibly) 32-bit immediate + */ +.macro andi32. // andi32. rD,rS1,IMMED +.if $n != 3 + .abort "invalid operands of andi." +.endif + .set __used_at,0 +.abs __is_abs,$2 +.if !__is_abs + .set __used_at,1 + li32 at,$2 + and. $0,$1,at +.elseif ($2 & 0xffff0000) == 0 + andi. $0,$1,$2 +.elseif ($2 & 0xffff) == 0 + andis. $0,$1,hi16($2) +.else + .set __used_at,1 + li32 at,$2 + and. $0,$1,at +.endif +.if __no_at & __used_at + .abort "Macro uses at while .no_at in effect" +.endif +.endmacro + +/* + * ori32 rD,rS1,IMMED + * + * Perform "ori" with (possibly) 32-bit immediate + */ +.macro ori32 // ori32 rD,rS1,IMMED +.if $n != 3 + .abort "invalid operands of ori" +.endif +.abs __is_abs,$2 +.if !__is_abs + oris $0,$1,hi16($2) + ori $0,$1,lo16($2) +.elseif ($2 & 0xffff0000) == 0 + ori $0,$1,$2 +.elseif ($2 & 0xffff) == 0 + oris $0,$1,hi16($2) +.else + oris $0,$1,hi16($2) + ori $0,$1,lo16($2) +.endif +.endmacro + +/* + * xori32 rD,rS1,IMMED + * + * Perform "xor" with (possibly) 32-bit immediate + */ +.macro xori32 // xori32 rD,rS1,IMMED +.if $n != 3 + .abort "invalid operands of xori" +.endif +.abs __is_abs,$2 +.if !__is_abs + xoris $0,$1,hi16($2) + xori $0,$1,lo16($2) +.elseif ($2 & 0xffff0000) == 0 + xori $0,$1,$2 +.elseif ($2 & 0xffff) == 0 + xoris $0,$1,hi16($2) +.else + xoris $0,$1,hi16($2) + xori $0,$1,lo16($2) +.endif +.endmacro + + +/* + * MEMREF_INST -- macros to memory referencing instructions + * "capable" of dealing with 32 bit offsets. + * + * NOTE: Because the assembler doesn't have any mechanism for easily + * parsing the d(rS) syntax of register-displacement form instructions, + * these instructions do NOT mirror the normal memory reference + * instructions. The following "transformation" is used: + * lbz rD,d(rS) + * becomes: + * lbz32 rD,rS,d + * I.e.: "32" is appended to the instruction name and the base register + * and displacement become the 2'nd and 3'rd comma-separated operands. + * + * The forms: + * lbz32 rD,d + * and: + * lbz32 rD,rS + * are also recognized and the missing operand is assumed 0. + * + * ALSO NOTE: r0 or zt should never be used as rS in these instructions. + * Use "0" as rS in this case. + */ +#define MEMREF_INST(op) \ +.macro op ## 32 @\ +.set __used_at,0 @\ +.if $n == 3 @\ + .greg __is_greg,$1 @\ + .abs __is_abs,$2 @\ + .if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$2($1) @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$2($1) @\ + .else @\ + .if !__is_greg @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + op $0,lo16($2)(at) @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + add at,at,$1 @\ + op $0,lo16($2)(at) @\ + .endif @\ + .endif @\ + .else @\ + .if !__is_greg @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + op $0,lo16($2)(at) @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + add at,at,$1 @\ + op $0,lo16($2)(at) @\ + .endif @\ + .endif @\ +.elseif $n == 2 @\ + .greg __is_greg,$1 @\ + .if !__is_greg @\ + .abs __is_abs,$1 @\ + .if __is_abs @\ + .if ($1 & 0xffff8000) == 0 @\ + op $0,$1(0) @\ + .elseif ($1 & 0xffff8000) == 0xffff8000 @\ + op $0,$1(0) @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($1) @\ + op $0,lo16($1)(at) @\ + .endif @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($1) @\ + op $0,lo16($1)(at) @\ + .endif @\ + .else @\ + op $0,0($1) @\ + .endif @\ +.else @\ + .abort "Invalid operands of " #op "32" @\ +.endif @\ +.if __no_at & __used_at @\ + .abort "Macro uses at while .no_at in effect" @\ +.endif @\ +.endmacro + +MEMREF_INST(lbz) +MEMREF_INST(lhz) +MEMREF_INST(lha) +MEMREF_INST(lwz) +MEMREF_INST(lwa) +MEMREF_INST(ld) + +MEMREF_INST(stb) +MEMREF_INST(sth) +MEMREF_INST(stw) +MEMREF_INST(std) + +MEMREF_INST(lmw) +MEMREF_INST(lmd) +MEMREF_INST(stmw) +MEMREF_INST(stmd) + +/* + * ARITH_INST -- define 32-bit immediate forms of arithmetic + * instructions + * + * E.g. addi32 rD,rS,IMMED + */ +#define ARITH_INST(op, op3) \ +.macro op ## 32 @\ +.if $n != 3 @\ + .abort "invalid operands to " #op "32" @\ +.endif @\ +.abs __is_abs,$2 @\ +.if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$1,$2 @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ +.elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ +.else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ +.endif @\ +.endmacro + +ARITH_INST(addi, add) +ARITH_INST(subi, sub) +ARITH_INST(addic, addc) +ARITH_INST(subic, subc) +ARITH_INST(mulli, mull) + +/* + * COND_ARITH_INST -- define 32-bit immediate forms of arithmetic + * instructions that set bits in the condition register + * + * E.g. addic32. rD,rS,IMMED + */ +#define COND_ARITH_INST(name, op, op3) \ +.macro name @\ +.if $n != 3 @\ + .abort "invalid operands to " #name @\ +.endif @\ +.abs __is_abs,$2 @\ +.if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$1,$2 @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ +.elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ +.else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ +.endif @\ +.endmacro + +COND_ARITH_INST(addic32., addic., addc.) +COND_ARITH_INST(subic32., subic., subc.) + +/* + * CMPEX_INST -- define 32-bit immediate forms of extended compare + * instructions + * + * E.g. cmpwi32 cr3,rS,IMMED + * cmpwi32 rS,IMMED + */ +#define CMPEX_INST(op, op3) \ +.macro op ## 32 @\ +.if $n == 3 @\ + .abs __is_abs,$2 @\ + .if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$1,$2 @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ +.elseif $n == 2 @\ + .abs __is_abs,$1 @\ + .if __is_abs @\ + .if ($1 & 0xffff8000) == 0 @\ + op $0,$1 @\ + .elseif ($1 & 0xffff8000) == 0xffff8000 @\ + op $0,$1 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$1 @\ + op3 $0,at @\ + .endif @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$1 @\ + op3 $0,at @\ + .endif @\ +.else @\ + .abort "invalid operands to " #op "32" @\ +.endif @\ +.endmacro + +CMPEX_INST(cmpdi, cmpd) +CMPEX_INST(cmpwi, cmpw) +CMPEX_INST(cmpldi, cmpld) +CMPEX_INST(cmplwi, cmplw) + +/* + * CMP_INST -- define 32-bit immediate forms of standard compare + * instructions + * + * E.g. cmpi32 cr3,0,rS,IMMED + */ +#define CMP_INST(op, op3) \ +.macro op ## 32 @\ +.if $n == 4 @\ + .abs __is_abs,$3 @\ + .if __is_abs @\ + .if ($3 & 0xffff8000) == 0 @\ + op $0,$1,$2,$3 @\ + .elseif ($3 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2,$3 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$3 @\ + op3 $0,$1,$2,at @\ + .endif @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$3 @\ + op3 $0,$1,$2,at @\ + .endif @\ +.else @\ + .abort "invalid operands to " #op "32" @\ +.endif @\ +.endmacro + +CMP_INST(cmpi, cmp) +CMP_INST(cmpli, cmpl) + +#endif /* __ASSEMBLER__ */ + +#endif /* _ARCH_PPC_PSEUDO_INST_H_ */ diff --git a/i386/include/architecture/ppc/.svn/text-base/reg_help.h.svn-base b/i386/include/architecture/ppc/.svn/text-base/reg_help.h.svn-base new file mode 100644 index 0000000..a593802 --- /dev/null +++ b/i386/include/architecture/ppc/.svn/text-base/reg_help.h.svn-base @@ -0,0 +1,225 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/reg_help.h + * Author: Doug Mitchell, NeXT Computer, Inc. + * + * m98k-specific macros and inlines for defining machine registers. + * + * HISTORY + * 05-Nov-92 Doug Mitchell at NeXT + * Created. + * + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. Removed dependency on nrw directory. + * Merged code from architecture/nrw/reg_help.h. + * Moved Register Usage #defines from asm_help.h in here. + */ + +#ifndef _ARCH_PPC_REG_HELP_H_ +#define _ARCH_PPC_REG_HELP_H_ + +#if defined(__ASSEMBLER__) +/* + * GRF Register Usage Aliases + */ +#define zt r0 // architecturally 0 for mem refs only! + // real reg other inst, caller-saved +#define sp r1 // stack pointer, callee-saved +#define toc r2 // tbl of contents, callee-saved +#define a0 r3 // arg 0, return value 0, caller saved +#define a1 r4 // arg 1, return value 1, caller saved +#define a2 r5 // .... +#define a3 r6 +#define a4 r7 +#define a5 r8 +#define a6 r9 +#define a7 r10 // arg 7, return value 7, caller saved +#define ep r11 // environment ptr, caller saved +#define at r12 // assembler temp, caller saved +#define s17 r13 // callee-saved 17 +#define s16 r14 +#define s15 r15 +#define s14 r16 +#define s13 r17 +#define s12 r18 +#define s11 r19 +#define s10 r20 +#define s9 r21 +#define s8 r22 +#define s7 r23 +#define s6 r24 +#define s5 r25 +#define s4 r26 +#define s3 r27 +#define s2 r28 +#define s1 r29 // .... +#define s0 r30 // callee-saved 0 +#define fp r31 // frame-pointer, callee-saved + +/* + * Conversion of GRF aliases to register numbers + */ +#define GRF_ZT 0 // architecturally 0 for mem refs only! + // real reg other inst, caller-saved +#define GRF_SP 1 // stack pointer, callee-saved +#define GRF_TOC 2 // tbl of contents, callee-saved +#define GRF_A0 3 // arg 0, return value 0, caller saved +#define GRF_A1 4 // arg 1, return value 1, caller saved +#define GRF_A2 5 // .... +#define GRF_A3 6 +#define GRF_A4 7 +#define GRF_A5 8 +#define GRF_A6 9 +#define GRF_A7 10 // arg 7, return value 7, caller saved +#define GRF_EP 11 // environment ptr, caller saved +#define GRF_AT 12 // assembler temp, caller saved +#define GRF_S17 13 // callee-saved 17 +#define GRF_S16 14 +#define GRF_S15 15 +#define GRF_S14 16 +#define GRF_S13 17 +#define GRF_S12 18 +#define GRF_S11 19 +#define GRF_S10 20 +#define GRF_S9 21 +#define GRF_S8 22 +#define GRF_S7 23 +#define GRF_S6 24 +#define GRF_S5 25 +#define GRF_S4 26 +#define GRF_S3 27 +#define GRF_S2 28 +#define GRF_S1 29 // .... +#define GRF_S0 30 // callee-saved 0 +#define GRF_FP 31 // frame pointer, callee-saved + +/* + * FPF Register names + */ +#define ft0 f0 // scratch reg, caller-saved +#define fa0 f1 // fp arg 0, return 0, caller-saved +#define fa1 f2 // fp arg 1, caller-saved +#define fa2 f3 // fp arg 2, caller-saved +#define fa3 f4 +#define fa4 f5 +#define fa5 f6 +#define fa6 f7 +#define fa7 f8 +#define fa8 f9 +#define fa9 f10 +#define fa10 f11 +#define fa11 f12 +#define fa12 f13 // fp arg 12, caller-saved +#define fs17 f14 // callee-saved 17 +#define fs16 f15 +#define fs15 f16 +#define fs14 f17 +#define fs13 f18 +#define fs12 f19 +#define fs11 f20 +#define fs10 f21 +#define fs9 f22 +#define fs8 f23 +#define fs7 f24 +#define fs6 f25 +#define fs5 f26 +#define fs4 f27 +#define fs3 f28 +#define fs2 f29 +#define fs1 f30 +#define fs0 f31 // callee-saved 0 + +/* + * Conversion of FPF aliases to register numbers + */ +#define FPF_FT0 0 // scratch reg, caller-saved +#define FPF_FA0 1 // fp arg 0, return 0, caller-saved +#define FPF_FA1 2 // fp arg 1, caller-saved +#define FPF_FA2 3 // fp arg 2, caller-saved +#define FPF_FA3 4 +#define FPF_FA4 5 +#define FPF_FA5 6 +#define FPF_FA6 7 +#define FPF_FA7 8 +#define FPF_FA8 9 +#define FPF_FA9 10 +#define FPF_FA10 11 +#define FPF_FA11 12 +#define FPF_FA12 13 // fp arg 12, caller-saved +#define FPF_FS17 14 // callee-saved 17 +#define FPF_FS16 15 +#define FPF_FS15 16 +#define FPF_FS14 17 +#define FPF_FS13 18 +#define FPF_FS12 19 +#define FPF_FS11 20 +#define FPF_FS10 21 +#define FPF_FS9 22 +#define FPF_FS8 23 +#define FPF_FS7 24 +#define FPF_FS6 25 +#define FPF_FS5 26 +#define FPF_FS4 27 +#define FPF_FS3 28 +#define FPF_FS2 29 +#define FPF_FS1 30 +#define FPF_FS0 31 // callee-saved 0 + +#endif /* __ASSEMBLER__ */ + + +/* Bitfield definition aid */ +#define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) +#define BIT_WIDTH(pos) (1) /* mostly to record the position */ + +/* Mask creation */ +#define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) +#define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) +#define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) + +/* Register addresses */ +#if __ASSEMBLER__ +# define REG_ADDR(type, addr) (addr) +#else /* ! __ASSEMBLER__ */ +# define REG_ADDR(type, addr) (*(volatile type *)(addr)) +#endif /* __ASSEMBLER__ */ + +/* Cast a register to be an unsigned */ +/* CAUTION : non naturally aligned foo can result into alignment traps + * use at own risk. + */ +#define CONTENTS(foo) (*(unsigned *) &(foo)) + +/* STRINGIFY -- perform all possible substitutions, then stringify */ +#define __STR(x) #x /* just a helper macro */ +#define STRINGIFY(x) __STR(x) + +/* + * Stack pointer must always be a multiple of 16 + */ +#define STACK_INCR 16 +#define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) + +#endif /* _ARCH_PPC_REG_HELP_H_ */ diff --git a/i386/include/architecture/ppc/alignment.h b/i386/include/architecture/ppc/alignment.h new file mode 100644 index 0000000..6fb66e5 --- /dev/null +++ b/i386/include/architecture/ppc/alignment.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1996 NeXT Software, Inc. + * + * File: architecture/ppc/alignment.h + + * Natural alignment of shorts and longs (for ppc) + * + * HISTORY + * + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 2 Sept 1992 Brian Raymor at NeXT + * Moved over to architecture. + * 17 August 1992 Jack Greenfield at NeXT + * Created. + */ + +__inline__ static unsigned short +get_align_short(void *ivalue) +{ + unsigned short ovalue = ((unsigned char *) ivalue)[0]; + + ovalue <<= 8 * sizeof(unsigned char); + return ovalue + ((unsigned char *) ivalue)[1]; +} + +__inline__ static unsigned short +put_align_short(unsigned short ivalue, void *ovalue) +{ + unsigned short *tvalue = &ivalue; + + ((unsigned char *) ovalue)[0] = ((unsigned char *) tvalue)[0]; + ((unsigned char *) ovalue)[1] = ((unsigned char *) tvalue)[1]; + return ivalue; +} + +__inline__ static unsigned long +get_align_long(void *ivalue) +{ + unsigned long ovalue = get_align_short(ivalue); + + ovalue <<= 8 * sizeof(unsigned short); + return ovalue + get_align_short(((unsigned char *) ivalue) + sizeof(short)); +} + +__inline__ static unsigned long +put_align_long(unsigned long ivalue, void *ovalue) +{ + unsigned long *tvalue = &ivalue; + + ((unsigned char *) ovalue)[0] = ((unsigned char *) tvalue)[0]; + ((unsigned char *) ovalue)[1] = ((unsigned char *) tvalue)[1]; + ((unsigned char *) ovalue)[2] = ((unsigned char *) tvalue)[2]; + ((unsigned char *) ovalue)[3] = ((unsigned char *) tvalue)[3]; + return ivalue; +} + diff --git a/i386/include/architecture/ppc/asm_help.h b/i386/include/architecture/ppc/asm_help.h new file mode 100644 index 0000000..b045655 --- /dev/null +++ b/i386/include/architecture/ppc/asm_help.h @@ -0,0 +1,451 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/asm_help.h + * Author: Mike DeMoney, NeXT Software, Inc. + * + * This header file defines macros useful when writing assembly code + * for the PowerPC processors. + * r12 is used as the tmp register / PICIFY base. + * + * HISTORY + * 20-May-97 Umesh Vaishampayan (umeshv@apple.com) + * Implemented Dynamic / PIC macros. + * + * 28-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * added ".align" directive to various macros to avoid alignment + * faults. Moved Register Usage #defines to reg_help.h as that's + * where they should have been in the first place. + * Added Dynamic / PIC macroes for routines which refernce external + * symbols. Not implemented fully as yet. + * + * 05-Nov-92 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_PPC_ASM_HELP_H_ +#define _ARCH_PPC_ASM_HELP_H_ + +#include <architecture/ppc/reg_help.h> + +#ifdef __ASSEMBLER__ +/* + * ppc stack frames look like this after procedure prolog has + * been executed: + * + * Higher address: + * ......... + * +-------------------------------+ + * | caller's LR | + * +-------------------------------+ + * | caller's CR | + * +-------------------------------+ + * Caller's SP->| caller's caller's sp | ^^ Caller's Frame ^^ + * +===============================+ vv Called Rtn Frame vv + * | Save Area for | FPF 31 + * .......... + * | Caller's FPF's | FPF n + * +-------------------------------+ + * | Save Area for | GRF 31 + * .......... + * | Caller's GRF's | GRF n + * +-------------------------------+ + * | alignment pad | + * ............ + * | (if necessary) | + * +-------------------------------+ + * | Local | + * ........ + * | Variables | + * +-------------------------------+ + * SP + X -> | aN for FUTURE call | + * +-------------------------------+ + * .......... + * +-------------------------------+ + * SP + 28 -> | a1 for FUTURE call | + * +-------------------------------+ + * SP + 24 -> | a0 for FUTURE call | + * +-------------------------------+ + * SP + 20 -> | caller's TOC | + * +-------------------------------+ + * SP + 16 -> | reserved | + * +-------------------------------+ + * SP + 12 -> | reserved | + * +-------------------------------+ + * SP + 8 -> | LR callee-save for FUTURE call| + * +-------------------------------+ + * SP + 4 -> | CR callee-save for FUTURE call| + * +-------------------------------+ + * SP -> | caller's sp | + * +===============================+ + * Lower address: + * + * NOTE: All state with the exception of LR and CR are saved in the + * called routines frame. LR and CR are saved in the CALLER'S FRAME. + * + * ALSO NOTE: Args to the called routine are found in the caller's frame. + */ + +/* + * ARG(n) -- stack offset to n'th argument + * + * NOTE CAREFULLY! These macros start numbering arguments at 1 (NOT 0) + * The first argument is ARG(1). + * + * ALSO NOTE: This stack offset is only valid if using routine + * DOES NOT alter SP. + * + */ +#define ARG(n) ((((n) - 1) * 4) + 24) + +/* + * Macros for building stack frame according to C calling conventions. + * lr, cr, and sp are saved. + * + * NOTE WELL: localvarsize is in bytes, maxargsout is a count of words, + * grfsaved and fpfsaved is a count of registers. BE SURE TO COUNT + * BOTH FP (r31) AND sN REGISTERS IN THE COUNT OF GRF REGISTERS SAVED! + * This will be TWO more than the N of the highest sN register you + * save: s2 implies you are saving s2, s1, s0, and fp => grfsaved + * should be 4! + * + * FURTHER NOTE: These macros do NOT SAVE GRF or FPF registers. User + * must do that. GRF sN regs should be saved via + * stmw sN,SAVED_GRF_S(N)(sp) + * where N is the highest numbered s* register to be saved. E.g. if + * s0, s1, and s2 are to be saved use: + * stmw s2,SAVED_GRF_S(2)(sp) + * Note that this also saves fp. + * An individual saved grf can be loaded via: + * lwz s2,SAVED_GRF_S(2)(sp) + * Analogous stuff works for fpf's. + * + * NOTE: these simple routines will be replaced with more complicated + * ones once we know what the linker and gdb will require as for as + * register use masks and frame declarations. + * + * Warning: ROUND_TO_STACK is only to be used in assembly language; + * for C usage, use ROUND_FRAME() in reg_help.h. + */ +#define ROUND_TO_STACK(len) \ + (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) + +#define BUILD_FRAME(localvarsize, maxargsout, grfsaved, fpfsaved) \ + .set __argoutsize, ROUND_TO_STACK((maxargsout) * 4) @\ + .if __argoutsize < 32 @\ + .set __argoutsize,32 @\ + .endif @\ + .set __framesize, ROUND_TO_STACK( \ + 24 + __argoutsize + (localvarsize) \ + + 4*(grfsaved) + 8*(fpfsaved)) @\ + .set __grfbase,(__framesize - 4*(grfsaved) - 8*(fpfsaved)) @\ + .set __fpfbase,(__framesize - 8*(fpfsaved)) @\ + mflr r0 @\ + mfcr r12 @\ + stw r0,8(sp) @\ + stw r12,4(sp) @\ + stwu r1,-__framesize(r1) + +/* + * Macros for referencing data in stack frame. + * + * NOTE WELL: ARG's and VAR's start at 1, NOT 0. Why ??? (FIXME) + */ +#define LOCAL_VAR(n) (((n)-1)*4 + __argoutsize + 24) +#define SAVED_GRF_S(n) (__grfbase + ((grfsaved) - (n) - 2) * 4) +#define SAVED_FRF_FS(n) (__fpfbase + ((fpfsaved) - (n) - 1) * 4) +#define ARG_IN(n) (ARG(n) + __framesize) +#define ARG_OUT(n) (ARG(n) + 0) +#define SAVED_FP (__grfbase + ((grfsaved) - 1) * 4) +#define SAVED_LR (__framesize + 8) +#define SAVED_CR (__framesize + 4) + +/* + * Macros for unwinding stack frame. + * NOTE: GRF's and FPF's are NOT RESTORED. User must do this before + * using this macro. + */ +#define RETURN \ + .if __framesize @\ + lwz32 r0,r1,SAVED_LR @\ + lwz32 r12,r1,SAVED_CR @\ + addic sp,r1,__framesize @\ + mtlr r0 @\ + mtcrf 0xff,r12 @\ + blr @\ + .else @\ + blr @\ + .endif + + +/* + * Macros for declaring procedures + * + * Use of these macros allows ctags to have a predictable way + * to find various types of declarations. They also simplify + * inserting appropriate symbol table information. + * + * NOTE: these simple stubs will be replaced with more + * complicated versions once we know what the linker and gdb + * will require as far as register use masks and frame declarations. + * These macros may also be ifdef'ed in the future to contain profiling + * code. + * + * FIXME: Document what makes a leaf a LEAF and a handler a HANDLER. + * (E.g. leaf's have return pc in lr, NESTED's have rpc in offset off + * sp, handlers have rpc in exception frame which is found via exception + * link, etc etc.) + */ + +/* + * TEXT -- declare start of text segment + */ +#define TEXT \ + .text @\ + .align 2 + +/* + * LEAF -- declare global leaf procedure + * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only + * be jumped to. (A leaf may do an align.) Use a LABEL() if you + * need control to flow into the label. + */ +#define LEAF(name) \ + .align 2 @\ + .globl name @\ +name: @\ + .set __framesize,0 + +/* + * X_LEAF -- declare alternate global label for leaf + */ +#define X_LEAF(name, value) \ + .globl name @\ + .set name,value + +/* + * P_LEAF -- declare private leaf procedure + */ +#define P_LEAF(name) \ + .align 2 @\ +name: @\ + .set __framesize,0 + +/* + * LABEL -- declare a global code label + * MUST be used (rather than LEAF, NESTED, etc) if control + * "flows into" the label. + */ +#define LABEL(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * NESTED -- declare procedure that invokes other procedures + */ +#define NESTED(name, localvarsize, maxargsout, grfsaved, fpfsaved)\ + .align 2 @\ + .globl name @\ +name: @\ + BUILD_FRAME(localvarsize, maxargsout, grfsaved, fpfsaved) + +/* + * X_NESTED -- declare alternate global label for nested proc + */ +#define X_NESTED(name, value) \ + .globl name @\ + .set name,value + +/* + * P_NESTED -- declare private nested procedure + */ +#define P_NESTED(name, localvarsize, maxargsout, grfsaved, fpfsaved)\ + .align 2 @\ +name: @\ + BUILD_FRAME(locavarsize, maxargsout, grfsaved, fpfsaved) + +/* + * HANDLER -- declare procedure with exception frame rather than + * standard C frame + */ +#define HANDLER(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * X_HANDLER -- declare alternate name for exception handler + * (Should appear immediately before a HANDLER declaration or + * another X_HANDLER declaration) + */ +#define X_HANDLER(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * P_HANDLER -- declare private handler + */ +#define P_HANDLER(name) \ + .align 2 @\ +name: + +/* + * END -- mark end of procedure + * FIXME: Unimplemented for now. + */ +#define END(name) + +/* + * BL -- call procedure (relative) + */ +#define BL(name) \ + bl name + +/* + * Storage definition macros + * The main purpose of these is to allow an easy handle for ctags + */ + +/* + * IMPORT -- import symbol + */ +#define IMPORT(name) \ + .reference name + +/* + * ABS -- declare global absolute symbol + */ +#define ABS(name, value) \ + .globl name @\ + .set name,value + +/* + * P_ABS -- declare private absolute symbol + */ +#define P_ABS(name, value) \ + .set name,value + +/* + * EXPORT -- declare global label for data + */ +#define EXPORT(name) \ + .align 2 @\ + .globl name @\ +name: + +/* + * BSS -- declare global zero'ed storage + */ +#define BSS(name,size) \ + .comm name,size + + +/* + * P_BSS -- declare private zero'ed storage + */ +#define P_BSS(name,size) \ + .lcomm name,size + +/* + * dynamic/PIC macros for routines which reference external symbols + */ +#if defined(__DYNAMIC__) +#define PICIFY_REG r12 + +/* Assume that the lr is saved before calling any of these macros */ +/* using PICIFY() */ + +#define PICIFY(var) \ + mflr r0 @\ + bcl 20,31,1f @\ +1: mflr PICIFY_REG @\ + mtlr r0 @\ + addis PICIFY_REG, PICIFY_REG, ha16(L ## var ## __non_lazy_ptr - 1b) @\ + lwz PICIFY_REG, lo16(L ## var ## __non_lazy_ptr - 1b)(PICIFY_REG) + +#define CALL_EXTERN_AGAIN(var) \ + PICIFY(var) @\ + mtctr PICIFY_REG @\ + mflr r0 @\ + stw r0,8(r1) @\ + stwu r1,-64(r1) @\ + bctrl @\ + addic r1,r1,64 @\ + lwz r0,8(r1) @\ + mtlr r0 + +#define NON_LAZY_STUB(var) \ + .non_lazy_symbol_pointer @\ + .align 2 @\ +L ## var ## __non_lazy_ptr: @\ + .indirect_symbol var @\ + .long 0 @\ + .text @\ + .align 2 + +#define BRANCH_EXTERN(var) \ + PICIFY(var) @\ + mtctr PICIFY_REG @\ + bctr @\ + NON_LAZY_STUB(var) + +#define CALL_EXTERN(var) \ + CALL_EXTERN_AGAIN(var) @\ + NON_LAZY_STUB(var) + +#define REG_TO_EXTERN(reg, var) \ + PICIFY(var) @\ + stw reg, 0(PICIFY_REG) @\ + NON_LAZY_STUB(var) + +#define EXTERN_TO_REG(reg, var) \ + PICIFY(var) @\ + lwz reg, 0(PICIFY_REG) @\ + NON_LAZY_STUB(var) + +#else /* ! __DYNAMIC__ */ +#define TMP_REG r12 +#define BRANCH_EXTERN(var) \ + b var + +#define CALL_EXTERN(var) \ + bl var + +#define CALL_EXTERN_AGAIN(var) \ + CALL_EXTERN(var) + +#define REG_TO_EXTERN(reg, var) \ + lis TMP_REG, ha16(var) @\ + stw reg, lo16(var)(TMP_REG) + +#define EXTERN_TO_REG(reg, var) \ + lis reg, ha16(var) @\ + lwz reg, lo16(var)(reg) + +#endif /* __DYNAMIC__ */ + +#endif /* __ASSEMBLER__ */ +#endif /* _ARCH_PPC_ASM_HELP_H_ */ diff --git a/i386/include/architecture/ppc/basic_regs.h b/i386/include/architecture/ppc/basic_regs.h new file mode 100644 index 0000000..91a60a8 --- /dev/null +++ b/i386/include/architecture/ppc/basic_regs.h @@ -0,0 +1,301 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/basic_regs.h + * Author: Doug Mitchell, NeXT Software, Inc. + * + * Basic ppc registers. + * + * HISTORY + * 22-May-97 Umesh Vaishampayan (umeshv@apple.com) + Updated to match MPCFPE32B/AD 1/97 REV. 1 + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 05-Nov-92 Doug Mitchell at NeXT + * Created. + */ + +#ifndef _ARCH_PPC_BASIC_REGS_H_ +#define _ARCH_PPC_BASIC_REGS_H_ + +#include <architecture/ppc/reg_help.h> +#include <architecture/ppc/macro_help.h> + +#if !defined(__ASSEMBLER__) + +/* + * Number of General Purpose registers. + */ +#define PPC_NGP_REGS 32 + +/* + * Common half-word used in Machine State Register and in + * various exception frames. Defined as a macro because the compiler + * will align a struct to a word boundary when used inside another struct. + */ +#define MSR_BITS \ + unsigned ee:BIT_WIDTH(15), /* external intr enable */ \ + pr:BIT_WIDTH(14), /* problem state */ \ + fp:BIT_WIDTH(13), /* floating point avail */ \ + me:BIT_WIDTH(12), /* machine check enable */ \ + fe0:BIT_WIDTH(11), /* fp exception mode 0 */ \ + se:BIT_WIDTH(10), /* single step enable */ \ + be:BIT_WIDTH(9), /* branch trace enable */ \ + fe1:BIT_WIDTH(8), /* fp exception mode 0 */ \ + rsvd1:BIT_WIDTH(7), /* reserved */ \ + ip:BIT_WIDTH(6), /* interrupt prefix */ \ + ir:BIT_WIDTH(5), /* instruction relocate */ \ + dr:BIT_WIDTH(4), /* data relocate */ \ + rsvd2:BITS_WIDTH(3,2), /* reserved */ \ + ri:BIT_WIDTH(1), /* recoverable exception */ \ + le:BIT_WIDTH(0) /* Little-endian mode */ + +/* + * Machine state register. + * Read and written via get_msr() and set_msr() inlines, below. + */ +typedef struct { + unsigned rsvd3:BITS_WIDTH(31,19), // reserved + pow:BIT_WIDTH(18), // Power management enable + rsvd0: BIT_WIDTH(17), // reserved + ile: BIT_WIDTH(16); // exception little endian + + MSR_BITS; // see above +} msr_t; + +/* + * Data Storage Interrupt Status Register (DSISR) + */ +typedef struct { + unsigned dse:BIT_WIDTH(31); // direct-store error + unsigned tnf:BIT_WIDTH(30); // translation not found + unsigned :BITS_WIDTH(29,28); + unsigned pe:BIT_WIDTH(27); // protection error + unsigned dsr:BIT_WIDTH(26); // lwarx/stwcx to direct-store + unsigned rw:BIT_WIDTH(25); // 1 => store, 0 => load + unsigned :BITS_WIDTH(24,23); + unsigned dab:BIT_WIDTH(22); // data address bkpt (601) + unsigned ssf:BIT_WIDTH(21); // seg table search failed + unsigned :BITS_WIDTH(20,0); +} dsisr_t; + +/* + * Instruction Storage Interrupt Status Register (really SRR1) + */ +typedef struct { + unsigned :BIT_WIDTH(31); + unsigned tnf:BIT_WIDTH(30); // translation not found + unsigned :BIT_WIDTH(29); + unsigned dse:BIT_WIDTH(28); // direct-store fetch error + unsigned pe:BIT_WIDTH(27); // protection error + unsigned :BITS_WIDTH(26,22); + unsigned ssf:BIT_WIDTH(21); // seg table search failed + unsigned :BITS_WIDTH(20,16); + MSR_BITS; +} isisr_t; + +/* + * Alignment Interrupt Status Register (really DSISR) + * NOTE: bit numbers in field *names* are in IBM'ese (0 is MSB). + * FIXME: Yuck!!! Double Yuck!!! + */ +typedef struct { + unsigned :BITS_WIDTH(31,20); + unsigned ds3031:BITS_WIDTH(19,18);// bits 30:31 if DS form + unsigned :BIT_WIDTH(17); + unsigned x2930:BITS_WIDTH(16,15); // bits 29:30 if X form + unsigned x25:BIT_WIDTH(14); // bit 25 if X form or + // bit 5 if D or DS form + unsigned x2124:BITS_WIDTH(13,10); // bits 21:24 if X form or + // bits 1:4 if D or DS form + unsigned all615:BITS_WIDTH(9,0); // bits 6:15 of instr + MSR_BITS; +} aisr_t; + +/* + * Program Interrupt Status Register (really SRR1) + */ +typedef struct { + unsigned :BITS_WIDTH(31,21); + unsigned fpee:BIT_WIDTH(20); // floating pt enable exception + unsigned ill:BIT_WIDTH(19); // illegal instruction + unsigned priv:BIT_WIDTH(18); // privileged instruction + unsigned trap:BIT_WIDTH(17); // trap program interrupt + unsigned subseq:BIT_WIDTH(16); // 1 => SRR0 points to + // subsequent instruction + MSR_BITS; +} pisr_t; + +/* + * Condition register. May not be useful in C, let's see... + */ +typedef struct { + unsigned lt:BIT_WIDTH(31), // negative + gt:BIT_WIDTH(30), // positive + eq:BIT_WIDTH(29), // equal to zero + so:BIT_WIDTH(28), // summary overflow + fx:BIT_WIDTH(27), // floating point exception + fex:BIT_WIDTH(26), // fp enabled exception + vx:BIT_WIDTH(25), // fp invalid operation + // exception + ox:BIT_WIDTH(24), // fp overflow exception + rsvd:BITS_WIDTH(23,0); // reserved +} cr_t; + +/* + * Abstract values representing fe0:fe1. + * See get_fp_exc_mode(), below. + */ +typedef enum { + FEM_IGNORE_EXCEP, // ignore exceptions + FEM_IMPR_NONREC, // imprecise nonrecoverable + FEM_IMPR_RECOV, // imprecise recoverable + FEM_PRECISE +} fp_exc_mode_t; + + +/* + * Special purpose registers. + */ + +/* + * Processor version register (special purpose register pvr). + */ +typedef struct { + unsigned version:BITS_WIDTH(31,16), + revision:BITS_WIDTH(15,0); +} pvr_t; + +/* + * Fixed point exception register (special purpose register xer) + */ +typedef struct { + unsigned so:BIT_WIDTH(31), // summary overflow + ov:BIT_WIDTH(30), // overflow + ca:BIT_WIDTH(29), // carry + rsvd1:BITS_WIDTH(28,7), // reserved + byte_count:BITS_WIDTH(6,0); +} xer_t; + +/* + * Inlines and macros to manipulate the above registers. + */ + +/* + * Get/set machine state register. + */ +static __inline__ msr_t +get_msr() +{ + msr_t __msr_tmp; + __asm__ volatile ("mfmsr %0 /* mfmsr */" : "=r" (__msr_tmp)); + return __msr_tmp; +} + +static __inline__ void +set_msr(msr_t msr) +{ + __asm__ volatile ("mtmsr %0 /* mtmsr */ " : : "r" (msr)); +} + +/* + * Determine current fp_exc_mode_t given prog_mode. + */ +static __inline__ fp_exc_mode_t +get_fp_exc_mode(pmr_t pmr) +{ + if(pmr.fe0) + return pmr.fe1 ? FEM_PRECISE : FEM_IMPR_RECOV; + else + return pmr.fe1 ? FEM_IMPR_NONREC : FEM_IGNORE_EXCEP; +} + +/* + * Software definitions for special purpose registers. + * The same register is used as per_cpu data pointer and + * vector base register. This requires that the vector + * table be the first item in the per_cpu table. + */ +#define SR_EXCEPTION_TMP_LR sprg0 +#define SR_EXCEPTION_TMP_CR sprg1 +#define SR_EXCEPTION_TMP_AT sprg2 +#define SR_PER_CPU_DATA sprg3 +#define SR_VBR sprg3 + +/* + * Get/set special purpose registers. + * + * GET_SPR - get SPR by name. + * + * Example usage: + * + * { + * xer_t some_xer; + * + * some_xer = GET_SPR(xer_t, xer); + * ... + * } + * + * This is a strange one. We're creating a list of C expressions within + * a set of curlies; the last expression ("__spr_tmp;") is the return value + * of the statement created by the curlies. + * + */ + +#define GET_SPR(type, spr) \ +({ \ + unsigned __spr_tmp; \ + __asm__ volatile ("mfspr %0, " STRINGIFY(spr) : "=r" (__spr_tmp)); \ + *(type *)&__spr_tmp; \ +}) + +/* + * Example usage of SET_SPR: + * + * { + * xer_t some_xer; + * + * ...set up some_xer... + * SET_SPR(xer, some_xer); + * } + */ +#define SET_SPR(spr, val) \ +MACRO_BEGIN \ + __typeof__ (val) __spr_tmp = (val); \ + __asm__ volatile ("mtspr "STRINGIFY(spr) ", %0" : : "r" (__spr_tmp)); \ +MACRO_END + +/* + * Fully synchronize instruction stream. + */ +static __inline__ void +ppc_sync() +{ + __asm__ volatile ("sync /* sync */" : : ); +} + +#endif /* ! __ASSEMBLER__ */ + +#endif /* _ARCH_PPC_BASIC_REGS_H_ */ + diff --git a/i386/include/architecture/ppc/byte_order.h b/i386/include/architecture/ppc/byte_order.h new file mode 100644 index 0000000..c3ffc66 --- /dev/null +++ b/i386/include/architecture/ppc/byte_order.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Maintain source compatibility + */ + +#include <architecture/byte_order.h> diff --git a/i386/include/architecture/ppc/cframe.h b/i386/include/architecture/ppc/cframe.h new file mode 100644 index 0000000..81de007 --- /dev/null +++ b/i386/include/architecture/ppc/cframe.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1991 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/cframe.h + * Author: Mike DeMoney, NeXT Software, Inc. + * + * This include file defines C calling sequence defines + * for ppc port. + * + * HISTORY + * 20-May-97 Umesh Vaishampayan (umeshv@apple.com) + * Added C_RED_ZONE. + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 11-June-91 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_PPC_CFRAME_H_ +#define _ARCH_PPC_CFRAME_H_ + +/* Note that these values are copies of the somewhat more authoritative + * values in <architecture/ppc/mode_independent_asm.h>. We do not + * include that file to avoid breaking legacy clients due to name + * collisions. + * + * Note also that C_ARGSAVE_LEN isn't well defined or useful in PPC. + * Most legacy uses of it are assuming it is the minimum stack frame + * size, which is what we define it to be. + */ +#if defined (__ppc64__) +#define C_ARGSAVE_LEN 64 /* "minimum arg save area" (but see above) */ +#define C_STACK_ALIGN 32 /* stack must be 32 byte aligned */ +#define C_RED_ZONE 320 /* 320 bytes to skip over saved registers */ +#else +#define C_ARGSAVE_LEN 32 /* "minimum arg save area" (but see above) */ +#define C_STACK_ALIGN 16 /* stack must be 16 byte aligned */ +#define C_RED_ZONE 224 /* 224 bytes to skip over saved registers */ +#endif + +#endif /* _ARCH_PPC_CFRAME_H_ */ diff --git a/i386/include/architecture/ppc/fenv.h b/i386/include/architecture/ppc/fenv.h new file mode 100644 index 0000000..d047cd2 --- /dev/null +++ b/i386/include/architecture/ppc/fenv.h @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: fenv.h * +* * +* Contains: typedefs and prototypes for C99 floating point environment. * +* * +*******************************************************************************/ + +#ifndef __FENV__ +#define __FENV__ + +#if defined( __i386__ ) || defined( __x86_64__ ) + #error Wrong arch. This is PowerPC only. +#endif + +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC fenv +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + A collection of functions designed to provide access to the floating + point environment for numerical programming. It is modeled after + the floating-point requirements in C9X. + + The file <fenv.h> declares many functions in support of numerical + programming. Programs that test flags or run under + non-default modes must do so under the effect of an enabling + "fenv_access" pragma. +*/ + +/******************************************************************************** +* * +* fenv_t is a type for representing the entire floating-point * +* environment in a single object. * +* * +* fexcept_t is a type for representing the floating-point * +* exception flag state collectively. * +* * +********************************************************************************/ +typedef unsigned int fenv_t; +typedef unsigned int fexcept_t; + +/* Definitions of floating-point exception macros */ +#define FE_INEXACT 0x02000000 +#define FE_DIVBYZERO 0x04000000 +#define FE_UNDERFLOW 0x08000000 +#define FE_OVERFLOW 0x10000000 +#define FE_INVALID 0x20000000 +#define FE_ALL_EXCEPT 0x3E000000 + +/* Definitions of rounding direction macros */ +#define FE_TONEAREST 0x00000000 +#define FE_TOWARDZERO 0x00000001 +#define FE_UPWARD 0x00000002 +#define FE_DOWNWARD 0x00000003 + +/* default environment object */ +extern const fenv_t _FE_DFL_ENV; +#define FE_DFL_ENV &_FE_DFL_ENV /* pointer to default environment */ + +/******************************************************************************* +* The following functions provide access to the exception flags. The * +* "int" input argument can be constructed by bitwise ORs of the exception * +* macros: for example: FE_OVERFLOW | FE_INEXACT. * +*******************************************************************************/ + +/******************************************************************************* +* The function "feclearexcept" clears the supported exceptions represented * +* by its argument. * +*******************************************************************************/ + +extern int feclearexcept(int); + + +/******************************************************************************* +* The function "fegetexceptflag" stores a representation of the exception * +* flags indicated by its integer argument through the fexcept_t pointer * +* argument. * +*******************************************************************************/ + +extern int fegetexceptflag(fexcept_t *, int); + + +/******************************************************************************* +* The function "feraiseexcept" raises the supported exceptions * +* represented by its argument. * +*******************************************************************************/ + +extern int feraiseexcept(int); + + +/******************************************************************************* +* The function "fesetexceptflag" sets or clears the exception flags indicated * +* by the its integer argument according to the representation in the * +* object pointed to by the fexcept_t pointer argument. The value of the * +* object must have been set by a previous call to "fegetexceptflag". * +* This function does not raise exceptions; it just sets the state of * +* the flags. * +*******************************************************************************/ + +extern int fesetexceptflag(const fexcept_t *, int); + + +/******************************************************************************* +* The function "fetestexcept" determines which of the specified subset of * +* the exception flags are currently set. The integer argument specifies * +* the exception flags to be queried as a bitwise OR of the exception * +* macros. This function returns the bitwise OR of the exception macros * +* corresponding to the currently set exceptions included in "excepts". * +*******************************************************************************/ + +extern int fetestexcept(int); + + +/******************************************************************************* +* The following functions provide control of rounding direction modes. * +*******************************************************************************/ + +/******************************************************************************* +* The function "fegetround" returns the value of the rounding direction * +* macro which represents the current rounding direction. * +*******************************************************************************/ + +extern int fegetround(void); + + +/******************************************************************************* +* The function "fesetround" establishes the rounding direction represented * +* by its argument. It returns zero if and only if the argument matches * +* a rounding direction macro. If not, the rounding direction is not * +* changed. * +*******************************************************************************/ + +extern int fesetround(int); + + +/******************************************************************************* +* The following functions manage the floating-point environment, exception * +* flags and dynamic modes, as one entity. * +*******************************************************************************/ + +extern int fegetenv(fenv_t *); +extern int feholdexcept(fenv_t *); +extern int fesetenv(const fenv_t *); +extern int feupdateenv(const fenv_t *); + + +#ifdef __cplusplus +} +#endif + +#endif /* __FENV__ */ + diff --git a/i386/include/architecture/ppc/fp_regs.h b/i386/include/architecture/ppc/fp_regs.h new file mode 100644 index 0000000..f3202d2 --- /dev/null +++ b/i386/include/architecture/ppc/fp_regs.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/fp_regs.h + * Author: Doug Mitchell, NeXT Software, Inc. + * + * ppc floating point registers. + * + * HISTORY + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 05-Nov-92 Doug Mitchell at NeXT + * Created. + */ + +#ifndef _ARCH_PPC_FP_REGS_H_ +#define _ARCH_PPC_FP_REGS_H_ + +#include <architecture/ppc/reg_help.h> + +#if !defined(__ASSEMBLER__) +/* + * Floating point status and control register. + * + * This struct is aligned to an 8-byte boundary because 64-bit + * load/store instructions (lfd/stfd) are used to access it. The + * FPSCR can only be read/written through other FP registers. + */ +typedef struct { + unsigned unused[1] __attribute__(( aligned(8) )); + unsigned fx:BIT_WIDTH(31), // exception summary + fex:BIT_WIDTH(30), // enabled exception summary + vx:BIT_WIDTH(29), // invalid op exception + // summary + ox:BIT_WIDTH(28), // overflow exception + ux:BIT_WIDTH(27), // underflow exception + zx:BIT_WIDTH(26), // divide by zero exception + xx:BIT_WIDTH(25), // inexact exception + vx_snan:BIT_WIDTH(24), // not a number exception + vx_isi:BIT_WIDTH(23), // exception + vx_idi:BIT_WIDTH(22), // exception + vx_zdz:BIT_WIDTH(21), // exception + vx_imz:BIT_WIDTH(20), // exception + vx_xvc:BIT_WIDTH(19), // exception + fr:BIT_WIDTH(18), // fraction rounded + fi:BIT_WIDTH(17), // fraction inexact + class:BIT_WIDTH(16), // class descriptor + fl:BIT_WIDTH(15), // negative + fg:BIT_WIDTH(14), // positive + fe:BIT_WIDTH(13), // equal or zero + fu:BIT_WIDTH(12), // not a number + rsvd1:BIT_WIDTH(11), // reserved + vx_soft:BIT_WIDTH(10), // software request exception + rsvd2:BIT_WIDTH(9), // reserved + vx_cvi:BIT_WIDTH(8), // invalid integer convert + // exception + ve:BIT_WIDTH(7), // invalid op exception enable + oe:BIT_WIDTH(6), // overflow exception enable + ue:BIT_WIDTH(5), // underflow exception enable + ze:BIT_WIDTH(4), // divide by zero exception + // enable + xe:BIT_WIDTH(3), // inexact exception enable + ni:BIT_WIDTH(2), // non-IEEE exception enable + rn:BITS_WIDTH(1,0); // rounding control +} ppc_fp_scr_t; + +/* + * Values for fp_scr_t.rn (rounding control). + */ +typedef enum { + RN_NEAREST = 0, + RN_TOWARD_ZERO = 1, + RN_TOWARD_PLUS = 2, + RN_TOWARD_MINUS = 3 +} ppc_fp_rn_t; + +/* + * ppc_fpf_t -- data types that MAY be in floating point register file + * Actual data types supported is implementation dependent + */ +typedef union { + float f; // 32 bit IEEE single + double d; // 64 bit IEEE double + + /* + * Insure compiler aligns struct appropriately + */ + unsigned x[2] __attribute__(( aligned(8) )); +} ppc_fpf_t; + +/* + * Number of FP registers. + */ +#define PPC_NFP_REGS 32 + +/* + * Read/write FPSCR. + * FIXME - these don't work, you need to go thru a fp register. + */ +typedef union { + double __dbl; + ppc_fp_scr_t __scr; +} __fp_un_t; + +static __inline__ ppc_fp_scr_t +get_fp_scr() +{ + __fp_un_t __fp_un; + + __asm__ volatile ("mffs. %0 /* mffs */" \ + : "=f" (__fp_un.__dbl)); + return (__fp_un.__scr); +} + +static __inline__ void +set_fp_scr(ppc_fp_scr_t fp_scr) +{ + __fp_un_t __fp_un; + + __fp_un.__scr = fp_scr; + __asm__ volatile ("mtfsf 0xff, %0; /* mtfsf */ " \ + : : "f" (__fp_un.__dbl)); +} + +#endif /* ! __ASSEMBLER__ */ + +#endif /* _ARCH_PPC_FP_REGS_H_ */ diff --git a/i386/include/architecture/ppc/macro_help.h b/i386/include/architecture/ppc/macro_help.h new file mode 100644 index 0000000..016f1b8 --- /dev/null +++ b/i386/include/architecture/ppc/macro_help.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1996 NeXT Software, Inc. + */ +/* + * Mach Operating System + * Copyright (c) 1989 Carnegie-Mellon University + * Copyright (c) 1988 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + * + * File: architecture/ppc/macro_help.h + * + * Provide help in making lint-free macro routines + * + * HISTORY + * + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Created from m98k version. + */ + +#ifndef _ARCH_PPC_MACRO_HELP_H_ +#define _ARCH_PPC_MACRO_HELP_H_ + +#ifndef MACRO_BEGIN +# define MACRO_BEGIN do { +#endif /* MACRO_BEGIN */ + +#ifndef MACRO_END +# define MACRO_END } while (0) +#endif /* MACRO_END */ + +#ifndef MACRO_RETURN +# define MACRO_RETURN if (1) return +#endif /* MACRO_RETURN */ + +#endif /* _ARCH_PPC_MACRO_HELP_H_ */ + diff --git a/i386/include/architecture/ppc/math.h b/i386/include/architecture/ppc/math.h new file mode 100644 index 0000000..b0c0652 --- /dev/null +++ b/i386/include/architecture/ppc/math.h @@ -0,0 +1,883 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/******************************************************************************* +* * +* File: math.h * +* * +* Contains: typedefs, prototypes, and macros germane to C99 floating point.* +* * +*******************************************************************************/ +#ifndef __MATH__ +#define __MATH__ + +#include "sys/cdefs.h" /* For definition of __DARWIN_UNIX03 et al */ + +#if (!defined(__WANT_LONG_DOUBLE_FORMAT__)) +#if defined(__APPLE_CC__) && defined(__LONG_DOUBLE_128__) +#define __WANT_LONG_DOUBLE_FORMAT__ 128 +#else +#define __WANT_LONG_DOUBLE_FORMAT__ 64 +#endif +#endif + +#if ( __WANT_LONG_DOUBLE_FORMAT__ - 0L == 128L ) +#define __LIBMLDBL_COMPAT(sym) __asm("_" __STRING(sym) "$LDBL128") +#elif ( __WANT_LONG_DOUBLE_FORMAT__ - 0L == 64L ) +#define __LIBMLDBL_COMPAT(sym) /* NOTHING */ +#else +#define __LIBMLDBL_COMPAT(sym) /* NOTHING */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** +* Floating point data types * +******************************************************************************/ + +/* Define float_t and double_t per C standard, ISO/IEC 9899:1999 7.12 2, + taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may + define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a compiler + must and may define only in float.h). +*/ +#if __FLT_EVAL_METHOD__ == 0 + typedef float float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 1 + typedef double float_t; + typedef double double_t; +#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1 + typedef long double float_t; + typedef long double double_t; +#else /* __FLT_EVAL_METHOD__ */ + #error "Unsupported value of __FLT_EVAL_METHOD__." +#endif /* __FLT_EVAL_METHOD__ */ + + +#if defined(__GNUC__) && ! defined( __XLC__ ) + #define HUGE_VAL __builtin_huge_val() + #define HUGE_VALF __builtin_huge_valf() + #define HUGE_VALL __builtin_huge_vall() + #define NAN __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */ + #define __MATH_H_ALWAYS_INLINE__ __attribute__ ((always_inline)) +#else + #define HUGE_VAL 1e500 + #define HUGE_VALF 1e50f + #define HUGE_VALL 1e500L + #define NAN __nan( ) + #define __MATH_H_ALWAYS_INLINE__ +#endif + +#define INFINITY HUGE_VALF + +/****************************************************************************** +* Taxonomy of floating point data types * +******************************************************************************/ + +#define FP_NAN 1 +#define FP_INFINITE 2 +#define FP_ZERO 3 +#define FP_NORMAL 4 +#define FP_SUBNORMAL 5 +#define FP_SUPERNORMAL 6 + +/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */ +#undef FP_FAST_FMA +#undef FP_FAST_FMAF +#undef FP_FAST_FMAL + +/* The values returned by `ilogb' for 0 and NaN respectively. */ +#define FP_ILOGB0 (-2147483647) +#define FP_ILOGBNAN (2147483647) + +/* Bitmasks for the math_errhandling macro. */ +#define MATH_ERRNO 1 /* errno set by math functions. */ +#define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */ + +#define math_errhandling (__math_errhandling()) +extern unsigned int __math_errhandling ( void ); + +/******************************************************************************** +* * +* Inquiry macros * +* * +* fpclassify Returns one of the FP_ values. * +* isnormal Non-zero if and only if the argument x is normalized. * +* isfinite Non-zero if and only if the argument x is finite. * +* isnan Non-zero if and only if the argument x is a NaN. * +* signbit Non-zero if and only if the sign of the argument x is * +* negative. This includes, NaNs, infinities and zeros. * +* * +********************************************************************************/ + +#if (__WANT_LONG_DOUBLE_FORMAT__ - 0L == 128L) + #define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)x) \ + : sizeof (x) == sizeof(double) ? __fpclassifyd((double)x) \ + : __fpclassify ((long double)x)) + + extern int __fpclassifyf(float ); + extern int __fpclassifyd(double ); + extern int __fpclassify (long double); + + #if defined( __GNUC__ ) && ! defined( __XLC__ ) && 0 == __FINITE_MATH_ONLY__ + /* Yes, that's right. You only get the fast iswhatever() macros if you do NOT turn on -ffast-math. */ + /* These inline functions require the compiler to be compiling to standard in order to work. */ + /* -ffast-math, among other things, implies that NaNs don't happen. The compiler can in that case */ + /* optimize x != x to be false always, wheras it would be true for NaNs. That breaks __inline_isnan() */ + /* below. */ + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnormald((double)(x)) \ + : __inline_isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isfinited((double)(x)) \ + : __inline_isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isinfd((double)(x)) \ + : __inline_isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_isnand((double)(x)) \ + : __inline_isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __inline_signbitd((double)(x)) \ + : __inline_signbit((long double)(x))) + + /* Developers who are calling __isnan, __isnormal, __isinf, etc. and now encountering errors are calling private APIs */ + /* that are deprecated. Please use the official C99 sanctioned macros listed above instead. */ + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long __u; }__u; __u.__f = __x; return (int)(__u.__u >> ( 8 * sizeof( __u.__u) - 1)); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; unsigned long __p; }__u; __u.__ld = __x; return (int) (__u.__p >> ( 8 * sizeof( __u.__p) - 1)); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + + #else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnormald((double)(x)) \ + : __isnormal ((long double)(x))) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isfinited((double)(x)) \ + : __isfinite ((long double)(x))) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isinfd((double)(x)) \ + : __isinf ((long double)(x))) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __isnand((double)(x)) \ + : __isnan ((long double)(x))) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) \ + : sizeof (x) == sizeof(double) ? __signbitd((double)(x)) \ + : __signbitl((long double)(x))) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + extern int __isnormal (long double); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + extern int __isfinite (long double); + + extern int __isinff (float ); + extern int __isinfd (double ); + extern int __isinf (long double); + + extern int __isnanf (float ); + extern int __isnand (double ); + extern int __isnan (long double); + + extern int __signbitf (float ); + extern int __signbitd (double ); + extern int __signbitl (long double); + + #endif + +#else + #define fpclassify(x) \ + ( sizeof (x) == sizeof(float ) ? __fpclassifyf((float)(x)) : __fpclassifyd((double)(x)) ) + + extern int __fpclassifyf(float ); + extern int __fpclassifyd(double ); + + #if defined( __GNUC__ ) && ! defined( __XLC__ ) && 0 == __FINITE_MATH_ONLY__ + /* Yes, that's right. You only get the fast iswhatever() macros if you do NOT turn on -ffast-math. */ + /* These inline functions require the compiler to be compiling to standard in order to work. */ + /* -ffast-math, among other things, implies that NaNs don't happen. The compiler can in that case */ + /* optimize x != x to be false always, wheras it would be true for NaNs. That breaks __inline_isnan() */ + /* below. */ + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnormalf((float)(x)) : __inline_isnormald((double)(x)) ) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isfinitef((float)(x)) : __inline_isfinited((double)(x)) ) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isinff((float)(x)) : __inline_isinfd((double)(x)) ) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_isnanf((float)(x)) : __inline_isnand((double)(x)) ) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __inline_signbitf((float)(x)) : __inline_signbitd((double)(x)) ) + + /* Developers who are calling __isnan, __isnormal, __isinf, etc. and now encountering errors are calling private APIs */ + /* that are deprecated. Please use the official C99 sanctioned macros listed above instead. */ + + static __inline__ int __inline_isfinitef (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinited (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isfinite (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinff (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinfd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isinf (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnanf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnand (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnan (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormalf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormald (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_isnormal (long double) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitf (float ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbitd (double ) __MATH_H_ALWAYS_INLINE__; + static __inline__ int __inline_signbit (long double) __MATH_H_ALWAYS_INLINE__; + + static __inline__ int __inline_isinff( float __x ) { return __builtin_fabsf(__x) == __builtin_inff(); } + static __inline__ int __inline_isinfd( double __x ) { return __builtin_fabs(__x) == __builtin_inf(); } + static __inline__ int __inline_isinf( long double __x ) { return __builtin_fabsl(__x) == __builtin_infl(); } + static __inline__ int __inline_isfinitef( float __x ) { return __x == __x && __builtin_fabsf(__x) != __builtin_inff(); } + static __inline__ int __inline_isfinited( double __x ) { return __x == __x && __builtin_fabs(__x) != __builtin_inf(); } + static __inline__ int __inline_isfinite( long double __x ) { return __x == __x && __builtin_fabsl(__x) != __builtin_infl(); } + static __inline__ int __inline_isnanf( float __x ) { return __x != __x; } + static __inline__ int __inline_isnand( double __x ) { return __x != __x; } + static __inline__ int __inline_isnan( long double __x ) { return __x != __x; } + static __inline__ int __inline_signbitf( float __x ) { union{ float __f; unsigned int __u; }__u; __u.__f = __x; return (int)(__u.__u >> 31); } + static __inline__ int __inline_signbitd( double __x ) { union{ double __f; unsigned long __u; }__u; __u.__f = __x; return (int)(__u.__u >> ( 8 * sizeof( __u.__u) - 1)); } + static __inline__ int __inline_signbit( long double __x ){ union{ long double __ld; unsigned long __p; }__u; __u.__ld = __x; return (int) (__u.__p >> ( 8 * sizeof( __u.__p) - 1)); } + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } + + #else + + #define isnormal(x) \ + ( sizeof (x) == sizeof(float ) ? __isnormalf((float)(x)) : __isnormald((double)(x)) ) + + #define isfinite(x) \ + ( sizeof (x) == sizeof(float ) ? __isfinitef((float)(x)) : __isfinited((double)(x)) ) + + #define isinf(x) \ + ( sizeof (x) == sizeof(float ) ? __isinff((float)(x)) : __isinfd((double)(x)) ) + + #define isnan(x) \ + ( sizeof (x) == sizeof(float ) ? __isnanf((float)(x)) : __isnand((double)(x)) ) + + #define signbit(x) \ + ( sizeof (x) == sizeof(float ) ? __signbitf((float)(x)) : __signbitd((double)(x)) ) + + + extern int __isnormalf (float ); + extern int __isnormald (double ); + + extern int __isfinitef (float ); + extern int __isfinited (double ); + + extern int __isinff (float ); + extern int __isinfd (double ); + + extern int __isnanf (float ); + extern int __isnand (double ); + + extern int __signbitf (float ); + extern int __signbitd (double ); + + #endif + +#endif /* __WANT_LONG_DOUBLE_FORMAT__ */ + + +/******************************************************************************** +* * +* Math Functions * +* * +********************************************************************************/ + +extern double acos( double ); +extern float acosf( float ); + +extern double asin( double ); +extern float asinf( float ); + +extern double atan( double ); +extern float atanf( float ); + +extern double atan2( double, double ); +extern float atan2f( float, float ); + +extern double cos( double ); +extern float cosf( float ); + +extern double sin( double ); +extern float sinf( float ); + +extern double tan( double ); +extern float tanf( float ); + +extern double acosh( double ); +extern float acoshf( float ); + +extern double asinh( double ); +extern float asinhf( float ); + +extern double atanh( double ); +extern float atanhf( float ); + +extern double cosh( double ); +extern float coshf( float ); + +extern double sinh( double ); +extern float sinhf( float ); + +extern double tanh( double ); +extern float tanhf( float ); + +extern double exp( double ); +extern float expf( float ); + +extern double exp2( double ); +extern float exp2f( float ); + +extern double expm1( double ); +extern float expm1f( float ); + +extern double log( double ); +extern float logf( float ); + +extern double log10( double ); +extern float log10f( float ); + +extern double log2( double ); +extern float log2f( float ); + +extern double log1p( double ); +extern float log1pf( float ); + +extern double logb( double ); +extern float logbf( float ); + +extern double modf( double, double * ); +extern float modff( float, float * ); + +extern double ldexp( double, int ); +extern float ldexpf( float, int ); + +extern double frexp( double, int * ); +extern float frexpf( float, int * ); + +extern int ilogb( double ); +extern int ilogbf( float ); + +extern double scalbn( double, int ); +extern float scalbnf( float, int ); + +extern double scalbln( double, long int ); +extern float scalblnf( float, long int ); + +extern double fabs( double ); +extern float fabsf( float ); + +extern double cbrt( double ); +extern float cbrtf( float ); + +extern double hypot( double, double ); +extern float hypotf( float, float ); + +extern double pow( double, double ); +extern float powf( float, float ); + +extern double sqrt( double ); +extern float sqrtf( float ); + +extern double erf( double ); +extern float erff( float ); + +extern double erfc( double ); +extern float erfcf( float ); + +extern double lgamma( double ); +extern float lgammaf( float ); + +extern double tgamma( double ); +extern float tgammaf( float ); + +extern double ceil( double ); +extern float ceilf( float ); + +extern double floor( double ); +extern float floorf( float ); + +extern double nearbyint( double ); +extern float nearbyintf( float ); + +extern double rint( double ); +extern float rintf( float ); + +extern long int lrint( double ); +extern long int lrintf( float ); + +extern double round( double ); +extern float roundf( float ); + +extern long int lround( double ); +extern long int lroundf( float ); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + /* C90 doesn't know about long long. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrint( double ); + extern long long int llrintf( float ); + + extern long long int llround( double ); + extern long long int llroundf( float ); +#endif /*#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern double trunc( double ); +extern float truncf( float ); + +extern double fmod( double, double ); +extern float fmodf( float, float ); + +extern double remainder( double, double ); +extern float remainderf( float, float ); + +extern double remquo( double, double, int * ); +extern float remquof( float, float, int * ); + +extern double copysign( double, double ); +extern float copysignf( float, float ); + +extern double nan( const char * ); +extern float nanf( const char * ); + +extern double nextafter( double, double ); +extern float nextafterf( float, float ); + + +extern double fdim( double, double ); +extern float fdimf( float, float ); + +extern double fmax( double, double ); +extern float fmaxf( float, float ); + +extern double fmin( double, double ); +extern float fminf( float, float ); + +extern double fma( double, double, double ); +extern float fmaf( float, float, float ); + +#if ( __WANT_LONG_DOUBLE_FORMAT__ - 0L > 0L ) +extern long double acosl( long double ) __LIBMLDBL_COMPAT(acosl); +extern long double asinl( long double ) __LIBMLDBL_COMPAT(asinl); +extern long double atanl( long double ) __LIBMLDBL_COMPAT(atanl); +extern long double atan2l( long double, long double ) __LIBMLDBL_COMPAT(atan2l); +extern long double cosl( long double ) __LIBMLDBL_COMPAT(cosl); +extern long double sinl( long double ) __LIBMLDBL_COMPAT(sinl); +extern long double tanl( long double ) __LIBMLDBL_COMPAT(tanl); +extern long double acoshl( long double ) __LIBMLDBL_COMPAT(acoshl); +extern long double asinhl( long double ) __LIBMLDBL_COMPAT(asinhl); +extern long double atanhl( long double ) __LIBMLDBL_COMPAT(atanhl); +extern long double coshl( long double ) __LIBMLDBL_COMPAT(coshl); +extern long double sinhl( long double ) __LIBMLDBL_COMPAT(sinhl); +extern long double tanhl( long double ) __LIBMLDBL_COMPAT(tanhl); +extern long double expl( long double ) __LIBMLDBL_COMPAT(expl); +extern long double exp2l( long double ) __LIBMLDBL_COMPAT(exp2l); +extern long double expm1l( long double ) __LIBMLDBL_COMPAT(expm1l); +extern long double logl( long double ) __LIBMLDBL_COMPAT(logl); +extern long double log10l( long double ) __LIBMLDBL_COMPAT(log10l); +extern long double log2l( long double ) __LIBMLDBL_COMPAT(log2l); +extern long double log1pl( long double ) __LIBMLDBL_COMPAT(log1pl); +extern long double logbl( long double ) __LIBMLDBL_COMPAT(logbl); +extern long double modfl( long double, long double * ) __LIBMLDBL_COMPAT(modfl); +extern long double ldexpl( long double, int ) __LIBMLDBL_COMPAT(ldexpl); +extern long double frexpl( long double, int * ) __LIBMLDBL_COMPAT(frexpl); +extern int ilogbl( long double ) __LIBMLDBL_COMPAT(ilogbl); +extern long double scalbnl( long double, int ) __LIBMLDBL_COMPAT(scalbnl); +extern long double scalblnl( long double, long int ) __LIBMLDBL_COMPAT(scalblnl); +extern long double fabsl( long double ) __LIBMLDBL_COMPAT(fabsl); +extern long double cbrtl( long double ) __LIBMLDBL_COMPAT(cbrtl); +extern long double hypotl( long double, long double ) __LIBMLDBL_COMPAT(hypotl); +extern long double powl( long double, long double ) __LIBMLDBL_COMPAT(powl); +extern long double sqrtl( long double ) __LIBMLDBL_COMPAT(sqrtl); +extern long double erfl( long double ) __LIBMLDBL_COMPAT(erfl); +extern long double erfcl( long double ) __LIBMLDBL_COMPAT(erfcl); +extern long double lgammal( long double ) __LIBMLDBL_COMPAT(lgammal); +extern long double tgammal( long double ) __LIBMLDBL_COMPAT(tgammal); +extern long double ceill( long double ) __LIBMLDBL_COMPAT(ceill); +extern long double floorl( long double ) __LIBMLDBL_COMPAT(floorl); +extern long double nearbyintl( long double ) __LIBMLDBL_COMPAT(nearbyintl); +extern long double rintl( long double ) __LIBMLDBL_COMPAT(rintl); +extern long int lrintl( long double ) __LIBMLDBL_COMPAT(lrintl); +extern long double roundl( long double ) __LIBMLDBL_COMPAT(roundl); +extern long int lroundl( long double ) __LIBMLDBL_COMPAT(lroundl); + +#if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) + /* C90 doesn't know about long long. Make sure you are passing -std=c99 or -std=gnu99 or better if you need this. */ + extern long long int llrintl( long double ) __LIBMLDBL_COMPAT(llrintl); + extern long long int llroundl( long double ) __LIBMLDBL_COMPAT(llroundl); +#endif /* #if ( defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || ! defined( __STRICT_ANSI__ ) || ! defined( __GNUC__ ) */ + +extern long double truncl( long double ) __LIBMLDBL_COMPAT(truncl); +extern long double fmodl( long double, long double) __LIBMLDBL_COMPAT(fmodl); +extern long double remainderl( long double, long double ) __LIBMLDBL_COMPAT(remainderl); +extern long double remquol( long double, long double, int * ) __LIBMLDBL_COMPAT(remquol); +extern long double copysignl( long double, long double ) __LIBMLDBL_COMPAT(copysignl); +extern long double nanl( const char * ) __LIBMLDBL_COMPAT(nanl); +extern long double nextafterl( long double, long double ) __LIBMLDBL_COMPAT(nextafterl); +extern double nexttoward( double, long double ) __LIBMLDBL_COMPAT(nexttoward); +extern float nexttowardf( float, long double ) __LIBMLDBL_COMPAT(nexttowardf); +extern long double nexttowardl( long double, long double ) __LIBMLDBL_COMPAT(nexttowardl); +extern long double fdiml( long double, long double ) __LIBMLDBL_COMPAT(fdiml); +extern long double fmaxl( long double, long double ) __LIBMLDBL_COMPAT(fmaxl); +extern long double fminl( long double, long double ) __LIBMLDBL_COMPAT(fminl); +extern long double fmal( long double, long double, long double ) __LIBMLDBL_COMPAT(fmal); +#endif /* __WANT_LONG_DOUBLE_FORMAT__ */ + +#define isgreater(x, y) __builtin_isgreater ((x),(y)) +#define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y)) +#define isless(x, y) __builtin_isless ((x),(y)) +#define islessequal(x, y) __builtin_islessequal ((x),(y)) +#define islessgreater(x, y) __builtin_islessgreater ((x),(y)) +#define isunordered(x, y) __builtin_isunordered ((x),(y)) + +extern double __inf( void ); +extern float __inff( void ); +extern float __nan( void ); /* 10.3 (and later) must retain in ABI for backward compatability */ + +#if !defined(_ANSI_SOURCE) +extern double j0 ( double ); +extern double j1 ( double ); +extern double jn ( int, double ); + +extern double y0 ( double ); +extern double y1 ( double ); +extern double yn ( int, double ); + +/* + * Scalb Travellers' advisory: + * --------------------------- + * + * Reduction of Information advisory -- This advisory may constitute "too much information". Readers who are easily panicked + * or confused may be needlessly panicked or confused by this advisory. + * + * We are in the process of retiring the legacy scalb. IEEE-754 did not specify what the argument types should be + * for scalb. We guessed scalb(double, int) -- ints are faster to use here -- but our guess and what later standards + * standard eventually settled on did not agree. To be compliant with these standards, our scalb needs to be scalb(double, double). + * Unfortunately, we have a commitment to be binary compatible with old software compiled against scalb(double, int) + * for older operating systems, so the old symbol _scalb must live on in perpetuity in the __ppc__ binary interface to service + * this need. To deal with this problem, we have introduced a new binary symbol _scalb$UNIX2003 and did some magic below + * so that when you now compile against scalb() on a __ppc__ application, you get linked to _scalb$UNIX2003 instead. Thus, + * this constitutes a source level *** API CHANGE *** from scalb( double, int ) to scalb( double, double) on __ppc__ only + * that your source will need to contend with if you compile with this header. On __ppc__, all ints are exactly representable + * as doubles so from an arithmetic standpoint, this should cause no changes arithmetically from parameters of int type, but there + * remains the danger of triggering various compiler warnings that might balloon to more serious problems under -Werror. + * + * On __ppc64__, __i386__ and future archs, scalb has always been scalb( double, double) and will continue to be so. Thus, this change + * will make scalb on all platforms behave identically, with the same parameter types. The change will also eliminate GCC warnings about + * the math.h scalb declaration not matching the gcc4 builtin version. + * + * The intent is that you will "never know" that a change occurred, and your code should "just do the right thing" without modification. + * However, if you would like to sidestep any problems associated with this move, it is suggested that you use the C99 scalbn or scalbln + * or single/long double variants as appropriate instead. Their behavior and type is rigorously defined. There should be no hidden arithmetic + * "gotchas" if you simply replace all legacy calls to scalb with scalbn, since they essentially do the same thing. If you + * decide to take this step, you should exercise due diligence to make sure that scalbn is present in the oldest version of + * MacOS X that you support. Otherwise, your application may fail to load on older systems. C99 support was introduced in MacOS X.3.9. + * + * Use of the symbol _scalb$UNIX2003 should not in itself be construed to mean that scalb$UNIX2003 necessarily is UNIX 2003 compliant. + * UNIX is a registered trademark of The Open Group. + */ + +/* maps to _scalb$UNIX2003 on __ppc__ and _scalb elsewhere */ +#if defined( __ppc__ ) + #if defined( __GNUC__ ) && ! defined( __XLC__ ) && ( ! defined( __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1040 ) + extern double scalb ( double, double ) __asm("_scalb$UNIX2003" ); + #else + extern double scalb ( double , int ); + #endif +#else + extern double scalb ( double, double ); +#endif + +#define M_E 2.71828182845904523536028747135266250 /* e */ +#define M_LOG2E 1.44269504088896340735992468100189214 /* log_2(e) */ +#define M_LOG10E 0.434294481903251827651128918916605082 /* log_10(e) */ +#define M_LN2 0.693147180559945309417232121458176568 /* log_e(2) */ +#define M_LN10 2.30258509299404568401799145468436421 /* log_e(10) */ +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */ +#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */ +#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */ +#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */ +#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */ +#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */ +#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */ + +#define MAXFLOAT ((float)3.40282346638528860e+38) +extern int signgam; + +#endif /* !defined(_ANSI_SOURCE) */ + +#if !defined(__NOEXTENSIONS__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define __WANT_EXTENSIONS__ +#endif + +#ifdef __WANT_EXTENSIONS__ + +#define FP_SNAN FP_NAN +#define FP_QNAN FP_NAN + +extern long int rinttol ( double ); + +extern long int roundtol ( double ); + +typedef struct __complex_s { + double Real; + double Imag; +} __complex_t; + +/* + * XOPEN/SVID + */ +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) +enum fdversion {_fdlibm_ieee = -1, _fdlibm_svid, _fdlibm_xopen, _fdlibm_posix}; /* Legacy fdlibm constructs */ +#define fdlibm_ieee _fdlibm_ieee +#define fdlibm_svid _fdlibm_svid +#define fdlibm_xopen _fdlibm_xopen +#define fdlibm_posix _fdlibm_posix + +#define _LIB_VERSION_TYPE enum fdversion +#define _LIB_VERSION _fdlib_version + +/* if global variable _LIB_VERSION is not desirable, one may + * change the following to be a constant by: + * #define _LIB_VERSION_TYPE const enum version + * In that case, after one initializes the value _LIB_VERSION (see + * s_lib_version.c) during compile time, it cannot be modified + * in the middle of a program + */ +extern _LIB_VERSION_TYPE _LIB_VERSION; + +#define _IEEE_ fdlibm_ieee +#define _SVID_ fdlibm_svid +#define _XOPEN_ fdlibm_xopen +#define _POSIX_ fdlibm_posix + +#if !defined(__cplusplus) +struct exception { + int type; + char *name; + double arg1; + double arg2; + double retval; +}; +#endif + +#define HUGE MAXFLOAT + +/* + * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> + * (one may replace the following line by "#include <values.h>") + */ + +#define X_TLOSS 1.41484755040568800000e+16 + +#define DOMAIN 1 +#define SING 2 +#define OVERFLOW 3 +#define UNDERFLOW 4 +#define TLOSS 5 +#define PLOSS 6 + +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#if !defined( __STRICT_ANSI__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +extern int finite ( double ); + +extern double gamma ( double ); + +#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#if !defined(__cplusplus) +extern int matherr ( struct exception * ); +#endif + +/* + * IEEE Test Vector + */ +extern double significand ( double ); + +/* + * BSD math library entry points + */ +extern double drem ( double, double ); + +/* + * Reentrant version of gamma & lgamma; passes signgam back by reference + * as the second argument; user must allocate space for signgam. + */ +#ifdef _REENTRANT +extern double gamma_r ( double, int * ); +extern double lgamma_r ( double, int * ); +#endif /* _REENTRANT */ +#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#endif /* __WANT_EXTENSIONS__ */ + +/* + * The following replacements for libm's floor, floorf, ceil, and ceilf are activated + * when the flag "-ffast-math" is passed to the gcc compiler. These functions do not + * distinguish between -0.0 and 0.0, so are not IEC6509 compliant for argument -0.0. + */ +#if defined(__FAST_MATH__) && !defined(__cplusplus) + +#define __FSELS(e,t,f) (((e) >= 0.0f) ? (t) : (f)) +#define __FSEL(e,t,f) (((e) >= 0.0) ? (t) : (f)) + +static __inline__ float __fastmath_floorf( float f ) __attribute__((__always_inline__)); +static __inline__ float __fastmath_floorf( float f ) +{ + float b, c, d, e, g, h, t; + + c = __FSELS( f, -8388608.f, 8388608.f ); b = fabsf( f ); + d = f - c; e = b - 8388608.f; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = f - d; + h = __FSELS( g, 0.0f, 1.0f ); + t = d - h; + return __FSELS( e, f, t ); +} + +static __inline__ float __fastmath_ceilf( float f ) __attribute__((__always_inline__)); +static __inline__ float __fastmath_ceilf( float f ) +{ + float b, c, d, e, g, h, t; + + c = __FSELS( f, -8388608.f, 8388608.f ); b = fabsf( f ); + d = f - c; e = b - 8388608.f; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = d - f; + h = __FSELS( g, 0.0f, 1.0f ); + t = d + h; + return __FSELS( e, f, t ); +} + +static __inline__ double __fastmath_floor( double f ) __attribute__((__always_inline__)); +static __inline__ double __fastmath_floor( double f ) +{ + double b, c, d, e, g, h, t; + + c = __FSEL( f, -4503599627370496., 4503599627370496. ); b = fabs( f ); + d = f - c; e = b - 4503599627370496.; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = f - d; + h = __FSEL( g, 0.0, 1.0 ); + t = d - h; + return __FSEL( e, f, t ); +} + +static __inline__ double __fastmath_ceil( double f ) __attribute__((__always_inline__)); +static __inline__ double __fastmath_ceil( double f ) +{ + double b, c, d, e, g, h, t; + + c = __FSEL( f, -4503599627370496., 4503599627370496. ); b = fabs( f ); + d = f - c; e = b - 4503599627370496.; + __asm__("" : "+f" (d)); /* Tell compiler value of d cannot be optimized away. */ + d = d + c; + g = d - f; + h = __FSEL( g, 0.0, 1.0 ); + t = d + h; + return __FSEL( e, f, t ); +} + +#define floorf(x) __fastmath_floorf((x)) +#define ceilf(x) __fastmath_ceilf((x)) +#define floor(x) __fastmath_floor((x)) +#define ceil(x) __fastmath_ceil((x)) + +#endif /* __FAST_MATH__ && !__cplusplus */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MATH__ */ diff --git a/i386/include/architecture/ppc/mode_independent_asm.h b/i386/include/architecture/ppc/mode_independent_asm.h new file mode 100644 index 0000000..a5177ce --- /dev/null +++ b/i386/include/architecture/ppc/mode_independent_asm.h @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _PPC_MODE_INDEPENDENT_ASM_H_ +#define _PPC_MODE_INDEPENDENT_ASM_H_ + + +/* This file facilitates writing mode-independent PPC assembler source, ie + * source which can be built both for 32-bit mode (__ppc__) and 64-bit + * mode (__ppc64__.) + * + * It defines constants such as the number of bytes in a GPR (GPR_BYTES), + * macros to address and call externals (MI_GET_ADDRESS), and a set of mode + * independent PPC assembler pseudo-mnemonics. + * + * The assembler mnemonics map to word operations when building for __ppc__, + * and to doubleword operations when building for __ppc64__. They use "g" to + * stand for either word or doubleword, depending on the target mode. + * + * Although there are certainly other things to be aware of when writing code + * targeted at both 32 and 64-bit mode, using these macros and psuedo-mnemonics + * is surprisingly helpful. + */ + +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#elif defined(__ppc__) +#define MODE_CHOICE(x, y) x +#else +#error undefined architecture +#endif + + +/* The mode-independent "g" mnemonics. */ + +#define cmpg MODE_CHOICE(cmpw, cmpd) +#define cmplg MODE_CHOICE(cmplw, cmpld) +#define cmpgi MODE_CHOICE(cmpwi, cmpdi) +#define cmplgi MODE_CHOICE(cmplwi, cmpldi) +#define srgi MODE_CHOICE(srwi, srdi) +#define srg MODE_CHOICE(srw, srd) +#define sragi MODE_CHOICE(srawi, sradi) +#define slgi MODE_CHOICE(slwi, sldi) +#define rotlgi MODE_CHOICE(rotlwi, rotldi) +#define clrrgi MODE_CHOICE(clrrwi, clrrdi) +#define cntlzg MODE_CHOICE(cntlzw, cntlzd) +#define lg MODE_CHOICE(lwz, ld) +#define stg MODE_CHOICE(stw, std) +#define lgx MODE_CHOICE(lwzx, ldx) +#define stgx MODE_CHOICE(stwx, stdx) +#define lgu MODE_CHOICE(lwzu, ldu) +#define stgu MODE_CHOICE(stwu, stdu) +#define lgux MODE_CHOICE(lwzux, ldux) +#define stgux MODE_CHOICE(stwux, stdux) +#define lgwa MODE_CHOICE(lwz, lwa) + +#define g_long MODE_CHOICE(long, quad) // usage is ".g_long" + + +/* Architectural constants. */ + +#define GPR_BYTES MODE_CHOICE(4,8) // size of a GPR in bytes +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) // log2(GPR_BYTES) + + +/* Stack frame definitions. To keep things simple, we are limited + * to eight arguments and two locals. + */ +#define SF_CRSAVE MODE_CHOICE(4,8) +#define SF_RETURN MODE_CHOICE(8,16) +#define SF_ARG1 MODE_CHOICE(24,48) +#define SF_ARG2 MODE_CHOICE(28,56) +#define SF_ARG3 MODE_CHOICE(32,64) +#define SF_ARG4 MODE_CHOICE(36,72) +#define SF_ARG5 MODE_CHOICE(40,80) +#define SF_ARG6 MODE_CHOICE(44,88) +#define SF_ARG7 MODE_CHOICE(48,96) +#define SF_ARG8 MODE_CHOICE(52,104) +#define SF_LOCAL1 MODE_CHOICE(56,112) +#define SF_LOCAL2 MODE_CHOICE(60,120) +#define SF_SIZE MODE_CHOICE(64,128) + +#define SF_ALIGNMENT MODE_CHOICE(16,32) +#define SF_REDZONE MODE_CHOICE(224,320) + +#define SF_ROUND(x) (((x)+SF_ALIGNMENT-1)&(-SF_ALIGNMENT)) + +#define SF_MINSIZE MODE_CHOICE(64,128) + + +/* WARNING: some clients fall through this macro, so do not attempt + * to optimize by doing an ".align 5" in the macro. Do the 32-byte + * alignment in the .s file, before invoking the macro. + */ +#define MI_ENTRY_POINT(name) \ + .globl name @\ + .text @\ + .align 2 @\ +name: + +#define MI_PUSH_STACK_FRAME \ + mflr r0 @\ + stg r0,SF_RETURN(r1) @\ + stgu r1,-SF_SIZE(r1) + +#define MI_POP_STACK_FRAME_AND_RETURN \ + lg r0,SF_RETURN+SF_SIZE(r1) @\ + addi r1,r1,SF_SIZE @\ + mtlr r0 @\ + blr + + +/* MI_GET_ADDRESS(reg,var) is the basic primitive to address data or code. + * It works both in 32 and 64-bit mode, and with static and dynamic + * code generation. Note however that it can be invoked at most once per + * symbol, since it always creates a non_lazy_ptr in dynamic mode. + * Save the address for re-use, rather than invoking the macro again. + */ +#if defined(__DYNAMIC__) +#define MI_GET_ADDRESS(reg,var) \ + mflr r0 @\ + bcl 20,31,1f @\ +1: mflr reg @\ + mtlr r0 @\ + addis reg,reg,ha16(L ## var ## __non_lazy_ptr - 1b) @\ + lg reg,lo16(L ## var ## __non_lazy_ptr - 1b)(reg) @\ + .non_lazy_symbol_pointer @\ + .align LOG2_GPR_BYTES @\ + .indirect_symbol var @\ +L ## var ## __non_lazy_ptr: @\ + .g_long 0 @\ + .text @\ + .align 2 +#else /* ! __DYNAMIC__ */ +#define MI_GET_ADDRESS(reg,var) \ + lis reg,hi16(var) @\ + ori reg,reg,lo16(var) +#endif + + +/* MI_CALL_EXTERNAL(var) */ + +#if defined(__DYNAMIC__) +#define MI_CALL_EXTERNAL(var) \ + MI_GET_ADDRESS(r12,var) @\ + mtctr r12 @\ + bctrl +#else /* ! __DYNAMIC__ */ +#define MI_CALL_EXTERNAL(var) \ + bl var +#endif + + +/* MI_BRANCH_EXTERNAL(var) */ + +#if defined(__DYNAMIC__) +#define MI_BRANCH_EXTERNAL(var) \ + MI_GET_ADDRESS(r12,var) @\ + mtctr r12 @\ + bctr +#else /* ! __DYNAMIC__ */ +#define MI_BRANCH_EXTERNAL(var) \ + b var +#endif + + +#endif /* _PPC_MODE_INDEPENDENT_ASM_H_ */ diff --git a/i386/include/architecture/ppc/pseudo_inst.h b/i386/include/architecture/ppc/pseudo_inst.h new file mode 100644 index 0000000..d22c3f3 --- /dev/null +++ b/i386/include/architecture/ppc/pseudo_inst.h @@ -0,0 +1,447 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/pseudo_inst.h + * Author: Mike DeMoney + * + * This header file defines assembler pseudo-instruction macros for + * for the ppc. + * + * NOTE: This is obviously only useful to include in assembly + * code source. + * + * ALSO NOTE: These macros don't attempt to be 64-bit compatable + * + * HISTORY + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. + * 05-Nov-92 Mike DeMoney (mike@next.com) + * Created. + */ + +#ifndef _ARCH_PPC_PSEUDO_INST_H_ +#define _ARCH_PPC_PSEUDO_INST_H_ + +#include <architecture/ppc/reg_help.h> +#include <architecture/ppc/asm_help.h> + +#ifdef __ASSEMBLER__ + +/* + * Pseudo instruction definitions + */ + +/* + * Macro package initialization + */ + .set __no_at,0 /* allow at by default */ + +/* + * .at_off -- disable use of at by macros + * .at_on -- enable use of at by macros + */ +.macro .at_off + .set __no_at,1 +.endmacro + +.macro .at_on + .set __no_at,0 +.endmacro + +/* + * li32 rD,IMMED + * + * Load 32-bit immediate into rD + * FIXME: Need a way to undefine built-in macro for this. + */ +.macro li32 // li32 rD,immed +.if $n != 2 + .abort "invalid operands of li32" +.endif +.abs __is_abs,$1 +.if !__is_abs + addis $0,0,hi16($1) + ori $0,$0,lo16($1) +.elseif $1 == 0 + addi $0,0,0 +.elseif ($1 & 0xffff) == 0 + addis $0,0,hi16($1) +.elseif ($1 & 0xffff8000) == 0 + addi $0,0,$1 +.elseif ($1 & 0xffff8000) == 0xffff8000 + addi $0,0,$1 +.else + addis $0,0,hi16($1) + ori $0,$0,lo16($1) +.endif +.endmacro + + +/* + * andi32. rD,rS1,IMMED + * + * Perform "andi." with (possibly) 32-bit immediate + */ +.macro andi32. // andi32. rD,rS1,IMMED +.if $n != 3 + .abort "invalid operands of andi." +.endif + .set __used_at,0 +.abs __is_abs,$2 +.if !__is_abs + .set __used_at,1 + li32 at,$2 + and. $0,$1,at +.elseif ($2 & 0xffff0000) == 0 + andi. $0,$1,$2 +.elseif ($2 & 0xffff) == 0 + andis. $0,$1,hi16($2) +.else + .set __used_at,1 + li32 at,$2 + and. $0,$1,at +.endif +.if __no_at & __used_at + .abort "Macro uses at while .no_at in effect" +.endif +.endmacro + +/* + * ori32 rD,rS1,IMMED + * + * Perform "ori" with (possibly) 32-bit immediate + */ +.macro ori32 // ori32 rD,rS1,IMMED +.if $n != 3 + .abort "invalid operands of ori" +.endif +.abs __is_abs,$2 +.if !__is_abs + oris $0,$1,hi16($2) + ori $0,$1,lo16($2) +.elseif ($2 & 0xffff0000) == 0 + ori $0,$1,$2 +.elseif ($2 & 0xffff) == 0 + oris $0,$1,hi16($2) +.else + oris $0,$1,hi16($2) + ori $0,$1,lo16($2) +.endif +.endmacro + +/* + * xori32 rD,rS1,IMMED + * + * Perform "xor" with (possibly) 32-bit immediate + */ +.macro xori32 // xori32 rD,rS1,IMMED +.if $n != 3 + .abort "invalid operands of xori" +.endif +.abs __is_abs,$2 +.if !__is_abs + xoris $0,$1,hi16($2) + xori $0,$1,lo16($2) +.elseif ($2 & 0xffff0000) == 0 + xori $0,$1,$2 +.elseif ($2 & 0xffff) == 0 + xoris $0,$1,hi16($2) +.else + xoris $0,$1,hi16($2) + xori $0,$1,lo16($2) +.endif +.endmacro + + +/* + * MEMREF_INST -- macros to memory referencing instructions + * "capable" of dealing with 32 bit offsets. + * + * NOTE: Because the assembler doesn't have any mechanism for easily + * parsing the d(rS) syntax of register-displacement form instructions, + * these instructions do NOT mirror the normal memory reference + * instructions. The following "transformation" is used: + * lbz rD,d(rS) + * becomes: + * lbz32 rD,rS,d + * I.e.: "32" is appended to the instruction name and the base register + * and displacement become the 2'nd and 3'rd comma-separated operands. + * + * The forms: + * lbz32 rD,d + * and: + * lbz32 rD,rS + * are also recognized and the missing operand is assumed 0. + * + * ALSO NOTE: r0 or zt should never be used as rS in these instructions. + * Use "0" as rS in this case. + */ +#define MEMREF_INST(op) \ +.macro op ## 32 @\ +.set __used_at,0 @\ +.if $n == 3 @\ + .greg __is_greg,$1 @\ + .abs __is_abs,$2 @\ + .if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$2($1) @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$2($1) @\ + .else @\ + .if !__is_greg @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + op $0,lo16($2)(at) @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + add at,at,$1 @\ + op $0,lo16($2)(at) @\ + .endif @\ + .endif @\ + .else @\ + .if !__is_greg @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + op $0,lo16($2)(at) @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($2) @\ + add at,at,$1 @\ + op $0,lo16($2)(at) @\ + .endif @\ + .endif @\ +.elseif $n == 2 @\ + .greg __is_greg,$1 @\ + .if !__is_greg @\ + .abs __is_abs,$1 @\ + .if __is_abs @\ + .if ($1 & 0xffff8000) == 0 @\ + op $0,$1(0) @\ + .elseif ($1 & 0xffff8000) == 0xffff8000 @\ + op $0,$1(0) @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($1) @\ + op $0,lo16($1)(at) @\ + .endif @\ + .else @\ + .set __used_at,1 @\ + lis at,ha16($1) @\ + op $0,lo16($1)(at) @\ + .endif @\ + .else @\ + op $0,0($1) @\ + .endif @\ +.else @\ + .abort "Invalid operands of " #op "32" @\ +.endif @\ +.if __no_at & __used_at @\ + .abort "Macro uses at while .no_at in effect" @\ +.endif @\ +.endmacro + +MEMREF_INST(lbz) +MEMREF_INST(lhz) +MEMREF_INST(lha) +MEMREF_INST(lwz) +MEMREF_INST(lwa) +MEMREF_INST(ld) + +MEMREF_INST(stb) +MEMREF_INST(sth) +MEMREF_INST(stw) +MEMREF_INST(std) + +MEMREF_INST(lmw) +MEMREF_INST(lmd) +MEMREF_INST(stmw) +MEMREF_INST(stmd) + +/* + * ARITH_INST -- define 32-bit immediate forms of arithmetic + * instructions + * + * E.g. addi32 rD,rS,IMMED + */ +#define ARITH_INST(op, op3) \ +.macro op ## 32 @\ +.if $n != 3 @\ + .abort "invalid operands to " #op "32" @\ +.endif @\ +.abs __is_abs,$2 @\ +.if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$1,$2 @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ +.elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ +.else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ +.endif @\ +.endmacro + +ARITH_INST(addi, add) +ARITH_INST(subi, sub) +ARITH_INST(addic, addc) +ARITH_INST(subic, subc) +ARITH_INST(mulli, mull) + +/* + * COND_ARITH_INST -- define 32-bit immediate forms of arithmetic + * instructions that set bits in the condition register + * + * E.g. addic32. rD,rS,IMMED + */ +#define COND_ARITH_INST(name, op, op3) \ +.macro name @\ +.if $n != 3 @\ + .abort "invalid operands to " #name @\ +.endif @\ +.abs __is_abs,$2 @\ +.if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$1,$2 @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ +.elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ +.else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ +.endif @\ +.endmacro + +COND_ARITH_INST(addic32., addic., addc.) +COND_ARITH_INST(subic32., subic., subc.) + +/* + * CMPEX_INST -- define 32-bit immediate forms of extended compare + * instructions + * + * E.g. cmpwi32 cr3,rS,IMMED + * cmpwi32 rS,IMMED + */ +#define CMPEX_INST(op, op3) \ +.macro op ## 32 @\ +.if $n == 3 @\ + .abs __is_abs,$2 @\ + .if __is_abs @\ + .if ($2 & 0xffff8000) == 0 @\ + op $0,$1,$2 @\ + .elseif ($2 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$2 @\ + op3 $0,$1,at @\ + .endif @\ +.elseif $n == 2 @\ + .abs __is_abs,$1 @\ + .if __is_abs @\ + .if ($1 & 0xffff8000) == 0 @\ + op $0,$1 @\ + .elseif ($1 & 0xffff8000) == 0xffff8000 @\ + op $0,$1 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$1 @\ + op3 $0,at @\ + .endif @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$1 @\ + op3 $0,at @\ + .endif @\ +.else @\ + .abort "invalid operands to " #op "32" @\ +.endif @\ +.endmacro + +CMPEX_INST(cmpdi, cmpd) +CMPEX_INST(cmpwi, cmpw) +CMPEX_INST(cmpldi, cmpld) +CMPEX_INST(cmplwi, cmplw) + +/* + * CMP_INST -- define 32-bit immediate forms of standard compare + * instructions + * + * E.g. cmpi32 cr3,0,rS,IMMED + */ +#define CMP_INST(op, op3) \ +.macro op ## 32 @\ +.if $n == 4 @\ + .abs __is_abs,$3 @\ + .if __is_abs @\ + .if ($3 & 0xffff8000) == 0 @\ + op $0,$1,$2,$3 @\ + .elseif ($3 & 0xffff8000) == 0xffff8000 @\ + op $0,$1,$2,$3 @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$3 @\ + op3 $0,$1,$2,at @\ + .endif @\ + .elseif __no_at @\ + .abort "Macro uses at while .no_at in effect" @\ + .else @\ + li32 at,$3 @\ + op3 $0,$1,$2,at @\ + .endif @\ +.else @\ + .abort "invalid operands to " #op "32" @\ +.endif @\ +.endmacro + +CMP_INST(cmpi, cmp) +CMP_INST(cmpli, cmpl) + +#endif /* __ASSEMBLER__ */ + +#endif /* _ARCH_PPC_PSEUDO_INST_H_ */ diff --git a/i386/include/architecture/ppc/reg_help.h b/i386/include/architecture/ppc/reg_help.h new file mode 100644 index 0000000..a593802 --- /dev/null +++ b/i386/include/architecture/ppc/reg_help.h @@ -0,0 +1,225 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1996 NeXT Software, Inc. All rights reserved. + * + * File: architecture/ppc/reg_help.h + * Author: Doug Mitchell, NeXT Computer, Inc. + * + * m98k-specific macros and inlines for defining machine registers. + * + * HISTORY + * 05-Nov-92 Doug Mitchell at NeXT + * Created. + * + * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) + * Ported from m98k. Removed dependency on nrw directory. + * Merged code from architecture/nrw/reg_help.h. + * Moved Register Usage #defines from asm_help.h in here. + */ + +#ifndef _ARCH_PPC_REG_HELP_H_ +#define _ARCH_PPC_REG_HELP_H_ + +#if defined(__ASSEMBLER__) +/* + * GRF Register Usage Aliases + */ +#define zt r0 // architecturally 0 for mem refs only! + // real reg other inst, caller-saved +#define sp r1 // stack pointer, callee-saved +#define toc r2 // tbl of contents, callee-saved +#define a0 r3 // arg 0, return value 0, caller saved +#define a1 r4 // arg 1, return value 1, caller saved +#define a2 r5 // .... +#define a3 r6 +#define a4 r7 +#define a5 r8 +#define a6 r9 +#define a7 r10 // arg 7, return value 7, caller saved +#define ep r11 // environment ptr, caller saved +#define at r12 // assembler temp, caller saved +#define s17 r13 // callee-saved 17 +#define s16 r14 +#define s15 r15 +#define s14 r16 +#define s13 r17 +#define s12 r18 +#define s11 r19 +#define s10 r20 +#define s9 r21 +#define s8 r22 +#define s7 r23 +#define s6 r24 +#define s5 r25 +#define s4 r26 +#define s3 r27 +#define s2 r28 +#define s1 r29 // .... +#define s0 r30 // callee-saved 0 +#define fp r31 // frame-pointer, callee-saved + +/* + * Conversion of GRF aliases to register numbers + */ +#define GRF_ZT 0 // architecturally 0 for mem refs only! + // real reg other inst, caller-saved +#define GRF_SP 1 // stack pointer, callee-saved +#define GRF_TOC 2 // tbl of contents, callee-saved +#define GRF_A0 3 // arg 0, return value 0, caller saved +#define GRF_A1 4 // arg 1, return value 1, caller saved +#define GRF_A2 5 // .... +#define GRF_A3 6 +#define GRF_A4 7 +#define GRF_A5 8 +#define GRF_A6 9 +#define GRF_A7 10 // arg 7, return value 7, caller saved +#define GRF_EP 11 // environment ptr, caller saved +#define GRF_AT 12 // assembler temp, caller saved +#define GRF_S17 13 // callee-saved 17 +#define GRF_S16 14 +#define GRF_S15 15 +#define GRF_S14 16 +#define GRF_S13 17 +#define GRF_S12 18 +#define GRF_S11 19 +#define GRF_S10 20 +#define GRF_S9 21 +#define GRF_S8 22 +#define GRF_S7 23 +#define GRF_S6 24 +#define GRF_S5 25 +#define GRF_S4 26 +#define GRF_S3 27 +#define GRF_S2 28 +#define GRF_S1 29 // .... +#define GRF_S0 30 // callee-saved 0 +#define GRF_FP 31 // frame pointer, callee-saved + +/* + * FPF Register names + */ +#define ft0 f0 // scratch reg, caller-saved +#define fa0 f1 // fp arg 0, return 0, caller-saved +#define fa1 f2 // fp arg 1, caller-saved +#define fa2 f3 // fp arg 2, caller-saved +#define fa3 f4 +#define fa4 f5 +#define fa5 f6 +#define fa6 f7 +#define fa7 f8 +#define fa8 f9 +#define fa9 f10 +#define fa10 f11 +#define fa11 f12 +#define fa12 f13 // fp arg 12, caller-saved +#define fs17 f14 // callee-saved 17 +#define fs16 f15 +#define fs15 f16 +#define fs14 f17 +#define fs13 f18 +#define fs12 f19 +#define fs11 f20 +#define fs10 f21 +#define fs9 f22 +#define fs8 f23 +#define fs7 f24 +#define fs6 f25 +#define fs5 f26 +#define fs4 f27 +#define fs3 f28 +#define fs2 f29 +#define fs1 f30 +#define fs0 f31 // callee-saved 0 + +/* + * Conversion of FPF aliases to register numbers + */ +#define FPF_FT0 0 // scratch reg, caller-saved +#define FPF_FA0 1 // fp arg 0, return 0, caller-saved +#define FPF_FA1 2 // fp arg 1, caller-saved +#define FPF_FA2 3 // fp arg 2, caller-saved +#define FPF_FA3 4 +#define FPF_FA4 5 +#define FPF_FA5 6 +#define FPF_FA6 7 +#define FPF_FA7 8 +#define FPF_FA8 9 +#define FPF_FA9 10 +#define FPF_FA10 11 +#define FPF_FA11 12 +#define FPF_FA12 13 // fp arg 12, caller-saved +#define FPF_FS17 14 // callee-saved 17 +#define FPF_FS16 15 +#define FPF_FS15 16 +#define FPF_FS14 17 +#define FPF_FS13 18 +#define FPF_FS12 19 +#define FPF_FS11 20 +#define FPF_FS10 21 +#define FPF_FS9 22 +#define FPF_FS8 23 +#define FPF_FS7 24 +#define FPF_FS6 25 +#define FPF_FS5 26 +#define FPF_FS4 27 +#define FPF_FS3 28 +#define FPF_FS2 29 +#define FPF_FS1 30 +#define FPF_FS0 31 // callee-saved 0 + +#endif /* __ASSEMBLER__ */ + + +/* Bitfield definition aid */ +#define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) +#define BIT_WIDTH(pos) (1) /* mostly to record the position */ + +/* Mask creation */ +#define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) +#define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) +#define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) + +/* Register addresses */ +#if __ASSEMBLER__ +# define REG_ADDR(type, addr) (addr) +#else /* ! __ASSEMBLER__ */ +# define REG_ADDR(type, addr) (*(volatile type *)(addr)) +#endif /* __ASSEMBLER__ */ + +/* Cast a register to be an unsigned */ +/* CAUTION : non naturally aligned foo can result into alignment traps + * use at own risk. + */ +#define CONTENTS(foo) (*(unsigned *) &(foo)) + +/* STRINGIFY -- perform all possible substitutions, then stringify */ +#define __STR(x) #x /* just a helper macro */ +#define STRINGIFY(x) __STR(x) + +/* + * Stack pointer must always be a multiple of 16 + */ +#define STACK_INCR 16 +#define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) + +#endif /* _ARCH_PPC_REG_HELP_H_ */ diff --git a/i386/include/assert.h b/i386/include/assert.h new file mode 100644 index 0000000..1bfea51 --- /dev/null +++ b/i386/include/assert.h @@ -0,0 +1,92 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)assert.h 8.2 (Berkeley) 1/21/94 + * $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $ + */ + +#include <sys/cdefs.h> +#ifdef __cplusplus +#include <stdlib.h> +#endif /* __cplusplus */ + +/* + * Unlike other ANSI header files, <assert.h> may usefully be included + * multiple times, with and without NDEBUG defined. + */ + +#undef assert +#undef __assert + +#ifdef NDEBUG +#define assert(e) ((void)0) +#else + +#ifndef __GNUC__ + +__BEGIN_DECLS +#ifndef __cplusplus +void abort(void) __dead2; +#endif /* !__cplusplus */ +int printf(const char * __restrict, ...); +__END_DECLS + +#define assert(e) \ + ((void) ((e) ? 0 : __assert (#e, __FILE__, __LINE__))) +#define __assert(e, file, line) \ + ((void)printf ("%s:%u: failed assertion `%s'\n", file, line, e), abort()) + +#else /* __GNUC__ */ + +__BEGIN_DECLS +void __assert_rtn(const char *, const char *, int, const char *) __dead2; +void __eprintf(const char *, const char *, unsigned, const char *) __dead2; +__END_DECLS + +#define __assert(e, file, line) \ + __eprintf ("%s:%u: failed assertion `%s'\n", file, line, e) + +#if __DARWIN_UNIX03 +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) +#else /* !__DARWIN_UNIX03 */ +#define assert(e) \ + (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0) +#endif /* __DARWIN_UNIX03 */ + +#endif /* __GNUC__ */ +#endif /* NDEBUG */ diff --git a/i386/include/ctype.h b/i386/include/ctype.h new file mode 100644 index 0000000..58dca3d --- /dev/null +++ b/i386/include/ctype.h @@ -0,0 +1,438 @@ +/* + * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ctype.h 8.4 (Berkeley) 1/21/94 + */ + +//Begin-Libc +//#include "xlocale_private.h" +//End-Libc +#ifndef _CTYPE_H_ +#define _CTYPE_H_ + +#include <runetype.h> + +#define _CTYPE_A 0x00000100L /* Alpha */ +#define _CTYPE_C 0x00000200L /* Control */ +#define _CTYPE_D 0x00000400L /* Digit */ +#define _CTYPE_G 0x00000800L /* Graph */ +#define _CTYPE_L 0x00001000L /* Lower */ +#define _CTYPE_P 0x00002000L /* Punct */ +#define _CTYPE_S 0x00004000L /* Space */ +#define _CTYPE_U 0x00008000L /* Upper */ +#define _CTYPE_X 0x00010000L /* X digit */ +#define _CTYPE_B 0x00020000L /* Blank */ +#define _CTYPE_R 0x00040000L /* Print */ +#define _CTYPE_I 0x00080000L /* Ideogram */ +#define _CTYPE_T 0x00100000L /* Special */ +#define _CTYPE_Q 0x00200000L /* Phonogram */ +#define _CTYPE_SW0 0x20000000L /* 0 width character */ +#define _CTYPE_SW1 0x40000000L /* 1 width character */ +#define _CTYPE_SW2 0x80000000L /* 2 width character */ +#define _CTYPE_SW3 0xc0000000L /* 3 width character */ +#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */ +#define _CTYPE_SWS 30 /* Bits to shift to get width */ + +#ifdef _NONSTD_SOURCE +/* + * Backward compatibility + */ +#define _A _CTYPE_A /* Alpha */ +#define _C _CTYPE_C /* Control */ +#define _D _CTYPE_D /* Digit */ +#define _G _CTYPE_G /* Graph */ +#define _L _CTYPE_L /* Lower */ +#define _P _CTYPE_P /* Punct */ +#define _S _CTYPE_S /* Space */ +#define _U _CTYPE_U /* Upper */ +#define _X _CTYPE_X /* X digit */ +#define _B _CTYPE_B /* Blank */ +#define _R _CTYPE_R /* Print */ +#define _I _CTYPE_I /* Ideogram */ +#define _T _CTYPE_T /* Special */ +#define _Q _CTYPE_Q /* Phonogram */ +#define _SW0 _CTYPE_SW0 /* 0 width character */ +#define _SW1 _CTYPE_SW1 /* 1 width character */ +#define _SW2 _CTYPE_SW2 /* 2 width character */ +#define _SW3 _CTYPE_SW3 /* 3 width character */ +#endif /* _NONSTD_SOURCE */ + +/* + * _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us + * to generate code for extern versions of all intermediate inline functions. + */ +#ifdef _EXTERNALIZE_CTYPE_INLINES_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_CTYPE_static_inline +#else /* !_EXTERNALIZE_CTYPE_INLINES_ */ +#define __DARWIN_CTYPE_static_inline static __inline +#endif /* !_EXTERNALIZE_CTYPE_INLINES_ */ + +/* + * _EXTERNALIZE_CTYPE_INLINES_TOP_ is defined in locale/isctype.c to tell us + * to generate code for extern versions of all top-level inline functions. + */ +#ifdef _EXTERNALIZE_CTYPE_INLINES_TOP_ +#define _USE_CTYPE_INLINE_ +#define __DARWIN_CTYPE_TOP_static_inline +#else /* !_EXTERNALIZE_CTYPE_INLINES_TOP_ */ +#define __DARWIN_CTYPE_TOP_static_inline static __inline +#endif /* _EXTERNALIZE_CTYPE_INLINES_TOP_ */ + +/* + * Use inline functions if we are allowed to and the compiler supports them. + */ +#if !defined(_DONT_USE_CTYPE_INLINE_) && \ + (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) + +/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */ +__BEGIN_DECLS +unsigned long ___runetype(__darwin_ct_rune_t); +__darwin_ct_rune_t ___tolower(__darwin_ct_rune_t); +__darwin_ct_rune_t ___toupper(__darwin_ct_rune_t); +__END_DECLS + +__DARWIN_CTYPE_TOP_static_inline int +isascii(int _c) +{ + return ((_c & ~0x7F) == 0); +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_static_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + return _DefaultRuneLocale.__runetype[_c & 0xff] & _f; +} +//Begin-Libc +#elif defined(__LIBC__) +__DARWIN_CTYPE_static_inline int +__maskrune(__darwin_ct_rune_t _c, unsigned long _f) +{ + return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__runetype[_c]) & _f; +} +//End-Libc +#else /* !USE_ASCII */ +__BEGIN_DECLS +int __maskrune(__darwin_ct_rune_t, unsigned long); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_static_inline int +__istype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f) + : !!__maskrune(_c, _f)); +#endif /* USE_ASCII */ +} + +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__isctype(__darwin_ct_rune_t _c, unsigned long _f) +{ +#ifdef USE_ASCII + return !!(__maskrune(_c, _f)); +#else /* USE_ASCII */ + return (_c < 0 || _c >= _CACHED_RUNES) ? 0 : + !!(_DefaultRuneLocale.__runetype[_c] & _f); +#endif /* USE_ASCII */ +} + +#ifdef USE_ASCII +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__mapupper[_c & 0xff]; +} + +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return _DefaultRuneLocale.__maplower[_c & 0xff]; +} +//Begin-Libc +#elif defined(__LIBC__) +/* + * We can't do what we do for __toupper_l() (check for ASCII first, then call + * ___toupper_l() otherwise) because versions of ___toupper() before Tiger + * assume c >= _CACHED_RUNES. So we are stuck making __toupper() a routine + * to hide the extended locale details, outside of Libc. + */ +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__toupper(__darwin_ct_rune_t _c) +{ + return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__mapupper[_c]; +} + +__DARWIN_CTYPE_static_inline __darwin_ct_rune_t +__tolower(__darwin_ct_rune_t _c) +{ + return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) : + __current_locale()->__lc_ctype->_CurrentRuneLocale.__maplower[_c]; +} +//End-Libc +#else /* !USE_ASCII */ +__BEGIN_DECLS +__darwin_ct_rune_t __toupper(__darwin_ct_rune_t); +__darwin_ct_rune_t __tolower(__darwin_ct_rune_t); +__END_DECLS +#endif /* USE_ASCII */ + +__DARWIN_CTYPE_static_inline int +__wcwidth(__darwin_ct_rune_t _c) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} + +#ifndef _EXTERNALIZE_CTYPE_INLINES_ + +#define _tolower(c) __tolower(c) +#define _toupper(c) __toupper(c) + +__DARWIN_CTYPE_TOP_static_inline int +isalnum(int _c) +{ + return (__istype(_c, _CTYPE_A|_CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isalpha(int _c) +{ + return (__istype(_c, _CTYPE_A)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isblank(int _c) +{ + return (__istype(_c, _CTYPE_B)); +} + +__DARWIN_CTYPE_TOP_static_inline int +iscntrl(int _c) +{ + return (__istype(_c, _CTYPE_C)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_static_inline int +isdigit(int _c) +{ + return (__isctype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isgraph(int _c) +{ + return (__istype(_c, _CTYPE_G)); +} + +__DARWIN_CTYPE_TOP_static_inline int +islower(int _c) +{ + return (__istype(_c, _CTYPE_L)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isprint(int _c) +{ + return (__istype(_c, _CTYPE_R)); +} + +__DARWIN_CTYPE_TOP_static_inline int +ispunct(int _c) +{ + return (__istype(_c, _CTYPE_P)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isspace(int _c) +{ + return (__istype(_c, _CTYPE_S)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isupper(int _c) +{ + return (__istype(_c, _CTYPE_U)); +} + +/* ANSI -- locale independent */ +__DARWIN_CTYPE_TOP_static_inline int +isxdigit(int _c) +{ + return (__isctype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_static_inline int +toascii(int _c) +{ + return (_c & 0x7F); +} + +__DARWIN_CTYPE_TOP_static_inline int +tolower(int _c) +{ + return (__tolower(_c)); +} + +__DARWIN_CTYPE_TOP_static_inline int +toupper(int _c) +{ + return (__toupper(_c)); +} + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +__DARWIN_CTYPE_TOP_static_inline int +digittoint(int _c) +{ + return (__maskrune(_c, 0x0F)); +} + +__DARWIN_CTYPE_TOP_static_inline int +ishexnumber(int _c) +{ + return (__istype(_c, _CTYPE_X)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isideogram(int _c) +{ + return (__istype(_c, _CTYPE_I)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isnumber(int _c) +{ + return (__istype(_c, _CTYPE_D)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isphonogram(int _c) +{ + return (__istype(_c, _CTYPE_Q)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isrune(int _c) +{ + return (__istype(_c, 0xFFFFFFF0L)); +} + +__DARWIN_CTYPE_TOP_static_inline int +isspecial(int _c) +{ + return (__istype(_c, _CTYPE_T)); +} +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* _EXTERNALIZE_CTYPE_INLINES_ */ + +#else /* not using inlines */ + +__BEGIN_DECLS +int isalnum(int); +int isalpha(int); +int isblank(int); +int iscntrl(int); +int isdigit(int); +int isgraph(int); +int islower(int); +int isprint(int); +int ispunct(int); +int isspace(int); +int isupper(int); +int isxdigit(int); +int tolower(int); +int toupper(int); +int isascii(int); +int toascii(int); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int _tolower(int); +int _toupper(int); +int digittoint(int); +int ishexnumber(int); +int isideogram(int); +int isnumber(int); +int isphonogram(int); +int isrune(int); +int isspecial(int); +#endif +__END_DECLS + +#endif /* using inlines */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include <xlocale/_ctype.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_CTYPE_H_ */ diff --git a/i386/include/device/.svn/all-wcprops b/i386/include/device/.svn/all-wcprops new file mode 100644 index 0000000..53ae8e5 --- /dev/null +++ b/i386/include/device/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/device +END +device_port.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/device/device_port.h +END +device_types.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/device/device_types.h +END diff --git a/i386/include/device/.svn/entries b/i386/include/device/.svn/entries new file mode 100644 index 0000000..423da67 --- /dev/null +++ b/i386/include/device/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/device +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +device_port.h +file + + + + +2013-08-27T23:54:36.000000Z +a32061f0b361911908c8f1a738ad6fbd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2936 + +device_types.h +file + + + + +2013-08-27T23:54:36.000000Z +3002c6d1dc242f177c4ae99fb073e186 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4507 + diff --git a/i386/include/device/.svn/text-base/device_port.h.svn-base b/i386/include/device/.svn/text-base/device_port.h.svn-base new file mode 100644 index 0000000..8948ed5 --- /dev/null +++ b/i386/include/device/.svn/text-base/device_port.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Author: David B. Golub, Carnegie Mellon University + * Date: 8/89 + */ + +#ifndef _DEVICE_DEVICE_PORT_H_ +#define _DEVICE_DEVICE_PORT_H_ + +#include <device/device_types.h> + +/* + * Master privileged I/O object for this host + */ +extern mach_port_t master_device_port; + +#define DEVICE_PAGER_GUARDED 0x1 +#define DEVICE_PAGER_COHERENT 0x2 +#define DEVICE_PAGER_CACHE_INHIB 0x4 +#define DEVICE_PAGER_WRITE_THROUGH 0x8 +#define DEVICE_PAGER_CONTIGUOUS 0x100 +#define DEVICE_PAGER_NOPHYSCACHE 0x200 + +#endif /* _DEVICE_DEVICE_PORT_H_ */ diff --git a/i386/include/device/.svn/text-base/device_types.h.svn-base b/i386/include/device/.svn/text-base/device_types.h.svn-base new file mode 100644 index 0000000..f71249e --- /dev/null +++ b/i386/include/device/.svn/text-base/device_types.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Author: David B. Golub, Carnegie Mellon University + * Date: 3/89 + */ + +#ifndef DEVICE_TYPES_H +#define DEVICE_TYPES_H + +/* + * Types for device interface. + */ +#include <mach/std_types.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/port.h> + +/* + * IO buffer - out-of-line array of characters. + */ +typedef char * io_buf_ptr_t; + +/* + * Some types for IOKit. + */ + +#ifdef IOKIT + +/* must match device_types.defs */ +typedef char io_name_t[128]; +typedef char io_string_t[512]; +typedef char io_struct_inband_t[4096]; + +#if KERNEL +typedef uint64_t io_user_scalar_t; +typedef uint64_t io_user_reference_t; +typedef int io_scalar_inband_t[16]; +// must be the same type as OSAsyncReference +typedef natural_t io_async_ref_t[8]; +typedef io_user_scalar_t io_scalar_inband64_t[16]; +typedef io_user_reference_t io_async_ref64_t[8]; +#elif __LP64__ +typedef uint64_t io_user_scalar_t; +typedef uint64_t io_user_reference_t; +typedef io_user_scalar_t io_scalar_inband_t[16]; +typedef io_user_reference_t io_async_ref_t[8]; +typedef io_user_scalar_t io_scalar_inband64_t[16]; +typedef io_user_reference_t io_async_ref64_t[8]; +#else +typedef int io_user_scalar_t; +typedef natural_t io_user_reference_t; +typedef io_user_scalar_t io_scalar_inband_t[16]; +typedef io_user_reference_t io_async_ref_t[8]; +typedef uint64_t io_scalar_inband64_t[16]; +typedef uint64_t io_async_ref64_t[8]; +#endif // __LP64__ + +#ifdef MACH_KERNEL + +typedef struct IOObject * io_object_t; +typedef io_object_t io_connect_t; + +extern void iokit_remove_reference( io_object_t obj ); + +extern io_object_t iokit_lookup_object_port( ipc_port_t port ); +extern io_connect_t iokit_lookup_connect_port( ipc_port_t port ); + +extern ipc_port_t iokit_make_object_port( io_object_t obj ); +extern ipc_port_t iokit_make_connect_port( io_connect_t obj ); + +extern boolean_t iokit_notify( mach_msg_header_t *msg ); + +#else + +#ifndef __IOKIT_PORTS_DEFINED__ +#define __IOKIT_PORTS_DEFINED__ +typedef mach_port_t io_object_t; +#endif /* __IOKIT_PORTS_DEFINED__ */ + +#endif /* MACH_KERNEL */ + +#endif /* IOKIT */ + +#endif /* DEVICE_TYPES_H */ + diff --git a/i386/include/device/device_port.h b/i386/include/device/device_port.h new file mode 100644 index 0000000..8948ed5 --- /dev/null +++ b/i386/include/device/device_port.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Author: David B. Golub, Carnegie Mellon University + * Date: 8/89 + */ + +#ifndef _DEVICE_DEVICE_PORT_H_ +#define _DEVICE_DEVICE_PORT_H_ + +#include <device/device_types.h> + +/* + * Master privileged I/O object for this host + */ +extern mach_port_t master_device_port; + +#define DEVICE_PAGER_GUARDED 0x1 +#define DEVICE_PAGER_COHERENT 0x2 +#define DEVICE_PAGER_CACHE_INHIB 0x4 +#define DEVICE_PAGER_WRITE_THROUGH 0x8 +#define DEVICE_PAGER_CONTIGUOUS 0x100 +#define DEVICE_PAGER_NOPHYSCACHE 0x200 + +#endif /* _DEVICE_DEVICE_PORT_H_ */ diff --git a/i386/include/device/device_types.h b/i386/include/device/device_types.h new file mode 100644 index 0000000..f71249e --- /dev/null +++ b/i386/include/device/device_types.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Author: David B. Golub, Carnegie Mellon University + * Date: 3/89 + */ + +#ifndef DEVICE_TYPES_H +#define DEVICE_TYPES_H + +/* + * Types for device interface. + */ +#include <mach/std_types.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/port.h> + +/* + * IO buffer - out-of-line array of characters. + */ +typedef char * io_buf_ptr_t; + +/* + * Some types for IOKit. + */ + +#ifdef IOKIT + +/* must match device_types.defs */ +typedef char io_name_t[128]; +typedef char io_string_t[512]; +typedef char io_struct_inband_t[4096]; + +#if KERNEL +typedef uint64_t io_user_scalar_t; +typedef uint64_t io_user_reference_t; +typedef int io_scalar_inband_t[16]; +// must be the same type as OSAsyncReference +typedef natural_t io_async_ref_t[8]; +typedef io_user_scalar_t io_scalar_inband64_t[16]; +typedef io_user_reference_t io_async_ref64_t[8]; +#elif __LP64__ +typedef uint64_t io_user_scalar_t; +typedef uint64_t io_user_reference_t; +typedef io_user_scalar_t io_scalar_inband_t[16]; +typedef io_user_reference_t io_async_ref_t[8]; +typedef io_user_scalar_t io_scalar_inband64_t[16]; +typedef io_user_reference_t io_async_ref64_t[8]; +#else +typedef int io_user_scalar_t; +typedef natural_t io_user_reference_t; +typedef io_user_scalar_t io_scalar_inband_t[16]; +typedef io_user_reference_t io_async_ref_t[8]; +typedef uint64_t io_scalar_inband64_t[16]; +typedef uint64_t io_async_ref64_t[8]; +#endif // __LP64__ + +#ifdef MACH_KERNEL + +typedef struct IOObject * io_object_t; +typedef io_object_t io_connect_t; + +extern void iokit_remove_reference( io_object_t obj ); + +extern io_object_t iokit_lookup_object_port( ipc_port_t port ); +extern io_connect_t iokit_lookup_connect_port( ipc_port_t port ); + +extern ipc_port_t iokit_make_object_port( io_object_t obj ); +extern ipc_port_t iokit_make_connect_port( io_connect_t obj ); + +extern boolean_t iokit_notify( mach_msg_header_t *msg ); + +#else + +#ifndef __IOKIT_PORTS_DEFINED__ +#define __IOKIT_PORTS_DEFINED__ +typedef mach_port_t io_object_t; +#endif /* __IOKIT_PORTS_DEFINED__ */ + +#endif /* MACH_KERNEL */ + +#endif /* IOKIT */ + +#endif /* DEVICE_TYPES_H */ + diff --git a/i386/include/errno.h b/i386/include/errno.h new file mode 100644 index 0000000..9879cc4 --- /dev/null +++ b/i386/include/errno.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <sys/errno.h> + diff --git a/i386/include/float.h b/i386/include/float.h new file mode 100644 index 0000000..84fd005 --- /dev/null +++ b/i386/include/float.h @@ -0,0 +1,281 @@ +/* This file exists soley to keep Metrowerks' compilers happy. The version + used by GCC can be found in /usr/lib/gcc, although it's + not very informative. */ + +#ifndef _FLOAT_H_ + +#if defined(__GNUC__) +#include_next <float.h> + +#elif defined(__MWERKS__) +#define _FLOAT_H_ + +/* APPLE LOCAL begin MW compatibility */ +/* Define various characteristics of floating-point types, if needed. */ +#ifndef __FLT_RADIX__ +#define __FLT_RADIX__ 2 +#endif +#ifndef __FLT_MANT_DIG__ +#define __FLT_MANT_DIG__ 24 +#endif +#ifndef __FLT_DIG__ +#define __FLT_DIG__ 6 +#endif +#ifndef __FLT_EPSILON__ +#define __FLT_EPSILON__ 1.19209290e-07F +#endif +#ifndef __FLT_MIN__ +#define __FLT_MIN__ 1.17549435e-38F +#endif +#ifndef __FLT_MAX__ +#define __FLT_MAX__ 3.40282347e+38F +#endif +#ifndef __FLT_MIN_EXP__ +#define __FLT_MIN_EXP__ (-125) +#endif +#ifndef __FLT_MIN_10_EXP__ +#define __FLT_MIN_10_EXP__ (-37) +#endif +#ifndef __FLT_MAX_EXP__ +#define __FLT_MAX_EXP__ 128 +#endif +#ifndef __FLT_MAX_10_EXP__ +#define __FLT_MAX_10_EXP__ 38 +#endif +#ifndef __DBL_MANT_DIG__ +#define __DBL_MANT_DIG__ 53 +#endif +#ifndef __DBL_DIG__ +#define __DBL_DIG__ 15 +#endif +#ifndef __DBL_EPSILON__ +#define __DBL_EPSILON__ 2.2204460492503131e-16 +#endif +#ifndef __DBL_MIN__ +#define __DBL_MIN__ 2.2250738585072014e-308 +#endif +#ifndef __DBL_MAX__ +#define __DBL_MAX__ 1.7976931348623157e+308 +#endif +#ifndef __DBL_MIN_EXP__ +#define __DBL_MIN_EXP__ (-1021) +#endif +#ifndef __DBL_MIN_10_EXP__ +#define __DBL_MIN_10_EXP__ (-307) +#endif +#ifndef __DBL_MAX_EXP__ +#define __DBL_MAX_EXP__ 1024 +#endif +#ifndef __DBL_MAX_10_EXP__ +#define __DBL_MAX_10_EXP__ 308 +#endif +#ifndef __LDBL_MANT_DIG__ +#define __LDBL_MANT_DIG__ 53 +#endif +#ifndef __LDBL_DIG__ +#define __LDBL_DIG__ 15 +#endif +#ifndef __LDBL_EPSILON__ +#define __LDBL_EPSILON__ 2.2204460492503131e-16 +#endif +#ifndef __LDBL_MIN__ +#define __LDBL_MIN__ 2.2250738585072014e-308 +#endif +#ifndef __LDBL_MAX__ +#define __LDBL_MAX__ 1.7976931348623157e+308 +#endif +#ifndef __LDBL_MIN_EXP__ +#define __LDBL_MIN_EXP__ (-1021) +#endif +#ifndef __LDBL_MIN_10_EXP__ +#define __LDBL_MIN_10_EXP__ (-307) +#endif +#ifndef __LDBL_MAX_EXP__ +#define __LDBL_MAX_EXP__ 1024 +#endif +#ifndef __LDBL_MAX_10_EXP__ +#define __LDBL_MAX_10_EXP__ 308 +#endif +/* APPLE LOCAl end MW compatibility */ + +/* Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* + * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h> + */ + + +/* Radix of exponent representation, b. */ +#undef FLT_RADIX +#define FLT_RADIX __FLT_RADIX__ + +/* Number of base-FLT_RADIX digits in the significand, p. */ +#undef FLT_MANT_DIG +#undef DBL_MANT_DIG +#undef LDBL_MANT_DIG +#define FLT_MANT_DIG __FLT_MANT_DIG__ +#define DBL_MANT_DIG __DBL_MANT_DIG__ +#define LDBL_MANT_DIG __LDBL_MANT_DIG__ + +/* Number of decimal digits, q, such that any floating-point number with q + decimal digits can be rounded into a floating-point number with p radix b + digits and back again without change to the q decimal digits, + + p * log10(b) if b is a power of 10 + floor((p - 1) * log10(b)) otherwise +*/ +#undef FLT_DIG +#undef DBL_DIG +#undef LDBL_DIG +#define FLT_DIG __FLT_DIG__ +#define DBL_DIG __DBL_DIG__ +#define LDBL_DIG __LDBL_DIG__ + +/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ +#undef FLT_MIN_EXP +#undef DBL_MIN_EXP +#undef LDBL_MIN_EXP +#define FLT_MIN_EXP __FLT_MIN_EXP__ +#define DBL_MIN_EXP __DBL_MIN_EXP__ +#define LDBL_MIN_EXP __LDBL_MIN_EXP__ + +/* Minimum negative integer such that 10 raised to that power is in the + range of normalized floating-point numbers, + + ceil(log10(b) * (emin - 1)) +*/ +#undef FLT_MIN_10_EXP +#undef DBL_MIN_10_EXP +#undef LDBL_MIN_10_EXP +#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ +#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ +#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ + +/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ +#undef FLT_MAX_EXP +#undef DBL_MAX_EXP +#undef LDBL_MAX_EXP +#define FLT_MAX_EXP __FLT_MAX_EXP__ +#define DBL_MAX_EXP __DBL_MAX_EXP__ +#define LDBL_MAX_EXP __LDBL_MAX_EXP__ + +/* Maximum integer such that 10 raised to that power is in the range of + representable finite floating-point numbers, + + floor(log10((1 - b**-p) * b**emax)) +*/ +#undef FLT_MAX_10_EXP +#undef DBL_MAX_10_EXP +#undef LDBL_MAX_10_EXP +#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ +#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ +#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ + +/* Maximum representable finite floating-point number, + + (1 - b**-p) * b**emax +*/ +#undef FLT_MAX +#undef DBL_MAX +#undef LDBL_MAX +#define FLT_MAX __FLT_MAX__ +#define DBL_MAX __DBL_MAX__ +#define LDBL_MAX __LDBL_MAX__ + +/* The difference between 1 and the least value greater than 1 that is + representable in the given floating point type, b**1-p. */ +#undef FLT_EPSILON +#undef DBL_EPSILON +#undef LDBL_EPSILON +#define FLT_EPSILON __FLT_EPSILON__ +#define DBL_EPSILON __DBL_EPSILON__ +#define LDBL_EPSILON __LDBL_EPSILON__ + +/* Minimum normalized positive floating-point number, b**(emin - 1). */ +#undef FLT_MIN +#undef DBL_MIN +#undef LDBL_MIN +#define FLT_MIN __FLT_MIN__ +#define DBL_MIN __DBL_MIN__ +#define LDBL_MIN __LDBL_MIN__ + +/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ +/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */ +#undef FLT_ROUNDS +#define FLT_ROUNDS 1 + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* The floating-point expression evaluation method. + -1 indeterminate + 0 evaluate all operations and constants just to the range and + precision of the type + 1 evaluate operations and constants of type float and double + to the range and precision of the double type, evaluate + long double operations and constants to the range and + precision of the long double type + 2 evaluate all operations and constants to the range and + precision of the long double type + + ??? This ought to change with the setting of the fp control word; + the value provided by the compiler assumes the widest setting. */ +#undef FLT_EVAL_METHOD +#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ + +/* Number of decimal digits, n, such that any floating-point number in the + widest supported floating type with pmax radix b digits can be rounded + to a floating-point number with n decimal digits and back again without + change to the value, + + pmax * log10(b) if b is a power of 10 + ceil(1 + pmax * log10(b)) otherwise +*/ +#undef DECIMAL_DIG +#define DECIMAL_DIG __DECIMAL_DIG__ + +#endif /* C99 */ + +#ifdef __cplusplus +extern "C" { +#endif +extern int __fegetfltrounds( void ); +#ifdef __cplusplus +} +#endif +#undef FLT_ROUNDS +#define FLT_ROUNDS (__fegetfltrounds ()) +/* End of GNU CC file */ + +/* APPLE LOCAL begin CW compatibility */ +/* CodeWarrior defines the following on its own. */ +#undef DECIMAL_DIG +/* APPLE LOCAL end CW compatibility */ + +#else +#error This file is only for Metrowerks compatibilty. +#endif + +#endif /* _FLOAT_H_ */ diff --git a/i386/include/hfs/.svn/all-wcprops b/i386/include/hfs/.svn/all-wcprops new file mode 100644 index 0000000..1dd253f --- /dev/null +++ b/i386/include/hfs/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/hfs +END +hfs_encodings.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/hfs/hfs_encodings.h +END +hfs_mount.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/hfs/hfs_mount.h +END +hfs_format.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/hfs/hfs_format.h +END diff --git a/i386/include/hfs/.svn/entries b/i386/include/hfs/.svn/entries new file mode 100644 index 0000000..2dc63a7 --- /dev/null +++ b/i386/include/hfs/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/hfs +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +hfs_encodings.h +file + + + + +2013-08-27T23:54:33.000000Z +4c4970818fa05eaf0ae307f0c6b7a918 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2443 + +hfs_mount.h +file + + + + +2013-08-27T23:54:33.000000Z +f92cdd0f73dfd5d508e4a79eba156c16 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3204 + +hfs_format.h +file + + + + +2013-08-27T23:54:33.000000Z +9ff7f052f524fb65a973f2b1e0865def +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +30977 + diff --git a/i386/include/hfs/.svn/text-base/hfs_encodings.h.svn-base b/i386/include/hfs/.svn/text-base/hfs_encodings.h.svn-base new file mode 100644 index 0000000..8d9dc4b --- /dev/null +++ b/i386/include/hfs/.svn/text-base/hfs_encodings.h.svn-base @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2000-2002, 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-2000 Apple Computer, Inc. All Rights Reserved + */ + +#ifndef _HFS_ENCODINGS_H_ +#define _HFS_ENCODINGS_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_UNSTABLE + +#define CTL_HFS_NAMES { \ + { 0, 0 }, \ + { "encodingbias", CTLTYPE_INT }, \ +} + +/* + * HFS Filename Encoding Converters Interface + * + * Private Interface for adding hfs filename + * encoding converters. These are not needed + * for HFS Plus volumes (since they already + * have Unicode filenames). + * + * Used by HFS Encoding Converter Kernel Modules + * (like HFS_Japanese.kmod) to register their + * encoding conversion routines. + */ + +typedef int (* hfs_to_unicode_func_t)(const Str31 hfs_str, UniChar *uni_str, + u_int32_t maxCharLen, u_int32_t *usedCharLen); + +typedef int (* unicode_to_hfs_func_t)(UniChar *uni_str, u_int32_t unicodeChars, + Str31 hfs_str); + + +int hfs_addconverter(int kmod_id, u_int32_t encoding, + hfs_to_unicode_func_t get_unicode, + unicode_to_hfs_func_t get_hfsname); + +int hfs_remconverter(int kmod_id, u_int32_t encoding); + +#endif /* __APPLE_API_UNSTABLE */ + +#endif /* ! _HFS_ENCODINGS_H_ */ diff --git a/i386/include/hfs/.svn/text-base/hfs_format.h.svn-base b/i386/include/hfs/.svn/text-base/hfs_format.h.svn-base new file mode 100644 index 0000000..224d2e2 --- /dev/null +++ b/i386/include/hfs/.svn/text-base/hfs_format.h.svn-base @@ -0,0 +1,785 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __HFS_FORMAT__ +#define __HFS_FORMAT__ + +#include <sys/types.h> + +/* + * hfs_format.c + * + * This file describes the on-disk format for HFS and HFS Plus volumes. + * The HFS Plus volume format is desciibed in detail in Apple Technote 1150. + * + * http://developer.apple.com/technotes/tn/tn1150.html + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* some on-disk hfs structures have 68K alignment (misaligned) */ + +/* Signatures used to differentiate between HFS and HFS Plus volumes */ +enum { + kHFSSigWord = 0x4244, /* 'BD' in ASCII */ + kHFSPlusSigWord = 0x482B, /* 'H+' in ASCII */ + kHFSXSigWord = 0x4858, /* 'HX' in ASCII */ + + kHFSPlusVersion = 0x0004, /* 'H+' volumes are version 4 only */ + kHFSXVersion = 0x0005, /* 'HX' volumes start with version 5 */ + + kHFSPlusMountVersion = 0x31302E30, /* '10.0' for Mac OS X */ + kHFSJMountVersion = 0x4846534a, /* 'HFSJ' for journaled HFS+ on OS X */ + kFSKMountVersion = 0x46534b21 /* 'FSK!' for failed journal replay */ +}; + + +/* + * Mac OS X has two special directories on HFS+ volumes for hardlinked files + * and hardlinked directories as well as for open-unlinked files. + * + * These directories and their contents are not exported from the filesystem + * under Mac OS X. + */ +#define HFSPLUSMETADATAFOLDER "\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80HFS+ Private Data" +#define HFSPLUS_DIR_METADATA_FOLDER ".HFS+ Private Directory Data\xd" + +/* + * Files in the "HFS+ Private Data" folder have one of the following prefixes + * followed by a decimal number (no leading zeros) for the file ID. + * + * Note: Earlier version of Mac OS X used a 32 bit random number for the link + * ref number instead of the file id. + * + * e.g. iNode7182000 and temp3296 + */ +#define HFS_INODE_PREFIX "iNode" +#define HFS_DELETE_PREFIX "temp" + +/* + * Files in the ".HFS+ Private Directory Data" folder have the following + * prefix followed by a decimal number (no leading zeros) for the file ID. + * + * e.g. dir_555 + */ +#define HFS_DIRINODE_PREFIX "dir_" + +/* + * Hardlink inodes save the head of the link chain in + * an extended attribute named FIRST_LINK_XATTR_NAME. + * The attribute data is the decimal value in ASCII + * of the cnid for the first link in the chain. + * + * This extended attribute is private (i.e. its not + * exported in the getxattr/listxattr POSIX APIs). + */ +#define FIRST_LINK_XATTR_NAME "com.apple.system.hfs.firstlink" +#define FIRST_LINK_XATTR_REC_SIZE (sizeof(HFSPlusAttrData) - 2 + 12) + +/* + * The name space ID for generating an HFS volume UUID + * + * B3E20F39-F292-11D6-97A4-00306543ECAC + */ +#define HFS_UUID_NAMESPACE_ID "\xB3\xE2\x0F\x39\xF2\x92\x11\xD6\x97\xA4\x00\x30\x65\x43\xEC\xAC" + +/* + * Indirect link files (hard links) have the following type/creator. + */ +enum { + kHardLinkFileType = 0x686C6E6B, /* 'hlnk' */ + kHFSPlusCreator = 0x6866732B /* 'hfs+' */ +}; + + +/* + * File type and creator for symbolic links + */ +enum { + kSymLinkFileType = 0x736C6E6B, /* 'slnk' */ + kSymLinkCreator = 0x72686170 /* 'rhap' */ +}; + + +#ifndef _HFSUNISTR255_DEFINED_ +#define _HFSUNISTR255_DEFINED_ +/* Unicode strings are used for HFS Plus file and folder names */ +struct HFSUniStr255 { + u_int16_t length; /* number of unicode characters */ + u_int16_t unicode[255]; /* unicode characters */ +} __attribute__((aligned(2), packed)); +typedef struct HFSUniStr255 HFSUniStr255; +typedef const HFSUniStr255 *ConstHFSUniStr255Param; +#endif /* _HFSUNISTR255_DEFINED_ */ + +enum { + kHFSMaxVolumeNameChars = 27, + kHFSMaxFileNameChars = 31, + kHFSPlusMaxFileNameChars = 255 +}; + + +/* Extent overflow file data structures */ + +/* HFS Extent key */ +struct HFSExtentKey { + u_int8_t keyLength; /* length of key, excluding this field */ + u_int8_t forkType; /* 0 = data fork, FF = resource fork */ + u_int32_t fileID; /* file ID */ + u_int16_t startBlock; /* first file allocation block number in this extent */ +} __attribute__((aligned(2), packed)); +typedef struct HFSExtentKey HFSExtentKey; + +/* HFS Plus Extent key */ +struct HFSPlusExtentKey { + u_int16_t keyLength; /* length of key, excluding this field */ + u_int8_t forkType; /* 0 = data fork, FF = resource fork */ + u_int8_t pad; /* make the other fields align on 32-bit boundary */ + u_int32_t fileID; /* file ID */ + u_int32_t startBlock; /* first file allocation block number in this extent */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusExtentKey HFSPlusExtentKey; + +/* Number of extent descriptors per extent record */ +enum { + kHFSExtentDensity = 3, + kHFSPlusExtentDensity = 8 +}; + +/* HFS extent descriptor */ +struct HFSExtentDescriptor { + u_int16_t startBlock; /* first allocation block */ + u_int16_t blockCount; /* number of allocation blocks */ +} __attribute__((aligned(2), packed)); +typedef struct HFSExtentDescriptor HFSExtentDescriptor; + +/* HFS Plus extent descriptor */ +struct HFSPlusExtentDescriptor { + u_int32_t startBlock; /* first allocation block */ + u_int32_t blockCount; /* number of allocation blocks */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor; + +/* HFS extent record */ +typedef HFSExtentDescriptor HFSExtentRecord[3]; + +/* HFS Plus extent record */ +typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; + + +/* Finder information */ +struct FndrFileInfo { + u_int32_t fdType; /* file type */ + u_int32_t fdCreator; /* file creator */ + u_int16_t fdFlags; /* Finder flags */ + struct { + int16_t v; /* file's location */ + int16_t h; + } fdLocation; + int16_t opaque; +} __attribute__((aligned(2), packed)); +typedef struct FndrFileInfo FndrFileInfo; + +struct FndrDirInfo { + struct { /* folder's window rectangle */ + int16_t top; + int16_t left; + int16_t bottom; + int16_t right; + } frRect; + unsigned short frFlags; /* Finder flags */ + struct { + u_int16_t v; /* folder's location */ + u_int16_t h; + } frLocation; + int16_t opaque; +} __attribute__((aligned(2), packed)); +typedef struct FndrDirInfo FndrDirInfo; + +struct FndrOpaqueInfo { + int8_t opaque[16]; +} __attribute__((aligned(2), packed)); +typedef struct FndrOpaqueInfo FndrOpaqueInfo; + + +/* HFS Plus Fork data info - 80 bytes */ +struct HFSPlusForkData { + u_int64_t logicalSize; /* fork's logical size in bytes */ + u_int32_t clumpSize; /* fork's clump size in bytes */ + u_int32_t totalBlocks; /* total blocks used by this fork */ + HFSPlusExtentRecord extents; /* initial set of extents */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusForkData HFSPlusForkData; + + +/* Mac OS X has 16 bytes worth of "BSD" info. + * + * Note: Mac OS 9 implementations and applications + * should preserve, but not change, this information. + */ +struct HFSPlusBSDInfo { + u_int32_t ownerID; /* user-id of owner or hard link chain previous link */ + u_int32_t groupID; /* group-id of owner or hard link chain next link */ + u_int8_t adminFlags; /* super-user changeable flags */ + u_int8_t ownerFlags; /* owner changeable flags */ + u_int16_t fileMode; /* file type and permission bits */ + union { + u_int32_t iNodeNum; /* indirect node number (hard links only) */ + u_int32_t linkCount; /* links that refer to this indirect node */ + u_int32_t rawDevice; /* special file device (FBLK and FCHR only) */ + } special; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusBSDInfo HFSPlusBSDInfo; + +/* + * Hardlink "links" resolve to an inode + * and the actual uid/gid comes from that + * inode. + * + * We repurpose the links's uid/gid fields + * for the hardlink link chain. The chain + * consists of a doubly linked list of file + * ids. + */ + +#define hl_firstLinkID reserved1 /* Valid only if HasLinkChain flag is set (indirect nodes only) */ + +#define hl_prevLinkID bsdInfo.ownerID /* Valid only if HasLinkChain flag is set */ +#define hl_nextLinkID bsdInfo.groupID /* Valid only if HasLinkChain flag is set */ + +#define hl_linkReference bsdInfo.special.iNodeNum +#define hl_linkCount bsdInfo.special.linkCount + + +/* Catalog file data structures */ + +enum { + kHFSRootParentID = 1, /* Parent ID of the root folder */ + kHFSRootFolderID = 2, /* Folder ID of the root folder */ + kHFSExtentsFileID = 3, /* File ID of the extents file */ + kHFSCatalogFileID = 4, /* File ID of the catalog file */ + kHFSBadBlockFileID = 5, /* File ID of the bad allocation block file */ + kHFSAllocationFileID = 6, /* File ID of the allocation file (HFS Plus only) */ + kHFSStartupFileID = 7, /* File ID of the startup file (HFS Plus only) */ + kHFSAttributesFileID = 8, /* File ID of the attribute file (HFS Plus only) */ + kHFSAttributeDataFileID = 13, /* Used in Mac OS X runtime for extent based attributes */ + /* kHFSAttributeDataFileID is never stored on disk. */ + kHFSRepairCatalogFileID = 14, /* Used when rebuilding Catalog B-tree */ + kHFSBogusExtentFileID = 15, /* Used for exchanging extents in extents file */ + kHFSFirstUserCatalogNodeID = 16 +}; + +/* HFS catalog key */ +struct HFSCatalogKey { + u_int8_t keyLength; /* key length (in bytes) */ + u_int8_t reserved; /* reserved (set to zero) */ + u_int32_t parentID; /* parent folder ID */ + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; /* catalog node name */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogKey HFSCatalogKey; + +/* HFS Plus catalog key */ +struct HFSPlusCatalogKey { + u_int16_t keyLength; /* key length (in bytes) */ + u_int32_t parentID; /* parent folder ID */ + HFSUniStr255 nodeName; /* catalog node name */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogKey HFSPlusCatalogKey; + +/* Catalog record types */ +enum { + /* HFS Catalog Records */ + kHFSFolderRecord = 0x0100, /* Folder record */ + kHFSFileRecord = 0x0200, /* File record */ + kHFSFolderThreadRecord = 0x0300, /* Folder thread record */ + kHFSFileThreadRecord = 0x0400, /* File thread record */ + + /* HFS Plus Catalog Records */ + kHFSPlusFolderRecord = 1, /* Folder record */ + kHFSPlusFileRecord = 2, /* File record */ + kHFSPlusFolderThreadRecord = 3, /* Folder thread record */ + kHFSPlusFileThreadRecord = 4 /* File thread record */ +}; + + +/* Catalog file record flags */ +enum { + kHFSFileLockedBit = 0x0000, /* file is locked and cannot be written to */ + kHFSFileLockedMask = 0x0001, + + kHFSThreadExistsBit = 0x0001, /* a file thread record exists for this file */ + kHFSThreadExistsMask = 0x0002, + + kHFSHasAttributesBit = 0x0002, /* object has extended attributes */ + kHFSHasAttributesMask = 0x0004, + + kHFSHasSecurityBit = 0x0003, /* object has security data (ACLs) */ + kHFSHasSecurityMask = 0x0008, + + kHFSHasFolderCountBit = 0x0004, /* only for HFSX, folder maintains a separate sub-folder count */ + kHFSHasFolderCountMask = 0x0010, /* (sum of folder records and directory hard links) */ + + kHFSHasLinkChainBit = 0x0005, /* has hardlink chain (inode or link) */ + kHFSHasLinkChainMask = 0x0020, + + kHFSHasChildLinkBit = 0x0006, /* folder has a child that's a dir link */ + kHFSHasChildLinkMask = 0x0040 +}; + + +/* HFS catalog folder record - 70 bytes */ +struct HFSCatalogFolder { + int16_t recordType; /* == kHFSFolderRecord */ + u_int16_t flags; /* folder flags */ + u_int16_t valence; /* folder valence */ + u_int32_t folderID; /* folder ID */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t modifyDate; /* date and time of last modification */ + u_int32_t backupDate; /* date and time of last backup */ + FndrDirInfo userInfo; /* Finder information */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int32_t reserved[4]; /* reserved - initialized as zero */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogFolder HFSCatalogFolder; + +/* HFS Plus catalog folder record - 88 bytes */ +struct HFSPlusCatalogFolder { + int16_t recordType; /* == kHFSPlusFolderRecord */ + u_int16_t flags; /* file flags */ + u_int32_t valence; /* folder's item count */ + u_int32_t folderID; /* folder ID */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t contentModDate; /* date and time of last content modification */ + u_int32_t attributeModDate; /* date and time of last attribute modification */ + u_int32_t accessDate; /* date and time of last access (MacOS X only) */ + u_int32_t backupDate; /* date and time of last backup */ + HFSPlusBSDInfo bsdInfo; /* permissions (for MacOS X) */ + FndrDirInfo userInfo; /* Finder information */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int32_t textEncoding; /* hint for name conversions */ + u_int32_t folderCount; /* number of enclosed folders, active when HasFolderCount is set */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder; + +/* HFS catalog file record - 102 bytes */ +struct HFSCatalogFile { + int16_t recordType; /* == kHFSFileRecord */ + u_int8_t flags; /* file flags */ + int8_t fileType; /* file type (unused ?) */ + FndrFileInfo userInfo; /* Finder information */ + u_int32_t fileID; /* file ID */ + u_int16_t dataStartBlock; /* not used - set to zero */ + int32_t dataLogicalSize; /* logical EOF of data fork */ + int32_t dataPhysicalSize; /* physical EOF of data fork */ + u_int16_t rsrcStartBlock; /* not used - set to zero */ + int32_t rsrcLogicalSize; /* logical EOF of resource fork */ + int32_t rsrcPhysicalSize; /* physical EOF of resource fork */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t modifyDate; /* date and time of last modification */ + u_int32_t backupDate; /* date and time of last backup */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int16_t clumpSize; /* file clump size (not used) */ + HFSExtentRecord dataExtents; /* first data fork extent record */ + HFSExtentRecord rsrcExtents; /* first resource fork extent record */ + u_int32_t reserved; /* reserved - initialized as zero */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogFile HFSCatalogFile; + +/* HFS Plus catalog file record - 248 bytes */ +struct HFSPlusCatalogFile { + int16_t recordType; /* == kHFSPlusFileRecord */ + u_int16_t flags; /* file flags */ + u_int32_t reserved1; /* reserved - initialized as zero */ + u_int32_t fileID; /* file ID */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t contentModDate; /* date and time of last content modification */ + u_int32_t attributeModDate; /* date and time of last attribute modification */ + u_int32_t accessDate; /* date and time of last access (MacOS X only) */ + u_int32_t backupDate; /* date and time of last backup */ + HFSPlusBSDInfo bsdInfo; /* permissions (for MacOS X) */ + FndrFileInfo userInfo; /* Finder information */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int32_t textEncoding; /* hint for name conversions */ + u_int32_t reserved2; /* reserved - initialized as zero */ + + /* Note: these start on double long (64 bit) boundary */ + HFSPlusForkData dataFork; /* size and block data for data fork */ + HFSPlusForkData resourceFork; /* size and block data for resource fork */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogFile HFSPlusCatalogFile; + +/* HFS catalog thread record - 46 bytes */ +struct HFSCatalogThread { + int16_t recordType; /* == kHFSFolderThreadRecord or kHFSFileThreadRecord */ + int32_t reserved[2]; /* reserved - initialized as zero */ + u_int32_t parentID; /* parent ID for this catalog node */ + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; /* name of this catalog node */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogThread HFSCatalogThread; + +/* HFS Plus catalog thread record -- 264 bytes */ +struct HFSPlusCatalogThread { + int16_t recordType; /* == kHFSPlusFolderThreadRecord or kHFSPlusFileThreadRecord */ + int16_t reserved; /* reserved - initialized as zero */ + u_int32_t parentID; /* parent ID for this catalog node */ + HFSUniStr255 nodeName; /* name of this catalog node (variable length) */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogThread HFSPlusCatalogThread; + +#ifdef __APPLE_API_UNSTABLE +/* + These are the types of records in the attribute B-tree. The values were + chosen so that they wouldn't conflict with the catalog record types. +*/ +enum { + kHFSPlusAttrInlineData = 0x10, /* attributes whose data fits in a b-tree node */ + kHFSPlusAttrForkData = 0x20, /* extent based attributes (data lives in extents) */ + kHFSPlusAttrExtents = 0x30 /* overflow extents for large attributes */ +}; + + +/* + HFSPlusAttrForkData + For larger attributes, whose value is stored in allocation blocks. + If the attribute has more than 8 extents, there will be additional + records (of type HFSPlusAttrExtents) for this attribute. +*/ +struct HFSPlusAttrForkData { + u_int32_t recordType; /* == kHFSPlusAttrForkData*/ + u_int32_t reserved; + HFSPlusForkData theFork; /* size and first extents of value*/ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrForkData HFSPlusAttrForkData; + +/* + HFSPlusAttrExtents + This record contains information about overflow extents for large, + fragmented attributes. +*/ +struct HFSPlusAttrExtents { + u_int32_t recordType; /* == kHFSPlusAttrExtents*/ + u_int32_t reserved; + HFSPlusExtentRecord extents; /* additional extents*/ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrExtents HFSPlusAttrExtents; + +/* + * Atrributes B-tree Data Record + * + * For small attributes, whose entire value is stored + * within a single B-tree record. + */ +struct HFSPlusAttrData { + u_int32_t recordType; /* == kHFSPlusAttrInlineData */ + u_int32_t reserved[2]; + u_int32_t attrSize; /* size of attribute data in bytes */ + u_int8_t attrData[2]; /* variable length */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrData HFSPlusAttrData; + + +/* HFSPlusAttrInlineData is obsolete use HFSPlusAttrData instead */ +struct HFSPlusAttrInlineData { + u_int32_t recordType; + u_int32_t reserved; + u_int32_t logicalSize; + u_int8_t userData[2]; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData; + + +/* A generic Attribute Record*/ +union HFSPlusAttrRecord { + u_int32_t recordType; + HFSPlusAttrInlineData inlineData; /* NOT USED */ + HFSPlusAttrData attrData; + HFSPlusAttrForkData forkData; + HFSPlusAttrExtents overflowExtents; +}; +typedef union HFSPlusAttrRecord HFSPlusAttrRecord; + +/* Attribute key */ +enum { kHFSMaxAttrNameLen = 127 }; +struct HFSPlusAttrKey { + u_int16_t keyLength; /* key length (in bytes) */ + u_int16_t pad; /* set to zero */ + u_int32_t fileID; /* file associated with attribute */ + u_int32_t startBlock; /* first allocation block number for extents */ + u_int16_t attrNameLen; /* number of unicode characters */ + u_int16_t attrName[kHFSMaxAttrNameLen]; /* attribute name (Unicode) */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrKey HFSPlusAttrKey; + +#define kHFSPlusAttrKeyMaximumLength (sizeof(HFSPlusAttrKey) - sizeof(u_int16_t)) +#define kHFSPlusAttrKeyMinimumLength (kHFSPlusAttrKeyMaximumLength - kHFSMaxAttrNameLen*sizeof(u_int16_t)) + +#endif /* __APPLE_API_UNSTABLE */ + + +/* Key and node lengths */ +enum { + kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(u_int16_t), + kHFSExtentKeyMaximumLength = sizeof(HFSExtentKey) - sizeof(u_int8_t), + kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(u_int16_t), + kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(u_int16_t), + kHFSCatalogKeyMaximumLength = sizeof(HFSCatalogKey) - sizeof(u_int8_t), + kHFSCatalogKeyMinimumLength = kHFSCatalogKeyMaximumLength - (kHFSMaxFileNameChars + 1) + sizeof(u_int8_t), + kHFSPlusCatalogMinNodeSize = 4096, + kHFSPlusExtentMinNodeSize = 512, + kHFSPlusAttrMinNodeSize = 4096 +}; + +/* HFS and HFS Plus volume attribute bits */ +enum { + /* Bits 0-6 are reserved (always cleared by MountVol call) */ + kHFSVolumeHardwareLockBit = 7, /* volume is locked by hardware */ + kHFSVolumeUnmountedBit = 8, /* volume was successfully unmounted */ + kHFSVolumeSparedBlocksBit = 9, /* volume has bad blocks spared */ + kHFSVolumeNoCacheRequiredBit = 10, /* don't cache volume blocks (i.e. RAM or ROM disk) */ + kHFSBootVolumeInconsistentBit = 11, /* boot volume is inconsistent (System 7.6 and later) */ + kHFSCatalogNodeIDsReusedBit = 12, + kHFSVolumeJournaledBit = 13, /* this volume has a journal on it */ + kHFSVolumeInconsistentBit = 14, /* serious inconsistencies detected at runtime */ + kHFSVolumeSoftwareLockBit = 15, /* volume is locked by software */ + /* + * HFS only has 16 bits of attributes in the MDB, but HFS Plus has 32 bits. + * Therefore, bits 16-31 can only be used on HFS Plus. + */ + kHFSUnusedNodeFixBit = 31, /* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */ + + kHFSVolumeHardwareLockMask = 1 << kHFSVolumeHardwareLockBit, + kHFSVolumeUnmountedMask = 1 << kHFSVolumeUnmountedBit, + kHFSVolumeSparedBlocksMask = 1 << kHFSVolumeSparedBlocksBit, + kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit, + kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit, + kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit, + kHFSVolumeJournaledMask = 1 << kHFSVolumeJournaledBit, + kHFSVolumeInconsistentMask = 1 << kHFSVolumeInconsistentBit, + kHFSVolumeSoftwareLockMask = 1 << kHFSVolumeSoftwareLockBit, + kHFSUnusedNodeFixMask = 1 << kHFSUnusedNodeFixBit, + kHFSMDBAttributesMask = 0x8380 +}; + +enum { + kHFSUnusedNodesFixDate = 0xc5ef2480 /* March 25, 2009 */ +}; + +/* HFS Master Directory Block - 162 bytes */ +/* Stored at sector #2 (3rd sector) and second-to-last sector. */ +struct HFSMasterDirectoryBlock { + u_int16_t drSigWord; /* == kHFSSigWord */ + u_int32_t drCrDate; /* date and time of volume creation */ + u_int32_t drLsMod; /* date and time of last modification */ + u_int16_t drAtrb; /* volume attributes */ + u_int16_t drNmFls; /* number of files in root folder */ + u_int16_t drVBMSt; /* first block of volume bitmap */ + u_int16_t drAllocPtr; /* start of next allocation search */ + u_int16_t drNmAlBlks; /* number of allocation blocks in volume */ + u_int32_t drAlBlkSiz; /* size (in bytes) of allocation blocks */ + u_int32_t drClpSiz; /* default clump size */ + u_int16_t drAlBlSt; /* first allocation block in volume */ + u_int32_t drNxtCNID; /* next unused catalog node ID */ + u_int16_t drFreeBks; /* number of unused allocation blocks */ + u_int8_t drVN[kHFSMaxVolumeNameChars + 1]; /* volume name */ + u_int32_t drVolBkUp; /* date and time of last backup */ + u_int16_t drVSeqNum; /* volume backup sequence number */ + u_int32_t drWrCnt; /* volume write count */ + u_int32_t drXTClpSiz; /* clump size for extents overflow file */ + u_int32_t drCTClpSiz; /* clump size for catalog file */ + u_int16_t drNmRtDirs; /* number of directories in root folder */ + u_int32_t drFilCnt; /* number of files in volume */ + u_int32_t drDirCnt; /* number of directories in volume */ + u_int32_t drFndrInfo[8]; /* information used by the Finder */ + u_int16_t drEmbedSigWord; /* embedded volume signature (formerly drVCSize) */ + HFSExtentDescriptor drEmbedExtent; /* embedded volume location and size (formerly drVBMCSize and drCtlCSize) */ + u_int32_t drXTFlSize; /* size of extents overflow file */ + HFSExtentRecord drXTExtRec; /* extent record for extents overflow file */ + u_int32_t drCTFlSize; /* size of catalog file */ + HFSExtentRecord drCTExtRec; /* extent record for catalog file */ +} __attribute__((aligned(2), packed)); +typedef struct HFSMasterDirectoryBlock HFSMasterDirectoryBlock; + + +#ifdef __APPLE_API_UNSTABLE +#define SET_HFS_TEXT_ENCODING(hint) \ + (0x656e6300 | ((hint) & 0xff)) +#define GET_HFS_TEXT_ENCODING(hint) \ + (((hint) & 0xffffff00) == 0x656e6300 ? (hint) & 0x000000ff : 0xffffffffU) +#endif /* __APPLE_API_UNSTABLE */ + + +/* HFS Plus Volume Header - 512 bytes */ +/* Stored at sector #2 (3rd sector) and second-to-last sector. */ +struct HFSPlusVolumeHeader { + u_int16_t signature; /* == kHFSPlusSigWord */ + u_int16_t version; /* == kHFSPlusVersion */ + u_int32_t attributes; /* volume attributes */ + u_int32_t lastMountedVersion; /* implementation version which last mounted volume */ + u_int32_t journalInfoBlock; /* block addr of journal info (if volume is journaled, zero otherwise) */ + + u_int32_t createDate; /* date and time of volume creation */ + u_int32_t modifyDate; /* date and time of last modification */ + u_int32_t backupDate; /* date and time of last backup */ + u_int32_t checkedDate; /* date and time of last disk check */ + + u_int32_t fileCount; /* number of files in volume */ + u_int32_t folderCount; /* number of directories in volume */ + + u_int32_t blockSize; /* size (in bytes) of allocation blocks */ + u_int32_t totalBlocks; /* number of allocation blocks in volume (includes this header and VBM*/ + u_int32_t freeBlocks; /* number of unused allocation blocks */ + + u_int32_t nextAllocation; /* start of next allocation search */ + u_int32_t rsrcClumpSize; /* default resource fork clump size */ + u_int32_t dataClumpSize; /* default data fork clump size */ + u_int32_t nextCatalogID; /* next unused catalog node ID */ + + u_int32_t writeCount; /* volume write count */ + u_int64_t encodingsBitmap; /* which encodings have been use on this volume */ + + u_int8_t finderInfo[32]; /* information used by the Finder */ + + HFSPlusForkData allocationFile; /* allocation bitmap file */ + HFSPlusForkData extentsFile; /* extents B-tree file */ + HFSPlusForkData catalogFile; /* catalog B-tree file */ + HFSPlusForkData attributesFile; /* extended attributes B-tree file */ + HFSPlusForkData startupFile; /* boot file (secondary loader) */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader; + + +/* B-tree structures */ + +enum BTreeKeyLimits{ + kMaxKeyLength = 520 +}; + +union BTreeKey{ + u_int8_t length8; + u_int16_t length16; + u_int8_t rawData [kMaxKeyLength+2]; +}; +typedef union BTreeKey BTreeKey; + +/* BTNodeDescriptor -- Every B-tree node starts with these fields. */ +struct BTNodeDescriptor { + u_int32_t fLink; /* next node at this level*/ + u_int32_t bLink; /* previous node at this level*/ + int8_t kind; /* kind of node (leaf, index, header, map)*/ + u_int8_t height; /* zero for header, map; child is one more than parent*/ + u_int16_t numRecords; /* number of records in this node*/ + u_int16_t reserved; /* reserved - initialized as zero */ +} __attribute__((aligned(2), packed)); +typedef struct BTNodeDescriptor BTNodeDescriptor; + +/* Constants for BTNodeDescriptor kind */ +enum { + kBTLeafNode = -1, + kBTIndexNode = 0, + kBTHeaderNode = 1, + kBTMapNode = 2 +}; + +/* BTHeaderRec -- The first record of a B-tree header node */ +struct BTHeaderRec { + u_int16_t treeDepth; /* maximum height (usually leaf nodes) */ + u_int32_t rootNode; /* node number of root node */ + u_int32_t leafRecords; /* number of leaf records in all leaf nodes */ + u_int32_t firstLeafNode; /* node number of first leaf node */ + u_int32_t lastLeafNode; /* node number of last leaf node */ + u_int16_t nodeSize; /* size of a node, in bytes */ + u_int16_t maxKeyLength; /* reserved */ + u_int32_t totalNodes; /* total number of nodes in tree */ + u_int32_t freeNodes; /* number of unused (free) nodes in tree */ + u_int16_t reserved1; /* unused */ + u_int32_t clumpSize; /* reserved */ + u_int8_t btreeType; /* reserved */ + u_int8_t keyCompareType; /* Key string Comparison Type */ + u_int32_t attributes; /* persistent attributes about the tree */ + u_int32_t reserved3[16]; /* reserved */ +} __attribute__((aligned(2), packed)); +typedef struct BTHeaderRec BTHeaderRec; + +/* Constants for BTHeaderRec attributes */ +enum { + kBTBadCloseMask = 0x00000001, /* reserved */ + kBTBigKeysMask = 0x00000002, /* key length field is 16 bits */ + kBTVariableIndexKeysMask = 0x00000004 /* keys in index nodes are variable length */ +}; + + +/* Catalog Key Name Comparison Type */ +enum { + kHFSCaseFolding = 0xCF, /* case folding (case-insensitive) */ + kHFSBinaryCompare = 0xBC /* binary compare (case-sensitive) */ +}; + + +/* JournalInfoBlock - Structure that describes where our journal lives */ + +// the original size of the reserved field in the JournalInfoBlock was +// 32*sizeof(u_int32_t). To keep the total size of the structure the +// same we subtract the size of new fields (currently: ext_jnl_uuid and +// machine_uuid). If you add additional fields, place them before the +// reserved field and subtract their size in this macro. +// +#define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48) + +typedef char uuid_string_t[37]; +struct JournalInfoBlock { + u_int32_t flags; + u_int32_t device_signature[8]; // signature used to locate our device. + u_int64_t offset; // byte offset to the journal on the device + u_int64_t size; // size in bytes of the journal + uuid_string_t ext_jnl_uuid; + char machine_serial_num[48]; + char reserved[JIB_RESERVED_SIZE]; +} __attribute__((aligned(2), packed)); +typedef struct JournalInfoBlock JournalInfoBlock; + +enum { + kJIJournalInFSMask = 0x00000001, + kJIJournalOnOtherDeviceMask = 0x00000002, + kJIJournalNeedInitMask = 0x00000004 +}; + +// +// This the content type uuid for "external journal" GPT +// partitions. Each instance of a partition also has a +// uuid that uniquely identifies that instance. +// +#define EXTJNL_CONTENT_TYPE_UUID "4A6F7572-6E61-11AA-AA11-00306543ECAC" + + +#ifdef __cplusplus +} +#endif + +#endif /* __HFS_FORMAT__ */ diff --git a/i386/include/hfs/.svn/text-base/hfs_mount.h.svn-base b/i386/include/hfs/.svn/text-base/hfs_mount.h.svn-base new file mode 100644 index 0000000..acad4d0 --- /dev/null +++ b/i386/include/hfs/.svn/text-base/hfs_mount.h.svn-base @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-2002 Apple Computer, Inc. All Rights Reserved + * + */ + +#ifndef _HFS_MOUNT_H_ +#define _HFS_MOUNT_H_ + +#include <sys/appleapiopts.h> + +#include <sys/mount.h> +#include <sys/time.h> + +/* + * Arguments to mount HFS-based filesystems + */ + +#define OVERRIDE_UNKNOWN_PERMISSIONS 0 + +#define UNKNOWNUID ((uid_t)99) +#define UNKNOWNGID ((gid_t)99) +#define UNKNOWNPERMISSIONS (S_IRWXU | S_IROTH | S_IXOTH) /* 705 */ + +#ifdef __APPLE_API_UNSTABLE +struct hfs_mount_args { + char *fspec; /* block special device to mount */ + uid_t hfs_uid; /* uid that owns hfs files (standard HFS only) */ + gid_t hfs_gid; /* gid that owns hfs files (standard HFS only) */ + mode_t hfs_mask; /* mask to be applied for hfs perms (standard HFS only) */ + u_int32_t hfs_encoding; /* encoding for this volume (standard HFS only) */ + struct timezone hfs_timezone; /* user time zone info (standard HFS only) */ + int flags; /* mounting flags, see below */ + int journal_tbuffer_size; /* size in bytes of the journal transaction buffer */ + int journal_flags; /* flags to pass to journal_open/create */ + int journal_disable; /* don't use journaling (potentially dangerous) */ +}; + +#define HFSFSMNT_NOXONFILES 0x1 /* disable execute permissions for files */ +#define HFSFSMNT_WRAPPER 0x2 /* mount HFS wrapper (if it exists) */ +#define HFSFSMNT_EXTENDED_ARGS 0x4 /* indicates new fields after "flags" are valid */ + +/* + * Sysctl values for HFS + */ +#define HFS_ENCODINGBIAS 1 /* encoding matching CJK bias */ +#define HFS_EXTEND_FS 2 +#define HFS_ENCODINGHINT 3 /* guess encoding for string */ +#define HFS_ENABLE_JOURNALING 0x082969 +#define HFS_DISABLE_JOURNALING 0x031272 +#define HFS_GET_JOURNAL_INFO 0x6a6e6c69 +#define HFS_SET_PKG_EXTENSIONS 0x121031 +#define HFS_REPLAY_JOURNAL 0x6a6e6c72 + +#endif /* __APPLE_API_UNSTABLE */ + +#endif /* ! _HFS_MOUNT_H_ */ diff --git a/i386/include/hfs/hfs_encodings.h b/i386/include/hfs/hfs_encodings.h new file mode 100644 index 0000000..8d9dc4b --- /dev/null +++ b/i386/include/hfs/hfs_encodings.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2000-2002, 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-2000 Apple Computer, Inc. All Rights Reserved + */ + +#ifndef _HFS_ENCODINGS_H_ +#define _HFS_ENCODINGS_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_UNSTABLE + +#define CTL_HFS_NAMES { \ + { 0, 0 }, \ + { "encodingbias", CTLTYPE_INT }, \ +} + +/* + * HFS Filename Encoding Converters Interface + * + * Private Interface for adding hfs filename + * encoding converters. These are not needed + * for HFS Plus volumes (since they already + * have Unicode filenames). + * + * Used by HFS Encoding Converter Kernel Modules + * (like HFS_Japanese.kmod) to register their + * encoding conversion routines. + */ + +typedef int (* hfs_to_unicode_func_t)(const Str31 hfs_str, UniChar *uni_str, + u_int32_t maxCharLen, u_int32_t *usedCharLen); + +typedef int (* unicode_to_hfs_func_t)(UniChar *uni_str, u_int32_t unicodeChars, + Str31 hfs_str); + + +int hfs_addconverter(int kmod_id, u_int32_t encoding, + hfs_to_unicode_func_t get_unicode, + unicode_to_hfs_func_t get_hfsname); + +int hfs_remconverter(int kmod_id, u_int32_t encoding); + +#endif /* __APPLE_API_UNSTABLE */ + +#endif /* ! _HFS_ENCODINGS_H_ */ diff --git a/i386/include/hfs/hfs_format.h b/i386/include/hfs/hfs_format.h new file mode 100644 index 0000000..224d2e2 --- /dev/null +++ b/i386/include/hfs/hfs_format.h @@ -0,0 +1,785 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef __HFS_FORMAT__ +#define __HFS_FORMAT__ + +#include <sys/types.h> + +/* + * hfs_format.c + * + * This file describes the on-disk format for HFS and HFS Plus volumes. + * The HFS Plus volume format is desciibed in detail in Apple Technote 1150. + * + * http://developer.apple.com/technotes/tn/tn1150.html + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* some on-disk hfs structures have 68K alignment (misaligned) */ + +/* Signatures used to differentiate between HFS and HFS Plus volumes */ +enum { + kHFSSigWord = 0x4244, /* 'BD' in ASCII */ + kHFSPlusSigWord = 0x482B, /* 'H+' in ASCII */ + kHFSXSigWord = 0x4858, /* 'HX' in ASCII */ + + kHFSPlusVersion = 0x0004, /* 'H+' volumes are version 4 only */ + kHFSXVersion = 0x0005, /* 'HX' volumes start with version 5 */ + + kHFSPlusMountVersion = 0x31302E30, /* '10.0' for Mac OS X */ + kHFSJMountVersion = 0x4846534a, /* 'HFSJ' for journaled HFS+ on OS X */ + kFSKMountVersion = 0x46534b21 /* 'FSK!' for failed journal replay */ +}; + + +/* + * Mac OS X has two special directories on HFS+ volumes for hardlinked files + * and hardlinked directories as well as for open-unlinked files. + * + * These directories and their contents are not exported from the filesystem + * under Mac OS X. + */ +#define HFSPLUSMETADATAFOLDER "\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80\xE2\x90\x80HFS+ Private Data" +#define HFSPLUS_DIR_METADATA_FOLDER ".HFS+ Private Directory Data\xd" + +/* + * Files in the "HFS+ Private Data" folder have one of the following prefixes + * followed by a decimal number (no leading zeros) for the file ID. + * + * Note: Earlier version of Mac OS X used a 32 bit random number for the link + * ref number instead of the file id. + * + * e.g. iNode7182000 and temp3296 + */ +#define HFS_INODE_PREFIX "iNode" +#define HFS_DELETE_PREFIX "temp" + +/* + * Files in the ".HFS+ Private Directory Data" folder have the following + * prefix followed by a decimal number (no leading zeros) for the file ID. + * + * e.g. dir_555 + */ +#define HFS_DIRINODE_PREFIX "dir_" + +/* + * Hardlink inodes save the head of the link chain in + * an extended attribute named FIRST_LINK_XATTR_NAME. + * The attribute data is the decimal value in ASCII + * of the cnid for the first link in the chain. + * + * This extended attribute is private (i.e. its not + * exported in the getxattr/listxattr POSIX APIs). + */ +#define FIRST_LINK_XATTR_NAME "com.apple.system.hfs.firstlink" +#define FIRST_LINK_XATTR_REC_SIZE (sizeof(HFSPlusAttrData) - 2 + 12) + +/* + * The name space ID for generating an HFS volume UUID + * + * B3E20F39-F292-11D6-97A4-00306543ECAC + */ +#define HFS_UUID_NAMESPACE_ID "\xB3\xE2\x0F\x39\xF2\x92\x11\xD6\x97\xA4\x00\x30\x65\x43\xEC\xAC" + +/* + * Indirect link files (hard links) have the following type/creator. + */ +enum { + kHardLinkFileType = 0x686C6E6B, /* 'hlnk' */ + kHFSPlusCreator = 0x6866732B /* 'hfs+' */ +}; + + +/* + * File type and creator for symbolic links + */ +enum { + kSymLinkFileType = 0x736C6E6B, /* 'slnk' */ + kSymLinkCreator = 0x72686170 /* 'rhap' */ +}; + + +#ifndef _HFSUNISTR255_DEFINED_ +#define _HFSUNISTR255_DEFINED_ +/* Unicode strings are used for HFS Plus file and folder names */ +struct HFSUniStr255 { + u_int16_t length; /* number of unicode characters */ + u_int16_t unicode[255]; /* unicode characters */ +} __attribute__((aligned(2), packed)); +typedef struct HFSUniStr255 HFSUniStr255; +typedef const HFSUniStr255 *ConstHFSUniStr255Param; +#endif /* _HFSUNISTR255_DEFINED_ */ + +enum { + kHFSMaxVolumeNameChars = 27, + kHFSMaxFileNameChars = 31, + kHFSPlusMaxFileNameChars = 255 +}; + + +/* Extent overflow file data structures */ + +/* HFS Extent key */ +struct HFSExtentKey { + u_int8_t keyLength; /* length of key, excluding this field */ + u_int8_t forkType; /* 0 = data fork, FF = resource fork */ + u_int32_t fileID; /* file ID */ + u_int16_t startBlock; /* first file allocation block number in this extent */ +} __attribute__((aligned(2), packed)); +typedef struct HFSExtentKey HFSExtentKey; + +/* HFS Plus Extent key */ +struct HFSPlusExtentKey { + u_int16_t keyLength; /* length of key, excluding this field */ + u_int8_t forkType; /* 0 = data fork, FF = resource fork */ + u_int8_t pad; /* make the other fields align on 32-bit boundary */ + u_int32_t fileID; /* file ID */ + u_int32_t startBlock; /* first file allocation block number in this extent */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusExtentKey HFSPlusExtentKey; + +/* Number of extent descriptors per extent record */ +enum { + kHFSExtentDensity = 3, + kHFSPlusExtentDensity = 8 +}; + +/* HFS extent descriptor */ +struct HFSExtentDescriptor { + u_int16_t startBlock; /* first allocation block */ + u_int16_t blockCount; /* number of allocation blocks */ +} __attribute__((aligned(2), packed)); +typedef struct HFSExtentDescriptor HFSExtentDescriptor; + +/* HFS Plus extent descriptor */ +struct HFSPlusExtentDescriptor { + u_int32_t startBlock; /* first allocation block */ + u_int32_t blockCount; /* number of allocation blocks */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusExtentDescriptor HFSPlusExtentDescriptor; + +/* HFS extent record */ +typedef HFSExtentDescriptor HFSExtentRecord[3]; + +/* HFS Plus extent record */ +typedef HFSPlusExtentDescriptor HFSPlusExtentRecord[8]; + + +/* Finder information */ +struct FndrFileInfo { + u_int32_t fdType; /* file type */ + u_int32_t fdCreator; /* file creator */ + u_int16_t fdFlags; /* Finder flags */ + struct { + int16_t v; /* file's location */ + int16_t h; + } fdLocation; + int16_t opaque; +} __attribute__((aligned(2), packed)); +typedef struct FndrFileInfo FndrFileInfo; + +struct FndrDirInfo { + struct { /* folder's window rectangle */ + int16_t top; + int16_t left; + int16_t bottom; + int16_t right; + } frRect; + unsigned short frFlags; /* Finder flags */ + struct { + u_int16_t v; /* folder's location */ + u_int16_t h; + } frLocation; + int16_t opaque; +} __attribute__((aligned(2), packed)); +typedef struct FndrDirInfo FndrDirInfo; + +struct FndrOpaqueInfo { + int8_t opaque[16]; +} __attribute__((aligned(2), packed)); +typedef struct FndrOpaqueInfo FndrOpaqueInfo; + + +/* HFS Plus Fork data info - 80 bytes */ +struct HFSPlusForkData { + u_int64_t logicalSize; /* fork's logical size in bytes */ + u_int32_t clumpSize; /* fork's clump size in bytes */ + u_int32_t totalBlocks; /* total blocks used by this fork */ + HFSPlusExtentRecord extents; /* initial set of extents */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusForkData HFSPlusForkData; + + +/* Mac OS X has 16 bytes worth of "BSD" info. + * + * Note: Mac OS 9 implementations and applications + * should preserve, but not change, this information. + */ +struct HFSPlusBSDInfo { + u_int32_t ownerID; /* user-id of owner or hard link chain previous link */ + u_int32_t groupID; /* group-id of owner or hard link chain next link */ + u_int8_t adminFlags; /* super-user changeable flags */ + u_int8_t ownerFlags; /* owner changeable flags */ + u_int16_t fileMode; /* file type and permission bits */ + union { + u_int32_t iNodeNum; /* indirect node number (hard links only) */ + u_int32_t linkCount; /* links that refer to this indirect node */ + u_int32_t rawDevice; /* special file device (FBLK and FCHR only) */ + } special; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusBSDInfo HFSPlusBSDInfo; + +/* + * Hardlink "links" resolve to an inode + * and the actual uid/gid comes from that + * inode. + * + * We repurpose the links's uid/gid fields + * for the hardlink link chain. The chain + * consists of a doubly linked list of file + * ids. + */ + +#define hl_firstLinkID reserved1 /* Valid only if HasLinkChain flag is set (indirect nodes only) */ + +#define hl_prevLinkID bsdInfo.ownerID /* Valid only if HasLinkChain flag is set */ +#define hl_nextLinkID bsdInfo.groupID /* Valid only if HasLinkChain flag is set */ + +#define hl_linkReference bsdInfo.special.iNodeNum +#define hl_linkCount bsdInfo.special.linkCount + + +/* Catalog file data structures */ + +enum { + kHFSRootParentID = 1, /* Parent ID of the root folder */ + kHFSRootFolderID = 2, /* Folder ID of the root folder */ + kHFSExtentsFileID = 3, /* File ID of the extents file */ + kHFSCatalogFileID = 4, /* File ID of the catalog file */ + kHFSBadBlockFileID = 5, /* File ID of the bad allocation block file */ + kHFSAllocationFileID = 6, /* File ID of the allocation file (HFS Plus only) */ + kHFSStartupFileID = 7, /* File ID of the startup file (HFS Plus only) */ + kHFSAttributesFileID = 8, /* File ID of the attribute file (HFS Plus only) */ + kHFSAttributeDataFileID = 13, /* Used in Mac OS X runtime for extent based attributes */ + /* kHFSAttributeDataFileID is never stored on disk. */ + kHFSRepairCatalogFileID = 14, /* Used when rebuilding Catalog B-tree */ + kHFSBogusExtentFileID = 15, /* Used for exchanging extents in extents file */ + kHFSFirstUserCatalogNodeID = 16 +}; + +/* HFS catalog key */ +struct HFSCatalogKey { + u_int8_t keyLength; /* key length (in bytes) */ + u_int8_t reserved; /* reserved (set to zero) */ + u_int32_t parentID; /* parent folder ID */ + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; /* catalog node name */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogKey HFSCatalogKey; + +/* HFS Plus catalog key */ +struct HFSPlusCatalogKey { + u_int16_t keyLength; /* key length (in bytes) */ + u_int32_t parentID; /* parent folder ID */ + HFSUniStr255 nodeName; /* catalog node name */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogKey HFSPlusCatalogKey; + +/* Catalog record types */ +enum { + /* HFS Catalog Records */ + kHFSFolderRecord = 0x0100, /* Folder record */ + kHFSFileRecord = 0x0200, /* File record */ + kHFSFolderThreadRecord = 0x0300, /* Folder thread record */ + kHFSFileThreadRecord = 0x0400, /* File thread record */ + + /* HFS Plus Catalog Records */ + kHFSPlusFolderRecord = 1, /* Folder record */ + kHFSPlusFileRecord = 2, /* File record */ + kHFSPlusFolderThreadRecord = 3, /* Folder thread record */ + kHFSPlusFileThreadRecord = 4 /* File thread record */ +}; + + +/* Catalog file record flags */ +enum { + kHFSFileLockedBit = 0x0000, /* file is locked and cannot be written to */ + kHFSFileLockedMask = 0x0001, + + kHFSThreadExistsBit = 0x0001, /* a file thread record exists for this file */ + kHFSThreadExistsMask = 0x0002, + + kHFSHasAttributesBit = 0x0002, /* object has extended attributes */ + kHFSHasAttributesMask = 0x0004, + + kHFSHasSecurityBit = 0x0003, /* object has security data (ACLs) */ + kHFSHasSecurityMask = 0x0008, + + kHFSHasFolderCountBit = 0x0004, /* only for HFSX, folder maintains a separate sub-folder count */ + kHFSHasFolderCountMask = 0x0010, /* (sum of folder records and directory hard links) */ + + kHFSHasLinkChainBit = 0x0005, /* has hardlink chain (inode or link) */ + kHFSHasLinkChainMask = 0x0020, + + kHFSHasChildLinkBit = 0x0006, /* folder has a child that's a dir link */ + kHFSHasChildLinkMask = 0x0040 +}; + + +/* HFS catalog folder record - 70 bytes */ +struct HFSCatalogFolder { + int16_t recordType; /* == kHFSFolderRecord */ + u_int16_t flags; /* folder flags */ + u_int16_t valence; /* folder valence */ + u_int32_t folderID; /* folder ID */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t modifyDate; /* date and time of last modification */ + u_int32_t backupDate; /* date and time of last backup */ + FndrDirInfo userInfo; /* Finder information */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int32_t reserved[4]; /* reserved - initialized as zero */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogFolder HFSCatalogFolder; + +/* HFS Plus catalog folder record - 88 bytes */ +struct HFSPlusCatalogFolder { + int16_t recordType; /* == kHFSPlusFolderRecord */ + u_int16_t flags; /* file flags */ + u_int32_t valence; /* folder's item count */ + u_int32_t folderID; /* folder ID */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t contentModDate; /* date and time of last content modification */ + u_int32_t attributeModDate; /* date and time of last attribute modification */ + u_int32_t accessDate; /* date and time of last access (MacOS X only) */ + u_int32_t backupDate; /* date and time of last backup */ + HFSPlusBSDInfo bsdInfo; /* permissions (for MacOS X) */ + FndrDirInfo userInfo; /* Finder information */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int32_t textEncoding; /* hint for name conversions */ + u_int32_t folderCount; /* number of enclosed folders, active when HasFolderCount is set */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogFolder HFSPlusCatalogFolder; + +/* HFS catalog file record - 102 bytes */ +struct HFSCatalogFile { + int16_t recordType; /* == kHFSFileRecord */ + u_int8_t flags; /* file flags */ + int8_t fileType; /* file type (unused ?) */ + FndrFileInfo userInfo; /* Finder information */ + u_int32_t fileID; /* file ID */ + u_int16_t dataStartBlock; /* not used - set to zero */ + int32_t dataLogicalSize; /* logical EOF of data fork */ + int32_t dataPhysicalSize; /* physical EOF of data fork */ + u_int16_t rsrcStartBlock; /* not used - set to zero */ + int32_t rsrcLogicalSize; /* logical EOF of resource fork */ + int32_t rsrcPhysicalSize; /* physical EOF of resource fork */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t modifyDate; /* date and time of last modification */ + u_int32_t backupDate; /* date and time of last backup */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int16_t clumpSize; /* file clump size (not used) */ + HFSExtentRecord dataExtents; /* first data fork extent record */ + HFSExtentRecord rsrcExtents; /* first resource fork extent record */ + u_int32_t reserved; /* reserved - initialized as zero */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogFile HFSCatalogFile; + +/* HFS Plus catalog file record - 248 bytes */ +struct HFSPlusCatalogFile { + int16_t recordType; /* == kHFSPlusFileRecord */ + u_int16_t flags; /* file flags */ + u_int32_t reserved1; /* reserved - initialized as zero */ + u_int32_t fileID; /* file ID */ + u_int32_t createDate; /* date and time of creation */ + u_int32_t contentModDate; /* date and time of last content modification */ + u_int32_t attributeModDate; /* date and time of last attribute modification */ + u_int32_t accessDate; /* date and time of last access (MacOS X only) */ + u_int32_t backupDate; /* date and time of last backup */ + HFSPlusBSDInfo bsdInfo; /* permissions (for MacOS X) */ + FndrFileInfo userInfo; /* Finder information */ + FndrOpaqueInfo finderInfo; /* additional Finder information */ + u_int32_t textEncoding; /* hint for name conversions */ + u_int32_t reserved2; /* reserved - initialized as zero */ + + /* Note: these start on double long (64 bit) boundary */ + HFSPlusForkData dataFork; /* size and block data for data fork */ + HFSPlusForkData resourceFork; /* size and block data for resource fork */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogFile HFSPlusCatalogFile; + +/* HFS catalog thread record - 46 bytes */ +struct HFSCatalogThread { + int16_t recordType; /* == kHFSFolderThreadRecord or kHFSFileThreadRecord */ + int32_t reserved[2]; /* reserved - initialized as zero */ + u_int32_t parentID; /* parent ID for this catalog node */ + u_int8_t nodeName[kHFSMaxFileNameChars + 1]; /* name of this catalog node */ +} __attribute__((aligned(2), packed)); +typedef struct HFSCatalogThread HFSCatalogThread; + +/* HFS Plus catalog thread record -- 264 bytes */ +struct HFSPlusCatalogThread { + int16_t recordType; /* == kHFSPlusFolderThreadRecord or kHFSPlusFileThreadRecord */ + int16_t reserved; /* reserved - initialized as zero */ + u_int32_t parentID; /* parent ID for this catalog node */ + HFSUniStr255 nodeName; /* name of this catalog node (variable length) */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusCatalogThread HFSPlusCatalogThread; + +#ifdef __APPLE_API_UNSTABLE +/* + These are the types of records in the attribute B-tree. The values were + chosen so that they wouldn't conflict with the catalog record types. +*/ +enum { + kHFSPlusAttrInlineData = 0x10, /* attributes whose data fits in a b-tree node */ + kHFSPlusAttrForkData = 0x20, /* extent based attributes (data lives in extents) */ + kHFSPlusAttrExtents = 0x30 /* overflow extents for large attributes */ +}; + + +/* + HFSPlusAttrForkData + For larger attributes, whose value is stored in allocation blocks. + If the attribute has more than 8 extents, there will be additional + records (of type HFSPlusAttrExtents) for this attribute. +*/ +struct HFSPlusAttrForkData { + u_int32_t recordType; /* == kHFSPlusAttrForkData*/ + u_int32_t reserved; + HFSPlusForkData theFork; /* size and first extents of value*/ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrForkData HFSPlusAttrForkData; + +/* + HFSPlusAttrExtents + This record contains information about overflow extents for large, + fragmented attributes. +*/ +struct HFSPlusAttrExtents { + u_int32_t recordType; /* == kHFSPlusAttrExtents*/ + u_int32_t reserved; + HFSPlusExtentRecord extents; /* additional extents*/ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrExtents HFSPlusAttrExtents; + +/* + * Atrributes B-tree Data Record + * + * For small attributes, whose entire value is stored + * within a single B-tree record. + */ +struct HFSPlusAttrData { + u_int32_t recordType; /* == kHFSPlusAttrInlineData */ + u_int32_t reserved[2]; + u_int32_t attrSize; /* size of attribute data in bytes */ + u_int8_t attrData[2]; /* variable length */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrData HFSPlusAttrData; + + +/* HFSPlusAttrInlineData is obsolete use HFSPlusAttrData instead */ +struct HFSPlusAttrInlineData { + u_int32_t recordType; + u_int32_t reserved; + u_int32_t logicalSize; + u_int8_t userData[2]; +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrInlineData HFSPlusAttrInlineData; + + +/* A generic Attribute Record*/ +union HFSPlusAttrRecord { + u_int32_t recordType; + HFSPlusAttrInlineData inlineData; /* NOT USED */ + HFSPlusAttrData attrData; + HFSPlusAttrForkData forkData; + HFSPlusAttrExtents overflowExtents; +}; +typedef union HFSPlusAttrRecord HFSPlusAttrRecord; + +/* Attribute key */ +enum { kHFSMaxAttrNameLen = 127 }; +struct HFSPlusAttrKey { + u_int16_t keyLength; /* key length (in bytes) */ + u_int16_t pad; /* set to zero */ + u_int32_t fileID; /* file associated with attribute */ + u_int32_t startBlock; /* first allocation block number for extents */ + u_int16_t attrNameLen; /* number of unicode characters */ + u_int16_t attrName[kHFSMaxAttrNameLen]; /* attribute name (Unicode) */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusAttrKey HFSPlusAttrKey; + +#define kHFSPlusAttrKeyMaximumLength (sizeof(HFSPlusAttrKey) - sizeof(u_int16_t)) +#define kHFSPlusAttrKeyMinimumLength (kHFSPlusAttrKeyMaximumLength - kHFSMaxAttrNameLen*sizeof(u_int16_t)) + +#endif /* __APPLE_API_UNSTABLE */ + + +/* Key and node lengths */ +enum { + kHFSPlusExtentKeyMaximumLength = sizeof(HFSPlusExtentKey) - sizeof(u_int16_t), + kHFSExtentKeyMaximumLength = sizeof(HFSExtentKey) - sizeof(u_int8_t), + kHFSPlusCatalogKeyMaximumLength = sizeof(HFSPlusCatalogKey) - sizeof(u_int16_t), + kHFSPlusCatalogKeyMinimumLength = kHFSPlusCatalogKeyMaximumLength - sizeof(HFSUniStr255) + sizeof(u_int16_t), + kHFSCatalogKeyMaximumLength = sizeof(HFSCatalogKey) - sizeof(u_int8_t), + kHFSCatalogKeyMinimumLength = kHFSCatalogKeyMaximumLength - (kHFSMaxFileNameChars + 1) + sizeof(u_int8_t), + kHFSPlusCatalogMinNodeSize = 4096, + kHFSPlusExtentMinNodeSize = 512, + kHFSPlusAttrMinNodeSize = 4096 +}; + +/* HFS and HFS Plus volume attribute bits */ +enum { + /* Bits 0-6 are reserved (always cleared by MountVol call) */ + kHFSVolumeHardwareLockBit = 7, /* volume is locked by hardware */ + kHFSVolumeUnmountedBit = 8, /* volume was successfully unmounted */ + kHFSVolumeSparedBlocksBit = 9, /* volume has bad blocks spared */ + kHFSVolumeNoCacheRequiredBit = 10, /* don't cache volume blocks (i.e. RAM or ROM disk) */ + kHFSBootVolumeInconsistentBit = 11, /* boot volume is inconsistent (System 7.6 and later) */ + kHFSCatalogNodeIDsReusedBit = 12, + kHFSVolumeJournaledBit = 13, /* this volume has a journal on it */ + kHFSVolumeInconsistentBit = 14, /* serious inconsistencies detected at runtime */ + kHFSVolumeSoftwareLockBit = 15, /* volume is locked by software */ + /* + * HFS only has 16 bits of attributes in the MDB, but HFS Plus has 32 bits. + * Therefore, bits 16-31 can only be used on HFS Plus. + */ + kHFSUnusedNodeFixBit = 31, /* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */ + + kHFSVolumeHardwareLockMask = 1 << kHFSVolumeHardwareLockBit, + kHFSVolumeUnmountedMask = 1 << kHFSVolumeUnmountedBit, + kHFSVolumeSparedBlocksMask = 1 << kHFSVolumeSparedBlocksBit, + kHFSVolumeNoCacheRequiredMask = 1 << kHFSVolumeNoCacheRequiredBit, + kHFSBootVolumeInconsistentMask = 1 << kHFSBootVolumeInconsistentBit, + kHFSCatalogNodeIDsReusedMask = 1 << kHFSCatalogNodeIDsReusedBit, + kHFSVolumeJournaledMask = 1 << kHFSVolumeJournaledBit, + kHFSVolumeInconsistentMask = 1 << kHFSVolumeInconsistentBit, + kHFSVolumeSoftwareLockMask = 1 << kHFSVolumeSoftwareLockBit, + kHFSUnusedNodeFixMask = 1 << kHFSUnusedNodeFixBit, + kHFSMDBAttributesMask = 0x8380 +}; + +enum { + kHFSUnusedNodesFixDate = 0xc5ef2480 /* March 25, 2009 */ +}; + +/* HFS Master Directory Block - 162 bytes */ +/* Stored at sector #2 (3rd sector) and second-to-last sector. */ +struct HFSMasterDirectoryBlock { + u_int16_t drSigWord; /* == kHFSSigWord */ + u_int32_t drCrDate; /* date and time of volume creation */ + u_int32_t drLsMod; /* date and time of last modification */ + u_int16_t drAtrb; /* volume attributes */ + u_int16_t drNmFls; /* number of files in root folder */ + u_int16_t drVBMSt; /* first block of volume bitmap */ + u_int16_t drAllocPtr; /* start of next allocation search */ + u_int16_t drNmAlBlks; /* number of allocation blocks in volume */ + u_int32_t drAlBlkSiz; /* size (in bytes) of allocation blocks */ + u_int32_t drClpSiz; /* default clump size */ + u_int16_t drAlBlSt; /* first allocation block in volume */ + u_int32_t drNxtCNID; /* next unused catalog node ID */ + u_int16_t drFreeBks; /* number of unused allocation blocks */ + u_int8_t drVN[kHFSMaxVolumeNameChars + 1]; /* volume name */ + u_int32_t drVolBkUp; /* date and time of last backup */ + u_int16_t drVSeqNum; /* volume backup sequence number */ + u_int32_t drWrCnt; /* volume write count */ + u_int32_t drXTClpSiz; /* clump size for extents overflow file */ + u_int32_t drCTClpSiz; /* clump size for catalog file */ + u_int16_t drNmRtDirs; /* number of directories in root folder */ + u_int32_t drFilCnt; /* number of files in volume */ + u_int32_t drDirCnt; /* number of directories in volume */ + u_int32_t drFndrInfo[8]; /* information used by the Finder */ + u_int16_t drEmbedSigWord; /* embedded volume signature (formerly drVCSize) */ + HFSExtentDescriptor drEmbedExtent; /* embedded volume location and size (formerly drVBMCSize and drCtlCSize) */ + u_int32_t drXTFlSize; /* size of extents overflow file */ + HFSExtentRecord drXTExtRec; /* extent record for extents overflow file */ + u_int32_t drCTFlSize; /* size of catalog file */ + HFSExtentRecord drCTExtRec; /* extent record for catalog file */ +} __attribute__((aligned(2), packed)); +typedef struct HFSMasterDirectoryBlock HFSMasterDirectoryBlock; + + +#ifdef __APPLE_API_UNSTABLE +#define SET_HFS_TEXT_ENCODING(hint) \ + (0x656e6300 | ((hint) & 0xff)) +#define GET_HFS_TEXT_ENCODING(hint) \ + (((hint) & 0xffffff00) == 0x656e6300 ? (hint) & 0x000000ff : 0xffffffffU) +#endif /* __APPLE_API_UNSTABLE */ + + +/* HFS Plus Volume Header - 512 bytes */ +/* Stored at sector #2 (3rd sector) and second-to-last sector. */ +struct HFSPlusVolumeHeader { + u_int16_t signature; /* == kHFSPlusSigWord */ + u_int16_t version; /* == kHFSPlusVersion */ + u_int32_t attributes; /* volume attributes */ + u_int32_t lastMountedVersion; /* implementation version which last mounted volume */ + u_int32_t journalInfoBlock; /* block addr of journal info (if volume is journaled, zero otherwise) */ + + u_int32_t createDate; /* date and time of volume creation */ + u_int32_t modifyDate; /* date and time of last modification */ + u_int32_t backupDate; /* date and time of last backup */ + u_int32_t checkedDate; /* date and time of last disk check */ + + u_int32_t fileCount; /* number of files in volume */ + u_int32_t folderCount; /* number of directories in volume */ + + u_int32_t blockSize; /* size (in bytes) of allocation blocks */ + u_int32_t totalBlocks; /* number of allocation blocks in volume (includes this header and VBM*/ + u_int32_t freeBlocks; /* number of unused allocation blocks */ + + u_int32_t nextAllocation; /* start of next allocation search */ + u_int32_t rsrcClumpSize; /* default resource fork clump size */ + u_int32_t dataClumpSize; /* default data fork clump size */ + u_int32_t nextCatalogID; /* next unused catalog node ID */ + + u_int32_t writeCount; /* volume write count */ + u_int64_t encodingsBitmap; /* which encodings have been use on this volume */ + + u_int8_t finderInfo[32]; /* information used by the Finder */ + + HFSPlusForkData allocationFile; /* allocation bitmap file */ + HFSPlusForkData extentsFile; /* extents B-tree file */ + HFSPlusForkData catalogFile; /* catalog B-tree file */ + HFSPlusForkData attributesFile; /* extended attributes B-tree file */ + HFSPlusForkData startupFile; /* boot file (secondary loader) */ +} __attribute__((aligned(2), packed)); +typedef struct HFSPlusVolumeHeader HFSPlusVolumeHeader; + + +/* B-tree structures */ + +enum BTreeKeyLimits{ + kMaxKeyLength = 520 +}; + +union BTreeKey{ + u_int8_t length8; + u_int16_t length16; + u_int8_t rawData [kMaxKeyLength+2]; +}; +typedef union BTreeKey BTreeKey; + +/* BTNodeDescriptor -- Every B-tree node starts with these fields. */ +struct BTNodeDescriptor { + u_int32_t fLink; /* next node at this level*/ + u_int32_t bLink; /* previous node at this level*/ + int8_t kind; /* kind of node (leaf, index, header, map)*/ + u_int8_t height; /* zero for header, map; child is one more than parent*/ + u_int16_t numRecords; /* number of records in this node*/ + u_int16_t reserved; /* reserved - initialized as zero */ +} __attribute__((aligned(2), packed)); +typedef struct BTNodeDescriptor BTNodeDescriptor; + +/* Constants for BTNodeDescriptor kind */ +enum { + kBTLeafNode = -1, + kBTIndexNode = 0, + kBTHeaderNode = 1, + kBTMapNode = 2 +}; + +/* BTHeaderRec -- The first record of a B-tree header node */ +struct BTHeaderRec { + u_int16_t treeDepth; /* maximum height (usually leaf nodes) */ + u_int32_t rootNode; /* node number of root node */ + u_int32_t leafRecords; /* number of leaf records in all leaf nodes */ + u_int32_t firstLeafNode; /* node number of first leaf node */ + u_int32_t lastLeafNode; /* node number of last leaf node */ + u_int16_t nodeSize; /* size of a node, in bytes */ + u_int16_t maxKeyLength; /* reserved */ + u_int32_t totalNodes; /* total number of nodes in tree */ + u_int32_t freeNodes; /* number of unused (free) nodes in tree */ + u_int16_t reserved1; /* unused */ + u_int32_t clumpSize; /* reserved */ + u_int8_t btreeType; /* reserved */ + u_int8_t keyCompareType; /* Key string Comparison Type */ + u_int32_t attributes; /* persistent attributes about the tree */ + u_int32_t reserved3[16]; /* reserved */ +} __attribute__((aligned(2), packed)); +typedef struct BTHeaderRec BTHeaderRec; + +/* Constants for BTHeaderRec attributes */ +enum { + kBTBadCloseMask = 0x00000001, /* reserved */ + kBTBigKeysMask = 0x00000002, /* key length field is 16 bits */ + kBTVariableIndexKeysMask = 0x00000004 /* keys in index nodes are variable length */ +}; + + +/* Catalog Key Name Comparison Type */ +enum { + kHFSCaseFolding = 0xCF, /* case folding (case-insensitive) */ + kHFSBinaryCompare = 0xBC /* binary compare (case-sensitive) */ +}; + + +/* JournalInfoBlock - Structure that describes where our journal lives */ + +// the original size of the reserved field in the JournalInfoBlock was +// 32*sizeof(u_int32_t). To keep the total size of the structure the +// same we subtract the size of new fields (currently: ext_jnl_uuid and +// machine_uuid). If you add additional fields, place them before the +// reserved field and subtract their size in this macro. +// +#define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48) + +typedef char uuid_string_t[37]; +struct JournalInfoBlock { + u_int32_t flags; + u_int32_t device_signature[8]; // signature used to locate our device. + u_int64_t offset; // byte offset to the journal on the device + u_int64_t size; // size in bytes of the journal + uuid_string_t ext_jnl_uuid; + char machine_serial_num[48]; + char reserved[JIB_RESERVED_SIZE]; +} __attribute__((aligned(2), packed)); +typedef struct JournalInfoBlock JournalInfoBlock; + +enum { + kJIJournalInFSMask = 0x00000001, + kJIJournalOnOtherDeviceMask = 0x00000002, + kJIJournalNeedInitMask = 0x00000004 +}; + +// +// This the content type uuid for "external journal" GPT +// partitions. Each instance of a partition also has a +// uuid that uniquely identifies that instance. +// +#define EXTJNL_CONTENT_TYPE_UUID "4A6F7572-6E61-11AA-AA11-00306543ECAC" + + +#ifdef __cplusplus +} +#endif + +#endif /* __HFS_FORMAT__ */ diff --git a/i386/include/hfs/hfs_mount.h b/i386/include/hfs/hfs_mount.h new file mode 100644 index 0000000..acad4d0 --- /dev/null +++ b/i386/include/hfs/hfs_mount.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997-2002 Apple Computer, Inc. All Rights Reserved + * + */ + +#ifndef _HFS_MOUNT_H_ +#define _HFS_MOUNT_H_ + +#include <sys/appleapiopts.h> + +#include <sys/mount.h> +#include <sys/time.h> + +/* + * Arguments to mount HFS-based filesystems + */ + +#define OVERRIDE_UNKNOWN_PERMISSIONS 0 + +#define UNKNOWNUID ((uid_t)99) +#define UNKNOWNGID ((gid_t)99) +#define UNKNOWNPERMISSIONS (S_IRWXU | S_IROTH | S_IXOTH) /* 705 */ + +#ifdef __APPLE_API_UNSTABLE +struct hfs_mount_args { + char *fspec; /* block special device to mount */ + uid_t hfs_uid; /* uid that owns hfs files (standard HFS only) */ + gid_t hfs_gid; /* gid that owns hfs files (standard HFS only) */ + mode_t hfs_mask; /* mask to be applied for hfs perms (standard HFS only) */ + u_int32_t hfs_encoding; /* encoding for this volume (standard HFS only) */ + struct timezone hfs_timezone; /* user time zone info (standard HFS only) */ + int flags; /* mounting flags, see below */ + int journal_tbuffer_size; /* size in bytes of the journal transaction buffer */ + int journal_flags; /* flags to pass to journal_open/create */ + int journal_disable; /* don't use journaling (potentially dangerous) */ +}; + +#define HFSFSMNT_NOXONFILES 0x1 /* disable execute permissions for files */ +#define HFSFSMNT_WRAPPER 0x2 /* mount HFS wrapper (if it exists) */ +#define HFSFSMNT_EXTENDED_ARGS 0x4 /* indicates new fields after "flags" are valid */ + +/* + * Sysctl values for HFS + */ +#define HFS_ENCODINGBIAS 1 /* encoding matching CJK bias */ +#define HFS_EXTEND_FS 2 +#define HFS_ENCODINGHINT 3 /* guess encoding for string */ +#define HFS_ENABLE_JOURNALING 0x082969 +#define HFS_DISABLE_JOURNALING 0x031272 +#define HFS_GET_JOURNAL_INFO 0x6a6e6c69 +#define HFS_SET_PKG_EXTENSIONS 0x121031 +#define HFS_REPLAY_JOURNAL 0x6a6e6c72 + +#endif /* __APPLE_API_UNSTABLE */ + +#endif /* ! _HFS_MOUNT_H_ */ diff --git a/i386/include/i386/.svn/all-wcprops b/i386/include/i386/.svn/all-wcprops new file mode 100644 index 0000000..11bb30f --- /dev/null +++ b/i386/include/i386/.svn/all-wcprops @@ -0,0 +1,95 @@ +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386 +END +endian.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/endian.h +END +_param.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/_param.h +END +profile.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/profile.h +END +param.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/param.h +END +_limits.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/_limits.h +END +limits.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/limits.h +END +eflags.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/eflags.h +END +setjmp.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/setjmp.h +END +vmparam.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/vmparam.h +END +_types.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/_types.h +END +types.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/types.h +END +_structs.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/_structs.h +END +signal.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/signal.h +END +fasttrap_isa.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/fasttrap_isa.h +END +user_ldt.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/i386/user_ldt.h +END diff --git a/i386/include/i386/.svn/entries b/i386/include/i386/.svn/entries new file mode 100644 index 0000000..3a0d2b3 --- /dev/null +++ b/i386/include/i386/.svn/entries @@ -0,0 +1,538 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/i386 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +endian.h +file + + + + +2013-08-27T23:54:47.000000Z +8cd959a4c84c17115fa36c998f570d56 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4314 + +_param.h +file + + + + +2013-08-27T23:54:47.000000Z +8977c612ae0030d7bba29b33cb92e5ec +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2016 + +profile.h +file + + + + +2013-08-27T23:54:47.000000Z +0917c51f01ea173f43b721f0c75fc36d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1540 + +param.h +file + + + + +2013-08-27T23:54:47.000000Z +e341641a39541e4e960c43567cc8d4e6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6458 + +_limits.h +file + + + + +2013-08-27T23:54:47.000000Z +5d12dff7aa6719cabef8c2a19e4a0624 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1069 + +limits.h +file + + + + +2013-08-27T23:54:47.000000Z +2aa74fce3167a9d013ad6c65a35cb63a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4710 + +eflags.h +file + + + + +2013-08-27T23:54:47.000000Z +5934bcdfad74509233c553feccf6c679 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3614 + +setjmp.h +file + + + + +2013-08-27T23:54:47.000000Z +596aa74d19dcebe17bd5eda69cbd004e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2649 + +vmparam.h +file + + + + +2013-08-27T23:54:47.000000Z +b9720a807c763074a955bd13acc07db3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2122 + +_types.h +file + + + + +2013-08-27T23:54:47.000000Z +4b405fb1901284a5433f49d8720654cb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4503 + +types.h +file + + + + +2013-08-27T23:54:47.000000Z +6ae42892383aabc3a28a446996d9b5ca +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4989 + +_structs.h +file + + + + +2013-08-27T23:54:47.000000Z +970988de4cc152bb9432e55679e01925 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3271 + +signal.h +file + + + + +2013-08-27T23:54:47.000000Z +ab6c2b19f227679c973c454a7150bef8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2124 + +fasttrap_isa.h +file + + + + +2013-08-27T23:54:47.000000Z +1f9d5327fd998ee5a6386b78dcec8bda +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3420 + +user_ldt.h +file + + + + +2013-08-27T23:54:47.000000Z +8a5203d3f4814a0d9a25bce8013d6596 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2750 + diff --git a/i386/include/i386/.svn/text-base/_limits.h.svn-base b/i386/include/i386/.svn/text-base/_limits.h.svn-base new file mode 100644 index 0000000..3b9e7a6 --- /dev/null +++ b/i386/include/i386/.svn/text-base/_limits.h.svn-base @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _I386__LIMITS_H_ +#define _I386__LIMITS_H_ + +#define __DARWIN_CLK_TCK 100 /* ticks per second */ + +#endif /* _I386__LIMITS_H_ */ diff --git a/i386/include/i386/.svn/text-base/_param.h.svn-base b/i386/include/i386/.svn/text-base/_param.h.svn-base new file mode 100644 index 0000000..61f0d24 --- /dev/null +++ b/i386/include/i386/.svn/text-base/_param.h.svn-base @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _I386__PARAM_H_ +#define _I386__PARAM_H_ + +#include <i386/_types.h> + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is unsigned int and must be + * cast to any desired pointer type. + */ +#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1) +#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) + +#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1) +#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32) + + +#endif /* _I386__PARAM_H_ */ diff --git a/i386/include/i386/.svn/text-base/_structs.h.svn-base b/i386/include/i386/.svn/text-base/_structs.h.svn-base new file mode 100644 index 0000000..9cad355 --- /dev/null +++ b/i386/include/i386/.svn/text-base/_structs.h.svn-base @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include <sys/appleapiopts.h> + +#ifdef __need_mcontext_t +#ifndef __need_struct_mcontext +#define __need_struct_mcontext +#endif /* __need_struct_mcontext */ +#endif /* __need_mcontext_t */ + +#if defined(__need_struct_mcontext) +#include <mach/i386/_structs.h> +#endif /* __need_struct_mcontext */ + + +#ifdef __need_struct_mcontext +#undef __need_struct_mcontext + +#ifndef _STRUCT_MCONTEXT32 +#if __DARWIN_UNIX03 +#define _STRUCT_MCONTEXT32 struct __darwin_mcontext32 +_STRUCT_MCONTEXT32 +{ + _STRUCT_X86_EXCEPTION_STATE32 __es; + _STRUCT_X86_THREAD_STATE32 __ss; + _STRUCT_X86_FLOAT_STATE32 __fs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MCONTEXT32 struct mcontext32 +_STRUCT_MCONTEXT32 +{ + _STRUCT_X86_EXCEPTION_STATE32 es; + _STRUCT_X86_THREAD_STATE32 ss; + _STRUCT_X86_FLOAT_STATE32 fs; +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* _STRUCT_MCONTEXT32 */ + +#ifndef _STRUCT_MCONTEXT64 +#if __DARWIN_UNIX03 +#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64 +_STRUCT_MCONTEXT64 +{ + _STRUCT_X86_EXCEPTION_STATE64 __es; + _STRUCT_X86_THREAD_STATE64 __ss; + _STRUCT_X86_FLOAT_STATE64 __fs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MCONTEXT64 struct mcontext64 +_STRUCT_MCONTEXT64 +{ + _STRUCT_X86_EXCEPTION_STATE64 es; + _STRUCT_X86_THREAD_STATE64 ss; + _STRUCT_X86_FLOAT_STATE64 fs; +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* _STRUCT_MCONTEXT64 */ +#endif /* __need_struct_mcontext */ + +#ifdef __need_mcontext_t +#undef __need_mcontext_t +#ifndef _MCONTEXT_T +#define _MCONTEXT_T +#if defined(__LP64__) +typedef _STRUCT_MCONTEXT64 *mcontext_t; +#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64 +#else +typedef _STRUCT_MCONTEXT32 *mcontext_t; +#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32 +#endif +#endif /* _MCONTEXT_T */ +#endif /* __need_mcontext_t */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef I386_MCONTEXT_SIZE +#define I386_MCONTEXT_SIZE sizeof(struct mcontext) +#endif /* I386_MCONTEXT_SIZE */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + diff --git a/i386/include/i386/.svn/text-base/_types.h.svn-base b/i386/include/i386/.svn/text-base/_types.h.svn-base new file mode 100644 index 0000000..67741d5 --- /dev/null +++ b/i386/include/i386/.svn/text-base/_types.h.svn-base @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_I386__TYPES_H_ +#define _BSD_I386__TYPES_H_ + +/* + * This header file contains integer types. It's intended to also contain + * flotaing point and other arithmetic types, as needed, later. + */ + +#ifdef __GNUC__ +typedef __signed char __int8_t; +#else /* !__GNUC__ */ +typedef char __int8_t; +#endif /* !__GNUC__ */ +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long long __int64_t; +typedef unsigned long long __uint64_t; + +typedef long __darwin_intptr_t; +typedef unsigned int __darwin_natural_t; + +/* + * The rune type below is declared to be an ``int'' instead of the more natural + * ``unsigned long'' or ``long''. Two things are happening here. It is not + * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, + * it looks like 10646 will be a 31 bit standard. This means that if your + * ints cannot hold 32 bits, you will be in trouble. The reason an int was + * chosen over a long is that the is*() and to*() routines take ints (says + * ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it + * here, you lose a bit of ANSI conformance, but your programs will still + * work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ + +typedef int __darwin_ct_rune_t; /* ct_rune_t */ + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + long long _mbstateL; /* for alignment */ +} __mbstate_t; + +typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */ + +#if defined(__GNUC__) && defined(__PTRDIFF_TYPE__) +typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */ +#else +typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */ +#endif /* __GNUC__ */ + +#if defined(__GNUC__) && defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */ +#else +typedef unsigned long __darwin_size_t; /* sizeof() */ +#endif + +#if (__GNUC__ > 2) +typedef __builtin_va_list __darwin_va_list; /* va_list */ +#else +typedef void * __darwin_va_list; /* va_list */ +#endif + +#if defined(__GNUC__) && defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */ +#else +typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */ +#endif + +typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */ + +#if defined(__GNUC__) && defined(__WINT_TYPE__) +typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */ +#else +typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */ +#endif + +typedef unsigned long __darwin_clock_t; /* clock() */ +typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */ +typedef long __darwin_ssize_t; /* byte count or error */ +typedef long __darwin_time_t; /* time() */ + +#endif /* _BSD_I386__TYPES_H_ */ diff --git a/i386/include/i386/.svn/text-base/eflags.h.svn-base b/i386/include/i386/.svn/text-base/eflags.h.svn-base new file mode 100644 index 0000000..9dc6478 --- /dev/null +++ b/i386/include/i386/.svn/text-base/eflags.h.svn-base @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _I386_EFLAGS_H_ +#define _I386_EFLAGS_H_ + +/* + * i386 flags register + */ + +#ifndef EFL_CF +#define EFL_CF 0x00000001 /* carry */ +#define EFL_PF 0x00000004 /* parity of low 8 bits */ +#define EFL_AF 0x00000010 /* carry out of bit 3 */ +#define EFL_ZF 0x00000040 /* zero */ +#define EFL_SF 0x00000080 /* sign */ +#define EFL_TF 0x00000100 /* trace trap */ +#define EFL_IF 0x00000200 /* interrupt enable */ +#define EFL_DF 0x00000400 /* direction */ +#define EFL_OF 0x00000800 /* overflow */ +#define EFL_IOPL 0x00003000 /* IO privilege level: */ +#define EFL_IOPL_KERNEL 0x00000000 /* kernel */ +#define EFL_IOPL_USER 0x00003000 /* user */ +#define EFL_NT 0x00004000 /* nested task */ +#define EFL_RF 0x00010000 /* resume without tracing */ +#define EFL_VM 0x00020000 /* virtual 8086 mode */ +#define EFL_AC 0x00040000 /* alignment check */ +#define EFL_VIF 0x00080000 /* virtual interrupt flag */ +#define EFL_VIP 0x00100000 /* virtual interrupt pending */ +#define EFL_ID 0x00200000 /* cpuID instruction */ +#endif + +#define EFL_CLR 0xfff88028 +#define EFL_SET 0x00000002 + +#define EFL_USER_SET (EFL_IF) +#define EFL_USER_CLEAR (EFL_IOPL|EFL_NT|EFL_RF) + +#endif /* _I386_EFLAGS_H_ */ diff --git a/i386/include/i386/.svn/text-base/endian.h.svn-base b/i386/include/i386/.svn/text-base/endian.h.svn-base new file mode 100644 index 0000000..9f64aa0 --- /dev/null +++ b/i386/include/i386/.svn/text-base/endian.h.svn-base @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +/* + * Copyright (c) 1987, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)endian.h 8.1 (Berkeley) 6/11/93 + */ + +#ifndef _I386__ENDIAN_H_ +#define _I386__ENDIAN_H_ + +#include <sys/cdefs.h> +/* + * Define _NOQUAD if the compiler does NOT support 64-bit integers. + */ +/* #define _NOQUAD */ + +/* + * Define the order of 32-bit words in 64-bit words. + */ +#define _QUAD_HIGHWORD 1 +#define _QUAD_LOWWORD 0 + +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ + +#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN + +#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +#define BIG_ENDIAN __DARWIN_BIG_ENDIAN +#define PDP_ENDIAN __DARWIN_PDP_ENDIAN + +#define BYTE_ORDER __DARWIN_BYTE_ORDER + +#include <sys/_endian.h> + +#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ +#endif /* !_I386__ENDIAN_H_ */ diff --git a/i386/include/i386/.svn/text-base/fasttrap_isa.h.svn-base b/i386/include/i386/.svn/text-base/fasttrap_isa.h.svn-base new file mode 100644 index 0000000..d51c7dd --- /dev/null +++ b/i386/include/i386/.svn/text-base/fasttrap_isa.h.svn-base @@ -0,0 +1,116 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +/* + * #pragma ident "@(#)fasttrap_isa.h 1.6 06/09/19 SMI" + */ + +#include <sys/types.h> +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define FASTTRAP_MAX_INSTR_SIZE 15 + +#define FASTTRAP_INSTR 0xcc + +#define FASTTRAP_SUNWDTRACE_SIZE 64 + +typedef uint8_t fasttrap_instr_t; + +typedef struct fasttrap_machtp { + uint8_t ftmt_instr[FASTTRAP_MAX_INSTR_SIZE]; /* orig. instr. */ + uint8_t ftmt_size; /* instruction size */ +#if __sol64 || defined(__APPLE__) + uint8_t ftmt_ripmode; /* %rip-relative handling mode */ + uint8_t ftmt_modrm; /* saved modrm byte */ +#endif + uint8_t ftmt_type; /* emulation type */ + uint8_t ftmt_code; /* branch condition */ + uint8_t ftmt_base; /* branch base */ + uint8_t ftmt_index; /* branch index */ + uint8_t ftmt_scale; /* branch scale */ + uint8_t ftmt_segment; /* segment for memory accesses */ + user_addr_t ftmt_dest; /* destination of control flow */ +} fasttrap_machtp_t; + +#define ftt_instr ftt_mtp.ftmt_instr +#if __sol64 || defined(__APPLE__) +#define ftt_ripmode ftt_mtp.ftmt_ripmode +#define ftt_modrm ftt_mtp.ftmt_modrm +#endif +#define ftt_size ftt_mtp.ftmt_size +#define ftt_type ftt_mtp.ftmt_type +#define ftt_code ftt_mtp.ftmt_code +#define ftt_base ftt_mtp.ftmt_base +#define ftt_index ftt_mtp.ftmt_index +#define ftt_scale ftt_mtp.ftmt_scale +#define ftt_segment ftt_mtp.ftmt_segment +#define ftt_dest ftt_mtp.ftmt_dest + +#define FASTTRAP_T_COMMON 0x00 /* common case -- no emulation */ +#define FASTTRAP_T_JCC 0x01 /* near and far conditional jumps */ +#define FASTTRAP_T_LOOP 0x02 /* loop instructions */ +#define FASTTRAP_T_JCXZ 0x03 /* jump if %ecx/%rcx is zero */ +#define FASTTRAP_T_JMP 0x04 /* relative jump */ +#define FASTTRAP_T_CALL 0x05 /* near call (and link) */ +#define FASTTRAP_T_RET 0x06 /* ret */ +#define FASTTRAP_T_RET16 0x07 /* ret <imm16> */ + +/* + * For performance rather than correctness. + */ +#define FASTTRAP_T_PUSHL_EBP 0x10 /* pushl %ebp (for function entry) */ +#define FASTTRAP_T_NOP 0x11 /* nop */ + +#define FASTTRAP_RIP_1 0x1 +#define FASTTRAP_RIP_2 0x2 +#define FASTTRAP_RIP_X 0x4 + +/* + * Segment values. + */ +#define FASTTRAP_SEG_NONE 0 +#define FASTTRAP_SEG_CS 1 +#define FASTTRAP_SEG_DS 2 +#define FASTTRAP_SEG_ES 3 +#define FASTTRAP_SEG_FS 4 +#define FASTTRAP_SEG_GS 5 +#define FASTTRAP_SEG_SS 6 + +#define FASTTRAP_RETURN_AFRAMES 6 +#define FASTTRAP_ENTRY_AFRAMES 5 +#define FASTTRAP_OFFSET_AFRAMES 5 + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ diff --git a/i386/include/i386/.svn/text-base/limits.h.svn-base b/i386/include/i386/.svn/text-base/limits.h.svn-base new file mode 100644 index 0000000..9ee7c03 --- /dev/null +++ b/i386/include/i386/.svn/text-base/limits.h.svn-base @@ -0,0 +1,107 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.3 (Berkeley) 1/4/94 + */ + +#ifndef _I386_LIMITS_H_ +#define _I386_LIMITS_H_ + +#include <sys/cdefs.h> +#include <i386/_limits.h> + +#define CHAR_BIT 8 /* number of bits in a char */ +#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * According to ANSI (section 2.2.4.2), the values below must be usable by + * #if preprocessing directives. Additionally, the expression must have the + * same type as would an expression that is an object of the corresponding + * type converted according to the integral promotions. The subtraction for + * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values + * are written as hex so that GCC will be quiet about large integer constants. + */ +#define SCHAR_MAX 127 /* min value for a signed char */ +#define SCHAR_MIN (-128) /* max value for a signed char */ + +#define UCHAR_MAX 255 /* max value for an unsigned char */ +#define CHAR_MAX 127 /* max value for a char */ +#define CHAR_MIN (-128) /* min value for a char */ + +#define USHRT_MAX 65535 /* max value for an unsigned short */ +#define SHRT_MAX 32767 /* max value for a short */ +#define SHRT_MIN (-32768) /* min value for a short */ + +#define UINT_MAX 0xffffffff /* max value for an unsigned int */ +#define INT_MAX 2147483647 /* max value for an int */ +#define INT_MIN (-2147483647-1) /* min value for an int */ + +#ifdef __LP64__ +#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */ +#define LONG_MAX 0x7fffffffffffffffL /* max signed long */ +#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */ +#else /* !__LP64__ */ +#define ULONG_MAX 0xffffffffUL /* max unsigned long */ +#define LONG_MAX 2147483647L /* max signed long */ +#define LONG_MIN (-2147483647L-1) /* min signed long */ +#endif /* __LP64__ */ + +#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */ +#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */ +#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */ + +#if !defined(_ANSI_SOURCE) +#ifdef __LP64__ +#define LONG_BIT 64 +#else /* !__LP64__ */ +#define LONG_BIT 32 +#endif /* __LP64__ */ +#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ +#define WORD_BIT 32 + +#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) +#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ + +#define UQUAD_MAX ULLONG_MAX +#define QUAD_MAX LLONG_MAX +#define QUAD_MIN LLONG_MIN + +#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */ +#endif /* !_ANSI_SOURCE */ + +#endif /* _I386_LIMITS_H_ */ diff --git a/i386/include/i386/.svn/text-base/param.h.svn-base b/i386/include/i386/.svn/text-base/param.h.svn-base new file mode 100644 index 0000000..03a38d2 --- /dev/null +++ b/i386/include/i386/.svn/text-base/param.h.svn-base @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)param.h 8.1 (Berkeley) 4/4/95 + */ + +/* + * Machine dependent constants for Intel 386. + */ + +#ifndef _I386_PARAM_H_ +#define _I386_PARAM_H_ + +#include <i386/_param.h> + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is unsigned int and must be + * cast to any desired pointer type. + */ +#define ALIGNBYTES __DARWIN_ALIGNBYTES +#define ALIGN(p) __DARWIN_ALIGN(p) + +#define NBPG 4096 /* bytes/page */ +#define PGOFSET (NBPG-1) /* byte offset into page */ +#define PGSHIFT 12 /* LOG2(NBPG) */ + +#define DEV_BSIZE 512 +#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ +#define BLKDEV_IOSIZE 2048 +#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ + +#define CLSIZE 1 +#define CLSIZELOG2 0 + +/* + * Constants related to network buffer management. + * MCLBYTES must be no larger than CLBYTES (the software page size), and, + * on machines that exchange pages of input or output buffers with mbuf + * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple + * of the hardware page size. + */ +#define MSIZE 256 /* size of an mbuf */ +#define MCLBYTES 2048 /* large enough for ether MTU */ +#define MCLSHIFT 11 +#define MCLOFSET (MCLBYTES - 1) +#ifndef NMBCLUSTERS +#ifdef GATEWAY +#define NMBCLUSTERS ((1024 * 1024) / MCLBYTES) /* cl map size: 1MB */ +#else +#define NMBCLUSTERS ((1024 * 512) / MCLBYTES) /* cl map size: 0.5MB */ +#endif +#endif + +/* + * Some macros for units conversion + */ +/* Core clicks (NeXT_page_size bytes) to segments and vice versa */ +#define ctos(x) (x) +#define stoc(x) (x) + +/* Core clicks (4096 bytes) to disk blocks */ +#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT)) +#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT)) +#define dtob(x) ((x)<<DEV_BSHIFT) + +/* clicks to bytes */ +#define ctob(x) ((x)<<PGSHIFT) + +/* bytes to clicks */ +#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) + +#ifdef __APPLE__ +#define btodb(bytes, devBlockSize) \ + ((unsigned)(bytes) / devBlockSize) +#define dbtob(db, devBlockSize) \ + ((unsigned)(db) * devBlockSize) +#else +#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ + ((unsigned)(bytes) >> DEV_BSHIFT) +#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ + ((unsigned)(db) << DEV_BSHIFT) +#endif + +/* + * Map a ``block device block'' to a file system block. + * This should be device dependent, and will be if we + * add an entry to cdevsw/bdevsw for that purpose. + * For now though just use DEV_BSIZE. + */ +#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE)) + +/* + * Macros to decode (and encode) processor status word. + */ +#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl)) +#define USERMODE(x) (((x) & 3) == 3) +#define BASEPRI(x) (((x) & (255 << 8)) == 0) + + +#if defined(KERNEL) || defined(STANDALONE) +#define DELAY(n) delay(n) + +#else /* defined(KERNEL) || defined(STANDALONE) */ +#define DELAY(n) { register int N = (n); while (--N > 0); } +#endif /* defined(KERNEL) || defined(STANDALONE) */ + +#endif /* _I386_PARAM_H_ */ diff --git a/i386/include/i386/.svn/text-base/profile.h.svn-base b/i386/include/i386/.svn/text-base/profile.h.svn-base new file mode 100644 index 0000000..26782f8 --- /dev/null +++ b/i386/include/i386/.svn/text-base/profile.h.svn-base @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997, Apple Computer, Inc. All rights reserved. + * + */ + +#ifndef _BSD_I386_PROFILE_H_ +#define _BSD_I386_PROFILE_H_ + +#include <sys/appleapiopts.h> + + +#endif /* _BSD_I386_PROFILE_H_ */ diff --git a/i386/include/i386/.svn/text-base/setjmp.h.svn-base b/i386/include/i386/.svn/text-base/setjmp.h.svn-base new file mode 100644 index 0000000..aff6e3c --- /dev/null +++ b/i386/include/i386/.svn/text-base/setjmp.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * File: setjmp.h + * + * Declaration of setjmp routines and data structures. + */ +#ifndef _BSD_I386_SETJMP_H +#define _BSD_I386_SETJMP_H + +#include <sys/cdefs.h> + +#if defined(__x86_64__) +/* + * _JBLEN is number of ints required to save the following: + * rflags, rip, rbp, rsp, rbx, r12, r13, r14, r15... these are 8 bytes each + * mxcsr, fp control word, sigmask... these are 4 bytes each + * add 16 ints for future expansion needs... + */ +#define _JBLEN ((9 * 2) + 3 + 16) +typedef int jmp_buf[_JBLEN]; +typedef int sigjmp_buf[_JBLEN + 1]; + +#else + +/* + * _JBLEN is number of ints required to save the following: + * eax, ebx, ecx, edx, edi, esi, ebp, esp, ss, eflags, eip, + * cs, de, es, fs, gs == 16 ints + * onstack, mask = 2 ints + */ + +#define _JBLEN (18) +typedef int jmp_buf[_JBLEN]; +typedef int sigjmp_buf[_JBLEN + 1]; + +#endif + +__BEGIN_DECLS +int setjmp(jmp_buf); +void longjmp(jmp_buf, int); + +#ifndef _ANSI_SOURCE +int _setjmp(jmp_buf); +void _longjmp(jmp_buf, int); +int sigsetjmp(sigjmp_buf, int); +void siglongjmp(sigjmp_buf, int); +#endif /* _ANSI_SOURCE */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +void longjmperror(void); +#endif /* neither ANSI nor POSIX */ +__END_DECLS +#endif /* !_BSD_I386_SETJMP_H */ diff --git a/i386/include/i386/.svn/text-base/signal.h.svn-base b/i386/include/i386/.svn/text-base/signal.h.svn-base new file mode 100644 index 0000000..8419888 --- /dev/null +++ b/i386/include/i386/.svn/text-base/signal.h.svn-base @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + */ + +#ifndef _I386_SIGNAL_H_ +#define _I386_SIGNAL_H_ 1 + +#include <sys/cdefs.h> + +#ifndef _ANSI_SOURCE +typedef int sig_atomic_t; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_OBSOLETE + +/* + * Information pushed on stack when a signal is delivered. + * This is used by the kernel to restore state following + * execution of the signal handler. It is also made available + * to the handler to allow it to properly restore state if + * a non-standard exit is performed. + */ +#define __need_struct_sigcontext +#include <i386/_structs.h> + +#endif /* __APPLE_API_OBSOLETE */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* ! _ANSI_SOURCE */ + +#endif /* _I386_SIGNAL_H_ */ + diff --git a/i386/include/i386/.svn/text-base/types.h.svn-base b/i386/include/i386/.svn/text-base/types.h.svn-base new file mode 100644 index 0000000..ef4e660 --- /dev/null +++ b/i386/include/i386/.svn/text-base/types.h.svn-base @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + */ + +#ifndef _MACHTYPES_H_ +#define _MACHTYPES_H_ + +#include <i386/types.h> + + +#ifndef __ASSEMBLER__ +#include <i386/_types.h> +#include <sys/cdefs.h> +/* + * Basic integral types. Omit the typedef if + * not possible for a machine/compiler combination. + */ +#ifndef _INT8_T +#define _INT8_T +typedef __signed char int8_t; +#endif +typedef unsigned char u_int8_t; +#ifndef _INT16_T +#define _INT16_T +typedef short int16_t; +#endif +typedef unsigned short u_int16_t; +#ifndef _INT32_T +#define _INT32_T +typedef int int32_t; +#endif +typedef unsigned int u_int32_t; +#ifndef _INT64_T +#define _INT64_T +typedef long long int64_t; +#endif +typedef unsigned long long u_int64_t; + +#if __LP64__ +typedef int64_t register_t; +#else +typedef int32_t register_t; +#endif + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef __darwin_intptr_t intptr_t; +#endif +#ifndef _UINTPTR_T +#define _UINTPTR_T +typedef unsigned long uintptr_t; +#endif + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +/* These types are used for reserving the largest possible size. */ +typedef u_int64_t user_addr_t; +typedef u_int64_t user_size_t; +typedef int64_t user_ssize_t; +typedef int64_t user_long_t; +typedef u_int64_t user_ulong_t; +typedef int64_t user_time_t; +typedef int64_t user_off_t; +#define USER_ADDR_NULL ((user_addr_t) 0) +#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr))) + + +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* This defines the size of syscall arguments after copying into the kernel: */ +typedef u_int64_t syscall_arg_t; + +#ifndef __offsetof +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif + +#endif /* __ASSEMBLER__ */ +#endif /* _MACHTYPES_H_ */ diff --git a/i386/include/i386/.svn/text-base/user_ldt.h.svn-base b/i386/include/i386/.svn/text-base/user_ldt.h.svn-base new file mode 100644 index 0000000..3b61e3f --- /dev/null +++ b/i386/include/i386/.svn/text-base/user_ldt.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + */ + +#ifndef _I386_USER_LDT_H_ +#define _I386_USER_LDT_H_ + +/* + * User LDT management. + * + * Each task may have its own LDT. + */ + +#define LDT_AUTO_ALLOC 0xffffffff + +#include <sys/cdefs.h> + +union ldt_entry; + +__BEGIN_DECLS +int i386_get_ldt(int, union ldt_entry *, int); +int i386_set_ldt(int, const union ldt_entry *, int); +__END_DECLS + +#endif /* _I386_USER_LDT_H_ */ diff --git a/i386/include/i386/.svn/text-base/vmparam.h.svn-base b/i386/include/i386/.svn/text-base/vmparam.h.svn-base new file mode 100644 index 0000000..b6389b4 --- /dev/null +++ b/i386/include/i386/.svn/text-base/vmparam.h.svn-base @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _BSD_I386_VMPARAM_H_ +#define _BSD_I386_VMPARAM_H_ 1 + +#include <sys/resource.h> + +/* Rosetta dependency on this address */ +#define USRSTACK VM_USRSTACK32 + +#define USRSTACK64 VM_USRSTACK64 + + +/* + * Virtual memory related constants, all in bytes + */ +#ifndef DFLDSIZ +#define DFLDSIZ (RLIM_INFINITY) /* initial data size limit */ +#endif +#ifndef MAXDSIZ +#define MAXDSIZ (RLIM_INFINITY) /* max data size */ +#endif +#ifndef DFLSSIZ +#define DFLSSIZ (8*1024*1024) /* initial stack size limit */ +#endif +#ifndef MAXSSIZ +#define MAXSSIZ (64*1024*1024) /* max stack size */ +#endif +#ifndef DFLCSIZ +#define DFLCSIZ (0) /* initial core size limit */ +#endif +#ifndef MAXCSIZ +#define MAXCSIZ (RLIM_INFINITY) /* max core size */ +#endif /* MAXCSIZ */ + +#endif /* _BSD_I386_VMPARAM_H_ */ diff --git a/i386/include/i386/_limits.h b/i386/include/i386/_limits.h new file mode 100644 index 0000000..3b9e7a6 --- /dev/null +++ b/i386/include/i386/_limits.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _I386__LIMITS_H_ +#define _I386__LIMITS_H_ + +#define __DARWIN_CLK_TCK 100 /* ticks per second */ + +#endif /* _I386__LIMITS_H_ */ diff --git a/i386/include/i386/_param.h b/i386/include/i386/_param.h new file mode 100644 index 0000000..61f0d24 --- /dev/null +++ b/i386/include/i386/_param.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _I386__PARAM_H_ +#define _I386__PARAM_H_ + +#include <i386/_types.h> + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is unsigned int and must be + * cast to any desired pointer type. + */ +#define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1) +#define __DARWIN_ALIGN(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES) + +#define __DARWIN_ALIGNBYTES32 (sizeof(__uint32_t) - 1) +#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32) + + +#endif /* _I386__PARAM_H_ */ diff --git a/i386/include/i386/_structs.h b/i386/include/i386/_structs.h new file mode 100644 index 0000000..9cad355 --- /dev/null +++ b/i386/include/i386/_structs.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include <sys/appleapiopts.h> + +#ifdef __need_mcontext_t +#ifndef __need_struct_mcontext +#define __need_struct_mcontext +#endif /* __need_struct_mcontext */ +#endif /* __need_mcontext_t */ + +#if defined(__need_struct_mcontext) +#include <mach/i386/_structs.h> +#endif /* __need_struct_mcontext */ + + +#ifdef __need_struct_mcontext +#undef __need_struct_mcontext + +#ifndef _STRUCT_MCONTEXT32 +#if __DARWIN_UNIX03 +#define _STRUCT_MCONTEXT32 struct __darwin_mcontext32 +_STRUCT_MCONTEXT32 +{ + _STRUCT_X86_EXCEPTION_STATE32 __es; + _STRUCT_X86_THREAD_STATE32 __ss; + _STRUCT_X86_FLOAT_STATE32 __fs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MCONTEXT32 struct mcontext32 +_STRUCT_MCONTEXT32 +{ + _STRUCT_X86_EXCEPTION_STATE32 es; + _STRUCT_X86_THREAD_STATE32 ss; + _STRUCT_X86_FLOAT_STATE32 fs; +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* _STRUCT_MCONTEXT32 */ + +#ifndef _STRUCT_MCONTEXT64 +#if __DARWIN_UNIX03 +#define _STRUCT_MCONTEXT64 struct __darwin_mcontext64 +_STRUCT_MCONTEXT64 +{ + _STRUCT_X86_EXCEPTION_STATE64 __es; + _STRUCT_X86_THREAD_STATE64 __ss; + _STRUCT_X86_FLOAT_STATE64 __fs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MCONTEXT64 struct mcontext64 +_STRUCT_MCONTEXT64 +{ + _STRUCT_X86_EXCEPTION_STATE64 es; + _STRUCT_X86_THREAD_STATE64 ss; + _STRUCT_X86_FLOAT_STATE64 fs; +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* _STRUCT_MCONTEXT64 */ +#endif /* __need_struct_mcontext */ + +#ifdef __need_mcontext_t +#undef __need_mcontext_t +#ifndef _MCONTEXT_T +#define _MCONTEXT_T +#if defined(__LP64__) +typedef _STRUCT_MCONTEXT64 *mcontext_t; +#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64 +#else +typedef _STRUCT_MCONTEXT32 *mcontext_t; +#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32 +#endif +#endif /* _MCONTEXT_T */ +#endif /* __need_mcontext_t */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef I386_MCONTEXT_SIZE +#define I386_MCONTEXT_SIZE sizeof(struct mcontext) +#endif /* I386_MCONTEXT_SIZE */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + diff --git a/i386/include/i386/_types.h b/i386/include/i386/_types.h new file mode 100644 index 0000000..67741d5 --- /dev/null +++ b/i386/include/i386/_types.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_I386__TYPES_H_ +#define _BSD_I386__TYPES_H_ + +/* + * This header file contains integer types. It's intended to also contain + * flotaing point and other arithmetic types, as needed, later. + */ + +#ifdef __GNUC__ +typedef __signed char __int8_t; +#else /* !__GNUC__ */ +typedef char __int8_t; +#endif /* !__GNUC__ */ +typedef unsigned char __uint8_t; +typedef short __int16_t; +typedef unsigned short __uint16_t; +typedef int __int32_t; +typedef unsigned int __uint32_t; +typedef long long __int64_t; +typedef unsigned long long __uint64_t; + +typedef long __darwin_intptr_t; +typedef unsigned int __darwin_natural_t; + +/* + * The rune type below is declared to be an ``int'' instead of the more natural + * ``unsigned long'' or ``long''. Two things are happening here. It is not + * unsigned so that EOF (-1) can be naturally assigned to it and used. Also, + * it looks like 10646 will be a 31 bit standard. This means that if your + * ints cannot hold 32 bits, you will be in trouble. The reason an int was + * chosen over a long is that the is*() and to*() routines take ints (says + * ANSI C), but they use __darwin_ct_rune_t instead of int. By changing it + * here, you lose a bit of ANSI conformance, but your programs will still + * work. + * + * NOTE: rune_t is not covered by ANSI nor other standards, and should not + * be instantiated outside of lib/libc/locale. Use wchar_t. wchar_t and + * rune_t must be the same type. Also wint_t must be no narrower than + * wchar_t, and should also be able to hold all members of the largest + * character set plus one extra value (WEOF). wint_t must be at least 16 bits. + */ + +typedef int __darwin_ct_rune_t; /* ct_rune_t */ + +/* + * mbstate_t is an opaque object to keep conversion state, during multibyte + * stream conversions. The content must not be referenced by user programs. + */ +typedef union { + char __mbstate8[128]; + long long _mbstateL; /* for alignment */ +} __mbstate_t; + +typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */ + +#if defined(__GNUC__) && defined(__PTRDIFF_TYPE__) +typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */ +#else +typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */ +#endif /* __GNUC__ */ + +#if defined(__GNUC__) && defined(__SIZE_TYPE__) +typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */ +#else +typedef unsigned long __darwin_size_t; /* sizeof() */ +#endif + +#if (__GNUC__ > 2) +typedef __builtin_va_list __darwin_va_list; /* va_list */ +#else +typedef void * __darwin_va_list; /* va_list */ +#endif + +#if defined(__GNUC__) && defined(__WCHAR_TYPE__) +typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */ +#else +typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */ +#endif + +typedef __darwin_wchar_t __darwin_rune_t; /* rune_t */ + +#if defined(__GNUC__) && defined(__WINT_TYPE__) +typedef __WINT_TYPE__ __darwin_wint_t; /* wint_t */ +#else +typedef __darwin_ct_rune_t __darwin_wint_t; /* wint_t */ +#endif + +typedef unsigned long __darwin_clock_t; /* clock() */ +typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */ +typedef long __darwin_ssize_t; /* byte count or error */ +typedef long __darwin_time_t; /* time() */ + +#endif /* _BSD_I386__TYPES_H_ */ diff --git a/i386/include/i386/eflags.h b/i386/include/i386/eflags.h new file mode 100644 index 0000000..9dc6478 --- /dev/null +++ b/i386/include/i386/eflags.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _I386_EFLAGS_H_ +#define _I386_EFLAGS_H_ + +/* + * i386 flags register + */ + +#ifndef EFL_CF +#define EFL_CF 0x00000001 /* carry */ +#define EFL_PF 0x00000004 /* parity of low 8 bits */ +#define EFL_AF 0x00000010 /* carry out of bit 3 */ +#define EFL_ZF 0x00000040 /* zero */ +#define EFL_SF 0x00000080 /* sign */ +#define EFL_TF 0x00000100 /* trace trap */ +#define EFL_IF 0x00000200 /* interrupt enable */ +#define EFL_DF 0x00000400 /* direction */ +#define EFL_OF 0x00000800 /* overflow */ +#define EFL_IOPL 0x00003000 /* IO privilege level: */ +#define EFL_IOPL_KERNEL 0x00000000 /* kernel */ +#define EFL_IOPL_USER 0x00003000 /* user */ +#define EFL_NT 0x00004000 /* nested task */ +#define EFL_RF 0x00010000 /* resume without tracing */ +#define EFL_VM 0x00020000 /* virtual 8086 mode */ +#define EFL_AC 0x00040000 /* alignment check */ +#define EFL_VIF 0x00080000 /* virtual interrupt flag */ +#define EFL_VIP 0x00100000 /* virtual interrupt pending */ +#define EFL_ID 0x00200000 /* cpuID instruction */ +#endif + +#define EFL_CLR 0xfff88028 +#define EFL_SET 0x00000002 + +#define EFL_USER_SET (EFL_IF) +#define EFL_USER_CLEAR (EFL_IOPL|EFL_NT|EFL_RF) + +#endif /* _I386_EFLAGS_H_ */ diff --git a/i386/include/i386/endian.h b/i386/include/i386/endian.h new file mode 100644 index 0000000..9f64aa0 --- /dev/null +++ b/i386/include/i386/endian.h @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +/* + * Copyright (c) 1987, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)endian.h 8.1 (Berkeley) 6/11/93 + */ + +#ifndef _I386__ENDIAN_H_ +#define _I386__ENDIAN_H_ + +#include <sys/cdefs.h> +/* + * Define _NOQUAD if the compiler does NOT support 64-bit integers. + */ +/* #define _NOQUAD */ + +/* + * Define the order of 32-bit words in 64-bit words. + */ +#define _QUAD_HIGHWORD 1 +#define _QUAD_LOWWORD 0 + +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ + +#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN + +#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) + +#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN +#define BIG_ENDIAN __DARWIN_BIG_ENDIAN +#define PDP_ENDIAN __DARWIN_PDP_ENDIAN + +#define BYTE_ORDER __DARWIN_BYTE_ORDER + +#include <sys/_endian.h> + +#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ +#endif /* !_I386__ENDIAN_H_ */ diff --git a/i386/include/i386/fasttrap_isa.h b/i386/include/i386/fasttrap_isa.h new file mode 100644 index 0000000..d51c7dd --- /dev/null +++ b/i386/include/i386/fasttrap_isa.h @@ -0,0 +1,116 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_ISA_H +#define _FASTTRAP_ISA_H + +/* + * #pragma ident "@(#)fasttrap_isa.h 1.6 06/09/19 SMI" + */ + +#include <sys/types.h> +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define FASTTRAP_MAX_INSTR_SIZE 15 + +#define FASTTRAP_INSTR 0xcc + +#define FASTTRAP_SUNWDTRACE_SIZE 64 + +typedef uint8_t fasttrap_instr_t; + +typedef struct fasttrap_machtp { + uint8_t ftmt_instr[FASTTRAP_MAX_INSTR_SIZE]; /* orig. instr. */ + uint8_t ftmt_size; /* instruction size */ +#if __sol64 || defined(__APPLE__) + uint8_t ftmt_ripmode; /* %rip-relative handling mode */ + uint8_t ftmt_modrm; /* saved modrm byte */ +#endif + uint8_t ftmt_type; /* emulation type */ + uint8_t ftmt_code; /* branch condition */ + uint8_t ftmt_base; /* branch base */ + uint8_t ftmt_index; /* branch index */ + uint8_t ftmt_scale; /* branch scale */ + uint8_t ftmt_segment; /* segment for memory accesses */ + user_addr_t ftmt_dest; /* destination of control flow */ +} fasttrap_machtp_t; + +#define ftt_instr ftt_mtp.ftmt_instr +#if __sol64 || defined(__APPLE__) +#define ftt_ripmode ftt_mtp.ftmt_ripmode +#define ftt_modrm ftt_mtp.ftmt_modrm +#endif +#define ftt_size ftt_mtp.ftmt_size +#define ftt_type ftt_mtp.ftmt_type +#define ftt_code ftt_mtp.ftmt_code +#define ftt_base ftt_mtp.ftmt_base +#define ftt_index ftt_mtp.ftmt_index +#define ftt_scale ftt_mtp.ftmt_scale +#define ftt_segment ftt_mtp.ftmt_segment +#define ftt_dest ftt_mtp.ftmt_dest + +#define FASTTRAP_T_COMMON 0x00 /* common case -- no emulation */ +#define FASTTRAP_T_JCC 0x01 /* near and far conditional jumps */ +#define FASTTRAP_T_LOOP 0x02 /* loop instructions */ +#define FASTTRAP_T_JCXZ 0x03 /* jump if %ecx/%rcx is zero */ +#define FASTTRAP_T_JMP 0x04 /* relative jump */ +#define FASTTRAP_T_CALL 0x05 /* near call (and link) */ +#define FASTTRAP_T_RET 0x06 /* ret */ +#define FASTTRAP_T_RET16 0x07 /* ret <imm16> */ + +/* + * For performance rather than correctness. + */ +#define FASTTRAP_T_PUSHL_EBP 0x10 /* pushl %ebp (for function entry) */ +#define FASTTRAP_T_NOP 0x11 /* nop */ + +#define FASTTRAP_RIP_1 0x1 +#define FASTTRAP_RIP_2 0x2 +#define FASTTRAP_RIP_X 0x4 + +/* + * Segment values. + */ +#define FASTTRAP_SEG_NONE 0 +#define FASTTRAP_SEG_CS 1 +#define FASTTRAP_SEG_DS 2 +#define FASTTRAP_SEG_ES 3 +#define FASTTRAP_SEG_FS 4 +#define FASTTRAP_SEG_GS 5 +#define FASTTRAP_SEG_SS 6 + +#define FASTTRAP_RETURN_AFRAMES 6 +#define FASTTRAP_ENTRY_AFRAMES 5 +#define FASTTRAP_OFFSET_AFRAMES 5 + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_ISA_H */ diff --git a/i386/include/i386/limits.h b/i386/include/i386/limits.h new file mode 100644 index 0000000..9ee7c03 --- /dev/null +++ b/i386/include/i386/limits.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.3 (Berkeley) 1/4/94 + */ + +#ifndef _I386_LIMITS_H_ +#define _I386_LIMITS_H_ + +#include <sys/cdefs.h> +#include <i386/_limits.h> + +#define CHAR_BIT 8 /* number of bits in a char */ +#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define CLK_TCK __DARWIN_CLK_TCK /* ticks per second */ +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * According to ANSI (section 2.2.4.2), the values below must be usable by + * #if preprocessing directives. Additionally, the expression must have the + * same type as would an expression that is an object of the corresponding + * type converted according to the integral promotions. The subtraction for + * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an + * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). + * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values + * are written as hex so that GCC will be quiet about large integer constants. + */ +#define SCHAR_MAX 127 /* min value for a signed char */ +#define SCHAR_MIN (-128) /* max value for a signed char */ + +#define UCHAR_MAX 255 /* max value for an unsigned char */ +#define CHAR_MAX 127 /* max value for a char */ +#define CHAR_MIN (-128) /* min value for a char */ + +#define USHRT_MAX 65535 /* max value for an unsigned short */ +#define SHRT_MAX 32767 /* max value for a short */ +#define SHRT_MIN (-32768) /* min value for a short */ + +#define UINT_MAX 0xffffffff /* max value for an unsigned int */ +#define INT_MAX 2147483647 /* max value for an int */ +#define INT_MIN (-2147483647-1) /* min value for an int */ + +#ifdef __LP64__ +#define ULONG_MAX 0xffffffffffffffffUL /* max unsigned long */ +#define LONG_MAX 0x7fffffffffffffffL /* max signed long */ +#define LONG_MIN (-0x7fffffffffffffffL-1) /* min signed long */ +#else /* !__LP64__ */ +#define ULONG_MAX 0xffffffffUL /* max unsigned long */ +#define LONG_MAX 2147483647L /* max signed long */ +#define LONG_MIN (-2147483647L-1) /* min signed long */ +#endif /* __LP64__ */ + +#define ULLONG_MAX 0xffffffffffffffffULL /* max unsigned long long */ +#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */ +#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */ + +#if !defined(_ANSI_SOURCE) +#ifdef __LP64__ +#define LONG_BIT 64 +#else /* !__LP64__ */ +#define LONG_BIT 32 +#endif /* __LP64__ */ +#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ +#define WORD_BIT 32 + +#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) +#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ + +#define UQUAD_MAX ULLONG_MAX +#define QUAD_MAX LLONG_MAX +#define QUAD_MIN LLONG_MIN + +#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */ +#endif /* !_ANSI_SOURCE */ + +#endif /* _I386_LIMITS_H_ */ diff --git a/i386/include/i386/param.h b/i386/include/i386/param.h new file mode 100644 index 0000000..03a38d2 --- /dev/null +++ b/i386/include/i386/param.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)param.h 8.1 (Berkeley) 4/4/95 + */ + +/* + * Machine dependent constants for Intel 386. + */ + +#ifndef _I386_PARAM_H_ +#define _I386_PARAM_H_ + +#include <i386/_param.h> + +/* + * Round p (pointer or byte index) up to a correctly-aligned value for all + * data types (int, long, ...). The result is unsigned int and must be + * cast to any desired pointer type. + */ +#define ALIGNBYTES __DARWIN_ALIGNBYTES +#define ALIGN(p) __DARWIN_ALIGN(p) + +#define NBPG 4096 /* bytes/page */ +#define PGOFSET (NBPG-1) /* byte offset into page */ +#define PGSHIFT 12 /* LOG2(NBPG) */ + +#define DEV_BSIZE 512 +#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ +#define BLKDEV_IOSIZE 2048 +#define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ + +#define CLSIZE 1 +#define CLSIZELOG2 0 + +/* + * Constants related to network buffer management. + * MCLBYTES must be no larger than CLBYTES (the software page size), and, + * on machines that exchange pages of input or output buffers with mbuf + * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple + * of the hardware page size. + */ +#define MSIZE 256 /* size of an mbuf */ +#define MCLBYTES 2048 /* large enough for ether MTU */ +#define MCLSHIFT 11 +#define MCLOFSET (MCLBYTES - 1) +#ifndef NMBCLUSTERS +#ifdef GATEWAY +#define NMBCLUSTERS ((1024 * 1024) / MCLBYTES) /* cl map size: 1MB */ +#else +#define NMBCLUSTERS ((1024 * 512) / MCLBYTES) /* cl map size: 0.5MB */ +#endif +#endif + +/* + * Some macros for units conversion + */ +/* Core clicks (NeXT_page_size bytes) to segments and vice versa */ +#define ctos(x) (x) +#define stoc(x) (x) + +/* Core clicks (4096 bytes) to disk blocks */ +#define ctod(x) ((x)<<(PGSHIFT-DEV_BSHIFT)) +#define dtoc(x) ((x)>>(PGSHIFT-DEV_BSHIFT)) +#define dtob(x) ((x)<<DEV_BSHIFT) + +/* clicks to bytes */ +#define ctob(x) ((x)<<PGSHIFT) + +/* bytes to clicks */ +#define btoc(x) (((unsigned)(x)+(NBPG-1))>>PGSHIFT) + +#ifdef __APPLE__ +#define btodb(bytes, devBlockSize) \ + ((unsigned)(bytes) / devBlockSize) +#define dbtob(db, devBlockSize) \ + ((unsigned)(db) * devBlockSize) +#else +#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ + ((unsigned)(bytes) >> DEV_BSHIFT) +#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ + ((unsigned)(db) << DEV_BSHIFT) +#endif + +/* + * Map a ``block device block'' to a file system block. + * This should be device dependent, and will be if we + * add an entry to cdevsw/bdevsw for that purpose. + * For now though just use DEV_BSIZE. + */ +#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE)) + +/* + * Macros to decode (and encode) processor status word. + */ +#define STATUS_WORD(rpl, ipl) (((ipl) << 8) | (rpl)) +#define USERMODE(x) (((x) & 3) == 3) +#define BASEPRI(x) (((x) & (255 << 8)) == 0) + + +#if defined(KERNEL) || defined(STANDALONE) +#define DELAY(n) delay(n) + +#else /* defined(KERNEL) || defined(STANDALONE) */ +#define DELAY(n) { register int N = (n); while (--N > 0); } +#endif /* defined(KERNEL) || defined(STANDALONE) */ + +#endif /* _I386_PARAM_H_ */ diff --git a/i386/include/i386/profile.h b/i386/include/i386/profile.h new file mode 100644 index 0000000..26782f8 --- /dev/null +++ b/i386/include/i386/profile.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1997, Apple Computer, Inc. All rights reserved. + * + */ + +#ifndef _BSD_I386_PROFILE_H_ +#define _BSD_I386_PROFILE_H_ + +#include <sys/appleapiopts.h> + + +#endif /* _BSD_I386_PROFILE_H_ */ diff --git a/i386/include/i386/setjmp.h b/i386/include/i386/setjmp.h new file mode 100644 index 0000000..aff6e3c --- /dev/null +++ b/i386/include/i386/setjmp.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. + * + * File: setjmp.h + * + * Declaration of setjmp routines and data structures. + */ +#ifndef _BSD_I386_SETJMP_H +#define _BSD_I386_SETJMP_H + +#include <sys/cdefs.h> + +#if defined(__x86_64__) +/* + * _JBLEN is number of ints required to save the following: + * rflags, rip, rbp, rsp, rbx, r12, r13, r14, r15... these are 8 bytes each + * mxcsr, fp control word, sigmask... these are 4 bytes each + * add 16 ints for future expansion needs... + */ +#define _JBLEN ((9 * 2) + 3 + 16) +typedef int jmp_buf[_JBLEN]; +typedef int sigjmp_buf[_JBLEN + 1]; + +#else + +/* + * _JBLEN is number of ints required to save the following: + * eax, ebx, ecx, edx, edi, esi, ebp, esp, ss, eflags, eip, + * cs, de, es, fs, gs == 16 ints + * onstack, mask = 2 ints + */ + +#define _JBLEN (18) +typedef int jmp_buf[_JBLEN]; +typedef int sigjmp_buf[_JBLEN + 1]; + +#endif + +__BEGIN_DECLS +int setjmp(jmp_buf); +void longjmp(jmp_buf, int); + +#ifndef _ANSI_SOURCE +int _setjmp(jmp_buf); +void _longjmp(jmp_buf, int); +int sigsetjmp(sigjmp_buf, int); +void siglongjmp(sigjmp_buf, int); +#endif /* _ANSI_SOURCE */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +void longjmperror(void); +#endif /* neither ANSI nor POSIX */ +__END_DECLS +#endif /* !_BSD_I386_SETJMP_H */ diff --git a/i386/include/i386/signal.h b/i386/include/i386/signal.h new file mode 100644 index 0000000..8419888 --- /dev/null +++ b/i386/include/i386/signal.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + */ + +#ifndef _I386_SIGNAL_H_ +#define _I386_SIGNAL_H_ 1 + +#include <sys/cdefs.h> + +#ifndef _ANSI_SOURCE +typedef int sig_atomic_t; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_OBSOLETE + +/* + * Information pushed on stack when a signal is delivered. + * This is used by the kernel to restore state following + * execution of the signal handler. It is also made available + * to the handler to allow it to properly restore state if + * a non-standard exit is performed. + */ +#define __need_struct_sigcontext +#include <i386/_structs.h> + +#endif /* __APPLE_API_OBSOLETE */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* ! _ANSI_SOURCE */ + +#endif /* _I386_SIGNAL_H_ */ + diff --git a/i386/include/i386/types.h b/i386/include/i386/types.h new file mode 100644 index 0000000..ef4e660 --- /dev/null +++ b/i386/include/i386/types.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +/* + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.3 (Berkeley) 1/5/94 + */ + +#ifndef _MACHTYPES_H_ +#define _MACHTYPES_H_ + +#include <i386/types.h> + + +#ifndef __ASSEMBLER__ +#include <i386/_types.h> +#include <sys/cdefs.h> +/* + * Basic integral types. Omit the typedef if + * not possible for a machine/compiler combination. + */ +#ifndef _INT8_T +#define _INT8_T +typedef __signed char int8_t; +#endif +typedef unsigned char u_int8_t; +#ifndef _INT16_T +#define _INT16_T +typedef short int16_t; +#endif +typedef unsigned short u_int16_t; +#ifndef _INT32_T +#define _INT32_T +typedef int int32_t; +#endif +typedef unsigned int u_int32_t; +#ifndef _INT64_T +#define _INT64_T +typedef long long int64_t; +#endif +typedef unsigned long long u_int64_t; + +#if __LP64__ +typedef int64_t register_t; +#else +typedef int32_t register_t; +#endif + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef __darwin_intptr_t intptr_t; +#endif +#ifndef _UINTPTR_T +#define _UINTPTR_T +typedef unsigned long uintptr_t; +#endif + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +/* These types are used for reserving the largest possible size. */ +typedef u_int64_t user_addr_t; +typedef u_int64_t user_size_t; +typedef int64_t user_ssize_t; +typedef int64_t user_long_t; +typedef u_int64_t user_ulong_t; +typedef int64_t user_time_t; +typedef int64_t user_off_t; +#define USER_ADDR_NULL ((user_addr_t) 0) +#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr))) + + +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* This defines the size of syscall arguments after copying into the kernel: */ +typedef u_int64_t syscall_arg_t; + +#ifndef __offsetof +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif + +#endif /* __ASSEMBLER__ */ +#endif /* _MACHTYPES_H_ */ diff --git a/i386/include/i386/user_ldt.h b/i386/include/i386/user_ldt.h new file mode 100644 index 0000000..3b61e3f --- /dev/null +++ b/i386/include/i386/user_ldt.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + */ + +#ifndef _I386_USER_LDT_H_ +#define _I386_USER_LDT_H_ + +/* + * User LDT management. + * + * Each task may have its own LDT. + */ + +#define LDT_AUTO_ALLOC 0xffffffff + +#include <sys/cdefs.h> + +union ldt_entry; + +__BEGIN_DECLS +int i386_get_ldt(int, union ldt_entry *, int); +int i386_set_ldt(int, const union ldt_entry *, int); +__END_DECLS + +#endif /* _I386_USER_LDT_H_ */ diff --git a/i386/include/i386/vmparam.h b/i386/include/i386/vmparam.h new file mode 100644 index 0000000..b6389b4 --- /dev/null +++ b/i386/include/i386/vmparam.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _BSD_I386_VMPARAM_H_ +#define _BSD_I386_VMPARAM_H_ 1 + +#include <sys/resource.h> + +/* Rosetta dependency on this address */ +#define USRSTACK VM_USRSTACK32 + +#define USRSTACK64 VM_USRSTACK64 + + +/* + * Virtual memory related constants, all in bytes + */ +#ifndef DFLDSIZ +#define DFLDSIZ (RLIM_INFINITY) /* initial data size limit */ +#endif +#ifndef MAXDSIZ +#define MAXDSIZ (RLIM_INFINITY) /* max data size */ +#endif +#ifndef DFLSSIZ +#define DFLSSIZ (8*1024*1024) /* initial stack size limit */ +#endif +#ifndef MAXSSIZ +#define MAXSSIZ (64*1024*1024) /* max stack size */ +#endif +#ifndef DFLCSIZ +#define DFLCSIZ (0) /* initial core size limit */ +#endif +#ifndef MAXCSIZ +#define MAXCSIZ (RLIM_INFINITY) /* max core size */ +#endif /* MAXCSIZ */ + +#endif /* _BSD_I386_VMPARAM_H_ */ diff --git a/i386/include/inttypes.h b/i386/include/inttypes.h new file mode 100644 index 0000000..4f9dd8d --- /dev/null +++ b/i386/include/inttypes.h @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2000, 2001, 2002, 2003, 2004 Apple Computer, Inc. + * All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * <inttypes.h> -- Standard C header, defined in ISO/IEC 9899:1999 + * (aka "C99"), section 7.8. This defines format string conversion + * specifiers suitable for use within arguments to fprintf and fscanf + * and their ilk. + */ + +/* "C++ implementations should define these macros only when + * __STDC_FORMAT_MACROS is defined before <inttypes.h> is included." + */ +#if (!defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)) && !defined(__STDC_FORMAT_MACROS_DEFINED) +#define __STDC_FORMAT_MACROS_DEFINED + +# undef __PRI_8_LENGTH_MODIFIER__ +# undef __PRI_64_LENGTH_MODIFIER__ +# undef __SCN_64_LENGTH_MODIFIER__ + +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 > 1020 +# define __PRI_8_LENGTH_MODIFIER__ "hh" +# define __PRI_64_LENGTH_MODIFIER__ "ll" +# define __SCN_64_LENGTH_MODIFIER__ "ll" +# else +/* These could be "hh", "ll", and "ll" respectively, but that doesn't work on + 10.2, and these do. Note that there's no way to use scanf to scan a + decimal into a 'char' argument on 10.2, so "hh" is used unconditionally + and programs that use it won't work on Jaguar. */ +# define __PRI_8_LENGTH_MODIFIER__ "" /* none */ +# define __PRI_64_LENGTH_MODIFIER__ "q" +# define __SCN_64_LENGTH_MODIFIER__ "q" +# endif +# define __PRI_MAX_LENGTH_MODIFIER__ "j" +# define __SCN_MAX_LENGTH_MODIFIER__ "j" + +# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d" +# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x" +# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X" + +# define PRId16 "hd" +# define PRIi16 "hi" +# define PRIo16 "ho" +# define PRIu16 "hu" +# define PRIx16 "hx" +# define PRIX16 "hX" + +# define PRId32 "d" +# define PRIi32 "i" +# define PRIo32 "o" +# define PRIu32 "u" +# define PRIx32 "x" +# define PRIX32 "X" + +# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d" +# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i" +# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o" +# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u" +# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x" +# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X" + +# define PRIdLEAST8 PRId8 +# define PRIiLEAST8 PRIi8 +# define PRIoLEAST8 PRIo8 +# define PRIuLEAST8 PRIu8 +# define PRIxLEAST8 PRIx8 +# define PRIXLEAST8 PRIX8 + +# define PRIdLEAST16 PRId16 +# define PRIiLEAST16 PRIi16 +# define PRIoLEAST16 PRIo16 +# define PRIuLEAST16 PRIu16 +# define PRIxLEAST16 PRIx16 +# define PRIXLEAST16 PRIX16 + +# define PRIdLEAST32 PRId32 +# define PRIiLEAST32 PRIi32 +# define PRIoLEAST32 PRIo32 +# define PRIuLEAST32 PRIu32 +# define PRIxLEAST32 PRIx32 +# define PRIXLEAST32 PRIX32 + +# define PRIdLEAST64 PRId64 +# define PRIiLEAST64 PRIi64 +# define PRIoLEAST64 PRIo64 +# define PRIuLEAST64 PRIu64 +# define PRIxLEAST64 PRIx64 +# define PRIXLEAST64 PRIX64 + +# define PRIdFAST8 PRId8 +# define PRIiFAST8 PRIi8 +# define PRIoFAST8 PRIo8 +# define PRIuFAST8 PRIu8 +# define PRIxFAST8 PRIx8 +# define PRIXFAST8 PRIX8 + +# define PRIdFAST16 PRId16 +# define PRIiFAST16 PRIi16 +# define PRIoFAST16 PRIo16 +# define PRIuFAST16 PRIu16 +# define PRIxFAST16 PRIx16 +# define PRIXFAST16 PRIX16 + +# define PRIdFAST32 PRId32 +# define PRIiFAST32 PRIi32 +# define PRIoFAST32 PRIo32 +# define PRIuFAST32 PRIu32 +# define PRIxFAST32 PRIx32 +# define PRIXFAST32 PRIX32 + +# define PRIdFAST64 PRId64 +# define PRIiFAST64 PRIi64 +# define PRIoFAST64 PRIo64 +# define PRIuFAST64 PRIu64 +# define PRIxFAST64 PRIx64 +# define PRIXFAST64 PRIX64 + +/* int32_t is 'int', but intptr_t is 'long'. */ +# define PRIdPTR "ld" +# define PRIiPTR "li" +# define PRIoPTR "lo" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +# define PRIXPTR "lX" + +# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d" +# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i" +# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o" +# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u" +# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x" +# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X" + +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 > 1020 +# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d" +# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i" +# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o" +# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u" +# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x" +# else +# define SCNd8 "hhd" +# define SCNi8 "hhi" +# define SCNo8 "hho" +# define SCNu8 "hhu" +# define SCNx8 "hhx" +# endif + +# define SCNd16 "hd" +# define SCNi16 "hi" +# define SCNo16 "ho" +# define SCNu16 "hu" +# define SCNx16 "hx" + +# define SCNd32 "d" +# define SCNi32 "i" +# define SCNo32 "o" +# define SCNu32 "u" +# define SCNx32 "x" + +# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d" +# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i" +# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o" +# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u" +# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x" + +# define SCNdLEAST8 SCNd8 +# define SCNiLEAST8 SCNi8 +# define SCNoLEAST8 SCNo8 +# define SCNuLEAST8 SCNu8 +# define SCNxLEAST8 SCNx8 + +# define SCNdLEAST16 SCNd16 +# define SCNiLEAST16 SCNi16 +# define SCNoLEAST16 SCNo16 +# define SCNuLEAST16 SCNu16 +# define SCNxLEAST16 SCNx16 + +# define SCNdLEAST32 SCNd32 +# define SCNiLEAST32 SCNi32 +# define SCNoLEAST32 SCNo32 +# define SCNuLEAST32 SCNu32 +# define SCNxLEAST32 SCNx32 + +# define SCNdLEAST64 SCNd64 +# define SCNiLEAST64 SCNi64 +# define SCNoLEAST64 SCNo64 +# define SCNuLEAST64 SCNu64 +# define SCNxLEAST64 SCNx64 + +# define SCNdFAST8 SCNd8 +# define SCNiFAST8 SCNi8 +# define SCNoFAST8 SCNo8 +# define SCNuFAST8 SCNu8 +# define SCNxFAST8 SCNx8 + +# define SCNdFAST16 SCNd16 +# define SCNiFAST16 SCNi16 +# define SCNoFAST16 SCNo16 +# define SCNuFAST16 SCNu16 +# define SCNxFAST16 SCNx16 + +# define SCNdFAST32 SCNd32 +# define SCNiFAST32 SCNi32 +# define SCNoFAST32 SCNo32 +# define SCNuFAST32 SCNu32 +# define SCNxFAST32 SCNx32 + +# define SCNdFAST64 SCNd64 +# define SCNiFAST64 SCNi64 +# define SCNoFAST64 SCNo64 +# define SCNuFAST64 SCNu64 +# define SCNxFAST64 SCNx64 + +# define SCNdPTR "ld" +# define SCNiPTR "li" +# define SCNoPTR "lo" +# define SCNuPTR "lu" +# define SCNxPTR "lx" + +# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d" +# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i" +# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o" +# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u" +# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x" + +#endif /* if C++, then __STDC_FORMAT_MACROS enables the above macros */ + +#if !defined(_INTTYPES_H_) +#define _INTTYPES_H_ + +#include <sys/cdefs.h> /* For __BEGIN_DECLS and __END_DECLS */ +#include <_types.h> /* For __darwin_wchar_t */ +#include <stdint.h> + +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) + /* Translator is not ISO/IEC 9899:1999-compliant. */ +# if !defined(restrict) +# define restrict +# define __RESTRICT_KEYWORD_DEFINED__ +# endif +#endif + +__BEGIN_DECLS + + /* 7.8.2.1 */ + extern intmax_t imaxabs(intmax_t j); + + /* 7.8.2.2 */ + typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + + extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); + + /* 7.8.2.3 */ + extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base); + extern uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base); + +#ifndef __cplusplus /* wchar_t is a built-in type in C++ */ +# ifndef _WCHAR_T +# define _WCHAR_T + typedef __darwin_wchar_t wchar_t; +# endif /* _WCHAR_T */ +#endif /* __cplusplus */ + + /* 7.8.2.4 */ + extern intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); + extern uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison wcstoimax wcstoumax +#endif + +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include <xlocale/_inttypes.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +/* + No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros; + in fact, you can't #undef them, because later uses of any of + their dependents will *not* then do the intended substitution. + Expansion of a #define like this one: + + #define x IDENT y + + uses the cpp value of IDENT at the location where x is *expanded*, + not where it is #defined. +*/ + +#if defined(__RESTRICT_KEYWORD_DEFINED__) +# undef restrict +# undef __RESTRICT_KEYWORD_DEFINED__ +#endif + +#endif /* !_INTTYPES_H_ */ diff --git a/i386/include/klibc/.svn/all-wcprops b/i386/include/klibc/.svn/all-wcprops new file mode 100644 index 0000000..d9b2a07 --- /dev/null +++ b/i386/include/klibc/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/klibc +END +compiler.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/klibc/compiler.h +END diff --git a/i386/include/klibc/.svn/entries b/i386/include/klibc/.svn/entries new file mode 100644 index 0000000..3819349 --- /dev/null +++ b/i386/include/klibc/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/klibc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +compiler.h +file + + + + +2013-08-27T23:54:33.000000Z +1dc58c2dba6e0857998a2343184099d1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4221 + diff --git a/i386/include/klibc/.svn/text-base/compiler.h.svn-base b/i386/include/klibc/.svn/text-base/compiler.h.svn-base new file mode 100644 index 0000000..ff5a006 --- /dev/null +++ b/i386/include/klibc/.svn/text-base/compiler.h.svn-base @@ -0,0 +1,158 @@ +/* + * klibc/compiler.h + * + * Various compiler features + */ + +#ifndef _KLIBC_COMPILER_H +#define _KLIBC_COMPILER_H + +/* Specific calling conventions */ +/* __cdecl is used when we want varadic and non-varadic functions to have + the same binary calling convention. */ +#ifdef __i386__ +# ifdef __GNUC__ +# define __cdecl __attribute__((cdecl,regparm(0))) +# else + /* Most other C compilers have __cdecl as a keyword */ +# endif +#else +# define __cdecl /* Meaningless on non-i386 */ +#endif + +/* + * How to declare a function which should be inlined or instantiated locally + */ +#ifdef __GNUC__ +# ifdef __GNUC_STDC_INLINE__ +# define __static_inline static __inline__ __attribute__((__gnu_inline__)) +# else +# define __static_inline static __inline__ +# endif +#else +# define __static_inline inline /* Just hope this works... */ +#endif + +/* + * How to declare a function which should be inlined or have a call to + * an external module + */ +#ifdef __GNUC__ +# ifdef __GNUC_STDC_INLINE__ +# define __extern_inline extern __inline__ __attribute__((__gnu_inline__)) +# else +# define __extern_inline extern __inline__ +# endif +#else +# define __extern_inline inline /* Just hope this works... */ +#endif + +/* How to declare a function that *must* be inlined */ +/* Use "extern inline" even in the gcc3+ case to avoid warnings in ctype.h */ +#ifdef __GNUC__ +# if __GNUC__ >= 3 +# define __must_inline __extern_inline __attribute__((__always_inline__)) +# else +# define __must_inline extern __inline__ +# endif +#else +# define __must_inline inline /* Just hope this works... */ +#endif + +/* How to declare a function that does not return */ +#ifdef __GNUC__ +# define __noreturn void __attribute__((noreturn)) +#else +# define __noreturn void +#endif + +/* "const" function: + + Many functions do not examine any values except their arguments, + and have no effects except the return value. Basically this is + just slightly more strict class than the `pure' attribute above, + since function is not allowed to read global memory. + + Note that a function that has pointer arguments and examines the + data pointed to must _not_ be declared `const'. Likewise, a + function that calls a non-`const' function usually must not be + `const'. It does not make sense for a `const' function to return + `void'. +*/ +#ifdef __GNUC__ +# define __constfunc __attribute__((const)) +#else +# define __constfunc +#endif +#undef __attribute_const__ +#define __attribute_const__ __constfunc + +/* "pure" function: + + Many functions have no effects except the return value and their + return value depends only on the parameters and/or global + variables. Such a function can be subject to common subexpression + elimination and loop optimization just as an arithmetic operator + would be. These functions should be declared with the attribute + `pure'. +*/ +#ifdef __GNUC__ +# define __purefunc __attribute__((pure)) +#else +# define __purefunc +#endif +#undef __attribute_pure__ +#define __attribute_pure__ __purefunc + +/* Format attribute */ +#ifdef __GNUC__ +# define __formatfunc(t,f,a) __attribute__((format(t,f,a))) +#else +# define __formatfunc(t,f,a) +#endif + +/* malloc() function (returns unaliased pointer) */ +#if defined(__GNUC__) && (__GNUC__ >= 3) +# define __mallocfunc __attribute__((malloc)) +#else +# define __mallocfunc +#endif + +/* likely/unlikely */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) +# define __likely(x) __builtin_expect(!!(x), 1) +# define __unlikely(x) __builtin_expect(!!(x), 0) +#else +# define __likely(x) (!!(x)) +# define __unlikely(x) (!!(x)) +#endif + +/* Possibly unused function */ +#ifdef __GNUC__ +# define __unusedfunc __attribute__((unused)) +#else +# define __unusedfunc +#endif + +/* It's all user space... */ +#define __user + +/* The bitwise attribute: disallow arithmetric operations */ +#ifdef __CHECKER__ /* sparse only */ +# define __bitwise __attribute__((bitwise)) +#else +# define __bitwise +#endif + +/* Shut up unused warnings */ +#ifdef __GNUC__ +# define __attribute_used__ __attribute__((used)) +#else +# define __attribute_used__ +#endif + +/* Compiler pragma to make an alias symbol */ +#define __ALIAS(__t, __f, __p, __a) \ + __t __f __p __attribute__((weak, alias(#__a))); + +#endif diff --git a/i386/include/klibc/compiler.h b/i386/include/klibc/compiler.h new file mode 100644 index 0000000..ff5a006 --- /dev/null +++ b/i386/include/klibc/compiler.h @@ -0,0 +1,158 @@ +/* + * klibc/compiler.h + * + * Various compiler features + */ + +#ifndef _KLIBC_COMPILER_H +#define _KLIBC_COMPILER_H + +/* Specific calling conventions */ +/* __cdecl is used when we want varadic and non-varadic functions to have + the same binary calling convention. */ +#ifdef __i386__ +# ifdef __GNUC__ +# define __cdecl __attribute__((cdecl,regparm(0))) +# else + /* Most other C compilers have __cdecl as a keyword */ +# endif +#else +# define __cdecl /* Meaningless on non-i386 */ +#endif + +/* + * How to declare a function which should be inlined or instantiated locally + */ +#ifdef __GNUC__ +# ifdef __GNUC_STDC_INLINE__ +# define __static_inline static __inline__ __attribute__((__gnu_inline__)) +# else +# define __static_inline static __inline__ +# endif +#else +# define __static_inline inline /* Just hope this works... */ +#endif + +/* + * How to declare a function which should be inlined or have a call to + * an external module + */ +#ifdef __GNUC__ +# ifdef __GNUC_STDC_INLINE__ +# define __extern_inline extern __inline__ __attribute__((__gnu_inline__)) +# else +# define __extern_inline extern __inline__ +# endif +#else +# define __extern_inline inline /* Just hope this works... */ +#endif + +/* How to declare a function that *must* be inlined */ +/* Use "extern inline" even in the gcc3+ case to avoid warnings in ctype.h */ +#ifdef __GNUC__ +# if __GNUC__ >= 3 +# define __must_inline __extern_inline __attribute__((__always_inline__)) +# else +# define __must_inline extern __inline__ +# endif +#else +# define __must_inline inline /* Just hope this works... */ +#endif + +/* How to declare a function that does not return */ +#ifdef __GNUC__ +# define __noreturn void __attribute__((noreturn)) +#else +# define __noreturn void +#endif + +/* "const" function: + + Many functions do not examine any values except their arguments, + and have no effects except the return value. Basically this is + just slightly more strict class than the `pure' attribute above, + since function is not allowed to read global memory. + + Note that a function that has pointer arguments and examines the + data pointed to must _not_ be declared `const'. Likewise, a + function that calls a non-`const' function usually must not be + `const'. It does not make sense for a `const' function to return + `void'. +*/ +#ifdef __GNUC__ +# define __constfunc __attribute__((const)) +#else +# define __constfunc +#endif +#undef __attribute_const__ +#define __attribute_const__ __constfunc + +/* "pure" function: + + Many functions have no effects except the return value and their + return value depends only on the parameters and/or global + variables. Such a function can be subject to common subexpression + elimination and loop optimization just as an arithmetic operator + would be. These functions should be declared with the attribute + `pure'. +*/ +#ifdef __GNUC__ +# define __purefunc __attribute__((pure)) +#else +# define __purefunc +#endif +#undef __attribute_pure__ +#define __attribute_pure__ __purefunc + +/* Format attribute */ +#ifdef __GNUC__ +# define __formatfunc(t,f,a) __attribute__((format(t,f,a))) +#else +# define __formatfunc(t,f,a) +#endif + +/* malloc() function (returns unaliased pointer) */ +#if defined(__GNUC__) && (__GNUC__ >= 3) +# define __mallocfunc __attribute__((malloc)) +#else +# define __mallocfunc +#endif + +/* likely/unlikely */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) +# define __likely(x) __builtin_expect(!!(x), 1) +# define __unlikely(x) __builtin_expect(!!(x), 0) +#else +# define __likely(x) (!!(x)) +# define __unlikely(x) (!!(x)) +#endif + +/* Possibly unused function */ +#ifdef __GNUC__ +# define __unusedfunc __attribute__((unused)) +#else +# define __unusedfunc +#endif + +/* It's all user space... */ +#define __user + +/* The bitwise attribute: disallow arithmetric operations */ +#ifdef __CHECKER__ /* sparse only */ +# define __bitwise __attribute__((bitwise)) +#else +# define __bitwise +#endif + +/* Shut up unused warnings */ +#ifdef __GNUC__ +# define __attribute_used__ __attribute__((used)) +#else +# define __attribute_used__ +#endif + +/* Compiler pragma to make an alias symbol */ +#define __ALIAS(__t, __f, __p, __a) \ + __t __f __p __attribute__((weak, alias(#__a))); + +#endif diff --git a/i386/include/libkern/.svn/all-wcprops b/i386/include/libkern/.svn/all-wcprops new file mode 100644 index 0000000..4d337b0 --- /dev/null +++ b/i386/include/libkern/.svn/all-wcprops @@ -0,0 +1,53 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern +END +OSAtomic.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSAtomic.h +END +_OSByteOrder.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/_OSByteOrder.h +END +OSByteOrder.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSByteOrder.h +END +OSReturn.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSReturn.h +END +OSKextLib.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSKextLib.h +END +OSCacheControl.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSCacheControl.h +END +OSTypes.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSTypes.h +END +OSDebug.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/OSDebug.h +END diff --git a/i386/include/libkern/.svn/entries b/i386/include/libkern/.svn/entries new file mode 100644 index 0000000..02fe606 --- /dev/null +++ b/i386/include/libkern/.svn/entries @@ -0,0 +1,312 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/libkern +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +crypto +dir + +ppc +dir + +machine +dir + +OSAtomic.h +file + + + + +2013-08-27T23:54:47.000000Z +4405fe93d82ac2c3748f281685080077 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9497 + +_OSByteOrder.h +file + + + + +2013-08-27T23:54:47.000000Z +a38af69ca7daf05e4164afcbf6cd6cf0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4338 + +OSByteOrder.h +file + + + + +2013-08-27T23:54:47.000000Z +720543ab179a493fff71424db6740b8d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10635 + +OSReturn.h +file + + + + +2013-08-27T23:54:47.000000Z +dba1db35563c7226528ea286a2d25f25 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6299 + +i386 +dir + +OSKextLib.h +file + + + + +2013-08-27T23:54:47.000000Z +1dba528f46c0454b27bf835fc678f8a3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15793 + +OSCacheControl.h +file + + + + +2013-08-27T23:54:47.000000Z +6a161af1d32ae519684eff544abd3aca +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2162 + +OSTypes.h +file + + + + +2013-08-27T23:54:47.000000Z +b5c39a7ce39822b779fbe3c9ae7f5094 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3650 + +OSDebug.h +file + + + + +2013-08-27T23:54:47.000000Z +347b0f62bf00598d967007e24e680bfd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2367 + diff --git a/i386/include/libkern/.svn/text-base/OSAtomic.h.svn-base b/i386/include/libkern/.svn/text-base/OSAtomic.h.svn-base new file mode 100644 index 0000000..9f2dba4 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSAtomic.h.svn-base @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _OSATOMIC_H_ +#define _OSATOMIC_H_ + +#include <stddef.h> +#include <sys/cdefs.h> +#include <stdint.h> +#include <stdbool.h> + +/* These are the preferred versions of the atomic and synchronization operations. + * Their implementation is customized at boot time for the platform, including + * late-breaking errata fixes as necessary. They are thread safe. + * + * WARNING: all addresses passed to these functions must be "naturally aligned", ie + * int32_t's must be 32-bit aligned (low 2 bits of address zero), and int64_t's + * must be 64-bit aligned (low 3 bits of address zero.) + * + * Note that some versions of the atomic functions incorporate memory barriers, + * and some do not. Barriers strictly order memory access on a weakly-ordered + * architecture such as PPC. All loads and stores executed in sequential program + * order before the barrier will complete before any load or store executed after + * the barrier. On a uniprocessor, the barrier operation is typically a nop. + * On a multiprocessor, the barrier can be quite expensive on some platforms, + * eg PPC. + * + * Most code will want to use the barrier functions to insure that memory shared + * between threads is properly synchronized. For example, if you want to initialize + * a shared data structure and then atomically increment a variable to indicate + * that the initialization is complete, then you must use OSAtomicIncrement32Barrier() + * to ensure that the stores to your data structure complete before the atomic add. + * Likewise, the consumer of that data structure must use OSAtomicDecrement32Barrier(), + * in order to ensure that their loads of the structure are not executed before + * the atomic decrement. On the other hand, if you are simply incrementing a global + * counter, then it is safe and potentially faster to use OSAtomicIncrement32(). + * + * If you are unsure which version to use, prefer the barrier variants as they are + * safer. + * + * The spinlock and queue operations always incorporate a barrier. + */ +__BEGIN_DECLS + + +/* Arithmetic functions. They return the new value. + */ +int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue ); +int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue ); + +__inline static +int32_t OSAtomicIncrement32( volatile int32_t *__theValue ) + { return OSAtomicAdd32( 1, __theValue); } +__inline static +int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue ) + { return OSAtomicAdd32Barrier( 1, __theValue); } + +__inline static +int32_t OSAtomicDecrement32( volatile int32_t *__theValue ) + { return OSAtomicAdd32( -1, __theValue); } +__inline static +int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue ) + { return OSAtomicAdd32Barrier( -1, __theValue); } + +#if defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) + +int64_t OSAtomicAdd64( int64_t __theAmount, volatile int64_t *__theValue ); +int64_t OSAtomicAdd64Barrier( int64_t __theAmount, volatile int64_t *__theValue ); + +__inline static +int64_t OSAtomicIncrement64( volatile int64_t *__theValue ) + { return OSAtomicAdd64( 1, __theValue); } +__inline static +int64_t OSAtomicIncrement64Barrier( volatile int64_t *__theValue ) + { return OSAtomicAdd64Barrier( 1, __theValue); } + +__inline static +int64_t OSAtomicDecrement64( volatile int64_t *__theValue ) + { return OSAtomicAdd64( -1, __theValue); } +__inline static +int64_t OSAtomicDecrement64Barrier( volatile int64_t *__theValue ) + { return OSAtomicAdd64Barrier( -1, __theValue); } + +#endif /* defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) */ + + +/* Boolean functions (and, or, xor.) These come in four versions for each operation: + * with and without barriers, and returning the old or new value of the operation. + * The "Orig" versions return the original value, ie before the operation, the non-Orig + * versions return the value after the operation. All are layered on top of + * compare-and-swap. + */ +int32_t OSAtomicOr32( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicOr32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicOr32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); + +int32_t OSAtomicAnd32( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicAnd32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicAnd32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicAnd32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); + +int32_t OSAtomicXor32( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicXor32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); + + +/* Compare and swap. They return true if the swap occured. There are several versions, + * depending on data type and whether or not a barrier is used. + */ +bool OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); +bool OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); +bool OSAtomicCompareAndSwapPtr( void *__oldValue, void *__newValue, void * volatile *__theValue ); +bool OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue ); +bool OSAtomicCompareAndSwapInt( int __oldValue, int __newValue, volatile int *__theValue ); +bool OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile int *__theValue ); +bool OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long *__theValue ); +bool OSAtomicCompareAndSwapLongBarrier( long __oldValue, long __newValue, volatile long *__theValue ); + +#if defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) + +bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ); +bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ); + +#endif /* defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) */ + + +/* Test and set. They return the original value of the bit, and operate on bit (0x80>>(n&7)) + * in byte ((char*)theAddress + (n>>3)). + */ +bool OSAtomicTestAndSet( uint32_t __n, volatile void *__theAddress ); +bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress ); +bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress ); +bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress ); + + +/* Spinlocks. These use memory barriers as required to synchronize access to shared + * memory protected by the lock. The lock operation spins, but employs various strategies + * to back off if the lock is held, making it immune to most priority-inversion livelocks. + * The try operation immediately returns false if the lock was held, true if it took the + * lock. The convention is that unlocked is zero, locked is nonzero. + */ +#define OS_SPINLOCK_INIT 0 + +typedef int32_t OSSpinLock; + +bool OSSpinLockTry( volatile OSSpinLock *__lock ); +void OSSpinLockLock( volatile OSSpinLock *__lock ); +void OSSpinLockUnlock( volatile OSSpinLock *__lock ); + + +/* Lockless atomic enqueue and dequeue. These routines manipulate singly + * linked LIFO lists. Ie, a dequeue will return the most recently enqueued + * element, or NULL if the list is empty. The "offset" parameter is the offset + * in bytes of the link field within the data structure being queued. The + * link field should be a pointer type. Memory barriers are incorporated as + * needed to permit thread-safe access to the queue element. + */ +#if defined(__x86_64__) + +typedef volatile struct { + void *opaque1; + long opaque2; +} OSQueueHead __attribute__ ((aligned (16))); + +#else + +typedef volatile struct { + void *opaque1; + long opaque2; +} OSQueueHead; + +#endif + +#define OS_ATOMIC_QUEUE_INIT { NULL, 0 } + +void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset); +void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset); + + +/* Memory barrier. It is both a read and write barrier. + */ +void OSMemoryBarrier( void ); + + +__END_DECLS + +#endif /* _OSATOMIC_H_ */ diff --git a/i386/include/libkern/.svn/text-base/OSByteOrder.h.svn-base b/i386/include/libkern/.svn/text-base/OSByteOrder.h.svn-base new file mode 100644 index 0000000..915a249 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSByteOrder.h.svn-base @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDER_H +#define _OS_OSBYTEORDER_H + +#include <stdint.h> +#include <libkern/_OSByteOrder.h> + +/* Macros for swapping constant values in the preprocessing stage. */ +#define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x) +#define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x) +#define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x) + +#if defined(__GNUC__) + +#if (defined(__ppc__) || defined(__ppc64__)) +#include <libkern/ppc/OSByteOrder.h> +#elif (defined(__i386__) || defined(__x86_64__)) +#include <libkern/i386/OSByteOrder.h> +#elif defined(__arm__) +#include <libkern/arm/OSByteOrder.h> +#else +#include <libkern/machine/OSByteOrder.h> +#endif + +#else /* ! __GNUC__ */ + +#include <libkern/machine/OSByteOrder.h> + +#endif /* __GNUC__ */ + +#define OSSwapInt16(x) __DARWIN_OSSwapInt16(x) +#define OSSwapInt32(x) __DARWIN_OSSwapInt32(x) +#define OSSwapInt64(x) __DARWIN_OSSwapInt64(x) + +enum { + OSUnknownByteOrder, + OSLittleEndian, + OSBigEndian +}; + +OS_INLINE +int32_t +OSHostByteOrder(void) { +#if defined(__LITTLE_ENDIAN__) + return OSLittleEndian; +#elif defined(__BIG_ENDIAN__) + return OSBigEndian; +#else + return OSUnknownByteOrder; +#endif +} + +#define OSReadBigInt(x, y) OSReadBigInt32(x, y) +#define OSWriteBigInt(x, y, z) OSWriteBigInt32(x, y, z) +#define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x) +#define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x) +#define OSReadLittleInt(x, y) OSReadLittleInt32(x, y) +#define OSWriteLittleInt(x, y, z) OSWriteLittleInt32(x, y, z) +#define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x) +#define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x) + +/* Functions for loading native endian values. */ + +OS_INLINE +uint16_t +_OSReadInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint16_t *)((uintptr_t)base + byteOffset); +} + +OS_INLINE +uint32_t +_OSReadInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint32_t *)((uintptr_t)base + byteOffset); +} + +OS_INLINE +uint64_t +_OSReadInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint64_t *)((uintptr_t)base + byteOffset); +} + +/* Functions for storing native endian values. */ + +OS_INLINE +void +_OSWriteInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data; +} + +OS_INLINE +void +_OSWriteInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data; +} + +OS_INLINE +void +_OSWriteInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data; +} + +#if defined(__BIG_ENDIAN__) + +/* Functions for loading big endian to host endianess. */ + +#define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset) +#define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset) +#define OSReadBigInt64(base, byteOffset) _OSReadInt64(base, byteOffset) + +/* Functions for storing host endianess to big endian. */ + +#define OSWriteBigInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data) +#define OSWriteBigInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data) +#define OSWriteBigInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data) + +/* Functions for loading little endian to host endianess. */ + +#define OSReadLittleInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset) +#define OSReadLittleInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset) +#define OSReadLittleInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset) + +/* Functions for storing host endianess to little endian. */ + +#define OSWriteLittleInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data) +#define OSWriteLittleInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data) +#define OSWriteLittleInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data) + +/* Host endianess to big endian byte swapping macros for constants. */ + +#define OSSwapHostToBigConstInt16(x) ((uint16_t)(x)) +#define OSSwapHostToBigConstInt32(x) ((uint32_t)(x)) +#define OSSwapHostToBigConstInt64(x) ((uint64_t)(x)) + +/* Generic host endianess to big endian byte swapping functions. */ + +#define OSSwapHostToBigInt16(x) ((uint16_t)(x)) +#define OSSwapHostToBigInt32(x) ((uint32_t)(x)) +#define OSSwapHostToBigInt64(x) ((uint64_t)(x)) + +/* Host endianess to little endian byte swapping macros for constants. */ + +#define OSSwapHostToLittleConstInt16(x) OSSwapConstInt16(x) +#define OSSwapHostToLittleConstInt32(x) OSSwapConstInt32(x) +#define OSSwapHostToLittleConstInt64(x) OSSwapConstInt64(x) + +/* Generic host endianess to little endian byte swapping functions. */ + +#define OSSwapHostToLittleInt16(x) OSSwapInt16(x) +#define OSSwapHostToLittleInt32(x) OSSwapInt32(x) +#define OSSwapHostToLittleInt64(x) OSSwapInt64(x) + +/* Big endian to host endianess byte swapping macros for constants. */ + +#define OSSwapBigToHostConstInt16(x) ((uint16_t)(x)) +#define OSSwapBigToHostConstInt32(x) ((uint32_t)(x)) +#define OSSwapBigToHostConstInt64(x) ((uint64_t)(x)) + +/* Generic big endian to host endianess byte swapping functions. */ + +#define OSSwapBigToHostInt16(x) ((uint16_t)(x)) +#define OSSwapBigToHostInt32(x) ((uint32_t)(x)) +#define OSSwapBigToHostInt64(x) ((uint64_t)(x)) + +/* Little endian to host endianess byte swapping macros for constants. */ + +#define OSSwapLittleToHostConstInt16(x) OSSwapConstInt16(x) +#define OSSwapLittleToHostConstInt32(x) OSSwapConstInt32(x) +#define OSSwapLittleToHostConstInt64(x) OSSwapConstInt64(x) + +/* Generic little endian to host endianess byte swapping functions. */ + +#define OSSwapLittleToHostInt16(x) OSSwapInt16(x) +#define OSSwapLittleToHostInt32(x) OSSwapInt32(x) +#define OSSwapLittleToHostInt64(x) OSSwapInt64(x) + +#elif defined(__LITTLE_ENDIAN__) + +/* Functions for loading big endian to host endianess. */ + +#define OSReadBigInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset) +#define OSReadBigInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset) +#define OSReadBigInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset) + +/* Functions for storing host endianess to big endian. */ + +#define OSWriteBigInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data) +#define OSWriteBigInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data) +#define OSWriteBigInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data) + +/* Functions for loading little endian to host endianess. */ + +#define OSReadLittleInt16(base, byteOffset) _OSReadInt16(base, byteOffset) +#define OSReadLittleInt32(base, byteOffset) _OSReadInt32(base, byteOffset) +#define OSReadLittleInt64(base, byteOffset) _OSReadInt64(base, byteOffset) + +/* Functions for storing host endianess to little endian. */ + +#define OSWriteLittleInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data) +#define OSWriteLittleInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data) +#define OSWriteLittleInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data) + +/* Host endianess to big endian byte swapping macros for constants. */ + +#define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x) +#define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x) +#define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x) + +/* Generic host endianess to big endian byte swapping functions. */ + +#define OSSwapHostToBigInt16(x) OSSwapInt16(x) +#define OSSwapHostToBigInt32(x) OSSwapInt32(x) +#define OSSwapHostToBigInt64(x) OSSwapInt64(x) + +/* Host endianess to little endian byte swapping macros for constants. */ + +#define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x)) +#define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x)) +#define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x)) + +/* Generic host endianess to little endian byte swapping functions. */ + +#define OSSwapHostToLittleInt16(x) ((uint16_t)(x)) +#define OSSwapHostToLittleInt32(x) ((uint32_t)(x)) +#define OSSwapHostToLittleInt64(x) ((uint64_t)(x)) + +/* Big endian to host endianess byte swapping macros for constants. */ + +#define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x) +#define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x) +#define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x) + +/* Generic big endian to host endianess byte swapping functions. */ + +#define OSSwapBigToHostInt16(x) OSSwapInt16(x) +#define OSSwapBigToHostInt32(x) OSSwapInt32(x) +#define OSSwapBigToHostInt64(x) OSSwapInt64(x) + +/* Little endian to host endianess byte swapping macros for constants. */ + +#define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x)) +#define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x)) +#define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x)) + +/* Generic little endian to host endianess byte swapping functions. */ + +#define OSSwapLittleToHostInt16(x) ((uint16_t)(x)) +#define OSSwapLittleToHostInt32(x) ((uint32_t)(x)) +#define OSSwapLittleToHostInt64(x) ((uint64_t)(x)) + +#else +#error Unknown endianess. +#endif + +#endif /* ! _OS_OSBYTEORDER_H */ + + diff --git a/i386/include/libkern/.svn/text-base/OSCacheControl.h.svn-base b/i386/include/libkern/.svn/text-base/OSCacheControl.h.svn-base new file mode 100644 index 0000000..771a704 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSCacheControl.h.svn-base @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_CACHE_CONTROL_H_ +#define _OS_CACHE_CONTROL_H_ + +#include <stddef.h> +#include <sys/cdefs.h> +#include <stdint.h> + +__BEGIN_DECLS + + +/* Functions performed by sys_cache_control(): */ + +/* Prepare memory for execution. This should be called + * after writing machine instructions to memory, before + * executing them. It syncs the dcache and icache. + * On IA32 processors this function is a NOP, because + * no synchronization is required. + */ +#define kCacheFunctionPrepareForExecution 1 + +/* Flush data cache(s). This ensures that cached data + * makes it all the way out to DRAM, and then removes + * copies of the data from all processor caches. + * It can be useful when dealing with cache incoherent + * devices or DMA. + */ +#define kCacheFunctionFlushDcache 2 + + +/* perform one of the above cache functions: */ +int sys_cache_control( int function, void *start, size_t len); + +/* equivalent to sys_cache_control(kCacheFunctionPrepareForExecution): */ +void sys_icache_invalidate( void *start, size_t len); + +/* equivalent to sys_cache_control(kCacheFunctionFlushDcache): */ +void sys_dcache_flush( void *start, size_t len); + + +__END_DECLS + +#endif /* _OS_CACHE_CONTROL_H_ */ diff --git a/i386/include/libkern/.svn/text-base/OSDebug.h.svn-base b/i386/include/libkern/.svn/text-base/OSDebug.h.svn-base new file mode 100644 index 0000000..eaeefc1 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSDebug.h.svn-base @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _OS_OSDEBBUG_H +#define _OS_OSDEBBUG_H + +#include <sys/cdefs.h> +#include <mach/mach_types.h> + +__BEGIN_DECLS + +extern int log_leaks; + +/* Use kernel_debug() to log a backtrace */ +extern void trace_backtrace(unsigned int debugid, unsigned int debugid2, unsigned long size, unsigned long data); +/* Report a message with a 4 entry backtrace - very slow */ +extern void OSReportWithBacktrace(const char *str, ...); +extern unsigned OSBacktrace(void **bt, unsigned maxAddrs); + +/*! @function OSKernelStackRemaining + @abstract Returns bytes available below the current stack frame. + @discussion Returns bytes available below the current stack frame. Safe for interrupt or thread context. + @result Approximate byte count available. */ + +vm_offset_t OSKernelStackRemaining( void ); + +__END_DECLS + +#define TRACE_MACHLEAKS(a,b,c,d) \ +do { \ + if (log_leaks) \ + trace_backtrace(a,b,c,d); \ +} while(0) + +#endif /* !_OS_OSDEBBUG_H */ diff --git a/i386/include/libkern/.svn/text-base/OSKextLib.h.svn-base b/i386/include/libkern/.svn/text-base/OSKextLib.h.svn-base new file mode 100644 index 0000000..dbe2ba2 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSKextLib.h.svn-base @@ -0,0 +1,472 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _LIBKERN_OSKEXTLIB_H +#define _LIBKERN_OSKEXTLIB_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <stdint.h> +#include <mach/kmod.h> +#include <mach/vm_types.h> + +#include <CoreFoundation/CoreFoundation.h> +#include <System/libkern/OSReturn.h> + +/*! + * @header + * + * Declares functions, basic return values, and other constants + * related to kernel extensions (kexts). + */ + +#if PRAGMA_MARK +#pragma mark - +/********************************************************************/ +#pragma mark OSReturn Values for Kernel Extensions +/********************************************************************/ +#endif +/*! + * @group OSReturn Values for Kernel Extensions + * Many kext-related functions return these values, + * as well as those defined under + * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code> + * and other variants of <code>kern_return_t</code>. + */ + + +#define sub_libkern_kext err_sub(2) +#define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) + + +/*! + * @define kOSKextReturnInternalError + * @abstract An internal error in the kext library. + * Contrast with <code>@link //apple_ref/c/econst/OSReturnError + * OSReturnError@/link</code>. + */ +#define kOSKextReturnInternalError libkern_kext_err(0x1) + +/*! + * @define kOSKextReturnNoMemory + * @abstract Memory allocation failed. + */ +#define kOSKextReturnNoMemory libkern_kext_err(0x2) + +/*! + * @define kOSKextReturnNoResources + * @abstract Some resource other than memory (such as available load tags) + * is exhausted. + */ +#define kOSKextReturnNoResources libkern_kext_err(0x3) + +/*! + * @define kOSKextReturnNotPrivileged + * @abstract The caller lacks privileges to perform the requested operation. + */ +#define kOSKextReturnNotPrivileged libkern_kext_err(0x4) + +/*! + * @define kOSKextReturnInvalidArgument + * @abstract Invalid argument. + */ +#define kOSKextReturnInvalidArgument libkern_kext_err(0x5) + +/*! + * @define kOSKextReturnNotFound + * @abstract Search item not found. + */ +#define kOSKextReturnNotFound libkern_kext_err(0x6) + +/*! + * @define kOSKextReturnBadData + * @abstract Malformed data (not used for XML). + */ +#define kOSKextReturnBadData libkern_kext_err(0x7) + +/*! + * @define kOSKextReturnSerialization + * @abstract Error converting or (un)serializing URL, string, or XML. + */ +#define kOSKextReturnSerialization libkern_kext_err(0x8) + +/*! + * @define kOSKextReturnUnsupported + * @abstract Operation is no longer or not yet supported. + */ +#define kOSKextReturnUnsupported libkern_kext_err(0x9) + +/*! + * @define kOSKextReturnDisabled + * @abstract Operation is currently disabled. + */ +#define kOSKextReturnDisabled libkern_kext_err(0xa) + +/*! + * @define kOSKextReturnNotAKext + * @abstract Bundle is not a kernel extension. + */ +#define kOSKextReturnNotAKext libkern_kext_err(0xb) + +/*! + * @define kOSKextReturnValidation + * @abstract Validation failures encountered; check diagnostics for details. + */ +#define kOSKextReturnValidation libkern_kext_err(0xc) + +/*! + * @define kOSKextReturnAuthentication + * @abstract Authetication failures encountered; check diagnostics for details. + */ +#define kOSKextReturnAuthentication libkern_kext_err(0xd) + +/*! + * @define kOSKextReturnDependencies + * @abstract Dependency resolution failures encountered; check diagnostics for details. + */ +#define kOSKextReturnDependencies libkern_kext_err(0xe) + +/*! + * @define kOSKextReturnArchNotFound + * @abstract Kext does not contain code for the requested architecture. + */ +#define kOSKextReturnArchNotFound libkern_kext_err(0xf) + +/*! + * @define kOSKextReturnCache + * @abstract An error occurred processing a system kext cache. + */ +#define kOSKextReturnCache libkern_kext_err(0x10) + +/*! + * @define kOSKextReturnDeferred + * @abstract Operation has been posted asynchronously to user space (kernel only). + */ +#define kOSKextReturnDeferred libkern_kext_err(0x11) + +/*! + * @define kOSKextReturnBootLevel + * @abstract Kext not loadable or operation not allowed at current boot level. + */ +#define kOSKextReturnBootLevel libkern_kext_err(0x12) + +/*! + * @define kOSKextReturnNotLoadable + * @abstract Kext cannot be loaded; check diagnostics for details. + */ +#define kOSKextReturnNotLoadable libkern_kext_err(0x13) + +/*! + * @define kOSKextReturnLoadedVersionDiffers + * @abstract A different version (or executable UUID, or executable by checksum) + * of the requested kext is already loaded. + */ +#define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14) + +/*! + * @define kOSKextReturnDependencyLoadError + * @abstract A load error occurred on a dependency of the kext being loaded. + */ +#define kOSKextReturnDependencyLoadError libkern_kext_err(0x15) + +/*! + * @define kOSKextReturnLinkError + * @abstract A link failure occured with this kext or a dependency. + */ +#define kOSKextReturnLinkError libkern_kext_err(0x16) + +/*! + * @define kOSKextReturnStartStopError + * @abstract The kext start or stop routine returned an error. + */ +#define kOSKextReturnStartStopError libkern_kext_err(0x17) + +/*! + * @define kOSKextReturnInUse + * @abstract The kext is currently in use or has outstanding references, + * and cannot be unloaded. + */ +#define kOSKextReturnInUse libkern_kext_err(0x18) + +/*! + * @define kOSKextReturnTimeout + * @abstract A kext request has timed out. + */ +#define kOSKextReturnTimeout libkern_kext_err(0x19) + +/*! + * @define kOSKextReturnStopping + * @abstract The kext is in the process of stopping; requests cannot be made. + */ +#define kOSKextReturnStopping libkern_kext_err(0x1a) + +#if PRAGMA_MARK +#pragma mark - +/********************************************************************/ +#pragma mark Kext/OSBundle Property List Keys +/********************************************************************/ +#endif +/*! + * @group Kext Property List Keys + * These constants cover CFBundle properties defined for kernel extensions. + * Because they are used in the kernel, if you want to use one with + * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro. + */ + + +/*! + * @define kOSBundleCompatibleVersionKey + * @abstract A string giving the backwards-compatible version of a library kext + * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's' + * is a build stage 'd', 'a', 'b', 'f' or 'fc'). + */ +#define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion" + +/*! + * @define kOSBundleEnableKextLoggingKey + * @abstract Set to true to have the kernel kext logging spec applied + * to the kext. + * See <code>@link //apple_ref/c/econst/OSKextLogSpec + * OSKextLogSpec@/link</code>. + */ +#define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging" + +/*! + * @define kOSBundleIsInterfaceKey + * @abstract A boolean value indicating whether the kext executable + * contains only symbol references. + */ +#define kOSBundleIsInterfaceKey "OSBundleIsInterface" + +/*! + * @define kOSBundleLibrariesKey + * @abstract A dictionary listing link dependencies for this kext. + * Keys are bundle identifiers, values are version strings. + */ +#define kOSBundleLibrariesKey "OSBundleLibraries" + +/*! + * @define kOSBundleRequiredKey + * @abstract A string indicating in which kinds of startup this kext + * may need to load during early startup (before + * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>). + * @discussion + * The value is one of: + * <ul> + * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li> + * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li> + * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li> + * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li> + * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li> + * </ul> + * + * Use this property judiciously. + * Every kext that declares a value other than "OSBundleRequiredSafeBoot" + * increases startup time, as the booter must read it into memory, + * or startup kext caches must include it. + */ +#define kOSBundleRequiredKey "OSBundleRequired" + +/*! + * @define kOSBundleAllowUserLoadKey + * @abstract A boolean value indicating whether + * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code> + * will honor a non-root process's request to load a kext. + * @discussion + * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL + * KextManagerLoadKextWithURL@/link</code> + * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier + * KextManagerLoadKextWithIdentifier@/link</code>. + */ +#define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad" + +/*! + * @define kOSKernelResourceKey + * @abstract A boolean value indicating whether the kext represents a built-in + * component of the kernel. + */ +#define kOSKernelResourceKey "OSKernelResource" + +/*! + * @define kIOKitPersonalitiesKey + * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers. + */ +#define kIOKitPersonalitiesKey "IOKitPersonalities" + +/* + * @define kIOPersonalityPublisherKey + * @abstract Used in personalities sent to the I/O Kit, + * contains the CFBundleIdentifier of the kext + * that the personality originated in. + */ +#define kIOPersonalityPublisherKey "IOPersonalityPublisher" + + +#if PRAGMA_MARK +/********************************************************************/ +#pragma mark Kext/OSBundle Property Deprecated Keys +/********************************************************************/ +#endif +/* + * @define kOSBundleDebugLevelKey + * @abstract + * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard). + * Value is an integer from 1-6, corresponding to the verbose levels + * of kext tools on those releases. + * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging + * OSKextEnableKextLogging@/link</code>. + */ +#define kOSBundleDebugLevelKey "OSBundleDebugLevel" + +/*! + * @define kOSBundleSharedExecutableIdentifierKey + * @abstract Deprecated (used on some releases of Mac OS X + * prior to 10.6 Snow Leopard). + * Value is the bundle identifier of the pseudokext + * that contains an executable shared by this kext. + */ +#define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier" + + +#if PRAGMA_MARK +/********************************************************************/ +#pragma mark Kext/OSBundle Property List Values +/********************************************************************/ +#endif + +/*! + * @group Kext Property List Values + * These constants encompass established values + * for kernel extension bundle properties. + */ + +/*! +* @define kOSKextKernelIdentifier +* @abstract +* This is the CFBundleIdentifier user for the kernel itself. +*/ +#define kOSKextKernelIdentifier "__kernel__" + +/*! +* @define kOSBundleRequiredRoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed to mount the root filesystem +* whether starting from a local or a network volume. +*/ +#define kOSBundleRequiredRoot "Root" + +/*! +* @define kOSBundleRequiredLocalRoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed to mount the root filesystem +* when starting from a local disk. +*/ +#define kOSBundleRequiredLocalRoot "Local-Root" + +/*! +* @define kOSBundleRequiredNetworkRoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed to mount the root filesystem +* when starting over a network connection. +*/ +#define kOSBundleRequiredNetworkRoot "Network-Root" + +/*! +* @define kOSBundleRequiredSafeBoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext can be loaded during a safe startup. +* This value does not normally cause the kext to be read by the booter +* or included in startup kext caches. +*/ +#define kOSBundleRequiredSafeBoot "Safe Boot" + +/*! +* @define kOSBundleRequiredConsole +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed for console access +* (specifically in a single-user startup when +* <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>. +* does not run) +* and should be loaded during early startup. +*/ +#define kOSBundleRequiredConsole "Console" + + +#if PRAGMA_MARK +#pragma mark - +/********************************************************************/ +#pragma mark Kext Information +/********************************************************************/ +#endif +/*! + * @group Kext Information + * Types, constants, and macros providing a kext with information + * about itself. + */ + +/*! + * @typedef OSKextLoadTag + * + * @abstract + * A unique identifier assigned to a loaded instanace of a kext. + * + * @discussion + * If a kext is unloaded and later reloaded, the new instance + * has a different load tag. + * + * A kext can get its own load tag in the <code>kmod_info_t</code> + * structure passed into its module start routine, as the + * <code>id</code> field (cast to this type). + * You can use the load tag with the functions + * <code>@link OSKextRetainKextWithLoadTag + * OSKextRetainKextWithLoadTag@/link</code> and + * <code>@link OSKextReleaseKextWithLoadTag + * OSKextReleaseKextWithLoadTag@/link</code>. + */ +typedef uint32_t OSKextLoadTag; + +/*! + * @define kOSKextInvalidLoadTag + * + * @abstract + * A load tag value that will never be used for a loaded kext; + * indicates kext not found. + */ +#define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1)) + + + +__END_DECLS + +#endif /* _LIBKERN_OSKEXTLIB_H */ diff --git a/i386/include/libkern/.svn/text-base/OSReturn.h.svn-base b/i386/include/libkern/.svn/text-base/OSReturn.h.svn-base new file mode 100644 index 0000000..b5490c9 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSReturn.h.svn-base @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2000 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Core OSReturn values. + */ + +#ifndef __LIBKERN_OSRETURN_H +#define __LIBKERN_OSRETURN_H + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#include <mach/error.h> + + +/*! + * @header + * + * Declares functions, basic return values, and other constants + * related to kernel extensions (kexts). + */ + +#if PRAGMA_MARK +#pragma mark Core OSReturn Values for Libkern +#endif +/********************************************************************* +* Core OSReturn Values for Libkern +*********************************************************************/ +/*! + * @group Core OSReturn Values for Libkern + * Some kext and I/O Kit functions can return these values, + * as well as other values of + * <code>kern_return_t</code>. + * + * Many of these return values represent internal errors + * in the Libkern C++ run-time typing information system + * based on @link //apple_ref/doc/class/OSMetaClass OSMetaClass@/link; + * you are unlikely to ever see them. + * + */ + + +/*! + * @typedef OSReturn + * @abstract The return type for many Libkern functions. + */ +typedef kern_return_t OSReturn; + +#ifndef sys_libkern +#define sys_libkern err_system(0x37) +#endif /* sys_libkern */ + +#define sub_libkern_common err_sub(0) +#define sub_libkern_metaclass err_sub(1) +#define sub_libkern_reserved err_sub(-1) + +#define libkern_common_err(return) (sys_libkern|sub_libkern_common|(return)) +#define libkern_metaclass_err(return) (sys_libkern|sub_libkern_metaclass|(return)) + +/* See OSKextLib.h for these + * #define sub_libkern_kext err_sub(2) + * #define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) + */ + +/*! + * @define kOSReturnSuccess + * @abstract Operation successful. + * Equal to <code>@link //apple_ref/c/econst/KERN_SUCCESS + * KERN_SUCCESS@/link</code>. + */ +#define kOSReturnSuccess KERN_SUCCESS + +/*! + * @define kOSReturnError + * @abstract Unspecified Libkern error. + * <b>Not equal</b> to + * <code>@link //apple_ref/c/econst/KERN_FAILURE + * KERN_FAILURE@/link</code>. + */ +#define kOSReturnError libkern_common_err(1) + +/*! + * @define kOSMetaClassInternal + * @abstract Internal OSMetaClass run-time error. + */ +#define kOSMetaClassInternal libkern_metaclass_err(1) + +/*! + * @define kOSMetaClassHasInstances + * @abstract A kext cannot be unloaded because there are instances + * derived from Libkern C++ classes that it defines. + */ +#define kOSMetaClassHasInstances libkern_metaclass_err(2) + +/*! + * @define kOSMetaClassNoInit + * @abstract Internal error: The Libkern C++ class registration system + * was not properly initialized during kext loading. + */ +#define kOSMetaClassNoInit libkern_metaclass_err(3) +// OSMetaClass::preModLoad wasn't called, runtime internal error + +/*! + * @define kOSMetaClassNoTempData + * @abstract Internal error: An allocation failure occurred + * registering Libkern C++ classes during kext loading. + */ +#define kOSMetaClassNoTempData libkern_metaclass_err(4) +// Allocation failure internal data + +/*! + * @define kOSMetaClassNoDicts + * @abstract Internal error: An allocation failure occurred + * registering Libkern C++ classes during kext loading. + */ +#define kOSMetaClassNoDicts libkern_metaclass_err(5) +// Allocation failure for Metaclass internal dictionaries + +/*! + * @define kOSMetaClassNoKModSet + * @abstract Internal error: An allocation failure occurred + * registering Libkern C++ classes during kext loading. + */ +#define kOSMetaClassNoKModSet libkern_metaclass_err(6) +// Allocation failure for internal kmodule set + +/*! + * @define kOSMetaClassNoInsKModSet + * @abstract Internal error: An error occurred registering + * a specific Libkern C++ class during kext loading. + */ +#define kOSMetaClassNoInsKModSet libkern_metaclass_err(7) +// Can't insert the KMod set into the module dictionary + +/*! + * @define kOSMetaClassNoSuper + * @abstract Internal error: No superclass can be found + * for a specific Libkern C++ class during kext loading. + */ +#define kOSMetaClassNoSuper libkern_metaclass_err(8) + +/*! + * @define kOSMetaClassInstNoSuper + * @abstract Internal error: No superclass can be found when constructing + * an instance of a Libkern C++ class. + */ +#define kOSMetaClassInstNoSuper libkern_metaclass_err(9) + +/*! + * @define kOSMetaClassDuplicateClass + * @abstract A duplicate Libkern C++ classname was encountered + * during kext loading. + */ +#define kOSMetaClassDuplicateClass libkern_metaclass_err(10) + +/*! + * @define kOSMetaClassNoKext + * @abstract Internal error: The kext for a Libkern C++ class + * can't be found during kext loading. + */ +#define kOSMetaClassNoKext libkern_metaclass_err(11) + +__END_DECLS + +#endif /* ! __LIBKERN_OSRETURN_H */ diff --git a/i386/include/libkern/.svn/text-base/OSTypes.h.svn-base b/i386/include/libkern/.svn/text-base/OSTypes.h.svn-base new file mode 100644 index 0000000..6a03a27 --- /dev/null +++ b/i386/include/libkern/.svn/text-base/OSTypes.h.svn-base @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _OS_OSTYPES_H +#define _OS_OSTYPES_H + +#define OSTYPES_K64_REV 2 + +typedef unsigned int UInt; +typedef signed int SInt; + +#ifndef __MACTYPES__ /* CF MacTypes.h */ +#ifndef __TYPES__ /* guess... Mac Types.h */ + +typedef unsigned char UInt8; +typedef unsigned short UInt16; +#if __LP64__ +typedef unsigned int UInt32; +#else +typedef unsigned long UInt32; +#endif +typedef unsigned long long UInt64; +#if defined(__BIG_ENDIAN__) +typedef struct UnsignedWide { + UInt32 hi; + UInt32 lo; +} UnsignedWide; +#elif defined(__LITTLE_ENDIAN__) +typedef struct UnsignedWide { + UInt32 lo; + UInt32 hi; +} UnsignedWide; +#else +#error Unknown endianess. +#endif + +typedef signed char SInt8; +typedef signed short SInt16; +#if __LP64__ +typedef signed int SInt32; +#else +typedef signed long SInt32; +#endif +typedef signed long long SInt64; +#if defined(__BIG_ENDIAN__) +typedef struct wide { + SInt32 hi; + UInt32 lo; +} wide; +#elif defined(__LITTLE_ENDIAN__) +typedef struct wide { + UInt32 lo; + SInt32 hi; +} wide; +#else +#error Unknown endianess. +#endif + +typedef SInt32 OSStatus; + +#if defined(__LP64__) && defined(KERNEL) +#ifndef ABSOLUTETIME_SCALAR_TYPE +#define ABSOLUTETIME_SCALAR_TYPE 1 +#endif +typedef UInt64 AbsoluteTime; +#else +typedef UnsignedWide AbsoluteTime; +#endif + +typedef UInt32 OptionBits; + +#if defined(KERNEL) && defined(__LP64__) +/* + * Use intrinsic boolean types for the LP64 kernel, otherwise maintain + * source and binary backward compatibility. This attempts to resolve + * the "(x == true)" vs. "(x)" conditional issue. + */ +#ifdef __cplusplus +typedef bool Boolean; +#else /* !__cplusplus */ +#if defined(__STDC_VERSION__) && ((__STDC_VERSION__ - 199901L) > 0L) +/* only use this if we are sure we are using a c99 compiler */ +typedef _Bool Boolean; +#else /* !c99 */ +/* Fall back to previous definition unless c99 */ +typedef unsigned char Boolean; +#endif /* !c99 */ +#endif /* !__cplusplus */ +#else /* !(KERNEL && __LP64__) */ +typedef unsigned char Boolean; +#endif /* !(KERNEL && __LP64__) */ + +#endif /* __TYPES__ */ +#endif /* __MACTYPES__ */ + +#if !defined(OS_INLINE) +# define OS_INLINE static inline +#endif + +#endif /* _OS_OSTYPES_H */ diff --git a/i386/include/libkern/.svn/text-base/_OSByteOrder.h.svn-base b/i386/include/libkern/.svn/text-base/_OSByteOrder.h.svn-base new file mode 100644 index 0000000..d8806fc --- /dev/null +++ b/i386/include/libkern/.svn/text-base/_OSByteOrder.h.svn-base @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS__OSBYTEORDER_H +#define _OS__OSBYTEORDER_H + +/* + * This header is normally included from <libkern/OSByteOrder.h>. However, + * <sys/_endian.h> also includes this in the case of little-endian + * architectures, so that we can map OSByteOrder routines to the hton* and ntoh* + * macros. This results in the asymmetry below; we only include + * <libkern/arch/_OSByteOrder.h> for little-endian architectures. + */ + +//#include <sys/_types.h> + +/* Macros for swapping constant values in the preprocessing stage. */ +#define __DARWIN_OSSwapConstInt16(x) \ + ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \ + (((__uint16_t)(x) & 0x00ff) << 8))) + +#define __DARWIN_OSSwapConstInt32(x) \ + ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | \ + (((__uint32_t)(x) & 0x00ff0000) >> 8) | \ + (((__uint32_t)(x) & 0x0000ff00) << 8) | \ + (((__uint32_t)(x) & 0x000000ff) << 24))) + +#define __DARWIN_OSSwapConstInt64(x) \ + ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \ + (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \ + (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \ + (((__uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \ + (((__uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \ + (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \ + (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \ + (((__uint64_t)(x) & 0x00000000000000ffULL) << 56))) + +#if defined(__GNUC__) + +#if defined(__i386__) || defined(__x86_64__) +#include <libkern/i386/_OSByteOrder.h> +#endif + +#if defined(__arm__) +#include <libkern/arm/OSByteOrder.h> +#endif + + +#define __DARWIN_OSSwapInt16(x) \ + (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)) + +#define __DARWIN_OSSwapInt32(x) \ + (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x)) + +#define __DARWIN_OSSwapInt64(x) \ + (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x)) + +#else /* ! __GNUC__ */ + +#if defined(__i386__) || defined(__x86_64__) + +#if !defined(__DARWIN_OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __DARWIN_OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define __DARWIN_OS_INLINE static inline +# else +# define __DARWIN_OS_INLINE static __inline__ +# endif +#endif + +__DARWIN_OS_INLINE +uint16_t +_OSSwapInt16( + uint16_t data +) +{ + return __DARWIN_OSSwapConstInt16(data); +} + +__DARWIN_OS_INLINE +uint32_t +_OSSwapInt32( + uint32_t data +) +{ + return __DARWIN_OSSwapConstInt32(data); +} + +__DARWIN_OS_INLINE +uint64_t +_OSSwapInt64( + uint64_t data +) +{ + return __DARWIN_OSSwapConstInt64(data); +} +#endif + +#define __DARWIN_OSSwapInt16(x) _OSSwapInt16(x) + +#define __DARWIN_OSSwapInt32(x) _OSSwapInt32(x) + +#define __DARWIN_OSSwapInt64(x) _OSSwapInt64(x) + +#endif /* __GNUC__ */ + +#endif /* ! _OS__OSBYTEORDER_H */ diff --git a/i386/include/libkern/OSAtomic.h b/i386/include/libkern/OSAtomic.h new file mode 100644 index 0000000..9f2dba4 --- /dev/null +++ b/i386/include/libkern/OSAtomic.h @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _OSATOMIC_H_ +#define _OSATOMIC_H_ + +#include <stddef.h> +#include <sys/cdefs.h> +#include <stdint.h> +#include <stdbool.h> + +/* These are the preferred versions of the atomic and synchronization operations. + * Their implementation is customized at boot time for the platform, including + * late-breaking errata fixes as necessary. They are thread safe. + * + * WARNING: all addresses passed to these functions must be "naturally aligned", ie + * int32_t's must be 32-bit aligned (low 2 bits of address zero), and int64_t's + * must be 64-bit aligned (low 3 bits of address zero.) + * + * Note that some versions of the atomic functions incorporate memory barriers, + * and some do not. Barriers strictly order memory access on a weakly-ordered + * architecture such as PPC. All loads and stores executed in sequential program + * order before the barrier will complete before any load or store executed after + * the barrier. On a uniprocessor, the barrier operation is typically a nop. + * On a multiprocessor, the barrier can be quite expensive on some platforms, + * eg PPC. + * + * Most code will want to use the barrier functions to insure that memory shared + * between threads is properly synchronized. For example, if you want to initialize + * a shared data structure and then atomically increment a variable to indicate + * that the initialization is complete, then you must use OSAtomicIncrement32Barrier() + * to ensure that the stores to your data structure complete before the atomic add. + * Likewise, the consumer of that data structure must use OSAtomicDecrement32Barrier(), + * in order to ensure that their loads of the structure are not executed before + * the atomic decrement. On the other hand, if you are simply incrementing a global + * counter, then it is safe and potentially faster to use OSAtomicIncrement32(). + * + * If you are unsure which version to use, prefer the barrier variants as they are + * safer. + * + * The spinlock and queue operations always incorporate a barrier. + */ +__BEGIN_DECLS + + +/* Arithmetic functions. They return the new value. + */ +int32_t OSAtomicAdd32( int32_t __theAmount, volatile int32_t *__theValue ); +int32_t OSAtomicAdd32Barrier( int32_t __theAmount, volatile int32_t *__theValue ); + +__inline static +int32_t OSAtomicIncrement32( volatile int32_t *__theValue ) + { return OSAtomicAdd32( 1, __theValue); } +__inline static +int32_t OSAtomicIncrement32Barrier( volatile int32_t *__theValue ) + { return OSAtomicAdd32Barrier( 1, __theValue); } + +__inline static +int32_t OSAtomicDecrement32( volatile int32_t *__theValue ) + { return OSAtomicAdd32( -1, __theValue); } +__inline static +int32_t OSAtomicDecrement32Barrier( volatile int32_t *__theValue ) + { return OSAtomicAdd32Barrier( -1, __theValue); } + +#if defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) + +int64_t OSAtomicAdd64( int64_t __theAmount, volatile int64_t *__theValue ); +int64_t OSAtomicAdd64Barrier( int64_t __theAmount, volatile int64_t *__theValue ); + +__inline static +int64_t OSAtomicIncrement64( volatile int64_t *__theValue ) + { return OSAtomicAdd64( 1, __theValue); } +__inline static +int64_t OSAtomicIncrement64Barrier( volatile int64_t *__theValue ) + { return OSAtomicAdd64Barrier( 1, __theValue); } + +__inline static +int64_t OSAtomicDecrement64( volatile int64_t *__theValue ) + { return OSAtomicAdd64( -1, __theValue); } +__inline static +int64_t OSAtomicDecrement64Barrier( volatile int64_t *__theValue ) + { return OSAtomicAdd64Barrier( -1, __theValue); } + +#endif /* defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) */ + + +/* Boolean functions (and, or, xor.) These come in four versions for each operation: + * with and without barriers, and returning the old or new value of the operation. + * The "Orig" versions return the original value, ie before the operation, the non-Orig + * versions return the value after the operation. All are layered on top of + * compare-and-swap. + */ +int32_t OSAtomicOr32( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicOr32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicOr32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicOr32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); + +int32_t OSAtomicAnd32( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicAnd32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicAnd32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicAnd32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); + +int32_t OSAtomicXor32( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicXor32Barrier( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicXor32Orig( uint32_t __theMask, volatile uint32_t *__theValue ); +int32_t OSAtomicXor32OrigBarrier( uint32_t __theMask, volatile uint32_t *__theValue ); + + +/* Compare and swap. They return true if the swap occured. There are several versions, + * depending on data type and whether or not a barrier is used. + */ +bool OSAtomicCompareAndSwap32( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); +bool OSAtomicCompareAndSwap32Barrier( int32_t __oldValue, int32_t __newValue, volatile int32_t *__theValue ); +bool OSAtomicCompareAndSwapPtr( void *__oldValue, void *__newValue, void * volatile *__theValue ); +bool OSAtomicCompareAndSwapPtrBarrier( void *__oldValue, void *__newValue, void * volatile *__theValue ); +bool OSAtomicCompareAndSwapInt( int __oldValue, int __newValue, volatile int *__theValue ); +bool OSAtomicCompareAndSwapIntBarrier( int __oldValue, int __newValue, volatile int *__theValue ); +bool OSAtomicCompareAndSwapLong( long __oldValue, long __newValue, volatile long *__theValue ); +bool OSAtomicCompareAndSwapLongBarrier( long __oldValue, long __newValue, volatile long *__theValue ); + +#if defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) + +bool OSAtomicCompareAndSwap64( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ); +bool OSAtomicCompareAndSwap64Barrier( int64_t __oldValue, int64_t __newValue, volatile int64_t *__theValue ); + +#endif /* defined(__ppc64__) || defined(__i386__) || defined(__x86_64__) || defined(__arm__) */ + + +/* Test and set. They return the original value of the bit, and operate on bit (0x80>>(n&7)) + * in byte ((char*)theAddress + (n>>3)). + */ +bool OSAtomicTestAndSet( uint32_t __n, volatile void *__theAddress ); +bool OSAtomicTestAndSetBarrier( uint32_t __n, volatile void *__theAddress ); +bool OSAtomicTestAndClear( uint32_t __n, volatile void *__theAddress ); +bool OSAtomicTestAndClearBarrier( uint32_t __n, volatile void *__theAddress ); + + +/* Spinlocks. These use memory barriers as required to synchronize access to shared + * memory protected by the lock. The lock operation spins, but employs various strategies + * to back off if the lock is held, making it immune to most priority-inversion livelocks. + * The try operation immediately returns false if the lock was held, true if it took the + * lock. The convention is that unlocked is zero, locked is nonzero. + */ +#define OS_SPINLOCK_INIT 0 + +typedef int32_t OSSpinLock; + +bool OSSpinLockTry( volatile OSSpinLock *__lock ); +void OSSpinLockLock( volatile OSSpinLock *__lock ); +void OSSpinLockUnlock( volatile OSSpinLock *__lock ); + + +/* Lockless atomic enqueue and dequeue. These routines manipulate singly + * linked LIFO lists. Ie, a dequeue will return the most recently enqueued + * element, or NULL if the list is empty. The "offset" parameter is the offset + * in bytes of the link field within the data structure being queued. The + * link field should be a pointer type. Memory barriers are incorporated as + * needed to permit thread-safe access to the queue element. + */ +#if defined(__x86_64__) + +typedef volatile struct { + void *opaque1; + long opaque2; +} OSQueueHead __attribute__ ((aligned (16))); + +#else + +typedef volatile struct { + void *opaque1; + long opaque2; +} OSQueueHead; + +#endif + +#define OS_ATOMIC_QUEUE_INIT { NULL, 0 } + +void OSAtomicEnqueue( OSQueueHead *__list, void *__new, size_t __offset); +void* OSAtomicDequeue( OSQueueHead *__list, size_t __offset); + + +/* Memory barrier. It is both a read and write barrier. + */ +void OSMemoryBarrier( void ); + + +__END_DECLS + +#endif /* _OSATOMIC_H_ */ diff --git a/i386/include/libkern/OSByteOrder.h b/i386/include/libkern/OSByteOrder.h new file mode 100644 index 0000000..915a249 --- /dev/null +++ b/i386/include/libkern/OSByteOrder.h @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDER_H +#define _OS_OSBYTEORDER_H + +#include <stdint.h> +#include <libkern/_OSByteOrder.h> + +/* Macros for swapping constant values in the preprocessing stage. */ +#define OSSwapConstInt16(x) __DARWIN_OSSwapConstInt16(x) +#define OSSwapConstInt32(x) __DARWIN_OSSwapConstInt32(x) +#define OSSwapConstInt64(x) __DARWIN_OSSwapConstInt64(x) + +#if defined(__GNUC__) + +#if (defined(__ppc__) || defined(__ppc64__)) +#include <libkern/ppc/OSByteOrder.h> +#elif (defined(__i386__) || defined(__x86_64__)) +#include <libkern/i386/OSByteOrder.h> +#elif defined(__arm__) +#include <libkern/arm/OSByteOrder.h> +#else +#include <libkern/machine/OSByteOrder.h> +#endif + +#else /* ! __GNUC__ */ + +#include <libkern/machine/OSByteOrder.h> + +#endif /* __GNUC__ */ + +#define OSSwapInt16(x) __DARWIN_OSSwapInt16(x) +#define OSSwapInt32(x) __DARWIN_OSSwapInt32(x) +#define OSSwapInt64(x) __DARWIN_OSSwapInt64(x) + +enum { + OSUnknownByteOrder, + OSLittleEndian, + OSBigEndian +}; + +OS_INLINE +int32_t +OSHostByteOrder(void) { +#if defined(__LITTLE_ENDIAN__) + return OSLittleEndian; +#elif defined(__BIG_ENDIAN__) + return OSBigEndian; +#else + return OSUnknownByteOrder; +#endif +} + +#define OSReadBigInt(x, y) OSReadBigInt32(x, y) +#define OSWriteBigInt(x, y, z) OSWriteBigInt32(x, y, z) +#define OSSwapBigToHostInt(x) OSSwapBigToHostInt32(x) +#define OSSwapHostToBigInt(x) OSSwapHostToBigInt32(x) +#define OSReadLittleInt(x, y) OSReadLittleInt32(x, y) +#define OSWriteLittleInt(x, y, z) OSWriteLittleInt32(x, y, z) +#define OSSwapHostToLittleInt(x) OSSwapHostToLittleInt32(x) +#define OSSwapLittleToHostInt(x) OSSwapLittleToHostInt32(x) + +/* Functions for loading native endian values. */ + +OS_INLINE +uint16_t +_OSReadInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint16_t *)((uintptr_t)base + byteOffset); +} + +OS_INLINE +uint32_t +_OSReadInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint32_t *)((uintptr_t)base + byteOffset); +} + +OS_INLINE +uint64_t +_OSReadInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + return *(volatile uint64_t *)((uintptr_t)base + byteOffset); +} + +/* Functions for storing native endian values. */ + +OS_INLINE +void +_OSWriteInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = data; +} + +OS_INLINE +void +_OSWriteInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = data; +} + +OS_INLINE +void +_OSWriteInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = data; +} + +#if defined(__BIG_ENDIAN__) + +/* Functions for loading big endian to host endianess. */ + +#define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset) +#define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset) +#define OSReadBigInt64(base, byteOffset) _OSReadInt64(base, byteOffset) + +/* Functions for storing host endianess to big endian. */ + +#define OSWriteBigInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data) +#define OSWriteBigInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data) +#define OSWriteBigInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data) + +/* Functions for loading little endian to host endianess. */ + +#define OSReadLittleInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset) +#define OSReadLittleInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset) +#define OSReadLittleInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset) + +/* Functions for storing host endianess to little endian. */ + +#define OSWriteLittleInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data) +#define OSWriteLittleInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data) +#define OSWriteLittleInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data) + +/* Host endianess to big endian byte swapping macros for constants. */ + +#define OSSwapHostToBigConstInt16(x) ((uint16_t)(x)) +#define OSSwapHostToBigConstInt32(x) ((uint32_t)(x)) +#define OSSwapHostToBigConstInt64(x) ((uint64_t)(x)) + +/* Generic host endianess to big endian byte swapping functions. */ + +#define OSSwapHostToBigInt16(x) ((uint16_t)(x)) +#define OSSwapHostToBigInt32(x) ((uint32_t)(x)) +#define OSSwapHostToBigInt64(x) ((uint64_t)(x)) + +/* Host endianess to little endian byte swapping macros for constants. */ + +#define OSSwapHostToLittleConstInt16(x) OSSwapConstInt16(x) +#define OSSwapHostToLittleConstInt32(x) OSSwapConstInt32(x) +#define OSSwapHostToLittleConstInt64(x) OSSwapConstInt64(x) + +/* Generic host endianess to little endian byte swapping functions. */ + +#define OSSwapHostToLittleInt16(x) OSSwapInt16(x) +#define OSSwapHostToLittleInt32(x) OSSwapInt32(x) +#define OSSwapHostToLittleInt64(x) OSSwapInt64(x) + +/* Big endian to host endianess byte swapping macros for constants. */ + +#define OSSwapBigToHostConstInt16(x) ((uint16_t)(x)) +#define OSSwapBigToHostConstInt32(x) ((uint32_t)(x)) +#define OSSwapBigToHostConstInt64(x) ((uint64_t)(x)) + +/* Generic big endian to host endianess byte swapping functions. */ + +#define OSSwapBigToHostInt16(x) ((uint16_t)(x)) +#define OSSwapBigToHostInt32(x) ((uint32_t)(x)) +#define OSSwapBigToHostInt64(x) ((uint64_t)(x)) + +/* Little endian to host endianess byte swapping macros for constants. */ + +#define OSSwapLittleToHostConstInt16(x) OSSwapConstInt16(x) +#define OSSwapLittleToHostConstInt32(x) OSSwapConstInt32(x) +#define OSSwapLittleToHostConstInt64(x) OSSwapConstInt64(x) + +/* Generic little endian to host endianess byte swapping functions. */ + +#define OSSwapLittleToHostInt16(x) OSSwapInt16(x) +#define OSSwapLittleToHostInt32(x) OSSwapInt32(x) +#define OSSwapLittleToHostInt64(x) OSSwapInt64(x) + +#elif defined(__LITTLE_ENDIAN__) + +/* Functions for loading big endian to host endianess. */ + +#define OSReadBigInt16(base, byteOffset) OSReadSwapInt16(base, byteOffset) +#define OSReadBigInt32(base, byteOffset) OSReadSwapInt32(base, byteOffset) +#define OSReadBigInt64(base, byteOffset) OSReadSwapInt64(base, byteOffset) + +/* Functions for storing host endianess to big endian. */ + +#define OSWriteBigInt16(base, byteOffset, data) OSWriteSwapInt16(base, byteOffset, data) +#define OSWriteBigInt32(base, byteOffset, data) OSWriteSwapInt32(base, byteOffset, data) +#define OSWriteBigInt64(base, byteOffset, data) OSWriteSwapInt64(base, byteOffset, data) + +/* Functions for loading little endian to host endianess. */ + +#define OSReadLittleInt16(base, byteOffset) _OSReadInt16(base, byteOffset) +#define OSReadLittleInt32(base, byteOffset) _OSReadInt32(base, byteOffset) +#define OSReadLittleInt64(base, byteOffset) _OSReadInt64(base, byteOffset) + +/* Functions for storing host endianess to little endian. */ + +#define OSWriteLittleInt16(base, byteOffset, data) _OSWriteInt16(base, byteOffset, data) +#define OSWriteLittleInt32(base, byteOffset, data) _OSWriteInt32(base, byteOffset, data) +#define OSWriteLittleInt64(base, byteOffset, data) _OSWriteInt64(base, byteOffset, data) + +/* Host endianess to big endian byte swapping macros for constants. */ + +#define OSSwapHostToBigConstInt16(x) OSSwapConstInt16(x) +#define OSSwapHostToBigConstInt32(x) OSSwapConstInt32(x) +#define OSSwapHostToBigConstInt64(x) OSSwapConstInt64(x) + +/* Generic host endianess to big endian byte swapping functions. */ + +#define OSSwapHostToBigInt16(x) OSSwapInt16(x) +#define OSSwapHostToBigInt32(x) OSSwapInt32(x) +#define OSSwapHostToBigInt64(x) OSSwapInt64(x) + +/* Host endianess to little endian byte swapping macros for constants. */ + +#define OSSwapHostToLittleConstInt16(x) ((uint16_t)(x)) +#define OSSwapHostToLittleConstInt32(x) ((uint32_t)(x)) +#define OSSwapHostToLittleConstInt64(x) ((uint64_t)(x)) + +/* Generic host endianess to little endian byte swapping functions. */ + +#define OSSwapHostToLittleInt16(x) ((uint16_t)(x)) +#define OSSwapHostToLittleInt32(x) ((uint32_t)(x)) +#define OSSwapHostToLittleInt64(x) ((uint64_t)(x)) + +/* Big endian to host endianess byte swapping macros for constants. */ + +#define OSSwapBigToHostConstInt16(x) OSSwapConstInt16(x) +#define OSSwapBigToHostConstInt32(x) OSSwapConstInt32(x) +#define OSSwapBigToHostConstInt64(x) OSSwapConstInt64(x) + +/* Generic big endian to host endianess byte swapping functions. */ + +#define OSSwapBigToHostInt16(x) OSSwapInt16(x) +#define OSSwapBigToHostInt32(x) OSSwapInt32(x) +#define OSSwapBigToHostInt64(x) OSSwapInt64(x) + +/* Little endian to host endianess byte swapping macros for constants. */ + +#define OSSwapLittleToHostConstInt16(x) ((uint16_t)(x)) +#define OSSwapLittleToHostConstInt32(x) ((uint32_t)(x)) +#define OSSwapLittleToHostConstInt64(x) ((uint64_t)(x)) + +/* Generic little endian to host endianess byte swapping functions. */ + +#define OSSwapLittleToHostInt16(x) ((uint16_t)(x)) +#define OSSwapLittleToHostInt32(x) ((uint32_t)(x)) +#define OSSwapLittleToHostInt64(x) ((uint64_t)(x)) + +#else +#error Unknown endianess. +#endif + +#endif /* ! _OS_OSBYTEORDER_H */ + + diff --git a/i386/include/libkern/OSCacheControl.h b/i386/include/libkern/OSCacheControl.h new file mode 100644 index 0000000..771a704 --- /dev/null +++ b/i386/include/libkern/OSCacheControl.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_CACHE_CONTROL_H_ +#define _OS_CACHE_CONTROL_H_ + +#include <stddef.h> +#include <sys/cdefs.h> +#include <stdint.h> + +__BEGIN_DECLS + + +/* Functions performed by sys_cache_control(): */ + +/* Prepare memory for execution. This should be called + * after writing machine instructions to memory, before + * executing them. It syncs the dcache and icache. + * On IA32 processors this function is a NOP, because + * no synchronization is required. + */ +#define kCacheFunctionPrepareForExecution 1 + +/* Flush data cache(s). This ensures that cached data + * makes it all the way out to DRAM, and then removes + * copies of the data from all processor caches. + * It can be useful when dealing with cache incoherent + * devices or DMA. + */ +#define kCacheFunctionFlushDcache 2 + + +/* perform one of the above cache functions: */ +int sys_cache_control( int function, void *start, size_t len); + +/* equivalent to sys_cache_control(kCacheFunctionPrepareForExecution): */ +void sys_icache_invalidate( void *start, size_t len); + +/* equivalent to sys_cache_control(kCacheFunctionFlushDcache): */ +void sys_dcache_flush( void *start, size_t len); + + +__END_DECLS + +#endif /* _OS_CACHE_CONTROL_H_ */ diff --git a/i386/include/libkern/OSDebug.h b/i386/include/libkern/OSDebug.h new file mode 100644 index 0000000..eaeefc1 --- /dev/null +++ b/i386/include/libkern/OSDebug.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _OS_OSDEBBUG_H +#define _OS_OSDEBBUG_H + +#include <sys/cdefs.h> +#include <mach/mach_types.h> + +__BEGIN_DECLS + +extern int log_leaks; + +/* Use kernel_debug() to log a backtrace */ +extern void trace_backtrace(unsigned int debugid, unsigned int debugid2, unsigned long size, unsigned long data); +/* Report a message with a 4 entry backtrace - very slow */ +extern void OSReportWithBacktrace(const char *str, ...); +extern unsigned OSBacktrace(void **bt, unsigned maxAddrs); + +/*! @function OSKernelStackRemaining + @abstract Returns bytes available below the current stack frame. + @discussion Returns bytes available below the current stack frame. Safe for interrupt or thread context. + @result Approximate byte count available. */ + +vm_offset_t OSKernelStackRemaining( void ); + +__END_DECLS + +#define TRACE_MACHLEAKS(a,b,c,d) \ +do { \ + if (log_leaks) \ + trace_backtrace(a,b,c,d); \ +} while(0) + +#endif /* !_OS_OSDEBBUG_H */ diff --git a/i386/include/libkern/OSKextLib.h b/i386/include/libkern/OSKextLib.h new file mode 100644 index 0000000..dbe2ba2 --- /dev/null +++ b/i386/include/libkern/OSKextLib.h @@ -0,0 +1,472 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _LIBKERN_OSKEXTLIB_H +#define _LIBKERN_OSKEXTLIB_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <stdint.h> +#include <mach/kmod.h> +#include <mach/vm_types.h> + +#include <CoreFoundation/CoreFoundation.h> +#include <System/libkern/OSReturn.h> + +/*! + * @header + * + * Declares functions, basic return values, and other constants + * related to kernel extensions (kexts). + */ + +#if PRAGMA_MARK +#pragma mark - +/********************************************************************/ +#pragma mark OSReturn Values for Kernel Extensions +/********************************************************************/ +#endif +/*! + * @group OSReturn Values for Kernel Extensions + * Many kext-related functions return these values, + * as well as those defined under + * <code>@link //apple_ref/c/tdef/OSReturn OSReturn@/link</code> + * and other variants of <code>kern_return_t</code>. + */ + + +#define sub_libkern_kext err_sub(2) +#define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) + + +/*! + * @define kOSKextReturnInternalError + * @abstract An internal error in the kext library. + * Contrast with <code>@link //apple_ref/c/econst/OSReturnError + * OSReturnError@/link</code>. + */ +#define kOSKextReturnInternalError libkern_kext_err(0x1) + +/*! + * @define kOSKextReturnNoMemory + * @abstract Memory allocation failed. + */ +#define kOSKextReturnNoMemory libkern_kext_err(0x2) + +/*! + * @define kOSKextReturnNoResources + * @abstract Some resource other than memory (such as available load tags) + * is exhausted. + */ +#define kOSKextReturnNoResources libkern_kext_err(0x3) + +/*! + * @define kOSKextReturnNotPrivileged + * @abstract The caller lacks privileges to perform the requested operation. + */ +#define kOSKextReturnNotPrivileged libkern_kext_err(0x4) + +/*! + * @define kOSKextReturnInvalidArgument + * @abstract Invalid argument. + */ +#define kOSKextReturnInvalidArgument libkern_kext_err(0x5) + +/*! + * @define kOSKextReturnNotFound + * @abstract Search item not found. + */ +#define kOSKextReturnNotFound libkern_kext_err(0x6) + +/*! + * @define kOSKextReturnBadData + * @abstract Malformed data (not used for XML). + */ +#define kOSKextReturnBadData libkern_kext_err(0x7) + +/*! + * @define kOSKextReturnSerialization + * @abstract Error converting or (un)serializing URL, string, or XML. + */ +#define kOSKextReturnSerialization libkern_kext_err(0x8) + +/*! + * @define kOSKextReturnUnsupported + * @abstract Operation is no longer or not yet supported. + */ +#define kOSKextReturnUnsupported libkern_kext_err(0x9) + +/*! + * @define kOSKextReturnDisabled + * @abstract Operation is currently disabled. + */ +#define kOSKextReturnDisabled libkern_kext_err(0xa) + +/*! + * @define kOSKextReturnNotAKext + * @abstract Bundle is not a kernel extension. + */ +#define kOSKextReturnNotAKext libkern_kext_err(0xb) + +/*! + * @define kOSKextReturnValidation + * @abstract Validation failures encountered; check diagnostics for details. + */ +#define kOSKextReturnValidation libkern_kext_err(0xc) + +/*! + * @define kOSKextReturnAuthentication + * @abstract Authetication failures encountered; check diagnostics for details. + */ +#define kOSKextReturnAuthentication libkern_kext_err(0xd) + +/*! + * @define kOSKextReturnDependencies + * @abstract Dependency resolution failures encountered; check diagnostics for details. + */ +#define kOSKextReturnDependencies libkern_kext_err(0xe) + +/*! + * @define kOSKextReturnArchNotFound + * @abstract Kext does not contain code for the requested architecture. + */ +#define kOSKextReturnArchNotFound libkern_kext_err(0xf) + +/*! + * @define kOSKextReturnCache + * @abstract An error occurred processing a system kext cache. + */ +#define kOSKextReturnCache libkern_kext_err(0x10) + +/*! + * @define kOSKextReturnDeferred + * @abstract Operation has been posted asynchronously to user space (kernel only). + */ +#define kOSKextReturnDeferred libkern_kext_err(0x11) + +/*! + * @define kOSKextReturnBootLevel + * @abstract Kext not loadable or operation not allowed at current boot level. + */ +#define kOSKextReturnBootLevel libkern_kext_err(0x12) + +/*! + * @define kOSKextReturnNotLoadable + * @abstract Kext cannot be loaded; check diagnostics for details. + */ +#define kOSKextReturnNotLoadable libkern_kext_err(0x13) + +/*! + * @define kOSKextReturnLoadedVersionDiffers + * @abstract A different version (or executable UUID, or executable by checksum) + * of the requested kext is already loaded. + */ +#define kOSKextReturnLoadedVersionDiffers libkern_kext_err(0x14) + +/*! + * @define kOSKextReturnDependencyLoadError + * @abstract A load error occurred on a dependency of the kext being loaded. + */ +#define kOSKextReturnDependencyLoadError libkern_kext_err(0x15) + +/*! + * @define kOSKextReturnLinkError + * @abstract A link failure occured with this kext or a dependency. + */ +#define kOSKextReturnLinkError libkern_kext_err(0x16) + +/*! + * @define kOSKextReturnStartStopError + * @abstract The kext start or stop routine returned an error. + */ +#define kOSKextReturnStartStopError libkern_kext_err(0x17) + +/*! + * @define kOSKextReturnInUse + * @abstract The kext is currently in use or has outstanding references, + * and cannot be unloaded. + */ +#define kOSKextReturnInUse libkern_kext_err(0x18) + +/*! + * @define kOSKextReturnTimeout + * @abstract A kext request has timed out. + */ +#define kOSKextReturnTimeout libkern_kext_err(0x19) + +/*! + * @define kOSKextReturnStopping + * @abstract The kext is in the process of stopping; requests cannot be made. + */ +#define kOSKextReturnStopping libkern_kext_err(0x1a) + +#if PRAGMA_MARK +#pragma mark - +/********************************************************************/ +#pragma mark Kext/OSBundle Property List Keys +/********************************************************************/ +#endif +/*! + * @group Kext Property List Keys + * These constants cover CFBundle properties defined for kernel extensions. + * Because they are used in the kernel, if you want to use one with + * CFBundle APIs you'll need to wrap it in a <code>CFSTR()</code> macro. + */ + + +/*! + * @define kOSBundleCompatibleVersionKey + * @abstract A string giving the backwards-compatible version of a library kext + * in extended Mac OS 'vers' format (####.##.##s{1-255} where 's' + * is a build stage 'd', 'a', 'b', 'f' or 'fc'). + */ +#define kOSBundleCompatibleVersionKey "OSBundleCompatibleVersion" + +/*! + * @define kOSBundleEnableKextLoggingKey + * @abstract Set to true to have the kernel kext logging spec applied + * to the kext. + * See <code>@link //apple_ref/c/econst/OSKextLogSpec + * OSKextLogSpec@/link</code>. + */ +#define kOSBundleEnableKextLoggingKey "OSBundleEnableKextLogging" + +/*! + * @define kOSBundleIsInterfaceKey + * @abstract A boolean value indicating whether the kext executable + * contains only symbol references. + */ +#define kOSBundleIsInterfaceKey "OSBundleIsInterface" + +/*! + * @define kOSBundleLibrariesKey + * @abstract A dictionary listing link dependencies for this kext. + * Keys are bundle identifiers, values are version strings. + */ +#define kOSBundleLibrariesKey "OSBundleLibraries" + +/*! + * @define kOSBundleRequiredKey + * @abstract A string indicating in which kinds of startup this kext + * may need to load during early startup (before + * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code>). + * @discussion + * The value is one of: + * <ul> + * <li>@link kOSBundleRequiredRoot "OSBundleRequiredRoot"@/link</li> + * <li>@link kOSBundleRequiredLocalRoot "OSBundleRequiredLocalRoot"@/link</li> + * <li>@link kOSBundleRequiredNetworkRoot "OSBundleRequiredNetworkRoot"@/link</li> + * <li>@link kOSBundleRequiredSafeBoot "OSBundleRequiredSafeBoot"@/link</li> + * <li>@link kOSBundleRequiredConsole "OSBundleRequiredConsole"@/link</li> + * </ul> + * + * Use this property judiciously. + * Every kext that declares a value other than "OSBundleRequiredSafeBoot" + * increases startup time, as the booter must read it into memory, + * or startup kext caches must include it. + */ +#define kOSBundleRequiredKey "OSBundleRequired" + +/*! + * @define kOSBundleAllowUserLoadKey + * @abstract A boolean value indicating whether + * <code>@link //apple_ref/doc/man/8/kextd kextcache(8)@/link</code> + * will honor a non-root process's request to load a kext. + * @discussion + * See <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithURL + * KextManagerLoadKextWithURL@/link</code> + * and <code>@link //apple_ref/doc/compositePage/c/func/KextManagerLoadKextWithIdentifier + * KextManagerLoadKextWithIdentifier@/link</code>. + */ +#define kOSBundleAllowUserLoadKey "OSBundleAllowUserLoad" + +/*! + * @define kOSKernelResourceKey + * @abstract A boolean value indicating whether the kext represents a built-in + * component of the kernel. + */ +#define kOSKernelResourceKey "OSKernelResource" + +/*! + * @define kIOKitPersonalitiesKey + * @abstract A dictionary of dictionaries used in matching for I/O Kit drivers. + */ +#define kIOKitPersonalitiesKey "IOKitPersonalities" + +/* + * @define kIOPersonalityPublisherKey + * @abstract Used in personalities sent to the I/O Kit, + * contains the CFBundleIdentifier of the kext + * that the personality originated in. + */ +#define kIOPersonalityPublisherKey "IOPersonalityPublisher" + + +#if PRAGMA_MARK +/********************************************************************/ +#pragma mark Kext/OSBundle Property Deprecated Keys +/********************************************************************/ +#endif +/* + * @define kOSBundleDebugLevelKey + * @abstract + * Deprecated (used on some releases of Mac OS X prior to 10.6 Snow Leopard). + * Value is an integer from 1-6, corresponding to the verbose levels + * of kext tools on those releases. + * On 10.6 Snow Leopard, use <code>@link OSKextEnableKextLogging + * OSKextEnableKextLogging@/link</code>. + */ +#define kOSBundleDebugLevelKey "OSBundleDebugLevel" + +/*! + * @define kOSBundleSharedExecutableIdentifierKey + * @abstract Deprecated (used on some releases of Mac OS X + * prior to 10.6 Snow Leopard). + * Value is the bundle identifier of the pseudokext + * that contains an executable shared by this kext. + */ +#define kOSBundleSharedExecutableIdentifierKey "OSBundleSharedExecutableIdentifier" + + +#if PRAGMA_MARK +/********************************************************************/ +#pragma mark Kext/OSBundle Property List Values +/********************************************************************/ +#endif + +/*! + * @group Kext Property List Values + * These constants encompass established values + * for kernel extension bundle properties. + */ + +/*! +* @define kOSKextKernelIdentifier +* @abstract +* This is the CFBundleIdentifier user for the kernel itself. +*/ +#define kOSKextKernelIdentifier "__kernel__" + +/*! +* @define kOSBundleRequiredRoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed to mount the root filesystem +* whether starting from a local or a network volume. +*/ +#define kOSBundleRequiredRoot "Root" + +/*! +* @define kOSBundleRequiredLocalRoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed to mount the root filesystem +* when starting from a local disk. +*/ +#define kOSBundleRequiredLocalRoot "Local-Root" + +/*! +* @define kOSBundleRequiredNetworkRoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed to mount the root filesystem +* when starting over a network connection. +*/ +#define kOSBundleRequiredNetworkRoot "Network-Root" + +/*! +* @define kOSBundleRequiredSafeBoot +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext can be loaded during a safe startup. +* This value does not normally cause the kext to be read by the booter +* or included in startup kext caches. +*/ +#define kOSBundleRequiredSafeBoot "Safe Boot" + +/*! +* @define kOSBundleRequiredConsole +* @abstract +* This <code>@link kOSBundleRequiredKey OSBundleRequired@/link</code> +* value indicates that the kext may be needed for console access +* (specifically in a single-user startup when +* <code>@link //apple_ref/doc/man/8/kextd kextd(8)@/link</code>. +* does not run) +* and should be loaded during early startup. +*/ +#define kOSBundleRequiredConsole "Console" + + +#if PRAGMA_MARK +#pragma mark - +/********************************************************************/ +#pragma mark Kext Information +/********************************************************************/ +#endif +/*! + * @group Kext Information + * Types, constants, and macros providing a kext with information + * about itself. + */ + +/*! + * @typedef OSKextLoadTag + * + * @abstract + * A unique identifier assigned to a loaded instanace of a kext. + * + * @discussion + * If a kext is unloaded and later reloaded, the new instance + * has a different load tag. + * + * A kext can get its own load tag in the <code>kmod_info_t</code> + * structure passed into its module start routine, as the + * <code>id</code> field (cast to this type). + * You can use the load tag with the functions + * <code>@link OSKextRetainKextWithLoadTag + * OSKextRetainKextWithLoadTag@/link</code> and + * <code>@link OSKextReleaseKextWithLoadTag + * OSKextReleaseKextWithLoadTag@/link</code>. + */ +typedef uint32_t OSKextLoadTag; + +/*! + * @define kOSKextInvalidLoadTag + * + * @abstract + * A load tag value that will never be used for a loaded kext; + * indicates kext not found. + */ +#define kOSKextInvalidLoadTag ((OSKextLoadTag)(-1)) + + + +__END_DECLS + +#endif /* _LIBKERN_OSKEXTLIB_H */ diff --git a/i386/include/libkern/OSReturn.h b/i386/include/libkern/OSReturn.h new file mode 100644 index 0000000..b5490c9 --- /dev/null +++ b/i386/include/libkern/OSReturn.h @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2000 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Apple Inc. All rights reserved. + * + * HISTORY + * + */ + +/* + * Core OSReturn values. + */ + +#ifndef __LIBKERN_OSRETURN_H +#define __LIBKERN_OSRETURN_H + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#include <mach/error.h> + + +/*! + * @header + * + * Declares functions, basic return values, and other constants + * related to kernel extensions (kexts). + */ + +#if PRAGMA_MARK +#pragma mark Core OSReturn Values for Libkern +#endif +/********************************************************************* +* Core OSReturn Values for Libkern +*********************************************************************/ +/*! + * @group Core OSReturn Values for Libkern + * Some kext and I/O Kit functions can return these values, + * as well as other values of + * <code>kern_return_t</code>. + * + * Many of these return values represent internal errors + * in the Libkern C++ run-time typing information system + * based on @link //apple_ref/doc/class/OSMetaClass OSMetaClass@/link; + * you are unlikely to ever see them. + * + */ + + +/*! + * @typedef OSReturn + * @abstract The return type for many Libkern functions. + */ +typedef kern_return_t OSReturn; + +#ifndef sys_libkern +#define sys_libkern err_system(0x37) +#endif /* sys_libkern */ + +#define sub_libkern_common err_sub(0) +#define sub_libkern_metaclass err_sub(1) +#define sub_libkern_reserved err_sub(-1) + +#define libkern_common_err(return) (sys_libkern|sub_libkern_common|(return)) +#define libkern_metaclass_err(return) (sys_libkern|sub_libkern_metaclass|(return)) + +/* See OSKextLib.h for these + * #define sub_libkern_kext err_sub(2) + * #define libkern_kext_err(code) (sys_libkern|sub_libkern_kext|(code)) + */ + +/*! + * @define kOSReturnSuccess + * @abstract Operation successful. + * Equal to <code>@link //apple_ref/c/econst/KERN_SUCCESS + * KERN_SUCCESS@/link</code>. + */ +#define kOSReturnSuccess KERN_SUCCESS + +/*! + * @define kOSReturnError + * @abstract Unspecified Libkern error. + * <b>Not equal</b> to + * <code>@link //apple_ref/c/econst/KERN_FAILURE + * KERN_FAILURE@/link</code>. + */ +#define kOSReturnError libkern_common_err(1) + +/*! + * @define kOSMetaClassInternal + * @abstract Internal OSMetaClass run-time error. + */ +#define kOSMetaClassInternal libkern_metaclass_err(1) + +/*! + * @define kOSMetaClassHasInstances + * @abstract A kext cannot be unloaded because there are instances + * derived from Libkern C++ classes that it defines. + */ +#define kOSMetaClassHasInstances libkern_metaclass_err(2) + +/*! + * @define kOSMetaClassNoInit + * @abstract Internal error: The Libkern C++ class registration system + * was not properly initialized during kext loading. + */ +#define kOSMetaClassNoInit libkern_metaclass_err(3) +// OSMetaClass::preModLoad wasn't called, runtime internal error + +/*! + * @define kOSMetaClassNoTempData + * @abstract Internal error: An allocation failure occurred + * registering Libkern C++ classes during kext loading. + */ +#define kOSMetaClassNoTempData libkern_metaclass_err(4) +// Allocation failure internal data + +/*! + * @define kOSMetaClassNoDicts + * @abstract Internal error: An allocation failure occurred + * registering Libkern C++ classes during kext loading. + */ +#define kOSMetaClassNoDicts libkern_metaclass_err(5) +// Allocation failure for Metaclass internal dictionaries + +/*! + * @define kOSMetaClassNoKModSet + * @abstract Internal error: An allocation failure occurred + * registering Libkern C++ classes during kext loading. + */ +#define kOSMetaClassNoKModSet libkern_metaclass_err(6) +// Allocation failure for internal kmodule set + +/*! + * @define kOSMetaClassNoInsKModSet + * @abstract Internal error: An error occurred registering + * a specific Libkern C++ class during kext loading. + */ +#define kOSMetaClassNoInsKModSet libkern_metaclass_err(7) +// Can't insert the KMod set into the module dictionary + +/*! + * @define kOSMetaClassNoSuper + * @abstract Internal error: No superclass can be found + * for a specific Libkern C++ class during kext loading. + */ +#define kOSMetaClassNoSuper libkern_metaclass_err(8) + +/*! + * @define kOSMetaClassInstNoSuper + * @abstract Internal error: No superclass can be found when constructing + * an instance of a Libkern C++ class. + */ +#define kOSMetaClassInstNoSuper libkern_metaclass_err(9) + +/*! + * @define kOSMetaClassDuplicateClass + * @abstract A duplicate Libkern C++ classname was encountered + * during kext loading. + */ +#define kOSMetaClassDuplicateClass libkern_metaclass_err(10) + +/*! + * @define kOSMetaClassNoKext + * @abstract Internal error: The kext for a Libkern C++ class + * can't be found during kext loading. + */ +#define kOSMetaClassNoKext libkern_metaclass_err(11) + +__END_DECLS + +#endif /* ! __LIBKERN_OSRETURN_H */ diff --git a/i386/include/libkern/OSTypes.h b/i386/include/libkern/OSTypes.h new file mode 100644 index 0000000..6a03a27 --- /dev/null +++ b/i386/include/libkern/OSTypes.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * HISTORY + * + */ + +#ifndef _OS_OSTYPES_H +#define _OS_OSTYPES_H + +#define OSTYPES_K64_REV 2 + +typedef unsigned int UInt; +typedef signed int SInt; + +#ifndef __MACTYPES__ /* CF MacTypes.h */ +#ifndef __TYPES__ /* guess... Mac Types.h */ + +typedef unsigned char UInt8; +typedef unsigned short UInt16; +#if __LP64__ +typedef unsigned int UInt32; +#else +typedef unsigned long UInt32; +#endif +typedef unsigned long long UInt64; +#if defined(__BIG_ENDIAN__) +typedef struct UnsignedWide { + UInt32 hi; + UInt32 lo; +} UnsignedWide; +#elif defined(__LITTLE_ENDIAN__) +typedef struct UnsignedWide { + UInt32 lo; + UInt32 hi; +} UnsignedWide; +#else +#error Unknown endianess. +#endif + +typedef signed char SInt8; +typedef signed short SInt16; +#if __LP64__ +typedef signed int SInt32; +#else +typedef signed long SInt32; +#endif +typedef signed long long SInt64; +#if defined(__BIG_ENDIAN__) +typedef struct wide { + SInt32 hi; + UInt32 lo; +} wide; +#elif defined(__LITTLE_ENDIAN__) +typedef struct wide { + UInt32 lo; + SInt32 hi; +} wide; +#else +#error Unknown endianess. +#endif + +typedef SInt32 OSStatus; + +#if defined(__LP64__) && defined(KERNEL) +#ifndef ABSOLUTETIME_SCALAR_TYPE +#define ABSOLUTETIME_SCALAR_TYPE 1 +#endif +typedef UInt64 AbsoluteTime; +#else +typedef UnsignedWide AbsoluteTime; +#endif + +typedef UInt32 OptionBits; + +#if defined(KERNEL) && defined(__LP64__) +/* + * Use intrinsic boolean types for the LP64 kernel, otherwise maintain + * source and binary backward compatibility. This attempts to resolve + * the "(x == true)" vs. "(x)" conditional issue. + */ +#ifdef __cplusplus +typedef bool Boolean; +#else /* !__cplusplus */ +#if defined(__STDC_VERSION__) && ((__STDC_VERSION__ - 199901L) > 0L) +/* only use this if we are sure we are using a c99 compiler */ +typedef _Bool Boolean; +#else /* !c99 */ +/* Fall back to previous definition unless c99 */ +typedef unsigned char Boolean; +#endif /* !c99 */ +#endif /* !__cplusplus */ +#else /* !(KERNEL && __LP64__) */ +typedef unsigned char Boolean; +#endif /* !(KERNEL && __LP64__) */ + +#endif /* __TYPES__ */ +#endif /* __MACTYPES__ */ + +#if !defined(OS_INLINE) +# define OS_INLINE static inline +#endif + +#endif /* _OS_OSTYPES_H */ diff --git a/i386/include/libkern/_OSByteOrder.h b/i386/include/libkern/_OSByteOrder.h new file mode 100644 index 0000000..d8806fc --- /dev/null +++ b/i386/include/libkern/_OSByteOrder.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS__OSBYTEORDER_H +#define _OS__OSBYTEORDER_H + +/* + * This header is normally included from <libkern/OSByteOrder.h>. However, + * <sys/_endian.h> also includes this in the case of little-endian + * architectures, so that we can map OSByteOrder routines to the hton* and ntoh* + * macros. This results in the asymmetry below; we only include + * <libkern/arch/_OSByteOrder.h> for little-endian architectures. + */ + +//#include <sys/_types.h> + +/* Macros for swapping constant values in the preprocessing stage. */ +#define __DARWIN_OSSwapConstInt16(x) \ + ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \ + (((__uint16_t)(x) & 0x00ff) << 8))) + +#define __DARWIN_OSSwapConstInt32(x) \ + ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | \ + (((__uint32_t)(x) & 0x00ff0000) >> 8) | \ + (((__uint32_t)(x) & 0x0000ff00) << 8) | \ + (((__uint32_t)(x) & 0x000000ff) << 24))) + +#define __DARWIN_OSSwapConstInt64(x) \ + ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \ + (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \ + (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \ + (((__uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \ + (((__uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \ + (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \ + (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \ + (((__uint64_t)(x) & 0x00000000000000ffULL) << 56))) + +#if defined(__GNUC__) + +#if defined(__i386__) || defined(__x86_64__) +#include <libkern/i386/_OSByteOrder.h> +#endif + +#if defined(__arm__) +#include <libkern/arm/OSByteOrder.h> +#endif + + +#define __DARWIN_OSSwapInt16(x) \ + (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)) + +#define __DARWIN_OSSwapInt32(x) \ + (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x)) + +#define __DARWIN_OSSwapInt64(x) \ + (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x)) + +#else /* ! __GNUC__ */ + +#if defined(__i386__) || defined(__x86_64__) + +#if !defined(__DARWIN_OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __DARWIN_OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define __DARWIN_OS_INLINE static inline +# else +# define __DARWIN_OS_INLINE static __inline__ +# endif +#endif + +__DARWIN_OS_INLINE +uint16_t +_OSSwapInt16( + uint16_t data +) +{ + return __DARWIN_OSSwapConstInt16(data); +} + +__DARWIN_OS_INLINE +uint32_t +_OSSwapInt32( + uint32_t data +) +{ + return __DARWIN_OSSwapConstInt32(data); +} + +__DARWIN_OS_INLINE +uint64_t +_OSSwapInt64( + uint64_t data +) +{ + return __DARWIN_OSSwapConstInt64(data); +} +#endif + +#define __DARWIN_OSSwapInt16(x) _OSSwapInt16(x) + +#define __DARWIN_OSSwapInt32(x) _OSSwapInt32(x) + +#define __DARWIN_OSSwapInt64(x) _OSSwapInt64(x) + +#endif /* __GNUC__ */ + +#endif /* ! _OS__OSBYTEORDER_H */ diff --git a/i386/include/libkern/crypto/.svn/all-wcprops b/i386/include/libkern/crypto/.svn/all-wcprops new file mode 100644 index 0000000..d72b6fa --- /dev/null +++ b/i386/include/libkern/crypto/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/crypto +END +sha1.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/crypto/sha1.h +END +md5.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/crypto/md5.h +END diff --git a/i386/include/libkern/crypto/.svn/entries b/i386/include/libkern/crypto/.svn/entries new file mode 100644 index 0000000..9026c23 --- /dev/null +++ b/i386/include/libkern/crypto/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/libkern/crypto +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +sha1.h +file + + + + +2013-08-27T23:54:46.000000Z +64f571a35e1627bc4dd9e023b98465eb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2313 + +md5.h +file + + + + +2013-08-27T23:54:46.000000Z +664019079c0179330782d574333c5a2d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2858 + diff --git a/i386/include/libkern/crypto/.svn/text-base/md5.h.svn-base b/i386/include/libkern/crypto/.svn/text-base/md5.h.svn-base new file mode 100644 index 0000000..57e826a --- /dev/null +++ b/i386/include/libkern/crypto/.svn/text-base/md5.h.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * MD5.H - header file for MD5.C + */ + +/* + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD5 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD5 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + */ + +#ifndef _CRYPTO_MD5_H_ +#define _CRYPTO_MD5_H_ + +#include <sys/types.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define MD5_DIGEST_LENGTH 16 + +/* MD5 context. */ +typedef struct { + u_int32_t state[4]; /* state (ABCD) */ + u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} MD5_CTX; + +extern void MD5Init(MD5_CTX *); +extern void MD5Update(MD5_CTX *, const void *, unsigned int); +extern void MD5Final(unsigned char [MD5_DIGEST_LENGTH], MD5_CTX *); + +__END_DECLS + +#endif /* _CRYPTO_MD5_H_ */ diff --git a/i386/include/libkern/crypto/.svn/text-base/sha1.h.svn-base b/i386/include/libkern/crypto/.svn/text-base/sha1.h.svn-base new file mode 100644 index 0000000..9acc46b --- /dev/null +++ b/i386/include/libkern/crypto/.svn/text-base/sha1.h.svn-base @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _CRYPTO_SHA1_H_ +#define _CRYPTO_SHA1_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define SHA_DIGEST_LENGTH 20 +#define SHA1_RESULTLEN SHA_DIGEST_LENGTH + +typedef struct sha1_ctxt { + union { + u_int8_t b8[20]; + u_int32_t b32[5]; /* state (ABCDE) */ + } h; + union { + u_int8_t b8[8]; + u_int32_t b32[2]; + u_int64_t b64[1]; /* # of bits, modulo 2^64 (msb first) */ + } c; + union { + u_int8_t b8[64]; + u_int32_t b32[16]; /* input buffer */ + } m; + u_int8_t count; /* unused; for compatibility only */ +} SHA1_CTX; + +/* For compatibility with the other SHA-1 implementation. */ +#define sha1_init(c) SHA1Init(c) +#define sha1_loop(c, b, l) SHA1Update(c, b, l) +#define sha1_result(c, b) SHA1Final(b, c) + +extern void SHA1Init(SHA1_CTX *); +extern void SHA1Update(SHA1_CTX *, const void *, size_t); +extern void SHA1UpdateUsePhysicalAddress(SHA1_CTX *, const void *, size_t); +extern void SHA1Final(void *, SHA1_CTX *); + +#ifdef __cplusplus +} +#endif + +#endif /*_CRYPTO_SHA1_H_*/ diff --git a/i386/include/libkern/crypto/md5.h b/i386/include/libkern/crypto/md5.h new file mode 100644 index 0000000..57e826a --- /dev/null +++ b/i386/include/libkern/crypto/md5.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * MD5.H - header file for MD5.C + */ + +/* + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD5 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD5 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + */ + +#ifndef _CRYPTO_MD5_H_ +#define _CRYPTO_MD5_H_ + +#include <sys/types.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#define MD5_DIGEST_LENGTH 16 + +/* MD5 context. */ +typedef struct { + u_int32_t state[4]; /* state (ABCD) */ + u_int32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ + unsigned char buffer[64]; /* input buffer */ +} MD5_CTX; + +extern void MD5Init(MD5_CTX *); +extern void MD5Update(MD5_CTX *, const void *, unsigned int); +extern void MD5Final(unsigned char [MD5_DIGEST_LENGTH], MD5_CTX *); + +__END_DECLS + +#endif /* _CRYPTO_MD5_H_ */ diff --git a/i386/include/libkern/crypto/sha1.h b/i386/include/libkern/crypto/sha1.h new file mode 100644 index 0000000..9acc46b --- /dev/null +++ b/i386/include/libkern/crypto/sha1.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _CRYPTO_SHA1_H_ +#define _CRYPTO_SHA1_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define SHA_DIGEST_LENGTH 20 +#define SHA1_RESULTLEN SHA_DIGEST_LENGTH + +typedef struct sha1_ctxt { + union { + u_int8_t b8[20]; + u_int32_t b32[5]; /* state (ABCDE) */ + } h; + union { + u_int8_t b8[8]; + u_int32_t b32[2]; + u_int64_t b64[1]; /* # of bits, modulo 2^64 (msb first) */ + } c; + union { + u_int8_t b8[64]; + u_int32_t b32[16]; /* input buffer */ + } m; + u_int8_t count; /* unused; for compatibility only */ +} SHA1_CTX; + +/* For compatibility with the other SHA-1 implementation. */ +#define sha1_init(c) SHA1Init(c) +#define sha1_loop(c, b, l) SHA1Update(c, b, l) +#define sha1_result(c, b) SHA1Final(b, c) + +extern void SHA1Init(SHA1_CTX *); +extern void SHA1Update(SHA1_CTX *, const void *, size_t); +extern void SHA1UpdateUsePhysicalAddress(SHA1_CTX *, const void *, size_t); +extern void SHA1Final(void *, SHA1_CTX *); + +#ifdef __cplusplus +} +#endif + +#endif /*_CRYPTO_SHA1_H_*/ diff --git a/i386/include/libkern/i386/.svn/all-wcprops b/i386/include/libkern/i386/.svn/all-wcprops new file mode 100644 index 0000000..85a3db1 --- /dev/null +++ b/i386/include/libkern/i386/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/i386 +END +_OSByteOrder.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/i386/_OSByteOrder.h +END +OSByteOrder.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/i386/OSByteOrder.h +END diff --git a/i386/include/libkern/i386/.svn/entries b/i386/include/libkern/i386/.svn/entries new file mode 100644 index 0000000..02cf309 --- /dev/null +++ b/i386/include/libkern/i386/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/libkern/i386 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +_OSByteOrder.h +file + + + + +2013-08-27T23:54:47.000000Z +a8bd5fb42158e8d60e627c0faaa3490f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2727 + +OSByteOrder.h +file + + + + +2013-08-27T23:54:47.000000Z +71e1df45ef9e4fcb900d8aa143a4e181 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2957 + diff --git a/i386/include/libkern/i386/.svn/text-base/OSByteOrder.h.svn-base b/i386/include/libkern/i386/.svn/text-base/OSByteOrder.h.svn-base new file mode 100644 index 0000000..7f19736 --- /dev/null +++ b/i386/include/libkern/i386/.svn/text-base/OSByteOrder.h.svn-base @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERI386_H +#define _OS_OSBYTEORDERI386_H + +#include <stdint.h> +#include <libkern/i386/_OSByteOrder.h> + +#if !defined(OS_INLINE) +#define OS_INLINE __DARWIN_OS_INLINE +#endif + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t result; + + result = *(volatile uint16_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt16(result); +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t result; + + result = *(volatile uint32_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt32(result); +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint64_t result; + + result = *(volatile uint64_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt64(result); +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); +} + +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); +} + +#endif /* ! _OS_OSBYTEORDERI386_H */ diff --git a/i386/include/libkern/i386/.svn/text-base/_OSByteOrder.h.svn-base b/i386/include/libkern/i386/.svn/text-base/_OSByteOrder.h.svn-base new file mode 100644 index 0000000..51477bb --- /dev/null +++ b/i386/include/libkern/i386/.svn/text-base/_OSByteOrder.h.svn-base @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS__OSBYTEORDERI386_H +#define _OS__OSBYTEORDERI386_H + +#if !defined(__DARWIN_OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __DARWIN_OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define __DARWIN_OS_INLINE static inline +# else +# define __DARWIN_OS_INLINE static __inline__ +# endif +#endif + +/* Generic byte swapping functions. */ + +__DARWIN_OS_INLINE +__uint16_t +_OSSwapInt16( + __uint16_t _data +) +{ + return ((_data << 8) | (_data >> 8)); +} + +__DARWIN_OS_INLINE +__uint32_t +_OSSwapInt32( + __uint32_t _data +) +{ +#if defined(__llvm__) + return __builtin_bswap32(_data); +#else + __asm__ ("bswap %0" : "+r" (_data)); + return _data; +#endif +} + +#if defined(__llvm__) +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + return __builtin_bswap64(_data); +} + +#elif defined(__i386__) +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + __asm__ ("bswap %%eax\n\t" + "bswap %%edx\n\t" + "xchgl %%eax, %%edx" + : "+A" (_data)); + return _data; +} +#elif defined(__x86_64__) +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + __asm__ ("bswap %0" : "+r" (_data)); + return _data; +} +#else +#error Unknown architecture +#endif + +#endif /* ! _OS__OSBYTEORDERI386_H */ diff --git a/i386/include/libkern/i386/OSByteOrder.h b/i386/include/libkern/i386/OSByteOrder.h new file mode 100644 index 0000000..7f19736 --- /dev/null +++ b/i386/include/libkern/i386/OSByteOrder.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERI386_H +#define _OS_OSBYTEORDERI386_H + +#include <stdint.h> +#include <libkern/i386/_OSByteOrder.h> + +#if !defined(OS_INLINE) +#define OS_INLINE __DARWIN_OS_INLINE +#endif + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t result; + + result = *(volatile uint16_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt16(result); +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t result; + + result = *(volatile uint32_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt32(result); +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint64_t result; + + result = *(volatile uint64_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt64(result); +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); +} + +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); +} + +#endif /* ! _OS_OSBYTEORDERI386_H */ diff --git a/i386/include/libkern/i386/_OSByteOrder.h b/i386/include/libkern/i386/_OSByteOrder.h new file mode 100644 index 0000000..51477bb --- /dev/null +++ b/i386/include/libkern/i386/_OSByteOrder.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS__OSBYTEORDERI386_H +#define _OS__OSBYTEORDERI386_H + +#if !defined(__DARWIN_OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define __DARWIN_OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define __DARWIN_OS_INLINE static inline +# else +# define __DARWIN_OS_INLINE static __inline__ +# endif +#endif + +/* Generic byte swapping functions. */ + +__DARWIN_OS_INLINE +__uint16_t +_OSSwapInt16( + __uint16_t _data +) +{ + return ((_data << 8) | (_data >> 8)); +} + +__DARWIN_OS_INLINE +__uint32_t +_OSSwapInt32( + __uint32_t _data +) +{ +#if defined(__llvm__) + return __builtin_bswap32(_data); +#else + __asm__ ("bswap %0" : "+r" (_data)); + return _data; +#endif +} + +#if defined(__llvm__) +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + return __builtin_bswap64(_data); +} + +#elif defined(__i386__) +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + __asm__ ("bswap %%eax\n\t" + "bswap %%edx\n\t" + "xchgl %%eax, %%edx" + : "+A" (_data)); + return _data; +} +#elif defined(__x86_64__) +__DARWIN_OS_INLINE +__uint64_t +_OSSwapInt64( + __uint64_t _data +) +{ + __asm__ ("bswap %0" : "+r" (_data)); + return _data; +} +#else +#error Unknown architecture +#endif + +#endif /* ! _OS__OSBYTEORDERI386_H */ diff --git a/i386/include/libkern/machine/.svn/all-wcprops b/i386/include/libkern/machine/.svn/all-wcprops new file mode 100644 index 0000000..0e56fd3 --- /dev/null +++ b/i386/include/libkern/machine/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/machine +END +OSByteOrder.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/machine/OSByteOrder.h +END diff --git a/i386/include/libkern/machine/.svn/entries b/i386/include/libkern/machine/.svn/entries new file mode 100644 index 0000000..e62f345 --- /dev/null +++ b/i386/include/libkern/machine/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/libkern/machine +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +OSByteOrder.h +file + + + + +2013-08-27T23:54:46.000000Z +a659fe4b6effae4dd324d0bcd02298fd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3670 + diff --git a/i386/include/libkern/machine/.svn/text-base/OSByteOrder.h.svn-base b/i386/include/libkern/machine/.svn/text-base/OSByteOrder.h.svn-base new file mode 100644 index 0000000..4860215 --- /dev/null +++ b/i386/include/libkern/machine/.svn/text-base/OSByteOrder.h.svn-base @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERMACHINE_H +#define _OS_OSBYTEORDERMACHINE_H + +#include <stdint.h> + +#if !defined(OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define OS_INLINE static inline +# else +# define OS_INLINE static __inline__ +# endif +#endif + +/* Generic byte swapping functions. */ + +OS_INLINE +uint16_t +_OSSwapInt16( + uint16_t data +) +{ + return OSSwapConstInt16(data); +} + +OS_INLINE +uint32_t +_OSSwapInt32( + uint32_t data +) +{ + return OSSwapConstInt32(data); +} + +OS_INLINE +uint64_t +_OSSwapInt64( + uint64_t data +) +{ + return OSSwapConstInt64(data); +} + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t data = *(volatile uint16_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt16(data); +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t data = *(volatile uint32_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt32(data); +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint64_t data = *(volatile uint64_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt64(data); +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); +} + +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); +} + +#endif /* ! _OS_OSBYTEORDERMACHINE_H */ diff --git a/i386/include/libkern/machine/OSByteOrder.h b/i386/include/libkern/machine/OSByteOrder.h new file mode 100644 index 0000000..4860215 --- /dev/null +++ b/i386/include/libkern/machine/OSByteOrder.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERMACHINE_H +#define _OS_OSBYTEORDERMACHINE_H + +#include <stdint.h> + +#if !defined(OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define OS_INLINE static inline +# else +# define OS_INLINE static __inline__ +# endif +#endif + +/* Generic byte swapping functions. */ + +OS_INLINE +uint16_t +_OSSwapInt16( + uint16_t data +) +{ + return OSSwapConstInt16(data); +} + +OS_INLINE +uint32_t +_OSSwapInt32( + uint32_t data +) +{ + return OSSwapConstInt32(data); +} + +OS_INLINE +uint64_t +_OSSwapInt64( + uint64_t data +) +{ + return OSSwapConstInt64(data); +} + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t data = *(volatile uint16_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt16(data); +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t data = *(volatile uint32_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt32(data); +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint64_t data = *(volatile uint64_t *)((uintptr_t)base + byteOffset); + return _OSSwapInt64(data); +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + *(volatile uint16_t *)((uintptr_t)base + byteOffset) = _OSSwapInt16(data); +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + *(volatile uint32_t *)((uintptr_t)base + byteOffset) = _OSSwapInt32(data); +} + +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + *(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data); +} + +#endif /* ! _OS_OSBYTEORDERMACHINE_H */ diff --git a/i386/include/libkern/ppc/.svn/all-wcprops b/i386/include/libkern/ppc/.svn/all-wcprops new file mode 100644 index 0000000..9960e73 --- /dev/null +++ b/i386/include/libkern/ppc/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/ppc +END +OSByteOrder.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/libkern/ppc/OSByteOrder.h +END diff --git a/i386/include/libkern/ppc/.svn/entries b/i386/include/libkern/ppc/.svn/entries new file mode 100644 index 0000000..6739ee4 --- /dev/null +++ b/i386/include/libkern/ppc/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/libkern/ppc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +OSByteOrder.h +file + + + + +2013-08-27T23:54:46.000000Z +e8cb15ab25f4382445803331b69937aa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4962 + diff --git a/i386/include/libkern/ppc/.svn/text-base/OSByteOrder.h.svn-base b/i386/include/libkern/ppc/.svn/text-base/OSByteOrder.h.svn-base new file mode 100644 index 0000000..c666685 --- /dev/null +++ b/i386/include/libkern/ppc/.svn/text-base/OSByteOrder.h.svn-base @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERPPC_H +#define _OS_OSBYTEORDERPPC_H + +#include <stdint.h> + +#if !defined(OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define OS_INLINE static inline +# else +# define OS_INLINE static __inline__ +# endif +#endif + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t result; + volatile uint16_t *addr = (volatile uint16_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + result = *addr; + result = ((result << 8) | (result >> 8)); +#else + __asm__ ("lhbrx %0, %2, %1" + : "=r" (result) + : "r" (base), "bO" (byteOffset), "m" (*addr)); +#endif + + return result; +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t result; + volatile uint32_t *addr = (volatile uint32_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + result = __builtin_bswap32(*addr); +#else + __asm__ ("lwbrx %0, %2, %1" + : "=r" (result) + : "r" (base), "bO" (byteOffset), "m" (*addr)); +#endif + + return result; +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + volatile uint64_t *addr = (volatile uint64_t *)((uintptr_t)base + byteOffset); + union { + uint64_t u64; + uint32_t u32[2]; + } u; + +#if defined(__llvm__) + u.u64 = __builtin_bswap64(*addr); +#else + __asm__ ("lwbrx %0, %3, %2\n\t" + "lwbrx %1, %4, %2" + : "=&r" (u.u32[1]), "=r" (u.u32[0]) + : "r" (base), "bO" (byteOffset), "b" (byteOffset + 4), "m" (*addr)); +#endif + + return u.u64; +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + volatile uint16_t *addr = (volatile uint16_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + *addr = ((data >> 8) | (data << 8)); +#else + __asm__ ("sthbrx %1, %3, %2" + : "=m" (*addr) + : "r" (data), "r" (base), "bO" (byteOffset)); +#endif +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + volatile uint32_t *addr = (volatile uint32_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + *addr = __builtin_bswap32(data); +#else + __asm__ ("stwbrx %1, %3, %2" + : "=m" (*addr) + : "r" (data), "r" (base), "bO" (byteOffset)); +#endif +} + +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + volatile uint64_t *addr = (volatile uint64_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + *addr = __builtin_bswap64(data); +#else + uint32_t hi = (uint32_t)(data >> 32); + uint32_t lo = (uint32_t)(data & 0xffffffff); + + __asm__ ("stwbrx %1, %4, %3\n\t" + "stwbrx %2, %5, %3" + : "=m" (*addr) + : "r" (lo), "r" (hi), "r" (base), "bO" (byteOffset), "b" (byteOffset + 4)); +#endif +} + +/* Generic byte swapping functions. */ + +OS_INLINE +uint16_t +_OSSwapInt16( + uint16_t data +) +{ + return OSReadSwapInt16(&data, 0); +} + +OS_INLINE +uint32_t +_OSSwapInt32( + uint32_t data +) +{ + return OSReadSwapInt32(&data, 0); +} + +OS_INLINE +uint64_t +_OSSwapInt64( + uint64_t data +) +{ + return OSReadSwapInt64(&data, 0); +} + +#endif /* ! _OS_OSBYTEORDERPPC_H */ diff --git a/i386/include/libkern/ppc/OSByteOrder.h b/i386/include/libkern/ppc/OSByteOrder.h new file mode 100644 index 0000000..c666685 --- /dev/null +++ b/i386/include/libkern/ppc/OSByteOrder.h @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _OS_OSBYTEORDERPPC_H +#define _OS_OSBYTEORDERPPC_H + +#include <stdint.h> + +#if !defined(OS_INLINE) +# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +# define OS_INLINE static inline +# elif defined(__MWERKS__) || defined(__cplusplus) +# define OS_INLINE static inline +# else +# define OS_INLINE static __inline__ +# endif +#endif + +/* Functions for byte reversed loads. */ + +OS_INLINE +uint16_t +OSReadSwapInt16( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint16_t result; + volatile uint16_t *addr = (volatile uint16_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + result = *addr; + result = ((result << 8) | (result >> 8)); +#else + __asm__ ("lhbrx %0, %2, %1" + : "=r" (result) + : "r" (base), "bO" (byteOffset), "m" (*addr)); +#endif + + return result; +} + +OS_INLINE +uint32_t +OSReadSwapInt32( + const volatile void * base, + uintptr_t byteOffset +) +{ + uint32_t result; + volatile uint32_t *addr = (volatile uint32_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + result = __builtin_bswap32(*addr); +#else + __asm__ ("lwbrx %0, %2, %1" + : "=r" (result) + : "r" (base), "bO" (byteOffset), "m" (*addr)); +#endif + + return result; +} + +OS_INLINE +uint64_t +OSReadSwapInt64( + const volatile void * base, + uintptr_t byteOffset +) +{ + volatile uint64_t *addr = (volatile uint64_t *)((uintptr_t)base + byteOffset); + union { + uint64_t u64; + uint32_t u32[2]; + } u; + +#if defined(__llvm__) + u.u64 = __builtin_bswap64(*addr); +#else + __asm__ ("lwbrx %0, %3, %2\n\t" + "lwbrx %1, %4, %2" + : "=&r" (u.u32[1]), "=r" (u.u32[0]) + : "r" (base), "bO" (byteOffset), "b" (byteOffset + 4), "m" (*addr)); +#endif + + return u.u64; +} + +/* Functions for byte reversed stores. */ + +OS_INLINE +void +OSWriteSwapInt16( + volatile void * base, + uintptr_t byteOffset, + uint16_t data +) +{ + volatile uint16_t *addr = (volatile uint16_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + *addr = ((data >> 8) | (data << 8)); +#else + __asm__ ("sthbrx %1, %3, %2" + : "=m" (*addr) + : "r" (data), "r" (base), "bO" (byteOffset)); +#endif +} + +OS_INLINE +void +OSWriteSwapInt32( + volatile void * base, + uintptr_t byteOffset, + uint32_t data +) +{ + volatile uint32_t *addr = (volatile uint32_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + *addr = __builtin_bswap32(data); +#else + __asm__ ("stwbrx %1, %3, %2" + : "=m" (*addr) + : "r" (data), "r" (base), "bO" (byteOffset)); +#endif +} + +OS_INLINE +void +OSWriteSwapInt64( + volatile void * base, + uintptr_t byteOffset, + uint64_t data +) +{ + volatile uint64_t *addr = (volatile uint64_t *)((uintptr_t)base + byteOffset); + +#if defined(__llvm__) + *addr = __builtin_bswap64(data); +#else + uint32_t hi = (uint32_t)(data >> 32); + uint32_t lo = (uint32_t)(data & 0xffffffff); + + __asm__ ("stwbrx %1, %4, %3\n\t" + "stwbrx %2, %5, %3" + : "=m" (*addr) + : "r" (lo), "r" (hi), "r" (base), "bO" (byteOffset), "b" (byteOffset + 4)); +#endif +} + +/* Generic byte swapping functions. */ + +OS_INLINE +uint16_t +_OSSwapInt16( + uint16_t data +) +{ + return OSReadSwapInt16(&data, 0); +} + +OS_INLINE +uint32_t +_OSSwapInt32( + uint32_t data +) +{ + return OSReadSwapInt32(&data, 0); +} + +OS_INLINE +uint64_t +_OSSwapInt64( + uint64_t data +) +{ + return OSReadSwapInt64(&data, 0); +} + +#endif /* ! _OS_OSBYTEORDERPPC_H */ diff --git a/i386/include/limits.h b/i386/include/limits.h new file mode 100644 index 0000000..a117167 --- /dev/null +++ b/i386/include/limits.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: limits.h,v 1.8 1996/10/21 05:10:50 jtc Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)limits.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _LIMITS_H_ +#define _LIMITS_H_ + +#include <sys/cdefs.h> +#include <i386/limits.h> +#include <sys/syslimits.h> + +#if !defined(_ANSI_SOURCE) +#define _POSIX_AIO_LISTIO_MAX 2 +#define _POSIX_AIO_MAX 1 +#define _POSIX_DELAYTIMER_MAX 32 +#define _POSIX_HOST_NAME_MAX 255 +#define _POSIX_LOGIN_NAME_MAX 9 +#define _POSIX_MQ_OPEN_MAX 8 +#define _POSIX_MQ_PRIO_MAX 32 + +#define _POSIX_ARG_MAX 4096 +#define _POSIX_CHILD_MAX 25 +#define _POSIX_LINK_MAX 8 +#define _POSIX_MAX_CANON 255 +#define _POSIX_MAX_INPUT 255 +#define _POSIX_NAME_MAX 14 +#define _POSIX_NGROUPS_MAX 8 +#define _POSIX_OPEN_MAX 20 +#define _POSIX_PATH_MAX 256 +#define _POSIX_PIPE_BUF 512 +#define _POSIX_SSIZE_MAX 32767 +#define _POSIX_STREAM_MAX 8 +#define _POSIX_TZNAME_MAX 6 + +#define _POSIX_RE_DUP_MAX 255 +#define _POSIX_RTSIG_MAX 8 +#define _POSIX_SEM_NSEMS_MAX 256 +#define _POSIX_SEM_VALUE_MAX 32767 +#define _POSIX_SIGQUEUE_MAX 32 +#define _POSIX_SS_REPL_MAX 4 +#define _POSIX_SYMLINK_MAX 255 +#define _POSIX_SYMLOOP_MAX 8 +#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 +#define _POSIX_THREAD_KEYS_MAX 128 +#define _POSIX_THREAD_THREADS_MAX 64 +#define _POSIX_TIMER_MAX 32 +#define _POSIX_TRACE_EVENT_NAME_MAX 30 +#define _POSIX_TRACE_NAME_MAX 8 +#define _POSIX_TRACE_SYS_MAX 8 +#define _POSIX_TRACE_USER_EVENT_MAX 32 +#define _POSIX_TTY_NAME_MAX 9 + +#define _POSIX2_BC_BASE_MAX 99 +#define _POSIX2_BC_DIM_MAX 2048 +#define _POSIX2_BC_SCALE_MAX 99 +#define _POSIX2_BC_STRING_MAX 1000 +#define _POSIX2_CHARCLASS_NAME_MAX 14 +#define _POSIX2_COLL_WEIGHTS_MAX 2 +#define _POSIX2_EQUIV_CLASS_MAX 2 +#define _POSIX2_EXPR_NEST_MAX 32 +#define _POSIX2_LINE_MAX 2048 +#define _POSIX2_RE_DUP_MAX 255 + +#define PTHREAD_STACK_MIN 8192 +#define PTHREAD_DESTRUCTOR_ITERATIONS 4 +#define PTHREAD_KEYS_MAX 512 + +#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define PASS_MAX 128 +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#define NL_ARGMAX 9 +#define NL_LANGMAX 14 +#define NL_MSGMAX 32767 +#define NL_NMAX 1 +#define NL_SETMAX 255 +#define NL_TEXTMAX 2048 + +#define _XOPEN_IOV_MAX 16 +#define IOV_MAX 1024 +#define _XOPEN_NAME_MAX 255 +#define _XOPEN_PATH_MAX 1024 + +#endif /* _ANSI_SOURCE */ + +/* NZERO to be defined here. TBD. See also sys/param.h */ + +#endif /* !_LIMITS_H_ */ + diff --git a/i386/include/locale.h b/i386/include/locale.h new file mode 100644 index 0000000..ab28ceb --- /dev/null +++ b/i386/include/locale.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)locale.h 8.1 (Berkeley) 6/2/93 + * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $ + */ + +#ifndef _LOCALE_H_ +#define _LOCALE_H_ + +#include <_locale.h> + +#define LC_ALL 0 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_MONETARY 3 +#define LC_NUMERIC 4 +#define LC_TIME 5 +#define LC_MESSAGES 6 + +#define _LC_LAST 7 /* marks end */ + +__BEGIN_DECLS +char *setlocale(int, const char *); +__END_DECLS + +#endif /* _LOCALE_H_ */ diff --git a/i386/include/mach-o/.svn/all-wcprops b/i386/include/mach-o/.svn/all-wcprops new file mode 100644 index 0000000..969b718 --- /dev/null +++ b/i386/include/mach-o/.svn/all-wcprops @@ -0,0 +1,83 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o +END +nlist.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/nlist.h +END +stab.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/stab.h +END +fat.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/fat.h +END +swap.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/swap.h +END +ldsyms.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/ldsyms.h +END +dyld.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/dyld.h +END +arch.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/arch.h +END +getsect.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/getsect.h +END +compact_unwind_encoding.h +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/compact_unwind_encoding.h +END +dyld_images.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/dyld_images.h +END +reloc.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/reloc.h +END +loader.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/loader.h +END +ranlib.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/ranlib.h +END diff --git a/i386/include/mach-o/.svn/entries b/i386/include/mach-o/.svn/entries new file mode 100644 index 0000000..d6cc5a2 --- /dev/null +++ b/i386/include/mach-o/.svn/entries @@ -0,0 +1,479 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach-o +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +stab.h +file + + + + +2013-08-27T23:54:36.000000Z +7c9d92870c02e45980d4cf297ebb485b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6263 + +nlist.h +file + + + + +2013-08-27T23:54:36.000000Z +1028c26609b4483cdc8c3075e85d4ff7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13644 + +dyld.h +file + + + + +2013-08-27T23:54:36.000000Z +60ac3d0becca72f6e237289f9486dfb2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15541 + +ppc +dir + +getsect.h +file + + + + +2013-08-27T23:54:36.000000Z +aa9da3680e4fcb69ea66169d61a844a1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3560 + +i386 +dir + +reloc.h +file + + + + +2013-08-27T23:54:36.000000Z +37a3417653260cdf3296cb5e57f8d21c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10506 + +loader.h +file + + + + +2013-08-27T23:54:36.000000Z +e5cfed749127297ac180dd2b07ec87f6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +63780 + +ranlib.h +file + + + + +2013-08-27T23:54:36.000000Z +05ff58bba593d3f3a7978a2b5ff1f493 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3001 + +x86_64 +dir + +swap.h +file + + + + +2013-08-27T23:54:36.000000Z +dd38d282cd31f25b88aec3eb1350c160 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5759 + +fat.h +file + + + + +2013-08-27T23:54:36.000000Z +3d56a7e7313879b809c9488aeaacdceb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2534 + +ldsyms.h +file + + + + +2013-08-27T23:54:36.000000Z +05eef46494510ae38d20abceca293564 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5404 + +arch.h +file + + + + +2013-08-27T23:54:36.000000Z +8d484c999d7ef2bbca69a0713d2e13ed +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4185 + +compact_unwind_encoding.h +file + + + + +2013-08-27T23:54:36.000000Z +c6830e62a587fd1846546f5fac199f8c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7323 + +dyld_images.h +file + + + + +2013-08-27T23:54:36.000000Z +9ffa86ab3c1d01b535bb194f69eea2b8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7085 + diff --git a/i386/include/mach-o/.svn/text-base/arch.h.svn-base b/i386/include/mach-o/.svn/text-base/arch.h.svn-base new file mode 100644 index 0000000..526c10f --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/arch.h.svn-base @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_ARCH_H_ +#define _MACH_O_ARCH_H_ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * Functions that deal with information about architectures. + * + */ + +#include <stdint.h> +#include <mach/machine.h> +#include <architecture/byte_order.h> + +/* The NXArchInfo structs contain the architectures symbolic name + * (such as "ppc"), its CPU type and CPU subtype as defined in + * mach/machine.h, the byte order for the architecture, and a + * describing string (such as "PowerPC"). + * There will both be entries for specific CPUs (such as ppc604e) as + * well as generic "family" entries (such as ppc). + */ +typedef struct { + const char *name; + cpu_type_t cputype; + cpu_subtype_t cpusubtype; + enum NXByteOrder byteorder; + const char *description; +} NXArchInfo; + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* NXGetAllArchInfos() returns a pointer to an array of all known + * NXArchInfo structures. The last NXArchInfo is marked by a NULL name. + */ +extern const NXArchInfo *NXGetAllArchInfos(void); + +/* NXGetLocalArchInfo() returns the NXArchInfo for the local host, or NULL + * if none is known. + */ +extern const NXArchInfo *NXGetLocalArchInfo(void); + +/* NXGetArchInfoFromName() and NXGetArchInfoFromCpuType() return the + * NXArchInfo from the architecture's name or cputype/cpusubtype + * combination. A cpusubtype of CPU_SUBTYPE_MULTIPLE can be used + * to request the most general NXArchInfo known for the given cputype. + * NULL is returned if no matching NXArchInfo can be found. + */ +extern const NXArchInfo *NXGetArchInfoFromName(const char *name); +extern const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype, + cpu_subtype_t cpusubtype); + +/* NXFindBestFatArch() is passed a cputype and cpusubtype and a set of + * fat_arch structs and selects the best one that matches (if any) and returns + * a pointer to that fat_arch struct (or NULL). The fat_arch structs must be + * in the host byte order and correct such that the fat_archs really points to + * enough memory for nfat_arch structs. It is possible that this routine could + * fail if new cputypes or cpusubtypes are added and an old version of this + * routine is used. But if there is an exact match between the cputype and + * cpusubtype and one of the fat_arch structs this routine will always succeed. + */ +extern struct fat_arch *NXFindBestFatArch(cpu_type_t cputype, + cpu_subtype_t cpusubtype, + struct fat_arch *fat_archs, + uint32_t nfat_archs); + +/* NXCombineCpuSubtypes() returns the resulting cpusubtype when combining two + * different cpusubtypes for the specified cputype. If the two cpusubtypes + * can't be combined (the specific subtypes are mutually exclusive) -1 is + * returned indicating it is an error to combine them. This can also fail and + * return -1 if new cputypes or cpusubtypes are added and an old version of + * this routine is used. But if the cpusubtypes are the same they can always + * be combined and this routine will return the cpusubtype pass in. + */ +extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype, + cpu_subtype_t cpusubtype1, + cpu_subtype_t cpusubtype2); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MACH_O_ARCH_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/compact_unwind_encoding.h.svn-base b/i386/include/mach-o/.svn/text-base/compact_unwind_encoding.h.svn-base new file mode 100644 index 0000000..237b226 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/compact_unwind_encoding.h.svn-base @@ -0,0 +1,224 @@ +/* -*- mode: C; c-basic-offset: 4; tab-width: 4 -*- + * + * Copyright (c) 2008-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef __COMPACT_UNWIND_ENCODING__ +#define __COMPACT_UNWIND_ENCODING__ + +#include <stdint.h> + + +// +// Each final linked mach-o image has an optional __TEXT, __unwind_info section. +// This section is much smaller and faster to use than the __eh_frame section. +// + + + +// +// Compilers usually emit standard Dwarf FDEs. The linker recognizes standard FDEs and +// synthesizes a matching compact_unwind_encoding_t and adds it to the __unwind_info table. +// It is also possible for the compiler to emit __unwind_info entries for functions that +// have different unwind requirements at different ranges in the function. +// +typedef uint32_t compact_unwind_encoding_t; + + + +// +// The __unwind_info section is laid out for an efficient two level lookup. +// The header of the section contains a coarse index that maps function address +// to the page (4096 byte block) containing the unwind info for that function. +// + +#define UNWIND_SECTION_VERSION 1 +struct unwind_info_section_header +{ + uint32_t version; // UNWIND_SECTION_VERSION + uint32_t commonEncodingsArraySectionOffset; + uint32_t commonEncodingsArrayCount; + uint32_t personalityArraySectionOffset; + uint32_t personalityArrayCount; + uint32_t indexSectionOffset; + uint32_t indexCount; + // compact_unwind_encoding_t[] + // uintptr_t personalities[] + // unwind_info_section_header_index_entry[] + // unwind_info_section_header_lsda_index_entry[] +}; + +struct unwind_info_section_header_index_entry +{ + uint32_t functionOffset; + uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page + uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range +}; + +struct unwind_info_section_header_lsda_index_entry +{ + uint32_t functionOffset; + uint32_t lsdaOffset; +}; + +// +// There are two kinds of second level index pages: regular and compressed. +// A compressed page can hold up to 1021 entries, but it cannot be used +// if too many different encoding types are used. The regular page holds +// 511 entries. +// + +struct unwind_info_regular_second_level_entry +{ + uint32_t functionOffset; + compact_unwind_encoding_t encoding; +}; + +#define UNWIND_SECOND_LEVEL_REGULAR 2 +struct unwind_info_regular_second_level_page_header +{ + uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR + uint16_t entryPageOffset; + uint16_t entryCount; + // entry array +}; + +#define UNWIND_SECOND_LEVEL_COMPRESSED 3 +struct unwind_info_compressed_second_level_page_header +{ + uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED + uint16_t entryPageOffset; + uint16_t entryCount; + uint16_t encodingsPageOffset; + uint16_t encodingsCount; + // 32-bit entry array + // encodings array +}; + +#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF) +#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF) + + + +// architecture independent bits +enum { + UNWIND_IS_NOT_FUNCTION_START = 0x80000000, + UNWIND_HAS_LSDA = 0x40000000, + UNWIND_PERSONALITY_MASK = 0x30000000, +}; + + +// x86_64 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// rbp based: +// 15-bits (5*3-bits per reg) register permutation +// 8-bits for stack offset +// frameless: +// 8-bits stack size +// 3-bits stack adjust +// 3-bits register count +// 10-bits register permutation +// +enum { + UNWIND_X86_64_MODE_MASK = 0x0F000000, + UNWIND_X86_64_MODE_COMPATIBILITY = 0x00000000, + UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000, + UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000, + UNWIND_X86_64_MODE_STACK_IND = 0x03000000, + UNWIND_X86_64_MODE_DWARF = 0x04000000, + + UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF, + UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000, + + UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000, + UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000, + UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00, + UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, + + UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x03FFFFFF, +}; + +enum { + UNWIND_X86_64_REG_NONE = 0, + UNWIND_X86_64_REG_RBX = 1, + UNWIND_X86_64_REG_R12 = 2, + UNWIND_X86_64_REG_R13 = 3, + UNWIND_X86_64_REG_R14 = 4, + UNWIND_X86_64_REG_R15 = 5, + UNWIND_X86_64_REG_RBP = 6, +}; + + +// x86 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// ebp based: +// 15-bits (5*3-bits per reg) register permutation +// 8-bits for stack offset +// frameless: +// 8-bits stack size +// 3-bits stack adjust +// 3-bits register count +// 10-bits register permutation +// +enum { + UNWIND_X86_MODE_MASK = 0x0F000000, + UNWIND_X86_MODE_COMPATIBILITY = 0x00000000, + UNWIND_X86_MODE_EBP_FRAME = 0x01000000, + UNWIND_X86_MODE_STACK_IMMD = 0x02000000, + UNWIND_X86_MODE_STACK_IND = 0x03000000, + UNWIND_X86_MODE_DWARF = 0x04000000, + + UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF, + UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000, + + UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000, + UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000, + UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00, + UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, + + UNWIND_X86_DWARF_SECTION_OFFSET = 0x03FFFFFF, +}; + +enum { + UNWIND_X86_REG_NONE = 0, + UNWIND_X86_REG_EBX = 1, + UNWIND_X86_REG_ECX = 2, + UNWIND_X86_REG_EDX = 3, + UNWIND_X86_REG_EDI = 4, + UNWIND_X86_REG_ESI = 5, + UNWIND_X86_REG_EBP = 6, +}; + + +#endif + diff --git a/i386/include/mach-o/.svn/text-base/dyld.h.svn-base b/i386/include/mach-o/.svn/text-base/dyld.h.svn-base new file mode 100644 index 0000000..3f579ef --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/dyld.h.svn-base @@ -0,0 +1,253 @@ +/* + * Copyright (c) 1999-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_DYLD_H_ +#define _MACH_O_DYLD_H_ + + +#include <stddef.h> +#include <stdint.h> +#include <stdbool.h> + +#include <mach-o/loader.h> +#include <Availability.h> + +#if __cplusplus +extern "C" { +#endif + +/* + * The following functions allow you to iterate through all loaded images. + * This is not a thread safe operation. Another thread can add or remove + * an image during the iteration. + * + * Many uses of these routines can be replace by a call to dladdr() which + * will return the mach_header and name of an image, given an address in + * the image. dladdr() is thread safe. + */ +extern uint32_t _dyld_image_count(void) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern const char* _dyld_get_image_name(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * The following functions allow you to install callbacks which will be called + * by dyld whenever an image is loaded or unloaded. During a call to _dyld_register_func_for_add_image() + * the callback func is called for every existing image. Later, it is called as each new image + * is loaded and bound (but initializers not yet run). The callback registered with + * _dyld_register_func_for_remove_image() is called after any terminators in an image are run + * and before the image is un-memory-mapped. + */ +extern void _dyld_register_func_for_add_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * NSVersionOfRunTimeLibrary() returns the current_version number of the currently dylib + * specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and + * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if no such library is loaded. + */ +extern int32_t NSVersionOfRunTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * NSVersionOfRunTimeLibrary() returns the current_version number that the main executable was linked + * against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and + * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if the main executable did not link + * against the specified library. + */ +extern int32_t NSVersionOfLinkTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * _NSGetExecutablePath() copies the path of the main executable into the buffer. The bufsize parameter + * should initially be the size of the buffer. The function returns 0 if the path was successfully copied, + * and *bufsize is left unchanged. It returns -1 if the buffer is not large enough, and *bufsize is set + * to the size required. + * + * Note that _NSGetExecutablePath will return "a path" to the executable not a "real path" to the executable. + * That is the path may be a symbolic link and not the real file. With deep directories the total bufsize + * needed could be more than MAXPATHLEN. + */ +extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0); + + + +/* + * _dyld_moninit() is a private interface between dyld and libSystem. + */ +extern void _dyld_moninit(void (*monaddition)(char *lowpc, char *highpc)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + + + + +/* + * The following dyld API's are deprecated as of Mac OS X 10.5. They are either + * no longer necessary or are superceeded by dlopen and friends in <dlfcn.h>. + * dlopen/dlsym/dlclose have been available since Mac OS X 10.3 and work with + * dylibs and bundles. + * + * NSAddImage -> dlopen + * NSLookupSymbolInImage -> dlsym + * NSCreateObjectFileImageFromFile -> dlopen + * NSDestroyObjectFileImage -> dlclose + * NSLinkModule -> not needed when dlopen used + * NSUnLinkModule -> not needed when dlclose used + * NSLookupSymbolInModule -> dlsym + * _dyld_image_containing_address -> dladdr + * NSLinkEditError -> dlerror + * + */ + +#ifndef ENUM_DYLD_BOOL +#define ENUM_DYLD_BOOL + #undef FALSE + #undef TRUE + enum DYLD_BOOL { FALSE, TRUE }; +#endif /* ENUM_DYLD_BOOL */ + + +/* Object file image API */ +typedef enum { + NSObjectFileImageFailure, /* for this a message is printed on stderr */ + NSObjectFileImageSuccess, + NSObjectFileImageInappropriateFile, + NSObjectFileImageArch, + NSObjectFileImageFormat, /* for this a message is printed on stderr */ + NSObjectFileImageAccess +} NSObjectFileImageReturnCode; + +typedef struct __NSObjectFileImage* NSObjectFileImage; + +/* NSObjectFileImage can only be used with MH_BUNDLE files */ +extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern uint32_t NSSymbolDefinitionCountInObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern const char* NSSymbolDefinitionNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern uint32_t NSSymbolReferenceCountInObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern const char* NSSymbolReferenceNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal, bool *tentative_definition) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern void* NSGetSectionDataInObjectFileImage(NSObjectFileImage objectFileImage, const char* segmentName, const char* sectionName, size_t *size) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool NSHasModInitObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +typedef struct __NSModule* NSModule; +extern const char* NSNameOfModule(NSModule m) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern const char* NSLibraryNameForModule(NSModule m) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern NSModule NSLinkModule(NSObjectFileImage objectFileImage, const char* moduleName, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSLINKMODULE_OPTION_NONE 0x0 +#define NSLINKMODULE_OPTION_BINDNOW 0x1 +#define NSLINKMODULE_OPTION_PRIVATE 0x2 +#define NSLINKMODULE_OPTION_RETURN_ON_ERROR 0x4 +#define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8 +#define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10 + +extern bool NSUnLinkModule(NSModule module, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSUNLINKMODULE_OPTION_NONE 0x0 +#define NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED 0x1 +#define NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES 0x2 + +/* symbol API */ +typedef struct __NSSymbol* NSSymbol; +extern bool NSIsSymbolNameDefined(const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern bool NSIsSymbolNameDefinedInImage(const struct mach_header* image, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 +#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 +extern const char* NSNameOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern void * NSAddressOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern NSModule NSModuleForSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +/* error handling API */ +typedef enum { + NSLinkEditFileAccessError, + NSLinkEditFileFormatError, + NSLinkEditMachResourceError, + NSLinkEditUnixResourceError, + NSLinkEditOtherError, + NSLinkEditWarningError, + NSLinkEditMultiplyDefinedError, + NSLinkEditUndefinedError +} NSLinkEditErrors; + +/* + * For the NSLinkEditErrors value NSLinkEditOtherError these are the values + * passed to the link edit error handler as the errorNumber (what would be an + * errno value for NSLinkEditUnixResourceError or a kern_return_t value for + * NSLinkEditMachResourceError). + */ +typedef enum { + NSOtherErrorRelocation, + NSOtherErrorLazyBind, + NSOtherErrorIndrLoop, + NSOtherErrorLazyInit, + NSOtherErrorInvalidArgs +} NSOtherErrorNumbers; + +extern void NSLinkEditError(NSLinkEditErrors *c, int *errorNumber, const char** fileName, const char** errorString) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +typedef struct { + void (*undefined)(const char* symbolName); + NSModule (*multiple)(NSSymbol s, NSModule oldModule, NSModule newModule); + void (*linkEdit)(NSLinkEditErrors errorClass, int errorNumber, + const char* fileName, const char* errorString); +} NSLinkEditErrorHandlers; + +extern void NSInstallLinkEditErrorHandlers(const NSLinkEditErrorHandlers *handlers) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern bool NSAddLibrary(const char* pathName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern bool NSAddLibraryWithSearching(const char* pathName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSADDIMAGE_OPTION_NONE 0x0 +#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 +#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 +#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 +#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 + +extern bool _dyld_present(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_launched_prebound(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_all_twolevel_modules_prebound(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_bind_objc_module(const void* objc_module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_bind_fully_image_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_image_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_lookup_and_bind(const char* symbol_name, void **address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_lookup_and_bind_with_hint(const char* symbol_name, const char* library_name_hint, void** address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_lookup_and_bind_fully(const char* symbol_name, void** address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern const struct mach_header* _dyld_get_image_header_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + + +#if __cplusplus +} +#endif + +#endif /* _MACH_O_DYLD_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/dyld_images.h.svn-base b/i386/include/mach-o/.svn/text-base/dyld_images.h.svn-base new file mode 100644 index 0000000..ed710ef --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/dyld_images.h.svn-base @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2006-2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _DYLD_IMAGES_ +#define _DYLD_IMAGES_ + +#include <stdbool.h> +#include <unistd.h> +#include <mach/mach.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Beginning in Mac OS X 10.4, this is how gdb discovers which mach-o images are loaded in a process. + * + * gdb looks for the symbol "_dyld_all_image_infos" in dyld. It contains the fields below. + * + * For a snashot of what images are currently loaded, the infoArray fields contain a pointer + * to an array of all images. If infoArray is NULL, it means it is being modified, come back later. + * + * To be notified of changes, gdb sets a break point on the address pointed to by the notificationn + * field. The function it points to is called by dyld with an array of information about what images + * have been added (dyld_image_adding) or are about to be removed (dyld_image_removing). + * + * The notification is called after infoArray is updated. This means that if gdb attaches to a process + * and infoArray is NULL, gdb can set a break point on notification and let the proccess continue to + * run until the break point. Then gdb can inspect the full infoArray. + * + * The dyldVersion field always points to a C string that contains the dyld version. For instance, + * in dyld-127.3, dyldVersion would contain a pointer to "127.3". + * + * The errorMessage and terminationFlags fields are normally zero. If dyld terminates a process + * (for instance because a required dylib or symbol is missing), then the errorMessage field will + * be set to point to a C string message buffer containing the reason dyld terminate the process. + * The low bit of the terminationFlags will be set if dyld terminated the process before any user + * code ran, in which case there is no need for the crash log to contain the backtrace. + * + * When dyld terminates a process because some required dylib or symbol cannot be bound, in + * addition to the errorMessage field, it now sets the errorKind field and the corresponding + * fields: errorClientOfDylibPath, errorTargetDylibPath, errorSymbol. + * + */ + +enum dyld_image_mode { dyld_image_adding=0, dyld_image_removing=1 }; + +struct dyld_image_info { + const struct mach_header* imageLoadAddress; /* base address image is mapped into */ + const char* imageFilePath; /* path dyld used to load the image */ + uintptr_t imageFileModDate; /* time_t of image file */ + /* if stat().st_mtime of imageFilePath does not match imageFileModDate, */ + /* then file has been modified since dyld loaded it */ +}; + +struct dyld_uuid_info { + const struct mach_header* imageLoadAddress; /* base address image is mapped into */ + uuid_t imageUUID; /* UUID of image */ +}; + +typedef void (*dyld_image_notifier)(enum dyld_image_mode mode, uint32_t infoCount, const struct dyld_image_info info[]); + +/* for use in dyld_all_image_infos.errorKind field */ +enum { dyld_error_kind_none=0, + dyld_error_kind_dylib_missing=1, + dyld_error_kind_dylib_wrong_arch=2, + dyld_error_kind_dylib_version=3, + dyld_error_kind_symbol_missing=4 + }; + + +struct dyld_all_image_infos { + uint32_t version; /* 1 in Mac OS X 10.4 and 10.5 */ + uint32_t infoArrayCount; + const struct dyld_image_info* infoArray; + dyld_image_notifier notification; + bool processDetachedFromSharedRegion; + /* the following fields are only in version 2 (Mac OS X 10.6, iPhoneOS 2.0) and later */ + bool libSystemInitialized; + const struct mach_header* dyldImageLoadAddress; + /* the following field is only in version 3 (Mac OS X 10.6, iPhoneOS 3.0) and later */ + void* jitInfo; + /* the following fields are only in version 5 (Mac OS X 10.6, iPhoneOS 3.0) and later */ + const char* dyldVersion; + const char* errorMessage; + uintptr_t terminationFlags; + /* the following field is only in version 6 (Mac OS X 10.6, iPhoneOS 3.1) and later */ + void* coreSymbolicationShmPage; + /* the following field is only in version 7 (Mac OS X 10.6, iPhoneOS 3.1) and later */ + uintptr_t systemOrderFlag; + /* the following field is only in version 8 (Mac OS X 10.7, iPhoneOS 3.1) and later */ + uintptr_t uuidArrayCount; + const struct dyld_uuid_info* uuidArray; /* only images not in dyld shared cache */ + /* the following field is only in version 9 (Mac OS X 10.7, iOS 4.0) and later */ + struct dyld_all_image_infos* dyldAllImageInfosAddress; + /* the following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later */ + uintptr_t initialImageCount; + /* the following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later */ + uintptr_t errorKind; + const char* errorClientOfDylibPath; + const char* errorTargetDylibPath; + const char* errorSymbol; + /* the following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later */ + uintptr_t sharedCacheSlide; +}; +extern struct dyld_all_image_infos dyld_all_image_infos; + +/* + * Beginning in Mac OS X 10.6, rather than looking up the symbol "_dyld_all_image_infos" + * in dyld's symbol table, you can add DYLD_ALL_IMAGE_INFOS_OFFSET_OFFSET to the mach_header + * for dyld and read the 32-bit unsigned int at that location. Adding that value to dyld's + * mach_header address gets you the address of dyld_all_image_infos in dyld. + */ +#define DYLD_ALL_IMAGE_INFOS_OFFSET_OFFSET 0x1010 + + + +/* + * Beginning in Mac OS X 10.5, this is how gdb discovers where the shared cache is in a process. + * Images that are in the shared cache have their segments rearranged, so when using imageFilePath + * to load the file from disk, you have to know to adjust addresses based on how their segment + * was rearranged. + * + * gdb looks for the symbol "_dyld_shared_region_ranges" in dyld. + * + * It contains information the count of shared regions used by the process. The count is + * the number of start/length pairs. + */ +struct dyld_shared_cache_ranges { + uintptr_t sharedRegionsCount; /* how many ranges follow */ + struct { + uintptr_t start; + uintptr_t length; + } ranges[4]; /* max regions */ +}; +extern struct dyld_shared_cache_ranges dyld_shared_cache_ranges; + + + +#ifdef __cplusplus +} +#endif + +#endif /* _DYLD_IMAGES_ */ diff --git a/i386/include/mach-o/.svn/text-base/fat.h.svn-base b/i386/include/mach-o/.svn/text-base/fat.h.svn-base new file mode 100644 index 0000000..e2bcf43 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/fat.h.svn-base @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_FAT_H_ +#define _MACH_O_FAT_H_ +/* + * This header file describes the structures of the file format for "fat" + * architecture specific file (wrapper design). At the begining of the file + * there is one fat_header structure followed by a number of fat_arch + * structures. For each architecture in the file, specified by a pair of + * cputype and cpusubtype, the fat_header describes the file offset, file + * size and alignment in the file of the architecture specific member. + * The padded bytes in the file to place each member on it's specific alignment + * are defined to be read as zeros and can be left as "holes" if the file system + * can support them as long as they read as zeros. + * + * All structures defined here are always written and read to/from disk + * in big-endian order. + */ + +/* + * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types + * and contains the constants for the possible values of these types. + */ +#include <stdint.h> +#include <mach/machine.h> +#include <architecture/byte_order.h> + +#define FAT_MAGIC 0xcafebabe +#define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */ + +struct fat_header { + uint32_t magic; /* FAT_MAGIC */ + uint32_t nfat_arch; /* number of structs that follow */ +}; + +struct fat_arch { + cpu_type_t cputype; /* cpu specifier (int) */ + cpu_subtype_t cpusubtype; /* machine specifier (int) */ + uint32_t offset; /* file offset to this object file */ + uint32_t size; /* size of this object file */ + uint32_t align; /* alignment as a power of 2 */ +}; + +#endif /* _MACH_O_FAT_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/getsect.h.svn-base b/i386/include/mach-o/.svn/text-base/getsect.h.svn-base new file mode 100644 index 0000000..cee1f9f --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/getsect.h.svn-base @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_GETSECT_H_ +#define _MACH_O_GETSECT_H_ + +#include <stdint.h> +#include <mach-o/loader.h> + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Runtime interfaces for Mach-O programs. For both 32-bit and 64-bit programs, + * where the sizes returned will be 32-bit or 64-bit based on the size of + * 'unsigned long'. + */ +extern char *getsectdata( + const char *segname, + const char *sectname, + unsigned long *size); + +extern char *getsectdatafromFramework( + const char *FrameworkName, + const char *segname, + const char *sectname, + unsigned long *size); + +extern unsigned long get_end(void); +extern unsigned long get_etext(void); +extern unsigned long get_edata(void); + +#ifndef __LP64__ +/* + * Runtime interfaces for 32-bit Mach-O programs. + */ +extern const struct section *getsectbyname( + const char *segname, + const char *sectname); + +extern uint8_t *getsectiondata( + const struct mach_header *mhp, + const char *segname, + const char *sectname, + unsigned long *size); + +extern const struct segment_command *getsegbyname( + const char *segname); + +extern uint8_t *getsegmentdata( + const struct mach_header *mhp, + const char *segname, + unsigned long *size); + +#else /* defined(__LP64__) */ +/* + * Runtime interfaces for 64-bit Mach-O programs. + */ +extern const struct section_64 *getsectbyname( + const char *segname, + const char *sectname); + +extern uint8_t *getsectiondata( + const struct mach_header_64 *mhp, + const char *segname, + const char *sectname, + unsigned long *size); + +extern const struct segment_command_64 *getsegbyname( + const char *segname); + +extern uint8_t *getsegmentdata( + const struct mach_header_64 *mhp, + const char *segname, + unsigned long *size); + +#endif /* defined(__LP64__) */ + +/* + * Interfaces for tools working with 32-bit Mach-O files. + */ +extern char *getsectdatafromheader( + const struct mach_header *mhp, + const char *segname, + const char *sectname, + uint32_t *size); + +extern const struct section *getsectbynamefromheader( + const struct mach_header *mhp, + const char *segname, + const char *sectname); + +/* + * Interfaces for tools working with 64-bit Mach-O files. + */ +extern char *getsectdatafromheader_64( + const struct mach_header_64 *mhp, + const char *segname, + const char *sectname, + uint64_t *size); + +extern const struct section_64 *getsectbynamefromheader_64( + const struct mach_header_64 *mhp, + const char *segname, + const char *sectname); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MACH_O_GETSECT_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/ldsyms.h.svn-base b/i386/include/mach-o/.svn/text-base/ldsyms.h.svn-base new file mode 100644 index 0000000..3f28b1b --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/ldsyms.h.svn-base @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _MACHO_LDSYMS_H_ +#define _MACHO_LDSYMS_H_ + +#include <mach-o/loader.h> + +/* + * This file describes the link editor defined symbols. The semantics of a + * link editor symbol is that it is defined by the link editor only if it is + * referenced and it is an error for the user to define them (see the man page + * ld(1)). The standard UNIX link editor symbols: __end, __etext and __edata + * are not not supported by the Apple Mach-O link editor. These symbols are + * really not meaningful in a Mach-O object file and the link editor symbols + * that are supported (described here) replace them. In the case of the + * standard UNIX link editor symbols the program can use the symbol + * __mh_execute_header and walk the load commands of it's program to determine + * the ending (or beginning) of any section or segment in the program. Note + * that the compiler prepends an underbar to all external symbol names coded + * in a high level language. Thus in 'C' names are coded without an underbar + * and symbol names in the symbol table have an underbar. There are two cpp + * macros for each link editor defined name in this file. The macro with a + * leading underbar is the symbol name and the one without is the name as + * coded in 'C'. + */ + +/* + * The value of the link editor defined symbol _MH_EXECUTE_SYM is the address + * of the mach header in a Mach-O executable file type. It does not appear in + * any file type other than a MH_EXECUTE file type. The type of the symbol is + * absolute as the header is not part of any section. + */ +#define _MH_EXECUTE_SYM "__mh_execute_header" +#define MH_EXECUTE_SYM "_mh_execute_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_execute_header; + +/* + * The value of the link editor defined symbol _MH_BUNDLE_SYM is the address + * of the mach header in a Mach-O bundle file type. It does not appear in + * any file type other than a MH_BUNDLE file type. The type of the symbol is + * an N_SECT symbol even thought the header is not part of any section. This + * symbol is private to the code in the bundle it is a part of. + */ +#define _MH_BUNDLE_SYM "__mh_bundle_header" +#define MH_BUNDLE_SYM "_mh_bundle_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_bundle_header; + +/* + * The value of the link editor defined symbol _MH_DYLIB_SYM is the address + * of the mach header in a Mach-O dylib file type. It does not appear in + * any file type other than a MH_DYLIB file type. The type of the symbol is + * an N_SECT symbol even thought the header is not part of any section. This + * symbol is private to the code in the library it is a part of. + */ +#define _MH_DYLIB_SYM "__mh_dylib_header" +#define MH_DYLIB_SYM "_mh_dylib_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_dylib_header; + +/* + * The value of the link editor defined symbol _MH_DYLINKER_SYM is the address + * of the mach header in a Mach-O dylinker file type. It does not appear in + * any file type other than a MH_DYLINKER file type. The type of the symbol is + * an N_SECT symbol even thought the header is not part of any section. This + * symbol is private to the code in the dynamic linker it is a part of. + */ +#define _MH_DYLINKER_SYM "__mh_dylinker_header" +#define MH_DYLINKER_SYM "_mh_dylinker_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_dylinker_header; + +/* + * For the MH_PRELOAD file type the headers are not loaded as part of any + * segment so the link editor defines symbols defined for the beginning + * and ending of each segment and each section in each segment. The names for + * the symbols for a segment's beginning and end will have the form: + * __SEGNAME__begin and __SEGNAME__end where __SEGNAME is the name of the + * segment. The names for the symbols for a section's beginning and end will + * have the form: __SEGNAME__sectname__begin and __SEGNAME__sectname__end + * where __sectname is the name of the section and __SEGNAME is the segment it + * is in. + * + * The above symbols' types are those of the section they are referring to. + * This is true even for symbols who's values are end's of a section and + * that value is next address after that section and not really in that + * section. This results in these symbols having types referring to sections + * who's values are not in that section. + */ + +#endif /* _MACHO_LDSYMS_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/loader.h.svn-base b/i386/include/mach-o/.svn/text-base/loader.h.svn-base new file mode 100644 index 0000000..ff18e29 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/loader.h.svn-base @@ -0,0 +1,1402 @@ +/* + * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACHO_LOADER_H_ +#define _MACHO_LOADER_H_ + +/* + * This file describes the format of mach object files. + */ +#include <stdint.h> + +/* + * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types + * and contains the constants for the possible values of these types. + */ +#include <mach/machine.h> + +/* + * <mach/vm_prot.h> is needed here for the vm_prot_t type and contains the + * constants that are or'ed together for the possible values of this type. + */ +#include <mach/vm_prot.h> + +/* + * <machine/thread_status.h> is expected to define the flavors of the thread + * states and the structures of those flavors for each machine. + */ +#include <mach/machine/thread_status.h> +#include <architecture/byte_order.h> + +/* + * The 32-bit mach header appears at the very beginning of the object file for + * 32-bit architectures. + */ +struct mach_header { + uint32_t magic; /* mach magic number identifier */ + cpu_type_t cputype; /* cpu specifier */ + cpu_subtype_t cpusubtype; /* machine specifier */ + uint32_t filetype; /* type of file */ + uint32_t ncmds; /* number of load commands */ + uint32_t sizeofcmds; /* the size of all the load commands */ + uint32_t flags; /* flags */ +}; + +/* Constant for the magic field of the mach_header (32-bit architectures) */ +#define MH_MAGIC 0xfeedface /* the mach magic number */ +#define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */ + +/* + * The 64-bit mach header appears at the very beginning of object files for + * 64-bit architectures. + */ +struct mach_header_64 { + uint32_t magic; /* mach magic number identifier */ + cpu_type_t cputype; /* cpu specifier */ + cpu_subtype_t cpusubtype; /* machine specifier */ + uint32_t filetype; /* type of file */ + uint32_t ncmds; /* number of load commands */ + uint32_t sizeofcmds; /* the size of all the load commands */ + uint32_t flags; /* flags */ + uint32_t reserved; /* reserved */ +}; + +/* Constant for the magic field of the mach_header_64 (64-bit architectures) */ +#define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */ +#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ + +/* + * The layout of the file depends on the filetype. For all but the MH_OBJECT + * file type the segments are padded out and aligned on a segment alignment + * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB, + * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part + * of their first segment. + * + * The file type MH_OBJECT is a compact format intended as output of the + * assembler and input (and possibly output) of the link editor (the .o + * format). All sections are in one unnamed segment with no segment padding. + * This format is used as an executable format when the file is so small the + * segment padding greatly increases its size. + * + * The file type MH_PRELOAD is an executable format intended for things that + * are not executed under the kernel (proms, stand alones, kernels, etc). The + * format can be executed under the kernel but may demand paged it and not + * preload it before execution. + * + * A core file is in MH_CORE format and can be any in an arbritray legal + * Mach-O file. + * + * Constants for the filetype field of the mach_header + */ +#define MH_OBJECT 0x1 /* relocatable object file */ +#define MH_EXECUTE 0x2 /* demand paged executable file */ +#define MH_FVMLIB 0x3 /* fixed VM shared library file */ +#define MH_CORE 0x4 /* core file */ +#define MH_PRELOAD 0x5 /* preloaded executable file */ +#define MH_DYLIB 0x6 /* dynamically bound shared library */ +#define MH_DYLINKER 0x7 /* dynamic link editor */ +#define MH_BUNDLE 0x8 /* dynamically bound bundle file */ +#define MH_DYLIB_STUB 0x9 /* shared library stub for static */ + /* linking only, no section contents */ +#define MH_DSYM 0xa /* companion file with only debug */ + /* sections */ +#define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */ + +/* Constants for the flags field of the mach_header */ +#define MH_NOUNDEFS 0x1 /* the object file has no undefined + references */ +#define MH_INCRLINK 0x2 /* the object file is the output of an + incremental link against a base file + and can't be link edited again */ +#define MH_DYLDLINK 0x4 /* the object file is input for the + dynamic linker and can't be staticly + link edited again */ +#define MH_BINDATLOAD 0x8 /* the object file's undefined + references are bound by the dynamic + linker when loaded. */ +#define MH_PREBOUND 0x10 /* the file has its dynamic undefined + references prebound. */ +#define MH_SPLIT_SEGS 0x20 /* the file has its read-only and + read-write segments split */ +#define MH_LAZY_INIT 0x40 /* the shared library init routine is + to be run lazily via catching memory + faults to its writeable segments + (obsolete) */ +#define MH_TWOLEVEL 0x80 /* the image is using two-level name + space bindings */ +#define MH_FORCE_FLAT 0x100 /* the executable is forcing all images + to use flat name space bindings */ +#define MH_NOMULTIDEFS 0x200 /* this umbrella guarantees no multiple + defintions of symbols in its + sub-images so the two-level namespace + hints can always be used. */ +#define MH_NOFIXPREBINDING 0x400 /* do not have dyld notify the + prebinding agent about this + executable */ +#define MH_PREBINDABLE 0x800 /* the binary is not prebound but can + have its prebinding redone. only used + when MH_PREBOUND is not set. */ +#define MH_ALLMODSBOUND 0x1000 /* indicates that this binary binds to + all two-level namespace modules of + its dependent libraries. only used + when MH_PREBINDABLE and MH_TWOLEVEL + are both set. */ +#define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into + sub-sections via symbols for dead + code stripping */ +#define MH_CANONICAL 0x4000 /* the binary has been canonicalized + via the unprebind operation */ +#define MH_WEAK_DEFINES 0x8000 /* the final linked image contains + external weak symbols */ +#define MH_BINDS_TO_WEAK 0x10000 /* the final linked image uses + weak symbols */ + +#define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks + in the task will be given stack + execution privilege. Only used in + MH_EXECUTE filetypes. */ +#define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary + declares it is safe for use in + processes with uid zero */ + +#define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary + declares it is safe for use in + processes when issetugid() is true */ + +#define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib, + the static linker does not need to + examine dependent dylibs to see + if any are re-exported */ +#define MH_PIE 0x200000 /* When this bit is set, the OS will + load the main executable at a + random address. Only used in + MH_EXECUTE filetypes. */ +#define MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When + linking against a dylib that + has this bit set, the static linker + will automatically not create a + LC_LOAD_DYLIB load command to the + dylib if no symbols are being + referenced from the dylib. */ +#define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type + S_THREAD_LOCAL_VARIABLES */ + +#define MH_NO_HEAP_EXECUTION 0x1000000 /* When this bit is set, the OS will + run the main executable with + a non-executable heap even on + platforms (e.g. i386) that don't + require it. Only used in MH_EXECUTE + filetypes. */ + +/* + * The load commands directly follow the mach_header. The total size of all + * of the commands is given by the sizeofcmds field in the mach_header. All + * load commands must have as their first two fields cmd and cmdsize. The cmd + * field is filled in with a constant for that command type. Each command type + * has a structure specifically for it. The cmdsize field is the size in bytes + * of the particular load command structure plus anything that follows it that + * is a part of the load command (i.e. section structures, strings, etc.). To + * advance to the next load command the cmdsize can be added to the offset or + * pointer of the current load command. The cmdsize for 32-bit architectures + * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple + * of 8 bytes (these are forever the maximum alignment of any load commands). + * The padded bytes must be zero. All tables in the object file must also + * follow these rules so the file can be memory mapped. Otherwise the pointers + * to these tables will not work well or at all on some machines. With all + * padding zeroed like objects will compare byte for byte. + */ +struct load_command { + uint32_t cmd; /* type of load command */ + uint32_t cmdsize; /* total size of command in bytes */ +}; + +/* + * After MacOS X 10.1 when a new load command is added that is required to be + * understood by the dynamic linker for the image to execute properly the + * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic + * linker sees such a load command it it does not understand will issue a + * "unknown load command required for execution" error and refuse to use the + * image. Other load commands without this bit that are not understood will + * simply be ignored. + */ +#define LC_REQ_DYLD 0x80000000 + +/* Constants for the cmd field of all load commands, the type */ +#define LC_SEGMENT 0x1 /* segment of this file to be mapped */ +#define LC_SYMTAB 0x2 /* link-edit stab symbol table info */ +#define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */ +#define LC_THREAD 0x4 /* thread */ +#define LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */ +#define LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */ +#define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */ +#define LC_IDENT 0x8 /* object identification info (obsolete) */ +#define LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */ +#define LC_PREPAGE 0xa /* prepage command (internal use) */ +#define LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */ +#define LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */ +#define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */ +#define LC_LOAD_DYLINKER 0xe /* load a dynamic linker */ +#define LC_ID_DYLINKER 0xf /* dynamic linker identification */ +#define LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */ + /* linked shared library */ +#define LC_ROUTINES 0x11 /* image routines */ +#define LC_SUB_FRAMEWORK 0x12 /* sub framework */ +#define LC_SUB_UMBRELLA 0x13 /* sub umbrella */ +#define LC_SUB_CLIENT 0x14 /* sub client */ +#define LC_SUB_LIBRARY 0x15 /* sub library */ +#define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */ +#define LC_PREBIND_CKSUM 0x17 /* prebind checksum */ + +/* + * load a dynamically linked shared library that is allowed to be missing + * (all symbols are weak imported). + */ +#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) + +#define LC_SEGMENT_64 0x19 /* 64-bit segment of this file to be + mapped */ +#define LC_ROUTINES_64 0x1a /* 64-bit image routines */ +#define LC_UUID 0x1b /* the uuid */ +#define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */ +#define LC_CODE_SIGNATURE 0x1d /* local of code signature */ +#define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */ +#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */ +#define LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */ +#define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */ +#define LC_DYLD_INFO 0x22 /* compressed dyld information */ +#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */ +#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */ +#define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */ +#define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */ +#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ +#define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat + like environment variable */ + +/* + * A variable length string in a load command is represented by an lc_str + * union. The strings are stored just after the load command structure and + * the offset is from the start of the load command structure. The size + * of the string is reflected in the cmdsize field of the load command. + * Once again any padded bytes to bring the cmdsize field to a multiple + * of 4 bytes must be zero. + */ +union lc_str { + uint32_t offset; /* offset to the string */ +#ifndef __LP64__ + char *ptr; /* pointer to the string */ +#endif +}; + +/* + * The segment load command indicates that a part of this file is to be + * mapped into the task's address space. The size of this segment in memory, + * vmsize, maybe equal to or larger than the amount to map from this file, + * filesize. The file is mapped starting at fileoff to the beginning of + * the segment in memory, vmaddr. The rest of the memory of the segment, + * if any, is allocated zero fill on demand. The segment's maximum virtual + * memory protection and initial virtual memory protection are specified + * by the maxprot and initprot fields. If the segment has sections then the + * section structures directly follow the segment command and their size is + * reflected in cmdsize. + */ +struct segment_command { /* for 32-bit architectures */ + uint32_t cmd; /* LC_SEGMENT */ + uint32_t cmdsize; /* includes sizeof section structs */ + char segname[16]; /* segment name */ + uint32_t vmaddr; /* memory address of this segment */ + uint32_t vmsize; /* memory size of this segment */ + uint32_t fileoff; /* file offset of this segment */ + uint32_t filesize; /* amount to map from the file */ + vm_prot_t maxprot; /* maximum VM protection */ + vm_prot_t initprot; /* initial VM protection */ + uint32_t nsects; /* number of sections in segment */ + uint32_t flags; /* flags */ +}; + +/* + * The 64-bit segment load command indicates that a part of this file is to be + * mapped into a 64-bit task's address space. If the 64-bit segment has + * sections then section_64 structures directly follow the 64-bit segment + * command and their size is reflected in cmdsize. + */ +struct segment_command_64 { /* for 64-bit architectures */ + uint32_t cmd; /* LC_SEGMENT_64 */ + uint32_t cmdsize; /* includes sizeof section_64 structs */ + char segname[16]; /* segment name */ + uint64_t vmaddr; /* memory address of this segment */ + uint64_t vmsize; /* memory size of this segment */ + uint64_t fileoff; /* file offset of this segment */ + uint64_t filesize; /* amount to map from the file */ + vm_prot_t maxprot; /* maximum VM protection */ + vm_prot_t initprot; /* initial VM protection */ + uint32_t nsects; /* number of sections in segment */ + uint32_t flags; /* flags */ +}; + +/* Constants for the flags field of the segment_command */ +#define SG_HIGHVM 0x1 /* the file contents for this segment is for + the high part of the VM space, the low part + is zero filled (for stacks in core files) */ +#define SG_FVMLIB 0x2 /* this segment is the VM that is allocated by + a fixed VM library, for overlap checking in + the link editor */ +#define SG_NORELOC 0x4 /* this segment has nothing that was relocated + in it and nothing relocated to it, that is + it maybe safely replaced without relocation*/ +#define SG_PROTECTED_VERSION_1 0x8 /* This segment is protected. If the + segment starts at file offset 0, the + first page of the segment is not + protected. All other pages of the + segment are protected. */ + +/* + * A segment is made up of zero or more sections. Non-MH_OBJECT files have + * all of their segments with the proper sections in each, and padded to the + * specified segment alignment when produced by the link editor. The first + * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header + * and load commands of the object file before its first section. The zero + * fill sections are always last in their segment (in all formats). This + * allows the zeroed segment padding to be mapped into memory where zero fill + * sections might be. The gigabyte zero fill sections, those with the section + * type S_GB_ZEROFILL, can only be in a segment with sections of this type. + * These segments are then placed after all other segments. + * + * The MH_OBJECT format has all of its sections in one segment for + * compactness. There is no padding to a specified segment boundary and the + * mach_header and load commands are not part of the segment. + * + * Sections with the same section name, sectname, going into the same segment, + * segname, are combined by the link editor. The resulting section is aligned + * to the maximum alignment of the combined sections and is the new section's + * alignment. The combined sections are aligned to their original alignment in + * the combined section. Any padded bytes to get the specified alignment are + * zeroed. + * + * The format of the relocation entries referenced by the reloff and nreloc + * fields of the section structure for mach object files is described in the + * header file <reloc.h>. + */ +struct section { /* for 32-bit architectures */ + char sectname[16]; /* name of this section */ + char segname[16]; /* segment this section goes in */ + uint32_t addr; /* memory address of this section */ + uint32_t size; /* size in bytes of this section */ + uint32_t offset; /* file offset of this section */ + uint32_t align; /* section alignment (power of 2) */ + uint32_t reloff; /* file offset of relocation entries */ + uint32_t nreloc; /* number of relocation entries */ + uint32_t flags; /* flags (section type and attributes)*/ + uint32_t reserved1; /* reserved (for offset or index) */ + uint32_t reserved2; /* reserved (for count or sizeof) */ +}; + +struct section_64 { /* for 64-bit architectures */ + char sectname[16]; /* name of this section */ + char segname[16]; /* segment this section goes in */ + uint64_t addr; /* memory address of this section */ + uint64_t size; /* size in bytes of this section */ + uint32_t offset; /* file offset of this section */ + uint32_t align; /* section alignment (power of 2) */ + uint32_t reloff; /* file offset of relocation entries */ + uint32_t nreloc; /* number of relocation entries */ + uint32_t flags; /* flags (section type and attributes)*/ + uint32_t reserved1; /* reserved (for offset or index) */ + uint32_t reserved2; /* reserved (for count or sizeof) */ + uint32_t reserved3; /* reserved */ +}; + +/* + * The flags field of a section structure is separated into two parts a section + * type and section attributes. The section types are mutually exclusive (it + * can only have one type) but the section attributes are not (it may have more + * than one attribute). + */ +#define SECTION_TYPE 0x000000ff /* 256 section types */ +#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */ + +/* Constants for the type of a section */ +#define S_REGULAR 0x0 /* regular section */ +#define S_ZEROFILL 0x1 /* zero fill on demand section */ +#define S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/ +#define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */ +#define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */ +#define S_LITERAL_POINTERS 0x5 /* section with only pointers to */ + /* literals */ +/* + * For the two types of symbol pointers sections and the symbol stubs section + * they have indirect symbol table entries. For each of the entries in the + * section the indirect symbol table entries, in corresponding order in the + * indirect symbol table, start at the index stored in the reserved1 field + * of the section structure. Since the indirect symbol table entries + * correspond to the entries in the section the number of indirect symbol table + * entries is inferred from the size of the section divided by the size of the + * entries in the section. For symbol pointers sections the size of the entries + * in the section is 4 bytes and for symbol stubs sections the byte size of the + * stubs is stored in the reserved2 field of the section structure. + */ +#define S_NON_LAZY_SYMBOL_POINTERS 0x6 /* section with only non-lazy + symbol pointers */ +#define S_LAZY_SYMBOL_POINTERS 0x7 /* section with only lazy symbol + pointers */ +#define S_SYMBOL_STUBS 0x8 /* section with only symbol + stubs, byte size of stub in + the reserved2 field */ +#define S_MOD_INIT_FUNC_POINTERS 0x9 /* section with only function + pointers for initialization*/ +#define S_MOD_TERM_FUNC_POINTERS 0xa /* section with only function + pointers for termination */ +#define S_COALESCED 0xb /* section contains symbols that + are to be coalesced */ +#define S_GB_ZEROFILL 0xc /* zero fill on demand section + (that can be larger than 4 + gigabytes) */ +#define S_INTERPOSING 0xd /* section with only pairs of + function pointers for + interposing */ +#define S_16BYTE_LITERALS 0xe /* section with only 16 byte + literals */ +#define S_DTRACE_DOF 0xf /* section contains + DTrace Object Format */ +#define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 /* section with only lazy + symbol pointers to lazy + loaded dylibs */ +/* + * Section types to support thread local variables + */ +#define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial + values for TLVs */ +#define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial + values for TLVs */ +#define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */ +#define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV + descriptors */ +#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call + to initialize TLV + values */ + +/* + * Constants for the section attributes part of the flags field of a section + * structure. + */ +#define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */ +#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* section contains only true + machine instructions */ +#define S_ATTR_NO_TOC 0x40000000 /* section contains coalesced + symbols that are not to be + in a ranlib table of + contents */ +#define S_ATTR_STRIP_STATIC_SYMS 0x20000000 /* ok to strip static symbols + in this section in files + with the MH_DYLDLINK flag */ +#define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */ +#define S_ATTR_LIVE_SUPPORT 0x08000000 /* blocks are live if they + reference live blocks */ +#define S_ATTR_SELF_MODIFYING_CODE 0x04000000 /* Used with i386 code stubs + written on by dyld */ +/* + * If a segment contains any sections marked with S_ATTR_DEBUG then all + * sections in that segment must have this attribute. No section other than + * a section marked with this attribute may reference the contents of this + * section. A section with this attribute may contain no symbols and must have + * a section type S_REGULAR. The static linker will not copy section contents + * from sections with this attribute into its output file. These sections + * generally contain DWARF debugging info. + */ +#define S_ATTR_DEBUG 0x02000000 /* a debug section */ +#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */ +#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* section contains some + machine instructions */ +#define S_ATTR_EXT_RELOC 0x00000200 /* section has external + relocation entries */ +#define S_ATTR_LOC_RELOC 0x00000100 /* section has local + relocation entries */ + + +/* + * The names of segments and sections in them are mostly meaningless to the + * link-editor. But there are few things to support traditional UNIX + * executables that require the link-editor and assembler to use some names + * agreed upon by convention. + * + * The initial protection of the "__TEXT" segment has write protection turned + * off (not writeable). + * + * The link-editor will allocate common symbols at the end of the "__common" + * section in the "__DATA" segment. It will create the section and segment + * if needed. + */ + +/* The currently known segment names and the section names in those segments */ + +#define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */ + /* protections and catches NULL */ + /* references for MH_EXECUTE files */ + + +#define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */ +#define SECT_TEXT "__text" /* the real text part of the text */ + /* section no headers, and no padding */ +#define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */ + /* section */ +#define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */ + /* fvmlib initialization */ + /* section */ + +#define SEG_DATA "__DATA" /* the tradition UNIX data segment */ +#define SECT_DATA "__data" /* the real initialized data section */ + /* no padding, no bss overlap */ +#define SECT_BSS "__bss" /* the real uninitialized data section*/ + /* no padding */ +#define SECT_COMMON "__common" /* the section common symbols are */ + /* allocated in by the link editor */ + +#define SEG_OBJC "__OBJC" /* objective-C runtime segment */ +#define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */ +#define SECT_OBJC_MODULES "__module_info" /* module information */ +#define SECT_OBJC_STRINGS "__selector_strs" /* string table */ +#define SECT_OBJC_REFS "__selector_refs" /* string table */ + +#define SEG_ICON "__ICON" /* the icon segment */ +#define SECT_ICON_HEADER "__header" /* the icon headers */ +#define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */ + +#define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */ + /* created and maintained by the link */ + /* editor. Created with -seglinkedit */ + /* option to ld(1) for MH_EXECUTE and */ + /* FVMLIB file types only */ + +#define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */ + +#define SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */ + /* modifing code stubs that has read, */ + /* write and execute permissions */ + +/* + * Fixed virtual memory shared libraries are identified by two things. The + * target pathname (the name of the library as found for execution), and the + * minor version number. The address of where the headers are loaded is in + * header_addr. (THIS IS OBSOLETE and no longer supported). + */ +struct fvmlib { + union lc_str name; /* library's target pathname */ + uint32_t minor_version; /* library's minor version number */ + uint32_t header_addr; /* library's header address */ +}; + +/* + * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header) + * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library. + * An object that uses a fixed virtual shared library also contains a + * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses. + * (THIS IS OBSOLETE and no longer supported). + */ +struct fvmlib_command { + uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */ + uint32_t cmdsize; /* includes pathname string */ + struct fvmlib fvmlib; /* the library identification */ +}; + +/* + * Dynamicly linked shared libraries are identified by two things. The + * pathname (the name of the library as found for execution), and the + * compatibility version number. The pathname must match and the compatibility + * number in the user of the library must be greater than or equal to the + * library being used. The time stamp is used to record the time a library was + * built and copied into user so it can be use to determined if the library used + * at runtime is exactly the same as used to built the program. + */ +struct dylib { + union lc_str name; /* library's path name */ + uint32_t timestamp; /* library's build time stamp */ + uint32_t current_version; /* library's current version number */ + uint32_t compatibility_version; /* library's compatibility vers number*/ +}; + +/* + * A dynamically linked shared library (filetype == MH_DYLIB in the mach header) + * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library. + * An object that uses a dynamically linked shared library also contains a + * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or + * LC_REEXPORT_DYLIB) for each library it uses. + */ +struct dylib_command { + uint32_t cmd; /* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB, + LC_REEXPORT_DYLIB */ + uint32_t cmdsize; /* includes pathname string */ + struct dylib dylib; /* the library identification */ +}; + +/* + * A dynamically linked shared library may be a subframework of an umbrella + * framework. If so it will be linked with "-umbrella umbrella_name" where + * Where "umbrella_name" is the name of the umbrella framework. A subframework + * can only be linked against by its umbrella framework or other subframeworks + * that are part of the same umbrella framework. Otherwise the static link + * editor produces an error and states to link against the umbrella framework. + * The name of the umbrella framework for subframeworks is recorded in the + * following structure. + */ +struct sub_framework_command { + uint32_t cmd; /* LC_SUB_FRAMEWORK */ + uint32_t cmdsize; /* includes umbrella string */ + union lc_str umbrella; /* the umbrella framework name */ +}; + +/* + * For dynamically linked shared libraries that are subframework of an umbrella + * framework they can allow clients other than the umbrella framework or other + * subframeworks in the same umbrella framework. To do this the subframework + * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load + * command is created for each -allowable_client flag. The client_name is + * usually a framework name. It can also be a name used for bundles clients + * where the bundle is built with "-client_name client_name". + */ +struct sub_client_command { + uint32_t cmd; /* LC_SUB_CLIENT */ + uint32_t cmdsize; /* includes client string */ + union lc_str client; /* the client name */ +}; + +/* + * A dynamically linked shared library may be a sub_umbrella of an umbrella + * framework. If so it will be linked with "-sub_umbrella umbrella_name" where + * Where "umbrella_name" is the name of the sub_umbrella framework. When + * staticly linking when -twolevel_namespace is in effect a twolevel namespace + * umbrella framework will only cause its subframeworks and those frameworks + * listed as sub_umbrella frameworks to be implicited linked in. Any other + * dependent dynamic libraries will not be linked it when -twolevel_namespace + * is in effect. The primary library recorded by the static linker when + * resolving a symbol in these libraries will be the umbrella framework. + * Zero or more sub_umbrella frameworks may be use by an umbrella framework. + * The name of a sub_umbrella framework is recorded in the following structure. + */ +struct sub_umbrella_command { + uint32_t cmd; /* LC_SUB_UMBRELLA */ + uint32_t cmdsize; /* includes sub_umbrella string */ + union lc_str sub_umbrella; /* the sub_umbrella framework name */ +}; + +/* + * A dynamically linked shared library may be a sub_library of another shared + * library. If so it will be linked with "-sub_library library_name" where + * Where "library_name" is the name of the sub_library shared library. When + * staticly linking when -twolevel_namespace is in effect a twolevel namespace + * shared library will only cause its subframeworks and those frameworks + * listed as sub_umbrella frameworks and libraries listed as sub_libraries to + * be implicited linked in. Any other dependent dynamic libraries will not be + * linked it when -twolevel_namespace is in effect. The primary library + * recorded by the static linker when resolving a symbol in these libraries + * will be the umbrella framework (or dynamic library). Zero or more sub_library + * shared libraries may be use by an umbrella framework or (or dynamic library). + * The name of a sub_library framework is recorded in the following structure. + * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc". + */ +struct sub_library_command { + uint32_t cmd; /* LC_SUB_LIBRARY */ + uint32_t cmdsize; /* includes sub_library string */ + union lc_str sub_library; /* the sub_library name */ +}; + +/* + * A program (filetype == MH_EXECUTE) that is + * prebound to its dynamic libraries has one of these for each library that + * the static linker used in prebinding. It contains a bit vector for the + * modules in the library. The bits indicate which modules are bound (1) and + * which are not (0) from the library. The bit for module 0 is the low bit + * of the first byte. So the bit for the Nth module is: + * (linked_modules[N/8] >> N%8) & 1 + */ +struct prebound_dylib_command { + uint32_t cmd; /* LC_PREBOUND_DYLIB */ + uint32_t cmdsize; /* includes strings */ + union lc_str name; /* library's path name */ + uint32_t nmodules; /* number of modules in library */ + union lc_str linked_modules; /* bit vector of linked modules */ +}; + +/* + * A program that uses a dynamic linker contains a dylinker_command to identify + * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker + * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER). + * A file can have at most one of these. + * This struct is also used for the LC_DYLD_ENVIRONMENT load command and + * contains string for dyld to treat like environment variable. + */ +struct dylinker_command { + uint32_t cmd; /* LC_ID_DYLINKER, LC_LOAD_DYLINKER or + LC_DYLD_ENVIRONMENT */ + uint32_t cmdsize; /* includes pathname string */ + union lc_str name; /* dynamic linker's path name */ +}; + +/* + * Thread commands contain machine-specific data structures suitable for + * use in the thread state primitives. The machine specific data structures + * follow the struct thread_command as follows. + * Each flavor of machine specific data structure is preceded by an unsigned + * long constant for the flavor of that data structure, an uint32_t + * that is the count of longs of the size of the state data structure and then + * the state data structure follows. This triple may be repeated for many + * flavors. The constants for the flavors, counts and state data structure + * definitions are expected to be in the header file <machine/thread_status.h>. + * These machine specific data structures sizes must be multiples of + * 4 bytes The cmdsize reflects the total size of the thread_command + * and all of the sizes of the constants for the flavors, counts and state + * data structures. + * + * For executable objects that are unix processes there will be one + * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor. + * This is the same as a LC_THREAD, except that a stack is automatically + * created (based on the shell's limit for the stack size). Command arguments + * and environment variables are copied onto that stack. + */ +struct thread_command { + uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */ + uint32_t cmdsize; /* total size of this command */ + /* uint32_t flavor flavor of thread state */ + /* uint32_t count count of longs in thread state */ + /* struct XXX_thread_state state thread state for this flavor */ + /* ... */ +}; + +/* + * The routines command contains the address of the dynamic shared library + * initialization routine and an index into the module table for the module + * that defines the routine. Before any modules are used from the library the + * dynamic linker fully binds the module that defines the initialization routine + * and then calls it. This gets called before any module initialization + * routines (used for C++ static constructors) in the library. + */ +struct routines_command { /* for 32-bit architectures */ + uint32_t cmd; /* LC_ROUTINES */ + uint32_t cmdsize; /* total size of this command */ + uint32_t init_address; /* address of initialization routine */ + uint32_t init_module; /* index into the module table that */ + /* the init routine is defined in */ + uint32_t reserved1; + uint32_t reserved2; + uint32_t reserved3; + uint32_t reserved4; + uint32_t reserved5; + uint32_t reserved6; +}; + +/* + * The 64-bit routines command. Same use as above. + */ +struct routines_command_64 { /* for 64-bit architectures */ + uint32_t cmd; /* LC_ROUTINES_64 */ + uint32_t cmdsize; /* total size of this command */ + uint64_t init_address; /* address of initialization routine */ + uint64_t init_module; /* index into the module table that */ + /* the init routine is defined in */ + uint64_t reserved1; + uint64_t reserved2; + uint64_t reserved3; + uint64_t reserved4; + uint64_t reserved5; + uint64_t reserved6; +}; + +/* + * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD + * "stab" style symbol table information as described in the header files + * <nlist.h> and <stab.h>. + */ +struct symtab_command { + uint32_t cmd; /* LC_SYMTAB */ + uint32_t cmdsize; /* sizeof(struct symtab_command) */ + uint32_t symoff; /* symbol table offset */ + uint32_t nsyms; /* number of symbol table entries */ + uint32_t stroff; /* string table offset */ + uint32_t strsize; /* string table size in bytes */ +}; + +/* + * This is the second set of the symbolic information which is used to support + * the data structures for the dynamically link editor. + * + * The original set of symbolic information in the symtab_command which contains + * the symbol and string tables must also be present when this load command is + * present. When this load command is present the symbol table is organized + * into three groups of symbols: + * local symbols (static and debugging symbols) - grouped by module + * defined external symbols - grouped by module (sorted by name if not lib) + * undefined external symbols (sorted by name if MH_BINDATLOAD is not set, + * and in order the were seen by the static + * linker if MH_BINDATLOAD is set) + * In this load command there are offsets and counts to each of the three groups + * of symbols. + * + * This load command contains a the offsets and sizes of the following new + * symbolic information tables: + * table of contents + * module table + * reference symbol table + * indirect symbol table + * The first three tables above (the table of contents, module table and + * reference symbol table) are only present if the file is a dynamically linked + * shared library. For executable and object modules, which are files + * containing only one module, the information that would be in these three + * tables is determined as follows: + * table of contents - the defined external symbols are sorted by name + * module table - the file contains only one module so everything in the + * file is part of the module. + * reference symbol table - is the defined and undefined external symbols + * + * For dynamically linked shared library files this load command also contains + * offsets and sizes to the pool of relocation entries for all sections + * separated into two groups: + * external relocation entries + * local relocation entries + * For executable and object modules the relocation entries continue to hang + * off the section structures. + */ +struct dysymtab_command { + uint32_t cmd; /* LC_DYSYMTAB */ + uint32_t cmdsize; /* sizeof(struct dysymtab_command) */ + + /* + * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command + * are grouped into the following three groups: + * local symbols (further grouped by the module they are from) + * defined external symbols (further grouped by the module they are from) + * undefined symbols + * + * The local symbols are used only for debugging. The dynamic binding + * process may have to use them to indicate to the debugger the local + * symbols for a module that is being bound. + * + * The last two groups are used by the dynamic binding process to do the + * binding (indirectly through the module table and the reference symbol + * table when this is a dynamically linked shared library file). + */ + uint32_t ilocalsym; /* index to local symbols */ + uint32_t nlocalsym; /* number of local symbols */ + + uint32_t iextdefsym;/* index to externally defined symbols */ + uint32_t nextdefsym;/* number of externally defined symbols */ + + uint32_t iundefsym; /* index to undefined symbols */ + uint32_t nundefsym; /* number of undefined symbols */ + + /* + * For the for the dynamic binding process to find which module a symbol + * is defined in the table of contents is used (analogous to the ranlib + * structure in an archive) which maps defined external symbols to modules + * they are defined in. This exists only in a dynamically linked shared + * library file. For executable and object modules the defined external + * symbols are sorted by name and is use as the table of contents. + */ + uint32_t tocoff; /* file offset to table of contents */ + uint32_t ntoc; /* number of entries in table of contents */ + + /* + * To support dynamic binding of "modules" (whole object files) the symbol + * table must reflect the modules that the file was created from. This is + * done by having a module table that has indexes and counts into the merged + * tables for each module. The module structure that these two entries + * refer to is described below. This exists only in a dynamically linked + * shared library file. For executable and object modules the file only + * contains one module so everything in the file belongs to the module. + */ + uint32_t modtaboff; /* file offset to module table */ + uint32_t nmodtab; /* number of module table entries */ + + /* + * To support dynamic module binding the module structure for each module + * indicates the external references (defined and undefined) each module + * makes. For each module there is an offset and a count into the + * reference symbol table for the symbols that the module references. + * This exists only in a dynamically linked shared library file. For + * executable and object modules the defined external symbols and the + * undefined external symbols indicates the external references. + */ + uint32_t extrefsymoff; /* offset to referenced symbol table */ + uint32_t nextrefsyms; /* number of referenced symbol table entries */ + + /* + * The sections that contain "symbol pointers" and "routine stubs" have + * indexes and (implied counts based on the size of the section and fixed + * size of the entry) into the "indirect symbol" table for each pointer + * and stub. For every section of these two types the index into the + * indirect symbol table is stored in the section header in the field + * reserved1. An indirect symbol table entry is simply a 32bit index into + * the symbol table to the symbol that the pointer or stub is referring to. + * The indirect symbol table is ordered to match the entries in the section. + */ + uint32_t indirectsymoff; /* file offset to the indirect symbol table */ + uint32_t nindirectsyms; /* number of indirect symbol table entries */ + + /* + * To support relocating an individual module in a library file quickly the + * external relocation entries for each module in the library need to be + * accessed efficiently. Since the relocation entries can't be accessed + * through the section headers for a library file they are separated into + * groups of local and external entries further grouped by module. In this + * case the presents of this load command who's extreloff, nextrel, + * locreloff and nlocrel fields are non-zero indicates that the relocation + * entries of non-merged sections are not referenced through the section + * structures (and the reloff and nreloc fields in the section headers are + * set to zero). + * + * Since the relocation entries are not accessed through the section headers + * this requires the r_address field to be something other than a section + * offset to identify the item to be relocated. In this case r_address is + * set to the offset from the vmaddr of the first LC_SEGMENT command. + * For MH_SPLIT_SEGS images r_address is set to the the offset from the + * vmaddr of the first read-write LC_SEGMENT command. + * + * The relocation entries are grouped by module and the module table + * entries have indexes and counts into them for the group of external + * relocation entries for that the module. + * + * For sections that are merged across modules there must not be any + * remaining external relocation entries for them (for merged sections + * remaining relocation entries must be local). + */ + uint32_t extreloff; /* offset to external relocation entries */ + uint32_t nextrel; /* number of external relocation entries */ + + /* + * All the local relocation entries are grouped together (they are not + * grouped by their module since they are only used if the object is moved + * from it staticly link edited address). + */ + uint32_t locreloff; /* offset to local relocation entries */ + uint32_t nlocrel; /* number of local relocation entries */ + +}; + +/* + * An indirect symbol table entry is simply a 32bit index into the symbol table + * to the symbol that the pointer or stub is refering to. Unless it is for a + * non-lazy symbol pointer section for a defined symbol which strip(1) as + * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the + * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. + */ +#define INDIRECT_SYMBOL_LOCAL 0x80000000 +#define INDIRECT_SYMBOL_ABS 0x40000000 + + +/* a table of contents entry */ +struct dylib_table_of_contents { + uint32_t symbol_index; /* the defined external symbol + (index into the symbol table) */ + uint32_t module_index; /* index into the module table this symbol + is defined in */ +}; + +/* a module table entry */ +struct dylib_module { + uint32_t module_name; /* the module name (index into string table) */ + + uint32_t iextdefsym; /* index into externally defined symbols */ + uint32_t nextdefsym; /* number of externally defined symbols */ + uint32_t irefsym; /* index into reference symbol table */ + uint32_t nrefsym; /* number of reference symbol table entries */ + uint32_t ilocalsym; /* index into symbols for local symbols */ + uint32_t nlocalsym; /* number of local symbols */ + + uint32_t iextrel; /* index into external relocation entries */ + uint32_t nextrel; /* number of external relocation entries */ + + uint32_t iinit_iterm; /* low 16 bits are the index into the init + section, high 16 bits are the index into + the term section */ + uint32_t ninit_nterm; /* low 16 bits are the number of init section + entries, high 16 bits are the number of + term section entries */ + + uint32_t /* for this module address of the start of */ + objc_module_info_addr; /* the (__OBJC,__module_info) section */ + uint32_t /* for this module size of */ + objc_module_info_size; /* the (__OBJC,__module_info) section */ +}; + +/* a 64-bit module table entry */ +struct dylib_module_64 { + uint32_t module_name; /* the module name (index into string table) */ + + uint32_t iextdefsym; /* index into externally defined symbols */ + uint32_t nextdefsym; /* number of externally defined symbols */ + uint32_t irefsym; /* index into reference symbol table */ + uint32_t nrefsym; /* number of reference symbol table entries */ + uint32_t ilocalsym; /* index into symbols for local symbols */ + uint32_t nlocalsym; /* number of local symbols */ + + uint32_t iextrel; /* index into external relocation entries */ + uint32_t nextrel; /* number of external relocation entries */ + + uint32_t iinit_iterm; /* low 16 bits are the index into the init + section, high 16 bits are the index into + the term section */ + uint32_t ninit_nterm; /* low 16 bits are the number of init section + entries, high 16 bits are the number of + term section entries */ + + uint32_t /* for this module size of */ + objc_module_info_size; /* the (__OBJC,__module_info) section */ + uint64_t /* for this module address of the start of */ + objc_module_info_addr; /* the (__OBJC,__module_info) section */ +}; + +/* + * The entries in the reference symbol table are used when loading the module + * (both by the static and dynamic link editors) and if the module is unloaded + * or replaced. Therefore all external symbols (defined and undefined) are + * listed in the module's reference table. The flags describe the type of + * reference that is being made. The constants for the flags are defined in + * <mach-o/nlist.h> as they are also used for symbol table entries. + */ +struct dylib_reference { + uint32_t isym:24, /* index into the symbol table */ + flags:8; /* flags to indicate the type of reference */ +}; + +/* + * The twolevel_hints_command contains the offset and number of hints in the + * two-level namespace lookup hints table. + */ +struct twolevel_hints_command { + uint32_t cmd; /* LC_TWOLEVEL_HINTS */ + uint32_t cmdsize; /* sizeof(struct twolevel_hints_command) */ + uint32_t offset; /* offset to the hint table */ + uint32_t nhints; /* number of hints in the hint table */ +}; + +/* + * The entries in the two-level namespace lookup hints table are twolevel_hint + * structs. These provide hints to the dynamic link editor where to start + * looking for an undefined symbol in a two-level namespace image. The + * isub_image field is an index into the sub-images (sub-frameworks and + * sub-umbrellas list) that made up the two-level image that the undefined + * symbol was found in when it was built by the static link editor. If + * isub-image is 0 the the symbol is expected to be defined in library and not + * in the sub-images. If isub-image is non-zero it is an index into the array + * of sub-images for the umbrella with the first index in the sub-images being + * 1. The array of sub-images is the ordered list of sub-images of the umbrella + * that would be searched for a symbol that has the umbrella recorded as its + * primary library. The table of contents index is an index into the + * library's table of contents. This is used as the starting point of the + * binary search or a directed linear search. + */ +struct twolevel_hint { + uint32_t + isub_image:8, /* index into the sub images */ + itoc:24; /* index into the table of contents */ +}; + +/* + * The prebind_cksum_command contains the value of the original check sum for + * prebound files or zero. When a prebound file is first created or modified + * for other than updating its prebinding information the value of the check sum + * is set to zero. When the file has it prebinding re-done and if the value of + * the check sum is zero the original check sum is calculated and stored in + * cksum field of this load command in the output file. If when the prebinding + * is re-done and the cksum field is non-zero it is left unchanged from the + * input file. + */ +struct prebind_cksum_command { + uint32_t cmd; /* LC_PREBIND_CKSUM */ + uint32_t cmdsize; /* sizeof(struct prebind_cksum_command) */ + uint32_t cksum; /* the check sum or zero */ +}; + +/* + * The uuid load command contains a single 128-bit unique random number that + * identifies an object produced by the static link editor. + */ +struct uuid_command { + uint32_t cmd; /* LC_UUID */ + uint32_t cmdsize; /* sizeof(struct uuid_command) */ + uint8_t uuid[16]; /* the 128-bit uuid */ +}; + +/* + * The rpath_command contains a path which at runtime should be added to + * the current run path used to find @rpath prefixed dylibs. + */ +struct rpath_command { + uint32_t cmd; /* LC_RPATH */ + uint32_t cmdsize; /* includes string */ + union lc_str path; /* path to add to run path */ +}; + +/* + * The linkedit_data_command contains the offsets and sizes of a blob + * of data in the __LINKEDIT segment. + */ +struct linkedit_data_command { + uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, + or LC_FUNCTION_STARTS */ + uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */ + uint32_t dataoff; /* file offset of data in __LINKEDIT segment */ + uint32_t datasize; /* file size of data in __LINKEDIT segment */ +}; + +/* + * The encryption_info_command contains the file offset and size of an + * of an encrypted segment. + */ +struct encryption_info_command { + uint32_t cmd; /* LC_ENCRYPTION_INFO */ + uint32_t cmdsize; /* sizeof(struct encryption_info_command) */ + uint32_t cryptoff; /* file offset of encrypted range */ + uint32_t cryptsize; /* file size of encrypted range */ + uint32_t cryptid; /* which enryption system, + 0 means not-encrypted yet */ +}; + +/* + * The version_min_command contains the min OS version on which this + * binary was built to run. + */ +struct version_min_command { + uint32_t cmd; /* LC_VERSION_MIN_MACOSX or + LC_VERSION_MIN_IPHONEOS */ + uint32_t cmdsize; /* sizeof(struct min_version_command) */ + uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ + uint32_t reserved; /* zero */ +}; + +/* + * The dyld_info_command contains the file offsets and sizes of + * the new compressed form of the information dyld needs to + * load the image. This information is used by dyld on Mac OS X + * 10.6 and later. All information pointed to by this command + * is encoded using byte streams, so no endian swapping is needed + * to interpret it. + */ +struct dyld_info_command { + uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */ + uint32_t cmdsize; /* sizeof(struct dyld_info_command) */ + + /* + * Dyld rebases an image whenever dyld loads it at an address different + * from its preferred address. The rebase information is a stream + * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_. + * Conceptually the rebase information is a table of tuples: + * <seg-index, seg-offset, type> + * The opcodes are a compressed way to encode the table by only + * encoding when a column changes. In addition simple patterns + * like "every n'th offset for m times" can be encoded in a few + * bytes. + */ + uint32_t rebase_off; /* file offset to rebase info */ + uint32_t rebase_size; /* size of rebase info */ + + /* + * Dyld binds an image during the loading process, if the image + * requires any pointers to be initialized to symbols in other images. + * The bind information is a stream of byte sized + * opcodes whose symbolic names start with BIND_OPCODE_. + * Conceptually the bind information is a table of tuples: + * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend> + * The opcodes are a compressed way to encode the table by only + * encoding when a column changes. In addition simple patterns + * like for runs of pointers initialzed to the same value can be + * encoded in a few bytes. + */ + uint32_t bind_off; /* file offset to binding info */ + uint32_t bind_size; /* size of binding info */ + + /* + * Some C++ programs require dyld to unique symbols so that all + * images in the process use the same copy of some code/data. + * This step is done after binding. The content of the weak_bind + * info is an opcode stream like the bind_info. But it is sorted + * alphabetically by symbol name. This enable dyld to walk + * all images with weak binding information in order and look + * for collisions. If there are no collisions, dyld does + * no updating. That means that some fixups are also encoded + * in the bind_info. For instance, all calls to "operator new" + * are first bound to libstdc++.dylib using the information + * in bind_info. Then if some image overrides operator new + * that is detected when the weak_bind information is processed + * and the call to operator new is then rebound. + */ + uint32_t weak_bind_off; /* file offset to weak binding info */ + uint32_t weak_bind_size; /* size of weak binding info */ + + /* + * Some uses of external symbols do not need to be bound immediately. + * Instead they can be lazily bound on first use. The lazy_bind + * are contains a stream of BIND opcodes to bind all lazy symbols. + * Normal use is that dyld ignores the lazy_bind section when + * loading an image. Instead the static linker arranged for the + * lazy pointer to initially point to a helper function which + * pushes the offset into the lazy_bind area for the symbol + * needing to be bound, then jumps to dyld which simply adds + * the offset to lazy_bind_off to get the information on what + * to bind. + */ + uint32_t lazy_bind_off; /* file offset to lazy binding info */ + uint32_t lazy_bind_size; /* size of lazy binding infs */ + + /* + * The symbols exported by a dylib are encoded in a trie. This + * is a compact representation that factors out common prefixes. + * It also reduces LINKEDIT pages in RAM because it encodes all + * information (name, address, flags) in one small, contiguous range. + * The export area is a stream of nodes. The first node sequentially + * is the start node for the trie. + * + * Nodes for a symbol start with a uleb128 that is the length of + * the exported symbol information for the string so far. + * If there is no exported symbol, the node starts with a zero byte. + * If there is exported info, it follows the length. First is + * a uleb128 containing flags. Normally, it is followed by a + * uleb128 encoded offset which is location of the content named + * by the symbol from the mach_header for the image. If the flags + * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is + * a uleb128 encoded library ordinal, then a zero terminated + * UTF8 string. If the string is zero length, then the symbol + * is re-export from the specified dylib with the same name. + * + * After the optional exported symbol information is a byte of + * how many edges (0-255) that this node has leaving it, + * followed by each edge. + * Each edge is a zero terminated UTF8 of the addition chars + * in the symbol, followed by a uleb128 offset for the node that + * edge points to. + * + */ + uint32_t export_off; /* file offset to lazy binding info */ + uint32_t export_size; /* size of lazy binding infs */ +}; + +/* + * The following are used to encode rebasing information + */ +#define REBASE_TYPE_POINTER 1 +#define REBASE_TYPE_TEXT_ABSOLUTE32 2 +#define REBASE_TYPE_TEXT_PCREL32 3 + +#define REBASE_OPCODE_MASK 0xF0 +#define REBASE_IMMEDIATE_MASK 0x0F +#define REBASE_OPCODE_DONE 0x00 +#define REBASE_OPCODE_SET_TYPE_IMM 0x10 +#define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20 +#define REBASE_OPCODE_ADD_ADDR_ULEB 0x30 +#define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40 +#define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50 +#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60 +#define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70 +#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80 + + +/* + * The following are used to encode binding information + */ +#define BIND_TYPE_POINTER 1 +#define BIND_TYPE_TEXT_ABSOLUTE32 2 +#define BIND_TYPE_TEXT_PCREL32 3 + +#define BIND_SPECIAL_DYLIB_SELF 0 +#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 +#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 + +#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1 +#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8 + +#define BIND_OPCODE_MASK 0xF0 +#define BIND_IMMEDIATE_MASK 0x0F +#define BIND_OPCODE_DONE 0x00 +#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10 +#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20 +#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30 +#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40 +#define BIND_OPCODE_SET_TYPE_IMM 0x50 +#define BIND_OPCODE_SET_ADDEND_SLEB 0x60 +#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70 +#define BIND_OPCODE_ADD_ADDR_ULEB 0x80 +#define BIND_OPCODE_DO_BIND 0x90 +#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0 +#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0 +#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0 + + +/* + * The following are used on the flags byte of a terminal node + * in the export information. + */ +#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03 +#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00 +#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01 +#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04 +#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08 +#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10 + +/* + * The symseg_command contains the offset and size of the GNU style + * symbol table information as described in the header file <symseg.h>. + * The symbol roots of the symbol segments must also be aligned properly + * in the file. So the requirement of keeping the offsets aligned to a + * multiple of a 4 bytes translates to the length field of the symbol + * roots also being a multiple of a long. Also the padding must again be + * zeroed. (THIS IS OBSOLETE and no longer supported). + */ +struct symseg_command { + uint32_t cmd; /* LC_SYMSEG */ + uint32_t cmdsize; /* sizeof(struct symseg_command) */ + uint32_t offset; /* symbol segment offset */ + uint32_t size; /* symbol segment size in bytes */ +}; + +/* + * The ident_command contains a free format string table following the + * ident_command structure. The strings are null terminated and the size of + * the command is padded out with zero bytes to a multiple of 4 bytes/ + * (THIS IS OBSOLETE and no longer supported). + */ +struct ident_command { + uint32_t cmd; /* LC_IDENT */ + uint32_t cmdsize; /* strings that follow this command */ +}; + +/* + * The fvmfile_command contains a reference to a file to be loaded at the + * specified virtual address. (Presently, this command is reserved for + * internal use. The kernel ignores this command when loading a program into + * memory). + */ +struct fvmfile_command { + uint32_t cmd; /* LC_FVMFILE */ + uint32_t cmdsize; /* includes pathname string */ + union lc_str name; /* files pathname */ + uint32_t header_addr; /* files virtual address */ +}; + +/* + * Sections of type S_THREAD_LOCAL_VARIABLES contain an array + * of tlv_descriptor structures. + */ +struct tlv_descriptor +{ + void* (*thunk)(struct tlv_descriptor*); + unsigned long key; + unsigned long offset; +}; + +#endif /* _MACHO_LOADER_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/nlist.h.svn-base b/i386/include/mach-o/.svn/text-base/nlist.h.svn-base new file mode 100644 index 0000000..1c19410 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/nlist.h.svn-base @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACHO_NLIST_H_ +#define _MACHO_NLIST_H_ +/* $NetBSD: nlist.h,v 1.5 1994/10/26 00:56:11 cgd Exp $ */ + +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)nlist.h 8.2 (Berkeley) 1/21/94 + */ +#include <stdint.h> + +/* + * Format of a symbol table entry of a Mach-O file for 32-bit architectures. + * Modified from the BSD format. The modifications from the original format + * were changing n_other (an unused field) to n_sect and the addition of the + * N_SECT type. These modifications are required to support symbols in a larger + * number of sections not just the three sections (text, data and bss) in a BSD + * file. + */ +struct nlist { + union { +#ifndef __LP64__ + char *n_name; /* for use when in-core */ +#endif + int32_t n_strx; /* index into the string table */ + } n_un; + uint8_t n_type; /* type flag, see below */ + uint8_t n_sect; /* section number or NO_SECT */ + int16_t n_desc; /* see <mach-o/stab.h> */ + uint32_t n_value; /* value of this symbol (or stab offset) */ +}; + +/* + * This is the symbol table entry structure for 64-bit architectures. + */ +struct nlist_64 { + union { + uint32_t n_strx; /* index into the string table */ + } n_un; + uint8_t n_type; /* type flag, see below */ + uint8_t n_sect; /* section number or NO_SECT */ + uint16_t n_desc; /* see <mach-o/stab.h> */ + uint64_t n_value; /* value of this symbol (or stab offset) */ +}; + +/* + * Symbols with a index into the string table of zero (n_un.n_strx == 0) are + * defined to have a null, "", name. Therefore all string indexes to non null + * names must not have a zero string index. This is bit historical information + * that has never been well documented. + */ + +/* + * The n_type field really contains four fields: + * unsigned char N_STAB:3, + * N_PEXT:1, + * N_TYPE:3, + * N_EXT:1; + * which are used via the following masks. + */ +#define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ +#define N_PEXT 0x10 /* private external symbol bit */ +#define N_TYPE 0x0e /* mask for the type bits */ +#define N_EXT 0x01 /* external symbol bit, set for external symbols */ + +/* + * Only symbolic debugging entries have some of the N_STAB bits set and if any + * of these bits are set then it is a symbolic debugging entry (a stab). In + * which case then the values of the n_type field (the entire field) are given + * in <mach-o/stab.h> + */ + +/* + * Values for N_TYPE bits of the n_type field. + */ +#define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */ +#define N_ABS 0x2 /* absolute, n_sect == NO_SECT */ +#define N_SECT 0xe /* defined in section number n_sect */ +#define N_PBUD 0xc /* prebound undefined (defined in a dylib) */ +#define N_INDR 0xa /* indirect */ + +/* + * If the type is N_INDR then the symbol is defined to be the same as another + * symbol. In this case the n_value field is an index into the string table + * of the other symbol's name. When the other symbol is defined then they both + * take on the defined type and value. + */ + +/* + * If the type is N_SECT then the n_sect field contains an ordinal of the + * section the symbol is defined in. The sections are numbered from 1 and + * refer to sections in order they appear in the load commands for the file + * they are in. This means the same ordinal may very well refer to different + * sections in different files. + * + * The n_value field for all symbol table entries (including N_STAB's) gets + * updated by the link editor based on the value of it's n_sect field and where + * the section n_sect references gets relocated. If the value of the n_sect + * field is NO_SECT then it's n_value field is not changed by the link editor. + */ +#define NO_SECT 0 /* symbol is not in any section */ +#define MAX_SECT 255 /* 1 thru 255 inclusive */ + +/* + * Common symbols are represented by undefined (N_UNDF) external (N_EXT) types + * who's values (n_value) are non-zero. In which case the value of the n_value + * field is the size (in bytes) of the common symbol. The n_sect field is set + * to NO_SECT. The alignment of a common symbol may be set as a power of 2 + * between 2^1 and 2^15 as part of the n_desc field using the macros below. If + * the alignment is not set (a value of zero) then natural alignment based on + * the size is used. + */ +#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f) +#define SET_COMM_ALIGN(n_desc,align) \ + (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8)) + +/* + * To support the lazy binding of undefined symbols in the dynamic link-editor, + * the undefined symbols in the symbol table (the nlist structures) are marked + * with the indication if the undefined reference is a lazy reference or + * non-lazy reference. If both a non-lazy reference and a lazy reference is + * made to the same symbol the non-lazy reference takes precedence. A reference + * is lazy only when all references to that symbol are made through a symbol + * pointer in a lazy symbol pointer section. + * + * The implementation of marking nlist structures in the symbol table for + * undefined symbols will be to use some of the bits of the n_desc field as a + * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field + * of an nlist structure for an undefined symbol to determine the type of + * undefined reference (lazy or non-lazy). + * + * The constants for the REFERENCE FLAGS are propagated to the reference table + * in a shared library file. In that case the constant for a defined symbol, + * REFERENCE_FLAG_DEFINED, is also used. + */ +/* Reference type bits of the n_desc field of undefined symbols */ +#define REFERENCE_TYPE 0x7 +/* types of references */ +#define REFERENCE_FLAG_UNDEFINED_NON_LAZY 0 +#define REFERENCE_FLAG_UNDEFINED_LAZY 1 +#define REFERENCE_FLAG_DEFINED 2 +#define REFERENCE_FLAG_PRIVATE_DEFINED 3 +#define REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4 +#define REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5 + +/* + * To simplify stripping of objects that use are used with the dynamic link + * editor, the static link editor marks the symbols defined an object that are + * referenced by a dynamicly bound object (dynamic shared libraries, bundles). + * With this marking strip knows not to strip these symbols. + */ +#define REFERENCED_DYNAMICALLY 0x0010 + +/* + * For images created by the static link editor with the -twolevel_namespace + * option in effect the flags field of the mach header is marked with + * MH_TWOLEVEL. And the binding of the undefined references of the image are + * determined by the static link editor. Which library an undefined symbol is + * bound to is recorded by the static linker in the high 8 bits of the n_desc + * field using the SET_LIBRARY_ORDINAL macro below. The ordinal recorded + * references the libraries listed in the Mach-O's LC_LOAD_DYLIB, + * LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_LOAD_UPWARD_DYLIB, and + * LC_LAZY_LOAD_DYLIB, etc. load commands in the order they appear in the + * headers. The library ordinals start from 1. + * For a dynamic library that is built as a two-level namespace image the + * undefined references from module defined in another use the same nlist struct + * an in that case SELF_LIBRARY_ORDINAL is used as the library ordinal. For + * defined symbols in all images they also must have the library ordinal set to + * SELF_LIBRARY_ORDINAL. The EXECUTABLE_ORDINAL refers to the executable + * image for references from plugins that refer to the executable that loads + * them. + * + * The DYNAMIC_LOOKUP_ORDINAL is for undefined symbols in a two-level namespace + * image that are looked up by the dynamic linker with flat namespace semantics. + * This ordinal was added as a feature in Mac OS X 10.3 by reducing the + * value of MAX_LIBRARY_ORDINAL by one. So it is legal for existing binaries + * or binaries built with older tools to have 0xfe (254) dynamic libraries. In + * this case the ordinal value 0xfe (254) must be treated as a library ordinal + * for compatibility. + */ +#define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff) +#define SET_LIBRARY_ORDINAL(n_desc,ordinal) \ + (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8)) +#define SELF_LIBRARY_ORDINAL 0x0 +#define MAX_LIBRARY_ORDINAL 0xfd +#define DYNAMIC_LOOKUP_ORDINAL 0xfe +#define EXECUTABLE_ORDINAL 0xff + +/* + * The bit 0x0020 of the n_desc field is used for two non-overlapping purposes + * and has two different symbolic names, N_NO_DEAD_STRIP and N_DESC_DISCARDED. + */ + +/* + * The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a + * relocatable .o file (MH_OBJECT filetype). And is used to indicate to the + * static link editor it is never to dead strip the symbol. + */ +#define N_NO_DEAD_STRIP 0x0020 /* symbol is not to be dead stripped */ + +/* + * The N_DESC_DISCARDED bit of the n_desc field never appears in linked image. + * But is used in very rare cases by the dynamic link editor to mark an in + * memory symbol as discared and longer used for linking. + */ +#define N_DESC_DISCARDED 0x0020 /* symbol is discarded */ + +/* + * The N_WEAK_REF bit of the n_desc field indicates to the dynamic linker that + * the undefined symbol is allowed to be missing and is to have the address of + * zero when missing. + */ +#define N_WEAK_REF 0x0040 /* symbol is weak referenced */ + +/* + * The N_WEAK_DEF bit of the n_desc field indicates to the static and dynamic + * linkers that the symbol definition is weak, allowing a non-weak symbol to + * also be used which causes the weak definition to be discared. Currently this + * is only supported for symbols in coalesed sections. + */ +#define N_WEAK_DEF 0x0080 /* coalesed symbol is a weak definition */ + +/* + * The N_REF_TO_WEAK bit of the n_desc field indicates to the dynamic linker + * that the undefined symbol should be resolved using flat namespace searching. + */ +#define N_REF_TO_WEAK 0x0080 /* reference to a weak symbol */ + +/* + * The N_ARM_THUMB_DEF bit of the n_desc field indicates that the symbol is + * a defintion of a Thumb function. + */ +#define N_ARM_THUMB_DEF 0x0008 /* symbol is a Thumb function (ARM) */ + +/* + * The N_SYMBOL_RESOLVER bit of the n_desc field indicates that the + * that the function is actually a resolver function and should + * be called to get the address of the real function to use. + * This bit is only available in .o files (MH_OBJECT filetype) + */ +#define N_SYMBOL_RESOLVER 0x0100 + +#ifndef __STRICT_BSD__ +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +/* + * The function nlist(3) from the C library. + */ +extern int nlist (const char *filename, struct nlist *list); +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __STRICT_BSD__ */ + +#endif /* _MACHO_LIST_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/ranlib.h.svn-base b/i386/include/mach-o/.svn/text-base/ranlib.h.svn-base new file mode 100644 index 0000000..66a1f09 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/ranlib.h.svn-base @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* ranlib.h 4.1 83/05/03 */ +#ifndef _MACH_O_RANLIB_H_ +#define _MACH_O_RANLIB_H_ + +#include <stdint.h> +#include <sys/types.h> /* off_t */ + +/* + * There are two known orders of table of contents for archives. The first is + * the order ranlib(1) originally produced and still produces without any + * options. This table of contents has the archive member name "__.SYMDEF" + * This order has the ranlib structures in the order the objects appear in the + * archive and the symbol names of those objects in the order of symbol table. + * The second know order is sorted by symbol name and is produced with the -s + * option to ranlib(1). This table of contents has the archive member name + * "__.SYMDEF SORTED" and many programs (notably the 1.0 version of ld(1) can't + * tell the difference between names because of the imbedded blank in the name + * and works with either table of contents). This second order is used by the + * post 1.0 link editor to produce faster linking. The original 1.0 version of + * ranlib(1) gets confused when it is run on a archive with the second type of + * table of contents because it and ar(1) which it uses use different ways to + * determined the member name (ar(1) treats all blanks in the name as + * significant and ranlib(1) only checks for the first one). + */ +#define SYMDEF "__.SYMDEF" +#define SYMDEF_SORTED "__.SYMDEF SORTED" + +/* + * Structure of the __.SYMDEF table of contents for an archive. + * __.SYMDEF begins with a long giving the size in bytes of the ranlib + * structures which immediately follow, and then continues with a string + * table consisting of a long giving the number of bytes of strings which + * follow and then the strings themselves. The ran_strx fields index the + * string table whose first byte is numbered 0. + */ +struct ranlib { + union { + uint32_t ran_strx; /* string table index of */ +#ifndef __LP64__ + char *ran_name; /* symbol defined by */ +#endif + } ran_un; + uint32_t ran_off; /* library member at this offset */ +}; +#endif /* _MACH_O_RANLIB_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/reloc.h.svn-base b/i386/include/mach-o/.svn/text-base/reloc.h.svn-base new file mode 100644 index 0000000..d5741ef --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/reloc.h.svn-base @@ -0,0 +1,203 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */ + +/* + * Copyright (c) 1993 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MACHO_RELOC_H_ +#define _MACHO_RELOC_H_ +#include <stdint.h> + +/* + * Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD + * format. The modifications from the original format were changing the value + * of the r_symbolnum field for "local" (r_extern == 0) relocation entries. + * This modification is required to support symbols in an arbitrary number of + * sections not just the three sections (text, data and bss) in a 4.3BSD file. + * Also the last 4 bits have had the r_type tag added to them. + */ +struct relocation_info { + int32_t r_address; /* offset in the section to what is being + relocated */ + uint32_t r_symbolnum:24, /* symbol index if r_extern == 1 or section + ordinal if r_extern == 0 */ + r_pcrel:1, /* was relocated pc relative already */ + r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ + r_extern:1, /* does not include value of sym referenced */ + r_type:4; /* if not 0, machine specific relocation type */ +}; +#define R_ABS 0 /* absolute relocation type for Mach-O files */ + +/* + * The r_address is not really the address as it's name indicates but an offset. + * In 4.3BSD a.out objects this offset is from the start of the "segment" for + * which relocation entry is for (text or data). For Mach-O object files it is + * also an offset but from the start of the "section" for which the relocation + * entry is for. See comments in <mach-o/loader.h> about the r_address feild + * in images for used with the dynamic linker. + * + * In 4.3BSD a.out objects if r_extern is zero then r_symbolnum is an ordinal + * for the segment the symbol being relocated is in. These ordinals are the + * symbol types N_TEXT, N_DATA, N_BSS or N_ABS. In Mach-O object files these + * ordinals refer to the sections in the object file in the order their section + * structures appear in the headers of the object file they are in. The first + * section has the ordinal 1, the second 2, and so on. This means that the + * same ordinal in two different object files could refer to two different + * sections. And further could have still different ordinals when combined + * by the link-editor. The value R_ABS is used for relocation entries for + * absolute symbols which need no further relocation. + */ + +/* + * For RISC machines some of the references are split across two instructions + * and the instruction does not contain the complete value of the reference. + * In these cases a second, or paired relocation entry, follows each of these + * relocation entries, using a PAIR r_type, which contains the other part of the + * reference not contained in the instruction. This other part is stored in the + * pair's r_address field. The exact number of bits of the other part of the + * reference store in the r_address field is dependent on the particular + * relocation type for the particular architecture. + */ + +/* + * To make scattered loading by the link editor work correctly "local" + * relocation entries can't be used when the item to be relocated is the value + * of a symbol plus an offset (where the resulting expresion is outside the + * block the link editor is moving, a blocks are divided at symbol addresses). + * In this case. where the item is a symbol value plus offset, the link editor + * needs to know more than just the section the symbol was defined. What is + * needed is the actual value of the symbol without the offset so it can do the + * relocation correctly based on where the value of the symbol got relocated to + * not the value of the expression (with the offset added to the symbol value). + * So for the NeXT 2.0 release no "local" relocation entries are ever used when + * there is a non-zero offset added to a symbol. The "external" and "local" + * relocation entries remain unchanged. + * + * The implemention is quite messy given the compatibility with the existing + * relocation entry format. The ASSUMPTION is that a section will never be + * bigger than 2**24 - 1 (0x00ffffff or 16,777,215) bytes. This assumption + * allows the r_address (which is really an offset) to fit in 24 bits and high + * bit of the r_address field in the relocation_info structure to indicate + * it is really a scattered_relocation_info structure. Since these are only + * used in places where "local" relocation entries are used and not where + * "external" relocation entries are used the r_extern field has been removed. + * + * For scattered loading to work on a RISC machine where some of the references + * are split across two instructions the link editor needs to be assured that + * each reference has a unique 32 bit reference (that more than one reference is + * NOT sharing the same high 16 bits for example) so it move each referenced + * item independent of each other. Some compilers guarantees this but the + * compilers don't so scattered loading can be done on those that do guarantee + * this. + */ +#if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) +/* + * The reason for the ifdef's of __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are that + * when stattered relocation entries were added the mistake of using a mask + * against a structure that is made up of bit fields was used. To make this + * design work this structure must be laid out in memory the same way so the + * mask can be applied can check the same bit each time (r_scattered). + */ +#endif /* defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) */ +#define R_SCATTERED 0x80000000 /* mask to be applied to the r_address field + of a relocation_info structure to tell that + is is really a scattered_relocation_info + stucture */ +struct scattered_relocation_info { +#ifdef __BIG_ENDIAN__ + uint32_t r_scattered:1, /* 1=scattered, 0=non-scattered (see above) */ + r_pcrel:1, /* was relocated pc relative already */ + r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ + r_type:4, /* if not 0, machine specific relocation type */ + r_address:24; /* offset in the section to what is being + relocated */ + int32_t r_value; /* the value the item to be relocated is + refering to (without any offset added) */ +#endif /* __BIG_ENDIAN__ */ +#ifdef __LITTLE_ENDIAN__ + uint32_t + r_address:24, /* offset in the section to what is being + relocated */ + r_type:4, /* if not 0, machine specific relocation type */ + r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ + r_pcrel:1, /* was relocated pc relative already */ + r_scattered:1; /* 1=scattered, 0=non-scattered (see above) */ + int32_t r_value; /* the value the item to be relocated is + refering to (without any offset added) */ +#endif /* __LITTLE_ENDIAN__ */ +}; + +/* + * Relocation types used in a generic implementation. Relocation entries for + * normal things use the generic relocation as discribed above and their r_type + * is GENERIC_RELOC_VANILLA (a value of zero). + * + * Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support + * the difference of two symbols defined in different sections. That is the + * expression "symbol1 - symbol2 + constant" is a relocatable expression when + * both symbols are defined in some section. For this type of relocation the + * both relocations entries are scattered relocation entries. The value of + * symbol1 is stored in the first relocation entry's r_value field and the + * value of symbol2 is stored in the pair's r_value field. + * + * A special case for a prebound lazy pointer is needed to beable to set the + * value of the lazy pointer back to its non-prebound state. This is done + * using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation + * entry where the r_value feild is the value of the lazy pointer not prebound. + */ +enum reloc_type_generic +{ + GENERIC_RELOC_VANILLA, /* generic relocation as discribed above */ + GENERIC_RELOC_PAIR, /* Only follows a GENERIC_RELOC_SECTDIFF */ + GENERIC_RELOC_SECTDIFF, + GENERIC_RELOC_PB_LA_PTR, /* prebound lazy pointer */ + GENERIC_RELOC_LOCAL_SECTDIFF, + GENERIC_RELOC_TLV /* thread local variables */ +}; + +#endif /* _MACHO_RELOC_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/stab.h.svn-base b/i386/include/mach-o/.svn/text-base/stab.h.svn-base new file mode 100644 index 0000000..e9e15b2 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/stab.h.svn-base @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACHO_STAB_H_ +#define _MACHO_STAB_H_ +/* $NetBSD: stab.h,v 1.4 1994/10/26 00:56:25 cgd Exp $ */ + +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stab.h 5.2 (Berkeley) 4/4/91 + */ + +/* + * This file gives definitions supplementing <nlist.h> for permanent symbol + * table entries of Mach-O files. Modified from the BSD definitions. The + * modifications from the original definitions were changing what the values of + * what was the n_other field (an unused field) which is now the n_sect field. + * These modifications are required to support symbols in an arbitrary number of + * sections not just the three sections (text, data and bss) in a BSD file. + * The values of the defined constants have NOT been changed. + * + * These must have one of the N_STAB bits on. The n_value fields are subject + * to relocation according to the value of their n_sect field. So for types + * that refer to things in sections the n_sect field must be filled in with the + * proper section ordinal. For types that are not to have their n_value field + * relocatated the n_sect field must be NO_SECT. + */ + +/* + * Symbolic debugger symbols. The comments give the conventional use for + * + * .stabs "n_name", n_type, n_sect, n_desc, n_value + * + * where n_type is the defined constant and not listed in the comment. Other + * fields not listed are zero. n_sect is the section ordinal the entry is + * refering to. + */ +#define N_GSYM 0x20 /* global symbol: name,,NO_SECT,type,0 */ +#define N_FNAME 0x22 /* procedure name (f77 kludge): name,,NO_SECT,0,0 */ +#define N_FUN 0x24 /* procedure: name,,n_sect,linenumber,address */ +#define N_STSYM 0x26 /* static symbol: name,,n_sect,type,address */ +#define N_LCSYM 0x28 /* .lcomm symbol: name,,n_sect,type,address */ +#define N_BNSYM 0x2e /* begin nsect sym: 0,,n_sect,0,address */ +#define N_OPT 0x3c /* emitted with gcc2_compiled and in gcc source */ +#define N_RSYM 0x40 /* register sym: name,,NO_SECT,type,register */ +#define N_SLINE 0x44 /* src line: 0,,n_sect,linenumber,address */ +#define N_ENSYM 0x4e /* end nsect sym: 0,,n_sect,0,address */ +#define N_SSYM 0x60 /* structure elt: name,,NO_SECT,type,struct_offset */ +#define N_SO 0x64 /* source file name: name,,n_sect,0,address */ +#define N_OSO 0x66 /* object file name: name,,0,0,st_mtime */ +#define N_LSYM 0x80 /* local sym: name,,NO_SECT,type,offset */ +#define N_BINCL 0x82 /* include file beginning: name,,NO_SECT,0,sum */ +#define N_SOL 0x84 /* #included file name: name,,n_sect,0,address */ +#define N_PARAMS 0x86 /* compiler parameters: name,,NO_SECT,0,0 */ +#define N_VERSION 0x88 /* compiler version: name,,NO_SECT,0,0 */ +#define N_OLEVEL 0x8A /* compiler -O level: name,,NO_SECT,0,0 */ +#define N_PSYM 0xa0 /* parameter: name,,NO_SECT,type,offset */ +#define N_EINCL 0xa2 /* include file end: name,,NO_SECT,0,0 */ +#define N_ENTRY 0xa4 /* alternate entry: name,,n_sect,linenumber,address */ +#define N_LBRAC 0xc0 /* left bracket: 0,,NO_SECT,nesting level,address */ +#define N_EXCL 0xc2 /* deleted include file: name,,NO_SECT,0,sum */ +#define N_RBRAC 0xe0 /* right bracket: 0,,NO_SECT,nesting level,address */ +#define N_BCOMM 0xe2 /* begin common: name,,NO_SECT,0,0 */ +#define N_ECOMM 0xe4 /* end common: name,,n_sect,0,0 */ +#define N_ECOML 0xe8 /* end common (local name): 0,,n_sect,0,address */ +#define N_LENG 0xfe /* second stab entry with length information */ + +/* + * for the berkeley pascal compiler, pc(1): + */ +#define N_PC 0x30 /* global pascal symbol: name,,NO_SECT,subtype,line */ + +#endif /* _MACHO_STAB_H_ */ diff --git a/i386/include/mach-o/.svn/text-base/swap.h.svn-base b/i386/include/mach-o/.svn/text-base/swap.h.svn-base new file mode 100644 index 0000000..ba10994 --- /dev/null +++ b/i386/include/mach-o/.svn/text-base/swap.h.svn-base @@ -0,0 +1,207 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_SWAP_H_ +#define _MACH_O_SWAP_H_ + +#include <stdint.h> +#include <architecture/byte_order.h> +#include <mach-o/fat.h> +#include <mach-o/loader.h> +#include <mach-o/nlist.h> +#include <mach-o/reloc.h> +#include <mach-o/ranlib.h> + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +extern void swap_fat_header( + struct fat_header *fat_header, + enum NXByteOrder target_byte_order); + +extern void swap_fat_arch( + struct fat_arch *fat_archs, + uint32_t nfat_arch, + enum NXByteOrder target_byte_order); + +extern void swap_mach_header( + struct mach_header *mh, + enum NXByteOrder target_byte_order); + +extern void swap_mach_header_64( + struct mach_header_64 *mh, + enum NXByteOrder target_byte_order); + +extern void swap_load_command( + struct load_command *lc, + enum NXByteOrder target_byte_order); + +extern void swap_segment_command( + struct segment_command *sg, + enum NXByteOrder target_byte_order); + +extern void swap_segment_command_64( + struct segment_command_64 *sg, + enum NXByteOrder target_byte_order); + +extern void swap_section( + struct section *s, + uint32_t nsects, + enum NXByteOrder target_byte_order); + +extern void swap_section_64( + struct section_64 *s, + uint32_t nsects, + enum NXByteOrder target_byte_order); + +extern void swap_symtab_command( + struct symtab_command *st, + enum NXByteOrder target_byte_order); + +extern void swap_dysymtab_command( + struct dysymtab_command *dyst, + enum NXByteOrder target_byte_sex); + +extern void swap_symseg_command( + struct symseg_command *ss, + enum NXByteOrder target_byte_order); + +extern void swap_fvmlib_command( + struct fvmlib_command *fl, + enum NXByteOrder target_byte_order); + +extern void swap_dylib_command( + struct dylib_command *dl, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_framework_command( + struct sub_framework_command *sub, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_umbrella_command( + struct sub_umbrella_command *usub, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_library_command( + struct sub_library_command *lsub, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_client_command( + struct sub_client_command *csub, + enum NXByteOrder target_byte_sex); + +extern void swap_prebound_dylib_command( + struct prebound_dylib_command *pbdylib, + enum NXByteOrder target_byte_sex); + +extern void swap_dylinker_command( + struct dylinker_command *dyld, + enum NXByteOrder target_byte_sex); + +extern void swap_fvmfile_command( + struct fvmfile_command *ff, + enum NXByteOrder target_byte_order); + +extern void swap_thread_command( + struct thread_command *ut, + enum NXByteOrder target_byte_order); + +extern void swap_ident_command( + struct ident_command *ident, + enum NXByteOrder target_byte_order); + +extern void swap_routines_command( + struct routines_command *r_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_routines_command_64( + struct routines_command_64 *r_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_twolevel_hints_command( + struct twolevel_hints_command *hints_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_prebind_cksum_command( + struct prebind_cksum_command *cksum_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_uuid_command( + struct uuid_command *uuid_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_twolevel_hint( + struct twolevel_hint *hints, + uint32_t nhints, + enum NXByteOrder target_byte_sex); + +extern void swap_nlist( + struct nlist *symbols, + uint32_t nsymbols, + enum NXByteOrder target_byte_order); + +extern void swap_nlist_64( + struct nlist_64 *symbols, + uint32_t nsymbols, + enum NXByteOrder target_byte_order); + +extern void swap_ranlib( + struct ranlib *ranlibs, + uint32_t nranlibs, + enum NXByteOrder target_byte_order); + +extern void swap_relocation_info( + struct relocation_info *relocs, + uint32_t nrelocs, + enum NXByteOrder target_byte_order); + +extern void swap_indirect_symbols( + uint32_t *indirect_symbols, + uint32_t nindirect_symbols, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_reference( + struct dylib_reference *refs, + uint32_t nrefs, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_module( + struct dylib_module *mods, + uint32_t nmods, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_module_64( + struct dylib_module_64 *mods, + uint32_t nmods, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_table_of_contents( + struct dylib_table_of_contents *tocs, + uint32_t ntocs, + enum NXByteOrder target_byte_sex); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MACH_O_SWAP_H_ */ diff --git a/i386/include/mach-o/arch.h b/i386/include/mach-o/arch.h new file mode 100644 index 0000000..526c10f --- /dev/null +++ b/i386/include/mach-o/arch.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_ARCH_H_ +#define _MACH_O_ARCH_H_ +/* + * Copyright (c) 1997 Apple Computer, Inc. + * + * Functions that deal with information about architectures. + * + */ + +#include <stdint.h> +#include <mach/machine.h> +#include <architecture/byte_order.h> + +/* The NXArchInfo structs contain the architectures symbolic name + * (such as "ppc"), its CPU type and CPU subtype as defined in + * mach/machine.h, the byte order for the architecture, and a + * describing string (such as "PowerPC"). + * There will both be entries for specific CPUs (such as ppc604e) as + * well as generic "family" entries (such as ppc). + */ +typedef struct { + const char *name; + cpu_type_t cputype; + cpu_subtype_t cpusubtype; + enum NXByteOrder byteorder; + const char *description; +} NXArchInfo; + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* NXGetAllArchInfos() returns a pointer to an array of all known + * NXArchInfo structures. The last NXArchInfo is marked by a NULL name. + */ +extern const NXArchInfo *NXGetAllArchInfos(void); + +/* NXGetLocalArchInfo() returns the NXArchInfo for the local host, or NULL + * if none is known. + */ +extern const NXArchInfo *NXGetLocalArchInfo(void); + +/* NXGetArchInfoFromName() and NXGetArchInfoFromCpuType() return the + * NXArchInfo from the architecture's name or cputype/cpusubtype + * combination. A cpusubtype of CPU_SUBTYPE_MULTIPLE can be used + * to request the most general NXArchInfo known for the given cputype. + * NULL is returned if no matching NXArchInfo can be found. + */ +extern const NXArchInfo *NXGetArchInfoFromName(const char *name); +extern const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype, + cpu_subtype_t cpusubtype); + +/* NXFindBestFatArch() is passed a cputype and cpusubtype and a set of + * fat_arch structs and selects the best one that matches (if any) and returns + * a pointer to that fat_arch struct (or NULL). The fat_arch structs must be + * in the host byte order and correct such that the fat_archs really points to + * enough memory for nfat_arch structs. It is possible that this routine could + * fail if new cputypes or cpusubtypes are added and an old version of this + * routine is used. But if there is an exact match between the cputype and + * cpusubtype and one of the fat_arch structs this routine will always succeed. + */ +extern struct fat_arch *NXFindBestFatArch(cpu_type_t cputype, + cpu_subtype_t cpusubtype, + struct fat_arch *fat_archs, + uint32_t nfat_archs); + +/* NXCombineCpuSubtypes() returns the resulting cpusubtype when combining two + * different cpusubtypes for the specified cputype. If the two cpusubtypes + * can't be combined (the specific subtypes are mutually exclusive) -1 is + * returned indicating it is an error to combine them. This can also fail and + * return -1 if new cputypes or cpusubtypes are added and an old version of + * this routine is used. But if the cpusubtypes are the same they can always + * be combined and this routine will return the cpusubtype pass in. + */ +extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype, + cpu_subtype_t cpusubtype1, + cpu_subtype_t cpusubtype2); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MACH_O_ARCH_H_ */ diff --git a/i386/include/mach-o/compact_unwind_encoding.h b/i386/include/mach-o/compact_unwind_encoding.h new file mode 100644 index 0000000..237b226 --- /dev/null +++ b/i386/include/mach-o/compact_unwind_encoding.h @@ -0,0 +1,224 @@ +/* -*- mode: C; c-basic-offset: 4; tab-width: 4 -*- + * + * Copyright (c) 2008-2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +#ifndef __COMPACT_UNWIND_ENCODING__ +#define __COMPACT_UNWIND_ENCODING__ + +#include <stdint.h> + + +// +// Each final linked mach-o image has an optional __TEXT, __unwind_info section. +// This section is much smaller and faster to use than the __eh_frame section. +// + + + +// +// Compilers usually emit standard Dwarf FDEs. The linker recognizes standard FDEs and +// synthesizes a matching compact_unwind_encoding_t and adds it to the __unwind_info table. +// It is also possible for the compiler to emit __unwind_info entries for functions that +// have different unwind requirements at different ranges in the function. +// +typedef uint32_t compact_unwind_encoding_t; + + + +// +// The __unwind_info section is laid out for an efficient two level lookup. +// The header of the section contains a coarse index that maps function address +// to the page (4096 byte block) containing the unwind info for that function. +// + +#define UNWIND_SECTION_VERSION 1 +struct unwind_info_section_header +{ + uint32_t version; // UNWIND_SECTION_VERSION + uint32_t commonEncodingsArraySectionOffset; + uint32_t commonEncodingsArrayCount; + uint32_t personalityArraySectionOffset; + uint32_t personalityArrayCount; + uint32_t indexSectionOffset; + uint32_t indexCount; + // compact_unwind_encoding_t[] + // uintptr_t personalities[] + // unwind_info_section_header_index_entry[] + // unwind_info_section_header_lsda_index_entry[] +}; + +struct unwind_info_section_header_index_entry +{ + uint32_t functionOffset; + uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page + uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range +}; + +struct unwind_info_section_header_lsda_index_entry +{ + uint32_t functionOffset; + uint32_t lsdaOffset; +}; + +// +// There are two kinds of second level index pages: regular and compressed. +// A compressed page can hold up to 1021 entries, but it cannot be used +// if too many different encoding types are used. The regular page holds +// 511 entries. +// + +struct unwind_info_regular_second_level_entry +{ + uint32_t functionOffset; + compact_unwind_encoding_t encoding; +}; + +#define UNWIND_SECOND_LEVEL_REGULAR 2 +struct unwind_info_regular_second_level_page_header +{ + uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR + uint16_t entryPageOffset; + uint16_t entryCount; + // entry array +}; + +#define UNWIND_SECOND_LEVEL_COMPRESSED 3 +struct unwind_info_compressed_second_level_page_header +{ + uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED + uint16_t entryPageOffset; + uint16_t entryCount; + uint16_t encodingsPageOffset; + uint16_t encodingsCount; + // 32-bit entry array + // encodings array +}; + +#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF) +#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF) + + + +// architecture independent bits +enum { + UNWIND_IS_NOT_FUNCTION_START = 0x80000000, + UNWIND_HAS_LSDA = 0x40000000, + UNWIND_PERSONALITY_MASK = 0x30000000, +}; + + +// x86_64 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// rbp based: +// 15-bits (5*3-bits per reg) register permutation +// 8-bits for stack offset +// frameless: +// 8-bits stack size +// 3-bits stack adjust +// 3-bits register count +// 10-bits register permutation +// +enum { + UNWIND_X86_64_MODE_MASK = 0x0F000000, + UNWIND_X86_64_MODE_COMPATIBILITY = 0x00000000, + UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000, + UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000, + UNWIND_X86_64_MODE_STACK_IND = 0x03000000, + UNWIND_X86_64_MODE_DWARF = 0x04000000, + + UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF, + UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000, + + UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000, + UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000, + UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00, + UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, + + UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x03FFFFFF, +}; + +enum { + UNWIND_X86_64_REG_NONE = 0, + UNWIND_X86_64_REG_RBX = 1, + UNWIND_X86_64_REG_R12 = 2, + UNWIND_X86_64_REG_R13 = 3, + UNWIND_X86_64_REG_R14 = 4, + UNWIND_X86_64_REG_R15 = 5, + UNWIND_X86_64_REG_RBP = 6, +}; + + +// x86 +// +// 1-bit: start +// 1-bit: has lsda +// 2-bit: personality index +// +// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=dwarf +// ebp based: +// 15-bits (5*3-bits per reg) register permutation +// 8-bits for stack offset +// frameless: +// 8-bits stack size +// 3-bits stack adjust +// 3-bits register count +// 10-bits register permutation +// +enum { + UNWIND_X86_MODE_MASK = 0x0F000000, + UNWIND_X86_MODE_COMPATIBILITY = 0x00000000, + UNWIND_X86_MODE_EBP_FRAME = 0x01000000, + UNWIND_X86_MODE_STACK_IMMD = 0x02000000, + UNWIND_X86_MODE_STACK_IND = 0x03000000, + UNWIND_X86_MODE_DWARF = 0x04000000, + + UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF, + UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000, + + UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000, + UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000, + UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00, + UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF, + + UNWIND_X86_DWARF_SECTION_OFFSET = 0x03FFFFFF, +}; + +enum { + UNWIND_X86_REG_NONE = 0, + UNWIND_X86_REG_EBX = 1, + UNWIND_X86_REG_ECX = 2, + UNWIND_X86_REG_EDX = 3, + UNWIND_X86_REG_EDI = 4, + UNWIND_X86_REG_ESI = 5, + UNWIND_X86_REG_EBP = 6, +}; + + +#endif + diff --git a/i386/include/mach-o/dyld.h b/i386/include/mach-o/dyld.h new file mode 100644 index 0000000..3f579ef --- /dev/null +++ b/i386/include/mach-o/dyld.h @@ -0,0 +1,253 @@ +/* + * Copyright (c) 1999-2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_DYLD_H_ +#define _MACH_O_DYLD_H_ + + +#include <stddef.h> +#include <stdint.h> +#include <stdbool.h> + +#include <mach-o/loader.h> +#include <Availability.h> + +#if __cplusplus +extern "C" { +#endif + +/* + * The following functions allow you to iterate through all loaded images. + * This is not a thread safe operation. Another thread can add or remove + * an image during the iteration. + * + * Many uses of these routines can be replace by a call to dladdr() which + * will return the mach_header and name of an image, given an address in + * the image. dladdr() is thread safe. + */ +extern uint32_t _dyld_image_count(void) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern const char* _dyld_get_image_name(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * The following functions allow you to install callbacks which will be called + * by dyld whenever an image is loaded or unloaded. During a call to _dyld_register_func_for_add_image() + * the callback func is called for every existing image. Later, it is called as each new image + * is loaded and bound (but initializers not yet run). The callback registered with + * _dyld_register_func_for_remove_image() is called after any terminators in an image are run + * and before the image is un-memory-mapped. + */ +extern void _dyld_register_func_for_add_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); +extern void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * NSVersionOfRunTimeLibrary() returns the current_version number of the currently dylib + * specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and + * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if no such library is loaded. + */ +extern int32_t NSVersionOfRunTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * NSVersionOfRunTimeLibrary() returns the current_version number that the main executable was linked + * against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and + * "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if the main executable did not link + * against the specified library. + */ +extern int32_t NSVersionOfLinkTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + +/* + * _NSGetExecutablePath() copies the path of the main executable into the buffer. The bufsize parameter + * should initially be the size of the buffer. The function returns 0 if the path was successfully copied, + * and *bufsize is left unchanged. It returns -1 if the buffer is not large enough, and *bufsize is set + * to the size required. + * + * Note that _NSGetExecutablePath will return "a path" to the executable not a "real path" to the executable. + * That is the path may be a symbolic link and not the real file. With deep directories the total bufsize + * needed could be more than MAXPATHLEN. + */ +extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0); + + + +/* + * _dyld_moninit() is a private interface between dyld and libSystem. + */ +extern void _dyld_moninit(void (*monaddition)(char *lowpc, char *highpc)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0); + + + + + +/* + * The following dyld API's are deprecated as of Mac OS X 10.5. They are either + * no longer necessary or are superceeded by dlopen and friends in <dlfcn.h>. + * dlopen/dlsym/dlclose have been available since Mac OS X 10.3 and work with + * dylibs and bundles. + * + * NSAddImage -> dlopen + * NSLookupSymbolInImage -> dlsym + * NSCreateObjectFileImageFromFile -> dlopen + * NSDestroyObjectFileImage -> dlclose + * NSLinkModule -> not needed when dlopen used + * NSUnLinkModule -> not needed when dlclose used + * NSLookupSymbolInModule -> dlsym + * _dyld_image_containing_address -> dladdr + * NSLinkEditError -> dlerror + * + */ + +#ifndef ENUM_DYLD_BOOL +#define ENUM_DYLD_BOOL + #undef FALSE + #undef TRUE + enum DYLD_BOOL { FALSE, TRUE }; +#endif /* ENUM_DYLD_BOOL */ + + +/* Object file image API */ +typedef enum { + NSObjectFileImageFailure, /* for this a message is printed on stderr */ + NSObjectFileImageSuccess, + NSObjectFileImageInappropriateFile, + NSObjectFileImageArch, + NSObjectFileImageFormat, /* for this a message is printed on stderr */ + NSObjectFileImageAccess +} NSObjectFileImageReturnCode; + +typedef struct __NSObjectFileImage* NSObjectFileImage; + +/* NSObjectFileImage can only be used with MH_BUNDLE files */ +extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern uint32_t NSSymbolDefinitionCountInObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern const char* NSSymbolDefinitionNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern uint32_t NSSymbolReferenceCountInObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern const char* NSSymbolReferenceNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal, bool *tentative_definition) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern void* NSGetSectionDataInObjectFileImage(NSObjectFileImage objectFileImage, const char* segmentName, const char* sectionName, size_t *size) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool NSHasModInitObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +typedef struct __NSModule* NSModule; +extern const char* NSNameOfModule(NSModule m) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern const char* NSLibraryNameForModule(NSModule m) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern NSModule NSLinkModule(NSObjectFileImage objectFileImage, const char* moduleName, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSLINKMODULE_OPTION_NONE 0x0 +#define NSLINKMODULE_OPTION_BINDNOW 0x1 +#define NSLINKMODULE_OPTION_PRIVATE 0x2 +#define NSLINKMODULE_OPTION_RETURN_ON_ERROR 0x4 +#define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8 +#define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10 + +extern bool NSUnLinkModule(NSModule module, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSUNLINKMODULE_OPTION_NONE 0x0 +#define NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED 0x1 +#define NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES 0x2 + +/* symbol API */ +typedef struct __NSSymbol* NSSymbol; +extern bool NSIsSymbolNameDefined(const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern bool NSIsSymbolNameDefinedInImage(const struct mach_header* image, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 +#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 +#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 +extern const char* NSNameOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern void * NSAddressOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern NSModule NSModuleForSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +/* error handling API */ +typedef enum { + NSLinkEditFileAccessError, + NSLinkEditFileFormatError, + NSLinkEditMachResourceError, + NSLinkEditUnixResourceError, + NSLinkEditOtherError, + NSLinkEditWarningError, + NSLinkEditMultiplyDefinedError, + NSLinkEditUndefinedError +} NSLinkEditErrors; + +/* + * For the NSLinkEditErrors value NSLinkEditOtherError these are the values + * passed to the link edit error handler as the errorNumber (what would be an + * errno value for NSLinkEditUnixResourceError or a kern_return_t value for + * NSLinkEditMachResourceError). + */ +typedef enum { + NSOtherErrorRelocation, + NSOtherErrorLazyBind, + NSOtherErrorIndrLoop, + NSOtherErrorLazyInit, + NSOtherErrorInvalidArgs +} NSOtherErrorNumbers; + +extern void NSLinkEditError(NSLinkEditErrors *c, int *errorNumber, const char** fileName, const char** errorString) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +typedef struct { + void (*undefined)(const char* symbolName); + NSModule (*multiple)(NSSymbol s, NSModule oldModule, NSModule newModule); + void (*linkEdit)(NSLinkEditErrors errorClass, int errorNumber, + const char* fileName, const char* errorString); +} NSLinkEditErrorHandlers; + +extern void NSInstallLinkEditErrorHandlers(const NSLinkEditErrorHandlers *handlers) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern bool NSAddLibrary(const char* pathName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern bool NSAddLibraryWithSearching(const char* pathName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +#define NSADDIMAGE_OPTION_NONE 0x0 +#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 +#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 +#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 +#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 + +extern bool _dyld_present(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_launched_prebound(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_all_twolevel_modules_prebound(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_bind_objc_module(const void* objc_module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_bind_fully_image_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern bool _dyld_image_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_lookup_and_bind(const char* symbol_name, void **address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_lookup_and_bind_with_hint(const char* symbol_name, const char* library_name_hint, void** address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA); +extern void _dyld_lookup_and_bind_fully(const char* symbol_name, void** address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + +extern const struct mach_header* _dyld_get_image_header_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA); + + +#if __cplusplus +} +#endif + +#endif /* _MACH_O_DYLD_H_ */ diff --git a/i386/include/mach-o/dyld_images.h b/i386/include/mach-o/dyld_images.h new file mode 100644 index 0000000..ed710ef --- /dev/null +++ b/i386/include/mach-o/dyld_images.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2006-2010 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _DYLD_IMAGES_ +#define _DYLD_IMAGES_ + +#include <stdbool.h> +#include <unistd.h> +#include <mach/mach.h> + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Beginning in Mac OS X 10.4, this is how gdb discovers which mach-o images are loaded in a process. + * + * gdb looks for the symbol "_dyld_all_image_infos" in dyld. It contains the fields below. + * + * For a snashot of what images are currently loaded, the infoArray fields contain a pointer + * to an array of all images. If infoArray is NULL, it means it is being modified, come back later. + * + * To be notified of changes, gdb sets a break point on the address pointed to by the notificationn + * field. The function it points to is called by dyld with an array of information about what images + * have been added (dyld_image_adding) or are about to be removed (dyld_image_removing). + * + * The notification is called after infoArray is updated. This means that if gdb attaches to a process + * and infoArray is NULL, gdb can set a break point on notification and let the proccess continue to + * run until the break point. Then gdb can inspect the full infoArray. + * + * The dyldVersion field always points to a C string that contains the dyld version. For instance, + * in dyld-127.3, dyldVersion would contain a pointer to "127.3". + * + * The errorMessage and terminationFlags fields are normally zero. If dyld terminates a process + * (for instance because a required dylib or symbol is missing), then the errorMessage field will + * be set to point to a C string message buffer containing the reason dyld terminate the process. + * The low bit of the terminationFlags will be set if dyld terminated the process before any user + * code ran, in which case there is no need for the crash log to contain the backtrace. + * + * When dyld terminates a process because some required dylib or symbol cannot be bound, in + * addition to the errorMessage field, it now sets the errorKind field and the corresponding + * fields: errorClientOfDylibPath, errorTargetDylibPath, errorSymbol. + * + */ + +enum dyld_image_mode { dyld_image_adding=0, dyld_image_removing=1 }; + +struct dyld_image_info { + const struct mach_header* imageLoadAddress; /* base address image is mapped into */ + const char* imageFilePath; /* path dyld used to load the image */ + uintptr_t imageFileModDate; /* time_t of image file */ + /* if stat().st_mtime of imageFilePath does not match imageFileModDate, */ + /* then file has been modified since dyld loaded it */ +}; + +struct dyld_uuid_info { + const struct mach_header* imageLoadAddress; /* base address image is mapped into */ + uuid_t imageUUID; /* UUID of image */ +}; + +typedef void (*dyld_image_notifier)(enum dyld_image_mode mode, uint32_t infoCount, const struct dyld_image_info info[]); + +/* for use in dyld_all_image_infos.errorKind field */ +enum { dyld_error_kind_none=0, + dyld_error_kind_dylib_missing=1, + dyld_error_kind_dylib_wrong_arch=2, + dyld_error_kind_dylib_version=3, + dyld_error_kind_symbol_missing=4 + }; + + +struct dyld_all_image_infos { + uint32_t version; /* 1 in Mac OS X 10.4 and 10.5 */ + uint32_t infoArrayCount; + const struct dyld_image_info* infoArray; + dyld_image_notifier notification; + bool processDetachedFromSharedRegion; + /* the following fields are only in version 2 (Mac OS X 10.6, iPhoneOS 2.0) and later */ + bool libSystemInitialized; + const struct mach_header* dyldImageLoadAddress; + /* the following field is only in version 3 (Mac OS X 10.6, iPhoneOS 3.0) and later */ + void* jitInfo; + /* the following fields are only in version 5 (Mac OS X 10.6, iPhoneOS 3.0) and later */ + const char* dyldVersion; + const char* errorMessage; + uintptr_t terminationFlags; + /* the following field is only in version 6 (Mac OS X 10.6, iPhoneOS 3.1) and later */ + void* coreSymbolicationShmPage; + /* the following field is only in version 7 (Mac OS X 10.6, iPhoneOS 3.1) and later */ + uintptr_t systemOrderFlag; + /* the following field is only in version 8 (Mac OS X 10.7, iPhoneOS 3.1) and later */ + uintptr_t uuidArrayCount; + const struct dyld_uuid_info* uuidArray; /* only images not in dyld shared cache */ + /* the following field is only in version 9 (Mac OS X 10.7, iOS 4.0) and later */ + struct dyld_all_image_infos* dyldAllImageInfosAddress; + /* the following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later */ + uintptr_t initialImageCount; + /* the following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later */ + uintptr_t errorKind; + const char* errorClientOfDylibPath; + const char* errorTargetDylibPath; + const char* errorSymbol; + /* the following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later */ + uintptr_t sharedCacheSlide; +}; +extern struct dyld_all_image_infos dyld_all_image_infos; + +/* + * Beginning in Mac OS X 10.6, rather than looking up the symbol "_dyld_all_image_infos" + * in dyld's symbol table, you can add DYLD_ALL_IMAGE_INFOS_OFFSET_OFFSET to the mach_header + * for dyld and read the 32-bit unsigned int at that location. Adding that value to dyld's + * mach_header address gets you the address of dyld_all_image_infos in dyld. + */ +#define DYLD_ALL_IMAGE_INFOS_OFFSET_OFFSET 0x1010 + + + +/* + * Beginning in Mac OS X 10.5, this is how gdb discovers where the shared cache is in a process. + * Images that are in the shared cache have their segments rearranged, so when using imageFilePath + * to load the file from disk, you have to know to adjust addresses based on how their segment + * was rearranged. + * + * gdb looks for the symbol "_dyld_shared_region_ranges" in dyld. + * + * It contains information the count of shared regions used by the process. The count is + * the number of start/length pairs. + */ +struct dyld_shared_cache_ranges { + uintptr_t sharedRegionsCount; /* how many ranges follow */ + struct { + uintptr_t start; + uintptr_t length; + } ranges[4]; /* max regions */ +}; +extern struct dyld_shared_cache_ranges dyld_shared_cache_ranges; + + + +#ifdef __cplusplus +} +#endif + +#endif /* _DYLD_IMAGES_ */ diff --git a/i386/include/mach-o/fat.h b/i386/include/mach-o/fat.h new file mode 100644 index 0000000..e2bcf43 --- /dev/null +++ b/i386/include/mach-o/fat.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_FAT_H_ +#define _MACH_O_FAT_H_ +/* + * This header file describes the structures of the file format for "fat" + * architecture specific file (wrapper design). At the begining of the file + * there is one fat_header structure followed by a number of fat_arch + * structures. For each architecture in the file, specified by a pair of + * cputype and cpusubtype, the fat_header describes the file offset, file + * size and alignment in the file of the architecture specific member. + * The padded bytes in the file to place each member on it's specific alignment + * are defined to be read as zeros and can be left as "holes" if the file system + * can support them as long as they read as zeros. + * + * All structures defined here are always written and read to/from disk + * in big-endian order. + */ + +/* + * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types + * and contains the constants for the possible values of these types. + */ +#include <stdint.h> +#include <mach/machine.h> +#include <architecture/byte_order.h> + +#define FAT_MAGIC 0xcafebabe +#define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */ + +struct fat_header { + uint32_t magic; /* FAT_MAGIC */ + uint32_t nfat_arch; /* number of structs that follow */ +}; + +struct fat_arch { + cpu_type_t cputype; /* cpu specifier (int) */ + cpu_subtype_t cpusubtype; /* machine specifier (int) */ + uint32_t offset; /* file offset to this object file */ + uint32_t size; /* size of this object file */ + uint32_t align; /* alignment as a power of 2 */ +}; + +#endif /* _MACH_O_FAT_H_ */ diff --git a/i386/include/mach-o/getsect.h b/i386/include/mach-o/getsect.h new file mode 100644 index 0000000..cee1f9f --- /dev/null +++ b/i386/include/mach-o/getsect.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_GETSECT_H_ +#define _MACH_O_GETSECT_H_ + +#include <stdint.h> +#include <mach-o/loader.h> + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Runtime interfaces for Mach-O programs. For both 32-bit and 64-bit programs, + * where the sizes returned will be 32-bit or 64-bit based on the size of + * 'unsigned long'. + */ +extern char *getsectdata( + const char *segname, + const char *sectname, + unsigned long *size); + +extern char *getsectdatafromFramework( + const char *FrameworkName, + const char *segname, + const char *sectname, + unsigned long *size); + +extern unsigned long get_end(void); +extern unsigned long get_etext(void); +extern unsigned long get_edata(void); + +#ifndef __LP64__ +/* + * Runtime interfaces for 32-bit Mach-O programs. + */ +extern const struct section *getsectbyname( + const char *segname, + const char *sectname); + +extern uint8_t *getsectiondata( + const struct mach_header *mhp, + const char *segname, + const char *sectname, + unsigned long *size); + +extern const struct segment_command *getsegbyname( + const char *segname); + +extern uint8_t *getsegmentdata( + const struct mach_header *mhp, + const char *segname, + unsigned long *size); + +#else /* defined(__LP64__) */ +/* + * Runtime interfaces for 64-bit Mach-O programs. + */ +extern const struct section_64 *getsectbyname( + const char *segname, + const char *sectname); + +extern uint8_t *getsectiondata( + const struct mach_header_64 *mhp, + const char *segname, + const char *sectname, + unsigned long *size); + +extern const struct segment_command_64 *getsegbyname( + const char *segname); + +extern uint8_t *getsegmentdata( + const struct mach_header_64 *mhp, + const char *segname, + unsigned long *size); + +#endif /* defined(__LP64__) */ + +/* + * Interfaces for tools working with 32-bit Mach-O files. + */ +extern char *getsectdatafromheader( + const struct mach_header *mhp, + const char *segname, + const char *sectname, + uint32_t *size); + +extern const struct section *getsectbynamefromheader( + const struct mach_header *mhp, + const char *segname, + const char *sectname); + +/* + * Interfaces for tools working with 64-bit Mach-O files. + */ +extern char *getsectdatafromheader_64( + const struct mach_header_64 *mhp, + const char *segname, + const char *sectname, + uint64_t *size); + +extern const struct section_64 *getsectbynamefromheader_64( + const struct mach_header_64 *mhp, + const char *segname, + const char *sectname); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MACH_O_GETSECT_H_ */ diff --git a/i386/include/mach-o/i386/.svn/all-wcprops b/i386/include/mach-o/i386/.svn/all-wcprops new file mode 100644 index 0000000..e782c6f --- /dev/null +++ b/i386/include/mach-o/i386/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/i386 +END +swap.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/i386/swap.h +END diff --git a/i386/include/mach-o/i386/.svn/entries b/i386/include/mach-o/i386/.svn/entries new file mode 100644 index 0000000..834af5a --- /dev/null +++ b/i386/include/mach-o/i386/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach-o/i386 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +swap.h +file + + + + +2013-08-27T23:54:36.000000Z +103a4cdbb88e9fc97d34f38878dde135 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3085 + diff --git a/i386/include/mach-o/i386/.svn/text-base/swap.h.svn-base b/i386/include/mach-o/i386/.svn/text-base/swap.h.svn-base new file mode 100644 index 0000000..09e322f --- /dev/null +++ b/i386/include/mach-o/i386/.svn/text-base/swap.h.svn-base @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <architecture/byte_order.h> +#include <mach/i386/thread_status.h> + +extern void swap_i386_thread_state( + i386_thread_state_t *cpu, + enum NXByteOrder target_byte_order); + +/* current i386 thread states */ +#if i386_THREAD_STATE == 1 +extern void swap_i386_float_state( + struct i386_float_state *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_i386_exception_state( + i386_exception_state_t *exc, + enum NXByteOrder target_byte_order); +#endif /* i386_THREAD_STATE == 1 */ + +/* i386 thread states on older releases */ +#if i386_THREAD_STATE == -1 +extern void swap_i386_thread_fpstate( + i386_thread_fpstate_t *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_i386_thread_exceptstate( + i386_thread_exceptstate_t *exc, + enum NXByteOrder target_byte_order); + +extern void swap_i386_thread_cthreadstate( + i386_thread_cthreadstate_t *user, + enum NXByteOrder target_byte_order); +#endif /* i386_THREAD_STATE == -1 */ + +#ifdef x86_THREAD_STATE64 +extern void swap_x86_thread_state64( + x86_thread_state64_t *cpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_state_hdr( + x86_state_hdr_t *hdr, + enum NXByteOrder target_byte_order); + +extern void swap_x86_float_state64( + x86_float_state64_t *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_exception_state64( + x86_exception_state64_t *exc, + enum NXByteOrder target_byte_order); + +extern void swap_x86_thread_state( + x86_thread_state_t *cpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_float_state( + x86_float_state_t *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_exception_state( + x86_exception_state_t *exc, + enum NXByteOrder target_byte_order); + +extern void swap_x86_debug_state32( + x86_debug_state32_t *debug, + enum NXByteOrder target_byte_order); + +extern void swap_x86_debug_state64( + x86_debug_state64_t *debug, + enum NXByteOrder target_byte_order); + +extern void swap_x86_debug_state( + x86_debug_state_t *debug, + enum NXByteOrder target_byte_order); +#endif /* x86_THREAD_STATE64 */ diff --git a/i386/include/mach-o/i386/swap.h b/i386/include/mach-o/i386/swap.h new file mode 100644 index 0000000..09e322f --- /dev/null +++ b/i386/include/mach-o/i386/swap.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <architecture/byte_order.h> +#include <mach/i386/thread_status.h> + +extern void swap_i386_thread_state( + i386_thread_state_t *cpu, + enum NXByteOrder target_byte_order); + +/* current i386 thread states */ +#if i386_THREAD_STATE == 1 +extern void swap_i386_float_state( + struct i386_float_state *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_i386_exception_state( + i386_exception_state_t *exc, + enum NXByteOrder target_byte_order); +#endif /* i386_THREAD_STATE == 1 */ + +/* i386 thread states on older releases */ +#if i386_THREAD_STATE == -1 +extern void swap_i386_thread_fpstate( + i386_thread_fpstate_t *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_i386_thread_exceptstate( + i386_thread_exceptstate_t *exc, + enum NXByteOrder target_byte_order); + +extern void swap_i386_thread_cthreadstate( + i386_thread_cthreadstate_t *user, + enum NXByteOrder target_byte_order); +#endif /* i386_THREAD_STATE == -1 */ + +#ifdef x86_THREAD_STATE64 +extern void swap_x86_thread_state64( + x86_thread_state64_t *cpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_state_hdr( + x86_state_hdr_t *hdr, + enum NXByteOrder target_byte_order); + +extern void swap_x86_float_state64( + x86_float_state64_t *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_exception_state64( + x86_exception_state64_t *exc, + enum NXByteOrder target_byte_order); + +extern void swap_x86_thread_state( + x86_thread_state_t *cpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_float_state( + x86_float_state_t *fpu, + enum NXByteOrder target_byte_order); + +extern void swap_x86_exception_state( + x86_exception_state_t *exc, + enum NXByteOrder target_byte_order); + +extern void swap_x86_debug_state32( + x86_debug_state32_t *debug, + enum NXByteOrder target_byte_order); + +extern void swap_x86_debug_state64( + x86_debug_state64_t *debug, + enum NXByteOrder target_byte_order); + +extern void swap_x86_debug_state( + x86_debug_state_t *debug, + enum NXByteOrder target_byte_order); +#endif /* x86_THREAD_STATE64 */ diff --git a/i386/include/mach-o/ldsyms.h b/i386/include/mach-o/ldsyms.h new file mode 100644 index 0000000..3f28b1b --- /dev/null +++ b/i386/include/mach-o/ldsyms.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _MACHO_LDSYMS_H_ +#define _MACHO_LDSYMS_H_ + +#include <mach-o/loader.h> + +/* + * This file describes the link editor defined symbols. The semantics of a + * link editor symbol is that it is defined by the link editor only if it is + * referenced and it is an error for the user to define them (see the man page + * ld(1)). The standard UNIX link editor symbols: __end, __etext and __edata + * are not not supported by the Apple Mach-O link editor. These symbols are + * really not meaningful in a Mach-O object file and the link editor symbols + * that are supported (described here) replace them. In the case of the + * standard UNIX link editor symbols the program can use the symbol + * __mh_execute_header and walk the load commands of it's program to determine + * the ending (or beginning) of any section or segment in the program. Note + * that the compiler prepends an underbar to all external symbol names coded + * in a high level language. Thus in 'C' names are coded without an underbar + * and symbol names in the symbol table have an underbar. There are two cpp + * macros for each link editor defined name in this file. The macro with a + * leading underbar is the symbol name and the one without is the name as + * coded in 'C'. + */ + +/* + * The value of the link editor defined symbol _MH_EXECUTE_SYM is the address + * of the mach header in a Mach-O executable file type. It does not appear in + * any file type other than a MH_EXECUTE file type. The type of the symbol is + * absolute as the header is not part of any section. + */ +#define _MH_EXECUTE_SYM "__mh_execute_header" +#define MH_EXECUTE_SYM "_mh_execute_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_execute_header; + +/* + * The value of the link editor defined symbol _MH_BUNDLE_SYM is the address + * of the mach header in a Mach-O bundle file type. It does not appear in + * any file type other than a MH_BUNDLE file type. The type of the symbol is + * an N_SECT symbol even thought the header is not part of any section. This + * symbol is private to the code in the bundle it is a part of. + */ +#define _MH_BUNDLE_SYM "__mh_bundle_header" +#define MH_BUNDLE_SYM "_mh_bundle_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_bundle_header; + +/* + * The value of the link editor defined symbol _MH_DYLIB_SYM is the address + * of the mach header in a Mach-O dylib file type. It does not appear in + * any file type other than a MH_DYLIB file type. The type of the symbol is + * an N_SECT symbol even thought the header is not part of any section. This + * symbol is private to the code in the library it is a part of. + */ +#define _MH_DYLIB_SYM "__mh_dylib_header" +#define MH_DYLIB_SYM "_mh_dylib_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_dylib_header; + +/* + * The value of the link editor defined symbol _MH_DYLINKER_SYM is the address + * of the mach header in a Mach-O dylinker file type. It does not appear in + * any file type other than a MH_DYLINKER file type. The type of the symbol is + * an N_SECT symbol even thought the header is not part of any section. This + * symbol is private to the code in the dynamic linker it is a part of. + */ +#define _MH_DYLINKER_SYM "__mh_dylinker_header" +#define MH_DYLINKER_SYM "_mh_dylinker_header" +extern const struct +#ifdef __LP64__ +mach_header_64 +#else +mach_header +#endif +_mh_dylinker_header; + +/* + * For the MH_PRELOAD file type the headers are not loaded as part of any + * segment so the link editor defines symbols defined for the beginning + * and ending of each segment and each section in each segment. The names for + * the symbols for a segment's beginning and end will have the form: + * __SEGNAME__begin and __SEGNAME__end where __SEGNAME is the name of the + * segment. The names for the symbols for a section's beginning and end will + * have the form: __SEGNAME__sectname__begin and __SEGNAME__sectname__end + * where __sectname is the name of the section and __SEGNAME is the segment it + * is in. + * + * The above symbols' types are those of the section they are referring to. + * This is true even for symbols who's values are end's of a section and + * that value is next address after that section and not really in that + * section. This results in these symbols having types referring to sections + * who's values are not in that section. + */ + +#endif /* _MACHO_LDSYMS_H_ */ diff --git a/i386/include/mach-o/loader.h b/i386/include/mach-o/loader.h new file mode 100644 index 0000000..ff18e29 --- /dev/null +++ b/i386/include/mach-o/loader.h @@ -0,0 +1,1402 @@ +/* + * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACHO_LOADER_H_ +#define _MACHO_LOADER_H_ + +/* + * This file describes the format of mach object files. + */ +#include <stdint.h> + +/* + * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types + * and contains the constants for the possible values of these types. + */ +#include <mach/machine.h> + +/* + * <mach/vm_prot.h> is needed here for the vm_prot_t type and contains the + * constants that are or'ed together for the possible values of this type. + */ +#include <mach/vm_prot.h> + +/* + * <machine/thread_status.h> is expected to define the flavors of the thread + * states and the structures of those flavors for each machine. + */ +#include <mach/machine/thread_status.h> +#include <architecture/byte_order.h> + +/* + * The 32-bit mach header appears at the very beginning of the object file for + * 32-bit architectures. + */ +struct mach_header { + uint32_t magic; /* mach magic number identifier */ + cpu_type_t cputype; /* cpu specifier */ + cpu_subtype_t cpusubtype; /* machine specifier */ + uint32_t filetype; /* type of file */ + uint32_t ncmds; /* number of load commands */ + uint32_t sizeofcmds; /* the size of all the load commands */ + uint32_t flags; /* flags */ +}; + +/* Constant for the magic field of the mach_header (32-bit architectures) */ +#define MH_MAGIC 0xfeedface /* the mach magic number */ +#define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */ + +/* + * The 64-bit mach header appears at the very beginning of object files for + * 64-bit architectures. + */ +struct mach_header_64 { + uint32_t magic; /* mach magic number identifier */ + cpu_type_t cputype; /* cpu specifier */ + cpu_subtype_t cpusubtype; /* machine specifier */ + uint32_t filetype; /* type of file */ + uint32_t ncmds; /* number of load commands */ + uint32_t sizeofcmds; /* the size of all the load commands */ + uint32_t flags; /* flags */ + uint32_t reserved; /* reserved */ +}; + +/* Constant for the magic field of the mach_header_64 (64-bit architectures) */ +#define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */ +#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */ + +/* + * The layout of the file depends on the filetype. For all but the MH_OBJECT + * file type the segments are padded out and aligned on a segment alignment + * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB, + * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part + * of their first segment. + * + * The file type MH_OBJECT is a compact format intended as output of the + * assembler and input (and possibly output) of the link editor (the .o + * format). All sections are in one unnamed segment with no segment padding. + * This format is used as an executable format when the file is so small the + * segment padding greatly increases its size. + * + * The file type MH_PRELOAD is an executable format intended for things that + * are not executed under the kernel (proms, stand alones, kernels, etc). The + * format can be executed under the kernel but may demand paged it and not + * preload it before execution. + * + * A core file is in MH_CORE format and can be any in an arbritray legal + * Mach-O file. + * + * Constants for the filetype field of the mach_header + */ +#define MH_OBJECT 0x1 /* relocatable object file */ +#define MH_EXECUTE 0x2 /* demand paged executable file */ +#define MH_FVMLIB 0x3 /* fixed VM shared library file */ +#define MH_CORE 0x4 /* core file */ +#define MH_PRELOAD 0x5 /* preloaded executable file */ +#define MH_DYLIB 0x6 /* dynamically bound shared library */ +#define MH_DYLINKER 0x7 /* dynamic link editor */ +#define MH_BUNDLE 0x8 /* dynamically bound bundle file */ +#define MH_DYLIB_STUB 0x9 /* shared library stub for static */ + /* linking only, no section contents */ +#define MH_DSYM 0xa /* companion file with only debug */ + /* sections */ +#define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */ + +/* Constants for the flags field of the mach_header */ +#define MH_NOUNDEFS 0x1 /* the object file has no undefined + references */ +#define MH_INCRLINK 0x2 /* the object file is the output of an + incremental link against a base file + and can't be link edited again */ +#define MH_DYLDLINK 0x4 /* the object file is input for the + dynamic linker and can't be staticly + link edited again */ +#define MH_BINDATLOAD 0x8 /* the object file's undefined + references are bound by the dynamic + linker when loaded. */ +#define MH_PREBOUND 0x10 /* the file has its dynamic undefined + references prebound. */ +#define MH_SPLIT_SEGS 0x20 /* the file has its read-only and + read-write segments split */ +#define MH_LAZY_INIT 0x40 /* the shared library init routine is + to be run lazily via catching memory + faults to its writeable segments + (obsolete) */ +#define MH_TWOLEVEL 0x80 /* the image is using two-level name + space bindings */ +#define MH_FORCE_FLAT 0x100 /* the executable is forcing all images + to use flat name space bindings */ +#define MH_NOMULTIDEFS 0x200 /* this umbrella guarantees no multiple + defintions of symbols in its + sub-images so the two-level namespace + hints can always be used. */ +#define MH_NOFIXPREBINDING 0x400 /* do not have dyld notify the + prebinding agent about this + executable */ +#define MH_PREBINDABLE 0x800 /* the binary is not prebound but can + have its prebinding redone. only used + when MH_PREBOUND is not set. */ +#define MH_ALLMODSBOUND 0x1000 /* indicates that this binary binds to + all two-level namespace modules of + its dependent libraries. only used + when MH_PREBINDABLE and MH_TWOLEVEL + are both set. */ +#define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into + sub-sections via symbols for dead + code stripping */ +#define MH_CANONICAL 0x4000 /* the binary has been canonicalized + via the unprebind operation */ +#define MH_WEAK_DEFINES 0x8000 /* the final linked image contains + external weak symbols */ +#define MH_BINDS_TO_WEAK 0x10000 /* the final linked image uses + weak symbols */ + +#define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks + in the task will be given stack + execution privilege. Only used in + MH_EXECUTE filetypes. */ +#define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary + declares it is safe for use in + processes with uid zero */ + +#define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary + declares it is safe for use in + processes when issetugid() is true */ + +#define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib, + the static linker does not need to + examine dependent dylibs to see + if any are re-exported */ +#define MH_PIE 0x200000 /* When this bit is set, the OS will + load the main executable at a + random address. Only used in + MH_EXECUTE filetypes. */ +#define MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When + linking against a dylib that + has this bit set, the static linker + will automatically not create a + LC_LOAD_DYLIB load command to the + dylib if no symbols are being + referenced from the dylib. */ +#define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type + S_THREAD_LOCAL_VARIABLES */ + +#define MH_NO_HEAP_EXECUTION 0x1000000 /* When this bit is set, the OS will + run the main executable with + a non-executable heap even on + platforms (e.g. i386) that don't + require it. Only used in MH_EXECUTE + filetypes. */ + +/* + * The load commands directly follow the mach_header. The total size of all + * of the commands is given by the sizeofcmds field in the mach_header. All + * load commands must have as their first two fields cmd and cmdsize. The cmd + * field is filled in with a constant for that command type. Each command type + * has a structure specifically for it. The cmdsize field is the size in bytes + * of the particular load command structure plus anything that follows it that + * is a part of the load command (i.e. section structures, strings, etc.). To + * advance to the next load command the cmdsize can be added to the offset or + * pointer of the current load command. The cmdsize for 32-bit architectures + * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple + * of 8 bytes (these are forever the maximum alignment of any load commands). + * The padded bytes must be zero. All tables in the object file must also + * follow these rules so the file can be memory mapped. Otherwise the pointers + * to these tables will not work well or at all on some machines. With all + * padding zeroed like objects will compare byte for byte. + */ +struct load_command { + uint32_t cmd; /* type of load command */ + uint32_t cmdsize; /* total size of command in bytes */ +}; + +/* + * After MacOS X 10.1 when a new load command is added that is required to be + * understood by the dynamic linker for the image to execute properly the + * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic + * linker sees such a load command it it does not understand will issue a + * "unknown load command required for execution" error and refuse to use the + * image. Other load commands without this bit that are not understood will + * simply be ignored. + */ +#define LC_REQ_DYLD 0x80000000 + +/* Constants for the cmd field of all load commands, the type */ +#define LC_SEGMENT 0x1 /* segment of this file to be mapped */ +#define LC_SYMTAB 0x2 /* link-edit stab symbol table info */ +#define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */ +#define LC_THREAD 0x4 /* thread */ +#define LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */ +#define LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */ +#define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */ +#define LC_IDENT 0x8 /* object identification info (obsolete) */ +#define LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */ +#define LC_PREPAGE 0xa /* prepage command (internal use) */ +#define LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */ +#define LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */ +#define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */ +#define LC_LOAD_DYLINKER 0xe /* load a dynamic linker */ +#define LC_ID_DYLINKER 0xf /* dynamic linker identification */ +#define LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */ + /* linked shared library */ +#define LC_ROUTINES 0x11 /* image routines */ +#define LC_SUB_FRAMEWORK 0x12 /* sub framework */ +#define LC_SUB_UMBRELLA 0x13 /* sub umbrella */ +#define LC_SUB_CLIENT 0x14 /* sub client */ +#define LC_SUB_LIBRARY 0x15 /* sub library */ +#define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */ +#define LC_PREBIND_CKSUM 0x17 /* prebind checksum */ + +/* + * load a dynamically linked shared library that is allowed to be missing + * (all symbols are weak imported). + */ +#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) + +#define LC_SEGMENT_64 0x19 /* 64-bit segment of this file to be + mapped */ +#define LC_ROUTINES_64 0x1a /* 64-bit image routines */ +#define LC_UUID 0x1b /* the uuid */ +#define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */ +#define LC_CODE_SIGNATURE 0x1d /* local of code signature */ +#define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */ +#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */ +#define LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */ +#define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */ +#define LC_DYLD_INFO 0x22 /* compressed dyld information */ +#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */ +#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */ +#define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */ +#define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */ +#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */ +#define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat + like environment variable */ + +/* + * A variable length string in a load command is represented by an lc_str + * union. The strings are stored just after the load command structure and + * the offset is from the start of the load command structure. The size + * of the string is reflected in the cmdsize field of the load command. + * Once again any padded bytes to bring the cmdsize field to a multiple + * of 4 bytes must be zero. + */ +union lc_str { + uint32_t offset; /* offset to the string */ +#ifndef __LP64__ + char *ptr; /* pointer to the string */ +#endif +}; + +/* + * The segment load command indicates that a part of this file is to be + * mapped into the task's address space. The size of this segment in memory, + * vmsize, maybe equal to or larger than the amount to map from this file, + * filesize. The file is mapped starting at fileoff to the beginning of + * the segment in memory, vmaddr. The rest of the memory of the segment, + * if any, is allocated zero fill on demand. The segment's maximum virtual + * memory protection and initial virtual memory protection are specified + * by the maxprot and initprot fields. If the segment has sections then the + * section structures directly follow the segment command and their size is + * reflected in cmdsize. + */ +struct segment_command { /* for 32-bit architectures */ + uint32_t cmd; /* LC_SEGMENT */ + uint32_t cmdsize; /* includes sizeof section structs */ + char segname[16]; /* segment name */ + uint32_t vmaddr; /* memory address of this segment */ + uint32_t vmsize; /* memory size of this segment */ + uint32_t fileoff; /* file offset of this segment */ + uint32_t filesize; /* amount to map from the file */ + vm_prot_t maxprot; /* maximum VM protection */ + vm_prot_t initprot; /* initial VM protection */ + uint32_t nsects; /* number of sections in segment */ + uint32_t flags; /* flags */ +}; + +/* + * The 64-bit segment load command indicates that a part of this file is to be + * mapped into a 64-bit task's address space. If the 64-bit segment has + * sections then section_64 structures directly follow the 64-bit segment + * command and their size is reflected in cmdsize. + */ +struct segment_command_64 { /* for 64-bit architectures */ + uint32_t cmd; /* LC_SEGMENT_64 */ + uint32_t cmdsize; /* includes sizeof section_64 structs */ + char segname[16]; /* segment name */ + uint64_t vmaddr; /* memory address of this segment */ + uint64_t vmsize; /* memory size of this segment */ + uint64_t fileoff; /* file offset of this segment */ + uint64_t filesize; /* amount to map from the file */ + vm_prot_t maxprot; /* maximum VM protection */ + vm_prot_t initprot; /* initial VM protection */ + uint32_t nsects; /* number of sections in segment */ + uint32_t flags; /* flags */ +}; + +/* Constants for the flags field of the segment_command */ +#define SG_HIGHVM 0x1 /* the file contents for this segment is for + the high part of the VM space, the low part + is zero filled (for stacks in core files) */ +#define SG_FVMLIB 0x2 /* this segment is the VM that is allocated by + a fixed VM library, for overlap checking in + the link editor */ +#define SG_NORELOC 0x4 /* this segment has nothing that was relocated + in it and nothing relocated to it, that is + it maybe safely replaced without relocation*/ +#define SG_PROTECTED_VERSION_1 0x8 /* This segment is protected. If the + segment starts at file offset 0, the + first page of the segment is not + protected. All other pages of the + segment are protected. */ + +/* + * A segment is made up of zero or more sections. Non-MH_OBJECT files have + * all of their segments with the proper sections in each, and padded to the + * specified segment alignment when produced by the link editor. The first + * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header + * and load commands of the object file before its first section. The zero + * fill sections are always last in their segment (in all formats). This + * allows the zeroed segment padding to be mapped into memory where zero fill + * sections might be. The gigabyte zero fill sections, those with the section + * type S_GB_ZEROFILL, can only be in a segment with sections of this type. + * These segments are then placed after all other segments. + * + * The MH_OBJECT format has all of its sections in one segment for + * compactness. There is no padding to a specified segment boundary and the + * mach_header and load commands are not part of the segment. + * + * Sections with the same section name, sectname, going into the same segment, + * segname, are combined by the link editor. The resulting section is aligned + * to the maximum alignment of the combined sections and is the new section's + * alignment. The combined sections are aligned to their original alignment in + * the combined section. Any padded bytes to get the specified alignment are + * zeroed. + * + * The format of the relocation entries referenced by the reloff and nreloc + * fields of the section structure for mach object files is described in the + * header file <reloc.h>. + */ +struct section { /* for 32-bit architectures */ + char sectname[16]; /* name of this section */ + char segname[16]; /* segment this section goes in */ + uint32_t addr; /* memory address of this section */ + uint32_t size; /* size in bytes of this section */ + uint32_t offset; /* file offset of this section */ + uint32_t align; /* section alignment (power of 2) */ + uint32_t reloff; /* file offset of relocation entries */ + uint32_t nreloc; /* number of relocation entries */ + uint32_t flags; /* flags (section type and attributes)*/ + uint32_t reserved1; /* reserved (for offset or index) */ + uint32_t reserved2; /* reserved (for count or sizeof) */ +}; + +struct section_64 { /* for 64-bit architectures */ + char sectname[16]; /* name of this section */ + char segname[16]; /* segment this section goes in */ + uint64_t addr; /* memory address of this section */ + uint64_t size; /* size in bytes of this section */ + uint32_t offset; /* file offset of this section */ + uint32_t align; /* section alignment (power of 2) */ + uint32_t reloff; /* file offset of relocation entries */ + uint32_t nreloc; /* number of relocation entries */ + uint32_t flags; /* flags (section type and attributes)*/ + uint32_t reserved1; /* reserved (for offset or index) */ + uint32_t reserved2; /* reserved (for count or sizeof) */ + uint32_t reserved3; /* reserved */ +}; + +/* + * The flags field of a section structure is separated into two parts a section + * type and section attributes. The section types are mutually exclusive (it + * can only have one type) but the section attributes are not (it may have more + * than one attribute). + */ +#define SECTION_TYPE 0x000000ff /* 256 section types */ +#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */ + +/* Constants for the type of a section */ +#define S_REGULAR 0x0 /* regular section */ +#define S_ZEROFILL 0x1 /* zero fill on demand section */ +#define S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/ +#define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */ +#define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */ +#define S_LITERAL_POINTERS 0x5 /* section with only pointers to */ + /* literals */ +/* + * For the two types of symbol pointers sections and the symbol stubs section + * they have indirect symbol table entries. For each of the entries in the + * section the indirect symbol table entries, in corresponding order in the + * indirect symbol table, start at the index stored in the reserved1 field + * of the section structure. Since the indirect symbol table entries + * correspond to the entries in the section the number of indirect symbol table + * entries is inferred from the size of the section divided by the size of the + * entries in the section. For symbol pointers sections the size of the entries + * in the section is 4 bytes and for symbol stubs sections the byte size of the + * stubs is stored in the reserved2 field of the section structure. + */ +#define S_NON_LAZY_SYMBOL_POINTERS 0x6 /* section with only non-lazy + symbol pointers */ +#define S_LAZY_SYMBOL_POINTERS 0x7 /* section with only lazy symbol + pointers */ +#define S_SYMBOL_STUBS 0x8 /* section with only symbol + stubs, byte size of stub in + the reserved2 field */ +#define S_MOD_INIT_FUNC_POINTERS 0x9 /* section with only function + pointers for initialization*/ +#define S_MOD_TERM_FUNC_POINTERS 0xa /* section with only function + pointers for termination */ +#define S_COALESCED 0xb /* section contains symbols that + are to be coalesced */ +#define S_GB_ZEROFILL 0xc /* zero fill on demand section + (that can be larger than 4 + gigabytes) */ +#define S_INTERPOSING 0xd /* section with only pairs of + function pointers for + interposing */ +#define S_16BYTE_LITERALS 0xe /* section with only 16 byte + literals */ +#define S_DTRACE_DOF 0xf /* section contains + DTrace Object Format */ +#define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 /* section with only lazy + symbol pointers to lazy + loaded dylibs */ +/* + * Section types to support thread local variables + */ +#define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial + values for TLVs */ +#define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial + values for TLVs */ +#define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */ +#define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV + descriptors */ +#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call + to initialize TLV + values */ + +/* + * Constants for the section attributes part of the flags field of a section + * structure. + */ +#define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */ +#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* section contains only true + machine instructions */ +#define S_ATTR_NO_TOC 0x40000000 /* section contains coalesced + symbols that are not to be + in a ranlib table of + contents */ +#define S_ATTR_STRIP_STATIC_SYMS 0x20000000 /* ok to strip static symbols + in this section in files + with the MH_DYLDLINK flag */ +#define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */ +#define S_ATTR_LIVE_SUPPORT 0x08000000 /* blocks are live if they + reference live blocks */ +#define S_ATTR_SELF_MODIFYING_CODE 0x04000000 /* Used with i386 code stubs + written on by dyld */ +/* + * If a segment contains any sections marked with S_ATTR_DEBUG then all + * sections in that segment must have this attribute. No section other than + * a section marked with this attribute may reference the contents of this + * section. A section with this attribute may contain no symbols and must have + * a section type S_REGULAR. The static linker will not copy section contents + * from sections with this attribute into its output file. These sections + * generally contain DWARF debugging info. + */ +#define S_ATTR_DEBUG 0x02000000 /* a debug section */ +#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */ +#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* section contains some + machine instructions */ +#define S_ATTR_EXT_RELOC 0x00000200 /* section has external + relocation entries */ +#define S_ATTR_LOC_RELOC 0x00000100 /* section has local + relocation entries */ + + +/* + * The names of segments and sections in them are mostly meaningless to the + * link-editor. But there are few things to support traditional UNIX + * executables that require the link-editor and assembler to use some names + * agreed upon by convention. + * + * The initial protection of the "__TEXT" segment has write protection turned + * off (not writeable). + * + * The link-editor will allocate common symbols at the end of the "__common" + * section in the "__DATA" segment. It will create the section and segment + * if needed. + */ + +/* The currently known segment names and the section names in those segments */ + +#define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */ + /* protections and catches NULL */ + /* references for MH_EXECUTE files */ + + +#define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */ +#define SECT_TEXT "__text" /* the real text part of the text */ + /* section no headers, and no padding */ +#define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */ + /* section */ +#define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */ + /* fvmlib initialization */ + /* section */ + +#define SEG_DATA "__DATA" /* the tradition UNIX data segment */ +#define SECT_DATA "__data" /* the real initialized data section */ + /* no padding, no bss overlap */ +#define SECT_BSS "__bss" /* the real uninitialized data section*/ + /* no padding */ +#define SECT_COMMON "__common" /* the section common symbols are */ + /* allocated in by the link editor */ + +#define SEG_OBJC "__OBJC" /* objective-C runtime segment */ +#define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */ +#define SECT_OBJC_MODULES "__module_info" /* module information */ +#define SECT_OBJC_STRINGS "__selector_strs" /* string table */ +#define SECT_OBJC_REFS "__selector_refs" /* string table */ + +#define SEG_ICON "__ICON" /* the icon segment */ +#define SECT_ICON_HEADER "__header" /* the icon headers */ +#define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */ + +#define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */ + /* created and maintained by the link */ + /* editor. Created with -seglinkedit */ + /* option to ld(1) for MH_EXECUTE and */ + /* FVMLIB file types only */ + +#define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */ + +#define SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */ + /* modifing code stubs that has read, */ + /* write and execute permissions */ + +/* + * Fixed virtual memory shared libraries are identified by two things. The + * target pathname (the name of the library as found for execution), and the + * minor version number. The address of where the headers are loaded is in + * header_addr. (THIS IS OBSOLETE and no longer supported). + */ +struct fvmlib { + union lc_str name; /* library's target pathname */ + uint32_t minor_version; /* library's minor version number */ + uint32_t header_addr; /* library's header address */ +}; + +/* + * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header) + * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library. + * An object that uses a fixed virtual shared library also contains a + * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses. + * (THIS IS OBSOLETE and no longer supported). + */ +struct fvmlib_command { + uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */ + uint32_t cmdsize; /* includes pathname string */ + struct fvmlib fvmlib; /* the library identification */ +}; + +/* + * Dynamicly linked shared libraries are identified by two things. The + * pathname (the name of the library as found for execution), and the + * compatibility version number. The pathname must match and the compatibility + * number in the user of the library must be greater than or equal to the + * library being used. The time stamp is used to record the time a library was + * built and copied into user so it can be use to determined if the library used + * at runtime is exactly the same as used to built the program. + */ +struct dylib { + union lc_str name; /* library's path name */ + uint32_t timestamp; /* library's build time stamp */ + uint32_t current_version; /* library's current version number */ + uint32_t compatibility_version; /* library's compatibility vers number*/ +}; + +/* + * A dynamically linked shared library (filetype == MH_DYLIB in the mach header) + * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library. + * An object that uses a dynamically linked shared library also contains a + * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or + * LC_REEXPORT_DYLIB) for each library it uses. + */ +struct dylib_command { + uint32_t cmd; /* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB, + LC_REEXPORT_DYLIB */ + uint32_t cmdsize; /* includes pathname string */ + struct dylib dylib; /* the library identification */ +}; + +/* + * A dynamically linked shared library may be a subframework of an umbrella + * framework. If so it will be linked with "-umbrella umbrella_name" where + * Where "umbrella_name" is the name of the umbrella framework. A subframework + * can only be linked against by its umbrella framework or other subframeworks + * that are part of the same umbrella framework. Otherwise the static link + * editor produces an error and states to link against the umbrella framework. + * The name of the umbrella framework for subframeworks is recorded in the + * following structure. + */ +struct sub_framework_command { + uint32_t cmd; /* LC_SUB_FRAMEWORK */ + uint32_t cmdsize; /* includes umbrella string */ + union lc_str umbrella; /* the umbrella framework name */ +}; + +/* + * For dynamically linked shared libraries that are subframework of an umbrella + * framework they can allow clients other than the umbrella framework or other + * subframeworks in the same umbrella framework. To do this the subframework + * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load + * command is created for each -allowable_client flag. The client_name is + * usually a framework name. It can also be a name used for bundles clients + * where the bundle is built with "-client_name client_name". + */ +struct sub_client_command { + uint32_t cmd; /* LC_SUB_CLIENT */ + uint32_t cmdsize; /* includes client string */ + union lc_str client; /* the client name */ +}; + +/* + * A dynamically linked shared library may be a sub_umbrella of an umbrella + * framework. If so it will be linked with "-sub_umbrella umbrella_name" where + * Where "umbrella_name" is the name of the sub_umbrella framework. When + * staticly linking when -twolevel_namespace is in effect a twolevel namespace + * umbrella framework will only cause its subframeworks and those frameworks + * listed as sub_umbrella frameworks to be implicited linked in. Any other + * dependent dynamic libraries will not be linked it when -twolevel_namespace + * is in effect. The primary library recorded by the static linker when + * resolving a symbol in these libraries will be the umbrella framework. + * Zero or more sub_umbrella frameworks may be use by an umbrella framework. + * The name of a sub_umbrella framework is recorded in the following structure. + */ +struct sub_umbrella_command { + uint32_t cmd; /* LC_SUB_UMBRELLA */ + uint32_t cmdsize; /* includes sub_umbrella string */ + union lc_str sub_umbrella; /* the sub_umbrella framework name */ +}; + +/* + * A dynamically linked shared library may be a sub_library of another shared + * library. If so it will be linked with "-sub_library library_name" where + * Where "library_name" is the name of the sub_library shared library. When + * staticly linking when -twolevel_namespace is in effect a twolevel namespace + * shared library will only cause its subframeworks and those frameworks + * listed as sub_umbrella frameworks and libraries listed as sub_libraries to + * be implicited linked in. Any other dependent dynamic libraries will not be + * linked it when -twolevel_namespace is in effect. The primary library + * recorded by the static linker when resolving a symbol in these libraries + * will be the umbrella framework (or dynamic library). Zero or more sub_library + * shared libraries may be use by an umbrella framework or (or dynamic library). + * The name of a sub_library framework is recorded in the following structure. + * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc". + */ +struct sub_library_command { + uint32_t cmd; /* LC_SUB_LIBRARY */ + uint32_t cmdsize; /* includes sub_library string */ + union lc_str sub_library; /* the sub_library name */ +}; + +/* + * A program (filetype == MH_EXECUTE) that is + * prebound to its dynamic libraries has one of these for each library that + * the static linker used in prebinding. It contains a bit vector for the + * modules in the library. The bits indicate which modules are bound (1) and + * which are not (0) from the library. The bit for module 0 is the low bit + * of the first byte. So the bit for the Nth module is: + * (linked_modules[N/8] >> N%8) & 1 + */ +struct prebound_dylib_command { + uint32_t cmd; /* LC_PREBOUND_DYLIB */ + uint32_t cmdsize; /* includes strings */ + union lc_str name; /* library's path name */ + uint32_t nmodules; /* number of modules in library */ + union lc_str linked_modules; /* bit vector of linked modules */ +}; + +/* + * A program that uses a dynamic linker contains a dylinker_command to identify + * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker + * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER). + * A file can have at most one of these. + * This struct is also used for the LC_DYLD_ENVIRONMENT load command and + * contains string for dyld to treat like environment variable. + */ +struct dylinker_command { + uint32_t cmd; /* LC_ID_DYLINKER, LC_LOAD_DYLINKER or + LC_DYLD_ENVIRONMENT */ + uint32_t cmdsize; /* includes pathname string */ + union lc_str name; /* dynamic linker's path name */ +}; + +/* + * Thread commands contain machine-specific data structures suitable for + * use in the thread state primitives. The machine specific data structures + * follow the struct thread_command as follows. + * Each flavor of machine specific data structure is preceded by an unsigned + * long constant for the flavor of that data structure, an uint32_t + * that is the count of longs of the size of the state data structure and then + * the state data structure follows. This triple may be repeated for many + * flavors. The constants for the flavors, counts and state data structure + * definitions are expected to be in the header file <machine/thread_status.h>. + * These machine specific data structures sizes must be multiples of + * 4 bytes The cmdsize reflects the total size of the thread_command + * and all of the sizes of the constants for the flavors, counts and state + * data structures. + * + * For executable objects that are unix processes there will be one + * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor. + * This is the same as a LC_THREAD, except that a stack is automatically + * created (based on the shell's limit for the stack size). Command arguments + * and environment variables are copied onto that stack. + */ +struct thread_command { + uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */ + uint32_t cmdsize; /* total size of this command */ + /* uint32_t flavor flavor of thread state */ + /* uint32_t count count of longs in thread state */ + /* struct XXX_thread_state state thread state for this flavor */ + /* ... */ +}; + +/* + * The routines command contains the address of the dynamic shared library + * initialization routine and an index into the module table for the module + * that defines the routine. Before any modules are used from the library the + * dynamic linker fully binds the module that defines the initialization routine + * and then calls it. This gets called before any module initialization + * routines (used for C++ static constructors) in the library. + */ +struct routines_command { /* for 32-bit architectures */ + uint32_t cmd; /* LC_ROUTINES */ + uint32_t cmdsize; /* total size of this command */ + uint32_t init_address; /* address of initialization routine */ + uint32_t init_module; /* index into the module table that */ + /* the init routine is defined in */ + uint32_t reserved1; + uint32_t reserved2; + uint32_t reserved3; + uint32_t reserved4; + uint32_t reserved5; + uint32_t reserved6; +}; + +/* + * The 64-bit routines command. Same use as above. + */ +struct routines_command_64 { /* for 64-bit architectures */ + uint32_t cmd; /* LC_ROUTINES_64 */ + uint32_t cmdsize; /* total size of this command */ + uint64_t init_address; /* address of initialization routine */ + uint64_t init_module; /* index into the module table that */ + /* the init routine is defined in */ + uint64_t reserved1; + uint64_t reserved2; + uint64_t reserved3; + uint64_t reserved4; + uint64_t reserved5; + uint64_t reserved6; +}; + +/* + * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD + * "stab" style symbol table information as described in the header files + * <nlist.h> and <stab.h>. + */ +struct symtab_command { + uint32_t cmd; /* LC_SYMTAB */ + uint32_t cmdsize; /* sizeof(struct symtab_command) */ + uint32_t symoff; /* symbol table offset */ + uint32_t nsyms; /* number of symbol table entries */ + uint32_t stroff; /* string table offset */ + uint32_t strsize; /* string table size in bytes */ +}; + +/* + * This is the second set of the symbolic information which is used to support + * the data structures for the dynamically link editor. + * + * The original set of symbolic information in the symtab_command which contains + * the symbol and string tables must also be present when this load command is + * present. When this load command is present the symbol table is organized + * into three groups of symbols: + * local symbols (static and debugging symbols) - grouped by module + * defined external symbols - grouped by module (sorted by name if not lib) + * undefined external symbols (sorted by name if MH_BINDATLOAD is not set, + * and in order the were seen by the static + * linker if MH_BINDATLOAD is set) + * In this load command there are offsets and counts to each of the three groups + * of symbols. + * + * This load command contains a the offsets and sizes of the following new + * symbolic information tables: + * table of contents + * module table + * reference symbol table + * indirect symbol table + * The first three tables above (the table of contents, module table and + * reference symbol table) are only present if the file is a dynamically linked + * shared library. For executable and object modules, which are files + * containing only one module, the information that would be in these three + * tables is determined as follows: + * table of contents - the defined external symbols are sorted by name + * module table - the file contains only one module so everything in the + * file is part of the module. + * reference symbol table - is the defined and undefined external symbols + * + * For dynamically linked shared library files this load command also contains + * offsets and sizes to the pool of relocation entries for all sections + * separated into two groups: + * external relocation entries + * local relocation entries + * For executable and object modules the relocation entries continue to hang + * off the section structures. + */ +struct dysymtab_command { + uint32_t cmd; /* LC_DYSYMTAB */ + uint32_t cmdsize; /* sizeof(struct dysymtab_command) */ + + /* + * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command + * are grouped into the following three groups: + * local symbols (further grouped by the module they are from) + * defined external symbols (further grouped by the module they are from) + * undefined symbols + * + * The local symbols are used only for debugging. The dynamic binding + * process may have to use them to indicate to the debugger the local + * symbols for a module that is being bound. + * + * The last two groups are used by the dynamic binding process to do the + * binding (indirectly through the module table and the reference symbol + * table when this is a dynamically linked shared library file). + */ + uint32_t ilocalsym; /* index to local symbols */ + uint32_t nlocalsym; /* number of local symbols */ + + uint32_t iextdefsym;/* index to externally defined symbols */ + uint32_t nextdefsym;/* number of externally defined symbols */ + + uint32_t iundefsym; /* index to undefined symbols */ + uint32_t nundefsym; /* number of undefined symbols */ + + /* + * For the for the dynamic binding process to find which module a symbol + * is defined in the table of contents is used (analogous to the ranlib + * structure in an archive) which maps defined external symbols to modules + * they are defined in. This exists only in a dynamically linked shared + * library file. For executable and object modules the defined external + * symbols are sorted by name and is use as the table of contents. + */ + uint32_t tocoff; /* file offset to table of contents */ + uint32_t ntoc; /* number of entries in table of contents */ + + /* + * To support dynamic binding of "modules" (whole object files) the symbol + * table must reflect the modules that the file was created from. This is + * done by having a module table that has indexes and counts into the merged + * tables for each module. The module structure that these two entries + * refer to is described below. This exists only in a dynamically linked + * shared library file. For executable and object modules the file only + * contains one module so everything in the file belongs to the module. + */ + uint32_t modtaboff; /* file offset to module table */ + uint32_t nmodtab; /* number of module table entries */ + + /* + * To support dynamic module binding the module structure for each module + * indicates the external references (defined and undefined) each module + * makes. For each module there is an offset and a count into the + * reference symbol table for the symbols that the module references. + * This exists only in a dynamically linked shared library file. For + * executable and object modules the defined external symbols and the + * undefined external symbols indicates the external references. + */ + uint32_t extrefsymoff; /* offset to referenced symbol table */ + uint32_t nextrefsyms; /* number of referenced symbol table entries */ + + /* + * The sections that contain "symbol pointers" and "routine stubs" have + * indexes and (implied counts based on the size of the section and fixed + * size of the entry) into the "indirect symbol" table for each pointer + * and stub. For every section of these two types the index into the + * indirect symbol table is stored in the section header in the field + * reserved1. An indirect symbol table entry is simply a 32bit index into + * the symbol table to the symbol that the pointer or stub is referring to. + * The indirect symbol table is ordered to match the entries in the section. + */ + uint32_t indirectsymoff; /* file offset to the indirect symbol table */ + uint32_t nindirectsyms; /* number of indirect symbol table entries */ + + /* + * To support relocating an individual module in a library file quickly the + * external relocation entries for each module in the library need to be + * accessed efficiently. Since the relocation entries can't be accessed + * through the section headers for a library file they are separated into + * groups of local and external entries further grouped by module. In this + * case the presents of this load command who's extreloff, nextrel, + * locreloff and nlocrel fields are non-zero indicates that the relocation + * entries of non-merged sections are not referenced through the section + * structures (and the reloff and nreloc fields in the section headers are + * set to zero). + * + * Since the relocation entries are not accessed through the section headers + * this requires the r_address field to be something other than a section + * offset to identify the item to be relocated. In this case r_address is + * set to the offset from the vmaddr of the first LC_SEGMENT command. + * For MH_SPLIT_SEGS images r_address is set to the the offset from the + * vmaddr of the first read-write LC_SEGMENT command. + * + * The relocation entries are grouped by module and the module table + * entries have indexes and counts into them for the group of external + * relocation entries for that the module. + * + * For sections that are merged across modules there must not be any + * remaining external relocation entries for them (for merged sections + * remaining relocation entries must be local). + */ + uint32_t extreloff; /* offset to external relocation entries */ + uint32_t nextrel; /* number of external relocation entries */ + + /* + * All the local relocation entries are grouped together (they are not + * grouped by their module since they are only used if the object is moved + * from it staticly link edited address). + */ + uint32_t locreloff; /* offset to local relocation entries */ + uint32_t nlocrel; /* number of local relocation entries */ + +}; + +/* + * An indirect symbol table entry is simply a 32bit index into the symbol table + * to the symbol that the pointer or stub is refering to. Unless it is for a + * non-lazy symbol pointer section for a defined symbol which strip(1) as + * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the + * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. + */ +#define INDIRECT_SYMBOL_LOCAL 0x80000000 +#define INDIRECT_SYMBOL_ABS 0x40000000 + + +/* a table of contents entry */ +struct dylib_table_of_contents { + uint32_t symbol_index; /* the defined external symbol + (index into the symbol table) */ + uint32_t module_index; /* index into the module table this symbol + is defined in */ +}; + +/* a module table entry */ +struct dylib_module { + uint32_t module_name; /* the module name (index into string table) */ + + uint32_t iextdefsym; /* index into externally defined symbols */ + uint32_t nextdefsym; /* number of externally defined symbols */ + uint32_t irefsym; /* index into reference symbol table */ + uint32_t nrefsym; /* number of reference symbol table entries */ + uint32_t ilocalsym; /* index into symbols for local symbols */ + uint32_t nlocalsym; /* number of local symbols */ + + uint32_t iextrel; /* index into external relocation entries */ + uint32_t nextrel; /* number of external relocation entries */ + + uint32_t iinit_iterm; /* low 16 bits are the index into the init + section, high 16 bits are the index into + the term section */ + uint32_t ninit_nterm; /* low 16 bits are the number of init section + entries, high 16 bits are the number of + term section entries */ + + uint32_t /* for this module address of the start of */ + objc_module_info_addr; /* the (__OBJC,__module_info) section */ + uint32_t /* for this module size of */ + objc_module_info_size; /* the (__OBJC,__module_info) section */ +}; + +/* a 64-bit module table entry */ +struct dylib_module_64 { + uint32_t module_name; /* the module name (index into string table) */ + + uint32_t iextdefsym; /* index into externally defined symbols */ + uint32_t nextdefsym; /* number of externally defined symbols */ + uint32_t irefsym; /* index into reference symbol table */ + uint32_t nrefsym; /* number of reference symbol table entries */ + uint32_t ilocalsym; /* index into symbols for local symbols */ + uint32_t nlocalsym; /* number of local symbols */ + + uint32_t iextrel; /* index into external relocation entries */ + uint32_t nextrel; /* number of external relocation entries */ + + uint32_t iinit_iterm; /* low 16 bits are the index into the init + section, high 16 bits are the index into + the term section */ + uint32_t ninit_nterm; /* low 16 bits are the number of init section + entries, high 16 bits are the number of + term section entries */ + + uint32_t /* for this module size of */ + objc_module_info_size; /* the (__OBJC,__module_info) section */ + uint64_t /* for this module address of the start of */ + objc_module_info_addr; /* the (__OBJC,__module_info) section */ +}; + +/* + * The entries in the reference symbol table are used when loading the module + * (both by the static and dynamic link editors) and if the module is unloaded + * or replaced. Therefore all external symbols (defined and undefined) are + * listed in the module's reference table. The flags describe the type of + * reference that is being made. The constants for the flags are defined in + * <mach-o/nlist.h> as they are also used for symbol table entries. + */ +struct dylib_reference { + uint32_t isym:24, /* index into the symbol table */ + flags:8; /* flags to indicate the type of reference */ +}; + +/* + * The twolevel_hints_command contains the offset and number of hints in the + * two-level namespace lookup hints table. + */ +struct twolevel_hints_command { + uint32_t cmd; /* LC_TWOLEVEL_HINTS */ + uint32_t cmdsize; /* sizeof(struct twolevel_hints_command) */ + uint32_t offset; /* offset to the hint table */ + uint32_t nhints; /* number of hints in the hint table */ +}; + +/* + * The entries in the two-level namespace lookup hints table are twolevel_hint + * structs. These provide hints to the dynamic link editor where to start + * looking for an undefined symbol in a two-level namespace image. The + * isub_image field is an index into the sub-images (sub-frameworks and + * sub-umbrellas list) that made up the two-level image that the undefined + * symbol was found in when it was built by the static link editor. If + * isub-image is 0 the the symbol is expected to be defined in library and not + * in the sub-images. If isub-image is non-zero it is an index into the array + * of sub-images for the umbrella with the first index in the sub-images being + * 1. The array of sub-images is the ordered list of sub-images of the umbrella + * that would be searched for a symbol that has the umbrella recorded as its + * primary library. The table of contents index is an index into the + * library's table of contents. This is used as the starting point of the + * binary search or a directed linear search. + */ +struct twolevel_hint { + uint32_t + isub_image:8, /* index into the sub images */ + itoc:24; /* index into the table of contents */ +}; + +/* + * The prebind_cksum_command contains the value of the original check sum for + * prebound files or zero. When a prebound file is first created or modified + * for other than updating its prebinding information the value of the check sum + * is set to zero. When the file has it prebinding re-done and if the value of + * the check sum is zero the original check sum is calculated and stored in + * cksum field of this load command in the output file. If when the prebinding + * is re-done and the cksum field is non-zero it is left unchanged from the + * input file. + */ +struct prebind_cksum_command { + uint32_t cmd; /* LC_PREBIND_CKSUM */ + uint32_t cmdsize; /* sizeof(struct prebind_cksum_command) */ + uint32_t cksum; /* the check sum or zero */ +}; + +/* + * The uuid load command contains a single 128-bit unique random number that + * identifies an object produced by the static link editor. + */ +struct uuid_command { + uint32_t cmd; /* LC_UUID */ + uint32_t cmdsize; /* sizeof(struct uuid_command) */ + uint8_t uuid[16]; /* the 128-bit uuid */ +}; + +/* + * The rpath_command contains a path which at runtime should be added to + * the current run path used to find @rpath prefixed dylibs. + */ +struct rpath_command { + uint32_t cmd; /* LC_RPATH */ + uint32_t cmdsize; /* includes string */ + union lc_str path; /* path to add to run path */ +}; + +/* + * The linkedit_data_command contains the offsets and sizes of a blob + * of data in the __LINKEDIT segment. + */ +struct linkedit_data_command { + uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO, + or LC_FUNCTION_STARTS */ + uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */ + uint32_t dataoff; /* file offset of data in __LINKEDIT segment */ + uint32_t datasize; /* file size of data in __LINKEDIT segment */ +}; + +/* + * The encryption_info_command contains the file offset and size of an + * of an encrypted segment. + */ +struct encryption_info_command { + uint32_t cmd; /* LC_ENCRYPTION_INFO */ + uint32_t cmdsize; /* sizeof(struct encryption_info_command) */ + uint32_t cryptoff; /* file offset of encrypted range */ + uint32_t cryptsize; /* file size of encrypted range */ + uint32_t cryptid; /* which enryption system, + 0 means not-encrypted yet */ +}; + +/* + * The version_min_command contains the min OS version on which this + * binary was built to run. + */ +struct version_min_command { + uint32_t cmd; /* LC_VERSION_MIN_MACOSX or + LC_VERSION_MIN_IPHONEOS */ + uint32_t cmdsize; /* sizeof(struct min_version_command) */ + uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */ + uint32_t reserved; /* zero */ +}; + +/* + * The dyld_info_command contains the file offsets and sizes of + * the new compressed form of the information dyld needs to + * load the image. This information is used by dyld on Mac OS X + * 10.6 and later. All information pointed to by this command + * is encoded using byte streams, so no endian swapping is needed + * to interpret it. + */ +struct dyld_info_command { + uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */ + uint32_t cmdsize; /* sizeof(struct dyld_info_command) */ + + /* + * Dyld rebases an image whenever dyld loads it at an address different + * from its preferred address. The rebase information is a stream + * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_. + * Conceptually the rebase information is a table of tuples: + * <seg-index, seg-offset, type> + * The opcodes are a compressed way to encode the table by only + * encoding when a column changes. In addition simple patterns + * like "every n'th offset for m times" can be encoded in a few + * bytes. + */ + uint32_t rebase_off; /* file offset to rebase info */ + uint32_t rebase_size; /* size of rebase info */ + + /* + * Dyld binds an image during the loading process, if the image + * requires any pointers to be initialized to symbols in other images. + * The bind information is a stream of byte sized + * opcodes whose symbolic names start with BIND_OPCODE_. + * Conceptually the bind information is a table of tuples: + * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend> + * The opcodes are a compressed way to encode the table by only + * encoding when a column changes. In addition simple patterns + * like for runs of pointers initialzed to the same value can be + * encoded in a few bytes. + */ + uint32_t bind_off; /* file offset to binding info */ + uint32_t bind_size; /* size of binding info */ + + /* + * Some C++ programs require dyld to unique symbols so that all + * images in the process use the same copy of some code/data. + * This step is done after binding. The content of the weak_bind + * info is an opcode stream like the bind_info. But it is sorted + * alphabetically by symbol name. This enable dyld to walk + * all images with weak binding information in order and look + * for collisions. If there are no collisions, dyld does + * no updating. That means that some fixups are also encoded + * in the bind_info. For instance, all calls to "operator new" + * are first bound to libstdc++.dylib using the information + * in bind_info. Then if some image overrides operator new + * that is detected when the weak_bind information is processed + * and the call to operator new is then rebound. + */ + uint32_t weak_bind_off; /* file offset to weak binding info */ + uint32_t weak_bind_size; /* size of weak binding info */ + + /* + * Some uses of external symbols do not need to be bound immediately. + * Instead they can be lazily bound on first use. The lazy_bind + * are contains a stream of BIND opcodes to bind all lazy symbols. + * Normal use is that dyld ignores the lazy_bind section when + * loading an image. Instead the static linker arranged for the + * lazy pointer to initially point to a helper function which + * pushes the offset into the lazy_bind area for the symbol + * needing to be bound, then jumps to dyld which simply adds + * the offset to lazy_bind_off to get the information on what + * to bind. + */ + uint32_t lazy_bind_off; /* file offset to lazy binding info */ + uint32_t lazy_bind_size; /* size of lazy binding infs */ + + /* + * The symbols exported by a dylib are encoded in a trie. This + * is a compact representation that factors out common prefixes. + * It also reduces LINKEDIT pages in RAM because it encodes all + * information (name, address, flags) in one small, contiguous range. + * The export area is a stream of nodes. The first node sequentially + * is the start node for the trie. + * + * Nodes for a symbol start with a uleb128 that is the length of + * the exported symbol information for the string so far. + * If there is no exported symbol, the node starts with a zero byte. + * If there is exported info, it follows the length. First is + * a uleb128 containing flags. Normally, it is followed by a + * uleb128 encoded offset which is location of the content named + * by the symbol from the mach_header for the image. If the flags + * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is + * a uleb128 encoded library ordinal, then a zero terminated + * UTF8 string. If the string is zero length, then the symbol + * is re-export from the specified dylib with the same name. + * + * After the optional exported symbol information is a byte of + * how many edges (0-255) that this node has leaving it, + * followed by each edge. + * Each edge is a zero terminated UTF8 of the addition chars + * in the symbol, followed by a uleb128 offset for the node that + * edge points to. + * + */ + uint32_t export_off; /* file offset to lazy binding info */ + uint32_t export_size; /* size of lazy binding infs */ +}; + +/* + * The following are used to encode rebasing information + */ +#define REBASE_TYPE_POINTER 1 +#define REBASE_TYPE_TEXT_ABSOLUTE32 2 +#define REBASE_TYPE_TEXT_PCREL32 3 + +#define REBASE_OPCODE_MASK 0xF0 +#define REBASE_IMMEDIATE_MASK 0x0F +#define REBASE_OPCODE_DONE 0x00 +#define REBASE_OPCODE_SET_TYPE_IMM 0x10 +#define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20 +#define REBASE_OPCODE_ADD_ADDR_ULEB 0x30 +#define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40 +#define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50 +#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60 +#define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70 +#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80 + + +/* + * The following are used to encode binding information + */ +#define BIND_TYPE_POINTER 1 +#define BIND_TYPE_TEXT_ABSOLUTE32 2 +#define BIND_TYPE_TEXT_PCREL32 3 + +#define BIND_SPECIAL_DYLIB_SELF 0 +#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 +#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 + +#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1 +#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8 + +#define BIND_OPCODE_MASK 0xF0 +#define BIND_IMMEDIATE_MASK 0x0F +#define BIND_OPCODE_DONE 0x00 +#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10 +#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20 +#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30 +#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40 +#define BIND_OPCODE_SET_TYPE_IMM 0x50 +#define BIND_OPCODE_SET_ADDEND_SLEB 0x60 +#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70 +#define BIND_OPCODE_ADD_ADDR_ULEB 0x80 +#define BIND_OPCODE_DO_BIND 0x90 +#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0 +#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0 +#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0 + + +/* + * The following are used on the flags byte of a terminal node + * in the export information. + */ +#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03 +#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00 +#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01 +#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04 +#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08 +#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10 + +/* + * The symseg_command contains the offset and size of the GNU style + * symbol table information as described in the header file <symseg.h>. + * The symbol roots of the symbol segments must also be aligned properly + * in the file. So the requirement of keeping the offsets aligned to a + * multiple of a 4 bytes translates to the length field of the symbol + * roots also being a multiple of a long. Also the padding must again be + * zeroed. (THIS IS OBSOLETE and no longer supported). + */ +struct symseg_command { + uint32_t cmd; /* LC_SYMSEG */ + uint32_t cmdsize; /* sizeof(struct symseg_command) */ + uint32_t offset; /* symbol segment offset */ + uint32_t size; /* symbol segment size in bytes */ +}; + +/* + * The ident_command contains a free format string table following the + * ident_command structure. The strings are null terminated and the size of + * the command is padded out with zero bytes to a multiple of 4 bytes/ + * (THIS IS OBSOLETE and no longer supported). + */ +struct ident_command { + uint32_t cmd; /* LC_IDENT */ + uint32_t cmdsize; /* strings that follow this command */ +}; + +/* + * The fvmfile_command contains a reference to a file to be loaded at the + * specified virtual address. (Presently, this command is reserved for + * internal use. The kernel ignores this command when loading a program into + * memory). + */ +struct fvmfile_command { + uint32_t cmd; /* LC_FVMFILE */ + uint32_t cmdsize; /* includes pathname string */ + union lc_str name; /* files pathname */ + uint32_t header_addr; /* files virtual address */ +}; + +/* + * Sections of type S_THREAD_LOCAL_VARIABLES contain an array + * of tlv_descriptor structures. + */ +struct tlv_descriptor +{ + void* (*thunk)(struct tlv_descriptor*); + unsigned long key; + unsigned long offset; +}; + +#endif /* _MACHO_LOADER_H_ */ diff --git a/i386/include/mach-o/nlist.h b/i386/include/mach-o/nlist.h new file mode 100644 index 0000000..1c19410 --- /dev/null +++ b/i386/include/mach-o/nlist.h @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACHO_NLIST_H_ +#define _MACHO_NLIST_H_ +/* $NetBSD: nlist.h,v 1.5 1994/10/26 00:56:11 cgd Exp $ */ + +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)nlist.h 8.2 (Berkeley) 1/21/94 + */ +#include <stdint.h> + +/* + * Format of a symbol table entry of a Mach-O file for 32-bit architectures. + * Modified from the BSD format. The modifications from the original format + * were changing n_other (an unused field) to n_sect and the addition of the + * N_SECT type. These modifications are required to support symbols in a larger + * number of sections not just the three sections (text, data and bss) in a BSD + * file. + */ +struct nlist { + union { +#ifndef __LP64__ + char *n_name; /* for use when in-core */ +#endif + int32_t n_strx; /* index into the string table */ + } n_un; + uint8_t n_type; /* type flag, see below */ + uint8_t n_sect; /* section number or NO_SECT */ + int16_t n_desc; /* see <mach-o/stab.h> */ + uint32_t n_value; /* value of this symbol (or stab offset) */ +}; + +/* + * This is the symbol table entry structure for 64-bit architectures. + */ +struct nlist_64 { + union { + uint32_t n_strx; /* index into the string table */ + } n_un; + uint8_t n_type; /* type flag, see below */ + uint8_t n_sect; /* section number or NO_SECT */ + uint16_t n_desc; /* see <mach-o/stab.h> */ + uint64_t n_value; /* value of this symbol (or stab offset) */ +}; + +/* + * Symbols with a index into the string table of zero (n_un.n_strx == 0) are + * defined to have a null, "", name. Therefore all string indexes to non null + * names must not have a zero string index. This is bit historical information + * that has never been well documented. + */ + +/* + * The n_type field really contains four fields: + * unsigned char N_STAB:3, + * N_PEXT:1, + * N_TYPE:3, + * N_EXT:1; + * which are used via the following masks. + */ +#define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ +#define N_PEXT 0x10 /* private external symbol bit */ +#define N_TYPE 0x0e /* mask for the type bits */ +#define N_EXT 0x01 /* external symbol bit, set for external symbols */ + +/* + * Only symbolic debugging entries have some of the N_STAB bits set and if any + * of these bits are set then it is a symbolic debugging entry (a stab). In + * which case then the values of the n_type field (the entire field) are given + * in <mach-o/stab.h> + */ + +/* + * Values for N_TYPE bits of the n_type field. + */ +#define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */ +#define N_ABS 0x2 /* absolute, n_sect == NO_SECT */ +#define N_SECT 0xe /* defined in section number n_sect */ +#define N_PBUD 0xc /* prebound undefined (defined in a dylib) */ +#define N_INDR 0xa /* indirect */ + +/* + * If the type is N_INDR then the symbol is defined to be the same as another + * symbol. In this case the n_value field is an index into the string table + * of the other symbol's name. When the other symbol is defined then they both + * take on the defined type and value. + */ + +/* + * If the type is N_SECT then the n_sect field contains an ordinal of the + * section the symbol is defined in. The sections are numbered from 1 and + * refer to sections in order they appear in the load commands for the file + * they are in. This means the same ordinal may very well refer to different + * sections in different files. + * + * The n_value field for all symbol table entries (including N_STAB's) gets + * updated by the link editor based on the value of it's n_sect field and where + * the section n_sect references gets relocated. If the value of the n_sect + * field is NO_SECT then it's n_value field is not changed by the link editor. + */ +#define NO_SECT 0 /* symbol is not in any section */ +#define MAX_SECT 255 /* 1 thru 255 inclusive */ + +/* + * Common symbols are represented by undefined (N_UNDF) external (N_EXT) types + * who's values (n_value) are non-zero. In which case the value of the n_value + * field is the size (in bytes) of the common symbol. The n_sect field is set + * to NO_SECT. The alignment of a common symbol may be set as a power of 2 + * between 2^1 and 2^15 as part of the n_desc field using the macros below. If + * the alignment is not set (a value of zero) then natural alignment based on + * the size is used. + */ +#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f) +#define SET_COMM_ALIGN(n_desc,align) \ + (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8)) + +/* + * To support the lazy binding of undefined symbols in the dynamic link-editor, + * the undefined symbols in the symbol table (the nlist structures) are marked + * with the indication if the undefined reference is a lazy reference or + * non-lazy reference. If both a non-lazy reference and a lazy reference is + * made to the same symbol the non-lazy reference takes precedence. A reference + * is lazy only when all references to that symbol are made through a symbol + * pointer in a lazy symbol pointer section. + * + * The implementation of marking nlist structures in the symbol table for + * undefined symbols will be to use some of the bits of the n_desc field as a + * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field + * of an nlist structure for an undefined symbol to determine the type of + * undefined reference (lazy or non-lazy). + * + * The constants for the REFERENCE FLAGS are propagated to the reference table + * in a shared library file. In that case the constant for a defined symbol, + * REFERENCE_FLAG_DEFINED, is also used. + */ +/* Reference type bits of the n_desc field of undefined symbols */ +#define REFERENCE_TYPE 0x7 +/* types of references */ +#define REFERENCE_FLAG_UNDEFINED_NON_LAZY 0 +#define REFERENCE_FLAG_UNDEFINED_LAZY 1 +#define REFERENCE_FLAG_DEFINED 2 +#define REFERENCE_FLAG_PRIVATE_DEFINED 3 +#define REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4 +#define REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5 + +/* + * To simplify stripping of objects that use are used with the dynamic link + * editor, the static link editor marks the symbols defined an object that are + * referenced by a dynamicly bound object (dynamic shared libraries, bundles). + * With this marking strip knows not to strip these symbols. + */ +#define REFERENCED_DYNAMICALLY 0x0010 + +/* + * For images created by the static link editor with the -twolevel_namespace + * option in effect the flags field of the mach header is marked with + * MH_TWOLEVEL. And the binding of the undefined references of the image are + * determined by the static link editor. Which library an undefined symbol is + * bound to is recorded by the static linker in the high 8 bits of the n_desc + * field using the SET_LIBRARY_ORDINAL macro below. The ordinal recorded + * references the libraries listed in the Mach-O's LC_LOAD_DYLIB, + * LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_LOAD_UPWARD_DYLIB, and + * LC_LAZY_LOAD_DYLIB, etc. load commands in the order they appear in the + * headers. The library ordinals start from 1. + * For a dynamic library that is built as a two-level namespace image the + * undefined references from module defined in another use the same nlist struct + * an in that case SELF_LIBRARY_ORDINAL is used as the library ordinal. For + * defined symbols in all images they also must have the library ordinal set to + * SELF_LIBRARY_ORDINAL. The EXECUTABLE_ORDINAL refers to the executable + * image for references from plugins that refer to the executable that loads + * them. + * + * The DYNAMIC_LOOKUP_ORDINAL is for undefined symbols in a two-level namespace + * image that are looked up by the dynamic linker with flat namespace semantics. + * This ordinal was added as a feature in Mac OS X 10.3 by reducing the + * value of MAX_LIBRARY_ORDINAL by one. So it is legal for existing binaries + * or binaries built with older tools to have 0xfe (254) dynamic libraries. In + * this case the ordinal value 0xfe (254) must be treated as a library ordinal + * for compatibility. + */ +#define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff) +#define SET_LIBRARY_ORDINAL(n_desc,ordinal) \ + (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8)) +#define SELF_LIBRARY_ORDINAL 0x0 +#define MAX_LIBRARY_ORDINAL 0xfd +#define DYNAMIC_LOOKUP_ORDINAL 0xfe +#define EXECUTABLE_ORDINAL 0xff + +/* + * The bit 0x0020 of the n_desc field is used for two non-overlapping purposes + * and has two different symbolic names, N_NO_DEAD_STRIP and N_DESC_DISCARDED. + */ + +/* + * The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a + * relocatable .o file (MH_OBJECT filetype). And is used to indicate to the + * static link editor it is never to dead strip the symbol. + */ +#define N_NO_DEAD_STRIP 0x0020 /* symbol is not to be dead stripped */ + +/* + * The N_DESC_DISCARDED bit of the n_desc field never appears in linked image. + * But is used in very rare cases by the dynamic link editor to mark an in + * memory symbol as discared and longer used for linking. + */ +#define N_DESC_DISCARDED 0x0020 /* symbol is discarded */ + +/* + * The N_WEAK_REF bit of the n_desc field indicates to the dynamic linker that + * the undefined symbol is allowed to be missing and is to have the address of + * zero when missing. + */ +#define N_WEAK_REF 0x0040 /* symbol is weak referenced */ + +/* + * The N_WEAK_DEF bit of the n_desc field indicates to the static and dynamic + * linkers that the symbol definition is weak, allowing a non-weak symbol to + * also be used which causes the weak definition to be discared. Currently this + * is only supported for symbols in coalesed sections. + */ +#define N_WEAK_DEF 0x0080 /* coalesed symbol is a weak definition */ + +/* + * The N_REF_TO_WEAK bit of the n_desc field indicates to the dynamic linker + * that the undefined symbol should be resolved using flat namespace searching. + */ +#define N_REF_TO_WEAK 0x0080 /* reference to a weak symbol */ + +/* + * The N_ARM_THUMB_DEF bit of the n_desc field indicates that the symbol is + * a defintion of a Thumb function. + */ +#define N_ARM_THUMB_DEF 0x0008 /* symbol is a Thumb function (ARM) */ + +/* + * The N_SYMBOL_RESOLVER bit of the n_desc field indicates that the + * that the function is actually a resolver function and should + * be called to get the address of the real function to use. + * This bit is only available in .o files (MH_OBJECT filetype) + */ +#define N_SYMBOL_RESOLVER 0x0100 + +#ifndef __STRICT_BSD__ +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ +/* + * The function nlist(3) from the C library. + */ +extern int nlist (const char *filename, struct nlist *list); +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __STRICT_BSD__ */ + +#endif /* _MACHO_LIST_H_ */ diff --git a/i386/include/mach-o/ppc/.svn/all-wcprops b/i386/include/mach-o/ppc/.svn/all-wcprops new file mode 100644 index 0000000..ecd32f8 --- /dev/null +++ b/i386/include/mach-o/ppc/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/ppc +END +swap.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/ppc/swap.h +END +reloc.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/ppc/reloc.h +END diff --git a/i386/include/mach-o/ppc/.svn/entries b/i386/include/mach-o/ppc/.svn/entries new file mode 100644 index 0000000..f22c5c8 --- /dev/null +++ b/i386/include/mach-o/ppc/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach-o/ppc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +swap.h +file + + + + +2013-08-27T23:54:36.000000Z +ccc0b81b75592437c023d4b1876c301a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1376 + +reloc.h +file + + + + +2013-08-27T23:54:36.000000Z +4ff9bbb462f1dcc64b600b043d90f6ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3195 + diff --git a/i386/include/mach-o/ppc/.svn/text-base/reloc.h.svn-base b/i386/include/mach-o/ppc/.svn/text-base/reloc.h.svn-base new file mode 100644 index 0000000..7b564cc --- /dev/null +++ b/i386/include/mach-o/ppc/.svn/text-base/reloc.h.svn-base @@ -0,0 +1,65 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Relocation types used in the ppc implementation. Relocation entries for + * things other than instructions use the same generic relocation as discribed + * above and their r_type is RELOC_VANILLA. The rest of the relocation types + * are for instructions. Since they are for instructions the r_address field + * indicates the 32 bit instruction that the relocation is to be preformed on. + * The fields r_pcrel and r_length are ignored for non-RELOC_VANILLA r_types + * except for PPC_RELOC_BR14. + * + * For PPC_RELOC_BR14 if the r_length is the unused value 3, then the branch was + * statically predicted setting or clearing the Y-bit based on the sign of the + * displacement or the opcode. If this is the case the static linker must flip + * the value of the Y-bit if the sign of the displacement changes for non-branch + * always conditions. + */ +enum reloc_type_ppc +{ + PPC_RELOC_VANILLA, /* generic relocation as discribed above */ + PPC_RELOC_PAIR, /* the second relocation entry of a pair */ + PPC_RELOC_BR14, /* 14 bit branch displacement (to a word address) */ + PPC_RELOC_BR24, /* 24 bit branch displacement (to a word address) */ + PPC_RELOC_HI16, /* a PAIR follows with the low half */ + PPC_RELOC_LO16, /* a PAIR follows with the high half */ + PPC_RELOC_HA16, /* Same as the RELOC_HI16 except the low 16 bits and the + * high 16 bits are added together with the low 16 bits + * sign extened first. This means if bit 15 of the low + * 16 bits is set the high 16 bits stored in the + * instruction will be adjusted. + */ + PPC_RELOC_LO14, /* Same as the LO16 except that the low 2 bits are not + * stored in the instruction and are always zero. This + * is used in double word load/store instructions. + */ + PPC_RELOC_SECTDIFF, /* a PAIR follows with subtract symbol value */ + PPC_RELOC_PB_LA_PTR,/* prebound lazy pointer */ + PPC_RELOC_HI16_SECTDIFF, /* section difference forms of above. a PAIR */ + PPC_RELOC_LO16_SECTDIFF, /* follows these with subtract symbol value */ + PPC_RELOC_HA16_SECTDIFF, + PPC_RELOC_JBSR, + PPC_RELOC_LO14_SECTDIFF, + PPC_RELOC_LOCAL_SECTDIFF /* like PPC_RELOC_SECTDIFF, but the symbol + referenced was local. */ +}; diff --git a/i386/include/mach-o/ppc/.svn/text-base/swap.h.svn-base b/i386/include/mach-o/ppc/.svn/text-base/swap.h.svn-base new file mode 100644 index 0000000..2c116a9 --- /dev/null +++ b/i386/include/mach-o/ppc/.svn/text-base/swap.h.svn-base @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <architecture/byte_order.h> +#include <mach/ppc/thread_status.h> + +extern void swap_ppc_thread_state_t( + ppc_thread_state_t *cpu, + enum NXByteOrder target_byte_sex); + +extern void swap_ppc_float_state_t( + ppc_float_state_t *fpu, + enum NXByteOrder target_byte_sex); + +extern void swap_ppc_exception_state_t( + ppc_exception_state_t *state, + enum NXByteOrder target_byte_sex); diff --git a/i386/include/mach-o/ppc/reloc.h b/i386/include/mach-o/ppc/reloc.h new file mode 100644 index 0000000..7b564cc --- /dev/null +++ b/i386/include/mach-o/ppc/reloc.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Relocation types used in the ppc implementation. Relocation entries for + * things other than instructions use the same generic relocation as discribed + * above and their r_type is RELOC_VANILLA. The rest of the relocation types + * are for instructions. Since they are for instructions the r_address field + * indicates the 32 bit instruction that the relocation is to be preformed on. + * The fields r_pcrel and r_length are ignored for non-RELOC_VANILLA r_types + * except for PPC_RELOC_BR14. + * + * For PPC_RELOC_BR14 if the r_length is the unused value 3, then the branch was + * statically predicted setting or clearing the Y-bit based on the sign of the + * displacement or the opcode. If this is the case the static linker must flip + * the value of the Y-bit if the sign of the displacement changes for non-branch + * always conditions. + */ +enum reloc_type_ppc +{ + PPC_RELOC_VANILLA, /* generic relocation as discribed above */ + PPC_RELOC_PAIR, /* the second relocation entry of a pair */ + PPC_RELOC_BR14, /* 14 bit branch displacement (to a word address) */ + PPC_RELOC_BR24, /* 24 bit branch displacement (to a word address) */ + PPC_RELOC_HI16, /* a PAIR follows with the low half */ + PPC_RELOC_LO16, /* a PAIR follows with the high half */ + PPC_RELOC_HA16, /* Same as the RELOC_HI16 except the low 16 bits and the + * high 16 bits are added together with the low 16 bits + * sign extened first. This means if bit 15 of the low + * 16 bits is set the high 16 bits stored in the + * instruction will be adjusted. + */ + PPC_RELOC_LO14, /* Same as the LO16 except that the low 2 bits are not + * stored in the instruction and are always zero. This + * is used in double word load/store instructions. + */ + PPC_RELOC_SECTDIFF, /* a PAIR follows with subtract symbol value */ + PPC_RELOC_PB_LA_PTR,/* prebound lazy pointer */ + PPC_RELOC_HI16_SECTDIFF, /* section difference forms of above. a PAIR */ + PPC_RELOC_LO16_SECTDIFF, /* follows these with subtract symbol value */ + PPC_RELOC_HA16_SECTDIFF, + PPC_RELOC_JBSR, + PPC_RELOC_LO14_SECTDIFF, + PPC_RELOC_LOCAL_SECTDIFF /* like PPC_RELOC_SECTDIFF, but the symbol + referenced was local. */ +}; diff --git a/i386/include/mach-o/ppc/swap.h b/i386/include/mach-o/ppc/swap.h new file mode 100644 index 0000000..2c116a9 --- /dev/null +++ b/i386/include/mach-o/ppc/swap.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <architecture/byte_order.h> +#include <mach/ppc/thread_status.h> + +extern void swap_ppc_thread_state_t( + ppc_thread_state_t *cpu, + enum NXByteOrder target_byte_sex); + +extern void swap_ppc_float_state_t( + ppc_float_state_t *fpu, + enum NXByteOrder target_byte_sex); + +extern void swap_ppc_exception_state_t( + ppc_exception_state_t *state, + enum NXByteOrder target_byte_sex); diff --git a/i386/include/mach-o/ranlib.h b/i386/include/mach-o/ranlib.h new file mode 100644 index 0000000..66a1f09 --- /dev/null +++ b/i386/include/mach-o/ranlib.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* ranlib.h 4.1 83/05/03 */ +#ifndef _MACH_O_RANLIB_H_ +#define _MACH_O_RANLIB_H_ + +#include <stdint.h> +#include <sys/types.h> /* off_t */ + +/* + * There are two known orders of table of contents for archives. The first is + * the order ranlib(1) originally produced and still produces without any + * options. This table of contents has the archive member name "__.SYMDEF" + * This order has the ranlib structures in the order the objects appear in the + * archive and the symbol names of those objects in the order of symbol table. + * The second know order is sorted by symbol name and is produced with the -s + * option to ranlib(1). This table of contents has the archive member name + * "__.SYMDEF SORTED" and many programs (notably the 1.0 version of ld(1) can't + * tell the difference between names because of the imbedded blank in the name + * and works with either table of contents). This second order is used by the + * post 1.0 link editor to produce faster linking. The original 1.0 version of + * ranlib(1) gets confused when it is run on a archive with the second type of + * table of contents because it and ar(1) which it uses use different ways to + * determined the member name (ar(1) treats all blanks in the name as + * significant and ranlib(1) only checks for the first one). + */ +#define SYMDEF "__.SYMDEF" +#define SYMDEF_SORTED "__.SYMDEF SORTED" + +/* + * Structure of the __.SYMDEF table of contents for an archive. + * __.SYMDEF begins with a long giving the size in bytes of the ranlib + * structures which immediately follow, and then continues with a string + * table consisting of a long giving the number of bytes of strings which + * follow and then the strings themselves. The ran_strx fields index the + * string table whose first byte is numbered 0. + */ +struct ranlib { + union { + uint32_t ran_strx; /* string table index of */ +#ifndef __LP64__ + char *ran_name; /* symbol defined by */ +#endif + } ran_un; + uint32_t ran_off; /* library member at this offset */ +}; +#endif /* _MACH_O_RANLIB_H_ */ diff --git a/i386/include/mach-o/reloc.h b/i386/include/mach-o/reloc.h new file mode 100644 index 0000000..d5741ef --- /dev/null +++ b/i386/include/mach-o/reloc.h @@ -0,0 +1,203 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $ */ + +/* + * Copyright (c) 1993 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MACHO_RELOC_H_ +#define _MACHO_RELOC_H_ +#include <stdint.h> + +/* + * Format of a relocation entry of a Mach-O file. Modified from the 4.3BSD + * format. The modifications from the original format were changing the value + * of the r_symbolnum field for "local" (r_extern == 0) relocation entries. + * This modification is required to support symbols in an arbitrary number of + * sections not just the three sections (text, data and bss) in a 4.3BSD file. + * Also the last 4 bits have had the r_type tag added to them. + */ +struct relocation_info { + int32_t r_address; /* offset in the section to what is being + relocated */ + uint32_t r_symbolnum:24, /* symbol index if r_extern == 1 or section + ordinal if r_extern == 0 */ + r_pcrel:1, /* was relocated pc relative already */ + r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ + r_extern:1, /* does not include value of sym referenced */ + r_type:4; /* if not 0, machine specific relocation type */ +}; +#define R_ABS 0 /* absolute relocation type for Mach-O files */ + +/* + * The r_address is not really the address as it's name indicates but an offset. + * In 4.3BSD a.out objects this offset is from the start of the "segment" for + * which relocation entry is for (text or data). For Mach-O object files it is + * also an offset but from the start of the "section" for which the relocation + * entry is for. See comments in <mach-o/loader.h> about the r_address feild + * in images for used with the dynamic linker. + * + * In 4.3BSD a.out objects if r_extern is zero then r_symbolnum is an ordinal + * for the segment the symbol being relocated is in. These ordinals are the + * symbol types N_TEXT, N_DATA, N_BSS or N_ABS. In Mach-O object files these + * ordinals refer to the sections in the object file in the order their section + * structures appear in the headers of the object file they are in. The first + * section has the ordinal 1, the second 2, and so on. This means that the + * same ordinal in two different object files could refer to two different + * sections. And further could have still different ordinals when combined + * by the link-editor. The value R_ABS is used for relocation entries for + * absolute symbols which need no further relocation. + */ + +/* + * For RISC machines some of the references are split across two instructions + * and the instruction does not contain the complete value of the reference. + * In these cases a second, or paired relocation entry, follows each of these + * relocation entries, using a PAIR r_type, which contains the other part of the + * reference not contained in the instruction. This other part is stored in the + * pair's r_address field. The exact number of bits of the other part of the + * reference store in the r_address field is dependent on the particular + * relocation type for the particular architecture. + */ + +/* + * To make scattered loading by the link editor work correctly "local" + * relocation entries can't be used when the item to be relocated is the value + * of a symbol plus an offset (where the resulting expresion is outside the + * block the link editor is moving, a blocks are divided at symbol addresses). + * In this case. where the item is a symbol value plus offset, the link editor + * needs to know more than just the section the symbol was defined. What is + * needed is the actual value of the symbol without the offset so it can do the + * relocation correctly based on where the value of the symbol got relocated to + * not the value of the expression (with the offset added to the symbol value). + * So for the NeXT 2.0 release no "local" relocation entries are ever used when + * there is a non-zero offset added to a symbol. The "external" and "local" + * relocation entries remain unchanged. + * + * The implemention is quite messy given the compatibility with the existing + * relocation entry format. The ASSUMPTION is that a section will never be + * bigger than 2**24 - 1 (0x00ffffff or 16,777,215) bytes. This assumption + * allows the r_address (which is really an offset) to fit in 24 bits and high + * bit of the r_address field in the relocation_info structure to indicate + * it is really a scattered_relocation_info structure. Since these are only + * used in places where "local" relocation entries are used and not where + * "external" relocation entries are used the r_extern field has been removed. + * + * For scattered loading to work on a RISC machine where some of the references + * are split across two instructions the link editor needs to be assured that + * each reference has a unique 32 bit reference (that more than one reference is + * NOT sharing the same high 16 bits for example) so it move each referenced + * item independent of each other. Some compilers guarantees this but the + * compilers don't so scattered loading can be done on those that do guarantee + * this. + */ +#if defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) +/* + * The reason for the ifdef's of __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are that + * when stattered relocation entries were added the mistake of using a mask + * against a structure that is made up of bit fields was used. To make this + * design work this structure must be laid out in memory the same way so the + * mask can be applied can check the same bit each time (r_scattered). + */ +#endif /* defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__) */ +#define R_SCATTERED 0x80000000 /* mask to be applied to the r_address field + of a relocation_info structure to tell that + is is really a scattered_relocation_info + stucture */ +struct scattered_relocation_info { +#ifdef __BIG_ENDIAN__ + uint32_t r_scattered:1, /* 1=scattered, 0=non-scattered (see above) */ + r_pcrel:1, /* was relocated pc relative already */ + r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ + r_type:4, /* if not 0, machine specific relocation type */ + r_address:24; /* offset in the section to what is being + relocated */ + int32_t r_value; /* the value the item to be relocated is + refering to (without any offset added) */ +#endif /* __BIG_ENDIAN__ */ +#ifdef __LITTLE_ENDIAN__ + uint32_t + r_address:24, /* offset in the section to what is being + relocated */ + r_type:4, /* if not 0, machine specific relocation type */ + r_length:2, /* 0=byte, 1=word, 2=long, 3=quad */ + r_pcrel:1, /* was relocated pc relative already */ + r_scattered:1; /* 1=scattered, 0=non-scattered (see above) */ + int32_t r_value; /* the value the item to be relocated is + refering to (without any offset added) */ +#endif /* __LITTLE_ENDIAN__ */ +}; + +/* + * Relocation types used in a generic implementation. Relocation entries for + * normal things use the generic relocation as discribed above and their r_type + * is GENERIC_RELOC_VANILLA (a value of zero). + * + * Another type of generic relocation, GENERIC_RELOC_SECTDIFF, is to support + * the difference of two symbols defined in different sections. That is the + * expression "symbol1 - symbol2 + constant" is a relocatable expression when + * both symbols are defined in some section. For this type of relocation the + * both relocations entries are scattered relocation entries. The value of + * symbol1 is stored in the first relocation entry's r_value field and the + * value of symbol2 is stored in the pair's r_value field. + * + * A special case for a prebound lazy pointer is needed to beable to set the + * value of the lazy pointer back to its non-prebound state. This is done + * using the GENERIC_RELOC_PB_LA_PTR r_type. This is a scattered relocation + * entry where the r_value feild is the value of the lazy pointer not prebound. + */ +enum reloc_type_generic +{ + GENERIC_RELOC_VANILLA, /* generic relocation as discribed above */ + GENERIC_RELOC_PAIR, /* Only follows a GENERIC_RELOC_SECTDIFF */ + GENERIC_RELOC_SECTDIFF, + GENERIC_RELOC_PB_LA_PTR, /* prebound lazy pointer */ + GENERIC_RELOC_LOCAL_SECTDIFF, + GENERIC_RELOC_TLV /* thread local variables */ +}; + +#endif /* _MACHO_RELOC_H_ */ diff --git a/i386/include/mach-o/stab.h b/i386/include/mach-o/stab.h new file mode 100644 index 0000000..e9e15b2 --- /dev/null +++ b/i386/include/mach-o/stab.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACHO_STAB_H_ +#define _MACHO_STAB_H_ +/* $NetBSD: stab.h,v 1.4 1994/10/26 00:56:25 cgd Exp $ */ + +/*- + * Copyright (c) 1991 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stab.h 5.2 (Berkeley) 4/4/91 + */ + +/* + * This file gives definitions supplementing <nlist.h> for permanent symbol + * table entries of Mach-O files. Modified from the BSD definitions. The + * modifications from the original definitions were changing what the values of + * what was the n_other field (an unused field) which is now the n_sect field. + * These modifications are required to support symbols in an arbitrary number of + * sections not just the three sections (text, data and bss) in a BSD file. + * The values of the defined constants have NOT been changed. + * + * These must have one of the N_STAB bits on. The n_value fields are subject + * to relocation according to the value of their n_sect field. So for types + * that refer to things in sections the n_sect field must be filled in with the + * proper section ordinal. For types that are not to have their n_value field + * relocatated the n_sect field must be NO_SECT. + */ + +/* + * Symbolic debugger symbols. The comments give the conventional use for + * + * .stabs "n_name", n_type, n_sect, n_desc, n_value + * + * where n_type is the defined constant and not listed in the comment. Other + * fields not listed are zero. n_sect is the section ordinal the entry is + * refering to. + */ +#define N_GSYM 0x20 /* global symbol: name,,NO_SECT,type,0 */ +#define N_FNAME 0x22 /* procedure name (f77 kludge): name,,NO_SECT,0,0 */ +#define N_FUN 0x24 /* procedure: name,,n_sect,linenumber,address */ +#define N_STSYM 0x26 /* static symbol: name,,n_sect,type,address */ +#define N_LCSYM 0x28 /* .lcomm symbol: name,,n_sect,type,address */ +#define N_BNSYM 0x2e /* begin nsect sym: 0,,n_sect,0,address */ +#define N_OPT 0x3c /* emitted with gcc2_compiled and in gcc source */ +#define N_RSYM 0x40 /* register sym: name,,NO_SECT,type,register */ +#define N_SLINE 0x44 /* src line: 0,,n_sect,linenumber,address */ +#define N_ENSYM 0x4e /* end nsect sym: 0,,n_sect,0,address */ +#define N_SSYM 0x60 /* structure elt: name,,NO_SECT,type,struct_offset */ +#define N_SO 0x64 /* source file name: name,,n_sect,0,address */ +#define N_OSO 0x66 /* object file name: name,,0,0,st_mtime */ +#define N_LSYM 0x80 /* local sym: name,,NO_SECT,type,offset */ +#define N_BINCL 0x82 /* include file beginning: name,,NO_SECT,0,sum */ +#define N_SOL 0x84 /* #included file name: name,,n_sect,0,address */ +#define N_PARAMS 0x86 /* compiler parameters: name,,NO_SECT,0,0 */ +#define N_VERSION 0x88 /* compiler version: name,,NO_SECT,0,0 */ +#define N_OLEVEL 0x8A /* compiler -O level: name,,NO_SECT,0,0 */ +#define N_PSYM 0xa0 /* parameter: name,,NO_SECT,type,offset */ +#define N_EINCL 0xa2 /* include file end: name,,NO_SECT,0,0 */ +#define N_ENTRY 0xa4 /* alternate entry: name,,n_sect,linenumber,address */ +#define N_LBRAC 0xc0 /* left bracket: 0,,NO_SECT,nesting level,address */ +#define N_EXCL 0xc2 /* deleted include file: name,,NO_SECT,0,sum */ +#define N_RBRAC 0xe0 /* right bracket: 0,,NO_SECT,nesting level,address */ +#define N_BCOMM 0xe2 /* begin common: name,,NO_SECT,0,0 */ +#define N_ECOMM 0xe4 /* end common: name,,n_sect,0,0 */ +#define N_ECOML 0xe8 /* end common (local name): 0,,n_sect,0,address */ +#define N_LENG 0xfe /* second stab entry with length information */ + +/* + * for the berkeley pascal compiler, pc(1): + */ +#define N_PC 0x30 /* global pascal symbol: name,,NO_SECT,subtype,line */ + +#endif /* _MACHO_STAB_H_ */ diff --git a/i386/include/mach-o/swap.h b/i386/include/mach-o/swap.h new file mode 100644 index 0000000..ba10994 --- /dev/null +++ b/i386/include/mach-o/swap.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_O_SWAP_H_ +#define _MACH_O_SWAP_H_ + +#include <stdint.h> +#include <architecture/byte_order.h> +#include <mach-o/fat.h> +#include <mach-o/loader.h> +#include <mach-o/nlist.h> +#include <mach-o/reloc.h> +#include <mach-o/ranlib.h> + +#if __cplusplus +extern "C" { +#endif /* __cplusplus */ + +extern void swap_fat_header( + struct fat_header *fat_header, + enum NXByteOrder target_byte_order); + +extern void swap_fat_arch( + struct fat_arch *fat_archs, + uint32_t nfat_arch, + enum NXByteOrder target_byte_order); + +extern void swap_mach_header( + struct mach_header *mh, + enum NXByteOrder target_byte_order); + +extern void swap_mach_header_64( + struct mach_header_64 *mh, + enum NXByteOrder target_byte_order); + +extern void swap_load_command( + struct load_command *lc, + enum NXByteOrder target_byte_order); + +extern void swap_segment_command( + struct segment_command *sg, + enum NXByteOrder target_byte_order); + +extern void swap_segment_command_64( + struct segment_command_64 *sg, + enum NXByteOrder target_byte_order); + +extern void swap_section( + struct section *s, + uint32_t nsects, + enum NXByteOrder target_byte_order); + +extern void swap_section_64( + struct section_64 *s, + uint32_t nsects, + enum NXByteOrder target_byte_order); + +extern void swap_symtab_command( + struct symtab_command *st, + enum NXByteOrder target_byte_order); + +extern void swap_dysymtab_command( + struct dysymtab_command *dyst, + enum NXByteOrder target_byte_sex); + +extern void swap_symseg_command( + struct symseg_command *ss, + enum NXByteOrder target_byte_order); + +extern void swap_fvmlib_command( + struct fvmlib_command *fl, + enum NXByteOrder target_byte_order); + +extern void swap_dylib_command( + struct dylib_command *dl, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_framework_command( + struct sub_framework_command *sub, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_umbrella_command( + struct sub_umbrella_command *usub, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_library_command( + struct sub_library_command *lsub, + enum NXByteOrder target_byte_sex); + +extern void swap_sub_client_command( + struct sub_client_command *csub, + enum NXByteOrder target_byte_sex); + +extern void swap_prebound_dylib_command( + struct prebound_dylib_command *pbdylib, + enum NXByteOrder target_byte_sex); + +extern void swap_dylinker_command( + struct dylinker_command *dyld, + enum NXByteOrder target_byte_sex); + +extern void swap_fvmfile_command( + struct fvmfile_command *ff, + enum NXByteOrder target_byte_order); + +extern void swap_thread_command( + struct thread_command *ut, + enum NXByteOrder target_byte_order); + +extern void swap_ident_command( + struct ident_command *ident, + enum NXByteOrder target_byte_order); + +extern void swap_routines_command( + struct routines_command *r_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_routines_command_64( + struct routines_command_64 *r_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_twolevel_hints_command( + struct twolevel_hints_command *hints_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_prebind_cksum_command( + struct prebind_cksum_command *cksum_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_uuid_command( + struct uuid_command *uuid_cmd, + enum NXByteOrder target_byte_sex); + +extern void swap_twolevel_hint( + struct twolevel_hint *hints, + uint32_t nhints, + enum NXByteOrder target_byte_sex); + +extern void swap_nlist( + struct nlist *symbols, + uint32_t nsymbols, + enum NXByteOrder target_byte_order); + +extern void swap_nlist_64( + struct nlist_64 *symbols, + uint32_t nsymbols, + enum NXByteOrder target_byte_order); + +extern void swap_ranlib( + struct ranlib *ranlibs, + uint32_t nranlibs, + enum NXByteOrder target_byte_order); + +extern void swap_relocation_info( + struct relocation_info *relocs, + uint32_t nrelocs, + enum NXByteOrder target_byte_order); + +extern void swap_indirect_symbols( + uint32_t *indirect_symbols, + uint32_t nindirect_symbols, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_reference( + struct dylib_reference *refs, + uint32_t nrefs, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_module( + struct dylib_module *mods, + uint32_t nmods, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_module_64( + struct dylib_module_64 *mods, + uint32_t nmods, + enum NXByteOrder target_byte_sex); + +extern void swap_dylib_table_of_contents( + struct dylib_table_of_contents *tocs, + uint32_t ntocs, + enum NXByteOrder target_byte_sex); + +#if __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MACH_O_SWAP_H_ */ diff --git a/i386/include/mach-o/x86_64/.svn/all-wcprops b/i386/include/mach-o/x86_64/.svn/all-wcprops new file mode 100644 index 0000000..5ebc2d2 --- /dev/null +++ b/i386/include/mach-o/x86_64/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/x86_64 +END +reloc.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach-o/x86_64/reloc.h +END diff --git a/i386/include/mach-o/x86_64/.svn/entries b/i386/include/mach-o/x86_64/.svn/entries new file mode 100644 index 0000000..598d796 --- /dev/null +++ b/i386/include/mach-o/x86_64/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach-o/x86_64 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +reloc.h +file + + + + +2013-08-27T23:54:36.000000Z +fe8574680ac83ef4936768fccf205829 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8341 + diff --git a/i386/include/mach-o/x86_64/.svn/text-base/reloc.h.svn-base b/i386/include/mach-o/x86_64/.svn/text-base/reloc.h.svn-base new file mode 100644 index 0000000..d3466d8 --- /dev/null +++ b/i386/include/mach-o/x86_64/.svn/text-base/reloc.h.svn-base @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Relocations for x86_64 are a bit different than for other architectures in + * Mach-O: Scattered relocations are not used. Almost all relocations produced + * by the compiler are external relocations. An external relocation has the + * r_extern bit set to 1 and the r_symbolnum field contains the symbol table + * index of the target label. + * + * When the assembler is generating relocations, if the target label is a local + * label (begins with 'L'), then the previous non-local label in the same + * section is used as the target of the external relocation. An addend is used + * with the distance from that non-local label to the target label. Only when + * there is no previous non-local label in the section is an internal + * relocation used. + * + * The addend (i.e. the 4 in _foo+4) is encoded in the instruction (Mach-O does + * not have RELA relocations). For PC-relative relocations, the addend is + * stored directly in the instruction. This is different from other Mach-O + * architectures, which encode the addend minus the current section offset. + * + * The relocation types are: + * + * X86_64_RELOC_UNSIGNED // for absolute addresses + * X86_64_RELOC_SIGNED // for signed 32-bit displacement + * X86_64_RELOC_BRANCH // a CALL/JMP instruction with 32-bit displacement + * X86_64_RELOC_GOT_LOAD // a MOVQ load of a GOT entry + * X86_64_RELOC_GOT // other GOT references + * X86_64_RELOC_SUBTRACTOR // must be followed by a X86_64_RELOC_UNSIGNED + * + * The following are sample assembly instructions, followed by the relocation + * and section content they generate in an object file: + * + * call _foo + * r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * E8 00 00 00 00 + * + * call _foo+4 + * r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * E8 04 00 00 00 + * + * movq _foo@GOTPCREL(%rip), %rax + * r_type=X86_64_RELOC_GOT_LOAD, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * 48 8B 05 00 00 00 00 + * + * pushq _foo@GOTPCREL(%rip) + * r_type=X86_64_RELOC_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * FF 35 00 00 00 00 + * + * movl _foo(%rip), %eax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * 8B 05 00 00 00 00 + * + * movl _foo+4(%rip), %eax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * 8B 05 04 00 00 00 + * + * movb $0x12, _foo(%rip) + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * C6 05 FF FF FF FF 12 + * + * movl $0x12345678, _foo(%rip) + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * C7 05 FC FF FF FF 78 56 34 12 + * + * .quad _foo + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 00 00 00 00 00 00 00 00 + * + * .quad _foo+4 + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 04 00 00 00 00 00 00 00 + * + * .quad _foo - _bar + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 00 00 00 00 00 00 00 00 + * + * .quad _foo - _bar + 4 + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 04 00 00 00 00 00 00 00 + * + * .long _foo - _bar + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar + * r_type=X86_64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 00 00 00 00 + * + * lea L1(%rip), %rax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_prev + * 48 8d 05 12 00 00 00 + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * lea L0(%rip), %rax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3 + * 48 8d 05 56 00 00 00 + * // assumes L0 is in third section and there is no previous non-local label. + * // The rip-relative-offset of 0x00000056 is L0-address_of_next_instruction. + * // address_of_next_instruction is the address of the relocation + 4. + * + * add $6,L0(%rip) + * r_type=X86_64_RELOC_SIGNED_1, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3 + * 83 05 18 00 00 00 06 + * // assumes L0 is in third section and there is no previous non-local label. + * // The rip-relative-offset of 0x00000018 is L0-address_of_next_instruction. + * // address_of_next_instruction is the address of the relocation + 4 + 1. + * // The +1 comes from SIGNED_1. This is used because the relocation is not + * // at the end of the instruction. + * + * .quad L1 + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev + * 12 00 00 00 00 00 00 00 + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * .quad L0 + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=0, r_pcrel=0, r_symbolnum=3 + * 56 00 00 00 00 00 00 00 + * // assumes L0 is in third section, has an address of 0x00000056 in .o + * // file, and there is no previous non-local label + * + * .quad _foo - . + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * EE FF FF FF FF FF FF FF + * // assumes _prev is the first non-local label 0x12 bytes before this + * // .quad + * + * .quad _foo - L1 + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * EE FF FF FF FF FF FF FF + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * .quad L1 - _prev + * // No relocations. This is an assembly time constant. + * 12 00 00 00 00 00 00 00 + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * + * + * In final linked images, there are only two valid relocation kinds: + * + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=1, r_symbolnum=sym_index + * This tells dyld to add the address of a symbol to a pointer sized (8-byte) + * piece of data (i.e on disk the 8-byte piece of data contains the addend). The + * r_symbolnum contains the index into the symbol table of the target symbol. + * + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=0, r_symbolnum=0 + * This tells dyld to adjust the pointer sized (8-byte) piece of data by the amount + * the containing image was loaded from its base address (e.g. slide). + * + */ +enum reloc_type_x86_64 +{ + X86_64_RELOC_UNSIGNED, // for absolute addresses + X86_64_RELOC_SIGNED, // for signed 32-bit displacement + X86_64_RELOC_BRANCH, // a CALL/JMP instruction with 32-bit displacement + X86_64_RELOC_GOT_LOAD, // a MOVQ load of a GOT entry + X86_64_RELOC_GOT, // other GOT references + X86_64_RELOC_SUBTRACTOR, // must be followed by a X86_64_RELOC_UNSIGNED + X86_64_RELOC_SIGNED_1, // for signed 32-bit displacement with a -1 addend + X86_64_RELOC_SIGNED_2, // for signed 32-bit displacement with a -2 addend + X86_64_RELOC_SIGNED_4, // for signed 32-bit displacement with a -4 addend + X86_64_RELOC_TLV, // for thread local variables +}; diff --git a/i386/include/mach-o/x86_64/reloc.h b/i386/include/mach-o/x86_64/reloc.h new file mode 100644 index 0000000..d3466d8 --- /dev/null +++ b/i386/include/mach-o/x86_64/reloc.h @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Relocations for x86_64 are a bit different than for other architectures in + * Mach-O: Scattered relocations are not used. Almost all relocations produced + * by the compiler are external relocations. An external relocation has the + * r_extern bit set to 1 and the r_symbolnum field contains the symbol table + * index of the target label. + * + * When the assembler is generating relocations, if the target label is a local + * label (begins with 'L'), then the previous non-local label in the same + * section is used as the target of the external relocation. An addend is used + * with the distance from that non-local label to the target label. Only when + * there is no previous non-local label in the section is an internal + * relocation used. + * + * The addend (i.e. the 4 in _foo+4) is encoded in the instruction (Mach-O does + * not have RELA relocations). For PC-relative relocations, the addend is + * stored directly in the instruction. This is different from other Mach-O + * architectures, which encode the addend minus the current section offset. + * + * The relocation types are: + * + * X86_64_RELOC_UNSIGNED // for absolute addresses + * X86_64_RELOC_SIGNED // for signed 32-bit displacement + * X86_64_RELOC_BRANCH // a CALL/JMP instruction with 32-bit displacement + * X86_64_RELOC_GOT_LOAD // a MOVQ load of a GOT entry + * X86_64_RELOC_GOT // other GOT references + * X86_64_RELOC_SUBTRACTOR // must be followed by a X86_64_RELOC_UNSIGNED + * + * The following are sample assembly instructions, followed by the relocation + * and section content they generate in an object file: + * + * call _foo + * r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * E8 00 00 00 00 + * + * call _foo+4 + * r_type=X86_64_RELOC_BRANCH, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * E8 04 00 00 00 + * + * movq _foo@GOTPCREL(%rip), %rax + * r_type=X86_64_RELOC_GOT_LOAD, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * 48 8B 05 00 00 00 00 + * + * pushq _foo@GOTPCREL(%rip) + * r_type=X86_64_RELOC_GOT, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * FF 35 00 00 00 00 + * + * movl _foo(%rip), %eax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * 8B 05 00 00 00 00 + * + * movl _foo+4(%rip), %eax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * 8B 05 04 00 00 00 + * + * movb $0x12, _foo(%rip) + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * C6 05 FF FF FF FF 12 + * + * movl $0x12345678, _foo(%rip) + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_foo + * C7 05 FC FF FF FF 78 56 34 12 + * + * .quad _foo + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 00 00 00 00 00 00 00 00 + * + * .quad _foo+4 + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 04 00 00 00 00 00 00 00 + * + * .quad _foo - _bar + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 00 00 00 00 00 00 00 00 + * + * .quad _foo - _bar + 4 + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_bar + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 04 00 00 00 00 00 00 00 + * + * .long _foo - _bar + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_bar + * r_type=X86_64_RELOC_UNSIGNED, r_length=2, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * 00 00 00 00 + * + * lea L1(%rip), %rax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=1, r_pcrel=1, r_symbolnum=_prev + * 48 8d 05 12 00 00 00 + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * lea L0(%rip), %rax + * r_type=X86_64_RELOC_SIGNED, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3 + * 48 8d 05 56 00 00 00 + * // assumes L0 is in third section and there is no previous non-local label. + * // The rip-relative-offset of 0x00000056 is L0-address_of_next_instruction. + * // address_of_next_instruction is the address of the relocation + 4. + * + * add $6,L0(%rip) + * r_type=X86_64_RELOC_SIGNED_1, r_length=2, r_extern=0, r_pcrel=1, r_symbolnum=3 + * 83 05 18 00 00 00 06 + * // assumes L0 is in third section and there is no previous non-local label. + * // The rip-relative-offset of 0x00000018 is L0-address_of_next_instruction. + * // address_of_next_instruction is the address of the relocation + 4 + 1. + * // The +1 comes from SIGNED_1. This is used because the relocation is not + * // at the end of the instruction. + * + * .quad L1 + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev + * 12 00 00 00 00 00 00 00 + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * .quad L0 + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=0, r_pcrel=0, r_symbolnum=3 + * 56 00 00 00 00 00 00 00 + * // assumes L0 is in third section, has an address of 0x00000056 in .o + * // file, and there is no previous non-local label + * + * .quad _foo - . + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * EE FF FF FF FF FF FF FF + * // assumes _prev is the first non-local label 0x12 bytes before this + * // .quad + * + * .quad _foo - L1 + * r_type=X86_64_RELOC_SUBTRACTOR, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_prev + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_extern=1, r_pcrel=0, r_symbolnum=_foo + * EE FF FF FF FF FF FF FF + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * .quad L1 - _prev + * // No relocations. This is an assembly time constant. + * 12 00 00 00 00 00 00 00 + * // assumes _prev is the first non-local label 0x12 bytes before L1 + * + * + * + * In final linked images, there are only two valid relocation kinds: + * + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=1, r_symbolnum=sym_index + * This tells dyld to add the address of a symbol to a pointer sized (8-byte) + * piece of data (i.e on disk the 8-byte piece of data contains the addend). The + * r_symbolnum contains the index into the symbol table of the target symbol. + * + * r_type=X86_64_RELOC_UNSIGNED, r_length=3, r_pcrel=0, r_extern=0, r_symbolnum=0 + * This tells dyld to adjust the pointer sized (8-byte) piece of data by the amount + * the containing image was loaded from its base address (e.g. slide). + * + */ +enum reloc_type_x86_64 +{ + X86_64_RELOC_UNSIGNED, // for absolute addresses + X86_64_RELOC_SIGNED, // for signed 32-bit displacement + X86_64_RELOC_BRANCH, // a CALL/JMP instruction with 32-bit displacement + X86_64_RELOC_GOT_LOAD, // a MOVQ load of a GOT entry + X86_64_RELOC_GOT, // other GOT references + X86_64_RELOC_SUBTRACTOR, // must be followed by a X86_64_RELOC_UNSIGNED + X86_64_RELOC_SIGNED_1, // for signed 32-bit displacement with a -1 addend + X86_64_RELOC_SIGNED_2, // for signed 32-bit displacement with a -2 addend + X86_64_RELOC_SIGNED_4, // for signed 32-bit displacement with a -4 addend + X86_64_RELOC_TLV, // for thread local variables +}; diff --git a/i386/include/mach/.svn/all-wcprops b/i386/include/mach/.svn/all-wcprops new file mode 100644 index 0000000..65fc937 --- /dev/null +++ b/i386/include/mach/.svn/all-wcprops @@ -0,0 +1,617 @@ +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach +END +kmod.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/kmod.h +END +clock.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock.h +END +ledger.defs +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ledger.defs +END +task.defs +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task.defs +END +thread_act.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_act.h +END +policy.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/policy.h +END +mach_host.defs +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_host.defs +END +security.defs +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/security.defs +END +clock_reply.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock_reply.h +END +vm_map.defs +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_map.defs +END +port_obj.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/port_obj.h +END +vm_map.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_map.h +END +mach_traps.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_traps.h +END +task_policy.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task_policy.h +END +memory_object_types.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/memory_object_types.h +END +exception_types.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/exception_types.h +END +ndr.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ndr.h +END +message.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/message.h +END +vm_prot.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_prot.h +END +mach_interface.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_interface.h +END +thread_act.defs +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_act.defs +END +error.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/error.h +END +task_special_ports.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task_special_ports.h +END +sdt.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/sdt.h +END +mach_init.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_init.h +END +host_security.defs +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_security.defs +END +clock_reply.defs +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock_reply.defs +END +host_special_ports.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_special_ports.h +END +vm_inherit.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_inherit.h +END +mig_errors.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mig_errors.h +END +mach.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach.h +END +mig.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mig.h +END +bootstrap.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/bootstrap.h +END +host_priv.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_priv.h +END +task_access.defs +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task_access.defs +END +task_info.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task_info.h +END +mach_error.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_error.h +END +clock_priv.defs +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock_priv.defs +END +vm_region.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_region.h +END +mach_types.defs +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_types.defs +END +mach_time.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_time.h +END +host_reboot.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_reboot.h +END +mach_param.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_param.h +END +processor_info.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/processor_info.h +END +processor_set.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/processor_set.h +END +time_value.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/time_value.h +END +clock_priv.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock_priv.h +END +vm_statistics.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_statistics.h +END +lock_set.defs +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/lock_set.defs +END +notify.defs +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/notify.defs +END +vm_param.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_param.h +END +lock_set.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/lock_set.h +END +machine.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine.h +END +host_security.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_security.h +END +vm_task.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_task.h +END +mach_host.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_host.h +END +mach_port.defs +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_port.defs +END +processor.defs +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/processor.defs +END +exc.defs +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/exc.defs +END +thread_status.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_status.h +END +mach_vm.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_vm.h +END +host_notify_reply.defs +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_notify_reply.defs +END +vm_sync.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_sync.h +END +std_types.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/std_types.h +END +processor.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/processor.h +END +exc.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/exc.h +END +thread_info.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_info.h +END +semaphore.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/semaphore.h +END +port.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/port.h +END +processor_set.defs +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/processor_set.defs +END +rpc.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/rpc.h +END +shared_memory_server.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/shared_memory_server.h +END +host_info.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_info.h +END +sync_policy.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/sync_policy.h +END +mach_types.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_types.h +END +exception.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/exception.h +END +kern_return.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/kern_return.h +END +thread_special_ports.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_special_ports.h +END +mach_exc.defs +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_exc.defs +END +vm_behavior.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_behavior.h +END +ledger.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ledger.h +END +task.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task.h +END +vm_purgable.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_purgable.h +END +mach_vm.defs +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_vm.defs +END +host_notify.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_notify.h +END +audit_triggers.defs +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/audit_triggers.defs +END +vm_types.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_types.h +END +host_priv.defs +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/host_priv.defs +END +notify.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/notify.h +END +std_types.defs +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/std_types.defs +END +clock_types.defs +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock_types.defs +END +shared_region.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/shared_region.h +END +mach_port.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_port.h +END +sync.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/sync.h +END +clock_types.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock_types.h +END +boolean.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/boolean.h +END +task_ledger.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/task_ledger.h +END +mach_syscalls.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/mach_syscalls.h +END +clock.defs +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/clock.defs +END +thread_policy.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_policy.h +END +thread_switch.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/thread_switch.h +END +vm_attributes.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/vm_attributes.h +END diff --git a/i386/include/mach/.svn/entries b/i386/include/mach/.svn/entries new file mode 100644 index 0000000..c418516 --- /dev/null +++ b/i386/include/mach/.svn/entries @@ -0,0 +1,3508 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +kmod.h +file + + + + +2013-08-27T23:54:46.000000Z +44eef501b084b2b5d69dfdeb3508b99a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6702 + +clock.h +file + + + + +2013-08-27T23:54:46.000000Z +3ae252404cedb489e385b22e226a371c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5222 + +ledger.defs +file + + + + +2013-08-27T23:54:46.000000Z +478caf5386ff8598ea08ea6a8ae38463 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2241 + +task.defs +file + + + + +2013-08-27T23:54:46.000000Z +86189259b490eee349d58626edf261fb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10391 + +thread_act.h +file + + + + +2013-08-27T23:54:46.000000Z +aeb2a97d0cbabbde38d44b7e1a322074 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1666 + +policy.h +file + + + + +2013-08-27T23:54:46.000000Z +98bb402ccb38e106e7f2003c5b317d22 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7119 + +mach_host.defs +file + + + + +2013-08-27T23:54:46.000000Z +d7e3228e63922c6494a6f06418c0d161 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6975 + +security.defs +file + + + + +2013-08-27T23:54:46.000000Z +4e5e4564be2d78b97c76344bc5c7b35d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6873 + +clock_reply.h +file + + + + +2013-08-27T23:54:46.000000Z +a8045a69c70e37a010cae193f6bda3b1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3595 + +vm_map.defs +file + + + + +2013-08-27T23:54:46.000000Z +67cbdc7d165583b88c39cc57ec691b8d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15209 + +port_obj.h +file + + + + +2013-08-27T23:54:46.000000Z +0cef8fa58347639341560658855047cb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3157 + +vm_map.h +file + + + + +2013-08-27T23:54:46.000000Z +5b2a822b7ae844275f7299efb362db98 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +29210 + +task_policy.h +file + + + + +2013-08-27T23:54:46.000000Z +90342e0bc6e597aef2b6836922bf5e2b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4264 + +mach_traps.h +file + + + + +2013-08-27T23:54:46.000000Z +087bae69e4180d0e7e4cbf83ebb1ba9b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4263 + +exception_types.h +file + + + + +2013-08-27T23:54:46.000000Z +49b3da18727443b201619a8020d0c079 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6118 + +memory_object_types.h +file + + + + +2013-08-27T23:54:46.000000Z +132b5a77945d15857486eb400827cd13 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8715 + +ndr.h +file + + + + +2013-08-27T23:54:46.000000Z +e4cdbf5d9a30a55931ddc79e1f549e61 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6686 + +message.h +file + + + + +2013-08-27T23:54:46.000000Z +2e59bfbfaa5500c7a7a048676426fffa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25315 + +vm_prot.h +file + + + + +2013-08-27T23:54:46.000000Z +4d3853a79219e118b3fb7dd3eaf3063a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4548 + +mach_interface.h +file + + + + +2013-08-27T23:54:46.000000Z +f9e8d68b505aad4e98c9af20f1aa1f39 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2091 + +thread_act.defs +file + + + + +2013-08-27T23:54:46.000000Z +02fd84f1dc55b44b3cb9943bc1e3e75d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9387 + +error.h +file + + + + +2013-08-27T23:54:46.000000Z +206c85e8bd39e794c465b9ef7d31c182 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3874 + +task_special_ports.h +file + + + + +2013-08-27T23:54:46.000000Z +2f2c56ef15222791e738659d81c5f467 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5011 + +sdt.h +file + + + + +2013-08-27T23:54:46.000000Z +cbb2e49b1d1936f8c519886f7073e96b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1046 + +mach_init.h +file + + + + +2013-08-27T23:54:46.000000Z +db84a248abe36ea1c78d437f065f3b26 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4263 + +host_security.defs +file + + + + +2013-08-27T23:54:46.000000Z +443251818344daebdf8e80ee525c40d4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3260 + +clock_reply.defs +file + + + + +2013-08-27T23:54:46.000000Z +5013f11e14806069e074a0c6d84dacf9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1925 + +i386 +dir + +vm_inherit.h +file + + + + +2013-08-27T23:54:46.000000Z +6669aa72ea8c61b73d7ab811cdb6ad30 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3204 + +host_special_ports.h +file + + + + +2013-08-27T23:54:46.000000Z +8e1dd96f7a996f30a6dd372efb654cad +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6984 + +mach.h +file + + + + +2013-08-27T23:54:46.000000Z +c2ebd1d24642eb32576d15105a82b1bd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4183 + +mig_errors.h +file + + + + +2013-08-27T23:54:46.000000Z +6a8cde8da252e967c7efe690ffd43fe0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4498 + +mig.h +file + + + + +2013-08-27T23:54:46.000000Z +b23b9d227641afe30b1e1a52f4a2863b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5557 + +bootstrap.h +file + + + + +2013-08-27T23:54:46.000000Z +714d3b5b14ce7f9d55e3dd0481041d09 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1508 + +host_priv.h +file + + + + +2013-08-27T23:54:46.000000Z +a1ad8007c32a2b3708211e06154562c9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +29067 + +task_access.defs +file + + + + +2013-08-27T23:54:46.000000Z +6b13b7ed764fb503d1b0893dba1dbab8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1992 + +task_info.h +file + + + + +2013-08-27T23:54:46.000000Z +43bdcaa09e225217b819af7b26474095 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9044 + +machine +dir + +mach_error.h +file + + + + +2013-08-27T23:54:46.000000Z +04030b122901b62ce8c7582304a01af7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3043 + +clock_priv.defs +file + + + + +2013-08-27T23:54:46.000000Z +d81bcb220f521f57db848f7c6ad6c634 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2143 + +vm_region.h +file + + + + +2013-08-27T23:54:46.000000Z +8afe8b73356d2c2b0eab19406a5c4a57 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11701 + +mach_types.defs +file + + + + +2013-08-27T23:54:46.000000Z +491f985e463dbbcf37763b27a27098e4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14899 + +mach_time.h +file + + + + +2013-08-27T23:54:46.000000Z +540f3701408ffb109177d51776626dcd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1862 + +host_reboot.h +file + + + + +2013-08-27T23:54:46.000000Z +a9ee76eb5fb0207a37a0d8407e2a11d0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1568 + +mach_param.h +file + + + + +2013-08-27T23:54:46.000000Z +40392d70d5543214a40dd63b0e612b14 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2712 + +processor_info.h +file + + + + +2013-08-27T23:54:46.000000Z +d3e3b514ffd3d16704adcfba2ceb965f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5800 + +processor_set.h +file + + + + +2013-08-27T23:54:46.000000Z +725b5e8470ac7364e3cfbfc4bd783deb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12271 + +time_value.h +file + + + + +2013-08-27T23:54:46.000000Z +2d41cff5c259307f7864c196983c7fbc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3328 + +clock_priv.h +file + + + + +2013-08-27T23:54:46.000000Z +831e25a160e76b9a7fdfc3d16da493ac +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4346 + +vm_statistics.h +file + + + + +2013-08-27T23:54:46.000000Z +c6ad1c572b76898ca7eb52ef6300d0d2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11342 + +ppc +dir + +lock_set.defs +file + + + + +2013-08-27T23:54:46.000000Z +6feb84d0d9fb5c2d69fea9c8629a70ed +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2209 + +notify.defs +file + + + + +2013-08-27T23:54:46.000000Z +1226fe93d7122ed3d22ffe5233b6365c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3901 + +vm_param.h +file + + + + +2013-08-27T23:54:46.000000Z +10afee7891927010285b7fba77a91007 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2696 + +lock_set.h +file + + + + +2013-08-27T23:54:46.000000Z +9037608f4266648ec8d9a92acb1d2144 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6916 + +machine.h +file + + + + +2013-08-27T23:54:46.000000Z +6498ec06319b1e947a92af05ec16795f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12107 + +host_security.h +file + + + + +2013-08-27T23:54:46.000000Z +fd1e0a293672bc0ddc94cb9ad0813e13 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5399 + +vm_task.h +file + + + + +2013-08-27T23:54:46.000000Z +bd7cb78d6ae98e6b001bb6488a36bb74 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1549 + +mach_host.h +file + + + + +2013-08-27T23:54:46.000000Z +51a00fb0910d6bfbba68925177ece433 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20340 + +mach_port.defs +file + + + + +2013-08-27T23:54:46.000000Z +04e006d44ecd8a1f67e6eb7e9f15e203 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14119 + +processor.defs +file + + + + +2013-08-27T23:54:46.000000Z +b0914d5f0bcd8e357f16873cb3da2202 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3722 + +exc.defs +file + + + + +2013-08-27T23:54:46.000000Z +7385e698fc609a8b7b296f6f806d9482 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3959 + +host_notify_reply.defs +file + + + + +2013-08-27T23:54:46.000000Z +4b07fc4e282f192910d30574e38b5b88 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1561 + +mach_vm.h +file + + + + +2013-08-27T23:54:46.000000Z +7dc64d21e894ef3a8b44f8776dda9c77 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22786 + +thread_status.h +file + + + + +2013-08-27T23:54:46.000000Z +28cd56f338ae14c2757f995159c99ee8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3492 + +std_types.h +file + + + + +2013-08-27T23:54:46.000000Z +0ddaa947ff41f3503f8074f0b3a758b8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2693 + +vm_sync.h +file + + + + +2013-08-27T23:54:46.000000Z +c26bde47d75c0d8b3738fcdd3906f74c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3029 + +processor.h +file + + + + +2013-08-27T23:54:46.000000Z +8ee837c9310735f2d7889b27ea82e067 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7816 + +exc.h +file + + + + +2013-08-27T23:54:46.000000Z +a47e1ee20cd41b75e57a894be7c0d7fc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6389 + +thread_info.h +file + + + + +2013-08-27T23:54:46.000000Z +f4b61879f561e4efe2b154edccadcdda +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5478 + +semaphore.h +file + + + + +2013-08-27T23:54:46.000000Z +dc2d3e7f8c4cd24908885834b8761a40 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2765 + +port.h +file + + + + +2013-08-27T23:54:46.000000Z +aee21bedfd822e444d6cc79e6bb547dc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11881 + +processor_set.defs +file + + + + +2013-08-27T23:54:46.000000Z +4a839b326970b1ad22c2266bfe258702 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4761 + +rpc.h +file + + + + +2013-08-27T23:54:46.000000Z +30ef79a9e1a62ce9514ddfd10a981742 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4917 + +shared_memory_server.h +file + + + + +2013-08-27T23:54:46.000000Z +eef216a640e9a21d93d76555fdb063e0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4480 + +host_info.h +file + + + + +2013-08-27T23:54:46.000000Z +217cd04d64eb6aab39b306d86857e9d3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7787 + +sync_policy.h +file + + + + +2013-08-27T23:54:46.000000Z +6367ea8a1c01882222e66945f357af43 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1796 + +mach_types.h +file + + + + +2013-08-27T23:54:46.000000Z +65497515a90889c1892481317148e4ed +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7865 + +exception.h +file + + + + +2013-08-27T23:54:46.000000Z +6854000e2d3e313911f6b2f70f44b5de +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2530 + +kern_return.h +file + + + + +2013-08-27T23:54:46.000000Z +2e7e741fce64cb0a861a8070bd00513b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9138 + +thread_special_ports.h +file + + + + +2013-08-27T23:54:46.000000Z +9e1d40e00f245b99e8d864da3e0a5800 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3125 + +mach_exc.defs +file + + + + +2013-08-27T23:54:46.000000Z +79feeeeb605bb6f88b1c647164cd3963 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3996 + +vm_behavior.h +file + + + + +2013-08-27T23:54:46.000000Z +518a2d7141a2dd257d708ddcac268095 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2914 + +ledger.h +file + + + + +2013-08-27T23:54:46.000000Z +3e40f1ddf9f9dfec10af0a55b4409493 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5972 + +task.h +file + + + + +2013-08-27T23:54:46.000000Z +6ea36d423bc2b6e09c3894b4777bebf8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1636 + +vm_purgable.h +file + + + + +2013-08-27T23:54:46.000000Z +e989e407554d793ff06a2ce4e770e003 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5872 + +mach_vm.defs +file + + + + +2013-08-27T23:54:46.000000Z +7e3fda746851cbeeb9d69969cce45638 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15353 + +host_notify.h +file + + + + +2013-08-27T23:54:46.000000Z +ec18ca207f65ea7c2a33f348a4a3b7e6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1544 + +audit_triggers.defs +file + + + + +2013-08-27T23:54:46.000000Z +a681daba6246804d65a8e646002bf673 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1947 + +vm_types.h +file + + + + +2013-08-27T23:54:46.000000Z +738d514b9597a5a5f314ad9713bd7a6e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3074 + +host_priv.defs +file + + + + +2013-08-27T23:54:46.000000Z +c2f349b43fb13e58f77c117a232b228a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11599 + +x86_64 +dir + +notify.h +file + + + + +2013-08-27T23:54:46.000000Z +86c11963c3ec7ba495b34478182722df +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4777 + +std_types.defs +file + + + + +2013-08-27T23:54:46.000000Z +94dae8bdd7168726f7e8e32f4e817466 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4965 + +clock_types.defs +file + + + + +2013-08-27T23:54:46.000000Z +01cce421f19ba19cbced48e5be7771b3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2386 + +shared_region.h +file + + + + +2013-08-27T23:54:46.000000Z +b34af1acba8235a31de3e95c46f9e144 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5563 + +mach_port.h +file + + + + +2013-08-27T23:54:46.000000Z +791d6ec71029aed5619653106ce8ec99 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +30666 + +sync.h +file + + + + +2013-08-27T23:54:46.000000Z +a63e99ffe206ad17ddad2c7c55f87421 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1625 + +clock_types.h +file + + + + +2013-08-27T23:54:46.000000Z +71d7449c60f382f7f306026a8fea6b5c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4054 + +boolean.h +file + + + + +2013-08-27T23:54:46.000000Z +8b6c3ff820b2771617ef4ab55df67274 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2824 + +task_ledger.h +file + + + + +2013-08-27T23:54:46.000000Z +0c5316ba2c691dd14bb90d240e8ec56f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1800 + +mach_syscalls.h +file + + + + +2013-08-27T23:54:46.000000Z +a332196ce8b866eb9df49aea5e9b1414 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1495 + +clock.defs +file + + + + +2013-08-27T23:54:46.000000Z +6c980b841875af5f0cbc7d82d3b04145 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2454 + +thread_policy.h +file + + + + +2013-08-27T23:54:46.000000Z +ac69cb67e0e024878dd437e03bc8503d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6978 + +thread_switch.h +file + + + + +2013-08-27T23:54:46.000000Z +4d6cb90477f1ad7103dcf8c7b800e532 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2837 + +vm_attributes.h +file + + + + +2013-08-27T23:54:46.000000Z +ee1131506060fe5438d1f527140f9971 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3666 + diff --git a/i386/include/mach/.svn/text-base/audit_triggers.defs.svn-base b/i386/include/mach/.svn/text-base/audit_triggers.defs.svn-base new file mode 100644 index 0000000..1d6e279 --- /dev/null +++ b/i386/include/mach/.svn/text-base/audit_triggers.defs.svn-base @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004-2008, Apple Inc. All rights reserved. + * + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ +*/ + +/* + * Interface definition for the audit logging facility. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ + audit_triggers 123; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +simpleroutine audit_triggers( + audit_port : mach_port_t; + in flags : int); + diff --git a/i386/include/mach/.svn/text-base/boolean.h.svn-base b/i386/include/mach/.svn/text-base/boolean.h.svn-base new file mode 100644 index 0000000..641c396 --- /dev/null +++ b/i386/include/mach/.svn/text-base/boolean.h.svn-base @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/boolean.h + * + * Boolean data type. + * + */ + +#ifndef _MACH_BOOLEAN_H_ +#define _MACH_BOOLEAN_H_ + +/* + * Pick up "boolean_t" type definition + */ + +#ifndef ASSEMBLER +#include <mach/machine/boolean.h> +#endif /* ASSEMBLER */ + +/* + * Define TRUE and FALSE if not defined. + */ + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ + +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + +#endif /* _MACH_BOOLEAN_H_ */ diff --git a/i386/include/mach/.svn/text-base/bootstrap.h.svn-base b/i386/include/mach/.svn/text-base/bootstrap.h.svn-base new file mode 100644 index 0000000..67667c3 --- /dev/null +++ b/i386/include/mach/.svn/text-base/bootstrap.h.svn-base @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach bootstrap interfaces (obsolete: header included only for compatibility) + */ +#ifndef _MACH_BOOTSTRAP_H_ +#define _MACH_BOOTSTRAP_H_ + +#endif /* _MACH_BOOTSTRAP_H_ */ diff --git a/i386/include/mach/.svn/text-base/clock.defs.svn-base b/i386/include/mach/.svn/text-base/clock.defs.svn-base new file mode 100644 index 0000000..440042c --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock.defs.svn-base @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/clock.defs + * Purpose: Kernel clock subsystem definitions. This + * file defines the clock request interface. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + clock 1000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> + +/* + * References to clock objects are returned by: + * host_get_clock_service(host_t,...) + * host_get_clock_control(host_priv_t,...) - Priviledged subclass + */ + +/* + * Get the clock time. + * Available to all. + */ +routine clock_get_time( + clock_serv : clock_serv_t; + out cur_time : mach_timespec_t); + +/* + * Get clock attributes. + * Available to all. + */ +routine clock_get_attributes( + clock_serv : clock_serv_t; + in flavor : clock_flavor_t; + out clock_attr : clock_attr_t, CountInOut); + +/* + * Setup a clock alarm. + * Available to all. + */ +routine clock_alarm( + clock_serv : clock_serv_t; + alarm_type : alarm_type_t; + alarm_time : mach_timespec_t; + alarm_port : clock_reply_t = + MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/clock.h.svn-base b/i386/include/mach/.svn/text-base/clock.h.svn-base new file mode 100644 index 0000000..948b489 --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock.h.svn-base @@ -0,0 +1,221 @@ +#ifndef _clock_user_ +#define _clock_user_ + +/* Module clock */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef clock_MSG_COUNT +#define clock_MSG_COUNT 3 +#endif /* clock_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine clock_get_time */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_get_time +( + clock_serv_t clock_serv, + mach_timespec_t *cur_time +); + +/* Routine clock_get_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_get_attributes +( + clock_serv_t clock_serv, + clock_flavor_t flavor, + clock_attr_t clock_attr, + mach_msg_type_number_t *clock_attrCnt +); + +/* Routine clock_alarm */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_alarm +( + clock_serv_t clock_serv, + alarm_type_t alarm_type, + mach_timespec_t alarm_time, + clock_reply_t alarm_port +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__clock_subsystem__defined +#define __Request__clock_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__clock_get_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_flavor_t flavor; + mach_msg_type_number_t clock_attrCnt; + } __Request__clock_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t alarm_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + alarm_type_t alarm_type; + mach_timespec_t alarm_time; + } __Request__clock_alarm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__clock_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__clock_subsystem__defined +#define __RequestUnion__clock_subsystem__defined +union __RequestUnion__clock_subsystem { + __Request__clock_get_time_t Request_clock_get_time; + __Request__clock_get_attributes_t Request_clock_get_attributes; + __Request__clock_alarm_t Request_clock_alarm; +}; +#endif /* !__RequestUnion__clock_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__clock_subsystem__defined +#define __Reply__clock_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_timespec_t cur_time; + } __Reply__clock_get_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t clock_attrCnt; + int clock_attr[1]; + } __Reply__clock_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_alarm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__clock_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__clock_subsystem__defined +#define __ReplyUnion__clock_subsystem__defined +union __ReplyUnion__clock_subsystem { + __Reply__clock_get_time_t Reply_clock_get_time; + __Reply__clock_get_attributes_t Reply_clock_get_attributes; + __Reply__clock_alarm_t Reply_clock_alarm; +}; +#endif /* !__RequestUnion__clock_subsystem__defined */ + +#ifndef subsystem_to_name_map_clock +#define subsystem_to_name_map_clock \ + { "clock_get_time", 1000 },\ + { "clock_get_attributes", 1001 },\ + { "clock_alarm", 1002 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _clock_user_ */ diff --git a/i386/include/mach/.svn/text-base/clock_priv.defs.svn-base b/i386/include/mach/.svn/text-base/clock_priv.defs.svn-base new file mode 100644 index 0000000..b3854a4 --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock_priv.defs.svn-base @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/clock_priv.defs + * Purpose: Kernel clock subsystem definitions. This + * file defines the clock request interface. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + clock_priv 1200; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> + +/* + * References to clock_priv objects are returned by: + * host_get_clock_control(host_priv_t,...) - Priviledged subclass + */ + +/* + * Set the clock time. + * Privileged. + */ +routine clock_set_time( + clock_ctrl : clock_ctrl_t; + new_time : mach_timespec_t); + +/* + * Set clock attributes. + * Privileged. + */ +routine clock_set_attributes( + clock_ctrl : clock_ctrl_t; + in flavor : clock_flavor_t; + in clock_attr : clock_attr_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/clock_priv.h.svn-base b/i386/include/mach/.svn/text-base/clock_priv.h.svn-base new file mode 100644 index 0000000..8a38935 --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock_priv.h.svn-base @@ -0,0 +1,175 @@ +#ifndef _clock_priv_user_ +#define _clock_priv_user_ + +/* Module clock_priv */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef clock_priv_MSG_COUNT +#define clock_priv_MSG_COUNT 2 +#endif /* clock_priv_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine clock_set_time */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_set_time +( + clock_ctrl_t clock_ctrl, + mach_timespec_t new_time +); + +/* Routine clock_set_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_set_attributes +( + clock_ctrl_t clock_ctrl, + clock_flavor_t flavor, + clock_attr_t clock_attr, + mach_msg_type_number_t clock_attrCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__clock_priv_subsystem__defined +#define __Request__clock_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_timespec_t new_time; + } __Request__clock_set_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_flavor_t flavor; + mach_msg_type_number_t clock_attrCnt; + int clock_attr[1]; + } __Request__clock_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__clock_priv_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__clock_priv_subsystem__defined +#define __RequestUnion__clock_priv_subsystem__defined +union __RequestUnion__clock_priv_subsystem { + __Request__clock_set_time_t Request_clock_set_time; + __Request__clock_set_attributes_t Request_clock_set_attributes; +}; +#endif /* !__RequestUnion__clock_priv_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__clock_priv_subsystem__defined +#define __Reply__clock_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_set_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__clock_priv_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__clock_priv_subsystem__defined +#define __ReplyUnion__clock_priv_subsystem__defined +union __ReplyUnion__clock_priv_subsystem { + __Reply__clock_set_time_t Reply_clock_set_time; + __Reply__clock_set_attributes_t Reply_clock_set_attributes; +}; +#endif /* !__RequestUnion__clock_priv_subsystem__defined */ + +#ifndef subsystem_to_name_map_clock_priv +#define subsystem_to_name_map_clock_priv \ + { "clock_set_time", 1200 },\ + { "clock_set_attributes", 1201 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _clock_priv_user_ */ diff --git a/i386/include/mach/.svn/text-base/clock_reply.defs.svn-base b/i386/include/mach/.svn/text-base/clock_reply.defs.svn-base new file mode 100644 index 0000000..9646f90 --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock_reply.defs.svn-base @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: clock_reply.defs + * Purpose: Kernel clock subsystem definitions. This + * file defines the clock reply interface. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ + clock_reply 3125107; /* Matches up with old value */ + +#include <mach/std_types.defs> +#include <mach/clock_types.defs> + + +/* + * Reply routine for clock_alarm. + */ +simpleroutine clock_alarm_reply( + alarm_port : clock_reply_t; + alarm_code : kern_return_t; + alarm_type : alarm_type_t; + alarm_time : mach_timespec_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/clock_reply.h.svn-base b/i386/include/mach/.svn/text-base/clock_reply.h.svn-base new file mode 100644 index 0000000..d0cf150 --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock_reply.h.svn-base @@ -0,0 +1,136 @@ +#ifndef _clock_reply_user_ +#define _clock_reply_user_ + +/* Module clock_reply */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef clock_reply_MSG_COUNT +#define clock_reply_MSG_COUNT 1 +#endif /* clock_reply_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* SimpleRoutine clock_alarm_reply */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_alarm_reply +( + clock_reply_t alarm_port, + mach_msg_type_name_t alarm_portPoly, + kern_return_t alarm_code, + alarm_type_t alarm_type, + mach_timespec_t alarm_time +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__clock_reply_subsystem__defined +#define __Request__clock_reply_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t alarm_code; + alarm_type_t alarm_type; + mach_timespec_t alarm_time; + } __Request__clock_alarm_reply_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__clock_reply_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__clock_reply_subsystem__defined +#define __RequestUnion__clock_reply_subsystem__defined +union __RequestUnion__clock_reply_subsystem { + __Request__clock_alarm_reply_t Request_clock_alarm_reply; +}; +#endif /* !__RequestUnion__clock_reply_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__clock_reply_subsystem__defined +#define __Reply__clock_reply_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_alarm_reply_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__clock_reply_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__clock_reply_subsystem__defined +#define __ReplyUnion__clock_reply_subsystem__defined +union __ReplyUnion__clock_reply_subsystem { + __Reply__clock_alarm_reply_t Reply_clock_alarm_reply; +}; +#endif /* !__RequestUnion__clock_reply_subsystem__defined */ + +#ifndef subsystem_to_name_map_clock_reply +#define subsystem_to_name_map_clock_reply \ + { "clock_alarm_reply", 3125107 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _clock_reply_user_ */ diff --git a/i386/include/mach/.svn/text-base/clock_types.defs.svn-base b/i386/include/mach/.svn/text-base/clock_types.defs.svn-base new file mode 100644 index 0000000..4dbacfc --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock_types.defs.svn-base @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: clock_types.defs + * Purpose: + * Clock kernel interface type declarations + */ + +#ifndef _MACH_CLOCK_TYPES_DEFS_ +#define _MACH_CLOCK_TYPES_DEFS_ + +#include <mach/std_types.defs> + +type clock_serv_t = mach_port_t + cusertype: clock_serv_t +#if KERNEL_SERVER + intran: clock_serv_t convert_port_to_clock(mach_port_t) + outtran: mach_port_t convert_clock_to_port(clock_serv_t) +#endif /* KERNEL_SERVER */ + ; + +type clock_ctrl_t = mach_port_t + cusertype: clock_ctrl_t +#if KERNEL_SERVER + intran: clock_ctrl_t convert_port_to_clock_ctrl(mach_port_t) + outtran: mach_port_t convert_clock_ctrl_to_port(clock_ctrl_t) +#endif /* KERNEL_SERVER */ + ; + +type clock_reply_t = polymorphic|MACH_MSG_TYPE_MAKE_SEND_ONCE; + +type clock_flavor_t = int; +type clock_attr_t = array[*:1] of int; +type mach_timespec_t = struct[2] of int; +type time_t = int; +type sleep_type_t = int; +type alarm_type_t = int; +type clock_res_t = int; +type clock_id_t = int; + +import <mach/mach_types.h>; + +#endif /* _MACH_CLOCK_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/clock_types.h.svn-base b/i386/include/mach/.svn/text-base/clock_types.h.svn-base new file mode 100644 index 0000000..12035da --- /dev/null +++ b/i386/include/mach/.svn/text-base/clock_types.h.svn-base @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: clock_types.h + * Purpose: Clock facility header definitions. These + * definitons are needed by both kernel and + * user-level software. + */ + +/* + * All interfaces defined here are obsolete. + */ + +#ifndef _MACH_CLOCK_TYPES_H_ +#define _MACH_CLOCK_TYPES_H_ + +#include <stdint.h> +#include <mach/time_value.h> + +/* + * Type definitions. + */ +typedef int alarm_type_t; /* alarm time type */ +typedef int sleep_type_t; /* sleep time type */ +typedef int clock_id_t; /* clock identification type */ +typedef int clock_flavor_t; /* clock flavor type */ +typedef int *clock_attr_t; /* clock attribute type */ +typedef int clock_res_t; /* clock resolution type */ + +/* + * Normal time specification used by the kernel clock facility. + */ +struct mach_timespec { + unsigned int tv_sec; /* seconds */ + clock_res_t tv_nsec; /* nanoseconds */ +}; +typedef struct mach_timespec mach_timespec_t; + +/* + * Reserved clock id values for default clocks. + */ +#define SYSTEM_CLOCK 0 +#define CALENDAR_CLOCK 1 + +#define REALTIME_CLOCK 0 + +/* + * Attribute names. + */ +#define CLOCK_GET_TIME_RES 1 /* get_time call resolution */ +/* 2 * was map_time call resolution */ +#define CLOCK_ALARM_CURRES 3 /* current alarm resolution */ +#define CLOCK_ALARM_MINRES 4 /* minimum alarm resolution */ +#define CLOCK_ALARM_MAXRES 5 /* maximum alarm resolution */ + +#define NSEC_PER_USEC 1000 /* nanoseconds per microsecond */ +#define USEC_PER_SEC 1000000 /* microseconds per second */ +#define NSEC_PER_SEC 1000000000 /* nanoseconds per second */ + +#define BAD_MACH_TIMESPEC(t) \ + ((t)->tv_nsec < 0 || (t)->tv_nsec >= NSEC_PER_SEC) + +/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */ +#define CMP_MACH_TIMESPEC(t1, t2) \ + ((t1)->tv_sec > (t2)->tv_sec ? +NSEC_PER_SEC : \ + ((t1)->tv_sec < (t2)->tv_sec ? -NSEC_PER_SEC : \ + (t1)->tv_nsec - (t2)->tv_nsec)) + +/* t1 += t2 */ +#define ADD_MACH_TIMESPEC(t1, t2) \ + do { \ + if (((t1)->tv_nsec += (t2)->tv_nsec) >= NSEC_PER_SEC) { \ + (t1)->tv_nsec -= NSEC_PER_SEC; \ + (t1)->tv_sec += 1; \ + } \ + (t1)->tv_sec += (t2)->tv_sec; \ + } while (0) + +/* t1 -= t2 */ +#define SUB_MACH_TIMESPEC(t1, t2) \ + do { \ + if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \ + (t1)->tv_nsec += NSEC_PER_SEC; \ + (t1)->tv_sec -= 1; \ + } \ + (t1)->tv_sec -= (t2)->tv_sec; \ + } while (0) + +/* + * Alarm parameter defines. + */ +#define ALRMTYPE 0xff /* type (8-bit field) */ +#define TIME_ABSOLUTE 0x00 /* absolute time */ +#define TIME_RELATIVE 0x01 /* relative time */ + +#define BAD_ALRMTYPE(t) (((t) &~ TIME_RELATIVE) != 0) + +#endif /* _MACH_CLOCK_TYPES_H_ */ diff --git a/i386/include/mach/.svn/text-base/error.h.svn-base b/i386/include/mach/.svn/text-base/error.h.svn-base new file mode 100644 index 0000000..a32eaee --- /dev/null +++ b/i386/include/mach/.svn/text-base/error.h.svn-base @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/error.h + * Purpose: + * error module definitions + * + */ + +#ifndef _MACH_ERROR_H_ +#define _MACH_ERROR_H_ + +#include <mach/kern_return.h> + +/* + * error number layout as follows: + * + * hi lo + * | system(6) | subsystem(12) | code(14) | + */ + + +#define err_none (mach_error_t)0 +#define ERR_SUCCESS (mach_error_t)0 +#define ERR_ROUTINE_NIL (mach_error_fn_t)0 + + +#define err_system(x) (((x)&0x3f)<<26) +#define err_sub(x) (((x)&0xfff)<<14) + +#define err_get_system(err) (((err)>>26)&0x3f) +#define err_get_sub(err) (((err)>>14)&0xfff) +#define err_get_code(err) ((err)&0x3fff) + +#define system_emask (err_system(0x3f)) +#define sub_emask (err_sub(0xfff)) +#define code_emask (0x3fff) + + +/* major error systems */ +#define err_kern err_system(0x0) /* kernel */ +#define err_us err_system(0x1) /* user space library */ +#define err_server err_system(0x2) /* user space servers */ +#define err_ipc err_system(0x3) /* old ipc errors */ +#define err_mach_ipc err_system(0x4) /* mach-ipc errors */ +#define err_dipc err_system(0x7) /* distributed ipc */ +#define err_local err_system(0x3e) /* user defined errors */ +#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */ + +#define err_max_system 0x3f + + +/* unix errors get lumped into one subsystem */ +#define unix_err(errno) (err_kern|err_sub(3)|errno) + +typedef kern_return_t mach_error_t; +typedef mach_error_t (* mach_error_fn_t)( void ); + +#endif /* _MACH_ERROR_H_ */ diff --git a/i386/include/mach/.svn/text-base/exc.defs.svn-base b/i386/include/mach/.svn/text-base/exc.defs.svn-base new file mode 100644 index 0000000..de6aee7 --- /dev/null +++ b/i386/include/mach/.svn/text-base/exc.defs.svn-base @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Abstract: + * MiG definitions file for Mach exception interface. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif + exc 2401; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +ServerPrefix catch_; + +type exception_data_t = array[*:2] of integer_t; +type exception_type_t = int; + +routine exception_raise( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : exception_data_t + ); + +routine exception_raise_state( +#if KERNEL_USER + exception_port : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : exception_data_t, const; + inout flavor : int; + old_state : thread_state_t, const; + out new_state : thread_state_t); + +routine exception_raise_state_identity( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : exception_data_t; + inout flavor : int; + old_state : thread_state_t; + out new_state : thread_state_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/exc.h.svn-base b/i386/include/mach/.svn/text-base/exc.h.svn-base new file mode 100644 index 0000000..3987a6e --- /dev/null +++ b/i386/include/mach/.svn/text-base/exc.h.svn-base @@ -0,0 +1,257 @@ +#ifndef _exc_user_ +#define _exc_user_ + +/* Module exc */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef exc_MSG_COUNT +#define exc_MSG_COUNT 3 +#endif /* exc_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine exception_raise */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t exception_raise +( + mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt +); + +/* Routine exception_raise_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t exception_raise_state +( + mach_port_t exception_port, + exception_type_t exception, + const exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + const thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt +); + +/* Routine exception_raise_state_identity */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t exception_raise_state_identity +( + mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__exc_subsystem__defined +#define __Request__exc_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + } __Request__exception_raise_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + int flavor; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Request__exception_raise_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + int flavor; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Request__exception_raise_state_identity_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__exc_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__exc_subsystem__defined +#define __RequestUnion__exc_subsystem__defined +union __RequestUnion__exc_subsystem { + __Request__exception_raise_t Request_exception_raise; + __Request__exception_raise_state_t Request_exception_raise_state; + __Request__exception_raise_state_identity_t Request_exception_raise_state_identity; +}; +#endif /* !__RequestUnion__exc_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__exc_subsystem__defined +#define __Reply__exc_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__exception_raise_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Reply__exception_raise_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Reply__exception_raise_state_identity_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__exc_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__exc_subsystem__defined +#define __ReplyUnion__exc_subsystem__defined +union __ReplyUnion__exc_subsystem { + __Reply__exception_raise_t Reply_exception_raise; + __Reply__exception_raise_state_t Reply_exception_raise_state; + __Reply__exception_raise_state_identity_t Reply_exception_raise_state_identity; +}; +#endif /* !__RequestUnion__exc_subsystem__defined */ + +#ifndef subsystem_to_name_map_exc +#define subsystem_to_name_map_exc \ + { "exception_raise", 2401 },\ + { "exception_raise_state", 2402 },\ + { "exception_raise_state_identity", 2403 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _exc_user_ */ diff --git a/i386/include/mach/.svn/text-base/exception.h.svn-base b/i386/include/mach/.svn/text-base/exception.h.svn-base new file mode 100644 index 0000000..e7d5d23 --- /dev/null +++ b/i386/include/mach/.svn/text-base/exception.h.svn-base @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +#ifndef _MACH_EXCEPTION_H_ +#define _MACH_EXCEPTION_H_ + +#include <mach/exception_types.h> + +#endif /* _MACH_EXCEPTION_H_ */ diff --git a/i386/include/mach/.svn/text-base/exception_types.h.svn-base b/i386/include/mach/.svn/text-base/exception_types.h.svn-base new file mode 100644 index 0000000..642cbe2 --- /dev/null +++ b/i386/include/mach/.svn/text-base/exception_types.h.svn-base @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_EXCEPTION_TYPES_H_ +#define _MACH_EXCEPTION_TYPES_H_ + +#include <mach/machine/exception.h> + +/* + * Machine-independent exception definitions. + */ + +#define EXC_BAD_ACCESS 1 /* Could not access memory */ + /* Code contains kern_return_t describing error. */ + /* Subcode contains bad memory address. */ + +#define EXC_BAD_INSTRUCTION 2 /* Instruction failed */ + /* Illegal or undefined instruction or operand */ + +#define EXC_ARITHMETIC 3 /* Arithmetic exception */ + /* Exact nature of exception is in code field */ + +#define EXC_EMULATION 4 /* Emulation instruction */ + /* Emulation support instruction encountered */ + /* Details in code and subcode fields */ + +#define EXC_SOFTWARE 5 /* Software generated exception */ + /* Exact exception is in code field. */ + /* Codes 0 - 0xFFFF reserved to hardware */ + /* Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) */ + +#define EXC_BREAKPOINT 6 /* Trace, breakpoint, etc. */ + /* Details in code field. */ + +#define EXC_SYSCALL 7 /* System calls. */ + +#define EXC_MACH_SYSCALL 8 /* Mach system calls. */ + +#define EXC_RPC_ALERT 9 /* RPC alert */ + +#define EXC_CRASH 10 /* Abnormal process exit */ + +/* + * Machine-independent exception behaviors + */ + +# define EXCEPTION_DEFAULT 1 +/* Send a catch_exception_raise message including the identity. + */ + +# define EXCEPTION_STATE 2 +/* Send a catch_exception_raise_state message including the + * thread state. + */ + +# define EXCEPTION_STATE_IDENTITY 3 +/* Send a catch_exception_raise_state_identity message including + * the thread identity and state. + */ + +#define MACH_EXCEPTION_CODES 0x80000000 +/* Send 64-bit code and subcode in the exception header */ + +/* + * Masks for exception definitions, above + * bit zero is unused, therefore 1 word = 31 exception types + */ + +#define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS) +#define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION) +#define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC) +#define EXC_MASK_EMULATION (1 << EXC_EMULATION) +#define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE) +#define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT) +#define EXC_MASK_SYSCALL (1 << EXC_SYSCALL) +#define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL) +#define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT) +#define EXC_MASK_CRASH (1 << EXC_CRASH) + +#define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | \ + EXC_MASK_BAD_INSTRUCTION | \ + EXC_MASK_ARITHMETIC | \ + EXC_MASK_EMULATION | \ + EXC_MASK_SOFTWARE | \ + EXC_MASK_BREAKPOINT | \ + EXC_MASK_SYSCALL | \ + EXC_MASK_MACH_SYSCALL | \ + EXC_MASK_RPC_ALERT | \ + EXC_MASK_MACHINE) + + +#define FIRST_EXCEPTION 1 /* ZERO is illegal */ + +/* + * Machine independent codes for EXC_SOFTWARE + * Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) + * 0x10000 - 0x10002 in use for unix signals + */ +#define EXC_SOFT_SIGNAL 0x10003 /* Unix signal exceptions */ + +#ifndef ASSEMBLER + +#include <mach/port.h> +#include <mach/thread_status.h> +#include <mach/machine/vm_types.h> +/* + * Exported types + */ + +typedef int exception_type_t; +typedef integer_t exception_data_type_t; +typedef int64_t mach_exception_data_type_t; +typedef int exception_behavior_t; +typedef exception_data_type_t *exception_data_t; +typedef mach_exception_data_type_t *mach_exception_data_t; +typedef unsigned int exception_mask_t; +typedef exception_mask_t *exception_mask_array_t; +typedef exception_behavior_t *exception_behavior_array_t; +typedef thread_state_flavor_t *exception_flavor_array_t; +typedef mach_port_t *exception_port_array_t; +typedef mach_exception_data_type_t mach_exception_code_t; +typedef mach_exception_data_type_t mach_exception_subcode_t; + +#endif /* ASSEMBLER */ + +#endif /* _MACH_EXCEPTION_TYPES_H_ */ diff --git a/i386/include/mach/.svn/text-base/host_info.h.svn-base b/i386/include/mach/.svn/text-base/host_info.h.svn-base new file mode 100644 index 0000000..bc8f803 --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_info.h.svn-base @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/host_info.h + * + * Definitions for host_info call. + */ + +#ifndef _MACH_HOST_INFO_H_ +#define _MACH_HOST_INFO_H_ + +#include <mach/message.h> +#include <mach/vm_statistics.h> +#include <mach/machine.h> +#include <mach/machine/vm_types.h> +#include <mach/time_value.h> + +#include <sys/cdefs.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef integer_t *host_info_t; /* varying array of int. */ +typedef integer_t *host_info64_t; /* varying array of int. */ + +#define HOST_INFO_MAX (1024) /* max array size */ +typedef integer_t host_info_data_t[HOST_INFO_MAX]; + +#define KERNEL_VERSION_MAX (512) +typedef char kernel_version_t[KERNEL_VERSION_MAX]; + +#define KERNEL_BOOT_INFO_MAX (4096) +typedef char kernel_boot_info_t[KERNEL_BOOT_INFO_MAX]; + +/* + * Currently defined information. + */ +/* host_info() */ +typedef integer_t host_flavor_t; +#define HOST_BASIC_INFO 1 /* basic info */ +#define HOST_SCHED_INFO 3 /* scheduling info */ +#define HOST_RESOURCE_SIZES 4 /* kernel struct sizes */ +#define HOST_PRIORITY_INFO 5 /* priority information */ +#define HOST_SEMAPHORE_TRAPS 7 /* Has semaphore traps */ +#define HOST_MACH_MSG_TRAP 8 /* Has mach_msg_trap */ + + +#pragma pack(4) + +struct host_basic_info { + integer_t max_cpus; /* max number of CPUs possible */ + integer_t avail_cpus; /* number of CPUs now available */ + natural_t memory_size; /* size of memory in bytes, capped at 2 GB */ + cpu_type_t cpu_type; /* cpu type */ + cpu_subtype_t cpu_subtype; /* cpu subtype */ + cpu_threadtype_t cpu_threadtype; /* cpu threadtype */ + integer_t physical_cpu; /* number of physical CPUs now available */ + integer_t physical_cpu_max; /* max number of physical CPUs possible */ + integer_t logical_cpu; /* number of logical cpu now available */ + integer_t logical_cpu_max; /* max number of physical CPUs possible */ + uint64_t max_mem; /* actual size of physical memory */ +}; + +#pragma pack() + +typedef struct host_basic_info host_basic_info_data_t; +typedef struct host_basic_info *host_basic_info_t; +#define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_basic_info_data_t)/sizeof(integer_t))) + +struct host_sched_info { + integer_t min_timeout; /* minimum timeout in milliseconds */ + integer_t min_quantum; /* minimum quantum in milliseconds */ +}; + +typedef struct host_sched_info host_sched_info_data_t; +typedef struct host_sched_info *host_sched_info_t; +#define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_sched_info_data_t)/sizeof(integer_t))) + +struct kernel_resource_sizes { + natural_t task; + natural_t thread; + natural_t port; + natural_t memory_region; + natural_t memory_object; +}; + +typedef struct kernel_resource_sizes kernel_resource_sizes_data_t; +typedef struct kernel_resource_sizes *kernel_resource_sizes_t; +#define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) \ + (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t))) + +struct host_priority_info { + integer_t kernel_priority; + integer_t system_priority; + integer_t server_priority; + integer_t user_priority; + integer_t depress_priority; + integer_t idle_priority; + integer_t minimum_priority; + integer_t maximum_priority; +}; + +typedef struct host_priority_info host_priority_info_data_t; +typedef struct host_priority_info *host_priority_info_t; +#define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_priority_info_data_t)/sizeof(integer_t))) + +/* host_statistics() */ +#define HOST_LOAD_INFO 1 /* System loading stats */ +#define HOST_VM_INFO 2 /* Virtual memory stats */ +#define HOST_CPU_LOAD_INFO 3 /* CPU load stats */ + +/* host_statistics64() */ +#define HOST_VM_INFO64 4 /* 64-bit virtual memory stats */ + + +struct host_load_info { + integer_t avenrun[3]; /* scaled by LOAD_SCALE */ + integer_t mach_factor[3]; /* scaled by LOAD_SCALE */ +}; + +typedef struct host_load_info host_load_info_data_t; +typedef struct host_load_info *host_load_info_t; +#define HOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_load_info_data_t)/sizeof(integer_t))) + +/* in <mach/vm_statistics.h> */ +/* vm_statistics64 */ +#define HOST_VM_INFO64_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_statistics64_data_t)/sizeof(integer_t))) + +/* size of the latest version of the structure */ +#define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT + + +/* vm_statistics */ +#define HOST_VM_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_statistics_data_t)/sizeof(integer_t))) + +/* size of the latest version of the structure */ +#define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT +#define HOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT +/* previous versions: adjust the size according to what was added each time */ +#define HOST_VM_INFO_REV1_COUNT /* added "speculative_count" (1 int) */ \ + ((mach_msg_type_number_t) \ + (HOST_VM_INFO_REV2_COUNT - 1)) +#define HOST_VM_INFO_REV0_COUNT /* added "purgable" info (2 ints) */ \ + ((mach_msg_type_number_t) \ + (HOST_VM_INFO_REV1_COUNT - 2)) + +struct host_cpu_load_info { /* number of ticks while running... */ + natural_t cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ +}; + +typedef struct host_cpu_load_info host_cpu_load_info_data_t; +typedef struct host_cpu_load_info *host_cpu_load_info_t; +#define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t))) + +#endif /* _MACH_HOST_INFO_H_ */ diff --git a/i386/include/mach/.svn/text-base/host_notify.h.svn-base b/i386/include/mach/.svn/text-base/host_notify.h.svn-base new file mode 100644 index 0000000..6c0ca74 --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_notify.h.svn-base @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_HOST_NOTIFY_H_ +#define _MACH_HOST_NOTIFY_H_ + +#define HOST_NOTIFY_CALENDAR_CHANGE 0 +#define HOST_NOTIFY_TYPE_MAX 0 + +#define HOST_CALENDAR_CHANGED_REPLYID 950 + +#endif /* _MACH_HOST_NOTIFY_H_ */ diff --git a/i386/include/mach/.svn/text-base/host_notify_reply.defs.svn-base b/i386/include/mach/.svn/text-base/host_notify_reply.defs.svn-base new file mode 100644 index 0000000..85437f8 --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_notify_reply.defs.svn-base @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERN_USER */ + host_notify_reply 950; + +#include <mach/std_types.defs> + +simpleroutine host_calendar_changed( + notify_port : mach_port_move_send_once_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/host_priv.defs.svn-base b/i386/include/mach/.svn/text-base/host_priv.defs.svn-base new file mode 100644 index 0000000..3be3986 --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_priv.defs.svn-base @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2000-2004 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * Matchmaker definitions file for Mach kernel interface. + */ +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + host_priv 400; + +#ifdef KERNEL_USER +userprefix r_; +#endif /* KERNEL_USER */ + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Get boot configuration information from kernel. + */ +routine host_get_boot_info( + host_priv : host_priv_t; + out boot_info : kernel_boot_info_t); + +/* + * Reboot this host. + * Only available to privileged users. + */ +routine host_reboot( + host_priv : host_priv_t; + options : int); + + +/* + * Return privileged statistics from this host. + */ +routine host_priv_statistics( + host_priv : host_priv_t; + flavor : host_flavor_t; + out host_info_out : host_info_t, CountInOut); + +/* + * Sets the default memory manager, the port to which + * newly-created temporary memory objects are delivered. + * [See (memory_object_default)memory_object_create.] + * Also sets the default cluster size used for pagein/pageout + * to this port. + * The old memory manager port is returned. + */ +routine host_default_memory_manager( + host_priv : host_priv_t; + inout default_manager : memory_object_default_t = + MACH_MSG_TYPE_MAKE_SEND; + cluster_size : memory_object_cluster_size_t); + + +/* + * Specify that the range of the virtual address space + * of the target task must not cause page faults for + * the indicated accesses. + * + * [ To unwire the pages, specify VM_PROT_NONE. ] + */ +routine vm_wire( + host_priv : host_priv_t; + task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + desired_access : vm_prot_t); + +/* + * Specify that the target thread must always be able + * to run and to allocate memory. + */ +routine thread_wire( + host_priv : host_priv_t; + thread : thread_act_t; + wired : boolean_t); + +/* + * Allocate zero-filled, wired, contiguous physical memory + * in the address space of the target task, either at the + * specified address, or wherever space can be found (if + * anywhere is TRUE), of the specified size. The address + * at which the allocation actually took place is returned. + * All pages will be entered into the task's pmap immediately, + * with VM_PROT_ALL. + * + * In addition to all the failure modes of its cousin, + * vm_allocate, this call may also fail if insufficient + * contiguous memory exists to satisfy the request. + * + * Memory obtained from this call should be freed the + * normal way, via vm_deallocate. + * + * N.B. This is an EXPERIMENTAL interface! + */ +routine vm_allocate_cpm( + host_priv : host_priv_t; + task : vm_map_t; + inout address : vm_address_t; + size : vm_size_t; + flags : int); + +/* + * Get list of processors on this host. + */ +routine host_processors( + host_priv : host_priv_t; + out out_processor_list : processor_array_t); + + +/* + * Get control port for a system-wide clock. + * Privileged. + */ +routine host_get_clock_control( + host_priv : host_priv_t; + clock_id : clock_id_t; + out clock_ctrl : clock_ctrl_t); + + +/* + * kernel module interface (obsolete as of SnowLeopard) + * see mach/kmod.h + */ +/* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ +routine kmod_create( + host_priv : host_priv_t; + info : vm_address_t; + out module : kmod_t); + +routine kmod_destroy( + host_priv : host_priv_t; + module : kmod_t); + +routine kmod_control( + host_priv : host_priv_t; + module : kmod_t; + flavor : kmod_control_flavor_t; + inout data : kmod_args_t); + +/* + * Get a given special port for a given node. + * Special ports are defined in host_special_ports.h; + * examples include the master device port. + * There are a limited number of slots available for system servers. + */ +routine host_get_special_port( + host_priv : host_priv_t; + node : int; + which : int; + out port : mach_port_t); + +/* + * Set a given special port for the local node. + * See host_get_special_port. + */ +routine host_set_special_port( + host_priv : host_priv_t; + which : int; + port : mach_port_t); + +/* + * Set an exception handler for a host on one or more exception types. + * These handlers are invoked for all threads on the host if there are + * no task or thread-specific exception handlers or those handlers returned + * an error. + */ +routine host_set_exception_ports( + host_priv : host_priv_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t); + + +/* + * Lookup some of the old exception handlers for a host + */ +routine host_get_exception_ports( + host_priv : host_priv_t; + exception_mask : exception_mask_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + + +/* + * Set an exception handler for a host on one or more exception types. + * At the same time, return the previously defined exception handlers for + * those types. + */ +routine host_swap_exception_ports( + host_priv : host_priv_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t; + out masks : exception_mask_array_t; + out old_handlerss : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * Loads a symbol table for an external file into the kernel debugger. + * The symbol table data is an array of characters. It is assumed that + * the caller and the kernel debugger agree on its format. + * This call is only supported in MACH_DEBUG and MACH_KDB kernels, + * otherwise KERN_FAILURE is returned. + */ +routine host_load_symbol_table( + host : host_priv_t; + task : task_t; + name : symtab_name_t; + symtab : pointer_t); + +/* + * Specify that the range of the virtual address space + * of the target task must not cause page faults for + * the indicated accesses. + * + * [ To unwire the pages, specify VM_PROT_NONE. ] + */ +routine mach_vm_wire( + host_priv : host_priv_t; + task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + desired_access : vm_prot_t); + +/* + * JMM - Keep all processor_set related items at the end for easy + * removal. + */ +/* + * List all processor sets on host. + */ +routine host_processor_sets( + host_priv : host_priv_t; + out processor_sets : processor_set_name_array_t); + +/* + * Get control port for a processor set. + */ +routine host_processor_set_priv( + host_priv : host_priv_t; + set_name : processor_set_name_t; + out set : processor_set_t); + +/************************** Warning *************************************/ +/* The following routines are going away in a future release */ +/* use the appropriate variant of host_set_special_port instead */ +/************************************************************************/ + +/* + * Set the dynamic_pager control port. Other entities + * can request a send right to this port to talk with + * the dynamic_pager utility, setting behavioral parameters + * within the dynamic pager and getting low/high backing store + * resource notifications. + */ +routine set_dp_control_port( + host : host_priv_t; + in control_port : mach_port_t); + +/* + * Get the dynamic_pager control port. This port + * allows the holder to talk directly with the dynamic + * pager utility. + */ +routine get_dp_control_port( + host : host_priv_t; + out contorl_port :mach_port_t); + +/* + * Set the UserNotification daemon access port for this host. + * If this value is already set, the kernel will discard its + * reference to the previously registered port. + */ +routine host_set_UNDServer( + host : host_priv_t; + in server : UNDServerRef); + +/* + * Get the UserNotification daemon access port for this host. + * This can then be used to communicate with that daemon, which + * in turn communicates with the User through whatever means + * available (pop-up-menus for GUI systems, text for non-GUI, etc..). + * + * Access to this port is restricted to privileged clients because + * it is a special purpose port intended for kernel clients. User + * level clients should go directly to the CFUserNotifcation services. + */ +routine host_get_UNDServer( + host : host_priv_t; + out server : UNDServerRef); + +/* + * Perform an operation with a kernel extension, on the kext loading system, + * or request information about loaded kexts or the state of the kext loading + * system. + * Active operations (load, unload, disable/enable) require host_priv/root access. + * Info retrieval does not. + * + * WARNING: THIS ROUTINE IS PRIVATE TO THE KEXT-MANAGEMENT STACK AND IS + * SUBJECT TO CHANGE AT ANY TIME. + */ +routine kext_request( + host_priv : host_priv_t; + in user_log_flags : uint32_t; + in request_data : pointer_t; + out response_data : pointer_t; + out log_data : pointer_t; + out op_result : kern_return_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/host_priv.h.svn-base b/i386/include/mach/.svn/text-base/host_priv.h.svn-base new file mode 100644 index 0000000..7a9df1f --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_priv.h.svn-base @@ -0,0 +1,1269 @@ +#ifndef _host_priv_user_ +#define _host_priv_user_ + +/* Module host_priv */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef host_priv_MSG_COUNT +#define host_priv_MSG_COUNT 26 +#endif /* host_priv_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine host_get_boot_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_boot_info +( + host_priv_t host_priv, + kernel_boot_info_t boot_info +); + +/* Routine host_reboot */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_reboot +( + host_priv_t host_priv, + int options +); + +/* Routine host_priv_statistics */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_priv_statistics +( + host_priv_t host_priv, + host_flavor_t flavor, + host_info_t host_info_out, + mach_msg_type_number_t *host_info_outCnt +); + +/* Routine host_default_memory_manager */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_default_memory_manager +( + host_priv_t host_priv, + memory_object_default_t *default_manager, + memory_object_cluster_size_t cluster_size +); + +/* Routine vm_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_wire +( + host_priv_t host_priv, + vm_map_t task, + vm_address_t address, + vm_size_t size, + vm_prot_t desired_access +); + +/* Routine thread_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_wire +( + host_priv_t host_priv, + thread_act_t thread, + boolean_t wired +); + +/* Routine vm_allocate_cpm */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_allocate_cpm +( + host_priv_t host_priv, + vm_map_t task, + vm_address_t *address, + vm_size_t size, + int flags +); + +/* Routine host_processors */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processors +( + host_priv_t host_priv, + processor_array_t *out_processor_list, + mach_msg_type_number_t *out_processor_listCnt +); + +/* Routine host_get_clock_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_clock_control +( + host_priv_t host_priv, + clock_id_t clock_id, + clock_ctrl_t *clock_ctrl +); + +/* Routine kmod_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_create +( + host_priv_t host_priv, + vm_address_t info, + kmod_t *module +); + +/* Routine kmod_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_destroy +( + host_priv_t host_priv, + kmod_t module +); + +/* Routine kmod_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_control +( + host_priv_t host_priv, + kmod_t module, + kmod_control_flavor_t flavor, + kmod_args_t *data, + mach_msg_type_number_t *dataCnt +); + +/* Routine host_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_special_port +( + host_priv_t host_priv, + int node, + int which, + mach_port_t *port +); + +/* Routine host_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_set_special_port +( + host_priv_t host_priv, + int which, + mach_port_t port +); + +/* Routine host_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_set_exception_ports +( + host_priv_t host_priv, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine host_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_exception_ports +( + host_priv_t host_priv, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine host_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_swap_exception_ports +( + host_priv_t host_priv, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine host_load_symbol_table */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_load_symbol_table +( + host_priv_t host, + task_t task, + symtab_name_t name, + vm_offset_t symtab, + mach_msg_type_number_t symtabCnt +); + +/* Routine mach_vm_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_wire +( + host_priv_t host_priv, + vm_map_t task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_prot_t desired_access +); + +/* Routine host_processor_sets */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processor_sets +( + host_priv_t host_priv, + processor_set_name_array_t *processor_sets, + mach_msg_type_number_t *processor_setsCnt +); + +/* Routine host_processor_set_priv */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processor_set_priv +( + host_priv_t host_priv, + processor_set_name_t set_name, + processor_set_t *set +); + +/* Routine set_dp_control_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t set_dp_control_port +( + host_priv_t host, + mach_port_t control_port +); + +/* Routine get_dp_control_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t get_dp_control_port +( + host_priv_t host, + mach_port_t *contorl_port +); + +/* Routine host_set_UNDServer */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_set_UNDServer +( + host_priv_t host, + UNDServerRef server +); + +/* Routine host_get_UNDServer */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_UNDServer +( + host_priv_t host, + UNDServerRef *server +); + +/* Routine kext_request */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kext_request +( + host_priv_t host_priv, + uint32_t user_log_flags, + vm_offset_t request_data, + mach_msg_type_number_t request_dataCnt, + vm_offset_t *response_data, + mach_msg_type_number_t *response_dataCnt, + vm_offset_t *log_data, + mach_msg_type_number_t *log_dataCnt, + kern_return_t *op_result +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__host_priv_subsystem__defined +#define __Request__host_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_get_boot_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int options; + } __Request__host_reboot_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info_outCnt; + } __Request__host_priv_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t default_manager; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_cluster_size_t cluster_size; + } __Request__host_default_memory_manager_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_prot_t desired_access; + } __Request__vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t wired; + } __Request__thread_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + int flags; + } __Request__vm_allocate_cpm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_processors_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_id_t clock_id; + } __Request__host_get_clock_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t info; + } __Request__kmod_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kmod_t module; + } __Request__kmod_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + kmod_t module; + kmod_control_flavor_t flavor; + mach_msg_type_number_t dataCnt; + } __Request__kmod_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int node; + int which; + } __Request__host_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which; + } __Request__host_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__host_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__host_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__host_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + mach_msg_ool_descriptor_t symtab; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t nameCnt; + char name[32]; + mach_msg_type_number_t symtabCnt; + } __Request__host_load_symbol_table_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_prot_t desired_access; + } __Request__mach_vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_processor_sets_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t set_name; + /* end of the kernel processed data */ + } __Request__host_processor_set_priv_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t control_port; + /* end of the kernel processed data */ + } __Request__set_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__get_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t server; + /* end of the kernel processed data */ + } __Request__host_set_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_get_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t request_data; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t user_log_flags; + mach_msg_type_number_t request_dataCnt; + } __Request__kext_request_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__host_priv_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__host_priv_subsystem__defined +#define __RequestUnion__host_priv_subsystem__defined +union __RequestUnion__host_priv_subsystem { + __Request__host_get_boot_info_t Request_host_get_boot_info; + __Request__host_reboot_t Request_host_reboot; + __Request__host_priv_statistics_t Request_host_priv_statistics; + __Request__host_default_memory_manager_t Request_host_default_memory_manager; + __Request__vm_wire_t Request_vm_wire; + __Request__thread_wire_t Request_thread_wire; + __Request__vm_allocate_cpm_t Request_vm_allocate_cpm; + __Request__host_processors_t Request_host_processors; + __Request__host_get_clock_control_t Request_host_get_clock_control; + __Request__kmod_create_t Request_kmod_create; + __Request__kmod_destroy_t Request_kmod_destroy; + __Request__kmod_control_t Request_kmod_control; + __Request__host_get_special_port_t Request_host_get_special_port; + __Request__host_set_special_port_t Request_host_set_special_port; + __Request__host_set_exception_ports_t Request_host_set_exception_ports; + __Request__host_get_exception_ports_t Request_host_get_exception_ports; + __Request__host_swap_exception_ports_t Request_host_swap_exception_ports; + __Request__host_load_symbol_table_t Request_host_load_symbol_table; + __Request__mach_vm_wire_t Request_mach_vm_wire; + __Request__host_processor_sets_t Request_host_processor_sets; + __Request__host_processor_set_priv_t Request_host_processor_set_priv; + __Request__set_dp_control_port_t Request_set_dp_control_port; + __Request__get_dp_control_port_t Request_get_dp_control_port; + __Request__host_set_UNDServer_t Request_host_set_UNDServer; + __Request__host_get_UNDServer_t Request_host_get_UNDServer; + __Request__kext_request_t Request_kext_request; +}; +#endif /* !__RequestUnion__host_priv_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__host_priv_subsystem__defined +#define __Reply__host_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */ + mach_msg_type_number_t boot_infoCnt; + char boot_info[4096]; + } __Reply__host_get_boot_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_reboot_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info_outCnt; + integer_t host_info_out[15]; + } __Reply__host_priv_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t default_manager; + /* end of the kernel processed data */ + } __Reply__host_default_memory_manager_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_allocate_cpm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t out_processor_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t out_processor_listCnt; + } __Reply__host_processors_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t clock_ctrl; + /* end of the kernel processed data */ + } __Reply__host_get_clock_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + kmod_t module; + } __Reply__kmod_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__kmod_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t dataCnt; + } __Reply__kmod_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t port; + /* end of the kernel processed data */ + } __Reply__host_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__host_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__host_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_load_symbol_table_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t processor_sets; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t processor_setsCnt; + } __Reply__host_processor_sets_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t set; + /* end of the kernel processed data */ + } __Reply__host_processor_set_priv_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__set_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t contorl_port; + /* end of the kernel processed data */ + } __Reply__get_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_set_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t server; + /* end of the kernel processed data */ + } __Reply__host_get_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t response_data; + mach_msg_ool_descriptor_t log_data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t response_dataCnt; + mach_msg_type_number_t log_dataCnt; + kern_return_t op_result; + } __Reply__kext_request_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__host_priv_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__host_priv_subsystem__defined +#define __ReplyUnion__host_priv_subsystem__defined +union __ReplyUnion__host_priv_subsystem { + __Reply__host_get_boot_info_t Reply_host_get_boot_info; + __Reply__host_reboot_t Reply_host_reboot; + __Reply__host_priv_statistics_t Reply_host_priv_statistics; + __Reply__host_default_memory_manager_t Reply_host_default_memory_manager; + __Reply__vm_wire_t Reply_vm_wire; + __Reply__thread_wire_t Reply_thread_wire; + __Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm; + __Reply__host_processors_t Reply_host_processors; + __Reply__host_get_clock_control_t Reply_host_get_clock_control; + __Reply__kmod_create_t Reply_kmod_create; + __Reply__kmod_destroy_t Reply_kmod_destroy; + __Reply__kmod_control_t Reply_kmod_control; + __Reply__host_get_special_port_t Reply_host_get_special_port; + __Reply__host_set_special_port_t Reply_host_set_special_port; + __Reply__host_set_exception_ports_t Reply_host_set_exception_ports; + __Reply__host_get_exception_ports_t Reply_host_get_exception_ports; + __Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports; + __Reply__host_load_symbol_table_t Reply_host_load_symbol_table; + __Reply__mach_vm_wire_t Reply_mach_vm_wire; + __Reply__host_processor_sets_t Reply_host_processor_sets; + __Reply__host_processor_set_priv_t Reply_host_processor_set_priv; + __Reply__set_dp_control_port_t Reply_set_dp_control_port; + __Reply__get_dp_control_port_t Reply_get_dp_control_port; + __Reply__host_set_UNDServer_t Reply_host_set_UNDServer; + __Reply__host_get_UNDServer_t Reply_host_get_UNDServer; + __Reply__kext_request_t Reply_kext_request; +}; +#endif /* !__RequestUnion__host_priv_subsystem__defined */ + +#ifndef subsystem_to_name_map_host_priv +#define subsystem_to_name_map_host_priv \ + { "host_get_boot_info", 400 },\ + { "host_reboot", 401 },\ + { "host_priv_statistics", 402 },\ + { "host_default_memory_manager", 403 },\ + { "vm_wire", 404 },\ + { "thread_wire", 405 },\ + { "vm_allocate_cpm", 406 },\ + { "host_processors", 407 },\ + { "host_get_clock_control", 408 },\ + { "kmod_create", 409 },\ + { "kmod_destroy", 410 },\ + { "kmod_control", 411 },\ + { "host_get_special_port", 412 },\ + { "host_set_special_port", 413 },\ + { "host_set_exception_ports", 414 },\ + { "host_get_exception_ports", 415 },\ + { "host_swap_exception_ports", 416 },\ + { "host_load_symbol_table", 417 },\ + { "mach_vm_wire", 418 },\ + { "host_processor_sets", 419 },\ + { "host_processor_set_priv", 420 },\ + { "set_dp_control_port", 421 },\ + { "get_dp_control_port", 422 },\ + { "host_set_UNDServer", 423 },\ + { "host_get_UNDServer", 424 },\ + { "kext_request", 425 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _host_priv_user_ */ diff --git a/i386/include/mach/.svn/text-base/host_reboot.h.svn-base b/i386/include/mach/.svn/text-base/host_reboot.h.svn-base new file mode 100644 index 0000000..65609dd --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_reboot.h.svn-base @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_HOST_REBOOT_ +#define _MACH_HOST_REBOOT_ + +#define HOST_REBOOT_HALT 0x0008 +#define HOST_REBOOT_UPSDELAY 0x0100 +#define HOST_REBOOT_DEBUGGER 0x1000 + +#endif /* _MACH_HOST_REBOOT_ */ diff --git a/i386/include/mach/.svn/text-base/host_security.defs.svn-base b/i386/include/mach/.svn/text-base/host_security.defs.svn-base new file mode 100644 index 0000000..4098df4 --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_security.defs.svn-base @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/host_security.defs + * + * Abstract: + * Mach host security operations support. + */ +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + host_security 600; + +/* + * Basic types + */ +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + + +/* + * Create a new task with an explicit security token + */ +routine host_security_create_task_token( + host_security : host_security_t; + parent_task : task_t; + sec_token : security_token_t; + audit_token : audit_token_t; + host : host_t; + ledgers : ledger_array_t; + inherit_memory : boolean_t; + out child_task : task_t); + +/* + * Change a task's security token + */ +routine host_security_set_task_token( + host_security : host_security_t; + target_task : task_t; + sec_token : security_token_t; + audit_token : audit_token_t; + host : host_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/host_security.h.svn-base b/i386/include/mach/.svn/text-base/host_security.h.svn-base new file mode 100644 index 0000000..ee4ed9e --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_security.h.svn-base @@ -0,0 +1,197 @@ +#ifndef _host_security_user_ +#define _host_security_user_ + +/* Module host_security */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef host_security_MSG_COUNT +#define host_security_MSG_COUNT 2 +#endif /* host_security_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine host_security_create_task_token */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_security_create_task_token +( + host_security_t host_security, + task_t parent_task, + security_token_t sec_token, + audit_token_t audit_token, + host_t host, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine host_security_set_task_token */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_security_set_task_token +( + host_security_t host_security, + task_t target_task, + security_token_t sec_token, + audit_token_t audit_token, + host_t host +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__host_security_subsystem__defined +#define __Request__host_security_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_task; + mach_msg_port_descriptor_t host; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + security_token_t sec_token; + audit_token_t audit_token; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__host_security_create_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t target_task; + mach_msg_port_descriptor_t host; + /* end of the kernel processed data */ + NDR_record_t NDR; + security_token_t sec_token; + audit_token_t audit_token; + } __Request__host_security_set_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__host_security_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__host_security_subsystem__defined +#define __RequestUnion__host_security_subsystem__defined +union __RequestUnion__host_security_subsystem { + __Request__host_security_create_task_token_t Request_host_security_create_task_token; + __Request__host_security_set_task_token_t Request_host_security_set_task_token; +}; +#endif /* !__RequestUnion__host_security_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__host_security_subsystem__defined +#define __Reply__host_security_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__host_security_create_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_security_set_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__host_security_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__host_security_subsystem__defined +#define __ReplyUnion__host_security_subsystem__defined +union __ReplyUnion__host_security_subsystem { + __Reply__host_security_create_task_token_t Reply_host_security_create_task_token; + __Reply__host_security_set_task_token_t Reply_host_security_set_task_token; +}; +#endif /* !__RequestUnion__host_security_subsystem__defined */ + +#ifndef subsystem_to_name_map_host_security +#define subsystem_to_name_map_host_security \ + { "host_security_create_task_token", 600 },\ + { "host_security_set_task_token", 601 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _host_security_user_ */ diff --git a/i386/include/mach/.svn/text-base/host_special_ports.h.svn-base b/i386/include/mach/.svn/text-base/host_special_ports.h.svn-base new file mode 100644 index 0000000..755327c --- /dev/null +++ b/i386/include/mach/.svn/text-base/host_special_ports.h.svn-base @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/host_special_ports.h + * + * Defines codes for access to host-wide special ports. + */ + +#ifndef _MACH_HOST_SPECIAL_PORTS_H_ +#define _MACH_HOST_SPECIAL_PORTS_H_ + +/* + * Cannot be set or gotten from user space + */ +#define HOST_SECURITY_PORT 0 + +/* + * Always provided by kernel (cannot be set from user-space). + */ +#define HOST_PORT 1 +#define HOST_PRIV_PORT 2 +#define HOST_IO_MASTER_PORT 3 +#define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */ + +/* + * Not provided by kernel + */ +#define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_AUTOMOUNTD_PORT (4 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_LOCKD_PORT (5 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_SEATBELT_PORT (7 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_KEXTD_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_CHUD_PORT (9 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_UNFREED_PORT (10 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_AMFID_PORT (11 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_MAX_SPECIAL_PORT (12 + HOST_MAX_SPECIAL_KERNEL_PORT) + /* room to grow here as well */ + +/* + * Special node identifier to always represent the local node. + */ +#define HOST_LOCAL_NODE -1 + +/* + * Definitions for ease of use. + * + * In the get call, the host parameter can be any host, but will generally + * be the local node host port. In the set call, the host must the per-node + * host port for the node being affected. + */ +#define host_get_host_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_PORT, (port))) +#define host_set_host_port(host, port) (KERN_INVALID_ARGUMENT) + +#define host_get_host_priv_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_PRIV_PORT, (port))) +#define host_set_host_priv_port(host, port) (KERN_INVALID_ARGUMENT) + +#define host_get_io_master_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port))) +#define host_set_io_master_port(host, port) (KERN_INVALID_ARGUMENT) + +/* + * User-settable special ports. + */ +#define host_get_dynamic_pager_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port))) +#define host_set_dynamic_pager_port(host, port) \ + (host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port))) + +#define host_get_audit_control_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port))) +#define host_set_audit_control_port(host, port) \ + (host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port))) + +#define host_get_user_notification_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port))) +#define host_set_user_notification_port(host, port) \ + (host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port))) + +#define host_get_automountd_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_AUTOMOUNTD_PORT, (port))) +#define host_set_automountd_port(host, port) \ + (host_set_special_port((host), HOST_AUTOMOUNTD_PORT, (port))) + +#define host_get_lockd_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_LOCKD_PORT, (port))) +#define host_set_lockd_port(host, port) \ + (host_set_special_port((host), HOST_LOCKD_PORT, (port))) + +#define host_get_kextd_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_KEXTD_PORT, (port))) +#define host_set_kextd_port(host, port) \ + (host_set_special_port((host), HOST_KEXTD_PORT, (port))) + +#define host_get_chud_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_CHUD_PORT, (port))) +#define host_set_chud_port(host, port) \ + (host_set_special_port((host), HOST_CHUD_PORT, (port))) + +#define host_get_unfreed_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_UNFREED_PORT, (port))) +#define host_set_unfreed_port(host, port) \ + (host_set_special_port((host), HOST_UNFREED_PORT, (port))) + +#define host_get_amfid_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_AMFID_PORT, (port))) +#define host_set_amfid_port(host, port) \ + (host_set_special_port((host), HOST_AMFID_PORT, (port))) + +#endif /* _MACH_HOST_SPECIAL_PORTS_H_ */ diff --git a/i386/include/mach/.svn/text-base/kern_return.h.svn-base b/i386/include/mach/.svn/text-base/kern_return.h.svn-base new file mode 100644 index 0000000..da73236 --- /dev/null +++ b/i386/include/mach/.svn/text-base/kern_return.h.svn-base @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: h/kern_return.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Kernel return codes. + * + */ + +#ifndef _MACH_KERN_RETURN_H_ +#define _MACH_KERN_RETURN_H_ + +#include <mach/machine/kern_return.h> + +#define KERN_SUCCESS 0 + +#define KERN_INVALID_ADDRESS 1 + /* Specified address is not currently valid. + */ + +#define KERN_PROTECTION_FAILURE 2 + /* Specified memory is valid, but does not permit the + * required forms of access. + */ + +#define KERN_NO_SPACE 3 + /* The address range specified is already in use, or + * no address range of the size specified could be + * found. + */ + +#define KERN_INVALID_ARGUMENT 4 + /* The function requested was not applicable to this + * type of argument, or an argument is invalid + */ + +#define KERN_FAILURE 5 + /* The function could not be performed. A catch-all. + */ + +#define KERN_RESOURCE_SHORTAGE 6 + /* A system resource could not be allocated to fulfill + * this request. This failure may not be permanent. + */ + +#define KERN_NOT_RECEIVER 7 + /* The task in question does not hold receive rights + * for the port argument. + */ + +#define KERN_NO_ACCESS 8 + /* Bogus access restriction. + */ + +#define KERN_MEMORY_FAILURE 9 + /* During a page fault, the target address refers to a + * memory object that has been destroyed. This + * failure is permanent. + */ + +#define KERN_MEMORY_ERROR 10 + /* During a page fault, the memory object indicated + * that the data could not be returned. This failure + * may be temporary; future attempts to access this + * same data may succeed, as defined by the memory + * object. + */ + +#define KERN_ALREADY_IN_SET 11 + /* The receive right is already a member of the portset. + */ + +#define KERN_NOT_IN_SET 12 + /* The receive right is not a member of a port set. + */ + +#define KERN_NAME_EXISTS 13 + /* The name already denotes a right in the task. + */ + +#define KERN_ABORTED 14 + /* The operation was aborted. Ipc code will + * catch this and reflect it as a message error. + */ + +#define KERN_INVALID_NAME 15 + /* The name doesn't denote a right in the task. + */ + +#define KERN_INVALID_TASK 16 + /* Target task isn't an active task. + */ + +#define KERN_INVALID_RIGHT 17 + /* The name denotes a right, but not an appropriate right. + */ + +#define KERN_INVALID_VALUE 18 + /* A blatant range error. + */ + +#define KERN_UREFS_OVERFLOW 19 + /* Operation would overflow limit on user-references. + */ + +#define KERN_INVALID_CAPABILITY 20 + /* The supplied (port) capability is improper. + */ + +#define KERN_RIGHT_EXISTS 21 + /* The task already has send or receive rights + * for the port under another name. + */ + +#define KERN_INVALID_HOST 22 + /* Target host isn't actually a host. + */ + +#define KERN_MEMORY_PRESENT 23 + /* An attempt was made to supply "precious" data + * for memory that is already present in a + * memory object. + */ + +#define KERN_MEMORY_DATA_MOVED 24 + /* A page was requested of a memory manager via + * memory_object_data_request for an object using + * a MEMORY_OBJECT_COPY_CALL strategy, with the + * VM_PROT_WANTS_COPY flag being used to specify + * that the page desired is for a copy of the + * object, and the memory manager has detected + * the page was pushed into a copy of the object + * while the kernel was walking the shadow chain + * from the copy to the object. This error code + * is delivered via memory_object_data_error + * and is handled by the kernel (it forces the + * kernel to restart the fault). It will not be + * seen by users. + */ + +#define KERN_MEMORY_RESTART_COPY 25 + /* A strategic copy was attempted of an object + * upon which a quicker copy is now possible. + * The caller should retry the copy using + * vm_object_copy_quickly. This error code + * is seen only by the kernel. + */ + +#define KERN_INVALID_PROCESSOR_SET 26 + /* An argument applied to assert processor set privilege + * was not a processor set control port. + */ + +#define KERN_POLICY_LIMIT 27 + /* The specified scheduling attributes exceed the thread's + * limits. + */ + +#define KERN_INVALID_POLICY 28 + /* The specified scheduling policy is not currently + * enabled for the processor set. + */ + +#define KERN_INVALID_OBJECT 29 + /* The external memory manager failed to initialize the + * memory object. + */ + +#define KERN_ALREADY_WAITING 30 + /* A thread is attempting to wait for an event for which + * there is already a waiting thread. + */ + +#define KERN_DEFAULT_SET 31 + /* An attempt was made to destroy the default processor + * set. + */ + +#define KERN_EXCEPTION_PROTECTED 32 + /* An attempt was made to fetch an exception port that is + * protected, or to abort a thread while processing a + * protected exception. + */ + +#define KERN_INVALID_LEDGER 33 + /* A ledger was required but not supplied. + */ + +#define KERN_INVALID_MEMORY_CONTROL 34 + /* The port was not a memory cache control port. + */ + +#define KERN_INVALID_SECURITY 35 + /* An argument supplied to assert security privilege + * was not a host security port. + */ + +#define KERN_NOT_DEPRESSED 36 + /* thread_depress_abort was called on a thread which + * was not currently depressed. + */ + +#define KERN_TERMINATED 37 + /* Object has been terminated and is no longer available + */ + +#define KERN_LOCK_SET_DESTROYED 38 + /* Lock set has been destroyed and is no longer available. + */ + +#define KERN_LOCK_UNSTABLE 39 + /* The thread holding the lock terminated before releasing + * the lock + */ + +#define KERN_LOCK_OWNED 40 + /* The lock is already owned by another thread + */ + +#define KERN_LOCK_OWNED_SELF 41 + /* The lock is already owned by the calling thread + */ + +#define KERN_SEMAPHORE_DESTROYED 42 + /* Semaphore has been destroyed and is no longer available. + */ + +#define KERN_RPC_SERVER_TERMINATED 43 + /* Return from RPC indicating the target server was + * terminated before it successfully replied + */ + +#define KERN_RPC_TERMINATE_ORPHAN 44 + /* Terminate an orphaned activation. + */ + +#define KERN_RPC_CONTINUE_ORPHAN 45 + /* Allow an orphaned activation to continue executing. + */ + +#define KERN_NOT_SUPPORTED 46 + /* Empty thread activation (No thread linked to it) + */ + +#define KERN_NODE_DOWN 47 + /* Remote node down or inaccessible. + */ + +#define KERN_NOT_WAITING 48 + /* A signalled thread was not actually waiting. */ + +#define KERN_OPERATION_TIMED_OUT 49 + /* Some thread-oriented operation (semaphore_wait) timed out + */ + +#define KERN_CODESIGN_ERROR 50 + /* During a page fault, indicates that the page was rejected + * as a result of a signature check. + */ + +#define KERN_RETURN_MAX 0x100 + /* Maximum return value allowable + */ + +#endif /* _MACH_KERN_RETURN_H_ */ diff --git a/i386/include/mach/.svn/text-base/kmod.h.svn-base b/i386/include/mach/.svn/text-base/kmod.h.svn-base new file mode 100644 index 0000000..f31821d --- /dev/null +++ b/i386/include/mach/.svn/text-base/kmod.h.svn-base @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _MACH_KMOD_H_ +#define _MACH_KMOD_H_ + +#include <mach/kern_return.h> +#include <mach/mach_types.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#if PRAGMA_MARK +#pragma mark Basic macros & typedefs +#endif +/*********************************************************************** +* Basic macros & typedefs +***********************************************************************/ +#define KMOD_MAX_NAME 64 + +#define KMOD_RETURN_SUCCESS KERN_SUCCESS +#define KMOD_RETURN_FAILURE KERN_FAILURE + +typedef int kmod_t; + +struct kmod_info; +typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data); +typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data); + +#if PRAGMA_MARK +#pragma mark Structure definitions +#endif +/*********************************************************************** +* Structure definitions +* +* All structures must be #pragma pack(4). +***********************************************************************/ +#pragma pack(4) + +/* Run-time struct only; never saved to a file */ +typedef struct kmod_reference { + struct kmod_reference * next; + struct kmod_info * info; +} kmod_reference_t; + +/*********************************************************************** +* Warning: Any changes to the kmod_info structure affect the +* KMOD_..._DECL macros below. +***********************************************************************/ + +/* The kmod_info_t structure is only safe to use inside the running + * kernel. If you need to work with a kmod_info_t structure outside + * the kernel, please use the compatibility definitions below. + */ +typedef struct kmod_info { + struct kmod_info * next; + int32_t info_version; // version of this structure + uint32_t id; + char name[KMOD_MAX_NAME]; + char version[KMOD_MAX_NAME]; + int32_t reference_count; // # linkage refs to this + kmod_reference_t * reference_list; // who this refs (links on) + vm_address_t address; // starting address + vm_size_t size; // total size + vm_size_t hdr_size; // unwired hdr size + kmod_start_func_t * start; + kmod_stop_func_t * stop; +} kmod_info_t; + +/* A compatibility definition of kmod_info_t for 32-bit kexts. + */ +typedef struct kmod_info_32_v1 { + uint32_t next_addr; + int32_t info_version; + uint32_t id; + uint8_t name[KMOD_MAX_NAME]; + uint8_t version[KMOD_MAX_NAME]; + int32_t reference_count; + uint32_t reference_list_addr; + uint32_t address; + uint32_t size; + uint32_t hdr_size; + uint32_t start_addr; + uint32_t stop_addr; +} kmod_info_32_v1_t; + +/* A compatibility definition of kmod_info_t for 64-bit kexts. + */ +typedef struct kmod_info_64_v1 { + uint64_t next_addr; + int32_t info_version; + uint32_t id; + uint8_t name[KMOD_MAX_NAME]; + uint8_t version[KMOD_MAX_NAME]; + int32_t reference_count; + uint64_t reference_list_addr; + uint64_t address; + uint64_t size; + uint64_t hdr_size; + uint64_t start_addr; + uint64_t stop_addr; +} kmod_info_64_v1_t; + +#pragma pack() + +#if PRAGMA_MARK +#pragma mark Kmod structure declaration macros +#endif +/*********************************************************************** +* Kmod structure declaration macros +***********************************************************************/ +#define KMOD_INFO_NAME kmod_info +#define KMOD_INFO_VERSION 1 + +#define KMOD_DECL(name, version) \ + static kmod_start_func_t name ## _module_start; \ + static kmod_stop_func_t name ## _module_stop; \ + kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \ + { #name }, { version }, -1, 0, 0, 0, 0, \ + name ## _module_start, \ + name ## _module_stop }; + +#define KMOD_EXPLICIT_DECL(name, version, start, stop) \ + kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \ + { #name }, { version }, -1, 0, 0, 0, 0, \ + start, stop }; + +#if PRAGMA_MARK +#pragma mark Kernel private declarations +#endif +/*********************************************************************** +* Kernel private declarations. +***********************************************************************/ + + +#if PRAGMA_MARK +#pragma mark Obsolete kmod stuff +#endif +/*********************************************************************** +* These 3 should be dropped but they're referenced by MIG declarations. +***********************************************************************/ +typedef void * kmod_args_t; +typedef int kmod_control_flavor_t; +typedef kmod_info_t * kmod_info_array_t; + +__END_DECLS + +#endif /* _MACH_KMOD_H_ */ diff --git a/i386/include/mach/.svn/text-base/ledger.defs.svn-base b/i386/include/mach/.svn/text-base/ledger.defs.svn-base new file mode 100644 index 0000000..76367a9 --- /dev/null +++ b/i386/include/mach/.svn/text-base/ledger.defs.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + ledger 5000; + +#ifdef KERNEL_USER +userprefix r_; +#endif /* KERNEL_USER */ + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Create a subordinate ledger + */ +routine ledger_create( + parent_ledger : ledger_t; + ledger_ledger : ledger_t; + out new_ledger : ledger_t; + transfer : ledger_item_t); + +/* + * Destroy a ledger + */ +routine ledger_terminate( + ledger : ledger_t); + +/* + * Transfer resources from a parent ledger to a child + */ +routine ledger_transfer( + parent_ledger : ledger_t; + child_ledger : ledger_t; + transfer : ledger_item_t); + +/* + * Return the ledger limit and balance + */ +routine ledger_read( + ledger : ledger_t; + out balance : ledger_item_t; + out limit : ledger_item_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/ledger.h.svn-base b/i386/include/mach/.svn/text-base/ledger.h.svn-base new file mode 100644 index 0000000..f0f050f --- /dev/null +++ b/i386/include/mach/.svn/text-base/ledger.h.svn-base @@ -0,0 +1,259 @@ +#ifndef _ledger_user_ +#define _ledger_user_ + +/* Module ledger */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef ledger_MSG_COUNT +#define ledger_MSG_COUNT 4 +#endif /* ledger_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine ledger_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_create +( + ledger_t parent_ledger, + ledger_t ledger_ledger, + ledger_t *new_ledger, + ledger_item_t transfer +); + +/* Routine ledger_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_terminate +( + ledger_t ledger +); + +/* Routine ledger_transfer */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_transfer +( + ledger_t parent_ledger, + ledger_t child_ledger, + ledger_item_t transfer +); + +/* Routine ledger_read */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_read +( + ledger_t ledger, + ledger_item_t *balance, + ledger_item_t *limit +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__ledger_subsystem__defined +#define __Request__ledger_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t ledger_ledger; + /* end of the kernel processed data */ + NDR_record_t NDR; + ledger_item_t transfer; + } __Request__ledger_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__ledger_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_ledger; + /* end of the kernel processed data */ + NDR_record_t NDR; + ledger_item_t transfer; + } __Request__ledger_transfer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__ledger_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__ledger_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__ledger_subsystem__defined +#define __RequestUnion__ledger_subsystem__defined +union __RequestUnion__ledger_subsystem { + __Request__ledger_create_t Request_ledger_create; + __Request__ledger_terminate_t Request_ledger_terminate; + __Request__ledger_transfer_t Request_ledger_transfer; + __Request__ledger_read_t Request_ledger_read; +}; +#endif /* !__RequestUnion__ledger_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__ledger_subsystem__defined +#define __Reply__ledger_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_ledger; + /* end of the kernel processed data */ + } __Reply__ledger_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__ledger_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__ledger_transfer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + ledger_item_t balance; + ledger_item_t limit; + } __Reply__ledger_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__ledger_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__ledger_subsystem__defined +#define __ReplyUnion__ledger_subsystem__defined +union __ReplyUnion__ledger_subsystem { + __Reply__ledger_create_t Reply_ledger_create; + __Reply__ledger_terminate_t Reply_ledger_terminate; + __Reply__ledger_transfer_t Reply_ledger_transfer; + __Reply__ledger_read_t Reply_ledger_read; +}; +#endif /* !__RequestUnion__ledger_subsystem__defined */ + +#ifndef subsystem_to_name_map_ledger +#define subsystem_to_name_map_ledger \ + { "ledger_create", 5000 },\ + { "ledger_terminate", 5001 },\ + { "ledger_transfer", 5002 },\ + { "ledger_read", 5003 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _ledger_user_ */ diff --git a/i386/include/mach/.svn/text-base/lock_set.defs.svn-base b/i386/include/mach/.svn/text-base/lock_set.defs.svn-base new file mode 100644 index 0000000..c7ee584 --- /dev/null +++ b/i386/include/mach/.svn/text-base/lock_set.defs.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + * + */ +/* + * File: mach/lock_set.defs + * Author: Joseph CaraDonna + * + * Exported kernel calls + * + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + lock_set 617000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * a lock_set_t is created and destroyed through the task object. + * lock_set_create(task,&lock_set_t,...); + * lock_set_destroy(task,lock_set_t); + */ + +routine lock_acquire( + lock_set : lock_set_t; + lock_id : int); + +routine lock_release( + lock_set : lock_set_t; + lock_id : int); + +routine lock_try( + lock_set : lock_set_t; + lock_id : int); + +routine lock_make_stable( + lock_set : lock_set_t; + lock_id : int); + +routine lock_handoff( + lock_set : lock_set_t; + lock_id : int); + +routine lock_handoff_accept( + lock_set : lock_set_t; + lock_id : int); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/lock_set.h.svn-base b/i386/include/mach/.svn/text-base/lock_set.h.svn-base new file mode 100644 index 0000000..07a8d13 --- /dev/null +++ b/i386/include/mach/.svn/text-base/lock_set.h.svn-base @@ -0,0 +1,326 @@ +#ifndef _lock_set_user_ +#define _lock_set_user_ + +/* Module lock_set */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef lock_set_MSG_COUNT +#define lock_set_MSG_COUNT 6 +#endif /* lock_set_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine lock_acquire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_acquire +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_release */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_release +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_try */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_try +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_make_stable */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_make_stable +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_handoff */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_handoff +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_handoff_accept */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_handoff_accept +( + lock_set_t lock_set, + int lock_id +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__lock_set_subsystem__defined +#define __Request__lock_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_acquire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_release_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_try_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_make_stable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_handoff_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_handoff_accept_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__lock_set_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__lock_set_subsystem__defined +#define __RequestUnion__lock_set_subsystem__defined +union __RequestUnion__lock_set_subsystem { + __Request__lock_acquire_t Request_lock_acquire; + __Request__lock_release_t Request_lock_release; + __Request__lock_try_t Request_lock_try; + __Request__lock_make_stable_t Request_lock_make_stable; + __Request__lock_handoff_t Request_lock_handoff; + __Request__lock_handoff_accept_t Request_lock_handoff_accept; +}; +#endif /* !__RequestUnion__lock_set_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__lock_set_subsystem__defined +#define __Reply__lock_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_acquire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_release_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_try_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_make_stable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_handoff_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_handoff_accept_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__lock_set_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__lock_set_subsystem__defined +#define __ReplyUnion__lock_set_subsystem__defined +union __ReplyUnion__lock_set_subsystem { + __Reply__lock_acquire_t Reply_lock_acquire; + __Reply__lock_release_t Reply_lock_release; + __Reply__lock_try_t Reply_lock_try; + __Reply__lock_make_stable_t Reply_lock_make_stable; + __Reply__lock_handoff_t Reply_lock_handoff; + __Reply__lock_handoff_accept_t Reply_lock_handoff_accept; +}; +#endif /* !__RequestUnion__lock_set_subsystem__defined */ + +#ifndef subsystem_to_name_map_lock_set +#define subsystem_to_name_map_lock_set \ + { "lock_acquire", 617000 },\ + { "lock_release", 617001 },\ + { "lock_try", 617002 },\ + { "lock_make_stable", 617003 },\ + { "lock_handoff", 617004 },\ + { "lock_handoff_accept", 617005 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _lock_set_user_ */ diff --git a/i386/include/mach/.svn/text-base/mach.h.svn-base b/i386/include/mach/.svn/text-base/mach.h.svn-base new file mode 100644 index 0000000..0b3b1a0 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach.h.svn-base @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1999-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Includes all the types that a normal user + * of Mach programs should need + */ + +#ifndef _MACH_H_ +#define _MACH_H_ + +#define __MACH30__ +#define MACH_IPC_FLAVOR UNTYPED + +#include <mach/std_types.h> +#include <mach/mach_types.h> +#include <mach/mach_interface.h> +#include <mach/mach_port.h> +#include <mach/mach_init.h> +#include <mach/mach_host.h> +#include <mach/thread_switch.h> + +#include <mach/rpc.h> /* for compatibility only */ +#include <mach/mig.h> + +#include <mach/mig_errors.h> +#include <mach/mach_error.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS +/* + * Standard prototypes + */ +extern void panic_init(mach_port_t); +extern void panic(const char *, ...); + +extern void safe_gets(char *, + char *, + int); + +extern void slot_name(cpu_type_t, + cpu_subtype_t, + char **, + char **); + +extern void mig_reply_setup(mach_msg_header_t *, + mach_msg_header_t *); + +extern void mach_msg_destroy(mach_msg_header_t *); + +extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *); + +extern mach_msg_return_t mach_msg_send(mach_msg_header_t *); + +extern mach_msg_return_t mach_msg_server_once(boolean_t (*) + (mach_msg_header_t *, + mach_msg_header_t *), + mach_msg_size_t, + mach_port_t, + mach_msg_options_t); +extern mach_msg_return_t mach_msg_server(boolean_t (*) + (mach_msg_header_t *, + mach_msg_header_t *), + mach_msg_size_t, + mach_port_t, + mach_msg_options_t); + +/* + * Prototypes for compatibility + */ +extern kern_return_t clock_get_res(mach_port_t, + clock_res_t *); +extern kern_return_t clock_set_res(mach_port_t, + clock_res_t); + +extern kern_return_t clock_sleep(mach_port_t, + int, + mach_timespec_t, + mach_timespec_t *); +__END_DECLS + +#endif /* _MACH_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_error.h.svn-base b/i386/include/mach/.svn/text-base/mach_error.h.svn-base new file mode 100644 index 0000000..5840bd5 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_error.h.svn-base @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +/* + * File: mach_error.h + * Author: Douglas Orr, Carnegie Mellon University + * Date: Mar. 1988 + * + * Definitions of routines in mach_error.c + */ + +#ifndef _MACH_ERROR_ +#define _MACH_ERROR_ 1 + +#include <mach/error.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS +char *mach_error_string( +/* + * Returns a string appropriate to the error argument given + */ + mach_error_t error_value + ); + +void mach_error( +/* + * Prints an appropriate message on the standard error stream + */ + const char *str, + mach_error_t error_value + ); + +char *mach_error_type( +/* + * Returns a string with the error system, subsystem and code + */ + mach_error_t error_value + ); +__END_DECLS + +#endif /* _MACH_ERROR_ */ diff --git a/i386/include/mach/.svn/text-base/mach_exc.defs.svn-base b/i386/include/mach/.svn/text-base/mach_exc.defs.svn-base new file mode 100644 index 0000000..00fae28 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_exc.defs.svn-base @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Abstract: + * MiG definitions file for Mach exception interface. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif + mach_exc 2405; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +ServerPrefix catch_; + +type mach_exception_data_t = array[*:2] of int64_t; +type exception_type_t = int; + +routine mach_exception_raise( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : mach_exception_data_t + ); + +routine mach_exception_raise_state( +#if KERNEL_USER + exception_port : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : mach_exception_data_t, const; + inout flavor : int; + old_state : thread_state_t, const; + out new_state : thread_state_t); + +routine mach_exception_raise_state_identity( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : mach_exception_data_t; + inout flavor : int; + old_state : thread_state_t; + out new_state : thread_state_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/mach_host.defs.svn-base b/i386/include/mach/.svn/text-base/mach_host.defs.svn-base new file mode 100644 index 0000000..90ba9b9 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_host.defs.svn-base @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/mach_host.defs + * + * Abstract: + * Mach host operations support. Includes processor allocation and + * control. + */ + +#ifdef MACH_KERNEL +#include <advisory_pageout.h> +#endif /* MACH_KERNEL */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + mach_host 200; + +/* + * Basic types + */ + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * References to host objects are returned by: + * mach_host_self() - trap + */ + +/* + * Return information about this host. + */ +routine host_info( + host : host_t; + flavor : host_flavor_t; + out host_info_out : host_info_t, CountInOut); + +/* + * Get string describing current kernel version. + */ +routine host_kernel_version( + host : host_t; + out kernel_version : kernel_version_t); + +/* + * Get host page size + * (compatibility for running old libraries on new kernels - + * host_page_size() is now a library routine based on constants) + */ +routine _host_page_size( + host : host_t; + out out_page_size : vm_size_t); + +/* + * Allow pagers to create named entries that point to un-mapped + * abstract memory object. The named entries are generally mappable + * and can be subsetted through the mach_make_memory_entry call + */ +routine mach_memory_object_memory_entry( + host :host_t; + internal :boolean_t; + size :vm_size_t; + permission :vm_prot_t; + pager :memory_object_t; + out entry_handle :mach_port_move_send_t); + + +/* + * Get processor info for all the processors on this host. + * The returned data is an OOL array of processor info. + */ +routine host_processor_info( + host : host_t; + flavor : processor_flavor_t; + out out_processor_count : natural_t; + out out_processor_info : processor_info_array_t); + +/* + * Return host IO master access port + */ +routine host_get_io_master( + host : host_t; + out io_master : io_master_t); + +/* + * Get service port for a processor set. + * Available to all. + */ +routine host_get_clock_service( + host : host_t; + clock_id : clock_id_t; + out clock_serv : clock_serv_t); + +/* + * kernel module interface (obsolete as of SnowLeopard) + * see mach/kmod.h + */ +/* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ +routine kmod_get_info( + host : host_t; + out modules : kmod_args_t); + +/* + * Returns information about the memory allocation zones. + * Supported in all kernels.. + */ +routine host_zone_info( + host : host_t; + out names : zone_name_array_t, + Dealloc; + out info : zone_info_array_t, + Dealloc); + +/* + * Returns information about the global VP table. + * Only supported in MACH_VM_DEBUG kernels, + * otherwise returns KERN_FAILURE. + */ +routine host_virtual_physical_table_info( + host : host_t; + out info : hash_info_bucket_array_t, + Dealloc); + +/* + * Returns information about the global reverse hash table. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine host_ipc_hash_info( + host : host_t; + out info : hash_info_bucket_array_t, + Dealloc); + +skip; /* was enable_bluebox */ +skip; /* was disable_bluebox */ + +/* + * JMM - Keep processor_set related items at the end for easy + * removal. + */ +/* + * Get default processor set for host. + */ +routine processor_set_default( + host : host_t; + out default_set : processor_set_name_t); + +/* + * Create new processor set. Returns real port for manipulations, + * and name port for obtaining information. + */ +routine processor_set_create( + host : host_t; + out new_set : processor_set_t; + out new_name : processor_set_name_t); + +/* + * Temporary interfaces for conversion to 64 bit data path + */ + +routine mach_memory_object_memory_entry_64( + host :host_t; + internal :boolean_t; + size :memory_object_size_t; + permission :vm_prot_t; + pager :memory_object_t; + out entry_handle :mach_port_move_send_t); + +/* + * Return statistics from this host. + */ +routine host_statistics( + host_priv : host_t; + flavor : host_flavor_t; + out host_info_out : host_info_t, CountInOut); + +routine host_request_notification( + host : host_t; + notify_type : host_flavor_t; + notify_port : mach_port_make_send_once_t); + +routine host_lockgroup_info( + host : host_t; + out lockgroup_info : lockgroup_info_array_t, + Dealloc); + +/* + * Return 64-bit statistics from this host. + */ +routine host_statistics64( + host_priv : host_t; + flavor : host_flavor_t; + out host_info64_out : host_info64_t, CountInOut); + + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/mach_host.h.svn-base b/i386/include/mach/.svn/text-base/mach_host.h.svn-base new file mode 100644 index 0000000..70ab53f --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_host.h.svn-base @@ -0,0 +1,873 @@ +#ifndef _mach_host_user_ +#define _mach_host_user_ + +/* Module mach_host */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef mach_host_MSG_COUNT +#define mach_host_MSG_COUNT 20 +#endif /* mach_host_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> +#include <mach/mach_init.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine host_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_info +( + host_t host, + host_flavor_t flavor, + host_info_t host_info_out, + mach_msg_type_number_t *host_info_outCnt +); + +/* Routine host_kernel_version */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_kernel_version +( + host_t host, + kernel_version_t kernel_version +); + +/* Routine _host_page_size */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t _host_page_size +( + host_t host, + vm_size_t *out_page_size +); + +/* Routine mach_memory_object_memory_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_memory_object_memory_entry +( + host_t host, + boolean_t internal, + vm_size_t size, + vm_prot_t permission, + memory_object_t pager, + mach_port_t *entry_handle +); + +/* Routine host_processor_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processor_info +( + host_t host, + processor_flavor_t flavor, + natural_t *out_processor_count, + processor_info_array_t *out_processor_info, + mach_msg_type_number_t *out_processor_infoCnt +); + +/* Routine host_get_io_master */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_io_master +( + host_t host, + io_master_t *io_master +); + +/* Routine host_get_clock_service */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_clock_service +( + host_t host, + clock_id_t clock_id, + clock_serv_t *clock_serv +); + +/* Routine kmod_get_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_get_info +( + host_t host, + kmod_args_t *modules, + mach_msg_type_number_t *modulesCnt +); + +/* Routine host_zone_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_zone_info +( + host_t host, + zone_name_array_t *names, + mach_msg_type_number_t *namesCnt, + zone_info_array_t *info, + mach_msg_type_number_t *infoCnt +); + +/* Routine host_virtual_physical_table_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_virtual_physical_table_info +( + host_t host, + hash_info_bucket_array_t *info, + mach_msg_type_number_t *infoCnt +); + +/* Routine host_ipc_hash_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_ipc_hash_info +( + host_t host, + hash_info_bucket_array_t *info, + mach_msg_type_number_t *infoCnt +); + +/* Routine processor_set_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_default +( + host_t host, + processor_set_name_t *default_set +); + +/* Routine processor_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_create +( + host_t host, + processor_set_t *new_set, + processor_set_name_t *new_name +); + +/* Routine mach_memory_object_memory_entry_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_memory_object_memory_entry_64 +( + host_t host, + boolean_t internal, + memory_object_size_t size, + vm_prot_t permission, + memory_object_t pager, + mach_port_t *entry_handle +); + +/* Routine host_statistics */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_statistics +( + host_t host_priv, + host_flavor_t flavor, + host_info_t host_info_out, + mach_msg_type_number_t *host_info_outCnt +); + +/* Routine host_request_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_request_notification +( + host_t host, + host_flavor_t notify_type, + mach_port_t notify_port +); + +/* Routine host_lockgroup_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_lockgroup_info +( + host_t host, + lockgroup_info_array_t *lockgroup_info, + mach_msg_type_number_t *lockgroup_infoCnt +); + +/* Routine host_statistics64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_statistics64 +( + host_t host_priv, + host_flavor_t flavor, + host_info64_t host_info64_out, + mach_msg_type_number_t *host_info64_outCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__mach_host_subsystem__defined +#define __Request__mach_host_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info_outCnt; + } __Request__host_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_kernel_version_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request___host_page_size_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pager; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t internal; + vm_size_t size; + vm_prot_t permission; + } __Request__mach_memory_object_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_flavor_t flavor; + } __Request__host_processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_get_io_master_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_id_t clock_id; + } __Request__host_get_clock_service_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__kmod_get_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_zone_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_virtual_physical_table_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_ipc_hash_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pager; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t internal; + memory_object_size_t size; + vm_prot_t permission; + } __Request__mach_memory_object_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info_outCnt; + } __Request__host_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notify_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + host_flavor_t notify_type; + } __Request__host_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_lockgroup_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info64_outCnt; + } __Request__host_statistics64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__mach_host_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__mach_host_subsystem__defined +#define __RequestUnion__mach_host_subsystem__defined +union __RequestUnion__mach_host_subsystem { + __Request__host_info_t Request_host_info; + __Request__host_kernel_version_t Request_host_kernel_version; + __Request___host_page_size_t Request__host_page_size; + __Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry; + __Request__host_processor_info_t Request_host_processor_info; + __Request__host_get_io_master_t Request_host_get_io_master; + __Request__host_get_clock_service_t Request_host_get_clock_service; + __Request__kmod_get_info_t Request_kmod_get_info; + __Request__host_zone_info_t Request_host_zone_info; + __Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info; + __Request__host_ipc_hash_info_t Request_host_ipc_hash_info; + __Request__processor_set_default_t Request_processor_set_default; + __Request__processor_set_create_t Request_processor_set_create; + __Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64; + __Request__host_statistics_t Request_host_statistics; + __Request__host_request_notification_t Request_host_request_notification; + __Request__host_lockgroup_info_t Request_host_lockgroup_info; + __Request__host_statistics64_t Request_host_statistics64; +}; +#endif /* !__RequestUnion__mach_host_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__mach_host_subsystem__defined +#define __Reply__mach_host_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info_outCnt; + integer_t host_info_out[15]; + } __Reply__host_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */ + mach_msg_type_number_t kernel_versionCnt; + char kernel_version[512]; + } __Reply__host_kernel_version_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_size_t out_page_size; + } __Reply___host_page_size_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t entry_handle; + /* end of the kernel processed data */ + } __Reply__mach_memory_object_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t out_processor_info; + /* end of the kernel processed data */ + NDR_record_t NDR; + natural_t out_processor_count; + mach_msg_type_number_t out_processor_infoCnt; + } __Reply__host_processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t io_master; + /* end of the kernel processed data */ + } __Reply__host_get_io_master_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t clock_serv; + /* end of the kernel processed data */ + } __Reply__host_get_clock_service_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t modules; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t modulesCnt; + } __Reply__kmod_get_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t names; + mach_msg_ool_descriptor_t info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t namesCnt; + mach_msg_type_number_t infoCnt; + } __Reply__host_zone_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t infoCnt; + } __Reply__host_virtual_physical_table_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t infoCnt; + } __Reply__host_ipc_hash_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t default_set; + /* end of the kernel processed data */ + } __Reply__processor_set_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + mach_msg_port_descriptor_t new_name; + /* end of the kernel processed data */ + } __Reply__processor_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t entry_handle; + /* end of the kernel processed data */ + } __Reply__mach_memory_object_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info_outCnt; + integer_t host_info_out[15]; + } __Reply__host_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t lockgroup_info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t lockgroup_infoCnt; + } __Reply__host_lockgroup_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info64_outCnt; + integer_t host_info64_out[256]; + } __Reply__host_statistics64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__mach_host_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__mach_host_subsystem__defined +#define __ReplyUnion__mach_host_subsystem__defined +union __ReplyUnion__mach_host_subsystem { + __Reply__host_info_t Reply_host_info; + __Reply__host_kernel_version_t Reply_host_kernel_version; + __Reply___host_page_size_t Reply__host_page_size; + __Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry; + __Reply__host_processor_info_t Reply_host_processor_info; + __Reply__host_get_io_master_t Reply_host_get_io_master; + __Reply__host_get_clock_service_t Reply_host_get_clock_service; + __Reply__kmod_get_info_t Reply_kmod_get_info; + __Reply__host_zone_info_t Reply_host_zone_info; + __Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info; + __Reply__host_ipc_hash_info_t Reply_host_ipc_hash_info; + __Reply__processor_set_default_t Reply_processor_set_default; + __Reply__processor_set_create_t Reply_processor_set_create; + __Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64; + __Reply__host_statistics_t Reply_host_statistics; + __Reply__host_request_notification_t Reply_host_request_notification; + __Reply__host_lockgroup_info_t Reply_host_lockgroup_info; + __Reply__host_statistics64_t Reply_host_statistics64; +}; +#endif /* !__RequestUnion__mach_host_subsystem__defined */ + +#ifndef subsystem_to_name_map_mach_host +#define subsystem_to_name_map_mach_host \ + { "host_info", 200 },\ + { "host_kernel_version", 201 },\ + { "_host_page_size", 202 },\ + { "mach_memory_object_memory_entry", 203 },\ + { "host_processor_info", 204 },\ + { "host_get_io_master", 205 },\ + { "host_get_clock_service", 206 },\ + { "kmod_get_info", 207 },\ + { "host_zone_info", 208 },\ + { "host_virtual_physical_table_info", 209 },\ + { "host_ipc_hash_info", 210 },\ + { "processor_set_default", 213 },\ + { "processor_set_create", 214 },\ + { "mach_memory_object_memory_entry_64", 215 },\ + { "host_statistics", 216 },\ + { "host_request_notification", 217 },\ + { "host_lockgroup_info", 218 },\ + { "host_statistics64", 219 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _mach_host_user_ */ diff --git a/i386/include/mach/.svn/text-base/mach_init.h.svn-base b/i386/include/mach/.svn/text-base/mach_init.h.svn-base new file mode 100644 index 0000000..36a47fa --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_init.h.svn-base @@ -0,0 +1,130 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Items provided by the Mach environment initialization. + */ + +#ifndef _MACH_INIT_ +#define _MACH_INIT_ 1 + +#include <mach/mach_types.h> +#include <stdarg.h> + +#include <sys/cdefs.h> + +/* + * Kernel-related ports; how a task/thread controls itself + */ + +__BEGIN_DECLS +extern mach_port_t mach_task_self(void); +extern mach_port_t mach_host_self(void); +extern mach_port_t mach_thread_self(void); +extern kern_return_t host_page_size(host_t, vm_size_t *); + +extern mach_port_t mach_task_self_; +#define mach_task_self() mach_task_self_ +#define current_task() mach_task_self() + +__END_DECLS +#include <mach/mach_traps.h> +__BEGIN_DECLS + +/* + * Other important ports in the Mach user environment + */ + +extern mach_port_t bootstrap_port; +extern mach_port_t name_server_port; +extern mach_port_t environment_port; +extern mach_port_t service_port; + +/* + * Where these ports occur in the "mach_ports_register" + * collection... only servers or the runtime library need know. + */ + +#define NAME_SERVER_SLOT 0 +#define ENVIRONMENT_SLOT 1 +#define SERVICE_SLOT 2 + +#define MACH_PORTS_SLOTS_USED 3 + +/* + * Globally interesting numbers. + * These macros assume vm_page_size is a power-of-2. + */ + +extern vm_size_t vm_page_size; +extern vm_size_t vm_page_mask; +extern int vm_page_shift; + +#define trunc_page(x) ((x) & (~(vm_page_size - 1))) +#define round_page(x) trunc_page((x) + (vm_page_size - 1)) + +/* + * Page-size rounding macros for the fixed-width VM types. + */ +#define mach_vm_trunc_page(x) ((mach_vm_offset_t)(x) & ~((signed)PAGE_MASK)) +#define mach_vm_round_page(x) (((mach_vm_offset_t)(x) + PAGE_MASK) & ~((signed)PAGE_MASK)) + +/* + * fprintf_stderr uses vprintf_stderr_func to produce + * error messages, this can be overridden by a user + * application to point to a user-specified output function + */ +extern int (*vprintf_stderr_func)(const char *format, va_list ap); +__END_DECLS + +#endif /* _MACH_INIT_ */ diff --git a/i386/include/mach/.svn/text-base/mach_interface.h.svn-base b/i386/include/mach/.svn/text-base/mach_interface.h.svn-base new file mode 100644 index 0000000..af939cb --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_interface.h.svn-base @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (C) Apple Computer 1998 + * ALL Rights Reserved + */ +/* + * This file represents the interfaces that used to come + * from creating the user headers from the mach.defs file. + * Because mach.defs was decomposed, this file now just + * wraps up all the new interface headers generated from + * each of the new .defs resulting from that decomposition. + */ +#ifndef _MACH_INTERFACE_H_ +#define _MACH_INTERFACE_H_ + +#include <mach/clock_priv.h> +#include <mach/host_priv.h> +#include <mach/host_security.h> +#include <mach/ledger.h> +#include <mach/lock_set.h> +#include <mach/processor.h> +#include <mach/processor_set.h> +#include <mach/semaphore.h> +#include <mach/task.h> +#include <mach/thread_act.h> +#include <mach/vm_map.h> + +#endif /* _MACH_INTERFACE_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_param.h.svn-base b/i386/include/mach/.svn/text-base/mach_param.h.svn-base new file mode 100644 index 0000000..e4ead67 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_param.h.svn-base @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_param.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1986 + * + * Mach system sizing parameters + */ + +#ifndef _MACH_MACH_PARAM_H_ +#define _MACH_MACH_PARAM_H_ + +/* Number of "registered" ports */ + +#define TASK_PORT_REGISTER_MAX 3 + +#endif /* _MACH_MACH_PARAM_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_port.defs.svn-base b/i386/include/mach/.svn/text-base/mach_port.defs.svn-base new file mode 100644 index 0000000..5801ee4 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_port.defs.svn-base @@ -0,0 +1,492 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + mach_port 3200; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Returns the set of port and port set names + * to which the target task has access, along with + * the type (set or port) for each name. + */ + +routine mach_port_names( + task : ipc_space_t; + out names : mach_port_name_array_t; + out types : mach_port_type_array_t); + +/* + * Returns the type (set or port) for the port name + * within the target task. Also indicates whether + * there is a dead-name request for the name. + */ + +routine mach_port_type( + task : ipc_space_t; + name : mach_port_name_t; + out ptype : mach_port_type_t); + +/* + * Changes the name by which a port (or port set) is known to + * the target task. The new name can't be in use. The + * old name becomes available for recycling. + */ + +routine mach_port_rename( + task : ipc_space_t; + old_name : mach_port_name_t; + new_name : mach_port_name_t); + +/* + * Allocates the specified kind of object, with the given name. + * The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * New port sets are empty. New ports don't have any + * send/send-once rights or queued messages. The make-send + * count is zero and their queue limit is MACH_PORT_QLIMIT_DEFAULT. + * New sets, ports, and dead names have one user reference. + */ + +routine mach_port_allocate_name( + task : ipc_space_t; + right : mach_port_right_t; + name : mach_port_name_t); + +/* + * Allocates the specified kind of object. + * The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * Like port_allocate_name, but the kernel picks a name. + * It can use any name not associated with a right. + */ + +routine mach_port_allocate( + task : ipc_space_t; + right : mach_port_right_t; + out name : mach_port_name_t); + +/* + * Destroys all rights associated with the name and makes it + * available for recycling immediately. The name can be a + * port (possibly with multiple user refs), a port set, or + * a dead name (again, with multiple user refs). + */ + +routine mach_port_destroy( + task : ipc_space_t; + name : mach_port_name_t); + +/* + * Releases one send/send-once/dead-name user ref. + * Just like mach_port_mod_refs -1, but deduces the + * correct type of right. This allows a user task + * to release a ref for a port without worrying + * about whether the port has died or not. + */ + +routine mach_port_deallocate( + task : ipc_space_t; + name : mach_port_name_t); + +/* + * A port set always has one user ref. + * A send-once right always has one user ref. + * A dead name always has one or more user refs. + * A send right always has one or more user refs. + * A receive right always has one user ref. + * The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * MACH_PORT_RIGHT_SEND + * MACH_PORT_RIGHT_SEND_ONCE + */ + +routine mach_port_get_refs( + task : ipc_space_t; + name : mach_port_name_t; + right : mach_port_right_t; + out refs : mach_port_urefs_t); + +/* + * The delta is a signed change to the task's + * user ref count for the right. Only dead names + * and send rights can have a positive delta. + * The resulting user ref count can't be negative. + * If it is zero, the right is deallocated. + * If the name isn't a composite right, it becomes + * available for recycling. The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * MACH_PORT_RIGHT_SEND + * MACH_PORT_RIGHT_SEND_ONCE + */ + +routine mach_port_mod_refs( + task : ipc_space_t; + name : mach_port_name_t; + right : mach_port_right_t; + delta : mach_port_delta_t); + +skip; + +/* + * Only valid for receive rights. + * Sets the make-send count for the port. + */ +routine mach_port_set_mscount( + task : ipc_space_t; + name : mach_port_name_t; + mscount : mach_port_mscount_t); + +/* + * Only valid for port sets. Returns a list of + * the members. + */ + +routine mach_port_get_set_status( + task : ipc_space_t; + name : mach_port_name_t; + out members : mach_port_name_array_t); + +/* + * Puts the member port (the task must have receive rights) + * into the after port set. If the port is already a member + * of any set(s), it is atomically removed from those sets as + * part of this operation. (If after is MACH_PORT_NULL, the + * port is still removed from all current sets). + */ + +routine mach_port_move_member( + task : ipc_space_t; + member : mach_port_name_t; + after : mach_port_name_t); + +/* + * Requests a notification from the kernel. The request + * must supply the send-once right which is used for + * the notification. If a send-once right was previously + * registered, it is returned. The msg_id must be one of + * MACH_NOTIFY_PORT_DESTROYED (receive rights) + * MACH_NOTIFY_DEAD_NAME (send/receive/send-once rights) + * MACH_NOTIFY_NO_SENDERS (receive rights) + * + * The sync value specifies whether a notification should + * get sent immediately, if appropriate. The exact meaning + * depends on the notification: + * MACH_NOTIFY_PORT_DESTROYED: must be zero. + * MACH_NOTIFY_DEAD_NAME: if non-zero, then name can be dead, + * and the notification gets sent immediately. + * If zero, then name can't be dead. + * MACH_NOTIFY_NO_SENDERS: the notification gets sent + * immediately if the current mscount is greater + * than or equal to the sync value and there are no + * extant send rights. + */ + +routine mach_port_request_notification( + task : ipc_space_t; + name : mach_port_name_t; + msgid : mach_msg_id_t; + sync : mach_port_mscount_t; + notify : mach_port_send_once_t; + out previous : mach_port_move_send_once_t); + +/* + * Inserts the specified rights into the target task, + * using the specified name. If inserting send/receive + * rights and the task already has send/receive rights + * for the port, then the names must agree. In any case, + * the task gains a user ref for the port. + */ + +routine mach_port_insert_right( + task : ipc_space_t; + name : mach_port_name_t; + poly : mach_port_poly_t); + +/* + * Returns the specified right for the named port + * in the target task, extracting that right from + * the target task. The target task loses a user + * ref and the name may be available for recycling. + * msgt_name must be one of + * MACH_MSG_TYPE_MOVE_RECEIVE + * MACH_MSG_TYPE_COPY_SEND + * MACH_MSG_TYPE_MAKE_SEND + * MACH_MSG_TYPE_MOVE_SEND + * MACH_MSG_TYPE_MAKE_SEND_ONCE + * MACH_MSG_TYPE_MOVE_SEND_ONCE + */ + +routine mach_port_extract_right( + task : ipc_space_t; + name : mach_port_name_t; + msgt_name : mach_msg_type_name_t; + out poly : mach_port_poly_t); + +/* + * Only valid for receive rights. + * Sets the sequence number for the port. + */ + +routine mach_port_set_seqno( + task : ipc_space_t; + name : mach_port_name_t; + seqno : mach_port_seqno_t); + +/* + * Returns information about a port. + */ + +routine mach_port_get_attributes( + task : ipc_space_t; + name : mach_port_name_t; + flavor : mach_port_flavor_t; + out port_info_out : mach_port_info_t, CountInOut); + +/* + * Set attributes of a port + */ + +routine mach_port_set_attributes( + task : ipc_space_t; + name : mach_port_name_t; + flavor : mach_port_flavor_t; + port_info : mach_port_info_t); + + +/* + * Allocates the specified kind of object, qos version. + * The right must be + * MACH_PORT_RIGHT_RECEIVE + * Like port_allocate_name, but the kernel picks a name. + * It can use any name not associated with a right. + */ + +routine mach_port_allocate_qos( + task : ipc_space_t; + right : mach_port_right_t; + inout qos : mach_port_qos_t; + out name : mach_port_name_t); + + +/* + * Generic interface to allocation various kinds of ports. + * Should never be called directly by users (at least not + * unless they are exceedingly masochistic). + */ + +routine mach_port_allocate_full( + task : ipc_space_t; + right : mach_port_right_t; + proto : mach_port_t; + inout qos : mach_port_qos_t; + inout name : mach_port_name_t); + + +/* + * Pre-expand task port name space. + */ +routine task_set_port_space( + task : ipc_space_t; + table_entries : int); + + +/* + * Returns the exact number of extant send rights + * for the given receive right. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_get_srights( + task : ipc_space_t; + name : mach_port_name_t; + out srights : mach_port_rights_t); + + +/* + * Returns information about an IPC space. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_space_info( + task : ipc_space_t; + out space_info : ipc_info_space_t; + out table_info : ipc_info_name_array_t; + out tree_info : ipc_info_tree_name_array_t); + +/* + * Returns information about the dead-name requests + * registered with the named receive right. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_dnrequest_info( + task : ipc_space_t; + name : mach_port_name_t; + out dnr_total : unsigned; /* total size of table */ + out dnr_used : unsigned); /* amount used */ + +/* + * Return the type and address of the kernel object + * that the given send/receive right represents. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + * + * This interface is DEPRECATED in favor of the new + * mach_port_kernel_object64() call (see below). + */ +routine mach_port_kernel_object( + task : ipc_space_t; + name : mach_port_name_t; + out object_type : unsigned; + out object_addr : unsigned); + + +/* + * Inserts the specified rights into the portset identified + * by the <task, pset> pair. The results of passing in the + * Poly argument via the supplied disposition must yield a + * receive right. + * + * If the <task,pset> pair does not represent a valid portset + * KERN_INVALID_RIGHT is returned. + * + * If the passed in name argument does not represent a receive + * right, KERN_INVALID_CAPABILITY will be returned. + * + * If the port represented by the receive right is already in + * the portset, KERN_ALREADY_IN_SET is returned. + */ +routine mach_port_insert_member( + task : ipc_space_t; + name : mach_port_name_t; + pset : mach_port_name_t); + +/* + * Extracts the specified right from the named portset + * in the target task. + * the target task. The target task loses a user + * ref and the name may be available for recycling. + * msgt_name must be one of + * MACH_MSG_TYPE_MOVE_RECEIVE + * MACH_MSG_TYPE_COPY_SEND + * MACH_MSG_TYPE_MAKE_SEND + * MACH_MSG_TYPE_MOVE_SEND + * MACH_MSG_TYPE_MAKE_SEND_ONCE + * MACH_MSG_TYPE_MOVE_SEND_ONCE + */ + +routine mach_port_extract_member( + task : ipc_space_t; + name : mach_port_name_t; + pset : mach_port_name_t); + +/* + * Only valid for receive rights. + * Gets the context pointer for the port. + */ + +routine mach_port_get_context( + task : ipc_space_t; + name : mach_port_name_t; + out context : mach_vm_address_t); + +/* + * Only valid for receive rights. + * Sets the context pointer for the port. + */ + +routine mach_port_set_context( + task : ipc_space_t; + name : mach_port_name_t; + context : mach_vm_address_t); + +/* + * Return the type and address of the kernel object + * that the given send/receive right represents. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_kobject( + task : ipc_space_t; + name : mach_port_name_t; + out object_type : natural_t; + out object_addr : mach_vm_address_t); + + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/mach_port.h.svn-base b/i386/include/mach/.svn/text-base/mach_port.h.svn-base new file mode 100644 index 0000000..c964828 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_port.h.svn-base @@ -0,0 +1,1383 @@ +#ifndef _mach_port_user_ +#define _mach_port_user_ + +/* Module mach_port */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef mach_port_MSG_COUNT +#define mach_port_MSG_COUNT 31 +#endif /* mach_port_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine mach_port_names */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_names +( + ipc_space_t task, + mach_port_name_array_t *names, + mach_msg_type_number_t *namesCnt, + mach_port_type_array_t *types, + mach_msg_type_number_t *typesCnt +); + +/* Routine mach_port_type */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_type +( + ipc_space_t task, + mach_port_name_t name, + mach_port_type_t *ptype +); + +/* Routine mach_port_rename */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_rename +( + ipc_space_t task, + mach_port_name_t old_name, + mach_port_name_t new_name +); + +/* Routine mach_port_allocate_name */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate_name +( + ipc_space_t task, + mach_port_right_t right, + mach_port_name_t name +); + +/* Routine mach_port_allocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate +( + ipc_space_t task, + mach_port_right_t right, + mach_port_name_t *name +); + +/* Routine mach_port_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_destroy +( + ipc_space_t task, + mach_port_name_t name +); + +/* Routine mach_port_deallocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_deallocate +( + ipc_space_t task, + mach_port_name_t name +); + +/* Routine mach_port_get_refs */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_refs +( + ipc_space_t task, + mach_port_name_t name, + mach_port_right_t right, + mach_port_urefs_t *refs +); + +/* Routine mach_port_mod_refs */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_mod_refs +( + ipc_space_t task, + mach_port_name_t name, + mach_port_right_t right, + mach_port_delta_t delta +); + +/* Routine mach_port_set_mscount */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_mscount +( + ipc_space_t task, + mach_port_name_t name, + mach_port_mscount_t mscount +); + +/* Routine mach_port_get_set_status */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_set_status +( + ipc_space_t task, + mach_port_name_t name, + mach_port_name_array_t *members, + mach_msg_type_number_t *membersCnt +); + +/* Routine mach_port_move_member */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_move_member +( + ipc_space_t task, + mach_port_name_t member, + mach_port_name_t after +); + +/* Routine mach_port_request_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_request_notification +( + ipc_space_t task, + mach_port_name_t name, + mach_msg_id_t msgid, + mach_port_mscount_t sync, + mach_port_t notify, + mach_msg_type_name_t notifyPoly, + mach_port_t *previous +); + +/* Routine mach_port_insert_right */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_insert_right +( + ipc_space_t task, + mach_port_name_t name, + mach_port_t poly, + mach_msg_type_name_t polyPoly +); + +/* Routine mach_port_extract_right */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_extract_right +( + ipc_space_t task, + mach_port_name_t name, + mach_msg_type_name_t msgt_name, + mach_port_t *poly, + mach_msg_type_name_t *polyPoly +); + +/* Routine mach_port_set_seqno */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_seqno +( + ipc_space_t task, + mach_port_name_t name, + mach_port_seqno_t seqno +); + +/* Routine mach_port_get_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_attributes +( + ipc_space_t task, + mach_port_name_t name, + mach_port_flavor_t flavor, + mach_port_info_t port_info_out, + mach_msg_type_number_t *port_info_outCnt +); + +/* Routine mach_port_set_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_attributes +( + ipc_space_t task, + mach_port_name_t name, + mach_port_flavor_t flavor, + mach_port_info_t port_info, + mach_msg_type_number_t port_infoCnt +); + +/* Routine mach_port_allocate_qos */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate_qos +( + ipc_space_t task, + mach_port_right_t right, + mach_port_qos_t *qos, + mach_port_name_t *name +); + +/* Routine mach_port_allocate_full */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate_full +( + ipc_space_t task, + mach_port_right_t right, + mach_port_t proto, + mach_port_qos_t *qos, + mach_port_name_t *name +); + +/* Routine task_set_port_space */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_port_space +( + ipc_space_t task, + int table_entries +); + +/* Routine mach_port_get_srights */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_srights +( + ipc_space_t task, + mach_port_name_t name, + mach_port_rights_t *srights +); + +/* Routine mach_port_space_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_space_info +( + ipc_space_t task, + ipc_info_space_t *space_info, + ipc_info_name_array_t *table_info, + mach_msg_type_number_t *table_infoCnt, + ipc_info_tree_name_array_t *tree_info, + mach_msg_type_number_t *tree_infoCnt +); + +/* Routine mach_port_dnrequest_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_dnrequest_info +( + ipc_space_t task, + mach_port_name_t name, + unsigned *dnr_total, + unsigned *dnr_used +); + +/* Routine mach_port_kernel_object */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_kernel_object +( + ipc_space_t task, + mach_port_name_t name, + unsigned *object_type, + unsigned *object_addr +); + +/* Routine mach_port_insert_member */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_insert_member +( + ipc_space_t task, + mach_port_name_t name, + mach_port_name_t pset +); + +/* Routine mach_port_extract_member */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_extract_member +( + ipc_space_t task, + mach_port_name_t name, + mach_port_name_t pset +); + +/* Routine mach_port_get_context */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_context +( + ipc_space_t task, + mach_port_name_t name, + mach_vm_address_t *context +); + +/* Routine mach_port_set_context */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_context +( + ipc_space_t task, + mach_port_name_t name, + mach_vm_address_t context +); + +/* Routine mach_port_kobject */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_kobject +( + ipc_space_t task, + mach_port_name_t name, + natural_t *object_type, + mach_vm_address_t *object_addr +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__mach_port_subsystem__defined +#define __Request__mach_port_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_port_names_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_type_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t old_name; + mach_port_name_t new_name; + } __Request__mach_port_rename_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_right_t right; + mach_port_name_t name; + } __Request__mach_port_allocate_name_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_right_t right; + } __Request__mach_port_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_right_t right; + } __Request__mach_port_get_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_right_t right; + mach_port_delta_t delta; + } __Request__mach_port_mod_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_mscount_t mscount; + } __Request__mach_port_set_mscount_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_get_set_status_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t member; + mach_port_name_t after; + } __Request__mach_port_move_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notify; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_port_name_t name; + mach_msg_id_t msgid; + mach_port_mscount_t sync; + } __Request__mach_port_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t poly; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_insert_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_msg_type_name_t msgt_name; + } __Request__mach_port_extract_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_seqno_t seqno; + } __Request__mach_port_set_seqno_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_flavor_t flavor; + mach_msg_type_number_t port_info_outCnt; + } __Request__mach_port_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_flavor_t flavor; + mach_msg_type_number_t port_infoCnt; + integer_t port_info[10]; + } __Request__mach_port_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_right_t right; + mach_port_qos_t qos; + } __Request__mach_port_allocate_qos_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t proto; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_port_right_t right; + mach_port_qos_t qos; + mach_port_name_t name; + } __Request__mach_port_allocate_full_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int table_entries; + } __Request__task_set_port_space_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_get_srights_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_port_space_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_dnrequest_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_kernel_object_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_name_t pset; + } __Request__mach_port_insert_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_name_t pset; + } __Request__mach_port_extract_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_get_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_vm_address_t context; + } __Request__mach_port_set_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_kobject_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__mach_port_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__mach_port_subsystem__defined +#define __RequestUnion__mach_port_subsystem__defined +union __RequestUnion__mach_port_subsystem { + __Request__mach_port_names_t Request_mach_port_names; + __Request__mach_port_type_t Request_mach_port_type; + __Request__mach_port_rename_t Request_mach_port_rename; + __Request__mach_port_allocate_name_t Request_mach_port_allocate_name; + __Request__mach_port_allocate_t Request_mach_port_allocate; + __Request__mach_port_destroy_t Request_mach_port_destroy; + __Request__mach_port_deallocate_t Request_mach_port_deallocate; + __Request__mach_port_get_refs_t Request_mach_port_get_refs; + __Request__mach_port_mod_refs_t Request_mach_port_mod_refs; + __Request__mach_port_set_mscount_t Request_mach_port_set_mscount; + __Request__mach_port_get_set_status_t Request_mach_port_get_set_status; + __Request__mach_port_move_member_t Request_mach_port_move_member; + __Request__mach_port_request_notification_t Request_mach_port_request_notification; + __Request__mach_port_insert_right_t Request_mach_port_insert_right; + __Request__mach_port_extract_right_t Request_mach_port_extract_right; + __Request__mach_port_set_seqno_t Request_mach_port_set_seqno; + __Request__mach_port_get_attributes_t Request_mach_port_get_attributes; + __Request__mach_port_set_attributes_t Request_mach_port_set_attributes; + __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos; + __Request__mach_port_allocate_full_t Request_mach_port_allocate_full; + __Request__task_set_port_space_t Request_task_set_port_space; + __Request__mach_port_get_srights_t Request_mach_port_get_srights; + __Request__mach_port_space_info_t Request_mach_port_space_info; + __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info; + __Request__mach_port_kernel_object_t Request_mach_port_kernel_object; + __Request__mach_port_insert_member_t Request_mach_port_insert_member; + __Request__mach_port_extract_member_t Request_mach_port_extract_member; + __Request__mach_port_get_context_t Request_mach_port_get_context; + __Request__mach_port_set_context_t Request_mach_port_set_context; + __Request__mach_port_kobject_t Request_mach_port_kobject; +}; +#endif /* !__RequestUnion__mach_port_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__mach_port_subsystem__defined +#define __Reply__mach_port_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t names; + mach_msg_ool_descriptor_t types; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t namesCnt; + mach_msg_type_number_t typesCnt; + } __Reply__mach_port_names_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_type_t ptype; + } __Reply__mach_port_type_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_rename_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_allocate_name_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_name_t name; + } __Reply__mach_port_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_urefs_t refs; + } __Reply__mach_port_get_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_mod_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_mscount_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t members; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t membersCnt; + } __Reply__mach_port_get_set_status_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_move_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t previous; + /* end of the kernel processed data */ + } __Reply__mach_port_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_insert_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t poly; + /* end of the kernel processed data */ + } __Reply__mach_port_extract_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_seqno_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t port_info_outCnt; + integer_t port_info_out[10]; + } __Reply__mach_port_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_qos_t qos; + mach_port_name_t name; + } __Reply__mach_port_allocate_qos_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_qos_t qos; + mach_port_name_t name; + } __Reply__mach_port_allocate_full_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_port_space_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_rights_t srights; + } __Reply__mach_port_get_srights_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t table_info; + mach_msg_ool_descriptor_t tree_info; + /* end of the kernel processed data */ + NDR_record_t NDR; + ipc_info_space_t space_info; + mach_msg_type_number_t table_infoCnt; + mach_msg_type_number_t tree_infoCnt; + } __Reply__mach_port_space_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + unsigned dnr_total; + unsigned dnr_used; + } __Reply__mach_port_dnrequest_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + unsigned object_type; + unsigned object_addr; + } __Reply__mach_port_kernel_object_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_insert_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_extract_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t context; + } __Reply__mach_port_get_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + natural_t object_type; + mach_vm_address_t object_addr; + } __Reply__mach_port_kobject_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__mach_port_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__mach_port_subsystem__defined +#define __ReplyUnion__mach_port_subsystem__defined +union __ReplyUnion__mach_port_subsystem { + __Reply__mach_port_names_t Reply_mach_port_names; + __Reply__mach_port_type_t Reply_mach_port_type; + __Reply__mach_port_rename_t Reply_mach_port_rename; + __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name; + __Reply__mach_port_allocate_t Reply_mach_port_allocate; + __Reply__mach_port_destroy_t Reply_mach_port_destroy; + __Reply__mach_port_deallocate_t Reply_mach_port_deallocate; + __Reply__mach_port_get_refs_t Reply_mach_port_get_refs; + __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs; + __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount; + __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status; + __Reply__mach_port_move_member_t Reply_mach_port_move_member; + __Reply__mach_port_request_notification_t Reply_mach_port_request_notification; + __Reply__mach_port_insert_right_t Reply_mach_port_insert_right; + __Reply__mach_port_extract_right_t Reply_mach_port_extract_right; + __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno; + __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes; + __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes; + __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos; + __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full; + __Reply__task_set_port_space_t Reply_task_set_port_space; + __Reply__mach_port_get_srights_t Reply_mach_port_get_srights; + __Reply__mach_port_space_info_t Reply_mach_port_space_info; + __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info; + __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object; + __Reply__mach_port_insert_member_t Reply_mach_port_insert_member; + __Reply__mach_port_extract_member_t Reply_mach_port_extract_member; + __Reply__mach_port_get_context_t Reply_mach_port_get_context; + __Reply__mach_port_set_context_t Reply_mach_port_set_context; + __Reply__mach_port_kobject_t Reply_mach_port_kobject; +}; +#endif /* !__RequestUnion__mach_port_subsystem__defined */ + +#ifndef subsystem_to_name_map_mach_port +#define subsystem_to_name_map_mach_port \ + { "mach_port_names", 3200 },\ + { "mach_port_type", 3201 },\ + { "mach_port_rename", 3202 },\ + { "mach_port_allocate_name", 3203 },\ + { "mach_port_allocate", 3204 },\ + { "mach_port_destroy", 3205 },\ + { "mach_port_deallocate", 3206 },\ + { "mach_port_get_refs", 3207 },\ + { "mach_port_mod_refs", 3208 },\ + { "mach_port_set_mscount", 3210 },\ + { "mach_port_get_set_status", 3211 },\ + { "mach_port_move_member", 3212 },\ + { "mach_port_request_notification", 3213 },\ + { "mach_port_insert_right", 3214 },\ + { "mach_port_extract_right", 3215 },\ + { "mach_port_set_seqno", 3216 },\ + { "mach_port_get_attributes", 3217 },\ + { "mach_port_set_attributes", 3218 },\ + { "mach_port_allocate_qos", 3219 },\ + { "mach_port_allocate_full", 3220 },\ + { "task_set_port_space", 3221 },\ + { "mach_port_get_srights", 3222 },\ + { "mach_port_space_info", 3223 },\ + { "mach_port_dnrequest_info", 3224 },\ + { "mach_port_kernel_object", 3225 },\ + { "mach_port_insert_member", 3226 },\ + { "mach_port_extract_member", 3227 },\ + { "mach_port_get_context", 3228 },\ + { "mach_port_set_context", 3229 },\ + { "mach_port_kobject", 3230 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _mach_port_user_ */ diff --git a/i386/include/mach/.svn/text-base/mach_syscalls.h.svn-base b/i386/include/mach/.svn/text-base/mach_syscalls.h.svn-base new file mode 100644 index 0000000..0e04e4f --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_syscalls.h.svn-base @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_MACH_SYSCALLS_H_ +#define _MACH_MACH_SYSCALLS_H_ + +#include <mach/mach_traps.h> + +#endif /* _MACH_MACH_SYSCALLS_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_time.h.svn-base b/i386/include/mach/.svn/text-base/mach_time.h.svn-base new file mode 100644 index 0000000..6a7ce4f --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_time.h.svn-base @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2001-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACH_TIME_H_ +#define _MACH_MACH_TIME_H_ + +#include <mach/mach_types.h> + +#include <sys/cdefs.h> + +struct mach_timebase_info { + uint32_t numer; + uint32_t denom; +}; + +typedef struct mach_timebase_info *mach_timebase_info_t; +typedef struct mach_timebase_info mach_timebase_info_data_t; + +__BEGIN_DECLS + +kern_return_t mach_timebase_info( + mach_timebase_info_t info); + +kern_return_t mach_wait_until( + uint64_t deadline); + + +uint64_t mach_absolute_time(void); +__END_DECLS + +#endif /* _MACH_MACH_TIME_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_traps.h.svn-base b/i386/include/mach/.svn/text-base/mach_traps.h.svn-base new file mode 100644 index 0000000..50cbd0a --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_traps.h.svn-base @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Definitions of general Mach system traps. + * + * These are the definitions as seen from user-space. + * The kernel definitions are in <mach/syscall_sw.h>. + * Kernel RPC functions are defined in <mach/mach_interface.h>. + */ + +#ifndef _MACH_MACH_TRAPS_H_ +#define _MACH_MACH_TRAPS_H_ + +#include <stdint.h> + +#include <mach/std_types.h> +#include <mach/mach_types.h> +#include <mach/kern_return.h> +#include <mach/port.h> +#include <mach/vm_types.h> +#include <mach/clock_types.h> + +#include <machine/endian.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS + + + +extern kern_return_t macx_swapon( + uint64_t filename, + int flags, + int size, + int priority); + +extern kern_return_t macx_swapoff( + uint64_t filename, + int flags); + +extern kern_return_t macx_triggers( + int hi_water, + int low_water, + int flags, + mach_port_t alert_port); + +extern kern_return_t macx_backing_store_suspend( + boolean_t suspend); + +extern kern_return_t macx_backing_store_recovery( + int pid); + +extern boolean_t swtch_pri(int pri); + +extern boolean_t swtch(void); + +extern kern_return_t thread_switch( + mach_port_name_t thread_name, + int option, + mach_msg_timeout_t option_time); + +extern mach_port_name_t task_self_trap(void); + +/* + * Obsolete interfaces. + */ + +extern kern_return_t task_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *t); + +extern kern_return_t task_name_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *tn); + +extern kern_return_t pid_for_task( + mach_port_name_t t, + int *x); + +#if !defined(__LP64__) +/* these should go away altogether - so no 64 legacy please */ + +extern kern_return_t map_fd( + int fd, + vm_offset_t offset, + vm_offset_t *va, + boolean_t findspace, + vm_size_t size); + +#endif /* !defined(__LP64__) */ + + +__END_DECLS + +#endif /* _MACH_MACH_TRAPS_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_types.defs.svn-base b/i386/include/mach/.svn/text-base/mach_types.defs.svn-base new file mode 100644 index 0000000..d325179 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_types.defs.svn-base @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * NOTICE: This file was modified by McAfee Research in 2004 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ +/* + */ +/* + * Mach kernel interface type declarations + */ + +#ifndef _MACH_MACH_TYPES_DEFS_ +#define _MACH_MACH_TYPES_DEFS_ + + +#include <mach/std_types.defs> + +type memory_object_offset_t = uint64_t; +type memory_object_size_t = uint64_t; +type memory_object_cluster_size_t = uint32_t; +type memory_object_fault_info_t = array[16] of integer_t; + + +type mach_port_status_t = struct[10] of integer_t; /* obsolete */ + + /* mach_port_info_t: can hold either a + * mach_port_status_t (9 ints) or a + * mach_port_limits_t (1 int). If new flavors of + * mach_port_{get,set}_attributes are added, the size of + * this array may have to be increased. (See mach/port.h) + */ +type mach_port_flavor_t = int; +type mach_port_info_t = array[*:10] of integer_t; + +type task_t = mach_port_t +#if KERNEL_SERVER + intran: task_t convert_port_to_task(mach_port_t) + outtran: mach_port_t convert_task_to_port(task_t) + destructor: task_deallocate(task_t) +#endif /* KERNEL_SERVER */ + ; + +type task_name_t = mach_port_t +#if KERNEL_SERVER + intran: task_name_t convert_port_to_task_name(mach_port_t) + outtran: mach_port_t convert_task_name_to_port(task_name_t) + destructor: task_name_deallocate(task_name_t) +#endif /* KERNEL_SERVER */ + ; + +type thread_t = mach_port_t +#if KERNEL_SERVER + intran: thread_t convert_port_to_thread(mach_port_t) + outtran: mach_port_t convert_thread_to_port(thread_t) + destructor: thread_deallocate(thread_t) +#endif /* KERNEL_SERVER */ + ; + +type thread_act_t = mach_port_t +#if KERNEL_SERVER + intran: thread_act_t convert_port_to_thread(mach_port_t) + outtran: mach_port_t convert_thread_to_port(thread_act_t) + destructor: thread_deallocate(thread_act_t) +#endif /* KERNEL_SERVER */ + ; + +type thread_act_consume_ref_t = mach_port_move_send_t + cusertype: thread_act_t +#if KERNEL_SERVER + intran: thread_act_t convert_port_to_thread(mach_port_t) + destructor: thread_deallocate(thread_act_t) +#endif /* KERNEL_SERVER */ + ; + + /* thread_state_t: This inline array can hold + * a machine-dependent amount of data, defined in + * mach/machine/???? (currently THREAD_STATE_MAX, + * in mach/thread_state.h) + */ +#include <mach/machine/thread_state.h> +type thread_state_flavor_t = int; +type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t; + +type task_array_t = ^array[] of task_t; +type thread_array_t = ^array[] of thread_t; +type thread_act_array_t = ^array[] of thread_act_t; +type act_params_t = array[6] of int; + +type vm_map_t = mach_port_t +#if KERNEL_SERVER + intran: vm_map_t convert_port_to_map(mach_port_t) + destructor: vm_map_deallocate(vm_map_t) +#endif /* KERNEL_SERVER */ + ; + +type vm_task_entry_t = mach_port_t + cusertype: vm_map_t +#if KERNEL_SERVER + intran: vm_map_t convert_port_entry_to_map(mach_port_t) + destructor: vm_map_deallocate(vm_map_t) +#endif /* KERNEL_SERVER */ + ; + +type ipc_space_t = mach_port_t +#if KERNEL_SERVER + intran: ipc_space_t convert_port_to_space(mach_port_t) + destructor: space_deallocate(ipc_space_t) +#endif /* KERNEL_SERVER */ + ; + +type vm_prot_t = int; +type vm_inherit_t = int; +type vm_purgable_t = int; +type xxx_vm_statistics_data_t = struct[13] of integer_t; +type vm_behavior_t = int; +type vm_statistics_data_t = struct[15] of integer_t; +type vm_machine_attribute_t = int; +type vm_machine_attribute_val_t = int; +type vm_sync_t = int; + + /* thread_info_t: this inline array can hold any of: + * thread_basic_info_t (10 ints) + * policy_timeshare_info_t (5 ints) + * policy_fifo_info_t (4 ints) + * policy_rr_info_t (5 ints) + * if other thread_info flavors are added, this + * definition may need to be changed. (See + * mach/thread_info.h and mach/policy.h) */ +type thread_flavor_t = int; +type thread_info_t = array[*:12] of integer_t; + +type thread_policy_flavor_t = natural_t; +type thread_policy_t = array[*:16] of integer_t; + + /* task_info_t: this inline array can hold any of: + * task_basic_info_32_t (8 ints) + * task_basic_info_64_t (10 ints) + * task_events_info_t (8 ints) + * task_thread_times_info_t (4 ints) + * policy_timeshare_info_t (5 ints) + * policy_fifo_info_t (4 ints) + * policy_rr_info_t (5 ints) + * task security token (2 ints) + * task audit token (8 ints) + * If other task_info flavors are added, this + * definition may need to be changed. (See + * mach/task_info.h and mach/policy.h) */ +type task_flavor_t = int; +type task_info_t = array[*:10] of integer_t; + +type task_policy_flavor_t = natural_t; +type task_policy_t = array[*:16] of integer_t; + +type mem_entry_name_port_t = mach_port_t +#if KERNEL_SERVER + intran: mem_entry_name_port_t null_conversion(mach_port_t) + outtran: mach_port_t null_conversion(mem_entry_name_port_t) +#endif /* KERNEL_SERVER */ + ; + +type mem_entry_name_port_move_send_t = mach_port_move_send_t + cusertype: mem_entry_name_port_t +#if KERNEL_SERVER + intran: mem_entry_name_port_t null_conversion(mach_port_t) + outtran: mach_port_t null_conversion(mem_entry_name_port_t) +#endif /* KERNEL_SERVER */ + ; + +type memory_object_default_t = mach_port_t + ; + +type memory_object_t = mach_port_t + ; + + +type memory_object_control_t = mach_port_t + ; + +type memory_object_name_t = mach_port_t + ctype: mach_port_t + ; + + +type memory_object_copy_strategy_t = int; +type memory_object_return_t = int; + +type machine_info_data_t = struct[5] of integer_t; +type machine_slot_data_t = struct[8] of integer_t; + +type host_t = mach_port_t +#if KERNEL_SERVER + intran: host_t convert_port_to_host(mach_port_t) + outtran: mach_port_t convert_host_to_port(host_t) +#endif /* KERNEL_SERVER */ + ; + +type host_priv_t = mach_port_t +#if KERNEL_SERVER + intran: host_priv_t convert_port_to_host_priv(mach_port_t) +#endif /* KERNEL_SERVER */ + ; + +type host_security_t = mach_port_t +#if KERNEL_SERVER + intran: host_security_t convert_port_to_host_security(mach_port_t) +#endif /* KERNEL_SERVER */ + ; + + /* + * host_info_t: variable-sized inline array that can contain: + * + * host_basic_info_old_t (5 ints) + * host_basic_info_t (12 ints) + * host_sched_info_t (2 ints) + * kernel_resource_sizes_t (5 ints) + * host_load_info_t (6 ints) + * vm_statistics32_t (15 ints) + * + * If other host_info flavors are added, this definition may + * need to be changed. (See mach/{host_info,vm_statistics}.h) + */ +type host_flavor_t = int; +type host_info_t = array[*:15] of integer_t; + + + /* + * host_info64_t: variable-sized inline array that can contain: + * + * vm_statistics_t (6 ints and 9 longs) + */ +type host_info64_t = array[*:256] of integer_t; + +type processor_t = mach_port_t +#if KERNEL_SERVER + intran: processor_t convert_port_to_processor(mach_port_t) + outtran: mach_port_t convert_processor_to_port(processor_t) +#endif /* KERNEL_SERVER */ + ; + +type processor_array_t = ^array[] of processor_t; + + /* processor_info_t: variable-sized inline array that can + * contain: + * processor_basic_info_t: (5 ints) + * processor_cpu_load_info_t:(4 ints) + * processor_machine_info_t :(12 ints) + * If other processor_info flavors are added, this definition + * may need to be changed. (See mach/processor_info.h) */ +type processor_flavor_t = int; +type processor_info_t = array[*:12] of integer_t; +type processor_info_array_t = ^array[] of integer_t; + +type processor_set_t = mach_port_t +#if KERNEL_SERVER + intran: processor_set_t convert_port_to_pset(mach_port_t) + outtran: mach_port_t convert_pset_to_port(processor_set_t) + destructor: pset_deallocate(processor_set_t) +#endif /* KERNEL_SERVER */ + ; + +type processor_set_array_t = ^array[] of processor_set_t; + +type processor_set_name_t = mach_port_t +#if KERNEL_SERVER + intran: processor_set_name_t convert_port_to_pset_name(mach_port_t) + outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t) + destructor: pset_deallocate(processor_set_name_t) +#endif /* KERNEL_SERVER */ + ; + +type processor_set_name_array_t = ^array[] of processor_set_name_t; + + /* processor_set_info_t: variable-size inline array + * that can hold: + * processor_set_basic_info (5 ints) + * processor_set_load_info (4 ints) + * policy_timeshare_base_t (1 int) + * policy_fifo_base_t (1 int) + * policy_rr_base_t (1 int) + * policy_timeshare_base_t (1 int) + * policy_fifo_base_t (1 int) + * policy_rr_base_t (1 int) + * policy_t (1 int) + * If other flavors are added, this definition may + * need to be changed. (see mach/processor.h) */ +type processor_set_flavor_t = int; +type processor_set_info_t = array[*:5] of integer_t; + +type bootstrap_t = mach_port_t; + +type kernel_version_t = c_string[*:512]; +type kernel_boot_info_t = c_string[*:4096]; + +type time_value_t = struct[2] of integer_t; + +type mach_port_qos_t = struct[2] of integer_t; + +type emulation_vector_t = ^array[] of vm_offset_t; + +type inline_existence_map_t = array[*:512] of char; + +type policy_t = int; + /* policy_info_t: variable-size inline array. Can hold: + * policy_timeshare_info_t (5 ints) + * policy_fifo_info_t (4 ints) + * policy_rr_info_t (5 ints) */ +type policy_base_t = array[*:5] of integer_t; +type policy_info_t = array[*:2] of integer_t; +type policy_limit_t = array[*:1] of integer_t; + +type ledger_t = mach_port_t +#if KERNEL_SERVER + intran: ledger_t convert_port_to_ledger(mach_port_t) + outtran: mach_port_t convert_ledger_to_port(ledger_t) +#endif /* KERNEL_SERVER */ + ; + +type ledger_array_t = ^array[] of ledger_t; +type ledger_item_t = integer_t; + +type security_token_t = struct[2] of uint32_t; +type audit_token_t = struct[8] of uint32_t; + +type msg_labels_t = mach_port_t; + + /* memory_object_info_t: variable-size inline array: + * memory_object_attr_info_t (5 ints) + * XXX actually it's 6 ints temporarily (object_ready!) + * memory_object_behave_info_t (4 ints) + * memory_object_perf_info_t (2 ints) + * old_memory_object_attr_info_t (3 ints) + * memory_object_norma_info_t (5 ints) + * If other flavors are added, this definition may + * need to be changed. (see mach/memory_object.h) */ +type memory_object_flavor_t = int; +type memory_object_info_t = array[*:6] of int; + + /* vm_region_info_t: variable-size inline array that can hold: + * vm_region_basic_info_t (8 ints) + * If other flavors are added, this definition may + * need to be changed. (see mach/vm_region.h) */ +type vm_region_flavor_t = int; +type vm_region_info_t = array[*:10] of int; +type vm_region_recurse_info_t = array[*:19] of int; + +type vm_page_info_flavor_t = int; +type vm_page_info_t = array[*:32] of int; + +type mach_vm_read_entry_t = array[512] of mach_vm_offset_t; +type vm_read_entry_t = array[512] of vm_offset_t; +#if VM32_SUPPORT +type vm32_read_entry_t = array[512] of vm32_offset_t; +#endif + +type exception_mask_t = int; +type exception_behavior_t = int; + +type exception_handler_t = mach_port_t; + +type exception_handler_array_t = + array[*:32] of exception_handler_t; + +type exception_behavior_array_t = + array[*:32] of exception_behavior_t; + +type exception_flavor_array_t = + array[*:32] of thread_state_flavor_t; + +type exception_mask_array_t = + array[*:32] of exception_mask_t; + +type semaphore_t = mach_port_t +#if KERNEL_SERVER + intran: semaphore_t convert_port_to_semaphore(mach_port_t) + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) + destructor: semaphore_dereference(semaphore_t) +#endif /* KERNEL_SERVER */ + ; + +type semaphore_consume_ref_t = mach_port_move_send_t + cusertype: semaphore_t +#if KERNEL_SERVER + intran: semaphore_t convert_port_to_semaphore(mach_port_t) + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) + destructor: semaphore_dereference(semaphore_t) +#endif /* KERNEL_SERVER */ + ; + +type lock_set_t = mach_port_t +#if KERNEL_SERVER + intran: lock_set_t convert_port_to_lock_set(mach_port_t) + outtran: mach_port_t convert_lock_set_to_port(lock_set_t) + destructor: lock_set_dereference(lock_set_t) +#endif /* KERNEL_SERVER */ + ; + +/* kernel module loader */ +type kmod_t = int; +type kmod_control_flavor_t = int; + +type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE + ctype: kmod_args_t; + +type io_master_t = mach_port_t; +type UNDServerRef = mach_port_t; + +#if KERNEL_SERVER + +simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */ + +#endif /* KERNEL_SERVER */ + +import <mach/mig.h>; +import <mach/mach_types.h>; + +#endif /* _MACH_MACH_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/mach_types.h.svn-base b/i386/include/mach/.svn/text-base/mach_types.h.svn-base new file mode 100644 index 0000000..30ebec9 --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_types.h.svn-base @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ +/* + * File: mach/mach_types.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1986 + * + * Mach external interface definitions. + * + */ + +#ifndef _MACH_MACH_TYPES_H_ +#define _MACH_MACH_TYPES_H_ + +#include <stdint.h> + +#include <sys/cdefs.h> + +#include <mach/host_info.h> +#include <mach/host_notify.h> +#include <mach/host_special_ports.h> +#include <mach/machine.h> +#include <mach/machine/vm_types.h> +#include <mach/memory_object_types.h> +#include <mach/message.h> +#include <mach/exception_types.h> +#include <mach/port.h> +#include <mach/processor_info.h> +#include <mach/task_info.h> +#include <mach/task_policy.h> +#include <mach/task_special_ports.h> +#include <mach/thread_info.h> +#include <mach/thread_policy.h> +#include <mach/thread_special_ports.h> +#include <mach/thread_status.h> +#include <mach/time_value.h> +#include <mach/clock_types.h> +#include <mach/vm_attributes.h> +#include <mach/vm_inherit.h> +#include <mach/vm_purgable.h> +#include <mach/vm_behavior.h> +#include <mach/vm_prot.h> +#include <mach/vm_statistics.h> +#include <mach/vm_sync.h> +#include <mach/vm_types.h> +#include <mach/vm_region.h> +#include <mach/kmod.h> + + +/* + * If we are not in the kernel, then these will all be represented by + * ports at user-space. + */ +typedef mach_port_t task_t; +typedef mach_port_t task_name_t; +typedef mach_port_t thread_t; +typedef mach_port_t thread_act_t; +typedef mach_port_t ipc_space_t; +typedef mach_port_t host_t; +typedef mach_port_t host_priv_t; +typedef mach_port_t host_security_t; +typedef mach_port_t processor_t; +typedef mach_port_t processor_set_t; +typedef mach_port_t processor_set_control_t; +typedef mach_port_t semaphore_t; +typedef mach_port_t lock_set_t; +typedef mach_port_t ledger_t; +typedef mach_port_t alarm_t; +typedef mach_port_t clock_serv_t; +typedef mach_port_t clock_ctrl_t; + + +/* + * These aren't really unique types. They are just called + * out as unique types at one point in history. So we list + * them here for compatibility. + */ +typedef processor_set_t processor_set_name_t; + +/* + * These types are just hard-coded as ports + */ +typedef mach_port_t clock_reply_t; +typedef mach_port_t bootstrap_t; +typedef mach_port_t mem_entry_name_port_t; +typedef mach_port_t exception_handler_t; +typedef exception_handler_t *exception_handler_array_t; +typedef mach_port_t vm_task_entry_t; +typedef mach_port_t io_master_t; +typedef mach_port_t UNDServerRef; + +/* + * Mig doesn't translate the components of an array. + * For example, Mig won't use the thread_t translations + * to translate a thread_array_t argument. So, these definitions + * are not completely accurate at the moment for other kernel + * components. + */ +typedef task_t *task_array_t; +typedef thread_t *thread_array_t; +typedef processor_set_t *processor_set_array_t; +typedef processor_set_t *processor_set_name_array_t; +typedef processor_t *processor_array_t; +typedef thread_act_t *thread_act_array_t; +typedef ledger_t *ledger_array_t; + +/* + * However the real mach_types got declared, we also have to declare + * types with "port" in the name for compatability with the way OSF + * had declared the user interfaces at one point. Someday these should + * go away. + */ +typedef task_t task_port_t; +typedef task_array_t task_port_array_t; +typedef thread_t thread_port_t; +typedef thread_array_t thread_port_array_t; +typedef ipc_space_t ipc_space_port_t; +typedef host_t host_name_t; +typedef host_t host_name_port_t; +typedef processor_set_t processor_set_port_t; +typedef processor_set_t processor_set_name_port_t; +typedef processor_set_array_t processor_set_name_port_array_t; +typedef processor_set_t processor_set_control_port_t; +typedef processor_t processor_port_t; +typedef processor_array_t processor_port_array_t; +typedef thread_act_t thread_act_port_t; +typedef thread_act_array_t thread_act_port_array_t; +typedef semaphore_t semaphore_port_t; +typedef lock_set_t lock_set_port_t; +typedef ledger_t ledger_port_t; +typedef ledger_array_t ledger_port_array_t; +typedef alarm_t alarm_port_t; +typedef clock_serv_t clock_serv_port_t; +typedef clock_ctrl_t clock_ctrl_port_t; +typedef exception_handler_t exception_port_t; +typedef exception_handler_array_t exception_port_arrary_t; + + +#define TASK_NULL ((task_t) 0) +#define TASK_NAME_NULL ((task_name_t) 0) +#define THREAD_NULL ((thread_t) 0) +#define THR_ACT_NULL ((thread_act_t) 0) +#define IPC_SPACE_NULL ((ipc_space_t) 0) +#define HOST_NULL ((host_t) 0) +#define HOST_PRIV_NULL ((host_priv_t)0) +#define HOST_SECURITY_NULL ((host_security_t)0) +#define PROCESSOR_SET_NULL ((processor_set_t) 0) +#define PROCESSOR_NULL ((processor_t) 0) +#define SEMAPHORE_NULL ((semaphore_t) 0) +#define LOCK_SET_NULL ((lock_set_t) 0) +#define LEDGER_NULL ((ledger_t) 0) +#define ALARM_NULL ((alarm_t) 0) +#define CLOCK_NULL ((clock_t) 0) +#define UND_SERVER_NULL ((UNDServerRef) 0) + +typedef natural_t ledger_item_t; +#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0)) + +typedef mach_vm_offset_t *emulation_vector_t; +typedef char *user_subsystem_t; + +typedef char *labelstr_t; +/* + * Backwards compatibility, for those programs written + * before mach/{std,mach}_types.{defs,h} were set up. + */ +#include <mach/std_types.h> + +#endif /* _MACH_MACH_TYPES_H_ */ diff --git a/i386/include/mach/.svn/text-base/mach_vm.defs.svn-base b/i386/include/mach/.svn/text-base/mach_vm.defs.svn-base new file mode 100644 index 0000000..8dbb71f --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_vm.defs.svn-base @@ -0,0 +1,480 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_vm.defs + * + * Exported kernel VM calls (for any task on the platform). + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) + mach_vm +#else + vm_map_lp64_local +#endif + 4800; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Allocate zero-filled memory in the address space + * of the target task, either at the specified address, + * or wherever space can be found (controlled by flags), + * of the specified size. The address at which the + * allocation actually took place is returned. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_allocate( +#else +routine vm_allocate( +#endif + target : vm_task_entry_t; + inout address : mach_vm_address_t; + size : mach_vm_size_t; + flags : int); + +/* + * Deallocate the specified range from the virtual + * address space of the target virtual memory map. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_deallocate( +#else +routine vm_deallocate( +#endif + target : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t); + +/* + * Set the current or maximum protection attribute + * for the specified range of the virtual address + * space of the target virtual memory map. The current + * protection limits the memory access rights of threads + * within the map; the maximum protection limits the accesses + * that may be given in the current protection. + * Protections are specified as a set of {read, write, execute} + * *permissions*. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_protect( +#else +routine vm_protect( +#endif + target_task : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + set_maximum : boolean_t; + new_protection : vm_prot_t); + +/* + * Set the inheritance attribute for the specified range + * of the virtual address space of the target address space. + * The inheritance value is one of {none, copy, share}, and + * specifies how the child address space should acquire + * this memory at the time of a task_create call. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_inherit( +#else +routine vm_inherit( +#endif + target_task : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + new_inheritance : vm_inherit_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit reading.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_read( +#else +routine vm_read( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + out data : pointer_t); + +/* + * List corrollary to vm_read, returns mapped contents of specified + * ranges within target address space. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_read_list( +#else +routine vm_read_list( +#endif + target_task : vm_map_t; + inout data_list : mach_vm_read_entry_t; + count : natural_t); + +/* + * Writes the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit writing.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_write( +#else +routine vm_write( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + data : pointer_t); + +/* + * Copy the contents of the source range of the virtual + * address space of the target task to the destination + * range in that same address space. [Both of the + * ranges must be aligned on a virtual page boundary, + * and must be multiples of pages in extent. The + * protection on the source range must permit reading, + * and the protection on the destination range must + * permit writing.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_copy( +#else +routine vm_copy( +#endif + target_task : vm_map_t; + source_address : mach_vm_address_t; + size : mach_vm_size_t; + dest_address : mach_vm_address_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [There + * are no alignment restrictions, and the results will + * overwrite the area pointed to by data - which must + * already exist. The protection on the specified range + * must permit reading.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_read_overwrite( +#else +routine vm_read_overwrite( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + data : mach_vm_address_t; + out outsize : mach_vm_size_t); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_msync( +#else +routine vm_msync( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + sync_flags : vm_sync_t ); + +/* + * Set the paging behavior attribute for the specified range + * of the virtual address space of the target task. + * The behavior value is one of {default, random, forward + * sequential, reverse sequential} and indicates the expected + * page reference pattern for the specified range. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_behavior_set( +#else +routine vm_behavior_set( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + new_behavior : vm_behavior_t); + + +/* + * Map a user-supplie memory object into the virtual address + * space of the target task. If desired (anywhere is TRUE), + * the kernel will find a suitable address range of the + * specified size; else, the specific address will be allocated. + * + * The beginning address of the range will be aligned on a virtual + * page boundary, be at or beyond the address specified, and + * meet the mask requirements (bits turned on in the mask must not + * be turned on in the result); the size of the range, in bytes, + * will be rounded up to an integral number of virtual pages. + * + * The memory in the resulting range will be associated with the + * specified memory object, with the beginning of the memory range + * referring to the specified offset into the memory object. + * + * The mapping will take the current and maximum protections and + * the inheritance attributes specified; see the vm_protect and + * vm_inherit calls for a description of these attributes. + * + * If desired (copy is TRUE), the memory range will be filled + * with a copy of the data from the memory object; this copy will + * be private to this mapping in this target task. Otherwise, + * the memory in this mapping will be shared with other mappings + * of the same memory object at the same offset (in this task or + * in other tasks). [The Mach kernel only enforces shared memory + * consistency among mappings on one host with similar page alignments. + * The user-defined memory manager for this object is responsible + * for further consistency.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_map( +#else +routine vm_map( +#endif + target_task : vm_task_entry_t; + inout address : mach_vm_address_t; + size : mach_vm_size_t; + mask : mach_vm_offset_t; + flags : int; + object : mem_entry_name_port_t; + offset : memory_object_offset_t; + copy : boolean_t; + cur_protection : vm_prot_t; + max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Set/Get special properties of memory associated + * to some virtual address range, such as cachability, + * migrability, replicability. Machine-dependent. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_machine_attribute( +#else +routine vm_machine_attribute( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + attribute : vm_machine_attribute_t; + inout value : vm_machine_attribute_val_t); + +/* + * Map portion of a task's address space. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_remap( +#else +routine vm_remap( +#endif + target_task : vm_map_t; + inout target_address : mach_vm_address_t; + size : mach_vm_size_t; + mask : mach_vm_offset_t; + anywhere : boolean_t; + src_task : vm_map_t; + src_address : mach_vm_address_t; + copy : boolean_t; + out cur_protection : vm_prot_t; + out max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Give the caller information on the given location in a virtual + * address space. If a page is mapped return ref and dirty info. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_page_query( +#else +routine vm_map_page_query( +#endif + target_map :vm_map_t; + offset :mach_vm_offset_t; + out disposition :integer_t; + out ref_count :integer_t); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_region_recurse( +#else +routine vm_region_recurse_64( +#endif + target_task : vm_map_t; + inout address : mach_vm_address_t; + out size : mach_vm_size_t; + inout nesting_depth : natural_t; + out info : vm_region_recurse_info_t,CountInOut); + +/* + * Returns information about the contents of the virtual + * address space of the target task at the specified + * address. The returned protection, inheritance, sharing + * and memory object values apply to the entire range described + * by the address range returned; the memory object offset + * corresponds to the beginning of the address range. + * [If the specified address is not allocated, the next + * highest address range is described. If no addresses beyond + * the one specified are allocated, the call returns KERN_NO_SPACE.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_region( +#else +routine vm_region_64( +#endif + target_task : vm_map_t; + inout address : mach_vm_address_t; + out size : mach_vm_size_t; + flavor : vm_region_flavor_t; + out info : vm_region_info_t, CountInOut; + out object_name : memory_object_name_t = + MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t); + +/* + * Allow application level processes to create named entries which + * correspond to mapped portions of their address space. These named + * entries can then be manipulated, shared with other processes in + * other address spaces and ultimately mapped in ohter address spaces + * + * THIS INTERFACE IS STILL EVOLVING. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +#if !defined(__LP64__) || KERNEL_SERVER || XNU_KERNEL_PRIVATE || LIBSYSCALL_INTERFACE +routine _mach_make_memory_entry( +#else +routine mach_make_memory_entry( +#endif +#else +routine mach_make_memory_entry_64( +#endif + target_task :vm_map_t; + inout size :memory_object_size_t; + offset :memory_object_offset_t; + permission :vm_prot_t; + out object_handle :mem_entry_name_port_move_send_t; + parent_handle :mem_entry_name_port_t); + +/* + * Control behavior and investigate state of a "purgable" object in + * the virtual address space of the target task. A purgable object is + * created via a call to mach_vm_allocate() with VM_FLAGS_PURGABLE + * specified. See the routine implementation for a complete + * definition of the routine. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_purgable_control( +#else +routine vm_purgable_control( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + control : vm_purgable_t; + inout state : int); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_page_info( + target_task : vm_map_t; + address : mach_vm_address_t; + flavor : vm_page_info_flavor_t; + out info : vm_page_info_t, CountInOut); +#else +skip; +#endif + +/****************************** Legacy section ***************************/ +/* The following definitions are exist to provide compatibility with */ +/* the legacy APIs. They are no different. We just need to produce */ +/* the user-level stub interface for them. */ +/****************************** Legacy section ***************************/ + + +/* + * These interfaces just aren't supported in the new (wide) model: + * + * mach_vm_region_info() - + * vm_map_pages_info() - + * no user-level replacement for these MACH_DEBUG interfaces + * vm_map_get_upl() - + * no user-level replacement at the moment + * vm_region_info() - + * use mach_vm_region_info() or vm_region_info_64() + * vm_region_recurse() - + * use mach_vm_region_recurse() or vm_region_recurse_64() + */ + +/* + * The following legacy interfaces are provides as macro wrappers to the new + * interfaces. You should strive to use the new ones instead: + * + * vm_map() - + * use mach_vm_map() or vm_map_64() + * vm_region() - + * use mach_vm_region() or vm_region_64() + * mach_make_memory_entry() - + * use mach_vm_make_memory_entry() or mach_make_memory_entry_64() + */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/mach_vm.h.svn-base b/i386/include/mach/.svn/text-base/mach_vm.h.svn-base new file mode 100644 index 0000000..f72b17e --- /dev/null +++ b/i386/include/mach/.svn/text-base/mach_vm.h.svn-base @@ -0,0 +1,1032 @@ +#ifndef _mach_vm_user_ +#define _mach_vm_user_ + +/* Module mach_vm */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef mach_vm_MSG_COUNT +#define mach_vm_MSG_COUNT 20 +#endif /* mach_vm_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine mach_vm_allocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_allocate +( + vm_map_t target, + mach_vm_address_t *address, + mach_vm_size_t size, + int flags +); + +/* Routine mach_vm_deallocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_deallocate +( + vm_map_t target, + mach_vm_address_t address, + mach_vm_size_t size +); + +/* Routine mach_vm_protect */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_protect +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + boolean_t set_maximum, + vm_prot_t new_protection +); + +/* Routine mach_vm_inherit */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_inherit +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_inherit_t new_inheritance +); + +/* Routine mach_vm_read */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_read +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_offset_t *data, + mach_msg_type_number_t *dataCnt +); + +/* Routine mach_vm_read_list */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_read_list +( + vm_map_t target_task, + mach_vm_read_entry_t data_list, + natural_t count +); + +/* Routine mach_vm_write */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_write +( + vm_map_t target_task, + mach_vm_address_t address, + vm_offset_t data, + mach_msg_type_number_t dataCnt +); + +/* Routine mach_vm_copy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_copy +( + vm_map_t target_task, + mach_vm_address_t source_address, + mach_vm_size_t size, + mach_vm_address_t dest_address +); + +/* Routine mach_vm_read_overwrite */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_read_overwrite +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + mach_vm_address_t data, + mach_vm_size_t *outsize +); + +/* Routine mach_vm_msync */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_msync +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_sync_t sync_flags +); + +/* Routine mach_vm_behavior_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_behavior_set +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_behavior_t new_behavior +); + +/* Routine mach_vm_map */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_map +( + vm_map_t target_task, + mach_vm_address_t *address, + mach_vm_size_t size, + mach_vm_offset_t mask, + int flags, + mem_entry_name_port_t object, + memory_object_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance +); + +/* Routine mach_vm_machine_attribute */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_machine_attribute +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_machine_attribute_t attribute, + vm_machine_attribute_val_t *value +); + +/* Routine mach_vm_remap */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_remap +( + vm_map_t target_task, + mach_vm_address_t *target_address, + mach_vm_size_t size, + mach_vm_offset_t mask, + boolean_t anywhere, + vm_map_t src_task, + mach_vm_address_t src_address, + boolean_t copy, + vm_prot_t *cur_protection, + vm_prot_t *max_protection, + vm_inherit_t inheritance +); + +/* Routine mach_vm_page_query */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_page_query +( + vm_map_t target_map, + mach_vm_offset_t offset, + integer_t *disposition, + integer_t *ref_count +); + +/* Routine mach_vm_region_recurse */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region_recurse +( + vm_map_t target_task, + mach_vm_address_t *address, + mach_vm_size_t *size, + natural_t *nesting_depth, + vm_region_recurse_info_t info, + mach_msg_type_number_t *infoCnt +); + +/* Routine mach_vm_region */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region +( + vm_map_t target_task, + mach_vm_address_t *address, + mach_vm_size_t *size, + vm_region_flavor_t flavor, + vm_region_info_t info, + mach_msg_type_number_t *infoCnt, + mach_port_t *object_name +); + +/* Routine _mach_make_memory_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t _mach_make_memory_entry +( + vm_map_t target_task, + memory_object_size_t *size, + memory_object_offset_t offset, + vm_prot_t permission, + mem_entry_name_port_t *object_handle, + mem_entry_name_port_t parent_handle +); + +/* Routine mach_vm_purgable_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_purgable_control +( + vm_map_t target_task, + mach_vm_address_t address, + vm_purgable_t control, + int *state +); + +/* Routine mach_vm_page_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_page_info +( + vm_map_t target_task, + mach_vm_address_t address, + vm_page_info_flavor_t flavor, + vm_page_info_t info, + mach_msg_type_number_t *infoCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__mach_vm_subsystem__defined +#define __Request__mach_vm_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + int flags; + } __Request__mach_vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + } __Request__mach_vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + boolean_t set_maximum; + vm_prot_t new_protection; + } __Request__mach_vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_inherit_t new_inheritance; + } __Request__mach_vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + } __Request__mach_vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_read_entry_t data_list; + natural_t count; + } __Request__mach_vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_msg_type_number_t dataCnt; + } __Request__mach_vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t source_address; + mach_vm_size_t size; + mach_vm_address_t dest_address; + } __Request__mach_vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + mach_vm_address_t data; + } __Request__mach_vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_sync_t sync_flags; + } __Request__mach_vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_behavior_t new_behavior; + } __Request__mach_vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + mach_vm_offset_t mask; + int flags; + memory_object_offset_t offset; + boolean_t copy; + vm_prot_t cur_protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + } __Request__mach_vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_machine_attribute_t attribute; + vm_machine_attribute_val_t value; + } __Request__mach_vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t src_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t target_address; + mach_vm_size_t size; + mach_vm_offset_t mask; + boolean_t anywhere; + mach_vm_address_t src_address; + boolean_t copy; + vm_inherit_t inheritance; + } __Request__mach_vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_offset_t offset; + } __Request__mach_vm_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + } __Request__mach_vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + vm_region_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__mach_vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + memory_object_offset_t offset; + vm_prot_t permission; + } __Request___mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + vm_purgable_t control; + int state; + } __Request__mach_vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + vm_page_info_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__mach_vm_page_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__mach_vm_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__mach_vm_subsystem__defined +#define __RequestUnion__mach_vm_subsystem__defined +union __RequestUnion__mach_vm_subsystem { + __Request__mach_vm_allocate_t Request_mach_vm_allocate; + __Request__mach_vm_deallocate_t Request_mach_vm_deallocate; + __Request__mach_vm_protect_t Request_mach_vm_protect; + __Request__mach_vm_inherit_t Request_mach_vm_inherit; + __Request__mach_vm_read_t Request_mach_vm_read; + __Request__mach_vm_read_list_t Request_mach_vm_read_list; + __Request__mach_vm_write_t Request_mach_vm_write; + __Request__mach_vm_copy_t Request_mach_vm_copy; + __Request__mach_vm_read_overwrite_t Request_mach_vm_read_overwrite; + __Request__mach_vm_msync_t Request_mach_vm_msync; + __Request__mach_vm_behavior_set_t Request_mach_vm_behavior_set; + __Request__mach_vm_map_t Request_mach_vm_map; + __Request__mach_vm_machine_attribute_t Request_mach_vm_machine_attribute; + __Request__mach_vm_remap_t Request_mach_vm_remap; + __Request__mach_vm_page_query_t Request_mach_vm_page_query; + __Request__mach_vm_region_recurse_t Request_mach_vm_region_recurse; + __Request__mach_vm_region_t Request_mach_vm_region; + __Request___mach_make_memory_entry_t Request__mach_make_memory_entry; + __Request__mach_vm_purgable_control_t Request_mach_vm_purgable_control; + __Request__mach_vm_page_info_t Request_mach_vm_page_info; +}; +#endif /* !__RequestUnion__mach_vm_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__mach_vm_subsystem__defined +#define __Reply__mach_vm_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + } __Reply__mach_vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t dataCnt; + } __Reply__mach_vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_read_entry_t data_list; + } __Reply__mach_vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_size_t outsize; + } __Reply__mach_vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + } __Reply__mach_vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_machine_attribute_val_t value; + } __Reply__mach_vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t target_address; + vm_prot_t cur_protection; + vm_prot_t max_protection; + } __Reply__mach_vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + integer_t disposition; + integer_t ref_count; + } __Reply__mach_vm_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + mach_vm_size_t size; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + int info[19]; + } __Reply__mach_vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_name; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + mach_msg_type_number_t infoCnt; + int info[10]; + } __Reply__mach_vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + } __Reply___mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int state; + } __Reply__mach_vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t infoCnt; + int info[32]; + } __Reply__mach_vm_page_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__mach_vm_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__mach_vm_subsystem__defined +#define __ReplyUnion__mach_vm_subsystem__defined +union __ReplyUnion__mach_vm_subsystem { + __Reply__mach_vm_allocate_t Reply_mach_vm_allocate; + __Reply__mach_vm_deallocate_t Reply_mach_vm_deallocate; + __Reply__mach_vm_protect_t Reply_mach_vm_protect; + __Reply__mach_vm_inherit_t Reply_mach_vm_inherit; + __Reply__mach_vm_read_t Reply_mach_vm_read; + __Reply__mach_vm_read_list_t Reply_mach_vm_read_list; + __Reply__mach_vm_write_t Reply_mach_vm_write; + __Reply__mach_vm_copy_t Reply_mach_vm_copy; + __Reply__mach_vm_read_overwrite_t Reply_mach_vm_read_overwrite; + __Reply__mach_vm_msync_t Reply_mach_vm_msync; + __Reply__mach_vm_behavior_set_t Reply_mach_vm_behavior_set; + __Reply__mach_vm_map_t Reply_mach_vm_map; + __Reply__mach_vm_machine_attribute_t Reply_mach_vm_machine_attribute; + __Reply__mach_vm_remap_t Reply_mach_vm_remap; + __Reply__mach_vm_page_query_t Reply_mach_vm_page_query; + __Reply__mach_vm_region_recurse_t Reply_mach_vm_region_recurse; + __Reply__mach_vm_region_t Reply_mach_vm_region; + __Reply___mach_make_memory_entry_t Reply__mach_make_memory_entry; + __Reply__mach_vm_purgable_control_t Reply_mach_vm_purgable_control; + __Reply__mach_vm_page_info_t Reply_mach_vm_page_info; +}; +#endif /* !__RequestUnion__mach_vm_subsystem__defined */ + +#ifndef subsystem_to_name_map_mach_vm +#define subsystem_to_name_map_mach_vm \ + { "mach_vm_allocate", 4800 },\ + { "mach_vm_deallocate", 4801 },\ + { "mach_vm_protect", 4802 },\ + { "mach_vm_inherit", 4803 },\ + { "mach_vm_read", 4804 },\ + { "mach_vm_read_list", 4805 },\ + { "mach_vm_write", 4806 },\ + { "mach_vm_copy", 4807 },\ + { "mach_vm_read_overwrite", 4808 },\ + { "mach_vm_msync", 4809 },\ + { "mach_vm_behavior_set", 4810 },\ + { "mach_vm_map", 4811 },\ + { "mach_vm_machine_attribute", 4812 },\ + { "mach_vm_remap", 4813 },\ + { "mach_vm_page_query", 4814 },\ + { "mach_vm_region_recurse", 4815 },\ + { "mach_vm_region", 4816 },\ + { "_mach_make_memory_entry", 4817 },\ + { "mach_vm_purgable_control", 4818 },\ + { "mach_vm_page_info", 4819 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _mach_vm_user_ */ diff --git a/i386/include/mach/.svn/text-base/machine.h.svn-base b/i386/include/mach/.svn/text-base/machine.h.svn-base new file mode 100644 index 0000000..431d3c9 --- /dev/null +++ b/i386/include/mach/.svn/text-base/machine.h.svn-base @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* File: machine.h + * Author: Avadis Tevanian, Jr. + * Date: 1986 + * + * Machine independent machine abstraction. + */ + +#ifndef _MACH_MACHINE_H_ +#define _MACH_MACHINE_H_ + +#include <stdint.h> +#include <mach/machine/vm_types.h> +#include <mach/boolean.h> + +typedef integer_t cpu_type_t; +typedef integer_t cpu_subtype_t; +typedef integer_t cpu_threadtype_t; + +#define CPU_STATE_MAX 4 + +#define CPU_STATE_USER 0 +#define CPU_STATE_SYSTEM 1 +#define CPU_STATE_IDLE 2 +#define CPU_STATE_NICE 3 + + + +/* + * Capability bits used in the definition of cpu_type. + */ +#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */ +#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */ + +/* + * Machine types known by all. + */ + +#define CPU_TYPE_ANY ((cpu_type_t) -1) + +#define CPU_TYPE_VAX ((cpu_type_t) 1) +/* skip ((cpu_type_t) 2) */ +/* skip ((cpu_type_t) 3) */ +/* skip ((cpu_type_t) 4) */ +/* skip ((cpu_type_t) 5) */ +#define CPU_TYPE_MC680x0 ((cpu_type_t) 6) +#define CPU_TYPE_X86 ((cpu_type_t) 7) +#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */ +#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) + +/* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */ +/* skip ((cpu_type_t) 9) */ +#define CPU_TYPE_MC98000 ((cpu_type_t) 10) +#define CPU_TYPE_HPPA ((cpu_type_t) 11) +#define CPU_TYPE_ARM ((cpu_type_t) 12) +#define CPU_TYPE_MC88000 ((cpu_type_t) 13) +#define CPU_TYPE_SPARC ((cpu_type_t) 14) +#define CPU_TYPE_I860 ((cpu_type_t) 15) +/* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */ +/* skip ((cpu_type_t) 17) */ +#define CPU_TYPE_POWERPC ((cpu_type_t) 18) +#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) + +/* + * Machine subtypes (these are defined here, instead of in a machine + * dependent directory, so that any program can get all definitions + * regardless of where is it compiled). + */ + +/* + * Capability bits used in the definition of cpu_subtype. + */ +#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */ +#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */ + + +/* + * Object files that are hand-crafted to run on any + * implementation of an architecture are tagged with + * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as + * the "ALL" subtype of an architecture except that it allows us + * to easily find object files that may need to be modified + * whenever a new implementation of an architecture comes out. + * + * It is the responsibility of the implementor to make sure the + * software handles unsupported implementations elegantly. + */ +#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1) +#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1) + +/* + * Machine threadtypes. + * This is none - not defined - for most machine types/subtypes. + */ +#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0) + +/* + * VAX subtypes (these do *not* necessary conform to the actual cpu + * ID assigned by DEC available via the SID register). + */ + +#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4) +#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10) +#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11) +#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12) + +/* + * 680x0 subtypes + * + * The subtype definitions here are unusual for historical reasons. + * NeXT used to consider 68030 code as generic 68000 code. For + * backwards compatability: + * + * CPU_SUBTYPE_MC68030 symbol has been preserved for source code + * compatability. + * + * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same + * subtype as CPU_SUBTYPE_MC68030 for binary comatability. + * + * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object + * files to be tagged as containing 68030-specific instructions. + */ + +#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */ +#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3) + +/* + * I386 subtypes + */ + +#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4)) + +#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0) +#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0) +#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0) +#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128 +#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0) +#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0) +#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1) +#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3) +#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5) +#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6) +#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7) +#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0) +#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1) +#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2) +#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0) +#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0) +#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1) +#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0) +#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1) +#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0) +#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1) + +#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15) +#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15 + +#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4) +#define CPU_SUBTYPE_INTEL_MODEL_ALL 0 + +/* + * X86 subtypes. + */ + +#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3) +#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3) +#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4) + + +#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1) + +/* + * Mips subtypes. + */ + +#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */ +#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */ +#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7) + +/* + * MC98000 (PowerPC) subtypes + */ +#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1) + +/* + * HPPA subtypes for Hewlett-Packard HP-PA family of + * risc processors. Port by NeXT to 700 series. + */ + +#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */ +#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1) + +/* + * MC88000 subtypes. + */ +#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2) + +/* + * SPARC subtypes + */ +#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0) + +/* + * I860 subtypes + */ +#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1) + +/* + * PowerPC subtypes + */ +#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4) +#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10) +#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11) +#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100) + +/* + * ARM subtypes + */ +#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) + +/* + * CPU families (sysctl hw.cpufamily) + * + * These are meant to identify the CPU's marketing name - an + * application can map these to (possibly) localized strings. + * NB: the encodings of the CPU families are intentionally arbitrary. + * There is no ordering, and you should never try to deduce whether + * or not some feature is available based on the family. + * Use feature flags (eg, hw.optional.altivec) to test for optional + * functionality. + */ +#define CPUFAMILY_UNKNOWN 0 +#define CPUFAMILY_POWERPC_G3 0xcee41549 +#define CPUFAMILY_POWERPC_G4 0x77c184ae +#define CPUFAMILY_POWERPC_G5 0xed76d8aa +#define CPUFAMILY_INTEL_6_13 0xaa33392b +#define CPUFAMILY_INTEL_YONAH 0x73d67300 +#define CPUFAMILY_INTEL_MEROM 0x426f69ef +#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc +#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2 +#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec +#define CPUFAMILY_ARM_9 0xe73283ae +#define CPUFAMILY_ARM_11 0x8ff620d8 +#define CPUFAMILY_ARM_XSCALE 0x53b005f5 +#define CPUFAMILY_ARM_13 0x0cc90e64 + +/* The following synonyms are deprecated: */ +#define CPUFAMILY_INTEL_6_14 CPUFAMILY_INTEL_YONAH +#define CPUFAMILY_INTEL_6_15 CPUFAMILY_INTEL_MEROM +#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN +#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM + +#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_YONAH +#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_MEROM + + +#endif /* _MACH_MACHINE_H_ */ diff --git a/i386/include/mach/.svn/text-base/memory_object_types.h.svn-base b/i386/include/mach/.svn/text-base/memory_object_types.h.svn-base new file mode 100644 index 0000000..5c1f76e --- /dev/null +++ b/i386/include/mach/.svn/text-base/memory_object_types.h.svn-base @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: memory_object.h + * Author: Michael Wayne Young + * + * External memory management interface definition. + */ + +#ifndef _MACH_MEMORY_OBJECT_TYPES_H_ +#define _MACH_MEMORY_OBJECT_TYPES_H_ + +/* + * User-visible types used in the external memory + * management interface: + */ + +#include <mach/port.h> +#include <mach/message.h> +#include <mach/vm_prot.h> +#include <mach/vm_sync.h> +#include <mach/vm_types.h> +#include <mach/machine/vm_types.h> + +#include <sys/cdefs.h> + +#define VM_64_BIT_DATA_OBJECTS + +typedef unsigned long long memory_object_offset_t; +typedef unsigned long long memory_object_size_t; +typedef natural_t memory_object_cluster_size_t; +typedef natural_t * memory_object_fault_info_t; + +typedef unsigned long long vm_object_id_t; + + +/* + * Temporary until real EMMI version gets re-implemented + */ + + +typedef mach_port_t memory_object_t; +typedef mach_port_t memory_object_control_t; + + +typedef memory_object_t *memory_object_array_t; + /* A memory object ... */ + /* Used by the kernel to retrieve */ + /* or store data */ + +typedef mach_port_t memory_object_name_t; + /* Used to describe the memory ... */ + /* object in vm_regions() calls */ + +typedef mach_port_t memory_object_default_t; + /* Registered with the host ... */ + /* for creating new internal objects */ + +#define MEMORY_OBJECT_NULL ((memory_object_t) 0) +#define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0) +#define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0) +#define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0) + + +typedef int memory_object_copy_strategy_t; + /* How memory manager handles copy: */ +#define MEMORY_OBJECT_COPY_NONE 0 + /* ... No special support */ +#define MEMORY_OBJECT_COPY_CALL 1 + /* ... Make call on memory manager */ +#define MEMORY_OBJECT_COPY_DELAY 2 + /* ... Memory manager doesn't + * change data externally. + */ +#define MEMORY_OBJECT_COPY_TEMPORARY 3 + /* ... Memory manager doesn't + * change data externally, and + * doesn't need to see changes. + */ +#define MEMORY_OBJECT_COPY_SYMMETRIC 4 + /* ... Memory manager doesn't + * change data externally, + * doesn't need to see changes, + * and object will not be + * multiply mapped. + * + * XXX + * Not yet safe for non-kernel use. + */ + +#define MEMORY_OBJECT_COPY_INVALID 5 + /* ... An invalid copy strategy, + * for external objects which + * have not been initialized. + * Allows copy_strategy to be + * examined without also + * examining pager_ready and + * internal. + */ + +typedef int memory_object_return_t; + /* Which pages to return to manager + this time (lock_request) */ +#define MEMORY_OBJECT_RETURN_NONE 0 + /* ... don't return any. */ +#define MEMORY_OBJECT_RETURN_DIRTY 1 + /* ... only dirty pages. */ +#define MEMORY_OBJECT_RETURN_ALL 2 + /* ... dirty and precious pages. */ +#define MEMORY_OBJECT_RETURN_ANYTHING 3 + /* ... any resident page. */ + +/* + * Data lock request flags + */ + +#define MEMORY_OBJECT_DATA_FLUSH 0x1 +#define MEMORY_OBJECT_DATA_NO_CHANGE 0x2 +#define MEMORY_OBJECT_DATA_PURGE 0x4 +#define MEMORY_OBJECT_COPY_SYNC 0x8 +#define MEMORY_OBJECT_DATA_SYNC 0x10 +#define MEMORY_OBJECT_IO_SYNC 0x20 +#define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40 + +/* + * Types for the memory object flavor interfaces + */ + +#define MEMORY_OBJECT_INFO_MAX (1024) +typedef int *memory_object_info_t; +typedef int memory_object_flavor_t; +typedef int memory_object_info_data_t[MEMORY_OBJECT_INFO_MAX]; + + +#define MEMORY_OBJECT_PERFORMANCE_INFO 11 +#define MEMORY_OBJECT_ATTRIBUTE_INFO 14 +#define MEMORY_OBJECT_BEHAVIOR_INFO 15 + + +struct memory_object_perf_info { + memory_object_cluster_size_t cluster_size; + boolean_t may_cache; +}; + +struct memory_object_attr_info { + memory_object_copy_strategy_t copy_strategy; + memory_object_cluster_size_t cluster_size; + boolean_t may_cache_object; + boolean_t temporary; +}; + +struct memory_object_behave_info { + memory_object_copy_strategy_t copy_strategy; + boolean_t temporary; + boolean_t invalidate; + boolean_t silent_overwrite; + boolean_t advisory_pageout; +}; + + +typedef struct memory_object_behave_info *memory_object_behave_info_t; +typedef struct memory_object_behave_info memory_object_behave_info_data_t; + +typedef struct memory_object_perf_info *memory_object_perf_info_t; +typedef struct memory_object_perf_info memory_object_perf_info_data_t; + +typedef struct memory_object_attr_info *memory_object_attr_info_t; +typedef struct memory_object_attr_info memory_object_attr_info_data_t; + +#define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(memory_object_behave_info_data_t)/sizeof(int))) +#define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(memory_object_perf_info_data_t)/sizeof(int))) +#define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(memory_object_attr_info_data_t)/sizeof(int))) + +#define invalid_memory_object_flavor(f) \ + (f != MEMORY_OBJECT_ATTRIBUTE_INFO && \ + f != MEMORY_OBJECT_PERFORMANCE_INFO && \ + f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && \ + f != MEMORY_OBJECT_BEHAVIOR_INFO && \ + f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO) + + +/* + * Used to support options on memory_object_release_name call + */ +#define MEMORY_OBJECT_TERMINATE_IDLE 0x1 +#define MEMORY_OBJECT_RESPECT_CACHE 0x2 +#define MEMORY_OBJECT_RELEASE_NO_OP 0x4 + + +/* named entry processor mapping options */ +/* enumerated */ +#define MAP_MEM_NOOP 0 +#define MAP_MEM_COPYBACK 1 +#define MAP_MEM_IO 2 +#define MAP_MEM_WTHRU 3 +#define MAP_MEM_WCOMB 4 /* Write combining mode */ + /* aka store gather */ + +#define GET_MAP_MEM(flags) \ + ((((unsigned int)(flags)) >> 24) & 0xFF) + +#define SET_MAP_MEM(caching, flags) \ + ((flags) = ((((unsigned int)(caching)) << 24) \ + & 0xFF000000) | ((flags) & 0xFFFFFF)); + +/* leave room for vm_prot bits */ +#define MAP_MEM_ONLY 0x10000 /* change processor caching */ +#define MAP_MEM_NAMED_CREATE 0x20000 /* create extant object */ +#define MAP_MEM_PURGABLE 0x40000 /* create a purgable VM object */ +#define MAP_MEM_NAMED_REUSE 0x80000 /* reuse provided entry if identical */ + + +#endif /* _MACH_MEMORY_OBJECT_TYPES_H_ */ diff --git a/i386/include/mach/.svn/text-base/message.h.svn-base b/i386/include/mach/.svn/text-base/message.h.svn-base new file mode 100644 index 0000000..15c9be4 --- /dev/null +++ b/i386/include/mach/.svn/text-base/message.h.svn-base @@ -0,0 +1,783 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * NOTICE: This file was modified by McAfee Research in 2004 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + * Copyright (c) 2005 SPARTA, Inc. + */ +/* + */ +/* + * File: mach/message.h + * + * Mach IPC message and primitive function definitions. + */ + +#ifndef _MACH_MESSAGE_H_ +#define _MACH_MESSAGE_H_ + +#include <stdint.h> +#include <mach/port.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/machine/vm_types.h> + +#include <sys/cdefs.h> + +/* + * The timeout mechanism uses mach_msg_timeout_t values, + * passed by value. The timeout units are milliseconds. + * It is controlled with the MACH_SEND_TIMEOUT + * and MACH_RCV_TIMEOUT options. + */ + +typedef natural_t mach_msg_timeout_t; + +/* + * The value to be used when there is no timeout. + * (No MACH_SEND_TIMEOUT/MACH_RCV_TIMEOUT option.) + */ + +#define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0) + +/* + * The kernel uses MACH_MSGH_BITS_COMPLEX as a hint. If it isn't on, it + * assumes the body of the message doesn't contain port rights or OOL + * data. The field is set in received messages. A user task must + * use caution in interpreting the body of a message if the bit isn't + * on, because the mach_msg_type's in the body might "lie" about the + * contents. If the bit isn't on, but the mach_msg_types + * in the body specify rights or OOL data, the behavior is undefined. + * (Ie, an error may or may not be produced.) + * + * The value of MACH_MSGH_BITS_REMOTE determines the interpretation + * of the msgh_remote_port field. It is handled like a msgt_name. + * + * The value of MACH_MSGH_BITS_LOCAL determines the interpretation + * of the msgh_local_port field. It is handled like a msgt_name. + * + * MACH_MSGH_BITS() combines two MACH_MSG_TYPE_* values, for the remote + * and local fields, into a single value suitable for msgh_bits. + * + * MACH_MSGH_BITS_CIRCULAR should be zero; is is used internally. + * + * The unused bits should be zero and are reserved for the kernel + * or for future interface expansion. + */ + +#define MACH_MSGH_BITS_ZERO 0x00000000 +#define MACH_MSGH_BITS_REMOTE_MASK 0x000000ff +#define MACH_MSGH_BITS_LOCAL_MASK 0x0000ff00 +#define MACH_MSGH_BITS_COMPLEX 0x80000000U +#define MACH_MSGH_BITS_USER 0x8000ffffU + +#define MACH_MSGH_BITS_CIRCULAR 0x40000000 /* internal use only */ +#define MACH_MSGH_BITS_USED 0xc000ffffU + +#define MACH_MSGH_BITS_PORTS_MASK \ + (MACH_MSGH_BITS_REMOTE_MASK|MACH_MSGH_BITS_LOCAL_MASK) + +#define MACH_MSGH_BITS(remote, local) \ + ((remote) | ((local) << 8)) +#define MACH_MSGH_BITS_REMOTE(bits) \ + ((bits) & MACH_MSGH_BITS_REMOTE_MASK) +#define MACH_MSGH_BITS_LOCAL(bits) \ + (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8) +#define MACH_MSGH_BITS_PORTS(bits) \ + ((bits) & MACH_MSGH_BITS_PORTS_MASK) +#define MACH_MSGH_BITS_OTHER(bits) \ + ((bits) &~ MACH_MSGH_BITS_PORTS_MASK) + +/* + * Every message starts with a message header. + * Following the message header, if the message is complex, are a count + * of type descriptors and the type descriptors themselves + * (mach_msg_descriptor_t). The size of the message must be specified in + * bytes, and includes the message header, descriptor count, descriptors, + * and inline data. + * + * The msgh_remote_port field specifies the destination of the message. + * It must specify a valid send or send-once right for a port. + * + * The msgh_local_port field specifies a "reply port". Normally, + * This field carries a send-once right that the receiver will use + * to reply to the message. It may carry the values MACH_PORT_NULL, + * MACH_PORT_DEAD, a send-once right, or a send right. + * + * The msgh_seqno field carries a sequence number associated with the + * received-from port. A port's sequence number is incremented every + * time a message is received from it. In sent messages, the field's + * value is ignored. + * + * The msgh_id field is uninterpreted by the message primitives. + * It normally carries information specifying the format + * or meaning of the message. + */ + +typedef unsigned int mach_msg_bits_t; +typedef natural_t mach_msg_size_t; +typedef integer_t mach_msg_id_t; + + +#define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0 + +typedef unsigned int mach_msg_type_name_t; + +#define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive rights */ +#define MACH_MSG_TYPE_MOVE_SEND 17 /* Must hold send rights */ +#define MACH_MSG_TYPE_MOVE_SEND_ONCE 18 /* Must hold sendonce rights */ +#define MACH_MSG_TYPE_COPY_SEND 19 /* Must hold send rights */ +#define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive rights */ +#define MACH_MSG_TYPE_MAKE_SEND_ONCE 21 /* Must hold receive rights */ +#define MACH_MSG_TYPE_COPY_RECEIVE 22 /* Must hold receive rights */ + +typedef unsigned int mach_msg_copy_options_t; + +#define MACH_MSG_PHYSICAL_COPY 0 +#define MACH_MSG_VIRTUAL_COPY 1 +#define MACH_MSG_ALLOCATE 2 +#define MACH_MSG_OVERWRITE 3 +#ifdef MACH_KERNEL +#define MACH_MSG_KALLOC_COPY_T 4 +#endif /* MACH_KERNEL */ + +/* + * In a complex mach message, the mach_msg_header_t is followed by + * a descriptor count, then an array of that number of descriptors + * (mach_msg_*_descriptor_t). The type field of mach_msg_type_descriptor_t + * (which any descriptor can be cast to) indicates the flavor of the + * descriptor. + * + * Note that in LP64, the various types of descriptors are no longer all + * the same size as mach_msg_descriptor_t, so the array cannot be indexed + * as expected. + */ + +typedef unsigned int mach_msg_descriptor_type_t; + +#define MACH_MSG_PORT_DESCRIPTOR 0 +#define MACH_MSG_OOL_DESCRIPTOR 1 +#define MACH_MSG_OOL_PORTS_DESCRIPTOR 2 +#define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3 + +#pragma pack(4) + +typedef struct +{ + natural_t pad1; + mach_msg_size_t pad2; + unsigned int pad3 : 24; + mach_msg_descriptor_type_t type : 8; +} mach_msg_type_descriptor_t; + +typedef struct +{ + mach_port_t name; +#if !(defined(KERNEL) && defined(__LP64__)) +// Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes + mach_msg_size_t pad1; +#endif + unsigned int pad2 : 16; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +} mach_msg_port_descriptor_t; + +typedef struct +{ + uint32_t address; + mach_msg_size_t size; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; +} mach_msg_ool_descriptor32_t; + +typedef struct +{ + uint64_t address; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; + mach_msg_size_t size; +} mach_msg_ool_descriptor64_t; + +typedef struct +{ + void* address; +#if !defined(__LP64__) + mach_msg_size_t size; +#endif + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; +#if defined(__LP64__) + mach_msg_size_t size; +#endif +#if defined(KERNEL) && !defined(__LP64__) + uint32_t pad_end; +#endif +} mach_msg_ool_descriptor_t; + +typedef struct +{ + uint32_t address; + mach_msg_size_t count; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +} mach_msg_ool_ports_descriptor32_t; + +typedef struct +{ + uint64_t address; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; + mach_msg_size_t count; +} mach_msg_ool_ports_descriptor64_t; + +typedef struct +{ + void* address; +#if !defined(__LP64__) + mach_msg_size_t count; +#endif + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +#if defined(__LP64__) + mach_msg_size_t count; +#endif +#if defined(KERNEL) && !defined(__LP64__) + uint32_t pad_end; +#endif +} mach_msg_ool_ports_descriptor_t; + +/* + * LP64support - This union definition is not really + * appropriate in LP64 mode because not all descriptors + * are of the same size in that environment. + */ +#if defined(__LP64__) && defined(KERNEL) +typedef union +{ + mach_msg_port_descriptor_t port; + mach_msg_ool_descriptor32_t out_of_line; + mach_msg_ool_ports_descriptor32_t ool_ports; + mach_msg_type_descriptor_t type; +} mach_msg_descriptor_t; +#else +typedef union +{ + mach_msg_port_descriptor_t port; + mach_msg_ool_descriptor_t out_of_line; + mach_msg_ool_ports_descriptor_t ool_ports; + mach_msg_type_descriptor_t type; +} mach_msg_descriptor_t; +#endif + +typedef struct +{ + mach_msg_size_t msgh_descriptor_count; +} mach_msg_body_t; + +#define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0 +#define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0 + +typedef struct +{ + mach_msg_bits_t msgh_bits; + mach_msg_size_t msgh_size; + mach_port_t msgh_remote_port; + mach_port_t msgh_local_port; + mach_msg_size_t msgh_reserved; + mach_msg_id_t msgh_id; +} mach_msg_header_t; + +#define MACH_MSG_NULL (mach_msg_header_t *) 0 + +typedef struct +{ + mach_msg_header_t header; + mach_msg_body_t body; +} mach_msg_base_t; + +typedef unsigned int mach_msg_trailer_type_t; + +#define MACH_MSG_TRAILER_FORMAT_0 0 + +typedef unsigned int mach_msg_trailer_size_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; +} mach_msg_trailer_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; +} mach_msg_seqno_trailer_t; + +typedef struct +{ + unsigned int val[2]; +} security_token_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; +} mach_msg_security_trailer_t; + +/* + * The audit token is an opaque token which identifies + * Mach tasks and senders of Mach messages as subjects + * to the BSM audit system. Only the appropriate BSM + * library routines should be used to interpret the + * contents of the audit token as the representation + * of the subject identity within the token may change + * over time. + */ +typedef struct +{ + unsigned int val[8]; +} audit_token_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; +} mach_msg_audit_trailer_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; + mach_vm_address_t msgh_context; +} mach_msg_context_trailer_t; + + +typedef struct +{ + mach_port_name_t sender; +} msg_labels_t; + +/* + Trailer type to pass MAC policy label info as a mach message trailer. + +*/ + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; + mach_vm_address_t msgh_context; + int msgh_ad; + msg_labels_t msgh_labels; +} mach_msg_mac_trailer_t; + +#define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t) + +/* + * These values can change from release to release - but clearly + * code cannot request additional trailer elements one was not + * compiled to understand. Therefore, it is safe to use this + * constant when the same module specified the receive options. + * Otherwise, you run the risk that the options requested by + * another module may exceed the local modules notion of + * MAX_TRAILER_SIZE. + */ +typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t; +#define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t)) + +/* + * Legacy requirements keep us from ever updating these defines (even + * when the format_0 trailers gain new option data fields in the future). + * Therefore, they shouldn't be used going forward. Instead, the sizes + * should be compared against the specific element size requested using + * REQUESTED_TRAILER_SIZE. + */ +typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t; + +/*typedef mach_msg_mac_trailer_t mach_msg_format_0_trailer_t; +*/ + +#define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t) + +#define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} } +extern security_token_t KERNEL_SECURITY_TOKEN; + +#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} } +extern audit_token_t KERNEL_AUDIT_TOKEN; + +typedef integer_t mach_msg_options_t; + +typedef struct +{ + mach_msg_header_t header; +} mach_msg_empty_send_t; + +typedef struct +{ + mach_msg_header_t header; + mach_msg_trailer_t trailer; +} mach_msg_empty_rcv_t; + +typedef union +{ + mach_msg_empty_send_t send; + mach_msg_empty_rcv_t rcv; +} mach_msg_empty_t; + +#pragma pack() + +/* utility to round the message size - will become machine dependent */ +#define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \ + ~(sizeof (natural_t) - 1)) + +/* + * There is no fixed upper bound to the size of Mach messages. + */ + +#define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0) + +/* + * Compatibility definitions, for code written + * when there was a msgh_kind instead of msgh_seqno. + */ +#define MACH_MSGH_KIND_NORMAL 0x00000000 +#define MACH_MSGH_KIND_NOTIFICATION 0x00000001 +#define msgh_kind msgh_seqno +#define mach_msg_kind_t mach_port_seqno_t + +typedef natural_t mach_msg_type_size_t; +typedef natural_t mach_msg_type_number_t; + +/* + * Values received/carried in messages. Tells the receiver what + * sort of port right he now has. + * + * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name + * which should remain uninterpreted by the kernel. (Port rights + * are not transferred, just the port name.) + */ + +#define MACH_MSG_TYPE_PORT_NONE 0 + +#define MACH_MSG_TYPE_PORT_NAME 15 +#define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE +#define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND +#define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE + +#define MACH_MSG_TYPE_LAST 22 /* Last assigned */ + +/* + * A dummy value. Mostly used to indicate that the actual value + * will be filled in later, dynamically. + */ + +#define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1) + +/* + * Is a given item a port type? + */ + +#define MACH_MSG_TYPE_PORT_ANY(x) \ + (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ + ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) + +#define MACH_MSG_TYPE_PORT_ANY_SEND(x) \ + (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \ + ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) + +#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \ + (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ + ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE)) + +typedef integer_t mach_msg_option_t; + +#define MACH_MSG_OPTION_NONE 0x00000000 + +#define MACH_SEND_MSG 0x00000001 +#define MACH_RCV_MSG 0x00000002 +#define MACH_RCV_LARGE 0x00000004 + +#define MACH_SEND_TIMEOUT 0x00000010 +#define MACH_SEND_INTERRUPT 0x00000040 /* libmach implements */ +#define MACH_SEND_CANCEL 0x00000080 +#define MACH_SEND_ALWAYS 0x00010000 /* internal use only */ +#define MACH_SEND_TRAILER 0x00020000 + +#define MACH_RCV_TIMEOUT 0x00000100 +#define MACH_RCV_NOTIFY 0x00000200 +#define MACH_RCV_INTERRUPT 0x00000400 /* libmach implements */ +#define MACH_RCV_OVERWRITE 0x00001000 + +/* + * NOTE: a 0x00------ RCV mask implies to ask for + * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements, + * which is equivalent to a mach_msg_trailer_t. + * + * XXXMAC: unlike the rest of the MACH_RCV_* flags, MACH_RCV_TRAILER_LABELS + * needs its own private bit since we only calculate its fields when absolutely + * required. + */ +#define MACH_RCV_TRAILER_NULL 0 +#define MACH_RCV_TRAILER_SEQNO 1 +#define MACH_RCV_TRAILER_SENDER 2 +#define MACH_RCV_TRAILER_AUDIT 3 +#define MACH_RCV_TRAILER_CTX 4 +#define MACH_RCV_TRAILER_AV 7 +#define MACH_RCV_TRAILER_LABELS 8 + +#define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28) +#define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24) +#define MACH_RCV_TRAILER_MASK ((0xff << 24)) + +#define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf) + +/* + * XXXMAC: note that in the case of MACH_RCV_TRAILER_LABELS, + * we just fall through to mach_msg_max_trailer_t. + * This is correct behavior since mach_msg_max_trailer_t is defined as + * mac_msg_mac_trailer_t which is used for the LABELS trailer. + * It also makes things work properly if MACH_RCV_TRAILER_LABELS is ORed + * with one of the other options. + */ +#define REQUESTED_TRAILER_SIZE(y) \ + ((mach_msg_trailer_size_t) \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \ + sizeof(mach_msg_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \ + sizeof(mach_msg_seqno_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? \ + sizeof(mach_msg_security_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? \ + sizeof(mach_msg_audit_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? \ + sizeof(mach_msg_context_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? \ + sizeof(mach_msg_mac_trailer_t) : \ + sizeof(mach_msg_max_trailer_t)))))))) + +/* + * Much code assumes that mach_msg_return_t == kern_return_t. + * This definition is useful for descriptive purposes. + * + * See <mach/error.h> for the format of error codes. + * IPC errors are system 4. Send errors are subsystem 0; + * receive errors are subsystem 1. The code field is always non-zero. + * The high bits of the code field communicate extra information + * for some error codes. MACH_MSG_MASK masks off these special bits. + */ + +typedef kern_return_t mach_msg_return_t; + +#define MACH_MSG_SUCCESS 0x00000000 + + +#define MACH_MSG_MASK 0x00003e00 + /* All special error code bits defined below. */ +#define MACH_MSG_IPC_SPACE 0x00002000 + /* No room in IPC name space for another capability name. */ +#define MACH_MSG_VM_SPACE 0x00001000 + /* No room in VM address space for out-of-line memory. */ +#define MACH_MSG_IPC_KERNEL 0x00000800 + /* Kernel resource shortage handling an IPC capability. */ +#define MACH_MSG_VM_KERNEL 0x00000400 + /* Kernel resource shortage handling out-of-line memory. */ + +#define MACH_SEND_IN_PROGRESS 0x10000001 + /* Thread is waiting to send. (Internal use only.) */ +#define MACH_SEND_INVALID_DATA 0x10000002 + /* Bogus in-line data. */ +#define MACH_SEND_INVALID_DEST 0x10000003 + /* Bogus destination port. */ +#define MACH_SEND_TIMED_OUT 0x10000004 + /* Message not sent before timeout expired. */ +#define MACH_SEND_INTERRUPTED 0x10000007 + /* Software interrupt. */ +#define MACH_SEND_MSG_TOO_SMALL 0x10000008 + /* Data doesn't contain a complete message. */ +#define MACH_SEND_INVALID_REPLY 0x10000009 + /* Bogus reply port. */ +#define MACH_SEND_INVALID_RIGHT 0x1000000a + /* Bogus port rights in the message body. */ +#define MACH_SEND_INVALID_NOTIFY 0x1000000b + /* Bogus notify port argument. */ +#define MACH_SEND_INVALID_MEMORY 0x1000000c + /* Invalid out-of-line memory pointer. */ +#define MACH_SEND_NO_BUFFER 0x1000000d + /* No message buffer is available. */ +#define MACH_SEND_TOO_LARGE 0x1000000e + /* Send is too large for port */ +#define MACH_SEND_INVALID_TYPE 0x1000000f + /* Invalid msg-type specification. */ +#define MACH_SEND_INVALID_HEADER 0x10000010 + /* A field in the header had a bad value. */ +#define MACH_SEND_INVALID_TRAILER 0x10000011 + /* The trailer to be sent does not match kernel format. */ +#define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015 + /* compatibility: no longer a returned error */ + +#define MACH_RCV_IN_PROGRESS 0x10004001 + /* Thread is waiting for receive. (Internal use only.) */ +#define MACH_RCV_INVALID_NAME 0x10004002 + /* Bogus name for receive port/port-set. */ +#define MACH_RCV_TIMED_OUT 0x10004003 + /* Didn't get a message within the timeout value. */ +#define MACH_RCV_TOO_LARGE 0x10004004 + /* Message buffer is not large enough for inline data. */ +#define MACH_RCV_INTERRUPTED 0x10004005 + /* Software interrupt. */ +#define MACH_RCV_PORT_CHANGED 0x10004006 + /* compatibility: no longer a returned error */ +#define MACH_RCV_INVALID_NOTIFY 0x10004007 + /* Bogus notify port argument. */ +#define MACH_RCV_INVALID_DATA 0x10004008 + /* Bogus message buffer for inline data. */ +#define MACH_RCV_PORT_DIED 0x10004009 + /* Port/set was sent away/died during receive. */ +#define MACH_RCV_IN_SET 0x1000400a + /* compatibility: no longer a returned error */ +#define MACH_RCV_HEADER_ERROR 0x1000400b + /* Error receiving message header. See special bits. */ +#define MACH_RCV_BODY_ERROR 0x1000400c + /* Error receiving message body. See special bits. */ +#define MACH_RCV_INVALID_TYPE 0x1000400d + /* Invalid msg-type specification in scatter list. */ +#define MACH_RCV_SCATTER_SMALL 0x1000400e + /* Out-of-line overwrite region is not large enough */ +#define MACH_RCV_INVALID_TRAILER 0x1000400f + /* trailer type or number of trailer elements not supported */ +#define MACH_RCV_IN_PROGRESS_TIMED 0x10004011 + /* Waiting for receive with timeout. (Internal use only.) */ + + +__BEGIN_DECLS + +/* + * Routine: mach_msg_overwrite + * Purpose: + * Send and/or receive a message. If the message operation + * is interrupted, and the user did not request an indication + * of that fact, then restart the appropriate parts of the + * operation silently (trap version does not restart). + * + * Distinct send and receive buffers may be specified. If + * no separate receive buffer is specified, the msg parameter + * will be used for both send and receive operations. + * + * In addition to a distinct receive buffer, that buffer may + * already contain scatter control information to direct the + * receiving of the message. + */ + +extern mach_msg_return_t mach_msg_overwrite( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_name_t rcv_name, + mach_msg_timeout_t timeout, + mach_port_name_t notify, + mach_msg_header_t *rcv_msg, + mach_msg_size_t rcv_limit); + + +/* + * Routine: mach_msg + * Purpose: + * Send and/or receive a message. If the message operation + * is interrupted, and the user did not request an indication + * of that fact, then restart the appropriate parts of the + * operation silently (trap version does not restart). + */ +extern mach_msg_return_t mach_msg( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_name_t rcv_name, + mach_msg_timeout_t timeout, + mach_port_name_t notify); + + +__END_DECLS + +#endif /* _MACH_MESSAGE_H_ */ + diff --git a/i386/include/mach/.svn/text-base/mig.h.svn-base b/i386/include/mach/.svn/text-base/mig.h.svn-base new file mode 100644 index 0000000..b62dd2c --- /dev/null +++ b/i386/include/mach/.svn/text-base/mig.h.svn-base @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Mach MIG Subsystem Interfaces + */ + +#ifndef _MACH_MIG_H_ +#define _MACH_MIG_H_ + +#include <stdint.h> +#include <mach/port.h> +#include <mach/message.h> +#include <mach/vm_types.h> + +#include <sys/cdefs.h> + +#if defined(MACH_KERNEL) + +#if defined(BSMALL_LATER) +/* Really small configurations don't need type checking */ +#define __MigTypeCheck 0 +#else +/* Turn MIG type checking on by default for kernel */ +#define __MigTypeCheck 1 +#endif +#define __MigKernelSpecificCode 1 +#define _MIG_KERNEL_SPECIFIC_CODE_ 1 + +/* Otherwise check legacy setting (temporary) */ +#elif defined(TypeCheck) + +#define __MigTypeCheck TypeCheck + +#elif !defined(__MigTypeCheck) + +/* otherwise, default MIG type checking on - except in small configurations */ +#if defined(BSMALL) +#define __MigTypeCheck 0 +#else +#define __MigTypeCheck 1 +#endif + +#endif /* !defined(__MigTypeCheck) */ + +/* + * Pack MIG message structs. + * This is an indicator of the need to view shared structs in a + * binary-compatible format - and MIG message structs are no different. + */ +#define __MigPackStructs 1 + +/* + * Definition for MIG-generated server stub routines. These routines + * unpack the request message, call the server procedure, and pack the + * reply message. + */ +typedef void (*mig_stub_routine_t) (mach_msg_header_t *InHeadP, + mach_msg_header_t *OutHeadP); + +typedef mig_stub_routine_t mig_routine_t; + +/* + * Definition for MIG-generated server routine. This routine takes a + * message, and returns the appropriate stub function for handling that + * message. + */ +typedef mig_routine_t (*mig_server_routine_t) (mach_msg_header_t *InHeadP); + +/* + * Generic definition for implementation routines. These routines do + * the real work associated with this request. This generic type is + * used for keeping the pointers in the subsystem array. + */ +typedef kern_return_t (*mig_impl_routine_t)(void); + +typedef mach_msg_type_descriptor_t routine_arg_descriptor; +typedef mach_msg_type_descriptor_t *routine_arg_descriptor_t; +typedef mach_msg_type_descriptor_t *mig_routine_arg_descriptor_t; + +#define MIG_ROUTINE_ARG_DESCRIPTOR_NULL ((mig_routine_arg_descriptor_t)0) + +struct routine_descriptor { + mig_impl_routine_t impl_routine; /* Server work func pointer */ + mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */ + unsigned int argc; /* Number of argument words */ + unsigned int descr_count; /* Number complex descriptors */ + routine_arg_descriptor_t + arg_descr; /* pointer to descriptor array*/ + unsigned int max_reply_msg; /* Max size for reply msg */ +}; +typedef struct routine_descriptor *routine_descriptor_t; + +typedef struct routine_descriptor mig_routine_descriptor; +typedef mig_routine_descriptor *mig_routine_descriptor_t; + +#define MIG_ROUTINE_DESCRIPTOR_NULL ((mig_routine_descriptor_t)0) + +typedef struct mig_subsystem { + mig_server_routine_t server; /* pointer to demux routine */ + mach_msg_id_t start; /* Min routine number */ + mach_msg_id_t end; /* Max routine number + 1 */ + mach_msg_size_t maxsize; /* Max reply message size */ + vm_address_t reserved; /* reserved for MIG use */ + mig_routine_descriptor + routine[1]; /* Routine descriptor array */ +} *mig_subsystem_t; + +#define MIG_SUBSYSTEM_NULL ((mig_subsystem_t)0) + +typedef struct mig_symtab { + char *ms_routine_name; + int ms_routine_number; + void (*ms_routine)(void); /* Since the functions in the + * symbol table have unknown + * signatures, this is the best + * we can do... + */ +} mig_symtab_t; + + +__BEGIN_DECLS + +/* Client side reply port allocate */ +extern mach_port_t mig_get_reply_port(void); + +/* Client side reply port deallocate */ +extern void mig_dealloc_reply_port(mach_port_t reply_port); + +/* Client side reply port "deallocation" */ +extern void mig_put_reply_port(mach_port_t reply_port); + +/* Bounded string copy */ +extern int mig_strncpy(char *dest, const char *src, int len); + + +/* Allocate memory for out-of-line mig structures */ +extern void mig_allocate(vm_address_t *, vm_size_t); + +/* Deallocate memory used for out-of-line mig structures */ +extern void mig_deallocate(vm_address_t, vm_size_t); + + +__END_DECLS + +#endif /* _MACH_MIG_H_ */ diff --git a/i386/include/mach/.svn/text-base/mig_errors.h.svn-base b/i386/include/mach/.svn/text-base/mig_errors.h.svn-base new file mode 100644 index 0000000..f1234bc --- /dev/null +++ b/i386/include/mach/.svn/text-base/mig_errors.h.svn-base @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Mach Interface Generator errors + * + */ + +#ifndef _MACH_MIG_ERRORS_H_ +#define _MACH_MIG_ERRORS_H_ + +#include <mach/mig.h> +#include <mach/ndr.h> +#include <mach/message.h> +#include <mach/kern_return.h> + +#include <sys/cdefs.h> + +/* + * These error codes should be specified as system 4, subsytem 2. + * But alas backwards compatibility makes that impossible. + * The problem is old clients of new servers (eg, the kernel) + * which get strange large error codes when there is a Mig problem + * in the server. Unfortunately, the IPC system doesn't have + * the knowledge to convert the codes in this situation. + */ + +#define MIG_TYPE_ERROR -300 /* client type check failure */ +#define MIG_REPLY_MISMATCH -301 /* wrong reply message ID */ +#define MIG_REMOTE_ERROR -302 /* server detected error */ +#define MIG_BAD_ID -303 /* bad request message ID */ +#define MIG_BAD_ARGUMENTS -304 /* server type check failure */ +#define MIG_NO_REPLY -305 /* no reply should be send */ +#define MIG_EXCEPTION -306 /* server raised exception */ +#define MIG_ARRAY_TOO_LARGE -307 /* array not large enough */ +#define MIG_SERVER_DIED -308 /* server died */ +#define MIG_TRAILER_ERROR -309 /* trailer has an unknown format */ + +/* + * Whenever MIG detects an error, it sends back a generic + * mig_reply_error_t format message. Clients must accept + * these in addition to the expected reply message format. + */ +#pragma pack(4) +typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; +} mig_reply_error_t; +#pragma pack() + + +__BEGIN_DECLS + +#if !defined(__NDR_convert__mig_reply_error_t__defined) +#define __NDR_convert__mig_reply_error_t__defined + +static __inline__ void +__NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x) +{ +#if defined(__NDR_convert__int_rep__kern_return_t__defined) + if (x->NDR.int_rep != NDR_record.int_rep) + __NDR_convert__int_rep__kern_return_t(&x->RetCode, x->NDR.int_rep); +#endif /* __NDR_convert__int_rep__kern_return_t__defined */ +} +#endif /* !defined(__NDR_convert__mig_reply_error_t__defined) */ + +__END_DECLS + +#endif /* _MACH_MIG_ERRORS_H_ */ diff --git a/i386/include/mach/.svn/text-base/ndr.h.svn-base b/i386/include/mach/.svn/text-base/ndr.h.svn-base new file mode 100644 index 0000000..cb64d3f --- /dev/null +++ b/i386/include/mach/.svn/text-base/ndr.h.svn-base @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_NDR_H_ +#define _MACH_NDR_H_ + +#include <stdint.h> +#include <sys/cdefs.h> + +typedef struct { + unsigned char mig_vers; + unsigned char if_vers; + unsigned char reserved1; + unsigned char mig_encoding; + unsigned char int_rep; + unsigned char char_rep; + unsigned char float_rep; + unsigned char reserved2; +} NDR_record_t; + +/* + * MIG supported protocols for Network Data Representation + */ +#define NDR_PROTOCOL_2_0 0 + +/* + * NDR 2.0 format flag type definition and values. + */ +#define NDR_INT_BIG_ENDIAN 0 +#define NDR_INT_LITTLE_ENDIAN 1 +#define NDR_FLOAT_IEEE 0 +#define NDR_FLOAT_VAX 1 +#define NDR_FLOAT_CRAY 2 +#define NDR_FLOAT_IBM 3 +#define NDR_CHAR_ASCII 0 +#define NDR_CHAR_EBCDIC 1 + +extern NDR_record_t NDR_record; + +#if defined(BSMALL) +#define __NDR_convert__ 0 +#define __NDR_convert__int_rep__ 0 +#else +#ifndef __NDR_convert__ +#define __NDR_convert__ 1 +#endif /* __NDR_convert__ */ + +#ifndef __NDR_convert__int_rep__ +#define __NDR_convert__int_rep__ 1 +#endif /* __NDR_convert__int_rep__ */ + +#endif /* defined(BSMALL) */ + +#ifndef __NDR_convert__char_rep__ +#define __NDR_convert__char_rep__ 0 +#endif /* __NDR_convert__char_rep__ */ + +#ifndef __NDR_convert__float_rep__ +#define __NDR_convert__float_rep__ 0 +#endif /* __NDR_convert__float_rep__ */ + +#if __NDR_convert__ + +#define __NDR_convert__NOOP do ; while (0) +#define __NDR_convert__UNKNOWN(s) __NDR_convert__NOOP +#define __NDR_convert__SINGLE(a, f, r) do { r((a), (f)); } while (0) +#define __NDR_convert__ARRAY(a, f, c, r) \ + do { int __i__, __C__ = (c); \ + for (__i__ = 0; __i__ < __C__; __i__++) \ + r(&(a)[__i__], f); } while (0) +#define __NDR_convert__2DARRAY(a, f, s, c, r) \ + do { int __i__, __C__ = (c), __S__ = (s); \ + for (__i__ = 0; __i__ < __C__; __i__++) \ + r(&(a)[__i__ * __S__], f, __S__); } while (0) + +#if __NDR_convert__int_rep__ + +#include <libkern/OSByteOrder.h> + +#define __NDR_READSWAP_assign(a, rs) do { *(a) = rs(a); } while (0) + +#define __NDR_READSWAP__uint16_t(a) OSReadSwapInt16((void *)a, 0) +#define __NDR_READSWAP__int16_t(a) (int16_t)OSReadSwapInt16((void *)a, 0) +#define __NDR_READSWAP__uint32_t(a) OSReadSwapInt32((void *)a, 0) +#define __NDR_READSWAP__int32_t(a) (int32_t)OSReadSwapInt32((void *)a, 0) +#define __NDR_READSWAP__uint64_t(a) OSReadSwapInt64((void *)a, 0) +#define __NDR_READSWAP__int64_t(a) (int64_t)OSReadSwapInt64((void *)a, 0) + +__BEGIN_DECLS + +static __inline__ float __NDR_READSWAP__float(float *argp) { + union { + float sv; + uint32_t ull; + } result; + result.ull = __NDR_READSWAP__uint32_t((uint32_t *)argp); + return result.sv; +} + +static __inline__ double __NDR_READSWAP__double(double *argp) { + union { + double sv; + uint64_t ull; + } result; + result.ull = __NDR_READSWAP__uint64_t((uint64_t *)argp); + return result.sv; +} + +__END_DECLS + +#define __NDR_convert__int_rep__int16_t__defined +#define __NDR_convert__int_rep__int16_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__int16_t) + +#define __NDR_convert__int_rep__uint16_t__defined +#define __NDR_convert__int_rep__uint16_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__uint16_t) + +#define __NDR_convert__int_rep__int32_t__defined +#define __NDR_convert__int_rep__int32_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__int32_t) + +#define __NDR_convert__int_rep__uint32_t__defined +#define __NDR_convert__int_rep__uint32_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__uint32_t) + +#define __NDR_convert__int_rep__int64_t__defined +#define __NDR_convert__int_rep__int64_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__int64_t) + +#define __NDR_convert__int_rep__uint64_t__defined +#define __NDR_convert__int_rep__uint64_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__uint64_t) + +#define __NDR_convert__int_rep__float__defined +#define __NDR_convert__int_rep__float(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__float) + +#define __NDR_convert__int_rep__double__defined +#define __NDR_convert__int_rep__double(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__double) + +#define __NDR_convert__int_rep__boolean_t__defined +#define __NDR_convert__int_rep__boolean_t(v, f) \ + __NDR_convert__int_rep__int32_t(v,f) + +#define __NDR_convert__int_rep__kern_return_t__defined +#define __NDR_convert__int_rep__kern_return_t(v,f) \ + __NDR_convert__int_rep__int32_t(v,f) + +#define __NDR_convert__int_rep__mach_port_name_t__defined +#define __NDR_convert__int_rep__mach_port_name_t(v,f) \ + __NDR_convert__int_rep__uint32_t(v,f) + +#define __NDR_convert__int_rep__mach_msg_type_number_t__defined +#define __NDR_convert__int_rep__mach_msg_type_number_t(v,f) \ + __NDR_convert__int_rep__uint32_t(v,f) + +#endif /* __NDR_convert__int_rep__ */ + +#if __NDR_convert__char_rep__ + +#warning NDR character representation conversions not implemented yet! +#define __NDR_convert__char_rep__char(v,f) __NDR_convert__NOOP +#define __NDR_convert__char_rep__string(v,f,l) __NDR_convert__NOOP + +#endif /* __NDR_convert__char_rep__ */ + +#if __NDR_convert__float_rep__ + +#warning NDR floating point representation conversions not implemented yet! +#define __NDR_convert__float_rep__float(v,f) __NDR_convert__NOOP +#define __NDR_convert__float_rep__double(v,f) __NDR_convert__NOOP + +#endif /* __NDR_convert__float_rep__ */ + +#endif /* __NDR_convert__ */ + +#endif /* _MACH_NDR_H_ */ diff --git a/i386/include/mach/.svn/text-base/notify.defs.svn-base b/i386/include/mach/.svn/text-base/notify.defs.svn-base new file mode 100644 index 0000000..6f7f81d --- /dev/null +++ b/i386/include/mach/.svn/text-base/notify.defs.svn-base @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif + notify 64; + +#include <mach/std_types.defs> + +#if SEQNOS +serverprefix do_seqnos_; +serverdemux seqnos_notify_server; +#else /* !SEQNOS */ +serverprefix do_; +serverdemux notify_server; +#endif /* SEQNOS */ + +/* MACH_NOTIFY_FIRST: 0100 */ +skip; + +/* MACH_NOTIFY_PORT_DELETED: 0101 */ +simpleroutine mach_notify_port_deleted( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + name : mach_port_name_t); + +skip; /* was MACH_NOTIFY_MSG_ACCEPTED: 0102 */ + +skip; /* was NOTIFY_OWNERSHIP_RIGHTS: 0103 */ + +skip; /* was NOTIFY_RECEIVE_RIGHTS: 0104 */ + +/* MACH_NOTIFY_PORT_DESTROYED: 0105 */ +simpleroutine mach_notify_port_destroyed( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + rights : mach_port_move_receive_t); + +/* MACH_NOTIFY_NO_SENDERS: 0106 */ +simpleroutine mach_notify_no_senders( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + mscount : mach_port_mscount_t); + +/* MACH_NOTIFY_SEND_ONCE: 0107 */ +simpleroutine mach_notify_send_once( + notify : mach_port_move_send_once_t +#if SEQNOS +; msgseqno seqno : mach_port_seqno_t +#endif /* SEQNOS */ + ); + +/* MACH_NOTIFY_DEAD_NAME: 0110 */ +simpleroutine mach_notify_dead_name( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + name : mach_port_name_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/notify.h.svn-base b/i386/include/mach/.svn/text-base/notify.h.svn-base new file mode 100644 index 0000000..768a865 --- /dev/null +++ b/i386/include/mach/.svn/text-base/notify.h.svn-base @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/notify.h + * + * Kernel notification message definitions. + */ + +#ifndef _MACH_NOTIFY_H_ +#define _MACH_NOTIFY_H_ + +#include <mach/port.h> +#include <mach/message.h> +#include <mach/ndr.h> + +/* + * An alternative specification of the notification interface + * may be found in mach/notify.defs. + */ + +#define MACH_NOTIFY_FIRST 0100 +#define MACH_NOTIFY_PORT_DELETED (MACH_NOTIFY_FIRST + 001 ) + /* A send or send-once right was deleted. */ +#define MACH_NOTIFY_PORT_DESTROYED (MACH_NOTIFY_FIRST + 005) + /* A receive right was (would have been) deallocated */ +#define MACH_NOTIFY_NO_SENDERS (MACH_NOTIFY_FIRST + 006) + /* Receive right has no extant send rights */ +#define MACH_NOTIFY_SEND_ONCE (MACH_NOTIFY_FIRST + 007) + /* An extant send-once right died */ +#define MACH_NOTIFY_DEAD_NAME (MACH_NOTIFY_FIRST + 010) + /* Send or send-once right died, leaving a dead-name */ +#define MACH_NOTIFY_LAST (MACH_NOTIFY_FIRST + 015) + +typedef mach_port_t notify_port_t; + +/* + * Hard-coded message structures for receiving Mach port notification + * messages. However, they are not actual large enough to receive + * the largest trailers current exported by Mach IPC (so they cannot + * be used for space allocations in situations using these new larger + * trailers). Instead, the MIG-generated server routines (and + * related prototypes should be used). + */ +typedef struct { + mach_msg_header_t not_header; + NDR_record_t NDR; + mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ + mach_msg_format_0_trailer_t trailer; +} mach_port_deleted_notification_t; + +typedef struct { + mach_msg_header_t not_header; + mach_msg_body_t not_body; + mach_msg_port_descriptor_t not_port;/* MACH_MSG_TYPE_PORT_RECEIVE */ + mach_msg_format_0_trailer_t trailer; +} mach_port_destroyed_notification_t; + +typedef struct { + mach_msg_header_t not_header; + NDR_record_t NDR; + mach_msg_type_number_t not_count; + mach_msg_format_0_trailer_t trailer; +} mach_no_senders_notification_t; + +typedef struct { + mach_msg_header_t not_header; + mach_msg_format_0_trailer_t trailer; +} mach_send_once_notification_t; + +typedef struct { + mach_msg_header_t not_header; + NDR_record_t NDR; + mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ + mach_msg_format_0_trailer_t trailer; +} mach_dead_name_notification_t; + +#endif /* _MACH_NOTIFY_H_ */ diff --git a/i386/include/mach/.svn/text-base/policy.h.svn-base b/i386/include/mach/.svn/text-base/policy.h.svn-base new file mode 100644 index 0000000..b6ec795 --- /dev/null +++ b/i386/include/mach/.svn/text-base/policy.h.svn-base @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_POLICY_H_ +#define _MACH_POLICY_H_ + +/* + * mach/policy.h + * + * Definitions for scheduing policy. + */ + +/* + * All interfaces defined here are obsolete. + */ + +#include <mach/boolean.h> +#include <mach/message.h> +#include <mach/vm_types.h> + +/* + * Old scheduling control interface + */ +typedef int policy_t; +typedef integer_t *policy_info_t; +typedef integer_t *policy_base_t; +typedef integer_t *policy_limit_t; + +/* + * Policy definitions. Policies should be powers of 2, + * but cannot be or'd together other than to test for a + * policy 'class'. + */ +#define POLICY_NULL 0 /* none */ +#define POLICY_TIMESHARE 1 /* timesharing */ +#define POLICY_RR 2 /* fixed round robin */ +#define POLICY_FIFO 4 /* fixed fifo */ + +#define __NEW_SCHEDULING_FRAMEWORK__ + +/* + * Check if policy is of 'class' fixed-priority. + */ +#define POLICYCLASS_FIXEDPRI (POLICY_RR | POLICY_FIFO) + +/* + * Check if policy is valid. + */ +#define invalid_policy(policy) \ + ((policy) != POLICY_TIMESHARE && \ + (policy) != POLICY_RR && \ + (policy) != POLICY_FIFO) + + +/* + * Types for TIMESHARE policy + */ +struct policy_timeshare_base { + integer_t base_priority; +}; +struct policy_timeshare_limit { + integer_t max_priority; +}; +struct policy_timeshare_info { + integer_t max_priority; + integer_t base_priority; + integer_t cur_priority; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_timeshare_base *policy_timeshare_base_t; +typedef struct policy_timeshare_limit *policy_timeshare_limit_t; +typedef struct policy_timeshare_info *policy_timeshare_info_t; + +typedef struct policy_timeshare_base policy_timeshare_base_data_t; +typedef struct policy_timeshare_limit policy_timeshare_limit_data_t; +typedef struct policy_timeshare_info policy_timeshare_info_data_t; + + +#define POLICY_TIMESHARE_BASE_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_timeshare_base)/sizeof(integer_t))) +#define POLICY_TIMESHARE_LIMIT_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_timeshare_limit)/sizeof(integer_t))) +#define POLICY_TIMESHARE_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_timeshare_info)/sizeof(integer_t))) + + +/* + * Types for the ROUND ROBIN (RR) policy + */ +struct policy_rr_base { + integer_t base_priority; + integer_t quantum; +}; +struct policy_rr_limit { + integer_t max_priority; +}; +struct policy_rr_info { + integer_t max_priority; + integer_t base_priority; + integer_t quantum; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_rr_base *policy_rr_base_t; +typedef struct policy_rr_limit *policy_rr_limit_t; +typedef struct policy_rr_info *policy_rr_info_t; + +typedef struct policy_rr_base policy_rr_base_data_t; +typedef struct policy_rr_limit policy_rr_limit_data_t; +typedef struct policy_rr_info policy_rr_info_data_t; + +#define POLICY_RR_BASE_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_rr_base)/sizeof(integer_t))) +#define POLICY_RR_LIMIT_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_rr_limit)/sizeof(integer_t))) +#define POLICY_RR_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_rr_info)/sizeof(integer_t))) + + +/* + * Types for the FIRST-IN-FIRST-OUT (FIFO) policy + */ +struct policy_fifo_base { + integer_t base_priority; +}; +struct policy_fifo_limit { + integer_t max_priority; +}; +struct policy_fifo_info { + integer_t max_priority; + integer_t base_priority; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_fifo_base *policy_fifo_base_t; +typedef struct policy_fifo_limit *policy_fifo_limit_t; +typedef struct policy_fifo_info *policy_fifo_info_t; + +typedef struct policy_fifo_base policy_fifo_base_data_t; +typedef struct policy_fifo_limit policy_fifo_limit_data_t; +typedef struct policy_fifo_info policy_fifo_info_data_t; + +#define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_fifo_base)/sizeof(integer_t))) +#define POLICY_FIFO_LIMIT_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_fifo_limit)/sizeof(integer_t))) +#define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_fifo_info)/sizeof(integer_t))) + +/* + * Aggregate policy types + */ + +struct policy_bases { + policy_timeshare_base_data_t ts; + policy_rr_base_data_t rr; + policy_fifo_base_data_t fifo; +}; + +struct policy_limits { + policy_timeshare_limit_data_t ts; + policy_rr_limit_data_t rr; + policy_fifo_limit_data_t fifo; +}; + +struct policy_infos { + policy_timeshare_info_data_t ts; + policy_rr_info_data_t rr; + policy_fifo_info_data_t fifo; +}; + +typedef struct policy_bases policy_base_data_t; +typedef struct policy_limits policy_limit_data_t; +typedef struct policy_infos policy_info_data_t; + +#endif /* _MACH_POLICY_H_ */ diff --git a/i386/include/mach/.svn/text-base/port.h.svn-base b/i386/include/mach/.svn/text-base/port.h.svn-base new file mode 100644 index 0000000..6550139 --- /dev/null +++ b/i386/include/mach/.svn/text-base/port.h.svn-base @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * NOTICE: This file was modified by McAfee Research in 2004 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ +/* + */ +/* + * File: mach/port.h + * + * Definition of a Mach port + * + * Mach ports are the endpoints to Mach-implemented communications + * channels (usually uni-directional message queues, but other types + * also exist). + * + * Unique collections of these endpoints are maintained for each + * Mach task. Each Mach port in the task's collection is given a + * [task-local] name to identify it - and the the various "rights" + * held by the task for that specific endpoint. + * + * This header defines the types used to identify these Mach ports + * and the various rights associated with them. For more info see: + * + * <mach/mach_port.h> - manipulation of port rights in a given space + * <mach/message.h> - message queue [and port right passing] mechanism + * + */ + +#ifndef _MACH_PORT_H_ +#define _MACH_PORT_H_ + +#include <sys/cdefs.h> +#include <stdint.h> +#include <mach/boolean.h> +#include <mach/machine/vm_types.h> + +/* + * mach_port_name_t - the local identity for a Mach port + * + * The name is Mach port namespace specific. It is used to + * identify the rights held for that port by the task whose + * namespace is implied [or specifically provided]. + * + * Use of this type usually implies just a name - no rights. + * See mach_port_t for a type that implies a "named right." + * + */ + +typedef natural_t mach_port_name_t; +typedef mach_port_name_t *mach_port_name_array_t; + + +/* + * mach_port_t - a named port right + * + * In user-space, "rights" are represented by the name of the + * right in the Mach port namespace. Even so, this type is + * presented as a unique one to more clearly denote the presence + * of a right coming along with the name. + * + * Often, various rights for a port held in a single name space + * will coalesce and are, therefore, be identified by a single name + * [this is the case for send and receive rights]. But not + * always [send-once rights currently get a unique name for + * each right]. + * + */ + +#ifndef _MACH_PORT_T +#define _MACH_PORT_T +typedef mach_port_name_t mach_port_t; +#endif + + +typedef mach_port_t *mach_port_array_t; + +/* + * MACH_PORT_NULL is a legal value that can be carried in messages. + * It indicates the absence of any port or port rights. (A port + * argument keeps the message from being "simple", even if the + * value is MACH_PORT_NULL.) The value MACH_PORT_DEAD is also a legal + * value that can be carried in messages. It indicates + * that a port right was present, but it died. + */ + +#define MACH_PORT_NULL 0 /* intentional loose typing */ +#define MACH_PORT_DEAD ((mach_port_name_t) ~0) +#define MACH_PORT_VALID(name) \ + (((name) != MACH_PORT_NULL) && \ + ((name) != MACH_PORT_DEAD)) + + +/* + * For kernel-selected [assigned] port names, the name is + * comprised of two parts: a generation number and an index. + * This approach keeps the exact same name from being generated + * and reused too quickly [to catch right/reference counting bugs]. + * The dividing line between the constituent parts is exposed so + * that efficient "mach_port_name_t to data structure pointer" + * conversion implementation can be made. But it is possible + * for user-level code to assign their own names to Mach ports. + * These are not required to participate in this algorithm. So + * care should be taken before "assuming" this model. + * + */ + +#ifndef NO_PORT_GEN + +#define MACH_PORT_INDEX(name) ((name) >> 8) +#define MACH_PORT_GEN(name) (((name) & 0xff) << 24) +#define MACH_PORT_MAKE(index, gen) \ + (((index) << 8) | (gen) >> 24) + +#else /* NO_PORT_GEN */ + +#define MACH_PORT_INDEX(name) (name) +#define MACH_PORT_GEN(name) (0) +#define MACH_PORT_MAKE(index, gen) (index) + +#endif /* NO_PORT_GEN */ + + +/* + * These are the different rights a task may have for a port. + * The MACH_PORT_RIGHT_* definitions are used as arguments + * to mach_port_allocate, mach_port_get_refs, etc, to specify + * a particular right to act upon. The mach_port_names and + * mach_port_type calls return bitmasks using the MACH_PORT_TYPE_* + * definitions. This is because a single name may denote + * multiple rights. + */ + +typedef natural_t mach_port_right_t; + +#define MACH_PORT_RIGHT_SEND ((mach_port_right_t) 0) +#define MACH_PORT_RIGHT_RECEIVE ((mach_port_right_t) 1) +#define MACH_PORT_RIGHT_SEND_ONCE ((mach_port_right_t) 2) +#define MACH_PORT_RIGHT_PORT_SET ((mach_port_right_t) 3) +#define MACH_PORT_RIGHT_DEAD_NAME ((mach_port_right_t) 4) +#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) +#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) + +typedef natural_t mach_port_type_t; +typedef mach_port_type_t *mach_port_type_array_t; + +#define MACH_PORT_TYPE(right) \ + ((mach_port_type_t)(((mach_port_type_t) 1) \ + << ((right) + ((mach_port_right_t) 16)))) +#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L) +#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND) +#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE) +#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE) +#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET) +#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME) +#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) + +/* Convenient combinations. */ + +#define MACH_PORT_TYPE_SEND_RECEIVE \ + (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE) +#define MACH_PORT_TYPE_SEND_RIGHTS \ + (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE) +#define MACH_PORT_TYPE_PORT_RIGHTS \ + (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE) +#define MACH_PORT_TYPE_PORT_OR_DEAD \ + (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME) +#define MACH_PORT_TYPE_ALL_RIGHTS \ + (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET) + +/* Dummy type bits that mach_port_type/mach_port_names can return. */ + +#define MACH_PORT_TYPE_DNREQUEST 0x80000000 + +/* User-references for capabilities. */ + +typedef natural_t mach_port_urefs_t; +typedef integer_t mach_port_delta_t; /* change in urefs */ + +/* Attributes of ports. (See mach_port_get_receive_status.) */ + +typedef natural_t mach_port_seqno_t; /* sequence number */ +typedef natural_t mach_port_mscount_t; /* make-send count */ +typedef natural_t mach_port_msgcount_t; /* number of msgs */ +typedef natural_t mach_port_rights_t; /* number of rights */ + +/* + * Are there outstanding send rights for a given port? + */ +#define MACH_PORT_SRIGHTS_NONE 0 /* no srights */ +#define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */ +typedef unsigned int mach_port_srights_t; /* status of send rights */ + +typedef struct mach_port_status { + mach_port_rights_t mps_pset; /* count of containing port sets */ + mach_port_seqno_t mps_seqno; /* sequence number */ + mach_port_mscount_t mps_mscount; /* make-send count */ + mach_port_msgcount_t mps_qlimit; /* queue limit */ + mach_port_msgcount_t mps_msgcount; /* number in the queue */ + mach_port_rights_t mps_sorights; /* how many send-once rights */ + boolean_t mps_srights; /* do send rights exist? */ + boolean_t mps_pdrequest; /* port-deleted requested? */ + boolean_t mps_nsrequest; /* no-senders requested? */ + natural_t mps_flags; /* port flags */ +} mach_port_status_t; + +/* System-wide values for setting queue limits on a port */ +#define MACH_PORT_QLIMIT_ZERO ((mach_port_msgcount_t) 0) +#define MACH_PORT_QLIMIT_BASIC ((mach_port_msgcount_t) 5) +#define MACH_PORT_QLIMIT_SMALL ((mach_port_msgcount_t) 16) +#define MACH_PORT_QLIMIT_LARGE ((mach_port_msgcount_t) 1024) +#define MACH_PORT_QLIMIT_KERNEL ((mach_port_msgcount_t) 65536) +#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO +#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC +#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE + +typedef struct mach_port_limits { + mach_port_msgcount_t mpl_qlimit; /* number of msgs */ +} mach_port_limits_t; + +typedef integer_t *mach_port_info_t; /* varying array of natural_t */ + +/* Flavors for mach_port_get/set_attributes() */ +typedef int mach_port_flavor_t; +#define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_status_t */ +#define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_limits_t */ +#define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */ + +#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \ + (sizeof(mach_port_limits_t)/sizeof(natural_t))) +#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \ + (sizeof(mach_port_status_t)/sizeof(natural_t))) +#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1 + +/* + * Structure used to pass information about port allocation requests. + * Must be padded to 64-bits total length. + */ +typedef struct mach_port_qos { + unsigned int name:1; /* name given */ + unsigned int prealloc:1; /* prealloced message */ + boolean_t pad1:30; + natural_t len; +} mach_port_qos_t; + +#if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH) +/* + * Mach 3.0 renamed everything to have mach_ in front of it. + * These types and macros are provided for backward compatibility + * but are deprecated. + */ +typedef mach_port_t port_t; +typedef mach_port_name_t port_name_t; +typedef mach_port_name_t *port_name_array_t; + +#define PORT_NULL ((port_t) 0) +#define PORT_DEAD ((port_t) ~0) +#define PORT_VALID(name) \ + ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD) + +#endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */ + +#endif /* _MACH_PORT_H_ */ diff --git a/i386/include/mach/.svn/text-base/port_obj.h.svn-base b/i386/include/mach/.svn/text-base/port_obj.h.svn-base new file mode 100644 index 0000000..d2b5f89 --- /dev/null +++ b/i386/include/mach/.svn/text-base/port_obj.h.svn-base @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Define a service to map from a kernel-generated port name + * to server-defined "type" and "value" data to be associated + * with the port. + */ + +#ifndef PORT_OBJ_H +#define PORT_OBJ_H + +#include <mach/port.h> + +struct port_obj_tentry { + void *pos_value; + int pos_type; +}; + +#include <sys/cdefs.h> + +__BEGIN_DECLS +extern void port_obj_init(int); +__END_DECLS + +extern struct port_obj_tentry *port_obj_table; +extern int port_obj_table_size; + +#ifndef PORT_OBJ_ASSERT + +#define port_set_obj_value_type(pname, value, type) \ +do { \ + int ndx; \ + \ + if (!port_obj_table) \ + port_obj_init(port_obj_table_size); \ + ndx = MACH_PORT_INDEX(pname); \ + port_obj_table[ndx].pos_value = (value); \ + port_obj_table[ndx].pos_type = (type); \ +} while (0) + +#define port_get_obj_value(pname) \ + (port_obj_table[MACH_PORT_INDEX(pname)].pos_value) + +#define port_get_obj_type(pname) \ + (port_obj_table[MACH_PORT_INDEX(pname)].pos_type) + +#else /* PORT_OBJ_ASSERT */ + +#define port_set_obj_value_type(pname, value, type) \ +do { \ + int ndx; \ + \ + if (!port_obj_table) \ + port_obj_init(port_obj_table_size); \ + ndx = MACH_PORT_INDEX(pname); \ + assert(ndx > 0); \ + assert(ndx < port_obj_table_size); \ + port_obj_table[ndx].pos_value = (value); \ + port_obj_table[ndx].pos_type = (type); \ +} while (0) + +#define port_get_obj_value(pname) \ + ((MACH_PORT_INDEX(pname) < (unsigned)port_obj_table_size) ? \ + port_obj_table[MACH_PORT_INDEX(pname)].pos_value : \ + (panic("port_get_obj_value: index too big"), (void *)-1)) + +#define port_get_obj_type(pname) \ + ((MACH_PORT_INDEX(pname) < (unsigned)port_obj_table_size) ? \ + port_obj_table[MACH_PORT_INDEX(pname)].pos_type : \ + (panic("port_get_obj_type: index too big"), -1)) + +#endif /* PORT_OBJ_ASSERT */ + +#endif /* PORT_OBJ_H */ diff --git a/i386/include/mach/.svn/text-base/processor.defs.svn-base b/i386/include/mach/.svn/text-base/processor.defs.svn-base new file mode 100644 index 0000000..f590633 --- /dev/null +++ b/i386/include/mach/.svn/text-base/processor.defs.svn-base @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + processor 3000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * References to processor objects are returned by: + * host_processors(host_priv_t,...); + * +/* + * Start processor. + */ +routine processor_start( + processor : processor_t); + +/* + * Exit processor -- may not be restartable. + */ + +routine processor_exit( + processor : processor_t); + +/* + * Return information about this processor. + */ +routine processor_info( + processor : processor_t; + flavor : processor_flavor_t; + out host : host_t; + out processor_info_out: processor_info_t, CountInOut); + + +/* + * Do something machine-dependent to processor. + */ +routine processor_control( + processor : processor_t; + processor_cmd : processor_info_t); + +/* + * JMM - Keep processor_set related stuff at the end because + * they likely will be removed. + */ + +/* + * Assign processor to processor set. + */ +routine processor_assign( + processor : processor_t; + new_set : processor_set_t; + wait : boolean_t); + +/* + * Get current assignment for processor. + */ +routine processor_get_assignment( + processor : processor_t; + out assigned_set : processor_set_name_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/processor.h.svn-base b/i386/include/mach/.svn/text-base/processor.h.svn-base new file mode 100644 index 0000000..e3afbde --- /dev/null +++ b/i386/include/mach/.svn/text-base/processor.h.svn-base @@ -0,0 +1,336 @@ +#ifndef _processor_user_ +#define _processor_user_ + +/* Module processor */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef processor_MSG_COUNT +#define processor_MSG_COUNT 6 +#endif /* processor_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine processor_start */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_start +( + processor_t processor +); + +/* Routine processor_exit */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_exit +( + processor_t processor +); + +/* Routine processor_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_info +( + processor_t processor, + processor_flavor_t flavor, + host_t *host, + processor_info_t processor_info_out, + mach_msg_type_number_t *processor_info_outCnt +); + +/* Routine processor_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_control +( + processor_t processor, + processor_info_t processor_cmd, + mach_msg_type_number_t processor_cmdCnt +); + +/* Routine processor_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_assign +( + processor_t processor, + processor_set_t new_set, + boolean_t wait +); + +/* Routine processor_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_get_assignment +( + processor_t processor, + processor_set_name_t *assigned_set +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__processor_subsystem__defined +#define __Request__processor_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_start_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_exit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_flavor_t flavor; + mach_msg_type_number_t processor_info_outCnt; + } __Request__processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t processor_cmdCnt; + integer_t processor_cmd[12]; + } __Request__processor_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t wait; + } __Request__processor_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__processor_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__processor_subsystem__defined +#define __RequestUnion__processor_subsystem__defined +union __RequestUnion__processor_subsystem { + __Request__processor_start_t Request_processor_start; + __Request__processor_exit_t Request_processor_exit; + __Request__processor_info_t Request_processor_info; + __Request__processor_control_t Request_processor_control; + __Request__processor_assign_t Request_processor_assign; + __Request__processor_get_assignment_t Request_processor_get_assignment; +}; +#endif /* !__RequestUnion__processor_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__processor_subsystem__defined +#define __Reply__processor_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_start_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_exit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t host; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t processor_info_outCnt; + integer_t processor_info_out[12]; + } __Reply__processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__processor_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__processor_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__processor_subsystem__defined +#define __ReplyUnion__processor_subsystem__defined +union __ReplyUnion__processor_subsystem { + __Reply__processor_start_t Reply_processor_start; + __Reply__processor_exit_t Reply_processor_exit; + __Reply__processor_info_t Reply_processor_info; + __Reply__processor_control_t Reply_processor_control; + __Reply__processor_assign_t Reply_processor_assign; + __Reply__processor_get_assignment_t Reply_processor_get_assignment; +}; +#endif /* !__RequestUnion__processor_subsystem__defined */ + +#ifndef subsystem_to_name_map_processor +#define subsystem_to_name_map_processor \ + { "processor_start", 3000 },\ + { "processor_exit", 3001 },\ + { "processor_info", 3002 },\ + { "processor_control", 3003 },\ + { "processor_assign", 3004 },\ + { "processor_get_assignment", 3005 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _processor_user_ */ diff --git a/i386/include/mach/.svn/text-base/processor_info.h.svn-base b/i386/include/mach/.svn/text-base/processor_info.h.svn-base new file mode 100644 index 0000000..1607c71 --- /dev/null +++ b/i386/include/mach/.svn/text-base/processor_info.h.svn-base @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/processor_info.h + * Author: David L. Black + * Date: 1988 + * + * Data structure definitions for processor_info, processor_set_info + */ + +#ifndef _MACH_PROCESSOR_INFO_H_ +#define _MACH_PROCESSOR_INFO_H_ + +#include <mach/message.h> +#include <mach/machine.h> +#include <mach/machine/processor_info.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef integer_t *processor_info_t; /* varying array of int. */ +typedef integer_t *processor_info_array_t; /* varying array of int */ + +#define PROCESSOR_INFO_MAX (1024) /* max array size */ +typedef integer_t processor_info_data_t[PROCESSOR_INFO_MAX]; + + +typedef integer_t *processor_set_info_t; /* varying array of int. */ + +#define PROCESSOR_SET_INFO_MAX (1024) /* max array size */ +typedef integer_t processor_set_info_data_t[PROCESSOR_SET_INFO_MAX]; + +/* + * Currently defined information. + */ +typedef int processor_flavor_t; +#define PROCESSOR_BASIC_INFO 1 /* basic information */ +#define PROCESSOR_CPU_LOAD_INFO 2 /* cpu load information */ +#define PROCESSOR_PM_REGS_INFO 0x10000001 /* performance monitor register info */ +#define PROCESSOR_TEMPERATURE 0x10000002 /* Processor core temperature */ + +struct processor_basic_info { + cpu_type_t cpu_type; /* type of cpu */ + cpu_subtype_t cpu_subtype; /* subtype of cpu */ + boolean_t running; /* is processor running */ + int slot_num; /* slot number */ + boolean_t is_master; /* is this the master processor */ +}; + +typedef struct processor_basic_info processor_basic_info_data_t; +typedef struct processor_basic_info *processor_basic_info_t; +#define PROCESSOR_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_basic_info_data_t)/sizeof(natural_t))) + +struct processor_cpu_load_info { /* number of ticks while running... */ + unsigned int cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ +}; + +typedef struct processor_cpu_load_info processor_cpu_load_info_data_t; +typedef struct processor_cpu_load_info *processor_cpu_load_info_t; +#define PROCESSOR_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t))) + +/* + * Scaling factor for load_average, mach_factor. + */ +#define LOAD_SCALE 1000 + +typedef int processor_set_flavor_t; +#define PROCESSOR_SET_BASIC_INFO 5 /* basic information */ + +struct processor_set_basic_info { + int processor_count; /* How many processors */ + int default_policy; /* When others not enabled */ +}; + +typedef struct processor_set_basic_info processor_set_basic_info_data_t; +typedef struct processor_set_basic_info *processor_set_basic_info_t; +#define PROCESSOR_SET_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t))) + +#define PROCESSOR_SET_LOAD_INFO 4 /* scheduling statistics */ + +struct processor_set_load_info { + int task_count; /* How many tasks */ + int thread_count; /* How many threads */ + integer_t load_average; /* Scaled */ + integer_t mach_factor; /* Scaled */ +}; + +typedef struct processor_set_load_info processor_set_load_info_data_t; +typedef struct processor_set_load_info *processor_set_load_info_t; +#define PROCESSOR_SET_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_set_load_info_data_t)/sizeof(natural_t))) + + +#endif /* _MACH_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/.svn/text-base/processor_set.defs.svn-base b/i386/include/mach/.svn/text-base/processor_set.defs.svn-base new file mode 100644 index 0000000..dc0f407 --- /dev/null +++ b/i386/include/mach/.svn/text-base/processor_set.defs.svn-base @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + processor_set 4000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Return scheduling statistics for a processor set. + */ +routine processor_set_statistics( + pset : processor_set_name_t; + flavor : processor_set_flavor_t; + out info_out : processor_set_info_t, CountInOut); + + +/* + * Destroy processor set. + */ +routine processor_set_destroy( + set : processor_set_t); + + +/* + * Set max priority for processor_set. + */ +routine processor_set_max_priority( + processor_set : processor_set_t; + max_priority : int; + change_threads : boolean_t); + +/* + * Enable policy for processor set + */ +routine processor_set_policy_enable( + processor_set : processor_set_t; + policy : int); + +/* + * Disable policy for processor set + */ +routine processor_set_policy_disable( + processor_set : processor_set_t; + policy : int; + change_threads : boolean_t); + +/* + * List all tasks in processor set. + */ +routine processor_set_tasks( + processor_set : processor_set_t; + out task_list : task_array_t); + +/* + * List all threads in processor set. + */ +routine processor_set_threads( + processor_set : processor_set_t; + out thread_list : thread_act_array_t); + +/* + * Controls the scheduling attributes governing the processor set. + * Allows control of enabled policies, and per-policy base and limit + * priorities. + */ +routine processor_set_policy_control( + pset : processor_set_t; + flavor : processor_set_flavor_t; + policy_info : processor_set_info_t; + change : boolean_t); + + +/* + * Debug Info + * This call is only valid on MACH_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine processor_set_stack_usage( + pset : processor_set_t; + out ltotal : unsigned; + out space : vm_size_t; + out resident : vm_size_t; + out maxusage : vm_size_t; + out maxstack : vm_offset_t); + +/* + * Get information about processor set. + */ +routine processor_set_info( + set_name : processor_set_name_t; + flavor : int; + out host : host_t; + out info_out : processor_set_info_t, CountInOut); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/processor_set.h.svn-base b/i386/include/mach/.svn/text-base/processor_set.h.svn-base new file mode 100644 index 0000000..1aaf327 --- /dev/null +++ b/i386/include/mach/.svn/text-base/processor_set.h.svn-base @@ -0,0 +1,516 @@ +#ifndef _processor_set_user_ +#define _processor_set_user_ + +/* Module processor_set */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef processor_set_MSG_COUNT +#define processor_set_MSG_COUNT 10 +#endif /* processor_set_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine processor_set_statistics */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_statistics +( + processor_set_name_t pset, + processor_set_flavor_t flavor, + processor_set_info_t info_out, + mach_msg_type_number_t *info_outCnt +); + +/* Routine processor_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_destroy +( + processor_set_t set +); + +/* Routine processor_set_max_priority */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_max_priority +( + processor_set_t processor_set, + int max_priority, + boolean_t change_threads +); + +/* Routine processor_set_policy_enable */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_policy_enable +( + processor_set_t processor_set, + int policy +); + +/* Routine processor_set_policy_disable */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_policy_disable +( + processor_set_t processor_set, + int policy, + boolean_t change_threads +); + +/* Routine processor_set_tasks */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_tasks +( + processor_set_t processor_set, + task_array_t *task_list, + mach_msg_type_number_t *task_listCnt +); + +/* Routine processor_set_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_threads +( + processor_set_t processor_set, + thread_act_array_t *thread_list, + mach_msg_type_number_t *thread_listCnt +); + +/* Routine processor_set_policy_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_policy_control +( + processor_set_t pset, + processor_set_flavor_t flavor, + processor_set_info_t policy_info, + mach_msg_type_number_t policy_infoCnt, + boolean_t change +); + +/* Routine processor_set_stack_usage */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_stack_usage +( + processor_set_t pset, + unsigned *ltotal, + vm_size_t *space, + vm_size_t *resident, + vm_size_t *maxusage, + vm_offset_t *maxstack +); + +/* Routine processor_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_info +( + processor_set_name_t set_name, + int flavor, + host_t *host, + processor_set_info_t info_out, + mach_msg_type_number_t *info_outCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__processor_set_subsystem__defined +#define __Request__processor_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_set_flavor_t flavor; + mach_msg_type_number_t info_outCnt; + } __Request__processor_set_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int max_priority; + boolean_t change_threads; + } __Request__processor_set_max_priority_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + } __Request__processor_set_policy_enable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + boolean_t change_threads; + } __Request__processor_set_policy_disable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_tasks_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_set_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[5]; + boolean_t change; + } __Request__processor_set_policy_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_stack_usage_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t info_outCnt; + } __Request__processor_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__processor_set_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__processor_set_subsystem__defined +#define __RequestUnion__processor_set_subsystem__defined +union __RequestUnion__processor_set_subsystem { + __Request__processor_set_statistics_t Request_processor_set_statistics; + __Request__processor_set_destroy_t Request_processor_set_destroy; + __Request__processor_set_max_priority_t Request_processor_set_max_priority; + __Request__processor_set_policy_enable_t Request_processor_set_policy_enable; + __Request__processor_set_policy_disable_t Request_processor_set_policy_disable; + __Request__processor_set_tasks_t Request_processor_set_tasks; + __Request__processor_set_threads_t Request_processor_set_threads; + __Request__processor_set_policy_control_t Request_processor_set_policy_control; + __Request__processor_set_stack_usage_t Request_processor_set_stack_usage; + __Request__processor_set_info_t Request_processor_set_info; +}; +#endif /* !__RequestUnion__processor_set_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__processor_set_subsystem__defined +#define __Reply__processor_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t info_outCnt; + integer_t info_out[5]; + } __Reply__processor_set_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_max_priority_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_policy_enable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_policy_disable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t task_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t task_listCnt; + } __Reply__processor_set_tasks_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t thread_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t thread_listCnt; + } __Reply__processor_set_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_policy_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + unsigned ltotal; + vm_size_t space; + vm_size_t resident; + vm_size_t maxusage; + vm_offset_t maxstack; + } __Reply__processor_set_stack_usage_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t host; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t info_outCnt; + integer_t info_out[5]; + } __Reply__processor_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__processor_set_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__processor_set_subsystem__defined +#define __ReplyUnion__processor_set_subsystem__defined +union __ReplyUnion__processor_set_subsystem { + __Reply__processor_set_statistics_t Reply_processor_set_statistics; + __Reply__processor_set_destroy_t Reply_processor_set_destroy; + __Reply__processor_set_max_priority_t Reply_processor_set_max_priority; + __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable; + __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable; + __Reply__processor_set_tasks_t Reply_processor_set_tasks; + __Reply__processor_set_threads_t Reply_processor_set_threads; + __Reply__processor_set_policy_control_t Reply_processor_set_policy_control; + __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage; + __Reply__processor_set_info_t Reply_processor_set_info; +}; +#endif /* !__RequestUnion__processor_set_subsystem__defined */ + +#ifndef subsystem_to_name_map_processor_set +#define subsystem_to_name_map_processor_set \ + { "processor_set_statistics", 4000 },\ + { "processor_set_destroy", 4001 },\ + { "processor_set_max_priority", 4002 },\ + { "processor_set_policy_enable", 4003 },\ + { "processor_set_policy_disable", 4004 },\ + { "processor_set_tasks", 4005 },\ + { "processor_set_threads", 4006 },\ + { "processor_set_policy_control", 4007 },\ + { "processor_set_stack_usage", 4008 },\ + { "processor_set_info", 4009 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _processor_set_user_ */ diff --git a/i386/include/mach/.svn/text-base/rpc.h.svn-base b/i386/include/mach/.svn/text-base/rpc.h.svn-base new file mode 100644 index 0000000..565d7ac --- /dev/null +++ b/i386/include/mach/.svn/text-base/rpc.h.svn-base @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Mach RPC Subsystem Interfaces + */ + +#ifndef _MACH_RPC_H_ +#define _MACH_RPC_H_ + +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/port.h> +#include <mach/vm_types.h> + +#include <mach/mig.h> +#include <mach/mig_errors.h> +#include <mach/machine/rpc.h> +#include <mach/thread_status.h> + +/* + * These are the types for RPC-specific variants of the MIG routine + * descriptor and subsystem data types. + * + * THIS IS ONLY FOR COMPATIBILITY. WE WILL NOT BE IMPLEMENTING THIS. + */ + +/* + * Basic mach rpc types. + */ +typedef unsigned int routine_arg_type; +typedef unsigned int routine_arg_offset; +typedef unsigned int routine_arg_size; + +/* + * Definitions for a signature's argument and routine descriptor's. + */ +struct rpc_routine_arg_descriptor { + routine_arg_type type; /* Port, Array, etc. */ + routine_arg_size size; /* element size in bytes */ + routine_arg_size count; /* number of elements */ + routine_arg_offset offset; /* Offset in list of routine args */ +}; +typedef struct rpc_routine_arg_descriptor *rpc_routine_arg_descriptor_t; + +struct rpc_routine_descriptor { + mig_impl_routine_t impl_routine; /* Server work func pointer */ + mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */ + unsigned int argc; /* Number of argument words */ + unsigned int descr_count; /* Number of complex argument */ + /* descriptors */ + rpc_routine_arg_descriptor_t + arg_descr; /* Pointer to beginning of */ + /* the arg_descr array */ + unsigned int max_reply_msg; /* Max size for reply msg */ +}; +typedef struct rpc_routine_descriptor *rpc_routine_descriptor_t; + +#define RPC_DESCR_SIZE(x) ((x)->descr_count * \ + sizeof(struct rpc_routine_arg_descriptor)) + +struct rpc_signature { + struct rpc_routine_descriptor rd; + struct rpc_routine_arg_descriptor rad[1]; +}; + +#define RPC_SIGBUF_SIZE 8 + +/* + * A subsystem describes a set of server routines that can be invoked by + * mach_rpc() on the ports that are registered with the subsystem. For + * each routine, the routine number is given, along with the + * address of the implementation function in the server and a + * description of the arguments of the routine (it's "signature"). + * + * This structure definition is only a template for what is really a + * variable-length structure (generated by MIG for each subsystem). + * The actual structures do not always have one entry in the routine + * array, and also have a varying number of entries in the arg_descr + * array. Each routine has an array of zero or more arg descriptors + * one for each complex arg. These arrays are all catenated together + * to form the arg_descr field of the subsystem struct. The + * arg_descr field of each routine entry points to a unique sub-sequence + * within this catenated array. The goal is to keep everything + * contiguous. + */ +struct rpc_subsystem { + void *reserved; /* Reserved for system use */ + + mach_msg_id_t start; /* Min routine number */ + mach_msg_id_t end; /* Max routine number + 1 */ + unsigned int maxsize; /* Max mach_msg size */ + vm_address_t base_addr; /* Address of this struct in user */ + + struct rpc_routine_descriptor /* Array of routine descriptors */ + routine[1 /* Actually, (start-end+1) */ + ]; + + struct rpc_routine_arg_descriptor + arg_descriptor[1 /* Actually, the sum of the descr_ */ + ]; /* count fields for all routines */ +}; +typedef struct rpc_subsystem *rpc_subsystem_t; + +#define RPC_SUBSYSTEM_NULL ((rpc_subsystem_t) 0) + +#endif /* _MACH_RPC_H_ */ diff --git a/i386/include/mach/.svn/text-base/sdt.h.svn-base b/i386/include/mach/.svn/text-base/sdt.h.svn-base new file mode 100644 index 0000000..3268551 --- /dev/null +++ b/i386/include/mach/.svn/text-base/sdt.h.svn-base @@ -0,0 +1,32 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_SDT_H +#define _MACH_SDT_H + +#include <mach/machine/sdt.h> + +#endif /* _MACH_SDT_H */ diff --git a/i386/include/mach/.svn/text-base/security.defs.svn-base b/i386/include/mach/.svn/text-base/security.defs.svn-base new file mode 100644 index 0000000..734aa90 --- /dev/null +++ b/i386/include/mach/.svn/text-base/security.defs.svn-base @@ -0,0 +1,208 @@ + +/* -*- C++ -*- */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif KERNEL_SERVER + security 5200; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +type labelstr_t = c_string[*:512]; + +/** + @brief Retrieve a task label as a label handle + @param task Target's task port + @param label Returned label handle + + This call retrieves the label handle of the specified task. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_task_label(task : ipc_space_t; + out label : mach_port_name_t); + +/** + @brief Retrieve a task label in textual form + @param task Target's task port + @param policies Comma-delimited list of policies to query + @param label Returned label text + + This call retrieves an externalized task label for the + specified task, with respect to the specified policies. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_task_label_text(task : ipc_space_t; + policies : labelstr_t; + out label : labelstr_t); + +/** + @brief Retrieve a port label as a label handle + @param task Issuer's task port + @param port Port to query label from + @param label Returned label handle + + This call retrieves a new label handle for the specified port. + If the port represents a label handle, KERN_INVALID_ARGUMENT is + returned. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_label(task : ipc_space_t; + port : mach_port_name_t; + out label : mach_port_name_t); + +/** + @brief Retrieve a port label in textual form + @param task Issuer's task port + @param name Port to query label from + @param policies Comma-delimited list of policies to query + @param label Returned label text + + This call retrieves an externalized port label for the specified port, + with respect to the specified policies. If the port represents a label + handle, the returned label text refers to the stored label and not the + access control label. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_label_text(task : ipc_space_t; + name : mach_port_name_t; + policies : labelstr_t; + out label : labelstr_t); + +/** + @brief Relabel a port + @param task Task containing specified ports + @param name Port to relabel + @param label String representation of new label + + This call attempts to relabel the specified port to the + label specified. For label handles, it changes the access control + label and not the stored label. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_set_port_label(task : ipc_space_t; + name : mach_port_name_t; + label : labelstr_t); + +/** + @brief Generic access control check + @param task Any task port + @param subj subject label in textual form + @param obj object label in textual form + @param serv Service or object class name + @param perm Permission, or method, within the specified service + + This function provides a general way for a user process to query + an arbitrary access control decision from the system's security policies. + Currently, there are no standards for the format of the service and + permission names. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_check_service(task : ipc_space_t; + subject : labelstr_t; + object : labelstr_t; + service : labelstr_t; + perm : labelstr_t); + +/** + @brief Generic access control check + @param task Task containing specified ports (usually caller's) + @param subj subject label in textual form + @param obj port containing object label + @param serv Service or object class name + @param perm Permission, or method, within the specified service + + This function provides a general way for a user process to query + an arbitrary access control decision from the system's security policies. + Currently, there are no standards for the format of the service and + permission names. If the port is a label handle, the stored label is + used. Otherwise, its access control label is used. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_port_check_service_obj(task : ipc_space_t; + subject : labelstr_t; + object : mach_port_name_t; + service : labelstr_t; + perm : labelstr_t); + +/** + @brief Generic access control check + @param task Task containing specified ports (usually caller's) + @param subj port containing subject label + @param obj port containing object label + @param serv Service or object class name + @param perm Permission, or method, within the specified service + + This function provides a general way for a user process to query + an arbitrary access control decision from the system's security policies. + Currently, there are no standards for the format of the service and + permission names. If any ports are label handles, the stored label is + used. Otherwise, the access control labels are used. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_port_check_access(task : ipc_space_t; + subject : mach_port_name_t; + object : mach_port_name_t; + service : labelstr_t; + perm : labelstr_t); + +/** + @brief Create a new label handle + @param task Task to receive new ports (usually caller's) + @param name Returned label handle port + @param label String representation of new label + + Creates a new label handle, with the stored label defined by the + given text. Any task may create a label handle with any valid label, + not necessarily one that it has permission to access. A port right + for the new label handle is inserted into the specified task. + Posession of label handles should not imply any security properties. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_label_new(task : ipc_space_t; + out name : mach_port_name_t; + label : labelstr_t); + +/** + @brief Request a computed label + @param task subj,obj,newlabel relative to this task (usually caller's) + @param subj port containing subject label + @param obj port containing object label + @param serv Service or object class name + @param newlabel Returned label handle port + + Ask the loaded policies to compute a label based on the two input labels + and the service name. There is currently no standard for the service name, + or even what the input labels represent (Subject and parent object are only + a suggestion). If any ports are label handles, the stored label is + used. Otherwise, the access control labels are used. A new label handle + is created to contain the computed label, and is stored into the + specified task. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_request_label(task : ipc_space_t; + subject : mach_port_name_t; + object : mach_port_name_t; + service : labelstr_t; + out newlabel : mach_port_name_t); diff --git a/i386/include/mach/.svn/text-base/semaphore.h.svn-base b/i386/include/mach/.svn/text-base/semaphore.h.svn-base new file mode 100644 index 0000000..660af09 --- /dev/null +++ b/i386/include/mach/.svn/text-base/semaphore.h.svn-base @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_SEMAPHORE_H_ +#define _MACH_SEMAPHORE_H_ + +#include <mach/port.h> +#include <mach/mach_types.h> +#include <mach/kern_return.h> +#include <mach/sync_policy.h> + +/* + * Forward Declarations + * + * The semaphore creation and deallocation routines are + * defined with the Mach task APIs in <mach/task.h>. + * + * kern_return_t semaphore_create(task_t task, + * semaphore_t *new_semaphore, + * sync_policy_t policy, + * int value); + * + * kern_return_t semaphore_destroy(task_t task, + * semaphore_t semaphore); + */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + +extern kern_return_t semaphore_signal (semaphore_t semaphore); +extern kern_return_t semaphore_signal_all (semaphore_t semaphore); + +extern kern_return_t semaphore_wait (semaphore_t semaphore); + + +extern kern_return_t semaphore_timedwait (semaphore_t semaphore, + mach_timespec_t wait_time); + +extern kern_return_t semaphore_timedwait_signal(semaphore_t wait_semaphore, + semaphore_t signal_semaphore, + mach_timespec_t wait_time); + +extern kern_return_t semaphore_wait_signal (semaphore_t wait_semaphore, + semaphore_t signal_semaphore); + +extern kern_return_t semaphore_signal_thread (semaphore_t semaphore, + thread_t thread); + + +__END_DECLS + + +#endif /* _MACH_SEMAPHORE_H_ */ diff --git a/i386/include/mach/.svn/text-base/shared_memory_server.h.svn-base b/i386/include/mach/.svn/text-base/shared_memory_server.h.svn-base new file mode 100644 index 0000000..1ca25f3 --- /dev/null +++ b/i386/include/mach/.svn/text-base/shared_memory_server.h.svn-base @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * + * File: mach/shared_memory_server.h + * + * protos and struct definitions for shared library + * server and interface + */ + +/* + * XXX + * + * NOTE: this file is deprecated and will be removed in the near future. + * Any project that includes this file should be changed to: + * 1. use <mach/shared_region.h> instead of this file, + * 2. handle the new shared regions, now available on more platforms + */ + +#ifndef _MACH_SHARED_MEMORY_SERVER_H_ +#define _MACH_SHARED_MEMORY_SERVER_H_ + +#warning "<mach/shared_memory_server.h> is deprecated. Please use <mach/shared_region.h> instead." + +#include <sys/cdefs.h> +#include <mach/vm_prot.h> +#include <mach/vm_types.h> +#include <mach/mach_types.h> + +#define VM_PROT_COW 0x8 /* must not interfere with normal prot assignments */ +#define VM_PROT_ZF 0x10 /* must not interfere with normal prot assignments */ + +#ifdef __arm__ +#define GLOBAL_SHARED_TEXT_SEGMENT 0x30000000U +#define GLOBAL_SHARED_DATA_SEGMENT 0x38000000U +#define GLOBAL_SHARED_SEGMENT_MASK 0xF8000000U + +#define SHARED_TEXT_REGION_SIZE 0x08000000 +#define SHARED_DATA_REGION_SIZE 0x08000000 +#else +#define GLOBAL_SHARED_TEXT_SEGMENT 0x90000000U +#define GLOBAL_SHARED_DATA_SEGMENT 0xA0000000U +#define GLOBAL_SHARED_SEGMENT_MASK 0xF0000000U + +#define SHARED_TEXT_REGION_SIZE 0x10000000 +#define SHARED_DATA_REGION_SIZE 0x10000000 +#endif + +#if !defined(__LP64__) + +#define SHARED_LIBRARY_SERVER_SUPPORTED + +#define SHARED_ALTERNATE_LOAD_BASE 0x09000000 + +/* + * Note: the two masks below are useful because the assumption is + * made that these shared regions will always be mapped on natural boundaries + * i.e. if the size is 0x10000000 the object can be mapped at + * 0x20000000, or 0x30000000, but not 0x1000000 + */ +#ifdef __arm__ +#define SHARED_TEXT_REGION_MASK 0x07FFFFFF +#define SHARED_DATA_REGION_MASK 0x07FFFFFF +#else +#define SHARED_TEXT_REGION_MASK 0x0FFFFFFF +#define SHARED_DATA_REGION_MASK 0x0FFFFFFF +#endif + + +/* flags field aliases for copyin_shared_file and load_shared_file */ + +/* IN */ +#define ALTERNATE_LOAD_SITE 0x1 +#define NEW_LOCAL_SHARED_REGIONS 0x2 +#define QUERY_IS_SYSTEM_REGION 0x4 + +/* OUT */ +#define SF_PREV_LOADED 0x1 +#define SYSTEM_REGION_BACKED 0x2 + + +struct sf_mapping { + vm_offset_t mapping_offset; + vm_size_t size; + vm_offset_t file_offset; + vm_prot_t protection; /* read/write/execute/COW/ZF */ + vm_offset_t cksum; +}; +typedef struct sf_mapping sf_mapping_t; + +#endif /* !defined(__LP64__) */ + +/* + * All shared_region_* declarations are a private interface + * between dyld and the kernel. + * + */ +struct shared_file_mapping_np { + mach_vm_address_t sfm_address; + mach_vm_size_t sfm_size; + mach_vm_offset_t sfm_file_offset; + vm_prot_t sfm_max_prot; + vm_prot_t sfm_init_prot; +}; + +struct shared_region_range_np { + mach_vm_address_t srr_address; + mach_vm_size_t srr_size; +}; + + +__BEGIN_DECLS +int shared_region_map_file_np(int fd, + uint32_t mappingCount, + const struct shared_file_mapping_np *mappings, + int64_t *slide_p); +int shared_region_make_private_np(uint32_t rangeCount, + const struct shared_region_range_np *ranges); +__END_DECLS + + +#endif /* _MACH_SHARED_MEMORY_SERVER_H_ */ diff --git a/i386/include/mach/.svn/text-base/shared_region.h.svn-base b/i386/include/mach/.svn/text-base/shared_region.h.svn-base new file mode 100644 index 0000000..4bea17e --- /dev/null +++ b/i386/include/mach/.svn/text-base/shared_region.h.svn-base @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * File: mach/shared_region.h + * + * protos and struct definitions for shared region + */ + +#ifndef _MACH_SHARED_REGION_H_ +#define _MACH_SHARED_REGION_H_ + +#include <sys/cdefs.h> +#include <mach/vm_prot.h> +#include <mach/vm_types.h> +#include <mach/mach_types.h> + +#define SHARED_REGION_BASE_I386 0x90000000ULL +#define SHARED_REGION_SIZE_I386 0x20000000ULL +#define SHARED_REGION_NESTING_BASE_I386 0x90000000ULL +#define SHARED_REGION_NESTING_SIZE_I386 0x20000000ULL +#define SHARED_REGION_NESTING_MIN_I386 0x00200000ULL +#define SHARED_REGION_NESTING_MAX_I386 0xFFE00000ULL + +#define SHARED_REGION_BASE_X86_64 0x00007FFF70000000ULL +#define SHARED_REGION_SIZE_X86_64 0x000000008FE00000ULL +#define SHARED_REGION_NESTING_BASE_X86_64 0x00007FFF80000000ULL +#define SHARED_REGION_NESTING_SIZE_X86_64 0x0000000040000000ULL +#define SHARED_REGION_NESTING_MIN_X86_64 0x0000000000200000ULL +#define SHARED_REGION_NESTING_MAX_X86_64 0xFFFFFFFFFFE00000ULL + +#define SHARED_REGION_BASE_PPC 0x90000000ULL +#define SHARED_REGION_SIZE_PPC 0x20000000ULL +#define SHARED_REGION_NESTING_BASE_PPC 0x90000000ULL +#define SHARED_REGION_NESTING_SIZE_PPC 0x10000000ULL +#define SHARED_REGION_NESTING_MIN_PPC 0x10000000ULL +#define SHARED_REGION_NESTING_MAX_PPC 0x10000000ULL + +#define SHARED_REGION_BASE_PPC64 0x00007FFF60000000ULL +#define SHARED_REGION_SIZE_PPC64 0x00000000A0000000ULL +#define SHARED_REGION_NESTING_BASE_PPC64 0x00007FFF60000000ULL +#define SHARED_REGION_NESTING_SIZE_PPC64 0x00000000A0000000ULL +#define SHARED_REGION_NESTING_MIN_PPC64 0x0000000010000000ULL +#define SHARED_REGION_NESTING_MAX_PPC64 0x0000000010000000ULL + +#define SHARED_REGION_BASE_ARM 0x30000000ULL +#define SHARED_REGION_SIZE_ARM 0x10000000ULL +#define SHARED_REGION_NESTING_BASE_ARM 0x30000000ULL +#define SHARED_REGION_NESTING_SIZE_ARM 0x08000000ULL +#define SHARED_REGION_NESTING_MIN_ARM ? +#define SHARED_REGION_NESTING_MAX_ARM ? + +#if defined(__i386__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_I386 +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_I386 +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_I386 +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_I386 +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_I386 +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_I386 +#elif defined(__x86_64__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_X86_64 +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_X86_64 +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_X86_64 +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_X86_64 +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_X86_64 +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_X86_64 +#elif defined(__ppc__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_PPC +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_PPC +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_PPC +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_PPC +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_PPC +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_PPC +#elif defined(__ppc64__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_PPC64 +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_PPC64 +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_PPC64 +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_PPC64 +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_PPC64 +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_PPC64 +#elif defined(__arm__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_ARM +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_ARM +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_ARM +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_ARM +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_ARM +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_ARM +#endif + +/* + * All shared_region_* declarations are a private interface + * between dyld and the kernel. + * + */ +struct shared_file_mapping_np { + mach_vm_address_t sfm_address; + mach_vm_size_t sfm_size; + mach_vm_offset_t sfm_file_offset; + vm_prot_t sfm_max_prot; + vm_prot_t sfm_init_prot; +}; +#define VM_PROT_COW 0x8 /* must not interfere with normal prot assignments */ +#define VM_PROT_ZF 0x10 /* must not interfere with normal prot assignments */ + + +__BEGIN_DECLS +int shared_region_check_np(uint64_t *startaddress); +int shared_region_map_np(int fd, + uint32_t mappingCount, + const struct shared_file_mapping_np *mappings); +__END_DECLS + + +#endif /* _MACH_SHARED_REGION_H_ */ diff --git a/i386/include/mach/.svn/text-base/std_types.defs.svn-base b/i386/include/mach/.svn/text-base/std_types.defs.svn-base new file mode 100644 index 0000000..0b48383 --- /dev/null +++ b/i386/include/mach/.svn/text-base/std_types.defs.svn-base @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Mach kernel standard interface type declarations + */ + +#ifndef _MACH_STD_TYPES_DEFS_ +#define _MACH_STD_TYPES_DEFS_ + +/* from ISO/IEC 988:1999 spec */ +/* 7.18.1.1 Exact-width integer types */ + +type int8_t = MACH_MSG_TYPE_INTEGER_8; +type uint8_t = MACH_MSG_TYPE_INTEGER_8; +type int16_t = MACH_MSG_TYPE_INTEGER_16; +type uint16_t = MACH_MSG_TYPE_INTEGER_16; +type int32_t = MACH_MSG_TYPE_INTEGER_32; +type uint32_t = MACH_MSG_TYPE_INTEGER_32; +type int64_t = MACH_MSG_TYPE_INTEGER_64; +type uint64_t = MACH_MSG_TYPE_INTEGER_64; + +/* + * Legacy fixed-length Mach types which should + * be replaced with the Standard types from above. + */ +type int32 = int32_t; +type unsigned32 = uint32_t; +type int64 = int64_t; +type unsigned64 = uint64_t; + +/* + * Other fixed length Mach types. + */ +type char = MACH_MSG_TYPE_CHAR; +type boolean_t = MACH_MSG_TYPE_BOOLEAN; + +#include <mach/machine/machine_types.defs> + +type kern_return_t = int; + +type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE + ctype: vm_offset_t; + + +type mach_port_t = MACH_MSG_TYPE_COPY_SEND; +type mach_port_array_t = array[] of mach_port_t; + +type mach_port_name_t = MACH_MSG_TYPE_PORT_NAME; +type mach_port_name_array_t = array[] of mach_port_name_t; + +type mach_port_right_t = natural_t; + +type mach_port_type_t = natural_t; +type mach_port_type_array_t = array[] of mach_port_type_t; + +type mach_port_urefs_t = natural_t; +type mach_port_delta_t = integer_t; +type mach_port_seqno_t = natural_t; +type mach_port_mscount_t = unsigned; +type mach_port_msgcount_t = unsigned; +type mach_port_rights_t = unsigned; +type mach_msg_id_t = integer_t; +type mach_msg_size_t = natural_t; +type mach_msg_type_name_t = unsigned; +type mach_msg_options_t = integer_t; + +type mach_port_move_receive_t = MACH_MSG_TYPE_MOVE_RECEIVE + ctype: mach_port_t; +type mach_port_copy_send_t = MACH_MSG_TYPE_COPY_SEND + ctype: mach_port_t; +type mach_port_make_send_t = MACH_MSG_TYPE_MAKE_SEND + ctype: mach_port_t; +type mach_port_move_send_t = MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t; +type mach_port_make_send_once_t = MACH_MSG_TYPE_MAKE_SEND_ONCE + ctype: mach_port_t; +type mach_port_move_send_once_t = MACH_MSG_TYPE_MOVE_SEND_ONCE + ctype: mach_port_t; + +type mach_port_receive_t = MACH_MSG_TYPE_PORT_RECEIVE + ctype: mach_port_t; +type mach_port_send_t = MACH_MSG_TYPE_PORT_SEND + ctype: mach_port_t; +type mach_port_send_once_t = MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +type mach_port_poly_t = polymorphic + ctype: mach_port_t; + +import <mach/std_types.h>; +import <mach/mig.h>; + +#endif /* _MACH_STD_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/std_types.h.svn-base b/i386/include/mach/.svn/text-base/std_types.h.svn-base new file mode 100644 index 0000000..f5b838a --- /dev/null +++ b/i386/include/mach/.svn/text-base/std_types.h.svn-base @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Mach standard external interface type definitions. + * + */ + +#ifndef _MACH_STD_TYPES_H_ +#define _MACH_STD_TYPES_H_ + +#include <stdint.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/port.h> +#include <mach/vm_types.h> + +#endif /* _MACH_STD_TYPES_H_ */ diff --git a/i386/include/mach/.svn/text-base/sync.h.svn-base b/i386/include/mach/.svn/text-base/sync.h.svn-base new file mode 100644 index 0000000..0a567c2 --- /dev/null +++ b/i386/include/mach/.svn/text-base/sync.h.svn-base @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +** This file contains compatibilty wrapper header for things that used +** to be generated from mach/sync.defs. Now that code is split into two +** different interface generator files, so include the two resulting +** headers here. +*/ +#include <mach/semaphore.h> +#include <mach/lock_set.h> diff --git a/i386/include/mach/.svn/text-base/sync_policy.h.svn-base b/i386/include/mach/.svn/text-base/sync_policy.h.svn-base new file mode 100644 index 0000000..1fd8d3f --- /dev/null +++ b/i386/include/mach/.svn/text-base/sync_policy.h.svn-base @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_SYNC_POLICY_H_ +#define _MACH_SYNC_POLICY_H_ + +typedef int sync_policy_t; + +/* + * These options define the wait ordering of the synchronizers + */ +#define SYNC_POLICY_FIFO 0x0 +#define SYNC_POLICY_FIXED_PRIORITY 0x1 +#define SYNC_POLICY_REVERSED 0x2 +#define SYNC_POLICY_ORDER_MASK 0x3 +#define SYNC_POLICY_LIFO (SYNC_POLICY_FIFO|SYNC_POLICY_REVERSED) + + +#define SYNC_POLICY_MAX 0x7 + +#endif /* _MACH_SYNC_POLICY_H_ */ diff --git a/i386/include/mach/.svn/text-base/task.defs.svn-base b/i386/include/mach/.svn/text-base/task.defs.svn-base new file mode 100644 index 0000000..ceebc95 --- /dev/null +++ b/i386/include/mach/.svn/text-base/task.defs.svn-base @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + task 3400; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +/* + * Create a new task with an empty set of IPC rights, + * and having an address space constructed from the + * target task (or empty, if inherit_memory is FALSE). + */ +routine task_create( + target_task : task_t; + ledgers : ledger_array_t; + inherit_memory : boolean_t; + out child_task : task_t); + +/* + * Destroy the target task, causing all of its threads + * to be destroyed, all of its IPC rights to be deallocated, + * and all of its address space to be deallocated. + */ +routine task_terminate( + target_task : task_t); + +/* + * Returns the set of threads belonging to the target task. + */ +routine task_threads( + target_task : task_t; + out act_list : thread_act_array_t); + +/* + * Stash a handful of ports for the target task; child + * tasks inherit this stash at task_create time. + */ +routine mach_ports_register( + target_task : task_t; + init_port_set : mach_port_array_t = + ^array[] of mach_port_t); + +/* + * Retrieve the stashed ports for the target task. + */ +routine mach_ports_lookup( + target_task : task_t; + out init_port_set : mach_port_array_t = + ^array[] of mach_port_t); + +/* + * Returns information about the target task. + */ +routine task_info( + target_task : task_name_t; + flavor : task_flavor_t; + out task_info_out : task_info_t, CountInOut); + +/* + * Set task information. + */ +routine task_set_info( + target_task : task_t; + flavor : task_flavor_t; + task_info_in : task_info_t); + +/* + * Increment the suspend count for the target task. + * No threads within a task may run when the suspend + * count for that task is non-zero. + */ +routine task_suspend( + target_task : task_t); + + +/* + * Decrement the suspend count for the target task, + * if the count is currently non-zero. If the resulting + * suspend count is zero, then threads within the task + * that also have non-zero suspend counts may execute. + */ +routine task_resume( + target_task : task_t); + +/* + * Returns the current value of the selected special port + * associated with the target task. + */ +routine task_get_special_port( + task : task_t; + which_port : int; + out special_port : mach_port_t); + +/* + * Set one of the special ports associated with the + * target task. + */ +routine task_set_special_port( + task : task_t; + which_port : int; + special_port : mach_port_t); + +/* + * Create a new thread within the target task, returning + * the port representing the first thr_act in that new thread. The + * initial execution state of the thread is undefined. + */ +routine thread_create( + parent_task : task_t; + out child_act : thread_act_t); + +/* + * Create a new thread within the target task, returning + * the port representing that new thread. The new thread + * is not suspended; its initial execution state is given + * by flavor and new_state. Returns the port representing + * the new thread. + */ +routine thread_create_running( + parent_task : task_t; + flavor : thread_state_flavor_t; + new_state : thread_state_t; + out child_act : thread_act_t); + +/* + * Set an exception handler for a task on one or more exception types. + * These handlers are invoked for all threads in the task if there are + * no thread-specific exception handlers or those handlers returned an + * error. + */ +routine task_set_exception_ports( + task : task_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t); + + +/* + * Lookup some of the old exception handlers for a task + */ +routine task_get_exception_ports( + task : task_t; + exception_mask : exception_mask_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + + +/* + * Set an exception handler for a thread on one or more exception types. + * At the same time, return the previously defined exception handlers for + * those types. + */ +routine task_swap_exception_ports( + task : task_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t; + out masks : exception_mask_array_t; + out old_handlerss : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * Create and destroy lock_set and semaphore synchronizers on a + * per-task basis (i.e. the task owns them). + */ +routine lock_set_create( + task : task_t; + out new_lock_set : lock_set_t; + n_ulocks : int; + policy : int); + +routine lock_set_destroy( + task : task_t; + lock_set : lock_set_t); + +routine semaphore_create( + task : task_t; + out semaphore : semaphore_t; + policy : int; + value : int); + +routine semaphore_destroy( + task : task_t; + semaphore : semaphore_consume_ref_t); + +/* + * Set/get policy information for a task. + * (Approved Mac OS X microkernel interface) + */ + +routine task_policy_set( + task : task_t; + flavor : task_policy_flavor_t; + policy_info : task_policy_t); + +routine task_policy_get( + task : task_t; + flavor : task_policy_flavor_t; +out policy_info : task_policy_t, CountInOut; +inout get_default : boolean_t); + +/* + * Removed from the kernel. + */ +#if KERNEL_SERVER +skip; +#else +routine task_sample( + task : task_t; + reply : mach_port_make_send_t); +#endif + +/* + * JMM - Everything from here down is likely to go away soon + */ +/* + * OBSOLETE interface. + */ +routine task_policy( + task : task_t; + policy : policy_t; + base : policy_base_t; + set_limit : boolean_t; + change : boolean_t); + + +/* + * Establish a user-level handler for the specified + * system call. + */ +routine task_set_emulation( + target_port : task_t; + routine_entry_pt: vm_address_t; + routine_number : int); + +/* + * Get user-level handler entry points for all + * emulated system calls. + */ +routine task_get_emulation_vector( + task : task_t; + out vector_start : int; + out emulation_vector: emulation_vector_t); + +/* + * Establish user-level handlers for the specified + * system calls. Non-emulated system calls are specified + * with emulation_vector[i] == EML_ROUTINE_NULL. + */ +routine task_set_emulation_vector( + task : task_t; + vector_start : int; + emulation_vector: emulation_vector_t); + + +/* + * Establish restart pc for interrupted atomic sequences. + */ +routine task_set_ras_pc( + target_task : task_t; + basepc : vm_address_t; + boundspc : vm_address_t); + + +skip; /* was kernel_task_create() */ + +/* + * JMM - Want to eliminate processor_set so keep them at the end. + */ + +/* + * Assign task to processor set. + */ +routine task_assign( + task : task_t; + new_set : processor_set_t; + assign_threads : boolean_t); + +/* + * Assign task to default set. + */ +routine task_assign_default( + task : task_t; + assign_threads : boolean_t); + +/* + * Get current assignment for task. + */ +routine task_get_assignment( + task : task_t; + out assigned_set : processor_set_name_t); + +/* + * OBSOLETE interface. + */ +routine task_set_policy( + task : task_t; + pset : processor_set_t; + policy : policy_t; + base : policy_base_t; + limit : policy_limit_t; + change : boolean_t); + +/* + * Read the selected state which is to be installed on new + * threads in the task as they are created. + */ +routine task_get_state( + task : task_t; + flavor : thread_state_flavor_t; + out old_state : thread_state_t, CountInOut); + +/* + * Set the selected state information to be installed on + * all subsequently created threads in the task. + */ +routine task_set_state( + task : task_t; + flavor : thread_state_flavor_t; + new_state : thread_state_t); + + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/task.h.svn-base b/i386/include/mach/.svn/text-base/task.h.svn-base new file mode 100644 index 0000000..459a330 --- /dev/null +++ b/i386/include/mach/.svn/text-base/task.h.svn-base @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined(__i386__) +#include <mach/i386/task.h> +#elif defined(__x86_64__) +#include <mach/x86_64/task.h> +#elif defined(__ppc__) +#include <mach/ppc/task.h> +#elif defined(__ppc64__) +#include <mach/ppc64/task.h> +#elif defined(__arm__) +#include <mach/arm/task.h> +#else +#error unknown architecture +#endif diff --git a/i386/include/mach/.svn/text-base/task_access.defs.svn-base b/i386/include/mach/.svn/text-base/task_access.defs.svn-base new file mode 100644 index 0000000..1696fd3 --- /dev/null +++ b/i386/include/mach/.svn/text-base/task_access.defs.svn-base @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERN_USER */ + task_access 27000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Verify task_for_pid access for the given pid + * Access granted by return value (success/failure) + */ +routine check_task_access( + task_access_port : mach_port_t; + calling_pid : int32_t; + calling_gid : uint32_t; + target_pid : int32_t; + ServerAuditToken caller_cred : audit_token_t); + +/* + * Search for a code signature for unsigned executables + */ +routine find_code_signature( + task_access_port : mach_port_t; + new_pid : int32_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/task_info.h.svn-base b/i386/include/mach/.svn/text-base/task_info.h.svn-base new file mode 100644 index 0000000..cab9c17 --- /dev/null +++ b/i386/include/mach/.svn/text-base/task_info.h.svn-base @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * Machine-independent task information structures and definitions. + * + * The definitions in this file are exported to the user. The kernel + * will translate its internal data structures to these structures + * as appropriate. + * + */ + +#ifndef _MACH_TASK_INFO_H_ +#define _MACH_TASK_INFO_H_ + +#include <mach/message.h> +#include <mach/machine/vm_types.h> +#include <mach/time_value.h> +#include <mach/policy.h> + +#include <sys/cdefs.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef natural_t task_flavor_t; +typedef integer_t *task_info_t; /* varying array of int */ + +#define TASK_INFO_MAX (1024) /* maximum array size */ +typedef integer_t task_info_data_t[TASK_INFO_MAX]; + +/* + * Currently defined information structures. + */ + +#pragma pack(4) + +#define TASK_BASIC_INFO_32 4 /* basic information */ +#define TASK_BASIC2_INFO_32 6 + +struct task_basic_info_32 { + integer_t suspend_count; /* suspend count for task */ + natural_t virtual_size; /* virtual memory size (bytes) */ + natural_t resident_size; /* resident memory size (bytes) */ + time_value_t user_time; /* total user run time for + terminated threads */ + time_value_t system_time; /* total system run time for + terminated threads */ + policy_t policy; /* default policy for new threads */ +}; +typedef struct task_basic_info_32 task_basic_info_32_data_t; +typedef struct task_basic_info_32 *task_basic_info_32_t; +#define TASK_BASIC_INFO_32_COUNT \ + (sizeof(task_basic_info_32_data_t) / sizeof(natural_t)) + + +#define TASK_BASIC_INFO_64 5 /* 64-bit capable basic info */ + +struct task_basic_info_64 { + integer_t suspend_count; /* suspend count for task */ + mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ + mach_vm_size_t resident_size; /* resident memory size (bytes) */ + time_value_t user_time; /* total user run time for + terminated threads */ + time_value_t system_time; /* total system run time for + terminated threads */ + policy_t policy; /* default policy for new threads */ +}; +typedef struct task_basic_info_64 task_basic_info_64_data_t; +typedef struct task_basic_info_64 *task_basic_info_64_t; +#define TASK_BASIC_INFO_64_COUNT \ + (sizeof(task_basic_info_64_data_t) / sizeof(natural_t)) + + +/* localized structure - cannot be safely passed between tasks of differing sizes */ + +struct task_basic_info { + integer_t suspend_count; /* suspend count for task */ + vm_size_t virtual_size; /* virtual memory size (bytes) */ + vm_size_t resident_size; /* resident memory size (bytes) */ + time_value_t user_time; /* total user run time for + terminated threads */ + time_value_t system_time; /* total system run time for + terminated threads */ + policy_t policy; /* default policy for new threads */ +}; + +typedef struct task_basic_info task_basic_info_data_t; +typedef struct task_basic_info *task_basic_info_t; +#define TASK_BASIC_INFO_COUNT \ + (sizeof(task_basic_info_data_t) / sizeof(natural_t)) +#if !defined(__LP64__) +#define TASK_BASIC_INFO TASK_BASIC_INFO_32 +#else +#define TASK_BASIC_INFO TASK_BASIC_INFO_64 +#endif + + + +#define TASK_EVENTS_INFO 2 /* various event counts */ + +struct task_events_info { + integer_t faults; /* number of page faults */ + integer_t pageins; /* number of actual pageins */ + integer_t cow_faults; /* number of copy-on-write faults */ + integer_t messages_sent; /* number of messages sent */ + integer_t messages_received; /* number of messages received */ + integer_t syscalls_mach; /* number of mach system calls */ + integer_t syscalls_unix; /* number of unix system calls */ + integer_t csw; /* number of context switches */ +}; +typedef struct task_events_info task_events_info_data_t; +typedef struct task_events_info *task_events_info_t; +#define TASK_EVENTS_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(task_events_info_data_t) / sizeof(natural_t))) + +#define TASK_THREAD_TIMES_INFO 3 /* total times for live threads - + only accurate if suspended */ + +struct task_thread_times_info { + time_value_t user_time; /* total user run time for + live threads */ + time_value_t system_time; /* total system run time for + live threads */ +}; + +typedef struct task_thread_times_info task_thread_times_info_data_t; +typedef struct task_thread_times_info *task_thread_times_info_t; +#define TASK_THREAD_TIMES_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(task_thread_times_info_data_t) / sizeof(natural_t))) + +#define TASK_ABSOLUTETIME_INFO 1 + +struct task_absolutetime_info { + uint64_t total_user; /* total time */ + uint64_t total_system; + uint64_t threads_user; /* existing threads only */ + uint64_t threads_system; +}; + +typedef struct task_absolutetime_info task_absolutetime_info_data_t; +typedef struct task_absolutetime_info *task_absolutetime_info_t; +#define TASK_ABSOLUTETIME_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof (task_absolutetime_info_data_t) / sizeof (natural_t))) + +#define TASK_SECURITY_TOKEN 13 +#define TASK_SECURITY_TOKEN_COUNT ((mach_msg_type_number_t) \ + (sizeof(security_token_t) / sizeof(natural_t))) + +#define TASK_AUDIT_TOKEN 15 +#define TASK_AUDIT_TOKEN_COUNT \ + (sizeof(audit_token_t) / sizeof(natural_t)) + + +#define TASK_AFFINITY_TAG_INFO 16 /* This is experimental. */ + +struct task_affinity_tag_info { + integer_t set_count; + integer_t min; + integer_t max; + integer_t task_count; +}; +typedef struct task_affinity_tag_info task_affinity_tag_info_data_t; +typedef struct task_affinity_tag_info *task_affinity_tag_info_t; +#define TASK_AFFINITY_TAG_INFO_COUNT \ + (sizeof(task_affinity_tag_info_data_t) / sizeof(natural_t)) + +#define TASK_DYLD_INFO 17 /* This is experimental. */ + +struct task_dyld_info { + mach_vm_address_t all_image_info_addr; + mach_vm_size_t all_image_info_size; +}; +typedef struct task_dyld_info task_dyld_info_data_t; +typedef struct task_dyld_info *task_dyld_info_t; +#define TASK_DYLD_INFO_COUNT \ + (sizeof(task_dyld_info_data_t) / sizeof(natural_t)) + +#pragma pack() + + +/* + * Obsolete interfaces. + */ + +#define TASK_SCHED_TIMESHARE_INFO 10 +#define TASK_SCHED_RR_INFO 11 +#define TASK_SCHED_FIFO_INFO 12 + +#define TASK_SCHED_INFO 14 + +#endif /* _MACH_TASK_INFO_H_ */ diff --git a/i386/include/mach/.svn/text-base/task_ledger.h.svn-base b/i386/include/mach/.svn/text-base/task_ledger.h.svn-base new file mode 100644 index 0000000..5d4bc25 --- /dev/null +++ b/i386/include/mach/.svn/text-base/task_ledger.h.svn-base @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_TASK_LEDGER_H_ +#define _MACH_TASK_LEDGER_H_ + +/* + * Evolving and likely to change. + */ + +/* + * Definitions for task ledger line items + */ +#define ITEM_THREADS 0 /* number of threads */ +#define ITEM_TASKS 1 /* number of tasks */ + +#define ITEM_VM 2 /* virtual space (bytes)*/ + +#define LEDGER_N_ITEMS 3 /* Total line items */ + +#define LEDGER_UNLIMITED 0 /* ignored item.maximum */ + +#endif /* _MACH_TASK_LEDGER_H_ */ diff --git a/i386/include/mach/.svn/text-base/task_policy.h.svn-base b/i386/include/mach/.svn/text-base/task_policy.h.svn-base new file mode 100644 index 0000000..3a2fb39 --- /dev/null +++ b/i386/include/mach/.svn/text-base/task_policy.h.svn-base @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_TASK_POLICY_H_ +#define _MACH_TASK_POLICY_H_ + +#include <mach/mach_types.h> + +/* + * These are the calls for accessing the policy parameters + * of a particular task. + * + * The extra 'get_default' parameter to the second call is + * IN/OUT as follows: + * 1) if asserted on the way in it indicates that the default + * values should be returned, not the ones currently set, in + * this case 'get_default' will always be asserted on return; + * 2) if unasserted on the way in, the current settings are + * desired and if still unasserted on return, then the info + * returned reflects the current settings, otherwise if + * 'get_default' returns asserted, it means that there are no + * current settings due to other parameters taking precedence, + * and the default ones are being returned instead. + */ + +typedef natural_t task_policy_flavor_t; +typedef integer_t *task_policy_t; + +/* +kern_return_t task_policy_set( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t count); + +kern_return_t task_policy_get( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *count, + boolean_t *get_default); +*/ + +/* + * Defined flavors. + */ +/* + * TASK_CATEGORY_POLICY: + * + * This provides information to the kernel about the role + * of the task in the system. + * + * Parameters: + * + * role: Enumerated as follows: + * + * TASK_UNSPECIFIED is the default, since the role is not + * inherited from the parent. + * + * TASK_FOREGROUND_APPLICATION should be assigned when the + * task is a normal UI application in the foreground from + * the HI point of view. + * **N.B. There may be more than one of these at a given time. + * + * TASK_BACKGROUND_APPLICATION should be assigned when the + * task is a normal UI application in the background from + * the HI point of view. + * + * TASK_CONTROL_APPLICATION should be assigned to the unique + * UI application which implements the pop-up application dialog. + * There can only be one task at a time with this designation, + * which is assigned FCFS. + * + * TASK_GRAPHICS_SERVER should be assigned to the graphics + * management (window) server. There can only be one task at + * a time with this designation, which is assigned FCFS. + */ + +#define TASK_CATEGORY_POLICY 1 + +enum task_role { + TASK_RENICED = -1, + TASK_UNSPECIFIED = 0, + TASK_FOREGROUND_APPLICATION, + TASK_BACKGROUND_APPLICATION, + TASK_CONTROL_APPLICATION, + TASK_GRAPHICS_SERVER, + TASK_THROTTLE_APPLICATION, + TASK_DEFAULT_APPLICATION +}; + +typedef enum task_role task_role_t; + +struct task_category_policy { + task_role_t role; +}; + +typedef struct task_category_policy task_category_policy_data_t; +typedef struct task_category_policy *task_category_policy_t; + +#define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (task_category_policy_data_t) / sizeof (integer_t))) + +#endif /* _MACH_TASK_POLICY_H_ */ diff --git a/i386/include/mach/.svn/text-base/task_special_ports.h.svn-base b/i386/include/mach/.svn/text-base/task_special_ports.h.svn-base new file mode 100644 index 0000000..ec980cf --- /dev/null +++ b/i386/include/mach/.svn/text-base/task_special_ports.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/task_special_ports.h + * + * Defines codes for special_purpose task ports. These are NOT + * port identifiers - they are only used for the task_get_special_port + * and task_set_special_port routines. + * + */ + +#ifndef _MACH_TASK_SPECIAL_PORTS_H_ +#define _MACH_TASK_SPECIAL_PORTS_H_ + +typedef int task_special_port_t; + +#define TASK_KERNEL_PORT 1 /* Represents task to the outside + world.*/ + +#define TASK_HOST_PORT 2 /* The host (priv) port for task. */ + +#define TASK_NAME_PORT 3 /* the name (unpriv) port for task */ + +#define TASK_BOOTSTRAP_PORT 4 /* Bootstrap environment for task. */ + +/* + * Evolving and likely to change. + */ + +#define TASK_WIRED_LEDGER_PORT 5 /* Wired resource ledger for task. */ + +#define TASK_PAGED_LEDGER_PORT 6 /* Paged resource ledger for task. */ + +#define TASK_SEATBELT_PORT 7 /* Seatbelt compiler/DEM port for task. */ + +#define TASK_GSSD_PORT 8 /* GSSD port for security context */ + +#define TASK_ACCESS_PORT 9 /* Permission check for task_for_pid. */ + +#define task_get_wired_ledger_port(task, port) \ + (task_get_special_port((task), TASK_WIRED_LEDGER_PORT, (port))) + +#define task_set_wired_ledger_port(task, port) \ + (task_set_special_port((task), TASK_WIRED_LEDGER_PORT, (port))) + +#define task_get_paged_ledger_port(task, port) \ + (task_get_special_port((task), TASK_PAGED_LEDGER_PORT, (port))) + +#define task_set_paged_ledger_port(task, port) \ + (task_set_special_port((task), TASK_PAGED_LEDGER_PORT, (port))) + +/* + * Definitions for ease of use + */ + +#define task_get_kernel_port(task, port) \ + (task_get_special_port((task), TASK_KERNEL_PORT, (port))) + +#define task_set_kernel_port(task, port) \ + (task_set_special_port((task), TASK_KERNEL_PORT, (port))) + +#define task_get_host_port(task, port) \ + (task_get_special_port((task), TASK_HOST_PORT, (port))) + +#define task_set_host_port(task, port) \ + (task_set_special_port((task), TASK_HOST_PORT, (port))) + +#define task_get_bootstrap_port(task, port) \ + (task_get_special_port((task), TASK_BOOTSTRAP_PORT, (port))) + +#define task_set_bootstrap_port(task, port) \ + (task_set_special_port((task), TASK_BOOTSTRAP_PORT, (port))) + +#define task_get_gssd_port(task, port) \ + (task_get_special_port((task), TASK_GSSD_PORT, (port))) + +#define task_set_gssd_port(task, port) \ + (task_set_special_port((task), TASK_GSSD_PORT, (port))) + +#define task_get_task_access_port(task, port) \ + (task_get_special_port((task), TASK_ACCESS_PORT, (port))) + +#define task_set_task_access_port(task, port) \ + (task_set_special_port((task), TASK_ACCESS_PORT, (port))) + +#endif /* _MACH_TASK_SPECIAL_PORTS_H_ */ diff --git a/i386/include/mach/.svn/text-base/thread_act.defs.svn-base b/i386/include/mach/.svn/text-base/thread_act.defs.svn-base new file mode 100644 index 0000000..47a21a9 --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_act.defs.svn-base @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + thread_act 3600; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Destroy the target thread. + * + * JMM - For legacy reasons this consumes a reference to the + * target thread. This will have to change in the future because + * we want the interfaces to be able to be defined in more standard + * IDLs and transports, and most of them do not support the notion + * of reference ownership transfers (just sharing). + */ +routine thread_terminate( + target_act : thread_act_consume_ref_t); + + +/* + * Return the selected state information for the target + * thr_act. If the thr_act is currently executing, the results + * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a + * list of valid flavors for the target thread.] + */ +routine act_get_state( + target_act : thread_act_t; + flavor : int; + out old_state : thread_state_t, CountInOut); + +/* + * Set the selected state information for the target thread. + * If the thread is currently executing, the state change + * may be ill-defined. + */ +routine act_set_state( + target_act : thread_act_t; + flavor : int; + new_state : thread_state_t); + +/* + * Backward compatible old-style thread routines. + * These have different semantics than the new activation versions. + * + * Return the selected state information for the target + * thread. If the thread is currently executing, the results + * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a + * list of valid flavors for the target thr_act.] + */ +routine thread_get_state( + target_act : thread_act_t; + flavor : thread_state_flavor_t; + out old_state : thread_state_t, CountInOut); + +/* + * Set the selected state information for the target thread. + * If the thread is currently executing, the state change + * may be ill-defined. + */ +routine thread_set_state( + target_act : thread_act_t; + flavor : thread_state_flavor_t; + new_state : thread_state_t); + +/* + * Increment the suspend count for the target thread. + * Once this call has completed, the thread will not + * execute any further user or meta- instructions. + * Once suspended, a thread may not execute again until + * its suspend count is zero, and the suspend count + * for its task is also zero. + */ +routine thread_suspend( + target_act : thread_act_t); + +/* + * Decrement the suspend count for the target thread, + * if that count is not already zero. + */ +routine thread_resume( + target_act : thread_act_t); + +/* + * Cause any user or meta- instructions currently being + * executed by the target thread to be aborted. [Meta- + * instructions consist of the basic traps for IPC + * (e.g., msg_send, msg_receive) and self-identification + * (e.g., task_self, thread_self, thread_reply). Calls + * described by MiG interfaces are not meta-instructions + * themselves.] + */ +routine thread_abort( + target_act : thread_act_t); + +/* + * Cause any user or meta- instructions currently being + * executed by the target thread to be aborted so that + * they are transparently restartable. This call fails + * if the abort would result in a non-restartable condition. + * Retry is the caller's responsibility. [Meta- + * instructions consist of the basic traps for IPC + * (e.g., msg_send, msg_receive) and self-identification + * (e.g., task_self, thread_self, thread_reply). Calls + * described by MiG interfaces are not meta-instructions + * themselves.] + */ +routine thread_abort_safely( + target_act : thread_act_t); + + +routine thread_depress_abort( + thread : thread_act_t); + + +/* + * Returns the current value of the selected special port + * associated with the target thread. + */ +routine thread_get_special_port( + thr_act : thread_act_t; + which_port : int; + out special_port : mach_port_t); + +/* + * Set one of the special ports associated with the + * target thread. + */ +routine thread_set_special_port( + thr_act : thread_act_t; + which_port : int; + special_port : mach_port_t); + +/* + * Returns information about the target thread. + */ +routine thread_info( + target_act : thread_act_t; + flavor : thread_flavor_t; + out thread_info_out : thread_info_t, CountInOut); + +/* + * Set an exception handler for a thread on one or more exception types + */ +routine thread_set_exception_ports( + thread : thread_act_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t); + +/* + * Lookup some of the old exception handlers for a thread + */ +routine thread_get_exception_ports( + thread : thread_act_t; + exception_mask : exception_mask_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * Set an exception handler for a thread on one or more exception types. + * At the same time, return the previously defined exception handlers for + * those types. + */ +routine thread_swap_exception_ports( + thread : thread_act_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * OBSOLETE interface. + */ +routine thread_policy( + thr_act : thread_act_t; + policy : policy_t; + base : policy_base_t; + set_limit : boolean_t); + +/* + * Set/get policy information for a thread. + * (Approved Mac OS X microkernel interface) + */ + +routine thread_policy_set( + thread : thread_act_t; + flavor : thread_policy_flavor_t; + policy_info : thread_policy_t); + +routine thread_policy_get( + thread : thread_act_t; + flavor : thread_policy_flavor_t; +out policy_info : thread_policy_t, CountInOut; +inout get_default : boolean_t); + +/* + * Removed from the kernel. + */ +#if KERNEL_SERVER +skip; +#else +routine thread_sample( + thread : thread_act_t; + reply : mach_port_make_send_t); +#endif + +/* + * ETAP has been removed from the kernel. + */ +#if KERNEL_SERVER +skip; +#else +routine etap_trace_thread( + target_act : thread_act_t; + trace_status : boolean_t); +#endif + +/* + * Assign thread to processor set. + */ +routine thread_assign( + thread : thread_act_t; + new_set : processor_set_t); + +/* + * Assign thread to default set. + */ +routine thread_assign_default( + thread : thread_act_t); + +/* + * Get current assignment for thread. + */ +routine thread_get_assignment( + thread : thread_act_t; + out assigned_set : processor_set_name_t); + + +/* + * OBSOLETE interface. + */ +routine thread_set_policy( + thr_act : thread_act_t; + pset : processor_set_t; + policy : policy_t; + base : policy_base_t; + limit : policy_limit_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/thread_act.h.svn-base b/i386/include/mach/.svn/text-base/thread_act.h.svn-base new file mode 100644 index 0000000..ac2309b --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_act.h.svn-base @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined(__i386__) +#include <mach/i386/thread_act.h> +#elif defined(__x86_64__) +#include <mach/x86_64/thread_act.h> +#elif defined(__ppc__) +#include <mach/ppc/thread_act.h> +#elif defined(__ppc64__) +#include <mach/ppc64/thread_act.h> +#elif defined(__arm__) +#include <mach/arm/thread_act.h> +#else +#error unknown architecture +#endif diff --git a/i386/include/mach/.svn/text-base/thread_info.h.svn-base b/i386/include/mach/.svn/text-base/thread_info.h.svn-base new file mode 100644 index 0000000..5f51aea --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_info.h.svn-base @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/thread_info + * + * Thread information structure and definitions. + * + * The defintions in this file are exported to the user. The kernel + * will translate its internal data structures to these structures + * as appropriate. + * + */ + +#ifndef _MACH_THREAD_INFO_H_ +#define _MACH_THREAD_INFO_H_ + +#include <mach/boolean.h> +#include <mach/policy.h> +#include <mach/time_value.h> +#include <mach/message.h> +#include <mach/machine/vm_types.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef natural_t thread_flavor_t; +typedef integer_t *thread_info_t; /* varying array of int */ + +#define THREAD_INFO_MAX (1024) /* maximum array size */ +typedef integer_t thread_info_data_t[THREAD_INFO_MAX]; + +/* + * Currently defined information. + */ +#define THREAD_BASIC_INFO 3 /* basic information */ + +struct thread_basic_info { + time_value_t user_time; /* user run time */ + time_value_t system_time; /* system run time */ + integer_t cpu_usage; /* scaled cpu usage percentage */ + policy_t policy; /* scheduling policy in effect */ + integer_t run_state; /* run state (see below) */ + integer_t flags; /* various flags (see below) */ + integer_t suspend_count; /* suspend count for thread */ + integer_t sleep_time; /* number of seconds that thread + has been sleeping */ +}; + +typedef struct thread_basic_info thread_basic_info_data_t; +typedef struct thread_basic_info *thread_basic_info_t; +#define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(thread_basic_info_data_t) / sizeof(natural_t))) + +#define THREAD_IDENTIFIER_INFO 4 /* thread id and other information */ + +struct thread_identifier_info { + uint64_t thread_id; /* system-wide unique 64-bit thread id */ + uint64_t thread_handle; /* handle to be used by libproc */ + uint64_t dispatch_qaddr; /* libdispatch queue address */ +}; + +typedef struct thread_identifier_info thread_identifier_info_data_t; +typedef struct thread_identifier_info *thread_identifier_info_t; +#define THREAD_IDENTIFIER_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(thread_identifier_info_data_t) / sizeof(natural_t))) + +/* + * Scale factor for usage field. + */ + +#define TH_USAGE_SCALE 1000 + +/* + * Thread run states (state field). + */ + +#define TH_STATE_RUNNING 1 /* thread is running normally */ +#define TH_STATE_STOPPED 2 /* thread is stopped */ +#define TH_STATE_WAITING 3 /* thread is waiting normally */ +#define TH_STATE_UNINTERRUPTIBLE 4 /* thread is in an uninterruptible + wait */ +#define TH_STATE_HALTED 5 /* thread is halted at a + clean point */ + +/* + * Thread flags (flags field). + */ +#define TH_FLAGS_SWAPPED 0x1 /* thread is swapped out */ +#define TH_FLAGS_IDLE 0x2 /* thread is an idle thread */ + +/* + * Obsolete interfaces. + */ + +#define THREAD_SCHED_TIMESHARE_INFO 10 +#define THREAD_SCHED_RR_INFO 11 +#define THREAD_SCHED_FIFO_INFO 12 + +#endif /* _MACH_THREAD_INFO_H_ */ diff --git a/i386/include/mach/.svn/text-base/thread_policy.h.svn-base b/i386/include/mach/.svn/text-base/thread_policy.h.svn-base new file mode 100644 index 0000000..d9530b7 --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_policy.h.svn-base @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_THREAD_POLICY_H_ +#define _MACH_THREAD_POLICY_H_ + +#include <mach/mach_types.h> + +/* + * These are the calls for accessing the policy parameters + * of a particular thread. + * + * The extra 'get_default' parameter to the second call is + * IN/OUT as follows: + * 1) if asserted on the way in it indicates that the default + * values should be returned, not the ones currently set, in + * this case 'get_default' will always be asserted on return; + * 2) if unasserted on the way in, the current settings are + * desired and if still unasserted on return, then the info + * returned reflects the current settings, otherwise if + * 'get_default' returns asserted, it means that there are no + * current settings due to other parameters taking precedence, + * and the default ones are being returned instead. + */ + +typedef natural_t thread_policy_flavor_t; +typedef integer_t *thread_policy_t; + +/* +kern_return_t thread_policy_set( + thread_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t count); + +kern_return_t thread_policy_get( + thread_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *count, + boolean_t *get_default); +*/ + +/* + * Defined flavors. + */ +/* + * THREAD_STANDARD_POLICY: + * + * This is the standard (fair) scheduling mode, assigned to new + * threads. The thread will be given processor time in a manner + * which apportions approximately equal share to long running + * computations. + * + * Parameters: + * [none] + */ + +#define THREAD_STANDARD_POLICY 1 + +struct thread_standard_policy { + natural_t no_data; +}; + +typedef struct thread_standard_policy thread_standard_policy_data_t; +typedef struct thread_standard_policy *thread_standard_policy_t; + +#define THREAD_STANDARD_POLICY_COUNT 0 + +/* + * THREAD_EXTENDED_POLICY: + * + * Extended form of THREAD_STANDARD_POLICY, which supplies a + * hint indicating whether this is a long running computation. + * + * Parameters: + * + * timeshare: TRUE (the default) results in identical scheduling + * behavior as THREAD_STANDARD_POLICY. + */ + +#define THREAD_EXTENDED_POLICY 1 + +struct thread_extended_policy { + boolean_t timeshare; +}; + +typedef struct thread_extended_policy thread_extended_policy_data_t; +typedef struct thread_extended_policy *thread_extended_policy_t; + +#define THREAD_EXTENDED_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_extended_policy_data_t) / sizeof (integer_t))) + +/* + * THREAD_TIME_CONSTRAINT_POLICY: + * + * This scheduling mode is for threads which have real time + * constraints on their execution. + * + * Parameters: + * + * period: This is the nominal amount of time between separate + * processing arrivals, specified in absolute time units. A + * value of 0 indicates that there is no inherent periodicity in + * the computation. + * + * computation: This is the nominal amount of computation + * time needed during a separate processing arrival, specified + * in absolute time units. + * + * constraint: This is the maximum amount of real time that + * may elapse from the start of a separate processing arrival + * to the end of computation for logically correct functioning, + * specified in absolute time units. Must be (>= computation). + * Note that latency = (constraint - computation). + * + * preemptible: This indicates that the computation may be + * interrupted, subject to the constraint specified above. + */ + +#define THREAD_TIME_CONSTRAINT_POLICY 2 + +struct thread_time_constraint_policy { + uint32_t period; + uint32_t computation; + uint32_t constraint; + boolean_t preemptible; +}; + +typedef struct thread_time_constraint_policy \ + thread_time_constraint_policy_data_t; +typedef struct thread_time_constraint_policy \ + *thread_time_constraint_policy_t; + +#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t))) + +/* + * THREAD_PRECEDENCE_POLICY: + * + * This may be used to indicate the relative value of the + * computation compared to the other threads in the task. + * + * Parameters: + * + * importance: The importance is specified as a signed value. + */ + +#define THREAD_PRECEDENCE_POLICY 3 + +struct thread_precedence_policy { + integer_t importance; +}; + +typedef struct thread_precedence_policy thread_precedence_policy_data_t; +typedef struct thread_precedence_policy *thread_precedence_policy_t; + +#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t))) + +/* + * THREAD_AFFINITY_POLICY: + * + * This policy is experimental. + * This may be used to express affinity relationships + * between threads in the task. Threads with the same affinity tag will + * be scheduled to share an L2 cache if possible. That is, affinity tags + * are a hint to the scheduler for thread placement. + * + * The namespace of affinity tags is generally local to one task. However, + * a child task created after the assignment of affinity tags by its parent + * will share that namespace. In particular, a family of forked processes + * may be created with a shared affinity namespace. + * + * Parameters: + * tag: The affinity set identifier. + */ + +#define THREAD_AFFINITY_POLICY 4 + +struct thread_affinity_policy { + integer_t affinity_tag; +}; + +#define THREAD_AFFINITY_TAG_NULL 0 + +typedef struct thread_affinity_policy thread_affinity_policy_data_t; +typedef struct thread_affinity_policy *thread_affinity_policy_t; + +#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t))) + +#endif /* _MACH_THREAD_POLICY_H_ */ diff --git a/i386/include/mach/.svn/text-base/thread_special_ports.h.svn-base b/i386/include/mach/.svn/text-base/thread_special_ports.h.svn-base new file mode 100644 index 0000000..1d44c02 --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_special_ports.h.svn-base @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/thread_special_ports.h + * + * Defines codes for special_purpose thread ports. These are NOT + * port identifiers - they are only used for the thread_get_special_port + * and thread_set_special_port routines. + * + */ + +#ifndef _MACH_THREAD_SPECIAL_PORTS_H_ +#define _MACH_THREAD_SPECIAL_PORTS_H_ + +#define THREAD_KERNEL_PORT 1 /* Represents the thread to the outside + world.*/ + +/* + * Definitions for ease of use + */ + +#define thread_get_kernel_port(thread, port) \ + (thread_get_special_port((thread), THREAD_KERNEL_PORT, (port))) + +#define thread_set_kernel_port(thread, port) \ + (thread_set_special_port((thread), THREAD_KERNEL_PORT, (port))) + +#endif /* _MACH_THREAD_SPECIAL_PORTS_H_ */ diff --git a/i386/include/mach/.svn/text-base/thread_status.h.svn-base b/i386/include/mach/.svn/text-base/thread_status.h.svn-base new file mode 100644 index 0000000..aead09b --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_status.h.svn-base @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/thread_status.h + * Author: Avadis Tevanian, Jr. + * + * This file contains the structure definitions for the user-visible + * thread state. This thread state is examined with the thread_get_state + * kernel call and may be changed with the thread_set_state kernel call. + * + */ + +#ifndef _MACH_THREAD_STATUS_H_ +#define _MACH_THREAD_STATUS_H_ + +/* + * The actual structure that comprises the thread state is defined + * in the machine dependent module. + */ +#include <mach/machine/vm_types.h> +#include <mach/machine/thread_status.h> +#include <mach/machine/thread_state.h> + +/* + * Generic definition for machine-dependent thread status. + */ + +typedef natural_t *thread_state_t; /* Variable-length array */ + +/* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */ +typedef natural_t thread_state_data_t[THREAD_STATE_MAX]; + +#define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */ +#define THREAD_STATE_FLAVOR_LIST_NEW 128 + +typedef int thread_state_flavor_t; +typedef thread_state_flavor_t *thread_state_flavor_array_t; + +#endif /* _MACH_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/.svn/text-base/thread_switch.h.svn-base b/i386/include/mach/.svn/text-base/thread_switch.h.svn-base new file mode 100644 index 0000000..f555894 --- /dev/null +++ b/i386/include/mach/.svn/text-base/thread_switch.h.svn-base @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_THREAD_SWITCH_H_ +#define _MACH_THREAD_SWITCH_H_ + +#include <mach/mach_types.h> +#include <mach/kern_return.h> +#include <mach/message.h> +#include <mach/mach_traps.h> + +/* + * Constant definitions for thread_switch trap. + */ + +#define SWITCH_OPTION_NONE 0 +#define SWITCH_OPTION_DEPRESS 1 +#define SWITCH_OPTION_WAIT 2 + +#define valid_switch_option(opt) (0 <= (opt) && (opt) <= 2) + +#endif /* _MACH_THREAD_SWITCH_H_ */ diff --git a/i386/include/mach/.svn/text-base/time_value.h.svn-base b/i386/include/mach/.svn/text-base/time_value.h.svn-base new file mode 100644 index 0000000..e4f912d --- /dev/null +++ b/i386/include/mach/.svn/text-base/time_value.h.svn-base @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +#ifndef _MACH_TIME_VALUE_H_ +#define _MACH_TIME_VALUE_H_ + +#include <mach/machine/vm_types.h> + +/* + * Time value returned by kernel. + */ + +struct time_value { + integer_t seconds; + integer_t microseconds; +}; + +typedef struct time_value time_value_t; + +/* + * Macros to manipulate time values. Assume that time values + * are normalized (microseconds <= 999999). + */ +#define TIME_MICROS_MAX (1000000) + +#define time_value_add_usec(val, micros) { \ + if (((val)->microseconds += (micros)) \ + >= TIME_MICROS_MAX) { \ + (val)->microseconds -= TIME_MICROS_MAX; \ + (val)->seconds++; \ + } \ +} + +#define time_value_add(result, addend) { \ + (result)->microseconds += (addend)->microseconds; \ + (result)->seconds += (addend)->seconds; \ + if ((result)->microseconds >= TIME_MICROS_MAX) { \ + (result)->microseconds -= TIME_MICROS_MAX; \ + (result)->seconds++; \ + } \ +} + +#endif /* _MACH_TIME_VALUE_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_attributes.h.svn-base b/i386/include/mach/.svn/text-base/vm_attributes.h.svn-base new file mode 100644 index 0000000..2be3233 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_attributes.h.svn-base @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_attributes.h + * Author: Alessandro Forin + * + * Virtual memory attributes definitions. + * + * These definitions are in addition to the machine-independent + * ones (e.g. protection), and are only selectively supported + * on specific machine architectures. + * + */ + +#ifndef _MACH_VM_ATTRIBUTES_H_ +#define _MACH_VM_ATTRIBUTES_H_ + +/* + * Types of machine-dependent attributes + */ +typedef unsigned int vm_machine_attribute_t; + +#define MATTR_CACHE 1 /* cachability */ +#define MATTR_MIGRATE 2 /* migrability */ +#define MATTR_REPLICATE 4 /* replicability */ + +/* + * Values for the above, e.g. operations on attribute + */ +typedef int vm_machine_attribute_val_t; + +#define MATTR_VAL_OFF 0 /* (generic) turn attribute off */ +#define MATTR_VAL_ON 1 /* (generic) turn attribute on */ +#define MATTR_VAL_GET 2 /* (generic) return current value */ + +#define MATTR_VAL_CACHE_FLUSH 6 /* flush from all caches */ +#define MATTR_VAL_DCACHE_FLUSH 7 /* flush from data caches */ +#define MATTR_VAL_ICACHE_FLUSH 8 /* flush from instruction caches */ +#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */ +#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */ + +#define MATTR_VAL_GET_INFO 10 /* get page info (stats) */ + +#endif /* _MACH_VM_ATTRIBUTES_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_behavior.h.svn-base b/i386/include/mach/.svn/text-base/vm_behavior.h.svn-base new file mode 100644 index 0000000..ec0ee72 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_behavior.h.svn-base @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/vm_behavior.h + * + * Virtual memory map behavior definitions. + * + */ + +#ifndef _MACH_VM_BEHAVIOR_H_ +#define _MACH_VM_BEHAVIOR_H_ + +/* + * Types defined: + * + * vm_behavior_t behavior codes. + */ + +typedef int vm_behavior_t; + +/* + * Enumeration of valid values for vm_behavior_t. + * These describe expected page reference behavior for + * for a given range of virtual memory. For implementation + * details see vm/vm_fault.c + */ + + +/* + * The following behaviors affect the memory region's future behavior + * and are stored in the VM map entry data structure. + */ +#define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0) /* default */ +#define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1) /* random */ +#define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2) /* forward sequential */ +#define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3) /* reverse sequential */ + +/* + * The following "behaviors" affect the memory region only at the time of the + * call and are not stored in the VM map entry. + */ +#define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4) /* will need in near future */ +#define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5) /* dont need in near future */ +#define VM_BEHAVIOR_FREE ((vm_behavior_t) 6) /* free memory without write-back */ +#define VM_BEHAVIOR_ZERO_WIRED_PAGES ((vm_behavior_t) 7) /* zero out the wired pages of an entry if it is being deleted without unwiring them first */ +#define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8) +#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9) +#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10) + +#endif /*_MACH_VM_BEHAVIOR_H_*/ diff --git a/i386/include/mach/.svn/text-base/vm_inherit.h.svn-base b/i386/include/mach/.svn/text-base/vm_inherit.h.svn-base new file mode 100644 index 0000000..d6440e4 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_inherit.h.svn-base @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_inherit.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * + * Virtual memory map inheritance definitions. + * + */ + +#ifndef _MACH_VM_INHERIT_H_ +#define _MACH_VM_INHERIT_H_ + +/* + * Types defined: + * + * vm_inherit_t inheritance codes. + */ + +typedef unsigned int vm_inherit_t; /* might want to change this */ + +/* + * Enumeration of valid values for vm_inherit_t. + */ + +#define VM_INHERIT_SHARE ((vm_inherit_t) 0) /* share with child */ +#define VM_INHERIT_COPY ((vm_inherit_t) 1) /* copy into child */ +#define VM_INHERIT_NONE ((vm_inherit_t) 2) /* absent from child */ +#define VM_INHERIT_DONATE_COPY ((vm_inherit_t) 3) /* copy and delete */ + +#define VM_INHERIT_DEFAULT VM_INHERIT_COPY +#define VM_INHERIT_LAST_VALID VM_INHERIT_NONE + +#endif /* _MACH_VM_INHERIT_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_map.defs.svn-base b/i386/include/mach/.svn/text-base/vm_map.defs.svn-base new file mode 100644 index 0000000..439c014 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_map.defs.svn-base @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_map.defs + * + * Exported (native-sized) kernel VM calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + vm_map 3800; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Returns information about the contents of the virtual + * address space of the target task at the specified + * address. The returned protection, inheritance, sharing + * and memory object values apply to the entire range described + * by the address range returned; the memory object offset + * corresponds to the beginning of the address range. + * [If the specified address is not allocated, the next + * highest address range is described. If no addresses beyond + * the one specified are allocated, the call returns KERN_NO_SPACE.] + */ +routine vm_region( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + flavor : vm_region_flavor_t; + out info : vm_region_info_t, CountInOut; + out object_name : memory_object_name_t = + MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t); + +/* + * Allocate zero-filled memory in the address space + * of the target task, either at the specified address, + * or wherever space can be found (if anywhere is TRUE), + * of the specified size. The address at which the + * allocation actually took place is returned. + */ +routine vm_allocate( + target_task : vm_task_entry_t; + inout address : vm_address_t; + size : vm_size_t; + flags : int); + +/* + * Deallocate the specified range from the virtual + * address space of the target task. + */ +routine vm_deallocate( + target_task : vm_task_entry_t; + address : vm_address_t; + size : vm_size_t); + +/* + * Set the current or maximum protection attribute + * for the specified range of the virtual address + * space of the target task. The current protection + * limits the memory access rights of threads within + * the task; the maximum protection limits the accesses + * that may be given in the current protection. + * Protections are specified as a set of {read, write, execute} + * *permissions*. + */ +routine vm_protect( + target_task : vm_task_entry_t; + address : vm_address_t; + size : vm_size_t; + set_maximum : boolean_t; + new_protection : vm_prot_t); + +/* + * Set the inheritance attribute for the specified range + * of the virtual address space of the target task. + * The inheritance value is one of {none, copy, share}, and + * specifies how the child address space should acquire + * this memory at the time of a task_create call. + */ +routine vm_inherit( + target_task : vm_task_entry_t; + address : vm_address_t; + size : vm_size_t; + new_inheritance : vm_inherit_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit reading.] + */ +routine vm_read( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + out data : pointer_t); + +/* + * List corrollary to vm_read, returns mapped contents of specified + * ranges within target address space. + */ +routine vm_read_list( + target_task : vm_map_t; + inout data_list : vm_read_entry_t; + count : natural_t); + +/* + * Writes the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit writing.] + */ +routine vm_write( + target_task : vm_map_t; + address : vm_address_t; + data : pointer_t); + +/* + * Copy the contents of the source range of the virtual + * address space of the target task to the destination + * range in that same address space. [Both of the + * ranges must be aligned on a virtual page boundary, + * and must be multiples of pages in extent. The + * protection on the source range must permit reading, + * and the protection on the destination range must + * permit writing.] + */ +routine vm_copy( + target_task : vm_map_t; + source_address : vm_address_t; + size : vm_size_t; + dest_address : vm_address_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [There + * are no alignment restrictions, and the results will + * overwrite the area pointed to by data - which must + * already exist. The protection on the specified range + * must permit reading.] + */ +routine vm_read_overwrite( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + data : vm_address_t; + out outsize : vm_size_t); + + +routine vm_msync( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + sync_flags : vm_sync_t ); + +/* + * Set the paging behavior attribute for the specified range + * of the virtual address space of the target task. + * The behavior value is one of {default, random, forward + * sequential, reverse sequential} and indicates the expected + * page reference pattern for the specified range. + */ +routine vm_behavior_set( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + new_behavior : vm_behavior_t); + + +/* + * Map a user-defined memory object into the virtual address + * space of the target task. If desired (anywhere is TRUE), + * the kernel will find a suitable address range of the + * specified size; else, the specific address will be allocated. + * + * The beginning address of the range will be aligned on a virtual + * page boundary, be at or beyond the address specified, and + * meet the mask requirements (bits turned on in the mask must not + * be turned on in the result); the size of the range, in bytes, + * will be rounded up to an integral number of virtual pages. + * + * The memory in the resulting range will be associated with the + * specified memory object, with the beginning of the memory range + * referring to the specified offset into the memory object. + * + * The mapping will take the current and maximum protections and + * the inheritance attributes specified; see the vm_protect and + * vm_inherit calls for a description of these attributes. + * + * If desired (copy is TRUE), the memory range will be filled + * with a copy of the data from the memory object; this copy will + * be private to this mapping in this target task. Otherwise, + * the memory in this mapping will be shared with other mappings + * of the same memory object at the same offset (in this task or + * in other tasks). [The Mach kernel only enforces shared memory + * consistency among mappings on one host with similar page alignments. + * The user-defined memory manager for this object is responsible + * for further consistency.] + */ +routine vm_map( + target_task : vm_task_entry_t; + inout address : vm_address_t; + size : vm_size_t; + mask : vm_address_t; + flags : int; + object : mem_entry_name_port_t; + offset : vm_offset_t; + copy : boolean_t; + cur_protection : vm_prot_t; + max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Set/Get special properties of memory associated + * to some virtual address range, such as cachability, + * migrability, replicability. Machine-dependent. + */ +routine vm_machine_attribute( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + attribute : vm_machine_attribute_t; + inout value : vm_machine_attribute_val_t); + +/* + * Map portion of a task's address space. + */ +routine vm_remap( + target_task : vm_map_t; + inout target_address : vm_address_t; + size : vm_size_t; + mask : vm_address_t; + anywhere : boolean_t; + src_task : vm_map_t; + src_address : vm_address_t; + copy : boolean_t; + out cur_protection : vm_prot_t; + out max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Require that all future virtual memory allocation + * allocates wired memory. Setting must_wire to FALSE + * disables the wired future feature. + */ +routine task_wire( + target_task : vm_map_t; + must_wire : boolean_t); + + +/* + * Allow application level processes to create named entries which + * correspond to mapped portions of their address space. These named + * entries can then be manipulated, shared with other processes in + * other address spaces and ultimately mapped in ohter address spaces + */ + +routine mach_make_memory_entry( + target_task :vm_map_t; + inout size :vm_size_t; + offset :vm_offset_t; + permission :vm_prot_t; + out object_handle :mem_entry_name_port_move_send_t; + parent_entry :mem_entry_name_port_t); + +/* + * Give the caller information on the given location in a virtual + * address space. If a page is mapped return ref and dirty info. + */ +routine vm_map_page_query( + target_map :vm_map_t; + offset :vm_offset_t; + out disposition :integer_t; + out ref_count :integer_t); + +/* + * Returns information about a region of memory. + * Includes info about the chain of objects rooted at that region. + * Only available in MACH_VM_DEBUG compiled kernels, + * otherwise returns KERN_FAILURE. + */ +routine mach_vm_region_info( + task : vm_map_t; + address : vm_address_t; + out region : vm_info_region_t; + out objects : vm_info_object_array_t); + +routine vm_mapped_pages_info( + task : vm_map_t; + out pages : page_address_array_t); + +#if 0 +/* + * Allow application level processes to create named entries which + * are backed by sub-maps which describe regions of address space. + * These regions of space can have objects mapped into them and + * in turn, can be mapped into target address spaces + */ + +routine vm_region_object_create( + target_task :vm_map_t; + in size :vm_size_t; + out region_object :mach_port_move_send_t); +#else +skip; /* was vm_region_object_create */ +#endif + +/* + * A recursive form of vm_region which probes submaps withint the + * address space. + */ +routine vm_region_recurse( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + inout nesting_depth : natural_t; + out info : vm_region_recurse_info_t,CountInOut); + + +/* + * The routines below are temporary, meant for transitional use + * as their counterparts are moved from 32 to 64 bit data path + */ + + +routine vm_region_recurse_64( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + inout nesting_depth : natural_t; + out info : vm_region_recurse_info_t,CountInOut); + +routine mach_vm_region_info_64( + task : vm_map_t; + address : vm_address_t; + out region : vm_info_region_64_t; + out objects : vm_info_object_array_t); + +routine vm_region_64( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + flavor : vm_region_flavor_t; + out info : vm_region_info_t, CountInOut; + out object_name : memory_object_name_t = + MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t); + +routine mach_make_memory_entry_64( + target_task :vm_map_t; + inout size :memory_object_size_t; + offset :memory_object_offset_t; + permission :vm_prot_t; + out object_handle :mach_port_move_send_t; + parent_entry :mem_entry_name_port_t); + + + +routine vm_map_64( + target_task : vm_task_entry_t; + inout address : vm_address_t; + size : vm_size_t; + mask : vm_address_t; + flags : int; + object : mem_entry_name_port_t; + offset : memory_object_offset_t; + copy : boolean_t; + cur_protection : vm_prot_t; + max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +#if 0 +/* + * The UPL interfaces are not ready for user-level export. + */ +routine vm_map_get_upl( + target_task : vm_map_t; + address : vm_map_offset_t; + inout size : vm_size_t; + out upl : upl_t; + out page_info : upl_page_info_array_t, CountInOut; + inout flags : integer_t; + force_data_sync : integer_t); + +routine vm_upl_map( + target_task : vm_map_t; + upl : upl_t; + inout address : vm_address_t); + +routine vm_upl_unmap( + target_task : vm_map_t; + upl : upl_t); +#else +skip; /* was vm_map_get_upl */ +skip; /* was vm_upl_map */ +skip; /* was vm_upl_unmap */ +#endif + +/* + * Control behavior and investigate state of a "purgable" object in + * the virtual address space of the target task. A purgable object is + * created via a call to vm_allocate() with VM_FLAGS_PURGABLE + * specified. See the routine implementation for a complete + * definition of the routine. + */ +routine vm_purgable_control( + target_task : vm_map_t; + address : vm_address_t; + control : vm_purgable_t; + inout state : int); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/.svn/text-base/vm_map.h.svn-base b/i386/include/mach/.svn/text-base/vm_map.h.svn-base new file mode 100644 index 0000000..1ed28fb --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_map.h.svn-base @@ -0,0 +1,1378 @@ +#ifndef _vm_map_user_ +#define _vm_map_user_ + +/* Module vm_map */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef vm_map_MSG_COUNT +#define vm_map_MSG_COUNT 31 +#endif /* vm_map_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine vm_region */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + vm_region_flavor_t flavor, + vm_region_info_t info, + mach_msg_type_number_t *infoCnt, + mach_port_t *object_name +); + +/* Routine vm_allocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_allocate +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t size, + int flags +); + +/* Routine vm_deallocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_deallocate +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size +); + +/* Routine vm_protect */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_protect +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + boolean_t set_maximum, + vm_prot_t new_protection +); + +/* Routine vm_inherit */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_inherit +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_inherit_t new_inheritance +); + +/* Routine vm_read */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_read +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_offset_t *data, + mach_msg_type_number_t *dataCnt +); + +/* Routine vm_read_list */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_read_list +( + vm_map_t target_task, + vm_read_entry_t data_list, + natural_t count +); + +/* Routine vm_write */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_write +( + vm_map_t target_task, + vm_address_t address, + vm_offset_t data, + mach_msg_type_number_t dataCnt +); + +/* Routine vm_copy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_copy +( + vm_map_t target_task, + vm_address_t source_address, + vm_size_t size, + vm_address_t dest_address +); + +/* Routine vm_read_overwrite */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_read_overwrite +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_address_t data, + vm_size_t *outsize +); + +/* Routine vm_msync */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_msync +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_sync_t sync_flags +); + +/* Routine vm_behavior_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_behavior_set +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_behavior_t new_behavior +); + +/* Routine vm_map */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_map +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t size, + vm_address_t mask, + int flags, + mem_entry_name_port_t object, + vm_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance +); + +/* Routine vm_machine_attribute */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_machine_attribute +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_machine_attribute_t attribute, + vm_machine_attribute_val_t *value +); + +/* Routine vm_remap */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_remap +( + vm_map_t target_task, + vm_address_t *target_address, + vm_size_t size, + vm_address_t mask, + boolean_t anywhere, + vm_map_t src_task, + vm_address_t src_address, + boolean_t copy, + vm_prot_t *cur_protection, + vm_prot_t *max_protection, + vm_inherit_t inheritance +); + +/* Routine task_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_wire +( + vm_map_t target_task, + boolean_t must_wire +); + +/* Routine mach_make_memory_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_make_memory_entry +( + vm_map_t target_task, + vm_size_t *size, + vm_offset_t offset, + vm_prot_t permission, + mem_entry_name_port_t *object_handle, + mem_entry_name_port_t parent_entry +); + +/* Routine vm_map_page_query */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_map_page_query +( + vm_map_t target_map, + vm_offset_t offset, + integer_t *disposition, + integer_t *ref_count +); + +/* Routine mach_vm_region_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region_info +( + vm_map_t task, + vm_address_t address, + vm_info_region_t *region, + vm_info_object_array_t *objects, + mach_msg_type_number_t *objectsCnt +); + +/* Routine vm_mapped_pages_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_mapped_pages_info +( + vm_map_t task, + page_address_array_t *pages, + mach_msg_type_number_t *pagesCnt +); + +/* Routine vm_region_recurse */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region_recurse +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + natural_t *nesting_depth, + vm_region_recurse_info_t info, + mach_msg_type_number_t *infoCnt +); + +/* Routine vm_region_recurse_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region_recurse_64 +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + natural_t *nesting_depth, + vm_region_recurse_info_t info, + mach_msg_type_number_t *infoCnt +); + +/* Routine mach_vm_region_info_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region_info_64 +( + vm_map_t task, + vm_address_t address, + vm_info_region_64_t *region, + vm_info_object_array_t *objects, + mach_msg_type_number_t *objectsCnt +); + +/* Routine vm_region_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region_64 +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + vm_region_flavor_t flavor, + vm_region_info_t info, + mach_msg_type_number_t *infoCnt, + mach_port_t *object_name +); + +/* Routine mach_make_memory_entry_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_make_memory_entry_64 +( + vm_map_t target_task, + memory_object_size_t *size, + memory_object_offset_t offset, + vm_prot_t permission, + mach_port_t *object_handle, + mem_entry_name_port_t parent_entry +); + +/* Routine vm_map_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_map_64 +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t size, + vm_address_t mask, + int flags, + mem_entry_name_port_t object, + memory_object_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance +); + +/* Routine vm_purgable_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_purgable_control +( + vm_map_t target_task, + vm_address_t address, + vm_purgable_t control, + int *state +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__vm_map_subsystem__defined +#define __Request__vm_map_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_region_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + int flags; + } __Request__vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + } __Request__vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + boolean_t set_maximum; + vm_prot_t new_protection; + } __Request__vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_inherit_t new_inheritance; + } __Request__vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + } __Request__vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_read_entry_t data_list; + natural_t count; + } __Request__vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + mach_msg_type_number_t dataCnt; + } __Request__vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t source_address; + vm_size_t size; + vm_address_t dest_address; + } __Request__vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_address_t data; + } __Request__vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_sync_t sync_flags; + } __Request__vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_behavior_t new_behavior; + } __Request__vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_address_t mask; + int flags; + vm_offset_t offset; + boolean_t copy; + vm_prot_t cur_protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + } __Request__vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_machine_attribute_t attribute; + vm_machine_attribute_val_t value; + } __Request__vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t src_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t target_address; + vm_size_t size; + vm_address_t mask; + boolean_t anywhere; + vm_address_t src_address; + boolean_t copy; + vm_inherit_t inheritance; + } __Request__vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t must_wire; + } __Request__task_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_entry; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_size_t size; + vm_offset_t offset; + vm_prot_t permission; + } __Request__mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_offset_t offset; + } __Request__vm_map_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + } __Request__mach_vm_region_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__vm_mapped_pages_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_recurse_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + } __Request__mach_vm_region_info_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_region_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_entry; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + memory_object_offset_t offset; + vm_prot_t permission; + } __Request__mach_make_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_address_t mask; + int flags; + memory_object_offset_t offset; + boolean_t copy; + vm_prot_t cur_protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + } __Request__vm_map_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_purgable_t control; + int state; + } __Request__vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__vm_map_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__vm_map_subsystem__defined +#define __RequestUnion__vm_map_subsystem__defined +union __RequestUnion__vm_map_subsystem { + __Request__vm_region_t Request_vm_region; + __Request__vm_allocate_t Request_vm_allocate; + __Request__vm_deallocate_t Request_vm_deallocate; + __Request__vm_protect_t Request_vm_protect; + __Request__vm_inherit_t Request_vm_inherit; + __Request__vm_read_t Request_vm_read; + __Request__vm_read_list_t Request_vm_read_list; + __Request__vm_write_t Request_vm_write; + __Request__vm_copy_t Request_vm_copy; + __Request__vm_read_overwrite_t Request_vm_read_overwrite; + __Request__vm_msync_t Request_vm_msync; + __Request__vm_behavior_set_t Request_vm_behavior_set; + __Request__vm_map_t Request_vm_map; + __Request__vm_machine_attribute_t Request_vm_machine_attribute; + __Request__vm_remap_t Request_vm_remap; + __Request__task_wire_t Request_task_wire; + __Request__mach_make_memory_entry_t Request_mach_make_memory_entry; + __Request__vm_map_page_query_t Request_vm_map_page_query; + __Request__mach_vm_region_info_t Request_mach_vm_region_info; + __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info; + __Request__vm_region_recurse_t Request_vm_region_recurse; + __Request__vm_region_recurse_64_t Request_vm_region_recurse_64; + __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64; + __Request__vm_region_64_t Request_vm_region_64; + __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64; + __Request__vm_map_64_t Request_vm_map_64; + __Request__vm_purgable_control_t Request_vm_purgable_control; +}; +#endif /* !__RequestUnion__vm_map_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__vm_map_subsystem__defined +#define __Reply__vm_map_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_name; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + mach_msg_type_number_t infoCnt; + int info[10]; + } __Reply__vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t dataCnt; + } __Reply__vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_read_entry_t data_list; + } __Reply__vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_size_t outsize; + } __Reply__vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_machine_attribute_val_t value; + } __Reply__vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t target_address; + vm_prot_t cur_protection; + vm_prot_t max_protection; + } __Reply__vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_size_t size; + } __Reply__mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + integer_t disposition; + integer_t ref_count; + } __Reply__vm_map_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t objects; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_info_region_t region; + mach_msg_type_number_t objectsCnt; + } __Reply__mach_vm_region_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t pages; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t pagesCnt; + } __Reply__vm_mapped_pages_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + vm_size_t size; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + int info[19]; + } __Reply__vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + vm_size_t size; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + int info[19]; + } __Reply__vm_region_recurse_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t objects; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_info_region_64_t region; + mach_msg_type_number_t objectsCnt; + } __Reply__mach_vm_region_info_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_name; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + mach_msg_type_number_t infoCnt; + int info[10]; + } __Reply__vm_region_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + } __Reply__mach_make_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_map_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int state; + } __Reply__vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__vm_map_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__vm_map_subsystem__defined +#define __ReplyUnion__vm_map_subsystem__defined +union __ReplyUnion__vm_map_subsystem { + __Reply__vm_region_t Reply_vm_region; + __Reply__vm_allocate_t Reply_vm_allocate; + __Reply__vm_deallocate_t Reply_vm_deallocate; + __Reply__vm_protect_t Reply_vm_protect; + __Reply__vm_inherit_t Reply_vm_inherit; + __Reply__vm_read_t Reply_vm_read; + __Reply__vm_read_list_t Reply_vm_read_list; + __Reply__vm_write_t Reply_vm_write; + __Reply__vm_copy_t Reply_vm_copy; + __Reply__vm_read_overwrite_t Reply_vm_read_overwrite; + __Reply__vm_msync_t Reply_vm_msync; + __Reply__vm_behavior_set_t Reply_vm_behavior_set; + __Reply__vm_map_t Reply_vm_map; + __Reply__vm_machine_attribute_t Reply_vm_machine_attribute; + __Reply__vm_remap_t Reply_vm_remap; + __Reply__task_wire_t Reply_task_wire; + __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry; + __Reply__vm_map_page_query_t Reply_vm_map_page_query; + __Reply__mach_vm_region_info_t Reply_mach_vm_region_info; + __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info; + __Reply__vm_region_recurse_t Reply_vm_region_recurse; + __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64; + __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64; + __Reply__vm_region_64_t Reply_vm_region_64; + __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64; + __Reply__vm_map_64_t Reply_vm_map_64; + __Reply__vm_purgable_control_t Reply_vm_purgable_control; +}; +#endif /* !__RequestUnion__vm_map_subsystem__defined */ + +#ifndef subsystem_to_name_map_vm_map +#define subsystem_to_name_map_vm_map \ + { "vm_region", 3800 },\ + { "vm_allocate", 3801 },\ + { "vm_deallocate", 3802 },\ + { "vm_protect", 3803 },\ + { "vm_inherit", 3804 },\ + { "vm_read", 3805 },\ + { "vm_read_list", 3806 },\ + { "vm_write", 3807 },\ + { "vm_copy", 3808 },\ + { "vm_read_overwrite", 3809 },\ + { "vm_msync", 3810 },\ + { "vm_behavior_set", 3811 },\ + { "vm_map", 3812 },\ + { "vm_machine_attribute", 3813 },\ + { "vm_remap", 3814 },\ + { "task_wire", 3815 },\ + { "mach_make_memory_entry", 3816 },\ + { "vm_map_page_query", 3817 },\ + { "mach_vm_region_info", 3818 },\ + { "vm_mapped_pages_info", 3819 },\ + { "vm_region_recurse", 3821 },\ + { "vm_region_recurse_64", 3822 },\ + { "mach_vm_region_info_64", 3823 },\ + { "vm_region_64", 3824 },\ + { "mach_make_memory_entry_64", 3825 },\ + { "vm_map_64", 3826 },\ + { "vm_purgable_control", 3830 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _vm_map_user_ */ diff --git a/i386/include/mach/.svn/text-base/vm_param.h.svn-base b/i386/include/mach/.svn/text-base/vm_param.h.svn-base new file mode 100644 index 0000000..9a87873 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_param.h.svn-base @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_param.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine independent virtual memory parameters. + * + */ + +#ifndef _MACH_VM_PARAM_H_ +#define _MACH_VM_PARAM_H_ + +#include <mach/machine/vm_param.h> + + +#endif /* _MACH_VM_PARAM_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_prot.h.svn-base b/i386/include/mach/.svn/text-base/vm_prot.h.svn-base new file mode 100644 index 0000000..6fe17d4 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_prot.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_prot.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * + * Virtual memory protection definitions. + * + */ + +#ifndef _MACH_VM_PROT_H_ +#define _MACH_VM_PROT_H_ + +/* + * Types defined: + * + * vm_prot_t VM protection values. + */ + +typedef int vm_prot_t; + +/* + * Protection values, defined as bits within the vm_prot_t type + */ + +#define VM_PROT_NONE ((vm_prot_t) 0x00) + +#define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */ +#define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */ +#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */ + +/* + * The default protection for newly-created virtual memory + */ + +#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE) + +/* + * The maximum privileges possible, for parameter checking. + */ + +#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) + +/* + * An invalid protection value. + * Used only by memory_object_lock_request to indicate no change + * to page locks. Using -1 here is a bad idea because it + * looks like VM_PROT_ALL and then some. + */ + +#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08) + +/* + * When a caller finds that he cannot obtain write permission on a + * mapped entry, the following flag can be used. The entry will + * be made "needs copy" effectively copying the object (using COW), + * and write permission will be added to the maximum protections + * for the associated entry. + */ + +#define VM_PROT_COPY ((vm_prot_t) 0x10) + + +/* + * Another invalid protection value. + * Used only by memory_object_data_request upon an object + * which has specified a copy_call copy strategy. It is used + * when the kernel wants a page belonging to a copy of the + * object, and is only asking the object as a result of + * following a shadow chain. This solves the race between pages + * being pushed up by the memory manager and the kernel + * walking down the shadow chain. + */ + +#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10) + + +/* + * The caller wants this memory region treated as if it had a valid + * code signature. + */ + +#define VM_PROT_TRUSTED ((vm_prot_t) 0x20) + + +#endif /* _MACH_VM_PROT_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_purgable.h.svn-base b/i386/include/mach/.svn/text-base/vm_purgable.h.svn-base new file mode 100644 index 0000000..2d8ca30 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_purgable.h.svn-base @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Virtual memory map purgeable object definitions. + * Objects that will be needed in the future (forward cached objects) should be queued LIFO. + * Objects that have been used and are cached for reuse (backward cached) should be queued FIFO. + * Every user of purgeable memory is entitled to using the highest volatile group (7). + * Only if a client wants some of its objects to definitely be purged earlier, it can put those in + * another group. This could be used to make all FIFO objects (in the lower group) go away before + * any LIFO objects (in the higher group) go away. + * Objects that should not get any chance to stay around can be marked as "obsolete". They will + * be emptied before any other objects or pages are reclaimed. Obsolete objects are not emptied + * in any particular order. + * 'purgeable' is recognized as the correct spelling. For historical reasons, definitions + * in this file are spelled 'purgable'. + */ + +#ifndef _MACH_VM_PURGABLE_H_ +#define _MACH_VM_PURGABLE_H_ + +/* + * Types defined: + * + * vm_purgable_t purgeable object control codes. + */ + +typedef int vm_purgable_t; + +/* + * Enumeration of valid values for vm_purgable_t. + */ +#define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0) /* set state of purgeable object */ +#define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1) /* get state of purgeable object */ +#define VM_PURGABLE_PURGE_ALL ((vm_purgable_t) 2) /* purge all volatile objects now */ + +#define VM_PURGABLE_DEBUG_SHIFT 12 +#define VM_PURGABLE_DEBUG_MASK (0x3 << VM_PURGABLE_DEBUG_SHIFT) +#define VM_PURGABLE_DEBUG_EMPTY (0x1 << VM_PURGABLE_DEBUG_SHIFT) +#define VM_PURGABLE_DEBUG_FAULT (0x2 << VM_PURGABLE_DEBUG_SHIFT) + +/* + * Volatile memory ordering groups (group zero objects are purged before group 1, etc... + * It is implementation dependent as to whether these groups are global or per-address space. + * (for the moment, they are global). + */ +#define VM_VOLATILE_GROUP_SHIFT 8 +#define VM_VOLATILE_GROUP_MASK (7 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_DEFAULT VM_VOLATILE_GROUP_7 + +#define VM_VOLATILE_GROUP_0 (0 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_1 (1 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_2 (2 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_3 (3 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_4 (4 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_5 (5 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_6 (6 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_7 (7 << VM_VOLATILE_GROUP_SHIFT) + +/* + * Purgeable behavior + * Within the same group, FIFO objects will be emptied before objects that are added later. + * LIFO objects will be emptied after objects that are added later. + * - Input only, not returned on state queries. + */ +#define VM_PURGABLE_BEHAVIOR_SHIFT 6 +#define VM_PURGABLE_BEHAVIOR_MASK (1 << VM_PURGABLE_BEHAVIOR_SHIFT) +#define VM_PURGABLE_BEHAVIOR_FIFO (0 << VM_PURGABLE_BEHAVIOR_SHIFT) +#define VM_PURGABLE_BEHAVIOR_LIFO (1 << VM_PURGABLE_BEHAVIOR_SHIFT) + +/* + * Obsolete object. + * Disregard volatile group, and put object into obsolete queue instead, so it is the next object + * to be purged. + * - Input only, not returned on state queries. + */ +#define VM_PURGABLE_ORDERING_SHIFT 5 +#define VM_PURGABLE_ORDERING_MASK (1 << VM_PURGABLE_ORDERING_SHIFT) +#define VM_PURGABLE_ORDERING_OBSOLETE (1 << VM_PURGABLE_ORDERING_SHIFT) +#define VM_PURGABLE_ORDERING_NORMAL (0 << VM_PURGABLE_ORDERING_SHIFT) + + +/* + * Obsolete parameter - do not use + */ +#define VM_VOLATILE_ORDER_SHIFT 4 +#define VM_VOLATILE_ORDER_MASK (1 << VM_VOLATILE_ORDER_SHIFT) +#define VM_VOLATILE_MAKE_FIRST_IN_GROUP (1 << VM_VOLATILE_ORDER_SHIFT) +#define VM_VOLATILE_MAKE_LAST_IN_GROUP (0 << VM_VOLATILE_ORDER_SHIFT) + +/* + * Valid states of a purgeable object. + */ +#define VM_PURGABLE_STATE_MIN 0 /* minimum purgeable object state value */ +#define VM_PURGABLE_STATE_MAX 3 /* maximum purgeable object state value */ +#define VM_PURGABLE_STATE_MASK 3 /* mask to separate state from group */ + +#define VM_PURGABLE_NONVOLATILE 0 /* purgeable object is non-volatile */ +#define VM_PURGABLE_VOLATILE 1 /* purgeable object is volatile */ +#define VM_PURGABLE_EMPTY 2 /* purgeable object is volatile and empty */ +#define VM_PURGABLE_DENY 3 /* (mark) object not purgeable */ + +#define VM_PURGABLE_ALL_MASKS (VM_PURGABLE_STATE_MASK | \ + VM_VOLATILE_ORDER_MASK | \ + VM_PURGABLE_ORDERING_MASK | \ + VM_PURGABLE_BEHAVIOR_MASK | \ + VM_VOLATILE_GROUP_MASK | \ + VM_PURGABLE_DEBUG_MASK) +#endif /* _MACH_VM_PURGABLE_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_region.h.svn-base b/i386/include/mach/.svn/text-base/vm_region.h.svn-base new file mode 100644 index 0000000..ceb42b7 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_region.h.svn-base @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/vm_region.h + * + * Define the attributes of a task's memory region + * + */ + +#ifndef _MACH_VM_REGION_H_ +#define _MACH_VM_REGION_H_ + +#include <mach/boolean.h> +#include <mach/vm_prot.h> +#include <mach/vm_inherit.h> +#include <mach/vm_behavior.h> +#include <mach/vm_types.h> +#include <mach/message.h> +#include <mach/machine/vm_param.h> +#include <mach/machine/vm_types.h> +#include <mach/memory_object_types.h> + +#include <sys/cdefs.h> + +#pragma pack(4) + +// LP64todo: all the current tools are 32bit, obviously never worked for 64b +// so probably should be a real 32b ID vs. ptr. +// Current users just check for equality +typedef uint32_t vm32_object_id_t; + +/* + * Types defined: + * + * vm_region_info_t memory region attributes + */ + +#define VM_REGION_INFO_MAX (1024) +typedef int *vm_region_info_t; +typedef int *vm_region_info_64_t; +typedef int *vm_region_recurse_info_t; +typedef int *vm_region_recurse_info_64_t; +typedef int vm_region_flavor_t; +typedef int vm_region_info_data_t[VM_REGION_INFO_MAX]; + +#define VM_REGION_BASIC_INFO_64 9 +struct vm_region_basic_info_64 { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + boolean_t shared; + boolean_t reserved; + memory_object_offset_t offset; + vm_behavior_t behavior; + unsigned short user_wired_count; +}; +typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t; +typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t; + +#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) \ + (sizeof(vm_region_basic_info_data_64_t)/sizeof(int))) + +/* + * Passing VM_REGION_BASIC_INFO to vm_region_64 + * automatically converts it to a VM_REGION_BASIC_INFO_64. + * Please use that explicitly instead. + */ +#define VM_REGION_BASIC_INFO 10 + +/* + * This is the legacy basic info structure. It is + * deprecated because it passes only a 32-bit memory object + * offset back - too small for many larger objects (e.g. files). + */ +struct vm_region_basic_info { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + boolean_t shared; + boolean_t reserved; + uint32_t offset; /* too small for a real offset */ + vm_behavior_t behavior; + unsigned short user_wired_count; +}; + +typedef struct vm_region_basic_info *vm_region_basic_info_t; +typedef struct vm_region_basic_info vm_region_basic_info_data_t; + +#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_basic_info_data_t)/sizeof(int))) + +#define VM_REGION_EXTENDED_INFO 11 + +#define SM_COW 1 +#define SM_PRIVATE 2 +#define SM_EMPTY 3 +#define SM_SHARED 4 +#define SM_TRUESHARED 5 +#define SM_PRIVATE_ALIASED 6 +#define SM_SHARED_ALIASED 7 + +/* + * For submap info, the SM flags above are overlayed when a submap + * is encountered. The field denotes whether or not machine level mapping + * information is being shared. PTE's etc. When such sharing is taking + * place the value returned is SM_TRUESHARED otherwise SM_PRIVATE is passed + * back. + */ + +struct vm_region_extended_info { + vm_prot_t protection; + unsigned int user_tag; + unsigned int pages_resident; + unsigned int pages_shared_now_private; + unsigned int pages_swapped_out; + unsigned int pages_dirtied; + unsigned int ref_count; + unsigned short shadow_depth; + unsigned char external_pager; + unsigned char share_mode; +}; + +typedef struct vm_region_extended_info *vm_region_extended_info_t; +typedef struct vm_region_extended_info vm_region_extended_info_data_t; + +#define VM_REGION_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_extended_info_data_t)/sizeof(int))) + + +#define VM_REGION_TOP_INFO 12 + +struct vm_region_top_info { + unsigned int obj_id; + unsigned int ref_count; + unsigned int private_pages_resident; + unsigned int shared_pages_resident; + unsigned char share_mode; +}; + +typedef struct vm_region_top_info *vm_region_top_info_t; +typedef struct vm_region_top_info vm_region_top_info_data_t; + +#define VM_REGION_TOP_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_top_info_data_t)/sizeof(int))) + + + +/* + * vm_region_submap_info will return information on a submap or object. + * The user supplies a nesting level on the call. When a walk of the + * user's map is done and a submap is encountered, the nesting count is + * checked. If the nesting count is greater than 1 the submap is entered and + * the offset relative to the address in the base map is examined. If the + * nesting count is zero, the information on the submap is returned. + * The caller may thus learn about a submap and its contents by judicious + * choice of the base map address and nesting count. The nesting count + * allows penetration of recursively mapped submaps. If a submap is + * encountered as a mapped entry of another submap, the caller may bump + * the nesting count and call vm_region_recurse again on the target address + * range. The "is_submap" field tells the caller whether or not a submap + * has been encountered. + * + * Object only fields are filled in through a walking of the object shadow + * chain (where one is present), and a walking of the resident page queue. + * + */ + +struct vm_region_submap_info { + vm_prot_t protection; /* present access protection */ + vm_prot_t max_protection; /* max avail through vm_prot */ + vm_inherit_t inheritance;/* behavior of map/obj on fork */ + uint32_t offset; /* offset into object/map */ + unsigned int user_tag; /* user tag on map entry */ + unsigned int pages_resident; /* only valid for objects */ + unsigned int pages_shared_now_private; /* only for objects */ + unsigned int pages_swapped_out; /* only for objects */ + unsigned int pages_dirtied; /* only for objects */ + unsigned int ref_count; /* obj/map mappers, etc */ + unsigned short shadow_depth; /* only for obj */ + unsigned char external_pager; /* only for obj */ + unsigned char share_mode; /* see enumeration */ + boolean_t is_submap; /* submap vs obj */ + vm_behavior_t behavior; /* access behavior hint */ + vm32_object_id_t object_id; /* obj/map name, not a handle */ + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_info *vm_region_submap_info_t; +typedef struct vm_region_submap_info vm_region_submap_info_data_t; + +#define VM_REGION_SUBMAP_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_submap_info_data_t)/sizeof(int))) + +struct vm_region_submap_info_64 { + vm_prot_t protection; /* present access protection */ + vm_prot_t max_protection; /* max avail through vm_prot */ + vm_inherit_t inheritance;/* behavior of map/obj on fork */ + memory_object_offset_t offset; /* offset into object/map */ + unsigned int user_tag; /* user tag on map entry */ + unsigned int pages_resident; /* only valid for objects */ + unsigned int pages_shared_now_private; /* only for objects */ + unsigned int pages_swapped_out; /* only for objects */ + unsigned int pages_dirtied; /* only for objects */ + unsigned int ref_count; /* obj/map mappers, etc */ + unsigned short shadow_depth; /* only for obj */ + unsigned char external_pager; /* only for obj */ + unsigned char share_mode; /* see enumeration */ + boolean_t is_submap; /* submap vs obj */ + vm_behavior_t behavior; /* access behavior hint */ + vm32_object_id_t object_id; /* obj/map name, not a handle */ + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t; +typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t; + +#define VM_REGION_SUBMAP_INFO_COUNT_64 ((mach_msg_type_number_t) \ + (sizeof(vm_region_submap_info_data_64_t)/sizeof(int))) + +struct vm_region_submap_short_info_64 { + vm_prot_t protection; /* present access protection */ + vm_prot_t max_protection; /* max avail through vm_prot */ + vm_inherit_t inheritance;/* behavior of map/obj on fork */ + memory_object_offset_t offset; /* offset into object/map */ + unsigned int user_tag; /* user tag on map entry */ + unsigned int ref_count; /* obj/map mappers, etc */ + unsigned short shadow_depth; /* only for obj */ + unsigned char external_pager; /* only for obj */ + unsigned char share_mode; /* see enumeration */ + boolean_t is_submap; /* submap vs obj */ + vm_behavior_t behavior; /* access behavior hint */ + vm32_object_id_t object_id; /* obj/map name, not a handle */ + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t; +typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t; + +#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t) \ + (sizeof(vm_region_submap_short_info_data_64_t)/sizeof(int))) + + +struct mach_vm_read_entry { + mach_vm_address_t address; + mach_vm_size_t size; +}; + +struct vm_read_entry { + vm_address_t address; + vm_size_t size; +}; + +#if VM32_SUPPORT +struct vm32_read_entry { + vm32_address_t address; + vm32_size_t size; +}; +#endif + + +#define VM_MAP_ENTRY_MAX (256) + +typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX]; +typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX]; +#if VM32_SUPPORT +typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX]; +#endif + +#pragma pack() + + +#define VM_PAGE_INFO_MAX +typedef int *vm_page_info_t; +typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX]; +typedef int vm_page_info_flavor_t; + +#define VM_PAGE_INFO_BASIC 1 +struct vm_page_info_basic { + int disposition; + int ref_count; + vm_object_id_t object_id; + memory_object_offset_t offset; + int depth; +}; +typedef struct vm_page_info_basic *vm_page_info_basic_t; +typedef struct vm_page_info_basic vm_page_info_basic_data_t; + +#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_page_info_basic_data_t)/sizeof(int))) + + +#endif /*_MACH_VM_REGION_H_*/ diff --git a/i386/include/mach/.svn/text-base/vm_statistics.h.svn-base b/i386/include/mach/.svn/text-base/vm_statistics.h.svn-base new file mode 100644 index 0000000..016a1c2 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_statistics.h.svn-base @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_statistics.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young, David Golub + * + * Virtual memory statistics structure. + * + */ + +#ifndef _MACH_VM_STATISTICS_H_ +#define _MACH_VM_STATISTICS_H_ + +#include <mach/machine/vm_types.h> + + +/* + * vm_statistics + * + * History: + * rev0 - original structure. + * rev1 - added purgable info (purgable_count and purges). + * rev2 - added speculative_count. + * + * Note: you cannot add any new fields to this structure. Add them below in + * vm_statistics64. + */ + +struct vm_statistics { + natural_t free_count; /* # of pages free */ + natural_t active_count; /* # of pages active */ + natural_t inactive_count; /* # of pages inactive */ + natural_t wire_count; /* # of pages wired down */ + natural_t zero_fill_count; /* # of zero fill pages */ + natural_t reactivations; /* # of pages reactivated */ + natural_t pageins; /* # of pageins */ + natural_t pageouts; /* # of pageouts */ + natural_t faults; /* # of faults */ + natural_t cow_faults; /* # of copy-on-writes */ + natural_t lookups; /* object cache lookups */ + natural_t hits; /* object cache hits */ + + /* added for rev1 */ + natural_t purgeable_count; /* # of pages purgeable */ + natural_t purges; /* # of pages purged */ + + /* added for rev2 */ + /* + * NB: speculative pages are already accounted for in "free_count", + * so "speculative_count" is the number of "free" pages that are + * used to hold data that was read speculatively from disk but + * haven't actually been used by anyone so far. + */ + natural_t speculative_count; /* # of pages speculative */ +}; + +/* Used by all architectures */ +typedef struct vm_statistics *vm_statistics_t; +typedef struct vm_statistics vm_statistics_data_t; + +#if defined(__ppc__) /* On ppc, vm statistics are still 32-bit */ + +typedef struct vm_statistics *vm_statistics64_t; +typedef struct vm_statistics vm_statistics64_data_t; + +#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) value + +#else /* !(defined(__ppc__)) */ + +/* + * vm_statistics64 + * + * History: + * rev0 - original structure. + * rev1 - added purgable info (purgable_count and purges). + * rev2 - added speculative_count. + * ---- + * rev3 - changed name to vm_statistics64. + * changed some fields in structure to 64-bit on + * arm, i386 and x86_64 architectures. + * + */ + +struct vm_statistics64 { + natural_t free_count; /* # of pages free */ + natural_t active_count; /* # of pages active */ + natural_t inactive_count; /* # of pages inactive */ + natural_t wire_count; /* # of pages wired down */ + uint64_t zero_fill_count; /* # of zero fill pages */ + uint64_t reactivations; /* # of pages reactivated */ + uint64_t pageins; /* # of pageins */ + uint64_t pageouts; /* # of pageouts */ + uint64_t faults; /* # of faults */ + uint64_t cow_faults; /* # of copy-on-writes */ + uint64_t lookups; /* object cache lookups */ + uint64_t hits; /* object cache hits */ + + /* added for rev1 */ + uint64_t purges; /* # of pages purged */ + natural_t purgeable_count; /* # of pages purgeable */ + + /* added for rev2 */ + /* + * NB: speculative pages are already accounted for in "free_count", + * so "speculative_count" is the number of "free" pages that are + * used to hold data that was read speculatively from disk but + * haven't actually been used by anyone so far. + */ + natural_t speculative_count; /* # of pages speculative */ + +} +#ifdef __arm__ +__attribute__((aligned(8))) +#endif +; + +typedef struct vm_statistics64 *vm_statistics64_t; +typedef struct vm_statistics64 vm_statistics64_data_t; + +/* + * VM_STATISTICS_TRUNCATE_TO_32_BIT + * + * This is used by host_statistics() to truncate and peg the 64-bit in-kernel values from + * vm_statistics64 to the 32-bit values of the older structure above (vm_statistics). + */ +#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value))) + +#endif /* !(defined(__ppc__)) */ + + +/* included for the vm_map_page_query call */ + +#define VM_PAGE_QUERY_PAGE_PRESENT 0x1 +#define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2 +#define VM_PAGE_QUERY_PAGE_REF 0x4 +#define VM_PAGE_QUERY_PAGE_DIRTY 0x8 +#define VM_PAGE_QUERY_PAGE_PAGED_OUT 0x10 +#define VM_PAGE_QUERY_PAGE_COPIED 0x20 +#define VM_PAGE_QUERY_PAGE_SPECULATIVE 0x40 +#define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80 +#define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100 +#define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200 + + +/* + * VM allocation flags: + * + * VM_FLAGS_FIXED + * (really the absence of VM_FLAGS_ANYWHERE) + * Allocate new VM region at the specified virtual address, if possible. + * + * VM_FLAGS_ANYWHERE + * Allocate new VM region anywhere it would fit in the address space. + * + * VM_FLAGS_PURGABLE + * Create a purgable VM object for that new VM region. + * + * VM_FLAGS_NO_PMAP_CHECK + * (for DEBUG kernel config only, ignored for other configs) + * Do not check that there is no stale pmap mapping for the new VM region. + * This is useful for kernel memory allocations at bootstrap when building + * the initial kernel address space while some memory is already in use. + * + * VM_FLAGS_OVERWRITE + * The new VM region can replace existing VM regions if necessary + * (to be used in combination with VM_FLAGS_FIXED). + * + * VM_FLAGS_NO_CACHE + * Pages brought in to this VM region are placed on the speculative + * queue instead of the active queue. In other words, they are not + * cached so that they will be stolen first if memory runs low. + */ +#define VM_FLAGS_FIXED 0x0000 +#define VM_FLAGS_ANYWHERE 0x0001 +#define VM_FLAGS_PURGABLE 0x0002 +#define VM_FLAGS_NO_CACHE 0x0010 + +/* + * VM_FLAGS_SUPERPAGE_MASK + * 3 bits that specify whether large pages should be used instead of + * base pages (!=0), as well as the requested page size. + */ +#define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */ +#define VM_FLAGS_SUPERPAGE_SHIFT 16 + +#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */ +#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE<<VM_FLAGS_SUPERPAGE_SHIFT) +#if defined(__x86_64__) || !defined(KERNEL) +#define SUPERPAGE_SIZE_2MB 1 +#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT) +#endif + +#define VM_FLAGS_ALIAS_MASK 0xFF000000 +#define VM_GET_FLAGS_ALIAS(flags, alias) \ + (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 +#define VM_SET_FLAGS_ALIAS(flags, alias) \ + (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ + (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) + +/* These are the flags that we accept from user-space */ +#define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ + VM_FLAGS_ANYWHERE | \ + VM_FLAGS_PURGABLE | \ + VM_FLAGS_NO_CACHE | \ + VM_FLAGS_SUPERPAGE_MASK | \ + VM_FLAGS_ALIAS_MASK) +#define VM_FLAGS_USER_MAP VM_FLAGS_USER_ALLOCATE + +#define VM_MEMORY_MALLOC 1 +#define VM_MEMORY_MALLOC_SMALL 2 +#define VM_MEMORY_MALLOC_LARGE 3 +#define VM_MEMORY_MALLOC_HUGE 4 +#define VM_MEMORY_SBRK 5// uninteresting -- no one should call +#define VM_MEMORY_REALLOC 6 +#define VM_MEMORY_MALLOC_TINY 7 +#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8 +#define VM_MEMORY_MALLOC_LARGE_REUSED 9 + +#define VM_MEMORY_ANALYSIS_TOOL 10 + +#define VM_MEMORY_MACH_MSG 20 +#define VM_MEMORY_IOKIT 21 +#define VM_MEMORY_STACK 30 +#define VM_MEMORY_GUARD 31 +#define VM_MEMORY_SHARED_PMAP 32 +/* memory containing a dylib */ +#define VM_MEMORY_DYLIB 33 +#define VM_MEMORY_OBJC_DISPATCHERS 34 + +// Placeholders for now -- as we analyze the libraries and find how they +// use memory, we can make these labels more specific. +#define VM_MEMORY_APPKIT 40 +#define VM_MEMORY_FOUNDATION 41 +#define VM_MEMORY_COREGRAPHICS 42 +#define VM_MEMORY_CARBON 43 +#define VM_MEMORY_JAVA 44 +#define VM_MEMORY_ATS 50 +#define VM_MEMORY_LAYERKIT 51 +#define VM_MEMORY_CGIMAGE 52 +#define VM_MEMORY_TCMALLOC 53 + +/* private raster data (i.e. layers, some images, QGL allocator) */ +#define VM_MEMORY_COREGRAPHICS_DATA 54 + +/* shared image and font caches */ +#define VM_MEMORY_COREGRAPHICS_SHARED 55 + +/* Memory used for virtual framebuffers, shadowing buffers, etc... */ +#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56 + +/* Window backing stores, custom shadow data, and compressed backing stores */ +#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57 + +/* catch-all for other uses, such as the read-only shared data page */ +#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS + +/* memory allocated by the dynamic loader for itself */ +#define VM_MEMORY_DYLD 60 +/* malloc'd memory created by dyld */ +#define VM_MEMORY_DYLD_MALLOC 61 + +/* Used for sqlite page cache */ +#define VM_MEMORY_SQLITE 62 + +/* JavaScriptCore heaps */ +#define VM_MEMORY_JAVASCRIPT_CORE 63 +/* memory allocated for the JIT */ +#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64 +#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65 + +/* memory allocated for GLSL */ +#define VM_MEMORY_GLSL 66 + +/* Reserve 240-255 for application */ +#define VM_MEMORY_APPLICATION_SPECIFIC_1 240 +#define VM_MEMORY_APPLICATION_SPECIFIC_16 255 + +#define VM_MAKE_TAG(tag) ((tag) << 24) + +#endif /* _MACH_VM_STATISTICS_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_sync.h.svn-base b/i386/include/mach/.svn/text-base/vm_sync.h.svn-base new file mode 100644 index 0000000..dfb948b --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_sync.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * File: mach/vm_sync.h + * + * Virtual memory synchronisation definitions. + * + */ + +#ifndef _MACH_VM_SYNC_H_ +#define _MACH_VM_SYNC_H_ + +typedef unsigned vm_sync_t; + +/* + * Synchronization flags, defined as bits within the vm_sync_t type + */ + +#define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01) +#define VM_SYNC_SYNCHRONOUS ((vm_sync_t) 0x02) +#define VM_SYNC_INVALIDATE ((vm_sync_t) 0x04) +#define VM_SYNC_KILLPAGES ((vm_sync_t) 0x08) +#define VM_SYNC_DEACTIVATE ((vm_sync_t) 0x10) +#define VM_SYNC_CONTIGUOUS ((vm_sync_t) 0x20) +#define VM_SYNC_REUSABLEPAGES ((vm_sync_t) 0x40) + +#endif /* _MACH_VM_SYNC_H_ */ diff --git a/i386/include/mach/.svn/text-base/vm_task.h.svn-base b/i386/include/mach/.svn/text-base/vm_task.h.svn-base new file mode 100644 index 0000000..d2401ac --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_task.h.svn-base @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +** This file contains compatibilty wrapper header for things that are +** generated from mach/vm_map.defs into mach/vm_map.h. +** +** This file will go away eventually - please switch. +*/ +#include <mach/vm_map.h> diff --git a/i386/include/mach/.svn/text-base/vm_types.h.svn-base b/i386/include/mach/.svn/text-base/vm_types.h.svn-base new file mode 100644 index 0000000..37f4bd5 --- /dev/null +++ b/i386/include/mach/.svn/text-base/vm_types.h.svn-base @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + * + */ +#ifndef _MACH_VM_TYPES_H_ +#define _MACH_VM_TYPES_H_ + +#include <mach/port.h> +#include <mach/machine/vm_types.h> + +#include <stdint.h> + +typedef vm_offset_t pointer_t; +typedef vm_offset_t vm_address_t; + +/* + * We use addr64_t for 64-bit addresses that are used on both + * 32 and 64-bit machines. On PPC, they are passed and returned as + * two adjacent 32-bit GPRs. We use addr64_t in places where + * common code must be useable both on 32 and 64-bit machines. + */ +typedef uint64_t addr64_t; /* Basic effective address */ + +/* + * We use reg64_t for addresses that are 32 bits on a 32-bit + * machine, and 64 bits on a 64-bit machine, but are always + * passed and returned in a single GPR on PPC. This type + * cannot be used in generic 32-bit c, since on a 64-bit + * machine the upper half of the register will be ignored + * by the c compiler in 32-bit mode. In c, we can only use the + * type in prototypes of functions that are written in and called + * from assembly language. This type is basically a comment. + */ +typedef uint32_t reg64_t; + +/* + * To minimize the use of 64-bit fields, we keep some physical + * addresses (that are page aligned) as 32-bit page numbers. + * This limits the physical address space to 16TB of RAM. + */ +typedef uint32_t ppnum_t; /* Physical page number */ +#define PPNUM_MAX UINT32_MAX + + + +typedef mach_port_t vm_map_t; + + +#define VM_MAP_NULL ((vm_map_t) 0) + +/* + * Evolving definitions, likely to change. + */ + +typedef uint64_t vm_object_offset_t; +typedef uint64_t vm_object_size_t; + + +typedef mach_port_t upl_t; +typedef mach_port_t vm_named_entry_t; + + +#define UPL_NULL ((upl_t) 0) +#define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0) + +#endif /* _MACH_VM_TYPES_H_ */ diff --git a/i386/include/mach/audit_triggers.defs b/i386/include/mach/audit_triggers.defs new file mode 100644 index 0000000..1d6e279 --- /dev/null +++ b/i386/include/mach/audit_triggers.defs @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2004-2008, Apple Inc. All rights reserved. + * + * @APPLE_BSD_LICENSE_HEADER_START@ + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @APPLE_BSD_LICENSE_HEADER_END@ +*/ + +/* + * Interface definition for the audit logging facility. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ + audit_triggers 123; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +simpleroutine audit_triggers( + audit_port : mach_port_t; + in flags : int); + diff --git a/i386/include/mach/boolean.h b/i386/include/mach/boolean.h new file mode 100644 index 0000000..641c396 --- /dev/null +++ b/i386/include/mach/boolean.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/boolean.h + * + * Boolean data type. + * + */ + +#ifndef _MACH_BOOLEAN_H_ +#define _MACH_BOOLEAN_H_ + +/* + * Pick up "boolean_t" type definition + */ + +#ifndef ASSEMBLER +#include <mach/machine/boolean.h> +#endif /* ASSEMBLER */ + +/* + * Define TRUE and FALSE if not defined. + */ + +#ifndef TRUE +#define TRUE 1 +#endif /* TRUE */ + +#ifndef FALSE +#define FALSE 0 +#endif /* FALSE */ + +#endif /* _MACH_BOOLEAN_H_ */ diff --git a/i386/include/mach/bootstrap.h b/i386/include/mach/bootstrap.h new file mode 100644 index 0000000..67667c3 --- /dev/null +++ b/i386/include/mach/bootstrap.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach bootstrap interfaces (obsolete: header included only for compatibility) + */ +#ifndef _MACH_BOOTSTRAP_H_ +#define _MACH_BOOTSTRAP_H_ + +#endif /* _MACH_BOOTSTRAP_H_ */ diff --git a/i386/include/mach/clock.defs b/i386/include/mach/clock.defs new file mode 100644 index 0000000..440042c --- /dev/null +++ b/i386/include/mach/clock.defs @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/clock.defs + * Purpose: Kernel clock subsystem definitions. This + * file defines the clock request interface. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + clock 1000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> + +/* + * References to clock objects are returned by: + * host_get_clock_service(host_t,...) + * host_get_clock_control(host_priv_t,...) - Priviledged subclass + */ + +/* + * Get the clock time. + * Available to all. + */ +routine clock_get_time( + clock_serv : clock_serv_t; + out cur_time : mach_timespec_t); + +/* + * Get clock attributes. + * Available to all. + */ +routine clock_get_attributes( + clock_serv : clock_serv_t; + in flavor : clock_flavor_t; + out clock_attr : clock_attr_t, CountInOut); + +/* + * Setup a clock alarm. + * Available to all. + */ +routine clock_alarm( + clock_serv : clock_serv_t; + alarm_type : alarm_type_t; + alarm_time : mach_timespec_t; + alarm_port : clock_reply_t = + MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/clock.h b/i386/include/mach/clock.h new file mode 100644 index 0000000..948b489 --- /dev/null +++ b/i386/include/mach/clock.h @@ -0,0 +1,221 @@ +#ifndef _clock_user_ +#define _clock_user_ + +/* Module clock */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef clock_MSG_COUNT +#define clock_MSG_COUNT 3 +#endif /* clock_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine clock_get_time */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_get_time +( + clock_serv_t clock_serv, + mach_timespec_t *cur_time +); + +/* Routine clock_get_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_get_attributes +( + clock_serv_t clock_serv, + clock_flavor_t flavor, + clock_attr_t clock_attr, + mach_msg_type_number_t *clock_attrCnt +); + +/* Routine clock_alarm */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_alarm +( + clock_serv_t clock_serv, + alarm_type_t alarm_type, + mach_timespec_t alarm_time, + clock_reply_t alarm_port +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__clock_subsystem__defined +#define __Request__clock_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__clock_get_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_flavor_t flavor; + mach_msg_type_number_t clock_attrCnt; + } __Request__clock_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t alarm_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + alarm_type_t alarm_type; + mach_timespec_t alarm_time; + } __Request__clock_alarm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__clock_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__clock_subsystem__defined +#define __RequestUnion__clock_subsystem__defined +union __RequestUnion__clock_subsystem { + __Request__clock_get_time_t Request_clock_get_time; + __Request__clock_get_attributes_t Request_clock_get_attributes; + __Request__clock_alarm_t Request_clock_alarm; +}; +#endif /* !__RequestUnion__clock_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__clock_subsystem__defined +#define __Reply__clock_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_timespec_t cur_time; + } __Reply__clock_get_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t clock_attrCnt; + int clock_attr[1]; + } __Reply__clock_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_alarm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__clock_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__clock_subsystem__defined +#define __ReplyUnion__clock_subsystem__defined +union __ReplyUnion__clock_subsystem { + __Reply__clock_get_time_t Reply_clock_get_time; + __Reply__clock_get_attributes_t Reply_clock_get_attributes; + __Reply__clock_alarm_t Reply_clock_alarm; +}; +#endif /* !__RequestUnion__clock_subsystem__defined */ + +#ifndef subsystem_to_name_map_clock +#define subsystem_to_name_map_clock \ + { "clock_get_time", 1000 },\ + { "clock_get_attributes", 1001 },\ + { "clock_alarm", 1002 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _clock_user_ */ diff --git a/i386/include/mach/clock_priv.defs b/i386/include/mach/clock_priv.defs new file mode 100644 index 0000000..b3854a4 --- /dev/null +++ b/i386/include/mach/clock_priv.defs @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/clock_priv.defs + * Purpose: Kernel clock subsystem definitions. This + * file defines the clock request interface. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + clock_priv 1200; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> + +/* + * References to clock_priv objects are returned by: + * host_get_clock_control(host_priv_t,...) - Priviledged subclass + */ + +/* + * Set the clock time. + * Privileged. + */ +routine clock_set_time( + clock_ctrl : clock_ctrl_t; + new_time : mach_timespec_t); + +/* + * Set clock attributes. + * Privileged. + */ +routine clock_set_attributes( + clock_ctrl : clock_ctrl_t; + in flavor : clock_flavor_t; + in clock_attr : clock_attr_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/clock_priv.h b/i386/include/mach/clock_priv.h new file mode 100644 index 0000000..8a38935 --- /dev/null +++ b/i386/include/mach/clock_priv.h @@ -0,0 +1,175 @@ +#ifndef _clock_priv_user_ +#define _clock_priv_user_ + +/* Module clock_priv */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef clock_priv_MSG_COUNT +#define clock_priv_MSG_COUNT 2 +#endif /* clock_priv_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine clock_set_time */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_set_time +( + clock_ctrl_t clock_ctrl, + mach_timespec_t new_time +); + +/* Routine clock_set_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_set_attributes +( + clock_ctrl_t clock_ctrl, + clock_flavor_t flavor, + clock_attr_t clock_attr, + mach_msg_type_number_t clock_attrCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__clock_priv_subsystem__defined +#define __Request__clock_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_timespec_t new_time; + } __Request__clock_set_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_flavor_t flavor; + mach_msg_type_number_t clock_attrCnt; + int clock_attr[1]; + } __Request__clock_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__clock_priv_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__clock_priv_subsystem__defined +#define __RequestUnion__clock_priv_subsystem__defined +union __RequestUnion__clock_priv_subsystem { + __Request__clock_set_time_t Request_clock_set_time; + __Request__clock_set_attributes_t Request_clock_set_attributes; +}; +#endif /* !__RequestUnion__clock_priv_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__clock_priv_subsystem__defined +#define __Reply__clock_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_set_time_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__clock_priv_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__clock_priv_subsystem__defined +#define __ReplyUnion__clock_priv_subsystem__defined +union __ReplyUnion__clock_priv_subsystem { + __Reply__clock_set_time_t Reply_clock_set_time; + __Reply__clock_set_attributes_t Reply_clock_set_attributes; +}; +#endif /* !__RequestUnion__clock_priv_subsystem__defined */ + +#ifndef subsystem_to_name_map_clock_priv +#define subsystem_to_name_map_clock_priv \ + { "clock_set_time", 1200 },\ + { "clock_set_attributes", 1201 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _clock_priv_user_ */ diff --git a/i386/include/mach/clock_reply.defs b/i386/include/mach/clock_reply.defs new file mode 100644 index 0000000..9646f90 --- /dev/null +++ b/i386/include/mach/clock_reply.defs @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: clock_reply.defs + * Purpose: Kernel clock subsystem definitions. This + * file defines the clock reply interface. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ + clock_reply 3125107; /* Matches up with old value */ + +#include <mach/std_types.defs> +#include <mach/clock_types.defs> + + +/* + * Reply routine for clock_alarm. + */ +simpleroutine clock_alarm_reply( + alarm_port : clock_reply_t; + alarm_code : kern_return_t; + alarm_type : alarm_type_t; + alarm_time : mach_timespec_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/clock_reply.h b/i386/include/mach/clock_reply.h new file mode 100644 index 0000000..d0cf150 --- /dev/null +++ b/i386/include/mach/clock_reply.h @@ -0,0 +1,136 @@ +#ifndef _clock_reply_user_ +#define _clock_reply_user_ + +/* Module clock_reply */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef clock_reply_MSG_COUNT +#define clock_reply_MSG_COUNT 1 +#endif /* clock_reply_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* SimpleRoutine clock_alarm_reply */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t clock_alarm_reply +( + clock_reply_t alarm_port, + mach_msg_type_name_t alarm_portPoly, + kern_return_t alarm_code, + alarm_type_t alarm_type, + mach_timespec_t alarm_time +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__clock_reply_subsystem__defined +#define __Request__clock_reply_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t alarm_code; + alarm_type_t alarm_type; + mach_timespec_t alarm_time; + } __Request__clock_alarm_reply_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__clock_reply_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__clock_reply_subsystem__defined +#define __RequestUnion__clock_reply_subsystem__defined +union __RequestUnion__clock_reply_subsystem { + __Request__clock_alarm_reply_t Request_clock_alarm_reply; +}; +#endif /* !__RequestUnion__clock_reply_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__clock_reply_subsystem__defined +#define __Reply__clock_reply_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__clock_alarm_reply_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__clock_reply_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__clock_reply_subsystem__defined +#define __ReplyUnion__clock_reply_subsystem__defined +union __ReplyUnion__clock_reply_subsystem { + __Reply__clock_alarm_reply_t Reply_clock_alarm_reply; +}; +#endif /* !__RequestUnion__clock_reply_subsystem__defined */ + +#ifndef subsystem_to_name_map_clock_reply +#define subsystem_to_name_map_clock_reply \ + { "clock_alarm_reply", 3125107 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _clock_reply_user_ */ diff --git a/i386/include/mach/clock_types.defs b/i386/include/mach/clock_types.defs new file mode 100644 index 0000000..4dbacfc --- /dev/null +++ b/i386/include/mach/clock_types.defs @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: clock_types.defs + * Purpose: + * Clock kernel interface type declarations + */ + +#ifndef _MACH_CLOCK_TYPES_DEFS_ +#define _MACH_CLOCK_TYPES_DEFS_ + +#include <mach/std_types.defs> + +type clock_serv_t = mach_port_t + cusertype: clock_serv_t +#if KERNEL_SERVER + intran: clock_serv_t convert_port_to_clock(mach_port_t) + outtran: mach_port_t convert_clock_to_port(clock_serv_t) +#endif /* KERNEL_SERVER */ + ; + +type clock_ctrl_t = mach_port_t + cusertype: clock_ctrl_t +#if KERNEL_SERVER + intran: clock_ctrl_t convert_port_to_clock_ctrl(mach_port_t) + outtran: mach_port_t convert_clock_ctrl_to_port(clock_ctrl_t) +#endif /* KERNEL_SERVER */ + ; + +type clock_reply_t = polymorphic|MACH_MSG_TYPE_MAKE_SEND_ONCE; + +type clock_flavor_t = int; +type clock_attr_t = array[*:1] of int; +type mach_timespec_t = struct[2] of int; +type time_t = int; +type sleep_type_t = int; +type alarm_type_t = int; +type clock_res_t = int; +type clock_id_t = int; + +import <mach/mach_types.h>; + +#endif /* _MACH_CLOCK_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/clock_types.h b/i386/include/mach/clock_types.h new file mode 100644 index 0000000..12035da --- /dev/null +++ b/i386/include/mach/clock_types.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: clock_types.h + * Purpose: Clock facility header definitions. These + * definitons are needed by both kernel and + * user-level software. + */ + +/* + * All interfaces defined here are obsolete. + */ + +#ifndef _MACH_CLOCK_TYPES_H_ +#define _MACH_CLOCK_TYPES_H_ + +#include <stdint.h> +#include <mach/time_value.h> + +/* + * Type definitions. + */ +typedef int alarm_type_t; /* alarm time type */ +typedef int sleep_type_t; /* sleep time type */ +typedef int clock_id_t; /* clock identification type */ +typedef int clock_flavor_t; /* clock flavor type */ +typedef int *clock_attr_t; /* clock attribute type */ +typedef int clock_res_t; /* clock resolution type */ + +/* + * Normal time specification used by the kernel clock facility. + */ +struct mach_timespec { + unsigned int tv_sec; /* seconds */ + clock_res_t tv_nsec; /* nanoseconds */ +}; +typedef struct mach_timespec mach_timespec_t; + +/* + * Reserved clock id values for default clocks. + */ +#define SYSTEM_CLOCK 0 +#define CALENDAR_CLOCK 1 + +#define REALTIME_CLOCK 0 + +/* + * Attribute names. + */ +#define CLOCK_GET_TIME_RES 1 /* get_time call resolution */ +/* 2 * was map_time call resolution */ +#define CLOCK_ALARM_CURRES 3 /* current alarm resolution */ +#define CLOCK_ALARM_MINRES 4 /* minimum alarm resolution */ +#define CLOCK_ALARM_MAXRES 5 /* maximum alarm resolution */ + +#define NSEC_PER_USEC 1000 /* nanoseconds per microsecond */ +#define USEC_PER_SEC 1000000 /* microseconds per second */ +#define NSEC_PER_SEC 1000000000 /* nanoseconds per second */ + +#define BAD_MACH_TIMESPEC(t) \ + ((t)->tv_nsec < 0 || (t)->tv_nsec >= NSEC_PER_SEC) + +/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */ +#define CMP_MACH_TIMESPEC(t1, t2) \ + ((t1)->tv_sec > (t2)->tv_sec ? +NSEC_PER_SEC : \ + ((t1)->tv_sec < (t2)->tv_sec ? -NSEC_PER_SEC : \ + (t1)->tv_nsec - (t2)->tv_nsec)) + +/* t1 += t2 */ +#define ADD_MACH_TIMESPEC(t1, t2) \ + do { \ + if (((t1)->tv_nsec += (t2)->tv_nsec) >= NSEC_PER_SEC) { \ + (t1)->tv_nsec -= NSEC_PER_SEC; \ + (t1)->tv_sec += 1; \ + } \ + (t1)->tv_sec += (t2)->tv_sec; \ + } while (0) + +/* t1 -= t2 */ +#define SUB_MACH_TIMESPEC(t1, t2) \ + do { \ + if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \ + (t1)->tv_nsec += NSEC_PER_SEC; \ + (t1)->tv_sec -= 1; \ + } \ + (t1)->tv_sec -= (t2)->tv_sec; \ + } while (0) + +/* + * Alarm parameter defines. + */ +#define ALRMTYPE 0xff /* type (8-bit field) */ +#define TIME_ABSOLUTE 0x00 /* absolute time */ +#define TIME_RELATIVE 0x01 /* relative time */ + +#define BAD_ALRMTYPE(t) (((t) &~ TIME_RELATIVE) != 0) + +#endif /* _MACH_CLOCK_TYPES_H_ */ diff --git a/i386/include/mach/error.h b/i386/include/mach/error.h new file mode 100644 index 0000000..a32eaee --- /dev/null +++ b/i386/include/mach/error.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/error.h + * Purpose: + * error module definitions + * + */ + +#ifndef _MACH_ERROR_H_ +#define _MACH_ERROR_H_ + +#include <mach/kern_return.h> + +/* + * error number layout as follows: + * + * hi lo + * | system(6) | subsystem(12) | code(14) | + */ + + +#define err_none (mach_error_t)0 +#define ERR_SUCCESS (mach_error_t)0 +#define ERR_ROUTINE_NIL (mach_error_fn_t)0 + + +#define err_system(x) (((x)&0x3f)<<26) +#define err_sub(x) (((x)&0xfff)<<14) + +#define err_get_system(err) (((err)>>26)&0x3f) +#define err_get_sub(err) (((err)>>14)&0xfff) +#define err_get_code(err) ((err)&0x3fff) + +#define system_emask (err_system(0x3f)) +#define sub_emask (err_sub(0xfff)) +#define code_emask (0x3fff) + + +/* major error systems */ +#define err_kern err_system(0x0) /* kernel */ +#define err_us err_system(0x1) /* user space library */ +#define err_server err_system(0x2) /* user space servers */ +#define err_ipc err_system(0x3) /* old ipc errors */ +#define err_mach_ipc err_system(0x4) /* mach-ipc errors */ +#define err_dipc err_system(0x7) /* distributed ipc */ +#define err_local err_system(0x3e) /* user defined errors */ +#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */ + +#define err_max_system 0x3f + + +/* unix errors get lumped into one subsystem */ +#define unix_err(errno) (err_kern|err_sub(3)|errno) + +typedef kern_return_t mach_error_t; +typedef mach_error_t (* mach_error_fn_t)( void ); + +#endif /* _MACH_ERROR_H_ */ diff --git a/i386/include/mach/exc.defs b/i386/include/mach/exc.defs new file mode 100644 index 0000000..de6aee7 --- /dev/null +++ b/i386/include/mach/exc.defs @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Abstract: + * MiG definitions file for Mach exception interface. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif + exc 2401; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +ServerPrefix catch_; + +type exception_data_t = array[*:2] of integer_t; +type exception_type_t = int; + +routine exception_raise( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : exception_data_t + ); + +routine exception_raise_state( +#if KERNEL_USER + exception_port : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : exception_data_t, const; + inout flavor : int; + old_state : thread_state_t, const; + out new_state : thread_state_t); + +routine exception_raise_state_identity( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : exception_data_t; + inout flavor : int; + old_state : thread_state_t; + out new_state : thread_state_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/exc.h b/i386/include/mach/exc.h new file mode 100644 index 0000000..3987a6e --- /dev/null +++ b/i386/include/mach/exc.h @@ -0,0 +1,257 @@ +#ifndef _exc_user_ +#define _exc_user_ + +/* Module exc */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef exc_MSG_COUNT +#define exc_MSG_COUNT 3 +#endif /* exc_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine exception_raise */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t exception_raise +( + mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt +); + +/* Routine exception_raise_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t exception_raise_state +( + mach_port_t exception_port, + exception_type_t exception, + const exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + const thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt +); + +/* Routine exception_raise_state_identity */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t exception_raise_state_identity +( + mach_port_t exception_port, + mach_port_t thread, + mach_port_t task, + exception_type_t exception, + exception_data_t code, + mach_msg_type_number_t codeCnt, + int *flavor, + thread_state_t old_state, + mach_msg_type_number_t old_stateCnt, + thread_state_t new_state, + mach_msg_type_number_t *new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__exc_subsystem__defined +#define __Request__exc_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + } __Request__exception_raise_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + int flavor; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Request__exception_raise_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_type_t exception; + mach_msg_type_number_t codeCnt; + integer_t code[2]; + int flavor; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Request__exception_raise_state_identity_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__exc_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__exc_subsystem__defined +#define __RequestUnion__exc_subsystem__defined +union __RequestUnion__exc_subsystem { + __Request__exception_raise_t Request_exception_raise; + __Request__exception_raise_state_t Request_exception_raise_state; + __Request__exception_raise_state_identity_t Request_exception_raise_state_identity; +}; +#endif /* !__RequestUnion__exc_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__exc_subsystem__defined +#define __Reply__exc_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__exception_raise_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Reply__exception_raise_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Reply__exception_raise_state_identity_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__exc_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__exc_subsystem__defined +#define __ReplyUnion__exc_subsystem__defined +union __ReplyUnion__exc_subsystem { + __Reply__exception_raise_t Reply_exception_raise; + __Reply__exception_raise_state_t Reply_exception_raise_state; + __Reply__exception_raise_state_identity_t Reply_exception_raise_state_identity; +}; +#endif /* !__RequestUnion__exc_subsystem__defined */ + +#ifndef subsystem_to_name_map_exc +#define subsystem_to_name_map_exc \ + { "exception_raise", 2401 },\ + { "exception_raise_state", 2402 },\ + { "exception_raise_state_identity", 2403 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _exc_user_ */ diff --git a/i386/include/mach/exception.h b/i386/include/mach/exception.h new file mode 100644 index 0000000..e7d5d23 --- /dev/null +++ b/i386/include/mach/exception.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +#ifndef _MACH_EXCEPTION_H_ +#define _MACH_EXCEPTION_H_ + +#include <mach/exception_types.h> + +#endif /* _MACH_EXCEPTION_H_ */ diff --git a/i386/include/mach/exception_types.h b/i386/include/mach/exception_types.h new file mode 100644 index 0000000..642cbe2 --- /dev/null +++ b/i386/include/mach/exception_types.h @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_EXCEPTION_TYPES_H_ +#define _MACH_EXCEPTION_TYPES_H_ + +#include <mach/machine/exception.h> + +/* + * Machine-independent exception definitions. + */ + +#define EXC_BAD_ACCESS 1 /* Could not access memory */ + /* Code contains kern_return_t describing error. */ + /* Subcode contains bad memory address. */ + +#define EXC_BAD_INSTRUCTION 2 /* Instruction failed */ + /* Illegal or undefined instruction or operand */ + +#define EXC_ARITHMETIC 3 /* Arithmetic exception */ + /* Exact nature of exception is in code field */ + +#define EXC_EMULATION 4 /* Emulation instruction */ + /* Emulation support instruction encountered */ + /* Details in code and subcode fields */ + +#define EXC_SOFTWARE 5 /* Software generated exception */ + /* Exact exception is in code field. */ + /* Codes 0 - 0xFFFF reserved to hardware */ + /* Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) */ + +#define EXC_BREAKPOINT 6 /* Trace, breakpoint, etc. */ + /* Details in code field. */ + +#define EXC_SYSCALL 7 /* System calls. */ + +#define EXC_MACH_SYSCALL 8 /* Mach system calls. */ + +#define EXC_RPC_ALERT 9 /* RPC alert */ + +#define EXC_CRASH 10 /* Abnormal process exit */ + +/* + * Machine-independent exception behaviors + */ + +# define EXCEPTION_DEFAULT 1 +/* Send a catch_exception_raise message including the identity. + */ + +# define EXCEPTION_STATE 2 +/* Send a catch_exception_raise_state message including the + * thread state. + */ + +# define EXCEPTION_STATE_IDENTITY 3 +/* Send a catch_exception_raise_state_identity message including + * the thread identity and state. + */ + +#define MACH_EXCEPTION_CODES 0x80000000 +/* Send 64-bit code and subcode in the exception header */ + +/* + * Masks for exception definitions, above + * bit zero is unused, therefore 1 word = 31 exception types + */ + +#define EXC_MASK_BAD_ACCESS (1 << EXC_BAD_ACCESS) +#define EXC_MASK_BAD_INSTRUCTION (1 << EXC_BAD_INSTRUCTION) +#define EXC_MASK_ARITHMETIC (1 << EXC_ARITHMETIC) +#define EXC_MASK_EMULATION (1 << EXC_EMULATION) +#define EXC_MASK_SOFTWARE (1 << EXC_SOFTWARE) +#define EXC_MASK_BREAKPOINT (1 << EXC_BREAKPOINT) +#define EXC_MASK_SYSCALL (1 << EXC_SYSCALL) +#define EXC_MASK_MACH_SYSCALL (1 << EXC_MACH_SYSCALL) +#define EXC_MASK_RPC_ALERT (1 << EXC_RPC_ALERT) +#define EXC_MASK_CRASH (1 << EXC_CRASH) + +#define EXC_MASK_ALL (EXC_MASK_BAD_ACCESS | \ + EXC_MASK_BAD_INSTRUCTION | \ + EXC_MASK_ARITHMETIC | \ + EXC_MASK_EMULATION | \ + EXC_MASK_SOFTWARE | \ + EXC_MASK_BREAKPOINT | \ + EXC_MASK_SYSCALL | \ + EXC_MASK_MACH_SYSCALL | \ + EXC_MASK_RPC_ALERT | \ + EXC_MASK_MACHINE) + + +#define FIRST_EXCEPTION 1 /* ZERO is illegal */ + +/* + * Machine independent codes for EXC_SOFTWARE + * Codes 0x10000 - 0x1FFFF reserved for OS emulation (Unix) + * 0x10000 - 0x10002 in use for unix signals + */ +#define EXC_SOFT_SIGNAL 0x10003 /* Unix signal exceptions */ + +#ifndef ASSEMBLER + +#include <mach/port.h> +#include <mach/thread_status.h> +#include <mach/machine/vm_types.h> +/* + * Exported types + */ + +typedef int exception_type_t; +typedef integer_t exception_data_type_t; +typedef int64_t mach_exception_data_type_t; +typedef int exception_behavior_t; +typedef exception_data_type_t *exception_data_t; +typedef mach_exception_data_type_t *mach_exception_data_t; +typedef unsigned int exception_mask_t; +typedef exception_mask_t *exception_mask_array_t; +typedef exception_behavior_t *exception_behavior_array_t; +typedef thread_state_flavor_t *exception_flavor_array_t; +typedef mach_port_t *exception_port_array_t; +typedef mach_exception_data_type_t mach_exception_code_t; +typedef mach_exception_data_type_t mach_exception_subcode_t; + +#endif /* ASSEMBLER */ + +#endif /* _MACH_EXCEPTION_TYPES_H_ */ diff --git a/i386/include/mach/host_info.h b/i386/include/mach/host_info.h new file mode 100644 index 0000000..bc8f803 --- /dev/null +++ b/i386/include/mach/host_info.h @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/host_info.h + * + * Definitions for host_info call. + */ + +#ifndef _MACH_HOST_INFO_H_ +#define _MACH_HOST_INFO_H_ + +#include <mach/message.h> +#include <mach/vm_statistics.h> +#include <mach/machine.h> +#include <mach/machine/vm_types.h> +#include <mach/time_value.h> + +#include <sys/cdefs.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef integer_t *host_info_t; /* varying array of int. */ +typedef integer_t *host_info64_t; /* varying array of int. */ + +#define HOST_INFO_MAX (1024) /* max array size */ +typedef integer_t host_info_data_t[HOST_INFO_MAX]; + +#define KERNEL_VERSION_MAX (512) +typedef char kernel_version_t[KERNEL_VERSION_MAX]; + +#define KERNEL_BOOT_INFO_MAX (4096) +typedef char kernel_boot_info_t[KERNEL_BOOT_INFO_MAX]; + +/* + * Currently defined information. + */ +/* host_info() */ +typedef integer_t host_flavor_t; +#define HOST_BASIC_INFO 1 /* basic info */ +#define HOST_SCHED_INFO 3 /* scheduling info */ +#define HOST_RESOURCE_SIZES 4 /* kernel struct sizes */ +#define HOST_PRIORITY_INFO 5 /* priority information */ +#define HOST_SEMAPHORE_TRAPS 7 /* Has semaphore traps */ +#define HOST_MACH_MSG_TRAP 8 /* Has mach_msg_trap */ + + +#pragma pack(4) + +struct host_basic_info { + integer_t max_cpus; /* max number of CPUs possible */ + integer_t avail_cpus; /* number of CPUs now available */ + natural_t memory_size; /* size of memory in bytes, capped at 2 GB */ + cpu_type_t cpu_type; /* cpu type */ + cpu_subtype_t cpu_subtype; /* cpu subtype */ + cpu_threadtype_t cpu_threadtype; /* cpu threadtype */ + integer_t physical_cpu; /* number of physical CPUs now available */ + integer_t physical_cpu_max; /* max number of physical CPUs possible */ + integer_t logical_cpu; /* number of logical cpu now available */ + integer_t logical_cpu_max; /* max number of physical CPUs possible */ + uint64_t max_mem; /* actual size of physical memory */ +}; + +#pragma pack() + +typedef struct host_basic_info host_basic_info_data_t; +typedef struct host_basic_info *host_basic_info_t; +#define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_basic_info_data_t)/sizeof(integer_t))) + +struct host_sched_info { + integer_t min_timeout; /* minimum timeout in milliseconds */ + integer_t min_quantum; /* minimum quantum in milliseconds */ +}; + +typedef struct host_sched_info host_sched_info_data_t; +typedef struct host_sched_info *host_sched_info_t; +#define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_sched_info_data_t)/sizeof(integer_t))) + +struct kernel_resource_sizes { + natural_t task; + natural_t thread; + natural_t port; + natural_t memory_region; + natural_t memory_object; +}; + +typedef struct kernel_resource_sizes kernel_resource_sizes_data_t; +typedef struct kernel_resource_sizes *kernel_resource_sizes_t; +#define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) \ + (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t))) + +struct host_priority_info { + integer_t kernel_priority; + integer_t system_priority; + integer_t server_priority; + integer_t user_priority; + integer_t depress_priority; + integer_t idle_priority; + integer_t minimum_priority; + integer_t maximum_priority; +}; + +typedef struct host_priority_info host_priority_info_data_t; +typedef struct host_priority_info *host_priority_info_t; +#define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_priority_info_data_t)/sizeof(integer_t))) + +/* host_statistics() */ +#define HOST_LOAD_INFO 1 /* System loading stats */ +#define HOST_VM_INFO 2 /* Virtual memory stats */ +#define HOST_CPU_LOAD_INFO 3 /* CPU load stats */ + +/* host_statistics64() */ +#define HOST_VM_INFO64 4 /* 64-bit virtual memory stats */ + + +struct host_load_info { + integer_t avenrun[3]; /* scaled by LOAD_SCALE */ + integer_t mach_factor[3]; /* scaled by LOAD_SCALE */ +}; + +typedef struct host_load_info host_load_info_data_t; +typedef struct host_load_info *host_load_info_t; +#define HOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(host_load_info_data_t)/sizeof(integer_t))) + +/* in <mach/vm_statistics.h> */ +/* vm_statistics64 */ +#define HOST_VM_INFO64_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_statistics64_data_t)/sizeof(integer_t))) + +/* size of the latest version of the structure */ +#define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT + + +/* vm_statistics */ +#define HOST_VM_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_statistics_data_t)/sizeof(integer_t))) + +/* size of the latest version of the structure */ +#define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT +#define HOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT +/* previous versions: adjust the size according to what was added each time */ +#define HOST_VM_INFO_REV1_COUNT /* added "speculative_count" (1 int) */ \ + ((mach_msg_type_number_t) \ + (HOST_VM_INFO_REV2_COUNT - 1)) +#define HOST_VM_INFO_REV0_COUNT /* added "purgable" info (2 ints) */ \ + ((mach_msg_type_number_t) \ + (HOST_VM_INFO_REV1_COUNT - 2)) + +struct host_cpu_load_info { /* number of ticks while running... */ + natural_t cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ +}; + +typedef struct host_cpu_load_info host_cpu_load_info_data_t; +typedef struct host_cpu_load_info *host_cpu_load_info_t; +#define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t))) + +#endif /* _MACH_HOST_INFO_H_ */ diff --git a/i386/include/mach/host_notify.h b/i386/include/mach/host_notify.h new file mode 100644 index 0000000..6c0ca74 --- /dev/null +++ b/i386/include/mach/host_notify.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_HOST_NOTIFY_H_ +#define _MACH_HOST_NOTIFY_H_ + +#define HOST_NOTIFY_CALENDAR_CHANGE 0 +#define HOST_NOTIFY_TYPE_MAX 0 + +#define HOST_CALENDAR_CHANGED_REPLYID 950 + +#endif /* _MACH_HOST_NOTIFY_H_ */ diff --git a/i386/include/mach/host_notify_reply.defs b/i386/include/mach/host_notify_reply.defs new file mode 100644 index 0000000..85437f8 --- /dev/null +++ b/i386/include/mach/host_notify_reply.defs @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERN_USER */ + host_notify_reply 950; + +#include <mach/std_types.defs> + +simpleroutine host_calendar_changed( + notify_port : mach_port_move_send_once_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/host_priv.defs b/i386/include/mach/host_priv.defs new file mode 100644 index 0000000..3be3986 --- /dev/null +++ b/i386/include/mach/host_priv.defs @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2000-2004 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * Matchmaker definitions file for Mach kernel interface. + */ +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + host_priv 400; + +#ifdef KERNEL_USER +userprefix r_; +#endif /* KERNEL_USER */ + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Get boot configuration information from kernel. + */ +routine host_get_boot_info( + host_priv : host_priv_t; + out boot_info : kernel_boot_info_t); + +/* + * Reboot this host. + * Only available to privileged users. + */ +routine host_reboot( + host_priv : host_priv_t; + options : int); + + +/* + * Return privileged statistics from this host. + */ +routine host_priv_statistics( + host_priv : host_priv_t; + flavor : host_flavor_t; + out host_info_out : host_info_t, CountInOut); + +/* + * Sets the default memory manager, the port to which + * newly-created temporary memory objects are delivered. + * [See (memory_object_default)memory_object_create.] + * Also sets the default cluster size used for pagein/pageout + * to this port. + * The old memory manager port is returned. + */ +routine host_default_memory_manager( + host_priv : host_priv_t; + inout default_manager : memory_object_default_t = + MACH_MSG_TYPE_MAKE_SEND; + cluster_size : memory_object_cluster_size_t); + + +/* + * Specify that the range of the virtual address space + * of the target task must not cause page faults for + * the indicated accesses. + * + * [ To unwire the pages, specify VM_PROT_NONE. ] + */ +routine vm_wire( + host_priv : host_priv_t; + task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + desired_access : vm_prot_t); + +/* + * Specify that the target thread must always be able + * to run and to allocate memory. + */ +routine thread_wire( + host_priv : host_priv_t; + thread : thread_act_t; + wired : boolean_t); + +/* + * Allocate zero-filled, wired, contiguous physical memory + * in the address space of the target task, either at the + * specified address, or wherever space can be found (if + * anywhere is TRUE), of the specified size. The address + * at which the allocation actually took place is returned. + * All pages will be entered into the task's pmap immediately, + * with VM_PROT_ALL. + * + * In addition to all the failure modes of its cousin, + * vm_allocate, this call may also fail if insufficient + * contiguous memory exists to satisfy the request. + * + * Memory obtained from this call should be freed the + * normal way, via vm_deallocate. + * + * N.B. This is an EXPERIMENTAL interface! + */ +routine vm_allocate_cpm( + host_priv : host_priv_t; + task : vm_map_t; + inout address : vm_address_t; + size : vm_size_t; + flags : int); + +/* + * Get list of processors on this host. + */ +routine host_processors( + host_priv : host_priv_t; + out out_processor_list : processor_array_t); + + +/* + * Get control port for a system-wide clock. + * Privileged. + */ +routine host_get_clock_control( + host_priv : host_priv_t; + clock_id : clock_id_t; + out clock_ctrl : clock_ctrl_t); + + +/* + * kernel module interface (obsolete as of SnowLeopard) + * see mach/kmod.h + */ +/* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ +routine kmod_create( + host_priv : host_priv_t; + info : vm_address_t; + out module : kmod_t); + +routine kmod_destroy( + host_priv : host_priv_t; + module : kmod_t); + +routine kmod_control( + host_priv : host_priv_t; + module : kmod_t; + flavor : kmod_control_flavor_t; + inout data : kmod_args_t); + +/* + * Get a given special port for a given node. + * Special ports are defined in host_special_ports.h; + * examples include the master device port. + * There are a limited number of slots available for system servers. + */ +routine host_get_special_port( + host_priv : host_priv_t; + node : int; + which : int; + out port : mach_port_t); + +/* + * Set a given special port for the local node. + * See host_get_special_port. + */ +routine host_set_special_port( + host_priv : host_priv_t; + which : int; + port : mach_port_t); + +/* + * Set an exception handler for a host on one or more exception types. + * These handlers are invoked for all threads on the host if there are + * no task or thread-specific exception handlers or those handlers returned + * an error. + */ +routine host_set_exception_ports( + host_priv : host_priv_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t); + + +/* + * Lookup some of the old exception handlers for a host + */ +routine host_get_exception_ports( + host_priv : host_priv_t; + exception_mask : exception_mask_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + + +/* + * Set an exception handler for a host on one or more exception types. + * At the same time, return the previously defined exception handlers for + * those types. + */ +routine host_swap_exception_ports( + host_priv : host_priv_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t; + out masks : exception_mask_array_t; + out old_handlerss : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * Loads a symbol table for an external file into the kernel debugger. + * The symbol table data is an array of characters. It is assumed that + * the caller and the kernel debugger agree on its format. + * This call is only supported in MACH_DEBUG and MACH_KDB kernels, + * otherwise KERN_FAILURE is returned. + */ +routine host_load_symbol_table( + host : host_priv_t; + task : task_t; + name : symtab_name_t; + symtab : pointer_t); + +/* + * Specify that the range of the virtual address space + * of the target task must not cause page faults for + * the indicated accesses. + * + * [ To unwire the pages, specify VM_PROT_NONE. ] + */ +routine mach_vm_wire( + host_priv : host_priv_t; + task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + desired_access : vm_prot_t); + +/* + * JMM - Keep all processor_set related items at the end for easy + * removal. + */ +/* + * List all processor sets on host. + */ +routine host_processor_sets( + host_priv : host_priv_t; + out processor_sets : processor_set_name_array_t); + +/* + * Get control port for a processor set. + */ +routine host_processor_set_priv( + host_priv : host_priv_t; + set_name : processor_set_name_t; + out set : processor_set_t); + +/************************** Warning *************************************/ +/* The following routines are going away in a future release */ +/* use the appropriate variant of host_set_special_port instead */ +/************************************************************************/ + +/* + * Set the dynamic_pager control port. Other entities + * can request a send right to this port to talk with + * the dynamic_pager utility, setting behavioral parameters + * within the dynamic pager and getting low/high backing store + * resource notifications. + */ +routine set_dp_control_port( + host : host_priv_t; + in control_port : mach_port_t); + +/* + * Get the dynamic_pager control port. This port + * allows the holder to talk directly with the dynamic + * pager utility. + */ +routine get_dp_control_port( + host : host_priv_t; + out contorl_port :mach_port_t); + +/* + * Set the UserNotification daemon access port for this host. + * If this value is already set, the kernel will discard its + * reference to the previously registered port. + */ +routine host_set_UNDServer( + host : host_priv_t; + in server : UNDServerRef); + +/* + * Get the UserNotification daemon access port for this host. + * This can then be used to communicate with that daemon, which + * in turn communicates with the User through whatever means + * available (pop-up-menus for GUI systems, text for non-GUI, etc..). + * + * Access to this port is restricted to privileged clients because + * it is a special purpose port intended for kernel clients. User + * level clients should go directly to the CFUserNotifcation services. + */ +routine host_get_UNDServer( + host : host_priv_t; + out server : UNDServerRef); + +/* + * Perform an operation with a kernel extension, on the kext loading system, + * or request information about loaded kexts or the state of the kext loading + * system. + * Active operations (load, unload, disable/enable) require host_priv/root access. + * Info retrieval does not. + * + * WARNING: THIS ROUTINE IS PRIVATE TO THE KEXT-MANAGEMENT STACK AND IS + * SUBJECT TO CHANGE AT ANY TIME. + */ +routine kext_request( + host_priv : host_priv_t; + in user_log_flags : uint32_t; + in request_data : pointer_t; + out response_data : pointer_t; + out log_data : pointer_t; + out op_result : kern_return_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/host_priv.h b/i386/include/mach/host_priv.h new file mode 100644 index 0000000..7a9df1f --- /dev/null +++ b/i386/include/mach/host_priv.h @@ -0,0 +1,1269 @@ +#ifndef _host_priv_user_ +#define _host_priv_user_ + +/* Module host_priv */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef host_priv_MSG_COUNT +#define host_priv_MSG_COUNT 26 +#endif /* host_priv_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine host_get_boot_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_boot_info +( + host_priv_t host_priv, + kernel_boot_info_t boot_info +); + +/* Routine host_reboot */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_reboot +( + host_priv_t host_priv, + int options +); + +/* Routine host_priv_statistics */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_priv_statistics +( + host_priv_t host_priv, + host_flavor_t flavor, + host_info_t host_info_out, + mach_msg_type_number_t *host_info_outCnt +); + +/* Routine host_default_memory_manager */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_default_memory_manager +( + host_priv_t host_priv, + memory_object_default_t *default_manager, + memory_object_cluster_size_t cluster_size +); + +/* Routine vm_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_wire +( + host_priv_t host_priv, + vm_map_t task, + vm_address_t address, + vm_size_t size, + vm_prot_t desired_access +); + +/* Routine thread_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_wire +( + host_priv_t host_priv, + thread_act_t thread, + boolean_t wired +); + +/* Routine vm_allocate_cpm */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_allocate_cpm +( + host_priv_t host_priv, + vm_map_t task, + vm_address_t *address, + vm_size_t size, + int flags +); + +/* Routine host_processors */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processors +( + host_priv_t host_priv, + processor_array_t *out_processor_list, + mach_msg_type_number_t *out_processor_listCnt +); + +/* Routine host_get_clock_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_clock_control +( + host_priv_t host_priv, + clock_id_t clock_id, + clock_ctrl_t *clock_ctrl +); + +/* Routine kmod_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_create +( + host_priv_t host_priv, + vm_address_t info, + kmod_t *module +); + +/* Routine kmod_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_destroy +( + host_priv_t host_priv, + kmod_t module +); + +/* Routine kmod_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_control +( + host_priv_t host_priv, + kmod_t module, + kmod_control_flavor_t flavor, + kmod_args_t *data, + mach_msg_type_number_t *dataCnt +); + +/* Routine host_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_special_port +( + host_priv_t host_priv, + int node, + int which, + mach_port_t *port +); + +/* Routine host_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_set_special_port +( + host_priv_t host_priv, + int which, + mach_port_t port +); + +/* Routine host_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_set_exception_ports +( + host_priv_t host_priv, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine host_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_exception_ports +( + host_priv_t host_priv, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine host_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_swap_exception_ports +( + host_priv_t host_priv, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine host_load_symbol_table */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_load_symbol_table +( + host_priv_t host, + task_t task, + symtab_name_t name, + vm_offset_t symtab, + mach_msg_type_number_t symtabCnt +); + +/* Routine mach_vm_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_wire +( + host_priv_t host_priv, + vm_map_t task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_prot_t desired_access +); + +/* Routine host_processor_sets */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processor_sets +( + host_priv_t host_priv, + processor_set_name_array_t *processor_sets, + mach_msg_type_number_t *processor_setsCnt +); + +/* Routine host_processor_set_priv */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processor_set_priv +( + host_priv_t host_priv, + processor_set_name_t set_name, + processor_set_t *set +); + +/* Routine set_dp_control_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t set_dp_control_port +( + host_priv_t host, + mach_port_t control_port +); + +/* Routine get_dp_control_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t get_dp_control_port +( + host_priv_t host, + mach_port_t *contorl_port +); + +/* Routine host_set_UNDServer */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_set_UNDServer +( + host_priv_t host, + UNDServerRef server +); + +/* Routine host_get_UNDServer */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_UNDServer +( + host_priv_t host, + UNDServerRef *server +); + +/* Routine kext_request */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kext_request +( + host_priv_t host_priv, + uint32_t user_log_flags, + vm_offset_t request_data, + mach_msg_type_number_t request_dataCnt, + vm_offset_t *response_data, + mach_msg_type_number_t *response_dataCnt, + vm_offset_t *log_data, + mach_msg_type_number_t *log_dataCnt, + kern_return_t *op_result +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__host_priv_subsystem__defined +#define __Request__host_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_get_boot_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int options; + } __Request__host_reboot_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info_outCnt; + } __Request__host_priv_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t default_manager; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_cluster_size_t cluster_size; + } __Request__host_default_memory_manager_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_prot_t desired_access; + } __Request__vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t wired; + } __Request__thread_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + int flags; + } __Request__vm_allocate_cpm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_processors_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_id_t clock_id; + } __Request__host_get_clock_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t info; + } __Request__kmod_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kmod_t module; + } __Request__kmod_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + kmod_t module; + kmod_control_flavor_t flavor; + mach_msg_type_number_t dataCnt; + } __Request__kmod_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int node; + int which; + } __Request__host_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which; + } __Request__host_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__host_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__host_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__host_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + mach_msg_ool_descriptor_t symtab; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t nameOffset; /* MiG doesn't use it */ + mach_msg_type_number_t nameCnt; + char name[32]; + mach_msg_type_number_t symtabCnt; + } __Request__host_load_symbol_table_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t task; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_prot_t desired_access; + } __Request__mach_vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_processor_sets_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t set_name; + /* end of the kernel processed data */ + } __Request__host_processor_set_priv_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t control_port; + /* end of the kernel processed data */ + } __Request__set_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__get_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t server; + /* end of the kernel processed data */ + } __Request__host_set_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_get_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t request_data; + /* end of the kernel processed data */ + NDR_record_t NDR; + uint32_t user_log_flags; + mach_msg_type_number_t request_dataCnt; + } __Request__kext_request_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__host_priv_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__host_priv_subsystem__defined +#define __RequestUnion__host_priv_subsystem__defined +union __RequestUnion__host_priv_subsystem { + __Request__host_get_boot_info_t Request_host_get_boot_info; + __Request__host_reboot_t Request_host_reboot; + __Request__host_priv_statistics_t Request_host_priv_statistics; + __Request__host_default_memory_manager_t Request_host_default_memory_manager; + __Request__vm_wire_t Request_vm_wire; + __Request__thread_wire_t Request_thread_wire; + __Request__vm_allocate_cpm_t Request_vm_allocate_cpm; + __Request__host_processors_t Request_host_processors; + __Request__host_get_clock_control_t Request_host_get_clock_control; + __Request__kmod_create_t Request_kmod_create; + __Request__kmod_destroy_t Request_kmod_destroy; + __Request__kmod_control_t Request_kmod_control; + __Request__host_get_special_port_t Request_host_get_special_port; + __Request__host_set_special_port_t Request_host_set_special_port; + __Request__host_set_exception_ports_t Request_host_set_exception_ports; + __Request__host_get_exception_ports_t Request_host_get_exception_ports; + __Request__host_swap_exception_ports_t Request_host_swap_exception_ports; + __Request__host_load_symbol_table_t Request_host_load_symbol_table; + __Request__mach_vm_wire_t Request_mach_vm_wire; + __Request__host_processor_sets_t Request_host_processor_sets; + __Request__host_processor_set_priv_t Request_host_processor_set_priv; + __Request__set_dp_control_port_t Request_set_dp_control_port; + __Request__get_dp_control_port_t Request_get_dp_control_port; + __Request__host_set_UNDServer_t Request_host_set_UNDServer; + __Request__host_get_UNDServer_t Request_host_get_UNDServer; + __Request__kext_request_t Request_kext_request; +}; +#endif /* !__RequestUnion__host_priv_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__host_priv_subsystem__defined +#define __Reply__host_priv_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t boot_infoOffset; /* MiG doesn't use it */ + mach_msg_type_number_t boot_infoCnt; + char boot_info[4096]; + } __Reply__host_get_boot_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_reboot_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info_outCnt; + integer_t host_info_out[15]; + } __Reply__host_priv_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t default_manager; + /* end of the kernel processed data */ + } __Reply__host_default_memory_manager_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_allocate_cpm_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t out_processor_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t out_processor_listCnt; + } __Reply__host_processors_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t clock_ctrl; + /* end of the kernel processed data */ + } __Reply__host_get_clock_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + kmod_t module; + } __Reply__kmod_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__kmod_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t dataCnt; + } __Reply__kmod_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t port; + /* end of the kernel processed data */ + } __Reply__host_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__host_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__host_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_load_symbol_table_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t processor_sets; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t processor_setsCnt; + } __Reply__host_processor_sets_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t set; + /* end of the kernel processed data */ + } __Reply__host_processor_set_priv_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__set_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t contorl_port; + /* end of the kernel processed data */ + } __Reply__get_dp_control_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_set_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t server; + /* end of the kernel processed data */ + } __Reply__host_get_UNDServer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t response_data; + mach_msg_ool_descriptor_t log_data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t response_dataCnt; + mach_msg_type_number_t log_dataCnt; + kern_return_t op_result; + } __Reply__kext_request_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__host_priv_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__host_priv_subsystem__defined +#define __ReplyUnion__host_priv_subsystem__defined +union __ReplyUnion__host_priv_subsystem { + __Reply__host_get_boot_info_t Reply_host_get_boot_info; + __Reply__host_reboot_t Reply_host_reboot; + __Reply__host_priv_statistics_t Reply_host_priv_statistics; + __Reply__host_default_memory_manager_t Reply_host_default_memory_manager; + __Reply__vm_wire_t Reply_vm_wire; + __Reply__thread_wire_t Reply_thread_wire; + __Reply__vm_allocate_cpm_t Reply_vm_allocate_cpm; + __Reply__host_processors_t Reply_host_processors; + __Reply__host_get_clock_control_t Reply_host_get_clock_control; + __Reply__kmod_create_t Reply_kmod_create; + __Reply__kmod_destroy_t Reply_kmod_destroy; + __Reply__kmod_control_t Reply_kmod_control; + __Reply__host_get_special_port_t Reply_host_get_special_port; + __Reply__host_set_special_port_t Reply_host_set_special_port; + __Reply__host_set_exception_ports_t Reply_host_set_exception_ports; + __Reply__host_get_exception_ports_t Reply_host_get_exception_ports; + __Reply__host_swap_exception_ports_t Reply_host_swap_exception_ports; + __Reply__host_load_symbol_table_t Reply_host_load_symbol_table; + __Reply__mach_vm_wire_t Reply_mach_vm_wire; + __Reply__host_processor_sets_t Reply_host_processor_sets; + __Reply__host_processor_set_priv_t Reply_host_processor_set_priv; + __Reply__set_dp_control_port_t Reply_set_dp_control_port; + __Reply__get_dp_control_port_t Reply_get_dp_control_port; + __Reply__host_set_UNDServer_t Reply_host_set_UNDServer; + __Reply__host_get_UNDServer_t Reply_host_get_UNDServer; + __Reply__kext_request_t Reply_kext_request; +}; +#endif /* !__RequestUnion__host_priv_subsystem__defined */ + +#ifndef subsystem_to_name_map_host_priv +#define subsystem_to_name_map_host_priv \ + { "host_get_boot_info", 400 },\ + { "host_reboot", 401 },\ + { "host_priv_statistics", 402 },\ + { "host_default_memory_manager", 403 },\ + { "vm_wire", 404 },\ + { "thread_wire", 405 },\ + { "vm_allocate_cpm", 406 },\ + { "host_processors", 407 },\ + { "host_get_clock_control", 408 },\ + { "kmod_create", 409 },\ + { "kmod_destroy", 410 },\ + { "kmod_control", 411 },\ + { "host_get_special_port", 412 },\ + { "host_set_special_port", 413 },\ + { "host_set_exception_ports", 414 },\ + { "host_get_exception_ports", 415 },\ + { "host_swap_exception_ports", 416 },\ + { "host_load_symbol_table", 417 },\ + { "mach_vm_wire", 418 },\ + { "host_processor_sets", 419 },\ + { "host_processor_set_priv", 420 },\ + { "set_dp_control_port", 421 },\ + { "get_dp_control_port", 422 },\ + { "host_set_UNDServer", 423 },\ + { "host_get_UNDServer", 424 },\ + { "kext_request", 425 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _host_priv_user_ */ diff --git a/i386/include/mach/host_reboot.h b/i386/include/mach/host_reboot.h new file mode 100644 index 0000000..65609dd --- /dev/null +++ b/i386/include/mach/host_reboot.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_HOST_REBOOT_ +#define _MACH_HOST_REBOOT_ + +#define HOST_REBOOT_HALT 0x0008 +#define HOST_REBOOT_UPSDELAY 0x0100 +#define HOST_REBOOT_DEBUGGER 0x1000 + +#endif /* _MACH_HOST_REBOOT_ */ diff --git a/i386/include/mach/host_security.defs b/i386/include/mach/host_security.defs new file mode 100644 index 0000000..4098df4 --- /dev/null +++ b/i386/include/mach/host_security.defs @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/host_security.defs + * + * Abstract: + * Mach host security operations support. + */ +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + host_security 600; + +/* + * Basic types + */ +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + + +/* + * Create a new task with an explicit security token + */ +routine host_security_create_task_token( + host_security : host_security_t; + parent_task : task_t; + sec_token : security_token_t; + audit_token : audit_token_t; + host : host_t; + ledgers : ledger_array_t; + inherit_memory : boolean_t; + out child_task : task_t); + +/* + * Change a task's security token + */ +routine host_security_set_task_token( + host_security : host_security_t; + target_task : task_t; + sec_token : security_token_t; + audit_token : audit_token_t; + host : host_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/host_security.h b/i386/include/mach/host_security.h new file mode 100644 index 0000000..ee4ed9e --- /dev/null +++ b/i386/include/mach/host_security.h @@ -0,0 +1,197 @@ +#ifndef _host_security_user_ +#define _host_security_user_ + +/* Module host_security */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef host_security_MSG_COUNT +#define host_security_MSG_COUNT 2 +#endif /* host_security_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine host_security_create_task_token */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_security_create_task_token +( + host_security_t host_security, + task_t parent_task, + security_token_t sec_token, + audit_token_t audit_token, + host_t host, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine host_security_set_task_token */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_security_set_task_token +( + host_security_t host_security, + task_t target_task, + security_token_t sec_token, + audit_token_t audit_token, + host_t host +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__host_security_subsystem__defined +#define __Request__host_security_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_task; + mach_msg_port_descriptor_t host; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + security_token_t sec_token; + audit_token_t audit_token; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__host_security_create_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t target_task; + mach_msg_port_descriptor_t host; + /* end of the kernel processed data */ + NDR_record_t NDR; + security_token_t sec_token; + audit_token_t audit_token; + } __Request__host_security_set_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__host_security_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__host_security_subsystem__defined +#define __RequestUnion__host_security_subsystem__defined +union __RequestUnion__host_security_subsystem { + __Request__host_security_create_task_token_t Request_host_security_create_task_token; + __Request__host_security_set_task_token_t Request_host_security_set_task_token; +}; +#endif /* !__RequestUnion__host_security_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__host_security_subsystem__defined +#define __Reply__host_security_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__host_security_create_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_security_set_task_token_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__host_security_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__host_security_subsystem__defined +#define __ReplyUnion__host_security_subsystem__defined +union __ReplyUnion__host_security_subsystem { + __Reply__host_security_create_task_token_t Reply_host_security_create_task_token; + __Reply__host_security_set_task_token_t Reply_host_security_set_task_token; +}; +#endif /* !__RequestUnion__host_security_subsystem__defined */ + +#ifndef subsystem_to_name_map_host_security +#define subsystem_to_name_map_host_security \ + { "host_security_create_task_token", 600 },\ + { "host_security_set_task_token", 601 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _host_security_user_ */ diff --git a/i386/include/mach/host_special_ports.h b/i386/include/mach/host_special_ports.h new file mode 100644 index 0000000..755327c --- /dev/null +++ b/i386/include/mach/host_special_ports.h @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/host_special_ports.h + * + * Defines codes for access to host-wide special ports. + */ + +#ifndef _MACH_HOST_SPECIAL_PORTS_H_ +#define _MACH_HOST_SPECIAL_PORTS_H_ + +/* + * Cannot be set or gotten from user space + */ +#define HOST_SECURITY_PORT 0 + +/* + * Always provided by kernel (cannot be set from user-space). + */ +#define HOST_PORT 1 +#define HOST_PRIV_PORT 2 +#define HOST_IO_MASTER_PORT 3 +#define HOST_MAX_SPECIAL_KERNEL_PORT 7 /* room to grow */ + +/* + * Not provided by kernel + */ +#define HOST_DYNAMIC_PAGER_PORT (1 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_AUDIT_CONTROL_PORT (2 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_USER_NOTIFICATION_PORT (3 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_AUTOMOUNTD_PORT (4 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_LOCKD_PORT (5 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_SEATBELT_PORT (7 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_KEXTD_PORT (8 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_CHUD_PORT (9 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_UNFREED_PORT (10 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_AMFID_PORT (11 + HOST_MAX_SPECIAL_KERNEL_PORT) +#define HOST_MAX_SPECIAL_PORT (12 + HOST_MAX_SPECIAL_KERNEL_PORT) + /* room to grow here as well */ + +/* + * Special node identifier to always represent the local node. + */ +#define HOST_LOCAL_NODE -1 + +/* + * Definitions for ease of use. + * + * In the get call, the host parameter can be any host, but will generally + * be the local node host port. In the set call, the host must the per-node + * host port for the node being affected. + */ +#define host_get_host_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_PORT, (port))) +#define host_set_host_port(host, port) (KERN_INVALID_ARGUMENT) + +#define host_get_host_priv_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_PRIV_PORT, (port))) +#define host_set_host_priv_port(host, port) (KERN_INVALID_ARGUMENT) + +#define host_get_io_master_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_IO_MASTER_PORT, (port))) +#define host_set_io_master_port(host, port) (KERN_INVALID_ARGUMENT) + +/* + * User-settable special ports. + */ +#define host_get_dynamic_pager_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_DYNAMIC_PAGER_PORT, (port))) +#define host_set_dynamic_pager_port(host, port) \ + (host_set_special_port((host), HOST_DYNAMIC_PAGER_PORT, (port))) + +#define host_get_audit_control_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_AUDIT_CONTROL_PORT, (port))) +#define host_set_audit_control_port(host, port) \ + (host_set_special_port((host), HOST_AUDIT_CONTROL_PORT, (port))) + +#define host_get_user_notification_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_USER_NOTIFICATION_PORT, (port))) +#define host_set_user_notification_port(host, port) \ + (host_set_special_port((host), HOST_USER_NOTIFICATION_PORT, (port))) + +#define host_get_automountd_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_AUTOMOUNTD_PORT, (port))) +#define host_set_automountd_port(host, port) \ + (host_set_special_port((host), HOST_AUTOMOUNTD_PORT, (port))) + +#define host_get_lockd_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_LOCKD_PORT, (port))) +#define host_set_lockd_port(host, port) \ + (host_set_special_port((host), HOST_LOCKD_PORT, (port))) + +#define host_get_kextd_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_KEXTD_PORT, (port))) +#define host_set_kextd_port(host, port) \ + (host_set_special_port((host), HOST_KEXTD_PORT, (port))) + +#define host_get_chud_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_CHUD_PORT, (port))) +#define host_set_chud_port(host, port) \ + (host_set_special_port((host), HOST_CHUD_PORT, (port))) + +#define host_get_unfreed_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_UNFREED_PORT, (port))) +#define host_set_unfreed_port(host, port) \ + (host_set_special_port((host), HOST_UNFREED_PORT, (port))) + +#define host_get_amfid_port(host, port) \ + (host_get_special_port((host), \ + HOST_LOCAL_NODE, HOST_AMFID_PORT, (port))) +#define host_set_amfid_port(host, port) \ + (host_set_special_port((host), HOST_AMFID_PORT, (port))) + +#endif /* _MACH_HOST_SPECIAL_PORTS_H_ */ diff --git a/i386/include/mach/i386/.svn/all-wcprops b/i386/include/mach/i386/.svn/all-wcprops new file mode 100644 index 0000000..a7213e8 --- /dev/null +++ b/i386/include/mach/i386/.svn/all-wcprops @@ -0,0 +1,107 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386 +END +processor_info.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/processor_info.h +END +thread_act.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/thread_act.h +END +kern_return.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/kern_return.h +END +exception.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/exception.h +END +ndr_def.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/ndr_def.h +END +vm_param.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/vm_param.h +END +task.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/task.h +END +fp_reg.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/fp_reg.h +END +_structs.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/_structs.h +END +vm_types.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/vm_types.h +END +thread_state.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/thread_state.h +END +thread_status.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/thread_status.h +END +boolean.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/boolean.h +END +asm.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/asm.h +END +machine_types.defs +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/machine_types.defs +END +rpc.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/rpc.h +END +sdt_isa.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/i386/sdt_isa.h +END diff --git a/i386/include/mach/i386/.svn/entries b/i386/include/mach/i386/.svn/entries new file mode 100644 index 0000000..db91dec --- /dev/null +++ b/i386/include/mach/i386/.svn/entries @@ -0,0 +1,606 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach/i386 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +processor_info.h +file + + + + +2013-08-27T23:54:40.000000Z +99a464c64676ff9f480c36ea4a07c0ef +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1564 + +thread_act.h +file + + + + +2013-08-27T23:54:40.000000Z +25d845f2e915a195e887ae48026bf854 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25654 + +kern_return.h +file + + + + +2013-08-27T23:54:40.000000Z +b5b9779f531702ae23c7148bcd5996e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2732 + +exception.h +file + + + + +2013-08-27T23:54:40.000000Z +e773bfd326e35491f5412fec9243a987 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4334 + +ndr_def.h +file + + + + +2013-08-27T23:54:40.000000Z +66aac4931844c7458986a5bf2bf84bb8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1606 + +vm_param.h +file + + + + +2013-08-27T23:54:40.000000Z +038ae128a310e858f1e226d5864f132b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5846 + +task.h +file + + + + +2013-08-27T23:54:40.000000Z +d87c8dd8a5baf21d6cd2fb7fd2c6775d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34704 + +fp_reg.h +file + + + + +2013-08-27T23:54:40.000000Z +9e3df9eee41f4ebacda13a11b76c1738 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5729 + +_structs.h +file + + + + +2013-08-27T23:54:40.000000Z +696f0e24e9d25949e5560d8089ba8fe9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15857 + +vm_types.h +file + + + + +2013-08-27T23:54:40.000000Z +0d96b4e8746868cf6b0e2d64bb969f61 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4662 + +thread_state.h +file + + + + +2013-08-27T23:54:40.000000Z +4ffdc199f0fe46a33a923f373c8e8f73 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1708 + +thread_status.h +file + + + + +2013-08-27T23:54:40.000000Z +b9ac0b0e0d806a89d7d46b97fa249a0a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9563 + +boolean.h +file + + + + +2013-08-27T23:54:40.000000Z +ef9456c036786afe0df12e055ae49c92 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2677 + +asm.h +file + + + + +2013-08-27T23:54:40.000000Z +9555a68835bfd2a8df9e00405822d795 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8927 + +machine_types.defs +file + + + + +2013-08-27T23:54:40.000000Z +6600ac2390fa2b8dd31f4f538013cf54 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3541 + +rpc.h +file + + + + +2013-08-27T23:54:40.000000Z +afde3226f98904c9507109dd9090dc56 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1451 + +sdt_isa.h +file + + + + +2013-08-27T23:54:40.000000Z +98c4ec2c431edaf8b13a7f734e3e3dab +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15722 + diff --git a/i386/include/mach/i386/.svn/text-base/_structs.h.svn-base b/i386/include/mach/i386/.svn/text-base/_structs.h.svn-base new file mode 100644 index 0000000..927d12f --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/_structs.h.svn-base @@ -0,0 +1,561 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_I386__STRUCTS_H_ +#define _MACH_I386__STRUCTS_H_ + +/* + * i386 is the structure that is exported to user threads for + * use in status/mutate calls. This structure should never change. + * + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_THREAD_STATE32 struct __darwin_i386_thread_state +_STRUCT_X86_THREAD_STATE32 +{ + unsigned int __eax; + unsigned int __ebx; + unsigned int __ecx; + unsigned int __edx; + unsigned int __edi; + unsigned int __esi; + unsigned int __ebp; + unsigned int __esp; + unsigned int __ss; + unsigned int __eflags; + unsigned int __eip; + unsigned int __cs; + unsigned int __ds; + unsigned int __es; + unsigned int __fs; + unsigned int __gs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_THREAD_STATE32 struct i386_thread_state +_STRUCT_X86_THREAD_STATE32 +{ + unsigned int eax; + unsigned int ebx; + unsigned int ecx; + unsigned int edx; + unsigned int edi; + unsigned int esi; + unsigned int ebp; + unsigned int esp; + unsigned int ss; + unsigned int eflags; + unsigned int eip; + unsigned int cs; + unsigned int ds; + unsigned int es; + unsigned int fs; + unsigned int gs; +}; +#endif /* !__DARWIN_UNIX03 */ + +/* This structure should be double-word aligned for performance */ + +#if __DARWIN_UNIX03 +#define _STRUCT_FP_CONTROL struct __darwin_fp_control +_STRUCT_FP_CONTROL +{ + unsigned short __invalid :1, + __denorm :1, + __zdiv :1, + __ovrfl :1, + __undfl :1, + __precis :1, + :2, + __pc :2, +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define FP_PREC_24B 0 +#define FP_PREC_53B 2 +#define FP_PREC_64B 3 +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + __rc :2, +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define FP_RND_NEAR 0 +#define FP_RND_DOWN 1 +#define FP_RND_UP 2 +#define FP_CHOP 3 +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + /*inf*/ :1, + :3; +}; +typedef _STRUCT_FP_CONTROL __darwin_fp_control_t; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_FP_CONTROL struct fp_control +_STRUCT_FP_CONTROL +{ + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + :2, + pc :2, +#define FP_PREC_24B 0 +#define FP_PREC_53B 2 +#define FP_PREC_64B 3 + rc :2, +#define FP_RND_NEAR 0 +#define FP_RND_DOWN 1 +#define FP_RND_UP 2 +#define FP_CHOP 3 + /*inf*/ :1, + :3; +}; +typedef _STRUCT_FP_CONTROL fp_control_t; +#endif /* !__DARWIN_UNIX03 */ + +/* + * Status word. + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_FP_STATUS struct __darwin_fp_status +_STRUCT_FP_STATUS +{ + unsigned short __invalid :1, + __denorm :1, + __zdiv :1, + __ovrfl :1, + __undfl :1, + __precis :1, + __stkflt :1, + __errsumm :1, + __c0 :1, + __c1 :1, + __c2 :1, + __tos :3, + __c3 :1, + __busy :1; +}; +typedef _STRUCT_FP_STATUS __darwin_fp_status_t; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_FP_STATUS struct fp_status +_STRUCT_FP_STATUS +{ + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + stkflt :1, + errsumm :1, + c0 :1, + c1 :1, + c2 :1, + tos :3, + c3 :1, + busy :1; +}; +typedef _STRUCT_FP_STATUS fp_status_t; +#endif /* !__DARWIN_UNIX03 */ + +/* defn of 80bit x87 FPU or MMX register */ + +#if __DARWIN_UNIX03 +#define _STRUCT_MMST_REG struct __darwin_mmst_reg +_STRUCT_MMST_REG +{ + char __mmst_reg[10]; + char __mmst_rsrv[6]; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MMST_REG struct mmst_reg +_STRUCT_MMST_REG +{ + char mmst_reg[10]; + char mmst_rsrv[6]; +}; +#endif /* !__DARWIN_UNIX03 */ + + +/* defn of 128 bit XMM regs */ + +#if __DARWIN_UNIX03 +#define _STRUCT_XMM_REG struct __darwin_xmm_reg +_STRUCT_XMM_REG +{ + char __xmm_reg[16]; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_XMM_REG struct xmm_reg +_STRUCT_XMM_REG +{ + char xmm_reg[16]; +}; +#endif /* !__DARWIN_UNIX03 */ + +/* + * Floating point state. + */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define FP_STATE_BYTES 512 /* number of chars worth of data from fpu_fcw */ +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_FLOAT_STATE32 struct __darwin_i386_float_state +_STRUCT_X86_FLOAT_STATE32 +{ + int __fpu_reserved[2]; + _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ + __uint8_t __fpu_ftw; /* x87 FPU tag word */ + __uint8_t __fpu_rsrv1; /* reserved */ + __uint16_t __fpu_fop; /* x87 FPU Opcode */ + __uint32_t __fpu_ip; /* x87 FPU Instruction Pointer offset */ + __uint16_t __fpu_cs; /* x87 FPU Instruction Pointer Selector */ + __uint16_t __fpu_rsrv2; /* reserved */ + __uint32_t __fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ + __uint16_t __fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ + __uint16_t __fpu_rsrv3; /* reserved */ + __uint32_t __fpu_mxcsr; /* MXCSR Register state */ + __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ + char __fpu_rsrv4[14*16]; /* reserved */ + int __fpu_reserved1; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_FLOAT_STATE32 struct i386_float_state +_STRUCT_X86_FLOAT_STATE32 +{ + int fpu_reserved[2]; + _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ + __uint8_t fpu_ftw; /* x87 FPU tag word */ + __uint8_t fpu_rsrv1; /* reserved */ + __uint16_t fpu_fop; /* x87 FPU Opcode */ + __uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ + __uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ + __uint16_t fpu_rsrv2; /* reserved */ + __uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ + __uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ + __uint16_t fpu_rsrv3; /* reserved */ + __uint32_t fpu_mxcsr; /* MXCSR Register state */ + __uint32_t fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ + char fpu_rsrv4[14*16]; /* reserved */ + int fpu_reserved1; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_EXCEPTION_STATE32 struct __darwin_i386_exception_state +_STRUCT_X86_EXCEPTION_STATE32 +{ + unsigned int __trapno; + unsigned int __err; + unsigned int __faultvaddr; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_EXCEPTION_STATE32 struct i386_exception_state +_STRUCT_X86_EXCEPTION_STATE32 +{ + unsigned int trapno; + unsigned int err; + unsigned int faultvaddr; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_DEBUG_STATE32 struct __darwin_x86_debug_state32 +_STRUCT_X86_DEBUG_STATE32 +{ + unsigned int __dr0; + unsigned int __dr1; + unsigned int __dr2; + unsigned int __dr3; + unsigned int __dr4; + unsigned int __dr5; + unsigned int __dr6; + unsigned int __dr7; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_DEBUG_STATE32 struct x86_debug_state32 +_STRUCT_X86_DEBUG_STATE32 +{ + unsigned int dr0; + unsigned int dr1; + unsigned int dr2; + unsigned int dr3; + unsigned int dr4; + unsigned int dr5; + unsigned int dr6; + unsigned int dr7; +}; +#endif /* !__DARWIN_UNIX03 */ + +/* + * 64 bit versions of the above + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_THREAD_STATE64 struct __darwin_x86_thread_state64 +_STRUCT_X86_THREAD_STATE64 +{ + __uint64_t __rax; + __uint64_t __rbx; + __uint64_t __rcx; + __uint64_t __rdx; + __uint64_t __rdi; + __uint64_t __rsi; + __uint64_t __rbp; + __uint64_t __rsp; + __uint64_t __r8; + __uint64_t __r9; + __uint64_t __r10; + __uint64_t __r11; + __uint64_t __r12; + __uint64_t __r13; + __uint64_t __r14; + __uint64_t __r15; + __uint64_t __rip; + __uint64_t __rflags; + __uint64_t __cs; + __uint64_t __fs; + __uint64_t __gs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_THREAD_STATE64 struct x86_thread_state64 +_STRUCT_X86_THREAD_STATE64 +{ + __uint64_t rax; + __uint64_t rbx; + __uint64_t rcx; + __uint64_t rdx; + __uint64_t rdi; + __uint64_t rsi; + __uint64_t rbp; + __uint64_t rsp; + __uint64_t r8; + __uint64_t r9; + __uint64_t r10; + __uint64_t r11; + __uint64_t r12; + __uint64_t r13; + __uint64_t r14; + __uint64_t r15; + __uint64_t rip; + __uint64_t rflags; + __uint64_t cs; + __uint64_t fs; + __uint64_t gs; +}; +#endif /* !__DARWIN_UNIX03 */ + + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_FLOAT_STATE64 struct __darwin_x86_float_state64 +_STRUCT_X86_FLOAT_STATE64 +{ + int __fpu_reserved[2]; + _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ + __uint8_t __fpu_ftw; /* x87 FPU tag word */ + __uint8_t __fpu_rsrv1; /* reserved */ + __uint16_t __fpu_fop; /* x87 FPU Opcode */ + + /* x87 FPU Instruction Pointer */ + __uint32_t __fpu_ip; /* offset */ + __uint16_t __fpu_cs; /* Selector */ + + __uint16_t __fpu_rsrv2; /* reserved */ + + /* x87 FPU Instruction Operand(Data) Pointer */ + __uint32_t __fpu_dp; /* offset */ + __uint16_t __fpu_ds; /* Selector */ + + __uint16_t __fpu_rsrv3; /* reserved */ + __uint32_t __fpu_mxcsr; /* MXCSR Register state */ + __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ + _STRUCT_XMM_REG __fpu_xmm8; /* XMM 8 */ + _STRUCT_XMM_REG __fpu_xmm9; /* XMM 9 */ + _STRUCT_XMM_REG __fpu_xmm10; /* XMM 10 */ + _STRUCT_XMM_REG __fpu_xmm11; /* XMM 11 */ + _STRUCT_XMM_REG __fpu_xmm12; /* XMM 12 */ + _STRUCT_XMM_REG __fpu_xmm13; /* XMM 13 */ + _STRUCT_XMM_REG __fpu_xmm14; /* XMM 14 */ + _STRUCT_XMM_REG __fpu_xmm15; /* XMM 15 */ + char __fpu_rsrv4[6*16]; /* reserved */ + int __fpu_reserved1; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_FLOAT_STATE64 struct x86_float_state64 +_STRUCT_X86_FLOAT_STATE64 +{ + int fpu_reserved[2]; + _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ + __uint8_t fpu_ftw; /* x87 FPU tag word */ + __uint8_t fpu_rsrv1; /* reserved */ + __uint16_t fpu_fop; /* x87 FPU Opcode */ + + /* x87 FPU Instruction Pointer */ + __uint32_t fpu_ip; /* offset */ + __uint16_t fpu_cs; /* Selector */ + + __uint16_t fpu_rsrv2; /* reserved */ + + /* x87 FPU Instruction Operand(Data) Pointer */ + __uint32_t fpu_dp; /* offset */ + __uint16_t fpu_ds; /* Selector */ + + __uint16_t fpu_rsrv3; /* reserved */ + __uint32_t fpu_mxcsr; /* MXCSR Register state */ + __uint32_t fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ + _STRUCT_XMM_REG fpu_xmm8; /* XMM 8 */ + _STRUCT_XMM_REG fpu_xmm9; /* XMM 9 */ + _STRUCT_XMM_REG fpu_xmm10; /* XMM 10 */ + _STRUCT_XMM_REG fpu_xmm11; /* XMM 11 */ + _STRUCT_XMM_REG fpu_xmm12; /* XMM 12 */ + _STRUCT_XMM_REG fpu_xmm13; /* XMM 13 */ + _STRUCT_XMM_REG fpu_xmm14; /* XMM 14 */ + _STRUCT_XMM_REG fpu_xmm15; /* XMM 15 */ + char fpu_rsrv4[6*16]; /* reserved */ + int fpu_reserved1; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_EXCEPTION_STATE64 struct __darwin_x86_exception_state64 +_STRUCT_X86_EXCEPTION_STATE64 +{ + unsigned int __trapno; + unsigned int __err; + __uint64_t __faultvaddr; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_EXCEPTION_STATE64 struct x86_exception_state64 +_STRUCT_X86_EXCEPTION_STATE64 +{ + unsigned int trapno; + unsigned int err; + __uint64_t faultvaddr; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_DEBUG_STATE64 struct __darwin_x86_debug_state64 +_STRUCT_X86_DEBUG_STATE64 +{ + __uint64_t __dr0; + __uint64_t __dr1; + __uint64_t __dr2; + __uint64_t __dr3; + __uint64_t __dr4; + __uint64_t __dr5; + __uint64_t __dr6; + __uint64_t __dr7; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_DEBUG_STATE64 struct x86_debug_state64 +_STRUCT_X86_DEBUG_STATE64 +{ + __uint64_t dr0; + __uint64_t dr1; + __uint64_t dr2; + __uint64_t dr3; + __uint64_t dr4; + __uint64_t dr5; + __uint64_t dr6; + __uint64_t dr7; +}; +#endif /* !__DARWIN_UNIX03 */ + +#endif /* _MACH_I386__STRUCTS_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/asm.h.svn-base b/i386/include/mach/i386/.svn/text-base/asm.h.svn-base new file mode 100644 index 0000000..02a5620 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/asm.h.svn-base @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +#ifndef _I386_ASM_H_ +#define _I386_ASM_H_ + +#ifdef _KERNEL +#include <gprof.h> +#endif /* _KERNEL */ + +#ifdef MACH_KERNEL +#include <mach_kdb.h> +#else /* !MACH_KERNEL */ +#define MACH_KDB 0 +#endif /* !MACH_KERNEL */ + + +#if defined(MACH_KERNEL) || defined(_KERNEL) +#include <gprof.h> +#endif /* MACH_KERNEL || _KERNEL */ + +#if defined(__i386__) + +#define S_PC (%esp) +#define S_ARG0 4(%esp) +#define S_ARG1 8(%esp) +#define S_ARG2 12(%esp) +#define S_ARG3 16(%esp) +#define S_ARG4 20(%esp) + +#define FRAME pushl %ebp; movl %esp, %ebp +#define EMARF leave + +#define B_LINK (%ebp) +#define B_PC 4(%ebp) +#define B_ARG0 8(%ebp) +#define B_ARG1 12(%ebp) +#define B_ARG2 16(%ebp) +#define B_ARG3 20(%ebp) + +#elif defined(__x86_64__) + +#define S_PC (%rsp) + +#define FRAME pushq %rbp; movq %rsp, %rbp +#define EMARF leave + +#define B_LINK (%rbp) +#define B_PC 8(%rbp) + +#else +#error unsupported architecture +#endif + +/* There is another definition of ALIGN for .c sources */ +#ifdef ASSEMBLER +#define ALIGN 4,0x90 +#endif /* ASSEMBLER */ + +#ifndef FALIGN +#define FALIGN ALIGN +#endif + +#define LB(x,n) n +#if __STDC__ +#ifndef __NO_UNDERSCORES__ +#define LCL(x) L ## x +#define EXT(x) _ ## x +#define LEXT(x) _ ## x ## : +#else +#define LCL(x) .L ## x +#define EXT(x) x +#define LEXT(x) x ## : +#endif +#define LBc(x,n) n ## : +#define LBb(x,n) n ## b +#define LBf(x,n) n ## f +#else /* __STDC__ */ +#ifndef __NO_UNDERSCORES__ +#define LCL(x) L/**/x +#define EXT(x) _/**/x +#define LEXT(x) _/**/x/**/: +#else /* __NO_UNDERSCORES__ */ +#define LCL(x) .L/**/x +#define EXT(x) x +#define LEXT(x) x/**/: +#endif /* __NO_UNDERSCORES__ */ +#define LBc(x,n) n/**/: +#define LBb(x,n) n/**/b +#define LBf(x,n) n/**/f +#endif /* __STDC__ */ + +#define SVC .byte 0x9a; .long 0; .word 0x7 + +#define RPC_SVC .byte 0x9a; .long 0; .word 0xf + +#define String .asciz +#define Value .word +#define Times(a,b) (a*b) +#define Divide(a,b) (a/b) + +#define INB inb %dx, %al +#define OUTB outb %al, %dx +#define INL inl %dx, %eax +#define OUTL outl %eax, %dx + +#define data16 .byte 0x66 +#define addr16 .byte 0x67 + +#if !GPROF +#define MCOUNT + +#elif defined(__SHARED__) +#define MCOUNT ; .data;\ + .align ALIGN;\ + LBc(x, 8) .long 0;\ + .text;\ + Gpush;\ + Gload;\ + leal Gotoff(LBb(x,8)),%edx;\ + Egaddr(%eax,_mcount_ptr);\ + Gpop;\ + call *(%eax); + +#else /* !GPROF, !__SHARED__ */ +#define MCOUNT ; call mcount; +#endif /* GPROF */ + +#ifdef __ELF__ +#define ELF_FUNC(x) .type x,@function +#define ELF_DATA(x) .type x,@object +#define ELF_SIZE(x,s) .size x,s +#else +#define ELF_FUNC(x) +#define ELF_DATA(x) +#define ELF_SIZE(x,s) +#endif + +#define Entry(x) .globl EXT(x); ELF_FUNC(EXT(x)); .align FALIGN; LEXT(x) +#define ENTRY(x) Entry(x) MCOUNT +#define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ + ELF_FUNC(EXT(x)); ELF_FUNC(EXT(y)); \ + .align FALIGN; LEXT(x); LEXT(y) \ + MCOUNT +#if __STDC__ +#define ASENTRY(x) .globl x; .align FALIGN; x ## : ELF_FUNC(x) MCOUNT +#else +#define ASENTRY(x) .globl x; .align FALIGN; x: ELF_FUNC(x) MCOUNT +#endif /* __STDC__ */ + +#define DATA(x) .globl EXT(x); ELF_DATA(EXT(x)); .align ALIGN; LEXT(x) + +#define End(x) ELF_SIZE(x,.-x) +#define END(x) End(EXT(x)) +#define ENDDATA(x) END(x) +#define Enddata(x) End(x) + +/* + * ELF shared library accessor macros. + * Gpush saves the %ebx register used for the GOT address + * Gpop pops %ebx if we need a GOT + * Gload loads %ebx with the GOT address if shared libraries are used + * Gcall calls an external function. + * Gotoff allows you to reference local labels. + * Gotoff2 allows you to reference local labels with an index reg. + * Gotoff3 allows you to reference local labels with an index reg & size. + * Gaddr loads up a register with an address of an external item. + * Gstack is the number of bytes that Gpush pushes on the stack. + * + * Varients of the above with E or L prefixes do EXT(name) or LCL(name) + * respectively. + */ + +#ifndef __SHARED__ +#define Gpush +#define Gpop +#define Gload +#define Gcall(func) call func +#define Gotoff(lab) lab +#define Gotoff2(l,r) l(r) +#define Gotoff3(l,r,s) l(,r,s) +#define Gaddr(to,lab) movl $lab,to +#define Gcmp(lab,reg) cmpl $lab,reg +#define Gmemload(lab,reg) movl lab,reg +#define Gmemstore(reg,lab,tmp) movl reg,lab +#define Gstack 0 + +#else +#ifdef __ELF__ /* ELF shared libraries */ +#define Gpush pushl %ebx +#define Gpop popl %ebx +#define Gload call 9f; 9: popl %ebx; addl $_GLOBAL_OFFSET_TABLE_+[.-9b],%ebx +#define Gcall(func) call EXT(func)@PLT +#define Gotoff(lab) lab@GOTOFF(%ebx) +#define Gotoff2(l,r) l@GOTOFF(%ebx,r) +#define Gotoff3(l,r,s) l@GOTOFF(%ebx,r,s) +#define Gaddr(to,lab) movl lab@GOT(%ebx),to +#define Gcmp(lab,reg) cmpl reg,lab@GOT(%ebx) +#define Gmemload(lab,reg) movl lab@GOT(%ebx),reg; movl (reg),reg +#define Gmemstore(reg,lab,tmp) movl lab@GOT(%ebx),tmp; movl reg,(tmp) +#define Gstack 4 + +#else /* ROSE shared libraries */ +#define Gpush +#define Gpop +#define Gload +#define Gcall(func) call *9f; .data; .align ALIGN; 9: .long func; .text +#define Gotoff(lab) lab +#define Gotoff2(l,r) l(r) +#define Gotoff3(l,r,s) l(,r,s) +#define Gaddr(to,lab) movl 9f,to; .data; .align ALIGN; 9: .long lab; .text +#define Gcmp(lab,reg) cmpl reg,9f; .data; .align ALIGN; 9: .long lab; .text +#define Gmemload(lab,reg) movl 9f,reg; movl (reg),reg; .data; .align ALIGN; 9: .long lab; .text +#define Gmemstore(reg,lab,tmp) movl 9f,tmp; movl reg,(tmp); .data; .align ALIGN; 9: .long lab; .text +#define Gstack 0 +#endif /* __ELF__ */ +#endif /* __SHARED__ */ + +/* Egotoff is not provided, since external symbols should not use @GOTOFF + relocations. */ +#define Egcall(func) Gcall(EXT(func)) +#define Egaddr(to,lab) Gaddr(to,EXT(lab)) +#define Egcmp(lab,reg) Gcmp(EXT(lab),reg) +#define Egmemload(lab,reg) Gmemload(EXT(lab),reg) +#define Egmemstore(reg,lab,tmp) Gmemstore(reg,EXT(lab),tmp) + +#define Lgotoff(lab) Gotoff(LCL(lab)) +#define Lgotoff2(l,r) Gotoff2(LCL(l),r) +#define Lgotoff3(l,r,s) Gotoff3(LCL(l),r,s) +#define Lgcmp(lab,reg) Gcmp(LCL(lab),reg) +#define Lgmemload(lab,reg) movl Lgotoff(lab),reg +#define Lgmemstore(reg,lab,tmp) movl reg,Lgotoff(lab) + +#ifdef ASSEMBLER +#if MACH_KDB +#include <ddb/stab.h> +/* + * This pseudo-assembler line is added so that there will be at least + * one N_SO entry in the symbol stable to define the current file name. + */ +#endif /* MACH_KDB */ + +#else /* NOT ASSEMBLER */ + +/* These defines are here for .c files that wish to reference global symbols + * within __asm__ statements. + */ +#ifndef __NO_UNDERSCORES__ +#define CC_SYM_PREFIX "_" +#else +#define CC_SYM_PREFIX "" +#endif /* __NO_UNDERSCORES__ */ +#endif /* ASSEMBLER */ + +#endif /* _I386_ASM_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/boolean.h.svn-base b/i386/include/mach/i386/.svn/text-base/boolean.h.svn-base new file mode 100644 index 0000000..100f7e7 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/boolean.h.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: boolean.h + * + * Boolean type, for I386. + */ + +#ifndef _MACH_I386_BOOLEAN_H_ +#define _MACH_I386_BOOLEAN_H_ + +#if defined(__x86_64__) && !defined(KERNEL) +typedef unsigned int boolean_t; +#else +typedef int boolean_t; +#endif + +#endif /* _MACH_I386_BOOLEAN_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/exception.h.svn-base b/i386/include/mach/i386/.svn/text-base/exception.h.svn-base new file mode 100644 index 0000000..77fe4e4 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/exception.h.svn-base @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_I386_EXCEPTION_H_ +#define _MACH_I386_EXCEPTION_H_ + +/* + * No machine dependent types for the 80386 + */ + +#define EXC_TYPES_COUNT 11 /* incl. illegal exception 0 */ + +/* + * Codes and subcodes for 80386 exceptions. + */ + +#define EXCEPTION_CODE_MAX 2 /* currently code and subcode */ + +/* + * EXC_BAD_INSTRUCTION + */ + +#define EXC_I386_INVOP 1 + +/* + * EXC_ARITHMETIC + */ + +#define EXC_I386_DIV 1 +#define EXC_I386_INTO 2 +#define EXC_I386_NOEXT 3 +#define EXC_I386_EXTOVR 4 +#define EXC_I386_EXTERR 5 +#define EXC_I386_EMERR 6 +#define EXC_I386_BOUND 7 +#define EXC_I386_SSEEXTERR 8 + +/* + * EXC_SOFTWARE + * Note: 0x10000-0x10003 in use for unix signal + */ + +/* + * EXC_BAD_ACCESS + */ + +/* + * EXC_BREAKPOINT + */ + +#define EXC_I386_SGL 1 +#define EXC_I386_BPT 2 + +#define EXC_I386_DIVERR 0 /* divide by 0 eprror */ +#define EXC_I386_SGLSTP 1 /* single step */ +#define EXC_I386_NMIFLT 2 /* NMI */ +#define EXC_I386_BPTFLT 3 /* breakpoint fault */ +#define EXC_I386_INTOFLT 4 /* INTO overflow fault */ +#define EXC_I386_BOUNDFLT 5 /* BOUND instruction fault */ +#define EXC_I386_INVOPFLT 6 /* invalid opcode fault */ +#define EXC_I386_NOEXTFLT 7 /* extension not available fault*/ +#define EXC_I386_DBLFLT 8 /* double fault */ +#define EXC_I386_EXTOVRFLT 9 /* extension overrun fault */ +#define EXC_I386_INVTSSFLT 10 /* invalid TSS fault */ +#define EXC_I386_SEGNPFLT 11 /* segment not present fault */ +#define EXC_I386_STKFLT 12 /* stack fault */ +#define EXC_I386_GPFLT 13 /* general protection fault */ +#define EXC_I386_PGFLT 14 /* page fault */ +#define EXC_I386_EXTERRFLT 16 /* extension error fault */ +#define EXC_I386_ALIGNFLT 17 /* Alignment fault */ +#define EXC_I386_ENDPERR 33 /* emulated extension error flt */ +#define EXC_I386_ENOEXTFLT 32 /* emulated ext not present */ + + +/* + * machine dependent exception masks + */ +#define EXC_MASK_MACHINE 0 + +#endif /* _MACH_I386_EXCEPTION_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/fp_reg.h.svn-base b/i386/include/mach/i386/.svn/text-base/fp_reg.h.svn-base new file mode 100644 index 0000000..47a26a9 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/fp_reg.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1992-1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _I386_FP_SAVE_H_ +#define _I386_FP_SAVE_H_ + + +/* note when allocating this data structure, it must be 16 byte aligned. */ +struct x86_fx_save { + unsigned short fx_control; /* control */ + unsigned short fx_status; /* status */ + unsigned char fx_tag; /* register tags */ + unsigned char fx_bbz1; /* better be zero when calling fxrtstor */ + unsigned short fx_opcode; + unsigned int fx_eip; /* eip instruction */ + unsigned short fx_cs; /* cs instruction */ + unsigned short fx_bbz2; /* better be zero when calling fxrtstor */ + unsigned int fx_dp; /* data address */ + unsigned short fx_ds; /* data segment */ + unsigned short fx_bbz3; /* better be zero when calling fxrtstor */ + unsigned int fx_MXCSR; + unsigned int fx_MXCSR_MASK; + unsigned short fx_reg_word[8][8]; /* STx/MMx registers */ + unsigned short fx_XMM_reg[8][16]; /* XMM0-XMM15 on 64 bit processors */ + /* XMM0-XMM7 on 32 bit processors... unused storage reserved */ + unsigned char fx_reserved[16*6]; /* reserved by intel for future expansion */ +}; + + +/* + * Control register + */ +#define FPC_IE 0x0001 /* enable invalid operation + exception */ +#define FPC_IM FPC_IE +#define FPC_DE 0x0002 /* enable denormalized operation + exception */ +#define FPC_DM FPC_DE +#define FPC_ZE 0x0004 /* enable zero-divide exception */ +#define FPC_ZM FPC_ZE +#define FPC_OE 0x0008 /* enable overflow exception */ +#define FPC_OM FPC_OE +#define FPC_UE 0x0010 /* enable underflow exception */ +#define FPC_PE 0x0020 /* enable precision exception */ +#define FPC_PC 0x0300 /* precision control: */ +#define FPC_PC_24 0x0000 /* 24 bits */ +#define FPC_PC_53 0x0200 /* 53 bits */ +#define FPC_PC_64 0x0300 /* 64 bits */ +#define FPC_RC 0x0c00 /* rounding control: */ +#define FPC_RC_RN 0x0000 /* round to nearest or even */ +#define FPC_RC_RD 0x0400 /* round down */ +#define FPC_RC_RU 0x0800 /* round up */ +#define FPC_RC_CHOP 0x0c00 /* chop */ +#define FPC_IC 0x1000 /* infinity control (obsolete) */ +#define FPC_IC_PROJ 0x0000 /* projective infinity */ +#define FPC_IC_AFF 0x1000 /* affine infinity (std) */ + +/* + * Status register + */ +#define FPS_IE 0x0001 /* invalid operation */ +#define FPS_DE 0x0002 /* denormalized operand */ +#define FPS_ZE 0x0004 /* divide by zero */ +#define FPS_OE 0x0008 /* overflow */ +#define FPS_UE 0x0010 /* underflow */ +#define FPS_PE 0x0020 /* precision */ +#define FPS_SF 0x0040 /* stack flag */ +#define FPS_ES 0x0080 /* error summary */ +#define FPS_C0 0x0100 /* condition code bit 0 */ +#define FPS_C1 0x0200 /* condition code bit 1 */ +#define FPS_C2 0x0400 /* condition code bit 2 */ +#define FPS_TOS 0x3800 /* top-of-stack pointer */ +#define FPS_TOS_SHIFT 11 +#define FPS_C3 0x4000 /* condition code bit 3 */ +#define FPS_BUSY 0x8000 /* FPU busy */ + +/* + * Kind of floating-point support provided by kernel. + */ +#define FP_NO 0 /* no floating point */ +#define FP_SOFT 1 /* software FP emulator */ +#define FP_287 2 /* 80287 */ +#define FP_387 3 /* 80387 or 80486 */ +#define FP_FXSR 4 /* Fast save/restore SIMD Extension */ + +#endif /* _I386_FP_SAVE_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/kern_return.h.svn-base b/i386/include/mach/i386/.svn/text-base/kern_return.h.svn-base new file mode 100644 index 0000000..a9df708 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/kern_return.h.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: kern_return.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine-dependent kernel return definitions. + */ + +#ifndef _MACH_I386_KERN_RETURN_H_ +#define _MACH_I386_KERN_RETURN_H_ + +#ifndef ASSEMBLER +typedef int kern_return_t; +#endif /* ASSEMBLER */ + +#endif /* _MACH_I386_KERN_RETURN_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/machine_types.defs.svn-base b/i386/include/mach/i386/.svn/text-base/machine_types.defs.svn-base new file mode 100644 index 0000000..6a35615 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/machine_types.defs.svn-base @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Header file for basic, machine-dependent data types. i386 version. + */ + +#ifndef _MACHINE_VM_TYPES_DEFS_ +#define _MACHINE_VM_TYPES_DEFS_ 1 + +type short = int16_t; +type int = int32_t; +type unsigned = uint32_t; + +type float = MACH_MSG_TYPE_REAL_32; +type double = MACH_MSG_TYPE_REAL_64; + + +/* from ISO/IEC 988:1999 spec */ +/* 7.18.1.4 Integer types capable of hgolding object pointers */ +/* + * The [u]intptr_t types for the native + * integer type, e.g. 32 or 64 or.. whatever + * register size the machine has. They are + * used for entities that might be either + * [unsigned] integers or pointers, and for + * type-casting between the two. + * + * For instance, the IPC system represents + * a port in user space as an integer and + * in kernel space as a pointer. + */ +#if defined(__LP64__) +type uintptr_t = uint64_t; +type intptr_t = int64_t; +#else +type uintptr_t = uint32_t; +type intptr_t = int32_t; +#endif + +/* + * These are the legacy Mach types that are + * the [rough] equivalents of the standards above. + * They were defined in terms of int, not + * long int, so they remain separate. + */ +#if defined(__LP64__) +type register_t = int64_t; +#else +type register_t = int32_t; +#endif +type integer_t = int32_t; +type natural_t = uint32_t; + +/* + * These are the VM types that scale with the address + * space size of a given process. + */ + +#if defined(__LP64__) +type vm_address_t = uint64_t; +type vm_offset_t = uint64_t; +type vm_size_t = uint64_t; +#else +type vm_address_t = natural_t; +type vm_offset_t = natural_t; +type vm_size_t = natural_t; +#endif + +/* + * The mach_vm_xxx_t types are sized to hold the + * maximum pointer, offset, etc... supported on the + * platform. + */ +type mach_vm_address_t = uint64_t; +type mach_vm_offset_t = uint64_t; +type mach_vm_size_t = uint64_t; + +#if MACH_IPC_COMPAT +/* + * For the old IPC interface + */ +#define MSG_TYPE_PORT_NAME natural_t + +#endif /* MACH_IPC_COMPAT */ + +/* + * These are types used internal to Mach to implement the + * legacy 32-bit VM APIs published by the kernel. + */ +#define VM32_SUPPORT 1 + +type vm32_address_t = uint32_t; +type vm32_offset_t = uint32_t; +type vm32_size_t = uint32_t; + +#endif /* _MACHINE_VM_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/i386/.svn/text-base/ndr_def.h.svn-base b/i386/include/mach/i386/.svn/text-base/ndr_def.h.svn-base new file mode 100644 index 0000000..5163f63 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/ndr_def.h.svn-base @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* NDR record for Intel x86s */ + +#include <mach/ndr.h> + +NDR_record_t NDR_record = { + 0, /* mig_reserved */ + 0, /* mig_reserved */ + 0, /* mig_reserved */ + NDR_PROTOCOL_2_0, + NDR_INT_LITTLE_ENDIAN, + NDR_CHAR_ASCII, + NDR_FLOAT_IEEE, + 0, +}; diff --git a/i386/include/mach/i386/.svn/text-base/processor_info.h.svn-base b/i386/include/mach/i386/.svn/text-base/processor_info.h.svn-base new file mode 100644 index 0000000..8272c6d --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/processor_info.h.svn-base @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * File: mach/i386/processor_info.h + * + * Data structure definitions for i386 specific processor control + */ + +#ifndef _MACH_I386_PROCESSOR_INFO_H_ +#define _MACH_I386_PROCESSOR_INFO_H_ + +#endif /* _MACH_I386_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/rpc.h.svn-base b/i386/include/mach/i386/.svn/text-base/rpc.h.svn-base new file mode 100644 index 0000000..55561f9 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/rpc.h.svn-base @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_I386_RPC_H_ +#define _MACH_I386_RPC_H_ + +#endif /* _MACH_I386_RPC_H_ */ + diff --git a/i386/include/mach/i386/.svn/text-base/sdt_isa.h.svn-base b/i386/include/mach/i386/.svn/text-base/sdt_isa.h.svn-base new file mode 100644 index 0000000..7934a2c --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/sdt_isa.h.svn-base @@ -0,0 +1,412 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_I386_SDT_ISA_H +#define _MACH_I386_SDT_ISA_H + +/* + * Only define when testing. This makes the calls into actual calls to + * test functions. + */ +/* #define DTRACE_CALL_TEST */ + +#define DTRACE_STRINGIFY(s) #s +#define DTRACE_TOSTRING(s) DTRACE_STRINGIFY(s) +#define DTRACE_LABEL(p, n) \ + "__dtrace_probe$" DTRACE_TOSTRING(__LINE__) DTRACE_STRINGIFY(_##p##___##n) ":" "\n\t" + +#ifdef DTRACE_CALL_TEST + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_CALL_INSN(p,n) + +#else + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_NOPS + +#endif + +#ifdef __x86_64__ + +#define DTRACE_NOPS \ + "nop" "\n\t" \ + "nop" "\n\t" \ + "nop" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "call _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 3 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 5 +#define ARGS6_EXTENT 6 +#define ARGS7_EXTENT 7 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 10 +#define ARGS10_EXTENT 10 + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ( \ + DTRACE_CALL(provider, name) \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + "movq\t0x20(%0),%%r8" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx", "r8" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + "movq\t0x20(%0),%%r8" "\n\t" \ + "movq\t0x28(%0),%%r9" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subq\t$0x8,%%rsp" "\n\t" \ + "movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + "movq\t0x20(%0),%%r8" "\n\t" \ + "movq\t0x28(%0),%%r9" "\n\t" \ + "movq\t0x30(%0),%%rax" "\n\t" \ + "movq\t%%rax,0x0(%%rsp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addq\t$0x8,%%rsp" "\n\t" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "rax" \ + ); + +#endif // __x86_64__ + +#ifdef __i386__ + +#define DTRACE_NOPS \ + "nop" "\n\t" \ + "leal 0(%%esi), %%esi" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "call _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 4 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 8 +#define ARGS6_EXTENT 8 +#define ARGS7_EXTENT 8 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 12 +#define ARGS10_EXTENT 12 + +/* + * Because this code is used in the kernel, we must not touch any floating point + * or specialized registers. This leaves the following registers: + * + * eax ; volatile, safe to use + * ebx ; PIC register, gcc error when used + * ecx ; volatile, safe to use + * edx ; volatile, safe to use + * esi ; non-volatile, otherwise safe to use + * edi ; non-volatile, otherwise safe to use + * + * Using any of the non volatile register causes a spill to stack which is almost + * certainly a net performance loss. Also, note that the array ref (__dtrace_args) + * consumes one free register. If all three of the volatile regs are used for load/store, + * the compiler will spill a register to hold the array ref. + * + * The end result is that we only pipeline two loads/stores at a time. Blech. + */ + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ( \ + DTRACE_CALL(provider, name) \ + "# eat trailing nl +tabfrom DTRACE_CALL" \ + : \ + : \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL8ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t0x1C(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + "movl\t%%edx,0x1C(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL9ARGS(provider, name) \ + asm volatile ("subl\t$0x30,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t0x1C(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + "movl\t%%edx,0x1C(%%esp)" "\n\t" \ + "movl\t0x20(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x20(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x30,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL10ARGS(provider, name) \ + asm volatile ("subl\t$0x30,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t0x1C(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + "movl\t%%edx,0x1C(%%esp)" "\n\t" \ + "movl\t0x20(%0),%%eax" "\n\t" \ + "movl\t0x24(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x20(%%esp)" "\n\t" \ + "movl\t%%edx,0x24(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x30,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#endif // __i386__ + +#endif /* _MACH_I386_SDT_ISA_H */ diff --git a/i386/include/mach/i386/.svn/text-base/task.h.svn-base b/i386/include/mach/i386/.svn/text-base/task.h.svn-base new file mode 100644 index 0000000..15c8248 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/task.h.svn-base @@ -0,0 +1,1578 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 35 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +/* Routine task_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine task_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; + __Request__task_get_state_t Request_task_get_state; + __Request__task_set_state_t Request_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; + __Reply__task_get_state_t Reply_task_get_state; + __Reply__task_set_state_t Reply_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 },\ + { "task_get_state", 3433 },\ + { "task_set_state", 3434 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/i386/include/mach/i386/.svn/text-base/thread_act.h.svn-base b/i386/include/mach/i386/.svn/text-base/thread_act.h.svn-base new file mode 100644 index 0000000..fde4189 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/thread_act.h.svn-base @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/i386/include/mach/i386/.svn/text-base/thread_state.h.svn-base b/i386/include/mach/i386/.svn/text-base/thread_state.h.svn-base new file mode 100644 index 0000000..dba05b9 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/thread_state.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_I386_THREAD_STATE_H_ +#define _MACH_I386_THREAD_STATE_H_ + +/* Size of maximum exported thread state in words */ +#define I386_THREAD_STATE_MAX (144) /* Size of biggest state possible */ + +#if defined (__i386__) || defined(__x86_64__) +#define THREAD_STATE_MAX I386_THREAD_STATE_MAX +#endif + +#endif /* _MACH_I386_THREAD_STATE_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/thread_status.h.svn-base b/i386/include/mach/i386/.svn/text-base/thread_status.h.svn-base new file mode 100644 index 0000000..65773e3 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/thread_status.h.svn-base @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: thread_status.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * This file contains the structure definitions for the thread + * state as applied to I386 processors. + */ + +#ifndef _MACH_I386_THREAD_STATUS_H_ +#define _MACH_I386_THREAD_STATUS_H_ + +#include <mach/i386/_structs.h> +#include <mach/message.h> +#include <mach/i386/fp_reg.h> +#include <mach/i386/thread_state.h> +#include <i386/eflags.h> + +/* + * the i386_xxxx form is kept for legacy purposes since these types + * are externally known... eventually they should be deprecated. + * our internal implementation has moved to the following naming convention + * + * x86_xxxx32 names are used to deal with 32 bit states + * x86_xxxx64 names are used to deal with 64 bit states + * x86_xxxx names are used to deal with either 32 or 64 bit states + * via a self-describing mechanism + */ + +/* + * these are the legacy names which should be deprecated in the future + * they are externally known which is the only reason we don't just get + * rid of them + */ +#define i386_THREAD_STATE 1 +#define i386_FLOAT_STATE 2 +#define i386_EXCEPTION_STATE 3 + +/* + * THREAD_STATE_FLAVOR_LIST 0 + * these are the supported flavors + */ +#define x86_THREAD_STATE32 1 +#define x86_FLOAT_STATE32 2 +#define x86_EXCEPTION_STATE32 3 +#define x86_THREAD_STATE64 4 +#define x86_FLOAT_STATE64 5 +#define x86_EXCEPTION_STATE64 6 +#define x86_THREAD_STATE 7 +#define x86_FLOAT_STATE 8 +#define x86_EXCEPTION_STATE 9 +#define x86_DEBUG_STATE32 10 +#define x86_DEBUG_STATE64 11 +#define x86_DEBUG_STATE 12 +#define THREAD_STATE_NONE 13 + +/* + * Largest state on this machine: + * (be sure mach/machine/thread_state.h matches!) + */ +#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX + +/* + * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed + * an exception flavor will return if that is a defined flavor for that + * platform. The macro must be manually updated to include all of the valid + * exception flavors as defined above. + */ +#define VALID_THREAD_STATE_FLAVOR(x) \ + ((x == x86_THREAD_STATE32) || \ + (x == x86_FLOAT_STATE32) || \ + (x == x86_EXCEPTION_STATE32) || \ + (x == x86_DEBUG_STATE32) || \ + (x == x86_THREAD_STATE64) || \ + (x == x86_FLOAT_STATE64) || \ + (x == x86_EXCEPTION_STATE64) || \ + (x == x86_DEBUG_STATE64) || \ + (x == x86_THREAD_STATE) || \ + (x == x86_FLOAT_STATE) || \ + (x == x86_EXCEPTION_STATE) || \ + (x == x86_DEBUG_STATE) || \ + (x == THREAD_STATE_NONE)) + +struct x86_state_hdr { + int flavor; + int count; +}; +typedef struct x86_state_hdr x86_state_hdr_t; + +/* + * Default segment register values. + */ + +#define USER_CODE_SELECTOR 0x0017 +#define USER_DATA_SELECTOR 0x001f +#define KERN_CODE_SELECTOR 0x0008 +#define KERN_DATA_SELECTOR 0x0010 + +/* + * to be deprecated in the future + */ +typedef _STRUCT_X86_THREAD_STATE32 i386_thread_state_t; +#define i386_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (i386_thread_state_t) / sizeof (int) )) + +typedef _STRUCT_X86_THREAD_STATE32 x86_thread_state32_t; +#define x86_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_thread_state32_t) / sizeof (int) )) + +/* + * to be deprecated in the future + */ +typedef _STRUCT_X86_FLOAT_STATE32 i386_float_state_t; +#define i386_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(i386_float_state_t)/sizeof(unsigned int))) + +typedef _STRUCT_X86_FLOAT_STATE32 x86_float_state32_t; +#define x86_FLOAT_STATE32_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_float_state32_t)/sizeof(unsigned int))) + +/* + * to be deprecated in the future + */ +typedef _STRUCT_X86_EXCEPTION_STATE32 i386_exception_state_t; +#define i386_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (i386_exception_state_t) / sizeof (int) )) + +typedef _STRUCT_X86_EXCEPTION_STATE32 x86_exception_state32_t; +#define x86_EXCEPTION_STATE32_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_exception_state32_t) / sizeof (int) )) + +#define I386_EXCEPTION_STATE_COUNT i386_EXCEPTION_STATE_COUNT + +typedef _STRUCT_X86_DEBUG_STATE32 x86_debug_state32_t; +#define x86_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_debug_state32_t) / sizeof (int) )) + +#define X86_DEBUG_STATE32_COUNT x86_DEBUG_STATE32_COUNT + +typedef _STRUCT_X86_THREAD_STATE64 x86_thread_state64_t; +#define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_thread_state64_t) / sizeof (int) )) + +typedef _STRUCT_X86_FLOAT_STATE64 x86_float_state64_t; +#define x86_FLOAT_STATE64_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_float_state64_t)/sizeof(unsigned int))) + +typedef _STRUCT_X86_EXCEPTION_STATE64 x86_exception_state64_t; +#define x86_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_exception_state64_t) / sizeof (int) )) + +#define X86_EXCEPTION_STATE64_COUNT x86_EXCEPTION_STATE64_COUNT + +typedef _STRUCT_X86_DEBUG_STATE64 x86_debug_state64_t; +#define x86_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_debug_state64_t) / sizeof (int) )) + +#define X86_DEBUG_STATE64_COUNT x86_DEBUG_STATE64_COUNT + +/* + * Combined thread, float and exception states + */ +struct x86_thread_state { + x86_state_hdr_t tsh; + union { + x86_thread_state32_t ts32; + x86_thread_state64_t ts64; + } uts; +}; + +struct x86_float_state { + x86_state_hdr_t fsh; + union { + x86_float_state32_t fs32; + x86_float_state64_t fs64; + } ufs; +}; + +struct x86_exception_state { + x86_state_hdr_t esh; + union { + x86_exception_state32_t es32; + x86_exception_state64_t es64; + } ues; +}; + +struct x86_debug_state { + x86_state_hdr_t dsh; + union { + x86_debug_state32_t ds32; + x86_debug_state64_t ds64; + } uds; +}; + +typedef struct x86_thread_state x86_thread_state_t; +#define x86_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_thread_state_t) / sizeof (int) )) + +typedef struct x86_float_state x86_float_state_t; +#define x86_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_float_state_t)/sizeof(unsigned int))) + +typedef struct x86_exception_state x86_exception_state_t; +#define x86_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_exception_state_t)/sizeof(unsigned int))) + +typedef struct x86_debug_state x86_debug_state_t; +#define x86_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_debug_state_t)/sizeof(unsigned int))) + +/* + * Machine-independent way for servers and Mach's exception mechanism to + * choose the most efficient state flavor for exception RPC's: + */ +#define MACHINE_THREAD_STATE x86_THREAD_STATE +#define MACHINE_THREAD_STATE_COUNT x86_THREAD_STATE_COUNT + +/* + * when reloading the segment registers on + * a return out of the kernel, we may take + * a GeneralProtection or SegmentNotPresent + * fault if one or more of the segment + * registers in the saved state was improperly + * specified via an x86_THREAD_STATE32 call + * the frame we push on top of the existing + * save area looks like this... we need to + * carry this as part of the save area + * in case we get hit so that we have a big + * enough stack + */ +struct x86_seg_load_fault32 { + unsigned int trapno; + unsigned int err; + unsigned int eip; + unsigned int cs; + unsigned int efl; +}; + + +#endif /* _MACH_I386_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/vm_param.h.svn-base b/i386/include/mach/i386/.svn/text-base/vm_param.h.svn-base new file mode 100644 index 0000000..edcb834 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/vm_param.h.svn-base @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Copyright (c) 1994 The University of Utah and + * the Computer Systems Laboratory at the University of Utah (CSL). + * All rights reserved. + * + * Permission to use, copy, modify and distribute this software is hereby + * granted provided that (1) source code retains these copyright, permission, + * and disclaimer notices, and (2) redistributions including binaries + * reproduce the notices in supporting documentation, and (3) all advertising + * materials mentioning features or use of this software display the following + * acknowledgement: ``This product includes software developed by the + * Computer Systems Laboratory at the University of Utah.'' + * + * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS + * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF + * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * CSL requests users of this software to return to csl-dist@cs.utah.edu any + * improvements that they make and grant CSL redistribution rights. + * + */ + +/* + * File: vm_param.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * I386 machine dependent virtual memory parameters. + * Most of the declarations are preceeded by I386_ (or i386_) + * which is OK because only I386 specific code will be using + * them. + */ + +#ifndef _MACH_I386_VM_PARAM_H_ +#define _MACH_I386_VM_PARAM_H_ + +#define BYTE_SIZE 8 /* byte size in bits */ + +#define I386_PGBYTES 4096 /* bytes per 80386 page */ +#define I386_PGSHIFT 12 /* bitshift for pages */ + +#define PAGE_SIZE I386_PGBYTES +#define PAGE_SHIFT I386_PGSHIFT +#define PAGE_MASK (PAGE_SIZE - 1) + +#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */ +#define I386_LPGSHIFT 21 /* bitshift for large pages */ +#define I386_LPGMASK (I386_LPGBYTES-1) + +/* + * Convert bytes to pages and convert pages to bytes. + * No rounding is used. + */ + +#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT)) +#define machine_btop(x) i386_btop(x) +#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT) + +/* + * Round off or truncate to the nearest page. These will work + * for either addresses or counts. (i.e. 1 byte rounds to 1 page + * bytes. + */ + +#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \ + ~(I386_PGBYTES-1)) +#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1)) + + + +#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) +/* + * default top of user stack... it grows down from here + */ +#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) +#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) +/* + * the end of the usable user address space , for now about 47 bits. + * the 64 bit commpage is past the end of this + */ +#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL) +/* + * canonical end of user address space for limits checking + */ +#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL) + + +/* system-wide values */ +#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) +#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) + +/* process-relative values (all 32-bit legacy only for now) */ +#define VM_MIN_ADDRESS ((vm_offset_t) 0) +#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000) +#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000) + + + +#endif /* _MACH_I386_VM_PARAM_H_ */ diff --git a/i386/include/mach/i386/.svn/text-base/vm_types.h.svn-base b/i386/include/mach/i386/.svn/text-base/vm_types.h.svn-base new file mode 100644 index 0000000..2c38fa2 --- /dev/null +++ b/i386/include/mach/i386/.svn/text-base/vm_types.h.svn-base @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: vm_types.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Header file for VM data types. I386 version. + */ + +#ifndef _MACH_I386_VM_TYPES_H_ +#define _MACH_I386_VM_TYPES_H_ + +#ifndef ASSEMBLER + +#include <i386/_types.h> +#include <mach/i386/vm_param.h> +#include <stdint.h> + +/* + * natural_t and integer_t are Mach's legacy types for machine- + * independent integer types (unsigned, and signed, respectively). + * Their original purpose was to define other types in a machine/ + * compiler independent way. + * + * They also had an implicit "same size as pointer" characteristic + * to them (i.e. Mach's traditional types are very ILP32 or ILP64 + * centric). We support x86 ABIs that do not follow either of + * these models (specifically LP64). Therefore, we had to make a + * choice between making these types scale with pointers or stay + * tied to integers. Because their use is predominantly tied to + * to the size of an integer, we are keeping that association and + * breaking free from pointer size guarantees. + * + * New use of these types is discouraged. + */ +typedef __darwin_natural_t natural_t; +typedef int integer_t; + +/* + * A vm_offset_t is a type-neutral pointer, + * e.g. an offset into a virtual memory space. + */ +#ifdef __LP64__ +typedef uintptr_t vm_offset_t; +#else /* __LP64__ */ +typedef natural_t vm_offset_t; +#endif /* __LP64__ */ + +/* + * A vm_size_t is the proper type for e.g. + * expressing the difference between two + * vm_offset_t entities. + */ +#ifdef __LP64__ +typedef uintptr_t vm_size_t; +#else /* __LP64__ */ +typedef natural_t vm_size_t; +#endif /* __LP64__ */ + +/* + * This new type is independent of a particular vm map's + * implementation size - and represents appropriate types + * for all possible maps. This is used for interfaces + * where the size of the map is not known - or we don't + * want to have to distinguish. + */ +typedef uint64_t mach_vm_address_t; +typedef uint64_t mach_vm_offset_t; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t; +typedef uint64_t vm_map_address_t; +typedef uint64_t vm_map_size_t; + + +#endif /* ASSEMBLER */ + +/* + * If composing messages by hand (please do not) + */ +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif /* _MACH_I386_VM_TYPES_H_ */ diff --git a/i386/include/mach/i386/_structs.h b/i386/include/mach/i386/_structs.h new file mode 100644 index 0000000..927d12f --- /dev/null +++ b/i386/include/mach/i386/_structs.h @@ -0,0 +1,561 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_I386__STRUCTS_H_ +#define _MACH_I386__STRUCTS_H_ + +/* + * i386 is the structure that is exported to user threads for + * use in status/mutate calls. This structure should never change. + * + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_THREAD_STATE32 struct __darwin_i386_thread_state +_STRUCT_X86_THREAD_STATE32 +{ + unsigned int __eax; + unsigned int __ebx; + unsigned int __ecx; + unsigned int __edx; + unsigned int __edi; + unsigned int __esi; + unsigned int __ebp; + unsigned int __esp; + unsigned int __ss; + unsigned int __eflags; + unsigned int __eip; + unsigned int __cs; + unsigned int __ds; + unsigned int __es; + unsigned int __fs; + unsigned int __gs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_THREAD_STATE32 struct i386_thread_state +_STRUCT_X86_THREAD_STATE32 +{ + unsigned int eax; + unsigned int ebx; + unsigned int ecx; + unsigned int edx; + unsigned int edi; + unsigned int esi; + unsigned int ebp; + unsigned int esp; + unsigned int ss; + unsigned int eflags; + unsigned int eip; + unsigned int cs; + unsigned int ds; + unsigned int es; + unsigned int fs; + unsigned int gs; +}; +#endif /* !__DARWIN_UNIX03 */ + +/* This structure should be double-word aligned for performance */ + +#if __DARWIN_UNIX03 +#define _STRUCT_FP_CONTROL struct __darwin_fp_control +_STRUCT_FP_CONTROL +{ + unsigned short __invalid :1, + __denorm :1, + __zdiv :1, + __ovrfl :1, + __undfl :1, + __precis :1, + :2, + __pc :2, +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define FP_PREC_24B 0 +#define FP_PREC_53B 2 +#define FP_PREC_64B 3 +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + __rc :2, +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define FP_RND_NEAR 0 +#define FP_RND_DOWN 1 +#define FP_RND_UP 2 +#define FP_CHOP 3 +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + /*inf*/ :1, + :3; +}; +typedef _STRUCT_FP_CONTROL __darwin_fp_control_t; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_FP_CONTROL struct fp_control +_STRUCT_FP_CONTROL +{ + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + :2, + pc :2, +#define FP_PREC_24B 0 +#define FP_PREC_53B 2 +#define FP_PREC_64B 3 + rc :2, +#define FP_RND_NEAR 0 +#define FP_RND_DOWN 1 +#define FP_RND_UP 2 +#define FP_CHOP 3 + /*inf*/ :1, + :3; +}; +typedef _STRUCT_FP_CONTROL fp_control_t; +#endif /* !__DARWIN_UNIX03 */ + +/* + * Status word. + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_FP_STATUS struct __darwin_fp_status +_STRUCT_FP_STATUS +{ + unsigned short __invalid :1, + __denorm :1, + __zdiv :1, + __ovrfl :1, + __undfl :1, + __precis :1, + __stkflt :1, + __errsumm :1, + __c0 :1, + __c1 :1, + __c2 :1, + __tos :3, + __c3 :1, + __busy :1; +}; +typedef _STRUCT_FP_STATUS __darwin_fp_status_t; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_FP_STATUS struct fp_status +_STRUCT_FP_STATUS +{ + unsigned short invalid :1, + denorm :1, + zdiv :1, + ovrfl :1, + undfl :1, + precis :1, + stkflt :1, + errsumm :1, + c0 :1, + c1 :1, + c2 :1, + tos :3, + c3 :1, + busy :1; +}; +typedef _STRUCT_FP_STATUS fp_status_t; +#endif /* !__DARWIN_UNIX03 */ + +/* defn of 80bit x87 FPU or MMX register */ + +#if __DARWIN_UNIX03 +#define _STRUCT_MMST_REG struct __darwin_mmst_reg +_STRUCT_MMST_REG +{ + char __mmst_reg[10]; + char __mmst_rsrv[6]; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_MMST_REG struct mmst_reg +_STRUCT_MMST_REG +{ + char mmst_reg[10]; + char mmst_rsrv[6]; +}; +#endif /* !__DARWIN_UNIX03 */ + + +/* defn of 128 bit XMM regs */ + +#if __DARWIN_UNIX03 +#define _STRUCT_XMM_REG struct __darwin_xmm_reg +_STRUCT_XMM_REG +{ + char __xmm_reg[16]; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_XMM_REG struct xmm_reg +_STRUCT_XMM_REG +{ + char xmm_reg[16]; +}; +#endif /* !__DARWIN_UNIX03 */ + +/* + * Floating point state. + */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define FP_STATE_BYTES 512 /* number of chars worth of data from fpu_fcw */ +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_FLOAT_STATE32 struct __darwin_i386_float_state +_STRUCT_X86_FLOAT_STATE32 +{ + int __fpu_reserved[2]; + _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ + __uint8_t __fpu_ftw; /* x87 FPU tag word */ + __uint8_t __fpu_rsrv1; /* reserved */ + __uint16_t __fpu_fop; /* x87 FPU Opcode */ + __uint32_t __fpu_ip; /* x87 FPU Instruction Pointer offset */ + __uint16_t __fpu_cs; /* x87 FPU Instruction Pointer Selector */ + __uint16_t __fpu_rsrv2; /* reserved */ + __uint32_t __fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ + __uint16_t __fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ + __uint16_t __fpu_rsrv3; /* reserved */ + __uint32_t __fpu_mxcsr; /* MXCSR Register state */ + __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ + char __fpu_rsrv4[14*16]; /* reserved */ + int __fpu_reserved1; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_FLOAT_STATE32 struct i386_float_state +_STRUCT_X86_FLOAT_STATE32 +{ + int fpu_reserved[2]; + _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ + __uint8_t fpu_ftw; /* x87 FPU tag word */ + __uint8_t fpu_rsrv1; /* reserved */ + __uint16_t fpu_fop; /* x87 FPU Opcode */ + __uint32_t fpu_ip; /* x87 FPU Instruction Pointer offset */ + __uint16_t fpu_cs; /* x87 FPU Instruction Pointer Selector */ + __uint16_t fpu_rsrv2; /* reserved */ + __uint32_t fpu_dp; /* x87 FPU Instruction Operand(Data) Pointer offset */ + __uint16_t fpu_ds; /* x87 FPU Instruction Operand(Data) Pointer Selector */ + __uint16_t fpu_rsrv3; /* reserved */ + __uint32_t fpu_mxcsr; /* MXCSR Register state */ + __uint32_t fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ + char fpu_rsrv4[14*16]; /* reserved */ + int fpu_reserved1; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_EXCEPTION_STATE32 struct __darwin_i386_exception_state +_STRUCT_X86_EXCEPTION_STATE32 +{ + unsigned int __trapno; + unsigned int __err; + unsigned int __faultvaddr; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_EXCEPTION_STATE32 struct i386_exception_state +_STRUCT_X86_EXCEPTION_STATE32 +{ + unsigned int trapno; + unsigned int err; + unsigned int faultvaddr; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_DEBUG_STATE32 struct __darwin_x86_debug_state32 +_STRUCT_X86_DEBUG_STATE32 +{ + unsigned int __dr0; + unsigned int __dr1; + unsigned int __dr2; + unsigned int __dr3; + unsigned int __dr4; + unsigned int __dr5; + unsigned int __dr6; + unsigned int __dr7; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_DEBUG_STATE32 struct x86_debug_state32 +_STRUCT_X86_DEBUG_STATE32 +{ + unsigned int dr0; + unsigned int dr1; + unsigned int dr2; + unsigned int dr3; + unsigned int dr4; + unsigned int dr5; + unsigned int dr6; + unsigned int dr7; +}; +#endif /* !__DARWIN_UNIX03 */ + +/* + * 64 bit versions of the above + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_THREAD_STATE64 struct __darwin_x86_thread_state64 +_STRUCT_X86_THREAD_STATE64 +{ + __uint64_t __rax; + __uint64_t __rbx; + __uint64_t __rcx; + __uint64_t __rdx; + __uint64_t __rdi; + __uint64_t __rsi; + __uint64_t __rbp; + __uint64_t __rsp; + __uint64_t __r8; + __uint64_t __r9; + __uint64_t __r10; + __uint64_t __r11; + __uint64_t __r12; + __uint64_t __r13; + __uint64_t __r14; + __uint64_t __r15; + __uint64_t __rip; + __uint64_t __rflags; + __uint64_t __cs; + __uint64_t __fs; + __uint64_t __gs; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_THREAD_STATE64 struct x86_thread_state64 +_STRUCT_X86_THREAD_STATE64 +{ + __uint64_t rax; + __uint64_t rbx; + __uint64_t rcx; + __uint64_t rdx; + __uint64_t rdi; + __uint64_t rsi; + __uint64_t rbp; + __uint64_t rsp; + __uint64_t r8; + __uint64_t r9; + __uint64_t r10; + __uint64_t r11; + __uint64_t r12; + __uint64_t r13; + __uint64_t r14; + __uint64_t r15; + __uint64_t rip; + __uint64_t rflags; + __uint64_t cs; + __uint64_t fs; + __uint64_t gs; +}; +#endif /* !__DARWIN_UNIX03 */ + + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_FLOAT_STATE64 struct __darwin_x86_float_state64 +_STRUCT_X86_FLOAT_STATE64 +{ + int __fpu_reserved[2]; + _STRUCT_FP_CONTROL __fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS __fpu_fsw; /* x87 FPU status word */ + __uint8_t __fpu_ftw; /* x87 FPU tag word */ + __uint8_t __fpu_rsrv1; /* reserved */ + __uint16_t __fpu_fop; /* x87 FPU Opcode */ + + /* x87 FPU Instruction Pointer */ + __uint32_t __fpu_ip; /* offset */ + __uint16_t __fpu_cs; /* Selector */ + + __uint16_t __fpu_rsrv2; /* reserved */ + + /* x87 FPU Instruction Operand(Data) Pointer */ + __uint32_t __fpu_dp; /* offset */ + __uint16_t __fpu_ds; /* Selector */ + + __uint16_t __fpu_rsrv3; /* reserved */ + __uint32_t __fpu_mxcsr; /* MXCSR Register state */ + __uint32_t __fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG __fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG __fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG __fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG __fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG __fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG __fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG __fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG __fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG __fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG __fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG __fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG __fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG __fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG __fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG __fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG __fpu_xmm7; /* XMM 7 */ + _STRUCT_XMM_REG __fpu_xmm8; /* XMM 8 */ + _STRUCT_XMM_REG __fpu_xmm9; /* XMM 9 */ + _STRUCT_XMM_REG __fpu_xmm10; /* XMM 10 */ + _STRUCT_XMM_REG __fpu_xmm11; /* XMM 11 */ + _STRUCT_XMM_REG __fpu_xmm12; /* XMM 12 */ + _STRUCT_XMM_REG __fpu_xmm13; /* XMM 13 */ + _STRUCT_XMM_REG __fpu_xmm14; /* XMM 14 */ + _STRUCT_XMM_REG __fpu_xmm15; /* XMM 15 */ + char __fpu_rsrv4[6*16]; /* reserved */ + int __fpu_reserved1; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_FLOAT_STATE64 struct x86_float_state64 +_STRUCT_X86_FLOAT_STATE64 +{ + int fpu_reserved[2]; + _STRUCT_FP_CONTROL fpu_fcw; /* x87 FPU control word */ + _STRUCT_FP_STATUS fpu_fsw; /* x87 FPU status word */ + __uint8_t fpu_ftw; /* x87 FPU tag word */ + __uint8_t fpu_rsrv1; /* reserved */ + __uint16_t fpu_fop; /* x87 FPU Opcode */ + + /* x87 FPU Instruction Pointer */ + __uint32_t fpu_ip; /* offset */ + __uint16_t fpu_cs; /* Selector */ + + __uint16_t fpu_rsrv2; /* reserved */ + + /* x87 FPU Instruction Operand(Data) Pointer */ + __uint32_t fpu_dp; /* offset */ + __uint16_t fpu_ds; /* Selector */ + + __uint16_t fpu_rsrv3; /* reserved */ + __uint32_t fpu_mxcsr; /* MXCSR Register state */ + __uint32_t fpu_mxcsrmask; /* MXCSR mask */ + _STRUCT_MMST_REG fpu_stmm0; /* ST0/MM0 */ + _STRUCT_MMST_REG fpu_stmm1; /* ST1/MM1 */ + _STRUCT_MMST_REG fpu_stmm2; /* ST2/MM2 */ + _STRUCT_MMST_REG fpu_stmm3; /* ST3/MM3 */ + _STRUCT_MMST_REG fpu_stmm4; /* ST4/MM4 */ + _STRUCT_MMST_REG fpu_stmm5; /* ST5/MM5 */ + _STRUCT_MMST_REG fpu_stmm6; /* ST6/MM6 */ + _STRUCT_MMST_REG fpu_stmm7; /* ST7/MM7 */ + _STRUCT_XMM_REG fpu_xmm0; /* XMM 0 */ + _STRUCT_XMM_REG fpu_xmm1; /* XMM 1 */ + _STRUCT_XMM_REG fpu_xmm2; /* XMM 2 */ + _STRUCT_XMM_REG fpu_xmm3; /* XMM 3 */ + _STRUCT_XMM_REG fpu_xmm4; /* XMM 4 */ + _STRUCT_XMM_REG fpu_xmm5; /* XMM 5 */ + _STRUCT_XMM_REG fpu_xmm6; /* XMM 6 */ + _STRUCT_XMM_REG fpu_xmm7; /* XMM 7 */ + _STRUCT_XMM_REG fpu_xmm8; /* XMM 8 */ + _STRUCT_XMM_REG fpu_xmm9; /* XMM 9 */ + _STRUCT_XMM_REG fpu_xmm10; /* XMM 10 */ + _STRUCT_XMM_REG fpu_xmm11; /* XMM 11 */ + _STRUCT_XMM_REG fpu_xmm12; /* XMM 12 */ + _STRUCT_XMM_REG fpu_xmm13; /* XMM 13 */ + _STRUCT_XMM_REG fpu_xmm14; /* XMM 14 */ + _STRUCT_XMM_REG fpu_xmm15; /* XMM 15 */ + char fpu_rsrv4[6*16]; /* reserved */ + int fpu_reserved1; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_EXCEPTION_STATE64 struct __darwin_x86_exception_state64 +_STRUCT_X86_EXCEPTION_STATE64 +{ + unsigned int __trapno; + unsigned int __err; + __uint64_t __faultvaddr; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_EXCEPTION_STATE64 struct x86_exception_state64 +_STRUCT_X86_EXCEPTION_STATE64 +{ + unsigned int trapno; + unsigned int err; + __uint64_t faultvaddr; +}; +#endif /* !__DARWIN_UNIX03 */ + +#if __DARWIN_UNIX03 +#define _STRUCT_X86_DEBUG_STATE64 struct __darwin_x86_debug_state64 +_STRUCT_X86_DEBUG_STATE64 +{ + __uint64_t __dr0; + __uint64_t __dr1; + __uint64_t __dr2; + __uint64_t __dr3; + __uint64_t __dr4; + __uint64_t __dr5; + __uint64_t __dr6; + __uint64_t __dr7; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_X86_DEBUG_STATE64 struct x86_debug_state64 +_STRUCT_X86_DEBUG_STATE64 +{ + __uint64_t dr0; + __uint64_t dr1; + __uint64_t dr2; + __uint64_t dr3; + __uint64_t dr4; + __uint64_t dr5; + __uint64_t dr6; + __uint64_t dr7; +}; +#endif /* !__DARWIN_UNIX03 */ + +#endif /* _MACH_I386__STRUCTS_H_ */ diff --git a/i386/include/mach/i386/asm.h b/i386/include/mach/i386/asm.h new file mode 100644 index 0000000..02a5620 --- /dev/null +++ b/i386/include/mach/i386/asm.h @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +#ifndef _I386_ASM_H_ +#define _I386_ASM_H_ + +#ifdef _KERNEL +#include <gprof.h> +#endif /* _KERNEL */ + +#ifdef MACH_KERNEL +#include <mach_kdb.h> +#else /* !MACH_KERNEL */ +#define MACH_KDB 0 +#endif /* !MACH_KERNEL */ + + +#if defined(MACH_KERNEL) || defined(_KERNEL) +#include <gprof.h> +#endif /* MACH_KERNEL || _KERNEL */ + +#if defined(__i386__) + +#define S_PC (%esp) +#define S_ARG0 4(%esp) +#define S_ARG1 8(%esp) +#define S_ARG2 12(%esp) +#define S_ARG3 16(%esp) +#define S_ARG4 20(%esp) + +#define FRAME pushl %ebp; movl %esp, %ebp +#define EMARF leave + +#define B_LINK (%ebp) +#define B_PC 4(%ebp) +#define B_ARG0 8(%ebp) +#define B_ARG1 12(%ebp) +#define B_ARG2 16(%ebp) +#define B_ARG3 20(%ebp) + +#elif defined(__x86_64__) + +#define S_PC (%rsp) + +#define FRAME pushq %rbp; movq %rsp, %rbp +#define EMARF leave + +#define B_LINK (%rbp) +#define B_PC 8(%rbp) + +#else +#error unsupported architecture +#endif + +/* There is another definition of ALIGN for .c sources */ +#ifdef ASSEMBLER +#define ALIGN 4,0x90 +#endif /* ASSEMBLER */ + +#ifndef FALIGN +#define FALIGN ALIGN +#endif + +#define LB(x,n) n +#if __STDC__ +#ifndef __NO_UNDERSCORES__ +#define LCL(x) L ## x +#define EXT(x) _ ## x +#define LEXT(x) _ ## x ## : +#else +#define LCL(x) .L ## x +#define EXT(x) x +#define LEXT(x) x ## : +#endif +#define LBc(x,n) n ## : +#define LBb(x,n) n ## b +#define LBf(x,n) n ## f +#else /* __STDC__ */ +#ifndef __NO_UNDERSCORES__ +#define LCL(x) L/**/x +#define EXT(x) _/**/x +#define LEXT(x) _/**/x/**/: +#else /* __NO_UNDERSCORES__ */ +#define LCL(x) .L/**/x +#define EXT(x) x +#define LEXT(x) x/**/: +#endif /* __NO_UNDERSCORES__ */ +#define LBc(x,n) n/**/: +#define LBb(x,n) n/**/b +#define LBf(x,n) n/**/f +#endif /* __STDC__ */ + +#define SVC .byte 0x9a; .long 0; .word 0x7 + +#define RPC_SVC .byte 0x9a; .long 0; .word 0xf + +#define String .asciz +#define Value .word +#define Times(a,b) (a*b) +#define Divide(a,b) (a/b) + +#define INB inb %dx, %al +#define OUTB outb %al, %dx +#define INL inl %dx, %eax +#define OUTL outl %eax, %dx + +#define data16 .byte 0x66 +#define addr16 .byte 0x67 + +#if !GPROF +#define MCOUNT + +#elif defined(__SHARED__) +#define MCOUNT ; .data;\ + .align ALIGN;\ + LBc(x, 8) .long 0;\ + .text;\ + Gpush;\ + Gload;\ + leal Gotoff(LBb(x,8)),%edx;\ + Egaddr(%eax,_mcount_ptr);\ + Gpop;\ + call *(%eax); + +#else /* !GPROF, !__SHARED__ */ +#define MCOUNT ; call mcount; +#endif /* GPROF */ + +#ifdef __ELF__ +#define ELF_FUNC(x) .type x,@function +#define ELF_DATA(x) .type x,@object +#define ELF_SIZE(x,s) .size x,s +#else +#define ELF_FUNC(x) +#define ELF_DATA(x) +#define ELF_SIZE(x,s) +#endif + +#define Entry(x) .globl EXT(x); ELF_FUNC(EXT(x)); .align FALIGN; LEXT(x) +#define ENTRY(x) Entry(x) MCOUNT +#define ENTRY2(x,y) .globl EXT(x); .globl EXT(y); \ + ELF_FUNC(EXT(x)); ELF_FUNC(EXT(y)); \ + .align FALIGN; LEXT(x); LEXT(y) \ + MCOUNT +#if __STDC__ +#define ASENTRY(x) .globl x; .align FALIGN; x ## : ELF_FUNC(x) MCOUNT +#else +#define ASENTRY(x) .globl x; .align FALIGN; x: ELF_FUNC(x) MCOUNT +#endif /* __STDC__ */ + +#define DATA(x) .globl EXT(x); ELF_DATA(EXT(x)); .align ALIGN; LEXT(x) + +#define End(x) ELF_SIZE(x,.-x) +#define END(x) End(EXT(x)) +#define ENDDATA(x) END(x) +#define Enddata(x) End(x) + +/* + * ELF shared library accessor macros. + * Gpush saves the %ebx register used for the GOT address + * Gpop pops %ebx if we need a GOT + * Gload loads %ebx with the GOT address if shared libraries are used + * Gcall calls an external function. + * Gotoff allows you to reference local labels. + * Gotoff2 allows you to reference local labels with an index reg. + * Gotoff3 allows you to reference local labels with an index reg & size. + * Gaddr loads up a register with an address of an external item. + * Gstack is the number of bytes that Gpush pushes on the stack. + * + * Varients of the above with E or L prefixes do EXT(name) or LCL(name) + * respectively. + */ + +#ifndef __SHARED__ +#define Gpush +#define Gpop +#define Gload +#define Gcall(func) call func +#define Gotoff(lab) lab +#define Gotoff2(l,r) l(r) +#define Gotoff3(l,r,s) l(,r,s) +#define Gaddr(to,lab) movl $lab,to +#define Gcmp(lab,reg) cmpl $lab,reg +#define Gmemload(lab,reg) movl lab,reg +#define Gmemstore(reg,lab,tmp) movl reg,lab +#define Gstack 0 + +#else +#ifdef __ELF__ /* ELF shared libraries */ +#define Gpush pushl %ebx +#define Gpop popl %ebx +#define Gload call 9f; 9: popl %ebx; addl $_GLOBAL_OFFSET_TABLE_+[.-9b],%ebx +#define Gcall(func) call EXT(func)@PLT +#define Gotoff(lab) lab@GOTOFF(%ebx) +#define Gotoff2(l,r) l@GOTOFF(%ebx,r) +#define Gotoff3(l,r,s) l@GOTOFF(%ebx,r,s) +#define Gaddr(to,lab) movl lab@GOT(%ebx),to +#define Gcmp(lab,reg) cmpl reg,lab@GOT(%ebx) +#define Gmemload(lab,reg) movl lab@GOT(%ebx),reg; movl (reg),reg +#define Gmemstore(reg,lab,tmp) movl lab@GOT(%ebx),tmp; movl reg,(tmp) +#define Gstack 4 + +#else /* ROSE shared libraries */ +#define Gpush +#define Gpop +#define Gload +#define Gcall(func) call *9f; .data; .align ALIGN; 9: .long func; .text +#define Gotoff(lab) lab +#define Gotoff2(l,r) l(r) +#define Gotoff3(l,r,s) l(,r,s) +#define Gaddr(to,lab) movl 9f,to; .data; .align ALIGN; 9: .long lab; .text +#define Gcmp(lab,reg) cmpl reg,9f; .data; .align ALIGN; 9: .long lab; .text +#define Gmemload(lab,reg) movl 9f,reg; movl (reg),reg; .data; .align ALIGN; 9: .long lab; .text +#define Gmemstore(reg,lab,tmp) movl 9f,tmp; movl reg,(tmp); .data; .align ALIGN; 9: .long lab; .text +#define Gstack 0 +#endif /* __ELF__ */ +#endif /* __SHARED__ */ + +/* Egotoff is not provided, since external symbols should not use @GOTOFF + relocations. */ +#define Egcall(func) Gcall(EXT(func)) +#define Egaddr(to,lab) Gaddr(to,EXT(lab)) +#define Egcmp(lab,reg) Gcmp(EXT(lab),reg) +#define Egmemload(lab,reg) Gmemload(EXT(lab),reg) +#define Egmemstore(reg,lab,tmp) Gmemstore(reg,EXT(lab),tmp) + +#define Lgotoff(lab) Gotoff(LCL(lab)) +#define Lgotoff2(l,r) Gotoff2(LCL(l),r) +#define Lgotoff3(l,r,s) Gotoff3(LCL(l),r,s) +#define Lgcmp(lab,reg) Gcmp(LCL(lab),reg) +#define Lgmemload(lab,reg) movl Lgotoff(lab),reg +#define Lgmemstore(reg,lab,tmp) movl reg,Lgotoff(lab) + +#ifdef ASSEMBLER +#if MACH_KDB +#include <ddb/stab.h> +/* + * This pseudo-assembler line is added so that there will be at least + * one N_SO entry in the symbol stable to define the current file name. + */ +#endif /* MACH_KDB */ + +#else /* NOT ASSEMBLER */ + +/* These defines are here for .c files that wish to reference global symbols + * within __asm__ statements. + */ +#ifndef __NO_UNDERSCORES__ +#define CC_SYM_PREFIX "_" +#else +#define CC_SYM_PREFIX "" +#endif /* __NO_UNDERSCORES__ */ +#endif /* ASSEMBLER */ + +#endif /* _I386_ASM_H_ */ diff --git a/i386/include/mach/i386/boolean.h b/i386/include/mach/i386/boolean.h new file mode 100644 index 0000000..100f7e7 --- /dev/null +++ b/i386/include/mach/i386/boolean.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: boolean.h + * + * Boolean type, for I386. + */ + +#ifndef _MACH_I386_BOOLEAN_H_ +#define _MACH_I386_BOOLEAN_H_ + +#if defined(__x86_64__) && !defined(KERNEL) +typedef unsigned int boolean_t; +#else +typedef int boolean_t; +#endif + +#endif /* _MACH_I386_BOOLEAN_H_ */ diff --git a/i386/include/mach/i386/exception.h b/i386/include/mach/i386/exception.h new file mode 100644 index 0000000..77fe4e4 --- /dev/null +++ b/i386/include/mach/i386/exception.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_I386_EXCEPTION_H_ +#define _MACH_I386_EXCEPTION_H_ + +/* + * No machine dependent types for the 80386 + */ + +#define EXC_TYPES_COUNT 11 /* incl. illegal exception 0 */ + +/* + * Codes and subcodes for 80386 exceptions. + */ + +#define EXCEPTION_CODE_MAX 2 /* currently code and subcode */ + +/* + * EXC_BAD_INSTRUCTION + */ + +#define EXC_I386_INVOP 1 + +/* + * EXC_ARITHMETIC + */ + +#define EXC_I386_DIV 1 +#define EXC_I386_INTO 2 +#define EXC_I386_NOEXT 3 +#define EXC_I386_EXTOVR 4 +#define EXC_I386_EXTERR 5 +#define EXC_I386_EMERR 6 +#define EXC_I386_BOUND 7 +#define EXC_I386_SSEEXTERR 8 + +/* + * EXC_SOFTWARE + * Note: 0x10000-0x10003 in use for unix signal + */ + +/* + * EXC_BAD_ACCESS + */ + +/* + * EXC_BREAKPOINT + */ + +#define EXC_I386_SGL 1 +#define EXC_I386_BPT 2 + +#define EXC_I386_DIVERR 0 /* divide by 0 eprror */ +#define EXC_I386_SGLSTP 1 /* single step */ +#define EXC_I386_NMIFLT 2 /* NMI */ +#define EXC_I386_BPTFLT 3 /* breakpoint fault */ +#define EXC_I386_INTOFLT 4 /* INTO overflow fault */ +#define EXC_I386_BOUNDFLT 5 /* BOUND instruction fault */ +#define EXC_I386_INVOPFLT 6 /* invalid opcode fault */ +#define EXC_I386_NOEXTFLT 7 /* extension not available fault*/ +#define EXC_I386_DBLFLT 8 /* double fault */ +#define EXC_I386_EXTOVRFLT 9 /* extension overrun fault */ +#define EXC_I386_INVTSSFLT 10 /* invalid TSS fault */ +#define EXC_I386_SEGNPFLT 11 /* segment not present fault */ +#define EXC_I386_STKFLT 12 /* stack fault */ +#define EXC_I386_GPFLT 13 /* general protection fault */ +#define EXC_I386_PGFLT 14 /* page fault */ +#define EXC_I386_EXTERRFLT 16 /* extension error fault */ +#define EXC_I386_ALIGNFLT 17 /* Alignment fault */ +#define EXC_I386_ENDPERR 33 /* emulated extension error flt */ +#define EXC_I386_ENOEXTFLT 32 /* emulated ext not present */ + + +/* + * machine dependent exception masks + */ +#define EXC_MASK_MACHINE 0 + +#endif /* _MACH_I386_EXCEPTION_H_ */ diff --git a/i386/include/mach/i386/fp_reg.h b/i386/include/mach/i386/fp_reg.h new file mode 100644 index 0000000..47a26a9 --- /dev/null +++ b/i386/include/mach/i386/fp_reg.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1992-1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _I386_FP_SAVE_H_ +#define _I386_FP_SAVE_H_ + + +/* note when allocating this data structure, it must be 16 byte aligned. */ +struct x86_fx_save { + unsigned short fx_control; /* control */ + unsigned short fx_status; /* status */ + unsigned char fx_tag; /* register tags */ + unsigned char fx_bbz1; /* better be zero when calling fxrtstor */ + unsigned short fx_opcode; + unsigned int fx_eip; /* eip instruction */ + unsigned short fx_cs; /* cs instruction */ + unsigned short fx_bbz2; /* better be zero when calling fxrtstor */ + unsigned int fx_dp; /* data address */ + unsigned short fx_ds; /* data segment */ + unsigned short fx_bbz3; /* better be zero when calling fxrtstor */ + unsigned int fx_MXCSR; + unsigned int fx_MXCSR_MASK; + unsigned short fx_reg_word[8][8]; /* STx/MMx registers */ + unsigned short fx_XMM_reg[8][16]; /* XMM0-XMM15 on 64 bit processors */ + /* XMM0-XMM7 on 32 bit processors... unused storage reserved */ + unsigned char fx_reserved[16*6]; /* reserved by intel for future expansion */ +}; + + +/* + * Control register + */ +#define FPC_IE 0x0001 /* enable invalid operation + exception */ +#define FPC_IM FPC_IE +#define FPC_DE 0x0002 /* enable denormalized operation + exception */ +#define FPC_DM FPC_DE +#define FPC_ZE 0x0004 /* enable zero-divide exception */ +#define FPC_ZM FPC_ZE +#define FPC_OE 0x0008 /* enable overflow exception */ +#define FPC_OM FPC_OE +#define FPC_UE 0x0010 /* enable underflow exception */ +#define FPC_PE 0x0020 /* enable precision exception */ +#define FPC_PC 0x0300 /* precision control: */ +#define FPC_PC_24 0x0000 /* 24 bits */ +#define FPC_PC_53 0x0200 /* 53 bits */ +#define FPC_PC_64 0x0300 /* 64 bits */ +#define FPC_RC 0x0c00 /* rounding control: */ +#define FPC_RC_RN 0x0000 /* round to nearest or even */ +#define FPC_RC_RD 0x0400 /* round down */ +#define FPC_RC_RU 0x0800 /* round up */ +#define FPC_RC_CHOP 0x0c00 /* chop */ +#define FPC_IC 0x1000 /* infinity control (obsolete) */ +#define FPC_IC_PROJ 0x0000 /* projective infinity */ +#define FPC_IC_AFF 0x1000 /* affine infinity (std) */ + +/* + * Status register + */ +#define FPS_IE 0x0001 /* invalid operation */ +#define FPS_DE 0x0002 /* denormalized operand */ +#define FPS_ZE 0x0004 /* divide by zero */ +#define FPS_OE 0x0008 /* overflow */ +#define FPS_UE 0x0010 /* underflow */ +#define FPS_PE 0x0020 /* precision */ +#define FPS_SF 0x0040 /* stack flag */ +#define FPS_ES 0x0080 /* error summary */ +#define FPS_C0 0x0100 /* condition code bit 0 */ +#define FPS_C1 0x0200 /* condition code bit 1 */ +#define FPS_C2 0x0400 /* condition code bit 2 */ +#define FPS_TOS 0x3800 /* top-of-stack pointer */ +#define FPS_TOS_SHIFT 11 +#define FPS_C3 0x4000 /* condition code bit 3 */ +#define FPS_BUSY 0x8000 /* FPU busy */ + +/* + * Kind of floating-point support provided by kernel. + */ +#define FP_NO 0 /* no floating point */ +#define FP_SOFT 1 /* software FP emulator */ +#define FP_287 2 /* 80287 */ +#define FP_387 3 /* 80387 or 80486 */ +#define FP_FXSR 4 /* Fast save/restore SIMD Extension */ + +#endif /* _I386_FP_SAVE_H_ */ diff --git a/i386/include/mach/i386/kern_return.h b/i386/include/mach/i386/kern_return.h new file mode 100644 index 0000000..a9df708 --- /dev/null +++ b/i386/include/mach/i386/kern_return.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: kern_return.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine-dependent kernel return definitions. + */ + +#ifndef _MACH_I386_KERN_RETURN_H_ +#define _MACH_I386_KERN_RETURN_H_ + +#ifndef ASSEMBLER +typedef int kern_return_t; +#endif /* ASSEMBLER */ + +#endif /* _MACH_I386_KERN_RETURN_H_ */ diff --git a/i386/include/mach/i386/machine_types.defs b/i386/include/mach/i386/machine_types.defs new file mode 100644 index 0000000..6a35615 --- /dev/null +++ b/i386/include/mach/i386/machine_types.defs @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Header file for basic, machine-dependent data types. i386 version. + */ + +#ifndef _MACHINE_VM_TYPES_DEFS_ +#define _MACHINE_VM_TYPES_DEFS_ 1 + +type short = int16_t; +type int = int32_t; +type unsigned = uint32_t; + +type float = MACH_MSG_TYPE_REAL_32; +type double = MACH_MSG_TYPE_REAL_64; + + +/* from ISO/IEC 988:1999 spec */ +/* 7.18.1.4 Integer types capable of hgolding object pointers */ +/* + * The [u]intptr_t types for the native + * integer type, e.g. 32 or 64 or.. whatever + * register size the machine has. They are + * used for entities that might be either + * [unsigned] integers or pointers, and for + * type-casting between the two. + * + * For instance, the IPC system represents + * a port in user space as an integer and + * in kernel space as a pointer. + */ +#if defined(__LP64__) +type uintptr_t = uint64_t; +type intptr_t = int64_t; +#else +type uintptr_t = uint32_t; +type intptr_t = int32_t; +#endif + +/* + * These are the legacy Mach types that are + * the [rough] equivalents of the standards above. + * They were defined in terms of int, not + * long int, so they remain separate. + */ +#if defined(__LP64__) +type register_t = int64_t; +#else +type register_t = int32_t; +#endif +type integer_t = int32_t; +type natural_t = uint32_t; + +/* + * These are the VM types that scale with the address + * space size of a given process. + */ + +#if defined(__LP64__) +type vm_address_t = uint64_t; +type vm_offset_t = uint64_t; +type vm_size_t = uint64_t; +#else +type vm_address_t = natural_t; +type vm_offset_t = natural_t; +type vm_size_t = natural_t; +#endif + +/* + * The mach_vm_xxx_t types are sized to hold the + * maximum pointer, offset, etc... supported on the + * platform. + */ +type mach_vm_address_t = uint64_t; +type mach_vm_offset_t = uint64_t; +type mach_vm_size_t = uint64_t; + +#if MACH_IPC_COMPAT +/* + * For the old IPC interface + */ +#define MSG_TYPE_PORT_NAME natural_t + +#endif /* MACH_IPC_COMPAT */ + +/* + * These are types used internal to Mach to implement the + * legacy 32-bit VM APIs published by the kernel. + */ +#define VM32_SUPPORT 1 + +type vm32_address_t = uint32_t; +type vm32_offset_t = uint32_t; +type vm32_size_t = uint32_t; + +#endif /* _MACHINE_VM_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/i386/ndr_def.h b/i386/include/mach/i386/ndr_def.h new file mode 100644 index 0000000..5163f63 --- /dev/null +++ b/i386/include/mach/i386/ndr_def.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* NDR record for Intel x86s */ + +#include <mach/ndr.h> + +NDR_record_t NDR_record = { + 0, /* mig_reserved */ + 0, /* mig_reserved */ + 0, /* mig_reserved */ + NDR_PROTOCOL_2_0, + NDR_INT_LITTLE_ENDIAN, + NDR_CHAR_ASCII, + NDR_FLOAT_IEEE, + 0, +}; diff --git a/i386/include/mach/i386/processor_info.h b/i386/include/mach/i386/processor_info.h new file mode 100644 index 0000000..8272c6d --- /dev/null +++ b/i386/include/mach/i386/processor_info.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * File: mach/i386/processor_info.h + * + * Data structure definitions for i386 specific processor control + */ + +#ifndef _MACH_I386_PROCESSOR_INFO_H_ +#define _MACH_I386_PROCESSOR_INFO_H_ + +#endif /* _MACH_I386_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/i386/rpc.h b/i386/include/mach/i386/rpc.h new file mode 100644 index 0000000..55561f9 --- /dev/null +++ b/i386/include/mach/i386/rpc.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_I386_RPC_H_ +#define _MACH_I386_RPC_H_ + +#endif /* _MACH_I386_RPC_H_ */ + diff --git a/i386/include/mach/i386/sdt_isa.h b/i386/include/mach/i386/sdt_isa.h new file mode 100644 index 0000000..7934a2c --- /dev/null +++ b/i386/include/mach/i386/sdt_isa.h @@ -0,0 +1,412 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_I386_SDT_ISA_H +#define _MACH_I386_SDT_ISA_H + +/* + * Only define when testing. This makes the calls into actual calls to + * test functions. + */ +/* #define DTRACE_CALL_TEST */ + +#define DTRACE_STRINGIFY(s) #s +#define DTRACE_TOSTRING(s) DTRACE_STRINGIFY(s) +#define DTRACE_LABEL(p, n) \ + "__dtrace_probe$" DTRACE_TOSTRING(__LINE__) DTRACE_STRINGIFY(_##p##___##n) ":" "\n\t" + +#ifdef DTRACE_CALL_TEST + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_CALL_INSN(p,n) + +#else + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_NOPS + +#endif + +#ifdef __x86_64__ + +#define DTRACE_NOPS \ + "nop" "\n\t" \ + "nop" "\n\t" \ + "nop" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "call _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 3 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 5 +#define ARGS6_EXTENT 6 +#define ARGS7_EXTENT 7 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 10 +#define ARGS10_EXTENT 10 + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ( \ + DTRACE_CALL(provider, name) \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + "movq\t0x20(%0),%%r8" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx", "r8" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + "movq\t0x20(%0),%%r8" "\n\t" \ + "movq\t0x28(%0),%%r9" "\n\t" \ + DTRACE_CALL(provider, name) \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subq\t$0x8,%%rsp" "\n\t" \ + "movq\t0x0(%0),%%rdi" "\n\t" \ + "movq\t0x8(%0),%%rsi" "\n\t" \ + "movq\t0x10(%0),%%rdx" "\n\t" \ + "movq\t0x18(%0),%%rcx" "\n\t" \ + "movq\t0x20(%0),%%r8" "\n\t" \ + "movq\t0x28(%0),%%r9" "\n\t" \ + "movq\t0x30(%0),%%rax" "\n\t" \ + "movq\t%%rax,0x0(%%rsp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addq\t$0x8,%%rsp" "\n\t" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "rax" \ + ); + +#endif // __x86_64__ + +#ifdef __i386__ + +#define DTRACE_NOPS \ + "nop" "\n\t" \ + "leal 0(%%esi), %%esi" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "call _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 4 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 8 +#define ARGS6_EXTENT 8 +#define ARGS7_EXTENT 8 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 12 +#define ARGS10_EXTENT 12 + +/* + * Because this code is used in the kernel, we must not touch any floating point + * or specialized registers. This leaves the following registers: + * + * eax ; volatile, safe to use + * ebx ; PIC register, gcc error when used + * ecx ; volatile, safe to use + * edx ; volatile, safe to use + * esi ; non-volatile, otherwise safe to use + * edi ; non-volatile, otherwise safe to use + * + * Using any of the non volatile register causes a spill to stack which is almost + * certainly a net performance loss. Also, note that the array ref (__dtrace_args) + * consumes one free register. If all three of the volatile regs are used for load/store, + * the compiler will spill a register to hold the array ref. + * + * The end result is that we only pipeline two loads/stores at a time. Blech. + */ + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ( \ + DTRACE_CALL(provider, name) \ + "# eat trailing nl +tabfrom DTRACE_CALL" \ + : \ + : \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("subl\t$0x10,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x10,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL8ARGS(provider, name) \ + asm volatile ("subl\t$0x20,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t0x1C(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + "movl\t%%edx,0x1C(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x20,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL9ARGS(provider, name) \ + asm volatile ("subl\t$0x30,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t0x1C(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + "movl\t%%edx,0x1C(%%esp)" "\n\t" \ + "movl\t0x20(%0),%%eax" "\n\t" \ + "movl\t%%eax,0x20(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x30,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#define DTRACE_CALL10ARGS(provider, name) \ + asm volatile ("subl\t$0x30,%%esp" "\n\t" \ + "movl\t0x0(%0),%%eax" "\n\t" \ + "movl\t0x4(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x0(%%esp)" "\n\t" \ + "movl\t%%edx,0x4(%%esp)" "\n\t" \ + "movl\t0x8(%0),%%eax" "\n\t" \ + "movl\t0xC(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x8(%%esp)" "\n\t" \ + "movl\t%%edx,0xC(%%esp)" "\n\t" \ + "movl\t0x10(%0),%%eax" "\n\t" \ + "movl\t0x14(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x10(%%esp)" "\n\t" \ + "movl\t%%edx,0x14(%%esp)" "\n\t" \ + "movl\t0x18(%0),%%eax" "\n\t" \ + "movl\t0x1C(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x18(%%esp)" "\n\t" \ + "movl\t%%edx,0x1C(%%esp)" "\n\t" \ + "movl\t0x20(%0),%%eax" "\n\t" \ + "movl\t0x24(%0),%%edx" "\n\t" \ + "movl\t%%eax,0x20(%%esp)" "\n\t" \ + "movl\t%%edx,0x24(%%esp)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addl\t$0x30,%%esp" \ + : \ + : "r" (__dtrace_args) \ + : "memory", "eax", "edx" \ + ); + +#endif // __i386__ + +#endif /* _MACH_I386_SDT_ISA_H */ diff --git a/i386/include/mach/i386/task.h b/i386/include/mach/i386/task.h new file mode 100644 index 0000000..15c8248 --- /dev/null +++ b/i386/include/mach/i386/task.h @@ -0,0 +1,1578 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 35 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +/* Routine task_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine task_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; + __Request__task_get_state_t Request_task_get_state; + __Request__task_set_state_t Request_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; + __Reply__task_get_state_t Reply_task_get_state; + __Reply__task_set_state_t Reply_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 },\ + { "task_get_state", 3433 },\ + { "task_set_state", 3434 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/i386/include/mach/i386/thread_act.h b/i386/include/mach/i386/thread_act.h new file mode 100644 index 0000000..fde4189 --- /dev/null +++ b/i386/include/mach/i386/thread_act.h @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/i386/include/mach/i386/thread_state.h b/i386/include/mach/i386/thread_state.h new file mode 100644 index 0000000..dba05b9 --- /dev/null +++ b/i386/include/mach/i386/thread_state.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_I386_THREAD_STATE_H_ +#define _MACH_I386_THREAD_STATE_H_ + +/* Size of maximum exported thread state in words */ +#define I386_THREAD_STATE_MAX (144) /* Size of biggest state possible */ + +#if defined (__i386__) || defined(__x86_64__) +#define THREAD_STATE_MAX I386_THREAD_STATE_MAX +#endif + +#endif /* _MACH_I386_THREAD_STATE_H_ */ diff --git a/i386/include/mach/i386/thread_status.h b/i386/include/mach/i386/thread_status.h new file mode 100644 index 0000000..65773e3 --- /dev/null +++ b/i386/include/mach/i386/thread_status.h @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: thread_status.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * This file contains the structure definitions for the thread + * state as applied to I386 processors. + */ + +#ifndef _MACH_I386_THREAD_STATUS_H_ +#define _MACH_I386_THREAD_STATUS_H_ + +#include <mach/i386/_structs.h> +#include <mach/message.h> +#include <mach/i386/fp_reg.h> +#include <mach/i386/thread_state.h> +#include <i386/eflags.h> + +/* + * the i386_xxxx form is kept for legacy purposes since these types + * are externally known... eventually they should be deprecated. + * our internal implementation has moved to the following naming convention + * + * x86_xxxx32 names are used to deal with 32 bit states + * x86_xxxx64 names are used to deal with 64 bit states + * x86_xxxx names are used to deal with either 32 or 64 bit states + * via a self-describing mechanism + */ + +/* + * these are the legacy names which should be deprecated in the future + * they are externally known which is the only reason we don't just get + * rid of them + */ +#define i386_THREAD_STATE 1 +#define i386_FLOAT_STATE 2 +#define i386_EXCEPTION_STATE 3 + +/* + * THREAD_STATE_FLAVOR_LIST 0 + * these are the supported flavors + */ +#define x86_THREAD_STATE32 1 +#define x86_FLOAT_STATE32 2 +#define x86_EXCEPTION_STATE32 3 +#define x86_THREAD_STATE64 4 +#define x86_FLOAT_STATE64 5 +#define x86_EXCEPTION_STATE64 6 +#define x86_THREAD_STATE 7 +#define x86_FLOAT_STATE 8 +#define x86_EXCEPTION_STATE 9 +#define x86_DEBUG_STATE32 10 +#define x86_DEBUG_STATE64 11 +#define x86_DEBUG_STATE 12 +#define THREAD_STATE_NONE 13 + +/* + * Largest state on this machine: + * (be sure mach/machine/thread_state.h matches!) + */ +#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX + +/* + * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed + * an exception flavor will return if that is a defined flavor for that + * platform. The macro must be manually updated to include all of the valid + * exception flavors as defined above. + */ +#define VALID_THREAD_STATE_FLAVOR(x) \ + ((x == x86_THREAD_STATE32) || \ + (x == x86_FLOAT_STATE32) || \ + (x == x86_EXCEPTION_STATE32) || \ + (x == x86_DEBUG_STATE32) || \ + (x == x86_THREAD_STATE64) || \ + (x == x86_FLOAT_STATE64) || \ + (x == x86_EXCEPTION_STATE64) || \ + (x == x86_DEBUG_STATE64) || \ + (x == x86_THREAD_STATE) || \ + (x == x86_FLOAT_STATE) || \ + (x == x86_EXCEPTION_STATE) || \ + (x == x86_DEBUG_STATE) || \ + (x == THREAD_STATE_NONE)) + +struct x86_state_hdr { + int flavor; + int count; +}; +typedef struct x86_state_hdr x86_state_hdr_t; + +/* + * Default segment register values. + */ + +#define USER_CODE_SELECTOR 0x0017 +#define USER_DATA_SELECTOR 0x001f +#define KERN_CODE_SELECTOR 0x0008 +#define KERN_DATA_SELECTOR 0x0010 + +/* + * to be deprecated in the future + */ +typedef _STRUCT_X86_THREAD_STATE32 i386_thread_state_t; +#define i386_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (i386_thread_state_t) / sizeof (int) )) + +typedef _STRUCT_X86_THREAD_STATE32 x86_thread_state32_t; +#define x86_THREAD_STATE32_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_thread_state32_t) / sizeof (int) )) + +/* + * to be deprecated in the future + */ +typedef _STRUCT_X86_FLOAT_STATE32 i386_float_state_t; +#define i386_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(i386_float_state_t)/sizeof(unsigned int))) + +typedef _STRUCT_X86_FLOAT_STATE32 x86_float_state32_t; +#define x86_FLOAT_STATE32_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_float_state32_t)/sizeof(unsigned int))) + +/* + * to be deprecated in the future + */ +typedef _STRUCT_X86_EXCEPTION_STATE32 i386_exception_state_t; +#define i386_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (i386_exception_state_t) / sizeof (int) )) + +typedef _STRUCT_X86_EXCEPTION_STATE32 x86_exception_state32_t; +#define x86_EXCEPTION_STATE32_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_exception_state32_t) / sizeof (int) )) + +#define I386_EXCEPTION_STATE_COUNT i386_EXCEPTION_STATE_COUNT + +typedef _STRUCT_X86_DEBUG_STATE32 x86_debug_state32_t; +#define x86_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_debug_state32_t) / sizeof (int) )) + +#define X86_DEBUG_STATE32_COUNT x86_DEBUG_STATE32_COUNT + +typedef _STRUCT_X86_THREAD_STATE64 x86_thread_state64_t; +#define x86_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_thread_state64_t) / sizeof (int) )) + +typedef _STRUCT_X86_FLOAT_STATE64 x86_float_state64_t; +#define x86_FLOAT_STATE64_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_float_state64_t)/sizeof(unsigned int))) + +typedef _STRUCT_X86_EXCEPTION_STATE64 x86_exception_state64_t; +#define x86_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_exception_state64_t) / sizeof (int) )) + +#define X86_EXCEPTION_STATE64_COUNT x86_EXCEPTION_STATE64_COUNT + +typedef _STRUCT_X86_DEBUG_STATE64 x86_debug_state64_t; +#define x86_DEBUG_STATE64_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_debug_state64_t) / sizeof (int) )) + +#define X86_DEBUG_STATE64_COUNT x86_DEBUG_STATE64_COUNT + +/* + * Combined thread, float and exception states + */ +struct x86_thread_state { + x86_state_hdr_t tsh; + union { + x86_thread_state32_t ts32; + x86_thread_state64_t ts64; + } uts; +}; + +struct x86_float_state { + x86_state_hdr_t fsh; + union { + x86_float_state32_t fs32; + x86_float_state64_t fs64; + } ufs; +}; + +struct x86_exception_state { + x86_state_hdr_t esh; + union { + x86_exception_state32_t es32; + x86_exception_state64_t es64; + } ues; +}; + +struct x86_debug_state { + x86_state_hdr_t dsh; + union { + x86_debug_state32_t ds32; + x86_debug_state64_t ds64; + } uds; +}; + +typedef struct x86_thread_state x86_thread_state_t; +#define x86_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + ( sizeof (x86_thread_state_t) / sizeof (int) )) + +typedef struct x86_float_state x86_float_state_t; +#define x86_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_float_state_t)/sizeof(unsigned int))) + +typedef struct x86_exception_state x86_exception_state_t; +#define x86_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_exception_state_t)/sizeof(unsigned int))) + +typedef struct x86_debug_state x86_debug_state_t; +#define x86_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(x86_debug_state_t)/sizeof(unsigned int))) + +/* + * Machine-independent way for servers and Mach's exception mechanism to + * choose the most efficient state flavor for exception RPC's: + */ +#define MACHINE_THREAD_STATE x86_THREAD_STATE +#define MACHINE_THREAD_STATE_COUNT x86_THREAD_STATE_COUNT + +/* + * when reloading the segment registers on + * a return out of the kernel, we may take + * a GeneralProtection or SegmentNotPresent + * fault if one or more of the segment + * registers in the saved state was improperly + * specified via an x86_THREAD_STATE32 call + * the frame we push on top of the existing + * save area looks like this... we need to + * carry this as part of the save area + * in case we get hit so that we have a big + * enough stack + */ +struct x86_seg_load_fault32 { + unsigned int trapno; + unsigned int err; + unsigned int eip; + unsigned int cs; + unsigned int efl; +}; + + +#endif /* _MACH_I386_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/i386/vm_param.h b/i386/include/mach/i386/vm_param.h new file mode 100644 index 0000000..edcb834 --- /dev/null +++ b/i386/include/mach/i386/vm_param.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Copyright (c) 1994 The University of Utah and + * the Computer Systems Laboratory at the University of Utah (CSL). + * All rights reserved. + * + * Permission to use, copy, modify and distribute this software is hereby + * granted provided that (1) source code retains these copyright, permission, + * and disclaimer notices, and (2) redistributions including binaries + * reproduce the notices in supporting documentation, and (3) all advertising + * materials mentioning features or use of this software display the following + * acknowledgement: ``This product includes software developed by the + * Computer Systems Laboratory at the University of Utah.'' + * + * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS + * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF + * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * CSL requests users of this software to return to csl-dist@cs.utah.edu any + * improvements that they make and grant CSL redistribution rights. + * + */ + +/* + * File: vm_param.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * I386 machine dependent virtual memory parameters. + * Most of the declarations are preceeded by I386_ (or i386_) + * which is OK because only I386 specific code will be using + * them. + */ + +#ifndef _MACH_I386_VM_PARAM_H_ +#define _MACH_I386_VM_PARAM_H_ + +#define BYTE_SIZE 8 /* byte size in bits */ + +#define I386_PGBYTES 4096 /* bytes per 80386 page */ +#define I386_PGSHIFT 12 /* bitshift for pages */ + +#define PAGE_SIZE I386_PGBYTES +#define PAGE_SHIFT I386_PGSHIFT +#define PAGE_MASK (PAGE_SIZE - 1) + +#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */ +#define I386_LPGSHIFT 21 /* bitshift for large pages */ +#define I386_LPGMASK (I386_LPGBYTES-1) + +/* + * Convert bytes to pages and convert pages to bytes. + * No rounding is used. + */ + +#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT)) +#define machine_btop(x) i386_btop(x) +#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT) + +/* + * Round off or truncate to the nearest page. These will work + * for either addresses or counts. (i.e. 1 byte rounds to 1 page + * bytes. + */ + +#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \ + ~(I386_PGBYTES-1)) +#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1)) + + + +#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL) +/* + * default top of user stack... it grows down from here + */ +#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) +#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) +/* + * the end of the usable user address space , for now about 47 bits. + * the 64 bit commpage is past the end of this + */ +#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL) +/* + * canonical end of user address space for limits checking + */ +#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL) + + +/* system-wide values */ +#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) +#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) + +/* process-relative values (all 32-bit legacy only for now) */ +#define VM_MIN_ADDRESS ((vm_offset_t) 0) +#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000) +#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000) + + + +#endif /* _MACH_I386_VM_PARAM_H_ */ diff --git a/i386/include/mach/i386/vm_types.h b/i386/include/mach/i386/vm_types.h new file mode 100644 index 0000000..2c38fa2 --- /dev/null +++ b/i386/include/mach/i386/vm_types.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: vm_types.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Header file for VM data types. I386 version. + */ + +#ifndef _MACH_I386_VM_TYPES_H_ +#define _MACH_I386_VM_TYPES_H_ + +#ifndef ASSEMBLER + +#include <i386/_types.h> +#include <mach/i386/vm_param.h> +#include <stdint.h> + +/* + * natural_t and integer_t are Mach's legacy types for machine- + * independent integer types (unsigned, and signed, respectively). + * Their original purpose was to define other types in a machine/ + * compiler independent way. + * + * They also had an implicit "same size as pointer" characteristic + * to them (i.e. Mach's traditional types are very ILP32 or ILP64 + * centric). We support x86 ABIs that do not follow either of + * these models (specifically LP64). Therefore, we had to make a + * choice between making these types scale with pointers or stay + * tied to integers. Because their use is predominantly tied to + * to the size of an integer, we are keeping that association and + * breaking free from pointer size guarantees. + * + * New use of these types is discouraged. + */ +typedef __darwin_natural_t natural_t; +typedef int integer_t; + +/* + * A vm_offset_t is a type-neutral pointer, + * e.g. an offset into a virtual memory space. + */ +#ifdef __LP64__ +typedef uintptr_t vm_offset_t; +#else /* __LP64__ */ +typedef natural_t vm_offset_t; +#endif /* __LP64__ */ + +/* + * A vm_size_t is the proper type for e.g. + * expressing the difference between two + * vm_offset_t entities. + */ +#ifdef __LP64__ +typedef uintptr_t vm_size_t; +#else /* __LP64__ */ +typedef natural_t vm_size_t; +#endif /* __LP64__ */ + +/* + * This new type is independent of a particular vm map's + * implementation size - and represents appropriate types + * for all possible maps. This is used for interfaces + * where the size of the map is not known - or we don't + * want to have to distinguish. + */ +typedef uint64_t mach_vm_address_t; +typedef uint64_t mach_vm_offset_t; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t; +typedef uint64_t vm_map_address_t; +typedef uint64_t vm_map_size_t; + + +#endif /* ASSEMBLER */ + +/* + * If composing messages by hand (please do not) + */ +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif /* _MACH_I386_VM_TYPES_H_ */ diff --git a/i386/include/mach/kern_return.h b/i386/include/mach/kern_return.h new file mode 100644 index 0000000..da73236 --- /dev/null +++ b/i386/include/mach/kern_return.h @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: h/kern_return.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Kernel return codes. + * + */ + +#ifndef _MACH_KERN_RETURN_H_ +#define _MACH_KERN_RETURN_H_ + +#include <mach/machine/kern_return.h> + +#define KERN_SUCCESS 0 + +#define KERN_INVALID_ADDRESS 1 + /* Specified address is not currently valid. + */ + +#define KERN_PROTECTION_FAILURE 2 + /* Specified memory is valid, but does not permit the + * required forms of access. + */ + +#define KERN_NO_SPACE 3 + /* The address range specified is already in use, or + * no address range of the size specified could be + * found. + */ + +#define KERN_INVALID_ARGUMENT 4 + /* The function requested was not applicable to this + * type of argument, or an argument is invalid + */ + +#define KERN_FAILURE 5 + /* The function could not be performed. A catch-all. + */ + +#define KERN_RESOURCE_SHORTAGE 6 + /* A system resource could not be allocated to fulfill + * this request. This failure may not be permanent. + */ + +#define KERN_NOT_RECEIVER 7 + /* The task in question does not hold receive rights + * for the port argument. + */ + +#define KERN_NO_ACCESS 8 + /* Bogus access restriction. + */ + +#define KERN_MEMORY_FAILURE 9 + /* During a page fault, the target address refers to a + * memory object that has been destroyed. This + * failure is permanent. + */ + +#define KERN_MEMORY_ERROR 10 + /* During a page fault, the memory object indicated + * that the data could not be returned. This failure + * may be temporary; future attempts to access this + * same data may succeed, as defined by the memory + * object. + */ + +#define KERN_ALREADY_IN_SET 11 + /* The receive right is already a member of the portset. + */ + +#define KERN_NOT_IN_SET 12 + /* The receive right is not a member of a port set. + */ + +#define KERN_NAME_EXISTS 13 + /* The name already denotes a right in the task. + */ + +#define KERN_ABORTED 14 + /* The operation was aborted. Ipc code will + * catch this and reflect it as a message error. + */ + +#define KERN_INVALID_NAME 15 + /* The name doesn't denote a right in the task. + */ + +#define KERN_INVALID_TASK 16 + /* Target task isn't an active task. + */ + +#define KERN_INVALID_RIGHT 17 + /* The name denotes a right, but not an appropriate right. + */ + +#define KERN_INVALID_VALUE 18 + /* A blatant range error. + */ + +#define KERN_UREFS_OVERFLOW 19 + /* Operation would overflow limit on user-references. + */ + +#define KERN_INVALID_CAPABILITY 20 + /* The supplied (port) capability is improper. + */ + +#define KERN_RIGHT_EXISTS 21 + /* The task already has send or receive rights + * for the port under another name. + */ + +#define KERN_INVALID_HOST 22 + /* Target host isn't actually a host. + */ + +#define KERN_MEMORY_PRESENT 23 + /* An attempt was made to supply "precious" data + * for memory that is already present in a + * memory object. + */ + +#define KERN_MEMORY_DATA_MOVED 24 + /* A page was requested of a memory manager via + * memory_object_data_request for an object using + * a MEMORY_OBJECT_COPY_CALL strategy, with the + * VM_PROT_WANTS_COPY flag being used to specify + * that the page desired is for a copy of the + * object, and the memory manager has detected + * the page was pushed into a copy of the object + * while the kernel was walking the shadow chain + * from the copy to the object. This error code + * is delivered via memory_object_data_error + * and is handled by the kernel (it forces the + * kernel to restart the fault). It will not be + * seen by users. + */ + +#define KERN_MEMORY_RESTART_COPY 25 + /* A strategic copy was attempted of an object + * upon which a quicker copy is now possible. + * The caller should retry the copy using + * vm_object_copy_quickly. This error code + * is seen only by the kernel. + */ + +#define KERN_INVALID_PROCESSOR_SET 26 + /* An argument applied to assert processor set privilege + * was not a processor set control port. + */ + +#define KERN_POLICY_LIMIT 27 + /* The specified scheduling attributes exceed the thread's + * limits. + */ + +#define KERN_INVALID_POLICY 28 + /* The specified scheduling policy is not currently + * enabled for the processor set. + */ + +#define KERN_INVALID_OBJECT 29 + /* The external memory manager failed to initialize the + * memory object. + */ + +#define KERN_ALREADY_WAITING 30 + /* A thread is attempting to wait for an event for which + * there is already a waiting thread. + */ + +#define KERN_DEFAULT_SET 31 + /* An attempt was made to destroy the default processor + * set. + */ + +#define KERN_EXCEPTION_PROTECTED 32 + /* An attempt was made to fetch an exception port that is + * protected, or to abort a thread while processing a + * protected exception. + */ + +#define KERN_INVALID_LEDGER 33 + /* A ledger was required but not supplied. + */ + +#define KERN_INVALID_MEMORY_CONTROL 34 + /* The port was not a memory cache control port. + */ + +#define KERN_INVALID_SECURITY 35 + /* An argument supplied to assert security privilege + * was not a host security port. + */ + +#define KERN_NOT_DEPRESSED 36 + /* thread_depress_abort was called on a thread which + * was not currently depressed. + */ + +#define KERN_TERMINATED 37 + /* Object has been terminated and is no longer available + */ + +#define KERN_LOCK_SET_DESTROYED 38 + /* Lock set has been destroyed and is no longer available. + */ + +#define KERN_LOCK_UNSTABLE 39 + /* The thread holding the lock terminated before releasing + * the lock + */ + +#define KERN_LOCK_OWNED 40 + /* The lock is already owned by another thread + */ + +#define KERN_LOCK_OWNED_SELF 41 + /* The lock is already owned by the calling thread + */ + +#define KERN_SEMAPHORE_DESTROYED 42 + /* Semaphore has been destroyed and is no longer available. + */ + +#define KERN_RPC_SERVER_TERMINATED 43 + /* Return from RPC indicating the target server was + * terminated before it successfully replied + */ + +#define KERN_RPC_TERMINATE_ORPHAN 44 + /* Terminate an orphaned activation. + */ + +#define KERN_RPC_CONTINUE_ORPHAN 45 + /* Allow an orphaned activation to continue executing. + */ + +#define KERN_NOT_SUPPORTED 46 + /* Empty thread activation (No thread linked to it) + */ + +#define KERN_NODE_DOWN 47 + /* Remote node down or inaccessible. + */ + +#define KERN_NOT_WAITING 48 + /* A signalled thread was not actually waiting. */ + +#define KERN_OPERATION_TIMED_OUT 49 + /* Some thread-oriented operation (semaphore_wait) timed out + */ + +#define KERN_CODESIGN_ERROR 50 + /* During a page fault, indicates that the page was rejected + * as a result of a signature check. + */ + +#define KERN_RETURN_MAX 0x100 + /* Maximum return value allowable + */ + +#endif /* _MACH_KERN_RETURN_H_ */ diff --git a/i386/include/mach/kmod.h b/i386/include/mach/kmod.h new file mode 100644 index 0000000..f31821d --- /dev/null +++ b/i386/include/mach/kmod.h @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _MACH_KMOD_H_ +#define _MACH_KMOD_H_ + +#include <mach/kern_return.h> +#include <mach/mach_types.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#if PRAGMA_MARK +#pragma mark Basic macros & typedefs +#endif +/*********************************************************************** +* Basic macros & typedefs +***********************************************************************/ +#define KMOD_MAX_NAME 64 + +#define KMOD_RETURN_SUCCESS KERN_SUCCESS +#define KMOD_RETURN_FAILURE KERN_FAILURE + +typedef int kmod_t; + +struct kmod_info; +typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data); +typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data); + +#if PRAGMA_MARK +#pragma mark Structure definitions +#endif +/*********************************************************************** +* Structure definitions +* +* All structures must be #pragma pack(4). +***********************************************************************/ +#pragma pack(4) + +/* Run-time struct only; never saved to a file */ +typedef struct kmod_reference { + struct kmod_reference * next; + struct kmod_info * info; +} kmod_reference_t; + +/*********************************************************************** +* Warning: Any changes to the kmod_info structure affect the +* KMOD_..._DECL macros below. +***********************************************************************/ + +/* The kmod_info_t structure is only safe to use inside the running + * kernel. If you need to work with a kmod_info_t structure outside + * the kernel, please use the compatibility definitions below. + */ +typedef struct kmod_info { + struct kmod_info * next; + int32_t info_version; // version of this structure + uint32_t id; + char name[KMOD_MAX_NAME]; + char version[KMOD_MAX_NAME]; + int32_t reference_count; // # linkage refs to this + kmod_reference_t * reference_list; // who this refs (links on) + vm_address_t address; // starting address + vm_size_t size; // total size + vm_size_t hdr_size; // unwired hdr size + kmod_start_func_t * start; + kmod_stop_func_t * stop; +} kmod_info_t; + +/* A compatibility definition of kmod_info_t for 32-bit kexts. + */ +typedef struct kmod_info_32_v1 { + uint32_t next_addr; + int32_t info_version; + uint32_t id; + uint8_t name[KMOD_MAX_NAME]; + uint8_t version[KMOD_MAX_NAME]; + int32_t reference_count; + uint32_t reference_list_addr; + uint32_t address; + uint32_t size; + uint32_t hdr_size; + uint32_t start_addr; + uint32_t stop_addr; +} kmod_info_32_v1_t; + +/* A compatibility definition of kmod_info_t for 64-bit kexts. + */ +typedef struct kmod_info_64_v1 { + uint64_t next_addr; + int32_t info_version; + uint32_t id; + uint8_t name[KMOD_MAX_NAME]; + uint8_t version[KMOD_MAX_NAME]; + int32_t reference_count; + uint64_t reference_list_addr; + uint64_t address; + uint64_t size; + uint64_t hdr_size; + uint64_t start_addr; + uint64_t stop_addr; +} kmod_info_64_v1_t; + +#pragma pack() + +#if PRAGMA_MARK +#pragma mark Kmod structure declaration macros +#endif +/*********************************************************************** +* Kmod structure declaration macros +***********************************************************************/ +#define KMOD_INFO_NAME kmod_info +#define KMOD_INFO_VERSION 1 + +#define KMOD_DECL(name, version) \ + static kmod_start_func_t name ## _module_start; \ + static kmod_stop_func_t name ## _module_stop; \ + kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \ + { #name }, { version }, -1, 0, 0, 0, 0, \ + name ## _module_start, \ + name ## _module_stop }; + +#define KMOD_EXPLICIT_DECL(name, version, start, stop) \ + kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U, \ + { #name }, { version }, -1, 0, 0, 0, 0, \ + start, stop }; + +#if PRAGMA_MARK +#pragma mark Kernel private declarations +#endif +/*********************************************************************** +* Kernel private declarations. +***********************************************************************/ + + +#if PRAGMA_MARK +#pragma mark Obsolete kmod stuff +#endif +/*********************************************************************** +* These 3 should be dropped but they're referenced by MIG declarations. +***********************************************************************/ +typedef void * kmod_args_t; +typedef int kmod_control_flavor_t; +typedef kmod_info_t * kmod_info_array_t; + +__END_DECLS + +#endif /* _MACH_KMOD_H_ */ diff --git a/i386/include/mach/ledger.defs b/i386/include/mach/ledger.defs new file mode 100644 index 0000000..76367a9 --- /dev/null +++ b/i386/include/mach/ledger.defs @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERNEL_USER */ +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + ledger 5000; + +#ifdef KERNEL_USER +userprefix r_; +#endif /* KERNEL_USER */ + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Create a subordinate ledger + */ +routine ledger_create( + parent_ledger : ledger_t; + ledger_ledger : ledger_t; + out new_ledger : ledger_t; + transfer : ledger_item_t); + +/* + * Destroy a ledger + */ +routine ledger_terminate( + ledger : ledger_t); + +/* + * Transfer resources from a parent ledger to a child + */ +routine ledger_transfer( + parent_ledger : ledger_t; + child_ledger : ledger_t; + transfer : ledger_item_t); + +/* + * Return the ledger limit and balance + */ +routine ledger_read( + ledger : ledger_t; + out balance : ledger_item_t; + out limit : ledger_item_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/ledger.h b/i386/include/mach/ledger.h new file mode 100644 index 0000000..f0f050f --- /dev/null +++ b/i386/include/mach/ledger.h @@ -0,0 +1,259 @@ +#ifndef _ledger_user_ +#define _ledger_user_ + +/* Module ledger */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef ledger_MSG_COUNT +#define ledger_MSG_COUNT 4 +#endif /* ledger_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine ledger_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_create +( + ledger_t parent_ledger, + ledger_t ledger_ledger, + ledger_t *new_ledger, + ledger_item_t transfer +); + +/* Routine ledger_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_terminate +( + ledger_t ledger +); + +/* Routine ledger_transfer */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_transfer +( + ledger_t parent_ledger, + ledger_t child_ledger, + ledger_item_t transfer +); + +/* Routine ledger_read */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t ledger_read +( + ledger_t ledger, + ledger_item_t *balance, + ledger_item_t *limit +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__ledger_subsystem__defined +#define __Request__ledger_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t ledger_ledger; + /* end of the kernel processed data */ + NDR_record_t NDR; + ledger_item_t transfer; + } __Request__ledger_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__ledger_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_ledger; + /* end of the kernel processed data */ + NDR_record_t NDR; + ledger_item_t transfer; + } __Request__ledger_transfer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__ledger_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__ledger_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__ledger_subsystem__defined +#define __RequestUnion__ledger_subsystem__defined +union __RequestUnion__ledger_subsystem { + __Request__ledger_create_t Request_ledger_create; + __Request__ledger_terminate_t Request_ledger_terminate; + __Request__ledger_transfer_t Request_ledger_transfer; + __Request__ledger_read_t Request_ledger_read; +}; +#endif /* !__RequestUnion__ledger_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__ledger_subsystem__defined +#define __Reply__ledger_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_ledger; + /* end of the kernel processed data */ + } __Reply__ledger_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__ledger_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__ledger_transfer_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + ledger_item_t balance; + ledger_item_t limit; + } __Reply__ledger_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__ledger_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__ledger_subsystem__defined +#define __ReplyUnion__ledger_subsystem__defined +union __ReplyUnion__ledger_subsystem { + __Reply__ledger_create_t Reply_ledger_create; + __Reply__ledger_terminate_t Reply_ledger_terminate; + __Reply__ledger_transfer_t Reply_ledger_transfer; + __Reply__ledger_read_t Reply_ledger_read; +}; +#endif /* !__RequestUnion__ledger_subsystem__defined */ + +#ifndef subsystem_to_name_map_ledger +#define subsystem_to_name_map_ledger \ + { "ledger_create", 5000 },\ + { "ledger_terminate", 5001 },\ + { "ledger_transfer", 5002 },\ + { "ledger_read", 5003 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _ledger_user_ */ diff --git a/i386/include/mach/lock_set.defs b/i386/include/mach/lock_set.defs new file mode 100644 index 0000000..c7ee584 --- /dev/null +++ b/i386/include/mach/lock_set.defs @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + * + */ +/* + * File: mach/lock_set.defs + * Author: Joseph CaraDonna + * + * Exported kernel calls + * + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + lock_set 617000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * a lock_set_t is created and destroyed through the task object. + * lock_set_create(task,&lock_set_t,...); + * lock_set_destroy(task,lock_set_t); + */ + +routine lock_acquire( + lock_set : lock_set_t; + lock_id : int); + +routine lock_release( + lock_set : lock_set_t; + lock_id : int); + +routine lock_try( + lock_set : lock_set_t; + lock_id : int); + +routine lock_make_stable( + lock_set : lock_set_t; + lock_id : int); + +routine lock_handoff( + lock_set : lock_set_t; + lock_id : int); + +routine lock_handoff_accept( + lock_set : lock_set_t; + lock_id : int); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/lock_set.h b/i386/include/mach/lock_set.h new file mode 100644 index 0000000..07a8d13 --- /dev/null +++ b/i386/include/mach/lock_set.h @@ -0,0 +1,326 @@ +#ifndef _lock_set_user_ +#define _lock_set_user_ + +/* Module lock_set */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef lock_set_MSG_COUNT +#define lock_set_MSG_COUNT 6 +#endif /* lock_set_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine lock_acquire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_acquire +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_release */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_release +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_try */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_try +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_make_stable */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_make_stable +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_handoff */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_handoff +( + lock_set_t lock_set, + int lock_id +); + +/* Routine lock_handoff_accept */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_handoff_accept +( + lock_set_t lock_set, + int lock_id +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__lock_set_subsystem__defined +#define __Request__lock_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_acquire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_release_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_try_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_make_stable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_handoff_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int lock_id; + } __Request__lock_handoff_accept_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__lock_set_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__lock_set_subsystem__defined +#define __RequestUnion__lock_set_subsystem__defined +union __RequestUnion__lock_set_subsystem { + __Request__lock_acquire_t Request_lock_acquire; + __Request__lock_release_t Request_lock_release; + __Request__lock_try_t Request_lock_try; + __Request__lock_make_stable_t Request_lock_make_stable; + __Request__lock_handoff_t Request_lock_handoff; + __Request__lock_handoff_accept_t Request_lock_handoff_accept; +}; +#endif /* !__RequestUnion__lock_set_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__lock_set_subsystem__defined +#define __Reply__lock_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_acquire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_release_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_try_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_make_stable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_handoff_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_handoff_accept_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__lock_set_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__lock_set_subsystem__defined +#define __ReplyUnion__lock_set_subsystem__defined +union __ReplyUnion__lock_set_subsystem { + __Reply__lock_acquire_t Reply_lock_acquire; + __Reply__lock_release_t Reply_lock_release; + __Reply__lock_try_t Reply_lock_try; + __Reply__lock_make_stable_t Reply_lock_make_stable; + __Reply__lock_handoff_t Reply_lock_handoff; + __Reply__lock_handoff_accept_t Reply_lock_handoff_accept; +}; +#endif /* !__RequestUnion__lock_set_subsystem__defined */ + +#ifndef subsystem_to_name_map_lock_set +#define subsystem_to_name_map_lock_set \ + { "lock_acquire", 617000 },\ + { "lock_release", 617001 },\ + { "lock_try", 617002 },\ + { "lock_make_stable", 617003 },\ + { "lock_handoff", 617004 },\ + { "lock_handoff_accept", 617005 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _lock_set_user_ */ diff --git a/i386/include/mach/mach.h b/i386/include/mach/mach.h new file mode 100644 index 0000000..0b3b1a0 --- /dev/null +++ b/i386/include/mach/mach.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 1999-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Includes all the types that a normal user + * of Mach programs should need + */ + +#ifndef _MACH_H_ +#define _MACH_H_ + +#define __MACH30__ +#define MACH_IPC_FLAVOR UNTYPED + +#include <mach/std_types.h> +#include <mach/mach_types.h> +#include <mach/mach_interface.h> +#include <mach/mach_port.h> +#include <mach/mach_init.h> +#include <mach/mach_host.h> +#include <mach/thread_switch.h> + +#include <mach/rpc.h> /* for compatibility only */ +#include <mach/mig.h> + +#include <mach/mig_errors.h> +#include <mach/mach_error.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS +/* + * Standard prototypes + */ +extern void panic_init(mach_port_t); +extern void panic(const char *, ...); + +extern void safe_gets(char *, + char *, + int); + +extern void slot_name(cpu_type_t, + cpu_subtype_t, + char **, + char **); + +extern void mig_reply_setup(mach_msg_header_t *, + mach_msg_header_t *); + +extern void mach_msg_destroy(mach_msg_header_t *); + +extern mach_msg_return_t mach_msg_receive(mach_msg_header_t *); + +extern mach_msg_return_t mach_msg_send(mach_msg_header_t *); + +extern mach_msg_return_t mach_msg_server_once(boolean_t (*) + (mach_msg_header_t *, + mach_msg_header_t *), + mach_msg_size_t, + mach_port_t, + mach_msg_options_t); +extern mach_msg_return_t mach_msg_server(boolean_t (*) + (mach_msg_header_t *, + mach_msg_header_t *), + mach_msg_size_t, + mach_port_t, + mach_msg_options_t); + +/* + * Prototypes for compatibility + */ +extern kern_return_t clock_get_res(mach_port_t, + clock_res_t *); +extern kern_return_t clock_set_res(mach_port_t, + clock_res_t); + +extern kern_return_t clock_sleep(mach_port_t, + int, + mach_timespec_t, + mach_timespec_t *); +__END_DECLS + +#endif /* _MACH_H_ */ diff --git a/i386/include/mach/mach_error.h b/i386/include/mach/mach_error.h new file mode 100644 index 0000000..5840bd5 --- /dev/null +++ b/i386/include/mach/mach_error.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +/* + * File: mach_error.h + * Author: Douglas Orr, Carnegie Mellon University + * Date: Mar. 1988 + * + * Definitions of routines in mach_error.c + */ + +#ifndef _MACH_ERROR_ +#define _MACH_ERROR_ 1 + +#include <mach/error.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS +char *mach_error_string( +/* + * Returns a string appropriate to the error argument given + */ + mach_error_t error_value + ); + +void mach_error( +/* + * Prints an appropriate message on the standard error stream + */ + const char *str, + mach_error_t error_value + ); + +char *mach_error_type( +/* + * Returns a string with the error system, subsystem and code + */ + mach_error_t error_value + ); +__END_DECLS + +#endif /* _MACH_ERROR_ */ diff --git a/i386/include/mach/mach_exc.defs b/i386/include/mach/mach_exc.defs new file mode 100644 index 0000000..00fae28 --- /dev/null +++ b/i386/include/mach/mach_exc.defs @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Abstract: + * MiG definitions file for Mach exception interface. + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif + mach_exc 2405; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +ServerPrefix catch_; + +type mach_exception_data_t = array[*:2] of int64_t; +type exception_type_t = int; + +routine mach_exception_raise( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : mach_exception_data_t + ); + +routine mach_exception_raise_state( +#if KERNEL_USER + exception_port : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : mach_exception_data_t, const; + inout flavor : int; + old_state : thread_state_t, const; + out new_state : thread_state_t); + +routine mach_exception_raise_state_identity( +#if KERNEL_USER + exception_port : mach_port_move_send_t; + thread : mach_port_move_send_t; + task : mach_port_move_send_t; +#else /* KERNEL_USER */ + exception_port : mach_port_t; + thread : mach_port_t; + task : mach_port_t; +#endif /* KERNEL_USER */ + exception : exception_type_t; + code : mach_exception_data_t; + inout flavor : int; + old_state : thread_state_t; + out new_state : thread_state_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/mach_host.defs b/i386/include/mach/mach_host.defs new file mode 100644 index 0000000..90ba9b9 --- /dev/null +++ b/i386/include/mach/mach_host.defs @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/mach_host.defs + * + * Abstract: + * Mach host operations support. Includes processor allocation and + * control. + */ + +#ifdef MACH_KERNEL +#include <advisory_pageout.h> +#endif /* MACH_KERNEL */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + mach_host 200; + +/* + * Basic types + */ + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach/clock_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * References to host objects are returned by: + * mach_host_self() - trap + */ + +/* + * Return information about this host. + */ +routine host_info( + host : host_t; + flavor : host_flavor_t; + out host_info_out : host_info_t, CountInOut); + +/* + * Get string describing current kernel version. + */ +routine host_kernel_version( + host : host_t; + out kernel_version : kernel_version_t); + +/* + * Get host page size + * (compatibility for running old libraries on new kernels - + * host_page_size() is now a library routine based on constants) + */ +routine _host_page_size( + host : host_t; + out out_page_size : vm_size_t); + +/* + * Allow pagers to create named entries that point to un-mapped + * abstract memory object. The named entries are generally mappable + * and can be subsetted through the mach_make_memory_entry call + */ +routine mach_memory_object_memory_entry( + host :host_t; + internal :boolean_t; + size :vm_size_t; + permission :vm_prot_t; + pager :memory_object_t; + out entry_handle :mach_port_move_send_t); + + +/* + * Get processor info for all the processors on this host. + * The returned data is an OOL array of processor info. + */ +routine host_processor_info( + host : host_t; + flavor : processor_flavor_t; + out out_processor_count : natural_t; + out out_processor_info : processor_info_array_t); + +/* + * Return host IO master access port + */ +routine host_get_io_master( + host : host_t; + out io_master : io_master_t); + +/* + * Get service port for a processor set. + * Available to all. + */ +routine host_get_clock_service( + host : host_t; + clock_id : clock_id_t; + out clock_serv : clock_serv_t); + +/* + * kernel module interface (obsolete as of SnowLeopard) + * see mach/kmod.h + */ +/* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ +routine kmod_get_info( + host : host_t; + out modules : kmod_args_t); + +/* + * Returns information about the memory allocation zones. + * Supported in all kernels.. + */ +routine host_zone_info( + host : host_t; + out names : zone_name_array_t, + Dealloc; + out info : zone_info_array_t, + Dealloc); + +/* + * Returns information about the global VP table. + * Only supported in MACH_VM_DEBUG kernels, + * otherwise returns KERN_FAILURE. + */ +routine host_virtual_physical_table_info( + host : host_t; + out info : hash_info_bucket_array_t, + Dealloc); + +/* + * Returns information about the global reverse hash table. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine host_ipc_hash_info( + host : host_t; + out info : hash_info_bucket_array_t, + Dealloc); + +skip; /* was enable_bluebox */ +skip; /* was disable_bluebox */ + +/* + * JMM - Keep processor_set related items at the end for easy + * removal. + */ +/* + * Get default processor set for host. + */ +routine processor_set_default( + host : host_t; + out default_set : processor_set_name_t); + +/* + * Create new processor set. Returns real port for manipulations, + * and name port for obtaining information. + */ +routine processor_set_create( + host : host_t; + out new_set : processor_set_t; + out new_name : processor_set_name_t); + +/* + * Temporary interfaces for conversion to 64 bit data path + */ + +routine mach_memory_object_memory_entry_64( + host :host_t; + internal :boolean_t; + size :memory_object_size_t; + permission :vm_prot_t; + pager :memory_object_t; + out entry_handle :mach_port_move_send_t); + +/* + * Return statistics from this host. + */ +routine host_statistics( + host_priv : host_t; + flavor : host_flavor_t; + out host_info_out : host_info_t, CountInOut); + +routine host_request_notification( + host : host_t; + notify_type : host_flavor_t; + notify_port : mach_port_make_send_once_t); + +routine host_lockgroup_info( + host : host_t; + out lockgroup_info : lockgroup_info_array_t, + Dealloc); + +/* + * Return 64-bit statistics from this host. + */ +routine host_statistics64( + host_priv : host_t; + flavor : host_flavor_t; + out host_info64_out : host_info64_t, CountInOut); + + +/* vim: set ft=c : */ diff --git a/i386/include/mach/mach_host.h b/i386/include/mach/mach_host.h new file mode 100644 index 0000000..70ab53f --- /dev/null +++ b/i386/include/mach/mach_host.h @@ -0,0 +1,873 @@ +#ifndef _mach_host_user_ +#define _mach_host_user_ + +/* Module mach_host */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef mach_host_MSG_COUNT +#define mach_host_MSG_COUNT 20 +#endif /* mach_host_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> +#include <mach/mach_init.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine host_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_info +( + host_t host, + host_flavor_t flavor, + host_info_t host_info_out, + mach_msg_type_number_t *host_info_outCnt +); + +/* Routine host_kernel_version */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_kernel_version +( + host_t host, + kernel_version_t kernel_version +); + +/* Routine _host_page_size */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t _host_page_size +( + host_t host, + vm_size_t *out_page_size +); + +/* Routine mach_memory_object_memory_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_memory_object_memory_entry +( + host_t host, + boolean_t internal, + vm_size_t size, + vm_prot_t permission, + memory_object_t pager, + mach_port_t *entry_handle +); + +/* Routine host_processor_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_processor_info +( + host_t host, + processor_flavor_t flavor, + natural_t *out_processor_count, + processor_info_array_t *out_processor_info, + mach_msg_type_number_t *out_processor_infoCnt +); + +/* Routine host_get_io_master */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_io_master +( + host_t host, + io_master_t *io_master +); + +/* Routine host_get_clock_service */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_get_clock_service +( + host_t host, + clock_id_t clock_id, + clock_serv_t *clock_serv +); + +/* Routine kmod_get_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t kmod_get_info +( + host_t host, + kmod_args_t *modules, + mach_msg_type_number_t *modulesCnt +); + +/* Routine host_zone_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_zone_info +( + host_t host, + zone_name_array_t *names, + mach_msg_type_number_t *namesCnt, + zone_info_array_t *info, + mach_msg_type_number_t *infoCnt +); + +/* Routine host_virtual_physical_table_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_virtual_physical_table_info +( + host_t host, + hash_info_bucket_array_t *info, + mach_msg_type_number_t *infoCnt +); + +/* Routine host_ipc_hash_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_ipc_hash_info +( + host_t host, + hash_info_bucket_array_t *info, + mach_msg_type_number_t *infoCnt +); + +/* Routine processor_set_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_default +( + host_t host, + processor_set_name_t *default_set +); + +/* Routine processor_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_create +( + host_t host, + processor_set_t *new_set, + processor_set_name_t *new_name +); + +/* Routine mach_memory_object_memory_entry_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_memory_object_memory_entry_64 +( + host_t host, + boolean_t internal, + memory_object_size_t size, + vm_prot_t permission, + memory_object_t pager, + mach_port_t *entry_handle +); + +/* Routine host_statistics */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_statistics +( + host_t host_priv, + host_flavor_t flavor, + host_info_t host_info_out, + mach_msg_type_number_t *host_info_outCnt +); + +/* Routine host_request_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_request_notification +( + host_t host, + host_flavor_t notify_type, + mach_port_t notify_port +); + +/* Routine host_lockgroup_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_lockgroup_info +( + host_t host, + lockgroup_info_array_t *lockgroup_info, + mach_msg_type_number_t *lockgroup_infoCnt +); + +/* Routine host_statistics64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t host_statistics64 +( + host_t host_priv, + host_flavor_t flavor, + host_info64_t host_info64_out, + mach_msg_type_number_t *host_info64_outCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__mach_host_subsystem__defined +#define __Request__mach_host_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info_outCnt; + } __Request__host_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_kernel_version_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request___host_page_size_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pager; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t internal; + vm_size_t size; + vm_prot_t permission; + } __Request__mach_memory_object_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_flavor_t flavor; + } __Request__host_processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_get_io_master_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + clock_id_t clock_id; + } __Request__host_get_clock_service_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__kmod_get_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_zone_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_virtual_physical_table_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_ipc_hash_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pager; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t internal; + memory_object_size_t size; + vm_prot_t permission; + } __Request__mach_memory_object_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info_outCnt; + } __Request__host_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notify_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + host_flavor_t notify_type; + } __Request__host_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__host_lockgroup_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + host_flavor_t flavor; + mach_msg_type_number_t host_info64_outCnt; + } __Request__host_statistics64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__mach_host_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__mach_host_subsystem__defined +#define __RequestUnion__mach_host_subsystem__defined +union __RequestUnion__mach_host_subsystem { + __Request__host_info_t Request_host_info; + __Request__host_kernel_version_t Request_host_kernel_version; + __Request___host_page_size_t Request__host_page_size; + __Request__mach_memory_object_memory_entry_t Request_mach_memory_object_memory_entry; + __Request__host_processor_info_t Request_host_processor_info; + __Request__host_get_io_master_t Request_host_get_io_master; + __Request__host_get_clock_service_t Request_host_get_clock_service; + __Request__kmod_get_info_t Request_kmod_get_info; + __Request__host_zone_info_t Request_host_zone_info; + __Request__host_virtual_physical_table_info_t Request_host_virtual_physical_table_info; + __Request__host_ipc_hash_info_t Request_host_ipc_hash_info; + __Request__processor_set_default_t Request_processor_set_default; + __Request__processor_set_create_t Request_processor_set_create; + __Request__mach_memory_object_memory_entry_64_t Request_mach_memory_object_memory_entry_64; + __Request__host_statistics_t Request_host_statistics; + __Request__host_request_notification_t Request_host_request_notification; + __Request__host_lockgroup_info_t Request_host_lockgroup_info; + __Request__host_statistics64_t Request_host_statistics64; +}; +#endif /* !__RequestUnion__mach_host_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__mach_host_subsystem__defined +#define __Reply__mach_host_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info_outCnt; + integer_t host_info_out[15]; + } __Reply__host_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t kernel_versionOffset; /* MiG doesn't use it */ + mach_msg_type_number_t kernel_versionCnt; + char kernel_version[512]; + } __Reply__host_kernel_version_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_size_t out_page_size; + } __Reply___host_page_size_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t entry_handle; + /* end of the kernel processed data */ + } __Reply__mach_memory_object_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t out_processor_info; + /* end of the kernel processed data */ + NDR_record_t NDR; + natural_t out_processor_count; + mach_msg_type_number_t out_processor_infoCnt; + } __Reply__host_processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t io_master; + /* end of the kernel processed data */ + } __Reply__host_get_io_master_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t clock_serv; + /* end of the kernel processed data */ + } __Reply__host_get_clock_service_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t modules; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t modulesCnt; + } __Reply__kmod_get_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t names; + mach_msg_ool_descriptor_t info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t namesCnt; + mach_msg_type_number_t infoCnt; + } __Reply__host_zone_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t infoCnt; + } __Reply__host_virtual_physical_table_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t infoCnt; + } __Reply__host_ipc_hash_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t default_set; + /* end of the kernel processed data */ + } __Reply__processor_set_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + mach_msg_port_descriptor_t new_name; + /* end of the kernel processed data */ + } __Reply__processor_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t entry_handle; + /* end of the kernel processed data */ + } __Reply__mach_memory_object_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info_outCnt; + integer_t host_info_out[15]; + } __Reply__host_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__host_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t lockgroup_info; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t lockgroup_infoCnt; + } __Reply__host_lockgroup_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t host_info64_outCnt; + integer_t host_info64_out[256]; + } __Reply__host_statistics64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__mach_host_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__mach_host_subsystem__defined +#define __ReplyUnion__mach_host_subsystem__defined +union __ReplyUnion__mach_host_subsystem { + __Reply__host_info_t Reply_host_info; + __Reply__host_kernel_version_t Reply_host_kernel_version; + __Reply___host_page_size_t Reply__host_page_size; + __Reply__mach_memory_object_memory_entry_t Reply_mach_memory_object_memory_entry; + __Reply__host_processor_info_t Reply_host_processor_info; + __Reply__host_get_io_master_t Reply_host_get_io_master; + __Reply__host_get_clock_service_t Reply_host_get_clock_service; + __Reply__kmod_get_info_t Reply_kmod_get_info; + __Reply__host_zone_info_t Reply_host_zone_info; + __Reply__host_virtual_physical_table_info_t Reply_host_virtual_physical_table_info; + __Reply__host_ipc_hash_info_t Reply_host_ipc_hash_info; + __Reply__processor_set_default_t Reply_processor_set_default; + __Reply__processor_set_create_t Reply_processor_set_create; + __Reply__mach_memory_object_memory_entry_64_t Reply_mach_memory_object_memory_entry_64; + __Reply__host_statistics_t Reply_host_statistics; + __Reply__host_request_notification_t Reply_host_request_notification; + __Reply__host_lockgroup_info_t Reply_host_lockgroup_info; + __Reply__host_statistics64_t Reply_host_statistics64; +}; +#endif /* !__RequestUnion__mach_host_subsystem__defined */ + +#ifndef subsystem_to_name_map_mach_host +#define subsystem_to_name_map_mach_host \ + { "host_info", 200 },\ + { "host_kernel_version", 201 },\ + { "_host_page_size", 202 },\ + { "mach_memory_object_memory_entry", 203 },\ + { "host_processor_info", 204 },\ + { "host_get_io_master", 205 },\ + { "host_get_clock_service", 206 },\ + { "kmod_get_info", 207 },\ + { "host_zone_info", 208 },\ + { "host_virtual_physical_table_info", 209 },\ + { "host_ipc_hash_info", 210 },\ + { "processor_set_default", 213 },\ + { "processor_set_create", 214 },\ + { "mach_memory_object_memory_entry_64", 215 },\ + { "host_statistics", 216 },\ + { "host_request_notification", 217 },\ + { "host_lockgroup_info", 218 },\ + { "host_statistics64", 219 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _mach_host_user_ */ diff --git a/i386/include/mach/mach_init.h b/i386/include/mach/mach_init.h new file mode 100644 index 0000000..36a47fa --- /dev/null +++ b/i386/include/mach/mach_init.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987,1986 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +/* + * Items provided by the Mach environment initialization. + */ + +#ifndef _MACH_INIT_ +#define _MACH_INIT_ 1 + +#include <mach/mach_types.h> +#include <stdarg.h> + +#include <sys/cdefs.h> + +/* + * Kernel-related ports; how a task/thread controls itself + */ + +__BEGIN_DECLS +extern mach_port_t mach_task_self(void); +extern mach_port_t mach_host_self(void); +extern mach_port_t mach_thread_self(void); +extern kern_return_t host_page_size(host_t, vm_size_t *); + +extern mach_port_t mach_task_self_; +#define mach_task_self() mach_task_self_ +#define current_task() mach_task_self() + +__END_DECLS +#include <mach/mach_traps.h> +__BEGIN_DECLS + +/* + * Other important ports in the Mach user environment + */ + +extern mach_port_t bootstrap_port; +extern mach_port_t name_server_port; +extern mach_port_t environment_port; +extern mach_port_t service_port; + +/* + * Where these ports occur in the "mach_ports_register" + * collection... only servers or the runtime library need know. + */ + +#define NAME_SERVER_SLOT 0 +#define ENVIRONMENT_SLOT 1 +#define SERVICE_SLOT 2 + +#define MACH_PORTS_SLOTS_USED 3 + +/* + * Globally interesting numbers. + * These macros assume vm_page_size is a power-of-2. + */ + +extern vm_size_t vm_page_size; +extern vm_size_t vm_page_mask; +extern int vm_page_shift; + +#define trunc_page(x) ((x) & (~(vm_page_size - 1))) +#define round_page(x) trunc_page((x) + (vm_page_size - 1)) + +/* + * Page-size rounding macros for the fixed-width VM types. + */ +#define mach_vm_trunc_page(x) ((mach_vm_offset_t)(x) & ~((signed)PAGE_MASK)) +#define mach_vm_round_page(x) (((mach_vm_offset_t)(x) + PAGE_MASK) & ~((signed)PAGE_MASK)) + +/* + * fprintf_stderr uses vprintf_stderr_func to produce + * error messages, this can be overridden by a user + * application to point to a user-specified output function + */ +extern int (*vprintf_stderr_func)(const char *format, va_list ap); +__END_DECLS + +#endif /* _MACH_INIT_ */ diff --git a/i386/include/mach/mach_interface.h b/i386/include/mach/mach_interface.h new file mode 100644 index 0000000..af939cb --- /dev/null +++ b/i386/include/mach/mach_interface.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (C) Apple Computer 1998 + * ALL Rights Reserved + */ +/* + * This file represents the interfaces that used to come + * from creating the user headers from the mach.defs file. + * Because mach.defs was decomposed, this file now just + * wraps up all the new interface headers generated from + * each of the new .defs resulting from that decomposition. + */ +#ifndef _MACH_INTERFACE_H_ +#define _MACH_INTERFACE_H_ + +#include <mach/clock_priv.h> +#include <mach/host_priv.h> +#include <mach/host_security.h> +#include <mach/ledger.h> +#include <mach/lock_set.h> +#include <mach/processor.h> +#include <mach/processor_set.h> +#include <mach/semaphore.h> +#include <mach/task.h> +#include <mach/thread_act.h> +#include <mach/vm_map.h> + +#endif /* _MACH_INTERFACE_H_ */ diff --git a/i386/include/mach/mach_param.h b/i386/include/mach/mach_param.h new file mode 100644 index 0000000..e4ead67 --- /dev/null +++ b/i386/include/mach/mach_param.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_param.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1986 + * + * Mach system sizing parameters + */ + +#ifndef _MACH_MACH_PARAM_H_ +#define _MACH_MACH_PARAM_H_ + +/* Number of "registered" ports */ + +#define TASK_PORT_REGISTER_MAX 3 + +#endif /* _MACH_MACH_PARAM_H_ */ diff --git a/i386/include/mach/mach_port.defs b/i386/include/mach/mach_port.defs new file mode 100644 index 0000000..5801ee4 --- /dev/null +++ b/i386/include/mach/mach_port.defs @@ -0,0 +1,492 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + mach_port 3200; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Returns the set of port and port set names + * to which the target task has access, along with + * the type (set or port) for each name. + */ + +routine mach_port_names( + task : ipc_space_t; + out names : mach_port_name_array_t; + out types : mach_port_type_array_t); + +/* + * Returns the type (set or port) for the port name + * within the target task. Also indicates whether + * there is a dead-name request for the name. + */ + +routine mach_port_type( + task : ipc_space_t; + name : mach_port_name_t; + out ptype : mach_port_type_t); + +/* + * Changes the name by which a port (or port set) is known to + * the target task. The new name can't be in use. The + * old name becomes available for recycling. + */ + +routine mach_port_rename( + task : ipc_space_t; + old_name : mach_port_name_t; + new_name : mach_port_name_t); + +/* + * Allocates the specified kind of object, with the given name. + * The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * New port sets are empty. New ports don't have any + * send/send-once rights or queued messages. The make-send + * count is zero and their queue limit is MACH_PORT_QLIMIT_DEFAULT. + * New sets, ports, and dead names have one user reference. + */ + +routine mach_port_allocate_name( + task : ipc_space_t; + right : mach_port_right_t; + name : mach_port_name_t); + +/* + * Allocates the specified kind of object. + * The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * Like port_allocate_name, but the kernel picks a name. + * It can use any name not associated with a right. + */ + +routine mach_port_allocate( + task : ipc_space_t; + right : mach_port_right_t; + out name : mach_port_name_t); + +/* + * Destroys all rights associated with the name and makes it + * available for recycling immediately. The name can be a + * port (possibly with multiple user refs), a port set, or + * a dead name (again, with multiple user refs). + */ + +routine mach_port_destroy( + task : ipc_space_t; + name : mach_port_name_t); + +/* + * Releases one send/send-once/dead-name user ref. + * Just like mach_port_mod_refs -1, but deduces the + * correct type of right. This allows a user task + * to release a ref for a port without worrying + * about whether the port has died or not. + */ + +routine mach_port_deallocate( + task : ipc_space_t; + name : mach_port_name_t); + +/* + * A port set always has one user ref. + * A send-once right always has one user ref. + * A dead name always has one or more user refs. + * A send right always has one or more user refs. + * A receive right always has one user ref. + * The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * MACH_PORT_RIGHT_SEND + * MACH_PORT_RIGHT_SEND_ONCE + */ + +routine mach_port_get_refs( + task : ipc_space_t; + name : mach_port_name_t; + right : mach_port_right_t; + out refs : mach_port_urefs_t); + +/* + * The delta is a signed change to the task's + * user ref count for the right. Only dead names + * and send rights can have a positive delta. + * The resulting user ref count can't be negative. + * If it is zero, the right is deallocated. + * If the name isn't a composite right, it becomes + * available for recycling. The right must be one of + * MACH_PORT_RIGHT_RECEIVE + * MACH_PORT_RIGHT_PORT_SET + * MACH_PORT_RIGHT_DEAD_NAME + * MACH_PORT_RIGHT_SEND + * MACH_PORT_RIGHT_SEND_ONCE + */ + +routine mach_port_mod_refs( + task : ipc_space_t; + name : mach_port_name_t; + right : mach_port_right_t; + delta : mach_port_delta_t); + +skip; + +/* + * Only valid for receive rights. + * Sets the make-send count for the port. + */ +routine mach_port_set_mscount( + task : ipc_space_t; + name : mach_port_name_t; + mscount : mach_port_mscount_t); + +/* + * Only valid for port sets. Returns a list of + * the members. + */ + +routine mach_port_get_set_status( + task : ipc_space_t; + name : mach_port_name_t; + out members : mach_port_name_array_t); + +/* + * Puts the member port (the task must have receive rights) + * into the after port set. If the port is already a member + * of any set(s), it is atomically removed from those sets as + * part of this operation. (If after is MACH_PORT_NULL, the + * port is still removed from all current sets). + */ + +routine mach_port_move_member( + task : ipc_space_t; + member : mach_port_name_t; + after : mach_port_name_t); + +/* + * Requests a notification from the kernel. The request + * must supply the send-once right which is used for + * the notification. If a send-once right was previously + * registered, it is returned. The msg_id must be one of + * MACH_NOTIFY_PORT_DESTROYED (receive rights) + * MACH_NOTIFY_DEAD_NAME (send/receive/send-once rights) + * MACH_NOTIFY_NO_SENDERS (receive rights) + * + * The sync value specifies whether a notification should + * get sent immediately, if appropriate. The exact meaning + * depends on the notification: + * MACH_NOTIFY_PORT_DESTROYED: must be zero. + * MACH_NOTIFY_DEAD_NAME: if non-zero, then name can be dead, + * and the notification gets sent immediately. + * If zero, then name can't be dead. + * MACH_NOTIFY_NO_SENDERS: the notification gets sent + * immediately if the current mscount is greater + * than or equal to the sync value and there are no + * extant send rights. + */ + +routine mach_port_request_notification( + task : ipc_space_t; + name : mach_port_name_t; + msgid : mach_msg_id_t; + sync : mach_port_mscount_t; + notify : mach_port_send_once_t; + out previous : mach_port_move_send_once_t); + +/* + * Inserts the specified rights into the target task, + * using the specified name. If inserting send/receive + * rights and the task already has send/receive rights + * for the port, then the names must agree. In any case, + * the task gains a user ref for the port. + */ + +routine mach_port_insert_right( + task : ipc_space_t; + name : mach_port_name_t; + poly : mach_port_poly_t); + +/* + * Returns the specified right for the named port + * in the target task, extracting that right from + * the target task. The target task loses a user + * ref and the name may be available for recycling. + * msgt_name must be one of + * MACH_MSG_TYPE_MOVE_RECEIVE + * MACH_MSG_TYPE_COPY_SEND + * MACH_MSG_TYPE_MAKE_SEND + * MACH_MSG_TYPE_MOVE_SEND + * MACH_MSG_TYPE_MAKE_SEND_ONCE + * MACH_MSG_TYPE_MOVE_SEND_ONCE + */ + +routine mach_port_extract_right( + task : ipc_space_t; + name : mach_port_name_t; + msgt_name : mach_msg_type_name_t; + out poly : mach_port_poly_t); + +/* + * Only valid for receive rights. + * Sets the sequence number for the port. + */ + +routine mach_port_set_seqno( + task : ipc_space_t; + name : mach_port_name_t; + seqno : mach_port_seqno_t); + +/* + * Returns information about a port. + */ + +routine mach_port_get_attributes( + task : ipc_space_t; + name : mach_port_name_t; + flavor : mach_port_flavor_t; + out port_info_out : mach_port_info_t, CountInOut); + +/* + * Set attributes of a port + */ + +routine mach_port_set_attributes( + task : ipc_space_t; + name : mach_port_name_t; + flavor : mach_port_flavor_t; + port_info : mach_port_info_t); + + +/* + * Allocates the specified kind of object, qos version. + * The right must be + * MACH_PORT_RIGHT_RECEIVE + * Like port_allocate_name, but the kernel picks a name. + * It can use any name not associated with a right. + */ + +routine mach_port_allocate_qos( + task : ipc_space_t; + right : mach_port_right_t; + inout qos : mach_port_qos_t; + out name : mach_port_name_t); + + +/* + * Generic interface to allocation various kinds of ports. + * Should never be called directly by users (at least not + * unless they are exceedingly masochistic). + */ + +routine mach_port_allocate_full( + task : ipc_space_t; + right : mach_port_right_t; + proto : mach_port_t; + inout qos : mach_port_qos_t; + inout name : mach_port_name_t); + + +/* + * Pre-expand task port name space. + */ +routine task_set_port_space( + task : ipc_space_t; + table_entries : int); + + +/* + * Returns the exact number of extant send rights + * for the given receive right. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_get_srights( + task : ipc_space_t; + name : mach_port_name_t; + out srights : mach_port_rights_t); + + +/* + * Returns information about an IPC space. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_space_info( + task : ipc_space_t; + out space_info : ipc_info_space_t; + out table_info : ipc_info_name_array_t; + out tree_info : ipc_info_tree_name_array_t); + +/* + * Returns information about the dead-name requests + * registered with the named receive right. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_dnrequest_info( + task : ipc_space_t; + name : mach_port_name_t; + out dnr_total : unsigned; /* total size of table */ + out dnr_used : unsigned); /* amount used */ + +/* + * Return the type and address of the kernel object + * that the given send/receive right represents. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + * + * This interface is DEPRECATED in favor of the new + * mach_port_kernel_object64() call (see below). + */ +routine mach_port_kernel_object( + task : ipc_space_t; + name : mach_port_name_t; + out object_type : unsigned; + out object_addr : unsigned); + + +/* + * Inserts the specified rights into the portset identified + * by the <task, pset> pair. The results of passing in the + * Poly argument via the supplied disposition must yield a + * receive right. + * + * If the <task,pset> pair does not represent a valid portset + * KERN_INVALID_RIGHT is returned. + * + * If the passed in name argument does not represent a receive + * right, KERN_INVALID_CAPABILITY will be returned. + * + * If the port represented by the receive right is already in + * the portset, KERN_ALREADY_IN_SET is returned. + */ +routine mach_port_insert_member( + task : ipc_space_t; + name : mach_port_name_t; + pset : mach_port_name_t); + +/* + * Extracts the specified right from the named portset + * in the target task. + * the target task. The target task loses a user + * ref and the name may be available for recycling. + * msgt_name must be one of + * MACH_MSG_TYPE_MOVE_RECEIVE + * MACH_MSG_TYPE_COPY_SEND + * MACH_MSG_TYPE_MAKE_SEND + * MACH_MSG_TYPE_MOVE_SEND + * MACH_MSG_TYPE_MAKE_SEND_ONCE + * MACH_MSG_TYPE_MOVE_SEND_ONCE + */ + +routine mach_port_extract_member( + task : ipc_space_t; + name : mach_port_name_t; + pset : mach_port_name_t); + +/* + * Only valid for receive rights. + * Gets the context pointer for the port. + */ + +routine mach_port_get_context( + task : ipc_space_t; + name : mach_port_name_t; + out context : mach_vm_address_t); + +/* + * Only valid for receive rights. + * Sets the context pointer for the port. + */ + +routine mach_port_set_context( + task : ipc_space_t; + name : mach_port_name_t; + context : mach_vm_address_t); + +/* + * Return the type and address of the kernel object + * that the given send/receive right represents. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine mach_port_kobject( + task : ipc_space_t; + name : mach_port_name_t; + out object_type : natural_t; + out object_addr : mach_vm_address_t); + + +/* vim: set ft=c : */ diff --git a/i386/include/mach/mach_port.h b/i386/include/mach/mach_port.h new file mode 100644 index 0000000..c964828 --- /dev/null +++ b/i386/include/mach/mach_port.h @@ -0,0 +1,1383 @@ +#ifndef _mach_port_user_ +#define _mach_port_user_ + +/* Module mach_port */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef mach_port_MSG_COUNT +#define mach_port_MSG_COUNT 31 +#endif /* mach_port_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine mach_port_names */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_names +( + ipc_space_t task, + mach_port_name_array_t *names, + mach_msg_type_number_t *namesCnt, + mach_port_type_array_t *types, + mach_msg_type_number_t *typesCnt +); + +/* Routine mach_port_type */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_type +( + ipc_space_t task, + mach_port_name_t name, + mach_port_type_t *ptype +); + +/* Routine mach_port_rename */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_rename +( + ipc_space_t task, + mach_port_name_t old_name, + mach_port_name_t new_name +); + +/* Routine mach_port_allocate_name */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate_name +( + ipc_space_t task, + mach_port_right_t right, + mach_port_name_t name +); + +/* Routine mach_port_allocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate +( + ipc_space_t task, + mach_port_right_t right, + mach_port_name_t *name +); + +/* Routine mach_port_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_destroy +( + ipc_space_t task, + mach_port_name_t name +); + +/* Routine mach_port_deallocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_deallocate +( + ipc_space_t task, + mach_port_name_t name +); + +/* Routine mach_port_get_refs */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_refs +( + ipc_space_t task, + mach_port_name_t name, + mach_port_right_t right, + mach_port_urefs_t *refs +); + +/* Routine mach_port_mod_refs */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_mod_refs +( + ipc_space_t task, + mach_port_name_t name, + mach_port_right_t right, + mach_port_delta_t delta +); + +/* Routine mach_port_set_mscount */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_mscount +( + ipc_space_t task, + mach_port_name_t name, + mach_port_mscount_t mscount +); + +/* Routine mach_port_get_set_status */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_set_status +( + ipc_space_t task, + mach_port_name_t name, + mach_port_name_array_t *members, + mach_msg_type_number_t *membersCnt +); + +/* Routine mach_port_move_member */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_move_member +( + ipc_space_t task, + mach_port_name_t member, + mach_port_name_t after +); + +/* Routine mach_port_request_notification */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_request_notification +( + ipc_space_t task, + mach_port_name_t name, + mach_msg_id_t msgid, + mach_port_mscount_t sync, + mach_port_t notify, + mach_msg_type_name_t notifyPoly, + mach_port_t *previous +); + +/* Routine mach_port_insert_right */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_insert_right +( + ipc_space_t task, + mach_port_name_t name, + mach_port_t poly, + mach_msg_type_name_t polyPoly +); + +/* Routine mach_port_extract_right */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_extract_right +( + ipc_space_t task, + mach_port_name_t name, + mach_msg_type_name_t msgt_name, + mach_port_t *poly, + mach_msg_type_name_t *polyPoly +); + +/* Routine mach_port_set_seqno */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_seqno +( + ipc_space_t task, + mach_port_name_t name, + mach_port_seqno_t seqno +); + +/* Routine mach_port_get_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_attributes +( + ipc_space_t task, + mach_port_name_t name, + mach_port_flavor_t flavor, + mach_port_info_t port_info_out, + mach_msg_type_number_t *port_info_outCnt +); + +/* Routine mach_port_set_attributes */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_attributes +( + ipc_space_t task, + mach_port_name_t name, + mach_port_flavor_t flavor, + mach_port_info_t port_info, + mach_msg_type_number_t port_infoCnt +); + +/* Routine mach_port_allocate_qos */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate_qos +( + ipc_space_t task, + mach_port_right_t right, + mach_port_qos_t *qos, + mach_port_name_t *name +); + +/* Routine mach_port_allocate_full */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_allocate_full +( + ipc_space_t task, + mach_port_right_t right, + mach_port_t proto, + mach_port_qos_t *qos, + mach_port_name_t *name +); + +/* Routine task_set_port_space */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_port_space +( + ipc_space_t task, + int table_entries +); + +/* Routine mach_port_get_srights */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_srights +( + ipc_space_t task, + mach_port_name_t name, + mach_port_rights_t *srights +); + +/* Routine mach_port_space_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_space_info +( + ipc_space_t task, + ipc_info_space_t *space_info, + ipc_info_name_array_t *table_info, + mach_msg_type_number_t *table_infoCnt, + ipc_info_tree_name_array_t *tree_info, + mach_msg_type_number_t *tree_infoCnt +); + +/* Routine mach_port_dnrequest_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_dnrequest_info +( + ipc_space_t task, + mach_port_name_t name, + unsigned *dnr_total, + unsigned *dnr_used +); + +/* Routine mach_port_kernel_object */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_kernel_object +( + ipc_space_t task, + mach_port_name_t name, + unsigned *object_type, + unsigned *object_addr +); + +/* Routine mach_port_insert_member */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_insert_member +( + ipc_space_t task, + mach_port_name_t name, + mach_port_name_t pset +); + +/* Routine mach_port_extract_member */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_extract_member +( + ipc_space_t task, + mach_port_name_t name, + mach_port_name_t pset +); + +/* Routine mach_port_get_context */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_get_context +( + ipc_space_t task, + mach_port_name_t name, + mach_vm_address_t *context +); + +/* Routine mach_port_set_context */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_set_context +( + ipc_space_t task, + mach_port_name_t name, + mach_vm_address_t context +); + +/* Routine mach_port_kobject */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_port_kobject +( + ipc_space_t task, + mach_port_name_t name, + natural_t *object_type, + mach_vm_address_t *object_addr +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__mach_port_subsystem__defined +#define __Request__mach_port_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_port_names_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_type_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t old_name; + mach_port_name_t new_name; + } __Request__mach_port_rename_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_right_t right; + mach_port_name_t name; + } __Request__mach_port_allocate_name_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_right_t right; + } __Request__mach_port_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_right_t right; + } __Request__mach_port_get_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_right_t right; + mach_port_delta_t delta; + } __Request__mach_port_mod_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_mscount_t mscount; + } __Request__mach_port_set_mscount_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_get_set_status_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t member; + mach_port_name_t after; + } __Request__mach_port_move_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notify; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_port_name_t name; + mach_msg_id_t msgid; + mach_port_mscount_t sync; + } __Request__mach_port_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t poly; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_insert_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_msg_type_name_t msgt_name; + } __Request__mach_port_extract_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_seqno_t seqno; + } __Request__mach_port_set_seqno_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_flavor_t flavor; + mach_msg_type_number_t port_info_outCnt; + } __Request__mach_port_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_flavor_t flavor; + mach_msg_type_number_t port_infoCnt; + integer_t port_info[10]; + } __Request__mach_port_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_right_t right; + mach_port_qos_t qos; + } __Request__mach_port_allocate_qos_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t proto; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_port_right_t right; + mach_port_qos_t qos; + mach_port_name_t name; + } __Request__mach_port_allocate_full_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int table_entries; + } __Request__task_set_port_space_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_get_srights_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_port_space_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_dnrequest_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_kernel_object_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_name_t pset; + } __Request__mach_port_insert_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_port_name_t pset; + } __Request__mach_port_extract_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_get_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + mach_vm_address_t context; + } __Request__mach_port_set_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_port_name_t name; + } __Request__mach_port_kobject_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__mach_port_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__mach_port_subsystem__defined +#define __RequestUnion__mach_port_subsystem__defined +union __RequestUnion__mach_port_subsystem { + __Request__mach_port_names_t Request_mach_port_names; + __Request__mach_port_type_t Request_mach_port_type; + __Request__mach_port_rename_t Request_mach_port_rename; + __Request__mach_port_allocate_name_t Request_mach_port_allocate_name; + __Request__mach_port_allocate_t Request_mach_port_allocate; + __Request__mach_port_destroy_t Request_mach_port_destroy; + __Request__mach_port_deallocate_t Request_mach_port_deallocate; + __Request__mach_port_get_refs_t Request_mach_port_get_refs; + __Request__mach_port_mod_refs_t Request_mach_port_mod_refs; + __Request__mach_port_set_mscount_t Request_mach_port_set_mscount; + __Request__mach_port_get_set_status_t Request_mach_port_get_set_status; + __Request__mach_port_move_member_t Request_mach_port_move_member; + __Request__mach_port_request_notification_t Request_mach_port_request_notification; + __Request__mach_port_insert_right_t Request_mach_port_insert_right; + __Request__mach_port_extract_right_t Request_mach_port_extract_right; + __Request__mach_port_set_seqno_t Request_mach_port_set_seqno; + __Request__mach_port_get_attributes_t Request_mach_port_get_attributes; + __Request__mach_port_set_attributes_t Request_mach_port_set_attributes; + __Request__mach_port_allocate_qos_t Request_mach_port_allocate_qos; + __Request__mach_port_allocate_full_t Request_mach_port_allocate_full; + __Request__task_set_port_space_t Request_task_set_port_space; + __Request__mach_port_get_srights_t Request_mach_port_get_srights; + __Request__mach_port_space_info_t Request_mach_port_space_info; + __Request__mach_port_dnrequest_info_t Request_mach_port_dnrequest_info; + __Request__mach_port_kernel_object_t Request_mach_port_kernel_object; + __Request__mach_port_insert_member_t Request_mach_port_insert_member; + __Request__mach_port_extract_member_t Request_mach_port_extract_member; + __Request__mach_port_get_context_t Request_mach_port_get_context; + __Request__mach_port_set_context_t Request_mach_port_set_context; + __Request__mach_port_kobject_t Request_mach_port_kobject; +}; +#endif /* !__RequestUnion__mach_port_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__mach_port_subsystem__defined +#define __Reply__mach_port_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t names; + mach_msg_ool_descriptor_t types; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t namesCnt; + mach_msg_type_number_t typesCnt; + } __Reply__mach_port_names_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_type_t ptype; + } __Reply__mach_port_type_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_rename_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_allocate_name_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_name_t name; + } __Reply__mach_port_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_urefs_t refs; + } __Reply__mach_port_get_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_mod_refs_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_mscount_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t members; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t membersCnt; + } __Reply__mach_port_get_set_status_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_move_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t previous; + /* end of the kernel processed data */ + } __Reply__mach_port_request_notification_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_insert_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t poly; + /* end of the kernel processed data */ + } __Reply__mach_port_extract_right_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_seqno_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t port_info_outCnt; + integer_t port_info_out[10]; + } __Reply__mach_port_get_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_attributes_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_qos_t qos; + mach_port_name_t name; + } __Reply__mach_port_allocate_qos_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_qos_t qos; + mach_port_name_t name; + } __Reply__mach_port_allocate_full_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_port_space_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_port_rights_t srights; + } __Reply__mach_port_get_srights_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t table_info; + mach_msg_ool_descriptor_t tree_info; + /* end of the kernel processed data */ + NDR_record_t NDR; + ipc_info_space_t space_info; + mach_msg_type_number_t table_infoCnt; + mach_msg_type_number_t tree_infoCnt; + } __Reply__mach_port_space_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + unsigned dnr_total; + unsigned dnr_used; + } __Reply__mach_port_dnrequest_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + unsigned object_type; + unsigned object_addr; + } __Reply__mach_port_kernel_object_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_insert_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_extract_member_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t context; + } __Reply__mach_port_get_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_port_set_context_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + natural_t object_type; + mach_vm_address_t object_addr; + } __Reply__mach_port_kobject_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__mach_port_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__mach_port_subsystem__defined +#define __ReplyUnion__mach_port_subsystem__defined +union __ReplyUnion__mach_port_subsystem { + __Reply__mach_port_names_t Reply_mach_port_names; + __Reply__mach_port_type_t Reply_mach_port_type; + __Reply__mach_port_rename_t Reply_mach_port_rename; + __Reply__mach_port_allocate_name_t Reply_mach_port_allocate_name; + __Reply__mach_port_allocate_t Reply_mach_port_allocate; + __Reply__mach_port_destroy_t Reply_mach_port_destroy; + __Reply__mach_port_deallocate_t Reply_mach_port_deallocate; + __Reply__mach_port_get_refs_t Reply_mach_port_get_refs; + __Reply__mach_port_mod_refs_t Reply_mach_port_mod_refs; + __Reply__mach_port_set_mscount_t Reply_mach_port_set_mscount; + __Reply__mach_port_get_set_status_t Reply_mach_port_get_set_status; + __Reply__mach_port_move_member_t Reply_mach_port_move_member; + __Reply__mach_port_request_notification_t Reply_mach_port_request_notification; + __Reply__mach_port_insert_right_t Reply_mach_port_insert_right; + __Reply__mach_port_extract_right_t Reply_mach_port_extract_right; + __Reply__mach_port_set_seqno_t Reply_mach_port_set_seqno; + __Reply__mach_port_get_attributes_t Reply_mach_port_get_attributes; + __Reply__mach_port_set_attributes_t Reply_mach_port_set_attributes; + __Reply__mach_port_allocate_qos_t Reply_mach_port_allocate_qos; + __Reply__mach_port_allocate_full_t Reply_mach_port_allocate_full; + __Reply__task_set_port_space_t Reply_task_set_port_space; + __Reply__mach_port_get_srights_t Reply_mach_port_get_srights; + __Reply__mach_port_space_info_t Reply_mach_port_space_info; + __Reply__mach_port_dnrequest_info_t Reply_mach_port_dnrequest_info; + __Reply__mach_port_kernel_object_t Reply_mach_port_kernel_object; + __Reply__mach_port_insert_member_t Reply_mach_port_insert_member; + __Reply__mach_port_extract_member_t Reply_mach_port_extract_member; + __Reply__mach_port_get_context_t Reply_mach_port_get_context; + __Reply__mach_port_set_context_t Reply_mach_port_set_context; + __Reply__mach_port_kobject_t Reply_mach_port_kobject; +}; +#endif /* !__RequestUnion__mach_port_subsystem__defined */ + +#ifndef subsystem_to_name_map_mach_port +#define subsystem_to_name_map_mach_port \ + { "mach_port_names", 3200 },\ + { "mach_port_type", 3201 },\ + { "mach_port_rename", 3202 },\ + { "mach_port_allocate_name", 3203 },\ + { "mach_port_allocate", 3204 },\ + { "mach_port_destroy", 3205 },\ + { "mach_port_deallocate", 3206 },\ + { "mach_port_get_refs", 3207 },\ + { "mach_port_mod_refs", 3208 },\ + { "mach_port_set_mscount", 3210 },\ + { "mach_port_get_set_status", 3211 },\ + { "mach_port_move_member", 3212 },\ + { "mach_port_request_notification", 3213 },\ + { "mach_port_insert_right", 3214 },\ + { "mach_port_extract_right", 3215 },\ + { "mach_port_set_seqno", 3216 },\ + { "mach_port_get_attributes", 3217 },\ + { "mach_port_set_attributes", 3218 },\ + { "mach_port_allocate_qos", 3219 },\ + { "mach_port_allocate_full", 3220 },\ + { "task_set_port_space", 3221 },\ + { "mach_port_get_srights", 3222 },\ + { "mach_port_space_info", 3223 },\ + { "mach_port_dnrequest_info", 3224 },\ + { "mach_port_kernel_object", 3225 },\ + { "mach_port_insert_member", 3226 },\ + { "mach_port_extract_member", 3227 },\ + { "mach_port_get_context", 3228 },\ + { "mach_port_set_context", 3229 },\ + { "mach_port_kobject", 3230 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _mach_port_user_ */ diff --git a/i386/include/mach/mach_syscalls.h b/i386/include/mach/mach_syscalls.h new file mode 100644 index 0000000..0e04e4f --- /dev/null +++ b/i386/include/mach/mach_syscalls.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_MACH_SYSCALLS_H_ +#define _MACH_MACH_SYSCALLS_H_ + +#include <mach/mach_traps.h> + +#endif /* _MACH_MACH_SYSCALLS_H_ */ diff --git a/i386/include/mach/mach_time.h b/i386/include/mach/mach_time.h new file mode 100644 index 0000000..6a7ce4f --- /dev/null +++ b/i386/include/mach/mach_time.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2001-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACH_TIME_H_ +#define _MACH_MACH_TIME_H_ + +#include <mach/mach_types.h> + +#include <sys/cdefs.h> + +struct mach_timebase_info { + uint32_t numer; + uint32_t denom; +}; + +typedef struct mach_timebase_info *mach_timebase_info_t; +typedef struct mach_timebase_info mach_timebase_info_data_t; + +__BEGIN_DECLS + +kern_return_t mach_timebase_info( + mach_timebase_info_t info); + +kern_return_t mach_wait_until( + uint64_t deadline); + + +uint64_t mach_absolute_time(void); +__END_DECLS + +#endif /* _MACH_MACH_TIME_H_ */ diff --git a/i386/include/mach/mach_traps.h b/i386/include/mach/mach_traps.h new file mode 100644 index 0000000..50cbd0a --- /dev/null +++ b/i386/include/mach/mach_traps.h @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Definitions of general Mach system traps. + * + * These are the definitions as seen from user-space. + * The kernel definitions are in <mach/syscall_sw.h>. + * Kernel RPC functions are defined in <mach/mach_interface.h>. + */ + +#ifndef _MACH_MACH_TRAPS_H_ +#define _MACH_MACH_TRAPS_H_ + +#include <stdint.h> + +#include <mach/std_types.h> +#include <mach/mach_types.h> +#include <mach/kern_return.h> +#include <mach/port.h> +#include <mach/vm_types.h> +#include <mach/clock_types.h> + +#include <machine/endian.h> + +#include <sys/cdefs.h> + +__BEGIN_DECLS + + + +extern kern_return_t macx_swapon( + uint64_t filename, + int flags, + int size, + int priority); + +extern kern_return_t macx_swapoff( + uint64_t filename, + int flags); + +extern kern_return_t macx_triggers( + int hi_water, + int low_water, + int flags, + mach_port_t alert_port); + +extern kern_return_t macx_backing_store_suspend( + boolean_t suspend); + +extern kern_return_t macx_backing_store_recovery( + int pid); + +extern boolean_t swtch_pri(int pri); + +extern boolean_t swtch(void); + +extern kern_return_t thread_switch( + mach_port_name_t thread_name, + int option, + mach_msg_timeout_t option_time); + +extern mach_port_name_t task_self_trap(void); + +/* + * Obsolete interfaces. + */ + +extern kern_return_t task_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *t); + +extern kern_return_t task_name_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *tn); + +extern kern_return_t pid_for_task( + mach_port_name_t t, + int *x); + +#if !defined(__LP64__) +/* these should go away altogether - so no 64 legacy please */ + +extern kern_return_t map_fd( + int fd, + vm_offset_t offset, + vm_offset_t *va, + boolean_t findspace, + vm_size_t size); + +#endif /* !defined(__LP64__) */ + + +__END_DECLS + +#endif /* _MACH_MACH_TRAPS_H_ */ diff --git a/i386/include/mach/mach_types.defs b/i386/include/mach/mach_types.defs new file mode 100644 index 0000000..d325179 --- /dev/null +++ b/i386/include/mach/mach_types.defs @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * NOTICE: This file was modified by McAfee Research in 2004 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ +/* + */ +/* + * Mach kernel interface type declarations + */ + +#ifndef _MACH_MACH_TYPES_DEFS_ +#define _MACH_MACH_TYPES_DEFS_ + + +#include <mach/std_types.defs> + +type memory_object_offset_t = uint64_t; +type memory_object_size_t = uint64_t; +type memory_object_cluster_size_t = uint32_t; +type memory_object_fault_info_t = array[16] of integer_t; + + +type mach_port_status_t = struct[10] of integer_t; /* obsolete */ + + /* mach_port_info_t: can hold either a + * mach_port_status_t (9 ints) or a + * mach_port_limits_t (1 int). If new flavors of + * mach_port_{get,set}_attributes are added, the size of + * this array may have to be increased. (See mach/port.h) + */ +type mach_port_flavor_t = int; +type mach_port_info_t = array[*:10] of integer_t; + +type task_t = mach_port_t +#if KERNEL_SERVER + intran: task_t convert_port_to_task(mach_port_t) + outtran: mach_port_t convert_task_to_port(task_t) + destructor: task_deallocate(task_t) +#endif /* KERNEL_SERVER */ + ; + +type task_name_t = mach_port_t +#if KERNEL_SERVER + intran: task_name_t convert_port_to_task_name(mach_port_t) + outtran: mach_port_t convert_task_name_to_port(task_name_t) + destructor: task_name_deallocate(task_name_t) +#endif /* KERNEL_SERVER */ + ; + +type thread_t = mach_port_t +#if KERNEL_SERVER + intran: thread_t convert_port_to_thread(mach_port_t) + outtran: mach_port_t convert_thread_to_port(thread_t) + destructor: thread_deallocate(thread_t) +#endif /* KERNEL_SERVER */ + ; + +type thread_act_t = mach_port_t +#if KERNEL_SERVER + intran: thread_act_t convert_port_to_thread(mach_port_t) + outtran: mach_port_t convert_thread_to_port(thread_act_t) + destructor: thread_deallocate(thread_act_t) +#endif /* KERNEL_SERVER */ + ; + +type thread_act_consume_ref_t = mach_port_move_send_t + cusertype: thread_act_t +#if KERNEL_SERVER + intran: thread_act_t convert_port_to_thread(mach_port_t) + destructor: thread_deallocate(thread_act_t) +#endif /* KERNEL_SERVER */ + ; + + /* thread_state_t: This inline array can hold + * a machine-dependent amount of data, defined in + * mach/machine/???? (currently THREAD_STATE_MAX, + * in mach/thread_state.h) + */ +#include <mach/machine/thread_state.h> +type thread_state_flavor_t = int; +type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t; + +type task_array_t = ^array[] of task_t; +type thread_array_t = ^array[] of thread_t; +type thread_act_array_t = ^array[] of thread_act_t; +type act_params_t = array[6] of int; + +type vm_map_t = mach_port_t +#if KERNEL_SERVER + intran: vm_map_t convert_port_to_map(mach_port_t) + destructor: vm_map_deallocate(vm_map_t) +#endif /* KERNEL_SERVER */ + ; + +type vm_task_entry_t = mach_port_t + cusertype: vm_map_t +#if KERNEL_SERVER + intran: vm_map_t convert_port_entry_to_map(mach_port_t) + destructor: vm_map_deallocate(vm_map_t) +#endif /* KERNEL_SERVER */ + ; + +type ipc_space_t = mach_port_t +#if KERNEL_SERVER + intran: ipc_space_t convert_port_to_space(mach_port_t) + destructor: space_deallocate(ipc_space_t) +#endif /* KERNEL_SERVER */ + ; + +type vm_prot_t = int; +type vm_inherit_t = int; +type vm_purgable_t = int; +type xxx_vm_statistics_data_t = struct[13] of integer_t; +type vm_behavior_t = int; +type vm_statistics_data_t = struct[15] of integer_t; +type vm_machine_attribute_t = int; +type vm_machine_attribute_val_t = int; +type vm_sync_t = int; + + /* thread_info_t: this inline array can hold any of: + * thread_basic_info_t (10 ints) + * policy_timeshare_info_t (5 ints) + * policy_fifo_info_t (4 ints) + * policy_rr_info_t (5 ints) + * if other thread_info flavors are added, this + * definition may need to be changed. (See + * mach/thread_info.h and mach/policy.h) */ +type thread_flavor_t = int; +type thread_info_t = array[*:12] of integer_t; + +type thread_policy_flavor_t = natural_t; +type thread_policy_t = array[*:16] of integer_t; + + /* task_info_t: this inline array can hold any of: + * task_basic_info_32_t (8 ints) + * task_basic_info_64_t (10 ints) + * task_events_info_t (8 ints) + * task_thread_times_info_t (4 ints) + * policy_timeshare_info_t (5 ints) + * policy_fifo_info_t (4 ints) + * policy_rr_info_t (5 ints) + * task security token (2 ints) + * task audit token (8 ints) + * If other task_info flavors are added, this + * definition may need to be changed. (See + * mach/task_info.h and mach/policy.h) */ +type task_flavor_t = int; +type task_info_t = array[*:10] of integer_t; + +type task_policy_flavor_t = natural_t; +type task_policy_t = array[*:16] of integer_t; + +type mem_entry_name_port_t = mach_port_t +#if KERNEL_SERVER + intran: mem_entry_name_port_t null_conversion(mach_port_t) + outtran: mach_port_t null_conversion(mem_entry_name_port_t) +#endif /* KERNEL_SERVER */ + ; + +type mem_entry_name_port_move_send_t = mach_port_move_send_t + cusertype: mem_entry_name_port_t +#if KERNEL_SERVER + intran: mem_entry_name_port_t null_conversion(mach_port_t) + outtran: mach_port_t null_conversion(mem_entry_name_port_t) +#endif /* KERNEL_SERVER */ + ; + +type memory_object_default_t = mach_port_t + ; + +type memory_object_t = mach_port_t + ; + + +type memory_object_control_t = mach_port_t + ; + +type memory_object_name_t = mach_port_t + ctype: mach_port_t + ; + + +type memory_object_copy_strategy_t = int; +type memory_object_return_t = int; + +type machine_info_data_t = struct[5] of integer_t; +type machine_slot_data_t = struct[8] of integer_t; + +type host_t = mach_port_t +#if KERNEL_SERVER + intran: host_t convert_port_to_host(mach_port_t) + outtran: mach_port_t convert_host_to_port(host_t) +#endif /* KERNEL_SERVER */ + ; + +type host_priv_t = mach_port_t +#if KERNEL_SERVER + intran: host_priv_t convert_port_to_host_priv(mach_port_t) +#endif /* KERNEL_SERVER */ + ; + +type host_security_t = mach_port_t +#if KERNEL_SERVER + intran: host_security_t convert_port_to_host_security(mach_port_t) +#endif /* KERNEL_SERVER */ + ; + + /* + * host_info_t: variable-sized inline array that can contain: + * + * host_basic_info_old_t (5 ints) + * host_basic_info_t (12 ints) + * host_sched_info_t (2 ints) + * kernel_resource_sizes_t (5 ints) + * host_load_info_t (6 ints) + * vm_statistics32_t (15 ints) + * + * If other host_info flavors are added, this definition may + * need to be changed. (See mach/{host_info,vm_statistics}.h) + */ +type host_flavor_t = int; +type host_info_t = array[*:15] of integer_t; + + + /* + * host_info64_t: variable-sized inline array that can contain: + * + * vm_statistics_t (6 ints and 9 longs) + */ +type host_info64_t = array[*:256] of integer_t; + +type processor_t = mach_port_t +#if KERNEL_SERVER + intran: processor_t convert_port_to_processor(mach_port_t) + outtran: mach_port_t convert_processor_to_port(processor_t) +#endif /* KERNEL_SERVER */ + ; + +type processor_array_t = ^array[] of processor_t; + + /* processor_info_t: variable-sized inline array that can + * contain: + * processor_basic_info_t: (5 ints) + * processor_cpu_load_info_t:(4 ints) + * processor_machine_info_t :(12 ints) + * If other processor_info flavors are added, this definition + * may need to be changed. (See mach/processor_info.h) */ +type processor_flavor_t = int; +type processor_info_t = array[*:12] of integer_t; +type processor_info_array_t = ^array[] of integer_t; + +type processor_set_t = mach_port_t +#if KERNEL_SERVER + intran: processor_set_t convert_port_to_pset(mach_port_t) + outtran: mach_port_t convert_pset_to_port(processor_set_t) + destructor: pset_deallocate(processor_set_t) +#endif /* KERNEL_SERVER */ + ; + +type processor_set_array_t = ^array[] of processor_set_t; + +type processor_set_name_t = mach_port_t +#if KERNEL_SERVER + intran: processor_set_name_t convert_port_to_pset_name(mach_port_t) + outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t) + destructor: pset_deallocate(processor_set_name_t) +#endif /* KERNEL_SERVER */ + ; + +type processor_set_name_array_t = ^array[] of processor_set_name_t; + + /* processor_set_info_t: variable-size inline array + * that can hold: + * processor_set_basic_info (5 ints) + * processor_set_load_info (4 ints) + * policy_timeshare_base_t (1 int) + * policy_fifo_base_t (1 int) + * policy_rr_base_t (1 int) + * policy_timeshare_base_t (1 int) + * policy_fifo_base_t (1 int) + * policy_rr_base_t (1 int) + * policy_t (1 int) + * If other flavors are added, this definition may + * need to be changed. (see mach/processor.h) */ +type processor_set_flavor_t = int; +type processor_set_info_t = array[*:5] of integer_t; + +type bootstrap_t = mach_port_t; + +type kernel_version_t = c_string[*:512]; +type kernel_boot_info_t = c_string[*:4096]; + +type time_value_t = struct[2] of integer_t; + +type mach_port_qos_t = struct[2] of integer_t; + +type emulation_vector_t = ^array[] of vm_offset_t; + +type inline_existence_map_t = array[*:512] of char; + +type policy_t = int; + /* policy_info_t: variable-size inline array. Can hold: + * policy_timeshare_info_t (5 ints) + * policy_fifo_info_t (4 ints) + * policy_rr_info_t (5 ints) */ +type policy_base_t = array[*:5] of integer_t; +type policy_info_t = array[*:2] of integer_t; +type policy_limit_t = array[*:1] of integer_t; + +type ledger_t = mach_port_t +#if KERNEL_SERVER + intran: ledger_t convert_port_to_ledger(mach_port_t) + outtran: mach_port_t convert_ledger_to_port(ledger_t) +#endif /* KERNEL_SERVER */ + ; + +type ledger_array_t = ^array[] of ledger_t; +type ledger_item_t = integer_t; + +type security_token_t = struct[2] of uint32_t; +type audit_token_t = struct[8] of uint32_t; + +type msg_labels_t = mach_port_t; + + /* memory_object_info_t: variable-size inline array: + * memory_object_attr_info_t (5 ints) + * XXX actually it's 6 ints temporarily (object_ready!) + * memory_object_behave_info_t (4 ints) + * memory_object_perf_info_t (2 ints) + * old_memory_object_attr_info_t (3 ints) + * memory_object_norma_info_t (5 ints) + * If other flavors are added, this definition may + * need to be changed. (see mach/memory_object.h) */ +type memory_object_flavor_t = int; +type memory_object_info_t = array[*:6] of int; + + /* vm_region_info_t: variable-size inline array that can hold: + * vm_region_basic_info_t (8 ints) + * If other flavors are added, this definition may + * need to be changed. (see mach/vm_region.h) */ +type vm_region_flavor_t = int; +type vm_region_info_t = array[*:10] of int; +type vm_region_recurse_info_t = array[*:19] of int; + +type vm_page_info_flavor_t = int; +type vm_page_info_t = array[*:32] of int; + +type mach_vm_read_entry_t = array[512] of mach_vm_offset_t; +type vm_read_entry_t = array[512] of vm_offset_t; +#if VM32_SUPPORT +type vm32_read_entry_t = array[512] of vm32_offset_t; +#endif + +type exception_mask_t = int; +type exception_behavior_t = int; + +type exception_handler_t = mach_port_t; + +type exception_handler_array_t = + array[*:32] of exception_handler_t; + +type exception_behavior_array_t = + array[*:32] of exception_behavior_t; + +type exception_flavor_array_t = + array[*:32] of thread_state_flavor_t; + +type exception_mask_array_t = + array[*:32] of exception_mask_t; + +type semaphore_t = mach_port_t +#if KERNEL_SERVER + intran: semaphore_t convert_port_to_semaphore(mach_port_t) + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) + destructor: semaphore_dereference(semaphore_t) +#endif /* KERNEL_SERVER */ + ; + +type semaphore_consume_ref_t = mach_port_move_send_t + cusertype: semaphore_t +#if KERNEL_SERVER + intran: semaphore_t convert_port_to_semaphore(mach_port_t) + outtran: mach_port_t convert_semaphore_to_port(semaphore_t) + destructor: semaphore_dereference(semaphore_t) +#endif /* KERNEL_SERVER */ + ; + +type lock_set_t = mach_port_t +#if KERNEL_SERVER + intran: lock_set_t convert_port_to_lock_set(mach_port_t) + outtran: mach_port_t convert_lock_set_to_port(lock_set_t) + destructor: lock_set_dereference(lock_set_t) +#endif /* KERNEL_SERVER */ + ; + +/* kernel module loader */ +type kmod_t = int; +type kmod_control_flavor_t = int; + +type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE + ctype: kmod_args_t; + +type io_master_t = mach_port_t; +type UNDServerRef = mach_port_t; + +#if KERNEL_SERVER + +simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */ + +#endif /* KERNEL_SERVER */ + +import <mach/mig.h>; +import <mach/mach_types.h>; + +#endif /* _MACH_MACH_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/mach_types.h b/i386/include/mach/mach_types.h new file mode 100644 index 0000000..30ebec9 --- /dev/null +++ b/i386/include/mach/mach_types.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ +/* + * File: mach/mach_types.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1986 + * + * Mach external interface definitions. + * + */ + +#ifndef _MACH_MACH_TYPES_H_ +#define _MACH_MACH_TYPES_H_ + +#include <stdint.h> + +#include <sys/cdefs.h> + +#include <mach/host_info.h> +#include <mach/host_notify.h> +#include <mach/host_special_ports.h> +#include <mach/machine.h> +#include <mach/machine/vm_types.h> +#include <mach/memory_object_types.h> +#include <mach/message.h> +#include <mach/exception_types.h> +#include <mach/port.h> +#include <mach/processor_info.h> +#include <mach/task_info.h> +#include <mach/task_policy.h> +#include <mach/task_special_ports.h> +#include <mach/thread_info.h> +#include <mach/thread_policy.h> +#include <mach/thread_special_ports.h> +#include <mach/thread_status.h> +#include <mach/time_value.h> +#include <mach/clock_types.h> +#include <mach/vm_attributes.h> +#include <mach/vm_inherit.h> +#include <mach/vm_purgable.h> +#include <mach/vm_behavior.h> +#include <mach/vm_prot.h> +#include <mach/vm_statistics.h> +#include <mach/vm_sync.h> +#include <mach/vm_types.h> +#include <mach/vm_region.h> +#include <mach/kmod.h> + + +/* + * If we are not in the kernel, then these will all be represented by + * ports at user-space. + */ +typedef mach_port_t task_t; +typedef mach_port_t task_name_t; +typedef mach_port_t thread_t; +typedef mach_port_t thread_act_t; +typedef mach_port_t ipc_space_t; +typedef mach_port_t host_t; +typedef mach_port_t host_priv_t; +typedef mach_port_t host_security_t; +typedef mach_port_t processor_t; +typedef mach_port_t processor_set_t; +typedef mach_port_t processor_set_control_t; +typedef mach_port_t semaphore_t; +typedef mach_port_t lock_set_t; +typedef mach_port_t ledger_t; +typedef mach_port_t alarm_t; +typedef mach_port_t clock_serv_t; +typedef mach_port_t clock_ctrl_t; + + +/* + * These aren't really unique types. They are just called + * out as unique types at one point in history. So we list + * them here for compatibility. + */ +typedef processor_set_t processor_set_name_t; + +/* + * These types are just hard-coded as ports + */ +typedef mach_port_t clock_reply_t; +typedef mach_port_t bootstrap_t; +typedef mach_port_t mem_entry_name_port_t; +typedef mach_port_t exception_handler_t; +typedef exception_handler_t *exception_handler_array_t; +typedef mach_port_t vm_task_entry_t; +typedef mach_port_t io_master_t; +typedef mach_port_t UNDServerRef; + +/* + * Mig doesn't translate the components of an array. + * For example, Mig won't use the thread_t translations + * to translate a thread_array_t argument. So, these definitions + * are not completely accurate at the moment for other kernel + * components. + */ +typedef task_t *task_array_t; +typedef thread_t *thread_array_t; +typedef processor_set_t *processor_set_array_t; +typedef processor_set_t *processor_set_name_array_t; +typedef processor_t *processor_array_t; +typedef thread_act_t *thread_act_array_t; +typedef ledger_t *ledger_array_t; + +/* + * However the real mach_types got declared, we also have to declare + * types with "port" in the name for compatability with the way OSF + * had declared the user interfaces at one point. Someday these should + * go away. + */ +typedef task_t task_port_t; +typedef task_array_t task_port_array_t; +typedef thread_t thread_port_t; +typedef thread_array_t thread_port_array_t; +typedef ipc_space_t ipc_space_port_t; +typedef host_t host_name_t; +typedef host_t host_name_port_t; +typedef processor_set_t processor_set_port_t; +typedef processor_set_t processor_set_name_port_t; +typedef processor_set_array_t processor_set_name_port_array_t; +typedef processor_set_t processor_set_control_port_t; +typedef processor_t processor_port_t; +typedef processor_array_t processor_port_array_t; +typedef thread_act_t thread_act_port_t; +typedef thread_act_array_t thread_act_port_array_t; +typedef semaphore_t semaphore_port_t; +typedef lock_set_t lock_set_port_t; +typedef ledger_t ledger_port_t; +typedef ledger_array_t ledger_port_array_t; +typedef alarm_t alarm_port_t; +typedef clock_serv_t clock_serv_port_t; +typedef clock_ctrl_t clock_ctrl_port_t; +typedef exception_handler_t exception_port_t; +typedef exception_handler_array_t exception_port_arrary_t; + + +#define TASK_NULL ((task_t) 0) +#define TASK_NAME_NULL ((task_name_t) 0) +#define THREAD_NULL ((thread_t) 0) +#define THR_ACT_NULL ((thread_act_t) 0) +#define IPC_SPACE_NULL ((ipc_space_t) 0) +#define HOST_NULL ((host_t) 0) +#define HOST_PRIV_NULL ((host_priv_t)0) +#define HOST_SECURITY_NULL ((host_security_t)0) +#define PROCESSOR_SET_NULL ((processor_set_t) 0) +#define PROCESSOR_NULL ((processor_t) 0) +#define SEMAPHORE_NULL ((semaphore_t) 0) +#define LOCK_SET_NULL ((lock_set_t) 0) +#define LEDGER_NULL ((ledger_t) 0) +#define ALARM_NULL ((alarm_t) 0) +#define CLOCK_NULL ((clock_t) 0) +#define UND_SERVER_NULL ((UNDServerRef) 0) + +typedef natural_t ledger_item_t; +#define LEDGER_ITEM_INFINITY ((ledger_item_t) (~0)) + +typedef mach_vm_offset_t *emulation_vector_t; +typedef char *user_subsystem_t; + +typedef char *labelstr_t; +/* + * Backwards compatibility, for those programs written + * before mach/{std,mach}_types.{defs,h} were set up. + */ +#include <mach/std_types.h> + +#endif /* _MACH_MACH_TYPES_H_ */ diff --git a/i386/include/mach/mach_vm.defs b/i386/include/mach/mach_vm.defs new file mode 100644 index 0000000..8dbb71f --- /dev/null +++ b/i386/include/mach/mach_vm.defs @@ -0,0 +1,480 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_vm.defs + * + * Exported kernel VM calls (for any task on the platform). + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) + mach_vm +#else + vm_map_lp64_local +#endif + 4800; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Allocate zero-filled memory in the address space + * of the target task, either at the specified address, + * or wherever space can be found (controlled by flags), + * of the specified size. The address at which the + * allocation actually took place is returned. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_allocate( +#else +routine vm_allocate( +#endif + target : vm_task_entry_t; + inout address : mach_vm_address_t; + size : mach_vm_size_t; + flags : int); + +/* + * Deallocate the specified range from the virtual + * address space of the target virtual memory map. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_deallocate( +#else +routine vm_deallocate( +#endif + target : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t); + +/* + * Set the current or maximum protection attribute + * for the specified range of the virtual address + * space of the target virtual memory map. The current + * protection limits the memory access rights of threads + * within the map; the maximum protection limits the accesses + * that may be given in the current protection. + * Protections are specified as a set of {read, write, execute} + * *permissions*. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_protect( +#else +routine vm_protect( +#endif + target_task : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + set_maximum : boolean_t; + new_protection : vm_prot_t); + +/* + * Set the inheritance attribute for the specified range + * of the virtual address space of the target address space. + * The inheritance value is one of {none, copy, share}, and + * specifies how the child address space should acquire + * this memory at the time of a task_create call. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_inherit( +#else +routine vm_inherit( +#endif + target_task : vm_task_entry_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + new_inheritance : vm_inherit_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit reading.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_read( +#else +routine vm_read( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + out data : pointer_t); + +/* + * List corrollary to vm_read, returns mapped contents of specified + * ranges within target address space. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_read_list( +#else +routine vm_read_list( +#endif + target_task : vm_map_t; + inout data_list : mach_vm_read_entry_t; + count : natural_t); + +/* + * Writes the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit writing.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_write( +#else +routine vm_write( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + data : pointer_t); + +/* + * Copy the contents of the source range of the virtual + * address space of the target task to the destination + * range in that same address space. [Both of the + * ranges must be aligned on a virtual page boundary, + * and must be multiples of pages in extent. The + * protection on the source range must permit reading, + * and the protection on the destination range must + * permit writing.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_copy( +#else +routine vm_copy( +#endif + target_task : vm_map_t; + source_address : mach_vm_address_t; + size : mach_vm_size_t; + dest_address : mach_vm_address_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [There + * are no alignment restrictions, and the results will + * overwrite the area pointed to by data - which must + * already exist. The protection on the specified range + * must permit reading.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_read_overwrite( +#else +routine vm_read_overwrite( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + data : mach_vm_address_t; + out outsize : mach_vm_size_t); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_msync( +#else +routine vm_msync( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + sync_flags : vm_sync_t ); + +/* + * Set the paging behavior attribute for the specified range + * of the virtual address space of the target task. + * The behavior value is one of {default, random, forward + * sequential, reverse sequential} and indicates the expected + * page reference pattern for the specified range. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_behavior_set( +#else +routine vm_behavior_set( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + new_behavior : vm_behavior_t); + + +/* + * Map a user-supplie memory object into the virtual address + * space of the target task. If desired (anywhere is TRUE), + * the kernel will find a suitable address range of the + * specified size; else, the specific address will be allocated. + * + * The beginning address of the range will be aligned on a virtual + * page boundary, be at or beyond the address specified, and + * meet the mask requirements (bits turned on in the mask must not + * be turned on in the result); the size of the range, in bytes, + * will be rounded up to an integral number of virtual pages. + * + * The memory in the resulting range will be associated with the + * specified memory object, with the beginning of the memory range + * referring to the specified offset into the memory object. + * + * The mapping will take the current and maximum protections and + * the inheritance attributes specified; see the vm_protect and + * vm_inherit calls for a description of these attributes. + * + * If desired (copy is TRUE), the memory range will be filled + * with a copy of the data from the memory object; this copy will + * be private to this mapping in this target task. Otherwise, + * the memory in this mapping will be shared with other mappings + * of the same memory object at the same offset (in this task or + * in other tasks). [The Mach kernel only enforces shared memory + * consistency among mappings on one host with similar page alignments. + * The user-defined memory manager for this object is responsible + * for further consistency.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_map( +#else +routine vm_map( +#endif + target_task : vm_task_entry_t; + inout address : mach_vm_address_t; + size : mach_vm_size_t; + mask : mach_vm_offset_t; + flags : int; + object : mem_entry_name_port_t; + offset : memory_object_offset_t; + copy : boolean_t; + cur_protection : vm_prot_t; + max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Set/Get special properties of memory associated + * to some virtual address range, such as cachability, + * migrability, replicability. Machine-dependent. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_machine_attribute( +#else +routine vm_machine_attribute( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + size : mach_vm_size_t; + attribute : vm_machine_attribute_t; + inout value : vm_machine_attribute_val_t); + +/* + * Map portion of a task's address space. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_remap( +#else +routine vm_remap( +#endif + target_task : vm_map_t; + inout target_address : mach_vm_address_t; + size : mach_vm_size_t; + mask : mach_vm_offset_t; + anywhere : boolean_t; + src_task : vm_map_t; + src_address : mach_vm_address_t; + copy : boolean_t; + out cur_protection : vm_prot_t; + out max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Give the caller information on the given location in a virtual + * address space. If a page is mapped return ref and dirty info. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_page_query( +#else +routine vm_map_page_query( +#endif + target_map :vm_map_t; + offset :mach_vm_offset_t; + out disposition :integer_t; + out ref_count :integer_t); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_region_recurse( +#else +routine vm_region_recurse_64( +#endif + target_task : vm_map_t; + inout address : mach_vm_address_t; + out size : mach_vm_size_t; + inout nesting_depth : natural_t; + out info : vm_region_recurse_info_t,CountInOut); + +/* + * Returns information about the contents of the virtual + * address space of the target task at the specified + * address. The returned protection, inheritance, sharing + * and memory object values apply to the entire range described + * by the address range returned; the memory object offset + * corresponds to the beginning of the address range. + * [If the specified address is not allocated, the next + * highest address range is described. If no addresses beyond + * the one specified are allocated, the call returns KERN_NO_SPACE.] + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_region( +#else +routine vm_region_64( +#endif + target_task : vm_map_t; + inout address : mach_vm_address_t; + out size : mach_vm_size_t; + flavor : vm_region_flavor_t; + out info : vm_region_info_t, CountInOut; + out object_name : memory_object_name_t = + MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t); + +/* + * Allow application level processes to create named entries which + * correspond to mapped portions of their address space. These named + * entries can then be manipulated, shared with other processes in + * other address spaces and ultimately mapped in ohter address spaces + * + * THIS INTERFACE IS STILL EVOLVING. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +#if !defined(__LP64__) || KERNEL_SERVER || XNU_KERNEL_PRIVATE || LIBSYSCALL_INTERFACE +routine _mach_make_memory_entry( +#else +routine mach_make_memory_entry( +#endif +#else +routine mach_make_memory_entry_64( +#endif + target_task :vm_map_t; + inout size :memory_object_size_t; + offset :memory_object_offset_t; + permission :vm_prot_t; + out object_handle :mem_entry_name_port_move_send_t; + parent_handle :mem_entry_name_port_t); + +/* + * Control behavior and investigate state of a "purgable" object in + * the virtual address space of the target task. A purgable object is + * created via a call to mach_vm_allocate() with VM_FLAGS_PURGABLE + * specified. See the routine implementation for a complete + * definition of the routine. + */ +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_purgable_control( +#else +routine vm_purgable_control( +#endif + target_task : vm_map_t; + address : mach_vm_address_t; + control : vm_purgable_t; + inout state : int); + + +#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) +routine mach_vm_page_info( + target_task : vm_map_t; + address : mach_vm_address_t; + flavor : vm_page_info_flavor_t; + out info : vm_page_info_t, CountInOut); +#else +skip; +#endif + +/****************************** Legacy section ***************************/ +/* The following definitions are exist to provide compatibility with */ +/* the legacy APIs. They are no different. We just need to produce */ +/* the user-level stub interface for them. */ +/****************************** Legacy section ***************************/ + + +/* + * These interfaces just aren't supported in the new (wide) model: + * + * mach_vm_region_info() - + * vm_map_pages_info() - + * no user-level replacement for these MACH_DEBUG interfaces + * vm_map_get_upl() - + * no user-level replacement at the moment + * vm_region_info() - + * use mach_vm_region_info() or vm_region_info_64() + * vm_region_recurse() - + * use mach_vm_region_recurse() or vm_region_recurse_64() + */ + +/* + * The following legacy interfaces are provides as macro wrappers to the new + * interfaces. You should strive to use the new ones instead: + * + * vm_map() - + * use mach_vm_map() or vm_map_64() + * vm_region() - + * use mach_vm_region() or vm_region_64() + * mach_make_memory_entry() - + * use mach_vm_make_memory_entry() or mach_make_memory_entry_64() + */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/mach_vm.h b/i386/include/mach/mach_vm.h new file mode 100644 index 0000000..f72b17e --- /dev/null +++ b/i386/include/mach/mach_vm.h @@ -0,0 +1,1032 @@ +#ifndef _mach_vm_user_ +#define _mach_vm_user_ + +/* Module mach_vm */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef mach_vm_MSG_COUNT +#define mach_vm_MSG_COUNT 20 +#endif /* mach_vm_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine mach_vm_allocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_allocate +( + vm_map_t target, + mach_vm_address_t *address, + mach_vm_size_t size, + int flags +); + +/* Routine mach_vm_deallocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_deallocate +( + vm_map_t target, + mach_vm_address_t address, + mach_vm_size_t size +); + +/* Routine mach_vm_protect */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_protect +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + boolean_t set_maximum, + vm_prot_t new_protection +); + +/* Routine mach_vm_inherit */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_inherit +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_inherit_t new_inheritance +); + +/* Routine mach_vm_read */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_read +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_offset_t *data, + mach_msg_type_number_t *dataCnt +); + +/* Routine mach_vm_read_list */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_read_list +( + vm_map_t target_task, + mach_vm_read_entry_t data_list, + natural_t count +); + +/* Routine mach_vm_write */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_write +( + vm_map_t target_task, + mach_vm_address_t address, + vm_offset_t data, + mach_msg_type_number_t dataCnt +); + +/* Routine mach_vm_copy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_copy +( + vm_map_t target_task, + mach_vm_address_t source_address, + mach_vm_size_t size, + mach_vm_address_t dest_address +); + +/* Routine mach_vm_read_overwrite */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_read_overwrite +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + mach_vm_address_t data, + mach_vm_size_t *outsize +); + +/* Routine mach_vm_msync */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_msync +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_sync_t sync_flags +); + +/* Routine mach_vm_behavior_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_behavior_set +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_behavior_t new_behavior +); + +/* Routine mach_vm_map */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_map +( + vm_map_t target_task, + mach_vm_address_t *address, + mach_vm_size_t size, + mach_vm_offset_t mask, + int flags, + mem_entry_name_port_t object, + memory_object_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance +); + +/* Routine mach_vm_machine_attribute */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_machine_attribute +( + vm_map_t target_task, + mach_vm_address_t address, + mach_vm_size_t size, + vm_machine_attribute_t attribute, + vm_machine_attribute_val_t *value +); + +/* Routine mach_vm_remap */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_remap +( + vm_map_t target_task, + mach_vm_address_t *target_address, + mach_vm_size_t size, + mach_vm_offset_t mask, + boolean_t anywhere, + vm_map_t src_task, + mach_vm_address_t src_address, + boolean_t copy, + vm_prot_t *cur_protection, + vm_prot_t *max_protection, + vm_inherit_t inheritance +); + +/* Routine mach_vm_page_query */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_page_query +( + vm_map_t target_map, + mach_vm_offset_t offset, + integer_t *disposition, + integer_t *ref_count +); + +/* Routine mach_vm_region_recurse */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region_recurse +( + vm_map_t target_task, + mach_vm_address_t *address, + mach_vm_size_t *size, + natural_t *nesting_depth, + vm_region_recurse_info_t info, + mach_msg_type_number_t *infoCnt +); + +/* Routine mach_vm_region */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region +( + vm_map_t target_task, + mach_vm_address_t *address, + mach_vm_size_t *size, + vm_region_flavor_t flavor, + vm_region_info_t info, + mach_msg_type_number_t *infoCnt, + mach_port_t *object_name +); + +/* Routine _mach_make_memory_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t _mach_make_memory_entry +( + vm_map_t target_task, + memory_object_size_t *size, + memory_object_offset_t offset, + vm_prot_t permission, + mem_entry_name_port_t *object_handle, + mem_entry_name_port_t parent_handle +); + +/* Routine mach_vm_purgable_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_purgable_control +( + vm_map_t target_task, + mach_vm_address_t address, + vm_purgable_t control, + int *state +); + +/* Routine mach_vm_page_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_page_info +( + vm_map_t target_task, + mach_vm_address_t address, + vm_page_info_flavor_t flavor, + vm_page_info_t info, + mach_msg_type_number_t *infoCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__mach_vm_subsystem__defined +#define __Request__mach_vm_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + int flags; + } __Request__mach_vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + } __Request__mach_vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + boolean_t set_maximum; + vm_prot_t new_protection; + } __Request__mach_vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_inherit_t new_inheritance; + } __Request__mach_vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + } __Request__mach_vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_read_entry_t data_list; + natural_t count; + } __Request__mach_vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_msg_type_number_t dataCnt; + } __Request__mach_vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t source_address; + mach_vm_size_t size; + mach_vm_address_t dest_address; + } __Request__mach_vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + mach_vm_address_t data; + } __Request__mach_vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_sync_t sync_flags; + } __Request__mach_vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_behavior_t new_behavior; + } __Request__mach_vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + mach_vm_offset_t mask; + int flags; + memory_object_offset_t offset; + boolean_t copy; + vm_prot_t cur_protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + } __Request__mach_vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + vm_machine_attribute_t attribute; + vm_machine_attribute_val_t value; + } __Request__mach_vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t src_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t target_address; + mach_vm_size_t size; + mach_vm_offset_t mask; + boolean_t anywhere; + mach_vm_address_t src_address; + boolean_t copy; + vm_inherit_t inheritance; + } __Request__mach_vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_offset_t offset; + } __Request__mach_vm_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + } __Request__mach_vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + vm_region_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__mach_vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + memory_object_offset_t offset; + vm_prot_t permission; + } __Request___mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + vm_purgable_t control; + int state; + } __Request__mach_vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_vm_address_t address; + vm_page_info_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__mach_vm_page_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__mach_vm_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__mach_vm_subsystem__defined +#define __RequestUnion__mach_vm_subsystem__defined +union __RequestUnion__mach_vm_subsystem { + __Request__mach_vm_allocate_t Request_mach_vm_allocate; + __Request__mach_vm_deallocate_t Request_mach_vm_deallocate; + __Request__mach_vm_protect_t Request_mach_vm_protect; + __Request__mach_vm_inherit_t Request_mach_vm_inherit; + __Request__mach_vm_read_t Request_mach_vm_read; + __Request__mach_vm_read_list_t Request_mach_vm_read_list; + __Request__mach_vm_write_t Request_mach_vm_write; + __Request__mach_vm_copy_t Request_mach_vm_copy; + __Request__mach_vm_read_overwrite_t Request_mach_vm_read_overwrite; + __Request__mach_vm_msync_t Request_mach_vm_msync; + __Request__mach_vm_behavior_set_t Request_mach_vm_behavior_set; + __Request__mach_vm_map_t Request_mach_vm_map; + __Request__mach_vm_machine_attribute_t Request_mach_vm_machine_attribute; + __Request__mach_vm_remap_t Request_mach_vm_remap; + __Request__mach_vm_page_query_t Request_mach_vm_page_query; + __Request__mach_vm_region_recurse_t Request_mach_vm_region_recurse; + __Request__mach_vm_region_t Request_mach_vm_region; + __Request___mach_make_memory_entry_t Request__mach_make_memory_entry; + __Request__mach_vm_purgable_control_t Request_mach_vm_purgable_control; + __Request__mach_vm_page_info_t Request_mach_vm_page_info; +}; +#endif /* !__RequestUnion__mach_vm_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__mach_vm_subsystem__defined +#define __Reply__mach_vm_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + } __Reply__mach_vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t dataCnt; + } __Reply__mach_vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_read_entry_t data_list; + } __Reply__mach_vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_size_t outsize; + } __Reply__mach_vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + } __Reply__mach_vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_machine_attribute_val_t value; + } __Reply__mach_vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t target_address; + vm_prot_t cur_protection; + vm_prot_t max_protection; + } __Reply__mach_vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + integer_t disposition; + integer_t ref_count; + } __Reply__mach_vm_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_vm_address_t address; + mach_vm_size_t size; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + int info[19]; + } __Reply__mach_vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_name; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_vm_address_t address; + mach_vm_size_t size; + mach_msg_type_number_t infoCnt; + int info[10]; + } __Reply__mach_vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + } __Reply___mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int state; + } __Reply__mach_vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t infoCnt; + int info[32]; + } __Reply__mach_vm_page_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__mach_vm_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__mach_vm_subsystem__defined +#define __ReplyUnion__mach_vm_subsystem__defined +union __ReplyUnion__mach_vm_subsystem { + __Reply__mach_vm_allocate_t Reply_mach_vm_allocate; + __Reply__mach_vm_deallocate_t Reply_mach_vm_deallocate; + __Reply__mach_vm_protect_t Reply_mach_vm_protect; + __Reply__mach_vm_inherit_t Reply_mach_vm_inherit; + __Reply__mach_vm_read_t Reply_mach_vm_read; + __Reply__mach_vm_read_list_t Reply_mach_vm_read_list; + __Reply__mach_vm_write_t Reply_mach_vm_write; + __Reply__mach_vm_copy_t Reply_mach_vm_copy; + __Reply__mach_vm_read_overwrite_t Reply_mach_vm_read_overwrite; + __Reply__mach_vm_msync_t Reply_mach_vm_msync; + __Reply__mach_vm_behavior_set_t Reply_mach_vm_behavior_set; + __Reply__mach_vm_map_t Reply_mach_vm_map; + __Reply__mach_vm_machine_attribute_t Reply_mach_vm_machine_attribute; + __Reply__mach_vm_remap_t Reply_mach_vm_remap; + __Reply__mach_vm_page_query_t Reply_mach_vm_page_query; + __Reply__mach_vm_region_recurse_t Reply_mach_vm_region_recurse; + __Reply__mach_vm_region_t Reply_mach_vm_region; + __Reply___mach_make_memory_entry_t Reply__mach_make_memory_entry; + __Reply__mach_vm_purgable_control_t Reply_mach_vm_purgable_control; + __Reply__mach_vm_page_info_t Reply_mach_vm_page_info; +}; +#endif /* !__RequestUnion__mach_vm_subsystem__defined */ + +#ifndef subsystem_to_name_map_mach_vm +#define subsystem_to_name_map_mach_vm \ + { "mach_vm_allocate", 4800 },\ + { "mach_vm_deallocate", 4801 },\ + { "mach_vm_protect", 4802 },\ + { "mach_vm_inherit", 4803 },\ + { "mach_vm_read", 4804 },\ + { "mach_vm_read_list", 4805 },\ + { "mach_vm_write", 4806 },\ + { "mach_vm_copy", 4807 },\ + { "mach_vm_read_overwrite", 4808 },\ + { "mach_vm_msync", 4809 },\ + { "mach_vm_behavior_set", 4810 },\ + { "mach_vm_map", 4811 },\ + { "mach_vm_machine_attribute", 4812 },\ + { "mach_vm_remap", 4813 },\ + { "mach_vm_page_query", 4814 },\ + { "mach_vm_region_recurse", 4815 },\ + { "mach_vm_region", 4816 },\ + { "_mach_make_memory_entry", 4817 },\ + { "mach_vm_purgable_control", 4818 },\ + { "mach_vm_page_info", 4819 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _mach_vm_user_ */ diff --git a/i386/include/mach/machine.h b/i386/include/mach/machine.h new file mode 100644 index 0000000..431d3c9 --- /dev/null +++ b/i386/include/mach/machine.h @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* File: machine.h + * Author: Avadis Tevanian, Jr. + * Date: 1986 + * + * Machine independent machine abstraction. + */ + +#ifndef _MACH_MACHINE_H_ +#define _MACH_MACHINE_H_ + +#include <stdint.h> +#include <mach/machine/vm_types.h> +#include <mach/boolean.h> + +typedef integer_t cpu_type_t; +typedef integer_t cpu_subtype_t; +typedef integer_t cpu_threadtype_t; + +#define CPU_STATE_MAX 4 + +#define CPU_STATE_USER 0 +#define CPU_STATE_SYSTEM 1 +#define CPU_STATE_IDLE 2 +#define CPU_STATE_NICE 3 + + + +/* + * Capability bits used in the definition of cpu_type. + */ +#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */ +#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */ + +/* + * Machine types known by all. + */ + +#define CPU_TYPE_ANY ((cpu_type_t) -1) + +#define CPU_TYPE_VAX ((cpu_type_t) 1) +/* skip ((cpu_type_t) 2) */ +/* skip ((cpu_type_t) 3) */ +/* skip ((cpu_type_t) 4) */ +/* skip ((cpu_type_t) 5) */ +#define CPU_TYPE_MC680x0 ((cpu_type_t) 6) +#define CPU_TYPE_X86 ((cpu_type_t) 7) +#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */ +#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64) + +/* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */ +/* skip ((cpu_type_t) 9) */ +#define CPU_TYPE_MC98000 ((cpu_type_t) 10) +#define CPU_TYPE_HPPA ((cpu_type_t) 11) +#define CPU_TYPE_ARM ((cpu_type_t) 12) +#define CPU_TYPE_MC88000 ((cpu_type_t) 13) +#define CPU_TYPE_SPARC ((cpu_type_t) 14) +#define CPU_TYPE_I860 ((cpu_type_t) 15) +/* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */ +/* skip ((cpu_type_t) 17) */ +#define CPU_TYPE_POWERPC ((cpu_type_t) 18) +#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64) + +/* + * Machine subtypes (these are defined here, instead of in a machine + * dependent directory, so that any program can get all definitions + * regardless of where is it compiled). + */ + +/* + * Capability bits used in the definition of cpu_subtype. + */ +#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */ +#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */ + + +/* + * Object files that are hand-crafted to run on any + * implementation of an architecture are tagged with + * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as + * the "ALL" subtype of an architecture except that it allows us + * to easily find object files that may need to be modified + * whenever a new implementation of an architecture comes out. + * + * It is the responsibility of the implementor to make sure the + * software handles unsupported implementations elegantly. + */ +#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1) +#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1) + +/* + * Machine threadtypes. + * This is none - not defined - for most machine types/subtypes. + */ +#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0) + +/* + * VAX subtypes (these do *not* necessary conform to the actual cpu + * ID assigned by DEC available via the SID register). + */ + +#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4) +#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10) +#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11) +#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12) + +/* + * 680x0 subtypes + * + * The subtype definitions here are unusual for historical reasons. + * NeXT used to consider 68030 code as generic 68000 code. For + * backwards compatability: + * + * CPU_SUBTYPE_MC68030 symbol has been preserved for source code + * compatability. + * + * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same + * subtype as CPU_SUBTYPE_MC68030 for binary comatability. + * + * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object + * files to be tagged as containing 68030-specific instructions. + */ + +#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */ +#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3) + +/* + * I386 subtypes + */ + +#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4)) + +#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0) +#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0) +#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0) +#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128 +#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0) +#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0) +#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1) +#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3) +#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5) +#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6) +#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7) +#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0) +#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1) +#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2) +#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0) +#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0) +#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1) +#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0) +#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1) +#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0) +#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1) + +#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15) +#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15 + +#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4) +#define CPU_SUBTYPE_INTEL_MODEL_ALL 0 + +/* + * X86 subtypes. + */ + +#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3) +#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3) +#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4) + + +#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1) + +/* + * Mips subtypes. + */ + +#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */ +#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */ +#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7) + +/* + * MC98000 (PowerPC) subtypes + */ +#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1) + +/* + * HPPA subtypes for Hewlett-Packard HP-PA family of + * risc processors. Port by NeXT to 700 series. + */ + +#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */ +#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1) + +/* + * MC88000 subtypes. + */ +#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2) + +/* + * SPARC subtypes + */ +#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0) + +/* + * I860 subtypes + */ +#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1) + +/* + * PowerPC subtypes + */ +#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1) +#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2) +#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3) +#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4) +#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9) +#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10) +#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11) +#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100) + +/* + * ARM subtypes + */ +#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0) +#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5) +#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6) +#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7) +#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8) +#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9) + +/* + * CPU families (sysctl hw.cpufamily) + * + * These are meant to identify the CPU's marketing name - an + * application can map these to (possibly) localized strings. + * NB: the encodings of the CPU families are intentionally arbitrary. + * There is no ordering, and you should never try to deduce whether + * or not some feature is available based on the family. + * Use feature flags (eg, hw.optional.altivec) to test for optional + * functionality. + */ +#define CPUFAMILY_UNKNOWN 0 +#define CPUFAMILY_POWERPC_G3 0xcee41549 +#define CPUFAMILY_POWERPC_G4 0x77c184ae +#define CPUFAMILY_POWERPC_G5 0xed76d8aa +#define CPUFAMILY_INTEL_6_13 0xaa33392b +#define CPUFAMILY_INTEL_YONAH 0x73d67300 +#define CPUFAMILY_INTEL_MEROM 0x426f69ef +#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc +#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2 +#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec +#define CPUFAMILY_ARM_9 0xe73283ae +#define CPUFAMILY_ARM_11 0x8ff620d8 +#define CPUFAMILY_ARM_XSCALE 0x53b005f5 +#define CPUFAMILY_ARM_13 0x0cc90e64 + +/* The following synonyms are deprecated: */ +#define CPUFAMILY_INTEL_6_14 CPUFAMILY_INTEL_YONAH +#define CPUFAMILY_INTEL_6_15 CPUFAMILY_INTEL_MEROM +#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN +#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM + +#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_YONAH +#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_MEROM + + +#endif /* _MACH_MACHINE_H_ */ diff --git a/i386/include/mach/machine/.svn/all-wcprops b/i386/include/mach/machine/.svn/all-wcprops new file mode 100644 index 0000000..a8b4017 --- /dev/null +++ b/i386/include/mach/machine/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine +END +processor_info.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/processor_info.h +END +sdt.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/sdt.h +END +thread_status.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/thread_status.h +END +exception.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/exception.h +END +kern_return.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/kern_return.h +END +boolean.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/boolean.h +END +asm.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/asm.h +END +ndr_def.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/ndr_def.h +END +machine_types.defs +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/machine_types.defs +END +vm_param.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/vm_param.h +END +rpc.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/rpc.h +END +sdt_isa.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/sdt_isa.h +END +vm_types.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/vm_types.h +END +thread_state.h +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/machine/thread_state.h +END diff --git a/i386/include/mach/machine/.svn/entries b/i386/include/mach/machine/.svn/entries new file mode 100644 index 0000000..764c053 --- /dev/null +++ b/i386/include/mach/machine/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach/machine +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +processor_info.h +file + + + + +2013-08-27T23:54:42.000000Z +a1dc653a63ab9656f553670320a762ad +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1733 + +sdt.h +file + + + + +2013-08-27T23:54:42.000000Z +e057fd045e731591267e9f144171ff2d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1148 + +thread_status.h +file + + + + +2013-08-27T23:54:42.000000Z +5df1fbeeb645b64b9fbec32d3c36f557 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1727 + +exception.h +file + + + + +2013-08-27T23:54:42.000000Z +4e1602c48f6fd092e5cf0554b1542413 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1703 + +kern_return.h +file + + + + +2013-08-27T23:54:42.000000Z +84793350fd96c226d50deb99d1b93079 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1715 + +boolean.h +file + + + + +2013-08-27T23:54:42.000000Z +ed129aea34f0ea8c899a7dab16743ac6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1691 + +asm.h +file + + + + +2013-08-27T23:54:42.000000Z +703f1e606a80b06f9f776af05d82199f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1664 + +ndr_def.h +file + + + + +2013-08-27T23:54:42.000000Z +cdfbf319c09d956f3bcbbb64c06a718b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1688 + +machine_types.defs +file + + + + +2013-08-27T23:54:42.000000Z +20be84badc8e93ab9a220b3a7fb78a74 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1773 + +vm_param.h +file + + + + +2013-08-27T23:54:42.000000Z +834cdc941cae4ee0628b14e7aa925851 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1697 + +rpc.h +file + + + + +2013-08-27T23:54:42.000000Z +18651b9a531c642be58a5e83c797aabd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1667 + +sdt_isa.h +file + + + + +2013-08-27T23:54:42.000000Z +c8fc1bb3b0b1be6f8fed147cf030f96e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1689 + +vm_types.h +file + + + + +2013-08-27T23:54:42.000000Z +d2a9139a26e9104da3cae11c930a1297 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1696 + +thread_state.h +file + + + + +2013-08-27T23:54:42.000000Z +2eedc91be3d516b83ffa0f4983e71fad +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1720 + diff --git a/i386/include/mach/machine/.svn/text-base/asm.h.svn-base b/i386/include/mach/machine/.svn/text-base/asm.h.svn-base new file mode 100644 index 0000000..59e1da2 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/asm.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_ASM_H +#define _MACH_MACHINE_ASM_H + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/asm.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/asm.h" +#elif defined (__arm__) +#include "mach/arm/asm.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_ASM_H */ diff --git a/i386/include/mach/machine/.svn/text-base/boolean.h.svn-base b/i386/include/mach/machine/.svn/text-base/boolean.h.svn-base new file mode 100644 index 0000000..1bec00d --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/boolean.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_BOOLEAN_H_ +#define _MACH_MACHINE_BOOLEAN_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/boolean.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/boolean.h" +#elif defined (__arm__) +#include "mach/arm/boolean.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_BOOLEAN_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/exception.h.svn-base b/i386/include/mach/machine/.svn/text-base/exception.h.svn-base new file mode 100644 index 0000000..5ce83f2 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/exception.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_EXCEPTION_H_ +#define _MACH_MACHINE_EXCEPTION_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/exception.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/exception.h" +#elif defined (__arm__) +#include "mach/arm/exception.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_EXCEPTION_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/kern_return.h.svn-base b/i386/include/mach/machine/.svn/text-base/kern_return.h.svn-base new file mode 100644 index 0000000..df37396 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/kern_return.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_KERN_RETURN_H_ +#define _MACH_MACHINE_KERN_RETURN_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/kern_return.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/kern_return.h" +#elif defined (__arm__) +#include "mach/arm/kern_return.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_KERN_RETURN_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/machine_types.defs.svn-base b/i386/include/mach/machine/.svn/text-base/machine_types.defs.svn-base new file mode 100644 index 0000000..418d16b --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/machine_types.defs.svn-base @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_MACHINE_TYPES_DEFS +#define _MACH_MACHINE_MACHINE_TYPES_DEFS + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/machine_types.defs" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/machine_types.defs" +#elif defined (__arm__) +#include "mach/arm/machine_types.defs" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/machine/.svn/text-base/ndr_def.h.svn-base b/i386/include/mach/machine/.svn/text-base/ndr_def.h.svn-base new file mode 100644 index 0000000..a7b5a9b --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/ndr_def.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_NDR_DEF_H +#define _MACH_MACHINE_NDR_DEF_H + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/ndr_def.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/ndr_def.h" +#elif defined (__arm__) +#include "mach/arm/ndr_def.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_NDR_DEF_H */ diff --git a/i386/include/mach/machine/.svn/text-base/processor_info.h.svn-base b/i386/include/mach/machine/.svn/text-base/processor_info.h.svn-base new file mode 100644 index 0000000..ca96367 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/processor_info.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_PROCESSOR_INFO_H_ +#define _MACH_MACHINE_PROCESSOR_INFO_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/processor_info.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/processor_info.h" +#elif defined (__arm__) +#include "mach/arm/processor_info.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/rpc.h.svn-base b/i386/include/mach/machine/.svn/text-base/rpc.h.svn-base new file mode 100644 index 0000000..b969bd4 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/rpc.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_RPC_H_ +#define _MACH_MACHINE_RPC_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/rpc.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/rpc.h" +#elif defined (__arm__) +#include "mach/arm/rpc.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_RPC_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/sdt.h.svn-base b/i386/include/mach/machine/.svn/text-base/sdt.h.svn-base new file mode 100644 index 0000000..e85508f --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/sdt.h.svn-base @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + */ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_MACHINE_SYS_SDT_H +#define _MACH_MACHINE_SYS_SDT_H + +#include <mach/machine/sdt_isa.h> + + +#endif /* _MACH_MACHINE_SYS_SDT_H */ diff --git a/i386/include/mach/machine/.svn/text-base/sdt_isa.h.svn-base b/i386/include/mach/machine/.svn/text-base/sdt_isa.h.svn-base new file mode 100644 index 0000000..a8e1379 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/sdt_isa.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_MACHINE_SDT_ISA_H_ +#define _MACH_MACHINE_SDT_ISA_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include <mach/ppc/sdt_isa.h> +#elif defined (__i386__) || defined(__x86_64__) +#include <mach/i386/sdt_isa.h> +#elif defined (__arm__) +#include <mach/arm/sdt_isa.h> +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_SDT_ISA_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/thread_state.h.svn-base b/i386/include/mach/machine/.svn/text-base/thread_state.h.svn-base new file mode 100644 index 0000000..18ffca4 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/thread_state.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_THREAD_STATE_H_ +#define _MACH_MACHINE_THREAD_STATE_H_ + +#if defined (__ppc__) || defined(__ppc64__) +#include "mach/ppc/thread_state.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/thread_state.h" +#elif defined (__arm__) +#include "mach/arm/thread_state.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_THREAD_STATE_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/thread_status.h.svn-base b/i386/include/mach/machine/.svn/text-base/thread_status.h.svn-base new file mode 100644 index 0000000..ad5eff0 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/thread_status.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_THREAD_STATUS_H_ +#define _MACH_MACHINE_THREAD_STATUS_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/thread_status.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/thread_status.h" +#elif defined (__arm__) +#include "mach/arm/thread_status.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/vm_param.h.svn-base b/i386/include/mach/machine/.svn/text-base/vm_param.h.svn-base new file mode 100644 index 0000000..c71121b --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/vm_param.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_VM_PARAM_H_ +#define _MACH_MACHINE_VM_PARAM_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/vm_param.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/vm_param.h" +#elif defined (__arm__) +#include "mach/arm/vm_param.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_VM_PARAM_H_ */ diff --git a/i386/include/mach/machine/.svn/text-base/vm_types.h.svn-base b/i386/include/mach/machine/.svn/text-base/vm_types.h.svn-base new file mode 100644 index 0000000..b366092 --- /dev/null +++ b/i386/include/mach/machine/.svn/text-base/vm_types.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_VM_TYPES_H_ +#define _MACH_MACHINE_VM_TYPES_H_ + +#if defined (__ppc__) || defined(__ppc64__) +#include "mach/ppc/vm_types.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/vm_types.h" +#elif defined (__arm__) +#include "mach/arm/vm_types.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_VM_TYPES_H_ */ diff --git a/i386/include/mach/machine/asm.h b/i386/include/mach/machine/asm.h new file mode 100644 index 0000000..59e1da2 --- /dev/null +++ b/i386/include/mach/machine/asm.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_ASM_H +#define _MACH_MACHINE_ASM_H + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/asm.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/asm.h" +#elif defined (__arm__) +#include "mach/arm/asm.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_ASM_H */ diff --git a/i386/include/mach/machine/boolean.h b/i386/include/mach/machine/boolean.h new file mode 100644 index 0000000..1bec00d --- /dev/null +++ b/i386/include/mach/machine/boolean.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_BOOLEAN_H_ +#define _MACH_MACHINE_BOOLEAN_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/boolean.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/boolean.h" +#elif defined (__arm__) +#include "mach/arm/boolean.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_BOOLEAN_H_ */ diff --git a/i386/include/mach/machine/exception.h b/i386/include/mach/machine/exception.h new file mode 100644 index 0000000..5ce83f2 --- /dev/null +++ b/i386/include/mach/machine/exception.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_EXCEPTION_H_ +#define _MACH_MACHINE_EXCEPTION_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/exception.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/exception.h" +#elif defined (__arm__) +#include "mach/arm/exception.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_EXCEPTION_H_ */ diff --git a/i386/include/mach/machine/kern_return.h b/i386/include/mach/machine/kern_return.h new file mode 100644 index 0000000..df37396 --- /dev/null +++ b/i386/include/mach/machine/kern_return.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_KERN_RETURN_H_ +#define _MACH_MACHINE_KERN_RETURN_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/kern_return.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/kern_return.h" +#elif defined (__arm__) +#include "mach/arm/kern_return.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_KERN_RETURN_H_ */ diff --git a/i386/include/mach/machine/machine_types.defs b/i386/include/mach/machine/machine_types.defs new file mode 100644 index 0000000..418d16b --- /dev/null +++ b/i386/include/mach/machine/machine_types.defs @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_MACHINE_TYPES_DEFS +#define _MACH_MACHINE_MACHINE_TYPES_DEFS + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/machine_types.defs" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/machine_types.defs" +#elif defined (__arm__) +#include "mach/arm/machine_types.defs" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/machine/ndr_def.h b/i386/include/mach/machine/ndr_def.h new file mode 100644 index 0000000..a7b5a9b --- /dev/null +++ b/i386/include/mach/machine/ndr_def.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_NDR_DEF_H +#define _MACH_MACHINE_NDR_DEF_H + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/ndr_def.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/ndr_def.h" +#elif defined (__arm__) +#include "mach/arm/ndr_def.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_NDR_DEF_H */ diff --git a/i386/include/mach/machine/processor_info.h b/i386/include/mach/machine/processor_info.h new file mode 100644 index 0000000..ca96367 --- /dev/null +++ b/i386/include/mach/machine/processor_info.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_PROCESSOR_INFO_H_ +#define _MACH_MACHINE_PROCESSOR_INFO_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/processor_info.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/processor_info.h" +#elif defined (__arm__) +#include "mach/arm/processor_info.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/machine/rpc.h b/i386/include/mach/machine/rpc.h new file mode 100644 index 0000000..b969bd4 --- /dev/null +++ b/i386/include/mach/machine/rpc.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_RPC_H_ +#define _MACH_MACHINE_RPC_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/rpc.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/rpc.h" +#elif defined (__arm__) +#include "mach/arm/rpc.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_RPC_H_ */ diff --git a/i386/include/mach/machine/sdt.h b/i386/include/mach/machine/sdt.h new file mode 100644 index 0000000..e85508f --- /dev/null +++ b/i386/include/mach/machine/sdt.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + */ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_MACHINE_SYS_SDT_H +#define _MACH_MACHINE_SYS_SDT_H + +#include <mach/machine/sdt_isa.h> + + +#endif /* _MACH_MACHINE_SYS_SDT_H */ diff --git a/i386/include/mach/machine/sdt_isa.h b/i386/include/mach/machine/sdt_isa.h new file mode 100644 index 0000000..a8e1379 --- /dev/null +++ b/i386/include/mach/machine/sdt_isa.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _MACH_MACHINE_SDT_ISA_H_ +#define _MACH_MACHINE_SDT_ISA_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include <mach/ppc/sdt_isa.h> +#elif defined (__i386__) || defined(__x86_64__) +#include <mach/i386/sdt_isa.h> +#elif defined (__arm__) +#include <mach/arm/sdt_isa.h> +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_SDT_ISA_H_ */ diff --git a/i386/include/mach/machine/thread_state.h b/i386/include/mach/machine/thread_state.h new file mode 100644 index 0000000..18ffca4 --- /dev/null +++ b/i386/include/mach/machine/thread_state.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_THREAD_STATE_H_ +#define _MACH_MACHINE_THREAD_STATE_H_ + +#if defined (__ppc__) || defined(__ppc64__) +#include "mach/ppc/thread_state.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/thread_state.h" +#elif defined (__arm__) +#include "mach/arm/thread_state.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_THREAD_STATE_H_ */ diff --git a/i386/include/mach/machine/thread_status.h b/i386/include/mach/machine/thread_status.h new file mode 100644 index 0000000..ad5eff0 --- /dev/null +++ b/i386/include/mach/machine/thread_status.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_THREAD_STATUS_H_ +#define _MACH_MACHINE_THREAD_STATUS_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/thread_status.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/thread_status.h" +#elif defined (__arm__) +#include "mach/arm/thread_status.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/machine/vm_param.h b/i386/include/mach/machine/vm_param.h new file mode 100644 index 0000000..c71121b --- /dev/null +++ b/i386/include/mach/machine/vm_param.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_VM_PARAM_H_ +#define _MACH_MACHINE_VM_PARAM_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "mach/ppc/vm_param.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/vm_param.h" +#elif defined (__arm__) +#include "mach/arm/vm_param.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_VM_PARAM_H_ */ diff --git a/i386/include/mach/machine/vm_types.h b/i386/include/mach/machine/vm_types.h new file mode 100644 index 0000000..b366092 --- /dev/null +++ b/i386/include/mach/machine/vm_types.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_MACHINE_VM_TYPES_H_ +#define _MACH_MACHINE_VM_TYPES_H_ + +#if defined (__ppc__) || defined(__ppc64__) +#include "mach/ppc/vm_types.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "mach/i386/vm_types.h" +#elif defined (__arm__) +#include "mach/arm/vm_types.h" +#else +#error architecture not supported +#endif + +#endif /* _MACH_MACHINE_VM_TYPES_H_ */ diff --git a/i386/include/mach/memory_object_types.h b/i386/include/mach/memory_object_types.h new file mode 100644 index 0000000..5c1f76e --- /dev/null +++ b/i386/include/mach/memory_object_types.h @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: memory_object.h + * Author: Michael Wayne Young + * + * External memory management interface definition. + */ + +#ifndef _MACH_MEMORY_OBJECT_TYPES_H_ +#define _MACH_MEMORY_OBJECT_TYPES_H_ + +/* + * User-visible types used in the external memory + * management interface: + */ + +#include <mach/port.h> +#include <mach/message.h> +#include <mach/vm_prot.h> +#include <mach/vm_sync.h> +#include <mach/vm_types.h> +#include <mach/machine/vm_types.h> + +#include <sys/cdefs.h> + +#define VM_64_BIT_DATA_OBJECTS + +typedef unsigned long long memory_object_offset_t; +typedef unsigned long long memory_object_size_t; +typedef natural_t memory_object_cluster_size_t; +typedef natural_t * memory_object_fault_info_t; + +typedef unsigned long long vm_object_id_t; + + +/* + * Temporary until real EMMI version gets re-implemented + */ + + +typedef mach_port_t memory_object_t; +typedef mach_port_t memory_object_control_t; + + +typedef memory_object_t *memory_object_array_t; + /* A memory object ... */ + /* Used by the kernel to retrieve */ + /* or store data */ + +typedef mach_port_t memory_object_name_t; + /* Used to describe the memory ... */ + /* object in vm_regions() calls */ + +typedef mach_port_t memory_object_default_t; + /* Registered with the host ... */ + /* for creating new internal objects */ + +#define MEMORY_OBJECT_NULL ((memory_object_t) 0) +#define MEMORY_OBJECT_CONTROL_NULL ((memory_object_control_t) 0) +#define MEMORY_OBJECT_NAME_NULL ((memory_object_name_t) 0) +#define MEMORY_OBJECT_DEFAULT_NULL ((memory_object_default_t) 0) + + +typedef int memory_object_copy_strategy_t; + /* How memory manager handles copy: */ +#define MEMORY_OBJECT_COPY_NONE 0 + /* ... No special support */ +#define MEMORY_OBJECT_COPY_CALL 1 + /* ... Make call on memory manager */ +#define MEMORY_OBJECT_COPY_DELAY 2 + /* ... Memory manager doesn't + * change data externally. + */ +#define MEMORY_OBJECT_COPY_TEMPORARY 3 + /* ... Memory manager doesn't + * change data externally, and + * doesn't need to see changes. + */ +#define MEMORY_OBJECT_COPY_SYMMETRIC 4 + /* ... Memory manager doesn't + * change data externally, + * doesn't need to see changes, + * and object will not be + * multiply mapped. + * + * XXX + * Not yet safe for non-kernel use. + */ + +#define MEMORY_OBJECT_COPY_INVALID 5 + /* ... An invalid copy strategy, + * for external objects which + * have not been initialized. + * Allows copy_strategy to be + * examined without also + * examining pager_ready and + * internal. + */ + +typedef int memory_object_return_t; + /* Which pages to return to manager + this time (lock_request) */ +#define MEMORY_OBJECT_RETURN_NONE 0 + /* ... don't return any. */ +#define MEMORY_OBJECT_RETURN_DIRTY 1 + /* ... only dirty pages. */ +#define MEMORY_OBJECT_RETURN_ALL 2 + /* ... dirty and precious pages. */ +#define MEMORY_OBJECT_RETURN_ANYTHING 3 + /* ... any resident page. */ + +/* + * Data lock request flags + */ + +#define MEMORY_OBJECT_DATA_FLUSH 0x1 +#define MEMORY_OBJECT_DATA_NO_CHANGE 0x2 +#define MEMORY_OBJECT_DATA_PURGE 0x4 +#define MEMORY_OBJECT_COPY_SYNC 0x8 +#define MEMORY_OBJECT_DATA_SYNC 0x10 +#define MEMORY_OBJECT_IO_SYNC 0x20 +#define MEMORY_OBJECT_DATA_FLUSH_ALL 0x40 + +/* + * Types for the memory object flavor interfaces + */ + +#define MEMORY_OBJECT_INFO_MAX (1024) +typedef int *memory_object_info_t; +typedef int memory_object_flavor_t; +typedef int memory_object_info_data_t[MEMORY_OBJECT_INFO_MAX]; + + +#define MEMORY_OBJECT_PERFORMANCE_INFO 11 +#define MEMORY_OBJECT_ATTRIBUTE_INFO 14 +#define MEMORY_OBJECT_BEHAVIOR_INFO 15 + + +struct memory_object_perf_info { + memory_object_cluster_size_t cluster_size; + boolean_t may_cache; +}; + +struct memory_object_attr_info { + memory_object_copy_strategy_t copy_strategy; + memory_object_cluster_size_t cluster_size; + boolean_t may_cache_object; + boolean_t temporary; +}; + +struct memory_object_behave_info { + memory_object_copy_strategy_t copy_strategy; + boolean_t temporary; + boolean_t invalidate; + boolean_t silent_overwrite; + boolean_t advisory_pageout; +}; + + +typedef struct memory_object_behave_info *memory_object_behave_info_t; +typedef struct memory_object_behave_info memory_object_behave_info_data_t; + +typedef struct memory_object_perf_info *memory_object_perf_info_t; +typedef struct memory_object_perf_info memory_object_perf_info_data_t; + +typedef struct memory_object_attr_info *memory_object_attr_info_t; +typedef struct memory_object_attr_info memory_object_attr_info_data_t; + +#define MEMORY_OBJECT_BEHAVE_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(memory_object_behave_info_data_t)/sizeof(int))) +#define MEMORY_OBJECT_PERF_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(memory_object_perf_info_data_t)/sizeof(int))) +#define MEMORY_OBJECT_ATTR_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(memory_object_attr_info_data_t)/sizeof(int))) + +#define invalid_memory_object_flavor(f) \ + (f != MEMORY_OBJECT_ATTRIBUTE_INFO && \ + f != MEMORY_OBJECT_PERFORMANCE_INFO && \ + f != OLD_MEMORY_OBJECT_BEHAVIOR_INFO && \ + f != MEMORY_OBJECT_BEHAVIOR_INFO && \ + f != OLD_MEMORY_OBJECT_ATTRIBUTE_INFO) + + +/* + * Used to support options on memory_object_release_name call + */ +#define MEMORY_OBJECT_TERMINATE_IDLE 0x1 +#define MEMORY_OBJECT_RESPECT_CACHE 0x2 +#define MEMORY_OBJECT_RELEASE_NO_OP 0x4 + + +/* named entry processor mapping options */ +/* enumerated */ +#define MAP_MEM_NOOP 0 +#define MAP_MEM_COPYBACK 1 +#define MAP_MEM_IO 2 +#define MAP_MEM_WTHRU 3 +#define MAP_MEM_WCOMB 4 /* Write combining mode */ + /* aka store gather */ + +#define GET_MAP_MEM(flags) \ + ((((unsigned int)(flags)) >> 24) & 0xFF) + +#define SET_MAP_MEM(caching, flags) \ + ((flags) = ((((unsigned int)(caching)) << 24) \ + & 0xFF000000) | ((flags) & 0xFFFFFF)); + +/* leave room for vm_prot bits */ +#define MAP_MEM_ONLY 0x10000 /* change processor caching */ +#define MAP_MEM_NAMED_CREATE 0x20000 /* create extant object */ +#define MAP_MEM_PURGABLE 0x40000 /* create a purgable VM object */ +#define MAP_MEM_NAMED_REUSE 0x80000 /* reuse provided entry if identical */ + + +#endif /* _MACH_MEMORY_OBJECT_TYPES_H_ */ diff --git a/i386/include/mach/message.h b/i386/include/mach/message.h new file mode 100644 index 0000000..15c9be4 --- /dev/null +++ b/i386/include/mach/message.h @@ -0,0 +1,783 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * NOTICE: This file was modified by McAfee Research in 2004 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + * Copyright (c) 2005 SPARTA, Inc. + */ +/* + */ +/* + * File: mach/message.h + * + * Mach IPC message and primitive function definitions. + */ + +#ifndef _MACH_MESSAGE_H_ +#define _MACH_MESSAGE_H_ + +#include <stdint.h> +#include <mach/port.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/machine/vm_types.h> + +#include <sys/cdefs.h> + +/* + * The timeout mechanism uses mach_msg_timeout_t values, + * passed by value. The timeout units are milliseconds. + * It is controlled with the MACH_SEND_TIMEOUT + * and MACH_RCV_TIMEOUT options. + */ + +typedef natural_t mach_msg_timeout_t; + +/* + * The value to be used when there is no timeout. + * (No MACH_SEND_TIMEOUT/MACH_RCV_TIMEOUT option.) + */ + +#define MACH_MSG_TIMEOUT_NONE ((mach_msg_timeout_t) 0) + +/* + * The kernel uses MACH_MSGH_BITS_COMPLEX as a hint. If it isn't on, it + * assumes the body of the message doesn't contain port rights or OOL + * data. The field is set in received messages. A user task must + * use caution in interpreting the body of a message if the bit isn't + * on, because the mach_msg_type's in the body might "lie" about the + * contents. If the bit isn't on, but the mach_msg_types + * in the body specify rights or OOL data, the behavior is undefined. + * (Ie, an error may or may not be produced.) + * + * The value of MACH_MSGH_BITS_REMOTE determines the interpretation + * of the msgh_remote_port field. It is handled like a msgt_name. + * + * The value of MACH_MSGH_BITS_LOCAL determines the interpretation + * of the msgh_local_port field. It is handled like a msgt_name. + * + * MACH_MSGH_BITS() combines two MACH_MSG_TYPE_* values, for the remote + * and local fields, into a single value suitable for msgh_bits. + * + * MACH_MSGH_BITS_CIRCULAR should be zero; is is used internally. + * + * The unused bits should be zero and are reserved for the kernel + * or for future interface expansion. + */ + +#define MACH_MSGH_BITS_ZERO 0x00000000 +#define MACH_MSGH_BITS_REMOTE_MASK 0x000000ff +#define MACH_MSGH_BITS_LOCAL_MASK 0x0000ff00 +#define MACH_MSGH_BITS_COMPLEX 0x80000000U +#define MACH_MSGH_BITS_USER 0x8000ffffU + +#define MACH_MSGH_BITS_CIRCULAR 0x40000000 /* internal use only */ +#define MACH_MSGH_BITS_USED 0xc000ffffU + +#define MACH_MSGH_BITS_PORTS_MASK \ + (MACH_MSGH_BITS_REMOTE_MASK|MACH_MSGH_BITS_LOCAL_MASK) + +#define MACH_MSGH_BITS(remote, local) \ + ((remote) | ((local) << 8)) +#define MACH_MSGH_BITS_REMOTE(bits) \ + ((bits) & MACH_MSGH_BITS_REMOTE_MASK) +#define MACH_MSGH_BITS_LOCAL(bits) \ + (((bits) & MACH_MSGH_BITS_LOCAL_MASK) >> 8) +#define MACH_MSGH_BITS_PORTS(bits) \ + ((bits) & MACH_MSGH_BITS_PORTS_MASK) +#define MACH_MSGH_BITS_OTHER(bits) \ + ((bits) &~ MACH_MSGH_BITS_PORTS_MASK) + +/* + * Every message starts with a message header. + * Following the message header, if the message is complex, are a count + * of type descriptors and the type descriptors themselves + * (mach_msg_descriptor_t). The size of the message must be specified in + * bytes, and includes the message header, descriptor count, descriptors, + * and inline data. + * + * The msgh_remote_port field specifies the destination of the message. + * It must specify a valid send or send-once right for a port. + * + * The msgh_local_port field specifies a "reply port". Normally, + * This field carries a send-once right that the receiver will use + * to reply to the message. It may carry the values MACH_PORT_NULL, + * MACH_PORT_DEAD, a send-once right, or a send right. + * + * The msgh_seqno field carries a sequence number associated with the + * received-from port. A port's sequence number is incremented every + * time a message is received from it. In sent messages, the field's + * value is ignored. + * + * The msgh_id field is uninterpreted by the message primitives. + * It normally carries information specifying the format + * or meaning of the message. + */ + +typedef unsigned int mach_msg_bits_t; +typedef natural_t mach_msg_size_t; +typedef integer_t mach_msg_id_t; + + +#define MACH_MSG_SIZE_NULL (mach_msg_size_t *) 0 + +typedef unsigned int mach_msg_type_name_t; + +#define MACH_MSG_TYPE_MOVE_RECEIVE 16 /* Must hold receive rights */ +#define MACH_MSG_TYPE_MOVE_SEND 17 /* Must hold send rights */ +#define MACH_MSG_TYPE_MOVE_SEND_ONCE 18 /* Must hold sendonce rights */ +#define MACH_MSG_TYPE_COPY_SEND 19 /* Must hold send rights */ +#define MACH_MSG_TYPE_MAKE_SEND 20 /* Must hold receive rights */ +#define MACH_MSG_TYPE_MAKE_SEND_ONCE 21 /* Must hold receive rights */ +#define MACH_MSG_TYPE_COPY_RECEIVE 22 /* Must hold receive rights */ + +typedef unsigned int mach_msg_copy_options_t; + +#define MACH_MSG_PHYSICAL_COPY 0 +#define MACH_MSG_VIRTUAL_COPY 1 +#define MACH_MSG_ALLOCATE 2 +#define MACH_MSG_OVERWRITE 3 +#ifdef MACH_KERNEL +#define MACH_MSG_KALLOC_COPY_T 4 +#endif /* MACH_KERNEL */ + +/* + * In a complex mach message, the mach_msg_header_t is followed by + * a descriptor count, then an array of that number of descriptors + * (mach_msg_*_descriptor_t). The type field of mach_msg_type_descriptor_t + * (which any descriptor can be cast to) indicates the flavor of the + * descriptor. + * + * Note that in LP64, the various types of descriptors are no longer all + * the same size as mach_msg_descriptor_t, so the array cannot be indexed + * as expected. + */ + +typedef unsigned int mach_msg_descriptor_type_t; + +#define MACH_MSG_PORT_DESCRIPTOR 0 +#define MACH_MSG_OOL_DESCRIPTOR 1 +#define MACH_MSG_OOL_PORTS_DESCRIPTOR 2 +#define MACH_MSG_OOL_VOLATILE_DESCRIPTOR 3 + +#pragma pack(4) + +typedef struct +{ + natural_t pad1; + mach_msg_size_t pad2; + unsigned int pad3 : 24; + mach_msg_descriptor_type_t type : 8; +} mach_msg_type_descriptor_t; + +typedef struct +{ + mach_port_t name; +#if !(defined(KERNEL) && defined(__LP64__)) +// Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes + mach_msg_size_t pad1; +#endif + unsigned int pad2 : 16; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +} mach_msg_port_descriptor_t; + +typedef struct +{ + uint32_t address; + mach_msg_size_t size; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; +} mach_msg_ool_descriptor32_t; + +typedef struct +{ + uint64_t address; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; + mach_msg_size_t size; +} mach_msg_ool_descriptor64_t; + +typedef struct +{ + void* address; +#if !defined(__LP64__) + mach_msg_size_t size; +#endif + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + unsigned int pad1: 8; + mach_msg_descriptor_type_t type: 8; +#if defined(__LP64__) + mach_msg_size_t size; +#endif +#if defined(KERNEL) && !defined(__LP64__) + uint32_t pad_end; +#endif +} mach_msg_ool_descriptor_t; + +typedef struct +{ + uint32_t address; + mach_msg_size_t count; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +} mach_msg_ool_ports_descriptor32_t; + +typedef struct +{ + uint64_t address; + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; + mach_msg_size_t count; +} mach_msg_ool_ports_descriptor64_t; + +typedef struct +{ + void* address; +#if !defined(__LP64__) + mach_msg_size_t count; +#endif + boolean_t deallocate: 8; + mach_msg_copy_options_t copy: 8; + mach_msg_type_name_t disposition : 8; + mach_msg_descriptor_type_t type : 8; +#if defined(__LP64__) + mach_msg_size_t count; +#endif +#if defined(KERNEL) && !defined(__LP64__) + uint32_t pad_end; +#endif +} mach_msg_ool_ports_descriptor_t; + +/* + * LP64support - This union definition is not really + * appropriate in LP64 mode because not all descriptors + * are of the same size in that environment. + */ +#if defined(__LP64__) && defined(KERNEL) +typedef union +{ + mach_msg_port_descriptor_t port; + mach_msg_ool_descriptor32_t out_of_line; + mach_msg_ool_ports_descriptor32_t ool_ports; + mach_msg_type_descriptor_t type; +} mach_msg_descriptor_t; +#else +typedef union +{ + mach_msg_port_descriptor_t port; + mach_msg_ool_descriptor_t out_of_line; + mach_msg_ool_ports_descriptor_t ool_ports; + mach_msg_type_descriptor_t type; +} mach_msg_descriptor_t; +#endif + +typedef struct +{ + mach_msg_size_t msgh_descriptor_count; +} mach_msg_body_t; + +#define MACH_MSG_BODY_NULL (mach_msg_body_t *) 0 +#define MACH_MSG_DESCRIPTOR_NULL (mach_msg_descriptor_t *) 0 + +typedef struct +{ + mach_msg_bits_t msgh_bits; + mach_msg_size_t msgh_size; + mach_port_t msgh_remote_port; + mach_port_t msgh_local_port; + mach_msg_size_t msgh_reserved; + mach_msg_id_t msgh_id; +} mach_msg_header_t; + +#define MACH_MSG_NULL (mach_msg_header_t *) 0 + +typedef struct +{ + mach_msg_header_t header; + mach_msg_body_t body; +} mach_msg_base_t; + +typedef unsigned int mach_msg_trailer_type_t; + +#define MACH_MSG_TRAILER_FORMAT_0 0 + +typedef unsigned int mach_msg_trailer_size_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; +} mach_msg_trailer_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; +} mach_msg_seqno_trailer_t; + +typedef struct +{ + unsigned int val[2]; +} security_token_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; +} mach_msg_security_trailer_t; + +/* + * The audit token is an opaque token which identifies + * Mach tasks and senders of Mach messages as subjects + * to the BSM audit system. Only the appropriate BSM + * library routines should be used to interpret the + * contents of the audit token as the representation + * of the subject identity within the token may change + * over time. + */ +typedef struct +{ + unsigned int val[8]; +} audit_token_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; +} mach_msg_audit_trailer_t; + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; + mach_vm_address_t msgh_context; +} mach_msg_context_trailer_t; + + +typedef struct +{ + mach_port_name_t sender; +} msg_labels_t; + +/* + Trailer type to pass MAC policy label info as a mach message trailer. + +*/ + +typedef struct +{ + mach_msg_trailer_type_t msgh_trailer_type; + mach_msg_trailer_size_t msgh_trailer_size; + mach_port_seqno_t msgh_seqno; + security_token_t msgh_sender; + audit_token_t msgh_audit; + mach_vm_address_t msgh_context; + int msgh_ad; + msg_labels_t msgh_labels; +} mach_msg_mac_trailer_t; + +#define MACH_MSG_TRAILER_MINIMUM_SIZE sizeof(mach_msg_trailer_t) + +/* + * These values can change from release to release - but clearly + * code cannot request additional trailer elements one was not + * compiled to understand. Therefore, it is safe to use this + * constant when the same module specified the receive options. + * Otherwise, you run the risk that the options requested by + * another module may exceed the local modules notion of + * MAX_TRAILER_SIZE. + */ +typedef mach_msg_mac_trailer_t mach_msg_max_trailer_t; +#define MAX_TRAILER_SIZE ((mach_msg_size_t)sizeof(mach_msg_max_trailer_t)) + +/* + * Legacy requirements keep us from ever updating these defines (even + * when the format_0 trailers gain new option data fields in the future). + * Therefore, they shouldn't be used going forward. Instead, the sizes + * should be compared against the specific element size requested using + * REQUESTED_TRAILER_SIZE. + */ +typedef mach_msg_security_trailer_t mach_msg_format_0_trailer_t; + +/*typedef mach_msg_mac_trailer_t mach_msg_format_0_trailer_t; +*/ + +#define MACH_MSG_TRAILER_FORMAT_0_SIZE sizeof(mach_msg_format_0_trailer_t) + +#define KERNEL_SECURITY_TOKEN_VALUE { {0, 1} } +extern security_token_t KERNEL_SECURITY_TOKEN; + +#define KERNEL_AUDIT_TOKEN_VALUE { {0, 0, 0, 0, 0, 0, 0, 0} } +extern audit_token_t KERNEL_AUDIT_TOKEN; + +typedef integer_t mach_msg_options_t; + +typedef struct +{ + mach_msg_header_t header; +} mach_msg_empty_send_t; + +typedef struct +{ + mach_msg_header_t header; + mach_msg_trailer_t trailer; +} mach_msg_empty_rcv_t; + +typedef union +{ + mach_msg_empty_send_t send; + mach_msg_empty_rcv_t rcv; +} mach_msg_empty_t; + +#pragma pack() + +/* utility to round the message size - will become machine dependent */ +#define round_msg(x) (((mach_msg_size_t)(x) + sizeof (natural_t) - 1) & \ + ~(sizeof (natural_t) - 1)) + +/* + * There is no fixed upper bound to the size of Mach messages. + */ + +#define MACH_MSG_SIZE_MAX ((mach_msg_size_t) ~0) + +/* + * Compatibility definitions, for code written + * when there was a msgh_kind instead of msgh_seqno. + */ +#define MACH_MSGH_KIND_NORMAL 0x00000000 +#define MACH_MSGH_KIND_NOTIFICATION 0x00000001 +#define msgh_kind msgh_seqno +#define mach_msg_kind_t mach_port_seqno_t + +typedef natural_t mach_msg_type_size_t; +typedef natural_t mach_msg_type_number_t; + +/* + * Values received/carried in messages. Tells the receiver what + * sort of port right he now has. + * + * MACH_MSG_TYPE_PORT_NAME is used to transfer a port name + * which should remain uninterpreted by the kernel. (Port rights + * are not transferred, just the port name.) + */ + +#define MACH_MSG_TYPE_PORT_NONE 0 + +#define MACH_MSG_TYPE_PORT_NAME 15 +#define MACH_MSG_TYPE_PORT_RECEIVE MACH_MSG_TYPE_MOVE_RECEIVE +#define MACH_MSG_TYPE_PORT_SEND MACH_MSG_TYPE_MOVE_SEND +#define MACH_MSG_TYPE_PORT_SEND_ONCE MACH_MSG_TYPE_MOVE_SEND_ONCE + +#define MACH_MSG_TYPE_LAST 22 /* Last assigned */ + +/* + * A dummy value. Mostly used to indicate that the actual value + * will be filled in later, dynamically. + */ + +#define MACH_MSG_TYPE_POLYMORPHIC ((mach_msg_type_name_t) -1) + +/* + * Is a given item a port type? + */ + +#define MACH_MSG_TYPE_PORT_ANY(x) \ + (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ + ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) + +#define MACH_MSG_TYPE_PORT_ANY_SEND(x) \ + (((x) >= MACH_MSG_TYPE_MOVE_SEND) && \ + ((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE)) + +#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \ + (((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \ + ((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE)) + +typedef integer_t mach_msg_option_t; + +#define MACH_MSG_OPTION_NONE 0x00000000 + +#define MACH_SEND_MSG 0x00000001 +#define MACH_RCV_MSG 0x00000002 +#define MACH_RCV_LARGE 0x00000004 + +#define MACH_SEND_TIMEOUT 0x00000010 +#define MACH_SEND_INTERRUPT 0x00000040 /* libmach implements */ +#define MACH_SEND_CANCEL 0x00000080 +#define MACH_SEND_ALWAYS 0x00010000 /* internal use only */ +#define MACH_SEND_TRAILER 0x00020000 + +#define MACH_RCV_TIMEOUT 0x00000100 +#define MACH_RCV_NOTIFY 0x00000200 +#define MACH_RCV_INTERRUPT 0x00000400 /* libmach implements */ +#define MACH_RCV_OVERWRITE 0x00001000 + +/* + * NOTE: a 0x00------ RCV mask implies to ask for + * a MACH_MSG_TRAILER_FORMAT_0 with 0 Elements, + * which is equivalent to a mach_msg_trailer_t. + * + * XXXMAC: unlike the rest of the MACH_RCV_* flags, MACH_RCV_TRAILER_LABELS + * needs its own private bit since we only calculate its fields when absolutely + * required. + */ +#define MACH_RCV_TRAILER_NULL 0 +#define MACH_RCV_TRAILER_SEQNO 1 +#define MACH_RCV_TRAILER_SENDER 2 +#define MACH_RCV_TRAILER_AUDIT 3 +#define MACH_RCV_TRAILER_CTX 4 +#define MACH_RCV_TRAILER_AV 7 +#define MACH_RCV_TRAILER_LABELS 8 + +#define MACH_RCV_TRAILER_TYPE(x) (((x) & 0xf) << 28) +#define MACH_RCV_TRAILER_ELEMENTS(x) (((x) & 0xf) << 24) +#define MACH_RCV_TRAILER_MASK ((0xff << 24)) + +#define GET_RCV_ELEMENTS(y) (((y) >> 24) & 0xf) + +/* + * XXXMAC: note that in the case of MACH_RCV_TRAILER_LABELS, + * we just fall through to mach_msg_max_trailer_t. + * This is correct behavior since mach_msg_max_trailer_t is defined as + * mac_msg_mac_trailer_t which is used for the LABELS trailer. + * It also makes things work properly if MACH_RCV_TRAILER_LABELS is ORed + * with one of the other options. + */ +#define REQUESTED_TRAILER_SIZE(y) \ + ((mach_msg_trailer_size_t) \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_NULL) ? \ + sizeof(mach_msg_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SEQNO) ? \ + sizeof(mach_msg_seqno_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_SENDER) ? \ + sizeof(mach_msg_security_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AUDIT) ? \ + sizeof(mach_msg_audit_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_CTX) ? \ + sizeof(mach_msg_context_trailer_t) : \ + ((GET_RCV_ELEMENTS(y) == MACH_RCV_TRAILER_AV) ? \ + sizeof(mach_msg_mac_trailer_t) : \ + sizeof(mach_msg_max_trailer_t)))))))) + +/* + * Much code assumes that mach_msg_return_t == kern_return_t. + * This definition is useful for descriptive purposes. + * + * See <mach/error.h> for the format of error codes. + * IPC errors are system 4. Send errors are subsystem 0; + * receive errors are subsystem 1. The code field is always non-zero. + * The high bits of the code field communicate extra information + * for some error codes. MACH_MSG_MASK masks off these special bits. + */ + +typedef kern_return_t mach_msg_return_t; + +#define MACH_MSG_SUCCESS 0x00000000 + + +#define MACH_MSG_MASK 0x00003e00 + /* All special error code bits defined below. */ +#define MACH_MSG_IPC_SPACE 0x00002000 + /* No room in IPC name space for another capability name. */ +#define MACH_MSG_VM_SPACE 0x00001000 + /* No room in VM address space for out-of-line memory. */ +#define MACH_MSG_IPC_KERNEL 0x00000800 + /* Kernel resource shortage handling an IPC capability. */ +#define MACH_MSG_VM_KERNEL 0x00000400 + /* Kernel resource shortage handling out-of-line memory. */ + +#define MACH_SEND_IN_PROGRESS 0x10000001 + /* Thread is waiting to send. (Internal use only.) */ +#define MACH_SEND_INVALID_DATA 0x10000002 + /* Bogus in-line data. */ +#define MACH_SEND_INVALID_DEST 0x10000003 + /* Bogus destination port. */ +#define MACH_SEND_TIMED_OUT 0x10000004 + /* Message not sent before timeout expired. */ +#define MACH_SEND_INTERRUPTED 0x10000007 + /* Software interrupt. */ +#define MACH_SEND_MSG_TOO_SMALL 0x10000008 + /* Data doesn't contain a complete message. */ +#define MACH_SEND_INVALID_REPLY 0x10000009 + /* Bogus reply port. */ +#define MACH_SEND_INVALID_RIGHT 0x1000000a + /* Bogus port rights in the message body. */ +#define MACH_SEND_INVALID_NOTIFY 0x1000000b + /* Bogus notify port argument. */ +#define MACH_SEND_INVALID_MEMORY 0x1000000c + /* Invalid out-of-line memory pointer. */ +#define MACH_SEND_NO_BUFFER 0x1000000d + /* No message buffer is available. */ +#define MACH_SEND_TOO_LARGE 0x1000000e + /* Send is too large for port */ +#define MACH_SEND_INVALID_TYPE 0x1000000f + /* Invalid msg-type specification. */ +#define MACH_SEND_INVALID_HEADER 0x10000010 + /* A field in the header had a bad value. */ +#define MACH_SEND_INVALID_TRAILER 0x10000011 + /* The trailer to be sent does not match kernel format. */ +#define MACH_SEND_INVALID_RT_OOL_SIZE 0x10000015 + /* compatibility: no longer a returned error */ + +#define MACH_RCV_IN_PROGRESS 0x10004001 + /* Thread is waiting for receive. (Internal use only.) */ +#define MACH_RCV_INVALID_NAME 0x10004002 + /* Bogus name for receive port/port-set. */ +#define MACH_RCV_TIMED_OUT 0x10004003 + /* Didn't get a message within the timeout value. */ +#define MACH_RCV_TOO_LARGE 0x10004004 + /* Message buffer is not large enough for inline data. */ +#define MACH_RCV_INTERRUPTED 0x10004005 + /* Software interrupt. */ +#define MACH_RCV_PORT_CHANGED 0x10004006 + /* compatibility: no longer a returned error */ +#define MACH_RCV_INVALID_NOTIFY 0x10004007 + /* Bogus notify port argument. */ +#define MACH_RCV_INVALID_DATA 0x10004008 + /* Bogus message buffer for inline data. */ +#define MACH_RCV_PORT_DIED 0x10004009 + /* Port/set was sent away/died during receive. */ +#define MACH_RCV_IN_SET 0x1000400a + /* compatibility: no longer a returned error */ +#define MACH_RCV_HEADER_ERROR 0x1000400b + /* Error receiving message header. See special bits. */ +#define MACH_RCV_BODY_ERROR 0x1000400c + /* Error receiving message body. See special bits. */ +#define MACH_RCV_INVALID_TYPE 0x1000400d + /* Invalid msg-type specification in scatter list. */ +#define MACH_RCV_SCATTER_SMALL 0x1000400e + /* Out-of-line overwrite region is not large enough */ +#define MACH_RCV_INVALID_TRAILER 0x1000400f + /* trailer type or number of trailer elements not supported */ +#define MACH_RCV_IN_PROGRESS_TIMED 0x10004011 + /* Waiting for receive with timeout. (Internal use only.) */ + + +__BEGIN_DECLS + +/* + * Routine: mach_msg_overwrite + * Purpose: + * Send and/or receive a message. If the message operation + * is interrupted, and the user did not request an indication + * of that fact, then restart the appropriate parts of the + * operation silently (trap version does not restart). + * + * Distinct send and receive buffers may be specified. If + * no separate receive buffer is specified, the msg parameter + * will be used for both send and receive operations. + * + * In addition to a distinct receive buffer, that buffer may + * already contain scatter control information to direct the + * receiving of the message. + */ + +extern mach_msg_return_t mach_msg_overwrite( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_name_t rcv_name, + mach_msg_timeout_t timeout, + mach_port_name_t notify, + mach_msg_header_t *rcv_msg, + mach_msg_size_t rcv_limit); + + +/* + * Routine: mach_msg + * Purpose: + * Send and/or receive a message. If the message operation + * is interrupted, and the user did not request an indication + * of that fact, then restart the appropriate parts of the + * operation silently (trap version does not restart). + */ +extern mach_msg_return_t mach_msg( + mach_msg_header_t *msg, + mach_msg_option_t option, + mach_msg_size_t send_size, + mach_msg_size_t rcv_size, + mach_port_name_t rcv_name, + mach_msg_timeout_t timeout, + mach_port_name_t notify); + + +__END_DECLS + +#endif /* _MACH_MESSAGE_H_ */ + diff --git a/i386/include/mach/mig.h b/i386/include/mach/mig.h new file mode 100644 index 0000000..b62dd2c --- /dev/null +++ b/i386/include/mach/mig.h @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Mach MIG Subsystem Interfaces + */ + +#ifndef _MACH_MIG_H_ +#define _MACH_MIG_H_ + +#include <stdint.h> +#include <mach/port.h> +#include <mach/message.h> +#include <mach/vm_types.h> + +#include <sys/cdefs.h> + +#if defined(MACH_KERNEL) + +#if defined(BSMALL_LATER) +/* Really small configurations don't need type checking */ +#define __MigTypeCheck 0 +#else +/* Turn MIG type checking on by default for kernel */ +#define __MigTypeCheck 1 +#endif +#define __MigKernelSpecificCode 1 +#define _MIG_KERNEL_SPECIFIC_CODE_ 1 + +/* Otherwise check legacy setting (temporary) */ +#elif defined(TypeCheck) + +#define __MigTypeCheck TypeCheck + +#elif !defined(__MigTypeCheck) + +/* otherwise, default MIG type checking on - except in small configurations */ +#if defined(BSMALL) +#define __MigTypeCheck 0 +#else +#define __MigTypeCheck 1 +#endif + +#endif /* !defined(__MigTypeCheck) */ + +/* + * Pack MIG message structs. + * This is an indicator of the need to view shared structs in a + * binary-compatible format - and MIG message structs are no different. + */ +#define __MigPackStructs 1 + +/* + * Definition for MIG-generated server stub routines. These routines + * unpack the request message, call the server procedure, and pack the + * reply message. + */ +typedef void (*mig_stub_routine_t) (mach_msg_header_t *InHeadP, + mach_msg_header_t *OutHeadP); + +typedef mig_stub_routine_t mig_routine_t; + +/* + * Definition for MIG-generated server routine. This routine takes a + * message, and returns the appropriate stub function for handling that + * message. + */ +typedef mig_routine_t (*mig_server_routine_t) (mach_msg_header_t *InHeadP); + +/* + * Generic definition for implementation routines. These routines do + * the real work associated with this request. This generic type is + * used for keeping the pointers in the subsystem array. + */ +typedef kern_return_t (*mig_impl_routine_t)(void); + +typedef mach_msg_type_descriptor_t routine_arg_descriptor; +typedef mach_msg_type_descriptor_t *routine_arg_descriptor_t; +typedef mach_msg_type_descriptor_t *mig_routine_arg_descriptor_t; + +#define MIG_ROUTINE_ARG_DESCRIPTOR_NULL ((mig_routine_arg_descriptor_t)0) + +struct routine_descriptor { + mig_impl_routine_t impl_routine; /* Server work func pointer */ + mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */ + unsigned int argc; /* Number of argument words */ + unsigned int descr_count; /* Number complex descriptors */ + routine_arg_descriptor_t + arg_descr; /* pointer to descriptor array*/ + unsigned int max_reply_msg; /* Max size for reply msg */ +}; +typedef struct routine_descriptor *routine_descriptor_t; + +typedef struct routine_descriptor mig_routine_descriptor; +typedef mig_routine_descriptor *mig_routine_descriptor_t; + +#define MIG_ROUTINE_DESCRIPTOR_NULL ((mig_routine_descriptor_t)0) + +typedef struct mig_subsystem { + mig_server_routine_t server; /* pointer to demux routine */ + mach_msg_id_t start; /* Min routine number */ + mach_msg_id_t end; /* Max routine number + 1 */ + mach_msg_size_t maxsize; /* Max reply message size */ + vm_address_t reserved; /* reserved for MIG use */ + mig_routine_descriptor + routine[1]; /* Routine descriptor array */ +} *mig_subsystem_t; + +#define MIG_SUBSYSTEM_NULL ((mig_subsystem_t)0) + +typedef struct mig_symtab { + char *ms_routine_name; + int ms_routine_number; + void (*ms_routine)(void); /* Since the functions in the + * symbol table have unknown + * signatures, this is the best + * we can do... + */ +} mig_symtab_t; + + +__BEGIN_DECLS + +/* Client side reply port allocate */ +extern mach_port_t mig_get_reply_port(void); + +/* Client side reply port deallocate */ +extern void mig_dealloc_reply_port(mach_port_t reply_port); + +/* Client side reply port "deallocation" */ +extern void mig_put_reply_port(mach_port_t reply_port); + +/* Bounded string copy */ +extern int mig_strncpy(char *dest, const char *src, int len); + + +/* Allocate memory for out-of-line mig structures */ +extern void mig_allocate(vm_address_t *, vm_size_t); + +/* Deallocate memory used for out-of-line mig structures */ +extern void mig_deallocate(vm_address_t, vm_size_t); + + +__END_DECLS + +#endif /* _MACH_MIG_H_ */ diff --git a/i386/include/mach/mig_errors.h b/i386/include/mach/mig_errors.h new file mode 100644 index 0000000..f1234bc --- /dev/null +++ b/i386/include/mach/mig_errors.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Mach Interface Generator errors + * + */ + +#ifndef _MACH_MIG_ERRORS_H_ +#define _MACH_MIG_ERRORS_H_ + +#include <mach/mig.h> +#include <mach/ndr.h> +#include <mach/message.h> +#include <mach/kern_return.h> + +#include <sys/cdefs.h> + +/* + * These error codes should be specified as system 4, subsytem 2. + * But alas backwards compatibility makes that impossible. + * The problem is old clients of new servers (eg, the kernel) + * which get strange large error codes when there is a Mig problem + * in the server. Unfortunately, the IPC system doesn't have + * the knowledge to convert the codes in this situation. + */ + +#define MIG_TYPE_ERROR -300 /* client type check failure */ +#define MIG_REPLY_MISMATCH -301 /* wrong reply message ID */ +#define MIG_REMOTE_ERROR -302 /* server detected error */ +#define MIG_BAD_ID -303 /* bad request message ID */ +#define MIG_BAD_ARGUMENTS -304 /* server type check failure */ +#define MIG_NO_REPLY -305 /* no reply should be send */ +#define MIG_EXCEPTION -306 /* server raised exception */ +#define MIG_ARRAY_TOO_LARGE -307 /* array not large enough */ +#define MIG_SERVER_DIED -308 /* server died */ +#define MIG_TRAILER_ERROR -309 /* trailer has an unknown format */ + +/* + * Whenever MIG detects an error, it sends back a generic + * mig_reply_error_t format message. Clients must accept + * these in addition to the expected reply message format. + */ +#pragma pack(4) +typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; +} mig_reply_error_t; +#pragma pack() + + +__BEGIN_DECLS + +#if !defined(__NDR_convert__mig_reply_error_t__defined) +#define __NDR_convert__mig_reply_error_t__defined + +static __inline__ void +__NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x) +{ +#if defined(__NDR_convert__int_rep__kern_return_t__defined) + if (x->NDR.int_rep != NDR_record.int_rep) + __NDR_convert__int_rep__kern_return_t(&x->RetCode, x->NDR.int_rep); +#endif /* __NDR_convert__int_rep__kern_return_t__defined */ +} +#endif /* !defined(__NDR_convert__mig_reply_error_t__defined) */ + +__END_DECLS + +#endif /* _MACH_MIG_ERRORS_H_ */ diff --git a/i386/include/mach/ndr.h b/i386/include/mach/ndr.h new file mode 100644 index 0000000..cb64d3f --- /dev/null +++ b/i386/include/mach/ndr.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_NDR_H_ +#define _MACH_NDR_H_ + +#include <stdint.h> +#include <sys/cdefs.h> + +typedef struct { + unsigned char mig_vers; + unsigned char if_vers; + unsigned char reserved1; + unsigned char mig_encoding; + unsigned char int_rep; + unsigned char char_rep; + unsigned char float_rep; + unsigned char reserved2; +} NDR_record_t; + +/* + * MIG supported protocols for Network Data Representation + */ +#define NDR_PROTOCOL_2_0 0 + +/* + * NDR 2.0 format flag type definition and values. + */ +#define NDR_INT_BIG_ENDIAN 0 +#define NDR_INT_LITTLE_ENDIAN 1 +#define NDR_FLOAT_IEEE 0 +#define NDR_FLOAT_VAX 1 +#define NDR_FLOAT_CRAY 2 +#define NDR_FLOAT_IBM 3 +#define NDR_CHAR_ASCII 0 +#define NDR_CHAR_EBCDIC 1 + +extern NDR_record_t NDR_record; + +#if defined(BSMALL) +#define __NDR_convert__ 0 +#define __NDR_convert__int_rep__ 0 +#else +#ifndef __NDR_convert__ +#define __NDR_convert__ 1 +#endif /* __NDR_convert__ */ + +#ifndef __NDR_convert__int_rep__ +#define __NDR_convert__int_rep__ 1 +#endif /* __NDR_convert__int_rep__ */ + +#endif /* defined(BSMALL) */ + +#ifndef __NDR_convert__char_rep__ +#define __NDR_convert__char_rep__ 0 +#endif /* __NDR_convert__char_rep__ */ + +#ifndef __NDR_convert__float_rep__ +#define __NDR_convert__float_rep__ 0 +#endif /* __NDR_convert__float_rep__ */ + +#if __NDR_convert__ + +#define __NDR_convert__NOOP do ; while (0) +#define __NDR_convert__UNKNOWN(s) __NDR_convert__NOOP +#define __NDR_convert__SINGLE(a, f, r) do { r((a), (f)); } while (0) +#define __NDR_convert__ARRAY(a, f, c, r) \ + do { int __i__, __C__ = (c); \ + for (__i__ = 0; __i__ < __C__; __i__++) \ + r(&(a)[__i__], f); } while (0) +#define __NDR_convert__2DARRAY(a, f, s, c, r) \ + do { int __i__, __C__ = (c), __S__ = (s); \ + for (__i__ = 0; __i__ < __C__; __i__++) \ + r(&(a)[__i__ * __S__], f, __S__); } while (0) + +#if __NDR_convert__int_rep__ + +#include <libkern/OSByteOrder.h> + +#define __NDR_READSWAP_assign(a, rs) do { *(a) = rs(a); } while (0) + +#define __NDR_READSWAP__uint16_t(a) OSReadSwapInt16((void *)a, 0) +#define __NDR_READSWAP__int16_t(a) (int16_t)OSReadSwapInt16((void *)a, 0) +#define __NDR_READSWAP__uint32_t(a) OSReadSwapInt32((void *)a, 0) +#define __NDR_READSWAP__int32_t(a) (int32_t)OSReadSwapInt32((void *)a, 0) +#define __NDR_READSWAP__uint64_t(a) OSReadSwapInt64((void *)a, 0) +#define __NDR_READSWAP__int64_t(a) (int64_t)OSReadSwapInt64((void *)a, 0) + +__BEGIN_DECLS + +static __inline__ float __NDR_READSWAP__float(float *argp) { + union { + float sv; + uint32_t ull; + } result; + result.ull = __NDR_READSWAP__uint32_t((uint32_t *)argp); + return result.sv; +} + +static __inline__ double __NDR_READSWAP__double(double *argp) { + union { + double sv; + uint64_t ull; + } result; + result.ull = __NDR_READSWAP__uint64_t((uint64_t *)argp); + return result.sv; +} + +__END_DECLS + +#define __NDR_convert__int_rep__int16_t__defined +#define __NDR_convert__int_rep__int16_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__int16_t) + +#define __NDR_convert__int_rep__uint16_t__defined +#define __NDR_convert__int_rep__uint16_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__uint16_t) + +#define __NDR_convert__int_rep__int32_t__defined +#define __NDR_convert__int_rep__int32_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__int32_t) + +#define __NDR_convert__int_rep__uint32_t__defined +#define __NDR_convert__int_rep__uint32_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__uint32_t) + +#define __NDR_convert__int_rep__int64_t__defined +#define __NDR_convert__int_rep__int64_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__int64_t) + +#define __NDR_convert__int_rep__uint64_t__defined +#define __NDR_convert__int_rep__uint64_t(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__uint64_t) + +#define __NDR_convert__int_rep__float__defined +#define __NDR_convert__int_rep__float(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__float) + +#define __NDR_convert__int_rep__double__defined +#define __NDR_convert__int_rep__double(v,f) \ + __NDR_READSWAP_assign(v, __NDR_READSWAP__double) + +#define __NDR_convert__int_rep__boolean_t__defined +#define __NDR_convert__int_rep__boolean_t(v, f) \ + __NDR_convert__int_rep__int32_t(v,f) + +#define __NDR_convert__int_rep__kern_return_t__defined +#define __NDR_convert__int_rep__kern_return_t(v,f) \ + __NDR_convert__int_rep__int32_t(v,f) + +#define __NDR_convert__int_rep__mach_port_name_t__defined +#define __NDR_convert__int_rep__mach_port_name_t(v,f) \ + __NDR_convert__int_rep__uint32_t(v,f) + +#define __NDR_convert__int_rep__mach_msg_type_number_t__defined +#define __NDR_convert__int_rep__mach_msg_type_number_t(v,f) \ + __NDR_convert__int_rep__uint32_t(v,f) + +#endif /* __NDR_convert__int_rep__ */ + +#if __NDR_convert__char_rep__ + +#warning NDR character representation conversions not implemented yet! +#define __NDR_convert__char_rep__char(v,f) __NDR_convert__NOOP +#define __NDR_convert__char_rep__string(v,f,l) __NDR_convert__NOOP + +#endif /* __NDR_convert__char_rep__ */ + +#if __NDR_convert__float_rep__ + +#warning NDR floating point representation conversions not implemented yet! +#define __NDR_convert__float_rep__float(v,f) __NDR_convert__NOOP +#define __NDR_convert__float_rep__double(v,f) __NDR_convert__NOOP + +#endif /* __NDR_convert__float_rep__ */ + +#endif /* __NDR_convert__ */ + +#endif /* _MACH_NDR_H_ */ diff --git a/i386/include/mach/notify.defs b/i386/include/mach/notify.defs new file mode 100644 index 0000000..6f7f81d --- /dev/null +++ b/i386/include/mach/notify.defs @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif + notify 64; + +#include <mach/std_types.defs> + +#if SEQNOS +serverprefix do_seqnos_; +serverdemux seqnos_notify_server; +#else /* !SEQNOS */ +serverprefix do_; +serverdemux notify_server; +#endif /* SEQNOS */ + +/* MACH_NOTIFY_FIRST: 0100 */ +skip; + +/* MACH_NOTIFY_PORT_DELETED: 0101 */ +simpleroutine mach_notify_port_deleted( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + name : mach_port_name_t); + +skip; /* was MACH_NOTIFY_MSG_ACCEPTED: 0102 */ + +skip; /* was NOTIFY_OWNERSHIP_RIGHTS: 0103 */ + +skip; /* was NOTIFY_RECEIVE_RIGHTS: 0104 */ + +/* MACH_NOTIFY_PORT_DESTROYED: 0105 */ +simpleroutine mach_notify_port_destroyed( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + rights : mach_port_move_receive_t); + +/* MACH_NOTIFY_NO_SENDERS: 0106 */ +simpleroutine mach_notify_no_senders( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + mscount : mach_port_mscount_t); + +/* MACH_NOTIFY_SEND_ONCE: 0107 */ +simpleroutine mach_notify_send_once( + notify : mach_port_move_send_once_t +#if SEQNOS +; msgseqno seqno : mach_port_seqno_t +#endif /* SEQNOS */ + ); + +/* MACH_NOTIFY_DEAD_NAME: 0110 */ +simpleroutine mach_notify_dead_name( + notify : mach_port_move_send_once_t; +#if SEQNOS + msgseqno seqno : mach_port_seqno_t; +#endif /* SEQNOS */ + name : mach_port_name_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/notify.h b/i386/include/mach/notify.h new file mode 100644 index 0000000..768a865 --- /dev/null +++ b/i386/include/mach/notify.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/notify.h + * + * Kernel notification message definitions. + */ + +#ifndef _MACH_NOTIFY_H_ +#define _MACH_NOTIFY_H_ + +#include <mach/port.h> +#include <mach/message.h> +#include <mach/ndr.h> + +/* + * An alternative specification of the notification interface + * may be found in mach/notify.defs. + */ + +#define MACH_NOTIFY_FIRST 0100 +#define MACH_NOTIFY_PORT_DELETED (MACH_NOTIFY_FIRST + 001 ) + /* A send or send-once right was deleted. */ +#define MACH_NOTIFY_PORT_DESTROYED (MACH_NOTIFY_FIRST + 005) + /* A receive right was (would have been) deallocated */ +#define MACH_NOTIFY_NO_SENDERS (MACH_NOTIFY_FIRST + 006) + /* Receive right has no extant send rights */ +#define MACH_NOTIFY_SEND_ONCE (MACH_NOTIFY_FIRST + 007) + /* An extant send-once right died */ +#define MACH_NOTIFY_DEAD_NAME (MACH_NOTIFY_FIRST + 010) + /* Send or send-once right died, leaving a dead-name */ +#define MACH_NOTIFY_LAST (MACH_NOTIFY_FIRST + 015) + +typedef mach_port_t notify_port_t; + +/* + * Hard-coded message structures for receiving Mach port notification + * messages. However, they are not actual large enough to receive + * the largest trailers current exported by Mach IPC (so they cannot + * be used for space allocations in situations using these new larger + * trailers). Instead, the MIG-generated server routines (and + * related prototypes should be used). + */ +typedef struct { + mach_msg_header_t not_header; + NDR_record_t NDR; + mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ + mach_msg_format_0_trailer_t trailer; +} mach_port_deleted_notification_t; + +typedef struct { + mach_msg_header_t not_header; + mach_msg_body_t not_body; + mach_msg_port_descriptor_t not_port;/* MACH_MSG_TYPE_PORT_RECEIVE */ + mach_msg_format_0_trailer_t trailer; +} mach_port_destroyed_notification_t; + +typedef struct { + mach_msg_header_t not_header; + NDR_record_t NDR; + mach_msg_type_number_t not_count; + mach_msg_format_0_trailer_t trailer; +} mach_no_senders_notification_t; + +typedef struct { + mach_msg_header_t not_header; + mach_msg_format_0_trailer_t trailer; +} mach_send_once_notification_t; + +typedef struct { + mach_msg_header_t not_header; + NDR_record_t NDR; + mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */ + mach_msg_format_0_trailer_t trailer; +} mach_dead_name_notification_t; + +#endif /* _MACH_NOTIFY_H_ */ diff --git a/i386/include/mach/policy.h b/i386/include/mach/policy.h new file mode 100644 index 0000000..b6ec795 --- /dev/null +++ b/i386/include/mach/policy.h @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_POLICY_H_ +#define _MACH_POLICY_H_ + +/* + * mach/policy.h + * + * Definitions for scheduing policy. + */ + +/* + * All interfaces defined here are obsolete. + */ + +#include <mach/boolean.h> +#include <mach/message.h> +#include <mach/vm_types.h> + +/* + * Old scheduling control interface + */ +typedef int policy_t; +typedef integer_t *policy_info_t; +typedef integer_t *policy_base_t; +typedef integer_t *policy_limit_t; + +/* + * Policy definitions. Policies should be powers of 2, + * but cannot be or'd together other than to test for a + * policy 'class'. + */ +#define POLICY_NULL 0 /* none */ +#define POLICY_TIMESHARE 1 /* timesharing */ +#define POLICY_RR 2 /* fixed round robin */ +#define POLICY_FIFO 4 /* fixed fifo */ + +#define __NEW_SCHEDULING_FRAMEWORK__ + +/* + * Check if policy is of 'class' fixed-priority. + */ +#define POLICYCLASS_FIXEDPRI (POLICY_RR | POLICY_FIFO) + +/* + * Check if policy is valid. + */ +#define invalid_policy(policy) \ + ((policy) != POLICY_TIMESHARE && \ + (policy) != POLICY_RR && \ + (policy) != POLICY_FIFO) + + +/* + * Types for TIMESHARE policy + */ +struct policy_timeshare_base { + integer_t base_priority; +}; +struct policy_timeshare_limit { + integer_t max_priority; +}; +struct policy_timeshare_info { + integer_t max_priority; + integer_t base_priority; + integer_t cur_priority; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_timeshare_base *policy_timeshare_base_t; +typedef struct policy_timeshare_limit *policy_timeshare_limit_t; +typedef struct policy_timeshare_info *policy_timeshare_info_t; + +typedef struct policy_timeshare_base policy_timeshare_base_data_t; +typedef struct policy_timeshare_limit policy_timeshare_limit_data_t; +typedef struct policy_timeshare_info policy_timeshare_info_data_t; + + +#define POLICY_TIMESHARE_BASE_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_timeshare_base)/sizeof(integer_t))) +#define POLICY_TIMESHARE_LIMIT_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_timeshare_limit)/sizeof(integer_t))) +#define POLICY_TIMESHARE_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_timeshare_info)/sizeof(integer_t))) + + +/* + * Types for the ROUND ROBIN (RR) policy + */ +struct policy_rr_base { + integer_t base_priority; + integer_t quantum; +}; +struct policy_rr_limit { + integer_t max_priority; +}; +struct policy_rr_info { + integer_t max_priority; + integer_t base_priority; + integer_t quantum; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_rr_base *policy_rr_base_t; +typedef struct policy_rr_limit *policy_rr_limit_t; +typedef struct policy_rr_info *policy_rr_info_t; + +typedef struct policy_rr_base policy_rr_base_data_t; +typedef struct policy_rr_limit policy_rr_limit_data_t; +typedef struct policy_rr_info policy_rr_info_data_t; + +#define POLICY_RR_BASE_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_rr_base)/sizeof(integer_t))) +#define POLICY_RR_LIMIT_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_rr_limit)/sizeof(integer_t))) +#define POLICY_RR_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_rr_info)/sizeof(integer_t))) + + +/* + * Types for the FIRST-IN-FIRST-OUT (FIFO) policy + */ +struct policy_fifo_base { + integer_t base_priority; +}; +struct policy_fifo_limit { + integer_t max_priority; +}; +struct policy_fifo_info { + integer_t max_priority; + integer_t base_priority; + boolean_t depressed; + integer_t depress_priority; +}; + +typedef struct policy_fifo_base *policy_fifo_base_t; +typedef struct policy_fifo_limit *policy_fifo_limit_t; +typedef struct policy_fifo_info *policy_fifo_info_t; + +typedef struct policy_fifo_base policy_fifo_base_data_t; +typedef struct policy_fifo_limit policy_fifo_limit_data_t; +typedef struct policy_fifo_info policy_fifo_info_data_t; + +#define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_fifo_base)/sizeof(integer_t))) +#define POLICY_FIFO_LIMIT_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_fifo_limit)/sizeof(integer_t))) +#define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(struct policy_fifo_info)/sizeof(integer_t))) + +/* + * Aggregate policy types + */ + +struct policy_bases { + policy_timeshare_base_data_t ts; + policy_rr_base_data_t rr; + policy_fifo_base_data_t fifo; +}; + +struct policy_limits { + policy_timeshare_limit_data_t ts; + policy_rr_limit_data_t rr; + policy_fifo_limit_data_t fifo; +}; + +struct policy_infos { + policy_timeshare_info_data_t ts; + policy_rr_info_data_t rr; + policy_fifo_info_data_t fifo; +}; + +typedef struct policy_bases policy_base_data_t; +typedef struct policy_limits policy_limit_data_t; +typedef struct policy_infos policy_info_data_t; + +#endif /* _MACH_POLICY_H_ */ diff --git a/i386/include/mach/port.h b/i386/include/mach/port.h new file mode 100644 index 0000000..6550139 --- /dev/null +++ b/i386/include/mach/port.h @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * NOTICE: This file was modified by McAfee Research in 2004 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ +/* + */ +/* + * File: mach/port.h + * + * Definition of a Mach port + * + * Mach ports are the endpoints to Mach-implemented communications + * channels (usually uni-directional message queues, but other types + * also exist). + * + * Unique collections of these endpoints are maintained for each + * Mach task. Each Mach port in the task's collection is given a + * [task-local] name to identify it - and the the various "rights" + * held by the task for that specific endpoint. + * + * This header defines the types used to identify these Mach ports + * and the various rights associated with them. For more info see: + * + * <mach/mach_port.h> - manipulation of port rights in a given space + * <mach/message.h> - message queue [and port right passing] mechanism + * + */ + +#ifndef _MACH_PORT_H_ +#define _MACH_PORT_H_ + +#include <sys/cdefs.h> +#include <stdint.h> +#include <mach/boolean.h> +#include <mach/machine/vm_types.h> + +/* + * mach_port_name_t - the local identity for a Mach port + * + * The name is Mach port namespace specific. It is used to + * identify the rights held for that port by the task whose + * namespace is implied [or specifically provided]. + * + * Use of this type usually implies just a name - no rights. + * See mach_port_t for a type that implies a "named right." + * + */ + +typedef natural_t mach_port_name_t; +typedef mach_port_name_t *mach_port_name_array_t; + + +/* + * mach_port_t - a named port right + * + * In user-space, "rights" are represented by the name of the + * right in the Mach port namespace. Even so, this type is + * presented as a unique one to more clearly denote the presence + * of a right coming along with the name. + * + * Often, various rights for a port held in a single name space + * will coalesce and are, therefore, be identified by a single name + * [this is the case for send and receive rights]. But not + * always [send-once rights currently get a unique name for + * each right]. + * + */ + +#ifndef _MACH_PORT_T +#define _MACH_PORT_T +typedef mach_port_name_t mach_port_t; +#endif + + +typedef mach_port_t *mach_port_array_t; + +/* + * MACH_PORT_NULL is a legal value that can be carried in messages. + * It indicates the absence of any port or port rights. (A port + * argument keeps the message from being "simple", even if the + * value is MACH_PORT_NULL.) The value MACH_PORT_DEAD is also a legal + * value that can be carried in messages. It indicates + * that a port right was present, but it died. + */ + +#define MACH_PORT_NULL 0 /* intentional loose typing */ +#define MACH_PORT_DEAD ((mach_port_name_t) ~0) +#define MACH_PORT_VALID(name) \ + (((name) != MACH_PORT_NULL) && \ + ((name) != MACH_PORT_DEAD)) + + +/* + * For kernel-selected [assigned] port names, the name is + * comprised of two parts: a generation number and an index. + * This approach keeps the exact same name from being generated + * and reused too quickly [to catch right/reference counting bugs]. + * The dividing line between the constituent parts is exposed so + * that efficient "mach_port_name_t to data structure pointer" + * conversion implementation can be made. But it is possible + * for user-level code to assign their own names to Mach ports. + * These are not required to participate in this algorithm. So + * care should be taken before "assuming" this model. + * + */ + +#ifndef NO_PORT_GEN + +#define MACH_PORT_INDEX(name) ((name) >> 8) +#define MACH_PORT_GEN(name) (((name) & 0xff) << 24) +#define MACH_PORT_MAKE(index, gen) \ + (((index) << 8) | (gen) >> 24) + +#else /* NO_PORT_GEN */ + +#define MACH_PORT_INDEX(name) (name) +#define MACH_PORT_GEN(name) (0) +#define MACH_PORT_MAKE(index, gen) (index) + +#endif /* NO_PORT_GEN */ + + +/* + * These are the different rights a task may have for a port. + * The MACH_PORT_RIGHT_* definitions are used as arguments + * to mach_port_allocate, mach_port_get_refs, etc, to specify + * a particular right to act upon. The mach_port_names and + * mach_port_type calls return bitmasks using the MACH_PORT_TYPE_* + * definitions. This is because a single name may denote + * multiple rights. + */ + +typedef natural_t mach_port_right_t; + +#define MACH_PORT_RIGHT_SEND ((mach_port_right_t) 0) +#define MACH_PORT_RIGHT_RECEIVE ((mach_port_right_t) 1) +#define MACH_PORT_RIGHT_SEND_ONCE ((mach_port_right_t) 2) +#define MACH_PORT_RIGHT_PORT_SET ((mach_port_right_t) 3) +#define MACH_PORT_RIGHT_DEAD_NAME ((mach_port_right_t) 4) +#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) +#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) + +typedef natural_t mach_port_type_t; +typedef mach_port_type_t *mach_port_type_array_t; + +#define MACH_PORT_TYPE(right) \ + ((mach_port_type_t)(((mach_port_type_t) 1) \ + << ((right) + ((mach_port_right_t) 16)))) +#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L) +#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND) +#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE) +#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE) +#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET) +#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME) +#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) + +/* Convenient combinations. */ + +#define MACH_PORT_TYPE_SEND_RECEIVE \ + (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE) +#define MACH_PORT_TYPE_SEND_RIGHTS \ + (MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE) +#define MACH_PORT_TYPE_PORT_RIGHTS \ + (MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE) +#define MACH_PORT_TYPE_PORT_OR_DEAD \ + (MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME) +#define MACH_PORT_TYPE_ALL_RIGHTS \ + (MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET) + +/* Dummy type bits that mach_port_type/mach_port_names can return. */ + +#define MACH_PORT_TYPE_DNREQUEST 0x80000000 + +/* User-references for capabilities. */ + +typedef natural_t mach_port_urefs_t; +typedef integer_t mach_port_delta_t; /* change in urefs */ + +/* Attributes of ports. (See mach_port_get_receive_status.) */ + +typedef natural_t mach_port_seqno_t; /* sequence number */ +typedef natural_t mach_port_mscount_t; /* make-send count */ +typedef natural_t mach_port_msgcount_t; /* number of msgs */ +typedef natural_t mach_port_rights_t; /* number of rights */ + +/* + * Are there outstanding send rights for a given port? + */ +#define MACH_PORT_SRIGHTS_NONE 0 /* no srights */ +#define MACH_PORT_SRIGHTS_PRESENT 1 /* srights */ +typedef unsigned int mach_port_srights_t; /* status of send rights */ + +typedef struct mach_port_status { + mach_port_rights_t mps_pset; /* count of containing port sets */ + mach_port_seqno_t mps_seqno; /* sequence number */ + mach_port_mscount_t mps_mscount; /* make-send count */ + mach_port_msgcount_t mps_qlimit; /* queue limit */ + mach_port_msgcount_t mps_msgcount; /* number in the queue */ + mach_port_rights_t mps_sorights; /* how many send-once rights */ + boolean_t mps_srights; /* do send rights exist? */ + boolean_t mps_pdrequest; /* port-deleted requested? */ + boolean_t mps_nsrequest; /* no-senders requested? */ + natural_t mps_flags; /* port flags */ +} mach_port_status_t; + +/* System-wide values for setting queue limits on a port */ +#define MACH_PORT_QLIMIT_ZERO ((mach_port_msgcount_t) 0) +#define MACH_PORT_QLIMIT_BASIC ((mach_port_msgcount_t) 5) +#define MACH_PORT_QLIMIT_SMALL ((mach_port_msgcount_t) 16) +#define MACH_PORT_QLIMIT_LARGE ((mach_port_msgcount_t) 1024) +#define MACH_PORT_QLIMIT_KERNEL ((mach_port_msgcount_t) 65536) +#define MACH_PORT_QLIMIT_MIN MACH_PORT_QLIMIT_ZERO +#define MACH_PORT_QLIMIT_DEFAULT MACH_PORT_QLIMIT_BASIC +#define MACH_PORT_QLIMIT_MAX MACH_PORT_QLIMIT_LARGE + +typedef struct mach_port_limits { + mach_port_msgcount_t mpl_qlimit; /* number of msgs */ +} mach_port_limits_t; + +typedef integer_t *mach_port_info_t; /* varying array of natural_t */ + +/* Flavors for mach_port_get/set_attributes() */ +typedef int mach_port_flavor_t; +#define MACH_PORT_LIMITS_INFO 1 /* uses mach_port_status_t */ +#define MACH_PORT_RECEIVE_STATUS 2 /* uses mach_port_limits_t */ +#define MACH_PORT_DNREQUESTS_SIZE 3 /* info is int */ + +#define MACH_PORT_LIMITS_INFO_COUNT ((natural_t) \ + (sizeof(mach_port_limits_t)/sizeof(natural_t))) +#define MACH_PORT_RECEIVE_STATUS_COUNT ((natural_t) \ + (sizeof(mach_port_status_t)/sizeof(natural_t))) +#define MACH_PORT_DNREQUESTS_SIZE_COUNT 1 + +/* + * Structure used to pass information about port allocation requests. + * Must be padded to 64-bits total length. + */ +typedef struct mach_port_qos { + unsigned int name:1; /* name given */ + unsigned int prealloc:1; /* prealloced message */ + boolean_t pad1:30; + natural_t len; +} mach_port_qos_t; + +#if !__DARWIN_UNIX03 && !defined(_NO_PORT_T_FROM_MACH) +/* + * Mach 3.0 renamed everything to have mach_ in front of it. + * These types and macros are provided for backward compatibility + * but are deprecated. + */ +typedef mach_port_t port_t; +typedef mach_port_name_t port_name_t; +typedef mach_port_name_t *port_name_array_t; + +#define PORT_NULL ((port_t) 0) +#define PORT_DEAD ((port_t) ~0) +#define PORT_VALID(name) \ + ((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD) + +#endif /* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */ + +#endif /* _MACH_PORT_H_ */ diff --git a/i386/include/mach/port_obj.h b/i386/include/mach/port_obj.h new file mode 100644 index 0000000..d2b5f89 --- /dev/null +++ b/i386/include/mach/port_obj.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Define a service to map from a kernel-generated port name + * to server-defined "type" and "value" data to be associated + * with the port. + */ + +#ifndef PORT_OBJ_H +#define PORT_OBJ_H + +#include <mach/port.h> + +struct port_obj_tentry { + void *pos_value; + int pos_type; +}; + +#include <sys/cdefs.h> + +__BEGIN_DECLS +extern void port_obj_init(int); +__END_DECLS + +extern struct port_obj_tentry *port_obj_table; +extern int port_obj_table_size; + +#ifndef PORT_OBJ_ASSERT + +#define port_set_obj_value_type(pname, value, type) \ +do { \ + int ndx; \ + \ + if (!port_obj_table) \ + port_obj_init(port_obj_table_size); \ + ndx = MACH_PORT_INDEX(pname); \ + port_obj_table[ndx].pos_value = (value); \ + port_obj_table[ndx].pos_type = (type); \ +} while (0) + +#define port_get_obj_value(pname) \ + (port_obj_table[MACH_PORT_INDEX(pname)].pos_value) + +#define port_get_obj_type(pname) \ + (port_obj_table[MACH_PORT_INDEX(pname)].pos_type) + +#else /* PORT_OBJ_ASSERT */ + +#define port_set_obj_value_type(pname, value, type) \ +do { \ + int ndx; \ + \ + if (!port_obj_table) \ + port_obj_init(port_obj_table_size); \ + ndx = MACH_PORT_INDEX(pname); \ + assert(ndx > 0); \ + assert(ndx < port_obj_table_size); \ + port_obj_table[ndx].pos_value = (value); \ + port_obj_table[ndx].pos_type = (type); \ +} while (0) + +#define port_get_obj_value(pname) \ + ((MACH_PORT_INDEX(pname) < (unsigned)port_obj_table_size) ? \ + port_obj_table[MACH_PORT_INDEX(pname)].pos_value : \ + (panic("port_get_obj_value: index too big"), (void *)-1)) + +#define port_get_obj_type(pname) \ + ((MACH_PORT_INDEX(pname) < (unsigned)port_obj_table_size) ? \ + port_obj_table[MACH_PORT_INDEX(pname)].pos_type : \ + (panic("port_get_obj_type: index too big"), -1)) + +#endif /* PORT_OBJ_ASSERT */ + +#endif /* PORT_OBJ_H */ diff --git a/i386/include/mach/ppc/.svn/all-wcprops b/i386/include/mach/ppc/.svn/all-wcprops new file mode 100644 index 0000000..c61f24d --- /dev/null +++ b/i386/include/mach/ppc/.svn/all-wcprops @@ -0,0 +1,101 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc +END +processor_info.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/processor_info.h +END +thread_act.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/thread_act.h +END +kern_return.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/kern_return.h +END +exception.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/exception.h +END +ndr_def.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/ndr_def.h +END +vm_param.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/vm_param.h +END +task.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/task.h +END +vm_types.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/vm_types.h +END +_structs.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/_structs.h +END +thread_state.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/thread_state.h +END +thread_status.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/thread_status.h +END +boolean.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/boolean.h +END +asm.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/asm.h +END +machine_types.defs +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/machine_types.defs +END +rpc.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/rpc.h +END +sdt_isa.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/ppc/sdt_isa.h +END diff --git a/i386/include/mach/ppc/.svn/entries b/i386/include/mach/ppc/.svn/entries new file mode 100644 index 0000000..96bb1b4 --- /dev/null +++ b/i386/include/mach/ppc/.svn/entries @@ -0,0 +1,572 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach/ppc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +processor_info.h +file + + + + +2013-08-27T23:54:44.000000Z +1def29767118d758f4916d50a56aac5c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1619 + +thread_act.h +file + + + + +2013-08-27T23:54:44.000000Z +25d845f2e915a195e887ae48026bf854 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25654 + +kern_return.h +file + + + + +2013-08-27T23:54:44.000000Z +f2ad3d54a39d3df0d8dfda96a2fa7378 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2729 + +exception.h +file + + + + +2013-08-27T23:54:44.000000Z +2abb8083935fb60213b3c19b63634559 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4408 + +ndr_def.h +file + + + + +2013-08-27T23:54:44.000000Z +cac0320480d02d9090f7d8a90600cef3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1570 + +vm_param.h +file + + + + +2013-08-27T23:54:44.000000Z +4bf6349de403d6634c9054180f5ddd0a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2673 + +task.h +file + + + + +2013-08-27T23:54:44.000000Z +d87c8dd8a5baf21d6cd2fb7fd2c6775d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34704 + +vm_types.h +file + + + + +2013-08-27T23:54:44.000000Z +df31e09f20fa6ee73656f2a2833845cc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4754 + +_structs.h +file + + + + +2013-08-27T23:54:44.000000Z +75b4095e3aed90f204bff5290e833806 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11671 + +thread_state.h +file + + + + +2013-08-27T23:54:44.000000Z +97e5166d09d67290be7445b45264bb5e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1702 + +thread_status.h +file + + + + +2013-08-27T23:54:44.000000Z +c2b7927398fe95018fcc00b33495f336 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5095 + +boolean.h +file + + + + +2013-08-27T23:54:44.000000Z +c73717d4fdb2f372401fe3c9daddb28b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2652 + +asm.h +file + + + + +2013-08-27T23:54:44.000000Z +16adb3c40020e8e9e31a6510e4e5780c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18179 + +machine_types.defs +file + + + + +2013-08-27T23:54:44.000000Z +6148f30af540845e90cc39c55afb109b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3512 + +rpc.h +file + + + + +2013-08-27T23:54:44.000000Z +51d2e12e62f2d63f0a9078eb1a04800a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1447 + +sdt_isa.h +file + + + + +2013-08-27T23:54:44.000000Z +28d6204e065de28a66bbc7546b099c6a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15122 + diff --git a/i386/include/mach/ppc/.svn/text-base/_structs.h.svn-base b/i386/include/mach/ppc/.svn/text-base/_structs.h.svn-base new file mode 100644 index 0000000..f2c78cd --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/_structs.h.svn-base @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC__STRUCTS_H_ +#define _MACH_PPC__STRUCTS_H_ + +#include <sys/cdefs.h> + +/* + * ppc_thread_state is the structure that is exported to user threads for + * use in status/mutate calls. This structure should never change. + * + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_THREAD_STATE struct __darwin_ppc_thread_state +_STRUCT_PPC_THREAD_STATE +{ + unsigned int __srr0; /* Instruction address register (PC) */ + unsigned int __srr1; /* Machine state register (supervisor) */ + unsigned int __r0; + unsigned int __r1; + unsigned int __r2; + unsigned int __r3; + unsigned int __r4; + unsigned int __r5; + unsigned int __r6; + unsigned int __r7; + unsigned int __r8; + unsigned int __r9; + unsigned int __r10; + unsigned int __r11; + unsigned int __r12; + unsigned int __r13; + unsigned int __r14; + unsigned int __r15; + unsigned int __r16; + unsigned int __r17; + unsigned int __r18; + unsigned int __r19; + unsigned int __r20; + unsigned int __r21; + unsigned int __r22; + unsigned int __r23; + unsigned int __r24; + unsigned int __r25; + unsigned int __r26; + unsigned int __r27; + unsigned int __r28; + unsigned int __r29; + unsigned int __r30; + unsigned int __r31; + + unsigned int __cr; /* Condition register */ + unsigned int __xer; /* User's integer exception register */ + unsigned int __lr; /* Link register */ + unsigned int __ctr; /* Count register */ + unsigned int __mq; /* MQ register (601 only) */ + + unsigned int __vrsave; /* Vector Save Register */ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_THREAD_STATE struct ppc_thread_state +_STRUCT_PPC_THREAD_STATE +{ + unsigned int srr0; /* Instruction address register (PC) */ + unsigned int srr1; /* Machine state register (supervisor) */ + unsigned int r0; + unsigned int r1; + unsigned int r2; + unsigned int r3; + unsigned int r4; + unsigned int r5; + unsigned int r6; + unsigned int r7; + unsigned int r8; + unsigned int r9; + unsigned int r10; + unsigned int r11; + unsigned int r12; + unsigned int r13; + unsigned int r14; + unsigned int r15; + unsigned int r16; + unsigned int r17; + unsigned int r18; + unsigned int r19; + unsigned int r20; + unsigned int r21; + unsigned int r22; + unsigned int r23; + unsigned int r24; + unsigned int r25; + unsigned int r26; + unsigned int r27; + unsigned int r28; + unsigned int r29; + unsigned int r30; + unsigned int r31; + + unsigned int cr; /* Condition register */ + unsigned int xer; /* User's integer exception register */ + unsigned int lr; /* Link register */ + unsigned int ctr; /* Count register */ + unsigned int mq; /* MQ register (601 only) */ + + unsigned int vrsave; /* Vector Save Register */ +}; +#endif /* __DARWIN_UNIX03 */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#pragma pack(4) /* Make sure the structure stays as we defined it */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_THREAD_STATE64 struct __darwin_ppc_thread_state64 +_STRUCT_PPC_THREAD_STATE64 +{ + unsigned long long __srr0; /* Instruction address register (PC) */ + unsigned long long __srr1; /* Machine state register (supervisor) */ + unsigned long long __r0; + unsigned long long __r1; + unsigned long long __r2; + unsigned long long __r3; + unsigned long long __r4; + unsigned long long __r5; + unsigned long long __r6; + unsigned long long __r7; + unsigned long long __r8; + unsigned long long __r9; + unsigned long long __r10; + unsigned long long __r11; + unsigned long long __r12; + unsigned long long __r13; + unsigned long long __r14; + unsigned long long __r15; + unsigned long long __r16; + unsigned long long __r17; + unsigned long long __r18; + unsigned long long __r19; + unsigned long long __r20; + unsigned long long __r21; + unsigned long long __r22; + unsigned long long __r23; + unsigned long long __r24; + unsigned long long __r25; + unsigned long long __r26; + unsigned long long __r27; + unsigned long long __r28; + unsigned long long __r29; + unsigned long long __r30; + unsigned long long __r31; + + unsigned int __cr; /* Condition register */ + unsigned long long __xer; /* User's integer exception register */ + unsigned long long __lr; /* Link register */ + unsigned long long __ctr; /* Count register */ + + unsigned int __vrsave; /* Vector Save Register */ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_THREAD_STATE64 struct ppc_thread_state64 +_STRUCT_PPC_THREAD_STATE64 +{ + unsigned long long srr0; /* Instruction address register (PC) */ + unsigned long long srr1; /* Machine state register (supervisor) */ + unsigned long long r0; + unsigned long long r1; + unsigned long long r2; + unsigned long long r3; + unsigned long long r4; + unsigned long long r5; + unsigned long long r6; + unsigned long long r7; + unsigned long long r8; + unsigned long long r9; + unsigned long long r10; + unsigned long long r11; + unsigned long long r12; + unsigned long long r13; + unsigned long long r14; + unsigned long long r15; + unsigned long long r16; + unsigned long long r17; + unsigned long long r18; + unsigned long long r19; + unsigned long long r20; + unsigned long long r21; + unsigned long long r22; + unsigned long long r23; + unsigned long long r24; + unsigned long long r25; + unsigned long long r26; + unsigned long long r27; + unsigned long long r28; + unsigned long long r29; + unsigned long long r30; + unsigned long long r31; + + unsigned int cr; /* Condition register */ + unsigned long long xer; /* User's integer exception register */ + unsigned long long lr; /* Link register */ + unsigned long long ctr; /* Count register */ + + unsigned int vrsave; /* Vector Save Register */ +}; +#endif /* __DARWIN_UNIX03 */ + +#pragma pack() + +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* This structure should be double-word aligned for performance */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_FLOAT_STATE struct __darwin_ppc_float_state +_STRUCT_PPC_FLOAT_STATE +{ + double __fpregs[32]; + + unsigned int __fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */ + unsigned int __fpscr; /* floating point status register */ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_FLOAT_STATE struct ppc_float_state +_STRUCT_PPC_FLOAT_STATE +{ + double fpregs[32]; + + unsigned int fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */ + unsigned int fpscr; /* floating point status register */ +}; +#endif /* __DARWIN_UNIX03 */ + +#pragma pack(4) /* Make sure the structure stays as we defined it */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_VECTOR_STATE struct __darwin_ppc_vector_state +_STRUCT_PPC_VECTOR_STATE +{ +#if defined(__LP64__) + unsigned int __save_vr[32][4]; + unsigned int __save_vscr[4]; +#else + unsigned long __save_vr[32][4]; + unsigned long __save_vscr[4]; +#endif + unsigned int __save_pad5[4]; + unsigned int __save_vrvalid; /* VRs that have been saved */ + unsigned int __save_pad6[7]; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_VECTOR_STATE struct ppc_vector_state +_STRUCT_PPC_VECTOR_STATE +{ +#if defined(__LP64__) + unsigned int save_vr[32][4]; + unsigned int save_vscr[4]; +#else + unsigned long save_vr[32][4]; + unsigned long save_vscr[4]; +#endif + unsigned int save_pad5[4]; + unsigned int save_vrvalid; /* VRs that have been saved */ + unsigned int save_pad6[7]; +}; +#endif /* __DARWIN_UNIX03 */ + +#pragma pack() + +/* + * ppc_exception_state + * + * This structure corresponds to some additional state of the user + * registers as saved in the PCB upon kernel entry. They are only + * available if an exception is passed out of the kernel, and even + * then not all are guaranteed to be updated. + * + * Some padding is included in this structure which allows space for + * servers to store temporary values if need be, to maintain binary + * compatiblity. + */ + +/* Exception state for 32-bit thread (on 32-bit processor) */ +/* Still available on 64-bit processors, but may fall short */ +/* of covering the full potential state (hi half available). */ + +#pragma pack(4) /* Make sure the structure stays as we defined it */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_EXCEPTION_STATE struct __darwin_ppc_exception_state +_STRUCT_PPC_EXCEPTION_STATE +{ +#if defined(__LP64__) + unsigned int __dar; /* Fault registers for coredump */ + unsigned int __dsisr; + unsigned int __exception; /* number of powerpc exception taken */ + unsigned int __pad0; /* align to 16 bytes */ + unsigned int __pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long __dar; /* Fault registers for coredump */ + unsigned long __dsisr; + unsigned long __exception; /* number of powerpc exception taken */ + unsigned long __pad0; /* align to 16 bytes */ + unsigned long __pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_EXCEPTION_STATE struct ppc_exception_state +_STRUCT_PPC_EXCEPTION_STATE +{ +#if defined(__LP64__) + unsigned int dar; /* Fault registers for coredump */ + unsigned int dsisr; + unsigned int exception; /* number of powerpc exception taken */ + unsigned int pad0; /* align to 16 bytes */ + unsigned int pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long dar; /* Fault registers for coredump */ + unsigned long dsisr; + unsigned long exception; /* number of powerpc exception taken */ + unsigned long pad0; /* align to 16 bytes */ + unsigned long pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#endif /* __DARWIN_UNIX03 */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_EXCEPTION_STATE64 struct __darwin_ppc_exception_state64 +_STRUCT_PPC_EXCEPTION_STATE64 +{ + unsigned long long __dar; /* Fault registers for coredump */ +#if defined(__LP64__) + unsigned int __dsisr; + unsigned int __exception; /* number of powerpc exception taken */ + unsigned int __pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long __dsisr; + unsigned long __exception; /* number of powerpc exception taken */ + unsigned long __pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_EXCEPTION_STATE64 struct ppc_exception_state64 +_STRUCT_PPC_EXCEPTION_STATE64 +{ + unsigned long long dar; /* Fault registers for coredump */ +#if defined(__LP64__) + unsigned int dsisr; + unsigned int exception; /* number of powerpc exception taken */ + unsigned int pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long dsisr; + unsigned long exception; /* number of powerpc exception taken */ + unsigned long pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#pragma pack() + +#endif /* _MACH_PPC__STRUCTS_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/asm.h.svn-base b/i386/include/mach/ppc/.svn/text-base/asm.h.svn-base new file mode 100644 index 0000000..2535a84 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/asm.h.svn-base @@ -0,0 +1,781 @@ +/* + * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +#ifndef _PPC_ASM_H_ +#define _PPC_ASM_H_ + +#define __ASMNL__ @ +#define STRINGD .ascii + +#ifdef ASSEMBLER + + +#define br0 0 + +#define ARG0 r3 +#define ARG1 r4 +#define ARG2 r5 +#define ARG3 r6 +#define ARG4 r7 +#define ARG5 r8 +#define ARG6 r9 +#define ARG7 r10 + +#define tmp0 r0 /* Temporary GPR remapping (603e specific) */ +#define tmp1 r1 +#define tmp2 r2 +#define tmp3 r3 + +/* SPR registers */ + +#define mq 0 /* MQ register for 601 emulation */ +#define rtcu 4 /* RTCU - upper word of RTC for 601 emulation */ +#define rtcl 5 /* RTCL - lower word of RTC for 601 emulation */ +#define dsisr 18 +#define ppcDAR 19 +#define ppcdar 19 +#define dar 19 +#define SDR1 25 +#define sdr1 25 +#define srr0 26 +#define srr1 27 +#define vrsave 256 /* Vector Register save */ +#define sprg0 272 +#define sprg1 273 +#define sprg2 274 +#define sprg3 275 +#define scomc 276 +#define scomd 277 +#define pvr 287 + +#define IBAT0U 528 +#define IBAT0L 529 +#define IBAT1U 530 +#define IBAT1L 531 +#define IBAT2U 532 +#define IBAT2L 533 +#define IBAT3U 534 +#define IBAT3L 535 +#define ibat0u 528 +#define ibat0l 529 +#define ibat1u 530 +#define ibat1l 531 +#define ibat2u 532 +#define ibat2l 533 +#define ibat3u 534 +#define ibat3l 535 + +#define DBAT0U 536 +#define DBAT0L 537 +#define DBAT1U 538 +#define DBAT1L 539 +#define DBAT2U 540 +#define DBAT2L 541 +#define DBAT3U 542 +#define DBAT3L 543 +#define dbat0u 536 +#define dbat0l 537 +#define dbat1u 538 +#define dbat1l 539 +#define dbat2u 540 +#define dbat2l 541 +#define dbat3u 542 +#define dbat3l 543 + +#define ummcr2 928 /* Performance monitor control */ +#define upmc5 929 /* Performance monitor counter */ +#define upmc6 930 /* Performance monitor counter */ +#define ubamr 935 /* Performance monitor mask */ +#define ummcr0 936 /* Performance monitor control */ +#define upmc1 937 /* Performance monitor counter */ +#define upmc2 938 /* Performance monitor counter */ +#define usia 939 /* User sampled instruction address */ +#define ummcr1 940 /* Performance monitor control */ +#define upmc3 941 /* Performance monitor counter */ +#define upmc4 942 /* Performance monitor counter */ +#define usda 943 /* User sampled data address */ +#define mmcr2 944 /* Performance monitor control */ +#define pmc5 945 /* Performance monitor counter */ +#define pmc6 946 /* Performance monitor counter */ +#define bamr 951 /* Performance monitor mask */ +#define mmcr0 952 +#define pmc1 953 +#define pmc2 954 +#define sia 955 +#define mmcr1 956 +#define pmc3 957 +#define pmc4 958 +#define sda 959 /* Sampled data address */ +#define dmiss 976 /* ea that missed */ +#define trig0 976 +#define dcmp 977 /* compare value for the va that missed */ +#define trig1 977 +#define hash1 978 /* pointer to first hash pteg */ +#define trig2 978 +#define hash2 979 /* pointer to second hash pteg */ +#define imiss 980 /* ea that missed */ +#define tlbmiss 980 /* ea that missed */ +#define icmp 981 /* compare value for the va that missed */ +#define ptehi 981 /* compare value for the va that missed */ +#define rpa 982 /* required physical address register */ +#define ptelo 982 /* required physical address register */ +#define l3pdet 984 /* l3pdet */ + +#define HID0 1008 /* Checkstop and misc enables */ +#define hid0 1008 /* Checkstop and misc enables */ +#define HID1 1009 /* Clock configuration */ +#define hid1 1009 /* Clock configuration */ +#define HID2 1016 /* Other processor controls */ +#define hid2 1016 /* Other processor controls */ +#define iabr 1010 /* Instruction address breakpoint register */ +#define ictrl 1011 /* Instruction Cache Control */ +#define ldstdb 1012 /* Load/Store Debug */ +#define hid4 1012 /* Misc stuff */ +#define dabr 1013 /* Data address breakpoint register */ +#define msscr0 1014 /* Memory subsystem control */ +#define hid5 1014 /* Misc stuff */ +#define msscr1 1015 /* Memory subsystem debug */ +#define msssr0 1015 /* Memory Subsystem Status */ +#define ldstcr 1016 /* Load/Store Status/Control */ +#define l2cr2 1016 /* L2 Cache control 2 */ +#define l2cr 1017 /* L2 Cache control */ +#define l3cr 1018 /* L3 Cache control */ +#define ictc 1019 /* I-cache throttling control */ +#define thrm1 1020 /* Thermal management 1 */ +#define thrm2 1021 /* Thermal management 2 */ +#define thrm3 1022 /* Thermal management 3 */ +#define pir 1023 /* Processor ID Register */ + + +/* SPR registers (64-bit, PPC970 specific) */ + +#define scomc_gp 276 +#define scomd_gp 277 + +#define hsprg0 304 +#define hsprg1 305 +#define hdec 310 +#define hior 311 +#define rmor 312 +#define hrmor 313 +#define hsrr0 314 +#define hsrr1 315 +#define lpcr 318 +#define lpidr 319 + +#define ummcra_gp 770 +#define upmc1_gp 771 +#define upmc2_gp 772 +#define upmc3_gp 773 +#define upmc4_gp 774 +#define upmc5_gp 775 +#define upmc6_gp 776 +#define upmc7_gp 777 +#define upmc8_gp 778 +#define ummcr0_gp 779 +#define usiar_gp 780 +#define usdar_gp 781 +#define ummcr1_gp 782 +#define uimc_gp 783 + +#define mmcra_gp 786 +#define pmc1_gp 787 +#define pmc2_gp 788 +#define pmc3_gp 789 +#define pmc4_gp 790 +#define pmc5_gp 791 +#define pmc6_gp 792 +#define pmc7_gp 793 +#define pmc8_gp 794 +#define mmcr0_gp 795 +#define siar_gp 796 +#define sdar_gp 797 +#define mmcr1_gp 798 +#define imc_gp 799 + +#define trig0_gp 976 +#define trig1_gp 977 +#define trig2_gp 978 + +#define dabrx 1015 + +; hid0 bits +#define emcp 0 +#define emcpm 0x80000000 +#define dbp 1 +#define dbpm 0x40000000 +#define eba 2 +#define ebam 0x20000000 +#define ebd 3 +#define ebdm 0x10000000 +#define sbclk 4 +#define sbclkm 0x08000000 +#define eclk 6 +#define eclkm 0x02000000 +#define par 7 +#define parm 0x01000000 +#define sten 7 +#define stenm 0x01000000 +#define dnap 7 +#define dnapm 0x01000000 +#define doze 8 +#define dozem 0x00800000 +#define nap 9 +#define napm 0x00400000 +#define sleep 10 +#define sleepm 0x00200000 +#define dpm 11 +#define dpmm 0x00100000 +#define riseg 12 +#define risegm 0x00080000 +#define eiec 13 +#define eiecm 0x00040000 +#define mum 14 +#define mumm 0x00020000 +#define nhr 15 +#define nhrm 0x00010000 +#define ice 16 +#define icem 0x00008000 +#define dce 17 +#define dcem 0x00004000 +#define ilock 18 +#define ilockm 0x00002000 +#define dlock 19 +#define dlockm 0x00001000 +#define exttben 19 +#define icfi 20 +#define icfim 0x00000800 +#define dcfi 21 +#define dcfim 0x00000400 +#define spd 22 +#define spdm 0x00000200 +#define hdice 23 +#define hdicem 0x00000100 +#define sge 24 +#define sgem 0x00000080 +#define dcfa 25 +#define dcfam 0x00000040 +#define btic 26 +#define bticm 0x00000020 +#define lrstk 27 +#define lrstkm 0x00000010 +#define abe 28 +#define abem 0x00000008 +#define fold 28 +#define foldm 0x00000008 +#define bht 29 +#define bhtm 0x00000004 +#define nopdst 30 +#define nopdstm 0x00000002 +#define nopti 31 +#define noptim 0x00000001 + +; hid1 bits +#define hid1pcem 0xF8000000 +#define hid1prem 0x06000000 +#define hid1dfs0 8 +#define hid1dfs0m 0x00800000 +#define hid1dfs1 9 +#define hid1dfs1m 0x00400000 +#define hid1pi0 14 +#define hid1pi0m 0x00020000 +#define hid1FCPErr 14 +#define hid1ps 15 +#define hid1FCD0PErr 15 +#define hid1psm 0x00010000 +#define hid1pc0 0x0000F800 +#define hid1pr0 0x00000600 +#define hid1pc1 0x000000F8 +#define hid1pc0 0x0000F800 +#define hid1pr1 0x00000006 +#define hid1FCD1PErr 16 +#define hid1FIERATErr 17 + +; hid2 bits +#define hid2vmin 18 +#define hid2vminm 0x00002000 + +; msscr0 bits +#define shden 0 +#define shdenm 0x80000000 +#define shden3 1 +#define shdenm3 0x40000000 +#define l1intvs 2 +#define l1intve 4 +#define l1intvb 0x38000000 +#define l2intvs 5 +#define l2intve 7 +#define l2intvb 0x07000000 +#define dl1hwf 8 +#define dl1hwfm 0x00800000 +#define dbsiz 9 +#define dbsizm 0x00400000 +#define emode 10 +#define emodem 0x00200000 +#define abgd 11 +#define abgdm 0x00100000 +#define tfsts 24 +#define tfste 25 +#define tfstm 0x000000C0 +#define l2pfes 30 +#define l2pfee 31 +#define l2pfem 0x00000003 + +; msscr1 bits +#define cqd 15 +#define cqdm 0x00010000 +#define csqs 1 +#define csqe 2 +#define csqm 0x60000000 + +; msssr1 bits - 7450 +#define vgL2PARA 0 +#define vgL3PARA 1 +#define vgL2COQEL 2 +#define vgL3COQEL 3 +#define vgL2CTR 4 +#define vgL3CTR 5 +#define vgL2COQR 6 +#define vgL3COQR 7 +#define vgLMQ 8 +#define vgSMC 9 +#define vgSNP 10 +#define vgBIU 11 +#define vgSMCE 12 +#define vgL2TAG 13 +#define vgL2DAT 14 +#define vgL3TAG 15 +#define vgL3DAT 16 +#define vgAPE 17 +#define vgDPE 18 +#define vgTEA 19 + +; srr1 bits +#define icmck 1 +#define icmckm 0x40000000 +#define dcmck 2 +#define dcmckm 0x20000000 +#define l2mck 3 +#define l2mckm 0x10000000 +#define tlbmck 4 +#define tlbmckm 0x08000000 +#define brmck 5 +#define brmckm 0x04000000 +#define othmck 10 +#define othmckm 0x00200000 +#define l2dpmck 11 +#define l2dpmckm 0x00100000 +#define mcpmck 12 +#define mcpmckm 0x00080000 +#define teamck 13 +#define teamckm 0x00040000 +#define dpmck 14 +#define dpmckm 0x00020000 +#define apmck 15 +#define apmckm 0x00010000 + +#define mckIFUE 42 +#define mckLDST 43 +#define mckXCs 44 +#define mckXCe 45 +#define mckNoErr 0 +#define mckIFSLBPE 1 +#define mckIFTLBPE 2 +#define mckIFTLBUE 3 + +; dsisr bits +#define mckUEdfr 16 +#define mckUETwDfr 17 +#define mckL1DCPE 18 +#define mckL1DTPE 19 +#define mckDEPE 20 +#define mckTLBPE 21 +#define mckSLBPE 23 + +; Async MCK source +#define AsyMCKSrc 0x0226 +#define AsyMCKRSrc 0x0227 +#define AsyMCKext 0 +#define AsyMCKfir 1 +#define AsyMCKhri 2 +#define AsyMCKdbg 3 +#define AsyMCKncstp 4 + +; Core FIR +#define cFIR 0x0300 +#define cFIRrst 0x0310 +#define cFIRICachePE 0 +#define cFIRITagPE0 1 +#define cFIRITagPE1 2 +#define cFIRIEratPE 3 +#define cFIRIFUL2UE 4 +#define cFIRIFUCS 5 +#define cFIRDCachePE 6 +#define cFIRDTagPE 7 +#define cFIRDEratPE 8 +#define cFIRTLBPE 9 +#define cFIRSLBPE 10 +#define cFIRSL2UE 11 + +; Core Error Inject +#define CoreErrI 0x0350 +#define CoreIFU 0 +#define CoreLSU 1 +#define CoreRate0 2 +#define CoreRate1 3 +#define CoreOnce 0 +#define CoreSolid 2 +#define CorePulse 3 + +; L2 FIR +#define l2FIR 0x0400 +#define l2FIRrst 0x0410 + +; Bus FIR +#define busFIR 0x0A00 +#define busFIRrst 0x0A10 + +; HID4 +#define hid4RMCI 23 +#define hid4FAlgn 24 +#define hid4DisPF 25 +#define hid4ResPF 26 +#define hid4EnSPTW 27 +#define hid4L1DCFI 28 +#define hid4DisDERpg 31 +#define hid4DisDCTpg 36 +#define hid4DisDCpg 41 +#define hid4DisTLBpg 48 +#define hid4DisSLBpg 54 +#define hid4MckEIEna 55 + +; L2 cache control +#define l2e 0 +#define l2em 0x80000000 +#define l2pe 1 +#define l2pem 0x40000000 +#define l2siz 2 +#define l2sizf 3 +#define l2sizm 0x30000000 +#define l2clk 4 +#define l2clkf 6 +#define l2clkm 0x0E000000 +#define l2ram 7 +#define l2ramf 8 +#define l2ramm 0x01800000 +#define l2do 9 +#define l2dom 0x00400000 +#define l2i 10 +#define l2im 0x00200000 +#define l2ctl 11 +#define l2ctlm 0x00100000 +#define l2ionly 11 +#define l2ionlym 0x00100000 +#define l2wt 12 +#define l2wtm 0x00080000 +#define l2ts 13 +#define l2tsm 0x00040000 +#define l2oh 14 +#define l2ohf 15 +#define l2ohm 0x00030000 +#define l2donly 15 +#define l2donlym 0x00010000 +#define l2sl 16 +#define l2slm 0x00008000 +#define l2df 17 +#define l2dfm 0x00004000 +#define l2byp 18 +#define l2bypm 0x00002000 +#define l2fa 19 +#define l2fam 0x00001000 +#define l2hwf 20 +#define l2hwfm 0x00000800 +#define l2io 21 +#define l2iom 0x00000400 +#define l2clkstp 22 +#define l2clkstpm 0x00000200 +#define l2dro 23 +#define l2drom 0x00000100 +#define l2ctr 24 +#define l2ctrf 30 +#define l2ctrm 0x000000FE +#define l2ip 31 +#define l2ipm 0x00000001 + +; L3 cache control +#define l3e 0 +#define l3em 0x80000000 +#define l3pe 1 +#define l3pem 0x40000000 +#define l3siz 3 +#define l3sizm 0x10000000 +#define l3clken 4 +#define l3clkenm 0x08000000 +#define l3dx 5 +#define l3dxm 0x04000000 +#define l3clk 6 +#define l3clkf 8 +#define l3clkm 0x03800000 +#define l3io 9 +#define l3iom 0x00400000 +#define l3spo 13 +#define l3spom 0x00040000 +#define l3cksp 14 +#define l3ckspf 15 +#define l3ckspm 0x00030000 +#define l3psp 16 +#define l3pspf 18 +#define l3pspm 0x0000E000 +#define l3rep 19 +#define l3repm 0x00001000 +#define l3hwf 20 +#define l3hwfm 0x00000800 +#define l3i 21 +#define l3im 0x00000400 +#define l3rt 22 +#define l3rtf 23 +#define l3rtm 0x00000300 +#define l3dro 23 +#define l3drom 0x00000100 +#define l3cya 24 +#define l3cyam 0x00000080 +#define l3donly 25 +#define l3donlym 0x00000040 +#define l3dmem 29 +#define l3dmemm 0x00000004 +#define l3dmsiz 31 +#define l3dmsizm 0x00000001 + +#define thrmtin 0 +#define thrmtinm 0x80000000 +#define thrmtiv 1 +#define thrmtivm 0x40000000 +#define thrmthrs 2 +#define thrmthre 8 +#define thrmthrm 0x3F800000 +#define thrmtid 29 +#define thrmtidm 0x00000004 +#define thrmtie 30 +#define thrmtiem 0x00000002 +#define thrmv 31 +#define thrmvm 0x00000001 + +#define thrmsitvs 15 +#define thrmsitve 30 +#define thrmsitvm 0x0001FFFE +#define thrme 31 +#define thrmem 0x00000001 + +#define ictcfib 23 +#define ictcfie 30 +#define ictcfim 0x000001FE +#define ictce 31 +#define ictcem 0x00000001 + +#define slbESID 36 +#define slbKey 52 +#define slbIndex 52 +#define slbV 36 +#define slbVm 0x08000000 +#define slbCnt 64 + +/* + * Macros to access high and low word values of an address + */ + +#define HIGH_CADDR(x) ha16(x) +#define HIGH_ADDR(x) hi16(x) +#define LOW_ADDR(x) lo16(x) + +#endif /* ASSEMBLER */ + +#define cr0_lt 0 +#define cr0_gt 1 +#define cr0_eq 2 +#define cr0_so 3 +#define cr0_un 3 +#define cr1_lt 4 +#define cr1_gt 5 +#define cr1_eq 6 +#define cr1_so 7 +#define cr1_un 7 +#define cr2_lt 8 +#define cr2_gt 9 +#define cr2_eq 10 +#define cr2_so 11 +#define cr2_un 11 +#define cr3_lt 12 +#define cr3_gt 13 +#define cr3_eq 14 +#define cr3_so 15 +#define cr3_un 15 +#define cr4_lt 16 +#define cr4_gt 17 +#define cr4_eq 18 +#define cr4_so 19 +#define cr4_un 19 +#define cr5_lt 20 +#define cr5_gt 21 +#define cr5_eq 22 +#define cr5_so 23 +#define cr5_un 23 +#define cr6_lt 24 +#define cr6_gt 25 +#define cr6_eq 26 +#define cr6_so 27 +#define cr6_un 27 +#define cr7_lt 28 +#define cr7_gt 29 +#define cr7_eq 30 +#define cr7_so 31 +#define cr7_un 31 + +/* GUS Mode Register */ +#define GUSModeReg 0x0430 +#define GUSMdmapen 0x00008000 +#define GUSMstgtdis 0x00000080 +#define GUSMstgttim 0x00000038 +#define GUSMstgttoff 0x00000004 + +/* PowerTune */ +#define PowerTuneControlReg 0x0AA001 +#define PowerTuneStatusReg 0x408001 + +/* Code inject */ +// The following bits are always on in the MSR when injected code is executing +#define ijemon 0x00000010 +// The following bits are always off in the MSR when injected code it executing +#define ijemoff 0x0000C620 +#define ijemtrap ijemon|1 +// The following is the inject exit trap +#define ijtrap 0x0FFFC9C9 + +/* Misc */ +#define srr1clr 0x783F0000 + +/* Tags are placed before Immediately Following Code (IFC) for the debugger + * to be able to deduce where to find various registers when backtracing + * + * We only define the values as we use them, see SVR4 ABI PowerPc Supplement + * for more details (defined in ELF spec). + */ + +#define TAG_NO_FRAME_USED 0x00000000 + +/* (should use genassym to get these offsets) */ + +#define FM_BACKPTR 0 +#define FM_CR_SAVE 4 +#define FM_LR_SAVE 8 /* MacOSX is NOT following the ABI at the moment.. */ +#define FM_SIZE 64 /* minimum frame contents, backptr and LR save. Make sure it is quadaligned */ +#define FM_ARG0 56 +#define FM_ALIGN(l) ((l+15)&-16) +#define PK_SYSCALL_BEGIN 0x7000 + + +/* redzone is the area under the stack pointer which must be preserved + * when taking a trap, interrupt etc. + */ +#define FM_REDZONE 224 /* is ((32-14+1)*4) */ + +#define COPYIN_ARG0_OFFSET FM_ARG0 + +#ifdef MACH_KERNEL +#include <mach_kdb.h> +#else /* MACH_KERNEL */ +#define MACH_KDB 0 +#endif /* MACH_KERNEL */ + +#define BREAKPOINT_TRAP tw 4,r4,r4 + +/* There is another definition of ALIGN for .c sources */ +#ifndef __LANGUAGE_ASSEMBLY +#define ALIGN 4 +#endif /* __LANGUAGE_ASSEMBLY */ + +#ifndef FALIGN +#define FALIGN 4 /* Align functions on words for now. Cachelines is better */ +#endif + +#define LB(x,n) n +#if __STDC__ +#define LCL(x) L ## x +#define EXT(x) _ ## x +#define LEXT(x) _ ## x ## : +#define LBc(x,n) n ## : +#define LBb(x,n) n ## b +#define LBf(x,n) n ## f +#else /* __STDC__ */ +#define LCL(x) L/**/x +#define EXT(x) _/**/x +#define LEXT(x) _/**/x/**/: +#define LBc(x,n) n/**/: +#define LBb(x,n) n/**/b +#define LBf(x,n) n/**/f +#endif /* __STDC__ */ + +#define String .asciz +#define Value .word +#define Times(a,b) (a*b) +#define Divide(a,b) (a/b) + +#define data16 .byte 0x66 +#define addr16 .byte 0x67 + +#define MCOUNT + +#define ELF_FUNC(x) +#define ELF_DATA(x) +#define ELF_SIZE(x,s) + +#define Entry(x,tag) .text@.align FALIGN@ .globl EXT(x)@ LEXT(x) +#define ENTRY(x,tag) Entry(x,tag)@MCOUNT +#define ENTRY2(x,y,tag) .text@ .align FALIGN@ .globl EXT(x)@ .globl EXT(y)@ \ + LEXT(x)@ LEXT(y) @\ + MCOUNT +#if __STDC__ +#define ASENTRY(x) .globl x @ .align FALIGN; x ## @ MCOUNT +#else +#define ASENTRY(x) .globl x @ .align FALIGN; x @ MCOUNT +#endif /* __STDC__ */ +#define DATA(x) .globl EXT(x) @ .align ALIGN @ LEXT(x) + + +#define End(x) ELF_SIZE(x,.-x) +#define END(x) End(EXT(x)) +#define ENDDATA(x) END(x) +#define Enddata(x) End(x) + +/* These defines are here for .c files that wish to reference global symbols + * within __asm__ statements. + */ +#define CC_SYM_PREFIX "_" + +#endif /* _PPC_ASM_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/boolean.h.svn-base b/i386/include/mach/ppc/.svn/text-base/boolean.h.svn-base new file mode 100644 index 0000000..aa3769c --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/boolean.h.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: boolean.h + * + * Boolean type, for ppc. + */ + +#ifndef _MACH_PPC_BOOLEAN_H_ +#define _MACH_PPC_BOOLEAN_H_ + +#if defined(__ppc64__) +typedef unsigned int boolean_t; +#else +typedef int boolean_t; +#endif + +#endif /* _MACH_PPC_BOOLEAN_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/exception.h.svn-base b/i386/include/mach/ppc/.svn/text-base/exception.h.svn-base new file mode 100644 index 0000000..da4e7cb --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/exception.h.svn-base @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Copyright (c) 1990, 1991, 1992, The University of Utah and + * the Center for Software Science at the University of Utah (CSS). + * All rights reserved. + * + * Permission to use, copy, modify and distribute this software is hereby + * granted provided that (1) source code retains these copyright, permission, + * and disclaimer notices, and (2) redistributions including binaries + * reproduce the notices in supporting documentation, and (3) all advertising + * materials mentioning features or use of this software display the following + * acknowledgement: ``This product includes software developed by the Center + * for Software Science at the University of Utah.'' + * + * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS + * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF + * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * CSS requests users of this software to return to css-dist@cs.utah.edu any + * improvements that they make and grant CSS redistribution rights. + * + * Utah $Hdr: $ + */ + +#ifndef _MACH_PPC_EXCEPTION_H_ +#define _MACH_PPC_EXCEPTION_H_ + +#define EXC_TYPES_COUNT 11 /* incl. illegal exception 0 */ + +#define EXCEPTION_CODE_MAX 2 /* elements in vector (code+subcode) */ +/* + * EXC_BAD_INSTRUCTION + */ + +#define EXC_PPC_INVALID_SYSCALL 1 /* invalid syscall number */ +#define EXC_PPC_UNIPL_INST 2 /* unimplemented instruction */ +#define EXC_PPC_PRIVINST 3 /* priviledged instruction */ +#define EXC_PPC_PRIVREG 4 /* priviledged register */ +#define EXC_PPC_TRACE 5 /* trace/single-step */ +#define EXC_PPC_PERFMON 6 /* performance monitor */ + +/* + * EXC_BAD_ACCESS + * Note: do not conflict with kern_return_t values returned by vm_fault + */ + +#define EXC_PPC_VM_PROT_READ 0x101 /* error reading syscall args */ +#define EXC_PPC_BADSPACE 0x102 /* bad space referenced */ +#define EXC_PPC_UNALIGNED 0x103 /* unaligned data reference */ + +/* + * EXC_ARITHMETIC + */ + +#define EXC_PPC_OVERFLOW 1 /* integer overflow */ +#define EXC_PPC_ZERO_DIVIDE 2 /* integer divide by zero */ +#define EXC_PPC_FLT_INEXACT 3 /* IEEE inexact exception */ +#define EXC_PPC_FLT_ZERO_DIVIDE 4 /* IEEE zero divide */ +#define EXC_PPC_FLT_UNDERFLOW 5 /* IEEE floating underflow */ +#define EXC_PPC_FLT_OVERFLOW 6 /* IEEE floating overflow */ +#define EXC_PPC_FLT_NOT_A_NUMBER 7 /* IEEE not a number */ + +/* + * EXC_PPC_NOEMULATION should go away when we add software emulation + * for floating point. Right now we don't support this. + */ + +#define EXC_PPC_NOEMULATION 8 /* no floating point emulation */ +#define EXC_PPC_ALTIVECASSIST 9 /* Altivec Denorm Assist */ + +/* + * EXC_SOFTWARE + * Note: 0x10000-0x10003 in use for unix signal + */ +#define EXC_PPC_TRAP 1 /* Program trap */ +#define EXC_PPC_MIGRATE 0x10100 /* Time to bolt */ + + +/* + * EXC_BREAKPOINT + */ + +#define EXC_PPC_BREAKPOINT EXC_PPC_TRAP /* breakpoint trap */ + +/* + * machine dependent exception masks + */ +#define EXC_MASK_MACHINE 0 + +#endif /* _MACH_PPC_EXCEPTION_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/kern_return.h.svn-base b/i386/include/mach/ppc/.svn/text-base/kern_return.h.svn-base new file mode 100644 index 0000000..2c79023 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/kern_return.h.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: kern_return.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine-dependent kernel return definitions. + */ + +#ifndef _MACH_PPC_KERN_RETURN_H_ +#define _MACH_PPC_KERN_RETURN_H_ + +#ifndef ASSEMBLER +typedef int kern_return_t; +#endif /* ASSEMBLER */ + +#endif /* _MACH_PPC_KERN_RETURN_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/machine_types.defs.svn-base b/i386/include/mach/ppc/.svn/text-base/machine_types.defs.svn-base new file mode 100644 index 0000000..f0d5c41 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/machine_types.defs.svn-base @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Header file for basic, machine-dependent data types. + */ + +#ifndef _PPC_VM_TYPES_DEFS_ +#define _PPC_VM_TYPES_DEFS_ + +type short = int16_t; +type int = int32_t; +type unsigned = uint32_t; + +type float = MACH_MSG_TYPE_REAL_32; +type double = MACH_MSG_TYPE_REAL_64; + +/* from ISO/IEC 988:1999 spec */ +/* 7.18.1.4 Integer types capable of holding object pointers */ +/* + * The [u]intptr_t types for the native + * integer type, e.g. 32 or 64 or.. whatever + * register size the machine has. They are + * used for entities that might be either + * [unsigned] integers or pointers, and for + * type-casting between the two. + * + * For instance, the IPC system represents + * a port in user space as an integer and + * in kernel space as a pointer. + */ +#if defined(__ppc64__) +type uintptr_t = uint64_t; +type intptr_t = int64_t; +#else +type uintptr_t = uint32_t; +type intptr_t = int32_t; +#endif + +/* + * These are the legacy Mach types that are + * the [rough] equivalents of the standards above. + * They were defined in terms of int, not + * long int, so they remain separate. + */ +#if defined(__ppc64__) +type register_t = int64_t; +#else +type register_t = int32_t; +#endif +type integer_t = int32_t; +type natural_t = uint32_t; + +/* + * These are the VM types that scale with the address + * space size of a given process. + */ + +#if defined(__ppc64__) +type vm_address_t = uint64_t; +type vm_offset_t = uint64_t; +type vm_size_t = uint64_t; +#else +type vm_address_t = natural_t; +type vm_offset_t = natural_t; +type vm_size_t = natural_t; +#endif + +/* + * The mach_vm_xxx_t types are sized to hold the + * maximum pointer, offset, etc... supported on the + * platform. + */ +type mach_vm_address_t = uint64_t; +type mach_vm_offset_t = uint64_t; +type mach_vm_size_t = uint64_t; + +#if MACH_IPC_COMPAT +/* + * For the old IPC interface + */ +#define MSG_TYPE_PORT_NAME uint32_t + +#endif /* MACH_IPC_COMPAT */ + +/* + * These are types used internal to Mach to implement the + * legacy 32-bit VM APIs published by the kernel. + */ +#define VM32_SUPPORT 1 + +type vm32_address_t = uint32_t; +type vm32_offset_t = uint32_t; +type vm32_size_t = uint32_t; + +#endif /* _PPC_VM_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/ppc/.svn/text-base/ndr_def.h.svn-base b/i386/include/mach/ppc/.svn/text-base/ndr_def.h.svn-base new file mode 100644 index 0000000..cb012b2 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/ndr_def.h.svn-base @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#include <mach/ndr.h> + +NDR_record_t NDR_record = { + 0, /* mig_reserved */ + 0, /* mig_reserved */ + 0, /* mig_reserved */ + NDR_PROTOCOL_2_0, + NDR_INT_BIG_ENDIAN, + NDR_CHAR_ASCII, + NDR_FLOAT_IEEE, + 0, +}; diff --git a/i386/include/mach/ppc/.svn/text-base/processor_info.h.svn-base b/i386/include/mach/ppc/.svn/text-base/processor_info.h.svn-base new file mode 100644 index 0000000..fa07690 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/processor_info.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * File: mach/ppc/processor_info.h + * + * Data structure definitions for ppc specific processor control + */ + +#ifndef _MACH_PPC_PROCESSOR_INFO_H_ +#define _MACH_PPC_PROCESSOR_INFO_H_ + +#include <mach/machine.h> +#include <mach/message.h> + + +#endif /* _MACH_PPC_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/rpc.h.svn-base b/i386/include/mach/ppc/.svn/text-base/rpc.h.svn-base new file mode 100644 index 0000000..b3a274a --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/rpc.h.svn-base @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_RPC_H_ +#define _MACH_PPC_RPC_H_ + +#endif /* _MACH_PPC_RPC_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/sdt_isa.h.svn-base b/i386/include/mach/ppc/.svn/text-base/sdt_isa.h.svn-base new file mode 100644 index 0000000..c94bb75 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/sdt_isa.h.svn-base @@ -0,0 +1,413 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_PPC_SDT_ISA_H +#define _MACH_PPC_SDT_ISA_H + +/* #pragma ident "@(#)sdt.h 1.7 05/06/08 SMI" */ + +/* + * Only define when testing. This makes the calls into actual calls to + * test functions. + */ +/* #define DTRACE_CALL_TEST */ + +#define DTRACE_STRINGIFY(s) #s +#define DTRACE_TOSTRING(s) DTRACE_STRINGIFY(s) + +#define DTRACE_LABEL(p, n) \ + "__dtrace_probe$" DTRACE_TOSTRING(__LINE__) DTRACE_STRINGIFY(_##p##___##n) ":" "\n\t" + +#ifdef DTRACE_CALL_TEST + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_CALL_INSN(p,n) + +#else /* !DTRACE_CALL_TEST */ + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_NOPS + +#endif /* !DTRACE_CALL_TEST */ + +#ifdef __ppc__ + +#define DTRACE_NOPS \ + "nop" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "bl _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 3 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 5 +#define ARGS6_EXTENT 6 +#define ARGS7_EXTENT 7 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 9 +#define ARGS10_EXTENT 10 + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ( \ + DTRACE_CALL(provider, name) \ + "# eat trailing nl+tab from DTRACE_CALL" \ + : \ + : \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("subi r1,r1,0x20" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x20" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x20" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x20" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ + ); + +#define DTRACE_CALL8ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + "lwz r10,0x1c(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10" \ + ); + +#define DTRACE_CALL9ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + "lwz r10,0x1c(%0)" "\n\t" \ + "lwz r11,0x20(%0)" "\n\t" \ + "stw r11,0x38(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11" \ + ); + +#define DTRACE_CALL10ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + "lwz r10,0x1c(%0)" "\n\t" \ + "lwz r11,0x20(%0)" "\n\t" \ + "lwz r12,0x24(%0)" "\n\t" \ + "stw r11,0x38(r1)" "\n\t" \ + "stw r12,0x3c(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" \ + ); + +#endif // __ppc__ + +#ifdef __ppc64__ + +#define DTRACE_NOPS \ + "nop" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "bl _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 3 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 5 +#define ARGS6_EXTENT 6 +#define ARGS7_EXTENT 7 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 9 +#define ARGS10_EXTENT 10 + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : \ + : \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("ld r3,0x0(%0)" "\n\t" \ + "subi r1,r1,0x38" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x38" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x48" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x48" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x50" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x50" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x58" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x58" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x60" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x60" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x68" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x68" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ + ); + +#define DTRACE_CALL8ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x70" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + "ld r10,0x38(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x70" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10" \ + ); + +#define DTRACE_CALL9ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x78" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + "ld r10,0x38(%0)" "\n\t" \ + "ld r11,0x40(%0)" "\n\t" \ + "std r11,0x70(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x78" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11" \ + ); + +#define DTRACE_CALL10ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x80" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + "ld r10,0x38(%0)" "\n\t" \ + "ld r11,0x40(%0)" "\n\t" \ + "ld r12,0x48(%0)" "\n\t" \ + "std r11,0x70(r1)" "\n\t" \ + "std r12,0x78(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x80" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" \ + ); + +#endif // __ppc64__ + +#endif /* _MACH_PPC_SDT_ISA_H */ diff --git a/i386/include/mach/ppc/.svn/text-base/task.h.svn-base b/i386/include/mach/ppc/.svn/text-base/task.h.svn-base new file mode 100644 index 0000000..15c8248 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/task.h.svn-base @@ -0,0 +1,1578 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 35 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +/* Routine task_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine task_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; + __Request__task_get_state_t Request_task_get_state; + __Request__task_set_state_t Request_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; + __Reply__task_get_state_t Reply_task_get_state; + __Reply__task_set_state_t Reply_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 },\ + { "task_get_state", 3433 },\ + { "task_set_state", 3434 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/thread_act.h.svn-base b/i386/include/mach/ppc/.svn/text-base/thread_act.h.svn-base new file mode 100644 index 0000000..fde4189 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/thread_act.h.svn-base @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/thread_state.h.svn-base b/i386/include/mach/ppc/.svn/text-base/thread_state.h.svn-base new file mode 100644 index 0000000..3ab7baa --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/thread_state.h.svn-base @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_THREAD_STATE_H_ +#define _MACH_PPC_THREAD_STATE_H_ + +/* Size of maximum exported thread state in words */ +#define PPC_THREAD_STATE_MAX (144) /* Size of biggest state possible */ + +#if defined (__ppc__) || defined (__ppc64__) +#define THREAD_STATE_MAX PPC_THREAD_STATE_MAX +#endif + +#endif /* _MACH_PPC_THREAD_STATE_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/thread_status.h.svn-base b/i386/include/mach/ppc/.svn/text-base/thread_status.h.svn-base new file mode 100644 index 0000000..ba077f7 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/thread_status.h.svn-base @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_THREAD_STATUS_H_ +#define _MACH_PPC_THREAD_STATUS_H_ + +#include <mach/ppc/_structs.h> +#include <mach/message.h> + +/* + * ppc_thread_state is the structure that is exported to user threads for + * use in status/mutate calls. This structure should never change. + * + */ + +#define PPC_THREAD_STATE 1 +#define PPC_FLOAT_STATE 2 +#define PPC_EXCEPTION_STATE 3 +#define PPC_VECTOR_STATE 4 +#define PPC_THREAD_STATE64 5 +#define PPC_EXCEPTION_STATE64 6 +#define THREAD_STATE_NONE 7 + +/* + * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed + * an exception flavor will return whether that is a defined flavor for + * that platform. + * The macro must be manually updated to include all of the valid exception + * flavors as defined above. + */ +#define VALID_THREAD_STATE_FLAVOR(x) \ + ((x == PPC_THREAD_STATE) || \ + (x == PPC_FLOAT_STATE) || \ + (x == PPC_EXCEPTION_STATE) || \ + (x == PPC_VECTOR_STATE) || \ + (x == PPC_THREAD_STATE64) || \ + (x == PPC_EXCEPTION_STATE64) || \ + (x == THREAD_STATE_NONE)) + +typedef _STRUCT_PPC_THREAD_STATE ppc_thread_state_t; +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef _STRUCT_PPC_THREAD_STATE64 ppc_thread_state64_t; +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +typedef _STRUCT_PPC_FLOAT_STATE ppc_float_state_t; +typedef _STRUCT_PPC_VECTOR_STATE ppc_vector_state_t; + +/* + * saved state structure + * + * This structure corresponds to the saved state. + * + */ + +#ifdef MACH__POSIX_C_SOURCE_PRIVATE + +#include <ppc/savearea.h> + +typedef struct savearea ppc_saved_state_t; + +#else /* MACH__POSIX_C_SOURCE_PRIVATE */ + +typedef struct ppc_thread_state ppc_saved_state_t; + +#endif /* MACH__POSIX_C_SOURCE_PRIVATE */ + +/* + * ppc_exception_state + * + * This structure corresponds to some additional state of the user + * registers as saved in the PCB upon kernel entry. They are only + * available if an exception is passed out of the kernel, and even + * then not all are guaranteed to be updated. + * + * Some padding is included in this structure which allows space for + * servers to store temporary values if need be, to maintain binary + * compatiblity. + */ + +/* Exception state for 32-bit thread (on 32-bit processor) */ +/* Still available on 64-bit processors, but may fall short */ +/* of covering the full potential state (hi half available). */ + +typedef _STRUCT_PPC_EXCEPTION_STATE ppc_exception_state_t; +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef _STRUCT_PPC_EXCEPTION_STATE64 ppc_exception_state64_t; +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Save State Flags + */ + +#define PPC_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_thread_state_t) / sizeof(int))) + +#define PPC_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_thread_state64_t) / sizeof(int))) + +#define PPC_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_exception_state_t) / sizeof(int))) + +#define PPC_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_exception_state64_t) / sizeof(int))) + +#define PPC_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_float_state_t) / sizeof(int))) + +#define PPC_VECTOR_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_vector_state_t) / sizeof(int))) + +/* + * Machine-independent way for servers and Mach's exception mechanism to + * choose the most efficient state flavor for exception RPC's: + */ +#define MACHINE_THREAD_STATE PPC_THREAD_STATE +#define MACHINE_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT + +/* + * Largest state on this machine: + */ +#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX + +#endif /* _MACH_PPC_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/vm_param.h.svn-base b/i386/include/mach/ppc/.svn/text-base/vm_param.h.svn-base new file mode 100644 index 0000000..92a4a76 --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/vm_param.h.svn-base @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_VM_PARAM_H_ +#define _MACH_PPC_VM_PARAM_H_ + +/* + * These are the global definitions + */ + +#define BYTE_SIZE 8 /* byte size in bits */ + +#define PPC_PGBYTES 4096 /* bytes per ppc page */ +#define PPC_PGSHIFT 12 /* number of bits to shift for pages */ + +#define PAGE_SIZE PPC_PGBYTES +#define PAGE_SHIFT PPC_PGSHIFT +#define PAGE_MASK (PAGE_SIZE - 1) + +#if 0 +#define VM_MAX_PAGE_ADDRESS 0xFFFFFFFFFFFFF000ULL +#else +/* + * LP64todo - For now, we are limited to 51-bits of user addressing + */ +#define VM_MAX_PAGE_ADDRESS 0x0007FFFFFFFFF000ULL +#endif + +#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) +#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) + +/* + * These are the values relative to the local process. + */ +#if defined (__ppc64__) +/* + * LP64todo - We don't have the 64-bit address space layout yet. + * Use the 32-bit stack layout for now. + */ +#define VM_MIN_ADDRESS ((vm_offset_t) MACH_VM_MIN_ADDRESS) +#define VM_MAX_ADDRESS ((vm_offset_t) MACH_VM_MAX_ADDRESS) +#define USER_STACK_END ((vm_offset_t) 0x00000000ffff0000ULL) +#else +#define VM_MIN_ADDRESS ((vm_offset_t) 0) +#define VM_MAX_ADDRESS ((vm_offset_t) (VM_MAX_PAGE_ADDRESS & 0xFFFFFFFF)) +#define USER_STACK_END ((vm_offset_t) 0xffff0000U) +#endif /* defined(__ppc64__) */ + + +#endif /* _MACH_PPC_VM_PARAM_H_ */ diff --git a/i386/include/mach/ppc/.svn/text-base/vm_types.h.svn-base b/i386/include/mach/ppc/.svn/text-base/vm_types.h.svn-base new file mode 100644 index 0000000..3d04ddd --- /dev/null +++ b/i386/include/mach/ppc/.svn/text-base/vm_types.h.svn-base @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: vm_types.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Header file for VM data types. PPC version. + */ + +#ifndef _MACH_PPC_VM_TYPES_H_ +#define _MACH_PPC_VM_TYPES_H_ + +#ifndef ASSEMBLER + +#include <ppc/_types.h> +#include <mach/ppc/vm_param.h> +#include <stdint.h> + +/* + * natural_t and integer_t are Mach's legacy types for machine- + * independent integer types (unsigned, and signed, respectively). + * Their original purpose was to define other types in a machine/ + * compiler independent way. + * + * They also had an implicit "same size as pointer" characteristic + * to them (i.e. Mach's traditional types are very ILP32 or ILP64 + * centric). We support PowerPC ABIs that do not follow either of + * these models (specifically LP64). Therefore, we had to make a + * choice between making these types scale with pointers or stay + * tied to integers. Because their use is predominantly tied to + * to the size of an integer, we are keeping that association and + * breaking free from pointer size guarantees. + * + * New use of these types is discouraged. + */ +typedef __darwin_natural_t natural_t; +typedef int integer_t; + +#if defined(__ppc__) + +/* + * For 32-bit PowerPC ABIs, the scalable types were + * always based upon natural_t (unsigned int). + * Because of potential legacy issues with name mangling, + * we cannot use the stdint uintptr_t type. + */ +typedef natural_t vm_offset_t; +typedef natural_t vm_size_t; + +#else /* __ppc64__ */ + +/* + * For 64-bit PowerPC ABIs, we have no legacy name mangling + * issues, so we use the stdint types for scaling these + * types to the same size as a pointer. + */ +typedef uintptr_t vm_offset_t; +typedef uintptr_t vm_size_t; + +#endif + +/* + * This new type is independent of a particular vm map's + * implementation size - and represents appropriate types + * for all possible maps. This is used for interfaces + * where the size of the map is not known - or we don't + * want to have to distinguish. + */ +typedef uint64_t mach_vm_address_t; +typedef uint64_t mach_vm_offset_t; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t; +typedef uint64_t vm_map_address_t; +typedef uint64_t vm_map_size_t; + + +#endif /* ASSEMBLER */ + +/* + * If composing messages by hand (please do not) + */ +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif /* _MACH_PPC_VM_TYPES_H_ */ diff --git a/i386/include/mach/ppc/_structs.h b/i386/include/mach/ppc/_structs.h new file mode 100644 index 0000000..f2c78cd --- /dev/null +++ b/i386/include/mach/ppc/_structs.h @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC__STRUCTS_H_ +#define _MACH_PPC__STRUCTS_H_ + +#include <sys/cdefs.h> + +/* + * ppc_thread_state is the structure that is exported to user threads for + * use in status/mutate calls. This structure should never change. + * + */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_THREAD_STATE struct __darwin_ppc_thread_state +_STRUCT_PPC_THREAD_STATE +{ + unsigned int __srr0; /* Instruction address register (PC) */ + unsigned int __srr1; /* Machine state register (supervisor) */ + unsigned int __r0; + unsigned int __r1; + unsigned int __r2; + unsigned int __r3; + unsigned int __r4; + unsigned int __r5; + unsigned int __r6; + unsigned int __r7; + unsigned int __r8; + unsigned int __r9; + unsigned int __r10; + unsigned int __r11; + unsigned int __r12; + unsigned int __r13; + unsigned int __r14; + unsigned int __r15; + unsigned int __r16; + unsigned int __r17; + unsigned int __r18; + unsigned int __r19; + unsigned int __r20; + unsigned int __r21; + unsigned int __r22; + unsigned int __r23; + unsigned int __r24; + unsigned int __r25; + unsigned int __r26; + unsigned int __r27; + unsigned int __r28; + unsigned int __r29; + unsigned int __r30; + unsigned int __r31; + + unsigned int __cr; /* Condition register */ + unsigned int __xer; /* User's integer exception register */ + unsigned int __lr; /* Link register */ + unsigned int __ctr; /* Count register */ + unsigned int __mq; /* MQ register (601 only) */ + + unsigned int __vrsave; /* Vector Save Register */ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_THREAD_STATE struct ppc_thread_state +_STRUCT_PPC_THREAD_STATE +{ + unsigned int srr0; /* Instruction address register (PC) */ + unsigned int srr1; /* Machine state register (supervisor) */ + unsigned int r0; + unsigned int r1; + unsigned int r2; + unsigned int r3; + unsigned int r4; + unsigned int r5; + unsigned int r6; + unsigned int r7; + unsigned int r8; + unsigned int r9; + unsigned int r10; + unsigned int r11; + unsigned int r12; + unsigned int r13; + unsigned int r14; + unsigned int r15; + unsigned int r16; + unsigned int r17; + unsigned int r18; + unsigned int r19; + unsigned int r20; + unsigned int r21; + unsigned int r22; + unsigned int r23; + unsigned int r24; + unsigned int r25; + unsigned int r26; + unsigned int r27; + unsigned int r28; + unsigned int r29; + unsigned int r30; + unsigned int r31; + + unsigned int cr; /* Condition register */ + unsigned int xer; /* User's integer exception register */ + unsigned int lr; /* Link register */ + unsigned int ctr; /* Count register */ + unsigned int mq; /* MQ register (601 only) */ + + unsigned int vrsave; /* Vector Save Register */ +}; +#endif /* __DARWIN_UNIX03 */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#pragma pack(4) /* Make sure the structure stays as we defined it */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_THREAD_STATE64 struct __darwin_ppc_thread_state64 +_STRUCT_PPC_THREAD_STATE64 +{ + unsigned long long __srr0; /* Instruction address register (PC) */ + unsigned long long __srr1; /* Machine state register (supervisor) */ + unsigned long long __r0; + unsigned long long __r1; + unsigned long long __r2; + unsigned long long __r3; + unsigned long long __r4; + unsigned long long __r5; + unsigned long long __r6; + unsigned long long __r7; + unsigned long long __r8; + unsigned long long __r9; + unsigned long long __r10; + unsigned long long __r11; + unsigned long long __r12; + unsigned long long __r13; + unsigned long long __r14; + unsigned long long __r15; + unsigned long long __r16; + unsigned long long __r17; + unsigned long long __r18; + unsigned long long __r19; + unsigned long long __r20; + unsigned long long __r21; + unsigned long long __r22; + unsigned long long __r23; + unsigned long long __r24; + unsigned long long __r25; + unsigned long long __r26; + unsigned long long __r27; + unsigned long long __r28; + unsigned long long __r29; + unsigned long long __r30; + unsigned long long __r31; + + unsigned int __cr; /* Condition register */ + unsigned long long __xer; /* User's integer exception register */ + unsigned long long __lr; /* Link register */ + unsigned long long __ctr; /* Count register */ + + unsigned int __vrsave; /* Vector Save Register */ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_THREAD_STATE64 struct ppc_thread_state64 +_STRUCT_PPC_THREAD_STATE64 +{ + unsigned long long srr0; /* Instruction address register (PC) */ + unsigned long long srr1; /* Machine state register (supervisor) */ + unsigned long long r0; + unsigned long long r1; + unsigned long long r2; + unsigned long long r3; + unsigned long long r4; + unsigned long long r5; + unsigned long long r6; + unsigned long long r7; + unsigned long long r8; + unsigned long long r9; + unsigned long long r10; + unsigned long long r11; + unsigned long long r12; + unsigned long long r13; + unsigned long long r14; + unsigned long long r15; + unsigned long long r16; + unsigned long long r17; + unsigned long long r18; + unsigned long long r19; + unsigned long long r20; + unsigned long long r21; + unsigned long long r22; + unsigned long long r23; + unsigned long long r24; + unsigned long long r25; + unsigned long long r26; + unsigned long long r27; + unsigned long long r28; + unsigned long long r29; + unsigned long long r30; + unsigned long long r31; + + unsigned int cr; /* Condition register */ + unsigned long long xer; /* User's integer exception register */ + unsigned long long lr; /* Link register */ + unsigned long long ctr; /* Count register */ + + unsigned int vrsave; /* Vector Save Register */ +}; +#endif /* __DARWIN_UNIX03 */ + +#pragma pack() + +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* This structure should be double-word aligned for performance */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_FLOAT_STATE struct __darwin_ppc_float_state +_STRUCT_PPC_FLOAT_STATE +{ + double __fpregs[32]; + + unsigned int __fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */ + unsigned int __fpscr; /* floating point status register */ +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_FLOAT_STATE struct ppc_float_state +_STRUCT_PPC_FLOAT_STATE +{ + double fpregs[32]; + + unsigned int fpscr_pad; /* fpscr is 64 bits, 32 bits of rubbish */ + unsigned int fpscr; /* floating point status register */ +}; +#endif /* __DARWIN_UNIX03 */ + +#pragma pack(4) /* Make sure the structure stays as we defined it */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_VECTOR_STATE struct __darwin_ppc_vector_state +_STRUCT_PPC_VECTOR_STATE +{ +#if defined(__LP64__) + unsigned int __save_vr[32][4]; + unsigned int __save_vscr[4]; +#else + unsigned long __save_vr[32][4]; + unsigned long __save_vscr[4]; +#endif + unsigned int __save_pad5[4]; + unsigned int __save_vrvalid; /* VRs that have been saved */ + unsigned int __save_pad6[7]; +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_VECTOR_STATE struct ppc_vector_state +_STRUCT_PPC_VECTOR_STATE +{ +#if defined(__LP64__) + unsigned int save_vr[32][4]; + unsigned int save_vscr[4]; +#else + unsigned long save_vr[32][4]; + unsigned long save_vscr[4]; +#endif + unsigned int save_pad5[4]; + unsigned int save_vrvalid; /* VRs that have been saved */ + unsigned int save_pad6[7]; +}; +#endif /* __DARWIN_UNIX03 */ + +#pragma pack() + +/* + * ppc_exception_state + * + * This structure corresponds to some additional state of the user + * registers as saved in the PCB upon kernel entry. They are only + * available if an exception is passed out of the kernel, and even + * then not all are guaranteed to be updated. + * + * Some padding is included in this structure which allows space for + * servers to store temporary values if need be, to maintain binary + * compatiblity. + */ + +/* Exception state for 32-bit thread (on 32-bit processor) */ +/* Still available on 64-bit processors, but may fall short */ +/* of covering the full potential state (hi half available). */ + +#pragma pack(4) /* Make sure the structure stays as we defined it */ + +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_EXCEPTION_STATE struct __darwin_ppc_exception_state +_STRUCT_PPC_EXCEPTION_STATE +{ +#if defined(__LP64__) + unsigned int __dar; /* Fault registers for coredump */ + unsigned int __dsisr; + unsigned int __exception; /* number of powerpc exception taken */ + unsigned int __pad0; /* align to 16 bytes */ + unsigned int __pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long __dar; /* Fault registers for coredump */ + unsigned long __dsisr; + unsigned long __exception; /* number of powerpc exception taken */ + unsigned long __pad0; /* align to 16 bytes */ + unsigned long __pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_EXCEPTION_STATE struct ppc_exception_state +_STRUCT_PPC_EXCEPTION_STATE +{ +#if defined(__LP64__) + unsigned int dar; /* Fault registers for coredump */ + unsigned int dsisr; + unsigned int exception; /* number of powerpc exception taken */ + unsigned int pad0; /* align to 16 bytes */ + unsigned int pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long dar; /* Fault registers for coredump */ + unsigned long dsisr; + unsigned long exception; /* number of powerpc exception taken */ + unsigned long pad0; /* align to 16 bytes */ + unsigned long pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#endif /* __DARWIN_UNIX03 */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#if __DARWIN_UNIX03 +#define _STRUCT_PPC_EXCEPTION_STATE64 struct __darwin_ppc_exception_state64 +_STRUCT_PPC_EXCEPTION_STATE64 +{ + unsigned long long __dar; /* Fault registers for coredump */ +#if defined(__LP64__) + unsigned int __dsisr; + unsigned int __exception; /* number of powerpc exception taken */ + unsigned int __pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long __dsisr; + unsigned long __exception; /* number of powerpc exception taken */ + unsigned long __pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_PPC_EXCEPTION_STATE64 struct ppc_exception_state64 +_STRUCT_PPC_EXCEPTION_STATE64 +{ + unsigned long long dar; /* Fault registers for coredump */ +#if defined(__LP64__) + unsigned int dsisr; + unsigned int exception; /* number of powerpc exception taken */ + unsigned int pad1[4]; /* space in PCB "just in case" */ +#else + unsigned long dsisr; + unsigned long exception; /* number of powerpc exception taken */ + unsigned long pad1[4]; /* space in PCB "just in case" */ +#endif +}; +#endif /* __DARWIN_UNIX03 */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#pragma pack() + +#endif /* _MACH_PPC__STRUCTS_H_ */ diff --git a/i386/include/mach/ppc/asm.h b/i386/include/mach/ppc/asm.h new file mode 100644 index 0000000..2535a84 --- /dev/null +++ b/i386/include/mach/ppc/asm.h @@ -0,0 +1,781 @@ +/* + * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +#ifndef _PPC_ASM_H_ +#define _PPC_ASM_H_ + +#define __ASMNL__ @ +#define STRINGD .ascii + +#ifdef ASSEMBLER + + +#define br0 0 + +#define ARG0 r3 +#define ARG1 r4 +#define ARG2 r5 +#define ARG3 r6 +#define ARG4 r7 +#define ARG5 r8 +#define ARG6 r9 +#define ARG7 r10 + +#define tmp0 r0 /* Temporary GPR remapping (603e specific) */ +#define tmp1 r1 +#define tmp2 r2 +#define tmp3 r3 + +/* SPR registers */ + +#define mq 0 /* MQ register for 601 emulation */ +#define rtcu 4 /* RTCU - upper word of RTC for 601 emulation */ +#define rtcl 5 /* RTCL - lower word of RTC for 601 emulation */ +#define dsisr 18 +#define ppcDAR 19 +#define ppcdar 19 +#define dar 19 +#define SDR1 25 +#define sdr1 25 +#define srr0 26 +#define srr1 27 +#define vrsave 256 /* Vector Register save */ +#define sprg0 272 +#define sprg1 273 +#define sprg2 274 +#define sprg3 275 +#define scomc 276 +#define scomd 277 +#define pvr 287 + +#define IBAT0U 528 +#define IBAT0L 529 +#define IBAT1U 530 +#define IBAT1L 531 +#define IBAT2U 532 +#define IBAT2L 533 +#define IBAT3U 534 +#define IBAT3L 535 +#define ibat0u 528 +#define ibat0l 529 +#define ibat1u 530 +#define ibat1l 531 +#define ibat2u 532 +#define ibat2l 533 +#define ibat3u 534 +#define ibat3l 535 + +#define DBAT0U 536 +#define DBAT0L 537 +#define DBAT1U 538 +#define DBAT1L 539 +#define DBAT2U 540 +#define DBAT2L 541 +#define DBAT3U 542 +#define DBAT3L 543 +#define dbat0u 536 +#define dbat0l 537 +#define dbat1u 538 +#define dbat1l 539 +#define dbat2u 540 +#define dbat2l 541 +#define dbat3u 542 +#define dbat3l 543 + +#define ummcr2 928 /* Performance monitor control */ +#define upmc5 929 /* Performance monitor counter */ +#define upmc6 930 /* Performance monitor counter */ +#define ubamr 935 /* Performance monitor mask */ +#define ummcr0 936 /* Performance monitor control */ +#define upmc1 937 /* Performance monitor counter */ +#define upmc2 938 /* Performance monitor counter */ +#define usia 939 /* User sampled instruction address */ +#define ummcr1 940 /* Performance monitor control */ +#define upmc3 941 /* Performance monitor counter */ +#define upmc4 942 /* Performance monitor counter */ +#define usda 943 /* User sampled data address */ +#define mmcr2 944 /* Performance monitor control */ +#define pmc5 945 /* Performance monitor counter */ +#define pmc6 946 /* Performance monitor counter */ +#define bamr 951 /* Performance monitor mask */ +#define mmcr0 952 +#define pmc1 953 +#define pmc2 954 +#define sia 955 +#define mmcr1 956 +#define pmc3 957 +#define pmc4 958 +#define sda 959 /* Sampled data address */ +#define dmiss 976 /* ea that missed */ +#define trig0 976 +#define dcmp 977 /* compare value for the va that missed */ +#define trig1 977 +#define hash1 978 /* pointer to first hash pteg */ +#define trig2 978 +#define hash2 979 /* pointer to second hash pteg */ +#define imiss 980 /* ea that missed */ +#define tlbmiss 980 /* ea that missed */ +#define icmp 981 /* compare value for the va that missed */ +#define ptehi 981 /* compare value for the va that missed */ +#define rpa 982 /* required physical address register */ +#define ptelo 982 /* required physical address register */ +#define l3pdet 984 /* l3pdet */ + +#define HID0 1008 /* Checkstop and misc enables */ +#define hid0 1008 /* Checkstop and misc enables */ +#define HID1 1009 /* Clock configuration */ +#define hid1 1009 /* Clock configuration */ +#define HID2 1016 /* Other processor controls */ +#define hid2 1016 /* Other processor controls */ +#define iabr 1010 /* Instruction address breakpoint register */ +#define ictrl 1011 /* Instruction Cache Control */ +#define ldstdb 1012 /* Load/Store Debug */ +#define hid4 1012 /* Misc stuff */ +#define dabr 1013 /* Data address breakpoint register */ +#define msscr0 1014 /* Memory subsystem control */ +#define hid5 1014 /* Misc stuff */ +#define msscr1 1015 /* Memory subsystem debug */ +#define msssr0 1015 /* Memory Subsystem Status */ +#define ldstcr 1016 /* Load/Store Status/Control */ +#define l2cr2 1016 /* L2 Cache control 2 */ +#define l2cr 1017 /* L2 Cache control */ +#define l3cr 1018 /* L3 Cache control */ +#define ictc 1019 /* I-cache throttling control */ +#define thrm1 1020 /* Thermal management 1 */ +#define thrm2 1021 /* Thermal management 2 */ +#define thrm3 1022 /* Thermal management 3 */ +#define pir 1023 /* Processor ID Register */ + + +/* SPR registers (64-bit, PPC970 specific) */ + +#define scomc_gp 276 +#define scomd_gp 277 + +#define hsprg0 304 +#define hsprg1 305 +#define hdec 310 +#define hior 311 +#define rmor 312 +#define hrmor 313 +#define hsrr0 314 +#define hsrr1 315 +#define lpcr 318 +#define lpidr 319 + +#define ummcra_gp 770 +#define upmc1_gp 771 +#define upmc2_gp 772 +#define upmc3_gp 773 +#define upmc4_gp 774 +#define upmc5_gp 775 +#define upmc6_gp 776 +#define upmc7_gp 777 +#define upmc8_gp 778 +#define ummcr0_gp 779 +#define usiar_gp 780 +#define usdar_gp 781 +#define ummcr1_gp 782 +#define uimc_gp 783 + +#define mmcra_gp 786 +#define pmc1_gp 787 +#define pmc2_gp 788 +#define pmc3_gp 789 +#define pmc4_gp 790 +#define pmc5_gp 791 +#define pmc6_gp 792 +#define pmc7_gp 793 +#define pmc8_gp 794 +#define mmcr0_gp 795 +#define siar_gp 796 +#define sdar_gp 797 +#define mmcr1_gp 798 +#define imc_gp 799 + +#define trig0_gp 976 +#define trig1_gp 977 +#define trig2_gp 978 + +#define dabrx 1015 + +; hid0 bits +#define emcp 0 +#define emcpm 0x80000000 +#define dbp 1 +#define dbpm 0x40000000 +#define eba 2 +#define ebam 0x20000000 +#define ebd 3 +#define ebdm 0x10000000 +#define sbclk 4 +#define sbclkm 0x08000000 +#define eclk 6 +#define eclkm 0x02000000 +#define par 7 +#define parm 0x01000000 +#define sten 7 +#define stenm 0x01000000 +#define dnap 7 +#define dnapm 0x01000000 +#define doze 8 +#define dozem 0x00800000 +#define nap 9 +#define napm 0x00400000 +#define sleep 10 +#define sleepm 0x00200000 +#define dpm 11 +#define dpmm 0x00100000 +#define riseg 12 +#define risegm 0x00080000 +#define eiec 13 +#define eiecm 0x00040000 +#define mum 14 +#define mumm 0x00020000 +#define nhr 15 +#define nhrm 0x00010000 +#define ice 16 +#define icem 0x00008000 +#define dce 17 +#define dcem 0x00004000 +#define ilock 18 +#define ilockm 0x00002000 +#define dlock 19 +#define dlockm 0x00001000 +#define exttben 19 +#define icfi 20 +#define icfim 0x00000800 +#define dcfi 21 +#define dcfim 0x00000400 +#define spd 22 +#define spdm 0x00000200 +#define hdice 23 +#define hdicem 0x00000100 +#define sge 24 +#define sgem 0x00000080 +#define dcfa 25 +#define dcfam 0x00000040 +#define btic 26 +#define bticm 0x00000020 +#define lrstk 27 +#define lrstkm 0x00000010 +#define abe 28 +#define abem 0x00000008 +#define fold 28 +#define foldm 0x00000008 +#define bht 29 +#define bhtm 0x00000004 +#define nopdst 30 +#define nopdstm 0x00000002 +#define nopti 31 +#define noptim 0x00000001 + +; hid1 bits +#define hid1pcem 0xF8000000 +#define hid1prem 0x06000000 +#define hid1dfs0 8 +#define hid1dfs0m 0x00800000 +#define hid1dfs1 9 +#define hid1dfs1m 0x00400000 +#define hid1pi0 14 +#define hid1pi0m 0x00020000 +#define hid1FCPErr 14 +#define hid1ps 15 +#define hid1FCD0PErr 15 +#define hid1psm 0x00010000 +#define hid1pc0 0x0000F800 +#define hid1pr0 0x00000600 +#define hid1pc1 0x000000F8 +#define hid1pc0 0x0000F800 +#define hid1pr1 0x00000006 +#define hid1FCD1PErr 16 +#define hid1FIERATErr 17 + +; hid2 bits +#define hid2vmin 18 +#define hid2vminm 0x00002000 + +; msscr0 bits +#define shden 0 +#define shdenm 0x80000000 +#define shden3 1 +#define shdenm3 0x40000000 +#define l1intvs 2 +#define l1intve 4 +#define l1intvb 0x38000000 +#define l2intvs 5 +#define l2intve 7 +#define l2intvb 0x07000000 +#define dl1hwf 8 +#define dl1hwfm 0x00800000 +#define dbsiz 9 +#define dbsizm 0x00400000 +#define emode 10 +#define emodem 0x00200000 +#define abgd 11 +#define abgdm 0x00100000 +#define tfsts 24 +#define tfste 25 +#define tfstm 0x000000C0 +#define l2pfes 30 +#define l2pfee 31 +#define l2pfem 0x00000003 + +; msscr1 bits +#define cqd 15 +#define cqdm 0x00010000 +#define csqs 1 +#define csqe 2 +#define csqm 0x60000000 + +; msssr1 bits - 7450 +#define vgL2PARA 0 +#define vgL3PARA 1 +#define vgL2COQEL 2 +#define vgL3COQEL 3 +#define vgL2CTR 4 +#define vgL3CTR 5 +#define vgL2COQR 6 +#define vgL3COQR 7 +#define vgLMQ 8 +#define vgSMC 9 +#define vgSNP 10 +#define vgBIU 11 +#define vgSMCE 12 +#define vgL2TAG 13 +#define vgL2DAT 14 +#define vgL3TAG 15 +#define vgL3DAT 16 +#define vgAPE 17 +#define vgDPE 18 +#define vgTEA 19 + +; srr1 bits +#define icmck 1 +#define icmckm 0x40000000 +#define dcmck 2 +#define dcmckm 0x20000000 +#define l2mck 3 +#define l2mckm 0x10000000 +#define tlbmck 4 +#define tlbmckm 0x08000000 +#define brmck 5 +#define brmckm 0x04000000 +#define othmck 10 +#define othmckm 0x00200000 +#define l2dpmck 11 +#define l2dpmckm 0x00100000 +#define mcpmck 12 +#define mcpmckm 0x00080000 +#define teamck 13 +#define teamckm 0x00040000 +#define dpmck 14 +#define dpmckm 0x00020000 +#define apmck 15 +#define apmckm 0x00010000 + +#define mckIFUE 42 +#define mckLDST 43 +#define mckXCs 44 +#define mckXCe 45 +#define mckNoErr 0 +#define mckIFSLBPE 1 +#define mckIFTLBPE 2 +#define mckIFTLBUE 3 + +; dsisr bits +#define mckUEdfr 16 +#define mckUETwDfr 17 +#define mckL1DCPE 18 +#define mckL1DTPE 19 +#define mckDEPE 20 +#define mckTLBPE 21 +#define mckSLBPE 23 + +; Async MCK source +#define AsyMCKSrc 0x0226 +#define AsyMCKRSrc 0x0227 +#define AsyMCKext 0 +#define AsyMCKfir 1 +#define AsyMCKhri 2 +#define AsyMCKdbg 3 +#define AsyMCKncstp 4 + +; Core FIR +#define cFIR 0x0300 +#define cFIRrst 0x0310 +#define cFIRICachePE 0 +#define cFIRITagPE0 1 +#define cFIRITagPE1 2 +#define cFIRIEratPE 3 +#define cFIRIFUL2UE 4 +#define cFIRIFUCS 5 +#define cFIRDCachePE 6 +#define cFIRDTagPE 7 +#define cFIRDEratPE 8 +#define cFIRTLBPE 9 +#define cFIRSLBPE 10 +#define cFIRSL2UE 11 + +; Core Error Inject +#define CoreErrI 0x0350 +#define CoreIFU 0 +#define CoreLSU 1 +#define CoreRate0 2 +#define CoreRate1 3 +#define CoreOnce 0 +#define CoreSolid 2 +#define CorePulse 3 + +; L2 FIR +#define l2FIR 0x0400 +#define l2FIRrst 0x0410 + +; Bus FIR +#define busFIR 0x0A00 +#define busFIRrst 0x0A10 + +; HID4 +#define hid4RMCI 23 +#define hid4FAlgn 24 +#define hid4DisPF 25 +#define hid4ResPF 26 +#define hid4EnSPTW 27 +#define hid4L1DCFI 28 +#define hid4DisDERpg 31 +#define hid4DisDCTpg 36 +#define hid4DisDCpg 41 +#define hid4DisTLBpg 48 +#define hid4DisSLBpg 54 +#define hid4MckEIEna 55 + +; L2 cache control +#define l2e 0 +#define l2em 0x80000000 +#define l2pe 1 +#define l2pem 0x40000000 +#define l2siz 2 +#define l2sizf 3 +#define l2sizm 0x30000000 +#define l2clk 4 +#define l2clkf 6 +#define l2clkm 0x0E000000 +#define l2ram 7 +#define l2ramf 8 +#define l2ramm 0x01800000 +#define l2do 9 +#define l2dom 0x00400000 +#define l2i 10 +#define l2im 0x00200000 +#define l2ctl 11 +#define l2ctlm 0x00100000 +#define l2ionly 11 +#define l2ionlym 0x00100000 +#define l2wt 12 +#define l2wtm 0x00080000 +#define l2ts 13 +#define l2tsm 0x00040000 +#define l2oh 14 +#define l2ohf 15 +#define l2ohm 0x00030000 +#define l2donly 15 +#define l2donlym 0x00010000 +#define l2sl 16 +#define l2slm 0x00008000 +#define l2df 17 +#define l2dfm 0x00004000 +#define l2byp 18 +#define l2bypm 0x00002000 +#define l2fa 19 +#define l2fam 0x00001000 +#define l2hwf 20 +#define l2hwfm 0x00000800 +#define l2io 21 +#define l2iom 0x00000400 +#define l2clkstp 22 +#define l2clkstpm 0x00000200 +#define l2dro 23 +#define l2drom 0x00000100 +#define l2ctr 24 +#define l2ctrf 30 +#define l2ctrm 0x000000FE +#define l2ip 31 +#define l2ipm 0x00000001 + +; L3 cache control +#define l3e 0 +#define l3em 0x80000000 +#define l3pe 1 +#define l3pem 0x40000000 +#define l3siz 3 +#define l3sizm 0x10000000 +#define l3clken 4 +#define l3clkenm 0x08000000 +#define l3dx 5 +#define l3dxm 0x04000000 +#define l3clk 6 +#define l3clkf 8 +#define l3clkm 0x03800000 +#define l3io 9 +#define l3iom 0x00400000 +#define l3spo 13 +#define l3spom 0x00040000 +#define l3cksp 14 +#define l3ckspf 15 +#define l3ckspm 0x00030000 +#define l3psp 16 +#define l3pspf 18 +#define l3pspm 0x0000E000 +#define l3rep 19 +#define l3repm 0x00001000 +#define l3hwf 20 +#define l3hwfm 0x00000800 +#define l3i 21 +#define l3im 0x00000400 +#define l3rt 22 +#define l3rtf 23 +#define l3rtm 0x00000300 +#define l3dro 23 +#define l3drom 0x00000100 +#define l3cya 24 +#define l3cyam 0x00000080 +#define l3donly 25 +#define l3donlym 0x00000040 +#define l3dmem 29 +#define l3dmemm 0x00000004 +#define l3dmsiz 31 +#define l3dmsizm 0x00000001 + +#define thrmtin 0 +#define thrmtinm 0x80000000 +#define thrmtiv 1 +#define thrmtivm 0x40000000 +#define thrmthrs 2 +#define thrmthre 8 +#define thrmthrm 0x3F800000 +#define thrmtid 29 +#define thrmtidm 0x00000004 +#define thrmtie 30 +#define thrmtiem 0x00000002 +#define thrmv 31 +#define thrmvm 0x00000001 + +#define thrmsitvs 15 +#define thrmsitve 30 +#define thrmsitvm 0x0001FFFE +#define thrme 31 +#define thrmem 0x00000001 + +#define ictcfib 23 +#define ictcfie 30 +#define ictcfim 0x000001FE +#define ictce 31 +#define ictcem 0x00000001 + +#define slbESID 36 +#define slbKey 52 +#define slbIndex 52 +#define slbV 36 +#define slbVm 0x08000000 +#define slbCnt 64 + +/* + * Macros to access high and low word values of an address + */ + +#define HIGH_CADDR(x) ha16(x) +#define HIGH_ADDR(x) hi16(x) +#define LOW_ADDR(x) lo16(x) + +#endif /* ASSEMBLER */ + +#define cr0_lt 0 +#define cr0_gt 1 +#define cr0_eq 2 +#define cr0_so 3 +#define cr0_un 3 +#define cr1_lt 4 +#define cr1_gt 5 +#define cr1_eq 6 +#define cr1_so 7 +#define cr1_un 7 +#define cr2_lt 8 +#define cr2_gt 9 +#define cr2_eq 10 +#define cr2_so 11 +#define cr2_un 11 +#define cr3_lt 12 +#define cr3_gt 13 +#define cr3_eq 14 +#define cr3_so 15 +#define cr3_un 15 +#define cr4_lt 16 +#define cr4_gt 17 +#define cr4_eq 18 +#define cr4_so 19 +#define cr4_un 19 +#define cr5_lt 20 +#define cr5_gt 21 +#define cr5_eq 22 +#define cr5_so 23 +#define cr5_un 23 +#define cr6_lt 24 +#define cr6_gt 25 +#define cr6_eq 26 +#define cr6_so 27 +#define cr6_un 27 +#define cr7_lt 28 +#define cr7_gt 29 +#define cr7_eq 30 +#define cr7_so 31 +#define cr7_un 31 + +/* GUS Mode Register */ +#define GUSModeReg 0x0430 +#define GUSMdmapen 0x00008000 +#define GUSMstgtdis 0x00000080 +#define GUSMstgttim 0x00000038 +#define GUSMstgttoff 0x00000004 + +/* PowerTune */ +#define PowerTuneControlReg 0x0AA001 +#define PowerTuneStatusReg 0x408001 + +/* Code inject */ +// The following bits are always on in the MSR when injected code is executing +#define ijemon 0x00000010 +// The following bits are always off in the MSR when injected code it executing +#define ijemoff 0x0000C620 +#define ijemtrap ijemon|1 +// The following is the inject exit trap +#define ijtrap 0x0FFFC9C9 + +/* Misc */ +#define srr1clr 0x783F0000 + +/* Tags are placed before Immediately Following Code (IFC) for the debugger + * to be able to deduce where to find various registers when backtracing + * + * We only define the values as we use them, see SVR4 ABI PowerPc Supplement + * for more details (defined in ELF spec). + */ + +#define TAG_NO_FRAME_USED 0x00000000 + +/* (should use genassym to get these offsets) */ + +#define FM_BACKPTR 0 +#define FM_CR_SAVE 4 +#define FM_LR_SAVE 8 /* MacOSX is NOT following the ABI at the moment.. */ +#define FM_SIZE 64 /* minimum frame contents, backptr and LR save. Make sure it is quadaligned */ +#define FM_ARG0 56 +#define FM_ALIGN(l) ((l+15)&-16) +#define PK_SYSCALL_BEGIN 0x7000 + + +/* redzone is the area under the stack pointer which must be preserved + * when taking a trap, interrupt etc. + */ +#define FM_REDZONE 224 /* is ((32-14+1)*4) */ + +#define COPYIN_ARG0_OFFSET FM_ARG0 + +#ifdef MACH_KERNEL +#include <mach_kdb.h> +#else /* MACH_KERNEL */ +#define MACH_KDB 0 +#endif /* MACH_KERNEL */ + +#define BREAKPOINT_TRAP tw 4,r4,r4 + +/* There is another definition of ALIGN for .c sources */ +#ifndef __LANGUAGE_ASSEMBLY +#define ALIGN 4 +#endif /* __LANGUAGE_ASSEMBLY */ + +#ifndef FALIGN +#define FALIGN 4 /* Align functions on words for now. Cachelines is better */ +#endif + +#define LB(x,n) n +#if __STDC__ +#define LCL(x) L ## x +#define EXT(x) _ ## x +#define LEXT(x) _ ## x ## : +#define LBc(x,n) n ## : +#define LBb(x,n) n ## b +#define LBf(x,n) n ## f +#else /* __STDC__ */ +#define LCL(x) L/**/x +#define EXT(x) _/**/x +#define LEXT(x) _/**/x/**/: +#define LBc(x,n) n/**/: +#define LBb(x,n) n/**/b +#define LBf(x,n) n/**/f +#endif /* __STDC__ */ + +#define String .asciz +#define Value .word +#define Times(a,b) (a*b) +#define Divide(a,b) (a/b) + +#define data16 .byte 0x66 +#define addr16 .byte 0x67 + +#define MCOUNT + +#define ELF_FUNC(x) +#define ELF_DATA(x) +#define ELF_SIZE(x,s) + +#define Entry(x,tag) .text@.align FALIGN@ .globl EXT(x)@ LEXT(x) +#define ENTRY(x,tag) Entry(x,tag)@MCOUNT +#define ENTRY2(x,y,tag) .text@ .align FALIGN@ .globl EXT(x)@ .globl EXT(y)@ \ + LEXT(x)@ LEXT(y) @\ + MCOUNT +#if __STDC__ +#define ASENTRY(x) .globl x @ .align FALIGN; x ## @ MCOUNT +#else +#define ASENTRY(x) .globl x @ .align FALIGN; x @ MCOUNT +#endif /* __STDC__ */ +#define DATA(x) .globl EXT(x) @ .align ALIGN @ LEXT(x) + + +#define End(x) ELF_SIZE(x,.-x) +#define END(x) End(EXT(x)) +#define ENDDATA(x) END(x) +#define Enddata(x) End(x) + +/* These defines are here for .c files that wish to reference global symbols + * within __asm__ statements. + */ +#define CC_SYM_PREFIX "_" + +#endif /* _PPC_ASM_H_ */ diff --git a/i386/include/mach/ppc/boolean.h b/i386/include/mach/ppc/boolean.h new file mode 100644 index 0000000..aa3769c --- /dev/null +++ b/i386/include/mach/ppc/boolean.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: boolean.h + * + * Boolean type, for ppc. + */ + +#ifndef _MACH_PPC_BOOLEAN_H_ +#define _MACH_PPC_BOOLEAN_H_ + +#if defined(__ppc64__) +typedef unsigned int boolean_t; +#else +typedef int boolean_t; +#endif + +#endif /* _MACH_PPC_BOOLEAN_H_ */ diff --git a/i386/include/mach/ppc/exception.h b/i386/include/mach/ppc/exception.h new file mode 100644 index 0000000..da4e7cb --- /dev/null +++ b/i386/include/mach/ppc/exception.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Copyright (c) 1990, 1991, 1992, The University of Utah and + * the Center for Software Science at the University of Utah (CSS). + * All rights reserved. + * + * Permission to use, copy, modify and distribute this software is hereby + * granted provided that (1) source code retains these copyright, permission, + * and disclaimer notices, and (2) redistributions including binaries + * reproduce the notices in supporting documentation, and (3) all advertising + * materials mentioning features or use of this software display the following + * acknowledgement: ``This product includes software developed by the Center + * for Software Science at the University of Utah.'' + * + * THE UNIVERSITY OF UTAH AND CSS ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS + * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSS DISCLAIM ANY LIABILITY OF + * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * CSS requests users of this software to return to css-dist@cs.utah.edu any + * improvements that they make and grant CSS redistribution rights. + * + * Utah $Hdr: $ + */ + +#ifndef _MACH_PPC_EXCEPTION_H_ +#define _MACH_PPC_EXCEPTION_H_ + +#define EXC_TYPES_COUNT 11 /* incl. illegal exception 0 */ + +#define EXCEPTION_CODE_MAX 2 /* elements in vector (code+subcode) */ +/* + * EXC_BAD_INSTRUCTION + */ + +#define EXC_PPC_INVALID_SYSCALL 1 /* invalid syscall number */ +#define EXC_PPC_UNIPL_INST 2 /* unimplemented instruction */ +#define EXC_PPC_PRIVINST 3 /* priviledged instruction */ +#define EXC_PPC_PRIVREG 4 /* priviledged register */ +#define EXC_PPC_TRACE 5 /* trace/single-step */ +#define EXC_PPC_PERFMON 6 /* performance monitor */ + +/* + * EXC_BAD_ACCESS + * Note: do not conflict with kern_return_t values returned by vm_fault + */ + +#define EXC_PPC_VM_PROT_READ 0x101 /* error reading syscall args */ +#define EXC_PPC_BADSPACE 0x102 /* bad space referenced */ +#define EXC_PPC_UNALIGNED 0x103 /* unaligned data reference */ + +/* + * EXC_ARITHMETIC + */ + +#define EXC_PPC_OVERFLOW 1 /* integer overflow */ +#define EXC_PPC_ZERO_DIVIDE 2 /* integer divide by zero */ +#define EXC_PPC_FLT_INEXACT 3 /* IEEE inexact exception */ +#define EXC_PPC_FLT_ZERO_DIVIDE 4 /* IEEE zero divide */ +#define EXC_PPC_FLT_UNDERFLOW 5 /* IEEE floating underflow */ +#define EXC_PPC_FLT_OVERFLOW 6 /* IEEE floating overflow */ +#define EXC_PPC_FLT_NOT_A_NUMBER 7 /* IEEE not a number */ + +/* + * EXC_PPC_NOEMULATION should go away when we add software emulation + * for floating point. Right now we don't support this. + */ + +#define EXC_PPC_NOEMULATION 8 /* no floating point emulation */ +#define EXC_PPC_ALTIVECASSIST 9 /* Altivec Denorm Assist */ + +/* + * EXC_SOFTWARE + * Note: 0x10000-0x10003 in use for unix signal + */ +#define EXC_PPC_TRAP 1 /* Program trap */ +#define EXC_PPC_MIGRATE 0x10100 /* Time to bolt */ + + +/* + * EXC_BREAKPOINT + */ + +#define EXC_PPC_BREAKPOINT EXC_PPC_TRAP /* breakpoint trap */ + +/* + * machine dependent exception masks + */ +#define EXC_MASK_MACHINE 0 + +#endif /* _MACH_PPC_EXCEPTION_H_ */ diff --git a/i386/include/mach/ppc/kern_return.h b/i386/include/mach/ppc/kern_return.h new file mode 100644 index 0000000..2c79023 --- /dev/null +++ b/i386/include/mach/ppc/kern_return.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: kern_return.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine-dependent kernel return definitions. + */ + +#ifndef _MACH_PPC_KERN_RETURN_H_ +#define _MACH_PPC_KERN_RETURN_H_ + +#ifndef ASSEMBLER +typedef int kern_return_t; +#endif /* ASSEMBLER */ + +#endif /* _MACH_PPC_KERN_RETURN_H_ */ diff --git a/i386/include/mach/ppc/machine_types.defs b/i386/include/mach/ppc/machine_types.defs new file mode 100644 index 0000000..f0d5c41 --- /dev/null +++ b/i386/include/mach/ppc/machine_types.defs @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Header file for basic, machine-dependent data types. + */ + +#ifndef _PPC_VM_TYPES_DEFS_ +#define _PPC_VM_TYPES_DEFS_ + +type short = int16_t; +type int = int32_t; +type unsigned = uint32_t; + +type float = MACH_MSG_TYPE_REAL_32; +type double = MACH_MSG_TYPE_REAL_64; + +/* from ISO/IEC 988:1999 spec */ +/* 7.18.1.4 Integer types capable of holding object pointers */ +/* + * The [u]intptr_t types for the native + * integer type, e.g. 32 or 64 or.. whatever + * register size the machine has. They are + * used for entities that might be either + * [unsigned] integers or pointers, and for + * type-casting between the two. + * + * For instance, the IPC system represents + * a port in user space as an integer and + * in kernel space as a pointer. + */ +#if defined(__ppc64__) +type uintptr_t = uint64_t; +type intptr_t = int64_t; +#else +type uintptr_t = uint32_t; +type intptr_t = int32_t; +#endif + +/* + * These are the legacy Mach types that are + * the [rough] equivalents of the standards above. + * They were defined in terms of int, not + * long int, so they remain separate. + */ +#if defined(__ppc64__) +type register_t = int64_t; +#else +type register_t = int32_t; +#endif +type integer_t = int32_t; +type natural_t = uint32_t; + +/* + * These are the VM types that scale with the address + * space size of a given process. + */ + +#if defined(__ppc64__) +type vm_address_t = uint64_t; +type vm_offset_t = uint64_t; +type vm_size_t = uint64_t; +#else +type vm_address_t = natural_t; +type vm_offset_t = natural_t; +type vm_size_t = natural_t; +#endif + +/* + * The mach_vm_xxx_t types are sized to hold the + * maximum pointer, offset, etc... supported on the + * platform. + */ +type mach_vm_address_t = uint64_t; +type mach_vm_offset_t = uint64_t; +type mach_vm_size_t = uint64_t; + +#if MACH_IPC_COMPAT +/* + * For the old IPC interface + */ +#define MSG_TYPE_PORT_NAME uint32_t + +#endif /* MACH_IPC_COMPAT */ + +/* + * These are types used internal to Mach to implement the + * legacy 32-bit VM APIs published by the kernel. + */ +#define VM32_SUPPORT 1 + +type vm32_address_t = uint32_t; +type vm32_offset_t = uint32_t; +type vm32_size_t = uint32_t; + +#endif /* _PPC_VM_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/ppc/ndr_def.h b/i386/include/mach/ppc/ndr_def.h new file mode 100644 index 0000000..cb012b2 --- /dev/null +++ b/i386/include/mach/ppc/ndr_def.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#include <mach/ndr.h> + +NDR_record_t NDR_record = { + 0, /* mig_reserved */ + 0, /* mig_reserved */ + 0, /* mig_reserved */ + NDR_PROTOCOL_2_0, + NDR_INT_BIG_ENDIAN, + NDR_CHAR_ASCII, + NDR_FLOAT_IEEE, + 0, +}; diff --git a/i386/include/mach/ppc/processor_info.h b/i386/include/mach/ppc/processor_info.h new file mode 100644 index 0000000..fa07690 --- /dev/null +++ b/i386/include/mach/ppc/processor_info.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * File: mach/ppc/processor_info.h + * + * Data structure definitions for ppc specific processor control + */ + +#ifndef _MACH_PPC_PROCESSOR_INFO_H_ +#define _MACH_PPC_PROCESSOR_INFO_H_ + +#include <mach/machine.h> +#include <mach/message.h> + + +#endif /* _MACH_PPC_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/ppc/rpc.h b/i386/include/mach/ppc/rpc.h new file mode 100644 index 0000000..b3a274a --- /dev/null +++ b/i386/include/mach/ppc/rpc.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_RPC_H_ +#define _MACH_PPC_RPC_H_ + +#endif /* _MACH_PPC_RPC_H_ */ diff --git a/i386/include/mach/ppc/sdt_isa.h b/i386/include/mach/ppc/sdt_isa.h new file mode 100644 index 0000000..c94bb75 --- /dev/null +++ b/i386/include/mach/ppc/sdt_isa.h @@ -0,0 +1,413 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_PPC_SDT_ISA_H +#define _MACH_PPC_SDT_ISA_H + +/* #pragma ident "@(#)sdt.h 1.7 05/06/08 SMI" */ + +/* + * Only define when testing. This makes the calls into actual calls to + * test functions. + */ +/* #define DTRACE_CALL_TEST */ + +#define DTRACE_STRINGIFY(s) #s +#define DTRACE_TOSTRING(s) DTRACE_STRINGIFY(s) + +#define DTRACE_LABEL(p, n) \ + "__dtrace_probe$" DTRACE_TOSTRING(__LINE__) DTRACE_STRINGIFY(_##p##___##n) ":" "\n\t" + +#ifdef DTRACE_CALL_TEST + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_CALL_INSN(p,n) + +#else /* !DTRACE_CALL_TEST */ + +#define DTRACE_CALL(p,n) \ + DTRACE_LABEL(p,n) \ + DTRACE_NOPS + +#endif /* !DTRACE_CALL_TEST */ + +#ifdef __ppc__ + +#define DTRACE_NOPS \ + "nop" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "bl _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 3 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 5 +#define ARGS6_EXTENT 6 +#define ARGS7_EXTENT 7 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 9 +#define ARGS10_EXTENT 10 + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ( \ + DTRACE_CALL(provider, name) \ + "# eat trailing nl+tab from DTRACE_CALL" \ + : \ + : \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("subi r1,r1,0x20" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x20" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x20" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x20" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ + ); + +#define DTRACE_CALL8ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + "lwz r10,0x1c(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10" \ + ); + +#define DTRACE_CALL9ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + "lwz r10,0x1c(%0)" "\n\t" \ + "lwz r11,0x20(%0)" "\n\t" \ + "stw r11,0x38(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11" \ + ); + +#define DTRACE_CALL10ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "lwz r3,0x0(%0)" "\n\t" \ + "lwz r4,0x4(%0)" "\n\t" \ + "lwz r5,0x8(%0)" "\n\t" \ + "lwz r6,0xc(%0)" "\n\t" \ + "lwz r7,0x10(%0)" "\n\t" \ + "lwz r8,0x14(%0)" "\n\t" \ + "lwz r9,0x18(%0)" "\n\t" \ + "lwz r10,0x1c(%0)" "\n\t" \ + "lwz r11,0x20(%0)" "\n\t" \ + "lwz r12,0x24(%0)" "\n\t" \ + "stw r11,0x38(r1)" "\n\t" \ + "stw r12,0x3c(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" \ + ); + +#endif // __ppc__ + +#ifdef __ppc64__ + +#define DTRACE_NOPS \ + "nop" "\n\t" + +#define DTRACE_CALL_INSN(p,n) \ + "bl _dtracetest" DTRACE_STRINGIFY(_##p##_##n) "\n\t" + +#define ARG1_EXTENT 1 +#define ARGS2_EXTENT 2 +#define ARGS3_EXTENT 3 +#define ARGS4_EXTENT 4 +#define ARGS5_EXTENT 5 +#define ARGS6_EXTENT 6 +#define ARGS7_EXTENT 7 +#define ARGS8_EXTENT 8 +#define ARGS9_EXTENT 9 +#define ARGS10_EXTENT 10 + +#define DTRACE_CALL0ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x30" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x30" \ + : \ + : \ + : \ + ); + +#define DTRACE_CALL1ARG(provider, name) \ + asm volatile ("ld r3,0x0(%0)" "\n\t" \ + "subi r1,r1,0x38" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x38" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3" \ + ); + +#define DTRACE_CALL2ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x40" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x40" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4" \ + ); + +#define DTRACE_CALL3ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x48" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x48" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5" \ + ); + +#define DTRACE_CALL4ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x50" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x50" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6" \ + ); + +#define DTRACE_CALL5ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x58" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x58" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7" \ + ); + +#define DTRACE_CALL6ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x60" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x60" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8" \ + ); + +#define DTRACE_CALL7ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x68" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x68" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ + ); + +#define DTRACE_CALL8ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x70" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + "ld r10,0x38(%0)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x70" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10" \ + ); + +#define DTRACE_CALL9ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x78" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + "ld r10,0x38(%0)" "\n\t" \ + "ld r11,0x40(%0)" "\n\t" \ + "std r11,0x70(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x78" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11" \ + ); + +#define DTRACE_CALL10ARGS(provider, name) \ + asm volatile ("subi r1,r1,0x80" "\n\t" \ + "ld r3,0x0(%0)" "\n\t" \ + "ld r4,0x8(%0)" "\n\t" \ + "ld r5,0x10(%0)" "\n\t" \ + "ld r6,0x18(%0)" "\n\t" \ + "ld r7,0x20(%0)" "\n\t" \ + "ld r8,0x28(%0)" "\n\t" \ + "ld r9,0x30(%0)" "\n\t" \ + "ld r10,0x38(%0)" "\n\t" \ + "ld r11,0x40(%0)" "\n\t" \ + "ld r12,0x48(%0)" "\n\t" \ + "std r11,0x70(r1)" "\n\t" \ + "std r12,0x78(r1)" "\n\t" \ + DTRACE_CALL(provider, name) \ + "addi r1,r1,0x80" \ + : \ + : "b" (__dtrace_args) \ + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12" \ + ); + +#endif // __ppc64__ + +#endif /* _MACH_PPC_SDT_ISA_H */ diff --git a/i386/include/mach/ppc/task.h b/i386/include/mach/ppc/task.h new file mode 100644 index 0000000..15c8248 --- /dev/null +++ b/i386/include/mach/ppc/task.h @@ -0,0 +1,1578 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 35 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +/* Routine task_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine task_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; + __Request__task_get_state_t Request_task_get_state; + __Request__task_set_state_t Request_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; + __Reply__task_get_state_t Reply_task_get_state; + __Reply__task_set_state_t Reply_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 },\ + { "task_get_state", 3433 },\ + { "task_set_state", 3434 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/i386/include/mach/ppc/thread_act.h b/i386/include/mach/ppc/thread_act.h new file mode 100644 index 0000000..fde4189 --- /dev/null +++ b/i386/include/mach/ppc/thread_act.h @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/i386/include/mach/ppc/thread_state.h b/i386/include/mach/ppc/thread_state.h new file mode 100644 index 0000000..3ab7baa --- /dev/null +++ b/i386/include/mach/ppc/thread_state.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_THREAD_STATE_H_ +#define _MACH_PPC_THREAD_STATE_H_ + +/* Size of maximum exported thread state in words */ +#define PPC_THREAD_STATE_MAX (144) /* Size of biggest state possible */ + +#if defined (__ppc__) || defined (__ppc64__) +#define THREAD_STATE_MAX PPC_THREAD_STATE_MAX +#endif + +#endif /* _MACH_PPC_THREAD_STATE_H_ */ diff --git a/i386/include/mach/ppc/thread_status.h b/i386/include/mach/ppc/thread_status.h new file mode 100644 index 0000000..ba077f7 --- /dev/null +++ b/i386/include/mach/ppc/thread_status.h @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_THREAD_STATUS_H_ +#define _MACH_PPC_THREAD_STATUS_H_ + +#include <mach/ppc/_structs.h> +#include <mach/message.h> + +/* + * ppc_thread_state is the structure that is exported to user threads for + * use in status/mutate calls. This structure should never change. + * + */ + +#define PPC_THREAD_STATE 1 +#define PPC_FLOAT_STATE 2 +#define PPC_EXCEPTION_STATE 3 +#define PPC_VECTOR_STATE 4 +#define PPC_THREAD_STATE64 5 +#define PPC_EXCEPTION_STATE64 6 +#define THREAD_STATE_NONE 7 + +/* + * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed + * an exception flavor will return whether that is a defined flavor for + * that platform. + * The macro must be manually updated to include all of the valid exception + * flavors as defined above. + */ +#define VALID_THREAD_STATE_FLAVOR(x) \ + ((x == PPC_THREAD_STATE) || \ + (x == PPC_FLOAT_STATE) || \ + (x == PPC_EXCEPTION_STATE) || \ + (x == PPC_VECTOR_STATE) || \ + (x == PPC_THREAD_STATE64) || \ + (x == PPC_EXCEPTION_STATE64) || \ + (x == THREAD_STATE_NONE)) + +typedef _STRUCT_PPC_THREAD_STATE ppc_thread_state_t; +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef _STRUCT_PPC_THREAD_STATE64 ppc_thread_state64_t; +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +typedef _STRUCT_PPC_FLOAT_STATE ppc_float_state_t; +typedef _STRUCT_PPC_VECTOR_STATE ppc_vector_state_t; + +/* + * saved state structure + * + * This structure corresponds to the saved state. + * + */ + +#ifdef MACH__POSIX_C_SOURCE_PRIVATE + +#include <ppc/savearea.h> + +typedef struct savearea ppc_saved_state_t; + +#else /* MACH__POSIX_C_SOURCE_PRIVATE */ + +typedef struct ppc_thread_state ppc_saved_state_t; + +#endif /* MACH__POSIX_C_SOURCE_PRIVATE */ + +/* + * ppc_exception_state + * + * This structure corresponds to some additional state of the user + * registers as saved in the PCB upon kernel entry. They are only + * available if an exception is passed out of the kernel, and even + * then not all are guaranteed to be updated. + * + * Some padding is included in this structure which allows space for + * servers to store temporary values if need be, to maintain binary + * compatiblity. + */ + +/* Exception state for 32-bit thread (on 32-bit processor) */ +/* Still available on 64-bit processors, but may fall short */ +/* of covering the full potential state (hi half available). */ + +typedef _STRUCT_PPC_EXCEPTION_STATE ppc_exception_state_t; +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef _STRUCT_PPC_EXCEPTION_STATE64 ppc_exception_state64_t; +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Save State Flags + */ + +#define PPC_THREAD_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_thread_state_t) / sizeof(int))) + +#define PPC_THREAD_STATE64_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_thread_state64_t) / sizeof(int))) + +#define PPC_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_exception_state_t) / sizeof(int))) + +#define PPC_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_exception_state64_t) / sizeof(int))) + +#define PPC_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_float_state_t) / sizeof(int))) + +#define PPC_VECTOR_STATE_COUNT ((mach_msg_type_number_t) \ + (sizeof(ppc_vector_state_t) / sizeof(int))) + +/* + * Machine-independent way for servers and Mach's exception mechanism to + * choose the most efficient state flavor for exception RPC's: + */ +#define MACHINE_THREAD_STATE PPC_THREAD_STATE +#define MACHINE_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT + +/* + * Largest state on this machine: + */ +#define THREAD_MACHINE_STATE_MAX THREAD_STATE_MAX + +#endif /* _MACH_PPC_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/ppc/vm_param.h b/i386/include/mach/ppc/vm_param.h new file mode 100644 index 0000000..92a4a76 --- /dev/null +++ b/i386/include/mach/ppc/vm_param.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_PPC_VM_PARAM_H_ +#define _MACH_PPC_VM_PARAM_H_ + +/* + * These are the global definitions + */ + +#define BYTE_SIZE 8 /* byte size in bits */ + +#define PPC_PGBYTES 4096 /* bytes per ppc page */ +#define PPC_PGSHIFT 12 /* number of bits to shift for pages */ + +#define PAGE_SIZE PPC_PGBYTES +#define PAGE_SHIFT PPC_PGSHIFT +#define PAGE_MASK (PAGE_SIZE - 1) + +#if 0 +#define VM_MAX_PAGE_ADDRESS 0xFFFFFFFFFFFFF000ULL +#else +/* + * LP64todo - For now, we are limited to 51-bits of user addressing + */ +#define VM_MAX_PAGE_ADDRESS 0x0007FFFFFFFFF000ULL +#endif + +#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0) +#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS) + +/* + * These are the values relative to the local process. + */ +#if defined (__ppc64__) +/* + * LP64todo - We don't have the 64-bit address space layout yet. + * Use the 32-bit stack layout for now. + */ +#define VM_MIN_ADDRESS ((vm_offset_t) MACH_VM_MIN_ADDRESS) +#define VM_MAX_ADDRESS ((vm_offset_t) MACH_VM_MAX_ADDRESS) +#define USER_STACK_END ((vm_offset_t) 0x00000000ffff0000ULL) +#else +#define VM_MIN_ADDRESS ((vm_offset_t) 0) +#define VM_MAX_ADDRESS ((vm_offset_t) (VM_MAX_PAGE_ADDRESS & 0xFFFFFFFF)) +#define USER_STACK_END ((vm_offset_t) 0xffff0000U) +#endif /* defined(__ppc64__) */ + + +#endif /* _MACH_PPC_VM_PARAM_H_ */ diff --git a/i386/include/mach/ppc/vm_types.h b/i386/include/mach/ppc/vm_types.h new file mode 100644 index 0000000..3d04ddd --- /dev/null +++ b/i386/include/mach/ppc/vm_types.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: vm_types.h + * Author: Avadis Tevanian, Jr. + * Date: 1985 + * + * Header file for VM data types. PPC version. + */ + +#ifndef _MACH_PPC_VM_TYPES_H_ +#define _MACH_PPC_VM_TYPES_H_ + +#ifndef ASSEMBLER + +#include <ppc/_types.h> +#include <mach/ppc/vm_param.h> +#include <stdint.h> + +/* + * natural_t and integer_t are Mach's legacy types for machine- + * independent integer types (unsigned, and signed, respectively). + * Their original purpose was to define other types in a machine/ + * compiler independent way. + * + * They also had an implicit "same size as pointer" characteristic + * to them (i.e. Mach's traditional types are very ILP32 or ILP64 + * centric). We support PowerPC ABIs that do not follow either of + * these models (specifically LP64). Therefore, we had to make a + * choice between making these types scale with pointers or stay + * tied to integers. Because their use is predominantly tied to + * to the size of an integer, we are keeping that association and + * breaking free from pointer size guarantees. + * + * New use of these types is discouraged. + */ +typedef __darwin_natural_t natural_t; +typedef int integer_t; + +#if defined(__ppc__) + +/* + * For 32-bit PowerPC ABIs, the scalable types were + * always based upon natural_t (unsigned int). + * Because of potential legacy issues with name mangling, + * we cannot use the stdint uintptr_t type. + */ +typedef natural_t vm_offset_t; +typedef natural_t vm_size_t; + +#else /* __ppc64__ */ + +/* + * For 64-bit PowerPC ABIs, we have no legacy name mangling + * issues, so we use the stdint types for scaling these + * types to the same size as a pointer. + */ +typedef uintptr_t vm_offset_t; +typedef uintptr_t vm_size_t; + +#endif + +/* + * This new type is independent of a particular vm map's + * implementation size - and represents appropriate types + * for all possible maps. This is used for interfaces + * where the size of the map is not known - or we don't + * want to have to distinguish. + */ +typedef uint64_t mach_vm_address_t; +typedef uint64_t mach_vm_offset_t; +typedef uint64_t mach_vm_size_t; + +typedef uint64_t vm_map_offset_t; +typedef uint64_t vm_map_address_t; +typedef uint64_t vm_map_size_t; + + +#endif /* ASSEMBLER */ + +/* + * If composing messages by hand (please do not) + */ +#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32 + +#endif /* _MACH_PPC_VM_TYPES_H_ */ diff --git a/i386/include/mach/processor.defs b/i386/include/mach/processor.defs new file mode 100644 index 0000000..f590633 --- /dev/null +++ b/i386/include/mach/processor.defs @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + processor 3000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * References to processor objects are returned by: + * host_processors(host_priv_t,...); + * +/* + * Start processor. + */ +routine processor_start( + processor : processor_t); + +/* + * Exit processor -- may not be restartable. + */ + +routine processor_exit( + processor : processor_t); + +/* + * Return information about this processor. + */ +routine processor_info( + processor : processor_t; + flavor : processor_flavor_t; + out host : host_t; + out processor_info_out: processor_info_t, CountInOut); + + +/* + * Do something machine-dependent to processor. + */ +routine processor_control( + processor : processor_t; + processor_cmd : processor_info_t); + +/* + * JMM - Keep processor_set related stuff at the end because + * they likely will be removed. + */ + +/* + * Assign processor to processor set. + */ +routine processor_assign( + processor : processor_t; + new_set : processor_set_t; + wait : boolean_t); + +/* + * Get current assignment for processor. + */ +routine processor_get_assignment( + processor : processor_t; + out assigned_set : processor_set_name_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/processor.h b/i386/include/mach/processor.h new file mode 100644 index 0000000..e3afbde --- /dev/null +++ b/i386/include/mach/processor.h @@ -0,0 +1,336 @@ +#ifndef _processor_user_ +#define _processor_user_ + +/* Module processor */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef processor_MSG_COUNT +#define processor_MSG_COUNT 6 +#endif /* processor_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine processor_start */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_start +( + processor_t processor +); + +/* Routine processor_exit */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_exit +( + processor_t processor +); + +/* Routine processor_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_info +( + processor_t processor, + processor_flavor_t flavor, + host_t *host, + processor_info_t processor_info_out, + mach_msg_type_number_t *processor_info_outCnt +); + +/* Routine processor_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_control +( + processor_t processor, + processor_info_t processor_cmd, + mach_msg_type_number_t processor_cmdCnt +); + +/* Routine processor_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_assign +( + processor_t processor, + processor_set_t new_set, + boolean_t wait +); + +/* Routine processor_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_get_assignment +( + processor_t processor, + processor_set_name_t *assigned_set +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__processor_subsystem__defined +#define __Request__processor_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_start_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_exit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_flavor_t flavor; + mach_msg_type_number_t processor_info_outCnt; + } __Request__processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + mach_msg_type_number_t processor_cmdCnt; + integer_t processor_cmd[12]; + } __Request__processor_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t wait; + } __Request__processor_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__processor_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__processor_subsystem__defined +#define __RequestUnion__processor_subsystem__defined +union __RequestUnion__processor_subsystem { + __Request__processor_start_t Request_processor_start; + __Request__processor_exit_t Request_processor_exit; + __Request__processor_info_t Request_processor_info; + __Request__processor_control_t Request_processor_control; + __Request__processor_assign_t Request_processor_assign; + __Request__processor_get_assignment_t Request_processor_get_assignment; +}; +#endif /* !__RequestUnion__processor_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__processor_subsystem__defined +#define __Reply__processor_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_start_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_exit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t host; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t processor_info_outCnt; + integer_t processor_info_out[12]; + } __Reply__processor_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__processor_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__processor_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__processor_subsystem__defined +#define __ReplyUnion__processor_subsystem__defined +union __ReplyUnion__processor_subsystem { + __Reply__processor_start_t Reply_processor_start; + __Reply__processor_exit_t Reply_processor_exit; + __Reply__processor_info_t Reply_processor_info; + __Reply__processor_control_t Reply_processor_control; + __Reply__processor_assign_t Reply_processor_assign; + __Reply__processor_get_assignment_t Reply_processor_get_assignment; +}; +#endif /* !__RequestUnion__processor_subsystem__defined */ + +#ifndef subsystem_to_name_map_processor +#define subsystem_to_name_map_processor \ + { "processor_start", 3000 },\ + { "processor_exit", 3001 },\ + { "processor_info", 3002 },\ + { "processor_control", 3003 },\ + { "processor_assign", 3004 },\ + { "processor_get_assignment", 3005 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _processor_user_ */ diff --git a/i386/include/mach/processor_info.h b/i386/include/mach/processor_info.h new file mode 100644 index 0000000..1607c71 --- /dev/null +++ b/i386/include/mach/processor_info.h @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +/* + * File: mach/processor_info.h + * Author: David L. Black + * Date: 1988 + * + * Data structure definitions for processor_info, processor_set_info + */ + +#ifndef _MACH_PROCESSOR_INFO_H_ +#define _MACH_PROCESSOR_INFO_H_ + +#include <mach/message.h> +#include <mach/machine.h> +#include <mach/machine/processor_info.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef integer_t *processor_info_t; /* varying array of int. */ +typedef integer_t *processor_info_array_t; /* varying array of int */ + +#define PROCESSOR_INFO_MAX (1024) /* max array size */ +typedef integer_t processor_info_data_t[PROCESSOR_INFO_MAX]; + + +typedef integer_t *processor_set_info_t; /* varying array of int. */ + +#define PROCESSOR_SET_INFO_MAX (1024) /* max array size */ +typedef integer_t processor_set_info_data_t[PROCESSOR_SET_INFO_MAX]; + +/* + * Currently defined information. + */ +typedef int processor_flavor_t; +#define PROCESSOR_BASIC_INFO 1 /* basic information */ +#define PROCESSOR_CPU_LOAD_INFO 2 /* cpu load information */ +#define PROCESSOR_PM_REGS_INFO 0x10000001 /* performance monitor register info */ +#define PROCESSOR_TEMPERATURE 0x10000002 /* Processor core temperature */ + +struct processor_basic_info { + cpu_type_t cpu_type; /* type of cpu */ + cpu_subtype_t cpu_subtype; /* subtype of cpu */ + boolean_t running; /* is processor running */ + int slot_num; /* slot number */ + boolean_t is_master; /* is this the master processor */ +}; + +typedef struct processor_basic_info processor_basic_info_data_t; +typedef struct processor_basic_info *processor_basic_info_t; +#define PROCESSOR_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_basic_info_data_t)/sizeof(natural_t))) + +struct processor_cpu_load_info { /* number of ticks while running... */ + unsigned int cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */ +}; + +typedef struct processor_cpu_load_info processor_cpu_load_info_data_t; +typedef struct processor_cpu_load_info *processor_cpu_load_info_t; +#define PROCESSOR_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t))) + +/* + * Scaling factor for load_average, mach_factor. + */ +#define LOAD_SCALE 1000 + +typedef int processor_set_flavor_t; +#define PROCESSOR_SET_BASIC_INFO 5 /* basic information */ + +struct processor_set_basic_info { + int processor_count; /* How many processors */ + int default_policy; /* When others not enabled */ +}; + +typedef struct processor_set_basic_info processor_set_basic_info_data_t; +typedef struct processor_set_basic_info *processor_set_basic_info_t; +#define PROCESSOR_SET_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t))) + +#define PROCESSOR_SET_LOAD_INFO 4 /* scheduling statistics */ + +struct processor_set_load_info { + int task_count; /* How many tasks */ + int thread_count; /* How many threads */ + integer_t load_average; /* Scaled */ + integer_t mach_factor; /* Scaled */ +}; + +typedef struct processor_set_load_info processor_set_load_info_data_t; +typedef struct processor_set_load_info *processor_set_load_info_t; +#define PROCESSOR_SET_LOAD_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(processor_set_load_info_data_t)/sizeof(natural_t))) + + +#endif /* _MACH_PROCESSOR_INFO_H_ */ diff --git a/i386/include/mach/processor_set.defs b/i386/include/mach/processor_set.defs new file mode 100644 index 0000000..dc0f407 --- /dev/null +++ b/i386/include/mach/processor_set.defs @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + processor_set 4000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Return scheduling statistics for a processor set. + */ +routine processor_set_statistics( + pset : processor_set_name_t; + flavor : processor_set_flavor_t; + out info_out : processor_set_info_t, CountInOut); + + +/* + * Destroy processor set. + */ +routine processor_set_destroy( + set : processor_set_t); + + +/* + * Set max priority for processor_set. + */ +routine processor_set_max_priority( + processor_set : processor_set_t; + max_priority : int; + change_threads : boolean_t); + +/* + * Enable policy for processor set + */ +routine processor_set_policy_enable( + processor_set : processor_set_t; + policy : int); + +/* + * Disable policy for processor set + */ +routine processor_set_policy_disable( + processor_set : processor_set_t; + policy : int; + change_threads : boolean_t); + +/* + * List all tasks in processor set. + */ +routine processor_set_tasks( + processor_set : processor_set_t; + out task_list : task_array_t); + +/* + * List all threads in processor set. + */ +routine processor_set_threads( + processor_set : processor_set_t; + out thread_list : thread_act_array_t); + +/* + * Controls the scheduling attributes governing the processor set. + * Allows control of enabled policies, and per-policy base and limit + * priorities. + */ +routine processor_set_policy_control( + pset : processor_set_t; + flavor : processor_set_flavor_t; + policy_info : processor_set_info_t; + change : boolean_t); + + +/* + * Debug Info + * This call is only valid on MACH_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine processor_set_stack_usage( + pset : processor_set_t; + out ltotal : unsigned; + out space : vm_size_t; + out resident : vm_size_t; + out maxusage : vm_size_t; + out maxstack : vm_offset_t); + +/* + * Get information about processor set. + */ +routine processor_set_info( + set_name : processor_set_name_t; + flavor : int; + out host : host_t; + out info_out : processor_set_info_t, CountInOut); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/processor_set.h b/i386/include/mach/processor_set.h new file mode 100644 index 0000000..1aaf327 --- /dev/null +++ b/i386/include/mach/processor_set.h @@ -0,0 +1,516 @@ +#ifndef _processor_set_user_ +#define _processor_set_user_ + +/* Module processor_set */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef processor_set_MSG_COUNT +#define processor_set_MSG_COUNT 10 +#endif /* processor_set_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine processor_set_statistics */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_statistics +( + processor_set_name_t pset, + processor_set_flavor_t flavor, + processor_set_info_t info_out, + mach_msg_type_number_t *info_outCnt +); + +/* Routine processor_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_destroy +( + processor_set_t set +); + +/* Routine processor_set_max_priority */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_max_priority +( + processor_set_t processor_set, + int max_priority, + boolean_t change_threads +); + +/* Routine processor_set_policy_enable */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_policy_enable +( + processor_set_t processor_set, + int policy +); + +/* Routine processor_set_policy_disable */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_policy_disable +( + processor_set_t processor_set, + int policy, + boolean_t change_threads +); + +/* Routine processor_set_tasks */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_tasks +( + processor_set_t processor_set, + task_array_t *task_list, + mach_msg_type_number_t *task_listCnt +); + +/* Routine processor_set_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_threads +( + processor_set_t processor_set, + thread_act_array_t *thread_list, + mach_msg_type_number_t *thread_listCnt +); + +/* Routine processor_set_policy_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_policy_control +( + processor_set_t pset, + processor_set_flavor_t flavor, + processor_set_info_t policy_info, + mach_msg_type_number_t policy_infoCnt, + boolean_t change +); + +/* Routine processor_set_stack_usage */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_stack_usage +( + processor_set_t pset, + unsigned *ltotal, + vm_size_t *space, + vm_size_t *resident, + vm_size_t *maxusage, + vm_offset_t *maxstack +); + +/* Routine processor_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t processor_set_info +( + processor_set_name_t set_name, + int flavor, + host_t *host, + processor_set_info_t info_out, + mach_msg_type_number_t *info_outCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__processor_set_subsystem__defined +#define __Request__processor_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_set_flavor_t flavor; + mach_msg_type_number_t info_outCnt; + } __Request__processor_set_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int max_priority; + boolean_t change_threads; + } __Request__processor_set_max_priority_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + } __Request__processor_set_policy_enable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + boolean_t change_threads; + } __Request__processor_set_policy_disable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_tasks_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + processor_set_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[5]; + boolean_t change; + } __Request__processor_set_policy_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__processor_set_stack_usage_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t info_outCnt; + } __Request__processor_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__processor_set_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__processor_set_subsystem__defined +#define __RequestUnion__processor_set_subsystem__defined +union __RequestUnion__processor_set_subsystem { + __Request__processor_set_statistics_t Request_processor_set_statistics; + __Request__processor_set_destroy_t Request_processor_set_destroy; + __Request__processor_set_max_priority_t Request_processor_set_max_priority; + __Request__processor_set_policy_enable_t Request_processor_set_policy_enable; + __Request__processor_set_policy_disable_t Request_processor_set_policy_disable; + __Request__processor_set_tasks_t Request_processor_set_tasks; + __Request__processor_set_threads_t Request_processor_set_threads; + __Request__processor_set_policy_control_t Request_processor_set_policy_control; + __Request__processor_set_stack_usage_t Request_processor_set_stack_usage; + __Request__processor_set_info_t Request_processor_set_info; +}; +#endif /* !__RequestUnion__processor_set_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__processor_set_subsystem__defined +#define __Reply__processor_set_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t info_outCnt; + integer_t info_out[5]; + } __Reply__processor_set_statistics_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_max_priority_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_policy_enable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_policy_disable_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t task_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t task_listCnt; + } __Reply__processor_set_tasks_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t thread_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t thread_listCnt; + } __Reply__processor_set_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__processor_set_policy_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + unsigned ltotal; + vm_size_t space; + vm_size_t resident; + vm_size_t maxusage; + vm_offset_t maxstack; + } __Reply__processor_set_stack_usage_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t host; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t info_outCnt; + integer_t info_out[5]; + } __Reply__processor_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__processor_set_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__processor_set_subsystem__defined +#define __ReplyUnion__processor_set_subsystem__defined +union __ReplyUnion__processor_set_subsystem { + __Reply__processor_set_statistics_t Reply_processor_set_statistics; + __Reply__processor_set_destroy_t Reply_processor_set_destroy; + __Reply__processor_set_max_priority_t Reply_processor_set_max_priority; + __Reply__processor_set_policy_enable_t Reply_processor_set_policy_enable; + __Reply__processor_set_policy_disable_t Reply_processor_set_policy_disable; + __Reply__processor_set_tasks_t Reply_processor_set_tasks; + __Reply__processor_set_threads_t Reply_processor_set_threads; + __Reply__processor_set_policy_control_t Reply_processor_set_policy_control; + __Reply__processor_set_stack_usage_t Reply_processor_set_stack_usage; + __Reply__processor_set_info_t Reply_processor_set_info; +}; +#endif /* !__RequestUnion__processor_set_subsystem__defined */ + +#ifndef subsystem_to_name_map_processor_set +#define subsystem_to_name_map_processor_set \ + { "processor_set_statistics", 4000 },\ + { "processor_set_destroy", 4001 },\ + { "processor_set_max_priority", 4002 },\ + { "processor_set_policy_enable", 4003 },\ + { "processor_set_policy_disable", 4004 },\ + { "processor_set_tasks", 4005 },\ + { "processor_set_threads", 4006 },\ + { "processor_set_policy_control", 4007 },\ + { "processor_set_stack_usage", 4008 },\ + { "processor_set_info", 4009 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _processor_set_user_ */ diff --git a/i386/include/mach/rpc.h b/i386/include/mach/rpc.h new file mode 100644 index 0000000..565d7ac --- /dev/null +++ b/i386/include/mach/rpc.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +/* + * Mach RPC Subsystem Interfaces + */ + +#ifndef _MACH_RPC_H_ +#define _MACH_RPC_H_ + +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/port.h> +#include <mach/vm_types.h> + +#include <mach/mig.h> +#include <mach/mig_errors.h> +#include <mach/machine/rpc.h> +#include <mach/thread_status.h> + +/* + * These are the types for RPC-specific variants of the MIG routine + * descriptor and subsystem data types. + * + * THIS IS ONLY FOR COMPATIBILITY. WE WILL NOT BE IMPLEMENTING THIS. + */ + +/* + * Basic mach rpc types. + */ +typedef unsigned int routine_arg_type; +typedef unsigned int routine_arg_offset; +typedef unsigned int routine_arg_size; + +/* + * Definitions for a signature's argument and routine descriptor's. + */ +struct rpc_routine_arg_descriptor { + routine_arg_type type; /* Port, Array, etc. */ + routine_arg_size size; /* element size in bytes */ + routine_arg_size count; /* number of elements */ + routine_arg_offset offset; /* Offset in list of routine args */ +}; +typedef struct rpc_routine_arg_descriptor *rpc_routine_arg_descriptor_t; + +struct rpc_routine_descriptor { + mig_impl_routine_t impl_routine; /* Server work func pointer */ + mig_stub_routine_t stub_routine; /* Unmarshalling func pointer */ + unsigned int argc; /* Number of argument words */ + unsigned int descr_count; /* Number of complex argument */ + /* descriptors */ + rpc_routine_arg_descriptor_t + arg_descr; /* Pointer to beginning of */ + /* the arg_descr array */ + unsigned int max_reply_msg; /* Max size for reply msg */ +}; +typedef struct rpc_routine_descriptor *rpc_routine_descriptor_t; + +#define RPC_DESCR_SIZE(x) ((x)->descr_count * \ + sizeof(struct rpc_routine_arg_descriptor)) + +struct rpc_signature { + struct rpc_routine_descriptor rd; + struct rpc_routine_arg_descriptor rad[1]; +}; + +#define RPC_SIGBUF_SIZE 8 + +/* + * A subsystem describes a set of server routines that can be invoked by + * mach_rpc() on the ports that are registered with the subsystem. For + * each routine, the routine number is given, along with the + * address of the implementation function in the server and a + * description of the arguments of the routine (it's "signature"). + * + * This structure definition is only a template for what is really a + * variable-length structure (generated by MIG for each subsystem). + * The actual structures do not always have one entry in the routine + * array, and also have a varying number of entries in the arg_descr + * array. Each routine has an array of zero or more arg descriptors + * one for each complex arg. These arrays are all catenated together + * to form the arg_descr field of the subsystem struct. The + * arg_descr field of each routine entry points to a unique sub-sequence + * within this catenated array. The goal is to keep everything + * contiguous. + */ +struct rpc_subsystem { + void *reserved; /* Reserved for system use */ + + mach_msg_id_t start; /* Min routine number */ + mach_msg_id_t end; /* Max routine number + 1 */ + unsigned int maxsize; /* Max mach_msg size */ + vm_address_t base_addr; /* Address of this struct in user */ + + struct rpc_routine_descriptor /* Array of routine descriptors */ + routine[1 /* Actually, (start-end+1) */ + ]; + + struct rpc_routine_arg_descriptor + arg_descriptor[1 /* Actually, the sum of the descr_ */ + ]; /* count fields for all routines */ +}; +typedef struct rpc_subsystem *rpc_subsystem_t; + +#define RPC_SUBSYSTEM_NULL ((rpc_subsystem_t) 0) + +#endif /* _MACH_RPC_H_ */ diff --git a/i386/include/mach/sdt.h b/i386/include/mach/sdt.h new file mode 100644 index 0000000..3268551 --- /dev/null +++ b/i386/include/mach/sdt.h @@ -0,0 +1,32 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _MACH_SDT_H +#define _MACH_SDT_H + +#include <mach/machine/sdt.h> + +#endif /* _MACH_SDT_H */ diff --git a/i386/include/mach/security.defs b/i386/include/mach/security.defs new file mode 100644 index 0000000..734aa90 --- /dev/null +++ b/i386/include/mach/security.defs @@ -0,0 +1,208 @@ + +/* -*- C++ -*- */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif KERNEL_SERVER + security 5200; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +type labelstr_t = c_string[*:512]; + +/** + @brief Retrieve a task label as a label handle + @param task Target's task port + @param label Returned label handle + + This call retrieves the label handle of the specified task. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_task_label(task : ipc_space_t; + out label : mach_port_name_t); + +/** + @brief Retrieve a task label in textual form + @param task Target's task port + @param policies Comma-delimited list of policies to query + @param label Returned label text + + This call retrieves an externalized task label for the + specified task, with respect to the specified policies. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_task_label_text(task : ipc_space_t; + policies : labelstr_t; + out label : labelstr_t); + +/** + @brief Retrieve a port label as a label handle + @param task Issuer's task port + @param port Port to query label from + @param label Returned label handle + + This call retrieves a new label handle for the specified port. + If the port represents a label handle, KERN_INVALID_ARGUMENT is + returned. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_label(task : ipc_space_t; + port : mach_port_name_t; + out label : mach_port_name_t); + +/** + @brief Retrieve a port label in textual form + @param task Issuer's task port + @param name Port to query label from + @param policies Comma-delimited list of policies to query + @param label Returned label text + + This call retrieves an externalized port label for the specified port, + with respect to the specified policies. If the port represents a label + handle, the returned label text refers to the stored label and not the + access control label. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_get_label_text(task : ipc_space_t; + name : mach_port_name_t; + policies : labelstr_t; + out label : labelstr_t); + +/** + @brief Relabel a port + @param task Task containing specified ports + @param name Port to relabel + @param label String representation of new label + + This call attempts to relabel the specified port to the + label specified. For label handles, it changes the access control + label and not the stored label. + + @return Standard MiG return values (0 for success) +*/ + +routine mach_set_port_label(task : ipc_space_t; + name : mach_port_name_t; + label : labelstr_t); + +/** + @brief Generic access control check + @param task Any task port + @param subj subject label in textual form + @param obj object label in textual form + @param serv Service or object class name + @param perm Permission, or method, within the specified service + + This function provides a general way for a user process to query + an arbitrary access control decision from the system's security policies. + Currently, there are no standards for the format of the service and + permission names. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_check_service(task : ipc_space_t; + subject : labelstr_t; + object : labelstr_t; + service : labelstr_t; + perm : labelstr_t); + +/** + @brief Generic access control check + @param task Task containing specified ports (usually caller's) + @param subj subject label in textual form + @param obj port containing object label + @param serv Service or object class name + @param perm Permission, or method, within the specified service + + This function provides a general way for a user process to query + an arbitrary access control decision from the system's security policies. + Currently, there are no standards for the format of the service and + permission names. If the port is a label handle, the stored label is + used. Otherwise, its access control label is used. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_port_check_service_obj(task : ipc_space_t; + subject : labelstr_t; + object : mach_port_name_t; + service : labelstr_t; + perm : labelstr_t); + +/** + @brief Generic access control check + @param task Task containing specified ports (usually caller's) + @param subj port containing subject label + @param obj port containing object label + @param serv Service or object class name + @param perm Permission, or method, within the specified service + + This function provides a general way for a user process to query + an arbitrary access control decision from the system's security policies. + Currently, there are no standards for the format of the service and + permission names. If any ports are label handles, the stored label is + used. Otherwise, the access control labels are used. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_port_check_access(task : ipc_space_t; + subject : mach_port_name_t; + object : mach_port_name_t; + service : labelstr_t; + perm : labelstr_t); + +/** + @brief Create a new label handle + @param task Task to receive new ports (usually caller's) + @param name Returned label handle port + @param label String representation of new label + + Creates a new label handle, with the stored label defined by the + given text. Any task may create a label handle with any valid label, + not necessarily one that it has permission to access. A port right + for the new label handle is inserted into the specified task. + Posession of label handles should not imply any security properties. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_label_new(task : ipc_space_t; + out name : mach_port_name_t; + label : labelstr_t); + +/** + @brief Request a computed label + @param task subj,obj,newlabel relative to this task (usually caller's) + @param subj port containing subject label + @param obj port containing object label + @param serv Service or object class name + @param newlabel Returned label handle port + + Ask the loaded policies to compute a label based on the two input labels + and the service name. There is currently no standard for the service name, + or even what the input labels represent (Subject and parent object are only + a suggestion). If any ports are label handles, the stored label is + used. Otherwise, the access control labels are used. A new label handle + is created to contain the computed label, and is stored into the + specified task. + + @return Standard MiG return values (0 for success) +*/ + +routine mac_request_label(task : ipc_space_t; + subject : mach_port_name_t; + object : mach_port_name_t; + service : labelstr_t; + out newlabel : mach_port_name_t); diff --git a/i386/include/mach/semaphore.h b/i386/include/mach/semaphore.h new file mode 100644 index 0000000..660af09 --- /dev/null +++ b/i386/include/mach/semaphore.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_SEMAPHORE_H_ +#define _MACH_SEMAPHORE_H_ + +#include <mach/port.h> +#include <mach/mach_types.h> +#include <mach/kern_return.h> +#include <mach/sync_policy.h> + +/* + * Forward Declarations + * + * The semaphore creation and deallocation routines are + * defined with the Mach task APIs in <mach/task.h>. + * + * kern_return_t semaphore_create(task_t task, + * semaphore_t *new_semaphore, + * sync_policy_t policy, + * int value); + * + * kern_return_t semaphore_destroy(task_t task, + * semaphore_t semaphore); + */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + +extern kern_return_t semaphore_signal (semaphore_t semaphore); +extern kern_return_t semaphore_signal_all (semaphore_t semaphore); + +extern kern_return_t semaphore_wait (semaphore_t semaphore); + + +extern kern_return_t semaphore_timedwait (semaphore_t semaphore, + mach_timespec_t wait_time); + +extern kern_return_t semaphore_timedwait_signal(semaphore_t wait_semaphore, + semaphore_t signal_semaphore, + mach_timespec_t wait_time); + +extern kern_return_t semaphore_wait_signal (semaphore_t wait_semaphore, + semaphore_t signal_semaphore); + +extern kern_return_t semaphore_signal_thread (semaphore_t semaphore, + thread_t thread); + + +__END_DECLS + + +#endif /* _MACH_SEMAPHORE_H_ */ diff --git a/i386/include/mach/shared_memory_server.h b/i386/include/mach/shared_memory_server.h new file mode 100644 index 0000000..1ca25f3 --- /dev/null +++ b/i386/include/mach/shared_memory_server.h @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * + * File: mach/shared_memory_server.h + * + * protos and struct definitions for shared library + * server and interface + */ + +/* + * XXX + * + * NOTE: this file is deprecated and will be removed in the near future. + * Any project that includes this file should be changed to: + * 1. use <mach/shared_region.h> instead of this file, + * 2. handle the new shared regions, now available on more platforms + */ + +#ifndef _MACH_SHARED_MEMORY_SERVER_H_ +#define _MACH_SHARED_MEMORY_SERVER_H_ + +#warning "<mach/shared_memory_server.h> is deprecated. Please use <mach/shared_region.h> instead." + +#include <sys/cdefs.h> +#include <mach/vm_prot.h> +#include <mach/vm_types.h> +#include <mach/mach_types.h> + +#define VM_PROT_COW 0x8 /* must not interfere with normal prot assignments */ +#define VM_PROT_ZF 0x10 /* must not interfere with normal prot assignments */ + +#ifdef __arm__ +#define GLOBAL_SHARED_TEXT_SEGMENT 0x30000000U +#define GLOBAL_SHARED_DATA_SEGMENT 0x38000000U +#define GLOBAL_SHARED_SEGMENT_MASK 0xF8000000U + +#define SHARED_TEXT_REGION_SIZE 0x08000000 +#define SHARED_DATA_REGION_SIZE 0x08000000 +#else +#define GLOBAL_SHARED_TEXT_SEGMENT 0x90000000U +#define GLOBAL_SHARED_DATA_SEGMENT 0xA0000000U +#define GLOBAL_SHARED_SEGMENT_MASK 0xF0000000U + +#define SHARED_TEXT_REGION_SIZE 0x10000000 +#define SHARED_DATA_REGION_SIZE 0x10000000 +#endif + +#if !defined(__LP64__) + +#define SHARED_LIBRARY_SERVER_SUPPORTED + +#define SHARED_ALTERNATE_LOAD_BASE 0x09000000 + +/* + * Note: the two masks below are useful because the assumption is + * made that these shared regions will always be mapped on natural boundaries + * i.e. if the size is 0x10000000 the object can be mapped at + * 0x20000000, or 0x30000000, but not 0x1000000 + */ +#ifdef __arm__ +#define SHARED_TEXT_REGION_MASK 0x07FFFFFF +#define SHARED_DATA_REGION_MASK 0x07FFFFFF +#else +#define SHARED_TEXT_REGION_MASK 0x0FFFFFFF +#define SHARED_DATA_REGION_MASK 0x0FFFFFFF +#endif + + +/* flags field aliases for copyin_shared_file and load_shared_file */ + +/* IN */ +#define ALTERNATE_LOAD_SITE 0x1 +#define NEW_LOCAL_SHARED_REGIONS 0x2 +#define QUERY_IS_SYSTEM_REGION 0x4 + +/* OUT */ +#define SF_PREV_LOADED 0x1 +#define SYSTEM_REGION_BACKED 0x2 + + +struct sf_mapping { + vm_offset_t mapping_offset; + vm_size_t size; + vm_offset_t file_offset; + vm_prot_t protection; /* read/write/execute/COW/ZF */ + vm_offset_t cksum; +}; +typedef struct sf_mapping sf_mapping_t; + +#endif /* !defined(__LP64__) */ + +/* + * All shared_region_* declarations are a private interface + * between dyld and the kernel. + * + */ +struct shared_file_mapping_np { + mach_vm_address_t sfm_address; + mach_vm_size_t sfm_size; + mach_vm_offset_t sfm_file_offset; + vm_prot_t sfm_max_prot; + vm_prot_t sfm_init_prot; +}; + +struct shared_region_range_np { + mach_vm_address_t srr_address; + mach_vm_size_t srr_size; +}; + + +__BEGIN_DECLS +int shared_region_map_file_np(int fd, + uint32_t mappingCount, + const struct shared_file_mapping_np *mappings, + int64_t *slide_p); +int shared_region_make_private_np(uint32_t rangeCount, + const struct shared_region_range_np *ranges); +__END_DECLS + + +#endif /* _MACH_SHARED_MEMORY_SERVER_H_ */ diff --git a/i386/include/mach/shared_region.h b/i386/include/mach/shared_region.h new file mode 100644 index 0000000..4bea17e --- /dev/null +++ b/i386/include/mach/shared_region.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * + * File: mach/shared_region.h + * + * protos and struct definitions for shared region + */ + +#ifndef _MACH_SHARED_REGION_H_ +#define _MACH_SHARED_REGION_H_ + +#include <sys/cdefs.h> +#include <mach/vm_prot.h> +#include <mach/vm_types.h> +#include <mach/mach_types.h> + +#define SHARED_REGION_BASE_I386 0x90000000ULL +#define SHARED_REGION_SIZE_I386 0x20000000ULL +#define SHARED_REGION_NESTING_BASE_I386 0x90000000ULL +#define SHARED_REGION_NESTING_SIZE_I386 0x20000000ULL +#define SHARED_REGION_NESTING_MIN_I386 0x00200000ULL +#define SHARED_REGION_NESTING_MAX_I386 0xFFE00000ULL + +#define SHARED_REGION_BASE_X86_64 0x00007FFF70000000ULL +#define SHARED_REGION_SIZE_X86_64 0x000000008FE00000ULL +#define SHARED_REGION_NESTING_BASE_X86_64 0x00007FFF80000000ULL +#define SHARED_REGION_NESTING_SIZE_X86_64 0x0000000040000000ULL +#define SHARED_REGION_NESTING_MIN_X86_64 0x0000000000200000ULL +#define SHARED_REGION_NESTING_MAX_X86_64 0xFFFFFFFFFFE00000ULL + +#define SHARED_REGION_BASE_PPC 0x90000000ULL +#define SHARED_REGION_SIZE_PPC 0x20000000ULL +#define SHARED_REGION_NESTING_BASE_PPC 0x90000000ULL +#define SHARED_REGION_NESTING_SIZE_PPC 0x10000000ULL +#define SHARED_REGION_NESTING_MIN_PPC 0x10000000ULL +#define SHARED_REGION_NESTING_MAX_PPC 0x10000000ULL + +#define SHARED_REGION_BASE_PPC64 0x00007FFF60000000ULL +#define SHARED_REGION_SIZE_PPC64 0x00000000A0000000ULL +#define SHARED_REGION_NESTING_BASE_PPC64 0x00007FFF60000000ULL +#define SHARED_REGION_NESTING_SIZE_PPC64 0x00000000A0000000ULL +#define SHARED_REGION_NESTING_MIN_PPC64 0x0000000010000000ULL +#define SHARED_REGION_NESTING_MAX_PPC64 0x0000000010000000ULL + +#define SHARED_REGION_BASE_ARM 0x30000000ULL +#define SHARED_REGION_SIZE_ARM 0x10000000ULL +#define SHARED_REGION_NESTING_BASE_ARM 0x30000000ULL +#define SHARED_REGION_NESTING_SIZE_ARM 0x08000000ULL +#define SHARED_REGION_NESTING_MIN_ARM ? +#define SHARED_REGION_NESTING_MAX_ARM ? + +#if defined(__i386__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_I386 +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_I386 +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_I386 +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_I386 +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_I386 +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_I386 +#elif defined(__x86_64__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_X86_64 +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_X86_64 +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_X86_64 +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_X86_64 +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_X86_64 +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_X86_64 +#elif defined(__ppc__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_PPC +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_PPC +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_PPC +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_PPC +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_PPC +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_PPC +#elif defined(__ppc64__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_PPC64 +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_PPC64 +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_PPC64 +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_PPC64 +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_PPC64 +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_PPC64 +#elif defined(__arm__) +#define SHARED_REGION_BASE SHARED_REGION_BASE_ARM +#define SHARED_REGION_SIZE SHARED_REGION_SIZE_ARM +#define SHARED_REGION_NESTING_BASE SHARED_REGION_NESTING_BASE_ARM +#define SHARED_REGION_NESTING_SIZE SHARED_REGION_NESTING_SIZE_ARM +#define SHARED_REGION_NESTING_MIN SHARED_REGION_NESTING_MIN_ARM +#define SHARED_REGION_NESTING_MAX SHARED_REGION_NESTING_MAX_ARM +#endif + +/* + * All shared_region_* declarations are a private interface + * between dyld and the kernel. + * + */ +struct shared_file_mapping_np { + mach_vm_address_t sfm_address; + mach_vm_size_t sfm_size; + mach_vm_offset_t sfm_file_offset; + vm_prot_t sfm_max_prot; + vm_prot_t sfm_init_prot; +}; +#define VM_PROT_COW 0x8 /* must not interfere with normal prot assignments */ +#define VM_PROT_ZF 0x10 /* must not interfere with normal prot assignments */ + + +__BEGIN_DECLS +int shared_region_check_np(uint64_t *startaddress); +int shared_region_map_np(int fd, + uint32_t mappingCount, + const struct shared_file_mapping_np *mappings); +__END_DECLS + + +#endif /* _MACH_SHARED_REGION_H_ */ diff --git a/i386/include/mach/std_types.defs b/i386/include/mach/std_types.defs new file mode 100644 index 0000000..0b48383 --- /dev/null +++ b/i386/include/mach/std_types.defs @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Mach kernel standard interface type declarations + */ + +#ifndef _MACH_STD_TYPES_DEFS_ +#define _MACH_STD_TYPES_DEFS_ + +/* from ISO/IEC 988:1999 spec */ +/* 7.18.1.1 Exact-width integer types */ + +type int8_t = MACH_MSG_TYPE_INTEGER_8; +type uint8_t = MACH_MSG_TYPE_INTEGER_8; +type int16_t = MACH_MSG_TYPE_INTEGER_16; +type uint16_t = MACH_MSG_TYPE_INTEGER_16; +type int32_t = MACH_MSG_TYPE_INTEGER_32; +type uint32_t = MACH_MSG_TYPE_INTEGER_32; +type int64_t = MACH_MSG_TYPE_INTEGER_64; +type uint64_t = MACH_MSG_TYPE_INTEGER_64; + +/* + * Legacy fixed-length Mach types which should + * be replaced with the Standard types from above. + */ +type int32 = int32_t; +type unsigned32 = uint32_t; +type int64 = int64_t; +type unsigned64 = uint64_t; + +/* + * Other fixed length Mach types. + */ +type char = MACH_MSG_TYPE_CHAR; +type boolean_t = MACH_MSG_TYPE_BOOLEAN; + +#include <mach/machine/machine_types.defs> + +type kern_return_t = int; + +type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE + ctype: vm_offset_t; + + +type mach_port_t = MACH_MSG_TYPE_COPY_SEND; +type mach_port_array_t = array[] of mach_port_t; + +type mach_port_name_t = MACH_MSG_TYPE_PORT_NAME; +type mach_port_name_array_t = array[] of mach_port_name_t; + +type mach_port_right_t = natural_t; + +type mach_port_type_t = natural_t; +type mach_port_type_array_t = array[] of mach_port_type_t; + +type mach_port_urefs_t = natural_t; +type mach_port_delta_t = integer_t; +type mach_port_seqno_t = natural_t; +type mach_port_mscount_t = unsigned; +type mach_port_msgcount_t = unsigned; +type mach_port_rights_t = unsigned; +type mach_msg_id_t = integer_t; +type mach_msg_size_t = natural_t; +type mach_msg_type_name_t = unsigned; +type mach_msg_options_t = integer_t; + +type mach_port_move_receive_t = MACH_MSG_TYPE_MOVE_RECEIVE + ctype: mach_port_t; +type mach_port_copy_send_t = MACH_MSG_TYPE_COPY_SEND + ctype: mach_port_t; +type mach_port_make_send_t = MACH_MSG_TYPE_MAKE_SEND + ctype: mach_port_t; +type mach_port_move_send_t = MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t; +type mach_port_make_send_once_t = MACH_MSG_TYPE_MAKE_SEND_ONCE + ctype: mach_port_t; +type mach_port_move_send_once_t = MACH_MSG_TYPE_MOVE_SEND_ONCE + ctype: mach_port_t; + +type mach_port_receive_t = MACH_MSG_TYPE_PORT_RECEIVE + ctype: mach_port_t; +type mach_port_send_t = MACH_MSG_TYPE_PORT_SEND + ctype: mach_port_t; +type mach_port_send_once_t = MACH_MSG_TYPE_PORT_SEND_ONCE + ctype: mach_port_t; + +type mach_port_poly_t = polymorphic + ctype: mach_port_t; + +import <mach/std_types.h>; +import <mach/mig.h>; + +#endif /* _MACH_STD_TYPES_DEFS_ */ + +/* vim: set ft=c : */ diff --git a/i386/include/mach/std_types.h b/i386/include/mach/std_types.h new file mode 100644 index 0000000..f5b838a --- /dev/null +++ b/i386/include/mach/std_types.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * Mach standard external interface type definitions. + * + */ + +#ifndef _MACH_STD_TYPES_H_ +#define _MACH_STD_TYPES_H_ + +#include <stdint.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/port.h> +#include <mach/vm_types.h> + +#endif /* _MACH_STD_TYPES_H_ */ diff --git a/i386/include/mach/sync.h b/i386/include/mach/sync.h new file mode 100644 index 0000000..0a567c2 --- /dev/null +++ b/i386/include/mach/sync.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +** This file contains compatibilty wrapper header for things that used +** to be generated from mach/sync.defs. Now that code is split into two +** different interface generator files, so include the two resulting +** headers here. +*/ +#include <mach/semaphore.h> +#include <mach/lock_set.h> diff --git a/i386/include/mach/sync_policy.h b/i386/include/mach/sync_policy.h new file mode 100644 index 0000000..1fd8d3f --- /dev/null +++ b/i386/include/mach/sync_policy.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_SYNC_POLICY_H_ +#define _MACH_SYNC_POLICY_H_ + +typedef int sync_policy_t; + +/* + * These options define the wait ordering of the synchronizers + */ +#define SYNC_POLICY_FIFO 0x0 +#define SYNC_POLICY_FIXED_PRIORITY 0x1 +#define SYNC_POLICY_REVERSED 0x2 +#define SYNC_POLICY_ORDER_MASK 0x3 +#define SYNC_POLICY_LIFO (SYNC_POLICY_FIFO|SYNC_POLICY_REVERSED) + + +#define SYNC_POLICY_MAX 0x7 + +#endif /* _MACH_SYNC_POLICY_H_ */ diff --git a/i386/include/mach/task.defs b/i386/include/mach/task.defs new file mode 100644 index 0000000..ceebc95 --- /dev/null +++ b/i386/include/mach/task.defs @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + task 3400; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +/* + * Create a new task with an empty set of IPC rights, + * and having an address space constructed from the + * target task (or empty, if inherit_memory is FALSE). + */ +routine task_create( + target_task : task_t; + ledgers : ledger_array_t; + inherit_memory : boolean_t; + out child_task : task_t); + +/* + * Destroy the target task, causing all of its threads + * to be destroyed, all of its IPC rights to be deallocated, + * and all of its address space to be deallocated. + */ +routine task_terminate( + target_task : task_t); + +/* + * Returns the set of threads belonging to the target task. + */ +routine task_threads( + target_task : task_t; + out act_list : thread_act_array_t); + +/* + * Stash a handful of ports for the target task; child + * tasks inherit this stash at task_create time. + */ +routine mach_ports_register( + target_task : task_t; + init_port_set : mach_port_array_t = + ^array[] of mach_port_t); + +/* + * Retrieve the stashed ports for the target task. + */ +routine mach_ports_lookup( + target_task : task_t; + out init_port_set : mach_port_array_t = + ^array[] of mach_port_t); + +/* + * Returns information about the target task. + */ +routine task_info( + target_task : task_name_t; + flavor : task_flavor_t; + out task_info_out : task_info_t, CountInOut); + +/* + * Set task information. + */ +routine task_set_info( + target_task : task_t; + flavor : task_flavor_t; + task_info_in : task_info_t); + +/* + * Increment the suspend count for the target task. + * No threads within a task may run when the suspend + * count for that task is non-zero. + */ +routine task_suspend( + target_task : task_t); + + +/* + * Decrement the suspend count for the target task, + * if the count is currently non-zero. If the resulting + * suspend count is zero, then threads within the task + * that also have non-zero suspend counts may execute. + */ +routine task_resume( + target_task : task_t); + +/* + * Returns the current value of the selected special port + * associated with the target task. + */ +routine task_get_special_port( + task : task_t; + which_port : int; + out special_port : mach_port_t); + +/* + * Set one of the special ports associated with the + * target task. + */ +routine task_set_special_port( + task : task_t; + which_port : int; + special_port : mach_port_t); + +/* + * Create a new thread within the target task, returning + * the port representing the first thr_act in that new thread. The + * initial execution state of the thread is undefined. + */ +routine thread_create( + parent_task : task_t; + out child_act : thread_act_t); + +/* + * Create a new thread within the target task, returning + * the port representing that new thread. The new thread + * is not suspended; its initial execution state is given + * by flavor and new_state. Returns the port representing + * the new thread. + */ +routine thread_create_running( + parent_task : task_t; + flavor : thread_state_flavor_t; + new_state : thread_state_t; + out child_act : thread_act_t); + +/* + * Set an exception handler for a task on one or more exception types. + * These handlers are invoked for all threads in the task if there are + * no thread-specific exception handlers or those handlers returned an + * error. + */ +routine task_set_exception_ports( + task : task_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t); + + +/* + * Lookup some of the old exception handlers for a task + */ +routine task_get_exception_ports( + task : task_t; + exception_mask : exception_mask_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + + +/* + * Set an exception handler for a thread on one or more exception types. + * At the same time, return the previously defined exception handlers for + * those types. + */ +routine task_swap_exception_ports( + task : task_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t; + out masks : exception_mask_array_t; + out old_handlerss : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * Create and destroy lock_set and semaphore synchronizers on a + * per-task basis (i.e. the task owns them). + */ +routine lock_set_create( + task : task_t; + out new_lock_set : lock_set_t; + n_ulocks : int; + policy : int); + +routine lock_set_destroy( + task : task_t; + lock_set : lock_set_t); + +routine semaphore_create( + task : task_t; + out semaphore : semaphore_t; + policy : int; + value : int); + +routine semaphore_destroy( + task : task_t; + semaphore : semaphore_consume_ref_t); + +/* + * Set/get policy information for a task. + * (Approved Mac OS X microkernel interface) + */ + +routine task_policy_set( + task : task_t; + flavor : task_policy_flavor_t; + policy_info : task_policy_t); + +routine task_policy_get( + task : task_t; + flavor : task_policy_flavor_t; +out policy_info : task_policy_t, CountInOut; +inout get_default : boolean_t); + +/* + * Removed from the kernel. + */ +#if KERNEL_SERVER +skip; +#else +routine task_sample( + task : task_t; + reply : mach_port_make_send_t); +#endif + +/* + * JMM - Everything from here down is likely to go away soon + */ +/* + * OBSOLETE interface. + */ +routine task_policy( + task : task_t; + policy : policy_t; + base : policy_base_t; + set_limit : boolean_t; + change : boolean_t); + + +/* + * Establish a user-level handler for the specified + * system call. + */ +routine task_set_emulation( + target_port : task_t; + routine_entry_pt: vm_address_t; + routine_number : int); + +/* + * Get user-level handler entry points for all + * emulated system calls. + */ +routine task_get_emulation_vector( + task : task_t; + out vector_start : int; + out emulation_vector: emulation_vector_t); + +/* + * Establish user-level handlers for the specified + * system calls. Non-emulated system calls are specified + * with emulation_vector[i] == EML_ROUTINE_NULL. + */ +routine task_set_emulation_vector( + task : task_t; + vector_start : int; + emulation_vector: emulation_vector_t); + + +/* + * Establish restart pc for interrupted atomic sequences. + */ +routine task_set_ras_pc( + target_task : task_t; + basepc : vm_address_t; + boundspc : vm_address_t); + + +skip; /* was kernel_task_create() */ + +/* + * JMM - Want to eliminate processor_set so keep them at the end. + */ + +/* + * Assign task to processor set. + */ +routine task_assign( + task : task_t; + new_set : processor_set_t; + assign_threads : boolean_t); + +/* + * Assign task to default set. + */ +routine task_assign_default( + task : task_t; + assign_threads : boolean_t); + +/* + * Get current assignment for task. + */ +routine task_get_assignment( + task : task_t; + out assigned_set : processor_set_name_t); + +/* + * OBSOLETE interface. + */ +routine task_set_policy( + task : task_t; + pset : processor_set_t; + policy : policy_t; + base : policy_base_t; + limit : policy_limit_t; + change : boolean_t); + +/* + * Read the selected state which is to be installed on new + * threads in the task as they are created. + */ +routine task_get_state( + task : task_t; + flavor : thread_state_flavor_t; + out old_state : thread_state_t, CountInOut); + +/* + * Set the selected state information to be installed on + * all subsequently created threads in the task. + */ +routine task_set_state( + task : task_t; + flavor : thread_state_flavor_t; + new_state : thread_state_t); + + +/* vim: set ft=c : */ diff --git a/i386/include/mach/task.h b/i386/include/mach/task.h new file mode 100644 index 0000000..459a330 --- /dev/null +++ b/i386/include/mach/task.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined(__i386__) +#include <mach/i386/task.h> +#elif defined(__x86_64__) +#include <mach/x86_64/task.h> +#elif defined(__ppc__) +#include <mach/ppc/task.h> +#elif defined(__ppc64__) +#include <mach/ppc64/task.h> +#elif defined(__arm__) +#include <mach/arm/task.h> +#else +#error unknown architecture +#endif diff --git a/i386/include/mach/task_access.defs b/i386/include/mach/task_access.defs new file mode 100644 index 0000000..1696fd3 --- /dev/null +++ b/i386/include/mach/task_access.defs @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +subsystem +#if KERNEL_USER + KernelUser +#endif /* KERN_USER */ + task_access 27000; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Verify task_for_pid access for the given pid + * Access granted by return value (success/failure) + */ +routine check_task_access( + task_access_port : mach_port_t; + calling_pid : int32_t; + calling_gid : uint32_t; + target_pid : int32_t; + ServerAuditToken caller_cred : audit_token_t); + +/* + * Search for a code signature for unsigned executables + */ +routine find_code_signature( + task_access_port : mach_port_t; + new_pid : int32_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/task_info.h b/i386/include/mach/task_info.h new file mode 100644 index 0000000..cab9c17 --- /dev/null +++ b/i386/include/mach/task_info.h @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * Machine-independent task information structures and definitions. + * + * The definitions in this file are exported to the user. The kernel + * will translate its internal data structures to these structures + * as appropriate. + * + */ + +#ifndef _MACH_TASK_INFO_H_ +#define _MACH_TASK_INFO_H_ + +#include <mach/message.h> +#include <mach/machine/vm_types.h> +#include <mach/time_value.h> +#include <mach/policy.h> + +#include <sys/cdefs.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef natural_t task_flavor_t; +typedef integer_t *task_info_t; /* varying array of int */ + +#define TASK_INFO_MAX (1024) /* maximum array size */ +typedef integer_t task_info_data_t[TASK_INFO_MAX]; + +/* + * Currently defined information structures. + */ + +#pragma pack(4) + +#define TASK_BASIC_INFO_32 4 /* basic information */ +#define TASK_BASIC2_INFO_32 6 + +struct task_basic_info_32 { + integer_t suspend_count; /* suspend count for task */ + natural_t virtual_size; /* virtual memory size (bytes) */ + natural_t resident_size; /* resident memory size (bytes) */ + time_value_t user_time; /* total user run time for + terminated threads */ + time_value_t system_time; /* total system run time for + terminated threads */ + policy_t policy; /* default policy for new threads */ +}; +typedef struct task_basic_info_32 task_basic_info_32_data_t; +typedef struct task_basic_info_32 *task_basic_info_32_t; +#define TASK_BASIC_INFO_32_COUNT \ + (sizeof(task_basic_info_32_data_t) / sizeof(natural_t)) + + +#define TASK_BASIC_INFO_64 5 /* 64-bit capable basic info */ + +struct task_basic_info_64 { + integer_t suspend_count; /* suspend count for task */ + mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ + mach_vm_size_t resident_size; /* resident memory size (bytes) */ + time_value_t user_time; /* total user run time for + terminated threads */ + time_value_t system_time; /* total system run time for + terminated threads */ + policy_t policy; /* default policy for new threads */ +}; +typedef struct task_basic_info_64 task_basic_info_64_data_t; +typedef struct task_basic_info_64 *task_basic_info_64_t; +#define TASK_BASIC_INFO_64_COUNT \ + (sizeof(task_basic_info_64_data_t) / sizeof(natural_t)) + + +/* localized structure - cannot be safely passed between tasks of differing sizes */ + +struct task_basic_info { + integer_t suspend_count; /* suspend count for task */ + vm_size_t virtual_size; /* virtual memory size (bytes) */ + vm_size_t resident_size; /* resident memory size (bytes) */ + time_value_t user_time; /* total user run time for + terminated threads */ + time_value_t system_time; /* total system run time for + terminated threads */ + policy_t policy; /* default policy for new threads */ +}; + +typedef struct task_basic_info task_basic_info_data_t; +typedef struct task_basic_info *task_basic_info_t; +#define TASK_BASIC_INFO_COUNT \ + (sizeof(task_basic_info_data_t) / sizeof(natural_t)) +#if !defined(__LP64__) +#define TASK_BASIC_INFO TASK_BASIC_INFO_32 +#else +#define TASK_BASIC_INFO TASK_BASIC_INFO_64 +#endif + + + +#define TASK_EVENTS_INFO 2 /* various event counts */ + +struct task_events_info { + integer_t faults; /* number of page faults */ + integer_t pageins; /* number of actual pageins */ + integer_t cow_faults; /* number of copy-on-write faults */ + integer_t messages_sent; /* number of messages sent */ + integer_t messages_received; /* number of messages received */ + integer_t syscalls_mach; /* number of mach system calls */ + integer_t syscalls_unix; /* number of unix system calls */ + integer_t csw; /* number of context switches */ +}; +typedef struct task_events_info task_events_info_data_t; +typedef struct task_events_info *task_events_info_t; +#define TASK_EVENTS_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(task_events_info_data_t) / sizeof(natural_t))) + +#define TASK_THREAD_TIMES_INFO 3 /* total times for live threads - + only accurate if suspended */ + +struct task_thread_times_info { + time_value_t user_time; /* total user run time for + live threads */ + time_value_t system_time; /* total system run time for + live threads */ +}; + +typedef struct task_thread_times_info task_thread_times_info_data_t; +typedef struct task_thread_times_info *task_thread_times_info_t; +#define TASK_THREAD_TIMES_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(task_thread_times_info_data_t) / sizeof(natural_t))) + +#define TASK_ABSOLUTETIME_INFO 1 + +struct task_absolutetime_info { + uint64_t total_user; /* total time */ + uint64_t total_system; + uint64_t threads_user; /* existing threads only */ + uint64_t threads_system; +}; + +typedef struct task_absolutetime_info task_absolutetime_info_data_t; +typedef struct task_absolutetime_info *task_absolutetime_info_t; +#define TASK_ABSOLUTETIME_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof (task_absolutetime_info_data_t) / sizeof (natural_t))) + +#define TASK_SECURITY_TOKEN 13 +#define TASK_SECURITY_TOKEN_COUNT ((mach_msg_type_number_t) \ + (sizeof(security_token_t) / sizeof(natural_t))) + +#define TASK_AUDIT_TOKEN 15 +#define TASK_AUDIT_TOKEN_COUNT \ + (sizeof(audit_token_t) / sizeof(natural_t)) + + +#define TASK_AFFINITY_TAG_INFO 16 /* This is experimental. */ + +struct task_affinity_tag_info { + integer_t set_count; + integer_t min; + integer_t max; + integer_t task_count; +}; +typedef struct task_affinity_tag_info task_affinity_tag_info_data_t; +typedef struct task_affinity_tag_info *task_affinity_tag_info_t; +#define TASK_AFFINITY_TAG_INFO_COUNT \ + (sizeof(task_affinity_tag_info_data_t) / sizeof(natural_t)) + +#define TASK_DYLD_INFO 17 /* This is experimental. */ + +struct task_dyld_info { + mach_vm_address_t all_image_info_addr; + mach_vm_size_t all_image_info_size; +}; +typedef struct task_dyld_info task_dyld_info_data_t; +typedef struct task_dyld_info *task_dyld_info_t; +#define TASK_DYLD_INFO_COUNT \ + (sizeof(task_dyld_info_data_t) / sizeof(natural_t)) + +#pragma pack() + + +/* + * Obsolete interfaces. + */ + +#define TASK_SCHED_TIMESHARE_INFO 10 +#define TASK_SCHED_RR_INFO 11 +#define TASK_SCHED_FIFO_INFO 12 + +#define TASK_SCHED_INFO 14 + +#endif /* _MACH_TASK_INFO_H_ */ diff --git a/i386/include/mach/task_ledger.h b/i386/include/mach/task_ledger.h new file mode 100644 index 0000000..5d4bc25 --- /dev/null +++ b/i386/include/mach/task_ledger.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ + +#ifndef _MACH_TASK_LEDGER_H_ +#define _MACH_TASK_LEDGER_H_ + +/* + * Evolving and likely to change. + */ + +/* + * Definitions for task ledger line items + */ +#define ITEM_THREADS 0 /* number of threads */ +#define ITEM_TASKS 1 /* number of tasks */ + +#define ITEM_VM 2 /* virtual space (bytes)*/ + +#define LEDGER_N_ITEMS 3 /* Total line items */ + +#define LEDGER_UNLIMITED 0 /* ignored item.maximum */ + +#endif /* _MACH_TASK_LEDGER_H_ */ diff --git a/i386/include/mach/task_policy.h b/i386/include/mach/task_policy.h new file mode 100644 index 0000000..3a2fb39 --- /dev/null +++ b/i386/include/mach/task_policy.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_TASK_POLICY_H_ +#define _MACH_TASK_POLICY_H_ + +#include <mach/mach_types.h> + +/* + * These are the calls for accessing the policy parameters + * of a particular task. + * + * The extra 'get_default' parameter to the second call is + * IN/OUT as follows: + * 1) if asserted on the way in it indicates that the default + * values should be returned, not the ones currently set, in + * this case 'get_default' will always be asserted on return; + * 2) if unasserted on the way in, the current settings are + * desired and if still unasserted on return, then the info + * returned reflects the current settings, otherwise if + * 'get_default' returns asserted, it means that there are no + * current settings due to other parameters taking precedence, + * and the default ones are being returned instead. + */ + +typedef natural_t task_policy_flavor_t; +typedef integer_t *task_policy_t; + +/* +kern_return_t task_policy_set( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t count); + +kern_return_t task_policy_get( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *count, + boolean_t *get_default); +*/ + +/* + * Defined flavors. + */ +/* + * TASK_CATEGORY_POLICY: + * + * This provides information to the kernel about the role + * of the task in the system. + * + * Parameters: + * + * role: Enumerated as follows: + * + * TASK_UNSPECIFIED is the default, since the role is not + * inherited from the parent. + * + * TASK_FOREGROUND_APPLICATION should be assigned when the + * task is a normal UI application in the foreground from + * the HI point of view. + * **N.B. There may be more than one of these at a given time. + * + * TASK_BACKGROUND_APPLICATION should be assigned when the + * task is a normal UI application in the background from + * the HI point of view. + * + * TASK_CONTROL_APPLICATION should be assigned to the unique + * UI application which implements the pop-up application dialog. + * There can only be one task at a time with this designation, + * which is assigned FCFS. + * + * TASK_GRAPHICS_SERVER should be assigned to the graphics + * management (window) server. There can only be one task at + * a time with this designation, which is assigned FCFS. + */ + +#define TASK_CATEGORY_POLICY 1 + +enum task_role { + TASK_RENICED = -1, + TASK_UNSPECIFIED = 0, + TASK_FOREGROUND_APPLICATION, + TASK_BACKGROUND_APPLICATION, + TASK_CONTROL_APPLICATION, + TASK_GRAPHICS_SERVER, + TASK_THROTTLE_APPLICATION, + TASK_DEFAULT_APPLICATION +}; + +typedef enum task_role task_role_t; + +struct task_category_policy { + task_role_t role; +}; + +typedef struct task_category_policy task_category_policy_data_t; +typedef struct task_category_policy *task_category_policy_t; + +#define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (task_category_policy_data_t) / sizeof (integer_t))) + +#endif /* _MACH_TASK_POLICY_H_ */ diff --git a/i386/include/mach/task_special_ports.h b/i386/include/mach/task_special_ports.h new file mode 100644 index 0000000..ec980cf --- /dev/null +++ b/i386/include/mach/task_special_ports.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/task_special_ports.h + * + * Defines codes for special_purpose task ports. These are NOT + * port identifiers - they are only used for the task_get_special_port + * and task_set_special_port routines. + * + */ + +#ifndef _MACH_TASK_SPECIAL_PORTS_H_ +#define _MACH_TASK_SPECIAL_PORTS_H_ + +typedef int task_special_port_t; + +#define TASK_KERNEL_PORT 1 /* Represents task to the outside + world.*/ + +#define TASK_HOST_PORT 2 /* The host (priv) port for task. */ + +#define TASK_NAME_PORT 3 /* the name (unpriv) port for task */ + +#define TASK_BOOTSTRAP_PORT 4 /* Bootstrap environment for task. */ + +/* + * Evolving and likely to change. + */ + +#define TASK_WIRED_LEDGER_PORT 5 /* Wired resource ledger for task. */ + +#define TASK_PAGED_LEDGER_PORT 6 /* Paged resource ledger for task. */ + +#define TASK_SEATBELT_PORT 7 /* Seatbelt compiler/DEM port for task. */ + +#define TASK_GSSD_PORT 8 /* GSSD port for security context */ + +#define TASK_ACCESS_PORT 9 /* Permission check for task_for_pid. */ + +#define task_get_wired_ledger_port(task, port) \ + (task_get_special_port((task), TASK_WIRED_LEDGER_PORT, (port))) + +#define task_set_wired_ledger_port(task, port) \ + (task_set_special_port((task), TASK_WIRED_LEDGER_PORT, (port))) + +#define task_get_paged_ledger_port(task, port) \ + (task_get_special_port((task), TASK_PAGED_LEDGER_PORT, (port))) + +#define task_set_paged_ledger_port(task, port) \ + (task_set_special_port((task), TASK_PAGED_LEDGER_PORT, (port))) + +/* + * Definitions for ease of use + */ + +#define task_get_kernel_port(task, port) \ + (task_get_special_port((task), TASK_KERNEL_PORT, (port))) + +#define task_set_kernel_port(task, port) \ + (task_set_special_port((task), TASK_KERNEL_PORT, (port))) + +#define task_get_host_port(task, port) \ + (task_get_special_port((task), TASK_HOST_PORT, (port))) + +#define task_set_host_port(task, port) \ + (task_set_special_port((task), TASK_HOST_PORT, (port))) + +#define task_get_bootstrap_port(task, port) \ + (task_get_special_port((task), TASK_BOOTSTRAP_PORT, (port))) + +#define task_set_bootstrap_port(task, port) \ + (task_set_special_port((task), TASK_BOOTSTRAP_PORT, (port))) + +#define task_get_gssd_port(task, port) \ + (task_get_special_port((task), TASK_GSSD_PORT, (port))) + +#define task_set_gssd_port(task, port) \ + (task_set_special_port((task), TASK_GSSD_PORT, (port))) + +#define task_get_task_access_port(task, port) \ + (task_get_special_port((task), TASK_ACCESS_PORT, (port))) + +#define task_set_task_access_port(task, port) \ + (task_set_special_port((task), TASK_ACCESS_PORT, (port))) + +#endif /* _MACH_TASK_SPECIAL_PORTS_H_ */ diff --git a/i386/include/mach/thread_act.defs b/i386/include/mach/thread_act.defs new file mode 100644 index 0000000..47a21a9 --- /dev/null +++ b/i386/include/mach/thread_act.defs @@ -0,0 +1,323 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/mach_port.defs + * Author: Rich Draves + * + * Exported kernel calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + thread_act 3600; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> + +/* + * Destroy the target thread. + * + * JMM - For legacy reasons this consumes a reference to the + * target thread. This will have to change in the future because + * we want the interfaces to be able to be defined in more standard + * IDLs and transports, and most of them do not support the notion + * of reference ownership transfers (just sharing). + */ +routine thread_terminate( + target_act : thread_act_consume_ref_t); + + +/* + * Return the selected state information for the target + * thr_act. If the thr_act is currently executing, the results + * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a + * list of valid flavors for the target thread.] + */ +routine act_get_state( + target_act : thread_act_t; + flavor : int; + out old_state : thread_state_t, CountInOut); + +/* + * Set the selected state information for the target thread. + * If the thread is currently executing, the state change + * may be ill-defined. + */ +routine act_set_state( + target_act : thread_act_t; + flavor : int; + new_state : thread_state_t); + +/* + * Backward compatible old-style thread routines. + * These have different semantics than the new activation versions. + * + * Return the selected state information for the target + * thread. If the thread is currently executing, the results + * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a + * list of valid flavors for the target thr_act.] + */ +routine thread_get_state( + target_act : thread_act_t; + flavor : thread_state_flavor_t; + out old_state : thread_state_t, CountInOut); + +/* + * Set the selected state information for the target thread. + * If the thread is currently executing, the state change + * may be ill-defined. + */ +routine thread_set_state( + target_act : thread_act_t; + flavor : thread_state_flavor_t; + new_state : thread_state_t); + +/* + * Increment the suspend count for the target thread. + * Once this call has completed, the thread will not + * execute any further user or meta- instructions. + * Once suspended, a thread may not execute again until + * its suspend count is zero, and the suspend count + * for its task is also zero. + */ +routine thread_suspend( + target_act : thread_act_t); + +/* + * Decrement the suspend count for the target thread, + * if that count is not already zero. + */ +routine thread_resume( + target_act : thread_act_t); + +/* + * Cause any user or meta- instructions currently being + * executed by the target thread to be aborted. [Meta- + * instructions consist of the basic traps for IPC + * (e.g., msg_send, msg_receive) and self-identification + * (e.g., task_self, thread_self, thread_reply). Calls + * described by MiG interfaces are not meta-instructions + * themselves.] + */ +routine thread_abort( + target_act : thread_act_t); + +/* + * Cause any user or meta- instructions currently being + * executed by the target thread to be aborted so that + * they are transparently restartable. This call fails + * if the abort would result in a non-restartable condition. + * Retry is the caller's responsibility. [Meta- + * instructions consist of the basic traps for IPC + * (e.g., msg_send, msg_receive) and self-identification + * (e.g., task_self, thread_self, thread_reply). Calls + * described by MiG interfaces are not meta-instructions + * themselves.] + */ +routine thread_abort_safely( + target_act : thread_act_t); + + +routine thread_depress_abort( + thread : thread_act_t); + + +/* + * Returns the current value of the selected special port + * associated with the target thread. + */ +routine thread_get_special_port( + thr_act : thread_act_t; + which_port : int; + out special_port : mach_port_t); + +/* + * Set one of the special ports associated with the + * target thread. + */ +routine thread_set_special_port( + thr_act : thread_act_t; + which_port : int; + special_port : mach_port_t); + +/* + * Returns information about the target thread. + */ +routine thread_info( + target_act : thread_act_t; + flavor : thread_flavor_t; + out thread_info_out : thread_info_t, CountInOut); + +/* + * Set an exception handler for a thread on one or more exception types + */ +routine thread_set_exception_ports( + thread : thread_act_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t); + +/* + * Lookup some of the old exception handlers for a thread + */ +routine thread_get_exception_ports( + thread : thread_act_t; + exception_mask : exception_mask_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * Set an exception handler for a thread on one or more exception types. + * At the same time, return the previously defined exception handlers for + * those types. + */ +routine thread_swap_exception_ports( + thread : thread_act_t; + exception_mask : exception_mask_t; + new_port : mach_port_t; + behavior : exception_behavior_t; + new_flavor : thread_state_flavor_t; + out masks : exception_mask_array_t; + out old_handlers : exception_handler_array_t, SameCount; + out old_behaviors : exception_behavior_array_t, SameCount; + out old_flavors : exception_flavor_array_t, SameCount); + +/* + * OBSOLETE interface. + */ +routine thread_policy( + thr_act : thread_act_t; + policy : policy_t; + base : policy_base_t; + set_limit : boolean_t); + +/* + * Set/get policy information for a thread. + * (Approved Mac OS X microkernel interface) + */ + +routine thread_policy_set( + thread : thread_act_t; + flavor : thread_policy_flavor_t; + policy_info : thread_policy_t); + +routine thread_policy_get( + thread : thread_act_t; + flavor : thread_policy_flavor_t; +out policy_info : thread_policy_t, CountInOut; +inout get_default : boolean_t); + +/* + * Removed from the kernel. + */ +#if KERNEL_SERVER +skip; +#else +routine thread_sample( + thread : thread_act_t; + reply : mach_port_make_send_t); +#endif + +/* + * ETAP has been removed from the kernel. + */ +#if KERNEL_SERVER +skip; +#else +routine etap_trace_thread( + target_act : thread_act_t; + trace_status : boolean_t); +#endif + +/* + * Assign thread to processor set. + */ +routine thread_assign( + thread : thread_act_t; + new_set : processor_set_t); + +/* + * Assign thread to default set. + */ +routine thread_assign_default( + thread : thread_act_t); + +/* + * Get current assignment for thread. + */ +routine thread_get_assignment( + thread : thread_act_t; + out assigned_set : processor_set_name_t); + + +/* + * OBSOLETE interface. + */ +routine thread_set_policy( + thr_act : thread_act_t; + pset : processor_set_t; + policy : policy_t; + base : policy_base_t; + limit : policy_limit_t); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/thread_act.h b/i386/include/mach/thread_act.h new file mode 100644 index 0000000..ac2309b --- /dev/null +++ b/i386/include/mach/thread_act.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined(__i386__) +#include <mach/i386/thread_act.h> +#elif defined(__x86_64__) +#include <mach/x86_64/thread_act.h> +#elif defined(__ppc__) +#include <mach/ppc/thread_act.h> +#elif defined(__ppc64__) +#include <mach/ppc64/thread_act.h> +#elif defined(__arm__) +#include <mach/arm/thread_act.h> +#else +#error unknown architecture +#endif diff --git a/i386/include/mach/thread_info.h b/i386/include/mach/thread_info.h new file mode 100644 index 0000000..5f51aea --- /dev/null +++ b/i386/include/mach/thread_info.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/thread_info + * + * Thread information structure and definitions. + * + * The defintions in this file are exported to the user. The kernel + * will translate its internal data structures to these structures + * as appropriate. + * + */ + +#ifndef _MACH_THREAD_INFO_H_ +#define _MACH_THREAD_INFO_H_ + +#include <mach/boolean.h> +#include <mach/policy.h> +#include <mach/time_value.h> +#include <mach/message.h> +#include <mach/machine/vm_types.h> + +/* + * Generic information structure to allow for expansion. + */ +typedef natural_t thread_flavor_t; +typedef integer_t *thread_info_t; /* varying array of int */ + +#define THREAD_INFO_MAX (1024) /* maximum array size */ +typedef integer_t thread_info_data_t[THREAD_INFO_MAX]; + +/* + * Currently defined information. + */ +#define THREAD_BASIC_INFO 3 /* basic information */ + +struct thread_basic_info { + time_value_t user_time; /* user run time */ + time_value_t system_time; /* system run time */ + integer_t cpu_usage; /* scaled cpu usage percentage */ + policy_t policy; /* scheduling policy in effect */ + integer_t run_state; /* run state (see below) */ + integer_t flags; /* various flags (see below) */ + integer_t suspend_count; /* suspend count for thread */ + integer_t sleep_time; /* number of seconds that thread + has been sleeping */ +}; + +typedef struct thread_basic_info thread_basic_info_data_t; +typedef struct thread_basic_info *thread_basic_info_t; +#define THREAD_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(thread_basic_info_data_t) / sizeof(natural_t))) + +#define THREAD_IDENTIFIER_INFO 4 /* thread id and other information */ + +struct thread_identifier_info { + uint64_t thread_id; /* system-wide unique 64-bit thread id */ + uint64_t thread_handle; /* handle to be used by libproc */ + uint64_t dispatch_qaddr; /* libdispatch queue address */ +}; + +typedef struct thread_identifier_info thread_identifier_info_data_t; +typedef struct thread_identifier_info *thread_identifier_info_t; +#define THREAD_IDENTIFIER_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(thread_identifier_info_data_t) / sizeof(natural_t))) + +/* + * Scale factor for usage field. + */ + +#define TH_USAGE_SCALE 1000 + +/* + * Thread run states (state field). + */ + +#define TH_STATE_RUNNING 1 /* thread is running normally */ +#define TH_STATE_STOPPED 2 /* thread is stopped */ +#define TH_STATE_WAITING 3 /* thread is waiting normally */ +#define TH_STATE_UNINTERRUPTIBLE 4 /* thread is in an uninterruptible + wait */ +#define TH_STATE_HALTED 5 /* thread is halted at a + clean point */ + +/* + * Thread flags (flags field). + */ +#define TH_FLAGS_SWAPPED 0x1 /* thread is swapped out */ +#define TH_FLAGS_IDLE 0x2 /* thread is an idle thread */ + +/* + * Obsolete interfaces. + */ + +#define THREAD_SCHED_TIMESHARE_INFO 10 +#define THREAD_SCHED_RR_INFO 11 +#define THREAD_SCHED_FIFO_INFO 12 + +#endif /* _MACH_THREAD_INFO_H_ */ diff --git a/i386/include/mach/thread_policy.h b/i386/include/mach/thread_policy.h new file mode 100644 index 0000000..d9530b7 --- /dev/null +++ b/i386/include/mach/thread_policy.h @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _MACH_THREAD_POLICY_H_ +#define _MACH_THREAD_POLICY_H_ + +#include <mach/mach_types.h> + +/* + * These are the calls for accessing the policy parameters + * of a particular thread. + * + * The extra 'get_default' parameter to the second call is + * IN/OUT as follows: + * 1) if asserted on the way in it indicates that the default + * values should be returned, not the ones currently set, in + * this case 'get_default' will always be asserted on return; + * 2) if unasserted on the way in, the current settings are + * desired and if still unasserted on return, then the info + * returned reflects the current settings, otherwise if + * 'get_default' returns asserted, it means that there are no + * current settings due to other parameters taking precedence, + * and the default ones are being returned instead. + */ + +typedef natural_t thread_policy_flavor_t; +typedef integer_t *thread_policy_t; + +/* +kern_return_t thread_policy_set( + thread_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t count); + +kern_return_t thread_policy_get( + thread_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *count, + boolean_t *get_default); +*/ + +/* + * Defined flavors. + */ +/* + * THREAD_STANDARD_POLICY: + * + * This is the standard (fair) scheduling mode, assigned to new + * threads. The thread will be given processor time in a manner + * which apportions approximately equal share to long running + * computations. + * + * Parameters: + * [none] + */ + +#define THREAD_STANDARD_POLICY 1 + +struct thread_standard_policy { + natural_t no_data; +}; + +typedef struct thread_standard_policy thread_standard_policy_data_t; +typedef struct thread_standard_policy *thread_standard_policy_t; + +#define THREAD_STANDARD_POLICY_COUNT 0 + +/* + * THREAD_EXTENDED_POLICY: + * + * Extended form of THREAD_STANDARD_POLICY, which supplies a + * hint indicating whether this is a long running computation. + * + * Parameters: + * + * timeshare: TRUE (the default) results in identical scheduling + * behavior as THREAD_STANDARD_POLICY. + */ + +#define THREAD_EXTENDED_POLICY 1 + +struct thread_extended_policy { + boolean_t timeshare; +}; + +typedef struct thread_extended_policy thread_extended_policy_data_t; +typedef struct thread_extended_policy *thread_extended_policy_t; + +#define THREAD_EXTENDED_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_extended_policy_data_t) / sizeof (integer_t))) + +/* + * THREAD_TIME_CONSTRAINT_POLICY: + * + * This scheduling mode is for threads which have real time + * constraints on their execution. + * + * Parameters: + * + * period: This is the nominal amount of time between separate + * processing arrivals, specified in absolute time units. A + * value of 0 indicates that there is no inherent periodicity in + * the computation. + * + * computation: This is the nominal amount of computation + * time needed during a separate processing arrival, specified + * in absolute time units. + * + * constraint: This is the maximum amount of real time that + * may elapse from the start of a separate processing arrival + * to the end of computation for logically correct functioning, + * specified in absolute time units. Must be (>= computation). + * Note that latency = (constraint - computation). + * + * preemptible: This indicates that the computation may be + * interrupted, subject to the constraint specified above. + */ + +#define THREAD_TIME_CONSTRAINT_POLICY 2 + +struct thread_time_constraint_policy { + uint32_t period; + uint32_t computation; + uint32_t constraint; + boolean_t preemptible; +}; + +typedef struct thread_time_constraint_policy \ + thread_time_constraint_policy_data_t; +typedef struct thread_time_constraint_policy \ + *thread_time_constraint_policy_t; + +#define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_time_constraint_policy_data_t) / sizeof (integer_t))) + +/* + * THREAD_PRECEDENCE_POLICY: + * + * This may be used to indicate the relative value of the + * computation compared to the other threads in the task. + * + * Parameters: + * + * importance: The importance is specified as a signed value. + */ + +#define THREAD_PRECEDENCE_POLICY 3 + +struct thread_precedence_policy { + integer_t importance; +}; + +typedef struct thread_precedence_policy thread_precedence_policy_data_t; +typedef struct thread_precedence_policy *thread_precedence_policy_t; + +#define THREAD_PRECEDENCE_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_precedence_policy_data_t) / sizeof (integer_t))) + +/* + * THREAD_AFFINITY_POLICY: + * + * This policy is experimental. + * This may be used to express affinity relationships + * between threads in the task. Threads with the same affinity tag will + * be scheduled to share an L2 cache if possible. That is, affinity tags + * are a hint to the scheduler for thread placement. + * + * The namespace of affinity tags is generally local to one task. However, + * a child task created after the assignment of affinity tags by its parent + * will share that namespace. In particular, a family of forked processes + * may be created with a shared affinity namespace. + * + * Parameters: + * tag: The affinity set identifier. + */ + +#define THREAD_AFFINITY_POLICY 4 + +struct thread_affinity_policy { + integer_t affinity_tag; +}; + +#define THREAD_AFFINITY_TAG_NULL 0 + +typedef struct thread_affinity_policy thread_affinity_policy_data_t; +typedef struct thread_affinity_policy *thread_affinity_policy_t; + +#define THREAD_AFFINITY_POLICY_COUNT ((mach_msg_type_number_t) \ + (sizeof (thread_affinity_policy_data_t) / sizeof (integer_t))) + +#endif /* _MACH_THREAD_POLICY_H_ */ diff --git a/i386/include/mach/thread_special_ports.h b/i386/include/mach/thread_special_ports.h new file mode 100644 index 0000000..1d44c02 --- /dev/null +++ b/i386/include/mach/thread_special_ports.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/thread_special_ports.h + * + * Defines codes for special_purpose thread ports. These are NOT + * port identifiers - they are only used for the thread_get_special_port + * and thread_set_special_port routines. + * + */ + +#ifndef _MACH_THREAD_SPECIAL_PORTS_H_ +#define _MACH_THREAD_SPECIAL_PORTS_H_ + +#define THREAD_KERNEL_PORT 1 /* Represents the thread to the outside + world.*/ + +/* + * Definitions for ease of use + */ + +#define thread_get_kernel_port(thread, port) \ + (thread_get_special_port((thread), THREAD_KERNEL_PORT, (port))) + +#define thread_set_kernel_port(thread, port) \ + (thread_set_special_port((thread), THREAD_KERNEL_PORT, (port))) + +#endif /* _MACH_THREAD_SPECIAL_PORTS_H_ */ diff --git a/i386/include/mach/thread_status.h b/i386/include/mach/thread_status.h new file mode 100644 index 0000000..aead09b --- /dev/null +++ b/i386/include/mach/thread_status.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/thread_status.h + * Author: Avadis Tevanian, Jr. + * + * This file contains the structure definitions for the user-visible + * thread state. This thread state is examined with the thread_get_state + * kernel call and may be changed with the thread_set_state kernel call. + * + */ + +#ifndef _MACH_THREAD_STATUS_H_ +#define _MACH_THREAD_STATUS_H_ + +/* + * The actual structure that comprises the thread state is defined + * in the machine dependent module. + */ +#include <mach/machine/vm_types.h> +#include <mach/machine/thread_status.h> +#include <mach/machine/thread_state.h> + +/* + * Generic definition for machine-dependent thread status. + */ + +typedef natural_t *thread_state_t; /* Variable-length array */ + +/* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */ +typedef natural_t thread_state_data_t[THREAD_STATE_MAX]; + +#define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */ +#define THREAD_STATE_FLAVOR_LIST_NEW 128 + +typedef int thread_state_flavor_t; +typedef thread_state_flavor_t *thread_state_flavor_array_t; + +#endif /* _MACH_THREAD_STATUS_H_ */ diff --git a/i386/include/mach/thread_switch.h b/i386/include/mach/thread_switch.h new file mode 100644 index 0000000..f555894 --- /dev/null +++ b/i386/include/mach/thread_switch.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ + +#ifndef _MACH_THREAD_SWITCH_H_ +#define _MACH_THREAD_SWITCH_H_ + +#include <mach/mach_types.h> +#include <mach/kern_return.h> +#include <mach/message.h> +#include <mach/mach_traps.h> + +/* + * Constant definitions for thread_switch trap. + */ + +#define SWITCH_OPTION_NONE 0 +#define SWITCH_OPTION_DEPRESS 1 +#define SWITCH_OPTION_WAIT 2 + +#define valid_switch_option(opt) (0 <= (opt) && (opt) <= 2) + +#endif /* _MACH_THREAD_SWITCH_H_ */ diff --git a/i386/include/mach/time_value.h b/i386/include/mach/time_value.h new file mode 100644 index 0000000..e4f912d --- /dev/null +++ b/i386/include/mach/time_value.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ + +#ifndef _MACH_TIME_VALUE_H_ +#define _MACH_TIME_VALUE_H_ + +#include <mach/machine/vm_types.h> + +/* + * Time value returned by kernel. + */ + +struct time_value { + integer_t seconds; + integer_t microseconds; +}; + +typedef struct time_value time_value_t; + +/* + * Macros to manipulate time values. Assume that time values + * are normalized (microseconds <= 999999). + */ +#define TIME_MICROS_MAX (1000000) + +#define time_value_add_usec(val, micros) { \ + if (((val)->microseconds += (micros)) \ + >= TIME_MICROS_MAX) { \ + (val)->microseconds -= TIME_MICROS_MAX; \ + (val)->seconds++; \ + } \ +} + +#define time_value_add(result, addend) { \ + (result)->microseconds += (addend)->microseconds; \ + (result)->seconds += (addend)->seconds; \ + if ((result)->microseconds >= TIME_MICROS_MAX) { \ + (result)->microseconds -= TIME_MICROS_MAX; \ + (result)->seconds++; \ + } \ +} + +#endif /* _MACH_TIME_VALUE_H_ */ diff --git a/i386/include/mach/vm_attributes.h b/i386/include/mach/vm_attributes.h new file mode 100644 index 0000000..2be3233 --- /dev/null +++ b/i386/include/mach/vm_attributes.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_attributes.h + * Author: Alessandro Forin + * + * Virtual memory attributes definitions. + * + * These definitions are in addition to the machine-independent + * ones (e.g. protection), and are only selectively supported + * on specific machine architectures. + * + */ + +#ifndef _MACH_VM_ATTRIBUTES_H_ +#define _MACH_VM_ATTRIBUTES_H_ + +/* + * Types of machine-dependent attributes + */ +typedef unsigned int vm_machine_attribute_t; + +#define MATTR_CACHE 1 /* cachability */ +#define MATTR_MIGRATE 2 /* migrability */ +#define MATTR_REPLICATE 4 /* replicability */ + +/* + * Values for the above, e.g. operations on attribute + */ +typedef int vm_machine_attribute_val_t; + +#define MATTR_VAL_OFF 0 /* (generic) turn attribute off */ +#define MATTR_VAL_ON 1 /* (generic) turn attribute on */ +#define MATTR_VAL_GET 2 /* (generic) return current value */ + +#define MATTR_VAL_CACHE_FLUSH 6 /* flush from all caches */ +#define MATTR_VAL_DCACHE_FLUSH 7 /* flush from data caches */ +#define MATTR_VAL_ICACHE_FLUSH 8 /* flush from instruction caches */ +#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */ +#define MATTR_VAL_CACHE_SYNC 9 /* sync I+D caches */ + +#define MATTR_VAL_GET_INFO 10 /* get page info (stats) */ + +#endif /* _MACH_VM_ATTRIBUTES_H_ */ diff --git a/i386/include/mach/vm_behavior.h b/i386/include/mach/vm_behavior.h new file mode 100644 index 0000000..ec0ee72 --- /dev/null +++ b/i386/include/mach/vm_behavior.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/vm_behavior.h + * + * Virtual memory map behavior definitions. + * + */ + +#ifndef _MACH_VM_BEHAVIOR_H_ +#define _MACH_VM_BEHAVIOR_H_ + +/* + * Types defined: + * + * vm_behavior_t behavior codes. + */ + +typedef int vm_behavior_t; + +/* + * Enumeration of valid values for vm_behavior_t. + * These describe expected page reference behavior for + * for a given range of virtual memory. For implementation + * details see vm/vm_fault.c + */ + + +/* + * The following behaviors affect the memory region's future behavior + * and are stored in the VM map entry data structure. + */ +#define VM_BEHAVIOR_DEFAULT ((vm_behavior_t) 0) /* default */ +#define VM_BEHAVIOR_RANDOM ((vm_behavior_t) 1) /* random */ +#define VM_BEHAVIOR_SEQUENTIAL ((vm_behavior_t) 2) /* forward sequential */ +#define VM_BEHAVIOR_RSEQNTL ((vm_behavior_t) 3) /* reverse sequential */ + +/* + * The following "behaviors" affect the memory region only at the time of the + * call and are not stored in the VM map entry. + */ +#define VM_BEHAVIOR_WILLNEED ((vm_behavior_t) 4) /* will need in near future */ +#define VM_BEHAVIOR_DONTNEED ((vm_behavior_t) 5) /* dont need in near future */ +#define VM_BEHAVIOR_FREE ((vm_behavior_t) 6) /* free memory without write-back */ +#define VM_BEHAVIOR_ZERO_WIRED_PAGES ((vm_behavior_t) 7) /* zero out the wired pages of an entry if it is being deleted without unwiring them first */ +#define VM_BEHAVIOR_REUSABLE ((vm_behavior_t) 8) +#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9) +#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10) + +#endif /*_MACH_VM_BEHAVIOR_H_*/ diff --git a/i386/include/mach/vm_inherit.h b/i386/include/mach/vm_inherit.h new file mode 100644 index 0000000..d6440e4 --- /dev/null +++ b/i386/include/mach/vm_inherit.h @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_inherit.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * + * Virtual memory map inheritance definitions. + * + */ + +#ifndef _MACH_VM_INHERIT_H_ +#define _MACH_VM_INHERIT_H_ + +/* + * Types defined: + * + * vm_inherit_t inheritance codes. + */ + +typedef unsigned int vm_inherit_t; /* might want to change this */ + +/* + * Enumeration of valid values for vm_inherit_t. + */ + +#define VM_INHERIT_SHARE ((vm_inherit_t) 0) /* share with child */ +#define VM_INHERIT_COPY ((vm_inherit_t) 1) /* copy into child */ +#define VM_INHERIT_NONE ((vm_inherit_t) 2) /* absent from child */ +#define VM_INHERIT_DONATE_COPY ((vm_inherit_t) 3) /* copy and delete */ + +#define VM_INHERIT_DEFAULT VM_INHERIT_COPY +#define VM_INHERIT_LAST_VALID VM_INHERIT_NONE + +#endif /* _MACH_VM_INHERIT_H_ */ diff --git a/i386/include/mach/vm_map.defs b/i386/include/mach/vm_map.defs new file mode 100644 index 0000000..439c014 --- /dev/null +++ b/i386/include/mach/vm_map.defs @@ -0,0 +1,475 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_FREE_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_map.defs + * + * Exported (native-sized) kernel VM calls. + */ + +subsystem +#if KERNEL_SERVER + KernelServer +#endif /* KERNEL_SERVER */ + vm_map 3800; + +#include <mach/std_types.defs> +#include <mach/mach_types.defs> +#include <mach_debug/mach_debug_types.defs> + +/* + * Returns information about the contents of the virtual + * address space of the target task at the specified + * address. The returned protection, inheritance, sharing + * and memory object values apply to the entire range described + * by the address range returned; the memory object offset + * corresponds to the beginning of the address range. + * [If the specified address is not allocated, the next + * highest address range is described. If no addresses beyond + * the one specified are allocated, the call returns KERN_NO_SPACE.] + */ +routine vm_region( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + flavor : vm_region_flavor_t; + out info : vm_region_info_t, CountInOut; + out object_name : memory_object_name_t = + MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t); + +/* + * Allocate zero-filled memory in the address space + * of the target task, either at the specified address, + * or wherever space can be found (if anywhere is TRUE), + * of the specified size. The address at which the + * allocation actually took place is returned. + */ +routine vm_allocate( + target_task : vm_task_entry_t; + inout address : vm_address_t; + size : vm_size_t; + flags : int); + +/* + * Deallocate the specified range from the virtual + * address space of the target task. + */ +routine vm_deallocate( + target_task : vm_task_entry_t; + address : vm_address_t; + size : vm_size_t); + +/* + * Set the current or maximum protection attribute + * for the specified range of the virtual address + * space of the target task. The current protection + * limits the memory access rights of threads within + * the task; the maximum protection limits the accesses + * that may be given in the current protection. + * Protections are specified as a set of {read, write, execute} + * *permissions*. + */ +routine vm_protect( + target_task : vm_task_entry_t; + address : vm_address_t; + size : vm_size_t; + set_maximum : boolean_t; + new_protection : vm_prot_t); + +/* + * Set the inheritance attribute for the specified range + * of the virtual address space of the target task. + * The inheritance value is one of {none, copy, share}, and + * specifies how the child address space should acquire + * this memory at the time of a task_create call. + */ +routine vm_inherit( + target_task : vm_task_entry_t; + address : vm_address_t; + size : vm_size_t; + new_inheritance : vm_inherit_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit reading.] + */ +routine vm_read( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + out data : pointer_t); + +/* + * List corrollary to vm_read, returns mapped contents of specified + * ranges within target address space. + */ +routine vm_read_list( + target_task : vm_map_t; + inout data_list : vm_read_entry_t; + count : natural_t); + +/* + * Writes the contents of the specified range of the + * virtual address space of the target task. [The + * range must be aligned on a virtual page boundary, + * and must be a multiple of pages in extent. The + * protection on the specified range must permit writing.] + */ +routine vm_write( + target_task : vm_map_t; + address : vm_address_t; + data : pointer_t); + +/* + * Copy the contents of the source range of the virtual + * address space of the target task to the destination + * range in that same address space. [Both of the + * ranges must be aligned on a virtual page boundary, + * and must be multiples of pages in extent. The + * protection on the source range must permit reading, + * and the protection on the destination range must + * permit writing.] + */ +routine vm_copy( + target_task : vm_map_t; + source_address : vm_address_t; + size : vm_size_t; + dest_address : vm_address_t); + +/* + * Returns the contents of the specified range of the + * virtual address space of the target task. [There + * are no alignment restrictions, and the results will + * overwrite the area pointed to by data - which must + * already exist. The protection on the specified range + * must permit reading.] + */ +routine vm_read_overwrite( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + data : vm_address_t; + out outsize : vm_size_t); + + +routine vm_msync( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + sync_flags : vm_sync_t ); + +/* + * Set the paging behavior attribute for the specified range + * of the virtual address space of the target task. + * The behavior value is one of {default, random, forward + * sequential, reverse sequential} and indicates the expected + * page reference pattern for the specified range. + */ +routine vm_behavior_set( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + new_behavior : vm_behavior_t); + + +/* + * Map a user-defined memory object into the virtual address + * space of the target task. If desired (anywhere is TRUE), + * the kernel will find a suitable address range of the + * specified size; else, the specific address will be allocated. + * + * The beginning address of the range will be aligned on a virtual + * page boundary, be at or beyond the address specified, and + * meet the mask requirements (bits turned on in the mask must not + * be turned on in the result); the size of the range, in bytes, + * will be rounded up to an integral number of virtual pages. + * + * The memory in the resulting range will be associated with the + * specified memory object, with the beginning of the memory range + * referring to the specified offset into the memory object. + * + * The mapping will take the current and maximum protections and + * the inheritance attributes specified; see the vm_protect and + * vm_inherit calls for a description of these attributes. + * + * If desired (copy is TRUE), the memory range will be filled + * with a copy of the data from the memory object; this copy will + * be private to this mapping in this target task. Otherwise, + * the memory in this mapping will be shared with other mappings + * of the same memory object at the same offset (in this task or + * in other tasks). [The Mach kernel only enforces shared memory + * consistency among mappings on one host with similar page alignments. + * The user-defined memory manager for this object is responsible + * for further consistency.] + */ +routine vm_map( + target_task : vm_task_entry_t; + inout address : vm_address_t; + size : vm_size_t; + mask : vm_address_t; + flags : int; + object : mem_entry_name_port_t; + offset : vm_offset_t; + copy : boolean_t; + cur_protection : vm_prot_t; + max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Set/Get special properties of memory associated + * to some virtual address range, such as cachability, + * migrability, replicability. Machine-dependent. + */ +routine vm_machine_attribute( + target_task : vm_map_t; + address : vm_address_t; + size : vm_size_t; + attribute : vm_machine_attribute_t; + inout value : vm_machine_attribute_val_t); + +/* + * Map portion of a task's address space. + */ +routine vm_remap( + target_task : vm_map_t; + inout target_address : vm_address_t; + size : vm_size_t; + mask : vm_address_t; + anywhere : boolean_t; + src_task : vm_map_t; + src_address : vm_address_t; + copy : boolean_t; + out cur_protection : vm_prot_t; + out max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +/* + * Require that all future virtual memory allocation + * allocates wired memory. Setting must_wire to FALSE + * disables the wired future feature. + */ +routine task_wire( + target_task : vm_map_t; + must_wire : boolean_t); + + +/* + * Allow application level processes to create named entries which + * correspond to mapped portions of their address space. These named + * entries can then be manipulated, shared with other processes in + * other address spaces and ultimately mapped in ohter address spaces + */ + +routine mach_make_memory_entry( + target_task :vm_map_t; + inout size :vm_size_t; + offset :vm_offset_t; + permission :vm_prot_t; + out object_handle :mem_entry_name_port_move_send_t; + parent_entry :mem_entry_name_port_t); + +/* + * Give the caller information on the given location in a virtual + * address space. If a page is mapped return ref and dirty info. + */ +routine vm_map_page_query( + target_map :vm_map_t; + offset :vm_offset_t; + out disposition :integer_t; + out ref_count :integer_t); + +/* + * Returns information about a region of memory. + * Includes info about the chain of objects rooted at that region. + * Only available in MACH_VM_DEBUG compiled kernels, + * otherwise returns KERN_FAILURE. + */ +routine mach_vm_region_info( + task : vm_map_t; + address : vm_address_t; + out region : vm_info_region_t; + out objects : vm_info_object_array_t); + +routine vm_mapped_pages_info( + task : vm_map_t; + out pages : page_address_array_t); + +#if 0 +/* + * Allow application level processes to create named entries which + * are backed by sub-maps which describe regions of address space. + * These regions of space can have objects mapped into them and + * in turn, can be mapped into target address spaces + */ + +routine vm_region_object_create( + target_task :vm_map_t; + in size :vm_size_t; + out region_object :mach_port_move_send_t); +#else +skip; /* was vm_region_object_create */ +#endif + +/* + * A recursive form of vm_region which probes submaps withint the + * address space. + */ +routine vm_region_recurse( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + inout nesting_depth : natural_t; + out info : vm_region_recurse_info_t,CountInOut); + + +/* + * The routines below are temporary, meant for transitional use + * as their counterparts are moved from 32 to 64 bit data path + */ + + +routine vm_region_recurse_64( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + inout nesting_depth : natural_t; + out info : vm_region_recurse_info_t,CountInOut); + +routine mach_vm_region_info_64( + task : vm_map_t; + address : vm_address_t; + out region : vm_info_region_64_t; + out objects : vm_info_object_array_t); + +routine vm_region_64( + target_task : vm_map_t; + inout address : vm_address_t; + out size : vm_size_t; + flavor : vm_region_flavor_t; + out info : vm_region_info_t, CountInOut; + out object_name : memory_object_name_t = + MACH_MSG_TYPE_MOVE_SEND + ctype: mach_port_t); + +routine mach_make_memory_entry_64( + target_task :vm_map_t; + inout size :memory_object_size_t; + offset :memory_object_offset_t; + permission :vm_prot_t; + out object_handle :mach_port_move_send_t; + parent_entry :mem_entry_name_port_t); + + + +routine vm_map_64( + target_task : vm_task_entry_t; + inout address : vm_address_t; + size : vm_size_t; + mask : vm_address_t; + flags : int; + object : mem_entry_name_port_t; + offset : memory_object_offset_t; + copy : boolean_t; + cur_protection : vm_prot_t; + max_protection : vm_prot_t; + inheritance : vm_inherit_t); + +#if 0 +/* + * The UPL interfaces are not ready for user-level export. + */ +routine vm_map_get_upl( + target_task : vm_map_t; + address : vm_map_offset_t; + inout size : vm_size_t; + out upl : upl_t; + out page_info : upl_page_info_array_t, CountInOut; + inout flags : integer_t; + force_data_sync : integer_t); + +routine vm_upl_map( + target_task : vm_map_t; + upl : upl_t; + inout address : vm_address_t); + +routine vm_upl_unmap( + target_task : vm_map_t; + upl : upl_t); +#else +skip; /* was vm_map_get_upl */ +skip; /* was vm_upl_map */ +skip; /* was vm_upl_unmap */ +#endif + +/* + * Control behavior and investigate state of a "purgable" object in + * the virtual address space of the target task. A purgable object is + * created via a call to vm_allocate() with VM_FLAGS_PURGABLE + * specified. See the routine implementation for a complete + * definition of the routine. + */ +routine vm_purgable_control( + target_task : vm_map_t; + address : vm_address_t; + control : vm_purgable_t; + inout state : int); + +/* vim: set ft=c : */ diff --git a/i386/include/mach/vm_map.h b/i386/include/mach/vm_map.h new file mode 100644 index 0000000..1ed28fb --- /dev/null +++ b/i386/include/mach/vm_map.h @@ -0,0 +1,1378 @@ +#ifndef _vm_map_user_ +#define _vm_map_user_ + +/* Module vm_map */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef vm_map_MSG_COUNT +#define vm_map_MSG_COUNT 31 +#endif /* vm_map_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mach_types.h> +#include <mach_debug/mach_debug_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine vm_region */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + vm_region_flavor_t flavor, + vm_region_info_t info, + mach_msg_type_number_t *infoCnt, + mach_port_t *object_name +); + +/* Routine vm_allocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_allocate +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t size, + int flags +); + +/* Routine vm_deallocate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_deallocate +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size +); + +/* Routine vm_protect */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_protect +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + boolean_t set_maximum, + vm_prot_t new_protection +); + +/* Routine vm_inherit */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_inherit +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_inherit_t new_inheritance +); + +/* Routine vm_read */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_read +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_offset_t *data, + mach_msg_type_number_t *dataCnt +); + +/* Routine vm_read_list */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_read_list +( + vm_map_t target_task, + vm_read_entry_t data_list, + natural_t count +); + +/* Routine vm_write */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_write +( + vm_map_t target_task, + vm_address_t address, + vm_offset_t data, + mach_msg_type_number_t dataCnt +); + +/* Routine vm_copy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_copy +( + vm_map_t target_task, + vm_address_t source_address, + vm_size_t size, + vm_address_t dest_address +); + +/* Routine vm_read_overwrite */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_read_overwrite +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_address_t data, + vm_size_t *outsize +); + +/* Routine vm_msync */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_msync +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_sync_t sync_flags +); + +/* Routine vm_behavior_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_behavior_set +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_behavior_t new_behavior +); + +/* Routine vm_map */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_map +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t size, + vm_address_t mask, + int flags, + mem_entry_name_port_t object, + vm_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance +); + +/* Routine vm_machine_attribute */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_machine_attribute +( + vm_map_t target_task, + vm_address_t address, + vm_size_t size, + vm_machine_attribute_t attribute, + vm_machine_attribute_val_t *value +); + +/* Routine vm_remap */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_remap +( + vm_map_t target_task, + vm_address_t *target_address, + vm_size_t size, + vm_address_t mask, + boolean_t anywhere, + vm_map_t src_task, + vm_address_t src_address, + boolean_t copy, + vm_prot_t *cur_protection, + vm_prot_t *max_protection, + vm_inherit_t inheritance +); + +/* Routine task_wire */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_wire +( + vm_map_t target_task, + boolean_t must_wire +); + +/* Routine mach_make_memory_entry */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_make_memory_entry +( + vm_map_t target_task, + vm_size_t *size, + vm_offset_t offset, + vm_prot_t permission, + mem_entry_name_port_t *object_handle, + mem_entry_name_port_t parent_entry +); + +/* Routine vm_map_page_query */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_map_page_query +( + vm_map_t target_map, + vm_offset_t offset, + integer_t *disposition, + integer_t *ref_count +); + +/* Routine mach_vm_region_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region_info +( + vm_map_t task, + vm_address_t address, + vm_info_region_t *region, + vm_info_object_array_t *objects, + mach_msg_type_number_t *objectsCnt +); + +/* Routine vm_mapped_pages_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_mapped_pages_info +( + vm_map_t task, + page_address_array_t *pages, + mach_msg_type_number_t *pagesCnt +); + +/* Routine vm_region_recurse */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region_recurse +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + natural_t *nesting_depth, + vm_region_recurse_info_t info, + mach_msg_type_number_t *infoCnt +); + +/* Routine vm_region_recurse_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region_recurse_64 +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + natural_t *nesting_depth, + vm_region_recurse_info_t info, + mach_msg_type_number_t *infoCnt +); + +/* Routine mach_vm_region_info_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_vm_region_info_64 +( + vm_map_t task, + vm_address_t address, + vm_info_region_64_t *region, + vm_info_object_array_t *objects, + mach_msg_type_number_t *objectsCnt +); + +/* Routine vm_region_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_region_64 +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t *size, + vm_region_flavor_t flavor, + vm_region_info_t info, + mach_msg_type_number_t *infoCnt, + mach_port_t *object_name +); + +/* Routine mach_make_memory_entry_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_make_memory_entry_64 +( + vm_map_t target_task, + memory_object_size_t *size, + memory_object_offset_t offset, + vm_prot_t permission, + mach_port_t *object_handle, + mem_entry_name_port_t parent_entry +); + +/* Routine vm_map_64 */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_map_64 +( + vm_map_t target_task, + vm_address_t *address, + vm_size_t size, + vm_address_t mask, + int flags, + mem_entry_name_port_t object, + memory_object_offset_t offset, + boolean_t copy, + vm_prot_t cur_protection, + vm_prot_t max_protection, + vm_inherit_t inheritance +); + +/* Routine vm_purgable_control */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t vm_purgable_control +( + vm_map_t target_task, + vm_address_t address, + vm_purgable_t control, + int *state +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__vm_map_subsystem__defined +#define __Request__vm_map_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_region_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + int flags; + } __Request__vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + } __Request__vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + boolean_t set_maximum; + vm_prot_t new_protection; + } __Request__vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_inherit_t new_inheritance; + } __Request__vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + } __Request__vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_read_entry_t data_list; + natural_t count; + } __Request__vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + mach_msg_type_number_t dataCnt; + } __Request__vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t source_address; + vm_size_t size; + vm_address_t dest_address; + } __Request__vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_address_t data; + } __Request__vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_sync_t sync_flags; + } __Request__vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_behavior_t new_behavior; + } __Request__vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_address_t mask; + int flags; + vm_offset_t offset; + boolean_t copy; + vm_prot_t cur_protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + } __Request__vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_machine_attribute_t attribute; + vm_machine_attribute_val_t value; + } __Request__vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t src_task; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t target_address; + vm_size_t size; + vm_address_t mask; + boolean_t anywhere; + vm_address_t src_address; + boolean_t copy; + vm_inherit_t inheritance; + } __Request__vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t must_wire; + } __Request__task_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_entry; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_size_t size; + vm_offset_t offset; + vm_prot_t permission; + } __Request__mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_offset_t offset; + } __Request__vm_map_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + } __Request__mach_vm_region_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__vm_mapped_pages_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_recurse_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + } __Request__mach_vm_region_info_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_region_flavor_t flavor; + mach_msg_type_number_t infoCnt; + } __Request__vm_region_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t parent_entry; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + memory_object_offset_t offset; + vm_prot_t permission; + } __Request__mach_make_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + vm_address_t mask; + int flags; + memory_object_offset_t offset; + boolean_t copy; + vm_prot_t cur_protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + } __Request__vm_map_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t address; + vm_purgable_t control; + int state; + } __Request__vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__vm_map_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__vm_map_subsystem__defined +#define __RequestUnion__vm_map_subsystem__defined +union __RequestUnion__vm_map_subsystem { + __Request__vm_region_t Request_vm_region; + __Request__vm_allocate_t Request_vm_allocate; + __Request__vm_deallocate_t Request_vm_deallocate; + __Request__vm_protect_t Request_vm_protect; + __Request__vm_inherit_t Request_vm_inherit; + __Request__vm_read_t Request_vm_read; + __Request__vm_read_list_t Request_vm_read_list; + __Request__vm_write_t Request_vm_write; + __Request__vm_copy_t Request_vm_copy; + __Request__vm_read_overwrite_t Request_vm_read_overwrite; + __Request__vm_msync_t Request_vm_msync; + __Request__vm_behavior_set_t Request_vm_behavior_set; + __Request__vm_map_t Request_vm_map; + __Request__vm_machine_attribute_t Request_vm_machine_attribute; + __Request__vm_remap_t Request_vm_remap; + __Request__task_wire_t Request_task_wire; + __Request__mach_make_memory_entry_t Request_mach_make_memory_entry; + __Request__vm_map_page_query_t Request_vm_map_page_query; + __Request__mach_vm_region_info_t Request_mach_vm_region_info; + __Request__vm_mapped_pages_info_t Request_vm_mapped_pages_info; + __Request__vm_region_recurse_t Request_vm_region_recurse; + __Request__vm_region_recurse_64_t Request_vm_region_recurse_64; + __Request__mach_vm_region_info_64_t Request_mach_vm_region_info_64; + __Request__vm_region_64_t Request_vm_region_64; + __Request__mach_make_memory_entry_64_t Request_mach_make_memory_entry_64; + __Request__vm_map_64_t Request_vm_map_64; + __Request__vm_purgable_control_t Request_vm_purgable_control; +}; +#endif /* !__RequestUnion__vm_map_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__vm_map_subsystem__defined +#define __Reply__vm_map_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_name; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + mach_msg_type_number_t infoCnt; + int info[10]; + } __Reply__vm_region_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_allocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_deallocate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_protect_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_inherit_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t data; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t dataCnt; + } __Reply__vm_read_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_read_entry_t data_list; + } __Reply__vm_read_list_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_write_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_copy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_size_t outsize; + } __Reply__vm_read_overwrite_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_msync_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__vm_behavior_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_map_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_machine_attribute_val_t value; + } __Reply__vm_machine_attribute_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t target_address; + vm_prot_t cur_protection; + vm_prot_t max_protection; + } __Reply__vm_remap_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_wire_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_size_t size; + } __Reply__mach_make_memory_entry_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + integer_t disposition; + integer_t ref_count; + } __Reply__vm_map_page_query_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t objects; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_info_region_t region; + mach_msg_type_number_t objectsCnt; + } __Reply__mach_vm_region_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t pages; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t pagesCnt; + } __Reply__vm_mapped_pages_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + vm_size_t size; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + int info[19]; + } __Reply__vm_region_recurse_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + vm_size_t size; + natural_t nesting_depth; + mach_msg_type_number_t infoCnt; + int info[19]; + } __Reply__vm_region_recurse_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t objects; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_info_region_64_t region; + mach_msg_type_number_t objectsCnt; + } __Reply__mach_vm_region_info_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_name; + /* end of the kernel processed data */ + NDR_record_t NDR; + vm_address_t address; + vm_size_t size; + mach_msg_type_number_t infoCnt; + int info[10]; + } __Reply__vm_region_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t object_handle; + /* end of the kernel processed data */ + NDR_record_t NDR; + memory_object_size_t size; + } __Reply__mach_make_memory_entry_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + vm_address_t address; + } __Reply__vm_map_64_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + int state; + } __Reply__vm_purgable_control_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__vm_map_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__vm_map_subsystem__defined +#define __ReplyUnion__vm_map_subsystem__defined +union __ReplyUnion__vm_map_subsystem { + __Reply__vm_region_t Reply_vm_region; + __Reply__vm_allocate_t Reply_vm_allocate; + __Reply__vm_deallocate_t Reply_vm_deallocate; + __Reply__vm_protect_t Reply_vm_protect; + __Reply__vm_inherit_t Reply_vm_inherit; + __Reply__vm_read_t Reply_vm_read; + __Reply__vm_read_list_t Reply_vm_read_list; + __Reply__vm_write_t Reply_vm_write; + __Reply__vm_copy_t Reply_vm_copy; + __Reply__vm_read_overwrite_t Reply_vm_read_overwrite; + __Reply__vm_msync_t Reply_vm_msync; + __Reply__vm_behavior_set_t Reply_vm_behavior_set; + __Reply__vm_map_t Reply_vm_map; + __Reply__vm_machine_attribute_t Reply_vm_machine_attribute; + __Reply__vm_remap_t Reply_vm_remap; + __Reply__task_wire_t Reply_task_wire; + __Reply__mach_make_memory_entry_t Reply_mach_make_memory_entry; + __Reply__vm_map_page_query_t Reply_vm_map_page_query; + __Reply__mach_vm_region_info_t Reply_mach_vm_region_info; + __Reply__vm_mapped_pages_info_t Reply_vm_mapped_pages_info; + __Reply__vm_region_recurse_t Reply_vm_region_recurse; + __Reply__vm_region_recurse_64_t Reply_vm_region_recurse_64; + __Reply__mach_vm_region_info_64_t Reply_mach_vm_region_info_64; + __Reply__vm_region_64_t Reply_vm_region_64; + __Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64; + __Reply__vm_map_64_t Reply_vm_map_64; + __Reply__vm_purgable_control_t Reply_vm_purgable_control; +}; +#endif /* !__RequestUnion__vm_map_subsystem__defined */ + +#ifndef subsystem_to_name_map_vm_map +#define subsystem_to_name_map_vm_map \ + { "vm_region", 3800 },\ + { "vm_allocate", 3801 },\ + { "vm_deallocate", 3802 },\ + { "vm_protect", 3803 },\ + { "vm_inherit", 3804 },\ + { "vm_read", 3805 },\ + { "vm_read_list", 3806 },\ + { "vm_write", 3807 },\ + { "vm_copy", 3808 },\ + { "vm_read_overwrite", 3809 },\ + { "vm_msync", 3810 },\ + { "vm_behavior_set", 3811 },\ + { "vm_map", 3812 },\ + { "vm_machine_attribute", 3813 },\ + { "vm_remap", 3814 },\ + { "task_wire", 3815 },\ + { "mach_make_memory_entry", 3816 },\ + { "vm_map_page_query", 3817 },\ + { "mach_vm_region_info", 3818 },\ + { "vm_mapped_pages_info", 3819 },\ + { "vm_region_recurse", 3821 },\ + { "vm_region_recurse_64", 3822 },\ + { "mach_vm_region_info_64", 3823 },\ + { "vm_region_64", 3824 },\ + { "mach_make_memory_entry_64", 3825 },\ + { "vm_map_64", 3826 },\ + { "vm_purgable_control", 3830 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _vm_map_user_ */ diff --git a/i386/include/mach/vm_param.h b/i386/include/mach/vm_param.h new file mode 100644 index 0000000..9a87873 --- /dev/null +++ b/i386/include/mach/vm_param.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_param.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * Date: 1985 + * + * Machine independent virtual memory parameters. + * + */ + +#ifndef _MACH_VM_PARAM_H_ +#define _MACH_VM_PARAM_H_ + +#include <mach/machine/vm_param.h> + + +#endif /* _MACH_VM_PARAM_H_ */ diff --git a/i386/include/mach/vm_prot.h b/i386/include/mach/vm_prot.h new file mode 100644 index 0000000..6fe17d4 --- /dev/null +++ b/i386/include/mach/vm_prot.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_prot.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young + * + * Virtual memory protection definitions. + * + */ + +#ifndef _MACH_VM_PROT_H_ +#define _MACH_VM_PROT_H_ + +/* + * Types defined: + * + * vm_prot_t VM protection values. + */ + +typedef int vm_prot_t; + +/* + * Protection values, defined as bits within the vm_prot_t type + */ + +#define VM_PROT_NONE ((vm_prot_t) 0x00) + +#define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */ +#define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */ +#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */ + +/* + * The default protection for newly-created virtual memory + */ + +#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE) + +/* + * The maximum privileges possible, for parameter checking. + */ + +#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) + +/* + * An invalid protection value. + * Used only by memory_object_lock_request to indicate no change + * to page locks. Using -1 here is a bad idea because it + * looks like VM_PROT_ALL and then some. + */ + +#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08) + +/* + * When a caller finds that he cannot obtain write permission on a + * mapped entry, the following flag can be used. The entry will + * be made "needs copy" effectively copying the object (using COW), + * and write permission will be added to the maximum protections + * for the associated entry. + */ + +#define VM_PROT_COPY ((vm_prot_t) 0x10) + + +/* + * Another invalid protection value. + * Used only by memory_object_data_request upon an object + * which has specified a copy_call copy strategy. It is used + * when the kernel wants a page belonging to a copy of the + * object, and is only asking the object as a result of + * following a shadow chain. This solves the race between pages + * being pushed up by the memory manager and the kernel + * walking down the shadow chain. + */ + +#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10) + + +/* + * The caller wants this memory region treated as if it had a valid + * code signature. + */ + +#define VM_PROT_TRUSTED ((vm_prot_t) 0x20) + + +#endif /* _MACH_VM_PROT_H_ */ diff --git a/i386/include/mach/vm_purgable.h b/i386/include/mach/vm_purgable.h new file mode 100644 index 0000000..2d8ca30 --- /dev/null +++ b/i386/include/mach/vm_purgable.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Virtual memory map purgeable object definitions. + * Objects that will be needed in the future (forward cached objects) should be queued LIFO. + * Objects that have been used and are cached for reuse (backward cached) should be queued FIFO. + * Every user of purgeable memory is entitled to using the highest volatile group (7). + * Only if a client wants some of its objects to definitely be purged earlier, it can put those in + * another group. This could be used to make all FIFO objects (in the lower group) go away before + * any LIFO objects (in the higher group) go away. + * Objects that should not get any chance to stay around can be marked as "obsolete". They will + * be emptied before any other objects or pages are reclaimed. Obsolete objects are not emptied + * in any particular order. + * 'purgeable' is recognized as the correct spelling. For historical reasons, definitions + * in this file are spelled 'purgable'. + */ + +#ifndef _MACH_VM_PURGABLE_H_ +#define _MACH_VM_PURGABLE_H_ + +/* + * Types defined: + * + * vm_purgable_t purgeable object control codes. + */ + +typedef int vm_purgable_t; + +/* + * Enumeration of valid values for vm_purgable_t. + */ +#define VM_PURGABLE_SET_STATE ((vm_purgable_t) 0) /* set state of purgeable object */ +#define VM_PURGABLE_GET_STATE ((vm_purgable_t) 1) /* get state of purgeable object */ +#define VM_PURGABLE_PURGE_ALL ((vm_purgable_t) 2) /* purge all volatile objects now */ + +#define VM_PURGABLE_DEBUG_SHIFT 12 +#define VM_PURGABLE_DEBUG_MASK (0x3 << VM_PURGABLE_DEBUG_SHIFT) +#define VM_PURGABLE_DEBUG_EMPTY (0x1 << VM_PURGABLE_DEBUG_SHIFT) +#define VM_PURGABLE_DEBUG_FAULT (0x2 << VM_PURGABLE_DEBUG_SHIFT) + +/* + * Volatile memory ordering groups (group zero objects are purged before group 1, etc... + * It is implementation dependent as to whether these groups are global or per-address space. + * (for the moment, they are global). + */ +#define VM_VOLATILE_GROUP_SHIFT 8 +#define VM_VOLATILE_GROUP_MASK (7 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_DEFAULT VM_VOLATILE_GROUP_7 + +#define VM_VOLATILE_GROUP_0 (0 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_1 (1 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_2 (2 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_3 (3 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_4 (4 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_5 (5 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_6 (6 << VM_VOLATILE_GROUP_SHIFT) +#define VM_VOLATILE_GROUP_7 (7 << VM_VOLATILE_GROUP_SHIFT) + +/* + * Purgeable behavior + * Within the same group, FIFO objects will be emptied before objects that are added later. + * LIFO objects will be emptied after objects that are added later. + * - Input only, not returned on state queries. + */ +#define VM_PURGABLE_BEHAVIOR_SHIFT 6 +#define VM_PURGABLE_BEHAVIOR_MASK (1 << VM_PURGABLE_BEHAVIOR_SHIFT) +#define VM_PURGABLE_BEHAVIOR_FIFO (0 << VM_PURGABLE_BEHAVIOR_SHIFT) +#define VM_PURGABLE_BEHAVIOR_LIFO (1 << VM_PURGABLE_BEHAVIOR_SHIFT) + +/* + * Obsolete object. + * Disregard volatile group, and put object into obsolete queue instead, so it is the next object + * to be purged. + * - Input only, not returned on state queries. + */ +#define VM_PURGABLE_ORDERING_SHIFT 5 +#define VM_PURGABLE_ORDERING_MASK (1 << VM_PURGABLE_ORDERING_SHIFT) +#define VM_PURGABLE_ORDERING_OBSOLETE (1 << VM_PURGABLE_ORDERING_SHIFT) +#define VM_PURGABLE_ORDERING_NORMAL (0 << VM_PURGABLE_ORDERING_SHIFT) + + +/* + * Obsolete parameter - do not use + */ +#define VM_VOLATILE_ORDER_SHIFT 4 +#define VM_VOLATILE_ORDER_MASK (1 << VM_VOLATILE_ORDER_SHIFT) +#define VM_VOLATILE_MAKE_FIRST_IN_GROUP (1 << VM_VOLATILE_ORDER_SHIFT) +#define VM_VOLATILE_MAKE_LAST_IN_GROUP (0 << VM_VOLATILE_ORDER_SHIFT) + +/* + * Valid states of a purgeable object. + */ +#define VM_PURGABLE_STATE_MIN 0 /* minimum purgeable object state value */ +#define VM_PURGABLE_STATE_MAX 3 /* maximum purgeable object state value */ +#define VM_PURGABLE_STATE_MASK 3 /* mask to separate state from group */ + +#define VM_PURGABLE_NONVOLATILE 0 /* purgeable object is non-volatile */ +#define VM_PURGABLE_VOLATILE 1 /* purgeable object is volatile */ +#define VM_PURGABLE_EMPTY 2 /* purgeable object is volatile and empty */ +#define VM_PURGABLE_DENY 3 /* (mark) object not purgeable */ + +#define VM_PURGABLE_ALL_MASKS (VM_PURGABLE_STATE_MASK | \ + VM_VOLATILE_ORDER_MASK | \ + VM_PURGABLE_ORDERING_MASK | \ + VM_PURGABLE_BEHAVIOR_MASK | \ + VM_VOLATILE_GROUP_MASK | \ + VM_PURGABLE_DEBUG_MASK) +#endif /* _MACH_VM_PURGABLE_H_ */ diff --git a/i386/include/mach/vm_region.h b/i386/include/mach/vm_region.h new file mode 100644 index 0000000..ceb42b7 --- /dev/null +++ b/i386/include/mach/vm_region.h @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * File: mach/vm_region.h + * + * Define the attributes of a task's memory region + * + */ + +#ifndef _MACH_VM_REGION_H_ +#define _MACH_VM_REGION_H_ + +#include <mach/boolean.h> +#include <mach/vm_prot.h> +#include <mach/vm_inherit.h> +#include <mach/vm_behavior.h> +#include <mach/vm_types.h> +#include <mach/message.h> +#include <mach/machine/vm_param.h> +#include <mach/machine/vm_types.h> +#include <mach/memory_object_types.h> + +#include <sys/cdefs.h> + +#pragma pack(4) + +// LP64todo: all the current tools are 32bit, obviously never worked for 64b +// so probably should be a real 32b ID vs. ptr. +// Current users just check for equality +typedef uint32_t vm32_object_id_t; + +/* + * Types defined: + * + * vm_region_info_t memory region attributes + */ + +#define VM_REGION_INFO_MAX (1024) +typedef int *vm_region_info_t; +typedef int *vm_region_info_64_t; +typedef int *vm_region_recurse_info_t; +typedef int *vm_region_recurse_info_64_t; +typedef int vm_region_flavor_t; +typedef int vm_region_info_data_t[VM_REGION_INFO_MAX]; + +#define VM_REGION_BASIC_INFO_64 9 +struct vm_region_basic_info_64 { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + boolean_t shared; + boolean_t reserved; + memory_object_offset_t offset; + vm_behavior_t behavior; + unsigned short user_wired_count; +}; +typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t; +typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t; + +#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) \ + (sizeof(vm_region_basic_info_data_64_t)/sizeof(int))) + +/* + * Passing VM_REGION_BASIC_INFO to vm_region_64 + * automatically converts it to a VM_REGION_BASIC_INFO_64. + * Please use that explicitly instead. + */ +#define VM_REGION_BASIC_INFO 10 + +/* + * This is the legacy basic info structure. It is + * deprecated because it passes only a 32-bit memory object + * offset back - too small for many larger objects (e.g. files). + */ +struct vm_region_basic_info { + vm_prot_t protection; + vm_prot_t max_protection; + vm_inherit_t inheritance; + boolean_t shared; + boolean_t reserved; + uint32_t offset; /* too small for a real offset */ + vm_behavior_t behavior; + unsigned short user_wired_count; +}; + +typedef struct vm_region_basic_info *vm_region_basic_info_t; +typedef struct vm_region_basic_info vm_region_basic_info_data_t; + +#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_basic_info_data_t)/sizeof(int))) + +#define VM_REGION_EXTENDED_INFO 11 + +#define SM_COW 1 +#define SM_PRIVATE 2 +#define SM_EMPTY 3 +#define SM_SHARED 4 +#define SM_TRUESHARED 5 +#define SM_PRIVATE_ALIASED 6 +#define SM_SHARED_ALIASED 7 + +/* + * For submap info, the SM flags above are overlayed when a submap + * is encountered. The field denotes whether or not machine level mapping + * information is being shared. PTE's etc. When such sharing is taking + * place the value returned is SM_TRUESHARED otherwise SM_PRIVATE is passed + * back. + */ + +struct vm_region_extended_info { + vm_prot_t protection; + unsigned int user_tag; + unsigned int pages_resident; + unsigned int pages_shared_now_private; + unsigned int pages_swapped_out; + unsigned int pages_dirtied; + unsigned int ref_count; + unsigned short shadow_depth; + unsigned char external_pager; + unsigned char share_mode; +}; + +typedef struct vm_region_extended_info *vm_region_extended_info_t; +typedef struct vm_region_extended_info vm_region_extended_info_data_t; + +#define VM_REGION_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_extended_info_data_t)/sizeof(int))) + + +#define VM_REGION_TOP_INFO 12 + +struct vm_region_top_info { + unsigned int obj_id; + unsigned int ref_count; + unsigned int private_pages_resident; + unsigned int shared_pages_resident; + unsigned char share_mode; +}; + +typedef struct vm_region_top_info *vm_region_top_info_t; +typedef struct vm_region_top_info vm_region_top_info_data_t; + +#define VM_REGION_TOP_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_top_info_data_t)/sizeof(int))) + + + +/* + * vm_region_submap_info will return information on a submap or object. + * The user supplies a nesting level on the call. When a walk of the + * user's map is done and a submap is encountered, the nesting count is + * checked. If the nesting count is greater than 1 the submap is entered and + * the offset relative to the address in the base map is examined. If the + * nesting count is zero, the information on the submap is returned. + * The caller may thus learn about a submap and its contents by judicious + * choice of the base map address and nesting count. The nesting count + * allows penetration of recursively mapped submaps. If a submap is + * encountered as a mapped entry of another submap, the caller may bump + * the nesting count and call vm_region_recurse again on the target address + * range. The "is_submap" field tells the caller whether or not a submap + * has been encountered. + * + * Object only fields are filled in through a walking of the object shadow + * chain (where one is present), and a walking of the resident page queue. + * + */ + +struct vm_region_submap_info { + vm_prot_t protection; /* present access protection */ + vm_prot_t max_protection; /* max avail through vm_prot */ + vm_inherit_t inheritance;/* behavior of map/obj on fork */ + uint32_t offset; /* offset into object/map */ + unsigned int user_tag; /* user tag on map entry */ + unsigned int pages_resident; /* only valid for objects */ + unsigned int pages_shared_now_private; /* only for objects */ + unsigned int pages_swapped_out; /* only for objects */ + unsigned int pages_dirtied; /* only for objects */ + unsigned int ref_count; /* obj/map mappers, etc */ + unsigned short shadow_depth; /* only for obj */ + unsigned char external_pager; /* only for obj */ + unsigned char share_mode; /* see enumeration */ + boolean_t is_submap; /* submap vs obj */ + vm_behavior_t behavior; /* access behavior hint */ + vm32_object_id_t object_id; /* obj/map name, not a handle */ + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_info *vm_region_submap_info_t; +typedef struct vm_region_submap_info vm_region_submap_info_data_t; + +#define VM_REGION_SUBMAP_INFO_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_region_submap_info_data_t)/sizeof(int))) + +struct vm_region_submap_info_64 { + vm_prot_t protection; /* present access protection */ + vm_prot_t max_protection; /* max avail through vm_prot */ + vm_inherit_t inheritance;/* behavior of map/obj on fork */ + memory_object_offset_t offset; /* offset into object/map */ + unsigned int user_tag; /* user tag on map entry */ + unsigned int pages_resident; /* only valid for objects */ + unsigned int pages_shared_now_private; /* only for objects */ + unsigned int pages_swapped_out; /* only for objects */ + unsigned int pages_dirtied; /* only for objects */ + unsigned int ref_count; /* obj/map mappers, etc */ + unsigned short shadow_depth; /* only for obj */ + unsigned char external_pager; /* only for obj */ + unsigned char share_mode; /* see enumeration */ + boolean_t is_submap; /* submap vs obj */ + vm_behavior_t behavior; /* access behavior hint */ + vm32_object_id_t object_id; /* obj/map name, not a handle */ + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t; +typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t; + +#define VM_REGION_SUBMAP_INFO_COUNT_64 ((mach_msg_type_number_t) \ + (sizeof(vm_region_submap_info_data_64_t)/sizeof(int))) + +struct vm_region_submap_short_info_64 { + vm_prot_t protection; /* present access protection */ + vm_prot_t max_protection; /* max avail through vm_prot */ + vm_inherit_t inheritance;/* behavior of map/obj on fork */ + memory_object_offset_t offset; /* offset into object/map */ + unsigned int user_tag; /* user tag on map entry */ + unsigned int ref_count; /* obj/map mappers, etc */ + unsigned short shadow_depth; /* only for obj */ + unsigned char external_pager; /* only for obj */ + unsigned char share_mode; /* see enumeration */ + boolean_t is_submap; /* submap vs obj */ + vm_behavior_t behavior; /* access behavior hint */ + vm32_object_id_t object_id; /* obj/map name, not a handle */ + unsigned short user_wired_count; +}; + +typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t; +typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t; + +#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t) \ + (sizeof(vm_region_submap_short_info_data_64_t)/sizeof(int))) + + +struct mach_vm_read_entry { + mach_vm_address_t address; + mach_vm_size_t size; +}; + +struct vm_read_entry { + vm_address_t address; + vm_size_t size; +}; + +#if VM32_SUPPORT +struct vm32_read_entry { + vm32_address_t address; + vm32_size_t size; +}; +#endif + + +#define VM_MAP_ENTRY_MAX (256) + +typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX]; +typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX]; +#if VM32_SUPPORT +typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX]; +#endif + +#pragma pack() + + +#define VM_PAGE_INFO_MAX +typedef int *vm_page_info_t; +typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX]; +typedef int vm_page_info_flavor_t; + +#define VM_PAGE_INFO_BASIC 1 +struct vm_page_info_basic { + int disposition; + int ref_count; + vm_object_id_t object_id; + memory_object_offset_t offset; + int depth; +}; +typedef struct vm_page_info_basic *vm_page_info_basic_t; +typedef struct vm_page_info_basic vm_page_info_basic_data_t; + +#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) \ + (sizeof(vm_page_info_basic_data_t)/sizeof(int))) + + +#endif /*_MACH_VM_REGION_H_*/ diff --git a/i386/include/mach/vm_statistics.h b/i386/include/mach/vm_statistics.h new file mode 100644 index 0000000..016a1c2 --- /dev/null +++ b/i386/include/mach/vm_statistics.h @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + */ +/* + * File: mach/vm_statistics.h + * Author: Avadis Tevanian, Jr., Michael Wayne Young, David Golub + * + * Virtual memory statistics structure. + * + */ + +#ifndef _MACH_VM_STATISTICS_H_ +#define _MACH_VM_STATISTICS_H_ + +#include <mach/machine/vm_types.h> + + +/* + * vm_statistics + * + * History: + * rev0 - original structure. + * rev1 - added purgable info (purgable_count and purges). + * rev2 - added speculative_count. + * + * Note: you cannot add any new fields to this structure. Add them below in + * vm_statistics64. + */ + +struct vm_statistics { + natural_t free_count; /* # of pages free */ + natural_t active_count; /* # of pages active */ + natural_t inactive_count; /* # of pages inactive */ + natural_t wire_count; /* # of pages wired down */ + natural_t zero_fill_count; /* # of zero fill pages */ + natural_t reactivations; /* # of pages reactivated */ + natural_t pageins; /* # of pageins */ + natural_t pageouts; /* # of pageouts */ + natural_t faults; /* # of faults */ + natural_t cow_faults; /* # of copy-on-writes */ + natural_t lookups; /* object cache lookups */ + natural_t hits; /* object cache hits */ + + /* added for rev1 */ + natural_t purgeable_count; /* # of pages purgeable */ + natural_t purges; /* # of pages purged */ + + /* added for rev2 */ + /* + * NB: speculative pages are already accounted for in "free_count", + * so "speculative_count" is the number of "free" pages that are + * used to hold data that was read speculatively from disk but + * haven't actually been used by anyone so far. + */ + natural_t speculative_count; /* # of pages speculative */ +}; + +/* Used by all architectures */ +typedef struct vm_statistics *vm_statistics_t; +typedef struct vm_statistics vm_statistics_data_t; + +#if defined(__ppc__) /* On ppc, vm statistics are still 32-bit */ + +typedef struct vm_statistics *vm_statistics64_t; +typedef struct vm_statistics vm_statistics64_data_t; + +#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) value + +#else /* !(defined(__ppc__)) */ + +/* + * vm_statistics64 + * + * History: + * rev0 - original structure. + * rev1 - added purgable info (purgable_count and purges). + * rev2 - added speculative_count. + * ---- + * rev3 - changed name to vm_statistics64. + * changed some fields in structure to 64-bit on + * arm, i386 and x86_64 architectures. + * + */ + +struct vm_statistics64 { + natural_t free_count; /* # of pages free */ + natural_t active_count; /* # of pages active */ + natural_t inactive_count; /* # of pages inactive */ + natural_t wire_count; /* # of pages wired down */ + uint64_t zero_fill_count; /* # of zero fill pages */ + uint64_t reactivations; /* # of pages reactivated */ + uint64_t pageins; /* # of pageins */ + uint64_t pageouts; /* # of pageouts */ + uint64_t faults; /* # of faults */ + uint64_t cow_faults; /* # of copy-on-writes */ + uint64_t lookups; /* object cache lookups */ + uint64_t hits; /* object cache hits */ + + /* added for rev1 */ + uint64_t purges; /* # of pages purged */ + natural_t purgeable_count; /* # of pages purgeable */ + + /* added for rev2 */ + /* + * NB: speculative pages are already accounted for in "free_count", + * so "speculative_count" is the number of "free" pages that are + * used to hold data that was read speculatively from disk but + * haven't actually been used by anyone so far. + */ + natural_t speculative_count; /* # of pages speculative */ + +} +#ifdef __arm__ +__attribute__((aligned(8))) +#endif +; + +typedef struct vm_statistics64 *vm_statistics64_t; +typedef struct vm_statistics64 vm_statistics64_data_t; + +/* + * VM_STATISTICS_TRUNCATE_TO_32_BIT + * + * This is used by host_statistics() to truncate and peg the 64-bit in-kernel values from + * vm_statistics64 to the 32-bit values of the older structure above (vm_statistics). + */ +#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value))) + +#endif /* !(defined(__ppc__)) */ + + +/* included for the vm_map_page_query call */ + +#define VM_PAGE_QUERY_PAGE_PRESENT 0x1 +#define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2 +#define VM_PAGE_QUERY_PAGE_REF 0x4 +#define VM_PAGE_QUERY_PAGE_DIRTY 0x8 +#define VM_PAGE_QUERY_PAGE_PAGED_OUT 0x10 +#define VM_PAGE_QUERY_PAGE_COPIED 0x20 +#define VM_PAGE_QUERY_PAGE_SPECULATIVE 0x40 +#define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80 +#define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100 +#define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200 + + +/* + * VM allocation flags: + * + * VM_FLAGS_FIXED + * (really the absence of VM_FLAGS_ANYWHERE) + * Allocate new VM region at the specified virtual address, if possible. + * + * VM_FLAGS_ANYWHERE + * Allocate new VM region anywhere it would fit in the address space. + * + * VM_FLAGS_PURGABLE + * Create a purgable VM object for that new VM region. + * + * VM_FLAGS_NO_PMAP_CHECK + * (for DEBUG kernel config only, ignored for other configs) + * Do not check that there is no stale pmap mapping for the new VM region. + * This is useful for kernel memory allocations at bootstrap when building + * the initial kernel address space while some memory is already in use. + * + * VM_FLAGS_OVERWRITE + * The new VM region can replace existing VM regions if necessary + * (to be used in combination with VM_FLAGS_FIXED). + * + * VM_FLAGS_NO_CACHE + * Pages brought in to this VM region are placed on the speculative + * queue instead of the active queue. In other words, they are not + * cached so that they will be stolen first if memory runs low. + */ +#define VM_FLAGS_FIXED 0x0000 +#define VM_FLAGS_ANYWHERE 0x0001 +#define VM_FLAGS_PURGABLE 0x0002 +#define VM_FLAGS_NO_CACHE 0x0010 + +/* + * VM_FLAGS_SUPERPAGE_MASK + * 3 bits that specify whether large pages should be used instead of + * base pages (!=0), as well as the requested page size. + */ +#define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */ +#define VM_FLAGS_SUPERPAGE_SHIFT 16 + +#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */ +#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE<<VM_FLAGS_SUPERPAGE_SHIFT) +#if defined(__x86_64__) || !defined(KERNEL) +#define SUPERPAGE_SIZE_2MB 1 +#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT) +#endif + +#define VM_FLAGS_ALIAS_MASK 0xFF000000 +#define VM_GET_FLAGS_ALIAS(flags, alias) \ + (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 +#define VM_SET_FLAGS_ALIAS(flags, alias) \ + (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ + (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) + +/* These are the flags that we accept from user-space */ +#define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ + VM_FLAGS_ANYWHERE | \ + VM_FLAGS_PURGABLE | \ + VM_FLAGS_NO_CACHE | \ + VM_FLAGS_SUPERPAGE_MASK | \ + VM_FLAGS_ALIAS_MASK) +#define VM_FLAGS_USER_MAP VM_FLAGS_USER_ALLOCATE + +#define VM_MEMORY_MALLOC 1 +#define VM_MEMORY_MALLOC_SMALL 2 +#define VM_MEMORY_MALLOC_LARGE 3 +#define VM_MEMORY_MALLOC_HUGE 4 +#define VM_MEMORY_SBRK 5// uninteresting -- no one should call +#define VM_MEMORY_REALLOC 6 +#define VM_MEMORY_MALLOC_TINY 7 +#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8 +#define VM_MEMORY_MALLOC_LARGE_REUSED 9 + +#define VM_MEMORY_ANALYSIS_TOOL 10 + +#define VM_MEMORY_MACH_MSG 20 +#define VM_MEMORY_IOKIT 21 +#define VM_MEMORY_STACK 30 +#define VM_MEMORY_GUARD 31 +#define VM_MEMORY_SHARED_PMAP 32 +/* memory containing a dylib */ +#define VM_MEMORY_DYLIB 33 +#define VM_MEMORY_OBJC_DISPATCHERS 34 + +// Placeholders for now -- as we analyze the libraries and find how they +// use memory, we can make these labels more specific. +#define VM_MEMORY_APPKIT 40 +#define VM_MEMORY_FOUNDATION 41 +#define VM_MEMORY_COREGRAPHICS 42 +#define VM_MEMORY_CARBON 43 +#define VM_MEMORY_JAVA 44 +#define VM_MEMORY_ATS 50 +#define VM_MEMORY_LAYERKIT 51 +#define VM_MEMORY_CGIMAGE 52 +#define VM_MEMORY_TCMALLOC 53 + +/* private raster data (i.e. layers, some images, QGL allocator) */ +#define VM_MEMORY_COREGRAPHICS_DATA 54 + +/* shared image and font caches */ +#define VM_MEMORY_COREGRAPHICS_SHARED 55 + +/* Memory used for virtual framebuffers, shadowing buffers, etc... */ +#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56 + +/* Window backing stores, custom shadow data, and compressed backing stores */ +#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57 + +/* catch-all for other uses, such as the read-only shared data page */ +#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS + +/* memory allocated by the dynamic loader for itself */ +#define VM_MEMORY_DYLD 60 +/* malloc'd memory created by dyld */ +#define VM_MEMORY_DYLD_MALLOC 61 + +/* Used for sqlite page cache */ +#define VM_MEMORY_SQLITE 62 + +/* JavaScriptCore heaps */ +#define VM_MEMORY_JAVASCRIPT_CORE 63 +/* memory allocated for the JIT */ +#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64 +#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65 + +/* memory allocated for GLSL */ +#define VM_MEMORY_GLSL 66 + +/* Reserve 240-255 for application */ +#define VM_MEMORY_APPLICATION_SPECIFIC_1 240 +#define VM_MEMORY_APPLICATION_SPECIFIC_16 255 + +#define VM_MAKE_TAG(tag) ((tag) << 24) + +#endif /* _MACH_VM_STATISTICS_H_ */ diff --git a/i386/include/mach/vm_sync.h b/i386/include/mach/vm_sync.h new file mode 100644 index 0000000..dfb948b --- /dev/null +++ b/i386/include/mach/vm_sync.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + */ +/* + * Mach Operating System + * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University + * All Rights Reserved. + * + * Permission to use, copy, modify and distribute this software and its + * documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR + * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie Mellon + * the rights to redistribute these changes. + */ +/* + * File: mach/vm_sync.h + * + * Virtual memory synchronisation definitions. + * + */ + +#ifndef _MACH_VM_SYNC_H_ +#define _MACH_VM_SYNC_H_ + +typedef unsigned vm_sync_t; + +/* + * Synchronization flags, defined as bits within the vm_sync_t type + */ + +#define VM_SYNC_ASYNCHRONOUS ((vm_sync_t) 0x01) +#define VM_SYNC_SYNCHRONOUS ((vm_sync_t) 0x02) +#define VM_SYNC_INVALIDATE ((vm_sync_t) 0x04) +#define VM_SYNC_KILLPAGES ((vm_sync_t) 0x08) +#define VM_SYNC_DEACTIVATE ((vm_sync_t) 0x10) +#define VM_SYNC_CONTIGUOUS ((vm_sync_t) 0x20) +#define VM_SYNC_REUSABLEPAGES ((vm_sync_t) 0x40) + +#endif /* _MACH_VM_SYNC_H_ */ diff --git a/i386/include/mach/vm_task.h b/i386/include/mach/vm_task.h new file mode 100644 index 0000000..d2401ac --- /dev/null +++ b/i386/include/mach/vm_task.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* +** This file contains compatibilty wrapper header for things that are +** generated from mach/vm_map.defs into mach/vm_map.h. +** +** This file will go away eventually - please switch. +*/ +#include <mach/vm_map.h> diff --git a/i386/include/mach/vm_types.h b/i386/include/mach/vm_types.h new file mode 100644 index 0000000..37f4bd5 --- /dev/null +++ b/i386/include/mach/vm_types.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * @OSF_COPYRIGHT@ + * + */ +#ifndef _MACH_VM_TYPES_H_ +#define _MACH_VM_TYPES_H_ + +#include <mach/port.h> +#include <mach/machine/vm_types.h> + +#include <stdint.h> + +typedef vm_offset_t pointer_t; +typedef vm_offset_t vm_address_t; + +/* + * We use addr64_t for 64-bit addresses that are used on both + * 32 and 64-bit machines. On PPC, they are passed and returned as + * two adjacent 32-bit GPRs. We use addr64_t in places where + * common code must be useable both on 32 and 64-bit machines. + */ +typedef uint64_t addr64_t; /* Basic effective address */ + +/* + * We use reg64_t for addresses that are 32 bits on a 32-bit + * machine, and 64 bits on a 64-bit machine, but are always + * passed and returned in a single GPR on PPC. This type + * cannot be used in generic 32-bit c, since on a 64-bit + * machine the upper half of the register will be ignored + * by the c compiler in 32-bit mode. In c, we can only use the + * type in prototypes of functions that are written in and called + * from assembly language. This type is basically a comment. + */ +typedef uint32_t reg64_t; + +/* + * To minimize the use of 64-bit fields, we keep some physical + * addresses (that are page aligned) as 32-bit page numbers. + * This limits the physical address space to 16TB of RAM. + */ +typedef uint32_t ppnum_t; /* Physical page number */ +#define PPNUM_MAX UINT32_MAX + + + +typedef mach_port_t vm_map_t; + + +#define VM_MAP_NULL ((vm_map_t) 0) + +/* + * Evolving definitions, likely to change. + */ + +typedef uint64_t vm_object_offset_t; +typedef uint64_t vm_object_size_t; + + +typedef mach_port_t upl_t; +typedef mach_port_t vm_named_entry_t; + + +#define UPL_NULL ((upl_t) 0) +#define VM_NAMED_ENTRY_NULL ((vm_named_entry_t) 0) + +#endif /* _MACH_VM_TYPES_H_ */ diff --git a/i386/include/mach/x86_64/.svn/all-wcprops b/i386/include/mach/x86_64/.svn/all-wcprops new file mode 100644 index 0000000..cfc08e3 --- /dev/null +++ b/i386/include/mach/x86_64/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/x86_64 +END +thread_act.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/x86_64/thread_act.h +END +task.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/mach/x86_64/task.h +END diff --git a/i386/include/mach/x86_64/.svn/entries b/i386/include/mach/x86_64/.svn/entries new file mode 100644 index 0000000..f3ba69b --- /dev/null +++ b/i386/include/mach/x86_64/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/mach/x86_64 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +thread_act.h +file + + + + +2013-08-27T23:54:46.000000Z +25d845f2e915a195e887ae48026bf854 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25654 + +task.h +file + + + + +2013-08-27T23:54:46.000000Z +d87c8dd8a5baf21d6cd2fb7fd2c6775d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34704 + diff --git a/i386/include/mach/x86_64/.svn/text-base/task.h.svn-base b/i386/include/mach/x86_64/.svn/text-base/task.h.svn-base new file mode 100644 index 0000000..15c8248 --- /dev/null +++ b/i386/include/mach/x86_64/.svn/text-base/task.h.svn-base @@ -0,0 +1,1578 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 35 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +/* Routine task_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine task_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; + __Request__task_get_state_t Request_task_get_state; + __Request__task_set_state_t Request_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; + __Reply__task_get_state_t Reply_task_get_state; + __Reply__task_set_state_t Reply_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 },\ + { "task_get_state", 3433 },\ + { "task_set_state", 3434 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/i386/include/mach/x86_64/.svn/text-base/thread_act.h.svn-base b/i386/include/mach/x86_64/.svn/text-base/thread_act.h.svn-base new file mode 100644 index 0000000..fde4189 --- /dev/null +++ b/i386/include/mach/x86_64/.svn/text-base/thread_act.h.svn-base @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/i386/include/mach/x86_64/task.h b/i386/include/mach/x86_64/task.h new file mode 100644 index 0000000..15c8248 --- /dev/null +++ b/i386/include/mach/x86_64/task.h @@ -0,0 +1,1578 @@ +#ifndef _task_user_ +#define _task_user_ + +/* Module task */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef task_MSG_COUNT +#define task_MSG_COUNT 35 +#endif /* task_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine task_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_create +( + task_t target_task, + ledger_array_t ledgers, + mach_msg_type_number_t ledgersCnt, + boolean_t inherit_memory, + task_t *child_task +); + +/* Routine task_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_terminate +( + task_t target_task +); + +/* Routine task_threads */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_threads +( + task_t target_task, + thread_act_array_t *act_list, + mach_msg_type_number_t *act_listCnt +); + +/* Routine mach_ports_register */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_register +( + task_t target_task, + mach_port_array_t init_port_set, + mach_msg_type_number_t init_port_setCnt +); + +/* Routine mach_ports_lookup */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t mach_ports_lookup +( + task_t target_task, + mach_port_array_t *init_port_set, + mach_msg_type_number_t *init_port_setCnt +); + +/* Routine task_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_info +( + task_name_t target_task, + task_flavor_t flavor, + task_info_t task_info_out, + mach_msg_type_number_t *task_info_outCnt +); + +/* Routine task_set_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_info +( + task_t target_task, + task_flavor_t flavor, + task_info_t task_info_in, + mach_msg_type_number_t task_info_inCnt +); + +/* Routine task_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_suspend +( + task_t target_task +); + +/* Routine task_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_resume +( + task_t target_task +); + +/* Routine task_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_special_port +( + task_t task, + int which_port, + mach_port_t *special_port +); + +/* Routine task_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_special_port +( + task_t task, + int which_port, + mach_port_t special_port +); + +/* Routine thread_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create +( + task_t parent_task, + thread_act_t *child_act +); + +/* Routine thread_create_running */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_create_running +( + task_t parent_task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt, + thread_act_t *child_act +); + +/* Routine task_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine task_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_exception_ports +( + task_t task, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine task_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_swap_exception_ports +( + task_t task, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlerss, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine lock_set_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_create +( + task_t task, + lock_set_t *new_lock_set, + int n_ulocks, + int policy +); + +/* Routine lock_set_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t lock_set_destroy +( + task_t task, + lock_set_t lock_set +); + +/* Routine semaphore_create */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_create +( + task_t task, + semaphore_t *semaphore, + int policy, + int value +); + +/* Routine semaphore_destroy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t semaphore_destroy +( + task_t task, + semaphore_t semaphore +); + +/* Routine task_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_set +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine task_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy_get +( + task_t task, + task_policy_flavor_t flavor, + task_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine task_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_sample +( + task_t task, + mach_port_t reply +); + +/* Routine task_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_policy +( + task_t task, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit, + boolean_t change +); + +/* Routine task_set_emulation */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation +( + task_t target_port, + vm_address_t routine_entry_pt, + int routine_number +); + +/* Routine task_get_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_emulation_vector +( + task_t task, + int *vector_start, + emulation_vector_t *emulation_vector, + mach_msg_type_number_t *emulation_vectorCnt +); + +/* Routine task_set_emulation_vector */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_emulation_vector +( + task_t task, + int vector_start, + emulation_vector_t emulation_vector, + mach_msg_type_number_t emulation_vectorCnt +); + +/* Routine task_set_ras_pc */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_ras_pc +( + task_t target_task, + vm_address_t basepc, + vm_address_t boundspc +); + +/* Routine task_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign +( + task_t task, + processor_set_t new_set, + boolean_t assign_threads +); + +/* Routine task_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_assign_default +( + task_t task, + boolean_t assign_threads +); + +/* Routine task_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_assignment +( + task_t task, + processor_set_name_t *assigned_set +); + +/* Routine task_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_policy +( + task_t task, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt, + boolean_t change +); + +/* Routine task_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_get_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine task_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t task_set_state +( + task_t task, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__task_subsystem__defined +#define __Request__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t ledgers; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t ledgersCnt; + boolean_t inherit_memory; + } __Request__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Request__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_outCnt; + } __Request__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_flavor_t flavor; + mach_msg_type_number_t task_info_inCnt; + integer_t task_info_in[10]; + } __Request__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int n_ulocks; + int policy; + } __Request__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t lock_set; + /* end of the kernel processed data */ + } __Request__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int policy; + int value; + } __Request__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Request__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + task_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + boolean_t change; + } __Request__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t routine_entry_pt; + int routine_number; + } __Request__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Request__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + vm_address_t basepc; + vm_address_t boundspc; + } __Request__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t assign_threads; + } __Request__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + boolean_t change; + } __Request__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__task_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__task_subsystem__defined +#define __RequestUnion__task_subsystem__defined +union __RequestUnion__task_subsystem { + __Request__task_create_t Request_task_create; + __Request__task_terminate_t Request_task_terminate; + __Request__task_threads_t Request_task_threads; + __Request__mach_ports_register_t Request_mach_ports_register; + __Request__mach_ports_lookup_t Request_mach_ports_lookup; + __Request__task_info_t Request_task_info; + __Request__task_set_info_t Request_task_set_info; + __Request__task_suspend_t Request_task_suspend; + __Request__task_resume_t Request_task_resume; + __Request__task_get_special_port_t Request_task_get_special_port; + __Request__task_set_special_port_t Request_task_set_special_port; + __Request__thread_create_t Request_thread_create; + __Request__thread_create_running_t Request_thread_create_running; + __Request__task_set_exception_ports_t Request_task_set_exception_ports; + __Request__task_get_exception_ports_t Request_task_get_exception_ports; + __Request__task_swap_exception_ports_t Request_task_swap_exception_ports; + __Request__lock_set_create_t Request_lock_set_create; + __Request__lock_set_destroy_t Request_lock_set_destroy; + __Request__semaphore_create_t Request_semaphore_create; + __Request__semaphore_destroy_t Request_semaphore_destroy; + __Request__task_policy_set_t Request_task_policy_set; + __Request__task_policy_get_t Request_task_policy_get; + __Request__task_sample_t Request_task_sample; + __Request__task_policy_t Request_task_policy; + __Request__task_set_emulation_t Request_task_set_emulation; + __Request__task_get_emulation_vector_t Request_task_get_emulation_vector; + __Request__task_set_emulation_vector_t Request_task_set_emulation_vector; + __Request__task_set_ras_pc_t Request_task_set_ras_pc; + __Request__task_assign_t Request_task_assign; + __Request__task_assign_default_t Request_task_assign_default; + __Request__task_get_assignment_t Request_task_get_assignment; + __Request__task_set_policy_t Request_task_set_policy; + __Request__task_get_state_t Request_task_get_state; + __Request__task_set_state_t Request_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__task_subsystem__defined +#define __Reply__task_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_task; + /* end of the kernel processed data */ + } __Reply__task_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t act_list; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t act_listCnt; + } __Reply__task_threads_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__mach_ports_register_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_ports_descriptor_t init_port_set; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t init_port_setCnt; + } __Reply__mach_ports_lookup_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t task_info_outCnt; + integer_t task_info_out[10]; + } __Reply__task_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__task_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t child_act; + /* end of the kernel processed data */ + } __Reply__thread_create_running_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlerss[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__task_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_lock_set; + /* end of the kernel processed data */ + } __Reply__lock_set_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__lock_set_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t semaphore; + /* end of the kernel processed data */ + } __Reply__semaphore_create_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__semaphore_destroy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__task_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_ool_descriptor_t emulation_vector; + /* end of the kernel processed data */ + NDR_record_t NDR; + int vector_start; + mach_msg_type_number_t emulation_vectorCnt; + } __Reply__task_get_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_emulation_vector_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_ras_pc_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__task_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__task_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__task_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__task_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__task_subsystem__defined +#define __ReplyUnion__task_subsystem__defined +union __ReplyUnion__task_subsystem { + __Reply__task_create_t Reply_task_create; + __Reply__task_terminate_t Reply_task_terminate; + __Reply__task_threads_t Reply_task_threads; + __Reply__mach_ports_register_t Reply_mach_ports_register; + __Reply__mach_ports_lookup_t Reply_mach_ports_lookup; + __Reply__task_info_t Reply_task_info; + __Reply__task_set_info_t Reply_task_set_info; + __Reply__task_suspend_t Reply_task_suspend; + __Reply__task_resume_t Reply_task_resume; + __Reply__task_get_special_port_t Reply_task_get_special_port; + __Reply__task_set_special_port_t Reply_task_set_special_port; + __Reply__thread_create_t Reply_thread_create; + __Reply__thread_create_running_t Reply_thread_create_running; + __Reply__task_set_exception_ports_t Reply_task_set_exception_ports; + __Reply__task_get_exception_ports_t Reply_task_get_exception_ports; + __Reply__task_swap_exception_ports_t Reply_task_swap_exception_ports; + __Reply__lock_set_create_t Reply_lock_set_create; + __Reply__lock_set_destroy_t Reply_lock_set_destroy; + __Reply__semaphore_create_t Reply_semaphore_create; + __Reply__semaphore_destroy_t Reply_semaphore_destroy; + __Reply__task_policy_set_t Reply_task_policy_set; + __Reply__task_policy_get_t Reply_task_policy_get; + __Reply__task_sample_t Reply_task_sample; + __Reply__task_policy_t Reply_task_policy; + __Reply__task_set_emulation_t Reply_task_set_emulation; + __Reply__task_get_emulation_vector_t Reply_task_get_emulation_vector; + __Reply__task_set_emulation_vector_t Reply_task_set_emulation_vector; + __Reply__task_set_ras_pc_t Reply_task_set_ras_pc; + __Reply__task_assign_t Reply_task_assign; + __Reply__task_assign_default_t Reply_task_assign_default; + __Reply__task_get_assignment_t Reply_task_get_assignment; + __Reply__task_set_policy_t Reply_task_set_policy; + __Reply__task_get_state_t Reply_task_get_state; + __Reply__task_set_state_t Reply_task_set_state; +}; +#endif /* !__RequestUnion__task_subsystem__defined */ + +#ifndef subsystem_to_name_map_task +#define subsystem_to_name_map_task \ + { "task_create", 3400 },\ + { "task_terminate", 3401 },\ + { "task_threads", 3402 },\ + { "mach_ports_register", 3403 },\ + { "mach_ports_lookup", 3404 },\ + { "task_info", 3405 },\ + { "task_set_info", 3406 },\ + { "task_suspend", 3407 },\ + { "task_resume", 3408 },\ + { "task_get_special_port", 3409 },\ + { "task_set_special_port", 3410 },\ + { "thread_create", 3411 },\ + { "thread_create_running", 3412 },\ + { "task_set_exception_ports", 3413 },\ + { "task_get_exception_ports", 3414 },\ + { "task_swap_exception_ports", 3415 },\ + { "lock_set_create", 3416 },\ + { "lock_set_destroy", 3417 },\ + { "semaphore_create", 3418 },\ + { "semaphore_destroy", 3419 },\ + { "task_policy_set", 3420 },\ + { "task_policy_get", 3421 },\ + { "task_sample", 3422 },\ + { "task_policy", 3423 },\ + { "task_set_emulation", 3424 },\ + { "task_get_emulation_vector", 3425 },\ + { "task_set_emulation_vector", 3426 },\ + { "task_set_ras_pc", 3427 },\ + { "task_assign", 3429 },\ + { "task_assign_default", 3430 },\ + { "task_get_assignment", 3431 },\ + { "task_set_policy", 3432 },\ + { "task_get_state", 3433 },\ + { "task_set_state", 3434 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _task_user_ */ diff --git a/i386/include/mach/x86_64/thread_act.h b/i386/include/mach/x86_64/thread_act.h new file mode 100644 index 0000000..fde4189 --- /dev/null +++ b/i386/include/mach/x86_64/thread_act.h @@ -0,0 +1,1155 @@ +#ifndef _thread_act_user_ +#define _thread_act_user_ + +/* Module thread_act */ + +#include <string.h> +#include <mach/ndr.h> +#include <mach/boolean.h> +#include <mach/kern_return.h> +#include <mach/notify.h> +#include <mach/mach_types.h> +#include <mach/message.h> +#include <mach/mig_errors.h> +#include <mach/port.h> + +#ifdef AUTOTEST +#ifndef FUNCTION_PTR_T +#define FUNCTION_PTR_T +typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); +typedef struct { + char *name; + function_ptr_t function; +} function_table_entry; +typedef function_table_entry *function_table_t; +#endif /* FUNCTION_PTR_T */ +#endif /* AUTOTEST */ + +#ifndef thread_act_MSG_COUNT +#define thread_act_MSG_COUNT 25 +#endif /* thread_act_MSG_COUNT */ + +#include <mach/std_types.h> +#include <mach/mig.h> +#include <mach/mig.h> +#include <mach/mach_types.h> + +#ifdef __BeforeMigUserHeader +__BeforeMigUserHeader +#endif /* __BeforeMigUserHeader */ + +#include <sys/cdefs.h> +__BEGIN_DECLS + + +/* Routine thread_terminate */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_terminate +( + thread_act_t target_act +); + +/* Routine act_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_get_state +( + thread_act_t target_act, + int flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine act_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t act_set_state +( + thread_act_t target_act, + int flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_get_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t old_state, + mach_msg_type_number_t *old_stateCnt +); + +/* Routine thread_set_state */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_state +( + thread_act_t target_act, + thread_state_flavor_t flavor, + thread_state_t new_state, + mach_msg_type_number_t new_stateCnt +); + +/* Routine thread_suspend */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_suspend +( + thread_act_t target_act +); + +/* Routine thread_resume */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_resume +( + thread_act_t target_act +); + +/* Routine thread_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort +( + thread_act_t target_act +); + +/* Routine thread_abort_safely */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_abort_safely +( + thread_act_t target_act +); + +/* Routine thread_depress_abort */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_depress_abort +( + thread_act_t thread +); + +/* Routine thread_get_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t *special_port +); + +/* Routine thread_set_special_port */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_special_port +( + thread_act_t thr_act, + int which_port, + mach_port_t special_port +); + +/* Routine thread_info */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_info +( + thread_act_t target_act, + thread_flavor_t flavor, + thread_info_t thread_info_out, + mach_msg_type_number_t *thread_info_outCnt +); + +/* Routine thread_set_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor +); + +/* Routine thread_get_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_swap_exception_ports */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_swap_exception_ports +( + thread_act_t thread, + exception_mask_t exception_mask, + mach_port_t new_port, + exception_behavior_t behavior, + thread_state_flavor_t new_flavor, + exception_mask_array_t masks, + mach_msg_type_number_t *masksCnt, + exception_handler_array_t old_handlers, + exception_behavior_array_t old_behaviors, + exception_flavor_array_t old_flavors +); + +/* Routine thread_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy +( + thread_act_t thr_act, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + boolean_t set_limit +); + +/* Routine thread_policy_set */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_set +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t policy_infoCnt +); + +/* Routine thread_policy_get */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_policy_get +( + thread_act_t thread, + thread_policy_flavor_t flavor, + thread_policy_t policy_info, + mach_msg_type_number_t *policy_infoCnt, + boolean_t *get_default +); + +/* Routine thread_sample */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_sample +( + thread_act_t thread, + mach_port_t reply +); + +/* Routine etap_trace_thread */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t etap_trace_thread +( + thread_act_t target_act, + boolean_t trace_status +); + +/* Routine thread_assign */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign +( + thread_act_t thread, + processor_set_t new_set +); + +/* Routine thread_assign_default */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_assign_default +( + thread_act_t thread +); + +/* Routine thread_get_assignment */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_get_assignment +( + thread_act_t thread, + processor_set_name_t *assigned_set +); + +/* Routine thread_set_policy */ +#ifdef mig_external +mig_external +#else +extern +#endif /* mig_external */ +kern_return_t thread_set_policy +( + thread_act_t thr_act, + processor_set_t pset, + policy_t policy, + policy_base_t base, + mach_msg_type_number_t baseCnt, + policy_limit_t limit, + mach_msg_type_number_t limitCnt +); + +__END_DECLS + +/********************** Caution **************************/ +/* The following data types should be used to calculate */ +/* maximum message sizes only. The actual message may be */ +/* smaller, and the position of the arguments within the */ +/* message layout may vary from what is presented here. */ +/* For example, if any of the arguments are variable- */ +/* sized, and less than the maximum is sent, the data */ +/* will be packed tight in the actual message to reduce */ +/* the presence of holes. */ +/********************** Caution **************************/ + +/* typedefs for all requests */ + +#ifndef __Request__thread_act_subsystem__defined +#define __Request__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t old_stateCnt; + } __Request__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_state_flavor_t flavor; + mach_msg_type_number_t new_stateCnt; + natural_t new_state[144]; + } __Request__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + int which_port; + } __Request__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } __Request__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_flavor_t flavor; + mach_msg_type_number_t thread_info_outCnt; + } __Request__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + exception_mask_t exception_mask; + } __Request__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + exception_mask_t exception_mask; + exception_behavior_t behavior; + thread_state_flavor_t new_flavor; + } __Request__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + boolean_t set_limit; + } __Request__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + } __Request__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + thread_policy_flavor_t flavor; + mach_msg_type_number_t policy_infoCnt; + boolean_t get_default; + } __Request__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t reply; + /* end of the kernel processed data */ + } __Request__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + boolean_t trace_status; + } __Request__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t new_set; + /* end of the kernel processed data */ + } __Request__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + } __Request__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t pset; + /* end of the kernel processed data */ + NDR_record_t NDR; + policy_t policy; + mach_msg_type_number_t baseCnt; + integer_t base[5]; + mach_msg_type_number_t limitCnt; + integer_t limit[1]; + } __Request__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Request__thread_act_subsystem__defined */ + +/* union of all requests */ + +#ifndef __RequestUnion__thread_act_subsystem__defined +#define __RequestUnion__thread_act_subsystem__defined +union __RequestUnion__thread_act_subsystem { + __Request__thread_terminate_t Request_thread_terminate; + __Request__act_get_state_t Request_act_get_state; + __Request__act_set_state_t Request_act_set_state; + __Request__thread_get_state_t Request_thread_get_state; + __Request__thread_set_state_t Request_thread_set_state; + __Request__thread_suspend_t Request_thread_suspend; + __Request__thread_resume_t Request_thread_resume; + __Request__thread_abort_t Request_thread_abort; + __Request__thread_abort_safely_t Request_thread_abort_safely; + __Request__thread_depress_abort_t Request_thread_depress_abort; + __Request__thread_get_special_port_t Request_thread_get_special_port; + __Request__thread_set_special_port_t Request_thread_set_special_port; + __Request__thread_info_t Request_thread_info; + __Request__thread_set_exception_ports_t Request_thread_set_exception_ports; + __Request__thread_get_exception_ports_t Request_thread_get_exception_ports; + __Request__thread_swap_exception_ports_t Request_thread_swap_exception_ports; + __Request__thread_policy_t Request_thread_policy; + __Request__thread_policy_set_t Request_thread_policy_set; + __Request__thread_policy_get_t Request_thread_policy_get; + __Request__thread_sample_t Request_thread_sample; + __Request__etap_trace_thread_t Request_etap_trace_thread; + __Request__thread_assign_t Request_thread_assign; + __Request__thread_assign_default_t Request_thread_assign_default; + __Request__thread_get_assignment_t Request_thread_get_assignment; + __Request__thread_set_policy_t Request_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ +/* typedefs for all replies */ + +#ifndef __Reply__thread_act_subsystem__defined +#define __Reply__thread_act_subsystem__defined + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_terminate_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__act_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__act_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t old_stateCnt; + natural_t old_state[144]; + } __Reply__thread_get_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_state_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_suspend_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_resume_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_abort_safely_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_depress_abort_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + } __Reply__thread_get_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_special_port_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t thread_info_outCnt; + integer_t thread_info_out[12]; + } __Reply__thread_info_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_get_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t old_handlers[32]; + /* end of the kernel processed data */ + NDR_record_t NDR; + mach_msg_type_number_t masksCnt; + exception_mask_t masks[32]; + exception_behavior_t old_behaviors[32]; + thread_state_flavor_t old_flavors[32]; + } __Reply__thread_swap_exception_ports_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_policy_set_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + mach_msg_type_number_t policy_infoCnt; + integer_t policy_info[16]; + boolean_t get_default; + } __Reply__thread_policy_get_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_sample_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__etap_trace_thread_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_assign_default_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t assigned_set; + /* end of the kernel processed data */ + } __Reply__thread_get_assignment_t; +#ifdef __MigPackStructs +#pragma pack() +#endif + +#ifdef __MigPackStructs +#pragma pack(4) +#endif + typedef struct { + mach_msg_header_t Head; + NDR_record_t NDR; + kern_return_t RetCode; + } __Reply__thread_set_policy_t; +#ifdef __MigPackStructs +#pragma pack() +#endif +#endif /* !__Reply__thread_act_subsystem__defined */ + +/* union of all replies */ + +#ifndef __ReplyUnion__thread_act_subsystem__defined +#define __ReplyUnion__thread_act_subsystem__defined +union __ReplyUnion__thread_act_subsystem { + __Reply__thread_terminate_t Reply_thread_terminate; + __Reply__act_get_state_t Reply_act_get_state; + __Reply__act_set_state_t Reply_act_set_state; + __Reply__thread_get_state_t Reply_thread_get_state; + __Reply__thread_set_state_t Reply_thread_set_state; + __Reply__thread_suspend_t Reply_thread_suspend; + __Reply__thread_resume_t Reply_thread_resume; + __Reply__thread_abort_t Reply_thread_abort; + __Reply__thread_abort_safely_t Reply_thread_abort_safely; + __Reply__thread_depress_abort_t Reply_thread_depress_abort; + __Reply__thread_get_special_port_t Reply_thread_get_special_port; + __Reply__thread_set_special_port_t Reply_thread_set_special_port; + __Reply__thread_info_t Reply_thread_info; + __Reply__thread_set_exception_ports_t Reply_thread_set_exception_ports; + __Reply__thread_get_exception_ports_t Reply_thread_get_exception_ports; + __Reply__thread_swap_exception_ports_t Reply_thread_swap_exception_ports; + __Reply__thread_policy_t Reply_thread_policy; + __Reply__thread_policy_set_t Reply_thread_policy_set; + __Reply__thread_policy_get_t Reply_thread_policy_get; + __Reply__thread_sample_t Reply_thread_sample; + __Reply__etap_trace_thread_t Reply_etap_trace_thread; + __Reply__thread_assign_t Reply_thread_assign; + __Reply__thread_assign_default_t Reply_thread_assign_default; + __Reply__thread_get_assignment_t Reply_thread_get_assignment; + __Reply__thread_set_policy_t Reply_thread_set_policy; +}; +#endif /* !__RequestUnion__thread_act_subsystem__defined */ + +#ifndef subsystem_to_name_map_thread_act +#define subsystem_to_name_map_thread_act \ + { "thread_terminate", 3600 },\ + { "act_get_state", 3601 },\ + { "act_set_state", 3602 },\ + { "thread_get_state", 3603 },\ + { "thread_set_state", 3604 },\ + { "thread_suspend", 3605 },\ + { "thread_resume", 3606 },\ + { "thread_abort", 3607 },\ + { "thread_abort_safely", 3608 },\ + { "thread_depress_abort", 3609 },\ + { "thread_get_special_port", 3610 },\ + { "thread_set_special_port", 3611 },\ + { "thread_info", 3612 },\ + { "thread_set_exception_ports", 3613 },\ + { "thread_get_exception_ports", 3614 },\ + { "thread_swap_exception_ports", 3615 },\ + { "thread_policy", 3616 },\ + { "thread_policy_set", 3617 },\ + { "thread_policy_get", 3618 },\ + { "thread_sample", 3619 },\ + { "etap_trace_thread", 3620 },\ + { "thread_assign", 3621 },\ + { "thread_assign_default", 3622 },\ + { "thread_get_assignment", 3623 },\ + { "thread_set_policy", 3624 } +#endif + +#ifdef __AfterMigUserHeader +__AfterMigUserHeader +#endif /* __AfterMigUserHeader */ + +#endif /* _thread_act_user_ */ diff --git a/i386/include/machine/.svn/all-wcprops b/i386/include/machine/.svn/all-wcprops new file mode 100644 index 0000000..67cf4bc --- /dev/null +++ b/i386/include/machine/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine +END +signal.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/signal.h +END +byte_order.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/byte_order.h +END +endian.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/endian.h +END +_param.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/_param.h +END +_limits.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/_limits.h +END +fasttrap_isa.h +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/fasttrap_isa.h +END +param.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/param.h +END +profile.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/profile.h +END +limits.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/limits.h +END +setjmp.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/setjmp.h +END +_types.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/_types.h +END +vmparam.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/vmparam.h +END +types.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/types.h +END +_structs.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/machine/_structs.h +END diff --git a/i386/include/machine/.svn/entries b/i386/include/machine/.svn/entries new file mode 100644 index 0000000..0b2a2c3 --- /dev/null +++ b/i386/include/machine/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/machine +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +signal.h +file + + + + +2013-08-27T23:54:48.000000Z +e8afaa8451ffa309d4fab7fc3ac8af85 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1666 + +byte_order.h +file + + + + +2013-08-27T23:54:48.000000Z +1c26aeb92c8fcd195d94b894465233a8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1529 + +endian.h +file + + + + +2013-08-27T23:54:48.000000Z +b6db3029c42fa047ac61fdd3b95639bc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1731 + +_param.h +file + + + + +2013-08-27T23:54:48.000000Z +01b039f30286051912a5091c9ea8a73d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1567 + +_limits.h +file + + + + +2013-08-27T23:54:48.000000Z +f06d3e61c780823dbaa1c32c527b488a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1672 + +fasttrap_isa.h +file + + + + +2013-08-27T23:54:48.000000Z +a591a43479ae5357e909057fc6e918f8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1702 + +param.h +file + + + + +2013-08-27T23:54:48.000000Z +8dfe8b76e43139d59b20489455fa18f3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1726 + +profile.h +file + + + + +2013-08-27T23:54:48.000000Z +55d7d01ed3b5475d8b1ad0b182a2791b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1740 + +limits.h +file + + + + +2013-08-27T23:54:48.000000Z +18252d105a423d3cc282c8cdf4caed9e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +458 + +setjmp.h +file + + + + +2013-08-27T23:54:48.000000Z +0cc9365be8f48eb4d52ca25db6078b66 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1723 + +_types.h +file + + + + +2013-08-27T23:54:48.000000Z +976a0201718b12c2af7373279552edeb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1666 + +vmparam.h +file + + + + +2013-08-27T23:54:48.000000Z +ff6ac5b9817b2cc86175c33f5220e5c1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1672 + +types.h +file + + + + +2013-08-27T23:54:48.000000Z +68eec2e6905e31737cab31157d63c15f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1726 + +_structs.h +file + + + + +2013-08-27T23:54:48.000000Z +939d1db001aa81b4a30df7b5aaf07bfe +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1573 + diff --git a/i386/include/machine/.svn/text-base/_limits.h.svn-base b/i386/include/machine/.svn/text-base/_limits.h.svn-base new file mode 100644 index 0000000..373e726 --- /dev/null +++ b/i386/include/machine/.svn/text-base/_limits.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2004-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE__LIMITS_H_ +#define _BSD_MACHINE__LIMITS_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_limits.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/_limits.h" +#elif defined (__arm__) +#include "arm/_limits.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE__LIMITS_H_ */ diff --git a/i386/include/machine/.svn/text-base/_param.h.svn-base b/i386/include/machine/.svn/text-base/_param.h.svn-base new file mode 100644 index 0000000..4171fd0 --- /dev/null +++ b/i386/include/machine/.svn/text-base/_param.h.svn-base @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_param.h" +#elif defined (__i386__) || defined (__x86_64__) +#include "i386/_param.h" +#elif defined (__arm__) +#include "arm/_param.h" +#else +#error architecture not supported +#endif diff --git a/i386/include/machine/.svn/text-base/_structs.h.svn-base b/i386/include/machine/.svn/text-base/_structs.h.svn-base new file mode 100644 index 0000000..0e35938 --- /dev/null +++ b/i386/include/machine/.svn/text-base/_structs.h.svn-base @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_structs.h" +#elif defined (__i386__) || defined (__x86_64__) +#include "i386/_structs.h" +#elif defined (__arm__) +#include "arm/_structs.h" +#else +#error architecture not supported +#endif diff --git a/i386/include/machine/.svn/text-base/_types.h.svn-base b/i386/include/machine/.svn/text-base/_types.h.svn-base new file mode 100644 index 0000000..9f2d6d2 --- /dev/null +++ b/i386/include/machine/.svn/text-base/_types.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE__TYPES_H_ +#define _BSD_MACHINE__TYPES_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_types.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/_types.h" +#elif defined (__arm__) +#include "arm/_types.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE__TYPES_H_ */ diff --git a/i386/include/machine/.svn/text-base/byte_order.h.svn-base b/i386/include/machine/.svn/text-base/byte_order.h.svn-base new file mode 100644 index 0000000..4008142 --- /dev/null +++ b/i386/include/machine/.svn/text-base/byte_order.h.svn-base @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. + */ + +#ifndef _BSD_MACHINE_BYTE_ORDER_H_ +#define _BSD_MACHINE_BYTE_ORDER_H_ + +#include <architecture/byte_order.h> + +#endif /* _BSD_MACHINE_BYTE_ORDER_H_ */ diff --git a/i386/include/machine/.svn/text-base/endian.h.svn-base b/i386/include/machine/.svn/text-base/endian.h.svn-base new file mode 100644 index 0000000..a49d52a --- /dev/null +++ b/i386/include/machine/.svn/text-base/endian.h.svn-base @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +#ifndef _BSD_MACHINE_ENDIAN_H_ +#define _BSD_MACHINE_ENDIAN_H_ + +#if defined (__ppc__) || defined(__ppc64__) +#include "ppc/endian.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/endian.h" +#elif defined (__arm__) +#include "arm/endian.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_ENDIAN_H_ */ diff --git a/i386/include/machine/.svn/text-base/fasttrap_isa.h.svn-base b/i386/include/machine/.svn/text-base/fasttrap_isa.h.svn-base new file mode 100644 index 0000000..fa881d3 --- /dev/null +++ b/i386/include/machine/.svn/text-base/fasttrap_isa.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE_FASTTRAP_ISA_H_ +#define _BSD_MACHINE_FASTTRAP_ISA_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/fasttrap_isa.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/fasttrap_isa.h" +#elif defined (__arm__) +#include "arm/fasttrap_isa.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_FASTTRAP_ISA_H_ */ diff --git a/i386/include/machine/.svn/text-base/limits.h.svn-base b/i386/include/machine/.svn/text-base/limits.h.svn-base new file mode 100644 index 0000000..d52080f --- /dev/null +++ b/i386/include/machine/.svn/text-base/limits.h.svn-base @@ -0,0 +1,13 @@ +/* This is the `system' limits.h, independent of any particular + compiler. GCC provides its own limits.h which can be found in + /usr/lib/gcc, although it is not very informative. + This file is public domain. */ +#if defined (__ppc__) || defined (__ppc64__) +#include <ppc/limits.h> +#elif defined (__i386__) || defined(__x86_64__) +#include <i386/limits.h> +#elif defined (__arm__) +#include <arm/limits.h> +#else +#error architecture not supported +#endif diff --git a/i386/include/machine/.svn/text-base/param.h.svn-base b/i386/include/machine/.svn/text-base/param.h.svn-base new file mode 100644 index 0000000..0b2a2ad --- /dev/null +++ b/i386/include/machine/.svn/text-base/param.h.svn-base @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +#ifndef _BSD_MACHINE_PARAM_H_ +#define _BSD_MACHINE_PARAM_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/param.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/param.h" +#elif defined (__arm__) +#include "arm/param.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_PARAM_H_ */ diff --git a/i386/include/machine/.svn/text-base/profile.h.svn-base b/i386/include/machine/.svn/text-base/profile.h.svn-base new file mode 100644 index 0000000..45e4de8 --- /dev/null +++ b/i386/include/machine/.svn/text-base/profile.h.svn-base @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1997-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * History : + * 29-Sep-1997 Umesh Vaishampayan + * Created. + */ +#ifndef _BSD_MACHINE_PROFILE_H_ +#define _BSD_MACHINE_PROFILE_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/profile.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/profile.h" +#elif defined (__arm__) +#include "arm/profile.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_PROFILE_H_ */ diff --git a/i386/include/machine/.svn/text-base/setjmp.h.svn-base b/i386/include/machine/.svn/text-base/setjmp.h.svn-base new file mode 100644 index 0000000..9aa71b5 --- /dev/null +++ b/i386/include/machine/.svn/text-base/setjmp.h.svn-base @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved + */ +#ifndef _MACHINE_SETJMP_H_ +#define _MACHINE_SETJMP_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/setjmp.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/setjmp.h" +#elif defined (__arm__) +#include "arm/setjmp.h" +#else +#error architecture not supported +#endif + +#endif /* _MACHINE_SETJMP_H_ */ diff --git a/i386/include/machine/.svn/text-base/signal.h.svn-base b/i386/include/machine/.svn/text-base/signal.h.svn-base new file mode 100644 index 0000000..7457d1c --- /dev/null +++ b/i386/include/machine/.svn/text-base/signal.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE_SIGNAL_H_ +#define _BSD_MACHINE_SIGNAL_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/signal.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/signal.h" +#elif defined (__arm__) +#include "arm/signal.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_SIGNAL_H_ */ diff --git a/i386/include/machine/.svn/text-base/types.h.svn-base b/i386/include/machine/.svn/text-base/types.h.svn-base new file mode 100644 index 0000000..2bff809 --- /dev/null +++ b/i386/include/machine/.svn/text-base/types.h.svn-base @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +#ifndef _BSD_MACHINE_TYPES_H_ +#define _BSD_MACHINE_TYPES_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/types.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/types.h" +#elif defined (__arm__) +#include "arm/types.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_TYPES_H_ */ diff --git a/i386/include/machine/.svn/text-base/vmparam.h.svn-base b/i386/include/machine/.svn/text-base/vmparam.h.svn-base new file mode 100644 index 0000000..d9d0d74 --- /dev/null +++ b/i386/include/machine/.svn/text-base/vmparam.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE_VMPARAM_H_ +#define _BSD_MACHINE_VMPARAM_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/vmparam.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/vmparam.h" +#elif defined (__arm__) +#include "arm/vmparam.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_VMPARAM_H_ */ diff --git a/i386/include/machine/_limits.h b/i386/include/machine/_limits.h new file mode 100644 index 0000000..373e726 --- /dev/null +++ b/i386/include/machine/_limits.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2004-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE__LIMITS_H_ +#define _BSD_MACHINE__LIMITS_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_limits.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/_limits.h" +#elif defined (__arm__) +#include "arm/_limits.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE__LIMITS_H_ */ diff --git a/i386/include/machine/_param.h b/i386/include/machine/_param.h new file mode 100644 index 0000000..4171fd0 --- /dev/null +++ b/i386/include/machine/_param.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_param.h" +#elif defined (__i386__) || defined (__x86_64__) +#include "i386/_param.h" +#elif defined (__arm__) +#include "arm/_param.h" +#else +#error architecture not supported +#endif diff --git a/i386/include/machine/_structs.h b/i386/include/machine/_structs.h new file mode 100644 index 0000000..0e35938 --- /dev/null +++ b/i386/include/machine/_structs.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2004-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_structs.h" +#elif defined (__i386__) || defined (__x86_64__) +#include "i386/_structs.h" +#elif defined (__arm__) +#include "arm/_structs.h" +#else +#error architecture not supported +#endif diff --git a/i386/include/machine/_types.h b/i386/include/machine/_types.h new file mode 100644 index 0000000..9f2d6d2 --- /dev/null +++ b/i386/include/machine/_types.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE__TYPES_H_ +#define _BSD_MACHINE__TYPES_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/_types.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/_types.h" +#elif defined (__arm__) +#include "arm/_types.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE__TYPES_H_ */ diff --git a/i386/include/machine/byte_order.h b/i386/include/machine/byte_order.h new file mode 100644 index 0000000..4008142 --- /dev/null +++ b/i386/include/machine/byte_order.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. + */ + +#ifndef _BSD_MACHINE_BYTE_ORDER_H_ +#define _BSD_MACHINE_BYTE_ORDER_H_ + +#include <architecture/byte_order.h> + +#endif /* _BSD_MACHINE_BYTE_ORDER_H_ */ diff --git a/i386/include/machine/endian.h b/i386/include/machine/endian.h new file mode 100644 index 0000000..a49d52a --- /dev/null +++ b/i386/include/machine/endian.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +#ifndef _BSD_MACHINE_ENDIAN_H_ +#define _BSD_MACHINE_ENDIAN_H_ + +#if defined (__ppc__) || defined(__ppc64__) +#include "ppc/endian.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/endian.h" +#elif defined (__arm__) +#include "arm/endian.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_ENDIAN_H_ */ diff --git a/i386/include/machine/fasttrap_isa.h b/i386/include/machine/fasttrap_isa.h new file mode 100644 index 0000000..fa881d3 --- /dev/null +++ b/i386/include/machine/fasttrap_isa.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE_FASTTRAP_ISA_H_ +#define _BSD_MACHINE_FASTTRAP_ISA_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/fasttrap_isa.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/fasttrap_isa.h" +#elif defined (__arm__) +#include "arm/fasttrap_isa.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_FASTTRAP_ISA_H_ */ diff --git a/i386/include/machine/limits.h b/i386/include/machine/limits.h new file mode 100644 index 0000000..d52080f --- /dev/null +++ b/i386/include/machine/limits.h @@ -0,0 +1,13 @@ +/* This is the `system' limits.h, independent of any particular + compiler. GCC provides its own limits.h which can be found in + /usr/lib/gcc, although it is not very informative. + This file is public domain. */ +#if defined (__ppc__) || defined (__ppc64__) +#include <ppc/limits.h> +#elif defined (__i386__) || defined(__x86_64__) +#include <i386/limits.h> +#elif defined (__arm__) +#include <arm/limits.h> +#else +#error architecture not supported +#endif diff --git a/i386/include/machine/param.h b/i386/include/machine/param.h new file mode 100644 index 0000000..0b2a2ad --- /dev/null +++ b/i386/include/machine/param.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +#ifndef _BSD_MACHINE_PARAM_H_ +#define _BSD_MACHINE_PARAM_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/param.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/param.h" +#elif defined (__arm__) +#include "arm/param.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_PARAM_H_ */ diff --git a/i386/include/machine/profile.h b/i386/include/machine/profile.h new file mode 100644 index 0000000..45e4de8 --- /dev/null +++ b/i386/include/machine/profile.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1997-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * History : + * 29-Sep-1997 Umesh Vaishampayan + * Created. + */ +#ifndef _BSD_MACHINE_PROFILE_H_ +#define _BSD_MACHINE_PROFILE_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/profile.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/profile.h" +#elif defined (__arm__) +#include "arm/profile.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_PROFILE_H_ */ diff --git a/i386/include/machine/setjmp.h b/i386/include/machine/setjmp.h new file mode 100644 index 0000000..9aa71b5 --- /dev/null +++ b/i386/include/machine/setjmp.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved + */ +#ifndef _MACHINE_SETJMP_H_ +#define _MACHINE_SETJMP_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/setjmp.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/setjmp.h" +#elif defined (__arm__) +#include "arm/setjmp.h" +#else +#error architecture not supported +#endif + +#endif /* _MACHINE_SETJMP_H_ */ diff --git a/i386/include/machine/signal.h b/i386/include/machine/signal.h new file mode 100644 index 0000000..7457d1c --- /dev/null +++ b/i386/include/machine/signal.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE_SIGNAL_H_ +#define _BSD_MACHINE_SIGNAL_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/signal.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/signal.h" +#elif defined (__arm__) +#include "arm/signal.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_SIGNAL_H_ */ diff --git a/i386/include/machine/types.h b/i386/include/machine/types.h new file mode 100644 index 0000000..2bff809 --- /dev/null +++ b/i386/include/machine/types.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1995 NeXT Computer, Inc. All rights reserved. + */ +#ifndef _BSD_MACHINE_TYPES_H_ +#define _BSD_MACHINE_TYPES_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/types.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/types.h" +#elif defined (__arm__) +#include "arm/types.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_TYPES_H_ */ diff --git a/i386/include/machine/vmparam.h b/i386/include/machine/vmparam.h new file mode 100644 index 0000000..d9d0d74 --- /dev/null +++ b/i386/include/machine/vmparam.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_MACHINE_VMPARAM_H_ +#define _BSD_MACHINE_VMPARAM_H_ + +#if defined (__ppc__) || defined (__ppc64__) +#include "ppc/vmparam.h" +#elif defined (__i386__) || defined(__x86_64__) +#include "i386/vmparam.h" +#elif defined (__arm__) +#include "arm/vmparam.h" +#else +#error architecture not supported +#endif + +#endif /* _BSD_MACHINE_VMPARAM_H_ */ diff --git a/i386/include/math.h b/i386/include/math.h new file mode 100644 index 0000000..6b2172f --- /dev/null +++ b/i386/include/math.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef __MATH_H__ +#define __MATH_H__ + +#if (defined(__ppc__) || defined(__ppc64__)) +#include "architecture/ppc/math.h" +#elif (defined (__i386__) || defined( __x86_64__ )) +#include "architecture/i386/math.h" +#elif defined(__arm__) +#include "architecture/arm/math.h" +#else +#error Unknown architecture +#endif + +#endif /* __MATH_H__ */ diff --git a/i386/include/netinet/.svn/all-wcprops b/i386/include/netinet/.svn/all-wcprops new file mode 100644 index 0000000..95ec160 --- /dev/null +++ b/i386/include/netinet/.svn/all-wcprops @@ -0,0 +1,155 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet +END +in_pcb.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/in_pcb.h +END +tcp_fsm.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/tcp_fsm.h +END +igmp.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/igmp.h +END +ip6.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip6.h +END +tcp_seq.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/tcp_seq.h +END +tcp_var.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/tcp_var.h +END +icmp_var.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/icmp_var.h +END +udp_var.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/udp_var.h +END +ip_mroute.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip_mroute.h +END +ip_fw.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip_fw.h +END +igmp_var.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/igmp_var.h +END +in_systm.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/in_systm.h +END +in.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/in.h +END +ip.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip.h +END +in_var.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/in_var.h +END +icmp6.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/icmp6.h +END +tcpip.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/tcpip.h +END +ip_icmp.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip_icmp.h +END +ip_var.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip_var.h +END +bootp.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/bootp.h +END +if_ether.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/if_ether.h +END +ip_fw2.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/ip_fw2.h +END +tcp.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/tcp.h +END +tcp_timer.h +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/tcp_timer.h +END +udp.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet/udp.h +END diff --git a/i386/include/netinet/.svn/entries b/i386/include/netinet/.svn/entries new file mode 100644 index 0000000..bb1f366 --- /dev/null +++ b/i386/include/netinet/.svn/entries @@ -0,0 +1,878 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/netinet +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +in_pcb.h +file + + + + +2013-08-27T23:54:37.000000Z +c26eee3fdac7712380777f370e4ba48c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12627 + +tcp_fsm.h +file + + + + +2013-08-27T23:54:37.000000Z +c9aec5371c55b5339ad9f034d315bb36 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5181 + +igmp.h +file + + + + +2013-08-27T23:54:37.000000Z +c6989840a68553f4730d5db2a080bb24 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5320 + +ip6.h +file + + + + +2013-08-27T23:54:37.000000Z +3fdfa7daee31422c8dd5370bd53e29f3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9947 + +tcp_seq.h +file + + + + +2013-08-27T23:54:37.000000Z +7809d974168aa5ad49eff685b34e5a5a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4396 + +tcp_var.h +file + + + + +2013-08-27T23:54:37.000000Z +6485da7d83274c38353614cf32b12b7f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18659 + +icmp_var.h +file + + + + +2013-08-27T23:54:37.000000Z +66b45652e581db4439baea5cba0e6b37 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4582 + +udp_var.h +file + + + + +2013-08-27T23:54:37.000000Z +3df02c9836668b9cf8b0192350558dca +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5065 + +ip_mroute.h +file + + + + +2013-08-27T23:54:37.000000Z +d2fb75ae4c4cb62cf31953dfe76e4fa7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8874 + +ip_fw.h +file + + + + +2013-08-27T23:54:37.000000Z +e63034b61d8a7e8e81cde405f7397652 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10911 + +igmp_var.h +file + + + + +2013-08-27T23:54:37.000000Z +69cc935775101b9131cf97db6841cb61 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4319 + +in_systm.h +file + + + + +2013-08-27T23:54:37.000000Z +92adb9e94b48dde240116eeff6059a04 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3975 + +in.h +file + + + + +2013-08-27T23:54:37.000000Z +3caf03fee517e546d71b89a4b7043d02 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +21524 + +ip.h +file + + + + +2013-08-27T23:54:37.000000Z +c2d42572ce066c5201292506ccec6eb5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8100 + +icmp6.h +file + + + + +2013-08-27T23:54:37.000000Z +9ff3bf9d24cef1f461178f8ac352f452 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22648 + +in_var.h +file + + + + +2013-08-27T23:54:37.000000Z +427eada23a8de923a8282f57a55922c1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5170 + +tcpip.h +file + + + + +2013-08-27T23:54:37.000000Z +75a2450964c14fd7b8b7089e921a90e1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4271 + +ip_icmp.h +file + + + + +2013-08-27T23:54:37.000000Z +3ce4eb960a3801045e5893fc3ed290b5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9451 + +ip_var.h +file + + + + +2013-08-27T23:54:37.000000Z +f13a8eb38544b795448f44ae9581b669 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5773 + +bootp.h +file + + + + +2013-08-27T23:54:37.000000Z +c347e01a0d1ad03703c697b362a1485c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4165 + +if_ether.h +file + + + + +2013-08-27T23:54:37.000000Z +fe587cb1d64ab17230b0f9f1466fb9dd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5812 + +ip_fw2.h +file + + + + +2013-08-27T23:54:37.000000Z +e621f1777bfa6587167c99c36ff8d2e0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13913 + +tcp.h +file + + + + +2013-08-27T23:54:37.000000Z +62d4ccfbb6b657370158b938d1bc1451 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8239 + +tcp_timer.h +file + + + + +2013-08-27T23:54:37.000000Z +0f3ef73c2845e8b36d95b6cd1a83f2be +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5760 + +udp.h +file + + + + +2013-08-27T23:54:37.000000Z +4c65310c137ba39a1392671eb67bc212 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3694 + diff --git a/i386/include/netinet/.svn/text-base/bootp.h.svn-base b/i386/include/netinet/.svn/text-base/bootp.h.svn-base new file mode 100644 index 0000000..27f2581 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/bootp.h.svn-base @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Bootstrap Protocol (BOOTP). RFC 951. + */ +/* + * HISTORY + * + * 14 May 1992 ? at NeXT + * Added correct padding to struct nextvend. This is + * needed for the i386 due to alignment differences wrt + * the m68k. Also adjusted the size of the array fields + * because the NeXT vendor area was overflowing the bootp + * packet. + */ + +#include <netinet/udp.h> + +#define iaddr_t struct in_addr + +struct bootp { + u_char bp_op; /* packet opcode type */ +#define BOOTREQUEST 1 +#define BOOTREPLY 2 + u_char bp_htype; /* hardware addr type */ + u_char bp_hlen; /* hardware addr length */ + u_char bp_hops; /* gateway hops */ + u_int32_t bp_xid; /* transaction ID */ + u_short bp_secs; /* seconds since boot began */ + u_short bp_unused; + iaddr_t bp_ciaddr; /* client IP address */ + iaddr_t bp_yiaddr; /* 'your' IP address */ + iaddr_t bp_siaddr; /* server IP address */ + iaddr_t bp_giaddr; /* gateway IP address */ + u_char bp_chaddr[16]; /* client hardware address */ + u_char bp_sname[64]; /* server host name */ + u_char bp_file[128]; /* boot file name */ + u_char bp_vend[64]; /* vendor-specific area */ +}; + +/* + * UDP port numbers, server and client. + */ +#define IPPORT_BOOTPS 67 +#define IPPORT_BOOTPC 68 + +/* + * "vendor" data permitted for Stanford boot clients. + */ +struct vend { + u_char v_magic[4]; /* magic number */ + u_int32_t v_flags; /* flags/opcodes, etc. */ + u_char v_unused[56]; /* currently unused */ +}; +#define VM_STANFORD "STAN" /* v_magic for Stanford */ + +/* v_flags values */ +#define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */ +#define VF_HELP 2 /* help me, I'm not registered */ + +#define NVMAXTEXT 55 /* don't change this, it just fits RFC951 */ +struct nextvend { + u_char nv_magic[4]; /* Magic number for vendor specificity */ + u_char nv_version; /* NeXT protocol version */ + /* + * Round the beginning + * of the union to a 16 + * bit boundary due to + * struct/union alignment + * on the m68k. + */ + unsigned short :0; + union { + u_char NV0[58]; + struct { + u_char NV1_opcode; /* opcode - Version 1 */ + u_char NV1_xid; /* transcation id */ + u_char NV1_text[NVMAXTEXT]; /* text */ + u_char NV1_null; /* null terminator */ + } NV1; + } nv_U; +}; +#define nv_unused nv_U.NV0 +#define nv_opcode nv_U.NV1.NV1_opcode +#define nv_xid nv_U.NV1.NV1_xid +#define nv_text nv_U.NV1.NV1_text +#define nv_null nv_U.NV1.NV1_null + +/* Magic number */ +#define VM_NEXT "NeXT" /* v_magic for NeXT, Inc. */ + +/* Opcodes */ +#define BPOP_OK 0 +#define BPOP_QUERY 1 +#define BPOP_QUERY_NE 2 +#define BPOP_ERROR 3 + +struct bootp_packet { + struct ip bp_ip; + struct udphdr bp_udp; + struct bootp bp_bootp; +}; + +#define BOOTP_PKTSIZE (sizeof (struct bootp_packet)) + +/* backoffs must be masks */ +#define BOOTP_MIN_BACKOFF 0x7ff /* 2.048 sec */ +#define BOOTP_MAX_BACKOFF 0xffff /* 65.535 sec */ +#define BOOTP_RETRY 6 /* # retries */ + diff --git a/i386/include/netinet/.svn/text-base/icmp6.h.svn-base b/i386/include/netinet/.svn/text-base/icmp6.h.svn-base new file mode 100644 index 0000000..b8fbb81 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/icmp6.h.svn-base @@ -0,0 +1,620 @@ +/* + * Copyright (c) 2000,2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_ICMP6_H_ +#define _NETINET_ICMP6_H_ +#include <sys/appleapiopts.h> + +#define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr) + - sizeof(struct icmp6_hdr) */ + +struct icmp6_hdr { + u_int8_t icmp6_type; /* type field */ + u_int8_t icmp6_code; /* code field */ + u_int16_t icmp6_cksum; /* checksum field */ + union { + u_int32_t icmp6_un_data32[1]; /* type-specific field */ + u_int16_t icmp6_un_data16[2]; /* type-specific field */ + u_int8_t icmp6_un_data8[4]; /* type-specific field */ + } icmp6_dataun; +}; + +#define icmp6_data32 icmp6_dataun.icmp6_un_data32 +#define icmp6_data16 icmp6_dataun.icmp6_un_data16 +#define icmp6_data8 icmp6_dataun.icmp6_un_data8 +#define icmp6_pptr icmp6_data32[0] /* parameter prob */ +#define icmp6_mtu icmp6_data32[0] /* packet too big */ +#define icmp6_id icmp6_data16[0] /* echo request/reply */ +#define icmp6_seq icmp6_data16[1] /* echo request/reply */ +#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */ + +#define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */ +#define ICMP6_PACKET_TOO_BIG 2 /* packet too big */ +#define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */ +#define ICMP6_PARAM_PROB 4 /* ip6 header bad */ + +#define ICMP6_ECHO_REQUEST 128 /* echo service */ +#define ICMP6_ECHO_REPLY 129 /* echo reply */ +#define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */ +#define MLD6_LISTENER_QUERY 130 /* multicast listener query */ +#define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */ +#define MLD6_LISTENER_REPORT 131 /* multicast listener report */ +#define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */ +#define MLD6_LISTENER_DONE 132 /* multicast listener done */ + +#define MLD_LISTENER_QUERY MLD6_LISTENER_QUERY +#define MLD_LISTENER_REPORT MLD6_LISTENER_REPORT +#define MLD_LISTENER_DONE MLD6_LISTENER_DONE + +#define ND_ROUTER_SOLICIT 133 /* router solicitation */ +#define ND_ROUTER_ADVERT 134 /* router advertisment */ +#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */ +#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisment */ +#define ND_REDIRECT 137 /* redirect */ + +#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */ + +#define ICMP6_WRUREQUEST 139 /* who are you request */ +#define ICMP6_WRUREPLY 140 /* who are you reply */ +#define ICMP6_FQDN_QUERY 139 /* FQDN query */ +#define ICMP6_FQDN_REPLY 140 /* FQDN reply */ +#define ICMP6_NI_QUERY 139 /* node information request */ +#define ICMP6_NI_REPLY 140 /* node information reply */ + +/* The definitions below are experimental. TBA */ +#define MLD6_MTRACE_RESP 200 /* mtrace response(to sender) */ +#define MLD6_MTRACE 201 /* mtrace messages */ + +#define MLD_MTRACE_RESP MLD6_MTRACE_RESP +#define MLD_MTRACE MLD6_MTRACE + +#define ICMP6_HADISCOV_REQUEST 202 /* XXX To be defined */ +#define ICMP6_HADISCOV_REPLY 203 /* XXX To be defined */ + +#define ICMP6_MAXTYPE 203 + +#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ +#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ +#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */ +#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ +#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ +#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ + +#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ +#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ + +#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ +#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */ +#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */ + +#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */ + +#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */ +#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */ +#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */ + +#define ICMP6_NI_SUCCESS 0 /* node information successful reply */ +#define ICMP6_NI_REFUSED 1 /* node information request is refused */ +#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */ + +#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */ +#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */ +#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ + +/* Used in kernel only */ +#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */ +#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */ + +/* + * Multicast Listener Discovery + */ +struct mld6_hdr { + struct icmp6_hdr mld6_hdr; + struct in6_addr mld6_addr; /* multicast address */ +}; + +#define mld6_type mld6_hdr.icmp6_type +#define mld6_code mld6_hdr.icmp6_code +#define mld6_cksum mld6_hdr.icmp6_cksum +#define mld6_maxdelay mld6_hdr.icmp6_data16[0] +#define mld6_reserved mld6_hdr.icmp6_data16[1] + +/* + * Neighbor Discovery + */ + +struct nd_router_solicit { /* router solicitation */ + struct icmp6_hdr nd_rs_hdr; + /* could be followed by options */ +}; + +#define nd_rs_type nd_rs_hdr.icmp6_type +#define nd_rs_code nd_rs_hdr.icmp6_code +#define nd_rs_cksum nd_rs_hdr.icmp6_cksum +#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0] + +struct nd_router_advert { /* router advertisement */ + struct icmp6_hdr nd_ra_hdr; + u_int32_t nd_ra_reachable; /* reachable time */ + u_int32_t nd_ra_retransmit; /* retransmit timer */ + /* could be followed by options */ +}; + +#define nd_ra_type nd_ra_hdr.icmp6_type +#define nd_ra_code nd_ra_hdr.icmp6_code +#define nd_ra_cksum nd_ra_hdr.icmp6_cksum +#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] +#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] +#define ND_RA_FLAG_MANAGED 0x80 +#define ND_RA_FLAG_OTHER 0x40 +#define ND_RA_FLAG_HA 0x20 + +/* + * Router preference values based on draft-draves-ipngwg-router-selection-01. + * These are non-standard definitions. + */ +#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ + +#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */ +#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */ +#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */ +#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */ + +#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] + +struct nd_neighbor_solicit { /* neighbor solicitation */ + struct icmp6_hdr nd_ns_hdr; + struct in6_addr nd_ns_target; /*target address */ + /* could be followed by options */ +}; + +#define nd_ns_type nd_ns_hdr.icmp6_type +#define nd_ns_code nd_ns_hdr.icmp6_code +#define nd_ns_cksum nd_ns_hdr.icmp6_cksum +#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0] + +struct nd_neighbor_advert { /* neighbor advertisement */ + struct icmp6_hdr nd_na_hdr; + struct in6_addr nd_na_target; /* target address */ + /* could be followed by options */ +}; + +#define nd_na_type nd_na_hdr.icmp6_type +#define nd_na_code nd_na_hdr.icmp6_code +#define nd_na_cksum nd_na_hdr.icmp6_cksum +#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] +#if BYTE_ORDER == BIG_ENDIAN +#define ND_NA_FLAG_ROUTER 0x80000000 +#define ND_NA_FLAG_SOLICITED 0x40000000 +#define ND_NA_FLAG_OVERRIDE 0x20000000 +#else +#if BYTE_ORDER == LITTLE_ENDIAN +#define ND_NA_FLAG_ROUTER 0x80 +#define ND_NA_FLAG_SOLICITED 0x40 +#define ND_NA_FLAG_OVERRIDE 0x20 +#endif +#endif + +struct nd_redirect { /* redirect */ + struct icmp6_hdr nd_rd_hdr; + struct in6_addr nd_rd_target; /* target address */ + struct in6_addr nd_rd_dst; /* destination address */ + /* could be followed by options */ +}; + +#define nd_rd_type nd_rd_hdr.icmp6_type +#define nd_rd_code nd_rd_hdr.icmp6_code +#define nd_rd_cksum nd_rd_hdr.icmp6_cksum +#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] + +struct nd_opt_hdr { /* Neighbor discovery option header */ + u_int8_t nd_opt_type; + u_int8_t nd_opt_len; + /* followed by option specific data*/ +}; + +#define ND_OPT_SOURCE_LINKADDR 1 +#define ND_OPT_TARGET_LINKADDR 2 +#define ND_OPT_PREFIX_INFORMATION 3 +#define ND_OPT_REDIRECTED_HEADER 4 +#define ND_OPT_MTU 5 + +#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */ + +struct nd_opt_prefix_info { /* prefix information */ + u_int8_t nd_opt_pi_type; + u_int8_t nd_opt_pi_len; + u_int8_t nd_opt_pi_prefix_len; + u_int8_t nd_opt_pi_flags_reserved; + u_int32_t nd_opt_pi_valid_time; + u_int32_t nd_opt_pi_preferred_time; + u_int32_t nd_opt_pi_reserved2; + struct in6_addr nd_opt_pi_prefix; +}; + +#define ND_OPT_PI_FLAG_ONLINK 0x80 +#define ND_OPT_PI_FLAG_AUTO 0x40 + +struct nd_opt_rd_hdr { /* redirected header */ + u_int8_t nd_opt_rh_type; + u_int8_t nd_opt_rh_len; + u_int16_t nd_opt_rh_reserved1; + u_int32_t nd_opt_rh_reserved2; + /* followed by IP header and data */ +}; + +struct nd_opt_mtu { /* MTU option */ + u_int8_t nd_opt_mtu_type; + u_int8_t nd_opt_mtu_len; + u_int16_t nd_opt_mtu_reserved; + u_int32_t nd_opt_mtu_mtu; +}; + +struct nd_opt_route_info { /* route info */ + u_int8_t nd_opt_rti_type; + u_int8_t nd_opt_rti_len; + u_int8_t nd_opt_rti_prefixlen; + u_int8_t nd_opt_rti_flags; + u_int32_t nd_opt_rti_lifetime; + /* followed by prefix */ +}; + +/* + * icmp6 namelookup + */ + +struct icmp6_namelookup { + struct icmp6_hdr icmp6_nl_hdr; + u_int8_t icmp6_nl_nonce[8]; + int32_t icmp6_nl_ttl; +#if 0 + u_int8_t icmp6_nl_len; + u_int8_t icmp6_nl_name[3]; +#endif + /* could be followed by options */ +}; + +/* + * icmp6 node information + */ +struct icmp6_nodeinfo { + struct icmp6_hdr icmp6_ni_hdr; + u_int8_t icmp6_ni_nonce[8]; + /* could be followed by reply data */ +}; + +#define ni_type icmp6_ni_hdr.icmp6_type +#define ni_code icmp6_ni_hdr.icmp6_code +#define ni_cksum icmp6_ni_hdr.icmp6_cksum +#define ni_qtype icmp6_ni_hdr.icmp6_data16[0] +#define ni_flags icmp6_ni_hdr.icmp6_data16[1] + +#define NI_QTYPE_NOOP 0 /* NOOP */ +#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */ +#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */ +#define NI_QTYPE_DNSNAME 2 /* DNS Name */ +#define NI_QTYPE_NODEADDR 3 /* Node Addresses */ +#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ + +#if BYTE_ORDER == BIG_ENDIAN +#define NI_SUPTYPE_FLAG_COMPRESS 0x1 +#define NI_FQDN_FLAG_VALIDTTL 0x1 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define NI_SUPTYPE_FLAG_COMPRESS 0x0100 +#define NI_FQDN_FLAG_VALIDTTL 0x0100 +#endif + +#ifdef NAME_LOOKUPS_04 +#if BYTE_ORDER == BIG_ENDIAN +#define NI_NODEADDR_FLAG_LINKLOCAL 0x1 +#define NI_NODEADDR_FLAG_SITELOCAL 0x2 +#define NI_NODEADDR_FLAG_GLOBAL 0x4 +#define NI_NODEADDR_FLAG_ALL 0x8 +#define NI_NODEADDR_FLAG_TRUNCATE 0x10 +#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */ +#elif BYTE_ORDER == LITTLE_ENDIAN +#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100 +#define NI_NODEADDR_FLAG_SITELOCAL 0x0200 +#define NI_NODEADDR_FLAG_GLOBAL 0x0400 +#define NI_NODEADDR_FLAG_ALL 0x0800 +#define NI_NODEADDR_FLAG_TRUNCATE 0x1000 +#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */ +#endif +#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */ +#if BYTE_ORDER == BIG_ENDIAN +#define NI_NODEADDR_FLAG_TRUNCATE 0x1 +#define NI_NODEADDR_FLAG_ALL 0x2 +#define NI_NODEADDR_FLAG_COMPAT 0x4 +#define NI_NODEADDR_FLAG_LINKLOCAL 0x8 +#define NI_NODEADDR_FLAG_SITELOCAL 0x10 +#define NI_NODEADDR_FLAG_GLOBAL 0x20 +#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */ +#elif BYTE_ORDER == LITTLE_ENDIAN +#define NI_NODEADDR_FLAG_TRUNCATE 0x0100 +#define NI_NODEADDR_FLAG_ALL 0x0200 +#define NI_NODEADDR_FLAG_COMPAT 0x0400 +#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800 +#define NI_NODEADDR_FLAG_SITELOCAL 0x1000 +#define NI_NODEADDR_FLAG_GLOBAL 0x2000 +#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */ +#endif +#endif + +struct ni_reply_fqdn { + u_int32_t ni_fqdn_ttl; /* TTL */ + u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */ + u_int8_t ni_fqdn_name[3]; /* XXX: alignment */ +}; + +/* + * Router Renumbering. as router-renum-08.txt + */ +struct icmp6_router_renum { /* router renumbering header */ + struct icmp6_hdr rr_hdr; + u_int8_t rr_segnum; + u_int8_t rr_flags; + u_int16_t rr_maxdelay; + u_int32_t rr_reserved; +}; + +#define ICMP6_RR_FLAGS_TEST 0x80 +#define ICMP6_RR_FLAGS_REQRESULT 0x40 +#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 +#define ICMP6_RR_FLAGS_SPECSITE 0x10 +#define ICMP6_RR_FLAGS_PREVDONE 0x08 + +#define rr_type rr_hdr.icmp6_type +#define rr_code rr_hdr.icmp6_code +#define rr_cksum rr_hdr.icmp6_cksum +#define rr_seqnum rr_hdr.icmp6_data32[0] + +struct rr_pco_match { /* match prefix part */ + u_int8_t rpm_code; + u_int8_t rpm_len; + u_int8_t rpm_ordinal; + u_int8_t rpm_matchlen; + u_int8_t rpm_minlen; + u_int8_t rpm_maxlen; + u_int16_t rpm_reserved; + struct in6_addr rpm_prefix; +}; + +#define RPM_PCO_ADD 1 +#define RPM_PCO_CHANGE 2 +#define RPM_PCO_SETGLOBAL 3 +#define RPM_PCO_MAX 4 + +struct rr_pco_use { /* use prefix part */ + u_int8_t rpu_uselen; + u_int8_t rpu_keeplen; + u_int8_t rpu_ramask; + u_int8_t rpu_raflags; + u_int32_t rpu_vltime; + u_int32_t rpu_pltime; + u_int32_t rpu_flags; + struct in6_addr rpu_prefix; +}; +#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80 +#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40 + +#if BYTE_ORDER == BIG_ENDIAN +#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000 +#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80 +#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40 +#endif + +struct rr_result { /* router renumbering result message */ + u_int16_t rrr_flags; + u_int8_t rrr_ordinal; + u_int8_t rrr_matchedlen; + u_int32_t rrr_ifid; + struct in6_addr rrr_prefix; +}; +#if BYTE_ORDER == BIG_ENDIAN +#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002 +#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200 +#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100 +#endif + +/* + * icmp6 filter structures. + */ + +struct icmp6_filter { + u_int32_t icmp6_filt[8]; +}; + +#define ICMP6_FILTER_SETPASSALL(filterp) \ + memset(filterp, 0xff, sizeof(struct icmp6_filter)) +#define ICMP6_FILTER_SETBLOCKALL(filterp) \ + memset(filterp, 0x00, sizeof(struct icmp6_filter)) + +#define ICMP6_FILTER_SETPASS(type, filterp) \ + (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))) +#define ICMP6_FILTER_SETBLOCK(type, filterp) \ + (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))) +#define ICMP6_FILTER_WILLPASS(type, filterp) \ + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) +#define ICMP6_FILTER_WILLBLOCK(type, filterp) \ + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) + +/* + * Variables related to this implementation + * of the internet control message protocol version 6. + */ +struct icmp6errstat { + u_quad_t icp6errs_dst_unreach_noroute; + u_quad_t icp6errs_dst_unreach_admin; + u_quad_t icp6errs_dst_unreach_beyondscope; + u_quad_t icp6errs_dst_unreach_addr; + u_quad_t icp6errs_dst_unreach_noport; + u_quad_t icp6errs_packet_too_big; + u_quad_t icp6errs_time_exceed_transit; + u_quad_t icp6errs_time_exceed_reassembly; + u_quad_t icp6errs_paramprob_header; + u_quad_t icp6errs_paramprob_nextheader; + u_quad_t icp6errs_paramprob_option; + u_quad_t icp6errs_redirect; /* we regard redirect as an error here */ + u_quad_t icp6errs_unknown; +}; + +struct icmp6stat { +/* statistics related to icmp6 packets generated */ + u_quad_t icp6s_error; /* # of calls to icmp6_error */ + u_quad_t icp6s_canterror; /* no error 'cuz old was icmp */ + u_quad_t icp6s_toofreq; /* no error 'cuz rate limitation */ + u_quad_t icp6s_outhist[256]; +/* statistics related to input message processed */ + u_quad_t icp6s_badcode; /* icmp6_code out of range */ + u_quad_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */ + u_quad_t icp6s_checksum; /* bad checksum */ + u_quad_t icp6s_badlen; /* calculated bound mismatch */ + u_quad_t icp6s_reflect; /* number of responses */ + u_quad_t icp6s_inhist[256]; + u_quad_t icp6s_nd_toomanyopt; /* too many ND options */ + struct icmp6errstat icp6s_outerrhist; +#define icp6s_odst_unreach_noroute \ + icp6s_outerrhist.icp6errs_dst_unreach_noroute +#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin +#define icp6s_odst_unreach_beyondscope \ + icp6s_outerrhist.icp6errs_dst_unreach_beyondscope +#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr +#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport +#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big +#define icp6s_otime_exceed_transit \ + icp6s_outerrhist.icp6errs_time_exceed_transit +#define icp6s_otime_exceed_reassembly \ + icp6s_outerrhist.icp6errs_time_exceed_reassembly +#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header +#define icp6s_oparamprob_nextheader \ + icp6s_outerrhist.icp6errs_paramprob_nextheader +#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option +#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect +#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown + u_quad_t icp6s_pmtuchg; /* path MTU changes */ + u_quad_t icp6s_nd_badopt; /* bad ND options */ + u_quad_t icp6s_badns; /* bad neighbor solicitation */ + u_quad_t icp6s_badna; /* bad neighbor advertisement */ + u_quad_t icp6s_badrs; /* bad router advertisement */ + u_quad_t icp6s_badra; /* bad router advertisement */ + u_quad_t icp6s_badredirect; /* bad redirect message */ +}; + +/* + * Names for ICMP sysctl objects + */ +#define ICMPV6CTL_STATS 1 +#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */ +#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */ +#define ICMPV6CTL_ND6_PRUNE 6 +#define ICMPV6CTL_ND6_DELAY 8 +#define ICMPV6CTL_ND6_UMAXTRIES 9 +#define ICMPV6CTL_ND6_MMAXTRIES 10 +#define ICMPV6CTL_ND6_USELOOPBACK 11 +/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */ +#define ICMPV6CTL_NODEINFO 13 +#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */ +#define ICMPV6CTL_ND6_MAXNUDHINT 15 +#define ICMPV6CTL_MTUDISC_HIWAT 16 +#define ICMPV6CTL_MTUDISC_LOWAT 17 +#define ICMPV6CTL_ND6_DEBUG 18 +#define ICMPV6CTL_ND6_DRLIST 19 +#define ICMPV6CTL_ND6_PRLIST 20 +#define ICMPV6CTL_MAXID 21 + + +#endif /* !_NETINET_ICMP6_H_ */ diff --git a/i386/include/netinet/.svn/text-base/icmp_var.h.svn-base b/i386/include/netinet/.svn/text-base/icmp_var.h.svn-base new file mode 100644 index 0000000..ee482c1 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/icmp_var.h.svn-base @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/icmp_var.h,v 1.15.2.1 2001/02/24 21:35:18 bmilekic Exp $ + */ + +#ifndef _NETINET_ICMP_VAR_H_ +#define _NETINET_ICMP_VAR_H_ +#include <sys/appleapiopts.h> + +/* + * Variables related to this implementation + * of the internet control message protocol. + */ +struct icmpstat { +/* statistics related to icmp packets generated */ + u_int32_t icps_error; /* # of calls to icmp_error */ + u_int32_t icps_oldshort; /* no error 'cuz old ip too short */ + u_int32_t icps_oldicmp; /* no error 'cuz old was icmp */ + u_int32_t icps_outhist[ICMP_MAXTYPE + 1]; +/* statistics related to input messages processed */ + u_int32_t icps_badcode; /* icmp_code out of range */ + u_int32_t icps_tooshort; /* packet < ICMP_MINLEN */ + u_int32_t icps_checksum; /* bad checksum */ + u_int32_t icps_badlen; /* calculated bound mismatch */ + u_int32_t icps_reflect; /* number of responses */ + u_int32_t icps_inhist[ICMP_MAXTYPE + 1]; + u_int32_t icps_bmcastecho;/* b/mcast echo requests dropped */ + u_int32_t icps_bmcasttstamp; /* b/mcast tstamp requests dropped */ +}; + +/* + * Names for ICMP sysctl objects + */ +#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */ +#define ICMPCTL_STATS 2 /* statistics (read-only) */ +#define ICMPCTL_ICMPLIM 3 +#define ICMPCTL_TIMESTAMP 4 /* allow replies to time stamp requests */ +#define ICMPCTL_MAXID 5 + +#endif /* _NETINET_ICMP_VAR_H_ */ diff --git a/i386/include/netinet/.svn/text-base/if_ether.h.svn-base b/i386/include/netinet/.svn/text-base/if_ether.h.svn-base new file mode 100644 index 0000000..06e5b34 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/if_ether.h.svn-base @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 + * $FreeBSD: src/sys/netinet/if_ether.h,v 1.24 1999/12/29 04:40:58 peter Exp $ + */ + +#ifndef _NETINET_IF_ETHER_H_ +#define _NETINET_IF_ETHER_H_ +#include <sys/appleapiopts.h> + +#include <net/ethernet.h> + +#include <netinet/in.h> +#include <net/if_arp.h> +#define ea_byte ether_addr_octet + +/* + * Macro to map an IP multicast address to an Ethernet multicast address. + * The high-order 25 bits of the Ethernet address are statically assigned, + * and the low-order 23 bits are taken from the low end of the IP address. + */ +#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \ + /* struct in_addr *ipaddr; */ \ + /* u_char enaddr[ETHER_ADDR_LEN]; */ \ +{ \ + (enaddr)[0] = 0x01; \ + (enaddr)[1] = 0x00; \ + (enaddr)[2] = 0x5e; \ + (enaddr)[3] = ((const u_char *)ipaddr)[1] & 0x7f; \ + (enaddr)[4] = ((const u_char *)ipaddr)[2]; \ + (enaddr)[5] = ((const u_char *)ipaddr)[3]; \ +} +/* + * Macro to map an IP6 multicast address to an Ethernet multicast address. + * The high-order 16 bits of the Ethernet address are statically assigned, + * and the low-order 32 bits are taken from the low end of the IP6 address. + */ +#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \ +/* struct in6_addr *ip6addr; */ \ +/* u_char enaddr[ETHER_ADDR_LEN]; */ \ +{ \ + (enaddr)[0] = 0x33; \ + (enaddr)[1] = 0x33; \ + (enaddr)[2] = ((const u_char *)ip6addr)[12]; \ + (enaddr)[3] = ((const u_char *)ip6addr)[13]; \ + (enaddr)[4] = ((const u_char *)ip6addr)[14]; \ + (enaddr)[5] = ((const u_char *)ip6addr)[15]; \ +} + +/* + * Ethernet Address Resolution Protocol. + * + * See RFC 826 for protocol description. Structure below is adapted + * to resolving internet addresses. Field names used correspond to + * RFC 826. + */ +struct ether_arp { + struct arphdr ea_hdr; /* fixed-size header */ + u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */ + u_char arp_spa[4]; /* sender protocol address */ + u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */ + u_char arp_tpa[4]; /* target protocol address */ +}; +#define arp_hrd ea_hdr.ar_hrd +#define arp_pro ea_hdr.ar_pro +#define arp_hln ea_hdr.ar_hln +#define arp_pln ea_hdr.ar_pln +#define arp_op ea_hdr.ar_op + +struct sockaddr_inarp { + u_char sin_len; + u_char sin_family; + u_short sin_port; + struct in_addr sin_addr; + struct in_addr sin_srcaddr; + u_short sin_tos; + u_short sin_other; +#define SIN_PROXY 1 +}; +/* + * IP and ethernet specific routing flags + */ +#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */ +#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */ + + +#endif /* _NETINET_IF_ETHER_H_ */ diff --git a/i386/include/netinet/.svn/text-base/igmp.h.svn-base b/i386/include/netinet/.svn/text-base/igmp.h.svn-base new file mode 100644 index 0000000..3774cd8 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/igmp.h.svn-base @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)igmp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/igmp.h,v 1.10 1999/08/28 00:49:15 peter Exp $ + */ + +#ifndef _NETINET_IGMP_H_ +#define _NETINET_IGMP_H_ +#include <sys/appleapiopts.h> + +/* + * Internet Group Management Protocol (IGMP) definitions. + * + * Written by Steve Deering, Stanford, May 1988. + * + * MULTICAST Revision: 3.5.1.2 + */ + +/* + * IGMP packet format. + */ +struct igmp { + u_char igmp_type; /* version & type of IGMP message */ + u_char igmp_code; /* subtype for routing msgs */ + u_short igmp_cksum; /* IP-style checksum */ + struct in_addr igmp_group; /* group address being reported */ +}; /* (zero for queries) */ + +#define IGMP_MINLEN 8 + +/* + * Message types, including version number. + */ +#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */ +#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */ +#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */ +#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */ + +#define IGMP_DVMRP 0x13 /* DVMRP routing message */ +#define IGMP_PIM 0x14 /* PIM routing message */ + +#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/ +#define IGMP_MTRACE 0x1f /* mcast traceroute messages */ + +#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */ + /* query (in seconds) according */ + /* to RFC1112 */ + + +#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */ + /* specifies time in 10th of seconds*/ + +/* + * The following four defininitions are for backwards compatibility. + * They should be removed as soon as all applications are updated to + * use the new constant names. + */ +#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY +#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT +#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT +#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP + +#endif /* _NETINET_IGMP_H_ */ diff --git a/i386/include/netinet/.svn/text-base/igmp_var.h.svn-base b/i386/include/netinet/.svn/text-base/igmp_var.h.svn-base new file mode 100644 index 0000000..984ccd0 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/igmp_var.h.svn-base @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)igmp_var.h 8.1 (Berkeley) 7/19/93 + */ + +#ifndef _NETINET_IGMP_VAR_H_ +#define _NETINET_IGMP_VAR_H_ +#include <sys/appleapiopts.h> + + +/* + * Internet Group Management Protocol (IGMP), + * implementation-specific definitions. + * + * Written by Steve Deering, Stanford, May 1988. + * + * MULTICAST Revision: 3.5.1.3 + */ + +struct igmpstat { + u_int igps_rcv_total; /* total IGMP messages received */ + u_int igps_rcv_tooshort; /* received with too few bytes */ + u_int igps_rcv_badsum; /* received with bad checksum */ + u_int igps_rcv_queries; /* received membership queries */ + u_int igps_rcv_badqueries; /* received invalid queries */ + u_int igps_rcv_reports; /* received membership reports */ + u_int igps_rcv_badreports; /* received invalid reports */ + u_int igps_rcv_ourreports; /* received reports for our groups */ + u_int igps_snd_reports; /* sent membership reports */ +}; + + +/* + * Names for IGMP sysctl objects + */ +#define IGMPCTL_STATS 1 /* statistics (read-only) */ +#define IGMPCTL_MAXID 2 + +#endif diff --git a/i386/include/netinet/.svn/text-base/in.h.svn-base b/i386/include/netinet/.svn/text-base/in.h.svn-base new file mode 100644 index 0000000..b4e807f --- /dev/null +++ b/i386/include/netinet/.svn/text-base/in.h.svn-base @@ -0,0 +1,524 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in.h 8.3 (Berkeley) 1/3/94 + * $FreeBSD: src/sys/netinet/in.h,v 1.48.2.2 2001/04/21 14:53:06 ume Exp $ + */ + +#ifndef _NETINET_IN_H_ +#define _NETINET_IN_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> +#include <stdint.h> /* uint(8|16|32)_t */ + +#ifndef _IN_ADDR_T +#define _IN_ADDR_T +typedef __uint32_t in_addr_t; /* base type for internet address */ +#endif + +#ifndef _IN_PORT_T +#define _IN_PORT_T +typedef __uint16_t in_port_t; +#endif + +/* + * POSIX 1003.1-2003 + * "Inclusion of the <netinet/in.h> header may also make visible all + * symbols from <inttypes.h> and <sys/socket.h>". + */ +#include <sys/socket.h> + +/* + * The following two #includes insure htonl and family are defined + */ +#include <machine/endian.h> +#include <sys/_endian.h> + +/* + * Constants and structures defined by the internet system, + * Per RFC 790, September 1981, and numerous additions. + */ + +/* + * Protocols (RFC 1700) + */ +#define IPPROTO_IP 0 /* dummy for IP */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_ICMP 1 /* control message protocol */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_IGMP 2 /* group mgmt protocol */ +#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ +#define IPPROTO_IPV4 4 /* IPv4 encapsulation */ +#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_TCP 6 /* tcp */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_ST 7 /* Stream protocol II */ +#define IPPROTO_EGP 8 /* exterior gateway protocol */ +#define IPPROTO_PIGP 9 /* private interior gateway */ +#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ +#define IPPROTO_NVPII 11 /* network voice protocol*/ +#define IPPROTO_PUP 12 /* pup */ +#define IPPROTO_ARGUS 13 /* Argus */ +#define IPPROTO_EMCON 14 /* EMCON */ +#define IPPROTO_XNET 15 /* Cross Net Debugger */ +#define IPPROTO_CHAOS 16 /* Chaos*/ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_UDP 17 /* user datagram protocol */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_MUX 18 /* Multiplexing */ +#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ +#define IPPROTO_HMP 20 /* Host Monitoring */ +#define IPPROTO_PRM 21 /* Packet Radio Measurement */ +#define IPPROTO_IDP 22 /* xns idp */ +#define IPPROTO_TRUNK1 23 /* Trunk-1 */ +#define IPPROTO_TRUNK2 24 /* Trunk-2 */ +#define IPPROTO_LEAF1 25 /* Leaf-1 */ +#define IPPROTO_LEAF2 26 /* Leaf-2 */ +#define IPPROTO_RDP 27 /* Reliable Data */ +#define IPPROTO_IRTP 28 /* Reliable Transaction */ +#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ +#define IPPROTO_BLT 30 /* Bulk Data Transfer */ +#define IPPROTO_NSP 31 /* Network Services */ +#define IPPROTO_INP 32 /* Merit Internodal */ +#define IPPROTO_SEP 33 /* Sequential Exchange */ +#define IPPROTO_3PC 34 /* Third Party Connect */ +#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ +#define IPPROTO_XTP 36 /* XTP */ +#define IPPROTO_DDP 37 /* Datagram Delivery */ +#define IPPROTO_CMTP 38 /* Control Message Transport */ +#define IPPROTO_TPXX 39 /* TP++ Transport */ +#define IPPROTO_IL 40 /* IL transport protocol */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_IPV6 41 /* IP6 header */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_SDRP 42 /* Source Demand Routing */ +#define IPPROTO_ROUTING 43 /* IP6 routing header */ +#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ +#define IPPROTO_IDRP 45 /* InterDomain Routing*/ +#define IPPROTO_RSVP 46 /* resource reservation */ +#define IPPROTO_GRE 47 /* General Routing Encap. */ +#define IPPROTO_MHRP 48 /* Mobile Host Routing */ +#define IPPROTO_BHA 49 /* BHA */ +#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ +#define IPPROTO_AH 51 /* IP6 Auth Header */ +#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ +#define IPPROTO_SWIPE 53 /* IP with encryption */ +#define IPPROTO_NHRP 54 /* Next Hop Resolution */ +/* 55-57: Unassigned */ +#define IPPROTO_ICMPV6 58 /* ICMP6 */ +#define IPPROTO_NONE 59 /* IP6 no next header */ +#define IPPROTO_DSTOPTS 60 /* IP6 destination option */ +#define IPPROTO_AHIP 61 /* any host internal protocol */ +#define IPPROTO_CFTP 62 /* CFTP */ +#define IPPROTO_HELLO 63 /* "hello" routing protocol */ +#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ +#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ +#define IPPROTO_RVD 66 /* Remote Virtual Disk */ +#define IPPROTO_IPPC 67 /* Pluribus Packet Core */ +#define IPPROTO_ADFS 68 /* Any distributed FS */ +#define IPPROTO_SATMON 69 /* Satnet Monitoring */ +#define IPPROTO_VISA 70 /* VISA Protocol */ +#define IPPROTO_IPCV 71 /* Packet Core Utility */ +#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ +#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ +#define IPPROTO_WSN 74 /* Wang Span Network */ +#define IPPROTO_PVP 75 /* Packet Video Protocol */ +#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ +#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ +#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ +#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ +#define IPPROTO_EON 80 /* ISO cnlp */ +#define IPPROTO_VMTP 81 /* VMTP */ +#define IPPROTO_SVMTP 82 /* Secure VMTP */ +#define IPPROTO_VINES 83 /* Banyon VINES */ +#define IPPROTO_TTP 84 /* TTP */ +#define IPPROTO_IGP 85 /* NSFNET-IGP */ +#define IPPROTO_DGP 86 /* dissimilar gateway prot. */ +#define IPPROTO_TCF 87 /* TCF */ +#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ +#define IPPROTO_OSPFIGP 89 /* OSPFIGP */ +#define IPPROTO_SRPC 90 /* Strite RPC protocol */ +#define IPPROTO_LARP 91 /* Locus Address Resoloution */ +#define IPPROTO_MTP 92 /* Multicast Transport */ +#define IPPROTO_AX25 93 /* AX.25 Frames */ +#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ +#define IPPROTO_MICP 95 /* Mobile Int.ing control */ +#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ +#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ +#define IPPROTO_ENCAP 98 /* encapsulation header */ +#define IPPROTO_APES 99 /* any private encr. scheme */ +#define IPPROTO_GMTP 100 /* GMTP*/ +#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ +/* 101-254: Partly Unassigned */ +#define IPPROTO_PIM 103 /* Protocol Independent Mcast */ +#define IPPROTO_PGM 113 /* PGM */ +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion */ +#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_RAW 255 /* raw IP packet */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_MAX 256 + +/* last return value of *_input(), meaning "all job for this pkt is done". */ +#define IPPROTO_DONE 257 +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Local port number conventions: + * + * When a user does a bind(2) or connect(2) with a port number of zero, + * a non-conflicting local port address is chosen. + * The default range is IPPORT_RESERVED through + * IPPORT_USERRESERVED, although that is settable by sysctl. + * + * A user may set the IPPROTO_IP option IP_PORTRANGE to change this + * default assignment range. + * + * The value IP_PORTRANGE_DEFAULT causes the default behavior. + * + * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers + * into the "high" range. These are reserved for client outbound connections + * which do not want to be filtered by any firewalls. + * + * The value IP_PORTRANGE_LOW changes the range to the "low" are + * that is (by convention) restricted to privileged processes. This + * convention is based on "vouchsafe" principles only. It is only secure + * if you trust the remote host to restrict these ports. + * + * The default range of ports and the high range can be changed by + * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto) + * + * Changing those values has bad security implications if you are + * using a a stateless firewall that is allowing packets outside of that + * range in order to allow transparent outgoing connections. + * + * Such a firewall configuration will generally depend on the use of these + * default values. If you change them, you may find your Security + * Administrator looking for you with a heavy object. + * + * For a slightly more orthodox text view on this: + * + * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers + * + * port numbers are divided into three ranges: + * + * 0 - 1023 Well Known Ports + * 1024 - 49151 Registered Ports + * 49152 - 65535 Dynamic and/or Private Ports + * + */ + +#define __DARWIN_IPPORT_RESERVED 1024 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Ports < IPPORT_RESERVED are reserved for + * privileged processes (e.g. root). (IP_PORTRANGE_LOW) + * Ports > IPPORT_USERRESERVED are reserved + * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT) + */ +#ifndef IPPORT_RESERVED +#define IPPORT_RESERVED __DARWIN_IPPORT_RESERVED +#endif +#define IPPORT_USERRESERVED 5000 + +/* + * Default local port range to use by setting IP_PORTRANGE_HIGH + */ +#define IPPORT_HIFIRSTAUTO 49152 +#define IPPORT_HILASTAUTO 65535 + +/* + * Scanning for a free reserved port return a value below IPPORT_RESERVED, + * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was + * 512, but that conflicts with some well-known-services that firewalls may + * have a fit if we use. + */ +#define IPPORT_RESERVEDSTART 600 +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Internet address (a structure for historical reasons) + */ +struct in_addr { + in_addr_t s_addr; +}; + +/* + * Definitions of bits in internet address integers. + * On subnets, the decomposition of addresses to host and net parts + * is done according to subnet mask, not the masks here. + */ +#define INADDR_ANY (u_int32_t)0x00000000 +#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA_NSHIFT 24 +#define IN_CLASSA_HOST 0x00ffffff +#define IN_CLASSA_MAX 128 + +#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB_NSHIFT 16 +#define IN_CLASSB_HOST 0x0000ffff +#define IN_CLASSB_MAX 65536 + +#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC_NSHIFT 8 +#define IN_CLASSC_HOST 0x000000ff + +#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) +#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ +#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ +#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ +#define IN_MULTICAST(i) IN_CLASSD(i) + +#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) +#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) + +#define INADDR_LOOPBACK (u_int32_t)0x7f000001 +#define INADDR_NONE 0xffffffff /* -1 return */ + +#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ +#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ +#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ +#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ + +#ifdef __APPLE__ +#define IN_LINKLOCALNETNUM (u_int32_t)0xA9FE0000 /* 169.254.0.0 */ +#define IN_LINKLOCAL(i) (((u_int32_t)(i) & IN_CLASSB_NET) == IN_LINKLOCALNETNUM) +#endif + +#define IN_LOOPBACKNET 127 /* official! */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Socket address, internet style. + */ +struct sockaddr_in { + __uint8_t sin_len; + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; + char sin_zero[8]; +}; + +#define INET_ADDRSTRLEN 16 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Structure used to describe IP options. + * Used to store options internally, to pass them to a process, + * or to restore options retrieved earlier. + * The ip_dst is used for the first-hop gateway when using a source route + * (this gets put into the header proper). + */ +struct ip_opts { + struct in_addr ip_dst; /* first hop, 0 w/o src rt */ + char ip_opts[40]; /* actually variable in size */ +}; + +/* + * Options for use with [gs]etsockopt at the IP level. + * First word of comment is data type; bool is stored in int. + */ +#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ +#define IP_HDRINCL 2 /* int; header is included with data */ +#define IP_TOS 3 /* int; IP type of service and preced. */ +#define IP_TTL 4 /* int; IP time to live */ +#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ +#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ +#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ +#define IP_RETOPTS 8 /* ip_opts; set/get IP options */ +#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */ +#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ +#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ +#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ +#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ +#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ +#define IP_RSVP_ON 15 /* enable RSVP in kernel */ +#define IP_RSVP_OFF 16 /* disable RSVP in kernel */ +#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ +#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ +#define IP_PORTRANGE 19 /* int; range to choose for unspec port */ +#define IP_RECVIF 20 /* bool; receive reception if w/dgram */ +/* for IPSEC */ +#define IP_IPSEC_POLICY 21 /* int; set/get security policy */ +#define IP_FAITH 22 /* bool; accept FAITH'ed connections */ +#ifdef __APPLE__ +#define IP_STRIPHDR 23 /* bool: drop receive of raw IP header */ +#endif +#define IP_RECVTTL 24 /* bool; receive reception TTL w/dgram */ +#define IP_BOUND_IF 25 /* set/get bound interface */ + + +#define IP_FW_ADD 40 /* add a firewall rule to chain */ +#define IP_FW_DEL 41 /* delete a firewall rule from chain */ +#define IP_FW_FLUSH 42 /* flush firewall rule chain */ +#define IP_FW_ZERO 43 /* clear single/all firewall counter(s) */ +#define IP_FW_GET 44 /* get entire firewall rule chain */ +#define IP_FW_RESETLOG 45 /* reset logging counters */ + +/* These older firewall socket option codes are maintained for backward compatibility. */ +#define IP_OLD_FW_ADD 50 /* add a firewall rule to chain */ +#define IP_OLD_FW_DEL 51 /* delete a firewall rule from chain */ +#define IP_OLD_FW_FLUSH 52 /* flush firewall rule chain */ +#define IP_OLD_FW_ZERO 53 /* clear single/all firewall counter(s) */ +#define IP_OLD_FW_GET 54 /* get entire firewall rule chain */ +#define IP_NAT__XXX 55 /* set/get NAT opts XXX Deprecated, do not use */ +#define IP_OLD_FW_RESETLOG 56 /* reset logging counters */ + +#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ +#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ +#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ +#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ + +#define IP_TRAFFIC_MGT_BACKGROUND 65 /* int*; get background IO flags; set background IO */ + + +/* Background socket configuration flags */ +#ifdef __APPLE_API_UNSTABLE +#define TRAFFIC_MGT_SO_BACKGROUND 0x0001 /* background socket */ +#define TRAFFIC_MGT_SO_BG_SUPPRESSED 0x0002 /* currently throttled */ +#define TRAFFIC_MGT_SO_BG_REGULATE 0x0004 /* traffic is regulated */ +#endif /* __APPLE_API_UNSTABLE */ + +/* + * Defaults and limits for options + */ +#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ +#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ +#define IP_MAX_MEMBERSHIPS 20 /* per socket */ + +/* + * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. + */ +struct ip_mreq { + struct in_addr imr_multiaddr; /* IP multicast address of group */ + struct in_addr imr_interface; /* local IP address of interface */ +}; + +/* + * Argument for IP_PORTRANGE: + * - which range to search when port is unspecified at bind() or connect() + */ +#define IP_PORTRANGE_DEFAULT 0 /* default range */ +#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ +#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ + + +/* + * Definitions for inet sysctl operations. + * + * Third level is protocol number. + * Fourth level is desired variable within that protocol. + */ +#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ + + +/* + * Names for IP sysctl objects + */ +#define IPCTL_FORWARDING 1 /* act as router */ +#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ +#define IPCTL_DEFTTL 3 /* default TTL */ +#ifdef notyet +#define IPCTL_DEFMTU 4 /* default MTU */ +#endif +#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ +#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ +#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ +#define IPCTL_SOURCEROUTE 8 /* may perform source routes */ +#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ +#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ +#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ +#define IPCTL_STATS 12 /* ipstat structure */ +#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ +#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ +#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */ +#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ +#define IPCTL_MAXID 17 + + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +/* INET6 stuff */ +#define __KAME_NETINET_IN_H_INCLUDED_ +#include <netinet6/in6.h> +#undef __KAME_NETINET_IN_H_INCLUDED_ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__BEGIN_DECLS +int bindresvport(int, struct sockaddr_in *); +struct sockaddr; +int bindresvport_sa(int, struct sockaddr *); +__END_DECLS +#endif + +#endif /* _NETINET_IN_H_ */ diff --git a/i386/include/netinet/.svn/text-base/in_pcb.h.svn-base b/i386/include/netinet/.svn/text-base/in_pcb.h.svn-base new file mode 100644 index 0000000..c90cf8e --- /dev/null +++ b/i386/include/netinet/.svn/text-base/in_pcb.h.svn-base @@ -0,0 +1,337 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.32.2.4 2001/08/13 16:26:17 ume Exp $ + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _NETINET_IN_PCB_H_ +#define _NETINET_IN_PCB_H_ +#include <sys/appleapiopts.h> + +#include <sys/types.h> +#include <sys/queue.h> + +#include <netinet6/ipsec.h> /* for IPSEC */ + +typedef u_quad_t inp_gen_t; + +/* + * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet. + * So, AF_INET6 null laddr is also used as AF_INET null laddr, + * by utilize following structure. (At last, same as INRIA) + */ +struct in_addr_4in6 { + u_int32_t ia46_pad32[3]; + struct in_addr ia46_addr4; +}; + + +/* + * The range of the generation count, as used in this implementation, + * is 9e19. We would have to create 300 billion connections per + * second for this number to roll over in a year. This seems sufficiently + * unlikely that we simply don't concern ourselves with that possibility. + */ + +/* + * Interface exported to userland by various protocols which use + * inpcbs. Hack alert -- only define if struct xsocket is in scope. + */ + +/* + * This is a copy of the inpcb as it shipped in Panther. This structure + * is filled out in a copy function. This allows the inpcb to change + * without breaking userland tools. + * + * CAUTION: Many fields may not be filled out. Fewer may be filled out + * in the future. Code defensively. + */ + +#pragma pack(4) + +#if defined(__LP64__) +struct _inpcb_list_entry { + u_int32_t le_next; + u_int32_t le_prev; +}; +#define _INPCB_PTR(x) u_int32_t +#define _INPCB_LIST_ENTRY(x) struct _inpcb_list_entry +#else +#define _INPCB_PTR(x) x +#define _INPCB_LIST_ENTRY(x) LIST_ENTRY(x) +#endif + +struct inpcbinfo; +struct inpcbport; +struct mbuf; +struct ip6_pktopts; +struct ip6_moptions; +struct icmp6_filter; +struct inpcbpolicy; + +struct inpcb { + _INPCB_LIST_ENTRY(inpcb) inp_hash; /* hash list */ + struct in_addr reserved1; /* APPLE reserved: inp_faddr defined in protcol indep. part */ + struct in_addr reserved2; /* APPLE reserved */ + u_short inp_fport; /* foreign port */ + u_short inp_lport; /* local port */ + _INPCB_LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */ + _INPCB_PTR(caddr_t) inp_ppcb; /* pointer to per-protocol pcb */ + _INPCB_PTR(struct inpcbinfo *) inp_pcbinfo; /* PCB list info */ + _INPCB_PTR(void *) inp_socket; /* back pointer to socket */ + u_char nat_owner; /* Used to NAT TCP/UDP traffic */ + u_int32_t nat_cookie; /* Cookie stored and returned to NAT */ + _INPCB_LIST_ENTRY(inpcb) inp_portlist; /* list for this PCB's local port */ + _INPCB_PTR(struct inpcbport *) inp_phd; /* head of this list */ + inp_gen_t inp_gencnt; /* generation count of this instance */ + int inp_flags; /* generic IP/datagram flags */ + u_int32_t inp_flow; + + u_char inp_vflag; + + u_char inp_ip_ttl; /* time to live proto */ + u_char inp_ip_p; /* protocol proto */ + /* protocol dependent part */ + union { + /* foreign host table entry */ + struct in_addr_4in6 inp46_foreign; + struct in6_addr inp6_foreign; + } inp_dependfaddr; + union { + /* local host table entry */ + struct in_addr_4in6 inp46_local; + struct in6_addr inp6_local; + } inp_dependladdr; + union { + /* placeholder for routing entry */ + u_char inp4_route[20]; + u_char inp6_route[32]; + } inp_dependroute; + struct { + /* type of service proto */ + u_char inp4_ip_tos; + /* IP options */ + _INPCB_PTR(struct mbuf *) inp4_options; + /* IP multicast options */ + _INPCB_PTR(struct ip_moptions *) inp4_moptions; + } inp_depend4; + + struct { + /* IP options */ + _INPCB_PTR(struct mbuf *) inp6_options; + u_int8_t inp6_hlim; + u_int8_t unused_uint8_1; + ushort unused_uint16_1; + /* IP6 options for outgoing packets */ + _INPCB_PTR(struct ip6_pktopts *) inp6_outputopts; + /* IP multicast options */ + _INPCB_PTR(struct ip6_moptions *) inp6_moptions; + /* ICMPv6 code type filter */ + _INPCB_PTR(struct icmp6_filter *) inp6_icmp6filt; + /* IPV6_CHECKSUM setsockopt */ + int inp6_cksum; + u_short inp6_ifindex; + short inp6_hops; + } inp_depend6; + + int hash_element; /* Array index of pcb's hash list */ + _INPCB_PTR(caddr_t) inp_saved_ppcb; /* place to save pointer while cached */ + _INPCB_PTR(struct inpcbpolicy *) inp_sp; + u_int32_t reserved[3]; /* For future use */ +}; + +struct xinpcb { + u_int32_t xi_len; /* length of this structure */ + struct inpcb xi_inp; + struct xsocket xi_socket; + u_quad_t xi_alignment_hack; +}; + +#if !CONFIG_EMBEDDED + +struct inpcb64_list_entry { + u_int64_t le_next; + u_int64_t le_prev; +}; + +struct xinpcb64 { + u_int64_t xi_len; /* length of this structure */ + u_int64_t xi_inpp; + u_short inp_fport; /* foreign port */ + u_short inp_lport; /* local port */ + struct inpcb64_list_entry + inp_list; /* list for all PCBs of this proto */ + u_int64_t inp_ppcb; /* pointer to per-protocol pcb */ + u_int64_t inp_pcbinfo; /* PCB list info */ + struct inpcb64_list_entry + inp_portlist; /* list for this PCB's local port */ + u_int64_t inp_phd; /* head of this list */ + inp_gen_t inp_gencnt; /* generation count of this instance */ + int inp_flags; /* generic IP/datagram flags */ + u_int32_t inp_flow; + u_char inp_vflag; + u_char inp_ip_ttl; /* time to live */ + u_char inp_ip_p; /* protocol */ + union { /* foreign host table entry */ + struct in_addr_4in6 inp46_foreign; + struct in6_addr inp6_foreign; + } inp_dependfaddr; + union { /* local host table entry */ + struct in_addr_4in6 inp46_local; + struct in6_addr inp6_local; + } inp_dependladdr; + struct { + u_char inp4_ip_tos; /* type of service */ + } inp_depend4; + struct { + u_int8_t inp6_hlim; + int inp6_cksum; + u_short inp6_ifindex; + short inp6_hops; + } inp_depend6; + struct xsocket64 xi_socket; + u_quad_t xi_alignment_hack; +}; + +#endif /* !CONFIG_EMBEDDED */ + +struct xinpgen { + u_int32_t xig_len; /* length of this structure */ + u_int xig_count; /* number of PCBs at this time */ + inp_gen_t xig_gen; /* generation count at this time */ + so_gen_t xig_sogen; /* socket generation count at this time */ +}; + +#pragma pack() + +/* + * These defines are for use with the inpcb. + */ +#define INP_IPV4 0x1 +#define INP_IPV6 0x2 +#define inp_faddr inp_dependfaddr.inp46_foreign.ia46_addr4 +#define inp_laddr inp_dependladdr.inp46_local.ia46_addr4 +#define inp_route inp_dependroute.inp4_route +#define inp_ip_tos inp_depend4.inp4_ip_tos +#define inp_options inp_depend4.inp4_options +#define inp_moptions inp_depend4.inp4_moptions +#define in6p_faddr inp_dependfaddr.inp6_foreign +#define in6p_laddr inp_dependladdr.inp6_local +#define in6p_route inp_dependroute.inp6_route +#define in6p_ip6_hlim inp_depend6.inp6_hlim +#define in6p_hops inp_depend6.inp6_hops /* default hop limit */ +#define in6p_ip6_nxt inp_ip_p +#define in6p_flowinfo inp_flow +#define in6p_vflag inp_vflag +#define in6p_options inp_depend6.inp6_options +#define in6p_outputopts inp_depend6.inp6_outputopts +#define in6p_moptions inp_depend6.inp6_moptions +#define in6p_icmp6filt inp_depend6.inp6_icmp6filt +#define in6p_cksum inp_depend6.inp6_cksum +#define in6p_ifindex inp_depend6.inp6_ifindex +#define in6p_flags inp_flags /* for KAME src sync over BSD*'s */ +#define in6p_socket inp_socket /* for KAME src sync over BSD*'s */ +#define in6p_lport inp_lport /* for KAME src sync over BSD*'s */ +#define in6p_fport inp_fport /* for KAME src sync over BSD*'s */ +#define in6p_ppcb inp_ppcb /* for KAME src sync over BSD*'s */ +#define in6p_state inp_state +#define in6p_wantcnt inp_wantcnt + + +/* flags in inp_flags: */ +#define INP_RECVOPTS 0x01 /* receive incoming IP options */ +#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */ +#define INP_RECVDSTADDR 0x04 /* receive IP dst address */ +#define INP_HDRINCL 0x08 /* user supplies entire IP header */ +#define INP_HIGHPORT 0x10 /* user wants "high" port binding */ +#define INP_LOWPORT 0x20 /* user wants "low" port binding */ +#define INP_ANONPORT 0x40 /* port chosen for user */ +#define INP_RECVIF 0x80 /* receive incoming interface */ +#define INP_MTUDISC 0x100 /* user can do MTU discovery */ +#ifdef __APPLE__ +#define INP_STRIPHDR 0x200 /* Strip headers in raw_ip, for OT support */ +#endif +#define INP_FAITH 0x400 /* accept FAITH'ed connections */ +#define INP_INADDR_ANY 0x800 /* local address wasn't specified */ + +#define INP_RECVTTL 0x1000 +#define INP_UDP_NOCKSUM 0x2000 /* Turn off outbound UDP checksum */ +#define INP_BOUND_IF 0x4000 /* bind socket to an ifindex */ + +#define IN6P_IPV6_V6ONLY 0x008000 /* restrict AF_INET6 socket for v6 */ + +#define IN6P_PKTINFO 0x010000 /* receive IP6 dst and I/F */ +#define IN6P_HOPLIMIT 0x020000 /* receive hoplimit */ +#define IN6P_HOPOPTS 0x040000 /* receive hop-by-hop options */ +#define IN6P_DSTOPTS 0x080000 /* receive dst options after rthdr */ +#define IN6P_RTHDR 0x100000 /* receive routing header */ +#define IN6P_RTHDRDSTOPTS 0x200000 /* receive dstoptions before rthdr */ +#define IN6P_TCLASS 0x400000 /* receive traffic class value */ +#define IN6P_AUTOFLOWLABEL 0x800000 /* attach flowlabel automatically */ +#define IN6P_BINDV6ONLY 0x10000000 /* do not grab IPv4 traffic */ + + +#endif /* !_NETINET_IN_PCB_H_ */ diff --git a/i386/include/netinet/.svn/text-base/in_systm.h.svn-base b/i386/include/netinet/.svn/text-base/in_systm.h.svn-base new file mode 100644 index 0000000..57fbb8d --- /dev/null +++ b/i386/include/netinet/.svn/text-base/in_systm.h.svn-base @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_systm.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $ + */ + +#ifndef _NETINET_IN_SYSTM_H_ +#define _NETINET_IN_SYSTM_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> + +/* + * Miscellaneous internetwork + * definitions for kernel. + */ + +/* + * Network types. + * + * Internally the system keeps counters in the headers with the bytes + * swapped so that VAX instructions will work on them. It reverses + * the bytes before transmission at each protocol level. The n_ types + * represent the types with the bytes in ``high-ender'' order. + */ +typedef __uint16_t n_short; /* short as received from the net */ +typedef __uint32_t n_long; /* long as received from the net */ + +typedef __uint32_t n_time; /* ms since 00:00 GMT, byte rev */ + + +#endif diff --git a/i386/include/netinet/.svn/text-base/in_var.h.svn-base b/i386/include/netinet/.svn/text-base/in_var.h.svn-base new file mode 100644 index 0000000..04ce0d4 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/in_var.h.svn-base @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1985, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_var.h 8.2 (Berkeley) 1/9/95 + * $FreeBSD: src/sys/netinet/in_var.h,v 1.33.2.2 2001/07/17 10:50:01 ru Exp $ + */ + +#ifndef _NETINET_IN_VAR_H_ +#define _NETINET_IN_VAR_H_ +#include <sys/appleapiopts.h> + +#include <sys/queue.h> +#ifdef __APPLE__ +#include <sys/kern_event.h> +#endif + + +struct in_aliasreq { + char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct sockaddr_in ifra_addr; + struct sockaddr_in ifra_broadaddr; +#define ifra_dstaddr ifra_broadaddr + struct sockaddr_in ifra_mask; + u_int32_t ifra_unused; /* not used: used to be 'dlt' */ +}; + +/* + * Event data, internet style. + */ +struct kev_in_data { + struct net_event_data link_data; + struct in_addr ia_addr; + u_int32_t ia_net; /* network number of interface */ + u_int32_t ia_netmask; /* mask of net part */ + u_int32_t ia_subnet; /* subnet number, including net */ + u_int32_t ia_subnetmask; /* mask of subnet part */ + struct in_addr ia_netbroadcast;/* to recognize net broadcasts */ + struct in_addr ia_dstaddr; +}; + +struct kev_in_collision { + struct net_event_data link_data; /* link colliding arp was received on */ + struct in_addr ia_ipaddr; /* IP address we and another node are using */ + u_char hw_len; /* length of hardware address */ + u_char hw_addr[0]; /* variable length hardware address */ +}; + +#ifdef __APPLE_API_PRIVATE +struct kev_in_portinuse { + u_int16_t port; /* conflicting port number in host order */ + u_int32_t req_pid; /* PID port requestor */ + u_int32_t reserved[2]; +}; +#endif + + +/* + * Define inet event subclass and specific inet events. + */ + +#define KEV_INET_SUBCLASS 1 + +#define KEV_INET_NEW_ADDR 1 +#define KEV_INET_CHANGED_ADDR 2 +#define KEV_INET_ADDR_DELETED 3 +#define KEV_INET_SIFDSTADDR 4 +#define KEV_INET_SIFBRDADDR 5 +#define KEV_INET_SIFNETMASK 6 +#define KEV_INET_ARPCOLLISION 7 /* use kev_in_collision */ + +#ifdef __APPLE_API_PRIVATE +#define KEV_INET_PORTINUSE 8 /* use ken_in_portinuse */ +#endif + + +/* INET6 stuff */ +#include <netinet6/in6_var.h> + +#endif /* _NETINET_IN_VAR_H_ */ diff --git a/i386/include/netinet/.svn/text-base/ip.h.svn-base b/i386/include/netinet/.svn/text-base/ip.h.svn-base new file mode 100644 index 0000000..c21698f --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip.h.svn-base @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip.h 8.2 (Berkeley) 6/1/94 + * $FreeBSD: src/sys/netinet/ip.h,v 1.17 1999/12/22 19:13:20 shin Exp $ + */ + +#ifndef _NETINET_IP_H_ +#define _NETINET_IP_H_ +#include <sys/appleapiopts.h> +#include <sys/types.h> /* XXX temporary hack to get u_ types */ +#include <netinet/in.h> +#include <netinet/in_systm.h> + + +/* + * Definitions for internet protocol version 4. + * Per RFC 791, September 1981. + */ +#define IPVERSION 4 + +/* + * Structure of an internet header, naked of options. + */ +struct ip { +#ifdef _IP_VHL + u_char ip_vhl; /* version << 4 | header length >> 2 */ +#else +#if BYTE_ORDER == LITTLE_ENDIAN + u_int ip_hl:4, /* header length */ + ip_v:4; /* version */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int ip_v:4, /* version */ + ip_hl:4; /* header length */ +#endif +#endif /* not _IP_VHL */ + u_char ip_tos; /* type of service */ + u_short ip_len; /* total length */ + u_short ip_id; /* identification */ + u_short ip_off; /* fragment offset field */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_char ip_ttl; /* time to live */ + u_char ip_p; /* protocol */ + u_short ip_sum; /* checksum */ + struct in_addr ip_src,ip_dst; /* source and dest address */ +}; + +#ifdef _IP_VHL +#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl)) +#define IP_VHL_HL(vhl) ((vhl) & 0x0f) +#define IP_VHL_V(vhl) ((vhl) >> 4) +#define IP_VHL_BORING 0x45 +#endif + +#define IP_MAXPACKET 65535 /* maximum packet size */ + +/* + * Definitions for IP type of service (ip_tos) + */ +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 +#define IPTOS_MINCOST 0x02 +#if 1 +/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */ +#define IPTOS_CE 0x01 +#define IPTOS_ECT 0x02 +#endif + +/* + * ECN (Explicit Congestion Notification) codepoints in RFC3168 + * mapped to the lower 2 bits of the TOS field. + */ +#define IPTOS_ECN_NOTECT 0x00 /* not-ECT */ +#define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */ +#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */ +#define IPTOS_ECN_CE 0x03 /* congestion experienced */ +#define IPTOS_ECN_MASK 0x03 /* ECN field mask */ + +/* + * Definitions for IP precedence (also in ip_tos) (hopefully unused) + */ +#define IPTOS_PREC_NETCONTROL 0xe0 +#define IPTOS_PREC_INTERNETCONTROL 0xc0 +#define IPTOS_PREC_CRITIC_ECP 0xa0 +#define IPTOS_PREC_FLASHOVERRIDE 0x80 +#define IPTOS_PREC_FLASH 0x60 +#define IPTOS_PREC_IMMEDIATE 0x40 +#define IPTOS_PREC_PRIORITY 0x20 +#define IPTOS_PREC_ROUTINE 0x00 + +/* + * Definitions for options. + */ +#define IPOPT_COPIED(o) ((o)&0x80) +#define IPOPT_CLASS(o) ((o)&0x60) +#define IPOPT_NUMBER(o) ((o)&0x1f) + +#define IPOPT_CONTROL 0x00 +#define IPOPT_RESERVED1 0x20 +#define IPOPT_DEBMEAS 0x40 +#define IPOPT_RESERVED2 0x60 + +#define IPOPT_EOL 0 /* end of option list */ +#define IPOPT_NOP 1 /* no operation */ + +#define IPOPT_RR 7 /* record packet route */ +#define IPOPT_TS 68 /* timestamp */ +#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ +#define IPOPT_LSRR 131 /* loose source route */ +#define IPOPT_SATID 136 /* satnet id */ +#define IPOPT_SSRR 137 /* strict source route */ +#define IPOPT_RA 148 /* router alert */ + +/* + * Offsets to fields in options other than EOL and NOP. + */ +#define IPOPT_OPTVAL 0 /* option ID */ +#define IPOPT_OLEN 1 /* option length */ +#define IPOPT_OFFSET 2 /* offset within option */ +#define IPOPT_MINOFF 4 /* min value of above */ + +/* + * Time stamp option structure. + */ +struct ip_timestamp { + u_char ipt_code; /* IPOPT_TS */ + u_char ipt_len; /* size of structure (variable) */ + u_char ipt_ptr; /* index of current entry */ +#if BYTE_ORDER == LITTLE_ENDIAN + u_int ipt_flg:4, /* flags, see below */ + ipt_oflw:4; /* overflow counter */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int ipt_oflw:4, /* overflow counter */ + ipt_flg:4; /* flags, see below */ +#endif + union ipt_timestamp { + n_long ipt_time[1]; + struct ipt_ta { + struct in_addr ipt_addr; + n_long ipt_time; + } ipt_ta[1]; + } ipt_timestamp; +}; + +/* flag bits for ipt_flg */ +#define IPOPT_TS_TSONLY 0 /* timestamps only */ +#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ +#define IPOPT_TS_PRESPEC 3 /* specified modules only */ + +/* bits for security (not byte swapped) */ +#define IPOPT_SECUR_UNCLASS 0x0000 +#define IPOPT_SECUR_CONFID 0xf135 +#define IPOPT_SECUR_EFTO 0x789a +#define IPOPT_SECUR_MMMM 0xbc4d +#define IPOPT_SECUR_RESTR 0xaf13 +#define IPOPT_SECUR_SECRET 0xd788 +#define IPOPT_SECUR_TOPSECRET 0x6bc5 + +/* + * Internet implementation parameters. + */ +#define MAXTTL 255 /* maximum time to live (seconds) */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ +#define IPFRAGTTL 60 /* time to live for frags, slowhz */ +#define IPTTLDEC 1 /* subtracted when forwarding */ + +#define IP_MSS 576 /* default maximum segment size */ + +#endif diff --git a/i386/include/netinet/.svn/text-base/ip6.h.svn-base b/i386/include/netinet/.svn/text-base/ip6.h.svn-base new file mode 100644 index 0000000..2afb8d8 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip6.h.svn-base @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $*/ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_IP6_H_ +#define _NETINET_IP6_H_ +#include <sys/appleapiopts.h> + +/* + * Definition for internet protocol version 6. + * RFC 2460 + */ + +struct ip6_hdr { + union { + struct ip6_hdrctl { + u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */ + u_int16_t ip6_un1_plen; /* payload length */ + u_int8_t ip6_un1_nxt; /* next header */ + u_int8_t ip6_un1_hlim; /* hop limit */ + } ip6_un1; + u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ + } ip6_ctlun; + struct in6_addr ip6_src; /* source address */ + struct in6_addr ip6_dst; /* destination address */ +} __attribute__((__packed__)); + +#define ip6_vfc ip6_ctlun.ip6_un2_vfc +#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow +#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen +#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt +#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim +#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim + +#define IPV6_VERSION 0x60 +#define IPV6_VERSION_MASK 0xf0 + +#if BYTE_ORDER == BIG_ENDIAN +#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */ +#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */ +#else +#if BYTE_ORDER == LITTLE_ENDIAN +#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */ +#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ +#endif /* LITTLE_ENDIAN */ +#endif +#if 1 +/* ECN bits proposed by Sally Floyd */ +#define IP6TOS_CE 0x01 /* congestion experienced */ +#define IP6TOS_ECT 0x02 /* ECN-capable transport */ +#endif + +/* + * Extension Headers + */ + +struct ip6_ext { + u_int8_t ip6e_nxt; + u_int8_t ip6e_len; +} __attribute__((__packed__)); + +/* Hop-by-Hop options header */ +/* XXX should we pad it to force alignment on an 8-byte boundary? */ +struct ip6_hbh { + u_int8_t ip6h_nxt; /* next header */ + u_int8_t ip6h_len; /* length in units of 8 octets */ + /* followed by options */ +} __attribute__((__packed__)); + +/* Destination options header */ +/* XXX should we pad it to force alignment on an 8-byte boundary? */ +struct ip6_dest { + u_int8_t ip6d_nxt; /* next header */ + u_int8_t ip6d_len; /* length in units of 8 octets */ + /* followed by options */ +} __attribute__((__packed__)); + +/* Option types and related macros */ +#define IP6OPT_PAD1 0x00 /* 00 0 00000 */ +#define IP6OPT_PADN 0x01 /* 00 0 00001 */ +#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ +#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */ +#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */ +#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */ + +#define IP6OPT_RTALERT_LEN 4 +#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ +#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ +#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ +#define IP6OPT_MINLEN 2 + +#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */ +#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */ +#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */ +#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */ +#define IP6OPT_EID 0x8a /* 10 0 01010 */ + +#define IP6OPT_TYPE(o) ((o) & 0xC0) +#define IP6OPT_TYPE_SKIP 0x00 +#define IP6OPT_TYPE_DISCARD 0x40 +#define IP6OPT_TYPE_FORCEICMP 0x80 +#define IP6OPT_TYPE_ICMP 0xC0 + +#define IP6OPT_MUTABLE 0x20 + +#define IP6OPT_JUMBO_LEN 6 + +/* Routing header */ +struct ip6_rthdr { + u_int8_t ip6r_nxt; /* next header */ + u_int8_t ip6r_len; /* length in units of 8 octets */ + u_int8_t ip6r_type; /* routing type */ + u_int8_t ip6r_segleft; /* segments left */ + /* followed by routing type specific data */ +} __attribute__((__packed__)); + +/* Type 0 Routing header */ +struct ip6_rthdr0 { + u_int8_t ip6r0_nxt; /* next header */ + u_int8_t ip6r0_len; /* length in units of 8 octets */ + u_int8_t ip6r0_type; /* always zero */ + u_int8_t ip6r0_segleft; /* segments left */ + u_int8_t ip6r0_reserved; /* reserved field */ + u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ + struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ +} __attribute__((__packed__)); + +/* Fragment header */ +struct ip6_frag { + u_int8_t ip6f_nxt; /* next header */ + u_int8_t ip6f_reserved; /* reserved field */ + u_int16_t ip6f_offlg; /* offset, reserved, and flag */ + u_int32_t ip6f_ident; /* identification */ +} __attribute__((__packed__)); + +#if BYTE_ORDER == BIG_ENDIAN +#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ +#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ +#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ +#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ +#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ +#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */ +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + +/* + * Internet implementation parameters. + */ +#define IPV6_MAXHLIM 255 /* maximun hoplimit */ +#define IPV6_DEFHLIM 64 /* default hlim */ +#define IPV6_FRAGTTL 120 /* ttl for fragment packets, in slowtimo tick */ +#define IPV6_HLIMDEC 1 /* subtracted when forwaeding */ + +#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */ +#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/ + +#endif /* !_NETINET_IP6_H_ */ diff --git a/i386/include/netinet/.svn/text-base/ip_fw.h.svn-base b/i386/include/netinet/.svn/text-base/ip_fw.h.svn-base new file mode 100644 index 0000000..95f184f --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip_fw.h.svn-base @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1993 Daniel Boulet + * Copyright (c) 1994 Ugen J.S.Antsilevich + * + * Redistribution and use in source forms, with and without modification, + * are permitted provided that this entire comment appears intact. + * + * Redistribution in binary form may occur without any restrictions. + * Obviously, it would be nice if you gave credit where credit is due + * but requiring it would be too onerous. + * + * This software is provided ``AS IS'' without any warranties of any kind. + * + */ + +#ifndef _IP_FW_H +#define _IP_FW_H + +#include <sys/appleapiopts.h> + +#ifdef IPFW2 +#include <netinet/ip_fw2.h> +#else /* !IPFW2, good old ipfw */ + +#include <sys/queue.h> +#include <sys/types.h> /* u_ types */ + +#define IP_FW_CURRENT_API_VERSION 20 /* Version of this API */ + + +/* + * This union structure identifies an interface, either explicitly + * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME + * and IP_FW_F_OIFNAME say how to interpret this structure. An + * interface unit number of -1 matches any unit number, while an + * IP address of 0.0.0.0 indicates matches any interface. + * + * The receive and transmit interfaces are only compared against the + * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE) + * is set. Note some packets lack a receive or transmit interface + * (in which case the missing "interface" never matches). + */ + +union ip_fw_if { + struct in_addr fu_via_ip; /* Specified by IP address */ + struct { /* Specified by interface name */ +#define FW_IFNLEN 10 /* need room ! was IFNAMSIZ */ + char name[FW_IFNLEN]; + short unit; /* -1 means match any unit */ + } fu_via_if; +}; + +/* + * Format of an IP firewall descriptor + * + * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order. + * fw_flg and fw_n*p are stored in host byte order (of course). + * Port numbers are stored in HOST byte order. + */ + +struct ip_fw { + u_int32_t version; /* Version of this structure. Should always be */ + /* set to IP_FW_CURRENT_API_VERSION by clients. */ + void *context; /* Context that is usable by user processes to */ + /* identify this rule. */ + u_int64_t fw_pcnt,fw_bcnt; /* Packet and byte counters */ + struct in_addr fw_src, fw_dst; /* Source and destination IP addr */ + struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */ + u_short fw_number; /* Rule number */ + u_int fw_flg; /* Flags word */ +#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */ + union { + u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */ +#define IP_FW_ICMPTYPES_MAX 128 +#define IP_FW_ICMPTYPES_DIM (IP_FW_ICMPTYPES_MAX / (sizeof(unsigned) * 8)) + unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */ + } fw_uar; + u_int fw_ipflg; /* IP flags word */ + u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */ + u_char fw_tcpopt,fw_tcpnopt; /* TCP options set/unset */ + u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */ + long timestamp; /* timestamp (tv_sec) of last match */ + union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */ + union { + u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */ + u_short fu_pipe_nr; /* queue number (option DUMMYNET) */ + u_short fu_skipto_rule; /* SKIPTO command rule number */ + u_short fu_reject_code; /* REJECT response code */ + struct sockaddr_in fu_fwd_ip; + } fw_un; + u_char fw_prot; /* IP protocol */ + /* + * N'of src ports and # of dst ports in ports array (dst ports + * follow src ports; max of 10 ports in all; count of 0 means + * match all ports) + */ + u_char fw_nports; + void *pipe_ptr; /* flow_set ptr for dummynet pipe */ + void *next_rule_ptr ; /* next rule in case of match */ + uid_t fw_uid; /* uid to match */ + int fw_logamount; /* amount to log */ + u_int64_t fw_loghighest; /* highest number packet to log */ +}; + +/* + * extended ipfw structure... some fields in the original struct + * can be used to pass parameters up/down, namely pointers + * void *pipe_ptr + * void *next_rule_ptr + * some others can be used to pass parameters down, namely counters etc. + * u_int64_t fw_pcnt,fw_bcnt; + * long timestamp; + */ + +struct ip_fw_ext { /* extended structure */ + struct ip_fw rule; /* must be at offset 0 */ + long dont_match_prob; /* 0x7fffffff means 1.0, always fail */ + u_int dyn_type; /* type for dynamic rule */ +}; + +#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f) +#define IP_FW_SETNSRCP(rule, n) do { \ + (rule)->fw_nports &= ~0x0f; \ + (rule)->fw_nports |= (n); \ + } while (0) +#define IP_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4) +#define IP_FW_SETNDSTP(rule, n) do { \ + (rule)->fw_nports &= ~0xf0; \ + (rule)->fw_nports |= (n) << 4;\ + } while (0) + +#define fw_divert_port fw_un.fu_divert_port +#define fw_skipto_rule fw_un.fu_skipto_rule +#define fw_reject_code fw_un.fu_reject_code +#define fw_pipe_nr fw_un.fu_pipe_nr +#define fw_fwd_ip fw_un.fu_fwd_ip + +struct ip_fw_chain { + LIST_ENTRY(ip_fw_chain) next; + struct ip_fw *rule; +}; + +/* + * Flow mask/flow id for each queue. + */ +struct ipfw_flow_id { + u_int32_t dst_ip, src_ip ; + u_int16_t dst_port, src_port ; + u_int8_t proto ; + u_int8_t flags ; /* protocol-specific flags */ +} ; + +/* + * dynamic ipfw rule + */ +struct ipfw_dyn_rule { + struct ipfw_dyn_rule *next ; + + struct ipfw_flow_id id ; + struct ipfw_flow_id mask ; + struct ip_fw_chain *chain ; /* pointer to parent rule */ + u_int32_t type ; /* rule type */ + u_int32_t expire ; /* expire time */ + u_int64_t pcnt, bcnt; /* match counters */ + u_int32_t bucket ; /* which bucket in hash table */ + u_int32_t state ; /* state of this rule (typ. a */ + /* combination of TCP flags) */ +} ; + +/* + * Values for "flags" field . + */ +#define IP_FW_F_COMMAND 0x000000ff /* Mask for type of chain entry: */ +#define IP_FW_F_DENY 0x00000000 /* This is a deny rule */ +#define IP_FW_F_REJECT 0x00000001 /* Deny and send a response packet */ +#define IP_FW_F_ACCEPT 0x00000002 /* This is an accept rule */ +#define IP_FW_F_COUNT 0x00000003 /* This is a count rule */ +#define IP_FW_F_DIVERT 0x00000004 /* This is a divert rule */ +#define IP_FW_F_TEE 0x00000005 /* This is a tee rule */ +#define IP_FW_F_SKIPTO 0x00000006 /* This is a skipto rule */ +#define IP_FW_F_FWD 0x00000007 /* This is a "change forwarding address" rule */ +#define IP_FW_F_PIPE 0x00000008 /* This is a dummynet rule */ +#define IP_FW_F_QUEUE 0x00000009 /* This is a dummynet queue */ + +#define IP_FW_F_IN 0x00000100 /* Check inbound packets */ +#define IP_FW_F_OUT 0x00000200 /* Check outbound packets */ +#define IP_FW_F_IIFACE 0x00000400 /* Apply inbound interface test */ +#define IP_FW_F_OIFACE 0x00000800 /* Apply outbound interface test */ + +#define IP_FW_F_PRN 0x00001000 /* Print if this rule matches */ + +#define IP_FW_F_SRNG 0x00002000 /* The first two src ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IP_FW_F_DRNG 0x00004000 /* The first two dst ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IP_FW_F_FRAG 0x00008000 /* Fragment */ + +#define IP_FW_F_IIFNAME 0x00010000 /* In interface by name/unit (not IP) */ +#define IP_FW_F_OIFNAME 0x00020000 /* Out interface by name/unit (not IP) */ + +#define IP_FW_F_INVSRC 0x00040000 /* Invert sense of src check */ +#define IP_FW_F_INVDST 0x00080000 /* Invert sense of dst check */ + +#define IP_FW_F_ICMPBIT 0x00100000 /* ICMP type bitmap is valid */ + +#define IP_FW_F_UID 0x00200000 /* filter by uid */ + +#define IP_FW_F_RND_MATCH 0x00800000 /* probabilistic rule match */ +#define IP_FW_F_SMSK 0x01000000 /* src-port + mask */ +#define IP_FW_F_DMSK 0x02000000 /* dst-port + mask */ +#define IP_FW_BRIDGED 0x04000000 /* only match bridged packets */ +#define IP_FW_F_KEEP_S 0x08000000 /* keep state */ +#define IP_FW_F_CHECK_S 0x10000000 /* check state */ + +#define IP_FW_F_SME 0x20000000 /* source = me */ +#define IP_FW_F_DME 0x40000000 /* destination = me */ + +#define IP_FW_F_MASK 0x7FFFFFFF /* All possible flag bits mask */ + +/* + * Flags for the 'fw_ipflg' field, for comparing values of ip and its protocols. + */ +#define IP_FW_IF_TCPEST 0x00000020 /* established TCP connection */ +#define IP_FW_IF_TCPMSK 0x00000020 /* mask of all TCP values */ + +/* + * For backwards compatibility with rules specifying "via iface" but + * not restricted to only "in" or "out" packets, we define this combination + * of bits to represent this configuration. + */ + +#define IF_FW_F_VIAHACK (IP_FW_F_IN|IP_FW_F_OUT|IP_FW_F_IIFACE|IP_FW_F_OIFACE) + +/* + * Definitions for REJECT response codes. + * Values less than 256 correspond to ICMP unreachable codes. + */ +#define IP_FW_REJECT_RST 0x0100 /* TCP packets: send RST */ + +/* + * Definitions for IP option names. + */ +#define IP_FW_IPOPT_LSRR 0x01 +#define IP_FW_IPOPT_SSRR 0x02 +#define IP_FW_IPOPT_RR 0x04 +#define IP_FW_IPOPT_TS 0x08 + +/* + * Definitions for TCP option names. + */ +#define IP_FW_TCPOPT_MSS 0x01 +#define IP_FW_TCPOPT_WINDOW 0x02 +#define IP_FW_TCPOPT_SACK 0x04 +#define IP_FW_TCPOPT_TS 0x08 +#define IP_FW_TCPOPT_CC 0x10 + +/* + * Definitions for TCP flags. + */ +#define IP_FW_TCPF_FIN TH_FIN +#define IP_FW_TCPF_SYN TH_SYN +#define IP_FW_TCPF_RST TH_RST +#define IP_FW_TCPF_PSH TH_PUSH +#define IP_FW_TCPF_ACK TH_ACK +#define IP_FW_TCPF_URG TH_URG + +/* + * Main firewall chains definitions and global var's definitions. + */ + +#endif /* !IPFW2 */ +#endif /* _IP_FW_H */ diff --git a/i386/include/netinet/.svn/text-base/ip_fw2.h.svn-base b/i386/include/netinet/.svn/text-base/ip_fw2.h.svn-base new file mode 100644 index 0000000..8908353 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip_fw2.h.svn-base @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/netinet/ip_fw2.h,v 1.1.2.4 2003/07/17 06:03:39 luigi Exp $ + */ + +#ifndef _IPFW2_H +#define _IPFW2_H + +/* + * Define IP Firewall event subclass, and associated events. + */ + +/*! + @defined KEV_IPFW_SUBCLASS + @discussion The kernel event subclass for IP Firewall. +*/ +#define KEV_IPFW_SUBCLASS 1 + +/*! + @defined KEV_IPFW_ADD + @discussion The event code indicating a rule has been added. +*/ +#define KEV_IPFW_ADD 1 + +/*! + @defined KEV_IPFW_DEL + @discussion The event code indicating a rule has been removed. +*/ +#define KEV_IPFW_DEL 2 + +/*! + @defined KEV_IPFW_FLUSH + @discussion The event code indicating the rule set has been flushed. +*/ +#define KEV_IPFW_FLUSH 3 + +/*! + @defined KEV_IPFW_ENABLE + @discussion The event code indicating the enable flag has been changed +*/ +#define KEV_IPFW_ENABLE 4 + + + +/* + * The kernel representation of ipfw rules is made of a list of + * 'instructions' (for all practical purposes equivalent to BPF + * instructions), which specify which fields of the packet + * (or its metadata) should be analysed. + * + * Each instruction is stored in a structure which begins with + * "ipfw_insn", and can contain extra fields depending on the + * instruction type (listed below). + * Note that the code is written so that individual instructions + * have a size which is a multiple of 32 bits. This means that, if + * such structures contain pointers or other 64-bit entities, + * (there is just one instance now) they may end up unaligned on + * 64-bit architectures, so the must be handled with care. + * + * "enum ipfw_opcodes" are the opcodes supported. We can have up + * to 256 different opcodes. + */ + +enum ipfw_opcodes { /* arguments (4 byte each) */ + O_NOP, + + O_IP_SRC, /* u32 = IP */ + O_IP_SRC_MASK, /* ip = IP/mask */ + O_IP_SRC_ME, /* none */ + O_IP_SRC_SET, /* u32=base, arg1=len, bitmap */ + + O_IP_DST, /* u32 = IP */ + O_IP_DST_MASK, /* ip = IP/mask */ + O_IP_DST_ME, /* none */ + O_IP_DST_SET, /* u32=base, arg1=len, bitmap */ + + O_IP_SRCPORT, /* (n)port list:mask 4 byte ea */ + O_IP_DSTPORT, /* (n)port list:mask 4 byte ea */ + O_PROTO, /* arg1=protocol */ + + O_MACADDR2, /* 2 mac addr:mask */ + O_MAC_TYPE, /* same as srcport */ + + O_LAYER2, /* none */ + O_IN, /* none */ + O_FRAG, /* none */ + + O_RECV, /* none */ + O_XMIT, /* none */ + O_VIA, /* none */ + + O_IPOPT, /* arg1 = 2*u8 bitmap */ + O_IPLEN, /* arg1 = len */ + O_IPID, /* arg1 = id */ + + O_IPTOS, /* arg1 = id */ + O_IPPRECEDENCE, /* arg1 = precedence << 5 */ + O_IPTTL, /* arg1 = TTL */ + + O_IPVER, /* arg1 = version */ + O_UID, /* u32 = id */ + O_GID, /* u32 = id */ + O_ESTAB, /* none (tcp established) */ + O_TCPFLAGS, /* arg1 = 2*u8 bitmap */ + O_TCPWIN, /* arg1 = desired win */ + O_TCPSEQ, /* u32 = desired seq. */ + O_TCPACK, /* u32 = desired seq. */ + O_ICMPTYPE, /* u32 = icmp bitmap */ + O_TCPOPTS, /* arg1 = 2*u8 bitmap */ + + O_VERREVPATH, /* none */ + + O_PROBE_STATE, /* none */ + O_KEEP_STATE, /* none */ + O_LIMIT, /* ipfw_insn_limit */ + O_LIMIT_PARENT, /* dyn_type, not an opcode. */ + + /* + * These are really 'actions'. + */ + + O_LOG, /* ipfw_insn_log */ + O_PROB, /* u32 = match probability */ + + O_CHECK_STATE, /* none */ + O_ACCEPT, /* none */ + O_DENY, /* none */ + O_REJECT, /* arg1=icmp arg (same as deny) */ + O_COUNT, /* none */ + O_SKIPTO, /* arg1=next rule number */ + O_PIPE, /* arg1=pipe number */ + O_QUEUE, /* arg1=queue number */ + O_DIVERT, /* arg1=port number */ + O_TEE, /* arg1=port number */ + O_FORWARD_IP, /* fwd sockaddr */ + O_FORWARD_MAC, /* fwd mac */ + + /* + * More opcodes. + */ + O_IPSEC, /* has ipsec history */ + + O_LAST_OPCODE /* not an opcode! */ +}; + +/* + * Template for instructions. + * + * ipfw_insn is used for all instructions which require no operands, + * a single 16-bit value (arg1), or a couple of 8-bit values. + * + * For other instructions which require different/larger arguments + * we have derived structures, ipfw_insn_*. + * + * The size of the instruction (in 32-bit words) is in the low + * 6 bits of "len". The 2 remaining bits are used to implement + * NOT and OR on individual instructions. Given a type, you can + * compute the length to be put in "len" using F_INSN_SIZE(t) + * + * F_NOT negates the match result of the instruction. + * + * F_OR is used to build or blocks. By default, instructions + * are evaluated as part of a logical AND. An "or" block + * { X or Y or Z } contains F_OR set in all but the last + * instruction of the block. A match will cause the code + * to skip past the last instruction of the block. + * + * NOTA BENE: in a couple of places we assume that + * sizeof(ipfw_insn) == sizeof(u_int32_t) + * this needs to be fixed. + * + */ +typedef struct _ipfw_insn { /* template for instructions */ + enum ipfw_opcodes opcode:8; + u_int8_t len; /* numer of 32-byte words */ +#define F_NOT 0x80 +#define F_OR 0x40 +#define F_LEN_MASK 0x3f +#define F_LEN(cmd) ((cmd)->len & F_LEN_MASK) + + u_int16_t arg1; +} ipfw_insn; + +/* + * The F_INSN_SIZE(type) computes the size, in 4-byte words, of + * a given type. + */ +#define F_INSN_SIZE(t) ((sizeof (t))/sizeof(u_int32_t)) + +/* + * This is used to store an array of 16-bit entries (ports etc.) + */ +typedef struct _ipfw_insn_u16 { + ipfw_insn o; + u_int16_t ports[2]; /* there may be more */ +} ipfw_insn_u16; + +/* + * This is used to store an array of 32-bit entries + * (uid, single IPv4 addresses etc.) + */ +typedef struct _ipfw_insn_u32 { + ipfw_insn o; + u_int32_t d[1]; /* one or more */ +} ipfw_insn_u32; + +/* + * This is used to store IP addr-mask pairs. + */ +typedef struct _ipfw_insn_ip { + ipfw_insn o; + struct in_addr addr; + struct in_addr mask; +} ipfw_insn_ip; + +/* + * This is used to forward to a given address (ip). + */ +typedef struct _ipfw_insn_sa { + ipfw_insn o; + struct sockaddr_in sa; +} ipfw_insn_sa; + +/* + * This is used for MAC addr-mask pairs. + */ +typedef struct _ipfw_insn_mac { + ipfw_insn o; + u_char addr[12]; /* dst[6] + src[6] */ + u_char mask[12]; /* dst[6] + src[6] */ +} ipfw_insn_mac; + +/* + * This is used for interface match rules (recv xx, xmit xx). + */ +typedef struct _ipfw_insn_if { + ipfw_insn o; + union { + struct in_addr ip; + int32_t unit; + } p; + char name[IFNAMSIZ]; +} ipfw_insn_if; + +/* + * This is used for pipe and queue actions, which need to store + * a single pointer (which can have different size on different + * architectures. + * Note that, because of previous instructions, pipe_ptr might + * be unaligned in the overall structure, so it needs to be + * manipulated with care. + */ +typedef struct _ipfw_insn_pipe { + ipfw_insn o; + void *pipe_ptr; /* XXX */ +} ipfw_insn_pipe; + +/* + * This is used for limit rules. + */ +typedef struct _ipfw_insn_limit { + ipfw_insn o; + u_int8_t _pad; + u_int8_t limit_mask; /* combination of DYN_* below */ +#define DYN_SRC_ADDR 0x1 +#define DYN_SRC_PORT 0x2 +#define DYN_DST_ADDR 0x4 +#define DYN_DST_PORT 0x8 + + u_int16_t conn_limit; +} ipfw_insn_limit; + +/* + * This is used for log instructions. + */ +typedef struct _ipfw_insn_log { + ipfw_insn o; + u_int32_t max_log; /* how many do we log -- 0 = all */ + u_int32_t log_left; /* how many left to log */ +} ipfw_insn_log; + +/* Version of this API */ +#define IP_FW_VERSION_NONE 0 +#define IP_FW_VERSION_0 10 /* old ipfw */ +#define IP_FW_VERSION_1 20 /* ipfw in Jaguar/Panther */ +#define IP_FW_VERSION_2 30 /* ipfw2 */ +#define IP_FW_CURRENT_API_VERSION IP_FW_VERSION_2 + +/* + * Here we have the structure representing an ipfw rule. + * + * It starts with a general area (with link fields and counters) + * followed by an array of one or more instructions, which the code + * accesses as an array of 32-bit values. + * + * Given a rule pointer r: + * + * r->cmd is the start of the first instruction. + * ACTION_PTR(r) is the start of the first action (things to do + * once a rule matched). + * + * When assembling instruction, remember the following: + * + * + if a rule has a "keep-state" (or "limit") option, then the + * first instruction (at r->cmd) MUST BE an O_PROBE_STATE + * + if a rule has a "log" option, then the first action + * (at ACTION_PTR(r)) MUST be O_LOG + * + * NOTE: we use a simple linked list of rules because we never need + * to delete a rule without scanning the list. We do not use + * queue(3) macros for portability and readability. + */ + +struct ip_fw { + u_int32_t version; /* Version of this structure. MUST be set */ + /* by clients. Should always be */ + /* set to IP_FW_CURRENT_API_VERSION. */ + void *context; /* Context that is usable by user processes to */ + /* identify this rule. */ + struct ip_fw *next; /* linked list of rules */ + struct ip_fw *next_rule; /* ptr to next [skipto] rule */ + /* 'next_rule' is used to pass up 'set_disable' status */ + + u_int16_t act_ofs; /* offset of action in 32-bit units */ + u_int16_t cmd_len; /* # of 32-bit words in cmd */ + u_int16_t rulenum; /* rule number */ + u_int8_t set; /* rule set (0..31) */ + u_int32_t set_masks[2]; /* masks for manipulating sets atomically */ +#define RESVD_SET 31 /* set for default and persistent rules */ + u_int8_t _pad; /* padding */ + + /* These fields are present in all rules. */ + u_int64_t pcnt; /* Packet counter */ + u_int64_t bcnt; /* Byte counter */ + u_int32_t timestamp; /* tv_sec of last match */ + + u_int32_t reserved_1; /* reserved - set to 0 */ + u_int32_t reserved_2; /* reserved - set to 0 */ + + ipfw_insn cmd[1]; /* storage for commands */ +}; + +#define ACTION_PTR(rule) \ + (ipfw_insn *)( (u_int32_t *)((rule)->cmd) + ((rule)->act_ofs) ) + +#define RULESIZE(rule) (sizeof(struct ip_fw) + \ + ((struct ip_fw *)(rule))->cmd_len * 4 - 4) + +/* + * This structure is used as a flow mask and a flow id for various + * parts of the code. + */ +struct ipfw_flow_id { + u_int32_t dst_ip; + u_int32_t src_ip; + u_int16_t dst_port; + u_int16_t src_port; + u_int8_t proto; + u_int8_t flags; /* protocol-specific flags */ +}; + +/* + * Dynamic ipfw rule. + */ +typedef struct _ipfw_dyn_rule ipfw_dyn_rule; + +struct _ipfw_dyn_rule { + ipfw_dyn_rule *next; /* linked list of rules. */ + struct ip_fw *rule; /* pointer to rule */ + /* 'rule' is used to pass up the rule number (from the parent) */ + + ipfw_dyn_rule *parent; /* pointer to parent rule */ + u_int64_t pcnt; /* packet match counter */ + u_int64_t bcnt; /* byte match counter */ + struct ipfw_flow_id id; /* (masked) flow id */ + u_int32_t expire; /* expire time */ + u_int32_t bucket; /* which bucket in hash table */ + u_int32_t state; /* state of this rule (typically a + * combination of TCP flags) + */ + u_int32_t ack_fwd; /* most recent ACKs in forward */ + u_int32_t ack_rev; /* and reverse directions (used */ + /* to generate keepalives) */ + u_int16_t dyn_type; /* rule type */ + u_int16_t count; /* refcount */ +}; + +/* + * Definitions for IP option names. + */ +#define IP_FW_IPOPT_LSRR 0x01 +#define IP_FW_IPOPT_SSRR 0x02 +#define IP_FW_IPOPT_RR 0x04 +#define IP_FW_IPOPT_TS 0x08 + +/* + * Definitions for TCP option names. + */ +#define IP_FW_TCPOPT_MSS 0x01 +#define IP_FW_TCPOPT_WINDOW 0x02 +#define IP_FW_TCPOPT_SACK 0x04 +#define IP_FW_TCPOPT_TS 0x08 +#define IP_FW_TCPOPT_CC 0x10 + +#define ICMP_REJECT_RST 0x100 /* fake ICMP code (send a TCP RST) */ + +/* + * Main firewall chains definitions and global var's definitions. + */ + + +#endif /* _IPFW2_H */ diff --git a/i386/include/netinet/.svn/text-base/ip_icmp.h.svn-base b/i386/include/netinet/.svn/text-base/ip_icmp.h.svn-base new file mode 100644 index 0000000..0629b0f --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip_icmp.h.svn-base @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/ip_icmp.h,v 1.16 1999/12/29 04:41:01 peter Exp $ + */ + +#ifndef _NETINET_IP_ICMP_H_ +#define _NETINET_IP_ICMP_H_ +#include <sys/appleapiopts.h> + +/* + * Interface Control Message Protocol Definitions. + * Per RFC 792, September 1981. + */ + +/* + * Internal of an ICMP Router Advertisement + */ +struct icmp_ra_addr { + u_int32_t ira_addr; + u_int32_t ira_preference; +}; + +/* + * Structure of an icmp header. + */ +struct icmp { + u_char icmp_type; /* type of message, see below */ + u_char icmp_code; /* type sub code */ + u_short icmp_cksum; /* ones complement cksum of struct */ + union { + u_char ih_pptr; /* ICMP_PARAMPROB */ + struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ + struct ih_idseq { + n_short icd_id; + n_short icd_seq; + } ih_idseq; + int ih_void; + + /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ + struct ih_pmtu { + n_short ipm_void; + n_short ipm_nextmtu; + } ih_pmtu; + + struct ih_rtradv { + u_char irt_num_addrs; + u_char irt_wpa; + u_int16_t irt_lifetime; + } ih_rtradv; + } icmp_hun; +#define icmp_pptr icmp_hun.ih_pptr +#define icmp_gwaddr icmp_hun.ih_gwaddr +#define icmp_id icmp_hun.ih_idseq.icd_id +#define icmp_seq icmp_hun.ih_idseq.icd_seq +#define icmp_void icmp_hun.ih_void +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu +#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs +#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa +#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime + union { + struct id_ts { + n_time its_otime; + n_time its_rtime; + n_time its_ttime; + } id_ts; + struct id_ip { + struct ip idi_ip; + /* options and then 64 bits of data */ + } id_ip; + struct icmp_ra_addr id_radv; + u_int32_t id_mask; + char id_data[1]; + } icmp_dun; +#define icmp_otime icmp_dun.id_ts.its_otime +#define icmp_rtime icmp_dun.id_ts.its_rtime +#define icmp_ttime icmp_dun.id_ts.its_ttime +#define icmp_ip icmp_dun.id_ip.idi_ip +#define icmp_radv icmp_dun.id_radv +#define icmp_mask icmp_dun.id_mask +#define icmp_data icmp_dun.id_data +}; + +/* + * Lower bounds on packet lengths for various types. + * For the error advice packets must first insure that the + * packet is large enough to contain the returned ip header. + * Only then can we do the check to see if 64 bits of packet + * data have been returned, since we need to check the returned + * ip header length. + */ +#define ICMP_MINLEN 8 /* abs minimum */ +#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ +#define ICMP_MASKLEN 12 /* address mask */ +#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ +#ifndef _IP_VHL +#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) + /* N.B.: must separately check that ip_hl >= 5 */ +#else +#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8) + /* N.B.: must separately check that header length >= 5 */ +#endif + +/* + * Definition of type and code field values. + */ +#define ICMP_ECHOREPLY 0 /* echo reply */ +#define ICMP_UNREACH 3 /* dest unreachable, codes: */ +#define ICMP_UNREACH_NET 0 /* bad net */ +#define ICMP_UNREACH_HOST 1 /* bad host */ +#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ +#define ICMP_UNREACH_PORT 3 /* bad port */ +#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ +#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ +#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ +#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ +#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ +#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ +#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ +#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ +#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ +#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */ +#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */ +#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */ +#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ +#define ICMP_REDIRECT 5 /* shorter route, codes: */ +#define ICMP_REDIRECT_NET 0 /* for network */ +#define ICMP_REDIRECT_HOST 1 /* for host */ +#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ +#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ +#define ICMP_ALTHOSTADDR 6 /* alternate host address */ +#define ICMP_ECHO 8 /* echo service */ +#define ICMP_ROUTERADVERT 9 /* router advertisement */ +#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */ +#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */ +#define ICMP_ROUTERSOLICIT 10 /* router solicitation */ +#define ICMP_TIMXCEED 11 /* time exceeded, code: */ +#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ +#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ +#define ICMP_PARAMPROB 12 /* ip header bad */ +#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */ +#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ +#define ICMP_PARAMPROB_LENGTH 2 /* bad length */ +#define ICMP_TSTAMP 13 /* timestamp request */ +#define ICMP_TSTAMPREPLY 14 /* timestamp reply */ +#define ICMP_IREQ 15 /* information request */ +#define ICMP_IREQREPLY 16 /* information reply */ +#define ICMP_MASKREQ 17 /* address mask request */ +#define ICMP_MASKREPLY 18 /* address mask reply */ +#define ICMP_TRACEROUTE 30 /* traceroute */ +#define ICMP_DATACONVERR 31 /* data conversion error */ +#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ +#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ +#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ +#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */ +#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ +#define ICMP_SKIP 39 /* SKIP */ +#define ICMP_PHOTURIS 40 /* Photuris */ +#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */ +#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */ +#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ + +#define ICMP_MAXTYPE 40 + +#define ICMP_INFOTYPE(type) \ + ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ + (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ + (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ + (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ + (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) + + +#endif diff --git a/i386/include/netinet/.svn/text-base/ip_mroute.h.svn-base b/i386/include/netinet/.svn/text-base/ip_mroute.h.svn-base new file mode 100644 index 0000000..8073b11 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip_mroute.h.svn-base @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_IP_MROUTE_H_ +#define _NETINET_IP_MROUTE_H_ +#include <sys/appleapiopts.h> + +/* + * Definitions for IP multicast forwarding. + * + * Written by David Waitzman, BBN Labs, August 1988. + * Modified by Steve Deering, Stanford, February 1989. + * Modified by Ajit Thyagarajan, PARC, August 1993. + * Modified by Ajit Thyagarajan, PARC, August 1994. + * + * MROUTING Revision: 3.3.1.3 + */ + + +/* + * Multicast Routing set/getsockopt commands. + */ +#define MRT_INIT 100 /* initialize forwarder */ +#define MRT_DONE 101 /* shut down forwarder */ +#define MRT_ADD_VIF 102 /* create virtual interface */ +#define MRT_DEL_VIF 103 /* delete virtual interface */ +#define MRT_ADD_MFC 104 /* insert forwarding cache entry */ +#define MRT_DEL_MFC 105 /* delete forwarding cache entry */ +#define MRT_VERSION 106 /* get kernel version number */ +#define MRT_ASSERT 107 /* enable PIM assert processing */ + + + +#ifndef CONFIG_MAXVIFS +#define CONFIG_MAXVIFS 32 /* 4635538 temp workaround */ +#endif + +#ifndef CONFIG_MFCTBLSIZ +#define CONFIG_MFCTBLSIZ 256 /* 4635538 temp workaround */ +#endif + +/* + * Types and macros for handling bitmaps with one bit per virtual interface. + */ +typedef u_int32_t vifbitmap_t; +typedef u_short vifi_t; /* type of a vif index */ +#define ALL_VIFS (vifi_t)-1 + +#define VIFM_SET(n, m) ((m) |= (1 << (n))) +#define VIFM_CLR(n, m) ((m) &= ~(1 << (n))) +#define VIFM_ISSET(n, m) ((m) & (1 << (n))) +#define VIFM_CLRALL(m) ((m) = 0x00000000) +#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom)) +#define VIFM_SAME(m1, m2) ((m1) == (m2)) + + +/* + * Argument structure for MRT_ADD_VIF. + * (MRT_DEL_VIF takes a single vifi_t argument.) + */ +struct vifctl { + vifi_t vifc_vifi; /* the index of the vif to be added */ + u_char vifc_flags; /* VIFF_ flags defined below */ + u_char vifc_threshold; /* min ttl required to forward on vif */ + u_int vifc_rate_limit; /* max rate */ + struct in_addr vifc_lcl_addr; /* local interface address */ + struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */ +}; + +#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */ +#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */ + +/* + * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC + * (mfcc_tos to be added at a future point) + */ +struct mfcctl { + struct in_addr mfcc_origin; /* ip origin of mcasts */ + struct in_addr mfcc_mcastgrp; /* multicast group associated*/ + vifi_t mfcc_parent; /* incoming vif */ + u_char mfcc_ttls[CONFIG_MAXVIFS]; /* forwarding ttls on vifs */ +}; + +/* + * The kernel's multicast routing statistics. + */ +struct mrtstat { + u_int32_t mrts_mfc_lookups; /* # forw. cache hash table hits */ + u_int32_t mrts_mfc_misses; /* # forw. cache hash table misses */ + u_int32_t mrts_upcalls; /* # calls to mrouted */ + u_int32_t mrts_no_route; /* no route for packet's origin */ + u_int32_t mrts_bad_tunnel; /* malformed tunnel options */ + u_int32_t mrts_cant_tunnel; /* no room for tunnel options */ + u_int32_t mrts_wrong_if; /* arrived on wrong interface */ + u_int32_t mrts_upq_ovflw; /* upcall Q overflow */ + u_int32_t mrts_cache_cleanups; /* # entries with no upcalls */ + u_int32_t mrts_drop_sel; /* pkts dropped selectively */ + u_int32_t mrts_q_overflow; /* pkts dropped - Q overflow */ + u_int32_t mrts_pkt2large; /* pkts dropped - size > BKT SIZE */ + u_int32_t mrts_upq_sockfull; /* upcalls dropped - socket full */ +}; + +/* + * Argument structure used by mrouted to get src-grp pkt counts + */ +struct sioc_sg_req { + struct in_addr src; + struct in_addr grp; + u_int32_t pktcnt; + u_int32_t bytecnt; + u_int32_t wrong_if; +}; + +/* + * Argument structure used by mrouted to get vif pkt counts + */ +struct sioc_vif_req { + vifi_t vifi; /* vif number */ + u_int32_t icount; /* Input packet count on vif */ + u_int32_t ocount; /* Output packet count on vif */ + u_int32_t ibytes; /* Input byte count on vif */ + u_int32_t obytes; /* Output byte count on vif */ +}; + + +/* + * The kernel's multicast forwarding cache entry structure + * (A field for the type of service (mfc_tos) is to be added + * at a future point) + */ +struct mfc { + struct in_addr mfc_origin; /* IP origin of mcasts */ + struct in_addr mfc_mcastgrp; /* multicast group associated*/ + vifi_t mfc_parent; /* incoming vif */ + u_char mfc_ttls[CONFIG_MAXVIFS]; /* forwarding ttls on vifs */ + u_int32_t mfc_pkt_cnt; /* pkt count for src-grp */ + u_int32_t mfc_byte_cnt; /* byte count for src-grp */ + u_int32_t mfc_wrong_if; /* wrong if for src-grp */ + int mfc_expire; /* time to clean entry up */ + struct timeval mfc_last_assert; /* last time I sent an assert*/ + struct rtdetq *mfc_stall; /* q of packets awaiting mfc */ + struct mfc *mfc_next; /* next mfc entry */ +}; + +/* + * Struct used to communicate from kernel to multicast router + * note the convenient similarity to an IP packet + */ +struct igmpmsg { + u_int32_t unused1; + u_int32_t unused2; + u_char im_msgtype; /* what type of message */ +#define IGMPMSG_NOCACHE 1 +#define IGMPMSG_WRONGVIF 2 + u_char im_mbz; /* must be zero */ + u_char im_vif; /* vif rec'd on */ + u_char unused3; + struct in_addr im_src, im_dst; +}; + +#define MFCTBLSIZ CONFIG_MFCTBLSIZ + +#endif /* _NETINET_IP_MROUTE_H_ */ diff --git a/i386/include/netinet/.svn/text-base/ip_var.h.svn-base b/i386/include/netinet/.svn/text-base/ip_var.h.svn-base new file mode 100644 index 0000000..891f33a --- /dev/null +++ b/i386/include/netinet/.svn/text-base/ip_var.h.svn-base @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_var.h 8.2 (Berkeley) 1/9/95 + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _NETINET_IP_VAR_H_ +#define _NETINET_IP_VAR_H_ +#include <sys/appleapiopts.h> + +/* + * Overlay for ip header used by other protocols (tcp, udp). + */ +struct ipovly { + u_char ih_x1[9]; /* (unused) */ + u_char ih_pr; /* protocol */ + u_short ih_len; /* protocol length */ + struct in_addr ih_src; /* source internet address */ + struct in_addr ih_dst; /* destination internet address */ +}; + +#define MAX_IPOPTLEN 40 + +struct ipstat { + u_int32_t ips_total; /* total packets received */ + u_int32_t ips_badsum; /* checksum bad */ + u_int32_t ips_tooshort; /* packet too short */ + u_int32_t ips_toosmall; /* not enough data */ + u_int32_t ips_badhlen; /* ip header length < data size */ + u_int32_t ips_badlen; /* ip length < ip header length */ + u_int32_t ips_fragments; /* fragments received */ + u_int32_t ips_fragdropped; /* frags dropped (dups, out of space) */ + u_int32_t ips_fragtimeout; /* fragments timed out */ + u_int32_t ips_forward; /* packets forwarded */ + u_int32_t ips_fastforward; /* packets fast forwarded */ + u_int32_t ips_cantforward; /* packets rcvd for unreachable dest */ + u_int32_t ips_redirectsent; /* packets forwarded on same net */ + u_int32_t ips_noproto; /* unknown or unsupported protocol */ + u_int32_t ips_delivered; /* datagrams delivered to upper level*/ + u_int32_t ips_localout; /* total ip packets generated here */ + u_int32_t ips_odropped; /* lost packets due to nobufs, etc. */ + u_int32_t ips_reassembled; /* total packets reassembled ok */ + u_int32_t ips_fragmented; /* datagrams successfully fragmented */ + u_int32_t ips_ofragments; /* output fragments created */ + u_int32_t ips_cantfrag; /* don't fragment flag was set, etc. */ + u_int32_t ips_badoptions; /* error in option processing */ + u_int32_t ips_noroute; /* packets discarded due to no route */ + u_int32_t ips_badvers; /* ip version != 4 */ + u_int32_t ips_rawout; /* total raw ip packets generated */ + u_int32_t ips_toolong; /* ip length > max ip packet size */ + u_int32_t ips_notmember; /* multicasts for unregistered grps */ + u_int32_t ips_nogif; /* no match gif found */ + u_int32_t ips_badaddr; /* invalid address on header */ +}; + +struct ip_linklocal_stat { + u_int32_t iplls_in_total; + u_int32_t iplls_in_badttl; + u_int32_t iplls_out_total; + u_int32_t iplls_out_badttl; +}; + +#endif /* !_NETINET_IP_VAR_H_ */ diff --git a/i386/include/netinet/.svn/text-base/tcp.h.svn-base b/i386/include/netinet/.svn/text-base/tcp.h.svn-base new file mode 100644 index 0000000..3b4d8f9 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/tcp.h.svn-base @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $ + */ + +#ifndef _NETINET_TCP_H_ +#define _NETINET_TCP_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> +#include <machine/endian.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef __uint32_t tcp_seq; +typedef __uint32_t tcp_cc; /* connection count per rfc1644 */ + +#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */ +#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */ + +/* + * TCP header. + * Per RFC 793, September, 1981. + */ +struct tcphdr { + unsigned short th_sport; /* source port */ + unsigned short th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + unsigned int th_x2:4, /* (unused) */ + th_off:4; /* data offset */ +#endif +#if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN + unsigned int th_off:4, /* data offset */ + th_x2:4; /* (unused) */ +#endif + unsigned char th_flags; +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 +#define TH_ECE 0x40 +#define TH_CWR 0x80 +#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR) + + unsigned short th_win; /* window */ + unsigned short th_sum; /* checksum */ + unsigned short th_urp; /* urgent pointer */ +}; + +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOLEN_MAXSEG 4 +#define TCPOPT_WINDOW 3 +#define TCPOLEN_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 /* Experimental */ +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOPT_SACK 5 /* Experimental */ +#define TCPOLEN_SACK 8 /* len of sack block */ +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_TIMESTAMP 10 +#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ +#define TCPOPT_TSTAMP_HDR \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) + +#define MAX_TCPOPTLEN 40 /* Absolute maximum TCP options len */ + +#define TCPOPT_CC 11 /* CC options: RFC-1644 */ +#define TCPOPT_CCNEW 12 +#define TCPOPT_CCECHO 13 +#define TCPOLEN_CC 6 +#define TCPOLEN_CC_APPA (TCPOLEN_CC+2) +#define TCPOPT_CC_HDR(ccopt) \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) +#define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */ +#define TCPOLEN_SIGNATURE 18 + +/* Option definitions */ +#define TCPOPT_SACK_PERMIT_HDR \ +(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK_PERMITTED<<8|TCPOLEN_SACK_PERMITTED) +#define TCPOPT_SACK_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK<<8) +/* Miscellaneous constants */ +#define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at sender side */ +#define TCP_MAX_SACK 3 /* MAX # SACKs sent in any segment */ + + +/* + * Default maximum segment size for TCP. + * With an IP MTU of 576, this is 536, + * but 512 is probably more convenient. + * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). + */ +#define TCP_MSS 512 + +/* + * TCP_MINMSS is defined to be 216 which is fine for the smallest + * link MTU (256 bytes, SLIP interface) in the Internet. + * However it is very unlikely to come across such low MTU interfaces + * these days (anno dato 2004). + * Probably it can be set to 512 without ill effects. But we play safe. + * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. + * Setting this to "0" disables the minmss check. + */ +#define TCP_MINMSS 216 + +/* + * TCP_MINMSSOVERLOAD is defined to be 1000 which should cover any type + * of interactive TCP session. + * See tcp_subr.c tcp_minmssoverload SYSCTL declaration and tcp_input.c + * for more comments. + * Setting this to "0" disables the minmssoverload check. + */ +#define TCP_MINMSSOVERLOAD 1000 + +/* + * Default maximum segment size for TCP6. + * With an IP6 MSS of 1280, this is 1220, + * but 1024 is probably more convenient. (xxx kazu in doubt) + * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)) + */ +#define TCP6_MSS 1024 + +#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ +#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ + +#define TCP_MAX_WINSHIFT 14 /* maximum window shift */ + +#define TCP_MAXBURST 4 /* maximum segments in a burst */ + +#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ +#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) + /* max space left for options */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * User-settable options (used with setsockopt). + */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define TCP_MAXSEG 0x02 /* set maximum segment size */ +#define TCP_NOPUSH 0x04 /* don't push last block of write */ +#define TCP_NOOPT 0x08 /* don't use TCP options */ +#define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */ +#define TCP_CONNECTIONTIMEOUT 0x20 /* connection timeout */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#endif diff --git a/i386/include/netinet/.svn/text-base/tcp_fsm.h.svn-base b/i386/include/netinet/.svn/text-base/tcp_fsm.h.svn-base new file mode 100644 index 0000000..aaa7196 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/tcp_fsm.h.svn-base @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp_fsm.h,v 1.14 1999/11/07 04:18:30 jlemon Exp $ + */ + +#ifndef _NETINET_TCP_FSM_H_ +#define _NETINET_TCP_FSM_H_ +#include <sys/appleapiopts.h> + +/* + * TCP FSM state definitions. + * Per RFC793, September, 1981. + */ + +#define TCP_NSTATES 11 + +#define TCPS_CLOSED 0 /* closed */ +#define TCPS_LISTEN 1 /* listening for connection */ +#define TCPS_SYN_SENT 2 /* active, have sent syn */ +#define TCPS_SYN_RECEIVED 3 /* have send and received syn */ +/* states < TCPS_ESTABLISHED are those where connections not established */ +#define TCPS_ESTABLISHED 4 /* established */ +#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */ +/* states > TCPS_CLOSE_WAIT are those where user has closed */ +#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */ +#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */ +#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */ +/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */ +#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */ +#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */ + +/* for KAME src sync over BSD*'s */ +#define TCP6_NSTATES TCP_NSTATES +#define TCP6S_CLOSED TCPS_CLOSED +#define TCP6S_LISTEN TCPS_LISTEN +#define TCP6S_SYN_SENT TCPS_SYN_SENT +#define TCP6S_SYN_RECEIVED TCPS_SYN_RECEIVED +#define TCP6S_ESTABLISHED TCPS_ESTABLISHED +#define TCP6S_CLOSE_WAIT TCPS_CLOSE_WAIT +#define TCP6S_FIN_WAIT_1 TCPS_FIN_WAIT_1 +#define TCP6S_CLOSING TCPS_CLOSING +#define TCP6S_LAST_ACK TCPS_LAST_ACK +#define TCP6S_FIN_WAIT_2 TCPS_FIN_WAIT_2 +#define TCP6S_TIME_WAIT TCPS_TIME_WAIT + +#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) +#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED) +#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) + + +#if KPROF +#endif + +#ifdef TCPSTATES +char *tcpstates[] = { + "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", + "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING", + "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT" +}; +#endif + +#endif diff --git a/i386/include/netinet/.svn/text-base/tcp_seq.h.svn-base b/i386/include/netinet/.svn/text-base/tcp_seq.h.svn-base new file mode 100644 index 0000000..6494e58 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/tcp_seq.h.svn-base @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95 + * $FreeBSD: src/sys/netinet/tcp_seq.h,v 1.11.2.5 2001/08/22 00:59:12 silby Exp $ + */ + +#ifndef _NETINET_TCP_SEQ_H_ +#define _NETINET_TCP_SEQ_H_ +#include <sys/appleapiopts.h> +/* + * TCP sequence numbers are 32 bit integers operated + * on with modular arithmetic. These macros can be + * used to compare such integers. + */ +#define SEQ_LT(a,b) ((int)((a)-(b)) < 0) +#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define SEQ_GT(a,b) ((int)((a)-(b)) > 0) +#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) + +#define SEQ_MIN(a, b) ((SEQ_LT(a, b)) ? (a) : (b)) +#define SEQ_MAX(a, b) ((SEQ_GT(a, b)) ? (a) : (b)) + +/* for modulo comparisons of timestamps */ +#define TSTMP_LT(a,b) ((int)((a)-(b)) < 0) +#define TSTMP_GEQ(a,b) ((int)((a)-(b)) >= 0) + +/* + * TCP connection counts are 32 bit integers operated + * on with modular arithmetic. These macros can be + * used to compare such integers. + */ +#define CC_LT(a,b) ((int)((a)-(b)) < 0) +#define CC_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define CC_GT(a,b) ((int)((a)-(b)) > 0) +#define CC_GEQ(a,b) ((int)((a)-(b)) >= 0) + +/* Macro to increment a CC: skip 0 which has a special meaning */ +#define CC_INC(c) (++(c) == 0 ? ++(c) : (c)) + +#endif /* _NETINET_TCP_SEQ_H_ */ diff --git a/i386/include/netinet/.svn/text-base/tcp_timer.h.svn-base b/i386/include/netinet/.svn/text-base/tcp_timer.h.svn-base new file mode 100644 index 0000000..90f46d0 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/tcp_timer.h.svn-base @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp_timer.h,v 1.18 1999/12/29 04:41:03 peter Exp $ + */ + +#ifndef _NETINET_TCP_TIMER_H_ +#define _NETINET_TCP_TIMER_H_ +#include <sys/appleapiopts.h> + +/* + * Definitions of the TCP timers. These timers are counted + * down PR_SLOWHZ times a second. + */ +#define TCPT_NTIMERS 4 + +#define TCPT_REXMT 0 /* retransmit */ +#define TCPT_PERSIST 1 /* retransmit persistence */ +#define TCPT_KEEP 2 /* keep alive */ +#define TCPT_2MSL 3 /* 2*msl quiet time timer */ + +/* + * The TCPT_REXMT timer is used to force retransmissions. + * The TCP has the TCPT_REXMT timer set whenever segments + * have been sent for which ACKs are expected but not yet + * received. If an ACK is received which advances tp->snd_una, + * then the retransmit timer is cleared (if there are no more + * outstanding segments) or reset to the base value (if there + * are more ACKs expected). Whenever the retransmit timer goes off, + * we retransmit one unacknowledged segment, and do a backoff + * on the retransmit timer. + * + * The TCPT_PERSIST timer is used to keep window size information + * flowing even if the window goes shut. If all previous transmissions + * have been acknowledged (so that there are no retransmissions in progress), + * and the window is too small to bother sending anything, then we start + * the TCPT_PERSIST timer. When it expires, if the window is nonzero, + * we go to transmit state. Otherwise, at intervals send a single byte + * into the peer's window to force him to update our window information. + * We do this at most as often as TCPT_PERSMIN time intervals, + * but no more frequently than the current estimate of round-trip + * packet time. The TCPT_PERSIST timer is cleared whenever we receive + * a window update from the peer. + * + * The TCPT_KEEP timer is used to keep connections alive. If an + * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time, + * but not yet established, then we drop the connection. Once the connection + * is established, if the connection is idle for TCPTV_KEEP_IDLE time + * (and keepalives have been enabled on the socket), we begin to probe + * the connection. We force the peer to send us a segment by sending: + * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK> + * This segment is (deliberately) outside the window, and should elicit + * an ack segment in response from the peer. If, despite the TCPT_KEEP + * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE + * amount of time probing, then we drop the connection. + */ + +#endif /* !_NETINET_TCP_TIMER_H_ */ + diff --git a/i386/include/netinet/.svn/text-base/tcp_var.h.svn-base b/i386/include/netinet/.svn/text-base/tcp_var.h.svn-base new file mode 100644 index 0000000..1cb4847 --- /dev/null +++ b/i386/include/netinet/.svn/text-base/tcp_var.h.svn-base @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993, 1994, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95 + * $FreeBSD: src/sys/netinet/tcp_var.h,v 1.56.2.8 2001/08/22 00:59:13 silby Exp $ + */ + +#ifndef _NETINET_TCP_VAR_H_ +#define _NETINET_TCP_VAR_H_ +#include <sys/appleapiopts.h> +#include <sys/queue.h> +#include <netinet/in_pcb.h> +#include <netinet/tcp_timer.h> + +#if defined(__LP64__) +#define _TCPCB_PTR(x) u_int32_t +#define _TCPCB_LIST_HEAD(name, type) \ +struct name { \ + u_int32_t lh_first; \ +}; +#else +#define _TCPCB_PTR(x) x +#define _TCPCB_LIST_HEAD(name, type) LIST_HEAD(name, type) +#endif + +#define TCP_RETRANSHZ 10 /* tcp retrans timer (100ms) per hz */ + +struct tseg_qent; +_TCPCB_LIST_HEAD(tsegqe_head, tseg_qent); + +struct tcpcb { + struct tsegqe_head t_segq; + int t_dupacks; /* consecutive dup acks recd */ + u_int32_t unused; /* unused now: was t_template */ + + int t_timer[TCPT_NTIMERS]; /* tcp timers */ + + _TCPCB_PTR(struct inpcb *) t_inpcb; /* back pointer to internet pcb */ + int t_state; /* state of this connection */ + u_int t_flags; +#define TF_ACKNOW 0x00001 /* ack peer immediately */ +#define TF_DELACK 0x00002 /* ack, but try to delay it */ +#define TF_NODELAY 0x00004 /* don't delay packets to coalesce */ +#define TF_NOOPT 0x00008 /* don't use tcp options */ +#define TF_SENTFIN 0x00010 /* have sent FIN */ +#define TF_REQ_SCALE 0x00020 /* have/will request window scaling */ +#define TF_RCVD_SCALE 0x00040 /* other side has requested scaling */ +#define TF_REQ_TSTMP 0x00080 /* have/will request timestamps */ +#define TF_RCVD_TSTMP 0x00100 /* a timestamp was received in SYN */ +#define TF_SACK_PERMIT 0x00200 /* other side said I could SACK */ +#define TF_NEEDSYN 0x00400 /* send SYN (implicit state) */ +#define TF_NEEDFIN 0x00800 /* send FIN (implicit state) */ +#define TF_NOPUSH 0x01000 /* don't push */ +#define TF_REQ_CC 0x02000 /* have/will request CC */ +#define TF_RCVD_CC 0x04000 /* a CC was received in SYN */ +#define TF_SENDCCNEW 0x08000 /* send CCnew instead of CC in SYN */ +#define TF_MORETOCOME 0x10000 /* More data to be appended to sock */ +#define TF_LQ_OVERFLOW 0x20000 /* listen queue overflow */ +#define TF_RXWIN0SENT 0x40000 /* sent a receiver win 0 in response */ +#define TF_SLOWLINK 0x80000 /* route is a on a modem speed link */ + + int t_force; /* 1 if forcing out a byte */ + + tcp_seq snd_una; /* send unacknowledged */ + tcp_seq snd_max; /* highest sequence number sent; + * used to recognize retransmits + */ + tcp_seq snd_nxt; /* send next */ + tcp_seq snd_up; /* send urgent pointer */ + + tcp_seq snd_wl1; /* window update seg seq number */ + tcp_seq snd_wl2; /* window update seg ack number */ + tcp_seq iss; /* initial send sequence number */ + tcp_seq irs; /* initial receive sequence number */ + + tcp_seq rcv_nxt; /* receive next */ + tcp_seq rcv_adv; /* advertised window */ + u_int32_t rcv_wnd; /* receive window */ + tcp_seq rcv_up; /* receive urgent pointer */ + + u_int32_t snd_wnd; /* send window */ + u_int32_t snd_cwnd; /* congestion-controlled window */ + u_int32_t snd_ssthresh; /* snd_cwnd size threshold for + * for slow start exponential to + * linear switch + */ + u_int t_maxopd; /* mss plus options */ + + u_int32_t t_rcvtime; /* inactivity time */ + u_int32_t t_starttime; /* time connection was established */ + int t_rtttime; /* round trip time */ + tcp_seq t_rtseq; /* sequence number being timed */ + + int t_rxtcur; /* current retransmit value (ticks) */ + u_int t_maxseg; /* maximum segment size */ + int t_srtt; /* smoothed round-trip time */ + int t_rttvar; /* variance in round-trip time */ + + int t_rxtshift; /* log(2) of rexmt exp. backoff */ + u_int t_rttmin; /* minimum rtt allowed */ + u_int32_t t_rttupdated; /* number of times rtt sampled */ + u_int32_t max_sndwnd; /* largest window peer has offered */ + + int t_softerror; /* possible error not yet reported */ +/* out-of-band data */ + char t_oobflags; /* have some */ + char t_iobc; /* input character */ +#define TCPOOB_HAVEDATA 0x01 +#define TCPOOB_HADDATA 0x02 +/* RFC 1323 variables */ + u_char snd_scale; /* window scaling for send window */ + u_char rcv_scale; /* window scaling for recv window */ + u_char request_r_scale; /* pending window scaling */ + u_char requested_s_scale; + u_int32_t ts_recent; /* timestamp echo data */ + + u_int32_t ts_recent_age; /* when last updated */ + tcp_seq last_ack_sent; +/* RFC 1644 variables */ + tcp_cc cc_send; /* send connection count */ + tcp_cc cc_recv; /* receive connection count */ + tcp_seq snd_recover; /* for use in fast recovery */ +/* experimental */ + u_int32_t snd_cwnd_prev; /* cwnd prior to retransmit */ + u_int32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ + u_int32_t t_badrxtwin; /* window for retransmit recovery */ +}; + + +/* + * TCP statistics. + * Many of these should be kept per connection, + * but that's inconvenient at the moment. + */ +struct tcpstat { + u_int32_t tcps_connattempt; /* connections initiated */ + u_int32_t tcps_accepts; /* connections accepted */ + u_int32_t tcps_connects; /* connections established */ + u_int32_t tcps_drops; /* connections dropped */ + u_int32_t tcps_conndrops; /* embryonic connections dropped */ + u_int32_t tcps_closed; /* conn. closed (includes drops) */ + u_int32_t tcps_segstimed; /* segs where we tried to get rtt */ + u_int32_t tcps_rttupdated; /* times we succeeded */ + u_int32_t tcps_delack; /* delayed acks sent */ + u_int32_t tcps_timeoutdrop; /* conn. dropped in rxmt timeout */ + u_int32_t tcps_rexmttimeo; /* retransmit timeouts */ + u_int32_t tcps_persisttimeo; /* persist timeouts */ + u_int32_t tcps_keeptimeo; /* keepalive timeouts */ + u_int32_t tcps_keepprobe; /* keepalive probes sent */ + u_int32_t tcps_keepdrops; /* connections dropped in keepalive */ + + u_int32_t tcps_sndtotal; /* total packets sent */ + u_int32_t tcps_sndpack; /* data packets sent */ + u_int32_t tcps_sndbyte; /* data bytes sent */ + u_int32_t tcps_sndrexmitpack; /* data packets retransmitted */ + u_int32_t tcps_sndrexmitbyte; /* data bytes retransmitted */ + u_int32_t tcps_sndacks; /* ack-only packets sent */ + u_int32_t tcps_sndprobe; /* window probes sent */ + u_int32_t tcps_sndurg; /* packets sent with URG only */ + u_int32_t tcps_sndwinup; /* window update-only packets sent */ + u_int32_t tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */ + + u_int32_t tcps_rcvtotal; /* total packets received */ + u_int32_t tcps_rcvpack; /* packets received in sequence */ + u_int32_t tcps_rcvbyte; /* bytes received in sequence */ + u_int32_t tcps_rcvbadsum; /* packets received with ccksum errs */ + u_int32_t tcps_rcvbadoff; /* packets received with bad offset */ + u_int32_t tcps_rcvmemdrop; /* packets dropped for lack of memory */ + u_int32_t tcps_rcvshort; /* packets received too short */ + u_int32_t tcps_rcvduppack; /* duplicate-only packets received */ + u_int32_t tcps_rcvdupbyte; /* duplicate-only bytes received */ + u_int32_t tcps_rcvpartduppack; /* packets with some duplicate data */ + u_int32_t tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */ + u_int32_t tcps_rcvoopack; /* out-of-order packets received */ + u_int32_t tcps_rcvoobyte; /* out-of-order bytes received */ + u_int32_t tcps_rcvpackafterwin; /* packets with data after window */ + u_int32_t tcps_rcvbyteafterwin; /* bytes rcvd after window */ + u_int32_t tcps_rcvafterclose; /* packets rcvd after "close" */ + u_int32_t tcps_rcvwinprobe; /* rcvd window probe packets */ + u_int32_t tcps_rcvdupack; /* rcvd duplicate acks */ + u_int32_t tcps_rcvacktoomuch; /* rcvd acks for unsent data */ + u_int32_t tcps_rcvackpack; /* rcvd ack packets */ + u_int32_t tcps_rcvackbyte; /* bytes acked by rcvd acks */ + u_int32_t tcps_rcvwinupd; /* rcvd window update packets */ + u_int32_t tcps_pawsdrop; /* segments dropped due to PAWS */ + u_int32_t tcps_predack; /* times hdr predict ok for acks */ + u_int32_t tcps_preddat; /* times hdr predict ok for data pkts */ + u_int32_t tcps_pcbcachemiss; + u_int32_t tcps_cachedrtt; /* times cached RTT in route updated */ + u_int32_t tcps_cachedrttvar; /* times cached rttvar updated */ + u_int32_t tcps_cachedssthresh; /* times cached ssthresh updated */ + u_int32_t tcps_usedrtt; /* times RTT initialized from route */ + u_int32_t tcps_usedrttvar; /* times RTTVAR initialized from rt */ + u_int32_t tcps_usedssthresh; /* times ssthresh initialized from rt*/ + u_int32_t tcps_persistdrop; /* timeout in persist state */ + u_int32_t tcps_badsyn; /* bogus SYN, e.g. premature ACK */ + u_int32_t tcps_mturesent; /* resends due to MTU discovery */ + u_int32_t tcps_listendrop; /* listen queue overflows */ + + /* new stats from FreeBSD 5.4 sync up */ + u_int32_t tcps_minmssdrops; /* average minmss too low drops */ + u_int32_t tcps_sndrexmitbad; /* unnecessary packet retransmissions */ + u_int32_t tcps_badrst; /* ignored RSTs in the window */ + + u_int32_t tcps_sc_added; /* entry added to syncache */ + u_int32_t tcps_sc_retransmitted; /* syncache entry was retransmitted */ + u_int32_t tcps_sc_dupsyn; /* duplicate SYN packet */ + u_int32_t tcps_sc_dropped; /* could not reply to packet */ + u_int32_t tcps_sc_completed; /* successful extraction of entry */ + u_int32_t tcps_sc_bucketoverflow; /* syncache per-bucket limit hit */ + u_int32_t tcps_sc_cacheoverflow; /* syncache cache limit hit */ + u_int32_t tcps_sc_reset; /* RST removed entry from syncache */ + u_int32_t tcps_sc_stale; /* timed out or listen socket gone */ + u_int32_t tcps_sc_aborted; /* syncache entry aborted */ + u_int32_t tcps_sc_badack; /* removed due to bad ACK */ + u_int32_t tcps_sc_unreach; /* ICMP unreachable received */ + u_int32_t tcps_sc_zonefail; /* zalloc() failed */ + u_int32_t tcps_sc_sendcookie; /* SYN cookie sent */ + u_int32_t tcps_sc_recvcookie; /* SYN cookie received */ + + u_int32_t tcps_hc_added; /* entry added to hostcache */ + u_int32_t tcps_hc_bucketoverflow; /* hostcache per bucket limit hit */ + + /* SACK related stats */ + u_int32_t tcps_sack_recovery_episode; /* SACK recovery episodes */ + u_int32_t tcps_sack_rexmits; /* SACK rexmit segments */ + u_int32_t tcps_sack_rexmit_bytes; /* SACK rexmit bytes */ + u_int32_t tcps_sack_rcv_blocks; /* SACK blocks (options) received */ + u_int32_t tcps_sack_send_blocks; /* SACK blocks (options) sent */ + u_int32_t tcps_sack_sboverflow; /* SACK sendblock overflow */ + +#if TRAFFIC_MGT + u_int32_t tcps_bg_rcvtotal; /* total background packets received */ +#endif /* TRAFFIC_MGT */ +}; + +#pragma pack(4) + +/* + * TCB structure exported to user-land via sysctl(3). + * Evil hack: declare only if in_pcb.h and sys/socketvar.h have been + * included. Not all of our clients do. + */ + +struct xtcpcb { + u_int32_t xt_len; + struct inpcb xt_inp; + struct tcpcb xt_tp; + struct xsocket xt_socket; + u_quad_t xt_alignment_hack; +}; + +#if !CONFIG_EMBEDDED + +struct xtcpcb64 { + u_int32_t xt_len; + struct xinpcb64 xt_inpcb; + + u_int64_t t_segq; + int t_dupacks; /* consecutive dup acks recd */ + + int t_timer[TCPT_NTIMERS]; /* tcp timers */ + + int t_state; /* state of this connection */ + u_int t_flags; + + int t_force; /* 1 if forcing out a byte */ + + tcp_seq snd_una; /* send unacknowledged */ + tcp_seq snd_max; /* highest sequence number sent; + * used to recognize retransmits + */ + tcp_seq snd_nxt; /* send next */ + tcp_seq snd_up; /* send urgent pointer */ + + tcp_seq snd_wl1; /* window update seg seq number */ + tcp_seq snd_wl2; /* window update seg ack number */ + tcp_seq iss; /* initial send sequence number */ + tcp_seq irs; /* initial receive sequence number */ + + tcp_seq rcv_nxt; /* receive next */ + tcp_seq rcv_adv; /* advertised window */ + u_int32_t rcv_wnd; /* receive window */ + tcp_seq rcv_up; /* receive urgent pointer */ + + u_int32_t snd_wnd; /* send window */ + u_int32_t snd_cwnd; /* congestion-controlled window */ + u_int32_t snd_ssthresh; /* snd_cwnd size threshold for + * for slow start exponential to + * linear switch + */ + u_int t_maxopd; /* mss plus options */ + + u_int32_t t_rcvtime; /* inactivity time */ + u_int32_t t_starttime; /* time connection was established */ + int t_rtttime; /* round trip time */ + tcp_seq t_rtseq; /* sequence number being timed */ + + int t_rxtcur; /* current retransmit value (ticks) */ + u_int t_maxseg; /* maximum segment size */ + int t_srtt; /* smoothed round-trip time */ + int t_rttvar; /* variance in round-trip time */ + + int t_rxtshift; /* log(2) of rexmt exp. backoff */ + u_int t_rttmin; /* minimum rtt allowed */ + u_int32_t t_rttupdated; /* number of times rtt sampled */ + u_int32_t max_sndwnd; /* largest window peer has offered */ + + int t_softerror; /* possible error not yet reported */ +/* out-of-band data */ + char t_oobflags; /* have some */ + char t_iobc; /* input character */ +/* RFC 1323 variables */ + u_char snd_scale; /* window scaling for send window */ + u_char rcv_scale; /* window scaling for recv window */ + u_char request_r_scale; /* pending window scaling */ + u_char requested_s_scale; + u_int32_t ts_recent; /* timestamp echo data */ + + u_int32_t ts_recent_age; /* when last updated */ + tcp_seq last_ack_sent; +/* RFC 1644 variables */ + tcp_cc cc_send; /* send connection count */ + tcp_cc cc_recv; /* receive connection count */ + tcp_seq snd_recover; /* for use in fast recovery */ +/* experimental */ + u_int32_t snd_cwnd_prev; /* cwnd prior to retransmit */ + u_int32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ + u_int32_t t_badrxtwin; /* window for retransmit recovery */ + + u_quad_t xt_alignment_hack; +}; + +#endif /* !CONFIG_EMBEDDED */ + +#pragma pack() + +/* + * Names for TCP sysctl objects + */ +#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */ +#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */ +#define TCPCTL_MSSDFLT 3 /* MSS default */ +#define TCPCTL_STATS 4 /* statistics (read-only) */ +#define TCPCTL_RTTDFLT 5 /* default RTT estimate */ +#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */ +#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ +#define TCPCTL_SENDSPACE 8 /* send buffer space */ +#define TCPCTL_RECVSPACE 9 /* receive buffer space */ +#define TCPCTL_KEEPINIT 10 /* timeout for establishing syn */ +#define TCPCTL_PCBLIST 11 /* list of all outstanding PCBs */ +#define TCPCTL_DELACKTIME 12 /* time before sending delayed ACK */ +#define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */ +#define TCPCTL_MAXID 14 + + +#endif /* _NETINET_TCP_VAR_H_ */ diff --git a/i386/include/netinet/.svn/text-base/tcpip.h.svn-base b/i386/include/netinet/.svn/text-base/tcpip.h.svn-base new file mode 100644 index 0000000..4868d6e --- /dev/null +++ b/i386/include/netinet/.svn/text-base/tcpip.h.svn-base @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcpip.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcpip.h,v 1.8 1999/08/28 00:49:34 peter Exp $ + */ + +#ifndef _NETINET_TCPIP_H_ +#define _NETINET_TCPIP_H_ +#include <sys/appleapiopts.h> +#include <netinet/ip_var.h> +/* + * Tcp+ip header, after ip options removed. + */ +struct tcpiphdr { + struct ipovly ti_i; /* overlaid ip structure */ + struct tcphdr ti_t; /* tcp header */ +}; +#ifdef notyet +/* + * Tcp+ip header, after ip options removed but including TCP options. + */ +struct full_tcpiphdr { + struct ipovly ti_i; /* overlaid ip structure */ + struct tcphdr ti_t; /* tcp header */ + char ti_o[TCP_MAXOLEN]; /* space for tcp options */ +}; +#endif /* notyet */ +#define ti_x1 ti_i.ih_x1 +#define ti_pr ti_i.ih_pr +#define ti_len ti_i.ih_len +#define ti_src ti_i.ih_src +#define ti_dst ti_i.ih_dst +#define ti_sport ti_t.th_sport +#define ti_dport ti_t.th_dport +#define ti_seq ti_t.th_seq +#define ti_ack ti_t.th_ack +#define ti_x2 ti_t.th_x2 +#define ti_off ti_t.th_off +#define ti_flags ti_t.th_flags +#define ti_win ti_t.th_win +#define ti_sum ti_t.th_sum +#define ti_urp ti_t.th_urp + +#endif diff --git a/i386/include/netinet/.svn/text-base/udp.h.svn-base b/i386/include/netinet/.svn/text-base/udp.h.svn-base new file mode 100644 index 0000000..ef82a6f --- /dev/null +++ b/i386/include/netinet/.svn/text-base/udp.h.svn-base @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)udp.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_UDP_H_ +#define _NETINET_UDP_H_ +#include <sys/appleapiopts.h> +#include <sys/types.h> /* u_short */ + +/* + * Udp protocol header. + * Per RFC 768, September, 1981. + */ +struct udphdr { + u_short uh_sport; /* source port */ + u_short uh_dport; /* destination port */ + u_short uh_ulen; /* udp length */ + u_short uh_sum; /* udp checksum */ +}; + +/* + * User-settable options (used with setsockopt). + */ +#define UDP_NOCKSUM 0x01 /* don't checksum outbound payloads */ +#endif diff --git a/i386/include/netinet/.svn/text-base/udp_var.h.svn-base b/i386/include/netinet/.svn/text-base/udp_var.h.svn-base new file mode 100644 index 0000000..5b6defa --- /dev/null +++ b/i386/include/netinet/.svn/text-base/udp_var.h.svn-base @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_UDP_VAR_H_ +#define _NETINET_UDP_VAR_H_ +#include <sys/appleapiopts.h> + +#include <sys/sysctl.h> + +/* + * UDP kernel structures and variables. + */ +struct udpiphdr { + struct ipovly ui_i; /* overlaid ip structure */ + struct udphdr ui_u; /* udp header */ +}; +#define ui_x1 ui_i.ih_x1 +#define ui_pr ui_i.ih_pr +#define ui_len ui_i.ih_len +#define ui_src ui_i.ih_src +#define ui_dst ui_i.ih_dst +#define ui_sport ui_u.uh_sport +#define ui_dport ui_u.uh_dport +#define ui_ulen ui_u.uh_ulen +#define ui_sum ui_u.uh_sum +#define ui_next ui_i.ih_next +#define ui_prev ui_i.ih_prev + +struct udpstat { + /* input statistics: */ + u_int32_t udps_ipackets; /* total input packets */ + u_int32_t udps_hdrops; /* packet shorter than header */ + u_int32_t udps_badsum; /* checksum error */ + u_int32_t udps_badlen; /* data length larger than packet */ + u_int32_t udps_noport; /* no socket on port */ + u_int32_t udps_noportbcast; /* of above, arrived as broadcast */ + u_int32_t udps_fullsock; /* not delivered, input socket full */ + u_int32_t udpps_pcbcachemiss; /* input packets missing pcb cache */ + u_int32_t udpps_pcbhashmiss; /* input packets not for hashed pcb */ + /* output statistics: */ + u_int32_t udps_opackets; /* total output packets */ + u_int32_t udps_fastout; /* output packets on fast path */ +#ifndef __APPLE__ + u_int32_t udps_nosum; /* no checksum */ + /* of no socket on port, arrived as multicast */ + u_int32_t udps_noportmcast; +#endif +}; + +/* + * Names for UDP sysctl objects + */ +#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ +#define UDPCTL_STATS 2 /* statistics (read-only) */ +#define UDPCTL_MAXDGRAM 3 /* max datagram size */ +#define UDPCTL_RECVSPACE 4 /* default receive buffer space */ +#define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ +#define UDPCTL_MAXID 6 + +#endif /* _NETINET_UDP_VAR_H_ */ diff --git a/i386/include/netinet/bootp.h b/i386/include/netinet/bootp.h new file mode 100644 index 0000000..27f2581 --- /dev/null +++ b/i386/include/netinet/bootp.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Bootstrap Protocol (BOOTP). RFC 951. + */ +/* + * HISTORY + * + * 14 May 1992 ? at NeXT + * Added correct padding to struct nextvend. This is + * needed for the i386 due to alignment differences wrt + * the m68k. Also adjusted the size of the array fields + * because the NeXT vendor area was overflowing the bootp + * packet. + */ + +#include <netinet/udp.h> + +#define iaddr_t struct in_addr + +struct bootp { + u_char bp_op; /* packet opcode type */ +#define BOOTREQUEST 1 +#define BOOTREPLY 2 + u_char bp_htype; /* hardware addr type */ + u_char bp_hlen; /* hardware addr length */ + u_char bp_hops; /* gateway hops */ + u_int32_t bp_xid; /* transaction ID */ + u_short bp_secs; /* seconds since boot began */ + u_short bp_unused; + iaddr_t bp_ciaddr; /* client IP address */ + iaddr_t bp_yiaddr; /* 'your' IP address */ + iaddr_t bp_siaddr; /* server IP address */ + iaddr_t bp_giaddr; /* gateway IP address */ + u_char bp_chaddr[16]; /* client hardware address */ + u_char bp_sname[64]; /* server host name */ + u_char bp_file[128]; /* boot file name */ + u_char bp_vend[64]; /* vendor-specific area */ +}; + +/* + * UDP port numbers, server and client. + */ +#define IPPORT_BOOTPS 67 +#define IPPORT_BOOTPC 68 + +/* + * "vendor" data permitted for Stanford boot clients. + */ +struct vend { + u_char v_magic[4]; /* magic number */ + u_int32_t v_flags; /* flags/opcodes, etc. */ + u_char v_unused[56]; /* currently unused */ +}; +#define VM_STANFORD "STAN" /* v_magic for Stanford */ + +/* v_flags values */ +#define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */ +#define VF_HELP 2 /* help me, I'm not registered */ + +#define NVMAXTEXT 55 /* don't change this, it just fits RFC951 */ +struct nextvend { + u_char nv_magic[4]; /* Magic number for vendor specificity */ + u_char nv_version; /* NeXT protocol version */ + /* + * Round the beginning + * of the union to a 16 + * bit boundary due to + * struct/union alignment + * on the m68k. + */ + unsigned short :0; + union { + u_char NV0[58]; + struct { + u_char NV1_opcode; /* opcode - Version 1 */ + u_char NV1_xid; /* transcation id */ + u_char NV1_text[NVMAXTEXT]; /* text */ + u_char NV1_null; /* null terminator */ + } NV1; + } nv_U; +}; +#define nv_unused nv_U.NV0 +#define nv_opcode nv_U.NV1.NV1_opcode +#define nv_xid nv_U.NV1.NV1_xid +#define nv_text nv_U.NV1.NV1_text +#define nv_null nv_U.NV1.NV1_null + +/* Magic number */ +#define VM_NEXT "NeXT" /* v_magic for NeXT, Inc. */ + +/* Opcodes */ +#define BPOP_OK 0 +#define BPOP_QUERY 1 +#define BPOP_QUERY_NE 2 +#define BPOP_ERROR 3 + +struct bootp_packet { + struct ip bp_ip; + struct udphdr bp_udp; + struct bootp bp_bootp; +}; + +#define BOOTP_PKTSIZE (sizeof (struct bootp_packet)) + +/* backoffs must be masks */ +#define BOOTP_MIN_BACKOFF 0x7ff /* 2.048 sec */ +#define BOOTP_MAX_BACKOFF 0xffff /* 65.535 sec */ +#define BOOTP_RETRY 6 /* # retries */ + diff --git a/i386/include/netinet/icmp6.h b/i386/include/netinet/icmp6.h new file mode 100644 index 0000000..b8fbb81 --- /dev/null +++ b/i386/include/netinet/icmp6.h @@ -0,0 +1,620 @@ +/* + * Copyright (c) 2000,2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* $KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_ICMP6_H_ +#define _NETINET_ICMP6_H_ +#include <sys/appleapiopts.h> + +#define ICMPV6_PLD_MAXLEN 1232 /* IPV6_MMTU - sizeof(struct ip6_hdr) + - sizeof(struct icmp6_hdr) */ + +struct icmp6_hdr { + u_int8_t icmp6_type; /* type field */ + u_int8_t icmp6_code; /* code field */ + u_int16_t icmp6_cksum; /* checksum field */ + union { + u_int32_t icmp6_un_data32[1]; /* type-specific field */ + u_int16_t icmp6_un_data16[2]; /* type-specific field */ + u_int8_t icmp6_un_data8[4]; /* type-specific field */ + } icmp6_dataun; +}; + +#define icmp6_data32 icmp6_dataun.icmp6_un_data32 +#define icmp6_data16 icmp6_dataun.icmp6_un_data16 +#define icmp6_data8 icmp6_dataun.icmp6_un_data8 +#define icmp6_pptr icmp6_data32[0] /* parameter prob */ +#define icmp6_mtu icmp6_data32[0] /* packet too big */ +#define icmp6_id icmp6_data16[0] /* echo request/reply */ +#define icmp6_seq icmp6_data16[1] /* echo request/reply */ +#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */ + +#define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */ +#define ICMP6_PACKET_TOO_BIG 2 /* packet too big */ +#define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */ +#define ICMP6_PARAM_PROB 4 /* ip6 header bad */ + +#define ICMP6_ECHO_REQUEST 128 /* echo service */ +#define ICMP6_ECHO_REPLY 129 /* echo reply */ +#define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */ +#define MLD6_LISTENER_QUERY 130 /* multicast listener query */ +#define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */ +#define MLD6_LISTENER_REPORT 131 /* multicast listener report */ +#define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */ +#define MLD6_LISTENER_DONE 132 /* multicast listener done */ + +#define MLD_LISTENER_QUERY MLD6_LISTENER_QUERY +#define MLD_LISTENER_REPORT MLD6_LISTENER_REPORT +#define MLD_LISTENER_DONE MLD6_LISTENER_DONE + +#define ND_ROUTER_SOLICIT 133 /* router solicitation */ +#define ND_ROUTER_ADVERT 134 /* router advertisment */ +#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */ +#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisment */ +#define ND_REDIRECT 137 /* redirect */ + +#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */ + +#define ICMP6_WRUREQUEST 139 /* who are you request */ +#define ICMP6_WRUREPLY 140 /* who are you reply */ +#define ICMP6_FQDN_QUERY 139 /* FQDN query */ +#define ICMP6_FQDN_REPLY 140 /* FQDN reply */ +#define ICMP6_NI_QUERY 139 /* node information request */ +#define ICMP6_NI_REPLY 140 /* node information reply */ + +/* The definitions below are experimental. TBA */ +#define MLD6_MTRACE_RESP 200 /* mtrace response(to sender) */ +#define MLD6_MTRACE 201 /* mtrace messages */ + +#define MLD_MTRACE_RESP MLD6_MTRACE_RESP +#define MLD_MTRACE MLD6_MTRACE + +#define ICMP6_HADISCOV_REQUEST 202 /* XXX To be defined */ +#define ICMP6_HADISCOV_REPLY 203 /* XXX To be defined */ + +#define ICMP6_MAXTYPE 203 + +#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */ +#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */ +#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */ +#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */ +#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */ +#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */ + +#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */ +#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */ + +#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */ +#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */ +#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */ + +#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */ + +#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */ +#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */ +#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */ + +#define ICMP6_NI_SUCCESS 0 /* node information successful reply */ +#define ICMP6_NI_REFUSED 1 /* node information request is refused */ +#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */ + +#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */ +#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */ +#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */ + +/* Used in kernel only */ +#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */ +#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */ + +/* + * Multicast Listener Discovery + */ +struct mld6_hdr { + struct icmp6_hdr mld6_hdr; + struct in6_addr mld6_addr; /* multicast address */ +}; + +#define mld6_type mld6_hdr.icmp6_type +#define mld6_code mld6_hdr.icmp6_code +#define mld6_cksum mld6_hdr.icmp6_cksum +#define mld6_maxdelay mld6_hdr.icmp6_data16[0] +#define mld6_reserved mld6_hdr.icmp6_data16[1] + +/* + * Neighbor Discovery + */ + +struct nd_router_solicit { /* router solicitation */ + struct icmp6_hdr nd_rs_hdr; + /* could be followed by options */ +}; + +#define nd_rs_type nd_rs_hdr.icmp6_type +#define nd_rs_code nd_rs_hdr.icmp6_code +#define nd_rs_cksum nd_rs_hdr.icmp6_cksum +#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0] + +struct nd_router_advert { /* router advertisement */ + struct icmp6_hdr nd_ra_hdr; + u_int32_t nd_ra_reachable; /* reachable time */ + u_int32_t nd_ra_retransmit; /* retransmit timer */ + /* could be followed by options */ +}; + +#define nd_ra_type nd_ra_hdr.icmp6_type +#define nd_ra_code nd_ra_hdr.icmp6_code +#define nd_ra_cksum nd_ra_hdr.icmp6_cksum +#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] +#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] +#define ND_RA_FLAG_MANAGED 0x80 +#define ND_RA_FLAG_OTHER 0x40 +#define ND_RA_FLAG_HA 0x20 + +/* + * Router preference values based on draft-draves-ipngwg-router-selection-01. + * These are non-standard definitions. + */ +#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */ + +#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */ +#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */ +#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */ +#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */ + +#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] + +struct nd_neighbor_solicit { /* neighbor solicitation */ + struct icmp6_hdr nd_ns_hdr; + struct in6_addr nd_ns_target; /*target address */ + /* could be followed by options */ +}; + +#define nd_ns_type nd_ns_hdr.icmp6_type +#define nd_ns_code nd_ns_hdr.icmp6_code +#define nd_ns_cksum nd_ns_hdr.icmp6_cksum +#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0] + +struct nd_neighbor_advert { /* neighbor advertisement */ + struct icmp6_hdr nd_na_hdr; + struct in6_addr nd_na_target; /* target address */ + /* could be followed by options */ +}; + +#define nd_na_type nd_na_hdr.icmp6_type +#define nd_na_code nd_na_hdr.icmp6_code +#define nd_na_cksum nd_na_hdr.icmp6_cksum +#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] +#if BYTE_ORDER == BIG_ENDIAN +#define ND_NA_FLAG_ROUTER 0x80000000 +#define ND_NA_FLAG_SOLICITED 0x40000000 +#define ND_NA_FLAG_OVERRIDE 0x20000000 +#else +#if BYTE_ORDER == LITTLE_ENDIAN +#define ND_NA_FLAG_ROUTER 0x80 +#define ND_NA_FLAG_SOLICITED 0x40 +#define ND_NA_FLAG_OVERRIDE 0x20 +#endif +#endif + +struct nd_redirect { /* redirect */ + struct icmp6_hdr nd_rd_hdr; + struct in6_addr nd_rd_target; /* target address */ + struct in6_addr nd_rd_dst; /* destination address */ + /* could be followed by options */ +}; + +#define nd_rd_type nd_rd_hdr.icmp6_type +#define nd_rd_code nd_rd_hdr.icmp6_code +#define nd_rd_cksum nd_rd_hdr.icmp6_cksum +#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0] + +struct nd_opt_hdr { /* Neighbor discovery option header */ + u_int8_t nd_opt_type; + u_int8_t nd_opt_len; + /* followed by option specific data*/ +}; + +#define ND_OPT_SOURCE_LINKADDR 1 +#define ND_OPT_TARGET_LINKADDR 2 +#define ND_OPT_PREFIX_INFORMATION 3 +#define ND_OPT_REDIRECTED_HEADER 4 +#define ND_OPT_MTU 5 + +#define ND_OPT_ROUTE_INFO 200 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */ + +struct nd_opt_prefix_info { /* prefix information */ + u_int8_t nd_opt_pi_type; + u_int8_t nd_opt_pi_len; + u_int8_t nd_opt_pi_prefix_len; + u_int8_t nd_opt_pi_flags_reserved; + u_int32_t nd_opt_pi_valid_time; + u_int32_t nd_opt_pi_preferred_time; + u_int32_t nd_opt_pi_reserved2; + struct in6_addr nd_opt_pi_prefix; +}; + +#define ND_OPT_PI_FLAG_ONLINK 0x80 +#define ND_OPT_PI_FLAG_AUTO 0x40 + +struct nd_opt_rd_hdr { /* redirected header */ + u_int8_t nd_opt_rh_type; + u_int8_t nd_opt_rh_len; + u_int16_t nd_opt_rh_reserved1; + u_int32_t nd_opt_rh_reserved2; + /* followed by IP header and data */ +}; + +struct nd_opt_mtu { /* MTU option */ + u_int8_t nd_opt_mtu_type; + u_int8_t nd_opt_mtu_len; + u_int16_t nd_opt_mtu_reserved; + u_int32_t nd_opt_mtu_mtu; +}; + +struct nd_opt_route_info { /* route info */ + u_int8_t nd_opt_rti_type; + u_int8_t nd_opt_rti_len; + u_int8_t nd_opt_rti_prefixlen; + u_int8_t nd_opt_rti_flags; + u_int32_t nd_opt_rti_lifetime; + /* followed by prefix */ +}; + +/* + * icmp6 namelookup + */ + +struct icmp6_namelookup { + struct icmp6_hdr icmp6_nl_hdr; + u_int8_t icmp6_nl_nonce[8]; + int32_t icmp6_nl_ttl; +#if 0 + u_int8_t icmp6_nl_len; + u_int8_t icmp6_nl_name[3]; +#endif + /* could be followed by options */ +}; + +/* + * icmp6 node information + */ +struct icmp6_nodeinfo { + struct icmp6_hdr icmp6_ni_hdr; + u_int8_t icmp6_ni_nonce[8]; + /* could be followed by reply data */ +}; + +#define ni_type icmp6_ni_hdr.icmp6_type +#define ni_code icmp6_ni_hdr.icmp6_code +#define ni_cksum icmp6_ni_hdr.icmp6_cksum +#define ni_qtype icmp6_ni_hdr.icmp6_data16[0] +#define ni_flags icmp6_ni_hdr.icmp6_data16[1] + +#define NI_QTYPE_NOOP 0 /* NOOP */ +#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */ +#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */ +#define NI_QTYPE_DNSNAME 2 /* DNS Name */ +#define NI_QTYPE_NODEADDR 3 /* Node Addresses */ +#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */ + +#if BYTE_ORDER == BIG_ENDIAN +#define NI_SUPTYPE_FLAG_COMPRESS 0x1 +#define NI_FQDN_FLAG_VALIDTTL 0x1 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define NI_SUPTYPE_FLAG_COMPRESS 0x0100 +#define NI_FQDN_FLAG_VALIDTTL 0x0100 +#endif + +#ifdef NAME_LOOKUPS_04 +#if BYTE_ORDER == BIG_ENDIAN +#define NI_NODEADDR_FLAG_LINKLOCAL 0x1 +#define NI_NODEADDR_FLAG_SITELOCAL 0x2 +#define NI_NODEADDR_FLAG_GLOBAL 0x4 +#define NI_NODEADDR_FLAG_ALL 0x8 +#define NI_NODEADDR_FLAG_TRUNCATE 0x10 +#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */ +#elif BYTE_ORDER == LITTLE_ENDIAN +#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100 +#define NI_NODEADDR_FLAG_SITELOCAL 0x0200 +#define NI_NODEADDR_FLAG_GLOBAL 0x0400 +#define NI_NODEADDR_FLAG_ALL 0x0800 +#define NI_NODEADDR_FLAG_TRUNCATE 0x1000 +#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */ +#endif +#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */ +#if BYTE_ORDER == BIG_ENDIAN +#define NI_NODEADDR_FLAG_TRUNCATE 0x1 +#define NI_NODEADDR_FLAG_ALL 0x2 +#define NI_NODEADDR_FLAG_COMPAT 0x4 +#define NI_NODEADDR_FLAG_LINKLOCAL 0x8 +#define NI_NODEADDR_FLAG_SITELOCAL 0x10 +#define NI_NODEADDR_FLAG_GLOBAL 0x20 +#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */ +#elif BYTE_ORDER == LITTLE_ENDIAN +#define NI_NODEADDR_FLAG_TRUNCATE 0x0100 +#define NI_NODEADDR_FLAG_ALL 0x0200 +#define NI_NODEADDR_FLAG_COMPAT 0x0400 +#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800 +#define NI_NODEADDR_FLAG_SITELOCAL 0x1000 +#define NI_NODEADDR_FLAG_GLOBAL 0x2000 +#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */ +#endif +#endif + +struct ni_reply_fqdn { + u_int32_t ni_fqdn_ttl; /* TTL */ + u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */ + u_int8_t ni_fqdn_name[3]; /* XXX: alignment */ +}; + +/* + * Router Renumbering. as router-renum-08.txt + */ +struct icmp6_router_renum { /* router renumbering header */ + struct icmp6_hdr rr_hdr; + u_int8_t rr_segnum; + u_int8_t rr_flags; + u_int16_t rr_maxdelay; + u_int32_t rr_reserved; +}; + +#define ICMP6_RR_FLAGS_TEST 0x80 +#define ICMP6_RR_FLAGS_REQRESULT 0x40 +#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20 +#define ICMP6_RR_FLAGS_SPECSITE 0x10 +#define ICMP6_RR_FLAGS_PREVDONE 0x08 + +#define rr_type rr_hdr.icmp6_type +#define rr_code rr_hdr.icmp6_code +#define rr_cksum rr_hdr.icmp6_cksum +#define rr_seqnum rr_hdr.icmp6_data32[0] + +struct rr_pco_match { /* match prefix part */ + u_int8_t rpm_code; + u_int8_t rpm_len; + u_int8_t rpm_ordinal; + u_int8_t rpm_matchlen; + u_int8_t rpm_minlen; + u_int8_t rpm_maxlen; + u_int16_t rpm_reserved; + struct in6_addr rpm_prefix; +}; + +#define RPM_PCO_ADD 1 +#define RPM_PCO_CHANGE 2 +#define RPM_PCO_SETGLOBAL 3 +#define RPM_PCO_MAX 4 + +struct rr_pco_use { /* use prefix part */ + u_int8_t rpu_uselen; + u_int8_t rpu_keeplen; + u_int8_t rpu_ramask; + u_int8_t rpu_raflags; + u_int32_t rpu_vltime; + u_int32_t rpu_pltime; + u_int32_t rpu_flags; + struct in6_addr rpu_prefix; +}; +#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80 +#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40 + +#if BYTE_ORDER == BIG_ENDIAN +#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000 +#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80 +#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40 +#endif + +struct rr_result { /* router renumbering result message */ + u_int16_t rrr_flags; + u_int8_t rrr_ordinal; + u_int8_t rrr_matchedlen; + u_int32_t rrr_ifid; + struct in6_addr rrr_prefix; +}; +#if BYTE_ORDER == BIG_ENDIAN +#define ICMP6_RR_RESULT_FLAGS_OOB 0x0002 +#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200 +#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100 +#endif + +/* + * icmp6 filter structures. + */ + +struct icmp6_filter { + u_int32_t icmp6_filt[8]; +}; + +#define ICMP6_FILTER_SETPASSALL(filterp) \ + memset(filterp, 0xff, sizeof(struct icmp6_filter)) +#define ICMP6_FILTER_SETBLOCKALL(filterp) \ + memset(filterp, 0x00, sizeof(struct icmp6_filter)) + +#define ICMP6_FILTER_SETPASS(type, filterp) \ + (((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))) +#define ICMP6_FILTER_SETBLOCK(type, filterp) \ + (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))) +#define ICMP6_FILTER_WILLPASS(type, filterp) \ + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0) +#define ICMP6_FILTER_WILLBLOCK(type, filterp) \ + ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0) + +/* + * Variables related to this implementation + * of the internet control message protocol version 6. + */ +struct icmp6errstat { + u_quad_t icp6errs_dst_unreach_noroute; + u_quad_t icp6errs_dst_unreach_admin; + u_quad_t icp6errs_dst_unreach_beyondscope; + u_quad_t icp6errs_dst_unreach_addr; + u_quad_t icp6errs_dst_unreach_noport; + u_quad_t icp6errs_packet_too_big; + u_quad_t icp6errs_time_exceed_transit; + u_quad_t icp6errs_time_exceed_reassembly; + u_quad_t icp6errs_paramprob_header; + u_quad_t icp6errs_paramprob_nextheader; + u_quad_t icp6errs_paramprob_option; + u_quad_t icp6errs_redirect; /* we regard redirect as an error here */ + u_quad_t icp6errs_unknown; +}; + +struct icmp6stat { +/* statistics related to icmp6 packets generated */ + u_quad_t icp6s_error; /* # of calls to icmp6_error */ + u_quad_t icp6s_canterror; /* no error 'cuz old was icmp */ + u_quad_t icp6s_toofreq; /* no error 'cuz rate limitation */ + u_quad_t icp6s_outhist[256]; +/* statistics related to input message processed */ + u_quad_t icp6s_badcode; /* icmp6_code out of range */ + u_quad_t icp6s_tooshort; /* packet < sizeof(struct icmp6_hdr) */ + u_quad_t icp6s_checksum; /* bad checksum */ + u_quad_t icp6s_badlen; /* calculated bound mismatch */ + u_quad_t icp6s_reflect; /* number of responses */ + u_quad_t icp6s_inhist[256]; + u_quad_t icp6s_nd_toomanyopt; /* too many ND options */ + struct icmp6errstat icp6s_outerrhist; +#define icp6s_odst_unreach_noroute \ + icp6s_outerrhist.icp6errs_dst_unreach_noroute +#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin +#define icp6s_odst_unreach_beyondscope \ + icp6s_outerrhist.icp6errs_dst_unreach_beyondscope +#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr +#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport +#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big +#define icp6s_otime_exceed_transit \ + icp6s_outerrhist.icp6errs_time_exceed_transit +#define icp6s_otime_exceed_reassembly \ + icp6s_outerrhist.icp6errs_time_exceed_reassembly +#define icp6s_oparamprob_header icp6s_outerrhist.icp6errs_paramprob_header +#define icp6s_oparamprob_nextheader \ + icp6s_outerrhist.icp6errs_paramprob_nextheader +#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option +#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect +#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown + u_quad_t icp6s_pmtuchg; /* path MTU changes */ + u_quad_t icp6s_nd_badopt; /* bad ND options */ + u_quad_t icp6s_badns; /* bad neighbor solicitation */ + u_quad_t icp6s_badna; /* bad neighbor advertisement */ + u_quad_t icp6s_badrs; /* bad router advertisement */ + u_quad_t icp6s_badra; /* bad router advertisement */ + u_quad_t icp6s_badredirect; /* bad redirect message */ +}; + +/* + * Names for ICMP sysctl objects + */ +#define ICMPV6CTL_STATS 1 +#define ICMPV6CTL_REDIRACCEPT 2 /* accept/process redirects */ +#define ICMPV6CTL_REDIRTIMEOUT 3 /* redirect cache time */ +#define ICMPV6CTL_ND6_PRUNE 6 +#define ICMPV6CTL_ND6_DELAY 8 +#define ICMPV6CTL_ND6_UMAXTRIES 9 +#define ICMPV6CTL_ND6_MMAXTRIES 10 +#define ICMPV6CTL_ND6_USELOOPBACK 11 +/*#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here */ +#define ICMPV6CTL_NODEINFO 13 +#define ICMPV6CTL_ERRPPSLIMIT 14 /* ICMPv6 error pps limitation */ +#define ICMPV6CTL_ND6_MAXNUDHINT 15 +#define ICMPV6CTL_MTUDISC_HIWAT 16 +#define ICMPV6CTL_MTUDISC_LOWAT 17 +#define ICMPV6CTL_ND6_DEBUG 18 +#define ICMPV6CTL_ND6_DRLIST 19 +#define ICMPV6CTL_ND6_PRLIST 20 +#define ICMPV6CTL_MAXID 21 + + +#endif /* !_NETINET_ICMP6_H_ */ diff --git a/i386/include/netinet/icmp_var.h b/i386/include/netinet/icmp_var.h new file mode 100644 index 0000000..ee482c1 --- /dev/null +++ b/i386/include/netinet/icmp_var.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)icmp_var.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/icmp_var.h,v 1.15.2.1 2001/02/24 21:35:18 bmilekic Exp $ + */ + +#ifndef _NETINET_ICMP_VAR_H_ +#define _NETINET_ICMP_VAR_H_ +#include <sys/appleapiopts.h> + +/* + * Variables related to this implementation + * of the internet control message protocol. + */ +struct icmpstat { +/* statistics related to icmp packets generated */ + u_int32_t icps_error; /* # of calls to icmp_error */ + u_int32_t icps_oldshort; /* no error 'cuz old ip too short */ + u_int32_t icps_oldicmp; /* no error 'cuz old was icmp */ + u_int32_t icps_outhist[ICMP_MAXTYPE + 1]; +/* statistics related to input messages processed */ + u_int32_t icps_badcode; /* icmp_code out of range */ + u_int32_t icps_tooshort; /* packet < ICMP_MINLEN */ + u_int32_t icps_checksum; /* bad checksum */ + u_int32_t icps_badlen; /* calculated bound mismatch */ + u_int32_t icps_reflect; /* number of responses */ + u_int32_t icps_inhist[ICMP_MAXTYPE + 1]; + u_int32_t icps_bmcastecho;/* b/mcast echo requests dropped */ + u_int32_t icps_bmcasttstamp; /* b/mcast tstamp requests dropped */ +}; + +/* + * Names for ICMP sysctl objects + */ +#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */ +#define ICMPCTL_STATS 2 /* statistics (read-only) */ +#define ICMPCTL_ICMPLIM 3 +#define ICMPCTL_TIMESTAMP 4 /* allow replies to time stamp requests */ +#define ICMPCTL_MAXID 5 + +#endif /* _NETINET_ICMP_VAR_H_ */ diff --git a/i386/include/netinet/if_ether.h b/i386/include/netinet/if_ether.h new file mode 100644 index 0000000..06e5b34 --- /dev/null +++ b/i386/include/netinet/if_ether.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)if_ether.h 8.3 (Berkeley) 5/2/95 + * $FreeBSD: src/sys/netinet/if_ether.h,v 1.24 1999/12/29 04:40:58 peter Exp $ + */ + +#ifndef _NETINET_IF_ETHER_H_ +#define _NETINET_IF_ETHER_H_ +#include <sys/appleapiopts.h> + +#include <net/ethernet.h> + +#include <netinet/in.h> +#include <net/if_arp.h> +#define ea_byte ether_addr_octet + +/* + * Macro to map an IP multicast address to an Ethernet multicast address. + * The high-order 25 bits of the Ethernet address are statically assigned, + * and the low-order 23 bits are taken from the low end of the IP address. + */ +#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \ + /* struct in_addr *ipaddr; */ \ + /* u_char enaddr[ETHER_ADDR_LEN]; */ \ +{ \ + (enaddr)[0] = 0x01; \ + (enaddr)[1] = 0x00; \ + (enaddr)[2] = 0x5e; \ + (enaddr)[3] = ((const u_char *)ipaddr)[1] & 0x7f; \ + (enaddr)[4] = ((const u_char *)ipaddr)[2]; \ + (enaddr)[5] = ((const u_char *)ipaddr)[3]; \ +} +/* + * Macro to map an IP6 multicast address to an Ethernet multicast address. + * The high-order 16 bits of the Ethernet address are statically assigned, + * and the low-order 32 bits are taken from the low end of the IP6 address. + */ +#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \ +/* struct in6_addr *ip6addr; */ \ +/* u_char enaddr[ETHER_ADDR_LEN]; */ \ +{ \ + (enaddr)[0] = 0x33; \ + (enaddr)[1] = 0x33; \ + (enaddr)[2] = ((const u_char *)ip6addr)[12]; \ + (enaddr)[3] = ((const u_char *)ip6addr)[13]; \ + (enaddr)[4] = ((const u_char *)ip6addr)[14]; \ + (enaddr)[5] = ((const u_char *)ip6addr)[15]; \ +} + +/* + * Ethernet Address Resolution Protocol. + * + * See RFC 826 for protocol description. Structure below is adapted + * to resolving internet addresses. Field names used correspond to + * RFC 826. + */ +struct ether_arp { + struct arphdr ea_hdr; /* fixed-size header */ + u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */ + u_char arp_spa[4]; /* sender protocol address */ + u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */ + u_char arp_tpa[4]; /* target protocol address */ +}; +#define arp_hrd ea_hdr.ar_hrd +#define arp_pro ea_hdr.ar_pro +#define arp_hln ea_hdr.ar_hln +#define arp_pln ea_hdr.ar_pln +#define arp_op ea_hdr.ar_op + +struct sockaddr_inarp { + u_char sin_len; + u_char sin_family; + u_short sin_port; + struct in_addr sin_addr; + struct in_addr sin_srcaddr; + u_short sin_tos; + u_short sin_other; +#define SIN_PROXY 1 +}; +/* + * IP and ethernet specific routing flags + */ +#define RTF_USETRAILERS RTF_PROTO1 /* use trailers */ +#define RTF_ANNOUNCE RTF_PROTO2 /* announce new arp entry */ + + +#endif /* _NETINET_IF_ETHER_H_ */ diff --git a/i386/include/netinet/igmp.h b/i386/include/netinet/igmp.h new file mode 100644 index 0000000..3774cd8 --- /dev/null +++ b/i386/include/netinet/igmp.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)igmp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/igmp.h,v 1.10 1999/08/28 00:49:15 peter Exp $ + */ + +#ifndef _NETINET_IGMP_H_ +#define _NETINET_IGMP_H_ +#include <sys/appleapiopts.h> + +/* + * Internet Group Management Protocol (IGMP) definitions. + * + * Written by Steve Deering, Stanford, May 1988. + * + * MULTICAST Revision: 3.5.1.2 + */ + +/* + * IGMP packet format. + */ +struct igmp { + u_char igmp_type; /* version & type of IGMP message */ + u_char igmp_code; /* subtype for routing msgs */ + u_short igmp_cksum; /* IP-style checksum */ + struct in_addr igmp_group; /* group address being reported */ +}; /* (zero for queries) */ + +#define IGMP_MINLEN 8 + +/* + * Message types, including version number. + */ +#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */ +#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */ +#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */ +#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */ + +#define IGMP_DVMRP 0x13 /* DVMRP routing message */ +#define IGMP_PIM 0x14 /* PIM routing message */ + +#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/ +#define IGMP_MTRACE 0x1f /* mcast traceroute messages */ + +#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */ + /* query (in seconds) according */ + /* to RFC1112 */ + + +#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */ + /* specifies time in 10th of seconds*/ + +/* + * The following four defininitions are for backwards compatibility. + * They should be removed as soon as all applications are updated to + * use the new constant names. + */ +#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY +#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT +#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT +#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP + +#endif /* _NETINET_IGMP_H_ */ diff --git a/i386/include/netinet/igmp_var.h b/i386/include/netinet/igmp_var.h new file mode 100644 index 0000000..984ccd0 --- /dev/null +++ b/i386/include/netinet/igmp_var.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1988 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)igmp_var.h 8.1 (Berkeley) 7/19/93 + */ + +#ifndef _NETINET_IGMP_VAR_H_ +#define _NETINET_IGMP_VAR_H_ +#include <sys/appleapiopts.h> + + +/* + * Internet Group Management Protocol (IGMP), + * implementation-specific definitions. + * + * Written by Steve Deering, Stanford, May 1988. + * + * MULTICAST Revision: 3.5.1.3 + */ + +struct igmpstat { + u_int igps_rcv_total; /* total IGMP messages received */ + u_int igps_rcv_tooshort; /* received with too few bytes */ + u_int igps_rcv_badsum; /* received with bad checksum */ + u_int igps_rcv_queries; /* received membership queries */ + u_int igps_rcv_badqueries; /* received invalid queries */ + u_int igps_rcv_reports; /* received membership reports */ + u_int igps_rcv_badreports; /* received invalid reports */ + u_int igps_rcv_ourreports; /* received reports for our groups */ + u_int igps_snd_reports; /* sent membership reports */ +}; + + +/* + * Names for IGMP sysctl objects + */ +#define IGMPCTL_STATS 1 /* statistics (read-only) */ +#define IGMPCTL_MAXID 2 + +#endif diff --git a/i386/include/netinet/in.h b/i386/include/netinet/in.h new file mode 100644 index 0000000..b4e807f --- /dev/null +++ b/i386/include/netinet/in.h @@ -0,0 +1,524 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in.h 8.3 (Berkeley) 1/3/94 + * $FreeBSD: src/sys/netinet/in.h,v 1.48.2.2 2001/04/21 14:53:06 ume Exp $ + */ + +#ifndef _NETINET_IN_H_ +#define _NETINET_IN_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> +#include <stdint.h> /* uint(8|16|32)_t */ + +#ifndef _IN_ADDR_T +#define _IN_ADDR_T +typedef __uint32_t in_addr_t; /* base type for internet address */ +#endif + +#ifndef _IN_PORT_T +#define _IN_PORT_T +typedef __uint16_t in_port_t; +#endif + +/* + * POSIX 1003.1-2003 + * "Inclusion of the <netinet/in.h> header may also make visible all + * symbols from <inttypes.h> and <sys/socket.h>". + */ +#include <sys/socket.h> + +/* + * The following two #includes insure htonl and family are defined + */ +#include <machine/endian.h> +#include <sys/_endian.h> + +/* + * Constants and structures defined by the internet system, + * Per RFC 790, September 1981, and numerous additions. + */ + +/* + * Protocols (RFC 1700) + */ +#define IPPROTO_IP 0 /* dummy for IP */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_ICMP 1 /* control message protocol */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_IGMP 2 /* group mgmt protocol */ +#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ +#define IPPROTO_IPV4 4 /* IPv4 encapsulation */ +#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_TCP 6 /* tcp */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_ST 7 /* Stream protocol II */ +#define IPPROTO_EGP 8 /* exterior gateway protocol */ +#define IPPROTO_PIGP 9 /* private interior gateway */ +#define IPPROTO_RCCMON 10 /* BBN RCC Monitoring */ +#define IPPROTO_NVPII 11 /* network voice protocol*/ +#define IPPROTO_PUP 12 /* pup */ +#define IPPROTO_ARGUS 13 /* Argus */ +#define IPPROTO_EMCON 14 /* EMCON */ +#define IPPROTO_XNET 15 /* Cross Net Debugger */ +#define IPPROTO_CHAOS 16 /* Chaos*/ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_UDP 17 /* user datagram protocol */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_MUX 18 /* Multiplexing */ +#define IPPROTO_MEAS 19 /* DCN Measurement Subsystems */ +#define IPPROTO_HMP 20 /* Host Monitoring */ +#define IPPROTO_PRM 21 /* Packet Radio Measurement */ +#define IPPROTO_IDP 22 /* xns idp */ +#define IPPROTO_TRUNK1 23 /* Trunk-1 */ +#define IPPROTO_TRUNK2 24 /* Trunk-2 */ +#define IPPROTO_LEAF1 25 /* Leaf-1 */ +#define IPPROTO_LEAF2 26 /* Leaf-2 */ +#define IPPROTO_RDP 27 /* Reliable Data */ +#define IPPROTO_IRTP 28 /* Reliable Transaction */ +#define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ +#define IPPROTO_BLT 30 /* Bulk Data Transfer */ +#define IPPROTO_NSP 31 /* Network Services */ +#define IPPROTO_INP 32 /* Merit Internodal */ +#define IPPROTO_SEP 33 /* Sequential Exchange */ +#define IPPROTO_3PC 34 /* Third Party Connect */ +#define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ +#define IPPROTO_XTP 36 /* XTP */ +#define IPPROTO_DDP 37 /* Datagram Delivery */ +#define IPPROTO_CMTP 38 /* Control Message Transport */ +#define IPPROTO_TPXX 39 /* TP++ Transport */ +#define IPPROTO_IL 40 /* IL transport protocol */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_IPV6 41 /* IP6 header */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_SDRP 42 /* Source Demand Routing */ +#define IPPROTO_ROUTING 43 /* IP6 routing header */ +#define IPPROTO_FRAGMENT 44 /* IP6 fragmentation header */ +#define IPPROTO_IDRP 45 /* InterDomain Routing*/ +#define IPPROTO_RSVP 46 /* resource reservation */ +#define IPPROTO_GRE 47 /* General Routing Encap. */ +#define IPPROTO_MHRP 48 /* Mobile Host Routing */ +#define IPPROTO_BHA 49 /* BHA */ +#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */ +#define IPPROTO_AH 51 /* IP6 Auth Header */ +#define IPPROTO_INLSP 52 /* Integ. Net Layer Security */ +#define IPPROTO_SWIPE 53 /* IP with encryption */ +#define IPPROTO_NHRP 54 /* Next Hop Resolution */ +/* 55-57: Unassigned */ +#define IPPROTO_ICMPV6 58 /* ICMP6 */ +#define IPPROTO_NONE 59 /* IP6 no next header */ +#define IPPROTO_DSTOPTS 60 /* IP6 destination option */ +#define IPPROTO_AHIP 61 /* any host internal protocol */ +#define IPPROTO_CFTP 62 /* CFTP */ +#define IPPROTO_HELLO 63 /* "hello" routing protocol */ +#define IPPROTO_SATEXPAK 64 /* SATNET/Backroom EXPAK */ +#define IPPROTO_KRYPTOLAN 65 /* Kryptolan */ +#define IPPROTO_RVD 66 /* Remote Virtual Disk */ +#define IPPROTO_IPPC 67 /* Pluribus Packet Core */ +#define IPPROTO_ADFS 68 /* Any distributed FS */ +#define IPPROTO_SATMON 69 /* Satnet Monitoring */ +#define IPPROTO_VISA 70 /* VISA Protocol */ +#define IPPROTO_IPCV 71 /* Packet Core Utility */ +#define IPPROTO_CPNX 72 /* Comp. Prot. Net. Executive */ +#define IPPROTO_CPHB 73 /* Comp. Prot. HeartBeat */ +#define IPPROTO_WSN 74 /* Wang Span Network */ +#define IPPROTO_PVP 75 /* Packet Video Protocol */ +#define IPPROTO_BRSATMON 76 /* BackRoom SATNET Monitoring */ +#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */ +#define IPPROTO_WBMON 78 /* WIDEBAND Monitoring */ +#define IPPROTO_WBEXPAK 79 /* WIDEBAND EXPAK */ +#define IPPROTO_EON 80 /* ISO cnlp */ +#define IPPROTO_VMTP 81 /* VMTP */ +#define IPPROTO_SVMTP 82 /* Secure VMTP */ +#define IPPROTO_VINES 83 /* Banyon VINES */ +#define IPPROTO_TTP 84 /* TTP */ +#define IPPROTO_IGP 85 /* NSFNET-IGP */ +#define IPPROTO_DGP 86 /* dissimilar gateway prot. */ +#define IPPROTO_TCF 87 /* TCF */ +#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */ +#define IPPROTO_OSPFIGP 89 /* OSPFIGP */ +#define IPPROTO_SRPC 90 /* Strite RPC protocol */ +#define IPPROTO_LARP 91 /* Locus Address Resoloution */ +#define IPPROTO_MTP 92 /* Multicast Transport */ +#define IPPROTO_AX25 93 /* AX.25 Frames */ +#define IPPROTO_IPEIP 94 /* IP encapsulated in IP */ +#define IPPROTO_MICP 95 /* Mobile Int.ing control */ +#define IPPROTO_SCCSP 96 /* Semaphore Comm. security */ +#define IPPROTO_ETHERIP 97 /* Ethernet IP encapsulation */ +#define IPPROTO_ENCAP 98 /* encapsulation header */ +#define IPPROTO_APES 99 /* any private encr. scheme */ +#define IPPROTO_GMTP 100 /* GMTP*/ +#define IPPROTO_IPCOMP 108 /* payload compression (IPComp) */ +/* 101-254: Partly Unassigned */ +#define IPPROTO_PIM 103 /* Protocol Independent Mcast */ +#define IPPROTO_PGM 113 /* PGM */ +/* 255: Reserved */ +/* BSD Private, local use, namespace incursion */ +#define IPPROTO_DIVERT 254 /* divert pseudo-protocol */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define IPPROTO_RAW 255 /* raw IP packet */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPPROTO_MAX 256 + +/* last return value of *_input(), meaning "all job for this pkt is done". */ +#define IPPROTO_DONE 257 +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Local port number conventions: + * + * When a user does a bind(2) or connect(2) with a port number of zero, + * a non-conflicting local port address is chosen. + * The default range is IPPORT_RESERVED through + * IPPORT_USERRESERVED, although that is settable by sysctl. + * + * A user may set the IPPROTO_IP option IP_PORTRANGE to change this + * default assignment range. + * + * The value IP_PORTRANGE_DEFAULT causes the default behavior. + * + * The value IP_PORTRANGE_HIGH changes the range of candidate port numbers + * into the "high" range. These are reserved for client outbound connections + * which do not want to be filtered by any firewalls. + * + * The value IP_PORTRANGE_LOW changes the range to the "low" are + * that is (by convention) restricted to privileged processes. This + * convention is based on "vouchsafe" principles only. It is only secure + * if you trust the remote host to restrict these ports. + * + * The default range of ports and the high range can be changed by + * sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto) + * + * Changing those values has bad security implications if you are + * using a a stateless firewall that is allowing packets outside of that + * range in order to allow transparent outgoing connections. + * + * Such a firewall configuration will generally depend on the use of these + * default values. If you change them, you may find your Security + * Administrator looking for you with a heavy object. + * + * For a slightly more orthodox text view on this: + * + * ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers + * + * port numbers are divided into three ranges: + * + * 0 - 1023 Well Known Ports + * 1024 - 49151 Registered Ports + * 49152 - 65535 Dynamic and/or Private Ports + * + */ + +#define __DARWIN_IPPORT_RESERVED 1024 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Ports < IPPORT_RESERVED are reserved for + * privileged processes (e.g. root). (IP_PORTRANGE_LOW) + * Ports > IPPORT_USERRESERVED are reserved + * for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT) + */ +#ifndef IPPORT_RESERVED +#define IPPORT_RESERVED __DARWIN_IPPORT_RESERVED +#endif +#define IPPORT_USERRESERVED 5000 + +/* + * Default local port range to use by setting IP_PORTRANGE_HIGH + */ +#define IPPORT_HIFIRSTAUTO 49152 +#define IPPORT_HILASTAUTO 65535 + +/* + * Scanning for a free reserved port return a value below IPPORT_RESERVED, + * but higher than IPPORT_RESERVEDSTART. Traditionally the start value was + * 512, but that conflicts with some well-known-services that firewalls may + * have a fit if we use. + */ +#define IPPORT_RESERVEDSTART 600 +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Internet address (a structure for historical reasons) + */ +struct in_addr { + in_addr_t s_addr; +}; + +/* + * Definitions of bits in internet address integers. + * On subnets, the decomposition of addresses to host and net parts + * is done according to subnet mask, not the masks here. + */ +#define INADDR_ANY (u_int32_t)0x00000000 +#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) +#define IN_CLASSA_NET 0xff000000 +#define IN_CLASSA_NSHIFT 24 +#define IN_CLASSA_HOST 0x00ffffff +#define IN_CLASSA_MAX 128 + +#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) +#define IN_CLASSB_NET 0xffff0000 +#define IN_CLASSB_NSHIFT 16 +#define IN_CLASSB_HOST 0x0000ffff +#define IN_CLASSB_MAX 65536 + +#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) +#define IN_CLASSC_NET 0xffffff00 +#define IN_CLASSC_NSHIFT 8 +#define IN_CLASSC_HOST 0x000000ff + +#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) +#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ +#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ +#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ +#define IN_MULTICAST(i) IN_CLASSD(i) + +#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) +#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) + +#define INADDR_LOOPBACK (u_int32_t)0x7f000001 +#define INADDR_NONE 0xffffffff /* -1 return */ + +#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ +#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ +#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ +#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ + +#ifdef __APPLE__ +#define IN_LINKLOCALNETNUM (u_int32_t)0xA9FE0000 /* 169.254.0.0 */ +#define IN_LINKLOCAL(i) (((u_int32_t)(i) & IN_CLASSB_NET) == IN_LINKLOCALNETNUM) +#endif + +#define IN_LOOPBACKNET 127 /* official! */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Socket address, internet style. + */ +struct sockaddr_in { + __uint8_t sin_len; + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; + char sin_zero[8]; +}; + +#define INET_ADDRSTRLEN 16 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Structure used to describe IP options. + * Used to store options internally, to pass them to a process, + * or to restore options retrieved earlier. + * The ip_dst is used for the first-hop gateway when using a source route + * (this gets put into the header proper). + */ +struct ip_opts { + struct in_addr ip_dst; /* first hop, 0 w/o src rt */ + char ip_opts[40]; /* actually variable in size */ +}; + +/* + * Options for use with [gs]etsockopt at the IP level. + * First word of comment is data type; bool is stored in int. + */ +#define IP_OPTIONS 1 /* buf/ip_opts; set/get IP options */ +#define IP_HDRINCL 2 /* int; header is included with data */ +#define IP_TOS 3 /* int; IP type of service and preced. */ +#define IP_TTL 4 /* int; IP time to live */ +#define IP_RECVOPTS 5 /* bool; receive all IP opts w/dgram */ +#define IP_RECVRETOPTS 6 /* bool; receive IP opts for response */ +#define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/dgram */ +#define IP_RETOPTS 8 /* ip_opts; set/get IP options */ +#define IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */ +#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */ +#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */ +#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ +#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ +#define IP_MULTICAST_VIF 14 /* set/get IP mcast virt. iface */ +#define IP_RSVP_ON 15 /* enable RSVP in kernel */ +#define IP_RSVP_OFF 16 /* disable RSVP in kernel */ +#define IP_RSVP_VIF_ON 17 /* set RSVP per-vif socket */ +#define IP_RSVP_VIF_OFF 18 /* unset RSVP per-vif socket */ +#define IP_PORTRANGE 19 /* int; range to choose for unspec port */ +#define IP_RECVIF 20 /* bool; receive reception if w/dgram */ +/* for IPSEC */ +#define IP_IPSEC_POLICY 21 /* int; set/get security policy */ +#define IP_FAITH 22 /* bool; accept FAITH'ed connections */ +#ifdef __APPLE__ +#define IP_STRIPHDR 23 /* bool: drop receive of raw IP header */ +#endif +#define IP_RECVTTL 24 /* bool; receive reception TTL w/dgram */ +#define IP_BOUND_IF 25 /* set/get bound interface */ + + +#define IP_FW_ADD 40 /* add a firewall rule to chain */ +#define IP_FW_DEL 41 /* delete a firewall rule from chain */ +#define IP_FW_FLUSH 42 /* flush firewall rule chain */ +#define IP_FW_ZERO 43 /* clear single/all firewall counter(s) */ +#define IP_FW_GET 44 /* get entire firewall rule chain */ +#define IP_FW_RESETLOG 45 /* reset logging counters */ + +/* These older firewall socket option codes are maintained for backward compatibility. */ +#define IP_OLD_FW_ADD 50 /* add a firewall rule to chain */ +#define IP_OLD_FW_DEL 51 /* delete a firewall rule from chain */ +#define IP_OLD_FW_FLUSH 52 /* flush firewall rule chain */ +#define IP_OLD_FW_ZERO 53 /* clear single/all firewall counter(s) */ +#define IP_OLD_FW_GET 54 /* get entire firewall rule chain */ +#define IP_NAT__XXX 55 /* set/get NAT opts XXX Deprecated, do not use */ +#define IP_OLD_FW_RESETLOG 56 /* reset logging counters */ + +#define IP_DUMMYNET_CONFIGURE 60 /* add/configure a dummynet pipe */ +#define IP_DUMMYNET_DEL 61 /* delete a dummynet pipe from chain */ +#define IP_DUMMYNET_FLUSH 62 /* flush dummynet */ +#define IP_DUMMYNET_GET 64 /* get entire dummynet pipes */ + +#define IP_TRAFFIC_MGT_BACKGROUND 65 /* int*; get background IO flags; set background IO */ + + +/* Background socket configuration flags */ +#ifdef __APPLE_API_UNSTABLE +#define TRAFFIC_MGT_SO_BACKGROUND 0x0001 /* background socket */ +#define TRAFFIC_MGT_SO_BG_SUPPRESSED 0x0002 /* currently throttled */ +#define TRAFFIC_MGT_SO_BG_REGULATE 0x0004 /* traffic is regulated */ +#endif /* __APPLE_API_UNSTABLE */ + +/* + * Defaults and limits for options + */ +#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ +#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ +#define IP_MAX_MEMBERSHIPS 20 /* per socket */ + +/* + * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. + */ +struct ip_mreq { + struct in_addr imr_multiaddr; /* IP multicast address of group */ + struct in_addr imr_interface; /* local IP address of interface */ +}; + +/* + * Argument for IP_PORTRANGE: + * - which range to search when port is unspecified at bind() or connect() + */ +#define IP_PORTRANGE_DEFAULT 0 /* default range */ +#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ +#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ + + +/* + * Definitions for inet sysctl operations. + * + * Third level is protocol number. + * Fourth level is desired variable within that protocol. + */ +#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */ + + +/* + * Names for IP sysctl objects + */ +#define IPCTL_FORWARDING 1 /* act as router */ +#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */ +#define IPCTL_DEFTTL 3 /* default TTL */ +#ifdef notyet +#define IPCTL_DEFMTU 4 /* default MTU */ +#endif +#define IPCTL_RTEXPIRE 5 /* cloned route expiration time */ +#define IPCTL_RTMINEXPIRE 6 /* min value for expiration time */ +#define IPCTL_RTMAXCACHE 7 /* trigger level for dynamic expire */ +#define IPCTL_SOURCEROUTE 8 /* may perform source routes */ +#define IPCTL_DIRECTEDBROADCAST 9 /* may re-broadcast received packets */ +#define IPCTL_INTRQMAXLEN 10 /* max length of netisr queue */ +#define IPCTL_INTRQDROPS 11 /* number of netisr q drops */ +#define IPCTL_STATS 12 /* ipstat structure */ +#define IPCTL_ACCEPTSOURCEROUTE 13 /* may accept source routed packets */ +#define IPCTL_FASTFORWARDING 14 /* use fast IP forwarding code */ +#define IPCTL_KEEPFAITH 15 /* FAITH IPv4->IPv6 translater ctl */ +#define IPCTL_GIF_TTL 16 /* default TTL for gif encap packet */ +#define IPCTL_MAXID 17 + + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +/* INET6 stuff */ +#define __KAME_NETINET_IN_H_INCLUDED_ +#include <netinet6/in6.h> +#undef __KAME_NETINET_IN_H_INCLUDED_ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__BEGIN_DECLS +int bindresvport(int, struct sockaddr_in *); +struct sockaddr; +int bindresvport_sa(int, struct sockaddr *); +__END_DECLS +#endif + +#endif /* _NETINET_IN_H_ */ diff --git a/i386/include/netinet/in_pcb.h b/i386/include/netinet/in_pcb.h new file mode 100644 index 0000000..c90cf8e --- /dev/null +++ b/i386/include/netinet/in_pcb.h @@ -0,0 +1,337 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/in_pcb.h,v 1.32.2.4 2001/08/13 16:26:17 ume Exp $ + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _NETINET_IN_PCB_H_ +#define _NETINET_IN_PCB_H_ +#include <sys/appleapiopts.h> + +#include <sys/types.h> +#include <sys/queue.h> + +#include <netinet6/ipsec.h> /* for IPSEC */ + +typedef u_quad_t inp_gen_t; + +/* + * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet. + * So, AF_INET6 null laddr is also used as AF_INET null laddr, + * by utilize following structure. (At last, same as INRIA) + */ +struct in_addr_4in6 { + u_int32_t ia46_pad32[3]; + struct in_addr ia46_addr4; +}; + + +/* + * The range of the generation count, as used in this implementation, + * is 9e19. We would have to create 300 billion connections per + * second for this number to roll over in a year. This seems sufficiently + * unlikely that we simply don't concern ourselves with that possibility. + */ + +/* + * Interface exported to userland by various protocols which use + * inpcbs. Hack alert -- only define if struct xsocket is in scope. + */ + +/* + * This is a copy of the inpcb as it shipped in Panther. This structure + * is filled out in a copy function. This allows the inpcb to change + * without breaking userland tools. + * + * CAUTION: Many fields may not be filled out. Fewer may be filled out + * in the future. Code defensively. + */ + +#pragma pack(4) + +#if defined(__LP64__) +struct _inpcb_list_entry { + u_int32_t le_next; + u_int32_t le_prev; +}; +#define _INPCB_PTR(x) u_int32_t +#define _INPCB_LIST_ENTRY(x) struct _inpcb_list_entry +#else +#define _INPCB_PTR(x) x +#define _INPCB_LIST_ENTRY(x) LIST_ENTRY(x) +#endif + +struct inpcbinfo; +struct inpcbport; +struct mbuf; +struct ip6_pktopts; +struct ip6_moptions; +struct icmp6_filter; +struct inpcbpolicy; + +struct inpcb { + _INPCB_LIST_ENTRY(inpcb) inp_hash; /* hash list */ + struct in_addr reserved1; /* APPLE reserved: inp_faddr defined in protcol indep. part */ + struct in_addr reserved2; /* APPLE reserved */ + u_short inp_fport; /* foreign port */ + u_short inp_lport; /* local port */ + _INPCB_LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */ + _INPCB_PTR(caddr_t) inp_ppcb; /* pointer to per-protocol pcb */ + _INPCB_PTR(struct inpcbinfo *) inp_pcbinfo; /* PCB list info */ + _INPCB_PTR(void *) inp_socket; /* back pointer to socket */ + u_char nat_owner; /* Used to NAT TCP/UDP traffic */ + u_int32_t nat_cookie; /* Cookie stored and returned to NAT */ + _INPCB_LIST_ENTRY(inpcb) inp_portlist; /* list for this PCB's local port */ + _INPCB_PTR(struct inpcbport *) inp_phd; /* head of this list */ + inp_gen_t inp_gencnt; /* generation count of this instance */ + int inp_flags; /* generic IP/datagram flags */ + u_int32_t inp_flow; + + u_char inp_vflag; + + u_char inp_ip_ttl; /* time to live proto */ + u_char inp_ip_p; /* protocol proto */ + /* protocol dependent part */ + union { + /* foreign host table entry */ + struct in_addr_4in6 inp46_foreign; + struct in6_addr inp6_foreign; + } inp_dependfaddr; + union { + /* local host table entry */ + struct in_addr_4in6 inp46_local; + struct in6_addr inp6_local; + } inp_dependladdr; + union { + /* placeholder for routing entry */ + u_char inp4_route[20]; + u_char inp6_route[32]; + } inp_dependroute; + struct { + /* type of service proto */ + u_char inp4_ip_tos; + /* IP options */ + _INPCB_PTR(struct mbuf *) inp4_options; + /* IP multicast options */ + _INPCB_PTR(struct ip_moptions *) inp4_moptions; + } inp_depend4; + + struct { + /* IP options */ + _INPCB_PTR(struct mbuf *) inp6_options; + u_int8_t inp6_hlim; + u_int8_t unused_uint8_1; + ushort unused_uint16_1; + /* IP6 options for outgoing packets */ + _INPCB_PTR(struct ip6_pktopts *) inp6_outputopts; + /* IP multicast options */ + _INPCB_PTR(struct ip6_moptions *) inp6_moptions; + /* ICMPv6 code type filter */ + _INPCB_PTR(struct icmp6_filter *) inp6_icmp6filt; + /* IPV6_CHECKSUM setsockopt */ + int inp6_cksum; + u_short inp6_ifindex; + short inp6_hops; + } inp_depend6; + + int hash_element; /* Array index of pcb's hash list */ + _INPCB_PTR(caddr_t) inp_saved_ppcb; /* place to save pointer while cached */ + _INPCB_PTR(struct inpcbpolicy *) inp_sp; + u_int32_t reserved[3]; /* For future use */ +}; + +struct xinpcb { + u_int32_t xi_len; /* length of this structure */ + struct inpcb xi_inp; + struct xsocket xi_socket; + u_quad_t xi_alignment_hack; +}; + +#if !CONFIG_EMBEDDED + +struct inpcb64_list_entry { + u_int64_t le_next; + u_int64_t le_prev; +}; + +struct xinpcb64 { + u_int64_t xi_len; /* length of this structure */ + u_int64_t xi_inpp; + u_short inp_fport; /* foreign port */ + u_short inp_lport; /* local port */ + struct inpcb64_list_entry + inp_list; /* list for all PCBs of this proto */ + u_int64_t inp_ppcb; /* pointer to per-protocol pcb */ + u_int64_t inp_pcbinfo; /* PCB list info */ + struct inpcb64_list_entry + inp_portlist; /* list for this PCB's local port */ + u_int64_t inp_phd; /* head of this list */ + inp_gen_t inp_gencnt; /* generation count of this instance */ + int inp_flags; /* generic IP/datagram flags */ + u_int32_t inp_flow; + u_char inp_vflag; + u_char inp_ip_ttl; /* time to live */ + u_char inp_ip_p; /* protocol */ + union { /* foreign host table entry */ + struct in_addr_4in6 inp46_foreign; + struct in6_addr inp6_foreign; + } inp_dependfaddr; + union { /* local host table entry */ + struct in_addr_4in6 inp46_local; + struct in6_addr inp6_local; + } inp_dependladdr; + struct { + u_char inp4_ip_tos; /* type of service */ + } inp_depend4; + struct { + u_int8_t inp6_hlim; + int inp6_cksum; + u_short inp6_ifindex; + short inp6_hops; + } inp_depend6; + struct xsocket64 xi_socket; + u_quad_t xi_alignment_hack; +}; + +#endif /* !CONFIG_EMBEDDED */ + +struct xinpgen { + u_int32_t xig_len; /* length of this structure */ + u_int xig_count; /* number of PCBs at this time */ + inp_gen_t xig_gen; /* generation count at this time */ + so_gen_t xig_sogen; /* socket generation count at this time */ +}; + +#pragma pack() + +/* + * These defines are for use with the inpcb. + */ +#define INP_IPV4 0x1 +#define INP_IPV6 0x2 +#define inp_faddr inp_dependfaddr.inp46_foreign.ia46_addr4 +#define inp_laddr inp_dependladdr.inp46_local.ia46_addr4 +#define inp_route inp_dependroute.inp4_route +#define inp_ip_tos inp_depend4.inp4_ip_tos +#define inp_options inp_depend4.inp4_options +#define inp_moptions inp_depend4.inp4_moptions +#define in6p_faddr inp_dependfaddr.inp6_foreign +#define in6p_laddr inp_dependladdr.inp6_local +#define in6p_route inp_dependroute.inp6_route +#define in6p_ip6_hlim inp_depend6.inp6_hlim +#define in6p_hops inp_depend6.inp6_hops /* default hop limit */ +#define in6p_ip6_nxt inp_ip_p +#define in6p_flowinfo inp_flow +#define in6p_vflag inp_vflag +#define in6p_options inp_depend6.inp6_options +#define in6p_outputopts inp_depend6.inp6_outputopts +#define in6p_moptions inp_depend6.inp6_moptions +#define in6p_icmp6filt inp_depend6.inp6_icmp6filt +#define in6p_cksum inp_depend6.inp6_cksum +#define in6p_ifindex inp_depend6.inp6_ifindex +#define in6p_flags inp_flags /* for KAME src sync over BSD*'s */ +#define in6p_socket inp_socket /* for KAME src sync over BSD*'s */ +#define in6p_lport inp_lport /* for KAME src sync over BSD*'s */ +#define in6p_fport inp_fport /* for KAME src sync over BSD*'s */ +#define in6p_ppcb inp_ppcb /* for KAME src sync over BSD*'s */ +#define in6p_state inp_state +#define in6p_wantcnt inp_wantcnt + + +/* flags in inp_flags: */ +#define INP_RECVOPTS 0x01 /* receive incoming IP options */ +#define INP_RECVRETOPTS 0x02 /* receive IP options for reply */ +#define INP_RECVDSTADDR 0x04 /* receive IP dst address */ +#define INP_HDRINCL 0x08 /* user supplies entire IP header */ +#define INP_HIGHPORT 0x10 /* user wants "high" port binding */ +#define INP_LOWPORT 0x20 /* user wants "low" port binding */ +#define INP_ANONPORT 0x40 /* port chosen for user */ +#define INP_RECVIF 0x80 /* receive incoming interface */ +#define INP_MTUDISC 0x100 /* user can do MTU discovery */ +#ifdef __APPLE__ +#define INP_STRIPHDR 0x200 /* Strip headers in raw_ip, for OT support */ +#endif +#define INP_FAITH 0x400 /* accept FAITH'ed connections */ +#define INP_INADDR_ANY 0x800 /* local address wasn't specified */ + +#define INP_RECVTTL 0x1000 +#define INP_UDP_NOCKSUM 0x2000 /* Turn off outbound UDP checksum */ +#define INP_BOUND_IF 0x4000 /* bind socket to an ifindex */ + +#define IN6P_IPV6_V6ONLY 0x008000 /* restrict AF_INET6 socket for v6 */ + +#define IN6P_PKTINFO 0x010000 /* receive IP6 dst and I/F */ +#define IN6P_HOPLIMIT 0x020000 /* receive hoplimit */ +#define IN6P_HOPOPTS 0x040000 /* receive hop-by-hop options */ +#define IN6P_DSTOPTS 0x080000 /* receive dst options after rthdr */ +#define IN6P_RTHDR 0x100000 /* receive routing header */ +#define IN6P_RTHDRDSTOPTS 0x200000 /* receive dstoptions before rthdr */ +#define IN6P_TCLASS 0x400000 /* receive traffic class value */ +#define IN6P_AUTOFLOWLABEL 0x800000 /* attach flowlabel automatically */ +#define IN6P_BINDV6ONLY 0x10000000 /* do not grab IPv4 traffic */ + + +#endif /* !_NETINET_IN_PCB_H_ */ diff --git a/i386/include/netinet/in_systm.h b/i386/include/netinet/in_systm.h new file mode 100644 index 0000000..57fbb8d --- /dev/null +++ b/i386/include/netinet/in_systm.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_systm.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $ + */ + +#ifndef _NETINET_IN_SYSTM_H_ +#define _NETINET_IN_SYSTM_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> + +/* + * Miscellaneous internetwork + * definitions for kernel. + */ + +/* + * Network types. + * + * Internally the system keeps counters in the headers with the bytes + * swapped so that VAX instructions will work on them. It reverses + * the bytes before transmission at each protocol level. The n_ types + * represent the types with the bytes in ``high-ender'' order. + */ +typedef __uint16_t n_short; /* short as received from the net */ +typedef __uint32_t n_long; /* long as received from the net */ + +typedef __uint32_t n_time; /* ms since 00:00 GMT, byte rev */ + + +#endif diff --git a/i386/include/netinet/in_var.h b/i386/include/netinet/in_var.h new file mode 100644 index 0000000..04ce0d4 --- /dev/null +++ b/i386/include/netinet/in_var.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1985, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_var.h 8.2 (Berkeley) 1/9/95 + * $FreeBSD: src/sys/netinet/in_var.h,v 1.33.2.2 2001/07/17 10:50:01 ru Exp $ + */ + +#ifndef _NETINET_IN_VAR_H_ +#define _NETINET_IN_VAR_H_ +#include <sys/appleapiopts.h> + +#include <sys/queue.h> +#ifdef __APPLE__ +#include <sys/kern_event.h> +#endif + + +struct in_aliasreq { + char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct sockaddr_in ifra_addr; + struct sockaddr_in ifra_broadaddr; +#define ifra_dstaddr ifra_broadaddr + struct sockaddr_in ifra_mask; + u_int32_t ifra_unused; /* not used: used to be 'dlt' */ +}; + +/* + * Event data, internet style. + */ +struct kev_in_data { + struct net_event_data link_data; + struct in_addr ia_addr; + u_int32_t ia_net; /* network number of interface */ + u_int32_t ia_netmask; /* mask of net part */ + u_int32_t ia_subnet; /* subnet number, including net */ + u_int32_t ia_subnetmask; /* mask of subnet part */ + struct in_addr ia_netbroadcast;/* to recognize net broadcasts */ + struct in_addr ia_dstaddr; +}; + +struct kev_in_collision { + struct net_event_data link_data; /* link colliding arp was received on */ + struct in_addr ia_ipaddr; /* IP address we and another node are using */ + u_char hw_len; /* length of hardware address */ + u_char hw_addr[0]; /* variable length hardware address */ +}; + +#ifdef __APPLE_API_PRIVATE +struct kev_in_portinuse { + u_int16_t port; /* conflicting port number in host order */ + u_int32_t req_pid; /* PID port requestor */ + u_int32_t reserved[2]; +}; +#endif + + +/* + * Define inet event subclass and specific inet events. + */ + +#define KEV_INET_SUBCLASS 1 + +#define KEV_INET_NEW_ADDR 1 +#define KEV_INET_CHANGED_ADDR 2 +#define KEV_INET_ADDR_DELETED 3 +#define KEV_INET_SIFDSTADDR 4 +#define KEV_INET_SIFBRDADDR 5 +#define KEV_INET_SIFNETMASK 6 +#define KEV_INET_ARPCOLLISION 7 /* use kev_in_collision */ + +#ifdef __APPLE_API_PRIVATE +#define KEV_INET_PORTINUSE 8 /* use ken_in_portinuse */ +#endif + + +/* INET6 stuff */ +#include <netinet6/in6_var.h> + +#endif /* _NETINET_IN_VAR_H_ */ diff --git a/i386/include/netinet/ip.h b/i386/include/netinet/ip.h new file mode 100644 index 0000000..c21698f --- /dev/null +++ b/i386/include/netinet/ip.h @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip.h 8.2 (Berkeley) 6/1/94 + * $FreeBSD: src/sys/netinet/ip.h,v 1.17 1999/12/22 19:13:20 shin Exp $ + */ + +#ifndef _NETINET_IP_H_ +#define _NETINET_IP_H_ +#include <sys/appleapiopts.h> +#include <sys/types.h> /* XXX temporary hack to get u_ types */ +#include <netinet/in.h> +#include <netinet/in_systm.h> + + +/* + * Definitions for internet protocol version 4. + * Per RFC 791, September 1981. + */ +#define IPVERSION 4 + +/* + * Structure of an internet header, naked of options. + */ +struct ip { +#ifdef _IP_VHL + u_char ip_vhl; /* version << 4 | header length >> 2 */ +#else +#if BYTE_ORDER == LITTLE_ENDIAN + u_int ip_hl:4, /* header length */ + ip_v:4; /* version */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int ip_v:4, /* version */ + ip_hl:4; /* header length */ +#endif +#endif /* not _IP_VHL */ + u_char ip_tos; /* type of service */ + u_short ip_len; /* total length */ + u_short ip_id; /* identification */ + u_short ip_off; /* fragment offset field */ +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* dont fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + u_char ip_ttl; /* time to live */ + u_char ip_p; /* protocol */ + u_short ip_sum; /* checksum */ + struct in_addr ip_src,ip_dst; /* source and dest address */ +}; + +#ifdef _IP_VHL +#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl)) +#define IP_VHL_HL(vhl) ((vhl) & 0x0f) +#define IP_VHL_V(vhl) ((vhl) >> 4) +#define IP_VHL_BORING 0x45 +#endif + +#define IP_MAXPACKET 65535 /* maximum packet size */ + +/* + * Definitions for IP type of service (ip_tos) + */ +#define IPTOS_LOWDELAY 0x10 +#define IPTOS_THROUGHPUT 0x08 +#define IPTOS_RELIABILITY 0x04 +#define IPTOS_MINCOST 0x02 +#if 1 +/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */ +#define IPTOS_CE 0x01 +#define IPTOS_ECT 0x02 +#endif + +/* + * ECN (Explicit Congestion Notification) codepoints in RFC3168 + * mapped to the lower 2 bits of the TOS field. + */ +#define IPTOS_ECN_NOTECT 0x00 /* not-ECT */ +#define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */ +#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */ +#define IPTOS_ECN_CE 0x03 /* congestion experienced */ +#define IPTOS_ECN_MASK 0x03 /* ECN field mask */ + +/* + * Definitions for IP precedence (also in ip_tos) (hopefully unused) + */ +#define IPTOS_PREC_NETCONTROL 0xe0 +#define IPTOS_PREC_INTERNETCONTROL 0xc0 +#define IPTOS_PREC_CRITIC_ECP 0xa0 +#define IPTOS_PREC_FLASHOVERRIDE 0x80 +#define IPTOS_PREC_FLASH 0x60 +#define IPTOS_PREC_IMMEDIATE 0x40 +#define IPTOS_PREC_PRIORITY 0x20 +#define IPTOS_PREC_ROUTINE 0x00 + +/* + * Definitions for options. + */ +#define IPOPT_COPIED(o) ((o)&0x80) +#define IPOPT_CLASS(o) ((o)&0x60) +#define IPOPT_NUMBER(o) ((o)&0x1f) + +#define IPOPT_CONTROL 0x00 +#define IPOPT_RESERVED1 0x20 +#define IPOPT_DEBMEAS 0x40 +#define IPOPT_RESERVED2 0x60 + +#define IPOPT_EOL 0 /* end of option list */ +#define IPOPT_NOP 1 /* no operation */ + +#define IPOPT_RR 7 /* record packet route */ +#define IPOPT_TS 68 /* timestamp */ +#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */ +#define IPOPT_LSRR 131 /* loose source route */ +#define IPOPT_SATID 136 /* satnet id */ +#define IPOPT_SSRR 137 /* strict source route */ +#define IPOPT_RA 148 /* router alert */ + +/* + * Offsets to fields in options other than EOL and NOP. + */ +#define IPOPT_OPTVAL 0 /* option ID */ +#define IPOPT_OLEN 1 /* option length */ +#define IPOPT_OFFSET 2 /* offset within option */ +#define IPOPT_MINOFF 4 /* min value of above */ + +/* + * Time stamp option structure. + */ +struct ip_timestamp { + u_char ipt_code; /* IPOPT_TS */ + u_char ipt_len; /* size of structure (variable) */ + u_char ipt_ptr; /* index of current entry */ +#if BYTE_ORDER == LITTLE_ENDIAN + u_int ipt_flg:4, /* flags, see below */ + ipt_oflw:4; /* overflow counter */ +#endif +#if BYTE_ORDER == BIG_ENDIAN + u_int ipt_oflw:4, /* overflow counter */ + ipt_flg:4; /* flags, see below */ +#endif + union ipt_timestamp { + n_long ipt_time[1]; + struct ipt_ta { + struct in_addr ipt_addr; + n_long ipt_time; + } ipt_ta[1]; + } ipt_timestamp; +}; + +/* flag bits for ipt_flg */ +#define IPOPT_TS_TSONLY 0 /* timestamps only */ +#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ +#define IPOPT_TS_PRESPEC 3 /* specified modules only */ + +/* bits for security (not byte swapped) */ +#define IPOPT_SECUR_UNCLASS 0x0000 +#define IPOPT_SECUR_CONFID 0xf135 +#define IPOPT_SECUR_EFTO 0x789a +#define IPOPT_SECUR_MMMM 0xbc4d +#define IPOPT_SECUR_RESTR 0xaf13 +#define IPOPT_SECUR_SECRET 0xd788 +#define IPOPT_SECUR_TOPSECRET 0x6bc5 + +/* + * Internet implementation parameters. + */ +#define MAXTTL 255 /* maximum time to live (seconds) */ +#define IPDEFTTL 64 /* default ttl, from RFC 1340 */ +#define IPFRAGTTL 60 /* time to live for frags, slowhz */ +#define IPTTLDEC 1 /* subtracted when forwarding */ + +#define IP_MSS 576 /* default maximum segment size */ + +#endif diff --git a/i386/include/netinet/ip6.h b/i386/include/netinet/ip6.h new file mode 100644 index 0000000..2afb8d8 --- /dev/null +++ b/i386/include/netinet/ip6.h @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $*/ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_IP6_H_ +#define _NETINET_IP6_H_ +#include <sys/appleapiopts.h> + +/* + * Definition for internet protocol version 6. + * RFC 2460 + */ + +struct ip6_hdr { + union { + struct ip6_hdrctl { + u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */ + u_int16_t ip6_un1_plen; /* payload length */ + u_int8_t ip6_un1_nxt; /* next header */ + u_int8_t ip6_un1_hlim; /* hop limit */ + } ip6_un1; + u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */ + } ip6_ctlun; + struct in6_addr ip6_src; /* source address */ + struct in6_addr ip6_dst; /* destination address */ +} __attribute__((__packed__)); + +#define ip6_vfc ip6_ctlun.ip6_un2_vfc +#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow +#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen +#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt +#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim +#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim + +#define IPV6_VERSION 0x60 +#define IPV6_VERSION_MASK 0xf0 + +#if BYTE_ORDER == BIG_ENDIAN +#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */ +#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */ +#else +#if BYTE_ORDER == LITTLE_ENDIAN +#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */ +#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */ +#endif /* LITTLE_ENDIAN */ +#endif +#if 1 +/* ECN bits proposed by Sally Floyd */ +#define IP6TOS_CE 0x01 /* congestion experienced */ +#define IP6TOS_ECT 0x02 /* ECN-capable transport */ +#endif + +/* + * Extension Headers + */ + +struct ip6_ext { + u_int8_t ip6e_nxt; + u_int8_t ip6e_len; +} __attribute__((__packed__)); + +/* Hop-by-Hop options header */ +/* XXX should we pad it to force alignment on an 8-byte boundary? */ +struct ip6_hbh { + u_int8_t ip6h_nxt; /* next header */ + u_int8_t ip6h_len; /* length in units of 8 octets */ + /* followed by options */ +} __attribute__((__packed__)); + +/* Destination options header */ +/* XXX should we pad it to force alignment on an 8-byte boundary? */ +struct ip6_dest { + u_int8_t ip6d_nxt; /* next header */ + u_int8_t ip6d_len; /* length in units of 8 octets */ + /* followed by options */ +} __attribute__((__packed__)); + +/* Option types and related macros */ +#define IP6OPT_PAD1 0x00 /* 00 0 00000 */ +#define IP6OPT_PADN 0x01 /* 00 0 00001 */ +#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */ +#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */ +#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */ +#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */ + +#define IP6OPT_RTALERT_LEN 4 +#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */ +#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */ +#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */ +#define IP6OPT_MINLEN 2 + +#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */ +#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */ +#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */ +#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */ +#define IP6OPT_EID 0x8a /* 10 0 01010 */ + +#define IP6OPT_TYPE(o) ((o) & 0xC0) +#define IP6OPT_TYPE_SKIP 0x00 +#define IP6OPT_TYPE_DISCARD 0x40 +#define IP6OPT_TYPE_FORCEICMP 0x80 +#define IP6OPT_TYPE_ICMP 0xC0 + +#define IP6OPT_MUTABLE 0x20 + +#define IP6OPT_JUMBO_LEN 6 + +/* Routing header */ +struct ip6_rthdr { + u_int8_t ip6r_nxt; /* next header */ + u_int8_t ip6r_len; /* length in units of 8 octets */ + u_int8_t ip6r_type; /* routing type */ + u_int8_t ip6r_segleft; /* segments left */ + /* followed by routing type specific data */ +} __attribute__((__packed__)); + +/* Type 0 Routing header */ +struct ip6_rthdr0 { + u_int8_t ip6r0_nxt; /* next header */ + u_int8_t ip6r0_len; /* length in units of 8 octets */ + u_int8_t ip6r0_type; /* always zero */ + u_int8_t ip6r0_segleft; /* segments left */ + u_int8_t ip6r0_reserved; /* reserved field */ + u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ + struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ +} __attribute__((__packed__)); + +/* Fragment header */ +struct ip6_frag { + u_int8_t ip6f_nxt; /* next header */ + u_int8_t ip6f_reserved; /* reserved field */ + u_int16_t ip6f_offlg; /* offset, reserved, and flag */ + u_int32_t ip6f_ident; /* identification */ +} __attribute__((__packed__)); + +#if BYTE_ORDER == BIG_ENDIAN +#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ +#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ +#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ +#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ +#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ +#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */ +#endif /* BYTE_ORDER == LITTLE_ENDIAN */ + +/* + * Internet implementation parameters. + */ +#define IPV6_MAXHLIM 255 /* maximun hoplimit */ +#define IPV6_DEFHLIM 64 /* default hlim */ +#define IPV6_FRAGTTL 120 /* ttl for fragment packets, in slowtimo tick */ +#define IPV6_HLIMDEC 1 /* subtracted when forwaeding */ + +#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */ +#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/ + +#endif /* !_NETINET_IP6_H_ */ diff --git a/i386/include/netinet/ip_fw.h b/i386/include/netinet/ip_fw.h new file mode 100644 index 0000000..95f184f --- /dev/null +++ b/i386/include/netinet/ip_fw.h @@ -0,0 +1,303 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1993 Daniel Boulet + * Copyright (c) 1994 Ugen J.S.Antsilevich + * + * Redistribution and use in source forms, with and without modification, + * are permitted provided that this entire comment appears intact. + * + * Redistribution in binary form may occur without any restrictions. + * Obviously, it would be nice if you gave credit where credit is due + * but requiring it would be too onerous. + * + * This software is provided ``AS IS'' without any warranties of any kind. + * + */ + +#ifndef _IP_FW_H +#define _IP_FW_H + +#include <sys/appleapiopts.h> + +#ifdef IPFW2 +#include <netinet/ip_fw2.h> +#else /* !IPFW2, good old ipfw */ + +#include <sys/queue.h> +#include <sys/types.h> /* u_ types */ + +#define IP_FW_CURRENT_API_VERSION 20 /* Version of this API */ + + +/* + * This union structure identifies an interface, either explicitly + * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME + * and IP_FW_F_OIFNAME say how to interpret this structure. An + * interface unit number of -1 matches any unit number, while an + * IP address of 0.0.0.0 indicates matches any interface. + * + * The receive and transmit interfaces are only compared against the + * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE) + * is set. Note some packets lack a receive or transmit interface + * (in which case the missing "interface" never matches). + */ + +union ip_fw_if { + struct in_addr fu_via_ip; /* Specified by IP address */ + struct { /* Specified by interface name */ +#define FW_IFNLEN 10 /* need room ! was IFNAMSIZ */ + char name[FW_IFNLEN]; + short unit; /* -1 means match any unit */ + } fu_via_if; +}; + +/* + * Format of an IP firewall descriptor + * + * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order. + * fw_flg and fw_n*p are stored in host byte order (of course). + * Port numbers are stored in HOST byte order. + */ + +struct ip_fw { + u_int32_t version; /* Version of this structure. Should always be */ + /* set to IP_FW_CURRENT_API_VERSION by clients. */ + void *context; /* Context that is usable by user processes to */ + /* identify this rule. */ + u_int64_t fw_pcnt,fw_bcnt; /* Packet and byte counters */ + struct in_addr fw_src, fw_dst; /* Source and destination IP addr */ + struct in_addr fw_smsk, fw_dmsk; /* Mask for src and dest IP addr */ + u_short fw_number; /* Rule number */ + u_int fw_flg; /* Flags word */ +#define IP_FW_MAX_PORTS 10 /* A reasonable maximum */ + union { + u_short fw_pts[IP_FW_MAX_PORTS]; /* Array of port numbers to match */ +#define IP_FW_ICMPTYPES_MAX 128 +#define IP_FW_ICMPTYPES_DIM (IP_FW_ICMPTYPES_MAX / (sizeof(unsigned) * 8)) + unsigned fw_icmptypes[IP_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */ + } fw_uar; + u_int fw_ipflg; /* IP flags word */ + u_char fw_ipopt,fw_ipnopt; /* IP options set/unset */ + u_char fw_tcpopt,fw_tcpnopt; /* TCP options set/unset */ + u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */ + long timestamp; /* timestamp (tv_sec) of last match */ + union ip_fw_if fw_in_if, fw_out_if; /* Incoming and outgoing interfaces */ + union { + u_short fu_divert_port; /* Divert/tee port (options IPDIVERT) */ + u_short fu_pipe_nr; /* queue number (option DUMMYNET) */ + u_short fu_skipto_rule; /* SKIPTO command rule number */ + u_short fu_reject_code; /* REJECT response code */ + struct sockaddr_in fu_fwd_ip; + } fw_un; + u_char fw_prot; /* IP protocol */ + /* + * N'of src ports and # of dst ports in ports array (dst ports + * follow src ports; max of 10 ports in all; count of 0 means + * match all ports) + */ + u_char fw_nports; + void *pipe_ptr; /* flow_set ptr for dummynet pipe */ + void *next_rule_ptr ; /* next rule in case of match */ + uid_t fw_uid; /* uid to match */ + int fw_logamount; /* amount to log */ + u_int64_t fw_loghighest; /* highest number packet to log */ +}; + +/* + * extended ipfw structure... some fields in the original struct + * can be used to pass parameters up/down, namely pointers + * void *pipe_ptr + * void *next_rule_ptr + * some others can be used to pass parameters down, namely counters etc. + * u_int64_t fw_pcnt,fw_bcnt; + * long timestamp; + */ + +struct ip_fw_ext { /* extended structure */ + struct ip_fw rule; /* must be at offset 0 */ + long dont_match_prob; /* 0x7fffffff means 1.0, always fail */ + u_int dyn_type; /* type for dynamic rule */ +}; + +#define IP_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f) +#define IP_FW_SETNSRCP(rule, n) do { \ + (rule)->fw_nports &= ~0x0f; \ + (rule)->fw_nports |= (n); \ + } while (0) +#define IP_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4) +#define IP_FW_SETNDSTP(rule, n) do { \ + (rule)->fw_nports &= ~0xf0; \ + (rule)->fw_nports |= (n) << 4;\ + } while (0) + +#define fw_divert_port fw_un.fu_divert_port +#define fw_skipto_rule fw_un.fu_skipto_rule +#define fw_reject_code fw_un.fu_reject_code +#define fw_pipe_nr fw_un.fu_pipe_nr +#define fw_fwd_ip fw_un.fu_fwd_ip + +struct ip_fw_chain { + LIST_ENTRY(ip_fw_chain) next; + struct ip_fw *rule; +}; + +/* + * Flow mask/flow id for each queue. + */ +struct ipfw_flow_id { + u_int32_t dst_ip, src_ip ; + u_int16_t dst_port, src_port ; + u_int8_t proto ; + u_int8_t flags ; /* protocol-specific flags */ +} ; + +/* + * dynamic ipfw rule + */ +struct ipfw_dyn_rule { + struct ipfw_dyn_rule *next ; + + struct ipfw_flow_id id ; + struct ipfw_flow_id mask ; + struct ip_fw_chain *chain ; /* pointer to parent rule */ + u_int32_t type ; /* rule type */ + u_int32_t expire ; /* expire time */ + u_int64_t pcnt, bcnt; /* match counters */ + u_int32_t bucket ; /* which bucket in hash table */ + u_int32_t state ; /* state of this rule (typ. a */ + /* combination of TCP flags) */ +} ; + +/* + * Values for "flags" field . + */ +#define IP_FW_F_COMMAND 0x000000ff /* Mask for type of chain entry: */ +#define IP_FW_F_DENY 0x00000000 /* This is a deny rule */ +#define IP_FW_F_REJECT 0x00000001 /* Deny and send a response packet */ +#define IP_FW_F_ACCEPT 0x00000002 /* This is an accept rule */ +#define IP_FW_F_COUNT 0x00000003 /* This is a count rule */ +#define IP_FW_F_DIVERT 0x00000004 /* This is a divert rule */ +#define IP_FW_F_TEE 0x00000005 /* This is a tee rule */ +#define IP_FW_F_SKIPTO 0x00000006 /* This is a skipto rule */ +#define IP_FW_F_FWD 0x00000007 /* This is a "change forwarding address" rule */ +#define IP_FW_F_PIPE 0x00000008 /* This is a dummynet rule */ +#define IP_FW_F_QUEUE 0x00000009 /* This is a dummynet queue */ + +#define IP_FW_F_IN 0x00000100 /* Check inbound packets */ +#define IP_FW_F_OUT 0x00000200 /* Check outbound packets */ +#define IP_FW_F_IIFACE 0x00000400 /* Apply inbound interface test */ +#define IP_FW_F_OIFACE 0x00000800 /* Apply outbound interface test */ + +#define IP_FW_F_PRN 0x00001000 /* Print if this rule matches */ + +#define IP_FW_F_SRNG 0x00002000 /* The first two src ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IP_FW_F_DRNG 0x00004000 /* The first two dst ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IP_FW_F_FRAG 0x00008000 /* Fragment */ + +#define IP_FW_F_IIFNAME 0x00010000 /* In interface by name/unit (not IP) */ +#define IP_FW_F_OIFNAME 0x00020000 /* Out interface by name/unit (not IP) */ + +#define IP_FW_F_INVSRC 0x00040000 /* Invert sense of src check */ +#define IP_FW_F_INVDST 0x00080000 /* Invert sense of dst check */ + +#define IP_FW_F_ICMPBIT 0x00100000 /* ICMP type bitmap is valid */ + +#define IP_FW_F_UID 0x00200000 /* filter by uid */ + +#define IP_FW_F_RND_MATCH 0x00800000 /* probabilistic rule match */ +#define IP_FW_F_SMSK 0x01000000 /* src-port + mask */ +#define IP_FW_F_DMSK 0x02000000 /* dst-port + mask */ +#define IP_FW_BRIDGED 0x04000000 /* only match bridged packets */ +#define IP_FW_F_KEEP_S 0x08000000 /* keep state */ +#define IP_FW_F_CHECK_S 0x10000000 /* check state */ + +#define IP_FW_F_SME 0x20000000 /* source = me */ +#define IP_FW_F_DME 0x40000000 /* destination = me */ + +#define IP_FW_F_MASK 0x7FFFFFFF /* All possible flag bits mask */ + +/* + * Flags for the 'fw_ipflg' field, for comparing values of ip and its protocols. + */ +#define IP_FW_IF_TCPEST 0x00000020 /* established TCP connection */ +#define IP_FW_IF_TCPMSK 0x00000020 /* mask of all TCP values */ + +/* + * For backwards compatibility with rules specifying "via iface" but + * not restricted to only "in" or "out" packets, we define this combination + * of bits to represent this configuration. + */ + +#define IF_FW_F_VIAHACK (IP_FW_F_IN|IP_FW_F_OUT|IP_FW_F_IIFACE|IP_FW_F_OIFACE) + +/* + * Definitions for REJECT response codes. + * Values less than 256 correspond to ICMP unreachable codes. + */ +#define IP_FW_REJECT_RST 0x0100 /* TCP packets: send RST */ + +/* + * Definitions for IP option names. + */ +#define IP_FW_IPOPT_LSRR 0x01 +#define IP_FW_IPOPT_SSRR 0x02 +#define IP_FW_IPOPT_RR 0x04 +#define IP_FW_IPOPT_TS 0x08 + +/* + * Definitions for TCP option names. + */ +#define IP_FW_TCPOPT_MSS 0x01 +#define IP_FW_TCPOPT_WINDOW 0x02 +#define IP_FW_TCPOPT_SACK 0x04 +#define IP_FW_TCPOPT_TS 0x08 +#define IP_FW_TCPOPT_CC 0x10 + +/* + * Definitions for TCP flags. + */ +#define IP_FW_TCPF_FIN TH_FIN +#define IP_FW_TCPF_SYN TH_SYN +#define IP_FW_TCPF_RST TH_RST +#define IP_FW_TCPF_PSH TH_PUSH +#define IP_FW_TCPF_ACK TH_ACK +#define IP_FW_TCPF_URG TH_URG + +/* + * Main firewall chains definitions and global var's definitions. + */ + +#endif /* !IPFW2 */ +#endif /* _IP_FW_H */ diff --git a/i386/include/netinet/ip_fw2.h b/i386/include/netinet/ip_fw2.h new file mode 100644 index 0000000..8908353 --- /dev/null +++ b/i386/include/netinet/ip_fw2.h @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/netinet/ip_fw2.h,v 1.1.2.4 2003/07/17 06:03:39 luigi Exp $ + */ + +#ifndef _IPFW2_H +#define _IPFW2_H + +/* + * Define IP Firewall event subclass, and associated events. + */ + +/*! + @defined KEV_IPFW_SUBCLASS + @discussion The kernel event subclass for IP Firewall. +*/ +#define KEV_IPFW_SUBCLASS 1 + +/*! + @defined KEV_IPFW_ADD + @discussion The event code indicating a rule has been added. +*/ +#define KEV_IPFW_ADD 1 + +/*! + @defined KEV_IPFW_DEL + @discussion The event code indicating a rule has been removed. +*/ +#define KEV_IPFW_DEL 2 + +/*! + @defined KEV_IPFW_FLUSH + @discussion The event code indicating the rule set has been flushed. +*/ +#define KEV_IPFW_FLUSH 3 + +/*! + @defined KEV_IPFW_ENABLE + @discussion The event code indicating the enable flag has been changed +*/ +#define KEV_IPFW_ENABLE 4 + + + +/* + * The kernel representation of ipfw rules is made of a list of + * 'instructions' (for all practical purposes equivalent to BPF + * instructions), which specify which fields of the packet + * (or its metadata) should be analysed. + * + * Each instruction is stored in a structure which begins with + * "ipfw_insn", and can contain extra fields depending on the + * instruction type (listed below). + * Note that the code is written so that individual instructions + * have a size which is a multiple of 32 bits. This means that, if + * such structures contain pointers or other 64-bit entities, + * (there is just one instance now) they may end up unaligned on + * 64-bit architectures, so the must be handled with care. + * + * "enum ipfw_opcodes" are the opcodes supported. We can have up + * to 256 different opcodes. + */ + +enum ipfw_opcodes { /* arguments (4 byte each) */ + O_NOP, + + O_IP_SRC, /* u32 = IP */ + O_IP_SRC_MASK, /* ip = IP/mask */ + O_IP_SRC_ME, /* none */ + O_IP_SRC_SET, /* u32=base, arg1=len, bitmap */ + + O_IP_DST, /* u32 = IP */ + O_IP_DST_MASK, /* ip = IP/mask */ + O_IP_DST_ME, /* none */ + O_IP_DST_SET, /* u32=base, arg1=len, bitmap */ + + O_IP_SRCPORT, /* (n)port list:mask 4 byte ea */ + O_IP_DSTPORT, /* (n)port list:mask 4 byte ea */ + O_PROTO, /* arg1=protocol */ + + O_MACADDR2, /* 2 mac addr:mask */ + O_MAC_TYPE, /* same as srcport */ + + O_LAYER2, /* none */ + O_IN, /* none */ + O_FRAG, /* none */ + + O_RECV, /* none */ + O_XMIT, /* none */ + O_VIA, /* none */ + + O_IPOPT, /* arg1 = 2*u8 bitmap */ + O_IPLEN, /* arg1 = len */ + O_IPID, /* arg1 = id */ + + O_IPTOS, /* arg1 = id */ + O_IPPRECEDENCE, /* arg1 = precedence << 5 */ + O_IPTTL, /* arg1 = TTL */ + + O_IPVER, /* arg1 = version */ + O_UID, /* u32 = id */ + O_GID, /* u32 = id */ + O_ESTAB, /* none (tcp established) */ + O_TCPFLAGS, /* arg1 = 2*u8 bitmap */ + O_TCPWIN, /* arg1 = desired win */ + O_TCPSEQ, /* u32 = desired seq. */ + O_TCPACK, /* u32 = desired seq. */ + O_ICMPTYPE, /* u32 = icmp bitmap */ + O_TCPOPTS, /* arg1 = 2*u8 bitmap */ + + O_VERREVPATH, /* none */ + + O_PROBE_STATE, /* none */ + O_KEEP_STATE, /* none */ + O_LIMIT, /* ipfw_insn_limit */ + O_LIMIT_PARENT, /* dyn_type, not an opcode. */ + + /* + * These are really 'actions'. + */ + + O_LOG, /* ipfw_insn_log */ + O_PROB, /* u32 = match probability */ + + O_CHECK_STATE, /* none */ + O_ACCEPT, /* none */ + O_DENY, /* none */ + O_REJECT, /* arg1=icmp arg (same as deny) */ + O_COUNT, /* none */ + O_SKIPTO, /* arg1=next rule number */ + O_PIPE, /* arg1=pipe number */ + O_QUEUE, /* arg1=queue number */ + O_DIVERT, /* arg1=port number */ + O_TEE, /* arg1=port number */ + O_FORWARD_IP, /* fwd sockaddr */ + O_FORWARD_MAC, /* fwd mac */ + + /* + * More opcodes. + */ + O_IPSEC, /* has ipsec history */ + + O_LAST_OPCODE /* not an opcode! */ +}; + +/* + * Template for instructions. + * + * ipfw_insn is used for all instructions which require no operands, + * a single 16-bit value (arg1), or a couple of 8-bit values. + * + * For other instructions which require different/larger arguments + * we have derived structures, ipfw_insn_*. + * + * The size of the instruction (in 32-bit words) is in the low + * 6 bits of "len". The 2 remaining bits are used to implement + * NOT and OR on individual instructions. Given a type, you can + * compute the length to be put in "len" using F_INSN_SIZE(t) + * + * F_NOT negates the match result of the instruction. + * + * F_OR is used to build or blocks. By default, instructions + * are evaluated as part of a logical AND. An "or" block + * { X or Y or Z } contains F_OR set in all but the last + * instruction of the block. A match will cause the code + * to skip past the last instruction of the block. + * + * NOTA BENE: in a couple of places we assume that + * sizeof(ipfw_insn) == sizeof(u_int32_t) + * this needs to be fixed. + * + */ +typedef struct _ipfw_insn { /* template for instructions */ + enum ipfw_opcodes opcode:8; + u_int8_t len; /* numer of 32-byte words */ +#define F_NOT 0x80 +#define F_OR 0x40 +#define F_LEN_MASK 0x3f +#define F_LEN(cmd) ((cmd)->len & F_LEN_MASK) + + u_int16_t arg1; +} ipfw_insn; + +/* + * The F_INSN_SIZE(type) computes the size, in 4-byte words, of + * a given type. + */ +#define F_INSN_SIZE(t) ((sizeof (t))/sizeof(u_int32_t)) + +/* + * This is used to store an array of 16-bit entries (ports etc.) + */ +typedef struct _ipfw_insn_u16 { + ipfw_insn o; + u_int16_t ports[2]; /* there may be more */ +} ipfw_insn_u16; + +/* + * This is used to store an array of 32-bit entries + * (uid, single IPv4 addresses etc.) + */ +typedef struct _ipfw_insn_u32 { + ipfw_insn o; + u_int32_t d[1]; /* one or more */ +} ipfw_insn_u32; + +/* + * This is used to store IP addr-mask pairs. + */ +typedef struct _ipfw_insn_ip { + ipfw_insn o; + struct in_addr addr; + struct in_addr mask; +} ipfw_insn_ip; + +/* + * This is used to forward to a given address (ip). + */ +typedef struct _ipfw_insn_sa { + ipfw_insn o; + struct sockaddr_in sa; +} ipfw_insn_sa; + +/* + * This is used for MAC addr-mask pairs. + */ +typedef struct _ipfw_insn_mac { + ipfw_insn o; + u_char addr[12]; /* dst[6] + src[6] */ + u_char mask[12]; /* dst[6] + src[6] */ +} ipfw_insn_mac; + +/* + * This is used for interface match rules (recv xx, xmit xx). + */ +typedef struct _ipfw_insn_if { + ipfw_insn o; + union { + struct in_addr ip; + int32_t unit; + } p; + char name[IFNAMSIZ]; +} ipfw_insn_if; + +/* + * This is used for pipe and queue actions, which need to store + * a single pointer (which can have different size on different + * architectures. + * Note that, because of previous instructions, pipe_ptr might + * be unaligned in the overall structure, so it needs to be + * manipulated with care. + */ +typedef struct _ipfw_insn_pipe { + ipfw_insn o; + void *pipe_ptr; /* XXX */ +} ipfw_insn_pipe; + +/* + * This is used for limit rules. + */ +typedef struct _ipfw_insn_limit { + ipfw_insn o; + u_int8_t _pad; + u_int8_t limit_mask; /* combination of DYN_* below */ +#define DYN_SRC_ADDR 0x1 +#define DYN_SRC_PORT 0x2 +#define DYN_DST_ADDR 0x4 +#define DYN_DST_PORT 0x8 + + u_int16_t conn_limit; +} ipfw_insn_limit; + +/* + * This is used for log instructions. + */ +typedef struct _ipfw_insn_log { + ipfw_insn o; + u_int32_t max_log; /* how many do we log -- 0 = all */ + u_int32_t log_left; /* how many left to log */ +} ipfw_insn_log; + +/* Version of this API */ +#define IP_FW_VERSION_NONE 0 +#define IP_FW_VERSION_0 10 /* old ipfw */ +#define IP_FW_VERSION_1 20 /* ipfw in Jaguar/Panther */ +#define IP_FW_VERSION_2 30 /* ipfw2 */ +#define IP_FW_CURRENT_API_VERSION IP_FW_VERSION_2 + +/* + * Here we have the structure representing an ipfw rule. + * + * It starts with a general area (with link fields and counters) + * followed by an array of one or more instructions, which the code + * accesses as an array of 32-bit values. + * + * Given a rule pointer r: + * + * r->cmd is the start of the first instruction. + * ACTION_PTR(r) is the start of the first action (things to do + * once a rule matched). + * + * When assembling instruction, remember the following: + * + * + if a rule has a "keep-state" (or "limit") option, then the + * first instruction (at r->cmd) MUST BE an O_PROBE_STATE + * + if a rule has a "log" option, then the first action + * (at ACTION_PTR(r)) MUST be O_LOG + * + * NOTE: we use a simple linked list of rules because we never need + * to delete a rule without scanning the list. We do not use + * queue(3) macros for portability and readability. + */ + +struct ip_fw { + u_int32_t version; /* Version of this structure. MUST be set */ + /* by clients. Should always be */ + /* set to IP_FW_CURRENT_API_VERSION. */ + void *context; /* Context that is usable by user processes to */ + /* identify this rule. */ + struct ip_fw *next; /* linked list of rules */ + struct ip_fw *next_rule; /* ptr to next [skipto] rule */ + /* 'next_rule' is used to pass up 'set_disable' status */ + + u_int16_t act_ofs; /* offset of action in 32-bit units */ + u_int16_t cmd_len; /* # of 32-bit words in cmd */ + u_int16_t rulenum; /* rule number */ + u_int8_t set; /* rule set (0..31) */ + u_int32_t set_masks[2]; /* masks for manipulating sets atomically */ +#define RESVD_SET 31 /* set for default and persistent rules */ + u_int8_t _pad; /* padding */ + + /* These fields are present in all rules. */ + u_int64_t pcnt; /* Packet counter */ + u_int64_t bcnt; /* Byte counter */ + u_int32_t timestamp; /* tv_sec of last match */ + + u_int32_t reserved_1; /* reserved - set to 0 */ + u_int32_t reserved_2; /* reserved - set to 0 */ + + ipfw_insn cmd[1]; /* storage for commands */ +}; + +#define ACTION_PTR(rule) \ + (ipfw_insn *)( (u_int32_t *)((rule)->cmd) + ((rule)->act_ofs) ) + +#define RULESIZE(rule) (sizeof(struct ip_fw) + \ + ((struct ip_fw *)(rule))->cmd_len * 4 - 4) + +/* + * This structure is used as a flow mask and a flow id for various + * parts of the code. + */ +struct ipfw_flow_id { + u_int32_t dst_ip; + u_int32_t src_ip; + u_int16_t dst_port; + u_int16_t src_port; + u_int8_t proto; + u_int8_t flags; /* protocol-specific flags */ +}; + +/* + * Dynamic ipfw rule. + */ +typedef struct _ipfw_dyn_rule ipfw_dyn_rule; + +struct _ipfw_dyn_rule { + ipfw_dyn_rule *next; /* linked list of rules. */ + struct ip_fw *rule; /* pointer to rule */ + /* 'rule' is used to pass up the rule number (from the parent) */ + + ipfw_dyn_rule *parent; /* pointer to parent rule */ + u_int64_t pcnt; /* packet match counter */ + u_int64_t bcnt; /* byte match counter */ + struct ipfw_flow_id id; /* (masked) flow id */ + u_int32_t expire; /* expire time */ + u_int32_t bucket; /* which bucket in hash table */ + u_int32_t state; /* state of this rule (typically a + * combination of TCP flags) + */ + u_int32_t ack_fwd; /* most recent ACKs in forward */ + u_int32_t ack_rev; /* and reverse directions (used */ + /* to generate keepalives) */ + u_int16_t dyn_type; /* rule type */ + u_int16_t count; /* refcount */ +}; + +/* + * Definitions for IP option names. + */ +#define IP_FW_IPOPT_LSRR 0x01 +#define IP_FW_IPOPT_SSRR 0x02 +#define IP_FW_IPOPT_RR 0x04 +#define IP_FW_IPOPT_TS 0x08 + +/* + * Definitions for TCP option names. + */ +#define IP_FW_TCPOPT_MSS 0x01 +#define IP_FW_TCPOPT_WINDOW 0x02 +#define IP_FW_TCPOPT_SACK 0x04 +#define IP_FW_TCPOPT_TS 0x08 +#define IP_FW_TCPOPT_CC 0x10 + +#define ICMP_REJECT_RST 0x100 /* fake ICMP code (send a TCP RST) */ + +/* + * Main firewall chains definitions and global var's definitions. + */ + + +#endif /* _IPFW2_H */ diff --git a/i386/include/netinet/ip_icmp.h b/i386/include/netinet/ip_icmp.h new file mode 100644 index 0000000..0629b0f --- /dev/null +++ b/i386/include/netinet/ip_icmp.h @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/ip_icmp.h,v 1.16 1999/12/29 04:41:01 peter Exp $ + */ + +#ifndef _NETINET_IP_ICMP_H_ +#define _NETINET_IP_ICMP_H_ +#include <sys/appleapiopts.h> + +/* + * Interface Control Message Protocol Definitions. + * Per RFC 792, September 1981. + */ + +/* + * Internal of an ICMP Router Advertisement + */ +struct icmp_ra_addr { + u_int32_t ira_addr; + u_int32_t ira_preference; +}; + +/* + * Structure of an icmp header. + */ +struct icmp { + u_char icmp_type; /* type of message, see below */ + u_char icmp_code; /* type sub code */ + u_short icmp_cksum; /* ones complement cksum of struct */ + union { + u_char ih_pptr; /* ICMP_PARAMPROB */ + struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ + struct ih_idseq { + n_short icd_id; + n_short icd_seq; + } ih_idseq; + int ih_void; + + /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */ + struct ih_pmtu { + n_short ipm_void; + n_short ipm_nextmtu; + } ih_pmtu; + + struct ih_rtradv { + u_char irt_num_addrs; + u_char irt_wpa; + u_int16_t irt_lifetime; + } ih_rtradv; + } icmp_hun; +#define icmp_pptr icmp_hun.ih_pptr +#define icmp_gwaddr icmp_hun.ih_gwaddr +#define icmp_id icmp_hun.ih_idseq.icd_id +#define icmp_seq icmp_hun.ih_idseq.icd_seq +#define icmp_void icmp_hun.ih_void +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu +#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs +#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa +#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime + union { + struct id_ts { + n_time its_otime; + n_time its_rtime; + n_time its_ttime; + } id_ts; + struct id_ip { + struct ip idi_ip; + /* options and then 64 bits of data */ + } id_ip; + struct icmp_ra_addr id_radv; + u_int32_t id_mask; + char id_data[1]; + } icmp_dun; +#define icmp_otime icmp_dun.id_ts.its_otime +#define icmp_rtime icmp_dun.id_ts.its_rtime +#define icmp_ttime icmp_dun.id_ts.its_ttime +#define icmp_ip icmp_dun.id_ip.idi_ip +#define icmp_radv icmp_dun.id_radv +#define icmp_mask icmp_dun.id_mask +#define icmp_data icmp_dun.id_data +}; + +/* + * Lower bounds on packet lengths for various types. + * For the error advice packets must first insure that the + * packet is large enough to contain the returned ip header. + * Only then can we do the check to see if 64 bits of packet + * data have been returned, since we need to check the returned + * ip header length. + */ +#define ICMP_MINLEN 8 /* abs minimum */ +#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ +#define ICMP_MASKLEN 12 /* address mask */ +#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ +#ifndef _IP_VHL +#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) + /* N.B.: must separately check that ip_hl >= 5 */ +#else +#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8) + /* N.B.: must separately check that header length >= 5 */ +#endif + +/* + * Definition of type and code field values. + */ +#define ICMP_ECHOREPLY 0 /* echo reply */ +#define ICMP_UNREACH 3 /* dest unreachable, codes: */ +#define ICMP_UNREACH_NET 0 /* bad net */ +#define ICMP_UNREACH_HOST 1 /* bad host */ +#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ +#define ICMP_UNREACH_PORT 3 /* bad port */ +#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ +#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ +#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ +#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ +#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ +#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ +#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ +#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ +#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ +#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */ +#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */ +#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */ +#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ +#define ICMP_REDIRECT 5 /* shorter route, codes: */ +#define ICMP_REDIRECT_NET 0 /* for network */ +#define ICMP_REDIRECT_HOST 1 /* for host */ +#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ +#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ +#define ICMP_ALTHOSTADDR 6 /* alternate host address */ +#define ICMP_ECHO 8 /* echo service */ +#define ICMP_ROUTERADVERT 9 /* router advertisement */ +#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */ +#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */ +#define ICMP_ROUTERSOLICIT 10 /* router solicitation */ +#define ICMP_TIMXCEED 11 /* time exceeded, code: */ +#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ +#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ +#define ICMP_PARAMPROB 12 /* ip header bad */ +#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */ +#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ +#define ICMP_PARAMPROB_LENGTH 2 /* bad length */ +#define ICMP_TSTAMP 13 /* timestamp request */ +#define ICMP_TSTAMPREPLY 14 /* timestamp reply */ +#define ICMP_IREQ 15 /* information request */ +#define ICMP_IREQREPLY 16 /* information reply */ +#define ICMP_MASKREQ 17 /* address mask request */ +#define ICMP_MASKREPLY 18 /* address mask reply */ +#define ICMP_TRACEROUTE 30 /* traceroute */ +#define ICMP_DATACONVERR 31 /* data conversion error */ +#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ +#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ +#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ +#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */ +#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ +#define ICMP_SKIP 39 /* SKIP */ +#define ICMP_PHOTURIS 40 /* Photuris */ +#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */ +#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */ +#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ + +#define ICMP_MAXTYPE 40 + +#define ICMP_INFOTYPE(type) \ + ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ + (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ + (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ + (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ + (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) + + +#endif diff --git a/i386/include/netinet/ip_mroute.h b/i386/include/netinet/ip_mroute.h new file mode 100644 index 0000000..8073b11 --- /dev/null +++ b/i386/include/netinet/ip_mroute.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989 Stephen Deering. + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Stephen Deering of Stanford University. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_IP_MROUTE_H_ +#define _NETINET_IP_MROUTE_H_ +#include <sys/appleapiopts.h> + +/* + * Definitions for IP multicast forwarding. + * + * Written by David Waitzman, BBN Labs, August 1988. + * Modified by Steve Deering, Stanford, February 1989. + * Modified by Ajit Thyagarajan, PARC, August 1993. + * Modified by Ajit Thyagarajan, PARC, August 1994. + * + * MROUTING Revision: 3.3.1.3 + */ + + +/* + * Multicast Routing set/getsockopt commands. + */ +#define MRT_INIT 100 /* initialize forwarder */ +#define MRT_DONE 101 /* shut down forwarder */ +#define MRT_ADD_VIF 102 /* create virtual interface */ +#define MRT_DEL_VIF 103 /* delete virtual interface */ +#define MRT_ADD_MFC 104 /* insert forwarding cache entry */ +#define MRT_DEL_MFC 105 /* delete forwarding cache entry */ +#define MRT_VERSION 106 /* get kernel version number */ +#define MRT_ASSERT 107 /* enable PIM assert processing */ + + + +#ifndef CONFIG_MAXVIFS +#define CONFIG_MAXVIFS 32 /* 4635538 temp workaround */ +#endif + +#ifndef CONFIG_MFCTBLSIZ +#define CONFIG_MFCTBLSIZ 256 /* 4635538 temp workaround */ +#endif + +/* + * Types and macros for handling bitmaps with one bit per virtual interface. + */ +typedef u_int32_t vifbitmap_t; +typedef u_short vifi_t; /* type of a vif index */ +#define ALL_VIFS (vifi_t)-1 + +#define VIFM_SET(n, m) ((m) |= (1 << (n))) +#define VIFM_CLR(n, m) ((m) &= ~(1 << (n))) +#define VIFM_ISSET(n, m) ((m) & (1 << (n))) +#define VIFM_CLRALL(m) ((m) = 0x00000000) +#define VIFM_COPY(mfrom, mto) ((mto) = (mfrom)) +#define VIFM_SAME(m1, m2) ((m1) == (m2)) + + +/* + * Argument structure for MRT_ADD_VIF. + * (MRT_DEL_VIF takes a single vifi_t argument.) + */ +struct vifctl { + vifi_t vifc_vifi; /* the index of the vif to be added */ + u_char vifc_flags; /* VIFF_ flags defined below */ + u_char vifc_threshold; /* min ttl required to forward on vif */ + u_int vifc_rate_limit; /* max rate */ + struct in_addr vifc_lcl_addr; /* local interface address */ + struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */ +}; + +#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */ +#define VIFF_SRCRT 0x2 /* tunnel uses IP source routing */ + +/* + * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC + * (mfcc_tos to be added at a future point) + */ +struct mfcctl { + struct in_addr mfcc_origin; /* ip origin of mcasts */ + struct in_addr mfcc_mcastgrp; /* multicast group associated*/ + vifi_t mfcc_parent; /* incoming vif */ + u_char mfcc_ttls[CONFIG_MAXVIFS]; /* forwarding ttls on vifs */ +}; + +/* + * The kernel's multicast routing statistics. + */ +struct mrtstat { + u_int32_t mrts_mfc_lookups; /* # forw. cache hash table hits */ + u_int32_t mrts_mfc_misses; /* # forw. cache hash table misses */ + u_int32_t mrts_upcalls; /* # calls to mrouted */ + u_int32_t mrts_no_route; /* no route for packet's origin */ + u_int32_t mrts_bad_tunnel; /* malformed tunnel options */ + u_int32_t mrts_cant_tunnel; /* no room for tunnel options */ + u_int32_t mrts_wrong_if; /* arrived on wrong interface */ + u_int32_t mrts_upq_ovflw; /* upcall Q overflow */ + u_int32_t mrts_cache_cleanups; /* # entries with no upcalls */ + u_int32_t mrts_drop_sel; /* pkts dropped selectively */ + u_int32_t mrts_q_overflow; /* pkts dropped - Q overflow */ + u_int32_t mrts_pkt2large; /* pkts dropped - size > BKT SIZE */ + u_int32_t mrts_upq_sockfull; /* upcalls dropped - socket full */ +}; + +/* + * Argument structure used by mrouted to get src-grp pkt counts + */ +struct sioc_sg_req { + struct in_addr src; + struct in_addr grp; + u_int32_t pktcnt; + u_int32_t bytecnt; + u_int32_t wrong_if; +}; + +/* + * Argument structure used by mrouted to get vif pkt counts + */ +struct sioc_vif_req { + vifi_t vifi; /* vif number */ + u_int32_t icount; /* Input packet count on vif */ + u_int32_t ocount; /* Output packet count on vif */ + u_int32_t ibytes; /* Input byte count on vif */ + u_int32_t obytes; /* Output byte count on vif */ +}; + + +/* + * The kernel's multicast forwarding cache entry structure + * (A field for the type of service (mfc_tos) is to be added + * at a future point) + */ +struct mfc { + struct in_addr mfc_origin; /* IP origin of mcasts */ + struct in_addr mfc_mcastgrp; /* multicast group associated*/ + vifi_t mfc_parent; /* incoming vif */ + u_char mfc_ttls[CONFIG_MAXVIFS]; /* forwarding ttls on vifs */ + u_int32_t mfc_pkt_cnt; /* pkt count for src-grp */ + u_int32_t mfc_byte_cnt; /* byte count for src-grp */ + u_int32_t mfc_wrong_if; /* wrong if for src-grp */ + int mfc_expire; /* time to clean entry up */ + struct timeval mfc_last_assert; /* last time I sent an assert*/ + struct rtdetq *mfc_stall; /* q of packets awaiting mfc */ + struct mfc *mfc_next; /* next mfc entry */ +}; + +/* + * Struct used to communicate from kernel to multicast router + * note the convenient similarity to an IP packet + */ +struct igmpmsg { + u_int32_t unused1; + u_int32_t unused2; + u_char im_msgtype; /* what type of message */ +#define IGMPMSG_NOCACHE 1 +#define IGMPMSG_WRONGVIF 2 + u_char im_mbz; /* must be zero */ + u_char im_vif; /* vif rec'd on */ + u_char unused3; + struct in_addr im_src, im_dst; +}; + +#define MFCTBLSIZ CONFIG_MFCTBLSIZ + +#endif /* _NETINET_IP_MROUTE_H_ */ diff --git a/i386/include/netinet/ip_var.h b/i386/include/netinet/ip_var.h new file mode 100644 index 0000000..891f33a --- /dev/null +++ b/i386/include/netinet/ip_var.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ip_var.h 8.2 (Berkeley) 1/9/95 + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2007 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _NETINET_IP_VAR_H_ +#define _NETINET_IP_VAR_H_ +#include <sys/appleapiopts.h> + +/* + * Overlay for ip header used by other protocols (tcp, udp). + */ +struct ipovly { + u_char ih_x1[9]; /* (unused) */ + u_char ih_pr; /* protocol */ + u_short ih_len; /* protocol length */ + struct in_addr ih_src; /* source internet address */ + struct in_addr ih_dst; /* destination internet address */ +}; + +#define MAX_IPOPTLEN 40 + +struct ipstat { + u_int32_t ips_total; /* total packets received */ + u_int32_t ips_badsum; /* checksum bad */ + u_int32_t ips_tooshort; /* packet too short */ + u_int32_t ips_toosmall; /* not enough data */ + u_int32_t ips_badhlen; /* ip header length < data size */ + u_int32_t ips_badlen; /* ip length < ip header length */ + u_int32_t ips_fragments; /* fragments received */ + u_int32_t ips_fragdropped; /* frags dropped (dups, out of space) */ + u_int32_t ips_fragtimeout; /* fragments timed out */ + u_int32_t ips_forward; /* packets forwarded */ + u_int32_t ips_fastforward; /* packets fast forwarded */ + u_int32_t ips_cantforward; /* packets rcvd for unreachable dest */ + u_int32_t ips_redirectsent; /* packets forwarded on same net */ + u_int32_t ips_noproto; /* unknown or unsupported protocol */ + u_int32_t ips_delivered; /* datagrams delivered to upper level*/ + u_int32_t ips_localout; /* total ip packets generated here */ + u_int32_t ips_odropped; /* lost packets due to nobufs, etc. */ + u_int32_t ips_reassembled; /* total packets reassembled ok */ + u_int32_t ips_fragmented; /* datagrams successfully fragmented */ + u_int32_t ips_ofragments; /* output fragments created */ + u_int32_t ips_cantfrag; /* don't fragment flag was set, etc. */ + u_int32_t ips_badoptions; /* error in option processing */ + u_int32_t ips_noroute; /* packets discarded due to no route */ + u_int32_t ips_badvers; /* ip version != 4 */ + u_int32_t ips_rawout; /* total raw ip packets generated */ + u_int32_t ips_toolong; /* ip length > max ip packet size */ + u_int32_t ips_notmember; /* multicasts for unregistered grps */ + u_int32_t ips_nogif; /* no match gif found */ + u_int32_t ips_badaddr; /* invalid address on header */ +}; + +struct ip_linklocal_stat { + u_int32_t iplls_in_total; + u_int32_t iplls_in_badttl; + u_int32_t iplls_out_total; + u_int32_t iplls_out_badttl; +}; + +#endif /* !_NETINET_IP_VAR_H_ */ diff --git a/i386/include/netinet/tcp.h b/i386/include/netinet/tcp.h new file mode 100644 index 0000000..3b4d8f9 --- /dev/null +++ b/i386/include/netinet/tcp.h @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $ + */ + +#ifndef _NETINET_TCP_H_ +#define _NETINET_TCP_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> +#include <machine/endian.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef __uint32_t tcp_seq; +typedef __uint32_t tcp_cc; /* connection count per rfc1644 */ + +#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */ +#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */ + +/* + * TCP header. + * Per RFC 793, September, 1981. + */ +struct tcphdr { + unsigned short th_sport; /* source port */ + unsigned short th_dport; /* destination port */ + tcp_seq th_seq; /* sequence number */ + tcp_seq th_ack; /* acknowledgement number */ +#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + unsigned int th_x2:4, /* (unused) */ + th_off:4; /* data offset */ +#endif +#if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN + unsigned int th_off:4, /* data offset */ + th_x2:4; /* (unused) */ +#endif + unsigned char th_flags; +#define TH_FIN 0x01 +#define TH_SYN 0x02 +#define TH_RST 0x04 +#define TH_PUSH 0x08 +#define TH_ACK 0x10 +#define TH_URG 0x20 +#define TH_ECE 0x40 +#define TH_CWR 0x80 +#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR) + + unsigned short th_win; /* window */ + unsigned short th_sum; /* checksum */ + unsigned short th_urp; /* urgent pointer */ +}; + +#define TCPOPT_EOL 0 +#define TCPOPT_NOP 1 +#define TCPOPT_MAXSEG 2 +#define TCPOLEN_MAXSEG 4 +#define TCPOPT_WINDOW 3 +#define TCPOLEN_WINDOW 3 +#define TCPOPT_SACK_PERMITTED 4 /* Experimental */ +#define TCPOLEN_SACK_PERMITTED 2 +#define TCPOPT_SACK 5 /* Experimental */ +#define TCPOLEN_SACK 8 /* len of sack block */ +#define TCPOPT_TIMESTAMP 8 +#define TCPOLEN_TIMESTAMP 10 +#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ +#define TCPOPT_TSTAMP_HDR \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) + +#define MAX_TCPOPTLEN 40 /* Absolute maximum TCP options len */ + +#define TCPOPT_CC 11 /* CC options: RFC-1644 */ +#define TCPOPT_CCNEW 12 +#define TCPOPT_CCECHO 13 +#define TCPOLEN_CC 6 +#define TCPOLEN_CC_APPA (TCPOLEN_CC+2) +#define TCPOPT_CC_HDR(ccopt) \ + (TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC) +#define TCPOPT_SIGNATURE 19 /* Keyed MD5: RFC 2385 */ +#define TCPOLEN_SIGNATURE 18 + +/* Option definitions */ +#define TCPOPT_SACK_PERMIT_HDR \ +(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK_PERMITTED<<8|TCPOLEN_SACK_PERMITTED) +#define TCPOPT_SACK_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_SACK<<8) +/* Miscellaneous constants */ +#define MAX_SACK_BLKS 6 /* Max # SACK blocks stored at sender side */ +#define TCP_MAX_SACK 3 /* MAX # SACKs sent in any segment */ + + +/* + * Default maximum segment size for TCP. + * With an IP MTU of 576, this is 536, + * but 512 is probably more convenient. + * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). + */ +#define TCP_MSS 512 + +/* + * TCP_MINMSS is defined to be 216 which is fine for the smallest + * link MTU (256 bytes, SLIP interface) in the Internet. + * However it is very unlikely to come across such low MTU interfaces + * these days (anno dato 2004). + * Probably it can be set to 512 without ill effects. But we play safe. + * See tcp_subr.c tcp_minmss SYSCTL declaration for more comments. + * Setting this to "0" disables the minmss check. + */ +#define TCP_MINMSS 216 + +/* + * TCP_MINMSSOVERLOAD is defined to be 1000 which should cover any type + * of interactive TCP session. + * See tcp_subr.c tcp_minmssoverload SYSCTL declaration and tcp_input.c + * for more comments. + * Setting this to "0" disables the minmssoverload check. + */ +#define TCP_MINMSSOVERLOAD 1000 + +/* + * Default maximum segment size for TCP6. + * With an IP6 MSS of 1280, this is 1220, + * but 1024 is probably more convenient. (xxx kazu in doubt) + * This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr)) + */ +#define TCP6_MSS 1024 + +#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ +#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */ + +#define TCP_MAX_WINSHIFT 14 /* maximum window shift */ + +#define TCP_MAXBURST 4 /* maximum segments in a burst */ + +#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */ +#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr)) + /* max space left for options */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * User-settable options (used with setsockopt). + */ +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define TCP_MAXSEG 0x02 /* set maximum segment size */ +#define TCP_NOPUSH 0x04 /* don't push last block of write */ +#define TCP_NOOPT 0x08 /* don't use TCP options */ +#define TCP_KEEPALIVE 0x10 /* idle time used when SO_KEEPALIVE is enabled */ +#define TCP_CONNECTIONTIMEOUT 0x20 /* connection timeout */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#endif diff --git a/i386/include/netinet/tcp_fsm.h b/i386/include/netinet/tcp_fsm.h new file mode 100644 index 0000000..aaa7196 --- /dev/null +++ b/i386/include/netinet/tcp_fsm.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_fsm.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp_fsm.h,v 1.14 1999/11/07 04:18:30 jlemon Exp $ + */ + +#ifndef _NETINET_TCP_FSM_H_ +#define _NETINET_TCP_FSM_H_ +#include <sys/appleapiopts.h> + +/* + * TCP FSM state definitions. + * Per RFC793, September, 1981. + */ + +#define TCP_NSTATES 11 + +#define TCPS_CLOSED 0 /* closed */ +#define TCPS_LISTEN 1 /* listening for connection */ +#define TCPS_SYN_SENT 2 /* active, have sent syn */ +#define TCPS_SYN_RECEIVED 3 /* have send and received syn */ +/* states < TCPS_ESTABLISHED are those where connections not established */ +#define TCPS_ESTABLISHED 4 /* established */ +#define TCPS_CLOSE_WAIT 5 /* rcvd fin, waiting for close */ +/* states > TCPS_CLOSE_WAIT are those where user has closed */ +#define TCPS_FIN_WAIT_1 6 /* have closed, sent fin */ +#define TCPS_CLOSING 7 /* closed xchd FIN; await FIN ACK */ +#define TCPS_LAST_ACK 8 /* had fin and close; await FIN ACK */ +/* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */ +#define TCPS_FIN_WAIT_2 9 /* have closed, fin is acked */ +#define TCPS_TIME_WAIT 10 /* in 2*msl quiet wait after close */ + +/* for KAME src sync over BSD*'s */ +#define TCP6_NSTATES TCP_NSTATES +#define TCP6S_CLOSED TCPS_CLOSED +#define TCP6S_LISTEN TCPS_LISTEN +#define TCP6S_SYN_SENT TCPS_SYN_SENT +#define TCP6S_SYN_RECEIVED TCPS_SYN_RECEIVED +#define TCP6S_ESTABLISHED TCPS_ESTABLISHED +#define TCP6S_CLOSE_WAIT TCPS_CLOSE_WAIT +#define TCP6S_FIN_WAIT_1 TCPS_FIN_WAIT_1 +#define TCP6S_CLOSING TCPS_CLOSING +#define TCP6S_LAST_ACK TCPS_LAST_ACK +#define TCP6S_FIN_WAIT_2 TCPS_FIN_WAIT_2 +#define TCP6S_TIME_WAIT TCPS_TIME_WAIT + +#define TCPS_HAVERCVDSYN(s) ((s) >= TCPS_SYN_RECEIVED) +#define TCPS_HAVEESTABLISHED(s) ((s) >= TCPS_ESTABLISHED) +#define TCPS_HAVERCVDFIN(s) ((s) >= TCPS_TIME_WAIT) + + +#if KPROF +#endif + +#ifdef TCPSTATES +char *tcpstates[] = { + "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", + "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING", + "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT" +}; +#endif + +#endif diff --git a/i386/include/netinet/tcp_seq.h b/i386/include/netinet/tcp_seq.h new file mode 100644 index 0000000..6494e58 --- /dev/null +++ b/i386/include/netinet/tcp_seq.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_seq.h 8.3 (Berkeley) 6/21/95 + * $FreeBSD: src/sys/netinet/tcp_seq.h,v 1.11.2.5 2001/08/22 00:59:12 silby Exp $ + */ + +#ifndef _NETINET_TCP_SEQ_H_ +#define _NETINET_TCP_SEQ_H_ +#include <sys/appleapiopts.h> +/* + * TCP sequence numbers are 32 bit integers operated + * on with modular arithmetic. These macros can be + * used to compare such integers. + */ +#define SEQ_LT(a,b) ((int)((a)-(b)) < 0) +#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define SEQ_GT(a,b) ((int)((a)-(b)) > 0) +#define SEQ_GEQ(a,b) ((int)((a)-(b)) >= 0) + +#define SEQ_MIN(a, b) ((SEQ_LT(a, b)) ? (a) : (b)) +#define SEQ_MAX(a, b) ((SEQ_GT(a, b)) ? (a) : (b)) + +/* for modulo comparisons of timestamps */ +#define TSTMP_LT(a,b) ((int)((a)-(b)) < 0) +#define TSTMP_GEQ(a,b) ((int)((a)-(b)) >= 0) + +/* + * TCP connection counts are 32 bit integers operated + * on with modular arithmetic. These macros can be + * used to compare such integers. + */ +#define CC_LT(a,b) ((int)((a)-(b)) < 0) +#define CC_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define CC_GT(a,b) ((int)((a)-(b)) > 0) +#define CC_GEQ(a,b) ((int)((a)-(b)) >= 0) + +/* Macro to increment a CC: skip 0 which has a special meaning */ +#define CC_INC(c) (++(c) == 0 ? ++(c) : (c)) + +#endif /* _NETINET_TCP_SEQ_H_ */ diff --git a/i386/include/netinet/tcp_timer.h b/i386/include/netinet/tcp_timer.h new file mode 100644 index 0000000..90f46d0 --- /dev/null +++ b/i386/include/netinet/tcp_timer.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_timer.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcp_timer.h,v 1.18 1999/12/29 04:41:03 peter Exp $ + */ + +#ifndef _NETINET_TCP_TIMER_H_ +#define _NETINET_TCP_TIMER_H_ +#include <sys/appleapiopts.h> + +/* + * Definitions of the TCP timers. These timers are counted + * down PR_SLOWHZ times a second. + */ +#define TCPT_NTIMERS 4 + +#define TCPT_REXMT 0 /* retransmit */ +#define TCPT_PERSIST 1 /* retransmit persistence */ +#define TCPT_KEEP 2 /* keep alive */ +#define TCPT_2MSL 3 /* 2*msl quiet time timer */ + +/* + * The TCPT_REXMT timer is used to force retransmissions. + * The TCP has the TCPT_REXMT timer set whenever segments + * have been sent for which ACKs are expected but not yet + * received. If an ACK is received which advances tp->snd_una, + * then the retransmit timer is cleared (if there are no more + * outstanding segments) or reset to the base value (if there + * are more ACKs expected). Whenever the retransmit timer goes off, + * we retransmit one unacknowledged segment, and do a backoff + * on the retransmit timer. + * + * The TCPT_PERSIST timer is used to keep window size information + * flowing even if the window goes shut. If all previous transmissions + * have been acknowledged (so that there are no retransmissions in progress), + * and the window is too small to bother sending anything, then we start + * the TCPT_PERSIST timer. When it expires, if the window is nonzero, + * we go to transmit state. Otherwise, at intervals send a single byte + * into the peer's window to force him to update our window information. + * We do this at most as often as TCPT_PERSMIN time intervals, + * but no more frequently than the current estimate of round-trip + * packet time. The TCPT_PERSIST timer is cleared whenever we receive + * a window update from the peer. + * + * The TCPT_KEEP timer is used to keep connections alive. If an + * connection is idle (no segments received) for TCPTV_KEEP_INIT amount of time, + * but not yet established, then we drop the connection. Once the connection + * is established, if the connection is idle for TCPTV_KEEP_IDLE time + * (and keepalives have been enabled on the socket), we begin to probe + * the connection. We force the peer to send us a segment by sending: + * <SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK> + * This segment is (deliberately) outside the window, and should elicit + * an ack segment in response from the peer. If, despite the TCPT_KEEP + * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE + * amount of time probing, then we drop the connection. + */ + +#endif /* !_NETINET_TCP_TIMER_H_ */ + diff --git a/i386/include/netinet/tcp_var.h b/i386/include/netinet/tcp_var.h new file mode 100644 index 0000000..1cb4847 --- /dev/null +++ b/i386/include/netinet/tcp_var.h @@ -0,0 +1,413 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993, 1994, 1995 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcp_var.h 8.4 (Berkeley) 5/24/95 + * $FreeBSD: src/sys/netinet/tcp_var.h,v 1.56.2.8 2001/08/22 00:59:13 silby Exp $ + */ + +#ifndef _NETINET_TCP_VAR_H_ +#define _NETINET_TCP_VAR_H_ +#include <sys/appleapiopts.h> +#include <sys/queue.h> +#include <netinet/in_pcb.h> +#include <netinet/tcp_timer.h> + +#if defined(__LP64__) +#define _TCPCB_PTR(x) u_int32_t +#define _TCPCB_LIST_HEAD(name, type) \ +struct name { \ + u_int32_t lh_first; \ +}; +#else +#define _TCPCB_PTR(x) x +#define _TCPCB_LIST_HEAD(name, type) LIST_HEAD(name, type) +#endif + +#define TCP_RETRANSHZ 10 /* tcp retrans timer (100ms) per hz */ + +struct tseg_qent; +_TCPCB_LIST_HEAD(tsegqe_head, tseg_qent); + +struct tcpcb { + struct tsegqe_head t_segq; + int t_dupacks; /* consecutive dup acks recd */ + u_int32_t unused; /* unused now: was t_template */ + + int t_timer[TCPT_NTIMERS]; /* tcp timers */ + + _TCPCB_PTR(struct inpcb *) t_inpcb; /* back pointer to internet pcb */ + int t_state; /* state of this connection */ + u_int t_flags; +#define TF_ACKNOW 0x00001 /* ack peer immediately */ +#define TF_DELACK 0x00002 /* ack, but try to delay it */ +#define TF_NODELAY 0x00004 /* don't delay packets to coalesce */ +#define TF_NOOPT 0x00008 /* don't use tcp options */ +#define TF_SENTFIN 0x00010 /* have sent FIN */ +#define TF_REQ_SCALE 0x00020 /* have/will request window scaling */ +#define TF_RCVD_SCALE 0x00040 /* other side has requested scaling */ +#define TF_REQ_TSTMP 0x00080 /* have/will request timestamps */ +#define TF_RCVD_TSTMP 0x00100 /* a timestamp was received in SYN */ +#define TF_SACK_PERMIT 0x00200 /* other side said I could SACK */ +#define TF_NEEDSYN 0x00400 /* send SYN (implicit state) */ +#define TF_NEEDFIN 0x00800 /* send FIN (implicit state) */ +#define TF_NOPUSH 0x01000 /* don't push */ +#define TF_REQ_CC 0x02000 /* have/will request CC */ +#define TF_RCVD_CC 0x04000 /* a CC was received in SYN */ +#define TF_SENDCCNEW 0x08000 /* send CCnew instead of CC in SYN */ +#define TF_MORETOCOME 0x10000 /* More data to be appended to sock */ +#define TF_LQ_OVERFLOW 0x20000 /* listen queue overflow */ +#define TF_RXWIN0SENT 0x40000 /* sent a receiver win 0 in response */ +#define TF_SLOWLINK 0x80000 /* route is a on a modem speed link */ + + int t_force; /* 1 if forcing out a byte */ + + tcp_seq snd_una; /* send unacknowledged */ + tcp_seq snd_max; /* highest sequence number sent; + * used to recognize retransmits + */ + tcp_seq snd_nxt; /* send next */ + tcp_seq snd_up; /* send urgent pointer */ + + tcp_seq snd_wl1; /* window update seg seq number */ + tcp_seq snd_wl2; /* window update seg ack number */ + tcp_seq iss; /* initial send sequence number */ + tcp_seq irs; /* initial receive sequence number */ + + tcp_seq rcv_nxt; /* receive next */ + tcp_seq rcv_adv; /* advertised window */ + u_int32_t rcv_wnd; /* receive window */ + tcp_seq rcv_up; /* receive urgent pointer */ + + u_int32_t snd_wnd; /* send window */ + u_int32_t snd_cwnd; /* congestion-controlled window */ + u_int32_t snd_ssthresh; /* snd_cwnd size threshold for + * for slow start exponential to + * linear switch + */ + u_int t_maxopd; /* mss plus options */ + + u_int32_t t_rcvtime; /* inactivity time */ + u_int32_t t_starttime; /* time connection was established */ + int t_rtttime; /* round trip time */ + tcp_seq t_rtseq; /* sequence number being timed */ + + int t_rxtcur; /* current retransmit value (ticks) */ + u_int t_maxseg; /* maximum segment size */ + int t_srtt; /* smoothed round-trip time */ + int t_rttvar; /* variance in round-trip time */ + + int t_rxtshift; /* log(2) of rexmt exp. backoff */ + u_int t_rttmin; /* minimum rtt allowed */ + u_int32_t t_rttupdated; /* number of times rtt sampled */ + u_int32_t max_sndwnd; /* largest window peer has offered */ + + int t_softerror; /* possible error not yet reported */ +/* out-of-band data */ + char t_oobflags; /* have some */ + char t_iobc; /* input character */ +#define TCPOOB_HAVEDATA 0x01 +#define TCPOOB_HADDATA 0x02 +/* RFC 1323 variables */ + u_char snd_scale; /* window scaling for send window */ + u_char rcv_scale; /* window scaling for recv window */ + u_char request_r_scale; /* pending window scaling */ + u_char requested_s_scale; + u_int32_t ts_recent; /* timestamp echo data */ + + u_int32_t ts_recent_age; /* when last updated */ + tcp_seq last_ack_sent; +/* RFC 1644 variables */ + tcp_cc cc_send; /* send connection count */ + tcp_cc cc_recv; /* receive connection count */ + tcp_seq snd_recover; /* for use in fast recovery */ +/* experimental */ + u_int32_t snd_cwnd_prev; /* cwnd prior to retransmit */ + u_int32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ + u_int32_t t_badrxtwin; /* window for retransmit recovery */ +}; + + +/* + * TCP statistics. + * Many of these should be kept per connection, + * but that's inconvenient at the moment. + */ +struct tcpstat { + u_int32_t tcps_connattempt; /* connections initiated */ + u_int32_t tcps_accepts; /* connections accepted */ + u_int32_t tcps_connects; /* connections established */ + u_int32_t tcps_drops; /* connections dropped */ + u_int32_t tcps_conndrops; /* embryonic connections dropped */ + u_int32_t tcps_closed; /* conn. closed (includes drops) */ + u_int32_t tcps_segstimed; /* segs where we tried to get rtt */ + u_int32_t tcps_rttupdated; /* times we succeeded */ + u_int32_t tcps_delack; /* delayed acks sent */ + u_int32_t tcps_timeoutdrop; /* conn. dropped in rxmt timeout */ + u_int32_t tcps_rexmttimeo; /* retransmit timeouts */ + u_int32_t tcps_persisttimeo; /* persist timeouts */ + u_int32_t tcps_keeptimeo; /* keepalive timeouts */ + u_int32_t tcps_keepprobe; /* keepalive probes sent */ + u_int32_t tcps_keepdrops; /* connections dropped in keepalive */ + + u_int32_t tcps_sndtotal; /* total packets sent */ + u_int32_t tcps_sndpack; /* data packets sent */ + u_int32_t tcps_sndbyte; /* data bytes sent */ + u_int32_t tcps_sndrexmitpack; /* data packets retransmitted */ + u_int32_t tcps_sndrexmitbyte; /* data bytes retransmitted */ + u_int32_t tcps_sndacks; /* ack-only packets sent */ + u_int32_t tcps_sndprobe; /* window probes sent */ + u_int32_t tcps_sndurg; /* packets sent with URG only */ + u_int32_t tcps_sndwinup; /* window update-only packets sent */ + u_int32_t tcps_sndctrl; /* control (SYN|FIN|RST) packets sent */ + + u_int32_t tcps_rcvtotal; /* total packets received */ + u_int32_t tcps_rcvpack; /* packets received in sequence */ + u_int32_t tcps_rcvbyte; /* bytes received in sequence */ + u_int32_t tcps_rcvbadsum; /* packets received with ccksum errs */ + u_int32_t tcps_rcvbadoff; /* packets received with bad offset */ + u_int32_t tcps_rcvmemdrop; /* packets dropped for lack of memory */ + u_int32_t tcps_rcvshort; /* packets received too short */ + u_int32_t tcps_rcvduppack; /* duplicate-only packets received */ + u_int32_t tcps_rcvdupbyte; /* duplicate-only bytes received */ + u_int32_t tcps_rcvpartduppack; /* packets with some duplicate data */ + u_int32_t tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */ + u_int32_t tcps_rcvoopack; /* out-of-order packets received */ + u_int32_t tcps_rcvoobyte; /* out-of-order bytes received */ + u_int32_t tcps_rcvpackafterwin; /* packets with data after window */ + u_int32_t tcps_rcvbyteafterwin; /* bytes rcvd after window */ + u_int32_t tcps_rcvafterclose; /* packets rcvd after "close" */ + u_int32_t tcps_rcvwinprobe; /* rcvd window probe packets */ + u_int32_t tcps_rcvdupack; /* rcvd duplicate acks */ + u_int32_t tcps_rcvacktoomuch; /* rcvd acks for unsent data */ + u_int32_t tcps_rcvackpack; /* rcvd ack packets */ + u_int32_t tcps_rcvackbyte; /* bytes acked by rcvd acks */ + u_int32_t tcps_rcvwinupd; /* rcvd window update packets */ + u_int32_t tcps_pawsdrop; /* segments dropped due to PAWS */ + u_int32_t tcps_predack; /* times hdr predict ok for acks */ + u_int32_t tcps_preddat; /* times hdr predict ok for data pkts */ + u_int32_t tcps_pcbcachemiss; + u_int32_t tcps_cachedrtt; /* times cached RTT in route updated */ + u_int32_t tcps_cachedrttvar; /* times cached rttvar updated */ + u_int32_t tcps_cachedssthresh; /* times cached ssthresh updated */ + u_int32_t tcps_usedrtt; /* times RTT initialized from route */ + u_int32_t tcps_usedrttvar; /* times RTTVAR initialized from rt */ + u_int32_t tcps_usedssthresh; /* times ssthresh initialized from rt*/ + u_int32_t tcps_persistdrop; /* timeout in persist state */ + u_int32_t tcps_badsyn; /* bogus SYN, e.g. premature ACK */ + u_int32_t tcps_mturesent; /* resends due to MTU discovery */ + u_int32_t tcps_listendrop; /* listen queue overflows */ + + /* new stats from FreeBSD 5.4 sync up */ + u_int32_t tcps_minmssdrops; /* average minmss too low drops */ + u_int32_t tcps_sndrexmitbad; /* unnecessary packet retransmissions */ + u_int32_t tcps_badrst; /* ignored RSTs in the window */ + + u_int32_t tcps_sc_added; /* entry added to syncache */ + u_int32_t tcps_sc_retransmitted; /* syncache entry was retransmitted */ + u_int32_t tcps_sc_dupsyn; /* duplicate SYN packet */ + u_int32_t tcps_sc_dropped; /* could not reply to packet */ + u_int32_t tcps_sc_completed; /* successful extraction of entry */ + u_int32_t tcps_sc_bucketoverflow; /* syncache per-bucket limit hit */ + u_int32_t tcps_sc_cacheoverflow; /* syncache cache limit hit */ + u_int32_t tcps_sc_reset; /* RST removed entry from syncache */ + u_int32_t tcps_sc_stale; /* timed out or listen socket gone */ + u_int32_t tcps_sc_aborted; /* syncache entry aborted */ + u_int32_t tcps_sc_badack; /* removed due to bad ACK */ + u_int32_t tcps_sc_unreach; /* ICMP unreachable received */ + u_int32_t tcps_sc_zonefail; /* zalloc() failed */ + u_int32_t tcps_sc_sendcookie; /* SYN cookie sent */ + u_int32_t tcps_sc_recvcookie; /* SYN cookie received */ + + u_int32_t tcps_hc_added; /* entry added to hostcache */ + u_int32_t tcps_hc_bucketoverflow; /* hostcache per bucket limit hit */ + + /* SACK related stats */ + u_int32_t tcps_sack_recovery_episode; /* SACK recovery episodes */ + u_int32_t tcps_sack_rexmits; /* SACK rexmit segments */ + u_int32_t tcps_sack_rexmit_bytes; /* SACK rexmit bytes */ + u_int32_t tcps_sack_rcv_blocks; /* SACK blocks (options) received */ + u_int32_t tcps_sack_send_blocks; /* SACK blocks (options) sent */ + u_int32_t tcps_sack_sboverflow; /* SACK sendblock overflow */ + +#if TRAFFIC_MGT + u_int32_t tcps_bg_rcvtotal; /* total background packets received */ +#endif /* TRAFFIC_MGT */ +}; + +#pragma pack(4) + +/* + * TCB structure exported to user-land via sysctl(3). + * Evil hack: declare only if in_pcb.h and sys/socketvar.h have been + * included. Not all of our clients do. + */ + +struct xtcpcb { + u_int32_t xt_len; + struct inpcb xt_inp; + struct tcpcb xt_tp; + struct xsocket xt_socket; + u_quad_t xt_alignment_hack; +}; + +#if !CONFIG_EMBEDDED + +struct xtcpcb64 { + u_int32_t xt_len; + struct xinpcb64 xt_inpcb; + + u_int64_t t_segq; + int t_dupacks; /* consecutive dup acks recd */ + + int t_timer[TCPT_NTIMERS]; /* tcp timers */ + + int t_state; /* state of this connection */ + u_int t_flags; + + int t_force; /* 1 if forcing out a byte */ + + tcp_seq snd_una; /* send unacknowledged */ + tcp_seq snd_max; /* highest sequence number sent; + * used to recognize retransmits + */ + tcp_seq snd_nxt; /* send next */ + tcp_seq snd_up; /* send urgent pointer */ + + tcp_seq snd_wl1; /* window update seg seq number */ + tcp_seq snd_wl2; /* window update seg ack number */ + tcp_seq iss; /* initial send sequence number */ + tcp_seq irs; /* initial receive sequence number */ + + tcp_seq rcv_nxt; /* receive next */ + tcp_seq rcv_adv; /* advertised window */ + u_int32_t rcv_wnd; /* receive window */ + tcp_seq rcv_up; /* receive urgent pointer */ + + u_int32_t snd_wnd; /* send window */ + u_int32_t snd_cwnd; /* congestion-controlled window */ + u_int32_t snd_ssthresh; /* snd_cwnd size threshold for + * for slow start exponential to + * linear switch + */ + u_int t_maxopd; /* mss plus options */ + + u_int32_t t_rcvtime; /* inactivity time */ + u_int32_t t_starttime; /* time connection was established */ + int t_rtttime; /* round trip time */ + tcp_seq t_rtseq; /* sequence number being timed */ + + int t_rxtcur; /* current retransmit value (ticks) */ + u_int t_maxseg; /* maximum segment size */ + int t_srtt; /* smoothed round-trip time */ + int t_rttvar; /* variance in round-trip time */ + + int t_rxtshift; /* log(2) of rexmt exp. backoff */ + u_int t_rttmin; /* minimum rtt allowed */ + u_int32_t t_rttupdated; /* number of times rtt sampled */ + u_int32_t max_sndwnd; /* largest window peer has offered */ + + int t_softerror; /* possible error not yet reported */ +/* out-of-band data */ + char t_oobflags; /* have some */ + char t_iobc; /* input character */ +/* RFC 1323 variables */ + u_char snd_scale; /* window scaling for send window */ + u_char rcv_scale; /* window scaling for recv window */ + u_char request_r_scale; /* pending window scaling */ + u_char requested_s_scale; + u_int32_t ts_recent; /* timestamp echo data */ + + u_int32_t ts_recent_age; /* when last updated */ + tcp_seq last_ack_sent; +/* RFC 1644 variables */ + tcp_cc cc_send; /* send connection count */ + tcp_cc cc_recv; /* receive connection count */ + tcp_seq snd_recover; /* for use in fast recovery */ +/* experimental */ + u_int32_t snd_cwnd_prev; /* cwnd prior to retransmit */ + u_int32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ + u_int32_t t_badrxtwin; /* window for retransmit recovery */ + + u_quad_t xt_alignment_hack; +}; + +#endif /* !CONFIG_EMBEDDED */ + +#pragma pack() + +/* + * Names for TCP sysctl objects + */ +#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */ +#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */ +#define TCPCTL_MSSDFLT 3 /* MSS default */ +#define TCPCTL_STATS 4 /* statistics (read-only) */ +#define TCPCTL_RTTDFLT 5 /* default RTT estimate */ +#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */ +#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ +#define TCPCTL_SENDSPACE 8 /* send buffer space */ +#define TCPCTL_RECVSPACE 9 /* receive buffer space */ +#define TCPCTL_KEEPINIT 10 /* timeout for establishing syn */ +#define TCPCTL_PCBLIST 11 /* list of all outstanding PCBs */ +#define TCPCTL_DELACKTIME 12 /* time before sending delayed ACK */ +#define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */ +#define TCPCTL_MAXID 14 + + +#endif /* _NETINET_TCP_VAR_H_ */ diff --git a/i386/include/netinet/tcpip.h b/i386/include/netinet/tcpip.h new file mode 100644 index 0000000..4868d6e --- /dev/null +++ b/i386/include/netinet/tcpip.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)tcpip.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD: src/sys/netinet/tcpip.h,v 1.8 1999/08/28 00:49:34 peter Exp $ + */ + +#ifndef _NETINET_TCPIP_H_ +#define _NETINET_TCPIP_H_ +#include <sys/appleapiopts.h> +#include <netinet/ip_var.h> +/* + * Tcp+ip header, after ip options removed. + */ +struct tcpiphdr { + struct ipovly ti_i; /* overlaid ip structure */ + struct tcphdr ti_t; /* tcp header */ +}; +#ifdef notyet +/* + * Tcp+ip header, after ip options removed but including TCP options. + */ +struct full_tcpiphdr { + struct ipovly ti_i; /* overlaid ip structure */ + struct tcphdr ti_t; /* tcp header */ + char ti_o[TCP_MAXOLEN]; /* space for tcp options */ +}; +#endif /* notyet */ +#define ti_x1 ti_i.ih_x1 +#define ti_pr ti_i.ih_pr +#define ti_len ti_i.ih_len +#define ti_src ti_i.ih_src +#define ti_dst ti_i.ih_dst +#define ti_sport ti_t.th_sport +#define ti_dport ti_t.th_dport +#define ti_seq ti_t.th_seq +#define ti_ack ti_t.th_ack +#define ti_x2 ti_t.th_x2 +#define ti_off ti_t.th_off +#define ti_flags ti_t.th_flags +#define ti_win ti_t.th_win +#define ti_sum ti_t.th_sum +#define ti_urp ti_t.th_urp + +#endif diff --git a/i386/include/netinet/udp.h b/i386/include/netinet/udp.h new file mode 100644 index 0000000..ef82a6f --- /dev/null +++ b/i386/include/netinet/udp.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)udp.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_UDP_H_ +#define _NETINET_UDP_H_ +#include <sys/appleapiopts.h> +#include <sys/types.h> /* u_short */ + +/* + * Udp protocol header. + * Per RFC 768, September, 1981. + */ +struct udphdr { + u_short uh_sport; /* source port */ + u_short uh_dport; /* destination port */ + u_short uh_ulen; /* udp length */ + u_short uh_sum; /* udp checksum */ +}; + +/* + * User-settable options (used with setsockopt). + */ +#define UDP_NOCKSUM 0x01 /* don't checksum outbound payloads */ +#endif diff --git a/i386/include/netinet/udp_var.h b/i386/include/netinet/udp_var.h new file mode 100644 index 0000000..5b6defa --- /dev/null +++ b/i386/include/netinet/udp_var.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)udp_var.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET_UDP_VAR_H_ +#define _NETINET_UDP_VAR_H_ +#include <sys/appleapiopts.h> + +#include <sys/sysctl.h> + +/* + * UDP kernel structures and variables. + */ +struct udpiphdr { + struct ipovly ui_i; /* overlaid ip structure */ + struct udphdr ui_u; /* udp header */ +}; +#define ui_x1 ui_i.ih_x1 +#define ui_pr ui_i.ih_pr +#define ui_len ui_i.ih_len +#define ui_src ui_i.ih_src +#define ui_dst ui_i.ih_dst +#define ui_sport ui_u.uh_sport +#define ui_dport ui_u.uh_dport +#define ui_ulen ui_u.uh_ulen +#define ui_sum ui_u.uh_sum +#define ui_next ui_i.ih_next +#define ui_prev ui_i.ih_prev + +struct udpstat { + /* input statistics: */ + u_int32_t udps_ipackets; /* total input packets */ + u_int32_t udps_hdrops; /* packet shorter than header */ + u_int32_t udps_badsum; /* checksum error */ + u_int32_t udps_badlen; /* data length larger than packet */ + u_int32_t udps_noport; /* no socket on port */ + u_int32_t udps_noportbcast; /* of above, arrived as broadcast */ + u_int32_t udps_fullsock; /* not delivered, input socket full */ + u_int32_t udpps_pcbcachemiss; /* input packets missing pcb cache */ + u_int32_t udpps_pcbhashmiss; /* input packets not for hashed pcb */ + /* output statistics: */ + u_int32_t udps_opackets; /* total output packets */ + u_int32_t udps_fastout; /* output packets on fast path */ +#ifndef __APPLE__ + u_int32_t udps_nosum; /* no checksum */ + /* of no socket on port, arrived as multicast */ + u_int32_t udps_noportmcast; +#endif +}; + +/* + * Names for UDP sysctl objects + */ +#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ +#define UDPCTL_STATS 2 /* statistics (read-only) */ +#define UDPCTL_MAXDGRAM 3 /* max datagram size */ +#define UDPCTL_RECVSPACE 4 /* default receive buffer space */ +#define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ +#define UDPCTL_MAXID 6 + +#endif /* _NETINET_UDP_VAR_H_ */ diff --git a/i386/include/netinet6/.svn/all-wcprops b/i386/include/netinet6/.svn/all-wcprops new file mode 100644 index 0000000..05877f4 --- /dev/null +++ b/i386/include/netinet6/.svn/all-wcprops @@ -0,0 +1,71 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6 +END +ip6_mroute.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/ip6_mroute.h +END +ip6_fw.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/ip6_fw.h +END +pim6.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/pim6.h +END +in6.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/in6.h +END +ipsec.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/ipsec.h +END +in6_var.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/in6_var.h +END +esp.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/esp.h +END +ipcomp.h +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/ipcomp.h +END +nd6.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/nd6.h +END +raw_ip6.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/raw_ip6.h +END +ah.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/netinet6/ah.h +END diff --git a/i386/include/netinet6/.svn/entries b/i386/include/netinet6/.svn/entries new file mode 100644 index 0000000..7e0639d --- /dev/null +++ b/i386/include/netinet6/.svn/entries @@ -0,0 +1,402 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/netinet6 +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ip6_mroute.h +file + + + + +2013-08-27T23:54:48.000000Z +9f43fe1579182eb05703d6a456127174 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7945 + +ip6_fw.h +file + + + + +2013-08-27T23:54:48.000000Z +559a97614cf7391fc7c29f74eb1ed45a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8920 + +pim6.h +file + + + + +2013-08-27T23:54:48.000000Z +508671d5d13fc21868223f1c3104d4e9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2708 + +in6.h +file + + + + +2013-08-27T23:54:48.000000Z +458e474d839f836f30db677bbefde922 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20315 + +ipsec.h +file + + + + +2013-08-27T23:54:48.000000Z +88f7d1d208eab842dc242f3709e23b93 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5301 + +in6_var.h +file + + + + +2013-08-27T23:54:48.000000Z +c5527981f3723b07ed37e61f4f643760 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18636 + +esp.h +file + + + + +2013-08-27T23:54:48.000000Z +b369efa50a81fa8dc55d42db31ba0e2c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4030 + +ipcomp.h +file + + + + +2013-08-27T23:54:48.000000Z +a0f9c148e2fc03e293e002aff08ab1a0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2306 + +nd6.h +file + + + + +2013-08-27T23:54:48.000000Z +69b6239e2b56aa4462db5643629461c4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6697 + +raw_ip6.h +file + + + + +2013-08-27T23:54:48.000000Z +39582900ef5446c53be3a48bffa0332f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3609 + +ah.h +file + + + + +2013-08-27T23:54:48.000000Z +21a0efff7294303a26021424f2f423a4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2456 + diff --git a/i386/include/netinet6/.svn/text-base/ah.h.svn-base b/i386/include/netinet6/.svn/text-base/ah.h.svn-base new file mode 100644 index 0000000..970fa44 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/ah.h.svn-base @@ -0,0 +1,59 @@ +/* $FreeBSD: src/sys/netinet6/ah.h,v 1.3.2.2 2001/07/03 11:01:49 ume Exp $ */ +/* $KAME: ah.h,v 1.13 2000/10/18 21:28:00 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * RFC1826/2402 authentication header. + */ + +#ifndef _NETINET6_AH_H_ +#define _NETINET6_AH_H_ +#include <sys/appleapiopts.h> + +struct ah { + u_int8_t ah_nxt; /* Next Header */ + u_int8_t ah_len; /* Length of data, in 32bit */ + u_int16_t ah_reserve; /* Reserved for future use */ + u_int32_t ah_spi; /* Security parameter index */ + /* variable size, 32bit bound*/ /* Authentication data */ +}; + +struct newah { + u_int8_t ah_nxt; /* Next Header */ + u_int8_t ah_len; /* Length of data + 1, in 32bit */ + u_int16_t ah_reserve; /* Reserved for future use */ + u_int32_t ah_spi; /* Security parameter index */ + u_int32_t ah_seq; /* Sequence number field */ + /* variable size, 32bit bound*/ /* Authentication data */ +}; + + +#endif /* _NETINET6_AH_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/esp.h.svn-base b/i386/include/netinet6/.svn/text-base/esp.h.svn-base new file mode 100644 index 0000000..f567746 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/esp.h.svn-base @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/esp.h,v 1.2.2.2 2001/07/03 11:01:49 ume Exp $ */ +/* $KAME: esp.h,v 1.16 2000/10/18 21:28:00 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * RFC1827/2406 Encapsulated Security Payload. + */ + +#ifndef _NETINET6_ESP_H_ +#define _NETINET6_ESP_H_ +#include <sys/appleapiopts.h> + + +struct esp { + u_int32_t esp_spi; /* ESP */ + /*variable size, 32bit bound*/ /* Initialization Vector */ + /*variable size*/ /* Payload data */ + /*variable size*/ /* padding */ + /*8bit*/ /* pad size */ + /*8bit*/ /* next header */ + /*8bit*/ /* next header */ + /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */ +}; + +struct newesp { + u_int32_t esp_spi; /* ESP */ + u_int32_t esp_seq; /* Sequence number */ + /*variable size*/ /* (IV and) Payload data */ + /*variable size*/ /* padding */ + /*8bit*/ /* pad size */ + /*8bit*/ /* next header */ + /*8bit*/ /* next header */ + /*variable size, 32bit bound*/ /* Authentication data */ +}; + +struct esptail { + u_int8_t esp_padlen; /* pad length */ + u_int8_t esp_nxt; /* Next header */ + /*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/ +}; + + +#endif /* _NETINET6_ESP_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/in6.h.svn-base b/i386/include/netinet6/.svn/text-base/in6.h.svn-base new file mode 100644 index 0000000..10bf2b2 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/in6.h.svn-base @@ -0,0 +1,513 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/in6.h,v 1.7.2.4 2001/07/04 09:45:23 ume Exp $ */ +/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in.h 8.3 (Berkeley) 1/3/94 + */ + +#ifndef __KAME_NETINET_IN_H_INCLUDED_ +#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" +#endif + +#ifndef _NETINET6_IN6_H_ +#define _NETINET6_IN6_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> + + +#ifndef _SA_FAMILY_T +#define _SA_FAMILY_T +typedef __uint8_t sa_family_t; +#endif + +/* + * Identification of the network protocol stack + * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE + * has the table of implementation/integration differences. + */ +#define __KAME__ +#define __KAME_VERSION "20010528/apple-darwin" + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Local port number conventions: + * + * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), + * unless a kernel is compiled with IPNOPRIVPORTS defined. + * + * When a user does a bind(2) or connect(2) with a port number of zero, + * a non-conflicting local port address is chosen. + * + * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although + * that is settable by sysctl(3); net.inet.ip.anonportmin and + * net.inet.ip.anonportmax respectively. + * + * A user may set the IPPROTO_IP option IP_PORTRANGE to change this + * default assignment range. + * + * The value IP_PORTRANGE_DEFAULT causes the default behavior. + * + * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, + * and exists only for FreeBSD compatibility purposes. + * + * The value IP_PORTRANGE_LOW changes the range to the "low" are + * that is (by convention) restricted to privileged processes. + * This convention is based on "vouchsafe" principles only. + * It is only secure if you trust the remote host to restrict these ports. + * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. + */ + +#define IPV6PORT_RESERVED 1024 +#define IPV6PORT_ANONMIN 49152 +#define IPV6PORT_ANONMAX 65535 +#define IPV6PORT_RESERVEDMIN 600 +#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * IPv6 address + */ +struct in6_addr { + union { + __uint8_t __u6_addr8[16]; + __uint16_t __u6_addr16[8]; + __uint32_t __u6_addr32[4]; + } __u6_addr; /* 128-bit IP6 address */ +}; + +#define s6_addr __u6_addr.__u6_addr8 + +#define INET6_ADDRSTRLEN 46 + +/* + * Socket address for IPv6 + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SIN6_LEN +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +struct sockaddr_in6 { + __uint8_t sin6_len; /* length of this struct(sa_family_t)*/ + sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ + in_port_t sin6_port; /* Transport layer port # (in_port_t)*/ + __uint32_t sin6_flowinfo; /* IP6 flow information */ + struct in6_addr sin6_addr; /* IP6 address */ + __uint32_t sin6_scope_id; /* scope zone index */ +}; + + + + +/* + * Definition of some useful macros to handle IP6 addresses + */ +#define IN6ADDR_ANY_INIT \ + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} +#define IN6ADDR_LOOPBACK_INIT \ + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IN6ADDR_NODELOCAL_ALLNODES_INIT \ + {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ + {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ + {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +extern const struct in6_addr in6addr_any; +extern const struct in6_addr in6addr_loopback; +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +extern const struct in6_addr in6addr_nodelocal_allnodes; +extern const struct in6_addr in6addr_linklocal_allnodes; +extern const struct in6_addr in6addr_linklocal_allrouters; +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Equality + * NOTE: Some of kernel programming environment (for example, openbsd/sparc) + * does not supply memcmp(). For userland memcmp() is preferred as it is + * in ANSI standard. + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IN6_ARE_ADDR_EQUAL(a, b) \ + (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + + +/* + * Unspecified + */ +#define IN6_IS_ADDR_UNSPECIFIED(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) + +/* + * Loopback + */ +#define IN6_IS_ADDR_LOOPBACK(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) + +/* + * IPv4 compatible + */ +#define IN6_IS_ADDR_V4COMPAT(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) + +/* + * Mapped + */ +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) + +/* + * KAME Scope Values + */ + +#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 +#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 +#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 +#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ +#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e + +/* + * Unicast Scope + * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). + */ +#define IN6_IS_ADDR_LINKLOCAL(a) \ + (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) +#define IN6_IS_ADDR_SITELOCAL(a) \ + (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) + +/* + * Multicast + */ +#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) + +#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) + +/* + * Multicast Scope + */ +#define IN6_IS_ADDR_MC_NODELOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) +#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) +#define IN6_IS_ADDR_MC_SITELOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) +#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) +#define IN6_IS_ADDR_MC_GLOBAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) + + +/* + * IP6 route structure + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Options for use with [gs]etsockopt at the IPV6 level. + * First word of comment is data type; bool is stored in int. + */ +/* no hdrincl */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#if 0 /* the followings are relic in IPv4 and hence are disabled */ +#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ +#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ +#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ +#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ +#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ +#endif /* 0 */ +#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ +#define IPV6_MULTICAST_IF 9 /* __uint8_t; set/get IP6 multicast i/f */ +#define IPV6_MULTICAST_HOPS 10 /* __uint8_t; set/get IP6 multicast hops */ +#define IPV6_MULTICAST_LOOP 11 /* __uint8_t; set/get IP6 mcast loopback */ +#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ +#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ +#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ +/* RFC2292 options */ +#define IPV6_PKTINFO 19 /* bool; send/recv if, src/dst addr */ +#define IPV6_HOPLIMIT 20 /* bool; hop limit */ +#define IPV6_NEXTHOP 21 /* bool; next hop addr */ +#define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */ +#define IPV6_DSTOPTS 23 /* bool; destination option */ +#define IPV6_RTHDR 24 /* bool; routing header */ +#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ + +#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPV6_BINDV6ONLY IPV6_V6ONLY + + +#if 1 /*IPSEC*/ +#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ +#endif /* 1 */ +#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ + +#if 1 /*IPV6FIREWALL*/ +#define IPV6_FW_ADD 30 /* add a firewall rule to chain */ +#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ +#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ +#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ +#define IPV6_FW_GET 34 /* get entire firewall rule chain */ +#endif /* 1 */ + +#define IPV6_RECVTCLASS 35 /* bool; recv traffic class values */ +#define IPV6_TCLASS 36 /* int; send traffic class value */ + +/* to define items, should talk with KAME guys first, for *BSD compatibility */ + +#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ +#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ +#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ + +/* + * Defaults and limits for options + */ +#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ +#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ + +/* + * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. + */ +struct ipv6_mreq { + struct in6_addr ipv6mr_multiaddr; + unsigned int ipv6mr_interface; +}; + +/* + * IPV6_PKTINFO: Packet information(RFC2292 sec 5) + */ +struct in6_pktinfo { + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ + unsigned int ipi6_ifindex; /* send/recv interface index */ +}; + +/* + * Argument for IPV6_PORTRANGE: + * - which range to search when port is unspecified at bind() or connect() + */ +#define IPV6_PORTRANGE_DEFAULT 0 /* default range */ +#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ +#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ + +/* + * Definitions for inet6 sysctl operations. + * + * Third level is protocol number. + * Fourth level is desired variable within that protocol. + */ +#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ + +/* + * Names for IP sysctl objects + */ +#define IPV6CTL_FORWARDING 1 /* act as router */ +#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ +#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ +#ifdef notyet +#define IPV6CTL_DEFMTU 4 /* default MTU */ +#endif +#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ +#define IPV6CTL_STATS 6 /* stats */ +#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ +#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ +#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ +#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ +#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ +#define IPV6CTL_ACCEPT_RTADV 12 +#define IPV6CTL_KEEPFAITH 13 +#define IPV6CTL_LOG_INTERVAL 14 +#define IPV6CTL_HDRNESTLIMIT 15 +#define IPV6CTL_DAD_COUNT 16 +#define IPV6CTL_AUTO_FLOWLABEL 17 +#define IPV6CTL_DEFMCASTHLIM 18 +#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ +#define IPV6CTL_KAME_VERSION 20 +#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ +#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ +#if 0 /*obsolete*/ +#define IPV6CTL_MAPPED_ADDR 23 +#endif +#define IPV6CTL_V6ONLY 24 +#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ +#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ +#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ + +#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ +#define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ +#define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ +#define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ +#define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ + +#define IPV6CTL_MAXFRAGS 41 /* max fragments */ + +#define IPV6CTL_NEIGHBORGCTHRESH 46 +#define IPV6CTL_MAXIFPREFIXES 47 +#define IPV6CTL_MAXIFDEFROUTERS 48 +#define IPV6CTL_MAXDYNROUTES 49 + +/* New entries should be added here from current IPV6CTL_MAXID value. */ +/* to define items, should talk with KAME guys first, for *BSD compatibility */ +#define IPV6CTL_MAXID 50 + + +__BEGIN_DECLS +struct cmsghdr; + +extern int inet6_option_space(int); +extern int inet6_option_init(void *, struct cmsghdr **, int); +extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, + int, int); +extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); +extern int inet6_option_next(const struct cmsghdr *, __uint8_t **); +extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int); + +extern size_t inet6_rthdr_space(int, int); +extern struct cmsghdr *inet6_rthdr_init(void *, int); +extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, + unsigned int); +extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); +#if 0 /* not implemented yet */ +extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); +#endif +extern int inet6_rthdr_segments(const struct cmsghdr *); +extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); +extern int inet6_rthdr_getflags(const struct cmsghdr *, int); + +extern int inet6_opt_init(void *, size_t); +extern int inet6_opt_append(void *, size_t, int, __uint8_t, + size_t, __uint8_t, void **); +extern int inet6_opt_finish(void *, size_t, int); +extern int inet6_opt_set_val(void *, size_t, void *, int); + +extern int inet6_opt_next(void *, size_t, int, __uint8_t *, + size_t *, void **); +extern int inet6_opt_find(void *, size_t, int, __uint8_t, + size_t *, void **); +extern int inet6_opt_get_val(void *, size_t, void *, int); +extern size_t inet6_rth_space(int, int); +extern void *inet6_rth_init(void *, int, int, int); +extern int inet6_rth_add(void *, const struct in6_addr *); +extern int inet6_rth_reverse(const void *, void *); +extern int inet6_rth_segments(const void *); +extern struct in6_addr *inet6_rth_getaddr(const void *, int); +__END_DECLS +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#endif /* !_NETINET6_IN6_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/in6_var.h.svn-base b/i386/include/netinet6/.svn/text-base/in6_var.h.svn-base new file mode 100644 index 0000000..275802c --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/in6_var.h.svn-base @@ -0,0 +1,466 @@ +/* + * Copyright (c) 2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/in6_var.h,v 1.3.2.2 2001/07/03 11:01:52 ume Exp $ */ +/* $KAME: in6_var.h,v 1.56 2001/03/29 05:34:31 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1985, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_var.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET6_IN6_VAR_H_ +#define _NETINET6_IN6_VAR_H_ +#include <sys/appleapiopts.h> + +#ifdef __APPLE__ +#include <sys/kern_event.h> +#endif + +/* + * pltime/vltime are just for future reference (required to implements 2 + * hour rule for hosts). they should never be modified by nd6_timeout or + * anywhere else. + * userland -> kernel: accept pltime/vltime + * kernel -> userland: throw up everything + * in kernel: modify preferred/expire only + */ +struct in6_addrlifetime { + time_t ia6t_expire; /* valid lifetime expiration time */ + time_t ia6t_preferred; /* preferred lifetime expiration time */ + u_int32_t ia6t_vltime; /* valid lifetime */ + u_int32_t ia6t_pltime; /* prefix lifetime */ +}; + + +/* + * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12). + */ +struct in6_ifstat { + u_quad_t ifs6_in_receive; /* # of total input datagram */ + u_quad_t ifs6_in_hdrerr; /* # of datagrams with invalid hdr */ + u_quad_t ifs6_in_toobig; /* # of datagrams exceeded MTU */ + u_quad_t ifs6_in_noroute; /* # of datagrams with no route */ + u_quad_t ifs6_in_addrerr; /* # of datagrams with invalid dst */ + u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_in_truncated; /* # of truncated datagrams */ + u_quad_t ifs6_in_discard; /* # of discarded datagrams */ + /* NOTE: fragment timeout is not here */ + u_quad_t ifs6_in_deliver; /* # of datagrams delivered to ULP */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_out_forward; /* # of datagrams forwarded */ + /* NOTE: increment on outgoing if */ + u_quad_t ifs6_out_request; /* # of outgoing datagrams from ULP */ + /* NOTE: does not include forwrads */ + u_quad_t ifs6_out_discard; /* # of discarded datagrams */ + u_quad_t ifs6_out_fragok; /* # of datagrams fragmented */ + u_quad_t ifs6_out_fragfail; /* # of datagrams failed on fragment */ + u_quad_t ifs6_out_fragcreat; /* # of fragment datagrams */ + /* NOTE: this is # after fragment */ + u_quad_t ifs6_reass_reqd; /* # of incoming fragmented packets */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_reass_ok; /* # of reassembled packets */ + /* NOTE: this is # after reass */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_reass_fail; /* # of reass failures */ + /* NOTE: may not be packet count */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_in_mcast; /* # of inbound multicast datagrams */ + u_quad_t ifs6_out_mcast; /* # of outbound multicast datagrams */ +}; + +/* + * ICMPv6 interface statistics, as defined in RFC2466 Ipv6IfIcmpEntry. + * XXX: I'm not sure if this file is the right place for this structure... + */ +struct icmp6_ifstat { + /* + * Input statistics + */ + /* ipv6IfIcmpInMsgs, total # of input messages */ + u_quad_t ifs6_in_msg; + /* ipv6IfIcmpInErrors, # of input error messages */ + u_quad_t ifs6_in_error; + /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */ + u_quad_t ifs6_in_dstunreach; + /* ipv6IfIcmpInAdminProhibs, # of input administratively prohibited errs */ + u_quad_t ifs6_in_adminprohib; + /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */ + u_quad_t ifs6_in_timeexceed; + /* ipv6IfIcmpInParmProblems, # of input parameter problem errors */ + u_quad_t ifs6_in_paramprob; + /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */ + u_quad_t ifs6_in_pkttoobig; + /* ipv6IfIcmpInEchos, # of input echo requests */ + u_quad_t ifs6_in_echo; + /* ipv6IfIcmpInEchoReplies, # of input echo replies */ + u_quad_t ifs6_in_echoreply; + /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */ + u_quad_t ifs6_in_routersolicit; + /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */ + u_quad_t ifs6_in_routeradvert; + /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */ + u_quad_t ifs6_in_neighborsolicit; + /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advertisements */ + u_quad_t ifs6_in_neighboradvert; + /* ipv6IfIcmpInRedirects, # of input redirects */ + u_quad_t ifs6_in_redirect; + /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */ + u_quad_t ifs6_in_mldquery; + /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */ + u_quad_t ifs6_in_mldreport; + /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */ + u_quad_t ifs6_in_mlddone; + + /* + * Output statistics. We should solve unresolved routing problem... + */ + /* ipv6IfIcmpOutMsgs, total # of output messages */ + u_quad_t ifs6_out_msg; + /* ipv6IfIcmpOutErrors, # of output error messages */ + u_quad_t ifs6_out_error; + /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */ + u_quad_t ifs6_out_dstunreach; + /* ipv6IfIcmpOutAdminProhibs, # of output administratively prohibited errs */ + u_quad_t ifs6_out_adminprohib; + /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */ + u_quad_t ifs6_out_timeexceed; + /* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */ + u_quad_t ifs6_out_paramprob; + /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */ + u_quad_t ifs6_out_pkttoobig; + /* ipv6IfIcmpOutEchos, # of output echo requests */ + u_quad_t ifs6_out_echo; + /* ipv6IfIcmpOutEchoReplies, # of output echo replies */ + u_quad_t ifs6_out_echoreply; + /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */ + u_quad_t ifs6_out_routersolicit; + /* ipv6IfIcmpOutRouterAdvertisements, # of output router advertisements */ + u_quad_t ifs6_out_routeradvert; + /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */ + u_quad_t ifs6_out_neighborsolicit; + /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advertisements */ + u_quad_t ifs6_out_neighboradvert; + /* ipv6IfIcmpOutRedirects, # of output redirects */ + u_quad_t ifs6_out_redirect; + /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */ + u_quad_t ifs6_out_mldquery; + /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */ + u_quad_t ifs6_out_mldreport; + /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */ + u_quad_t ifs6_out_mlddone; +}; + +struct in6_ifreq { + char ifr_name[IFNAMSIZ]; + union { + struct sockaddr_in6 ifru_addr; + struct sockaddr_in6 ifru_dstaddr; + short ifru_flags; + int ifru_flags6; + int ifru_metric; + caddr_t ifru_data; + struct in6_addrlifetime ifru_lifetime; + struct in6_ifstat ifru_stat; + struct icmp6_ifstat ifru_icmp6stat; + u_int32_t ifru_scope_id[16]; + } ifr_ifru; +}; + +struct in6_aliasreq { + char ifra_name[IFNAMSIZ]; + struct sockaddr_in6 ifra_addr; + struct sockaddr_in6 ifra_dstaddr; + struct sockaddr_in6 ifra_prefixmask; + int ifra_flags; + struct in6_addrlifetime ifra_lifetime; +}; + + +/* prefix type macro */ +#define IN6_PREFIX_ND 1 +#define IN6_PREFIX_RR 2 + +/* + * prefix related flags passed between kernel(NDP related part) and + * user land command(ifconfig) and daemon(rtadvd). + */ +struct in6_prflags { + struct prf_ra { + u_char onlink : 1; + u_char autonomous : 1; + u_char reserved : 6; + } prf_ra; + u_char prf_reserved1; + u_short prf_reserved2; + /* want to put this on 4byte offset */ + struct prf_rr { + u_char decrvalid : 1; + u_char decrprefd : 1; + u_char reserved : 6; + } prf_rr; + u_char prf_reserved3; + u_short prf_reserved4; +}; + +struct in6_prefixreq { + char ipr_name[IFNAMSIZ]; + u_char ipr_origin; + u_char ipr_plen; + u_int32_t ipr_vltime; + u_int32_t ipr_pltime; + struct in6_prflags ipr_flags; + struct sockaddr_in6 ipr_prefix; +}; + +#define PR_ORIG_RA 0 +#define PR_ORIG_RR 1 +#define PR_ORIG_STATIC 2 +#define PR_ORIG_KERNEL 3 + +#define ipr_raf_onlink ipr_flags.prf_ra.onlink +#define ipr_raf_auto ipr_flags.prf_ra.autonomous + +#define ipr_statef_onlink ipr_flags.prf_state.onlink + +#define ipr_rrf_decrvalid ipr_flags.prf_rr.decrvalid +#define ipr_rrf_decrprefd ipr_flags.prf_rr.decrprefd + +struct in6_rrenumreq { + char irr_name[IFNAMSIZ]; + u_char irr_origin; + u_char irr_m_len; /* match len for matchprefix */ + u_char irr_m_minlen; /* minlen for matching prefix */ + u_char irr_m_maxlen; /* maxlen for matching prefix */ + u_char irr_u_uselen; /* uselen for adding prefix */ + u_char irr_u_keeplen; /* keeplen from matching prefix */ + struct irr_raflagmask { + u_char onlink : 1; + u_char autonomous : 1; + u_char reserved : 6; + } irr_raflagmask; + u_int32_t irr_vltime; + u_int32_t irr_pltime; + struct in6_prflags irr_flags; + struct sockaddr_in6 irr_matchprefix; + struct sockaddr_in6 irr_useprefix; +}; + +#define irr_raf_mask_onlink irr_raflagmask.onlink +#define irr_raf_mask_auto irr_raflagmask.autonomous +#define irr_raf_mask_reserved irr_raflagmask.reserved + +#define irr_raf_onlink irr_flags.prf_ra.onlink +#define irr_raf_auto irr_flags.prf_ra.autonomous + +#define irr_statef_onlink irr_flags.prf_state.onlink + +#define irr_rrf irr_flags.prf_rr +#define irr_rrf_decrvalid irr_flags.prf_rr.decrvalid +#define irr_rrf_decrprefd irr_flags.prf_rr.decrprefd + + +/* + * Event data, internet6 style. + */ + +struct kev_in6_addrlifetime { + u_int32_t ia6t_expire; + u_int32_t ia6t_preferred; + u_int32_t ia6t_vltime; + u_int32_t ia6t_pltime; +}; + +struct kev_in6_data { + struct net_event_data link_data; + struct sockaddr_in6 ia_addr; /* interface address */ + struct sockaddr_in6 ia_net; /* network number of interface */ + struct sockaddr_in6 ia_dstaddr; /* space for destination addr */ + struct sockaddr_in6 ia_prefixmask; /* prefix mask */ + u_int32_t ia_plen; /* prefix length */ + u_int32_t ia6_flags; /* address flags from in6_ifaddr */ + struct kev_in6_addrlifetime ia_lifetime; /* address life info */ +}; + +/* + * Define inet6 event subclass and specific inet6 events. + */ + +#define KEV_INET6_SUBCLASS 6 /* inet6 subclass identifier */ + +#define KEV_INET6_NEW_USER_ADDR 1 /* Userland configured IPv6 address */ +#define KEV_INET6_CHANGED_ADDR 2 /* Address changed event (future) */ +#define KEV_INET6_ADDR_DELETED 3 /* IPv6 add. in ia_addr field was deleted */ +#define KEV_INET6_NEW_LL_ADDR 4 /* Autoconfigured linklocal address has appeared */ +#define KEV_INET6_NEW_RTADV_ADDR 5 /* Autoconf router advertised address has appeared */ +#define KEV_INET6_DEFROUTER 6 /* Default router dectected by kernel */ + + +#define IN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) + +#define SIOCSIFADDR_IN6 _IOW('i', 12, struct in6_ifreq) +#define SIOCGIFADDR_IN6 _IOWR('i', 33, struct in6_ifreq) + +/* + * SIOCSxxx ioctls should be unused (see comments in in6.c), but + * we do not shift numbers for binary compatibility. + */ +#define SIOCSIFDSTADDR_IN6 _IOW('i', 14, struct in6_ifreq) +#define SIOCSIFNETMASK_IN6 _IOW('i', 22, struct in6_ifreq) + +#define SIOCGIFDSTADDR_IN6 _IOWR('i', 34, struct in6_ifreq) +#define SIOCGIFNETMASK_IN6 _IOWR('i', 37, struct in6_ifreq) + +#define SIOCDIFADDR_IN6 _IOW('i', 25, struct in6_ifreq) +#define SIOCAIFADDR_IN6 _IOW('i', 26, struct in6_aliasreq) + +#define SIOCSIFPHYADDR_IN6 _IOW('i', 62, struct in6_aliasreq) +#define SIOCGIFPSRCADDR_IN6 _IOWR('i', 63, struct in6_ifreq) +#define SIOCGIFPDSTADDR_IN6 _IOWR('i', 64, struct in6_ifreq) +#define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) +#define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist) +#define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_prlist) +#define OSIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ondireq) +#define SIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq) +#define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq) +#define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo) +#define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq) +#define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) + +#define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) +#define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) +#define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) +#define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) + +#define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq) +#define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq) + +#define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ + +#define SIOCSSCOPE6 _IOW('i', 88, struct in6_ifreq) +#define SIOCGSCOPE6 _IOWR('i', 89, struct in6_ifreq) +#define SIOCGSCOPE6DEF _IOWR('i', 90, struct in6_ifreq) + +#define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ +#define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */ +#define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */ +#define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */ +#define SIOCCIFPREFIX_IN6 _IOW('i', 104, \ + struct in6_rrenumreq) /* change */ +#define SIOCSGIFPREFIX_IN6 _IOW('i', 105, \ + struct in6_rrenumreq) /* set global */ + +#define SIOCGETSGCNT_IN6 _IOWR('u', 28, \ + struct sioc_sg_req6) /* get s,g pkt cnt */ +#define SIOCGETMIFCNT_IN6 _IOWR('u', 107, \ + struct sioc_mif_req6) /* get pkt cnt per if */ + + +#define IN6_IFF_ANYCAST 0x01 /* anycast address */ +#define IN6_IFF_TENTATIVE 0x02 /* tentative address */ +#define IN6_IFF_DUPLICATED 0x04 /* DAD detected duplicate */ +#define IN6_IFF_DETACHED 0x08 /* may be detached from the link */ +#define IN6_IFF_DEPRECATED 0x10 /* deprecated address */ +#define IN6_IFF_NODAD 0x20 /* don't perform DAD on this address + * (used only at first SIOC* call) + */ +#define IN6_IFF_AUTOCONF 0x40 /* autoconfigurable address. */ +#define IN6_IFF_TEMPORARY 0x80 /* temporary (anonymous) address. */ +#define IN6_IFF_NOPFX 0x8000 /* skip kernel prefix management. + * XXX: this should be temporary. + */ + +/* do not input/output */ +#define IN6_IFF_NOTREADY (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED) + + +#endif /* _NETINET6_IN6_VAR_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/ip6_fw.h.svn-base b/i386/include/netinet6/.svn/text-base/ip6_fw.h.svn-base new file mode 100644 index 0000000..8b619b3 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/ip6_fw.h.svn-base @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1993 Daniel Boulet + * Copyright (c) 1994 Ugen J.S.Antsilevich + * + * Redistribution and use in source forms, with and without modification, + * are permitted provided that this entire comment appears intact. + * + * Redistribution in binary form may occur without any restrictions. + * Obviously, it would be nice if you gave credit where credit is due + * but requiring it would be too onerous. + * + * This software is provided ``AS IS'' without any warranties of any kind. + * + */ + +#ifndef _IP6_FW_H +#define _IP6_FW_H + +#include <sys/appleapiopts.h> + +/* + * Define IPv6 Firewall event subclass, and associated events. + */ + +/*! + @defined KEV_IP6FW_SUBCLASS + @discussion The kernel event subclass for IPv6 Firewall. +*/ +#define KEV_IP6FW_SUBCLASS 2 + +/*! + @defined KEV_IP6FW_ADD + @discussion The event code indicating a rule has been added. +*/ +#define KEV_IP6FW_ADD 1 + +/*! + @defined KEV_IP6FW_DEL + @discussion The event code indicating a rule has been removed. +*/ +#define KEV_IP6FW_DEL 2 + +/*! + @defined KEV_IP6FW_FLUSH + @discussion The event code indicating the rule set has been flushed. +*/ +#define KEV_IP6FW_FLUSH 3 + +/*! + @defined KEV_IP6FW_FLUSH + @discussion The event code indicating the enable flag has been changed +*/ +#define KEV_IP6FW_ENABLE 4 + + +#include <net/if.h> + +#define IPV6_FW_CURRENT_API_VERSION 20 /* Version of this API */ + + +/* + * This union structure identifies an interface, either explicitly + * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME + * and IP_FW_F_OIFNAME say how to interpret this structure. An + * interface unit number of -1 matches any unit number, while an + * IP address of 0.0.0.0 indicates matches any interface. + * + * The receive and transmit interfaces are only compared against the + * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE) + * is set. Note some packets lack a receive or transmit interface + * (in which case the missing "interface" never matches). + */ + +union ip6_fw_if { + struct in6_addr fu_via_ip6; /* Specified by IPv6 address */ + struct { /* Specified by interface name */ +#define IP6FW_IFNLEN IFNAMSIZ + char name[IP6FW_IFNLEN]; + short unit; /* -1 means match any unit */ + } fu_via_if; +}; + +/* + * Format of an IP firewall descriptor + * + * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order. + * fw_flg and fw_n*p are stored in host byte order (of course). + * Port numbers are stored in HOST byte order. + * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108) + */ + + +struct ip6_fw { + u_int32_t version; /* Version of this structure. Should always be */ + /* set to IP6_FW_CURRENT_API_VERSION by clients. */ + void *context; /* Context that is usable by user processes to */ + /* identify this rule. */ + u_int32_t fw_pcnt,fw_bcnt; /* Packet and byte counters */ + struct in6_addr fw_src, fw_dst; /* Source and destination IPv6 addr */ + struct in6_addr fw_smsk, fw_dmsk; /* Mask for src and dest IPv6 addr */ + u_short fw_number; /* Rule number */ + u_short fw_flg; /* Flags word */ +#define IPV6_FW_MAX_PORTS 10 /* A reasonable maximum */ + u_int fw_ipflg; /* IP flags word */ + u_short fw_pts[IPV6_FW_MAX_PORTS]; /* Array of port numbers to match */ + u_char fw_ip6opt,fw_ip6nopt; /* IPv6 options set/unset */ + u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */ +#define IPV6_FW_ICMPTYPES_DIM (256 / (sizeof(unsigned) * 8)) + unsigned fw_icmp6types[IPV6_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */ + long timestamp; /* timestamp (tv_sec) of last match */ + union ip6_fw_if fw_in_if, fw_out_if;/* Incoming and outgoing interfaces */ + union { + u_short fu_divert_port; /* Divert/tee port (options IP6DIVERT) */ + u_short fu_skipto_rule; /* SKIPTO command rule number */ + u_short fu_reject_code; /* REJECT response code */ + } fw_un; + u_char fw_prot; /* IPv6 protocol */ + u_char fw_nports; /* N'of src ports and # of dst ports */ + /* in ports array (dst ports follow */ + /* src ports; max of 10 ports in all; */ + /* count of 0 means match all ports) */ +}; + + +#define IPV6_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f) +#define IPV6_FW_SETNSRCP(rule, n) do { \ + (rule)->fw_nports &= ~0x0f; \ + (rule)->fw_nports |= (n); \ + } while (0) +#define IPV6_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4) +#define IPV6_FW_SETNDSTP(rule, n) do { \ + (rule)->fw_nports &= ~0xf0; \ + (rule)->fw_nports |= (n) << 4;\ + } while (0) + +#define fw_divert_port fw_un.fu_divert_port +#define fw_skipto_rule fw_un.fu_skipto_rule +#define fw_reject_code fw_un.fu_reject_code + +struct ip6_fw_chain { + LIST_ENTRY(ip6_fw_chain) chain; + struct ip6_fw *rule; +}; + +/* + * Values for "flags" field . + */ +#define IPV6_FW_F_IN 0x0001 /* Check inbound packets */ +#define IPV6_FW_F_OUT 0x0002 /* Check outbound packets */ +#define IPV6_FW_F_IIFACE 0x0004 /* Apply inbound interface test */ +#define IPV6_FW_F_OIFACE 0x0008 /* Apply outbound interface test */ + +#define IPV6_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */ +#define IPV6_FW_F_DENY 0x0000 /* This is a deny rule */ +#define IPV6_FW_F_REJECT 0x0010 /* Deny and send a response packet */ +#define IPV6_FW_F_ACCEPT 0x0020 /* This is an accept rule */ +#define IPV6_FW_F_COUNT 0x0030 /* This is a count rule */ +#define IPV6_FW_F_DIVERT 0x0040 /* This is a divert rule */ +#define IPV6_FW_F_TEE 0x0050 /* This is a tee rule */ +#define IPV6_FW_F_SKIPTO 0x0060 /* This is a skipto rule */ + +#define IPV6_FW_F_PRN 0x0080 /* Print if this rule matches */ + +#define IPV6_FW_F_SRNG 0x0100 /* The first two src ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IPV6_FW_F_DRNG 0x0200 /* The first two dst ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IPV6_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */ +#define IPV6_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */ + +#define IPV6_FW_F_INVSRC 0x1000 /* Invert sense of src check */ +#define IPV6_FW_F_INVDST 0x2000 /* Invert sense of dst check */ + +#define IPV6_FW_F_FRAG 0x4000 /* Fragment */ + +#define IPV6_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */ + +#define IPV6_FW_F_MASK 0xFFFF /* All possible flag bits mask */ + +/* + * Flags for the 'fw_ipflg' field, for comparing values of ip and its protocols. */ +#define IPV6_FW_IF_TCPEST 0x00000020 /* established TCP connection */ +#define IPV6_FW_IF_TCPMSK 0x00000020 /* mask of all TCP values */ + +/* + * For backwards compatibility with rules specifying "via iface" but + * not restricted to only "in" or "out" packets, we define this combination + * of bits to represent this configuration. + */ + +#define IF6_FW_F_VIAHACK (IPV6_FW_F_IN|IPV6_FW_F_OUT|IPV6_FW_F_IIFACE|IPV6_FW_F_OIFACE) + +/* + * Definitions for REJECT response codes. + * Values less than 256 correspond to ICMP unreachable codes. + */ +#define IPV6_FW_REJECT_RST 0x0100 /* TCP packets: send RST */ + +/* + * Definitions for IPv6 option names. + */ +#define IPV6_FW_IP6OPT_HOPOPT 0x01 +#define IPV6_FW_IP6OPT_ROUTE 0x02 +#define IPV6_FW_IP6OPT_FRAG 0x04 +#define IPV6_FW_IP6OPT_ESP 0x08 +#define IPV6_FW_IP6OPT_AH 0x10 +#define IPV6_FW_IP6OPT_NONXT 0x20 +#define IPV6_FW_IP6OPT_OPTS 0x40 + +/* + * Definitions for TCP flags. + */ +#define IPV6_FW_TCPF_FIN TH_FIN +#define IPV6_FW_TCPF_SYN TH_SYN +#define IPV6_FW_TCPF_RST TH_RST +#define IPV6_FW_TCPF_PSH TH_PUSH +#define IPV6_FW_TCPF_ACK TH_ACK +#define IPV6_FW_TCPF_URG TH_URG + +/* + * Main firewall chains definitions and global var's definitions. + */ + +#endif /* _IP6_FW_H */ diff --git a/i386/include/netinet6/.svn/text-base/ip6_mroute.h.svn-base b/i386/include/netinet6/.svn/text-base/ip6_mroute.h.svn-base new file mode 100644 index 0000000..4a935d9 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/ip6_mroute.h.svn-base @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.2.2.2 2001/07/03 11:01:53 ume Exp $ */ +/* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */ + +/* + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* BSDI ip_mroute.h,v 2.5 1996/10/11 16:01:48 pjd Exp */ + +/* + * Definitions for IP multicast forwarding. + * + * Written by David Waitzman, BBN Labs, August 1988. + * Modified by Steve Deering, Stanford, February 1989. + * Modified by Ajit Thyagarajan, PARC, August 1993. + * Modified by Ajit Thyagarajan, PARC, August 1994. + * Modified by Ahmed Helmy, USC, September 1996. + * + * MROUTING Revision: 1.2 + */ + +#ifndef _NETINET6_IP6_MROUTE_H_ +#define _NETINET6_IP6_MROUTE_H_ +#include <sys/appleapiopts.h> + +/* + * Multicast Routing set/getsockopt commands. + */ +#define MRT6_DONE 101 /* shut down forwarder */ +#define MRT6_ADD_MIF 102 /* add multicast interface */ +#define MRT6_DEL_MIF 103 /* delete multicast interface */ +#define MRT6_ADD_MFC 104 /* insert forwarding cache entry */ +#define MRT6_DEL_MFC 105 /* delete forwarding cache entry */ +#define MRT6_PIM 107 /* enable pim code */ +#define MRT6_INIT 108 /* initialize forwarder (mrt6msg) */ + +#ifdef __APPLE__ +#define GET_TIME(t) getmicrotime(&t) +#endif + +/* + * Types and macros for handling bitmaps with one bit per multicast interface. + */ +typedef u_short mifi_t; /* type of a mif index */ +#define MAXMIFS 64 + +#ifndef IF_SETSIZE +#define IF_SETSIZE 256 +#endif + +typedef u_int32_t if_mask; +#define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */ + +#ifndef howmany +#define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) +#endif + +typedef struct if_set { + if_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)]; +} if_set; + +#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS))) +#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS))) +#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS))) +#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f))) +#define IF_ZERO(p) bzero(p, sizeof(*(p))) + +/* + * Argument structure for MRT6_ADD_IF. + */ +struct mif6ctl { + mifi_t mif6c_mifi; /* the index of the mif to be added */ + u_char mif6c_flags; /* MIFF_ flags defined below */ + u_short mif6c_pifi; /* the index of the physical IF */ +#if notyet + u_int mif6c_rate_limit; /* max rate */ +#endif +}; + +#define MIFF_REGISTER 0x1 /* mif represents a register end-point */ + +/* + * Argument structure for MRT6_ADD_MFC and MRT6_DEL_MFC + */ +struct mf6cctl { + struct sockaddr_in6 mf6cc_origin; /* IPv6 origin of mcasts */ + struct sockaddr_in6 mf6cc_mcastgrp; /* multicast group associated */ + mifi_t mf6cc_parent; /* incoming ifindex */ + struct if_set mf6cc_ifset; /* set of forwarding ifs */ +}; + +/* + * The kernel's multicast routing statistics. + */ +struct mrt6stat { + u_quad_t mrt6s_mfc_lookups; /* # forw. cache hash table hits */ + u_quad_t mrt6s_mfc_misses; /* # forw. cache hash table misses */ + u_quad_t mrt6s_upcalls; /* # calls to mrouted */ + u_quad_t mrt6s_no_route; /* no route for packet's origin */ + u_quad_t mrt6s_bad_tunnel; /* malformed tunnel options */ + u_quad_t mrt6s_cant_tunnel; /* no room for tunnel options */ + u_quad_t mrt6s_wrong_if; /* arrived on wrong interface */ + u_quad_t mrt6s_upq_ovflw; /* upcall Q overflow */ + u_quad_t mrt6s_cache_cleanups; /* # entries with no upcalls */ + u_quad_t mrt6s_drop_sel; /* pkts dropped selectively */ + u_quad_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ + u_quad_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ + u_quad_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */ +}; + + +/* + * Structure used to communicate from kernel to multicast router. + * We'll overlay the structure onto an MLD header (not an IPv6 header + * like igmpmsg{} used for IPv4 implementation). This is because this + * structure will be passed via an IPv6 raw socket, on which an application + * will only receive the payload i.e. the data after the IPv6 header and all + * the extension headers. (see Section 3 of draft-ietf-ipngwg-2292bis-01) + */ +struct mrt6msg { +#define MRT6MSG_NOCACHE 1 +#define MRT6MSG_WRONGMIF 2 +#define MRT6MSG_WHOLEPKT 3 /* used for user level encap*/ + u_char im6_mbz; /* must be zero */ + u_char im6_msgtype; /* what type of message */ + u_int16_t im6_mif; /* mif rec'd on */ + u_int32_t im6_pad; /* padding for 64bit arch */ + struct in6_addr im6_src, im6_dst; +}; + +/* + * Argument structure used by multicast routing daemon to get src-grp + * packet counts + */ +struct sioc_sg_req6 { + struct sockaddr_in6 src; + struct sockaddr_in6 grp; + u_quad_t pktcnt; + u_quad_t bytecnt; + u_quad_t wrong_if; +}; + +/* + * Argument structure used by mrouted to get mif pkt counts + */ +struct sioc_mif_req6 { + mifi_t mifi; /* mif number */ + u_quad_t icount; /* Input packet count on mif */ + u_quad_t ocount; /* Output packet count on mif */ + u_quad_t ibytes; /* Input byte count on mif */ + u_quad_t obytes; /* Output byte count on mif */ +}; + + + +#endif /* !_NETINET6_IP6_MROUTE_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/ipcomp.h.svn-base b/i386/include/netinet6/.svn/text-base/ipcomp.h.svn-base new file mode 100644 index 0000000..6f62011 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/ipcomp.h.svn-base @@ -0,0 +1,57 @@ +/* $FreeBSD: src/sys/netinet6/ipcomp.h,v 1.1.2.2 2001/07/03 11:01:54 ume Exp $ */ +/* $KAME: ipcomp.h,v 1.8 2000/09/26 07:55:14 itojun Exp $ */ + +/* + * Copyright (C) 1999 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * RFC2393 IP payload compression protocol (IPComp). + */ + +#ifndef _NETINET6_IPCOMP_H_ +#define _NETINET6_IPCOMP_H_ +#include <sys/appleapiopts.h> +#include <netinet6/ipsec.h> + +struct ipcomp { + u_int8_t comp_nxt; /* Next Header */ + u_int8_t comp_flags; /* reserved, must be zero */ + u_int16_t comp_cpi; /* Compression parameter index */ +}; + +/* well-known algorithm number (in CPI), from RFC2409 */ +#define IPCOMP_OUI 1 /* vendor specific */ +#define IPCOMP_DEFLATE 2 /* RFC2394 */ +#define IPCOMP_LZS 3 /* RFC2395 */ +#define IPCOMP_MAX 4 + +#define IPCOMP_CPI_NEGOTIATE_MIN 256 + + +#endif /* _NETINET6_IPCOMP_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/ipsec.h.svn-base b/i386/include/netinet6/.svn/text-base/ipsec.h.svn-base new file mode 100644 index 0000000..2d2e952 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/ipsec.h.svn-base @@ -0,0 +1,137 @@ +/* $FreeBSD: src/sys/netinet6/ipsec.h,v 1.4.2.2 2001/07/03 11:01:54 ume Exp $ */ +/* $KAME: ipsec.h,v 1.44 2001/03/23 08:08:47 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * IPsec controller part. + */ + +#ifndef _NETINET6_IPSEC_H_ +#define _NETINET6_IPSEC_H_ +#include <sys/cdefs.h> +#include <sys/appleapiopts.h> + +#include <net/pfkeyv2.h> + +/* according to IANA assignment, port 0x0000 and proto 0xff are reserved. */ +#define IPSEC_PORT_ANY 0 +#define IPSEC_ULPROTO_ANY 255 +#define IPSEC_PROTO_ANY 255 + +/* mode of security protocol */ +/* NOTE: DON'T use IPSEC_MODE_ANY at SPD. It's only use in SAD */ +#define IPSEC_MODE_ANY 0 /* i.e. wildcard. */ +#define IPSEC_MODE_TRANSPORT 1 +#define IPSEC_MODE_TUNNEL 2 + +/* + * Direction of security policy. + * NOTE: Since INVALID is used just as flag. + * The other are used for loop counter too. + */ +#define IPSEC_DIR_ANY 0 +#define IPSEC_DIR_INBOUND 1 +#define IPSEC_DIR_OUTBOUND 2 +#define IPSEC_DIR_MAX 3 +#define IPSEC_DIR_INVALID 4 + +/* Policy level */ +/* + * IPSEC, ENTRUST and BYPASS are allowed for setsockopt() in PCB, + * DISCARD, IPSEC and NONE are allowed for setkey() in SPD. + * DISCARD and NONE are allowed for system default. + */ +#define IPSEC_POLICY_DISCARD 0 /* discarding packet */ +#define IPSEC_POLICY_NONE 1 /* through IPsec engine */ +#define IPSEC_POLICY_IPSEC 2 /* do IPsec */ +#define IPSEC_POLICY_ENTRUST 3 /* consulting SPD if present. */ +#define IPSEC_POLICY_BYPASS 4 /* only for privileged socket. */ +#define IPSEC_POLICY_GENERATE 5 /* same as discard - IKE daemon can override with generated policy */ + +/* Security protocol level */ +#define IPSEC_LEVEL_DEFAULT 0 /* reference to system default */ +#define IPSEC_LEVEL_USE 1 /* use SA if present. */ +#define IPSEC_LEVEL_REQUIRE 2 /* require SA. */ +#define IPSEC_LEVEL_UNIQUE 3 /* unique SA. */ + +#define IPSEC_MANUAL_REQID_MAX 0x3fff + /* + * if security policy level == unique, this id + * indicate to a relative SA for use, else is + * zero. + * 1 - 0x3fff are reserved for manual keying. + * 0 are reserved for above reason. Others is + * for kernel use. + * Note that this id doesn't identify SA + * by only itself. + */ +#define IPSEC_REPLAYWSIZE 32 + +/* statistics for ipsec processing */ +struct ipsecstat { + u_quad_t in_success; /* succeeded inbound process */ + u_quad_t in_polvio; + /* security policy violation for inbound process */ + u_quad_t in_nosa; /* inbound SA is unavailable */ + u_quad_t in_inval; /* inbound processing failed due to EINVAL */ + u_quad_t in_nomem; /* inbound processing failed due to ENOBUFS */ + u_quad_t in_badspi; /* failed getting a SPI */ + u_quad_t in_ahreplay; /* AH replay check failed */ + u_quad_t in_espreplay; /* ESP replay check failed */ + u_quad_t in_ahauthsucc; /* AH authentication success */ + u_quad_t in_ahauthfail; /* AH authentication failure */ + u_quad_t in_espauthsucc; /* ESP authentication success */ + u_quad_t in_espauthfail; /* ESP authentication failure */ + u_quad_t in_esphist[256]; + u_quad_t in_ahhist[256]; + u_quad_t in_comphist[256]; + u_quad_t out_success; /* succeeded outbound process */ + u_quad_t out_polvio; + /* security policy violation for outbound process */ + u_quad_t out_nosa; /* outbound SA is unavailable */ + u_quad_t out_inval; /* outbound process failed due to EINVAL */ + u_quad_t out_nomem; /* inbound processing failed due to ENOBUFS */ + u_quad_t out_noroute; /* there is no route */ + u_quad_t out_esphist[256]; + u_quad_t out_ahhist[256]; + u_quad_t out_comphist[256]; +}; + + +__BEGIN_DECLS +extern caddr_t ipsec_set_policy(char *, int); +extern int ipsec_get_policylen(caddr_t); +extern char *ipsec_dump_policy(caddr_t, char *); + +extern const char *ipsec_strerror(void); +__END_DECLS + +#endif /* _NETINET6_IPSEC_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/nd6.h.svn-base b/i386/include/netinet6/.svn/text-base/nd6.h.svn-base new file mode 100644 index 0000000..4d5813c --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/nd6.h.svn-base @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/nd6.h,v 1.2.2.3 2001/08/13 01:10:49 simokawa Exp $ */ +/* $KAME: nd6.h,v 1.55 2001/04/27 15:09:49 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _NETINET6_ND6_H_ +#define _NETINET6_ND6_H_ +#include <sys/appleapiopts.h> + +/* see net/route.h, or net/if_inarp.h */ +#ifndef RTF_ANNOUNCE +#define RTF_ANNOUNCE RTF_PROTO2 +#endif + +#include <sys/queue.h> + + +#define ND6_LLINFO_PURGE -3 +#define ND6_LLINFO_NOSTATE -2 +/* + * We don't need the WAITDELETE state any more, but we keep the definition + * in a comment line instead of removing it. This is necessary to avoid + * unintentionally reusing the value for another purpose, which might + * affect backward compatibility with old applications. + * (20000711 jinmei@kame.net) + */ +/* #define ND6_LLINFO_WAITDELETE -1 */ +#define ND6_LLINFO_INCOMPLETE 0 +#define ND6_LLINFO_REACHABLE 1 +#define ND6_LLINFO_STALE 2 +#define ND6_LLINFO_DELAY 3 +#define ND6_LLINFO_PROBE 4 + + +struct nd_ifinfo { + u_int32_t linkmtu; /* LinkMTU */ + u_int32_t maxmtu; /* Upper bound of LinkMTU */ + u_int32_t basereachable; /* BaseReachableTime */ + u_int32_t reachable; /* Reachable Time */ + u_int32_t retrans; /* Retrans Timer */ + u_int32_t flags; /* Flags */ + int recalctm; /* BaseReacable re-calculation timer */ + u_int8_t chlim; /* CurHopLimit */ + u_int8_t receivedra; + /* the following 3 members are for privacy extension for addrconf */ + u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */ + u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */ + u_int8_t randomid[8]; /* current random ID */ +}; + + +#define ND6_IFF_PERFORMNUD 0x1 + +struct in6_nbrinfo { + char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct in6_addr addr; /* IPv6 address of the neighbor */ + long asked; /* number of queries already sent for this addr */ + int isrouter; /* if it acts as a router */ + int state; /* reachability state */ + int expire; /* lifetime for NDP state transition */ +}; + + +#define DRLSTSIZ 10 +#define PRLSTSIZ 10 + +struct in6_drlist { + char ifname[IFNAMSIZ]; + struct { + struct in6_addr rtaddr; + u_char flags; + u_short rtlifetime; + u_long expire; + u_short if_index; + } defrouter[DRLSTSIZ]; +}; + + +struct in6_defrouter { + struct sockaddr_in6 rtaddr; + u_char flags; + u_short rtlifetime; + u_long expire; + u_short if_index; +}; + + +struct in6_prlist { + char ifname[IFNAMSIZ]; + struct { + struct in6_addr prefix; + struct prf_ra raflags; + u_char prefixlen; + u_char origin; + u_long vltime; + u_long pltime; + u_long expire; + u_short if_index; + u_short advrtrs; /* number of advertisement routers */ + struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ + } prefix[PRLSTSIZ]; +}; + + +struct in6_prefix { + struct sockaddr_in6 prefix; + struct prf_ra raflags; + u_char prefixlen; + u_char origin; + u_long vltime; + u_long pltime; + u_long expire; + u_int32_t flags; + int refcnt; + u_short if_index; + u_short advrtrs; /* number of advertisement routers */ + /* struct sockaddr_in6 advrtr[] */ +}; + + +struct in6_ondireq { + char ifname[IFNAMSIZ]; + struct { + u_int32_t linkmtu; /* LinkMTU */ + u_int32_t maxmtu; /* Upper bound of LinkMTU */ + u_int32_t basereachable; /* BaseReachableTime */ + u_int32_t reachable; /* Reachable Time */ + u_int32_t retrans; /* Retrans Timer */ + u_int32_t flags; /* Flags */ + int recalctm; /* BaseReacable re-calculation timer */ + u_int8_t chlim; /* CurHopLimit */ + u_int8_t receivedra; + } ndi; +}; + +struct in6_ndireq { + char ifname[IFNAMSIZ]; + struct nd_ifinfo ndi; +}; + +struct in6_ndifreq { + char ifname[IFNAMSIZ]; + u_long ifindex; +}; + + +/* Prefix status */ +#define NDPRF_ONLINK 0x1 +#define NDPRF_DETACHED 0x2 + +/* protocol constants */ +#define MAX_RTR_SOLICITATION_DELAY 1 /*1sec*/ +#define RTR_SOLICITATION_INTERVAL 4 /*4sec*/ +#define MAX_RTR_SOLICITATIONS 3 + +#define ND6_INFINITE_LIFETIME 0xffffffff + + +#endif /* _NETINET6_ND6_H_ */ diff --git a/i386/include/netinet6/.svn/text-base/pim6.h.svn-base b/i386/include/netinet6/.svn/text-base/pim6.h.svn-base new file mode 100644 index 0000000..1ae3f1a --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/pim6.h.svn-base @@ -0,0 +1,70 @@ +/* $FreeBSD: src/sys/netinet6/pim6.h,v 1.1.2.1 2000/07/15 07:14:36 kris Exp $ */ +/* $KAME: pim6.h,v 1.3 2000/03/25 07:23:58 sumikawa Exp $ */ + +/* + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Protocol Independent Multicast (PIM) definitions + * + * Written by Ahmed Helmy, SGI, July 1996 + * + * MULTICAST + */ +#include <sys/appleapiopts.h> + +/* + * PIM packet header + */ +#define PIM_VERSION 2 +struct pim { +#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN) + u_char pim_type:4, /* the PIM message type, currently they are: + * Hello, Register, Register-Stop, Join/Prune, + * Bootstrap, Assert, Graft (PIM-DM only), + * Graft-Ack (PIM-DM only), C-RP-Adv + */ + pim_ver:4; /* PIM version number; 2 for PIMv2 */ +#else + u_char pim_ver:4, /* PIM version */ + pim_type:4; /* PIM type */ +#endif + u_char pim_rsv; /* Reserved */ + u_short pim_cksum; /* IP style check sum */ +}; + +#define PIM_MINLEN 8 /* The header min. length is 8 */ +#define PIM6_REG_MINLEN (PIM_MINLEN+40) /* Register message + inner IP6 header */ + +/* + * Message types + */ +#define PIM_REGISTER 1 /* PIM Register type is 1 */ + +/* second bit in reg_head is the null bit */ +#define PIM_NULL_REGISTER 0x40000000 diff --git a/i386/include/netinet6/.svn/text-base/raw_ip6.h.svn-base b/i386/include/netinet6/.svn/text-base/raw_ip6.h.svn-base new file mode 100644 index 0000000..2a506d4 --- /dev/null +++ b/i386/include/netinet6/.svn/text-base/raw_ip6.h.svn-base @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/raw_ip6.h,v 1.1.2.1 2001/07/03 11:01:55 ume Exp $ */ +/* $KAME: raw_ip6.h,v 1.2 2001/05/27 13:28:35 itojun Exp $ */ + +/* + * Copyright (C) 2001 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _NETINET6_RAW_IP6_H_ +#define _NETINET6_RAW_IP6_H_ +#include <sys/appleapiopts.h> + +/* + * ICMPv6 stat is counted separately. see netinet/icmp6.h + */ +struct rip6stat { + u_quad_t rip6s_ipackets; /* total input packets */ + u_quad_t rip6s_isum; /* input checksum computations */ + u_quad_t rip6s_badsum; /* of above, checksum error */ + u_quad_t rip6s_nosock; /* no matching socket */ + u_quad_t rip6s_nosockmcast; /* of above, arrived as multicast */ + u_quad_t rip6s_fullsock; /* not delivered, input socket full */ + + u_quad_t rip6s_opackets; /* total output packets */ +}; + +#endif diff --git a/i386/include/netinet6/ah.h b/i386/include/netinet6/ah.h new file mode 100644 index 0000000..970fa44 --- /dev/null +++ b/i386/include/netinet6/ah.h @@ -0,0 +1,59 @@ +/* $FreeBSD: src/sys/netinet6/ah.h,v 1.3.2.2 2001/07/03 11:01:49 ume Exp $ */ +/* $KAME: ah.h,v 1.13 2000/10/18 21:28:00 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * RFC1826/2402 authentication header. + */ + +#ifndef _NETINET6_AH_H_ +#define _NETINET6_AH_H_ +#include <sys/appleapiopts.h> + +struct ah { + u_int8_t ah_nxt; /* Next Header */ + u_int8_t ah_len; /* Length of data, in 32bit */ + u_int16_t ah_reserve; /* Reserved for future use */ + u_int32_t ah_spi; /* Security parameter index */ + /* variable size, 32bit bound*/ /* Authentication data */ +}; + +struct newah { + u_int8_t ah_nxt; /* Next Header */ + u_int8_t ah_len; /* Length of data + 1, in 32bit */ + u_int16_t ah_reserve; /* Reserved for future use */ + u_int32_t ah_spi; /* Security parameter index */ + u_int32_t ah_seq; /* Sequence number field */ + /* variable size, 32bit bound*/ /* Authentication data */ +}; + + +#endif /* _NETINET6_AH_H_ */ diff --git a/i386/include/netinet6/esp.h b/i386/include/netinet6/esp.h new file mode 100644 index 0000000..f567746 --- /dev/null +++ b/i386/include/netinet6/esp.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/esp.h,v 1.2.2.2 2001/07/03 11:01:49 ume Exp $ */ +/* $KAME: esp.h,v 1.16 2000/10/18 21:28:00 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * RFC1827/2406 Encapsulated Security Payload. + */ + +#ifndef _NETINET6_ESP_H_ +#define _NETINET6_ESP_H_ +#include <sys/appleapiopts.h> + + +struct esp { + u_int32_t esp_spi; /* ESP */ + /*variable size, 32bit bound*/ /* Initialization Vector */ + /*variable size*/ /* Payload data */ + /*variable size*/ /* padding */ + /*8bit*/ /* pad size */ + /*8bit*/ /* next header */ + /*8bit*/ /* next header */ + /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */ +}; + +struct newesp { + u_int32_t esp_spi; /* ESP */ + u_int32_t esp_seq; /* Sequence number */ + /*variable size*/ /* (IV and) Payload data */ + /*variable size*/ /* padding */ + /*8bit*/ /* pad size */ + /*8bit*/ /* next header */ + /*8bit*/ /* next header */ + /*variable size, 32bit bound*/ /* Authentication data */ +}; + +struct esptail { + u_int8_t esp_padlen; /* pad length */ + u_int8_t esp_nxt; /* Next header */ + /*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/ +}; + + +#endif /* _NETINET6_ESP_H_ */ diff --git a/i386/include/netinet6/in6.h b/i386/include/netinet6/in6.h new file mode 100644 index 0000000..10bf2b2 --- /dev/null +++ b/i386/include/netinet6/in6.h @@ -0,0 +1,513 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/in6.h,v 1.7.2.4 2001/07/04 09:45:23 ume Exp $ */ +/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in.h 8.3 (Berkeley) 1/3/94 + */ + +#ifndef __KAME_NETINET_IN_H_INCLUDED_ +#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553" +#endif + +#ifndef _NETINET6_IN6_H_ +#define _NETINET6_IN6_H_ +#include <sys/appleapiopts.h> +#include <sys/_types.h> + + +#ifndef _SA_FAMILY_T +#define _SA_FAMILY_T +typedef __uint8_t sa_family_t; +#endif + +/* + * Identification of the network protocol stack + * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE + * has the table of implementation/integration differences. + */ +#define __KAME__ +#define __KAME_VERSION "20010528/apple-darwin" + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Local port number conventions: + * + * Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root), + * unless a kernel is compiled with IPNOPRIVPORTS defined. + * + * When a user does a bind(2) or connect(2) with a port number of zero, + * a non-conflicting local port address is chosen. + * + * The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although + * that is settable by sysctl(3); net.inet.ip.anonportmin and + * net.inet.ip.anonportmax respectively. + * + * A user may set the IPPROTO_IP option IP_PORTRANGE to change this + * default assignment range. + * + * The value IP_PORTRANGE_DEFAULT causes the default behavior. + * + * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT, + * and exists only for FreeBSD compatibility purposes. + * + * The value IP_PORTRANGE_LOW changes the range to the "low" are + * that is (by convention) restricted to privileged processes. + * This convention is based on "vouchsafe" principles only. + * It is only secure if you trust the remote host to restrict these ports. + * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX. + */ + +#define IPV6PORT_RESERVED 1024 +#define IPV6PORT_ANONMIN 49152 +#define IPV6PORT_ANONMAX 65535 +#define IPV6PORT_RESERVEDMIN 600 +#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1) +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * IPv6 address + */ +struct in6_addr { + union { + __uint8_t __u6_addr8[16]; + __uint16_t __u6_addr16[8]; + __uint32_t __u6_addr32[4]; + } __u6_addr; /* 128-bit IP6 address */ +}; + +#define s6_addr __u6_addr.__u6_addr8 + +#define INET6_ADDRSTRLEN 46 + +/* + * Socket address for IPv6 + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SIN6_LEN +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +struct sockaddr_in6 { + __uint8_t sin6_len; /* length of this struct(sa_family_t)*/ + sa_family_t sin6_family; /* AF_INET6 (sa_family_t) */ + in_port_t sin6_port; /* Transport layer port # (in_port_t)*/ + __uint32_t sin6_flowinfo; /* IP6 flow information */ + struct in6_addr sin6_addr; /* IP6 address */ + __uint32_t sin6_scope_id; /* scope zone index */ +}; + + + + +/* + * Definition of some useful macros to handle IP6 addresses + */ +#define IN6ADDR_ANY_INIT \ + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} +#define IN6ADDR_LOOPBACK_INIT \ + {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IN6ADDR_NODELOCAL_ALLNODES_INIT \ + {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ + {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}} +#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ + {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}} +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +extern const struct in6_addr in6addr_any; +extern const struct in6_addr in6addr_loopback; +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +extern const struct in6_addr in6addr_nodelocal_allnodes; +extern const struct in6_addr in6addr_linklocal_allnodes; +extern const struct in6_addr in6addr_linklocal_allrouters; +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Equality + * NOTE: Some of kernel programming environment (for example, openbsd/sparc) + * does not supply memcmp(). For userland memcmp() is preferred as it is + * in ANSI standard. + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IN6_ARE_ADDR_EQUAL(a, b) \ + (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0) +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + + +/* + * Unspecified + */ +#define IN6_IS_ADDR_UNSPECIFIED(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) + +/* + * Loopback + */ +#define IN6_IS_ADDR_LOOPBACK(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) + +/* + * IPv4 compatible + */ +#define IN6_IS_ADDR_V4COMPAT(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) + +/* + * Mapped + */ +#define IN6_IS_ADDR_V4MAPPED(a) \ + ((*(const __uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const __uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) + +/* + * KAME Scope Values + */ + +#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 +#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 +#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05 +#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ +#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e + +/* + * Unicast Scope + * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373). + */ +#define IN6_IS_ADDR_LINKLOCAL(a) \ + (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80)) +#define IN6_IS_ADDR_SITELOCAL(a) \ + (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) + +/* + * Multicast + */ +#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) + +#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) + +/* + * Multicast Scope + */ +#define IN6_IS_ADDR_MC_NODELOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL)) +#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL)) +#define IN6_IS_ADDR_MC_SITELOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL)) +#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) +#define IN6_IS_ADDR_MC_GLOBAL(a) \ + (IN6_IS_ADDR_MULTICAST(a) && \ + (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) + + +/* + * IP6 route structure + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +/* + * Options for use with [gs]etsockopt at the IPV6 level. + * First word of comment is data type; bool is stored in int. + */ +/* no hdrincl */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#if 0 /* the followings are relic in IPv4 and hence are disabled */ +#define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */ +#define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */ +#define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */ +#define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */ +#define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */ +#endif /* 0 */ +#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */ +#define IPV6_MULTICAST_IF 9 /* __uint8_t; set/get IP6 multicast i/f */ +#define IPV6_MULTICAST_HOPS 10 /* __uint8_t; set/get IP6 multicast hops */ +#define IPV6_MULTICAST_LOOP 11 /* __uint8_t; set/get IP6 mcast loopback */ +#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ +#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ +#define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ +/* RFC2292 options */ +#define IPV6_PKTINFO 19 /* bool; send/recv if, src/dst addr */ +#define IPV6_HOPLIMIT 20 /* bool; hop limit */ +#define IPV6_NEXTHOP 21 /* bool; next hop addr */ +#define IPV6_HOPOPTS 22 /* bool; hop-by-hop option */ +#define IPV6_DSTOPTS 23 /* bool; destination option */ +#define IPV6_RTHDR 24 /* bool; routing header */ +#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ + +#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define IPV6_BINDV6ONLY IPV6_V6ONLY + + +#if 1 /*IPSEC*/ +#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ +#endif /* 1 */ +#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ + +#if 1 /*IPV6FIREWALL*/ +#define IPV6_FW_ADD 30 /* add a firewall rule to chain */ +#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ +#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ +#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ +#define IPV6_FW_GET 34 /* get entire firewall rule chain */ +#endif /* 1 */ + +#define IPV6_RECVTCLASS 35 /* bool; recv traffic class values */ +#define IPV6_TCLASS 36 /* int; send traffic class value */ + +/* to define items, should talk with KAME guys first, for *BSD compatibility */ + +#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ +#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ +#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ + +/* + * Defaults and limits for options + */ +#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ +#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ + +/* + * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. + */ +struct ipv6_mreq { + struct in6_addr ipv6mr_multiaddr; + unsigned int ipv6mr_interface; +}; + +/* + * IPV6_PKTINFO: Packet information(RFC2292 sec 5) + */ +struct in6_pktinfo { + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ + unsigned int ipi6_ifindex; /* send/recv interface index */ +}; + +/* + * Argument for IPV6_PORTRANGE: + * - which range to search when port is unspecified at bind() or connect() + */ +#define IPV6_PORTRANGE_DEFAULT 0 /* default range */ +#define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */ +#define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */ + +/* + * Definitions for inet6 sysctl operations. + * + * Third level is protocol number. + * Fourth level is desired variable within that protocol. + */ +#define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */ + +/* + * Names for IP sysctl objects + */ +#define IPV6CTL_FORWARDING 1 /* act as router */ +#define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/ +#define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */ +#ifdef notyet +#define IPV6CTL_DEFMTU 4 /* default MTU */ +#endif +#define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */ +#define IPV6CTL_STATS 6 /* stats */ +#define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */ +#define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */ +#define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */ +#define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */ +#define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */ +#define IPV6CTL_ACCEPT_RTADV 12 +#define IPV6CTL_KEEPFAITH 13 +#define IPV6CTL_LOG_INTERVAL 14 +#define IPV6CTL_HDRNESTLIMIT 15 +#define IPV6CTL_DAD_COUNT 16 +#define IPV6CTL_AUTO_FLOWLABEL 17 +#define IPV6CTL_DEFMCASTHLIM 18 +#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ +#define IPV6CTL_KAME_VERSION 20 +#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ +#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ +#if 0 /*obsolete*/ +#define IPV6CTL_MAPPED_ADDR 23 +#endif +#define IPV6CTL_V6ONLY 24 +#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ +#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ +#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ + +#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ +#define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */ +#define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */ +#define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */ +#define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */ + +#define IPV6CTL_MAXFRAGS 41 /* max fragments */ + +#define IPV6CTL_NEIGHBORGCTHRESH 46 +#define IPV6CTL_MAXIFPREFIXES 47 +#define IPV6CTL_MAXIFDEFROUTERS 48 +#define IPV6CTL_MAXDYNROUTES 49 + +/* New entries should be added here from current IPV6CTL_MAXID value. */ +/* to define items, should talk with KAME guys first, for *BSD compatibility */ +#define IPV6CTL_MAXID 50 + + +__BEGIN_DECLS +struct cmsghdr; + +extern int inet6_option_space(int); +extern int inet6_option_init(void *, struct cmsghdr **, int); +extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, + int, int); +extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); +extern int inet6_option_next(const struct cmsghdr *, __uint8_t **); +extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int); + +extern size_t inet6_rthdr_space(int, int); +extern struct cmsghdr *inet6_rthdr_init(void *, int); +extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, + unsigned int); +extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); +#if 0 /* not implemented yet */ +extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); +#endif +extern int inet6_rthdr_segments(const struct cmsghdr *); +extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int); +extern int inet6_rthdr_getflags(const struct cmsghdr *, int); + +extern int inet6_opt_init(void *, size_t); +extern int inet6_opt_append(void *, size_t, int, __uint8_t, + size_t, __uint8_t, void **); +extern int inet6_opt_finish(void *, size_t, int); +extern int inet6_opt_set_val(void *, size_t, void *, int); + +extern int inet6_opt_next(void *, size_t, int, __uint8_t *, + size_t *, void **); +extern int inet6_opt_find(void *, size_t, int, __uint8_t, + size_t *, void **); +extern int inet6_opt_get_val(void *, size_t, void *, int); +extern size_t inet6_rth_space(int, int); +extern void *inet6_rth_init(void *, int, int, int); +extern int inet6_rth_add(void *, const struct in6_addr *); +extern int inet6_rth_reverse(const void *, void *); +extern int inet6_rth_segments(const void *); +extern struct in6_addr *inet6_rth_getaddr(const void *, int); +__END_DECLS +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#endif /* !_NETINET6_IN6_H_ */ diff --git a/i386/include/netinet6/in6_var.h b/i386/include/netinet6/in6_var.h new file mode 100644 index 0000000..275802c --- /dev/null +++ b/i386/include/netinet6/in6_var.h @@ -0,0 +1,466 @@ +/* + * Copyright (c) 2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/in6_var.h,v 1.3.2.2 2001/07/03 11:01:52 ume Exp $ */ +/* $KAME: in6_var.h,v 1.56 2001/03/29 05:34:31 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1985, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)in_var.h 8.1 (Berkeley) 6/10/93 + */ + +#ifndef _NETINET6_IN6_VAR_H_ +#define _NETINET6_IN6_VAR_H_ +#include <sys/appleapiopts.h> + +#ifdef __APPLE__ +#include <sys/kern_event.h> +#endif + +/* + * pltime/vltime are just for future reference (required to implements 2 + * hour rule for hosts). they should never be modified by nd6_timeout or + * anywhere else. + * userland -> kernel: accept pltime/vltime + * kernel -> userland: throw up everything + * in kernel: modify preferred/expire only + */ +struct in6_addrlifetime { + time_t ia6t_expire; /* valid lifetime expiration time */ + time_t ia6t_preferred; /* preferred lifetime expiration time */ + u_int32_t ia6t_vltime; /* valid lifetime */ + u_int32_t ia6t_pltime; /* prefix lifetime */ +}; + + +/* + * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12). + */ +struct in6_ifstat { + u_quad_t ifs6_in_receive; /* # of total input datagram */ + u_quad_t ifs6_in_hdrerr; /* # of datagrams with invalid hdr */ + u_quad_t ifs6_in_toobig; /* # of datagrams exceeded MTU */ + u_quad_t ifs6_in_noroute; /* # of datagrams with no route */ + u_quad_t ifs6_in_addrerr; /* # of datagrams with invalid dst */ + u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_in_truncated; /* # of truncated datagrams */ + u_quad_t ifs6_in_discard; /* # of discarded datagrams */ + /* NOTE: fragment timeout is not here */ + u_quad_t ifs6_in_deliver; /* # of datagrams delivered to ULP */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_out_forward; /* # of datagrams forwarded */ + /* NOTE: increment on outgoing if */ + u_quad_t ifs6_out_request; /* # of outgoing datagrams from ULP */ + /* NOTE: does not include forwrads */ + u_quad_t ifs6_out_discard; /* # of discarded datagrams */ + u_quad_t ifs6_out_fragok; /* # of datagrams fragmented */ + u_quad_t ifs6_out_fragfail; /* # of datagrams failed on fragment */ + u_quad_t ifs6_out_fragcreat; /* # of fragment datagrams */ + /* NOTE: this is # after fragment */ + u_quad_t ifs6_reass_reqd; /* # of incoming fragmented packets */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_reass_ok; /* # of reassembled packets */ + /* NOTE: this is # after reass */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_reass_fail; /* # of reass failures */ + /* NOTE: may not be packet count */ + /* NOTE: increment on final dst if */ + u_quad_t ifs6_in_mcast; /* # of inbound multicast datagrams */ + u_quad_t ifs6_out_mcast; /* # of outbound multicast datagrams */ +}; + +/* + * ICMPv6 interface statistics, as defined in RFC2466 Ipv6IfIcmpEntry. + * XXX: I'm not sure if this file is the right place for this structure... + */ +struct icmp6_ifstat { + /* + * Input statistics + */ + /* ipv6IfIcmpInMsgs, total # of input messages */ + u_quad_t ifs6_in_msg; + /* ipv6IfIcmpInErrors, # of input error messages */ + u_quad_t ifs6_in_error; + /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */ + u_quad_t ifs6_in_dstunreach; + /* ipv6IfIcmpInAdminProhibs, # of input administratively prohibited errs */ + u_quad_t ifs6_in_adminprohib; + /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */ + u_quad_t ifs6_in_timeexceed; + /* ipv6IfIcmpInParmProblems, # of input parameter problem errors */ + u_quad_t ifs6_in_paramprob; + /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */ + u_quad_t ifs6_in_pkttoobig; + /* ipv6IfIcmpInEchos, # of input echo requests */ + u_quad_t ifs6_in_echo; + /* ipv6IfIcmpInEchoReplies, # of input echo replies */ + u_quad_t ifs6_in_echoreply; + /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */ + u_quad_t ifs6_in_routersolicit; + /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */ + u_quad_t ifs6_in_routeradvert; + /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */ + u_quad_t ifs6_in_neighborsolicit; + /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advertisements */ + u_quad_t ifs6_in_neighboradvert; + /* ipv6IfIcmpInRedirects, # of input redirects */ + u_quad_t ifs6_in_redirect; + /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */ + u_quad_t ifs6_in_mldquery; + /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */ + u_quad_t ifs6_in_mldreport; + /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */ + u_quad_t ifs6_in_mlddone; + + /* + * Output statistics. We should solve unresolved routing problem... + */ + /* ipv6IfIcmpOutMsgs, total # of output messages */ + u_quad_t ifs6_out_msg; + /* ipv6IfIcmpOutErrors, # of output error messages */ + u_quad_t ifs6_out_error; + /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */ + u_quad_t ifs6_out_dstunreach; + /* ipv6IfIcmpOutAdminProhibs, # of output administratively prohibited errs */ + u_quad_t ifs6_out_adminprohib; + /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */ + u_quad_t ifs6_out_timeexceed; + /* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */ + u_quad_t ifs6_out_paramprob; + /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */ + u_quad_t ifs6_out_pkttoobig; + /* ipv6IfIcmpOutEchos, # of output echo requests */ + u_quad_t ifs6_out_echo; + /* ipv6IfIcmpOutEchoReplies, # of output echo replies */ + u_quad_t ifs6_out_echoreply; + /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */ + u_quad_t ifs6_out_routersolicit; + /* ipv6IfIcmpOutRouterAdvertisements, # of output router advertisements */ + u_quad_t ifs6_out_routeradvert; + /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */ + u_quad_t ifs6_out_neighborsolicit; + /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advertisements */ + u_quad_t ifs6_out_neighboradvert; + /* ipv6IfIcmpOutRedirects, # of output redirects */ + u_quad_t ifs6_out_redirect; + /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */ + u_quad_t ifs6_out_mldquery; + /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */ + u_quad_t ifs6_out_mldreport; + /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */ + u_quad_t ifs6_out_mlddone; +}; + +struct in6_ifreq { + char ifr_name[IFNAMSIZ]; + union { + struct sockaddr_in6 ifru_addr; + struct sockaddr_in6 ifru_dstaddr; + short ifru_flags; + int ifru_flags6; + int ifru_metric; + caddr_t ifru_data; + struct in6_addrlifetime ifru_lifetime; + struct in6_ifstat ifru_stat; + struct icmp6_ifstat ifru_icmp6stat; + u_int32_t ifru_scope_id[16]; + } ifr_ifru; +}; + +struct in6_aliasreq { + char ifra_name[IFNAMSIZ]; + struct sockaddr_in6 ifra_addr; + struct sockaddr_in6 ifra_dstaddr; + struct sockaddr_in6 ifra_prefixmask; + int ifra_flags; + struct in6_addrlifetime ifra_lifetime; +}; + + +/* prefix type macro */ +#define IN6_PREFIX_ND 1 +#define IN6_PREFIX_RR 2 + +/* + * prefix related flags passed between kernel(NDP related part) and + * user land command(ifconfig) and daemon(rtadvd). + */ +struct in6_prflags { + struct prf_ra { + u_char onlink : 1; + u_char autonomous : 1; + u_char reserved : 6; + } prf_ra; + u_char prf_reserved1; + u_short prf_reserved2; + /* want to put this on 4byte offset */ + struct prf_rr { + u_char decrvalid : 1; + u_char decrprefd : 1; + u_char reserved : 6; + } prf_rr; + u_char prf_reserved3; + u_short prf_reserved4; +}; + +struct in6_prefixreq { + char ipr_name[IFNAMSIZ]; + u_char ipr_origin; + u_char ipr_plen; + u_int32_t ipr_vltime; + u_int32_t ipr_pltime; + struct in6_prflags ipr_flags; + struct sockaddr_in6 ipr_prefix; +}; + +#define PR_ORIG_RA 0 +#define PR_ORIG_RR 1 +#define PR_ORIG_STATIC 2 +#define PR_ORIG_KERNEL 3 + +#define ipr_raf_onlink ipr_flags.prf_ra.onlink +#define ipr_raf_auto ipr_flags.prf_ra.autonomous + +#define ipr_statef_onlink ipr_flags.prf_state.onlink + +#define ipr_rrf_decrvalid ipr_flags.prf_rr.decrvalid +#define ipr_rrf_decrprefd ipr_flags.prf_rr.decrprefd + +struct in6_rrenumreq { + char irr_name[IFNAMSIZ]; + u_char irr_origin; + u_char irr_m_len; /* match len for matchprefix */ + u_char irr_m_minlen; /* minlen for matching prefix */ + u_char irr_m_maxlen; /* maxlen for matching prefix */ + u_char irr_u_uselen; /* uselen for adding prefix */ + u_char irr_u_keeplen; /* keeplen from matching prefix */ + struct irr_raflagmask { + u_char onlink : 1; + u_char autonomous : 1; + u_char reserved : 6; + } irr_raflagmask; + u_int32_t irr_vltime; + u_int32_t irr_pltime; + struct in6_prflags irr_flags; + struct sockaddr_in6 irr_matchprefix; + struct sockaddr_in6 irr_useprefix; +}; + +#define irr_raf_mask_onlink irr_raflagmask.onlink +#define irr_raf_mask_auto irr_raflagmask.autonomous +#define irr_raf_mask_reserved irr_raflagmask.reserved + +#define irr_raf_onlink irr_flags.prf_ra.onlink +#define irr_raf_auto irr_flags.prf_ra.autonomous + +#define irr_statef_onlink irr_flags.prf_state.onlink + +#define irr_rrf irr_flags.prf_rr +#define irr_rrf_decrvalid irr_flags.prf_rr.decrvalid +#define irr_rrf_decrprefd irr_flags.prf_rr.decrprefd + + +/* + * Event data, internet6 style. + */ + +struct kev_in6_addrlifetime { + u_int32_t ia6t_expire; + u_int32_t ia6t_preferred; + u_int32_t ia6t_vltime; + u_int32_t ia6t_pltime; +}; + +struct kev_in6_data { + struct net_event_data link_data; + struct sockaddr_in6 ia_addr; /* interface address */ + struct sockaddr_in6 ia_net; /* network number of interface */ + struct sockaddr_in6 ia_dstaddr; /* space for destination addr */ + struct sockaddr_in6 ia_prefixmask; /* prefix mask */ + u_int32_t ia_plen; /* prefix length */ + u_int32_t ia6_flags; /* address flags from in6_ifaddr */ + struct kev_in6_addrlifetime ia_lifetime; /* address life info */ +}; + +/* + * Define inet6 event subclass and specific inet6 events. + */ + +#define KEV_INET6_SUBCLASS 6 /* inet6 subclass identifier */ + +#define KEV_INET6_NEW_USER_ADDR 1 /* Userland configured IPv6 address */ +#define KEV_INET6_CHANGED_ADDR 2 /* Address changed event (future) */ +#define KEV_INET6_ADDR_DELETED 3 /* IPv6 add. in ia_addr field was deleted */ +#define KEV_INET6_NEW_LL_ADDR 4 /* Autoconfigured linklocal address has appeared */ +#define KEV_INET6_NEW_RTADV_ADDR 5 /* Autoconf router advertised address has appeared */ +#define KEV_INET6_DEFROUTER 6 /* Default router dectected by kernel */ + + +#define IN6_ARE_MASKED_ADDR_EQUAL(d, a, m) ( \ + (((d)->s6_addr32[0] ^ (a)->s6_addr32[0]) & (m)->s6_addr32[0]) == 0 && \ + (((d)->s6_addr32[1] ^ (a)->s6_addr32[1]) & (m)->s6_addr32[1]) == 0 && \ + (((d)->s6_addr32[2] ^ (a)->s6_addr32[2]) & (m)->s6_addr32[2]) == 0 && \ + (((d)->s6_addr32[3] ^ (a)->s6_addr32[3]) & (m)->s6_addr32[3]) == 0 ) + +#define SIOCSIFADDR_IN6 _IOW('i', 12, struct in6_ifreq) +#define SIOCGIFADDR_IN6 _IOWR('i', 33, struct in6_ifreq) + +/* + * SIOCSxxx ioctls should be unused (see comments in in6.c), but + * we do not shift numbers for binary compatibility. + */ +#define SIOCSIFDSTADDR_IN6 _IOW('i', 14, struct in6_ifreq) +#define SIOCSIFNETMASK_IN6 _IOW('i', 22, struct in6_ifreq) + +#define SIOCGIFDSTADDR_IN6 _IOWR('i', 34, struct in6_ifreq) +#define SIOCGIFNETMASK_IN6 _IOWR('i', 37, struct in6_ifreq) + +#define SIOCDIFADDR_IN6 _IOW('i', 25, struct in6_ifreq) +#define SIOCAIFADDR_IN6 _IOW('i', 26, struct in6_aliasreq) + +#define SIOCSIFPHYADDR_IN6 _IOW('i', 62, struct in6_aliasreq) +#define SIOCGIFPSRCADDR_IN6 _IOWR('i', 63, struct in6_ifreq) +#define SIOCGIFPDSTADDR_IN6 _IOWR('i', 64, struct in6_ifreq) +#define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) +#define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist) +#define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_prlist) +#define OSIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ondireq) +#define SIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq) +#define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq) +#define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo) +#define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq) +#define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) + +#define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) +#define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) +#define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) +#define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) + +#define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq) +#define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq) + +#define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ + +#define SIOCSSCOPE6 _IOW('i', 88, struct in6_ifreq) +#define SIOCGSCOPE6 _IOWR('i', 89, struct in6_ifreq) +#define SIOCGSCOPE6DEF _IOWR('i', 90, struct in6_ifreq) + +#define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ +#define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */ +#define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */ +#define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */ +#define SIOCCIFPREFIX_IN6 _IOW('i', 104, \ + struct in6_rrenumreq) /* change */ +#define SIOCSGIFPREFIX_IN6 _IOW('i', 105, \ + struct in6_rrenumreq) /* set global */ + +#define SIOCGETSGCNT_IN6 _IOWR('u', 28, \ + struct sioc_sg_req6) /* get s,g pkt cnt */ +#define SIOCGETMIFCNT_IN6 _IOWR('u', 107, \ + struct sioc_mif_req6) /* get pkt cnt per if */ + + +#define IN6_IFF_ANYCAST 0x01 /* anycast address */ +#define IN6_IFF_TENTATIVE 0x02 /* tentative address */ +#define IN6_IFF_DUPLICATED 0x04 /* DAD detected duplicate */ +#define IN6_IFF_DETACHED 0x08 /* may be detached from the link */ +#define IN6_IFF_DEPRECATED 0x10 /* deprecated address */ +#define IN6_IFF_NODAD 0x20 /* don't perform DAD on this address + * (used only at first SIOC* call) + */ +#define IN6_IFF_AUTOCONF 0x40 /* autoconfigurable address. */ +#define IN6_IFF_TEMPORARY 0x80 /* temporary (anonymous) address. */ +#define IN6_IFF_NOPFX 0x8000 /* skip kernel prefix management. + * XXX: this should be temporary. + */ + +/* do not input/output */ +#define IN6_IFF_NOTREADY (IN6_IFF_TENTATIVE|IN6_IFF_DUPLICATED) + + +#endif /* _NETINET6_IN6_VAR_H_ */ diff --git a/i386/include/netinet6/ip6_fw.h b/i386/include/netinet6/ip6_fw.h new file mode 100644 index 0000000..8b619b3 --- /dev/null +++ b/i386/include/netinet6/ip6_fw.h @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2008 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1993 Daniel Boulet + * Copyright (c) 1994 Ugen J.S.Antsilevich + * + * Redistribution and use in source forms, with and without modification, + * are permitted provided that this entire comment appears intact. + * + * Redistribution in binary form may occur without any restrictions. + * Obviously, it would be nice if you gave credit where credit is due + * but requiring it would be too onerous. + * + * This software is provided ``AS IS'' without any warranties of any kind. + * + */ + +#ifndef _IP6_FW_H +#define _IP6_FW_H + +#include <sys/appleapiopts.h> + +/* + * Define IPv6 Firewall event subclass, and associated events. + */ + +/*! + @defined KEV_IP6FW_SUBCLASS + @discussion The kernel event subclass for IPv6 Firewall. +*/ +#define KEV_IP6FW_SUBCLASS 2 + +/*! + @defined KEV_IP6FW_ADD + @discussion The event code indicating a rule has been added. +*/ +#define KEV_IP6FW_ADD 1 + +/*! + @defined KEV_IP6FW_DEL + @discussion The event code indicating a rule has been removed. +*/ +#define KEV_IP6FW_DEL 2 + +/*! + @defined KEV_IP6FW_FLUSH + @discussion The event code indicating the rule set has been flushed. +*/ +#define KEV_IP6FW_FLUSH 3 + +/*! + @defined KEV_IP6FW_FLUSH + @discussion The event code indicating the enable flag has been changed +*/ +#define KEV_IP6FW_ENABLE 4 + + +#include <net/if.h> + +#define IPV6_FW_CURRENT_API_VERSION 20 /* Version of this API */ + + +/* + * This union structure identifies an interface, either explicitly + * by name or implicitly by IP address. The flags IP_FW_F_IIFNAME + * and IP_FW_F_OIFNAME say how to interpret this structure. An + * interface unit number of -1 matches any unit number, while an + * IP address of 0.0.0.0 indicates matches any interface. + * + * The receive and transmit interfaces are only compared against the + * the packet if the corresponding bit (IP_FW_F_IIFACE or IP_FW_F_OIFACE) + * is set. Note some packets lack a receive or transmit interface + * (in which case the missing "interface" never matches). + */ + +union ip6_fw_if { + struct in6_addr fu_via_ip6; /* Specified by IPv6 address */ + struct { /* Specified by interface name */ +#define IP6FW_IFNLEN IFNAMSIZ + char name[IP6FW_IFNLEN]; + short unit; /* -1 means match any unit */ + } fu_via_if; +}; + +/* + * Format of an IP firewall descriptor + * + * fw_src, fw_dst, fw_smsk, fw_dmsk are always stored in network byte order. + * fw_flg and fw_n*p are stored in host byte order (of course). + * Port numbers are stored in HOST byte order. + * Warning: setsockopt() will fail if sizeof(struct ip_fw) > MLEN (108) + */ + + +struct ip6_fw { + u_int32_t version; /* Version of this structure. Should always be */ + /* set to IP6_FW_CURRENT_API_VERSION by clients. */ + void *context; /* Context that is usable by user processes to */ + /* identify this rule. */ + u_int32_t fw_pcnt,fw_bcnt; /* Packet and byte counters */ + struct in6_addr fw_src, fw_dst; /* Source and destination IPv6 addr */ + struct in6_addr fw_smsk, fw_dmsk; /* Mask for src and dest IPv6 addr */ + u_short fw_number; /* Rule number */ + u_short fw_flg; /* Flags word */ +#define IPV6_FW_MAX_PORTS 10 /* A reasonable maximum */ + u_int fw_ipflg; /* IP flags word */ + u_short fw_pts[IPV6_FW_MAX_PORTS]; /* Array of port numbers to match */ + u_char fw_ip6opt,fw_ip6nopt; /* IPv6 options set/unset */ + u_char fw_tcpf,fw_tcpnf; /* TCP flags set/unset */ +#define IPV6_FW_ICMPTYPES_DIM (256 / (sizeof(unsigned) * 8)) + unsigned fw_icmp6types[IPV6_FW_ICMPTYPES_DIM]; /* ICMP types bitmap */ + long timestamp; /* timestamp (tv_sec) of last match */ + union ip6_fw_if fw_in_if, fw_out_if;/* Incoming and outgoing interfaces */ + union { + u_short fu_divert_port; /* Divert/tee port (options IP6DIVERT) */ + u_short fu_skipto_rule; /* SKIPTO command rule number */ + u_short fu_reject_code; /* REJECT response code */ + } fw_un; + u_char fw_prot; /* IPv6 protocol */ + u_char fw_nports; /* N'of src ports and # of dst ports */ + /* in ports array (dst ports follow */ + /* src ports; max of 10 ports in all; */ + /* count of 0 means match all ports) */ +}; + + +#define IPV6_FW_GETNSRCP(rule) ((rule)->fw_nports & 0x0f) +#define IPV6_FW_SETNSRCP(rule, n) do { \ + (rule)->fw_nports &= ~0x0f; \ + (rule)->fw_nports |= (n); \ + } while (0) +#define IPV6_FW_GETNDSTP(rule) ((rule)->fw_nports >> 4) +#define IPV6_FW_SETNDSTP(rule, n) do { \ + (rule)->fw_nports &= ~0xf0; \ + (rule)->fw_nports |= (n) << 4;\ + } while (0) + +#define fw_divert_port fw_un.fu_divert_port +#define fw_skipto_rule fw_un.fu_skipto_rule +#define fw_reject_code fw_un.fu_reject_code + +struct ip6_fw_chain { + LIST_ENTRY(ip6_fw_chain) chain; + struct ip6_fw *rule; +}; + +/* + * Values for "flags" field . + */ +#define IPV6_FW_F_IN 0x0001 /* Check inbound packets */ +#define IPV6_FW_F_OUT 0x0002 /* Check outbound packets */ +#define IPV6_FW_F_IIFACE 0x0004 /* Apply inbound interface test */ +#define IPV6_FW_F_OIFACE 0x0008 /* Apply outbound interface test */ + +#define IPV6_FW_F_COMMAND 0x0070 /* Mask for type of chain entry: */ +#define IPV6_FW_F_DENY 0x0000 /* This is a deny rule */ +#define IPV6_FW_F_REJECT 0x0010 /* Deny and send a response packet */ +#define IPV6_FW_F_ACCEPT 0x0020 /* This is an accept rule */ +#define IPV6_FW_F_COUNT 0x0030 /* This is a count rule */ +#define IPV6_FW_F_DIVERT 0x0040 /* This is a divert rule */ +#define IPV6_FW_F_TEE 0x0050 /* This is a tee rule */ +#define IPV6_FW_F_SKIPTO 0x0060 /* This is a skipto rule */ + +#define IPV6_FW_F_PRN 0x0080 /* Print if this rule matches */ + +#define IPV6_FW_F_SRNG 0x0100 /* The first two src ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IPV6_FW_F_DRNG 0x0200 /* The first two dst ports are a min * + * and max range (stored in host byte * + * order). */ + +#define IPV6_FW_F_IIFNAME 0x0400 /* In interface by name/unit (not IP) */ +#define IPV6_FW_F_OIFNAME 0x0800 /* Out interface by name/unit (not IP) */ + +#define IPV6_FW_F_INVSRC 0x1000 /* Invert sense of src check */ +#define IPV6_FW_F_INVDST 0x2000 /* Invert sense of dst check */ + +#define IPV6_FW_F_FRAG 0x4000 /* Fragment */ + +#define IPV6_FW_F_ICMPBIT 0x8000 /* ICMP type bitmap is valid */ + +#define IPV6_FW_F_MASK 0xFFFF /* All possible flag bits mask */ + +/* + * Flags for the 'fw_ipflg' field, for comparing values of ip and its protocols. */ +#define IPV6_FW_IF_TCPEST 0x00000020 /* established TCP connection */ +#define IPV6_FW_IF_TCPMSK 0x00000020 /* mask of all TCP values */ + +/* + * For backwards compatibility with rules specifying "via iface" but + * not restricted to only "in" or "out" packets, we define this combination + * of bits to represent this configuration. + */ + +#define IF6_FW_F_VIAHACK (IPV6_FW_F_IN|IPV6_FW_F_OUT|IPV6_FW_F_IIFACE|IPV6_FW_F_OIFACE) + +/* + * Definitions for REJECT response codes. + * Values less than 256 correspond to ICMP unreachable codes. + */ +#define IPV6_FW_REJECT_RST 0x0100 /* TCP packets: send RST */ + +/* + * Definitions for IPv6 option names. + */ +#define IPV6_FW_IP6OPT_HOPOPT 0x01 +#define IPV6_FW_IP6OPT_ROUTE 0x02 +#define IPV6_FW_IP6OPT_FRAG 0x04 +#define IPV6_FW_IP6OPT_ESP 0x08 +#define IPV6_FW_IP6OPT_AH 0x10 +#define IPV6_FW_IP6OPT_NONXT 0x20 +#define IPV6_FW_IP6OPT_OPTS 0x40 + +/* + * Definitions for TCP flags. + */ +#define IPV6_FW_TCPF_FIN TH_FIN +#define IPV6_FW_TCPF_SYN TH_SYN +#define IPV6_FW_TCPF_RST TH_RST +#define IPV6_FW_TCPF_PSH TH_PUSH +#define IPV6_FW_TCPF_ACK TH_ACK +#define IPV6_FW_TCPF_URG TH_URG + +/* + * Main firewall chains definitions and global var's definitions. + */ + +#endif /* _IP6_FW_H */ diff --git a/i386/include/netinet6/ip6_mroute.h b/i386/include/netinet6/ip6_mroute.h new file mode 100644 index 0000000..4a935d9 --- /dev/null +++ b/i386/include/netinet6/ip6_mroute.h @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.2.2.2 2001/07/03 11:01:53 ume Exp $ */ +/* $KAME: ip6_mroute.h,v 1.17 2001/02/10 02:05:52 itojun Exp $ */ + +/* + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* BSDI ip_mroute.h,v 2.5 1996/10/11 16:01:48 pjd Exp */ + +/* + * Definitions for IP multicast forwarding. + * + * Written by David Waitzman, BBN Labs, August 1988. + * Modified by Steve Deering, Stanford, February 1989. + * Modified by Ajit Thyagarajan, PARC, August 1993. + * Modified by Ajit Thyagarajan, PARC, August 1994. + * Modified by Ahmed Helmy, USC, September 1996. + * + * MROUTING Revision: 1.2 + */ + +#ifndef _NETINET6_IP6_MROUTE_H_ +#define _NETINET6_IP6_MROUTE_H_ +#include <sys/appleapiopts.h> + +/* + * Multicast Routing set/getsockopt commands. + */ +#define MRT6_DONE 101 /* shut down forwarder */ +#define MRT6_ADD_MIF 102 /* add multicast interface */ +#define MRT6_DEL_MIF 103 /* delete multicast interface */ +#define MRT6_ADD_MFC 104 /* insert forwarding cache entry */ +#define MRT6_DEL_MFC 105 /* delete forwarding cache entry */ +#define MRT6_PIM 107 /* enable pim code */ +#define MRT6_INIT 108 /* initialize forwarder (mrt6msg) */ + +#ifdef __APPLE__ +#define GET_TIME(t) getmicrotime(&t) +#endif + +/* + * Types and macros for handling bitmaps with one bit per multicast interface. + */ +typedef u_short mifi_t; /* type of a mif index */ +#define MAXMIFS 64 + +#ifndef IF_SETSIZE +#define IF_SETSIZE 256 +#endif + +typedef u_int32_t if_mask; +#define NIFBITS (sizeof(if_mask) * NBBY) /* bits per mask */ + +#ifndef howmany +#define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) +#endif + +typedef struct if_set { + if_mask ifs_bits[howmany(IF_SETSIZE, NIFBITS)]; +} if_set; + +#define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS))) +#define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS))) +#define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS))) +#define IF_COPY(f, t) bcopy(f, t, sizeof(*(f))) +#define IF_ZERO(p) bzero(p, sizeof(*(p))) + +/* + * Argument structure for MRT6_ADD_IF. + */ +struct mif6ctl { + mifi_t mif6c_mifi; /* the index of the mif to be added */ + u_char mif6c_flags; /* MIFF_ flags defined below */ + u_short mif6c_pifi; /* the index of the physical IF */ +#if notyet + u_int mif6c_rate_limit; /* max rate */ +#endif +}; + +#define MIFF_REGISTER 0x1 /* mif represents a register end-point */ + +/* + * Argument structure for MRT6_ADD_MFC and MRT6_DEL_MFC + */ +struct mf6cctl { + struct sockaddr_in6 mf6cc_origin; /* IPv6 origin of mcasts */ + struct sockaddr_in6 mf6cc_mcastgrp; /* multicast group associated */ + mifi_t mf6cc_parent; /* incoming ifindex */ + struct if_set mf6cc_ifset; /* set of forwarding ifs */ +}; + +/* + * The kernel's multicast routing statistics. + */ +struct mrt6stat { + u_quad_t mrt6s_mfc_lookups; /* # forw. cache hash table hits */ + u_quad_t mrt6s_mfc_misses; /* # forw. cache hash table misses */ + u_quad_t mrt6s_upcalls; /* # calls to mrouted */ + u_quad_t mrt6s_no_route; /* no route for packet's origin */ + u_quad_t mrt6s_bad_tunnel; /* malformed tunnel options */ + u_quad_t mrt6s_cant_tunnel; /* no room for tunnel options */ + u_quad_t mrt6s_wrong_if; /* arrived on wrong interface */ + u_quad_t mrt6s_upq_ovflw; /* upcall Q overflow */ + u_quad_t mrt6s_cache_cleanups; /* # entries with no upcalls */ + u_quad_t mrt6s_drop_sel; /* pkts dropped selectively */ + u_quad_t mrt6s_q_overflow; /* pkts dropped - Q overflow */ + u_quad_t mrt6s_pkt2large; /* pkts dropped - size > BKT SIZE */ + u_quad_t mrt6s_upq_sockfull; /* upcalls dropped - socket full */ +}; + + +/* + * Structure used to communicate from kernel to multicast router. + * We'll overlay the structure onto an MLD header (not an IPv6 header + * like igmpmsg{} used for IPv4 implementation). This is because this + * structure will be passed via an IPv6 raw socket, on which an application + * will only receive the payload i.e. the data after the IPv6 header and all + * the extension headers. (see Section 3 of draft-ietf-ipngwg-2292bis-01) + */ +struct mrt6msg { +#define MRT6MSG_NOCACHE 1 +#define MRT6MSG_WRONGMIF 2 +#define MRT6MSG_WHOLEPKT 3 /* used for user level encap*/ + u_char im6_mbz; /* must be zero */ + u_char im6_msgtype; /* what type of message */ + u_int16_t im6_mif; /* mif rec'd on */ + u_int32_t im6_pad; /* padding for 64bit arch */ + struct in6_addr im6_src, im6_dst; +}; + +/* + * Argument structure used by multicast routing daemon to get src-grp + * packet counts + */ +struct sioc_sg_req6 { + struct sockaddr_in6 src; + struct sockaddr_in6 grp; + u_quad_t pktcnt; + u_quad_t bytecnt; + u_quad_t wrong_if; +}; + +/* + * Argument structure used by mrouted to get mif pkt counts + */ +struct sioc_mif_req6 { + mifi_t mifi; /* mif number */ + u_quad_t icount; /* Input packet count on mif */ + u_quad_t ocount; /* Output packet count on mif */ + u_quad_t ibytes; /* Input byte count on mif */ + u_quad_t obytes; /* Output byte count on mif */ +}; + + + +#endif /* !_NETINET6_IP6_MROUTE_H_ */ diff --git a/i386/include/netinet6/ipcomp.h b/i386/include/netinet6/ipcomp.h new file mode 100644 index 0000000..6f62011 --- /dev/null +++ b/i386/include/netinet6/ipcomp.h @@ -0,0 +1,57 @@ +/* $FreeBSD: src/sys/netinet6/ipcomp.h,v 1.1.2.2 2001/07/03 11:01:54 ume Exp $ */ +/* $KAME: ipcomp.h,v 1.8 2000/09/26 07:55:14 itojun Exp $ */ + +/* + * Copyright (C) 1999 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * RFC2393 IP payload compression protocol (IPComp). + */ + +#ifndef _NETINET6_IPCOMP_H_ +#define _NETINET6_IPCOMP_H_ +#include <sys/appleapiopts.h> +#include <netinet6/ipsec.h> + +struct ipcomp { + u_int8_t comp_nxt; /* Next Header */ + u_int8_t comp_flags; /* reserved, must be zero */ + u_int16_t comp_cpi; /* Compression parameter index */ +}; + +/* well-known algorithm number (in CPI), from RFC2409 */ +#define IPCOMP_OUI 1 /* vendor specific */ +#define IPCOMP_DEFLATE 2 /* RFC2394 */ +#define IPCOMP_LZS 3 /* RFC2395 */ +#define IPCOMP_MAX 4 + +#define IPCOMP_CPI_NEGOTIATE_MIN 256 + + +#endif /* _NETINET6_IPCOMP_H_ */ diff --git a/i386/include/netinet6/ipsec.h b/i386/include/netinet6/ipsec.h new file mode 100644 index 0000000..2d2e952 --- /dev/null +++ b/i386/include/netinet6/ipsec.h @@ -0,0 +1,137 @@ +/* $FreeBSD: src/sys/netinet6/ipsec.h,v 1.4.2.2 2001/07/03 11:01:54 ume Exp $ */ +/* $KAME: ipsec.h,v 1.44 2001/03/23 08:08:47 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * IPsec controller part. + */ + +#ifndef _NETINET6_IPSEC_H_ +#define _NETINET6_IPSEC_H_ +#include <sys/cdefs.h> +#include <sys/appleapiopts.h> + +#include <net/pfkeyv2.h> + +/* according to IANA assignment, port 0x0000 and proto 0xff are reserved. */ +#define IPSEC_PORT_ANY 0 +#define IPSEC_ULPROTO_ANY 255 +#define IPSEC_PROTO_ANY 255 + +/* mode of security protocol */ +/* NOTE: DON'T use IPSEC_MODE_ANY at SPD. It's only use in SAD */ +#define IPSEC_MODE_ANY 0 /* i.e. wildcard. */ +#define IPSEC_MODE_TRANSPORT 1 +#define IPSEC_MODE_TUNNEL 2 + +/* + * Direction of security policy. + * NOTE: Since INVALID is used just as flag. + * The other are used for loop counter too. + */ +#define IPSEC_DIR_ANY 0 +#define IPSEC_DIR_INBOUND 1 +#define IPSEC_DIR_OUTBOUND 2 +#define IPSEC_DIR_MAX 3 +#define IPSEC_DIR_INVALID 4 + +/* Policy level */ +/* + * IPSEC, ENTRUST and BYPASS are allowed for setsockopt() in PCB, + * DISCARD, IPSEC and NONE are allowed for setkey() in SPD. + * DISCARD and NONE are allowed for system default. + */ +#define IPSEC_POLICY_DISCARD 0 /* discarding packet */ +#define IPSEC_POLICY_NONE 1 /* through IPsec engine */ +#define IPSEC_POLICY_IPSEC 2 /* do IPsec */ +#define IPSEC_POLICY_ENTRUST 3 /* consulting SPD if present. */ +#define IPSEC_POLICY_BYPASS 4 /* only for privileged socket. */ +#define IPSEC_POLICY_GENERATE 5 /* same as discard - IKE daemon can override with generated policy */ + +/* Security protocol level */ +#define IPSEC_LEVEL_DEFAULT 0 /* reference to system default */ +#define IPSEC_LEVEL_USE 1 /* use SA if present. */ +#define IPSEC_LEVEL_REQUIRE 2 /* require SA. */ +#define IPSEC_LEVEL_UNIQUE 3 /* unique SA. */ + +#define IPSEC_MANUAL_REQID_MAX 0x3fff + /* + * if security policy level == unique, this id + * indicate to a relative SA for use, else is + * zero. + * 1 - 0x3fff are reserved for manual keying. + * 0 are reserved for above reason. Others is + * for kernel use. + * Note that this id doesn't identify SA + * by only itself. + */ +#define IPSEC_REPLAYWSIZE 32 + +/* statistics for ipsec processing */ +struct ipsecstat { + u_quad_t in_success; /* succeeded inbound process */ + u_quad_t in_polvio; + /* security policy violation for inbound process */ + u_quad_t in_nosa; /* inbound SA is unavailable */ + u_quad_t in_inval; /* inbound processing failed due to EINVAL */ + u_quad_t in_nomem; /* inbound processing failed due to ENOBUFS */ + u_quad_t in_badspi; /* failed getting a SPI */ + u_quad_t in_ahreplay; /* AH replay check failed */ + u_quad_t in_espreplay; /* ESP replay check failed */ + u_quad_t in_ahauthsucc; /* AH authentication success */ + u_quad_t in_ahauthfail; /* AH authentication failure */ + u_quad_t in_espauthsucc; /* ESP authentication success */ + u_quad_t in_espauthfail; /* ESP authentication failure */ + u_quad_t in_esphist[256]; + u_quad_t in_ahhist[256]; + u_quad_t in_comphist[256]; + u_quad_t out_success; /* succeeded outbound process */ + u_quad_t out_polvio; + /* security policy violation for outbound process */ + u_quad_t out_nosa; /* outbound SA is unavailable */ + u_quad_t out_inval; /* outbound process failed due to EINVAL */ + u_quad_t out_nomem; /* inbound processing failed due to ENOBUFS */ + u_quad_t out_noroute; /* there is no route */ + u_quad_t out_esphist[256]; + u_quad_t out_ahhist[256]; + u_quad_t out_comphist[256]; +}; + + +__BEGIN_DECLS +extern caddr_t ipsec_set_policy(char *, int); +extern int ipsec_get_policylen(caddr_t); +extern char *ipsec_dump_policy(caddr_t, char *); + +extern const char *ipsec_strerror(void); +__END_DECLS + +#endif /* _NETINET6_IPSEC_H_ */ diff --git a/i386/include/netinet6/nd6.h b/i386/include/netinet6/nd6.h new file mode 100644 index 0000000..4d5813c --- /dev/null +++ b/i386/include/netinet6/nd6.h @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/nd6.h,v 1.2.2.3 2001/08/13 01:10:49 simokawa Exp $ */ +/* $KAME: nd6.h,v 1.55 2001/04/27 15:09:49 itojun Exp $ */ + +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _NETINET6_ND6_H_ +#define _NETINET6_ND6_H_ +#include <sys/appleapiopts.h> + +/* see net/route.h, or net/if_inarp.h */ +#ifndef RTF_ANNOUNCE +#define RTF_ANNOUNCE RTF_PROTO2 +#endif + +#include <sys/queue.h> + + +#define ND6_LLINFO_PURGE -3 +#define ND6_LLINFO_NOSTATE -2 +/* + * We don't need the WAITDELETE state any more, but we keep the definition + * in a comment line instead of removing it. This is necessary to avoid + * unintentionally reusing the value for another purpose, which might + * affect backward compatibility with old applications. + * (20000711 jinmei@kame.net) + */ +/* #define ND6_LLINFO_WAITDELETE -1 */ +#define ND6_LLINFO_INCOMPLETE 0 +#define ND6_LLINFO_REACHABLE 1 +#define ND6_LLINFO_STALE 2 +#define ND6_LLINFO_DELAY 3 +#define ND6_LLINFO_PROBE 4 + + +struct nd_ifinfo { + u_int32_t linkmtu; /* LinkMTU */ + u_int32_t maxmtu; /* Upper bound of LinkMTU */ + u_int32_t basereachable; /* BaseReachableTime */ + u_int32_t reachable; /* Reachable Time */ + u_int32_t retrans; /* Retrans Timer */ + u_int32_t flags; /* Flags */ + int recalctm; /* BaseReacable re-calculation timer */ + u_int8_t chlim; /* CurHopLimit */ + u_int8_t receivedra; + /* the following 3 members are for privacy extension for addrconf */ + u_int8_t randomseed0[8]; /* upper 64 bits of MD5 digest */ + u_int8_t randomseed1[8]; /* lower 64 bits (usually the EUI64 IFID) */ + u_int8_t randomid[8]; /* current random ID */ +}; + + +#define ND6_IFF_PERFORMNUD 0x1 + +struct in6_nbrinfo { + char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct in6_addr addr; /* IPv6 address of the neighbor */ + long asked; /* number of queries already sent for this addr */ + int isrouter; /* if it acts as a router */ + int state; /* reachability state */ + int expire; /* lifetime for NDP state transition */ +}; + + +#define DRLSTSIZ 10 +#define PRLSTSIZ 10 + +struct in6_drlist { + char ifname[IFNAMSIZ]; + struct { + struct in6_addr rtaddr; + u_char flags; + u_short rtlifetime; + u_long expire; + u_short if_index; + } defrouter[DRLSTSIZ]; +}; + + +struct in6_defrouter { + struct sockaddr_in6 rtaddr; + u_char flags; + u_short rtlifetime; + u_long expire; + u_short if_index; +}; + + +struct in6_prlist { + char ifname[IFNAMSIZ]; + struct { + struct in6_addr prefix; + struct prf_ra raflags; + u_char prefixlen; + u_char origin; + u_long vltime; + u_long pltime; + u_long expire; + u_short if_index; + u_short advrtrs; /* number of advertisement routers */ + struct in6_addr advrtr[DRLSTSIZ]; /* XXX: explicit limit */ + } prefix[PRLSTSIZ]; +}; + + +struct in6_prefix { + struct sockaddr_in6 prefix; + struct prf_ra raflags; + u_char prefixlen; + u_char origin; + u_long vltime; + u_long pltime; + u_long expire; + u_int32_t flags; + int refcnt; + u_short if_index; + u_short advrtrs; /* number of advertisement routers */ + /* struct sockaddr_in6 advrtr[] */ +}; + + +struct in6_ondireq { + char ifname[IFNAMSIZ]; + struct { + u_int32_t linkmtu; /* LinkMTU */ + u_int32_t maxmtu; /* Upper bound of LinkMTU */ + u_int32_t basereachable; /* BaseReachableTime */ + u_int32_t reachable; /* Reachable Time */ + u_int32_t retrans; /* Retrans Timer */ + u_int32_t flags; /* Flags */ + int recalctm; /* BaseReacable re-calculation timer */ + u_int8_t chlim; /* CurHopLimit */ + u_int8_t receivedra; + } ndi; +}; + +struct in6_ndireq { + char ifname[IFNAMSIZ]; + struct nd_ifinfo ndi; +}; + +struct in6_ndifreq { + char ifname[IFNAMSIZ]; + u_long ifindex; +}; + + +/* Prefix status */ +#define NDPRF_ONLINK 0x1 +#define NDPRF_DETACHED 0x2 + +/* protocol constants */ +#define MAX_RTR_SOLICITATION_DELAY 1 /*1sec*/ +#define RTR_SOLICITATION_INTERVAL 4 /*4sec*/ +#define MAX_RTR_SOLICITATIONS 3 + +#define ND6_INFINITE_LIFETIME 0xffffffff + + +#endif /* _NETINET6_ND6_H_ */ diff --git a/i386/include/netinet6/pim6.h b/i386/include/netinet6/pim6.h new file mode 100644 index 0000000..1ae3f1a --- /dev/null +++ b/i386/include/netinet6/pim6.h @@ -0,0 +1,70 @@ +/* $FreeBSD: src/sys/netinet6/pim6.h,v 1.1.2.1 2000/07/15 07:14:36 kris Exp $ */ +/* $KAME: pim6.h,v 1.3 2000/03/25 07:23:58 sumikawa Exp $ */ + +/* + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * Protocol Independent Multicast (PIM) definitions + * + * Written by Ahmed Helmy, SGI, July 1996 + * + * MULTICAST + */ +#include <sys/appleapiopts.h> + +/* + * PIM packet header + */ +#define PIM_VERSION 2 +struct pim { +#if defined(BYTE_ORDER) && (BYTE_ORDER == LITTLE_ENDIAN) + u_char pim_type:4, /* the PIM message type, currently they are: + * Hello, Register, Register-Stop, Join/Prune, + * Bootstrap, Assert, Graft (PIM-DM only), + * Graft-Ack (PIM-DM only), C-RP-Adv + */ + pim_ver:4; /* PIM version number; 2 for PIMv2 */ +#else + u_char pim_ver:4, /* PIM version */ + pim_type:4; /* PIM type */ +#endif + u_char pim_rsv; /* Reserved */ + u_short pim_cksum; /* IP style check sum */ +}; + +#define PIM_MINLEN 8 /* The header min. length is 8 */ +#define PIM6_REG_MINLEN (PIM_MINLEN+40) /* Register message + inner IP6 header */ + +/* + * Message types + */ +#define PIM_REGISTER 1 /* PIM Register type is 1 */ + +/* second bit in reg_head is the null bit */ +#define PIM_NULL_REGISTER 0x40000000 diff --git a/i386/include/netinet6/raw_ip6.h b/i386/include/netinet6/raw_ip6.h new file mode 100644 index 0000000..2a506d4 --- /dev/null +++ b/i386/include/netinet6/raw_ip6.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* $FreeBSD: src/sys/netinet6/raw_ip6.h,v 1.1.2.1 2001/07/03 11:01:55 ume Exp $ */ +/* $KAME: raw_ip6.h,v 1.2 2001/05/27 13:28:35 itojun Exp $ */ + +/* + * Copyright (C) 2001 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _NETINET6_RAW_IP6_H_ +#define _NETINET6_RAW_IP6_H_ +#include <sys/appleapiopts.h> + +/* + * ICMPv6 stat is counted separately. see netinet/icmp6.h + */ +struct rip6stat { + u_quad_t rip6s_ipackets; /* total input packets */ + u_quad_t rip6s_isum; /* input checksum computations */ + u_quad_t rip6s_badsum; /* of above, checksum error */ + u_quad_t rip6s_nosock; /* no matching socket */ + u_quad_t rip6s_nosockmcast; /* of above, arrived as multicast */ + u_quad_t rip6s_fullsock; /* not delivered, input socket full */ + + u_quad_t rip6s_opackets; /* total output packets */ +}; + +#endif diff --git a/i386/include/runetype.h b/i386/include/runetype.h new file mode 100644 index 0000000..fd16b82 --- /dev/null +++ b/i386/include/runetype.h @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Paul Borman at Krystal Technologies. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)runetype.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _RUNETYPE_H_ +#define _RUNETYPE_H_ + +#include <_types.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#ifndef _CT_RUNE_T +#define _CT_RUNE_T +typedef __darwin_ct_rune_t ct_rune_t; +#endif + +#ifndef _RUNE_T +#define _RUNE_T +typedef __darwin_rune_t rune_t; +#endif + +#ifndef __cplusplus +#ifndef _WCHAR_T +#define _WCHAR_T +typedef __darwin_wchar_t wchar_t; +#endif /* _WCHAR_T */ +#endif /* __cplusplus */ + +#ifndef _WINT_T +#define _WINT_T +typedef __darwin_wint_t wint_t; +#endif + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */ +#define _CRMASK (~(_CACHED_RUNES - 1)) + +/* + * The lower 8 bits of runetype[] contain the digit value of the rune. + */ +typedef struct { + __darwin_rune_t __min; /* First rune of the range */ + __darwin_rune_t __max; /* Last rune (inclusive) of the range */ + __darwin_rune_t __map; /* What first maps to in maps */ + __uint32_t *__types; /* Array of types in range */ +} _RuneEntry; + +typedef struct { + int __nranges; /* Number of ranges stored */ + _RuneEntry *__ranges; /* Pointer to the ranges */ +} _RuneRange; + +typedef struct { + char __name[14]; /* CHARCLASS_NAME_MAX = 14 */ + __uint32_t __mask; /* charclass mask */ +} _RuneCharClass; + +typedef struct { + char __magic[8]; /* Magic saying what version we are */ + char __encoding[32]; /* ASCII name of this encoding */ + + __darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **); + int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **); + __darwin_rune_t __invalid_rune; + + __uint32_t __runetype[_CACHED_RUNES]; + __darwin_rune_t __maplower[_CACHED_RUNES]; + __darwin_rune_t __mapupper[_CACHED_RUNES]; + + /* + * The following are to deal with Runes larger than _CACHED_RUNES - 1. + * Their data is actually contiguous with this structure so as to make + * it easier to read/write from/to disk. + */ + _RuneRange __runetype_ext; + _RuneRange __maplower_ext; + _RuneRange __mapupper_ext; + + void *__variable; /* Data which depends on the encoding */ + int __variable_len; /* how long that data is */ + + /* + * extra fields to deal with arbitrary character classes + */ + int __ncharclasses; + _RuneCharClass *__charclasses; +} _RuneLocale; + +#define _RUNE_MAGIC_A "RuneMagA" /* Indicates version A of RuneLocale */ + +__BEGIN_DECLS +extern _RuneLocale _DefaultRuneLocale; +extern _RuneLocale *_CurrentRuneLocale; +__END_DECLS + +#endif /* !_RUNETYPE_H_ */ diff --git a/i386/include/secure/.svn/all-wcprops b/i386/include/secure/.svn/all-wcprops new file mode 100644 index 0000000..bf6658d --- /dev/null +++ b/i386/include/secure/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/secure +END +_stdio.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/secure/_stdio.h +END +_common.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/secure/_common.h +END diff --git a/i386/include/secure/.svn/entries b/i386/include/secure/.svn/entries new file mode 100644 index 0000000..85e7fa0 --- /dev/null +++ b/i386/include/secure/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/secure +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +_stdio.h +file + + + + +2013-08-27T23:54:33.000000Z +ec054021b597fca001c52c8241a1d1e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2311 + +_common.h +file + + + + +2013-08-27T23:54:33.000000Z +4c7423afc6f11f403526f25b5279cd8b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1418 + diff --git a/i386/include/secure/.svn/text-base/_common.h.svn-base b/i386/include/secure/.svn/text-base/_common.h.svn-base new file mode 100644 index 0000000..53e1a02 --- /dev/null +++ b/i386/include/secure/.svn/text-base/_common.h.svn-base @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SECURE__COMMON_H_ +#define _SECURE__COMMON_H_ + +#undef _USE_FORTIFY_LEVEL +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +# if _FORTIFY_SOURCE > 1 +# define _USE_FORTIFY_LEVEL 2 +# else +# define _USE_FORTIFY_LEVEL 1 +# endif +#else +# define _USE_FORTIFY_LEVEL 0 +#endif + +#define __darwin_obsz0(object) __builtin_object_size (object, 0) +#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1) + +#endif diff --git a/i386/include/secure/.svn/text-base/_stdio.h.svn-base b/i386/include/secure/.svn/text-base/_stdio.h.svn-base new file mode 100644 index 0000000..9d1b163 --- /dev/null +++ b/i386/include/secure/.svn/text-base/_stdio.h.svn-base @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _STDIO_H_ + #error error "Never use <secure/_stdio.h> directly; include <stdio.h> instead." +#endif + +#ifndef _SECURE__STDIO_H_ +#define _SECURE__STDIO_H_ + +#include <secure/_common.h> + +#if _USE_FORTIFY_LEVEL > 0 + +#undef sprintf +#undef vsprintf +#undef snprintf +#undef vsnprintf + +/* sprintf, vsprintf, snprintf, vsnprintf */ + +extern int __sprintf_chk (char * __restrict, int, size_t, + const char * __restrict, ...) + __DARWIN_LDBL_COMPAT (__sprintf_chk); + +#define sprintf(str, ...) \ + __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) + +extern int __snprintf_chk (char * __restrict, size_t, int, size_t, + const char * __restrict, ...) + __DARWIN_LDBL_COMPAT (__snprintf_chk); + +#define snprintf(str, len, ...) \ + __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) + +extern int __vsprintf_chk (char * __restrict, int, size_t, + const char * __restrict, va_list) + __DARWIN_LDBL_COMPAT (__vsprintf_chk); + +#define vsprintf(str, format, ap) \ + __builtin___vsprintf_chk (str, 0, __darwin_obsz(str), format, ap) + +extern int __vsnprintf_chk (char * __restrict, size_t, int, size_t, + const char * __restrict, va_list) + __DARWIN_LDBL_COMPAT (__vsnprintf_chk); + +#define vsnprintf(str, len, format, ap) \ + __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap) + + +#endif + +#endif diff --git a/i386/include/secure/_common.h b/i386/include/secure/_common.h new file mode 100644 index 0000000..53e1a02 --- /dev/null +++ b/i386/include/secure/_common.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2007, 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _SECURE__COMMON_H_ +#define _SECURE__COMMON_H_ + +#undef _USE_FORTIFY_LEVEL +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +# if _FORTIFY_SOURCE > 1 +# define _USE_FORTIFY_LEVEL 2 +# else +# define _USE_FORTIFY_LEVEL 1 +# endif +#else +# define _USE_FORTIFY_LEVEL 0 +#endif + +#define __darwin_obsz0(object) __builtin_object_size (object, 0) +#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1) + +#endif diff --git a/i386/include/secure/_stdio.h b/i386/include/secure/_stdio.h new file mode 100644 index 0000000..9d1b163 --- /dev/null +++ b/i386/include/secure/_stdio.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef _STDIO_H_ + #error error "Never use <secure/_stdio.h> directly; include <stdio.h> instead." +#endif + +#ifndef _SECURE__STDIO_H_ +#define _SECURE__STDIO_H_ + +#include <secure/_common.h> + +#if _USE_FORTIFY_LEVEL > 0 + +#undef sprintf +#undef vsprintf +#undef snprintf +#undef vsnprintf + +/* sprintf, vsprintf, snprintf, vsnprintf */ + +extern int __sprintf_chk (char * __restrict, int, size_t, + const char * __restrict, ...) + __DARWIN_LDBL_COMPAT (__sprintf_chk); + +#define sprintf(str, ...) \ + __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) + +extern int __snprintf_chk (char * __restrict, size_t, int, size_t, + const char * __restrict, ...) + __DARWIN_LDBL_COMPAT (__snprintf_chk); + +#define snprintf(str, len, ...) \ + __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) + +extern int __vsprintf_chk (char * __restrict, int, size_t, + const char * __restrict, va_list) + __DARWIN_LDBL_COMPAT (__vsprintf_chk); + +#define vsprintf(str, format, ap) \ + __builtin___vsprintf_chk (str, 0, __darwin_obsz(str), format, ap) + +extern int __vsnprintf_chk (char * __restrict, size_t, int, size_t, + const char * __restrict, va_list) + __DARWIN_LDBL_COMPAT (__vsnprintf_chk); + +#define vsnprintf(str, len, format, ap) \ + __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap) + + +#endif + +#endif diff --git a/i386/include/setjmp.h b/i386/include/setjmp.h new file mode 100644 index 0000000..4fced23 --- /dev/null +++ b/i386/include/setjmp.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#ifndef _BSD_SETJMP_H +#define _BSD_SETJMP_H + +#include <machine/setjmp.h> + +#endif /* _BSD_SETJMP_H */ diff --git a/i386/include/signal.h b/i386/include/signal.h new file mode 100644 index 0000000..08ad77e --- /dev/null +++ b/i386/include/signal.h @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)signal.h 8.3 (Berkeley) 3/30/94 + */ + +#ifndef _USER_SIGNAL_H +#define _USER_SIGNAL_H + +#include <sys/cdefs.h> +#include <_types.h> +#include <sys/signal.h> + +#ifndef _PTHREAD_T +typedef __darwin_pthread_t pthread_t; +#define _PTHREAD_T +#endif + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern __const char *__const sys_signame[NSIG]; +extern __const char *__const sys_siglist[NSIG]; +#endif + +__BEGIN_DECLS +int raise(int); +__END_DECLS + +#ifndef _ANSI_SOURCE +__BEGIN_DECLS +void (*bsd_signal(int, void (*)(int)))(int); +//Begin-Libc +#ifndef LIBC_ALIAS_KILL +//End-Libc +int kill(pid_t, int) __DARWIN_ALIAS(kill); +//Begin-Libc +#else /* LIBC_ALIAS_KILL */ +int kill(pid_t, int) LIBC_ALIAS(kill); +#endif /* !LIBC_ALIAS_KILL */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_KILLPG +//End-Libc +int killpg(pid_t, int) __DARWIN_ALIAS(killpg); +//Begin-Libc +#else /* LIBC_ALIAS_KILLPG */ +int killpg(pid_t, int) LIBC_ALIAS(killpg); +#endif /* !LIBC_ALIAS_KILLPG */ +//End-Libc +int pthread_kill(pthread_t, int); +//Begin-Libc +#ifndef LIBC_ALIAS_PTHREAD_SIGMASK +//End-Libc +int pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask); +//Begin-Libc +#else /* LIBC_ALIAS_PTHREAD_SIGMASK */ +int pthread_sigmask(int, const sigset_t *, sigset_t *) LIBC_ALIAS(pthread_sigmask); +#endif /* !LIBC_ALIAS_PTHREAD_SIGMASK */ +//End-Libc +int sigaction(int, const struct sigaction * __restrict, + struct sigaction * __restrict); +int sigaddset(sigset_t *, int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGALTSTACK +//End-Libc +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) __DARWIN_ALIAS(sigaltstack); +//Begin-Libc +#else /* LIBC_ALIAS_SIGALTSTACK */ +int sigaltstack(const stack_t * __restrict, stack_t * __restrict) LIBC_ALIAS(sigaltstack); +#endif /* !LIBC_ALIAS_SIGALTSTACK */ +//End-Libc +int sigdelset(sigset_t *, int); +int sigemptyset(sigset_t *); +int sigfillset(sigset_t *); +int sighold(int); +int sigignore(int); +int siginterrupt(int, int); +int sigismember(const sigset_t *, int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGPAUSE +//End-Libc +int sigpause(int) __DARWIN_ALIAS_C(sigpause); +//Begin-Libc +#else /* LIBC_ALIAS_SIGPAUSE */ +int sigpause(int) LIBC_ALIAS_C(sigpause); +#endif /* !LIBC_ALIAS_SIGPAUSE */ +//End-Libc +int sigpending(sigset_t *); +int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); +int sigrelse(int); +void (*sigset(int, void (*)(int)))(int); +//Begin-Libc +#ifndef LIBC_ALIAS_SIGSUSPEND +//End-Libc +int sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend); +//Begin-Libc +#else /* LIBC_ALIAS_SIGSUSPEND */ +int sigsuspend(const sigset_t *) LIBC_ALIAS_C(sigsuspend); +#endif /* !LIBC_ALIAS_SIGSUSPEND */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_SIGWAIT +//End-Libc +int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait); +//Begin-Libc +#else /* LIBC_ALIAS_SIGWAIT */ +int sigwait(const sigset_t * __restrict, int * __restrict) LIBC_ALIAS_C(sigwait); +#endif /* !LIBC_ALIAS_SIGWAIT */ +//End-Libc +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void psignal(unsigned int, const char *); +int sigblock(int); +int sigsetmask(int); +int sigvec(int, struct sigvec *, struct sigvec *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + +/* List definitions after function declarations, or Reiser cpp gets upset. */ +#if defined(__i386__) || defined(__x86_64__) +/* The left shift operator on intel is modulo 32 */ +static __inline int +__sigbits(int __signo) +{ + return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1)); +} +#else /* !__i386__ && !__x86_64__ */ +#define __sigbits(signo) (1 << ((signo) - 1)) +#endif /* __i386__ || __x86_64__ */ + +#define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0) +#define sigdelset(set, signo) (*(set) &= ~__sigbits(signo), 0) +#define sigismember(set, signo) ((*(set) & __sigbits(signo)) != 0) +#define sigemptyset(set) (*(set) = 0, 0) +#define sigfillset(set) (*(set) = ~(sigset_t)0, 0) +#endif /* !_ANSI_SOURCE */ + +#endif /* !_USER_SIGNAL_H */ diff --git a/i386/include/stdarg.h b/i386/include/stdarg.h new file mode 100644 index 0000000..ede00f0 --- /dev/null +++ b/i386/include/stdarg.h @@ -0,0 +1,133 @@ +/* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* + * ISO C Standard: 7.15 Variable arguments <stdarg.h> + */ + +#ifndef _STDARG_H +#ifndef _ANSI_STDARG_H_ +#ifndef __need___va_list +#define _STDARG_H +#define _ANSI_STDARG_H_ +#endif /* not __need___va_list */ +#undef __need___va_list + +/* Define __gnuc_va_list. */ + +#ifndef __GNUC_VA_LIST +#define __GNUC_VA_LIST +typedef __builtin_va_list __gnuc_va_list; +#endif + +/* Define the standard macros for the user, + if this invocation was from the user program. */ +#ifdef _STDARG_H + +#define va_start(v,l) __builtin_va_start(v,l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v,l) __builtin_va_arg(v,l) +#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L +#define va_copy(d,s) __builtin_va_copy(d,s) +#endif +#define __va_copy(d,s) __builtin_va_copy(d,s) + +/* Define va_list, if desired, from __gnuc_va_list. */ +/* We deliberately do not define va_list when called from + stdio.h, because ANSI C says that stdio.h is not supposed to define + va_list. stdio.h needs to have access to that data type, + but must not use that name. It should use the name __gnuc_va_list, + which is safe because it is reserved for the implementation. */ + +#ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ +#undef _VA_LIST +#endif + +#ifdef _BSD_VA_LIST +#undef _BSD_VA_LIST +#endif + +#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) +/* SVR4.2 uses _VA_LIST for an internal alias for va_list, + so we must avoid testing it and setting it here. + SVR4 uses _VA_LIST as a flag in stdarg.h, but we should + have no conflict with that. */ +#ifndef _VA_LIST_ +#define _VA_LIST_ +#ifdef __i860__ +#ifndef _VA_LIST +#define _VA_LIST va_list +#endif +#endif /* __i860__ */ +typedef __gnuc_va_list va_list; +#ifdef _SCO_DS +#define __VA_LIST +#endif +#endif /* _VA_LIST_ */ +#else /* not __svr4__ || _SCO_DS */ + +/* The macro _VA_LIST_ is the same thing used by this file in Ultrix. + But on BSD NET2 we must not test or define or undef it. + (Note that the comments in NET 2's ansi.h + are incorrect for _VA_LIST_--see stdio.h!) */ +#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) +/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ +#ifndef _VA_LIST_DEFINED +/* The macro _VA_LIST is used in SCO Unix 3.2. */ +#ifndef _VA_LIST +/* The macro _VA_LIST_T_H is used in the Bull dpx2 */ +#ifndef _VA_LIST_T_H +/* The macro __va_list__ is used by BeOS. */ +#ifndef __va_list__ +typedef __gnuc_va_list va_list; +#endif /* not __va_list__ */ +#endif /* not _VA_LIST_T_H */ +#endif /* not _VA_LIST */ +#endif /* not _VA_LIST_DEFINED */ +#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) +#define _VA_LIST_ +#endif +#ifndef _VA_LIST +#define _VA_LIST +#endif +#ifndef _VA_LIST_DEFINED +#define _VA_LIST_DEFINED +#endif +#ifndef _VA_LIST_T_H +#define _VA_LIST_T_H +#endif +#ifndef __va_list__ +#define __va_list__ +#endif + +#endif /* not _VA_LIST_, except on certain systems */ + +#endif /* not __svr4__ */ + +#endif /* _STDARG_H */ + +#endif /* not _ANSI_STDARG_H_ */ +#endif /* not _STDARG_H */ diff --git a/i386/include/stdbool.h b/i386/include/stdbool.h new file mode 100644 index 0000000..994cee8 --- /dev/null +++ b/i386/include/stdbool.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/include/stdbool.h,v 1.6 2002/08/16 07:33:14 alfred Exp $ + */ + +#ifndef _STDBOOL_H_ +#define _STDBOOL_H_ + +#define __bool_true_false_are_defined 1 + +#ifndef __cplusplus + +#define bool _Bool +#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 +typedef int _Bool; +#endif + +#define false (bool)0 +#define true (bool)1 + +#endif /* !__cplusplus */ + +#endif /* !_STDBOOL_H_ */ diff --git a/i386/include/stddef.h b/i386/include/stddef.h new file mode 100644 index 0000000..9fc87ee --- /dev/null +++ b/i386/include/stddef.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $OpenBSD: stddef.h,v 1.2 1997/09/21 10:45:52 niklas Exp $ */ +/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */ + +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stddef.h 5.5 (Berkeley) 4/3/91 + */ + +#if !defined(__STDDEF_H__) + +#if !defined(__need_wchar_t) && !defined(__need_size_t) \ + && !defined(__need_ptrdiff_t) && !defined(__need_NULL) \ + && !defined(__need_wint_t) +#define __STDDEF_H__ +#endif /* none of __need_* defined */ + +#include <sys/_types.h> + +#if defined(__STDDEF_H__) || defined(__need_ptrdiff_t) +#ifndef _PTRDIFF_T +#define _PTRDIFF_T +typedef __darwin_ptrdiff_t ptrdiff_t; +#endif /* _PTRDIFF_T */ +#endif /* __STDDEF_H__ || __need_ptrdiff_t */ + +#if defined(__STDDEF_H__) || defined(__need_size_t) +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif /* _SIZE_T */ +#endif /* __STDDEF_H__ || __need_size_t */ + +#if defined(__STDDEF_H__) || defined(__need_wchar_t) +#ifndef __cplusplus +#ifndef _WCHAR_T +#define _WCHAR_T +typedef __darwin_wchar_t wchar_t; +#endif /* _WCHAR_T */ +#endif /* __cplusplus */ +#endif /* __STDDEF_H__ || __need_wchar_t */ + +#if (defined(__STDDEF_H__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))) \ + || defined(__need_wint_t) +#ifndef _WINT_T +#define _WINT_T +typedef __darwin_wint_t wint_t; +#endif /* _WINT_T */ +#endif /* __STDDEF_H__ && !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) || __need_wchar_t */ + +#if defined(__STDDEF_H__) || defined(__need_NULL) +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ +#endif /* __STDDEF_H__ || __need_NULL */ + +#ifdef __STDDEF_H__ +#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3) +#ifndef __offsetof /* Deprecated: for source compatability only */ +#define __offsetof(type, field) __builtin_offsetof(type, field) +#endif +#define offsetof(type, field) __builtin_offsetof(type, field) +#else /* ! (gcc >= 3.5) */ +#ifndef __offsetof /* Deprecated: for source compatability only */ +#define __offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif +#define offsetof(type, field) ((size_t)(&((type *)0)->field)) +#endif /* (gcc >= 3.5) */ +#endif /* __STDDEF_H__ */ + +#endif /* __STDDEF_H__ */ + +#undef __need_ptrdiff_t +#undef __need_size_t +#undef __need_wchar_t +#undef __need_wint_t +#undef __need_NULL diff --git a/i386/include/stdint.h b/i386/include/stdint.h new file mode 100644 index 0000000..1126b56 --- /dev/null +++ b/i386/include/stdint.h @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2000, 2001, 2003, 2004, 2008 Apple Computer, Inc. + * All rights reserved. + */ + +#ifndef _STDINT_H_ +#define _STDINT_H_ + +#if __LP64__ +#define __WORDSIZE 64 +#else +#define __WORDSIZE 32 +#endif + +/* from ISO/IEC 988:1999 spec */ + +/* 7.18.1.1 Exact-width integer types */ +#ifndef _INT8_T +#define _INT8_T +typedef signed char int8_t; +#endif /*_INT8_T */ + +#ifndef _INT16_T +#define _INT16_T +typedef short int16_t; +#endif /* _INT16_T */ + +#ifndef _INT32_T +#define _INT32_T +typedef int int32_t; +#endif /* _INT32_T */ + +#ifndef _INT64_T +#define _INT64_T +typedef long long int64_t; +#endif /* _INT64_T */ + +#ifndef _UINT8_T +#define _UINT8_T +typedef unsigned char uint8_t; +#endif /*_UINT8_T */ + +#ifndef _UINT16_T +#define _UINT16_T +typedef unsigned short uint16_t; +#endif /* _UINT16_T */ + +#ifndef _UINT32_T +#define _UINT32_T +typedef unsigned int uint32_t; +#endif /* _UINT32_T */ + +#ifndef _UINT64_T +#define _UINT64_T +typedef unsigned long long uint64_t; +#endif /* _UINT64_T */ + +/* 7.18.1.2 Minimum-width integer types */ +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + + +/* 7.18.1.3 Fastest-width integer types */ +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + + +/* 7.18.1.4 Integer types capable of holding object pointers */ + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef long intptr_t; +#endif /* _INTPTR_T */ + +#ifndef _UINTPTR_T +#define _UINTPTR_T +typedef unsigned long uintptr_t; +#endif /* _UINTPTR_T */ + + +/* 7.18.1.5 Greatest-width integer types */ +#ifndef _INTMAX_T +#define _INTMAX_T +#ifdef __INTMAX_TYPE__ +typedef __INTMAX_TYPE__ intmax_t; +#else /* __INTMAX_TYPE__ */ +typedef long long intmax_t; +#endif /* __INTMAX_TYPE__ */ +#endif /* _INTMAX_T */ + +#ifndef _UINTMAX_T +#define _UINTMAX_T +#ifdef __UINTMAX_TYPE__ +typedef __UINTMAX_TYPE__ uintmax_t; +#else /* __UINTMAX_TYPE__ */ +typedef unsigned long long uintmax_t; +#endif /* __UINTMAX_TYPE__ */ +#endif /* _UINTMAX_T */ + +/* 7.18.2 Limits of specified-width integer types: + * These #defines specify the minimum and maximum limits + * of each of the types declared above. + */ + + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define INT8_MIN -128 +#define INT16_MIN -32768 + /* + Note: the literal "most negative int" cannot be written in C -- + the rules in the standard (section 6.4.4.1 in C99) will give it + an unsigned type, so INT32_MIN (and the most negative member of + any larger signed type) must be written via a constant expression. + */ +#define INT32_MIN (-INT32_MAX-1) +#define INT64_MIN (-INT64_MAX-1) + +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 4294967295U +#define UINT64_MAX 18446744073709551615ULL + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding object pointers */ + +#if __WORDSIZE == 64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#endif + +#if __WORDSIZE == 64 +#define UINTPTR_MAX UINT64_MAX +#else +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX + +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 "Other" */ +#if __WORDSIZE == 64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif + +/* We have no sig_atomic_t yet, so no SIG_ATOMIC_{MIN,MAX}. + Should end up being {-127,127} or {0,255} ... or bigger. + My bet would be on one of {U}INT32_{MIN,MAX}. */ + +#if __WORDSIZE == 64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif + +#ifndef WCHAR_MAX +# ifdef __WCHAR_MAX__ +# define WCHAR_MAX __WCHAR_MAX__ +# else +# define WCHAR_MAX 0x7fffffff +# endif +#endif + +/* WCHAR_MIN should be 0 if wchar_t is an unsigned type and + (-WCHAR_MAX-1) if wchar_t is a signed type. Unfortunately, + it turns out that -fshort-wchar changes the signedness of + the type. */ +#ifndef WCHAR_MIN +# if WCHAR_MAX == 0xffff +# define WCHAR_MIN 0 +# else +# define WCHAR_MIN (-WCHAR_MAX-1) +# endif +#endif + +#define WINT_MIN INT32_MIN +#define WINT_MAX INT32_MAX + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +/* 7.18.4 Macros for integer constants */ +#define INT8_C(v) (v) +#define INT16_C(v) (v) +#define INT32_C(v) (v) +#define INT64_C(v) (v ## LL) + +#define UINT8_C(v) (v ## U) +#define UINT16_C(v) (v ## U) +#define UINT32_C(v) (v ## U) +#define UINT64_C(v) (v ## ULL) + +#define INTMAX_C(v) (v ## LL) +#define UINTMAX_C(v) (v ## ULL) + +#endif /* _STDINT_H_ */ diff --git a/i386/include/stdio.h b/i386/include/stdio.h new file mode 100644 index 0000000..455960c --- /dev/null +++ b/i386/include/stdio.h @@ -0,0 +1,503 @@ +/* + * Copyright (c) 2000, 2005, 2007, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdio.h 8.5 (Berkeley) 4/29/95 + */ + +#ifndef _STDIO_H_ +#define _STDIO_H_ + +#include <_types.h> + +#ifndef _VA_LIST +#define _VA_LIST +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * __gnuc_va_list and include <stdarg.h> */ +typedef __darwin_va_list va_list; +#endif + +#ifndef _OFF_T +#define _OFF_T +typedef __darwin_off_t off_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +typedef __darwin_off_t fpos_t; + +#define _FSTDIO /* Define for new stdio with functions. */ + +/* + * NB: to fit things in six character monocase externals, the stdio + * code uses the prefix `__s' for stdio objects, typically followed + * by a three-character attempt at a mnemonic. + */ + +/* stdio buffers */ +struct __sbuf { + unsigned char *_base; + int _size; +}; + +/* hold a buncha junk that would grow the ABI */ +struct __sFILEX; + +/* + * stdio state variables. + * + * The following always hold: + * + * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), + * _lbfsize is -_bf._size, else _lbfsize is 0 + * if _flags&__SRD, _w is 0 + * if _flags&__SWR, _r is 0 + * + * This ensures that the getc and putc macros (or inline functions) never + * try to write or read from a file that is in `read' or `write' mode. + * (Moreover, they can, and do, automatically switch from read mode to + * write mode, and back, on "r+" and "w+" files.) + * + * _lbfsize is used only to make the inline line-buffered output stream + * code as compact as possible. + * + * _ub, _up, and _ur are used when ungetc() pushes back more characters + * than fit in the current _bf, or when ungetc() pushes back a character + * that does not match the previous one in _bf. When this happens, + * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff + * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. + * + * NB: see WARNING above before changing the layout of this structure! + */ +typedef struct __sFILE { + unsigned char *_p; /* current position in (some) buffer */ + int _r; /* read space left for getc() */ + int _w; /* write space left for putc() */ + short _flags; /* flags, below; this FILE is free if 0 */ + short _file; /* fileno, if Unix descriptor, else -1 */ + struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ + int _lbfsize; /* 0 or -_bf._size, for inline putc */ + + /* operations */ + void *_cookie; /* cookie passed to io functions */ + int (*_close)(void *); + int (*_read) (void *, char *, int); + fpos_t (*_seek) (void *, fpos_t, int); + int (*_write)(void *, const char *, int); + + /* separate buffer for long sequences of ungetc() */ + struct __sbuf _ub; /* ungetc buffer */ + struct __sFILEX *_extra; /* additions to FILE to not break ABI */ + int _ur; /* saved _r when _r is counting ungetc data */ + + /* tricks to meet minimum requirements even when malloc() fails */ + unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ + unsigned char _nbuf[1]; /* guarantee a getc() buffer */ + + /* separate buffer for fgetln() when line crosses buffer boundary */ + struct __sbuf _lb; /* buffer for fgetln() */ + + /* Unix stdio files get aligned to block boundaries on fseek() */ + int _blksize; /* stat.st_blksize (may be != _bf._size) */ + fpos_t _offset; /* current lseek offset (see WARNING) */ +} FILE; + +__BEGIN_DECLS +#if __DARWIN_UNIX03 +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; +#else /* !__DARWIN_UNIX03 */ +extern FILE __sF[]; +#endif /* __DARWIN_UNIX03 */ +__END_DECLS + +#define __SLBF 0x0001 /* line buffered */ +#define __SNBF 0x0002 /* unbuffered */ +#define __SRD 0x0004 /* OK to read */ +#define __SWR 0x0008 /* OK to write */ + /* RD and WR are never simultaneously asserted */ +#define __SRW 0x0010 /* open for reading & writing */ +#define __SEOF 0x0020 /* found EOF */ +#define __SERR 0x0040 /* found error */ +#define __SMBF 0x0080 /* _buf is from malloc */ +#define __SAPP 0x0100 /* fdopen()ed in append mode */ +#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ +#define __SOPT 0x0400 /* do fseek() optimisation */ +#define __SNPT 0x0800 /* do not do fseek() optimisation */ +#define __SOFF 0x1000 /* set iff _offset is in fact correct */ +#define __SMOD 0x2000 /* true => fgetln modified _p text */ +#define __SALC 0x4000 /* allocate string space dynamically */ +#define __SIGN 0x8000 /* ignore this file in _fwalk */ + +/* + * The following three definitions are for ANSI C, which took them + * from System V, which brilliantly took internal interface macros and + * made them official arguments to setvbuf(), without renaming them. + * Hence, these ugly _IOxxx names are *supposed* to appear in user code. + * + * Although numbered as their counterparts above, the implementation + * does not rely on this. + */ +#define _IOFBF 0 /* setvbuf should set fully buffered */ +#define _IOLBF 1 /* setvbuf should set line buffered */ +#define _IONBF 2 /* setvbuf should set unbuffered */ + +#define BUFSIZ 1024 /* size of buffer used by setbuf */ +#define EOF (-1) + +/* + * FOPEN_MAX is a minimum maximum, and is the number of streams that + * stdio can provide without attempting to allocate further resources + * (which could fail). Do not use this for anything. + */ + /* must be == _POSIX_STREAM_MAX <limits.h> */ +#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */ +#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */ + +/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ +#ifndef _ANSI_SOURCE +#define P_tmpdir "/var/tmp/" +#endif +#define L_tmpnam 1024 /* XXX must be == PATH_MAX */ +#define TMP_MAX 308915776 + +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + +#if __DARWIN_UNIX03 +#define stdin __stdinp +#define stdout __stdoutp +#define stderr __stderrp +#else /* !__DARWIN_UNIX03 */ +#define stdin (&__sF[0]) +#define stdout (&__sF[1]) +#define stderr (&__sF[2]) +#endif /* __DARWIN_UNIX03 */ + +/* + * Functions defined in ANSI C standard. + */ +__BEGIN_DECLS +void clearerr(FILE *); +int fclose(FILE *); +int feof(FILE *); +int ferror(FILE *); +int fflush(FILE *); +int fgetc(FILE *); +int fgetpos(FILE * __restrict, fpos_t *); +char *fgets(char * __restrict, int, FILE *); +#if defined(__DARWIN_10_6_AND_LATER) && (defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)) +FILE *fopen(const char * __restrict, const char * __restrict) __DARWIN_EXTSN(fopen); +#else /* < 10.6 || !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_FOPEN +//End-Libc +FILE *fopen(const char * __restrict, const char * __restrict) __DARWIN_10_6_AND_LATER_ALIAS(__DARWIN_ALIAS(fopen)); +//Begin-Libc +#else /* LIBC_ALIAS_FOPEN */ +FILE *fopen(const char * __restrict, const char * __restrict) LIBC_ALIAS(fopen); +#endif /* !LIBC_ALIAS_FOPEN */ +//End-Libc +#endif /* >= 10.6 &&_(DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int fprintf(FILE * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(fprintf); +int fputc(int, FILE *); +//Begin-Libc +#ifndef LIBC_ALIAS_FPUTS +//End-Libc +int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs); +//Begin-Libc +#else /* LIBC_ALIAS_FPUTS */ +int fputs(const char * __restrict, FILE * __restrict) LIBC_ALIAS(fputs); +#endif /* !LIBC_ALIAS_FPUTS */ +//End-Libc +size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); +//Begin-Libc +#ifndef LIBC_ALIAS_FREOPEN +//End-Libc +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) __DARWIN_ALIAS(freopen); +//Begin-Libc +#else /* LIBC_ALIAS_FREOPEN */ +FILE *freopen(const char * __restrict, const char * __restrict, + FILE * __restrict) LIBC_ALIAS(freopen); +#endif /* !LIBC_ALIAS_FREOPEN */ +//End-Libc +int fscanf(FILE * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(fscanf); +int fseek(FILE *, long, int); +int fsetpos(FILE *, const fpos_t *); +long ftell(FILE *); +//Begin-Libc +#ifndef LIBC_ALIAS_FWRITE +//End-Libc +size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) __DARWIN_ALIAS(fwrite); +//Begin-Libc +#else /* LIBC_ALIAS_FWRITE */ +size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) LIBC_ALIAS(fwrite); +#endif /* !LIBC_ALIAS_FWRITE */ +//End-Libc +int getc(FILE *); +int getchar(void); +char *gets(char *); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +extern __const int sys_nerr; /* perror(3) external variables */ +extern __const char *__const sys_errlist[]; +#endif +void perror(const char *); +int printf(const char * __restrict, ...) __DARWIN_LDBL_COMPAT(printf); +int putc(int, FILE *); +int putchar(int); +int puts(const char *); +int remove(const char *); +int rename (const char *, const char *); +void rewind(FILE *); +int scanf(const char * __restrict, ...) __DARWIN_LDBL_COMPAT(scanf); +void setbuf(FILE * __restrict, char * __restrict); +int setvbuf(FILE * __restrict, char * __restrict, int, size_t); +int sprintf(char * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(sprintf); +int sscanf(const char * __restrict, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(sscanf); +FILE *tmpfile(void); +char *tmpnam(char *); +int ungetc(int, FILE *); +int vfprintf(FILE * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vfprintf); +int vprintf(const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vprintf); +int vsprintf(char * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vsprintf); +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +int asprintf(char **, const char *, ...) __DARWIN_LDBL_COMPAT(asprintf); +int vasprintf(char **, const char *, va_list) __DARWIN_LDBL_COMPAT(vasprintf); +#endif +__END_DECLS + +/* + * Functions defined in POSIX 1003.1. + */ +#ifndef _ANSI_SOURCE +#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */ + +__BEGIN_DECLS +char *ctermid(char *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *ctermid_r(char *); +#endif /* not POSIX */ +#if defined(__DARWIN_10_6_AND_LATER) && (defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)) +FILE *fdopen(int, const char *) __DARWIN_EXTSN(fdopen); +#else /* < 10.6 || !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_FDOPEN +//End-Libc +FILE *fdopen(int, const char *) __DARWIN_10_6_AND_LATER_ALIAS(__DARWIN_ALIAS(fdopen)); +//Begin-Libc +#else /* LIBC_ALIAS_FDOPEN */ +FILE *fdopen(int, const char *) LIBC_ALIAS(fdopen); +#endif /* !LIBC_ALIAS_FDOPEN */ +//End-Libc +#endif /* >= 10.6 &&_(DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *fgetln(FILE *, size_t *); +#endif /* not POSIX */ +int fileno(FILE *); +void flockfile(FILE *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__const char + *fmtcheck(const char *, const char *); +int fpurge(FILE *); +#endif /* not POSIX */ +int fseeko(FILE *, off_t, int); +off_t ftello(FILE *); +int ftrylockfile(FILE *); +void funlockfile(FILE *); +int getc_unlocked(FILE *); +int getchar_unlocked(void); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int getw(FILE *); +#endif /* not POSIX */ +int pclose(FILE *); +#if defined(__DARWIN_10_6_AND_LATER) && (defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)) +FILE *popen(const char *, const char *) __DARWIN_EXTSN(popen); +#else /* < 10.6 || !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */ +//Begin-Libc +#ifndef LIBC_ALIAS_POPEN +//End-Libc +FILE *popen(const char *, const char *) __DARWIN_10_6_AND_LATER_ALIAS(__DARWIN_ALIAS(popen)); +//Begin-Libc +#else /* LIBC_ALIAS_POPEN */ +FILE *popen(const char *, const char *) LIBC_ALIAS(popen); +#endif /* !LIBC_ALIAS_POPEN */ +//End-Libc +#endif /* >= 10.6 &&_(DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */ +int putc_unlocked(int, FILE *); +int putchar_unlocked(int); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int putw(int, FILE *); +void setbuffer(FILE *, char *, int); +int setlinebuf(FILE *); +#endif /* not POSIX */ +int snprintf(char * __restrict, size_t, const char * __restrict, ...) __DARWIN_LDBL_COMPAT(snprintf); +//Begin-Libc +#ifndef LIBC_ALIAS_TEMPNAM +//End-Libc +char *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam); +//Begin-Libc +#else /* LIBC_ALIAS_TEMPNAM */ +char *tempnam(const char *, const char *) LIBC_ALIAS(tempnam); +#endif /* !LIBC_ALIAS_TEMPNAM */ +//End-Libc +int vfscanf(FILE * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vfscanf); +int vscanf(const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vscanf); +int vsnprintf(char * __restrict, size_t, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vsnprintf); +int vsscanf(const char * __restrict, const char * __restrict, va_list) __DARWIN_LDBL_COMPAT(vsscanf); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +FILE *zopen(const char *, const char *, int); +#endif /* not POSIX */ +__END_DECLS + +/* + * Stdio function-access interface. + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +__BEGIN_DECLS +FILE *funopen(const void *, + int (*)(void *, char *, int), + int (*)(void *, const char *, int), + fpos_t (*)(void *, fpos_t, int), + int (*)(void *)); +__END_DECLS +#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) +#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) +#endif /* not POSIX */ +#endif /* not ANSI */ + +/* + * Functions internal to the implementation. + */ +__BEGIN_DECLS +int __srget(FILE *); +int __svfscanf(FILE *, const char *, va_list) __DARWIN_LDBL_COMPAT(__svfscanf); +int __swbuf(int, FILE *); +__END_DECLS + +/* + * The __sfoo macros are here so that we can + * define function versions in the C library. + */ +#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) +#if defined(__GNUC__) && defined(__STDC__) +static __inline int __sputc(int _c, FILE *_p) { + if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) + return (*_p->_p++ = _c); + else + return (__swbuf(_c, _p)); +} +#else +/* + * This has been tuned to generate reasonable code on the vax using pcc. + */ +#define __sputc(c, p) \ + (--(p)->_w < 0 ? \ + (p)->_w >= (p)->_lbfsize ? \ + (*(p)->_p = (c)), *(p)->_p != '\n' ? \ + (int)*(p)->_p++ : \ + __swbuf('\n', p) : \ + __swbuf((int)(c), p) : \ + (*(p)->_p = (c), (int)*(p)->_p++)) +#endif + +#define __sfeof(p) (((p)->_flags & __SEOF) != 0) +#define __sferror(p) (((p)->_flags & __SERR) != 0) +#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) +#define __sfileno(p) ((p)->_file) + +#ifndef _ANSI_SOURCE +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define feof_unlocked(p) __sfeof(p) +#define ferror_unlocked(p) __sferror(p) +#define clearerr_unlocked(p) __sclearerr(p) +#define fileno_unlocked(p) __sfileno(p) +#endif /* not POSIX */ + +#ifndef lint +#define getc_unlocked(fp) __sgetc(fp) +#define putc_unlocked(x, fp) __sputc(x, fp) +#endif /* lint */ + +#define getchar_unlocked() getc_unlocked(stdin) +#define putchar_unlocked(x) putc_unlocked(x, stdout) +#endif /* not ANSI */ + +#ifdef _USE_EXTENDED_LOCALES_ +#include <xlocale/_stdio.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus) +/* Security checking functions. */ +#include <secure/_stdio.h> +#endif + +#endif /* _STDIO_H_ */ diff --git a/i386/include/stdlib.h b/i386/include/stdlib.h new file mode 100644 index 0000000..a177dbb --- /dev/null +++ b/i386/include/stdlib.h @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)stdlib.h 8.5 (Berkeley) 5/19/95 + */ + +#ifndef _STDLIB_H_ +#define _STDLIB_H_ + +#include <sys/types.h> + +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#ifndef _CT_RUNE_T +#define _CT_RUNE_T +typedef __darwin_ct_rune_t ct_rune_t; +#endif + +#ifndef _RUNE_T +#define _RUNE_T +typedef __darwin_rune_t rune_t; +#endif +#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#ifndef __cplusplus +#ifndef _WCHAR_T +#define _WCHAR_T +typedef __darwin_wchar_t wchar_t; +#endif /* _WCHAR_T */ +#endif /* __cplusplus */ + +typedef struct { + int quot; /* quotient */ + int rem; /* remainder */ +} div_t; + +typedef struct { + long quot; /* quotient */ + long rem; /* remainder */ +} ldiv_t; + +#if !__DARWIN_NO_LONG_LONG +typedef struct { + long long quot; + long long rem; +} lldiv_t; +#endif /* !__DARWIN_NO_LONG_LONG */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 + +#define RAND_MAX 0x7fffffff + +#ifdef _USE_EXTENDED_LOCALES_ +#include <_xlocale.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#ifndef MB_CUR_MAX +#ifdef _USE_EXTENDED_LOCALES_ +#define MB_CUR_MAX (___mb_cur_max()) +#ifndef MB_CUR_MAX_L +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif /* !MB_CUR_MAX_L */ +#else /* !_USE_EXTENDED_LOCALES_ */ +extern int __mb_cur_max; +#define MB_CUR_MAX __mb_cur_max +#endif /* _USE_EXTENDED_LOCALES_ */ +#endif /* MB_CUR_MAX */ + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \ + && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L) +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) +#endif +//Begin-Libc +/* f must be a literal string */ +#define LIBC_ABORT(f,...) abort_report_np("%s:%s:%u: " f, __FILE__, __func__, __LINE__, ## __VA_ARGS__) +//End-Libc + +__BEGIN_DECLS +void abort(void) __dead2; +//Begin-Libc +__private_extern__ +void abort_report_np(const char *, ...) __dead2 __printflike(1, 2); +//End-Libc +int abs(int) __pure2; +int atexit(void (*)(void)); +double atof(const char *); +int atoi(const char *); +long atol(const char *); +#if !__DARWIN_NO_LONG_LONG +long long + atoll(const char *); +#endif /* !__DARWIN_NO_LONG_LONG */ +void *bsearch(const void *, const void *, size_t, + size_t, int (*)(const void *, const void *)); +void *calloc(size_t, size_t); +div_t div(int, int) __pure2; +void exit(int) __dead2; +void free(void *); +char *getenv(const char *); +long labs(long) __pure2; +ldiv_t ldiv(long, long) __pure2; +#if !__DARWIN_NO_LONG_LONG +long long + llabs(long long); +lldiv_t lldiv(long long, long long); +#endif /* !__DARWIN_NO_LONG_LONG */ +void *malloc(size_t); +int mblen(const char *, size_t); +size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); +int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); +int posix_memalign(void **, size_t, size_t); +void qsort(void *, size_t, size_t, + int (*)(const void *, const void *)); +int rand(void); +void *realloc(void *, size_t); +void srand(unsigned); +double strtod(const char *, char **) __DARWIN_ALIAS(strtod); +float strtof(const char *, char **) __DARWIN_ALIAS(strtof); +long strtol(const char *, char **, int); +long double + strtold(const char *, char **) __DARWIN_LDBL_COMPAT(strtold); +#if !__DARWIN_NO_LONG_LONG +long long + strtoll(const char *, char **, int); +#endif /* !__DARWIN_NO_LONG_LONG */ +unsigned long + strtoul(const char *, char **, int); +#if !__DARWIN_NO_LONG_LONG +unsigned long long + strtoull(const char *, char **, int); +#endif /* !__DARWIN_NO_LONG_LONG */ +//Begin-Libc +#ifndef LIBC_ALIAS_SYSTEM +//End-Libc +int system(const char *) __DARWIN_ALIAS_C(system); +//Begin-Libc +#else /* LIBC_ALIAS_SYSTEM */ +int system(const char *) LIBC_ALIAS_C(system); +#endif /* !LIBC_ALIAS_SYSTEM */ +//End-Libc +size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); +int wctomb(char *, wchar_t); + +#ifndef _ANSI_SOURCE +void _Exit(int) __dead2; +long a64l(const char *); +double drand48(void); +char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +double erand48(unsigned short[3]); +char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */ +char *gcvt(double, int, char *); /* LEGACY */ +int getsubopt(char **, char * const *, char **); +int grantpt(int); +#if __DARWIN_UNIX03 +char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */ +#else /* !__DARWIN_UNIX03 */ +char *initstate(unsigned long, char *, long); +#endif /* __DARWIN_UNIX03 */ +long jrand48(unsigned short[3]); +char *l64a(long); +void lcong48(unsigned short[7]); +long lrand48(void); +char *mktemp(char *); +int mkstemp(char *); +long mrand48(void); +long nrand48(unsigned short[3]); +int posix_openpt(int); +char *ptsname(int); +//Begin-Libc +#ifndef LIBC_ALIAS_PUTENV +//End-Libc +int putenv(char *) __DARWIN_ALIAS(putenv); +//Begin-Libc +#else /* LIBC_ALIAS_PUTENV */ +int putenv(char *) LIBC_ALIAS(putenv); +#endif /* !LIBC_ALIAS_PUTENV */ +//End-Libc +long random(void); +int rand_r(unsigned *); +//Begin-Libc +#ifdef __LIBC__ +#ifndef LIBC_ALIAS_REALPATH +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* LIBC_ALIAS_REALPATH */ +#ifdef VARIANT_DARWINEXTSN +char *realpath(const char * __restrict, char * __restrict) LIBC_EXTSN(realpath); +#else /* !VARIANT_DARWINEXTSN */ +char *realpath(const char * __restrict, char * __restrict) LIBC_ALIAS(realpath); +#endif /* VARIANT_DARWINEXTSN */ +#endif /* !LIBC_ALIAS_REALPATH */ +#else /* !__LIBC__ */ +//End-Libc +#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH) +char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath); +#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */ +char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath); +#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */ +//Begin-Libc +#endif /* __LIBC__ */ +//End-Libc +unsigned short + *seed48(unsigned short[3]); +//Begin-Libc +#ifndef LIBC_ALIAS_SETENV +//End-Libc +int setenv(const char *, const char *, int) __DARWIN_ALIAS(setenv); +//Begin-Libc +#else /* LIBC_ALIAS_SETENV */ +int setenv(const char *, const char *, int) LIBC_ALIAS(setenv); +#endif /* !LIBC_ALIAS_SETENV */ +//End-Libc +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_SETKEY +//End-Libc +void setkey(const char *) __DARWIN_ALIAS(setkey); +//Begin-Libc +#else /* LIBC_ALIAS_SETKEY */ +void setkey(const char *) LIBC_ALIAS(setkey); +#endif /* !LIBC_ALIAS_SETKEY */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +char *setstate(const char *); +void srand48(long); +#if __DARWIN_UNIX03 +void srandom(unsigned); +#else /* !__DARWIN_UNIX03 */ +void srandom(unsigned long); +#endif /* __DARWIN_UNIX03 */ +int unlockpt(int); +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_UNSETENV +//End-Libc +int unsetenv(const char *) __DARWIN_ALIAS(unsetenv); +//Begin-Libc +#else /* LIBC_ALIAS_UNSETENV */ +int unsetenv(const char *) LIBC_ALIAS(unsetenv); +#endif /* !LIBC_ALIAS_UNSETENV */ +//End-Libc +#else /* !__DARWIN_UNIX03 */ +void unsetenv(const char *); +#endif /* __DARWIN_UNIX03 */ +#endif /* !_ANSI_SOURCE */ + +/* Poison the following routines if -fshort-wchar is set */ +#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU +#pragma GCC poison mbstowcs mbtowc wcstombs wctomb +#endif +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include <xlocale/_stdlib.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _STDLIB_H_ */ diff --git a/i386/include/string.h b/i386/include/string.h new file mode 100644 index 0000000..6c16441 --- /dev/null +++ b/i386/include/string.h @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2000, 2007 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)string.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _STRING_H_ +#define _STRING_H_ +#include <_types.h> + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) /* For swab */ +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#include <sys/cdefs.h> + +__BEGIN_DECLS +void *memchr(const void *, int, size_t); +int memcmp(const void *, const void *, size_t); +void *memcpy(void *, const void *, size_t); +void *memmove(void *, const void *, size_t); +void *memset(void *, int, size_t); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *stpcpy(char *, const char *); +char *strcasestr(const char *, const char *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +char *strcat(char *, const char *); +char *strchr(const char *, int); +int strcmp(const char *, const char *); +int strcoll(const char *, const char *); +char *strcpy(char *, const char *); +size_t strcspn(const char *, const char *); +//Begin-Libc +#ifndef LIBC_ALIAS_STRERROR +//End-Libc +char *strerror(int) __DARWIN_ALIAS(strerror); +//Begin-Libc +#else /* LIBC_ALIAS_STRERROR */ +char *strerror(int) LIBC_ALIAS(strerror); +#endif /* !LIBC_ALIAS_STRERROR */ +//End-Libc +int strerror_r(int, char *, size_t); +size_t strlen(const char *); +char *strncat(char *, const char *, size_t); +int strncmp(const char *, const char *, size_t); +char *strncpy(char *, const char *, size_t); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +char *strnstr(const char *, const char *, size_t); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +char *strpbrk(const char *, const char *); +char *strrchr(const char *, int); +size_t strspn(const char *, const char *); +char *strstr(const char *, const char *); +char *strtok(char *, const char *); +size_t strxfrm(char *, const char *, size_t); + +/* Nonstandard routines */ +#ifndef _ANSI_SOURCE +void *memccpy(void *, const void *, int, size_t); +char *strtok_r(char *, const char *, char **); +char *strdup(const char *); +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int bcmp(const void *, const void *, size_t); +void bcopy(const void *, void *, size_t); +void bzero(void *, size_t); +int ffs(int); +int ffsl(long); +int fls(int); +int flsl(long); +char *index(const char *, int); +void memset_pattern4(void *, const void *, size_t); +void memset_pattern8(void *, const void *, size_t); +void memset_pattern16(void *, const void *, size_t); +char *rindex(const char *, int); +int strcasecmp(const char *, const char *); +size_t strlcat(char *, const char *, size_t); +size_t strlcpy(char *, const char *, size_t); +void strmode(int, char *); +int strncasecmp(const char *, const char *, size_t); +char *strsep(char **, const char *); +char *strsignal(int sig); +void swab(const void * __restrict, void * __restrict, ssize_t); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* !_ANSI_SOURCE */ +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include <xlocale/_string.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* _STRING_H_ */ diff --git a/i386/include/sys/.svn/all-wcprops b/i386/include/sys/.svn/all-wcprops new file mode 100644 index 0000000..ad20586 --- /dev/null +++ b/i386/include/sys/.svn/all-wcprops @@ -0,0 +1,113 @@ +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys +END +reboot.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/reboot.h +END +disk.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/disk.h +END +_endian.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/_endian.h +END +time.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/time.h +END +syslimits.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/syslimits.h +END +param.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/param.h +END +appleapiopts.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/appleapiopts.h +END +_types.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/_types.h +END +kernel_types.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/kernel_types.h +END +types.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/types.h +END +_structs.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/_structs.h +END +unistd.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/unistd.h +END +syscall.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/syscall.h +END +buf.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/buf.h +END +_select.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/_select.h +END +select.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/select.h +END +cdefs.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/cdefs.h +END +socket.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/sys/socket.h +END diff --git a/i386/include/sys/.svn/entries b/i386/include/sys/.svn/entries new file mode 100644 index 0000000..3da6b82 --- /dev/null +++ b/i386/include/sys/.svn/entries @@ -0,0 +1,640 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/sys +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +reboot.h +file + + + + +2013-08-27T23:54:50.000000Z +e7783144ecd05ebe88337a7b58306c9b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5680 + +disk.h +file + + + + +2013-08-27T23:54:50.000000Z +6dc1cd186a3e28783a605971904e1a0e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5691 + +_endian.h +file + + + + +2013-08-27T23:54:50.000000Z +6f34699ec4809af930459f9b4e224b39 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6066 + +time.h +file + + + + +2013-08-27T23:54:50.000000Z +bc9a741e949ab5a836accaa727115ca1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7703 + +syslimits.h +file + + + + +2013-08-27T23:54:50.000000Z +e2dc1de2e7d68529e0b4fe3851e0c76e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5532 + +param.h +file + + + + +2013-08-27T23:54:50.000000Z +de570189fbde8d733ede60fc87798ded +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10106 + +appleapiopts.h +file + + + + +2013-08-27T23:54:50.000000Z +db020d56d300544c6246c1c50cffbec8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2070 + +_types.h +file + + + + +2013-08-27T23:54:50.000000Z +6b6a6cd4c4783b184db609fc579c749a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3480 + +kernel_types.h +file + + + + +2013-08-27T23:54:50.000000Z +f1e837ca454cf43cf18b66e774400bcd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3740 + +types.h +file + + + + +2013-08-27T23:54:50.000000Z +fbd84e2dde145dcd6768584492318bfa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7681 + +_structs.h +file + + + + +2013-08-27T23:54:50.000000Z +39cb4b1301bb829b1739832af69e93f6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7886 + +unistd.h +file + + + + +2013-08-27T23:54:50.000000Z +8b69ddc2f97a2b90a40475d89b057819 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7445 + +syscall.h +file + + + + +2013-08-27T23:54:50.000000Z +f6eb1ec97c4fa0e2b64b1542a624628e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14644 + +buf.h +file + + + + +2013-08-27T23:54:50.000000Z +f4e84d196ad07287a38ed8e473ba0dde +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +36785 + +_select.h +file + + + + +2013-08-27T23:54:50.000000Z +35dfd21db1ffa4233a6472fc03f016bf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2294 + +select.h +file + + + + +2013-08-27T23:54:50.000000Z +0faee73c6a40862335312acbeaf50da3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5794 + +cdefs.h +file + + + + +2013-08-27T23:54:50.000000Z +5827da95019b9c53415b5cf7872c9edb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22051 + +socket.h +file + + + + +2013-08-27T23:54:50.000000Z +816faf489c5e60e1159fdc19e69893dc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22972 + diff --git a/i386/include/sys/.svn/text-base/_endian.h.svn-base b/i386/include/sys/.svn/text-base/_endian.h.svn-base new file mode 100644 index 0000000..3fb0f06 --- /dev/null +++ b/i386/include/sys/.svn/text-base/_endian.h.svn-base @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved. + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1987, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__ENDIAN_H_ +#define _SYS__ENDIAN_H_ + +#include <sys/cdefs.h> + +/* + * Macros for network/external number representation conversion. + */ + +#if defined(lint) + +__BEGIN_DECLS +__uint16_t ntohs(__uint16_t); +__uint16_t htons(__uint16_t); +__uint32_t ntohl(__uint32_t); +__uint32_t htonl(__uint32_t); +__END_DECLS + +#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN + +#define ntohl(x) ((__uint32_t)(x)) +#define ntohs(x) ((__uint16_t)(x)) +#define htonl(x) ((__uint32_t)(x)) +#define htons(x) ((__uint16_t)(x)) + +#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define NTOHL(x) (x) +#define NTOHS(x) (x) +#define HTONL(x) (x) +#define HTONS(x) (x) +#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ + +#else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + +#include <libkern/_OSByteOrder.h> + +#define ntohs(x) __DARWIN_OSSwapInt16(x) +#define htons(x) __DARWIN_OSSwapInt16(x) + +#define ntohl(x) __DARWIN_OSSwapInt32(x) +#define htonl(x) __DARWIN_OSSwapInt32(x) + +#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define NTOHL(x) (x) = ntohl((__uint32_t)x) +#define NTOHS(x) (x) = ntohs((__uint16_t)x) +#define HTONL(x) (x) = htonl((__uint32_t)x) +#define HTONS(x) (x) = htons((__uint16_t)x) +#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ +#endif /* __DARWIN_BYTE_ORDER */ +#endif /* !_SYS__ENDIAN_H_ */ diff --git a/i386/include/sys/.svn/text-base/_select.h.svn-base b/i386/include/sys/.svn/text-base/_select.h.svn-base new file mode 100644 index 0000000..6f70921 --- /dev/null +++ b/i386/include/sys/.svn/text-base/_select.h.svn-base @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2005, 2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * This is called from sys/select.h and sys/time.h for the common prototype + * of select(). Setting _DARWIN_C_SOURCE or _DARWIN_UNLIMITED_SELECT uses + * the version of select() that does not place a limit on the first argument + * (nfds). In the UNIX conformance case, values of nfds greater than + * FD_SETSIZE will return an error of EINVAL. + */ +#ifndef _SYS__SELECT_H_ +#define _SYS__SELECT_H_ + +int select(int, fd_set * __restrict, fd_set * __restrict, + fd_set * __restrict, struct timeval * __restrict) +#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) + __DARWIN_EXTSN_C(select) +#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ +# if defined(__LP64__) && !__DARWIN_NON_CANCELABLE + __DARWIN_1050(select) +# else /* !__LP64__ || __DARWIN_NON_CANCELABLE */ + __DARWIN_ALIAS_C(select) +# endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */ +#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */ + ; + +#endif /* !_SYS__SELECT_H_ */ diff --git a/i386/include/sys/.svn/text-base/_structs.h.svn-base b/i386/include/sys/.svn/text-base/_structs.h.svn-base new file mode 100644 index 0000000..5c9db95 --- /dev/null +++ b/i386/include/sys/.svn/text-base/_structs.h.svn-base @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include <sys/cdefs.h> + +#ifdef __need_ucontext_t +#ifndef __need_struct_ucontext +#define __need_struct_ucontext +#endif /* __need_struct_ucontext */ +#endif /* __need_ucontext_t */ + +#ifdef __need_ucontext64_t +#ifndef __need_struct_ucontext64 +#define __need_struct_ucontext64 +#endif /* __need_struct_ucontext64 */ +#endif /* __need_ucontext64_t */ + +#ifdef __need_struct_ucontext +#ifndef __need_struct_mcontext +#define __need_struct_mcontext +#endif /* __need_struct_mcontext */ +#endif /* __need_struct_ucontext */ + +#ifdef __need_struct_ucontext64 +#ifndef __need_struct_mcontext64 +#define __need_struct_mcontext64 +#endif /* __need_struct_mcontext64 */ +#endif /* __need_struct_ucontext64 */ + +#if defined(__need_struct_mcontext) || defined(__need_struct_mcontext64) +#include <machine/_structs.h> +#endif /* __need_struct_mcontext || __need_struct_mcontext64 */ + +#if defined(__need_stack_t) || defined(__need_struct_ucontext) || defined(__need_struct_ucontext64) +#ifndef __need_struct_sigaltstack +#define __need_struct_sigaltstack +#endif /* __need_struct_sigaltstack */ +#endif /* __need_stack_t || __need_struct_ucontext || __need_struct_ucontext64 */ + +#ifdef __need_struct_sigaltstack +#undef __need_struct_sigaltstack +/* Structure used in sigaltstack call. */ +#ifndef _STRUCT_SIGALTSTACK +#if __DARWIN_UNIX03 +#define _STRUCT_SIGALTSTACK struct __darwin_sigaltstack +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_SIGALTSTACK struct sigaltstack +#endif /* __DARWIN_UNIX03 */ +_STRUCT_SIGALTSTACK +{ + void *ss_sp; /* signal stack base */ + __darwin_size_t ss_size; /* signal stack length */ + int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */ +}; +#endif /* _STRUCT_SIGALTSTACK */ +#endif /* __need_struct_sigaltstack */ + +#ifdef __need_struct_timespec +#undef __need_struct_timespec +#ifndef _STRUCT_TIMESPEC +#define _STRUCT_TIMESPEC struct timespec +_STRUCT_TIMESPEC +{ + __darwin_time_t tv_sec; + long tv_nsec; +}; +#endif /* _STRUCT_TIMESPEC */ +#endif /* __need_struct_timespec */ + +#ifdef __need_struct_timeval +#undef __need_struct_timeval +#ifndef _STRUCT_TIMEVAL +#define _STRUCT_TIMEVAL struct timeval +_STRUCT_TIMEVAL +{ + __darwin_time_t tv_sec; /* seconds */ + __darwin_suseconds_t tv_usec; /* and microseconds */ +}; +#endif /* _STRUCT_TIMEVAL */ +#endif /* __need_struct_timeval */ + +#ifdef __need_struct_timeval32 +#undef __need_struct_timeval32 +#ifndef _STRUCT_TIMEVAL32 +#define _STRUCT_TIMEVAL32 struct timeval32 +_STRUCT_TIMEVAL32 +{ + __int32_t tv_sec; /* seconds */ + __int32_t tv_usec; /* and microseconds */ +}; +#endif /* _STRUCT_TIMEVAL32 */ +#endif /* __need_struct_timeval32 */ + +#ifdef __need_struct_ucontext +#undef __need_struct_ucontext +#ifndef _STRUCT_UCONTEXT +#if __DARWIN_UNIX03 +#define _STRUCT_UCONTEXT struct __darwin_ucontext +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_UCONTEXT struct ucontext +#endif /* __DARWIN_UNIX03 */ +_STRUCT_UCONTEXT +{ + int uc_onstack; + __darwin_sigset_t uc_sigmask; /* signal mask used by this context */ + _STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */ + _STRUCT_UCONTEXT *uc_link; /* pointer to resuming context */ + __darwin_size_t uc_mcsize; /* size of the machine context passed in */ + _STRUCT_MCONTEXT *uc_mcontext; /* pointer to machine specific context */ +#ifdef _XOPEN_SOURCE + _STRUCT_MCONTEXT __mcontext_data; +#endif /* _XOPEN_SOURCE */ +}; +#endif /* _STRUCT_UCONTEXT */ +#endif /* __need_struct_ucontext */ + +#ifdef __need_struct_ucontext64 +#undef __need_struct_ucontext64 +#ifndef _STRUCT_UCONTEXT64 +#if __DARWIN_UNIX03 +#define _STRUCT_UCONTEXT64 struct __darwin_ucontext64 +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_UCONTEXT64 struct ucontext64 +#endif /* __DARWIN_UNIX03 */ +_STRUCT_UCONTEXT64 +{ + int uc_onstack; + __darwin_sigset_t uc_sigmask; /* signal mask used by this context */ + _STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */ + _STRUCT_UCONTEXT64 *uc_link; /* pointer to resuming context */ + __darwin_size_t uc_mcsize; /* size of the machine context passed in */ + _STRUCT_MCONTEXT64 *uc_mcontext64; /* pointer to machine specific context */ +}; +#endif /* _STRUCT_UCONTEXT64 */ +#endif /* __need_struct_ucontext64 */ + + +#ifdef __need_fd_set +#undef __need_fd_set +#ifndef _FD_SET +#define _FD_SET +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifdef FD_SETSIZE +#define __DARWIN_FD_SETSIZE FD_SETSIZE +#else /* !FD_SETSIZE */ +#define __DARWIN_FD_SETSIZE 1024 +#endif /* FD_SETSIZE */ +#define __DARWIN_NBBY 8 /* bits in a byte */ +#define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY) /* bits per mask */ +#define __DARWIN_howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) /* # y's == x bits? */ + +__BEGIN_DECLS +typedef struct fd_set { + __int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)]; +} fd_set; +__END_DECLS + +/* This inline avoids argument side-effect issues with FD_ISSET() */ +static __inline int +__darwin_fd_isset(int _n, const struct fd_set *_p) +{ + return (_p->fds_bits[_n/__DARWIN_NFDBITS] & (1<<(_n % __DARWIN_NFDBITS))); +} + +#define __DARWIN_FD_SET(n, p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] |= (1<<(__fd % __DARWIN_NFDBITS))); } while(0) +#define __DARWIN_FD_CLR(n, p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] &= ~(1<<(__fd % __DARWIN_NFDBITS))); } while(0) +#define __DARWIN_FD_ISSET(n, p) __darwin_fd_isset((n), (p)) + +#if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3 +/* + * Use the built-in bzero function instead of the library version so that + * we do not pollute the namespace or introduce prototype warnings. + */ +#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p))) +#else +#define __DARWIN_FD_ZERO(p) bzero(p, sizeof(*(p))) +#endif + +#define __DARWIN_FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) +#endif /* _FD_SET */ +#endif /* __need_fd_set */ + +#ifdef __need_stack_t +#undef __need_stack_t +#ifndef _STACK_T +#define _STACK_T +typedef _STRUCT_SIGALTSTACK stack_t; /* [???] signal stack */ +#endif /* _STACK_T */ +#endif /* __need_stack_t */ + +#ifdef __need_ucontext_t +#undef __need_ucontext_t +/* user context */ +#ifndef _UCONTEXT_T +#define _UCONTEXT_T +typedef _STRUCT_UCONTEXT ucontext_t; /* [???] user context */ +#endif /* _UCONTEXT_T */ +#endif /* __need_ucontext_t */ + +#ifdef __need_ucontext64_t +#undef __need_ucontext64_t +#ifndef _UCONTEXT64_T +#define _UCONTEXT64_T +typedef _STRUCT_UCONTEXT64 ucontext64_t; /* [???] user context */ +#endif /* _UCONTEXT64_T */ +#endif /* __need_ucontext64_t */ diff --git a/i386/include/sys/.svn/text-base/_types.h.svn-base b/i386/include/sys/.svn/text-base/_types.h.svn-base new file mode 100644 index 0000000..9047dc2 --- /dev/null +++ b/i386/include/sys/.svn/text-base/_types.h.svn-base @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _SYS__TYPES_H_ +#define _SYS__TYPES_H_ + +#include <sys/cdefs.h> +#include <machine/_types.h> + +/* + * Type definitions; takes common type definitions that must be used + * in multiple header files due to [XSI], removes them from the system + * space, and puts them in the implementation space. + */ + +#ifdef __cplusplus +#ifdef __GNUG__ +#define __DARWIN_NULL __null +#else /* ! __GNUG__ */ +#ifdef __LP64__ +#define __DARWIN_NULL (0L) +#else /* !__LP64__ */ +#define __DARWIN_NULL 0 +#endif /* __LP64__ */ +#endif /* __GNUG__ */ +#else /* ! __cplusplus */ +#define __DARWIN_NULL ((void *)0) +#endif /* __cplusplus */ + +typedef __int64_t __darwin_blkcnt_t; /* total blocks */ +typedef __int32_t __darwin_blksize_t; /* preferred block size */ +typedef __int32_t __darwin_dev_t; /* dev_t */ +typedef unsigned int __darwin_fsblkcnt_t; /* Used by statvfs and fstatvfs */ +typedef unsigned int __darwin_fsfilcnt_t; /* Used by statvfs and fstatvfs */ +typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */ +typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/ +typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */ +#if __DARWIN_64_BIT_INO_T +typedef __darwin_ino64_t __darwin_ino_t; /* [???] Used for inodes */ +#else /* !__DARWIN_64_BIT_INO_T */ +typedef __uint32_t __darwin_ino_t; /* [???] Used for inodes */ +#endif /* __DARWIN_64_BIT_INO_T */ +typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */ +typedef __darwin_mach_port_name_t __darwin_mach_port_t; /* Used by mach */ +typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */ +typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */ +#ifndef _OFF_T +#define _OFF_T +typedef __darwin_off_t off_t; +#endif +typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */ +typedef __uint32_t __darwin_sigset_t; /* [???] signal set */ +typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */ +typedef __uint32_t __darwin_uid_t; /* [???] user IDs */ +typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */ +typedef unsigned char __darwin_uuid_t[16]; +typedef char __darwin_uuid_string_t[37]; + +#endif /* _SYS__TYPES_H_ */ diff --git a/i386/include/sys/.svn/text-base/appleapiopts.h.svn-base b/i386/include/sys/.svn/text-base/appleapiopts.h.svn-base new file mode 100644 index 0000000..2055701 --- /dev/null +++ b/i386/include/sys/.svn/text-base/appleapiopts.h.svn-base @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __SYS_APPLEAPIOPTS_H__ +#define __SYS_APPLEAPIOPTS_H__ + + +#ifndef __APPLE_API_STANDARD +#define __APPLE_API_STANDARD +#endif /* __APPLE_API_STANDARD */ + +#ifndef __APPLE_API_STABLE +#define __APPLE_API_STABLE +#endif /* __APPLE_API_STABLE */ + +#ifndef __APPLE_API_STRICT_CONFORMANCE + +#ifndef __APPLE_API_EVOLVING +#define __APPLE_API_EVOLVING +#endif /* __APPLE_API_EVOLVING */ + +#ifndef __APPLE_API_UNSTABLE +#define __APPLE_API_UNSTABLE +#endif /* __APPLE_API_UNSTABLE */ + +#ifndef __APPLE_API_PRIVATE +#define __APPLE_API_PRIVATE +#endif /* __APPLE_API_PRIVATE */ + +#ifndef __APPLE_API_OBSOLETE +#define __APPLE_API_OBSOLETE +#endif /* __APPLE_API_OBSOLETE */ + +#endif /* __APPLE_API_STRICT_CONFORMANCE */ + +#endif /* __SYS_APPLEAPIOPTS_H__ */ + diff --git a/i386/include/sys/.svn/text-base/buf.h.svn-base b/i386/include/sys/.svn/text-base/buf.h.svn-base new file mode 100644 index 0000000..6f0db77 --- /dev/null +++ b/i386/include/sys/.svn/text-base/buf.h.svn-base @@ -0,0 +1,859 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)buf.h 8.9 (Berkeley) 3/30/95 + */ + +#ifndef _SYS_BUF_H_ +#define _SYS_BUF_H_ + +#include <sys/cdefs.h> +#include <sys/kernel_types.h> +#include <mach/memory_object_types.h> + + +#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */ +#define B_READ 0x00000001 /* Read buffer. */ +#define B_ASYNC 0x00000002 /* Start I/O, do not wait. */ +#define B_NOCACHE 0x00000004 /* Do not cache block after use. */ +#define B_DELWRI 0x00000008 /* Delay I/O until buffer reused. */ +#define B_LOCKED 0x00000010 /* Locked in core (not reusable). */ +#define B_PHYS 0x00000020 /* I/O to user memory. */ +#define B_CLUSTER 0x00000040 /* UPL based I/O generated by cluster layer */ +#define B_PAGEIO 0x00000080 /* Page in/out */ +#define B_META 0x00000100 /* buffer contains meta-data. */ +#define B_RAW 0x00000200 /* Set by physio for raw transfers. */ +#define B_FUA 0x00000400 /* Write-through disk cache(if supported) */ +#define B_PASSIVE 0x00000800 /* PASSIVE I/Os are ignored by THROTTLE I/O */ +#define B_IOSTREAMING 0x00001000 /* sequential access pattern detected */ +#define B_THROTTLED_IO 0x00002000 /* low priority I/O */ +/* + * make sure to check when adding flags that + * that the new flags don't overlap the definitions + * in buf_internal.h + */ + +__BEGIN_DECLS + +/*! + @function buf_markaged + @abstract Mark a buffer as "aged," i.e. as a good candidate to be discarded and reused after buf_brelse(). + @param bp Buffer to mark. + */ +void buf_markaged(buf_t); + +/*! + @function buf_markinvalid + @abstract Mark a buffer as not having valid data and being ready for immediate reuse after buf_brelse(). + @param bp Buffer to mark. + */ +void buf_markinvalid(buf_t); + +/*! + @function buf_markdelayed + @abstract Mark a buffer as a delayed write: mark it dirty without actually scheduling I/O. + @discussion Data will be flushed to disk at some later time, not with brelse(). A sync()/fsync() + or pressure necessitating reuse of the buffer will cause it to be written back to disk. + @param bp Buffer to mark. + */ +void buf_markdelayed(buf_t); + +/*! + @function buf_markeintr + @abstract Mark a buffer as having been interrupted during I/O. + @discussion Waiters for I/O to complete (buf_biowait()) will return with EINTR when woken up. + buf_markeintr does not itself do a wakeup. + @param bp Buffer to mark. + */ +void buf_markeintr(buf_t); + +/*! + @function buf_markfua + @abstract Mark a buffer for write through disk cache, if disk supports it. + @param bp Buffer to mark. + */ +void buf_markfua(buf_t); + +/*! + @function buf_fua + @abstract Check if a buffer is marked for write through disk caches. + @param bp Buffer to test. + @return Nonzero if buffer is marked for write-through, 0 if not. + */ +int buf_fua(buf_t); + +/*! + @function buf_valid + @abstract Check if a buffer contains valid data. + @param bp Buffer to test. + @return Nonzero if buffer has valid data, 0 if not. + */ +int buf_valid(buf_t); + +/*! + @function buf_fromcache + @abstract Check if a buffer's data was found in core. + @discussion Will return truth after a buf_getblk that finds a valid buffer in the cache or the relevant + data in core (but not in a buffer). + @param bp Buffer to test. + @return Nonzero if we got this buffer's data without doing I/O, 0 if not. + */ +int buf_fromcache(buf_t); + +/*! + @function buf_upl + @abstract Get the upl (Universal Page List) associated with a buffer. + @discussion Buffers allocated with buf_alloc() are not returned with a upl, and + traditional buffers only have a upl while an I/O is in progress. + @param bp Buffer whose upl to grab. + @return Buffer's upl if it has one, else NULL. + */ +void * buf_upl(buf_t); + +/*! + @function buf_uploffset + @abstract Get the offset into a UPL at which this buffer begins. + @discussion This function should only be called on iobufs, i.e. buffers allocated with buf_alloc(). + @param bp Buffer whose uploffset to grab. + @return Buffer's uploffset--does not check whether that value makes sense for this buffer. + */ +uint32_t buf_uploffset(buf_t); + + + +/*! + @function buf_proc + @abstract Get the process associated with this buffer. + @discussion buf_proc() will generally return NULL; a process is currently only associated with + a buffer in the event of a physio() call. + @param bp Buffer whose associated process to find. + @return Associated process, possibly NULL. + */ +proc_t buf_proc(buf_t); + +/*! + @function buf_dirtyoff + @abstract Get the starting offset of the dirty region associated with a buffer. + @discussion The dirty offset is zero unless someone explicitly calls buf_setdirtyoff() (which the kernel does not). + @param bp Buffer whose dirty offset to get. + @return Dirty offset (0 if not explicitly changed). + */ +uint32_t buf_dirtyoff(buf_t); + +/*! + @function buf_dirtyend + @abstract Get the ending offset of the dirty region associated with a buffer. + @discussion If the buffer's data was found incore and dirty, the dirty end is the size of the block; otherwise, unless + someone outside of xnu explicitly changes it by calling buf_setdirtyend(), it will be zero. + @param bp Buffer whose dirty end to get. + @return 0 if buffer is found clean; size of buffer if found dirty. Can be set to any value by callers of buf_setdirtyend(). + */ +uint32_t buf_dirtyend(buf_t); + +/*! + @function buf_setdirtyoff + @abstract Set the starting offset of the dirty region associated with a buffer. + @discussion This value is zero unless someone set it explicitly. + @param bp Buffer whose dirty end to set. + @return void. + */ +void buf_setdirtyoff(buf_t, uint32_t); + +/*! + @function buf_setdirtyend + @abstract Set the ending offset of the dirty region associated with a buffer. + @discussion If the buffer's data was found incore and dirty, the dirty end is the size of the block; otherwise, unless + someone outside of xnu explicitly changes it by calling buf_setdirtyend(), it will be zero. + @param bp Buffer whose dirty end to set. + @return void. + */ +void buf_setdirtyend(buf_t, uint32_t); + +/*! + @function buf_error + @abstract Get the error value associated with a buffer. + @discussion Errors are set with buf_seterror(). + @param bp Buffer whose error value to retrieve. + @return Error value, directly. + */ +errno_t buf_error(buf_t); + +/*! + @function buf_seterror + @abstract Set an error value on a buffer. + @param bp Buffer whose error value to set. + @return void. + */ +void buf_seterror(buf_t, errno_t); + +/*! + @function buf_setflags + @abstract Set flags on a buffer. + @discussion: buffer_flags |= flags + @param bp Buffer whose flags to set. + @param flags Flags to add to buffer's mask. B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA + @return void. + */ +void buf_setflags(buf_t, int32_t); + +/*! + @function buf_clearflags + @abstract Clear flags on a buffer. + @discussion: buffer_flags &= ~flags + @param bp Buffer whose flags to clear. + @param flags Flags to remove from buffer's mask. B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA + @return void. + */ +void buf_clearflags(buf_t, int32_t); + +/*! + @function buf_flags + @abstract Get flags set on a buffer. + @discussion Valid flags are B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA. + @param bp Buffer whose flags to grab. + @return flags. + */ +int32_t buf_flags(buf_t); + +/*! + @function buf_reset + @abstract Reset I/O flag state on a buffer. + @discussion Clears current flags on a buffer (internal and external) and allows some new flags to be set. + Used perhaps to prepare an iobuf for reuse. + @param bp Buffer whose flags to grab. + @param flags Flags to set on buffer: B_READ, B_WRITE, B_ASYNC, B_NOCACHE. + @return void. + */ +void buf_reset(buf_t, int32_t); + +/*! + @function buf_map + @abstract Get virtual mappings for buffer data. + @discussion For buffers created through buf_getblk() (i.e. traditional buffer cache usage), + buf_map() just returns the address at which data was mapped by but_getblk(). For a B_CLUSTER buffer, i.e. an iobuf + whose upl state is managed manually, there are two possibilities. If the buffer was created + with an underlying "real" buffer through cluster_bp(), the mapping of the "real" buffer is returned. + Otherwise, the buffer was created with buf_alloc() and buf_setupl() was subsequently called; buf_map() + will call ubc_upl_map() to get a mapping for the buffer's upl and return the start of that mapping + plus the buffer's upl offset (set in buf_setupl()). In the last case, buf_unmap() must later be called + to tear down the mapping. NOTE: buf_map() does not set the buffer data pointer; this must be done with buf_setdataptr(). + @param bp Buffer whose mapping to find or create. + @param io_addr Destination for mapping address. + @return 0 for success, ENOMEM if unable to map the buffer. + */ +errno_t buf_map(buf_t, caddr_t *); + +/*! + @function buf_unmap + @abstract Release mappings for buffer data. + @discussion For buffers created through buf_getblk() (i.e. traditional buffer cache usage), + buf_unmap() does nothing; buf_brelse() will take care of unmapping. For a B_CLUSTER buffer, i.e. an iobuf + whose upl state is managed manually, there are two possibilities. If the buffer was created + with an underlying "real" buffer through cluster_bp(), buf_unmap() does nothing; buf_brelse() on the + underlying buffer will tear down the mapping. Otherwise, the buffer was created with buf_alloc() and + buf_setupl() was subsequently called; buf_map() created the mapping. In this case, buf_unmap() will + unmap the buffer. + @param bp Buffer whose mapping to find or create. + @param io_addr Destination for mapping address. + @return 0 for success, EINVAL if unable to unmap buffer. + */ +errno_t buf_unmap(buf_t); + +/*! + @function buf_setdrvdata + @abstract Set driver-specific data on a buffer. + @param bp Buffer whose driver-data to set. + @param drvdata Opaque driver data. + @return void. + */ +void buf_setdrvdata(buf_t, void *); + +/*! + @function buf_setdrvdata + @abstract Get driver-specific data from a buffer. + @param bp Buffer whose driver data to get. + @return Opaque driver data. + */ +void * buf_drvdata(buf_t); + +/*! + @function buf_setfsprivate + @abstract Set filesystem-specific data on a buffer. + @param bp Buffer whose filesystem data to set. + @param fsprivate Opaque filesystem data. + @return void. + */ +void buf_setfsprivate(buf_t, void *); + +/*! + @function buf_fsprivate + @abstract Get filesystem-specific data from a buffer. + @param bp Buffer whose filesystem data to get. + @return Opaque filesystem data. + */ +void * buf_fsprivate(buf_t); + +/*! + @function buf_blkno + @abstract Get physical block number associated with a buffer, in the sense of VNOP_BLOCKMAP. + @discussion When a buffer's physical block number is the same is its logical block number, then the physical + block number is considered uninitialized. A physical block number of -1 indicates that there is no valid + physical mapping (e.g. the logical block is invalid or corresponds to a sparse region in a file). Physical + block number is normally set by the cluster layer or by buf_getblk(). + @param bp Buffer whose physical block number to get. + @return Block number. + */ +daddr64_t buf_blkno(buf_t); + +/*! + @function buf_lblkno + @abstract Get logical block number associated with a buffer. + @discussion Logical block number is set on traditionally-used buffers by an argument passed to buf_getblk(), + for example by buf_bread(). + @param bp Buffer whose logical block number to get. + @return Block number. + */ +daddr64_t buf_lblkno(buf_t); + +/*! + @function buf_setblkno + @abstract Set physical block number associated with a buffer. + @discussion Physical block number is generally set by the cluster layer or by buf_getblk(). + @param bp Buffer whose physical block number to set. + @param blkno Block number to set. + @return void. + */ +void buf_setblkno(buf_t, daddr64_t); + +/*! + @function buf_setlblkno + @abstract Set logical block number associated with a buffer. + @discussion Logical block number is set on traditionally-used buffers by an argument passed to buf_getblk(), + for example by buf_bread(). + @param bp Buffer whose logical block number to set. + @param lblkno Block number to set. + @return void. + */ +void buf_setlblkno(buf_t, daddr64_t); + +/*! + @function buf_count + @abstract Get count of valid bytes in a buffer. This may be less than the space allocated to the buffer. + @param bp Buffer whose byte count to get. + @return Byte count. + */ +uint32_t buf_count(buf_t); + +/*! + @function buf_size + @abstract Get size of data region allocated to a buffer. + @discussion May be larger than amount of valid data in buffer. + @param bp Buffer whose size to get. + @return Size. + */ +uint32_t buf_size(buf_t); + +/*! + @function buf_resid + @abstract Get a count of bytes which were not consumed by an I/O on a buffer. + @discussion Set when an I/O operations completes. + @param bp Buffer whose outstanding count to get. + @return Count of unwritten/unread bytes. + */ +uint32_t buf_resid(buf_t); + +/*! + @function buf_setcount + @abstract Set count of valid bytes in a buffer. This may be less than the space allocated to the buffer. + @param bp Buffer whose byte count to set. + @param bcount Count to set. + @return void. + */ +void buf_setcount(buf_t, uint32_t); + +/*! + @function buf_setsize + @abstract Set size of data region allocated to a buffer. + @discussion May be larger than amount of valid data in buffer. Should be used by + code which is manually providing storage for an iobuf, one allocated with buf_alloc(). + @param bp Buffer whose size to set. + @return void. + */ +void buf_setsize(buf_t, uint32_t); + +/*! + @function buf_setresid + @abstract Set a count of bytes outstanding for I/O in a buffer. + @discussion Set when an I/O operations completes. Examples: called by IOStorageFamily when I/O + completes, often called on an "original" buffer when using a manipulated buffer to perform I/O + on behalf of the first. + @param bp Buffer whose outstanding count to set. + @return Count of unwritten/unread bytes. + */ +void buf_setresid(buf_t, uint32_t); + +/*! + @function buf_setdataptr + @abstract Set the address at which a buffer's data will be stored. + @discussion In traditional buffer use, the data pointer will be set automatically. This routine is + useful with iobufs (allocated with buf_alloc()). + @param bp Buffer whose data pointer to set. + @param data Pointer to data region. + @return void. + */ +void buf_setdataptr(buf_t, uintptr_t); + +/*! + @function buf_dataptr + @abstract Get the address at which a buffer's data is stored; for iobufs, this must + be set with buf_setdataptr(). See buf_map(). + @param bp Buffer whose data pointer to retrieve. + @return Data pointer; NULL if unset. + */ +uintptr_t buf_dataptr(buf_t); + +/*! + @function buf_vnode + @abstract Get the vnode associated with a buffer. + @discussion Every buffer is associated with a file. Because there is an I/O in flight, + there is an iocount on this vnode; it is returned WITHOUT an extra iocount, and vnode_put() + need NOT be called. + @param bp Buffer whose vnode to retrieve. + @return Buffer's vnode. + */ +vnode_t buf_vnode(buf_t); + +/*! + @function buf_setvnode + @abstract Set the vnode associated with a buffer. + @discussion This call need not be used on traditional buffers; it is for use with iobufs. + @param bp Buffer whose vnode to set. + @param vp The vnode to attach to the buffer. + @return void. + */ +void buf_setvnode(buf_t, vnode_t); + +/*! + @function buf_setdevice + @abstract Set the device associated with a buffer. + @discussion A buffer's device is set in buf_strategy() (or in buf_getblk() if the file is a device). + It is also set on an iobuf if buf_alloc() is passed a device vnode. + @param bp Buffer whose device ID to set. + @param vp Device to set on the buffer. + @return 0 for success, EINVAL if vp is not a device file. + */ +errno_t buf_setdevice(buf_t, vnode_t); + +/*! + @function buf_strategy + @abstract Pass an I/O request for a buffer down to the device layer. + @discussion This is one of the most important routines in the buffer cache layer. For buffers obtained + through buf_getblk, it handles finding physical block numbers for the I/O (with VNOP_BLKTOOFF and + VNOP_BLOCKMAP), packaging the I/O into page-sized chunks, and initiating I/O on the disk by calling + the device's strategy routine. If a buffer's UPL has been set manually with buf_setupl(), it assumes + that the request is already correctly configured with a block number and a size divisible by page size + and will just call directly to the device. + @param devvp Device on which to perform I/O + @param ap vnop_strategy_args structure (most importantly, a buffer). + @return 0 for success, or errors from filesystem or device layers. + */ +errno_t buf_strategy(vnode_t, void *); + +/* + * Flags for buf_invalblkno() + */ +#define BUF_WAIT 0x01 + +/*! + @function buf_invalblkno + @abstract Invalidate a filesystem logical block in a file. + @discussion buf_invalblkno() tries to make the data for a given block in a file + invalid; if the buffer for that block is found in core and is not busy, we mark it + invalid and call buf_brelse() (see "flags" param for what happens if the buffer is busy). + buf_brelse(), noticing that it is invalid, will + will return the buffer to the empty-buffer list and tell the VM subsystem to abandon + the relevant pages. Data will not be written to backing store--it will be cast aside. + Note that this function will only work if the block in question has been + obtained with a buf_getblk(). If data has been read into core without using + traditional buffer cache routines, buf_invalblkno() will not be able to invalidate it--this + includes the use of iobufs. + @param bp Buffer whose block to invalidate. + @param lblkno Logical block number. + @param flags BUF_WAIT: wait for busy buffers to become unbusy and invalidate them then. Otherwise, + just return EBUSY for busy blocks. + @return 0 for success, EINVAL if vp is not a device file. + */ +errno_t buf_invalblkno(vnode_t, daddr64_t, int); + +/*! + @function buf_callback + @abstract Get the function set to be called when I/O on a buffer completes. + @discussion A function returned by buf_callback was originally set with buf_setcallback(). + @param bp Buffer whose callback to get. + @return 0 for success, or errors from filesystem or device layers. + */ +void * buf_callback(buf_t); + +/*! + @function buf_setcallback + @abstract Set a function to be called once when I/O on a buffer completes. + @discussion A one-shot callout set with buf_setcallback() will be called from buf_biodone() + when I/O completes. It will be passed the "transaction" argument as well as the buffer. + buf_setcallback() also marks the buffer as B_ASYNC. + @param bp Buffer whose callback to set. + @param callback function to use as callback. + @param transaction Additional argument to callback function. + @return 0; always succeeds. + */ +errno_t buf_setcallback(buf_t, void (*)(buf_t, void *), void *); + +/*! + @function buf_setupl + @abstract Set the UPL (Universal Page List), and offset therein, on a buffer. + @discussion buf_setupl() should only be called on buffers allocated with buf_alloc(). + A subsequent call to buf_map() will map the UPL and give back the address at which data + begins. After buf_setupl() is called, a buffer is marked B_CLUSTER; when this is the case, + buf_strategy() assumes that a buffer is correctly configured to be passed to the device + layer without modification. Passing a NULL upl will clear the upl and the B_CLUSTER flag on the + buffer. + @param bp Buffer whose upl to set. + @param upl UPL to set in the buffer. + @parma offset Offset within upl at which relevant data begin. + @return 0 for success, EINVAL if the buffer was not allocated with buf_alloc(). + */ +errno_t buf_setupl(buf_t, upl_t, uint32_t); + +/*! + @function buf_clone + @abstract Clone a buffer with a restricted range and an optional callback. + @discussion Generates a buffer which is identical to its "bp" argument except that + it spans a subset of the data of the original. The buffer to be cloned should + have been allocated with buf_alloc(). Checks its arguments to make sure + that the data subset is coherent. Optionally, adds a callback function and argument to it + to be called when I/O completes (as with buf_setcallback(), but B_ASYNC is not set). If the original buffer had + a upl set through buf_setupl(), this upl is copied to the new buffer; otherwise, the original's + data pointer is used raw. The buffer must be released with buf_free(). + @param bp Buffer to clone. + @param io_offset Offset, relative to start of data in original buffer, at which new buffer's data will begin. + @param io_size Size of buffer region in new buffer, in the sense of buf_count(). + @param iodone Callback to be called from buf_biodone() when I/O completes, in the sense of buf_setcallback(). + @param arg Argument to pass to iodone() callback. + @return NULL if io_offset/io_size combination is invalid for the buffer to be cloned; otherwise, the new buffer. + */ +buf_t buf_clone(buf_t, int, int, void (*)(buf_t, void *), void *); + +/*! + @function buf_alloc + @abstract Allocate an uninitialized buffer. + @discussion A buffer returned by buf_alloc() is marked as busy and as an iobuf; it has no storage set up and must be + set up using buf_setdataptr() or buf_setupl()/buf_map(). + @param vp vnode to associate with the buffer: optionally NULL. If vp is a device file, then + the buffer's associated device will be set. If vp is NULL, it can be set later with buf_setvnode(). + @return New buffer. + */ +buf_t buf_alloc(vnode_t); + +/*! + @function buf_free + @abstract Free a buffer that was allocated with buf_alloc(). + @discussion The storage (UPL, data pointer) associated with an iobuf must be freed manually. + @param bp The buffer to free. + @return void. + */ +void buf_free(buf_t); + +/* + * flags for buf_invalidateblks + */ +#define BUF_WRITE_DATA 0x0001 /* write data blocks first */ +#define BUF_SKIP_META 0x0002 /* skip over metadata blocks */ + +/*! + @function buf_invalidateblks + @abstract Invalidate all the blocks associated with a vnode. + @discussion This function does for all blocks associated with a vnode what buf_invalblkno does for one block. + Again, it will only be able to invalidate data which were populated with traditional buffer cache routines, + i.e. by buf_getblk() and callers thereof. Unlike buf_invalblkno(), it can be made to write dirty data to disk + rather than casting it aside. + @param bp The buffer whose data to invalidate. + @param flags BUF_WRITE_DATA: write dirty data to disk with VNOP_BWRITE() before kicking buffer cache entries out. + BUF_SKIP_META: do not invalidate metadata blocks. + @param slpflag Flags to pass to "msleep" while waiting to acquire busy buffers. + @param slptimeo Timeout in "hz" (1/100 second) to wait for a buffer to become unbusy before waking from sleep + and re-starting the scan. + @return 0 for success, error values from msleep(). + */ +int buf_invalidateblks(vnode_t, int, int, int); + +/* + * flags for buf_flushdirtyblks and buf_iterate + */ +#define BUF_SKIP_NONLOCKED 0x01 +#define BUF_SKIP_LOCKED 0x02 +#define BUF_SCAN_CLEAN 0x04 /* scan the clean buffers */ +#define BUF_SCAN_DIRTY 0x08 /* scan the dirty buffers */ +#define BUF_NOTIFY_BUSY 0x10 /* notify the caller about the busy pages during the scan */ + + +#define BUF_RETURNED 0 +#define BUF_RETURNED_DONE 1 +#define BUF_CLAIMED 2 +#define BUF_CLAIMED_DONE 3 +/*! + @function buf_flushdirtyblks + @abstract Write dirty file blocks to disk. + @param vp The vnode whose blocks to flush. + @param wait Wait for writes to complete before returning. + @param flags Can pass zero, meaning "flush all dirty buffers." + BUF_SKIP_NONLOCKED: Skip buffers which are not busy when we encounter them. + BUF_SKIP_LOCKED: Skip buffers which are busy when we encounter them. + @param msg String to pass to msleep(). + @return void. + */ +void buf_flushdirtyblks(vnode_t, int, int, const char *); + +/*! + @function buf_iterate + @abstract Perform some operation on all buffers associated with a vnode. + @param vp The vnode whose buffers to scan. + @param callout Function to call on each buffer. Should return one of: + BUF_RETURNED: buf_iterate() should call buf_brelse() on the buffer. + BUF_RETURNED_DONE: buf_iterate() should call buf_brelse() on the buffer and then stop iterating. + BUF_CLAIMED: buf_iterate() should continue iterating (and not call buf_brelse()). + BUF_CLAIMED_DONE: buf_iterate() should stop iterating (and not call buf_brelse()). + @param flag + BUF_SKIP_NONLOCKED: Skip buffers which are not busy when we encounter them. BUF_SKIP_LOCKED: Skip buffers which are busy when we encounter them. + BUF_SCAN_CLEAN: Call out on clean buffers. + BUF_SCAN_DIRTY: Call out on dirty buffers. + BUF_NOTIFY_BUSY: If a buffer cannot be acquired, pass a NULL buffer to callout; otherwise, + that buffer will be silently skipped. + @param arg Argument to pass to callout in addition to buffer. + @return void. + */ +void buf_iterate(vnode_t, int (*)(buf_t, void *), int, void *); + +/*! + @function buf_clear + @abstract Zero out the storage associated with a buffer. + @discussion Calls buf_map() to get the buffer's data address; for a B_CLUSTER + buffer (one which has had buf_setupl() called on it), it tries to map the buffer's + UPL into memory; should only be called once during the life cycle of an iobuf (one allocated + with buf_alloc()). + @param bp The buffer to zero out. + @return void. + */ +void buf_clear(buf_t); + +/*! + @function buf_bawrite + @abstract Start an asychronous write on a buffer. + @discussion Calls VNOP_BWRITE to start the process of propagating an asynchronous write down to the device layer. + Callers can wait for writes to complete at their discretion using buf_biowait(). When this function is called, + data should already have been written to the buffer's data region. + @param bp The buffer on which to initiate I/O. + @param throttle If "throttle" is nonzero and more than VNODE_ASYNC_THROTTLE writes are in progress on this file, + buf_bawrite() will block until the write count drops below VNODE_ASYNC_THROTTLE. If "throttle" is zero and the write + count is high, it will fail with EWOULDBLOCK; the caller can decide whether to make a blocking call or pursue + other opportunities. + @return EWOULDBLOCK if write count is high and "throttle" is zero; otherwise, errors from VNOP_BWRITE. + */ +errno_t buf_bawrite(buf_t); + +/*! + @function buf_bdwrite + @abstract Mark a buffer for delayed write. + @discussion Marks a buffer as waiting for delayed write and the current I/O as complete; data will be written to backing store + before the buffer is reused, but it will not be queued for I/O immediately. Note that for buffers allocated + with buf_alloc(), there are no such guarantees; you must take care of your own flushing to disk. If + the number of delayed writes pending on the system is greater than an internal limit and the caller has not + requested otherwise [see return_error] , buf_bdwrite() will unilaterally launch an asynchronous I/O with buf_bawrite() to keep the pile of + delayed writes from getting too large. + @param bp The buffer to mark for delayed write. + @param return_error If the number of pending delayed writes systemwide is larger than an internal limit, + return EAGAIN rather than doing an asynchronous write. + @return EAGAIN for return_error != 0 case, 0 for succeess, errors from buf_bawrite. + */ +errno_t buf_bdwrite(buf_t); + +/*! + @function buf_bwrite + @abstract Write a buffer's data to backing store. + @discussion Once the data in a buffer has been modified, buf_bwrite() starts sending it to disk by calling + VNOP_STRATEGY. Unless B_ASYNC has been set on the buffer (by buf_setflags() or otherwise), data will have + been written to disk when buf_bwrite() returns. See Bach (p 56). + @param bp The buffer to write to disk. + @return 0 for success; errors from buf_biowait(). + */ +errno_t buf_bwrite(buf_t); + +/*! + @function buf_biodone + @abstract Mark an I/O as completed. + @discussion buf_biodone() should be called by whosoever decides that an I/O on a buffer is complete; for example, + IOStorageFamily. It clears the dirty flag on a buffer and signals on the vnode that a write has completed + with vnode_writedone(). If a callout or filter has been set on the buffer, that function is called. In the case + of a callout, that function is expected to take care of cleaning up and freeing the buffer. + Otherwise, if the buffer is marked B_ASYNC (e.g. it was passed to buf_bawrite()), then buf_biodone() + considers itself justified in calling buf_brelse() to return it to free lists--no one is waiting for it. Finally, + waiters on the bp (e.g. in buf_biowait()) are woken up. + @param bp The buffer to mark as done with I/O. + @return void. + */ +void buf_biodone(buf_t); + +/*! + @function buf_biowait + @abstract Wait for I/O on a buffer to complete. + @discussion Waits for I/O on a buffer to finish, as marked by a buf_biodone() call. + @param bp The buffer to wait on. + @return 0 for a successful wait; nonzero the buffer has been marked as EINTR or had an error set on it. + */ +errno_t buf_biowait(buf_t); + +/*! + @function buf_brelse + @abstract Release any claim to a buffer, sending it back to free lists. + @discussion buf_brelse() cleans up buffer state and releases a buffer to the free lists. If the buffer + is not marked invalid and its pages are dirty (e.g. a delayed write was made), its data will be commited + to backing store. If it is marked invalid, its data will be discarded completely. + A valid, cacheable buffer will be put on a list and kept in the buffer hash so it + can be found again; otherwise, it will be dissociated from its vnode and treated as empty. Which list a valid + buffer is placed on depends on the use of buf_markaged(), whether it is metadata, and the B_LOCKED flag. A + B_LOCKED buffer will not be available for reuse by other files, though its data may be paged out. + Note that buf_brelse() is intended for use with traditionally allocated buffers. + @param bp The buffer to release. + @retrn void. + */ +void buf_brelse(buf_t); + +/*! + @function minphys + @abstract Adjust a buffer's count to be no more than maximum physical I/O transfer size for the host architecture. + @discussion physio() takes as a parameter a function to bound transfer sizes for each VNOP_STRATEGY() call. minphys() + is a default implementation. It calls buf_setcount() to make the buffer's count the min() of its current count + and the max I/O size for the host architecture. + @param bp The buffer whose byte count to modify. + @return New byte count. + */ +u_int minphys(buf_t bp); + +/* + * Flags for operation type in getblk() + */ +#define BLK_READ 0x01 /* buffer for read */ +#define BLK_WRITE 0x02 /* buffer for write */ +#define BLK_META 0x10 /* buffer for metadata */ +/* + * modifier for above flags... if set, getblk will only return + * a bp that is already valid... i.e. found in the cache + */ +#define BLK_ONLYVALID 0x80000000 + +/*! + @function buf_getblk + @abstract Traditional buffer cache routine to get a buffer corresponding to a logical block in a file. + @discussion buf_getblk() gets a buffer, not necessarily containing valid data, representing a block in a file. + A metadata buffer will be returned with its own zone-allocated storage, managed by the traditional buffer-cache + layer, whereas data buffers will be returned hooked into backing by the UBC (which in fact controls the caching of data). + buf_getblk() first looks for the buffer header in cache; if the buffer is in-core but busy, buf_getblk() will wait for it to become + unbusy, depending on the slpflag and slptimeo parameters. If the buffer is found unbusy and is a metadata buffer, + it must already contain valid data and will be returned directly; data buffers will have a UPL configured to + prepare for interaction with the underlying UBC. If the buffer is found in core, it will be marked as such + and buf_fromcache() will return truth. A buffer is allocated and initialized (but not filled with data) + if none is found in core. buf_bread(), buf_breadn(), buf_meta_bread(), and buf_meta_breadn() all + return buffers obtained with buf_getblk(). + @param vp File for which to get block. + @param blkno Logical block number. + @param size Size of block. + @param slpflag Flag to pass to msleep() while waiting for buffer to become unbusy. + @param slptimeo Time, in milliseconds, to wait for buffer to become unbusy. 0 means to wait indefinitely. + @param operation BLK_READ: want a read buffer. BLK_WRITE: want a write buffer. BLK_META: want a metadata buffer. BLK_ONLYVALID: + only return buffers which are found in core (do not allocate anew), and do not change buffer size. The last remark means + that if a given logical block is found in core with a different size than what is requested, the buffer size will not be modified. + @return Buffer found in core or newly allocated, either containing valid data or ready for I/O. + */ +buf_t buf_getblk(vnode_t, daddr64_t, int, int, int, int); + +/*! + @function buf_geteblk + @abstract Get a metadata buffer which is marked invalid and not associated with any vnode. + @discussion A buffer is returned with zone-allocated storage of the specified size, marked B_META and invalid. + It has no vnode and is not visible in the buffer hash. + @param size Size of buffer. + @return Always returns a new buffer. + */ +buf_t buf_geteblk(int); + + +__END_DECLS + + +/* Macros to clear/set/test flags. */ +#define SET(t, f) (t) |= (f) +#define CLR(t, f) (t) &= ~(f) +#define ISSET(t, f) ((t) & (f)) + + +#endif /* !_SYS_BUF_H_ */ diff --git a/i386/include/sys/.svn/text-base/cdefs.h.svn-base b/i386/include/sys/.svn/text-base/cdefs.h.svn-base new file mode 100644 index 0000000..3240187 --- /dev/null +++ b/i386/include/sys/.svn/text-base/cdefs.h.svn-base @@ -0,0 +1,583 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright 1995 NeXT Computer, Inc. All rights reserved. */ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + */ + +#ifndef _CDEFS_H_ +#define _CDEFS_H_ + +#if defined(__cplusplus) +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif + +/* + * The __CONCAT macro is used to concatenate parts of symbol names, e.g. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * The __CONCAT macro is a bit tricky -- make sure you don't put spaces + * in between its arguments. __CONCAT can also concatenate double-quoted + * strings produced by the __STRING macro, but this only works with ANSI C. + */ +#if defined(__STDC__) || defined(__cplusplus) +#define __P(protos) protos /* full-blown ANSI C */ +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +#define __const const /* define reserved names to standard */ +#define __signed signed +#define __volatile volatile +#if defined(__cplusplus) +#define __inline inline /* convert to C++ keyword */ +#else +#ifndef __GNUC__ +#define __inline /* delete GCC keyword */ +#endif /* !__GNUC__ */ +#endif /* !__cplusplus */ + +#else /* !(__STDC__ || __cplusplus) */ +#define __P(protos) () /* traditional C preprocessor */ +#define __CONCAT(x,y) x/**/y +#define __STRING(x) "x" + +#ifndef __GNUC__ +#define __const /* delete pseudo-ANSI C keywords */ +#define __inline +#define __signed +#define __volatile +#endif /* !__GNUC__ */ + +/* + * In non-ANSI C environments, new programs will want ANSI-only C keywords + * deleted from the program and old programs will want them left alone. + * When using a compiler other than gcc, programs using the ANSI C keywords + * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. + * When using "gcc -traditional", we assume that this is the intent; if + * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. + */ +#ifndef NO_ANSI_KEYWORDS +#define const __const /* convert ANSI C keywords */ +#define inline __inline +#define signed __signed +#define volatile __volatile +#endif /* !NO_ANSI_KEYWORDS */ +#endif /* !(__STDC__ || __cplusplus) */ + +/* + * GCC1 and some versions of GCC2 declare dead (non-returning) and + * pure (no side effects) functions using "volatile" and "const"; + * unfortunately, these then cause warnings under "-ansi -pedantic". + * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of + * these work for GNU C++ (modulo a slight glitch in the C++ grammar + * in the distribution version of 2.5.5). + */ +#if defined(__MWERKS__) && (__MWERKS__ > 0x2400) + /* newer Metrowerks compilers support __attribute__() */ +#elif __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 5 +#define __dead2 __attribute__((__noreturn__)) +#define __pure2 __attribute__((__const__)) +#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 +#define __unused /* no attribute */ +#else +#define __unused __attribute__((__unused__)) +#endif +#else +#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +/* __dead and __pure are depreciated. Use __dead2 and __pure2 instead */ +#define __dead __volatile +#define __pure __const +#endif +#endif + +/* Delete pseudo-keywords wherever they are not available or needed. */ +#ifndef __dead +#define __dead +#define __pure +#endif +#ifndef __dead2 +#define __dead2 +#define __pure2 +#define __unused +#endif + +/* + * GCC 2.95 provides `__restrict' as an extension to C90 to support the + * C99-specific `restrict' type qualifier. We happen to use `__restrict' as + * a way to define the `restrict' type qualifier without disturbing older + * software that is unaware of C99 keywords. + */ +#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) +#if __STDC_VERSION__ < 199901 +#define __restrict +#else +#define __restrict restrict +#endif +#endif + +/* + * Compiler-dependent macros to declare that functions take printf-like + * or scanf-like arguments. They are null except for versions of gcc + * that are known to support the features properly. Functions declared + * with these attributes will cause compilation warnings if there is a + * mismatch between the format string and subsequent function parameter + * types. + */ +#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +#define __printflike(fmtarg, firstvararg) \ + __attribute__((__format__ (__printf__, fmtarg, firstvararg))) +#define __scanflike(fmtarg, firstvararg) \ + __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) +#else +#define __printflike(fmtarg, firstvararg) +#define __scanflike(fmtarg, firstvararg) +#endif + +#define __IDSTRING(name,string) static const char name[] __unused = string + +#ifndef __COPYRIGHT +#define __COPYRIGHT(s) __IDSTRING(copyright,s) +#endif + +#ifndef __RCSID +#define __RCSID(s) __IDSTRING(rcsid,s) +#endif + +#ifndef __SCCSID +#define __SCCSID(s) __IDSTRING(sccsid,s) +#endif + +#ifndef __PROJECT_VERSION +#define __PROJECT_VERSION(s) __IDSTRING(project_version,s) +#endif + +/* + * COMPILATION ENVIRONMENTS + * + * DEFAULT By default newly complied code will get POSIX APIs plus + * Apple API extensions in scope. + * + * Most users will use this compilation environment to avoid + * behavioral differences between 32 and 64 bit code. + * + * LEGACY Defining _NONSTD_SOURCE will get pre-POSIX APIs plus Apple + * API extensions in scope. + * + * This is generally equivalent to the Tiger release compilation + * environment, except that it cannot be applied to 64 bit code; + * its use is discouraged. + * + * We expect this environment to be deprecated in the future. + * + * STRICT Defining _POSIX_C_SOURCE or _XOPEN_SOURCE restricts the + * available APIs to exactly the set of APIs defined by the + * corresponding standard, based on the value defined. + * + * A correct, portable definition for _POSIX_C_SOURCE is 200112L. + * A correct, portable definition for _XOPEN_SOURCE is 600L. + * + * Apple API extensions are not visible in this environment, + * which can cause Apple specific code to fail to compile, + * or behave incorrectly if prototypes are not in scope or + * warnings about missing prototypes are not enabled or ignored. + * + * In any compilation environment, for correct symbol resolution to occur, + * function prototypes must be in scope. It is recommended that all Apple + * tools users add either the "-Wall" or "-Wimplicit-function-declaration" + * compiler flags to their projects to be warned when a function is being + * used without a prototype in scope. + */ + +/* These settings are particular to each product. */ +/* Product: MacOSX */ +#define __DARWIN_ONLY_64_BIT_INO_T 0 +/* #undef __DARWIN_ONLY_UNIX_CONFORMANCE (automatically set for 64-bit) */ +#define __DARWIN_ONLY_VERS_1050 0 + +/* + * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow + * legacy code to use the old symbol, thus maintaining binary compatibility + * while new code can use a standards compliant version of the same function. + * + * __DARWIN_ALIAS is used by itself if the function signature has not + * changed, it is used along with a #ifdef check for __DARWIN_UNIX03 + * if the signature has changed. Because the __LP64__ environment + * only supports UNIX03 semantics it causes __DARWIN_UNIX03 to be + * defined, but causes __DARWIN_ALIAS to do no symbol mangling. + * + * As a special case, when XCode is used to target a specific version of the + * OS, the manifest constant __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + * will be defined by the compiler, with the digits representing major version + * time 100 + minor version times 10 (e.g. 10.5 := 1050). If we are targeting + * pre-10.5, and it is the default compilation environment, revert the + * compilation environment to pre-__DARWIN_UNIX03. + */ +#if !defined(__DARWIN_ONLY_UNIX_CONFORMANCE) +# if defined(__LP64__) +# define __DARWIN_ONLY_UNIX_CONFORMANCE 1 +# else /* !__LP64__ */ +# define __DARWIN_ONLY_UNIX_CONFORMANCE 0 +# endif /* __LP64__ */ +#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ + +#if !defined(__DARWIN_UNIX03) +# if __DARWIN_ONLY_UNIX_CONFORMANCE +# if defined(_NONSTD_SOURCE) +# error "Can't define _NONSTD_SOURCE when only UNIX conformance is available." +# endif /* _NONSTD_SOURCE */ +# define __DARWIN_UNIX03 1 +# elif defined(_DARWIN_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE) +# if defined(_NONSTD_SOURCE) +# error "Can't define both _NONSTD_SOURCE and any of _DARWIN_C_SOURCE, _XOPEN_SOURCE or _POSIX_C_SOURCE." +# endif /* _NONSTD_SOURCE */ +# define __DARWIN_UNIX03 1 +# elif defined(_NONSTD_SOURCE) +# define __DARWIN_UNIX03 0 +# else /* default */ +# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) +# define __DARWIN_UNIX03 0 +# else /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */ +# define __DARWIN_UNIX03 1 +# endif /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */ +# endif /* _DARWIN_C_SOURCE || _XOPEN_SOURCE || _POSIX_C_SOURCE || __LP64__ */ +#endif /* !__DARWIN_UNIX03 */ + +#if !defined(__DARWIN_64_BIT_INO_T) +# if defined(_DARWIN_USE_64_BIT_INODE) +# if defined(_DARWIN_NO_64_BIT_INODE) +# error "Can't define both _DARWIN_USE_64_BIT_INODE and _DARWIN_NO_64_BIT_INODE." +# endif /* _DARWIN_NO_64_BIT_INODE */ +# define __DARWIN_64_BIT_INO_T 1 +# elif defined(_DARWIN_NO_64_BIT_INODE) +# if __DARWIN_ONLY_64_BIT_INO_T +# error "Can't define _DARWIN_NO_64_BIT_INODE when only 64-bit inodes are available." +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# define __DARWIN_64_BIT_INO_T 0 +# else /* default */ +# if __DARWIN_ONLY_64_BIT_INO_T +# define __DARWIN_64_BIT_INO_T 1 +# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1060) || __DARWIN_UNIX03 == 0 +# define __DARWIN_64_BIT_INO_T 0 +# else /* default */ +# define __DARWIN_64_BIT_INO_T 1 +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# endif +#endif /* !__DARWIN_64_BIT_INO_T */ + +#if !defined(__DARWIN_VERS_1050) +# if __DARWIN_ONLY_VERS_1050 +# define __DARWIN_VERS_1050 1 +# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) || __DARWIN_UNIX03 == 0 +# define __DARWIN_VERS_1050 0 +# else /* default */ +# define __DARWIN_VERS_1050 1 +# endif +#endif /* !__DARWIN_VERS_1050 */ + +#if !defined(__DARWIN_NON_CANCELABLE) +# define __DARWIN_NON_CANCELABLE 0 +#endif /* !__DARWIN_NON_CANCELABLE */ + +/* + * symbol suffixes used for symbol versioning + */ +#if __DARWIN_UNIX03 +# if __DARWIN_ONLY_UNIX_CONFORMANCE +# define __DARWIN_SUF_UNIX03 /* nothing */ +# else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ +# define __DARWIN_SUF_UNIX03 "$UNIX2003" +# endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */ + +# if __DARWIN_64_BIT_INO_T +# if __DARWIN_ONLY_64_BIT_INO_T +# define __DARWIN_SUF_64_BIT_INO_T /* nothing */ +# else /* !__DARWIN_ONLY_64_BIT_INO_T */ +# define __DARWIN_SUF_64_BIT_INO_T "$INODE64" +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# else /* !__DARWIN_64_BIT_INO_T */ +# define __DARWIN_SUF_64_BIT_INO_T /* nothing */ +# endif /* __DARWIN_64_BIT_INO_T */ + +# if __DARWIN_VERS_1050 +# if __DARWIN_ONLY_VERS_1050 +# define __DARWIN_SUF_1050 /* nothing */ +# else /* !__DARWIN_ONLY_VERS_1050 */ +# define __DARWIN_SUF_1050 "$1050" +# endif /* __DARWIN_ONLY_VERS_1050 */ +# else /* !__DARWIN_VERS_1050 */ +# define __DARWIN_SUF_1050 /* nothing */ +# endif /* __DARWIN_VERS_1050 */ + +# if __DARWIN_NON_CANCELABLE +# define __DARWIN_SUF_NON_CANCELABLE "$NOCANCEL" +# else /* !__DARWIN_NON_CANCELABLE */ +# define __DARWIN_SUF_NON_CANCELABLE /* nothing */ +# endif /* __DARWIN_NON_CANCELABLE */ + +#else /* !__DARWIN_UNIX03 */ +# define __DARWIN_SUF_UNIX03 /* nothing */ +# define __DARWIN_SUF_64_BIT_INO_T /* nothing */ +# define __DARWIN_SUF_NON_CANCELABLE /* nothing */ +# define __DARWIN_SUF_1050 /* nothing */ +#endif /* __DARWIN_UNIX03 */ + +#define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN" + +/* + * symbol versioning macros + */ +#define __DARWIN_ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_UNIX03) +#define __DARWIN_ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03) +#define __DARWIN_ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03) +#define __DARWIN_INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T) + +#define __DARWIN_1050(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050) +#define __DARWIN_1050ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_UNIX03) +#define __DARWIN_1050ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03) +#define __DARWIN_1050ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03) +#define __DARWIN_1050INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T) + +#define __DARWIN_EXTSN(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN) +#define __DARWIN_EXTSN_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN __DARWIN_SUF_NON_CANCELABLE) + +/* + * symbol release macros + */ +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1060) +#undef __DARWIN_10_6_AND_LATER +#define __DARWIN_10_6_AND_LATER_ALIAS(x) /* nothing */ +#else /* 10.6 and beyond */ +#define __DARWIN_10_6_AND_LATER +#define __DARWIN_10_6_AND_LATER_ALIAS(x) x +#endif + + +/* + * POSIX.1 requires that the macros we test be defined before any standard + * header file is included. This permits us to convert values for feature + * testing, as necessary, using only _POSIX_C_SOURCE. + * + * Here's a quick run-down of the versions: + * defined(_POSIX_SOURCE) 1003.1-1988 + * _POSIX_C_SOURCE == 1L 1003.1-1990 + * _POSIX_C_SOURCE == 2L 1003.2-1992 C Language Binding Option + * _POSIX_C_SOURCE == 199309L 1003.1b-1993 + * _POSIX_C_SOURCE == 199506L 1003.1c-1995, 1003.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + * _POSIX_C_SOURCE == 200112L 1003.1-2001 + * + * In addition, the X/Open Portability Guide, which is now the Single UNIX + * Specification, defines a feature-test macro which indicates the version of + * that specification, and which subsumes _POSIX_C_SOURCE. + */ + +/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1L. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199009L +#endif + +/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2L. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199209L +#endif + +/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ +#ifdef _XOPEN_SOURCE +#if _XOPEN_SOURCE - 0L >= 600L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112L +#elif _XOPEN_SOURCE - 0L >= 500L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199506L +#endif +#endif + +/* + * Deal with all versions of POSIX. The ordering relative to the tests above is + * important. + */ +#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 198808L +#endif + +/* + * long long is not supported in c89 (__STRICT_ANSI__), but g++ -ansi and + * c99 still want long longs. While not perfect, we allow long longs for + * g++. + */ +#define __DARWIN_NO_LONG_LONG (defined(__STRICT_ANSI__) \ + && (__STDC_VERSION__-0 < 199901L) \ + && !defined(__GNUG__)) + +/* + * Long double compatibility macro allow selecting variant symbols based + * on the old (compatible) 64-bit long doubles, or the new 128-bit + * long doubles. This applies only to ppc; i386 already has long double + * support, while ppc64 doesn't have any backwards history. + */ +#if defined(__arm__) +# define __DARWIN_LDBL_COMPAT(x) /* nothing */ +# define __DARWIN_LDBL_COMPAT2(x) /* nothing */ +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 1 +#elif defined(__ppc__) +# if defined(__LDBL_MANT_DIG__) && defined(__DBL_MANT_DIG__) && \ + __LDBL_MANT_DIG__ > __DBL_MANT_DIG__ +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1040 +# define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBLStub") +# else +# define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBL128") +# endif +# define __DARWIN_LDBL_COMPAT2(x) __asm("_" __STRING(x) "$LDBL128") +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 0 +# else +# define __DARWIN_LDBL_COMPAT(x) /* nothing */ +# define __DARWIN_LDBL_COMPAT2(x) /* nothing */ +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 1 +# endif +#elif defined(__i386__) || defined(__ppc64__) || defined(__x86_64__) +# define __DARWIN_LDBL_COMPAT(x) /* nothing */ +# define __DARWIN_LDBL_COMPAT2(x) /* nothing */ +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 0 +#else +# error Unknown architecture +#endif + +/* + * Deprecation macro + */ +#if __GNUC__ >= 3 +#define __deprecated __attribute__((deprecated)) +#else +#define __deprecated /* nothing */ +#endif + +/***************************************** + * Public darwin-specific feature macros + *****************************************/ + +/* + * _DARWIN_FEATURE_64_BIT_INODE indicates that the ino_t type is 64-bit, and + * structures modified for 64-bit inodes (like struct stat) will be used. + */ +#if __DARWIN_64_BIT_INO_T +#define _DARWIN_FEATURE_64_BIT_INODE 1 +#endif + +/* + * _DARWIN_FEATURE_LONG_DOUBLE_IS_DOUBLE indicates when the long double type + * is the same as the double type (ppc and arm only) + */ +#if __DARWIN_LONG_DOUBLE_IS_DOUBLE +#define _DARWIN_FEATURE_LONG_DOUBLE_IS_DOUBLE 1 +#endif + +/* + * _DARWIN_FEATURE_64_ONLY_BIT_INODE indicates that the ino_t type may only + * be 64-bit; there is no support for 32-bit ino_t when this macro is defined + * (and non-zero). There is no struct stat64 either, as the regular + * struct stat will already be the 64-bit version. + */ +#if __DARWIN_ONLY_64_BIT_INO_T +#define _DARWIN_FEATURE_ONLY_64_BIT_INODE 1 +#endif + +/* + * _DARWIN_FEATURE_ONLY_VERS_1050 indicates that only those APIs updated + * in 10.5 exists; no pre-10.5 variants are available. + */ +#if __DARWIN_ONLY_VERS_1050 +#define _DARWIN_FEATURE_ONLY_VERS_1050 1 +#endif + +/* + * _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE indicates only UNIX conforming API + * are available (the legacy BSD APIs are not available) + */ +#if __DARWIN_ONLY_UNIX_CONFORMANCE +#define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1 +#endif + +/* + * _DARWIN_FEATURE_UNIX_CONFORMANCE indicates whether UNIX conformance is on, + * and specifies the conformance level (3 is SUSv3) + */ +#if __DARWIN_UNIX03 +#define _DARWIN_FEATURE_UNIX_CONFORMANCE 3 +#endif + +/* + * This macro casts away the qualifier from the variable + * + * Note: use at your own risk, removing qualifiers can result in + * catastrophic run-time failures. + */ +#ifndef __CAST_AWAY_QUALIFIER +#define __CAST_AWAY_QUALIFIER(variable, qualifier, type) (type) ((char *)0 + ((qualifier char *)(variable) - (qualifier char *)0) ) +#endif + +#endif /* !_CDEFS_H_ */ diff --git a/i386/include/sys/.svn/text-base/disk.h.svn-base b/i386/include/sys/.svn/text-base/disk.h.svn-base new file mode 100644 index 0000000..bd61eb6 --- /dev/null +++ b/i386/include/sys/.svn/text-base/disk.h.svn-base @@ -0,0 +1,139 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _SYS_DISK_H_ +#define _SYS_DISK_H_ + +#include <stdint.h> +//#include <sys/ioctl.h> + +/* + * Definitions + * + * ioctl description + * ------------------------------------- --------------------------------------- + * DKIOCEJECT eject media + * DKIOCSYNCHRONIZECACHE flush media + * + * DKIOCFORMAT format media + * DKIOCGETFORMATCAPACITIES get media's formattable capacities + * + * DKIOCGETBLOCKSIZE get media's block size + * DKIOCGETBLOCKCOUNT get media's block count + * DKIOCGETFIRMWAREPATH get media's firmware path + * + * DKIOCISFORMATTED is media formatted? + * DKIOCISWRITABLE is media writable? + * + * DKIOCREQUESTIDLE idle media + * DKIOCDISCARD delete unused data + * + * DKIOCGETMAXBLOCKCOUNTREAD get maximum block count for reads + * DKIOCGETMAXBLOCKCOUNTWRITE get maximum block count for writes + * DKIOCGETMAXBYTECOUNTREAD get maximum byte count for reads + * DKIOCGETMAXBYTECOUNTWRITE get maximum byte count for writes + * + * DKIOCGETMAXSEGMENTCOUNTREAD get maximum segment count for reads + * DKIOCGETMAXSEGMENTCOUNTWRITE get maximum segment count for writes + * DKIOCGETMAXSEGMENTBYTECOUNTREAD get maximum segment byte count for reads + * DKIOCGETMAXSEGMENTBYTECOUNTWRITE get maximum segment byte count for writes + * + * DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT get minimum segment alignment in bytes + * DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT get maximum segment width in bits + * + * DKIOCGETPHYSICALBLOCKSIZE get device's block size + * DKIOCGETCOMMANDPOOLSIZE get device's queue depth + */ + +typedef struct +{ + uint64_t offset; + uint64_t length; + + uint8_t reserved0128[16]; /* reserved, clear to zero */ +} dk_discard_t; + +typedef struct +{ + char path[128]; +} dk_firmware_path_t; + +typedef struct +{ + uint64_t blockCount; + uint32_t blockSize; + + uint8_t reserved0096[4]; /* reserved, clear to zero */ +} dk_format_capacity_t; + +typedef struct +{ + dk_format_capacity_t * capacities; + uint32_t capacitiesCount; /* use zero to probe count */ + +#ifdef __LP64__ + uint8_t reserved0096[4]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0064[8]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ +} dk_format_capacities_t; + +#define DKIOCEJECT _IO('d', 21) +#define DKIOCSYNCHRONIZECACHE _IO('d', 22) + +#define DKIOCFORMAT _IOW('d', 26, dk_format_capacity_t) +#define DKIOCGETFORMATCAPACITIES _IOWR('d', 26, dk_format_capacities_t) + +#define DKIOCGETBLOCKSIZE _IOR('d', 24, uint32_t) +#define DKIOCGETBLOCKCOUNT _IOR('d', 25, uint64_t) +#define DKIOCGETFIRMWAREPATH _IOR('d', 28, dk_firmware_path_t) + +#define DKIOCISFORMATTED _IOR('d', 23, uint32_t) +#define DKIOCISWRITABLE _IOR('d', 29, uint32_t) + +#define DKIOCREQUESTIDLE _IO('d', 30) +#define DKIOCDISCARD _IOW('d', 31, dk_discard_t) + +#define DKIOCGETMAXBLOCKCOUNTREAD _IOR('d', 64, uint64_t) +#define DKIOCGETMAXBLOCKCOUNTWRITE _IOR('d', 65, uint64_t) +#define DKIOCGETMAXBYTECOUNTREAD _IOR('d', 70, uint64_t) +#define DKIOCGETMAXBYTECOUNTWRITE _IOR('d', 71, uint64_t) + +#define DKIOCGETMAXSEGMENTCOUNTREAD _IOR('d', 66, uint64_t) +#define DKIOCGETMAXSEGMENTCOUNTWRITE _IOR('d', 67, uint64_t) +#define DKIOCGETMAXSEGMENTBYTECOUNTREAD _IOR('d', 68, uint64_t) +#define DKIOCGETMAXSEGMENTBYTECOUNTWRITE _IOR('d', 69, uint64_t) + +#define DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT _IOR('d', 74, uint64_t) +#define DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT _IOR('d', 75, uint64_t) + +#define DKIOCGETPHYSICALBLOCKSIZE _IOR('d', 77, uint32_t) +#define DKIOCGETCOMMANDPOOLSIZE _IOR('d', 78, uint32_t) + + +#endif /* _SYS_DISK_H_ */ diff --git a/i386/include/sys/.svn/text-base/kernel_types.h.svn-base b/i386/include/sys/.svn/text-base/kernel_types.h.svn-base new file mode 100644 index 0000000..7d7d709 --- /dev/null +++ b/i386/include/sys/.svn/text-base/kernel_types.h.svn-base @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2004-2010 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _KERN_SYS_KERNELTYPES_H_ +#define _KERN_SYS_KERNELTYPES_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <stdint.h> + +#ifdef BSD_BUILD +/* Macros(?) to clear/set/test flags. */ +#define SET(t, f) (t) |= (f) +#define CLR(t, f) (t) &= ~(f) +#define ISSET(t, f) ((t) & (f)) +#endif + + +typedef int errno_t; +typedef int64_t daddr64_t; + +#ifndef BSD_BUILD +struct buf; +typedef struct buf * buf_t; + +struct file; +typedef struct file * file_t; + +#ifndef __LP64__ +struct ucred; +typedef struct ucred * ucred_t; +#endif + +struct mount; +typedef struct mount * mount_t; + +struct vnode; +typedef struct vnode * vnode_t; + +struct proc; +typedef struct proc * proc_t; + +struct uio; +typedef struct uio * uio_t; + +struct vfs_context; +typedef struct vfs_context * vfs_context_t; + +struct vfstable; +typedef struct vfstable * vfstable_t; + +struct __ifnet; +struct __mbuf; +struct __pkthdr; +struct __socket; +struct __sockopt; +struct __ifaddr; +struct __ifmultiaddr; +struct __ifnet_filter; +struct __rtentry; +struct __if_clone; + +typedef struct __ifnet* ifnet_t; +typedef struct __mbuf* mbuf_t; +typedef struct __pkthdr* pkthdr_t; +typedef struct __socket* socket_t; +typedef struct __sockopt* sockopt_t; +typedef struct __ifaddr* ifaddr_t; +typedef struct __ifmultiaddr* ifmultiaddr_t; +typedef struct __ifnet_filter* interface_filter_t; +typedef struct __rtentry* route_t; +typedef struct __if_clone* if_clone_t; + +#else /* BSD_BUILD */ + +typedef struct buf * buf_t; +typedef struct file * file_t; +#ifndef __LP64__ +typedef struct ucred * ucred_t; +#endif +typedef struct mount * mount_t; +typedef struct vnode * vnode_t; +typedef struct proc * proc_t; +typedef struct uio * uio_t; +typedef struct user_iovec * user_iovec_t; +typedef struct vfs_context * vfs_context_t; +typedef struct vfstable * vfstable_t; + + +#endif /* !BSD_BUILD */ + +#ifndef _KAUTH_GUID +#define _KAUTH_GUID +/* Apple-style globally unique identifier */ +typedef struct { +#define KAUTH_GUID_SIZE 16 /* 128-bit identifier */ + unsigned char g_guid[KAUTH_GUID_SIZE]; +} guid_t; +#define _GUID_T +#endif /* _KAUTH_GUID */ + +#ifndef _KAUTH_ACE +#define _KAUTH_ACE +struct kauth_ace; +typedef struct kauth_ace * kauth_ace_t; +#endif +#ifndef _KAUTH_ACL +#define _KAUTH_ACL +struct kauth_acl; +typedef struct kauth_acl * kauth_acl_t; +#endif +#ifndef _KAUTH_FILESEC +#define _KAUTH_FILESEC +struct kauth_filesec; +typedef struct kauth_filesec * kauth_filesec_t; +#endif + +#endif /* !_KERN_SYS_KERNELTYPES_H_ */ diff --git a/i386/include/sys/.svn/text-base/param.h.svn-base b/i386/include/sys/.svn/text-base/param.h.svn-base new file mode 100644 index 0000000..395fdf5 --- /dev/null +++ b/i386/include/sys/.svn/text-base/param.h.svn-base @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */ +/*- + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)param.h 8.3 (Berkeley) 4/4/95 + */ + +#ifndef _SYS_PARAM_H_ +#define _SYS_PARAM_H_ + +#define BSD 199506 /* System version (year & month). */ +#define BSD4_3 1 +#define BSD4_4 1 + +#define NeXTBSD 1995064 /* NeXTBSD version (year, month, release) */ +#define NeXTBSD4_0 0 /* NeXTBSD 4.0 */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#ifndef LOCORE +#include <sys/types.h> +#endif + +/* + * Machine-independent constants (some used in following include files). + * Redefined constants are from POSIX 1003.1 limits file. + * + * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>) + * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>) + */ +#include <sys/syslimits.h> + +#define MAXCOMLEN 16 /* max command name remembered */ +#define MAXINTERP 64 /* max interpreter file name length */ +#define MAXLOGNAME 255 /* max login name length */ +#define MAXUPRC CHILD_MAX /* max simultaneous processes */ +#define NCARGS ARG_MAX /* max bytes for an exec function */ +#define NGROUPS NGROUPS_MAX /* max number groups */ +#define NOFILE 256 /* default max open files per process */ +#define NOGROUP 65535 /* marker for empty group set member */ +#define MAXHOSTNAMELEN 256 /* max hostname size */ +#define MAXDOMNAMELEN 256 /* maximum domain name length */ + +/* Machine type dependent parameters. */ +#include <i386/param.h> + +/* More types and definitions used throughout the kernel. */ +#include <limits.h> + +/* + * Priorities. Note that with 32 run queues, differences less than 4 are + * insignificant. + */ +#define PSWP 0 +#define PVM 4 +#define PINOD 8 +#define PRIBIO 16 +#define PVFS 20 +#define PZERO 22 /* No longer magic, shouldn't be here. XXX */ +#define PSOCK 24 +#define PWAIT 32 +#define PLOCK 36 +#define PPAUSE 40 +#define PUSER 50 +#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */ + +#define PRIMASK 0x0ff +#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ +#define PTTYBLOCK 0x200 /* for tty SIGTTOU and SIGTTIN blocking */ +#define PDROP 0x400 /* OR'd with pri to stop re-aquistion of mutex upon wakeup */ +#define PSPIN 0x800 /* OR'd with pri to require mutex in spin mode upon wakeup */ + +#define NBPW sizeof(int) /* number of bytes per word (integer) */ + +#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ +#define NODEV (dev_t)(-1) /* non-existent device */ + +/* + * Clustering of hardware pages on machines with ridiculously small + * page sizes is done here. The paging subsystem deals with units of + * CLSIZE pte's describing NBPG (from machine/param.h) pages each. + */ +#define CLBYTES (CLSIZE*NBPG) +#define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ +#define claligned(x) ((((int)(x))&CLOFSET)==0) +#define CLOFF CLOFSET +#define CLSHIFT (PGSHIFT+CLSIZELOG2) + +#if CLSIZE==1 +#define clbase(i) (i) +#define clrnd(i) (i) +#else +/* Give the base virtual address (first of CLSIZE). */ +#define clbase(i) ((i) &~ (CLSIZE-1)) +/* Round a number of clicks up to a whole cluster. */ +#define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) +#endif + +#define CBLOCK 64 /* Clist block size, must be a power of 2. */ +#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ + /* Data chars/clist. */ +#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) +#define CROUND (CBLOCK - 1) /* Clist rounding. */ + +/* + * File system parameters and macros. + * + * The file system is made out of blocks of at most MAXPHYS units, with + * smaller units (fragments) only in the last direct block. MAXBSIZE + * primarily determines the size of buffers in the buffer pool. It may be + * made larger than MAXPHYS without any effect on existing file systems; + * however making it smaller may make some file systems unmountable. + * We set this to track the value of (MAX_UPL_TRANSFER*PAGE_SIZE) from + * osfmk/mach/memory_object_types.h to bound it at the maximum UPL size. + */ +#define MAXBSIZE (256 * 4096) +#define MAXPHYSIO MAXPHYS +#define MAXFRAG 8 + +#define MAXPHYSIO_WIRED (16 * 1024 * 1024) + +/* + * MAXPATHLEN defines the longest permissable path length after expanding + * symbolic links. It is used to allocate a temporary buffer from the buffer + * pool in which to do the name expansion, hence should be a power of two, + * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the + * maximum number of symbolic links that may be expanded in a path name. + * It should be set high enough to allow all legitimate uses, but halt + * infinite loops reasonably quickly. + */ +#define MAXPATHLEN PATH_MAX +#define MAXSYMLINKS 32 + +/* Bit map related macros. */ +#define setbit(a,i) (((char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a,i) (((char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a,i) (((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a,i) ((((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0) + +/* Macros for counting and rounding. */ +#ifndef howmany +#define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) +#endif +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#define powerof2(x) ((((x)-1)&(x))==0) + +/* Macros for min/max. */ +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif /* MIN */ +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif /* MAX */ + +/* + * Constants for setting the parameters of the kernel memory allocator. + * + * 2 ** MINBUCKET is the smallest unit of memory that will be + * allocated. It must be at least large enough to hold a pointer. + * + * Units of memory less or equal to MAXALLOCSAVE will permanently + * allocate physical memory; requests for these size pieces of + * memory are quite fast. Allocations greater than MAXALLOCSAVE must + * always allocate and free physical memory; requests for these + * size allocations should be done infrequently as they will be slow. + * + * Constraints: CLBYTES <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and + * MAXALLOCSIZE must be a power of two. + */ +#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */ +#define MAXALLOCSAVE (2 * CLBYTES) + +/* + * Scale factor for scaled integers used to count %cpu time and load avgs. + * + * The number of CPU `tick's that map to a unique `%age' can be expressed + * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that + * can be calculated (assuming 32 bits) can be closely approximated using + * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). + * + * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', + * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. + */ +#define FSHIFT 11 /* bits to right of fixed binary point */ +#define FSCALE (1<<FSHIFT) + +#endif /* _SYS_PARAM_H_ */ diff --git a/i386/include/sys/.svn/text-base/reboot.h.svn-base b/i386/include/sys/.svn/text-base/reboot.h.svn-base new file mode 100644 index 0000000..147a209 --- /dev/null +++ b/i386/include/sys/.svn/text-base/reboot.h.svn-base @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1988, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)reboot.h 8.3 (Berkeley) 12/13/94 + */ + +#ifndef _SYS_REBOOT_H_ +#define _SYS_REBOOT_H_ + +/* + * Arguments to reboot system call. + */ + +#ifdef __APPLE_API_PRIVATE +#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ + +#define RB_ASKNAME 0x01 /* ask for file name to reboot from */ +#define RB_SINGLE 0x02 /* reboot to single user only */ +#define RB_NOSYNC 0x04 /* dont sync before reboot */ +#define RB_HALT 0x08 /* don't reboot, just halt */ +#define RB_INITNAME 0x10 /* name given for /etc/init */ +#define RB_DFLTROOT 0x20 /* use compiled-in rootdev */ +#define RB_ALTBOOT 0x40 /* use /boot.old vs /boot */ +#define RB_UNIPROC 0x80 /* don't start slaves */ +#define RB_SAFEBOOT 0x100 /* booting safe */ +#define RB_UPSDELAY 0x200 /* Delays restart by 5 minutes */ +#define RB_QUICK 0x400 /* quick and ungraceful reboot with file system caches flushed*/ +#define RB_PANIC 0 /* reboot due to panic */ +#define RB_BOOT 1 /* reboot due to boot() */ + +#endif /* __APPLE_API_PRIVATE */ + +#ifdef __APPLE_API_OBSOLETE +/* + * Constants for converting boot-style device number to type, + * adaptor (uba, mba, etc), unit number and partition number. + * Type (== major device number) is in the low byte + * for backward compatibility. Except for that of the "magic + * number", each mask applies to the shifted value. + * Format: + * (4) (4) (4) (4) (8) (8) + * -------------------------------- + * |MA | AD| CT| UN| PART | TYPE | + * -------------------------------- + */ +#define B_ADAPTORSHIFT 24 +#define B_ADAPTORMASK 0x0f +#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK) +#define B_CONTROLLERSHIFT 20 +#define B_CONTROLLERMASK 0xf +#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK) +#define B_UNITSHIFT 16 +#define B_UNITMASK 0xff +#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK) +#define B_PARTITIONSHIFT 8 +#define B_PARTITIONMASK 0xff +#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK) +#define B_TYPESHIFT 0 +#define B_TYPEMASK 0xff +#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK) +#define B_MAGICMASK 0xf0000000 +#define B_DEVMAGIC 0xa0000000 + +#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \ + (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \ + ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \ + ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC) + +#endif /* __APPLE_API_OBSOLETE */ + + +#endif /* _SYS_REBOOT_H_ */ diff --git a/i386/include/sys/.svn/text-base/select.h.svn-base b/i386/include/sys/.svn/text-base/select.h.svn-base new file mode 100644 index 0000000..49a4572 --- /dev/null +++ b/i386/include/sys/.svn/text-base/select.h.svn-base @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)select.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _SYS_SELECT_H_ +#define _SYS_SELECT_H_ + +#include <sys/appleapiopts.h> +#include <sys/cdefs.h> +#include <sys/_types.h> + +/* + * [XSI] The <sys/select.h> header shall define the fd_set type as a structure. + * The timespec structure shall be defined as described in <time.h> + * The <sys/select.h> header shall define the timeval structure. + */ +#define __need_fd_set +#define __need_struct_timespec +#define __need_struct_timeval +#include <sys/_structs.h> + +/* + * The time_t and suseconds_t types shall be defined as described in + * <sys/types.h> + * The sigset_t type shall be defined as described in <signal.h> + */ +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + +#ifndef _SUSECONDS_T +#define _SUSECONDS_T +typedef __darwin_suseconds_t suseconds_t; +#endif + +#ifndef _SIGSET_T +#define _SIGSET_T +typedef __darwin_sigset_t sigset_t; +#endif + +/* + * [XSI] FD_CLR, FD_ISSET, FD_SET, FD_ZERO may be declared as a function, or + * defined as a macro, or both + * [XSI] FD_SETSIZE shall be defined as a macro + */ + +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE __DARWIN_FD_SETSIZE +#endif /* FD_SETSIZE */ +#ifndef FD_SET +#define FD_SET(n, p) __DARWIN_FD_SET(n, p) +#endif /* FD_SET */ +#ifndef FD_CLR +#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p) +#endif /* FD_CLR */ +#ifndef FD_ISSET +#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) +#endif /* FD_ISSET */ +#ifndef FD_ZERO +#define FD_ZERO(p) __DARWIN_FD_ZERO(p) +#endif /* FD_ZERO */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef FD_COPY +#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) +#endif /* FD_COPY */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +__BEGIN_DECLS + +#ifndef __MWERKS__ +int pselect(int, fd_set * __restrict, fd_set * __restrict, + fd_set * __restrict, const struct timespec * __restrict, + const sigset_t * __restrict) +#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) + __DARWIN_EXTSN_C(pselect) +#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ +# if defined(__LP64__) && !__DARWIN_NON_CANCELABLE + __DARWIN_1050(pselect) +# else /* !__LP64__ || __DARWIN_NON_CANCELABLE */ + __DARWIN_ALIAS_C(pselect) +# endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */ +#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */ + ; +#endif /* __MWERKS__ */ + +#include <sys/_select.h> /* select() prototype */ + +__END_DECLS + + +#endif /* !_SYS_SELECT_H_ */ diff --git a/i386/include/sys/.svn/text-base/socket.h.svn-base b/i386/include/sys/.svn/text-base/socket.h.svn-base new file mode 100644 index 0000000..a19105a --- /dev/null +++ b/i386/include/sys/.svn/text-base/socket.h.svn-base @@ -0,0 +1,629 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1998, 1999 Apple Computer, Inc. All Rights Reserved */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)socket.h 8.4 (Berkeley) 2/21/94 + * $FreeBSD: src/sys/sys/socket.h,v 1.39.2.7 2001/07/03 11:02:01 ume Exp $ + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _SYS_SOCKET_H_ +#define _SYS_SOCKET_H_ + +#include <sys/types.h> +#include <sys/cdefs.h> +#include <machine/_param.h> + +/* + * Definitions related to sockets: types, address families, options. + */ + +/* + * Data types. + */ +#ifndef _GID_T +typedef __darwin_gid_t gid_t; +#define _GID_T +#endif + +#ifndef _OFF_T +typedef __darwin_off_t off_t; +#define _OFF_T +#endif + +#ifndef _PID_T +typedef __darwin_pid_t pid_t; +#define _PID_T +#endif + +#ifndef _SA_FAMILY_T +#define _SA_FAMILY_T +typedef __uint8_t sa_family_t; +#endif + +#ifndef _SOCKLEN_T +#define _SOCKLEN_T +typedef __darwin_socklen_t socklen_t; +#endif + +/* XXX Not explicitly defined by POSIX, but function return types are */ +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +/* XXX Not explicitly defined by POSIX, but function return types are */ +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif + +/* + * [XSI] The iovec structure shall be defined as described in <sys/uio.h>. + */ +#ifndef _STRUCT_IOVEC +#define _STRUCT_IOVEC +struct iovec { + void * iov_base; /* [XSI] Base address of I/O memory region */ + size_t iov_len; /* [XSI] Size of region iov_base points to */ +}; +#endif + +/* + * Types + */ +#define SOCK_STREAM 1 /* stream socket */ +#define SOCK_DGRAM 2 /* datagram socket */ +#define SOCK_RAW 3 /* raw-protocol interface */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SOCK_RDM 4 /* reliably-delivered message */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define SOCK_SEQPACKET 5 /* sequenced packet stream */ + +/* + * Option flags per-socket. + */ +#define SO_DEBUG 0x0001 /* turn on debugging info recording */ +#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ +#define SO_REUSEADDR 0x0004 /* allow local address reuse */ +#define SO_KEEPALIVE 0x0008 /* keep connections alive */ +#define SO_DONTROUTE 0x0010 /* just use interface addresses */ +#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ +#define SO_LINGER 0x0080 /* linger on close if data present (in ticks) */ +#else +#define SO_LINGER 0x1080 /* linger on close if data present (in seconds) */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ +#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ +#ifndef __APPLE__ +#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ +#else +#define SO_DONTTRUNC 0x2000 /* APPLE: Retain unread data */ + /* (ATOMIC proto) */ +#define SO_WANTMORE 0x4000 /* APPLE: Give hint when more data ready */ +#define SO_WANTOOBFLAG 0x8000 /* APPLE: Want OOB in MSG_FLAG on receive */ +#endif +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Additional options, not kept in so_options. + */ +#define SO_SNDBUF 0x1001 /* send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define SO_SNDTIMEO 0x1005 /* send timeout */ +#define SO_RCVTIMEO 0x1006 /* receive timeout */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/*efine SO_PRIVSTATE 0x1009 get/deny privileged state */ +#ifdef __APPLE__ +#define SO_NREAD 0x1020 /* APPLE: get 1st-packet byte count */ +#define SO_NKE 0x1021 /* APPLE: Install socket-level NKE */ +#define SO_NOSIGPIPE 0x1022 /* APPLE: No SIGPIPE on EPIPE */ +#define SO_NOADDRERR 0x1023 /* APPLE: Returns EADDRNOTAVAIL when src is not available anymore */ +#define SO_NWRITE 0x1024 /* APPLE: Get number of bytes currently in send socket buffer */ +#define SO_REUSESHAREUID 0x1025 /* APPLE: Allow reuse of port/socket by different userids */ +#ifdef __APPLE_API_PRIVATE +#define SO_NOTIFYCONFLICT 0x1026 /* APPLE: send notification if there is a bind on a port which is already in use */ +#define SO_UPCALLCLOSEWAIT 0x1027 /* APPLE: block on close until an upcall returns */ +#endif +#define SO_LINGER_SEC 0x1080 /* linger on close if data present (in seconds) */ +#define SO_RESTRICTIONS 0x1081 /* APPLE: deny inbound/outbound/both/flag set */ +#define SO_RESTRICT_DENYIN 0x00000001 /* flag for SO_RESTRICTIONS - deny inbound */ +#define SO_RESTRICT_DENYOUT 0x00000002 /* flag for SO_RESTRICTIONS - deny outbound */ +#define SO_RESTRICT_DENYSET 0x80000000 /* flag for SO_RESTRICTIONS - deny has been set */ +#define SO_RANDOMPORT 0x1082 /* APPLE: request local port randomization */ +#define SO_NP_EXTENSIONS 0x1083 /* To turn off some POSIX behavior */ +#endif +#define SO_LABEL 0x1010 /* socket's MAC label */ +#define SO_PEERLABEL 0x1011 /* socket's peer MAC label */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Structure used for manipulating linger option. + */ +struct linger { + int l_onoff; /* option on/off */ + int l_linger; /* linger time */ +}; + +#ifndef __APPLE__ +struct accept_filter_arg { + char af_name[16]; + char af_arg[256-16]; +}; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifdef __APPLE__ + +/* + * Structure to control non-portable Sockets extension to POSIX + */ +struct so_np_extensions { + u_int32_t npx_flags; + u_int32_t npx_mask; +}; + +#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */ + + + +#endif +#endif + +/* + * Level number for (get/set)sockopt() to apply to socket itself. + */ +#define SOL_SOCKET 0xffff /* options for socket level */ + + +/* + * Address families. + */ +#define AF_UNSPEC 0 /* unspecified */ +#define AF_UNIX 1 /* local to host (pipes) */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define AF_LOCAL AF_UNIX /* backward compatibility */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define AF_IMPLINK 3 /* arpanet imp addresses */ +#define AF_PUP 4 /* pup protocols: e.g. BSP */ +#define AF_CHAOS 5 /* mit CHAOS protocols */ +#define AF_NS 6 /* XEROX NS protocols */ +#define AF_ISO 7 /* ISO protocols */ +#define AF_OSI AF_ISO +#define AF_ECMA 8 /* European computer manufacturers */ +#define AF_DATAKIT 9 /* datakit protocols */ +#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ +#define AF_SNA 11 /* IBM SNA */ +#define AF_DECnet 12 /* DECnet */ +#define AF_DLI 13 /* DEC Direct data link interface */ +#define AF_LAT 14 /* LAT */ +#define AF_HYLINK 15 /* NSC Hyperchannel */ +#define AF_APPLETALK 16 /* Apple Talk */ +#define AF_ROUTE 17 /* Internal Routing Protocol */ +#define AF_LINK 18 /* Link layer interface */ +#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ +#define AF_COIP 20 /* connection-oriented IP, aka ST II */ +#define AF_CNT 21 /* Computer Network Technology */ +#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ +#define AF_IPX 23 /* Novell Internet Protocol */ +#define AF_SIP 24 /* Simple Internet Protocol */ +#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ +#ifdef __APPLE__ +/*define pseudo_AF_BLUE 26 Identify packets for Blue Box - Not used */ +#define AF_NDRV 27 /* Network Driver 'raw' access */ +#endif +#define AF_ISDN 28 /* Integrated Services Digital Network*/ +#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ +#define pseudo_AF_KEY 29 /* Internal key-management function */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define AF_INET6 30 /* IPv6 */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define AF_NATM 31 /* native ATM access */ +#ifdef __APPLE__ +#define AF_SYSTEM 32 /* Kernel event messages */ +#define AF_NETBIOS 33 /* NetBIOS */ +#define AF_PPP 34 /* PPP communication protocol */ +#else +#define AF_ATM 30 /* ATM */ +#endif +#define pseudo_AF_HDRCMPLT 35 /* Used by BPF to not rewrite headers + * in interface output routine + */ +#define AF_RESERVED_36 36 /* Reserved for internal usage */ + +#ifndef __APPLE__ +#define AF_NETGRAPH 32 /* Netgraph sockets */ +#endif +#define AF_IEEE80211 37 /* IEEE 802.11 protocol */ +#define AF_MAX 38 +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * [XSI] Structure used by kernel to store most addresses. + */ +struct sockaddr { + __uint8_t sa_len; /* total length */ + sa_family_t sa_family; /* [XSI] address family */ + char sa_data[14]; /* [XSI] addr value (actually larger) */ +}; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SOCK_MAXADDRLEN 255 /* longest possible addresses */ + +/* + * Structure used by kernel to pass protocol + * information in raw sockets. + */ +struct sockproto { + __uint16_t sp_family; /* address family */ + __uint16_t sp_protocol; /* protocol */ +}; +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE)*/ + +/* + * RFC 2553: protocol-independent placeholder for socket addresses + */ +#define _SS_MAXSIZE 128 +#define _SS_ALIGNSIZE (sizeof(__int64_t)) +#define _SS_PAD1SIZE \ + (_SS_ALIGNSIZE - sizeof(__uint8_t) - sizeof(sa_family_t)) +#define _SS_PAD2SIZE \ + (_SS_MAXSIZE - sizeof(__uint8_t) - sizeof(sa_family_t) - \ + _SS_PAD1SIZE - _SS_ALIGNSIZE) + +/* + * [XSI] sockaddr_storage + */ +struct sockaddr_storage { + __uint8_t ss_len; /* address length */ + sa_family_t ss_family; /* [XSI] address family */ + char __ss_pad1[_SS_PAD1SIZE]; + __int64_t __ss_align; /* force structure storage alignment */ + char __ss_pad2[_SS_PAD2SIZE]; +}; + +/* + * Protocol families, same as address families for now. + */ +#define PF_UNSPEC AF_UNSPEC +#define PF_LOCAL AF_LOCAL +#define PF_UNIX PF_LOCAL /* backward compatibility */ +#define PF_INET AF_INET +#define PF_IMPLINK AF_IMPLINK +#define PF_PUP AF_PUP +#define PF_CHAOS AF_CHAOS +#define PF_NS AF_NS +#define PF_ISO AF_ISO +#define PF_OSI AF_ISO +#define PF_ECMA AF_ECMA +#define PF_DATAKIT AF_DATAKIT +#define PF_CCITT AF_CCITT +#define PF_SNA AF_SNA +#define PF_DECnet AF_DECnet +#define PF_DLI AF_DLI +#define PF_LAT AF_LAT +#define PF_HYLINK AF_HYLINK +#define PF_APPLETALK AF_APPLETALK +#define PF_ROUTE AF_ROUTE +#define PF_LINK AF_LINK +#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ +#define PF_COIP AF_COIP +#define PF_CNT AF_CNT +#define PF_SIP AF_SIP +#define PF_IPX AF_IPX /* same format as AF_NS */ +#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ +#define PF_PIP pseudo_AF_PIP +#ifdef __APPLE__ +#define PF_NDRV AF_NDRV +#endif +#define PF_ISDN AF_ISDN +#define PF_KEY pseudo_AF_KEY +#define PF_INET6 AF_INET6 +#define PF_NATM AF_NATM +#ifdef __APPLE__ +#define PF_SYSTEM AF_SYSTEM +#define PF_NETBIOS AF_NETBIOS +#define PF_PPP AF_PPP +#define PF_RESERVED_36 AF_RESERVED_36 + +#else +#define PF_ATM AF_ATM +#define PF_NETGRAPH AF_NETGRAPH +#endif + +#define PF_MAX AF_MAX + +/* + * These do not have socket-layer support: + */ +#define PF_VLAN ((uint32_t)0x766c616e) /* 'vlan' */ +#define PF_BOND ((uint32_t)0x626f6e64) /* 'bond' */ + +/* + * Definitions for network related sysctl, CTL_NET. + * + * Second level is protocol family. + * Third level is protocol number. + * + * Further levels are defined by the individual families below. + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define NET_MAXID AF_MAX +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * PF_ROUTE - Routing table + * + * Three additional levels are defined: + * Fourth: address family, 0 is wildcard + * Fifth: type of info, defined below + * Sixth: flag(s) to mask with for NET_RT_FLAGS + */ +#define NET_RT_DUMP 1 /* dump; may limit to a.f. */ +#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ +#define NET_RT_IFLIST 3 /* survey interface list */ +#define NET_RT_STAT 4 /* routing statistics */ +#define NET_RT_TRASH 5 /* routes not in table but not freed */ +#define NET_RT_IFLIST2 6 /* interface list with addresses */ +#define NET_RT_DUMP2 7 /* dump; may limit to a.f. */ +#define NET_RT_MAXID 8 +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + + +/* + * Maximum queue length specifiable by listen. + */ +#define SOMAXCONN 128 + +/* + * [XSI] Message header for recvmsg and sendmsg calls. + * Used value-result for recvmsg, value only for sendmsg. + */ +struct msghdr { + void *msg_name; /* [XSI] optional address */ + socklen_t msg_namelen; /* [XSI] size of address */ + struct iovec *msg_iov; /* [XSI] scatter/gather array */ + int msg_iovlen; /* [XSI] # elements in msg_iov */ + void *msg_control; /* [XSI] ancillary data, see below */ + socklen_t msg_controllen; /* [XSI] ancillary data buffer len */ + int msg_flags; /* [XSI] flags on received message */ +}; + + +#define MSG_OOB 0x1 /* process out-of-band data */ +#define MSG_PEEK 0x2 /* peek at incoming message */ +#define MSG_DONTROUTE 0x4 /* send without using routing tables */ +#define MSG_EOR 0x8 /* data completes record */ +#define MSG_TRUNC 0x10 /* data discarded before delivery */ +#define MSG_CTRUNC 0x20 /* control data lost before delivery */ +#define MSG_WAITALL 0x40 /* wait for full request or error */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ +#define MSG_EOF 0x100 /* data completes connection */ +#ifdef __APPLE__ +#define MSG_WAITSTREAM 0x200 /* wait up to full request.. may return partial */ +#define MSG_FLUSH 0x400 /* Start of 'hold' seq; dump so_temp */ +#define MSG_HOLD 0x800 /* Hold frag in so_temp */ +#define MSG_SEND 0x1000 /* Send the packet in so_temp */ +#define MSG_HAVEMORE 0x2000 /* Data ready to be read */ +#define MSG_RCVMORE 0x4000 /* Data remains in current pkt */ +#endif +#define MSG_NEEDSA 0x10000 /* Fail receive if socket address cannot be allocated */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Header for ancillary data objects in msg_control buffer. + * Used for additional information with/about a datagram + * not expressible by flags. The format is a sequence + * of message elements headed by cmsghdr structures. + */ +struct cmsghdr { + socklen_t cmsg_len; /* [XSI] data byte count, including hdr */ + int cmsg_level; /* [XSI] originating protocol */ + int cmsg_type; /* [XSI] protocol-specific type */ +/* followed by unsigned char cmsg_data[]; */ +}; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef __APPLE__ +/* + * While we may have more groups than this, the cmsgcred struct must + * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow + * this. +*/ +#define CMGROUP_MAX 16 + +/* + * Credentials structure, used to verify the identity of a peer + * process that has sent us a message. This is allocated by the + * peer process but filled in by the kernel. This prevents the + * peer from lying about its identity. (Note that cmcred_groups[0] + * is the effective GID.) + */ +struct cmsgcred { + pid_t cmcred_pid; /* PID of sending process */ + uid_t cmcred_uid; /* real UID of sending process */ + uid_t cmcred_euid; /* effective UID of sending process */ + gid_t cmcred_gid; /* real GID of sending process */ + short cmcred_ngroups; /* number or groups */ + gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ +}; +#endif +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* given pointer to struct cmsghdr, return pointer to data */ +#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ + __DARWIN_ALIGN32(sizeof(struct cmsghdr))) + +/* + * RFC 2292 requires to check msg_controllen, in case that the kernel returns + * an empty list for some reasons. + */ +#define CMSG_FIRSTHDR(mhdr) \ + ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ + (struct cmsghdr *)(mhdr)->msg_control : \ + (struct cmsghdr *)0L) + + +/* + * Given pointer to struct cmsghdr, return pointer to next cmsghdr + * RFC 2292 says that CMSG_NXTHDR(mhdr, NULL) is equivalent to CMSG_FIRSTHDR(mhdr) + */ +#define CMSG_NXTHDR(mhdr, cmsg) \ + ((char *)(cmsg) == (char *)0L ? CMSG_FIRSTHDR(mhdr) : \ + ((((unsigned char *)(cmsg) + \ + __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len) + \ + __DARWIN_ALIGN32(sizeof(struct cmsghdr))) > \ + ((unsigned char *)(mhdr)->msg_control + \ + (mhdr)->msg_controllen)) ? \ + (struct cmsghdr *)0L /* NULL */ : \ + (struct cmsghdr *)((unsigned char *)(cmsg) + \ + __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len)))) + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* RFC 2292 additions */ +#define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l)) +#define CMSG_LEN(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l)) + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* "Socket"-level control message types: */ +#define SCM_RIGHTS 0x01 /* access rights (array of int) */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ +#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * howto arguments for shutdown(2), specified by Posix.1g. + */ +#define SHUT_RD 0 /* shut down the reading side */ +#define SHUT_WR 1 /* shut down the writing side */ +#define SHUT_RDWR 2 /* shut down both sides */ + +#if !defined(_POSIX_C_SOURCE) +/* + * sendfile(2) header/trailer struct + */ +struct sf_hdtr { + struct iovec *headers; /* pointer to an array of header struct iovec's */ + int hdr_cnt; /* number of header iovec's */ + struct iovec *trailers; /* pointer to an array of trailer struct iovec's */ + int trl_cnt; /* number of trailer iovec's */ +}; + + +#endif /* !_POSIX_C_SOURCE */ + +__BEGIN_DECLS +int accept(int, struct sockaddr * __restrict, socklen_t * __restrict) + __DARWIN_ALIAS_C(accept); +int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind); +int connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C( connect); +int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict) + __DARWIN_ALIAS(getpeername); +int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict) + __DARWIN_ALIAS(getsockname); +int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); +int listen(int, int) __DARWIN_ALIAS(listen); +ssize_t recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv); +ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, + socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom); +ssize_t recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg); +ssize_t send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send); +ssize_t sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg); +ssize_t sendto(int, const void *, size_t, + int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto); +int setsockopt(int, int, int, const void *, socklen_t); +int shutdown(int, int); +int sockatmark(int); +int socket(int, int, int); +int socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair); + +#if !defined(_POSIX_C_SOURCE) +int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int); +#endif /* !_POSIX_C_SOURCE */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void pfctlinput(int, struct sockaddr *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + + + +#endif /* !_SYS_SOCKET_H_ */ diff --git a/i386/include/sys/.svn/text-base/syscall.h.svn-base b/i386/include/sys/.svn/text-base/syscall.h.svn-base new file mode 100644 index 0000000..1f5aeb7 --- /dev/null +++ b/i386/include/sys/.svn/text-base/syscall.h.svn-base @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2004-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + * + * + * System call switch table. + * + * DO NOT EDIT-- this file is automatically generated. + * created from /SourceCache/xnu/xnu-1504.7.4/bsd/kern/syscalls.master + */ + +#ifndef _SYS_SYSCALL_H_ +#define _SYS_SYSCALL_H_ + +#include <sys/appleapiopts.h> +#ifdef __APPLE_API_PRIVATE +#define SYS_syscall 0 +#define SYS_exit 1 +#define SYS_fork 2 +#define SYS_read 3 +#define SYS_write 4 +#define SYS_open 5 +#define SYS_close 6 +#define SYS_wait4 7 + /* 8 old creat */ +#define SYS_link 9 +#define SYS_unlink 10 + /* 11 old execv */ +#define SYS_chdir 12 +#define SYS_fchdir 13 +#define SYS_mknod 14 +#define SYS_chmod 15 +#define SYS_chown 16 + /* 17 old break */ +#define SYS_getfsstat 18 + /* 19 old lseek */ +#define SYS_getpid 20 + /* 21 old mount */ + /* 22 old umount */ +#define SYS_setuid 23 +#define SYS_getuid 24 +#define SYS_geteuid 25 +#define SYS_ptrace 26 +#define SYS_recvmsg 27 +#define SYS_sendmsg 28 +#define SYS_recvfrom 29 +#define SYS_accept 30 +#define SYS_getpeername 31 +#define SYS_getsockname 32 +#define SYS_access 33 +#define SYS_chflags 34 +#define SYS_fchflags 35 +#define SYS_sync 36 +#define SYS_kill 37 + /* 38 old stat */ +#define SYS_getppid 39 + /* 40 old lstat */ +#define SYS_dup 41 +#define SYS_pipe 42 +#define SYS_getegid 43 +#define SYS_profil 44 + /* 45 old ktrace */ +#define SYS_sigaction 46 +#define SYS_getgid 47 +#define SYS_sigprocmask 48 +#define SYS_getlogin 49 +#define SYS_setlogin 50 +#define SYS_acct 51 +#define SYS_sigpending 52 +#define SYS_sigaltstack 53 +#define SYS_ioctl 54 +#define SYS_reboot 55 +#define SYS_revoke 56 +#define SYS_symlink 57 +#define SYS_readlink 58 +#define SYS_execve 59 +#define SYS_umask 60 +#define SYS_chroot 61 + /* 62 old fstat */ + /* 63 used internally , reserved */ + /* 64 old getpagesize */ +#define SYS_msync 65 +#define SYS_vfork 66 + /* 67 old vread */ + /* 68 old vwrite */ + /* 69 old sbrk */ + /* 70 old sstk */ + /* 71 old mmap */ + /* 72 old vadvise */ +#define SYS_munmap 73 +#define SYS_mprotect 74 +#define SYS_madvise 75 + /* 76 old vhangup */ + /* 77 old vlimit */ +#define SYS_mincore 78 +#define SYS_getgroups 79 +#define SYS_setgroups 80 +#define SYS_getpgrp 81 +#define SYS_setpgid 82 +#define SYS_setitimer 83 + /* 84 old wait */ +#define SYS_swapon 85 +#define SYS_getitimer 86 + /* 87 old gethostname */ + /* 88 old sethostname */ +#define SYS_getdtablesize 89 +#define SYS_dup2 90 + /* 91 old getdopt */ +#define SYS_fcntl 92 +#define SYS_select 93 + /* 94 old setdopt */ +#define SYS_fsync 95 +#define SYS_setpriority 96 +#define SYS_socket 97 +#define SYS_connect 98 + /* 99 old accept */ +#define SYS_getpriority 100 + /* 101 old send */ + /* 102 old recv */ + /* 103 old sigreturn */ +#define SYS_bind 104 +#define SYS_setsockopt 105 +#define SYS_listen 106 + /* 107 old vtimes */ + /* 108 old sigvec */ + /* 109 old sigblock */ + /* 110 old sigsetmask */ +#define SYS_sigsuspend 111 + /* 112 old sigstack */ + /* 113 old recvmsg */ + /* 114 old sendmsg */ + /* 115 old vtrace */ +#define SYS_gettimeofday 116 +#define SYS_getrusage 117 +#define SYS_getsockopt 118 + /* 119 old resuba */ +#define SYS_readv 120 +#define SYS_writev 121 +#define SYS_settimeofday 122 +#define SYS_fchown 123 +#define SYS_fchmod 124 + /* 125 old recvfrom */ +#define SYS_setreuid 126 +#define SYS_setregid 127 +#define SYS_rename 128 + /* 129 old truncate */ + /* 130 old ftruncate */ +#define SYS_flock 131 +#define SYS_mkfifo 132 +#define SYS_sendto 133 +#define SYS_shutdown 134 +#define SYS_socketpair 135 +#define SYS_mkdir 136 +#define SYS_rmdir 137 +#define SYS_utimes 138 +#define SYS_futimes 139 +#define SYS_adjtime 140 + /* 141 old getpeername */ +#define SYS_gethostuuid 142 + /* 143 old sethostid */ + /* 144 old getrlimit */ + /* 145 old setrlimit */ + /* 146 old killpg */ +#define SYS_setsid 147 + /* 148 old setquota */ + /* 149 old qquota */ + /* 150 old getsockname */ +#define SYS_getpgid 151 +#define SYS_setprivexec 152 +#define SYS_pread 153 +#define SYS_pwrite 154 +#define SYS_nfssvc 155 + /* 156 old getdirentries */ +#define SYS_statfs 157 +#define SYS_fstatfs 158 +#define SYS_unmount 159 + /* 160 old async_daemon */ +#define SYS_getfh 161 + /* 162 old getdomainname */ + /* 163 old setdomainname */ + /* 164 */ +#define SYS_quotactl 165 + /* 166 old exportfs */ +#define SYS_mount 167 + /* 168 old ustat */ +#define SYS_csops 169 + /* 170 old table */ + /* 171 old wait3 */ + /* 172 old rpause */ +#define SYS_waitid 173 + /* 174 old getdents */ + /* 175 old gc_control */ +#define SYS_add_profil 176 + /* 177 */ + /* 178 */ + /* 179 */ +#define SYS_kdebug_trace 180 +#define SYS_setgid 181 +#define SYS_setegid 182 +#define SYS_seteuid 183 +#define SYS_sigreturn 184 +#define SYS_chud 185 + /* 186 */ +#define SYS_fdatasync 187 +#define SYS_stat 188 +#define SYS_fstat 189 +#define SYS_lstat 190 +#define SYS_pathconf 191 +#define SYS_fpathconf 192 + /* 193 */ +#define SYS_getrlimit 194 +#define SYS_setrlimit 195 +#define SYS_getdirentries 196 +#define SYS_mmap 197 + /* 198 __syscall */ +#define SYS_lseek 199 +#define SYS_truncate 200 +#define SYS_ftruncate 201 +#define SYS___sysctl 202 +#define SYS_mlock 203 +#define SYS_munlock 204 +#define SYS_undelete 205 +#define SYS_ATsocket 206 +#define SYS_ATgetmsg 207 +#define SYS_ATputmsg 208 +#define SYS_ATPsndreq 209 +#define SYS_ATPsndrsp 210 +#define SYS_ATPgetreq 211 +#define SYS_ATPgetrsp 212 + /* 213 Reserved for AppleTalk */ + /* 214 */ + /* 215 */ +#define SYS_mkcomplex 216 +#define SYS_statv 217 +#define SYS_lstatv 218 +#define SYS_fstatv 219 +#define SYS_getattrlist 220 +#define SYS_setattrlist 221 +#define SYS_getdirentriesattr 222 +#define SYS_exchangedata 223 + /* 224 old checkuseraccess / fsgetpath ( which moved to 427 ) */ +#define SYS_searchfs 225 +#define SYS_delete 226 +#define SYS_copyfile 227 +#define SYS_fgetattrlist 228 +#define SYS_fsetattrlist 229 +#define SYS_poll 230 +#define SYS_watchevent 231 +#define SYS_waitevent 232 +#define SYS_modwatch 233 +#define SYS_getxattr 234 +#define SYS_fgetxattr 235 +#define SYS_setxattr 236 +#define SYS_fsetxattr 237 +#define SYS_removexattr 238 +#define SYS_fremovexattr 239 +#define SYS_listxattr 240 +#define SYS_flistxattr 241 +#define SYS_fsctl 242 +#define SYS_initgroups 243 +#define SYS_posix_spawn 244 +#define SYS_ffsctl 245 + /* 246 */ +#define SYS_nfsclnt 247 +#define SYS_fhopen 248 + /* 249 */ +#define SYS_minherit 250 +#define SYS_semsys 251 +#define SYS_msgsys 252 +#define SYS_shmsys 253 +#define SYS_semctl 254 +#define SYS_semget 255 +#define SYS_semop 256 + /* 257 */ +#define SYS_msgctl 258 +#define SYS_msgget 259 +#define SYS_msgsnd 260 +#define SYS_msgrcv 261 +#define SYS_shmat 262 +#define SYS_shmctl 263 +#define SYS_shmdt 264 +#define SYS_shmget 265 +#define SYS_shm_open 266 +#define SYS_shm_unlink 267 +#define SYS_sem_open 268 +#define SYS_sem_close 269 +#define SYS_sem_unlink 270 +#define SYS_sem_wait 271 +#define SYS_sem_trywait 272 +#define SYS_sem_post 273 +#define SYS_sem_getvalue 274 +#define SYS_sem_init 275 +#define SYS_sem_destroy 276 +#define SYS_open_extended 277 +#define SYS_umask_extended 278 +#define SYS_stat_extended 279 +#define SYS_lstat_extended 280 +#define SYS_fstat_extended 281 +#define SYS_chmod_extended 282 +#define SYS_fchmod_extended 283 +#define SYS_access_extended 284 +#define SYS_settid 285 +#define SYS_gettid 286 +#define SYS_setsgroups 287 +#define SYS_getsgroups 288 +#define SYS_setwgroups 289 +#define SYS_getwgroups 290 +#define SYS_mkfifo_extended 291 +#define SYS_mkdir_extended 292 +#define SYS_identitysvc 293 +#define SYS_shared_region_check_np 294 +#define SYS_shared_region_map_np 295 +#define SYS_vm_pressure_monitor 296 +#define SYS_psynch_rw_longrdlock 297 +#define SYS_psynch_rw_yieldwrlock 298 +#define SYS_psynch_rw_downgrade 299 +#define SYS_psynch_rw_upgrade 300 +#define SYS_psynch_mutexwait 301 +#define SYS_psynch_mutexdrop 302 +#define SYS_psynch_cvbroad 303 +#define SYS_psynch_cvsignal 304 +#define SYS_psynch_cvwait 305 +#define SYS_psynch_rw_rdlock 306 +#define SYS_psynch_rw_wrlock 307 +#define SYS_psynch_rw_unlock 308 +#define SYS_psynch_rw_unlock2 309 +#define SYS_getsid 310 +#define SYS_settid_with_pid 311 + /* 312 old __pthread_cond_timedwait */ +#define SYS_aio_fsync 313 +#define SYS_aio_return 314 +#define SYS_aio_suspend 315 +#define SYS_aio_cancel 316 +#define SYS_aio_error 317 +#define SYS_aio_read 318 +#define SYS_aio_write 319 +#define SYS_lio_listio 320 + /* 321 old __pthread_cond_wait */ +#define SYS_iopolicysys 322 + /* 323 */ +#define SYS_mlockall 324 +#define SYS_munlockall 325 + /* 326 */ +#define SYS_issetugid 327 +#define SYS___pthread_kill 328 +#define SYS___pthread_sigmask 329 +#define SYS___sigwait 330 +#define SYS___disable_threadsignal 331 +#define SYS___pthread_markcancel 332 +#define SYS___pthread_canceled 333 +#define SYS___semwait_signal 334 + /* 335 old utrace */ +#define SYS_proc_info 336 +#define SYS_sendfile 337 +#define SYS_stat64 338 +#define SYS_fstat64 339 +#define SYS_lstat64 340 +#define SYS_stat64_extended 341 +#define SYS_lstat64_extended 342 +#define SYS_fstat64_extended 343 +#define SYS_getdirentries64 344 +#define SYS_statfs64 345 +#define SYS_fstatfs64 346 +#define SYS_getfsstat64 347 +#define SYS___pthread_chdir 348 +#define SYS___pthread_fchdir 349 +#define SYS_audit 350 +#define SYS_auditon 351 + /* 352 */ +#define SYS_getauid 353 +#define SYS_setauid 354 +#define SYS_getaudit 355 +#define SYS_setaudit 356 +#define SYS_getaudit_addr 357 +#define SYS_setaudit_addr 358 +#define SYS_auditctl 359 +#define SYS_bsdthread_create 360 +#define SYS_bsdthread_terminate 361 +#define SYS_kqueue 362 +#define SYS_kevent 363 +#define SYS_lchown 364 +#define SYS_stack_snapshot 365 +#define SYS_bsdthread_register 366 +#define SYS_workq_open 367 +#define SYS_workq_kernreturn 368 +#define SYS_kevent64 369 +#define SYS___old_semwait_signal 370 +#define SYS___old_semwait_signal_nocancel 371 +#define SYS_thread_selfid 372 + /* 373 */ + /* 374 */ + /* 375 */ + /* 376 */ + /* 377 */ + /* 378 */ + /* 379 */ +#define SYS___mac_execve 380 +#define SYS___mac_syscall 381 +#define SYS___mac_get_file 382 +#define SYS___mac_set_file 383 +#define SYS___mac_get_link 384 +#define SYS___mac_set_link 385 +#define SYS___mac_get_proc 386 +#define SYS___mac_set_proc 387 +#define SYS___mac_get_fd 388 +#define SYS___mac_set_fd 389 +#define SYS___mac_get_pid 390 +#define SYS___mac_get_lcid 391 +#define SYS___mac_get_lctx 392 +#define SYS___mac_set_lctx 393 +#define SYS_setlcid 394 +#define SYS_getlcid 395 +#define SYS_read_nocancel 396 +#define SYS_write_nocancel 397 +#define SYS_open_nocancel 398 +#define SYS_close_nocancel 399 +#define SYS_wait4_nocancel 400 +#define SYS_recvmsg_nocancel 401 +#define SYS_sendmsg_nocancel 402 +#define SYS_recvfrom_nocancel 403 +#define SYS_accept_nocancel 404 +#define SYS_msync_nocancel 405 +#define SYS_fcntl_nocancel 406 +#define SYS_select_nocancel 407 +#define SYS_fsync_nocancel 408 +#define SYS_connect_nocancel 409 +#define SYS_sigsuspend_nocancel 410 +#define SYS_readv_nocancel 411 +#define SYS_writev_nocancel 412 +#define SYS_sendto_nocancel 413 +#define SYS_pread_nocancel 414 +#define SYS_pwrite_nocancel 415 +#define SYS_waitid_nocancel 416 +#define SYS_poll_nocancel 417 +#define SYS_msgsnd_nocancel 418 +#define SYS_msgrcv_nocancel 419 +#define SYS_sem_wait_nocancel 420 +#define SYS_aio_suspend_nocancel 421 +#define SYS___sigwait_nocancel 422 +#define SYS___semwait_signal_nocancel 423 +#define SYS___mac_mount 424 +#define SYS___mac_get_mount 425 +#define SYS___mac_getfsstat 426 +#define SYS_fsgetpath 427 +#define SYS_audit_session_self 428 +#define SYS_audit_session_join 429 +#define SYS_pid_suspend 430 +#define SYS_pid_resume 431 +#define SYS_fileport_makeport 432 +#define SYS_fileport_makefd 433 +#define SYS_MAXSYSCALL 434 + +#endif /* __APPLE_API_PRIVATE */ +#endif /* !_SYS_SYSCALL_H_ */ diff --git a/i386/include/sys/.svn/text-base/syslimits.h.svn-base b/i386/include/sys/.svn/text-base/syslimits.h.svn-base new file mode 100644 index 0000000..a020b39 --- /dev/null +++ b/i386/include/sys/.svn/text-base/syslimits.h.svn-base @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* $NetBSD: syslimits.h,v 1.15 1997/06/25 00:48:09 lukem Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)syslimits.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _SYS_SYSLIMITS_H_ +#define _SYS_SYSLIMITS_H_ + +#include <sys/cdefs.h> + +#if !defined(_ANSI_SOURCE) +/* + * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at + * compile time; you *cannot* set it higher than the hard limit!! + */ +#define ARG_MAX (256 * 1024) /* max bytes for an exec function */ +#define CHILD_MAX 266 /* max simultaneous processes */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define LINK_MAX 32767 /* max file link count */ +#define MAX_CANON 1024 /* max bytes in term canon input line */ +#define MAX_INPUT 1024 /* max bytes in terminal input */ +#define NAME_MAX 255 /* max bytes in a file name */ +#define NGROUPS_MAX 16 /* max supplemental group id's */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */ + +#define OPEN_MAX 10240 /* max open files per process - todo, make a config option? */ + +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define PATH_MAX 1024 /* max bytes in pathname */ +#define PIPE_BUF 512 /* max bytes for atomic pipe writes */ + +#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ +#define BC_DIM_MAX 2048 /* max array elements in bc(1) */ +#define BC_SCALE_MAX 99 /* max scale value in bc(1) */ +#define BC_STRING_MAX 1000 /* max const string length in bc(1) */ +#define CHARCLASS_NAME_MAX 14 /* max character class name size */ +#define COLL_WEIGHTS_MAX 2 /* max weights for order keyword */ +#define EQUIV_CLASS_MAX 2 +#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ +#define LINE_MAX 2048 /* max bytes in an input line */ +#define RE_DUP_MAX 255 /* max RE's in interval notation */ + +#if __DARWIN_UNIX03 +#define NZERO 20 /* default priority [XSI] */ + /* = ((PRIO_MAX - PRIO_MIN) / 2) + 1 */ + /* range: 0 - 39 [(2 * NZERO) - 1] */ + /* 0 is not actually used */ +#else /* !__DARWIN_UNIX03 */ +#define NZERO 0 /* default priority */ + /* range: -20 - 20 */ + /* (PRIO_MIN - PRIO_MAX) */ +#endif /* __DARWIN_UNIX03 */ +#endif /* !_ANSI_SOURCE */ + +#endif /* !_SYS_SYSLIMITS_H_ */ diff --git a/i386/include/sys/.svn/text-base/time.h.svn-base b/i386/include/sys/.svn/text-base/time.h.svn-base new file mode 100644 index 0000000..4b2d999 --- /dev/null +++ b/i386/include/sys/.svn/text-base/time.h.svn-base @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.2 (Berkeley) 7/10/94 + */ + +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include <sys/cdefs.h> +#include <sys/_types.h> + +/* + * [XSI] The fd_set type shall be defined as described in <sys/select.h>. + * The timespec structure shall be defined as described in <time.h> + */ +#define __need_fd_set +#define __need_struct_timespec +#define __need_struct_timeval +#include <sys/_structs.h> + +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + +#ifndef _SUSECONDS_T +#define _SUSECONDS_T +typedef __darwin_suseconds_t suseconds_t; +#endif + +/* + * Structure used as a parameter by getitimer(2) and setitimer(2) system + * calls. + */ +struct itimerval { + struct timeval it_interval; /* timer interval */ + struct timeval it_value; /* current value */ +}; + +/* + * Names of the interval timers, and structure + * defining a timer setting. + */ +#define ITIMER_REAL 0 +#define ITIMER_VIRTUAL 1 +#define ITIMER_PROF 2 + +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE __DARWIN_FD_SETSIZE +#endif /* FD_SETSIZE */ +#ifndef FD_SET +#define FD_SET(n, p) __DARWIN_FD_SET(n, p) +#endif /* FD_SET */ +#ifndef FD_CLR +#define FD_CLR(n,p) __DARWIN_FD_CLR(n, p) +#endif /* FD_CLR */ +#ifndef FD_ISSET +#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) +#endif /* FD_ISSET */ +#ifndef FD_ZERO +#define FD_ZERO(p) __DARWIN_FD_ZERO(p) +#endif /* FD_ZERO */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#ifndef FD_COPY +#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) +#endif /* FD_COPY */ + +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->tv_sec = (tv)->tv_sec; \ + (ts)->tv_nsec = (tv)->tv_usec * 1000; \ +} +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (ts)->tv_sec; \ + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ +} + +struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; +#define DST_NONE 0 /* not on dst */ +#define DST_USA 1 /* USA style dst */ +#define DST_AUST 2 /* Australian style dst */ +#define DST_WET 3 /* Western European dst */ +#define DST_MET 4 /* Middle European dst */ +#define DST_EET 5 /* Eastern European dst */ +#define DST_CAN 6 /* Canada */ + +/* Operations on timevals. */ +#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#define timercmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec == (uvp)->tv_sec) ? \ + ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ + ((tvp)->tv_sec cmp (uvp)->tv_sec)) +#define timeradd(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ + if ((vvp)->tv_usec >= 1000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_usec -= 1000000; \ + } \ + } while (0) +#define timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) + +#define timevalcmp(l, r, cmp) timercmp(l, r, cmp) /* freebsd */ + +/* + * Getkerninfo clock information structure + */ +struct clockinfo { + int hz; /* clock frequency */ + int tick; /* micro-seconds per hz tick */ + int tickadj; /* clock skew rate for adjtime() */ + int stathz; /* statistics clock frequency */ + int profhz; /* profiling clock frequency */ +}; +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#include <time.h> +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +__BEGIN_DECLS + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int adjtime(const struct timeval *, struct timeval *); +int futimes(int, const struct timeval *); +int lutimes(const char *, const struct timeval *); +int settimeofday(const struct timeval *, const struct timezone *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +int getitimer(int, struct itimerval *); +int gettimeofday(struct timeval * __restrict, void * __restrict); + +#include <sys/_select.h> /* select() prototype */ + +int setitimer(int, const struct itimerval * __restrict, + struct itimerval * __restrict); +int utimes(const char *, const struct timeval *); + +__END_DECLS + + +#endif /* !_SYS_TIME_H_ */ diff --git a/i386/include/sys/.svn/text-base/types.h.svn-base b/i386/include/sys/.svn/text-base/types.h.svn-base new file mode 100644 index 0000000..01d4f2b --- /dev/null +++ b/i386/include/sys/.svn/text-base/types.h.svn-base @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.4 (Berkeley) 1/21/94 + */ + +#ifndef _SYS_TYPES_H_ +#define _SYS_TYPES_H_ + +#ifndef __ASSEMBLER__ +#include <sys/cdefs.h> + +/* Machine type dependent parameters. */ +#include <machine/types.h> +#include <sys/_types.h> +#include <machine/endian.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +#ifndef _U_LONG +typedef unsigned long u_long; +#define _U_LONG +#endif +typedef unsigned short ushort; /* Sys V compatibility */ +typedef unsigned int uint; /* Sys V compatibility */ +#endif + +typedef u_int64_t u_quad_t; /* quads */ +typedef int64_t quad_t; +typedef quad_t * qaddr_t; + +typedef char * caddr_t; /* core address */ +typedef int32_t daddr_t; /* disk address */ + +typedef u_int32_t fixpt_t; /* fixed point number */ + + +#ifndef _IN_ADDR_T +#define _IN_ADDR_T +typedef __uint32_t in_addr_t; /* base type for internet address */ +#endif + +#ifndef _IN_PORT_T +#define _IN_PORT_T +typedef __uint16_t in_port_t; +#endif + + +#ifndef _KEY_T +#define _KEY_T +typedef __int32_t key_t; /* IPC key (for Sys V IPC) */ +#endif + +#ifndef _NLINK_T +typedef __uint16_t nlink_t; /* link count */ +#define _NLINK_T +#endif + +typedef int32_t segsz_t; /* segment size */ +typedef int32_t swblk_t; /* swap offset */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* Major, minor numbers, dev_t's. */ +#if defined(__cplusplus) +/* + * These lowercase macros tend to match member functions in some C++ code, + * so for C++, we must use inline functions instead. + */ + +static inline __int32_t major(__uint32_t _x) +{ + return (__int32_t)(((__uint32_t)_x >> 24) & 0xff); +} + +static inline __int32_t minor(__uint32_t _x) +{ + return (__int32_t)((_x) & 0xffffff); +} +#else /* !__cplusplus */ + +#define major(x) ((int32_t)(((u_int32_t)(x) >> 24) & 0xff)) +#define minor(x) ((int32_t)((x) & 0xffffff)) + +#endif /* !__cplusplus */ +#endif /* !_POSIX_C_SOURCE */ + +#ifndef _CLOCK_T +#define _CLOCK_T +typedef __darwin_clock_t clock_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif + +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif + +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * This code is present here in order to maintain historical backward + * compatability, and is intended to be removed at some point in the + * future; please include <sys/select.h> instead. + */ +#define __need_fd_set +#include <sys/_structs.h> + +#define NBBY __DARWIN_NBBY /* bits in a byte */ +#define NFDBITS __DARWIN_NFDBITS /* bits per mask */ +#define howmany(x, y) __DARWIN_howmany(x, y) /* # y's == x bits? */ +typedef __int32_t fd_mask; + +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE __DARWIN_FD_SETSIZE +#endif /* FD_SETSIZE */ +#ifndef FD_SET +#define FD_SET(n, p) __DARWIN_FD_SET(n, p) +#endif /* FD_SET */ +#ifndef FD_CLR +#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p) +#endif /* FD_CLR */ +#ifndef FD_ISSET +#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) +#endif /* FD_ISSET */ +#ifndef FD_ZERO +#define FD_ZERO(p) __DARWIN_FD_ZERO(p) +#endif /* FD_ZERO */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef FD_COPY +#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) +#endif /* FD_COPY */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +#if defined(__STDC__) && defined(KERNEL) +/* + * Forward structure declarations for function prototypes. We include the + * common structures that cross subsystem boundaries here; others are mostly + * used in the same place that the structure is defined. + */ +struct proc; +struct pgrp; +struct ucred; +struct rusage; +struct file; +struct buf; +struct tty; +struct uio; +#endif + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* __ASSEMBLER__ */ + + + + +#endif /* !_SYS_TYPES_H_ */ diff --git a/i386/include/sys/.svn/text-base/unistd.h.svn-base b/i386/include/sys/.svn/text-base/unistd.h.svn-base new file mode 100644 index 0000000..d80b3bb --- /dev/null +++ b/i386/include/sys/.svn/text-base/unistd.h.svn-base @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 8.2 (Berkeley) 1/7/94 + */ + +#ifndef _SYS_UNISTD_H_ +#define _SYS_UNISTD_H_ + +#include <sys/cdefs.h> + +/* + * Although we have saved user/group IDs, we do not use them in setuid + * as described in POSIX 1003.1, because the feature does not work for + * root. We use the saved IDs in seteuid/setegid, which are not currently + * part of the POSIX 1003.1 specification. + */ +#ifdef _NOT_AVAILABLE +#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */ +#endif + +#define _POSIX_VERSION 200112L +#define _POSIX2_VERSION 200112L + +/* execution-time symbolic constants */ + /* may disable terminal special characters */ +#ifndef _POSIX_VDISABLE +#define _POSIX_VDISABLE ((unsigned char)'\377') +#endif + +#define _POSIX_THREAD_KEYS_MAX 128 + +/* access function */ +#define F_OK 0 /* test for existence of file */ +#define X_OK (1<<0) /* test for execute or search permission */ +#define W_OK (1<<1) /* test for write permission */ +#define R_OK (1<<2) /* test for read permission */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Extended access functions. + * Note that we depend on these matching the definitions in sys/kauth.h, + * but with the bits shifted left by 8. + */ +#define _READ_OK (1<<9) /* read file data / read directory */ +#define _WRITE_OK (1<<10) /* write file data / add file to directory */ +#define _EXECUTE_OK (1<<11) /* execute file / search in directory*/ +#define _DELETE_OK (1<<12) /* delete file / delete directory */ +#define _APPEND_OK (1<<13) /* append to file / add subdirectory to directory */ +#define _RMFILE_OK (1<<14) /* - / remove file from directory */ +#define _RATTR_OK (1<<15) /* read basic attributes */ +#define _WATTR_OK (1<<16) /* write basic attributes */ +#define _REXT_OK (1<<17) /* read extended attributes */ +#define _WEXT_OK (1<<18) /* write extended attributes */ +#define _RPERM_OK (1<<19) /* read permissions */ +#define _WPERM_OK (1<<20) /* write permissions */ +#define _CHOWN_OK (1<<21) /* change ownership */ + +#define _ACCESS_EXTENDED_MASK (_READ_OK | _WRITE_OK | _EXECUTE_OK | \ + _DELETE_OK | _APPEND_OK | \ + _RMFILE_OK | _REXT_OK | \ + _WEXT_OK | _RATTR_OK | _WATTR_OK | _RPERM_OK | \ + _WPERM_OK | _CHOWN_OK) +#endif + +/* whence values for lseek(2) */ +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif /* !SEEK_SET */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* whence values for lseek(2); renamed by POSIX 1003.1 */ +#define L_SET SEEK_SET +#define L_INCR SEEK_CUR +#define L_XTND SEEK_END +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +struct accessx_descriptor { + unsigned int ad_name_offset; + int ad_flags; + int ad_pad[2]; +}; +#define ACCESSX_MAX_DESCRIPTORS 100 +#define ACCESSX_MAX_TABLESIZE (16 * 1024) +#endif + +/* configurable pathname variables */ +#define _PC_LINK_MAX 1 +#define _PC_MAX_CANON 2 +#define _PC_MAX_INPUT 3 +#define _PC_NAME_MAX 4 +#define _PC_PATH_MAX 5 +#define _PC_PIPE_BUF 6 +#define _PC_CHOWN_RESTRICTED 7 +#define _PC_NO_TRUNC 8 +#define _PC_VDISABLE 9 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define _PC_NAME_CHARS_MAX 10 +#define _PC_CASE_SENSITIVE 11 +#define _PC_CASE_PRESERVING 12 +#define _PC_EXTENDED_SECURITY_NP 13 +#define _PC_AUTH_OPAQUE_NP 14 +#endif + +#define _PC_2_SYMLINKS 15 /* Symlink supported in directory */ +#define _PC_ALLOC_SIZE_MIN 16 /* Minimum storage actually allocated */ +#define _PC_ASYNC_IO 17 /* Async I/O [AIO] supported? */ +#define _PC_FILESIZEBITS 18 /* # of bits to represent file size */ +#define _PC_PRIO_IO 19 /* Priority I/O [PIO] supported? */ +#define _PC_REC_INCR_XFER_SIZE 20 /* Recommended increment for next two */ +#define _PC_REC_MAX_XFER_SIZE 21 /* Recommended max file transfer size */ +#define _PC_REC_MIN_XFER_SIZE 22 /* Recommended min file transfer size */ +#define _PC_REC_XFER_ALIGN 23 /* Recommended buffer alignment */ +#define _PC_SYMLINK_MAX 24 /* Max # of bytes in symlink name */ +#define _PC_SYNC_IO 25 /* Sync I/O [SIO] supported? */ + +/* configurable system strings */ +#define _CS_PATH 1 + +#endif /* !_SYS_UNISTD_H_ */ diff --git a/i386/include/sys/_endian.h b/i386/include/sys/_endian.h new file mode 100644 index 0000000..3fb0f06 --- /dev/null +++ b/i386/include/sys/_endian.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2004, 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1995 NeXT Computer, Inc. All rights reserved. + * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1987, 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__ENDIAN_H_ +#define _SYS__ENDIAN_H_ + +#include <sys/cdefs.h> + +/* + * Macros for network/external number representation conversion. + */ + +#if defined(lint) + +__BEGIN_DECLS +__uint16_t ntohs(__uint16_t); +__uint16_t htons(__uint16_t); +__uint32_t ntohl(__uint32_t); +__uint32_t htonl(__uint32_t); +__END_DECLS + +#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN + +#define ntohl(x) ((__uint32_t)(x)) +#define ntohs(x) ((__uint16_t)(x)) +#define htonl(x) ((__uint32_t)(x)) +#define htons(x) ((__uint16_t)(x)) + +#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define NTOHL(x) (x) +#define NTOHS(x) (x) +#define HTONL(x) (x) +#define HTONS(x) (x) +#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ + +#else /* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */ + +#include <libkern/_OSByteOrder.h> + +#define ntohs(x) __DARWIN_OSSwapInt16(x) +#define htons(x) __DARWIN_OSSwapInt16(x) + +#define ntohl(x) __DARWIN_OSSwapInt32(x) +#define htonl(x) __DARWIN_OSSwapInt32(x) + +#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +#define NTOHL(x) (x) = ntohl((__uint32_t)x) +#define NTOHS(x) (x) = ntohs((__uint16_t)x) +#define HTONL(x) (x) = htonl((__uint32_t)x) +#define HTONS(x) (x) = htons((__uint16_t)x) +#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */ +#endif /* __DARWIN_BYTE_ORDER */ +#endif /* !_SYS__ENDIAN_H_ */ diff --git a/i386/include/sys/_select.h b/i386/include/sys/_select.h new file mode 100644 index 0000000..6f70921 --- /dev/null +++ b/i386/include/sys/_select.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2005, 2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +/* + * This is called from sys/select.h and sys/time.h for the common prototype + * of select(). Setting _DARWIN_C_SOURCE or _DARWIN_UNLIMITED_SELECT uses + * the version of select() that does not place a limit on the first argument + * (nfds). In the UNIX conformance case, values of nfds greater than + * FD_SETSIZE will return an error of EINVAL. + */ +#ifndef _SYS__SELECT_H_ +#define _SYS__SELECT_H_ + +int select(int, fd_set * __restrict, fd_set * __restrict, + fd_set * __restrict, struct timeval * __restrict) +#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) + __DARWIN_EXTSN_C(select) +#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ +# if defined(__LP64__) && !__DARWIN_NON_CANCELABLE + __DARWIN_1050(select) +# else /* !__LP64__ || __DARWIN_NON_CANCELABLE */ + __DARWIN_ALIAS_C(select) +# endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */ +#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */ + ; + +#endif /* !_SYS__SELECT_H_ */ diff --git a/i386/include/sys/_structs.h b/i386/include/sys/_structs.h new file mode 100644 index 0000000..5c9db95 --- /dev/null +++ b/i386/include/sys/_structs.h @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2004-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#include <sys/cdefs.h> + +#ifdef __need_ucontext_t +#ifndef __need_struct_ucontext +#define __need_struct_ucontext +#endif /* __need_struct_ucontext */ +#endif /* __need_ucontext_t */ + +#ifdef __need_ucontext64_t +#ifndef __need_struct_ucontext64 +#define __need_struct_ucontext64 +#endif /* __need_struct_ucontext64 */ +#endif /* __need_ucontext64_t */ + +#ifdef __need_struct_ucontext +#ifndef __need_struct_mcontext +#define __need_struct_mcontext +#endif /* __need_struct_mcontext */ +#endif /* __need_struct_ucontext */ + +#ifdef __need_struct_ucontext64 +#ifndef __need_struct_mcontext64 +#define __need_struct_mcontext64 +#endif /* __need_struct_mcontext64 */ +#endif /* __need_struct_ucontext64 */ + +#if defined(__need_struct_mcontext) || defined(__need_struct_mcontext64) +#include <machine/_structs.h> +#endif /* __need_struct_mcontext || __need_struct_mcontext64 */ + +#if defined(__need_stack_t) || defined(__need_struct_ucontext) || defined(__need_struct_ucontext64) +#ifndef __need_struct_sigaltstack +#define __need_struct_sigaltstack +#endif /* __need_struct_sigaltstack */ +#endif /* __need_stack_t || __need_struct_ucontext || __need_struct_ucontext64 */ + +#ifdef __need_struct_sigaltstack +#undef __need_struct_sigaltstack +/* Structure used in sigaltstack call. */ +#ifndef _STRUCT_SIGALTSTACK +#if __DARWIN_UNIX03 +#define _STRUCT_SIGALTSTACK struct __darwin_sigaltstack +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_SIGALTSTACK struct sigaltstack +#endif /* __DARWIN_UNIX03 */ +_STRUCT_SIGALTSTACK +{ + void *ss_sp; /* signal stack base */ + __darwin_size_t ss_size; /* signal stack length */ + int ss_flags; /* SA_DISABLE and/or SA_ONSTACK */ +}; +#endif /* _STRUCT_SIGALTSTACK */ +#endif /* __need_struct_sigaltstack */ + +#ifdef __need_struct_timespec +#undef __need_struct_timespec +#ifndef _STRUCT_TIMESPEC +#define _STRUCT_TIMESPEC struct timespec +_STRUCT_TIMESPEC +{ + __darwin_time_t tv_sec; + long tv_nsec; +}; +#endif /* _STRUCT_TIMESPEC */ +#endif /* __need_struct_timespec */ + +#ifdef __need_struct_timeval +#undef __need_struct_timeval +#ifndef _STRUCT_TIMEVAL +#define _STRUCT_TIMEVAL struct timeval +_STRUCT_TIMEVAL +{ + __darwin_time_t tv_sec; /* seconds */ + __darwin_suseconds_t tv_usec; /* and microseconds */ +}; +#endif /* _STRUCT_TIMEVAL */ +#endif /* __need_struct_timeval */ + +#ifdef __need_struct_timeval32 +#undef __need_struct_timeval32 +#ifndef _STRUCT_TIMEVAL32 +#define _STRUCT_TIMEVAL32 struct timeval32 +_STRUCT_TIMEVAL32 +{ + __int32_t tv_sec; /* seconds */ + __int32_t tv_usec; /* and microseconds */ +}; +#endif /* _STRUCT_TIMEVAL32 */ +#endif /* __need_struct_timeval32 */ + +#ifdef __need_struct_ucontext +#undef __need_struct_ucontext +#ifndef _STRUCT_UCONTEXT +#if __DARWIN_UNIX03 +#define _STRUCT_UCONTEXT struct __darwin_ucontext +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_UCONTEXT struct ucontext +#endif /* __DARWIN_UNIX03 */ +_STRUCT_UCONTEXT +{ + int uc_onstack; + __darwin_sigset_t uc_sigmask; /* signal mask used by this context */ + _STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */ + _STRUCT_UCONTEXT *uc_link; /* pointer to resuming context */ + __darwin_size_t uc_mcsize; /* size of the machine context passed in */ + _STRUCT_MCONTEXT *uc_mcontext; /* pointer to machine specific context */ +#ifdef _XOPEN_SOURCE + _STRUCT_MCONTEXT __mcontext_data; +#endif /* _XOPEN_SOURCE */ +}; +#endif /* _STRUCT_UCONTEXT */ +#endif /* __need_struct_ucontext */ + +#ifdef __need_struct_ucontext64 +#undef __need_struct_ucontext64 +#ifndef _STRUCT_UCONTEXT64 +#if __DARWIN_UNIX03 +#define _STRUCT_UCONTEXT64 struct __darwin_ucontext64 +#else /* !__DARWIN_UNIX03 */ +#define _STRUCT_UCONTEXT64 struct ucontext64 +#endif /* __DARWIN_UNIX03 */ +_STRUCT_UCONTEXT64 +{ + int uc_onstack; + __darwin_sigset_t uc_sigmask; /* signal mask used by this context */ + _STRUCT_SIGALTSTACK uc_stack; /* stack used by this context */ + _STRUCT_UCONTEXT64 *uc_link; /* pointer to resuming context */ + __darwin_size_t uc_mcsize; /* size of the machine context passed in */ + _STRUCT_MCONTEXT64 *uc_mcontext64; /* pointer to machine specific context */ +}; +#endif /* _STRUCT_UCONTEXT64 */ +#endif /* __need_struct_ucontext64 */ + + +#ifdef __need_fd_set +#undef __need_fd_set +#ifndef _FD_SET +#define _FD_SET +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifdef FD_SETSIZE +#define __DARWIN_FD_SETSIZE FD_SETSIZE +#else /* !FD_SETSIZE */ +#define __DARWIN_FD_SETSIZE 1024 +#endif /* FD_SETSIZE */ +#define __DARWIN_NBBY 8 /* bits in a byte */ +#define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY) /* bits per mask */ +#define __DARWIN_howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) /* # y's == x bits? */ + +__BEGIN_DECLS +typedef struct fd_set { + __int32_t fds_bits[__DARWIN_howmany(__DARWIN_FD_SETSIZE, __DARWIN_NFDBITS)]; +} fd_set; +__END_DECLS + +/* This inline avoids argument side-effect issues with FD_ISSET() */ +static __inline int +__darwin_fd_isset(int _n, const struct fd_set *_p) +{ + return (_p->fds_bits[_n/__DARWIN_NFDBITS] & (1<<(_n % __DARWIN_NFDBITS))); +} + +#define __DARWIN_FD_SET(n, p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] |= (1<<(__fd % __DARWIN_NFDBITS))); } while(0) +#define __DARWIN_FD_CLR(n, p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] &= ~(1<<(__fd % __DARWIN_NFDBITS))); } while(0) +#define __DARWIN_FD_ISSET(n, p) __darwin_fd_isset((n), (p)) + +#if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3 +/* + * Use the built-in bzero function instead of the library version so that + * we do not pollute the namespace or introduce prototype warnings. + */ +#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p))) +#else +#define __DARWIN_FD_ZERO(p) bzero(p, sizeof(*(p))) +#endif + +#define __DARWIN_FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) +#endif /* _FD_SET */ +#endif /* __need_fd_set */ + +#ifdef __need_stack_t +#undef __need_stack_t +#ifndef _STACK_T +#define _STACK_T +typedef _STRUCT_SIGALTSTACK stack_t; /* [???] signal stack */ +#endif /* _STACK_T */ +#endif /* __need_stack_t */ + +#ifdef __need_ucontext_t +#undef __need_ucontext_t +/* user context */ +#ifndef _UCONTEXT_T +#define _UCONTEXT_T +typedef _STRUCT_UCONTEXT ucontext_t; /* [???] user context */ +#endif /* _UCONTEXT_T */ +#endif /* __need_ucontext_t */ + +#ifdef __need_ucontext64_t +#undef __need_ucontext64_t +#ifndef _UCONTEXT64_T +#define _UCONTEXT64_T +typedef _STRUCT_UCONTEXT64 ucontext64_t; /* [???] user context */ +#endif /* _UCONTEXT64_T */ +#endif /* __need_ucontext64_t */ diff --git a/i386/include/sys/_types.h b/i386/include/sys/_types.h new file mode 100644 index 0000000..9047dc2 --- /dev/null +++ b/i386/include/sys/_types.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _SYS__TYPES_H_ +#define _SYS__TYPES_H_ + +#include <sys/cdefs.h> +#include <machine/_types.h> + +/* + * Type definitions; takes common type definitions that must be used + * in multiple header files due to [XSI], removes them from the system + * space, and puts them in the implementation space. + */ + +#ifdef __cplusplus +#ifdef __GNUG__ +#define __DARWIN_NULL __null +#else /* ! __GNUG__ */ +#ifdef __LP64__ +#define __DARWIN_NULL (0L) +#else /* !__LP64__ */ +#define __DARWIN_NULL 0 +#endif /* __LP64__ */ +#endif /* __GNUG__ */ +#else /* ! __cplusplus */ +#define __DARWIN_NULL ((void *)0) +#endif /* __cplusplus */ + +typedef __int64_t __darwin_blkcnt_t; /* total blocks */ +typedef __int32_t __darwin_blksize_t; /* preferred block size */ +typedef __int32_t __darwin_dev_t; /* dev_t */ +typedef unsigned int __darwin_fsblkcnt_t; /* Used by statvfs and fstatvfs */ +typedef unsigned int __darwin_fsfilcnt_t; /* Used by statvfs and fstatvfs */ +typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */ +typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/ +typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */ +#if __DARWIN_64_BIT_INO_T +typedef __darwin_ino64_t __darwin_ino_t; /* [???] Used for inodes */ +#else /* !__DARWIN_64_BIT_INO_T */ +typedef __uint32_t __darwin_ino_t; /* [???] Used for inodes */ +#endif /* __DARWIN_64_BIT_INO_T */ +typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */ +typedef __darwin_mach_port_name_t __darwin_mach_port_t; /* Used by mach */ +typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */ +typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */ +#ifndef _OFF_T +#define _OFF_T +typedef __darwin_off_t off_t; +#endif +typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */ +typedef __uint32_t __darwin_sigset_t; /* [???] signal set */ +typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */ +typedef __uint32_t __darwin_uid_t; /* [???] user IDs */ +typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */ +typedef unsigned char __darwin_uuid_t[16]; +typedef char __darwin_uuid_string_t[37]; + +#endif /* _SYS__TYPES_H_ */ diff --git a/i386/include/sys/appleapiopts.h b/i386/include/sys/appleapiopts.h new file mode 100644 index 0000000..2055701 --- /dev/null +++ b/i386/include/sys/appleapiopts.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef __SYS_APPLEAPIOPTS_H__ +#define __SYS_APPLEAPIOPTS_H__ + + +#ifndef __APPLE_API_STANDARD +#define __APPLE_API_STANDARD +#endif /* __APPLE_API_STANDARD */ + +#ifndef __APPLE_API_STABLE +#define __APPLE_API_STABLE +#endif /* __APPLE_API_STABLE */ + +#ifndef __APPLE_API_STRICT_CONFORMANCE + +#ifndef __APPLE_API_EVOLVING +#define __APPLE_API_EVOLVING +#endif /* __APPLE_API_EVOLVING */ + +#ifndef __APPLE_API_UNSTABLE +#define __APPLE_API_UNSTABLE +#endif /* __APPLE_API_UNSTABLE */ + +#ifndef __APPLE_API_PRIVATE +#define __APPLE_API_PRIVATE +#endif /* __APPLE_API_PRIVATE */ + +#ifndef __APPLE_API_OBSOLETE +#define __APPLE_API_OBSOLETE +#endif /* __APPLE_API_OBSOLETE */ + +#endif /* __APPLE_API_STRICT_CONFORMANCE */ + +#endif /* __SYS_APPLEAPIOPTS_H__ */ + diff --git a/i386/include/sys/buf.h b/i386/include/sys/buf.h new file mode 100644 index 0000000..6f0db77 --- /dev/null +++ b/i386/include/sys/buf.h @@ -0,0 +1,859 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)buf.h 8.9 (Berkeley) 3/30/95 + */ + +#ifndef _SYS_BUF_H_ +#define _SYS_BUF_H_ + +#include <sys/cdefs.h> +#include <sys/kernel_types.h> +#include <mach/memory_object_types.h> + + +#define B_WRITE 0x00000000 /* Write buffer (pseudo flag). */ +#define B_READ 0x00000001 /* Read buffer. */ +#define B_ASYNC 0x00000002 /* Start I/O, do not wait. */ +#define B_NOCACHE 0x00000004 /* Do not cache block after use. */ +#define B_DELWRI 0x00000008 /* Delay I/O until buffer reused. */ +#define B_LOCKED 0x00000010 /* Locked in core (not reusable). */ +#define B_PHYS 0x00000020 /* I/O to user memory. */ +#define B_CLUSTER 0x00000040 /* UPL based I/O generated by cluster layer */ +#define B_PAGEIO 0x00000080 /* Page in/out */ +#define B_META 0x00000100 /* buffer contains meta-data. */ +#define B_RAW 0x00000200 /* Set by physio for raw transfers. */ +#define B_FUA 0x00000400 /* Write-through disk cache(if supported) */ +#define B_PASSIVE 0x00000800 /* PASSIVE I/Os are ignored by THROTTLE I/O */ +#define B_IOSTREAMING 0x00001000 /* sequential access pattern detected */ +#define B_THROTTLED_IO 0x00002000 /* low priority I/O */ +/* + * make sure to check when adding flags that + * that the new flags don't overlap the definitions + * in buf_internal.h + */ + +__BEGIN_DECLS + +/*! + @function buf_markaged + @abstract Mark a buffer as "aged," i.e. as a good candidate to be discarded and reused after buf_brelse(). + @param bp Buffer to mark. + */ +void buf_markaged(buf_t); + +/*! + @function buf_markinvalid + @abstract Mark a buffer as not having valid data and being ready for immediate reuse after buf_brelse(). + @param bp Buffer to mark. + */ +void buf_markinvalid(buf_t); + +/*! + @function buf_markdelayed + @abstract Mark a buffer as a delayed write: mark it dirty without actually scheduling I/O. + @discussion Data will be flushed to disk at some later time, not with brelse(). A sync()/fsync() + or pressure necessitating reuse of the buffer will cause it to be written back to disk. + @param bp Buffer to mark. + */ +void buf_markdelayed(buf_t); + +/*! + @function buf_markeintr + @abstract Mark a buffer as having been interrupted during I/O. + @discussion Waiters for I/O to complete (buf_biowait()) will return with EINTR when woken up. + buf_markeintr does not itself do a wakeup. + @param bp Buffer to mark. + */ +void buf_markeintr(buf_t); + +/*! + @function buf_markfua + @abstract Mark a buffer for write through disk cache, if disk supports it. + @param bp Buffer to mark. + */ +void buf_markfua(buf_t); + +/*! + @function buf_fua + @abstract Check if a buffer is marked for write through disk caches. + @param bp Buffer to test. + @return Nonzero if buffer is marked for write-through, 0 if not. + */ +int buf_fua(buf_t); + +/*! + @function buf_valid + @abstract Check if a buffer contains valid data. + @param bp Buffer to test. + @return Nonzero if buffer has valid data, 0 if not. + */ +int buf_valid(buf_t); + +/*! + @function buf_fromcache + @abstract Check if a buffer's data was found in core. + @discussion Will return truth after a buf_getblk that finds a valid buffer in the cache or the relevant + data in core (but not in a buffer). + @param bp Buffer to test. + @return Nonzero if we got this buffer's data without doing I/O, 0 if not. + */ +int buf_fromcache(buf_t); + +/*! + @function buf_upl + @abstract Get the upl (Universal Page List) associated with a buffer. + @discussion Buffers allocated with buf_alloc() are not returned with a upl, and + traditional buffers only have a upl while an I/O is in progress. + @param bp Buffer whose upl to grab. + @return Buffer's upl if it has one, else NULL. + */ +void * buf_upl(buf_t); + +/*! + @function buf_uploffset + @abstract Get the offset into a UPL at which this buffer begins. + @discussion This function should only be called on iobufs, i.e. buffers allocated with buf_alloc(). + @param bp Buffer whose uploffset to grab. + @return Buffer's uploffset--does not check whether that value makes sense for this buffer. + */ +uint32_t buf_uploffset(buf_t); + + + +/*! + @function buf_proc + @abstract Get the process associated with this buffer. + @discussion buf_proc() will generally return NULL; a process is currently only associated with + a buffer in the event of a physio() call. + @param bp Buffer whose associated process to find. + @return Associated process, possibly NULL. + */ +proc_t buf_proc(buf_t); + +/*! + @function buf_dirtyoff + @abstract Get the starting offset of the dirty region associated with a buffer. + @discussion The dirty offset is zero unless someone explicitly calls buf_setdirtyoff() (which the kernel does not). + @param bp Buffer whose dirty offset to get. + @return Dirty offset (0 if not explicitly changed). + */ +uint32_t buf_dirtyoff(buf_t); + +/*! + @function buf_dirtyend + @abstract Get the ending offset of the dirty region associated with a buffer. + @discussion If the buffer's data was found incore and dirty, the dirty end is the size of the block; otherwise, unless + someone outside of xnu explicitly changes it by calling buf_setdirtyend(), it will be zero. + @param bp Buffer whose dirty end to get. + @return 0 if buffer is found clean; size of buffer if found dirty. Can be set to any value by callers of buf_setdirtyend(). + */ +uint32_t buf_dirtyend(buf_t); + +/*! + @function buf_setdirtyoff + @abstract Set the starting offset of the dirty region associated with a buffer. + @discussion This value is zero unless someone set it explicitly. + @param bp Buffer whose dirty end to set. + @return void. + */ +void buf_setdirtyoff(buf_t, uint32_t); + +/*! + @function buf_setdirtyend + @abstract Set the ending offset of the dirty region associated with a buffer. + @discussion If the buffer's data was found incore and dirty, the dirty end is the size of the block; otherwise, unless + someone outside of xnu explicitly changes it by calling buf_setdirtyend(), it will be zero. + @param bp Buffer whose dirty end to set. + @return void. + */ +void buf_setdirtyend(buf_t, uint32_t); + +/*! + @function buf_error + @abstract Get the error value associated with a buffer. + @discussion Errors are set with buf_seterror(). + @param bp Buffer whose error value to retrieve. + @return Error value, directly. + */ +errno_t buf_error(buf_t); + +/*! + @function buf_seterror + @abstract Set an error value on a buffer. + @param bp Buffer whose error value to set. + @return void. + */ +void buf_seterror(buf_t, errno_t); + +/*! + @function buf_setflags + @abstract Set flags on a buffer. + @discussion: buffer_flags |= flags + @param bp Buffer whose flags to set. + @param flags Flags to add to buffer's mask. B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA + @return void. + */ +void buf_setflags(buf_t, int32_t); + +/*! + @function buf_clearflags + @abstract Clear flags on a buffer. + @discussion: buffer_flags &= ~flags + @param bp Buffer whose flags to clear. + @param flags Flags to remove from buffer's mask. B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA + @return void. + */ +void buf_clearflags(buf_t, int32_t); + +/*! + @function buf_flags + @abstract Get flags set on a buffer. + @discussion Valid flags are B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA. + @param bp Buffer whose flags to grab. + @return flags. + */ +int32_t buf_flags(buf_t); + +/*! + @function buf_reset + @abstract Reset I/O flag state on a buffer. + @discussion Clears current flags on a buffer (internal and external) and allows some new flags to be set. + Used perhaps to prepare an iobuf for reuse. + @param bp Buffer whose flags to grab. + @param flags Flags to set on buffer: B_READ, B_WRITE, B_ASYNC, B_NOCACHE. + @return void. + */ +void buf_reset(buf_t, int32_t); + +/*! + @function buf_map + @abstract Get virtual mappings for buffer data. + @discussion For buffers created through buf_getblk() (i.e. traditional buffer cache usage), + buf_map() just returns the address at which data was mapped by but_getblk(). For a B_CLUSTER buffer, i.e. an iobuf + whose upl state is managed manually, there are two possibilities. If the buffer was created + with an underlying "real" buffer through cluster_bp(), the mapping of the "real" buffer is returned. + Otherwise, the buffer was created with buf_alloc() and buf_setupl() was subsequently called; buf_map() + will call ubc_upl_map() to get a mapping for the buffer's upl and return the start of that mapping + plus the buffer's upl offset (set in buf_setupl()). In the last case, buf_unmap() must later be called + to tear down the mapping. NOTE: buf_map() does not set the buffer data pointer; this must be done with buf_setdataptr(). + @param bp Buffer whose mapping to find or create. + @param io_addr Destination for mapping address. + @return 0 for success, ENOMEM if unable to map the buffer. + */ +errno_t buf_map(buf_t, caddr_t *); + +/*! + @function buf_unmap + @abstract Release mappings for buffer data. + @discussion For buffers created through buf_getblk() (i.e. traditional buffer cache usage), + buf_unmap() does nothing; buf_brelse() will take care of unmapping. For a B_CLUSTER buffer, i.e. an iobuf + whose upl state is managed manually, there are two possibilities. If the buffer was created + with an underlying "real" buffer through cluster_bp(), buf_unmap() does nothing; buf_brelse() on the + underlying buffer will tear down the mapping. Otherwise, the buffer was created with buf_alloc() and + buf_setupl() was subsequently called; buf_map() created the mapping. In this case, buf_unmap() will + unmap the buffer. + @param bp Buffer whose mapping to find or create. + @param io_addr Destination for mapping address. + @return 0 for success, EINVAL if unable to unmap buffer. + */ +errno_t buf_unmap(buf_t); + +/*! + @function buf_setdrvdata + @abstract Set driver-specific data on a buffer. + @param bp Buffer whose driver-data to set. + @param drvdata Opaque driver data. + @return void. + */ +void buf_setdrvdata(buf_t, void *); + +/*! + @function buf_setdrvdata + @abstract Get driver-specific data from a buffer. + @param bp Buffer whose driver data to get. + @return Opaque driver data. + */ +void * buf_drvdata(buf_t); + +/*! + @function buf_setfsprivate + @abstract Set filesystem-specific data on a buffer. + @param bp Buffer whose filesystem data to set. + @param fsprivate Opaque filesystem data. + @return void. + */ +void buf_setfsprivate(buf_t, void *); + +/*! + @function buf_fsprivate + @abstract Get filesystem-specific data from a buffer. + @param bp Buffer whose filesystem data to get. + @return Opaque filesystem data. + */ +void * buf_fsprivate(buf_t); + +/*! + @function buf_blkno + @abstract Get physical block number associated with a buffer, in the sense of VNOP_BLOCKMAP. + @discussion When a buffer's physical block number is the same is its logical block number, then the physical + block number is considered uninitialized. A physical block number of -1 indicates that there is no valid + physical mapping (e.g. the logical block is invalid or corresponds to a sparse region in a file). Physical + block number is normally set by the cluster layer or by buf_getblk(). + @param bp Buffer whose physical block number to get. + @return Block number. + */ +daddr64_t buf_blkno(buf_t); + +/*! + @function buf_lblkno + @abstract Get logical block number associated with a buffer. + @discussion Logical block number is set on traditionally-used buffers by an argument passed to buf_getblk(), + for example by buf_bread(). + @param bp Buffer whose logical block number to get. + @return Block number. + */ +daddr64_t buf_lblkno(buf_t); + +/*! + @function buf_setblkno + @abstract Set physical block number associated with a buffer. + @discussion Physical block number is generally set by the cluster layer or by buf_getblk(). + @param bp Buffer whose physical block number to set. + @param blkno Block number to set. + @return void. + */ +void buf_setblkno(buf_t, daddr64_t); + +/*! + @function buf_setlblkno + @abstract Set logical block number associated with a buffer. + @discussion Logical block number is set on traditionally-used buffers by an argument passed to buf_getblk(), + for example by buf_bread(). + @param bp Buffer whose logical block number to set. + @param lblkno Block number to set. + @return void. + */ +void buf_setlblkno(buf_t, daddr64_t); + +/*! + @function buf_count + @abstract Get count of valid bytes in a buffer. This may be less than the space allocated to the buffer. + @param bp Buffer whose byte count to get. + @return Byte count. + */ +uint32_t buf_count(buf_t); + +/*! + @function buf_size + @abstract Get size of data region allocated to a buffer. + @discussion May be larger than amount of valid data in buffer. + @param bp Buffer whose size to get. + @return Size. + */ +uint32_t buf_size(buf_t); + +/*! + @function buf_resid + @abstract Get a count of bytes which were not consumed by an I/O on a buffer. + @discussion Set when an I/O operations completes. + @param bp Buffer whose outstanding count to get. + @return Count of unwritten/unread bytes. + */ +uint32_t buf_resid(buf_t); + +/*! + @function buf_setcount + @abstract Set count of valid bytes in a buffer. This may be less than the space allocated to the buffer. + @param bp Buffer whose byte count to set. + @param bcount Count to set. + @return void. + */ +void buf_setcount(buf_t, uint32_t); + +/*! + @function buf_setsize + @abstract Set size of data region allocated to a buffer. + @discussion May be larger than amount of valid data in buffer. Should be used by + code which is manually providing storage for an iobuf, one allocated with buf_alloc(). + @param bp Buffer whose size to set. + @return void. + */ +void buf_setsize(buf_t, uint32_t); + +/*! + @function buf_setresid + @abstract Set a count of bytes outstanding for I/O in a buffer. + @discussion Set when an I/O operations completes. Examples: called by IOStorageFamily when I/O + completes, often called on an "original" buffer when using a manipulated buffer to perform I/O + on behalf of the first. + @param bp Buffer whose outstanding count to set. + @return Count of unwritten/unread bytes. + */ +void buf_setresid(buf_t, uint32_t); + +/*! + @function buf_setdataptr + @abstract Set the address at which a buffer's data will be stored. + @discussion In traditional buffer use, the data pointer will be set automatically. This routine is + useful with iobufs (allocated with buf_alloc()). + @param bp Buffer whose data pointer to set. + @param data Pointer to data region. + @return void. + */ +void buf_setdataptr(buf_t, uintptr_t); + +/*! + @function buf_dataptr + @abstract Get the address at which a buffer's data is stored; for iobufs, this must + be set with buf_setdataptr(). See buf_map(). + @param bp Buffer whose data pointer to retrieve. + @return Data pointer; NULL if unset. + */ +uintptr_t buf_dataptr(buf_t); + +/*! + @function buf_vnode + @abstract Get the vnode associated with a buffer. + @discussion Every buffer is associated with a file. Because there is an I/O in flight, + there is an iocount on this vnode; it is returned WITHOUT an extra iocount, and vnode_put() + need NOT be called. + @param bp Buffer whose vnode to retrieve. + @return Buffer's vnode. + */ +vnode_t buf_vnode(buf_t); + +/*! + @function buf_setvnode + @abstract Set the vnode associated with a buffer. + @discussion This call need not be used on traditional buffers; it is for use with iobufs. + @param bp Buffer whose vnode to set. + @param vp The vnode to attach to the buffer. + @return void. + */ +void buf_setvnode(buf_t, vnode_t); + +/*! + @function buf_setdevice + @abstract Set the device associated with a buffer. + @discussion A buffer's device is set in buf_strategy() (or in buf_getblk() if the file is a device). + It is also set on an iobuf if buf_alloc() is passed a device vnode. + @param bp Buffer whose device ID to set. + @param vp Device to set on the buffer. + @return 0 for success, EINVAL if vp is not a device file. + */ +errno_t buf_setdevice(buf_t, vnode_t); + +/*! + @function buf_strategy + @abstract Pass an I/O request for a buffer down to the device layer. + @discussion This is one of the most important routines in the buffer cache layer. For buffers obtained + through buf_getblk, it handles finding physical block numbers for the I/O (with VNOP_BLKTOOFF and + VNOP_BLOCKMAP), packaging the I/O into page-sized chunks, and initiating I/O on the disk by calling + the device's strategy routine. If a buffer's UPL has been set manually with buf_setupl(), it assumes + that the request is already correctly configured with a block number and a size divisible by page size + and will just call directly to the device. + @param devvp Device on which to perform I/O + @param ap vnop_strategy_args structure (most importantly, a buffer). + @return 0 for success, or errors from filesystem or device layers. + */ +errno_t buf_strategy(vnode_t, void *); + +/* + * Flags for buf_invalblkno() + */ +#define BUF_WAIT 0x01 + +/*! + @function buf_invalblkno + @abstract Invalidate a filesystem logical block in a file. + @discussion buf_invalblkno() tries to make the data for a given block in a file + invalid; if the buffer for that block is found in core and is not busy, we mark it + invalid and call buf_brelse() (see "flags" param for what happens if the buffer is busy). + buf_brelse(), noticing that it is invalid, will + will return the buffer to the empty-buffer list and tell the VM subsystem to abandon + the relevant pages. Data will not be written to backing store--it will be cast aside. + Note that this function will only work if the block in question has been + obtained with a buf_getblk(). If data has been read into core without using + traditional buffer cache routines, buf_invalblkno() will not be able to invalidate it--this + includes the use of iobufs. + @param bp Buffer whose block to invalidate. + @param lblkno Logical block number. + @param flags BUF_WAIT: wait for busy buffers to become unbusy and invalidate them then. Otherwise, + just return EBUSY for busy blocks. + @return 0 for success, EINVAL if vp is not a device file. + */ +errno_t buf_invalblkno(vnode_t, daddr64_t, int); + +/*! + @function buf_callback + @abstract Get the function set to be called when I/O on a buffer completes. + @discussion A function returned by buf_callback was originally set with buf_setcallback(). + @param bp Buffer whose callback to get. + @return 0 for success, or errors from filesystem or device layers. + */ +void * buf_callback(buf_t); + +/*! + @function buf_setcallback + @abstract Set a function to be called once when I/O on a buffer completes. + @discussion A one-shot callout set with buf_setcallback() will be called from buf_biodone() + when I/O completes. It will be passed the "transaction" argument as well as the buffer. + buf_setcallback() also marks the buffer as B_ASYNC. + @param bp Buffer whose callback to set. + @param callback function to use as callback. + @param transaction Additional argument to callback function. + @return 0; always succeeds. + */ +errno_t buf_setcallback(buf_t, void (*)(buf_t, void *), void *); + +/*! + @function buf_setupl + @abstract Set the UPL (Universal Page List), and offset therein, on a buffer. + @discussion buf_setupl() should only be called on buffers allocated with buf_alloc(). + A subsequent call to buf_map() will map the UPL and give back the address at which data + begins. After buf_setupl() is called, a buffer is marked B_CLUSTER; when this is the case, + buf_strategy() assumes that a buffer is correctly configured to be passed to the device + layer without modification. Passing a NULL upl will clear the upl and the B_CLUSTER flag on the + buffer. + @param bp Buffer whose upl to set. + @param upl UPL to set in the buffer. + @parma offset Offset within upl at which relevant data begin. + @return 0 for success, EINVAL if the buffer was not allocated with buf_alloc(). + */ +errno_t buf_setupl(buf_t, upl_t, uint32_t); + +/*! + @function buf_clone + @abstract Clone a buffer with a restricted range and an optional callback. + @discussion Generates a buffer which is identical to its "bp" argument except that + it spans a subset of the data of the original. The buffer to be cloned should + have been allocated with buf_alloc(). Checks its arguments to make sure + that the data subset is coherent. Optionally, adds a callback function and argument to it + to be called when I/O completes (as with buf_setcallback(), but B_ASYNC is not set). If the original buffer had + a upl set through buf_setupl(), this upl is copied to the new buffer; otherwise, the original's + data pointer is used raw. The buffer must be released with buf_free(). + @param bp Buffer to clone. + @param io_offset Offset, relative to start of data in original buffer, at which new buffer's data will begin. + @param io_size Size of buffer region in new buffer, in the sense of buf_count(). + @param iodone Callback to be called from buf_biodone() when I/O completes, in the sense of buf_setcallback(). + @param arg Argument to pass to iodone() callback. + @return NULL if io_offset/io_size combination is invalid for the buffer to be cloned; otherwise, the new buffer. + */ +buf_t buf_clone(buf_t, int, int, void (*)(buf_t, void *), void *); + +/*! + @function buf_alloc + @abstract Allocate an uninitialized buffer. + @discussion A buffer returned by buf_alloc() is marked as busy and as an iobuf; it has no storage set up and must be + set up using buf_setdataptr() or buf_setupl()/buf_map(). + @param vp vnode to associate with the buffer: optionally NULL. If vp is a device file, then + the buffer's associated device will be set. If vp is NULL, it can be set later with buf_setvnode(). + @return New buffer. + */ +buf_t buf_alloc(vnode_t); + +/*! + @function buf_free + @abstract Free a buffer that was allocated with buf_alloc(). + @discussion The storage (UPL, data pointer) associated with an iobuf must be freed manually. + @param bp The buffer to free. + @return void. + */ +void buf_free(buf_t); + +/* + * flags for buf_invalidateblks + */ +#define BUF_WRITE_DATA 0x0001 /* write data blocks first */ +#define BUF_SKIP_META 0x0002 /* skip over metadata blocks */ + +/*! + @function buf_invalidateblks + @abstract Invalidate all the blocks associated with a vnode. + @discussion This function does for all blocks associated with a vnode what buf_invalblkno does for one block. + Again, it will only be able to invalidate data which were populated with traditional buffer cache routines, + i.e. by buf_getblk() and callers thereof. Unlike buf_invalblkno(), it can be made to write dirty data to disk + rather than casting it aside. + @param bp The buffer whose data to invalidate. + @param flags BUF_WRITE_DATA: write dirty data to disk with VNOP_BWRITE() before kicking buffer cache entries out. + BUF_SKIP_META: do not invalidate metadata blocks. + @param slpflag Flags to pass to "msleep" while waiting to acquire busy buffers. + @param slptimeo Timeout in "hz" (1/100 second) to wait for a buffer to become unbusy before waking from sleep + and re-starting the scan. + @return 0 for success, error values from msleep(). + */ +int buf_invalidateblks(vnode_t, int, int, int); + +/* + * flags for buf_flushdirtyblks and buf_iterate + */ +#define BUF_SKIP_NONLOCKED 0x01 +#define BUF_SKIP_LOCKED 0x02 +#define BUF_SCAN_CLEAN 0x04 /* scan the clean buffers */ +#define BUF_SCAN_DIRTY 0x08 /* scan the dirty buffers */ +#define BUF_NOTIFY_BUSY 0x10 /* notify the caller about the busy pages during the scan */ + + +#define BUF_RETURNED 0 +#define BUF_RETURNED_DONE 1 +#define BUF_CLAIMED 2 +#define BUF_CLAIMED_DONE 3 +/*! + @function buf_flushdirtyblks + @abstract Write dirty file blocks to disk. + @param vp The vnode whose blocks to flush. + @param wait Wait for writes to complete before returning. + @param flags Can pass zero, meaning "flush all dirty buffers." + BUF_SKIP_NONLOCKED: Skip buffers which are not busy when we encounter them. + BUF_SKIP_LOCKED: Skip buffers which are busy when we encounter them. + @param msg String to pass to msleep(). + @return void. + */ +void buf_flushdirtyblks(vnode_t, int, int, const char *); + +/*! + @function buf_iterate + @abstract Perform some operation on all buffers associated with a vnode. + @param vp The vnode whose buffers to scan. + @param callout Function to call on each buffer. Should return one of: + BUF_RETURNED: buf_iterate() should call buf_brelse() on the buffer. + BUF_RETURNED_DONE: buf_iterate() should call buf_brelse() on the buffer and then stop iterating. + BUF_CLAIMED: buf_iterate() should continue iterating (and not call buf_brelse()). + BUF_CLAIMED_DONE: buf_iterate() should stop iterating (and not call buf_brelse()). + @param flag + BUF_SKIP_NONLOCKED: Skip buffers which are not busy when we encounter them. BUF_SKIP_LOCKED: Skip buffers which are busy when we encounter them. + BUF_SCAN_CLEAN: Call out on clean buffers. + BUF_SCAN_DIRTY: Call out on dirty buffers. + BUF_NOTIFY_BUSY: If a buffer cannot be acquired, pass a NULL buffer to callout; otherwise, + that buffer will be silently skipped. + @param arg Argument to pass to callout in addition to buffer. + @return void. + */ +void buf_iterate(vnode_t, int (*)(buf_t, void *), int, void *); + +/*! + @function buf_clear + @abstract Zero out the storage associated with a buffer. + @discussion Calls buf_map() to get the buffer's data address; for a B_CLUSTER + buffer (one which has had buf_setupl() called on it), it tries to map the buffer's + UPL into memory; should only be called once during the life cycle of an iobuf (one allocated + with buf_alloc()). + @param bp The buffer to zero out. + @return void. + */ +void buf_clear(buf_t); + +/*! + @function buf_bawrite + @abstract Start an asychronous write on a buffer. + @discussion Calls VNOP_BWRITE to start the process of propagating an asynchronous write down to the device layer. + Callers can wait for writes to complete at their discretion using buf_biowait(). When this function is called, + data should already have been written to the buffer's data region. + @param bp The buffer on which to initiate I/O. + @param throttle If "throttle" is nonzero and more than VNODE_ASYNC_THROTTLE writes are in progress on this file, + buf_bawrite() will block until the write count drops below VNODE_ASYNC_THROTTLE. If "throttle" is zero and the write + count is high, it will fail with EWOULDBLOCK; the caller can decide whether to make a blocking call or pursue + other opportunities. + @return EWOULDBLOCK if write count is high and "throttle" is zero; otherwise, errors from VNOP_BWRITE. + */ +errno_t buf_bawrite(buf_t); + +/*! + @function buf_bdwrite + @abstract Mark a buffer for delayed write. + @discussion Marks a buffer as waiting for delayed write and the current I/O as complete; data will be written to backing store + before the buffer is reused, but it will not be queued for I/O immediately. Note that for buffers allocated + with buf_alloc(), there are no such guarantees; you must take care of your own flushing to disk. If + the number of delayed writes pending on the system is greater than an internal limit and the caller has not + requested otherwise [see return_error] , buf_bdwrite() will unilaterally launch an asynchronous I/O with buf_bawrite() to keep the pile of + delayed writes from getting too large. + @param bp The buffer to mark for delayed write. + @param return_error If the number of pending delayed writes systemwide is larger than an internal limit, + return EAGAIN rather than doing an asynchronous write. + @return EAGAIN for return_error != 0 case, 0 for succeess, errors from buf_bawrite. + */ +errno_t buf_bdwrite(buf_t); + +/*! + @function buf_bwrite + @abstract Write a buffer's data to backing store. + @discussion Once the data in a buffer has been modified, buf_bwrite() starts sending it to disk by calling + VNOP_STRATEGY. Unless B_ASYNC has been set on the buffer (by buf_setflags() or otherwise), data will have + been written to disk when buf_bwrite() returns. See Bach (p 56). + @param bp The buffer to write to disk. + @return 0 for success; errors from buf_biowait(). + */ +errno_t buf_bwrite(buf_t); + +/*! + @function buf_biodone + @abstract Mark an I/O as completed. + @discussion buf_biodone() should be called by whosoever decides that an I/O on a buffer is complete; for example, + IOStorageFamily. It clears the dirty flag on a buffer and signals on the vnode that a write has completed + with vnode_writedone(). If a callout or filter has been set on the buffer, that function is called. In the case + of a callout, that function is expected to take care of cleaning up and freeing the buffer. + Otherwise, if the buffer is marked B_ASYNC (e.g. it was passed to buf_bawrite()), then buf_biodone() + considers itself justified in calling buf_brelse() to return it to free lists--no one is waiting for it. Finally, + waiters on the bp (e.g. in buf_biowait()) are woken up. + @param bp The buffer to mark as done with I/O. + @return void. + */ +void buf_biodone(buf_t); + +/*! + @function buf_biowait + @abstract Wait for I/O on a buffer to complete. + @discussion Waits for I/O on a buffer to finish, as marked by a buf_biodone() call. + @param bp The buffer to wait on. + @return 0 for a successful wait; nonzero the buffer has been marked as EINTR or had an error set on it. + */ +errno_t buf_biowait(buf_t); + +/*! + @function buf_brelse + @abstract Release any claim to a buffer, sending it back to free lists. + @discussion buf_brelse() cleans up buffer state and releases a buffer to the free lists. If the buffer + is not marked invalid and its pages are dirty (e.g. a delayed write was made), its data will be commited + to backing store. If it is marked invalid, its data will be discarded completely. + A valid, cacheable buffer will be put on a list and kept in the buffer hash so it + can be found again; otherwise, it will be dissociated from its vnode and treated as empty. Which list a valid + buffer is placed on depends on the use of buf_markaged(), whether it is metadata, and the B_LOCKED flag. A + B_LOCKED buffer will not be available for reuse by other files, though its data may be paged out. + Note that buf_brelse() is intended for use with traditionally allocated buffers. + @param bp The buffer to release. + @retrn void. + */ +void buf_brelse(buf_t); + +/*! + @function minphys + @abstract Adjust a buffer's count to be no more than maximum physical I/O transfer size for the host architecture. + @discussion physio() takes as a parameter a function to bound transfer sizes for each VNOP_STRATEGY() call. minphys() + is a default implementation. It calls buf_setcount() to make the buffer's count the min() of its current count + and the max I/O size for the host architecture. + @param bp The buffer whose byte count to modify. + @return New byte count. + */ +u_int minphys(buf_t bp); + +/* + * Flags for operation type in getblk() + */ +#define BLK_READ 0x01 /* buffer for read */ +#define BLK_WRITE 0x02 /* buffer for write */ +#define BLK_META 0x10 /* buffer for metadata */ +/* + * modifier for above flags... if set, getblk will only return + * a bp that is already valid... i.e. found in the cache + */ +#define BLK_ONLYVALID 0x80000000 + +/*! + @function buf_getblk + @abstract Traditional buffer cache routine to get a buffer corresponding to a logical block in a file. + @discussion buf_getblk() gets a buffer, not necessarily containing valid data, representing a block in a file. + A metadata buffer will be returned with its own zone-allocated storage, managed by the traditional buffer-cache + layer, whereas data buffers will be returned hooked into backing by the UBC (which in fact controls the caching of data). + buf_getblk() first looks for the buffer header in cache; if the buffer is in-core but busy, buf_getblk() will wait for it to become + unbusy, depending on the slpflag and slptimeo parameters. If the buffer is found unbusy and is a metadata buffer, + it must already contain valid data and will be returned directly; data buffers will have a UPL configured to + prepare for interaction with the underlying UBC. If the buffer is found in core, it will be marked as such + and buf_fromcache() will return truth. A buffer is allocated and initialized (but not filled with data) + if none is found in core. buf_bread(), buf_breadn(), buf_meta_bread(), and buf_meta_breadn() all + return buffers obtained with buf_getblk(). + @param vp File for which to get block. + @param blkno Logical block number. + @param size Size of block. + @param slpflag Flag to pass to msleep() while waiting for buffer to become unbusy. + @param slptimeo Time, in milliseconds, to wait for buffer to become unbusy. 0 means to wait indefinitely. + @param operation BLK_READ: want a read buffer. BLK_WRITE: want a write buffer. BLK_META: want a metadata buffer. BLK_ONLYVALID: + only return buffers which are found in core (do not allocate anew), and do not change buffer size. The last remark means + that if a given logical block is found in core with a different size than what is requested, the buffer size will not be modified. + @return Buffer found in core or newly allocated, either containing valid data or ready for I/O. + */ +buf_t buf_getblk(vnode_t, daddr64_t, int, int, int, int); + +/*! + @function buf_geteblk + @abstract Get a metadata buffer which is marked invalid and not associated with any vnode. + @discussion A buffer is returned with zone-allocated storage of the specified size, marked B_META and invalid. + It has no vnode and is not visible in the buffer hash. + @param size Size of buffer. + @return Always returns a new buffer. + */ +buf_t buf_geteblk(int); + + +__END_DECLS + + +/* Macros to clear/set/test flags. */ +#define SET(t, f) (t) |= (f) +#define CLR(t, f) (t) &= ~(f) +#define ISSET(t, f) ((t) & (f)) + + +#endif /* !_SYS_BUF_H_ */ diff --git a/i386/include/sys/cdefs.h b/i386/include/sys/cdefs.h new file mode 100644 index 0000000..3240187 --- /dev/null +++ b/i386/include/sys/cdefs.h @@ -0,0 +1,583 @@ +/* + * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright 1995 NeXT Computer, Inc. All rights reserved. */ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 + */ + +#ifndef _CDEFS_H_ +#define _CDEFS_H_ + +#if defined(__cplusplus) +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif + +/* + * The __CONCAT macro is used to concatenate parts of symbol names, e.g. + * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * The __CONCAT macro is a bit tricky -- make sure you don't put spaces + * in between its arguments. __CONCAT can also concatenate double-quoted + * strings produced by the __STRING macro, but this only works with ANSI C. + */ +#if defined(__STDC__) || defined(__cplusplus) +#define __P(protos) protos /* full-blown ANSI C */ +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +#define __const const /* define reserved names to standard */ +#define __signed signed +#define __volatile volatile +#if defined(__cplusplus) +#define __inline inline /* convert to C++ keyword */ +#else +#ifndef __GNUC__ +#define __inline /* delete GCC keyword */ +#endif /* !__GNUC__ */ +#endif /* !__cplusplus */ + +#else /* !(__STDC__ || __cplusplus) */ +#define __P(protos) () /* traditional C preprocessor */ +#define __CONCAT(x,y) x/**/y +#define __STRING(x) "x" + +#ifndef __GNUC__ +#define __const /* delete pseudo-ANSI C keywords */ +#define __inline +#define __signed +#define __volatile +#endif /* !__GNUC__ */ + +/* + * In non-ANSI C environments, new programs will want ANSI-only C keywords + * deleted from the program and old programs will want them left alone. + * When using a compiler other than gcc, programs using the ANSI C keywords + * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. + * When using "gcc -traditional", we assume that this is the intent; if + * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. + */ +#ifndef NO_ANSI_KEYWORDS +#define const __const /* convert ANSI C keywords */ +#define inline __inline +#define signed __signed +#define volatile __volatile +#endif /* !NO_ANSI_KEYWORDS */ +#endif /* !(__STDC__ || __cplusplus) */ + +/* + * GCC1 and some versions of GCC2 declare dead (non-returning) and + * pure (no side effects) functions using "volatile" and "const"; + * unfortunately, these then cause warnings under "-ansi -pedantic". + * GCC2 uses a new, peculiar __attribute__((attrs)) style. All of + * these work for GNU C++ (modulo a slight glitch in the C++ grammar + * in the distribution version of 2.5.5). + */ +#if defined(__MWERKS__) && (__MWERKS__ > 0x2400) + /* newer Metrowerks compilers support __attribute__() */ +#elif __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 5 +#define __dead2 __attribute__((__noreturn__)) +#define __pure2 __attribute__((__const__)) +#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 +#define __unused /* no attribute */ +#else +#define __unused __attribute__((__unused__)) +#endif +#else +#define __attribute__(x) /* delete __attribute__ if non-gcc or gcc1 */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +/* __dead and __pure are depreciated. Use __dead2 and __pure2 instead */ +#define __dead __volatile +#define __pure __const +#endif +#endif + +/* Delete pseudo-keywords wherever they are not available or needed. */ +#ifndef __dead +#define __dead +#define __pure +#endif +#ifndef __dead2 +#define __dead2 +#define __pure2 +#define __unused +#endif + +/* + * GCC 2.95 provides `__restrict' as an extension to C90 to support the + * C99-specific `restrict' type qualifier. We happen to use `__restrict' as + * a way to define the `restrict' type qualifier without disturbing older + * software that is unaware of C99 keywords. + */ +#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) +#if __STDC_VERSION__ < 199901 +#define __restrict +#else +#define __restrict restrict +#endif +#endif + +/* + * Compiler-dependent macros to declare that functions take printf-like + * or scanf-like arguments. They are null except for versions of gcc + * that are known to support the features properly. Functions declared + * with these attributes will cause compilation warnings if there is a + * mismatch between the format string and subsequent function parameter + * types. + */ +#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 +#define __printflike(fmtarg, firstvararg) \ + __attribute__((__format__ (__printf__, fmtarg, firstvararg))) +#define __scanflike(fmtarg, firstvararg) \ + __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) +#else +#define __printflike(fmtarg, firstvararg) +#define __scanflike(fmtarg, firstvararg) +#endif + +#define __IDSTRING(name,string) static const char name[] __unused = string + +#ifndef __COPYRIGHT +#define __COPYRIGHT(s) __IDSTRING(copyright,s) +#endif + +#ifndef __RCSID +#define __RCSID(s) __IDSTRING(rcsid,s) +#endif + +#ifndef __SCCSID +#define __SCCSID(s) __IDSTRING(sccsid,s) +#endif + +#ifndef __PROJECT_VERSION +#define __PROJECT_VERSION(s) __IDSTRING(project_version,s) +#endif + +/* + * COMPILATION ENVIRONMENTS + * + * DEFAULT By default newly complied code will get POSIX APIs plus + * Apple API extensions in scope. + * + * Most users will use this compilation environment to avoid + * behavioral differences between 32 and 64 bit code. + * + * LEGACY Defining _NONSTD_SOURCE will get pre-POSIX APIs plus Apple + * API extensions in scope. + * + * This is generally equivalent to the Tiger release compilation + * environment, except that it cannot be applied to 64 bit code; + * its use is discouraged. + * + * We expect this environment to be deprecated in the future. + * + * STRICT Defining _POSIX_C_SOURCE or _XOPEN_SOURCE restricts the + * available APIs to exactly the set of APIs defined by the + * corresponding standard, based on the value defined. + * + * A correct, portable definition for _POSIX_C_SOURCE is 200112L. + * A correct, portable definition for _XOPEN_SOURCE is 600L. + * + * Apple API extensions are not visible in this environment, + * which can cause Apple specific code to fail to compile, + * or behave incorrectly if prototypes are not in scope or + * warnings about missing prototypes are not enabled or ignored. + * + * In any compilation environment, for correct symbol resolution to occur, + * function prototypes must be in scope. It is recommended that all Apple + * tools users add either the "-Wall" or "-Wimplicit-function-declaration" + * compiler flags to their projects to be warned when a function is being + * used without a prototype in scope. + */ + +/* These settings are particular to each product. */ +/* Product: MacOSX */ +#define __DARWIN_ONLY_64_BIT_INO_T 0 +/* #undef __DARWIN_ONLY_UNIX_CONFORMANCE (automatically set for 64-bit) */ +#define __DARWIN_ONLY_VERS_1050 0 + +/* + * The __DARWIN_ALIAS macros are used to do symbol renaming; they allow + * legacy code to use the old symbol, thus maintaining binary compatibility + * while new code can use a standards compliant version of the same function. + * + * __DARWIN_ALIAS is used by itself if the function signature has not + * changed, it is used along with a #ifdef check for __DARWIN_UNIX03 + * if the signature has changed. Because the __LP64__ environment + * only supports UNIX03 semantics it causes __DARWIN_UNIX03 to be + * defined, but causes __DARWIN_ALIAS to do no symbol mangling. + * + * As a special case, when XCode is used to target a specific version of the + * OS, the manifest constant __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + * will be defined by the compiler, with the digits representing major version + * time 100 + minor version times 10 (e.g. 10.5 := 1050). If we are targeting + * pre-10.5, and it is the default compilation environment, revert the + * compilation environment to pre-__DARWIN_UNIX03. + */ +#if !defined(__DARWIN_ONLY_UNIX_CONFORMANCE) +# if defined(__LP64__) +# define __DARWIN_ONLY_UNIX_CONFORMANCE 1 +# else /* !__LP64__ */ +# define __DARWIN_ONLY_UNIX_CONFORMANCE 0 +# endif /* __LP64__ */ +#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ + +#if !defined(__DARWIN_UNIX03) +# if __DARWIN_ONLY_UNIX_CONFORMANCE +# if defined(_NONSTD_SOURCE) +# error "Can't define _NONSTD_SOURCE when only UNIX conformance is available." +# endif /* _NONSTD_SOURCE */ +# define __DARWIN_UNIX03 1 +# elif defined(_DARWIN_C_SOURCE) || defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE) +# if defined(_NONSTD_SOURCE) +# error "Can't define both _NONSTD_SOURCE and any of _DARWIN_C_SOURCE, _XOPEN_SOURCE or _POSIX_C_SOURCE." +# endif /* _NONSTD_SOURCE */ +# define __DARWIN_UNIX03 1 +# elif defined(_NONSTD_SOURCE) +# define __DARWIN_UNIX03 0 +# else /* default */ +# if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) +# define __DARWIN_UNIX03 0 +# else /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */ +# define __DARWIN_UNIX03 1 +# endif /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 */ +# endif /* _DARWIN_C_SOURCE || _XOPEN_SOURCE || _POSIX_C_SOURCE || __LP64__ */ +#endif /* !__DARWIN_UNIX03 */ + +#if !defined(__DARWIN_64_BIT_INO_T) +# if defined(_DARWIN_USE_64_BIT_INODE) +# if defined(_DARWIN_NO_64_BIT_INODE) +# error "Can't define both _DARWIN_USE_64_BIT_INODE and _DARWIN_NO_64_BIT_INODE." +# endif /* _DARWIN_NO_64_BIT_INODE */ +# define __DARWIN_64_BIT_INO_T 1 +# elif defined(_DARWIN_NO_64_BIT_INODE) +# if __DARWIN_ONLY_64_BIT_INO_T +# error "Can't define _DARWIN_NO_64_BIT_INODE when only 64-bit inodes are available." +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# define __DARWIN_64_BIT_INO_T 0 +# else /* default */ +# if __DARWIN_ONLY_64_BIT_INO_T +# define __DARWIN_64_BIT_INO_T 1 +# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1060) || __DARWIN_UNIX03 == 0 +# define __DARWIN_64_BIT_INO_T 0 +# else /* default */ +# define __DARWIN_64_BIT_INO_T 1 +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# endif +#endif /* !__DARWIN_64_BIT_INO_T */ + +#if !defined(__DARWIN_VERS_1050) +# if __DARWIN_ONLY_VERS_1050 +# define __DARWIN_VERS_1050 1 +# elif defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050) || __DARWIN_UNIX03 == 0 +# define __DARWIN_VERS_1050 0 +# else /* default */ +# define __DARWIN_VERS_1050 1 +# endif +#endif /* !__DARWIN_VERS_1050 */ + +#if !defined(__DARWIN_NON_CANCELABLE) +# define __DARWIN_NON_CANCELABLE 0 +#endif /* !__DARWIN_NON_CANCELABLE */ + +/* + * symbol suffixes used for symbol versioning + */ +#if __DARWIN_UNIX03 +# if __DARWIN_ONLY_UNIX_CONFORMANCE +# define __DARWIN_SUF_UNIX03 /* nothing */ +# else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */ +# define __DARWIN_SUF_UNIX03 "$UNIX2003" +# endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */ + +# if __DARWIN_64_BIT_INO_T +# if __DARWIN_ONLY_64_BIT_INO_T +# define __DARWIN_SUF_64_BIT_INO_T /* nothing */ +# else /* !__DARWIN_ONLY_64_BIT_INO_T */ +# define __DARWIN_SUF_64_BIT_INO_T "$INODE64" +# endif /* __DARWIN_ONLY_64_BIT_INO_T */ +# else /* !__DARWIN_64_BIT_INO_T */ +# define __DARWIN_SUF_64_BIT_INO_T /* nothing */ +# endif /* __DARWIN_64_BIT_INO_T */ + +# if __DARWIN_VERS_1050 +# if __DARWIN_ONLY_VERS_1050 +# define __DARWIN_SUF_1050 /* nothing */ +# else /* !__DARWIN_ONLY_VERS_1050 */ +# define __DARWIN_SUF_1050 "$1050" +# endif /* __DARWIN_ONLY_VERS_1050 */ +# else /* !__DARWIN_VERS_1050 */ +# define __DARWIN_SUF_1050 /* nothing */ +# endif /* __DARWIN_VERS_1050 */ + +# if __DARWIN_NON_CANCELABLE +# define __DARWIN_SUF_NON_CANCELABLE "$NOCANCEL" +# else /* !__DARWIN_NON_CANCELABLE */ +# define __DARWIN_SUF_NON_CANCELABLE /* nothing */ +# endif /* __DARWIN_NON_CANCELABLE */ + +#else /* !__DARWIN_UNIX03 */ +# define __DARWIN_SUF_UNIX03 /* nothing */ +# define __DARWIN_SUF_64_BIT_INO_T /* nothing */ +# define __DARWIN_SUF_NON_CANCELABLE /* nothing */ +# define __DARWIN_SUF_1050 /* nothing */ +#endif /* __DARWIN_UNIX03 */ + +#define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN" + +/* + * symbol versioning macros + */ +#define __DARWIN_ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_UNIX03) +#define __DARWIN_ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03) +#define __DARWIN_ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03) +#define __DARWIN_INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T) + +#define __DARWIN_1050(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050) +#define __DARWIN_1050ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_UNIX03) +#define __DARWIN_1050ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03) +#define __DARWIN_1050ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03) +#define __DARWIN_1050INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T) + +#define __DARWIN_EXTSN(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN) +#define __DARWIN_EXTSN_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN __DARWIN_SUF_NON_CANCELABLE) + +/* + * symbol release macros + */ +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1060) +#undef __DARWIN_10_6_AND_LATER +#define __DARWIN_10_6_AND_LATER_ALIAS(x) /* nothing */ +#else /* 10.6 and beyond */ +#define __DARWIN_10_6_AND_LATER +#define __DARWIN_10_6_AND_LATER_ALIAS(x) x +#endif + + +/* + * POSIX.1 requires that the macros we test be defined before any standard + * header file is included. This permits us to convert values for feature + * testing, as necessary, using only _POSIX_C_SOURCE. + * + * Here's a quick run-down of the versions: + * defined(_POSIX_SOURCE) 1003.1-1988 + * _POSIX_C_SOURCE == 1L 1003.1-1990 + * _POSIX_C_SOURCE == 2L 1003.2-1992 C Language Binding Option + * _POSIX_C_SOURCE == 199309L 1003.1b-1993 + * _POSIX_C_SOURCE == 199506L 1003.1c-1995, 1003.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + * _POSIX_C_SOURCE == 200112L 1003.1-2001 + * + * In addition, the X/Open Portability Guide, which is now the Single UNIX + * Specification, defines a feature-test macro which indicates the version of + * that specification, and which subsumes _POSIX_C_SOURCE. + */ + +/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1L. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199009L +#endif + +/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2L. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199209L +#endif + +/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ +#ifdef _XOPEN_SOURCE +#if _XOPEN_SOURCE - 0L >= 600L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112L +#elif _XOPEN_SOURCE - 0L >= 500L +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199506L +#endif +#endif + +/* + * Deal with all versions of POSIX. The ordering relative to the tests above is + * important. + */ +#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 198808L +#endif + +/* + * long long is not supported in c89 (__STRICT_ANSI__), but g++ -ansi and + * c99 still want long longs. While not perfect, we allow long longs for + * g++. + */ +#define __DARWIN_NO_LONG_LONG (defined(__STRICT_ANSI__) \ + && (__STDC_VERSION__-0 < 199901L) \ + && !defined(__GNUG__)) + +/* + * Long double compatibility macro allow selecting variant symbols based + * on the old (compatible) 64-bit long doubles, or the new 128-bit + * long doubles. This applies only to ppc; i386 already has long double + * support, while ppc64 doesn't have any backwards history. + */ +#if defined(__arm__) +# define __DARWIN_LDBL_COMPAT(x) /* nothing */ +# define __DARWIN_LDBL_COMPAT2(x) /* nothing */ +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 1 +#elif defined(__ppc__) +# if defined(__LDBL_MANT_DIG__) && defined(__DBL_MANT_DIG__) && \ + __LDBL_MANT_DIG__ > __DBL_MANT_DIG__ +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 < 1040 +# define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBLStub") +# else +# define __DARWIN_LDBL_COMPAT(x) __asm("_" __STRING(x) "$LDBL128") +# endif +# define __DARWIN_LDBL_COMPAT2(x) __asm("_" __STRING(x) "$LDBL128") +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 0 +# else +# define __DARWIN_LDBL_COMPAT(x) /* nothing */ +# define __DARWIN_LDBL_COMPAT2(x) /* nothing */ +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 1 +# endif +#elif defined(__i386__) || defined(__ppc64__) || defined(__x86_64__) +# define __DARWIN_LDBL_COMPAT(x) /* nothing */ +# define __DARWIN_LDBL_COMPAT2(x) /* nothing */ +# define __DARWIN_LONG_DOUBLE_IS_DOUBLE 0 +#else +# error Unknown architecture +#endif + +/* + * Deprecation macro + */ +#if __GNUC__ >= 3 +#define __deprecated __attribute__((deprecated)) +#else +#define __deprecated /* nothing */ +#endif + +/***************************************** + * Public darwin-specific feature macros + *****************************************/ + +/* + * _DARWIN_FEATURE_64_BIT_INODE indicates that the ino_t type is 64-bit, and + * structures modified for 64-bit inodes (like struct stat) will be used. + */ +#if __DARWIN_64_BIT_INO_T +#define _DARWIN_FEATURE_64_BIT_INODE 1 +#endif + +/* + * _DARWIN_FEATURE_LONG_DOUBLE_IS_DOUBLE indicates when the long double type + * is the same as the double type (ppc and arm only) + */ +#if __DARWIN_LONG_DOUBLE_IS_DOUBLE +#define _DARWIN_FEATURE_LONG_DOUBLE_IS_DOUBLE 1 +#endif + +/* + * _DARWIN_FEATURE_64_ONLY_BIT_INODE indicates that the ino_t type may only + * be 64-bit; there is no support for 32-bit ino_t when this macro is defined + * (and non-zero). There is no struct stat64 either, as the regular + * struct stat will already be the 64-bit version. + */ +#if __DARWIN_ONLY_64_BIT_INO_T +#define _DARWIN_FEATURE_ONLY_64_BIT_INODE 1 +#endif + +/* + * _DARWIN_FEATURE_ONLY_VERS_1050 indicates that only those APIs updated + * in 10.5 exists; no pre-10.5 variants are available. + */ +#if __DARWIN_ONLY_VERS_1050 +#define _DARWIN_FEATURE_ONLY_VERS_1050 1 +#endif + +/* + * _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE indicates only UNIX conforming API + * are available (the legacy BSD APIs are not available) + */ +#if __DARWIN_ONLY_UNIX_CONFORMANCE +#define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1 +#endif + +/* + * _DARWIN_FEATURE_UNIX_CONFORMANCE indicates whether UNIX conformance is on, + * and specifies the conformance level (3 is SUSv3) + */ +#if __DARWIN_UNIX03 +#define _DARWIN_FEATURE_UNIX_CONFORMANCE 3 +#endif + +/* + * This macro casts away the qualifier from the variable + * + * Note: use at your own risk, removing qualifiers can result in + * catastrophic run-time failures. + */ +#ifndef __CAST_AWAY_QUALIFIER +#define __CAST_AWAY_QUALIFIER(variable, qualifier, type) (type) ((char *)0 + ((qualifier char *)(variable) - (qualifier char *)0) ) +#endif + +#endif /* !_CDEFS_H_ */ diff --git a/i386/include/sys/disk.h b/i386/include/sys/disk.h new file mode 100644 index 0000000..bd61eb6 --- /dev/null +++ b/i386/include/sys/disk.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _SYS_DISK_H_ +#define _SYS_DISK_H_ + +#include <stdint.h> +//#include <sys/ioctl.h> + +/* + * Definitions + * + * ioctl description + * ------------------------------------- --------------------------------------- + * DKIOCEJECT eject media + * DKIOCSYNCHRONIZECACHE flush media + * + * DKIOCFORMAT format media + * DKIOCGETFORMATCAPACITIES get media's formattable capacities + * + * DKIOCGETBLOCKSIZE get media's block size + * DKIOCGETBLOCKCOUNT get media's block count + * DKIOCGETFIRMWAREPATH get media's firmware path + * + * DKIOCISFORMATTED is media formatted? + * DKIOCISWRITABLE is media writable? + * + * DKIOCREQUESTIDLE idle media + * DKIOCDISCARD delete unused data + * + * DKIOCGETMAXBLOCKCOUNTREAD get maximum block count for reads + * DKIOCGETMAXBLOCKCOUNTWRITE get maximum block count for writes + * DKIOCGETMAXBYTECOUNTREAD get maximum byte count for reads + * DKIOCGETMAXBYTECOUNTWRITE get maximum byte count for writes + * + * DKIOCGETMAXSEGMENTCOUNTREAD get maximum segment count for reads + * DKIOCGETMAXSEGMENTCOUNTWRITE get maximum segment count for writes + * DKIOCGETMAXSEGMENTBYTECOUNTREAD get maximum segment byte count for reads + * DKIOCGETMAXSEGMENTBYTECOUNTWRITE get maximum segment byte count for writes + * + * DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT get minimum segment alignment in bytes + * DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT get maximum segment width in bits + * + * DKIOCGETPHYSICALBLOCKSIZE get device's block size + * DKIOCGETCOMMANDPOOLSIZE get device's queue depth + */ + +typedef struct +{ + uint64_t offset; + uint64_t length; + + uint8_t reserved0128[16]; /* reserved, clear to zero */ +} dk_discard_t; + +typedef struct +{ + char path[128]; +} dk_firmware_path_t; + +typedef struct +{ + uint64_t blockCount; + uint32_t blockSize; + + uint8_t reserved0096[4]; /* reserved, clear to zero */ +} dk_format_capacity_t; + +typedef struct +{ + dk_format_capacity_t * capacities; + uint32_t capacitiesCount; /* use zero to probe count */ + +#ifdef __LP64__ + uint8_t reserved0096[4]; /* reserved, clear to zero */ +#else /* !__LP64__ */ + uint8_t reserved0064[8]; /* reserved, clear to zero */ +#endif /* !__LP64__ */ +} dk_format_capacities_t; + +#define DKIOCEJECT _IO('d', 21) +#define DKIOCSYNCHRONIZECACHE _IO('d', 22) + +#define DKIOCFORMAT _IOW('d', 26, dk_format_capacity_t) +#define DKIOCGETFORMATCAPACITIES _IOWR('d', 26, dk_format_capacities_t) + +#define DKIOCGETBLOCKSIZE _IOR('d', 24, uint32_t) +#define DKIOCGETBLOCKCOUNT _IOR('d', 25, uint64_t) +#define DKIOCGETFIRMWAREPATH _IOR('d', 28, dk_firmware_path_t) + +#define DKIOCISFORMATTED _IOR('d', 23, uint32_t) +#define DKIOCISWRITABLE _IOR('d', 29, uint32_t) + +#define DKIOCREQUESTIDLE _IO('d', 30) +#define DKIOCDISCARD _IOW('d', 31, dk_discard_t) + +#define DKIOCGETMAXBLOCKCOUNTREAD _IOR('d', 64, uint64_t) +#define DKIOCGETMAXBLOCKCOUNTWRITE _IOR('d', 65, uint64_t) +#define DKIOCGETMAXBYTECOUNTREAD _IOR('d', 70, uint64_t) +#define DKIOCGETMAXBYTECOUNTWRITE _IOR('d', 71, uint64_t) + +#define DKIOCGETMAXSEGMENTCOUNTREAD _IOR('d', 66, uint64_t) +#define DKIOCGETMAXSEGMENTCOUNTWRITE _IOR('d', 67, uint64_t) +#define DKIOCGETMAXSEGMENTBYTECOUNTREAD _IOR('d', 68, uint64_t) +#define DKIOCGETMAXSEGMENTBYTECOUNTWRITE _IOR('d', 69, uint64_t) + +#define DKIOCGETMINSEGMENTALIGNMENTBYTECOUNT _IOR('d', 74, uint64_t) +#define DKIOCGETMAXSEGMENTADDRESSABLEBITCOUNT _IOR('d', 75, uint64_t) + +#define DKIOCGETPHYSICALBLOCKSIZE _IOR('d', 77, uint32_t) +#define DKIOCGETCOMMANDPOOLSIZE _IOR('d', 78, uint32_t) + + +#endif /* _SYS_DISK_H_ */ diff --git a/i386/include/sys/kernel_types.h b/i386/include/sys/kernel_types.h new file mode 100644 index 0000000..7d7d709 --- /dev/null +++ b/i386/include/sys/kernel_types.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2004-2010 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _KERN_SYS_KERNELTYPES_H_ +#define _KERN_SYS_KERNELTYPES_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> +#include <stdint.h> + +#ifdef BSD_BUILD +/* Macros(?) to clear/set/test flags. */ +#define SET(t, f) (t) |= (f) +#define CLR(t, f) (t) &= ~(f) +#define ISSET(t, f) ((t) & (f)) +#endif + + +typedef int errno_t; +typedef int64_t daddr64_t; + +#ifndef BSD_BUILD +struct buf; +typedef struct buf * buf_t; + +struct file; +typedef struct file * file_t; + +#ifndef __LP64__ +struct ucred; +typedef struct ucred * ucred_t; +#endif + +struct mount; +typedef struct mount * mount_t; + +struct vnode; +typedef struct vnode * vnode_t; + +struct proc; +typedef struct proc * proc_t; + +struct uio; +typedef struct uio * uio_t; + +struct vfs_context; +typedef struct vfs_context * vfs_context_t; + +struct vfstable; +typedef struct vfstable * vfstable_t; + +struct __ifnet; +struct __mbuf; +struct __pkthdr; +struct __socket; +struct __sockopt; +struct __ifaddr; +struct __ifmultiaddr; +struct __ifnet_filter; +struct __rtentry; +struct __if_clone; + +typedef struct __ifnet* ifnet_t; +typedef struct __mbuf* mbuf_t; +typedef struct __pkthdr* pkthdr_t; +typedef struct __socket* socket_t; +typedef struct __sockopt* sockopt_t; +typedef struct __ifaddr* ifaddr_t; +typedef struct __ifmultiaddr* ifmultiaddr_t; +typedef struct __ifnet_filter* interface_filter_t; +typedef struct __rtentry* route_t; +typedef struct __if_clone* if_clone_t; + +#else /* BSD_BUILD */ + +typedef struct buf * buf_t; +typedef struct file * file_t; +#ifndef __LP64__ +typedef struct ucred * ucred_t; +#endif +typedef struct mount * mount_t; +typedef struct vnode * vnode_t; +typedef struct proc * proc_t; +typedef struct uio * uio_t; +typedef struct user_iovec * user_iovec_t; +typedef struct vfs_context * vfs_context_t; +typedef struct vfstable * vfstable_t; + + +#endif /* !BSD_BUILD */ + +#ifndef _KAUTH_GUID +#define _KAUTH_GUID +/* Apple-style globally unique identifier */ +typedef struct { +#define KAUTH_GUID_SIZE 16 /* 128-bit identifier */ + unsigned char g_guid[KAUTH_GUID_SIZE]; +} guid_t; +#define _GUID_T +#endif /* _KAUTH_GUID */ + +#ifndef _KAUTH_ACE +#define _KAUTH_ACE +struct kauth_ace; +typedef struct kauth_ace * kauth_ace_t; +#endif +#ifndef _KAUTH_ACL +#define _KAUTH_ACL +struct kauth_acl; +typedef struct kauth_acl * kauth_acl_t; +#endif +#ifndef _KAUTH_FILESEC +#define _KAUTH_FILESEC +struct kauth_filesec; +typedef struct kauth_filesec * kauth_filesec_t; +#endif + +#endif /* !_KERN_SYS_KERNELTYPES_H_ */ diff --git a/i386/include/sys/param.h b/i386/include/sys/param.h new file mode 100644 index 0000000..395fdf5 --- /dev/null +++ b/i386/include/sys/param.h @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */ +/*- + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)param.h 8.3 (Berkeley) 4/4/95 + */ + +#ifndef _SYS_PARAM_H_ +#define _SYS_PARAM_H_ + +#define BSD 199506 /* System version (year & month). */ +#define BSD4_3 1 +#define BSD4_4 1 + +#define NeXTBSD 1995064 /* NeXTBSD version (year, month, release) */ +#define NeXTBSD4_0 0 /* NeXTBSD 4.0 */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#ifndef LOCORE +#include <sys/types.h> +#endif + +/* + * Machine-independent constants (some used in following include files). + * Redefined constants are from POSIX 1003.1 limits file. + * + * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>) + * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>) + */ +#include <sys/syslimits.h> + +#define MAXCOMLEN 16 /* max command name remembered */ +#define MAXINTERP 64 /* max interpreter file name length */ +#define MAXLOGNAME 255 /* max login name length */ +#define MAXUPRC CHILD_MAX /* max simultaneous processes */ +#define NCARGS ARG_MAX /* max bytes for an exec function */ +#define NGROUPS NGROUPS_MAX /* max number groups */ +#define NOFILE 256 /* default max open files per process */ +#define NOGROUP 65535 /* marker for empty group set member */ +#define MAXHOSTNAMELEN 256 /* max hostname size */ +#define MAXDOMNAMELEN 256 /* maximum domain name length */ + +/* Machine type dependent parameters. */ +#include <i386/param.h> + +/* More types and definitions used throughout the kernel. */ +#include <limits.h> + +/* + * Priorities. Note that with 32 run queues, differences less than 4 are + * insignificant. + */ +#define PSWP 0 +#define PVM 4 +#define PINOD 8 +#define PRIBIO 16 +#define PVFS 20 +#define PZERO 22 /* No longer magic, shouldn't be here. XXX */ +#define PSOCK 24 +#define PWAIT 32 +#define PLOCK 36 +#define PPAUSE 40 +#define PUSER 50 +#define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */ + +#define PRIMASK 0x0ff +#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ +#define PTTYBLOCK 0x200 /* for tty SIGTTOU and SIGTTIN blocking */ +#define PDROP 0x400 /* OR'd with pri to stop re-aquistion of mutex upon wakeup */ +#define PSPIN 0x800 /* OR'd with pri to require mutex in spin mode upon wakeup */ + +#define NBPW sizeof(int) /* number of bytes per word (integer) */ + +#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ +#define NODEV (dev_t)(-1) /* non-existent device */ + +/* + * Clustering of hardware pages on machines with ridiculously small + * page sizes is done here. The paging subsystem deals with units of + * CLSIZE pte's describing NBPG (from machine/param.h) pages each. + */ +#define CLBYTES (CLSIZE*NBPG) +#define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */ +#define claligned(x) ((((int)(x))&CLOFSET)==0) +#define CLOFF CLOFSET +#define CLSHIFT (PGSHIFT+CLSIZELOG2) + +#if CLSIZE==1 +#define clbase(i) (i) +#define clrnd(i) (i) +#else +/* Give the base virtual address (first of CLSIZE). */ +#define clbase(i) ((i) &~ (CLSIZE-1)) +/* Round a number of clicks up to a whole cluster. */ +#define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1)) +#endif + +#define CBLOCK 64 /* Clist block size, must be a power of 2. */ +#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ + /* Data chars/clist. */ +#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) +#define CROUND (CBLOCK - 1) /* Clist rounding. */ + +/* + * File system parameters and macros. + * + * The file system is made out of blocks of at most MAXPHYS units, with + * smaller units (fragments) only in the last direct block. MAXBSIZE + * primarily determines the size of buffers in the buffer pool. It may be + * made larger than MAXPHYS without any effect on existing file systems; + * however making it smaller may make some file systems unmountable. + * We set this to track the value of (MAX_UPL_TRANSFER*PAGE_SIZE) from + * osfmk/mach/memory_object_types.h to bound it at the maximum UPL size. + */ +#define MAXBSIZE (256 * 4096) +#define MAXPHYSIO MAXPHYS +#define MAXFRAG 8 + +#define MAXPHYSIO_WIRED (16 * 1024 * 1024) + +/* + * MAXPATHLEN defines the longest permissable path length after expanding + * symbolic links. It is used to allocate a temporary buffer from the buffer + * pool in which to do the name expansion, hence should be a power of two, + * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the + * maximum number of symbolic links that may be expanded in a path name. + * It should be set high enough to allow all legitimate uses, but halt + * infinite loops reasonably quickly. + */ +#define MAXPATHLEN PATH_MAX +#define MAXSYMLINKS 32 + +/* Bit map related macros. */ +#define setbit(a,i) (((char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY)) +#define clrbit(a,i) (((char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY))) +#define isset(a,i) (((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) +#define isclr(a,i) ((((char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0) + +/* Macros for counting and rounding. */ +#ifndef howmany +#define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) +#endif +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +#define powerof2(x) ((((x)-1)&(x))==0) + +/* Macros for min/max. */ +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif /* MIN */ +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif /* MAX */ + +/* + * Constants for setting the parameters of the kernel memory allocator. + * + * 2 ** MINBUCKET is the smallest unit of memory that will be + * allocated. It must be at least large enough to hold a pointer. + * + * Units of memory less or equal to MAXALLOCSAVE will permanently + * allocate physical memory; requests for these size pieces of + * memory are quite fast. Allocations greater than MAXALLOCSAVE must + * always allocate and free physical memory; requests for these + * size allocations should be done infrequently as they will be slow. + * + * Constraints: CLBYTES <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and + * MAXALLOCSIZE must be a power of two. + */ +#define MINBUCKET 4 /* 4 => min allocation of 16 bytes */ +#define MAXALLOCSAVE (2 * CLBYTES) + +/* + * Scale factor for scaled integers used to count %cpu time and load avgs. + * + * The number of CPU `tick's that map to a unique `%age' can be expressed + * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that + * can be calculated (assuming 32 bits) can be closely approximated using + * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). + * + * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', + * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. + */ +#define FSHIFT 11 /* bits to right of fixed binary point */ +#define FSCALE (1<<FSHIFT) + +#endif /* _SYS_PARAM_H_ */ diff --git a/i386/include/sys/reboot.h b/i386/include/sys/reboot.h new file mode 100644 index 0000000..147a209 --- /dev/null +++ b/i386/include/sys/reboot.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1988, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)reboot.h 8.3 (Berkeley) 12/13/94 + */ + +#ifndef _SYS_REBOOT_H_ +#define _SYS_REBOOT_H_ + +/* + * Arguments to reboot system call. + */ + +#ifdef __APPLE_API_PRIVATE +#define RB_AUTOBOOT 0 /* flags for system auto-booting itself */ + +#define RB_ASKNAME 0x01 /* ask for file name to reboot from */ +#define RB_SINGLE 0x02 /* reboot to single user only */ +#define RB_NOSYNC 0x04 /* dont sync before reboot */ +#define RB_HALT 0x08 /* don't reboot, just halt */ +#define RB_INITNAME 0x10 /* name given for /etc/init */ +#define RB_DFLTROOT 0x20 /* use compiled-in rootdev */ +#define RB_ALTBOOT 0x40 /* use /boot.old vs /boot */ +#define RB_UNIPROC 0x80 /* don't start slaves */ +#define RB_SAFEBOOT 0x100 /* booting safe */ +#define RB_UPSDELAY 0x200 /* Delays restart by 5 minutes */ +#define RB_QUICK 0x400 /* quick and ungraceful reboot with file system caches flushed*/ +#define RB_PANIC 0 /* reboot due to panic */ +#define RB_BOOT 1 /* reboot due to boot() */ + +#endif /* __APPLE_API_PRIVATE */ + +#ifdef __APPLE_API_OBSOLETE +/* + * Constants for converting boot-style device number to type, + * adaptor (uba, mba, etc), unit number and partition number. + * Type (== major device number) is in the low byte + * for backward compatibility. Except for that of the "magic + * number", each mask applies to the shifted value. + * Format: + * (4) (4) (4) (4) (8) (8) + * -------------------------------- + * |MA | AD| CT| UN| PART | TYPE | + * -------------------------------- + */ +#define B_ADAPTORSHIFT 24 +#define B_ADAPTORMASK 0x0f +#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK) +#define B_CONTROLLERSHIFT 20 +#define B_CONTROLLERMASK 0xf +#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK) +#define B_UNITSHIFT 16 +#define B_UNITMASK 0xff +#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK) +#define B_PARTITIONSHIFT 8 +#define B_PARTITIONMASK 0xff +#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK) +#define B_TYPESHIFT 0 +#define B_TYPEMASK 0xff +#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK) +#define B_MAGICMASK 0xf0000000 +#define B_DEVMAGIC 0xa0000000 + +#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \ + (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \ + ((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \ + ((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC) + +#endif /* __APPLE_API_OBSOLETE */ + + +#endif /* _SYS_REBOOT_H_ */ diff --git a/i386/include/sys/select.h b/i386/include/sys/select.h new file mode 100644 index 0000000..49a4572 --- /dev/null +++ b/i386/include/sys/select.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)select.h 8.2 (Berkeley) 1/4/94 + */ + +#ifndef _SYS_SELECT_H_ +#define _SYS_SELECT_H_ + +#include <sys/appleapiopts.h> +#include <sys/cdefs.h> +#include <sys/_types.h> + +/* + * [XSI] The <sys/select.h> header shall define the fd_set type as a structure. + * The timespec structure shall be defined as described in <time.h> + * The <sys/select.h> header shall define the timeval structure. + */ +#define __need_fd_set +#define __need_struct_timespec +#define __need_struct_timeval +#include <sys/_structs.h> + +/* + * The time_t and suseconds_t types shall be defined as described in + * <sys/types.h> + * The sigset_t type shall be defined as described in <signal.h> + */ +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + +#ifndef _SUSECONDS_T +#define _SUSECONDS_T +typedef __darwin_suseconds_t suseconds_t; +#endif + +#ifndef _SIGSET_T +#define _SIGSET_T +typedef __darwin_sigset_t sigset_t; +#endif + +/* + * [XSI] FD_CLR, FD_ISSET, FD_SET, FD_ZERO may be declared as a function, or + * defined as a macro, or both + * [XSI] FD_SETSIZE shall be defined as a macro + */ + +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE __DARWIN_FD_SETSIZE +#endif /* FD_SETSIZE */ +#ifndef FD_SET +#define FD_SET(n, p) __DARWIN_FD_SET(n, p) +#endif /* FD_SET */ +#ifndef FD_CLR +#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p) +#endif /* FD_CLR */ +#ifndef FD_ISSET +#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) +#endif /* FD_ISSET */ +#ifndef FD_ZERO +#define FD_ZERO(p) __DARWIN_FD_ZERO(p) +#endif /* FD_ZERO */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef FD_COPY +#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) +#endif /* FD_COPY */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +__BEGIN_DECLS + +#ifndef __MWERKS__ +int pselect(int, fd_set * __restrict, fd_set * __restrict, + fd_set * __restrict, const struct timespec * __restrict, + const sigset_t * __restrict) +#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT) + __DARWIN_EXTSN_C(pselect) +#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */ +# if defined(__LP64__) && !__DARWIN_NON_CANCELABLE + __DARWIN_1050(pselect) +# else /* !__LP64__ || __DARWIN_NON_CANCELABLE */ + __DARWIN_ALIAS_C(pselect) +# endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */ +#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */ + ; +#endif /* __MWERKS__ */ + +#include <sys/_select.h> /* select() prototype */ + +__END_DECLS + + +#endif /* !_SYS_SELECT_H_ */ diff --git a/i386/include/sys/socket.h b/i386/include/sys/socket.h new file mode 100644 index 0000000..a19105a --- /dev/null +++ b/i386/include/sys/socket.h @@ -0,0 +1,629 @@ +/* + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1998, 1999 Apple Computer, Inc. All Rights Reserved */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)socket.h 8.4 (Berkeley) 2/21/94 + * $FreeBSD: src/sys/sys/socket.h,v 1.39.2.7 2001/07/03 11:02:01 ume Exp $ + */ +/* + * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce + * support for mandatory and extensible security protections. This notice + * is included in support of clause 2.2 (b) of the Apple Public License, + * Version 2.0. + */ + +#ifndef _SYS_SOCKET_H_ +#define _SYS_SOCKET_H_ + +#include <sys/types.h> +#include <sys/cdefs.h> +#include <machine/_param.h> + +/* + * Definitions related to sockets: types, address families, options. + */ + +/* + * Data types. + */ +#ifndef _GID_T +typedef __darwin_gid_t gid_t; +#define _GID_T +#endif + +#ifndef _OFF_T +typedef __darwin_off_t off_t; +#define _OFF_T +#endif + +#ifndef _PID_T +typedef __darwin_pid_t pid_t; +#define _PID_T +#endif + +#ifndef _SA_FAMILY_T +#define _SA_FAMILY_T +typedef __uint8_t sa_family_t; +#endif + +#ifndef _SOCKLEN_T +#define _SOCKLEN_T +typedef __darwin_socklen_t socklen_t; +#endif + +/* XXX Not explicitly defined by POSIX, but function return types are */ +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +/* XXX Not explicitly defined by POSIX, but function return types are */ +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif + +/* + * [XSI] The iovec structure shall be defined as described in <sys/uio.h>. + */ +#ifndef _STRUCT_IOVEC +#define _STRUCT_IOVEC +struct iovec { + void * iov_base; /* [XSI] Base address of I/O memory region */ + size_t iov_len; /* [XSI] Size of region iov_base points to */ +}; +#endif + +/* + * Types + */ +#define SOCK_STREAM 1 /* stream socket */ +#define SOCK_DGRAM 2 /* datagram socket */ +#define SOCK_RAW 3 /* raw-protocol interface */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SOCK_RDM 4 /* reliably-delivered message */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define SOCK_SEQPACKET 5 /* sequenced packet stream */ + +/* + * Option flags per-socket. + */ +#define SO_DEBUG 0x0001 /* turn on debugging info recording */ +#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ +#define SO_REUSEADDR 0x0004 /* allow local address reuse */ +#define SO_KEEPALIVE 0x0008 /* keep connections alive */ +#define SO_DONTROUTE 0x0010 /* just use interface addresses */ +#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ +#define SO_LINGER 0x0080 /* linger on close if data present (in ticks) */ +#else +#define SO_LINGER 0x1080 /* linger on close if data present (in seconds) */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ +#define SO_TIMESTAMP 0x0400 /* timestamp received dgram traffic */ +#ifndef __APPLE__ +#define SO_ACCEPTFILTER 0x1000 /* there is an accept filter */ +#else +#define SO_DONTTRUNC 0x2000 /* APPLE: Retain unread data */ + /* (ATOMIC proto) */ +#define SO_WANTMORE 0x4000 /* APPLE: Give hint when more data ready */ +#define SO_WANTOOBFLAG 0x8000 /* APPLE: Want OOB in MSG_FLAG on receive */ +#endif +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Additional options, not kept in so_options. + */ +#define SO_SNDBUF 0x1001 /* send buffer size */ +#define SO_RCVBUF 0x1002 /* receive buffer size */ +#define SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define SO_SNDTIMEO 0x1005 /* send timeout */ +#define SO_RCVTIMEO 0x1006 /* receive timeout */ +#define SO_ERROR 0x1007 /* get error status and clear */ +#define SO_TYPE 0x1008 /* get socket type */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/*efine SO_PRIVSTATE 0x1009 get/deny privileged state */ +#ifdef __APPLE__ +#define SO_NREAD 0x1020 /* APPLE: get 1st-packet byte count */ +#define SO_NKE 0x1021 /* APPLE: Install socket-level NKE */ +#define SO_NOSIGPIPE 0x1022 /* APPLE: No SIGPIPE on EPIPE */ +#define SO_NOADDRERR 0x1023 /* APPLE: Returns EADDRNOTAVAIL when src is not available anymore */ +#define SO_NWRITE 0x1024 /* APPLE: Get number of bytes currently in send socket buffer */ +#define SO_REUSESHAREUID 0x1025 /* APPLE: Allow reuse of port/socket by different userids */ +#ifdef __APPLE_API_PRIVATE +#define SO_NOTIFYCONFLICT 0x1026 /* APPLE: send notification if there is a bind on a port which is already in use */ +#define SO_UPCALLCLOSEWAIT 0x1027 /* APPLE: block on close until an upcall returns */ +#endif +#define SO_LINGER_SEC 0x1080 /* linger on close if data present (in seconds) */ +#define SO_RESTRICTIONS 0x1081 /* APPLE: deny inbound/outbound/both/flag set */ +#define SO_RESTRICT_DENYIN 0x00000001 /* flag for SO_RESTRICTIONS - deny inbound */ +#define SO_RESTRICT_DENYOUT 0x00000002 /* flag for SO_RESTRICTIONS - deny outbound */ +#define SO_RESTRICT_DENYSET 0x80000000 /* flag for SO_RESTRICTIONS - deny has been set */ +#define SO_RANDOMPORT 0x1082 /* APPLE: request local port randomization */ +#define SO_NP_EXTENSIONS 0x1083 /* To turn off some POSIX behavior */ +#endif +#define SO_LABEL 0x1010 /* socket's MAC label */ +#define SO_PEERLABEL 0x1011 /* socket's peer MAC label */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Structure used for manipulating linger option. + */ +struct linger { + int l_onoff; /* option on/off */ + int l_linger; /* linger time */ +}; + +#ifndef __APPLE__ +struct accept_filter_arg { + char af_name[16]; + char af_arg[256-16]; +}; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifdef __APPLE__ + +/* + * Structure to control non-portable Sockets extension to POSIX + */ +struct so_np_extensions { + u_int32_t npx_flags; + u_int32_t npx_mask; +}; + +#define SONPX_SETOPTSHUT 0x000000001 /* flag for allowing setsockopt after shutdown */ + + + +#endif +#endif + +/* + * Level number for (get/set)sockopt() to apply to socket itself. + */ +#define SOL_SOCKET 0xffff /* options for socket level */ + + +/* + * Address families. + */ +#define AF_UNSPEC 0 /* unspecified */ +#define AF_UNIX 1 /* local to host (pipes) */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define AF_LOCAL AF_UNIX /* backward compatibility */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define AF_IMPLINK 3 /* arpanet imp addresses */ +#define AF_PUP 4 /* pup protocols: e.g. BSP */ +#define AF_CHAOS 5 /* mit CHAOS protocols */ +#define AF_NS 6 /* XEROX NS protocols */ +#define AF_ISO 7 /* ISO protocols */ +#define AF_OSI AF_ISO +#define AF_ECMA 8 /* European computer manufacturers */ +#define AF_DATAKIT 9 /* datakit protocols */ +#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ +#define AF_SNA 11 /* IBM SNA */ +#define AF_DECnet 12 /* DECnet */ +#define AF_DLI 13 /* DEC Direct data link interface */ +#define AF_LAT 14 /* LAT */ +#define AF_HYLINK 15 /* NSC Hyperchannel */ +#define AF_APPLETALK 16 /* Apple Talk */ +#define AF_ROUTE 17 /* Internal Routing Protocol */ +#define AF_LINK 18 /* Link layer interface */ +#define pseudo_AF_XTP 19 /* eXpress Transfer Protocol (no AF) */ +#define AF_COIP 20 /* connection-oriented IP, aka ST II */ +#define AF_CNT 21 /* Computer Network Technology */ +#define pseudo_AF_RTIP 22 /* Help Identify RTIP packets */ +#define AF_IPX 23 /* Novell Internet Protocol */ +#define AF_SIP 24 /* Simple Internet Protocol */ +#define pseudo_AF_PIP 25 /* Help Identify PIP packets */ +#ifdef __APPLE__ +/*define pseudo_AF_BLUE 26 Identify packets for Blue Box - Not used */ +#define AF_NDRV 27 /* Network Driver 'raw' access */ +#endif +#define AF_ISDN 28 /* Integrated Services Digital Network*/ +#define AF_E164 AF_ISDN /* CCITT E.164 recommendation */ +#define pseudo_AF_KEY 29 /* Internal key-management function */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#define AF_INET6 30 /* IPv6 */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define AF_NATM 31 /* native ATM access */ +#ifdef __APPLE__ +#define AF_SYSTEM 32 /* Kernel event messages */ +#define AF_NETBIOS 33 /* NetBIOS */ +#define AF_PPP 34 /* PPP communication protocol */ +#else +#define AF_ATM 30 /* ATM */ +#endif +#define pseudo_AF_HDRCMPLT 35 /* Used by BPF to not rewrite headers + * in interface output routine + */ +#define AF_RESERVED_36 36 /* Reserved for internal usage */ + +#ifndef __APPLE__ +#define AF_NETGRAPH 32 /* Netgraph sockets */ +#endif +#define AF_IEEE80211 37 /* IEEE 802.11 protocol */ +#define AF_MAX 38 +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * [XSI] Structure used by kernel to store most addresses. + */ +struct sockaddr { + __uint8_t sa_len; /* total length */ + sa_family_t sa_family; /* [XSI] address family */ + char sa_data[14]; /* [XSI] addr value (actually larger) */ +}; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SOCK_MAXADDRLEN 255 /* longest possible addresses */ + +/* + * Structure used by kernel to pass protocol + * information in raw sockets. + */ +struct sockproto { + __uint16_t sp_family; /* address family */ + __uint16_t sp_protocol; /* protocol */ +}; +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE)*/ + +/* + * RFC 2553: protocol-independent placeholder for socket addresses + */ +#define _SS_MAXSIZE 128 +#define _SS_ALIGNSIZE (sizeof(__int64_t)) +#define _SS_PAD1SIZE \ + (_SS_ALIGNSIZE - sizeof(__uint8_t) - sizeof(sa_family_t)) +#define _SS_PAD2SIZE \ + (_SS_MAXSIZE - sizeof(__uint8_t) - sizeof(sa_family_t) - \ + _SS_PAD1SIZE - _SS_ALIGNSIZE) + +/* + * [XSI] sockaddr_storage + */ +struct sockaddr_storage { + __uint8_t ss_len; /* address length */ + sa_family_t ss_family; /* [XSI] address family */ + char __ss_pad1[_SS_PAD1SIZE]; + __int64_t __ss_align; /* force structure storage alignment */ + char __ss_pad2[_SS_PAD2SIZE]; +}; + +/* + * Protocol families, same as address families for now. + */ +#define PF_UNSPEC AF_UNSPEC +#define PF_LOCAL AF_LOCAL +#define PF_UNIX PF_LOCAL /* backward compatibility */ +#define PF_INET AF_INET +#define PF_IMPLINK AF_IMPLINK +#define PF_PUP AF_PUP +#define PF_CHAOS AF_CHAOS +#define PF_NS AF_NS +#define PF_ISO AF_ISO +#define PF_OSI AF_ISO +#define PF_ECMA AF_ECMA +#define PF_DATAKIT AF_DATAKIT +#define PF_CCITT AF_CCITT +#define PF_SNA AF_SNA +#define PF_DECnet AF_DECnet +#define PF_DLI AF_DLI +#define PF_LAT AF_LAT +#define PF_HYLINK AF_HYLINK +#define PF_APPLETALK AF_APPLETALK +#define PF_ROUTE AF_ROUTE +#define PF_LINK AF_LINK +#define PF_XTP pseudo_AF_XTP /* really just proto family, no AF */ +#define PF_COIP AF_COIP +#define PF_CNT AF_CNT +#define PF_SIP AF_SIP +#define PF_IPX AF_IPX /* same format as AF_NS */ +#define PF_RTIP pseudo_AF_RTIP /* same format as AF_INET */ +#define PF_PIP pseudo_AF_PIP +#ifdef __APPLE__ +#define PF_NDRV AF_NDRV +#endif +#define PF_ISDN AF_ISDN +#define PF_KEY pseudo_AF_KEY +#define PF_INET6 AF_INET6 +#define PF_NATM AF_NATM +#ifdef __APPLE__ +#define PF_SYSTEM AF_SYSTEM +#define PF_NETBIOS AF_NETBIOS +#define PF_PPP AF_PPP +#define PF_RESERVED_36 AF_RESERVED_36 + +#else +#define PF_ATM AF_ATM +#define PF_NETGRAPH AF_NETGRAPH +#endif + +#define PF_MAX AF_MAX + +/* + * These do not have socket-layer support: + */ +#define PF_VLAN ((uint32_t)0x766c616e) /* 'vlan' */ +#define PF_BOND ((uint32_t)0x626f6e64) /* 'bond' */ + +/* + * Definitions for network related sysctl, CTL_NET. + * + * Second level is protocol family. + * Third level is protocol number. + * + * Further levels are defined by the individual families below. + */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define NET_MAXID AF_MAX +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * PF_ROUTE - Routing table + * + * Three additional levels are defined: + * Fourth: address family, 0 is wildcard + * Fifth: type of info, defined below + * Sixth: flag(s) to mask with for NET_RT_FLAGS + */ +#define NET_RT_DUMP 1 /* dump; may limit to a.f. */ +#define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ +#define NET_RT_IFLIST 3 /* survey interface list */ +#define NET_RT_STAT 4 /* routing statistics */ +#define NET_RT_TRASH 5 /* routes not in table but not freed */ +#define NET_RT_IFLIST2 6 /* interface list with addresses */ +#define NET_RT_DUMP2 7 /* dump; may limit to a.f. */ +#define NET_RT_MAXID 8 +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + + +/* + * Maximum queue length specifiable by listen. + */ +#define SOMAXCONN 128 + +/* + * [XSI] Message header for recvmsg and sendmsg calls. + * Used value-result for recvmsg, value only for sendmsg. + */ +struct msghdr { + void *msg_name; /* [XSI] optional address */ + socklen_t msg_namelen; /* [XSI] size of address */ + struct iovec *msg_iov; /* [XSI] scatter/gather array */ + int msg_iovlen; /* [XSI] # elements in msg_iov */ + void *msg_control; /* [XSI] ancillary data, see below */ + socklen_t msg_controllen; /* [XSI] ancillary data buffer len */ + int msg_flags; /* [XSI] flags on received message */ +}; + + +#define MSG_OOB 0x1 /* process out-of-band data */ +#define MSG_PEEK 0x2 /* peek at incoming message */ +#define MSG_DONTROUTE 0x4 /* send without using routing tables */ +#define MSG_EOR 0x8 /* data completes record */ +#define MSG_TRUNC 0x10 /* data discarded before delivery */ +#define MSG_CTRUNC 0x20 /* control data lost before delivery */ +#define MSG_WAITALL 0x40 /* wait for full request or error */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ +#define MSG_EOF 0x100 /* data completes connection */ +#ifdef __APPLE__ +#define MSG_WAITSTREAM 0x200 /* wait up to full request.. may return partial */ +#define MSG_FLUSH 0x400 /* Start of 'hold' seq; dump so_temp */ +#define MSG_HOLD 0x800 /* Hold frag in so_temp */ +#define MSG_SEND 0x1000 /* Send the packet in so_temp */ +#define MSG_HAVEMORE 0x2000 /* Data ready to be read */ +#define MSG_RCVMORE 0x4000 /* Data remains in current pkt */ +#endif +#define MSG_NEEDSA 0x10000 /* Fail receive if socket address cannot be allocated */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * Header for ancillary data objects in msg_control buffer. + * Used for additional information with/about a datagram + * not expressible by flags. The format is a sequence + * of message elements headed by cmsghdr structures. + */ +struct cmsghdr { + socklen_t cmsg_len; /* [XSI] data byte count, including hdr */ + int cmsg_level; /* [XSI] originating protocol */ + int cmsg_type; /* [XSI] protocol-specific type */ +/* followed by unsigned char cmsg_data[]; */ +}; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef __APPLE__ +/* + * While we may have more groups than this, the cmsgcred struct must + * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow + * this. +*/ +#define CMGROUP_MAX 16 + +/* + * Credentials structure, used to verify the identity of a peer + * process that has sent us a message. This is allocated by the + * peer process but filled in by the kernel. This prevents the + * peer from lying about its identity. (Note that cmcred_groups[0] + * is the effective GID.) + */ +struct cmsgcred { + pid_t cmcred_pid; /* PID of sending process */ + uid_t cmcred_uid; /* real UID of sending process */ + uid_t cmcred_euid; /* effective UID of sending process */ + gid_t cmcred_gid; /* real GID of sending process */ + short cmcred_ngroups; /* number or groups */ + gid_t cmcred_groups[CMGROUP_MAX]; /* groups */ +}; +#endif +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* given pointer to struct cmsghdr, return pointer to data */ +#define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ + __DARWIN_ALIGN32(sizeof(struct cmsghdr))) + +/* + * RFC 2292 requires to check msg_controllen, in case that the kernel returns + * an empty list for some reasons. + */ +#define CMSG_FIRSTHDR(mhdr) \ + ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ + (struct cmsghdr *)(mhdr)->msg_control : \ + (struct cmsghdr *)0L) + + +/* + * Given pointer to struct cmsghdr, return pointer to next cmsghdr + * RFC 2292 says that CMSG_NXTHDR(mhdr, NULL) is equivalent to CMSG_FIRSTHDR(mhdr) + */ +#define CMSG_NXTHDR(mhdr, cmsg) \ + ((char *)(cmsg) == (char *)0L ? CMSG_FIRSTHDR(mhdr) : \ + ((((unsigned char *)(cmsg) + \ + __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len) + \ + __DARWIN_ALIGN32(sizeof(struct cmsghdr))) > \ + ((unsigned char *)(mhdr)->msg_control + \ + (mhdr)->msg_controllen)) ? \ + (struct cmsghdr *)0L /* NULL */ : \ + (struct cmsghdr *)((unsigned char *)(cmsg) + \ + __DARWIN_ALIGN32((__uint32_t)(cmsg)->cmsg_len)))) + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* RFC 2292 additions */ +#define CMSG_SPACE(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + __DARWIN_ALIGN32(l)) +#define CMSG_LEN(l) (__DARWIN_ALIGN32(sizeof(struct cmsghdr)) + (l)) + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* "Socket"-level control message types: */ +#define SCM_RIGHTS 0x01 /* access rights (array of int) */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ +#define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +/* + * howto arguments for shutdown(2), specified by Posix.1g. + */ +#define SHUT_RD 0 /* shut down the reading side */ +#define SHUT_WR 1 /* shut down the writing side */ +#define SHUT_RDWR 2 /* shut down both sides */ + +#if !defined(_POSIX_C_SOURCE) +/* + * sendfile(2) header/trailer struct + */ +struct sf_hdtr { + struct iovec *headers; /* pointer to an array of header struct iovec's */ + int hdr_cnt; /* number of header iovec's */ + struct iovec *trailers; /* pointer to an array of trailer struct iovec's */ + int trl_cnt; /* number of trailer iovec's */ +}; + + +#endif /* !_POSIX_C_SOURCE */ + +__BEGIN_DECLS +int accept(int, struct sockaddr * __restrict, socklen_t * __restrict) + __DARWIN_ALIAS_C(accept); +int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind); +int connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C( connect); +int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict) + __DARWIN_ALIAS(getpeername); +int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict) + __DARWIN_ALIAS(getsockname); +int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); +int listen(int, int) __DARWIN_ALIAS(listen); +ssize_t recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv); +ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, + socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom); +ssize_t recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg); +ssize_t send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send); +ssize_t sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg); +ssize_t sendto(int, const void *, size_t, + int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto); +int setsockopt(int, int, int, const void *, socklen_t); +int shutdown(int, int); +int sockatmark(int); +int socket(int, int, int); +int socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair); + +#if !defined(_POSIX_C_SOURCE) +int sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int); +#endif /* !_POSIX_C_SOURCE */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +void pfctlinput(int, struct sockaddr *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + + + +#endif /* !_SYS_SOCKET_H_ */ diff --git a/i386/include/sys/syscall.h b/i386/include/sys/syscall.h new file mode 100644 index 0000000..1f5aeb7 --- /dev/null +++ b/i386/include/sys/syscall.h @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2004-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + * + * + * System call switch table. + * + * DO NOT EDIT-- this file is automatically generated. + * created from /SourceCache/xnu/xnu-1504.7.4/bsd/kern/syscalls.master + */ + +#ifndef _SYS_SYSCALL_H_ +#define _SYS_SYSCALL_H_ + +#include <sys/appleapiopts.h> +#ifdef __APPLE_API_PRIVATE +#define SYS_syscall 0 +#define SYS_exit 1 +#define SYS_fork 2 +#define SYS_read 3 +#define SYS_write 4 +#define SYS_open 5 +#define SYS_close 6 +#define SYS_wait4 7 + /* 8 old creat */ +#define SYS_link 9 +#define SYS_unlink 10 + /* 11 old execv */ +#define SYS_chdir 12 +#define SYS_fchdir 13 +#define SYS_mknod 14 +#define SYS_chmod 15 +#define SYS_chown 16 + /* 17 old break */ +#define SYS_getfsstat 18 + /* 19 old lseek */ +#define SYS_getpid 20 + /* 21 old mount */ + /* 22 old umount */ +#define SYS_setuid 23 +#define SYS_getuid 24 +#define SYS_geteuid 25 +#define SYS_ptrace 26 +#define SYS_recvmsg 27 +#define SYS_sendmsg 28 +#define SYS_recvfrom 29 +#define SYS_accept 30 +#define SYS_getpeername 31 +#define SYS_getsockname 32 +#define SYS_access 33 +#define SYS_chflags 34 +#define SYS_fchflags 35 +#define SYS_sync 36 +#define SYS_kill 37 + /* 38 old stat */ +#define SYS_getppid 39 + /* 40 old lstat */ +#define SYS_dup 41 +#define SYS_pipe 42 +#define SYS_getegid 43 +#define SYS_profil 44 + /* 45 old ktrace */ +#define SYS_sigaction 46 +#define SYS_getgid 47 +#define SYS_sigprocmask 48 +#define SYS_getlogin 49 +#define SYS_setlogin 50 +#define SYS_acct 51 +#define SYS_sigpending 52 +#define SYS_sigaltstack 53 +#define SYS_ioctl 54 +#define SYS_reboot 55 +#define SYS_revoke 56 +#define SYS_symlink 57 +#define SYS_readlink 58 +#define SYS_execve 59 +#define SYS_umask 60 +#define SYS_chroot 61 + /* 62 old fstat */ + /* 63 used internally , reserved */ + /* 64 old getpagesize */ +#define SYS_msync 65 +#define SYS_vfork 66 + /* 67 old vread */ + /* 68 old vwrite */ + /* 69 old sbrk */ + /* 70 old sstk */ + /* 71 old mmap */ + /* 72 old vadvise */ +#define SYS_munmap 73 +#define SYS_mprotect 74 +#define SYS_madvise 75 + /* 76 old vhangup */ + /* 77 old vlimit */ +#define SYS_mincore 78 +#define SYS_getgroups 79 +#define SYS_setgroups 80 +#define SYS_getpgrp 81 +#define SYS_setpgid 82 +#define SYS_setitimer 83 + /* 84 old wait */ +#define SYS_swapon 85 +#define SYS_getitimer 86 + /* 87 old gethostname */ + /* 88 old sethostname */ +#define SYS_getdtablesize 89 +#define SYS_dup2 90 + /* 91 old getdopt */ +#define SYS_fcntl 92 +#define SYS_select 93 + /* 94 old setdopt */ +#define SYS_fsync 95 +#define SYS_setpriority 96 +#define SYS_socket 97 +#define SYS_connect 98 + /* 99 old accept */ +#define SYS_getpriority 100 + /* 101 old send */ + /* 102 old recv */ + /* 103 old sigreturn */ +#define SYS_bind 104 +#define SYS_setsockopt 105 +#define SYS_listen 106 + /* 107 old vtimes */ + /* 108 old sigvec */ + /* 109 old sigblock */ + /* 110 old sigsetmask */ +#define SYS_sigsuspend 111 + /* 112 old sigstack */ + /* 113 old recvmsg */ + /* 114 old sendmsg */ + /* 115 old vtrace */ +#define SYS_gettimeofday 116 +#define SYS_getrusage 117 +#define SYS_getsockopt 118 + /* 119 old resuba */ +#define SYS_readv 120 +#define SYS_writev 121 +#define SYS_settimeofday 122 +#define SYS_fchown 123 +#define SYS_fchmod 124 + /* 125 old recvfrom */ +#define SYS_setreuid 126 +#define SYS_setregid 127 +#define SYS_rename 128 + /* 129 old truncate */ + /* 130 old ftruncate */ +#define SYS_flock 131 +#define SYS_mkfifo 132 +#define SYS_sendto 133 +#define SYS_shutdown 134 +#define SYS_socketpair 135 +#define SYS_mkdir 136 +#define SYS_rmdir 137 +#define SYS_utimes 138 +#define SYS_futimes 139 +#define SYS_adjtime 140 + /* 141 old getpeername */ +#define SYS_gethostuuid 142 + /* 143 old sethostid */ + /* 144 old getrlimit */ + /* 145 old setrlimit */ + /* 146 old killpg */ +#define SYS_setsid 147 + /* 148 old setquota */ + /* 149 old qquota */ + /* 150 old getsockname */ +#define SYS_getpgid 151 +#define SYS_setprivexec 152 +#define SYS_pread 153 +#define SYS_pwrite 154 +#define SYS_nfssvc 155 + /* 156 old getdirentries */ +#define SYS_statfs 157 +#define SYS_fstatfs 158 +#define SYS_unmount 159 + /* 160 old async_daemon */ +#define SYS_getfh 161 + /* 162 old getdomainname */ + /* 163 old setdomainname */ + /* 164 */ +#define SYS_quotactl 165 + /* 166 old exportfs */ +#define SYS_mount 167 + /* 168 old ustat */ +#define SYS_csops 169 + /* 170 old table */ + /* 171 old wait3 */ + /* 172 old rpause */ +#define SYS_waitid 173 + /* 174 old getdents */ + /* 175 old gc_control */ +#define SYS_add_profil 176 + /* 177 */ + /* 178 */ + /* 179 */ +#define SYS_kdebug_trace 180 +#define SYS_setgid 181 +#define SYS_setegid 182 +#define SYS_seteuid 183 +#define SYS_sigreturn 184 +#define SYS_chud 185 + /* 186 */ +#define SYS_fdatasync 187 +#define SYS_stat 188 +#define SYS_fstat 189 +#define SYS_lstat 190 +#define SYS_pathconf 191 +#define SYS_fpathconf 192 + /* 193 */ +#define SYS_getrlimit 194 +#define SYS_setrlimit 195 +#define SYS_getdirentries 196 +#define SYS_mmap 197 + /* 198 __syscall */ +#define SYS_lseek 199 +#define SYS_truncate 200 +#define SYS_ftruncate 201 +#define SYS___sysctl 202 +#define SYS_mlock 203 +#define SYS_munlock 204 +#define SYS_undelete 205 +#define SYS_ATsocket 206 +#define SYS_ATgetmsg 207 +#define SYS_ATputmsg 208 +#define SYS_ATPsndreq 209 +#define SYS_ATPsndrsp 210 +#define SYS_ATPgetreq 211 +#define SYS_ATPgetrsp 212 + /* 213 Reserved for AppleTalk */ + /* 214 */ + /* 215 */ +#define SYS_mkcomplex 216 +#define SYS_statv 217 +#define SYS_lstatv 218 +#define SYS_fstatv 219 +#define SYS_getattrlist 220 +#define SYS_setattrlist 221 +#define SYS_getdirentriesattr 222 +#define SYS_exchangedata 223 + /* 224 old checkuseraccess / fsgetpath ( which moved to 427 ) */ +#define SYS_searchfs 225 +#define SYS_delete 226 +#define SYS_copyfile 227 +#define SYS_fgetattrlist 228 +#define SYS_fsetattrlist 229 +#define SYS_poll 230 +#define SYS_watchevent 231 +#define SYS_waitevent 232 +#define SYS_modwatch 233 +#define SYS_getxattr 234 +#define SYS_fgetxattr 235 +#define SYS_setxattr 236 +#define SYS_fsetxattr 237 +#define SYS_removexattr 238 +#define SYS_fremovexattr 239 +#define SYS_listxattr 240 +#define SYS_flistxattr 241 +#define SYS_fsctl 242 +#define SYS_initgroups 243 +#define SYS_posix_spawn 244 +#define SYS_ffsctl 245 + /* 246 */ +#define SYS_nfsclnt 247 +#define SYS_fhopen 248 + /* 249 */ +#define SYS_minherit 250 +#define SYS_semsys 251 +#define SYS_msgsys 252 +#define SYS_shmsys 253 +#define SYS_semctl 254 +#define SYS_semget 255 +#define SYS_semop 256 + /* 257 */ +#define SYS_msgctl 258 +#define SYS_msgget 259 +#define SYS_msgsnd 260 +#define SYS_msgrcv 261 +#define SYS_shmat 262 +#define SYS_shmctl 263 +#define SYS_shmdt 264 +#define SYS_shmget 265 +#define SYS_shm_open 266 +#define SYS_shm_unlink 267 +#define SYS_sem_open 268 +#define SYS_sem_close 269 +#define SYS_sem_unlink 270 +#define SYS_sem_wait 271 +#define SYS_sem_trywait 272 +#define SYS_sem_post 273 +#define SYS_sem_getvalue 274 +#define SYS_sem_init 275 +#define SYS_sem_destroy 276 +#define SYS_open_extended 277 +#define SYS_umask_extended 278 +#define SYS_stat_extended 279 +#define SYS_lstat_extended 280 +#define SYS_fstat_extended 281 +#define SYS_chmod_extended 282 +#define SYS_fchmod_extended 283 +#define SYS_access_extended 284 +#define SYS_settid 285 +#define SYS_gettid 286 +#define SYS_setsgroups 287 +#define SYS_getsgroups 288 +#define SYS_setwgroups 289 +#define SYS_getwgroups 290 +#define SYS_mkfifo_extended 291 +#define SYS_mkdir_extended 292 +#define SYS_identitysvc 293 +#define SYS_shared_region_check_np 294 +#define SYS_shared_region_map_np 295 +#define SYS_vm_pressure_monitor 296 +#define SYS_psynch_rw_longrdlock 297 +#define SYS_psynch_rw_yieldwrlock 298 +#define SYS_psynch_rw_downgrade 299 +#define SYS_psynch_rw_upgrade 300 +#define SYS_psynch_mutexwait 301 +#define SYS_psynch_mutexdrop 302 +#define SYS_psynch_cvbroad 303 +#define SYS_psynch_cvsignal 304 +#define SYS_psynch_cvwait 305 +#define SYS_psynch_rw_rdlock 306 +#define SYS_psynch_rw_wrlock 307 +#define SYS_psynch_rw_unlock 308 +#define SYS_psynch_rw_unlock2 309 +#define SYS_getsid 310 +#define SYS_settid_with_pid 311 + /* 312 old __pthread_cond_timedwait */ +#define SYS_aio_fsync 313 +#define SYS_aio_return 314 +#define SYS_aio_suspend 315 +#define SYS_aio_cancel 316 +#define SYS_aio_error 317 +#define SYS_aio_read 318 +#define SYS_aio_write 319 +#define SYS_lio_listio 320 + /* 321 old __pthread_cond_wait */ +#define SYS_iopolicysys 322 + /* 323 */ +#define SYS_mlockall 324 +#define SYS_munlockall 325 + /* 326 */ +#define SYS_issetugid 327 +#define SYS___pthread_kill 328 +#define SYS___pthread_sigmask 329 +#define SYS___sigwait 330 +#define SYS___disable_threadsignal 331 +#define SYS___pthread_markcancel 332 +#define SYS___pthread_canceled 333 +#define SYS___semwait_signal 334 + /* 335 old utrace */ +#define SYS_proc_info 336 +#define SYS_sendfile 337 +#define SYS_stat64 338 +#define SYS_fstat64 339 +#define SYS_lstat64 340 +#define SYS_stat64_extended 341 +#define SYS_lstat64_extended 342 +#define SYS_fstat64_extended 343 +#define SYS_getdirentries64 344 +#define SYS_statfs64 345 +#define SYS_fstatfs64 346 +#define SYS_getfsstat64 347 +#define SYS___pthread_chdir 348 +#define SYS___pthread_fchdir 349 +#define SYS_audit 350 +#define SYS_auditon 351 + /* 352 */ +#define SYS_getauid 353 +#define SYS_setauid 354 +#define SYS_getaudit 355 +#define SYS_setaudit 356 +#define SYS_getaudit_addr 357 +#define SYS_setaudit_addr 358 +#define SYS_auditctl 359 +#define SYS_bsdthread_create 360 +#define SYS_bsdthread_terminate 361 +#define SYS_kqueue 362 +#define SYS_kevent 363 +#define SYS_lchown 364 +#define SYS_stack_snapshot 365 +#define SYS_bsdthread_register 366 +#define SYS_workq_open 367 +#define SYS_workq_kernreturn 368 +#define SYS_kevent64 369 +#define SYS___old_semwait_signal 370 +#define SYS___old_semwait_signal_nocancel 371 +#define SYS_thread_selfid 372 + /* 373 */ + /* 374 */ + /* 375 */ + /* 376 */ + /* 377 */ + /* 378 */ + /* 379 */ +#define SYS___mac_execve 380 +#define SYS___mac_syscall 381 +#define SYS___mac_get_file 382 +#define SYS___mac_set_file 383 +#define SYS___mac_get_link 384 +#define SYS___mac_set_link 385 +#define SYS___mac_get_proc 386 +#define SYS___mac_set_proc 387 +#define SYS___mac_get_fd 388 +#define SYS___mac_set_fd 389 +#define SYS___mac_get_pid 390 +#define SYS___mac_get_lcid 391 +#define SYS___mac_get_lctx 392 +#define SYS___mac_set_lctx 393 +#define SYS_setlcid 394 +#define SYS_getlcid 395 +#define SYS_read_nocancel 396 +#define SYS_write_nocancel 397 +#define SYS_open_nocancel 398 +#define SYS_close_nocancel 399 +#define SYS_wait4_nocancel 400 +#define SYS_recvmsg_nocancel 401 +#define SYS_sendmsg_nocancel 402 +#define SYS_recvfrom_nocancel 403 +#define SYS_accept_nocancel 404 +#define SYS_msync_nocancel 405 +#define SYS_fcntl_nocancel 406 +#define SYS_select_nocancel 407 +#define SYS_fsync_nocancel 408 +#define SYS_connect_nocancel 409 +#define SYS_sigsuspend_nocancel 410 +#define SYS_readv_nocancel 411 +#define SYS_writev_nocancel 412 +#define SYS_sendto_nocancel 413 +#define SYS_pread_nocancel 414 +#define SYS_pwrite_nocancel 415 +#define SYS_waitid_nocancel 416 +#define SYS_poll_nocancel 417 +#define SYS_msgsnd_nocancel 418 +#define SYS_msgrcv_nocancel 419 +#define SYS_sem_wait_nocancel 420 +#define SYS_aio_suspend_nocancel 421 +#define SYS___sigwait_nocancel 422 +#define SYS___semwait_signal_nocancel 423 +#define SYS___mac_mount 424 +#define SYS___mac_get_mount 425 +#define SYS___mac_getfsstat 426 +#define SYS_fsgetpath 427 +#define SYS_audit_session_self 428 +#define SYS_audit_session_join 429 +#define SYS_pid_suspend 430 +#define SYS_pid_resume 431 +#define SYS_fileport_makeport 432 +#define SYS_fileport_makefd 433 +#define SYS_MAXSYSCALL 434 + +#endif /* __APPLE_API_PRIVATE */ +#endif /* !_SYS_SYSCALL_H_ */ diff --git a/i386/include/sys/syslimits.h b/i386/include/sys/syslimits.h new file mode 100644 index 0000000..a020b39 --- /dev/null +++ b/i386/include/sys/syslimits.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* $NetBSD: syslimits.h,v 1.15 1997/06/25 00:48:09 lukem Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)syslimits.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _SYS_SYSLIMITS_H_ +#define _SYS_SYSLIMITS_H_ + +#include <sys/cdefs.h> + +#if !defined(_ANSI_SOURCE) +/* + * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at + * compile time; you *cannot* set it higher than the hard limit!! + */ +#define ARG_MAX (256 * 1024) /* max bytes for an exec function */ +#define CHILD_MAX 266 /* max simultaneous processes */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define GID_MAX 2147483647U /* max value for a gid_t (2^31-2) */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define LINK_MAX 32767 /* max file link count */ +#define MAX_CANON 1024 /* max bytes in term canon input line */ +#define MAX_INPUT 1024 /* max bytes in terminal input */ +#define NAME_MAX 255 /* max bytes in a file name */ +#define NGROUPS_MAX 16 /* max supplemental group id's */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */ + +#define OPEN_MAX 10240 /* max open files per process - todo, make a config option? */ + +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ +#define PATH_MAX 1024 /* max bytes in pathname */ +#define PIPE_BUF 512 /* max bytes for atomic pipe writes */ + +#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ +#define BC_DIM_MAX 2048 /* max array elements in bc(1) */ +#define BC_SCALE_MAX 99 /* max scale value in bc(1) */ +#define BC_STRING_MAX 1000 /* max const string length in bc(1) */ +#define CHARCLASS_NAME_MAX 14 /* max character class name size */ +#define COLL_WEIGHTS_MAX 2 /* max weights for order keyword */ +#define EQUIV_CLASS_MAX 2 +#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ +#define LINE_MAX 2048 /* max bytes in an input line */ +#define RE_DUP_MAX 255 /* max RE's in interval notation */ + +#if __DARWIN_UNIX03 +#define NZERO 20 /* default priority [XSI] */ + /* = ((PRIO_MAX - PRIO_MIN) / 2) + 1 */ + /* range: 0 - 39 [(2 * NZERO) - 1] */ + /* 0 is not actually used */ +#else /* !__DARWIN_UNIX03 */ +#define NZERO 0 /* default priority */ + /* range: -20 - 20 */ + /* (PRIO_MIN - PRIO_MAX) */ +#endif /* __DARWIN_UNIX03 */ +#endif /* !_ANSI_SOURCE */ + +#endif /* !_SYS_SYSLIMITS_H_ */ diff --git a/i386/include/sys/time.h b/i386/include/sys/time.h new file mode 100644 index 0000000..4b2d999 --- /dev/null +++ b/i386/include/sys/time.h @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.2 (Berkeley) 7/10/94 + */ + +#ifndef _SYS_TIME_H_ +#define _SYS_TIME_H_ + +#include <sys/cdefs.h> +#include <sys/_types.h> + +/* + * [XSI] The fd_set type shall be defined as described in <sys/select.h>. + * The timespec structure shall be defined as described in <time.h> + */ +#define __need_fd_set +#define __need_struct_timespec +#define __need_struct_timeval +#include <sys/_structs.h> + +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + +#ifndef _SUSECONDS_T +#define _SUSECONDS_T +typedef __darwin_suseconds_t suseconds_t; +#endif + +/* + * Structure used as a parameter by getitimer(2) and setitimer(2) system + * calls. + */ +struct itimerval { + struct timeval it_interval; /* timer interval */ + struct timeval it_value; /* current value */ +}; + +/* + * Names of the interval timers, and structure + * defining a timer setting. + */ +#define ITIMER_REAL 0 +#define ITIMER_VIRTUAL 1 +#define ITIMER_PROF 2 + +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE __DARWIN_FD_SETSIZE +#endif /* FD_SETSIZE */ +#ifndef FD_SET +#define FD_SET(n, p) __DARWIN_FD_SET(n, p) +#endif /* FD_SET */ +#ifndef FD_CLR +#define FD_CLR(n,p) __DARWIN_FD_CLR(n, p) +#endif /* FD_CLR */ +#ifndef FD_ISSET +#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) +#endif /* FD_ISSET */ +#ifndef FD_ZERO +#define FD_ZERO(p) __DARWIN_FD_ZERO(p) +#endif /* FD_ZERO */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) + +#ifndef FD_COPY +#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) +#endif /* FD_COPY */ + +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->tv_sec = (tv)->tv_sec; \ + (ts)->tv_nsec = (tv)->tv_usec * 1000; \ +} +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (ts)->tv_sec; \ + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ +} + +struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; +#define DST_NONE 0 /* not on dst */ +#define DST_USA 1 /* USA style dst */ +#define DST_AUST 2 /* Australian style dst */ +#define DST_WET 3 /* Western European dst */ +#define DST_MET 4 /* Middle European dst */ +#define DST_EET 5 /* Eastern European dst */ +#define DST_CAN 6 /* Canada */ + +/* Operations on timevals. */ +#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 +#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) +#define timercmp(tvp, uvp, cmp) \ + (((tvp)->tv_sec == (uvp)->tv_sec) ? \ + ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ + ((tvp)->tv_sec cmp (uvp)->tv_sec)) +#define timeradd(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ + if ((vvp)->tv_usec >= 1000000) { \ + (vvp)->tv_sec++; \ + (vvp)->tv_usec -= 1000000; \ + } \ + } while (0) +#define timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) + +#define timevalcmp(l, r, cmp) timercmp(l, r, cmp) /* freebsd */ + +/* + * Getkerninfo clock information structure + */ +struct clockinfo { + int hz; /* clock frequency */ + int tick; /* micro-seconds per hz tick */ + int tickadj; /* clock skew rate for adjtime() */ + int stathz; /* statistics clock frequency */ + int profhz; /* profiling clock frequency */ +}; +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#include <time.h> +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +__BEGIN_DECLS + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +int adjtime(const struct timeval *, struct timeval *); +int futimes(int, const struct timeval *); +int lutimes(const char *, const struct timeval *); +int settimeofday(const struct timeval *, const struct timezone *); +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + +int getitimer(int, struct itimerval *); +int gettimeofday(struct timeval * __restrict, void * __restrict); + +#include <sys/_select.h> /* select() prototype */ + +int setitimer(int, const struct itimerval * __restrict, + struct itimerval * __restrict); +int utimes(const char *, const struct timeval *); + +__END_DECLS + + +#endif /* !_SYS_TIME_H_ */ diff --git a/i386/include/sys/types.h b/i386/include/sys/types.h new file mode 100644 index 0000000..01d4f2b --- /dev/null +++ b/i386/include/sys/types.h @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2000-2008 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)types.h 8.4 (Berkeley) 1/21/94 + */ + +#ifndef _SYS_TYPES_H_ +#define _SYS_TYPES_H_ + +#ifndef __ASSEMBLER__ +#include <sys/cdefs.h> + +/* Machine type dependent parameters. */ +#include <machine/types.h> +#include <sys/_types.h> +#include <machine/endian.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +typedef unsigned char u_char; +typedef unsigned short u_short; +typedef unsigned int u_int; +#ifndef _U_LONG +typedef unsigned long u_long; +#define _U_LONG +#endif +typedef unsigned short ushort; /* Sys V compatibility */ +typedef unsigned int uint; /* Sys V compatibility */ +#endif + +typedef u_int64_t u_quad_t; /* quads */ +typedef int64_t quad_t; +typedef quad_t * qaddr_t; + +typedef char * caddr_t; /* core address */ +typedef int32_t daddr_t; /* disk address */ + +typedef u_int32_t fixpt_t; /* fixed point number */ + + +#ifndef _IN_ADDR_T +#define _IN_ADDR_T +typedef __uint32_t in_addr_t; /* base type for internet address */ +#endif + +#ifndef _IN_PORT_T +#define _IN_PORT_T +typedef __uint16_t in_port_t; +#endif + + +#ifndef _KEY_T +#define _KEY_T +typedef __int32_t key_t; /* IPC key (for Sys V IPC) */ +#endif + +#ifndef _NLINK_T +typedef __uint16_t nlink_t; /* link count */ +#define _NLINK_T +#endif + +typedef int32_t segsz_t; /* segment size */ +typedef int32_t swblk_t; /* swap offset */ + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* Major, minor numbers, dev_t's. */ +#if defined(__cplusplus) +/* + * These lowercase macros tend to match member functions in some C++ code, + * so for C++, we must use inline functions instead. + */ + +static inline __int32_t major(__uint32_t _x) +{ + return (__int32_t)(((__uint32_t)_x >> 24) & 0xff); +} + +static inline __int32_t minor(__uint32_t _x) +{ + return (__int32_t)((_x) & 0xffffff); +} +#else /* !__cplusplus */ + +#define major(x) ((int32_t)(((u_int32_t)(x) >> 24) & 0xff)) +#define minor(x) ((int32_t)((x) & 0xffffff)) + +#endif /* !__cplusplus */ +#endif /* !_POSIX_C_SOURCE */ + +#ifndef _CLOCK_T +#define _CLOCK_T +typedef __darwin_clock_t clock_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif + +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif + +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * This code is present here in order to maintain historical backward + * compatability, and is intended to be removed at some point in the + * future; please include <sys/select.h> instead. + */ +#define __need_fd_set +#include <sys/_structs.h> + +#define NBBY __DARWIN_NBBY /* bits in a byte */ +#define NFDBITS __DARWIN_NFDBITS /* bits per mask */ +#define howmany(x, y) __DARWIN_howmany(x, y) /* # y's == x bits? */ +typedef __int32_t fd_mask; + +/* + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). The + * extra protection here is to permit application redefinition above + * the default size. + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE __DARWIN_FD_SETSIZE +#endif /* FD_SETSIZE */ +#ifndef FD_SET +#define FD_SET(n, p) __DARWIN_FD_SET(n, p) +#endif /* FD_SET */ +#ifndef FD_CLR +#define FD_CLR(n, p) __DARWIN_FD_CLR(n, p) +#endif /* FD_CLR */ +#ifndef FD_ISSET +#define FD_ISSET(n, p) __DARWIN_FD_ISSET(n, p) +#endif /* FD_ISSET */ +#ifndef FD_ZERO +#define FD_ZERO(p) __DARWIN_FD_ZERO(p) +#endif /* FD_ZERO */ +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef FD_COPY +#define FD_COPY(f, t) __DARWIN_FD_COPY(f, t) +#endif /* FD_COPY */ +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ + + +#if defined(__STDC__) && defined(KERNEL) +/* + * Forward structure declarations for function prototypes. We include the + * common structures that cross subsystem boundaries here; others are mostly + * used in the same place that the structure is defined. + */ +struct proc; +struct pgrp; +struct ucred; +struct rusage; +struct file; +struct buf; +struct tty; +struct uio; +#endif + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +#endif /* __ASSEMBLER__ */ + + + + +#endif /* !_SYS_TYPES_H_ */ diff --git a/i386/include/sys/unistd.h b/i386/include/sys/unistd.h new file mode 100644 index 0000000..d80b3bb --- /dev/null +++ b/i386/include/sys/unistd.h @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 8.2 (Berkeley) 1/7/94 + */ + +#ifndef _SYS_UNISTD_H_ +#define _SYS_UNISTD_H_ + +#include <sys/cdefs.h> + +/* + * Although we have saved user/group IDs, we do not use them in setuid + * as described in POSIX 1003.1, because the feature does not work for + * root. We use the saved IDs in seteuid/setegid, which are not currently + * part of the POSIX 1003.1 specification. + */ +#ifdef _NOT_AVAILABLE +#define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */ +#endif + +#define _POSIX_VERSION 200112L +#define _POSIX2_VERSION 200112L + +/* execution-time symbolic constants */ + /* may disable terminal special characters */ +#ifndef _POSIX_VDISABLE +#define _POSIX_VDISABLE ((unsigned char)'\377') +#endif + +#define _POSIX_THREAD_KEYS_MAX 128 + +/* access function */ +#define F_OK 0 /* test for existence of file */ +#define X_OK (1<<0) /* test for execute or search permission */ +#define W_OK (1<<1) /* test for write permission */ +#define R_OK (1<<2) /* test for read permission */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* + * Extended access functions. + * Note that we depend on these matching the definitions in sys/kauth.h, + * but with the bits shifted left by 8. + */ +#define _READ_OK (1<<9) /* read file data / read directory */ +#define _WRITE_OK (1<<10) /* write file data / add file to directory */ +#define _EXECUTE_OK (1<<11) /* execute file / search in directory*/ +#define _DELETE_OK (1<<12) /* delete file / delete directory */ +#define _APPEND_OK (1<<13) /* append to file / add subdirectory to directory */ +#define _RMFILE_OK (1<<14) /* - / remove file from directory */ +#define _RATTR_OK (1<<15) /* read basic attributes */ +#define _WATTR_OK (1<<16) /* write basic attributes */ +#define _REXT_OK (1<<17) /* read extended attributes */ +#define _WEXT_OK (1<<18) /* write extended attributes */ +#define _RPERM_OK (1<<19) /* read permissions */ +#define _WPERM_OK (1<<20) /* write permissions */ +#define _CHOWN_OK (1<<21) /* change ownership */ + +#define _ACCESS_EXTENDED_MASK (_READ_OK | _WRITE_OK | _EXECUTE_OK | \ + _DELETE_OK | _APPEND_OK | \ + _RMFILE_OK | _REXT_OK | \ + _WEXT_OK | _RATTR_OK | _WATTR_OK | _RPERM_OK | \ + _WPERM_OK | _CHOWN_OK) +#endif + +/* whence values for lseek(2) */ +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif /* !SEEK_SET */ + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +/* whence values for lseek(2); renamed by POSIX 1003.1 */ +#define L_SET SEEK_SET +#define L_INCR SEEK_CUR +#define L_XTND SEEK_END +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +struct accessx_descriptor { + unsigned int ad_name_offset; + int ad_flags; + int ad_pad[2]; +}; +#define ACCESSX_MAX_DESCRIPTORS 100 +#define ACCESSX_MAX_TABLESIZE (16 * 1024) +#endif + +/* configurable pathname variables */ +#define _PC_LINK_MAX 1 +#define _PC_MAX_CANON 2 +#define _PC_MAX_INPUT 3 +#define _PC_NAME_MAX 4 +#define _PC_PATH_MAX 5 +#define _PC_PIPE_BUF 6 +#define _PC_CHOWN_RESTRICTED 7 +#define _PC_NO_TRUNC 8 +#define _PC_VDISABLE 9 + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define _PC_NAME_CHARS_MAX 10 +#define _PC_CASE_SENSITIVE 11 +#define _PC_CASE_PRESERVING 12 +#define _PC_EXTENDED_SECURITY_NP 13 +#define _PC_AUTH_OPAQUE_NP 14 +#endif + +#define _PC_2_SYMLINKS 15 /* Symlink supported in directory */ +#define _PC_ALLOC_SIZE_MIN 16 /* Minimum storage actually allocated */ +#define _PC_ASYNC_IO 17 /* Async I/O [AIO] supported? */ +#define _PC_FILESIZEBITS 18 /* # of bits to represent file size */ +#define _PC_PRIO_IO 19 /* Priority I/O [PIO] supported? */ +#define _PC_REC_INCR_XFER_SIZE 20 /* Recommended increment for next two */ +#define _PC_REC_MAX_XFER_SIZE 21 /* Recommended max file transfer size */ +#define _PC_REC_MIN_XFER_SIZE 22 /* Recommended min file transfer size */ +#define _PC_REC_XFER_ALIGN 23 /* Recommended buffer alignment */ +#define _PC_SYMLINK_MAX 24 /* Max # of bytes in symlink name */ +#define _PC_SYNC_IO 25 /* Sync I/O [SIO] supported? */ + +/* configurable system strings */ +#define _CS_PATH 1 + +#endif /* !_SYS_UNISTD_H_ */ diff --git a/i386/include/time.h b/i386/include/time.h new file mode 100644 index 0000000..2914d40 --- /dev/null +++ b/i386/include/time.h @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.3 (Berkeley) 1/21/94 + */ + +#ifndef _TIME_H_ +#define _TIME_H_ + +#include <_types.h> + +#define __need_struct_timespec +#include <_structs.h> + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +#ifndef _CLOCK_T +#define _CLOCK_T +typedef __darwin_clock_t clock_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +typedef __darwin_size_t size_t; +#endif + +#ifndef _TIME_T +#define _TIME_T +typedef __darwin_time_t time_t; +#endif + +struct tm { + int tm_sec; /* seconds after the minute [0-60] */ + int tm_min; /* minutes after the hour [0-59] */ + int tm_hour; /* hours since midnight [0-23] */ + int tm_mday; /* day of the month [1-31] */ + int tm_mon; /* months since January [0-11] */ + int tm_year; /* years since 1900 */ + int tm_wday; /* days since Sunday [0-6] */ + int tm_yday; /* days since January 1 [0-365] */ + int tm_isdst; /* Daylight Savings Time flag */ + long tm_gmtoff; /* offset from CUT in seconds */ + char *tm_zone; /* timezone abbreviation */ +}; + +#if __DARWIN_UNIX03 +#define CLOCKS_PER_SEC 1000000 /* [XSI] */ +#else /* !__DARWIN_UNIX03 */ +#include <machine/_limits.h> /* Include file containing CLK_TCK. */ + +#define CLOCKS_PER_SEC (__DARWIN_CLK_TCK) +#endif /* __DARWIN_UNIX03 */ + +#ifndef _ANSI_SOURCE +extern char *tzname[]; +#endif + +extern int getdate_err; +#if __DARWIN_UNIX03 +//Begin-Libc +#ifndef LIBC_ALIAS_TIMEZONE +//End-Libc +extern long timezone __DARWIN_ALIAS(timezone); +//Begin-Libc +#else /* LIBC_ALIAS_TIMEZONE */ +extern long timezone LIBC_ALIAS(timezone); +#endif /* !LIBC_ALIAS_TIMEZONE */ +//End-Libc +#endif /* __DARWIN_UNIX03 */ +extern int daylight; + +__BEGIN_DECLS +char *asctime(const struct tm *); +//Begin-Libc +#ifndef LIBC_ALIAS_CLOCK +//End-Libc +clock_t clock(void) __DARWIN_ALIAS(clock); +//Begin-Libc +#else /* LIBC_ALIAS_CLOCK */ +clock_t clock(void) LIBC_ALIAS(clock); +#endif /* !LIBC_ALIAS_CLOCK */ +//End-Libc +char *ctime(const time_t *); +double difftime(time_t, time_t); +struct tm *getdate(const char *); +struct tm *gmtime(const time_t *); +struct tm *localtime(const time_t *); +//Begin-Libc +#ifndef LIBC_ALIAS_MKTIME +//End-Libc +time_t mktime(struct tm *) __DARWIN_ALIAS(mktime); +//Begin-Libc +#else /* LIBC_ALIAS_MKTIME */ +time_t mktime(struct tm *) LIBC_ALIAS(mktime); +#endif /* !LIBC_ALIAS_MKTIME */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRFTIME +//End-Libc +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime); +//Begin-Libc +#else /* LIBC_ALIAS_STRFTIME */ +size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) LIBC_ALIAS(strftime); +#endif /* !LIBC_ALIAS_STRFTIME */ +//End-Libc +//Begin-Libc +#ifndef LIBC_ALIAS_STRPTIME +//End-Libc +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime); +//Begin-Libc +#else /* LIBC_ALIAS_STRPTIME */ +char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) LIBC_ALIAS(strptime); +#endif /* !LIBC_ALIAS_STRPTIME */ +//End-Libc +time_t time(time_t *); + +#ifndef _ANSI_SOURCE +void tzset(void); +#endif /* not ANSI */ + +/* [TSF] Thread safe functions */ +char *asctime_r(const struct tm * __restrict, char * __restrict); +char *ctime_r(const time_t *, char *); +struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict); +struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict); + +#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +time_t posix2time(time_t); +#if !__DARWIN_UNIX03 +char *timezone(int, int); +#endif /* !__DARWIN_UNIX03 */ +void tzsetwall(void); +time_t time2posix(time_t); +time_t timelocal(struct tm * const); +time_t timegm(struct tm * const); +#endif /* neither ANSI nor POSIX */ + +#if !defined(_ANSI_SOURCE) +//Begin-Libc +#ifndef LIBC_ALIAS_NANOSLEEP +//End-Libc +int nanosleep(const struct timespec *, struct timespec *) __DARWIN_ALIAS_C(nanosleep); +//Begin-Libc +#else /* LIBC_ALIAS_NANOSLEEP */ +int nanosleep(const struct timespec *, struct timespec *) LIBC_ALIAS_C(nanosleep); +#endif /* !LIBC_ALIAS_NANOSLEEP */ +//End-Libc +#endif +__END_DECLS + +#ifdef _USE_EXTENDED_LOCALES_ +#include <xlocale/_time.h> +#endif /* _USE_EXTENDED_LOCALES_ */ + +#endif /* !_TIME_H_ */ diff --git a/i386/include/ufs/.svn/all-wcprops b/i386/include/ufs/.svn/all-wcprops new file mode 100644 index 0000000..9873a6a --- /dev/null +++ b/i386/include/ufs/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs +END diff --git a/i386/include/ufs/.svn/entries b/i386/include/ufs/.svn/entries new file mode 100644 index 0000000..10126da --- /dev/null +++ b/i386/include/ufs/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/ufs +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ufs +dir + +ffs +dir + diff --git a/i386/include/ufs/ffs/.svn/all-wcprops b/i386/include/ufs/ffs/.svn/all-wcprops new file mode 100644 index 0000000..c5b2e09 --- /dev/null +++ b/i386/include/ufs/ffs/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ffs +END +ffs_extern.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ffs/ffs_extern.h +END +fs.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ffs/fs.h +END diff --git a/i386/include/ufs/ffs/.svn/entries b/i386/include/ufs/ffs/.svn/entries new file mode 100644 index 0000000..40b6989 --- /dev/null +++ b/i386/include/ufs/ffs/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/ufs/ffs +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ffs_extern.h +file + + + + +2013-08-27T23:54:36.000000Z +adde3cf8766876d6d364d204a5cf393e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6737 + +fs.h +file + + + + +2013-08-27T23:54:36.000000Z +8482802b6ff905568a0b3dfc08bc9e63 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25536 + diff --git a/i386/include/ufs/ffs/.svn/text-base/ffs_extern.h.svn-base b/i386/include/ufs/ffs/.svn/text-base/ffs_extern.h.svn-base new file mode 100644 index 0000000..e493453 --- /dev/null +++ b/i386/include/ufs/ffs/.svn/text-base/ffs_extern.h.svn-base @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ + +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95 + */ +#ifndef __UFS_FFS_FFS_EXTERN_H__ +#define __UFS_FFS_FFS_EXTERN_H__ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_UNSTABLE +/* + * Sysctl values for the fast filesystem. + */ +#define FFS_CLUSTERREAD 1 /* cluster reading enabled */ +#define FFS_CLUSTERWRITE 2 /* cluster writing enabled */ +#define FFS_REALLOCBLKS 3 /* block reallocation enabled */ +#define FFS_ASYNCFREE 4 /* asynchronous block freeing enabled */ +#define FFS_MAXID 5 /* number of valid ffs ids */ + +#define FFS_NAMES { \ + { 0, 0 }, \ + { "doclusterread", CTLTYPE_INT }, \ + { "doclusterwrite", CTLTYPE_INT }, \ + { "doreallocblks", CTLTYPE_INT }, \ + { "doasyncfree", CTLTYPE_INT }, \ +} +#endif /* __APPLE_API_UNSTABLE */ + +struct buf; +struct fs; +struct inode; +struct mount; +struct nameidata; +struct proc; +struct vfsstatfs; +struct timeval; +#ifndef _KAUTH_CRED_T +#define _KAUTH_CRED_T +struct ucred; +typedef struct ucred *kauth_cred_t; +#endif /* !_KAUTH_CRED_T */ +struct uio; +struct vnode; +struct mbuf; +struct vfsconf; + +#ifdef __APPLE_API_PRIVATE +__BEGIN_DECLS +int ffs_fsync_internal(vnode_t, int); + +int ffs_blkatoff(vnode_t, off_t, char **, buf_t *); + +int ffs_alloc(struct inode *, + ufs_daddr_t, ufs_daddr_t, int, kauth_cred_t, ufs_daddr_t *); +int ffs_balloc(struct inode *, + ufs_daddr_t, int, kauth_cred_t, struct buf **, int, int *); +int ffs_blkalloc(struct inode *ip, ufs_daddr_t lbn,int size, + kauth_cred_t cred, int flags); +void ffs_blkfree(struct inode *, ufs_daddr_t, int32_t); +ufs_daddr_t ffs_blkpref(struct inode *, ufs_daddr_t, int, ufs_daddr_t *); +void ffs_clrblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_fhtovp(struct mount *, int, unsigned char *, struct vnode **, vfs_context_t); +void ffs_fragacct(struct fs *, int, int32_t [], int); +int ffs_fsync(struct vnop_fsync_args *); +int ffs_init(struct vfsconf *); +int ffs_isblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_mount(struct mount *, vnode_t , user_addr_t, vfs_context_t); +int ffs_mountfs(struct vnode *, struct mount *, vfs_context_t); +int ffs_mountroot(mount_t, vnode_t, vfs_context_t); +int ffs_read(struct vnop_read_args *); +int ffs_realloccg(struct inode *, + ufs_daddr_t, ufs_daddr_t, int, int, kauth_cred_t, struct buf **); +int ffs_reclaim(struct vnop_reclaim_args *); +void ffs_setblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_vfs_getattr(struct mount *, struct vfs_attr *, vfs_context_t); +int ffs_vfs_setattr(struct mount *, struct vfs_attr *, vfs_context_t); +int ffs_sync(struct mount *, int, vfs_context_t); +int ffs_sysctl(int *, u_int, user_addr_t, size_t *, user_addr_t, size_t, vfs_context_t); +int ffs_unmount(struct mount *, int, vfs_context_t); +int ffs_update(struct vnode *, struct timeval *, struct timeval *, int); +int ffs_valloc(vnode_t dvp, mode_t mode, kauth_cred_t cred, vnode_t *vpp); +int ffs_vfree(struct vnode *vp, ino_t ino, int mode); +int ffs_vget(struct mount *, ino64_t, struct vnode **, vfs_context_t); +int ffs_vptofh(struct vnode *, int *, unsigned char *, vfs_context_t); +int ffs_write(struct vnop_write_args *); +int ffs_pagein(struct vnop_pagein_args *); +int ffs_pageout(struct vnop_pageout_args *); +int ffs_blktooff(struct vnop_blktooff_args *); +int ffs_offtoblk(struct vnop_offtoblk_args *); + +__END_DECLS + +extern int (**ffs_vnodeop_p)(void *); +extern int (**ffs_specop_p)(void *); +#if FIFO +extern int (**ffs_fifoop_p)(void *); +#define FFS_FIFOOPS ffs_fifoop_p +#else +#define FFS_FIFOOPS NULL +#endif + +#endif /* __APPLE_API_PRIVATE */ +#endif /* __UFS_FFS_FFS_EXTERN_H__ */ diff --git a/i386/include/ufs/ffs/.svn/text-base/fs.h.svn-base b/i386/include/ufs/ffs/.svn/text-base/fs.h.svn-base new file mode 100644 index 0000000..d641337 --- /dev/null +++ b/i386/include/ufs/ffs/.svn/text-base/fs.h.svn-base @@ -0,0 +1,591 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fs.h 8.13 (Berkeley) 3/21/95 + */ +#ifndef _FFS_FS_H_ +#define _FFS_FS_H_ + +#ifdef __APPLE_API_UNSTABLE +/* + * Each disk drive contains some number of file systems. + * A file system consists of a number of cylinder groups. + * Each cylinder group has inodes and data. + * + * A file system is described by its super-block, which in turn + * describes the cylinder groups. The super-block is critical + * data and is replicated in each cylinder group to protect against + * catastrophic loss. This is done at `newfs' time and the critical + * super-block data does not change, so the copies need not be + * referenced further unless disaster strikes. + * + * For file system fs, the offsets of the various blocks of interest + * are given in the super block as: + * [fs->fs_sblkno] Super-block + * [fs->fs_cblkno] Cylinder group block + * [fs->fs_iblkno] Inode blocks + * [fs->fs_dblkno] Data blocks + * The beginning of cylinder group cg in fs, is given by + * the ``cgbase(fs, cg)'' macro. + * + * The first boot and super blocks are given in absolute disk addresses. + * The byte-offset forms are preferred, as they don't imply a sector size. + */ +#define BBSIZE 8192 +#define SBSIZE 8192 +#define BBOFF ((off_t)(0)) +#define SBOFF ((off_t)(BBOFF + BBSIZE)) +#define BBLOCK ((ufs_daddr_t)(0)) +#define SBLOCK ((ufs_daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) + +/* + * Addresses stored in inodes are capable of addressing fragments + * of `blocks'. File system blocks of at most size MAXBSIZE can + * be optionally broken into 2, 4, or 8 pieces, each of which is + * addressible; these pieces may be DEV_BSIZE, or some multiple of + * a DEV_BSIZE unit. + * + * Large files consist of exclusively large data blocks. To avoid + * undue wasted disk space, the last data block of a small file may be + * allocated as only as many fragments of a large block as are + * necessary. The file system format retains only a single pointer + * to such a fragment, which is a piece of a single large block that + * has been divided. The size of such a fragment is determinable from + * information in the inode, using the ``blksize(fs, ip, lbn)'' macro. + * + * The file system records space availability at the fragment level; + * to determine block availability, aligned fragments are examined. + */ + +/* + * MINBSIZE is the smallest allowable block size. + * In order to insure that it is possible to create files of size + * 2^32 with only two levels of indirection, MINBSIZE is set to 4096. + * MINBSIZE must be big enough to hold a cylinder group block, + * thus changes to (struct cg) must keep its size within MINBSIZE. + * Note that super blocks are always of size SBSIZE, + * and that both SBSIZE and MAXBSIZE must be >= MINBSIZE. + */ +#define MINBSIZE 4096 + +/* + * The path name on which the file system is mounted is maintained + * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in + * the super block for this name. + */ +#define MAXMNTLEN 512 + +/* + * The limit on the amount of summary information per file system + * is defined by MAXCSBUFS. It is currently parameterized for a + * size of 128 bytes (2 million cylinder groups on machines with + * 32-bit pointers, and 1 million on 64-bit machines). One pointer + * is taken away to point to an array of cluster sizes that is + * computed as cylinder groups are inspected. + * There is a 128-byte region in the superblock reserved for in-core + * pointers to summary information. Originally this included an array + * of pointers to blocks of struct csum; now there are just three + * pointers and the remaining space is padded with fs_ocsp[]. + * + * NOCSPTRS determines the size of this padding. One pointer (fs_csp) + * is taken away to point to a contiguous array of struct csum for + * all cylinder groups; a second (fs_maxcluster) points to an array + * of cluster sizes that is computed as cylinder groups are inspected, + * and the third points to an array that tracks the creation of new + * directories. + */ +#define NOCSPTRS ((128 / sizeof(void *)) - 3) + +/* + * A summary of contiguous blocks of various sizes is maintained + * in each cylinder group. Normally this is set by the initial + * value of fs_maxcontig. To conserve space, a maximum summary size + * is set by FS_MAXCONTIG. + */ +#define FS_MAXCONTIG 16 + +/* + * MINFREE gives the minimum acceptable percentage of file system + * blocks which may be free. If the freelist drops below this level + * only the superuser may continue to allocate blocks. This may + * be set to 0 if no reserve of free blocks is deemed necessary, + * however throughput drops by fifty percent if the file system + * is run at between 95% and 100% full; thus the minimum default + * value of fs_minfree is 5%. However, to get good clustering + * performance, 10% is a better choice. hence we use 10% as our + * default value. With 10% free space, fragmentation is not a + * problem, so we choose to optimize for time. + */ +#define MINFREE 5 +#define DEFAULTOPT FS_OPTTIME + +/* Grigoriy Orlov <gluk@ptci.ru> has done some extensive work to fine + * tune the layout preferences for directories within a filesystem. + * His algorithm can be tuned by adjusting the following parameters + * which tell the system the average file size and the average number + * of files per directory. These defaults are well selected for typical + * filesystems, but may need to be tuned for odd cases like filesystems + * being used for squid caches or news spools. + */ +#define AVFILESIZ 16384 +#define AFPDIR 64 + +/* + * Per cylinder group information; summarized in blocks allocated + * from first cylinder group data blocks. These blocks have to be + * read in from fs_csaddr (size fs_cssize) in addition to the + * super block. + */ +struct csum { + int32_t cs_ndir; /* number of directories */ + int32_t cs_nbfree; /* number of free blocks */ + int32_t cs_nifree; /* number of free inodes */ + int32_t cs_nffree; /* number of free frags */ +}; + +/* + * Super block for an FFS file system. + */ +struct fs { + int32_t fs_firstfield; /* historic file system linked list, */ + int32_t fs_unused_1; /* used for incore super blocks */ + ufs_daddr_t fs_sblkno; /* addr of super-block in filesys */ + ufs_daddr_t fs_cblkno; /* offset of cyl-block in filesys */ + ufs_daddr_t fs_iblkno; /* offset of inode-blocks in filesys */ + ufs_daddr_t fs_dblkno; /* offset of first data after cg */ + int32_t fs_cgoffset; /* cylinder group offset in cylinder */ + int32_t fs_cgmask; /* used to calc mod fs_ntrak */ + u_int32_t fs_time; /* last time written */ + int32_t fs_size; /* number of blocks in fs */ + int32_t fs_dsize; /* number of data blocks in fs */ + int32_t fs_ncg; /* number of cylinder groups */ + int32_t fs_bsize; /* size of basic blocks in fs */ + int32_t fs_fsize; /* size of frag blocks in fs */ + int32_t fs_frag; /* number of frags in a block in fs */ +/* these are configuration parameters */ + int32_t fs_minfree; /* minimum percentage of free blocks */ + int32_t fs_rotdelay; /* num of ms for optimal next block */ + int32_t fs_rps; /* disk revolutions per second */ +/* these fields can be computed from the others */ + int32_t fs_bmask; /* ``blkoff'' calc of blk offsets */ + int32_t fs_fmask; /* ``fragoff'' calc of frag offsets */ + int32_t fs_bshift; /* ``lblkno'' calc of logical blkno */ + int32_t fs_fshift; /* ``numfrags'' calc number of frags */ +/* these are configuration parameters */ + int32_t fs_maxcontig; /* max number of contiguous blks */ + int32_t fs_maxbpg; /* max number of blks per cyl group */ +/* these fields can be computed from the others */ + int32_t fs_fragshift; /* block to frag shift */ + int32_t fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ + int32_t fs_sbsize; /* actual size of super block */ + int32_t fs_csmask; /* csum block offset (now unused) */ + int32_t fs_csshift; /* csum block number (now unused) */ + int32_t fs_nindir; /* value of NINDIR */ + int32_t fs_inopb; /* value of INOPB */ + int32_t fs_nspf; /* value of NSPF */ +/* yet another configuration parameter */ + int32_t fs_optim; /* optimization preference, see below */ +/* these fields are derived from the hardware */ + int32_t fs_npsect; /* # sectors/track including spares */ + int32_t fs_interleave; /* hardware sector interleave */ + int32_t fs_trackskew; /* sector 0 skew, per track */ + int32_t fs_headswitch; /* head switch time, usec */ + int32_t fs_trkseek; /* track-to-track seek, usec */ +/* sizes determined by number of cylinder groups and their sizes */ + ufs_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ + int32_t fs_cssize; /* size of cyl grp summary area */ + int32_t fs_cgsize; /* cylinder group size */ +/* these fields are derived from the hardware */ + int32_t fs_ntrak; /* tracks per cylinder */ + int32_t fs_nsect; /* sectors per track */ + int32_t fs_spc; /* sectors per cylinder */ +/* this comes from the disk driver partitioning */ + int32_t fs_ncyl; /* cylinders in file system */ +/* these fields can be computed from the others */ + int32_t fs_cpg; /* cylinders per group */ + int32_t fs_ipg; /* inodes per group */ + int32_t fs_fpg; /* blocks per group * fs_frag */ +/* this data must be re-computed after crashes */ + struct csum fs_cstotal; /* cylinder summary information */ +/* these fields are cleared at mount time */ + int8_t fs_fmod; /* super block modified flag */ + int8_t fs_clean; /* file system is clean flag */ + int8_t fs_ronly; /* mounted read-only flag */ + int8_t fs_flags; /* currently unused flag */ + u_char fs_fsmnt[MAXMNTLEN]; /* name mounted on */ +/* these fields retain the current block allocation info */ + int32_t fs_cgrotor; /* last cg searched */ + void *fs_ocsp[NOCSPTRS]; /* list of fs_cs info buffers */ + u_int8_t *fs_contigdirs; /* # of contiguously allocated dirs */ + struct csum *fs_csp; /* list of fs_cs info buffers */ + int32_t *fs_maxcluster; /* max cluster in each cyl group */ + int32_t fs_cpc; /* cyl per cycle in postbl */ + int16_t fs_opostbl[16][8]; /* old rotation block list head */ + int32_t fs_avgfilesize; /* expected average file size */ + int32_t fs_avgfpdir; /* expected # of files per directory */ + int32_t fs_sparecon[48]; /* reserved for future constants */ + int32_t fs_contigsumsize; /* size of cluster summary array */ + int32_t fs_maxsymlinklen; /* max length of an internal symlink */ + int32_t fs_inodefmt; /* format of on-disk inodes */ + u_int64_t fs_maxfilesize; /* maximum representable file size */ + int64_t fs_qbmask; /* ~fs_bmask for use with 64-bit size */ + int64_t fs_qfmask; /* ~fs_fmask for use with 64-bit size */ + int32_t fs_state; /* validate fs_clean field */ + int32_t fs_postblformat; /* format of positional layout tables */ + int32_t fs_nrpos; /* number of rotational positions */ + int32_t fs_postbloff; /* (u_int16) rotation block list head */ + int32_t fs_rotbloff; /* (u_int8) blocks for each rotation */ + int32_t fs_magic; /* magic number */ + u_int8_t fs_space[1]; /* list of blocks for each rotation */ +/* actually longer */ +} __attribute__((packed,aligned(4))); + +/* + * Filesystem identification + */ +#define FS_MAGIC 0x011954 /* the fast filesystem magic number */ +#define FS_OKAY 0x7c269d38 /* superblock checksum */ +#define FS_42INODEFMT -1 /* 4.2BSD inode format */ +#define FS_44INODEFMT 2 /* 4.4BSD inode format */ +/* + * Preference for optimization. + */ +#define FS_OPTTIME 0 /* minimize allocation time */ +#define FS_OPTSPACE 1 /* minimize disk fragmentation */ + +/* + * Rotational layout table format types + */ +#define FS_42POSTBLFMT -1 /* 4.2BSD rotational table format */ +#define FS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */ +/* + * Macros for access to superblock array structures + */ +#define fs_postbl(fs, cylno) \ + (((fs)->fs_postblformat == FS_42POSTBLFMT) \ + ? ((fs)->fs_opostbl[cylno]) \ + : ((int16_t *)((u_int8_t *)(fs) + \ + (fs)->fs_postbloff) + (cylno) * (fs)->fs_nrpos)) +#define fs_rotbl(fs) \ + (((fs)->fs_postblformat == FS_42POSTBLFMT) \ + ? ((fs)->fs_space) \ + : ((u_int8_t *)((u_int8_t *)(fs) + (fs)->fs_rotbloff))) + +/* + * The size of a cylinder group is calculated by CGSIZE. The maximum size + * is limited by the fact that cylinder groups are at most one block. + * Its size is derived from the size of the maps maintained in the + * cylinder group and the (struct cg) size. + */ +#define CGSIZE(fs) \ + /* base cg */ (sizeof(struct cg) + sizeof(int32_t) + \ + /* blktot size */ (fs)->fs_cpg * sizeof(int32_t) + \ + /* blks size */ (fs)->fs_cpg * (fs)->fs_nrpos * sizeof(int16_t) + \ + /* inode map */ howmany((fs)->fs_ipg, NBBY) + \ + /* block map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY) +\ + /* if present */ ((fs)->fs_contigsumsize <= 0 ? 0 : \ + /* cluster sum */ (fs)->fs_contigsumsize * sizeof(int32_t) + \ + /* cluster map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPB(fs), NBBY))) + +/* + * Convert cylinder group to base address of its global summary info. + * + * N.B. This macro assumes that sizeof(struct csum) is a power of two. + */ +#define fs_cs(fs, indx) fs_csp[indx] + +/* + * Cylinder group block for a file system. + */ +#define CG_MAGIC 0x090255 +struct cg { + int32_t cg_firstfield; /* historic cyl groups linked list */ + int32_t cg_magic; /* magic number */ + u_int32_t cg_time; /* time last written */ + int32_t cg_cgx; /* we are the cgx'th cylinder group */ + int16_t cg_ncyl; /* number of cyl's this cg */ + int16_t cg_niblk; /* number of inode blocks this cg */ + int32_t cg_ndblk; /* number of data blocks this cg */ + struct csum cg_cs; /* cylinder summary information */ + int32_t cg_rotor; /* position of last used block */ + int32_t cg_frotor; /* position of last used frag */ + int32_t cg_irotor; /* position of last used inode */ + int32_t cg_frsum[MAXFRAG]; /* counts of available frags */ + int32_t cg_btotoff; /* (int32) block totals per cylinder */ + int32_t cg_boff; /* (u_int16) free block positions */ + int32_t cg_iusedoff; /* (u_int8) used inode map */ + int32_t cg_freeoff; /* (u_int8) free block map */ + int32_t cg_nextfreeoff; /* (u_int8) next available space */ + int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */ + int32_t cg_clusteroff; /* (u_int8) free cluster map */ + int32_t cg_nclusterblks; /* number of clusters this cg */ + int32_t cg_sparecon[13]; /* reserved for future use */ + u_int8_t cg_space[1]; /* space for cylinder group maps */ +/* actually longer */ +} __attribute__((packed,aligned(4))); + +/* + * Macros for access to cylinder group array structures + */ +#define cg_blktot(cgp) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_btot) \ + : ((int32_t *)((u_int8_t *)(cgp) + (cgp)->cg_btotoff))) +#define cg_blks(fs, cgp, cylno) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_b[cylno]) \ + : ((int16_t *)((u_int8_t *)(cgp) + \ + (cgp)->cg_boff) + (cylno) * (fs)->fs_nrpos)) +#define cg_inosused(cgp) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_iused) \ + : ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff))) +#define cg_blksfree(cgp) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_free) \ + : ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff))) +#define cg_chkmagic(cgp) \ + ((cgp)->cg_magic == CG_MAGIC || ((struct ocg *)(cgp))->cg_magic == CG_MAGIC) +#define cg_clustersfree(cgp) \ + ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_clusteroff)) +#define cg_clustersum(cgp) \ + ((int32_t *)((u_int8_t *)(cgp) + (cgp)->cg_clustersumoff)) + +/* + * The following structure is defined + * for compatibility with old file systems. + */ +struct ocg { + int32_t cg_firstfield; /* historic linked list of cyl groups */ + int32_t cg_unused_1; /* used for incore cyl groups */ + u_int32_t cg_time; /* time last written */ + int32_t cg_cgx; /* we are the cgx'th cylinder group */ + int16_t cg_ncyl; /* number of cyl's this cg */ + int16_t cg_niblk; /* number of inode blocks this cg */ + int32_t cg_ndblk; /* number of data blocks this cg */ + struct csum cg_cs; /* cylinder summary information */ + int32_t cg_rotor; /* position of last used block */ + int32_t cg_frotor; /* position of last used frag */ + int32_t cg_irotor; /* position of last used inode */ + int32_t cg_frsum[8]; /* counts of available frags */ + int32_t cg_btot[32]; /* block totals per cylinder */ + int16_t cg_b[32][8]; /* positions of free blocks */ + u_int8_t cg_iused[256]; /* used inode map */ + int32_t cg_magic; /* magic number */ + u_int8_t cg_free[1]; /* free block map */ +/* actually longer */ +} __attribute__((packed,aligned(4))); + +/* + * Turn file system block numbers into disk block addresses. + * This maps file system blocks to device size blocks. + */ +#define fsbtodb(fs, b) ((b) << (fs)->fs_fsbtodb) +#define dbtofsb(fs, b) ((b) >> (fs)->fs_fsbtodb) + +/* + * Cylinder group macros to locate things in cylinder groups. + * They calc file system addresses of cylinder group data structures. + */ +#define cgbase(fs, c) ((ufs_daddr_t)((fs)->fs_fpg * (c))) +#define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ +#define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ +#define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ +#define cgtod(fs, c) (cgstart(fs, c) + (fs)->fs_cblkno) /* cg block */ +#define cgstart(fs, c) \ + (cgbase(fs, c) + (fs)->fs_cgoffset * ((c) & ~((fs)->fs_cgmask))) + +/* + * Macros for handling inode numbers: + * inode number to file system block offset. + * inode number to cylinder group number. + * inode number to file system block address. + */ +#define ino_to_cg(fs, x) ((x) / (fs)->fs_ipg) +#define ino_to_fsba(fs, x) \ + ((ufs_daddr_t)(cgimin(fs, ino_to_cg(fs, x)) + \ + (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) +#define ino_to_fsbo(fs, x) ((x) % INOPB(fs)) + +/* + * Give cylinder group number for a file system block. + * Give cylinder group block number for a file system block. + */ +#define dtog(fs, d) ((d) / (fs)->fs_fpg) +#define dtogd(fs, d) ((d) % (fs)->fs_fpg) + +/* + * Extract the bits for a block from a map. + * Compute the cylinder and rotational position of a cyl block addr. + */ +#define blkmap(fs, map, loc) \ + (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) +#define cbtocylno(fs, bno) \ + ((bno) * NSPF(fs) / (fs)->fs_spc) +#define cbtorpos(fs, bno) \ + (((bno) * NSPF(fs) % (fs)->fs_spc / (fs)->fs_nsect * (fs)->fs_trackskew + \ + (bno) * NSPF(fs) % (fs)->fs_spc % (fs)->fs_nsect * (fs)->fs_interleave) % \ + (fs)->fs_nsect * (fs)->fs_nrpos / (fs)->fs_npsect) + +/* + * The following macros optimize certain frequently calculated + * quantities by using shifts and masks in place of divisions + * modulos and multiplications. + */ +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ + ((loc) & (fs)->fs_qbmask) +#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ + ((loc) & (fs)->fs_qfmask) +#define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ + ((blk) << (fs)->fs_bshift) +#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ + ((loc) >> (fs)->fs_bshift) +#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ + ((loc) >> (fs)->fs_fshift) +#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ + (((size) + (fs)->fs_qbmask) & (fs)->fs_bmask) +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ + (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) +#define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ + ((frags) >> (fs)->fs_fragshift) +#define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ + ((blks) << (fs)->fs_fragshift) +#define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ + ((fsb) & ((fs)->fs_frag - 1)) +#define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ + ((fsb) &~ ((fs)->fs_frag - 1)) + +/* + * Determine the number of available frags given a + * percentage to hold in reserve. + */ +#define freespace(fs, percentreserved) \ + (blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \ + (fs)->fs_cstotal.cs_nffree - ((fs)->fs_dsize * (percentreserved) / 100)) + +/* + * Determining the size of a file block in the file system. + */ +#define blksize(fs, ip, lbn) \ + (((lbn) >= NDADDR || (ip)->i_size >= ((lbn) + 1) << (fs)->fs_bshift) \ + ? (fs)->fs_bsize \ + : (fragroundup(fs, blkoff(fs, (ip)->i_size)))) +#define dblksize(fs, dip, lbn) \ + (((lbn) >= NDADDR || (dip)->di_size >= ((lbn) + 1) << (fs)->fs_bshift) \ + ? (fs)->fs_bsize \ + : (fragroundup(fs, blkoff(fs, (dip)->di_size)))) + +/* + * Number of disk sectors per block/fragment; assumes DEV_BSIZE byte + * sector size. + */ +#define NSPB(fs) ((fs)->fs_nspf << (fs)->fs_fragshift) +#define NSPF(fs) ((fs)->fs_nspf) + +/* + * Number of inodes in a secondary storage block/fragment. + */ +#define INOPB(fs) ((fs)->fs_inopb) +#define INOPF(fs) ((fs)->fs_inopb >> (fs)->fs_fragshift) + +/* + * Number of indirects in a file system block. + */ +#define NINDIR(fs) ((fs)->fs_nindir) + +/* + * This macro controls whether the file system format is byte swapped or not. + * At NeXT, all little endian machines read and write big endian file systems. + */ +#define BIG_ENDIAN_FS (__LITTLE_ENDIAN__) + +#ifdef __APPLE_API_PRIVATE +extern int inside[], around[]; +extern u_char *fragtbl[]; +#endif /* __APPLE_API_PRIVATE */ + + +/* + * UFS Label: + * The purpose of this label is to name a UFS/FFS filesystem. The label + * is located at offset 7K (BBSIZE=8K - UFS_LABEL_SIZE=1K = 7K) of the + * partition. The first 7K is still available for boot blocks. + */ + +#define UFS_LABEL_MAGIC { 'L', 'A', 'B', 'L' } +#define UFS_LABEL_SIZE 1024 +#define UFS_LABEL_OFFSET (BBSIZE - UFS_LABEL_SIZE) /* top 1K */ +#define UFS_LABEL_VERSION 1 +#define UFS_MAX_LABEL_NAME 512 + +struct ufslabel { + u_int32_t ul_magic; + u_int16_t ul_checksum; /* checksum over entire label*/ + u_int32_t ul_version __attribute__((aligned(4))); /* label version */ + u_int32_t ul_time; /* creation time */ + u_int16_t ul_namelen; /* filesystem name length */ + u_char ul_name[UFS_MAX_LABEL_NAME]; /* filesystem name */ + u_int64_t ul_uuid __attribute__((aligned(4))); /* filesystem uuid */ + u_char ul_reserved[24];/* reserved for future use */ + u_char ul_unused[460]; /* pad out to 1K */ +} __attribute__((packed,aligned(4))); + +#endif /* __APPLE_API_UNSTABLE */ +#endif /* ! _FFS_FS_H_ */ diff --git a/i386/include/ufs/ffs/ffs_extern.h b/i386/include/ufs/ffs/ffs_extern.h new file mode 100644 index 0000000..e493453 --- /dev/null +++ b/i386/include/ufs/ffs/ffs_extern.h @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ + +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ffs_extern.h 8.6 (Berkeley) 3/30/95 + */ +#ifndef __UFS_FFS_FFS_EXTERN_H__ +#define __UFS_FFS_FFS_EXTERN_H__ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_UNSTABLE +/* + * Sysctl values for the fast filesystem. + */ +#define FFS_CLUSTERREAD 1 /* cluster reading enabled */ +#define FFS_CLUSTERWRITE 2 /* cluster writing enabled */ +#define FFS_REALLOCBLKS 3 /* block reallocation enabled */ +#define FFS_ASYNCFREE 4 /* asynchronous block freeing enabled */ +#define FFS_MAXID 5 /* number of valid ffs ids */ + +#define FFS_NAMES { \ + { 0, 0 }, \ + { "doclusterread", CTLTYPE_INT }, \ + { "doclusterwrite", CTLTYPE_INT }, \ + { "doreallocblks", CTLTYPE_INT }, \ + { "doasyncfree", CTLTYPE_INT }, \ +} +#endif /* __APPLE_API_UNSTABLE */ + +struct buf; +struct fs; +struct inode; +struct mount; +struct nameidata; +struct proc; +struct vfsstatfs; +struct timeval; +#ifndef _KAUTH_CRED_T +#define _KAUTH_CRED_T +struct ucred; +typedef struct ucred *kauth_cred_t; +#endif /* !_KAUTH_CRED_T */ +struct uio; +struct vnode; +struct mbuf; +struct vfsconf; + +#ifdef __APPLE_API_PRIVATE +__BEGIN_DECLS +int ffs_fsync_internal(vnode_t, int); + +int ffs_blkatoff(vnode_t, off_t, char **, buf_t *); + +int ffs_alloc(struct inode *, + ufs_daddr_t, ufs_daddr_t, int, kauth_cred_t, ufs_daddr_t *); +int ffs_balloc(struct inode *, + ufs_daddr_t, int, kauth_cred_t, struct buf **, int, int *); +int ffs_blkalloc(struct inode *ip, ufs_daddr_t lbn,int size, + kauth_cred_t cred, int flags); +void ffs_blkfree(struct inode *, ufs_daddr_t, int32_t); +ufs_daddr_t ffs_blkpref(struct inode *, ufs_daddr_t, int, ufs_daddr_t *); +void ffs_clrblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_fhtovp(struct mount *, int, unsigned char *, struct vnode **, vfs_context_t); +void ffs_fragacct(struct fs *, int, int32_t [], int); +int ffs_fsync(struct vnop_fsync_args *); +int ffs_init(struct vfsconf *); +int ffs_isblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_mount(struct mount *, vnode_t , user_addr_t, vfs_context_t); +int ffs_mountfs(struct vnode *, struct mount *, vfs_context_t); +int ffs_mountroot(mount_t, vnode_t, vfs_context_t); +int ffs_read(struct vnop_read_args *); +int ffs_realloccg(struct inode *, + ufs_daddr_t, ufs_daddr_t, int, int, kauth_cred_t, struct buf **); +int ffs_reclaim(struct vnop_reclaim_args *); +void ffs_setblock(struct fs *, u_char *, ufs_daddr_t); +int ffs_vfs_getattr(struct mount *, struct vfs_attr *, vfs_context_t); +int ffs_vfs_setattr(struct mount *, struct vfs_attr *, vfs_context_t); +int ffs_sync(struct mount *, int, vfs_context_t); +int ffs_sysctl(int *, u_int, user_addr_t, size_t *, user_addr_t, size_t, vfs_context_t); +int ffs_unmount(struct mount *, int, vfs_context_t); +int ffs_update(struct vnode *, struct timeval *, struct timeval *, int); +int ffs_valloc(vnode_t dvp, mode_t mode, kauth_cred_t cred, vnode_t *vpp); +int ffs_vfree(struct vnode *vp, ino_t ino, int mode); +int ffs_vget(struct mount *, ino64_t, struct vnode **, vfs_context_t); +int ffs_vptofh(struct vnode *, int *, unsigned char *, vfs_context_t); +int ffs_write(struct vnop_write_args *); +int ffs_pagein(struct vnop_pagein_args *); +int ffs_pageout(struct vnop_pageout_args *); +int ffs_blktooff(struct vnop_blktooff_args *); +int ffs_offtoblk(struct vnop_offtoblk_args *); + +__END_DECLS + +extern int (**ffs_vnodeop_p)(void *); +extern int (**ffs_specop_p)(void *); +#if FIFO +extern int (**ffs_fifoop_p)(void *); +#define FFS_FIFOOPS ffs_fifoop_p +#else +#define FFS_FIFOOPS NULL +#endif + +#endif /* __APPLE_API_PRIVATE */ +#endif /* __UFS_FFS_FFS_EXTERN_H__ */ diff --git a/i386/include/ufs/ffs/fs.h b/i386/include/ufs/ffs/fs.h new file mode 100644 index 0000000..d641337 --- /dev/null +++ b/i386/include/ufs/ffs/fs.h @@ -0,0 +1,591 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)fs.h 8.13 (Berkeley) 3/21/95 + */ +#ifndef _FFS_FS_H_ +#define _FFS_FS_H_ + +#ifdef __APPLE_API_UNSTABLE +/* + * Each disk drive contains some number of file systems. + * A file system consists of a number of cylinder groups. + * Each cylinder group has inodes and data. + * + * A file system is described by its super-block, which in turn + * describes the cylinder groups. The super-block is critical + * data and is replicated in each cylinder group to protect against + * catastrophic loss. This is done at `newfs' time and the critical + * super-block data does not change, so the copies need not be + * referenced further unless disaster strikes. + * + * For file system fs, the offsets of the various blocks of interest + * are given in the super block as: + * [fs->fs_sblkno] Super-block + * [fs->fs_cblkno] Cylinder group block + * [fs->fs_iblkno] Inode blocks + * [fs->fs_dblkno] Data blocks + * The beginning of cylinder group cg in fs, is given by + * the ``cgbase(fs, cg)'' macro. + * + * The first boot and super blocks are given in absolute disk addresses. + * The byte-offset forms are preferred, as they don't imply a sector size. + */ +#define BBSIZE 8192 +#define SBSIZE 8192 +#define BBOFF ((off_t)(0)) +#define SBOFF ((off_t)(BBOFF + BBSIZE)) +#define BBLOCK ((ufs_daddr_t)(0)) +#define SBLOCK ((ufs_daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE)) + +/* + * Addresses stored in inodes are capable of addressing fragments + * of `blocks'. File system blocks of at most size MAXBSIZE can + * be optionally broken into 2, 4, or 8 pieces, each of which is + * addressible; these pieces may be DEV_BSIZE, or some multiple of + * a DEV_BSIZE unit. + * + * Large files consist of exclusively large data blocks. To avoid + * undue wasted disk space, the last data block of a small file may be + * allocated as only as many fragments of a large block as are + * necessary. The file system format retains only a single pointer + * to such a fragment, which is a piece of a single large block that + * has been divided. The size of such a fragment is determinable from + * information in the inode, using the ``blksize(fs, ip, lbn)'' macro. + * + * The file system records space availability at the fragment level; + * to determine block availability, aligned fragments are examined. + */ + +/* + * MINBSIZE is the smallest allowable block size. + * In order to insure that it is possible to create files of size + * 2^32 with only two levels of indirection, MINBSIZE is set to 4096. + * MINBSIZE must be big enough to hold a cylinder group block, + * thus changes to (struct cg) must keep its size within MINBSIZE. + * Note that super blocks are always of size SBSIZE, + * and that both SBSIZE and MAXBSIZE must be >= MINBSIZE. + */ +#define MINBSIZE 4096 + +/* + * The path name on which the file system is mounted is maintained + * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in + * the super block for this name. + */ +#define MAXMNTLEN 512 + +/* + * The limit on the amount of summary information per file system + * is defined by MAXCSBUFS. It is currently parameterized for a + * size of 128 bytes (2 million cylinder groups on machines with + * 32-bit pointers, and 1 million on 64-bit machines). One pointer + * is taken away to point to an array of cluster sizes that is + * computed as cylinder groups are inspected. + * There is a 128-byte region in the superblock reserved for in-core + * pointers to summary information. Originally this included an array + * of pointers to blocks of struct csum; now there are just three + * pointers and the remaining space is padded with fs_ocsp[]. + * + * NOCSPTRS determines the size of this padding. One pointer (fs_csp) + * is taken away to point to a contiguous array of struct csum for + * all cylinder groups; a second (fs_maxcluster) points to an array + * of cluster sizes that is computed as cylinder groups are inspected, + * and the third points to an array that tracks the creation of new + * directories. + */ +#define NOCSPTRS ((128 / sizeof(void *)) - 3) + +/* + * A summary of contiguous blocks of various sizes is maintained + * in each cylinder group. Normally this is set by the initial + * value of fs_maxcontig. To conserve space, a maximum summary size + * is set by FS_MAXCONTIG. + */ +#define FS_MAXCONTIG 16 + +/* + * MINFREE gives the minimum acceptable percentage of file system + * blocks which may be free. If the freelist drops below this level + * only the superuser may continue to allocate blocks. This may + * be set to 0 if no reserve of free blocks is deemed necessary, + * however throughput drops by fifty percent if the file system + * is run at between 95% and 100% full; thus the minimum default + * value of fs_minfree is 5%. However, to get good clustering + * performance, 10% is a better choice. hence we use 10% as our + * default value. With 10% free space, fragmentation is not a + * problem, so we choose to optimize for time. + */ +#define MINFREE 5 +#define DEFAULTOPT FS_OPTTIME + +/* Grigoriy Orlov <gluk@ptci.ru> has done some extensive work to fine + * tune the layout preferences for directories within a filesystem. + * His algorithm can be tuned by adjusting the following parameters + * which tell the system the average file size and the average number + * of files per directory. These defaults are well selected for typical + * filesystems, but may need to be tuned for odd cases like filesystems + * being used for squid caches or news spools. + */ +#define AVFILESIZ 16384 +#define AFPDIR 64 + +/* + * Per cylinder group information; summarized in blocks allocated + * from first cylinder group data blocks. These blocks have to be + * read in from fs_csaddr (size fs_cssize) in addition to the + * super block. + */ +struct csum { + int32_t cs_ndir; /* number of directories */ + int32_t cs_nbfree; /* number of free blocks */ + int32_t cs_nifree; /* number of free inodes */ + int32_t cs_nffree; /* number of free frags */ +}; + +/* + * Super block for an FFS file system. + */ +struct fs { + int32_t fs_firstfield; /* historic file system linked list, */ + int32_t fs_unused_1; /* used for incore super blocks */ + ufs_daddr_t fs_sblkno; /* addr of super-block in filesys */ + ufs_daddr_t fs_cblkno; /* offset of cyl-block in filesys */ + ufs_daddr_t fs_iblkno; /* offset of inode-blocks in filesys */ + ufs_daddr_t fs_dblkno; /* offset of first data after cg */ + int32_t fs_cgoffset; /* cylinder group offset in cylinder */ + int32_t fs_cgmask; /* used to calc mod fs_ntrak */ + u_int32_t fs_time; /* last time written */ + int32_t fs_size; /* number of blocks in fs */ + int32_t fs_dsize; /* number of data blocks in fs */ + int32_t fs_ncg; /* number of cylinder groups */ + int32_t fs_bsize; /* size of basic blocks in fs */ + int32_t fs_fsize; /* size of frag blocks in fs */ + int32_t fs_frag; /* number of frags in a block in fs */ +/* these are configuration parameters */ + int32_t fs_minfree; /* minimum percentage of free blocks */ + int32_t fs_rotdelay; /* num of ms for optimal next block */ + int32_t fs_rps; /* disk revolutions per second */ +/* these fields can be computed from the others */ + int32_t fs_bmask; /* ``blkoff'' calc of blk offsets */ + int32_t fs_fmask; /* ``fragoff'' calc of frag offsets */ + int32_t fs_bshift; /* ``lblkno'' calc of logical blkno */ + int32_t fs_fshift; /* ``numfrags'' calc number of frags */ +/* these are configuration parameters */ + int32_t fs_maxcontig; /* max number of contiguous blks */ + int32_t fs_maxbpg; /* max number of blks per cyl group */ +/* these fields can be computed from the others */ + int32_t fs_fragshift; /* block to frag shift */ + int32_t fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */ + int32_t fs_sbsize; /* actual size of super block */ + int32_t fs_csmask; /* csum block offset (now unused) */ + int32_t fs_csshift; /* csum block number (now unused) */ + int32_t fs_nindir; /* value of NINDIR */ + int32_t fs_inopb; /* value of INOPB */ + int32_t fs_nspf; /* value of NSPF */ +/* yet another configuration parameter */ + int32_t fs_optim; /* optimization preference, see below */ +/* these fields are derived from the hardware */ + int32_t fs_npsect; /* # sectors/track including spares */ + int32_t fs_interleave; /* hardware sector interleave */ + int32_t fs_trackskew; /* sector 0 skew, per track */ + int32_t fs_headswitch; /* head switch time, usec */ + int32_t fs_trkseek; /* track-to-track seek, usec */ +/* sizes determined by number of cylinder groups and their sizes */ + ufs_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */ + int32_t fs_cssize; /* size of cyl grp summary area */ + int32_t fs_cgsize; /* cylinder group size */ +/* these fields are derived from the hardware */ + int32_t fs_ntrak; /* tracks per cylinder */ + int32_t fs_nsect; /* sectors per track */ + int32_t fs_spc; /* sectors per cylinder */ +/* this comes from the disk driver partitioning */ + int32_t fs_ncyl; /* cylinders in file system */ +/* these fields can be computed from the others */ + int32_t fs_cpg; /* cylinders per group */ + int32_t fs_ipg; /* inodes per group */ + int32_t fs_fpg; /* blocks per group * fs_frag */ +/* this data must be re-computed after crashes */ + struct csum fs_cstotal; /* cylinder summary information */ +/* these fields are cleared at mount time */ + int8_t fs_fmod; /* super block modified flag */ + int8_t fs_clean; /* file system is clean flag */ + int8_t fs_ronly; /* mounted read-only flag */ + int8_t fs_flags; /* currently unused flag */ + u_char fs_fsmnt[MAXMNTLEN]; /* name mounted on */ +/* these fields retain the current block allocation info */ + int32_t fs_cgrotor; /* last cg searched */ + void *fs_ocsp[NOCSPTRS]; /* list of fs_cs info buffers */ + u_int8_t *fs_contigdirs; /* # of contiguously allocated dirs */ + struct csum *fs_csp; /* list of fs_cs info buffers */ + int32_t *fs_maxcluster; /* max cluster in each cyl group */ + int32_t fs_cpc; /* cyl per cycle in postbl */ + int16_t fs_opostbl[16][8]; /* old rotation block list head */ + int32_t fs_avgfilesize; /* expected average file size */ + int32_t fs_avgfpdir; /* expected # of files per directory */ + int32_t fs_sparecon[48]; /* reserved for future constants */ + int32_t fs_contigsumsize; /* size of cluster summary array */ + int32_t fs_maxsymlinklen; /* max length of an internal symlink */ + int32_t fs_inodefmt; /* format of on-disk inodes */ + u_int64_t fs_maxfilesize; /* maximum representable file size */ + int64_t fs_qbmask; /* ~fs_bmask for use with 64-bit size */ + int64_t fs_qfmask; /* ~fs_fmask for use with 64-bit size */ + int32_t fs_state; /* validate fs_clean field */ + int32_t fs_postblformat; /* format of positional layout tables */ + int32_t fs_nrpos; /* number of rotational positions */ + int32_t fs_postbloff; /* (u_int16) rotation block list head */ + int32_t fs_rotbloff; /* (u_int8) blocks for each rotation */ + int32_t fs_magic; /* magic number */ + u_int8_t fs_space[1]; /* list of blocks for each rotation */ +/* actually longer */ +} __attribute__((packed,aligned(4))); + +/* + * Filesystem identification + */ +#define FS_MAGIC 0x011954 /* the fast filesystem magic number */ +#define FS_OKAY 0x7c269d38 /* superblock checksum */ +#define FS_42INODEFMT -1 /* 4.2BSD inode format */ +#define FS_44INODEFMT 2 /* 4.4BSD inode format */ +/* + * Preference for optimization. + */ +#define FS_OPTTIME 0 /* minimize allocation time */ +#define FS_OPTSPACE 1 /* minimize disk fragmentation */ + +/* + * Rotational layout table format types + */ +#define FS_42POSTBLFMT -1 /* 4.2BSD rotational table format */ +#define FS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */ +/* + * Macros for access to superblock array structures + */ +#define fs_postbl(fs, cylno) \ + (((fs)->fs_postblformat == FS_42POSTBLFMT) \ + ? ((fs)->fs_opostbl[cylno]) \ + : ((int16_t *)((u_int8_t *)(fs) + \ + (fs)->fs_postbloff) + (cylno) * (fs)->fs_nrpos)) +#define fs_rotbl(fs) \ + (((fs)->fs_postblformat == FS_42POSTBLFMT) \ + ? ((fs)->fs_space) \ + : ((u_int8_t *)((u_int8_t *)(fs) + (fs)->fs_rotbloff))) + +/* + * The size of a cylinder group is calculated by CGSIZE. The maximum size + * is limited by the fact that cylinder groups are at most one block. + * Its size is derived from the size of the maps maintained in the + * cylinder group and the (struct cg) size. + */ +#define CGSIZE(fs) \ + /* base cg */ (sizeof(struct cg) + sizeof(int32_t) + \ + /* blktot size */ (fs)->fs_cpg * sizeof(int32_t) + \ + /* blks size */ (fs)->fs_cpg * (fs)->fs_nrpos * sizeof(int16_t) + \ + /* inode map */ howmany((fs)->fs_ipg, NBBY) + \ + /* block map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPF(fs), NBBY) +\ + /* if present */ ((fs)->fs_contigsumsize <= 0 ? 0 : \ + /* cluster sum */ (fs)->fs_contigsumsize * sizeof(int32_t) + \ + /* cluster map */ howmany((fs)->fs_cpg * (fs)->fs_spc / NSPB(fs), NBBY))) + +/* + * Convert cylinder group to base address of its global summary info. + * + * N.B. This macro assumes that sizeof(struct csum) is a power of two. + */ +#define fs_cs(fs, indx) fs_csp[indx] + +/* + * Cylinder group block for a file system. + */ +#define CG_MAGIC 0x090255 +struct cg { + int32_t cg_firstfield; /* historic cyl groups linked list */ + int32_t cg_magic; /* magic number */ + u_int32_t cg_time; /* time last written */ + int32_t cg_cgx; /* we are the cgx'th cylinder group */ + int16_t cg_ncyl; /* number of cyl's this cg */ + int16_t cg_niblk; /* number of inode blocks this cg */ + int32_t cg_ndblk; /* number of data blocks this cg */ + struct csum cg_cs; /* cylinder summary information */ + int32_t cg_rotor; /* position of last used block */ + int32_t cg_frotor; /* position of last used frag */ + int32_t cg_irotor; /* position of last used inode */ + int32_t cg_frsum[MAXFRAG]; /* counts of available frags */ + int32_t cg_btotoff; /* (int32) block totals per cylinder */ + int32_t cg_boff; /* (u_int16) free block positions */ + int32_t cg_iusedoff; /* (u_int8) used inode map */ + int32_t cg_freeoff; /* (u_int8) free block map */ + int32_t cg_nextfreeoff; /* (u_int8) next available space */ + int32_t cg_clustersumoff; /* (u_int32) counts of avail clusters */ + int32_t cg_clusteroff; /* (u_int8) free cluster map */ + int32_t cg_nclusterblks; /* number of clusters this cg */ + int32_t cg_sparecon[13]; /* reserved for future use */ + u_int8_t cg_space[1]; /* space for cylinder group maps */ +/* actually longer */ +} __attribute__((packed,aligned(4))); + +/* + * Macros for access to cylinder group array structures + */ +#define cg_blktot(cgp) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_btot) \ + : ((int32_t *)((u_int8_t *)(cgp) + (cgp)->cg_btotoff))) +#define cg_blks(fs, cgp, cylno) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_b[cylno]) \ + : ((int16_t *)((u_int8_t *)(cgp) + \ + (cgp)->cg_boff) + (cylno) * (fs)->fs_nrpos)) +#define cg_inosused(cgp) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_iused) \ + : ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_iusedoff))) +#define cg_blksfree(cgp) \ + (((cgp)->cg_magic != CG_MAGIC) \ + ? (((struct ocg *)(cgp))->cg_free) \ + : ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_freeoff))) +#define cg_chkmagic(cgp) \ + ((cgp)->cg_magic == CG_MAGIC || ((struct ocg *)(cgp))->cg_magic == CG_MAGIC) +#define cg_clustersfree(cgp) \ + ((u_int8_t *)((u_int8_t *)(cgp) + (cgp)->cg_clusteroff)) +#define cg_clustersum(cgp) \ + ((int32_t *)((u_int8_t *)(cgp) + (cgp)->cg_clustersumoff)) + +/* + * The following structure is defined + * for compatibility with old file systems. + */ +struct ocg { + int32_t cg_firstfield; /* historic linked list of cyl groups */ + int32_t cg_unused_1; /* used for incore cyl groups */ + u_int32_t cg_time; /* time last written */ + int32_t cg_cgx; /* we are the cgx'th cylinder group */ + int16_t cg_ncyl; /* number of cyl's this cg */ + int16_t cg_niblk; /* number of inode blocks this cg */ + int32_t cg_ndblk; /* number of data blocks this cg */ + struct csum cg_cs; /* cylinder summary information */ + int32_t cg_rotor; /* position of last used block */ + int32_t cg_frotor; /* position of last used frag */ + int32_t cg_irotor; /* position of last used inode */ + int32_t cg_frsum[8]; /* counts of available frags */ + int32_t cg_btot[32]; /* block totals per cylinder */ + int16_t cg_b[32][8]; /* positions of free blocks */ + u_int8_t cg_iused[256]; /* used inode map */ + int32_t cg_magic; /* magic number */ + u_int8_t cg_free[1]; /* free block map */ +/* actually longer */ +} __attribute__((packed,aligned(4))); + +/* + * Turn file system block numbers into disk block addresses. + * This maps file system blocks to device size blocks. + */ +#define fsbtodb(fs, b) ((b) << (fs)->fs_fsbtodb) +#define dbtofsb(fs, b) ((b) >> (fs)->fs_fsbtodb) + +/* + * Cylinder group macros to locate things in cylinder groups. + * They calc file system addresses of cylinder group data structures. + */ +#define cgbase(fs, c) ((ufs_daddr_t)((fs)->fs_fpg * (c))) +#define cgdmin(fs, c) (cgstart(fs, c) + (fs)->fs_dblkno) /* 1st data */ +#define cgimin(fs, c) (cgstart(fs, c) + (fs)->fs_iblkno) /* inode blk */ +#define cgsblock(fs, c) (cgstart(fs, c) + (fs)->fs_sblkno) /* super blk */ +#define cgtod(fs, c) (cgstart(fs, c) + (fs)->fs_cblkno) /* cg block */ +#define cgstart(fs, c) \ + (cgbase(fs, c) + (fs)->fs_cgoffset * ((c) & ~((fs)->fs_cgmask))) + +/* + * Macros for handling inode numbers: + * inode number to file system block offset. + * inode number to cylinder group number. + * inode number to file system block address. + */ +#define ino_to_cg(fs, x) ((x) / (fs)->fs_ipg) +#define ino_to_fsba(fs, x) \ + ((ufs_daddr_t)(cgimin(fs, ino_to_cg(fs, x)) + \ + (blkstofrags((fs), (((x) % (fs)->fs_ipg) / INOPB(fs)))))) +#define ino_to_fsbo(fs, x) ((x) % INOPB(fs)) + +/* + * Give cylinder group number for a file system block. + * Give cylinder group block number for a file system block. + */ +#define dtog(fs, d) ((d) / (fs)->fs_fpg) +#define dtogd(fs, d) ((d) % (fs)->fs_fpg) + +/* + * Extract the bits for a block from a map. + * Compute the cylinder and rotational position of a cyl block addr. + */ +#define blkmap(fs, map, loc) \ + (((map)[(loc) / NBBY] >> ((loc) % NBBY)) & (0xff >> (NBBY - (fs)->fs_frag))) +#define cbtocylno(fs, bno) \ + ((bno) * NSPF(fs) / (fs)->fs_spc) +#define cbtorpos(fs, bno) \ + (((bno) * NSPF(fs) % (fs)->fs_spc / (fs)->fs_nsect * (fs)->fs_trackskew + \ + (bno) * NSPF(fs) % (fs)->fs_spc % (fs)->fs_nsect * (fs)->fs_interleave) % \ + (fs)->fs_nsect * (fs)->fs_nrpos / (fs)->fs_npsect) + +/* + * The following macros optimize certain frequently calculated + * quantities by using shifts and masks in place of divisions + * modulos and multiplications. + */ +#define blkoff(fs, loc) /* calculates (loc % fs->fs_bsize) */ \ + ((loc) & (fs)->fs_qbmask) +#define fragoff(fs, loc) /* calculates (loc % fs->fs_fsize) */ \ + ((loc) & (fs)->fs_qfmask) +#define lblktosize(fs, blk) /* calculates (blk * fs->fs_bsize) */ \ + ((blk) << (fs)->fs_bshift) +#define lblkno(fs, loc) /* calculates (loc / fs->fs_bsize) */ \ + ((loc) >> (fs)->fs_bshift) +#define numfrags(fs, loc) /* calculates (loc / fs->fs_fsize) */ \ + ((loc) >> (fs)->fs_fshift) +#define blkroundup(fs, size) /* calculates roundup(size, fs->fs_bsize) */ \ + (((size) + (fs)->fs_qbmask) & (fs)->fs_bmask) +#define fragroundup(fs, size) /* calculates roundup(size, fs->fs_fsize) */ \ + (((size) + (fs)->fs_qfmask) & (fs)->fs_fmask) +#define fragstoblks(fs, frags) /* calculates (frags / fs->fs_frag) */ \ + ((frags) >> (fs)->fs_fragshift) +#define blkstofrags(fs, blks) /* calculates (blks * fs->fs_frag) */ \ + ((blks) << (fs)->fs_fragshift) +#define fragnum(fs, fsb) /* calculates (fsb % fs->fs_frag) */ \ + ((fsb) & ((fs)->fs_frag - 1)) +#define blknum(fs, fsb) /* calculates rounddown(fsb, fs->fs_frag) */ \ + ((fsb) &~ ((fs)->fs_frag - 1)) + +/* + * Determine the number of available frags given a + * percentage to hold in reserve. + */ +#define freespace(fs, percentreserved) \ + (blkstofrags((fs), (fs)->fs_cstotal.cs_nbfree) + \ + (fs)->fs_cstotal.cs_nffree - ((fs)->fs_dsize * (percentreserved) / 100)) + +/* + * Determining the size of a file block in the file system. + */ +#define blksize(fs, ip, lbn) \ + (((lbn) >= NDADDR || (ip)->i_size >= ((lbn) + 1) << (fs)->fs_bshift) \ + ? (fs)->fs_bsize \ + : (fragroundup(fs, blkoff(fs, (ip)->i_size)))) +#define dblksize(fs, dip, lbn) \ + (((lbn) >= NDADDR || (dip)->di_size >= ((lbn) + 1) << (fs)->fs_bshift) \ + ? (fs)->fs_bsize \ + : (fragroundup(fs, blkoff(fs, (dip)->di_size)))) + +/* + * Number of disk sectors per block/fragment; assumes DEV_BSIZE byte + * sector size. + */ +#define NSPB(fs) ((fs)->fs_nspf << (fs)->fs_fragshift) +#define NSPF(fs) ((fs)->fs_nspf) + +/* + * Number of inodes in a secondary storage block/fragment. + */ +#define INOPB(fs) ((fs)->fs_inopb) +#define INOPF(fs) ((fs)->fs_inopb >> (fs)->fs_fragshift) + +/* + * Number of indirects in a file system block. + */ +#define NINDIR(fs) ((fs)->fs_nindir) + +/* + * This macro controls whether the file system format is byte swapped or not. + * At NeXT, all little endian machines read and write big endian file systems. + */ +#define BIG_ENDIAN_FS (__LITTLE_ENDIAN__) + +#ifdef __APPLE_API_PRIVATE +extern int inside[], around[]; +extern u_char *fragtbl[]; +#endif /* __APPLE_API_PRIVATE */ + + +/* + * UFS Label: + * The purpose of this label is to name a UFS/FFS filesystem. The label + * is located at offset 7K (BBSIZE=8K - UFS_LABEL_SIZE=1K = 7K) of the + * partition. The first 7K is still available for boot blocks. + */ + +#define UFS_LABEL_MAGIC { 'L', 'A', 'B', 'L' } +#define UFS_LABEL_SIZE 1024 +#define UFS_LABEL_OFFSET (BBSIZE - UFS_LABEL_SIZE) /* top 1K */ +#define UFS_LABEL_VERSION 1 +#define UFS_MAX_LABEL_NAME 512 + +struct ufslabel { + u_int32_t ul_magic; + u_int16_t ul_checksum; /* checksum over entire label*/ + u_int32_t ul_version __attribute__((aligned(4))); /* label version */ + u_int32_t ul_time; /* creation time */ + u_int16_t ul_namelen; /* filesystem name length */ + u_char ul_name[UFS_MAX_LABEL_NAME]; /* filesystem name */ + u_int64_t ul_uuid __attribute__((aligned(4))); /* filesystem uuid */ + u_char ul_reserved[24];/* reserved for future use */ + u_char ul_unused[460]; /* pad out to 1K */ +} __attribute__((packed,aligned(4))); + +#endif /* __APPLE_API_UNSTABLE */ +#endif /* ! _FFS_FS_H_ */ diff --git a/i386/include/ufs/ufs/.svn/all-wcprops b/i386/include/ufs/ufs/.svn/all-wcprops new file mode 100644 index 0000000..38ee623 --- /dev/null +++ b/i386/include/ufs/ufs/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ufs +END +dir.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ufs/dir.h +END +inode.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ufs/inode.h +END +ufsmount.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ufs/ufsmount.h +END +dinode.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ufs/dinode.h +END +ufs_extern.h +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/include/ufs/ufs/ufs_extern.h +END diff --git a/i386/include/ufs/ufs/.svn/entries b/i386/include/ufs/ufs/.svn/entries new file mode 100644 index 0000000..072b61f --- /dev/null +++ b/i386/include/ufs/ufs/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/include/ufs/ufs +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +dir.h +file + + + + +2013-08-27T23:54:36.000000Z +350376fc1ed0075f042b30df7e303f5d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7694 + +inode.h +file + + + + +2013-08-27T23:54:36.000000Z +74d0cd7c722aa91f000b3b70c4b36211 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6960 + +ufsmount.h +file + + + + +2013-08-27T23:54:36.000000Z +a134517067aa6f2e06966fc3252d609c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3894 + +dinode.h +file + + + + +2013-08-27T23:54:36.000000Z +4b209e81fff45d2e4d7d38ac99d0cbad +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7000 + +ufs_extern.h +file + + + + +2013-08-27T23:54:36.000000Z +05119104b5835bf114fd1a2fc41d9724 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6912 + diff --git a/i386/include/ufs/ufs/.svn/text-base/dinode.h.svn-base b/i386/include/ufs/ufs/.svn/text-base/dinode.h.svn-base new file mode 100644 index 0000000..fddda8d --- /dev/null +++ b/i386/include/ufs/ufs/.svn/text-base/dinode.h.svn-base @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dinode.h 8.9 (Berkeley) 3/29/95 + */ +#ifndef _UFS_DINODE_H_ +#define _UFS_DINODE_H_ + + +#ifdef __APPLE_API_UNSTABLE +/* + * The root inode is the root of the file system. Inode 0 can't be used for + * normal purposes and historically bad blocks were linked to inode 1, thus + * the root inode is 2. (Inode 1 is no longer used for this purpose, however + * numerous dump tapes make this assumption, so we are stuck with it). + */ +#define ROOTINO ((ino_t)2) + +/* + * The Whiteout inode# is a dummy non-zero inode number which will + * never be allocated to a real file. It is used as a place holder + * in the directory entry which has been tagged as a DT_W entry. + * See the comments about ROOTINO above. + */ +#define WINO ((ino_t)1) + +/* + * A dinode contains all the meta-data associated with a UFS file. + * This structure defines the on-disk format of a dinode. Since + * this structure describes an on-disk structure, all its fields + * are defined by types with precise widths. + */ + +#define NDADDR 12 /* Direct addresses in inode. */ +#define NIADDR 3 /* Indirect addresses in inode. */ + +typedef int32_t ufs_daddr_t; + +struct dinode { + u_int16_t di_mode; /* 0: IFMT, permissions; see below. */ + int16_t di_nlink; /* 2: File link count. */ + union { + u_int16_t oldids[2]; /* 4: Ffs: old user and group ids. */ + int32_t inumber; /* 4: Lfs: inode number. */ + } di_u; + u_int64_t di_size; /* 8: File byte count. */ + int32_t di_atime; /* 16: Last access time. */ + int32_t di_atimensec; /* 20: Last access time. */ + int32_t di_mtime; /* 24: Last modified time. */ + int32_t di_mtimensec; /* 28: Last modified time. */ + int32_t di_ctime; /* 32: Last inode change time. */ + int32_t di_ctimensec; /* 36: Last inode change time. */ + ufs_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ + ufs_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ + u_int32_t di_flags; /* 100: Status flags (chflags). */ + u_int32_t di_blocks; /* 104: Blocks actually held. */ + int32_t di_gen; /* 108: Generation number. */ + u_int32_t di_uid; /* 112: File owner. */ + u_int32_t di_gid; /* 116: File group. */ + int32_t di_spare[2]; /* 120: Reserved; currently unused */ +} __attribute__((packed,aligned(4))); + +/* + * The di_db fields may be overlaid with other information for + * file types that do not have associated disk storage. Block + * and character devices overlay the first data block with their + * dev_t value. Short symbolic links place their path in the + * di_db area. + */ +#define di_inumber di_u.inumber +#define di_ogid di_u.oldids[1] +#define di_ouid di_u.oldids[0] +#define di_rdev di_db[0] +#define di_shortlink di_db +#define MAXSYMLINKLEN ((NDADDR + NIADDR) * sizeof(ufs_daddr_t)) + +/* File permissions. */ +#define IEXEC 0000100 /* Executable. */ +#define IWRITE 0000200 /* Writeable. */ +#define IREAD 0000400 /* Readable. */ +#define ISVTX 0001000 /* Sticky bit. */ +#define ISGID 0002000 /* Set-gid. */ +#define ISUID 0004000 /* Set-uid. */ + +/* File types. */ +#define IFMT 0170000 /* Mask of file type. */ +#define IFIFO 0010000 /* Named pipe (fifo). */ +#define IFCHR 0020000 /* Character device. */ +#define IFDIR 0040000 /* Directory file. */ +#define IFBLK 0060000 /* Block device. */ +#define IFREG 0100000 /* Regular file. */ +#define IFLNK 0120000 /* Symbolic link. */ +#define IFSOCK 0140000 /* UNIX domain socket. */ +#define IFWHT 0160000 /* Whiteout. */ + +#endif /* __APPLE_API_UNSTABLE */ +#endif /* ! _UFS_DINODE_H_ */ diff --git a/i386/include/ufs/ufs/.svn/text-base/dir.h.svn-base b/i386/include/ufs/ufs/.svn/text-base/dir.h.svn-base new file mode 100644 index 0000000..8a673e9 --- /dev/null +++ b/i386/include/ufs/ufs/.svn/text-base/dir.h.svn-base @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dir.h 8.5 (Berkeley) 4/27/95 + */ + +#ifndef _DIR_H_ +#define _DIR_H_ + +#ifdef __APPLE_API_UNSTABLE +/* + * Theoretically, directories can be more than 2Gb in length, however, in + * practice this seems unlikely. So, we define the type doff_t as a 32-bit + * quantity to keep down the cost of doing lookup on a 32-bit machine. + */ +#define doff_t int32_t +#define MAXDIRSIZE (0x7fffffff) + +/* + * A directory consists of some number of blocks of DIRBLKSIZ + * bytes, where DIRBLKSIZ is chosen such that it can be transferred + * to disk in a single atomic operation (e.g. 512 bytes on most machines). + * + * Each DIRBLKSIZ byte block contains some number of directory entry + * structures, which are of variable length. Each directory entry has + * a struct direct at the front of it, containing its inode number, + * the length of the entry, and the length of the name contained in + * the entry. These are followed by the name padded to a 4 byte boundary + * with null bytes. All names are guaranteed null terminated. + * The maximum length of a name in a directory is UFSMAXNAMLEN. + * + * The macro DIRSIZ(fmt, dp) gives the amount of space required to represent + * a directory entry. Free space in a directory is represented by + * entries which have dp->d_reclen > DIRSIZ(fmt, dp). All DIRBLKSIZ bytes + * in a directory block are claimed by the directory entries. This + * usually results in the last entry in a directory having a large + * dp->d_reclen. When entries are deleted from a directory, the + * space is returned to the previous entry in the same directory + * block by increasing its dp->d_reclen. If the first entry of + * a directory block is free, then its dp->d_ino is set to 0. + * Entries other than the first in a directory do not normally have + * dp->d_ino set to 0. + */ +#ifdef __APPLE__ +#define DIRBLKSIZ 1024 +#else +#define DIRBLKSIZ DEV_BSIZE +#endif +#define UFSMAXNAMLEN 255 + +struct direct { + u_int32_t d_ino; /* inode number of entry */ + u_int16_t d_reclen; /* length of this record */ + u_int8_t d_type; /* file type, see below */ + u_int8_t d_namlen; /* length of string in d_name */ + char d_name[UFSMAXNAMLEN + 1];/* name with length <= UFSMAXNAMLEN */ +} __attribute__((packed,aligned(4))); + +/* + * File types + */ +#define DT_UNKNOWN 0 +#define DT_FIFO 1 +#define DT_CHR 2 +#define DT_DIR 4 +#define DT_BLK 6 +#define DT_REG 8 +#define DT_LNK 10 +#define DT_SOCK 12 +#define DT_WHT 14 + +/* + * Convert between stat structure types and directory types. + */ +#define IFTODT(mode) (((mode) & 0170000) >> 12) +#define DTTOIF(dirtype) ((dirtype) << 12) + +/* + * The DIRSIZ macro gives the minimum record length which will hold + * the directory entry. This requires the amount of space in struct direct + * without the d_name field, plus enough space for the name with a terminating + * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. + */ +#if (BYTE_ORDER == LITTLE_ENDIAN) +#define DIRSIZ(oldfmt, dp) \ + ((oldfmt) ? \ + ((sizeof(struct direct) - (UFSMAXNAMLEN+1)) + (((dp)->d_type+1 + 3) &~ 3)) : \ + ((sizeof(struct direct) - (UFSMAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))) +#else +#define DIRSIZ(oldfmt, dp) \ + ((sizeof(struct direct) - (UFSMAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) +#endif +#define OLDDIRFMT 1 +#define NEWDIRFMT 0 + +/* + * Template for manipulating directories. Should use struct direct's, + * but the name field is UFSMAXNAMLEN - 1, and this just won't do. + */ +struct dirtemplate { + u_int32_t dot_ino; + int16_t dot_reclen; + u_int8_t dot_type; + u_int8_t dot_namlen; + char dot_name[4]; /* must be multiple of 4 */ + u_int32_t dotdot_ino; + int16_t dotdot_reclen; + u_int8_t dotdot_type; + u_int8_t dotdot_namlen; + char dotdot_name[4]; /* ditto */ +} __attribute__((packed,aligned(4))); + +/* + * This is the old format of directories, sanz type element. + */ +struct odirtemplate { + u_int32_t dot_ino; + int16_t dot_reclen; + u_int16_t dot_namlen; + char dot_name[4]; /* must be multiple of 4 */ + u_int32_t dotdot_ino; + int16_t dotdot_reclen; + u_int16_t dotdot_namlen; + char dotdot_name[4]; /* ditto */ +} __attribute__((packed,aligned(4))); + +#endif /* __APPLE_API_UNSTABLE */ +#endif /* !_DIR_H_ */ diff --git a/i386/include/ufs/ufs/.svn/text-base/inode.h.svn-base b/i386/include/ufs/ufs/.svn/text-base/inode.h.svn-base new file mode 100644 index 0000000..a614f82 --- /dev/null +++ b/i386/include/ufs/ufs/.svn/text-base/inode.h.svn-base @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)inode.h 8.9 (Berkeley) 5/14/95 + */ +#ifndef _UFS_INDOE_H_ +#define _UFS_INDOE_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_PRIVATE +#include <ufs/ufs/dir.h> +#include <ufs/ufs/dinode.h> +#include <sys/queue.h> +#include <sys/event.h> +#include <sys/lock.h> +#include <sys/quota.h> + +/* + * The inode is used to describe each active (or recently active) file in the + * UFS filesystem. It is composed of two types of information. The first part + * is the information that is needed only while the file is active (such as + * the identity of the file and linkage to speed its lookup). The second part + * is * the permanent meta-data associated with the file which is read in + * from the permanent dinode from long term storage when the file becomes + * active, and is put back when the file is no longer being used. + */ +struct inode { + LIST_ENTRY(inode) i_hash;/* Hash chain. */ + struct vnode *i_vnode;/* Vnode associated with this inode. */ + struct vnode *i_devvp;/* Vnode for block I/O. */ + u_int32_t i_flag; /* flags, see below */ + dev_t i_dev; /* Device associated with the inode. */ + ino_t i_number; /* The identity of the inode. */ + + union { /* Associated filesystem. */ + struct fs *fs; /* FFS */ + } inode_u; +#define i_fs inode_u.fs + + struct dquot *i_dquot[MAXQUOTAS]; /* Dquot structures. */ + u_quad_t i_modrev; /* Revision level for NFS lease. */ + void *i_lockf; /* DEPRECATED */ + + /* + * Side effects; used during directory lookup. + */ + int32_t i_count; /* Size of free slot in directory. */ + doff_t i_endoff; /* End of useful stuff in directory. */ + doff_t i_diroff; /* Offset in dir, where we found last entry. */ + doff_t i_offset; /* Offset of free space in directory. */ + ino_t i_ino; /* Inode number of found directory. */ + u_int32_t i_reclen; /* Size of found directory entry. */ + daddr_t i_lastr; /* last read... read-ahead */ + /* + * The on-disk dinode itself. + */ + struct dinode i_din; /* 128 bytes of the on-disk dinode. */ +}; + +#define i_atime i_din.di_atime +#define i_atimensec i_din.di_atimensec +#define i_blocks i_din.di_blocks +#define i_ctime i_din.di_ctime +#define i_ctimensec i_din.di_ctimensec +#define i_db i_din.di_db +#define i_flags i_din.di_flags +#define i_gen i_din.di_gen +#define i_gid i_din.di_gid +#define i_ib i_din.di_ib +#define i_mode i_din.di_mode +#define i_mtime i_din.di_mtime +#define i_mtimensec i_din.di_mtimensec +#define i_nlink i_din.di_nlink +#define i_rdev i_din.di_rdev +#define i_shortlink i_din.di_shortlink +#define i_size i_din.di_size +#define i_uid i_din.di_uid +#define i_spare i_din.di_spare +#define i_oldids i_din.di_u.oldids +#define i_inumber i_din.di_u.inumber + +/* These flags are kept in i_flag. */ +#define IN_ACCESS 0x0001 /* Access time update request. */ +#define IN_CHANGE 0x0002 /* Inode change time update request. */ +#define IN_UPDATE 0x0004 /* Modification time update request. */ +#define IN_MODIFIED 0x0008 /* Inode has been modified. */ +#define IN_RENAME 0x0010 /* Inode is being renamed. */ +#define IN_SHLOCK 0x0020 /* File has shared lock. */ +#define IN_EXLOCK 0x0040 /* File has exclusive lock. */ +#define IN_TRANSIT 0x0080 /* inode is getting recycled */ +#define IN_WTRANSIT 0x0100 /* waiting for inode getting recycled */ +#define IN_ALLOC 0x0200 /* being allocated */ +#define IN_WALLOC 0x0400 /* waiting for allocation to be done */ + + +#endif /* __APPLE_API_PRIVATE */ +#endif /* ! _UFS_INDOE_H_ */ diff --git a/i386/include/ufs/ufs/.svn/text-base/ufs_extern.h.svn-base b/i386/include/ufs/ufs/.svn/text-base/ufs_extern.h.svn-base new file mode 100644 index 0000000..7b1f7ba --- /dev/null +++ b/i386/include/ufs/ufs/.svn/text-base/ufs_extern.h.svn-base @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ufs_extern.h 8.10 (Berkeley) 5/14/95 + */ +#ifndef _UFS_EXTERN_H_ +#define _UFS_EXTERN_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_PRIVATE +struct buf; +struct direct; +struct disklabel; +struct flock; +struct inode; +struct mbuf; +struct mount; +struct nameidata; +struct proc; +#ifndef _KAUTH_CRED_T +#define _KAUTH_CRED_T +struct ucred; +typedef struct ucred *kauth_cred_t; +#endif /* !_KAUTH_CRED_T */ +struct ufs_args; +struct uio; +struct vnode_attr; +struct vfsconf; +struct vnode; + +__BEGIN_DECLS +int ufs_remove_internal(vnode_t, vnode_t, struct componentname *, int); +int ufs_access_internal(vnode_t, mode_t, kauth_cred_t); + +int ffs_read_internal(vnode_t, struct uio *, int, int); +int ffs_write_internal(vnode_t, struct uio *, int, kauth_cred_t); +int ffs_truncate_internal(vnode_t, off_t, int, kauth_cred_t); + +void diskerr + (struct buf *, char *, char *, int, int, struct disklabel *); +void disksort(struct buf *, struct buf *); +u_int dkcksum(struct disklabel *); +char *readdisklabel(dev_t, int (*)(), struct disklabel *); +int setdisklabel(struct disklabel *, struct disklabel *, u_int32_t); +int writedisklabel(dev_t, int (*)(), struct disklabel *); + +int ufs_access(struct vnop_access_args *); +int ufs_checkpath(struct inode *, struct inode *, kauth_cred_t); +int ufs_close(struct vnop_close_args *); +int ufs_create(struct vnop_create_args *); +void ufs_dirbad(struct inode *, doff_t, const char *); +int ufs_dirbadentry(struct vnode *, struct direct *, int); +int ufs_dirempty(struct inode *, ino_t, kauth_cred_t); +int ufs_direnter(struct inode *, struct vnode *,struct componentname *); +int ufs_dirremove(struct vnode *, struct componentname*); +int ufs_dirrewrite + (struct inode *, struct inode *, struct componentname *); +int ufs_getattr(struct vnop_getattr_args *); +int ufs_getlbns(struct vnode *, ufs_daddr_t, struct indir *, int *); +struct vnode * + ufs_ihashget(dev_t, ino_t); +void ufs_ihashinit(void); +void ufs_ihashins(struct inode *); +struct vnode * + ufs_ihashlookup(dev_t, ino_t); +void ufs_ihashrem(struct inode *); +int ufs_inactive(struct vnop_inactive_args *); +int ufs_init(struct vfsconf *); +int ufs_ioctl(struct vnop_ioctl_args *); +int ufs_link(struct vnop_link_args *); +int ufs_lookup(struct vnop_lookup_args *); +int ufs_makeinode(struct vnode_attr *, struct vnode *, struct vnode **, struct componentname *); +int ufs_mkdir(struct vnop_mkdir_args *); +int ufs_mknod(struct vnop_mknod_args *); +int ufs_mmap(struct vnop_mmap_args *); +int ufs_open(struct vnop_open_args *); +int ufs_pathconf(struct vnop_pathconf_args *); +int ufs_readdir(struct vnop_readdir_args *); +int ufs_readlink(struct vnop_readlink_args *); +int ufs_reclaim(struct vnode *, struct proc *); +int ufs_remove(struct vnop_remove_args *); +int ufs_rename(struct vnop_rename_args *); +#define ufs_revoke nop_revoke +int ufs_rmdir(struct vnop_rmdir_args *); +int ufs_root(struct mount *, struct vnode **, vfs_context_t); +int ufs_select(struct vnop_select_args *); +int ufs_setattr(struct vnop_setattr_args *); +int ufs_start(struct mount *, int, vfs_context_t); +int ufs_strategy(struct vnop_strategy_args *); +int ufs_symlink(struct vnop_symlink_args *); +int ufs_whiteout(struct vnop_whiteout_args *); +int ufsspec_close(struct vnop_close_args *); +int ufsspec_read(struct vnop_read_args *); +int ufsspec_write(struct vnop_write_args *); + +#if FIFO +int ufsfifo_read(struct vnop_read_args *); +int ufsfifo_write(struct vnop_write_args *); +int ufsfifo_close(struct vnop_close_args *); +#endif +int ufs_blktooff(struct vnop_blktooff_args *); +int ufs_blockmap(struct vnop_blockmap_args *); + +__END_DECLS + +#endif /* __APPLE_API_PRIVATE */ +#endif /* ! _UFS_EXTERN_H_ */ diff --git a/i386/include/ufs/ufs/.svn/text-base/ufsmount.h.svn-base b/i386/include/ufs/ufs/.svn/text-base/ufsmount.h.svn-base new file mode 100644 index 0000000..095069b --- /dev/null +++ b/i386/include/ufs/ufs/.svn/text-base/ufsmount.h.svn-base @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 + */ +#ifndef _UFS_UFSMOUNT_H_ +#define _UFS_UFSMOUNT_H_ + +#include <sys/appleapiopts.h> +#include <sys/quota.h> + +#ifdef __APPLE_API_UNSTABLE +/* + * Arguments to mount UFS-based filesystems + */ +struct ufs_args { + char *fspec; /* block special device to mount */ +}; +#endif /* __APPLE_API_UNSTABLE */ + +#ifdef __APPLE_API_OBSOLETE +#if MFS +/* + * Arguments to mount MFS + */ +struct mfs_args { + char *fspec; /* name to export for statfs */ + caddr_t base; /* base of file system in memory */ + uint32_t size; /* size of file system */ +}; +#endif /* MFS */ +#endif /* __APPLE_API_OBSOLETE */ + + +#endif /* ! _UFS_UFSMOUNT_H_ */ diff --git a/i386/include/ufs/ufs/dinode.h b/i386/include/ufs/ufs/dinode.h new file mode 100644 index 0000000..fddda8d --- /dev/null +++ b/i386/include/ufs/ufs/dinode.h @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dinode.h 8.9 (Berkeley) 3/29/95 + */ +#ifndef _UFS_DINODE_H_ +#define _UFS_DINODE_H_ + + +#ifdef __APPLE_API_UNSTABLE +/* + * The root inode is the root of the file system. Inode 0 can't be used for + * normal purposes and historically bad blocks were linked to inode 1, thus + * the root inode is 2. (Inode 1 is no longer used for this purpose, however + * numerous dump tapes make this assumption, so we are stuck with it). + */ +#define ROOTINO ((ino_t)2) + +/* + * The Whiteout inode# is a dummy non-zero inode number which will + * never be allocated to a real file. It is used as a place holder + * in the directory entry which has been tagged as a DT_W entry. + * See the comments about ROOTINO above. + */ +#define WINO ((ino_t)1) + +/* + * A dinode contains all the meta-data associated with a UFS file. + * This structure defines the on-disk format of a dinode. Since + * this structure describes an on-disk structure, all its fields + * are defined by types with precise widths. + */ + +#define NDADDR 12 /* Direct addresses in inode. */ +#define NIADDR 3 /* Indirect addresses in inode. */ + +typedef int32_t ufs_daddr_t; + +struct dinode { + u_int16_t di_mode; /* 0: IFMT, permissions; see below. */ + int16_t di_nlink; /* 2: File link count. */ + union { + u_int16_t oldids[2]; /* 4: Ffs: old user and group ids. */ + int32_t inumber; /* 4: Lfs: inode number. */ + } di_u; + u_int64_t di_size; /* 8: File byte count. */ + int32_t di_atime; /* 16: Last access time. */ + int32_t di_atimensec; /* 20: Last access time. */ + int32_t di_mtime; /* 24: Last modified time. */ + int32_t di_mtimensec; /* 28: Last modified time. */ + int32_t di_ctime; /* 32: Last inode change time. */ + int32_t di_ctimensec; /* 36: Last inode change time. */ + ufs_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ + ufs_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ + u_int32_t di_flags; /* 100: Status flags (chflags). */ + u_int32_t di_blocks; /* 104: Blocks actually held. */ + int32_t di_gen; /* 108: Generation number. */ + u_int32_t di_uid; /* 112: File owner. */ + u_int32_t di_gid; /* 116: File group. */ + int32_t di_spare[2]; /* 120: Reserved; currently unused */ +} __attribute__((packed,aligned(4))); + +/* + * The di_db fields may be overlaid with other information for + * file types that do not have associated disk storage. Block + * and character devices overlay the first data block with their + * dev_t value. Short symbolic links place their path in the + * di_db area. + */ +#define di_inumber di_u.inumber +#define di_ogid di_u.oldids[1] +#define di_ouid di_u.oldids[0] +#define di_rdev di_db[0] +#define di_shortlink di_db +#define MAXSYMLINKLEN ((NDADDR + NIADDR) * sizeof(ufs_daddr_t)) + +/* File permissions. */ +#define IEXEC 0000100 /* Executable. */ +#define IWRITE 0000200 /* Writeable. */ +#define IREAD 0000400 /* Readable. */ +#define ISVTX 0001000 /* Sticky bit. */ +#define ISGID 0002000 /* Set-gid. */ +#define ISUID 0004000 /* Set-uid. */ + +/* File types. */ +#define IFMT 0170000 /* Mask of file type. */ +#define IFIFO 0010000 /* Named pipe (fifo). */ +#define IFCHR 0020000 /* Character device. */ +#define IFDIR 0040000 /* Directory file. */ +#define IFBLK 0060000 /* Block device. */ +#define IFREG 0100000 /* Regular file. */ +#define IFLNK 0120000 /* Symbolic link. */ +#define IFSOCK 0140000 /* UNIX domain socket. */ +#define IFWHT 0160000 /* Whiteout. */ + +#endif /* __APPLE_API_UNSTABLE */ +#endif /* ! _UFS_DINODE_H_ */ diff --git a/i386/include/ufs/ufs/dir.h b/i386/include/ufs/ufs/dir.h new file mode 100644 index 0000000..8a673e9 --- /dev/null +++ b/i386/include/ufs/ufs/dir.h @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)dir.h 8.5 (Berkeley) 4/27/95 + */ + +#ifndef _DIR_H_ +#define _DIR_H_ + +#ifdef __APPLE_API_UNSTABLE +/* + * Theoretically, directories can be more than 2Gb in length, however, in + * practice this seems unlikely. So, we define the type doff_t as a 32-bit + * quantity to keep down the cost of doing lookup on a 32-bit machine. + */ +#define doff_t int32_t +#define MAXDIRSIZE (0x7fffffff) + +/* + * A directory consists of some number of blocks of DIRBLKSIZ + * bytes, where DIRBLKSIZ is chosen such that it can be transferred + * to disk in a single atomic operation (e.g. 512 bytes on most machines). + * + * Each DIRBLKSIZ byte block contains some number of directory entry + * structures, which are of variable length. Each directory entry has + * a struct direct at the front of it, containing its inode number, + * the length of the entry, and the length of the name contained in + * the entry. These are followed by the name padded to a 4 byte boundary + * with null bytes. All names are guaranteed null terminated. + * The maximum length of a name in a directory is UFSMAXNAMLEN. + * + * The macro DIRSIZ(fmt, dp) gives the amount of space required to represent + * a directory entry. Free space in a directory is represented by + * entries which have dp->d_reclen > DIRSIZ(fmt, dp). All DIRBLKSIZ bytes + * in a directory block are claimed by the directory entries. This + * usually results in the last entry in a directory having a large + * dp->d_reclen. When entries are deleted from a directory, the + * space is returned to the previous entry in the same directory + * block by increasing its dp->d_reclen. If the first entry of + * a directory block is free, then its dp->d_ino is set to 0. + * Entries other than the first in a directory do not normally have + * dp->d_ino set to 0. + */ +#ifdef __APPLE__ +#define DIRBLKSIZ 1024 +#else +#define DIRBLKSIZ DEV_BSIZE +#endif +#define UFSMAXNAMLEN 255 + +struct direct { + u_int32_t d_ino; /* inode number of entry */ + u_int16_t d_reclen; /* length of this record */ + u_int8_t d_type; /* file type, see below */ + u_int8_t d_namlen; /* length of string in d_name */ + char d_name[UFSMAXNAMLEN + 1];/* name with length <= UFSMAXNAMLEN */ +} __attribute__((packed,aligned(4))); + +/* + * File types + */ +#define DT_UNKNOWN 0 +#define DT_FIFO 1 +#define DT_CHR 2 +#define DT_DIR 4 +#define DT_BLK 6 +#define DT_REG 8 +#define DT_LNK 10 +#define DT_SOCK 12 +#define DT_WHT 14 + +/* + * Convert between stat structure types and directory types. + */ +#define IFTODT(mode) (((mode) & 0170000) >> 12) +#define DTTOIF(dirtype) ((dirtype) << 12) + +/* + * The DIRSIZ macro gives the minimum record length which will hold + * the directory entry. This requires the amount of space in struct direct + * without the d_name field, plus enough space for the name with a terminating + * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. + */ +#if (BYTE_ORDER == LITTLE_ENDIAN) +#define DIRSIZ(oldfmt, dp) \ + ((oldfmt) ? \ + ((sizeof(struct direct) - (UFSMAXNAMLEN+1)) + (((dp)->d_type+1 + 3) &~ 3)) : \ + ((sizeof(struct direct) - (UFSMAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))) +#else +#define DIRSIZ(oldfmt, dp) \ + ((sizeof(struct direct) - (UFSMAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) +#endif +#define OLDDIRFMT 1 +#define NEWDIRFMT 0 + +/* + * Template for manipulating directories. Should use struct direct's, + * but the name field is UFSMAXNAMLEN - 1, and this just won't do. + */ +struct dirtemplate { + u_int32_t dot_ino; + int16_t dot_reclen; + u_int8_t dot_type; + u_int8_t dot_namlen; + char dot_name[4]; /* must be multiple of 4 */ + u_int32_t dotdot_ino; + int16_t dotdot_reclen; + u_int8_t dotdot_type; + u_int8_t dotdot_namlen; + char dotdot_name[4]; /* ditto */ +} __attribute__((packed,aligned(4))); + +/* + * This is the old format of directories, sanz type element. + */ +struct odirtemplate { + u_int32_t dot_ino; + int16_t dot_reclen; + u_int16_t dot_namlen; + char dot_name[4]; /* must be multiple of 4 */ + u_int32_t dotdot_ino; + int16_t dotdot_reclen; + u_int16_t dotdot_namlen; + char dotdot_name[4]; /* ditto */ +} __attribute__((packed,aligned(4))); + +#endif /* __APPLE_API_UNSTABLE */ +#endif /* !_DIR_H_ */ diff --git a/i386/include/ufs/ufs/inode.h b/i386/include/ufs/ufs/inode.h new file mode 100644 index 0000000..a614f82 --- /dev/null +++ b/i386/include/ufs/ufs/inode.h @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)inode.h 8.9 (Berkeley) 5/14/95 + */ +#ifndef _UFS_INDOE_H_ +#define _UFS_INDOE_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_PRIVATE +#include <ufs/ufs/dir.h> +#include <ufs/ufs/dinode.h> +#include <sys/queue.h> +#include <sys/event.h> +#include <sys/lock.h> +#include <sys/quota.h> + +/* + * The inode is used to describe each active (or recently active) file in the + * UFS filesystem. It is composed of two types of information. The first part + * is the information that is needed only while the file is active (such as + * the identity of the file and linkage to speed its lookup). The second part + * is * the permanent meta-data associated with the file which is read in + * from the permanent dinode from long term storage when the file becomes + * active, and is put back when the file is no longer being used. + */ +struct inode { + LIST_ENTRY(inode) i_hash;/* Hash chain. */ + struct vnode *i_vnode;/* Vnode associated with this inode. */ + struct vnode *i_devvp;/* Vnode for block I/O. */ + u_int32_t i_flag; /* flags, see below */ + dev_t i_dev; /* Device associated with the inode. */ + ino_t i_number; /* The identity of the inode. */ + + union { /* Associated filesystem. */ + struct fs *fs; /* FFS */ + } inode_u; +#define i_fs inode_u.fs + + struct dquot *i_dquot[MAXQUOTAS]; /* Dquot structures. */ + u_quad_t i_modrev; /* Revision level for NFS lease. */ + void *i_lockf; /* DEPRECATED */ + + /* + * Side effects; used during directory lookup. + */ + int32_t i_count; /* Size of free slot in directory. */ + doff_t i_endoff; /* End of useful stuff in directory. */ + doff_t i_diroff; /* Offset in dir, where we found last entry. */ + doff_t i_offset; /* Offset of free space in directory. */ + ino_t i_ino; /* Inode number of found directory. */ + u_int32_t i_reclen; /* Size of found directory entry. */ + daddr_t i_lastr; /* last read... read-ahead */ + /* + * The on-disk dinode itself. + */ + struct dinode i_din; /* 128 bytes of the on-disk dinode. */ +}; + +#define i_atime i_din.di_atime +#define i_atimensec i_din.di_atimensec +#define i_blocks i_din.di_blocks +#define i_ctime i_din.di_ctime +#define i_ctimensec i_din.di_ctimensec +#define i_db i_din.di_db +#define i_flags i_din.di_flags +#define i_gen i_din.di_gen +#define i_gid i_din.di_gid +#define i_ib i_din.di_ib +#define i_mode i_din.di_mode +#define i_mtime i_din.di_mtime +#define i_mtimensec i_din.di_mtimensec +#define i_nlink i_din.di_nlink +#define i_rdev i_din.di_rdev +#define i_shortlink i_din.di_shortlink +#define i_size i_din.di_size +#define i_uid i_din.di_uid +#define i_spare i_din.di_spare +#define i_oldids i_din.di_u.oldids +#define i_inumber i_din.di_u.inumber + +/* These flags are kept in i_flag. */ +#define IN_ACCESS 0x0001 /* Access time update request. */ +#define IN_CHANGE 0x0002 /* Inode change time update request. */ +#define IN_UPDATE 0x0004 /* Modification time update request. */ +#define IN_MODIFIED 0x0008 /* Inode has been modified. */ +#define IN_RENAME 0x0010 /* Inode is being renamed. */ +#define IN_SHLOCK 0x0020 /* File has shared lock. */ +#define IN_EXLOCK 0x0040 /* File has exclusive lock. */ +#define IN_TRANSIT 0x0080 /* inode is getting recycled */ +#define IN_WTRANSIT 0x0100 /* waiting for inode getting recycled */ +#define IN_ALLOC 0x0200 /* being allocated */ +#define IN_WALLOC 0x0400 /* waiting for allocation to be done */ + + +#endif /* __APPLE_API_PRIVATE */ +#endif /* ! _UFS_INDOE_H_ */ diff --git a/i386/include/ufs/ufs/ufs_extern.h b/i386/include/ufs/ufs/ufs_extern.h new file mode 100644 index 0000000..7b1f7ba --- /dev/null +++ b/i386/include/ufs/ufs/ufs_extern.h @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/*- + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ufs_extern.h 8.10 (Berkeley) 5/14/95 + */ +#ifndef _UFS_EXTERN_H_ +#define _UFS_EXTERN_H_ + +#include <sys/appleapiopts.h> + +#ifdef __APPLE_API_PRIVATE +struct buf; +struct direct; +struct disklabel; +struct flock; +struct inode; +struct mbuf; +struct mount; +struct nameidata; +struct proc; +#ifndef _KAUTH_CRED_T +#define _KAUTH_CRED_T +struct ucred; +typedef struct ucred *kauth_cred_t; +#endif /* !_KAUTH_CRED_T */ +struct ufs_args; +struct uio; +struct vnode_attr; +struct vfsconf; +struct vnode; + +__BEGIN_DECLS +int ufs_remove_internal(vnode_t, vnode_t, struct componentname *, int); +int ufs_access_internal(vnode_t, mode_t, kauth_cred_t); + +int ffs_read_internal(vnode_t, struct uio *, int, int); +int ffs_write_internal(vnode_t, struct uio *, int, kauth_cred_t); +int ffs_truncate_internal(vnode_t, off_t, int, kauth_cred_t); + +void diskerr + (struct buf *, char *, char *, int, int, struct disklabel *); +void disksort(struct buf *, struct buf *); +u_int dkcksum(struct disklabel *); +char *readdisklabel(dev_t, int (*)(), struct disklabel *); +int setdisklabel(struct disklabel *, struct disklabel *, u_int32_t); +int writedisklabel(dev_t, int (*)(), struct disklabel *); + +int ufs_access(struct vnop_access_args *); +int ufs_checkpath(struct inode *, struct inode *, kauth_cred_t); +int ufs_close(struct vnop_close_args *); +int ufs_create(struct vnop_create_args *); +void ufs_dirbad(struct inode *, doff_t, const char *); +int ufs_dirbadentry(struct vnode *, struct direct *, int); +int ufs_dirempty(struct inode *, ino_t, kauth_cred_t); +int ufs_direnter(struct inode *, struct vnode *,struct componentname *); +int ufs_dirremove(struct vnode *, struct componentname*); +int ufs_dirrewrite + (struct inode *, struct inode *, struct componentname *); +int ufs_getattr(struct vnop_getattr_args *); +int ufs_getlbns(struct vnode *, ufs_daddr_t, struct indir *, int *); +struct vnode * + ufs_ihashget(dev_t, ino_t); +void ufs_ihashinit(void); +void ufs_ihashins(struct inode *); +struct vnode * + ufs_ihashlookup(dev_t, ino_t); +void ufs_ihashrem(struct inode *); +int ufs_inactive(struct vnop_inactive_args *); +int ufs_init(struct vfsconf *); +int ufs_ioctl(struct vnop_ioctl_args *); +int ufs_link(struct vnop_link_args *); +int ufs_lookup(struct vnop_lookup_args *); +int ufs_makeinode(struct vnode_attr *, struct vnode *, struct vnode **, struct componentname *); +int ufs_mkdir(struct vnop_mkdir_args *); +int ufs_mknod(struct vnop_mknod_args *); +int ufs_mmap(struct vnop_mmap_args *); +int ufs_open(struct vnop_open_args *); +int ufs_pathconf(struct vnop_pathconf_args *); +int ufs_readdir(struct vnop_readdir_args *); +int ufs_readlink(struct vnop_readlink_args *); +int ufs_reclaim(struct vnode *, struct proc *); +int ufs_remove(struct vnop_remove_args *); +int ufs_rename(struct vnop_rename_args *); +#define ufs_revoke nop_revoke +int ufs_rmdir(struct vnop_rmdir_args *); +int ufs_root(struct mount *, struct vnode **, vfs_context_t); +int ufs_select(struct vnop_select_args *); +int ufs_setattr(struct vnop_setattr_args *); +int ufs_start(struct mount *, int, vfs_context_t); +int ufs_strategy(struct vnop_strategy_args *); +int ufs_symlink(struct vnop_symlink_args *); +int ufs_whiteout(struct vnop_whiteout_args *); +int ufsspec_close(struct vnop_close_args *); +int ufsspec_read(struct vnop_read_args *); +int ufsspec_write(struct vnop_write_args *); + +#if FIFO +int ufsfifo_read(struct vnop_read_args *); +int ufsfifo_write(struct vnop_write_args *); +int ufsfifo_close(struct vnop_close_args *); +#endif +int ufs_blktooff(struct vnop_blktooff_args *); +int ufs_blockmap(struct vnop_blockmap_args *); + +__END_DECLS + +#endif /* __APPLE_API_PRIVATE */ +#endif /* ! _UFS_EXTERN_H_ */ diff --git a/i386/include/ufs/ufs/ufsmount.h b/i386/include/ufs/ufs/ufsmount.h new file mode 100644 index 0000000..095069b --- /dev/null +++ b/i386/include/ufs/ufs/ufsmount.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2000-2008 Apple, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ +/* + * Copyright (c) 1982, 1986, 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)ufsmount.h 8.6 (Berkeley) 3/30/95 + */ +#ifndef _UFS_UFSMOUNT_H_ +#define _UFS_UFSMOUNT_H_ + +#include <sys/appleapiopts.h> +#include <sys/quota.h> + +#ifdef __APPLE_API_UNSTABLE +/* + * Arguments to mount UFS-based filesystems + */ +struct ufs_args { + char *fspec; /* block special device to mount */ +}; +#endif /* __APPLE_API_UNSTABLE */ + +#ifdef __APPLE_API_OBSOLETE +#if MFS +/* + * Arguments to mount MFS + */ +struct mfs_args { + char *fspec; /* name to export for statfs */ + caddr_t base; /* base of file system in memory */ + uint32_t size; /* size of file system */ +}; +#endif /* MFS */ +#endif /* __APPLE_API_OBSOLETE */ + + +#endif /* ! _UFS_UFSMOUNT_H_ */ diff --git a/i386/include/unistd.h b/i386/include/unistd.h new file mode 100644 index 0000000..a15eee6 --- /dev/null +++ b/i386/include/unistd.h @@ -0,0 +1,623 @@ +/* + * Copyright (c) 2000, 2002-2006, 2008, 2009 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1998-1999 Apple Computer, Inc. All Rights Reserved + * Copyright (c) 1991, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)unistd.h 8.12 (Berkeley) 4/27/95 + * + * Copyright (c) 1998 Apple Compter, Inc. + * All Rights Reserved + */ + +/* History: + 7/14/99 EKN at Apple fixed getdirentriesattr from getdirentryattr + 3/26/98 CHW at Apple added real interface to searchfs call + 3/5/98 CHW at Apple added hfs semantic system calls headers +*/ + +#ifndef _UNISTD_H_ +#define _UNISTD_H_ + +#include <_types.h> +#include <sys/unistd.h> + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef _DEV_T +#define _DEV_T +typedef __darwin_dev_t dev_t; +#endif +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#ifndef _GID_T +#define _GID_T +typedef __darwin_gid_t gid_t; +#endif + +#ifndef _INTPTR_T +#define _INTPTR_T +typedef __darwin_intptr_t intptr_t; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef _MODE_T +#define _MODE_T +typedef __darwin_mode_t mode_t; +#endif +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#ifndef _OFF_T +#define _OFF_T +typedef __darwin_off_t off_t; +#endif + +#ifndef _PID_T +#define _PID_T +typedef __darwin_pid_t pid_t; +#endif + +#ifndef _SIZE_T +#define _SIZE_T +/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see: + * _GCC_SIZE_T */ +typedef __darwin_size_t size_t; +#endif + +#ifndef _SSIZE_T +#define _SSIZE_T +typedef __darwin_ssize_t ssize_t; +#endif + +#ifndef _UID_T +#define _UID_T +typedef __darwin_uid_t uid_t; /* user id */ +#endif + +#ifndef _USECONDS_T +#define _USECONDS_T +typedef __darwin_useconds_t useconds_t; +#endif + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#ifndef _UUID_T +#define _UUID_T +typedef __darwin_uuid_t uuid_t; +#endif /* _UUID_T */ +#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */ + +#define STDIN_FILENO 0 /* standard input file descriptor */ +#define STDOUT_FILENO 1 /* standard output file descriptor */ +#define STDERR_FILENO 2 /* standard error file descriptor */ + +#ifndef NULL +#define NULL __DARWIN_NULL +#endif /* ! NULL */ + +/* Version test macros */ +/* _POSIX_VERSION and _POSIX2_VERSION from sys/unistd.h */ +#define _XOPEN_VERSION 600 /* [XSI] */ +#define _XOPEN_XCU_VERSION 4 /* Older standard */ + + +/* Please keep this list in the same order as the applicable standard */ +#define _POSIX_ADVISORY_INFO (-1) /* [ADV] */ +#define _POSIX_ASYNCHRONOUS_IO (-1) /* [AIO] */ +#define _POSIX_BARRIERS (-1) /* [BAR] */ +#define _POSIX_CHOWN_RESTRICTED 200112L +#define _POSIX_CLOCK_SELECTION (-1) /* [CS] */ +#define _POSIX_CPUTIME (-1) /* [CPT] */ +#define _POSIX_FSYNC 200112L /* [FSC] */ +#define _POSIX_IPV6 200112L +#define _POSIX_JOB_CONTROL 200112L +#define _POSIX_MAPPED_FILES 200112L /* [MF] */ +#define _POSIX_MEMLOCK (-1) /* [ML] */ +#define _POSIX_MEMLOCK_RANGE (-1) /* [MR] */ +#define _POSIX_MEMORY_PROTECTION 200112L /* [MPR] */ +#define _POSIX_MESSAGE_PASSING (-1) /* [MSG] */ +#define _POSIX_MONOTONIC_CLOCK (-1) /* [MON] */ +#define _POSIX_NO_TRUNC 200112L +#define _POSIX_PRIORITIZED_IO (-1) /* [PIO] */ +#define _POSIX_PRIORITY_SCHEDULING (-1) /* [PS] */ +#define _POSIX_RAW_SOCKETS (-1) /* [RS] */ +#define _POSIX_READER_WRITER_LOCKS 200112L /* [THR] */ +#define _POSIX_REALTIME_SIGNALS (-1) /* [RTS] */ +#define _POSIX_REGEXP 200112L +#define _POSIX_SAVED_IDS 200112L /* XXX required */ +#define _POSIX_SEMAPHORES (-1) /* [SEM] */ +#define _POSIX_SHARED_MEMORY_OBJECTS (-1) /* [SHM] */ +#define _POSIX_SHELL 200112L +#define _POSIX_SPAWN (-1) /* [SPN] */ +#define _POSIX_SPIN_LOCKS (-1) /* [SPI] */ +#define _POSIX_SPORADIC_SERVER (-1) /* [SS] */ +#define _POSIX_SYNCHRONIZED_IO (-1) /* [SIO] */ +#define _POSIX_THREAD_ATTR_STACKADDR 200112L /* [TSA] */ +#define _POSIX_THREAD_ATTR_STACKSIZE 200112L /* [TSS] */ +#define _POSIX_THREAD_CPUTIME (-1) /* [TCT] */ +#define _POSIX_THREAD_PRIO_INHERIT (-1) /* [TPI] */ +#define _POSIX_THREAD_PRIO_PROTECT (-1) /* [TPP] */ +#define _POSIX_THREAD_PRIORITY_SCHEDULING (-1) /* [TPS] */ +#define _POSIX_THREAD_PROCESS_SHARED 200112L /* [TSH] */ +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L /* [TSF] */ +#define _POSIX_THREAD_SPORADIC_SERVER (-1) /* [TSP] */ +#define _POSIX_THREADS 200112L /* [THR] */ +#define _POSIX_TIMEOUTS (-1) /* [TMO] */ +#define _POSIX_TIMERS (-1) /* [TMR] */ +#define _POSIX_TRACE (-1) /* [TRC] */ +#define _POSIX_TRACE_EVENT_FILTER (-1) /* [TEF] */ +#define _POSIX_TRACE_INHERIT (-1) /* [TRI] */ +#define _POSIX_TRACE_LOG (-1) /* [TRL] */ +#define _POSIX_TYPED_MEMORY_OBJECTS (-1) /* [TYM] */ +#ifndef _POSIX_VDISABLE +#define _POSIX_VDISABLE 0xff /* same as sys/termios.h */ +#endif /* _POSIX_VDISABLE */ + +#define _POSIX2_C_BIND 200112L +#define _POSIX2_C_DEV 200112L /* c99 command */ +#define _POSIX2_CHAR_TERM 200112L +#define _POSIX2_FORT_DEV (-1) /* fort77 command */ +#define _POSIX2_FORT_RUN 200112L +#define _POSIX2_LOCALEDEF 200112L /* localedef command */ +#define _POSIX2_PBS (-1) +#define _POSIX2_PBS_ACCOUNTING (-1) +#define _POSIX2_PBS_CHECKPOINT (-1) +#define _POSIX2_PBS_LOCATE (-1) +#define _POSIX2_PBS_MESSAGE (-1) +#define _POSIX2_PBS_TRACK (-1) +#define _POSIX2_SW_DEV 200112L +#define _POSIX2_UPE 200112L /* XXXX no fc, newgrp, tabs */ + +#define _V6_ILP32_OFF32 (-1) +#define _V6_ILP32_OFFBIG (1) +#define _V6_LP64_OFF64 (-1) +#define _V6_LPBIG_OFFBIG (-1) + +#define _XBS5_ILP32_OFF32 _V6_ILP32_OFF32 /* legacy */ +#define _XBS5_ILP32_OFFBIG _V6_ILP32_OFFBIG /* legacy */ +#define _XBS5_LP64_OFF64 _V6_LP64_OFF64 /* legacy */ +#define _XBS5_LPBIG_OFFBIG _V6_LPBIG_OFFBIG /* legacy */ + +#define _XOPEN_CRYPT (1) +#define _XOPEN_ENH_I18N (1) /* XXX required */ +#define _XOPEN_LEGACY (-1) /* no ftime gcvt, wcswcs */ +#define _XOPEN_REALTIME (-1) /* no q'ed signals, mq_* */ +#define _XOPEN_REALTIME_THREADS (-1) /* no posix_spawn, et. al. */ +#define _XOPEN_SHM (1) +#define _XOPEN_STREAMS (-1) +#define _XOPEN_UNIX (1) + + +#define F_ULOCK 0 /* unlock locked section */ +#define F_LOCK 1 /* lock a section for exclusive use */ +#define F_TLOCK 2 /* test and lock a section for exclusive use */ +#define F_TEST 3 /* test a section for locks by other procs */ + +/* configurable system variables */ +#define _SC_ARG_MAX 1 +#define _SC_CHILD_MAX 2 +#define _SC_CLK_TCK 3 +#define _SC_NGROUPS_MAX 4 +#define _SC_OPEN_MAX 5 +#define _SC_JOB_CONTROL 6 +#define _SC_SAVED_IDS 7 +#define _SC_VERSION 8 +#define _SC_BC_BASE_MAX 9 +#define _SC_BC_DIM_MAX 10 +#define _SC_BC_SCALE_MAX 11 +#define _SC_BC_STRING_MAX 12 +#define _SC_COLL_WEIGHTS_MAX 13 +#define _SC_EXPR_NEST_MAX 14 +#define _SC_LINE_MAX 15 +#define _SC_RE_DUP_MAX 16 +#define _SC_2_VERSION 17 +#define _SC_2_C_BIND 18 +#define _SC_2_C_DEV 19 +#define _SC_2_CHAR_TERM 20 +#define _SC_2_FORT_DEV 21 +#define _SC_2_FORT_RUN 22 +#define _SC_2_LOCALEDEF 23 +#define _SC_2_SW_DEV 24 +#define _SC_2_UPE 25 +#define _SC_STREAM_MAX 26 +#define _SC_TZNAME_MAX 27 +#define _SC_ASYNCHRONOUS_IO 28 +#define _SC_PAGESIZE 29 +#define _SC_MEMLOCK 30 +#define _SC_MEMLOCK_RANGE 31 +#define _SC_MEMORY_PROTECTION 32 +#define _SC_MESSAGE_PASSING 33 +#define _SC_PRIORITIZED_IO 34 +#define _SC_PRIORITY_SCHEDULING 35 +#define _SC_REALTIME_SIGNALS 36 +#define _SC_SEMAPHORES 37 +#define _SC_FSYNC 38 +#define _SC_SHARED_MEMORY_OBJECTS 39 +#define _SC_SYNCHRONIZED_IO 40 +#define _SC_TIMERS 41 +#define _SC_AIO_LISTIO_MAX 42 +#define _SC_AIO_MAX 43 +#define _SC_AIO_PRIO_DELTA_MAX 44 +#define _SC_DELAYTIMER_MAX 45 +#define _SC_MQ_OPEN_MAX 46 +#define _SC_MAPPED_FILES 47 /* swap _SC_PAGESIZE vs. BSD */ +#define _SC_RTSIG_MAX 48 +#define _SC_SEM_NSEMS_MAX 49 +#define _SC_SEM_VALUE_MAX 50 +#define _SC_SIGQUEUE_MAX 51 +#define _SC_TIMER_MAX 52 +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#define _SC_NPROCESSORS_CONF 57 +#define _SC_NPROCESSORS_ONLN 58 +#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */ +#define _SC_2_PBS 59 +#define _SC_2_PBS_ACCOUNTING 60 +#define _SC_2_PBS_CHECKPOINT 61 +#define _SC_2_PBS_LOCATE 62 +#define _SC_2_PBS_MESSAGE 63 +#define _SC_2_PBS_TRACK 64 +#define _SC_ADVISORY_INFO 65 +#define _SC_BARRIERS 66 +#define _SC_CLOCK_SELECTION 67 +#define _SC_CPUTIME 68 +#define _SC_FILE_LOCKING 69 +#define _SC_GETGR_R_SIZE_MAX 70 +#define _SC_GETPW_R_SIZE_MAX 71 +#define _SC_HOST_NAME_MAX 72 +#define _SC_LOGIN_NAME_MAX 73 +#define _SC_MONOTONIC_CLOCK 74 +#define _SC_MQ_PRIO_MAX 75 +#define _SC_READER_WRITER_LOCKS 76 +#define _SC_REGEXP 77 +#define _SC_SHELL 78 +#define _SC_SPAWN 79 +#define _SC_SPIN_LOCKS 80 +#define _SC_SPORADIC_SERVER 81 +#define _SC_THREAD_ATTR_STACKADDR 82 +#define _SC_THREAD_ATTR_STACKSIZE 83 +#define _SC_THREAD_CPUTIME 84 +#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 +#define _SC_THREAD_KEYS_MAX 86 +#define _SC_THREAD_PRIO_INHERIT 87 +#define _SC_THREAD_PRIO_PROTECT 88 +#define _SC_THREAD_PRIORITY_SCHEDULING 89 +#define _SC_THREAD_PROCESS_SHARED 90 +#define _SC_THREAD_SAFE_FUNCTIONS 91 +#define _SC_THREAD_SPORADIC_SERVER 92 +#define _SC_THREAD_STACK_MIN 93 +#define _SC_THREAD_THREADS_MAX 94 +#define _SC_TIMEOUTS 95 +#define _SC_THREADS 96 +#define _SC_TRACE 97 +#define _SC_TRACE_EVENT_FILTER 98 +#define _SC_TRACE_INHERIT 99 +#define _SC_TRACE_LOG 100 +#define _SC_TTY_NAME_MAX 101 +#define _SC_TYPED_MEMORY_OBJECTS 102 +#define _SC_V6_ILP32_OFF32 103 +#define _SC_V6_ILP32_OFFBIG 104 +#define _SC_V6_LP64_OFF64 105 +#define _SC_V6_LPBIG_OFFBIG 106 +#define _SC_IPV6 118 +#define _SC_RAW_SOCKETS 119 +#define _SC_SYMLOOP_MAX 120 +#define _SC_ATEXIT_MAX 107 +#define _SC_IOV_MAX 56 +#define _SC_PAGE_SIZE _SC_PAGESIZE +#define _SC_XOPEN_CRYPT 108 +#define _SC_XOPEN_ENH_I18N 109 +#define _SC_XOPEN_LEGACY 110 +#define _SC_XOPEN_REALTIME 111 +#define _SC_XOPEN_REALTIME_THREADS 112 +#define _SC_XOPEN_SHM 113 +#define _SC_XOPEN_STREAMS 114 +#define _SC_XOPEN_UNIX 115 +#define _SC_XOPEN_VERSION 116 +#define _SC_XOPEN_XCU_VERSION 121 +#define _SC_XBS5_ILP32_OFF32 122 +#define _SC_XBS5_ILP32_OFFBIG 123 +#define _SC_XBS5_LP64_OFF64 124 +#define _SC_XBS5_LPBIG_OFFBIG 125 +#define _SC_SS_REPL_MAX 126 +#define _SC_TRACE_EVENT_NAME_MAX 127 +#define _SC_TRACE_NAME_MAX 128 +#define _SC_TRACE_SYS_MAX 129 +#define _SC_TRACE_USER_EVENT_MAX 130 +#define _SC_PASS_MAX 131 + +#ifndef _CS_PATH /* XXX temporary #ifdef'ed for <sys/unistd.h> */ +#define _CS_PATH 1 +#endif +#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2 +#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3 +#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4 +#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5 +#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6 +#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7 +#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8 +#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9 +#define _CS_POSIX_V6_LP64_OFF64_LIBS 10 +#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12 +#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13 +#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14 + +/* reserved for compatibility with Issue 5 */ +#define _CS_XBS5_ILP32_OFF32_CFLAGS 20 +#define _CS_XBS5_ILP32_OFF32_LDFLAGS 21 +#define _CS_XBS5_ILP32_OFF32_LIBS 22 +#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 23 +#define _CS_XBS5_ILP32_OFFBIG_CFLAGS 24 +#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS 25 +#define _CS_XBS5_ILP32_OFFBIG_LIBS 26 +#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 27 +#define _CS_XBS5_LP64_OFF64_CFLAGS 28 +#define _CS_XBS5_LP64_OFF64_LDFLAGS 29 +#define _CS_XBS5_LP64_OFF64_LIBS 30 +#define _CS_XBS5_LP64_OFF64_LINTFLAGS 31 +#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS 32 +#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS 33 +#define _CS_XBS5_LPBIG_OFFBIG_LIBS 34 +#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 35 + +#define _CS_DARWIN_USER_DIR 65536 +#define _CS_DARWIN_USER_TEMP_DIR 65537 +#define _CS_DARWIN_USER_CACHE_DIR 65538 + +__BEGIN_DECLS + +void _exit(int) __dead2; +int access(const char *, int); +unsigned int + alarm(unsigned int); +int chdir(const char *); +int chown(const char *, uid_t, gid_t); +int close(int) __DARWIN_ALIAS_C(close); +size_t confstr(int, char *, size_t) __DARWIN_ALIAS(confstr); +char *crypt(const char *, const char *); +char *ctermid(char *); +int dup(int); +int dup2(int, int); +#if __DARWIN_UNIX03 +void encrypt(char *, int) __DARWIN_ALIAS(encrypt); +#else /* !__DARWIN_UNIX03 */ +int encrypt(char *, int); +#endif /* __DARWIN_UNIX03 */ +int execl(const char *, const char *, ...); +int execle(const char *, const char *, ...); +int execlp(const char *, const char *, ...); +int execv(const char *, char * const *); +int execve(const char *, char * const *, char * const *); +int execvp(const char *, char * const *); +int fchown(int, uid_t, gid_t); +int fchdir(int); +pid_t fork(void); +long fpathconf(int, int); +int fsync(int) __DARWIN_ALIAS_C(fsync); +int ftruncate(int, off_t); +char *getcwd(char *, size_t); +gid_t getegid(void); +uid_t geteuid(void); +gid_t getgid(void); +#if defined(_DARWIN_UNLIMITED_GETGROUPS) || defined(_DARWIN_C_SOURCE) +int getgroups(int, gid_t []) __DARWIN_EXTSN(getgroups); +#else /* !_DARWIN_UNLIMITED_GETGROUPS && !_DARWIN_C_SOURCE */ +int getgroups(int, gid_t []); +#endif /* _DARWIN_UNLIMITED_GETGROUPS || _DARWIN_C_SOURCE */ +long gethostid(void); +int gethostname(char *, size_t); +char *getlogin(void); +int getlogin_r(char *, size_t); +int getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt); +pid_t getpgid(pid_t); +pid_t getpgrp(void); +pid_t getpid(void); +pid_t getppid(void); +pid_t getsid(pid_t); +uid_t getuid(void); +char *getwd(char *); /* obsoleted by getcwd() */ +int isatty(int); +int lchown(const char *, uid_t, gid_t) __DARWIN_ALIAS(lchown); +int link(const char *, const char *); +int lockf(int, int, off_t) __DARWIN_ALIAS_C(lockf); +off_t lseek(int, off_t, int); +int nice(int) __DARWIN_ALIAS(nice); +long pathconf(const char *, int); +int pause(void) __DARWIN_ALIAS_C(pause); +int pipe(int [2]); +ssize_t pread(int, void *, size_t, off_t) __DARWIN_ALIAS_C(pread); +ssize_t pwrite(int, const void *, size_t, off_t) __DARWIN_ALIAS_C(pwrite); +ssize_t read(int, void *, size_t) __DARWIN_ALIAS_C(read); +ssize_t readlink(const char * __restrict, char * __restrict, size_t); +int rmdir(const char *); +int setegid(gid_t); +int seteuid(uid_t); +int setgid(gid_t); +int setpgid(pid_t, pid_t); +#if __DARWIN_UNIX03 +pid_t setpgrp(void) __DARWIN_ALIAS(setpgrp); +#else /* !__DARWIN_UNIX03 */ +int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */ +#endif /* __DARWIN_UNIX03 */ +int setregid(gid_t, gid_t) __DARWIN_ALIAS(setregid); +int setreuid(uid_t, uid_t) __DARWIN_ALIAS(setreuid); +pid_t setsid(void); +int setuid(uid_t); +unsigned int + sleep(unsigned int) __DARWIN_ALIAS_C(sleep); +void swab(const void * __restrict, void * __restrict, ssize_t); +int symlink(const char *, const char *); +void sync(void); +long sysconf(int); +pid_t tcgetpgrp(int); +int tcsetpgrp(int, pid_t); +int truncate(const char *, off_t); +char *ttyname(int); +#if __DARWIN_UNIX03 +int ttyname_r(int, char *, size_t) __DARWIN_ALIAS(ttyname_r); +#else /* !__DARWIN_UNIX03 */ +char *ttyname_r(int, char *, size_t); +#endif /* __DARWIN_UNIX03 */ +useconds_t + ualarm(useconds_t, useconds_t); +int unlink(const char *); +int usleep(useconds_t) __DARWIN_ALIAS_C(usleep); +pid_t vfork(void); +ssize_t write(int, const void *, size_t) __DARWIN_ALIAS_C(write); + +extern char *optarg; /* getopt(3) external variables */ +extern int optind, opterr, optopt; + +#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) +#include <sys/select.h> + +void _Exit(int) __dead2; +int accessx_np(const struct accessx_descriptor *, size_t, int *, uid_t); +int acct(const char *); +int add_profil(char *, size_t, unsigned long, unsigned int); +void *brk(const void *); +int chroot(const char *); +void endusershell(void); +int execvP(const char *, const char *, char * const *); +char *fflagstostr(unsigned long); +int getdtablesize(void); +int getdomainname(char *, int); +int getgrouplist(const char *, int, int *, int *); +int gethostuuid(uuid_t, const struct timespec *); +mode_t getmode(const void *, mode_t); +int getpagesize(void) __pure2; +char *getpass(const char *); +int getpeereid(int, uid_t *, gid_t *); +int getpgid(pid_t _pid); +int getsgroups_np(int *, uuid_t); +int getsid(pid_t _pid); +char *getusershell(void); +int getwgroups_np(int *, uuid_t); +int initgroups(const char *, int); +int iruserok(unsigned long, int, const char *, const char *); +int iruserok_sa(const void *, int, int, const char *, const char *); +int issetugid(void); +char *mkdtemp(char *); +int mknod(const char *, mode_t, dev_t); +int mkstemp(char *); +int mkstemps(char *, int); +char *mktemp(char *); +int nfssvc(int, void *); +int profil(char *, size_t, unsigned long, unsigned int); +int pthread_setugid_np(uid_t, gid_t); +int pthread_getugid_np( uid_t *, gid_t *); +int rcmd(char **, int, const char *, const char *, const char *, int *); +int rcmd_af(char **, int, const char *, const char *, const char *, int *, + int); +int reboot(int); +int revoke(const char *); +int rresvport(int *); +int rresvport_af(int *, int); +int ruserok(const char *, int, const char *, const char *); +void *sbrk(int); +int setdomainname(const char *, int); +int setgroups(int, const gid_t *); +void sethostid(long); +int sethostname(const char *, int); +#if __DARWIN_UNIX03 +void setkey(const char *) __DARWIN_ALIAS(setkey); +#else /* !__DARWIN_UNIX03 */ +int setkey(const char *); +#endif /* __DARWIN_UNIX03 */ +int setlogin(const char *); +void *setmode(const char *) __DARWIN_ALIAS(setmode); +int setrgid(gid_t); +int setruid(uid_t); +int setsgroups_np(int, const uuid_t); +void setusershell(void); +int setwgroups_np(int, const uuid_t); +int strtofflags(char **, unsigned long *, unsigned long *); +int swapon(const char *); +int syscall(int, ...); +int ttyslot(void); +int undelete(const char *); +int unwhiteout(const char *); +void *valloc(size_t); + +extern char *suboptarg; /* getsubopt(3) external variable */ +int getsubopt(char **, char * const *, char **); + +/* HFS & HFS Plus semantics system calls go here */ +#ifdef __LP64__ +int fgetattrlist(int,void*,void*,size_t,unsigned int); +int fsetattrlist(int,void*,void*,size_t,unsigned int); +int getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist); +int setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist); +int exchangedata(const char*,const char*,unsigned int); +int getdirentriesattr(int,void*,void*,size_t,unsigned int*,unsigned int*,unsigned int*,unsigned int); + +#else /* __LP64__ */ +int fgetattrlist(int,void*,void*,size_t,unsigned long); +int fsetattrlist(int,void*,void*,size_t,unsigned long); +int getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist); +int setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist); +int exchangedata(const char*,const char*,unsigned long); +int getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long); + +#endif /* __LP64__ */ + +struct fssearchblock; +struct searchstate; + +int searchfs(const char *, struct fssearchblock *, unsigned long *, unsigned int, unsigned int, struct searchstate *); +int fsctl(const char *,unsigned long,void*,unsigned int); +int ffsctl(int,unsigned long,void*,unsigned int); + +extern int optreset; + +#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +__END_DECLS + +#endif /* !_UNISTD_H_ */ diff --git a/i386/include/unwind.h b/i386/include/unwind.h new file mode 100644 index 0000000..24cb87e --- /dev/null +++ b/i386/include/unwind.h @@ -0,0 +1,245 @@ +/* Exception handling and frame unwind runtime interface routines. + Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* This is derived from the C++ ABI for IA-64. Where we diverge + for cross-architecture compatibility are noted with "@@@". */ + +#ifndef _UNWIND_H +#define _UNWIND_H + +#ifndef HIDE_EXPORTS +#ifdef __GCC__ +#pragma GCC visibility push(default) +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Level 1: Base ABI */ + +/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is + inefficient for 32-bit and smaller machines. */ +typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); +typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); +#if defined(__ia64__) && defined(__hpux__) +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); +#else +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); +#endif +typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); + +/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and + consumer of an exception. We'll go along with this for now even on + 32-bit machines. We'll need to provide some other option for + 16-bit machines and for machines with > 8 bits per byte. */ +typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); + +/* The unwind interface uses reason codes in several contexts to + identify the reasons for failures or other actions. */ +typedef enum +{ + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 +} _Unwind_Reason_Code; + + +/* The unwind interface uses a pointer to an exception header object + as its representation of an exception being thrown. In general, the + full representation of an exception object is language- and + implementation-specific, but it will be prefixed by a header + understood by the unwind interface. */ + +struct _Unwind_Exception; + +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, + struct _Unwind_Exception *); + +struct _Unwind_Exception +{ + _Unwind_Exception_Class exception_class; + _Unwind_Exception_Cleanup_Fn exception_cleanup; + _Unwind_Word private_1; + _Unwind_Word private_2; + + /* @@@ The IA-64 ABI says that this structure must be double-word aligned. + Taking that literally does not make much sense generically. Instead we + provide the maximum alignment required by any type for the machine. */ +} __attribute__((__aligned__)); + + +/* The ACTIONS argument to the personality routine is a bitwise OR of one + or more of the following constants. */ +typedef int _Unwind_Action; + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 + +/* This is an opaque type used to refer to a system-specific data + structure used by the system unwinder. This context is created and + destroyed by the system, and passed to the personality routine + during unwinding. */ +struct _Unwind_Context; + +/* Raise an exception, passing along the given exception object. */ +extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); + +/* Raise an exception for forced unwinding. */ + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, + _Unwind_Stop_Fn, + void *); + +/* Helper to invoke the exception_cleanup routine. */ +extern void _Unwind_DeleteException (struct _Unwind_Exception *); + +/* Resume propagation of an existing exception. This is used after + e.g. executing cleanup code, and not to implement rethrowing. */ +extern void _Unwind_Resume (struct _Unwind_Exception *); + +/* @@@ Resume propagation of an FORCE_UNWIND exception, or to rethrow + a normal exception that was handled. */ +extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); + +/* @@@ Use unwind data to perform a stack backtrace. The trace callback + is called for every stack frame in the call chain, but no cleanup + actions are performed. */ +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) + (struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +/* These functions are used for communicating information about the unwind + context (i.e. the unwind descriptors and the user register state) between + the unwind library and the personality routine and landing pad. Only + selected registers maybe manipulated. */ + +extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); +extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); + +extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); +extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *); +extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); + +/* @@@ Retrieve the CFA of the given context. */ +extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); + +extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); + +extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); + + +/* The personality routine is the function in the C++ (or other language) + runtime library which serves as an interface between the system unwind + library and language-specific exception handling semantics. It is + specific to the code fragment described by an unwind info block, and + it is always referenced via the pointer in the unwind info block, and + hence it has no ABI-specified name. + + Note that this implies that two different C++ implementations can + use different names, and have different contents in the language + specific data area. Moreover, that the language specific data + area contains no version info because name of the function invoked + provides more effective versioning by detecting at link time the + lack of code to handle the different data format. */ + +typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *); + +/* @@@ The following alternate entry points are for setjmp/longjmp + based unwinding. */ + +struct SjLj_Function_Context; +extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); +extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); + +extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException + (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); +extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *); + +/* @@@ The following provide access to the base addresses for text + and data-relative addressing in the LDSA. In order to stay link + compatible with the standard ABI for IA-64, we inline these. */ + +#ifdef __ia64__ +#include <stdlib.h> + +static inline _Unwind_Ptr +_Unwind_GetDataRelBase (struct _Unwind_Context *_C) +{ + /* The GP is stored in R1. */ + return _Unwind_GetGR (_C, 1); +} + +static inline _Unwind_Ptr +_Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__))) +{ + abort (); + return 0; +} + +/* @@@ Retrieve the Backing Store Pointer of the given context. */ +extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *); +#else +extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); +extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); +#endif + +/* @@@ Given an address, return the entry point of the function that + contains it. */ +extern void * _Unwind_FindEnclosingFunction (void *pc); + +#ifdef __cplusplus +} +#endif + +#ifndef HIDE_EXPORTS +#ifdef __GCC__ +#pragma GCC visibility pop +#endif +#endif + +#endif /* unwind.h */ diff --git a/i386/klibc/.svn/all-wcprops b/i386/klibc/.svn/all-wcprops new file mode 100644 index 0000000..7e0b4b1 --- /dev/null +++ b/i386/klibc/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/klibc +END +strlcpy.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/klibc/strlcpy.c +END +LICENSE +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/klibc/LICENSE +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/klibc/Makefile +END diff --git a/i386/klibc/.svn/entries b/i386/klibc/.svn/entries new file mode 100644 index 0000000..3c8b77e --- /dev/null +++ b/i386/klibc/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/klibc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +strlcpy.c +file + + + + +2013-08-27T23:54:51.000000Z +f2d442a513cd25f3ea3bf7ebc720fc88 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +373 + +LICENSE +file + + + + +2013-08-27T23:54:51.000000Z +d75181f10e998c21eb147f6d2e43ce8b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3742 + +Makefile +file + + + + +2013-08-27T23:54:51.000000Z +5d3aa98336fbcf073b442a1cce934fb6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1224 + diff --git a/i386/klibc/.svn/text-base/LICENSE.svn-base b/i386/klibc/.svn/text-base/LICENSE.svn-base new file mode 100644 index 0000000..aa6d7a7 --- /dev/null +++ b/i386/klibc/.svn/text-base/LICENSE.svn-base @@ -0,0 +1,73 @@ +This license applies to all files in directory and its subdirectories, +unless otherwise noted in individual files. + + +Some files are derived from files derived from the include/ directory +of the Linux kernel, and are licensed under the terms of the GNU +General Public License, version 2, as released by the Free Software +Foundation, Inc.; incorporated herein by reference. + + ----- + +Some files are derived from files copyrighted by the Regents of The +University of California, and are available under the following +license: + +Note: The advertising clause in the license appearing on BSD Unix +files was officially rescinded by the Director of the Office of +Technology Licensing of the University of California on July 22 +1999. He states that clause 3 is "hereby deleted in its entirety." + + * Copyright (c) + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + + ----- + +For all remaining files, the following license applies: + + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * Any copyright notice(s) and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/i386/klibc/.svn/text-base/Makefile.svn-base b/i386/klibc/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..b3701b7 --- /dev/null +++ b/i386/klibc/.svn/text-base/Makefile.svn-base @@ -0,0 +1,50 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/klibc +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = klibc +include ${SRCROOT}/Make.rules + +# LIBSAIODIR = ../libsaio + +CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ + -march=pentium4 -msse2 -msoft-float -fno-stack-protector \ + -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ + +INC = -I. -I$(SYMROOT) -I${SRCROOT}/i386/include + +OBJS = strlcpy.o + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +LIBS = libklibc.a +LIBS := $(addprefix $(SYMROOT)/, $(LIBS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +all embedtheme: $(DIRS_NEEDED) $(LIBS) + + +$(LIBS): $(OBJS) + @echo "\t[RM] $@" + @rm -f $@ + @echo "\t[AR] $(@F)" + @ar q $@ $^ &> /dev/null + @echo "\t[RANLIB] $(@F)" + @ranlib $@ + +# dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for l in $(LIBS); do if [ -f "$${l}" ];then echo "\t[RM] $${l}"; fi; done + @rm -f $(LIBS) $(OBJS) diff --git a/i386/klibc/.svn/text-base/strlcpy.c.svn-base b/i386/klibc/.svn/text-base/strlcpy.c.svn-base new file mode 100644 index 0000000..51c72d8 --- /dev/null +++ b/i386/klibc/.svn/text-base/strlcpy.c.svn-base @@ -0,0 +1,27 @@ +/* + * strlcpy.c + */ + +#include <string.h> +#include <klibc/compiler.h> + +size_t strlcpy(char *dst, const char *src, size_t size) +{ + size_t bytes = 0; + char *q = dst; + const char *p = src; + char ch; + + while ((ch = *p++)) { + if (bytes + 1 < size) + *q++ = ch; + + bytes++; + } + + /* If size == 0 there is no space for a final null... */ + if (size) + *q = '\0'; + + return bytes; +} diff --git a/i386/klibc/LICENSE b/i386/klibc/LICENSE new file mode 100644 index 0000000..aa6d7a7 --- /dev/null +++ b/i386/klibc/LICENSE @@ -0,0 +1,73 @@ +This license applies to all files in directory and its subdirectories, +unless otherwise noted in individual files. + + +Some files are derived from files derived from the include/ directory +of the Linux kernel, and are licensed under the terms of the GNU +General Public License, version 2, as released by the Free Software +Foundation, Inc.; incorporated herein by reference. + + ----- + +Some files are derived from files copyrighted by the Regents of The +University of California, and are available under the following +license: + +Note: The advertising clause in the license appearing on BSD Unix +files was officially rescinded by the Director of the Office of +Technology Licensing of the University of California on July 22 +1999. He states that clause 3 is "hereby deleted in its entirety." + + * Copyright (c) + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + + ----- + +For all remaining files, the following license applies: + + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * Any copyright notice(s) and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/i386/klibc/Makefile b/i386/klibc/Makefile new file mode 100644 index 0000000..b3701b7 --- /dev/null +++ b/i386/klibc/Makefile @@ -0,0 +1,50 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/klibc +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = klibc +include ${SRCROOT}/Make.rules + +# LIBSAIODIR = ../libsaio + +CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ + -march=pentium4 -msse2 -msoft-float -fno-stack-protector \ + -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ + +INC = -I. -I$(SYMROOT) -I${SRCROOT}/i386/include + +OBJS = strlcpy.o + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +LIBS = libklibc.a +LIBS := $(addprefix $(SYMROOT)/, $(LIBS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +all embedtheme: $(DIRS_NEEDED) $(LIBS) + + +$(LIBS): $(OBJS) + @echo "\t[RM] $@" + @rm -f $@ + @echo "\t[AR] $(@F)" + @ar q $@ $^ &> /dev/null + @echo "\t[RANLIB] $(@F)" + @ranlib $@ + +# dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for l in $(LIBS); do if [ -f "$${l}" ];then echo "\t[RM] $${l}"; fi; done + @rm -f $(LIBS) $(OBJS) diff --git a/i386/klibc/strlcpy.c b/i386/klibc/strlcpy.c new file mode 100644 index 0000000..51c72d8 --- /dev/null +++ b/i386/klibc/strlcpy.c @@ -0,0 +1,27 @@ +/* + * strlcpy.c + */ + +#include <string.h> +#include <klibc/compiler.h> + +size_t strlcpy(char *dst, const char *src, size_t size) +{ + size_t bytes = 0; + char *q = dst; + const char *p = src; + char ch; + + while ((ch = *p++)) { + if (bytes + 1 < size) + *q++ = ch; + + bytes++; + } + + /* If size == 0 there is no space for a final null... */ + if (size) + *q = '\0'; + + return bytes; +} diff --git a/i386/libsa/.svn/all-wcprops b/i386/libsa/.svn/all-wcprops new file mode 100644 index 0000000..4513504 --- /dev/null +++ b/i386/libsa/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsa +END +libsa.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsa/libsa.h +END +efi_tables.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/efi_tables.h +END +printf.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/printf.c +END +setjmp.s +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/setjmp.s +END +zalloc.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/zalloc.c +END +string.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/string.c +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/Cconfig +END +prf.c +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/prf.c +END +strtol.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/strtol.c +END +qsort.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/qsort.c +END +error.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/error.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/Makefile +END +efi_tables.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/efi_tables.c +END +memory.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsa/memory.h +END diff --git a/i386/libsa/.svn/entries b/i386/libsa/.svn/entries new file mode 100644 index 0000000..97f6fe9 --- /dev/null +++ b/i386/libsa/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/libsa +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +libsa.h +file + + + + +2013-08-27T23:55:05.000000Z +c9d23b3b581898595430b34e7e16d3ed +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +4327 + +efi_tables.h +file + + + + +2013-08-27T23:55:05.000000Z +4a9fb7a2031b183c266fc6bda828da8e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +504 + +printf.c +file + + + + +2013-08-27T23:55:05.000000Z +04859f4f7147e808c5eb4f51628087c5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2025 + +setjmp.s +file + + + + +2013-08-27T23:55:05.000000Z +6f0924ef7fbb89568508491eecdd525a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1889 + +zalloc.c +file + + + + +2013-08-27T23:55:05.000000Z +df6611f10c5540a9786cd14198fb475e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7747 + +string.c +file + + + + +2013-08-27T23:55:05.000000Z +7163e32b42aebafebce2c8f3b5756e2c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6332 + +Cconfig +file + + + + +2013-08-27T23:55:05.000000Z +68b329da9893e34099c7d8ad5cb9c940 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1 + +prf.c +file + + + + +2013-08-27T23:55:05.000000Z +c91f61d966816402a829437f0a5fe911 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3786 + +strtol.c +file + + + + +2013-08-27T23:55:05.000000Z +e93dad08b322204c3ac811591f3d0e7f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8778 + +qsort.c +file + + + + +2013-08-27T23:55:05.000000Z +6be2df2d400f4a27b757cb65546cfb03 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5868 + +error.c +file + + + + +2013-08-27T23:55:05.000000Z +b8160121763eaf2ea57340cfddb9e6b9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1238 + +Makefile +file + + + + +2013-08-27T23:55:05.000000Z +d1f5b7490fc449963398c49bb535af81 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1311 + +efi_tables.c +file + + + + +2013-08-27T23:55:05.000000Z +22336c6979207c8c5c3f79816960884f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7010 + +memory.h +file + + + + +2013-08-27T23:55:05.000000Z +02f94cff2a248a7e8d77504f9ec9b085 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4773 + diff --git a/i386/libsa/.svn/text-base/Cconfig.svn-base b/i386/libsa/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/i386/libsa/.svn/text-base/Cconfig.svn-base @@ -0,0 +1 @@ + diff --git a/i386/libsa/.svn/text-base/Makefile.svn-base b/i386/libsa/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..1d8ac09 --- /dev/null +++ b/i386/libsa/.svn/text-base/Makefile.svn-base @@ -0,0 +1,52 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/libsa +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = libsa +include ${SRCROOT}/Make.rules + +LIBSAIODIR = ../libsaio + +CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ + -march=pentium4 -msse2 -msoft-float -fno-stack-protector \ + -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ + +INC = -I. -I$(SYMROOT) -I$(LIBSAIODIR) -I${SRCROOT}/i386/include + +OBJS = prf.o printf.o zalloc.o \ + string.o strtol.o error.o \ + setjmp.o qsort.o efi_tables.o + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +LIBS = libsa.a +LIBS := $(addprefix $(SYMROOT)/, $(LIBS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +all embedtheme: $(DIRS_NEEDED) $(LIBS) + + +$(LIBS): $(OBJS) + @echo "\t[RM] $@" + @rm -f $@ + @echo "\t[AR] $(@F)" + @ar q $@ $^ &> /dev/null + @echo "\t[RANLIB] $(@F)" + @ranlib $@ + +# dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for l in $(LIBS); do if [ -f "$${l}" ];then echo "\t[RM] $${l}"; fi; done + @rm -f $(LIBS) $(OBJS) diff --git a/i386/libsa/.svn/text-base/efi_tables.c.svn-base b/i386/libsa/.svn/text-base/efi_tables.c.svn-base new file mode 100644 index 0000000..c136c31 --- /dev/null +++ b/i386/libsa/.svn/text-base/efi_tables.c.svn-base @@ -0,0 +1,162 @@ +/*! @file efi_tables.c + Copyright 2007 David F. Elliott. All rights reserved. + */ +#include "libsa.h" +#include "efi_tables.h" + + +/*========================================================================== + * CRC32 implementation copied from xnu in turn copied from Gary S. Brown. + */ + +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +static uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t crc32(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p; + + p = buf; + crc = crc ^ ~0U; + + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + + return crc ^ ~0U; +} + + +/*========================================================================== + * Utility function to make a device tree string from an EFI_GUID + */ + +void efi_guid_unparse_upper(EFI_GUID const *pGuid, char *out) +{ + sprintf(out, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", + pGuid->Data1, /* - */ + pGuid->Data2, /* - */ + pGuid->Data3, /* - */ + pGuid->Data4[0], pGuid->Data4[1], /* - */ + pGuid->Data4[2], pGuid->Data4[3], + pGuid->Data4[4], pGuid->Data4[5], + pGuid->Data4[6], pGuid->Data4[7]); +} + +bool efi_guid_is_null(EFI_GUID const *pGuid) +{ + if(pGuid->Data1 == 0 && pGuid->Data2 == 0 && pGuid->Data3 == 0) + { + int i; + for(i=0; i<8; ++i) + { + if(pGuid->Data4[i] != 0) + return false; + } + return true; + } + return false; +} + +#define COMPARE_MEMBER_AND_RETURN_IF_NE(a,b,mem) \ + if( ((a)->mem) < ((b)->mem) ) \ + return -1; \ + else if( ((a)->mem) > ((b)->mem) ) \ + return 1; + +int efi_guid_compare(EFI_GUID const *pG1, EFI_GUID const *pG2) +{ + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data1); + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data2); + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data3); + int i; + for(i=0; i<8; ++i) + { + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data4[i]); + } + return 0; +} diff --git a/i386/libsa/.svn/text-base/efi_tables.h.svn-base b/i386/libsa/.svn/text-base/efi_tables.h.svn-base new file mode 100644 index 0000000..8ff5171 --- /dev/null +++ b/i386/libsa/.svn/text-base/efi_tables.h.svn-base @@ -0,0 +1,16 @@ +/*! @file efi_tables.h + @abstract Utility functions for dealing with EFI tables + Copyright 2007 David F. Elliott. All rights reserved. + */ +#ifndef _LIBSA_EFI_TABLES_H__ +#define _LIBSA_EFI_TABLES_H__ + +#include "efi.h" + +uint32_t crc32(uint32_t crc, const void *buf, size_t size); + +void efi_guid_unparse_upper(EFI_GUID const *pGuid, char *out); +bool efi_guid_is_null(EFI_GUID const *pGuid); +int efi_guid_compare(EFI_GUID const *pG1, EFI_GUID const *pG2); + +#endif //ndef _LIBSA_EFI_TABLES_H__ diff --git a/i386/libsa/.svn/text-base/error.c.svn-base b/i386/libsa/.svn/text-base/error.c.svn-base new file mode 100644 index 0000000..d64a521 --- /dev/null +++ b/i386/libsa/.svn/text-base/error.c.svn-base @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* error handling */ + +#include "libsa.h" + +int errno; + +char * strerror(int errnum) +{ + static char error_string[16]; + sprintf(error_string,"Error %d", errnum); + return error_string; +} diff --git a/i386/libsa/.svn/text-base/libsa.h.svn-base b/i386/libsa/.svn/text-base/libsa.h.svn-base new file mode 100644 index 0000000..a6afc9d --- /dev/null +++ b/i386/libsa/.svn/text-base/libsa.h.svn-base @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOT_LIBSA_H +#define __BOOT_LIBSA_H + +/* Exported API for standalone library */ + +#include <mach-o/loader.h> +#include <stdarg.h> +#include <stddef.h> +#include <stdbool.h> + +/* + * ctype stuff (aserebln) + */ +static inline int isupper(int c) +{ + return (c >= 'A' && c <= 'Z'); +} + +static inline int islower(int c) +{ + return (c >= 'a' && c <= 'z'); +} + +static inline int isalpha(int c) +{ + return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')); +} + +static inline int isascii(int c) +{ + return ( (c >= 0x20) && (c < 0x7f) ); +} + +static inline int isspace(int c) +{ + return (c == ' ' || c == '\t' || c == '\n' || c == '\12'); +} + +static inline int isdigit(int c) +{ + return (c >= '0' && c <= '9'); +} + +static inline int isxdigit(int c) +{ + return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')); +} + +static inline int ispunct(int c) +{ + return (c == '.' || c == '-'); +} + +/* + * string.c + */ +#ifndef bcopy +extern void bcopy(const void * src, void * dst, size_t len); +#endif + +#ifndef bzero +extern void bzero(void * dst, size_t len); +#else +#error bzero is defined. +#endif + +extern void * memset(void * dst, int c, size_t n); +extern void * memcpy(void * dst, const void * src, size_t len); +extern int memcmp(const void * p1, const void * p2, size_t len); +extern int strcmp(const char * s1, const char * s2); +extern int strncmp(const char * s1, const char * s2, size_t n); +extern char * strcpy(char * s1, const char * s2); +extern char * strncpy(char * s1, const char * s2, size_t n); +extern size_t strlcpy(char * s1, const char * s2, size_t n); +extern char * strstr(const char *in, const char *str); +extern int atoi(const char * str); +extern int ptol(const char * str); +extern size_t strlen(const char * str); +extern char * strcat(char * s1, const char * s2); +extern char * strncat(char * s1, const char * s2, size_t n); +extern char * strdup(const char *s1); + +#if STRNCASECMP +extern int strncasecmp(const char * s1, const char * s2, size_t n); +#endif + +extern char * strchr(const char *str, int c); +extern char * strbreak(const char *str, char **next, long *len); + +extern uint8_t checksum8( void * start, unsigned int length ); + +/* + * error.c + */ +extern int errno; +extern char * strerror(int errnum); + +/* + * strtol.c + */ +extern long strtol(const char * nptr, char ** endptr, int base); +extern unsigned long strtoul(const char * nptr, char ** endptr, int base); +extern unsigned long long strtouq(const char *nptr, char ** endptr, int base); + +/* + * prf.c + */ +extern void prf(const char * fmt, va_list ap, int (*putfn_p)(), + void * putfn_arg); + +/* + * printf.c + */ +extern int sprintf(char *s, const char * format, ...); +extern int slvprintf(char * buffer, int len, const char * fmt, va_list arg); + +/* + * zalloc.c + */ +#define malloc(size) safe_malloc(size, __FILE__, __LINE__) +extern void malloc_init(char * start, int size, int nodes, void (*malloc_error)(char *, size_t, const char *, int)); +extern void * safe_malloc(size_t size,const char *file, int line); +extern void free(void * start); +extern void * realloc(void * ptr, size_t size); + +/* + * getsegbyname.c + */ +extern struct segment_command * + getsegbynamefromheader(struct mach_header * mhp, char * segname); + +#endif /* !__BOOT_LIBSA_H */ diff --git a/i386/libsa/.svn/text-base/memory.h.svn-base b/i386/libsa/.svn/text-base/memory.h.svn-base new file mode 100644 index 0000000..626bec1 --- /dev/null +++ b/i386/libsa/.svn/text-base/memory.h.svn-base @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOT_MEMORY_H +#define __BOOT_MEMORY_H + +/* Memory addresses used by booter and friends */ + +/* DFE 2007-12-21: Changed BASE_SEG to be conditional + This allows boot1u and other planned first-stage booters to avoid + maintaining their own copies of asm.s and bios.s and instead + simply build the files from libsaio with the right preprocessor + definitions. + + This affects BASE_ADDR and OFFSET16() thus obviating the need for + separate BASE1U_ADDR and OFFSET1U16() macros. + + Be careful though as changing these values with preprocessor macros + obviously requires rebuilding the source files. That means in particular + that libsaio.a is only suitable for boot2. + */ +#if defined(BASE_SEG) +/* assume user knows what he's doing */ +#elif defined(BOOT1) +# define BASE_SEG BOOT1U_SEG +#else +# define BASE_SEG BOOT2_SEG +#endif + +#define STACK_SEG 0x1000 // zef: old STACK_SEG 0x5000 +#define STACK_OFS 0xFFF0 // stack pointer + +#define BOOT1U_SEG 0x1000 +#define BOOT1U_OFS 0x0200 + +#define BOOT2_SEG 0x2000 +#define BOOT2_OFS 0x0200 // 512 byte disk sector offset + +#define BOOT2_MAX_LENGTH 0x6FE00 // Maximum size for boot2 is currentl 447kb + +#define BIOS_ADDR 0x8000 // BIOS disk I/O buffer +#define BIOS_LEN 0x8000 // 32K - divisible by 512 and 2048 + +#define BOOT0_ADDR 0x7E00 // boot0 gets loaded here + + +/* These are all "virtual" addresses... + * which are physical addresses plus MEMBASE. + */ +#define ADDR32(seg, ofs) (((seg) << 4 ) + (ofs)) + +#define MEMBASE 0x0 + +#define BOOTSTRUCT_ADDR 0x00011000 // it's slightly smaller +#define BOOTSTRUCT_LEN 0x0000F000 + +#define BASE_ADDR ADDR32(BASE_SEG, 0) +#define BOOT1U_ADDR ADDR32(BOOT1U_SEG, BOOT1U_OFS) +#define BOOT2_ADDR ADDR32(BOOT2_SEG, BOOT2_OFS) +// TODO: BOOT_ADDR ? + +#define HIB_ADDR 0x00040000 // special hibernation area +#define HIB_LEN 0x00060000 + +#define VIDEO_ADDR 0x000A0000 // unusable space +#define VIDEO_LEN 0x00060000 + +#define KERNEL_ADDR 0x00100000 // 128M kernel + drivers +#define KERNEL_LEN 0x08000000 + +#define ZALLOC_ADDR 0x08100000 // 256M zalloc area +#define ZALLOC_LEN 0x10000000 + +#define LOAD_ADDR 0x18100000 // 64M File load buffer +#define LOAD_LEN 0x04000000 + +// Location of data fed to boot2 by the prebooter +#define PREBOOT_DATA 0x1C100000 // Still have enough room for a 63M ramdisk image + // in case of 512MB system memory. + +#define TFTP_ADDR LOAD_ADDR // tftp download buffer +#define TFTP_LEN LOAD_LEN + +#define kLoadAddr LOAD_ADDR +#define kLoadSize LOAD_LEN + +#define CONVENTIONAL_LEN 0x0A0000 // 640k +#define EXTENDED_ADDR 0x100000 // 1024k + +#define ptov(paddr) ((paddr) - MEMBASE) +#define vtop(vaddr) ((vaddr) + MEMBASE) + +/* + * Extract segment/offset from a linear address. + */ +#define OFFSET16(addr) ((addr) - BASE_ADDR) +#define OFFSET(addr) ((addr) & 0xFFFF) +#define SEGMENT(addr) (((addr) & 0xF0000) >> 4) + +/* Extract segment/offset in normalized form so that the resulting far pointer + will point to something that is very unlikely to straddle a segment. + This is sometimes known as a "huge" pointer. + */ +#define NORMALIZED_OFFSET(addr) ((addr) & 0x000F) +#define NORMALIZED_SEGMENT(addr) (((addr) & 0xFFFF0) >> 4) + +/* + * We need a minimum of 32MB of system memory. + */ +#define MIN_SYS_MEM_KB (32 * 1024) + +/* + * The number of descriptor entries in the GDT. + */ +#define NGDTENT 7 + +/* + * The total size of the GDT in bytes. + * Each descriptor entry require 8 bytes. + */ +#define GDTLIMIT ( NGDTENT * 8 ) + +#endif /* !__BOOT_MEMORY_H */ diff --git a/i386/libsa/.svn/text-base/prf.c.svn-base b/i386/libsa/.svn/text-base/prf.c.svn-base new file mode 100644 index 0000000..8bf56e1 --- /dev/null +++ b/i386/libsa/.svn/text-base/prf.c.svn-base @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * Copyright (c) 1988 Carnegie-Mellon University + * Copyright (c) 1987 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)prf.c 7.1 (Berkeley) 6/5/86 + */ + +#include <sys/param.h> + +#define SPACE 1 +#define ZERO 2 +#define UCASE 16 + +/* + * Scaled down version of C Library printf. + * Used to print diagnostic information directly on console tty. + * Since it is not interrupt driven, all system activities are + * suspended. + * + */ + +/* + * Printn prints a number n in base b. + * We don't use recursion to avoid deep kernel stacks. + */ +static void +printn(n, b, flag, minwidth, putfn_p, putfn_arg) + u_long n; + int b, flag, minwidth; + int (*putfn_p)(); + void *putfn_arg; +{ + char prbuf[11]; + register char *cp; + int width = 0, neg = 0; + + if (b == 10 && (int)n < 0) { + neg = 1; + n = (unsigned)(-(int)n); + } + cp = prbuf; + do { + *cp++ = "0123456789abcdef0123456789ABCDEF"[(flag & UCASE) + n%b]; + n /= b; + width++; + } while (n); + + if (neg) { + (*putfn_p)('-', putfn_arg); + width++; + } + while (width++ < minwidth) + (*putfn_p)( (flag & ZERO) ? '0' : ' ', putfn_arg); + + do + (*putfn_p)(*--cp, putfn_arg); + while (cp > prbuf); +} + +void prf( + char *fmt, + unsigned int *adx, + int (*putfn_p)(), + void *putfn_arg +) +{ + int b, c; + char *s; + int flag = 0, width = 0; + int minwidth; + +loop: + while ((c = *fmt++) != '%') { + if(c == '\0') + return; + (*putfn_p)(c, putfn_arg); + } + minwidth = 0; +again: + c = *fmt++; + switch (c) { + case 'l': + goto again; + case ' ': + flag |= SPACE; + goto again; + case '0': + if (minwidth == 0) { + /* this is a flag */ + flag |= ZERO; + goto again; + } /* fall through */ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + minwidth *= 10; + minwidth += c - '0'; + goto again; + case 'X': + flag |= UCASE; + /* fall through */ + case 'x': + b = 16; + goto number; + case 'd': + b = 10; + goto number; + case 'o': case 'O': + b = 8; +number: + printn((u_long)*adx, b, flag, minwidth, putfn_p, putfn_arg); + break; + case 's': + s = (char *)*adx; + while ((c = *s++)) { + (*putfn_p)(c, putfn_arg); + width++; + } + while (width++ < minwidth) + (*putfn_p)(' ', putfn_arg); + break; + case 'c': + (*putfn_p)((char)*adx, putfn_arg); + break; + } + adx++; + goto loop; +} diff --git a/i386/libsa/.svn/text-base/printf.c.svn-base b/i386/libsa/.svn/text-base/printf.c.svn-base new file mode 100644 index 0000000..556dbf8 --- /dev/null +++ b/i386/libsa/.svn/text-base/printf.c.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsa.h" + +struct putc_info //Azi: exists on console.c & gui.c +{ + char * str; + char * last_str; +}; + +static int +sputc(int c, struct putc_info * pi) //Azi: same as above +{ + if (pi->last_str) + if (pi->str == pi->last_str) { + *(pi->str) = '\0'; + return 0; + } + *(pi->str)++ = c; + return c; +} + +/*VARARGS1*/ +/* now slprintf() return the length of the string as in man sprintf()*/ +int sprintf(char * str, const char * fmt, ...) +{ + va_list ap; + struct putc_info pi; + + va_start(ap, fmt); + pi.str = str; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + va_end(ap); + return (pi.str - str); +} + +/*VARARGS1*/ +int slvprintf(char * str, int len, const char * fmt, va_list ap) +{ + struct putc_info pi; + pi.str = str; + pi.last_str = str + len - 1; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + return (pi.str - str); +} diff --git a/i386/libsa/.svn/text-base/qsort.c.svn-base b/i386/libsa/.svn/text-base/qsort.c.svn-base new file mode 100644 index 0000000..018a33a --- /dev/null +++ b/i386/libsa/.svn/text-base/qsort.c.svn-base @@ -0,0 +1,193 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <sys/types.h> +#include <stdlib.h> +#include <sys/param.h> + +static inline char *med3 __P((char *, char *, char *, int (*)())); +static inline void swapfunc __P((char *, char *, int, int)); + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + register TYPE *pi = (TYPE *) (parmi); \ + register TYPE *pj = (TYPE *) (parmj); \ + do { \ + register TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + +static inline void +swapfunc(a, b, n, swaptype) + char *a, *b; + int n, swaptype; +{ + if(swaptype <= 1) + swapcode(long, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + +static inline char * +med3(a, b, c, cmp) + char *a, *b, *c; + int (*cmp)(); +{ + return cmp(a, b) < 0 ? + (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a )) + :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c )); +} + +void +qsort(a, n, es, cmp) + void *a; + size_t n, es; + int (*cmp)(); +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + int d, r, swaptype, swap_cnt; + +loop: SWAPINIT(a, es); + swap_cnt = 0; + if (n < 7) { + for (pm = a + es; pm < (char *) a + n * es; pm += es) + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + pm = a + (n / 2) * es; + if (n > 7) { + pl = a; + pn = a + (n - 1) * es; + if (n > 40) { + d = (n / 8) * es; + pl = med3(pl, pl + d, pl + 2 * d, cmp); + pm = med3(pm - d, pm, pm + d, cmp); + pn = med3(pn - 2 * d, pn - d, pn, cmp); + } + pm = med3(pl, pm, pn, cmp); + } + swap(a, pm); + pa = pb = a + es; + + pc = pd = a + (n - 1) * es; + for (;;) { + while (pb <= pc && (r = cmp(pb, a)) <= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (r = cmp(pc, a)) >= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + if (swap_cnt == 0) { /* Switch to insertion sort */ + for (pm = a + es; pm < (char *) a + n * es; pm += es) + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + + pn = a + n * es; + r = MIN(pa - (char *)a, pb - pa); + vecswap(a, pb - r, r); + r = MIN(pd - pc, (pn - pd) - (int)es); + vecswap(pb, pn - r, r); + if ((r = pb - pa) > (int)es) + qsort(a, r / es, es, cmp); + if ((r = pd - pc) > (int)es) { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + n = r / es; + goto loop; + } +/* qsort(pn - r, r / es, es, cmp);*/ +} diff --git a/i386/libsa/.svn/text-base/setjmp.s.svn-base b/i386/libsa/.svn/text-base/setjmp.s.svn-base new file mode 100644 index 0000000..6082ea0 --- /dev/null +++ b/i386/libsa/.svn/text-base/setjmp.s.svn-base @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.1 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include <architecture/i386/asm_help.h> + +#define O_EDI 0 +#define O_ESI 4 +#define O_EBX 8 +#define O_EBP 12 +#define O_ESP 16 +#define O_EIP 20 + +LEAF(_setjmp, 0) +X_LEAF(_set_label, _setjmp) + movl 4(%esp), %edx // address of save area + movl %edi, O_EDI(%edx) + movl %esi, O_ESI(%edx) + movl %ebx, O_EBX(%edx) + movl %ebp, O_EBP(%edx) + movl %esp, O_ESP(%edx) + movl (%esp), %ecx // %eip (return address) + movl %ecx, O_EIP(%edx) + subl %eax, %eax // retval <- 0 + ret + +LEAF(_longjmp, 0) +X_LEAF(_jump_label, _longjmp) + movl 4(%esp), %edx // address of save area + movl O_EDI(%edx), %edi + movl O_ESI(%edx), %esi + movl O_EBX(%edx), %ebx + movl O_EBP(%edx), %ebp + movl O_ESP(%edx), %esp + movl O_EIP(%edx), %eax // %eip (return address) + movl %eax, 0(%esp) + popl %eax // ret addr != 0 + jmp *%eax // indirect diff --git a/i386/libsa/.svn/text-base/string.c.svn-base b/i386/libsa/.svn/text-base/string.c.svn-base new file mode 100644 index 0000000..3a5f01d --- /dev/null +++ b/i386/libsa/.svn/text-base/string.c.svn-base @@ -0,0 +1,311 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* string operations */ + +#include "libsa.h" + +void * memset(void * dst, int val, size_t len) +{ + asm volatile ( "rep; stosb" + : "=c" (len), "=D" (dst) + : "0" (len), "1" (dst), "a" (val) + : "memory" ); + + return dst; +} + +#if 0 +void * memcpy(void * dst, const void * src, size_t len) +{ + asm volatile ( "rep; movsb" + : "=c" (len), "=D" (dst), "=S" (src) + : "0" (len), "1" (dst), "2" (src) + : "memory" ); + + return dst; +} + +void bcopy(const void * src, void * dst, size_t len) +{ + memcpy(dst, src, len); +} + +void bzero(void * dst, size_t len) +{ + memset(dst, 0, len); +} + +#else +void * memcpy(void * dst, const void * src, size_t len) +{ + asm volatile ( "cld \n\t" + "movl %%ecx, %%edx \n\t" + "shrl $2, %%ecx \n\t" + "rep; movsl \n\t" + "movl %%edx, %%ecx \n\t" + "andl $3, %%ecx \n\t" + "rep; movsb \n\t" + : "=D" (dst) + : "c" (len), "D" (dst), "S" (src) + : "memory", "%edx" ); + + return dst; +} + +void bcopy(const void * src, void * dst, size_t len) +{ + asm volatile ( "cld \n\t" + "movl %%ecx, %%edx \n\t" + "shrl $2, %%ecx \n\t" + "rep; movsl \n\t" + "movl %%edx, %%ecx \n\t" + "andl $3, %%ecx \n\t" + "rep; movsb \n\t" + : + : "c" (len), "D" (dst), "S" (src) + : "memory", "%edx" ); +} + +void bzero(void * dst, size_t len) +{ + asm volatile ( "xorl %%eax, %%eax \n\t" + "cld \n\t" + "movl %%ecx, %%edx \n\t" + "shrl $2, %%ecx \n\t" + "rep; stosl \n\t" + "movl %%edx, %%ecx \n\t" + "andl $3, %%ecx \n\t" + "rep; stosb \n\t" + : + : "c" (len), "D" (dst) + : "memory", "%eax" ); +} +#endif + +/* #if DONT_USE_GCC_BUILT_IN_STRLEN */ + +#define tolower(c) ((int)((c) & ~0x20)) +#define toupper(c) ((int)((c) | 0x20)) + +size_t strlen(const char * s) +{ + int n = 0; + while (*s++) n++; + return(n); +} + +/*#endif*/ + +/* NOTE: Moved from ntfs.c */ +int +memcmp(const void *p1, const void *p2, size_t len) +{ + while (len--) { + if (*(const char*)(p1++) != *(const char*)(p2++)) + return -1; + } + return 0; +} + +int +strcmp(const char * s1, const char * s2) +{ + while (*s1 && (*s1 == *s2)) { + s1++; + s2++; + } + return (*s1 - *s2); +} + +int strncmp(const char * s1, const char * s2, size_t len) +{ + register int n = len; + while (--n >= 0 && *s1 == *s2++) + if (*s1++ == '\0') + return(0); + return(n<0 ? 0 : *s1 - *--s2); +} + +char * +strcpy(char * s1, const char * s2) +{ + register char *ret = s1; + while ((*s1++ = *s2++)) + continue; + return ret; +} + +char * +strncpy(char * s1, const char * s2, size_t n) +{ + register char *ret = s1; + while (n && (*s1++ = *s2++)) + n--; + return ret; +} + +char * +strstr(const char *in, const char *str) +{ + char c; + size_t len; + + c = *str++; + if (!c) + return (char *) in; // Trivial empty string case + + len = strlen(str); + do { + char sc; + + do { + sc = *in++; + if (!sc) + return (char *) 0; + } while (sc != c); + } while (strncmp(in, str, len) != 0); + + return (char *) (in - 1); +} + +int +ptol(const char *str) +{ + register int c = *str; + + if (c <= '7' && c >= '0') + c -= '0'; + else if (c <= 'h' && c >= 'a') + c -= 'a'; + else c = 0; + return c; +} + +int +atoi(const char *str) +{ + register int sum = 0; + while (*str == ' ' || *str == '\t') + str++; + while (*str >= '0' && *str <= '9') { + sum *= 10; + sum += *str++ - '0'; + } + return sum; +} + +char *strncat(char *s1, const char *s2, size_t n) +{ + register char *ret = s1; + while (*s1) + s1++; + while (n-- && *s2) + *s1++ = *s2++; + *s1 = '\0'; + return ret; +} + +char *strcat(char *s1, const char *s2) +{ + return(strncat(s1, s2, strlen(s2))); +} + +char *strdup(const char *s1) +{ + return strcpy(malloc(strlen(s1) + 1), s1); +} + +#if STRNCASECMP +int strncasecmp(const char *s1, const char *s2, size_t len) +{ + register int n = len; + while (--n >= 0 && tolower(*s1) == tolower(*s2++)) + if (*s1++ == '\0') + return(0); + return(n<0 ? 0 : tolower(*s1) - tolower(*--s2)); +} +#endif + +char* strchr(const char *str, int c) +{ + do + { + if(*str == c) + return (char*)str; + } + while(*(str++)); + + return 0; +} + +char* strbreak(const char *str, char **next, long *len) +{ + char *start = (char*)str, *end; + bool quoted = false; + + if ( !start || !len ) + return 0; + + *len = 0; + + while ( isspace(*start) ) + start++; + + if (*start == '"') + { + start++; + + end = strchr(start, '"'); + if(end) + quoted = true; + else + end = strchr(start, '\0'); + } + else + { + for ( end = start; *end && !isspace(*end); end++ ) + {} + } + + *len = end - start; + + if(next) + *next = quoted ? end+1 : end; + + return start; +} + +/* COPYRIGHT NOTICE: checksum8 from AppleSMBIOS */ +uint8_t checksum8( void * start, unsigned int length ) +{ + uint8_t csum = 0; + uint8_t * cp = (uint8_t *) start; + unsigned int i; + + for ( i = 0; i < length; i++) + csum += *cp++; + + return csum; +} + diff --git a/i386/libsa/.svn/text-base/strtol.c.svn-base b/i386/libsa/.svn/text-base/strtol.c.svn-base new file mode 100644 index 0000000..3ef50bc --- /dev/null +++ b/i386/libsa/.svn/text-base/strtol.c.svn-base @@ -0,0 +1,310 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Copyright (c) 1995 NeXT Computer, Inc. All rights reserved. + * + * HISTORY + * Modified by Curtis Galloway at NeXT June 1993, + * for use in the standalone library. + * + * 30-Nov-1995 Dean Reece at NeXT + * Created based on BSD4.4's strtol.c & strtoul.c. + * Removed dependency on _ctype_ by static versions of isupper()... + * Added support for "0b101..." binary constants. + * Commented out references to errno. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtol.c 5.4 (Berkeley) 2/23/91"; +#endif /* LIBC_SCCS and not lint */ + +#include "libsa.h" +#include <limits.h> + +/* + * Convert a string to a long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +long +strtol(nptr, endptr, base) + const char *nptr; + char **endptr; + register int base; +{ + register const char *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } else if ((base == 0 || base == 2) && + c == '0' && (*s == 'b' || *s == 'B')) { + c = s[1]; + s += 2; + base = 2; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for longs is + * [-2147483648..2147483647] and the input base is 10, + * cutoff will be set to 214748364 and cutlim to either + * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated + * a value > 214748364, or equal but the next digit is > 7 (or 8), + * the number is too big, and we will return a range error. + * + * Set any if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; + cutlim = cutoff % (unsigned long)base; + cutoff /= (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; +// errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + + +/* + * Convert a string to an unsigned long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long +strtoul(nptr, endptr, base) + const char *nptr; + char **endptr; + register int base; +{ + register const char *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } else if ((base == 0 || base == 2) && + c == '0' && (*s == 'b' || *s == 'B')) { + c = s[1]; + s += 2; + base = 2; + } + if (base == 0) + base = c == '0' ? 8 : 10; + cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; + cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULONG_MAX; +// errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +/* + * Convert a string to an unsigned quad integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long long +strtouq(nptr, endptr, base) + const char *nptr; + char **endptr; + register int base; +{ + register const char *s = nptr; + register unsigned long long acc; + register int c; + register unsigned long long qbase, cutoff; + register int neg, any, cutlim; + + /* + * See strtoq for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + qbase = (unsigned)base; + cutoff = (unsigned long long)UQUAD_MAX / qbase; + cutlim = (unsigned long long)UQUAD_MAX % qbase; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= qbase; + acc += c; + } + } + if (any < 0) { + acc = UQUAD_MAX; +// errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/i386/libsa/.svn/text-base/zalloc.c.svn-base b/i386/libsa/.svn/text-base/zalloc.c.svn-base new file mode 100644 index 0000000..a513f84 --- /dev/null +++ b/i386/libsa/.svn/text-base/zalloc.c.svn-base @@ -0,0 +1,323 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + * + * Sam's simple memory allocator. + * + */ + +#include "libsa.h" +//#include "saio_internal.h" - Azi: needed for ZDEBUG (printf) +#include "memory.h" + +#define ZDEBUG 0 //Azi: booter doesn't load with this enabled; instant reboot at "boot1: ..." + +#if ZDEBUG +int zout; +#endif + +typedef struct { + char * start; + size_t size; +} zmem; + +static zmem * zalloced; +static zmem * zavailable; +static short availableNodes, allocedNodes, totalNodes; +static char * zalloc_base; +static char * zalloc_end; +static void (*zerror)(char *, size_t, const char *, int); + +static void zallocate(char * start,int size); +static void zinsert(zmem * zp, int ndx); +static void zdelete(zmem * zp, int ndx); +static void zcoalesce(void); + +#if ZDEBUG +size_t zalloced_size; +#endif + +#define ZALLOC_NODES 32767 /* was 16384 */ + +static void malloc_error(char *addr, size_t size, const char *file, int line) +{ +#ifdef i386 + asm volatile ("hlt"); +#endif +} + +// define the block of memory that the allocator will use +void malloc_init(char * start, int size, int nodes, void (*malloc_err_fn)(char *, size_t, const char *, int)) +{ + zalloc_base = start ? start : (char *)ZALLOC_ADDR; + totalNodes = nodes ? nodes : ZALLOC_NODES; + zalloced = (zmem *) zalloc_base; + zavailable = (zmem *) zalloc_base + sizeof(zmem) * totalNodes; + zavailable[0].start = (char *)zavailable + sizeof(zmem) * totalNodes; + if (size == 0) size = ZALLOC_LEN; + zavailable[0].size = size - (zavailable[0].start - zalloc_base); + zalloc_end = zalloc_base + size; + availableNodes = 1; + allocedNodes = 0; + zerror = malloc_err_fn ? malloc_err_fn : malloc_error; +} + +#define BEST_FIT 1 + +void * safe_malloc(size_t size, const char *file, int line) +{ + int i; +#if BEST_FIT + int bestFit; + size_t smallestSize; +#endif + char * ret = 0; + + if ( !zalloc_base ) + { + // this used to follow the bss but some bios' corrupted it... + malloc_init((char *)ZALLOC_ADDR, ZALLOC_LEN, ZALLOC_NODES, malloc_error); + } + + size = ((size + 0xf) & ~0xf); + + if (size == 0) { + if (zerror) (*zerror)((char *)0xdeadbeef, 0, file, line); + } +#if BEST_FIT + smallestSize = 0; + bestFit = -1; +#endif + + for (i = 0; i < availableNodes; i++) + { + // find node with equal size, or if not found, + // then smallest node that fits. + if ( zavailable[i].size == size ) + { + zallocate(ret = zavailable[i].start, size); + zdelete(zavailable, i); availableNodes--; + goto done; + } +#if BEST_FIT + else + { + if ((zavailable[i].size > size) && + ((smallestSize == 0) || + (zavailable[i].size < smallestSize))) + { + bestFit = i; + smallestSize = zavailable[i].size; + } + } + +#else + else if ( zavailable[i].size > size ) + { + zallocate(ret = zavailable[i].start, size); + zavailable[i].start += size; + zavailable[i].size -= size; + goto done; + } +#endif + } +#if BEST_FIT + if (bestFit != -1) + { + zallocate(ret = zavailable[bestFit].start, size); + zavailable[bestFit].start += size; + zavailable[bestFit].size -= size; + } +#endif + +done: + if ((ret == 0) || (ret + size >= zalloc_end)) + { + if (zerror) (*zerror)(ret, size, file, line); + } + if (ret != 0) + { + bzero(ret, size); + } +#if ZDEBUG + zalloced_size += size; +#endif + return (void *) ret; +} + +void free(void * pointer) +{ + unsigned long rp; + int i, found = 0; + size_t tsize = 0; + char * start = pointer; + +#if i386 + // Get return address of our caller, + // in case we have to report an error below. + asm volatile ("movl %%esp, %%eax\n\t" + "subl $4, %%eax\n\t" + "movl 0(%%eax), %%eax" : "=a" (rp) ); +#else + rp = 0; +#endif + + if ( !start ) return; + + for (i = 0; i < allocedNodes; i++) + { + if ( zalloced[i].start == start ) + { + tsize = zalloced[i].size; +#if ZDEBUG + zout -= tsize; + printf(" zz out %d\n",zout); +#endif + zdelete(zalloced, i); allocedNodes--; + found = 1; +#if ZDEBUG + memset(pointer, 0x5A, tsize); +#endif + break; + } + } + if ( !found ) { + if (zerror) (*zerror)(pointer, rp, "free", 0); + else return; + } +#if ZDEBUG + zalloced_size -= tsize; +#endif + + for (i = 0; i < availableNodes; i++) + { + if ((start + tsize) == zavailable[i].start) // merge it in + { + zavailable[i].start = start; + zavailable[i].size += tsize; + zcoalesce(); + return; + } + + if ((i > 0) && + (zavailable[i-1].start + zavailable[i-1].size == start)) + { + zavailable[i-1].size += tsize; + zcoalesce(); + return; + } + + if ((start + tsize) < zavailable[i].start) + { + if (++availableNodes > totalNodes) { + if (zerror) (*zerror)((char *)0xf000f000, 0, "free", 0); + } + zinsert(zavailable, i); + zavailable[i].start = start; + zavailable[i].size = tsize; + return; + } + } + + if (++availableNodes > totalNodes) { + if (zerror) (*zerror)((char *)0xf000f000, 1, "free", 0); + } + zavailable[i].start = start; + zavailable[i].size = tsize; + zcoalesce(); + return; +} + +static void +zallocate(char * start,int size) +{ +#if ZDEBUG + zout += size; + printf(" alloc %d, total 0x%x\n",size,zout); +#endif + zalloced[allocedNodes].start = start; + zalloced[allocedNodes].size = size; + if (++allocedNodes > totalNodes) { + if (zerror) (*zerror)((char *)0xf000f000, 2, "zallocate", 0); + }; +} + +static void +zinsert(zmem * zp, int ndx) +{ + int i; + zmem *z1, *z2; + + i = totalNodes-2; + z1 = zp + i; + z2 = z1 + 1; + + for (; i >= ndx; i--, z1--, z2--) + { + *z2 = *z1; + } +} + +static void +zdelete(zmem * zp, int ndx) +{ + int i; + zmem *z1, *z2; + + z1 = zp + ndx; + z2 = z1 + 1; + + for (i = ndx; i < totalNodes-1; i++, z1++, z2++) + { + *z1 = *z2; + } +} + +static void +zcoalesce(void) +{ + int i; + + for (i = 0; i < availableNodes-1; i++) + { + if ( zavailable[i].start + zavailable[i].size == + zavailable[i+1].start ) + { + zavailable[i].size += zavailable[i+1].size; + zdelete(zavailable, i+1); availableNodes--; + return; + } + } +} + +/* This is the simplest way possible. Should fix this. */ +void * realloc(void * start, size_t newsize) +{ + void * newstart = safe_malloc(newsize, __FILE__, __LINE__); + bcopy(start, newstart, newsize); + free(start); + return newstart; +} diff --git a/i386/libsa/Cconfig b/i386/libsa/Cconfig new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/i386/libsa/Cconfig @@ -0,0 +1 @@ + diff --git a/i386/libsa/Makefile b/i386/libsa/Makefile new file mode 100644 index 0000000..1d8ac09 --- /dev/null +++ b/i386/libsa/Makefile @@ -0,0 +1,52 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/libsa +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = libsa +include ${SRCROOT}/Make.rules + +LIBSAIODIR = ../libsaio + +CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \ + -march=pentium4 -msse2 -msoft-float -fno-stack-protector \ + -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ + +INC = -I. -I$(SYMROOT) -I$(LIBSAIODIR) -I${SRCROOT}/i386/include + +OBJS = prf.o printf.o zalloc.o \ + string.o strtol.o error.o \ + setjmp.o qsort.o efi_tables.o + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +LIBS = libsa.a +LIBS := $(addprefix $(SYMROOT)/, $(LIBS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +all embedtheme: $(DIRS_NEEDED) $(LIBS) + + +$(LIBS): $(OBJS) + @echo "\t[RM] $@" + @rm -f $@ + @echo "\t[AR] $(@F)" + @ar q $@ $^ &> /dev/null + @echo "\t[RANLIB] $(@F)" + @ranlib $@ + +# dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for l in $(LIBS); do if [ -f "$${l}" ];then echo "\t[RM] $${l}"; fi; done + @rm -f $(LIBS) $(OBJS) diff --git a/i386/libsa/efi_tables.c b/i386/libsa/efi_tables.c new file mode 100644 index 0000000..c136c31 --- /dev/null +++ b/i386/libsa/efi_tables.c @@ -0,0 +1,162 @@ +/*! @file efi_tables.c + Copyright 2007 David F. Elliott. All rights reserved. + */ +#include "libsa.h" +#include "efi_tables.h" + + +/*========================================================================== + * CRC32 implementation copied from xnu in turn copied from Gary S. Brown. + */ + +/*- + * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or + * code or tables extracted from it, as desired without restriction. + * + * First, the polynomial itself and its table of feedback terms. The + * polynomial is + * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 + * + * Note that we take it "backwards" and put the highest-order term in + * the lowest-order bit. The X^32 term is "implied"; the LSB is the + * X^31 term, etc. The X^0 term (usually shown as "+1") results in + * the MSB being 1 + * + * Note that the usual hardware shift register implementation, which + * is what we're using (we're merely optimizing it by doing eight-bit + * chunks at a time) shifts bits into the lowest-order term. In our + * implementation, that means shifting towards the right. Why do we + * do it this way? Because the calculated CRC must be transmitted in + * order from highest-order term to lowest-order term. UARTs transmit + * characters in order from LSB to MSB. By storing the CRC this way + * we hand it to the UART in the order low-byte to high-byte; the UART + * sends each low-bit to hight-bit; and the result is transmission bit + * by bit from highest- to lowest-order term without requiring any bit + * shuffling on our part. Reception works similarly + * + * The feedback terms table consists of 256, 32-bit entries. Notes + * + * The table can be generated at runtime if desired; code to do so + * is shown later. It might not be obvious, but the feedback + * terms simply represent the results of eight shift/xor opera + * tions for all combinations of data and CRC register values + * + * The values must be right-shifted by eight bits by the "updcrc + * logic; the shift must be unsigned (bring in zeroes). On some + * hardware you could probably optimize the shift in assembler by + * using byte-swap instructions + * polynomial $edb88320 + * + * + * CRC32 code derived from work by Gary S. Brown. + */ + +static uint32_t crc32_tab[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, + 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, + 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, + 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, + 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, + 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, + 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, + 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, + 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, + 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, + 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, + 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, + 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, + 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, + 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, + 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, + 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, + 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +uint32_t crc32(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p; + + p = buf; + crc = crc ^ ~0U; + + while (size--) + crc = crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8); + + return crc ^ ~0U; +} + + +/*========================================================================== + * Utility function to make a device tree string from an EFI_GUID + */ + +void efi_guid_unparse_upper(EFI_GUID const *pGuid, char *out) +{ + sprintf(out, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", + pGuid->Data1, /* - */ + pGuid->Data2, /* - */ + pGuid->Data3, /* - */ + pGuid->Data4[0], pGuid->Data4[1], /* - */ + pGuid->Data4[2], pGuid->Data4[3], + pGuid->Data4[4], pGuid->Data4[5], + pGuid->Data4[6], pGuid->Data4[7]); +} + +bool efi_guid_is_null(EFI_GUID const *pGuid) +{ + if(pGuid->Data1 == 0 && pGuid->Data2 == 0 && pGuid->Data3 == 0) + { + int i; + for(i=0; i<8; ++i) + { + if(pGuid->Data4[i] != 0) + return false; + } + return true; + } + return false; +} + +#define COMPARE_MEMBER_AND_RETURN_IF_NE(a,b,mem) \ + if( ((a)->mem) < ((b)->mem) ) \ + return -1; \ + else if( ((a)->mem) > ((b)->mem) ) \ + return 1; + +int efi_guid_compare(EFI_GUID const *pG1, EFI_GUID const *pG2) +{ + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data1); + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data2); + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data3); + int i; + for(i=0; i<8; ++i) + { + COMPARE_MEMBER_AND_RETURN_IF_NE(pG1, pG2, Data4[i]); + } + return 0; +} diff --git a/i386/libsa/efi_tables.h b/i386/libsa/efi_tables.h new file mode 100644 index 0000000..8ff5171 --- /dev/null +++ b/i386/libsa/efi_tables.h @@ -0,0 +1,16 @@ +/*! @file efi_tables.h + @abstract Utility functions for dealing with EFI tables + Copyright 2007 David F. Elliott. All rights reserved. + */ +#ifndef _LIBSA_EFI_TABLES_H__ +#define _LIBSA_EFI_TABLES_H__ + +#include "efi.h" + +uint32_t crc32(uint32_t crc, const void *buf, size_t size); + +void efi_guid_unparse_upper(EFI_GUID const *pGuid, char *out); +bool efi_guid_is_null(EFI_GUID const *pGuid); +int efi_guid_compare(EFI_GUID const *pG1, EFI_GUID const *pG2); + +#endif //ndef _LIBSA_EFI_TABLES_H__ diff --git a/i386/libsa/error.c b/i386/libsa/error.c new file mode 100644 index 0000000..d64a521 --- /dev/null +++ b/i386/libsa/error.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* error handling */ + +#include "libsa.h" + +int errno; + +char * strerror(int errnum) +{ + static char error_string[16]; + sprintf(error_string,"Error %d", errnum); + return error_string; +} diff --git a/i386/libsa/libsa.h b/i386/libsa/libsa.h new file mode 100644 index 0000000..a6afc9d --- /dev/null +++ b/i386/libsa/libsa.h @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOT_LIBSA_H +#define __BOOT_LIBSA_H + +/* Exported API for standalone library */ + +#include <mach-o/loader.h> +#include <stdarg.h> +#include <stddef.h> +#include <stdbool.h> + +/* + * ctype stuff (aserebln) + */ +static inline int isupper(int c) +{ + return (c >= 'A' && c <= 'Z'); +} + +static inline int islower(int c) +{ + return (c >= 'a' && c <= 'z'); +} + +static inline int isalpha(int c) +{ + return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')); +} + +static inline int isascii(int c) +{ + return ( (c >= 0x20) && (c < 0x7f) ); +} + +static inline int isspace(int c) +{ + return (c == ' ' || c == '\t' || c == '\n' || c == '\12'); +} + +static inline int isdigit(int c) +{ + return (c >= '0' && c <= '9'); +} + +static inline int isxdigit(int c) +{ + return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')); +} + +static inline int ispunct(int c) +{ + return (c == '.' || c == '-'); +} + +/* + * string.c + */ +#ifndef bcopy +extern void bcopy(const void * src, void * dst, size_t len); +#endif + +#ifndef bzero +extern void bzero(void * dst, size_t len); +#else +#error bzero is defined. +#endif + +extern void * memset(void * dst, int c, size_t n); +extern void * memcpy(void * dst, const void * src, size_t len); +extern int memcmp(const void * p1, const void * p2, size_t len); +extern int strcmp(const char * s1, const char * s2); +extern int strncmp(const char * s1, const char * s2, size_t n); +extern char * strcpy(char * s1, const char * s2); +extern char * strncpy(char * s1, const char * s2, size_t n); +extern size_t strlcpy(char * s1, const char * s2, size_t n); +extern char * strstr(const char *in, const char *str); +extern int atoi(const char * str); +extern int ptol(const char * str); +extern size_t strlen(const char * str); +extern char * strcat(char * s1, const char * s2); +extern char * strncat(char * s1, const char * s2, size_t n); +extern char * strdup(const char *s1); + +#if STRNCASECMP +extern int strncasecmp(const char * s1, const char * s2, size_t n); +#endif + +extern char * strchr(const char *str, int c); +extern char * strbreak(const char *str, char **next, long *len); + +extern uint8_t checksum8( void * start, unsigned int length ); + +/* + * error.c + */ +extern int errno; +extern char * strerror(int errnum); + +/* + * strtol.c + */ +extern long strtol(const char * nptr, char ** endptr, int base); +extern unsigned long strtoul(const char * nptr, char ** endptr, int base); +extern unsigned long long strtouq(const char *nptr, char ** endptr, int base); + +/* + * prf.c + */ +extern void prf(const char * fmt, va_list ap, int (*putfn_p)(), + void * putfn_arg); + +/* + * printf.c + */ +extern int sprintf(char *s, const char * format, ...); +extern int slvprintf(char * buffer, int len, const char * fmt, va_list arg); + +/* + * zalloc.c + */ +#define malloc(size) safe_malloc(size, __FILE__, __LINE__) +extern void malloc_init(char * start, int size, int nodes, void (*malloc_error)(char *, size_t, const char *, int)); +extern void * safe_malloc(size_t size,const char *file, int line); +extern void free(void * start); +extern void * realloc(void * ptr, size_t size); + +/* + * getsegbyname.c + */ +extern struct segment_command * + getsegbynamefromheader(struct mach_header * mhp, char * segname); + +#endif /* !__BOOT_LIBSA_H */ diff --git a/i386/libsa/memory.h b/i386/libsa/memory.h new file mode 100644 index 0000000..626bec1 --- /dev/null +++ b/i386/libsa/memory.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOT_MEMORY_H +#define __BOOT_MEMORY_H + +/* Memory addresses used by booter and friends */ + +/* DFE 2007-12-21: Changed BASE_SEG to be conditional + This allows boot1u and other planned first-stage booters to avoid + maintaining their own copies of asm.s and bios.s and instead + simply build the files from libsaio with the right preprocessor + definitions. + + This affects BASE_ADDR and OFFSET16() thus obviating the need for + separate BASE1U_ADDR and OFFSET1U16() macros. + + Be careful though as changing these values with preprocessor macros + obviously requires rebuilding the source files. That means in particular + that libsaio.a is only suitable for boot2. + */ +#if defined(BASE_SEG) +/* assume user knows what he's doing */ +#elif defined(BOOT1) +# define BASE_SEG BOOT1U_SEG +#else +# define BASE_SEG BOOT2_SEG +#endif + +#define STACK_SEG 0x1000 // zef: old STACK_SEG 0x5000 +#define STACK_OFS 0xFFF0 // stack pointer + +#define BOOT1U_SEG 0x1000 +#define BOOT1U_OFS 0x0200 + +#define BOOT2_SEG 0x2000 +#define BOOT2_OFS 0x0200 // 512 byte disk sector offset + +#define BOOT2_MAX_LENGTH 0x6FE00 // Maximum size for boot2 is currentl 447kb + +#define BIOS_ADDR 0x8000 // BIOS disk I/O buffer +#define BIOS_LEN 0x8000 // 32K - divisible by 512 and 2048 + +#define BOOT0_ADDR 0x7E00 // boot0 gets loaded here + + +/* These are all "virtual" addresses... + * which are physical addresses plus MEMBASE. + */ +#define ADDR32(seg, ofs) (((seg) << 4 ) + (ofs)) + +#define MEMBASE 0x0 + +#define BOOTSTRUCT_ADDR 0x00011000 // it's slightly smaller +#define BOOTSTRUCT_LEN 0x0000F000 + +#define BASE_ADDR ADDR32(BASE_SEG, 0) +#define BOOT1U_ADDR ADDR32(BOOT1U_SEG, BOOT1U_OFS) +#define BOOT2_ADDR ADDR32(BOOT2_SEG, BOOT2_OFS) +// TODO: BOOT_ADDR ? + +#define HIB_ADDR 0x00040000 // special hibernation area +#define HIB_LEN 0x00060000 + +#define VIDEO_ADDR 0x000A0000 // unusable space +#define VIDEO_LEN 0x00060000 + +#define KERNEL_ADDR 0x00100000 // 128M kernel + drivers +#define KERNEL_LEN 0x08000000 + +#define ZALLOC_ADDR 0x08100000 // 256M zalloc area +#define ZALLOC_LEN 0x10000000 + +#define LOAD_ADDR 0x18100000 // 64M File load buffer +#define LOAD_LEN 0x04000000 + +// Location of data fed to boot2 by the prebooter +#define PREBOOT_DATA 0x1C100000 // Still have enough room for a 63M ramdisk image + // in case of 512MB system memory. + +#define TFTP_ADDR LOAD_ADDR // tftp download buffer +#define TFTP_LEN LOAD_LEN + +#define kLoadAddr LOAD_ADDR +#define kLoadSize LOAD_LEN + +#define CONVENTIONAL_LEN 0x0A0000 // 640k +#define EXTENDED_ADDR 0x100000 // 1024k + +#define ptov(paddr) ((paddr) - MEMBASE) +#define vtop(vaddr) ((vaddr) + MEMBASE) + +/* + * Extract segment/offset from a linear address. + */ +#define OFFSET16(addr) ((addr) - BASE_ADDR) +#define OFFSET(addr) ((addr) & 0xFFFF) +#define SEGMENT(addr) (((addr) & 0xF0000) >> 4) + +/* Extract segment/offset in normalized form so that the resulting far pointer + will point to something that is very unlikely to straddle a segment. + This is sometimes known as a "huge" pointer. + */ +#define NORMALIZED_OFFSET(addr) ((addr) & 0x000F) +#define NORMALIZED_SEGMENT(addr) (((addr) & 0xFFFF0) >> 4) + +/* + * We need a minimum of 32MB of system memory. + */ +#define MIN_SYS_MEM_KB (32 * 1024) + +/* + * The number of descriptor entries in the GDT. + */ +#define NGDTENT 7 + +/* + * The total size of the GDT in bytes. + * Each descriptor entry require 8 bytes. + */ +#define GDTLIMIT ( NGDTENT * 8 ) + +#endif /* !__BOOT_MEMORY_H */ diff --git a/i386/libsa/prf.c b/i386/libsa/prf.c new file mode 100644 index 0000000..8bf56e1 --- /dev/null +++ b/i386/libsa/prf.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * Copyright (c) 1988 Carnegie-Mellon University + * Copyright (c) 1987 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)prf.c 7.1 (Berkeley) 6/5/86 + */ + +#include <sys/param.h> + +#define SPACE 1 +#define ZERO 2 +#define UCASE 16 + +/* + * Scaled down version of C Library printf. + * Used to print diagnostic information directly on console tty. + * Since it is not interrupt driven, all system activities are + * suspended. + * + */ + +/* + * Printn prints a number n in base b. + * We don't use recursion to avoid deep kernel stacks. + */ +static void +printn(n, b, flag, minwidth, putfn_p, putfn_arg) + u_long n; + int b, flag, minwidth; + int (*putfn_p)(); + void *putfn_arg; +{ + char prbuf[11]; + register char *cp; + int width = 0, neg = 0; + + if (b == 10 && (int)n < 0) { + neg = 1; + n = (unsigned)(-(int)n); + } + cp = prbuf; + do { + *cp++ = "0123456789abcdef0123456789ABCDEF"[(flag & UCASE) + n%b]; + n /= b; + width++; + } while (n); + + if (neg) { + (*putfn_p)('-', putfn_arg); + width++; + } + while (width++ < minwidth) + (*putfn_p)( (flag & ZERO) ? '0' : ' ', putfn_arg); + + do + (*putfn_p)(*--cp, putfn_arg); + while (cp > prbuf); +} + +void prf( + char *fmt, + unsigned int *adx, + int (*putfn_p)(), + void *putfn_arg +) +{ + int b, c; + char *s; + int flag = 0, width = 0; + int minwidth; + +loop: + while ((c = *fmt++) != '%') { + if(c == '\0') + return; + (*putfn_p)(c, putfn_arg); + } + minwidth = 0; +again: + c = *fmt++; + switch (c) { + case 'l': + goto again; + case ' ': + flag |= SPACE; + goto again; + case '0': + if (minwidth == 0) { + /* this is a flag */ + flag |= ZERO; + goto again; + } /* fall through */ + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + minwidth *= 10; + minwidth += c - '0'; + goto again; + case 'X': + flag |= UCASE; + /* fall through */ + case 'x': + b = 16; + goto number; + case 'd': + b = 10; + goto number; + case 'o': case 'O': + b = 8; +number: + printn((u_long)*adx, b, flag, minwidth, putfn_p, putfn_arg); + break; + case 's': + s = (char *)*adx; + while ((c = *s++)) { + (*putfn_p)(c, putfn_arg); + width++; + } + while (width++ < minwidth) + (*putfn_p)(' ', putfn_arg); + break; + case 'c': + (*putfn_p)((char)*adx, putfn_arg); + break; + } + adx++; + goto loop; +} diff --git a/i386/libsa/printf.c b/i386/libsa/printf.c new file mode 100644 index 0000000..556dbf8 --- /dev/null +++ b/i386/libsa/printf.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsa.h" + +struct putc_info //Azi: exists on console.c & gui.c +{ + char * str; + char * last_str; +}; + +static int +sputc(int c, struct putc_info * pi) //Azi: same as above +{ + if (pi->last_str) + if (pi->str == pi->last_str) { + *(pi->str) = '\0'; + return 0; + } + *(pi->str)++ = c; + return c; +} + +/*VARARGS1*/ +/* now slprintf() return the length of the string as in man sprintf()*/ +int sprintf(char * str, const char * fmt, ...) +{ + va_list ap; + struct putc_info pi; + + va_start(ap, fmt); + pi.str = str; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + va_end(ap); + return (pi.str - str); +} + +/*VARARGS1*/ +int slvprintf(char * str, int len, const char * fmt, va_list ap) +{ + struct putc_info pi; + pi.str = str; + pi.last_str = str + len - 1; + prf(fmt, ap, sputc, &pi); + *pi.str = '\0'; + return (pi.str - str); +} diff --git a/i386/libsa/qsort.c b/i386/libsa/qsort.c new file mode 100644 index 0000000..018a33a --- /dev/null +++ b/i386/libsa/qsort.c @@ -0,0 +1,193 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <sys/types.h> +#include <stdlib.h> +#include <sys/param.h> + +static inline char *med3 __P((char *, char *, char *, int (*)())); +static inline void swapfunc __P((char *, char *, int, int)); + +/* + * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". + */ +#define swapcode(TYPE, parmi, parmj, n) { \ + long i = (n) / sizeof (TYPE); \ + register TYPE *pi = (TYPE *) (parmi); \ + register TYPE *pj = (TYPE *) (parmj); \ + do { \ + register TYPE t = *pi; \ + *pi++ = *pj; \ + *pj++ = t; \ + } while (--i > 0); \ +} + +#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ + es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; + +static inline void +swapfunc(a, b, n, swaptype) + char *a, *b; + int n, swaptype; +{ + if(swaptype <= 1) + swapcode(long, a, b, n) + else + swapcode(char, a, b, n) +} + +#define swap(a, b) \ + if (swaptype == 0) { \ + long t = *(long *)(a); \ + *(long *)(a) = *(long *)(b); \ + *(long *)(b) = t; \ + } else \ + swapfunc(a, b, es, swaptype) + +#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) + +static inline char * +med3(a, b, c, cmp) + char *a, *b, *c; + int (*cmp)(); +{ + return cmp(a, b) < 0 ? + (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a )) + :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c )); +} + +void +qsort(a, n, es, cmp) + void *a; + size_t n, es; + int (*cmp)(); +{ + char *pa, *pb, *pc, *pd, *pl, *pm, *pn; + int d, r, swaptype, swap_cnt; + +loop: SWAPINIT(a, es); + swap_cnt = 0; + if (n < 7) { + for (pm = a + es; pm < (char *) a + n * es; pm += es) + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + pm = a + (n / 2) * es; + if (n > 7) { + pl = a; + pn = a + (n - 1) * es; + if (n > 40) { + d = (n / 8) * es; + pl = med3(pl, pl + d, pl + 2 * d, cmp); + pm = med3(pm - d, pm, pm + d, cmp); + pn = med3(pn - 2 * d, pn - d, pn, cmp); + } + pm = med3(pl, pm, pn, cmp); + } + swap(a, pm); + pa = pb = a + es; + + pc = pd = a + (n - 1) * es; + for (;;) { + while (pb <= pc && (r = cmp(pb, a)) <= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pa, pb); + pa += es; + } + pb += es; + } + while (pb <= pc && (r = cmp(pc, a)) >= 0) { + if (r == 0) { + swap_cnt = 1; + swap(pc, pd); + pd -= es; + } + pc -= es; + } + if (pb > pc) + break; + swap(pb, pc); + swap_cnt = 1; + pb += es; + pc -= es; + } + if (swap_cnt == 0) { /* Switch to insertion sort */ + for (pm = a + es; pm < (char *) a + n * es; pm += es) + for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0; + pl -= es) + swap(pl, pl - es); + return; + } + + pn = a + n * es; + r = MIN(pa - (char *)a, pb - pa); + vecswap(a, pb - r, r); + r = MIN(pd - pc, (pn - pd) - (int)es); + vecswap(pb, pn - r, r); + if ((r = pb - pa) > (int)es) + qsort(a, r / es, es, cmp); + if ((r = pd - pc) > (int)es) { + /* Iterate rather than recurse to save stack space */ + a = pn - r; + n = r / es; + goto loop; + } +/* qsort(pn - r, r / es, es, cmp);*/ +} diff --git a/i386/libsa/setjmp.s b/i386/libsa/setjmp.s new file mode 100644 index 0000000..6082ea0 --- /dev/null +++ b/i386/libsa/setjmp.s @@ -0,0 +1,58 @@ +/* + * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.1 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include <architecture/i386/asm_help.h> + +#define O_EDI 0 +#define O_ESI 4 +#define O_EBX 8 +#define O_EBP 12 +#define O_ESP 16 +#define O_EIP 20 + +LEAF(_setjmp, 0) +X_LEAF(_set_label, _setjmp) + movl 4(%esp), %edx // address of save area + movl %edi, O_EDI(%edx) + movl %esi, O_ESI(%edx) + movl %ebx, O_EBX(%edx) + movl %ebp, O_EBP(%edx) + movl %esp, O_ESP(%edx) + movl (%esp), %ecx // %eip (return address) + movl %ecx, O_EIP(%edx) + subl %eax, %eax // retval <- 0 + ret + +LEAF(_longjmp, 0) +X_LEAF(_jump_label, _longjmp) + movl 4(%esp), %edx // address of save area + movl O_EDI(%edx), %edi + movl O_ESI(%edx), %esi + movl O_EBX(%edx), %ebx + movl O_EBP(%edx), %ebp + movl O_ESP(%edx), %esp + movl O_EIP(%edx), %eax // %eip (return address) + movl %eax, 0(%esp) + popl %eax // ret addr != 0 + jmp *%eax // indirect diff --git a/i386/libsa/string.c b/i386/libsa/string.c new file mode 100644 index 0000000..3a5f01d --- /dev/null +++ b/i386/libsa/string.c @@ -0,0 +1,311 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* string operations */ + +#include "libsa.h" + +void * memset(void * dst, int val, size_t len) +{ + asm volatile ( "rep; stosb" + : "=c" (len), "=D" (dst) + : "0" (len), "1" (dst), "a" (val) + : "memory" ); + + return dst; +} + +#if 0 +void * memcpy(void * dst, const void * src, size_t len) +{ + asm volatile ( "rep; movsb" + : "=c" (len), "=D" (dst), "=S" (src) + : "0" (len), "1" (dst), "2" (src) + : "memory" ); + + return dst; +} + +void bcopy(const void * src, void * dst, size_t len) +{ + memcpy(dst, src, len); +} + +void bzero(void * dst, size_t len) +{ + memset(dst, 0, len); +} + +#else +void * memcpy(void * dst, const void * src, size_t len) +{ + asm volatile ( "cld \n\t" + "movl %%ecx, %%edx \n\t" + "shrl $2, %%ecx \n\t" + "rep; movsl \n\t" + "movl %%edx, %%ecx \n\t" + "andl $3, %%ecx \n\t" + "rep; movsb \n\t" + : "=D" (dst) + : "c" (len), "D" (dst), "S" (src) + : "memory", "%edx" ); + + return dst; +} + +void bcopy(const void * src, void * dst, size_t len) +{ + asm volatile ( "cld \n\t" + "movl %%ecx, %%edx \n\t" + "shrl $2, %%ecx \n\t" + "rep; movsl \n\t" + "movl %%edx, %%ecx \n\t" + "andl $3, %%ecx \n\t" + "rep; movsb \n\t" + : + : "c" (len), "D" (dst), "S" (src) + : "memory", "%edx" ); +} + +void bzero(void * dst, size_t len) +{ + asm volatile ( "xorl %%eax, %%eax \n\t" + "cld \n\t" + "movl %%ecx, %%edx \n\t" + "shrl $2, %%ecx \n\t" + "rep; stosl \n\t" + "movl %%edx, %%ecx \n\t" + "andl $3, %%ecx \n\t" + "rep; stosb \n\t" + : + : "c" (len), "D" (dst) + : "memory", "%eax" ); +} +#endif + +/* #if DONT_USE_GCC_BUILT_IN_STRLEN */ + +#define tolower(c) ((int)((c) & ~0x20)) +#define toupper(c) ((int)((c) | 0x20)) + +size_t strlen(const char * s) +{ + int n = 0; + while (*s++) n++; + return(n); +} + +/*#endif*/ + +/* NOTE: Moved from ntfs.c */ +int +memcmp(const void *p1, const void *p2, size_t len) +{ + while (len--) { + if (*(const char*)(p1++) != *(const char*)(p2++)) + return -1; + } + return 0; +} + +int +strcmp(const char * s1, const char * s2) +{ + while (*s1 && (*s1 == *s2)) { + s1++; + s2++; + } + return (*s1 - *s2); +} + +int strncmp(const char * s1, const char * s2, size_t len) +{ + register int n = len; + while (--n >= 0 && *s1 == *s2++) + if (*s1++ == '\0') + return(0); + return(n<0 ? 0 : *s1 - *--s2); +} + +char * +strcpy(char * s1, const char * s2) +{ + register char *ret = s1; + while ((*s1++ = *s2++)) + continue; + return ret; +} + +char * +strncpy(char * s1, const char * s2, size_t n) +{ + register char *ret = s1; + while (n && (*s1++ = *s2++)) + n--; + return ret; +} + +char * +strstr(const char *in, const char *str) +{ + char c; + size_t len; + + c = *str++; + if (!c) + return (char *) in; // Trivial empty string case + + len = strlen(str); + do { + char sc; + + do { + sc = *in++; + if (!sc) + return (char *) 0; + } while (sc != c); + } while (strncmp(in, str, len) != 0); + + return (char *) (in - 1); +} + +int +ptol(const char *str) +{ + register int c = *str; + + if (c <= '7' && c >= '0') + c -= '0'; + else if (c <= 'h' && c >= 'a') + c -= 'a'; + else c = 0; + return c; +} + +int +atoi(const char *str) +{ + register int sum = 0; + while (*str == ' ' || *str == '\t') + str++; + while (*str >= '0' && *str <= '9') { + sum *= 10; + sum += *str++ - '0'; + } + return sum; +} + +char *strncat(char *s1, const char *s2, size_t n) +{ + register char *ret = s1; + while (*s1) + s1++; + while (n-- && *s2) + *s1++ = *s2++; + *s1 = '\0'; + return ret; +} + +char *strcat(char *s1, const char *s2) +{ + return(strncat(s1, s2, strlen(s2))); +} + +char *strdup(const char *s1) +{ + return strcpy(malloc(strlen(s1) + 1), s1); +} + +#if STRNCASECMP +int strncasecmp(const char *s1, const char *s2, size_t len) +{ + register int n = len; + while (--n >= 0 && tolower(*s1) == tolower(*s2++)) + if (*s1++ == '\0') + return(0); + return(n<0 ? 0 : tolower(*s1) - tolower(*--s2)); +} +#endif + +char* strchr(const char *str, int c) +{ + do + { + if(*str == c) + return (char*)str; + } + while(*(str++)); + + return 0; +} + +char* strbreak(const char *str, char **next, long *len) +{ + char *start = (char*)str, *end; + bool quoted = false; + + if ( !start || !len ) + return 0; + + *len = 0; + + while ( isspace(*start) ) + start++; + + if (*start == '"') + { + start++; + + end = strchr(start, '"'); + if(end) + quoted = true; + else + end = strchr(start, '\0'); + } + else + { + for ( end = start; *end && !isspace(*end); end++ ) + {} + } + + *len = end - start; + + if(next) + *next = quoted ? end+1 : end; + + return start; +} + +/* COPYRIGHT NOTICE: checksum8 from AppleSMBIOS */ +uint8_t checksum8( void * start, unsigned int length ) +{ + uint8_t csum = 0; + uint8_t * cp = (uint8_t *) start; + unsigned int i; + + for ( i = 0; i < length; i++) + csum += *cp++; + + return csum; +} + diff --git a/i386/libsa/strtol.c b/i386/libsa/strtol.c new file mode 100644 index 0000000..3ef50bc --- /dev/null +++ b/i386/libsa/strtol.c @@ -0,0 +1,310 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Copyright (c) 1995 NeXT Computer, Inc. All rights reserved. + * + * HISTORY + * Modified by Curtis Galloway at NeXT June 1993, + * for use in the standalone library. + * + * 30-Nov-1995 Dean Reece at NeXT + * Created based on BSD4.4's strtol.c & strtoul.c. + * Removed dependency on _ctype_ by static versions of isupper()... + * Added support for "0b101..." binary constants. + * Commented out references to errno. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtol.c 5.4 (Berkeley) 2/23/91"; +#endif /* LIBC_SCCS and not lint */ + +#include "libsa.h" +#include <limits.h> + +/* + * Convert a string to a long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +long +strtol(nptr, endptr, base) + const char *nptr; + char **endptr; + register int base; +{ + register const char *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } else if ((base == 0 || base == 2) && + c == '0' && (*s == 'b' || *s == 'B')) { + c = s[1]; + s += 2; + base = 2; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for longs is + * [-2147483648..2147483647] and the input base is 10, + * cutoff will be set to 214748364 and cutlim to either + * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated + * a value > 214748364, or equal but the next digit is > 7 (or 8), + * the number is too big, and we will return a range error. + * + * Set any if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? -(unsigned long)LONG_MIN : LONG_MAX; + cutlim = cutoff % (unsigned long)base; + cutoff /= (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = neg ? LONG_MIN : LONG_MAX; +// errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + + +/* + * Convert a string to an unsigned long integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long +strtoul(nptr, endptr, base) + const char *nptr; + char **endptr; + register int base; +{ + register const char *s = nptr; + register unsigned long acc; + register int c; + register unsigned long cutoff; + register int neg = 0, any, cutlim; + + /* + * See strtol for comments as to the logic used. + */ + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else if (c == '+') + c = *s++; + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } else if ((base == 0 || base == 2) && + c == '0' && (*s == 'b' || *s == 'B')) { + c = s[1]; + s += 2; + base = 2; + } + if (base == 0) + base = c == '0' ? 8 : 10; + cutoff = (unsigned long)ULONG_MAX / (unsigned long)base; + cutlim = (unsigned long)ULONG_MAX % (unsigned long)base; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= base; + acc += c; + } + } + if (any < 0) { + acc = ULONG_MAX; +// errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} + +/* + * Convert a string to an unsigned quad integer. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +unsigned long long +strtouq(nptr, endptr, base) + const char *nptr; + char **endptr; + register int base; +{ + register const char *s = nptr; + register unsigned long long acc; + register int c; + register unsigned long long qbase, cutoff; + register int neg, any, cutlim; + + /* + * See strtoq for comments as to the logic used. + */ + s = nptr; + do { + c = *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + qbase = (unsigned)base; + cutoff = (unsigned long long)UQUAD_MAX / qbase; + cutlim = (unsigned long long)UQUAD_MAX % qbase; + for (acc = 0, any = 0;; c = *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) + any = -1; + else { + any = 1; + acc *= qbase; + acc += c; + } + } + if (any < 0) { + acc = UQUAD_MAX; +// errno = ERANGE; + } else if (neg) + acc = -acc; + if (endptr != 0) + *endptr = (char *)(any ? s - 1 : nptr); + return (acc); +} diff --git a/i386/libsa/zalloc.c b/i386/libsa/zalloc.c new file mode 100644 index 0000000..a513f84 --- /dev/null +++ b/i386/libsa/zalloc.c @@ -0,0 +1,323 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + * + * Sam's simple memory allocator. + * + */ + +#include "libsa.h" +//#include "saio_internal.h" - Azi: needed for ZDEBUG (printf) +#include "memory.h" + +#define ZDEBUG 0 //Azi: booter doesn't load with this enabled; instant reboot at "boot1: ..." + +#if ZDEBUG +int zout; +#endif + +typedef struct { + char * start; + size_t size; +} zmem; + +static zmem * zalloced; +static zmem * zavailable; +static short availableNodes, allocedNodes, totalNodes; +static char * zalloc_base; +static char * zalloc_end; +static void (*zerror)(char *, size_t, const char *, int); + +static void zallocate(char * start,int size); +static void zinsert(zmem * zp, int ndx); +static void zdelete(zmem * zp, int ndx); +static void zcoalesce(void); + +#if ZDEBUG +size_t zalloced_size; +#endif + +#define ZALLOC_NODES 32767 /* was 16384 */ + +static void malloc_error(char *addr, size_t size, const char *file, int line) +{ +#ifdef i386 + asm volatile ("hlt"); +#endif +} + +// define the block of memory that the allocator will use +void malloc_init(char * start, int size, int nodes, void (*malloc_err_fn)(char *, size_t, const char *, int)) +{ + zalloc_base = start ? start : (char *)ZALLOC_ADDR; + totalNodes = nodes ? nodes : ZALLOC_NODES; + zalloced = (zmem *) zalloc_base; + zavailable = (zmem *) zalloc_base + sizeof(zmem) * totalNodes; + zavailable[0].start = (char *)zavailable + sizeof(zmem) * totalNodes; + if (size == 0) size = ZALLOC_LEN; + zavailable[0].size = size - (zavailable[0].start - zalloc_base); + zalloc_end = zalloc_base + size; + availableNodes = 1; + allocedNodes = 0; + zerror = malloc_err_fn ? malloc_err_fn : malloc_error; +} + +#define BEST_FIT 1 + +void * safe_malloc(size_t size, const char *file, int line) +{ + int i; +#if BEST_FIT + int bestFit; + size_t smallestSize; +#endif + char * ret = 0; + + if ( !zalloc_base ) + { + // this used to follow the bss but some bios' corrupted it... + malloc_init((char *)ZALLOC_ADDR, ZALLOC_LEN, ZALLOC_NODES, malloc_error); + } + + size = ((size + 0xf) & ~0xf); + + if (size == 0) { + if (zerror) (*zerror)((char *)0xdeadbeef, 0, file, line); + } +#if BEST_FIT + smallestSize = 0; + bestFit = -1; +#endif + + for (i = 0; i < availableNodes; i++) + { + // find node with equal size, or if not found, + // then smallest node that fits. + if ( zavailable[i].size == size ) + { + zallocate(ret = zavailable[i].start, size); + zdelete(zavailable, i); availableNodes--; + goto done; + } +#if BEST_FIT + else + { + if ((zavailable[i].size > size) && + ((smallestSize == 0) || + (zavailable[i].size < smallestSize))) + { + bestFit = i; + smallestSize = zavailable[i].size; + } + } + +#else + else if ( zavailable[i].size > size ) + { + zallocate(ret = zavailable[i].start, size); + zavailable[i].start += size; + zavailable[i].size -= size; + goto done; + } +#endif + } +#if BEST_FIT + if (bestFit != -1) + { + zallocate(ret = zavailable[bestFit].start, size); + zavailable[bestFit].start += size; + zavailable[bestFit].size -= size; + } +#endif + +done: + if ((ret == 0) || (ret + size >= zalloc_end)) + { + if (zerror) (*zerror)(ret, size, file, line); + } + if (ret != 0) + { + bzero(ret, size); + } +#if ZDEBUG + zalloced_size += size; +#endif + return (void *) ret; +} + +void free(void * pointer) +{ + unsigned long rp; + int i, found = 0; + size_t tsize = 0; + char * start = pointer; + +#if i386 + // Get return address of our caller, + // in case we have to report an error below. + asm volatile ("movl %%esp, %%eax\n\t" + "subl $4, %%eax\n\t" + "movl 0(%%eax), %%eax" : "=a" (rp) ); +#else + rp = 0; +#endif + + if ( !start ) return; + + for (i = 0; i < allocedNodes; i++) + { + if ( zalloced[i].start == start ) + { + tsize = zalloced[i].size; +#if ZDEBUG + zout -= tsize; + printf(" zz out %d\n",zout); +#endif + zdelete(zalloced, i); allocedNodes--; + found = 1; +#if ZDEBUG + memset(pointer, 0x5A, tsize); +#endif + break; + } + } + if ( !found ) { + if (zerror) (*zerror)(pointer, rp, "free", 0); + else return; + } +#if ZDEBUG + zalloced_size -= tsize; +#endif + + for (i = 0; i < availableNodes; i++) + { + if ((start + tsize) == zavailable[i].start) // merge it in + { + zavailable[i].start = start; + zavailable[i].size += tsize; + zcoalesce(); + return; + } + + if ((i > 0) && + (zavailable[i-1].start + zavailable[i-1].size == start)) + { + zavailable[i-1].size += tsize; + zcoalesce(); + return; + } + + if ((start + tsize) < zavailable[i].start) + { + if (++availableNodes > totalNodes) { + if (zerror) (*zerror)((char *)0xf000f000, 0, "free", 0); + } + zinsert(zavailable, i); + zavailable[i].start = start; + zavailable[i].size = tsize; + return; + } + } + + if (++availableNodes > totalNodes) { + if (zerror) (*zerror)((char *)0xf000f000, 1, "free", 0); + } + zavailable[i].start = start; + zavailable[i].size = tsize; + zcoalesce(); + return; +} + +static void +zallocate(char * start,int size) +{ +#if ZDEBUG + zout += size; + printf(" alloc %d, total 0x%x\n",size,zout); +#endif + zalloced[allocedNodes].start = start; + zalloced[allocedNodes].size = size; + if (++allocedNodes > totalNodes) { + if (zerror) (*zerror)((char *)0xf000f000, 2, "zallocate", 0); + }; +} + +static void +zinsert(zmem * zp, int ndx) +{ + int i; + zmem *z1, *z2; + + i = totalNodes-2; + z1 = zp + i; + z2 = z1 + 1; + + for (; i >= ndx; i--, z1--, z2--) + { + *z2 = *z1; + } +} + +static void +zdelete(zmem * zp, int ndx) +{ + int i; + zmem *z1, *z2; + + z1 = zp + ndx; + z2 = z1 + 1; + + for (i = ndx; i < totalNodes-1; i++, z1++, z2++) + { + *z1 = *z2; + } +} + +static void +zcoalesce(void) +{ + int i; + + for (i = 0; i < availableNodes-1; i++) + { + if ( zavailable[i].start + zavailable[i].size == + zavailable[i+1].start ) + { + zavailable[i].size += zavailable[i+1].size; + zdelete(zavailable, i+1); availableNodes--; + return; + } + } +} + +/* This is the simplest way possible. Should fix this. */ +void * realloc(void * start, size_t newsize) +{ + void * newstart = safe_malloc(newsize, __FILE__, __LINE__); + bcopy(start, newstart, newsize); + free(start); + return newstart; +} diff --git a/i386/libsaio/.svn/all-wcprops b/i386/libsaio/.svn/all-wcprops new file mode 100644 index 0000000..0cb5902 --- /dev/null +++ b/i386/libsaio/.svn/all-wcprops @@ -0,0 +1,611 @@ +K 25 +svn:wc:ra_dav:version-url +V 58 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/libsaio +END +fake_efi.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/fake_efi.h +END +smbios_getters.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/smbios_getters.h +END +asm.s +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/asm.s +END +xml.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/xml.c +END +console.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/console.c +END +xml.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/xml.h +END +exfat.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/exfat.c +END +efi.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/efi.h +END +bootstruct.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/bootstruct.c +END +ntfs_private.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ntfs_private.h +END +io_inline.h +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/io_inline.h +END +hfs_CaseTables.h +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/hfs_CaseTables.h +END +ext2fs.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ext2fs.c +END +exfat.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/exfat.h +END +term.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/term.h +END +vbe.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/vbe.c +END +bootstruct.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/bootstruct.h +END +device_tree.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/device_tree.c +END +hfs.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/hfs.c +END +ext2fs.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ext2fs.h +END +vbe.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/vbe.h +END +acpi_patcher.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/acpi_patcher.c +END +device_tree.h +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/device_tree.h +END +allocate.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/allocate.c +END +hfs.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/hfs.h +END +bootargs.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/bootargs.h +END +hfs_compare.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/hfs_compare.c +END +spd.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/spd.c +END +libsaio.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/libsaio.h +END +acpi_patcher.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/acpi_patcher.h +END +spd.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/spd.h +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/Makefile +END +bios.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/bios.h +END +ufs.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ufs.h +END +gma.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/gma.c +END +nbp_cmd.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/nbp_cmd.h +END +gma.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/gma.h +END +bios.s +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/bios.s +END +pci_root.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/pci_root.c +END +befs.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/befs.c +END +aml_generator.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/aml_generator.c +END +pci_root.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/pci_root.h +END +msdos_private.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/msdos_private.h +END +memvendors.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/memvendors.h +END +befs.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/befs.h +END +aml_generator.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/aml_generator.h +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/Cconfig +END +table.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/table.c +END +usb.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/usb.c +END +device_inject.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/device_inject.c +END +device_inject.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/device_inject.h +END +fdisk.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/fdisk.h +END +base64-decode.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/base64-decode.c +END +dram_controllers.c +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/dram_controllers.c +END +ntfs.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ntfs.c +END +nvidia.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2252/branches/Chimera/i386/libsaio/nvidia.c +END +ati.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/ati.c +END +dram_controllers.h +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/dram_controllers.h +END +sys.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/sys.c +END +nbp.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/nbp.c +END +load.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/load.c +END +ntfs.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ntfs.h +END +nvidia.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/nvidia.h +END +acpi.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/acpi.h +END +ufs_byteorder.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ufs_byteorder.h +END +ati.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/ati.h +END +sl.h +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/sl.h +END +platform.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/platform.c +END +cpu.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/cpu.c +END +platform.h +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/platform.h +END +disk.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/disk.c +END +openbsd.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/openbsd.c +END +pci_setup.c +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/pci_setup.c +END +cpu.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/cpu.h +END +smbios.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/smbios.c +END +disk.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/disk.h +END +openbsd.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/openbsd.h +END +smbios_decode.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2252/branches/Chimera/i386/libsaio/smbios_decode.c +END +hpet.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/hpet.c +END +smbios.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/smbios.h +END +cache.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/cache.c +END +hpet.h +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/hpet.h +END +nvidia_helper.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/nvidia_helper.c +END +freebsd.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/freebsd.c +END +pci.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/pci.c +END +nvidia_helper.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/nvidia_helper.h +END +stringTable.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/stringTable.c +END +freebsd.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/freebsd.h +END +ati_reg.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/ati_reg.h +END +biosfn.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/biosfn.c +END +convert.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/convert.c +END +pci.h +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/pci.h +END +saio_types.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/saio_types.h +END +msdos.c +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/msdos.c +END +convert.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/convert.h +END +md5c.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/md5c.c +END +fake_efi.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/libsaio/fake_efi.c +END +smbios_getters.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/smbios_getters.c +END +msdos.h +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/msdos.h +END +misc.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/libsaio/misc.c +END +saio_internal.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/libsaio/saio_internal.h +END diff --git a/i386/libsaio/.svn/entries b/i386/libsaio/.svn/entries new file mode 100644 index 0000000..a0ce94d --- /dev/null +++ b/i386/libsaio/.svn/entries @@ -0,0 +1,3462 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/libsaio +http://forge.voodooprojects.org/svn/chameleon + + + +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +fake_efi.h +file + + + + +2013-08-27T23:54:11.000000Z +aa5fd3b0cc8cb6e322b7d310ba730723 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +298 + +smbios_getters.h +file + + + + +2013-08-27T23:54:11.000000Z +dca449cfe95be677e6a21003d2d2cccf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1132 + +asm.s +file + + + + +2013-08-27T23:54:11.000000Z +20cdee063d7a2cf2f84f30f6b3c38d1e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12913 + +xml.c +file + + + + +2013-08-27T23:54:11.000000Z +cce4d16bbd4ff90e444d6cef6ca3910b +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +27572 + +console.c +file + + + + +2013-08-27T23:54:11.000000Z +ce97db03fcc9b8d8d560861c92295369 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5639 + +xml.h +file + + + + +2013-08-27T23:54:11.000000Z +627e96c7e86e84f28e782a35add90f35 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +3720 + +exfat.c +file + + + + +2013-08-27T23:54:11.000000Z +f85d356ebe6e859decc186e728bf7bb5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8978 + +efi.h +file + + + + +2013-08-27T23:54:11.000000Z +34644469a316ca5b1d9e841dfefad0f1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15324 + +bootstruct.c +file + + + + +2013-08-27T23:54:11.000000Z +48fc66413fbd49c82f97c4d5d1aa8ac3 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +6814 + +ntfs_private.h +file + + + + +2013-08-27T23:54:11.000000Z +9e4729d092b57ad0667c80762beb8d6e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12635 + +io_inline.h +file + + + + +2013-08-27T23:54:11.000000Z +1e8e7992255c0171adbd4a1a558a13e7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2608 + +hfs_CaseTables.h +file + + + + +2013-08-27T23:54:11.000000Z +9a2f2e1a6277579c388afec7d9326a80 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34890 + +ext2fs.c +file + + + + +2013-08-27T23:54:11.000000Z +a3a3ccca72efce7e85593d651c93ca99 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1218 + +term.h +file + + + + +2013-08-27T23:54:11.000000Z +67e03acda016a29022edee0716551e75 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1415 + +vbe.c +file + + + + +2013-08-27T23:54:11.000000Z +3671af42f9dc6a4911225506d89dfabc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9016 + +exfat.h +file + + + + +2013-08-27T23:54:11.000000Z +ac6bbeb075456565cf6e856b9280020c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1173 + +bootstruct.h +file + + + + +2013-08-27T23:54:11.000000Z +04adb0f5e02f89dd953237ede626e0b0 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +4556 + +device_tree.c +file + + + + +2013-08-27T23:54:11.000000Z +cfca718327e9017109e4e6b087e80a54 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14050 + +hfs.c +file + + + + +2013-08-27T23:54:11.000000Z +86b1b5067c952651c0ec6d276da39af5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +36088 + +ext2fs.h +file + + + + +2013-08-27T23:54:11.000000Z +14c2dfad6d0fa69164a8bc6da9c69923 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +289 + +vbe.h +file + + + + +2013-08-27T23:54:11.000000Z +411ddf1ad2c805421142f461fb340b52 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8597 + +acpi_patcher.c +file + + + + +2013-08-27T23:54:11.000000Z +d708589cabb988a88f91647299778c72 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +35616 + +device_tree.h +file + + + + +2013-08-27T23:54:11.000000Z +5ed665c5c7e3b7bbe1f1e00710fa1b30 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1075 + +allocate.c +file + + + + +2013-08-27T23:54:11.000000Z +a1ad2f7288b2d62f50a9930737471e23 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2263 + +hfs.h +file + + + + +2013-08-27T23:54:11.000000Z +e7d3c9ba23a12f931bd5912d3d40888b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1617 + +bootargs.h +file + + + + +2013-08-27T23:54:11.000000Z +cb928e9633f8db75cb64b79a860a79d0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6484 + +hfs_compare.c +file + + + + +2013-08-27T23:54:11.000000Z +051e1ea45adbb15802ed8b60fe2ab225 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11592 + +spd.c +file + + + + +2013-08-27T23:54:11.000000Z +0334413dfde1df4d176c5418457abd8c +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +13247 + +libsaio.h +file + + + + +2013-08-27T23:54:11.000000Z +d4ddd5cd2ffa9956ba508de46f4230bf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1269 + +acpi_patcher.h +file + + + + +2013-08-27T23:54:11.000000Z +3a6b1b5dafff8d506aae4bf306971dcb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +557 + +spd.h +file + + + + +2013-08-27T23:54:11.000000Z +fdaced111a6f398f5aade10aac6aa3bf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8538 + +Makefile +file + + + + +2013-08-27T23:54:11.000000Z +a50c685519aaf8ca2aa5c5747be8690a +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +1913 + +bios.h +file + + + + +2013-08-27T23:54:11.000000Z +1dfcfe592d46b5b37f48cf9f69ddd5f2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2973 + +ufs.h +file + + + + +2013-08-27T23:54:11.000000Z +b03940e84a4dad36789c7329aed43cf1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1581 + +gma.c +file + + + + +2013-08-27T23:54:11.000000Z +87729cc0fe20c231173d63286f1862f1 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +11713 + +nbp_cmd.h +file + + + + +2013-08-27T23:54:11.000000Z +994df9748c35a2252d62a2580fd5086e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2944 + +gma.h +file + + + + +2013-08-27T23:54:11.000000Z +c512467998fdef516382d2e7028a7a14 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +349 + +bios.s +file + + + + +2013-08-27T23:54:11.000000Z +ca21d7a05cbf7252f7ce64327a94016d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5757 + +pci_root.c +file + + + + +2013-08-27T23:54:11.000000Z +9eab1138768a2450f9831d5f7f17ea81 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2815 + +befs.c +file + + + + +2013-08-27T23:54:11.000000Z +f5be67c66a21c4b06bc0f1accdca7f7d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +758 + +aml_generator.c +file + + + + +2013-08-27T23:54:11.000000Z +11d2ca29bd0bbe2dd30f93a481be46b4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10379 + +pci_root.h +file + + + + +2013-08-27T23:54:11.000000Z +e6e6b7f4840071a0f69dc8c845fc644d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +192 + +msdos_private.h +file + + + + +2013-08-27T23:54:11.000000Z +1479a58110560d55bafd1882baf800e4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13218 + +memvendors.h +file + + + + +2013-08-27T23:54:11.000000Z +18175b6dece44bd8a8db75f97f5948cb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +28046 + +befs.h +file + + + + +2013-08-27T23:54:11.000000Z +04c460652a5565cdfca39986344e8c9b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +184 + +aml_generator.h +file + + + + +2013-08-27T23:54:11.000000Z +835474b72fa68241e17b332c299934a1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1959 + +Cconfig +file + + + + +2013-08-27T23:54:11.000000Z +d41d8cd98f00b204e9800998ecf8427e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +0 + +table.c +file + + + + +2013-08-27T23:54:11.000000Z +753df570a24eaea6e61fe2ceb38b4fb7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3797 + +usb.c +file + + + + +2013-08-27T23:54:11.000000Z +5bf67b9cbd315306022f7668a83b8c74 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9386 + +device_inject.c +file + + + + +2013-08-27T23:54:11.000000Z +0a7c6c63b8fe48e78ae1d8802d22d248 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +8521 + +device_inject.h +file + + + + +2013-08-27T23:54:11.000000Z +c499ed365eb1aa62012624a3cfb0276f +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +2261 + +fdisk.h +file + + + + +2013-08-27T23:54:11.000000Z +515315ed27473d64c0227a2d06ee03f9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3633 + +base64-decode.c +file + + + + +2013-08-27T23:54:11.000000Z +ef9c8b8105147ea15e61cbf48743a52f +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +2366 + +dram_controllers.c +file + + + + +2013-08-27T23:54:11.000000Z +6976a45bda7d75cadf62880c54ef222e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15481 + +ntfs.c +file + + + + +2013-08-27T23:54:11.000000Z +eae6f200aabf39d1fb92ebea68799328 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10347 + +nvidia.c +file + + + + +2013-08-27T23:54:11.000000Z +bd4ca55949a85cce4a1636ec09bd5750 +2013-06-27T13:26:48.960340Z +2252 +macman + + + + + + + + + + + + + + + + + + + + + +64294 + +ati.c +file + + + + +2013-08-27T23:54:11.000000Z +cb477c0a868f18b814e8d9ee0f4ea24a +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +137115 + +dram_controllers.h +file + + + + +2013-08-27T23:54:11.000000Z +d720465a0b0d9c46bd832cde8694e201 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +863 + +sys.c +file + + + + +2013-08-27T23:54:11.000000Z +839507273cad697183c13ceefaee7afc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +29252 + +nbp.c +file + + + + +2013-08-27T23:54:11.000000Z +8755962b311bce2e9444993ac13cfe95 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4434 + +load.c +file + + + + +2013-08-27T23:54:11.000000Z +9004275a85de3cf9b0ae5f63cb37f801 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9127 + +ntfs.h +file + + + + +2013-08-27T23:54:11.000000Z +a12d6341639cd8a635d57b1e4c5ae87e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1097 + +nvidia.h +file + + + + +2013-08-27T23:54:11.000000Z +bc9d12c51b73a1b5cd7d004a7921c311 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +5429 + +acpi.h +file + + + + +2013-08-27T23:54:11.000000Z +845984e7a0c7c03024e2fd59819ca00a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4075 + +ufs_byteorder.h +file + + + + +2013-08-27T23:54:11.000000Z +2bb4d351b94fe2181b8e58ecf7463722 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1906 + +ati.h +file + + + + +2013-08-27T23:54:11.000000Z +a7f7cea84f141c0f793be268063269eb +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +4761 + +sl.h +file + + + + +2013-08-27T23:54:11.000000Z +f65d2eb0d67e40b93aa304e1222407f2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2270 + +platform.c +file + + + + +2013-08-27T23:54:11.000000Z +cade8f124959b5fda22a4ca69d702c6e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1620 + +cpu.c +file + + + + +2013-08-27T23:54:11.000000Z +db08e43feab2794e5d89b34882b68317 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +20637 + +platform.h +file + + + + +2013-08-27T23:54:11.000000Z +b9ea45c9b6924127ee08532ee72a70ec +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +5733 + +disk.c +file + + + + +2013-08-27T23:54:11.000000Z +d0206e24a17e512ba914d27d8a765747 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +62556 + +openbsd.c +file + + + + +2013-08-27T23:54:11.000000Z +4e52e83533c04a9b4c72fea494b9e45f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +583 + +pci_setup.c +file + + + + +2013-08-27T23:54:11.000000Z +0dca5438b5d5946d272b476af4cce7e3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1823 + +cpu.h +file + + + + +2013-08-27T23:54:11.000000Z +3450c9f283fe05b93a4474a7cfaca79f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6111 + +smbios.c +file + + + + +2013-08-27T23:54:11.000000Z +014888c70b89975d1c41bc53aba7b080 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +27514 + +disk.h +file + + + + +2013-08-27T23:54:11.000000Z +1eed731d4bad478e1a61f8da8a87c262 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +294 + +openbsd.h +file + + + + +2013-08-27T23:54:11.000000Z +7a3479de5f0b6e928436d4c483f98a0a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +116 + +smbios_decode.c +file + + + + +2013-08-27T23:54:11.000000Z +9be3db741f35a1b094db6e7a0ef1233d +2013-06-27T13:26:48.960340Z +2252 +macman + + + + + + + + + + + + + + + + + + + + + +11139 + +hpet.c +file + + + + +2013-08-27T23:54:11.000000Z +8742c76e7ca761c948666f0f737a278e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2430 + +smbios.h +file + + + + +2013-08-27T23:54:11.000000Z +49fb455df7c1a6fae7ccb60a54a7d72f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13196 + +cache.c +file + + + + +2013-08-27T23:54:11.000000Z +4ba2faddcfe4c45d7ecb7a40bef9957a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4777 + +hpet.h +file + + + + +2013-08-27T23:54:11.000000Z +97007b438440287f023e031a09c2323c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +306 + +nvidia_helper.c +file + + + + +2013-08-27T23:54:11.000000Z +801f57c19fb8200f3e4faa3a6e9420b3 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +3091 + +freebsd.c +file + + + + +2013-08-27T23:54:11.000000Z +489e96d878257eaed71c856a6ca38933 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +584 + +pci.c +file + + + + +2013-08-27T23:54:11.000000Z +d644ebd255cef16701353ffb0a69d031 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +4382 + +nvidia_helper.h +file + + + + +2013-08-27T23:54:11.000000Z +3e3e3989389b1563dac1deefd0a6be02 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +489 + +stringTable.c +file + + + + +2013-08-27T23:54:11.000000Z +71c5e2823c4edf386c5f847c2a8199ae +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +16557 + +freebsd.h +file + + + + +2013-08-27T23:54:11.000000Z +b078984a9e751eda114524faa693ba76 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +116 + +ati_reg.h +file + + + + +2013-08-27T23:54:11.000000Z +2798eeb94e6b08df387db88317f192e6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +295573 + +biosfn.c +file + + + + +2013-08-27T23:54:11.000000Z +0987c840bba0ffcb28b49532f4681711 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25729 + +convert.c +file + + + + +2013-08-27T23:54:11.000000Z +a70c45aa0a214097edb6b375373b05af +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4133 + +pci.h +file + + + + +2013-08-27T23:54:11.000000Z +6dfdb71896259868c0872f5a1c9a650e +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +50052 + +saio_types.h +file + + + + +2013-08-27T23:54:11.000000Z +7838170f3b865cea0946e274748b61fe +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8035 + +msdos.c +file + + + + +2013-08-27T23:54:11.000000Z +080534faedd290516f47edd19fd914d5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +23890 + +convert.h +file + + + + +2013-08-27T23:54:11.000000Z +a1b39cd4bfc86cc8146aa3f830db08d7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +732 + +md5c.c +file + + + + +2013-08-27T23:54:11.000000Z +cf7fd6690198615c9730024cfb03b215 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9002 + +fake_efi.c +file + + + + +2013-08-27T23:54:11.000000Z +ecaabcffa4d5ccb75fc1a0d6de24506e +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +28863 + +smbios_getters.c +file + + + + +2013-08-27T23:54:11.000000Z +8af21b4d2b8e128fdc10e5394e0dbd03 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +9826 + +msdos.h +file + + + + +2013-08-27T23:54:11.000000Z +75bf4772fa12da379ee571c3308ba852 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1634 + +misc.c +file + + + + +2013-08-27T23:54:11.000000Z +6b204ee591272758d0a233e1d8b105cf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3530 + +saio_internal.h +file + + + + +2013-08-27T23:54:11.000000Z +3f572c808574ae731794425b3792ec04 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +10279 + diff --git a/i386/libsaio/.svn/text-base/Cconfig.svn-base b/i386/libsaio/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..e69de29 diff --git a/i386/libsaio/.svn/text-base/Makefile.svn-base b/i386/libsaio/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..3ec1a27 --- /dev/null +++ b/i386/libsaio/.svn/text-base/Makefile.svn-base @@ -0,0 +1,65 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/libsaio +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = libsaio +include ${SRCROOT}/Make.rules + +UTILDIR = ../util +LIBSADIR = ../libsa +BOOT2DIR = ../boot2 + +DEFINES = -DNOTHING +#DEFINES = -DDEBUG_CPU=1 -DDEBUG_MEM=1 -DDEBUG_SPD=1 -DDEBUG_PCI=1 -DDEBUG_SMBIOS=1 + +CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ + -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ + -DRCZ_COMPRESSED_FILE_SUPPORT -fno-stack-protector \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ + +INC = -I. -I$(SRCROOT) -I$(SYMROOT) -I$(LIBSADIR) -I$(BOOT2DIR) -I${SRCROOT}/i386/include + +SAIO_OBJS = table.o asm.o bios.o biosfn.o \ + disk.o sys.o cache.o bootstruct.o \ + stringTable.o load.o pci.o allocate.o misc.o \ + befs.o freebsd.o openbsd.o \ + vbe.o nbp.o hfs.o hfs_compare.o \ + xml.o ntfs.o msdos.o md5c.o device_tree.o \ + cpu.o platform.o acpi_patcher.o \ + smbios.o smbios_getters.o smbios_decode.o \ + fake_efi.o ext2fs.o \ + hpet.o dram_controllers.o spd.o usb.o pci_setup.o \ + device_inject.o nvidia_helper.o nvidia.o ati.o gma.o pci_root.o \ + convert.o aml_generator.o console.o exfat.o base64-decode.o + +SAIO_OBJS := $(addprefix $(OBJROOT)/, $(SAIO_OBJS)) + +LIBS = libsaio.a +LIBS := $(addprefix $(SYMROOT)/, $(LIBS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + + +all: $(DIRS_NEEDED) $(CONFIG_HEADERS) $(LIBS) all-recursive + +$(LIBS): $(SAIO_OBJS) + @echo "\t[RM] $@" + @rm -f $@ + @echo "\t[AR] $(@F)" + @ar q $@ $^ &> /dev/null + @echo "\t[RANLIB] $(@F)" + @ranlib $(SYMROOT)/$(@F) + +clean-local: + @rm -f $(LIBS) $(SAIO_OBJS) + +# dependencies +-include $(OBJROOT)/Makedep diff --git a/i386/libsaio/.svn/text-base/acpi.h.svn-base b/i386/libsaio/.svn/text-base/acpi.h.svn-base new file mode 100644 index 0000000..bc8c770 --- /dev/null +++ b/i386/libsaio/.svn/text-base/acpi.h.svn-base @@ -0,0 +1,153 @@ +#ifndef __LIBSAIO_ACPI_H +#define __LIBSAIO_ACPI_H + +#define ACPI_RANGE_START (0x0E0000) +#define ACPI_RANGE_END (0x0FFFFF) + +#define UINT64_LE_FROM_CHARS(a,b,c,d,e,f,g,h) \ +( ((uint64_t)h << 56) \ +| ((uint64_t)g << 48) \ +| ((uint64_t)f << 40) \ +| ((uint64_t)e << 32) \ +| ((uint64_t)d << 24) \ +| ((uint64_t)c << 16) \ +| ((uint64_t)b << 8) \ +| ((uint64_t)a << 0) \ +) + +#define ACPI_SIGNATURE_UINT64_LE UINT64_LE_FROM_CHARS('R','S','D',' ','P','T','R',' ') + +/* Per ACPI 3.0a spec */ + +// TODO Migrate +struct acpi_2_rsdp { + char Signature[8]; + uint8_t Checksum; + char OEMID[6]; + uint8_t Revision; + uint32_t RsdtAddress; + uint32_t Length; + uint64_t XsdtAddress; + uint8_t ExtendedChecksum; + char Reserved[3]; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_rsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_xsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_ssdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_dsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_fadt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; + uint32_t FIRMWARE_CTRL; + uint32_t DSDT; + uint8_t Model; // JrCs + uint8_t PM_Profile; // JrCs + uint16_t SCI_Interrupt; + uint32_t SMI_Command_Port; + uint8_t ACPI_Enable; + uint8_t ACPI_Disable; + uint8_t S4BIOS_Command; + uint8_t PState_Control; + uint32_t PM1A_Event_Block_Address; + uint32_t PM1B_Event_Block_Address; + uint32_t PM1A_Control_Block_Address; + uint32_t PM1B_Control_Block_Address; + uint32_t PM2_Control_Block_Address; + uint32_t PM_Timer_Block_Address; + uint32_t GPE0_Block_Address; + uint32_t GPE1_Block_Address; + uint8_t PM1_Event_Block_Length; + uint8_t PM1_Control_Block_Length; + uint8_t PM2_Control_Block_Length; + uint8_t PM_Timer_Block_Length; + uint8_t GPE0_Block_Length; + uint8_t GPE1_Block_Length; + uint8_t GPE1_Base_Offset; + uint8_t CST_Support; + uint16_t C2_Latency; + uint16_t C3_Latency; + uint16_t CPU_Cache_Size; + uint16_t Cache_Flush_Stride; + uint8_t Duty_Cycle_Offset; + uint8_t Duty_Cycle_Width; + uint8_t RTC_Day_Alarm_Index; + uint8_t RTC_Month_Alarm_Index; + uint8_t RTC_Century_Index; + uint16_t Boot_Flags; + uint8_t Reserved0; +/* Begin Asere */ + //Reset Fix + uint32_t Flags; + uint8_t Reset_SpaceID; + uint8_t Reset_BitWidth; + uint8_t Reset_BitOffset; + uint8_t Reset_AccessWidth; + uint64_t Reset_Address; + uint8_t Reset_Value; + uint8_t Reserved[3]; + + uint64_t X_FIRMWARE_CTRL; + uint64_t X_DSDT; +/* End Asere */ + /*We absolutely don't care about theese fields*/ + uint8_t notimp2[96]; +} __attribute__((packed)); + +#endif /* !__LIBSAIO_ACPI_H */ diff --git a/i386/libsaio/.svn/text-base/acpi_patcher.c.svn-base b/i386/libsaio/.svn/text-base/acpi_patcher.c.svn-base new file mode 100644 index 0000000..7528a16 --- /dev/null +++ b/i386/libsaio/.svn/text-base/acpi_patcher.c.svn-base @@ -0,0 +1,1177 @@ +/* + * Copyright 2008 mackerintel + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "acpi.h" +#include "efi_tables.h" +#include "fake_efi.h" +#include "acpi_patcher.h" +#include "platform.h" +#include "cpu.h" +#include "aml_generator.h" + +#ifndef DEBUG_ACPI +#define DEBUG_ACPI 0 +#endif + +#if DEBUG_ACPI==2 +#define DBG(x...) {printf(x); sleep(1);} +#elif DEBUG_ACPI==1 +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +// Slice: New signature compare function +boolean_t tableSign(char *table, const char *sgn) +{ + int i; + for (i=0; i<4; i++) { + if ((table[i] &~0x20) != (sgn[i] &~0x20)) { + return false; + } + } + return true; +} + +/* Gets the ACPI 1.0 RSDP address */ +static struct acpi_2_rsdp* getAddressOfAcpiTable() +{ + /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ + + void *acpi_addr = (void*)ACPI_RANGE_START; + for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) + { + if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) + { + uint8_t csum = checksum8(acpi_addr, 20); + if(csum == 0) + { + // Only return the table if it is a true version 1.0 table (Revision 0) + if(((struct acpi_2_rsdp*)acpi_addr)->Revision == 0) + return acpi_addr; + } + } + } + return NULL; +} + +/* Gets the ACPI 2.0 RSDP address */ +static struct acpi_2_rsdp* getAddressOfAcpi20Table() +{ + /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ + + void *acpi_addr = (void*)ACPI_RANGE_START; + for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) + { + if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) + { + uint8_t csum = checksum8(acpi_addr, 20); + + /* Only assume this is a 2.0 or better table if the revision is greater than 0 + * NOTE: ACPI 3.0 spec only seems to say that 1.0 tables have revision 1 + * and that the current revision is 2.. I am going to assume that rev > 0 is 2.0. + */ + + if(csum == 0 && (((struct acpi_2_rsdp*)acpi_addr)->Revision > 0)) + { + uint8_t csum2 = checksum8(acpi_addr, sizeof(struct acpi_2_rsdp)); + if(csum2 == 0) + return acpi_addr; + } + } + } + return NULL; +} +/** The folowing ACPI Table search algo. should be reused anywhere needed:*/ +int search_and_get_acpi_fd(const char * filename, const char ** outDirspec) +{ + int fd = 0; + char dirSpec[512]; + + // Try finding 'filename' in the usual places + // Start searching any potential location for ACPI Table + sprintf(dirSpec, "%s", filename); + fd = open(dirSpec, 0); + if (fd < 0) + { + sprintf(dirSpec, "/Extra/%s", filename); + fd = open(dirSpec, 0); + if (fd < 0) + { + sprintf(dirSpec, "bt(0,0)/Extra/%s", filename); + fd = open(dirSpec, 0); + } + } + + if (fd < 0) + { + // NOT FOUND: + verbose("ACPI table not found: %s\n", filename); + *dirSpec = '\0'; + } + + if (outDirspec) *outDirspec = dirSpec; + return fd; +} + + +void *loadACPITable (const char * filename) +{ + void *tableAddr; + const char * dirspec=NULL; + + int fd = search_and_get_acpi_fd(filename, &dirspec); + + if (fd>=0) + { + tableAddr=(void*)AllocateKernelMemory(file_size (fd)); + if (tableAddr) + { + if (read (fd, tableAddr, file_size (fd))!=file_size (fd)) + { + printf("Couldn't read table %s\n",dirspec); + free (tableAddr); + close (fd); + return NULL; + } + + DBG("Table %s read and stored at: %x\n", dirspec, tableAddr); + close (fd); + return tableAddr; + } + close (fd); + printf("Couldn't allocate memory for table \n", dirspec); + } + //printf("Couldn't find table %s\n", filename); + return NULL; +} + +uint8_t acpi_cpu_count = 0; +char* acpi_cpu_name[32]; +uint32_t acpi_cpu_p_blk = 0; + +void get_acpi_cpu_names(unsigned char* dsdt, uint32_t length) +{ + uint32_t i; + + DBG("start finding cpu names. length %d\n", length); + + for (i=0; i<length-7; i++) + { + if (dsdt[i] == 0x5B && dsdt[i+1] == 0x83) // ProcessorOP + { + DBG("dsdt: %x%x\n", dsdt[i], dsdt[i+1]); + + uint32_t offset = i + 3 + (dsdt[i+2] >> 6); + + bool add_name = true; + + uint8_t j; + + for (j=0; j<4; j++) + { + char c = dsdt[offset+j]; + + if (!aml_isvalidchar(c)) + { + add_name = false; + verbose("Invalid character found in ProcessorOP 0x%x!\n", c); + break; + } + } + + if (add_name) + { + acpi_cpu_name[acpi_cpu_count] = malloc(4); + memcpy(acpi_cpu_name[acpi_cpu_count], dsdt+offset, 4); + i = offset + 5; + + if (acpi_cpu_count == 0) + acpi_cpu_p_blk = dsdt[i] | (dsdt[i+1] << 8); + + verbose("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]); + + if (++acpi_cpu_count == 32) return; + } + } + } + + DBG("end finding cpu names: cpu names found: %d\n", acpi_cpu_count); +} + +struct acpi_2_ssdt *generate_cst_ssdt(struct acpi_2_fadt* fadt) +{ + char ssdt_header[] = + { + 0x53, 0x53, 0x44, 0x54, 0xE7, 0x00, 0x00, 0x00, /* SSDT.... */ + 0x01, 0x17, 0x50, 0x6D, 0x52, 0x65, 0x66, 0x41, /* ..PmRefA */ + 0x43, 0x70, 0x75, 0x43, 0x73, 0x74, 0x00, 0x00, /* CpuCst.. */ + 0x00, 0x10, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* ....INTL */ + 0x31, 0x03, 0x10, 0x20 /* 1.._ */ + }; + + char resource_template_register_fixedhw[] = + { + 0x11, 0x14, 0x0A, 0x11, 0x82, 0x0C, 0x00, 0x7F, + 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x79, 0x00 + }; + + char resource_template_register_systemio[] = + { + 0x11, 0x14, 0x0A, 0x11, 0x82, 0x0C, 0x00, 0x01, + 0x08, 0x00, 0x00, 0x15, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x79, 0x00, + }; + + if (Platform.CPU.Vendor != 0x756E6547) { + verbose ("Not an Intel platform: C-States will not be generated !!!\n"); + return NULL; + } + + if (fadt == NULL) { + verbose ("FACP not exists: C-States will not be generated !!!\n"); + return NULL; + } + + struct acpi_2_dsdt* dsdt = (void*)fadt->DSDT; + + if (dsdt == NULL) { + verbose ("DSDT not found: C-States will not be generated !!!\n"); + return NULL; + } + + if (acpi_cpu_count == 0) + get_acpi_cpu_names((void*)dsdt, dsdt->Length); + + if (acpi_cpu_count > 0) + { + bool c2_enabled = false; + bool c3_enabled = false; + bool c4_enabled = false; + bool cst_using_systemio = false; + + getBoolForKey(kEnableC2State, &c2_enabled, &bootInfo->chameleonConfig); + getBoolForKey(kEnableC3State, &c3_enabled, &bootInfo->chameleonConfig); + getBoolForKey(kEnableC4State, &c4_enabled, &bootInfo->chameleonConfig); + getBoolForKey(kCSTUsingSystemIO, &cst_using_systemio, &bootInfo->chameleonConfig); + + c2_enabled = c2_enabled | (fadt->C2_Latency < 100); + c3_enabled = c3_enabled | (fadt->C3_Latency < 1000); + + unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + (c3_enabled ? 1 : 0); + + struct aml_chunk* root = aml_create_node(NULL); + aml_add_buffer(root, ssdt_header, sizeof(ssdt_header)); // SSDT header + struct aml_chunk* scop = aml_add_scope(root, "\\_PR_"); + struct aml_chunk* name = aml_add_name(scop, "CST_"); + struct aml_chunk* pack = aml_add_package(name); + aml_add_byte(pack, cstates_count); + + struct aml_chunk* tmpl = aml_add_package(pack); + if (cst_using_systemio) + { + // C1 + resource_template_register_fixedhw[8] = 0x00; + resource_template_register_fixedhw[9] = 0x00; + resource_template_register_fixedhw[18] = 0x00; + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x01); // C1 + aml_add_word(tmpl, 0x0001); // Latency + aml_add_dword(tmpl, 0x000003e8); // Power + + uint8_t p_blk_lo, p_blk_hi; + + if (c2_enabled) // C2 + { + p_blk_lo = acpi_cpu_p_blk + 4; + p_blk_hi = (acpi_cpu_p_blk + 4) >> 8; + + tmpl = aml_add_package(pack); + resource_template_register_systemio[11] = p_blk_lo; // C2 + resource_template_register_systemio[12] = p_blk_hi; // C2 + aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio)); + aml_add_byte(tmpl, 0x02); // C2 + aml_add_word(tmpl, 0x0040); // Latency + aml_add_dword(tmpl, 0x000001f4); // Power + } + + if (c4_enabled) // C4 + { + p_blk_lo = acpi_cpu_p_blk + 5; + p_blk_hi = (acpi_cpu_p_blk + 5) >> 8; + + tmpl = aml_add_package(pack); + resource_template_register_systemio[11] = p_blk_lo; // C4 + resource_template_register_systemio[12] = p_blk_hi; // C4 + aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio)); + aml_add_byte(tmpl, 0x04); // C4 + aml_add_word(tmpl, 0x0080); // Latency + aml_add_dword(tmpl, 0x000000C8); // Power + } + else if (c3_enabled) // C3 + { + p_blk_lo = acpi_cpu_p_blk + 5; + p_blk_hi = (acpi_cpu_p_blk + 5) >> 8; + + tmpl = aml_add_package(pack); + resource_template_register_systemio[11] = p_blk_lo; // C3 + resource_template_register_systemio[12] = p_blk_hi; // C3 + aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio)); + aml_add_byte(tmpl, 0x03); // C3 + aml_add_word(tmpl, 0x0060); // Latency + aml_add_dword(tmpl, 0x0000015e); // Power + } + } + else + { + // C1 + resource_template_register_fixedhw[11] = 0x00; // C1 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x01); // C1 + aml_add_word(tmpl, 0x0001); // Latency + aml_add_dword(tmpl, 0x000003e8); // Power + + resource_template_register_fixedhw[18] = 0x03; + + if (c2_enabled) // C2 + { + tmpl = aml_add_package(pack); + resource_template_register_fixedhw[11] = 0x10; // C2 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x02); // C2 + aml_add_word(tmpl, 0x0040); // Latency + aml_add_dword(tmpl, 0x000001f4); // Power + } + + if (c4_enabled) // C4 + { + tmpl = aml_add_package(pack); + resource_template_register_fixedhw[11] = 0x30; // C4 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x04); // C4 + aml_add_word(tmpl, 0x0080); // Latency + aml_add_dword(tmpl, 0x000000C8); // Power + } + else if (c3_enabled) + { + tmpl = aml_add_package(pack); + resource_template_register_fixedhw[11] = 0x20; // C3 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x03); // C3 + aml_add_word(tmpl, 0x0060); // Latency + aml_add_dword(tmpl, 0x0000015e); // Power + } + } + + // Aliaces + int i; + for (i = 0; i < acpi_cpu_count; i++) + { + char name[9]; + sprintf(name, "_PR_%c%c%c%c", acpi_cpu_name[i][0], acpi_cpu_name[i][1], acpi_cpu_name[i][2], acpi_cpu_name[i][3]); + + scop = aml_add_scope(root, name); + aml_add_alias(scop, "CST_", "_CST"); + } + + aml_calculate_size(root); + + struct acpi_2_ssdt *ssdt = (struct acpi_2_ssdt *)AllocateKernelMemory(root->Size); + + aml_write_node(root, (void*)ssdt, 0); + + ssdt->Length = root->Size; + ssdt->Checksum = 0; + ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length); + + aml_destroy_node(root); + + // dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt->Length); + + verbose ("SSDT with CPU C-States generated successfully\n"); + + return ssdt; + } + else + { + verbose ("ACPI CPUs not found: C-States not generated !!!\n"); + } + + return NULL; +} + +struct acpi_2_ssdt *generate_pss_ssdt(struct acpi_2_dsdt* dsdt) +{ + char ssdt_header[] = + { + 0x53, 0x53, 0x44, 0x54, 0x7E, 0x00, 0x00, 0x00, /* SSDT.... */ + 0x01, 0x6A, 0x50, 0x6D, 0x52, 0x65, 0x66, 0x00, /* ..PmRef. */ + 0x43, 0x70, 0x75, 0x50, 0x6D, 0x00, 0x00, 0x00, /* CpuPm... */ + 0x00, 0x30, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* .0..INTL */ + 0x31, 0x03, 0x10, 0x20, /* 1.._ */ + }; + + if (Platform.CPU.Vendor != 0x756E6547) { + verbose ("Not an Intel platform: P-States will not be generated !!!\n"); + return NULL; + } + + if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) { + verbose ("Unsupported CPU: P-States will not be generated !!!\n"); + return NULL; + } + + if (acpi_cpu_count == 0) + get_acpi_cpu_names((void*)dsdt, dsdt->Length); + + if (acpi_cpu_count > 0) + { + struct p_state initial, maximum, minimum, p_states[32]; + uint8_t p_states_count = 0; + + // Retrieving P-States, ported from code by superhai (c) + switch (Platform.CPU.Family) { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: // Intel Pentium M + case CPU_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPU_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPU_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPU_MODEL_ATOM: // Intel Atom (45nm) + { + bool cpu_dynamic_fsb = false; + + if (rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 27)) + { + wrmsr64(MSR_IA32_EXT_CONFIG, (rdmsr64(MSR_IA32_EXT_CONFIG) | (1 << 28))); + delay(1); + cpu_dynamic_fsb = rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 28); + } + + bool cpu_noninteger_bus_ratio = (rdmsr64(MSR_IA32_PERF_STATUS) & (1ULL << 46)); + + initial.Control = rdmsr64(MSR_IA32_PERF_STATUS); + + maximum.Control = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 32) & 0x1F3F) | (0x4000 * cpu_noninteger_bus_ratio); + maximum.CID = ((maximum.FID & 0x1F) << 1) | cpu_noninteger_bus_ratio; + + minimum.FID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 24) & 0x1F) | (0x80 * cpu_dynamic_fsb); + minimum.VID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 48) & 0x3F); + + if (minimum.FID == 0) + { + uint64_t msr; + uint8_t i; + // Probe for lowest fid + for (i = maximum.FID; i >= 0x6; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (i << 8) | minimum.VID); + intel_waitforsts(); + minimum.FID = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0x1F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + if (minimum.VID == maximum.VID) + { + uint64_t msr; + uint8_t i; + // Probe for lowest vid + for (i = maximum.VID; i > 0xA; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (minimum.FID << 8) | i); + intel_waitforsts(); + minimum.VID = rdmsr64(MSR_IA32_PERF_STATUS) & 0x3F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + minimum.CID = ((minimum.FID & 0x1F) << 1) >> cpu_dynamic_fsb; + + // Sanity check + if (maximum.CID < minimum.CID) + { + DBG("Insane FID values!"); + p_states_count = 0; + } + else + { + // Finalize P-States + // Find how many P-States machine supports + p_states_count = maximum.CID - minimum.CID + 1; + + if (p_states_count > 32) + p_states_count = 32; + + uint8_t vidstep; + uint8_t i = 0, u, invalid = 0; + + vidstep = ((maximum.VID << 2) - (minimum.VID << 2)) / (p_states_count - 1); + + for (u = 0; u < p_states_count; u++) + { + i = u - invalid; + + p_states[i].CID = maximum.CID - u; + p_states[i].FID = (p_states[i].CID >> 1); + + if (p_states[i].FID < 0x6) + { + if (cpu_dynamic_fsb) + p_states[i].FID = (p_states[i].FID << 1) | 0x80; + } + else if (cpu_noninteger_bus_ratio) + { + p_states[i].FID = p_states[i].FID | (0x40 * (p_states[i].CID & 0x1)); + } + + if (i && p_states[i].FID == p_states[i-1].FID) + invalid++; + + p_states[i].VID = ((maximum.VID << 2) - (vidstep * u)) >> 2; + + uint32_t multiplier = p_states[i].FID & 0x1f; // = 0x08 + bool half = p_states[i].FID & 0x40; // = 0x01 + bool dfsb = p_states[i].FID & 0x80; // = 0x00 + uint32_t fsb = Platform.CPU.FSBFrequency / 1000000; // = 400 + uint32_t halffsb = (fsb + 1) >> 1; // = 200 + uint32_t frequency = (multiplier * fsb); // = 3200 + + p_states[i].Frequency = (frequency + (half * halffsb)) >> dfsb; // = 3200 + 200 = 3400 + } + + p_states_count -= invalid; + } + + break; + } + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65xx + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1155 (22nm) + + { + if ((Platform.CPU.Model == CPU_MODEL_SANDYBRIDGE) || + (Platform.CPU.Model == CPU_MODEL_JAKETOWN) || + (Platform.CPU.Model == CPU_MODEL_HASWELL)) + { + maximum.Control = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0xff; + } else { + maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; + } + minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff; + + verbose("P-States: min %d, max %d\n", minimum.Control, maximum.Control); + + // Sanity check + if (maximum.Control < minimum.Control) + { + DBG("Insane control values!"); + p_states_count = 0; + } + else + { + uint8_t i; + p_states_count = 0; + + for (i = maximum.Control; i >= minimum.Control; i--) + { + p_states[p_states_count].Control = i; + p_states[p_states_count].CID = p_states[p_states_count].Control << 1; + p_states[p_states_count].Frequency = (Platform.CPU.FSBFrequency / 1000000) * i; + p_states_count++; + } + } + + break; + } + default: + verbose ("Unsupported CPU: P-States not generated !!!\n"); + break; + } + } + } + + // Generating SSDT + if (p_states_count > 0) + { + int i; + + struct aml_chunk* root = aml_create_node(NULL); + aml_add_buffer(root, ssdt_header, sizeof(ssdt_header)); // SSDT header + struct aml_chunk* scop = aml_add_scope(root, "\\_PR_"); + struct aml_chunk* name = aml_add_name(scop, "PSS_"); + struct aml_chunk* pack = aml_add_package(name); + + for (i = 0; i < p_states_count; i++) + { + struct aml_chunk* pstt = aml_add_package(pack); + + aml_add_dword(pstt, p_states[i].Frequency); + aml_add_dword(pstt, 0x00000000); // Power + aml_add_dword(pstt, 0x0000000A); // Latency + aml_add_dword(pstt, 0x0000000A); // Latency + aml_add_dword(pstt, p_states[i].Control); + aml_add_dword(pstt, i+1); // Status + } + + // Add aliaces + for (i = 0; i < acpi_cpu_count; i++) + { + char name[9]; + sprintf(name, "_PR_%c%c%c%c", acpi_cpu_name[i][0], acpi_cpu_name[i][1], acpi_cpu_name[i][2], acpi_cpu_name[i][3]); + + scop = aml_add_scope(root, name); + aml_add_alias(scop, "PSS_", "_PSS"); + } + + aml_calculate_size(root); + + struct acpi_2_ssdt *ssdt = (struct acpi_2_ssdt *)AllocateKernelMemory(root->Size); + + aml_write_node(root, (void*)ssdt, 0); + + ssdt->Length = root->Size; + ssdt->Checksum = 0; + ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length); + + aml_destroy_node(root); + + //dumpPhysAddr("P-States SSDT content: ", ssdt, ssdt->Length); + + verbose ("SSDT with CPU P-States generated successfully\n"); + + return ssdt; + } + } + else + { + verbose ("ACPI CPUs not found: P-States not generated !!!\n"); + } + + return NULL; +} + +struct acpi_2_fadt *patch_fadt(struct acpi_2_fadt *fadt, struct acpi_2_dsdt *new_dsdt) +{ + extern void setupSystemType(); + + struct acpi_2_fadt *fadt_mod; + bool fadt_rev2_needed = false; + bool fix_restart; + bool fix_restart_ps2; + const char * value; + + // Restart Fix + if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */ + fix_restart = true; + fix_restart_ps2 = false; + if ( getBoolForKey(kPS2RestartFix, &fix_restart_ps2, &bootInfo->chameleonConfig) && fix_restart_ps2) + fix_restart = true; + else + getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig); + + } else { + verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); + fix_restart = false; + } + + if (fix_restart) fadt_rev2_needed = true; + + // Allocate new fadt table + if (fadt->Length < 0x84 && fadt_rev2_needed) + { + fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(0x84); + memcpy(fadt_mod, fadt, fadt->Length); + fadt_mod->Length = 0x84; + fadt_mod->Revision = 0x02; // FADT rev 2 (ACPI 1.0B MS extensions) + } + else + { + fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(fadt->Length); + memcpy(fadt_mod, fadt, fadt->Length); + } + // Determine system type / PM_Model + if ( (value=getStringForKey(kSystemType, &bootInfo->chameleonConfig))!=NULL) + { + if (Platform.Type > 6) + { + if(fadt_mod->PM_Profile<=6) + Platform.Type = fadt_mod->PM_Profile; // get the fadt if correct + else + Platform.Type = 1; /* Set a fixed value (Desktop) */ + verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type); + } + else + Platform.Type = (unsigned char) strtoul(value, NULL, 10); + } + // Set PM_Profile from System-type if only user wanted this value to be forced + if (fadt_mod->PM_Profile != Platform.Type) + { + if (value) + { // user has overriden the SystemType so take care of it in FACP + verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type); + fadt_mod->PM_Profile = Platform.Type; + } + else + { // PM_Profile has a different value and no override has been set, so reflect the user value to ioregs + Platform.Type = fadt_mod->PM_Profile <= 6 ? fadt_mod->PM_Profile : 1; + } + } + // We now have to write the systemm-type in ioregs: we cannot do it before in setupDeviceTree() + // because we need to take care of facp original content, if it is correct. + setupSystemType(); + + // Patch FADT to fix restart + if (fix_restart) + { + if (fix_restart_ps2) { + fadt_mod->Flags|= 0x400; + fadt_mod->Reset_SpaceID = 0x01; // System I/O + fadt_mod->Reset_BitWidth = 0x08; // 1 byte + fadt_mod->Reset_BitOffset = 0x00; // Offset 0 + fadt_mod->Reset_AccessWidth = 0x01; // Byte access + fadt_mod->Reset_Address = 0x64; // Address of the register + fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system + msglog("FADT: PS2 Restart Fix applied!\n"); + } + else { + fadt_mod->Flags|= 0x400; + fadt_mod->Reset_SpaceID = 0x01; // System I/O + fadt_mod->Reset_BitWidth = 0x08; // 1 byte + fadt_mod->Reset_BitOffset = 0x00; // Offset 0 + fadt_mod->Reset_AccessWidth = 0x01; // Byte access + fadt_mod->Reset_Address = 0x0cf9; // Address of the register + fadt_mod->Reset_Value = 0x06; // Value to write to reset the system + verbose("FADT: ACPI Restart Fix applied!\n"); + } + + } + + // Patch DSDT Address if we have loaded DSDT.aml + if(new_dsdt) + { + DBG("DSDT: Old @%x,%x, ",fadt_mod->DSDT,fadt_mod->X_DSDT); + + fadt_mod->DSDT=(uint32_t)new_dsdt; + if ((uint32_t)(&(fadt_mod->X_DSDT))-(uint32_t)fadt_mod+8<=fadt_mod->Length) + fadt_mod->X_DSDT=(uint32_t)new_dsdt; + + DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT); + + verbose("FADT: Using custom DSDT!\n"); + } + + // Correct the checksum + fadt_mod->Checksum=0; + fadt_mod->Checksum=256-checksum8(fadt_mod,fadt_mod->Length); + + return fadt_mod; +} + +/* Setup ACPI without replacing DSDT. */ +int setupAcpiNoMod() +{ + // addConfigurationTable(&gEfiAcpiTableGuid, getAddressOfAcpiTable(), "ACPI"); + // addConfigurationTable(&gEfiAcpi20TableGuid, getAddressOfAcpi20Table(), "ACPI_20"); + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi10_p = (uint32_t)getAddressOfAcpiTable(); + acpi20_p = (uint32_t)getAddressOfAcpi20Table(); + addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); + if(acpi20_p) addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); + return 1; +} + +/* Setup ACPI. Replace DSDT if DSDT.aml is found */ +int setupAcpi(void) +{ + int version; + void *new_dsdt; + + + const char *filename; + char dirSpec[128]; + int len = 0; + + // always reset cpu count to 0 when injecting new acpi + acpi_cpu_count = 0; + + // Try using the file specified with the DSDT option + if (getValueForKey(kDSDT, &filename, &len, &bootInfo->chameleonConfig)) + { + sprintf(dirSpec, filename); + } + else + { + sprintf(dirSpec, "DSDT.aml"); + } + + // Load replacement DSDT + new_dsdt = loadACPITable(dirSpec); + // Mozodojo: going to patch FACP and load SSDT's even if DSDT.aml is not present + /*if (!new_dsdt) + { + return setupAcpiNoMod(); + }*/ + + // Mozodojo: Load additional SSDTs + struct acpi_2_ssdt *new_ssdt[32]; // 30 + 2 additional tables for pss & cst + int ssdt_count=0; + + // SSDT Options + bool drop_ssdt=false, generate_pstates=false, generate_cstates=false; + + getBoolForKey(kDropSSDT, &drop_ssdt, &bootInfo->chameleonConfig); + getBoolForKey(kGeneratePStates, &generate_pstates, &bootInfo->chameleonConfig); + getBoolForKey(kGenerateCStates, &generate_cstates, &bootInfo->chameleonConfig); + + DBG("Generating P-states config: %d\n", generate_pstates); + DBG("Generating C-states config: %d\n", generate_cstates); + + { + int i; + + for (i=0; i<30; i++) + { + char filename[512]; + + sprintf(filename, i>0?"SSDT-%d.aml":"SSDT.aml", i); + + if ( (new_ssdt[ssdt_count] = loadACPITable(filename)) ) + { + ssdt_count++; + } + else + { + break; + } + } + } + + // Do the same procedure for both versions of ACPI + for (version=0; version<2; version++) { + struct acpi_2_rsdp *rsdp, *rsdp_mod; + struct acpi_2_rsdt *rsdt, *rsdt_mod; + int rsdplength; + + // Find original rsdp + rsdp=(struct acpi_2_rsdp *)(version?getAddressOfAcpi20Table():getAddressOfAcpiTable()); + if (!rsdp) + { + DBG("No ACPI version %d found. Ignoring\n", version+1); + if (version) + addConfigurationTable(&gEfiAcpi20TableGuid, NULL, "ACPI_20"); + else + addConfigurationTable(&gEfiAcpiTableGuid, NULL, "ACPI"); + continue; + } + rsdplength=version?rsdp->Length:20; + + DBG("RSDP version %d found @%x. Length=%d\n",version+1,rsdp,rsdplength); + + /* FIXME: no check that memory allocation succeeded + * Copy and patch RSDP,RSDT, XSDT and FADT + * For more info see ACPI Specification pages 110 and following + */ + + rsdp_mod=(struct acpi_2_rsdp *) AllocateKernelMemory(rsdplength); + memcpy(rsdp_mod, rsdp, rsdplength); + rsdt=(struct acpi_2_rsdt *)(rsdp->RsdtAddress); + + DBG("RSDT @%x, Length %d\n",rsdt, rsdt->Length); + + if (rsdt && (uint32_t)rsdt !=0xffffffff && rsdt->Length<0x10000) + { + uint32_t *rsdt_entries; + int rsdt_entries_num; + int dropoffset=0, i; + + // mozo: using malloc cos I didn't found how to free already allocated kernel memory + rsdt_mod=(struct acpi_2_rsdt *)malloc(rsdt->Length); + memcpy (rsdt_mod, rsdt, rsdt->Length); + rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; + rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; + rsdt_entries=(uint32_t *)(rsdt_mod+1); + for (i=0;i<rsdt_entries_num;i++) + { + char *table=(char *)(rsdt_entries[i]); + if (!table) + continue; + + DBG("TABLE %c%c%c%c,",table[0],table[1],table[2],table[3]); + + rsdt_entries[i-dropoffset]=rsdt_entries[i]; + + if (drop_ssdt && tableSign(table, "SSDT")) + { + dropoffset++; + continue; + } + if (tableSign(table, "DSDT")) + { + DBG("DSDT found\n"); + + if(new_dsdt) + rsdt_entries[i-dropoffset]=(uint32_t)new_dsdt; + + continue; + } + if (tableSign(table, "FACP")) + { + struct acpi_2_fadt *fadt, *fadt_mod; + fadt=(struct acpi_2_fadt *)rsdt_entries[i]; + + DBG("FADT found @%x, Length %d\n",fadt, fadt->Length); + + if (!fadt || (uint32_t)fadt == 0xffffffff || fadt->Length>0x10000) + { + printf("FADT incorrect. Not modified\n"); + continue; + } + + fadt_mod = patch_fadt(fadt, new_dsdt); + rsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; + + // Generate _CST SSDT + if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) + { + DBG("C-states generated\n"); + generate_cstates = false; // Generate SSDT only once! + ssdt_count++; + } + + // Generating _PSS SSDT + if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) + { + DBG("P-states generated\n"); + generate_pstates = false; // Generate SSDT only once! + ssdt_count++; + } + + continue; + } + } + DBG("\n"); + + // Allocate rsdt in Kernel memory area + rsdt_mod->Length += 4*ssdt_count - 4*dropoffset; + struct acpi_2_rsdt *rsdt_copy = (struct acpi_2_rsdt *)AllocateKernelMemory(rsdt_mod->Length); + memcpy (rsdt_copy, rsdt_mod, rsdt_mod->Length); + free(rsdt_mod); rsdt_mod = rsdt_copy; + rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; + rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; + rsdt_entries=(uint32_t *)(rsdt_mod+1); + + // Mozodojo: Insert additional SSDTs into RSDT + if(ssdt_count>0) + { + int j; + + for (j=0; j<ssdt_count; j++) + rsdt_entries[i-dropoffset+j]=(uint32_t)new_ssdt[j]; + + verbose("RSDT: Added %d SSDT table(s)\n", ssdt_count); + } + + // Correct the checksum of RSDT + DBG("RSDT: Original checksum %d, ", rsdt_mod->Checksum); + + rsdt_mod->Checksum=0; + rsdt_mod->Checksum=256-checksum8(rsdt_mod,rsdt_mod->Length); + + DBG("New checksum %d at %x\n", rsdt_mod->Checksum,rsdt_mod); + } + else + { + rsdp_mod->RsdtAddress=0; + printf("RSDT not found or RSDT incorrect\n"); + } + + if (version) + { + struct acpi_2_xsdt *xsdt, *xsdt_mod; + + // FIXME: handle 64-bit address correctly + + xsdt=(struct acpi_2_xsdt*) ((uint32_t)rsdp->XsdtAddress); + DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, + xsdt->Length); + if (xsdt && (uint64_t)rsdp->XsdtAddress<0xffffffff && xsdt->Length<0x10000) + { + uint64_t *xsdt_entries; + int xsdt_entries_num, i; + int dropoffset=0; + + // mozo: using malloc cos I didn't found how to free already allocated kernel memory + xsdt_mod=(struct acpi_2_xsdt*)malloc(xsdt->Length); + memcpy(xsdt_mod, xsdt, xsdt->Length); + rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; + xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; + xsdt_entries=(uint64_t *)(xsdt_mod+1); + for (i=0;i<xsdt_entries_num;i++) + { + char *table=(char *)((uint32_t)(xsdt_entries[i])); + if (!table) + continue; + + xsdt_entries[i-dropoffset]=xsdt_entries[i]; + + if (drop_ssdt && tableSign(table, "SSDT")) + { + dropoffset++; + continue; + } + if (tableSign(table, "DSDT")) + { + DBG("DSDT found\n"); + + if (new_dsdt) + xsdt_entries[i-dropoffset]=(uint32_t)new_dsdt; + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + continue; + } + if (tableSign(table, "FACP")) + { + struct acpi_2_fadt *fadt, *fadt_mod; + fadt=(struct acpi_2_fadt *)(uint32_t)xsdt_entries[i]; + + DBG("FADT found @%x,%x, Length %d\n",(uint32_t)(xsdt_entries[i]>>32),fadt, + fadt->Length); + + if (!fadt || (uint64_t)xsdt_entries[i] >= 0xffffffff || fadt->Length>0x10000) + { + verbose("FADT incorrect or after 4GB. Dropping XSDT\n"); + goto drop_xsdt; + } + + fadt_mod = patch_fadt(fadt, new_dsdt); + xsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + // Generate _CST SSDT + if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) + { + generate_cstates = false; // Generate SSDT only once! + ssdt_count++; + } + + // Generating _PSS SSDT + if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) + { + generate_pstates = false; // Generate SSDT only once! + ssdt_count++; + } + + continue; + } + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + } + + // Allocate xsdt in Kernel memory area + xsdt_mod->Length += 8*ssdt_count - 8*dropoffset; + struct acpi_2_xsdt *xsdt_copy = (struct acpi_2_xsdt *)AllocateKernelMemory(xsdt_mod->Length); + memcpy(xsdt_copy, xsdt_mod, xsdt_mod->Length); + free(xsdt_mod); xsdt_mod = xsdt_copy; + rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; + xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; + xsdt_entries=(uint64_t *)(xsdt_mod+1); + + // Mozodojo: Insert additional SSDTs into XSDT + if(ssdt_count>0) + { + int j; + + for (j=0; j<ssdt_count; j++) + xsdt_entries[i-dropoffset+j]=(uint32_t)new_ssdt[j]; + + verbose("Added %d SSDT table(s) into XSDT\n", ssdt_count); + } + + // Correct the checksum of XSDT + xsdt_mod->Checksum=0; + xsdt_mod->Checksum=256-checksum8(xsdt_mod,xsdt_mod->Length); + } + else + { + drop_xsdt: + + DBG("About to drop XSDT\n"); + + /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT. + * A Better strategy would be to generate + */ + + rsdp_mod->XsdtAddress=0xffffffffffffffffLL; + verbose("XSDT not found or XSDT incorrect\n"); + } + } + + // Correct the checksum of RSDP + + DBG("RSDP: Original checksum %d, ", rsdp_mod->Checksum); + + rsdp_mod->Checksum=0; + rsdp_mod->Checksum=256-checksum8(rsdp_mod,20); + + DBG("New checksum %d\n", rsdp_mod->Checksum); + + if (version) + { + DBG("RSDP: Original extended checksum %d", rsdp_mod->ExtendedChecksum); + + rsdp_mod->ExtendedChecksum=0; + rsdp_mod->ExtendedChecksum=256-checksum8(rsdp_mod,rsdp_mod->Length); + + DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + } + + //verbose("Patched ACPI version %d DSDT\n", version+1); + if (version) + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi20_p = (uint32_t)rsdp_mod; + addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); + } + else + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi10_p = (uint32_t)rsdp_mod; + addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); + } + } +#if DEBUG_ACPI + printf("Press a key to continue... (DEBUG_ACPI)\n"); + getchar(); +#endif + return 1; +} diff --git a/i386/libsaio/.svn/text-base/acpi_patcher.h.svn-base b/i386/libsaio/.svn/text-base/acpi_patcher.h.svn-base new file mode 100644 index 0000000..4f5a35d --- /dev/null +++ b/i386/libsaio/.svn/text-base/acpi_patcher.h.svn-base @@ -0,0 +1,37 @@ +/* + * Copyright 2008 mackerintel + */ + +#ifndef __LIBSAIO_ACPI_PATCHER_H +#define __LIBSAIO_ACPI_PATCHER_H + +#include "libsaio.h" + +uint64_t acpi10_p; +uint64_t acpi20_p; +uint64_t smbios_p; + +extern int setupAcpi(); + +extern EFI_STATUS addConfigurationTable(); + +extern EFI_GUID gEfiAcpiTableGuid; +extern EFI_GUID gEfiAcpi20TableGuid; + +struct p_state +{ + union + { + uint16_t Control; + struct + { + uint8_t VID; // Voltage ID + uint8_t FID; // Frequency ID + }; + }; + + uint8_t CID; // Compare ID + uint32_t Frequency; +}; + +#endif /* !__LIBSAIO_ACPI_PATCHER_H */ diff --git a/i386/libsaio/.svn/text-base/allocate.c.svn-base b/i386/libsaio/.svn/text-base/allocate.c.svn-base new file mode 100644 index 0000000..717e05b --- /dev/null +++ b/i386/libsaio/.svn/text-base/allocate.c.svn-base @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "sl.h" +#include "saio_internal.h" +#include "bootstruct.h" +#include "device_tree.h" + +static long gImageLastKernelAddr; + +#define kPageSize 4096 +#define RoundPage(x) ((((unsigned)(x)) + kPageSize - 1) & ~(kPageSize - 1)) + + +long +AllocateMemoryRange(char * rangeName, long start, long length, long type) +{ + char *nameBuf; + uint32_t *buffer; + + nameBuf = malloc(strlen(rangeName) + 1); + if (nameBuf == 0) return -1; + strcpy(nameBuf, rangeName); + + buffer = malloc(2 * sizeof(uint32_t)); + if (buffer == 0) return -1; + + buffer[0] = start; + buffer[1] = length; + + DT__AddProperty(gMemoryMapNode, nameBuf, 2 * sizeof(uint32_t), (char *)buffer); + + return 0; +} + +long +AllocateKernelMemory( long inSize ) +{ + long addr; + + if (gImageLastKernelAddr == 0) { + gImageLastKernelAddr = RoundPage( bootArgs->kaddr + + bootArgs->ksize ); + } + addr = gImageLastKernelAddr; + gImageLastKernelAddr += RoundPage(inSize); + + if ( gImageLastKernelAddr >= (KERNEL_ADDR + KERNEL_LEN) ) { + stop ("AllocateKernelMemory error"); + } + + bootArgs->ksize = gImageLastKernelAddr - bootArgs->kaddr; + + return addr; +} diff --git a/i386/libsaio/.svn/text-base/aml_generator.c.svn-base b/i386/libsaio/.svn/text-base/aml_generator.c.svn-base new file mode 100644 index 0000000..6d24451 --- /dev/null +++ b/i386/libsaio/.svn/text-base/aml_generator.c.svn-base @@ -0,0 +1,498 @@ +/* + * aml_generator.c + * Chameleon + * + * Created by Mozodojo on 20/07/10. + * Copyright 2010 mozo. All rights reserved. + * + */ + +#include "aml_generator.h" + +bool aml_add_to_parent(struct aml_chunk* parent, struct aml_chunk* node) +{ + if (parent && node) + { + switch (parent->Type) + { + case AML_CHUNK_NONE: + case AML_CHUNK_BYTE: + case AML_CHUNK_WORD: + case AML_CHUNK_DWORD: + case AML_CHUNK_QWORD: + case AML_CHUNK_ALIAS: + verbose("aml_add_to_parent: node doesn't support child nodes!\n"); + return false; + case AML_CHUNK_NAME: + if (parent->First) + { + verbose("aml_add_to_parent: name node supports only one child node!\n"); + return false; + } + break; + + default: + break; + } + + if (!parent->First) + parent->First = node; + + if (parent->Last) + parent->Last->Next = node; + + parent->Last = node; + + return true; + } + + return false; +} + +struct aml_chunk* aml_create_node(struct aml_chunk* parent) +{ + struct aml_chunk* node = (struct aml_chunk*)malloc(sizeof(struct aml_chunk)); + + aml_add_to_parent(parent, node); + + return node; +} + +void aml_destroy_node(struct aml_chunk* node) +{ + // Delete child nodes + struct aml_chunk* child = node->First; + + while (child) + { + struct aml_chunk* next = child->Next; + + if (child->Buffer) + free(child->Buffer); + + free(child); + + child = next; + } + + // Free node + if (node->Buffer) + free(node->Buffer); + + free(node); +} + +struct aml_chunk* aml_add_buffer(struct aml_chunk* parent, const char* buffer, unsigned int size) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_NONE; + node->Length = size; + node->Buffer = malloc(node->Length); + memcpy(node->Buffer, buffer, node->Length); + } + + return node; +} + +struct aml_chunk* aml_add_byte(struct aml_chunk* parent, unsigned char value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_BYTE; + + node->Length = 1; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value; + } + + return node; +} + +struct aml_chunk* aml_add_word(struct aml_chunk* parent, unsigned int value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_WORD; + node->Length = 2; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = value >> 8; + } + + return node; +} + +struct aml_chunk* aml_add_dword(struct aml_chunk* parent, unsigned long value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_DWORD; + node->Length = 4; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = (value >> 8) & 0xff; + node->Buffer[2] = (value >> 16) & 0xff; + node->Buffer[3] = (value >> 24) & 0xff; + } + + return node; +} + +struct aml_chunk* aml_add_qword(struct aml_chunk* parent, unsigned long long value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_QWORD; + node->Length = 8; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = (value >> 8) & 0xff; + node->Buffer[2] = (value >> 16) & 0xff; + node->Buffer[3] = (value >> 24) & 0xff; + node->Buffer[4] = (value >> 32) & 0xff; + node->Buffer[5] = (value >> 40) & 0xff; + node->Buffer[6] = (value >> 48) & 0xff; + node->Buffer[7] = (value >> 56) & 0xff; + } + + return node; +} + +unsigned int aml_fill_simple_name(char* buffer, const char* name) +{ + if (strlen(name) < 4) + { + verbose("aml_fill_simple_name: simple name %s has incorrect lengh! Must be 4.\n", name); + return 0; + } + + memcpy(buffer, name, 4); + return 4; +} + +unsigned int aml_fill_name(struct aml_chunk* node, const char* name) +{ + if (!node) + return 0; + + int len = strlen(name), offset = 0, count = len / 4; + + if ((len % 4) > 1 || count == 0) + { + verbose("aml_fill_name: pathname %s has incorrect length! Must be 4, 8, 12, 16, etc...\n", name); + return 0; + } + + unsigned int root = 0; + + if ((len % 4) == 1 && name[0] == '\\') + root++; + + if (count == 1) + { + node->Length = 4 + root; + node->Buffer = malloc(node->Length); + memcpy(node->Buffer, name, 4 + root); + return node->Length; + } + + if (count == 2) + { + node->Length = 2 + 8; + node->Buffer = malloc(node->Length); + node->Buffer[offset++] = 0x5c; // Root Char + node->Buffer[offset++] = 0x2e; // Double name + memcpy(node->Buffer+offset, name + root, 8); + return node->Length; + } + + node->Length = 3 + count*4; + node->Buffer = malloc(node->Length); + node->Buffer[offset++] = 0x5c; // Root Char + node->Buffer[offset++] = 0x2f; // Multi name + node->Buffer[offset++] = count; // Names count + memcpy(node->Buffer+offset, name + root, count*4); + + return node->Length; +} + +struct aml_chunk* aml_add_scope(struct aml_chunk* parent, const char* name) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_SCOPE; + + aml_fill_name(node, name); + } + + return node; +} + +struct aml_chunk* aml_add_name(struct aml_chunk* parent, const char* name) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_NAME; + + aml_fill_name(node, name); + } + + return node; +} + +struct aml_chunk* aml_add_package(struct aml_chunk* parent) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_PACKAGE; + + node->Length = 1; + node->Buffer = malloc(node->Length); + } + + return node; +} + +struct aml_chunk* aml_add_alias(struct aml_chunk* parent, const char* name1, const char* name2) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_ALIAS; + + node->Length = 8; + node->Buffer = malloc(node->Length); + aml_fill_simple_name(node->Buffer, name1); + aml_fill_simple_name(node->Buffer+4, name2); + } + + return node; +} + +unsigned char aml_get_size_length(unsigned int size) +{ + if (size + 1 <= 0x3f) + return 1; + else if (size + 2 <= 0x3fff) + return 2; + else if (size + 3 <= 0x3fffff) + return 3; + + return 4; +} + +unsigned int aml_calculate_size(struct aml_chunk* node) +{ + if (node) + { + node->Size = 0; + + // Calculate child nodes size + struct aml_chunk* child = node->First; + unsigned char child_count = 0; + + while (child) + { + child_count++; + + node->Size += aml_calculate_size(child); + + child = child->Next; + } + + switch (node->Type) + { + case AML_CHUNK_NONE: + node->Size += node->Length; + break; + case AML_CHUNK_SCOPE: + node->Size += 1 + node->Length; + node->Size += aml_get_size_length(node->Size); + break; + case AML_CHUNK_PACKAGE: + node->Buffer[0] = child_count; + node->Size += 1 + node->Length; + node->Size += aml_get_size_length(node->Size); + break; + + case AML_CHUNK_BYTE: + if (node->Buffer[0] == 0x0 || node->Buffer[0] == 0x1) + { + node->Size += node->Length; + } + else + { + node->Size += 1 + node->Length; + } + + break; + + case AML_CHUNK_WORD: + case AML_CHUNK_DWORD: + case AML_CHUNK_QWORD: + case AML_CHUNK_ALIAS: + case AML_CHUNK_NAME: + node->Size += 1 + node->Length; + break; + } + + return node->Size; + } + + return 0; +} + +unsigned int aml_write_byte(unsigned char value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value; + + return offset; +} + +unsigned int aml_write_word(unsigned int value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value & 0xff; + buffer[offset++] = value >> 8; + + return offset; +} + +unsigned int aml_write_dword(unsigned long value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value & 0xff; + buffer[offset++] = (value >> 8) & 0xff; + buffer[offset++] = (value >> 16) & 0xff; + buffer[offset++] = (value >> 24) & 0xff; + + return offset; +} + +unsigned int aml_write_qword(unsigned long long value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value & 0xff; + buffer[offset++] = (value >> 8) & 0xff; + buffer[offset++] = (value >> 16) & 0xff; + buffer[offset++] = (value >> 24) & 0xff; + buffer[offset++] = (value >> 32) & 0xff; + buffer[offset++] = (value >> 40) & 0xff; + buffer[offset++] = (value >> 48) & 0xff; + buffer[offset++] = (value >> 56) & 0xff; + + return offset; +} + +unsigned int aml_write_buffer(const char* value, unsigned int size, char* buffer, unsigned int offset) +{ + if (size > 0) + { + memcpy(buffer + offset, value, size); + } + + return offset + size; +} + +unsigned int aml_write_size(unsigned int size, char* buffer, unsigned int offset) +{ + if (size <= 0x3f) + { + buffer[offset++] = size; + } + else if (size <= 0x3fff) + { + buffer[offset++] = 0x40 | (size & 0xf); + buffer[offset++] = (size >> 4) & 0xff; + } + else if (size <= 0x3fffff) + { + buffer[offset++] = 0x80 | (size & 0xf); + buffer[offset++] = (size >> 4) & 0xff; + buffer[offset++] = (size >> 12) & 0xff; + } + else + { + buffer[offset++] = 0xc0 | (size & 0xf); + buffer[offset++] = (size >> 4) & 0xff; + buffer[offset++] = (size >> 12) & 0xff; + buffer[offset++] = (size >> 20) & 0xff; + } + + return offset; +} + +unsigned int aml_write_node(struct aml_chunk* node, char* buffer, unsigned int offset) +{ + if (node && buffer) + { + unsigned int old = offset; + + switch (node->Type) + { + case AML_CHUNK_NONE: + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + break; + + case AML_CHUNK_SCOPE: + case AML_CHUNK_PACKAGE: + offset = aml_write_byte(node->Type, buffer, offset); + offset = aml_write_size(node->Size-1, buffer, offset); + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + break; + + case AML_CHUNK_BYTE: + if (node->Buffer[0] == 0x0 || node->Buffer[0] == 0x1) + { + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + } + else + { + offset = aml_write_byte(node->Type, buffer, offset); + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + } + break; + + case AML_CHUNK_WORD: + case AML_CHUNK_DWORD: + case AML_CHUNK_QWORD: + case AML_CHUNK_ALIAS: + case AML_CHUNK_NAME: + offset = aml_write_byte(node->Type, buffer, offset); + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + break; + + default: + break; + } + + struct aml_chunk* child = node->First; + + while (child) + { + offset = aml_write_node(child, buffer, offset); + + child = child->Next; + } + + if (offset - old != node->Size) + verbose("Node size incorrect: 0x%x\n", node->Type); + } + + return offset; +} diff --git a/i386/libsaio/.svn/text-base/aml_generator.h.svn-base b/i386/libsaio/.svn/text-base/aml_generator.h.svn-base new file mode 100644 index 0000000..70d3c77 --- /dev/null +++ b/i386/libsaio/.svn/text-base/aml_generator.h.svn-base @@ -0,0 +1,61 @@ +/* + * aml_generator.h + * Chameleon + * + * Created by Mozodojo on 20/07/10. + * Copyright 2010 mozo. All rights reserved. + * + */ + +#ifndef __LIBSAIO_AML_GENERATOR_H +#define __LIBSAIO_AML_GENERATOR_H + +#include "libsaio.h" + +#define AML_CHUNK_NONE 0xff +#define AML_CHUNK_ZERO 0x00 +#define AML_CHUNK_ONE 0x01 +#define AML_CHUNK_ALIAS 0x06 +#define AML_CHUNK_NAME 0x08 +#define AML_CHUNK_BYTE 0x0A +#define AML_CHUNK_WORD 0x0B +#define AML_CHUNK_DWORD 0x0C +#define AML_CHUNK_STRING 0x0D +#define AML_CHUNK_QWORD 0x0E +#define AML_CHUNK_SCOPE 0x10 +#define AML_CHUNK_PACKAGE 0x12 + +struct aml_chunk +{ + unsigned char Type; + unsigned int Length; + char* Buffer; + + unsigned int Size; + + struct aml_chunk* Next; + struct aml_chunk* First; + struct aml_chunk* Last; +}; + +static inline bool aml_isvalidchar(char c) +{ + return isupper(c) || isdigit(c) || c == '_'; +}; + +bool aml_add_to_parent(struct aml_chunk* parent, struct aml_chunk* node); +struct aml_chunk* aml_create_node(struct aml_chunk* parent); +void aml_destroy_node(struct aml_chunk* node); +struct aml_chunk* aml_add_buffer(struct aml_chunk* parent, const char* buffer, unsigned int size); +struct aml_chunk* aml_add_byte(struct aml_chunk* parent, unsigned char value); +struct aml_chunk* aml_add_word(struct aml_chunk* parent, unsigned int value); +struct aml_chunk* aml_add_dword(struct aml_chunk* parent, unsigned long value); +struct aml_chunk* aml_add_qword(struct aml_chunk* parent, unsigned long long value); +struct aml_chunk* aml_add_scope(struct aml_chunk* parent, const char* name); +struct aml_chunk* aml_add_name(struct aml_chunk* parent, const char* name); +struct aml_chunk* aml_add_package(struct aml_chunk* parent); +struct aml_chunk* aml_add_alias(struct aml_chunk* parent, const char* name1, const char* name2); +unsigned int aml_calculate_size(struct aml_chunk* node); +unsigned int aml_write_node(struct aml_chunk* node, char* buffer, unsigned int offset); + +#endif /* !__LIBSAIO_AML_GENERATOR_H */ \ No newline at end of file diff --git a/i386/libsaio/.svn/text-base/asm.s.svn-base b/i386/libsaio/.svn/text-base/asm.s.svn-base new file mode 100644 index 0000000..21ce6a4 --- /dev/null +++ b/i386/libsaio/.svn/text-base/asm.s.svn-base @@ -0,0 +1,497 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ +/* + * HISTORY + * $Log: asm.s,v $ + * Revision 1.8 2005/06/24 22:47:12 curtisg + * Merging changes for 4159531 to pass data to the kernel in EFI format. + * + * Revision 1.7 2004/05/13 17:58:38 curtisg + * Integrating: + * <rdar://problem/3094680>: (Silent boot) + * <rdar://problem/3363893>: (5 sec boot timeout is too short) + * <rdar://problem/3533781>: (Boot option to display graphics modes) + * <rdar://problem/3545539>: (Default graphics mode should be 32-bit) + * <rdar://problem/3643065>: (Booter should always find a video mode) + * <rdar://problem/3643815>: (Booter displays "0MB" VRAM) + * + * Revision 1.6 2003/11/05 20:51:02 curtisg + * Integrated 3069695,3331770,3370488,3371823 + * + * Revision 1.5.26.1 2003/10/27 23:57:59 curtisg + * Added printing of volume names, better handling of extended + * partitions, and updated Apple license strings. + * New chain booter should work better with foreign operating + * systems. + * + * Revision 1.5 2002/11/05 20:34:26 jliu + * Integrating: + * 3051234 boot shouldnt require Graphics = Yes + * 3091627 Need support for refresh rate adjustment + * + * Revision 1.4 2002/10/02 00:06:18 curtisg + * Integrating PR-3032510. + * + * Revision 1.3.6.1 2002/08/30 21:16:29 curtisg + * KERNBOOTSTRUCT is going away in favor of KernelBootArgs_t in <pexpert/i386/boot.h>. + * + * Revision 1.3 2002/07/09 14:06:21 jliu + * Merging changes from PR-2954224 branch in boot/i386. + * + * Revision 1.2.30.1 2002/07/05 16:24:51 jliu + * Merged UFS/HFS/HFS+ filesystem support from BootX. + * Moved boot2 load address due to increased size. boot0/boot1 also changed. + * Updated boot graphics and CLUT. + * Added support to chain load foreign booters. + * Fixed param passing bug in network loader. + * Misc cleanup in libsaio. + * + * Revision 1.2 2000/05/23 23:01:11 lindak + * Merged PR-2309530 into Kodiak (liu i386 booter: does not support label-less + * ufs partitions) + * + * Revision 1.1.1.2.4.1 2000/05/13 17:07:39 jliu + * New boot0 (boot1 has been deprecated). Booter must now reside in its own partition, no disk label required. + * + * Revision 1.1.1.2 1999/08/04 21:16:57 wsanchez + * Impoort of boot-66 + * + * Revision 1.3 1999/08/04 21:12:12 wsanchez + * Update APSL + * + * Revision 1.2 1999/03/25 05:48:30 wsanchez + * Add APL. + * Remove unused gzip code. + * Remove unused Adobe fonts. + * + * Revision 1.1.1.1.66.2 1999/03/16 16:08:54 wsanchez + * Substitute License + * + * Revision 1.1.1.1.66.1 1999/03/16 07:33:21 wsanchez + * Add APL + * + * Revision 1.1.1.1 1997/12/05 21:57:57 wsanchez + * Import of boot-25 (~mwatson) + * + * Revision 2.1.1.2 90//03//22 17:59:50 rvb + * Added _sp() => where is the stack at. [kupfer] + * + * Revision 2.1.1.1 90//02//09 17:25:04 rvb + * Add Intel copyright + * [90//02//09 rvb] + * + */ + + +// INTEL CORPORATION PROPRIETARY INFORMATION +// +// This software is supplied under the terms of a license agreement or +// nondisclosure agreement with Intel Corporation and may not be copied +// nor disclosed except in accordance with the terms of that agreement. +// +// Copyright 1988 Intel Corporation +// Copyright 1988, 1989 by Intel Corporation +// + +#include <architecture/i386/asm_help.h> +#include "memory.h" + +#define data32 .byte 0x66 +#define addr32 .byte 0x67 + + .file "asm.s" + +CR0_PE_ON = 0x1 +#ifdef BOOT1 +CR0_PE_OFF = 0x7ffffffe +#else +CR0_PE_OFF = 0x7ffffff0 +#endif + +STACK32_BASE = ADDR32(STACK_SEG, 0) +STACK16_SEG = STACK_SEG +CODE32_BASE = ADDR32(BASE_SEG, 0) +CODE16_SEG = BASE_SEG + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Pointer to 6-bytes in memory that contains the base address and the limit +// (size of GDT table in bytes) of the GDT. The LGDT is the only instruction +// that directly loads a linear address (not a segment relative address) and +// a limit in protected mode. + +.globl _Gdtr + //.data + .section __INIT,__data // turbo - Data that must be in the first segment + .align 2, 0x90 +_Gdtr: + .word GDTLIMIT + .long vtop(_Gdt) + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// IDTR representing real-mode IVT. The values are constant. + //.const + .section __INIT,__data // turbo - Data that must be in the first segment +// Real mode IDT + .align 2 +.globl _Idtr_real +_Idtr_real: + .word 0x03ff + .long 0x00000000 + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// IDTR representing protected-mode IDT. It is initially NULL which tells the +// procesor that no IDT is available. After we get into protected mode we can +// allocate memory for a proper IDT and update this IDTR to point to it. + //.data + .section __INIT,__data // turbo - Data that must be in the first segment + .align 2 +.globl _Idtr_prot +_Idtr_prot: + .word 0 + .long 0 + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Data area for __switch_stack. +// +save_sp: .long STACK_OFS +save_ss: .long STACK_SEG + + //.text + .section __INIT,__text // turbo - This code must reside within the first segment +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// real_to_prot() +// +// Transfer from real mode to protected mode. +// Preserves all registers except EAX. +// +LABEL(__real_to_prot) + + // Interrupts are disabled in protected mode. + + cli + + // Load the Global Descriptor Table Register (GDTR). + + addr32 + data32 + lgdt OFFSET16(_Gdtr) + + // Enter protected mode by setting the PE bit in CR0. + + mov %cr0, %eax + data32 + or $CR0_PE_ON, %eax + mov %eax, %cr0 + + // Make intrasegment jump to flush the processor pipeline and + // reload CS register. + + data32 + ljmp $0x08, $xprot + +xprot: + // we are in USE32 mode now + // set up the protected mode segment registers : DS, SS, ES, FS, GS + + mov $0x10, %eax + movw %ax, %ds + movw %ax, %ss + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + + // set up the PM IDT + lidt _Idtr_prot + + // Convert STACK_SEG:SP to 32-bit linear stack pointer. + + movzwl %sp, %eax + addl $STACK32_BASE, %eax + movl %eax, %esp + + // Convert STACK_SEG:BP to 32-bit linear base pointer. + + movzwl %bp, %eax + addl $STACK32_BASE, %eax + movl %eax, %ebp + + // Modify the caller's return address on the stack from + // segment offset to linear address. + + popl %eax + addl $CODE32_BASE, %eax + pushl %eax + + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// prot_to_real() +// +// Transfer from protected mode to real mode. +// Preserves all registers except EAX. +// +LABEL(__prot_to_real) + + // Load real-mode IDT while we're still in USE32 mode so we don't need + // 32-bit addressing prefixes. + lidt _Idtr_real + + // Set up segment registers appropriate for real mode. + + movw $0x30, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movw %ax, %ss + + ljmp $0x18, $x16 // change to USE16 mode + +x16: + mov %cr0, %eax // clear the PE bit of CR0 + data32 + and $CR0_PE_OFF, %eax + mov %eax, %cr0 + + // make intersegment jmp to flush the processor pipeline + // and reload CS register + + data32 + ljmp $CODE16_SEG, $xreal - CODE32_BASE + +xreal: + // we are in real mode now + // set up the real mode segment registers : DS, DS, ES, FS, GS + + movw %cs, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + + // load stack segment register SS. + + data32 + movl $STACK16_SEG, %eax + movw %ax, %ss + + // clear top 16-bits of ESP and EBP. + + data32 + movzwl %sp, %esp + data32 + movzwl %bp, %ebp + + // Modify caller's return address on the stack + // from linear address to segment offset. + + data32 + popl %eax + data32 + movzwl %ax, %eax + data32 + pushl %eax + + // Reenable maskable interrupts. + + sti + + data32 + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// halt() +// +LABEL(_halt) +#ifdef BOOT1 + hlt +#else + call _bgetc +#endif + jmp _halt + +#ifndef BOOT1 +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// startprog(phyaddr, arg) +// Start the program on protected mode where phyaddr is the entry point. +// Passes arg to the program in %eax. +// +LABEL(_startprog) + push %ebp + mov %esp, %ebp + + mov 0xc(%ebp), %eax // argument to program + mov 0x8(%ebp), %ecx // entry offset + mov $0x28, %ebx // segment + push %ebx + push %ecx + + // set up %ds and %es + + mov $0x20, %ebx + movw %bx, %ds + movw %bx, %es + + lret +#endif + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Returns the current stack pointer. +// +LABEL(__sp) + mov %esp, %eax + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Returns the current frame pointer. +// +LABEL(__bp) + mov %ebp, %eax + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// switch_stack() +// +// Switches stack pointer between SS:SP and memory save_ss:save_sp. +// Call this function from real mode only!!! +// +// AX, DI, and SI are clobbered. +// +LABEL(__switch_stack) + popl %eax # save return address + popl %edi # discard upper 16-bit + + data32 + addr32 + movl OFFSET16(save_ss), %esi # new SS to SI + + data32 + addr32 + movl OFFSET16(save_sp), %edi # new SP to DI + + addr32 + mov %ss, OFFSET16(save_ss) # save current SS to memory + + data32 + addr32 + movl %esp, OFFSET16(save_sp) # save current SP to memory + + cli + mov %si, %ss # switch stack + mov %di, %sp + sti + + pushl %eax # push IP of caller onto the new stack + + xorl %eax, %eax + xorl %esi, %esi + xorl %edi, %edi + + ret + +#ifndef BOOT1 +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// loader() +// +// Issue a request to the network loader. +// +LABEL(_loader) + enter $0, $0 + pushal + + # + # Pass a far pointer to the command structure + # to the INT call through DX:CX. + # + # The command code is in BX. + # + + movw 8(%ebp), %bx # 8[EBP] = command code + movw 12(%ebp), %cx # 12[EBP] = command structure offset + movw 14(%ebp), %dx # 14[EBP] = command structure segment + + call __prot_to_real # Revert to real mode + + ###### Real Mode Begin ###### + + data32 + call __switch_stack # Switch to NBP stack + + int $0x2b # Call NBP + + data32 + call __switch_stack # Restore stack + + data32 + call __real_to_prot # Back to protected mode + + ###### Real Mode End ###### + + popal + leave + ret +#endif + +#if UNUSED +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// pcpy(src, dst, cnt) +// where src is a virtual address and dst is a physical address +// +LABEL(_pcpy) + push %ebp + mov %esp, %ebp + push %es + push %esi + push %edi + push %ecx + + cld + + // set %es to point at the flat segment + + mov $0x20, %eax + movw %ax , %es + + mov 0x8(%ebp), %esi // source + mov 0xc(%ebp), %edi // destination + mov 0x10(%ebp), %ecx // count + + rep + movsb + + pop %ecx + pop %edi + pop %esi + pop %es + pop %ebp + + ret +#endif diff --git a/i386/libsaio/.svn/text-base/ati.c.svn-base b/i386/libsaio/.svn/text-base/ati.c.svn-base new file mode 100644 index 0000000..e6587f2 --- /dev/null +++ b/i386/libsaio/.svn/text-base/ati.c.svn-base @@ -0,0 +1,2322 @@ +/* + * ATI Graphics Card Enabler, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include "ati.h" + + +static const char *chip_family_name[] = { + "UNKNOW", + "R420", + "RV410", + "RV515", + "R520", + "RV530", + "RV560", + "RV570", + "R580", + /* IGP */ + "RS600", + "RS690", + "RS740", + "RS780", + "RS880", + /* R600 */ + "R600", + "RV610", + "RV620", + "RV630", + "RV635", + "RV670", + /* R700 */ + "RV710", + "RV730", + "RV740", + "RV772", + "RV770", + "RV790", + /* Evergreen */ + "Cedar", + "Cypress", + "Hemlock", + "Juniper", + "Redwood", + "Broadway", + // "Madison", + // "Park", + /* Northern Islands */ + // "Antilles", + "Barts", + "Caicos", + "Cayman", + "Turks", + /* Southern Islands */ + "Tahiti", + "Pitcairn", + // "CapeVerde", + // "Thames", + // "Lombok", + // "NewZealand", + "" +}; + +static card_config_t card_configs[] = { + {NULL, 0}, + /* OLDController */ + {"Wormy", 2}, + {"Alopias", 2}, + {"Caretta", 1}, + {"Kakapo", 3}, + {"Kipunji", 4}, + {"Peregrine", 2}, + {"Raven", 3}, + {"Sphyrna", 1}, + /* AMD2400Controller */ + {"Iago", 2}, + /* AMD2600Controller */ + {"Hypoprion", 2}, + {"Lamna", 2}, + /* AMD3800Controller */ + {"Megalodon", 3}, + {"Triakis", 2}, + /* AMD4600Controller */ + {"Flicker", 3}, + {"Gliff", 3}, + {"Shrike", 3}, + /* AMD4800Controller */ + {"Cardinal", 2}, + {"Motmot", 2}, + {"Quail", 3}, + /* AMD5000Controller */ + {"Douc", 2}, + {"Langur", 3}, + {"Uakari", 4}, + {"Zonalis", 6}, + {"Alouatta", 4}, + {"Hoolock", 3}, + {"Vervet", 4}, + {"Baboon", 3}, + {"Eulemur", 3}, + {"Galago", 2}, + {"Colobus", 2}, + {"Mangabey", 2}, + {"Nomascus", 4}, + {"Orangutan", 2}, + /* AMD6000Controller */ + {"Pithecia", 3}, + {"Bulrushes", 6}, + {"Cattail", 4}, + {"Hydrilla", 5}, + {"Duckweed", 4}, + {"Fanwort", 4}, + {"Elodea", 5}, + {"Kudzu", 2}, + {"Gibba", 5}, + {"Lotus", 3}, + {"Ipomoea", 3}, + {"Muskgrass", 4}, + {"Juncus", 4}, + {"Osmunda", 4}, + {"Pondweed", 3}, + {"Spikerush", 4}, + {"Typha", 5}, + /* AMD7000Controller */ + {"Aji", 4}, + {"Buri", 4}, + {"Chutoro", 5}, + {"Dashimaki", 4}, + {"Ebi", 5}, + {"Gari", 5}, + {"Futomaki", 4}, + {"Hamachi", 4}, + {"OPM", 6}, + {"Ikura", 6}, + {"IkuraS", 1} +}; + +static radeon_card_info_t radeon_cards[] = { + + // Earlier cards are not supported + // + // Layout is device_id, subsys_id (subsystem id plus vendor id), chip_family_name, display name, frame buffer + // Cards are grouped by device id and vendor id then sorted by subsystem id to make it easier to add new cards + // + + { 0x9400, 0x01611043, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9400, 0x021E1043, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9400, 0x25521002, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9400, 0x30001002, CHIP_FAMILY_R600, "ATI Radeon HD 2900 PRO", kNull }, + { 0x9400, 0x31421002, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + + { 0x9440, 0x05021002, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x0851174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x114A174B, CHIP_FAMILY_RV770, "ATI Radeon HD4870 Vapor-X", kCardinal }, + { 0x9440, 0x24401682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x24411682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x24441682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x24451682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + + { 0x9441, 0x02601043, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9441, 0x02841043, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9441, 0x24401682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9441, 0x25421002, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + + { 0x9442, 0x05021002, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0x080110B0, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0x24701682, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0x24711682, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0xE104174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0xE810174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + + { 0x944A, 0x02A21028, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001043, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001458, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001462, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001545, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001682, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x3000174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001787, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x300017AF, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + + { 0x944C, 0x05021002, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + { 0x944C, 0x20031787, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + { 0x944C, 0x24801682, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + { 0x944C, 0x24811682, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + + { 0x944E, 0x30001787, CHIP_FAMILY_RV770, "ATI Radeon HD 4730", kMotmot }, + { 0x944E, 0x30101787, CHIP_FAMILY_RV770, "ATI Radeon HD 4810", kMotmot }, + { 0x944E, 0x31001787, CHIP_FAMILY_RV770, "ATI Radeon HD 4820", kMotmot }, + { 0x944E, 0x3260174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4810", kMotmot }, + { 0x944E, 0x3261174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4810", kMotmot }, + + { 0x9460, 0x27021682, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, + { 0x9460, 0xE115174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, + { 0x9460, 0xE118174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, + + { 0x9480, 0x01211025, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kGliff }, + { 0x9480, 0x03111025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x03121025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x031C1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x031D1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x036C1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x036D1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x3628103C, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kGliff }, + { 0x9480, 0x9035104D, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kGliff }, + { 0x9480, 0xFD001179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFDD01179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFD121179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFD501179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFF001179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF151179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF221179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF501179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF801179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF821179, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0xFFA01179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFFA21179, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + + { 0x9490, 0x20031787, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kFlicker }, + { 0x9490, 0x25421028, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kFlicker }, + { 0x9490, 0x30501787, CHIP_FAMILY_RV730, "ATI Radeon HD 4710", kPeregrine }, + { 0x9490, 0x300017AF, CHIP_FAMILY_RV730, "ATI Radeon HD 4710", kPeregrine }, + { 0x9490, 0x4710174B, CHIP_FAMILY_RV730, "ATI Radeon HD 4710", kPeregrine }, + + { 0x9498, 0x10001043, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kPeregrine }, + { 0x9498, 0x20091787, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x21CF1458, CHIP_FAMILY_RV730, "ATI Radeon HD 4600", kPeregrine }, + { 0x9498, 0x24511682, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x24521682, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x24541682, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x29331682, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kPeregrine }, + { 0x9498, 0x29341682, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kPeregrine }, + { 0x9498, 0x30501787, CHIP_FAMILY_RV730, "ATI Radeon HD 4700", kPeregrine }, + { 0x9498, 0x31001787, CHIP_FAMILY_RV730, "ATI Radeon HD 4720", kPeregrine }, + + { 0x94B3, 0x0D001002, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B3, 0x1170174B, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B3, 0x29001682, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + + { 0x94C1, 0x0D021002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x10021002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Pro", kNull }, + { 0x94C1, 0x0D021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x21741458, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x10331462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x10401462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x11101462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + + { 0x94C3, 0x03421002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x01011A93, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x03021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x03421002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x04021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x10321462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x10411462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x11041462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x11051462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x203817AF, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x216A1458, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x21721458, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x2247148C, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 LE", kNull }, + { 0x94C3, 0x22471787, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 LE", kNull }, + { 0x94C3, 0x30001025, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x30001458, CHIP_FAMILY_RV610, "ATI Radeon HD 3410", kNull }, + { 0x94C3, 0x30001462, CHIP_FAMILY_RV610, "ATI Radeon HD 3410", kNull }, + { 0x94C3, 0x3000148C, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x30001642, CHIP_FAMILY_RV610, "ATI Radeon HD 3410", kNull }, + { 0x94C3, 0x3000174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x30001787, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x37161642, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x94C31002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0xE370174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0xE400174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + + { 0x9501, 0x25421002, CHIP_FAMILY_RV670, "ATI Radeon HD 3870", kNull }, + { 0x9501, 0x30001002, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9501, 0x3000174B, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9501, 0x30001787, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9501, 0x4750174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + + { 0x9505, 0x024A1043, CHIP_FAMILY_RV670, "ATI Radeon HD 3850", kNull }, + { 0x9505, 0x25421002, CHIP_FAMILY_RV670, "ATI Radeon HD 3850", kNull }, + { 0x9505, 0x30001002, CHIP_FAMILY_RV630, "ATI Radeon HD 3690", kNull }, + { 0x9505, 0x3000148C, CHIP_FAMILY_RV670, "ATI Radeon HD 3850", kNull }, + { 0x9505, 0x3000174B, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9505, 0x30001787, CHIP_FAMILY_RV630, "ATI Radeon HD 3690", kNull }, + { 0x9505, 0x30011043, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0x3001148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0x3001174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x3002148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0x3003148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x3004148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x3010174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x301017AF, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x4730174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0xE630174B, CHIP_FAMILY_RV670, "ATI Radeon HD 3800 Series", kNull }, + + { 0x9540, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4590", kPeregrine }, + { 0x9540, 0x4590174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4590", kPeregrine }, + + { 0x954F, 0x16131462, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0x20081787, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kPeregrine }, + { 0x954F, 0x29201682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0x29211682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0x3000174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kPeregrine }, + { 0x954F, 0x301017AF, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kPeregrine }, + { 0x954F, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kPeregrine }, + { 0x954F, 0x30901682, CHIP_FAMILY_RV710, "XFX Radeon HD 4570", kPeregrine }, + { 0x954F, 0x31001787, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kPeregrine }, + { 0x954F, 0x4450174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kPeregrine }, + { 0x954F, 0x4570174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4570", kPeregrine }, + { 0x954F, 0x66661043, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0xE990174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kPeregrine }, + + { 0x9552, 0x04341028, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4330", kShrike }, + { 0x9552, 0x21AC1458, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x21ED1458, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x308B103C, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4330", kShrike }, + { 0x9552, 0x3000148C, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x3000174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x30001787, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x300017AF, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x44721545, CHIP_FAMILY_RV710, "VisionTek Radeon 4350", kPeregrine }, + + { 0x9553, 0x18751043, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4570", kShrike }, + { 0x9553, 0x1B321043, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4570", kShrike }, + { 0x9553, 0x215B17AA, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4530/4570", kShrike }, + { 0x9553, 0x3092174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500 Series", kPeregrine }, + { 0x9553, 0x39291642, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4570", kPeregrine }, + { 0x9553, 0xFD001179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFD121179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFD501179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFD921179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFDD01179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFF001179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF151179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF161179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFF221179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF401179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF501179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF801179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF821179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFFA01179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFFA21179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFFC01179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + + { 0x9555, 0x29241682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kNull }, + { 0x9555, 0x24651682, CHIP_FAMILY_RV710, "ATI Radeon HD4300/HD4500", kNull }, + { 0x9555, 0x3711174B, CHIP_FAMILY_RV710, "ATI Radeon HD4300/HD4500", kNull }, + + { 0x9581, 0x011F1025, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x0562107B, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x15621043, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x3000148C, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9581, 0x30C5103C, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x3C2D17AA, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x63F61462, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x95811002, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9581, 0xFF001179, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0xFF011179, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + + { 0x9583, 0x0083106B, CHIP_FAMILY_RV630, "ATI Mobility Radeon HD 2600 XT", kNull }, + { 0x9583, 0x11071734, CHIP_FAMILY_RV630, "ATI Mobility Radeon HD 2600 XT", kNull }, + { 0x9583, 0x3000148C, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9583, 0x30D4103C, CHIP_FAMILY_RV630, "ATI Mobility Radeon HD 2600 XT", kNull }, + + { 0x9588, 0x01021A93, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 XT", kNull }, + + { 0x9589, 0x01001A93, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 PRO", kNull }, + { 0x9589, 0x0E41174B, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9589, 0x30001462, CHIP_FAMILY_RV630, "ATI Radeon HD 3610", kNull }, + { 0x9589, 0x30001642, CHIP_FAMILY_RV630, "ATI Radeon HD 3610", kNull }, + { 0x9589, 0x30001787, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + + { 0x9591, 0x15453992, CHIP_FAMILY_RV635, "ATI Radeon HD 3600", kNull }, + { 0x9591, 0x2303148C, CHIP_FAMILY_RV635, "ATI Radeon HD 2600/3600 Series", kNull }, + + { 0x9598, 0xB3831002, CHIP_FAMILY_RV635, "ATI All-in-Wonder HD", kNull }, + { 0x9598, 0x30001043, CHIP_FAMILY_RV635, "ATI Radeon HD 3730", kNull }, + { 0x9598, 0x3000148C, CHIP_FAMILY_RV635, "ATI Radeon HD 3730", kNull }, + { 0x9598, 0x30001545, CHIP_FAMILY_RV635, "ATI Radeon HD 2600 XT", kNull }, + { 0x9598, 0x3000174B, CHIP_FAMILY_RV635, "ATI Radeon HD 3730", kNull }, + { 0x9598, 0x30011043, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x3001148C, CHIP_FAMILY_RV635, "ATI Radeon HD 4580", kNull }, + { 0x9598, 0x3031148C, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x30011545, CHIP_FAMILY_RV635, "ATI Radeon HD 2600 Pro", kNull }, + { 0x9598, 0x3001174B, CHIP_FAMILY_RV635, "ATI Radeon HD 3750", kNull }, + { 0x9598, 0x300117AF, CHIP_FAMILY_RV635, "ATI Radeon HD 3750", kNull }, + { 0x9598, 0x301017AF, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x301117AF, CHIP_FAMILY_RV635, "ATI Radeon HD 4580", kNull }, + { 0x9598, 0x30501787, CHIP_FAMILY_RV635, "ATI Radeon HD 4610", kNull }, + { 0x9598, 0x4570174B, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x4580174B, CHIP_FAMILY_RV635, "ATI Radeon HD 4580", kNull }, + { 0x9598, 0x4610174B, CHIP_FAMILY_RV635, "ATI Radeon HD 4610", kNull }, + + { 0x95C0, 0x3000148C, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + { 0x95C0, 0x3000174B, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + { 0x95C0, 0x3002174B, CHIP_FAMILY_RV620, "ATI Radeon HD 3570", kNull }, + { 0x95C0, 0x3020174B, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C0, 0xE3901745, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + + { 0x95C5, 0x01041A93, CHIP_FAMILY_RV620, "ATI Radeon HD 3450", kNull }, + { 0x95C5, 0x01051A93, CHIP_FAMILY_RV620, "ATI Radeon HD 3450", kNull }, + { 0x95C5, 0x3000148C, CHIP_FAMILY_RV620, "ATI Radeon HD 3450", kNull }, + { 0x95C5, 0x3001148C, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + { 0x95C5, 0x3002148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4230", kNull }, + { 0x95C5, 0x3003148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x3010174B, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x301017AF, CHIP_FAMILY_RV620, "ATI Radeon HD 4230", kNull }, + { 0x95C5, 0x3032148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x3033148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4230", kNull }, + { 0x95C5, 0x30501787, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x4250174B, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + + /* Evergreen */ + { 0x6898, 0x00D0106B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kLangur }, + { 0x6898, 0x032E1043, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + { 0x6898, 0x038C1043, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kNull }, + { 0x6898, 0x0B001002, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kZonalis }, + { 0x6898, 0x21E51458, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + { 0x6898, 0x29611682, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + { 0x6898, 0xE140174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + + { 0x6899, 0x200A1787, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0x21E41458, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0x22901787, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0xE140174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0xE174174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + + { 0x689C, 0x034A1043, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + { 0x689C, 0x03521043, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5870 X2", kUakari }, + { 0x689C, 0x039E1043, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5870", kUakari }, + { 0x689C, 0x25421002, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + { 0x689C, 0x30201682, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + + { 0x68A0, 0x03081025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5830", kNomascus }, + { 0x68A0, 0x030A1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5830", kNomascus }, + { 0x68A0, 0x043A1028, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5870", kNomascus }, + + { 0x68A1, 0x03081025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x030A1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x03671025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x03681025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x038B1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x038C1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x042E1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x042F1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x144D103C, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kNomascus }, + { 0x68A1, 0x1522103C, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x22411462, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x39961462, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + + { 0x68A8, 0x04421025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x04511025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x048F1028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x04901028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x04B91028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x04BA1028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x050A1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050B1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050C1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050E1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050F1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05131025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05141025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05151025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05161025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05251025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05261025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x056D1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x159B103C, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0xC0AD144D, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + + { 0x68B8, 0x00CF106B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kHoolock }, + { 0x68B8, 0x0044144D, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770", kVervet }, + { 0x68B8, 0x1482174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x200A1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x200B1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x21D71458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x21F61458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x25431002, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x25431458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x29901682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x29911682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x30001002, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6700", kVervet }, + { 0x68B8, 0x6880103C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x6881103C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770", kVervet }, + { 0x68B8, 0xE144174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kHoolock }, + { 0x68B8, 0xE147174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0xE160174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0xEA60174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770", kVervet }, + + { 0x68BA, 0x03FE1043, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x1482174B, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x174B1482, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x200A1787, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x21421462, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x25431458, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x31501682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x31521682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x31531682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0xE144174B, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + + { 0x68BE, 0x200A1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5750", kVervet }, + { 0x68BE, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5750", kVervet }, + { 0x68BE, 0x3000148C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + { 0x68BE, 0x3000174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + { 0x68BE, 0x300017AF, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + { 0x68BE, 0x39821642, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + + { 0x68BF, 0x220E1458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0x3000148C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0x31401682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0x6750174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0xE144174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kHoolock }, + + { 0x68C0, 0x1594103C, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6570M", kNull }, + { 0x68C0, 0x392717AA, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5730", kNull }, + { 0x68C0, 0x395217AA, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5730", kNull }, + { 0x68C0, 0x84721043, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5000", kNull }, + + { 0x68C1, 0x02051025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x02961025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x030A1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x033D1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x033E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x03471025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03561025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03581025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x035A1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x035C1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03641025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x036D1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x03791025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x037E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03821025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x04121025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x042E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x042F1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x9071104D, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0x1449103C, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFD001179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFD121179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFD501179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFDD01179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + + { 0x68C8, 0x2306103C, CHIP_FAMILY_REDWOOD, "ATI FirePro V4800 (FireGL)", kNull }, + { 0x68C8, 0x240A1002, CHIP_FAMILY_REDWOOD, "ATI FirePro V4800 (FireGL)", kNull }, + { 0x68C8, 0x240A1028, CHIP_FAMILY_REDWOOD, "ATI FirePro V4800 (FireGL)", kNull }, + + { 0x68D8, 0x03561043, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, + { 0x68D8, 0x03C01043, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0x20091787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0x200B1787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, // catalinz + { 0x68D8, 0x21D91458, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, + { 0x68D8, 0x21F41458, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0x22051462, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x22941787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x30001787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5730", kNull }, + { 0x68D8, 0x301017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5730", kNull }, + { 0x68D8, 0x301117AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x30601682, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x30651682, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x56701545, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x5690174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x5730174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5730", kNull }, + { 0x68D8, 0x68E01028, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, + { 0x68D8, 0xE151174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kEulemur }, + { 0x68D8, 0xE155174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0xE166174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kUakari }, + + { 0x68D9, 0x03CE1043, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5550", kNull }, + { 0x68D9, 0x22401462, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5570", kNull }, + { 0x68D9, 0x3000148C, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6510", kNull }, + { 0x68D9, 0x3000174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6510", kNull }, + { 0x68D9, 0x301017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + { 0x68D9, 0x39691642, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5570", kNull }, + + { 0x68DA, 0x3000148C, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6390", kNull }, + { 0x68DA, 0x3000174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6390", kNull }, + { 0x68DA, 0x30001787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + { 0x68DA, 0x300017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6390", kNull }, + { 0x68DA, 0x301017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + { 0x68DA, 0x5630174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + + { 0x68E0, 0x02931025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x03581025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x03591025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x035C1025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x035D1025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x036D1025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kLangur }, + { 0x68E0, 0x04471028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x04561028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x04831025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x1433103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x1441103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x144A103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x1BF21043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kNull }, + { 0x68E0, 0x848F1043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kNull }, + { 0x68E0, 0xFD001179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFD121179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFD501179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFD921179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFDD01179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + + { 0x68E1, 0x04661028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x10021B61, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450M", kEulemur }, + { 0x68E1, 0x10501462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x1426103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x142A103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 545vM", kEulemur }, + { 0x68E1, 0x14E110CF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5400M", kEulemur }, + { 0x68E1, 0x21D81458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x21E21458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x21F11458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x22021458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x23421462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x23431462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x25481458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5400M", kEulemur }, + { 0x68E1, 0x254A1458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5000M", kEulemur }, + { 0x68E1, 0x30001043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3000148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x30001682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3000174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68E1, 0x30001787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, // 5430M ??? + { 0x68E1, 0x300017AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3001148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x301417AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68E1, 0x3002148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3003148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450M", kEulemur }, + { 0x68E1, 0x54501545, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x5470174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E1, 0x60001092, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x60001682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x6000174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x6230174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68E1, 0x6350174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68E1, 0xFDD01179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + + { 0x68E4, 0x04821025, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x1426103C, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x1C921043, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x397917AA, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x397F17AA, CHIP_FAMILY_CEDAR, "AMD Radeon HD 7370M", kNull }, + { 0x68E4, 0x84A01043, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + + { 0x68F9, 0x00011019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x00021019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x00191019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x010E1002, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x010E1028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x03741043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x03CA1043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x05181025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x05191025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x174B3000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, + { 0x68F9, 0x174B6250, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, + { 0x68F9, 0x174B6290, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, + { 0x68F9, 0x174BE164, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x20091787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x21261028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x2126103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x21301462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21311462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21331462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68F9, 0x21801462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21811462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21821462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x21831462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x22911787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x22301462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x22311462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x23401462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x24951462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x2AAC103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x2AEC103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x30001787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x300017AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, + { 0x68F9, 0x3001148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, + { 0x68F9, 0x30011787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5530", kNull }, + { 0x68F9, 0x3002148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, + { 0x68F9, 0x30021787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, + { 0x68F9, 0x300217AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, + { 0x68F9, 0x3003148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, + { 0x68F9, 0x301117AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x301217AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, + { 0x68F9, 0x301317AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x301417AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x30321682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x303A1682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x3580103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x360217AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x360317AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x360F17AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x361917AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x39831642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x39841642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x39871642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x3987174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x39971462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x3A051642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x3B311642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350A", kNull }, + { 0x68F9, 0x5470174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x5490174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, + { 0x68F9, 0x5530174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5530", kNull }, + { 0x68F9, 0x6230174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, + { 0x68F9, 0x6350174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x7350148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 7350", kNull }, + { 0x68F9, 0xE127174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE145174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE153174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE164174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + + /* Northen Islands */ + { 0x6718, 0x03B81043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x03BC1043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x0B001002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x20101458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x20101787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x22001458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x22011458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x23061787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, // HIS + { 0x6718, 0x23701462, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, // MSI + { 0x6718, 0x24701462, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, // MSI + { 0x6718, 0x31301682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x67181002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0xE182174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0xE203174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + + { 0x6719, 0x03BE1043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x03D41043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x0B001002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x186B174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x20101787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x21FD1458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x23071787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x24611462, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x31211682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x31221682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0xE189174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + +// { 0x671D, 0x0B2A1002, CHIP_FAMILY_ANTILLES, "AMD Radeon HD 6990", kNull }, +// { 0x671D, 0x1B2A1002, CHIP_FAMILY_ANTILLES, "AMD Radeon HD 6990", kNull }, +// { 0x671D, 0x31601682, CHIP_FAMILY_ANTILLES, "AMD Radeon HD 6990", kNull }, + + { 0x6720, 0x048F1028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x04901028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x04A41028, CHIP_FAMILY_BARTS, "AMD FirePro M8900M", kElodea }, + { 0x6720, 0x04B91028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x04BA1028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x51021558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x51041558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6990M", kElodea }, + { 0x6720, 0x71001558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x72001558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x72011558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6990M", kElodea }, + { 0x6720, 0xC0AD144D, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + + { 0x6738, 0x00D01002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x03AE1043, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x03C61043, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kBulrushes }, // ?? kDuckweed ?? + { 0x6738, 0x20101787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x21FA1002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x21FA1458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x23051787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x25101462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31031682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31041682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31071682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31081682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, // ?? kJuncus ?? + { 0x6738, 0x67381002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0xE178174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + + { 0x6739, 0x03B41043, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x200F1787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x21F81458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kBulrushes }, + { 0x6739, 0x23041787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x24001462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x24411462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x25201462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x30001787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31101682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31131682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31141682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31161682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31171682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x67391002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xAA881002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xE174174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xE177174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xE183174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + + { 0x673E, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + { 0x673E, 0x23101787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + { 0x673E, 0x31701682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + { 0x673E, 0x31721682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + + { 0x6740, 0x04A31028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, // ?? + { 0x6740, 0x1D121043, CHIP_FAMILY_TURKS, "AMD Radeon HD 6730M", kNull }, + { 0x6740, 0x1631103C, CHIP_FAMILY_TURKS, "AMD FirePro M5950", kNull }, + { 0x6740, 0x1657103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x165A103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x3388103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x3389103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, // ?? kHydrilla ?? + { 0x6740, 0x6740106B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, // ?? + + { 0x6741, 0x050E1025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, + { 0x6741, 0x050F1025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, + { 0x6741, 0x05131025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, + { 0x6741, 0x1646103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6750M", kNull }, + { 0x6741, 0x1688103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 7690M", kNull }, + { 0x6741, 0x358D103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6630M/6650M/6750M", kNull }, + { 0x6741, 0x9080104D, CHIP_FAMILY_TURKS, "AMD Radeon HD 6630M", kNull }, + + { 0x6758, 0x00121028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x0B0E1002, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kPithecia }, + { 0x6758, 0x0B0E1028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x20121787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kPithecia }, + { 0x6758, 0x20141787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x22051458, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x31811682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x31831682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x67581002, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x6882103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0xE181174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0xE1941746, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0xE194174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kMangabey }, + + { 0x6759, 0x20121787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kPithecia }, + { 0x6759, 0x31951682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kGibba }, + { 0x6759, 0x32801682, CHIP_FAMILY_TURKS, "AMD Radeon HD 7570", kPithecia }, + { 0x6759, 0xE193174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kPithecia }, + + { 0x675F, 0x23141787, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + { 0x675F, 0x254B1458, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + { 0x675F, 0x6510148C, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + { 0x675F, 0x6510174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + + { 0x6760, 0x00031179, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x04C11028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x04CA1028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x04CC1028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x101C1043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x165A103C, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x167D103C, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x1CB21043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x20011043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x85171043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470M", kNull }, + + { 0x6778, 0x00241019, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470", kBulrushes }, // Elitegroup + { 0x6778, 0x00271019, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // Elitegroup + { 0x6778, 0x21201028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470", kBulrushes }, // Dell + { 0x6778, 0xB4911462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // MSi + { 0x6778, 0xB4921462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // MSi + { 0x6778, 0xB4931462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // MSi + + { 0x6779, 0x00001002, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x03DA1043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x03DC1043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x20121787, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x21201028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x21251462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x22031458, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x22041458, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x23111787, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x32001682, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x64501092, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x909D1B0A, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0xE164174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kIpomoea }, + { 0x6779, 0xE180174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kPithecia }, + { 0x6779, 0xE190174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0xE199174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + + /* Southen Islands */ + + { 0x6798, 0x04181043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x041C1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04201043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04421043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04441043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04461043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04481043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x044A1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x044C1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x044E1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x0B001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, // 7990 ??? + { 0x6798, 0x23171787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x254D1458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x27701462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x30001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x30001787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32101682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32111682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32121682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32131682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x99991043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7990", kAji }, // Asus + { 0x6798, 0xE208174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + + { 0x679A, 0x04241043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x04261043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x0B001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x0B011002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8900", kAji }, + { 0x679A, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x23161787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x254C1458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x27601462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x27711462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8950", kAji }, + { 0x679A, 0x3000174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32121682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32201682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32211682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32221682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x6616103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x7950174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0xE207174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0xE208174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + + { 0x6800, 0x03711558, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05501028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05511028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05544028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x057B1028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05861028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05871028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05881028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + + { 0x6818, 0x042F1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x04311043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x0B041002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x0B051002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8800", kAji }, + { 0x6818, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x23211787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x25541458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x27401462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x32501682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kChutoro }, + { 0x6818, 0x32511682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x7870174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x8B04174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8860", kAji }, + { 0x6818, 0xE217174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + + { 0x6819, 0x042C1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x04311043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x04331043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x043A1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x045B1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x0B041002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // ATI + { 0x6819, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // HIS + { 0x6819, 0x23201787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // HIS + { 0x6819, 0x25531458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Gigabyte + { 0x6819, 0x27301462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // MSI + { 0x6819, 0x27311462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // MSI + { 0x6819, 0x27321462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // MSI + { 0x6819, 0x32601682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // XFX + { 0x6819, 0x32621682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // XFX + { 0x6819, 0x32641682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // XFX + { 0x6819, 0xE218174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Sapphire + { 0x6819, 0xE221174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Sapphire + + { 0x682F, 0x15271043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7700M", kAji }, + { 0x682F, 0x1831103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0x1832103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0x1834103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0x18A7103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0xC0DA144D, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + + { 0x683D, 0x00301002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8760", kAji }, // VERDE? + { 0x683D, 0x00301019, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8760", kAji }, // VERDE? + { 0x683D, 0x04211043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x23041002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7700", kAji }, + { 0x683D, 0x25561458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x27101462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x2B301002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x32331682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x6886103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7700", kAji }, + { 0x683D, 0x6890103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8760", kAji }, // VERDE? + { 0x683D, 0xE214174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + + { 0x683F, 0x04231043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x04271043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x04591043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x200B1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x23181787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x25511458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x27921462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x2B301002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x32411682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x32421682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x32451682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0xE2131019, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0xE213174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0xE215174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + + { 0x6840, 0x01241002, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M", kPondweed }, + { 0x6840, 0x01341002, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M", kPondweed }, + { 0x6840, 0x050E1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x050F1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x05131025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x05141025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x056D1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x059A1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x059B1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x059E1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06001025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06061025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06961025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06971025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06981025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06991025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x100A1043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x104B1043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x10DC1043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1813103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7590M", kPondweed }, + { 0x6840, 0x182F103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1830103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1835103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x183A103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x183C103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x183E103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1840103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1842103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1844103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1848103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x184A103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x184C103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1895103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1897103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x18A5103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x18A7103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x18F4103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21211043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21221043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21231043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21251043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21271043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x397017AA, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x397B17AA, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xC0C5144D, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 6000M", kPondweed }, + { 0x6840, 0xC0CE144D, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xC0DA144D, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB111179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB221179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB231179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB2C1179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB311179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB321179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB381179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB391179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB3A1179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB401179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB411179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB471179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB481179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB511179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB521179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB531179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB811179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB821179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB831179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFC561179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFCD41179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFCEE1179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + + /*old series*/ + + { 0x5D48, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Mobile ", kNull }, + { 0x5D49, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Mobile ", kNull }, + { 0x5D4A, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Mobile ", kNull }, + + { 0x5D4C, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D4D, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D4E, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D4F, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D50, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + + { 0x5D52, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + + { 0x5D57, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + + { 0x5E48, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + + { 0x5E4A, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + { 0x5E4B, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + { 0x5E4C, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + { 0x5E4D, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + + { 0x5E4F, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + + { 0x7100, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7101, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7102, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7103, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7104, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7105, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7106, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7108, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7109, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710A, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710B, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710C, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + + { 0x710E, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710F, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + + { 0x7140, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7141, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7142, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7143, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7144, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x7145, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x7146, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7147, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7149, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714A, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714C, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714D, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x714E, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x714F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7151, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7152, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7153, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x715E, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x715F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7180, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7181, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7183, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7186, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x7187, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7188, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + + { 0x718A, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x718B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x718C, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x718D, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + + { 0x718F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7193, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7196, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + + { 0x719B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x719F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x71C0, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C1, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C2, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C3, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C4, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + + { 0x71C5, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD 1600 Mobile ", kWormy }, + { 0x71C6, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C7, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71CD, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71CE, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71D2, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71D4, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + { 0x71D5, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + { 0x71D6, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + + { 0x71DA, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71DE, 0x00000000, CHIP_FAMILY_RV530, "ASUS M66 ATI Radeon Mobile ", kWormy }, + + { 0x7200, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kWormy }, + + { 0x7210, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kWormy }, + { 0x7211, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kWormy }, + + { 0x7240, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7243, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7244, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7245, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7246, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7247, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7248, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7249, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724A, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724B, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724C, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724D, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724E, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724F, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7280, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD X1950 Pro ", kAlopias }, + { 0x7281, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7283, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7284, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Mobile ", kAlopias }, + + { 0x7287, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7288, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7289, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x728B, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + { 0x728C, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7290, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7291, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7293, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7297, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + + /* IGP */ + + { 0x791E, 0x00000000, CHIP_FAMILY_RS690, "ATI Radeon IGP ", kNull }, + { 0x791F, 0x00000000, CHIP_FAMILY_RS690, "ATI Radeon IGP ", kNull }, + { 0x796C, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + { 0x796D, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + { 0x796E, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + { 0x796F, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + + /* standard/default models */ + + { 0x9400, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9401, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x9402, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x9403, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x9405, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x940A, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x940B, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x940F, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + + { 0x9440, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 ", kMotmot }, + { 0x9441, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9442, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4850 Series", kMotmot }, + { 0x9443, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4850 X2", kMotmot }, + { 0x9444, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8750 (FireGL)", kMotmot }, + { 0x9446, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V7770 (FireGL)", kMotmot }, + { 0x9447, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8700 Duo (FireGL)", kMotmot }, + { 0x944A, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4850", kMotmot }, + { 0x944B, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4850 X2", kMotmot }, + { 0x944C, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4830 Series", kMotmot }, + { 0x944E, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4810 Series", kMotmot }, + + { 0x9450, 0x00000000, CHIP_FAMILY_RV770, "AMD FireStream 9270", kMotmot }, + { 0x9452, 0x00000000, CHIP_FAMILY_RV770, "AMD FireStream 9250", kMotmot }, + + { 0x9456, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8700 (FireGL)", kMotmot }, + { 0x945A, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4870", kMotmot }, + + { 0x9460, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4800 Series", kMotmot }, + { 0x9462, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4800 Series", kMotmot }, + + { 0x9480, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4650 Series", kGliff }, + + { 0x9487, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x9488, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4650 Series", kGliff }, + { 0x9489, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x948A, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x948F, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x9490, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4710 Series", kGliff }, + { 0x9491, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4600 Series", kGliff }, + { 0x9495, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4650 Series", kGliff }, + + { 0x9498, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4710 Series", kGliff }, + { 0x949C, 0x00000000, CHIP_FAMILY_RV730, "ATI FirePro V7750 (FireGL)", kGliff }, + { 0x949E, 0x00000000, CHIP_FAMILY_RV730, "ATI FirePro V5700 (FireGL)", kGliff }, + { 0x949F, 0x00000000, CHIP_FAMILY_RV730, "ATI FirePro V3750 (FireGL)", kGliff }, + + { 0x94A0, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4830M", kFlicker }, + { 0x94A1, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4860M", kFlicker }, + { 0x94A3, 0x00000000, CHIP_FAMILY_RV740, "ATI FirePro M7740", kFlicker }, + { 0x94B1, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD", kFlicker }, + { 0x94B3, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B4, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4700 Series", kFlicker }, + { 0x94B5, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B9, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD", kFlicker }, + + { 0x94C0, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD Series", kIago }, + { 0x94C1, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + + { 0x94C3, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2350 Series", kIago }, + { 0x94C4, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C5, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C6, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C7, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kIago }, + { 0x94C8, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C9, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + + { 0x94CB, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94CC, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94CD, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO Series", kIago }, + + { 0x9500, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3800 Series", kMegalodon }, + { 0x9501, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3690 Series", kMegalodon }, + + { 0x9504, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850M Series", kMegalodon }, + { 0x9505, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3800 Series", kMegalodon }, + { 0x9506, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850 X2 M Series", kMegalodon }, + { 0x9507, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3830", kMegalodon }, + { 0x9508, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3870M Series", kMegalodon }, + { 0x9509, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3870 X2 MSeries", kMegalodon }, + + { 0x950F, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3870 X2", kMegalodon }, + + { 0x9511, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850 X2", kMegalodon }, + + { 0x9513, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3850 X2", kMegalodon }, + { 0x9515, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850 Series", kMegalodon }, + { 0x9517, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD Series", kMegalodon }, + + { 0x9519, 0x00000000, CHIP_FAMILY_RV670, "AMD FireStream 9170", kMegalodon }, + + { 0x9540, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kFlicker }, + { 0x9541, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD", kFlicker }, + { 0x9542, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD", kFlicker }, + { 0x954E, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD", kFlicker }, + { 0x954F, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kFlicker }, + + { 0x9552, 0x00000000, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4300/4500 Series", kShrike }, + { 0x9553, 0x00000000, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500M/5100M Series",kShrike }, + + { 0x9555, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD4300/HD4500 series", kShrike }, + + { 0x9557, 0x00000000, CHIP_FAMILY_RV710, "ATI FirePro RG220", kFlicker }, + + { 0x955F, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD 4330M series", kFlicker }, + + { 0x9580, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD Series", kHypoprion }, + { 0x9581, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3600 Series", kHypoprion }, + + { 0x9583, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3600 Series", kHypoprion }, + + { 0x9586, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 XT Series", kHypoprion }, + { 0x9587, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 Pro Series", kHypoprion }, + { 0x9588, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 XT", kHypoprion }, + { 0x9589, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3610 Series", kHypoprion }, + { 0x958A, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958B, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958C, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958D, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958E, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958F, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD Series", kHypoprion }, + + { 0x9591, 0x00000000, CHIP_FAMILY_RV635, "ATI Radeon HD 3600 Series", kMegalodon }, + + { 0x9598, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3600 Series", kMegalodon }, + + { 0x95C0, 0x00000000, CHIP_FAMILY_RV620, "ATI Radeon HD 3550 Series", kIago }, + + { 0x95C4, 0x00000000, CHIP_FAMILY_RV620, "ATI Radeon HD 3470 Series", kIago }, + + { 0x95C5, 0x00000000, CHIP_FAMILY_RV620, "ATI Radeon HD 3450 Series", kIago }, + + /* IGP */ + { 0x9610, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon HD 3200 Graphics", kNull }, + { 0x9611, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon 3100 Graphics", kNull }, + + { 0x9614, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon HD 3300 Graphics", kNull }, + + { 0x9616, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon 3000 Graphics", kNull }, + + { 0x9710, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 4200 Series", kNull }, + + { 0x9714, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 4290 Series", kNull }, + { 0x9715, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 4250 Series", kNull }, + + { 0x9723, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 5450 Series", kNull }, + + { 0x9802, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6310 Series", kNull }, + { 0x9803, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6310 Series", kNull }, + { 0x9804, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6310 Series", kNull }, + { 0x9805, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6250 Series", kNull }, + { 0x9806, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6320 Series", kNull }, + + /* Evergreen */ + { 0x688D, 0x00000000, CHIP_FAMILY_CYPRESS, "AMD FireStream 9350 Series", kUakari }, + + { 0x6898, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800 Series", kUakari }, + { 0x6899, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800 Series", kUakari }, + +// { 0x689B, 0x00000000, CHIP_FAMILY_???, "AMD Radeon HD 6800 Series", kNull }, + { 0x689C, 0x00000000, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5900 Series", kUakari }, + + { 0x689E, 0x00000000, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5800 Series", kUakari }, + + { 0x68A0, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5800 Series", kNomascus }, // CHIP_FAMILY_BROADWAY ?? + { 0x68A1, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5800 Series", kNomascus }, // CHIP_FAMILY_BROADWAY ?? + + { 0x68A8, 0x00000000, CHIP_FAMILY_JUNIPER, "AMD Mobility Radeon HD 6800 Series", kNomascus }, + { 0x68A9, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI FirePro V5800 (FireGL)", kNull }, + + + { 0x68B0, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Mobility Radeon HD 5800 Series", kHoolock }, // CHIP_FAMILY_BROADWAY ?? + { 0x68B1, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770 Series", kHoolock }, + + { 0x68B8, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5700 Series", kHoolock }, + { 0x68B9, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5600 Series", kHoolock }, + { 0x68BA, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6700 Series", kHoolock }, + + { 0x68BE, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5700 Series", kHoolock }, + { 0x68BF, 0x00000000, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6700 Series", kHoolock }, + + { 0x68C0, 0x00000000, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6570M/5700 Series", kBaboon }, + { 0x68C1, 0x00000000, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6500M/5600/5700 Series", kBaboon }, + { 0x68C8, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5650 Series", kVervet }, + { 0x68C9, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI FirePro V3800 (FireGL)", kBaboon }, + + { 0x68D8, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670 Series", kBaboon }, + { 0x68D9, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5500/5600 Series", kBaboon }, + { 0x68DA, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5500 Series", kBaboon }, + +// { 0x68DE, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD ??? Series", kNull }, + + + { 0x68E0, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5400 Series", kEulemur }, + { 0x68E1, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Mobility Radeon HD 5400 Series", kEulemur }, + + { 0x68E4, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6370M Series", kEulemur }, + { 0x68E5, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6300M Series", kEulemur }, + +// { 0x68E8, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, +// { 0x68E9, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, + +// { 0x68F8, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, + { 0x68F9, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470 Series", kEulemur }, + { 0x68FA, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 7300 Series", kNull }, + +// { 0x68FE, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, + + + /* Northen Islands */ + { 0x6718, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970 Series", kLotus }, + { 0x6719, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950 Series", kGibba }, + + { 0x671C, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970 Series", kLotus }, + { 0x671D, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950 Series", kLotus }, + + { 0x671F, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6930 Series", kLotus }, + + { 0x6720, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kFanwort }, + + { 0x6722, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kFanwort }, + { 0x6729, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kFanwort }, + { 0x6738, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870 Series", kDuckweed }, + { 0x6739, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850 Series", kDuckweed }, + + { 0x673E, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790 Series", kDuckweed }, + + { 0x6740, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M Series", kCattail }, + { 0x6741, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6750M Series", kCattail }, + + { 0x6745, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600M Series", kCattail }, + { 0x6749, 0x00000000, CHIP_FAMILY_TURKS, "ATI Radeon FirePro V4900", kPithecia }, + { 0x674A, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600M Series", kCattail }, + { 0x6750, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600A Series", kPithecia }, + + { 0x6758, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670 Series", kPithecia }, + { 0x6759, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570/7570 Series", kPithecia }, + + { 0x675D, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 7570M Series", kCattail }, + + { 0x675F, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570 Series", kBulrushes }, + { 0x6760, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400M Series", kHydrilla }, + { 0x6761, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6430M Series", kHydrilla }, + { 0x6768, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400M Series", kHydrilla }, + + { 0x6770, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400 Series", kBulrushes }, + + { 0x6772, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7400A Series", kBulrushes }, + + { 0x6778, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7000 Series", kBulrushes }, + { 0x6779, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450 Series", kBulrushes }, + + { 0x677B, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7400 Series", kBulrushes }, + + /* Southen Islands */ + + { 0x6780, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, // ATI7000Controller.kext + +// { 0x6784, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD ??? Series", kFutomaki }, + +// { 0x6788, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD ??? Series", kFutomaki }, + + { 0x678A, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + + { 0x6790, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, // ATI7000Controller.kext + { 0x6791, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + { 0x6792, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + + { 0x6798, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970 X-Edition", kFutomaki }, // ATI7000Controller.kext + { 0x6799, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7990 Series", kAji }, + { 0x679A, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950 Series", kFutomaki }, // ATI7000Controller.kext + { 0x679B, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + + { 0x679E, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870 XT", kFutomaki }, // ATI7000Controller.kext + { 0x679F, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950 Series", kFutomaki }, + + { 0x6800, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kFutomaki }, // ATI7000Controller.kext +// { 0x6801, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ???M Series", kFutomaki }, +// { 0x6802, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ???M Series", kFutomaki }, + + { 0x6806, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7600 Series", kFutomaki }, // ATI7000Controller.kext + + { 0x6808, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7600 Series", kFutomaki }, // ATI7000Controller.kext +// { 0x6809, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ??? Series", kNull }, +// { 0x6810, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ??? Series", kNull }, + + { 0x6818, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7800 Series", kFutomaki }, // CHIP_FAMILY_PITCAIRN ??// ATI7000Controller.kext + { 0x6819, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850 Series", kFutomaki },// CHIP_FAMILY_PITCAIRN ?? + { 0x6820, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + { 0x6821, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + +// { 0x6823, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 8800M Series", kBuri }, +// { 0x6824, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700M Series", kBuri }, + { 0x6825, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7870 Series", kBuri }, // ATI7000Controller.kext + { 0x6826, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, + { 0x6827, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7850M/8850M Series", kBuri }, // ATI7000Controller.kext +// { 0x6828, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD ??? Series", kBuri }, +// { 0x6829, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD ??? Series", kBuri }, + + { 0x682B, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 8800M Series", kBuri }, + + { 0x682D, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + + { 0x682F, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7730 Series", kBuri }, // ATI7000Controller.kext + + { 0x6830, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7800M Series", kBuri }, + { 0x6831, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, + + { 0x6837, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, +// { 0x6838, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD ??? Series", kBuri }, + { 0x6839, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + + { 0x683B, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + + { 0x683D, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7770 Series", kBuri }, // ATI7000Controller.kext + + { 0x683F, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7750 Series", kBuri }, // ATI7000Controller.kext + + { 0x6840, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M Series", kPondweed }, // THAMES?? + { 0x6841, 0x00000000, CHIP_FAMILY_THAMES, "AMD Radeon HD 7500M/7600M Series", kPondweed }, + { 0x6842, 0x00000000, CHIP_FAMILY_THAMES, "AMD Radeon HD 7000M Series", kPondweed }, + { 0x6843, 0x00000000, CHIP_FAMILY_THAMES, "AMD Radeon HD 7670M Series", kPondweed }, + { 0x6849, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M Series", kPondweed }, + +// { 0x684C, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ??? Series", kNull }, + { 0x6850, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M Series", kPondweed }, + { 0x6858, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7400 Series", kPondweed }, + { 0x6859, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M Series", kPondweed }, + + { 0x0000, 0x00000000, CHIP_FAMILY_UNKNOW, NULL, kNull } +}; + + +dev_prop_t ati_devprop_list[] = { + {FLAGTRUE, false, "@0,AAPL,boot-display", get_bootdisplay_val, NULVAL }, +// {FLAGTRUE, false, "@0,ATY,EFIDisplay", NULL, STRVAL("TMDSA") }, + +// {FLAGTRUE, true, "@0,AAPL,vram-memory", get_vrammemory_val, NULVAL }, +// {FLAGTRUE, true, "@0,compatible", get_name_val, NULVAL }, +// {FLAGTRUE, true, "@0,connector-type", get_conntype_val, NULVAL }, +// {FLAGTRUE, true, "@0,device_type", NULL, STRVAL("display") }, +// {FLAGTRUE, false, "@0,display-connect-flags", NULL, DWRVAL((uint32_t)0) }, +// {FLAGTRUE, true, "@0,display-type", NULL, STRVAL("NONE") }, + {FLAGTRUE, true, "@0,name", get_name_val, NULVAL }, +// {FLAGTRUE, true, "@0,VRAM,memsize", get_vrammemsize_val, NULVAL }, + +// {FLAGTRUE, false, "AAPL,aux-power-connected", NULL, DWRVAL((uint32_t)1) }, +// {FLAGTRUE, false, "AAPL,backlight-control", NULL, DWRVAL((uint32_t)0) }, + {FLAGTRUE, false, "ATY,bin_image", get_binimage_val, NULVAL }, + {FLAGTRUE, false, "ATY,Copyright", NULL, STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2010") }, + {FLAGTRUE, false, "ATY,Card#", get_romrevision_val, NULVAL }, + {FLAGTRUE, false, "ATY,VendorID", NULL, WRDVAL((uint16_t)0x1002) }, + {FLAGTRUE, false, "ATY,DeviceID", get_deviceid_val, NULVAL }, + +// {FLAGTRUE, false, "ATY,MCLK", get_mclk_val, NULVAL }, +// {FLAGTRUE, false, "ATY,SCLK", get_sclk_val, NULVAL }, +// {FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL((uint32_t)0x0a8c) }, + +// {FLAGTRUE, false, "ATY,PlatformInfo", get_platforminfo_val, NULVAL }, + + {FLAGTRUE, false, "name", get_nameparent_val, NULVAL }, + {FLAGTRUE, false, "device_type", get_nameparent_val, NULVAL }, + {FLAGTRUE, false, "model", get_model_val, STRVAL("ATI Radeon") }, +// {FLAGTRUE, false, "VRAM,totalsize", get_vramtotalsize_val, NULVAL }, + {FLAGTRUE, false, "hda-gfx", get_hdmiaudio, NULVAL}, + + {FLAGTRUE, false, NULL, NULL, NULVAL } +}; + +bool get_hdmiaudio(value_t * val) +{ + bool doit = false; + if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit){ + val->type = kStr; + val->size = strlen("onboard-1") + 1; + val->data = (uint8_t *)"onboard-1"; + + return true; + } + return false; +} + +bool get_bootdisplay_val(value_t *val) +{ + static uint32_t v = 0; + + if (v) + { + return false; + } + if (!card->posted) + { + return false; + } + v = 1; + val->type = kCst; + val->size = 4; + val->data = (uint8_t *)&v; + + return true; +} + +bool get_vrammemory_val(value_t *val) +{ + return false; +} + +bool get_name_val(value_t *val) +{ + val->type = aty_name.type; + val->size = aty_name.size; + val->data = aty_name.data; + + return true; +} + +bool get_nameparent_val(value_t *val) +{ + val->type = aty_nameparent.type; + val->size = aty_nameparent.size; + val->data = aty_nameparent.data; + + return true; +} + +bool get_model_val(value_t *val) +{ + if (!card->info->model_name) + return false; + + val->type = kStr; + val->size = strlen(card->info->model_name) + 1; + val->data = (uint8_t *)card->info->model_name; + + return true; +} + +bool get_conntype_val(value_t *val) +{ +//Connector types: +//0x00000010: VGA +//0x00000004: DL DVI-I +//0x00000200: SL DVI-I +//0x00000080: S-V +//0x00000800: HDMI +//0x00000400: DisplayPort +//0x00000002: LVDS + + return false; +} + +bool get_vrammemsize_val(value_t *val) +{ + static int idx = -1; + static uint64_t memsize; + + idx++; + memsize = ((uint64_t)card->vram_size << 32); + if (idx == 0) + { + memsize = memsize | (uint64_t)card->vram_size; + } + val->type = kCst; + val->size = 8; + val->data = (uint8_t *)&memsize; + + return true; +} + +bool get_binimage_val(value_t *val) +{ + if (!card->rom) + { + return false; + } + val->type = kPtr; + val->size = card->rom_size; + val->data = card->rom; + + return true; +} + +bool get_romrevision_val(value_t *val) +{ + uint8_t *rev; + if (!card->rom) + { + return false; + } + + rev = card->rom + *(uint8_t *)(card->rom + OFFSET_TO_GET_ATOMBIOS_STRINGS_START); + + val->type = kPtr; + val->size = strlen((char *)rev); + val->data = malloc(val->size); + + if (!val->data) + { + return false; + } + + memcpy(val->data, rev, val->size); + + return true; +} + +bool get_deviceid_val(value_t *val) +{ + val->type = kCst; + val->size = 2; + val->data = (uint8_t *)&card->pci_dev->device_id; + + return true; +} + +bool get_mclk_val(value_t *val) +{ + return false; +} + +bool get_sclk_val(value_t *val) +{ + return false; +} + +bool get_refclk_val(value_t *val) +{ + return false; +} + +bool get_platforminfo_val(value_t *val) +{ + val->data = malloc(0x80); + if (!val->data) + { + return false; + } + bzero(val->data, 0x80); + + val->type = kPtr; + val->size = 0x80; + val->data[0] = 1; + + return true; +} + +bool get_vramtotalsize_val(value_t *val) +{ + + val->type = kCst; + val->size = 4; + val->data = (uint8_t *)&card->vram_size; + + return true; +} + +void free_val(value_t *val) +{ + if (val->type == kPtr) + { + free(val->data); + } + + bzero(val, sizeof(value_t)); +} + +void devprop_add_list(dev_prop_t devprop_list[]) +{ + int i, pnum; + value_t *val = malloc(sizeof(value_t)); + + for (i = 0; devprop_list[i].name != NULL; i++) + { + if ((devprop_list[i].flags == FLAGTRUE) || (devprop_list[i].flags | card->flags)) + { + if (devprop_list[i].get_value && devprop_list[i].get_value(val)) + { + devprop_add_value(card->device, devprop_list[i].name, val->data, val->size); + free_val(val); + + if (devprop_list[i].all_ports) + { + for (pnum = 1; pnum < card->ports; pnum++) + { + if (devprop_list[i].get_value(val)) + { + devprop_list[i].name[1] = 0x30 + pnum; // convert to ascii + devprop_add_value(card->device, devprop_list[i].name, val->data, val->size); + free_val(val); + } + } + devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card + } + } + else + { + if (devprop_list[i].default_val.type != kNul) + { + devprop_add_value(card->device, devprop_list[i].name, + devprop_list[i].default_val.type == kCst ? + (uint8_t *)&(devprop_list[i].default_val.data) : devprop_list[i].default_val.data, + devprop_list[i].default_val.size); + } + + if (devprop_list[i].all_ports) + { + for (pnum = 1; pnum < card->ports; pnum++) + { + if (devprop_list[i].default_val.type != kNul) + { + devprop_list[i].name[1] = 0x30 + pnum; // convert to ascii + devprop_add_value(card->device, devprop_list[i].name, + devprop_list[i].default_val.type == kCst ? + (uint8_t *)&(devprop_list[i].default_val.data) : devprop_list[i].default_val.data, + devprop_list[i].default_val.size); + } + } + devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card + } + } + } + } + + free(val); +} + +bool validate_rom(option_rom_header_t *rom_header, pci_dt_t *pci_dev) +{ + option_rom_pci_header_t *rom_pci_header; + + if (rom_header->signature != 0xaa55) + { + return false; + } + + rom_pci_header = (option_rom_pci_header_t *)((uint8_t *)rom_header + rom_header->pci_header_offset); + + if (rom_pci_header->signature != 0x52494350) + { + return false; + } + + if (rom_pci_header->vendor_id != pci_dev->vendor_id || rom_pci_header->device_id != pci_dev->device_id) + { + return false; + } + + return true; +} + +bool load_vbios_file(const char *key, uint16_t vendor_id, uint16_t device_id, uint32_t subsys_id) +{ + int fd; + char file_name[24]; + bool do_load = false; + + getBoolForKey(key, &do_load, &bootInfo->chameleonConfig); + if (!do_load) + { + return false; + } + + sprintf(file_name, "/Extra/%04x_%04x_%08x.rom", vendor_id, device_id, subsys_id); + if ((fd = open_bvdev("bt(0,0)", file_name, 0)) < 0) + { + return false; + } + + card->rom_size = file_size(fd); + card->rom = malloc(card->rom_size); + if (!card->rom) + { + return false; + } + + read(fd, (char *)card->rom, card->rom_size); + + if (!validate_rom((option_rom_header_t *)card->rom, card->pci_dev)) + { + card->rom_size = 0; + card->rom = 0; + return false; + } + + card->rom_size = ((option_rom_header_t *)card->rom)->rom_size * 512; + + close(fd); + + return true; +} + +void get_vram_size(void) +{ + ati_chip_family_t chip_family = card->info->chip_family; + + card->vram_size = 0; + + if (chip_family >= CHIP_FAMILY_CEDAR) + { + // size in MB on evergreen + // XXX watch for overflow!!! + card->vram_size = RegRead32(R600_CONFIG_MEMSIZE) * 1024 * 1024; + } + else + { + if (chip_family >= CHIP_FAMILY_R600) + { + card->vram_size = RegRead32(R600_CONFIG_MEMSIZE); + } + } +} + +bool read_vbios(bool from_pci) +{ + option_rom_header_t *rom_addr; + + if (from_pci) + { + rom_addr = (option_rom_header_t *)(pci_config_read32(card->pci_dev->dev.addr, PCI_ROM_ADDRESS) & ~0x7ff); + verbose(" @0x%x\n", rom_addr); + } + else + { + rom_addr = (option_rom_header_t *)0xc0000; + } + + if (!validate_rom(rom_addr, card->pci_dev)) + { + return false; + } + card->rom_size = rom_addr->rom_size * 512; + if (!card->rom_size) + { + return false; + } + + card->rom = malloc(card->rom_size); + if (!card->rom) + { + return false; + } + + memcpy(card->rom, (void *)rom_addr, card->rom_size); + + return true; +} + +bool read_disabled_vbios(void) +{ + bool ret = false; + ati_chip_family_t chip_family = card->info->chip_family; + + if (chip_family >= CHIP_FAMILY_RV770) + { + uint32_t viph_control = RegRead32(RADEON_VIPH_CONTROL); + uint32_t bus_cntl = RegRead32(RADEON_BUS_CNTL); + uint32_t d1vga_control = RegRead32(AVIVO_D1VGA_CONTROL); + uint32_t d2vga_control = RegRead32(AVIVO_D2VGA_CONTROL); + uint32_t vga_render_control = RegRead32(AVIVO_VGA_RENDER_CONTROL); + uint32_t rom_cntl = RegRead32(R600_ROM_CNTL); + uint32_t cg_spll_func_cntl = 0; + uint32_t cg_spll_status; + + // disable VIP + RegWrite32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); + + // enable the rom + RegWrite32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); + + // Disable VGA mode + RegWrite32(AVIVO_D1VGA_CONTROL, (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_D2VGA_CONTROL, (d2vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, (vga_render_control & ~AVIVO_VGA_VSTATUS_CNTL_MASK)); + + if (chip_family == CHIP_FAMILY_RV730) + { + cg_spll_func_cntl = RegRead32(R600_CG_SPLL_FUNC_CNTL); + + // enable bypass mode + RegWrite32(R600_CG_SPLL_FUNC_CNTL, (cg_spll_func_cntl | R600_SPLL_BYPASS_EN)); + + // wait for SPLL_CHG_STATUS to change to 1 + cg_spll_status = 0; + while (!(cg_spll_status & R600_SPLL_CHG_STATUS)) + { + cg_spll_status = RegRead32(R600_CG_SPLL_STATUS); + } + + RegWrite32(R600_ROM_CNTL, (rom_cntl & ~R600_SCK_OVERWRITE)); + } + else + { + RegWrite32(R600_ROM_CNTL, (rom_cntl | R600_SCK_OVERWRITE)); + } + + ret = read_vbios(true); + + // restore regs + if (chip_family == CHIP_FAMILY_RV730) + { + RegWrite32(R600_CG_SPLL_FUNC_CNTL, cg_spll_func_cntl); + + // wait for SPLL_CHG_STATUS to change to 1 + cg_spll_status = 0; + while (!(cg_spll_status & R600_SPLL_CHG_STATUS)) + cg_spll_status = RegRead32(R600_CG_SPLL_STATUS); + } + RegWrite32(RADEON_VIPH_CONTROL, viph_control); + RegWrite32(RADEON_BUS_CNTL, bus_cntl); + RegWrite32(AVIVO_D1VGA_CONTROL, d1vga_control); + RegWrite32(AVIVO_D2VGA_CONTROL, d2vga_control); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); + RegWrite32(R600_ROM_CNTL, rom_cntl); + } + else + if (chip_family >= CHIP_FAMILY_R600) + { + uint32_t viph_control = RegRead32(RADEON_VIPH_CONTROL); + uint32_t bus_cntl = RegRead32(RADEON_BUS_CNTL); + uint32_t d1vga_control = RegRead32(AVIVO_D1VGA_CONTROL); + uint32_t d2vga_control = RegRead32(AVIVO_D2VGA_CONTROL); + uint32_t vga_render_control = RegRead32(AVIVO_VGA_RENDER_CONTROL); + uint32_t rom_cntl = RegRead32(R600_ROM_CNTL); + uint32_t general_pwrmgt = RegRead32(R600_GENERAL_PWRMGT); + uint32_t low_vid_lower_gpio_cntl = RegRead32(R600_LOW_VID_LOWER_GPIO_CNTL); + uint32_t medium_vid_lower_gpio_cntl = RegRead32(R600_MEDIUM_VID_LOWER_GPIO_CNTL); + uint32_t high_vid_lower_gpio_cntl = RegRead32(R600_HIGH_VID_LOWER_GPIO_CNTL); + uint32_t ctxsw_vid_lower_gpio_cntl = RegRead32(R600_CTXSW_VID_LOWER_GPIO_CNTL); + uint32_t lower_gpio_enable = RegRead32(R600_LOWER_GPIO_ENABLE); + + // disable VIP + RegWrite32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); + + // enable the rom + RegWrite32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); + + // Disable VGA mode + RegWrite32(AVIVO_D1VGA_CONTROL, (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_D2VGA_CONTROL, (d2vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, (vga_render_control & ~AVIVO_VGA_VSTATUS_CNTL_MASK)); + RegWrite32(R600_ROM_CNTL, ((rom_cntl & ~R600_SCK_PRESCALE_CRYSTAL_CLK_MASK) | (1 << R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT) | R600_SCK_OVERWRITE)); + RegWrite32(R600_GENERAL_PWRMGT, (general_pwrmgt & ~R600_OPEN_DRAIN_PADS)); + RegWrite32(R600_LOW_VID_LOWER_GPIO_CNTL, (low_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_MEDIUM_VID_LOWER_GPIO_CNTL, (medium_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_HIGH_VID_LOWER_GPIO_CNTL, (high_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_CTXSW_VID_LOWER_GPIO_CNTL, (ctxsw_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_LOWER_GPIO_ENABLE, (lower_gpio_enable | 0x400)); + + ret = read_vbios(true); + + // restore regs + RegWrite32(RADEON_VIPH_CONTROL, viph_control); + RegWrite32(RADEON_BUS_CNTL, bus_cntl); + RegWrite32(AVIVO_D1VGA_CONTROL, d1vga_control); + RegWrite32(AVIVO_D2VGA_CONTROL, d2vga_control); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); + RegWrite32(R600_ROM_CNTL, rom_cntl); + RegWrite32(R600_GENERAL_PWRMGT, general_pwrmgt); + RegWrite32(R600_LOW_VID_LOWER_GPIO_CNTL, low_vid_lower_gpio_cntl); + RegWrite32(R600_MEDIUM_VID_LOWER_GPIO_CNTL, medium_vid_lower_gpio_cntl); + RegWrite32(R600_HIGH_VID_LOWER_GPIO_CNTL, high_vid_lower_gpio_cntl); + RegWrite32(R600_CTXSW_VID_LOWER_GPIO_CNTL, ctxsw_vid_lower_gpio_cntl); + RegWrite32(R600_LOWER_GPIO_ENABLE, lower_gpio_enable); + } + + return ret; +} + +bool radeon_card_posted(void) +{ + uint32_t reg; + + // first check CRTCs + reg = RegRead32(RADEON_CRTC_GEN_CNTL) | RegRead32(RADEON_CRTC2_GEN_CNTL); + if (reg & RADEON_CRTC_EN) + { + return true; + } + + // then check MEM_SIZE, in case something turned the crtcs off + reg = RegRead32(R600_CONFIG_MEMSIZE); + if (reg) + { + return true; + } + + return false; +} + +#if 0 +bool devprop_add_pci_config_space(void) +{ + int offset; + + uint8_t *config_space = malloc(0x100); + if (!config_space) + { + return false; + } + + for (offset = 0; offset < 0x100; offset += 4) + { + config_space[offset / 4] = pci_config_read32(card->pci_dev->dev.addr, offset); + } + + devprop_add_value(card->device, "ATY,PCIConfigSpace", config_space, 0x100); + free(config_space); + + return true; +} +#endif + +static bool init_card(pci_dt_t *pci_dev) +{ + bool add_vbios = true; + char name[24]; + char name_parent[24]; + int i; + int n_ports = 0; + + card = malloc(sizeof(card_t)); + if (!card) + { + return false; + } + bzero(card, sizeof(card_t)); + + card->pci_dev = pci_dev; + + for (i = 0; radeon_cards[i].device_id ; i++) + { + if (radeon_cards[i].device_id == pci_dev->device_id) + { + if ((radeon_cards[i].subsys_id == 0x00000000) || (radeon_cards[i].subsys_id == pci_dev->subsys_id.subsys_id)) + { + card->info = &radeon_cards[i]; + break; + } + } + } + + if (card->info == NULL) // Jief + { + verbose("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%04x:%04x] \n", + pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys.vendor_id, pci_dev->subsys_id.subsys.device_id); + return false; + } + + card->fb = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_0) & ~0x0f); + card->mmio = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f); + card->io = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_4) & ~0x03); + + verbose("ATI Framebuffer Addr: @0x%08X MMIO Addr: @0x%08X I/O Port Addr: @0x%08X ROM Addr: @0x%08X\n", + card->fb, card->mmio, card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS)); + + card->posted = radeon_card_posted(); + verbose("ATI card %s, ", card->posted ? "POSTed" : "non-POSTed"); + + get_vram_size(); + + getBoolForKey(kATYbinimage, &add_vbios, &bootInfo->chameleonConfig); + + if (add_vbios) + { + if (!load_vbios_file(kUseAtiROM, pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id)) + { + verbose("reading Video BIOS from %s", card->posted ? "legacy space" : "PCI ROM"); + if (card->posted) + { + read_vbios(false); + } + else + { + read_disabled_vbios(); + } + verbose("\n"); + } + } + + + if (card->info->chip_family >= CHIP_FAMILY_CEDAR) + { + card->flags |= EVERGREEN; + } + + + // Check AtiConfig key for a framebuffer name, + card->cfg_name = getStringForKey(kAtiConfig, &bootInfo->chameleonConfig); + + // if none, + if (!card->cfg_name) + { + // use cfg_name on radeon_cards, to retrive the default name from card_configs, + card->cfg_name = card_configs[card->info->cfg_name].name; + + // which means one of the fb's or kNull + verbose("Framebuffer set to: %s using device's default.\n", card->cfg_name); + } + else + { + // else, use the fb name returned by AtiConfig. + verbose("Framebuffer set to: %s using AtiConfig=%s\n", card->cfg_name, card->cfg_name); + } + + // Check AtiPorts key for nr of ports, + card->ports = getIntForKey(kAtiPorts, &n_ports, &bootInfo->chameleonConfig); + // if a value bigger than 0 ?? is found, (do we need >= 0 ?? that's null FB on card_configs) + if (n_ports > 0) + { + card->ports = n_ports; // use it. + verbose("Number of ports set to: %d using AtiPorts=%d\n", card->ports, card->ports); + } + else + { + // else, match cfg_name with card_configs list and retrive default nr of ports. + for (i = 0; i < kCfgEnd; i++) + if (strcmp(card->cfg_name, card_configs[i].name) == 0) + { + card->ports = card_configs[i].ports; // default + } + + verbose("Number of ports set to: %d using framebuffer's default.\n", card->ports); + } + + + sprintf(name, "ATY,%s", card->cfg_name); + aty_name.type = kStr; + aty_name.size = strlen(name) + 1; + aty_name.data = (uint8_t *)name; + + sprintf(name_parent, "ATY,%sParent", card->cfg_name); + aty_nameparent.type = kStr; + aty_nameparent.size = strlen(name_parent) + 1; + aty_nameparent.data = (uint8_t *)name_parent; + + return true; +} + +bool setup_ati_devprop(pci_dt_t *ati_dev) +{ + char *devicepath; + + if (!init_card(ati_dev)) + { + return false; + } + + // ------------------------------------------------- + // Find a better way to do this (in device_inject.c) + if (!string) + { + string = devprop_create_string(); + } + devicepath = get_pci_dev_path(ati_dev); + card->device = devprop_add_device(string, devicepath); + if (!card->device) + { + return false; + } + // ------------------------------------------------- + +#if 0 + uint64_t fb = (uint32_t)card->fb; + uint64_t mmio = (uint32_t)card->mmio; + uint64_t io = (uint32_t)card->io; + devprop_add_value(card->device, "ATY,FrameBufferOffset", &fb, 8); + devprop_add_value(card->device, "ATY,RegisterSpaceOffset", &mmio, 8); + devprop_add_value(card->device, "ATY,IOSpaceOffset", &io, 8); +#endif + + devprop_add_list(ati_devprop_list); + + // ------------------------------------------------- + // Find a better way to do this (in device_inject.c) + //Azi: XXX tried to fix a malloc error in vain; this is related to XCode 4 compilation! + stringdata = malloc(sizeof(uint8_t) * string->length); + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + // ------------------------------------------------- + + verbose("%s %dMB [%04x:%04x] (subsys [%04x:%04x]) (%s:%s) :: %s\n", + chip_family_name[card->info->chip_family], card->info->model_name, + (uint32_t)(card->vram_size / (1024 * 1024)), card->cfg_name, + ati_dev->vendor_id, ati_dev->device_id, + ati_dev->subsys_id.subsys.vendor_id, ati_dev->subsys_id.subsys.device_id, + chip_family_name[card->info->chip_family], card->cfg_name, + devicepath); + + free(card); + + return true; +} diff --git a/i386/libsaio/.svn/text-base/ati.h.svn-base b/i386/libsaio/.svn/text-base/ati.h.svn-base new file mode 100644 index 0000000..c6b6d39 --- /dev/null +++ b/i386/libsaio/.svn/text-base/ati.h.svn-base @@ -0,0 +1,253 @@ +// +// ati.h +// Chameleon +// +// Created by Chris Morton on 1/30/13. +// +// + +#ifndef Chameleon_ati_h +#define Chameleon_ati_h + +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "device_inject.h" +#include "ati_reg.h" + + + +/* DEFINES */ +#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e + +#define Reg32(reg) (*(volatile uint32_t *)(card->mmio + reg)) +#define RegRead32(reg) (Reg32(reg)) +#define RegWrite32(reg, value) (Reg32(reg) = value) + +/* Flags */ +#define MKFLAG(n) (1 << n) +#define FLAGTRUE MKFLAG(0) +#define EVERGREEN MKFLAG(1) + +#define DATVAL(x) {kPtr, sizeof(x), (uint8_t *)x} +#define STRVAL(x) {kStr, sizeof(x), (uint8_t *)x} +#define BYTVAL(x) {kCst, 1, (uint8_t *)x} +#define WRDVAL(x) {kCst, 2, (uint8_t *)x} +#define DWRVAL(x) {kCst, 4, (uint8_t *)x} +#define QWRVAL(x) {kCst, 8, (uint8_t *)x} +#define NULVAL {kNul, 0, (uint8_t *)NULL} + + +/*Typedefs ENUMS*/ +typedef enum { + kNul, + kStr, + kPtr, + kCst +} type_t; + +typedef enum { + CHIP_FAMILY_UNKNOW, + /* Old */ + CHIP_FAMILY_R420, + CHIP_FAMILY_RV410, + CHIP_FAMILY_RV515, + CHIP_FAMILY_R520, + CHIP_FAMILY_RV530, + CHIP_FAMILY_RV560, + CHIP_FAMILY_RV570, + CHIP_FAMILY_R580, + /* IGP */ + CHIP_FAMILY_RS600, + CHIP_FAMILY_RS690, + CHIP_FAMILY_RS740, + CHIP_FAMILY_RS780, + CHIP_FAMILY_RS880, + /* R600 */ + CHIP_FAMILY_R600, + CHIP_FAMILY_RV610, + CHIP_FAMILY_RV620, + CHIP_FAMILY_RV630, + CHIP_FAMILY_RV635, + CHIP_FAMILY_RV670, + /* R700 */ + CHIP_FAMILY_RV710, + CHIP_FAMILY_RV730, + CHIP_FAMILY_RV740, + CHIP_FAMILY_RV770, + CHIP_FAMILY_RV772, + CHIP_FAMILY_RV790, + /* Evergreen */ + CHIP_FAMILY_CEDAR, + CHIP_FAMILY_CYPRESS, + CHIP_FAMILY_HEMLOCK, + CHIP_FAMILY_JUNIPER, + CHIP_FAMILY_REDWOOD, + CHIP_FAMILY_BROADWAY, + // CHIP_FAMILY_MADISON, + // CHIP_FAMILY_PARK, + /* Northern Islands */ + // CHIP_FAMILY_ANTILLES, + CHIP_FAMILY_BARTS, + CHIP_FAMILY_CAICOS, + CHIP_FAMILY_CAYMAN, + CHIP_FAMILY_TURKS, + /* Southern Islands */ + CHIP_FAMILY_TAHITI, + CHIP_FAMILY_PITCAIRN, + CHIP_FAMILY_VERDE, + CHIP_FAMILY_THAMES, + CHIP_FAMILY_LOMBOK, + // CHIP_FAMILY_NEWZEALAND, + CHIP_FAMILY_LAST +} ati_chip_family_t; + +typedef enum { + kNull, + /* OLDController */ + kWormy, + kAlopias, + kCaretta, + kKakapo, + kKipunji, + kPeregrine, + kRaven, + kSphyrna, + /* AMD2400Controller */ + kIago, + /* AMD2600Controller */ + kHypoprion, + kLamna, + /* AMD3800Controller */ + kMegalodon, + kTriakis, + /* AMD4600Controller */ + kFlicker, + kGliff, + kShrike, + /* AMD4800Controller */ + kCardinal, + kMotmot, + kQuail, + /* AMD5000Controller */ + kDouc, + kLangur, + kUakari, + kZonalis, + kAlouatta, + kHoolock, + kVervet, + kBaboon, + kEulemur, + kGalago, + kColobus, + kMangabey, + kNomascus, + kOrangutan, + /* AMD6000Controller */ + kPithecia, + kBulrushes, + kCattail, + kHydrilla, + kDuckweed, + kFanwort, + kElodea, + kKudzu, + kGibba, + kLotus, + kIpomoea, + kMuskgrass, + kJuncus, + kOsmunda, + kPondweed, + kSpikerush, + kTypha, + /* AMD7000Controller */ + kAji, // TESTING + kBuri, // TESTING + kChutoro, // TESTING + kDashimaki, // TESTING + kEbi, // TESTING + kGari, // TESTING + kFutomaki, // TESTING + kHamachi, // TESTING + kOPM, // TESTING + kIkura, // TESTING + kIkuraS, // TESTING + kCfgEnd +} ati_config_name_t; + +/* Typedefs STRUCTS */ +typedef struct { + type_t type; + uint32_t size; + uint8_t *data; +} value_t; + +//card to #ports +typedef struct { + const char *name; + uint8_t ports; +} card_config_t; + +//radeon card (includes teh AtiConfig) +typedef struct { + uint16_t device_id; + uint32_t subsys_id; + ati_chip_family_t chip_family; + const char *model_name; + ati_config_name_t cfg_name; +} radeon_card_info_t; + +// dev_tree representation +typedef struct { + uint32_t flags; + bool all_ports; + char *name; + bool (*get_value)(value_t *val); + value_t default_val; +} dev_prop_t; + +typedef struct { + struct DevPropDevice *device; + radeon_card_info_t *info; + pci_dt_t *pci_dev; + uint8_t *fb; + uint8_t *mmio; + uint8_t *io; + uint8_t *rom; + uint64_t rom_size; + uint64_t vram_size; + const char *cfg_name; + uint8_t ports; + uint32_t flags; + bool posted; +} card_t; + + + +/* functions */ +bool get_bootdisplay_val(value_t *val); +bool get_vrammemory_val(value_t *val); +bool get_name_val(value_t *val); +bool get_nameparent_val(value_t *val); +bool get_model_val(value_t *val); +bool get_conntype_val(value_t *val); +bool get_vrammemsize_val(value_t *val); +bool get_binimage_val(value_t *val); +bool get_romrevision_val(value_t *val); +bool get_deviceid_val(value_t *val); +bool get_mclk_val(value_t *val); +bool get_sclk_val(value_t *val); +bool get_refclk_val(value_t *val); +bool get_platforminfo_val(value_t *val); +bool get_vramtotalsize_val(value_t *val); +bool get_hdmiaudio(value_t * val); + +/* vals */ +static value_t aty_name; +static value_t aty_nameparent; +card_t *card; + +#endif diff --git a/i386/libsaio/.svn/text-base/ati_reg.h.svn-base b/i386/libsaio/.svn/text-base/ati_reg.h.svn-base new file mode 100644 index 0000000..46a072d --- /dev/null +++ b/i386/libsaio/.svn/text-base/ati_reg.h.svn-base @@ -0,0 +1,5672 @@ +/* + * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and + * VA Linux Systems Inc., Fremont, California. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation on the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR + * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/* + * Authors: + * Kevin E. Martin <martin@xfree86.org> + * Rickard E. Faith <faith@valinux.com> + * Alan Hourihane <alanh@fairlite.demon.co.uk> + * + * References: + * + * !!!! FIXME !!!! + * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical + * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April + * 1999. + * + * !!!! FIXME !!!! + * RAGE 128 Software Development Manual (Technical Reference Manual P/N + * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999. + * + */ + +/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h + * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT + * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */ + +#ifndef _ATI_REG_H_ +#define _ATI_REG_H_ + +#define ATI_DATATYPE_VQ 0 +#define ATI_DATATYPE_CI4 1 +#define ATI_DATATYPE_CI8 2 +#define ATI_DATATYPE_ARGB1555 3 +#define ATI_DATATYPE_RGB565 4 +#define ATI_DATATYPE_RGB888 5 +#define ATI_DATATYPE_ARGB8888 6 +#define ATI_DATATYPE_RGB332 7 +#define ATI_DATATYPE_Y8 8 +#define ATI_DATATYPE_RGB8 9 +#define ATI_DATATYPE_CI16 10 +#define ATI_DATATYPE_VYUY_422 11 +#define ATI_DATATYPE_YVYU_422 12 +#define ATI_DATATYPE_AYUV_444 14 +#define ATI_DATATYPE_ARGB4444 15 + + /* Registers for 2D/Video/Overlay */ +#define RADEON_ADAPTER_ID 0x0f2c /* PCI */ +#define RADEON_AGP_BASE 0x0170 +#define RADEON_AGP_CNTL 0x0174 +# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0) +# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0) +# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0) +# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0) +# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0) +# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0) +# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0) +# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0) +#define RADEON_STATUS_PCI_CONFIG 0x06 +# define RADEON_CAP_LIST 0x100000 +#define RADEON_CAPABILITIES_PTR_PCI_CONFIG 0x34 /* offset in PCI config*/ +# define RADEON_CAP_PTR_MASK 0xfc /* mask off reserved bits of CAP_PTR */ +# define RADEON_CAP_ID_NULL 0x00 /* End of capability list */ +# define RADEON_CAP_ID_AGP 0x02 /* AGP capability ID */ +# define RADEON_CAP_ID_EXP 0x10 /* PCI Express */ +#define RADEON_AGP_COMMAND 0x0f60 /* PCI */ +#define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/ +# define RADEON_AGP_ENABLE (1<<8) +#define RADEON_AGP_PLL_CNTL 0x000b /* PLL */ +#define RADEON_AGP_STATUS 0x0f5c /* PCI */ +# define RADEON_AGP_1X_MODE 0x01 +# define RADEON_AGP_2X_MODE 0x02 +# define RADEON_AGP_4X_MODE 0x04 +# define RADEON_AGP_FW_MODE 0x10 +# define RADEON_AGP_MODE_MASK 0x17 +# define RADEON_AGPv3_MODE 0x08 +# define RADEON_AGPv3_4X_MODE 0x01 +# define RADEON_AGPv3_8X_MODE 0x02 +#define RADEON_ATTRDR 0x03c1 /* VGA */ +#define RADEON_ATTRDW 0x03c0 /* VGA */ +#define RADEON_ATTRX 0x03c0 /* VGA */ +#define RADEON_AUX_WINDOW_HORZ_CNTL 0x02d8 +#define RADEON_AUX_WINDOW_VERT_CNTL 0x02dc + +#define RADEON_BASE_CODE 0x0f0b +#define RADEON_BIOS_0_SCRATCH 0x0010 +# define RADEON_FP_PANEL_SCALABLE (1 << 16) +# define RADEON_FP_PANEL_SCALE_EN (1 << 17) +# define RADEON_FP_CHIP_SCALE_EN (1 << 18) +# define RADEON_DRIVER_BRIGHTNESS_EN (1 << 26) +# define RADEON_DISPLAY_ROT_MASK (3 << 28) +# define RADEON_DISPLAY_ROT_00 (0 << 28) +# define RADEON_DISPLAY_ROT_90 (1 << 28) +# define RADEON_DISPLAY_ROT_180 (2 << 28) +# define RADEON_DISPLAY_ROT_270 (3 << 28) +#define RADEON_BIOS_1_SCRATCH 0x0014 +#define RADEON_BIOS_2_SCRATCH 0x0018 +#define RADEON_BIOS_3_SCRATCH 0x001c +#define RADEON_BIOS_4_SCRATCH 0x0020 +# define RADEON_CRT1_ATTACHED_MASK (3 << 0) +# define RADEON_CRT1_ATTACHED_MONO (1 << 0) +# define RADEON_CRT1_ATTACHED_COLOR (2 << 0) +# define RADEON_LCD1_ATTACHED (1 << 2) +# define RADEON_DFP1_ATTACHED (1 << 3) +# define RADEON_TV1_ATTACHED_MASK (3 << 4) +# define RADEON_TV1_ATTACHED_COMP (1 << 4) +# define RADEON_TV1_ATTACHED_SVIDEO (2 << 4) +# define RADEON_CRT2_ATTACHED_MASK (3 << 8) +# define RADEON_CRT2_ATTACHED_MONO (1 << 8) +# define RADEON_CRT2_ATTACHED_COLOR (2 << 8) +# define RADEON_DFP2_ATTACHED (1 << 11) +#define RADEON_BIOS_5_SCRATCH 0x0024 +# define RADEON_LCD1_ON (1 << 0) +# define RADEON_CRT1_ON (1 << 1) +# define RADEON_TV1_ON (1 << 2) +# define RADEON_DFP1_ON (1 << 3) +# define RADEON_CRT2_ON (1 << 5) +# define RADEON_CV1_ON (1 << 6) +# define RADEON_DFP2_ON (1 << 7) +# define RADEON_LCD1_CRTC_MASK (1 << 8) +# define RADEON_LCD1_CRTC_SHIFT 8 +# define RADEON_CRT1_CRTC_MASK (1 << 9) +# define RADEON_CRT1_CRTC_SHIFT 9 +# define RADEON_TV1_CRTC_MASK (1 << 10) +# define RADEON_TV1_CRTC_SHIFT 10 +# define RADEON_DFP1_CRTC_MASK (1 << 11) +# define RADEON_DFP1_CRTC_SHIFT 11 +# define RADEON_CRT2_CRTC_MASK (1 << 12) +# define RADEON_CRT2_CRTC_SHIFT 12 +# define RADEON_CV1_CRTC_MASK (1 << 13) +# define RADEON_CV1_CRTC_SHIFT 13 +# define RADEON_DFP2_CRTC_MASK (1 << 14) +# define RADEON_DFP2_CRTC_SHIFT 14 +#define RADEON_BIOS_6_SCRATCH 0x0028 +# define RADEON_ACC_MODE_CHANGE (1 << 2) +# define RADEON_EXT_DESKTOP_MODE (1 << 3) +# define RADEON_LCD_DPMS_ON (1 << 20) +# define RADEON_CRT_DPMS_ON (1 << 21) +# define RADEON_TV_DPMS_ON (1 << 22) +# define RADEON_DFP_DPMS_ON (1 << 23) +# define RADEON_DPMS_MASK (3 << 24) +# define RADEON_DPMS_ON (0 << 24) +# define RADEON_DPMS_STANDBY (1 << 24) +# define RADEON_DPMS_SUSPEND (2 << 24) +# define RADEON_DPMS_OFF (3 << 24) +# define RADEON_SCREEN_BLANKING (1 << 26) +# define RADEON_DRIVER_CRITICAL (1 << 27) +# define RADEON_DISPLAY_SWITCHING_DIS (1 << 30) +#define RADEON_BIOS_7_SCRATCH 0x002c +# define RADEON_SYS_HOTKEY (1 << 10) +# define RADEON_DRV_LOADED (1 << 12) +#define RADEON_BIOS_ROM 0x0f30 /* PCI */ +#define RADEON_BIST 0x0f0f /* PCI */ +#define RADEON_BRUSH_DATA0 0x1480 +#define RADEON_BRUSH_DATA1 0x1484 +#define RADEON_BRUSH_DATA10 0x14a8 +#define RADEON_BRUSH_DATA11 0x14ac +#define RADEON_BRUSH_DATA12 0x14b0 +#define RADEON_BRUSH_DATA13 0x14b4 +#define RADEON_BRUSH_DATA14 0x14b8 +#define RADEON_BRUSH_DATA15 0x14bc +#define RADEON_BRUSH_DATA16 0x14c0 +#define RADEON_BRUSH_DATA17 0x14c4 +#define RADEON_BRUSH_DATA18 0x14c8 +#define RADEON_BRUSH_DATA19 0x14cc +#define RADEON_BRUSH_DATA2 0x1488 +#define RADEON_BRUSH_DATA20 0x14d0 +#define RADEON_BRUSH_DATA21 0x14d4 +#define RADEON_BRUSH_DATA22 0x14d8 +#define RADEON_BRUSH_DATA23 0x14dc +#define RADEON_BRUSH_DATA24 0x14e0 +#define RADEON_BRUSH_DATA25 0x14e4 +#define RADEON_BRUSH_DATA26 0x14e8 +#define RADEON_BRUSH_DATA27 0x14ec +#define RADEON_BRUSH_DATA28 0x14f0 +#define RADEON_BRUSH_DATA29 0x14f4 +#define RADEON_BRUSH_DATA3 0x148c +#define RADEON_BRUSH_DATA30 0x14f8 +#define RADEON_BRUSH_DATA31 0x14fc +#define RADEON_BRUSH_DATA32 0x1500 +#define RADEON_BRUSH_DATA33 0x1504 +#define RADEON_BRUSH_DATA34 0x1508 +#define RADEON_BRUSH_DATA35 0x150c +#define RADEON_BRUSH_DATA36 0x1510 +#define RADEON_BRUSH_DATA37 0x1514 +#define RADEON_BRUSH_DATA38 0x1518 +#define RADEON_BRUSH_DATA39 0x151c +#define RADEON_BRUSH_DATA4 0x1490 +#define RADEON_BRUSH_DATA40 0x1520 +#define RADEON_BRUSH_DATA41 0x1524 +#define RADEON_BRUSH_DATA42 0x1528 +#define RADEON_BRUSH_DATA43 0x152c +#define RADEON_BRUSH_DATA44 0x1530 +#define RADEON_BRUSH_DATA45 0x1534 +#define RADEON_BRUSH_DATA46 0x1538 +#define RADEON_BRUSH_DATA47 0x153c +#define RADEON_BRUSH_DATA48 0x1540 +#define RADEON_BRUSH_DATA49 0x1544 +#define RADEON_BRUSH_DATA5 0x1494 +#define RADEON_BRUSH_DATA50 0x1548 +#define RADEON_BRUSH_DATA51 0x154c +#define RADEON_BRUSH_DATA52 0x1550 +#define RADEON_BRUSH_DATA53 0x1554 +#define RADEON_BRUSH_DATA54 0x1558 +#define RADEON_BRUSH_DATA55 0x155c +#define RADEON_BRUSH_DATA56 0x1560 +#define RADEON_BRUSH_DATA57 0x1564 +#define RADEON_BRUSH_DATA58 0x1568 +#define RADEON_BRUSH_DATA59 0x156c +#define RADEON_BRUSH_DATA6 0x1498 +#define RADEON_BRUSH_DATA60 0x1570 +#define RADEON_BRUSH_DATA61 0x1574 +#define RADEON_BRUSH_DATA62 0x1578 +#define RADEON_BRUSH_DATA63 0x157c +#define RADEON_BRUSH_DATA7 0x149c +#define RADEON_BRUSH_DATA8 0x14a0 +#define RADEON_BRUSH_DATA9 0x14a4 +#define RADEON_BRUSH_SCALE 0x1470 +#define RADEON_BRUSH_Y_X 0x1474 +#define RADEON_BUS_CNTL 0x0030 +# define RADEON_BUS_MASTER_DIS (1 << 6) +# define RADEON_BUS_BIOS_DIS_ROM (1 << 12) +# define RADEON_BUS_RD_DISCARD_EN (1 << 24) +# define RADEON_BUS_RD_ABORT_EN (1 << 25) +# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28) +# define RADEON_BUS_WRT_BURST (1 << 29) +# define RADEON_BUS_READ_BURST (1 << 30) +#define RADEON_BUS_CNTL1 0x0034 +# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) + +#define RADEON_PCIE_INDEX 0x0030 +#define RADEON_PCIE_DATA 0x0034 +#define R600_PCIE_PORT_INDEX 0x0038 +#define R600_PCIE_PORT_DATA 0x003c +/* PCIE_LC_LINK_WIDTH_CNTL is PCIE on r1xx-r5xx, PCIE_PORT on r6xx-r7xx */ +#define RADEON_PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE */ +# define RADEON_PCIE_LC_LINK_WIDTH_SHIFT 0 +# define RADEON_PCIE_LC_LINK_WIDTH_MASK 0x7 +# define RADEON_PCIE_LC_LINK_WIDTH_X0 0 +# define RADEON_PCIE_LC_LINK_WIDTH_X1 1 +# define RADEON_PCIE_LC_LINK_WIDTH_X2 2 +# define RADEON_PCIE_LC_LINK_WIDTH_X4 3 +# define RADEON_PCIE_LC_LINK_WIDTH_X8 4 +# define RADEON_PCIE_LC_LINK_WIDTH_X12 5 +# define RADEON_PCIE_LC_LINK_WIDTH_X16 6 +# define RADEON_PCIE_LC_LINK_WIDTH_RD_SHIFT 4 +# define RADEON_PCIE_LC_LINK_WIDTH_RD_MASK 0x70 +# define R600_PCIE_LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) +# define RADEON_PCIE_LC_RECONFIG_NOW (1 << 8) +# define RADEON_PCIE_LC_RECONFIG_LATER (1 << 9) +# define RADEON_PCIE_LC_SHORT_RECONFIG_EN (1 << 10) +# define R600_PCIE_LC_RENEGOTIATE_EN (1 << 10) +# define R600_PCIE_LC_SHORT_RECONFIG_EN (1 << 11) +#define R600_TARGET_AND_CURRENT_PROFILE_INDEX 0x70c +#define R700_TARGET_AND_CURRENT_PROFILE_INDEX 0x66c + +#define RADEON_CACHE_CNTL 0x1724 +#define RADEON_CACHE_LINE 0x0f0c /* PCI */ +#define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */ +#define RADEON_CAPABILITIES_PTR 0x0f34 /* PCI */ +#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */ +# define RADEON_DONT_USE_XTALIN (1 << 4) +# define RADEON_SCLK_DYN_START_CNTL (1 << 15) +#define RADEON_CLOCK_CNTL_DATA 0x000c +#define RADEON_CLOCK_CNTL_INDEX 0x0008 +# define RADEON_PLL_WR_EN (1 << 7) +# define RADEON_PLL_DIV_SEL (3 << 8) +# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8) +#define RADEON_M_SPLL_REF_FB_DIV 0x000a /* PLL */ +# define RADEON_M_SPLL_REF_DIV_MASK 0xff +# define RADEON_M_SPLL_REF_DIV_SHIFT 0 +# define RADEON_MPLL_FB_DIV_MASK 0xff +# define RADEON_MPLL_FB_DIV_SHIFT 8 +# define RADEON_SPLL_FB_DIV_MASK 0xff +# define RADEON_SPLL_FB_DIV_SHIFT 16 +#define RADEON_SPLL_CNTL 0x000c /* PLL */ +# define RADEON_SPLL_SLEEP (1 << 0) +# define RADEON_SPLL_RESET (1 << 1) +# define RADEON_SPLL_PCP_MASK 0x7 +# define RADEON_SPLL_PCP_SHIFT 8 +# define RADEON_SPLL_PVG_MASK 0x7 +# define RADEON_SPLL_PVG_SHIFT 11 +# define RADEON_SPLL_PDC_MASK 0x3 +# define RADEON_SPLL_PDC_SHIFT 14 +#define RADEON_CLK_PWRMGT_CNTL 0x0014 /* PLL */ +# define RADEON_ENGIN_DYNCLK_MODE (1 << 12) +# define RADEON_ACTIVE_HILO_LAT_MASK (3 << 13) +# define RADEON_ACTIVE_HILO_LAT_SHIFT 13 +# define RADEON_DISP_DYN_STOP_LAT_MASK (1 << 12) +# define RADEON_MC_BUSY (1 << 16) +# define RADEON_DLL_READY (1 << 19) +# define RADEON_CG_NO1_DEBUG_0 (1 << 24) +# define RADEON_CG_NO1_DEBUG_MASK (0x1f << 24) +# define RADEON_DYN_STOP_MODE_MASK (7 << 21) +# define RADEON_TVPLL_PWRMGT_OFF (1 << 30) +# define RADEON_TVCLK_TURNOFF (1 << 31) +#define RADEON_PLL_PWRMGT_CNTL 0x0015 /* PLL */ +# define RADEON_TCL_BYPASS_DISABLE (1 << 20) +#define RADEON_CLR_CMP_CLR_3D 0x1a24 +#define RADEON_CLR_CMP_CLR_DST 0x15c8 +#define RADEON_CLR_CMP_CLR_SRC 0x15c4 +#define RADEON_CLR_CMP_CNTL 0x15c0 +# define RADEON_SRC_CMP_EQ_COLOR (4 << 0) +# define RADEON_SRC_CMP_NEQ_COLOR (5 << 0) +# define RADEON_CLR_CMP_SRC_SOURCE (1 << 24) +#define RADEON_CLR_CMP_MASK 0x15cc +# define RADEON_CLR_CMP_MSK 0xffffffff +#define RADEON_CLR_CMP_MASK_3D 0x1A28 +#define RADEON_COMMAND 0x0f04 /* PCI */ +#define RADEON_COMPOSITE_SHADOW_ID 0x1a0c +#define RADEON_CONFIG_APER_0_BASE 0x0100 +#define RADEON_CONFIG_APER_1_BASE 0x0104 +#define RADEON_CONFIG_APER_SIZE 0x0108 +#define RADEON_CONFIG_BONDS 0x00e8 +#define RADEON_CONFIG_CNTL 0x00e0 +# define RADEON_CFG_ATI_REV_A11 (0 << 16) +# define RADEON_CFG_ATI_REV_A12 (1 << 16) +# define RADEON_CFG_ATI_REV_A13 (2 << 16) +# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16) +#define RADEON_CONFIG_MEMSIZE 0x00f8 +#define RADEON_CONFIG_MEMSIZE_EMBEDDED 0x0114 +#define RADEON_CONFIG_REG_1_BASE 0x010c +#define RADEON_CONFIG_REG_APER_SIZE 0x0110 +#define RADEON_CONFIG_XSTRAP 0x00e4 +#define RADEON_CONSTANT_COLOR_C 0x1d34 +# define RADEON_CONSTANT_COLOR_MASK 0x00ffffff +# define RADEON_CONSTANT_COLOR_ONE 0x00ffffff +# define RADEON_CONSTANT_COLOR_ZERO 0x00000000 +#define RADEON_CRC_CMDFIFO_ADDR 0x0740 +#define RADEON_CRC_CMDFIFO_DOUT 0x0744 +#define RADEON_GRPH_BUFFER_CNTL 0x02f0 +# define RADEON_GRPH_START_REQ_MASK (0x7f) +# define RADEON_GRPH_START_REQ_SHIFT 0 +# define RADEON_GRPH_STOP_REQ_MASK (0x7f<<8) +# define RADEON_GRPH_STOP_REQ_SHIFT 8 +# define RADEON_GRPH_CRITICAL_POINT_MASK (0x7f<<16) +# define RADEON_GRPH_CRITICAL_POINT_SHIFT 16 +# define RADEON_GRPH_CRITICAL_CNTL (1<<28) +# define RADEON_GRPH_BUFFER_SIZE (1<<29) +# define RADEON_GRPH_CRITICAL_AT_SOF (1<<30) +# define RADEON_GRPH_STOP_CNTL (1<<31) +#define RADEON_GRPH2_BUFFER_CNTL 0x03f0 +# define RADEON_GRPH2_START_REQ_MASK (0x7f) +# define RADEON_GRPH2_START_REQ_SHIFT 0 +# define RADEON_GRPH2_STOP_REQ_MASK (0x7f<<8) +# define RADEON_GRPH2_STOP_REQ_SHIFT 8 +# define RADEON_GRPH2_CRITICAL_POINT_MASK (0x7f<<16) +# define RADEON_GRPH2_CRITICAL_POINT_SHIFT 16 +# define RADEON_GRPH2_CRITICAL_CNTL (1<<28) +# define RADEON_GRPH2_BUFFER_SIZE (1<<29) +# define RADEON_GRPH2_CRITICAL_AT_SOF (1<<30) +# define RADEON_GRPH2_STOP_CNTL (1<<31) +#define RADEON_CRTC_CRNT_FRAME 0x0214 +#define RADEON_CRTC_EXT_CNTL 0x0054 +# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0) +# define RADEON_VGA_ATI_LINEAR (1 << 3) +# define RADEON_XCRT_CNT_EN (1 << 6) +# define RADEON_CRTC_HSYNC_DIS (1 << 8) +# define RADEON_CRTC_VSYNC_DIS (1 << 9) +# define RADEON_CRTC_DISPLAY_DIS (1 << 10) +# define RADEON_CRTC_SYNC_TRISTAT (1 << 11) +# define RADEON_CRTC_CRT_ON (1 << 15) +#define RADEON_CRTC_EXT_CNTL_DPMS_BYTE 0x0055 +# define RADEON_CRTC_HSYNC_DIS_BYTE (1 << 0) +# define RADEON_CRTC_VSYNC_DIS_BYTE (1 << 1) +# define RADEON_CRTC_DISPLAY_DIS_BYTE (1 << 2) +#define RADEON_CRTC_GEN_CNTL 0x0050 +# define RADEON_CRTC_DBL_SCAN_EN (1 << 0) +# define RADEON_CRTC_INTERLACE_EN (1 << 1) +# define RADEON_CRTC_CSYNC_EN (1 << 4) +# define RADEON_CRTC_ICON_EN (1 << 15) +# define RADEON_CRTC_CUR_EN (1 << 16) +# define RADEON_CRTC_CUR_MODE_MASK (7 << 20) +# define RADEON_CRTC_EXT_DISP_EN (1 << 24) +# define RADEON_CRTC_EN (1 << 25) +# define RADEON_CRTC_DISP_REQ_EN_B (1 << 26) +#define RADEON_CRTC2_GEN_CNTL 0x03f8 +# define RADEON_CRTC2_DBL_SCAN_EN (1 << 0) +# define RADEON_CRTC2_INTERLACE_EN (1 << 1) +# define RADEON_CRTC2_SYNC_TRISTAT (1 << 4) +# define RADEON_CRTC2_HSYNC_TRISTAT (1 << 5) +# define RADEON_CRTC2_VSYNC_TRISTAT (1 << 6) +# define RADEON_CRTC2_CRT2_ON (1 << 7) +# define RADEON_CRTC2_PIX_WIDTH_SHIFT 8 +# define RADEON_CRTC2_PIX_WIDTH_MASK (0xf << 8) +# define RADEON_CRTC2_ICON_EN (1 << 15) +# define RADEON_CRTC2_CUR_EN (1 << 16) +# define RADEON_CRTC2_CUR_MODE_MASK (7 << 20) +# define RADEON_CRTC2_DISP_DIS (1 << 23) +# define RADEON_CRTC2_EN (1 << 25) +# define RADEON_CRTC2_DISP_REQ_EN_B (1 << 26) +# define RADEON_CRTC2_CSYNC_EN (1 << 27) +# define RADEON_CRTC2_HSYNC_DIS (1 << 28) +# define RADEON_CRTC2_VSYNC_DIS (1 << 29) +#define RADEON_CRTC_MORE_CNTL 0x27c +# define RADEON_CRTC_AUTO_HORZ_CENTER_EN (1<<2) +# define RADEON_CRTC_AUTO_VERT_CENTER_EN (1<<3) +# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4) +# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5) +#define RADEON_CRTC_GUI_TRIG_VLINE 0x0218 +# define RADEON_CRTC_GUI_TRIG_VLINE_START_SHIFT 0 +# define RADEON_CRTC_GUI_TRIG_VLINE_INV (1 << 15) +# define RADEON_CRTC_GUI_TRIG_VLINE_END_SHIFT 16 +# define RADEON_CRTC_GUI_TRIG_VLINE_STALL (1 << 30) +#define RADEON_CRTC_H_SYNC_STRT_WID 0x0204 +# define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0) +# define RADEON_CRTC_H_SYNC_STRT_CHAR (0x3ff << 3) +# define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3 +# define RADEON_CRTC_H_SYNC_WID (0x3f << 16) +# define RADEON_CRTC_H_SYNC_WID_SHIFT 16 +# define RADEON_CRTC_H_SYNC_POL (1 << 23) +#define RADEON_CRTC2_H_SYNC_STRT_WID 0x0304 +# define RADEON_CRTC2_H_SYNC_STRT_PIX (0x07 << 0) +# define RADEON_CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3) +# define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3 +# define RADEON_CRTC2_H_SYNC_WID (0x3f << 16) +# define RADEON_CRTC2_H_SYNC_WID_SHIFT 16 +# define RADEON_CRTC2_H_SYNC_POL (1 << 23) +#define RADEON_CRTC_H_TOTAL_DISP 0x0200 +# define RADEON_CRTC_H_TOTAL (0x03ff << 0) +# define RADEON_CRTC_H_TOTAL_SHIFT 0 +# define RADEON_CRTC_H_DISP (0x01ff << 16) +# define RADEON_CRTC_H_DISP_SHIFT 16 +#define RADEON_CRTC2_H_TOTAL_DISP 0x0300 +# define RADEON_CRTC2_H_TOTAL (0x03ff << 0) +# define RADEON_CRTC2_H_TOTAL_SHIFT 0 +# define RADEON_CRTC2_H_DISP (0x01ff << 16) +# define RADEON_CRTC2_H_DISP_SHIFT 16 + +#define RADEON_CRTC_OFFSET_RIGHT 0x0220 +#define RADEON_CRTC_OFFSET 0x0224 +# define RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET (1<<30) +# define RADEON_CRTC_OFFSET__OFFSET_LOCK (1<<31) + +#define RADEON_CRTC2_OFFSET 0x0324 +# define RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET (1<<30) +# define RADEON_CRTC2_OFFSET__OFFSET_LOCK (1<<31) +#define RADEON_CRTC_OFFSET_CNTL 0x0228 +# define RADEON_CRTC_TILE_LINE_SHIFT 0 +# define RADEON_CRTC_TILE_LINE_RIGHT_SHIFT 4 +# define R300_CRTC_X_Y_MODE_EN_RIGHT (1 << 6) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_MASK (3 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_AUTO (0 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_SINGLE (1 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DOUBLE (2 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DIS (3 << 7) +# define R300_CRTC_X_Y_MODE_EN (1 << 9) +# define R300_CRTC_MICRO_TILE_BUFFER_MASK (3 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_AUTO (0 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_SINGLE (1 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_DOUBLE (2 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_DIS (3 << 10) +# define R300_CRTC_MICRO_TILE_EN_RIGHT (1 << 12) +# define R300_CRTC_MICRO_TILE_EN (1 << 13) +# define R300_CRTC_MACRO_TILE_EN_RIGHT (1 << 14) +# define R300_CRTC_MACRO_TILE_EN (1 << 15) +# define RADEON_CRTC_TILE_EN_RIGHT (1 << 14) +# define RADEON_CRTC_TILE_EN (1 << 15) +# define RADEON_CRTC_OFFSET_FLIP_CNTL (1 << 16) +# define RADEON_CRTC_STEREO_OFFSET_EN (1 << 17) + +#define R300_CRTC_TILE_X0_Y0 0x0350 +#define R300_CRTC2_TILE_X0_Y0 0x0358 + +#define RADEON_CRTC2_OFFSET_CNTL 0x0328 +# define RADEON_CRTC2_OFFSET_FLIP_CNTL (1 << 16) +# define RADEON_CRTC2_TILE_EN (1 << 15) +#define RADEON_CRTC_PITCH 0x022c +# define RADEON_CRTC_PITCH__SHIFT 0 +# define RADEON_CRTC_PITCH__RIGHT_SHIFT 16 + +#define RADEON_CRTC2_PITCH 0x032c +#define RADEON_CRTC_STATUS 0x005c +# define RADEON_CRTC_VBLANK_SAVE (1 << 1) +# define RADEON_CRTC_VBLANK_SAVE_CLEAR (1 << 1) +#define RADEON_CRTC2_STATUS 0x03fc +# define RADEON_CRTC2_VBLANK_SAVE (1 << 1) +# define RADEON_CRTC2_VBLANK_SAVE_CLEAR (1 << 1) +#define RADEON_CRTC_V_SYNC_STRT_WID 0x020c +# define RADEON_CRTC_V_SYNC_STRT (0x7ff << 0) +# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0 +# define RADEON_CRTC_V_SYNC_WID (0x1f << 16) +# define RADEON_CRTC_V_SYNC_WID_SHIFT 16 +# define RADEON_CRTC_V_SYNC_POL (1 << 23) +#define RADEON_CRTC2_V_SYNC_STRT_WID 0x030c +# define RADEON_CRTC2_V_SYNC_STRT (0x7ff << 0) +# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0 +# define RADEON_CRTC2_V_SYNC_WID (0x1f << 16) +# define RADEON_CRTC2_V_SYNC_WID_SHIFT 16 +# define RADEON_CRTC2_V_SYNC_POL (1 << 23) +#define RADEON_CRTC_V_TOTAL_DISP 0x0208 +# define RADEON_CRTC_V_TOTAL (0x07ff << 0) +# define RADEON_CRTC_V_TOTAL_SHIFT 0 +# define RADEON_CRTC_V_DISP (0x07ff << 16) +# define RADEON_CRTC_V_DISP_SHIFT 16 +#define RADEON_CRTC2_V_TOTAL_DISP 0x0308 +# define RADEON_CRTC2_V_TOTAL (0x07ff << 0) +# define RADEON_CRTC2_V_TOTAL_SHIFT 0 +# define RADEON_CRTC2_V_DISP (0x07ff << 16) +# define RADEON_CRTC2_V_DISP_SHIFT 16 +#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210 +# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16) +#define RADEON_CRTC2_CRNT_FRAME 0x0314 +#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318 +#define RADEON_CRTC2_STATUS 0x03fc +#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310 +#define RADEON_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */ +#define RADEON_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */ +#define RADEON_CUR_CLR0 0x026c +#define RADEON_CUR_CLR1 0x0270 +#define RADEON_CUR_HORZ_VERT_OFF 0x0268 +#define RADEON_CUR_HORZ_VERT_POSN 0x0264 +#define RADEON_CUR_OFFSET 0x0260 +# define RADEON_CUR_LOCK (1 << 31) +#define RADEON_CUR2_CLR0 0x036c +#define RADEON_CUR2_CLR1 0x0370 +#define RADEON_CUR2_HORZ_VERT_OFF 0x0368 +#define RADEON_CUR2_HORZ_VERT_POSN 0x0364 +#define RADEON_CUR2_OFFSET 0x0360 +# define RADEON_CUR2_LOCK (1 << 31) + +#define RADEON_DAC_CNTL 0x0058 +# define RADEON_DAC_RANGE_CNTL (3 << 0) +# define RADEON_DAC_RANGE_CNTL_PS2 (2 << 0) +# define RADEON_DAC_RANGE_CNTL_MASK 0x03 +# define RADEON_DAC_BLANKING (1 << 2) +# define RADEON_DAC_CMP_EN (1 << 3) +# define RADEON_DAC_CMP_OUTPUT (1 << 7) +# define RADEON_DAC_8BIT_EN (1 << 8) +# define RADEON_DAC_TVO_EN (1 << 10) +# define RADEON_DAC_VGA_ADR_EN (1 << 13) +# define RADEON_DAC_PDWN (1 << 15) +# define RADEON_DAC_MASK_ALL (0xff << 24) +#define RADEON_DAC_CNTL2 0x007c +# define RADEON_DAC2_TV_CLK_SEL (0 << 1) +# define RADEON_DAC2_DAC_CLK_SEL (1 << 0) +# define RADEON_DAC2_DAC2_CLK_SEL (1 << 1) +# define RADEON_DAC2_PALETTE_ACC_CTL (1 << 5) +# define RADEON_DAC2_CMP_EN (1 << 7) +# define RADEON_DAC2_CMP_OUT_R (1 << 8) +# define RADEON_DAC2_CMP_OUT_G (1 << 9) +# define RADEON_DAC2_CMP_OUT_B (1 << 10) +# define RADEON_DAC2_CMP_OUTPUT (1 << 11) +#define RADEON_DAC_EXT_CNTL 0x0280 +# define RADEON_DAC2_FORCE_BLANK_OFF_EN (1 << 0) +# define RADEON_DAC2_FORCE_DATA_EN (1 << 1) +# define RADEON_DAC_FORCE_BLANK_OFF_EN (1 << 4) +# define RADEON_DAC_FORCE_DATA_EN (1 << 5) +# define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_R (0 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_G (1 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_B (2 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_RGB (3 << 6) +# define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00 +# define RADEON_DAC_FORCE_DATA_SHIFT 8 +#define RADEON_DAC_MACRO_CNTL 0x0d04 +# define RADEON_DAC_PDWN_R (1 << 16) +# define RADEON_DAC_PDWN_G (1 << 17) +# define RADEON_DAC_PDWN_B (1 << 18) +#define RADEON_TV_DAC_CNTL 0x088c +# define RADEON_TV_DAC_NBLANK (1 << 0) +# define RADEON_TV_DAC_NHOLD (1 << 1) +# define RADEON_TV_DAC_PEDESTAL (1 << 2) +# define RADEON_TV_MONITOR_DETECT_EN (1 << 4) +# define RADEON_TV_DAC_CMPOUT (1 << 5) +# define RADEON_TV_DAC_STD_MASK (3 << 8) +# define RADEON_TV_DAC_STD_PAL (0 << 8) +# define RADEON_TV_DAC_STD_NTSC (1 << 8) +# define RADEON_TV_DAC_STD_PS2 (2 << 8) +# define RADEON_TV_DAC_STD_RS343 (3 << 8) +# define RADEON_TV_DAC_BGSLEEP (1 << 6) +# define RADEON_TV_DAC_BGADJ_MASK (0xf << 16) +# define RADEON_TV_DAC_BGADJ_SHIFT 16 +# define RADEON_TV_DAC_DACADJ_MASK (0xf << 20) +# define RADEON_TV_DAC_DACADJ_SHIFT 20 +# define RADEON_TV_DAC_RDACPD (1 << 24) +# define RADEON_TV_DAC_GDACPD (1 << 25) +# define RADEON_TV_DAC_BDACPD (1 << 26) +# define RADEON_TV_DAC_RDACDET (1 << 29) +# define RADEON_TV_DAC_GDACDET (1 << 30) +# define RADEON_TV_DAC_BDACDET (1 << 31) +# define R420_TV_DAC_DACADJ_MASK (0x1f << 20) +# define R420_TV_DAC_RDACPD (1 << 25) +# define R420_TV_DAC_GDACPD (1 << 26) +# define R420_TV_DAC_BDACPD (1 << 27) +# define R420_TV_DAC_TVENABLE (1 << 28) +#define RADEON_DISP_HW_DEBUG 0x0d14 +# define RADEON_CRT2_DISP1_SEL (1 << 5) +#define RADEON_DISP_OUTPUT_CNTL 0x0d64 +# define RADEON_DISP_DAC_SOURCE_MASK 0x03 +# define RADEON_DISP_DAC2_SOURCE_MASK 0x0c +# define RADEON_DISP_DAC_SOURCE_CRTC2 0x01 +# define RADEON_DISP_DAC_SOURCE_RMX 0x02 +# define RADEON_DISP_DAC_SOURCE_LTU 0x03 +# define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04 +# define RADEON_DISP_TVDAC_SOURCE_MASK (0x03 << 2) +# define RADEON_DISP_TVDAC_SOURCE_CRTC 0x0 +# define RADEON_DISP_TVDAC_SOURCE_CRTC2 (0x01 << 2) +# define RADEON_DISP_TVDAC_SOURCE_RMX (0x02 << 2) +# define RADEON_DISP_TVDAC_SOURCE_LTU (0x03 << 2) +# define RADEON_DISP_TRANS_MATRIX_MASK (0x03 << 4) +# define RADEON_DISP_TRANS_MATRIX_ALPHA_MSB (0x00 << 4) +# define RADEON_DISP_TRANS_MATRIX_GRAPHICS (0x01 << 4) +# define RADEON_DISP_TRANS_MATRIX_VIDEO (0x02 << 4) +# define RADEON_DISP_TV_SOURCE_CRTC (1 << 16) /* crtc1 or crtc2 */ +# define RADEON_DISP_TV_SOURCE_LTU (0 << 16) /* linear transform unit */ +#define RADEON_DISP_TV_OUT_CNTL 0x0d6c +# define RADEON_DISP_TV_PATH_SRC_CRTC2 (1 << 16) +# define RADEON_DISP_TV_PATH_SRC_CRTC1 (0 << 16) +#define RADEON_DAC_CRC_SIG 0x02cc +#define RADEON_DAC_DATA 0x03c9 /* VGA */ +#define RADEON_DAC_MASK 0x03c6 /* VGA */ +#define RADEON_DAC_R_INDEX 0x03c7 /* VGA */ +#define RADEON_DAC_W_INDEX 0x03c8 /* VGA */ +#define RADEON_DDA_CONFIG 0x02e0 +#define RADEON_DDA_ON_OFF 0x02e4 +#define RADEON_DEFAULT_OFFSET 0x16e0 +#define RADEON_DEFAULT_PITCH 0x16e4 +#define RADEON_DEFAULT_SC_BOTTOM_RIGHT 0x16e8 +# define RADEON_DEFAULT_SC_RIGHT_MAX (0x1fff << 0) +# define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16) +#define RADEON_DESTINATION_3D_CLR_CMP_VAL 0x1820 +#define RADEON_DESTINATION_3D_CLR_CMP_MSK 0x1824 +#define RADEON_DEVICE_ID 0x0f02 /* PCI */ +#define RADEON_DISP_MISC_CNTL 0x0d00 +# define RADEON_SOFT_RESET_GRPH_PP (1 << 0) +#define RADEON_DISP_MERGE_CNTL 0x0d60 +# define RADEON_DISP_ALPHA_MODE_MASK 0x03 +# define RADEON_DISP_ALPHA_MODE_KEY 0 +# define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1 +# define RADEON_DISP_ALPHA_MODE_GLOBAL 2 +# define RADEON_DISP_RGB_OFFSET_EN (1 << 8) +# define RADEON_DISP_GRPH_ALPHA_MASK (0xff << 16) +# define RADEON_DISP_OV0_ALPHA_MASK (0xff << 24) +# define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9) +#define RADEON_DISP2_MERGE_CNTL 0x0d68 +# define RADEON_DISP2_RGB_OFFSET_EN (1 << 8) +#define RADEON_DISP_LIN_TRANS_GRPH_A 0x0d80 +#define RADEON_DISP_LIN_TRANS_GRPH_B 0x0d84 +#define RADEON_DISP_LIN_TRANS_GRPH_C 0x0d88 +#define RADEON_DISP_LIN_TRANS_GRPH_D 0x0d8c +#define RADEON_DISP_LIN_TRANS_GRPH_E 0x0d90 +#define RADEON_DISP_LIN_TRANS_GRPH_F 0x0d98 +#define RADEON_DP_BRUSH_BKGD_CLR 0x1478 +#define RADEON_DP_BRUSH_FRGD_CLR 0x147c +#define RADEON_DP_CNTL 0x16c0 +# define RADEON_DST_X_LEFT_TO_RIGHT (1 << 0) +# define RADEON_DST_Y_TOP_TO_BOTTOM (1 << 1) +# define RADEON_DP_DST_TILE_LINEAR (0 << 3) +# define RADEON_DP_DST_TILE_MACRO (1 << 3) +# define RADEON_DP_DST_TILE_MICRO (2 << 3) +# define RADEON_DP_DST_TILE_BOTH (3 << 3) +#define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0 +# define RADEON_DST_Y_MAJOR (1 << 2) +# define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15) +# define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31) +#define RADEON_DP_DATATYPE 0x16c4 +# define RADEON_HOST_BIG_ENDIAN_EN (1 << 29) +#define RADEON_DP_GUI_MASTER_CNTL 0x146c +# define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0) +# define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1) +# define RADEON_GMC_SRC_CLIPPING (1 << 2) +# define RADEON_GMC_DST_CLIPPING (1 << 3) +# define RADEON_GMC_BRUSH_DATATYPE_MASK (0x0f << 4) +# define RADEON_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4) +# define RADEON_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4) +# define RADEON_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4) +# define RADEON_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4) +# define RADEON_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4) +# define RADEON_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4) +# define RADEON_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4) +# define RADEON_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4) +# define RADEON_GMC_BRUSH_8x8_COLOR (10 << 4) +# define RADEON_GMC_BRUSH_1X8_COLOR (12 << 4) +# define RADEON_GMC_BRUSH_SOLID_COLOR (13 << 4) +# define RADEON_GMC_BRUSH_NONE (15 << 4) +# define RADEON_GMC_DST_8BPP_CI (2 << 8) +# define RADEON_GMC_DST_15BPP (3 << 8) +# define RADEON_GMC_DST_16BPP (4 << 8) +# define RADEON_GMC_DST_24BPP (5 << 8) +# define RADEON_GMC_DST_32BPP (6 << 8) +# define RADEON_GMC_DST_8BPP_RGB (7 << 8) +# define RADEON_GMC_DST_Y8 (8 << 8) +# define RADEON_GMC_DST_RGB8 (9 << 8) +# define RADEON_GMC_DST_VYUY (11 << 8) +# define RADEON_GMC_DST_YVYU (12 << 8) +# define RADEON_GMC_DST_AYUV444 (14 << 8) +# define RADEON_GMC_DST_ARGB4444 (15 << 8) +# define RADEON_GMC_DST_DATATYPE_MASK (0x0f << 8) +# define RADEON_GMC_DST_DATATYPE_SHIFT 8 +# define RADEON_GMC_SRC_DATATYPE_MASK (3 << 12) +# define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12) +# define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12) +# define RADEON_GMC_SRC_DATATYPE_COLOR (3 << 12) +# define RADEON_GMC_BYTE_PIX_ORDER (1 << 14) +# define RADEON_GMC_BYTE_MSB_TO_LSB (0 << 14) +# define RADEON_GMC_BYTE_LSB_TO_MSB (1 << 14) +# define RADEON_GMC_CONVERSION_TEMP (1 << 15) +# define RADEON_GMC_CONVERSION_TEMP_6500 (0 << 15) +# define RADEON_GMC_CONVERSION_TEMP_9300 (1 << 15) +# define RADEON_GMC_ROP3_MASK (0xff << 16) +# define RADEON_DP_SRC_SOURCE_MASK (7 << 24) +# define RADEON_DP_SRC_SOURCE_MEMORY (2 << 24) +# define RADEON_DP_SRC_SOURCE_HOST_DATA (3 << 24) +# define RADEON_GMC_3D_FCN_EN (1 << 27) +# define RADEON_GMC_CLR_CMP_CNTL_DIS (1 << 28) +# define RADEON_GMC_AUX_CLIP_DIS (1 << 29) +# define RADEON_GMC_WR_MSK_DIS (1 << 30) +# define RADEON_GMC_LD_BRUSH_Y_X (1 << 31) +# define RADEON_ROP3_ZERO 0x00000000 +# define RADEON_ROP3_DSa 0x00880000 +# define RADEON_ROP3_SDna 0x00440000 +# define RADEON_ROP3_S 0x00cc0000 +# define RADEON_ROP3_DSna 0x00220000 +# define RADEON_ROP3_D 0x00aa0000 +# define RADEON_ROP3_DSx 0x00660000 +# define RADEON_ROP3_DSo 0x00ee0000 +# define RADEON_ROP3_DSon 0x00110000 +# define RADEON_ROP3_DSxn 0x00990000 +# define RADEON_ROP3_Dn 0x00550000 +# define RADEON_ROP3_SDno 0x00dd0000 +# define RADEON_ROP3_Sn 0x00330000 +# define RADEON_ROP3_DSno 0x00bb0000 +# define RADEON_ROP3_DSan 0x00770000 +# define RADEON_ROP3_ONE 0x00ff0000 +# define RADEON_ROP3_DPa 0x00a00000 +# define RADEON_ROP3_PDna 0x00500000 +# define RADEON_ROP3_P 0x00f00000 +# define RADEON_ROP3_DPna 0x000a0000 +# define RADEON_ROP3_D 0x00aa0000 +# define RADEON_ROP3_DPx 0x005a0000 +# define RADEON_ROP3_DPo 0x00fa0000 +# define RADEON_ROP3_DPon 0x00050000 +# define RADEON_ROP3_PDxn 0x00a50000 +# define RADEON_ROP3_PDno 0x00f50000 +# define RADEON_ROP3_Pn 0x000f0000 +# define RADEON_ROP3_DPno 0x00af0000 +# define RADEON_ROP3_DPan 0x005f0000 +#define RADEON_DP_GUI_MASTER_CNTL_C 0x1c84 +#define RADEON_DP_MIX 0x16c8 +#define RADEON_DP_SRC_BKGD_CLR 0x15dc +#define RADEON_DP_SRC_FRGD_CLR 0x15d8 +#define RADEON_DP_WRITE_MASK 0x16cc +#define RADEON_DST_BRES_DEC 0x1630 +#define RADEON_DST_BRES_ERR 0x1628 +#define RADEON_DST_BRES_INC 0x162c +#define RADEON_DST_BRES_LNTH 0x1634 +#define RADEON_DST_BRES_LNTH_SUB 0x1638 +#define RADEON_DST_HEIGHT 0x1410 +#define RADEON_DST_HEIGHT_WIDTH 0x143c +#define RADEON_DST_HEIGHT_WIDTH_8 0x158c +#define RADEON_DST_HEIGHT_WIDTH_BW 0x15b4 +#define RADEON_DST_HEIGHT_Y 0x15a0 +#define RADEON_DST_LINE_START 0x1600 +#define RADEON_DST_LINE_END 0x1604 +#define RADEON_DST_LINE_PATCOUNT 0x1608 +# define RADEON_BRES_CNTL_SHIFT 8 +#define RADEON_DST_OFFSET 0x1404 +#define RADEON_DST_PITCH 0x1408 +#define RADEON_DST_PITCH_OFFSET 0x142c +#define RADEON_DST_PITCH_OFFSET_C 0x1c80 +# define RADEON_PITCH_SHIFT 21 +# define RADEON_DST_TILE_LINEAR (0 << 30) +# define RADEON_DST_TILE_MACRO (1 << 30) +# define RADEON_DST_TILE_MICRO (2 << 30) +# define RADEON_DST_TILE_BOTH (3 << 30) +#define RADEON_DST_WIDTH 0x140c +#define RADEON_DST_WIDTH_HEIGHT 0x1598 +#define RADEON_DST_WIDTH_X 0x1588 +#define RADEON_DST_WIDTH_X_INCY 0x159c +#define RADEON_DST_X 0x141c +#define RADEON_DST_X_SUB 0x15a4 +#define RADEON_DST_X_Y 0x1594 +#define RADEON_DST_Y 0x1420 +#define RADEON_DST_Y_SUB 0x15a8 +#define RADEON_DST_Y_X 0x1438 + +#define RADEON_FCP_CNTL 0x0910 +# define RADEON_FCP0_SRC_PCICLK 0 +# define RADEON_FCP0_SRC_PCLK 1 +# define RADEON_FCP0_SRC_PCLKb 2 +# define RADEON_FCP0_SRC_HREF 3 +# define RADEON_FCP0_SRC_GND 4 +# define RADEON_FCP0_SRC_HREFb 5 +#define RADEON_FLUSH_1 0x1704 +#define RADEON_FLUSH_2 0x1708 +#define RADEON_FLUSH_3 0x170c +#define RADEON_FLUSH_4 0x1710 +#define RADEON_FLUSH_5 0x1714 +#define RADEON_FLUSH_6 0x1718 +#define RADEON_FLUSH_7 0x171c +#define RADEON_FOG_3D_TABLE_START 0x1810 +#define RADEON_FOG_3D_TABLE_END 0x1814 +#define RADEON_FOG_3D_TABLE_DENSITY 0x181c +#define RADEON_FOG_TABLE_INDEX 0x1a14 +#define RADEON_FOG_TABLE_DATA 0x1a18 +#define RADEON_FP_CRTC_H_TOTAL_DISP 0x0250 +#define RADEON_FP_CRTC_V_TOTAL_DISP 0x0254 +# define RADEON_FP_CRTC_H_TOTAL_MASK 0x000003ff +# define RADEON_FP_CRTC_H_DISP_MASK 0x01ff0000 +# define RADEON_FP_CRTC_V_TOTAL_MASK 0x00000fff +# define RADEON_FP_CRTC_V_DISP_MASK 0x0fff0000 +# define RADEON_FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8 +# define RADEON_FP_H_SYNC_WID_MASK 0x003f0000 +# define RADEON_FP_V_SYNC_STRT_MASK 0x00000fff +# define RADEON_FP_V_SYNC_WID_MASK 0x001f0000 +# define RADEON_FP_CRTC_H_TOTAL_SHIFT 0x00000000 +# define RADEON_FP_CRTC_H_DISP_SHIFT 0x00000010 +# define RADEON_FP_CRTC_V_TOTAL_SHIFT 0x00000000 +# define RADEON_FP_CRTC_V_DISP_SHIFT 0x00000010 +# define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003 +# define RADEON_FP_H_SYNC_WID_SHIFT 0x00000010 +# define RADEON_FP_V_SYNC_STRT_SHIFT 0x00000000 +# define RADEON_FP_V_SYNC_WID_SHIFT 0x00000010 +#define RADEON_FP_GEN_CNTL 0x0284 +# define RADEON_FP_FPON (1 << 0) +# define RADEON_FP_BLANK_EN (1 << 1) +# define RADEON_FP_TMDS_EN (1 << 2) +# define RADEON_FP_PANEL_FORMAT (1 << 3) +# define RADEON_FP_EN_TMDS (1 << 7) +# define RADEON_FP_DETECT_SENSE (1 << 8) +# define R200_FP_SOURCE_SEL_MASK (3 << 10) +# define R200_FP_SOURCE_SEL_CRTC1 (0 << 10) +# define R200_FP_SOURCE_SEL_CRTC2 (1 << 10) +# define R200_FP_SOURCE_SEL_RMX (2 << 10) +# define R200_FP_SOURCE_SEL_TRANS (3 << 10) +# define RADEON_FP_SEL_CRTC1 (0 << 13) +# define RADEON_FP_SEL_CRTC2 (1 << 13) +# define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15) +# define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16) +# define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17) +# define RADEON_FP_CRTC_USE_SHADOW_VEND (1 << 18) +# define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20) +# define RADEON_FP_DFP_SYNC_SEL (1 << 21) +# define RADEON_FP_CRTC_LOCK_8DOT (1 << 22) +# define RADEON_FP_CRT_SYNC_SEL (1 << 23) +# define RADEON_FP_USE_SHADOW_EN (1 << 24) +# define RADEON_FP_CRT_SYNC_ALT (1 << 26) +#define RADEON_FP2_GEN_CNTL 0x0288 +# define RADEON_FP2_BLANK_EN (1 << 1) +# define RADEON_FP2_ON (1 << 2) +# define RADEON_FP2_PANEL_FORMAT (1 << 3) +# define RADEON_FP2_DETECT_SENSE (1 << 8) +# define R200_FP2_SOURCE_SEL_MASK (3 << 10) +# define R200_FP2_SOURCE_SEL_CRTC1 (0 << 10) +# define R200_FP2_SOURCE_SEL_CRTC2 (1 << 10) +# define R200_FP2_SOURCE_SEL_RMX (2 << 10) +# define R200_FP2_SOURCE_SEL_TRANS_UNIT (3 << 10) +# define RADEON_FP2_SRC_SEL_MASK (3 << 13) +# define RADEON_FP2_SRC_SEL_CRTC2 (1 << 13) +# define RADEON_FP2_FP_POL (1 << 16) +# define RADEON_FP2_LP_POL (1 << 17) +# define RADEON_FP2_SCK_POL (1 << 18) +# define RADEON_FP2_LCD_CNTL_MASK (7 << 19) +# define RADEON_FP2_PAD_FLOP_EN (1 << 22) +# define RADEON_FP2_CRC_EN (1 << 23) +# define RADEON_FP2_CRC_READ_EN (1 << 24) +# define RADEON_FP2_DVO_EN (1 << 25) +# define RADEON_FP2_DVO_RATE_SEL_SDR (1 << 26) +# define R200_FP2_DVO_RATE_SEL_SDR (1 << 27) +# define R200_FP2_DVO_CLOCK_MODE_SINGLE (1 << 28) +# define R300_FP2_DVO_DUAL_CHANNEL_EN (1 << 29) +#define RADEON_FP_H_SYNC_STRT_WID 0x02c4 +#define RADEON_FP_H2_SYNC_STRT_WID 0x03c4 +#define RADEON_FP_HORZ_STRETCH 0x028c +#define RADEON_FP_HORZ2_STRETCH 0x038c +# define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff +# define RADEON_HORZ_STRETCH_RATIO_MAX 4096 +# define RADEON_HORZ_PANEL_SIZE (0x1ff << 16) +# define RADEON_HORZ_PANEL_SHIFT 16 +# define RADEON_HORZ_STRETCH_PIXREP (0 << 25) +# define RADEON_HORZ_STRETCH_BLEND (1 << 26) +# define RADEON_HORZ_STRETCH_ENABLE (1 << 25) +# define RADEON_HORZ_AUTO_RATIO (1 << 27) +# define RADEON_HORZ_FP_LOOP_STRETCH (0x7 << 28) +# define RADEON_HORZ_AUTO_RATIO_INC (1 << 31) +#define RADEON_FP_HORZ_VERT_ACTIVE 0x0278 +#define RADEON_FP_V_SYNC_STRT_WID 0x02c8 +#define RADEON_FP_VERT_STRETCH 0x0290 +#define RADEON_FP_V2_SYNC_STRT_WID 0x03c8 +#define RADEON_FP_VERT2_STRETCH 0x0390 +# define RADEON_VERT_PANEL_SIZE (0xfff << 12) +# define RADEON_VERT_PANEL_SHIFT 12 +# define RADEON_VERT_STRETCH_RATIO_MASK 0xfff +# define RADEON_VERT_STRETCH_RATIO_SHIFT 0 +# define RADEON_VERT_STRETCH_RATIO_MAX 4096 +# define RADEON_VERT_STRETCH_ENABLE (1 << 25) +# define RADEON_VERT_STRETCH_LINEREP (0 << 26) +# define RADEON_VERT_STRETCH_BLEND (1 << 26) +# define RADEON_VERT_AUTO_RATIO_EN (1 << 27) +# define RADEON_VERT_AUTO_RATIO_INC (1 << 31) +# define RADEON_VERT_STRETCH_RESERVED 0x71000000 +#define RS400_FP_2ND_GEN_CNTL 0x0384 +# define RS400_FP_2ND_ON (1 << 0) +# define RS400_FP_2ND_BLANK_EN (1 << 1) +# define RS400_TMDS_2ND_EN (1 << 2) +# define RS400_PANEL_FORMAT_2ND (1 << 3) +# define RS400_FP_2ND_EN_TMDS (1 << 7) +# define RS400_FP_2ND_DETECT_SENSE (1 << 8) +# define RS400_FP_2ND_SOURCE_SEL_MASK (3 << 10) +# define RS400_FP_2ND_SOURCE_SEL_CRTC1 (0 << 10) +# define RS400_FP_2ND_SOURCE_SEL_CRTC2 (1 << 10) +# define RS400_FP_2ND_SOURCE_SEL_RMX (2 << 10) +# define RS400_FP_2ND_DETECT_EN (1 << 12) +# define RS400_HPD_2ND_SEL (1 << 13) +#define RS400_FP2_2_GEN_CNTL 0x0388 +# define RS400_FP2_2_BLANK_EN (1 << 1) +# define RS400_FP2_2_ON (1 << 2) +# define RS400_FP2_2_PANEL_FORMAT (1 << 3) +# define RS400_FP2_2_DETECT_SENSE (1 << 8) +# define RS400_FP2_2_SOURCE_SEL_MASK (3 << 10) +# define RS400_FP2_2_SOURCE_SEL_CRTC1 (0 << 10) +# define RS400_FP2_2_SOURCE_SEL_CRTC2 (1 << 10) +# define RS400_FP2_2_SOURCE_SEL_RMX (2 << 10) +# define RS400_FP2_2_DVO2_EN (1 << 25) +#define RS400_TMDS2_CNTL 0x0394 +#define RS400_TMDS2_TRANSMITTER_CNTL 0x03a4 +# define RS400_TMDS2_PLLEN (1 << 0) +# define RS400_TMDS2_PLLRST (1 << 1) + +#define RADEON_GEN_INT_CNTL 0x0040 +#define RADEON_GEN_INT_STATUS 0x0044 +# define RADEON_VSYNC_INT_AK (1 << 2) +# define RADEON_VSYNC_INT (1 << 2) +# define RADEON_VSYNC2_INT_AK (1 << 6) +# define RADEON_VSYNC2_INT (1 << 6) +#define RADEON_GENENB 0x03c3 /* VGA */ +#define RADEON_GENFC_RD 0x03ca /* VGA */ +#define RADEON_GENFC_WT 0x03da /* VGA, 0x03ba */ +#define RADEON_GENMO_RD 0x03cc /* VGA */ +#define RADEON_GENMO_WT 0x03c2 /* VGA */ +#define RADEON_GENS0 0x03c2 /* VGA */ +#define RADEON_GENS1 0x03da /* VGA, 0x03ba */ +#define RADEON_GPIO_MONID 0x0068 /* DDC interface via I2C */ /* DDC3 */ +#define RADEON_GPIO_MONIDB 0x006c +#define RADEON_GPIO_CRT2_DDC 0x006c +#define RADEON_GPIO_DVI_DDC 0x0064 /* DDC2 */ +#define RADEON_GPIO_VGA_DDC 0x0060 /* DDC1 */ +# define RADEON_GPIO_A_0 (1 << 0) +# define RADEON_GPIO_A_1 (1 << 1) +# define RADEON_GPIO_Y_0 (1 << 8) +# define RADEON_GPIO_Y_1 (1 << 9) +# define RADEON_GPIO_Y_SHIFT_0 8 +# define RADEON_GPIO_Y_SHIFT_1 9 +# define RADEON_GPIO_EN_0 (1 << 16) +# define RADEON_GPIO_EN_1 (1 << 17) +# define RADEON_GPIO_MASK_0 (1 << 24) /*??*/ +# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/ +#define RADEON_GRPH8_DATA 0x03cf /* VGA */ +#define RADEON_GRPH8_IDX 0x03ce /* VGA */ +#define RADEON_GUI_SCRATCH_REG0 0x15e0 +#define RADEON_GUI_SCRATCH_REG1 0x15e4 +#define RADEON_GUI_SCRATCH_REG2 0x15e8 +#define RADEON_GUI_SCRATCH_REG3 0x15ec +#define RADEON_GUI_SCRATCH_REG4 0x15f0 +#define RADEON_GUI_SCRATCH_REG5 0x15f4 + +#define RADEON_HEADER 0x0f0e /* PCI */ +#define RADEON_HOST_DATA0 0x17c0 +#define RADEON_HOST_DATA1 0x17c4 +#define RADEON_HOST_DATA2 0x17c8 +#define RADEON_HOST_DATA3 0x17cc +#define RADEON_HOST_DATA4 0x17d0 +#define RADEON_HOST_DATA5 0x17d4 +#define RADEON_HOST_DATA6 0x17d8 +#define RADEON_HOST_DATA7 0x17dc +#define RADEON_HOST_DATA_LAST 0x17e0 +#define RADEON_HOST_PATH_CNTL 0x0130 +# define RADEON_HDP_SOFT_RESET (1 << 26) +# define RADEON_HDP_APER_CNTL (1 << 23) +#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */ +# define RADEON_HTOT_CNTL_VGA_EN (1 << 28) +#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */ + + /* Multimedia I2C bus */ +#define RADEON_I2C_CNTL_0 0x0090 +#define RADEON_I2C_DONE (1 << 0) +#define RADEON_I2C_NACK (1 << 1) +#define RADEON_I2C_HALT (1 << 2) +#define RADEON_I2C_SOFT_RST (1 << 5) +#define RADEON_I2C_DRIVE_EN (1 << 6) +#define RADEON_I2C_DRIVE_SEL (1 << 7) +#define RADEON_I2C_START (1 << 8) +#define RADEON_I2C_STOP (1 << 9) +#define RADEON_I2C_RECEIVE (1 << 10) +#define RADEON_I2C_ABORT (1 << 11) +#define RADEON_I2C_GO (1 << 12) +#define RADEON_I2C_CNTL_1 0x0094 +#define RADEON_I2C_SEL (1 << 16) +#define RADEON_I2C_EN (1 << 17) +#define RADEON_I2C_DATA 0x0098 + +#define RADEON_DVI_I2C_CNTL_0 0x02e0 +# define R200_DVI_I2C_PIN_SEL(x) ((x) << 3) +# define R200_SEL_DDC1 0 /* 0x60 - VGA_DDC */ +# define R200_SEL_DDC2 1 /* 0x64 - DVI_DDC */ +# define R200_SEL_DDC3 2 /* 0x68 - MONID_DDC */ +#define RADEON_DVI_I2C_CNTL_1 0x02e4 +#define RADEON_DVI_I2C_DATA 0x02e8 + +#define RADEON_INTERRUPT_LINE 0x0f3c /* PCI */ +#define RADEON_INTERRUPT_PIN 0x0f3d /* PCI */ +#define RADEON_IO_BASE 0x0f14 /* PCI */ + +#define RADEON_LATENCY 0x0f0d /* PCI */ +#define RADEON_LEAD_BRES_DEC 0x1608 +#define RADEON_LEAD_BRES_LNTH 0x161c +#define RADEON_LEAD_BRES_LNTH_SUB 0x1624 +#define RADEON_LVDS_GEN_CNTL 0x02d0 +# define RADEON_LVDS_ON (1 << 0) +# define RADEON_LVDS_DISPLAY_DIS (1 << 1) +# define RADEON_LVDS_PANEL_TYPE (1 << 2) +# define RADEON_LVDS_PANEL_FORMAT (1 << 3) +# define RADEON_LVDS_RST_FM (1 << 6) +# define RADEON_LVDS_EN (1 << 7) +# define RADEON_LVDS_BL_MOD_LEVEL_SHIFT 8 +# define RADEON_LVDS_BL_MOD_LEVEL_MASK (0xff << 8) +# define RADEON_LVDS_BL_MOD_EN (1 << 16) +# define RADEON_LVDS_DIGON (1 << 18) +# define RADEON_LVDS_BLON (1 << 19) +# define RADEON_LVDS_SEL_CRTC2 (1 << 23) +#define RADEON_LVDS_PLL_CNTL 0x02d4 +# define RADEON_HSYNC_DELAY_SHIFT 28 +# define RADEON_HSYNC_DELAY_MASK (0xf << 28) +# define RADEON_LVDS_PLL_EN (1 << 16) +# define RADEON_LVDS_PLL_RESET (1 << 17) +# define R300_LVDS_SRC_SEL_MASK (3 << 18) +# define R300_LVDS_SRC_SEL_CRTC1 (0 << 18) +# define R300_LVDS_SRC_SEL_CRTC2 (1 << 18) +# define R300_LVDS_SRC_SEL_RMX (2 << 18) + +#define RADEON_MAX_LATENCY 0x0f3f /* PCI */ +#define RADEON_MC_AGP_LOCATION 0x014c +#define RADEON_MC_FB_LOCATION 0x0148 +#define RADEON_DISPLAY_BASE_ADDR 0x23c +#define RADEON_DISPLAY2_BASE_ADDR 0x33c +#define RADEON_OV0_BASE_ADDR 0x43c +#define RADEON_NB_TOM 0x15c +#define R300_MC_INIT_MISC_LAT_TIMER 0x180 +# define R300_MC_DISP0R_INIT_LAT_SHIFT 8 +# define R300_MC_DISP0R_INIT_LAT_MASK 0xf +# define R300_MC_DISP1R_INIT_LAT_SHIFT 12 +# define R300_MC_DISP1R_INIT_LAT_MASK 0xf +#define RADEON_MCLK_CNTL 0x0012 /* PLL */ +# define RADEON_FORCEON_MCLKA (1 << 16) +# define RADEON_FORCEON_MCLKB (1 << 17) +# define RADEON_FORCEON_YCLKA (1 << 18) +# define RADEON_FORCEON_YCLKB (1 << 19) +# define RADEON_FORCEON_MC (1 << 20) +# define RADEON_FORCEON_AIC (1 << 21) +# define R300_DISABLE_MC_MCLKA (1 << 21) +# define R300_DISABLE_MC_MCLKB (1 << 21) +#define RADEON_MCLK_MISC 0x001f /* PLL */ +# define RADEON_MC_MCLK_MAX_DYN_STOP_LAT (1 << 12) +# define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1 << 13) +# define RADEON_MC_MCLK_DYN_ENABLE (1 << 14) +# define RADEON_IO_MCLK_DYN_ENABLE (1 << 15) +#define RADEON_LCD_GPIO_MASK 0x01a0 +#define RADEON_GPIOPAD_EN 0x01a0 +#define RADEON_LCD_GPIO_Y_REG 0x01a4 +#define RADEON_MDGPIO_A_REG 0x01ac +#define RADEON_MDGPIO_EN_REG 0x01b0 +#define RADEON_MDGPIO_MASK 0x0198 +#define RADEON_GPIOPAD_MASK 0x0198 +#define RADEON_GPIOPAD_A 0x019c +#define RADEON_MDGPIO_Y_REG 0x01b4 +#define RADEON_MEM_ADDR_CONFIG 0x0148 +#define RADEON_MEM_BASE 0x0f10 /* PCI */ +#define RADEON_MEM_CNTL 0x0140 +# define RADEON_MEM_NUM_CHANNELS_MASK 0x01 +# define RADEON_MEM_USE_B_CH_ONLY (1 << 1) +# define RV100_HALF_MODE (1 << 3) +# define R300_MEM_NUM_CHANNELS_MASK 0x03 +# define R300_MEM_USE_CD_CH_ONLY (1 << 2) +#define RADEON_MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */ +#define RADEON_MEM_INIT_LAT_TIMER 0x0154 +#define RADEON_MEM_INTF_CNTL 0x014c +#define RADEON_MEM_SDRAM_MODE_REG 0x0158 +# define RADEON_SDRAM_MODE_MASK 0xffff0000 +# define RADEON_B3MEM_RESET_MASK 0x6fffffff +# define RADEON_MEM_CFG_TYPE_DDR (1 << 30) +#define RADEON_MEM_STR_CNTL 0x0150 +# define RADEON_MEM_PWRUP_COMPL_A (1 << 0) +# define RADEON_MEM_PWRUP_COMPL_B (1 << 1) +# define R300_MEM_PWRUP_COMPL_C (1 << 2) +# define R300_MEM_PWRUP_COMPL_D (1 << 3) +# define RADEON_MEM_PWRUP_COMPLETE 0x03 +# define R300_MEM_PWRUP_COMPLETE 0x0f +#define RADEON_MC_STATUS 0x0150 +# define RADEON_MC_IDLE (1 << 2) +# define R300_MC_IDLE (1 << 4) +#define RADEON_MEM_VGA_RP_SEL 0x003c +#define RADEON_MEM_VGA_WP_SEL 0x0038 +#define RADEON_MIN_GRANT 0x0f3e /* PCI */ +#define RADEON_MM_DATA 0x0004 +#define RADEON_MM_INDEX 0x0000 +#define RADEON_MPLL_CNTL 0x000e /* PLL */ +#define RADEON_MPP_TB_CONFIG 0x01c0 /* ? */ +#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */ +#define RADEON_SEPROM_CNTL1 0x01c0 +# define RADEON_SCK_PRESCALE_SHIFT 24 +# define RADEON_SCK_PRESCALE_MASK (0xff << 24) +#define R300_MC_IND_INDEX 0x01f8 +# define R300_MC_IND_ADDR_MASK 0x3f +# define R300_MC_IND_WR_EN (1 << 8) +#define R300_MC_IND_DATA 0x01fc +#define R300_MC_READ_CNTL_AB 0x017c +# define R300_MEM_RBS_POSITION_A_MASK 0x03 +#define R300_MC_READ_CNTL_CD_mcind 0x24 +# define R300_MEM_RBS_POSITION_C_MASK 0x03 + +#define RADEON_N_VIF_COUNT 0x0248 + +#define RADEON_OV0_AUTO_FLIP_CNTL 0x0470 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM 0x00000007 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD 0x00000008 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD 0x00000010 +# define RADEON_OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE 0x00000040 +# define RADEON_OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT 0x00000300 +# define RADEON_OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN 0x00010000 +# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN 0x00040000 +# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN 0x00080000 +# define RADEON_OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE 0x00800000 + +#define RADEON_OV0_COLOUR_CNTL 0x04E0 +#define RADEON_OV0_DEINTERLACE_PATTERN 0x0474 +#define RADEON_OV0_EXCLUSIVE_HORZ 0x0408 +# define RADEON_EXCL_HORZ_START_MASK 0x000000ff +# define RADEON_EXCL_HORZ_END_MASK 0x0000ff00 +# define RADEON_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000 +# define RADEON_EXCL_HORZ_EXCLUSIVE_EN 0x80000000 +#define RADEON_OV0_EXCLUSIVE_VERT 0x040C +# define RADEON_EXCL_VERT_START_MASK 0x000003ff +# define RADEON_EXCL_VERT_END_MASK 0x03ff0000 +#define RADEON_OV0_FILTER_CNTL 0x04A0 +# define RADEON_FILTER_PROGRAMMABLE_COEF 0x0 +# define RADEON_FILTER_HC_COEF_HORZ_Y 0x1 +# define RADEON_FILTER_HC_COEF_HORZ_UV 0x2 +# define RADEON_FILTER_HC_COEF_VERT_Y 0x4 +# define RADEON_FILTER_HC_COEF_VERT_UV 0x8 +# define RADEON_FILTER_HARDCODED_COEF 0xf +# define RADEON_FILTER_COEF_MASK 0xf + +#define RADEON_OV0_FOUR_TAP_COEF_0 0x04B0 +#define RADEON_OV0_FOUR_TAP_COEF_1 0x04B4 +#define RADEON_OV0_FOUR_TAP_COEF_2 0x04B8 +#define RADEON_OV0_FOUR_TAP_COEF_3 0x04BC +#define RADEON_OV0_FOUR_TAP_COEF_4 0x04C0 +#define RADEON_OV0_FLAG_CNTL 0x04DC +#define RADEON_OV0_GAMMA_000_00F 0x0d40 +#define RADEON_OV0_GAMMA_010_01F 0x0d44 +#define RADEON_OV0_GAMMA_020_03F 0x0d48 +#define RADEON_OV0_GAMMA_040_07F 0x0d4c +#define RADEON_OV0_GAMMA_080_0BF 0x0e00 +#define RADEON_OV0_GAMMA_0C0_0FF 0x0e04 +#define RADEON_OV0_GAMMA_100_13F 0x0e08 +#define RADEON_OV0_GAMMA_140_17F 0x0e0c +#define RADEON_OV0_GAMMA_180_1BF 0x0e10 +#define RADEON_OV0_GAMMA_1C0_1FF 0x0e14 +#define RADEON_OV0_GAMMA_200_23F 0x0e18 +#define RADEON_OV0_GAMMA_240_27F 0x0e1c +#define RADEON_OV0_GAMMA_280_2BF 0x0e20 +#define RADEON_OV0_GAMMA_2C0_2FF 0x0e24 +#define RADEON_OV0_GAMMA_300_33F 0x0e28 +#define RADEON_OV0_GAMMA_340_37F 0x0e2c +#define RADEON_OV0_GAMMA_380_3BF 0x0d50 +#define RADEON_OV0_GAMMA_3C0_3FF 0x0d54 +#define RADEON_OV0_GRAPHICS_KEY_CLR_LOW 0x04EC +#define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH 0x04F0 +#define RADEON_OV0_H_INC 0x0480 +#define RADEON_OV0_KEY_CNTL 0x04F4 +# define RADEON_VIDEO_KEY_FN_MASK 0x00000003L +# define RADEON_VIDEO_KEY_FN_FALSE 0x00000000L +# define RADEON_VIDEO_KEY_FN_TRUE 0x00000001L +# define RADEON_VIDEO_KEY_FN_EQ 0x00000002L +# define RADEON_VIDEO_KEY_FN_NE 0x00000003L +# define RADEON_GRAPHIC_KEY_FN_MASK 0x00000030L +# define RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L +# define RADEON_GRAPHIC_KEY_FN_TRUE 0x00000010L +# define RADEON_GRAPHIC_KEY_FN_EQ 0x00000020L +# define RADEON_GRAPHIC_KEY_FN_NE 0x00000030L +# define RADEON_CMP_MIX_MASK 0x00000100L +# define RADEON_CMP_MIX_OR 0x00000000L +# define RADEON_CMP_MIX_AND 0x00000100L +#define RADEON_OV0_LIN_TRANS_A 0x0d20 +#define RADEON_OV0_LIN_TRANS_B 0x0d24 +#define RADEON_OV0_LIN_TRANS_C 0x0d28 +#define RADEON_OV0_LIN_TRANS_D 0x0d2c +#define RADEON_OV0_LIN_TRANS_E 0x0d30 +#define RADEON_OV0_LIN_TRANS_F 0x0d34 +#define RADEON_OV0_P1_BLANK_LINES_AT_TOP 0x0430 +# define RADEON_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL +# define RADEON_P1_ACTIVE_LINES_M1 0x0fff0000L +#define RADEON_OV0_P1_H_ACCUM_INIT 0x0488 +#define RADEON_OV0_P1_V_ACCUM_INIT 0x0428 +# define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L +# define RADEON_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L +#define RADEON_OV0_P1_X_START_END 0x0494 +#define RADEON_OV0_P2_X_START_END 0x0498 +#define RADEON_OV0_P23_BLANK_LINES_AT_TOP 0x0434 +# define RADEON_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL +# define RADEON_P23_ACTIVE_LINES_M1 0x07ff0000L +#define RADEON_OV0_P23_H_ACCUM_INIT 0x048C +#define RADEON_OV0_P23_V_ACCUM_INIT 0x042C +#define RADEON_OV0_P3_X_START_END 0x049C +#define RADEON_OV0_REG_LOAD_CNTL 0x0410 +# define RADEON_REG_LD_CTL_LOCK 0x00000001L +# define RADEON_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L +# define RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L +# define RADEON_REG_LD_CTL_LOCK_READBACK 0x00000008L +# define RADEON_REG_LD_CTL_FLIP_READBACK 0x00000010L +#define RADEON_OV0_SCALE_CNTL 0x0420 +# define RADEON_SCALER_HORZ_PICK_NEAREST 0x00000004L +# define RADEON_SCALER_VERT_PICK_NEAREST 0x00000008L +# define RADEON_SCALER_SIGNED_UV 0x00000010L +# define RADEON_SCALER_GAMMA_SEL_MASK 0x00000060L +# define RADEON_SCALER_GAMMA_SEL_BRIGHT 0x00000000L +# define RADEON_SCALER_GAMMA_SEL_G22 0x00000020L +# define RADEON_SCALER_GAMMA_SEL_G18 0x00000040L +# define RADEON_SCALER_GAMMA_SEL_G14 0x00000060L +# define RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L +# define RADEON_SCALER_SURFAC_FORMAT 0x00000f00L +# define RADEON_SCALER_SOURCE_15BPP 0x00000300L +# define RADEON_SCALER_SOURCE_16BPP 0x00000400L +# define RADEON_SCALER_SOURCE_32BPP 0x00000600L +# define RADEON_SCALER_SOURCE_YUV9 0x00000900L +# define RADEON_SCALER_SOURCE_YUV12 0x00000A00L +# define RADEON_SCALER_SOURCE_VYUY422 0x00000B00L +# define RADEON_SCALER_SOURCE_YVYU422 0x00000C00L +# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L +# define RADEON_SCALER_TEMPORAL_DEINT 0x00002000L +# define RADEON_SCALER_CRTC_SEL 0x00004000L +# define RADEON_SCALER_SMART_SWITCH 0x00008000L +# define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L +# define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L +# define RADEON_SCALER_DIS_LIMIT 0x08000000L +# define RADEON_SCALER_LIN_TRANS_BYPASS 0x10000000L +# define RADEON_SCALER_INT_EMU 0x20000000L +# define RADEON_SCALER_ENABLE 0x40000000L +# define RADEON_SCALER_SOFT_RESET 0x80000000L +#define RADEON_OV0_STEP_BY 0x0484 +#define RADEON_OV0_TEST 0x04F8 +#define RADEON_OV0_V_INC 0x0424 +#define RADEON_OV0_VID_BUF_PITCH0_VALUE 0x0460 +#define RADEON_OV0_VID_BUF_PITCH1_VALUE 0x0464 +#define RADEON_OV0_VID_BUF0_BASE_ADRS 0x0440 +# define RADEON_VIF_BUF0_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF0_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF1_BASE_ADRS 0x0444 +# define RADEON_VIF_BUF1_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF1_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF2_BASE_ADRS 0x0448 +# define RADEON_VIF_BUF2_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF2_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF3_BASE_ADRS 0x044C +#define RADEON_OV0_VID_BUF4_BASE_ADRS 0x0450 +#define RADEON_OV0_VID_BUF5_BASE_ADRS 0x0454 +#define RADEON_OV0_VIDEO_KEY_CLR_HIGH 0x04E8 +#define RADEON_OV0_VIDEO_KEY_CLR_LOW 0x04E4 +#define RADEON_OV0_Y_X_START 0x0400 +#define RADEON_OV0_Y_X_END 0x0404 +#define RADEON_OV1_Y_X_START 0x0600 +#define RADEON_OV1_Y_X_END 0x0604 +#define RADEON_OVR_CLR 0x0230 +#define RADEON_OVR_WID_LEFT_RIGHT 0x0234 +#define RADEON_OVR_WID_TOP_BOTTOM 0x0238 + +/* first capture unit */ + +#define RADEON_CAP0_BUF0_OFFSET 0x0920 +#define RADEON_CAP0_BUF1_OFFSET 0x0924 +#define RADEON_CAP0_BUF0_EVEN_OFFSET 0x0928 +#define RADEON_CAP0_BUF1_EVEN_OFFSET 0x092C + +#define RADEON_CAP0_BUF_PITCH 0x0930 +#define RADEON_CAP0_V_WINDOW 0x0934 +#define RADEON_CAP0_H_WINDOW 0x0938 +#define RADEON_CAP0_VBI0_OFFSET 0x093C +#define RADEON_CAP0_VBI1_OFFSET 0x0940 +#define RADEON_CAP0_VBI_V_WINDOW 0x0944 +#define RADEON_CAP0_VBI_H_WINDOW 0x0948 +#define RADEON_CAP0_PORT_MODE_CNTL 0x094C +#define RADEON_CAP0_TRIG_CNTL 0x0950 +#define RADEON_CAP0_DEBUG 0x0954 +#define RADEON_CAP0_CONFIG 0x0958 +# define RADEON_CAP0_CONFIG_CONTINUOS 0x00000001 +# define RADEON_CAP0_CONFIG_START_FIELD_EVEN 0x00000002 +# define RADEON_CAP0_CONFIG_START_BUF_GET 0x00000004 +# define RADEON_CAP0_CONFIG_START_BUF_SET 0x00000008 +# define RADEON_CAP0_CONFIG_BUF_TYPE_ALT 0x00000010 +# define RADEON_CAP0_CONFIG_BUF_TYPE_FRAME 0x00000020 +# define RADEON_CAP0_CONFIG_ONESHOT_MODE_FRAME 0x00000040 +# define RADEON_CAP0_CONFIG_BUF_MODE_DOUBLE 0x00000080 +# define RADEON_CAP0_CONFIG_BUF_MODE_TRIPLE 0x00000100 +# define RADEON_CAP0_CONFIG_MIRROR_EN 0x00000200 +# define RADEON_CAP0_CONFIG_ONESHOT_MIRROR_EN 0x00000400 +# define RADEON_CAP0_CONFIG_VIDEO_SIGNED_UV 0x00000800 +# define RADEON_CAP0_CONFIG_ANC_DECODE_EN 0x00001000 +# define RADEON_CAP0_CONFIG_VBI_EN 0x00002000 +# define RADEON_CAP0_CONFIG_SOFT_PULL_DOWN_EN 0x00004000 +# define RADEON_CAP0_CONFIG_VIP_EXTEND_FLAG_EN 0x00008000 +# define RADEON_CAP0_CONFIG_FAKE_FIELD_EN 0x00010000 +# define RADEON_CAP0_CONFIG_ODD_ONE_MORE_LINE 0x00020000 +# define RADEON_CAP0_CONFIG_EVEN_ONE_MORE_LINE 0x00040000 +# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_2 0x00080000 +# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_4 0x00100000 +# define RADEON_CAP0_CONFIG_VERT_DIVIDE_2 0x00200000 +# define RADEON_CAP0_CONFIG_VERT_DIVIDE_4 0x00400000 +# define RADEON_CAP0_CONFIG_FORMAT_BROOKTREE 0x00000000 +# define RADEON_CAP0_CONFIG_FORMAT_CCIR656 0x00800000 +# define RADEON_CAP0_CONFIG_FORMAT_ZV 0x01000000 +# define RADEON_CAP0_CONFIG_FORMAT_VIP 0x01800000 +# define RADEON_CAP0_CONFIG_FORMAT_TRANSPORT 0x02000000 +# define RADEON_CAP0_CONFIG_HORZ_DECIMATOR 0x04000000 +# define RADEON_CAP0_CONFIG_VIDEO_IN_YVYU422 0x00000000 +# define RADEON_CAP0_CONFIG_VIDEO_IN_VYUY422 0x20000000 +# define RADEON_CAP0_CONFIG_VBI_DIVIDE_2 0x40000000 +# define RADEON_CAP0_CONFIG_VBI_DIVIDE_4 0x80000000 +#define RADEON_CAP0_ANC_ODD_OFFSET 0x095C +#define RADEON_CAP0_ANC_EVEN_OFFSET 0x0960 +#define RADEON_CAP0_ANC_H_WINDOW 0x0964 +#define RADEON_CAP0_VIDEO_SYNC_TEST 0x0968 +#define RADEON_CAP0_ONESHOT_BUF_OFFSET 0x096C +#define RADEON_CAP0_BUF_STATUS 0x0970 +/* #define RADEON_CAP0_DWNSC_XRATIO 0x0978 */ +/* #define RADEON_CAP0_XSHARPNESS 0x097C */ +#define RADEON_CAP0_VBI2_OFFSET 0x0980 +#define RADEON_CAP0_VBI3_OFFSET 0x0984 +#define RADEON_CAP0_ANC2_OFFSET 0x0988 +#define RADEON_CAP0_ANC3_OFFSET 0x098C +#define RADEON_VID_BUFFER_CONTROL 0x0900 + +/* second capture unit */ + +#define RADEON_CAP1_BUF0_OFFSET 0x0990 +#define RADEON_CAP1_BUF1_OFFSET 0x0994 +#define RADEON_CAP1_BUF0_EVEN_OFFSET 0x0998 +#define RADEON_CAP1_BUF1_EVEN_OFFSET 0x099C + +#define RADEON_CAP1_BUF_PITCH 0x09A0 +#define RADEON_CAP1_V_WINDOW 0x09A4 +#define RADEON_CAP1_H_WINDOW 0x09A8 +#define RADEON_CAP1_VBI_ODD_OFFSET 0x09AC +#define RADEON_CAP1_VBI_EVEN_OFFSET 0x09B0 +#define RADEON_CAP1_VBI_V_WINDOW 0x09B4 +#define RADEON_CAP1_VBI_H_WINDOW 0x09B8 +#define RADEON_CAP1_PORT_MODE_CNTL 0x09BC +#define RADEON_CAP1_TRIG_CNTL 0x09C0 +#define RADEON_CAP1_DEBUG 0x09C4 +#define RADEON_CAP1_CONFIG 0x09C8 +#define RADEON_CAP1_ANC_ODD_OFFSET 0x09CC +#define RADEON_CAP1_ANC_EVEN_OFFSET 0x09D0 +#define RADEON_CAP1_ANC_H_WINDOW 0x09D4 +#define RADEON_CAP1_VIDEO_SYNC_TEST 0x09D8 +#define RADEON_CAP1_ONESHOT_BUF_OFFSET 0x09DC +#define RADEON_CAP1_BUF_STATUS 0x09E0 +#define RADEON_CAP1_DWNSC_XRATIO 0x09E8 +#define RADEON_CAP1_XSHARPNESS 0x09EC + +/* misc multimedia registers */ + +#define RADEON_IDCT_RUNS 0x1F80 +#define RADEON_IDCT_LEVELS 0x1F84 +#define RADEON_IDCT_CONTROL 0x1FBC +#define RADEON_IDCT_AUTH_CONTROL 0x1F88 +#define RADEON_IDCT_AUTH 0x1F8C + +#define RADEON_P2PLL_CNTL 0x002a /* P2PLL */ +# define RADEON_P2PLL_RESET (1 << 0) +# define RADEON_P2PLL_SLEEP (1 << 1) +# define RADEON_P2PLL_PVG_MASK (7 << 11) +# define RADEON_P2PLL_PVG_SHIFT 11 +# define RADEON_P2PLL_ATOMIC_UPDATE_EN (1 << 16) +# define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17) +# define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18) +#define RADEON_P2PLL_DIV_0 0x002c +# define RADEON_P2PLL_FB0_DIV_MASK 0x07ff +# define RADEON_P2PLL_POST0_DIV_MASK 0x00070000 +#define RADEON_P2PLL_REF_DIV 0x002B /* PLL */ +# define RADEON_P2PLL_REF_DIV_MASK 0x03ff +# define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ +# define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ +# define R300_PPLL_REF_DIV_ACC_MASK (0x3ff << 18) +# define R300_PPLL_REF_DIV_ACC_SHIFT 18 +#define RADEON_PALETTE_DATA 0x00b4 +#define RADEON_PALETTE_30_DATA 0x00b8 +#define RADEON_PALETTE_INDEX 0x00b0 +#define RADEON_PCI_GART_PAGE 0x017c +#define RADEON_PIXCLKS_CNTL 0x002d +# define RADEON_PIX2CLK_SRC_SEL_MASK 0x03 +# define RADEON_PIX2CLK_SRC_SEL_CPUCLK 0x00 +# define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01 +# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03 +# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6) +# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7) +# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8) +# define RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9) +# define R300_DVOCLK_ALWAYS_ONb (1 << 10) +# define RADEON_PIXCLK_BLEND_ALWAYS_ONb (1 << 11) +# define RADEON_PIXCLK_GV_ALWAYS_ONb (1 << 12) +# define RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13) +# define R300_PIXCLK_DVO_ALWAYS_ONb (1 << 13) +# define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) +# define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15) +# define R300_PIXCLK_TRANS_ALWAYS_ONb (1 << 16) +# define R300_PIXCLK_TVO_ALWAYS_ONb (1 << 17) +# define R300_P2G2CLK_ALWAYS_ONb (1 << 18) +# define R300_P2G2CLK_DAC_ALWAYS_ONb (1 << 19) +# define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23) +#define RADEON_PLANE_3D_MASK_C 0x1d44 +#define RADEON_PLL_TEST_CNTL 0x0013 /* PLL */ +# define RADEON_PLL_MASK_READ_B (1 << 9) +#define RADEON_PMI_CAP_ID 0x0f5c /* PCI */ +#define RADEON_PMI_DATA 0x0f63 /* PCI */ +#define RADEON_PMI_NXT_CAP_PTR 0x0f5d /* PCI */ +#define RADEON_PMI_PMC_REG 0x0f5e /* PCI */ +#define RADEON_PMI_PMCSR_REG 0x0f60 /* PCI */ +#define RADEON_PMI_REGISTER 0x0f5c /* PCI */ +#define RADEON_PPLL_CNTL 0x0002 /* PLL */ +# define RADEON_PPLL_RESET (1 << 0) +# define RADEON_PPLL_SLEEP (1 << 1) +# define RADEON_PPLL_PVG_MASK (7 << 11) +# define RADEON_PPLL_PVG_SHIFT 11 +# define RADEON_PPLL_ATOMIC_UPDATE_EN (1 << 16) +# define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17) +# define RADEON_PPLL_ATOMIC_UPDATE_VSYNC (1 << 18) +#define RADEON_PPLL_DIV_0 0x0004 /* PLL */ +#define RADEON_PPLL_DIV_1 0x0005 /* PLL */ +#define RADEON_PPLL_DIV_2 0x0006 /* PLL */ +#define RADEON_PPLL_DIV_3 0x0007 /* PLL */ +# define RADEON_PPLL_FB3_DIV_MASK 0x07ff +# define RADEON_PPLL_POST3_DIV_MASK 0x00070000 +#define RADEON_PPLL_REF_DIV 0x0003 /* PLL */ +# define RADEON_PPLL_REF_DIV_MASK 0x03ff +# define RADEON_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ +# define RADEON_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ +#define RADEON_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */ + +#define RADEON_RBBM_GUICNTL 0x172c +# define RADEON_HOST_DATA_SWAP_NONE (0 << 0) +# define RADEON_HOST_DATA_SWAP_16BIT (1 << 0) +# define RADEON_HOST_DATA_SWAP_32BIT (2 << 0) +# define RADEON_HOST_DATA_SWAP_HDW (3 << 0) +#define RADEON_RBBM_SOFT_RESET 0x00f0 +# define RADEON_SOFT_RESET_CP (1 << 0) +# define RADEON_SOFT_RESET_HI (1 << 1) +# define RADEON_SOFT_RESET_SE (1 << 2) +# define RADEON_SOFT_RESET_RE (1 << 3) +# define RADEON_SOFT_RESET_PP (1 << 4) +# define RADEON_SOFT_RESET_E2 (1 << 5) +# define RADEON_SOFT_RESET_RB (1 << 6) +# define RADEON_SOFT_RESET_HDP (1 << 7) +#define RADEON_RBBM_STATUS 0x0e40 +# define RADEON_RBBM_FIFOCNT_MASK 0x007f +# define RADEON_RBBM_ACTIVE (1 << 31) +#define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c +# define RADEON_RB2D_DC_FLUSH (3 << 0) +# define RADEON_RB2D_DC_FREE (3 << 2) +# define RADEON_RB2D_DC_FLUSH_ALL 0xf +# define RADEON_RB2D_DC_BUSY (1 << 31) +#define RADEON_RB2D_DSTCACHE_MODE 0x3428 +#define RADEON_DSTCACHE_CTLSTAT 0x1714 + +#define RADEON_RB3D_ZCACHE_MODE 0x3250 +#define RADEON_RB3D_ZCACHE_CTLSTAT 0x3254 +# define RADEON_RB3D_ZC_FLUSH_ALL 0x5 +#define RADEON_RB3D_DSTCACHE_MODE 0x3258 +# define RADEON_RB3D_DC_CACHE_ENABLE (0) +# define RADEON_RB3D_DC_2D_CACHE_DISABLE (1) +# define RADEON_RB3D_DC_3D_CACHE_DISABLE (2) +# define RADEON_RB3D_DC_CACHE_DISABLE (3) +# define RADEON_RB3D_DC_2D_CACHE_LINESIZE_128 (1 << 2) +# define RADEON_RB3D_DC_3D_CACHE_LINESIZE_128 (2 << 2) +# define RADEON_RB3D_DC_2D_CACHE_AUTOFLUSH (1 << 8) +# define RADEON_RB3D_DC_3D_CACHE_AUTOFLUSH (2 << 8) +# define R200_RB3D_DC_2D_CACHE_AUTOFREE (1 << 10) +# define R200_RB3D_DC_3D_CACHE_AUTOFREE (2 << 10) +# define RADEON_RB3D_DC_FORCE_RMW (1 << 16) +# define RADEON_RB3D_DC_DISABLE_RI_FILL (1 << 24) +# define RADEON_RB3D_DC_DISABLE_RI_READ (1 << 25) + +#define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325C +# define RADEON_RB3D_DC_FLUSH (3 << 0) +# define RADEON_RB3D_DC_FREE (3 << 2) +# define RADEON_RB3D_DC_FLUSH_ALL 0xf +# define RADEON_RB3D_DC_BUSY (1 << 31) + +#define RADEON_REG_BASE 0x0f18 /* PCI */ +#define RADEON_REGPROG_INF 0x0f09 /* PCI */ +#define RADEON_REVISION_ID 0x0f08 /* PCI */ + +#define RADEON_SC_BOTTOM 0x164c +#define RADEON_SC_BOTTOM_RIGHT 0x16f0 +#define RADEON_SC_BOTTOM_RIGHT_C 0x1c8c +#define RADEON_SC_LEFT 0x1640 +#define RADEON_SC_RIGHT 0x1644 +#define RADEON_SC_TOP 0x1648 +#define RADEON_SC_TOP_LEFT 0x16ec +#define RADEON_SC_TOP_LEFT_C 0x1c88 +# define RADEON_SC_SIGN_MASK_LO 0x8000 +# define RADEON_SC_SIGN_MASK_HI 0x80000000 +#define RADEON_SCLK_CNTL 0x000d /* PLL */ +# define RADEON_SCLK_SRC_SEL_MASK 0x0007 +# define RADEON_DYN_STOP_LAT_MASK 0x00007ff8 +# define RADEON_CP_MAX_DYN_STOP_LAT 0x0008 +# define RADEON_SCLK_FORCEON_MASK 0xffff8000 +# define RADEON_SCLK_FORCE_DISP2 (1<<15) +# define RADEON_SCLK_FORCE_CP (1<<16) +# define RADEON_SCLK_FORCE_HDP (1<<17) +# define RADEON_SCLK_FORCE_DISP1 (1<<18) +# define RADEON_SCLK_FORCE_TOP (1<<19) +# define RADEON_SCLK_FORCE_E2 (1<<20) +# define RADEON_SCLK_FORCE_SE (1<<21) +# define RADEON_SCLK_FORCE_IDCT (1<<22) +# define RADEON_SCLK_FORCE_VIP (1<<23) +# define RADEON_SCLK_FORCE_RE (1<<24) +# define RADEON_SCLK_FORCE_PB (1<<25) +# define RADEON_SCLK_FORCE_TAM (1<<26) +# define RADEON_SCLK_FORCE_TDM (1<<27) +# define RADEON_SCLK_FORCE_RB (1<<28) +# define RADEON_SCLK_FORCE_TV_SCLK (1<<29) +# define RADEON_SCLK_FORCE_SUBPIC (1<<30) +# define RADEON_SCLK_FORCE_OV0 (1<<31) +# define R300_SCLK_FORCE_VAP (1<<21) +# define R300_SCLK_FORCE_SR (1<<25) +# define R300_SCLK_FORCE_PX (1<<26) +# define R300_SCLK_FORCE_TX (1<<27) +# define R300_SCLK_FORCE_US (1<<28) +# define R300_SCLK_FORCE_SU (1<<30) +#define R300_SCLK_CNTL2 0x1e /* PLL */ +# define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10) +# define R300_SCLK_GA_MAX_DYN_STOP_LAT (1<<11) +# define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12) +# define R300_SCLK_FORCE_TCL (1<<13) +# define R300_SCLK_FORCE_CBA (1<<14) +# define R300_SCLK_FORCE_GA (1<<15) +#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */ +# define RADEON_SCLK_MORE_MAX_DYN_STOP_LAT 0x0007 +# define RADEON_SCLK_MORE_FORCEON 0x0700 +#define RADEON_SDRAM_MODE_REG 0x0158 +#define RADEON_SEQ8_DATA 0x03c5 /* VGA */ +#define RADEON_SEQ8_IDX 0x03c4 /* VGA */ +#define RADEON_SNAPSHOT_F_COUNT 0x0244 +#define RADEON_SNAPSHOT_VH_COUNTS 0x0240 +#define RADEON_SNAPSHOT_VIF_COUNT 0x024c +#define RADEON_SRC_OFFSET 0x15ac +#define RADEON_SRC_PITCH 0x15b0 +#define RADEON_SRC_PITCH_OFFSET 0x1428 +#define RADEON_SRC_SC_BOTTOM 0x165c +#define RADEON_SRC_SC_BOTTOM_RIGHT 0x16f4 +#define RADEON_SRC_SC_RIGHT 0x1654 +#define RADEON_SRC_X 0x1414 +#define RADEON_SRC_X_Y 0x1590 +#define RADEON_SRC_Y 0x1418 +#define RADEON_SRC_Y_X 0x1434 +#define RADEON_STATUS 0x0f06 /* PCI */ +#define RADEON_SUBPIC_CNTL 0x0540 /* ? */ +#define RADEON_SUB_CLASS 0x0f0a /* PCI */ +#define RADEON_SURFACE_CNTL 0x0b00 +# define RADEON_SURF_TRANSLATION_DIS (1 << 8) +# define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20) +# define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21) +# define RADEON_NONSURF_AP1_SWP_16BPP (1 << 22) +# define RADEON_NONSURF_AP1_SWP_32BPP (1 << 23) +#define RADEON_SURFACE0_INFO 0x0b0c +# define RADEON_SURF_TILE_COLOR_MACRO (0 << 16) +# define RADEON_SURF_TILE_COLOR_BOTH (1 << 16) +# define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16) +# define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16) +# define R200_SURF_TILE_NONE (0 << 16) +# define R200_SURF_TILE_COLOR_MACRO (1 << 16) +# define R200_SURF_TILE_COLOR_MICRO (2 << 16) +# define R200_SURF_TILE_COLOR_BOTH (3 << 16) +# define R200_SURF_TILE_DEPTH_32BPP (4 << 16) +# define R200_SURF_TILE_DEPTH_16BPP (5 << 16) +# define R300_SURF_TILE_NONE (0 << 16) +# define R300_SURF_TILE_COLOR_MACRO (1 << 16) +# define R300_SURF_TILE_DEPTH_32BPP (2 << 16) +# define RADEON_SURF_AP0_SWP_16BPP (1 << 20) +# define RADEON_SURF_AP0_SWP_32BPP (1 << 21) +# define RADEON_SURF_AP1_SWP_16BPP (1 << 22) +# define RADEON_SURF_AP1_SWP_32BPP (1 << 23) +#define RADEON_SURFACE0_LOWER_BOUND 0x0b04 +#define RADEON_SURFACE0_UPPER_BOUND 0x0b08 +#define RADEON_SURFACE1_INFO 0x0b1c +#define RADEON_SURFACE1_LOWER_BOUND 0x0b14 +#define RADEON_SURFACE1_UPPER_BOUND 0x0b18 +#define RADEON_SURFACE2_INFO 0x0b2c +#define RADEON_SURFACE2_LOWER_BOUND 0x0b24 +#define RADEON_SURFACE2_UPPER_BOUND 0x0b28 +#define RADEON_SURFACE3_INFO 0x0b3c +#define RADEON_SURFACE3_LOWER_BOUND 0x0b34 +#define RADEON_SURFACE3_UPPER_BOUND 0x0b38 +#define RADEON_SURFACE4_INFO 0x0b4c +#define RADEON_SURFACE4_LOWER_BOUND 0x0b44 +#define RADEON_SURFACE4_UPPER_BOUND 0x0b48 +#define RADEON_SURFACE5_INFO 0x0b5c +#define RADEON_SURFACE5_LOWER_BOUND 0x0b54 +#define RADEON_SURFACE5_UPPER_BOUND 0x0b58 +#define RADEON_SURFACE6_INFO 0x0b6c +#define RADEON_SURFACE6_LOWER_BOUND 0x0b64 +#define RADEON_SURFACE6_UPPER_BOUND 0x0b68 +#define RADEON_SURFACE7_INFO 0x0b7c +#define RADEON_SURFACE7_LOWER_BOUND 0x0b74 +#define RADEON_SURFACE7_UPPER_BOUND 0x0b78 +#define RADEON_SW_SEMAPHORE 0x013c + +#define RADEON_TEST_DEBUG_CNTL 0x0120 +#define RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001 + +#define RADEON_TEST_DEBUG_MUX 0x0124 +#define RADEON_TEST_DEBUG_OUT 0x012c +#define RADEON_TMDS_PLL_CNTL 0x02a8 +#define RADEON_TMDS_TRANSMITTER_CNTL 0x02a4 +# define RADEON_TMDS_TRANSMITTER_PLLEN 1 +# define RADEON_TMDS_TRANSMITTER_PLLRST 2 +#define RADEON_TRAIL_BRES_DEC 0x1614 +#define RADEON_TRAIL_BRES_ERR 0x160c +#define RADEON_TRAIL_BRES_INC 0x1610 +#define RADEON_TRAIL_X 0x1618 +#define RADEON_TRAIL_X_SUB 0x1620 + +#define RADEON_VCLK_ECP_CNTL 0x0008 /* PLL */ +# define RADEON_VCLK_SRC_SEL_MASK 0x03 +# define RADEON_VCLK_SRC_SEL_CPUCLK 0x00 +# define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01 +# define RADEON_VCLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_VCLK_SRC_SEL_PPLLCLK 0x03 +# define RADEON_PIXCLK_ALWAYS_ONb (1<<6) +# define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7) +# define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23) + +#define RADEON_VENDOR_ID 0x0f00 /* PCI */ +#define RADEON_VGA_DDA_CONFIG 0x02e8 +#define RADEON_VGA_DDA_ON_OFF 0x02ec +#define RADEON_VID_BUFFER_CONTROL 0x0900 +#define RADEON_VIDEOMUX_CNTL 0x0190 + + /* VIP bus */ +#define RADEON_VIPH_CH0_DATA 0x0c00 +#define RADEON_VIPH_CH1_DATA 0x0c04 +#define RADEON_VIPH_CH2_DATA 0x0c08 +#define RADEON_VIPH_CH3_DATA 0x0c0c +#define RADEON_VIPH_CH0_ADDR 0x0c10 +#define RADEON_VIPH_CH1_ADDR 0x0c14 +#define RADEON_VIPH_CH2_ADDR 0x0c18 +#define RADEON_VIPH_CH3_ADDR 0x0c1c +#define RADEON_VIPH_CH0_SBCNT 0x0c20 +#define RADEON_VIPH_CH1_SBCNT 0x0c24 +#define RADEON_VIPH_CH2_SBCNT 0x0c28 +#define RADEON_VIPH_CH3_SBCNT 0x0c2c +#define RADEON_VIPH_CH0_ABCNT 0x0c30 +#define RADEON_VIPH_CH1_ABCNT 0x0c34 +#define RADEON_VIPH_CH2_ABCNT 0x0c38 +#define RADEON_VIPH_CH3_ABCNT 0x0c3c +#define RADEON_VIPH_CONTROL 0x0c40 +# define RADEON_VIP_BUSY 0 +# define RADEON_VIP_IDLE 1 +# define RADEON_VIP_RESET 2 +# define RADEON_VIPH_EN (1 << 21) +#define RADEON_VIPH_DV_LAT 0x0c44 +#define RADEON_VIPH_BM_CHUNK 0x0c48 +#define RADEON_VIPH_DV_INT 0x0c4c +#define RADEON_VIPH_TIMEOUT_STAT 0x0c50 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_AK 0x00000010 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000 + +#define RADEON_VIPH_REG_DATA 0x0084 +#define RADEON_VIPH_REG_ADDR 0x0080 + + +#define RADEON_WAIT_UNTIL 0x1720 +# define RADEON_WAIT_CRTC_PFLIP (1 << 0) +# define RADEON_WAIT_RE_CRTC_VLINE (1 << 1) +# define RADEON_WAIT_FE_CRTC_VLINE (1 << 2) +# define RADEON_WAIT_CRTC_VLINE (1 << 3) +# define RADEON_WAIT_DMA_VID_IDLE (1 << 8) +# define RADEON_WAIT_DMA_GUI_IDLE (1 << 9) +# define RADEON_WAIT_CMDFIFO (1 << 10) /* wait for CMDFIFO_ENTRIES */ +# define RADEON_WAIT_OV0_FLIP (1 << 11) +# define RADEON_WAIT_AGP_FLUSH (1 << 13) +# define RADEON_WAIT_2D_IDLE (1 << 14) +# define RADEON_WAIT_3D_IDLE (1 << 15) +# define RADEON_WAIT_2D_IDLECLEAN (1 << 16) +# define RADEON_WAIT_3D_IDLECLEAN (1 << 17) +# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18) +# define RADEON_CMDFIFO_ENTRIES_SHIFT 10 +# define RADEON_CMDFIFO_ENTRIES_MASK 0x7f +# define RADEON_WAIT_VAP_IDLE (1 << 28) +# define RADEON_WAIT_BOTH_CRTC_PFLIP (1 << 30) +# define RADEON_ENG_DISPLAY_SELECT_CRTC0 (0 << 31) +# define RADEON_ENG_DISPLAY_SELECT_CRTC1 (1 << 31) + +#define RADEON_X_MPLL_REF_FB_DIV 0x000a /* PLL */ +#define RADEON_XCLK_CNTL 0x000d /* PLL */ +#define RADEON_XDLL_CNTL 0x000c /* PLL */ +#define RADEON_XPLL_CNTL 0x000b /* PLL */ + + + + /* Registers for 3D/TCL */ +#define RADEON_PP_BORDER_COLOR_0 0x1d40 +#define RADEON_PP_BORDER_COLOR_1 0x1d44 +#define RADEON_PP_BORDER_COLOR_2 0x1d48 +#define RADEON_PP_CNTL 0x1c38 +# define RADEON_STIPPLE_ENABLE (1 << 0) +# define RADEON_SCISSOR_ENABLE (1 << 1) +# define RADEON_PATTERN_ENABLE (1 << 2) +# define RADEON_SHADOW_ENABLE (1 << 3) +# define RADEON_TEX_ENABLE_MASK (0xf << 4) +# define RADEON_TEX_0_ENABLE (1 << 4) +# define RADEON_TEX_1_ENABLE (1 << 5) +# define RADEON_TEX_2_ENABLE (1 << 6) +# define RADEON_TEX_3_ENABLE (1 << 7) +# define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12) +# define RADEON_TEX_BLEND_0_ENABLE (1 << 12) +# define RADEON_TEX_BLEND_1_ENABLE (1 << 13) +# define RADEON_TEX_BLEND_2_ENABLE (1 << 14) +# define RADEON_TEX_BLEND_3_ENABLE (1 << 15) +# define RADEON_PLANAR_YUV_ENABLE (1 << 20) +# define RADEON_SPECULAR_ENABLE (1 << 21) +# define RADEON_FOG_ENABLE (1 << 22) +# define RADEON_ALPHA_TEST_ENABLE (1 << 23) +# define RADEON_ANTI_ALIAS_NONE (0 << 24) +# define RADEON_ANTI_ALIAS_LINE (1 << 24) +# define RADEON_ANTI_ALIAS_POLY (2 << 24) +# define RADEON_ANTI_ALIAS_LINE_POLY (3 << 24) +# define RADEON_BUMP_MAP_ENABLE (1 << 26) +# define RADEON_BUMPED_MAP_T0 (0 << 27) +# define RADEON_BUMPED_MAP_T1 (1 << 27) +# define RADEON_BUMPED_MAP_T2 (2 << 27) +# define RADEON_TEX_3D_ENABLE_0 (1 << 29) +# define RADEON_TEX_3D_ENABLE_1 (1 << 30) +# define RADEON_MC_ENABLE (1 << 31) +#define RADEON_PP_FOG_COLOR 0x1c18 +# define RADEON_FOG_COLOR_MASK 0x00ffffff +# define RADEON_FOG_VERTEX (0 << 24) +# define RADEON_FOG_TABLE (1 << 24) +# define RADEON_FOG_USE_DEPTH (0 << 25) +# define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25) +# define RADEON_FOG_USE_SPEC_ALPHA (3 << 25) +#define RADEON_PP_LUM_MATRIX 0x1d00 +#define RADEON_PP_MISC 0x1c14 +# define RADEON_REF_ALPHA_MASK 0x000000ff +# define RADEON_ALPHA_TEST_FAIL (0 << 8) +# define RADEON_ALPHA_TEST_LESS (1 << 8) +# define RADEON_ALPHA_TEST_LEQUAL (2 << 8) +# define RADEON_ALPHA_TEST_EQUAL (3 << 8) +# define RADEON_ALPHA_TEST_GEQUAL (4 << 8) +# define RADEON_ALPHA_TEST_GREATER (5 << 8) +# define RADEON_ALPHA_TEST_NEQUAL (6 << 8) +# define RADEON_ALPHA_TEST_PASS (7 << 8) +# define RADEON_ALPHA_TEST_OP_MASK (7 << 8) +# define RADEON_CHROMA_FUNC_FAIL (0 << 16) +# define RADEON_CHROMA_FUNC_PASS (1 << 16) +# define RADEON_CHROMA_FUNC_NEQUAL (2 << 16) +# define RADEON_CHROMA_FUNC_EQUAL (3 << 16) +# define RADEON_CHROMA_KEY_NEAREST (0 << 18) +# define RADEON_CHROMA_KEY_ZERO (1 << 18) +# define RADEON_SHADOW_ID_AUTO_INC (1 << 20) +# define RADEON_SHADOW_FUNC_EQUAL (0 << 21) +# define RADEON_SHADOW_FUNC_NEQUAL (1 << 21) +# define RADEON_SHADOW_PASS_1 (0 << 22) +# define RADEON_SHADOW_PASS_2 (1 << 22) +# define RADEON_RIGHT_HAND_CUBE_D3D (0 << 24) +# define RADEON_RIGHT_HAND_CUBE_OGL (1 << 24) +#define RADEON_PP_ROT_MATRIX_0 0x1d58 +#define RADEON_PP_ROT_MATRIX_1 0x1d5c +#define RADEON_PP_TXFILTER_0 0x1c54 +#define RADEON_PP_TXFILTER_1 0x1c6c +#define RADEON_PP_TXFILTER_2 0x1c84 +# define RADEON_MAG_FILTER_NEAREST (0 << 0) +# define RADEON_MAG_FILTER_LINEAR (1 << 0) +# define RADEON_MAG_FILTER_MASK (1 << 0) +# define RADEON_MIN_FILTER_NEAREST (0 << 1) +# define RADEON_MIN_FILTER_LINEAR (1 << 1) +# define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) +# define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) +# define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) +# define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST (8 << 1) +# define RADEON_MIN_FILTER_ANISO_LINEAR (9 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) +# define RADEON_MIN_FILTER_MASK (15 << 1) +# define RADEON_MAX_ANISO_1_TO_1 (0 << 5) +# define RADEON_MAX_ANISO_2_TO_1 (1 << 5) +# define RADEON_MAX_ANISO_4_TO_1 (2 << 5) +# define RADEON_MAX_ANISO_8_TO_1 (3 << 5) +# define RADEON_MAX_ANISO_16_TO_1 (4 << 5) +# define RADEON_MAX_ANISO_MASK (7 << 5) +# define RADEON_LOD_BIAS_MASK (0xff << 8) +# define RADEON_LOD_BIAS_SHIFT 8 +# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16) +# define RADEON_MAX_MIP_LEVEL_SHIFT 16 +# define RADEON_YUV_TO_RGB (1 << 20) +# define RADEON_YUV_TEMPERATURE_COOL (0 << 21) +# define RADEON_YUV_TEMPERATURE_HOT (1 << 21) +# define RADEON_YUV_TEMPERATURE_MASK (1 << 21) +# define RADEON_WRAPEN_S (1 << 22) +# define RADEON_CLAMP_S_WRAP (0 << 23) +# define RADEON_CLAMP_S_MIRROR (1 << 23) +# define RADEON_CLAMP_S_CLAMP_LAST (2 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) +# define RADEON_CLAMP_S_CLAMP_BORDER (4 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +# define RADEON_CLAMP_S_CLAMP_GL (6 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) +# define RADEON_CLAMP_S_MASK (7 << 23) +# define RADEON_WRAPEN_T (1 << 26) +# define RADEON_CLAMP_T_WRAP (0 << 27) +# define RADEON_CLAMP_T_MIRROR (1 << 27) +# define RADEON_CLAMP_T_CLAMP_LAST (2 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) +# define RADEON_CLAMP_T_CLAMP_BORDER (4 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +# define RADEON_CLAMP_T_CLAMP_GL (6 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) +# define RADEON_CLAMP_T_MASK (7 << 27) +# define RADEON_BORDER_MODE_OGL (0 << 31) +# define RADEON_BORDER_MODE_D3D (1 << 31) +#define RADEON_PP_TXFORMAT_0 0x1c58 +#define RADEON_PP_TXFORMAT_1 0x1c70 +#define RADEON_PP_TXFORMAT_2 0x1c88 +# define RADEON_TXFORMAT_I8 (0 << 0) +# define RADEON_TXFORMAT_AI88 (1 << 0) +# define RADEON_TXFORMAT_RGB332 (2 << 0) +# define RADEON_TXFORMAT_ARGB1555 (3 << 0) +# define RADEON_TXFORMAT_RGB565 (4 << 0) +# define RADEON_TXFORMAT_ARGB4444 (5 << 0) +# define RADEON_TXFORMAT_ARGB8888 (6 << 0) +# define RADEON_TXFORMAT_RGBA8888 (7 << 0) +# define RADEON_TXFORMAT_Y8 (8 << 0) +# define RADEON_TXFORMAT_VYUY422 (10 << 0) +# define RADEON_TXFORMAT_YVYU422 (11 << 0) +# define RADEON_TXFORMAT_DXT1 (12 << 0) +# define RADEON_TXFORMAT_DXT23 (14 << 0) +# define RADEON_TXFORMAT_DXT45 (15 << 0) +# define RADEON_TXFORMAT_FORMAT_MASK (31 << 0) +# define RADEON_TXFORMAT_FORMAT_SHIFT 0 +# define RADEON_TXFORMAT_APPLE_YUV_MODE (1 << 5) +# define RADEON_TXFORMAT_ALPHA_IN_MAP (1 << 6) +# define RADEON_TXFORMAT_NON_POWER2 (1 << 7) +# define RADEON_TXFORMAT_WIDTH_MASK (15 << 8) +# define RADEON_TXFORMAT_WIDTH_SHIFT 8 +# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12) +# define RADEON_TXFORMAT_HEIGHT_SHIFT 12 +# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16) +# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16 +# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20) +# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20 +# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) +# define RADEON_TXFORMAT_ENDIAN_NO_SWAP (0 << 26) +# define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26) +# define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26) +# define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26) +# define RADEON_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) +# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) +# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) +# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31) +#define RADEON_PP_CUBIC_FACES_0 0x1d24 +#define RADEON_PP_CUBIC_FACES_1 0x1d28 +#define RADEON_PP_CUBIC_FACES_2 0x1d2c +# define RADEON_FACE_WIDTH_1_SHIFT 0 +# define RADEON_FACE_HEIGHT_1_SHIFT 4 +# define RADEON_FACE_WIDTH_1_MASK (0xf << 0) +# define RADEON_FACE_HEIGHT_1_MASK (0xf << 4) +# define RADEON_FACE_WIDTH_2_SHIFT 8 +# define RADEON_FACE_HEIGHT_2_SHIFT 12 +# define RADEON_FACE_WIDTH_2_MASK (0xf << 8) +# define RADEON_FACE_HEIGHT_2_MASK (0xf << 12) +# define RADEON_FACE_WIDTH_3_SHIFT 16 +# define RADEON_FACE_HEIGHT_3_SHIFT 20 +# define RADEON_FACE_WIDTH_3_MASK (0xf << 16) +# define RADEON_FACE_HEIGHT_3_MASK (0xf << 20) +# define RADEON_FACE_WIDTH_4_SHIFT 24 +# define RADEON_FACE_HEIGHT_4_SHIFT 28 +# define RADEON_FACE_WIDTH_4_MASK (0xf << 24) +# define RADEON_FACE_HEIGHT_4_MASK (0xf << 28) + +#define RADEON_PP_TXOFFSET_0 0x1c5c +#define RADEON_PP_TXOFFSET_1 0x1c74 +#define RADEON_PP_TXOFFSET_2 0x1c8c +# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0) +# define RADEON_TXO_ENDIAN_BYTE_SWAP (1 << 0) +# define RADEON_TXO_ENDIAN_WORD_SWAP (2 << 0) +# define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0) +# define RADEON_TXO_MACRO_LINEAR (0 << 2) +# define RADEON_TXO_MACRO_TILE (1 << 2) +# define RADEON_TXO_MICRO_LINEAR (0 << 3) +# define RADEON_TXO_MICRO_TILE_X2 (1 << 3) +# define RADEON_TXO_MICRO_TILE_OPT (2 << 3) +# define RADEON_TXO_OFFSET_MASK 0xffffffe0 +# define RADEON_TXO_OFFSET_SHIFT 5 + +#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */ +#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4 +#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8 +#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc +#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0 +#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00 +#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04 +#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08 +#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c +#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10 +#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14 +#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18 +#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c +#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20 +#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24 + +#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */ +#define RADEON_PP_TEX_SIZE_1 0x1d0c +#define RADEON_PP_TEX_SIZE_2 0x1d14 +# define RADEON_TEX_USIZE_MASK (0x7ff << 0) +# define RADEON_TEX_USIZE_SHIFT 0 +# define RADEON_TEX_VSIZE_MASK (0x7ff << 16) +# define RADEON_TEX_VSIZE_SHIFT 16 +# define RADEON_SIGNED_RGB_MASK (1 << 30) +# define RADEON_SIGNED_RGB_SHIFT 30 +# define RADEON_SIGNED_ALPHA_MASK (1 << 31) +# define RADEON_SIGNED_ALPHA_SHIFT 31 +#define RADEON_PP_TEX_PITCH_0 0x1d08 /* NPOT */ +#define RADEON_PP_TEX_PITCH_1 0x1d10 /* NPOT */ +#define RADEON_PP_TEX_PITCH_2 0x1d18 /* NPOT */ +/* note: bits 13-5: 32 byte aligned stride of texture map */ + +#define RADEON_PP_TXCBLEND_0 0x1c60 +#define RADEON_PP_TXCBLEND_1 0x1c78 +#define RADEON_PP_TXCBLEND_2 0x1c90 +# define RADEON_COLOR_ARG_A_SHIFT 0 +# define RADEON_COLOR_ARG_A_MASK (0x1f << 0) +# define RADEON_COLOR_ARG_A_ZERO (0 << 0) +# define RADEON_COLOR_ARG_A_CURRENT_COLOR (2 << 0) +# define RADEON_COLOR_ARG_A_CURRENT_ALPHA (3 << 0) +# define RADEON_COLOR_ARG_A_DIFFUSE_COLOR (4 << 0) +# define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0) +# define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6 << 0) +# define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7 << 0) +# define RADEON_COLOR_ARG_A_TFACTOR_COLOR (8 << 0) +# define RADEON_COLOR_ARG_A_TFACTOR_ALPHA (9 << 0) +# define RADEON_COLOR_ARG_A_T0_COLOR (10 << 0) +# define RADEON_COLOR_ARG_A_T0_ALPHA (11 << 0) +# define RADEON_COLOR_ARG_A_T1_COLOR (12 << 0) +# define RADEON_COLOR_ARG_A_T1_ALPHA (13 << 0) +# define RADEON_COLOR_ARG_A_T2_COLOR (14 << 0) +# define RADEON_COLOR_ARG_A_T2_ALPHA (15 << 0) +# define RADEON_COLOR_ARG_A_T3_COLOR (16 << 0) +# define RADEON_COLOR_ARG_A_T3_ALPHA (17 << 0) +# define RADEON_COLOR_ARG_B_SHIFT 5 +# define RADEON_COLOR_ARG_B_MASK (0x1f << 5) +# define RADEON_COLOR_ARG_B_ZERO (0 << 5) +# define RADEON_COLOR_ARG_B_CURRENT_COLOR (2 << 5) +# define RADEON_COLOR_ARG_B_CURRENT_ALPHA (3 << 5) +# define RADEON_COLOR_ARG_B_DIFFUSE_COLOR (4 << 5) +# define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5) +# define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6 << 5) +# define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7 << 5) +# define RADEON_COLOR_ARG_B_TFACTOR_COLOR (8 << 5) +# define RADEON_COLOR_ARG_B_TFACTOR_ALPHA (9 << 5) +# define RADEON_COLOR_ARG_B_T0_COLOR (10 << 5) +# define RADEON_COLOR_ARG_B_T0_ALPHA (11 << 5) +# define RADEON_COLOR_ARG_B_T1_COLOR (12 << 5) +# define RADEON_COLOR_ARG_B_T1_ALPHA (13 << 5) +# define RADEON_COLOR_ARG_B_T2_COLOR (14 << 5) +# define RADEON_COLOR_ARG_B_T2_ALPHA (15 << 5) +# define RADEON_COLOR_ARG_B_T3_COLOR (16 << 5) +# define RADEON_COLOR_ARG_B_T3_ALPHA (17 << 5) +# define RADEON_COLOR_ARG_C_SHIFT 10 +# define RADEON_COLOR_ARG_C_MASK (0x1f << 10) +# define RADEON_COLOR_ARG_C_ZERO (0 << 10) +# define RADEON_COLOR_ARG_C_CURRENT_COLOR (2 << 10) +# define RADEON_COLOR_ARG_C_CURRENT_ALPHA (3 << 10) +# define RADEON_COLOR_ARG_C_DIFFUSE_COLOR (4 << 10) +# define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10) +# define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6 << 10) +# define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7 << 10) +# define RADEON_COLOR_ARG_C_TFACTOR_COLOR (8 << 10) +# define RADEON_COLOR_ARG_C_TFACTOR_ALPHA (9 << 10) +# define RADEON_COLOR_ARG_C_T0_COLOR (10 << 10) +# define RADEON_COLOR_ARG_C_T0_ALPHA (11 << 10) +# define RADEON_COLOR_ARG_C_T1_COLOR (12 << 10) +# define RADEON_COLOR_ARG_C_T1_ALPHA (13 << 10) +# define RADEON_COLOR_ARG_C_T2_COLOR (14 << 10) +# define RADEON_COLOR_ARG_C_T2_ALPHA (15 << 10) +# define RADEON_COLOR_ARG_C_T3_COLOR (16 << 10) +# define RADEON_COLOR_ARG_C_T3_ALPHA (17 << 10) +# define RADEON_COMP_ARG_A (1 << 15) +# define RADEON_COMP_ARG_A_SHIFT 15 +# define RADEON_COMP_ARG_B (1 << 16) +# define RADEON_COMP_ARG_B_SHIFT 16 +# define RADEON_COMP_ARG_C (1 << 17) +# define RADEON_COMP_ARG_C_SHIFT 17 +# define RADEON_BLEND_CTL_MASK (7 << 18) +# define RADEON_BLEND_CTL_ADD (0 << 18) +# define RADEON_BLEND_CTL_SUBTRACT (1 << 18) +# define RADEON_BLEND_CTL_ADDSIGNED (2 << 18) +# define RADEON_BLEND_CTL_BLEND (3 << 18) +# define RADEON_BLEND_CTL_DOT3 (4 << 18) +# define RADEON_SCALE_SHIFT 21 +# define RADEON_SCALE_MASK (3 << 21) +# define RADEON_SCALE_1X (0 << 21) +# define RADEON_SCALE_2X (1 << 21) +# define RADEON_SCALE_4X (2 << 21) +# define RADEON_CLAMP_TX (1 << 23) +# define RADEON_T0_EQ_TCUR (1 << 24) +# define RADEON_T1_EQ_TCUR (1 << 25) +# define RADEON_T2_EQ_TCUR (1 << 26) +# define RADEON_T3_EQ_TCUR (1 << 27) +# define RADEON_COLOR_ARG_MASK 0x1f +# define RADEON_COMP_ARG_SHIFT 15 +#define RADEON_PP_TXABLEND_0 0x1c64 +#define RADEON_PP_TXABLEND_1 0x1c7c +#define RADEON_PP_TXABLEND_2 0x1c94 +# define RADEON_ALPHA_ARG_A_SHIFT 0 +# define RADEON_ALPHA_ARG_A_MASK (0xf << 0) +# define RADEON_ALPHA_ARG_A_ZERO (0 << 0) +# define RADEON_ALPHA_ARG_A_CURRENT_ALPHA (1 << 0) +# define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0) +# define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0) +# define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0) +# define RADEON_ALPHA_ARG_A_T0_ALPHA (5 << 0) +# define RADEON_ALPHA_ARG_A_T1_ALPHA (6 << 0) +# define RADEON_ALPHA_ARG_A_T2_ALPHA (7 << 0) +# define RADEON_ALPHA_ARG_A_T3_ALPHA (8 << 0) +# define RADEON_ALPHA_ARG_B_SHIFT 4 +# define RADEON_ALPHA_ARG_B_MASK (0xf << 4) +# define RADEON_ALPHA_ARG_B_ZERO (0 << 4) +# define RADEON_ALPHA_ARG_B_CURRENT_ALPHA (1 << 4) +# define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4) +# define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4) +# define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4) +# define RADEON_ALPHA_ARG_B_T0_ALPHA (5 << 4) +# define RADEON_ALPHA_ARG_B_T1_ALPHA (6 << 4) +# define RADEON_ALPHA_ARG_B_T2_ALPHA (7 << 4) +# define RADEON_ALPHA_ARG_B_T3_ALPHA (8 << 4) +# define RADEON_ALPHA_ARG_C_SHIFT 8 +# define RADEON_ALPHA_ARG_C_MASK (0xf << 8) +# define RADEON_ALPHA_ARG_C_ZERO (0 << 8) +# define RADEON_ALPHA_ARG_C_CURRENT_ALPHA (1 << 8) +# define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8) +# define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8) +# define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8) +# define RADEON_ALPHA_ARG_C_T0_ALPHA (5 << 8) +# define RADEON_ALPHA_ARG_C_T1_ALPHA (6 << 8) +# define RADEON_ALPHA_ARG_C_T2_ALPHA (7 << 8) +# define RADEON_ALPHA_ARG_C_T3_ALPHA (8 << 8) +# define RADEON_DOT_ALPHA_DONT_REPLICATE (1 << 9) +# define RADEON_ALPHA_ARG_MASK 0xf + +#define RADEON_PP_TFACTOR_0 0x1c68 +#define RADEON_PP_TFACTOR_1 0x1c80 +#define RADEON_PP_TFACTOR_2 0x1c98 + +#define RADEON_RB3D_BLENDCNTL 0x1c20 +# define RADEON_COMB_FCN_MASK (3 << 12) +# define RADEON_COMB_FCN_ADD_CLAMP (0 << 12) +# define RADEON_COMB_FCN_ADD_NOCLAMP (1 << 12) +# define RADEON_COMB_FCN_SUB_CLAMP (2 << 12) +# define RADEON_COMB_FCN_SUB_NOCLAMP (3 << 12) +# define RADEON_SRC_BLEND_GL_ZERO (32 << 16) +# define RADEON_SRC_BLEND_GL_ONE (33 << 16) +# define RADEON_SRC_BLEND_GL_SRC_COLOR (34 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16) +# define RADEON_SRC_BLEND_GL_DST_COLOR (36 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16) +# define RADEON_SRC_BLEND_GL_SRC_ALPHA (38 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16) +# define RADEON_SRC_BLEND_GL_DST_ALPHA (40 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16) +# define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16) +# define RADEON_SRC_BLEND_MASK (63 << 16) +# define RADEON_DST_BLEND_GL_ZERO (32 << 24) +# define RADEON_DST_BLEND_GL_ONE (33 << 24) +# define RADEON_DST_BLEND_GL_SRC_COLOR (34 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24) +# define RADEON_DST_BLEND_GL_DST_COLOR (36 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24) +# define RADEON_DST_BLEND_GL_SRC_ALPHA (38 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24) +# define RADEON_DST_BLEND_GL_DST_ALPHA (40 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24) +# define RADEON_DST_BLEND_MASK (63 << 24) +#define RADEON_RB3D_CNTL 0x1c3c +# define RADEON_ALPHA_BLEND_ENABLE (1 << 0) +# define RADEON_PLANE_MASK_ENABLE (1 << 1) +# define RADEON_DITHER_ENABLE (1 << 2) +# define RADEON_ROUND_ENABLE (1 << 3) +# define RADEON_SCALE_DITHER_ENABLE (1 << 4) +# define RADEON_DITHER_INIT (1 << 5) +# define RADEON_ROP_ENABLE (1 << 6) +# define RADEON_STENCIL_ENABLE (1 << 7) +# define RADEON_Z_ENABLE (1 << 8) +# define RADEON_DEPTH_XZ_OFFEST_ENABLE (1 << 9) +# define RADEON_COLOR_FORMAT_ARGB1555 (3 << 10) +# define RADEON_COLOR_FORMAT_RGB565 (4 << 10) +# define RADEON_COLOR_FORMAT_ARGB8888 (6 << 10) +# define RADEON_COLOR_FORMAT_RGB332 (7 << 10) +# define RADEON_COLOR_FORMAT_Y8 (8 << 10) +# define RADEON_COLOR_FORMAT_RGB8 (9 << 10) +# define RADEON_COLOR_FORMAT_YUV422_VYUY (11 << 10) +# define RADEON_COLOR_FORMAT_YUV422_YVYU (12 << 10) +# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10) +# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10) +# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14) +#define RADEON_RB3D_COLOROFFSET 0x1c40 +# define RADEON_COLOROFFSET_MASK 0xfffffff0 +#define RADEON_RB3D_COLORPITCH 0x1c48 +# define RADEON_COLORPITCH_MASK 0x000001ff8 +# define RADEON_COLOR_TILE_ENABLE (1 << 16) +# define RADEON_COLOR_MICROTILE_ENABLE (1 << 17) +# define RADEON_COLOR_ENDIAN_NO_SWAP (0 << 18) +# define RADEON_COLOR_ENDIAN_WORD_SWAP (1 << 18) +# define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18) +#define RADEON_RB3D_DEPTHOFFSET 0x1c24 +#define RADEON_RB3D_DEPTHPITCH 0x1c28 +# define RADEON_DEPTHPITCH_MASK 0x00001ff8 +# define RADEON_DEPTH_ENDIAN_NO_SWAP (0 << 18) +# define RADEON_DEPTH_ENDIAN_WORD_SWAP (1 << 18) +# define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) +#define RADEON_RB3D_PLANEMASK 0x1d84 +#define RADEON_RB3D_ROPCNTL 0x1d80 +# define RADEON_ROP_MASK (15 << 8) +# define RADEON_ROP_CLEAR (0 << 8) +# define RADEON_ROP_NOR (1 << 8) +# define RADEON_ROP_AND_INVERTED (2 << 8) +# define RADEON_ROP_COPY_INVERTED (3 << 8) +# define RADEON_ROP_AND_REVERSE (4 << 8) +# define RADEON_ROP_INVERT (5 << 8) +# define RADEON_ROP_XOR (6 << 8) +# define RADEON_ROP_NAND (7 << 8) +# define RADEON_ROP_AND (8 << 8) +# define RADEON_ROP_EQUIV (9 << 8) +# define RADEON_ROP_NOOP (10 << 8) +# define RADEON_ROP_OR_INVERTED (11 << 8) +# define RADEON_ROP_COPY (12 << 8) +# define RADEON_ROP_OR_REVERSE (13 << 8) +# define RADEON_ROP_OR (14 << 8) +# define RADEON_ROP_SET (15 << 8) +#define RADEON_RB3D_STENCILREFMASK 0x1d7c +# define RADEON_STENCIL_REF_SHIFT 0 +# define RADEON_STENCIL_REF_MASK (0xff << 0) +# define RADEON_STENCIL_MASK_SHIFT 16 +# define RADEON_STENCIL_VALUE_MASK (0xff << 16) +# define RADEON_STENCIL_WRITEMASK_SHIFT 24 +# define RADEON_STENCIL_WRITE_MASK (0xff << 24) +#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c +# define RADEON_DEPTH_FORMAT_MASK (0xf << 0) +# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_INT_Z (4 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0) +# define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0) +# define RADEON_Z_TEST_NEVER (0 << 4) +# define RADEON_Z_TEST_LESS (1 << 4) +# define RADEON_Z_TEST_LEQUAL (2 << 4) +# define RADEON_Z_TEST_EQUAL (3 << 4) +# define RADEON_Z_TEST_GEQUAL (4 << 4) +# define RADEON_Z_TEST_GREATER (5 << 4) +# define RADEON_Z_TEST_NEQUAL (6 << 4) +# define RADEON_Z_TEST_ALWAYS (7 << 4) +# define RADEON_Z_TEST_MASK (7 << 4) +# define RADEON_STENCIL_TEST_NEVER (0 << 12) +# define RADEON_STENCIL_TEST_LESS (1 << 12) +# define RADEON_STENCIL_TEST_LEQUAL (2 << 12) +# define RADEON_STENCIL_TEST_EQUAL (3 << 12) +# define RADEON_STENCIL_TEST_GEQUAL (4 << 12) +# define RADEON_STENCIL_TEST_GREATER (5 << 12) +# define RADEON_STENCIL_TEST_NEQUAL (6 << 12) +# define RADEON_STENCIL_TEST_ALWAYS (7 << 12) +# define RADEON_STENCIL_TEST_MASK (0x7 << 12) +# define RADEON_STENCIL_FAIL_KEEP (0 << 16) +# define RADEON_STENCIL_FAIL_ZERO (1 << 16) +# define RADEON_STENCIL_FAIL_REPLACE (2 << 16) +# define RADEON_STENCIL_FAIL_INC (3 << 16) +# define RADEON_STENCIL_FAIL_DEC (4 << 16) +# define RADEON_STENCIL_FAIL_INVERT (5 << 16) +# define RADEON_STENCIL_FAIL_MASK (0x7 << 16) +# define RADEON_STENCIL_ZPASS_KEEP (0 << 20) +# define RADEON_STENCIL_ZPASS_ZERO (1 << 20) +# define RADEON_STENCIL_ZPASS_REPLACE (2 << 20) +# define RADEON_STENCIL_ZPASS_INC (3 << 20) +# define RADEON_STENCIL_ZPASS_DEC (4 << 20) +# define RADEON_STENCIL_ZPASS_INVERT (5 << 20) +# define RADEON_STENCIL_ZPASS_MASK (0x7 << 20) +# define RADEON_STENCIL_ZFAIL_KEEP (0 << 24) +# define RADEON_STENCIL_ZFAIL_ZERO (1 << 24) +# define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24) +# define RADEON_STENCIL_ZFAIL_INC (3 << 24) +# define RADEON_STENCIL_ZFAIL_DEC (4 << 24) +# define RADEON_STENCIL_ZFAIL_INVERT (5 << 24) +# define RADEON_STENCIL_ZFAIL_MASK (0x7 << 24) +# define RADEON_Z_COMPRESSION_ENABLE (1 << 28) +# define RADEON_FORCE_Z_DIRTY (1 << 29) +# define RADEON_Z_WRITE_ENABLE (1 << 30) +#define RADEON_RE_LINE_PATTERN 0x1cd0 +# define RADEON_LINE_PATTERN_MASK 0x0000ffff +# define RADEON_LINE_REPEAT_COUNT_SHIFT 16 +# define RADEON_LINE_PATTERN_START_SHIFT 24 +# define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) +# define RADEON_LINE_PATTERN_BIG_BIT_ORDER (1 << 28) +# define RADEON_LINE_PATTERN_AUTO_RESET (1 << 29) +#define RADEON_RE_LINE_STATE 0x1cd4 +# define RADEON_LINE_CURRENT_PTR_SHIFT 0 +# define RADEON_LINE_CURRENT_COUNT_SHIFT 8 +#define RADEON_RE_MISC 0x26c4 +# define RADEON_STIPPLE_COORD_MASK 0x1f +# define RADEON_STIPPLE_X_OFFSET_SHIFT 0 +# define RADEON_STIPPLE_X_OFFSET_MASK (0x1f << 0) +# define RADEON_STIPPLE_Y_OFFSET_SHIFT 8 +# define RADEON_STIPPLE_Y_OFFSET_MASK (0x1f << 8) +# define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16) +# define RADEON_STIPPLE_BIG_BIT_ORDER (1 << 16) +#define RADEON_RE_SOLID_COLOR 0x1c1c +#define RADEON_RE_TOP_LEFT 0x26c0 +# define RADEON_RE_LEFT_SHIFT 0 +# define RADEON_RE_TOP_SHIFT 16 +#define RADEON_RE_WIDTH_HEIGHT 0x1c44 +# define RADEON_RE_WIDTH_SHIFT 0 +# define RADEON_RE_HEIGHT_SHIFT 16 + +#define RADEON_SE_CNTL 0x1c4c +# define RADEON_FFACE_CULL_CW (0 << 0) +# define RADEON_FFACE_CULL_CCW (1 << 0) +# define RADEON_FFACE_CULL_DIR_MASK (1 << 0) +# define RADEON_BFACE_CULL (0 << 1) +# define RADEON_BFACE_SOLID (3 << 1) +# define RADEON_FFACE_CULL (0 << 3) +# define RADEON_FFACE_SOLID (3 << 3) +# define RADEON_FFACE_CULL_MASK (3 << 3) +# define RADEON_BADVTX_CULL_DISABLE (1 << 5) +# define RADEON_FLAT_SHADE_VTX_0 (0 << 6) +# define RADEON_FLAT_SHADE_VTX_1 (1 << 6) +# define RADEON_FLAT_SHADE_VTX_2 (2 << 6) +# define RADEON_FLAT_SHADE_VTX_LAST (3 << 6) +# define RADEON_DIFFUSE_SHADE_SOLID (0 << 8) +# define RADEON_DIFFUSE_SHADE_FLAT (1 << 8) +# define RADEON_DIFFUSE_SHADE_GOURAUD (2 << 8) +# define RADEON_DIFFUSE_SHADE_MASK (3 << 8) +# define RADEON_ALPHA_SHADE_SOLID (0 << 10) +# define RADEON_ALPHA_SHADE_FLAT (1 << 10) +# define RADEON_ALPHA_SHADE_GOURAUD (2 << 10) +# define RADEON_ALPHA_SHADE_MASK (3 << 10) +# define RADEON_SPECULAR_SHADE_SOLID (0 << 12) +# define RADEON_SPECULAR_SHADE_FLAT (1 << 12) +# define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12) +# define RADEON_SPECULAR_SHADE_MASK (3 << 12) +# define RADEON_FOG_SHADE_SOLID (0 << 14) +# define RADEON_FOG_SHADE_FLAT (1 << 14) +# define RADEON_FOG_SHADE_GOURAUD (2 << 14) +# define RADEON_FOG_SHADE_MASK (3 << 14) +# define RADEON_ZBIAS_ENABLE_POINT (1 << 16) +# define RADEON_ZBIAS_ENABLE_LINE (1 << 17) +# define RADEON_ZBIAS_ENABLE_TRI (1 << 18) +# define RADEON_WIDELINE_ENABLE (1 << 20) +# define RADEON_VPORT_XY_XFORM_ENABLE (1 << 24) +# define RADEON_VPORT_Z_XFORM_ENABLE (1 << 25) +# define RADEON_VTX_PIX_CENTER_D3D (0 << 27) +# define RADEON_VTX_PIX_CENTER_OGL (1 << 27) +# define RADEON_ROUND_MODE_TRUNC (0 << 28) +# define RADEON_ROUND_MODE_ROUND (1 << 28) +# define RADEON_ROUND_MODE_ROUND_EVEN (2 << 28) +# define RADEON_ROUND_MODE_ROUND_ODD (3 << 28) +# define RADEON_ROUND_PREC_16TH_PIX (0 << 30) +# define RADEON_ROUND_PREC_8TH_PIX (1 << 30) +# define RADEON_ROUND_PREC_4TH_PIX (2 << 30) +# define RADEON_ROUND_PREC_HALF_PIX (3 << 30) +#define R200_RE_CNTL 0x1c50 +# define R200_STIPPLE_ENABLE 0x1 +# define R200_SCISSOR_ENABLE 0x2 +# define R200_PATTERN_ENABLE 0x4 +# define R200_PERSPECTIVE_ENABLE 0x8 +# define R200_POINT_SMOOTH 0x20 +# define R200_VTX_STQ0_D3D 0x00010000 +# define R200_VTX_STQ1_D3D 0x00040000 +# define R200_VTX_STQ2_D3D 0x00100000 +# define R200_VTX_STQ3_D3D 0x00400000 +# define R200_VTX_STQ4_D3D 0x01000000 +# define R200_VTX_STQ5_D3D 0x04000000 +#define R200_RE_SCISSOR_TL_0 0x1cd8 +#define R200_RE_SCISSOR_BR_0 0x1cdc +#define R200_RE_SCISSOR_TL_1 0x1ce0 +#define R200_RE_SCISSOR_BR_1 0x1ce4 +#define R200_RE_SCISSOR_TL_2 0x1ce8 +#define R200_RE_SCISSOR_BR_2 0x1cec +# define R200_SCISSOR_X_SHIFT 0 +# define R200_SCISSOR_Y_SHIFT 16 +#define RADEON_SE_CNTL_STATUS 0x2140 +# define RADEON_VC_NO_SWAP (0 << 0) +# define RADEON_VC_16BIT_SWAP (1 << 0) +# define RADEON_VC_32BIT_SWAP (2 << 0) +# define RADEON_VC_HALF_DWORD_SWAP (3 << 0) +# define RADEON_TCL_BYPASS (1 << 8) +#define RADEON_SE_COORD_FMT 0x1c50 +# define RADEON_VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0) +# define RADEON_VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1) +# define RADEON_VTX_ST0_NONPARAMETRIC (1 << 8) +# define RADEON_VTX_ST1_NONPARAMETRIC (1 << 9) +# define RADEON_VTX_ST2_NONPARAMETRIC (1 << 10) +# define RADEON_VTX_ST3_NONPARAMETRIC (1 << 11) +# define RADEON_VTX_W0_NORMALIZE (1 << 12) +# define RADEON_VTX_W0_IS_NOT_1_OVER_W0 (1 << 16) +# define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17) +# define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19) +# define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21) +# define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23) +# define RADEON_TEX1_W_ROUTING_USE_W0 (0 << 26) +# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26) +#define RADEON_SE_LINE_WIDTH 0x1db8 +#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c +# define RADEON_LIGHTING_ENABLE (1 << 0) +# define RADEON_LIGHT_IN_MODELSPACE (1 << 1) +# define RADEON_LOCAL_VIEWER (1 << 2) +# define RADEON_NORMALIZE_NORMALS (1 << 3) +# define RADEON_RESCALE_NORMALS (1 << 4) +# define RADEON_SPECULAR_LIGHTS (1 << 5) +# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6) +# define RADEON_LIGHT_ALPHA (1 << 7) +# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8) +# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9) +# define RADEON_LM_SOURCE_STATE_PREMULT 0 +# define RADEON_LM_SOURCE_STATE_MULT 1 +# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2 +# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3 +# define RADEON_EMISSIVE_SOURCE_SHIFT 16 +# define RADEON_AMBIENT_SOURCE_SHIFT 18 +# define RADEON_DIFFUSE_SOURCE_SHIFT 20 +# define RADEON_SPECULAR_SOURCE_SHIFT 22 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED 0x2230 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c +#define RADEON_SE_TCL_MATERIAL_SPECULAR_RED 0x2240 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c +#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c +# define RADEON_MODELVIEW_0_SHIFT 0 +# define RADEON_MODELVIEW_1_SHIFT 4 +# define RADEON_MODELVIEW_2_SHIFT 8 +# define RADEON_MODELVIEW_3_SHIFT 12 +# define RADEON_IT_MODELVIEW_0_SHIFT 16 +# define RADEON_IT_MODELVIEW_1_SHIFT 20 +# define RADEON_IT_MODELVIEW_2_SHIFT 24 +# define RADEON_IT_MODELVIEW_3_SHIFT 28 +#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260 +# define RADEON_MODELPROJECT_0_SHIFT 0 +# define RADEON_MODELPROJECT_1_SHIFT 4 +# define RADEON_MODELPROJECT_2_SHIFT 8 +# define RADEON_MODELPROJECT_3_SHIFT 12 +# define RADEON_TEXMAT_0_SHIFT 16 +# define RADEON_TEXMAT_1_SHIFT 20 +# define RADEON_TEXMAT_2_SHIFT 24 +# define RADEON_TEXMAT_3_SHIFT 28 + + +#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254 +# define RADEON_TCL_VTX_W0 (1 << 0) +# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1) +# define RADEON_TCL_VTX_FP_ALPHA (1 << 2) +# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3) +# define RADEON_TCL_VTX_FP_SPEC (1 << 4) +# define RADEON_TCL_VTX_FP_FOG (1 << 5) +# define RADEON_TCL_VTX_PK_SPEC (1 << 6) +# define RADEON_TCL_VTX_ST0 (1 << 7) +# define RADEON_TCL_VTX_ST1 (1 << 8) +# define RADEON_TCL_VTX_Q1 (1 << 9) +# define RADEON_TCL_VTX_ST2 (1 << 10) +# define RADEON_TCL_VTX_Q2 (1 << 11) +# define RADEON_TCL_VTX_ST3 (1 << 12) +# define RADEON_TCL_VTX_Q3 (1 << 13) +# define RADEON_TCL_VTX_Q0 (1 << 14) +# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15 +# define RADEON_TCL_VTX_NORM0 (1 << 18) +# define RADEON_TCL_VTX_XY1 (1 << 27) +# define RADEON_TCL_VTX_Z1 (1 << 28) +# define RADEON_TCL_VTX_W1 (1 << 29) +# define RADEON_TCL_VTX_NORM1 (1 << 30) +# define RADEON_TCL_VTX_Z0 (1 << 31) + +#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258 +# define RADEON_TCL_COMPUTE_XYZW (1 << 0) +# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1) +# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2) +# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3) +# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4) +# define RADEON_TCL_TEX_INPUT_TEX_0 0 +# define RADEON_TCL_TEX_INPUT_TEX_1 1 +# define RADEON_TCL_TEX_INPUT_TEX_2 2 +# define RADEON_TCL_TEX_INPUT_TEX_3 3 +# define RADEON_TCL_TEX_COMPUTED_TEX_0 8 +# define RADEON_TCL_TEX_COMPUTED_TEX_1 9 +# define RADEON_TCL_TEX_COMPUTED_TEX_2 10 +# define RADEON_TCL_TEX_COMPUTED_TEX_3 11 +# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16 +# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20 +# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24 +# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28 + +#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270 +# define RADEON_LIGHT_0_ENABLE (1 << 0) +# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1) +# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2) +# define RADEON_LIGHT_0_IS_LOCAL (1 << 3) +# define RADEON_LIGHT_0_IS_SPOT (1 << 4) +# define RADEON_LIGHT_0_DUAL_CONE (1 << 5) +# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6) +# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7) +# define RADEON_LIGHT_0_SHIFT 0 +# define RADEON_LIGHT_1_ENABLE (1 << 16) +# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17) +# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18) +# define RADEON_LIGHT_1_IS_LOCAL (1 << 19) +# define RADEON_LIGHT_1_IS_SPOT (1 << 20) +# define RADEON_LIGHT_1_DUAL_CONE (1 << 21) +# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22) +# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23) +# define RADEON_LIGHT_1_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274 +# define RADEON_LIGHT_2_SHIFT 0 +# define RADEON_LIGHT_3_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278 +# define RADEON_LIGHT_4_SHIFT 0 +# define RADEON_LIGHT_5_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c +# define RADEON_LIGHT_6_SHIFT 0 +# define RADEON_LIGHT_7_SHIFT 16 + +#define RADEON_SE_TCL_SHININESS 0x2250 + +#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268 +# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0) +# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1) +# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2) +# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3) +# define RADEON_TEXMAT_0_ENABLE (1 << 4) +# define RADEON_TEXMAT_1_ENABLE (1 << 5) +# define RADEON_TEXMAT_2_ENABLE (1 << 6) +# define RADEON_TEXMAT_3_ENABLE (1 << 7) +# define RADEON_TEXGEN_INPUT_MASK 0xf +# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0 +# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1 +# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2 +# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3 +# define RADEON_TEXGEN_INPUT_OBJ 4 +# define RADEON_TEXGEN_INPUT_EYE 5 +# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6 +# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7 +# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8 +# define RADEON_TEXGEN_0_INPUT_SHIFT 16 +# define RADEON_TEXGEN_1_INPUT_SHIFT 20 +# define RADEON_TEXGEN_2_INPUT_SHIFT 24 +# define RADEON_TEXGEN_3_INPUT_SHIFT 28 + +#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264 +# define RADEON_UCP_IN_CLIP_SPACE (1 << 0) +# define RADEON_UCP_IN_MODEL_SPACE (1 << 1) +# define RADEON_UCP_ENABLE_0 (1 << 2) +# define RADEON_UCP_ENABLE_1 (1 << 3) +# define RADEON_UCP_ENABLE_2 (1 << 4) +# define RADEON_UCP_ENABLE_3 (1 << 5) +# define RADEON_UCP_ENABLE_4 (1 << 6) +# define RADEON_UCP_ENABLE_5 (1 << 7) +# define RADEON_TCL_FOG_MASK (3 << 8) +# define RADEON_TCL_FOG_DISABLE (0 << 8) +# define RADEON_TCL_FOG_EXP (1 << 8) +# define RADEON_TCL_FOG_EXP2 (2 << 8) +# define RADEON_TCL_FOG_LINEAR (3 << 8) +# define RADEON_RNG_BASED_FOG (1 << 10) +# define RADEON_LIGHT_TWOSIDE (1 << 11) +# define RADEON_BLEND_OP_COUNT_MASK (7 << 12) +# define RADEON_BLEND_OP_COUNT_SHIFT 12 +# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16) +# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17) +# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (1 << 18) +# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18) +# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (1 << 19) +# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19) +# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (1 << 20) +# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20) +# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (1 << 21) +# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21) +# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22) +# define RADEON_CULL_FRONT_IS_CW (0 << 28) +# define RADEON_CULL_FRONT_IS_CCW (1 << 28) +# define RADEON_CULL_FRONT (1 << 29) +# define RADEON_CULL_BACK (1 << 30) +# define RADEON_FORCE_W_TO_ONE (1 << 31) + +#define RADEON_SE_VPORT_XSCALE 0x1d98 +#define RADEON_SE_VPORT_XOFFSET 0x1d9c +#define RADEON_SE_VPORT_YSCALE 0x1da0 +#define RADEON_SE_VPORT_YOFFSET 0x1da4 +#define RADEON_SE_VPORT_ZSCALE 0x1da8 +#define RADEON_SE_VPORT_ZOFFSET 0x1dac +#define RADEON_SE_ZBIAS_FACTOR 0x1db0 +#define RADEON_SE_ZBIAS_CONSTANT 0x1db4 + +#define RADEON_SE_VTX_FMT 0x2080 +# define RADEON_SE_VTX_FMT_XY 0x00000000 +# define RADEON_SE_VTX_FMT_W0 0x00000001 +# define RADEON_SE_VTX_FMT_FPCOLOR 0x00000002 +# define RADEON_SE_VTX_FMT_FPALPHA 0x00000004 +# define RADEON_SE_VTX_FMT_PKCOLOR 0x00000008 +# define RADEON_SE_VTX_FMT_FPSPEC 0x00000010 +# define RADEON_SE_VTX_FMT_FPFOG 0x00000020 +# define RADEON_SE_VTX_FMT_PKSPEC 0x00000040 +# define RADEON_SE_VTX_FMT_ST0 0x00000080 +# define RADEON_SE_VTX_FMT_ST1 0x00000100 +# define RADEON_SE_VTX_FMT_Q1 0x00000200 +# define RADEON_SE_VTX_FMT_ST2 0x00000400 +# define RADEON_SE_VTX_FMT_Q2 0x00000800 +# define RADEON_SE_VTX_FMT_ST3 0x00001000 +# define RADEON_SE_VTX_FMT_Q3 0x00002000 +# define RADEON_SE_VTX_FMT_Q0 0x00004000 +# define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000 +# define RADEON_SE_VTX_FMT_N0 0x00040000 +# define RADEON_SE_VTX_FMT_XY1 0x08000000 +# define RADEON_SE_VTX_FMT_Z1 0x10000000 +# define RADEON_SE_VTX_FMT_W1 0x20000000 +# define RADEON_SE_VTX_FMT_N1 0x40000000 +# define RADEON_SE_VTX_FMT_Z 0x80000000 + +#define RADEON_SE_VF_CNTL 0x2084 +# define RADEON_VF_PRIM_TYPE_POINT_LIST 1 +# define RADEON_VF_PRIM_TYPE_LINE_LIST 2 +# define RADEON_VF_PRIM_TYPE_LINE_STRIP 3 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_LIST 4 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_FAN 5 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_STRIP 6 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_FLAG 7 +# define RADEON_VF_PRIM_TYPE_RECTANGLE_LIST 8 +# define RADEON_VF_PRIM_TYPE_POINT_LIST_3 9 +# define RADEON_VF_PRIM_TYPE_LINE_LIST_3 10 +# define RADEON_VF_PRIM_TYPE_SPIRIT_LIST 11 +# define RADEON_VF_PRIM_TYPE_LINE_LOOP 12 +# define RADEON_VF_PRIM_TYPE_QUAD_LIST 13 +# define RADEON_VF_PRIM_TYPE_QUAD_STRIP 14 +# define RADEON_VF_PRIM_TYPE_POLYGON 15 +# define RADEON_VF_PRIM_WALK_STATE (0<<4) +# define RADEON_VF_PRIM_WALK_INDEX (1<<4) +# define RADEON_VF_PRIM_WALK_LIST (2<<4) +# define RADEON_VF_PRIM_WALK_DATA (3<<4) +# define RADEON_VF_COLOR_ORDER_RGBA (1<<6) +# define RADEON_VF_RADEON_MODE (1<<8) +# define RADEON_VF_TCL_OUTPUT_CTL_ENA (1<<9) +# define RADEON_VF_PROG_STREAM_ENA (1<<10) +# define RADEON_VF_INDEX_SIZE_SHIFT 11 +# define RADEON_VF_NUM_VERTICES_SHIFT 16 + +#define RADEON_SE_PORT_DATA0 0x2000 + +#define R200_SE_VAP_CNTL 0x2080 +# define R200_VAP_TCL_ENABLE 0x00000001 +# define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010 +# define R200_VAP_FORCE_W_TO_ONE 0x00010000 +# define R200_VAP_D3D_TEX_DEFAULT 0x00020000 +# define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18 +# define R200_VAP_VF_MAX_VTX_NUM (9 << 18) +# define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000 +#define R200_VF_MAX_VTX_INDX 0x210c +#define R200_VF_MIN_VTX_INDX 0x2110 +#define R200_SE_VTE_CNTL 0x20b0 +# define R200_VPORT_X_SCALE_ENA 0x00000001 +# define R200_VPORT_X_OFFSET_ENA 0x00000002 +# define R200_VPORT_Y_SCALE_ENA 0x00000004 +# define R200_VPORT_Y_OFFSET_ENA 0x00000008 +# define R200_VPORT_Z_SCALE_ENA 0x00000010 +# define R200_VPORT_Z_OFFSET_ENA 0x00000020 +# define R200_VTX_XY_FMT 0x00000100 +# define R200_VTX_Z_FMT 0x00000200 +# define R200_VTX_W0_FMT 0x00000400 +# define R200_VTX_W0_NORMALIZE 0x00000800 +# define R200_VTX_ST_DENORMALIZED 0x00001000 +#define R200_SE_VAP_CNTL_STATUS 0x2140 +# define R200_VC_NO_SWAP (0 << 0) +# define R200_VC_16BIT_SWAP (1 << 0) +# define R200_VC_32BIT_SWAP (2 << 0) +#define R200_RE_AUX_SCISSOR_CNTL 0x26f0 +# define R200_EXCLUSIVE_SCISSOR_0 0x01000000 +# define R200_EXCLUSIVE_SCISSOR_1 0x02000000 +# define R200_EXCLUSIVE_SCISSOR_2 0x04000000 +# define R200_SCISSOR_ENABLE_0 0x10000000 +# define R200_SCISSOR_ENABLE_1 0x20000000 +# define R200_SCISSOR_ENABLE_2 0x40000000 +#define R200_PP_TXFILTER_0 0x2c00 +#define R200_PP_TXFILTER_1 0x2c20 +#define R200_PP_TXFILTER_2 0x2c40 +#define R200_PP_TXFILTER_3 0x2c60 +#define R200_PP_TXFILTER_4 0x2c80 +#define R200_PP_TXFILTER_5 0x2ca0 +# define R200_MAG_FILTER_NEAREST (0 << 0) +# define R200_MAG_FILTER_LINEAR (1 << 0) +# define R200_MAG_FILTER_MASK (1 << 0) +# define R200_MIN_FILTER_NEAREST (0 << 1) +# define R200_MIN_FILTER_LINEAR (1 << 1) +# define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) +# define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) +# define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) +# define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST (8 << 1) +# define R200_MIN_FILTER_ANISO_LINEAR (9 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) +# define R200_MIN_FILTER_MASK (15 << 1) +# define R200_MAX_ANISO_1_TO_1 (0 << 5) +# define R200_MAX_ANISO_2_TO_1 (1 << 5) +# define R200_MAX_ANISO_4_TO_1 (2 << 5) +# define R200_MAX_ANISO_8_TO_1 (3 << 5) +# define R200_MAX_ANISO_16_TO_1 (4 << 5) +# define R200_MAX_ANISO_MASK (7 << 5) +# define R200_MAX_MIP_LEVEL_MASK (0x0f << 16) +# define R200_MAX_MIP_LEVEL_SHIFT 16 +# define R200_YUV_TO_RGB (1 << 20) +# define R200_YUV_TEMPERATURE_COOL (0 << 21) +# define R200_YUV_TEMPERATURE_HOT (1 << 21) +# define R200_YUV_TEMPERATURE_MASK (1 << 21) +# define R200_WRAPEN_S (1 << 22) +# define R200_CLAMP_S_WRAP (0 << 23) +# define R200_CLAMP_S_MIRROR (1 << 23) +# define R200_CLAMP_S_CLAMP_LAST (2 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) +# define R200_CLAMP_S_CLAMP_BORDER (4 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +# define R200_CLAMP_S_CLAMP_GL (6 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) +# define R200_CLAMP_S_MASK (7 << 23) +# define R200_WRAPEN_T (1 << 26) +# define R200_CLAMP_T_WRAP (0 << 27) +# define R200_CLAMP_T_MIRROR (1 << 27) +# define R200_CLAMP_T_CLAMP_LAST (2 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) +# define R200_CLAMP_T_CLAMP_BORDER (4 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +# define R200_CLAMP_T_CLAMP_GL (6 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) +# define R200_CLAMP_T_MASK (7 << 27) +# define R200_KILL_LT_ZERO (1 << 30) +# define R200_BORDER_MODE_OGL (0 << 31) +# define R200_BORDER_MODE_D3D (1 << 31) +#define R200_PP_TXFORMAT_0 0x2c04 +#define R200_PP_TXFORMAT_1 0x2c24 +#define R200_PP_TXFORMAT_2 0x2c44 +#define R200_PP_TXFORMAT_3 0x2c64 +#define R200_PP_TXFORMAT_4 0x2c84 +#define R200_PP_TXFORMAT_5 0x2ca4 +# define R200_TXFORMAT_I8 (0 << 0) +# define R200_TXFORMAT_AI88 (1 << 0) +# define R200_TXFORMAT_RGB332 (2 << 0) +# define R200_TXFORMAT_ARGB1555 (3 << 0) +# define R200_TXFORMAT_RGB565 (4 << 0) +# define R200_TXFORMAT_ARGB4444 (5 << 0) +# define R200_TXFORMAT_ARGB8888 (6 << 0) +# define R200_TXFORMAT_RGBA8888 (7 << 0) +# define R200_TXFORMAT_Y8 (8 << 0) +# define R200_TXFORMAT_AVYU4444 (9 << 0) +# define R200_TXFORMAT_VYUY422 (10 << 0) +# define R200_TXFORMAT_YVYU422 (11 << 0) +# define R200_TXFORMAT_DXT1 (12 << 0) +# define R200_TXFORMAT_DXT23 (14 << 0) +# define R200_TXFORMAT_DXT45 (15 << 0) +# define R200_TXFORMAT_ABGR8888 (22 << 0) +# define R200_TXFORMAT_FORMAT_MASK (31 << 0) +# define R200_TXFORMAT_FORMAT_SHIFT 0 +# define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6) +# define R200_TXFORMAT_NON_POWER2 (1 << 7) +# define R200_TXFORMAT_WIDTH_MASK (15 << 8) +# define R200_TXFORMAT_WIDTH_SHIFT 8 +# define R200_TXFORMAT_HEIGHT_MASK (15 << 12) +# define R200_TXFORMAT_HEIGHT_SHIFT 12 +# define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ +# define R200_TXFORMAT_F5_WIDTH_SHIFT 16 +# define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) +# define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 +# define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) +# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) +# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 +# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) +# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) +# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) +#define R200_PP_TXFORMAT_X_0 0x2c08 +#define R200_PP_TXFORMAT_X_1 0x2c28 +#define R200_PP_TXFORMAT_X_2 0x2c48 +#define R200_PP_TXFORMAT_X_3 0x2c68 +#define R200_PP_TXFORMAT_X_4 0x2c88 +#define R200_PP_TXFORMAT_X_5 0x2ca8 + +#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ +#define R200_PP_TXSIZE_1 0x2c2c /* NPOT only */ +#define R200_PP_TXSIZE_2 0x2c4c /* NPOT only */ +#define R200_PP_TXSIZE_3 0x2c6c /* NPOT only */ +#define R200_PP_TXSIZE_4 0x2c8c /* NPOT only */ +#define R200_PP_TXSIZE_5 0x2cac /* NPOT only */ + +#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ +#define R200_PP_TXPITCH_1 0x2c30 /* NPOT only */ +#define R200_PP_TXPITCH_2 0x2c50 /* NPOT only */ +#define R200_PP_TXPITCH_3 0x2c70 /* NPOT only */ +#define R200_PP_TXPITCH_4 0x2c90 /* NPOT only */ +#define R200_PP_TXPITCH_5 0x2cb0 /* NPOT only */ + +#define R200_PP_TXOFFSET_0 0x2d00 +# define R200_TXO_ENDIAN_NO_SWAP (0 << 0) +# define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0) +# define R200_TXO_ENDIAN_WORD_SWAP (2 << 0) +# define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0) +# define R200_TXO_MACRO_LINEAR (0 << 2) +# define R200_TXO_MACRO_TILE (1 << 2) +# define R200_TXO_MICRO_LINEAR (0 << 3) +# define R200_TXO_MICRO_TILE (1 << 3) +# define R200_TXO_OFFSET_MASK 0xffffffe0 +# define R200_TXO_OFFSET_SHIFT 5 +#define R200_PP_TXOFFSET_1 0x2d18 +#define R200_PP_TXOFFSET_2 0x2d30 +#define R200_PP_TXOFFSET_3 0x2d48 +#define R200_PP_TXOFFSET_4 0x2d60 +#define R200_PP_TXOFFSET_5 0x2d78 + +#define R200_PP_TFACTOR_0 0x2ee0 +#define R200_PP_TFACTOR_1 0x2ee4 +#define R200_PP_TFACTOR_2 0x2ee8 +#define R200_PP_TFACTOR_3 0x2eec +#define R200_PP_TFACTOR_4 0x2ef0 +#define R200_PP_TFACTOR_5 0x2ef4 + +#define R200_PP_TXCBLEND_0 0x2f00 +# define R200_TXC_ARG_A_ZERO (0) +# define R200_TXC_ARG_A_CURRENT_COLOR (2) +# define R200_TXC_ARG_A_CURRENT_ALPHA (3) +# define R200_TXC_ARG_A_DIFFUSE_COLOR (4) +# define R200_TXC_ARG_A_DIFFUSE_ALPHA (5) +# define R200_TXC_ARG_A_SPECULAR_COLOR (6) +# define R200_TXC_ARG_A_SPECULAR_ALPHA (7) +# define R200_TXC_ARG_A_TFACTOR_COLOR (8) +# define R200_TXC_ARG_A_TFACTOR_ALPHA (9) +# define R200_TXC_ARG_A_R0_COLOR (10) +# define R200_TXC_ARG_A_R0_ALPHA (11) +# define R200_TXC_ARG_A_R1_COLOR (12) +# define R200_TXC_ARG_A_R1_ALPHA (13) +# define R200_TXC_ARG_A_R2_COLOR (14) +# define R200_TXC_ARG_A_R2_ALPHA (15) +# define R200_TXC_ARG_A_R3_COLOR (16) +# define R200_TXC_ARG_A_R3_ALPHA (17) +# define R200_TXC_ARG_A_R4_COLOR (18) +# define R200_TXC_ARG_A_R4_ALPHA (19) +# define R200_TXC_ARG_A_R5_COLOR (20) +# define R200_TXC_ARG_A_R5_ALPHA (21) +# define R200_TXC_ARG_A_TFACTOR1_COLOR (26) +# define R200_TXC_ARG_A_TFACTOR1_ALPHA (27) +# define R200_TXC_ARG_A_MASK (31 << 0) +# define R200_TXC_ARG_A_SHIFT 0 +# define R200_TXC_ARG_B_ZERO (0 << 5) +# define R200_TXC_ARG_B_CURRENT_COLOR (2 << 5) +# define R200_TXC_ARG_B_CURRENT_ALPHA (3 << 5) +# define R200_TXC_ARG_B_DIFFUSE_COLOR (4 << 5) +# define R200_TXC_ARG_B_DIFFUSE_ALPHA (5 << 5) +# define R200_TXC_ARG_B_SPECULAR_COLOR (6 << 5) +# define R200_TXC_ARG_B_SPECULAR_ALPHA (7 << 5) +# define R200_TXC_ARG_B_TFACTOR_COLOR (8 << 5) +# define R200_TXC_ARG_B_TFACTOR_ALPHA (9 << 5) +# define R200_TXC_ARG_B_R0_COLOR (10 << 5) +# define R200_TXC_ARG_B_R0_ALPHA (11 << 5) +# define R200_TXC_ARG_B_R1_COLOR (12 << 5) +# define R200_TXC_ARG_B_R1_ALPHA (13 << 5) +# define R200_TXC_ARG_B_R2_COLOR (14 << 5) +# define R200_TXC_ARG_B_R2_ALPHA (15 << 5) +# define R200_TXC_ARG_B_R3_COLOR (16 << 5) +# define R200_TXC_ARG_B_R3_ALPHA (17 << 5) +# define R200_TXC_ARG_B_R4_COLOR (18 << 5) +# define R200_TXC_ARG_B_R4_ALPHA (19 << 5) +# define R200_TXC_ARG_B_R5_COLOR (20 << 5) +# define R200_TXC_ARG_B_R5_ALPHA (21 << 5) +# define R200_TXC_ARG_B_TFACTOR1_COLOR (26 << 5) +# define R200_TXC_ARG_B_TFACTOR1_ALPHA (27 << 5) +# define R200_TXC_ARG_B_MASK (31 << 5) +# define R200_TXC_ARG_B_SHIFT 5 +# define R200_TXC_ARG_C_ZERO (0 << 10) +# define R200_TXC_ARG_C_CURRENT_COLOR (2 << 10) +# define R200_TXC_ARG_C_CURRENT_ALPHA (3 << 10) +# define R200_TXC_ARG_C_DIFFUSE_COLOR (4 << 10) +# define R200_TXC_ARG_C_DIFFUSE_ALPHA (5 << 10) +# define R200_TXC_ARG_C_SPECULAR_COLOR (6 << 10) +# define R200_TXC_ARG_C_SPECULAR_ALPHA (7 << 10) +# define R200_TXC_ARG_C_TFACTOR_COLOR (8 << 10) +# define R200_TXC_ARG_C_TFACTOR_ALPHA (9 << 10) +# define R200_TXC_ARG_C_R0_COLOR (10 << 10) +# define R200_TXC_ARG_C_R0_ALPHA (11 << 10) +# define R200_TXC_ARG_C_R1_COLOR (12 << 10) +# define R200_TXC_ARG_C_R1_ALPHA (13 << 10) +# define R200_TXC_ARG_C_R2_COLOR (14 << 10) +# define R200_TXC_ARG_C_R2_ALPHA (15 << 10) +# define R200_TXC_ARG_C_R3_COLOR (16 << 10) +# define R200_TXC_ARG_C_R3_ALPHA (17 << 10) +# define R200_TXC_ARG_C_R4_COLOR (18 << 10) +# define R200_TXC_ARG_C_R4_ALPHA (19 << 10) +# define R200_TXC_ARG_C_R5_COLOR (20 << 10) +# define R200_TXC_ARG_C_R5_ALPHA (21 << 10) +# define R200_TXC_ARG_C_TFACTOR1_COLOR (26 << 10) +# define R200_TXC_ARG_C_TFACTOR1_ALPHA (27 << 10) +# define R200_TXC_ARG_C_MASK (31 << 10) +# define R200_TXC_ARG_C_SHIFT 10 +# define R200_TXC_COMP_ARG_A (1 << 16) +# define R200_TXC_COMP_ARG_A_SHIFT (16) +# define R200_TXC_BIAS_ARG_A (1 << 17) +# define R200_TXC_SCALE_ARG_A (1 << 18) +# define R200_TXC_NEG_ARG_A (1 << 19) +# define R200_TXC_COMP_ARG_B (1 << 20) +# define R200_TXC_COMP_ARG_B_SHIFT (20) +# define R200_TXC_BIAS_ARG_B (1 << 21) +# define R200_TXC_SCALE_ARG_B (1 << 22) +# define R200_TXC_NEG_ARG_B (1 << 23) +# define R200_TXC_COMP_ARG_C (1 << 24) +# define R200_TXC_COMP_ARG_C_SHIFT (24) +# define R200_TXC_BIAS_ARG_C (1 << 25) +# define R200_TXC_SCALE_ARG_C (1 << 26) +# define R200_TXC_NEG_ARG_C (1 << 27) +# define R200_TXC_OP_MADD (0 << 28) +# define R200_TXC_OP_CND0 (2 << 28) +# define R200_TXC_OP_LERP (3 << 28) +# define R200_TXC_OP_DOT3 (4 << 28) +# define R200_TXC_OP_DOT4 (5 << 28) +# define R200_TXC_OP_CONDITIONAL (6 << 28) +# define R200_TXC_OP_DOT2_ADD (7 << 28) +# define R200_TXC_OP_MASK (7 << 28) +#define R200_PP_TXCBLEND2_0 0x2f04 +# define R200_TXC_TFACTOR_SEL_SHIFT 0 +# define R200_TXC_TFACTOR_SEL_MASK 0x7 +# define R200_TXC_TFACTOR1_SEL_SHIFT 4 +# define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4) +# define R200_TXC_SCALE_SHIFT 8 +# define R200_TXC_SCALE_MASK (7 << 8) +# define R200_TXC_SCALE_1X (0 << 8) +# define R200_TXC_SCALE_2X (1 << 8) +# define R200_TXC_SCALE_4X (2 << 8) +# define R200_TXC_SCALE_8X (3 << 8) +# define R200_TXC_SCALE_INV2 (5 << 8) +# define R200_TXC_SCALE_INV4 (6 << 8) +# define R200_TXC_SCALE_INV8 (7 << 8) +# define R200_TXC_CLAMP_SHIFT 12 +# define R200_TXC_CLAMP_MASK (3 << 12) +# define R200_TXC_CLAMP_WRAP (0 << 12) +# define R200_TXC_CLAMP_0_1 (1 << 12) +# define R200_TXC_CLAMP_8_8 (2 << 12) +# define R200_TXC_OUTPUT_REG_MASK (7 << 16) +# define R200_TXC_OUTPUT_REG_NONE (0 << 16) +# define R200_TXC_OUTPUT_REG_R0 (1 << 16) +# define R200_TXC_OUTPUT_REG_R1 (2 << 16) +# define R200_TXC_OUTPUT_REG_R2 (3 << 16) +# define R200_TXC_OUTPUT_REG_R3 (4 << 16) +# define R200_TXC_OUTPUT_REG_R4 (5 << 16) +# define R200_TXC_OUTPUT_REG_R5 (6 << 16) +# define R200_TXC_OUTPUT_MASK_MASK (7 << 20) +# define R200_TXC_OUTPUT_MASK_RGB (0 << 20) +# define R200_TXC_OUTPUT_MASK_RG (1 << 20) +# define R200_TXC_OUTPUT_MASK_RB (2 << 20) +# define R200_TXC_OUTPUT_MASK_R (3 << 20) +# define R200_TXC_OUTPUT_MASK_GB (4 << 20) +# define R200_TXC_OUTPUT_MASK_G (5 << 20) +# define R200_TXC_OUTPUT_MASK_B (6 << 20) +# define R200_TXC_OUTPUT_MASK_NONE (7 << 20) +# define R200_TXC_REPL_NORMAL 0 +# define R200_TXC_REPL_RED 1 +# define R200_TXC_REPL_GREEN 2 +# define R200_TXC_REPL_BLUE 3 +# define R200_TXC_REPL_ARG_A_SHIFT 26 +# define R200_TXC_REPL_ARG_A_MASK (3 << 26) +# define R200_TXC_REPL_ARG_B_SHIFT 28 +# define R200_TXC_REPL_ARG_B_MASK (3 << 28) +# define R200_TXC_REPL_ARG_C_SHIFT 30 +# define R200_TXC_REPL_ARG_C_MASK (3 << 30) +#define R200_PP_TXABLEND_0 0x2f08 +# define R200_TXA_ARG_A_ZERO (0) +# define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */ +# define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */ +# define R200_TXA_ARG_A_DIFFUSE_ALPHA (4) +# define R200_TXA_ARG_A_DIFFUSE_BLUE (5) +# define R200_TXA_ARG_A_SPECULAR_ALPHA (6) +# define R200_TXA_ARG_A_SPECULAR_BLUE (7) +# define R200_TXA_ARG_A_TFACTOR_ALPHA (8) +# define R200_TXA_ARG_A_TFACTOR_BLUE (9) +# define R200_TXA_ARG_A_R0_ALPHA (10) +# define R200_TXA_ARG_A_R0_BLUE (11) +# define R200_TXA_ARG_A_R1_ALPHA (12) +# define R200_TXA_ARG_A_R1_BLUE (13) +# define R200_TXA_ARG_A_R2_ALPHA (14) +# define R200_TXA_ARG_A_R2_BLUE (15) +# define R200_TXA_ARG_A_R3_ALPHA (16) +# define R200_TXA_ARG_A_R3_BLUE (17) +# define R200_TXA_ARG_A_R4_ALPHA (18) +# define R200_TXA_ARG_A_R4_BLUE (19) +# define R200_TXA_ARG_A_R5_ALPHA (20) +# define R200_TXA_ARG_A_R5_BLUE (21) +# define R200_TXA_ARG_A_TFACTOR1_ALPHA (26) +# define R200_TXA_ARG_A_TFACTOR1_BLUE (27) +# define R200_TXA_ARG_A_MASK (31 << 0) +# define R200_TXA_ARG_A_SHIFT 0 +# define R200_TXA_ARG_B_ZERO (0 << 5) +# define R200_TXA_ARG_B_CURRENT_ALPHA (2 << 5) /* guess */ +# define R200_TXA_ARG_B_CURRENT_BLUE (3 << 5) /* guess */ +# define R200_TXA_ARG_B_DIFFUSE_ALPHA (4 << 5) +# define R200_TXA_ARG_B_DIFFUSE_BLUE (5 << 5) +# define R200_TXA_ARG_B_SPECULAR_ALPHA (6 << 5) +# define R200_TXA_ARG_B_SPECULAR_BLUE (7 << 5) +# define R200_TXA_ARG_B_TFACTOR_ALPHA (8 << 5) +# define R200_TXA_ARG_B_TFACTOR_BLUE (9 << 5) +# define R200_TXA_ARG_B_R0_ALPHA (10 << 5) +# define R200_TXA_ARG_B_R0_BLUE (11 << 5) +# define R200_TXA_ARG_B_R1_ALPHA (12 << 5) +# define R200_TXA_ARG_B_R1_BLUE (13 << 5) +# define R200_TXA_ARG_B_R2_ALPHA (14 << 5) +# define R200_TXA_ARG_B_R2_BLUE (15 << 5) +# define R200_TXA_ARG_B_R3_ALPHA (16 << 5) +# define R200_TXA_ARG_B_R3_BLUE (17 << 5) +# define R200_TXA_ARG_B_R4_ALPHA (18 << 5) +# define R200_TXA_ARG_B_R4_BLUE (19 << 5) +# define R200_TXA_ARG_B_R5_ALPHA (20 << 5) +# define R200_TXA_ARG_B_R5_BLUE (21 << 5) +# define R200_TXA_ARG_B_TFACTOR1_ALPHA (26 << 5) +# define R200_TXA_ARG_B_TFACTOR1_BLUE (27 << 5) +# define R200_TXA_ARG_B_MASK (31 << 5) +# define R200_TXA_ARG_B_SHIFT 5 +# define R200_TXA_ARG_C_ZERO (0 << 10) +# define R200_TXA_ARG_C_CURRENT_ALPHA (2 << 10) /* guess */ +# define R200_TXA_ARG_C_CURRENT_BLUE (3 << 10) /* guess */ +# define R200_TXA_ARG_C_DIFFUSE_ALPHA (4 << 10) +# define R200_TXA_ARG_C_DIFFUSE_BLUE (5 << 10) +# define R200_TXA_ARG_C_SPECULAR_ALPHA (6 << 10) +# define R200_TXA_ARG_C_SPECULAR_BLUE (7 << 10) +# define R200_TXA_ARG_C_TFACTOR_ALPHA (8 << 10) +# define R200_TXA_ARG_C_TFACTOR_BLUE (9 << 10) +# define R200_TXA_ARG_C_R0_ALPHA (10 << 10) +# define R200_TXA_ARG_C_R0_BLUE (11 << 10) +# define R200_TXA_ARG_C_R1_ALPHA (12 << 10) +# define R200_TXA_ARG_C_R1_BLUE (13 << 10) +# define R200_TXA_ARG_C_R2_ALPHA (14 << 10) +# define R200_TXA_ARG_C_R2_BLUE (15 << 10) +# define R200_TXA_ARG_C_R3_ALPHA (16 << 10) +# define R200_TXA_ARG_C_R3_BLUE (17 << 10) +# define R200_TXA_ARG_C_R4_ALPHA (18 << 10) +# define R200_TXA_ARG_C_R4_BLUE (19 << 10) +# define R200_TXA_ARG_C_R5_ALPHA (20 << 10) +# define R200_TXA_ARG_C_R5_BLUE (21 << 10) +# define R200_TXA_ARG_C_TFACTOR1_ALPHA (26 << 10) +# define R200_TXA_ARG_C_TFACTOR1_BLUE (27 << 10) +# define R200_TXA_ARG_C_MASK (31 << 10) +# define R200_TXA_ARG_C_SHIFT 10 +# define R200_TXA_COMP_ARG_A (1 << 16) +# define R200_TXA_COMP_ARG_A_SHIFT (16) +# define R200_TXA_BIAS_ARG_A (1 << 17) +# define R200_TXA_SCALE_ARG_A (1 << 18) +# define R200_TXA_NEG_ARG_A (1 << 19) +# define R200_TXA_COMP_ARG_B (1 << 20) +# define R200_TXA_COMP_ARG_B_SHIFT (20) +# define R200_TXA_BIAS_ARG_B (1 << 21) +# define R200_TXA_SCALE_ARG_B (1 << 22) +# define R200_TXA_NEG_ARG_B (1 << 23) +# define R200_TXA_COMP_ARG_C (1 << 24) +# define R200_TXA_COMP_ARG_C_SHIFT (24) +# define R200_TXA_BIAS_ARG_C (1 << 25) +# define R200_TXA_SCALE_ARG_C (1 << 26) +# define R200_TXA_NEG_ARG_C (1 << 27) +# define R200_TXA_OP_MADD (0 << 28) +# define R200_TXA_OP_CND0 (2 << 28) +# define R200_TXA_OP_LERP (3 << 28) +# define R200_TXA_OP_CONDITIONAL (6 << 28) +# define R200_TXA_OP_MASK (7 << 28) +#define R200_PP_TXABLEND2_0 0x2f0c +# define R200_TXA_TFACTOR_SEL_SHIFT 0 +# define R200_TXA_TFACTOR_SEL_MASK 0x7 +# define R200_TXA_TFACTOR1_SEL_SHIFT 4 +# define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4) +# define R200_TXA_SCALE_SHIFT 8 +# define R200_TXA_SCALE_MASK (7 << 8) +# define R200_TXA_SCALE_1X (0 << 8) +# define R200_TXA_SCALE_2X (1 << 8) +# define R200_TXA_SCALE_4X (2 << 8) +# define R200_TXA_SCALE_8X (3 << 8) +# define R200_TXA_SCALE_INV2 (5 << 8) +# define R200_TXA_SCALE_INV4 (6 << 8) +# define R200_TXA_SCALE_INV8 (7 << 8) +# define R200_TXA_CLAMP_SHIFT 12 +# define R200_TXA_CLAMP_MASK (3 << 12) +# define R200_TXA_CLAMP_WRAP (0 << 12) +# define R200_TXA_CLAMP_0_1 (1 << 12) +# define R200_TXA_CLAMP_8_8 (2 << 12) +# define R200_TXA_OUTPUT_REG_MASK (7 << 16) +# define R200_TXA_OUTPUT_REG_NONE (0 << 16) +# define R200_TXA_OUTPUT_REG_R0 (1 << 16) +# define R200_TXA_OUTPUT_REG_R1 (2 << 16) +# define R200_TXA_OUTPUT_REG_R2 (3 << 16) +# define R200_TXA_OUTPUT_REG_R3 (4 << 16) +# define R200_TXA_OUTPUT_REG_R4 (5 << 16) +# define R200_TXA_OUTPUT_REG_R5 (6 << 16) +# define R200_TXA_DOT_ALPHA (1 << 20) +# define R200_TXA_REPL_NORMAL 0 +# define R200_TXA_REPL_RED 1 +# define R200_TXA_REPL_GREEN 2 +# define R200_TXA_REPL_ARG_A_SHIFT 26 +# define R200_TXA_REPL_ARG_A_MASK (3 << 26) +# define R200_TXA_REPL_ARG_B_SHIFT 28 +# define R200_TXA_REPL_ARG_B_MASK (3 << 28) +# define R200_TXA_REPL_ARG_C_SHIFT 30 +# define R200_TXA_REPL_ARG_C_MASK (3 << 30) +#define R200_PP_TXCBLEND_1 0x2f10 +#define R200_PP_TXCBLEND2_1 0x2f14 +#define R200_PP_TXABLEND_1 0x2f18 +#define R200_PP_TXABLEND2_1 0x2f1c +#define R200_PP_TXCBLEND_2 0x2f20 +#define R200_PP_TXCBLEND2_2 0x2f24 +#define R200_PP_TXABLEND_2 0x2f28 +#define R200_PP_TXABLEND2_2 0x2f2c +#define R200_PP_TXCBLEND_3 0x2f30 +#define R200_PP_TXCBLEND2_3 0x2f34 +#define R200_PP_TXABLEND_3 0x2f38 +#define R200_PP_TXABLEND2_3 0x2f3c + +#define R200_SE_VTX_FMT_0 0x2088 +# define R200_VTX_XY 0 /* always have xy */ +# define R200_VTX_Z0 (1<<0) +# define R200_VTX_W0 (1<<1) +# define R200_VTX_WEIGHT_COUNT_SHIFT (2) +# define R200_VTX_PV_MATRIX_SEL (1<<5) +# define R200_VTX_N0 (1<<6) +# define R200_VTX_POINT_SIZE (1<<7) +# define R200_VTX_DISCRETE_FOG (1<<8) +# define R200_VTX_SHININESS_0 (1<<9) +# define R200_VTX_SHININESS_1 (1<<10) +# define R200_VTX_COLOR_NOT_PRESENT 0 +# define R200_VTX_PK_RGBA 1 +# define R200_VTX_FP_RGB 2 +# define R200_VTX_FP_RGBA 3 +# define R200_VTX_COLOR_MASK 3 +# define R200_VTX_COLOR_0_SHIFT 11 +# define R200_VTX_COLOR_1_SHIFT 13 +# define R200_VTX_COLOR_2_SHIFT 15 +# define R200_VTX_COLOR_3_SHIFT 17 +# define R200_VTX_COLOR_4_SHIFT 19 +# define R200_VTX_COLOR_5_SHIFT 21 +# define R200_VTX_COLOR_6_SHIFT 23 +# define R200_VTX_COLOR_7_SHIFT 25 +# define R200_VTX_XY1 (1<<28) +# define R200_VTX_Z1 (1<<29) +# define R200_VTX_W1 (1<<30) +# define R200_VTX_N1 (1<<31) +#define R200_SE_VTX_FMT_1 0x208c +# define R200_VTX_TEX0_COMP_CNT_SHIFT 0 +# define R200_VTX_TEX1_COMP_CNT_SHIFT 3 +# define R200_VTX_TEX2_COMP_CNT_SHIFT 6 +# define R200_VTX_TEX3_COMP_CNT_SHIFT 9 +# define R200_VTX_TEX4_COMP_CNT_SHIFT 12 +# define R200_VTX_TEX5_COMP_CNT_SHIFT 15 + +#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 +#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 +#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250 +# define R200_OUTPUT_XYZW (1<<0) +# define R200_OUTPUT_COLOR_0 (1<<8) +# define R200_OUTPUT_COLOR_1 (1<<9) +# define R200_OUTPUT_TEX_0 (1<<16) +# define R200_OUTPUT_TEX_1 (1<<17) +# define R200_OUTPUT_TEX_2 (1<<18) +# define R200_OUTPUT_TEX_3 (1<<19) +# define R200_OUTPUT_TEX_4 (1<<20) +# define R200_OUTPUT_TEX_5 (1<<21) +# define R200_OUTPUT_TEX_MASK (0x3f<<16) +# define R200_OUTPUT_DISCRETE_FOG (1<<24) +# define R200_OUTPUT_PT_SIZE (1<<25) +# define R200_FORCE_INORDER_PROC (1<<31) +#define R200_PP_CNTL_X 0x2cc4 +#define R200_PP_TXMULTI_CTL_0 0x2c1c +#define R200_SE_VTX_STATE_CNTL 0x2180 +# define R200_UPDATE_USER_COLOR_0_ENA_MASK (1<<16) + + /* Registers for CP and Microcode Engine */ +#define RADEON_CP_ME_RAM_ADDR 0x07d4 +#define RADEON_CP_ME_RAM_RADDR 0x07d8 +#define RADEON_CP_ME_RAM_DATAH 0x07dc +#define RADEON_CP_ME_RAM_DATAL 0x07e0 + +#define RADEON_CP_RB_BASE 0x0700 +#define RADEON_CP_RB_CNTL 0x0704 +#define RADEON_CP_RB_RPTR_ADDR 0x070c +#define RADEON_CP_RB_RPTR 0x0710 +#define RADEON_CP_RB_WPTR 0x0714 + +#define RADEON_CP_IB_BASE 0x0738 +#define RADEON_CP_IB_BUFSZ 0x073c + +#define RADEON_CP_CSQ_CNTL 0x0740 +# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0) +# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28) +# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28) +# define RADEON_CSQ_PRIBM_INDDIS (2 << 28) +# define RADEON_CSQ_PRIPIO_INDBM (3 << 28) +# define RADEON_CSQ_PRIBM_INDBM (4 << 28) +# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28) +#define RADEON_CP_CSQ_STAT 0x07f8 +# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0) +# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8) +# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16) +# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24) +#define RADEON_CP_CSQ_ADDR 0x07f0 +#define RADEON_CP_CSQ_DATA 0x07f4 +#define RADEON_CP_CSQ_APER_PRIMARY 0x1000 +#define RADEON_CP_CSQ_APER_INDIRECT 0x1300 + +#define RADEON_CP_RB_WPTR_DELAY 0x0718 +# define RADEON_PRE_WRITE_TIMER_SHIFT 0 +# define RADEON_PRE_WRITE_LIMIT_SHIFT 23 + +#define RADEON_AIC_CNTL 0x01d0 +# define RADEON_PCIGART_TRANSLATE_EN (1 << 0) +#define RADEON_AIC_LO_ADDR 0x01dc + + + + /* Constants */ +#define RADEON_LAST_FRAME_REG RADEON_GUI_SCRATCH_REG0 +#define RADEON_LAST_CLEAR_REG RADEON_GUI_SCRATCH_REG2 + + + + /* CP packet types */ +#define RADEON_CP_PACKET0 0x00000000 +#define RADEON_CP_PACKET1 0x40000000 +#define RADEON_CP_PACKET2 0x80000000 +#define RADEON_CP_PACKET3 0xC0000000 +# define RADEON_CP_PACKET_MASK 0xC0000000 +# define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000 +# define RADEON_CP_PACKET_MAX_DWORDS (1 << 12) +# define RADEON_CP_PACKET0_REG_MASK 0x000007ff +# define RADEON_CP_PACKET1_REG0_MASK 0x000007ff +# define RADEON_CP_PACKET1_REG1_MASK 0x003ff800 + +#define RADEON_CP_PACKET0_ONE_REG_WR 0x00008000 + +#define RADEON_CP_PACKET3_NOP 0xC0001000 +#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900 +#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00 +#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00 +#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300 +#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400 +#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600 +#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800 +#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900 +#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00 +#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00 +#define R200_CP_PACKET3_3D_DRAW_IMMD_2 0xc0003500 +#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00 +#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100 +#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200 +#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300 +#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400 +#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500 +#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800 +#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00 +#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00 +#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00 + + +#define RADEON_CP_VC_FRMT_XY 0x00000000 +#define RADEON_CP_VC_FRMT_W0 0x00000001 +#define RADEON_CP_VC_FRMT_FPCOLOR 0x00000002 +#define RADEON_CP_VC_FRMT_FPALPHA 0x00000004 +#define RADEON_CP_VC_FRMT_PKCOLOR 0x00000008 +#define RADEON_CP_VC_FRMT_FPSPEC 0x00000010 +#define RADEON_CP_VC_FRMT_FPFOG 0x00000020 +#define RADEON_CP_VC_FRMT_PKSPEC 0x00000040 +#define RADEON_CP_VC_FRMT_ST0 0x00000080 +#define RADEON_CP_VC_FRMT_ST1 0x00000100 +#define RADEON_CP_VC_FRMT_Q1 0x00000200 +#define RADEON_CP_VC_FRMT_ST2 0x00000400 +#define RADEON_CP_VC_FRMT_Q2 0x00000800 +#define RADEON_CP_VC_FRMT_ST3 0x00001000 +#define RADEON_CP_VC_FRMT_Q3 0x00002000 +#define RADEON_CP_VC_FRMT_Q0 0x00004000 +#define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK 0x00038000 +#define RADEON_CP_VC_FRMT_N0 0x00040000 +#define RADEON_CP_VC_FRMT_XY1 0x08000000 +#define RADEON_CP_VC_FRMT_Z1 0x10000000 +#define RADEON_CP_VC_FRMT_W1 0x20000000 +#define RADEON_CP_VC_FRMT_N1 0x40000000 +#define RADEON_CP_VC_FRMT_Z 0x80000000 + +#define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE 0x00000000 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT 0x00000001 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE 0x00000002 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP 0x00000003 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2 0x00000007 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST 0x00000008 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST 0x0000000a +#define RADEON_CP_VC_CNTL_PRIM_TYPE_QUAD_LIST 0x0000000d +#define RADEON_CP_VC_CNTL_PRIM_WALK_IND 0x00000010 +#define RADEON_CP_VC_CNTL_PRIM_WALK_LIST 0x00000020 +#define RADEON_CP_VC_CNTL_PRIM_WALK_RING 0x00000030 +#define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA 0x00000000 +#define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA 0x00000040 +#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080 +#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000 +#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100 +#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000 +#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200 +#define RADEON_CP_VC_CNTL_NUM_SHIFT 16 + +#define RADEON_VS_MATRIX_0_ADDR 0 +#define RADEON_VS_MATRIX_1_ADDR 4 +#define RADEON_VS_MATRIX_2_ADDR 8 +#define RADEON_VS_MATRIX_3_ADDR 12 +#define RADEON_VS_MATRIX_4_ADDR 16 +#define RADEON_VS_MATRIX_5_ADDR 20 +#define RADEON_VS_MATRIX_6_ADDR 24 +#define RADEON_VS_MATRIX_7_ADDR 28 +#define RADEON_VS_MATRIX_8_ADDR 32 +#define RADEON_VS_MATRIX_9_ADDR 36 +#define RADEON_VS_MATRIX_10_ADDR 40 +#define RADEON_VS_MATRIX_11_ADDR 44 +#define RADEON_VS_MATRIX_12_ADDR 48 +#define RADEON_VS_MATRIX_13_ADDR 52 +#define RADEON_VS_MATRIX_14_ADDR 56 +#define RADEON_VS_MATRIX_15_ADDR 60 +#define RADEON_VS_LIGHT_AMBIENT_ADDR 64 +#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72 +#define RADEON_VS_LIGHT_SPECULAR_ADDR 80 +#define RADEON_VS_LIGHT_DIRPOS_ADDR 88 +#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96 +#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104 +#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112 +#define RADEON_VS_UCP_ADDR 116 +#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122 +#define RADEON_VS_FOG_PARAM_ADDR 123 +#define RADEON_VS_EYE_VECTOR_ADDR 124 + +#define RADEON_SS_LIGHT_DCD_ADDR 0 +#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8 +#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16 +#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24 +#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32 +#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48 +#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49 +#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50 +#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51 +#define RADEON_SS_SHININESS 60 + +#define RADEON_TV_MASTER_CNTL 0x0800 +# define RADEON_TV_ASYNC_RST (1 << 0) +# define RADEON_CRT_ASYNC_RST (1 << 1) +# define RADEON_RESTART_PHASE_FIX (1 << 3) +# define RADEON_TV_FIFO_ASYNC_RST (1 << 4) +# define RADEON_VIN_ASYNC_RST (1 << 5) +# define RADEON_AUD_ASYNC_RST (1 << 6) +# define RADEON_DVS_ASYNC_RST (1 << 7) +# define RADEON_CRT_FIFO_CE_EN (1 << 9) +# define RADEON_TV_FIFO_CE_EN (1 << 10) +# define RADEON_RE_SYNC_NOW_SEL_MASK (3 << 14) +# define RADEON_TVCLK_ALWAYS_ONb (1 << 30) +# define RADEON_TV_ON (1 << 31) +#define RADEON_TV_PRE_DAC_MUX_CNTL 0x0888 +# define RADEON_Y_RED_EN (1 << 0) +# define RADEON_C_GRN_EN (1 << 1) +# define RADEON_CMP_BLU_EN (1 << 2) +# define RADEON_DAC_DITHER_EN (1 << 3) +# define RADEON_RED_MX_FORCE_DAC_DATA (6 << 4) +# define RADEON_GRN_MX_FORCE_DAC_DATA (6 << 8) +# define RADEON_BLU_MX_FORCE_DAC_DATA (6 << 12) +# define RADEON_TV_FORCE_DAC_DATA_SHIFT 16 +#define RADEON_TV_RGB_CNTL 0x0804 +# define RADEON_SWITCH_TO_BLUE (1 << 4) +# define RADEON_RGB_DITHER_EN (1 << 5) +# define RADEON_RGB_SRC_SEL_MASK (3 << 8) +# define RADEON_RGB_SRC_SEL_CRTC1 (0 << 8) +# define RADEON_RGB_SRC_SEL_RMX (1 << 8) +# define RADEON_RGB_SRC_SEL_CRTC2 (2 << 8) +# define RADEON_RGB_CONVERT_BY_PASS (1 << 10) +# define RADEON_UVRAM_READ_MARGIN_SHIFT 16 +# define RADEON_FIFORAM_FFMACRO_READ_MARGIN_SHIFT 20 +# define RADEON_RGB_ATTEN_SEL(x) ((x) << 24) +# define RADEON_TVOUT_SCALE_EN (1 << 26) +# define RADEON_RGB_ATTEN_VAL(x) ((x) << 28) +#define RADEON_TV_SYNC_CNTL 0x0808 +# define RADEON_SYNC_OE (1 << 0) +# define RADEON_SYNC_OUT (1 << 1) +# define RADEON_SYNC_IN (1 << 2) +# define RADEON_SYNC_PUB (1 << 3) +# define RADEON_SYNC_PD (1 << 4) +# define RADEON_TV_SYNC_IO_DRIVE (1 << 5) +#define RADEON_TV_HTOTAL 0x080c +#define RADEON_TV_HDISP 0x0810 +#define RADEON_TV_HSTART 0x0818 +#define RADEON_TV_HCOUNT 0x081C +#define RADEON_TV_VTOTAL 0x0820 +#define RADEON_TV_VDISP 0x0824 +#define RADEON_TV_VCOUNT 0x0828 +#define RADEON_TV_FTOTAL 0x082c +#define RADEON_TV_FCOUNT 0x0830 +#define RADEON_TV_FRESTART 0x0834 +#define RADEON_TV_HRESTART 0x0838 +#define RADEON_TV_VRESTART 0x083c +#define RADEON_TV_HOST_READ_DATA 0x0840 +#define RADEON_TV_HOST_WRITE_DATA 0x0844 +#define RADEON_TV_HOST_RD_WT_CNTL 0x0848 +# define RADEON_HOST_FIFO_RD (1 << 12) +# define RADEON_HOST_FIFO_RD_ACK (1 << 13) +# define RADEON_HOST_FIFO_WT (1 << 14) +# define RADEON_HOST_FIFO_WT_ACK (1 << 15) +#define RADEON_TV_VSCALER_CNTL1 0x084c +# define RADEON_UV_INC_MASK 0xffff +# define RADEON_UV_INC_SHIFT 0 +# define RADEON_Y_W_EN (1 << 24) +# define RADEON_RESTART_FIELD (1 << 29) /* restart on field 0 */ +# define RADEON_Y_DEL_W_SIG_SHIFT 26 +#define RADEON_TV_TIMING_CNTL 0x0850 +# define RADEON_H_INC_MASK 0xfff +# define RADEON_H_INC_SHIFT 0 +# define RADEON_REQ_Y_FIRST (1 << 19) +# define RADEON_FORCE_BURST_ALWAYS (1 << 21) +# define RADEON_UV_POST_SCALE_BYPASS (1 << 23) +# define RADEON_UV_OUTPUT_POST_SCALE_SHIFT 24 +#define RADEON_TV_VSCALER_CNTL2 0x0854 +# define RADEON_DITHER_MODE (1 << 0) +# define RADEON_Y_OUTPUT_DITHER_EN (1 << 1) +# define RADEON_UV_OUTPUT_DITHER_EN (1 << 2) +# define RADEON_UV_TO_BUF_DITHER_EN (1 << 3) +#define RADEON_TV_Y_FALL_CNTL 0x0858 +# define RADEON_Y_FALL_PING_PONG (1 << 16) +# define RADEON_Y_COEF_EN (1 << 17) +#define RADEON_TV_Y_RISE_CNTL 0x085c +# define RADEON_Y_RISE_PING_PONG (1 << 16) +#define RADEON_TV_Y_SAW_TOOTH_CNTL 0x0860 +#define RADEON_TV_UPSAMP_AND_GAIN_CNTL 0x0864 +# define RADEON_YUPSAMP_EN (1 << 0) +# define RADEON_UVUPSAMP_EN (1 << 2) +#define RADEON_TV_GAIN_LIMIT_SETTINGS 0x0868 +# define RADEON_Y_GAIN_LIMIT_SHIFT 0 +# define RADEON_UV_GAIN_LIMIT_SHIFT 16 +#define RADEON_TV_LINEAR_GAIN_SETTINGS 0x086c +# define RADEON_Y_GAIN_SHIFT 0 +# define RADEON_UV_GAIN_SHIFT 16 +#define RADEON_TV_MODULATOR_CNTL1 0x0870 +# define RADEON_YFLT_EN (1 << 2) +# define RADEON_UVFLT_EN (1 << 3) +# define RADEON_ALT_PHASE_EN (1 << 6) +# define RADEON_SYNC_TIP_LEVEL (1 << 7) +# define RADEON_BLANK_LEVEL_SHIFT 8 +# define RADEON_SET_UP_LEVEL_SHIFT 16 +# define RADEON_SLEW_RATE_LIMIT (1 << 23) +# define RADEON_CY_FILT_BLEND_SHIFT 28 +#define RADEON_TV_MODULATOR_CNTL2 0x0874 +# define RADEON_TV_U_BURST_LEVEL_MASK 0x1ff +# define RADEON_TV_V_BURST_LEVEL_MASK 0x1ff +# define RADEON_TV_V_BURST_LEVEL_SHIFT 16 +#define RADEON_TV_CRC_CNTL 0x0890 +#define RADEON_TV_UV_ADR 0x08ac +# define RADEON_MAX_UV_ADR_MASK 0x000000ff +# define RADEON_MAX_UV_ADR_SHIFT 0 +# define RADEON_TABLE1_BOT_ADR_MASK 0x0000ff00 +# define RADEON_TABLE1_BOT_ADR_SHIFT 8 +# define RADEON_TABLE3_TOP_ADR_MASK 0x00ff0000 +# define RADEON_TABLE3_TOP_ADR_SHIFT 16 +# define RADEON_HCODE_TABLE_SEL_MASK 0x06000000 +# define RADEON_HCODE_TABLE_SEL_SHIFT 25 +# define RADEON_VCODE_TABLE_SEL_MASK 0x18000000 +# define RADEON_VCODE_TABLE_SEL_SHIFT 27 +# define RADEON_TV_MAX_FIFO_ADDR 0x1a7 +# define RADEON_TV_MAX_FIFO_ADDR_INTERNAL 0x1ff +#define RADEON_TV_PLL_FINE_CNTL 0x0020 /* PLL */ +#define RADEON_TV_PLL_CNTL 0x0021 /* PLL */ +# define RADEON_TV_M0LO_MASK 0xff +# define RADEON_TV_M0HI_MASK 0x7 +# define RADEON_TV_M0HI_SHIFT 18 +# define RADEON_TV_N0LO_MASK 0x1ff +# define RADEON_TV_N0LO_SHIFT 8 +# define RADEON_TV_N0HI_MASK 0x3 +# define RADEON_TV_N0HI_SHIFT 21 +# define RADEON_TV_P_MASK 0xf +# define RADEON_TV_P_SHIFT 24 +# define RADEON_TV_SLIP_EN (1 << 23) +# define RADEON_TV_DTO_EN (1 << 28) +#define RADEON_TV_PLL_CNTL1 0x0022 /* PLL */ +# define RADEON_TVPLL_RESET (1 << 1) +# define RADEON_TVPLL_SLEEP (1 << 3) +# define RADEON_TVPLL_REFCLK_SEL (1 << 4) +# define RADEON_TVPCP_SHIFT 8 +# define RADEON_TVPCP_MASK (7 << 8) +# define RADEON_TVPVG_SHIFT 11 +# define RADEON_TVPVG_MASK (7 << 11) +# define RADEON_TVPDC_SHIFT 14 +# define RADEON_TVPDC_MASK (3 << 14) +# define RADEON_TVPLL_TEST_DIS (1 << 31) +# define RADEON_TVCLK_SRC_SEL_TVPLL (1 << 30) + +#define RS400_DISP2_REQ_CNTL1 0xe30 +# define RS400_DISP2_START_REQ_LEVEL_SHIFT 0 +# define RS400_DISP2_START_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP2_STOP_REQ_LEVEL_SHIFT 12 +# define RS400_DISP2_STOP_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP2_ALLOW_FID_LEVEL_SHIFT 22 +# define RS400_DISP2_ALLOW_FID_LEVEL_MASK 0x3ff +#define RS400_DISP2_REQ_CNTL2 0xe34 +# define RS400_DISP2_CRITICAL_POINT_START_SHIFT 12 +# define RS400_DISP2_CRITICAL_POINT_START_MASK 0x3ff +# define RS400_DISP2_CRITICAL_POINT_STOP_SHIFT 22 +# define RS400_DISP2_CRITICAL_POINT_STOP_MASK 0x3ff +#define RS400_DMIF_MEM_CNTL1 0xe38 +# define RS400_DISP2_START_ADR_SHIFT 0 +# define RS400_DISP2_START_ADR_MASK 0x3ff +# define RS400_DISP1_CRITICAL_POINT_START_SHIFT 12 +# define RS400_DISP1_CRITICAL_POINT_START_MASK 0x3ff +# define RS400_DISP1_CRITICAL_POINT_STOP_SHIFT 22 +# define RS400_DISP1_CRITICAL_POINT_STOP_MASK 0x3ff +#define RS400_DISP1_REQ_CNTL1 0xe3c +# define RS400_DISP1_START_REQ_LEVEL_SHIFT 0 +# define RS400_DISP1_START_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP1_STOP_REQ_LEVEL_SHIFT 12 +# define RS400_DISP1_STOP_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP1_ALLOW_FID_LEVEL_SHIFT 22 +# define RS400_DISP1_ALLOW_FID_LEVEL_MASK 0x3ff + +#define RS690_MC_INDEX 0x78 +# define RS690_MC_INDEX_MASK 0x1ff +# define RS690_MC_INDEX_WR_EN (1 << 9) +# define RS690_MC_INDEX_WR_ACK 0x7f +#define RS690_MC_DATA 0x7c + +#define RS690_MC_FB_LOCATION 0x100 +#define RS690_MC_AGP_LOCATION 0x101 +#define RS690_MC_AGP_BASE 0x102 +#define RS690_MC_AGP_BASE_2 0x103 +#define RS690_MC_INIT_MISC_LAT_TIMER 0x104 +#define RS690_MC_STATUS 0x90 +#define RS690_MC_STATUS_IDLE (1 << 0) + +#define RS600_MC_INDEX 0x70 +# define RS600_MC_ADDR_MASK 0xffff +# define RS600_MC_IND_SEQ_RBS_0 (1 << 16) +# define RS600_MC_IND_SEQ_RBS_1 (1 << 17) +# define RS600_MC_IND_SEQ_RBS_2 (1 << 18) +# define RS600_MC_IND_SEQ_RBS_3 (1 << 19) +# define RS600_MC_IND_AIC_RBS (1 << 20) +# define RS600_MC_IND_CITF_ARB0 (1 << 21) +# define RS600_MC_IND_CITF_ARB1 (1 << 22) +# define RS600_MC_IND_WR_EN (1 << 23) +#define RS600_MC_DATA 0x74 + +#define RS600_MC_STATUS 0x0 +# define RS600_MC_IDLE (1 << 1) +#define RS600_MC_FB_LOCATION 0x4 +#define RS600_MC_AGP_LOCATION 0x5 +#define RS600_AGP_BASE 0x6 +#define RS600_AGP_BASE2 0x7 + +#define AVIVO_MC_INDEX 0x0070 +#define R520_MC_STATUS 0x00 +# define R520_MC_STATUS_IDLE (1 << 1) +#define RV515_MC_STATUS 0x08 +# define RV515_MC_STATUS_IDLE (1 << 4) +#define RV515_MC_INIT_MISC_LAT_TIMER 0x09 +#define AVIVO_MC_DATA 0x0074 + +#define RV515_MC_FB_LOCATION 0x1 +#define RV515_MC_AGP_LOCATION 0x2 +#define RV515_MC_AGP_BASE 0x3 +#define RV515_MC_AGP_BASE_2 0x4 +#define RV515_MC_CNTL 0x5 +# define RV515_MEM_NUM_CHANNELS_MASK 0x3 +#define R520_MC_FB_LOCATION 0x4 +#define R520_MC_AGP_LOCATION 0x5 +#define R520_MC_AGP_BASE 0x6 +#define R520_MC_AGP_BASE_2 0x7 +#define R520_MC_CNTL0 0x8 +# define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24) +# define R520_MEM_NUM_CHANNELS_SHIFT 24 +# define R520_MC_CHANNEL_SIZE (1 << 23) + +#define RS780_MC_INDEX 0x28f8 +# define RS780_MC_INDEX_MASK 0x1ff +# define RS780_MC_INDEX_WR_EN (1 << 9) +#define RS780_MC_DATA 0x28fc + +#define R600_RAMCFG 0x2408 +# define R600_CHANSIZE (1 << 7) +# define R600_CHANSIZE_OVERRIDE (1 << 10) + +#define R600_SRBM_STATUS 0x0e50 + +#define AVIVO_CP_DYN_CNTL 0x000f /* PLL */ +# define AVIVO_CP_FORCEON (1 << 0) +#define AVIVO_E2_DYN_CNTL 0x0011 /* PLL */ +# define AVIVO_E2_FORCEON (1 << 0) +#define AVIVO_IDCT_DYN_CNTL 0x0013 /* PLL */ +# define AVIVO_IDCT_FORCEON (1 << 0) + +#define AVIVO_HDP_FB_LOCATION 0x134 + +#define AVIVO_VGA_RENDER_CONTROL 0x0300 +# define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16) +#define AVIVO_D1VGA_CONTROL 0x0330 +# define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0) +# define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8) +# define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9) +# define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10) +# define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16) +# define AVIVO_DVGA_CONTROL_ROTATE (1<<24) +#define AVIVO_D2VGA_CONTROL 0x0338 + +#define AVIVO_VGA25_PPLL_REF_DIV_SRC 0x0360 +#define AVIVO_VGA25_PPLL_REF_DIV 0x0364 +#define AVIVO_VGA28_PPLL_REF_DIV_SRC 0x0368 +#define AVIVO_VGA28_PPLL_REF_DIV 0x036c +#define AVIVO_VGA41_PPLL_REF_DIV_SRC 0x0370 +#define AVIVO_VGA41_PPLL_REF_DIV 0x0374 +#define AVIVO_VGA25_PPLL_FB_DIV 0x0378 +#define AVIVO_VGA28_PPLL_FB_DIV 0x037c +#define AVIVO_VGA41_PPLL_FB_DIV 0x0380 +#define AVIVO_VGA25_PPLL_POST_DIV_SRC 0x0384 +#define AVIVO_VGA25_PPLL_POST_DIV 0x0388 +#define AVIVO_VGA28_PPLL_POST_DIV_SRC 0x038c +#define AVIVO_VGA28_PPLL_POST_DIV 0x0390 +#define AVIVO_VGA41_PPLL_POST_DIV_SRC 0x0394 +#define AVIVO_VGA41_PPLL_POST_DIV 0x0398 +#define AVIVO_VGA25_PPLL_CNTL 0x039c +#define AVIVO_VGA28_PPLL_CNTL 0x03a0 +#define AVIVO_VGA41_PPLL_CNTL 0x03a4 + +#define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400 +#define AVIVO_EXT1_PPLL_REF_DIV 0x404 +#define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408 +#define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c + +#define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410 +#define AVIVO_EXT2_PPLL_REF_DIV 0x414 +#define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418 +#define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c + +#define AVIVO_EXT1_PPLL_FB_DIV 0x430 +#define AVIVO_EXT2_PPLL_FB_DIV 0x434 + +#define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438 +#define AVIVO_EXT1_PPLL_POST_DIV 0x43c + +#define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440 +#define AVIVO_EXT2_PPLL_POST_DIV 0x444 + +#define AVIVO_EXT1_PPLL_CNTL 0x448 +#define AVIVO_EXT2_PPLL_CNTL 0x44c + +#define AVIVO_P1PLL_CNTL 0x450 +#define AVIVO_P2PLL_CNTL 0x454 +#define AVIVO_P1PLL_INT_SS_CNTL 0x458 +#define AVIVO_P2PLL_INT_SS_CNTL 0x45c +#define AVIVO_P1PLL_TMDSA_CNTL 0x460 +#define AVIVO_P2PLL_LVTMA_CNTL 0x464 + +#define AVIVO_PCLK_CRTC1_CNTL 0x480 +#define AVIVO_PCLK_CRTC2_CNTL 0x484 + +#define AVIVO_D1CRTC_H_TOTAL 0x6000 +#define AVIVO_D1CRTC_H_BLANK_START_END 0x6004 +#define AVIVO_D1CRTC_H_SYNC_A 0x6008 +#define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c +#define AVIVO_D1CRTC_H_SYNC_B 0x6010 +#define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014 + +#define AVIVO_D1CRTC_V_TOTAL 0x6020 +#define AVIVO_D1CRTC_V_BLANK_START_END 0x6024 +#define AVIVO_D1CRTC_V_SYNC_A 0x6028 +#define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c +#define AVIVO_D1CRTC_V_SYNC_B 0x6030 +#define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034 + +#define AVIVO_D1CRTC_CONTROL 0x6080 +# define AVIVO_CRTC_EN (1<<0) +#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 +#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 +#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c +#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 + +/* master controls */ +#define AVIVO_DC_CRTC_MASTER_EN 0x60f8 +#define AVIVO_DC_CRTC_TV_CONTROL 0x60fc + +#define AVIVO_D1GRPH_ENABLE 0x6100 +#define AVIVO_D1GRPH_CONTROL 0x6104 +# define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3<<0) + +# define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0<<8) + +# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4<<8) + +# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3<<8) + + +# define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0<<8) + +# define AVIVO_D1GRPH_SWAP_RB (1<<16) +# define AVIVO_D1GRPH_TILED (1<<20) +# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1<<21) + +#define AVIVO_D1GRPH_LUT_SEL 0x6108 + +#define R600_D1GRPH_SWAP_CONTROL 0x610C +# define R600_D1GRPH_SWAP_ENDIAN_NONE (0 << 0) +# define R600_D1GRPH_SWAP_ENDIAN_16BIT (1 << 0) +# define R600_D1GRPH_SWAP_ENDIAN_32BIT (2 << 0) +# define R600_D1GRPH_SWAP_ENDIAN_64BIT (3 << 0) + +/* the *_HIGH surface regs are backwards; the D1 regs are in the D2 + * block and vice versa. This applies to GRPH, CUR, etc. + */ + +#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 +#define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914 +#define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114 +#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 +#define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x691c +#define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x611c +#define AVIVO_D1GRPH_PITCH 0x6120 +#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 +#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 +#define AVIVO_D1GRPH_X_START 0x612c +#define AVIVO_D1GRPH_Y_START 0x6130 +#define AVIVO_D1GRPH_X_END 0x6134 +#define AVIVO_D1GRPH_Y_END 0x6138 +#define AVIVO_D1GRPH_UPDATE 0x6144 +# define AVIVO_D1GRPH_UPDATE_LOCK (1<<16) +#define AVIVO_D1GRPH_FLIP_CONTROL 0x6148 + +#define AVIVO_D1GRPH_COLOR_MATRIX_TRANSFORMATION_CNTL 0x6380 + +#define AVIVO_D1CUR_CONTROL 0x6400 +# define AVIVO_D1CURSOR_EN (1<<0) +# define AVIVO_D1CURSOR_MODE_SHIFT 8 +# define AVIVO_D1CURSOR_MODE_MASK (0x3<<8) +# define AVIVO_D1CURSOR_MODE_24BPP (0x2) +#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 +#define R700_D1CUR_SURFACE_ADDRESS_HIGH 0x6c0c +#define R700_D2CUR_SURFACE_ADDRESS_HIGH 0x640c +#define AVIVO_D1CUR_SIZE 0x6410 +#define AVIVO_D1CUR_POSITION 0x6414 +#define AVIVO_D1CUR_HOT_SPOT 0x6418 +#define AVIVO_D1CUR_UPDATE 0x6424 +# define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) + +#define AVIVO_DC_LUT_RW_SELECT 0x6480 +#define AVIVO_DC_LUT_RW_MODE 0x6484 +#define AVIVO_DC_LUT_RW_INDEX 0x6488 +#define AVIVO_DC_LUT_SEQ_COLOR 0x648c +#define AVIVO_DC_LUT_PWL_DATA 0x6490 +#define AVIVO_DC_LUT_30_COLOR 0x6494 +#define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498 +#define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c +#define AVIVO_DC_LUT_AUTOFILL 0x64a0 + +#define AVIVO_DC_LUTA_CONTROL 0x64c0 +#define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4 +#define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8 +#define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc +#define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0 +#define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4 +#define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8 + +#define AVIVO_DC_LB_MEMORY_SPLIT 0x6520 +# define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3 +# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3 +# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2) +# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 +# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff +#define AVIVO_D1MODE_PRIORITY_A_CNT 0x6548 +# define AVIVO_DxMODE_PRIORITY_MARK_MASK 0x7fff +# define AVIVO_DxMODE_PRIORITY_OFF (1 << 16) +# define AVIVO_DxMODE_PRIORITY_ALWAYS_ON (1 << 20) +# define AVIVO_DxMODE_PRIORITY_FORCE_MASK (1 << 24) +#define AVIVO_D1MODE_PRIORITY_B_CNT 0x654c +#define AVIVO_D2MODE_PRIORITY_A_CNT 0x6d48 +#define AVIVO_D2MODE_PRIORITY_B_CNT 0x6d4c +#define AVIVO_LB_MAX_REQ_OUTSTANDING 0x6d58 +# define AVIVO_LB_D1_MAX_REQ_OUTSTANDING_MASK 0xf +# define AVIVO_LB_D1_MAX_REQ_OUTSTANDING_SHIFT 0 +# define AVIVO_LB_D2_MAX_REQ_OUTSTANDING_MASK 0xf +# define AVIVO_LB_D2_MAX_REQ_OUTSTANDING_SHIFT 16 + +#define AVIVO_D1MODE_DATA_FORMAT 0x6528 +# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) +#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652c +#define AVIVO_D1MODE_VLINE_START_END 0x6538 +# define AVIVO_D1MODE_VLINE_START_SHIFT 0 +# define AVIVO_D1MODE_VLINE_END_SHIFT 16 +# define AVIVO_D1MODE_VLINE_INV (1 << 31) +#define AVIVO_D1MODE_VLINE_STATUS 0x653c +# define AVIVO_D1MODE_VLINE_STAT (1 << 12) +#define AVIVO_D1MODE_VIEWPORT_START 0x6580 +#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 +#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 +#define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c + +#define AVIVO_D1SCL_SCALER_ENABLE 0x6590 +#define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594 +#define AVIVO_D1SCL_UPDATE 0x65cc +# define AVIVO_D1SCL_UPDATE_LOCK (1<<16) + +/* second crtc */ +#define AVIVO_D2CRTC_H_TOTAL 0x6800 +#define AVIVO_D2CRTC_H_BLANK_START_END 0x6804 +#define AVIVO_D2CRTC_H_SYNC_A 0x6808 +#define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c +#define AVIVO_D2CRTC_H_SYNC_B 0x6810 +#define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814 + +#define AVIVO_D2CRTC_V_TOTAL 0x6820 +#define AVIVO_D2CRTC_V_BLANK_START_END 0x6824 +#define AVIVO_D2CRTC_V_SYNC_A 0x6828 +#define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c +#define AVIVO_D2CRTC_V_SYNC_B 0x6830 +#define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834 + +#define AVIVO_D2CRTC_CONTROL 0x6880 +#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 +#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 +#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c +#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 + +#define AVIVO_D2GRPH_ENABLE 0x6900 +#define AVIVO_D2GRPH_CONTROL 0x6904 +#define AVIVO_D2GRPH_LUT_SEL 0x6908 +#define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910 +#define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918 +#define AVIVO_D2GRPH_PITCH 0x6920 +#define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924 +#define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928 +#define AVIVO_D2GRPH_X_START 0x692c +#define AVIVO_D2GRPH_Y_START 0x6930 +#define AVIVO_D2GRPH_X_END 0x6934 +#define AVIVO_D2GRPH_Y_END 0x6938 +#define AVIVO_D2GRPH_UPDATE 0x6944 +#define AVIVO_D2GRPH_FLIP_CONTROL 0x6948 + +#define AVIVO_D2CUR_CONTROL 0x6c00 +#define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08 +#define AVIVO_D2CUR_SIZE 0x6c10 +#define AVIVO_D2CUR_POSITION 0x6c14 + +#define RS690_DCP_CONTROL 0x6c9c + +#define AVIVO_D2MODE_DATA_FORMAT 0x6d28 +#define AVIVO_D2MODE_DESKTOP_HEIGHT 0x6d2c +#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 +#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 +#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 +#define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c + +#define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 +#define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 +#define AVIVO_D2SCL_UPDATE 0x6dcc + +#define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 + +#define AVIVO_DACA_ENABLE 0x7800 +# define AVIVO_DAC_ENABLE (1 << 0) +#define AVIVO_DACA_SOURCE_SELECT 0x7804 +# define AVIVO_DAC_SOURCE_CRTC1 (0 << 0) +# define AVIVO_DAC_SOURCE_CRTC2 (1 << 0) +# define AVIVO_DAC_SOURCE_TV (2 << 0) + +#define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) +#define AVIVO_DACA_POWERDOWN 0x7850 +# define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0) +# define AVIVO_DACA_POWERDOWN_BLUE (1 << 8) +# define AVIVO_DACA_POWERDOWN_GREEN (1 << 16) +# define AVIVO_DACA_POWERDOWN_RED (1 << 24) + +#define AVIVO_DACB_ENABLE 0x7a00 +#define AVIVO_DACB_SOURCE_SELECT 0x7a04 +#define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) +#define AVIVO_DACB_POWERDOWN 0x7a50 +# define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0) +# define AVIVO_DACB_POWERDOWN_BLUE (1 << 8) +# define AVIVO_DACB_POWERDOWN_GREEN (1 << 16) +# define AVIVO_DACB_POWERDOWN_RED + +#define AVIVO_TMDSA_CNTL 0x7880 +# define AVIVO_TMDSA_CNTL_ENABLE (1 << 0) +# define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4) +# define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8) +# define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12) +# define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16) +# define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24) +# define AVIVO_TMDSA_CNTL_SWAP (1 << 28) +#define AVIVO_TMDSA_SOURCE_SELECT 0x7884 +/* 78a8 appears to be some kind of (reasonably tolerant) clock? + * 78d0 definitely hits the transmitter, definitely clock. */ +/* MYSTERY1 This appears to control dithering? */ +#define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894 +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) +#define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0 +# define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24) +#define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8 +# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) +# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) +#define AVIVO_TMDSA_CLOCK_ENABLE 0x7900 +#define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904 +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) + +#define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910 +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) + +#define AVIVO_LVTMA_CNTL 0x7a80 +# define AVIVO_LVTMA_CNTL_ENABLE (1 << 0) +# define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4) +# define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8) +# define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12) +# define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16) +# define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24) +# define AVIVO_LVTMA_CNTL_SWAP (1 << 28) +#define AVIVO_LVTMA_SOURCE_SELECT 0x7a84 +#define AVIVO_LVTMA_COLOR_FORMAT 0x7a88 +#define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94 +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) + + + +#define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0 +# define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24) + +#define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8 +# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) +# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) +#define R500_LVTMA_CLOCK_ENABLE 0x7b00 +#define R600_LVTMA_CLOCK_ENABLE 0x7b04 + +#define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04 +#define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08 +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) + +#define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10 +#define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14 +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) + +#define R500_LVTMA_PWRSEQ_CNTL 0x7af0 +#define R600_LVTMA_PWRSEQ_CNTL 0x7af4 +# define AVIVO_LVTMA_PWRSEQ_EN (1 << 0) +# define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2) +# define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3) +# define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4) +# define AVIVO_LVTMA_SYNCEN (1 << 8) +# define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9) +# define AVIVO_LVTMA_SYNCEN_POL (1 << 10) +# define AVIVO_LVTMA_DIGON (1 << 16) +# define AVIVO_LVTMA_DIGON_OVRD (1 << 17) +# define AVIVO_LVTMA_DIGON_POL (1 << 18) +# define AVIVO_LVTMA_BLON (1 << 24) +# define AVIVO_LVTMA_BLON_OVRD (1 << 25) +# define AVIVO_LVTMA_BLON_POL (1 << 26) + +#define R500_LVTMA_PWRSEQ_STATE 0x7af4 +#define R600_LVTMA_PWRSEQ_STATE 0x7af8 +# define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0) +# define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1) +# define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2) +# define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3) +# define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4) +# define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8) + +#define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8 +# define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0) +# define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 +# define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 + +#define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 + +#define AVIVO_GPIO_0 0x7e30 +#define AVIVO_GPIO_1 0x7e40 +#define AVIVO_GPIO_2 0x7e50 +#define AVIVO_GPIO_3 0x7e60 + +#define AVIVO_DC_GPIO_HPD_MASK 0x7e90 +#define AVIVO_DC_GPIO_HPD_A 0x7e94 +#define AVIVO_DC_GPIO_HPD_EN 0x7e98 +#define AVIVO_DC_GPIO_HPD_Y 0x7e9c + +#define AVIVO_I2C_STATUS 0x7d30 +# define AVIVO_I2C_STATUS_DONE (1 << 0) +# define AVIVO_I2C_STATUS_NACK (1 << 1) +# define AVIVO_I2C_STATUS_HALT (1 << 2) +# define AVIVO_I2C_STATUS_GO (1 << 3) +# define AVIVO_I2C_STATUS_MASK 0x7 +/* If radeon_mm_i2c is to be believed, this is HALT, NACK, and maybe + * DONE? */ +# define AVIVO_I2C_STATUS_CMD_RESET 0x7 +# define AVIVO_I2C_STATUS_CMD_WAIT (1 << 3) +#define AVIVO_I2C_STOP 0x7d34 +#define AVIVO_I2C_START_CNTL 0x7d38 +# define AVIVO_I2C_START (1 << 8) +# define AVIVO_I2C_CONNECTOR0 (0 << 16) +# define AVIVO_I2C_CONNECTOR1 (1 << 16) +#define R520_I2C_START (1<<0) +#define R520_I2C_STOP (1<<1) +#define R520_I2C_RX (1<<2) +#define R520_I2C_EN (1<<8) +#define R520_I2C_DDC1 (0<<16) +#define R520_I2C_DDC2 (1<<16) +#define R520_I2C_DDC3 (2<<16) +#define R520_I2C_DDC_MASK (3<<16) +#define AVIVO_I2C_CONTROL2 0x7d3c +# define AVIVO_I2C_7D3C_SIZE_SHIFT 8 +# define AVIVO_I2C_7D3C_SIZE_MASK (0xf << 8) +#define AVIVO_I2C_CONTROL3 0x7d40 +/* Reading is done 4 bytes at a time: read the bottom 8 bits from + * 7d44, four times in a row. + * Writing is a little more complex. First write DATA with + * 0xnnnnnnzz, then 0xnnnnnnyy, where nnnnnn is some non-deterministic + * magic number, zz is, I think, the slave address, and yy is the byte + * you want to write. */ +#define AVIVO_I2C_DATA 0x7d44 +#define R520_I2C_ADDR_COUNT_MASK (0x7) +#define R520_I2C_DATA_COUNT_SHIFT (8) +#define R520_I2C_DATA_COUNT_MASK (0xF00) +#define AVIVO_I2C_CNTL 0x7d50 +# define AVIVO_I2C_EN (1 << 0) +# define AVIVO_I2C_RESET (1 << 8) + +#define R600_GENERAL_PWRMGT 0x618 +# define R600_OPEN_DRAIN_PADS (1 << 11) + +#define R600_LOWER_GPIO_ENABLE 0x710 +#define R600_CTXSW_VID_LOWER_GPIO_CNTL 0x718 +#define R600_HIGH_VID_LOWER_GPIO_CNTL 0x71c +#define R600_MEDIUM_VID_LOWER_GPIO_CNTL 0x720 +#define R600_LOW_VID_LOWER_GPIO_CNTL 0x724 + +#define R600_MC_VM_FB_LOCATION 0x2180 +#define R600_MC_VM_AGP_TOP 0x2184 +#define R600_MC_VM_AGP_BOT 0x2188 +#define R600_MC_VM_AGP_BASE 0x218c +#define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190 +#define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194 +#define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198 + +#define R700_MC_VM_FB_LOCATION 0x2024 +#define R700_MC_VM_AGP_TOP 0x2028 +#define R700_MC_VM_AGP_BOT 0x202c +#define R700_MC_VM_AGP_BASE 0x2030 + +#define R600_HDP_NONSURFACE_BASE 0x2c04 + +#define R600_BUS_CNTL 0x5420 +#define R600_CONFIG_CNTL 0x5424 +#define R600_CONFIG_MEMSIZE 0x5428 +#define R600_CONFIG_F0_BASE 0x542C +#define R600_CONFIG_APER_SIZE 0x5430 + +#define R600_ROM_CNTL 0x1600 +# define R600_SCK_OVERWRITE (1 << 1) +# define R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT 28 +# define R600_SCK_PRESCALE_CRYSTAL_CLK_MASK (0xf << 28) + +#define R600_CG_SPLL_FUNC_CNTL 0x600 +# define R600_SPLL_BYPASS_EN (1 << 3) +#define R600_CG_SPLL_STATUS 0x60c +# define R600_SPLL_CHG_STATUS (1 << 1) + +#define R600_BIOS_0_SCRATCH 0x1724 +#define R600_BIOS_1_SCRATCH 0x1728 +#define R600_BIOS_2_SCRATCH 0x172c +#define R600_BIOS_3_SCRATCH 0x1730 +#define R600_BIOS_4_SCRATCH 0x1734 +#define R600_BIOS_5_SCRATCH 0x1738 +#define R600_BIOS_6_SCRATCH 0x173c +#define R600_BIOS_7_SCRATCH 0x1740 + +/* evergreen */ +#define EVERGREEN_VGA_MEMORY_BASE_ADDRESS 0x310 +#define EVERGREEN_VGA_MEMORY_BASE_ADDRESS_HIGH 0x324 +#define EVERGREEN_D3VGA_CONTROL 0x3e0 +#define EVERGREEN_D4VGA_CONTROL 0x3e4 +#define EVERGREEN_D5VGA_CONTROL 0x3e8 +#define EVERGREEN_D6VGA_CONTROL 0x3ec + +#define EVERGREEN_P1PLL_SS_CNTL 0x414 +#define EVERGREEN_P2PLL_SS_CNTL 0x454 +# define EVERGREEN_PxPLL_SS_EN (1 << 12) +/* GRPH blocks at 0x6800, 0x7400, 0x10000, 0x10c00, 0x11800, 0x12400 */ +#define EVERGREEN_GRPH_ENABLE 0x6800 +#define EVERGREEN_GRPH_CONTROL 0x6804 +# define EVERGREEN_GRPH_DEPTH(x) (((x) & 0x3) << 0) +# define EVERGREEN_GRPH_DEPTH_8BPP 0 +# define EVERGREEN_GRPH_DEPTH_16BPP 1 +# define EVERGREEN_GRPH_DEPTH_32BPP 2 +# define EVERGREEN_GRPH_FORMAT(x) (((x) & 0x7) << 8) +/* 8 BPP */ +# define EVERGREEN_GRPH_FORMAT_INDEXED 0 +/* 16 BPP */ +# define EVERGREEN_GRPH_FORMAT_ARGB1555 0 +# define EVERGREEN_GRPH_FORMAT_ARGB565 1 +# define EVERGREEN_GRPH_FORMAT_ARGB4444 2 +# define EVERGREEN_GRPH_FORMAT_AI88 3 +# define EVERGREEN_GRPH_FORMAT_MONO16 4 +# define EVERGREEN_GRPH_FORMAT_BGRA5551 5 +/* 32 BPP */ +# define EVERGREEN_GRPH_FORMAT_ARGB8888 0 +# define EVERGREEN_GRPH_FORMAT_ARGB2101010 1 +# define EVERGREEN_GRPH_FORMAT_32BPP_DIG 2 +# define EVERGREEN_GRPH_FORMAT_8B_ARGB2101010 3 +# define EVERGREEN_GRPH_FORMAT_BGRA1010102 4 +# define EVERGREEN_GRPH_FORMAT_8B_BGRA1010102 5 +# define EVERGREEN_GRPH_FORMAT_RGB111110 6 +# define EVERGREEN_GRPH_FORMAT_BGR101111 7 +#define EVERGREEN_GRPH_SWAP_CONTROL 0x680c +# define EVERGREEN_GRPH_ENDIAN_SWAP(x) (((x) & 0x3) << 0) +# define EVERGREEN_GRPH_ENDIAN_NONE 0 +# define EVERGREEN_GRPH_ENDIAN_8IN16 1 +# define EVERGREEN_GRPH_ENDIAN_8IN32 2 +# define EVERGREEN_GRPH_ENDIAN_8IN64 3 +# define EVERGREEN_GRPH_RED_CROSSBAR(x) (((x) & 0x3) << 4) +# define EVERGREEN_GRPH_RED_SEL_R 0 +# define EVERGREEN_GRPH_RED_SEL_G 1 +# define EVERGREEN_GRPH_RED_SEL_B 2 +# define EVERGREEN_GRPH_RED_SEL_A 3 +# define EVERGREEN_GRPH_GREEN_CROSSBAR(x) (((x) & 0x3) << 6) +# define EVERGREEN_GRPH_GREEN_SEL_G 0 +# define EVERGREEN_GRPH_GREEN_SEL_B 1 +# define EVERGREEN_GRPH_GREEN_SEL_A 2 +# define EVERGREEN_GRPH_GREEN_SEL_R 3 +# define EVERGREEN_GRPH_BLUE_CROSSBAR(x) (((x) & 0x3) << 8) +# define EVERGREEN_GRPH_BLUE_SEL_B 0 +# define EVERGREEN_GRPH_BLUE_SEL_A 1 +# define EVERGREEN_GRPH_BLUE_SEL_R 2 +# define EVERGREEN_GRPH_BLUE_SEL_G 3 +# define EVERGREEN_GRPH_ALPHA_CROSSBAR(x) (((x) & 0x3) << 10) +# define EVERGREEN_GRPH_ALPHA_SEL_A 0 +# define EVERGREEN_GRPH_ALPHA_SEL_R 1 +# define EVERGREEN_GRPH_ALPHA_SEL_G 2 +# define EVERGREEN_GRPH_ALPHA_SEL_B 3 +#define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS 0x6810 +#define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS 0x6814 +# define EVERGREEN_GRPH_DFQ_ENABLE (1 << 0) +# define EVERGREEN_GRPH_SURFACE_ADDRESS_MASK 0xffffff00 +#define EVERGREEN_GRPH_PITCH 0x6818 +#define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x681c +#define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x6820 +#define EVERGREEN_GRPH_SURFACE_OFFSET_X 0x6824 +#define EVERGREEN_GRPH_SURFACE_OFFSET_Y 0x6828 +#define EVERGREEN_GRPH_X_START 0x682c +#define EVERGREEN_GRPH_Y_START 0x6830 +#define EVERGREEN_GRPH_X_END 0x6834 +#define EVERGREEN_GRPH_Y_END 0x6838 + +/* CUR blocks at 0x6998, 0x7598, 0x10198, 0x10d98, 0x11998, 0x12598 */ +#define EVERGREEN_CUR_CONTROL 0x6998 +# define EVERGREEN_CURSOR_EN (1 << 0) +# define EVERGREEN_CURSOR_MODE(x) (((x) & 0x3) << 8) +# define EVERGREEN_CURSOR_MONO 0 +# define EVERGREEN_CURSOR_24_1 1 +# define EVERGREEN_CURSOR_24_8_PRE_MULT 2 +# define EVERGREEN_CURSOR_24_8_UNPRE_MULT 3 +# define EVERGREEN_CURSOR_2X_MAGNIFY (1 << 16) +# define EVERGREEN_CURSOR_FORCE_MC_ON (1 << 20) +# define EVERGREEN_CURSOR_URGENT_CONTROL(x) (((x) & 0x7) << 24) +# define EVERGREEN_CURSOR_URGENT_ALWAYS 0 +# define EVERGREEN_CURSOR_URGENT_1_8 1 +# define EVERGREEN_CURSOR_URGENT_1_4 2 +# define EVERGREEN_CURSOR_URGENT_3_8 3 +# define EVERGREEN_CURSOR_URGENT_1_2 4 +#define EVERGREEN_CUR_SURFACE_ADDRESS 0x699c +# define EVERGREEN_CUR_SURFACE_ADDRESS_MASK 0xfffff000 +#define EVERGREEN_CUR_SIZE 0x69a0 +#define EVERGREEN_CUR_SURFACE_ADDRESS_HIGH 0x69a4 +#define EVERGREEN_CUR_POSITION 0x69a8 +#define EVERGREEN_CUR_HOT_SPOT 0x69ac +#define EVERGREEN_CUR_COLOR1 0x69b0 +#define EVERGREEN_CUR_COLOR2 0x69b4 +#define EVERGREEN_CUR_UPDATE 0x69b8 +# define EVERGREEN_CURSOR_UPDATE_PENDING (1 << 0) +# define EVERGREEN_CURSOR_UPDATE_TAKEN (1 << 1) +# define EVERGREEN_CURSOR_UPDATE_LOCK (1 << 16) +# define EVERGREEN_CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24) + +/* LUT blocks at 0x69e0, 0x75e0, 0x101e0, 0x10de0, 0x119e0, 0x125e0 */ +#define EVERGREEN_DC_LUT_RW_MODE 0x69e0 +#define EVERGREEN_DC_LUT_RW_INDEX 0x69e4 +#define EVERGREEN_DC_LUT_SEQ_COLOR 0x69e8 +#define EVERGREEN_DC_LUT_PWL_DATA 0x69ec +#define EVERGREEN_DC_LUT_30_COLOR 0x69f0 +#define EVERGREEN_DC_LUT_VGA_ACCESS_ENABLE 0x69f4 +#define EVERGREEN_DC_LUT_WRITE_EN_MASK 0x69f8 +#define EVERGREEN_DC_LUT_AUTOFILL 0x69fc +#define EVERGREEN_DC_LUT_CONTROL 0x6a00 +#define EVERGREEN_DC_LUT_BLACK_OFFSET_BLUE 0x6a04 +#define EVERGREEN_DC_LUT_BLACK_OFFSET_GREEN 0x6a08 +#define EVERGREEN_DC_LUT_BLACK_OFFSET_RED 0x6a0c +#define EVERGREEN_DC_LUT_WHITE_OFFSET_BLUE 0x6a10 +#define EVERGREEN_DC_LUT_WHITE_OFFSET_GREEN 0x6a14 +#define EVERGREEN_DC_LUT_WHITE_OFFSET_RED 0x6a18 + +#define EVERGREEN_DATA_FORMAT 0x6b00 +# define EVERGREEN_INTERLEAVE_EN (1 << 0) +#define EVERGREEN_DESKTOP_HEIGHT 0x6b04 + +#define EVERGREEN_VIEWPORT_START 0x6d70 +#define EVERGREEN_VIEWPORT_SIZE 0x6d74 + +/* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */ +#define EVERGREEN_CRTC0_REGISTER_OFFSET (0x6df0 - 0x6df0) +#define EVERGREEN_CRTC1_REGISTER_OFFSET (0x79f0 - 0x6df0) +#define EVERGREEN_CRTC2_REGISTER_OFFSET (0x105f0 - 0x6df0) +#define EVERGREEN_CRTC3_REGISTER_OFFSET (0x111f0 - 0x6df0) +#define EVERGREEN_CRTC4_REGISTER_OFFSET (0x11df0 - 0x6df0) +#define EVERGREEN_CRTC5_REGISTER_OFFSET (0x129f0 - 0x6df0) + +/* CRTC blocks at 0x6df0, 0x79f0, 0x105f0, 0x111f0, 0x11df0, 0x129f0 */ +#define EVERGREEN_CRTC_CONTROL 0x6e70 +# define EVERGREEN_CRTC_MASTER_EN (1 << 0) +#define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 + +#define EVERGREEN_DC_GPIO_HPD_MASK 0x64b0 +#define EVERGREEN_DC_GPIO_HPD_A 0x64b4 +#define EVERGREEN_DC_GPIO_HPD_EN 0x64b8 +#define EVERGREEN_DC_GPIO_HPD_Y 0x64bc + +#define R300_GB_TILE_CONFIG 0x4018 +# define R300_ENABLE_TILING (1 << 0) +# define R300_PIPE_COUNT_RV350 (0 << 1) +# define R300_PIPE_COUNT_R300 (3 << 1) +# define R300_PIPE_COUNT_R420_3P (6 << 1) +# define R300_PIPE_COUNT_R420 (7 << 1) +# define R300_TILE_SIZE_8 (0 << 4) +# define R300_TILE_SIZE_16 (1 << 4) +# define R300_TILE_SIZE_32 (2 << 4) +# define R300_SUBPIXEL_1_12 (0 << 16) +# define R300_SUBPIXEL_1_16 (1 << 16) +#define R300_GB_SELECT 0x401c +#define R300_GB_ENABLE 0x4008 +#define R300_GB_AA_CONFIG 0x4020 +#define R400_GB_PIPE_SELECT 0x402c +#define R300_GB_MSPOS0 0x4010 +# define R300_MS_X0_SHIFT 0 +# define R300_MS_Y0_SHIFT 4 +# define R300_MS_X1_SHIFT 8 +# define R300_MS_Y1_SHIFT 12 +# define R300_MS_X2_SHIFT 16 +# define R300_MS_Y2_SHIFT 20 +# define R300_MSBD0_Y_SHIFT 24 +# define R300_MSBD0_X_SHIFT 28 +#define R300_GB_MSPOS1 0x4014 +# define R300_MS_X3_SHIFT 0 +# define R300_MS_Y3_SHIFT 4 +# define R300_MS_X4_SHIFT 8 +# define R300_MS_Y4_SHIFT 12 +# define R300_MS_X5_SHIFT 16 +# define R300_MS_Y5_SHIFT 20 +# define R300_MSBD1_SHIFT 24 + +#define R300_GA_ENHANCE 0x4274 +# define R300_GA_DEADLOCK_CNTL (1 << 0) +# define R300_GA_FASTSYNC_CNTL (1 << 1) + +#define R300_GA_POLY_MODE 0x4288 +# define R300_FRONT_PTYPE_POINT (0 << 4) +# define R300_FRONT_PTYPE_LINE (1 << 4) +# define R300_FRONT_PTYPE_TRIANGE (2 << 4) +# define R300_BACK_PTYPE_POINT (0 << 7) +# define R300_BACK_PTYPE_LINE (1 << 7) +# define R300_BACK_PTYPE_TRIANGE (2 << 7) +#define R300_GA_ROUND_MODE 0x428c +# define R300_GEOMETRY_ROUND_TRUNC (0 << 0) +# define R300_GEOMETRY_ROUND_NEAREST (1 << 0) +# define R300_COLOR_ROUND_TRUNC (0 << 2) +# define R300_COLOR_ROUND_NEAREST (1 << 2) +#define R300_GA_COLOR_CONTROL 0x4278 +# define R300_RGB0_SHADING_SOLID (0 << 0) +# define R300_RGB0_SHADING_FLAT (1 << 0) +# define R300_RGB0_SHADING_GOURAUD (2 << 0) +# define R300_ALPHA0_SHADING_SOLID (0 << 2) +# define R300_ALPHA0_SHADING_FLAT (1 << 2) +# define R300_ALPHA0_SHADING_GOURAUD (2 << 2) +# define R300_RGB1_SHADING_SOLID (0 << 4) +# define R300_RGB1_SHADING_FLAT (1 << 4) +# define R300_RGB1_SHADING_GOURAUD (2 << 4) +# define R300_ALPHA1_SHADING_SOLID (0 << 6) +# define R300_ALPHA1_SHADING_FLAT (1 << 6) +# define R300_ALPHA1_SHADING_GOURAUD (2 << 6) +# define R300_RGB2_SHADING_SOLID (0 << 8) +# define R300_RGB2_SHADING_FLAT (1 << 8) +# define R300_RGB2_SHADING_GOURAUD (2 << 8) +# define R300_ALPHA2_SHADING_SOLID (0 << 10) +# define R300_ALPHA2_SHADING_FLAT (1 << 10) +# define R300_ALPHA2_SHADING_GOURAUD (2 << 10) +# define R300_RGB3_SHADING_SOLID (0 << 12) +# define R300_RGB3_SHADING_FLAT (1 << 12) +# define R300_RGB3_SHADING_GOURAUD (2 << 12) +# define R300_ALPHA3_SHADING_SOLID (0 << 14) +# define R300_ALPHA3_SHADING_FLAT (1 << 14) +# define R300_ALPHA3_SHADING_GOURAUD (2 << 14) +#define R300_GA_OFFSET 0x4290 + +#define R500_SU_REG_DEST 0x42c8 + +#define R300_VAP_CNTL_STATUS 0x2140 +# define R300_PVS_BYPASS (1 << 8) +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 +#define R300_VAP_CNTL 0x2080 +# define R300_PVS_NUM_SLOTS_SHIFT 0 +# define R300_PVS_NUM_CNTLRS_SHIFT 4 +# define R300_PVS_NUM_FPUS_SHIFT 8 +# define R300_VF_MAX_VTX_NUM_SHIFT 18 +# define R300_GL_CLIP_SPACE_DEF (0 << 22) +# define R300_DX_CLIP_SPACE_DEF (1 << 22) +# define R500_TCL_STATE_OPTIMIZATION (1 << 23) +#define R300_VAP_VTE_CNTL 0x20B0 +# define R300_VPORT_X_SCALE_ENA (1 << 0) +# define R300_VPORT_X_OFFSET_ENA (1 << 1) +# define R300_VPORT_Y_SCALE_ENA (1 << 2) +# define R300_VPORT_Y_OFFSET_ENA (1 << 3) +# define R300_VPORT_Z_SCALE_ENA (1 << 4) +# define R300_VPORT_Z_OFFSET_ENA (1 << 5) +# define R300_VTX_XY_FMT (1 << 8) +# define R300_VTX_Z_FMT (1 << 9) +# define R300_VTX_W0_FMT (1 << 10) +#define R300_VAP_VTX_STATE_CNTL 0x2180 +#define R300_VAP_PSC_SGN_NORM_CNTL 0x21DC +#define R300_VAP_PROG_STREAM_CNTL_0 0x2150 +# define R300_DATA_TYPE_0_SHIFT 0 +# define R300_DATA_TYPE_FLOAT_1 0 +# define R300_DATA_TYPE_FLOAT_2 1 +# define R300_DATA_TYPE_FLOAT_3 2 +# define R300_DATA_TYPE_FLOAT_4 3 +# define R300_DATA_TYPE_BYTE 4 +# define R300_DATA_TYPE_D3DCOLOR 5 +# define R300_DATA_TYPE_SHORT_2 6 +# define R300_DATA_TYPE_SHORT_4 7 +# define R300_DATA_TYPE_VECTOR_3_TTT 8 +# define R300_DATA_TYPE_VECTOR_3_EET 9 +# define R300_SKIP_DWORDS_0_SHIFT 4 +# define R300_DST_VEC_LOC_0_SHIFT 8 +# define R300_LAST_VEC_0 (1 << 13) +# define R300_SIGNED_0 (1 << 14) +# define R300_NORMALIZE_0 (1 << 15) +# define R300_DATA_TYPE_1_SHIFT 16 +# define R300_SKIP_DWORDS_1_SHIFT 20 +# define R300_DST_VEC_LOC_1_SHIFT 24 +# define R300_LAST_VEC_1 (1 << 29) +# define R300_SIGNED_1 (1 << 30) +# define R300_NORMALIZE_1 (1 << 31) +#define R300_VAP_PROG_STREAM_CNTL_1 0x2154 +# define R300_DATA_TYPE_2_SHIFT 0 +# define R300_SKIP_DWORDS_2_SHIFT 4 +# define R300_DST_VEC_LOC_2_SHIFT 8 +# define R300_LAST_VEC_2 (1 << 13) +# define R300_SIGNED_2 (1 << 14) +# define R300_NORMALIZE_2 (1 << 15) +# define R300_DATA_TYPE_3_SHIFT 16 +# define R300_SKIP_DWORDS_3_SHIFT 20 +# define R300_DST_VEC_LOC_3_SHIFT 24 +# define R300_LAST_VEC_3 (1 << 29) +# define R300_SIGNED_3 (1 << 30) +# define R300_NORMALIZE_3 (1 << 31) +#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0 +# define R300_SWIZZLE_SELECT_X_0_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_0_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_0_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_0_SHIFT 9 +# define R300_SWIZZLE_SELECT_X 0 +# define R300_SWIZZLE_SELECT_Y 1 +# define R300_SWIZZLE_SELECT_Z 2 +# define R300_SWIZZLE_SELECT_W 3 +# define R300_SWIZZLE_SELECT_FP_ZERO 4 +# define R300_SWIZZLE_SELECT_FP_ONE 5 +# define R300_WRITE_ENA_0_SHIFT 12 +# define R300_WRITE_ENA_X 1 +# define R300_WRITE_ENA_Y 2 +# define R300_WRITE_ENA_Z 4 +# define R300_WRITE_ENA_W 8 +# define R300_SWIZZLE_SELECT_X_1_SHIFT 16 +# define R300_SWIZZLE_SELECT_Y_1_SHIFT 19 +# define R300_SWIZZLE_SELECT_Z_1_SHIFT 22 +# define R300_SWIZZLE_SELECT_W_1_SHIFT 25 +# define R300_WRITE_ENA_1_SHIFT 28 +#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4 +# define R300_SWIZZLE_SELECT_X_2_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_2_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_2_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_2_SHIFT 9 +# define R300_WRITE_ENA_2_SHIFT 12 +# define R300_SWIZZLE_SELECT_X_3_SHIFT 16 +# define R300_SWIZZLE_SELECT_Y_3_SHIFT 19 +# define R300_SWIZZLE_SELECT_Z_3_SHIFT 22 +# define R300_SWIZZLE_SELECT_W_3_SHIFT 25 +# define R300_WRITE_ENA_3_SHIFT 28 +#define R300_VAP_PVS_CODE_CNTL_0 0x22D0 +# define R300_PVS_FIRST_INST_SHIFT 0 +# define R300_PVS_XYZW_VALID_INST_SHIFT 10 +# define R300_PVS_LAST_INST_SHIFT 20 +#define R300_VAP_PVS_CODE_CNTL_1 0x22D8 +# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0 +#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200 +# define R300_PVS_CODE_START 0 +# define R300_PVS_CONST_START 512 +# define R500_PVS_CONST_START 1024 +# define R300_PVS_VECTOR_INST_INDEX(x) ((x) + R300_PVS_CODE_START) +# define R300_PVS_VECTOR_CONST_INDEX(x) ((x) + R300_PVS_CONST_START) +# define R500_PVS_VECTOR_CONST_INDEX(x) ((x) + R500_PVS_CONST_START) +#define R300_VAP_PVS_VECTOR_DATA_REG 0x2204 +/* PVS instructions */ +/* Opcode and dst instruction */ +#define R300_PVS_DST_OPCODE(x) ((x) << 0) +/* Vector ops */ +# define R300_VECTOR_NO_OP 0 +# define R300_VE_DOT_PRODUCT 1 +# define R300_VE_MULTIPLY 2 +# define R300_VE_ADD 3 +# define R300_VE_MULTIPLY_ADD 4 +# define R300_VE_DISTANCE_VECTOR 5 +# define R300_VE_FRACTION 6 +# define R300_VE_MAXIMUM 7 +# define R300_VE_MINIMUM 8 +# define R300_VE_SET_GREATER_THAN_EQUAL 9 +# define R300_VE_SET_LESS_THAN 10 +# define R300_VE_MULTIPLYX2_ADD 11 +# define R300_VE_MULTIPLY_CLAMP 12 +# define R300_VE_FLT2FIX_DX 13 +# define R300_VE_FLT2FIX_DX_RND 14 +/* R500 additions */ +# define R500_VE_PRED_SET_EQ_PUSH 15 +# define R500_VE_PRED_SET_GT_PUSH 16 +# define R500_VE_PRED_SET_GTE_PUSH 17 +# define R500_VE_PRED_SET_NEQ_PUSH 18 +# define R500_VE_COND_WRITE_EQ 19 +# define R500_VE_COND_WRITE_GT 20 +# define R500_VE_COND_WRITE_GTE 21 +# define R500_VE_COND_WRITE_NEQ 22 +# define R500_VE_COND_MUX_EQ 23 +# define R500_VE_COND_MUX_GT 24 +# define R500_VE_COND_MUX_GTE 25 +# define R500_VE_SET_GREATER_THAN 26 +# define R500_VE_SET_EQUAL 27 +# define R500_VE_SET_NOT_EQUAL 28 +/* Math ops */ +# define R300_MATH_NO_OP 0 +# define R300_ME_EXP_BASE2_DX 1 +# define R300_ME_LOG_BASE2_DX 2 +# define R300_ME_EXP_BASEE_FF 3 +# define R300_ME_LIGHT_COEFF_DX 4 +# define R300_ME_POWER_FUNC_FF 5 +# define R300_ME_RECIP_DX 6 +# define R300_ME_RECIP_FF 7 +# define R300_ME_RECIP_SQRT_DX 8 +# define R300_ME_RECIP_SQRT_FF 9 +# define R300_ME_MULTIPLY 10 +# define R300_ME_EXP_BASE2_FULL_DX 11 +# define R300_ME_LOG_BASE2_FULL_DX 12 +# define R300_ME_POWER_FUNC_FF_CLAMP_B 13 +# define R300_ME_POWER_FUNC_FF_CLAMP_B1 14 +# define R300_ME_POWER_FUNC_FF_CLAMP_01 15 +# define R300_ME_SIN 16 +# define R300_ME_COS 17 +/* R500 additions */ +# define R500_ME_LOG_BASE2_IEEE 18 +# define R500_ME_RECIP_IEEE 19 +# define R500_ME_RECIP_SQRT_IEEE 20 +# define R500_ME_PRED_SET_EQ 21 +# define R500_ME_PRED_SET_GT 22 +# define R500_ME_PRED_SET_GTE 23 +# define R500_ME_PRED_SET_NEQ 24 +# define R500_ME_PRED_SET_CLR 25 +# define R500_ME_PRED_SET_INV 26 +# define R500_ME_PRED_SET_POP 27 +# define R500_ME_PRED_SET_RESTORE 28 +/* macro */ +# define R300_PVS_MACRO_OP_2CLK_MADD 0 +# define R300_PVS_MACRO_OP_2CLK_M2X_ADD 1 +#define R300_PVS_DST_MATH_INST (1 << 6) +#define R300_PVS_DST_MACRO_INST (1 << 7) +#define R300_PVS_DST_REG_TYPE(x) ((x) << 8) +# define R300_PVS_DST_REG_TEMPORARY 0 +# define R300_PVS_DST_REG_A0 1 +# define R300_PVS_DST_REG_OUT 2 +# define R500_PVS_DST_REG_OUT_REPL_X 3 +# define R300_PVS_DST_REG_ALT_TEMPORARY 4 +# define R300_PVS_DST_REG_INPUT 5 +#define R300_PVS_DST_ADDR_MODE_1 (1 << 12) +#define R300_PVS_DST_OFFSET(x) ((x) << 13) +#define R300_PVS_DST_WE_X (1 << 20) +#define R300_PVS_DST_WE_Y (1 << 21) +#define R300_PVS_DST_WE_Z (1 << 22) +#define R300_PVS_DST_WE_W (1 << 23) +#define R300_PVS_DST_VE_SAT (1 << 24) +#define R300_PVS_DST_ME_SAT (1 << 25) +#define R300_PVS_DST_PRED_ENABLE (1 << 26) +#define R300_PVS_DST_PRED_SENSE (1 << 27) +#define R300_PVS_DST_DUAL_MATH_OP (1 << 28) +#define R300_PVS_DST_ADDR_SEL(x) ((x) << 29) +#define R300_PVS_DST_ADDR_MODE_0 (1 << 31) +/* src operand instruction */ +#define R300_PVS_SRC_REG_TYPE(x) ((x) << 0) +# define R300_PVS_SRC_REG_TEMPORARY 0 +# define R300_PVS_SRC_REG_INPUT 1 +# define R300_PVS_SRC_REG_CONSTANT 2 +# define R300_PVS_SRC_REG_ALT_TEMPORARY 3 +#define R300_SPARE_0 (1 << 2) +#define R300_PVS_SRC_ABS_XYZW (1 << 3) +#define R300_PVS_SRC_ADDR_MODE_0 (1 << 4) +#define R300_PVS_SRC_OFFSET(x) ((x) << 5) +#define R300_PVS_SRC_SWIZZLE_X(x) ((x) << 13) +#define R300_PVS_SRC_SWIZZLE_Y(x) ((x) << 16) +#define R300_PVS_SRC_SWIZZLE_Z(x) ((x) << 19) +#define R300_PVS_SRC_SWIZZLE_W(x) ((x) << 22) +# define R300_PVS_SRC_SELECT_X 0 +# define R300_PVS_SRC_SELECT_Y 1 +# define R300_PVS_SRC_SELECT_Z 2 +# define R300_PVS_SRC_SELECT_W 3 +# define R300_PVS_SRC_SELECT_FORCE_0 4 +# define R300_PVS_SRC_SELECT_FORCE_1 5 +#define R300_PVS_SRC_NEG_X (1 << 25) +#define R300_PVS_SRC_NEG_Y (1 << 26) +#define R300_PVS_SRC_NEG_Z (1 << 27) +#define R300_PVS_SRC_NEG_W (1 << 28) +#define R300_PVS_SRC_ADDR_SEL(x) ((x) << 29) +#define R300_PVS_SRC_ADDR_MODE_1 (1 << 31) + +#define R300_VAP_PVS_CONST_CNTL 0x22d4 +# define R300_PVS_CONST_BASE_OFFSET(x) ((x) << 0) +# define R300_PVS_MAX_CONST_ADDR(x) ((x) << 16) + +#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22dc +#define R300_VAP_OUT_VTX_FMT_0 0x2090 +# define R300_VTX_POS_PRESENT (1 << 0) +# define R300_VTX_COLOR_0_PRESENT (1 << 1) +# define R300_VTX_COLOR_1_PRESENT (1 << 2) +# define R300_VTX_COLOR_2_PRESENT (1 << 3) +# define R300_VTX_COLOR_3_PRESENT (1 << 4) +# define R300_VTX_PT_SIZE_PRESENT (1 << 16) +#define R300_VAP_OUT_VTX_FMT_1 0x2094 +# define R300_TEX_0_COMP_CNT_SHIFT 0 +# define R300_TEX_1_COMP_CNT_SHIFT 3 +# define R300_TEX_2_COMP_CNT_SHIFT 6 +# define R300_TEX_3_COMP_CNT_SHIFT 9 +# define R300_TEX_4_COMP_CNT_SHIFT 12 +# define R300_TEX_5_COMP_CNT_SHIFT 15 +# define R300_TEX_6_COMP_CNT_SHIFT 18 +# define R300_TEX_7_COMP_CNT_SHIFT 21 +#define R300_VAP_VTX_SIZE 0x20b4 +#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220 +#define R300_VAP_GB_VERT_DISC_ADJ 0x2224 +#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228 +#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c +#define R300_VAP_CLIP_CNTL 0x221c +# define R300_UCP_ENA_0 (1 << 0) +# define R300_UCP_ENA_1 (1 << 1) +# define R300_UCP_ENA_2 (1 << 2) +# define R300_UCP_ENA_3 (1 << 3) +# define R300_UCP_ENA_4 (1 << 4) +# define R300_UCP_ENA_5 (1 << 5) +# define R300_PS_UCP_MODE_SHIFT 14 +# define R300_CLIP_DISABLE (1 << 16) +# define R300_UCP_CULL_ONLY_ENA (1 << 17) +# define R300_BOUNDARY_EDGE_FLAG_ENA (1 << 18) +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 + +#define R500_VAP_INDEX_OFFSET 0x208c + +#define R300_SU_TEX_WRAP 0x42a0 +#define R300_SU_POLY_OFFSET_ENABLE 0x42b4 +#define R300_SU_CULL_MODE 0x42b8 +# define R300_CULL_FRONT (1 << 0) +# define R300_CULL_BACK (1 << 1) +# define R300_FACE_POS (0 << 2) +# define R300_FACE_NEG (1 << 2) +#define R300_SU_DEPTH_SCALE 0x42c0 +#define R300_SU_DEPTH_OFFSET 0x42c4 + +#define R300_RS_COUNT 0x4300 +# define R300_RS_COUNT_IT_COUNT_SHIFT 0 +# define R300_RS_COUNT_IC_COUNT_SHIFT 7 +# define R300_RS_COUNT_HIRES_EN (1 << 18) + +#define R300_RS_IP_0 0x4310 +#define R300_RS_IP_1 0x4314 +# define R300_RS_TEX_PTR(x) ((x) << 0) +# define R300_RS_COL_PTR(x) ((x) << 6) +# define R300_RS_COL_FMT(x) ((x) << 9) +# define R300_RS_COL_FMT_RGBA 0 +# define R300_RS_COL_FMT_RGB0 2 +# define R300_RS_COL_FMT_RGB1 3 +# define R300_RS_COL_FMT_000A 4 +# define R300_RS_COL_FMT_0000 5 +# define R300_RS_COL_FMT_0001 6 +# define R300_RS_COL_FMT_111A 8 +# define R300_RS_COL_FMT_1110 9 +# define R300_RS_COL_FMT_1111 10 +# define R300_RS_SEL_S(x) ((x) << 13) +# define R300_RS_SEL_T(x) ((x) << 16) +# define R300_RS_SEL_R(x) ((x) << 19) +# define R300_RS_SEL_Q(x) ((x) << 22) +# define R300_RS_SEL_C0 0 +# define R300_RS_SEL_C1 1 +# define R300_RS_SEL_C2 2 +# define R300_RS_SEL_C3 3 +# define R300_RS_SEL_K0 4 +# define R300_RS_SEL_K1 5 +#define R300_RS_INST_COUNT 0x4304 +# define R300_INST_COUNT_RS(x) ((x) << 0) +# define R300_RS_W_EN (1 << 4) +# define R300_TX_OFFSET_RS(x) ((x) << 5) +#define R300_RS_INST_0 0x4330 +#define R300_RS_INST_1 0x4334 +# define R300_INST_TEX_ID(x) ((x) << 0) +# define R300_RS_INST_TEX_CN_WRITE (1 << 3) +# define R300_INST_TEX_ADDR(x) ((x) << 6) + +#define R300_TX_INVALTAGS 0x4100 +#define R300_TX_FILTER0_0 0x4400 +#define R300_TX_FILTER0_1 0x4404 +#define R300_TX_FILTER0_2 0x4408 +# define R300_TX_CLAMP_S(x) ((x) << 0) +# define R300_TX_CLAMP_T(x) ((x) << 3) +# define R300_TX_CLAMP_R(x) ((x) << 6) +# define R300_TX_CLAMP_WRAP 0 +# define R300_TX_CLAMP_MIRROR 1 +# define R300_TX_CLAMP_CLAMP_LAST 2 +# define R300_TX_CLAMP_MIRROR_CLAMP_LAST 3 +# define R300_TX_CLAMP_CLAMP_BORDER 4 +# define R300_TX_CLAMP_MIRROR_CLAMP_BORDER 5 +# define R300_TX_CLAMP_CLAMP_GL 6 +# define R300_TX_CLAMP_MIRROR_CLAMP_GL 7 +# define R300_TX_MAG_FILTER_NEAREST (1 << 9) +# define R300_TX_MIN_FILTER_NEAREST (1 << 11) +# define R300_TX_MAG_FILTER_LINEAR (2 << 9) +# define R300_TX_MIN_FILTER_LINEAR (2 << 11) +# define R300_TX_ID_SHIFT 28 +#define R300_TX_FILTER1_0 0x4440 +#define R300_TX_FILTER1_1 0x4444 +#define R300_TX_FILTER1_2 0x4448 +#define R300_TX_FORMAT0_0 0x4480 +#define R300_TX_FORMAT0_1 0x4484 +#define R300_TX_FORMAT0_2 0x4488 +# define R300_TXWIDTH_SHIFT 0 +# define R300_TXHEIGHT_SHIFT 11 +# define R300_NUM_LEVELS_SHIFT 26 +# define R300_NUM_LEVELS_MASK 0x +# define R300_TXPROJECTED (1 << 30) +# define R300_TXPITCH_EN (1 << 31) +#define R300_TX_FORMAT1_0 0x44c0 +#define R300_TX_FORMAT1_1 0x44c4 +#define R300_TX_FORMAT1_2 0x44c8 +# define R300_TX_FORMAT_X8 0x0 +# define R300_TX_FORMAT_X16 0x1 +# define R300_TX_FORMAT_Y4X4 0x2 +# define R300_TX_FORMAT_Y8X8 0x3 +# define R300_TX_FORMAT_Y16X16 0x4 +# define R300_TX_FORMAT_Z3Y3X2 0x5 +# define R300_TX_FORMAT_Z5Y6X5 0x6 +# define R300_TX_FORMAT_Z6Y5X5 0x7 +# define R300_TX_FORMAT_Z11Y11X10 0x8 +# define R300_TX_FORMAT_Z10Y11X11 0x9 +# define R300_TX_FORMAT_W4Z4Y4X4 0xA +# define R300_TX_FORMAT_W1Z5Y5X5 0xB +# define R300_TX_FORMAT_W8Z8Y8X8 0xC +# define R300_TX_FORMAT_W2Z10Y10X10 0xD +# define R300_TX_FORMAT_W16Z16Y16X16 0xE +# define R300_TX_FORMAT_DXT1 0xF +# define R300_TX_FORMAT_DXT3 0x10 +# define R300_TX_FORMAT_DXT5 0x11 +# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */ +# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */ +# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */ +# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */ +# define R300_TX_FORMAT_VYUY422 0x14 /* no swizzle */ +# define R300_TX_FORMAT_YVYU422 0x15 /* no swizzle */ +# define R300_TX_FORMAT_X24_Y8 0x1e +# define R300_TX_FORMAT_X32 0x1e + /* Floating point formats */ + /* Note - hardware supports both 16 and 32 bit floating point */ +# define R300_TX_FORMAT_FL_I16 0x18 +# define R300_TX_FORMAT_FL_I16A16 0x19 +# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A +# define R300_TX_FORMAT_FL_I32 0x1B +# define R300_TX_FORMAT_FL_I32A32 0x1C +# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D + /* alpha modes, convenience mostly */ + /* if you have alpha, pick constant appropriate to the + number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */ +# define R300_TX_FORMAT_ALPHA_1CH 0x000 +# define R300_TX_FORMAT_ALPHA_2CH 0x200 +# define R300_TX_FORMAT_ALPHA_4CH 0x600 +# define R300_TX_FORMAT_ALPHA_NONE 0xA00 + /* Swizzling */ + /* constants */ +# define R300_TX_FORMAT_X 0 +# define R300_TX_FORMAT_Y 1 +# define R300_TX_FORMAT_Z 2 +# define R300_TX_FORMAT_W 3 +# define R300_TX_FORMAT_ZERO 4 +# define R300_TX_FORMAT_ONE 5 + /* 2.0*Z, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_Z 6 + /* 2.0*W, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_W 7 + +# define R300_TX_FORMAT_B_SHIFT 18 +# define R300_TX_FORMAT_G_SHIFT 15 +# define R300_TX_FORMAT_R_SHIFT 12 +# define R300_TX_FORMAT_A_SHIFT 9 + + /* Convenience macro to take care of layout and swizzling */ +# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) ( \ + ((R300_TX_FORMAT_##B)<<R300_TX_FORMAT_B_SHIFT) \ + | ((R300_TX_FORMAT_##G)<<R300_TX_FORMAT_G_SHIFT) \ + | ((R300_TX_FORMAT_##R)<<R300_TX_FORMAT_R_SHIFT) \ + | ((R300_TX_FORMAT_##A)<<R300_TX_FORMAT_A_SHIFT) \ + | (R300_TX_FORMAT_##FMT) \ + ) + +# define R300_TX_FORMAT_YUV_TO_RGB_CLAMP (1 << 22) +# define R300_TX_FORMAT_YUV_TO_RGB_NO_CLAMP (2 << 22) +# define R300_TX_FORMAT_SWAP_YUV (1 << 24) + +# define R300_TX_FORMAT_CACHE_WHOLE (0 << 27) +# define R300_TX_FORMAT_CACHE_HALF_REGION_0 (2 << 27) +# define R300_TX_FORMAT_CACHE_HALF_REGION_1 (3 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_0 (4 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_1 (5 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_2 (6 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_3 (7 << 27) + +#define R300_TX_FORMAT2_0 0x4500 +#define R300_TX_FORMAT2_1 0x4504 +#define R300_TX_FORMAT2_2 0x4508 +# define R500_TXWIDTH_11 (1 << 15) +# define R500_TXHEIGHT_11 (1 << 16) + +#define R300_TX_OFFSET_0 0x4540 +#define R300_TX_OFFSET_1 0x4544 +#define R300_TX_OFFSET_2 0x4548 +# define R300_ENDIAN_SWAP_16_BIT (1 << 0) +# define R300_ENDIAN_SWAP_32_BIT (2 << 0) +# define R300_ENDIAN_SWAP_HALF_DWORD (3 << 0) +# define R300_MACRO_TILE (1 << 2) + +#define R300_TX_BORDER_COLOR_0 0x45c0 + +#define R300_TX_ENABLE 0x4104 +# define R300_TEX_0_ENABLE (1 << 0) +# define R300_TEX_1_ENABLE (1 << 1) +# define R300_TEX_2_ENABLE (1 << 2) + +#define R300_US_W_FMT 0x46b4 +#define R300_US_OUT_FMT_1 0x46a8 +#define R300_US_OUT_FMT_2 0x46ac +#define R300_US_OUT_FMT_3 0x46b0 +#define R300_US_OUT_FMT_0 0x46a4 +# define R300_OUT_FMT_C4_8 (0 << 0) +# define R300_OUT_FMT_C4_10 (1 << 0) +# define R300_OUT_FMT_C4_10_GAMMA (2 << 0) +# define R300_OUT_FMT_C_16 (3 << 0) +# define R300_OUT_FMT_C2_16 (4 << 0) +# define R300_OUT_FMT_C4_16 (5 << 0) +# define R300_OUT_FMT_C_16_MPEG (6 << 0) +# define R300_OUT_FMT_C2_16_MPEG (7 << 0) +# define R300_OUT_FMT_C2_4 (8 << 0) +# define R300_OUT_FMT_C_3_3_2 (9 << 0) +# define R300_OUT_FMT_C_5_6_5 (10 << 0) +# define R300_OUT_FMT_C_11_11_10 (11 << 0) +# define R300_OUT_FMT_C_10_11_11 (12 << 0) +# define R300_OUT_FMT_C_2_10_10_10 (13 << 0) +# define R300_OUT_FMT_UNUSED (15 << 0) +# define R300_OUT_FMT_C_16_FP (16 << 0) +# define R300_OUT_FMT_C2_16_FP (17 << 0) +# define R300_OUT_FMT_C4_16_FP (18 << 0) +# define R300_OUT_FMT_C_32_FP (19 << 0) +# define R300_OUT_FMT_C2_32_FP (20 << 0) +# define R300_OUT_FMT_C4_32_FP (21 << 0) +# define R300_OUT_FMT_C0_SEL_ALPHA (0 << 8) +# define R300_OUT_FMT_C0_SEL_RED (1 << 8) +# define R300_OUT_FMT_C0_SEL_GREEN (2 << 8) +# define R300_OUT_FMT_C0_SEL_BLUE (3 << 8) +# define R300_OUT_FMT_C1_SEL_ALPHA (0 << 10) +# define R300_OUT_FMT_C1_SEL_RED (1 << 10) +# define R300_OUT_FMT_C1_SEL_GREEN (2 << 10) +# define R300_OUT_FMT_C1_SEL_BLUE (3 << 10) +# define R300_OUT_FMT_C2_SEL_ALPHA (0 << 12) +# define R300_OUT_FMT_C2_SEL_RED (1 << 12) +# define R300_OUT_FMT_C2_SEL_GREEN (2 << 12) +# define R300_OUT_FMT_C2_SEL_BLUE (3 << 12) +# define R300_OUT_FMT_C3_SEL_ALPHA (0 << 14) +# define R300_OUT_FMT_C3_SEL_RED (1 << 14) +# define R300_OUT_FMT_C3_SEL_GREEN (2 << 14) +# define R300_OUT_FMT_C3_SEL_BLUE (3 << 14) +#define R300_US_CONFIG 0x4600 +# define R300_NLEVEL_SHIFT 0 +# define R300_FIRST_TEX (1 << 3) +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) +#define R300_US_PIXSIZE 0x4604 +#define R300_US_CODE_OFFSET 0x4608 +# define R300_ALU_CODE_OFFSET(x) ((x) << 0) +# define R300_ALU_CODE_SIZE(x) ((x) << 6) +# define R300_TEX_CODE_OFFSET(x) ((x) << 13) +# define R300_TEX_CODE_SIZE(x) ((x) << 18) +#define R300_US_CODE_ADDR_0 0x4610 +# define R300_ALU_START(x) ((x) << 0) +# define R300_ALU_SIZE(x) ((x) << 6) +# define R300_TEX_START(x) ((x) << 12) +# define R300_TEX_SIZE(x) ((x) << 17) +# define R300_RGBA_OUT (1 << 22) +# define R300_W_OUT (1 << 23) +#define R300_US_CODE_ADDR_1 0x4614 +#define R300_US_CODE_ADDR_2 0x4618 +#define R300_US_CODE_ADDR_3 0x461c +#define R300_US_TEX_INST_0 0x4620 +#define R300_US_TEX_INST_1 0x4624 +#define R300_US_TEX_INST_2 0x4628 +#define R300_US_TEX_INST(x) (R300_US_TEX_INST_0 + (x)*4) +# define R300_TEX_SRC_ADDR(x) ((x) << 0) +# define R300_TEX_DST_ADDR(x) ((x) << 6) +# define R300_TEX_ID(x) ((x) << 11) +# define R300_TEX_INST(x) ((x) << 15) +# define R300_TEX_INST_NOP 0 +# define R300_TEX_INST_LD 1 +# define R300_TEX_INST_TEXKILL 2 +# define R300_TEX_INST_PROJ 3 +# define R300_TEX_INST_LODBIAS 4 +#define R300_US_ALU_RGB_ADDR_0 0x46c0 +#define R300_US_ALU_RGB_ADDR_1 0x46c4 +#define R300_US_ALU_RGB_ADDR_2 0x46c8 +#define R300_US_ALU_RGB_ADDR(x) (R300_US_ALU_RGB_ADDR_0 + (x)*4) +/* for ADDR0-2, values 0-31 specify a location in the pixel stack, + values 32-63 specify a constant */ +# define R300_ALU_RGB_ADDR0(x) ((x) << 0) +# define R300_ALU_RGB_ADDR1(x) ((x) << 6) +# define R300_ALU_RGB_ADDR2(x) ((x) << 12) +# define R300_ALU_RGB_CONST(x) ((x) | (1 << 5)) +/* ADDRD - where on the pixel stack the result of this instruction + will be written */ +# define R300_ALU_RGB_ADDRD(x) ((x) << 18) +# define R300_ALU_RGB_WMASK(x) ((x) << 23) +# define R300_ALU_RGB_OMASK(x) ((x) << 26) +# define R300_ALU_RGB_MASK_NONE 0 +# define R300_ALU_RGB_MASK_R 1 +# define R300_ALU_RGB_MASK_G 2 +# define R300_ALU_RGB_MASK_B 4 +# define R300_ALU_RGB_MASK_RGB 7 +# define R300_ALU_RGB_TARGET_A (0 << 29) +# define R300_ALU_RGB_TARGET_B (1 << 29) +# define R300_ALU_RGB_TARGET_C (2 << 29) +# define R300_ALU_RGB_TARGET_D (3 << 29) +#define R300_US_ALU_RGB_INST_0 0x48c0 +#define R300_US_ALU_RGB_INST_1 0x48c4 +#define R300_US_ALU_RGB_INST_2 0x48c8 +#define R300_US_ALU_RGB_INST(x) (R300_US_ALU_RGB_INST_0 + (x)*4) +# define R300_ALU_RGB_SEL_A(x) ((x) << 0) +# define R300_ALU_RGB_SRC0_RGB 0 +# define R300_ALU_RGB_SRC0_RRR 1 +# define R300_ALU_RGB_SRC0_GGG 2 +# define R300_ALU_RGB_SRC0_BBB 3 +# define R300_ALU_RGB_SRC1_RGB 4 +# define R300_ALU_RGB_SRC1_RRR 5 +# define R300_ALU_RGB_SRC1_GGG 6 +# define R300_ALU_RGB_SRC1_BBB 7 +# define R300_ALU_RGB_SRC2_RGB 8 +# define R300_ALU_RGB_SRC2_RRR 9 +# define R300_ALU_RGB_SRC2_GGG 10 +# define R300_ALU_RGB_SRC2_BBB 11 +# define R300_ALU_RGB_SRC0_AAA 12 +# define R300_ALU_RGB_SRC1_AAA 13 +# define R300_ALU_RGB_SRC2_AAA 14 +# define R300_ALU_RGB_SRCP_RGB 15 +# define R300_ALU_RGB_SRCP_RRR 16 +# define R300_ALU_RGB_SRCP_GGG 17 +# define R300_ALU_RGB_SRCP_BBB 18 +# define R300_ALU_RGB_SRCP_AAA 19 +# define R300_ALU_RGB_0_0 20 +# define R300_ALU_RGB_1_0 21 +# define R300_ALU_RGB_0_5 22 +# define R300_ALU_RGB_SRC0_GBR 23 +# define R300_ALU_RGB_SRC1_GBR 24 +# define R300_ALU_RGB_SRC2_GBR 25 +# define R300_ALU_RGB_SRC0_BRG 26 +# define R300_ALU_RGB_SRC1_BRG 27 +# define R300_ALU_RGB_SRC2_BRG 28 +# define R300_ALU_RGB_SRC0_ABG 29 +# define R300_ALU_RGB_SRC1_ABG 30 +# define R300_ALU_RGB_SRC2_ABG 31 +# define R300_ALU_RGB_MOD_A(x) ((x) << 5) +# define R300_ALU_RGB_MOD_NOP 0 +# define R300_ALU_RGB_MOD_NEG 1 +# define R300_ALU_RGB_MOD_ABS 2 +# define R300_ALU_RGB_MOD_NAB 3 +# define R300_ALU_RGB_SEL_B(x) ((x) << 7) +# define R300_ALU_RGB_MOD_B(x) ((x) << 12) +# define R300_ALU_RGB_SEL_C(x) ((x) << 14) +# define R300_ALU_RGB_MOD_C(x) ((x) << 19) +# define R300_ALU_RGB_SRCP_OP(x) ((x) << 21) +# define R300_ALU_RGB_SRCP_OP_1_MINUS_2RGB0 0 +# define R300_ALU_RGB_SRCP_OP_RGB1_MINUS_RGB0 1 +# define R300_ALU_RGB_SRCP_OP_RGB1_PLUS_RGB0 2 +# define R300_ALU_RGB_SRCP_OP_1_MINUS_RGB0 3 +# define R300_ALU_RGB_OP(x) ((x) << 23) +# define R300_ALU_RGB_OP_MAD 0 +# define R300_ALU_RGB_OP_DP3 1 +# define R300_ALU_RGB_OP_DP4 2 +# define R300_ALU_RGB_OP_D2A 3 +# define R300_ALU_RGB_OP_MIN 4 +# define R300_ALU_RGB_OP_MAX 5 +# define R300_ALU_RGB_OP_CND 7 +# define R300_ALU_RGB_OP_CMP 8 +# define R300_ALU_RGB_OP_FRC 9 +# define R300_ALU_RGB_OP_SOP 10 +# define R300_ALU_RGB_OMOD(x) ((x) << 27) +# define R300_ALU_RGB_OMOD_NONE 0 +# define R300_ALU_RGB_OMOD_MUL_2 1 +# define R300_ALU_RGB_OMOD_MUL_4 2 +# define R300_ALU_RGB_OMOD_MUL_8 3 +# define R300_ALU_RGB_OMOD_DIV_2 4 +# define R300_ALU_RGB_OMOD_DIV_4 5 +# define R300_ALU_RGB_OMOD_DIV_8 6 +# define R300_ALU_RGB_CLAMP (1 << 30) +# define R300_ALU_RGB_INSERT_NOP (1 << 31) +#define R300_US_ALU_ALPHA_ADDR_0 0x47c0 +#define R300_US_ALU_ALPHA_ADDR_1 0x47c4 +#define R300_US_ALU_ALPHA_ADDR_2 0x47c8 +#define R300_US_ALU_ALPHA_ADDR(x) (R300_US_ALU_ALPHA_ADDR_0 + (x)*4) +/* for ADDR0-2, values 0-31 specify a location in the pixel stack, + values 32-63 specify a constant */ +# define R300_ALU_ALPHA_ADDR0(x) ((x) << 0) +# define R300_ALU_ALPHA_ADDR1(x) ((x) << 6) +# define R300_ALU_ALPHA_ADDR2(x) ((x) << 12) +# define R300_ALU_ALPHA_CONST(x) ((x) | (1 << 5)) +/* ADDRD - where on the pixel stack the result of this instruction + will be written */ +# define R300_ALU_ALPHA_ADDRD(x) ((x) << 18) +# define R300_ALU_ALPHA_WMASK(x) ((x) << 23) +# define R300_ALU_ALPHA_OMASK(x) ((x) << 24) +# define R300_ALU_ALPHA_OMASK_W(x) ((x) << 27) +# define R300_ALU_ALPHA_MASK_NONE 0 +# define R300_ALU_ALPHA_MASK_A 1 +# define R300_ALU_ALPHA_TARGET_A (0 << 25) +# define R300_ALU_ALPHA_TARGET_B (1 << 25) +# define R300_ALU_ALPHA_TARGET_C (2 << 25) +# define R300_ALU_ALPHA_TARGET_D (3 << 25) +#define R300_US_ALU_ALPHA_INST_0 0x49c0 +#define R300_US_ALU_ALPHA_INST_1 0x49c4 +#define R300_US_ALU_ALPHA_INST_2 0x49c8 +#define R300_US_ALU_ALPHA_INST(x) (R300_US_ALU_ALPHA_INST_0 + (x)*4) +# define R300_ALU_ALPHA_SEL_A(x) ((x) << 0) +# define R300_ALU_ALPHA_SRC0_R 0 +# define R300_ALU_ALPHA_SRC0_G 1 +# define R300_ALU_ALPHA_SRC0_B 2 +# define R300_ALU_ALPHA_SRC1_R 3 +# define R300_ALU_ALPHA_SRC1_G 4 +# define R300_ALU_ALPHA_SRC1_B 5 +# define R300_ALU_ALPHA_SRC2_R 6 +# define R300_ALU_ALPHA_SRC2_G 7 +# define R300_ALU_ALPHA_SRC2_B 8 +# define R300_ALU_ALPHA_SRC0_A 9 +# define R300_ALU_ALPHA_SRC1_A 10 +# define R300_ALU_ALPHA_SRC2_A 11 +# define R300_ALU_ALPHA_SRCP_R 12 +# define R300_ALU_ALPHA_SRCP_G 13 +# define R300_ALU_ALPHA_SRCP_B 14 +# define R300_ALU_ALPHA_SRCP_A 15 +# define R300_ALU_ALPHA_0_0 16 +# define R300_ALU_ALPHA_1_0 17 +# define R300_ALU_ALPHA_0_5 18 +# define R300_ALU_ALPHA_MOD_A(x) ((x) << 5) +# define R300_ALU_ALPHA_MOD_NOP 0 +# define R300_ALU_ALPHA_MOD_NEG 1 +# define R300_ALU_ALPHA_MOD_ABS 2 +# define R300_ALU_ALPHA_MOD_NAB 3 +# define R300_ALU_ALPHA_SEL_B(x) ((x) << 7) +# define R300_ALU_ALPHA_MOD_B(x) ((x) << 12) +# define R300_ALU_ALPHA_SEL_C(x) ((x) << 14) +# define R300_ALU_ALPHA_MOD_C(x) ((x) << 19) +# define R300_ALU_ALPHA_SRCP_OP(x) ((x) << 21) +# define R300_ALU_ALPHA_SRCP_OP_1_MINUS_2RGB0 0 +# define R300_ALU_ALPHA_SRCP_OP_RGB1_MINUS_RGB0 1 +# define R300_ALU_ALPHA_SRCP_OP_RGB1_PLUS_RGB0 2 +# define R300_ALU_ALPHA_SRCP_OP_1_MINUS_RGB0 3 +# define R300_ALU_ALPHA_OP(x) ((x) << 23) +# define R300_ALU_ALPHA_OP_MAD 0 +# define R300_ALU_ALPHA_OP_DP 1 +# define R300_ALU_ALPHA_OP_MIN 2 +# define R300_ALU_ALPHA_OP_MAX 3 +# define R300_ALU_ALPHA_OP_CND 5 +# define R300_ALU_ALPHA_OP_CMP 6 +# define R300_ALU_ALPHA_OP_FRC 7 +# define R300_ALU_ALPHA_OP_EX2 8 +# define R300_ALU_ALPHA_OP_LN2 9 +# define R300_ALU_ALPHA_OP_RCP 10 +# define R300_ALU_ALPHA_OP_RSQ 11 +# define R300_ALU_ALPHA_OMOD(x) ((x) << 27) +# define R300_ALU_ALPHA_OMOD_NONE 0 +# define R300_ALU_ALPHA_OMOD_MUL_2 1 +# define R300_ALU_ALPHA_OMOD_MUL_4 2 +# define R300_ALU_ALPHA_OMOD_MUL_8 3 +# define R300_ALU_ALPHA_OMOD_DIV_2 4 +# define R300_ALU_ALPHA_OMOD_DIV_4 5 +# define R300_ALU_ALPHA_OMOD_DIV_8 6 +# define R300_ALU_ALPHA_CLAMP (1 << 30) + +#define R300_US_ALU_CONST_R_0 0x4c00 +#define R300_US_ALU_CONST_R(x) (R300_US_ALU_CONST_R_0 + (x)*16) +#define R300_US_ALU_CONST_G_0 0x4c04 +#define R300_US_ALU_CONST_G(x) (R300_US_ALU_CONST_G_0 + (x)*16) +#define R300_US_ALU_CONST_B_0 0x4c08 +#define R300_US_ALU_CONST_B(x) (R300_US_ALU_CONST_B_0 + (x)*16) +#define R300_US_ALU_CONST_A_0 0x4c0c +#define R300_US_ALU_CONST_A(x) (R300_US_ALU_CONST_A_0 + (x)*16) + +#define R300_FG_DEPTH_SRC 0x4bd8 +#define R300_FG_FOG_BLEND 0x4bc0 +#define R300_FG_ALPHA_FUNC 0x4bd4 + +#define R300_DST_PIPE_CONFIG 0x170c +# define R300_PIPE_AUTO_CONFIG (1 << 31) +#define R300_RB2D_DSTCACHE_MODE 0x3428 +#define R300_RB2D_DSTCACHE_MODE 0x3428 +# define R300_DC_AUTOFLUSH_ENABLE (1 << 8) +# define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17) +#define R300_RB2D_DSTCACHE_CTLSTAT 0x342c /* use DSTCACHE_CTLSTAT instead */ +#define R300_DSTCACHE_CTLSTAT 0x1714 +# define R300_DC_FLUSH_2D (1 << 0) +# define R300_DC_FREE_2D (1 << 2) +# define R300_RB2D_DC_FLUSH_ALL (R300_DC_FLUSH_2D | R300_DC_FREE_2D) +# define R300_RB2D_DC_BUSY (1 << 31) +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +# define R300_DC_FLUSH_3D (2 << 0) +# define R300_DC_FREE_3D (2 << 2) +# define R300_RB3D_DC_FLUSH_ALL (R300_DC_FLUSH_3D | R300_DC_FREE_3D) +# define R300_DC_FINISH_3D (1 << 4) +#define R300_RB3D_ZCACHE_CTLSTAT 0x4f18 +# define R300_ZC_FLUSH (1 << 0) +# define R300_ZC_FREE (1 << 1) +# define R300_ZC_FLUSH_ALL 0x3 +#define R300_RB3D_ZSTENCILCNTL 0x4f04 +#define R300_RB3D_ZCACHE_CTLSTAT 0x4f18 +#define R300_RB3D_BW_CNTL 0x4f1c +#define R300_RB3D_ZCNTL 0x4f00 +#define R300_RB3D_ZTOP 0x4f14 +#define R300_RB3D_ROPCNTL 0x4e18 +#define R300_RB3D_BLENDCNTL 0x4e04 +# define R300_ALPHA_BLEND_ENABLE (1 << 0) +# define R300_SEPARATE_ALPHA_ENABLE (1 << 1) +# define R300_READ_ENABLE (1 << 2) +#define R300_RB3D_ABLENDCNTL 0x4e08 +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +#define R300_RB3D_COLOROFFSET0 0x4e28 +#define R300_RB3D_COLORPITCH0 0x4e38 +# define R300_COLORTILE (1 << 16) +# define R300_COLORENDIAN_WORD (1 << 19) +# define R300_COLORENDIAN_DWORD (2 << 19) +# define R300_COLORENDIAN_HALF_DWORD (3 << 19) +# define R300_COLORFORMAT_ARGB1555 (3 << 21) +# define R300_COLORFORMAT_RGB565 (4 << 21) +# define R300_COLORFORMAT_ARGB8888 (6 << 21) +# define R300_COLORFORMAT_ARGB32323232 (7 << 21) +# define R300_COLORFORMAT_I8 (9 << 21) +# define R300_COLORFORMAT_ARGB16161616 (10 << 21) +# define R300_COLORFORMAT_VYUY (11 << 21) +# define R300_COLORFORMAT_YVYU (12 << 21) +# define R300_COLORFORMAT_UV88 (13 << 21) +# define R300_COLORFORMAT_ARGB4444 (15 << 21) + +#define R300_RB3D_AARESOLVE_CTL 0x4e88 +#define R300_RB3D_COLOR_CHANNEL_MASK 0x4e0c +# define R300_BLUE_MASK_EN (1 << 0) +# define R300_GREEN_MASK_EN (1 << 1) +# define R300_RED_MASK_EN (1 << 2) +# define R300_ALPHA_MASK_EN (1 << 3) +#define R300_RB3D_COLOR_CLEAR_VALUE 0x4e14 +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +#define R300_RB3D_CCTL 0x4e00 +#define R300_RB3D_DITHER_CTL 0x4e50 + +#define R300_SC_EDGERULE 0x43a8 +#define R300_SC_SCISSOR0 0x43e0 +#define R300_SC_SCISSOR1 0x43e4 +# define R300_SCISSOR_X_SHIFT 0 +# define R300_SCISSOR_Y_SHIFT 13 +#define R300_SC_CLIP_0_A 0x43b0 +#define R300_SC_CLIP_0_B 0x43b4 +# define R300_CLIP_X_SHIFT 0 +# define R300_CLIP_Y_SHIFT 13 +#define R300_SC_CLIP_RULE 0x43d0 +#define R300_SC_SCREENDOOR 0x43e8 + +/* R500 US has to be loaded through an index/data pair */ +#define R500_GA_US_VECTOR_INDEX 0x4250 +# define R500_US_VECTOR_TYPE_INST (0 << 16) +# define R500_US_VECTOR_TYPE_CONST (1 << 16) +# define R500_US_VECTOR_CLAMP (1 << 17) +# define R500_US_VECTOR_INST_INDEX(x) ((x) | R500_US_VECTOR_TYPE_INST) +# define R500_US_VECTOR_CONST_INDEX(x) ((x) | R500_US_VECTOR_TYPE_CONST) +#define R500_GA_US_VECTOR_DATA 0x4254 + +/* + * The R500 unified shader (US) registers come in banks of 512 each, one + * for each instruction slot in the shader. You can't touch them directly. + * R500_US_VECTOR_INDEX() sets the base instruction to modify; successive + * writes to R500_GA_US_VECTOR_DATA autoincrement the index after the + * instruction is fully specified. + */ +#define R500_US_ALU_ALPHA_INST_0 0xa800 +# define R500_ALPHA_OP_MAD 0 +# define R500_ALPHA_OP_DP 1 +# define R500_ALPHA_OP_MIN 2 +# define R500_ALPHA_OP_MAX 3 +/* #define R500_ALPHA_OP_RESERVED 4 */ +# define R500_ALPHA_OP_CND 5 +# define R500_ALPHA_OP_CMP 6 +# define R500_ALPHA_OP_FRC 7 +# define R500_ALPHA_OP_EX2 8 +# define R500_ALPHA_OP_LN2 9 +# define R500_ALPHA_OP_RCP 10 +# define R500_ALPHA_OP_RSQ 11 +# define R500_ALPHA_OP_SIN 12 +# define R500_ALPHA_OP_COS 13 +# define R500_ALPHA_OP_MDH 14 +# define R500_ALPHA_OP_MDV 15 +# define R500_ALPHA_ADDRD(x) ((x) << 4) +# define R500_ALPHA_ADDRD_REL (1 << 11) +# define R500_ALPHA_SEL_A_SRC0 (0 << 12) +# define R500_ALPHA_SEL_A_SRC1 (1 << 12) +# define R500_ALPHA_SEL_A_SRC2 (2 << 12) +# define R500_ALPHA_SEL_A_SRCP (3 << 12) +# define R500_ALPHA_SWIZ_A_R (0 << 14) +# define R500_ALPHA_SWIZ_A_G (1 << 14) +# define R500_ALPHA_SWIZ_A_B (2 << 14) +# define R500_ALPHA_SWIZ_A_A (3 << 14) +# define R500_ALPHA_SWIZ_A_0 (4 << 14) +# define R500_ALPHA_SWIZ_A_HALF (5 << 14) +# define R500_ALPHA_SWIZ_A_1 (6 << 14) +/* #define R500_ALPHA_SWIZ_A_UNUSED (7 << 14) */ +# define R500_ALPHA_MOD_A_NOP (0 << 17) +# define R500_ALPHA_MOD_A_NEG (1 << 17) +# define R500_ALPHA_MOD_A_ABS (2 << 17) +# define R500_ALPHA_MOD_A_NAB (3 << 17) +# define R500_ALPHA_SEL_B_SRC0 (0 << 19) +# define R500_ALPHA_SEL_B_SRC1 (1 << 19) +# define R500_ALPHA_SEL_B_SRC2 (2 << 19) +# define R500_ALPHA_SEL_B_SRCP (3 << 19) +# define R500_ALPHA_SWIZ_B_R (0 << 21) +# define R500_ALPHA_SWIZ_B_G (1 << 21) +# define R500_ALPHA_SWIZ_B_B (2 << 21) +# define R500_ALPHA_SWIZ_B_A (3 << 21) +# define R500_ALPHA_SWIZ_B_0 (4 << 21) +# define R500_ALPHA_SWIZ_B_HALF (5 << 21) +# define R500_ALPHA_SWIZ_B_1 (6 << 21) +/* #define R500_ALPHA_SWIZ_B_UNUSED (7 << 21) */ +# define R500_ALPHA_MOD_B_NOP (0 << 24) +# define R500_ALPHA_MOD_B_NEG (1 << 24) +# define R500_ALPHA_MOD_B_ABS (2 << 24) +# define R500_ALPHA_MOD_B_NAB (3 << 24) +# define R500_ALPHA_OMOD_IDENTITY (0 << 26) +# define R500_ALPHA_OMOD_MUL_2 (1 << 26) +# define R500_ALPHA_OMOD_MUL_4 (2 << 26) +# define R500_ALPHA_OMOD_MUL_8 (3 << 26) +# define R500_ALPHA_OMOD_DIV_2 (4 << 26) +# define R500_ALPHA_OMOD_DIV_4 (5 << 26) +# define R500_ALPHA_OMOD_DIV_8 (6 << 26) +# define R500_ALPHA_OMOD_DISABLE (7 << 26) +# define R500_ALPHA_TARGET(x) ((x) << 29) +# define R500_ALPHA_W_OMASK (1 << 31) +#define R500_US_ALU_ALPHA_ADDR_0 0x9800 +# define R500_ALPHA_ADDR0(x) ((x) << 0) +# define R500_ALPHA_ADDR0_CONST (1 << 8) +# define R500_ALPHA_ADDR0_REL (1 << 9) +# define R500_ALPHA_ADDR1(x) ((x) << 10) +# define R500_ALPHA_ADDR1_CONST (1 << 18) +# define R500_ALPHA_ADDR1_REL (1 << 19) +# define R500_ALPHA_ADDR2(x) ((x) << 20) +# define R500_ALPHA_ADDR2_CONST (1 << 28) +# define R500_ALPHA_ADDR2_REL (1 << 29) +# define R500_ALPHA_SRCP_OP_1_MINUS_2A0 (0 << 30) +# define R500_ALPHA_SRCP_OP_A1_MINUS_A0 (1 << 30) +# define R500_ALPHA_SRCP_OP_A1_PLUS_A0 (2 << 30) +# define R500_ALPHA_SRCP_OP_1_MINUS_A0 (3 << 30) +#define R500_US_ALU_RGBA_INST_0 0xb000 +# define R500_ALU_RGBA_OP_MAD (0 << 0) +# define R500_ALU_RGBA_OP_DP3 (1 << 0) +# define R500_ALU_RGBA_OP_DP4 (2 << 0) +# define R500_ALU_RGBA_OP_D2A (3 << 0) +# define R500_ALU_RGBA_OP_MIN (4 << 0) +# define R500_ALU_RGBA_OP_MAX (5 << 0) +/* #define R500_ALU_RGBA_OP_RESERVED (6 << 0) */ +# define R500_ALU_RGBA_OP_CND (7 << 0) +# define R500_ALU_RGBA_OP_CMP (8 << 0) +# define R500_ALU_RGBA_OP_FRC (9 << 0) +# define R500_ALU_RGBA_OP_SOP (10 << 0) +# define R500_ALU_RGBA_OP_MDH (11 << 0) +# define R500_ALU_RGBA_OP_MDV (12 << 0) +# define R500_ALU_RGBA_ADDRD(x) ((x) << 4) +# define R500_ALU_RGBA_ADDRD_REL (1 << 11) +# define R500_ALU_RGBA_SEL_C_SRC0 (0 << 12) +# define R500_ALU_RGBA_SEL_C_SRC1 (1 << 12) +# define R500_ALU_RGBA_SEL_C_SRC2 (2 << 12) +# define R500_ALU_RGBA_SEL_C_SRCP (3 << 12) +# define R500_ALU_RGBA_R_SWIZ_R (0 << 14) +# define R500_ALU_RGBA_R_SWIZ_G (1 << 14) +# define R500_ALU_RGBA_R_SWIZ_B (2 << 14) +# define R500_ALU_RGBA_R_SWIZ_A (3 << 14) +# define R500_ALU_RGBA_R_SWIZ_0 (4 << 14) +# define R500_ALU_RGBA_R_SWIZ_HALF (5 << 14) +# define R500_ALU_RGBA_R_SWIZ_1 (6 << 14) +/* #define R500_ALU_RGBA_R_SWIZ_UNUSED (7 << 14) */ +# define R500_ALU_RGBA_G_SWIZ_R (0 << 17) +# define R500_ALU_RGBA_G_SWIZ_G (1 << 17) +# define R500_ALU_RGBA_G_SWIZ_B (2 << 17) +# define R500_ALU_RGBA_G_SWIZ_A (3 << 17) +# define R500_ALU_RGBA_G_SWIZ_0 (4 << 17) +# define R500_ALU_RGBA_G_SWIZ_HALF (5 << 17) +# define R500_ALU_RGBA_G_SWIZ_1 (6 << 17) +/* #define R500_ALU_RGBA_G_SWIZ_UNUSED (7 << 17) */ +# define R500_ALU_RGBA_B_SWIZ_R (0 << 20) +# define R500_ALU_RGBA_B_SWIZ_G (1 << 20) +# define R500_ALU_RGBA_B_SWIZ_B (2 << 20) +# define R500_ALU_RGBA_B_SWIZ_A (3 << 20) +# define R500_ALU_RGBA_B_SWIZ_0 (4 << 20) +# define R500_ALU_RGBA_B_SWIZ_HALF (5 << 20) +# define R500_ALU_RGBA_B_SWIZ_1 (6 << 20) +/* #define R500_ALU_RGBA_B_SWIZ_UNUSED (7 << 20) */ +# define R500_ALU_RGBA_MOD_C_NOP (0 << 23) +# define R500_ALU_RGBA_MOD_C_NEG (1 << 23) +# define R500_ALU_RGBA_MOD_C_ABS (2 << 23) +# define R500_ALU_RGBA_MOD_C_NAB (3 << 23) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC0 (0 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC1 (1 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC2 (2 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRCP (3 << 25) +# define R500_ALU_RGBA_A_SWIZ_R (0 << 27) +# define R500_ALU_RGBA_A_SWIZ_G (1 << 27) +# define R500_ALU_RGBA_A_SWIZ_B (2 << 27) +# define R500_ALU_RGBA_A_SWIZ_A (3 << 27) +# define R500_ALU_RGBA_A_SWIZ_0 (4 << 27) +# define R500_ALU_RGBA_A_SWIZ_HALF (5 << 27) +# define R500_ALU_RGBA_A_SWIZ_1 (6 << 27) +/* #define R500_ALU_RGBA_A_SWIZ_UNUSED (7 << 27) */ +# define R500_ALU_RGBA_ALPHA_MOD_C_NOP (0 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_NEG (1 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_ABS (2 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_NAB (3 << 30) +#define R500_US_ALU_RGB_INST_0 0xa000 +# define R500_ALU_RGB_SEL_A_SRC0 (0 << 0) +# define R500_ALU_RGB_SEL_A_SRC1 (1 << 0) +# define R500_ALU_RGB_SEL_A_SRC2 (2 << 0) +# define R500_ALU_RGB_SEL_A_SRCP (3 << 0) +# define R500_ALU_RGB_R_SWIZ_A_R (0 << 2) +# define R500_ALU_RGB_R_SWIZ_A_G (1 << 2) +# define R500_ALU_RGB_R_SWIZ_A_B (2 << 2) +# define R500_ALU_RGB_R_SWIZ_A_A (3 << 2) +# define R500_ALU_RGB_R_SWIZ_A_0 (4 << 2) +# define R500_ALU_RGB_R_SWIZ_A_HALF (5 << 2) +# define R500_ALU_RGB_R_SWIZ_A_1 (6 << 2) +/* #define R500_ALU_RGB_R_SWIZ_A_UNUSED (7 << 2) */ +# define R500_ALU_RGB_G_SWIZ_A_R (0 << 5) +# define R500_ALU_RGB_G_SWIZ_A_G (1 << 5) +# define R500_ALU_RGB_G_SWIZ_A_B (2 << 5) +# define R500_ALU_RGB_G_SWIZ_A_A (3 << 5) +# define R500_ALU_RGB_G_SWIZ_A_0 (4 << 5) +# define R500_ALU_RGB_G_SWIZ_A_HALF (5 << 5) +# define R500_ALU_RGB_G_SWIZ_A_1 (6 << 5) +/* #define R500_ALU_RGB_G_SWIZ_A_UNUSED (7 << 5) */ +# define R500_ALU_RGB_B_SWIZ_A_R (0 << 8) +# define R500_ALU_RGB_B_SWIZ_A_G (1 << 8) +# define R500_ALU_RGB_B_SWIZ_A_B (2 << 8) +# define R500_ALU_RGB_B_SWIZ_A_A (3 << 8) +# define R500_ALU_RGB_B_SWIZ_A_0 (4 << 8) +# define R500_ALU_RGB_B_SWIZ_A_HALF (5 << 8) +# define R500_ALU_RGB_B_SWIZ_A_1 (6 << 8) +/* #define R500_ALU_RGB_B_SWIZ_A_UNUSED (7 << 8) */ +# define R500_ALU_RGB_MOD_A_NOP (0 << 11) +# define R500_ALU_RGB_MOD_A_NEG (1 << 11) +# define R500_ALU_RGB_MOD_A_ABS (2 << 11) +# define R500_ALU_RGB_MOD_A_NAB (3 << 11) +# define R500_ALU_RGB_SEL_B_SRC0 (0 << 13) +# define R500_ALU_RGB_SEL_B_SRC1 (1 << 13) +# define R500_ALU_RGB_SEL_B_SRC2 (2 << 13) +# define R500_ALU_RGB_SEL_B_SRCP (3 << 13) +# define R500_ALU_RGB_R_SWIZ_B_R (0 << 15) +# define R500_ALU_RGB_R_SWIZ_B_G (1 << 15) +# define R500_ALU_RGB_R_SWIZ_B_B (2 << 15) +# define R500_ALU_RGB_R_SWIZ_B_A (3 << 15) +# define R500_ALU_RGB_R_SWIZ_B_0 (4 << 15) +# define R500_ALU_RGB_R_SWIZ_B_HALF (5 << 15) +# define R500_ALU_RGB_R_SWIZ_B_1 (6 << 15) +/* #define R500_ALU_RGB_R_SWIZ_B_UNUSED (7 << 15) */ +# define R500_ALU_RGB_G_SWIZ_B_R (0 << 18) +# define R500_ALU_RGB_G_SWIZ_B_G (1 << 18) +# define R500_ALU_RGB_G_SWIZ_B_B (2 << 18) +# define R500_ALU_RGB_G_SWIZ_B_A (3 << 18) +# define R500_ALU_RGB_G_SWIZ_B_0 (4 << 18) +# define R500_ALU_RGB_G_SWIZ_B_HALF (5 << 18) +# define R500_ALU_RGB_G_SWIZ_B_1 (6 << 18) +/* #define R500_ALU_RGB_G_SWIZ_B_UNUSED (7 << 18) */ +# define R500_ALU_RGB_B_SWIZ_B_R (0 << 21) +# define R500_ALU_RGB_B_SWIZ_B_G (1 << 21) +# define R500_ALU_RGB_B_SWIZ_B_B (2 << 21) +# define R500_ALU_RGB_B_SWIZ_B_A (3 << 21) +# define R500_ALU_RGB_B_SWIZ_B_0 (4 << 21) +# define R500_ALU_RGB_B_SWIZ_B_HALF (5 << 21) +# define R500_ALU_RGB_B_SWIZ_B_1 (6 << 21) +/* #define R500_ALU_RGB_B_SWIZ_B_UNUSED (7 << 21) */ +# define R500_ALU_RGB_MOD_B_NOP (0 << 24) +# define R500_ALU_RGB_MOD_B_NEG (1 << 24) +# define R500_ALU_RGB_MOD_B_ABS (2 << 24) +# define R500_ALU_RGB_MOD_B_NAB (3 << 24) +# define R500_ALU_RGB_OMOD_IDENTITY (0 << 26) +# define R500_ALU_RGB_OMOD_MUL_2 (1 << 26) +# define R500_ALU_RGB_OMOD_MUL_4 (2 << 26) +# define R500_ALU_RGB_OMOD_MUL_8 (3 << 26) +# define R500_ALU_RGB_OMOD_DIV_2 (4 << 26) +# define R500_ALU_RGB_OMOD_DIV_4 (5 << 26) +# define R500_ALU_RGB_OMOD_DIV_8 (6 << 26) +# define R500_ALU_RGB_OMOD_DISABLE (7 << 26) +# define R500_ALU_RGB_TARGET(x) ((x) << 29) +# define R500_ALU_RGB_WMASK (1 << 31) +#define R500_US_ALU_RGB_ADDR_0 0x9000 +# define R500_RGB_ADDR0(x) ((x) << 0) +# define R500_RGB_ADDR0_CONST (1 << 8) +# define R500_RGB_ADDR0_REL (1 << 9) +# define R500_RGB_ADDR1(x) ((x) << 10) +# define R500_RGB_ADDR1_CONST (1 << 18) +# define R500_RGB_ADDR1_REL (1 << 19) +# define R500_RGB_ADDR2(x) ((x) << 20) +# define R500_RGB_ADDR2_CONST (1 << 28) +# define R500_RGB_ADDR2_REL (1 << 29) +# define R500_RGB_SRCP_OP_1_MINUS_2RGB0 (0 << 30) +# define R500_RGB_SRCP_OP_RGB1_MINUS_RGB0 (1 << 30) +# define R500_RGB_SRCP_OP_RGB1_PLUS_RGB0 (2 << 30) +# define R500_RGB_SRCP_OP_1_MINUS_RGB0 (3 << 30) +#define R500_US_CMN_INST_0 0xb800 +# define R500_INST_TYPE_ALU (0 << 0) +# define R500_INST_TYPE_OUT (1 << 0) +# define R500_INST_TYPE_FC (2 << 0) +# define R500_INST_TYPE_TEX (3 << 0) +# define R500_INST_TEX_SEM_WAIT (1 << 2) +# define R500_INST_RGB_PRED_SEL_NONE (0 << 3) +# define R500_INST_RGB_PRED_SEL_RGBA (1 << 3) +# define R500_INST_RGB_PRED_SEL_RRRR (2 << 3) +# define R500_INST_RGB_PRED_SEL_GGGG (3 << 3) +# define R500_INST_RGB_PRED_SEL_BBBB (4 << 3) +# define R500_INST_RGB_PRED_SEL_AAAA (5 << 3) +# define R500_INST_RGB_PRED_INV (1 << 6) +# define R500_INST_WRITE_INACTIVE (1 << 7) +# define R500_INST_LAST (1 << 8) +# define R500_INST_NOP (1 << 9) +# define R500_INST_ALU_WAIT (1 << 10) +# define R500_INST_RGB_WMASK_R (1 << 11) +# define R500_INST_RGB_WMASK_G (1 << 12) +# define R500_INST_RGB_WMASK_B (1 << 13) +# define R500_INST_ALPHA_WMASK (1 << 14) +# define R500_INST_RGB_OMASK_R (1 << 15) +# define R500_INST_RGB_OMASK_G (1 << 16) +# define R500_INST_RGB_OMASK_B (1 << 17) +# define R500_INST_ALPHA_OMASK (1 << 18) +# define R500_INST_RGB_CLAMP (1 << 19) +# define R500_INST_ALPHA_CLAMP (1 << 20) +# define R500_INST_ALU_RESULT_SEL (1 << 21) +# define R500_INST_ALPHA_PRED_INV (1 << 22) +# define R500_INST_ALU_RESULT_OP_EQ (0 << 23) +# define R500_INST_ALU_RESULT_OP_LT (1 << 23) +# define R500_INST_ALU_RESULT_OP_GE (2 << 23) +# define R500_INST_ALU_RESULT_OP_NE (3 << 23) +# define R500_INST_ALPHA_PRED_SEL_NONE (0 << 25) +# define R500_INST_ALPHA_PRED_SEL_RGBA (1 << 25) +# define R500_INST_ALPHA_PRED_SEL_RRRR (2 << 25) +# define R500_INST_ALPHA_PRED_SEL_GGGG (3 << 25) +# define R500_INST_ALPHA_PRED_SEL_BBBB (4 << 25) +# define R500_INST_ALPHA_PRED_SEL_AAAA (5 << 25) +/* XXX next four are kind of guessed */ +# define R500_INST_STAT_WE_R (1 << 28) +# define R500_INST_STAT_WE_G (1 << 29) +# define R500_INST_STAT_WE_B (1 << 30) +# define R500_INST_STAT_WE_A (1 << 31) +/* note that these are 8 bit lengths, despite the offsets, at least for R500 */ +#define R500_US_CODE_ADDR 0x4630 +# define R500_US_CODE_START_ADDR(x) ((x) << 0) +# define R500_US_CODE_END_ADDR(x) ((x) << 16) +#define R500_US_CODE_OFFSET 0x4638 +# define R500_US_CODE_OFFSET_ADDR(x) ((x) << 0) +#define R500_US_CODE_RANGE 0x4634 +# define R500_US_CODE_RANGE_ADDR(x) ((x) << 0) +# define R500_US_CODE_RANGE_SIZE(x) ((x) << 16) +#define R500_US_CONFIG 0x4600 +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) +#define R500_US_FC_ADDR_0 0xa000 +# define R500_FC_BOOL_ADDR(x) ((x) << 0) +# define R500_FC_INT_ADDR(x) ((x) << 8) +# define R500_FC_JUMP_ADDR(x) ((x) << 16) +# define R500_FC_JUMP_GLOBAL (1 << 31) +#define R500_US_FC_BOOL_CONST 0x4620 +# define R500_FC_KBOOL(x) (x) +#define R500_US_FC_CTRL 0x4624 +# define R500_FC_TEST_EN (1 << 30) +# define R500_FC_FULL_FC_EN (1 << 31) +#define R500_US_FC_INST_0 0x9800 +# define R500_FC_OP_JUMP (0 << 0) +# define R500_FC_OP_LOOP (1 << 0) +# define R500_FC_OP_ENDLOOP (2 << 0) +# define R500_FC_OP_REP (3 << 0) +# define R500_FC_OP_ENDREP (4 << 0) +# define R500_FC_OP_BREAKLOOP (5 << 0) +# define R500_FC_OP_BREAKREP (6 << 0) +# define R500_FC_OP_CONTINUE (7 << 0) +# define R500_FC_B_ELSE (1 << 4) +# define R500_FC_JUMP_ANY (1 << 5) +# define R500_FC_A_OP_NONE (0 << 6) +# define R500_FC_A_OP_POP (1 << 6) +# define R500_FC_A_OP_PUSH (2 << 6) +# define R500_FC_JUMP_FUNC(x) ((x) << 8) +# define R500_FC_B_POP_CNT(x) ((x) << 16) +# define R500_FC_B_OP0_NONE (0 << 24) +# define R500_FC_B_OP0_DECR (1 << 24) +# define R500_FC_B_OP0_INCR (2 << 24) +# define R500_FC_B_OP1_DECR (0 << 26) +# define R500_FC_B_OP1_NONE (1 << 26) +# define R500_FC_B_OP1_INCR (2 << 26) +# define R500_FC_IGNORE_UNCOVERED (1 << 28) +#define R500_US_FC_INT_CONST_0 0x4c00 +# define R500_FC_INT_CONST_KR(x) ((x) << 0) +# define R500_FC_INT_CONST_KG(x) ((x) << 8) +# define R500_FC_INT_CONST_KB(x) ((x) << 16) +/* _0 through _15 */ +#define R500_US_FORMAT0_0 0x4640 +# define R500_FORMAT_TXWIDTH(x) ((x) << 0) +# define R500_FORMAT_TXHEIGHT(x) ((x) << 11) +# define R500_FORMAT_TXDEPTH(x) ((x) << 22) +/* _0 through _3 */ +#define R500_US_OUT_FMT_0 0x46a4 +# define R500_OUT_FMT_C4_8 (0 << 0) +# define R500_OUT_FMT_C4_10 (1 << 0) +# define R500_OUT_FMT_C4_10_GAMMA (2 << 0) +# define R500_OUT_FMT_C_16 (3 << 0) +# define R500_OUT_FMT_C2_16 (4 << 0) +# define R500_OUT_FMT_C4_16 (5 << 0) +# define R500_OUT_FMT_C_16_MPEG (6 << 0) +# define R500_OUT_FMT_C2_16_MPEG (7 << 0) +# define R500_OUT_FMT_C2_4 (8 << 0) +# define R500_OUT_FMT_C_3_3_2 (9 << 0) +# define R500_OUT_FMT_C_6_5_6 (10 << 0) +# define R500_OUT_FMT_C_11_11_10 (11 << 0) +# define R500_OUT_FMT_C_10_11_11 (12 << 0) +# define R500_OUT_FMT_C_2_10_10_10 (13 << 0) +/* #define R500_OUT_FMT_RESERVED (14 << 0) */ +# define R500_OUT_FMT_UNUSED (15 << 0) +# define R500_OUT_FMT_C_16_FP (16 << 0) +# define R500_OUT_FMT_C2_16_FP (17 << 0) +# define R500_OUT_FMT_C4_16_FP (18 << 0) +# define R500_OUT_FMT_C_32_FP (19 << 0) +# define R500_OUT_FMT_C2_32_FP (20 << 0) +# define R500_OUT_FMT_C4_32_FP (21 << 0) +# define R500_C0_SEL_A (0 << 8) +# define R500_C0_SEL_R (1 << 8) +# define R500_C0_SEL_G (2 << 8) +# define R500_C0_SEL_B (3 << 8) +# define R500_C1_SEL_A (0 << 10) +# define R500_C1_SEL_R (1 << 10) +# define R500_C1_SEL_G (2 << 10) +# define R500_C1_SEL_B (3 << 10) +# define R500_C2_SEL_A (0 << 12) +# define R500_C2_SEL_R (1 << 12) +# define R500_C2_SEL_G (2 << 12) +# define R500_C2_SEL_B (3 << 12) +# define R500_C3_SEL_A (0 << 14) +# define R500_C3_SEL_R (1 << 14) +# define R500_C3_SEL_G (2 << 14) +# define R500_C3_SEL_B (3 << 14) +# define R500_OUT_SIGN(x) ((x) << 16) +# define R500_ROUND_ADJ (1 << 20) +#define R500_US_PIXSIZE 0x4604 +# define R500_PIX_SIZE(x) (x) +#define R500_US_TEX_ADDR_0 0x9800 +# define R500_TEX_SRC_ADDR(x) ((x) << 0) +# define R500_TEX_SRC_ADDR_REL (1 << 7) +# define R500_TEX_SRC_S_SWIZ_R (0 << 8) +# define R500_TEX_SRC_S_SWIZ_G (1 << 8) +# define R500_TEX_SRC_S_SWIZ_B (2 << 8) +# define R500_TEX_SRC_S_SWIZ_A (3 << 8) +# define R500_TEX_SRC_T_SWIZ_R (0 << 10) +# define R500_TEX_SRC_T_SWIZ_G (1 << 10) +# define R500_TEX_SRC_T_SWIZ_B (2 << 10) +# define R500_TEX_SRC_T_SWIZ_A (3 << 10) +# define R500_TEX_SRC_R_SWIZ_R (0 << 12) +# define R500_TEX_SRC_R_SWIZ_G (1 << 12) +# define R500_TEX_SRC_R_SWIZ_B (2 << 12) +# define R500_TEX_SRC_R_SWIZ_A (3 << 12) +# define R500_TEX_SRC_Q_SWIZ_R (0 << 14) +# define R500_TEX_SRC_Q_SWIZ_G (1 << 14) +# define R500_TEX_SRC_Q_SWIZ_B (2 << 14) +# define R500_TEX_SRC_Q_SWIZ_A (3 << 14) +# define R500_TEX_DST_ADDR(x) ((x) << 16) +# define R500_TEX_DST_ADDR_REL (1 << 23) +# define R500_TEX_DST_R_SWIZ_R (0 << 24) +# define R500_TEX_DST_R_SWIZ_G (1 << 24) +# define R500_TEX_DST_R_SWIZ_B (2 << 24) +# define R500_TEX_DST_R_SWIZ_A (3 << 24) +# define R500_TEX_DST_G_SWIZ_R (0 << 26) +# define R500_TEX_DST_G_SWIZ_G (1 << 26) +# define R500_TEX_DST_G_SWIZ_B (2 << 26) +# define R500_TEX_DST_G_SWIZ_A (3 << 26) +# define R500_TEX_DST_B_SWIZ_R (0 << 28) +# define R500_TEX_DST_B_SWIZ_G (1 << 28) +# define R500_TEX_DST_B_SWIZ_B (2 << 28) +# define R500_TEX_DST_B_SWIZ_A (3 << 28) +# define R500_TEX_DST_A_SWIZ_R (0 << 30) +# define R500_TEX_DST_A_SWIZ_G (1 << 30) +# define R500_TEX_DST_A_SWIZ_B (2 << 30) +# define R500_TEX_DST_A_SWIZ_A (3 << 30) +#define R500_US_TEX_ADDR_DXDY_0 0xa000 +# define R500_DX_ADDR(x) ((x) << 0) +# define R500_DX_ADDR_REL (1 << 7) +# define R500_DX_S_SWIZ_R (0 << 8) +# define R500_DX_S_SWIZ_G (1 << 8) +# define R500_DX_S_SWIZ_B (2 << 8) +# define R500_DX_S_SWIZ_A (3 << 8) +# define R500_DX_T_SWIZ_R (0 << 10) +# define R500_DX_T_SWIZ_G (1 << 10) +# define R500_DX_T_SWIZ_B (2 << 10) +# define R500_DX_T_SWIZ_A (3 << 10) +# define R500_DX_R_SWIZ_R (0 << 12) +# define R500_DX_R_SWIZ_G (1 << 12) +# define R500_DX_R_SWIZ_B (2 << 12) +# define R500_DX_R_SWIZ_A (3 << 12) +# define R500_DX_Q_SWIZ_R (0 << 14) +# define R500_DX_Q_SWIZ_G (1 << 14) +# define R500_DX_Q_SWIZ_B (2 << 14) +# define R500_DX_Q_SWIZ_A (3 << 14) +# define R500_DY_ADDR(x) ((x) << 16) +# define R500_DY_ADDR_REL (1 << 17) +# define R500_DY_S_SWIZ_R (0 << 24) +# define R500_DY_S_SWIZ_G (1 << 24) +# define R500_DY_S_SWIZ_B (2 << 24) +# define R500_DY_S_SWIZ_A (3 << 24) +# define R500_DY_T_SWIZ_R (0 << 26) +# define R500_DY_T_SWIZ_G (1 << 26) +# define R500_DY_T_SWIZ_B (2 << 26) +# define R500_DY_T_SWIZ_A (3 << 26) +# define R500_DY_R_SWIZ_R (0 << 28) +# define R500_DY_R_SWIZ_G (1 << 28) +# define R500_DY_R_SWIZ_B (2 << 28) +# define R500_DY_R_SWIZ_A (3 << 28) +# define R500_DY_Q_SWIZ_R (0 << 30) +# define R500_DY_Q_SWIZ_G (1 << 30) +# define R500_DY_Q_SWIZ_B (2 << 30) +# define R500_DY_Q_SWIZ_A (3 << 30) +#define R500_US_TEX_INST_0 0x9000 +# define R500_TEX_ID(x) ((x) << 16) +# define R500_TEX_INST_NOP (0 << 22) +# define R500_TEX_INST_LD (1 << 22) +# define R500_TEX_INST_TEXKILL (2 << 22) +# define R500_TEX_INST_PROJ (3 << 22) +# define R500_TEX_INST_LODBIAS (4 << 22) +# define R500_TEX_INST_LOD (5 << 22) +# define R500_TEX_INST_DXDY (6 << 22) +# define R500_TEX_SEM_ACQUIRE (1 << 25) +# define R500_TEX_IGNORE_UNCOVERED (1 << 26) +# define R500_TEX_UNSCALED (1 << 27) +#define R500_US_W_FMT 0x46b4 +# define R500_W_FMT_W0 (0 << 0) +# define R500_W_FMT_W24 (1 << 0) +# define R500_W_FMT_W24FP (2 << 0) +# define R500_W_SRC_US (0 << 2) +# define R500_W_SRC_RAS (1 << 2) + +#define R500_RS_INST_0 0x4320 +#define R500_RS_INST_1 0x4324 +# define R500_RS_INST_TEX_ID_SHIFT 0 +# define R500_RS_INST_TEX_CN_WRITE (1 << 4) +# define R500_RS_INST_TEX_ADDR_SHIFT 5 +# define R500_RS_INST_COL_ID_SHIFT 12 +# define R500_RS_INST_COL_CN_NO_WRITE (0 << 16) +# define R500_RS_INST_COL_CN_WRITE (1 << 16) +# define R500_RS_INST_COL_CN_WRITE_FBUFFER (2 << 16) +# define R500_RS_INST_COL_CN_WRITE_BACKFACE (3 << 16) +# define R500_RS_INST_COL_COL_ADDR_SHIFT 18 +# define R500_RS_INST_TEX_ADJ (1 << 25) +# define R500_RS_INST_W_CN (1 << 26) + +#define R500_US_FC_CTRL 0x4624 +#define R500_US_CODE_ADDR 0x4630 +#define R500_US_CODE_RANGE 0x4634 +#define R500_US_CODE_OFFSET 0x4638 + +#define R500_RS_IP_0 0x4074 +#define R500_RS_IP_1 0x4078 +# define R500_RS_IP_PTR_K0 62 +# define R500_RS_IP_PTR_K1 63 +# define R500_RS_IP_TEX_PTR_S_SHIFT 0 +# define R500_RS_IP_TEX_PTR_T_SHIFT 6 +# define R500_RS_IP_TEX_PTR_R_SHIFT 12 +# define R500_RS_IP_TEX_PTR_Q_SHIFT 18 +# define R500_RS_IP_COL_PTR_SHIFT 24 +# define R500_RS_IP_COL_FMT_SHIFT 27 +# define R500_RS_IP_COL_FMT_RGBA (0 << 27) +# define R500_RS_IP_OFFSET_EN (1 << 31) + +#define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ + +/* r6xx/r7xx stuff */ +#define R600_GRBM_STATUS 0x8010 +# define R600_CMDFIFO_AVAIL_MASK 0x1f +# define R700_CMDFIFO_AVAIL_MASK 0xf +# define R600_GUI_ACTIVE (1 << 31) + +#define R600_GRBM_SOFT_RESET 0x8020 +# define R600_SOFT_RESET_CP (1 << 0) + +#define R600_WAIT_UNTIL 0x8040 + +#define R600_CP_ME_CNTL 0x86d8 +# define R600_CP_ME_HALT (1 << 28) + +#define R600_CP_RB_BASE 0xc100 +#define R600_CP_RB_CNTL 0xc104 +# define R600_RB_NO_UPDATE (1 << 27) +# define R600_RB_RPTR_WR_ENA (1 << 31) +#define R600_CP_RB_RPTR_WR 0xc108 +#define R600_CP_RB_RPTR_ADDR 0xc10c +#define R600_CP_RB_RPTR_ADDR_HI 0xc110 +#define R600_CP_RB_WPTR 0xc114 +#define R600_CP_RB_WPTR_ADDR 0xc118 +#define R600_CP_RB_WPTR_ADDR_HI 0xc11c + +#define R600_CP_RB_RPTR 0x8700 +#define R600_CP_RB_WPTR_DELAY 0x8704 + +#endif diff --git a/i386/libsaio/.svn/text-base/base64-decode.c.svn-base b/i386/libsaio/.svn/text-base/base64-decode.c.svn-base new file mode 100644 index 0000000..0cf3307 --- /dev/null +++ b/i386/libsaio/.svn/text-base/base64-decode.c.svn-base @@ -0,0 +1,71 @@ +/* + * This code implements the BASE64 algorithm. + * This code is in the public domain; do with it what you wish. + * + * @file base64.c + * @brief This code implements the BASE64 algorithm + * @author Matthieu Speder + */ +#include <libsaio.h> + +//static const char base64_chars[] = +//"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static const char base64_digits[] = +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + +char *BASE64Decode(const char* src, int in_len, int* out_len) +{ + int endpad = 0; + char* dest; + char* result; + + if (in_len % 4) + { + /* Wrong base64 string length */ + return NULL; + + } + result = dest = malloc(in_len / 4 * 3 + 1); + if (result == NULL) + return NULL; /* out of memory */ + while (*src) { + char a = base64_digits[(unsigned char)*(src++)]; + char b = base64_digits[(unsigned char)*(src++)]; + char c = base64_digits[(unsigned char)*(src++)]; + char d = base64_digits[(unsigned char)*(src++)]; + *(dest++) = (a << 2) | ((b & 0x30) >> 4); + if (c == (char)-1) + { + // padding char. + endpad += 2; + break; + } + *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); + if (d == (char)-1) + { + // padding char. + endpad += 1; + break; + } + *(dest++) = ((c & 0x03) << 6) | d; + } + *dest = 0; + *out_len = in_len / 4 * 3 - endpad; // not including NULL terminator + return result; +} + + +/* end of base64.c */ \ No newline at end of file diff --git a/i386/libsaio/.svn/text-base/befs.c.svn-base b/i386/libsaio/.svn/text-base/befs.c.svn-base new file mode 100644 index 0000000..367ef01 --- /dev/null +++ b/i386/libsaio/.svn/text-base/befs.c.svn-base @@ -0,0 +1,43 @@ +/* + * befs.c + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "befs.h" + +#define BeFSProbeSize 2048 + +#define SUPER_BLOCK_MAGIC1 0x42465331 /* BFS1 */ +#define SUPER_BLOCK_MAGIC2 0xdd121031 +#define SUPER_BLOCK_MAGIC3 0x15b6830e + +/* Find BeFS signature */ +bool BeFSProbe (const void *buf) +{ + return (OSReadLittleInt32(buf+0x220,0)==SUPER_BLOCK_MAGIC1); +} + +/* Find BeFS volume label */ +void BeFSGetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc (BeFSProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, BeFSProbeSize); + if (!BeFSProbe (buf)) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x200, MIN (strMaxLen, 32)); + free (buf); +} diff --git a/i386/libsaio/.svn/text-base/befs.h.svn-base b/i386/libsaio/.svn/text-base/befs.h.svn-base new file mode 100644 index 0000000..01cd062 --- /dev/null +++ b/i386/libsaio/.svn/text-base/befs.h.svn-base @@ -0,0 +1,11 @@ +/* + * befs.h + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +extern bool BeFSProbe (const void *buf); +extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen); diff --git a/i386/libsaio/.svn/text-base/bios.h.svn-base b/i386/libsaio/.svn/text-base/bios.h.svn-base new file mode 100644 index 0000000..52c98ce --- /dev/null +++ b/i386/libsaio/.svn/text-base/bios.h.svn-base @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1994 NeXT Computer, Inc. + * All rights reserved. + */ + +#ifndef __LIBSAIO_BIOS_H +#define __LIBSAIO_BIOS_H + +#include "bootargs.h" + +typedef union { + unsigned int rx; + unsigned short rr; + struct { + unsigned char l; + unsigned char h; + } r; +} machineRegister_t; + +typedef struct { + unsigned short cf :1; + unsigned short :1; + unsigned short pf :1; + unsigned short :1; + unsigned short af :1; + unsigned short :1; + unsigned short zf :1; + unsigned short sf :1; + unsigned short tf :1; + unsigned short _if :1; + unsigned short df :1; + unsigned short of :1; + unsigned short iopl:2; + unsigned short nt :1; +} machineFlags_t; + +typedef struct { + unsigned int intno; + machineRegister_t eax; + machineRegister_t ebx; + machineRegister_t ecx; + machineRegister_t edx; + machineRegister_t edi; + machineRegister_t esi; + machineRegister_t ebp; + unsigned short cs; + unsigned short ds; + unsigned short es; + machineFlags_t flags; +} biosBuf_t; + +#define EBIOS_FIXED_DISK_ACCESS 0x01 +#define EBIOS_LOCKING_ACCESS 0x02 +#define EBIOS_ENHANCED_DRIVE_INFO 0x04 + +#define BASE_HD_DRIVE 0x80 + +#if 0 +/* + * ACPI defined memory range types. + */ +enum { + kMemoryRangeUsable = 1, // RAM usable by the OS. + kMemoryRangeReserved = 2, // Reserved. (Do not use) + kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed. + kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use) + + /* Undefined types should be treated as kMemoryRangeReserved */ +}; +#endif + +/* + * Memory range descriptor. + */ +typedef struct MemoryRange { + unsigned long long base; // 64-bit base address + unsigned long long length; // 64-bit length in bytes + unsigned long type; // type of memory range + unsigned long reserved; +} MemoryRange; + +#endif /* !__LIBSAIO_BIOS_H */ diff --git a/i386/libsaio/.svn/text-base/bios.s.svn-base b/i386/libsaio/.svn/text-base/bios.s.svn-base new file mode 100644 index 0000000..b36be6c --- /dev/null +++ b/i386/libsaio/.svn/text-base/bios.s.svn-base @@ -0,0 +1,184 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + * + * Harness for calling real-mode BIOS functions. + */ + +/* Copyright 2007 David Elliott + 2007-12-30 dfe + - Enhanced code to use specified DS register when doing BIOS interrupt + - Fixed movl %ax,new_es bug which assembler was interpreting as + movl %eax,new_es which was overwriting the next word. + */ +#include <architecture/i386/asm_help.h> +#include "memory.h" + +#define data32 .byte 0x66 +#define addr32 .byte 0x67 + +#define O_INT 0 +#define O_EAX 4 +#define O_EBX 8 +#define O_ECX 12 +#define O_EDX 16 +#define O_EDI 20 +#define O_ESI 24 +#define O_EBP 28 +#define O_CS 32 +#define O_DS 34 +#define O_ES 36 +#define O_FLG 38 + + .section __INIT,__data // turbo - Data that must be in the first segment + +/* Saved registers: + These used to be (and in theory ought to be) located in __DATA,__bss. + The problem is that the larger the binary grows, more of the BSS gets + pushed into the next real-mode segment. Doing it this way we waste 24 + bytes in the binary that our loader (e.g. boot1) must now load. But the + advantage is that we relocate this data to ensure it stays in the first + real-mode segment. Therefore, depending on link order, quite a lot of + new data, and possibly a lot of new executable code can be added to the + binary since with this change the BSS and most of the DATA is now only + accessed from protected mode where real-mode segment limits don't apply. + + With this change, plus the earlier change to respect DS (e.g. use huge + pointers), the binary can grow much larger, currently up to exactly 63.5k + which is the maximum that the first-stage bootsectors can handle. To get + more than that more changes are needed. In that case we would have to + play with Mach-O segments to ensure real-mode code and data got stuffed + well within the first 63.5k. Furthermore, we'd have to adjust the boot + sectors to allow them to span segments. + + Since this change alone only gains us about 4k more than where we're at + now (which is not anything to scoff at) it won't be very long before we + need to start using Mach-O segments to force the linker to locate certain + bits of code and data within the first 63.5k and modify the loaders to + be able to load more than 63.5k. + */ + .align 2 +save_eax: .space 4 + .align 2 +save_edx: .space 4 + .align 1 +save_es: .space 2 + .align 1 +save_flag: .space 2 + .align 2 +new_eax: .space 4 + .align 2 +new_edx: .space 4 + .align 1 +new_es: .space 2 + .align 1 +new_ds: .space 2 + + .section __INIT,__text // turbo - This code must reside within the first segment + + +/*============================================================================ + * Call real-mode BIOS INT functions. + * + */ +LABEL(_bios) + enter $0, $0 + pushal + + movl 8(%ebp), %edx // address of save area + movb O_INT(%edx), %al // save int number + movb %al, do_int+1 + + movl O_EBX(%edx), %ebx + movl O_ECX(%edx), %ecx + movl O_EDI(%edx), %edi + movl O_ESI(%edx), %esi + movl O_EBP(%edx), %ebp + movl %edx, save_edx + movl O_EAX(%edx), %eax + movl %eax, new_eax + movl O_EDX(%edx), %eax + movl %eax, new_edx + movw O_ES(%edx), %ax + movw %ax, new_es + movw O_DS(%edx), %ax + movw %ax, new_ds + + call __prot_to_real + + data32 + addr32 + mov OFFSET16(new_eax), %eax + data32 + addr32 + mov OFFSET16(new_edx), %edx + data32 + addr32 + mov OFFSET16(new_es), %es + + push %ds // Save DS + // Replace DS. WARNING: Don't access data until it's restored! + addr32 + data32 + mov OFFSET16(new_ds), %ds + +do_int: + int $0x00 + pop %ds // Restore DS before we do anything else + + pushf + data32 + addr32 + movl %eax, OFFSET16(save_eax) + popl %eax // actually pop %ax + addr32 + movl %eax, OFFSET16(save_flag) // actually movw + mov %es, %ax + addr32 + movl %eax, OFFSET16(save_es) // actually movw + data32 + call __real_to_prot + + movl %edx, new_edx // save new edx before clobbering + movl save_edx, %edx + movl new_edx, %eax // now move it into buffer + movl %eax, O_EDX(%edx) + movl save_eax, %eax + movl %eax, O_EAX(%edx) + movw save_es, %ax + movw %ax, O_ES(%edx) + movw save_flag, %ax + movw %ax, O_FLG(%edx) + movl %ebx, O_EBX(%edx) + movl %ecx, O_ECX(%edx) + movl %edi, O_EDI(%edx) + movl %esi, O_ESI(%edx) + movl %ebp, O_EBP(%edx) + + popal + leave + + ret diff --git a/i386/libsaio/.svn/text-base/biosfn.c.svn-base b/i386/libsaio/.svn/text-base/biosfn.c.svn-base new file mode 100644 index 0000000..dc1ec45 --- /dev/null +++ b/i386/libsaio/.svn/text-base/biosfn.c.svn-base @@ -0,0 +1,959 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + */ + +/* Copyright 2007 David Elliott + 2007-12-30 dfe + - Enhanced code to normalize segment/offset to huge pointers so that any + linear address within the first MB of memory can be passed to BIOS + functions. This allows some of the __DATA sections to span into the + next segment and also allows stack variables to be used whereas the + old code could only operate on static data in the first 64k. + NOTE: Requires bios.s change to respect DS. + */ +/* Copyright 2007 VMware Inc. + 2007-12-29 dfe + - Added ebiosEjectMedia + */ + +#include "bootstruct.h" +#include "libsaio.h" + + +#define MAX_DRIVES 8 + +static biosBuf_t bb; + +int bgetc(void) +{ + /* Poll for the next character. Most real BIOS do not need this as the + INT 16h,AH=0h function will block until one is received. + Unfortunately, Apple's EFI CSM will never wake up. This idea is lifted + from the grub-a20.patch to GRUB's stage2/asm.S file. + */ + while(!readKeyboardStatus()) + ; + bb.intno = 0x16; + bb.eax.r.h = 0x00; + bios(&bb); + return bb.eax.rr; +} + +int readKeyboardStatus(void) +{ + bb.intno = 0x16; + bb.eax.r.h = 0x01; + bios(&bb); + if (bb.flags.zf) { + return 0; + } else { + return bb.eax.rr; + } +} + +int readKeyboardShiftFlags(void) +{ + bb.intno = 0x16; + bb.eax.r.h = 0x02; + bios(&bb); + return bb.eax.r.l; +} + +unsigned int time18(void) +{ + union { + struct { + unsigned int low:16; + unsigned int high:16; + } s; + unsigned int i; + } time; + + bb.intno = 0x1a; + bb.eax.r.h = 0x00; + bios(&bb); + time.s.low = bb.edx.rr; + time.s.high = bb.ecx.rr; + return time.i; +} + +#if 0 +static unsigned long rerangeMemoryMap(unsigned long count) +{ + int i, still_changing, newcount = count; + + MemoryRange * range = (MemoryRange *)BIOS_ADDR; + struct MemoryRange change_tmp; + + /* sort map list by memory addresses (low -> high) */ + still_changing = 1; + while (still_changing) { + still_changing = 0; + for (i=1; i<count; i++) { + /* if <current_addr> > <last_addr>, swap */ + if (range[i].base < range[i-1].base) { + change_tmp.base = range[i].base; + change_tmp.length = range[i].length; + change_tmp.type = range[i].type; + + range[i].base = range[i-1].base; + range[i].length = range[i-1].length; + range[i].type = range[i-1].type; + + range[i-1].base = change_tmp.base; + range[i-1].length = change_tmp.length; + range[i-1].type = change_tmp.type; + + still_changing=1; + } + } + } + + /* clear overlaps */ + /* linux's arch/i386/kern/setup.c may have better algorithm */ + for (i=1; i<count; i++) { + if ( range[i-1].base + range[i-1].length > range[i].base ) { + range[newcount].base = range[i].base + range[i].length; + range[newcount].length = range[i-1].base + range[i-1].length - range[newcount].base; + range[newcount].type = range[i-1].type; + newcount++; + + range[i-1].length = range[i].base - range[i-1].base; + } + } + + /* + * 0xb0000000 : 0x10000000 NG + * 0xc0000400 NG + * 0xf2000000 NG + */ + range[newcount].base = 0xb0000000; + range[newcount].length = 0x0f000000; + range[newcount].type = kMemoryRangeUsable; + newcount++; + + return newcount; +} +#endif + +unsigned long getMemoryMap( MemoryRange * rangeArray, + unsigned long maxRangeCount, + unsigned long * conMemSizePtr, + unsigned long * extMemSizePtr ) +{ + #define kMemoryMapSignature 'SMAP' + #define kDescriptorSizeMin 20 + + MemoryRange * range = (MemoryRange *)BIOS_ADDR; + unsigned long count = 0; + // unsigned long rerangedCount; + unsigned long long conMemSize = 0; + unsigned long long extMemSize = 0; + + // Prepare for the INT15 E820h call. Each call returns a single + // memory range. A continuation value is returned that must be + // provided on a subsequent call to fetch the next range. + // + // Certain BIOSes (Award 6.00PG) expect the upper word in EAX + // to be cleared on entry, otherwise only a single range will + // be reported. + // + // Some BIOSes will simply ignore the value of ECX on entry. + // Probably best to keep its value at 20 to avoid surprises. + + //printf("Get memory map 0x%x, %d\n", rangeArray); getchar(); + if (maxRangeCount > (BIOS_LEN / sizeof(MemoryRange))) { + maxRangeCount = (BIOS_LEN / sizeof(MemoryRange)); + } + bb.ebx.rx = 0; // Initial continuation value must be zero. + + while ( count < maxRangeCount ) + { + bb.intno = 0x15; + bb.eax.rx = 0xe820; + bb.ecx.rx = kDescriptorSizeMin; + bb.edx.rx = kMemoryMapSignature; + bb.edi.rr = NORMALIZED_OFFSET( (unsigned long) range ); + bb.es = NORMALIZED_SEGMENT( (unsigned long) range ); + bios(&bb); + + // Check for errors. + + if ( bb.flags.cf + || bb.eax.rx != kMemoryMapSignature + || bb.ecx.rx != kDescriptorSizeMin ) { + //printf("Got an error %x %x %x\n", bb.flags.cf, + // bb.eax.rx, bb.ecx.rx); + break; + } + + // Tally up the conventional/extended memory sizes. + + if ( range->type == kMemoryRangeUsable || + range->type == kMemoryRangeACPI || + range->type == kMemoryRangeNVS ) + { + // Tally the conventional memory ranges. + if ( range->base + range->length <= 0xa0000 ) { + conMemSize += range->length; + } + + // Record the top of extended memory. + if ( range->base >= EXTENDED_ADDR ) { + extMemSize += range->length; + } + } + + range++; + count++; + + // Is this the last address range? + + if ( bb.ebx.rx == 0 ) { + //printf("last range\n"); + break; + } + } + *conMemSizePtr = conMemSize / 1024; // size in KB + *extMemSizePtr = extMemSize / 1024; // size in KB + +#if 0 + rerangedCount = rerangeMemoryMap(count); + range += rerangedCount - count; +#endif + + // Copy out data + bcopy((char *)BIOS_ADDR, rangeArray, ((char *)range - (char *)BIOS_ADDR)); + +#if DEBUG + { + int i; + printf("%d total ranges\n", count); getchar(); + for (i=0, range = rangeArray; i<count; i++, range++) { + printf("range: type %d, base 0x%x, length 0x%x\n", + range->type, (unsigned int)range->base, (unsigned int)range->length); getchar(); + } + } +#endif + + return count; +} + +unsigned long getExtendedMemorySize() +{ + // Get extended memory size for large configurations. Not used unless + // the INT15, E820H call (Get System Address Map) failed. + // + // Input: + // + // AX Function Code E801h + // + // Outputs: + // + // CF Carry Flag Carry cleared indicates no error. + // AX Extended 1 Number of contiguous KB between 1 and 16 MB, + // maximum 0x3C00 = 15 MB. + // BX Extended 2 Number of contiguous 64 KB blocks between + // 16 MB and 4 GB. + // CX Configured 1 Number of contiguous KB between 1 and 16 MB, + // maximum 0x3C00 = 15 MB. + // DX Configured 2 Number of contiguous 64 KB blocks between + // 16 MB and 4 GB. + + bb.intno = 0x15; + bb.eax.rx = 0xe801; + bios(&bb); + + // Return the size of memory above 1MB (extended memory) in kilobytes. + + if ( bb.flags.cf == 0 ) return (bb.ebx.rr * 64 + bb.eax.rr); + + // Get Extended memory size. Called on last resort since the return + // value is limited to 16-bits (a little less than 64MB max). May + // not be supported by modern BIOSes. + // + // Input: + // + // AX Function Code E801h + // + // Outputs: + // + // CF Carry Flag Carry cleared indicates no error. + // AX Memory Count Number of contiguous KB above 1MB. + + bb.intno = 0x15; + bb.eax.rx = 0x88; + bios(&bb); + + // Return the size of memory above 1MB (extended memory) in kilobytes. + + return bb.flags.cf ? 0 : bb.eax.rr; +} + +unsigned long getConventionalMemorySize() +{ + bb.intno = 0x12; + bios(&bb); + return bb.eax.rr; // kilobytes +} + +void video_mode(int mode) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x00; + bb.eax.r.l = mode; + bios(&bb); +} + +int biosread(int dev, int cyl, int head, int sec, int num) +{ + int i; + + bb.intno = 0x13; + sec += 1; /* sector numbers start at 1 */ + + for (i=0;;) { + bb.ecx.r.h = cyl; + bb.ecx.r.l = ((cyl & 0x300) >> 2) | (sec & 0x3F); + bb.edx.r.h = head; + bb.edx.r.l = dev; + bb.eax.r.l = num; + bb.ebx.rr = OFFSET(ptov(BIOS_ADDR)); + bb.es = SEGMENT(ptov(BIOS_ADDR)); + + bb.eax.r.h = 0x02; + bios(&bb); + + /* In case of a successful call, make sure we set AH (return code) to zero. */ + if (bb.flags.cf == 0) + bb.eax.r.h = 0; + + /* Now we can really check for the return code (AH) value. */ + if ((bb.eax.r.h == 0x00) || (i++ >= 5)) + break; + + /* reset disk subsystem and try again */ + bb.eax.r.h = 0x00; + bios(&bb); + } + return bb.eax.r.h; +} + +int ebiosread(int dev, unsigned long long sec, int count) +{ + int i; + static struct { + unsigned char size; + unsigned char reserved; + unsigned char numblocks; + unsigned char reserved2; + unsigned short bufferOffset; + unsigned short bufferSegment; + unsigned long long startblock; + } addrpacket __attribute__((aligned(16))) = {0}; + addrpacket.size = sizeof(addrpacket); + + for (i=0;;) { + bb.intno = 0x13; + bb.eax.r.h = 0x42; + bb.edx.r.l = dev; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&addrpacket); + bb.ds = NORMALIZED_SEGMENT((unsigned)&addrpacket); + addrpacket.reserved = addrpacket.reserved2 = 0; + addrpacket.numblocks = count; + addrpacket.bufferOffset = OFFSET(ptov(BIOS_ADDR)); + addrpacket.bufferSegment = SEGMENT(ptov(BIOS_ADDR)); + addrpacket.startblock = sec; + bios(&bb); + + /* In case of a successful call, make sure we set AH (return code) to zero. */ + if (bb.flags.cf == 0) + bb.eax.r.h = 0; + + /* Now we can really check for the return code (AH) value. */ + if ((bb.eax.r.h == 0x00) || (i++ >= 5)) + break; + + /* reset disk subsystem and try again */ + bb.eax.r.h = 0x00; + bios(&bb); + } + return bb.eax.r.h; +} + +int ebioswrite(int dev, long sec, int count) +{ + int i; + static struct { + unsigned char size; + unsigned char reserved; + unsigned char numblocks; + unsigned char reserved2; + unsigned short bufferOffset; + unsigned short bufferSegment; + unsigned long long startblock; + } addrpacket __attribute__((aligned(16))) = {0}; + addrpacket.size = sizeof(addrpacket); + + for (i=0;;) { + bb.intno = 0x13; + bb.eax.r.l = 0; /* Don't verify */ + bb.eax.r.h = 0x43; + bb.edx.r.l = dev; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&addrpacket); + bb.ds = NORMALIZED_SEGMENT((unsigned)&addrpacket); + addrpacket.reserved = addrpacket.reserved2 = 0; + addrpacket.numblocks = count; + addrpacket.bufferOffset = OFFSET(ptov(BIOS_ADDR)); + addrpacket.bufferSegment = SEGMENT(ptov(BIOS_ADDR)); + addrpacket.startblock = sec; + bios(&bb); + + /* In case of a successful call, make sure we set AH (return code) to zero. */ + if (bb.flags.cf == 0) + bb.eax.r.h = 0; + + /* Now we can really check for the return code (AH) value. */ + if ((bb.eax.r.h == 0x00) || (i++ >= 5)) + break; + + /* reset disk subsystem and try again */ + bb.eax.r.h = 0x00; + bios(&bb); + } + return bb.eax.r.h; +} + +void bios_putchar(int ch) +{ + bb.intno = 0x10; + bb.ebx.r.h = 0x00; /* background black */ + bb.ebx.r.l = 0x0F; /* foreground white */ + bb.eax.r.h = 0x0e; + bb.eax.r.l = ch; + bios(&bb); +} + +void putca(int ch, int attr, int repeat) +{ + bb.intno = 0x10; + bb.ebx.r.h = 0x00; /* page number */ + bb.ebx.r.l = attr; /* attribute */ + bb.eax.r.h = 0x9; + bb.eax.r.l = ch; + bb.ecx.rx = repeat; /* repeat count */ + bios(&bb); +} + +/* Check to see if the passed-in drive is in El Torito no-emulation mode. */ +int is_no_emulation(int drive) +{ + struct packet { + unsigned char packet_size; + unsigned char media_type; + unsigned char drive_num; + unsigned char ctrlr_index; + unsigned long lba; + unsigned short device_spec; + unsigned short buffer_segment; + unsigned short load_segment; + unsigned short sector_count; + unsigned char cyl_count; + unsigned char sec_count; + unsigned char head_count; + unsigned char reseved; + } __attribute__((packed)); + static struct packet pkt; + + bzero(&pkt, sizeof(pkt)); + pkt.packet_size = 0x13; + + bb.intno = 0x13; + bb.eax.r.h = 0x4b; + bb.eax.r.l = 0x01; // subfunc: get info + bb.edx.r.l = drive; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&pkt); + bb.ds = NORMALIZED_SEGMENT((unsigned)&pkt); + + bios(&bb); +#if DEBUG + printf("el_torito info drive %x\n", drive); + + printf("--> cf %x, eax %x\n", bb.flags.cf, bb.eax.rr); + + printf("pkt_size: %x\n", pkt.packet_size); + printf("media_type: %x\n", pkt.media_type); + printf("drive_num: %x\n", pkt.drive_num); + printf("device_spec: %x\n", pkt.device_spec); + pause(); +#endif + + /* Some BIOSes erroneously return cf = 1 */ + /* Just check to see if the drive number is the same. */ + if (pkt.drive_num == drive) { + if ((pkt.media_type & 0x0F) == 0) { + /* We are in no-emulation mode. */ + return 1; + } + } + return 0; +} + +#if DEBUG +/* + * BIOS drive information. + */ +void print_drive_info(boot_drive_info_t *dp) +{ +// printf("buf_size = %x\n", dp->params.buf_size); + printf("info_flags = %x\n", dp->params.info_flags); + printf("phys_cyls = %lx\n", dp->params. phys_cyls); + printf("phys_heads = %lx\n", dp->params. phys_heads); + printf("phys_spt = %lx\n", dp->params. phys_spt); + printf("phys_sectors = %lx%lx\n", ((unsigned long *)(&dp->params.phys_sectors))[1], + ((unsigned long *)(&dp->params.phys_sectors))[0]); + printf("phys_nbps = %x\n", dp->params.phys_nbps); +// printf("dpte_offset = %x\n", dp->params.dpte_offset); +// printf("dpte_segment = %x\n", dp->params.dpte_segment); +// printf("key = %x\n", dp->params.key); +// printf("path_len = %x\n", dp->params. path_len); +// printf("reserved1 = %x\n", dp->params. reserved1); +// printf("reserved2 = %x\n", dp->params.reserved2); +// printf("bus_type[4] = %x\n", dp->params. bus_type[4]); +// printf("interface_type[8] = %x\n", dp->params. interface_type[8]); +// printf("interface_path[8] = %x\n", dp->params. interface_path[8]); +// printf("dev_path[8] = %x\n", dp->params. dev_path[8]); +// printf("reserved3 = %x\n", dp->params. reserved3); +// printf("checksum = %x\n", dp->params. checksum); + printf("io_port_base = %x\n", dp->dpte.io_port_base); + printf("control_port_base = %x\n", dp->dpte.control_port_base); + printf("head_flags = %x\n", dp->dpte. head_flags); + printf("vendor_info = %x\n", dp->dpte. vendor_info); + printf("irq = %x\n", dp->dpte. irq); +// printf("irq_unused = %x\n", dp->dpte. irq_unused); + printf("block_count = %x\n", dp->dpte. block_count); + printf("dma_channe = %x\n", dp->dpte. dma_channel); + printf("dma_type = %x\n", dp->dpte. dma_type); + printf("pio_type = %x\n", dp->dpte. pio_type); + printf("pio_unused = %x\n", dp->dpte. pio_unused); + printf("option_flags = %x\n", dp->dpte.option_flags); +// printf("reserved = %x\n", dp->dpte.reserved); + printf("revision = %x\n", dp->dpte. revision); +// printf("checksum = %x\n", dp->dpte. checksum); +} + +#endif + +int get_drive_info(int drive, struct driveInfo *dp) +{ + boot_drive_info_t *di = &dp->di; + int ret = 0; + +#if UNUSED + if (maxhd == 0) { + bb.intno = 0x13; + bb.eax.r.h = 0x08; + bb.edx.r.l = 0x80; + bios(&bb); + if (bb.flags.cf == 0) + maxhd = 0x7f + bb.edx.r.l; + }; + + if (drive > maxhd) + return 0; +#endif + + bzero(dp, sizeof(struct driveInfo)); + dp->biosdev = drive; + + /* Check for El Torito no-emulation mode. */ + dp->no_emulation = is_no_emulation(drive); + + /* Check drive for EBIOS support. */ + bb.intno = 0x13; + bb.eax.r.h = 0x41; + bb.edx.r.l = drive; + bb.ebx.rr = 0x55aa; + bios(&bb); + + if ((bb.ebx.rr == 0xaa55) && (bb.flags.cf == 0)) { + /* Get flags for supported operations. */ + dp->uses_ebios = bb.ecx.r.l; + } + + if (dp->uses_ebios & (EBIOS_ENHANCED_DRIVE_INFO | EBIOS_LOCKING_ACCESS | EBIOS_FIXED_DISK_ACCESS)) { + /* Get EBIOS drive info. */ + static struct drive_params params; + + params.buf_size = sizeof(params); + bb.intno = 0x13; + bb.eax.r.h = 0x48; + bb.edx.r.l = drive; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)¶ms); + bb.ds = NORMALIZED_SEGMENT((unsigned)¶ms); + bios(&bb); + + if (bb.flags.cf != 0 /* || params.phys_sectors < 2097152 */) { + dp->uses_ebios = 0; + di->params.buf_size = 1; + } + else + { + bcopy(¶ms, &di->params, sizeof(params)); + + if (drive >= BASE_HD_DRIVE && + (dp->uses_ebios & EBIOS_ENHANCED_DRIVE_INFO) && + di->params.buf_size >= 30 && + !(di->params.dpte_offset == 0xFFFF && di->params.dpte_segment == 0xFFFF)) { + void *ptr = (void *)(di->params.dpte_offset + ((unsigned int)di->params.dpte_segment << 4)); + bcopy(ptr, &di->dpte, sizeof(di->dpte)); + } + } + } + +/* + * zef: This code will fail on recent JMicron and Intel option ROMs + */ +// if (di->params.phys_heads == 0 || di->params.phys_spt == 0) { +// /* Either it's not EBIOS, or EBIOS didn't tell us. */ +// bb.intno = 0x13; +// bb.eax.r.h = 0x08; +// bb.edx.r.l = drive; +// bios(&bb); +// if (bb.flags.cf == 0 && bb.eax.r.h == 0) { +// unsigned long cyl; +// unsigned long sec; +// unsigned long hds; +// +// hds = bb.edx.r.h; +// sec = bb.ecx.r.l & 0x3F; +// if ((dp->uses_ebios & EBIOS_ENHANCED_DRIVE_INFO) && (sec != 0)) { +// cyl = (di->params.phys_sectors / ((hds + 1) * sec)) - 1; +// } else { +// cyl = bb.ecx.r.h | ((bb.ecx.r.l & 0xC0) << 2); +// } +// di->params.phys_heads = hds; +// di->params.phys_spt = sec; +// di->params.phys_cyls = cyl; +// } else { +// ret = -1; +// } +// } + + if (dp->no_emulation) { + /* Some BIOSes give us erroneous EBIOS support information. + * Assume that if you're on a CD, then you can use + * EBIOS disk calls. + */ + dp->uses_ebios |= EBIOS_FIXED_DISK_ACCESS; + } +#if DEBUG + print_drive_info(di); + printf("uses_ebios = 0x%x\n", dp->uses_ebios); + printf("result %d\n", ret); + pause(); +#endif + + if (ret == 0) { + dp->valid = 1; + } + return ret; +} + +int ebiosEjectMedia(int biosdev) +{ + bb.intno = 0x13; + bb.eax.r.h = 0x46; + bb.eax.r.l = 0; + bb.edx.rx = biosdev; + bios(&bb); + return bb.eax.r.h; +} + +void setCursorPosition(int x, int y, int page) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x02; + bb.ebx.r.h = page; /* page 0 for graphics */ + bb.edx.r.l = x; + bb.edx.r.h = y; + bios(&bb); +} + +void setCursorType(int type) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x01; + bb.ecx.rr = type; + bios(&bb); +} + +void getCursorPositionAndType(int * x, int * y, int * type) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x03; + bios(&bb); + *x = bb.edx.r.l; + *y = bb.edx.r.h; + *type = bb.ecx.rr; +} + +void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir) +{ + bb.intno = 0x10; + bb.eax.r.h = (dir > 0) ? 0x06 : 0x07; + bb.eax.r.l = rows; + bb.ebx.r.h = attr; + bb.ecx.r.h = y1; + bb.ecx.r.l = x1; + bb.edx.r.h = y2; + bb.edx.r.l = x2; + bios(&bb); +} + +void clearScreenRows( int y1, int y2 ) +{ + scollPage( 0, y1, 80 - 1, y2, 0x07, y2 - y1 + 1, 1 ); +} + +void setActiveDisplayPage( int page ) +{ + bb.intno = 0x10; + bb.eax.r.h = 5; + bb.eax.r.l = page; + bios(&bb); +} + +#if DEBUG + +int terminateDiskEmulation() +{ + static char cd_spec[0x13]; + + bb.intno = 0x13; + bb.eax.r.h = 0x4b; + bb.eax.r.l = 0; // subfunc: terminate emulation + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&cd_spec); + bb.ds = NORMALIZED_SEGMENT((unsigned)&cd_spec); + bios(&bb); + return bb.eax.r.h; +} + +int readDriveParameters(int drive, struct driveParameters *dp) +{ + bb.intno = 0x13; + bb.edx.r.l = drive; + bb.eax.r.h = 0x08; + bios(&bb); + if (bb.eax.r.h == 0) { + dp->heads = bb.edx.r.h; + dp->sectors = bb.ecx.r.l & 0x3F; + dp->cylinders = bb.ecx.r.h | ((bb.ecx.r.l & 0xC0) << 2); + dp->totalDrives = bb.edx.r.l; + } else { + bzero(dp, sizeof(*dp)); + } + return bb.eax.r.h; + +} +#endif + +#ifdef APM_SUPPORT + +#define APM_INTNO 0x15 +#define APM_INTCODE 0x53 + +int +APMPresent(void) +{ + bb.intno = APM_INTNO; + bb.eax.r.h = APM_INTCODE; + bb.eax.r.l = 0x00; + bb.ebx.rr = 0x0000; + bios(&bb); + if ((bb.flags.cf == 0) && + (bb.ebx.r.h == 'P') && + (bb.ebx.r.l == 'M')) { + /* Success */ + bootArgs->apmConfig.major_vers = bb.eax.r.h; + bootArgs->apmConfig.minor_vers = bb.eax.r.l; + bootArgs->apmConfig.flags.data = bb.ecx.rr; + return 1; + } + return 0; +} + +int +APMConnect32(void) +{ + bb.intno = APM_INTNO; + bb.eax.r.h = APM_INTCODE; + bb.eax.r.l = 0x03; + bb.ebx.rr = 0x0000; + bios(&bb); + if (bb.flags.cf == 0) { + /* Success */ + bootArgs->apmConfig.cs32_base = (bb.eax.rr) << 4; + bootArgs->apmConfig.entry_offset = bb.ebx.rx; + bootArgs->apmConfig.cs16_base = (bb.ecx.rr) << 4; + bootArgs->apmConfig.ds_base = (bb.edx.rr) << 4; + if (bootArgs->apmConfig.major_vers >= 1 && + bootArgs->apmConfig.minor_vers >= 1) { + bootArgs->apmConfig.cs_length = bb.esi.rr; + bootArgs->apmConfig.ds_length = bb.edi.rr; + } else { + bootArgs->apmConfig.cs_length = + bootArgs->apmConfig.ds_length = 64 * 1024; + } + bootArgs->apmConfig.connected = 1; + return 1; + } + return 0; +} + +#endif /* APM_SUPPORT */ + +#ifdef EISA_SUPPORT +bool eisa_present(void) +{ + static bool checked = false; + static bool isEISA; + + if (!checked) { + if (strncmp((char *)0xfffd9, "EISA", 4) == 0) + isEISA = true; + + checked = true; + } + + return (isEISA); +} + +int +ReadEISASlotInfo(EISA_slot_info_t *ep, int slot) +{ + union { + struct { + unsigned char char2h :2; + unsigned char char1 :5; + unsigned char char3 :5; + unsigned char char2l :3; + unsigned char d2 :4; + unsigned char d1 :4; + unsigned char d4 :4; + unsigned char d3 :4; + } s; + unsigned char data[4]; + } u; + static char hex[0x10] = "0123456789ABCDEF"; + + + bb.intno = 0x15; + bb.eax.r.h = 0xd8; + bb.eax.r.l = 0x00; + bb.ecx.r.l = slot; + bios(&bb); + if (bb.flags.cf) + return bb.eax.r.h; + ep->u_ID.d = bb.eax.r.l; + ep->configMajor = bb.ebx.r.h; + ep->configMinor = bb.ebx.r.l; + ep->checksum = bb.ecx.rr; + ep->numFunctions = bb.edx.r.h; + ep->u_resources.d = bb.edx.r.l; + u.data[0] = bb.edi.r.l; + u.data[1] = bb.edi.r.h; + u.data[2] = bb.esi.r.l; + u.data[3] = bb.esi.r.h; + ep->id[0] = u.s.char1 + ('A' - 1); + ep->id[1] = (u.s.char2l | (u.s.char2h << 3)) + ('A' - 1); + ep->id[2] = u.s.char3 + ('A' - 1); + ep->id[3] = hex[u.s.d1]; + ep->id[4] = hex[u.s.d2]; + ep->id[5] = hex[u.s.d3]; + ep->id[6] = hex[u.s.d4]; + ep->id[7] = 0; + return 0; +} + +/* + * Note: ep must point to an address below 64k. + */ + +int +ReadEISAFuncInfo(EISA_func_info_t *ep, int slot, int function) +{ + bb.intno = 0x15; + bb.eax.r.h = 0xd8; + bb.eax.r.l = 0x01; + bb.ecx.r.l = slot; + bb.ecx.r.h = function; + bb.esi.rr = (unsigned int)ep->data; + bios(&bb); + if (bb.eax.r.h == 0) { + ep->slot = slot; + ep->function = function; + } + return bb.eax.r.h; +} +#endif /* EISA_SUPPORT */ + +#define PCI_SIGNATURE 0x20494350 /* "PCI " */ + +int +ReadPCIBusInfo(PCI_bus_info_t *pp) +{ + bb.intno = 0x1a; + bb.eax.r.h = 0xb1; + bb.eax.r.l = 0x01; + bios(&bb); + if ((bb.eax.r.h == 0) && (bb.edx.rx == PCI_SIGNATURE)) { + pp->BIOSPresent = 1; + pp->u_bus.d = bb.eax.r.l; + pp->majorVersion = bb.ebx.r.h; + pp->minorVersion = bb.ebx.r.l; + pp->maxBusNum = bb.ecx.r.l; + return 0; + } + return -1; +} + +void sleep(int n) +{ + unsigned int endtime = (time18() + 18*n); + while (time18() < endtime); +} + +void delay(int ms) +{ + bb.intno = 0x15; + bb.eax.r.h = 0x86; + bb.ecx.rr = ms >> 16; + bb.edx.rr = ms & 0xFFFF; + bios(&bb); +} + diff --git a/i386/libsaio/.svn/text-base/bootargs.h.svn-base b/i386/libsaio/.svn/text-base/bootargs.h.svn-base new file mode 100644 index 0000000..b0bd909 --- /dev/null +++ b/i386/libsaio/.svn/text-base/bootargs.h.svn-base @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _PEXPERT_I386_BOOT_H +#define _PEXPERT_I386_BOOT_H + +#include <stdint.h> + +/* + * What the booter leaves behind for the kernel. + */ + +/* + * Types of boot driver that may be loaded by the booter. + */ +enum { + kBootDriverTypeInvalid = 0, + kBootDriverTypeKEXT = 1, + kBootDriverTypeMKEXT = 2 +}; + +enum { + kEfiReservedMemoryType = 0, + kEfiLoaderCode = 1, + kEfiLoaderData = 2, + kEfiBootServicesCode = 3, + kEfiBootServicesData = 4, + kEfiRuntimeServicesCode = 5, + kEfiRuntimeServicesData = 6, + kEfiConventionalMemory = 7, + kEfiUnusableMemory = 8, + kEfiACPIReclaimMemory = 9, + kEfiACPIMemoryNVS = 10, + kEfiMemoryMappedIO = 11, + kEfiMemoryMappedIOPortSpace = 12, + kEfiPalCode = 13, + kEfiMaxMemoryType = 14 +}; + +/* + * Memory range descriptor. + */ +typedef struct EfiMemoryRange { + uint32_t Type; + uint32_t Pad; + uint64_t PhysicalStart; + uint64_t VirtualStart; + uint64_t NumberOfPages; + uint64_t Attribute; +} EfiMemoryRange; + +#define BOOT_LINE_LENGTH 1024 +#define BOOT_STRING_LEN BOOT_LINE_LENGTH + +/* + * Video information.. + */ + +struct Boot_Video { + uint32_t v_baseAddr; /* Base address of video memory */ + uint32_t v_display; /* Display Code (if Applicable */ + uint32_t v_rowBytes; /* Number of bytes per pixel row */ + uint32_t v_width; /* Width */ + uint32_t v_height; /* Height */ + uint32_t v_depth; /* Pixel Depth */ +}; + +typedef struct Boot_Video Boot_Video; + +/* Values for v_display */ + +#define GRAPHICS_MODE 1 +#define FB_TEXT_MODE 2 + +/* Boot argument structure - passed into Mach kernel at boot time. + * "Revision" can be incremented for compatible changes + */ +// Lion +#define kBootArgsRevision 0 +#define kBootArgsVersion 2 + +// Snow Leopard and older +#define kBootArgsPreLionRevision 6 +#define kBootArgsPreLionVersion 1 + +/* Snapshot constants of previous revisions that are supported */ + +#define kBootArgsEfiMode32 32 +#define kBootArgsEfiMode64 64 + +typedef struct boot_args { + uint16_t Revision; /* Revision of boot_args structure */ + uint16_t Version; /* Version of boot_args structure */ + + uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ + uint8_t debugMode; /* Bit field with behavior changes */ + uint8_t __reserved1[2]; + + char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */ + + uint32_t MemoryMap; /* Physical address of memory map */ + uint32_t MemoryMapSize; + uint32_t MemoryMapDescriptorSize; + uint32_t MemoryMapDescriptorVersion; + + Boot_Video Video; /* Video Information */ + + uint32_t deviceTreeP; /* Physical address of flattened device tree */ + uint32_t deviceTreeLength; /* Length of flattened tree */ + + uint32_t kaddr; /* Physical address of beginning of kernel text */ + uint32_t ksize; /* Size of combined kernel text+data+efi */ + + uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */ + uint32_t efiRuntimeServicesPageCount; + uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ + + uint32_t efiSystemTable; /* physical address of system table in runtime area */ + uint32_t __reserved2; + + uint32_t performanceDataStart; /* physical address of log */ + uint32_t performanceDataSize; + + uint32_t keyStoreDataStart; /* physical address of key store data */ + uint32_t keyStoreDataSize; + uint64_t bootMemStart; + uint64_t bootMemSize; + uint64_t PhysicalMemorySize; + uint64_t FSBFrequency; + uint32_t __reserved4[734]; + +} boot_args; + +typedef struct boot_args_pre_lion { + uint16_t Revision; /* Revision of boot_args structure */ + uint16_t Version; /* Version of boot_args structure */ + + char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */ + + uint32_t MemoryMap; /* Physical address of memory map */ + uint32_t MemoryMapSize; + uint32_t MemoryMapDescriptorSize; + uint32_t MemoryMapDescriptorVersion; + + Boot_Video Video; /* Video Information */ + + uint32_t deviceTreeP; /* Physical address of flattened device tree */ + uint32_t deviceTreeLength; /* Length of flattened tree */ + + uint32_t kaddr; /* Physical address of beginning of kernel text */ + uint32_t ksize; /* Size of combined kernel text+data+efi */ + + uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */ + uint32_t efiRuntimeServicesPageCount; + uint32_t efiSystemTable; /* physical address of system table in runtime area */ + + uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ + uint8_t __reserved1[3]; + uint32_t __reserved2[1]; + uint32_t performanceDataStart; /* physical address of log */ + uint32_t performanceDataSize; + uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ + uint32_t __reserved3[2]; + +} boot_args_pre_lion; + +extern char gMacOSVersion[8]; + +#endif /* _PEXPERT_I386_BOOT_H */ diff --git a/i386/libsaio/.svn/text-base/bootstruct.c.svn-base b/i386/libsaio/.svn/text-base/bootstruct.c.svn-base new file mode 100644 index 0000000..f287806 --- /dev/null +++ b/i386/libsaio/.svn/text-base/bootstruct.c.svn-base @@ -0,0 +1,214 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" +#include "bootstruct.h" + +/*========================================================================== + * Initialize the structure of parameters passed to + * the kernel by the booter. + */ + +boot_args *bootArgs; +boot_args_pre_lion *bootArgsPreLion; +PrivateBootInfo_t *bootInfo; +Node *gMemoryMapNode; + +static char platformName[64]; + +void initKernBootStruct( void ) +{ + Node *node; + int nameLen; + static int init_done = 0; + + if ( !init_done ) + { + bootArgs = (boot_args *)malloc(sizeof(boot_args)); + bootArgsPreLion = (boot_args_pre_lion *)malloc(sizeof(boot_args_pre_lion)); + bootInfo = (PrivateBootInfo_t *)malloc(sizeof(PrivateBootInfo_t)); + if (bootArgs == 0 || bootInfo == 0) + stop("Couldn't allocate boot info\n"); + + bzero(bootArgs, sizeof(boot_args)); + bzero(bootArgsPreLion, sizeof(boot_args_pre_lion)); + bzero(bootInfo, sizeof(PrivateBootInfo_t)); + + // Get system memory map. Also update the size of the + // conventional/extended memory for backwards compatibility. + + bootInfo->memoryMapCount = + getMemoryMap( bootInfo->memoryMap, kMemoryMapCountMax, + (unsigned long *) &bootInfo->convmem, + (unsigned long *) &bootInfo->extmem ); + + if ( bootInfo->memoryMapCount == 0 ) + { + // BIOS did not provide a memory map, systems with + // discontiguous memory or unusual memory hole locations + // may have problems. + + bootInfo->convmem = getConventionalMemorySize(); + bootInfo->extmem = getExtendedMemorySize(); + } + + bootInfo->configEnd = bootInfo->config; + bootArgs->Video.v_display = VGA_TEXT_MODE; + + DT__Initialize(); + + node = DT__FindNode("/", true); + if (node == 0) { + stop("Couldn't create root node"); + } + getPlatformName(platformName); + nameLen = strlen(platformName) + 1; + DT__AddProperty(node, "compatible", nameLen, platformName); + DT__AddProperty(node, "model", nameLen, platformName); + + gMemoryMapNode = DT__FindNode("/chosen/memory-map", true); + + bootArgs->Version = kBootArgsVersion; + bootArgs->Revision = kBootArgsRevision; + + bootArgsPreLion->Version = kBootArgsPreLionVersion; + bootArgsPreLion->Revision = kBootArgsPreLionRevision; + + init_done = 1; + } +} + + +/* Copy boot args after kernel and record address. */ + +void +reserveKernBootStruct(void) +{ + if ((gMacOSVersion[0] == '1') && (gMacOSVersion[1] == '0') + && (gMacOSVersion[2] == '.') && (gMacOSVersion[3] == '7' || gMacOSVersion[3] == '8' || gMacOSVersion[3] == '9')) + { + void *oldAddr = bootArgs; + bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args)); + bcopy(oldAddr, bootArgs, sizeof(boot_args)); + } + else + { + void *oldAddr = bootArgsPreLion; + bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion)); + bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion)); + } +} + +void +finalizeBootStruct(void) +{ + uint32_t size; + void *addr; + int i; + EfiMemoryRange *memoryMap; + MemoryRange *range; + int memoryMapCount = bootInfo->memoryMapCount; + + if (memoryMapCount == 0) { + // XXX could make a two-part map here + stop("Unable to convert memory map into proper format\n"); + } + + // convert memory map to boot_args memory map + memoryMap = (EfiMemoryRange *)AllocateKernelMemory(sizeof(EfiMemoryRange) * memoryMapCount); + bootArgs->MemoryMap = (uint32_t)memoryMap; + bootArgs->MemoryMapSize = sizeof(EfiMemoryRange) * memoryMapCount; + bootArgs->MemoryMapDescriptorSize = sizeof(EfiMemoryRange); + bootArgs->MemoryMapDescriptorVersion = 0; + + for (i = 0; i < memoryMapCount; i++, memoryMap++) { + range = &bootInfo->memoryMap[i]; + switch(range->type) { + case kMemoryRangeACPI: + memoryMap->Type = kEfiACPIReclaimMemory; + break; + case kMemoryRangeNVS: + memoryMap->Type = kEfiACPIMemoryNVS; + break; + case kMemoryRangeUsable: + memoryMap->Type = kEfiConventionalMemory; + break; + case kMemoryRangeReserved: + default: + memoryMap->Type = kEfiReservedMemoryType; + break; + } + memoryMap->PhysicalStart = range->base; + memoryMap->VirtualStart = range->base; + memoryMap->NumberOfPages = range->length >> I386_PGSHIFT; + memoryMap->Attribute = 0; + } + + // copy bootFile into device tree + // XXX + + // add PCI info somehow into device tree + // XXX + + // Flatten device tree + DT__FlattenDeviceTree(0, &size); + addr = (void *)AllocateKernelMemory(size); + if (addr == 0) { + stop("Couldn't allocate device tree\n"); + } + + DT__FlattenDeviceTree((void **)&addr, &size); + bootArgs->deviceTreeP = (uint32_t)addr; + bootArgs->deviceTreeLength = size; + + // Copy BootArgs values to older structure + + memcpy(&bootArgsPreLion->CommandLine, &bootArgs->CommandLine, BOOT_LINE_LENGTH); + memcpy(&bootArgsPreLion->Video, &bootArgs->Video, sizeof(Boot_Video)); + + bootArgsPreLion->MemoryMap = bootArgs->MemoryMap; + bootArgsPreLion->MemoryMapSize = bootArgs->MemoryMapSize; + bootArgsPreLion->MemoryMapDescriptorSize = bootArgs->MemoryMapDescriptorSize; + bootArgsPreLion->MemoryMapDescriptorVersion = bootArgs->MemoryMapDescriptorVersion; + + bootArgsPreLion->deviceTreeP = bootArgs->deviceTreeP; + bootArgsPreLion->deviceTreeLength = bootArgs->deviceTreeLength; + + bootArgsPreLion->kaddr = bootArgs->kaddr; + bootArgsPreLion->ksize = bootArgs->ksize; + + bootArgsPreLion->efiRuntimeServicesPageStart = bootArgs->efiRuntimeServicesPageStart; + bootArgsPreLion->efiRuntimeServicesPageCount = bootArgs->efiRuntimeServicesPageCount; + bootArgsPreLion->efiSystemTable = bootArgs->efiSystemTable; + + bootArgsPreLion->efiMode = bootArgs->efiMode; + + bootArgsPreLion->performanceDataStart = bootArgs->performanceDataStart; + bootArgsPreLion->performanceDataSize = bootArgs->performanceDataSize; + bootArgsPreLion->efiRuntimeServicesVirtualPageStart = bootArgs->efiRuntimeServicesVirtualPageStart; +} diff --git a/i386/libsaio/.svn/text-base/bootstruct.h.svn-base b/i386/libsaio/.svn/text-base/bootstruct.h.svn-base new file mode 100644 index 0000000..f99d7fc --- /dev/null +++ b/i386/libsaio/.svn/text-base/bootstruct.h.svn-base @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2002-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOTSTRUCT_H +#define __BOOTSTRUCT_H + +#include "bootargs.h" +#include "saio_types.h" +#include "bios.h" +#include "device_tree.h" + +/*! + Kernel boot args global also used by booter for its own data. + */ +extern boot_args *bootArgs; +extern boot_args_pre_lion *bootArgsPreLion; +extern Node *gMemoryMapNode; + +#define VGA_TEXT_MODE 0 +//defined in /usr/../boot.h + +//#define GRAPHICS_MODE 1 +//#define FB_TEXT_MODE 2 + + + +/* + * Maximum number of boot drivers that can be loaded. + */ +#define NDRIVERS 500 + +#define CONFIG_SIZE (40 * 4096) + +#define kMemoryMapCountMax 1000 + +/* + * PCI bus information. + */ +typedef struct _PCI_bus_info_t { + union { + struct { + unsigned char configMethod1 :1; + unsigned char configMethod2 :1; + unsigned char :2; + unsigned char specialCycle1 :1; + unsigned char specialCycle2 :1; + } s; + unsigned char d; + } u_bus; + unsigned char maxBusNum; + unsigned char majorVersion; + unsigned char minorVersion; + unsigned char BIOSPresent; +} PCI_bus_info_t; + +typedef struct { + unsigned long address; // address where driver was loaded + unsigned long size; // number of bytes + unsigned long type; // driver type +} driver_config_t; + +/* + * INT15, E820h - Query System Address Map. + * + * Documented in ACPI Specification Rev 2.0, + * Chapter 15 (System Address Map Interfaces). + */ + +/* + * ACPI defined memory range types. + */ +enum { + kMemoryRangeUsable = 1, // RAM usable by the OS. + kMemoryRangeReserved = 2, // Reserved. (Do not use) + kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed. + kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use) + + /* Undefined types should be treated as kMemoryRangeReserved */ +}; + +/*! + PrivateBootInfo has fields used by the booter that used to be part of + KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure + completely changed to boot_args *bootArgs. This (new to boot-132) structure + contains the fields the kernel no longer cares about but the booter still + uses internally. Some fields (e.g. the video information) remain interesting + to the kernel and are thus located in bootArgs although with different field names. + */ +typedef struct PrivateBootInfo { + int convmem; // conventional memory + int extmem; // extended memory +#if 0 + int numBootDrivers; // number of drivers loaded +#endif + char bootFile[128]; // kernel file name + + unsigned long memoryMapCount; + MemoryRange memoryMap[kMemoryMapCountMax]; + + PCI_bus_info_t pciInfo; + +#if 0 + driver_config_t driverConfig[NDRIVERS]; +#endif + char * configEnd; // pointer to end of config files + char config[CONFIG_SIZE]; + + config_file_t bootConfig; // com.apple.Boot.plist + config_file_t chameleonConfig; // org.chameleon.Boot.plist which can override bootConfig keys + config_file_t themeConfig; // theme.plist + config_file_t smbiosConfig; // smbios.plist + config_file_t helperConfig; // boot helper partition's boot.plist + config_file_t ramdiskConfig; // RAMDisk.plist + + bool memDetect; +} PrivateBootInfo_t; + +extern PrivateBootInfo_t *bootInfo; + +#endif /* __BOOTSTRUCT_H */ diff --git a/i386/libsaio/.svn/text-base/cache.c.svn-base b/i386/libsaio/.svn/text-base/cache.c.svn-base new file mode 100644 index 0000000..9d70e86 --- /dev/null +++ b/i386/libsaio/.svn/text-base/cache.c.svn-base @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * cache.c - A simple cache for file systems meta-data. + * + * Copyright (c) 2000 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include <sl.h> +// #include <fs.h> + +struct CacheEntry { + CICell ih; + long time; + long long offset; +}; +typedef struct CacheEntry CacheEntry; + +#define kCacheSize (0x100000) +#define kCacheMinBlockSize (0x200) +#define kCacheMaxBlockSize (0x8000) +#define kCacheMaxEntries (kCacheSize / kCacheMinBlockSize) + +static CICell gCacheIH; +static long gCacheBlockSize; +static long gCacheNumEntries; +static long gCacheTime; + +#ifdef __i386__ +static CacheEntry *gCacheEntries; +static char *gCacheBuffer; +#else +static CacheEntry gCacheEntries[kCacheMaxEntries]; +static char gCacheBuffer[kCacheSize]; +#endif + +#if CACHE_STATS +unsigned long gCacheHits; +unsigned long gCacheMisses; +unsigned long gCacheEvicts; +#endif + +void CacheReset() +{ + gCacheIH = NULL; +} + +void CacheInit( CICell ih, long blockSize ) +{ +#ifdef __i386__ + if ((ih == gCacheIH) && (blockSize == gCacheBlockSize)) + return; +#endif + + if ((blockSize < kCacheMinBlockSize) || + (blockSize > kCacheMaxBlockSize)) + return; + + gCacheBlockSize = blockSize; + gCacheNumEntries = kCacheSize / gCacheBlockSize; + gCacheTime = 0; + +#if CACHE_STATS + gCacheHits = 0; + gCacheMisses = 0; + gCacheEvicts = 0; +#endif + + gCacheIH = ih; + +#ifdef __i386__ + if (!gCacheBuffer) gCacheBuffer = (char *) malloc(kCacheSize); + if (!gCacheEntries) gCacheEntries = (CacheEntry *) malloc(kCacheMaxEntries * sizeof(CacheEntry)); + if ( !gCacheBuffer || !gCacheEntries ) + { + gCacheIH = 0; // invalidate cache + return; + } +#endif + + bzero(gCacheEntries, kCacheMaxEntries * sizeof(CacheEntry)); +} + +long CacheRead( CICell ih, char * buffer, long long offset, + long length, long cache ) +{ + long cnt, oldestEntry = 0, oldestTime, loadCache = 0; + CacheEntry *entry; + + // See if the data can be cached. + if (cache && (gCacheIH == ih) && (length == gCacheBlockSize)) { + // Look for the data in the cache. + for (cnt = 0; cnt < gCacheNumEntries; cnt++) { + entry = &gCacheEntries[cnt]; + if ((entry->ih == ih) && (entry->offset == offset)) { + entry->time = ++gCacheTime; + break; + } + } + + // If the data was found copy it to the caller. + if (cnt != gCacheNumEntries) { + bcopy(gCacheBuffer + cnt * gCacheBlockSize, buffer, gCacheBlockSize); +#if CACHE_STATS + gCacheHits++; +#endif + return gCacheBlockSize; + } + + // Could not find the data in the cache. + loadCache = 1; + } + + // Read the data from the disk. + Seek(ih, offset); + Read(ih, (long)buffer, length); +#if CACHE_STATS + if (cache) gCacheMisses++; +#endif + + // Put the data from the disk in the cache if needed. + if (loadCache) { + // Find a free entry. + oldestTime = gCacheTime; + for (cnt = 0; cnt < gCacheNumEntries; cnt++) { + entry = &gCacheEntries[cnt]; + + // Found a free entry. + if (entry->ih == 0) break; + + if (entry->time < oldestTime) { + oldestTime = entry->time; + oldestEntry = cnt; + } + } + + // If no free entry was found, use the oldest. + if (cnt == gCacheNumEntries) { + cnt = oldestEntry; +#if CACHE_STATS + gCacheEvicts++; +#endif + } + + // Copy the data from disk to the new entry. + entry = &gCacheEntries[cnt]; + entry->ih = ih; + entry->time = ++gCacheTime; + entry->offset = offset; + bcopy(buffer, gCacheBuffer + cnt * gCacheBlockSize, gCacheBlockSize); + } + + return length; +} diff --git a/i386/libsaio/.svn/text-base/console.c.svn-base b/i386/libsaio/.svn/text-base/console.c.svn-base new file mode 100644 index 0000000..f7844c7 --- /dev/null +++ b/i386/libsaio/.svn/text-base/console.c.svn-base @@ -0,0 +1,267 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include <vers.h> + +extern int vprf(const char * fmt, va_list ap); + +bool gVerboseMode; +bool gErrors; + +/* + * Azi: Doubled available log size; this seems to fix some hangs and instant reboots caused by + * booting with -f (ignore caches). 96kb are enough to hold full log, booting with -f; even so, + * this depends on how much we "play" at the boot prompt and with what patches we're playing, + * depending on how much they print to the log. + * + * Kabyl: BooterLog + */ +#define BOOTER_LOG_SIZE (128 * 1024) +#define SAFE_LOG_SIZE 134 + +char *msgbuf = 0; +char *cursor = 0; + +struct putc_info //Azi: exists on gui.c & printf.c +{ + char * str; + char * last_str; +}; + +static int +sputc(int c, struct putc_info * pi) //Azi: same as above +{ + if (pi->last_str) + if (pi->str == pi->last_str) + { + *(pi->str) = '\0'; + return 0; + } + *(pi->str)++ = c; + return c; +} + +void initBooterLog(void) +{ + msgbuf = malloc(BOOTER_LOG_SIZE); + bzero(msgbuf, BOOTER_LOG_SIZE); + cursor = msgbuf; + msglog("%s\n", "Chimera " I386BOOT_CHAMELEONVERSION " (svn-r" I386BOOT_CHAMELEONREVISION ")" " [" I386BOOT_BUILDDATE "]"); +} + +void msglog(const char * fmt, ...) +{ + va_list ap; + struct putc_info pi; + + if (!msgbuf) + return; + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) + return; + + va_start(ap, fmt); + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + va_end(ap); + cursor += strlen((char *)cursor); +} + +void setupBooterLog(void) +{ + if (!msgbuf) + return; + + Node *node = DT__FindNode("/", false); + if (node) + DT__AddProperty(node, "boot-log", strlen((char *)msgbuf) + 1, msgbuf); +} +/* Kabyl: !BooterLog */ + +/* + * write one character to console + */ +int putchar(int c) +{ + if ( c == '\t' ) + { + for (c = 0; c < 8; c++) bios_putchar(' '); + return c; + } + + if ( c == '\n' ) + { + bios_putchar('\r'); + } + + bios_putchar(c); + + return c; +} + +int getc() +{ + int c = bgetc(); + + if ((c & 0xff) == 0) + return c; + else + return (c & 0xff); +} + +// Read and echo a character from console. This doesn't echo backspace +// since that screws up higher level handling + +int getchar() +{ + register int c = getc(); + +// if ( c == '\r' ) c = '\n'; + +// if ( c >= ' ' && c < 0x7f) putchar(c); + + return (c); +} + +int printf(const char * fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + prf(fmt, ap, putchar, 0); + else + vprf(fmt, ap); + + { + // Kabyl: BooterLog + struct putc_info pi; + + if (!msgbuf) + return 0; + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) + return 0; + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + cursor += strlen((char *)cursor); + } + + va_end(ap); + return 0; +} + +int verbose(const char * fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (gVerboseMode) + { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + prf(fmt, ap, putchar, 0); + else + vprf(fmt, ap); + } + + { + // Kabyl: BooterLog + struct putc_info pi; + + if (!msgbuf) + return 0; + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) + return 0; + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + cursor += strlen((char *)cursor); + } + + va_end(ap); + return(0); +} + +int error(const char * fmt, ...) +{ + va_list ap; + gErrors = true; + va_start(ap, fmt); + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + prf(fmt, ap, putchar, 0); + else + vprf(fmt, ap); + va_end(ap); + return(0); +} + +void stop(const char * fmt, ...) +{ + va_list ap; + + printf("\n"); + va_start(ap, fmt); + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + prf(fmt, ap, putchar, 0); + } else { + vprf(fmt, ap); + } + va_end(ap); + printf("\nThis is a non recoverable error! System HALTED!!!"); + halt(); + while (1); +} + +/** Print a "Press a key to continue..." message and wait for a key press. */ +void pause() +{ + printf("Press a key to continue...\n"); + getchar(); // replace getchar() by pause() were useful. +} diff --git a/i386/libsaio/.svn/text-base/convert.c.svn-base b/i386/libsaio/.svn/text-base/convert.c.svn-base new file mode 100644 index 0000000..912c4e5 --- /dev/null +++ b/i386/libsaio/.svn/text-base/convert.c.svn-base @@ -0,0 +1,153 @@ +/* + * Convert.c + * Implement conversion utility functions + * Create UUID parsing functions and gather other conversion routines + * --Rek + */ + +#include "convert.h" + +/** Transform a 16 bytes hexadecimal value UUID to a string */ +const char * getStringFromUUID(const EFI_CHAR8* eUUID) +{ + static char msg[UUID_LEN*2 + 8] = ""; + if (!eUUID) return ""; + const unsigned char * uuid = (unsigned char*) eUUID; + sprintf(msg, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + uuid[0], uuid[1], uuid[2], uuid[3], + uuid[4], uuid[5], uuid[6], uuid[7], + uuid[8], uuid[9], uuid[10],uuid[11], + uuid[12],uuid[13],uuid[14],uuid[15]); + return msg ; +} + +/** Parse an UUID string into an (EFI_CHAR8*) buffer */ +EFI_CHAR8* getUUIDFromString(const char *source) +{ + if (!source) return 0; + + char *p = (char *)source; + int i; + char buf[3]; + static EFI_CHAR8 uuid[UUID_LEN+1]=""; + + buf[2] = '\0'; + for (i=0; i<UUID_LEN; i++) { + if (p[0] == '\0' || p[1] == '\0' || !isxdigit(p[0]) || !isxdigit(p[1])) { + verbose("[ERROR] UUID='%s' syntax error\n", source); + return 0; + } + buf[0] = *p++; + buf[1] = *p++; + uuid[i] = (unsigned char) strtoul(buf, NULL, 16); + if (*p == '-' && (i % 2) == 1 && i < UUID_LEN - 1) { + p++; + } + } + uuid[UUID_LEN]='\0'; + + if (*p != '\0') { + verbose("[ERROR] UUID='%s' syntax error\n", source); + return 0; + } + return uuid; +} + +/** XXX AsereBLN replace by strtoul */ +uint32_t ascii_hex_to_int(char *buff) +{ + uint32_t value = 0, i, digit; + for(i = 0; i < strlen(buff); i++) + { + if (buff[i] >= 48 && buff[i] <= 57) // '0' through '9' + digit = buff[i] - 48; + else if (buff[i] >= 65 && buff[i] <= 70) // 'A' through 'F' + digit = buff[i] - 55; + else if (buff[i] >= 97 && buff[i] <= 102) // 'a' through 'f' + digit = buff[i] - 87; + else + return value; + + value = digit + 16 * value; + } + return value; +} + +void *convertHexStr2Binary(const char *hexStr, int *outLength) +{ + int len; + char hexNibble; + char hexByte[2]; + uint8_t binChar; + uint8_t *binStr; + int hexStrIdx, binStrIdx, hexNibbleIdx; + + len = strlen(hexStr); + if (len > 1) + { + // the resulting binary will be the half size of the input hex string + binStr = malloc(len / 2); + binStrIdx = 0; + hexNibbleIdx = 0; + for (hexStrIdx = 0; hexStrIdx < len; hexStrIdx++) + { + hexNibble = hexStr[hexStrIdx]; + + // ignore all chars except valid hex numbers + if ( (hexNibble >= '0' && hexNibble <= '9') || + (hexNibble >= 'A' && hexNibble <= 'F') || + (hexNibble >= 'a' && hexNibble <= 'f') ) + { + hexByte[hexNibbleIdx++] = hexNibble; + + // found both two nibbles, convert to binary + if (hexNibbleIdx == 2) + { + binChar = 0; + + for (hexNibbleIdx = 0; hexNibbleIdx < sizeof(hexByte); hexNibbleIdx++) + { + if (hexNibbleIdx > 0) binChar = binChar << 4; + + if (hexByte[hexNibbleIdx] <= '9') binChar += hexByte[hexNibbleIdx] - '0'; + else if (hexByte[hexNibbleIdx] <= 'F') binChar += hexByte[hexNibbleIdx] - ('A' - 10); + else if (hexByte[hexNibbleIdx] <= 'f') binChar += hexByte[hexNibbleIdx] - ('a' - 10); + } + + binStr[binStrIdx++] = binChar; + hexNibbleIdx = 0; + } + } + } + *outLength = binStrIdx; + return binStr; + } + else + { + *outLength = 0; + return NULL; + } +} + +// FIXME: can't use my original code here, +// Ironically, trying to reuse convertHexStr2Binary() would RESET the system! +/* +static EFI_CHAR8* getUUIDFromString2(const char * szInUUID) +{ + char szUUID[UUID_LEN+1], *p=szUUID; + int size=0; + void* ret; + + if (!szInUUID || strlen(szInUUID)<UUID_LEN) return (EFI_CHAR8*) 0; + + while(*szInUUID) if (*szInUUID!='-') *p++=*szInUUID++; else szInUUID++; + *p='\0'; + ret = convertHexStr2Binary(szUUID, &size); + if (!ret || size!=UUID_LEN) + { + verbose("UUID: cannot convert string <%s> to valid UUID.\n", szUUID); + return (EFI_CHAR8*) 0; + } + return (EFI_CHAR8*) ret; // new allocated buffer containing the converted string to bin +} +*/ diff --git a/i386/libsaio/.svn/text-base/convert.h.svn-base b/i386/libsaio/.svn/text-base/convert.h.svn-base new file mode 100644 index 0000000..c2883ca --- /dev/null +++ b/i386/libsaio/.svn/text-base/convert.h.svn-base @@ -0,0 +1,33 @@ +/* + * Convert.h + * Declare conversion utility functions + * --Rek + */ + +#ifndef __CONVERT_H +#define __CONVERT_H +#include "libsaio.h" +#include "efi.h" + +#define UUID_LEN 16 + +const char * getStringFromUUID(const EFI_CHAR8* uuid); +EFI_CHAR8* getUUIDFromString(const char *source); +void *convertHexStr2Binary(const char *hexStr, int *outLength); +uint32_t ascii_hex_to_int(char *buff); + +static inline uint16_t dp_swap16(uint16_t toswap) +{ + return (((toswap & 0x00FF) << 8) | ((toswap & 0xFF00) >> 8)); +} + +static inline uint32_t dp_swap32(uint32_t toswap) +{ + return ((toswap & 0x000000FF) << 24) | + ((toswap & 0x0000FF00) << 8 ) | + ((toswap & 0x00FF0000) >> 8 ) | + ((toswap & 0xFF000000) >> 24); +} + + +#endif diff --git a/i386/libsaio/.svn/text-base/cpu.c.svn-base b/i386/libsaio/.svn/text-base/cpu.c.svn-base new file mode 100644 index 0000000..717e95d --- /dev/null +++ b/i386/libsaio/.svn/text-base/cpu.c.svn-base @@ -0,0 +1,621 @@ +/* + * Copyright 2008 Islam Ahmed Zaid. All rights reserved. <azismed@gmail.com> + * AsereBLN: 2009: cleanup and bugfix + */ + +#include "libsaio.h" +#include "platform.h" +#include "cpu.h" +#include "bootstruct.h" +#include "boot.h" + +#ifndef DEBUG_CPU +#define DEBUG_CPU 0 +#endif + +#if DEBUG_CPU +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +/* + * timeRDTSC() + * This routine sets up PIT counter 2 to count down 1/20 of a second. + * It pauses until the value is latched in the counter + * and then reads the time stamp counter to return to the caller. + */ +uint64_t timeRDTSC(void) +{ + int attempts = 0; + uint64_t latchTime; + uint64_t saveTime,intermediate; + unsigned int timerValue, lastValue; + //boolean_t int_enabled; + /* + * Table of correction factors to account for + * - timer counter quantization errors, and + * - undercounts 0..5 + */ +#define SAMPLE_CLKS_EXACT (((double) CLKNUM) / 20.0) +#define SAMPLE_CLKS_INT ((int) CLKNUM / 20) +#define SAMPLE_NSECS (2000000000LL) +#define SAMPLE_MULTIPLIER (((double)SAMPLE_NSECS)*SAMPLE_CLKS_EXACT) +#define ROUND64(x) ((uint64_t)((x) + 0.5)) + uint64_t scale[6] = { + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-0)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-1)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-2)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-3)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-4)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-5)) + }; + +restart: + if (attempts >= 9) // increase to up to 9 attempts. + // This will flash-reboot. TODO: Use tscPanic instead. + printf("Timestamp counter calibation failed with %d attempts\n", attempts); + attempts++; + enable_PIT2(); // turn on PIT2 + set_PIT2(0); // reset timer 2 to be zero + latchTime = rdtsc64(); // get the time stamp to time + latchTime = get_PIT2(&timerValue) - latchTime; // time how long this takes + set_PIT2(SAMPLE_CLKS_INT); // set up the timer for (almost) 1/20th a second + saveTime = rdtsc64(); // now time how long a 20th a second is... + get_PIT2(&lastValue); + get_PIT2(&lastValue); // read twice, first value may be unreliable + do { + intermediate = get_PIT2(&timerValue); + if (timerValue > lastValue) { + // Timer wrapped + set_PIT2(0); + disable_PIT2(); + goto restart; + } + lastValue = timerValue; + } while (timerValue > 5); + printf("timerValue %d\n",timerValue); + printf("intermediate 0x%016llx\n",intermediate); + printf("saveTime 0x%016llx\n",saveTime); + + intermediate -= saveTime; // raw count for about 1/20 second + intermediate *= scale[timerValue]; // rescale measured time spent + intermediate /= SAMPLE_NSECS; // so its exactly 1/20 a second + intermediate += latchTime; // add on our save fudge + + set_PIT2(0); // reset timer 2 to be zero + disable_PIT2(); // turn off PIT 2 + + return intermediate; +} + +/* + * DFE: Measures the TSC frequency in Hz (64-bit) using the ACPI PM timer + */ +static uint64_t measure_tsc_frequency(void) +{ + uint64_t tscStart; + uint64_t tscEnd; + uint64_t tscDelta = 0xffffffffffffffffULL; + unsigned long pollCount; + uint64_t retval = 0; + int i; + + /* Time how many TSC ticks elapse in 30 msec using the 8254 PIT + * counter 2. We run this loop 3 times to make sure the cache + * is hot and we take the minimum delta from all of the runs. + * That is to say that we're biased towards measuring the minimum + * number of TSC ticks that occur while waiting for the timer to + * expire. That theoretically helps avoid inconsistencies when + * running under a VM if the TSC is not virtualized and the host + * steals time. The TSC is normally virtualized for VMware. + */ + for(i = 0; i < 10; ++i) + { + enable_PIT2(); + set_PIT2_mode0(CALIBRATE_LATCH); + tscStart = rdtsc64(); + pollCount = poll_PIT2_gate(); + tscEnd = rdtsc64(); + /* The poll loop must have run at least a few times for accuracy */ + if (pollCount <= 1) + continue; + /* The TSC must increment at LEAST once every millisecond. + * We should have waited exactly 30 msec so the TSC delta should + * be >= 30. Anything less and the processor is way too slow. + */ + if ((tscEnd - tscStart) <= CALIBRATE_TIME_MSEC) + continue; + // tscDelta = MIN(tscDelta, (tscEnd - tscStart)) + if ( (tscEnd - tscStart) < tscDelta ) + tscDelta = tscEnd - tscStart; + } + /* tscDelta is now the least number of TSC ticks the processor made in + * a timespan of 0.03 s (e.g. 30 milliseconds) + * Linux thus divides by 30 which gives the answer in kiloHertz because + * 1 / ms = kHz. But we're xnu and most of the rest of the code uses + * Hz so we need to convert our milliseconds to seconds. Since we're + * dividing by the milliseconds, we simply multiply by 1000. + */ + + /* Unlike linux, we're not limited to 32-bit, but we do need to take care + * that we're going to multiply by 1000 first so we do need at least some + * arithmetic headroom. For now, 32-bit should be enough. + * Also unlike Linux, our compiler can do 64-bit integer arithmetic. + */ + if (tscDelta > (1ULL<<32)) + retval = 0; + else + { + retval = tscDelta * 1000 / 30; + } + disable_PIT2(); + return retval; +} + +/* + * Original comment/code: + * "DFE: Measures the Max Performance Frequency in Hz (64-bit)" + * + * Measures the Actual Performance Frequency in Hz (64-bit) + * (just a naming change, mperf --> aperf ) + */ +static uint64_t measure_aperf_frequency(void) +{ + uint64_t aperfStart; + uint64_t aperfEnd; + uint64_t aperfDelta = 0xffffffffffffffffULL; + unsigned long pollCount; + uint64_t retval = 0; + int i; + + /* Time how many APERF ticks elapse in 30 msec using the 8254 PIT + * counter 2. We run this loop 3 times to make sure the cache + * is hot and we take the minimum delta from all of the runs. + * That is to say that we're biased towards measuring the minimum + * number of APERF ticks that occur while waiting for the timer to + * expire. + */ + for(i = 0; i < 10; ++i) + { + enable_PIT2(); + set_PIT2_mode0(CALIBRATE_LATCH); + aperfStart = rdmsr64(MSR_AMD_APERF); + pollCount = poll_PIT2_gate(); + aperfEnd = rdmsr64(MSR_AMD_APERF); + /* The poll loop must have run at least a few times for accuracy */ + if (pollCount <= 1) + continue; + /* The TSC must increment at LEAST once every millisecond. + * We should have waited exactly 30 msec so the APERF delta should + * be >= 30. Anything less and the processor is way too slow. + */ + if ((aperfEnd - aperfStart) <= CALIBRATE_TIME_MSEC) + continue; + // tscDelta = MIN(tscDelta, (tscEnd - tscStart)) + if ( (aperfEnd - aperfStart) < aperfDelta ) + aperfDelta = aperfEnd - aperfStart; + } + /* mperfDelta is now the least number of MPERF ticks the processor made in + * a timespan of 0.03 s (e.g. 30 milliseconds) + */ + + if (aperfDelta > (1ULL<<32)) + retval = 0; + else + { + retval = aperfDelta * 1000 / 30; + } + disable_PIT2(); + return retval; +} + +/* + * Calculates the FSB and CPU frequencies using specific MSRs for each CPU + * - multi. is read from a specific MSR. In the case of Intel, there is: + * a max multi. (used to calculate the FSB freq.), + * and a current multi. (used to calculate the CPU freq.) + * - fsbFrequency = tscFrequency / multi + * - cpuFrequency = fsbFrequency * multi + */ +void scan_cpu(PlatformInfo_t *p) +{ + uint64_t tscFrequency = 0; + uint64_t fsbFrequency = 0; + uint64_t cpuFrequency =0; + uint64_t msr = 0; + uint64_t flex_ratio = 0; + uint32_t max_ratio = 0; + uint32_t min_ratio = 0; + uint8_t bus_ratio_max = 0; + uint8_t bus_ratio_min = 0; + uint8_t currdiv = 0; + uint8_t currcoef = 0; + uint8_t maxdiv = 0; + uint8_t maxcoef = 0; + + const char *newratio; + int len = 0; + + /* get cpuid values */ + do_cpuid(0x00000000, p->CPU.CPUID[CPUID_0]); + do_cpuid(0x00000001, p->CPU.CPUID[CPUID_1]); + do_cpuid(0x00000002, p->CPU.CPUID[CPUID_2]); + do_cpuid(0x00000003, p->CPU.CPUID[CPUID_3]); + do_cpuid2(0x00000004, 0, p->CPU.CPUID[CPUID_4]); + do_cpuid(0x80000000, p->CPU.CPUID[CPUID_80]); + if (p->CPU.CPUID[CPUID_0][0] >= 0x5) { + do_cpuid(5, p->CPU.CPUID[CPUID_5]); + } + if (p->CPU.CPUID[CPUID_0][0] >= 6) { + do_cpuid(6, p->CPU.CPUID[CPUID_6]); + } + if ((p->CPU.CPUID[CPUID_80][0] & 0x0000000f) >= 8) { + do_cpuid(0x80000008, p->CPU.CPUID[CPUID_88]); + do_cpuid(0x80000001, p->CPU.CPUID[CPUID_81]); + } + else if ((p->CPU.CPUID[CPUID_80][0] & 0x0000000f) >= 1) { + do_cpuid(0x80000001, p->CPU.CPUID[CPUID_81]); + } + +#if DEBUG_CPU + { + int i; + printf("CPUID Raw Values:\n"); + for (i=0; i<CPUID_MAX; i++) { + printf("%02d: %08x-%08x-%08x-%08x\n", i, + p->CPU.CPUID[i][0], p->CPU.CPUID[i][1], + p->CPU.CPUID[i][2], p->CPU.CPUID[i][3]); + } + } +#endif + + p->CPU.Vendor = p->CPU.CPUID[CPUID_0][1]; + p->CPU.Signature = p->CPU.CPUID[CPUID_1][0]; + p->CPU.Stepping = bitfield(p->CPU.CPUID[CPUID_1][0], 3, 0); + p->CPU.Model = bitfield(p->CPU.CPUID[CPUID_1][0], 7, 4); + p->CPU.Family = bitfield(p->CPU.CPUID[CPUID_1][0], 11, 8); + p->CPU.ExtModel = bitfield(p->CPU.CPUID[CPUID_1][0], 19, 16); + p->CPU.ExtFamily = bitfield(p->CPU.CPUID[CPUID_1][0], 27, 20); + + p->CPU.Model += (p->CPU.ExtModel << 4); + + if (p->CPU.Vendor == CPUID_VENDOR_INTEL && + p->CPU.Family == 0x06 && + p->CPU.Model >= CPU_MODEL_NEHALEM && + p->CPU.Model != CPU_MODEL_ATOM // MSR is *NOT* available on the Intel Atom CPU + ) + { + msr = rdmsr64(MSR_CORE_THREAD_COUNT); // Undocumented MSR in Nehalem and newer CPUs + p->CPU.NoCores = bitfield((uint32_t)msr, 31, 16); // Using undocumented MSR to get actual values + p->CPU.NoThreads = bitfield((uint32_t)msr, 15, 0); // Using undocumented MSR to get actual values + } + else if (p->CPU.Vendor == CPUID_VENDOR_AMD) + { + p->CPU.NoThreads = bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16); + p->CPU.NoCores = bitfield(p->CPU.CPUID[CPUID_88][2], 7, 0) + 1; + } + else + { + // Use previous method for Cores and Threads + p->CPU.NoThreads = bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16); + p->CPU.NoCores = bitfield(p->CPU.CPUID[CPUID_4][0], 31, 26) + 1; + } + + /* get brand string (if supported) */ + /* Copyright: from Apple's XNU cpuid.c */ + if (p->CPU.CPUID[CPUID_80][0] > 0x80000004) { + uint32_t reg[4]; + char str[128], *s; + /* + * The brand string 48 bytes (max), guaranteed to + * be NULL terminated. + */ + do_cpuid(0x80000002, reg); + bcopy((char *)reg, &str[0], 16); + do_cpuid(0x80000003, reg); + bcopy((char *)reg, &str[16], 16); + do_cpuid(0x80000004, reg); + bcopy((char *)reg, &str[32], 16); + for (s = str; *s != '\0'; s++) { + if (*s != ' ') break; + } + + strlcpy(p->CPU.BrandString, s, sizeof(p->CPU.BrandString)); + + if (!strncmp(p->CPU.BrandString, CPU_STRING_UNKNOWN, MIN(sizeof(p->CPU.BrandString), strlen(CPU_STRING_UNKNOWN) + 1))) { + /* + * This string means we have a firmware-programmable brand string, + * and the firmware couldn't figure out what sort of CPU we have. + */ + p->CPU.BrandString[0] = '\0'; + } + } + + /* setup features */ + if ((bit(23) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_MMX; + } + if ((bit(25) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE; + } + if ((bit(26) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE2; + } + if ((bit(0) & p->CPU.CPUID[CPUID_1][2]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE3; + } + if ((bit(19) & p->CPU.CPUID[CPUID_1][2]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE41; + } + if ((bit(20) & p->CPU.CPUID[CPUID_1][2]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE42; + } + if ((bit(29) & p->CPU.CPUID[CPUID_81][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_EM64T; + } + if ((bit(5) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_MSR; + } + //if ((bit(28) & p->CPU.CPUID[CPUID_1][3]) != 0) { + if (p->CPU.NoThreads > p->CPU.NoCores) { + p->CPU.Features |= CPU_FEATURE_HTT; + } + + tscFrequency = measure_tsc_frequency(); +// /* if usual method failed */ +// if ( tscFrequency < 1000 ) +// { +// tscFrequency = timeRDTSC() * 20; +// } +// fsbFrequency = 0; +// cpuFrequency = 0; + + if ((p->CPU.Vendor == CPUID_VENDOR_INTEL) && ((p->CPU.Family == 0x06) || (p->CPU.Family == 0x0f))) { + int intelCPU = p->CPU.Model; + if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0c) || (p->CPU.Family == 0x0f && p->CPU.Model >= 0x03)) { + /* Nehalem CPU model */ + if (p->CPU.Family == 0x06 && (p->CPU.Model == CPU_MODEL_NEHALEM || + p->CPU.Model == CPU_MODEL_FIELDS || + p->CPU.Model == CPU_MODEL_DALES || + p->CPU.Model == CPU_MODEL_DALES_32NM || + p->CPU.Model == CPU_MODEL_WESTMERE || + p->CPU.Model == CPU_MODEL_NEHALEM_EX || + p->CPU.Model == CPU_MODEL_WESTMERE_EX || + p->CPU.Model == CPU_MODEL_SANDYBRIDGE || + p->CPU.Model == CPU_MODEL_JAKETOWN || + p->CPU.Model == CPU_MODEL_IVYBRIDGE || + p->CPU.Model == CPU_MODEL_HASWELL )){ + msr = rdmsr64(MSR_PLATFORM_INFO); +// DBG("msr(%d): platform_info %08x\n", __LINE__, bitfield(msr, 31, 0)); + bus_ratio_max = bitfield(msr, 15, 8); //MacMan: Changed bitfield to match Apple tsc.c + bus_ratio_min = bitfield(msr, 47, 40); //MacMan: Changed bitfield to match Apple tsc.c + msr = rdmsr64(MSR_FLEX_RATIO); +// DBG("msr(%d): flex_ratio %08x\n", __LINE__, bitfield(msr, 31, 0)); + if (bitfield(msr, 16, 16)) { + flex_ratio = bitfield(msr, 15, 8); //MacMan: Changed bitfield to match Apple tsc.c + if (flex_ratio == 0) { + /* Clear bit 16 (evidently the presence bit) */ + wrmsr64(MSR_FLEX_RATIO, (msr & 0xFFFFFFFFFFFEFFFFULL)); + msr = rdmsr64(MSR_FLEX_RATIO); +// verbose("Unusable flex ratio detected. Patched MSR now %08x\n", bitfield(msr, 31, 0)); + } else { + if (bus_ratio_max > flex_ratio) { + bus_ratio_max = flex_ratio; + } + } + } + + if (bus_ratio_max) { + fsbFrequency = (tscFrequency / bus_ratio_max); + } + //MacMan: Turbo Ratio Limit + switch (intelCPU) + { + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65xx + { + cpuFrequency = tscFrequency; + DBG("cpu.c (%d)CPU_MODEL_NEHALEM_EX or CPU_MODEL_WESTMERE_EX Found\n", __LINE__); + break; + } + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1050 (22nm) + { + msr = rdmsr64(MSR_IA32_PERF_STATUS); + currcoef = bitfield(msr, 15, 8); + cpuFrequency = currcoef * fsbFrequency; + maxcoef = bus_ratio_max; + break; + } + default: + { + msr = rdmsr64(MSR_IA32_PERF_STATUS); + currcoef = bitfield(msr, 7, 0); + cpuFrequency = currcoef * fsbFrequency; + maxcoef = bus_ratio_max; + break; + } + } + + if ((getValueForKey(kbusratio, &newratio, &len, &bootInfo->chameleonConfig)) && (len <= 4)) { + max_ratio = atoi(newratio); + max_ratio = (max_ratio * 10); + if (len >= 3) max_ratio = (max_ratio + 5); + + verbose("Bus-Ratio: min=%d, max=%s\n", bus_ratio_min, newratio); + + // extreme overclockers may love 320 ;) + if ((max_ratio >= min_ratio) && (max_ratio <= 320)) { + cpuFrequency = (fsbFrequency * max_ratio) / 10; + if (len >= 3) maxdiv = 1; + else maxdiv = 0; + } else { + max_ratio = (bus_ratio_max * 10); + } + } + p->CPU.MaxRatio = bus_ratio_max; + p->CPU.MinRatio = bus_ratio_min; + } else { + msr = rdmsr64(MSR_IA32_PERF_STATUS); + DBG("msr(%d): ia32_perf_stat 0x%08x\n", __LINE__, bitfield(msr, 31, 0)); + currcoef = bitfield(msr, 12, 8); + /* Non-integer bus ratio for the max-multi*/ + maxdiv = bitfield(msr, 46, 46); + /* Non-integer bus ratio for the current-multi (undocumented)*/ + currdiv = bitfield(msr, 14, 14); + + // This will always be model >= 3 + if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0e) || (p->CPU.Family == 0x0f)) + { + /* On these models, maxcoef defines TSC freq */ + maxcoef = bitfield(msr, 44, 40); + } else { + /* On lower models, currcoef defines TSC freq */ + /* XXX */ + maxcoef = currcoef; + } + + if (maxcoef) { + if (maxdiv) { + fsbFrequency = ((tscFrequency * 2) / ((maxcoef * 2) + 1)); + } else { + fsbFrequency = (tscFrequency / maxcoef); + } + if (currdiv) { + cpuFrequency = (fsbFrequency * ((currcoef * 2) + 1) / 2); + } else { + cpuFrequency = (fsbFrequency * currcoef); + } + DBG("max: %d%s current: %d%s\n", maxcoef, maxdiv ? ".5" : "",currcoef, currdiv ? ".5" : ""); + } + } + } + /* Mobile CPU */ + if (rdmsr64(MSR_IA32_PLATFORM_ID) & (1<<28)) { + p->CPU.Features |= CPU_FEATURE_MOBILE; + } + } + else if ((p->CPU.Vendor == CPUID_VENDOR_AMD) && (p->CPU.Family == 0x0f)) + { + switch(p->CPU.ExtFamily) + { + case 0x00: /* K8 */ + msr = rdmsr64(K8_FIDVID_STATUS); + maxcoef = bitfield(msr, 21, 16) / 2 + 4; + currcoef = bitfield(msr, 5, 0) / 2 + 4; + break; + + case 0x01: /* K10 */ + msr = rdmsr64(K10_COFVID_STATUS); + do_cpuid2(0x00000006, 0, p->CPU.CPUID[CPUID_6]); + // EffFreq: effective frequency interface + if (bitfield(p->CPU.CPUID[CPUID_6][2], 0, 0) == 1) + { + //uint64_t mperf = measure_mperf_frequency(); + uint64_t aperf = measure_aperf_frequency(); + cpuFrequency = aperf; + } + // NOTE: tsc runs at the maccoeff (non turbo) + // *not* at the turbo frequency. + maxcoef = bitfield(msr, 54, 49) / 2 + 4; + currcoef = bitfield(msr, 5, 0) + 0x10; + currdiv = 2 << bitfield(msr, 8, 6); + + break; + + case 0x05: /* K14 */ + msr = rdmsr64(K10_COFVID_STATUS); + currcoef = (bitfield(msr, 54, 49) + 0x10) << 2; + currdiv = (bitfield(msr, 8, 4) + 1) << 2; + currdiv += bitfield(msr, 3, 0); + + break; + + case 0x02: /* K11 */ + // not implimented + break; + } + + if (maxcoef) + { + if (currdiv) + { + if (!currcoef) currcoef = maxcoef; + if (!cpuFrequency) + fsbFrequency = ((tscFrequency * currdiv) / currcoef); + else + fsbFrequency = ((cpuFrequency * currdiv) / currcoef); + + DBG("%d.%d\n", currcoef / currdiv, ((currcoef % currdiv) * 100) / currdiv); + } else { + if (!cpuFrequency) + fsbFrequency = (tscFrequency / maxcoef); + else + fsbFrequency = (cpuFrequency / maxcoef); + DBG("%d\n", currcoef); + } + } + else if (currcoef) + { + if (currdiv) + { + fsbFrequency = ((tscFrequency * currdiv) / currcoef); + DBG("%d.%d\n", currcoef / currdiv, ((currcoef % currdiv) * 100) / currdiv); + } else { + fsbFrequency = (tscFrequency / currcoef); + DBG("%d\n", currcoef); + } + } + if (!cpuFrequency) cpuFrequency = tscFrequency; + } + +#if 0 + if (!fsbFrequency) { + fsbFrequency = (DEFAULT_FSB * 1000); + cpuFrequency = tscFrequency; + DBG("0 ! using the default value for FSB !\n"); + } +#endif + + p->CPU.MaxCoef = maxcoef; + if (maxdiv == 0){ + p->CPU.MaxDiv = bus_ratio_max; + } + else { + p->CPU.MaxDiv = maxdiv; + } + p->CPU.CurrCoef = currcoef; + if (currdiv == 0){ + p->CPU.CurrDiv = currcoef; + } + else { + p->CPU.CurrDiv = currdiv; + } + p->CPU.TSCFrequency = tscFrequency; + p->CPU.FSBFrequency = fsbFrequency; + p->CPU.CPUFrequency = cpuFrequency; + + // keep formatted with spaces instead of tabs + DBG("CPU: Brand String: %s\n", p->CPU.BrandString); + DBG("CPU: Vendor: 0x%x\n", p->CPU.Vendor); + DBG("CPU: Family / ExtFamily: 0x%x / 0x%x\n", p->CPU.Family, p->CPU.ExtFamily); + DBG("CPU: Model / ExtModel / Stepping: 0x%x / 0x%x / 0x%x\n", p->CPU.Model, p->CPU.ExtModel, p->CPU.Stepping); + DBG("CPU: Number of Cores / Threads: %d / %d\n", p->CPU.NoCores, p->CPU.NoThreads); + DBG("CPU: Features: 0x%08x\n", p->CPU.Features); + DBG("CPU: TSC Frequency: %d MHz\n", p->CPU.TSCFrequency / 1000000); + DBG("CPU: FSB Frequency: %d MHz\n", p->CPU.FSBFrequency / 1000000); + DBG("CPU: CPU Frequency: %d MHz\n", p->CPU.CPUFrequency / 1000000); + DBG("CPU: Minimum Bus Ratio: %d\n", p->CPU.MinRatio); + DBG("CPU: Maximum Bus Ratio: %d\n", p->CPU.MaxRatio); + DBG("CPU: Current Bus Ratio: %d\n", p->CPU.CurrCoef); +// DBG("CPU: Maximum Multiplier: %d\n", p->CPU.MaxCoef); +// DBG("CPU: Maximum Divider: %d\n", p->CPU.MaxDiv); +// DBG("CPU: Current Divider: %d\n", p->CPU.CurrDiv); + +#if DEBUG_CPU + pause(); +#endif +} diff --git a/i386/libsaio/.svn/text-base/cpu.h.svn-base b/i386/libsaio/.svn/text-base/cpu.h.svn-base new file mode 100644 index 0000000..0b72454 --- /dev/null +++ b/i386/libsaio/.svn/text-base/cpu.h.svn-base @@ -0,0 +1,217 @@ +/* + * Copyright 2008 Islam Ahmed Zaid. All rights reserved. <azismed@gmail.com> + * AsereBLN: 2009: cleanup and bugfix + */ + +#ifndef __LIBSAIO_CPU_H +#define __LIBSAIO_CPU_H + +//#include "libsaio.h" + +extern void scan_cpu(PlatformInfo_t *); + +#define bit(n) (1ULL << (n)) +#define bitmask(h,l) ((bit(h)|(bit(h)-1)) & ~(bit(l)-1)) +#define bitfield(x,h,l) (((x) & bitmask(h,l)) >> l) + +#define CPU_STRING_UNKNOWN "Unknown CPU Type" + +#define MSR_CORE_THREAD_COUNT 0x35 // Undocumented. Nehalem and newer only +#define MSR_FLEX_RATIO 0x194 // Undocumented. +#define MSR_IA32_EXT_CONFIG 0xEE // Undocumented. Core Solo and Core Duo only +#define MSR_PKG_CST_CONFIG_CTL 0xE2 +#define MSR_IA32_PERF_STATUS 0x198 +#define MSR_IA32_PERF_CONTROL 0x199 +#define MSR_IA32_PLATFORM_ID 0x17 +#define MSR_PLATFORM_INFO 0xCE +#define MSR_TURBO_RATIO_LIMIT 0x1AD + +#define K8_FIDVID_STATUS 0xC0010042 +#define K10_COFVID_STATUS 0xC0010071 + +#define MSR_AMD_MPERF 0x000000E7 +#define MSR_AMD_APERF 0x000000E8 + +#define DEFAULT_FSB 100000 /* for now, hardcoding 100MHz for old CPUs */ + +// DFE: This constant comes from older xnu: +#define CLKNUM 1193182 /* formerly 1193167 */ + +// DFE: These two constants come from Linux except CLOCK_TICK_RATE replaced with CLKNUM +#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ +#define CALIBRATE_LATCH ((CLKNUM * CALIBRATE_TIME_MSEC + 1000/2)/1000) + +static inline uint64_t rdtsc64(void) +{ + uint64_t ret; + __asm__ volatile("rdtsc" : "=A" (ret)); + return ret; +} + +static inline uint64_t rdmsr64(uint32_t msr) +{ + uint64_t ret; + __asm__ volatile("rdmsr" : "=A" (ret) : "c" (msr)); + return ret; +} + +static inline void wrmsr64(uint32_t msr, uint64_t val) +{ + __asm__ volatile("wrmsr" : : "c" (msr), "A" (val)); +} + +static inline void intel_waitforsts(void) { + uint32_t inline_timeout = 100000; + while (rdmsr64(MSR_IA32_PERF_STATUS) & (1 << 21)) { if (!inline_timeout--) break; } +} + +static inline void do_cpuid(uint32_t selector, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a" (selector)); +} + +static inline void do_cpuid2(uint32_t selector, uint32_t selector2, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a" (selector), "c" (selector2)); +} + +// DFE: enable_PIT2 and disable_PIT2 come from older xnu + +/* + * Enable or disable timer 2. + * Port 0x61 controls timer 2: + * bit 0 gates the clock, + * bit 1 gates output to speaker. + */ +static inline void enable_PIT2(void) +{ + /* Enable gate, disable speaker */ + __asm__ volatile( + " inb $0x61,%%al \n\t" + " and $0xFC,%%al \n\t" /* & ~0x03 */ + " or $1,%%al \n\t" + " outb %%al,$0x61 \n\t" + : : : "%al" ); +} + +static inline void disable_PIT2(void) +{ + /* Disable gate and output to speaker */ + __asm__ volatile( + " inb $0x61,%%al \n\t" + " and $0xFC,%%al \n\t" /* & ~0x03 */ + " outb %%al,$0x61 \n\t" + : : : "%al" ); +} + +// DFE: set_PIT2_mode0, poll_PIT2_gate, and measure_tsc_frequency are +// roughly based on Linux code + +/* Set the 8254 channel 2 to mode 0 with the specified value. + In mode 0, the counter will initially set its gate low when the + timer expires. For this to be useful, you ought to set it high + before calling this function. The enable_PIT2 function does this. + */ +static inline void set_PIT2_mode0(uint16_t value) +{ + __asm__ volatile( + " movb $0xB0,%%al \n\t" + " outb %%al,$0x43 \n\t" + " movb %%dl,%%al \n\t" + " outb %%al,$0x42 \n\t" + " movb %%dh,%%al \n\t" + " outb %%al,$0x42" + : : "d"(value) /*: no clobber */ ); +} + +/* Returns the number of times the loop ran before the PIT2 signaled */ +static inline unsigned long poll_PIT2_gate(void) +{ + unsigned long count = 0; + unsigned char nmi_sc_val; + do { + ++count; + __asm__ volatile( + "inb $0x61,%0" + : "=q"(nmi_sc_val) /*:*/ /* no input */ /*:*/ /* no clobber */); + } while( (nmi_sc_val & 0x20) == 0); + return count; +} + + +inline static void +set_PIT2(int value) +{ +/* + * First, tell the clock we are going to write 16 bits to the counter + * and enable one-shot mode (command 0xB8 to port 0x43) + * Then write the two bytes into the PIT2 clock register (port 0x42). + * Loop until the value is "realized" in the clock, + * this happens on the next tick. + */ + asm volatile( + " movb $0xB8,%%al \n\t" + " outb %%al,$0x43 \n\t" + " movb %%dl,%%al \n\t" + " outb %%al,$0x42 \n\t" + " movb %%dh,%%al \n\t" + " outb %%al,$0x42 \n" +"1: inb $0x42,%%al \n\t" + " inb $0x42,%%al \n\t" + " cmp %%al,%%dh \n\t" + " jne 1b" + : : "d"(value) : "%al"); +} + + +inline static uint64_t +get_PIT2(unsigned int *value) +{ + register uint64_t result; +/* + * This routine first latches the time (command 0x80 to port 0x43), + * then gets the time stamp so we know how long the read will take later. + * Read (from port 0x42) and return the current value of the timer. + */ +#ifdef __i386__ + asm volatile( + " xorl %%ecx,%%ecx \n\t" + " movb $0x80,%%al \n\t" + " outb %%al,$0x43 \n\t" + " rdtsc \n\t" + " pushl %%eax \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%cl \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%ch \n\t" + " popl %%eax " + : "=A"(result), "=c"(*value)); +#else /* __x86_64__ */ + asm volatile( + " xorq %%rcx,%%rcx \n\t" + " movb $0x80,%%al \n\t" + " outb %%al,$0x43 \n\t" + " rdtsc \n\t" + " pushq %%rax \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%cl \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%ch \n\t" + " popq %%rax " + : "=A"(result), "=c"(*value)); +#endif + + return result; +} + +#endif /* !__LIBSAIO_CPU_H */ diff --git a/i386/libsaio/.svn/text-base/device_inject.c.svn-base b/i386/libsaio/.svn/text-base/device_inject.c.svn-base new file mode 100644 index 0000000..895fd1a --- /dev/null +++ b/i386/libsaio/.svn/text-base/device_inject.c.svn-base @@ -0,0 +1,360 @@ +/* + * Copyright 2009 Jasmin Fazlic All rights reserved. + */ +/* + * Cleaned and merged by iNDi + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "pci_root.h" +#include "device_inject.h" +#include "convert.h" + +#ifndef DEBUG_INJECT +#define DEBUG_INJECT 0 +#endif + +#if DEBUG_INJECT +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +uint32_t devices_number = 1; +uint32_t builtin_set = 0; +struct DevPropString *string = 0; +uint8_t *stringdata = 0; +uint32_t stringlength = 0; + +char *efi_inject_get_devprop_string(uint32_t *len) +{ + if(string) { + *len = string->length; + return devprop_generate_string(string); + } + verbose("efi_inject_get_devprop_string NULL trying stringdata\n"); + return NULL; +} + +void setupDeviceProperties(Node *node) +{ + const char *val; + uint8_t *binStr; + int cnt, cnt2; + + static char DEVICE_PROPERTIES_PROP[] = "device-properties"; + + /* Generate devprop string. + */ + uint32_t strlength; + char *string = efi_inject_get_devprop_string(&strlength); + + /* Use the static "device-properties" boot config key contents if available, + * otheriwse use the generated one. + */ + if (!getValueForKey(kDeviceProperties, &val, &cnt, &bootInfo->chameleonConfig) && string) + { + val = (const char*)string; + cnt = strlength * 2; + } + + if (cnt > 1) + { + binStr = convertHexStr2Binary(val, &cnt2); + if (cnt2 > 0) DT__AddProperty(node, DEVICE_PROPERTIES_PROP, cnt2, binStr); + } +} + +struct DevPropString *devprop_create_string(void) +{ + string = (struct DevPropString*)malloc(sizeof(struct DevPropString)); + + if(string == NULL) + return NULL; + + memset(string, 0, sizeof(struct DevPropString)); + string->length = 12; + string->WHAT2 = 0x01000000; + return string; +} + +struct DevPropDevice *devprop_add_device(struct DevPropString *string, char *path) +{ + struct DevPropDevice *device; + const char pciroot_string[] = "PciRoot(0x"; + const char pci_device_string[] = "Pci(0x"; + + if (string == NULL || path == NULL) { + return NULL; + } + device = malloc(sizeof(struct DevPropDevice)); + + if (strncmp(path, pciroot_string, strlen(pciroot_string))) { + printf("ERROR parsing device path\n"); + return NULL; + } + + memset(device, 0, sizeof(struct DevPropDevice)); + device->acpi_dev_path._UID = getPciRootUID(); + + int numpaths = 0; + int x, curr = 0; + char buff[] = "00"; + + for (x = 0; x < strlen(path); x++) { + if (!strncmp(&path[x], pci_device_string, strlen(pci_device_string))) { + x+=strlen(pci_device_string); + curr=x; + while(path[++x] != ','); + if(x-curr == 2) + sprintf(buff, "%c%c", path[curr], path[curr+1]); + else if(x-curr == 1) + sprintf(buff, "%c", path[curr]); + else + { + printf("ERROR parsing device path\n"); + numpaths = 0; + break; + } + device->pci_dev_path[numpaths].device = ascii_hex_to_int(buff); + + x += 3; // 0x + curr = x; + while(path[++x] != ')'); + if(x-curr == 2) + sprintf(buff, "%c%c", path[curr], path[curr+1]); + else if(x-curr == 1) + sprintf(buff, "%c", path[curr]); + else + { + printf("ERROR parsing device path\n"); + numpaths = 0; + break; + } + device->pci_dev_path[numpaths].function = ascii_hex_to_int(buff); // TODO: find dev from char *path + + numpaths++; + } + } + + if(!numpaths) + return NULL; + + device->numentries = 0x00; + + device->acpi_dev_path.length = 0x0c; + device->acpi_dev_path.type = 0x02; + device->acpi_dev_path.subtype = 0x01; + device->acpi_dev_path._HID = 0xd041030a; + + device->num_pci_devpaths = numpaths; + device->length = 24 + (6*numpaths); + + int i; + + for(i = 0; i < numpaths; i++) + { + device->pci_dev_path[i].length = 0x06; + device->pci_dev_path[i].type = 0x01; + device->pci_dev_path[i].subtype = 0x01; + } + + device->path_end.length = 0x04; + device->path_end.type = 0x7f; + device->path_end.subtype = 0xff; + + device->string = string; + device->data = NULL; + string->length += device->length; + + if(!string->entries) + if((string->entries = (struct DevPropDevice**)malloc(sizeof(device)*DEV_PROP_DEVICE_MAX_ENTRIES))== NULL) + return 0; + + string->entries[string->numentries++] = (struct DevPropDevice*)malloc(sizeof(device)); + string->entries[string->numentries-1] = device; + + return device; +} + +int devprop_add_value(struct DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len) +{ + + if(!nm || !vl || !len) + return 0; + + uint32_t length = ((strlen(nm) * 2) + len + (2 * sizeof(uint32_t)) + 2); + uint8_t *data = (uint8_t*)malloc(length); + { + if(!data) + return 0; + + memset(data, 0, length); + uint32_t off= 0; + data[off+1] = ((strlen(nm) * 2) + 6) >> 8; + data[off] = ((strlen(nm) * 2) + 6) & 0x00FF; + + off += 4; + uint32_t i=0, l = strlen(nm); + for(i = 0 ; i < l ; i++, off += 2) + { + data[off] = *nm++; + } + + off += 2; + l = len; + uint32_t *datalength = (uint32_t*)&data[off]; + *datalength = l + 4; + off += 4; + for(i = 0 ; i < l ; i++, off++) + { + data[off] = *vl++; + } + } + + uint32_t offset = device->length - (24 + (6 * device->num_pci_devpaths)); + + uint8_t *newdata = (uint8_t*)malloc((length + offset)); + if(!newdata) + return 0; + if(device->data) + if(offset > 1) + memcpy(newdata, device->data, offset); + + memcpy(newdata + offset, data, length); + + device->length += length; + device->string->length += length; + device->numentries++; + + if(!device->data) + device->data = (uint8_t*)malloc(sizeof(uint8_t)); + else + free(device->data); + + free(data); + device->data = newdata; + + return 1; +} + +char *devprop_generate_string(struct DevPropString *string) +{ + char *buffer = (char*)malloc(string->length * 2); + char *ptr = buffer; + + if(!buffer) + return NULL; + + sprintf(buffer, "%08x%08x%04x%04x", dp_swap32(string->length), string->WHAT2, + dp_swap16(string->numentries), string->WHAT3); + buffer += 24; + int i = 0, x = 0; + + while(i < string->numentries) + { + sprintf(buffer, "%08x%04x%04x", dp_swap32(string->entries[i]->length), + dp_swap16(string->entries[i]->numentries), string->entries[i]->WHAT2); + + buffer += 16; + sprintf(buffer, "%02x%02x%04x%08x%08x", string->entries[i]->acpi_dev_path.type, + string->entries[i]->acpi_dev_path.subtype, + dp_swap16(string->entries[i]->acpi_dev_path.length), + string->entries[i]->acpi_dev_path._HID, + dp_swap32(string->entries[i]->acpi_dev_path._UID)); + + buffer += 24; + for(x=0;x < string->entries[i]->num_pci_devpaths; x++) + { + sprintf(buffer, "%02x%02x%04x%02x%02x", string->entries[i]->pci_dev_path[x].type, + string->entries[i]->pci_dev_path[x].subtype, + dp_swap16(string->entries[i]->pci_dev_path[x].length), + string->entries[i]->pci_dev_path[x].function, + string->entries[i]->pci_dev_path[x].device); + buffer += 12; + } + + sprintf(buffer, "%02x%02x%04x", string->entries[i]->path_end.type, + string->entries[i]->path_end.subtype, + dp_swap16(string->entries[i]->path_end.length)); + + buffer += 8; + uint8_t *dataptr = string->entries[i]->data; + for(x = 0; x < (string->entries[i]->length) - (24 + (6 * string->entries[i]->num_pci_devpaths)) ; x++) + { + sprintf(buffer, "%02x", *dataptr++); + buffer += 2; + } + i++; + } + return ptr; +} + +void devprop_free_string(struct DevPropString *string) +{ + if(!string) + return; + + int i; + for(i = 0; i < string->numentries; i++) + { + if(string->entries[i]) + { + if(string->entries[i]->data) + { + free(string->entries[i]->data); + string->entries[i]->data = NULL; + } + free(string->entries[i]); + string->entries[i] = NULL; + } + } + + free(string); + string = NULL; +} + +/* a fine place for this code */ + +int devprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id) +{ + if(!device) + return 0; + uint8_t builtin = 0x0; + if((vendor_id != 0x168c) && (builtin_set == 0)) + { + builtin_set = 1; + builtin = 0x01; + } + if(!devprop_add_value(device, "built-in", (uint8_t*)&builtin, 1)) + return 0; + devices_number++; + return 1; +} + +void set_eth_builtin(pci_dt_t *eth_dev) +{ + char *devicepath = get_pci_dev_path(eth_dev); + struct DevPropDevice *device = (struct DevPropDevice*)malloc(sizeof(struct DevPropDevice)); + + verbose("LAN Controller [%04x:%04x] :: %s\n", eth_dev->vendor_id, eth_dev->device_id, devicepath); + + if (!string) + string = devprop_create_string(); + + device = devprop_add_device(string, devicepath); + if(device) + { + verbose("Setting up lan keys\n"); + devprop_add_network_template(device, eth_dev->vendor_id); + stringdata = (uint8_t*)malloc(sizeof(uint8_t) * string->length); + if(stringdata) + { + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + } + } +} diff --git a/i386/libsaio/.svn/text-base/device_inject.h.svn-base b/i386/libsaio/.svn/text-base/device_inject.h.svn-base new file mode 100644 index 0000000..ade9996 --- /dev/null +++ b/i386/libsaio/.svn/text-base/device_inject.h.svn-base @@ -0,0 +1,75 @@ +/* + * Copyright 2009 Jasmin Fazlic All rights reserved. + */ +/* + * Cleaned and merged by iNDi + */ + +#ifndef __LIBSAIO_DEVICE_INJECT_H +#define __LIBSAIO_DEVICE_INJECT_H + +#define DP_ADD_TEMP_VAL(dev, val) devprop_add_value(dev, (char*)val[0], (uint8_t*)val[1], strlen(val[1]) + 1) +#define DP_ADD_TEMP_VAL_DATA(dev, val) devprop_add_value(dev, (char*)val.name, (uint8_t*)val.data, val.size) +#define MAX_PCI_DEV_PATHS 4 +#define DEV_PROP_DEVICE_MAX_ENTRIES 64 + +extern struct DevPropString *string; +extern uint8_t *stringdata; +extern uint32_t stringlength; + +extern void setupDeviceProperties(Node *node); + +struct ACPIDevPath { + uint8_t type; // = 2 ACPI device-path + uint8_t subtype; // = 1 ACPI Device-path + uint16_t length; // = 0x0c + uint32_t _HID; // = 0xD041030A ? + uint32_t _UID; // = 0x00000000 PCI ROOT +}; + +struct PCIDevPath { + uint8_t type; // = 1 Hardware device-path + uint8_t subtype; // = 1 PCI + uint16_t length; // = 6 + uint8_t function; // pci func number + uint8_t device; // pci dev number +}; + +struct DevicePathEnd { + uint8_t type; // = 0x7f + uint8_t subtype; // = 0xff + uint16_t length; // = 4; +}; + +struct DevPropDevice { + uint32_t length; + uint16_t numentries; + uint16_t WHAT2; // 0x0000 ? + struct ACPIDevPath acpi_dev_path; // = 0x02010c00 0xd041030a + struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS]; // = 0x01010600 func dev + struct DevicePathEnd path_end; // = 0x7fff0400 + uint8_t *data; + + // ------------------------ + uint8_t num_pci_devpaths; + struct DevPropString *string; + // ------------------------ +}; + +struct DevPropString { + uint32_t length; + uint32_t WHAT2; // 0x01000000 ? + uint16_t numentries; + uint16_t WHAT3; // 0x0000 ? + struct DevPropDevice **entries; +}; + +char *efi_inject_get_devprop_string(uint32_t *len); +int devprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id); +struct DevPropString *devprop_create_string(void); +struct DevPropDevice *devprop_add_device(struct DevPropString *string, char *path); +int devprop_add_value(struct DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len); +char *devprop_generate_string(struct DevPropString *string); +void devprop_free_string(struct DevPropString *string); + +#endif /* !__LIBSAIO_DEVICE_INJECT_H */ diff --git a/i386/libsaio/.svn/text-base/device_tree.c.svn-base b/i386/libsaio/.svn/text-base/device_tree.c.svn-base new file mode 100644 index 0000000..d17e384 --- /dev/null +++ b/i386/libsaio/.svn/text-base/device_tree.c.svn-base @@ -0,0 +1,540 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All Rights Reserved. + */ + +#if 1 +/* + + Structures for a Flattened Device Tree + */ + +#define kPropNameLength 32 + +typedef struct DeviceTreeNodeProperty { + char name[kPropNameLength]; // NUL terminated property name + unsigned long length; // Length (bytes) of folloing prop value + // unsigned long value[1]; // Variable length value of property + // Padded to a multiple of a longword? +} DeviceTreeNodeProperty; + +typedef struct OpaqueDTEntry { + unsigned long nProperties; // Number of props[] elements (0 => end) + unsigned long nChildren; // Number of children[] elements + // DeviceTreeNodeProperty props[];// array size == nProperties + // DeviceTreeNode children[]; // array size == nChildren +} DeviceTreeNode; + +typedef char DTPropertyNameBuf[32]; +/* Entry Name Definitions (Entry Names are C-Strings)*/ +enum { + kDTMaxEntryNameLength = 31 /* Max length of a C-String Entry Name (terminator not included) */ +}; + +/* length of DTEntryNameBuf = kDTMaxEntryNameLength +1*/ +typedef char DTEntryNameBuf[32]; +#endif + +#include "libsaio.h" +#include "device_tree.h" + +#if DEBUG +#define DPRINTF(args...) printf(args) +void +DT__PrintTree(Node *node); +#else +#define DPRINTF(args...) +#endif + + +#define RoundToLong(x) (((x) + 3) & ~3) + +static struct _DTSizeInfo { + uint32_t numNodes; + uint32_t numProperties; + uint32_t totalPropertySize; +} DTInfo; + +#define kAllocSize 4096 + +static Node *rootNode; + +static Node *freeNodes, *allocedNodes; +static Property *freeProperties, *allocedProperties; + +Property * +DT__AddProperty(Node *node, const char *name, uint32_t length, void *value) +{ + Property *prop; + + DPRINTF("DT__AddProperty([Node '%s'], '%s', %d, 0x%x)\n", DT__GetName(node), name, length, value); + if (freeProperties == NULL) { + void *buf = malloc(kAllocSize); + int i; + + DPRINTF("Allocating more free properties\n"); + if (buf == 0) return 0; + bzero(buf, kAllocSize); + // Use the first property to record the allocated buffer + // for later freeing. + prop = (Property *)buf; + prop->next = allocedProperties; + allocedProperties = prop; + prop->value = buf; + prop++; + for (i=1; i<(kAllocSize / sizeof(Property)); i++) { + prop->next = freeProperties; + freeProperties = prop; + prop++; + } + } + prop = freeProperties; + freeProperties = prop->next; + + prop->name = name; + prop->length = length; + prop->value = value; + + // Always add to end of list + if (node->properties == 0) { + node->properties = prop; + } else { + node->last_prop->next = prop; + } + node->last_prop = prop; + prop->next = 0; + + DPRINTF("Done [0x%x]\n", prop); + + DTInfo.numProperties++; + DTInfo.totalPropertySize += RoundToLong(length); + + return prop; +} + +Node * +DT__AddChild(Node *parent, const char *name) +{ + Node *node; + + if (freeNodes == NULL) { + void *buf = malloc(kAllocSize); + int i; + + DPRINTF("Allocating more free nodes\n"); + if (buf == 0) return 0; + bzero(buf, kAllocSize); + node = (Node *)buf; + // Use the first node to record the allocated buffer + // for later freeing. + node->next = allocedNodes; + allocedNodes = node; + node->children = (Node *)buf; + node++; + for (i=1; i<(kAllocSize / sizeof(Node)); i++) { + node->next = freeNodes; + freeNodes = node; + node++; + } + } + DPRINTF("DT__AddChild(0x%x, '%s')\n", parent, name); + node = freeNodes; + freeNodes = node->next; + DPRINTF("Got free node 0x%x\n", node); + DPRINTF("prop = 0x%x, children = 0x%x, next = 0x%x\n", node->properties, node->children, node->next); + + if (parent == NULL) { + rootNode = node; + node->next = 0; + } else { + node->next = parent->children; + parent->children = node; + } + DTInfo.numNodes++; + DT__AddProperty(node, "name", strlen(name) + 1, (void *) name); + return node; +} + +void +DT__FreeProperty(Property *prop) +{ + prop->next = freeProperties; + freeProperties = prop; +} +void +DT__FreeNode(Node *node) +{ + node->next = freeNodes; + freeNodes = node; +} + +void +DT__Initialize(void) +{ + DPRINTF("DT__Initialize\n"); + + freeNodes = 0; + allocedNodes = 0; + freeProperties = 0; + allocedProperties = 0; + + DTInfo.numNodes = 0; + DTInfo.numProperties = 0; + DTInfo.totalPropertySize = 0; + + rootNode = DT__AddChild(NULL, "/"); + DPRINTF("DT__Initialize done\n"); +} + +/* + * Free up memory used by in-memory representation + * of device tree. + */ +void +DT__Finalize(void) +{ + Node *node; + Property *prop; + + DPRINTF("DT__Finalize\n"); + for (prop = allocedProperties; prop != NULL; prop = prop->next) { + free(prop->value); + } + allocedProperties = NULL; + freeProperties = NULL; + + for (node = allocedNodes; node != NULL; node = node->next) { + free((void *)node->children); + } + allocedNodes = NULL; + freeNodes = NULL; + rootNode = NULL; + + // XXX leaks any created strings + + DTInfo.numNodes = 0; + DTInfo.numProperties = 0; + DTInfo.totalPropertySize = 0; +} + +static void * +FlattenNodes(Node *node, void *buffer) +{ + Property *prop; + DeviceTreeNode *flatNode; + DeviceTreeNodeProperty *flatProp; + int count; + + if (node == 0) return buffer; + + flatNode = (DeviceTreeNode *)buffer; + buffer += sizeof(DeviceTreeNode); + + for (count = 0, prop = node->properties; prop != 0; count++, prop = prop->next) { + flatProp = (DeviceTreeNodeProperty *)buffer; + strcpy(flatProp->name, prop->name); + flatProp->length = prop->length; + buffer += sizeof(DeviceTreeNodeProperty); + bcopy(prop->value, buffer, prop->length); + buffer += RoundToLong(prop->length); + } + flatNode->nProperties = count; + + for (count = 0, node = node->children; node != 0; count++, node = node->next) { + buffer = FlattenNodes(node, buffer); + } + flatNode->nChildren = count; + + return buffer; +} + +/* + * Flatten the in-memory representation of the device tree + * into a binary DT block. + * To get the buffer size needed, call with result = 0. + * To have a buffer allocated for you, call with *result = 0. + * To use your own buffer, call with *result = &buffer. + */ + +void +DT__FlattenDeviceTree(void **buffer_p, uint32_t *length) +{ + uint32_t totalSize; + void *buf; + + DPRINTF("DT__FlattenDeviceTree(0x%x, 0x%x)\n", buffer_p, length); +#if DEBUG + if (buffer_p) DT__PrintTree(rootNode); +#endif + + totalSize = DTInfo.numNodes * sizeof(DeviceTreeNode) + + DTInfo.numProperties * sizeof(DeviceTreeNodeProperty) + + DTInfo.totalPropertySize; + + DPRINTF("Total size 0x%x\n", totalSize); + if (buffer_p != 0) { + if (totalSize == 0) { + buf = 0; + } else { + if (*buffer_p == 0) { + buf = malloc(totalSize); + } else { + buf = *buffer_p; + } + bzero(buf, totalSize); + + FlattenNodes(rootNode, buf); + } + *buffer_p = buf; + } + if (length) + *length = totalSize; +} + +char * +DT__GetName(Node *node) +{ + Property *prop; + + //DPRINTF("DT__GetName(0x%x)\n", node); + //DPRINTF("Node properties = 0x%x\n", node->properties); + for (prop = node->properties; prop; prop = prop->next) { + //DPRINTF("Prop '%s'\n", prop->name); + if (strcmp(prop->name, "name") == 0) { + return prop->value; + } + } + //DPRINTF("DT__GetName returns 0\n"); + return "(null)"; +} + +Node * +DT__FindNode(const char *path, bool createIfMissing) +{ + Node *node, *child; + DTPropertyNameBuf nameBuf; + char *bp; + int i; + + DPRINTF("DT__FindNode('%s', %d)\n", path, createIfMissing); + + // Start at root + node = rootNode; + DPRINTF("root = 0x%x\n", rootNode); + + while (node) { + // Skip leading slash + while (*path == '/') path++; + + for (i=0, bp = nameBuf; ++i < kDTMaxEntryNameLength && *path && *path != '/'; bp++, path++) *bp = *path; + *bp = '\0'; + + if (nameBuf[0] == '\0') { + // last path entry + break; + } + DPRINTF("Node '%s'\n", nameBuf); + + for (child = node->children; child != 0; child = child->next) { + DPRINTF("Child 0x%x\n", child); + if (strcmp(DT__GetName(child), nameBuf) == 0) { + break; + } + } + if (child == 0 && createIfMissing) { + DPRINTF("Creating node\n"); + char *str = malloc(strlen(nameBuf) + 1); + // XXX this will leak + strcpy(str, nameBuf); + + child = DT__AddChild(node, str); + } + node = child; + } + return node; +} + +#if DEBUG + +void +DT__PrintNode(Node *node, int level) +{ + char spaces[10], *cp = spaces; + Property *prop; + + if (level > 9) level = 9; + while (level--) *cp++ = ' '; + *cp = '\0'; + + printf("%s===Node===\n", spaces); + for (prop = node->properties; prop; prop = prop->next) { + char c = *((char *)prop->value); + if (prop->length < 64 && ( + strcmp(prop->name, "name") == 0 || + (c >= '0' && c <= '9') || + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || c == '_')) { + printf("%s Property '%s' [%d] = '%s'\n", spaces, prop->name, prop->length, prop->value); + } else { + printf("%s Property '%s' [%d] = (data)\n", spaces, prop->name, prop->length); + } + } + printf("%s==========\n", spaces); +} + +static void +_PrintTree(Node *node, int level) +{ + DT__PrintNode(node, level); + level++; + for (node = node->children; node; node = node->next) + _PrintTree(node, level); +} + +void +DT__PrintTree(Node *node) +{ + if (node == 0) node = rootNode; + _PrintTree(node, 0); +} + +void +DT__PrintFlattenedNode(DTEntry entry, int level) +{ + char spaces[10], *cp = spaces; + DTPropertyIterator propIter; + char *name; + void *prop; + int propSize; + + if (level > 9) level = 9; + while (level--) *cp++ = ' '; + *cp = '\0'; + + printf("%s===Entry %p===\n", spaces, entry); + if (kSuccess != DTCreatePropertyIterator(entry, &propIter)) { + printf("Couldn't create property iterator\n"); + return; + } + while( kSuccess == DTIterateProperties( propIter, &name)) { + if( kSuccess != DTGetProperty( entry, name, &prop, &propSize )) + continue; + printf("%s Property %s = %s\n", spaces, name, prop); + } + DTDisposePropertyIterator(propIter); + + printf("%s==========\n", spaces); +} + +static void +_PrintFlattenedTree(DTEntry entry, int level) +{ + DTEntryIterator entryIter; + + PrintFlattenedNode(entry, level); + + if (kSuccess != DTCreateEntryIterator(entry, &entryIter)) { + printf("Couldn't create entry iterator\n"); + return; + } + level++; + while (kSuccess == DTIterateEntries( entryIter, &entry )) { + _PrintFlattenedTree(entry, level); + } + DTDisposeEntryIterator(entryIter); +} + +void +DT__PrintFlattenedTree(DTEntry entry) +{ + _PrintFlattenedTree(entry, 0); +} + + +int +main(int argc, char **argv) +{ + DTEntry dtEntry; + DTPropertyIterator propIter; + DTEntryIterator entryIter; + void *prop; + int propSize; + char *name; + void *flatTree; + uint32_t flatSize; + + Node *node; + + node = AddChild(NULL, "device-tree"); + AddProperty(node, "potato", 4, "foo"); + AddProperty(node, "chemistry", 4, "bar"); + AddProperty(node, "physics", 4, "baz"); + + node = AddChild(node, "dev"); + AddProperty(node, "one", 4, "one"); + AddProperty(node, "two", 4, "two"); + AddProperty(node, "three", 6, "three"); + + node = AddChild(rootNode, "foo"); + AddProperty(node, "aaa", 4, "aab"); + AddProperty(node, "bbb", 4, "bbc"); + AddProperty(node, "cccc", 6, "ccccd"); + + node = FindNode("/this/is/a/test", 1); + AddProperty(node, "dddd", 12, "abcdefghijk"); + + printf("In-memory tree:\n\n"); + + PrintTree(rootNode); + + FlattenDeviceTree(&flatTree, &flatSize); + + printf("Flat tree = %p, size %d\n", flatTree, flatSize); + + dtEntry = (DTEntry)flatTree; + + printf("\n\nPrinting flat tree\n\n"); + + DTInit(dtEntry); + + PrintFlattenedTree((DTEntry)flatTree); +#if 0 + printf("=== Entry %p ===\n", dtEntry); + if (kSuccess != DTCreatePropertyIterator(dtEntry, &propIter)) { + printf("Couldn't create property iterator\n"); + return 1; + } + while( kSuccess == DTIterateProperties( propIter, &name)) { + if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize )) + continue; + printf(" Property %s = %s\n", name, prop); + } + DTDisposePropertyIterator(propIter); + printf("========\n"); + + if (kSuccess != DTCreateEntryIterator(dtEntry, &entryIter)) { + printf("Couldn't create entry iterator\n"); + return 1; + } + while (kSuccess == DTIterateEntries( entryIter, &dtEntry )) { + printf("=== Entry %p ===\n", dtEntry); + + if (kSuccess != DTCreatePropertyIterator(dtEntry, &propIter)) { + printf("Couldn't create property iterator\n"); + return 1; + } + while( kSuccess == DTIterateProperties( propIter, &name)) { + if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize )) + continue; + printf(" Property %s = %s\n", name, prop); + } + DTDisposePropertyIterator(propIter); + printf("========\n"); + } + DTDisposeEntryIterator(entryIter); +#endif + + return 0; +} + +#endif + diff --git a/i386/libsaio/.svn/text-base/device_tree.h.svn-base b/i386/libsaio/.svn/text-base/device_tree.h.svn-base new file mode 100644 index 0000000..a401bbf --- /dev/null +++ b/i386/libsaio/.svn/text-base/device_tree.h.svn-base @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All Rights Reserved. + */ + +#ifndef __DEVICE_TREE_H +#define __DEVICE_TREE_H + +#include <stdbool.h> +#include <stdint.h> + +typedef struct _Property { + const char * name; + uint32_t length; + void * value; + + struct _Property * next; +} Property; + +typedef struct _Node { + struct _Property * properties; + struct _Property * last_prop; + + struct _Node * children; + + struct _Node * next; +} Node; + + +extern Property * +DT__AddProperty(Node *node, const char *name, uint32_t length, void *value); + +extern Node * +DT__AddChild(Node *parent, const char *name); + +Node * +DT__FindNode(const char *path, bool createIfMissing); + +extern void +DT__FreeProperty(Property *prop); + +extern void +DT__FreeNode(Node *node); + +extern char * +DT__GetName(Node *node); + +void +DT__Initialize(void); + +/* + * Free up memory used by in-memory representation + * of device tree. + */ +extern void +DT__Finalize(void); + +void +DT__FlattenDeviceTree(void **result, uint32_t *length); + + +#endif /* __DEVICE_TREE_H */ diff --git a/i386/libsaio/.svn/text-base/disk.c.svn-base b/i386/libsaio/.svn/text-base/disk.c.svn-base new file mode 100644 index 0000000..edf03e0 --- /dev/null +++ b/i386/libsaio/.svn/text-base/disk.c.svn-base @@ -0,0 +1,2124 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + */ + +/* + * Copyright 2007 VMware Inc. + * "Preboot" ramdisk support added by David Elliott + * GPT support added by David Elliott. Based on IOGUIDPartitionScheme.cpp. + */ + +//Azi: style the rest later... + +// Allow UFS_SUPPORT to be overridden with preprocessor option. +#ifndef UFS_SUPPORT +// zef: Disabled UFS support +#define UFS_SUPPORT 0 +#endif + +#if UFS_SUPPORT +#include "ufs.h" +#endif +#include <limits.h> +#include <IOKit/storage/IOApplePartitionScheme.h> +#include <IOKit/storage/IOGUIDPartitionScheme.h> +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "memory.h" +#include "fdisk.h" +#include "hfs.h" +#include "ntfs.h" +#include "msdos.h" +#include "ext2fs.h" +#include "befs.h" +#include "freebsd.h" +#include "openbsd.h" +#include "xml.h" +#include "disk.h" +// For EFI_GUID +#include "efi.h" +#include "efi_tables.h" + +typedef struct gpt_hdr gpt_hdr; +typedef struct gpt_ent gpt_ent; + +#define PROBEFS_SIZE BPS * 4 /* buffer size for filesystem probe */ +#define CD_BPS 2048 /* CD-ROM block size */ +#define N_CACHE_SECS (BIOS_LEN / BPS) /* Must be a multiple of 4 for CD-ROMs */ +#define UFS_FRONT_PORCH 0 +#define kAPMSector 2 /* Sector number of Apple partition map */ +#define kAPMCDSector 8 /* Translated sector of Apple partition map on a CD */ + +/* + * IORound and IOTrunc convenience functions, in the spirit + * of vm's round_page() and trunc_page(). + */ +#define IORound(value,multiple) \ + ((((value) + (multiple) - 1) / (multiple)) * (multiple)) + +#define IOTrunc(value,multiple) \ + (((value) / (multiple)) * (multiple)); + +/* + * trackbuf points to the start of the track cache. Biosread() + * will store the sectors read from disk to this memory area. + * + * biosbuf points to a sector within the track cache, and is + * updated by Biosread(). + */ +static char * const trackbuf = (char *) ptov(BIOS_ADDR); +static char * biosbuf; + +/* + * Map a disk drive to bootable volumes contained within. + */ +struct DiskBVMap { + int biosdev; // BIOS device number (unique) + BVRef bvr; // chain of boot volumes on the disk + int bvrcnt; // number of boot volumes + struct DiskBVMap * next; // linkage to next mapping +}; + +static struct DiskBVMap * gDiskBVMap = NULL; +static struct disk_blk0 * gBootSector = NULL; + +// Function pointers to be filled in if ramdisks are available: +int (*p_ramdiskReadBytes)( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ) = NULL; +int (*p_get_ramdisk_info)(int biosdev, struct driveInfo *dip) = NULL; + +static bool getOSVersion(BVRef bvr, char *str); + +extern void spinActivityIndicator(int sectors); + +//========================================================================== + +static int getDriveInfo( int biosdev, struct driveInfo *dip ) +{ + static struct driveInfo cached_di; + int cc; + + // Real BIOS devices are 8-bit, so anything above that is for internal use. + // Don't cache ramdisk drive info since it doesn't require several BIOS + // calls and is thus not worth it. + if(biosdev >= 0x100) + { + if(p_get_ramdisk_info != NULL) + cc = (*p_get_ramdisk_info)(biosdev, dip); + else + cc = -1; + if(cc < 0) + { + dip->valid = 0; + return -1; + } + else + return 0; + } + + if ( !cached_di.valid || biosdev != cached_di.biosdev ) + { + cc = get_drive_info(biosdev, &cached_di); + if (cc < 0) { + cached_di.valid = 0; + DEBUG_DISK(("get_drive_info returned error\n")); + return (-1); // BIOS call error + } + } + + bcopy(&cached_di, dip, sizeof(cached_di)); + + return 0; +} + +//========================================================================== +// Maps (E)BIOS return codes to message strings. + +struct NamedValue { + unsigned char value; + const char * name; +}; + +static const char * getNameForValue( const struct NamedValue * nameTable, + unsigned char value ) +{ + const struct NamedValue * np; + + for ( np = nameTable; np->value; np++) + if (np->value == value) + return np->name; + + return NULL; +} + +#define ECC_CORRECTED_ERR 0x11 + +static const struct NamedValue bios_errors[] = { + { 0x10, "Media error" }, + { 0x11, "Corrected ECC error" }, + { 0x20, "Controller or device error" }, + { 0x40, "Seek failed" }, + { 0x80, "Device timeout" }, + { 0xAA, "Drive not ready" }, + { 0x00, 0 } +}; + +static const char * bios_error(int errnum) +{ + static char errorstr[] = "Error 0x00"; + const char * errname; + + errname = getNameForValue( bios_errors, errnum ); + if ( errname ) return errname; + + sprintf(errorstr, "Error 0x%02x", errnum); + return errorstr; // No string, print error code only +} + +//========================================================================== +// Use BIOS INT13 calls to read the sector specified. This function will +// also perform read-ahead to cache a few subsequent sector to the sector +// cache. +// +// Return: +// 0 on success, or an error code from INT13/F2 or INT13/F42 BIOS call. + +static bool cache_valid = false; + +static int Biosread( int biosdev, unsigned long long secno ) +{ + static int xbiosdev, xcyl, xhead; + static unsigned int xsec, xnsecs; + struct driveInfo di; + + int rc = -1; + int cyl, head, sec; + int tries = 0; + int bps, divisor; + + if (getDriveInfo(biosdev, &di) < 0) { + return -1; + } + if (di.no_emulation) { + /* Always assume 2k block size; BIOS may lie about geometry */ + bps = 2048; + } else { + bps = di.di.params.phys_nbps; + if (bps == 0) { + return -1; + } + } + divisor = bps / BPS; + + DEBUG_DISK(("Biosread dev %x sec %d bps %d\n", biosdev, secno, bps)); + + // To read the disk sectors, use EBIOS if we can. Otherwise, + // revert to the standard BIOS calls. + + if ((biosdev >= kBIOSDevTypeHardDrive) && + (di.uses_ebios & EBIOS_FIXED_DISK_ACCESS)) + { + if (cache_valid && + (biosdev == xbiosdev) && + (secno >= xsec) && + ((unsigned int)secno < (xsec + xnsecs))) + { + biosbuf = trackbuf + (BPS * (secno - xsec)); + return 0; + } + + xnsecs = N_CACHE_SECS; + xsec = (secno / divisor) * divisor; + cache_valid = false; + + while ((rc = ebiosread(biosdev, secno / divisor, xnsecs / divisor)) && (++tries < 5)) + { + if (rc == ECC_CORRECTED_ERR) { + /* Ignore corrected ECC errors */ + rc = 0; + break; + } + error(" EBIOS read error: %s\n", bios_error(rc), rc); + error(" Block 0x%x Sectors %d\n", secno, xnsecs); + sleep(1); + } + } + else + { + /* spc = spt * heads */ + int spc = (di.di.params.phys_spt * di.di.params.phys_heads); + cyl = secno / spc; + head = (secno % spc) / di.di.params.phys_spt; + sec = secno % di.di.params.phys_spt; + + if (cache_valid && + (biosdev == xbiosdev) && + (cyl == xcyl) && + (head == xhead) && + ((unsigned int)sec >= xsec) && + ((unsigned int)sec < (xsec + xnsecs))) + { + // this sector is in trackbuf cache + biosbuf = trackbuf + (BPS * (sec - xsec)); + return 0; + } + + // Cache up to a track worth of sectors, but do not cross a + // track boundary. + + xcyl = cyl; + xhead = head; + xsec = sec; + xnsecs = ((unsigned int)(sec + N_CACHE_SECS) > di.di.params.phys_spt) ? (di.di.params.phys_spt - sec) : N_CACHE_SECS; + cache_valid = false; + + while ((rc = biosread(biosdev, cyl, head, sec, xnsecs)) && + (++tries < 5)) + { + if (rc == ECC_CORRECTED_ERR) { + /* Ignore corrected ECC errors */ + rc = 0; + break; + } + error(" BIOS read error: %s\n", bios_error(rc), rc); + error(" Block %d, Cyl %d Head %d Sector %d\n", + secno, cyl, head, sec); + sleep(1); + } + } + + // If the BIOS reported success, mark the sector cache as valid. + + if (rc == 0) { + cache_valid = true; + } + biosbuf = trackbuf + (secno % divisor) * BPS; + xbiosdev = biosdev; + + spinActivityIndicator(xnsecs); + + return rc; +} + +//========================================================================== + +int testBiosread( int biosdev, unsigned long long secno ) +{ + return Biosread(biosdev, secno); +} + +//========================================================================== + +static int readBytes( int biosdev, unsigned long long blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ) +{ + // ramdisks require completely different code for reading. + if(p_ramdiskReadBytes != NULL && biosdev >= 0x100) + return (*p_ramdiskReadBytes)(biosdev, blkno, byteoff, byteCount, buffer); + + char * cbuf = (char *) buffer; + int error; + int copy_len; + + DEBUG_DISK(("%s: dev %x block %x [%d] -> 0x%x...", __FUNCTION__, + biosdev, blkno, byteCount, (unsigned)cbuf)); + + for ( ; byteCount; cbuf += copy_len, blkno++ ) + { + error = Biosread( biosdev, blkno ); + if ( error ) + { + DEBUG_DISK(("error\n")); + return (-1); + } + + copy_len = ((byteCount + byteoff) > BPS) ? (BPS - byteoff) : byteCount; + bcopy( biosbuf + byteoff, cbuf, copy_len ); + byteCount -= copy_len; + byteoff = 0; + } + + DEBUG_DISK(("done\n")); + + return 0; +} + +//========================================================================== + +static int isExtendedFDiskPartition( const struct fdisk_part * part ) +{ + static unsigned char extParts[] = + { + 0x05, /* Extended */ + 0x0f, /* Win95 extended */ + 0x85, /* Linux extended */ + }; + + unsigned int i; + + for (i = 0; i < sizeof(extParts)/sizeof(extParts[0]); i++) + { + if (extParts[i] == part->systid) return 1; + } + return 0; +} + +//========================================================================== + +static int getNextFDiskPartition( int biosdev, int * partno, + const struct fdisk_part ** outPart ) +{ + static int sBiosdev = -1; + static int sNextPartNo; + static unsigned int sFirstBase; + static unsigned int sExtBase; + static unsigned int sExtDepth; + static struct fdisk_part * sExtPart; + struct fdisk_part * part; + + if ( sBiosdev != biosdev || *partno < 0 ) + { + // Fetch MBR. + if ( readBootSector( biosdev, DISK_BLK0, 0 ) ) return 0; + + sBiosdev = biosdev; + sNextPartNo = 0; + sFirstBase = 0; + sExtBase = 0; + sExtDepth = 0; + sExtPart = NULL; + } + + while (1) + { + part = NULL; + + if ( sNextPartNo < FDISK_NPART ) + { + part = (struct fdisk_part *) gBootSector->parts[sNextPartNo]; + } + else if ( sExtPart ) + { + unsigned int blkno = sExtPart->relsect + sFirstBase; + + // Save the block offset of the first extended partition. + + if (sExtDepth == 0) { + sFirstBase = blkno; + } + sExtBase = blkno; + + // Load extended partition table. + + if ( readBootSector( biosdev, blkno, 0 ) == 0 ) + { + sNextPartNo = 0; + sExtDepth++; + sExtPart = NULL; + continue; + } + // Fall through to part == NULL + } + + if ( part == NULL ) break; // Reached end of partition chain. + + // Advance to next partition number. + + sNextPartNo++; + + if ( isExtendedFDiskPartition(part) ) + { + sExtPart = part; + continue; + } + + // Skip empty slots. + + if ( part->systid == 0x00 ) + { + continue; + } + + // Change relative offset to an absolute offset. + part->relsect += sExtBase; + + *outPart = part; + *partno = sExtDepth ? (int)(sExtDepth + FDISK_NPART) : sNextPartNo; + + break; + } + + return (part != NULL); +} + +//========================================================================== + +static BVRef newFDiskBVRef( int biosdev, int partno, unsigned int blkoff, + const struct fdisk_part * part, + FSInit initFunc, FSLoadFile loadFunc, + FSReadFile readFunc, + FSGetDirEntry getdirFunc, + FSGetFileBlock getBlockFunc, + FSGetUUID getUUIDFunc, + BVGetDescription getDescriptionFunc, + BVFree bvFreeFunc, + int probe, int type, unsigned int bvrFlags ) +{ + BVRef bvr = (BVRef) malloc( sizeof(*bvr) ); + if ( bvr ) + { + bzero(bvr, sizeof(*bvr)); + + bvr->biosdev = biosdev; + bvr->part_no = partno; + bvr->part_boff = blkoff; + bvr->part_type = part->systid; + bvr->fs_loadfile = loadFunc; + bvr->fs_readfile = readFunc; + bvr->fs_getdirentry = getdirFunc; + bvr->fs_getfileblock= getBlockFunc; + bvr->fs_getuuid = getUUIDFunc; + bvr->description = getDescriptionFunc; + bvr->type = type; + bvr->bv_free = bvFreeFunc; + + if ((part->bootid & FDISK_ACTIVE) && (part->systid == FDISK_HFS)) + bvr->flags |= kBVFlagPrimary; + + // Probe the filesystem. + + if ( initFunc ) + { + bvr->flags |= kBVFlagNativeBoot; + + if ( probe && initFunc( bvr ) != 0 ) + { + // filesystem probe failed. + + DEBUG_DISK(("%s: failed probe on dev %x part %d\n", + __FUNCTION__, biosdev, partno)); + + (*bvr->bv_free)(bvr); + bvr = NULL; + } + if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagBootable; + } + } + else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagForeignBoot; + } + else + { + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + if (bvr) bvr->flags |= bvrFlags; + return bvr; +} + +//========================================================================== + +BVRef newAPMBVRef( int biosdev, int partno, unsigned int blkoff, + const DPME * part, + FSInit initFunc, FSLoadFile loadFunc, + FSReadFile readFunc, + FSGetDirEntry getdirFunc, + FSGetFileBlock getBlockFunc, + FSGetUUID getUUIDFunc, + BVGetDescription getDescriptionFunc, + BVFree bvFreeFunc, + int probe, int type, unsigned int bvrFlags ) +{ + BVRef bvr = (BVRef) malloc( sizeof(*bvr) ); + if ( bvr ) + { + bzero(bvr, sizeof(*bvr)); + + bvr->biosdev = biosdev; + bvr->part_no = partno; + bvr->part_boff = blkoff; + bvr->fs_loadfile = loadFunc; + bvr->fs_readfile = readFunc; + bvr->fs_getdirentry = getdirFunc; + bvr->fs_getfileblock= getBlockFunc; + bvr->fs_getuuid = getUUIDFunc; + bvr->description = getDescriptionFunc; + bvr->type = type; + bvr->bv_free = bvFreeFunc; + strlcpy(bvr->name, part->dpme_name, DPISTRLEN); + strlcpy(bvr->type_name, part->dpme_type, DPISTRLEN); + + /* + if ( part->bootid & FDISK_ACTIVE ) + bvr->flags |= kBVFlagPrimary; + */ + + // Probe the filesystem. + + if ( initFunc ) + { + bvr->flags |= kBVFlagNativeBoot | kBVFlagBootable | kBVFlagSystemVolume; + + if ( probe && initFunc( bvr ) != 0 ) + { + // filesystem probe failed. + + DEBUG_DISK(("%s: failed probe on dev %x part %d\n", + __FUNCTION__, biosdev, partno)); + + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + /* + else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagForeignBoot; + } + */ + else + { + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + if (bvr) bvr->flags |= bvrFlags; + return bvr; +} + +//========================================================================== + +// GUID's in LE form: +// HFS+ partition - 48465300-0000-11AA-AA11-00306543ECAC +EFI_GUID const GPT_HFS_GUID = { 0x48465300, 0x0000, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; + +// turbo - Apple Boot Partition - 426F6F74-0000-11AA-AA11-00306543ECAC +EFI_GUID const GPT_BOOT_GUID = { 0x426F6F74, 0x0000, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; + +// turbo - or an EFI System Partition - C12A7328-F81F-11D2-BA4B-00A0C93EC93B +EFI_GUID const GPT_EFISYS_GUID = { 0xC12A7328, 0xF81F, 0x11D2, { 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B } }; + +// zef - Basic Data Partition - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 for foreign OS support +EFI_GUID const GPT_BASICDATA_GUID = { 0xEBD0A0A2, 0xB9E5, 0x4433, { 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7 } }; + +// Microsoft Reserved Partition - E3C9E316-0B5C-4DB8-817DF92DF00215AE +EFI_GUID const GPT_BASICDATA2_GUID = { 0xE3C9E316, 0x0B5C, 0x4DB8, { 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE } }; + + +BVRef newGPTBVRef( int biosdev, int partno, unsigned int blkoff, + const gpt_ent * part, + FSInit initFunc, FSLoadFile loadFunc, + FSReadFile readFunc, + FSGetDirEntry getdirFunc, + FSGetFileBlock getBlockFunc, + FSGetUUID getUUIDFunc, + BVGetDescription getDescriptionFunc, + BVFree bvFreeFunc, + int probe, int type, unsigned int bvrFlags ) +{ + BVRef bvr = (BVRef) malloc( sizeof(*bvr) ); + if ( bvr ) + { + bzero(bvr, sizeof(*bvr)); + + bvr->biosdev = biosdev; + bvr->part_no = partno; + bvr->part_boff = blkoff; + bvr->fs_loadfile = loadFunc; + bvr->fs_readfile = readFunc; + bvr->fs_getdirentry = getdirFunc; + bvr->fs_getfileblock= getBlockFunc; + bvr->fs_getuuid = getUUIDFunc; + bvr->description = getDescriptionFunc; + bvr->type = type; + bvr->bv_free = bvFreeFunc; + // FIXME: UCS-2 -> UTF-8 the name + strlcpy(bvr->name, "----", DPISTRLEN); + if ( (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const*)part->ent_type) == 0) || + (efi_guid_compare(&GPT_HFS_GUID, (EFI_GUID const*)part->ent_type) == 0) ) + strlcpy(bvr->type_name, "GPT HFS+", DPISTRLEN); + else + strlcpy(bvr->type_name, "GPT Unknown", DPISTRLEN); + + /* + if ( part->bootid & FDISK_ACTIVE ) + bvr->flags |= kBVFlagPrimary; + */ + + // Probe the filesystem. + + if ( initFunc ) + { + bvr->flags |= kBVFlagNativeBoot; + + if ( probe && initFunc( bvr ) != 0 ) + { + // filesystem probe failed. + + DEBUG_DISK(("%s: failed probe on dev %x part %d\n", + __FUNCTION__, biosdev, partno)); + + (*bvr->bv_free)(bvr); + bvr = NULL; + } + if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagBootable; + } + } + else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagForeignBoot; + } + else + { + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + if (bvr) bvr->flags |= bvrFlags; + return bvr; +} + +//========================================================================== + +/* A note on partition numbers: + * IOKit makes the primary partitions numbers 1-4, and then + * extended partitions are numbered consecutively 5 and up. + * So, for example, if you have two primary partitions and + * one extended partition they will be numbered 1, 2, 5. + */ + +static BVRef diskScanFDiskBootVolumes( int biosdev, int * countPtr ) +{ + const struct fdisk_part * part; + struct DiskBVMap * map; + int partno = -1; + BVRef bvr; +#if UFS_SUPPORT + BVRef booterUFS = NULL; +#endif + int spc; + struct driveInfo di; + boot_drive_info_t *dp; + + /* Initialize disk info */ + if (getDriveInfo(biosdev, &di) != 0) { + return NULL; + } + dp = &di.di; + spc = (dp->params.phys_spt * dp->params.phys_heads); + if (spc == 0) { + /* This is probably a CD-ROM; punt on the geometry. */ + spc = 1; + } + + do { + // Create a new mapping. + + map = (struct DiskBVMap *) malloc( sizeof(*map) ); + if ( map ) + { + map->biosdev = biosdev; + map->bvr = NULL; + map->bvrcnt = 0; + map->next = gDiskBVMap; + gDiskBVMap = map; + + // Create a record for each partition found on the disk. + + while ( getNextFDiskPartition( biosdev, &partno, &part ) ) + { + DEBUG_DISK(("%s: part %d [%x]\n", __FUNCTION__, + partno, part->systid)); + bvr = 0; + + switch ( part->systid ) + { +#if UFS_SUPPORT + case FDISK_UFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect + UFS_FRONT_PORCH/BPS, + part, + UFSInitPartition, + UFSLoadFile, + UFSReadFile, + UFSGetDirEntry, + UFSGetFileBlock, + UFSGetUUID, + UFSGetDescription, + UFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; +#endif + + case FDISK_HFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; + + // turbo - we want the booter type scanned also + case FDISK_BOOTER: + if (part->bootid & FDISK_ACTIVE) + gBIOSBootVolume = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; + +#if UFS_SUPPORT + case FDISK_BOOTER: + booterUFS = newFDiskBVRef( + biosdev, partno, + ((part->relsect + spc - 1) / spc) * spc, + part, + UFSInitPartition, + UFSLoadFile, + UFSReadFile, + UFSGetDirEntry, + UFSGetFileBlock, + UFSGetUUID, + UFSGetDescription, + UFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; +#endif + + case FDISK_FAT32: + case FDISK_DOS12: + case FDISK_DOS16S: + case FDISK_DOS16B: + case FDISK_SMALLFAT32: + case FDISK_DOS16SLBA: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + MSDOSInitPartition, + MSDOSLoadFile, + MSDOSReadFile, + MSDOSGetDirEntry, + MSDOSGetFileBlock, + MSDOSGetUUID, + MSDOSGetDescription, + MSDOSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_NTFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, + NTFSGetUUID, + NTFSGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_LINUX: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, + EX2GetUUID, + EX2GetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_BEFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, + BeFSGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_FREEBSD: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, + FreeBSDGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_OPENBSD: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, + OpenBSDGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + default: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, 0, + (BVFree)free, + 0, + kBIOSDevTypeHardDrive, 0); + break; + } + + if ( bvr ) + { + bvr->next = map->bvr; + map->bvr = bvr; + map->bvrcnt++; + } + } + +#if UFS_SUPPORT + // Booting from a CD with an UFS filesystem embedded + // in a booter partition. + + if ( booterUFS ) + { + if ( map->bvrcnt == 0 ) + { + map->bvr = booterUFS; + map->bvrcnt++; + } + else free( booterUFS ); + } +#endif + } + } while (0); + + /* + * If no FDisk partition, then we will check for + * an Apple partition map elsewhere. + */ +#if UNUSED + if (map->bvrcnt == 0) { + static struct fdisk_part cdpart; + cdpart.systid = 0xCD; + + /* Let's try assuming we are on a hybrid HFS/ISO9660 CD. */ + bvr = newFDiskBVRef( + biosdev, 0, + 0, + &cdpart, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + 0, + kBIOSDevTypeHardDrive); + bvr->next = map->bvr; + map->bvr = bvr; + map->bvrcnt++; + } +#endif + // Actually this should always be true given the above code + if(map == gDiskBVMap) + { + // Don't leave a null map in the chain + if(map->bvrcnt == 0 && map->bvr == NULL) + { + gDiskBVMap = map->next; + free(map); + map = NULL; + } + } + + if (countPtr) *countPtr = map ? map->bvrcnt : 0; + + return map ? map->bvr : NULL; +} + +//========================================================================== + +static BVRef diskScanAPMBootVolumes( int biosdev, int * countPtr ) +{ + struct DiskBVMap * map; + struct Block0 *block0_p; + unsigned int blksize; + unsigned int factor; + void *buffer = malloc(BPS); + + /* Check for alternate block size */ + if (readBytes( biosdev, 0, 0, BPS, buffer ) != 0) { + return NULL; + } + block0_p = buffer; + if (OSSwapBigToHostInt16(block0_p->sbSig) == BLOCK0_SIGNATURE) { + blksize = OSSwapBigToHostInt16(block0_p->sbBlkSize); + if (blksize != BPS) { + free(buffer); + buffer = malloc(blksize); + } + factor = blksize / BPS; + } else { + blksize = BPS; + factor = 1; + } + + do { + // Create a new mapping. + + map = (struct DiskBVMap *) malloc( sizeof(*map) ); + if ( map ) + { + int error; + DPME *dpme_p = (DPME *)buffer; + UInt32 i, npart = UINT_MAX; + BVRef bvr; + + map->biosdev = biosdev; + map->bvr = NULL; + map->bvrcnt = 0; + map->next = gDiskBVMap; + gDiskBVMap = map; + + for (i=0; i<npart; i++) { + error = readBytes( biosdev, (kAPMSector + i) * factor, 0, blksize, buffer ); + + if (error || OSSwapBigToHostInt16(dpme_p->dpme_signature) != DPME_SIGNATURE) { + break; + } + + if (i==0) { + npart = OSSwapBigToHostInt32(dpme_p->dpme_map_entries); + } + /* + printf("name = %s, %s%s %d -> %d [%d -> %d] {%d}\n", + dpme.dpme_name, dpme.dpme_type, (dpme.dpme_flags & DPME_FLAGS_BOOTABLE) ? "(bootable)" : "", + dpme.dpme_pblock_start, dpme.dpme_pblocks, + dpme.dpme_lblock_start, dpme.dpme_lblocks, + dpme.dpme_boot_block); + */ + + if (strcmp(dpme_p->dpme_type, "Apple_HFS") == 0) { + bvr = newAPMBVRef(biosdev, + i, + OSSwapBigToHostInt32(dpme_p->dpme_pblock_start) * factor, + dpme_p, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + bvr->next = map->bvr; + map->bvr = bvr; + map->bvrcnt++; + } + } + } + } while (0); + + free(buffer); + + if (countPtr) *countPtr = map ? map->bvrcnt : 0; + + return map ? map->bvr : NULL; +} + +//========================================================================== + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +/* + * Trying to figure out the filsystem type of a given partition. + */ +static int probeFileSystem(int biosdev, unsigned int blkoff) +{ + // detected filesystem type; + int result = -1; + int fatbits; + + // Allocating buffer for 4 sectors. + const void * probeBuffer = malloc(PROBEFS_SIZE); + if (probeBuffer == NULL) + goto exit; + + // Reading first 4 sectors of current partition + int error = readBytes(biosdev, blkoff, 0, PROBEFS_SIZE, (void *)probeBuffer); + if (error) + goto exit; + + if (HFSProbe(probeBuffer)) + result = FDISK_HFS; + else if (EX2Probe(probeBuffer)) + result = FDISK_LINUX; + else if (FreeBSDProbe(probeBuffer)) + result = FDISK_FREEBSD; + else if (OpenBSDProbe(probeBuffer)) + result = FDISK_OPENBSD; + else if (NTFSProbe(probeBuffer)) + result = FDISK_NTFS; + else if (BeFSProbe(probeBuffer)) + result = FDISK_BEFS; + else if ( (fatbits = MSDOSProbe(probeBuffer)) ) + { + switch (fatbits) + { + case 32: + default: + result = FDISK_FAT32; + break; + case 16: + result = FDISK_DOS16B; + break; + case 12: + result = FDISK_DOS12; + break; + } + } + else + // Couldn't detect filesystem type + result = 0; + +exit: + if (probeBuffer != NULL) free((void *)probeBuffer); + return result; +} + +static bool isPartitionUsed(gpt_ent * partition) +{ + // + // Ask whether the given partition is used. + // + + return efi_guid_is_null((EFI_GUID const*)partition->ent_type) ? false : true; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +static BVRef diskScanGPTBootVolumes( int biosdev, int * countPtr ) +{ + struct DiskBVMap * map = NULL; + void *buffer = malloc(BPS); + int error; + if ( (error = readBytes( biosdev, /*secno*/0, 0, BPS, buffer )) != 0) { + verbose("Failed to read boot sector from BIOS device %02xh. Error=%d\n", biosdev, error); + goto scanErr; + } + struct REAL_disk_blk0 *fdiskMap = buffer; + if ( OSSwapLittleToHostInt16(fdiskMap->signature) != DISK_SIGNATURE ) + { + verbose("Failed to find boot signature on BIOS device %02xh\n", biosdev); + goto scanErr; + } + + int fdiskID = 0; + unsigned index; + for ( index = 0; index < FDISK_NPART; index++ ) + { + if ( fdiskMap->parts[index].systid ) + { + if ( fdiskMap->parts[index].systid == 0xEE ) + { + // Fail if two 0xEE partitions are present which + // means the FDISK code will wind up parsing it. + if ( fdiskID ) goto scanErr; + + fdiskID = index + 1; + } + } + } + + if ( fdiskID == 0 ) goto scanErr; + verbose("Attempting to read GPT\n"); + + if(readBytes(biosdev, 1, 0, BPS, buffer) != 0) + goto scanErr; + + gpt_hdr *headerMap = buffer; + + // Determine whether the partition header signature is present. + + if ( memcmp(headerMap->hdr_sig, GPT_HDR_SIG, strlen(GPT_HDR_SIG)) ) + { + goto scanErr; + } + + // Determine whether the partition header size is valid. + + UInt32 headerCheck = OSSwapLittleToHostInt32(headerMap->hdr_crc_self); + UInt32 headerSize = OSSwapLittleToHostInt32(headerMap->hdr_size); + + if ( headerSize < offsetof(gpt_hdr, padding) ) + { + goto scanErr; + } + + if ( headerSize > BPS ) + { + goto scanErr; + } + + // Determine whether the partition header checksum is valid. + + headerMap->hdr_crc_self = 0; + + if ( crc32(0, headerMap, headerSize) != headerCheck ) + { + goto scanErr; + } + + // Determine whether the partition entry size is valid. + + UInt64 gptBlock = 0; + UInt32 gptCheck = 0; + UInt32 gptCount = 0; + UInt32 gptID = 0; + gpt_ent * gptMap = 0; + UInt32 gptSize = 0; + + gptBlock = OSSwapLittleToHostInt64(headerMap->hdr_lba_table); + gptCheck = OSSwapLittleToHostInt32(headerMap->hdr_crc_table); + gptCount = OSSwapLittleToHostInt32(headerMap->hdr_entries); + gptSize = OSSwapLittleToHostInt32(headerMap->hdr_entsz); + + if ( gptSize < sizeof(gpt_ent) ) + { + goto scanErr; + } + + // Allocate a buffer large enough to hold one map, rounded to a media block. + free(buffer); + buffer = NULL; + + UInt32 bufferSize = IORound(gptCount * gptSize, BPS); + if(bufferSize == 0) + goto scanErr; + buffer = malloc(bufferSize); + + if(readBytes(biosdev, gptBlock, 0, bufferSize, buffer) != 0) + goto scanErr; + + verbose("Read GPT\n"); + + // Allocate a new map for this BIOS device and insert it into the chain + map = malloc(sizeof(*map)); + map->biosdev = biosdev; + map->bvr = NULL; + map->bvrcnt = 0; + map->next = gDiskBVMap; + gDiskBVMap = map; + + // fdisk like partition type id. + int fsType = 0; + + for(gptID = 1; gptID <= gptCount; ++gptID) + { + BVRef bvr = NULL; + unsigned int bvrFlags = 0; + + // size on disk can be larger than sizeof(gpt_ent) + gptMap = (gpt_ent *) ( buffer + ( (gptID - 1) * gptSize) ); + + // NOTE: EFI_GUID's are in LE and we know we're on an x86. + // The IOGUIDPartitionScheme.cpp code uses byte-based UUIDs, we don't. + + if (isPartitionUsed(gptMap)) + { + char stringuuid[100]; + efi_guid_unparse_upper((EFI_GUID*)gptMap->ent_type, stringuuid); + verbose("Reading GPT partition %d, type %s\n", gptID, stringuuid); + + // Getting fdisk like partition type. + fsType = probeFileSystem(biosdev, gptMap->ent_lba_start); + + if ( (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) || + (efi_guid_compare(&GPT_HFS_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ) + { + bvrFlags = (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ? kBVFlagBooter : 0; + bvr = newGPTBVRef(biosdev, + gptID, + gptMap->ent_lba_start, + gptMap, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, bvrFlags); + } + + // zef - foreign OS support + if ( (efi_guid_compare(&GPT_BASICDATA_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) || + (efi_guid_compare(&GPT_BASICDATA2_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ) + { + switch (fsType) + { + case FDISK_NTFS: + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + 0, 0, 0, 0, 0, 0, NTFSGetDescription, + (BVFree)free, 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_LINUX: + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + 0, 0, 0, 0, 0, 0, EX2GetDescription, + (BVFree)free, 0, kBIOSDevTypeHardDrive, 0); + break; + + default: + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + 0, 0, 0, 0, 0, 0, 0, + (BVFree)free, 0, kBIOSDevTypeHardDrive, 0); + break; + } + + } + + // turbo - save our booter partition + // zef - only on original boot device + if ( (efi_guid_compare(&GPT_EFISYS_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ) + { + switch (fsType) + { + case FDISK_HFS: + if (readBootSector( biosdev, gptMap->ent_lba_start, (void *)0x7e00 ) == 0) + { + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, kBIOSDevTypeHardDrive, kBVFlagEFISystem); + } + break; + + case FDISK_FAT32: + if (testFAT32EFIBootSector( biosdev, gptMap->ent_lba_start, (void *)0x7e00 ) == 0) + { + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + MSDOSInitPartition, + MSDOSLoadFile, + MSDOSReadFile, + MSDOSGetDirEntry, + MSDOSGetFileBlock, + MSDOSGetUUID, + MSDOSGetDescription, + MSDOSFree, + 0, kBIOSDevTypeHardDrive, kBVFlagEFISystem); + } + break; + + if (biosdev == gBIOSDev) + gBIOSBootVolume = bvr; + } + } + + if (bvr) + { + // Fixup bvr with the fake fdisk partition type. + if (fsType > 0) bvr->part_type = fsType; + + bvr->next = map->bvr; + map->bvr = bvr; + ++map->bvrcnt; + } + + } + } + +scanErr: + free(buffer); + + if(map) + { + if(countPtr) *countPtr = map->bvrcnt; + return map->bvr; + } + else + { + if(countPtr) *countPtr = 0; + return NULL; + } +} + +static bool getOSVersion(BVRef bvr, char *str) +{ + bool valid = false; + config_file_t systemVersion; + char dirSpec[512]; + + sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no); + + if (!loadConfigFile(dirSpec, &systemVersion)) + { + valid = true; + } + else + { + sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no); + + if (!loadConfigFile(dirSpec, &systemVersion)) + { + bvr->OSisServer = true; + valid = true; + } + } + + if (valid) + { + const char *val; + int len; + + if (getValueForKey(kProductVersion, &val, &len, &systemVersion)) + { + // getValueForKey uses const char for val + // so copy it and trim + *str = '\0'; + strncat(str, val, MIN(len, 4)); + } + else + valid = false; + } + + if(!valid) + { + int fh = -1; + sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no); + fh = open(dirSpec, 0); + + if (fh >= 0) + { + valid = true; + bvr->OSisInstaller = true; + strcpy(bvr->OSVersion, "10.7"); // 10.7 + + } + else + { + close(fh); + } + } + + return valid; +} + +//========================================================================== + +static void scanFSLevelBVRSettings(BVRef chain) +{ + BVRef bvr; + char dirSpec[512], fileSpec[512]; + char label[BVSTRLEN]; + int ret; + long flags, time; + int fh, fileSize, error; + + for (bvr = chain; bvr; bvr = bvr->next) + { + ret = -1; + error = 0; + + // + // Check for alternate volume label on boot helper partitions. + // + if (bvr->flags & kBVFlagBooter) + { + sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/", BIOS_DEV_UNIT(bvr), bvr->part_no); + strcpy(fileSpec, ".disk_label.contentDetails"); + ret = GetFileInfo(dirSpec, fileSpec, &flags, &time); + if (!ret) + { + fh = open(strcat(dirSpec, fileSpec), 0); + fileSize = file_size(fh); + if (fileSize > 0 && fileSize < BVSTRLEN) + { + if (read(fh, label, fileSize) != fileSize) + error = -1; + } + else + error = -1; + + close(fh); + + if (!error) + { + label[fileSize] = '\0'; + strcpy(bvr->altlabel, label); + } + } + } + + // + // Check for SystemVersion.plist or ServerVersion.plist + // to determine if a volume hosts an installed system. + // + if (bvr->flags & kBVFlagNativeBoot) + { + if (getOSVersion(bvr,bvr->OSVersion) == true) + { + bvr->flags |= kBVFlagSystemVolume; + } + } + + } +} + +void rescanBIOSDevice(int biosdev) +{ + struct DiskBVMap *oldMap = diskResetBootVolumes(biosdev); + CacheReset(); + diskFreeMap(oldMap); + oldMap = NULL; + scanBootVolumes(biosdev, 0); +} + +struct DiskBVMap* diskResetBootVolumes(int biosdev) +{ + struct DiskBVMap * map; + struct DiskBVMap *prevMap = NULL; + for ( map = gDiskBVMap; map; prevMap = map, map = map->next ) { + if ( biosdev == map->biosdev ) { + break; + } + } + if(map != NULL) + { + verbose("Resetting BIOS device %xh\n", biosdev); + // Reset the biosbuf cache + cache_valid = false; + if(map == gDiskBVMap) + gDiskBVMap = map->next; + else if(prevMap != NULL) + prevMap->next = map->next; + else + stop(""); + } + // Return the old map, either to be freed, or reinserted later + return map; +} + +// Frees a DiskBVMap and all of its BootVolume's +void diskFreeMap(struct DiskBVMap *map) +{ + if(map != NULL) + { + while(map->bvr != NULL) + { + BVRef bvr = map->bvr; + map->bvr = bvr->next; + (*bvr->bv_free)(bvr); + } + free(map); + } +} + +BVRef diskScanBootVolumes( int biosdev, int * countPtr ) +{ + struct DiskBVMap * map; + BVRef bvr; + int count = 0; + + // Find an existing mapping for this device. + + for ( map = gDiskBVMap; map; map = map->next ) { + if ( biosdev == map->biosdev ) { + count = map->bvrcnt; + break; + } + } + + if (map == NULL) { + bvr = diskScanGPTBootVolumes(biosdev, &count); + if (bvr == NULL) { + bvr = diskScanFDiskBootVolumes(biosdev, &count); + } + if (bvr == NULL) { + bvr = diskScanAPMBootVolumes(biosdev, &count); + } + if (bvr) + { + scanFSLevelBVRSettings(bvr); + } + } else { + bvr = map->bvr; + } + if (countPtr) *countPtr += count; + return bvr; +} + +BVRef getBVChainForBIOSDev(int biosdev) +{ + BVRef chain = NULL; + struct DiskBVMap * map = NULL; + + for (map = gDiskBVMap; map; map = map->next) + { + if (map->biosdev == biosdev) + { + chain = map->bvr; + break; + } + } + + return chain; +} + +BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count) +{ + BVRef chain = NULL; + BVRef bvr = NULL; + BVRef newBVR = NULL; + BVRef prevBVR = NULL; + + struct DiskBVMap * map = NULL; + int bvCount = 0; + + const char *raw = 0; + char* val = 0; + int len; + + getValueForKey(kHidePartition, &raw, &len, &bootInfo->chameleonConfig); + if(raw) + { + val = XMLDecode(raw); + } + + /* + * Traverse gDISKBVmap to get references for + * individual bvr chains of each drive. + */ + for (map = gDiskBVMap; map; map = map->next) + { + for (bvr = map->bvr; bvr; bvr = bvr->next) + { + /* + * Save the last bvr. + */ + if (newBVR) prevBVR = newBVR; + + /* + * Allocate and copy the matched bvr entry into a new one. + */ + newBVR = (BVRef) malloc(sizeof(*newBVR)); + bcopy(bvr, newBVR, sizeof(*newBVR)); + + /* + * Adjust the new bvr's fields. + */ + newBVR->next = NULL; + newBVR->filtered = true; + + if ( (!allowFlags || newBVR->flags & allowFlags) + && (!denyFlags || !(newBVR->flags & denyFlags) ) + && (newBVR->biosdev >= minBIOSDev && newBVR->biosdev <= maxBIOSDev) + ) + newBVR->visible = true; + + /* + * Looking for "Hide Partition" entries in 'hd(x,y)|uuid|"label" hd(m,n)|uuid|"label"' format, + * to be able to hide foreign partitions from the boot menu. + * + */ + if ( (newBVR->flags & kBVFlagForeignBoot) ) + { + char *start, *next = val; + long len = 0; + do + { + start = strbreak(next, &next, &len); + if(len && matchVolumeToString(newBVR, start, len) ) + newBVR->visible = false; + } + while ( next && *next ); + } + + /* + * Use the first bvr entry as the starting chain pointer. + */ + if (!chain) + chain = newBVR; + + /* + * Update the previous bvr's link pointer to use the new memory area. + */ + if (prevBVR) + prevBVR->next = newBVR; + + if (newBVR->visible) + bvCount++; + } + } + +#if DEBUG //Azi: warning - too big for boot-log.. far too big.. i mean HUGE!! :P + for (bvr = chain; bvr; bvr = bvr->next) + { + printf(" bvr: %d, dev: %d, part: %d, flags: %d, vis: %d\n", bvr, bvr->biosdev, bvr->part_no, bvr->flags, bvr->visible); + } + printf("count: %d\n", bvCount); + getchar(); +#endif + + *count = bvCount; + + free(val); + return chain; +} + +int freeFilteredBVChain(const BVRef chain) +{ + int ret = 1; + BVRef bvr = chain; + BVRef nextBVR = NULL; + + while (bvr) + { + nextBVR = bvr->next; + + if (bvr->filtered) + { + free(bvr); + } + else + { + ret = 0; + break; + } + + bvr = nextBVR; + } + + return ret; +} + +//========================================================================== + +static const struct NamedValue fdiskTypes[] = +{ + { FDISK_NTFS, "Windows NTFS" }, + { FDISK_DOS12, "Windows FAT12" }, + { FDISK_DOS16B, "Windows FAT16" }, + { FDISK_DOS16S, "Windows FAT16" }, + { FDISK_DOS16SLBA, "Windows FAT16" }, + { FDISK_SMALLFAT32, "Windows FAT32" }, + { FDISK_FAT32, "Windows FAT32" }, + { FDISK_FREEBSD, "FreeBSD" }, + { FDISK_OPENBSD, "OpenBSD" }, + { FDISK_LINUX, "Linux" }, + { FDISK_UFS, "Apple UFS" }, + { FDISK_HFS, "Apple HFS" }, + { FDISK_BOOTER, "Apple Boot/UFS" }, + { FDISK_BEFS, "Haiku" }, + { 0xCD, "CD-ROM" }, + { 0x00, 0 } /* must be last */ +}; + +//========================================================================== + +bool matchVolumeToString( BVRef bvr, const char* match, long matchLen) +{ + char testStr[128]; + + if ( !bvr || !match || !*match) + return 0; + + if ( bvr->biosdev < 0x80 || bvr->biosdev >= 0x100 ) + return 0; + + // Try to match hd(x,y) first. + sprintf(testStr, "hd(%d,%d)", BIOS_DEV_UNIT(bvr), bvr->part_no); + if ( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) ) + return true; + + // Try to match volume UUID. + if ( bvr->fs_getuuid && bvr->fs_getuuid(bvr, testStr) == 0) + { + if( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) ) + return true; + } + + // Try to match volume label (always quoted). + if ( bvr->description ) + { + bvr->description(bvr, testStr, sizeof(testStr)-1); + if( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) ) + return true; + } + + return false; +} + +/* If Rename Partition has defined an alias, then extract it for description purpose. + * The format for the rename string is the following: + * hd(x,y)|uuid|"label" "alias";hd(m,n)|uuid|"label" "alias"; etc... + */ + +bool getVolumeLabelAlias(BVRef bvr, char* str, long strMaxLen) +{ + char *aliasList, *entryStart, *entryNext; + + if ( !str || strMaxLen <= 0) + return false; + + aliasList = XMLDecode(getStringForKey(kRenamePartition, &bootInfo->chameleonConfig)); + if ( !aliasList ) + return false; + + for ( entryStart = entryNext = aliasList; + entryNext && *entryNext; + entryStart = entryNext ) + { + char *volStart, *volEnd, *aliasStart; + long volLen, aliasLen; + + // Delimit current entry + entryNext = strchr(entryStart, ';'); + if ( entryNext ) + { + *entryNext = '\0'; + entryNext++; + } + + volStart = strbreak(entryStart, &volEnd, &volLen); + if(!volLen) + continue; + + aliasStart = strbreak(volEnd, 0, &aliasLen); + if(!aliasLen) + continue; + + if ( matchVolumeToString(bvr, volStart, volLen) ) + { + strncat(str, aliasStart, MIN(strMaxLen, aliasLen)); + free(aliasList); + + return true; + } + } + + free(aliasList); + return false; +} + +void getBootVolumeDescription( BVRef bvr, char * str, long strMaxLen, bool useDeviceDescription ) +{ + unsigned char type; + char *p = str; + + if(!bvr || !p || strMaxLen <= 0) + return; + + type = (unsigned char) bvr->part_type; + + if (useDeviceDescription) + { + int len = getDeviceDescription(bvr, str); + if(len >= strMaxLen) + return; + + strcpy(str + len, bvr->OSisInstaller ? " (Installer) " : " "); + len += bvr->OSisInstaller ? 13 : 1; + strMaxLen -= len; + p += len; + } + + /* See if a partition rename is preferred */ + if(getVolumeLabelAlias(bvr, p, strMaxLen)) { + strncpy(bvr->label, p, strMaxLen); + return; // we're done here no need to seek for real name + } + + // + // Get the volume label using filesystem specific functions + // or use the alternate volume label if available. + // + if (*bvr->altlabel != '\0') + strncpy(p, bvr->altlabel, strMaxLen); + else if (bvr->description) + bvr->description(bvr, p, strMaxLen); + + if (*p == '\0') { + const char * name = getNameForValue( fdiskTypes, type ); + if (name == NULL) { + name = bvr->type_name; + } + if (name == NULL) { + sprintf(p, "TYPE %02x", type); + } else { + strncpy(p, name, strMaxLen); + } + } + + // Set the devices label + sprintf(bvr->label, p); +} + +//========================================================================== +int readBootSector( int biosdev, unsigned int secno, void * buffer ) +{ + struct disk_blk0 * bootSector = (struct disk_blk0 *) buffer; + int error; + + if ( bootSector == NULL ) + { + if ( gBootSector == NULL ) + { + gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector)); + if ( gBootSector == NULL ) return -1; + } + bootSector = gBootSector; + } + + error = readBytes( biosdev, secno, 0, BPS, bootSector ); + if ( error || bootSector->signature != DISK_SIGNATURE ) + return -1; + + return 0; +} + +/* + * Format of boot1f32 block. + */ + +#define BOOT1F32_MAGIC "BOOT " +#define BOOT1F32_MAGICLEN 11 + +struct disk_boot1f32_blk { + unsigned char init[3]; + unsigned char fsheader[87]; + unsigned char magic[BOOT1F32_MAGICLEN]; + unsigned char bootcode[409]; + unsigned short signature; +}; + +int testFAT32EFIBootSector( int biosdev, unsigned int secno, void * buffer ) +{ + struct disk_boot1f32_blk * bootSector = (struct disk_boot1f32_blk *) buffer; + int error; + + if ( bootSector == NULL ) + { + if ( gBootSector == NULL ) + { + gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector)); + if ( gBootSector == NULL ) return -1; + } + bootSector = (struct disk_boot1f32_blk *) gBootSector; + } + + error = readBytes( biosdev, secno, 0, BPS, bootSector ); + if ( error || bootSector->signature != DISK_SIGNATURE + || strncmp((const char *)bootSector->magic, BOOT1F32_MAGIC, BOOT1F32_MAGICLEN) ) + return -1; + + return 0; +} + +//========================================================================== +// Handle seek request from filesystem modules. + +void diskSeek( BVRef bvr, long long position ) +{ + bvr->fs_boff = position / BPS; + bvr->fs_byteoff = position % BPS; +} + +//========================================================================== +// Handle read request from filesystem modules. + +int diskRead( BVRef bvr, long addr, long length ) +{ + return readBytes( bvr->biosdev, + bvr->fs_boff + bvr->part_boff, + bvr->fs_byteoff, + length, + (void *) addr ); +} + +int rawDiskRead( BVRef bvr, unsigned int secno, void *buffer, unsigned int len ) +{ + int secs; + unsigned char *cbuf = (unsigned char *)buffer; + unsigned int copy_len; + int rc; + + if ((len & (BPS-1)) != 0) { + error("raw disk read not sector aligned"); + return -1; + } + secno += bvr->part_boff; + + cache_valid = false; + + while (len > 0) { + secs = len / BPS; + if (secs > N_CACHE_SECS) secs = N_CACHE_SECS; + copy_len = secs * BPS; + + //printf("rdr: ebiosread(%d, %d, %d)\n", bvr->biosdev, secno, secs); + if ((rc = ebiosread(bvr->biosdev, secno, secs)) != 0) { + /* Ignore corrected ECC errors */ + if (rc != ECC_CORRECTED_ERR) { + error(" EBIOS read error: %s\n", bios_error(rc), rc); + error(" Block %d Sectors %d\n", secno, secs); + return rc; + } + } + bcopy( trackbuf, cbuf, copy_len ); + len -= copy_len; + cbuf += copy_len; + secno += secs; + spinActivityIndicator(secs); + } + + return 0; +} + +int rawDiskWrite( BVRef bvr, unsigned int secno, void *buffer, unsigned int len ) +{ + int secs; + unsigned char *cbuf = (unsigned char *)buffer; + unsigned int copy_len; + int rc; + + if ((len & (BPS-1)) != 0) { + error("raw disk write not sector aligned"); + return -1; + } + secno += bvr->part_boff; + + cache_valid = false; + + while (len > 0) { + secs = len / BPS; + if (secs > N_CACHE_SECS) secs = N_CACHE_SECS; + copy_len = secs * BPS; + + bcopy( cbuf, trackbuf, copy_len ); + //printf("rdr: ebioswrite(%d, %d, %d)\n", bvr->biosdev, secno, secs); + if ((rc = ebioswrite(bvr->biosdev, secno, secs)) != 0) { + error(" EBIOS write error: %s\n", bios_error(rc), rc); + error(" Block %d Sectors %d\n", secno, secs); + return rc; + } + len -= copy_len; + cbuf += copy_len; + secno += secs; + spinActivityIndicator(secs); + } + + return 0; +} + +int diskIsCDROM(BVRef bvr) +{ + struct driveInfo di; + + if (getDriveInfo(bvr->biosdev, &di) == 0 && di.no_emulation) { + return 1; + } + return 0; +} + +int biosDevIsCDROM(int biosdev) +{ + struct driveInfo di; + + if (getDriveInfo(biosdev, &di) == 0 && di.no_emulation) + { + return 1; + } + return 0; +} diff --git a/i386/libsaio/.svn/text-base/disk.h.svn-base b/i386/libsaio/.svn/text-base/disk.h.svn-base new file mode 100644 index 0000000..ea1584d --- /dev/null +++ b/i386/libsaio/.svn/text-base/disk.h.svn-base @@ -0,0 +1,14 @@ +/* + * disk.h + * Chameleon + * + * Created by Daniel Miranda on 27/07/10. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ +#ifndef __LIBSAIO_DISK_H +#define __LIBSAIO_DISK_H + +bool matchVolumeToString( BVRef bvr, const char* match, long strMaxLen); + +#endif /* __LIBSAIO_DISK_H */ \ No newline at end of file diff --git a/i386/libsaio/.svn/text-base/dram_controllers.c.svn-base b/i386/libsaio/.svn/text-base/dram_controllers.c.svn-base new file mode 100644 index 0000000..5e7c168 --- /dev/null +++ b/i386/libsaio/.svn/text-base/dram_controllers.c.svn-base @@ -0,0 +1,562 @@ +/* + * dram controller access and scan from the pci host controller + * Integrated and adapted for chameleon 2.0 RC5 by Rekursor from bs0d work + * original source comes from: + * + * memtest86 + * + * Released under version 2 of the Gnu Public License. + * By Chris Brady, cbrady@sgi.com + * ---------------------------------------------------- + * MemTest86+ V4.00 Specific code (GPL V2.0) + * By Samuel DEMEULEMEESTER, sdemeule@memtest.org + * http://www.canardpc.com - http://www.memtest.org + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "dram_controllers.h" + +#ifndef DEBUG_DRAM +#define DEBUG_DRAM 0 +#endif + +#if DEBUG_DRAM +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +/* + * Initialise memory controller functions + */ + +// Setup P35 Memory Controller +static void setup_p35(pci_dt_t *dram_dev) +{ + uint32_t dev0; + + // Activate MMR I/O + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + if (!(dev0 & 0x1)) + pci_config_write8(dram_dev->dev.addr, 0x48, (dev0 | 1)); +} + +int nhm_bus = 0x3F; + +// Setup Nehalem Integrated Memory Controller +static void setup_nhm(pci_dt_t *dram_dev) +{ + static long possible_nhm_bus[] = {0xFF, 0x7F, 0x3F}; + unsigned long did, vid; + int i; + + // Nehalem supports Scrubbing + // First, locate the PCI bus where the MCH is located + for(i = 0; i < sizeof(possible_nhm_bus); i++) + { + vid = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), PCI_VENDOR_ID); + did = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), PCI_DEVICE_ID); + vid &= 0xFFFF; + did &= 0xFF00; + + if(vid == 0x8086 && did >= 0x2C00) + nhm_bus = possible_nhm_bus[i]; + } +} + +/* + * Retrieve memory controller fsb functions + */ + + +// Get i965 Memory Speed +static void get_fsb_i965(pci_dt_t *dram_dev) +{ + uint32_t dev0, mch_ratio, mch_cfg, mch_fsb; + + long *ptr; + + // Find Ratio + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + ptr = (long*)(dev0 + 0xC00); + mch_cfg = *ptr & 0xFFFF; + + mch_ratio = 100000; + + switch (mch_cfg & 7) + { + case 0: mch_fsb = 1066; break; + case 1: mch_fsb = 533; break; + default: + case 2: mch_fsb = 800; break; + case 3: mch_fsb = 667; break; + case 4: mch_fsb = 1333; break; + case 6: mch_fsb = 1600; break; + } + + DBG("mch_fsb %d\n", mch_fsb); + + switch (mch_fsb) + { + case 533: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 200000; break; + case 2: mch_ratio = 250000; break; + case 3: mch_ratio = 300000; break; + } + break; + + default: + case 800: + switch ((mch_cfg >> 4) & 7) + { + case 0: mch_ratio = 100000; break; + case 1: mch_ratio = 125000; break; + case 2: mch_ratio = 166667; break; // 1.666666667 + case 3: mch_ratio = 200000; break; + case 4: mch_ratio = 266667; break; // 2.666666667 + case 5: mch_ratio = 333333; break; // 3.333333333 + } + break; + + case 1066: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 100000; break; + case 2: mch_ratio = 125000; break; + case 3: mch_ratio = 150000; break; + case 4: mch_ratio = 200000; break; + case 5: mch_ratio = 250000; break; + } + break; + + case 1333: + switch ((mch_cfg >> 4) & 7) + { + case 2: mch_ratio = 100000; break; + case 3: mch_ratio = 120000; break; + case 4: mch_ratio = 160000; break; + case 5: mch_ratio = 200000; break; + } + break; + + case 1600: + switch ((mch_cfg >> 4) & 7) + { + case 3: mch_ratio = 100000; break; + case 4: mch_ratio = 133333; break; // 1.333333333 + case 5: mch_ratio = 150000; break; + case 6: mch_ratio = 200000; break; + } + break; + } + + DBG("mch_ratio %d\n", mch_ratio); + + // Compute RAM Frequency + Platform.RAM.Frequency = (Platform.CPU.FSBFrequency * mch_ratio) / 100000; + + DBG("ram_fsb %d\n", Platform.RAM.Frequency); + +} + +// Get i965m Memory Speed +static void get_fsb_im965(pci_dt_t *dram_dev) +{ + uint32_t dev0, mch_ratio, mch_cfg, mch_fsb; + + long *ptr; + + // Find Ratio + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + ptr = (long*)(dev0 + 0xC00); + mch_cfg = *ptr & 0xFFFF; + + mch_ratio = 100000; + + switch (mch_cfg & 7) + { + case 1: mch_fsb = 533; break; + default: + case 2: mch_fsb = 800; break; + case 3: mch_fsb = 667; break; + case 6: mch_fsb = 1066; break; + } + + switch (mch_fsb) + { + case 533: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 125000; break; + case 2: mch_ratio = 150000; break; + case 3: mch_ratio = 200000; break; + } + break; + + case 667: + switch ((mch_cfg >> 4)& 7) + { + case 1: mch_ratio = 100000; break; + case 2: mch_ratio = 120000; break; + case 3: mch_ratio = 160000; break; + case 4: mch_ratio = 200000; break; + case 5: mch_ratio = 240000; break; + } + break; + + default: + case 800: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 83333; break; // 0.833333333 + case 2: mch_ratio = 100000; break; + case 3: mch_ratio = 133333; break; // 1.333333333 + case 4: mch_ratio = 166667; break; // 1.666666667 + case 5: mch_ratio = 200000; break; + } + break; + case 1066: + switch ((mch_cfg >> 4)&7) { + case 5: mch_ratio = 150000; break; + case 6: mch_ratio = 200000; break; + } + + } + + // Compute RAM Frequency + Platform.RAM.Frequency = (Platform.CPU.FSBFrequency * mch_ratio) / 100000; +} + + +// Get iCore7 Memory Speed +static void get_fsb_nhm(pci_dt_t *dram_dev) +{ + uint32_t mch_ratio, mc_dimm_clk_ratio; + + // Get the clock ratio + mc_dimm_clk_ratio = pci_config_read16(PCIADDR(nhm_bus, 3, 4), 0x54 ); + mch_ratio = (mc_dimm_clk_ratio & 0x1F); + + // Compute RAM Frequency + Platform.RAM.Frequency = Platform.CPU.FSBFrequency * mch_ratio / 2; +} + +/* + * Retrieve memory controller info functions + */ + +// Get i965 Memory Timings +static void get_timings_i965(pci_dt_t *dram_dev) +{ + // Thanks for CDH optis + uint32_t dev0, c0ckectrl, c1ckectrl, offset; + uint32_t ODT_Control_Register, Precharge_Register, ACT_Register, Read_Register, Misc_Register; + + long *ptr; + + // Read MMR Base Address + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + + ptr = (long*)(dev0 + 0x260); + c0ckectrl = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + 0x660); + c1ckectrl = *ptr & 0xFFFFFFFF; + + // If DIMM 0 not populated, check DIMM 1 + ((c0ckectrl) >> 20 & 0xF) ? (offset = 0) : (offset = 0x400); + + ptr = (long*)(dev0 + offset + 0x29C); + ODT_Control_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x250); + Precharge_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x252); + ACT_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x258); + Read_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x244); + Misc_Register = *ptr & 0xFFFFFFFF; + + // 965 Series only support DDR2 + Platform.RAM.Type = SMB_MEM_TYPE_DDR2; + + // CAS Latency (tCAS) + Platform.RAM.CAS = ((ODT_Control_Register >> 17) & 7) + 3; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = (Read_Register >> 16) & 0xF; + + // RAS Precharge (tRP) + Platform.RAM.TRP = (ACT_Register >> 13) & 0xF; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = (Precharge_Register >> 11) & 0x1F; + + if ((c0ckectrl >> 20 & 0xF) && (c1ckectrl >> 20 & 0xF)) + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; +} + +// Get im965 Memory Timings +static void get_timings_im965(pci_dt_t *dram_dev) +{ + // Thanks for CDH optis + uint32_t dev0, c0ckectrl, c1ckectrl, offset, ODT_Control_Register, Precharge_Register; + long *ptr; + + // Read MMR Base Address + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + + ptr = (long*)(dev0 + 0x1200); + c0ckectrl = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + 0x1300); + c1ckectrl = *ptr & 0xFFFFFFFF; + + // If DIMM 0 not populated, check DIMM 1 + ((c0ckectrl) >> 20 & 0xF) ? (offset = 0) : (offset = 0x100); + + ptr = (long*)(dev0 + offset + 0x121C); + ODT_Control_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x1214); + Precharge_Register = *ptr & 0xFFFFFFFF; + + // Series only support DDR2 + Platform.RAM.Type = SMB_MEM_TYPE_DDR2; + + // CAS Latency (tCAS) + Platform.RAM.CAS = ((ODT_Control_Register >> 23) & 7) + 3; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = ((Precharge_Register >> 5) & 7) + 2; + + // RAS Precharge (tRP) + Platform.RAM.TRP= (Precharge_Register & 7) + 2; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = (Precharge_Register >> 21) & 0x1F; + + if ((c0ckectrl >> 20 & 0xF) && (c1ckectrl >> 20 & 0xF)) + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; +} + +// Get P35 Memory Timings +static void get_timings_p35(pci_dt_t *dram_dev) +{ + // Thanks for CDH optis + unsigned long dev0, Memory_Check, c0ckectrl, c1ckectrl, offset; + unsigned long ODT_Control_Register, Precharge_Register, ACT_Register, Read_Register, Misc_Register; + long *ptr; + + //Device_ID = pci_config_read16(dram_dev->dev.addr, 0x02); + //Device_ID &= 0xFFFF; + + // Now, read MMR Base Address + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + + ptr = (long*)(dev0 + 0x260); + c0ckectrl = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + 0x660); + c1ckectrl = *ptr & 0xFFFFFFFF; + + // If DIMM 0 not populated, check DIMM 1 + ((c0ckectrl) >> 20 & 0xF) ? (offset = 0) : (offset = 0x400); + + ptr = (long*)(dev0 + offset + 0x265); + ODT_Control_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x25D); + Precharge_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x252); + ACT_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x258); + Read_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x244); + Misc_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x1E8); + Memory_Check = *ptr & 0xFFFFFFFF; + + // On P45, check 1A8 + if(dram_dev->device_id > 0x2E00) { + ptr = (long*)(dev0 + offset + 0x1A8); + Memory_Check = *ptr & 0xFFFFFFFF; + Memory_Check >>= 2; + Memory_Check &= 1; + Memory_Check = !Memory_Check; + } else { + ptr = (long*)(dev0 + offset + 0x1E8); + Memory_Check = *ptr & 0xFFFFFFFF; + } + + // Determine DDR-II or DDR-III + if (Memory_Check & 1) + Platform.RAM.Type = SMB_MEM_TYPE_DDR2; + else + Platform.RAM.Type = SMB_MEM_TYPE_DDR3; + + // CAS Latency (tCAS) + if(dram_dev->device_id > 0x2E00) + Platform.RAM.CAS = ((ODT_Control_Register >> 8) & 0x3F) - 6; + else + Platform.RAM.CAS = ((ODT_Control_Register >> 8) & 0x3F) - 9; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = (Read_Register >> 17) & 0xF; + + // RAS Precharge (tRP) + Platform.RAM.TRP = (ACT_Register >> 13) & 0xF; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = Precharge_Register & 0x3F; + + // Channel configuration + if (((c0ckectrl >> 20) & 0xF) && ((c1ckectrl >> 20) & 0xF)) + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; +} + +// Get Nehalem Memory Timings +static void get_timings_nhm(pci_dt_t *dram_dev) +{ + unsigned long mc_channel_bank_timing, mc_control, mc_channel_mrs_value; + int fvc_bn = 4; + + // Find which channels are populated + mc_control = pci_config_read16(PCIADDR(nhm_bus, 3, 0), 0x48); + mc_control = (mc_control >> 8) & 0x7; + + // DDR-III + Platform.RAM.Type = SMB_MEM_TYPE_DDR3; + + // Get the first valid channel + if(mc_control & 1) + fvc_bn = 4; + else if(mc_control & 2) + fvc_bn = 5; + else if(mc_control & 7) + fvc_bn = 6; + + // Now, detect timings + mc_channel_bank_timing = pci_config_read32(PCIADDR(nhm_bus, fvc_bn, 0), 0x88); + mc_channel_mrs_value = pci_config_read32(PCIADDR(nhm_bus, fvc_bn, 0), 0x70); + + // CAS Latency (tCAS) + Platform.RAM.CAS = ((mc_channel_mrs_value >> 4) & 0xF ) + 4; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = (mc_channel_bank_timing >> 9) & 0xF; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = (mc_channel_bank_timing >> 4) & 0x1F; + + // RAS Precharge (tRP) + Platform.RAM.TRP = mc_channel_bank_timing & 0xF; + + // Single , Dual or Triple Channels + if (mc_control == 1 || mc_control == 2 || mc_control == 4 ) + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; + else if (mc_control == 7) + Platform.RAM.Channels = SMB_MEM_CHANNEL_TRIPLE; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; +} + +static struct mem_controller_t dram_controllers[] = { + + // Default unknown chipset + { 0, 0, "", NULL, NULL, NULL }, + + // Intel + { 0x8086, 0x7190, "VMWare", NULL, NULL, NULL }, + + { 0x8086, 0x1A30, "i845", NULL, NULL, NULL }, + + { 0x8086, 0x2970, "i946PL/GZ", setup_p35, get_fsb_i965, get_timings_i965 }, + { 0x8086, 0x2990, "Q963/Q965", setup_p35, get_fsb_i965, get_timings_i965 }, + { 0x8086, 0x29A0, "P965/G965", setup_p35, get_fsb_i965, get_timings_i965 }, + + { 0x8086, 0x2A00, "GM965/GL960", setup_p35, get_fsb_im965, get_timings_im965 }, + { 0x8086, 0x2A10, "GME965/GLE960", setup_p35, get_fsb_im965, get_timings_im965 }, + { 0x8086, 0x2A40, "PM/GM45/47", setup_p35, get_fsb_im965, get_timings_im965 }, + + { 0x8086, 0x29B0, "Q35", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x29C0, "P35/G33", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x29D0, "Q33", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x29E0, "X38/X48", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E00, "Eaglelake", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E10, "Q45/Q43", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E20, "P45/G45", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E30, "G41", setup_p35, get_fsb_i965, get_timings_p35 }, + + { 0x8086, 0xD131, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0xD132, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3400, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3401, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3402, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3403, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3404, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3405, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3406, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3407, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, +}; + +static const char *memory_channel_types[] = +{ + "Unknown", "Single", "Dual", "Triple" +}; + +void scan_dram_controller(pci_dt_t *dram_dev) +{ + int i; + for(i = 1; i < sizeof(dram_controllers) / sizeof(dram_controllers[0]); i++) + if ((dram_controllers[i].vendor == dram_dev->vendor_id) + && (dram_controllers[i].device == dram_dev->device_id)) + { + verbose("%s%s DRAM Controller [%4x:%4x] at %02x:%02x.%x\n", + (dram_dev->vendor_id == 0x8086) ? "Intel " : "" , + dram_controllers[i].name, dram_dev->vendor_id, dram_dev->device_id, + dram_dev->dev.bits.bus, dram_dev->dev.bits.dev, dram_dev->dev.bits.func); + + if (dram_controllers[i].initialise != NULL) + dram_controllers[i].initialise(dram_dev); + + if (dram_controllers[i].poll_timings != NULL) + dram_controllers[i].poll_timings(dram_dev); + + if (dram_controllers[i].poll_speed != NULL) + dram_controllers[i].poll_speed(dram_dev); + + verbose("Frequency detected: %d MHz (%d) %s Channel \n\tCAS:%d tRC:%d tRP:%d RAS:%d (%d-%d-%d-%d)\n", + (uint32_t)Platform.RAM.Frequency / 1000000, + (uint32_t)Platform.RAM.Frequency / 500000, + memory_channel_types[Platform.RAM.Channels] + ,Platform.RAM.CAS, Platform.RAM.TRC, Platform.RAM.TRP, Platform.RAM.RAS + ,Platform.RAM.CAS, Platform.RAM.TRC, Platform.RAM.TRP, Platform.RAM.RAS + ); +// getchar(); + } +} diff --git a/i386/libsaio/.svn/text-base/dram_controllers.h.svn-base b/i386/libsaio/.svn/text-base/dram_controllers.h.svn-base new file mode 100644 index 0000000..984f73c --- /dev/null +++ b/i386/libsaio/.svn/text-base/dram_controllers.h.svn-base @@ -0,0 +1,32 @@ +/* + * dram controller access and scan from the pci host controller + * Integrated and adapted for chameleon 2.0 RC5 by Rekursor from bs0d work + * original source comes from: + * + * memtest86 + * + * Released under version 2 of the Gnu Public License. + * By Chris Brady, cbrady@sgi.com + * ---------------------------------------------------- + * MemTest86+ V4.00 Specific code (GPL V2.0) + * By Samuel DEMEULEMEESTER, sdemeule@memtest.org + * http://www.canardpc.com - http://www.memtest.org + */ + +#ifndef __LIBSAIO_DRAM_CONTROLLERS_H +#define __LIBSAIO_DRAM_CONTROLLERS_H + +#include "libsaio.h" + +void scan_dram_controller(); + +struct mem_controller_t { + uint16_t vendor; + uint16_t device; + char *name; + void (*initialise)(pci_dt_t *dram_dev); + void (*poll_speed)(pci_dt_t *dram_dev); + void (*poll_timings)(pci_dt_t *dram_dev); +}; + +#endif /* !__LIBSAIO_DRAM_CONTROLLERS_H */ diff --git a/i386/libsaio/.svn/text-base/efi.h.svn-base b/i386/libsaio/.svn/text-base/efi.h.svn-base new file mode 100644 index 0000000..5ef7a5b --- /dev/null +++ b/i386/libsaio/.svn/text-base/efi.h.svn-base @@ -0,0 +1,558 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _PEXPERT_I386_EFI_H +#define _PEXPERT_I386_EFI_H + +#include <stdint.h> + +typedef uint8_t EFI_UINT8; +typedef uint16_t EFI_UINT16; +typedef uint32_t EFI_UINT32; +typedef uint64_t EFI_UINT64; + +typedef uint32_t EFI_UINTN; /* natural size for firmware, not kernel */ + +typedef int8_t EFI_INT8; +typedef int16_t EFI_INT16; +typedef int32_t EFI_INT32; +typedef int64_t EFI_INT64; + +typedef int8_t EFI_CHAR8; +typedef int16_t EFI_CHAR16; +typedef int32_t EFI_CHAR32; +typedef int64_t EFI_CHAR64; + +typedef uint32_t EFI_STATUS; +typedef uint8_t EFI_BOOLEAN; +typedef void VOID; + +typedef uint32_t EFI_PTR32; +typedef uint32_t EFI_HANDLE32; + +typedef uint64_t EFI_PTR64; +typedef uint64_t EFI_HANDLE64; +/* + +Portions Copyright 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +*/ + + +// +// Modifiers for EFI Runtime and Boot Services +// +#define EFI_RUNTIMESERVICE +#define EFIAPI +#define IN +#define OUT +#define OPTIONAL + +#define EFI_MAX_BIT 0x80000000 + +// +// Set the upper bit to indicate EFI Error. +// +#define EFIERR(a) (EFI_MAX_BIT | (a)) + +#define EFIWARN(a) (a) +#define EFI_ERROR(a) (((INTN) (a)) < 0) + +#define EFI_SUCCESS 0 +#define EFI_LOAD_ERROR EFIERR (1) +#define EFI_INVALID_PARAMETER EFIERR (2) +#define EFI_UNSUPPORTED EFIERR (3) +#define EFI_BAD_BUFFER_SIZE EFIERR (4) +#define EFI_BUFFER_TOO_SMALL EFIERR (5) +#define EFI_NOT_READY EFIERR (6) +#define EFI_DEVICE_ERROR EFIERR (7) +#define EFI_WRITE_PROTECTED EFIERR (8) +#define EFI_OUT_OF_RESOURCES EFIERR (9) +#define EFI_VOLUME_CORRUPTED EFIERR (10) +#define EFI_VOLUME_FULL EFIERR (11) +#define EFI_NO_MEDIA EFIERR (12) +#define EFI_MEDIA_CHANGED EFIERR (13) +#define EFI_NOT_FOUND EFIERR (14) +#define EFI_ACCESS_DENIED EFIERR (15) +#define EFI_NO_RESPONSE EFIERR (16) +#define EFI_NO_MAPPING EFIERR (17) +#define EFI_TIMEOUT EFIERR (18) +#define EFI_NOT_STARTED EFIERR (19) +#define EFI_ALREADY_STARTED EFIERR (20) +#define EFI_ABORTED EFIERR (21) +#define EFI_ICMP_ERROR EFIERR (22) +#define EFI_TFTP_ERROR EFIERR (23) +#define EFI_PROTOCOL_ERROR EFIERR (24) +#define EFI_INCOMPATIBLE_VERSION EFIERR (25) +#define EFI_SECURITY_VIOLATION EFIERR (26) +#define EFI_CRC_ERROR EFIERR (27) + +#define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1) +#define EFI_WARN_DELETE_FAILURE EFIWARN (2) +#define EFI_WARN_WRITE_FAILURE EFIWARN (3) +#define EFI_WARN_BUFFER_TOO_SMALL EFIWARN (4) + +// +// EFI Specification Revision information +// +#define EFI_SPECIFICATION_MAJOR_REVISION 1 +#define EFI_SPECIFICATION_MINOR_REVISION 10 + +typedef struct { + EFI_UINT32 Data1; + EFI_UINT16 Data2; + EFI_UINT16 Data3; + EFI_UINT8 Data4[8]; +} EFI_GUID; + +#define APPLE_VENDOR_GUID \ + {0xAC39C713, 0x7E50, 0x423D, {0x88, 0x9D, 0x27,0x8F, 0xCC, 0x34, 0x22, 0xB6} } + +#define EFI_GLOBAL_VARIABLE_GUID \ + {0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } + +typedef union { + EFI_GUID Guid; + EFI_UINT8 Raw[16]; +} EFI_GUID_UNION; + +// +// EFI Time Abstraction: +// Year: 2000 - 20XX +// Month: 1 - 12 +// Day: 1 - 31 +// Hour: 0 - 23 +// Minute: 0 - 59 +// Second: 0 - 59 +// Nanosecond: 0 - 999,999,999 +// TimeZone: -1440 to 1440 or 2047 +// +typedef struct { + EFI_UINT16 Year; + EFI_UINT8 Month; + EFI_UINT8 Day; + EFI_UINT8 Hour; + EFI_UINT8 Minute; + EFI_UINT8 Second; + EFI_UINT8 Pad1; + EFI_UINT32 Nanosecond; + EFI_INT16 TimeZone; + EFI_UINT8 Daylight; + EFI_UINT8 Pad2; +} EFI_TIME; + +// +// Bit definitions for EFI_TIME.Daylight +// +#define EFI_TIME_ADJUST_DAYLIGHT 0x01 +#define EFI_TIME_IN_DAYLIGHT 0x02 + +// +// Value definition for EFI_TIME.TimeZone +// +#define EFI_UNSPECIFIED_TIMEZONE 0x07FF + +typedef enum { + EfiReservedMemoryType, + EfiLoaderCode, + EfiLoaderData, + EfiBootServicesCode, + EfiBootServicesData, + EfiRuntimeServicesCode, + EfiRuntimeServicesData, + EfiConventionalMemory, + EfiUnusableMemory, + EfiACPIReclaimMemory, + EfiACPIMemoryNVS, + EfiMemoryMappedIO, + EfiMemoryMappedIOPortSpace, + EfiPalCode, + EfiMaxMemoryType +} EFI_MEMORY_TYPE; + +typedef struct { + EFI_UINT64 Signature; + EFI_UINT32 Revision; + EFI_UINT32 HeaderSize; + EFI_UINT32 CRC32; + EFI_UINT32 Reserved; +} __attribute__((aligned(8))) EFI_TABLE_HEADER; + +// +// possible caching types for the memory range +// +#define EFI_MEMORY_UC 0x0000000000000001ULL +#define EFI_MEMORY_WC 0x0000000000000002ULL +#define EFI_MEMORY_WT 0x0000000000000004ULL +#define EFI_MEMORY_WB 0x0000000000000008ULL +#define EFI_MEMORY_UCE 0x0000000000000010ULL + +// +// physical memory protection on range +// +#define EFI_MEMORY_WP 0x0000000000001000ULL +#define EFI_MEMORY_RP 0x0000000000002000ULL +#define EFI_MEMORY_XP 0x0000000000004000ULL + +// +// range requires a runtime mapping +// +#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL + +typedef EFI_UINT64 EFI_PHYSICAL_ADDRESS; +typedef EFI_UINT64 EFI_VIRTUAL_ADDRESS; + +#define EFI_MEMORY_DESCRIPTOR_VERSION 1 +typedef struct { + EFI_UINT32 Type; + EFI_UINT32 Pad; + EFI_PHYSICAL_ADDRESS PhysicalStart; + EFI_VIRTUAL_ADDRESS VirtualStart; + EFI_UINT64 NumberOfPages; + EFI_UINT64 Attribute; +} __attribute__((aligned(8))) EFI_MEMORY_DESCRIPTOR; + + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) ( + IN EFI_UINTN MemoryMapSize, + IN EFI_UINTN DescriptorSize, + IN EFI_UINT32 DescriptorVersion, + IN EFI_MEMORY_DESCRIPTOR * VirtualMap + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_CONVERT_POINTER) ( + IN EFI_UINTN DebugDisposition, + IN OUT VOID **Address + ) __attribute__((regparm(0))); + +// +// Variable attributes +// +#define EFI_VARIABLE_NON_VOLATILE 0x00000001 +#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 +#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_READ_ONLY 0x00000008 + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_VARIABLE) ( + IN EFI_CHAR16 * VariableName, + IN EFI_GUID * VendorGuid, + OUT EFI_UINT32 * Attributes OPTIONAL, + IN OUT EFI_UINTN * DataSize, + OUT VOID * Data + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) ( + IN OUT EFI_UINTN * VariableNameSize, + IN OUT EFI_CHAR16 * VariableName, + IN OUT EFI_GUID * VendorGuid + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_VARIABLE) ( + IN EFI_CHAR16 * VariableName, + IN EFI_GUID * VendorGuid, + IN EFI_UINT32 Attributes, + IN EFI_UINTN DataSize, + IN VOID * Data + ) __attribute__((regparm(0))); + +// +// EFI Time +// +typedef struct { + EFI_UINT32 Resolution; + EFI_UINT32 Accuracy; + EFI_BOOLEAN SetsToZero; +} __attribute__((aligned(4))) EFI_TIME_CAPABILITIES; + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_TIME) ( + OUT EFI_TIME * Time, + OUT EFI_TIME_CAPABILITIES * Capabilities OPTIONAL + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_TIME) ( + IN EFI_TIME * Time + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_WAKEUP_TIME) ( + OUT EFI_BOOLEAN * Enabled, + OUT EFI_BOOLEAN * Pending, + OUT EFI_TIME * Time + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_WAKEUP_TIME) ( + IN EFI_BOOLEAN Enable, + IN EFI_TIME * Time OPTIONAL + ) __attribute((regparm(0))); + +typedef enum { + EfiResetCold, + EfiResetWarm, + EfiResetShutdown, + +#ifdef TIANO_EXTENSION_FLAG + EfiResetUpdate +#endif + +} EFI_RESET_TYPE; + +typedef +EFI_RUNTIMESERVICE +VOID +(EFIAPI *EFI_RESET_SYSTEM) ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN EFI_UINTN DataSize, + IN EFI_CHAR16 * ResetData OPTIONAL + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) ( + OUT EFI_UINT32 * HighCount + ) __attribute__((regparm(0))); + +// +// Definition of Status Code extended data header +// +// HeaderSize The size of the architecture. This is specified to enable +// the future expansion +// +// Size The size of the data in bytes. This does not include the size +// of the header structure. +// +// Type A GUID defining the type of the data +// +// +#ifdef TIANO_EXTENSION_FLAG + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_REPORT_STATUS_CODE) ( + IN EFI_STATUS_CODE_TYPE Type, + IN EFI_STATUS_CODE_VALUE Value, + IN EFI_UINT32 Instance, + IN EFI_GUID * CallerId OPTIONAL, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) __attribute__((regparm(0))); + +#endif +// +// EFI Runtime Services Table +// +#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL +#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION)) + +typedef struct { + EFI_TABLE_HEADER Hdr; + + // + // Time services + // + EFI_PTR32 GetTime; + EFI_PTR32 SetTime; + EFI_PTR32 GetWakeupTime; + EFI_PTR32 SetWakeupTime; + + // + // Virtual memory services + // + EFI_PTR32 SetVirtualAddressMap; + EFI_PTR32 ConvertPointer; + + // + // Variable services + // + EFI_PTR32 GetVariable; + EFI_PTR32 GetNextVariableName; + EFI_PTR32 SetVariable; + + // + // Misc + // + EFI_PTR32 GetNextHighMonotonicCount; + EFI_PTR32 ResetSystem; + +#ifdef TIANO_EXTENSION_FLAG + // + // //////////////////////////////////////////////////// + // Extended EFI Services + ////////////////////////////////////////////////////// + // + EFI_PTR32 ReportStatusCode; +#endif + +} __attribute__((aligned(8))) EFI_RUNTIME_SERVICES_32; + +typedef struct { + EFI_TABLE_HEADER Hdr; + + // + // Time services + // + EFI_PTR64 GetTime; + EFI_PTR64 SetTime; + EFI_PTR64 GetWakeupTime; + EFI_PTR64 SetWakeupTime; + + // + // Virtual memory services + // + EFI_PTR64 SetVirtualAddressMap; + EFI_PTR64 ConvertPointer; + + // + // Variable services + // + EFI_PTR64 GetVariable; + EFI_PTR64 GetNextVariableName; + EFI_PTR64 SetVariable; + + // + // Misc + // + EFI_PTR64 GetNextHighMonotonicCount; + EFI_PTR64 ResetSystem; + +#ifdef TIANO_EXTENSION_FLAG + // + // //////////////////////////////////////////////////// + // Extended EFI Services + ////////////////////////////////////////////////////// + // + EFI_PTR64 ReportStatusCode; +#endif + +} __attribute__((aligned(8))) EFI_RUNTIME_SERVICES_64; + +// +// EFI Configuration Table +// +typedef struct { + EFI_GUID VendorGuid; + EFI_PTR32 VendorTable; +} EFI_CONFIGURATION_TABLE_32; + +typedef struct { + EFI_GUID VendorGuid; + EFI_PTR64 VendorTable; +} __attribute__((aligned(8))) EFI_CONFIGURATION_TABLE_64; + +// +// EFI System Table +// +#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL +#define EFI_SYSTEM_TABLE_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION)) +#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | 00) +#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | 02) +#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | 10) + +typedef struct EFI_SYSTEM_TABLE_32 { + EFI_TABLE_HEADER Hdr; + + EFI_PTR32 FirmwareVendor; + EFI_UINT32 FirmwareRevision; + + EFI_HANDLE32 ConsoleInHandle; + EFI_PTR32 ConIn; + + EFI_HANDLE32 ConsoleOutHandle; + EFI_PTR32 ConOut; + + EFI_HANDLE32 StandardErrorHandle; + EFI_PTR32 StdErr; + + EFI_PTR32 RuntimeServices; + EFI_PTR32 BootServices; + + EFI_UINT32 NumberOfTableEntries; + EFI_PTR32 ConfigurationTable; + +} __attribute__((aligned(8))) EFI_SYSTEM_TABLE_32; + +typedef struct EFI_SYSTEM_TABLE_64 { + EFI_TABLE_HEADER Hdr; + + EFI_PTR64 FirmwareVendor; + EFI_UINT32 FirmwareRevision; + + EFI_UINT32 __pad; + + EFI_HANDLE64 ConsoleInHandle; + EFI_PTR64 ConIn; + + EFI_HANDLE64 ConsoleOutHandle; + EFI_PTR64 ConOut; + + EFI_HANDLE64 StandardErrorHandle; + EFI_PTR64 StdErr; + + EFI_PTR64 RuntimeServices; + EFI_PTR64 BootServices; + + EFI_UINT64 NumberOfTableEntries; + EFI_PTR64 ConfigurationTable; + +} __attribute__((aligned(8))) EFI_SYSTEM_TABLE_64; + +#endif /* _PEXPERT_I386_EFI_H */ diff --git a/i386/libsaio/.svn/text-base/exfat.c.svn-base b/i386/libsaio/.svn/text-base/exfat.c.svn-base new file mode 100644 index 0000000..197b261 --- /dev/null +++ b/i386/libsaio/.svn/text-base/exfat.c.svn-base @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2004 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * dmazar, 14/7/2011 + * support for EXFAT volume label reading + * EXFAT info from: http://www.ntfs.com/exfat-overview.htm + * + * EXFAT shares partition type with NTFS (0x7) and easiest way of + * adding it was through ntfs.c module. All functions here are called + * from similar ntfs.c funcs as fallback (if not NTFS, maybe it's EXFAT). + */ + +#include "libsaio.h" +#include "sl.h" + +#ifndef DEBUG_EXFAT +#define DEBUG_EXFAT 0 +#endif + +#if DEBUG_EXFAT +#define DBG(x...) printf(x) +#define PAUSE() getchar() +#else +#define DBG(x...) +#define PAUSE() +#endif + +#define EXFAT_BBID "EXFAT " +#define EXFAT_BBIDLEN 8 + +#define MAX_BLOCK_SIZE 4096 +#define MAX_CLUSTER_SIZE 32 * 1024 * 1024 + +#define ERROR -1 + + +/* + * boot sector of the partition + * http://www.ntfs.com/exfat-boot-sector.htm + */ +struct exfatbootfile { + u_int8_t reserved1[3]; /* JumpBoot: 0xEB7690 */ + u_int8_t bf_sysid[8]; /* FileSystemName: 'EXFAT ' */ + u_int8_t reserved2[53]; /* MustBeZero */ + u_int64_t bf_prtoff; /* PartitionOffset: In sectors; if 0, shall be ignored */ + u_int64_t bf_vollen; /* VolumeLength: Size of exFAT volume in sectors */ + u_int32_t bf_fatoff; /* FatOffset: In sectors */ + u_int32_t bf_fatlen; /* FatLength: In sectors. May exceed the required space in order to align the second FAT */ + u_int32_t bf_cloff; /* ClusterHeapOffset: In sectors. */ + u_int32_t bf_clcnt; /* ClusterCount: 2^32-11 is the maximum number of clusters could be described. */ + u_int32_t bf_rdircl; /* RootDirectoryCluster. */ + u_int32_t bf_volsn; /* VolumeSerialNumber. */ + u_int16_t bf_fsrev; /* FileSystemRevision: as MAJOR.minor, major revision is high byte, minor is low byte; currently 01.00. */ + u_int16_t bf_volflags; /* VolumeFlags. */ + u_int8_t bf_bpss; /* BytesPerSectorShift: Power of 2. Minimum 9 (512 bytes per sector), maximum 12 (4096 bytes per sector) */ + u_int8_t bf_spcs; /* SectorsPerClusterShift: Power of 2. Minimum 0 (1 sector per cluster), maximum 25 BytesPerSectorShift, so max cluster size is 32 MB */ + u_int8_t bf_nfats; /* NumberOfFats: 2 is for TexFAT only */ + u_int8_t bf_drvs; /* DriveSelect: Extended INT 13h drive number; typically 0x80 */ + u_int8_t bf_pused; /* PercentInUse: 0..100 percentage of allocated clusters rounded down to the integer 0xFF percentage is not available */ + u_int8_t reserved3[7]; /* Reserved */ + u_int8_t bootcode[390]; /* BootCode */ + u_int16_t bf_bsig; /* BootSignature: 0xAA55 */ +}; + +struct direntry_label { + u_int8_t type; /* EntryType: 0x83 (or 0x03 if label is empty) */ + u_int8_t llen; /* CharacterCount: Length in Unicode characters (max 11) */ + u_int16_t label[11]; /* VolumeLabel: Unicode characters (max 11) */ + u_int8_t reserved1[8]; /* Reserved */ +}; + + +/** + * Reads volume label into str. + * Reads boot sector, performs dome checking, loads root dir + * and parses volume label. + */ +void +EXFATGetDescription(CICell ih, char *str, long strMaxLen) +{ + struct exfatbootfile *boot; + u_int32_t bytesPerSector = 0; + u_int32_t sectorsPerCluster = 0; + long long rdirOffset = 0; + char *buf = NULL; + struct direntry_label *dire = NULL; + int loopControl = 0; + + DBG("EXFAT: start %x:%x\n", ih->biosdev, ih->part_no); + + buf = (char *)malloc(MAX_BLOCK_SIZE); + if (buf == 0) + { + goto error; + } + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + // take our boot structure + boot = (struct exfatbootfile *) buf; + + /* + * The first three bytes are an Intel x86 jump instruction. I assume it + * can be the same forms as DOS FAT: + * 0xE9 0x?? 0x?? + * 0xEC 0x?? 0x90 + * where 0x?? means any byte value is OK. + */ + if (boot->reserved1[0] != 0xE9 + && (boot->reserved1[0] != 0xEB || boot->reserved1[2] != 0x90)) + { + goto error; + } + + // Check the "EXFAT " signature. + if (memcmp((const char *)boot->bf_sysid, EXFAT_BBID, EXFAT_BBIDLEN) != 0) + { + goto error; + } + + /* + * Make sure the bytes per sector and sectors per cluster are + * powers of two, and within reasonable ranges. + */ + bytesPerSector = 1 << boot->bf_bpss; /* Just one byte; no swapping needed */ + DBG("EXFAT: bpss=%d, bytesPerSector=%d\n", boot->bf_bpss, bytesPerSector); + if (boot->bf_bpss < 9 || boot->bf_bpss > 12) + { + DBG("EXFAT: invalid bytes per sector shift(%d)\n", boot->bf_bpss); + goto error; + } + + sectorsPerCluster = 1 << boot->bf_spcs; /* Just one byte; no swapping needed */ + DBG("EXFAT: spcs=%d, sectorsPerCluster=%d\n", boot->bf_spcs, sectorsPerCluster); + if (boot->bf_spcs > (25 - boot->bf_bpss)) + { + DBG("EXFAT: invalid sectors per cluster shift (%d)\n", boot->bf_spcs); + goto error; + } + + // calculate root dir cluster offset + rdirOffset = boot->bf_cloff + (boot->bf_rdircl - 2) * sectorsPerCluster; + DBG("EXFAT: rdirOffset=%d\n", rdirOffset); + + // load MAX_BLOCK_SIZE bytes of root dir + Seek(ih, rdirOffset * bytesPerSector); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + DBG("buf 0 1 2 = %x %x %x\n", 0x00ff & buf[0], 0x00ff & buf[1], 0x00ff & buf[2]); + + str[0] = '\0'; + + /* + * Search for volume label dir entry (type 0x83), convert from unicode and put to str. + * Set loopControl var to avoid searching outside of buf. + */ + loopControl = MAX_BLOCK_SIZE / sizeof(struct direntry_label); + dire = (struct direntry_label *)buf; + while (loopControl && dire->type && dire->type != 0x83) + { + dire++; + loopControl--; + } + if (dire->type == 0x83 && dire->llen > 0 && dire->llen <= 11) + { + utf_encodestr( dire->label, (int)dire->llen, (u_int8_t *)str, strMaxLen, OSLittleEndian ); + } + DBG("EXFAT: label=%s\n", str); + + free(buf); + PAUSE(); + return; + + error: + if (buf) free(buf); + DBG("EXFAT: error\n"); + PAUSE(); + return; +} + +/** + * Sets UUID to uuidStr. + * Reads the boot sector, does some checking, generates UUID + * (like the one you get on Windows???) + */ +long EXFATGetUUID(CICell ih, char *uuidStr) +{ + struct exfatbootfile *boot; + void *buf = malloc(MAX_BLOCK_SIZE); + if ( !buf ) + return -1; + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + boot = (struct exfatbootfile *) buf; + + /* + * Check the "EXFAT " signature. + */ + if (memcmp((const char *)boot->bf_sysid, EXFAT_BBID, EXFAT_BBIDLEN) != 0) + return -1; + + // Check for non-null volume serial number + if( !boot->bf_volsn ) + return -1; + + // Use UUID like the one you get on Windows + sprintf(uuidStr, "%04X-%04X", (unsigned short)(boot->bf_volsn >> 16) & 0xFFFF, + (unsigned short)boot->bf_volsn & 0xFFFF); + + DBG("EXFATGetUUID: %x:%x = %s\n", ih->biosdev, ih->part_no, uuidStr); + return 0; +} + +/** + * Returns true if given buffer is the boot rec of the EXFAT volume. + */ +bool EXFATProbe(const void * buffer) +{ + bool result = false; + + // boot sector structure + const struct exfatbootfile * boot = buffer; + + // Looking for EXFAT signature. + if (memcmp((const char *)boot->bf_sysid, EXFAT_BBID, EXFAT_BBIDLEN) == 0) + result = true; + + DBG("EXFATProbe: %d\n", result ? 1 : 0); + return result; +} diff --git a/i386/libsaio/.svn/text-base/exfat.h.svn-base b/i386/libsaio/.svn/text-base/exfat.h.svn-base new file mode 100644 index 0000000..ce36a59 --- /dev/null +++ b/i386/libsaio/.svn/text-base/exfat.h.svn-base @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * dmazar, 14/7/2011 + * support for EXFAT volume label reading + * + */ + +extern void EXFATGetDescription(CICell ih, char *str, long strMaxLen); +extern bool EXFATProbe (const void *buf); +extern long EXFATGetUUID(CICell ih, char *uuidStr); diff --git a/i386/libsaio/.svn/text-base/ext2fs.c.svn-base b/i386/libsaio/.svn/text-base/ext2fs.c.svn-base new file mode 100644 index 0000000..3051e49 --- /dev/null +++ b/i386/libsaio/.svn/text-base/ext2fs.c.svn-base @@ -0,0 +1,71 @@ +/* + * ext2fs.c + * + * + * Created by mackerintel on 1/26/09. + * Copyright 2009 __MyCompanyName__. All rights reserved. + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "ext2fs.h" + +#define EX2ProbeSize 2048 + +bool EX2Probe (const void *buf) +{ + return (OSReadLittleInt16(buf+0x438,0)==0xEF53); +} + +void EX2GetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc (EX2ProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, EX2ProbeSize); + if (!EX2Probe (buf)) + { + free (buf); + return; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x478, MIN(strMaxLen, 16)); + free (buf); +} + +long EX2GetUUID(CICell ih, char *uuidStr) +{ + uint8_t *b, *buf=malloc (EX2ProbeSize); + if (!buf) + return -1; + Seek(ih, 0); + Read(ih, (long)buf, EX2ProbeSize); + if (!EX2Probe (buf)) + { + free (buf); + return -1; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return -1; + } + b=buf+0x468; + sprintf(uuidStr, + "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", + b[0], b[1], b[2], b[3], + b[4], b[5], + b[6], b[7], + b[8], b[9], + b[10], b[11], b[12], b[13], b[14], b[15]); + free (buf); + return 0; +} diff --git a/i386/libsaio/.svn/text-base/ext2fs.h.svn-base b/i386/libsaio/.svn/text-base/ext2fs.h.svn-base new file mode 100644 index 0000000..2a83698 --- /dev/null +++ b/i386/libsaio/.svn/text-base/ext2fs.h.svn-base @@ -0,0 +1,12 @@ +/* + * ext2fs.h + * + * + * Created by mackerintel on 1/26/09. + * Copyright 2009 __MyCompanyName__. All rights reserved. + * + */ + +extern bool EX2Probe (const void *buf); +extern void EX2GetDescription(CICell ih, char *str, long strMaxLen); +extern long EX2GetUUID(CICell ih, char *uuidStr); diff --git a/i386/libsaio/.svn/text-base/fake_efi.c.svn-base b/i386/libsaio/.svn/text-base/fake_efi.c.svn-base new file mode 100644 index 0000000..cae3d91 --- /dev/null +++ b/i386/libsaio/.svn/text-base/fake_efi.c.svn-base @@ -0,0 +1,769 @@ + +/* + * Copyright 2007 David F. Elliott. All rights reserved. + */ + +#include "saio_types.h" +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "efi.h" +#include "acpi.h" +#include "fake_efi.h" +#include "efi_tables.h" +#include "platform.h" +#include "acpi_patcher.h" +#include "smbios.h" +#include "device_inject.h" +#include "convert.h" +#include "pci.h" +#include "sl.h" + +extern void setup_pci_devs(pci_dt_t *pci_dt); + +/* + * Modern Darwin kernels require some amount of EFI because Apple machines all + * have EFI. Modifying the kernel source to not require EFI is of course + * possible but would have to be maintained as a separate patch because it is + * unlikely that Apple wishes to add legacy support to their kernel. + * + * As you can see from the Apple-supplied code in bootstruct.c, it seems that + * the intention was clearly to modify this booter to provide EFI-like structures + * to the kernel rather than modifying the kernel to handle non-EFI stuff. This + * makes a lot of sense from an engineering point of view as it means the kernel + * for the as yet unreleased EFI-only Macs could still be booted by the non-EFI + * DTK systems so long as the kernel checked to ensure the boot tables were + * filled in appropriately. Modern xnu requires a system table and a runtime + * services table and performs no checks whatsoever to ensure the pointers to + * these tables are non-NULL. Therefore, any modern xnu kernel will page fault + * early on in the boot process if the system table pointer is zero. + * + * Even before that happens, the tsc_init function in modern xnu requires the FSB + * Frequency to be a property in the /efi/platform node of the device tree or else + * it panics the bootstrap process very early on. + * + * As of this writing, the current implementation found here is good enough + * to make the currently available xnu kernel boot without modification on a + * system with an appropriate processor. With a minor source modification to + * the tsc_init function to remove the explicit check for Core or Core 2 + * processors the kernel can be made to boot on other processors so long as + * the code can be executed by the processor and the machine contains the + * necessary hardware. + */ + +/*========================================================================== + * Utility function to make a device tree string from an EFI_GUID + */ +static inline char * mallocStringForGuid(EFI_GUID const *pGuid) +{ + char *string = malloc(37); + efi_guid_unparse_upper(pGuid, string); + return string; +} + +/*========================================================================== + * Function to map 32 bit physical address to 64 bit virtual address + */ +static uint64_t ptov64(uint32_t addr) +{ + return ((uint64_t)addr | 0xFFFFFF8000000000ULL); +} + +/*========================================================================== + * Fake EFI implementation + */ + +/* Identify ourselves as the EFI firmware vendor */ +static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','2', 0}; +static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */ + +/* Default platform system_id (fix by IntVar) */ +static EFI_CHAR8 const SYSTEM_ID[] = "0123456789ABCDEF"; //random value gen by uuidgen + +/* Just a ret instruction */ +static uint8_t const VOIDRET_INSTRUCTIONS[] = {0xc3}; + +/* movl $0x80000003,%eax; ret */ +static uint8_t const UNSUPPORTEDRET_INSTRUCTIONS_32[] = {0xb8, 0x03, 0x00, 0x00, 0x80, 0xc3}; +static uint8_t const UNSUPPORTEDRET_INSTRUCTIONS_64[] = {0x48, 0xb8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3}; + +EFI_SYSTEM_TABLE_32 *gST32 = NULL; +EFI_SYSTEM_TABLE_64 *gST64 = NULL; +Node *gEfiConfigurationTableNode = NULL; + +extern EFI_STATUS addConfigurationTable(EFI_GUID const *pGuid, void *table, char const *alias) +{ + EFI_UINTN i = 0; + + //Azi: as is, cpu's with em64t will use EFI64 on pre 10.6 systems, + // wich seems to cause no problem. In case it does, force i386 arch. + if (archCpuType == CPU_TYPE_I386) + { + i = gST32->NumberOfTableEntries; + } + else + { + i = gST64->NumberOfTableEntries; + } + + // We only do adds, not modifications and deletes like InstallConfigurationTable + if (i >= MAX_CONFIGURATION_TABLE_ENTRIES) + stop("Ran out of space for configuration tables. Increase the reserved size in the code.\n"); + + if (pGuid == NULL) + return EFI_INVALID_PARAMETER; + + if (table != NULL) + { + // FIXME + //((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorGuid = *pGuid; + //((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorTable = (EFI_PTR64)table; + + //++gST->NumberOfTableEntries; + + Node *tableNode = DT__AddChild(gEfiConfigurationTableNode, mallocStringForGuid(pGuid)); + + // Use the pointer to the GUID we just stuffed into the system table + DT__AddProperty(tableNode, "guid", sizeof(EFI_GUID), (void*)pGuid); + + // The "table" property is the 32-bit (in our implementation) physical address of the table + DT__AddProperty(tableNode, "table", sizeof(void*) * 2, table); + + // Assume the alias pointer is a global or static piece of data + if (alias != NULL) + DT__AddProperty(tableNode, "alias", strlen(alias)+1, (char*)alias); + + return EFI_SUCCESS; + } + return EFI_UNSUPPORTED; +} + +//Azi: crc32 done in place, on the cases were it wasn't. +/*static inline void fixupEfiSystemTableCRC32(EFI_SYSTEM_TABLE_64 *efiSystemTable) +{ + efiSystemTable->Hdr.CRC32 = 0; + efiSystemTable->Hdr.CRC32 = crc32(0L, efiSystemTable, efiSystemTable->Hdr.HeaderSize); +}*/ + +/* + * What we do here is simply allocate a fake EFI system table and a fake EFI + * runtime services table. + * + * Because we build against modern headers with kBootArgsRevision 4 we + * also take care to set efiMode = 32. + */ +void setupEfiTables32(void) +{ + // We use the fake_efi_pages struct so that we only need to do one kernel + // memory allocation for all needed EFI data. Otherwise, small allocations + // like the FIRMWARE_VENDOR string would take up an entire page. + // NOTE WELL: Do NOT assume this struct has any particular layout within itself. + // It is absolutely not intended to be publicly exposed anywhere + // We say pages (plural) although right now we are well within the 1 page size + // and probably will stay that way. + struct fake_efi_pages + { + EFI_SYSTEM_TABLE_32 efiSystemTable; + EFI_RUNTIME_SERVICES_32 efiRuntimeServices; + EFI_CONFIGURATION_TABLE_32 efiConfigurationTable[MAX_CONFIGURATION_TABLE_ENTRIES]; + EFI_CHAR16 firmwareVendor[sizeof(FIRMWARE_VENDOR)/sizeof(EFI_CHAR16)]; + uint8_t voidret_instructions[sizeof(VOIDRET_INSTRUCTIONS)/sizeof(uint8_t)]; + uint8_t unsupportedret_instructions[sizeof(UNSUPPORTEDRET_INSTRUCTIONS_32)/sizeof(uint8_t)]; + }; + + struct fake_efi_pages *fakeEfiPages = (struct fake_efi_pages*)AllocateKernelMemory(sizeof(struct fake_efi_pages)); + + // Zero out all the tables in case fields are added later + //bzero(fakeEfiPages, sizeof(struct fake_efi_pages)); + + // -------------------------------------------------------------------- + // Initialize some machine code that will return EFI_UNSUPPORTED for + // functions returning int and simply return for void functions. + memcpy(fakeEfiPages->voidret_instructions, VOIDRET_INSTRUCTIONS, sizeof(VOIDRET_INSTRUCTIONS)); + memcpy(fakeEfiPages->unsupportedret_instructions, UNSUPPORTEDRET_INSTRUCTIONS_32, sizeof(UNSUPPORTEDRET_INSTRUCTIONS_32)); + + // -------------------------------------------------------------------- + // System table + EFI_SYSTEM_TABLE_32 *efiSystemTable = gST32 = &fakeEfiPages->efiSystemTable; + efiSystemTable->Hdr.Signature = EFI_SYSTEM_TABLE_SIGNATURE; + efiSystemTable->Hdr.Revision = EFI_SYSTEM_TABLE_REVISION; + efiSystemTable->Hdr.HeaderSize = sizeof(EFI_SYSTEM_TABLE_32); + efiSystemTable->Hdr.CRC32 = 0; // Initialize to zero and then do CRC32 + efiSystemTable->Hdr.Reserved = 0; + + efiSystemTable->FirmwareVendor = (EFI_PTR32)&fakeEfiPages->firmwareVendor; + memcpy(fakeEfiPages->firmwareVendor, FIRMWARE_VENDOR, sizeof(FIRMWARE_VENDOR)); + efiSystemTable->FirmwareRevision = FIRMWARE_REVISION; + + // XXX: We may need to have basic implementations of ConIn/ConOut/StdErr + // The EFI spec states that all handles are invalid after boot services have been + // exited so we can probably get by with leaving the handles as zero. + efiSystemTable->ConsoleInHandle = 0; + efiSystemTable->ConIn = 0; + + efiSystemTable->ConsoleOutHandle = 0; + efiSystemTable->ConOut = 0; + + efiSystemTable->StandardErrorHandle = 0; + efiSystemTable->StdErr = 0; + + efiSystemTable->RuntimeServices = (EFI_PTR32)&fakeEfiPages->efiRuntimeServices; + + // According to the EFI spec, BootServices aren't valid after the + // boot process is exited so we can probably do without it. + // Apple didn't provide a definition for it in pexpert/i386/efi.h + // so I'm guessing they don't use it. + efiSystemTable->BootServices = 0; + + efiSystemTable->NumberOfTableEntries = 0; + efiSystemTable->ConfigurationTable = (EFI_PTR32)fakeEfiPages->efiConfigurationTable; + + // We're done. Now CRC32 the thing so the kernel will accept it. + // Must be initialized to zero before CRC32, done above. + gST32->Hdr.CRC32 = crc32(0L, gST32, gST32->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Runtime services + EFI_RUNTIME_SERVICES_32 *efiRuntimeServices = &fakeEfiPages->efiRuntimeServices; + efiRuntimeServices->Hdr.Signature = EFI_RUNTIME_SERVICES_SIGNATURE; + efiRuntimeServices->Hdr.Revision = EFI_RUNTIME_SERVICES_REVISION; + efiRuntimeServices->Hdr.HeaderSize = sizeof(EFI_RUNTIME_SERVICES_32); + efiRuntimeServices->Hdr.CRC32 = 0; + efiRuntimeServices->Hdr.Reserved = 0; + + // There are a number of function pointers in the efiRuntimeServices table. + // These are the Foundation (e.g. core) services and are expected to be present on + // all EFI-compliant machines. Some kernel extensions (notably AppleEFIRuntime) + // will call these without checking to see if they are null. + // + // We don't really feel like doing an EFI implementation in the bootloader + // but it is nice if we can at least prevent a complete crash by + // at least providing some sort of implementation until one can be provided + // nicely in a kext. + void (*voidret_fp)() = (void*)fakeEfiPages->voidret_instructions; + void (*unsupportedret_fp)() = (void*)fakeEfiPages->unsupportedret_instructions; + efiRuntimeServices->GetTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetWakeupTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetWakeupTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetVirtualAddressMap = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->ConvertPointer = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetVariable = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetNextVariableName = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetVariable = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetNextHighMonotonicCount = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->ResetSystem = (EFI_PTR32)voidret_fp; + + // We're done. Now CRC32 the thing so the kernel will accept it + efiRuntimeServices->Hdr.CRC32 = crc32(0L, efiRuntimeServices, efiRuntimeServices->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Finish filling in the rest of the boot args that we need. + bootArgs->efiSystemTable = (uint32_t)efiSystemTable; + bootArgs->efiMode = kBootArgsEfiMode32; + + // The bootArgs structure as a whole is bzero'd so we don't need to fill in + // things like efiRuntimeServices* and what not. + // + // In fact, the only code that seems to use that is the hibernate code so it + // knows not to save the pages. It even checks to make sure its nonzero. +} + +void setupEfiTables64(void) +{ + struct fake_efi_pages + { + EFI_SYSTEM_TABLE_64 efiSystemTable; + EFI_RUNTIME_SERVICES_64 efiRuntimeServices; + EFI_CONFIGURATION_TABLE_64 efiConfigurationTable[MAX_CONFIGURATION_TABLE_ENTRIES]; + EFI_CHAR16 firmwareVendor[sizeof(FIRMWARE_VENDOR)/sizeof(EFI_CHAR16)]; + uint8_t voidret_instructions[sizeof(VOIDRET_INSTRUCTIONS)/sizeof(uint8_t)]; + uint8_t unsupportedret_instructions[sizeof(UNSUPPORTEDRET_INSTRUCTIONS_64)/sizeof(uint8_t)]; + }; + + struct fake_efi_pages *fakeEfiPages = (struct fake_efi_pages*)AllocateKernelMemory(sizeof(struct fake_efi_pages)); + + // Zero out all the tables in case fields are added later + //bzero(fakeEfiPages, sizeof(struct fake_efi_pages)); + + // -------------------------------------------------------------------- + // Initialize some machine code that will return EFI_UNSUPPORTED for + // functions returning int and simply return for void functions. + memcpy(fakeEfiPages->voidret_instructions, VOIDRET_INSTRUCTIONS, sizeof(VOIDRET_INSTRUCTIONS)); + memcpy(fakeEfiPages->unsupportedret_instructions, UNSUPPORTEDRET_INSTRUCTIONS_64, sizeof(UNSUPPORTEDRET_INSTRUCTIONS_64)); + + // -------------------------------------------------------------------- + // System table + EFI_SYSTEM_TABLE_64 *efiSystemTable = gST64 = &fakeEfiPages->efiSystemTable; + efiSystemTable->Hdr.Signature = EFI_SYSTEM_TABLE_SIGNATURE; + efiSystemTable->Hdr.Revision = EFI_SYSTEM_TABLE_REVISION; + efiSystemTable->Hdr.HeaderSize = sizeof(EFI_SYSTEM_TABLE_64); + efiSystemTable->Hdr.CRC32 = 0; // Initialize to zero and then do CRC32 + efiSystemTable->Hdr.Reserved = 0; + + efiSystemTable->FirmwareVendor = ptov64((EFI_PTR32)&fakeEfiPages->firmwareVendor); + memcpy(fakeEfiPages->firmwareVendor, FIRMWARE_VENDOR, sizeof(FIRMWARE_VENDOR)); + efiSystemTable->FirmwareRevision = FIRMWARE_REVISION; + + // XXX: We may need to have basic implementations of ConIn/ConOut/StdErr + // The EFI spec states that all handles are invalid after boot services have been + // exited so we can probably get by with leaving the handles as zero. + efiSystemTable->ConsoleInHandle = 0; + efiSystemTable->ConIn = 0; + + efiSystemTable->ConsoleOutHandle = 0; + efiSystemTable->ConOut = 0; + + efiSystemTable->StandardErrorHandle = 0; + efiSystemTable->StdErr = 0; + + efiSystemTable->RuntimeServices = ptov64((EFI_PTR32)&fakeEfiPages->efiRuntimeServices); + // According to the EFI spec, BootServices aren't valid after the + // boot process is exited so we can probably do without it. + // Apple didn't provide a definition for it in pexpert/i386/efi.h + // so I'm guessing they don't use it. + efiSystemTable->BootServices = 0; + + efiSystemTable->NumberOfTableEntries = 0; + efiSystemTable->ConfigurationTable = ptov64((EFI_PTR32)fakeEfiPages->efiConfigurationTable); + + // We're done. Now CRC32 the thing so the kernel will accept it + gST64->Hdr.CRC32 = crc32(0L, gST64, gST64->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Runtime services + EFI_RUNTIME_SERVICES_64 *efiRuntimeServices = &fakeEfiPages->efiRuntimeServices; + efiRuntimeServices->Hdr.Signature = EFI_RUNTIME_SERVICES_SIGNATURE; + efiRuntimeServices->Hdr.Revision = EFI_RUNTIME_SERVICES_REVISION; + efiRuntimeServices->Hdr.HeaderSize = sizeof(EFI_RUNTIME_SERVICES_64); + efiRuntimeServices->Hdr.CRC32 = 0; + efiRuntimeServices->Hdr.Reserved = 0; + + // There are a number of function pointers in the efiRuntimeServices table. + // These are the Foundation (e.g. core) services and are expected to be present on + // all EFI-compliant machines. Some kernel extensions (notably AppleEFIRuntime) + // will call these without checking to see if they are null. + // + // We don't really feel like doing an EFI implementation in the bootloader + // but it is nice if we can at least prevent a complete crash by + // at least providing some sort of implementation until one can be provided + // nicely in a kext. + + void (*voidret_fp)() = (void*)fakeEfiPages->voidret_instructions; + void (*unsupportedret_fp)() = (void*)fakeEfiPages->unsupportedret_instructions; + efiRuntimeServices->GetTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetWakeupTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetWakeupTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetVirtualAddressMap = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->ConvertPointer = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetVariable = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetNextVariableName = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetVariable = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetNextHighMonotonicCount = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->ResetSystem = ptov64((EFI_PTR32)voidret_fp); + + // We're done. Now CRC32 the thing so the kernel will accept it + efiRuntimeServices->Hdr.CRC32 = crc32(0L, efiRuntimeServices, efiRuntimeServices->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Finish filling in the rest of the boot args that we need. + bootArgs->efiSystemTable = (uint32_t)efiSystemTable; + bootArgs->efiMode = kBootArgsEfiMode64; + + // The bootArgs structure as a whole is bzero'd so we don't need to fill in + // things like efiRuntimeServices* and what not. + // + // In fact, the only code that seems to use that is the hibernate code so it + // knows not to save the pages. It even checks to make sure its nonzero. +} + +/* + * In addition to the EFI tables there is also the EFI device tree node. + * In particular, we need /efi/platform to have an FSBFrequency key. Without it, + * the tsc_init function will panic very early on in kernel startup, before + * the console is available. + */ + +/*========================================================================== + * FSB Frequency detection + */ + +/* These should be const but DT__AddProperty takes char* */ +static const char TSC_Frequency_prop[] = "TSCFrequency"; +static const char FSB_Frequency_prop[] = "FSBFrequency"; +static const char CPU_Frequency_prop[] = "CPUFrequency"; + +/*========================================================================== + * SMBIOS + */ + +/* From Foundation/Efi/Guid/Smbios/SmBios.c */ +EFI_GUID const gEfiSmbiosTableGuid = EFI_SMBIOS_TABLE_GUID; + +#define SMBIOS_RANGE_START 0x000F0000 +#define SMBIOS_RANGE_END 0x000FFFFF + +/* '_SM_' in little endian: */ +#define SMBIOS_ANCHOR_UINT32_LE 0x5f4d535f + +#define EFI_ACPI_TABLE_GUID \ +{ \ + 0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ +} + +#define EFI_ACPI_20_TABLE_GUID \ +{ \ + 0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ +} + +EFI_GUID gEfiAcpiTableGuid = EFI_ACPI_TABLE_GUID; +EFI_GUID gEfiAcpi20TableGuid = EFI_ACPI_20_TABLE_GUID; + + +/*========================================================================== + * Fake EFI implementation + */ + +/* These should be const but DT__AddProperty takes char* */ +static const char FIRMWARE_REVISION_PROP[] = "firmware-revision"; +static const char FIRMWARE_ABI_PROP[] = "firmware-abi"; +static const char FIRMWARE_VENDOR_PROP[] = "firmware-vendor"; +static const char FIRMWARE_ABI_32_PROP_VALUE[] = "EFI32"; +static const char FIRMWARE_ABI_64_PROP_VALUE[] = "EFI64"; +static const char SYSTEM_ID_PROP[] = "system-id"; +static const char SYSTEM_SERIAL_PROP[] = "SystemSerialNumber"; +static const char SYSTEM_TYPE_PROP[] = "system-type"; +static const char MODEL_PROP[] = "Model"; +static const char BOARDID_PROP[] = "board-id"; + +/* + * Get an smbios option string option to convert to EFI_CHAR16 string + */ +static EFI_CHAR16* getSmbiosChar16(const char * key, size_t* len) +{ + const char *src = getStringForKey(key, &bootInfo->smbiosConfig); + EFI_CHAR16* dst = 0; + size_t i = 0; + + if (!key || !(*key) || !len || !src) return 0; + + *len = strlen(src); + dst = (EFI_CHAR16*) malloc( ((*len)+1) * 2 ); + for (; i < (*len); i++) dst[i] = src[i]; + dst[(*len)] = '\0'; + *len = ((*len)+1)*2; // return the CHAR16 bufsize in cluding zero terminated CHAR16 + return dst; +} + +/* + * Get the SystemID from the bios dmi info + */ +static EFI_CHAR8* getSmbiosUUID() +{ + static EFI_CHAR8 uuid[UUID_LEN]; + int i, isZero, isOnes; + SMBByte *p; + + p = (SMBByte*)Platform.UUID; + + for (i=0, isZero=1, isOnes=1; i<UUID_LEN; i++) + { + if (p[i] != 0x00) isZero = 0; + if (p[i] != 0xff) isOnes = 0; + } + + if (isZero || isOnes) // empty or setable means: no uuid present + { + verbose("No UUID present in SMBIOS System Information Table\n"); + return 0; + } + + memcpy(uuid, p, UUID_LEN); + return uuid; +} + +/* + * return a binary UUID value from the overriden SystemID and SMUUID if found, + * or from the bios if not, or from a fixed value if no bios value is found + */ +static EFI_CHAR8* getSystemID() +{ + // unable to determine UUID for host. Error: 35 fix + // Rek: new SMsystemid option conforming to smbios notation standards, this option should + // belong to smbios config only ... + const char *sysId = getStringForKey(kSystemID, &bootInfo->chameleonConfig); + EFI_CHAR8* ret = getUUIDFromString(sysId); + + if (!sysId || !ret) // try bios dmi info UUID extraction + { + ret = getSmbiosUUID(); + sysId = 0; + } + + if (!ret) // no bios dmi UUID available, set a fixed value for system-id + ret=getUUIDFromString((sysId = (const char*) SYSTEM_ID)); + + verbose("Customizing SystemID with : %s\n", getStringFromUUID(ret)); // apply a nice formatting to the displayed output + return ret; +} + +/* + * Must be called AFTER setup Acpi because we need to take care of correct + * facp content to reflect in ioregs + */ +void setupSystemType() +{ + Node *node = DT__FindNode("/", false); + if (node == 0) stop("Couldn't get root node"); + // we need to write this property after facp parsing + // Export system-type only if it has been overrriden by the SystemType option + DT__AddProperty(node, SYSTEM_TYPE_PROP, sizeof(Platform.Type), &Platform.Type); +} + +void setupEfiDeviceTree(void) +{ + EFI_CHAR8* ret = 0; + EFI_CHAR16* ret16 = 0; + size_t len = 0; + Node *node; + + node = DT__FindNode("/", false); + + if (node == 0) stop("Couldn't get root node"); + + // We could also just do DT__FindNode("/efi/platform", true) + // But I think eventually we want to fill stuff in the efi node + // too so we might as well create it so we have a pointer for it too. + node = DT__AddChild(node, "efi"); + + if (archCpuType == CPU_TYPE_I386) + { + DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_32_PROP_VALUE), (char*)FIRMWARE_ABI_32_PROP_VALUE); + } + else + { + DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_64_PROP_VALUE), (char*)FIRMWARE_ABI_64_PROP_VALUE); + } + + DT__AddProperty(node, FIRMWARE_REVISION_PROP, sizeof(FIRMWARE_REVISION), (EFI_UINT32*)&FIRMWARE_REVISION); + DT__AddProperty(node, FIRMWARE_VENDOR_PROP, sizeof(FIRMWARE_VENDOR), (EFI_CHAR16*)FIRMWARE_VENDOR); + + // TODO: Fill in other efi properties if necessary + + // Set up the /efi/runtime-services table node similar to the way a child node of configuration-table + // is set up. That is, name and table properties + Node *runtimeServicesNode = DT__AddChild(node, "runtime-services"); + + if (archCpuType == CPU_TYPE_I386) + { + // The value of the table property is the 32-bit physical address for the RuntimeServices table. + // Since the EFI system table already has a pointer to it, we simply use the address of that pointer + // for the pointer to the property data. Warning.. DT finalization calls free on that but we're not + // the only thing to use a non-malloc'd pointer for something in the DT + + DT__AddProperty(runtimeServicesNode, "table", sizeof(uint64_t), &gST32->RuntimeServices); + } + else + { + DT__AddProperty(runtimeServicesNode, "table", sizeof(uint64_t), &gST64->RuntimeServices); + } + + // Set up the /efi/configuration-table node which will eventually have several child nodes for + // all of the configuration tables needed by various kernel extensions. + gEfiConfigurationTableNode = DT__AddChild(node, "configuration-table"); + + // Now fill in the /efi/platform Node + Node *efiPlatformNode = DT__AddChild(node, "platform"); + + // NOTE WELL: If you do add FSB Frequency detection, make sure to store + // the value in the fsbFrequency global and not an malloc'd pointer + // because the DT_AddProperty function does not copy its args. + + if (Platform.CPU.FSBFrequency != 0) + DT__AddProperty(efiPlatformNode, FSB_Frequency_prop, sizeof(uint64_t), &Platform.CPU.FSBFrequency); + + // Export TSC and CPU frequencies for use by the kernel or KEXTs + if (Platform.CPU.TSCFrequency != 0) + DT__AddProperty(efiPlatformNode, TSC_Frequency_prop, sizeof(uint64_t), &Platform.CPU.TSCFrequency); + + if (Platform.CPU.CPUFrequency != 0) + DT__AddProperty(efiPlatformNode, CPU_Frequency_prop, sizeof(uint64_t), &Platform.CPU.CPUFrequency); + + // Export system-id. Can be disabled with SystemId=No in com.apple.Boot.plist + if ((ret=getSystemID())) + DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, (EFI_UINT32*) ret); + + // Export SystemSerialNumber if present + if ((ret16=getSmbiosChar16("SMserial", &len))) + DT__AddProperty(efiPlatformNode, SYSTEM_SERIAL_PROP, len, ret16); + + // Export Model if present + if ((ret16=getSmbiosChar16("SMproductname", &len))) + DT__AddProperty(efiPlatformNode, MODEL_PROP, len, ret16); + + // Fill /efi/device-properties node. + setupDeviceProperties(node); +} + +/* + * Must be called AFTER getSmbios + */ +void setupBoardId() +{ + Node *node; + node = DT__FindNode("/", false); + if (node == 0) { + stop("Couldn't get root node"); + } + const char *boardid = getStringForKey("SMboardproduct", &bootInfo->smbiosConfig); + if (boardid) + DT__AddProperty(node, BOARDID_PROP, strlen(boardid)+1, (EFI_CHAR16*)boardid); +} + +/* + * Populate the chosen node + */ +void setupChosenNode() +{ + Node *chosenNode; + chosenNode = DT__FindNode("/chosen", false); + if (chosenNode == 0) + stop("Couldn't get chosen node"); + + int bootUUIDLength = strlen(gBootUUIDString); + if (bootUUIDLength) + DT__AddProperty(chosenNode, "boot-uuid", bootUUIDLength + 1, gBootUUIDString); +} + +/* + * Load the smbios.plist override config file if any + */ +static void setupSmbiosConfigFile(const char *filename) +{ + char dirSpecSMBIOS[128]; + const char *override_pathname = NULL; + int len = 0, err = 0; + extern void scan_mem(); + + // Take in account user overriding + if (getValueForKey(kSMBIOSKey, &override_pathname, &len, &bootInfo->chameleonConfig) && len > 0) + { + // Specify a path to a file, e.g. SMBIOS=/Extra/macProXY.plist + sprintf(dirSpecSMBIOS, override_pathname); + err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig); + } + else + { + // Check selected volume's Extra. + sprintf(dirSpecSMBIOS, "/Extra/%s", filename); + if ( (err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig)) ) + { + // Check booter volume/rdbt Extra. + sprintf(dirSpecSMBIOS, "bt(0,0)/Extra/%s", filename); + err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig); + } + } + + if (err) + { + verbose("No SMBIOS replacement found.\n"); + } + + // get a chance to scan mem dynamically if user asks for it while having the config options + // loaded as well, as opposed to when it was in scan_platform(); also load the orig. smbios + // so that we can access dmi info, without patching the smbios yet. + scan_mem(); +} + +/* + * Installs all the needed configuration table entries + */ +static void setupEfiConfigurationTable() +{ + smbios_p = (EFI_PTR32)getSmbios(SMBIOS_PATCHED); + addConfigurationTable(&gEfiSmbiosTableGuid, &smbios_p, NULL); + + setupBoardId(); //need to be called after getSmbios + + // Setup ACPI with DSDT overrides (mackerintel's patch) + setupAcpi(); + + // We've obviously changed the count.. so fix up the CRC32 + if (archCpuType == CPU_TYPE_I386) + { + gST32->Hdr.CRC32 = 0; + gST32->Hdr.CRC32 = crc32(0L, gST32, gST32->Hdr.HeaderSize); + } + else + { + gST64->Hdr.CRC32 = 0; + gST64->Hdr.CRC32 = crc32(0L, gST64, gST64->Hdr.HeaderSize); + } + + // Setup the chosen node + setupChosenNode(); +} + +void saveOriginalSMBIOS(void) +{ + Node *node; + SMBEntryPoint *origeps; + void *tableAddress; + + node = DT__FindNode("/efi/platform", false); + if (!node) + { + verbose("/efi/platform node not found\n"); + return; + } + + origeps = getSmbios(SMBIOS_ORIGINAL); + if (!origeps) + { + return; + } + + tableAddress = (void *)AllocateKernelMemory(origeps->dmi.tableLength); + if (!tableAddress) + { + return; + } + + memcpy(tableAddress, (void *)origeps->dmi.tableAddress, origeps->dmi.tableLength); + DT__AddProperty(node, "SMBIOS", origeps->dmi.tableLength, tableAddress); +} + +/* + * Entrypoint from boot.c + */ +void setupFakeEfi(void) +{ + // Generate efi device strings + setup_pci_devs(root_pci_dev); + + readSMBIOSInfo(getSmbios(SMBIOS_ORIGINAL)); + + // load smbios.plist file if any + setupSmbiosConfigFile("smbios.plist"); + + setupSMBIOSTable(); + + // Initialize the base table + if (archCpuType == CPU_TYPE_I386) + { + setupEfiTables32(); + } + else + { + setupEfiTables64(); + } + + // Initialize the device tree + setupEfiDeviceTree(); + + saveOriginalSMBIOS(); + + // Add configuration table entries to both the services table and the device tree + setupEfiConfigurationTable(); +} diff --git a/i386/libsaio/.svn/text-base/fake_efi.h.svn-base b/i386/libsaio/.svn/text-base/fake_efi.h.svn-base new file mode 100644 index 0000000..460139e --- /dev/null +++ b/i386/libsaio/.svn/text-base/fake_efi.h.svn-base @@ -0,0 +1,13 @@ +/* + * Copyright 2007 David F. Elliott. All rights reserved. + */ + +#ifndef __LIBSAIO_FAKE_EFI_H +#define __LIBSAIO_FAKE_EFI_H + +/* Set up space for up to 10 configuration table entries */ +#define MAX_CONFIGURATION_TABLE_ENTRIES 10 + +extern void setupFakeEfi(void); + +#endif /* !__LIBSAIO_FAKE_EFI_H */ diff --git a/i386/libsaio/.svn/text-base/fdisk.h.svn-base b/i386/libsaio/.svn/text-base/fdisk.h.svn-base new file mode 100644 index 0000000..6c46410 --- /dev/null +++ b/i386/libsaio/.svn/text-base/fdisk.h.svn-base @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * IBM PC disk partitioning data structures. + * + * HISTORY + * + * 8 July 1992 David E. Bohman at NeXT + * Created. + */ + +#ifndef __LIBSAIO_FDISK_H +#define __LIBSAIO_FDISK_H + +#define DISK_BLK0 0 /* blkno of boot block */ +#define DISK_BLK0SZ 512 /* size of boot block */ +#define DISK_BOOTSZ 446 /* size of boot code in boot block */ +#define DISK_SIGNATURE 0xAA55 /* signature of the boot record */ +#define FDISK_NPART 4 /* number of entries in fdisk table */ +#define FDISK_ACTIVE 0x80 /* indicator of active partition */ +#define FDISK_NEXTNAME 0xA7 /* indicator of NeXT partition */ +#define FDISK_DOS12 0x01 /* 12-bit fat < 10MB dos partition */ +#define FDISK_DOS16S 0x04 /* 16-bit fat < 32MB dos partition */ +#define FDISK_DOSEXT 0x05 /* extended dos partition */ +#define FDISK_DOS16B 0x06 /* 16-bit fat >= 32MB dos partition */ +#define FDISK_NTFS 0x07 /* NTFS partition */ +#define FDISK_SMALLFAT32 0x0b /* FAT32 partition */ +#define FDISK_FAT32 0x0c /* FAT32 partition */ +#define FDISK_DOS16SLBA 0x0e +#define FDISK_LINUX 0x83 +#define FDISK_OPENBSD 0xa6 /* OpenBSD FFS partition */ +#define FDISK_FREEBSD 0xa5 /* FreeBSD UFS2 partition */ +#define FDISK_BEFS 0xeb /* Haiku BeFS partition */ +#define FDISK_UFS 0xa8 /* Apple UFS partition */ +#define FDISK_HFS 0xaf /* Apple HFS partition */ +#define FDISK_BOOTER 0xab /* Apple booter partition */ + +/* + * Format of fdisk partion entry (if present). + */ +struct fdisk_part { + unsigned char bootid; /* bootable or not */ + unsigned char beghead; /* begining head, sector, cylinder */ + unsigned char begsect; /* begcyl is a 10-bit number */ + unsigned char begcyl; /* High 2 bits are in begsect */ + unsigned char systid; /* OS type */ + unsigned char endhead; /* ending head, sector, cylinder */ + unsigned char endsect; /* endcyl is a 10-bit number */ + unsigned char endcyl; /* High 2 bits are in endsect */ + unsigned long relsect; /* partion physical offset on disk */ + unsigned long numsect; /* number of sectors in partition */ +} __attribute__((packed)); + +/* + * Format of boot block. + */ +struct disk_blk0 { + unsigned char bootcode[DISK_BOOTSZ]; + unsigned char parts[FDISK_NPART][sizeof (struct fdisk_part)]; + unsigned short signature; +}; + +struct REAL_disk_blk0 { + unsigned char bootcode[DISK_BOOTSZ]; + struct fdisk_part parts[FDISK_NPART]; + unsigned short signature; +} __attribute__((packed)); + +#endif /* !__LIBSAIO_FDISK_H */ diff --git a/i386/libsaio/.svn/text-base/freebsd.c.svn-base b/i386/libsaio/.svn/text-base/freebsd.c.svn-base new file mode 100644 index 0000000..30fec68 --- /dev/null +++ b/i386/libsaio/.svn/text-base/freebsd.c.svn-base @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "freebsd.h" + +#define FreeBSDProbeSize 2048 + +bool FreeBSDProbe (const void *buf) +{ + return (OSReadLittleInt32(buf+0xA55C,0)==0x19540119); +} +void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc(FreeBSDProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, FreeBSDProbeSize); + if (!FreeBSDProbe (buf)) + { + free (buf); + return; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x478, MIN (strMaxLen, 32)); + free (buf); +} diff --git a/i386/libsaio/.svn/text-base/freebsd.h.svn-base b/i386/libsaio/.svn/text-base/freebsd.h.svn-base new file mode 100644 index 0000000..4068f2b --- /dev/null +++ b/i386/libsaio/.svn/text-base/freebsd.h.svn-base @@ -0,0 +1,2 @@ +extern bool FreeBSDProbe (const void *buf); +extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file diff --git a/i386/libsaio/.svn/text-base/gma.c.svn-base b/i386/libsaio/.svn/text-base/gma.c.svn-base new file mode 100644 index 0000000..c040e57 --- /dev/null +++ b/i386/libsaio/.svn/text-base/gma.c.svn-base @@ -0,0 +1,323 @@ +/* + Original patch by Nawcom + http://forum.voodooprojects.org/index.php/topic,1029.0.html + + Original Intel HDx000 code from valv +*/ + +#include "libsa.h" +#include "saio_internal.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "device_inject.h" +#include "gma.h" +#include "vbe.h" +#include "graphics.h" + +#ifndef DEBUG_GMA +#define DEBUG_GMA 0 +#endif + +#if DEBUG_GMA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +uint8_t GMAX3100_vals[22][4] = { + { 0x01,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x08 }, + { 0x64,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x08 }, + { 0x01,0x00,0x00,0x00 }, + { 0x20,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x20,0x03,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x08,0x52,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x3B,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 } +}; + +uint8_t HD2000_vals[16][4] = { + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xfa,0x00,0x00,0x00 }, + { 0x2c,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xf4,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, +}; + +uint8_t HD3000_vals[16][4] = { + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xfa,0x00,0x00,0x00 }, + { 0x2c,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xf4,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, +}; + +uint8_t HD2000_tbl_info[18] = { + 0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x01,0x02,0x02,0x02,0x00,0x01,0x02,0x02 +}; +uint8_t HD2000_os_info[20] = { + 0x30,0x49,0x01,0x11,0x11,0x11,0x08,0x00,0x00,0x01, + 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 +}; + +// The following values came from a Sandy Bridge MacBook Air +uint8_t HD3000_tbl_info[18] = { + 0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01 +}; + +// The following values came from a Sandy Bridge MacBook Air +uint8_t HD3000_os_info[20] = { + 0x30,0x49,0x01,0x12,0x12,0x12,0x08,0x00,0x00,0x01, + 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 +}; + + +uint8_t reg_TRUE[] = { 0x01, 0x00, 0x00, 0x00 }; +uint8_t reg_FALSE[] = { 0x00, 0x00, 0x00, 0x00 }; + +static struct gma_gpu_t KnownGPUS[] = { + { 0x00000000, "Unknown" }, + { 0x808627A2, "Mobile GMA950" }, + { 0x808627AE, "Mobile GMA950" }, + { 0x808627A6, "Mobile GMA950" }, + { 0x8086A011, "Mobile GMA3150" }, + { 0x8086A012, "Mobile GMA3150" }, + { 0x80862772, "Desktop GMA950" }, + { 0x80862776, "Desktop GMA950" }, + { 0x8086A001, "Mobile GMA3150" }, + { 0x8086A002, "Desktop GMA3150" }, + { 0x80862A02, "GMAX3100" }, + { 0x80862A03, "GMAX3100" }, + { 0x80862A12, "GMAX3100" }, + { 0x80862A13, "GMAX3100" }, + { 0x80862A42, "GMAX3100" }, + { 0x80862A43, "GMAX3100" }, + { 0x80860102, "Intel HD Graphics 2000" }, + { 0x80860106, "Intel HD Graphics 2000 Mobile" }, + { 0x80860112, "Intel HD Graphics 3000" }, + { 0x80860116, "Intel HD Graphics 3000 Mobile" }, + { 0x80860122, "Intel HD Graphics 3000" }, + { 0x80860126, "Intel HD Graphics 3000 Mobile" }, + { 0x80860152, "Intel HD Graphics 2500" }, + { 0x80860156, "Intel HD Graphics 2500 Mobile" }, + { 0x80860162, "Intel HD Graphics 4000" }, + { 0x80860166, "Intel HD Graphics 4000 Mobile" }, +}; + +char *get_gma_model(uint32_t id) { + int i = 0; + + for (i = 0; i < (sizeof(KnownGPUS) / sizeof(KnownGPUS[0])); i++) + { + if (KnownGPUS[i].device == id) + return KnownGPUS[i].name; + } + return KnownGPUS[0].name; +} + +bool setup_gma_devprop(pci_dt_t *gma_dev) +{ + char *devicepath; + volatile uint8_t *regs; + uint32_t bar[7]; + char *model; + unsigned int device_id; + uint8_t BuiltIn = 0x00; + uint8_t ClassFix[4] = { 0x00, 0x00, 0x03, 0x00 }; + uint8_t hd3k_device_id[4] = { 0x26, 0x01, 0x00, 0x00 }; + uint8_t hd4k_device_id[4] = { 0x66, 0x01, 0x00, 0x00 }; + uint8_t ig_id[4] = { 0x0A, 0x00, 0x66, 0x01 }; + uint8_t ig_id_mobile[4] = { 0x09, 0x00, 0x66, 0x01 }; + + devicepath = get_pci_dev_path(gma_dev); + + bar[0] = pci_config_read32(gma_dev->dev.addr, 0x10); + regs = (uint8_t *) (bar[0] & ~0x0f); + + model = get_gma_model((gma_dev->vendor_id << 16) | gma_dev->device_id); + device_id = gma_dev->device_id; + + verbose("Intel %s [%04x:%04x] :: %s\n", + model, gma_dev->vendor_id, gma_dev->device_id, devicepath); + + if (!string) + string = devprop_create_string(); + + struct DevPropDevice *device = malloc(sizeof(struct DevPropDevice)); + device = devprop_add_device(string, devicepath); + + if (!device) + { + printf("Failed initializing dev-prop string dev-entry.\n"); + pause(); + return false; + } + + devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1)); +// devprop_add_value(device, "device_type", (uint8_t*)"display", 8); + + if ((model == (char *)&"Mobile GMA950") + || (model == (char *)&"Mobile GMA3150")) + { + devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4); + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + } + else if ((model == (char *)&"Desktop GMA950") + || (model == (char *)&"Desktop GMA3150")) + { + BuiltIn = 0x01; + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + } + else if (model == (char *)&"GMAX3100") + { + devprop_add_value(device, "AAPL,HasPanel", GMAX3100_vals[0], 4); + devprop_add_value(device, "AAPL,SelfRefreshSupported", GMAX3100_vals[1], 4); + devprop_add_value(device, "AAPL,aux-power-connected", GMAX3100_vals[2], 4); + devprop_add_value(device, "AAPL,backlight-control", GMAX3100_vals[3], 4); + devprop_add_value(device, "AAPL00,blackscreen-preferences", GMAX3100_vals[4], 4); + devprop_add_value(device, "AAPL01,BacklightIntensity", GMAX3100_vals[5], 4); + devprop_add_value(device, "AAPL01,blackscreen-preferences", GMAX3100_vals[6], 4); + devprop_add_value(device, "AAPL01,DataJustify", GMAX3100_vals[7], 4); + devprop_add_value(device, "AAPL01,Depth", GMAX3100_vals[8], 4); + devprop_add_value(device, "AAPL01,Dither", GMAX3100_vals[9], 4); + devprop_add_value(device, "AAPL01,DualLink", GMAX3100_vals[10], 4); + devprop_add_value(device, "AAPL01,Height", GMAX3100_vals[11], 4); + devprop_add_value(device, "AAPL01,Interlace", GMAX3100_vals[12], 4); + devprop_add_value(device, "AAPL01,Inverter", GMAX3100_vals[13], 4); + devprop_add_value(device, "AAPL01,InverterCurrent", GMAX3100_vals[14], 4); + devprop_add_value(device, "AAPL01,InverterCurrency", GMAX3100_vals[15], 4); + devprop_add_value(device, "AAPL01,LinkFormat", GMAX3100_vals[16], 4); + devprop_add_value(device, "AAPL01,LinkType", GMAX3100_vals[17], 4); + devprop_add_value(device, "AAPL01,Pipe", GMAX3100_vals[18], 4); + devprop_add_value(device, "AAPL01,PixelFormat", GMAX3100_vals[19], 4); + devprop_add_value(device, "AAPL01,Refresh", GMAX3100_vals[20], 4); + devprop_add_value(device, "AAPL01,Stretch", GMAX3100_vals[21], 4); + devprop_add_value(device, "class-code", ClassFix, 4); + } + else if (model == (char *)&"Intel HD Graphics 2000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); + } + else if (model == (char *)&"Intel HD Graphics 2000 Mobile") + { + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "graphic-options", HD2000_vals[13], 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4); + devprop_add_value(device, "AAPL00,Dither", HD2000_vals[11], 4); + devprop_add_value(device, "AAPL00,DualLink", HD2000_vals[10], 4); + devprop_add_value(device, "AAPL00,LinkFormat", HD2000_vals[9], 4); + devprop_add_value(device, "AAPL00,LinkType", HD2000_vals[8], 4); + devprop_add_value(device, "AAPL00,PixelFormat", HD2000_vals[0], 4); + devprop_add_value(device, "AAPL00,T1", HD2000_vals[1], 4); + devprop_add_value(device, "AAPL00,T2", HD2000_vals[2], 4); + devprop_add_value(device, "AAPL00,T3", HD2000_vals[3], 4); + devprop_add_value(device, "AAPL00,T4", HD2000_vals[4], 4); + devprop_add_value(device, "AAPL00,T5", HD2000_vals[5], 4); + devprop_add_value(device, "AAPL00,T6", HD2000_vals[6], 4); + devprop_add_value(device, "AAPL00,T7", HD2000_vals[7], 4); + devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); + devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + } + else if (model == (char *)&"Intel HD Graphics 3000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd3k_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); + } + else if (model == (char *)&"Intel HD Graphics 3000 Mobile") + { + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "graphic-options", HD3000_vals[13], 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4); + devprop_add_value(device, "AAPL00,Dither", HD3000_vals[11], 4); + devprop_add_value(device, "AAPL00,DualLink", HD3000_vals[10], 4); + devprop_add_value(device, "AAPL00,LinkFormat", HD3000_vals[9], 4); + devprop_add_value(device, "AAPL00,LinkType", HD3000_vals[8], 4); + devprop_add_value(device, "AAPL00,PixelFormat", HD3000_vals[0], 4); + devprop_add_value(device, "AAPL00,T1", HD3000_vals[1], 4); + devprop_add_value(device, "AAPL00,T2", HD3000_vals[2], 4); + devprop_add_value(device, "AAPL00,T3", HD3000_vals[3], 4); + devprop_add_value(device, "AAPL00,T4", HD3000_vals[4], 4); + devprop_add_value(device, "AAPL00,T5", HD3000_vals[5], 4); + devprop_add_value(device, "AAPL00,T6", HD3000_vals[6], 4); + devprop_add_value(device, "AAPL00,T7", HD3000_vals[7], 4); + devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); + devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + } + else if (model == (char *)&"Intel HD Graphics 4000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd4k_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,ig-platform-id", ig_id, 4); + } + else if (model == (char *)&"Intel HD Graphics 4000 Mobile") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_mobile, 4); + } + + stringdata = malloc(sizeof(uint8_t) * string->length); + if (!stringdata) + { + printf("No stringdata.\n"); + pause(); + return false; + } + + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + + return true; +} diff --git a/i386/libsaio/.svn/text-base/gma.h.svn-base b/i386/libsaio/.svn/text-base/gma.h.svn-base new file mode 100644 index 0000000..afbc605 --- /dev/null +++ b/i386/libsaio/.svn/text-base/gma.h.svn-base @@ -0,0 +1,16 @@ +#ifndef __LIBSAIO_GMA_H +#define __LIBSAIO_GMA_H + +bool setup_gma_devprop(pci_dt_t *gma_dev); + +struct gma_gpu_t { + unsigned device; + char *name; +}; + +#define REG8(reg) ((volatile uint8_t *)regs)[(reg)] +#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1] +#define REG32(reg) ((volatile uint32_t *)regs)[(reg) >> 2] + + +#endif /* !__LIBSAIO_GMA_H */ diff --git a/i386/libsaio/.svn/text-base/hfs.c.svn-base b/i386/libsaio/.svn/text-base/hfs.c.svn-base new file mode 100644 index 0000000..e2e0aec --- /dev/null +++ b/i386/libsaio/.svn/text-base/hfs.c.svn-base @@ -0,0 +1,1064 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * hfs.c - File System Module for HFS and HFS+. + * + * Copyright (c) 1999-2002 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include <sl.h> +#include <hfs/hfs_format.h> + +#include "hfs.h" + +#define kBlockSize (0x200) + +#define kMDBBaseOffset (2 * kBlockSize) + +#define kBTreeCatalog (0) +#define kBTreeExtents (1) + +#ifdef __i386__ + +static CICell gCurrentIH; +static long long gAllocationOffset; +static long gIsHFSPlus; +static long gCaseSensitive; +static long gBlockSize; +static long gCacheBlockSize; +static char *gBTreeHeaderBuffer; +static BTHeaderRec *gBTHeaders[2]; +static char *gHFSMdbVib; +static HFSMasterDirectoryBlock *gHFSMDB; +static char *gHFSPlusHeader; +static HFSPlusVolumeHeader *gHFSPlus; +static char *gLinkTemp; +static long long gVolID; +static char *gTempStr; + +#else /* !__i386__ */ + +static CICell gCurrentIH; +static long long gAllocationOffset; +static long gIsHFSPlus; +static long gBlockSize; +static long gCaseSensitive; +static long gCacheBlockSize; +static char gBTreeHeaderBuffer[512]; +static BTHeaderRec *gBTHeaders[2]; +static char gHFSMdbVib[kBlockSize]; +static HFSMasterDirectoryBlock *gHFSMDB =(HFSMasterDirectoryBlock*)gHFSMdbVib; +static char gHFSPlusHeader[kBlockSize]; +static HFSPlusVolumeHeader *gHFSPlus =(HFSPlusVolumeHeader*)gHFSPlusHeader; +static char gLinkTemp[64]; +static long long gVolID; + +#endif /* !__i386__ */ + +static long ReadFile(void *file, uint64_t *length, void *base, uint64_t offset); +static long GetCatalogEntryInfo(void *entry, long *flags, long *time, + FinderInfo *finderInfo, long *infoValid); +static long ResolvePathToCatalogEntry(char *filePath, long *flags, + void *entry, long dirID, long long *dirIndex); + +static long GetCatalogEntry(long long *dirIndex, char **name, + long *flags, long *time, + FinderInfo *finderInfo, long *infoValid); +static long ReadCatalogEntry(char *fileName, long dirID, void *entry, + long long *dirIndex); +static long ReadExtentsEntry(long fileID, long startBlock, void *entry); + +static long ReadBTreeEntry(long btree, void *key, char *entry, long long *dirIndex); +static void GetBTreeRecord(long index, char *nodeBuffer, long nodeSize, + char **key, char **data); + +static long ReadExtent(char *extent, uint64_t extentSize, long extentFile, + uint64_t offset, uint64_t size, void *buffer, long cache); + +static long GetExtentStart(void *extents, long index); +static long GetExtentSize(void *extents, long index); + +static long CompareHFSCatalogKeys(void *key, void *testKey); +static long CompareHFSPlusCatalogKeys(void *key, void *testKey); +static long CompareHFSExtentsKeys(void *key, void *testKey); +static long CompareHFSPlusExtentsKeys(void *key, void *testKey); + +extern long FastRelString(u_int8_t *str1, u_int8_t *str2); +extern long BinaryUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, + u_int16_t *uniStr2, u_int32_t len2); + + +static void SwapFinderInfo(FndrFileInfo *dst, FndrFileInfo *src) +{ + dst->fdType = SWAP_BE32(src->fdType); + dst->fdCreator = SWAP_BE32(src->fdCreator); + dst->fdFlags = SWAP_BE16(src->fdFlags); + // Don't bother with location +} + +void HFSFree(CICell ih) +{ + if(gCurrentIH == ih) + gCurrentIH = 0; + free(ih); +} + +bool HFSProbe (const void *buf) +{ + const HFSMasterDirectoryBlock *mdb; + const HFSPlusVolumeHeader *header; + mdb=(const HFSMasterDirectoryBlock *)(((const char*)buf)+kMDBBaseOffset); + header=(const HFSPlusVolumeHeader *)(((const char*)buf)+kMDBBaseOffset); + + if ( SWAP_BE16(mdb->drSigWord) == kHFSSigWord ) + return true; + if (SWAP_BE16(header->signature) != kHFSPlusSigWord && + SWAP_BE16(header->signature) != kHFSXSigWord) + return false; + return true; +} + +long HFSInitPartition(CICell ih) +{ + long extentSize, extentFile, nodeSize; + void *extent; + + if (ih == gCurrentIH) { +#ifdef __i386__ + CacheInit(ih, gCacheBlockSize); +#endif + return 0; + } + +#ifdef __i386__ + if (!gTempStr) gTempStr = (char *)malloc(4096); + if (!gLinkTemp) gLinkTemp = (char *)malloc(64); + if (!gBTreeHeaderBuffer) gBTreeHeaderBuffer = (char *)malloc(512); + if (!gHFSMdbVib) { + gHFSMdbVib = (char *)malloc(kBlockSize); + gHFSMDB = (HFSMasterDirectoryBlock *)gHFSMdbVib; + } + if (!gHFSPlusHeader) { + gHFSPlusHeader = (char *)malloc(kBlockSize); + gHFSPlus = (HFSPlusVolumeHeader *)gHFSPlusHeader; + } + if (!gTempStr || !gLinkTemp || !gBTreeHeaderBuffer || + !gHFSMdbVib || !gHFSPlusHeader) return -1; +#endif /* __i386__ */ + + gAllocationOffset = 0; + gIsHFSPlus = 0; + gCaseSensitive = 0; + gBTHeaders[0] = 0; + gBTHeaders[1] = 0; + + // Look for the HFS MDB + Seek(ih, kMDBBaseOffset); + Read(ih, (long)gHFSMdbVib, kBlockSize); + + if ( SWAP_BE16(gHFSMDB->drSigWord) == kHFSSigWord ) { + gAllocationOffset = SWAP_BE16(gHFSMDB->drAlBlSt) * kBlockSize; + + // See if it is HFSPlus + if (SWAP_BE16(gHFSMDB->drEmbedSigWord) != kHFSPlusSigWord) { + // Normal HFS; + gCacheBlockSize = gBlockSize = SWAP_BE32(gHFSMDB->drAlBlkSiz); + CacheInit(ih, gCacheBlockSize); + gCurrentIH = ih; + + // grab the 64 bit volume ID + bcopy(&gHFSMDB->drFndrInfo[6], &gVolID, 8); + + // Get the Catalog BTree node size. + extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drCTFlSize); + extentFile = kHFSCatalogFileID; + ReadExtent(extent, extentSize, extentFile, 0, 256, + gBTreeHeaderBuffer + kBTreeCatalog * 256, 0); + + nodeSize = SWAP_BE16(((BTHeaderRec *)(gBTreeHeaderBuffer + kBTreeCatalog * 256 + + sizeof(BTNodeDescriptor)))->nodeSize); + + // If the BTree node size is larger than the block size, reset the cache. + if (nodeSize > gBlockSize) { + gCacheBlockSize = nodeSize; + CacheInit(ih, gCacheBlockSize); + } + + return 0; + } + + // Calculate the offset to the embeded HFSPlus volume. + gAllocationOffset += (long long)SWAP_BE16(gHFSMDB->drEmbedExtent.startBlock) * + SWAP_BE32(gHFSMDB->drAlBlkSiz); + } + + // Look for the HFSPlus Header + Seek(ih, gAllocationOffset + kMDBBaseOffset); + Read(ih, (long)gHFSPlusHeader, kBlockSize); + + // Not a HFS+ or HFSX volume. + if (SWAP_BE16(gHFSPlus->signature) != kHFSPlusSigWord && + SWAP_BE16(gHFSPlus->signature) != kHFSXSigWord) { + verbose("HFS signature was not present.\n"); + gCurrentIH = 0; + return -1; + } + + gIsHFSPlus = 1; + gCacheBlockSize = gBlockSize = SWAP_BE32(gHFSPlus->blockSize); + CacheInit(ih, gCacheBlockSize); + gCurrentIH = ih; + + ih->modTime = SWAP_BE32(gHFSPlus->modifyDate) - 2082844800; + + // grab the 64 bit volume ID + bcopy(&gHFSPlus->finderInfo[24], &gVolID, 8); + + // Get the Catalog BTree node size. + extent = &gHFSPlus->catalogFile.extents; + extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize); + extentFile = kHFSCatalogFileID; + + ReadExtent(extent, extentSize, extentFile, 0, 256, + gBTreeHeaderBuffer + kBTreeCatalog * 256, 0); + + nodeSize = SWAP_BE16(((BTHeaderRec *)(gBTreeHeaderBuffer + kBTreeCatalog * 256 + + sizeof(BTNodeDescriptor)))->nodeSize); + + // If the BTree node size is larger than the block size, reset the cache. + if (nodeSize > gBlockSize) { + gCacheBlockSize = nodeSize; + CacheInit(ih, gCacheBlockSize); + } + + return 0; +} + +long HFSLoadFile(CICell ih, char * filePath) +{ + return HFSReadFile(ih, filePath, (void *)gFSLoadAddress, 0, 0); +} + +long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length) +{ + char entry[512]; + char devStr[12]; + long dirID, result, flags; + + if (HFSInitPartition(ih) == -1) return -1; + + dirID = kHFSRootFolderID; + // Skip a lead '\'. Start in the system folder if there are two. + if (filePath[0] == '/') { + if (filePath[1] == '/') { + if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); + else dirID = SWAP_BE32(gHFSMDB->drFndrInfo[5]); + if (dirID == 0) { + return -1; + } + filePath++; + } + filePath++; + } + + result = ResolvePathToCatalogEntry(filePath, &flags, entry, dirID, 0); + if ((result == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { + return -1; + } + +#if UNUSED + // Not yet for Intel. System.config/Default.table will fail this check. + // Check file owner and permissions. + if (flags & (kOwnerNotRoot | kPermGroupWrite | kPermOtherWrite)) return -1; +#endif + + result = ReadFile(entry, &length, base, offset); + if (result == -1) { + return -1; + } + + getDeviceDescription(ih, devStr); + verbose("Read HFS%s file: [%s/%s] %d bytes.\n", + (gIsHFSPlus ? "+" : ""), devStr, filePath, (uint32_t)length); + + return length; +} + +long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, + long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + char entry[512]; + long dirID, dirFlags; + + if (HFSInitPartition(ih) == -1) return -1; + + if (*dirIndex == -1) return -1; + + dirID = kHFSRootFolderID; + // Skip a lead '\'. Start in the system folder if there are two. + if (dirPath[0] == '/') { + if (dirPath[1] == '/') { + if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); + else dirID = SWAP_BE32(gHFSMDB->drFndrInfo[5]); + if (dirID == 0) return -1; + dirPath++; + } + dirPath++; + } + + if (*dirIndex == 0) { + ResolvePathToCatalogEntry(dirPath, &dirFlags, entry, dirID, dirIndex); + if (*dirIndex == 0) *dirIndex = -1; + if ((dirFlags & kFileTypeMask) != kFileTypeUnknown) return -1; + } + + GetCatalogEntry(dirIndex, name, flags, time, finderInfo, infoValid); + if (*dirIndex == 0) *dirIndex = -1; + if ((*flags & kFileTypeMask) == kFileTypeUnknown) return -1; + + return 0; +} + +void +HFSGetDescription(CICell ih, char *str, long strMaxLen) +{ + + UInt16 nodeSize; + UInt32 firstLeafNode; + long long dirIndex; + char *name; + long flags, time; + + if (HFSInitPartition(ih) == -1) { return; } + + /* Fill some crucial data structures by side effect. */ + dirIndex = 0; + HFSGetDirEntry(ih, "/", &dirIndex, &name, &flags, &time, 0, 0); + + /* Now we can loook up the volume name node. */ + nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize); + firstLeafNode = SWAP_BE32(gBTHeaders[kBTreeCatalog]->firstLeafNode); + + dirIndex = (long long) firstLeafNode * nodeSize; + + GetCatalogEntry(&dirIndex, &name, &flags, &time, 0, 0); + + strncpy(str, name, strMaxLen); + str[strMaxLen] = '\0'; +} + + +long +HFSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock) +{ + char entry[512]; + long dirID, result, flags; + void *extents; + HFSCatalogFile *hfsFile = (void *)entry; + HFSPlusCatalogFile *hfsPlusFile = (void *)entry; + + if (HFSInitPartition(ih) == -1) return -1; + + dirID = kHFSRootFolderID; + // Skip a lead '\'. Start in the system folder if there are two. + if (filePath[0] == '/') { + if (filePath[1] == '/') { + if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); + else dirID = SWAP_BE32(gHFSMDB->drFndrInfo[5]); + if (dirID == 0) { + return -1; + } + filePath++; + } + filePath++; + } + + result = ResolvePathToCatalogEntry(filePath, &flags, entry, dirID, 0); + if ((result == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { + printf("HFS: Resolve path %s failed\n", filePath); + return -1; + } + + if (gIsHFSPlus) { + extents = &hfsPlusFile->dataFork.extents; + } else { + extents = &hfsFile->dataExtents; + } + +#if DEBUG + printf("extent start 0x%x\n", (unsigned long)GetExtentStart(extents, 0)); + printf("block size 0x%x\n", (unsigned long)gBlockSize); + printf("Allocation offset 0x%x\n", (unsigned long)gAllocationOffset); +#endif + *firstBlock = ((unsigned long long)GetExtentStart(extents, 0) * (unsigned long long) gBlockSize + gAllocationOffset) / 512ULL; + return 0; +} + +long HFSGetUUID(CICell ih, char *uuidStr) +{ + if (HFSInitPartition(ih) == -1) return -1; + if (gVolID == 0LL) return -1; + + return CreateUUIDString((uint8_t*)(&gVolID), sizeof(gVolID), uuidStr); +} + +// Private Functions + +static long ReadFile(void * file, uint64_t * length, void * base, uint64_t offset) +{ + void *extents; + long fileID; + uint64_t fileLength; + HFSCatalogFile *hfsFile = file; + HFSPlusCatalogFile *hfsPlusFile = file; + + if (gIsHFSPlus) { + fileID = SWAP_BE32(hfsPlusFile->fileID); + fileLength = (uint64_t)SWAP_BE64(hfsPlusFile->dataFork.logicalSize); + extents = &hfsPlusFile->dataFork.extents; + } else { + fileID = SWAP_BE32(hfsFile->fileID); + fileLength = SWAP_BE32(hfsFile->dataLogicalSize); + extents = &hfsFile->dataExtents; + } + + if (offset > fileLength) { + printf("Offset is too large.\n"); + return -1; + } + + if ((*length == 0) || ((offset + *length) > fileLength)) { + *length = fileLength - offset; + } + +/* if (*length > kLoadSize) { + printf("File is too large.\n"); + return -1; + }*/ + + *length = ReadExtent((char *)extents, fileLength, fileID, + offset, *length, (char *)base, 0); + + return 0; +} + +static long GetCatalogEntryInfo(void * entry, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + long tmpTime = 0; + long valid = 0; + + // Get information about the file. + + switch ( SWAP_BE16(*(short *)entry) ) + { + case kHFSFolderRecord : + *flags = kFileTypeDirectory; + tmpTime = SWAP_BE32(((HFSCatalogFolder *)entry)->modifyDate); + break; + + case kHFSPlusFolderRecord : + *flags = kFileTypeDirectory | + (SWAP_BE16(((HFSPlusCatalogFolder *)entry)->bsdInfo.fileMode) & kPermMask); + if (SWAP_BE32(((HFSPlusCatalogFolder *)entry)->bsdInfo.ownerID) != 0) + *flags |= kOwnerNotRoot; + tmpTime = SWAP_BE32(((HFSPlusCatalogFolder *)entry)->contentModDate); + break; + + case kHFSFileRecord : + *flags = kFileTypeFlat; + tmpTime = SWAP_BE32(((HFSCatalogFile *)entry)->modifyDate); + if (finderInfo) { + SwapFinderInfo((FndrFileInfo *)finderInfo, &((HFSCatalogFile *)entry)->userInfo); + valid = 1; + } + break; + + case kHFSPlusFileRecord : + *flags = kFileTypeFlat | + (SWAP_BE16(((HFSPlusCatalogFile *)entry)->bsdInfo.fileMode) & kPermMask); + if (SWAP_BE32(((HFSPlusCatalogFile *)entry)->bsdInfo.ownerID) != 0) + *flags |= kOwnerNotRoot; + tmpTime = SWAP_BE32(((HFSPlusCatalogFile *)entry)->contentModDate); + if (finderInfo) { + SwapFinderInfo((FndrFileInfo *)finderInfo, &((HFSPlusCatalogFile *)entry)->userInfo); + valid = 1; + } + break; + + case kHFSFileThreadRecord : + case kHFSPlusFileThreadRecord : + case kHFSFolderThreadRecord : + case kHFSPlusFolderThreadRecord : + *flags = kFileTypeUnknown; + tmpTime = 0; + break; + } + + if (time != 0) { + // Convert base time from 1904 to 1970. + *time = tmpTime - 2082844800; + } + if (infoValid) *infoValid = valid; + + return 0; +} + +static long ResolvePathToCatalogEntry(char * filePath, long * flags, + void * entry, long dirID, long long * dirIndex) +{ + char *restPath; + long result, cnt, subFolderID = 0; + long long tmpDirIndex; + HFSPlusCatalogFile *hfsPlusFile; + + // Copy the file name to gTempStr + cnt = 0; + while ((filePath[cnt] != '/') && (filePath[cnt] != '\0')) cnt++; + strlcpy(gTempStr, filePath, cnt+1); + + // Move restPath to the right place. + if (filePath[cnt] != '\0') cnt++; + restPath = filePath + cnt; + + // gTempStr is a name in the current Dir. + // restPath is the rest of the path if any. + + result = ReadCatalogEntry(gTempStr, dirID, entry, dirIndex); + if (result == -1) { + return -1; + } + + GetCatalogEntryInfo(entry, flags, 0, 0, 0); + + if ((*flags & kFileTypeMask) == kFileTypeDirectory) { + if (gIsHFSPlus) + subFolderID = SWAP_BE32(((HFSPlusCatalogFolder *)entry)->folderID); + else + subFolderID = SWAP_BE32(((HFSCatalogFolder *)entry)->folderID); + } + + if ((*flags & kFileTypeMask) == kFileTypeDirectory) + result = ResolvePathToCatalogEntry(restPath, flags, entry, + subFolderID, dirIndex); + + if (gIsHFSPlus && ((*flags & kFileTypeMask) == kFileTypeFlat)) { + hfsPlusFile = (HFSPlusCatalogFile *)entry; + if ((SWAP_BE32(hfsPlusFile->userInfo.fdType) == kHardLinkFileType) && + (SWAP_BE32(hfsPlusFile->userInfo.fdCreator) == kHFSPlusCreator)) { + sprintf(gLinkTemp, "%s/%s%ld", HFSPLUSMETADATAFOLDER, + HFS_INODE_PREFIX, SWAP_BE32(hfsPlusFile->bsdInfo.special.iNodeNum)); + result = ResolvePathToCatalogEntry(gLinkTemp, flags, entry, + kHFSRootFolderID, &tmpDirIndex); + } + } + + return result; +} + +static long GetCatalogEntry(long long * dirIndex, char ** name, + long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + long extentSize, nodeSize, curNode, index; + void *extent; + char *nodeBuf, *testKey, *entry; + BTNodeDescriptor *node; + + if (gIsHFSPlus) { + extent = &gHFSPlus->catalogFile.extents; + extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize); + } else { + extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drCTFlSize); + } + + nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize); + nodeBuf = (char *)malloc(nodeSize); + node = (BTNodeDescriptor *)nodeBuf; + + index = (long) (*dirIndex % nodeSize); + curNode = (long) (*dirIndex / nodeSize); + + // Read the BTree node and get the record for index. + ReadExtent(extent, extentSize, kHFSCatalogFileID, + (long long) curNode * nodeSize, nodeSize, nodeBuf, 1); + GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &entry); + + GetCatalogEntryInfo(entry, flags, time, finderInfo, infoValid); + + // Get the file name. + if (gIsHFSPlus) { + utf_encodestr(((HFSPlusCatalogKey *)testKey)->nodeName.unicode, + SWAP_BE16(((HFSPlusCatalogKey *)testKey)->nodeName.length), + (u_int8_t *)gTempStr, 256, OSBigEndian); + } else { + strncpy(gTempStr, + (const char *)&((HFSCatalogKey *)testKey)->nodeName[1], + ((HFSCatalogKey *)testKey)->nodeName[0]); + gTempStr[((HFSCatalogKey *)testKey)->nodeName[0]] = '\0'; + } + *name = gTempStr; + + // Update dirIndex. + index++; + if (index == SWAP_BE16(node->numRecords)) { + index = 0; + curNode = SWAP_BE32(node->fLink); + } + *dirIndex = (long long) curNode * nodeSize + index; + + free(nodeBuf); + + return 0; +} + +static long ReadCatalogEntry(char * fileName, long dirID, + void * entry, long long * dirIndex) +{ + long length; + char key[sizeof(HFSPlusCatalogKey)]; + HFSCatalogKey *hfsKey = (HFSCatalogKey *)key; + HFSPlusCatalogKey *hfsPlusKey = (HFSPlusCatalogKey *)key; + + // Make the catalog key. + if ( gIsHFSPlus ) + { + hfsPlusKey->parentID = SWAP_BE32(dirID); + length = strlen(fileName); + if (length > 255) length = 255; + utf_decodestr((u_int8_t *)fileName, hfsPlusKey->nodeName.unicode, + &(hfsPlusKey->nodeName.length), 512, OSBigEndian); + } else { + hfsKey->parentID = SWAP_BE32(dirID); + length = strlen(fileName); + if (length > 31) length = 31; + hfsKey->nodeName[0] = length; + strncpy((char *)(hfsKey->nodeName + 1), fileName, length); + } + + return ReadBTreeEntry(kBTreeCatalog, &key, entry, dirIndex); +} + +static long ReadExtentsEntry(long fileID, long startBlock, void * entry) +{ + char key[sizeof(HFSPlusExtentKey)]; + HFSExtentKey *hfsKey = (HFSExtentKey *)key; + HFSPlusExtentKey *hfsPlusKey = (HFSPlusExtentKey *)key; + + // Make the extents key. + if (gIsHFSPlus) { + hfsPlusKey->forkType = 0; + hfsPlusKey->fileID = SWAP_BE32(fileID); + hfsPlusKey->startBlock = SWAP_BE32(startBlock); + } else { + hfsKey->forkType = 0; + hfsKey->fileID = SWAP_BE32(fileID); + hfsKey->startBlock = SWAP_BE16(startBlock); + } + + return ReadBTreeEntry(kBTreeExtents, &key, entry, 0); +} + +static long ReadBTreeEntry(long btree, void * key, char * entry, long long * dirIndex) +{ + long extentSize; + void *extent; + short extentFile; + char *nodeBuf; + BTNodeDescriptor *node; + long nodeSize, result = 0, entrySize = 0; + long curNode, index = 0, lowerBound, upperBound; + char *testKey, *recordData; + + // Figure out which tree is being looked at. + if (btree == kBTreeCatalog) { + if (gIsHFSPlus) { + extent = &gHFSPlus->catalogFile.extents; + extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize); + } else { + extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drCTFlSize); + } + extentFile = kHFSCatalogFileID; + } else { + if (gIsHFSPlus) { + extent = &gHFSPlus->extentsFile.extents; + extentSize = SWAP_BE64(gHFSPlus->extentsFile.logicalSize); + } else { + extent = (HFSExtentDescriptor *)&gHFSMDB->drXTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drXTFlSize); + } + extentFile = kHFSExtentsFileID; + } + + // Read the BTree Header if needed. + if (gBTHeaders[btree] == 0) { + ReadExtent(extent, extentSize, extentFile, 0, 256, + gBTreeHeaderBuffer + btree * 256, 0); + gBTHeaders[btree] = (BTHeaderRec *)(gBTreeHeaderBuffer + btree * 256 + + sizeof(BTNodeDescriptor)); + if ((gIsHFSPlus && btree == kBTreeCatalog) && + (gBTHeaders[btree]->keyCompareType == kHFSBinaryCompare)) { + gCaseSensitive = 1; + } + } + + curNode = SWAP_BE32(gBTHeaders[btree]->rootNode); + nodeSize = SWAP_BE16(gBTHeaders[btree]->nodeSize); + nodeBuf = (char *)malloc(nodeSize); + node = (BTNodeDescriptor *)nodeBuf; + + while (1) { + // Read the current node. + ReadExtent(extent, extentSize, extentFile, + (long long) curNode * nodeSize, nodeSize, nodeBuf, 1); + + // Find the matching key. + lowerBound = 0; + upperBound = SWAP_BE16(node->numRecords) - 1; + while (lowerBound <= upperBound) { + index = (lowerBound + upperBound) / 2; + + GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &recordData); + + if (gIsHFSPlus) { + if (btree == kBTreeCatalog) { + result = CompareHFSPlusCatalogKeys(key, testKey); + } else { + result = CompareHFSPlusExtentsKeys(key, testKey); + } + } else { + if (btree == kBTreeCatalog) { + result = CompareHFSCatalogKeys(key, testKey); + } else { + result = CompareHFSExtentsKeys(key, testKey); + } + } + + if (result < 0) upperBound = index - 1; // search < trial + else if (result > 0) lowerBound = index + 1; // search > trial + else break; // search = trial + } + + if (result < 0) { + index = upperBound; + GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &recordData); + } + + // Found the closest key... Recurse on it if this is an index node. + if (node->kind == kBTIndexNode) { + curNode = SWAP_BE32( *((long *)recordData) ); + } else break; + } + + // Return error if the file was not found. + if (result != 0) { free(nodeBuf); return -1; } + + if (btree == kBTreeCatalog) { + switch (SWAP_BE16(*(short *)recordData)) { + case kHFSFolderRecord : entrySize = 70; break; + case kHFSFileRecord : entrySize = 102; break; + case kHFSFolderThreadRecord : entrySize = 46; break; + case kHFSFileThreadRecord : entrySize = 46; break; + case kHFSPlusFolderRecord : entrySize = 88; break; + case kHFSPlusFileRecord : entrySize = 248; break; + case kHFSPlusFolderThreadRecord : entrySize = 264; break; + case kHFSPlusFileThreadRecord : entrySize = 264; break; + } + } else { + if (gIsHFSPlus) entrySize = sizeof(HFSPlusExtentRecord); + else entrySize = sizeof(HFSExtentRecord); + } + + bcopy(recordData, entry, entrySize); + + // Update dirIndex. + if (dirIndex != 0) { + index++; + if (index == SWAP_BE16(node->numRecords)) { + index = 0; + curNode = SWAP_BE32(node->fLink); + } + *dirIndex = (long long) curNode * nodeSize + index; + } + + free(nodeBuf); + + return 0; +} + +static void GetBTreeRecord(long index, char * nodeBuffer, long nodeSize, + char ** key, char ** data) +{ + long keySize; + long recordOffset; + + recordOffset = SWAP_BE16(*((short *)(nodeBuffer + (nodeSize - 2 * index - 2)))); + *key = nodeBuffer + recordOffset; + if (gIsHFSPlus) { + keySize = SWAP_BE16(*(short *)*key); + *data = *key + 2 + keySize; + } else { + keySize = **key; + *data = *key + 2 + keySize - (keySize & 1); + } +} + +static long ReadExtent(char * extent, uint64_t extentSize, + long extentFile, uint64_t offset, uint64_t size, + void * buffer, long cache) +{ + uint64_t lastOffset; + long long blockNumber, countedBlocks = 0; + long long nextExtent = 0, sizeRead = 0, readSize; + long long nextExtentBlock, currentExtentBlock = 0; + long long readOffset; + long long extentDensity, sizeofExtent, currentExtentSize; + char *currentExtent, *extentBuffer = 0, *bufferPos = buffer; + + if (offset >= extentSize) return 0; + + if (gIsHFSPlus) { + extentDensity = kHFSPlusExtentDensity; + sizeofExtent = sizeof(HFSPlusExtentDescriptor); + } else { + extentDensity = kHFSExtentDensity; + sizeofExtent = sizeof(HFSExtentDescriptor); + } + + lastOffset = offset + size; + while (offset < lastOffset) { + blockNumber = offset / gBlockSize; + + // Find the extent for the offset. + for (; ; nextExtent++) { + if (nextExtent < extentDensity) { + if ((countedBlocks+GetExtentSize(extent, nextExtent)-1)<blockNumber) { + countedBlocks += GetExtentSize(extent, nextExtent); + continue; + } + + currentExtent = extent + nextExtent * sizeofExtent; + break; + } + + if (extentBuffer == 0) { + extentBuffer = malloc(sizeofExtent * extentDensity); + if (extentBuffer == 0) return -1; + } + + nextExtentBlock = nextExtent / extentDensity; + if (currentExtentBlock != nextExtentBlock) { + ReadExtentsEntry(extentFile, countedBlocks, extentBuffer); + currentExtentBlock = nextExtentBlock; + } + + currentExtentSize = GetExtentSize(extentBuffer, nextExtent % extentDensity); + + if ((countedBlocks + currentExtentSize - 1) >= blockNumber) { + currentExtent = extentBuffer + sizeofExtent * (nextExtent % extentDensity); + break; + } + + countedBlocks += currentExtentSize; + } + + readOffset = ((blockNumber - countedBlocks) * gBlockSize) + + (offset % gBlockSize); + + // MacWen: fix overflow in multiplication by forcing 64bit multiplication + readSize = (long long)GetExtentSize(currentExtent, 0) * gBlockSize - readOffset; + if (readSize > (size - sizeRead)) readSize = size - sizeRead; + + readOffset += (long long)GetExtentStart(currentExtent, 0) * gBlockSize; + + CacheRead(gCurrentIH, bufferPos, gAllocationOffset + readOffset, + readSize, cache); + + sizeRead += readSize; + offset += readSize; + bufferPos += readSize; + } + + if (extentBuffer) free(extentBuffer); + + return sizeRead; +} + +static long GetExtentStart(void * extents, long index) +{ + long start; + HFSExtentDescriptor *hfsExtents = extents; + HFSPlusExtentDescriptor *hfsPlusExtents = extents; + + if (gIsHFSPlus) start = SWAP_BE32(hfsPlusExtents[index].startBlock); + else start = SWAP_BE16(hfsExtents[index].startBlock); + + return start; +} + +static long GetExtentSize(void * extents, long index) +{ + long size; + HFSExtentDescriptor *hfsExtents = extents; + HFSPlusExtentDescriptor *hfsPlusExtents = extents; + + if (gIsHFSPlus) size = SWAP_BE32(hfsPlusExtents[index].blockCount); + else size = SWAP_BE16(hfsExtents[index].blockCount); + + return size; +} + +static long CompareHFSCatalogKeys(void * key, void * testKey) +{ + HFSCatalogKey *searchKey, *trialKey; + long result, searchParentID, trialParentID; + + searchKey = key; + trialKey = testKey; + + searchParentID = SWAP_BE32(searchKey->parentID); + trialParentID = SWAP_BE32(trialKey->parentID); + + // parent dirID is unsigned + if (searchParentID > trialParentID) result = 1; + else if (searchParentID < trialParentID) result = -1; + else { + // parent dirID's are equal, compare names + result = FastRelString(searchKey->nodeName, trialKey->nodeName); + } + + return result; +} + +static long CompareHFSPlusCatalogKeys(void * key, void * testKey) +{ + HFSPlusCatalogKey *searchKey, *trialKey; + long result, searchParentID, trialParentID; + + searchKey = key; + trialKey = testKey; + + searchParentID = SWAP_BE32(searchKey->parentID); + trialParentID = SWAP_BE32(trialKey->parentID); + + // parent dirID is unsigned + if (searchParentID > trialParentID) result = 1; + else if (searchParentID < trialParentID) result = -1; + else { + // parent dirID's are equal, compare names + if ((searchKey->nodeName.length == 0) || (trialKey->nodeName.length == 0)) + result = searchKey->nodeName.length - trialKey->nodeName.length; + else + if (gCaseSensitive) { + result = BinaryUnicodeCompare(&searchKey->nodeName.unicode[0], + SWAP_BE16(searchKey->nodeName.length), + &trialKey->nodeName.unicode[0], + SWAP_BE16(trialKey->nodeName.length)); + } else { + result = FastUnicodeCompare(&searchKey->nodeName.unicode[0], + SWAP_BE16(searchKey->nodeName.length), + &trialKey->nodeName.unicode[0], + SWAP_BE16(trialKey->nodeName.length), OSBigEndian); + } + } + + return result; +} + +static long CompareHFSExtentsKeys(void * key, void * testKey) +{ + HFSExtentKey *searchKey, *trialKey; + long result; + + searchKey = key; + trialKey = testKey; + + // assume searchKey < trialKey + result = -1; + + if (searchKey->fileID == trialKey->fileID) { + // FileNum's are equal; compare fork types + if (searchKey->forkType == trialKey->forkType) { + // Fork types are equal; compare allocation block number + if (searchKey->startBlock == trialKey->startBlock) { + // Everything is equal + result = 0; + } else { + // Allocation block numbers differ; determine sign + if (SWAP_BE16(searchKey->startBlock) > SWAP_BE16(trialKey->startBlock)) + result = 1; + } + } else { + // Fork types differ; determine sign + if (searchKey->forkType > trialKey->forkType) result = 1; + } + } else { + // FileNums differ; determine sign + if (SWAP_BE32(searchKey->fileID) > SWAP_BE32(trialKey->fileID)) + result = 1; + } + + return result; +} + +static long CompareHFSPlusExtentsKeys(void * key, void * testKey) +{ + HFSPlusExtentKey *searchKey, *trialKey; + long result; + + searchKey = key; + trialKey = testKey; + + // assume searchKey < trialKey + result = -1; + + if (searchKey->fileID == trialKey->fileID) { + // FileNum's are equal; compare fork types + if (searchKey->forkType == trialKey->forkType) { + // Fork types are equal; compare allocation block number + if (searchKey->startBlock == trialKey->startBlock) { + // Everything is equal + result = 0; + } else { + // Allocation block numbers differ; determine sign + if (SWAP_BE32(searchKey->startBlock) > SWAP_BE32(trialKey->startBlock)) + result = 1; + } + } else { + // Fork types differ; determine sign + if (searchKey->forkType > trialKey->forkType) result = 1; + } + } else { + // FileNums differ; determine sign + if (SWAP_BE32(searchKey->fileID) > SWAP_BE32(trialKey->fileID)) + result = 1; + } + + return result; +} + diff --git a/i386/libsaio/.svn/text-base/hfs.h.svn-base b/i386/libsaio/.svn/text-base/hfs.h.svn-base new file mode 100644 index 0000000..407f163 --- /dev/null +++ b/i386/libsaio/.svn/text-base/hfs.h.svn-base @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern long HFSInitPartition(CICell ih); +extern long HFSLoadFile(CICell ih, char * filePath); +extern long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length); +extern long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +extern void HFSGetDescription(CICell ih, char *str, long strMaxLen); +extern long HFSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); +extern long HFSGetUUID(CICell ih, char *uuidStr); +extern void HFSFree(CICell ih); +extern bool HFSProbe (const void *buf); diff --git a/i386/libsaio/.svn/text-base/hfs_CaseTables.h.svn-base b/i386/libsaio/.svn/text-base/hfs_CaseTables.h.svn-base new file mode 100644 index 0000000..105007c --- /dev/null +++ b/i386/libsaio/.svn/text-base/hfs_CaseTables.h.svn-base @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + File: CaseTables.h +*/ + + +/* The lower case table consists of a 256-entry high-byte table followed by some number of + 256-entry subtables. The high-byte table contains either an offset to the subtable for + characters with that high byte or zero, which means that there are no case mappings or + ignored characters in that block. Ignored characters are mapped to zero. + */ + +#if UNCOMPRESSED +u_int16_t gLowerCaseTable[] = { + + // High-byte indices ( == 0 iff no case mapping and no ignorables ) + + /* 0 */ 0x0100, 0x0200, 0x0000, 0x0300, 0x0400, 0x0500, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 1 */ 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 2 */ 0x0700, 0x0800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 3 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 4 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 5 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 6 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 7 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 8 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 9 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* A */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* B */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* C */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* D */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* E */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* F */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0900, 0x0A00, + + // Table 1 (for high byte 0x00) + + /* 0 */ 0xFFFF, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, + /* 1 */ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, + /* 2 */ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + /* 3 */ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + /* 4 */ 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + /* 5 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + /* 6 */ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + /* 7 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, + /* 8 */ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + /* 9 */ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + /* A */ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + /* B */ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + /* C */ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00E6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + /* D */ 0x00F0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00F8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00FE, 0x00DF, + /* E */ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + /* F */ 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, + + // Table 2 (for high byte 0x01) + + /* 0 */ 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E, 0x010F, + /* 1 */ 0x0111, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, 0x0119, 0x011A, 0x011B, 0x011C, 0x011D, 0x011E, 0x011F, + /* 2 */ 0x0120, 0x0121, 0x0122, 0x0123, 0x0124, 0x0125, 0x0127, 0x0127, 0x0128, 0x0129, 0x012A, 0x012B, 0x012C, 0x012D, 0x012E, 0x012F, + /* 3 */ 0x0130, 0x0131, 0x0133, 0x0133, 0x0134, 0x0135, 0x0136, 0x0137, 0x0138, 0x0139, 0x013A, 0x013B, 0x013C, 0x013D, 0x013E, 0x0140, + /* 4 */ 0x0140, 0x0142, 0x0142, 0x0143, 0x0144, 0x0145, 0x0146, 0x0147, 0x0148, 0x0149, 0x014B, 0x014B, 0x014C, 0x014D, 0x014E, 0x014F, + /* 5 */ 0x0150, 0x0151, 0x0153, 0x0153, 0x0154, 0x0155, 0x0156, 0x0157, 0x0158, 0x0159, 0x015A, 0x015B, 0x015C, 0x015D, 0x015E, 0x015F, + /* 6 */ 0x0160, 0x0161, 0x0162, 0x0163, 0x0164, 0x0165, 0x0167, 0x0167, 0x0168, 0x0169, 0x016A, 0x016B, 0x016C, 0x016D, 0x016E, 0x016F, + /* 7 */ 0x0170, 0x0171, 0x0172, 0x0173, 0x0174, 0x0175, 0x0176, 0x0177, 0x0178, 0x0179, 0x017A, 0x017B, 0x017C, 0x017D, 0x017E, 0x017F, + /* 8 */ 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, 0x0188, 0x0256, 0x0257, 0x018C, 0x018C, 0x018D, 0x01DD, 0x0259, + /* 9 */ 0x025B, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, 0x0199, 0x0199, 0x019A, 0x019B, 0x026F, 0x0272, 0x019E, 0x0275, + /* A */ 0x01A0, 0x01A1, 0x01A3, 0x01A3, 0x01A5, 0x01A5, 0x01A6, 0x01A8, 0x01A8, 0x0283, 0x01AA, 0x01AB, 0x01AD, 0x01AD, 0x0288, 0x01AF, + /* B */ 0x01B0, 0x028A, 0x028B, 0x01B4, 0x01B4, 0x01B6, 0x01B6, 0x0292, 0x01B9, 0x01B9, 0x01BA, 0x01BB, 0x01BD, 0x01BD, 0x01BE, 0x01BF, + /* C */ 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9, 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC, 0x01CD, 0x01CE, 0x01CF, + /* D */ 0x01D0, 0x01D1, 0x01D2, 0x01D3, 0x01D4, 0x01D5, 0x01D6, 0x01D7, 0x01D8, 0x01D9, 0x01DA, 0x01DB, 0x01DC, 0x01DD, 0x01DE, 0x01DF, + /* E */ 0x01E0, 0x01E1, 0x01E2, 0x01E3, 0x01E5, 0x01E5, 0x01E6, 0x01E7, 0x01E8, 0x01E9, 0x01EA, 0x01EB, 0x01EC, 0x01ED, 0x01EE, 0x01EF, + /* F */ 0x01F0, 0x01F3, 0x01F3, 0x01F3, 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9, 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, + + // Table 3 (for high byte 0x03) + + /* 0 */ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E, 0x030F, + /* 1 */ 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, 0x0318, 0x0319, 0x031A, 0x031B, 0x031C, 0x031D, 0x031E, 0x031F, + /* 2 */ 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327, 0x0328, 0x0329, 0x032A, 0x032B, 0x032C, 0x032D, 0x032E, 0x032F, + /* 3 */ 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337, 0x0338, 0x0339, 0x033A, 0x033B, 0x033C, 0x033D, 0x033E, 0x033F, + /* 4 */ 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x0345, 0x0346, 0x0347, 0x0348, 0x0349, 0x034A, 0x034B, 0x034C, 0x034D, 0x034E, 0x034F, + /* 5 */ 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357, 0x0358, 0x0359, 0x035A, 0x035B, 0x035C, 0x035D, 0x035E, 0x035F, + /* 6 */ 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367, 0x0368, 0x0369, 0x036A, 0x036B, 0x036C, 0x036D, 0x036E, 0x036F, + /* 7 */ 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377, 0x0378, 0x0379, 0x037A, 0x037B, 0x037C, 0x037D, 0x037E, 0x037F, + /* 8 */ 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0386, 0x0387, 0x0388, 0x0389, 0x038A, 0x038B, 0x038C, 0x038D, 0x038E, 0x038F, + /* 9 */ 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + /* A */ 0x03C0, 0x03C1, 0x03A2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + /* B */ 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + /* C */ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x03CF, + /* D */ 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, 0x03D5, 0x03D6, 0x03D7, 0x03D8, 0x03D9, 0x03DA, 0x03DB, 0x03DC, 0x03DD, 0x03DE, 0x03DF, + /* E */ 0x03E0, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7, 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF, + /* F */ 0x03F0, 0x03F1, 0x03F2, 0x03F3, 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x03F8, 0x03F9, 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, + + // Table 4 (for high byte 0x04) + + /* 0 */ 0x0400, 0x0401, 0x0452, 0x0403, 0x0454, 0x0455, 0x0456, 0x0407, 0x0458, 0x0459, 0x045A, 0x045B, 0x040C, 0x040D, 0x040E, 0x045F, + /* 1 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0419, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + /* 2 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + /* 3 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + /* 4 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + /* 5 */ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, + /* 6 */ 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, 0x0469, 0x0469, 0x046B, 0x046B, 0x046D, 0x046D, 0x046F, 0x046F, + /* 7 */ 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0476, 0x0477, 0x0479, 0x0479, 0x047B, 0x047B, 0x047D, 0x047D, 0x047F, 0x047F, + /* 8 */ 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, 0x0488, 0x0489, 0x048A, 0x048B, 0x048C, 0x048D, 0x048E, 0x048F, + /* 9 */ 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, 0x0499, 0x0499, 0x049B, 0x049B, 0x049D, 0x049D, 0x049F, 0x049F, + /* A */ 0x04A1, 0x04A1, 0x04A3, 0x04A3, 0x04A5, 0x04A5, 0x04A7, 0x04A7, 0x04A9, 0x04A9, 0x04AB, 0x04AB, 0x04AD, 0x04AD, 0x04AF, 0x04AF, + /* B */ 0x04B1, 0x04B1, 0x04B3, 0x04B3, 0x04B5, 0x04B5, 0x04B7, 0x04B7, 0x04B9, 0x04B9, 0x04BB, 0x04BB, 0x04BD, 0x04BD, 0x04BF, 0x04BF, + /* C */ 0x04C0, 0x04C1, 0x04C2, 0x04C4, 0x04C4, 0x04C5, 0x04C6, 0x04C8, 0x04C8, 0x04C9, 0x04CA, 0x04CC, 0x04CC, 0x04CD, 0x04CE, 0x04CF, + /* D */ 0x04D0, 0x04D1, 0x04D2, 0x04D3, 0x04D4, 0x04D5, 0x04D6, 0x04D7, 0x04D8, 0x04D9, 0x04DA, 0x04DB, 0x04DC, 0x04DD, 0x04DE, 0x04DF, + /* E */ 0x04E0, 0x04E1, 0x04E2, 0x04E3, 0x04E4, 0x04E5, 0x04E6, 0x04E7, 0x04E8, 0x04E9, 0x04EA, 0x04EB, 0x04EC, 0x04ED, 0x04EE, 0x04EF, + /* F */ 0x04F0, 0x04F1, 0x04F2, 0x04F3, 0x04F4, 0x04F5, 0x04F6, 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC, 0x04FD, 0x04FE, 0x04FF, + + // Table 5 (for high byte 0x05) + + /* 0 */ 0x0500, 0x0501, 0x0502, 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508, 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x050E, 0x050F, + /* 1 */ 0x0510, 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517, 0x0518, 0x0519, 0x051A, 0x051B, 0x051C, 0x051D, 0x051E, 0x051F, + /* 2 */ 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527, 0x0528, 0x0529, 0x052A, 0x052B, 0x052C, 0x052D, 0x052E, 0x052F, + /* 3 */ 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + /* 4 */ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + /* 5 */ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557, 0x0558, 0x0559, 0x055A, 0x055B, 0x055C, 0x055D, 0x055E, 0x055F, + /* 6 */ 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + /* 7 */ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + /* 8 */ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587, 0x0588, 0x0589, 0x058A, 0x058B, 0x058C, 0x058D, 0x058E, 0x058F, + /* 9 */ 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597, 0x0598, 0x0599, 0x059A, 0x059B, 0x059C, 0x059D, 0x059E, 0x059F, + /* A */ 0x05A0, 0x05A1, 0x05A2, 0x05A3, 0x05A4, 0x05A5, 0x05A6, 0x05A7, 0x05A8, 0x05A9, 0x05AA, 0x05AB, 0x05AC, 0x05AD, 0x05AE, 0x05AF, + /* B */ 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, 0x05B8, 0x05B9, 0x05BA, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, + /* C */ 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05C4, 0x05C5, 0x05C6, 0x05C7, 0x05C8, 0x05C9, 0x05CA, 0x05CB, 0x05CC, 0x05CD, 0x05CE, 0x05CF, + /* D */ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + /* E */ 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x05EB, 0x05EC, 0x05ED, 0x05EE, 0x05EF, + /* F */ 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9, 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, + + // Table 6 (for high byte 0x10) + + /* 0 */ 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009, 0x100A, 0x100B, 0x100C, 0x100D, 0x100E, 0x100F, + /* 1 */ 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017, 0x1018, 0x1019, 0x101A, 0x101B, 0x101C, 0x101D, 0x101E, 0x101F, + /* 2 */ 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027, 0x1028, 0x1029, 0x102A, 0x102B, 0x102C, 0x102D, 0x102E, 0x102F, + /* 3 */ 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037, 0x1038, 0x1039, 0x103A, 0x103B, 0x103C, 0x103D, 0x103E, 0x103F, + /* 4 */ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049, 0x104A, 0x104B, 0x104C, 0x104D, 0x104E, 0x104F, + /* 5 */ 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057, 0x1058, 0x1059, 0x105A, 0x105B, 0x105C, 0x105D, 0x105E, 0x105F, + /* 6 */ 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067, 0x1068, 0x1069, 0x106A, 0x106B, 0x106C, 0x106D, 0x106E, 0x106F, + /* 7 */ 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077, 0x1078, 0x1079, 0x107A, 0x107B, 0x107C, 0x107D, 0x107E, 0x107F, + /* 8 */ 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087, 0x1088, 0x1089, 0x108A, 0x108B, 0x108C, 0x108D, 0x108E, 0x108F, + /* 9 */ 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097, 0x1098, 0x1099, 0x109A, 0x109B, 0x109C, 0x109D, 0x109E, 0x109F, + /* A */ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + /* B */ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + /* C */ 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10C6, 0x10C7, 0x10C8, 0x10C9, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, + /* D */ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + /* E */ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + /* F */ 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10F6, 0x10F7, 0x10F8, 0x10F9, 0x10FA, 0x10FB, 0x10FC, 0x10FD, 0x10FE, 0x10FF, + + // Table 7 (for high byte 0x20) + + /* 0 */ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x200B, 0x0000, 0x0000, 0x0000, 0x0000, + /* 1 */ 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017, 0x2018, 0x2019, 0x201A, 0x201B, 0x201C, 0x201D, 0x201E, 0x201F, + /* 2 */ 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027, 0x2028, 0x2029, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x202F, + /* 3 */ 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037, 0x2038, 0x2039, 0x203A, 0x203B, 0x203C, 0x203D, 0x203E, 0x203F, + /* 4 */ 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047, 0x2048, 0x2049, 0x204A, 0x204B, 0x204C, 0x204D, 0x204E, 0x204F, + /* 5 */ 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057, 0x2058, 0x2059, 0x205A, 0x205B, 0x205C, 0x205D, 0x205E, 0x205F, + /* 6 */ 0x2060, 0x2061, 0x2062, 0x2063, 0x2064, 0x2065, 0x2066, 0x2067, 0x2068, 0x2069, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 7 */ 0x2070, 0x2071, 0x2072, 0x2073, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079, 0x207A, 0x207B, 0x207C, 0x207D, 0x207E, 0x207F, + /* 8 */ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x208A, 0x208B, 0x208C, 0x208D, 0x208E, 0x208F, + /* 9 */ 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x2095, 0x2096, 0x2097, 0x2098, 0x2099, 0x209A, 0x209B, 0x209C, 0x209D, 0x209E, 0x209F, + /* A */ 0x20A0, 0x20A1, 0x20A2, 0x20A3, 0x20A4, 0x20A5, 0x20A6, 0x20A7, 0x20A8, 0x20A9, 0x20AA, 0x20AB, 0x20AC, 0x20AD, 0x20AE, 0x20AF, + /* B */ 0x20B0, 0x20B1, 0x20B2, 0x20B3, 0x20B4, 0x20B5, 0x20B6, 0x20B7, 0x20B8, 0x20B9, 0x20BA, 0x20BB, 0x20BC, 0x20BD, 0x20BE, 0x20BF, + /* C */ 0x20C0, 0x20C1, 0x20C2, 0x20C3, 0x20C4, 0x20C5, 0x20C6, 0x20C7, 0x20C8, 0x20C9, 0x20CA, 0x20CB, 0x20CC, 0x20CD, 0x20CE, 0x20CF, + /* D */ 0x20D0, 0x20D1, 0x20D2, 0x20D3, 0x20D4, 0x20D5, 0x20D6, 0x20D7, 0x20D8, 0x20D9, 0x20DA, 0x20DB, 0x20DC, 0x20DD, 0x20DE, 0x20DF, + /* E */ 0x20E0, 0x20E1, 0x20E2, 0x20E3, 0x20E4, 0x20E5, 0x20E6, 0x20E7, 0x20E8, 0x20E9, 0x20EA, 0x20EB, 0x20EC, 0x20ED, 0x20EE, 0x20EF, + /* F */ 0x20F0, 0x20F1, 0x20F2, 0x20F3, 0x20F4, 0x20F5, 0x20F6, 0x20F7, 0x20F8, 0x20F9, 0x20FA, 0x20FB, 0x20FC, 0x20FD, 0x20FE, 0x20FF, + + // Table 8 (for high byte 0x21) + + /* 0 */ 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, 0x2108, 0x2109, 0x210A, 0x210B, 0x210C, 0x210D, 0x210E, 0x210F, + /* 1 */ 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, 0x2118, 0x2119, 0x211A, 0x211B, 0x211C, 0x211D, 0x211E, 0x211F, + /* 2 */ 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x2126, 0x2127, 0x2128, 0x2129, 0x212A, 0x212B, 0x212C, 0x212D, 0x212E, 0x212F, + /* 3 */ 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137, 0x2138, 0x2139, 0x213A, 0x213B, 0x213C, 0x213D, 0x213E, 0x213F, + /* 4 */ 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147, 0x2148, 0x2149, 0x214A, 0x214B, 0x214C, 0x214D, 0x214E, 0x214F, + /* 5 */ 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215A, 0x215B, 0x215C, 0x215D, 0x215E, 0x215F, + /* 6 */ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + /* 7 */ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + /* 8 */ 0x2180, 0x2181, 0x2182, 0x2183, 0x2184, 0x2185, 0x2186, 0x2187, 0x2188, 0x2189, 0x218A, 0x218B, 0x218C, 0x218D, 0x218E, 0x218F, + /* 9 */ 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197, 0x2198, 0x2199, 0x219A, 0x219B, 0x219C, 0x219D, 0x219E, 0x219F, + /* A */ 0x21A0, 0x21A1, 0x21A2, 0x21A3, 0x21A4, 0x21A5, 0x21A6, 0x21A7, 0x21A8, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21AE, 0x21AF, + /* B */ 0x21B0, 0x21B1, 0x21B2, 0x21B3, 0x21B4, 0x21B5, 0x21B6, 0x21B7, 0x21B8, 0x21B9, 0x21BA, 0x21BB, 0x21BC, 0x21BD, 0x21BE, 0x21BF, + /* C */ 0x21C0, 0x21C1, 0x21C2, 0x21C3, 0x21C4, 0x21C5, 0x21C6, 0x21C7, 0x21C8, 0x21C9, 0x21CA, 0x21CB, 0x21CC, 0x21CD, 0x21CE, 0x21CF, + /* D */ 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x21D4, 0x21D5, 0x21D6, 0x21D7, 0x21D8, 0x21D9, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21DE, 0x21DF, + /* E */ 0x21E0, 0x21E1, 0x21E2, 0x21E3, 0x21E4, 0x21E5, 0x21E6, 0x21E7, 0x21E8, 0x21E9, 0x21EA, 0x21EB, 0x21EC, 0x21ED, 0x21EE, 0x21EF, + /* F */ 0x21F0, 0x21F1, 0x21F2, 0x21F3, 0x21F4, 0x21F5, 0x21F6, 0x21F7, 0x21F8, 0x21F9, 0x21FA, 0x21FB, 0x21FC, 0x21FD, 0x21FE, 0x21FF, + + // Table 9 (for high byte 0xFE) + + /* 0 */ 0xFE00, 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, 0xFE0F, + /* 1 */ 0xFE10, 0xFE11, 0xFE12, 0xFE13, 0xFE14, 0xFE15, 0xFE16, 0xFE17, 0xFE18, 0xFE19, 0xFE1A, 0xFE1B, 0xFE1C, 0xFE1D, 0xFE1E, 0xFE1F, + /* 2 */ 0xFE20, 0xFE21, 0xFE22, 0xFE23, 0xFE24, 0xFE25, 0xFE26, 0xFE27, 0xFE28, 0xFE29, 0xFE2A, 0xFE2B, 0xFE2C, 0xFE2D, 0xFE2E, 0xFE2F, + /* 3 */ 0xFE30, 0xFE31, 0xFE32, 0xFE33, 0xFE34, 0xFE35, 0xFE36, 0xFE37, 0xFE38, 0xFE39, 0xFE3A, 0xFE3B, 0xFE3C, 0xFE3D, 0xFE3E, 0xFE3F, + /* 4 */ 0xFE40, 0xFE41, 0xFE42, 0xFE43, 0xFE44, 0xFE45, 0xFE46, 0xFE47, 0xFE48, 0xFE49, 0xFE4A, 0xFE4B, 0xFE4C, 0xFE4D, 0xFE4E, 0xFE4F, + /* 5 */ 0xFE50, 0xFE51, 0xFE52, 0xFE53, 0xFE54, 0xFE55, 0xFE56, 0xFE57, 0xFE58, 0xFE59, 0xFE5A, 0xFE5B, 0xFE5C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8, 0xFFD9, 0xFFDA, 0xFFDB, 0xFFDC, 0xFFDD, 0xFFDE, 0xFFDF, + /* E */ 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE3, 0xFFE4, 0xFFE5, 0xFFE6, 0xFFE7, 0xFFE8, 0xFFE9, 0xFFEA, 0xFFEB, 0xFFEC, 0xFFED, 0xFFEE, 0xFFEF, + /* F */ 0xFFF0, 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6, 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF, +}; + +/* RelString case folding table */ + +unsigned short gCompareTable[] = { + + /* 0 */ 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, + /* 1 */ 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, + /* 2 */ 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, + /* 3 */ 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, + /* 4 */ 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, + /* 5 */ 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, + + // 0x60 maps to 'a' + // range 0x61 to 0x7a ('a' to 'z') map to upper case + + /* 6 */ 0x4180, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, + /* 7 */ 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, + + // range 0x80 to 0xd8 gets mapped... + + /* 8 */ 0x4108, 0x410C, 0x4310, 0x4502, 0x4E0A, 0x4F08, 0x5508, 0x4182, 0x4104, 0x4186, 0x4108, 0x410A, 0x410C, 0x4310, 0x4502, 0x4584, + /* 9 */ 0x4586, 0x4588, 0x4982, 0x4984, 0x4986, 0x4988, 0x4E0A, 0x4F82, 0x4F84, 0x4F86, 0x4F08, 0x4F0A, 0x5582, 0x5584, 0x5586, 0x5508, + /* A */ 0xA000, 0xA100, 0xA200, 0xA300, 0xA400, 0xA500, 0xA600, 0x5382, 0xA800, 0xA900, 0xAA00, 0xAB00, 0xAC00, 0xAD00, 0x4114, 0x4F0E, + /* B */ 0xB000, 0xB100, 0xB200, 0xB300, 0xB400, 0xB500, 0xB600, 0xB700, 0xB800, 0xB900, 0xBA00, 0x4192, 0x4F92, 0xBD00, 0x4114, 0x4F0E, + /* C */ 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC500, 0xC600, 0x2206, 0x2208, 0xC900, 0x2000, 0x4104, 0x410A, 0x4F0A, 0x4F14, 0x4F14, + /* D */ 0xD000, 0xD100, 0x2202, 0x2204, 0x2702, 0x2704, 0xD600, 0xD700, 0x5988, 0xD900, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xDF00, + + /* E */ 0xE000, 0xE100, 0xE200, 0xE300, 0xE400, 0xE500, 0xE600, 0xE700, 0xE800, 0xE900, 0xEA00, 0xEB00, 0xEC00, 0xED00, 0xEE00, 0xEF00, + /* F */ 0xF000, 0xF100, 0xF200, 0xF300, 0xF400, 0xF500, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00, + +}; +#else /* ! UNCOMPRESSED */ + +enum { + kTypeLiteral = 0, + kTypeAscending = 1, + kTypeAscending256 = 2 +}; + +struct compressed_block { + unsigned char type; + unsigned char count; + unsigned short data; +}; + +unsigned short *gLowerCaseTable; + +struct compressed_block gLowerCaseTableCompressed[] = { + {0x0, 0x1, 0x100}, + {0x0, 0x1, 0x200}, + {0x0, 0x1, 0x0}, + {0x0, 0x1, 0x300}, + {0x0, 0x1, 0x400}, + {0x0, 0x1, 0x500}, + {0x0, 0xa, 0x0}, + {0x0, 0x1, 0x600}, + {0x0, 0xf, 0x0}, + {0x0, 0x1, 0x700}, + {0x0, 0x1, 0x800}, + {0x0, 0xdc, 0x0}, + {0x0, 0x1, 0x900}, + {0x0, 0x1, 0xa00}, + {0x0, 0x1, 0xffff}, + {0x1, 0x40, 0x1}, + {0x1, 0x1a, 0x61}, + {0x1, 0x6b, 0x5b}, + {0x0, 0x1, 0xe6}, + {0x1, 0x9, 0xc7}, + {0x0, 0x1, 0xf0}, + {0x1, 0x7, 0xd1}, + {0x0, 0x1, 0xf8}, + {0x1, 0x5, 0xd9}, + {0x0, 0x1, 0xfe}, + {0x1, 0x31, 0xdf}, + {0x0, 0x2, 0x111}, + {0x1, 0x14, 0x112}, + {0x0, 0x2, 0x127}, + {0x1, 0xa, 0x128}, + {0x0, 0x2, 0x133}, + {0x1, 0xb, 0x134}, + {0x0, 0x2, 0x140}, + {0x0, 0x2, 0x142}, + {0x1, 0x7, 0x143}, + {0x0, 0x2, 0x14b}, + {0x1, 0x6, 0x14c}, + {0x0, 0x2, 0x153}, + {0x1, 0x12, 0x154}, + {0x0, 0x2, 0x167}, + {0x1, 0x19, 0x168}, + {0x0, 0x1, 0x253}, + {0x0, 0x2, 0x183}, + {0x0, 0x2, 0x185}, + {0x0, 0x1, 0x254}, + {0x0, 0x2, 0x188}, + {0x1, 0x2, 0x256}, + {0x0, 0x2, 0x18c}, + {0x0, 0x1, 0x18d}, + {0x0, 0x1, 0x1dd}, + {0x0, 0x1, 0x259}, + {0x0, 0x1, 0x25b}, + {0x0, 0x2, 0x192}, + {0x0, 0x1, 0x260}, + {0x0, 0x1, 0x263}, + {0x0, 0x1, 0x195}, + {0x0, 0x1, 0x269}, + {0x0, 0x1, 0x268}, + {0x0, 0x2, 0x199}, + {0x1, 0x2, 0x19a}, + {0x0, 0x1, 0x26f}, + {0x0, 0x1, 0x272}, + {0x0, 0x1, 0x19e}, + {0x0, 0x1, 0x275}, + {0x1, 0x2, 0x1a0}, + {0x0, 0x2, 0x1a3}, + {0x0, 0x2, 0x1a5}, + {0x0, 0x1, 0x1a6}, + {0x0, 0x2, 0x1a8}, + {0x0, 0x1, 0x283}, + {0x1, 0x2, 0x1aa}, + {0x0, 0x2, 0x1ad}, + {0x0, 0x1, 0x288}, + {0x1, 0x2, 0x1af}, + {0x1, 0x2, 0x28a}, + {0x0, 0x2, 0x1b4}, + {0x0, 0x2, 0x1b6}, + {0x0, 0x1, 0x292}, + {0x0, 0x2, 0x1b9}, + {0x1, 0x2, 0x1ba}, + {0x0, 0x2, 0x1bd}, + {0x1, 0x6, 0x1be}, + {0x0, 0x3, 0x1c6}, + {0x0, 0x3, 0x1c9}, + {0x0, 0x3, 0x1cc}, + {0x1, 0x17, 0x1cd}, + {0x0, 0x2, 0x1e5}, + {0x1, 0xb, 0x1e6}, + {0x0, 0x3, 0x1f3}, + {0x1, 0xc, 0x1f4}, + {0x1, 0x91, 0x300}, + {0x1, 0x11, 0x3b1}, + {0x0, 0x1, 0x3a2}, + {0x1, 0x7, 0x3c3}, + {0x1, 0x38, 0x3aa}, + {0x0, 0x2, 0x3e3}, + {0x0, 0x2, 0x3e5}, + {0x0, 0x2, 0x3e7}, + {0x0, 0x2, 0x3e9}, + {0x0, 0x2, 0x3eb}, + {0x0, 0x2, 0x3ed}, + {0x0, 0x2, 0x3ef}, + {0x1, 0x12, 0x3f0}, + {0x0, 0x1, 0x452}, + {0x0, 0x1, 0x403}, + {0x1, 0x3, 0x454}, + {0x0, 0x1, 0x407}, + {0x1, 0x4, 0x458}, + {0x1, 0x3, 0x40c}, + {0x0, 0x1, 0x45f}, + {0x1, 0x9, 0x430}, + {0x0, 0x1, 0x419}, + {0x1, 0x16, 0x43a}, + {0x1, 0x30, 0x430}, + {0x0, 0x2, 0x461}, + {0x0, 0x2, 0x463}, + {0x0, 0x2, 0x465}, + {0x0, 0x2, 0x467}, + {0x0, 0x2, 0x469}, + {0x0, 0x2, 0x46b}, + {0x0, 0x2, 0x46d}, + {0x0, 0x2, 0x46f}, + {0x0, 0x2, 0x471}, + {0x0, 0x2, 0x473}, + {0x0, 0x2, 0x475}, + {0x1, 0x2, 0x476}, + {0x0, 0x2, 0x479}, + {0x0, 0x2, 0x47b}, + {0x0, 0x2, 0x47d}, + {0x0, 0x2, 0x47f}, + {0x0, 0x2, 0x481}, + {0x1, 0xe, 0x482}, + {0x0, 0x2, 0x491}, + {0x0, 0x2, 0x493}, + {0x0, 0x2, 0x495}, + {0x0, 0x2, 0x497}, + {0x0, 0x2, 0x499}, + {0x0, 0x2, 0x49b}, + {0x0, 0x2, 0x49d}, + {0x0, 0x2, 0x49f}, + {0x0, 0x2, 0x4a1}, + {0x0, 0x2, 0x4a3}, + {0x0, 0x2, 0x4a5}, + {0x0, 0x2, 0x4a7}, + {0x0, 0x2, 0x4a9}, + {0x0, 0x2, 0x4ab}, + {0x0, 0x2, 0x4ad}, + {0x0, 0x2, 0x4af}, + {0x0, 0x2, 0x4b1}, + {0x0, 0x2, 0x4b3}, + {0x0, 0x2, 0x4b5}, + {0x0, 0x2, 0x4b7}, + {0x0, 0x2, 0x4b9}, + {0x0, 0x2, 0x4bb}, + {0x0, 0x2, 0x4bd}, + {0x0, 0x2, 0x4bf}, + {0x1, 0x3, 0x4c0}, + {0x0, 0x2, 0x4c4}, + {0x1, 0x2, 0x4c5}, + {0x0, 0x2, 0x4c8}, + {0x1, 0x2, 0x4c9}, + {0x0, 0x2, 0x4cc}, + {0x1, 0x64, 0x4cd}, + {0x1, 0x26, 0x561}, + {0x1, 0xa9, 0x557}, + {0x1, 0xa0, 0x1000}, + {0x1, 0x26, 0x10d0}, + {0x1, 0x3a, 0x10c6}, + {0x1, 0xc, 0x2000}, + {0x0, 0x4, 0x0}, + {0x1, 0x1a, 0x2010}, + {0x0, 0x5, 0x0}, + {0x1, 0x3b, 0x202f}, + {0x0, 0x6, 0x0}, + {0x1, 0xf0, 0x2070}, + {0x1, 0x10, 0x2170}, + {0x1, 0x90, 0x2170}, + {0x1, 0xff, 0xfe00}, + {0x0, 0x1, 0x0}, + {0x1, 0x21, 0xff00}, + {0x1, 0x1a, 0xff41}, + {0x1, 0xc5, 0xff3b}, +}; +// Please update count if you add/remove entries but also please just let +// the compiler calculate it so you don't get it wrong. +//#define kLowerCaseTableNBlocks 182 +#define kLowerCaseTableNBlocks (sizeof(gLowerCaseTableCompressed)/sizeof(*gLowerCaseTableCompressed)) +// WARNING: The expanded size MUST be updated if you change the table and +// cannot be calculated at compile time. +#define kLowerCaseTableDataSize 5632 /* size of uncompressed structure in bytes */ + +unsigned short *gCompareTable; + +struct compressed_block gCompareTableCompressed[] = { + {0x2, 0x60, 0x0}, + {0x0, 0x1, 0x4180}, + {0x2, 0x1a, 0x4100}, + {0x2, 0x5, 0x7b00}, + {0x0, 0x1, 0x4108}, + {0x0, 0x1, 0x410c}, + {0x0, 0x1, 0x4310}, + {0x0, 0x1, 0x4502}, + {0x0, 0x1, 0x4e0a}, + {0x0, 0x1, 0x4f08}, + {0x0, 0x1, 0x5508}, + {0x0, 0x1, 0x4182}, + {0x0, 0x1, 0x4104}, + {0x0, 0x1, 0x4186}, + {0x0, 0x1, 0x4108}, + {0x0, 0x1, 0x410a}, + {0x0, 0x1, 0x410c}, + {0x0, 0x1, 0x4310}, + {0x0, 0x1, 0x4502}, + {0x0, 0x1, 0x4584}, + {0x0, 0x1, 0x4586}, + {0x0, 0x1, 0x4588}, + {0x0, 0x1, 0x4982}, + {0x0, 0x1, 0x4984}, + {0x0, 0x1, 0x4986}, + {0x0, 0x1, 0x4988}, + {0x0, 0x1, 0x4e0a}, + {0x0, 0x1, 0x4f82}, + {0x0, 0x1, 0x4f84}, + {0x0, 0x1, 0x4f86}, + {0x0, 0x1, 0x4f08}, + {0x0, 0x1, 0x4f0a}, + {0x0, 0x1, 0x5582}, + {0x0, 0x1, 0x5584}, + {0x0, 0x1, 0x5586}, + {0x0, 0x1, 0x5508}, + {0x2, 0x7, 0xa000}, + {0x0, 0x1, 0x5382}, + {0x2, 0x6, 0xa800}, + {0x0, 0x1, 0x4114}, + {0x0, 0x1, 0x4f0e}, + {0x2, 0xb, 0xb000}, + {0x0, 0x1, 0x4192}, + {0x0, 0x1, 0x4f92}, + {0x0, 0x1, 0xbd00}, + {0x0, 0x1, 0x4114}, + {0x0, 0x1, 0x4f0e}, + {0x2, 0x7, 0xc000}, + {0x0, 0x1, 0x2206}, + {0x0, 0x1, 0x2208}, + {0x0, 0x1, 0xc900}, + {0x0, 0x1, 0x2000}, + {0x0, 0x1, 0x4104}, + {0x0, 0x1, 0x410a}, + {0x0, 0x1, 0x4f0a}, + {0x0, 0x2, 0x4f14}, + {0x2, 0x2, 0xd000}, + {0x0, 0x1, 0x2202}, + {0x0, 0x1, 0x2204}, + {0x0, 0x1, 0x2702}, + {0x0, 0x1, 0x2704}, + {0x2, 0x2, 0xd600}, + {0x0, 0x1, 0x5988}, + {0x2, 0x27, 0xd900}, +}; +// Please update count if you add/remove entries but also please just let +// the compiler calculate it so you don't get it wrong. +//#define kCompareTableNBlocks 64 +#define kCompareTableNBlocks (sizeof(gCompareTableCompressed)/sizeof(*gCompareTableCompressed)) +// WARNING: The expanded size MUST be updated if you change the table and +// cannot be calculated at compile time. +#define kCompareTableDataSize 512 /* size of uncompressed structure in bytes */ + +#endif /* UNCOMPRESSED */ diff --git a/i386/libsaio/.svn/text-base/hfs_compare.c.svn-base b/i386/libsaio/.svn/text-base/hfs_compare.c.svn-base new file mode 100644 index 0000000..abf2ba2 --- /dev/null +++ b/i386/libsaio/.svn/text-base/hfs_compare.c.svn-base @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * HFSCompare.c - Functions for working with and comparing HFS nams. + * + * Copyright (c) 1999-2000 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include <sl.h> +#include "hfs_CaseTables.h" + +#if ! UNCOMPRESSED + +static unsigned short * +UncompressStructure(struct compressed_block *bp, int count, int size) +{ + unsigned short *out = malloc(size); + unsigned short *op = out; + unsigned short data; + int i, j; + + for (i=0; i<count; i++, bp++) { + // If this happens (it shouldn't) please fix size and/or double check that count really is + // the number of elements in the array. + // This was a very hard bug to find, so please leave this code here. + if(out + size <= op + bp->count) + { + stop("HFS+ Unicode tables are malformed\n"); + } + data = bp->data; + for (j=0; j<bp->count; j++) { + *op++ = data; + if (bp->type == kTypeAscending) data++; + else if (bp->type == kTypeAscending256) data += 256; + } + } + return out; +} + +static void +InitCompareTables(void) +{ + if (gCompareTable == 0) { + gCompareTable = UncompressStructure(gCompareTableCompressed, + kCompareTableNBlocks, kCompareTableDataSize); + gLowerCaseTable = UncompressStructure(gLowerCaseTableCompressed, + kLowerCaseTableNBlocks, kLowerCaseTableDataSize); + } +} + +#endif /* ! UNCOMPRESSED */ + +//_______________________________________________________________________ +// +// Routine: FastRelString +// +// Output: returns -1 if str1 < str2 +// returns 1 if str1 > str2 +// return 0 if equal +// +//_______________________________________________________________________ + +int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) +{ + int32_t bestGuess; + u_int8_t length, length2; + +#if ! UNCOMPRESED + InitCompareTables(); +#endif + + length = *(str1++); + length2 = *(str2++); + + if (length == length2) + bestGuess = 0; + else if (length < length2) + bestGuess = -1; + else + { + bestGuess = 1; + length = length2; + } + + while (length--) + { + u_int32_t aChar, bChar; + + aChar = *(str1++); + bChar = *(str2++); + + if (aChar != bChar) /* If they don't match exacly, do case conversion */ + { + u_int16_t aSortWord, bSortWord; + + aSortWord = gCompareTable[aChar]; + bSortWord = gCompareTable[bChar]; + + if (aSortWord > bSortWord) + return 1; + + if (aSortWord < bSortWord) + return -1; + } + + /* + * If characters match exactly, then go on to next character + * immediately without doing any extra work. + */ + } + + /* if you got to here, then return bestGuess */ + return bestGuess; +} + + +// +// FastUnicodeCompare - Compare two Unicode strings; produce a relative ordering +// +// IF RESULT +// -------------------------- +// str1 < str2 => -1 +// str1 = str2 => 0 +// str1 > str2 => +1 +// +// The lower case table starts with 256 entries (one for each of the upper bytes +// of the original Unicode char). If that entry is zero, then all characters with +// that upper byte are already case folded. If the entry is non-zero, then it is +// the _index_ (not byte offset) of the start of the sub-table for the characters +// with that upper byte. All ignorable characters are folded to the value zero. +// +// In pseudocode: +// +// Let c = source Unicode character +// Let table[] = lower case table +// +// lower = table[highbyte(c)] +// if (lower == 0) +// lower = c +// else +// lower = table[lower+lowbyte(c)] +// +// if (lower == 0) +// ignore this character +// +// To handle ignorable characters, we now need a loop to find the next valid character. +// Also, we can't pre-compute the number of characters to compare; the string length might +// be larger than the number of non-ignorable characters. Further, we must be able to handle +// ignorable characters at any point in the string, including as the first or last characters. +// We use a zero value as a sentinel to detect both end-of-string and ignorable characters. +// Since the File Manager doesn't prevent the NUL character (value zero) as part of a filename, +// the case mapping table is assumed to map u+0000 to some non-zero value (like 0xFFFF, which is +// an invalid Unicode character). +// +// Pseudocode: +// +// while (1) { +// c1 = GetNextValidChar(str1) // returns zero if at end of string +// c2 = GetNextValidChar(str2) +// +// if (c1 != c2) break // found a difference +// +// if (c1 == 0) // reached end of string on both strings at once? +// return 0; // yes, so strings are equal +// } +// +// // When we get here, c1 != c2. So, we just need to determine which one is less. +// if (c1 < c2) +// return -1; +// else +// return 1; +// + +int32_t FastUnicodeCompare( u_int16_t * str1, register u_int32_t length1, + u_int16_t * str2, register u_int32_t length2, int byte_order ) +{ + register u_int16_t c1,c2; + register u_int16_t temp; + +#if ! UNCOMPRESSED + InitCompareTables(); +#endif + + while (1) { + /* Set default values for c1, c2 in case there are no more valid chars */ + c1 = 0; + c2 = 0; + + /* Find next non-ignorable char from str1, or zero if no more */ + while (length1 && c1 == 0) { + if (byte_order == OSBigEndian) + c1 = SWAP_BE16(*(str1++)); + else + c1 = SWAP_LE16(*(str1++)); + --length1; + if ((temp = gLowerCaseTable[c1>>8]) != 0) // is there a subtable for this upper byte? + c1 = gLowerCaseTable[temp + (c1 & 0x00FF)]; // yes, so fold the char + } + + /* Find next non-ignorable char from str2, or zero if no more */ + while (length2 && c2 == 0) { + if (byte_order == OSBigEndian) + c2 = SWAP_BE16(*(str2++)); + else + c2 = SWAP_LE16(*(str2++)); + --length2; + if ((temp = gLowerCaseTable[c2>>8]) != 0) // is there a subtable for this upper byte? + c2 = gLowerCaseTable[temp + (c2 & 0x00FF)]; // yes, so fold the char + } + + if (c1 != c2) /* found a difference, so stop looping */ + break; + + if (c1 == 0) /* did we reach the end of both strings at the same time? */ + return 0; /* yes, so strings are equal */ + } + + if (c1 < c2) + return -1; + else + return 1; +} + + +// +// BinaryUnicodeCompare - Compare two Unicode strings; produce a relative ordering +// Compared using a 16-bit binary comparison (no case folding) +// +int32_t BinaryUnicodeCompare (u_int16_t * str1, u_int32_t length1, + u_int16_t * str2, u_int32_t length2) +{ + register u_int16_t c1, c2; + int32_t bestGuess; + u_int32_t length; + + bestGuess = 0; + + if (length1 < length2) { + length = length1; + --bestGuess; + } else if (length1 > length2) { + length = length2; + ++bestGuess; + } else { + length = length1; + } + + while (length--) { + c1 = *(str1++); + c2 = *(str2++); + + if (c1 > c2) + return (1); + if (c1 < c2) + return (-1); + } + + return (bestGuess); +} + + +/* + * UTF-8 (UCS Transformation Format) + * + * The following subset of UTF-8 is used to encode UCS-2 filenames. It + * requires a maximum of three 3 bytes per UCS-2 character. Only the + * shortest encoding required to represent the significant UCS-2 bits + * is legal. + * + * UTF-8 Multibyte Codes + * + * Bytes Bits UCS-2 Min UCS-2 Max UTF-8 Byte Sequence (binary) + * ------------------------------------------------------------------- + * 1 7 0x0000 0x007F 0xxxxxxx + * 2 11 0x0080 0x07FF 110xxxxx 10xxxxxx + * 3 16 0x0800 0xFFFF 1110xxxx 10xxxxxx 10xxxxxx + * ------------------------------------------------------------------- + */ + + +/* + * utf_encodestr - Encodes the UCS-2 (Unicode) string at ucsp into a + * null terminated UTF-8 string at utf8p. + * + * ucslen is the number of UCS-2 input characters (not bytes) + * bufsize is the size of the output buffer in bytes + */ +void +utf_encodestr( const u_int16_t * ucsp, int ucslen, + u_int8_t * utf8p, u_int32_t bufsize, int byte_order ) +{ + u_int8_t *bufend; + u_int16_t ucs_ch; + + bufend = utf8p + bufsize; + + while (ucslen-- > 0) { + if (byte_order == OSBigEndian) + ucs_ch = SWAP_BE16(*ucsp++); + else + ucs_ch = SWAP_LE16(*ucsp++); + + if (ucs_ch < 0x0080) { + if (utf8p >= bufend) + break; + if (ucs_ch == '\0') + continue; /* skip over embedded NULLs */ + *utf8p++ = ucs_ch; + + } else if (ucs_ch < 0x800) { + if ((utf8p + 1) >= bufend) + break; + *utf8p++ = (ucs_ch >> 6) | 0xc0; + *utf8p++ = (ucs_ch & 0x3f) | 0x80; + + } else { + if ((utf8p + 2) >= bufend) + break; + *utf8p++ = (ucs_ch >> 12) | 0xe0; + *utf8p++ = ((ucs_ch >> 6) & 0x3f) | 0x80; + *utf8p++ = ((ucs_ch) & 0x3f) | 0x80; + } + } + + *utf8p = '\0'; +} + + +/* + * utf_decodestr - Decodes the null terminated UTF-8 string at + * utf8p into a UCS-2 (Unicode) string at ucsp. + * + * ucslen is the number of UCS-2 output characters (not bytes) + * bufsize is the size of the output buffer in bytes + */ +void utf_decodestr(const u_int8_t * utf8p, u_int16_t * ucsp, u_int16_t * ucslen, u_int32_t bufsize, int byte_order) +{ + u_int16_t *bufstart; + u_int16_t *bufend; + u_int16_t ucs_ch; + u_int8_t byte; + + bufstart = ucsp; + bufend = (u_int16_t *)((u_int8_t *)ucsp + bufsize); + + while ((byte = *utf8p++) != '\0') { + if (ucsp >= bufend) + break; + + /* check for ascii */ + if (byte < 0x80) { + ucs_ch = byte; + + if (byte_order == OSBigEndian) + *ucsp++ = SWAP_BE16(ucs_ch); + else + *ucsp++ = SWAP_LE16(ucs_ch); + + continue; + } + + switch (byte & 0xf0) { + /* 2 byte sequence*/ + case 0xc0: + case 0xd0: + /* extract bits 6 - 10 from first byte */ + ucs_ch = (byte & 0x1F) << 6; + break; + /* 3 byte sequence*/ + case 0xe0: + /* extract bits 12 - 15 from first byte */ + ucs_ch = (byte & 0x0F) << 6; + + /* extract bits 6 - 11 from second byte */ + if (((byte = *utf8p++) & 0xc0) != 0x80) + goto stop; + + ucs_ch += (byte & 0x3F); + ucs_ch <<= 6; + break; + default: + goto stop; + } + + /* extract bits 0 - 5 from final byte */ + if (((byte = *utf8p++) & 0xc0) != 0x80) + goto stop; + ucs_ch += (byte & 0x3F); + + if (byte_order == OSBigEndian) + *ucsp++ = SWAP_BE16(ucs_ch); + else + *ucsp++ = SWAP_LE16(ucs_ch); + } +stop: + if (byte_order == OSBigEndian) + *ucslen = SWAP_BE16(ucsp - bufstart); + else + *ucslen = SWAP_LE16(ucsp - bufstart); +} diff --git a/i386/libsaio/.svn/text-base/hpet.c.svn-base b/i386/libsaio/.svn/text-base/hpet.c.svn-base new file mode 100644 index 0000000..8c73bda --- /dev/null +++ b/i386/libsaio/.svn/text-base/hpet.c.svn-base @@ -0,0 +1,103 @@ +/* + * + */ + +#include "libsaio.h" +#include "pci.h" +#include "hpet.h" + +#ifndef DEBUG_HPET +#define DEBUG_HPET 0 +#endif + +#if DEBUG_HPET +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +static struct lpc_controller_t lpc_controllers[] = { + + // Default unknown chipset + { 0, 0, "" }, + + // Intel + { 0x8086, 0x24dc, "ICH5" }, + { 0x8086, 0x2640, "ICH6" }, + { 0x8086, 0x2641, "ICH6M" }, + + { 0x8086, 0x27b0, "ICH7 DH" }, + { 0x8086, 0x27b8, "ICH7" }, + { 0x8086, 0x27b9, "ICH7M" }, + { 0x8086, 0x27bd, "ICH7M DH" }, + + { 0x8086, 0x2810, "ICH8R" }, + { 0x8086, 0x2811, "ICH8M-E" }, + { 0x8086, 0x2812, "ICH8DH" }, + { 0x8086, 0x2814, "ICH8DO" }, + { 0x8086, 0x2815, "ICH8M" }, + + { 0x8086, 0x2912, "ICH9DH" }, + { 0x8086, 0x2914, "ICH9DO" }, + { 0x8086, 0x2916, "ICH9R" }, + { 0x8086, 0x2917, "ICH9M-E" }, + { 0x8086, 0x2918, "ICH9" }, + { 0x8086, 0x2919, "ICH9M" }, + + { 0x8086, 0x3a14, "ICH10DO" }, + { 0x8086, 0x3a16, "ICH10R" }, + { 0x8086, 0x3a18, "ICH10" }, + { 0x8086, 0x3a1a, "ICH10D" }, + +}; + +void force_enable_hpet(pci_dt_t *lpc_dev) +{ + int i; + uint32_t val, hpet_address = 0xFED00000; + void *rcba; + + /* LPC on Intel ICH is always (?) at 00:1f.0 */ + for(i = 1; i < sizeof(lpc_controllers) / sizeof(lpc_controllers[0]); i++) + if ((lpc_controllers[i].vendor == lpc_dev->vendor_id) + && (lpc_controllers[i].device == lpc_dev->device_id)) + { + rcba = (void *)(pci_config_read32(lpc_dev->dev.addr, 0xF0) & 0xFFFFC000); + + DBG("Intel(R) %s LPC Interface [%04x:%04x], MMIO @ 0x%lx\n", + lpc_controllers[i].name, lpc_dev->vendor_id, lpc_dev->device_id, rcba); + + if (rcba == 0) + printf(" RCBA disabled; cannot force enable HPET\n"); + else + { + val = REG32(rcba, 0x3404); + if (val & 0x80) + { + // HPET is enabled in HPTC. Just not reported by BIOS + DBG(" HPET is enabled in HPTC, just not reported by BIOS\n"); + hpet_address |= (val & 3) << 12 ; + DBG(" HPET MMIO @ 0x%lx\n", hpet_address); + } + else + { + // HPET disabled in HPTC. Trying to enable + DBG(" HPET is disabled in HPTC, trying to enable\n"); + REG32(rcba, 0x3404) = val | 0x80; + hpet_address |= (val & 3) << 12 ; + DBG(" Force enabled HPET, MMIO @ 0x%lx\n", hpet_address); + } + + // verify if the job is done + val = REG32(rcba, 0x3404); + if (!(val & 0x80)) + printf(" Failed to force enable HPET\n"); + } + break; + } + +#if DEBUG_HPET + printf("Press [Enter] to continue...\n"); + getchar(); +#endif +} diff --git a/i386/libsaio/.svn/text-base/hpet.h.svn-base b/i386/libsaio/.svn/text-base/hpet.h.svn-base new file mode 100644 index 0000000..498e37b --- /dev/null +++ b/i386/libsaio/.svn/text-base/hpet.h.svn-base @@ -0,0 +1,20 @@ +/* + * + */ + +#ifndef __LIBSAIO_HPET_H +#define __LIBSAIO_HPET_H + +#include "libsaio.h" + +#define REG32(base, reg) ((volatile uint32_t *)base)[(reg) >> 2] + +void force_enable_hpet(pci_dt_t *lpc_dev); + +struct lpc_controller_t { + unsigned vendor; + unsigned device; + char *name; +}; + +#endif /* !__LIBSAIO_HPET_H */ diff --git a/i386/libsaio/.svn/text-base/io_inline.h.svn-base b/i386/libsaio/.svn/text-base/io_inline.h.svn-base new file mode 100644 index 0000000..0535c10 --- /dev/null +++ b/i386/libsaio/.svn/text-base/io_inline.h.svn-base @@ -0,0 +1,82 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Inlines for io space access. + * + * HISTORY + * + * 20 May 1992 ? at NeXT + * Created. + */ + +#ifndef __LIBSAIO_IO_INLINE_H +#define __LIBSAIO_IO_INLINE_H + +/* + *############################################################################ + * + * x86 IN/OUT I/O inline functions. + * + * IN : inb, inw, inl + * IN(port) + * + * OUT: outb, outw, outl + * OUT(port, data) + * + *############################################################################ + */ + +#define __IN(s, u) \ +static inline unsigned u \ +in##s(unsigned short port) \ +{ \ + unsigned u data; \ + asm volatile ( \ + "in" #s " %1,%0" \ + : "=a" (data) \ + : "d" (port)); \ + return (data); \ +} + +#define __OUT(s, u) \ +static inline void \ +out##s(unsigned short port, unsigned u data) \ +{ \ + asm volatile ( \ + "out" #s " %1,%0" \ + : \ + : "d" (port), "a" (data)); \ +} + +__IN(b, char) /* inb() */ +__IN(w, short) /* inw() */ +__IN(l, long) /* inl() */ + +__OUT(b, char) /* outb() */ +__OUT(w, short) /* outw() */ +__OUT(l, long) /* outl() */ + +#endif /* !__LIBSAIO_IO_INLINE_H */ diff --git a/i386/libsaio/.svn/text-base/libsaio.h.svn-base b/i386/libsaio/.svn/text-base/libsaio.h.svn-base new file mode 100644 index 0000000..6eee4d1 --- /dev/null +++ b/i386/libsaio/.svn/text-base/libsaio.h.svn-base @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* libsaio.h */ + +#ifndef __LIBSAIO_LIBSAIO_H +#define __LIBSAIO_LIBSAIO_H + +#include "libsa.h" +#include "memory.h" +#include "io_inline.h" +#include "saio_types.h" +#include "saio_internal.h" + +#endif /* !__LIBSAIO_LIBSAIO_H */ diff --git a/i386/libsaio/.svn/text-base/load.c.svn-base b/i386/libsaio/.svn/text-base/load.c.svn-base new file mode 100644 index 0000000..ac3d161 --- /dev/null +++ b/i386/libsaio/.svn/text-base/load.c.svn-base @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * load.c - Functions for decoding a Mach-o Kernel. + * + * Copyright (c) 1998-2003 Apple Computer, Inc. + * + */ + +#include <mach-o/fat.h> +#include <mach-o/loader.h> +#include <mach/machine/thread_status.h> + +#include <sl.h> + +static long DecodeSegment(long cmdBase, unsigned int*load_addr, unsigned int *load_size); +static long DecodeUnixThread(long cmdBase, unsigned int *entry); +static long DecodeSymbolTable(long cmdBase); + + +static unsigned long gBinaryAddress; +bool gHaveKernelCache; /* XXX aserebln: uninitialized? and only set to true, never to false */ +cpu_type_t archCpuType=CPU_TYPE_I386; + +// Public Functions + +long ThinFatFile(void **binary, unsigned long *length) +{ + unsigned long nfat, swapped, size = 0; + struct fat_header *fhp = (struct fat_header *)*binary; + struct fat_arch *fap = + (struct fat_arch *)((unsigned long)*binary + sizeof(struct fat_header)); + cpu_type_t fapcputype; + uint32_t fapoffset; + uint32_t fapsize; + + if (fhp->magic == FAT_MAGIC) { + nfat = fhp->nfat_arch; + swapped = 0; + } else if (fhp->magic == FAT_CIGAM) { + nfat = OSSwapInt32(fhp->nfat_arch); + swapped = 1; + } else { + return -1; + } + + for (; nfat > 0; nfat--, fap++) { + if (swapped) { + fapcputype = OSSwapInt32(fap->cputype); + fapoffset = OSSwapInt32(fap->offset); + fapsize = OSSwapInt32(fap->size); + } + else + { + fapcputype = fap->cputype; + fapoffset = fap->offset; + fapsize = fap->size; + } + + if (fapcputype == archCpuType) { + *binary = (void *) ((unsigned long)*binary + fapoffset); + size = fapsize; + break; + } + } + + if (length != 0) *length = size; + + return 0; +} + +long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize) +{ + struct mach_header *mH; + unsigned long ncmds, cmdBase, cmd, cmdsize, cmdstart; + // long headerBase, headerAddr, headerSize; + unsigned int vmaddr = ~0; + unsigned int vmend = 0; + unsigned long cnt; + long ret = -1; + unsigned int entry = 0; + + gBinaryAddress = (unsigned long)binary; + + mH = (struct mach_header *)(gBinaryAddress); + switch (archCpuType) + { + case CPU_TYPE_I386: + if (mH->magic != MH_MAGIC) { + error("Mach-O file has bad magic number\n"); + return -1; + } + cmdstart = (unsigned long)gBinaryAddress + sizeof(struct mach_header); + break; + case CPU_TYPE_X86_64: + if (mH->magic != MH_MAGIC_64 && mH->magic == MH_MAGIC) + return -1; + if (mH->magic != MH_MAGIC_64) { + error("Mach-O file has bad magic number\n"); + return -1; + } + cmdstart = (unsigned long)gBinaryAddress + sizeof(struct mach_header_64); + break; + default: + error("Unknown CPU type\n"); + return -1; + } + + cmdBase = cmdstart; + +#if DEBUG + printf("magic: %x\n", (unsigned)mH->magic); + printf("cputype: %x\n", (unsigned)mH->cputype); + printf("cpusubtype: %x\n", (unsigned)mH->cpusubtype); + printf("filetype: %x\n", (unsigned)mH->filetype); + printf("ncmds: %x\n", (unsigned)mH->ncmds); + printf("sizeofcmds: %x\n", (unsigned)mH->sizeofcmds); + printf("flags: %x\n", (unsigned)mH->flags); + getchar(); +#endif + + ncmds = mH->ncmds; + + for (cnt = 0; cnt < ncmds; cnt++) { + cmd = ((long *)cmdBase)[0]; + cmdsize = ((long *)cmdBase)[1]; + unsigned int load_addr; + unsigned int load_size; + + switch (cmd) { + case LC_SEGMENT_64: + case LC_SEGMENT: + ret = DecodeSegment(cmdBase, &load_addr, &load_size); + if (ret == 0 && load_size != 0 && load_addr >= KERNEL_ADDR) { + vmaddr = MIN(vmaddr, load_addr); + vmend = MAX(vmend, load_addr + load_size); + } + break; + + case LC_UNIXTHREAD: + ret = DecodeUnixThread(cmdBase, &entry); + break; + + case LC_SYMTAB: + break; + + default: +#if NOTDEF + printf("Ignoring cmd type %d.\n", (unsigned)cmd); +#endif + break; + } + + if (ret != 0) return -1; + + cmdBase += cmdsize; + } + + *rentry = (entry_t)( (unsigned long) entry & 0x3fffffff ); + *rsize = vmend - vmaddr; + *raddr = (char *)vmaddr; + + cmdBase = cmdstart; + for (cnt = 0; cnt < ncmds; cnt++) { + cmd = ((long *)cmdBase)[0]; + cmdsize = ((long *)cmdBase)[1]; + + if(cmd==LC_SYMTAB) + if (DecodeSymbolTable(cmdBase)!=0) + return -1; + + cmdBase += cmdsize; + } + + return ret; +} + +// Private Functions + +static long DecodeSegment(long cmdBase, unsigned int *load_addr, unsigned int *load_size) +{ + unsigned long vmaddr, fileaddr; + long vmsize, filesize; + char *segname; + + if (((long *)cmdBase)[0]==LC_SEGMENT_64) + { + struct segment_command_64 *segCmd; + + segCmd = (struct segment_command_64 *)cmdBase; + + vmaddr = (segCmd->vmaddr & 0x3fffffff); + vmsize = segCmd->vmsize; + fileaddr = (gBinaryAddress + segCmd->fileoff); + filesize = segCmd->filesize; + + segname=segCmd->segname; + +#ifdef DEBUG + printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n", + segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize, + (unsigned) segCmd->nsects, (unsigned)segCmd->flags); + getchar(); +#endif + } + else + { + struct segment_command *segCmd; + + segCmd = (struct segment_command *)cmdBase; + + vmaddr = (segCmd->vmaddr & 0x3fffffff); + vmsize = segCmd->vmsize; + fileaddr = (gBinaryAddress + segCmd->fileoff); + filesize = segCmd->filesize; + + segname=segCmd->segname; + +#ifdef DEBUG + printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n", + segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize, + (unsigned) segCmd->nsects, (unsigned)segCmd->flags); + getchar(); +#endif + } + + if (vmsize == 0 || filesize == 0) { + *load_addr = ~0; + *load_size = 0; + return 0; + } + + if (! ((vmaddr >= KERNEL_ADDR && + (vmaddr + vmsize) <= (KERNEL_ADDR + KERNEL_LEN)) || + (vmaddr >= HIB_ADDR && + (vmaddr + vmsize) <= (HIB_ADDR + HIB_LEN)))) { + stop("Kernel overflows available space"); + } + + if (vmsize && ((strcmp(segname, "__PRELINK_INFO") == 0) || (strcmp(segname, "__PRELINK") == 0))) + gHaveKernelCache = true; + + // Copy from file load area. + if (vmsize>0 && filesize>0) + bcopy((char *)fileaddr, (char *)vmaddr, vmsize>filesize?filesize:vmsize); + + // Zero space at the end of the segment. + if (vmsize > filesize) + bzero((char *)(vmaddr + filesize), vmsize - filesize); + + *load_addr = vmaddr; + *load_size = vmsize; + + return 0; +} + +static long DecodeUnixThread(long cmdBase, unsigned int *entry) +{ + switch (archCpuType) + { + case CPU_TYPE_I386: + { + i386_thread_state_t *i386ThreadState; + + i386ThreadState = (i386_thread_state_t *) + (cmdBase + sizeof(struct thread_command) + 8); + + *entry = i386ThreadState->eip; + return 0; + } + + case CPU_TYPE_X86_64: + { + x86_thread_state64_t *x86_64ThreadState; + + x86_64ThreadState = (x86_thread_state64_t *) + (cmdBase + sizeof(struct thread_command) + 8); + + *entry = x86_64ThreadState->rip; + return 0; + } + + default: + error("Unknown CPU type\n"); + return -1; + } +} + +static long DecodeSymbolTable(long cmdBase) +{ + struct symtab_command *symTab, *symTableSave; + long tmpAddr, symsSize, totalSize; + long gSymbolTableAddr; + long gSymbolTableSize; + + symTab = (struct symtab_command *)cmdBase; + +#if DEBUG + printf("symoff: %x, nsyms: %x, stroff: %x, strsize: %x\n", + symTab->symoff, symTab->nsyms, symTab->stroff, symTab->strsize); + getchar(); +#endif + + symsSize = symTab->stroff - symTab->symoff; + totalSize = symsSize + symTab->strsize; + + gSymbolTableSize = totalSize + sizeof(struct symtab_command); + gSymbolTableAddr = AllocateKernelMemory(gSymbolTableSize); + // Add the SymTab to the memory-map. + AllocateMemoryRange("Kernel-__SYMTAB", gSymbolTableAddr, gSymbolTableSize, -1); + + symTableSave = (struct symtab_command *)gSymbolTableAddr; + tmpAddr = gSymbolTableAddr + sizeof(struct symtab_command); + + symTableSave->symoff = tmpAddr; + symTableSave->nsyms = symTab->nsyms; + symTableSave->stroff = tmpAddr + symsSize; + symTableSave->strsize = symTab->strsize; + + bcopy((char *)(gBinaryAddress + symTab->symoff), + (char *)tmpAddr, totalSize); + return 0; +} diff --git a/i386/libsaio/.svn/text-base/md5c.c.svn-base b/i386/libsaio/.svn/text-base/md5c.c.svn-base new file mode 100644 index 0000000..ec4ec6d --- /dev/null +++ b/i386/libsaio/.svn/text-base/md5c.c.svn-base @@ -0,0 +1,293 @@ +/* + * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + * + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD5 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD5 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + * + * $Id: md5c.c,v 1.1 2005/06/24 22:47:12 curtisg Exp $ + * + * This code is the same as the code published by RSA Inc. It has been + * edited for clarity and style only. + */ + +#include "libsaio.h" +#include <libkern/crypto/md5.h> + + +#define Encode memcpy +#define Decode memcpy + +static unsigned char PADDING[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* F, G, H and I are basic MD5 functions. */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits. */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* + * FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. + * Rotation is separate from addition to prevent recomputation. + */ +#define FF(a, b, c, d, x, s, ac) { \ + (a) += F ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) { \ + (a) += G ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) { \ + (a) += H ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) { \ + (a) += I ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +static void MD5Transform (u_int32_t state[4], const unsigned char block[64]); + +/* MD5 initialization. Begins an MD5 operation, writing a new context. */ + +void +MD5Init (context) + MD5_CTX *context; +{ + + context->count[0] = context->count[1] = 0; + + /* Load magic initialization constants. */ + context->state[0] = 0x67452301; + context->state[1] = 0xefcdab89; + context->state[2] = 0x98badcfe; + context->state[3] = 0x10325476; +} + +/* + * MD5 block update operation. Continues an MD5 message-digest + * operation, processing another message block, and updating the + * context. + */ + +void +MD5Update (context, input, inputLen) + MD5_CTX *context; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + const void *input; +#else + const unsigned char *input; +#endif + unsigned int inputLen; +{ + unsigned int i, index, partLen; + + /* Compute number of bytes mod 64 */ + index = (unsigned int)((context->count[0] >> 3) & 0x3F); + + /* Update number of bits */ + if ((context->count[0] += ((u_int32_t)inputLen << 3)) + < ((u_int32_t)inputLen << 3)) + context->count[1]++; + context->count[1] += ((u_int32_t)inputLen >> 29); + + partLen = 64 - index; + + /* Transform as many times as possible. */ + if (inputLen >= partLen) { + memcpy((void *)&context->buffer[index], (const void *)input, + partLen); + MD5Transform (context->state, context->buffer); + + for (i = partLen; i + 63 < inputLen; i += 64) + MD5Transform (context->state, &((const unsigned char *)input)[i]); + + index = 0; + } + else + i = 0; + + /* Buffer remaining input */ + memcpy ((void *)&context->buffer[index], (const void *)&((const unsigned char*)input)[i], + inputLen-i); +} + +/* + * MD5 padding. Adds padding followed by original length. + */ + +void +MD5Pad (context) + MD5_CTX *context; +{ + unsigned char bits[8]; + unsigned int index, padLen; + + /* Save number of bits */ + Encode (bits, context->count, 8); + + /* Pad out to 56 mod 64. */ + index = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + MD5Update (context, PADDING, padLen); + + /* Append length (before padding) */ + MD5Update (context, bits, 8); +} + +/* + * MD5 finalization. Ends an MD5 message-digest operation, writing the + * the message digest and zeroizing the context. + */ + +void +MD5Final (digest, context) + unsigned char digest[16]; + MD5_CTX *context; +{ + /* Do padding. */ + MD5Pad (context); + + /* Store state in digest */ + Encode (digest, context->state, 16); + + /* Zeroize sensitive information. */ + memset ((void *)context, 0, sizeof (*context)); +} + +/* MD5 basic transformation. Transforms state based on block. */ + +static void +MD5Transform (state, block) + u_int32_t state[4]; + const unsigned char block[64]; +{ + u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + Decode (x, block, 64); + + /* Round 1 */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 + FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + /* Round 2 */ +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 + GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 + HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + /* Round 4 */ +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + + /* Zeroize sensitive information. */ + memset ((void *)x, 0, sizeof (x)); +} diff --git a/i386/libsaio/.svn/text-base/memvendors.h.svn-base b/i386/libsaio/.svn/text-base/memvendors.h.svn-base new file mode 100644 index 0000000..782fc6c --- /dev/null +++ b/i386/libsaio/.svn/text-base/memvendors.h.svn-base @@ -0,0 +1,894 @@ +/* + * Memory module vendors as published by JEDEC 106AA + * + * Special thanks to indi, memtest and theking for the table + * + */ +#ifndef __MEMVEN_H +#define __MEMVEN_H + +typedef struct _vidTag { + uint8_t bank; + uint8_t code; + const char* name; +} VenIdName; + +VenIdName vendorMap[] = { + { 0, 0x01, "AMD"}, + { 0, 0x02, "AMI"}, + { 0, 0x83, "Fairchild"}, + { 0, 0x04, "Fujitsu"}, + { 0, 0x85, "GTE"}, + { 0, 0x86, "Harris"}, + { 0, 0x07, "Hitachi"}, + { 0, 0x08, "Inmos"}, + { 0, 0x89, "Intel"}, + { 0, 0x8a, "I.T.T."}, + { 0, 0x0b, "Intersil"}, + { 0, 0x8c, "Monolithic Memories"}, + { 0, 0x0d, "Mostek"}, + { 0, 0x0e, "Freescale (Motorola)"}, + { 0, 0x8f, "National"}, + { 0, 0x10, "NEC"}, + { 0, 0x91, "RCA"}, + { 0, 0x92, "Raytheon"}, + { 0, 0x13, "Conexant (Rockwell)"}, + { 0, 0x94, "Seeq"}, + { 0, 0x15, "NXP (Philips)"}, + { 0, 0x16, "Synertek"}, + { 0, 0x97, "Texas Instruments"}, + { 0, 0x98, "Toshiba"}, + { 0, 0x19, "Xicor"}, + { 0, 0x1a, "Zilog"}, + { 0, 0x9b, "Eurotechnique"}, + { 0, 0x1c, "Mitsubishi"}, + { 0, 0x9d, "Lucent (AT&T)"}, + { 0, 0x9e, "Exel"}, + { 0, 0x1f, "Atmel"}, + { 0, 0x20, "SGS/Thomson"}, + { 0, 0xa1, "Lattice Semi."}, + { 0, 0xa2, "NCR"}, + { 0, 0x23, "Wafer Scale Integration"}, + { 0, 0xa4, "IBM"}, + { 0, 0x25, "Tristar"}, + { 0, 0x26, "Visic"}, + { 0, 0xa7, "Intl. CMOS Technology"}, + { 0, 0xa8, "SSSI"}, + { 0, 0x29, "MicrochipTechnology"}, + { 0, 0x2a, "Ricoh"}, + { 0, 0xab, "VLSI"}, + { 0, 0x2c, "Micron Technology"}, + { 0, 0xad, "Hynix Semiconductor"}, + { 0, 0xae, "OKI Semiconductor"}, + { 0, 0x2f, "ACTEL"}, + { 0, 0xb0, "Sharp"}, + { 0, 0x31, "Catalyst"}, + { 0, 0x32, "Panasonic"}, + { 0, 0xb3, "IDT"}, + { 0, 0x34, "Cypress"}, + { 0, 0xb5, "DEC"}, + { 0, 0xb6, "LSI Logic"}, + { 0, 0x37, "Zarlink (Plessey)"}, + { 0, 0x38, "UTMC"}, + { 0, 0xb9, "Thinking Machine"}, + { 0, 0xba, "Thomson CSF"}, + { 0, 0x3b, "Integrated CMOS (Vertex)"}, + { 0, 0xbc, "Honeywell"}, + { 0, 0x3d, "Tektronix"}, + { 0, 0x3e, "Sun Microsystems"}, + { 0, 0xbf, "SST"}, + { 0, 0x40, "ProMos/Mosel Vitelic"}, + { 0, 0xc1, "Infineon (Siemens)"}, + { 0, 0xc2, "Macronix"}, + { 0, 0x43, "Xerox"}, + { 0, 0xc4, "Plus Logic"}, + { 0, 0x45, "SanDisk"}, + { 0, 0x46, "Elan Circuit Tech."}, + { 0, 0xc7, "European Silicon Str."}, + { 0, 0xc8, "Apple Computer"}, + { 0, 0x49, "Xilinx"}, + { 0, 0x4a, "Compaq"}, + { 0, 0xcb, "Protocol Engines"}, + { 0, 0x4c, "SCI"}, + { 0, 0xcd, "Seiko Instruments"}, + { 0, 0xce, "Samsung"}, + { 0, 0x4f, "I3 Design System"}, + { 0, 0xd0, "Klic"}, + { 0, 0x51, "Crosspoint Solutions"}, + { 0, 0x52, "Alliance Semiconductor"}, + { 0, 0xd3, "Tandem"}, + { 0, 0x54, "Hewlett-Packard"}, + { 0, 0xd5, "Intg. Silicon Solutions"}, + { 0, 0xd6, "Brooktree"}, + { 0, 0x57, "New Media"}, + { 0, 0x58, "MHS Electronic"}, + { 0, 0xd9, "Performance Semi."}, + { 0, 0xda, "Winbond Electronic"}, + { 0, 0x5b, "Kawasaki Steel"}, + { 0, 0xdc, "Bright Micro"}, + { 0, 0x5d, "TECMAR"}, + { 0, 0x5e, "Exar"}, + { 0, 0xdf, "PCMCIA"}, + { 0, 0xe0, "LG Semi (Goldstar)"}, + { 0, 0x61, "Northern Telecom"}, + { 0, 0x62, "Sanyo"}, + { 0, 0xe3, "Array Microsystems"}, + { 0, 0x64, "Crystal Semiconductor"}, + { 0, 0xe5, "Analog Devices"}, + { 0, 0xe6, "PMC-Sierra"}, + { 0, 0x67, "Asparix"}, + { 0, 0x68, "Convex Computer"}, + { 0, 0xe9, "Quality Semiconductor"}, + { 0, 0xea, "Nimbus Technology"}, + { 0, 0x6b, "Transwitch"}, + { 0, 0xec, "Micronas (ITT Intermetall)"}, + { 0, 0x6d, "Cannon"}, + { 0, 0x6e, "Altera"}, + { 0, 0xef, "NEXCOM"}, + { 0, 0x70, "QUALCOMM"}, + { 0, 0xf1, "Sony"}, + { 0, 0xf2, "Cray Research"}, + { 0, 0x73, "AMS(Austria Micro)"}, + { 0, 0xf4, "Vitesse"}, + { 0, 0x75, "Aster Electronics"}, + { 0, 0x76, "Bay Networks (Synoptic)"}, + { 0, 0xf7, "Zentrum/ZMD"}, + { 0, 0xf8, "TRW"}, + { 0, 0x79, "Thesys"}, + { 0, 0x7a, "Solbourne Computer"}, + { 0, 0xfb, "Allied-Signal"}, + { 0, 0x7c, "Dialog"}, + { 0, 0xfd, "Media Vision"}, + { 0, 0xfe, "Numonyx"}, + { 1, 0x01, "Cirrus Logic"}, + { 1, 0x02, "National Instruments"}, + { 1, 0x83, "ILC Data Device"}, + { 1, 0x04, "Alcatel Mietec"}, + { 1, 0x85, "Micro Linear"}, + { 1, 0x86, "Univ. of NC"}, + { 1, 0x07, "JTAG Technologies"}, + { 1, 0x08, "BAE Systems (Loral)"}, + { 1, 0x89, "Nchip"}, + { 1, 0x8a, "Galileo Tech"}, + { 1, 0x0b, "Bestlink Systems"}, + { 1, 0x8c, "Graychip"}, + { 1, 0x0d, "GENNUM"}, + { 1, 0x0e, "VideoLogic"}, + { 1, 0x8f, "Robert Bosch"}, + { 1, 0x10, "Chip Express"}, + { 1, 0x91, "DATARAM"}, + { 1, 0x92, "United Microelectronics Corp."}, + { 1, 0x13, "TCSI"}, + { 1, 0x94, "Smart Modular"}, + { 1, 0x15, "Hughes Aircraft"}, + { 1, 0x16, "Lanstar Semiconductor"}, + { 1, 0x97, "Qlogic"}, + { 1, 0x98, "Kingston"}, + { 1, 0x19, "Music Semi"}, + { 1, 0x1a, "Ericsson Components"}, + { 1, 0x9b, "SpaSE"}, + { 1, 0x1c, "Eon Silicon Devices"}, + { 1, 0x9d, "Programmable Micro Corp"}, + { 1, 0x9e, "DoD"}, + { 1, 0x1f, "Integ. Memories Tech."}, + { 1, 0x20, "Corollary"}, + { 1, 0xa1, "Dallas Semiconductor"}, + { 1, 0xa2, "Omnivision"}, + { 1, 0x23, "EIV(Switzerland)"}, + { 1, 0xa4, "Novatel Wireless"}, + { 1, 0x25, "Zarlink (Mitel)"}, + { 1, 0x26, "Clearpoint"}, + { 1, 0xa7, "Cabletron"}, + { 1, 0xa8, "STEC (Silicon Tech)"}, + { 1, 0x29, "Vanguard"}, + { 1, 0x2a, "Hagiwara Sys-Com"}, + { 1, 0xab, "Vantis"}, + { 1, 0x2c, "Celestica"}, + { 1, 0xad, "Century"}, + { 1, 0xae, "Hal Computers"}, + { 1, 0x2f, "Rohm Company"}, + { 1, 0xb0, "Juniper Networks"}, + { 1, 0x31, "Libit Signal Processing"}, + { 1, 0x32, "Mushkin Enhanced Memory"}, + { 1, 0xb3, "Tundra Semiconductor"}, + { 1, 0x34, "Adaptec"}, + { 1, 0xb5, "LightSpeed Semi."}, + { 1, 0xb6, "ZSP Corp."}, + { 1, 0x37, "AMIC Technology"}, + { 1, 0x38, "Adobe Systems"}, + { 1, 0xb9, "Dynachip"}, + { 1, 0xba, "PNY Electronics"}, + { 1, 0x3b, "Newport Digital"}, + { 1, 0xbc, "MMC Networks"}, + { 1, 0x3d, "T Square"}, + { 1, 0x3e, "Seiko Epson"}, + { 1, 0xbf, "Broadcom"}, + { 1, 0x40, "Viking Components"}, + { 1, 0xc1, "V3 Semiconductor"}, + { 1, 0xc2, "Flextronics (Orbit Semiconductor)"}, + { 1, 0x43, "Suwa Electronics"}, + { 1, 0xc4, "Transmeta"}, + { 1, 0x45, "Micron CMS"}, + { 1, 0x46, "American Computer & Digital Components"}, + { 1, 0xc7, "Enhance 3000"}, + { 1, 0xc8, "Tower Semiconductor"}, + { 1, 0x49, "CPU Design"}, + { 1, 0x4a, "Price Point"}, + { 1, 0xcb, "Maxim Integrated Product"}, + { 1, 0x4c, "Tellabs"}, + { 1, 0xcd, "Centaur Technology"}, + { 1, 0xce, "Unigen"}, + { 1, 0x4f, "Transcend Information"}, + { 1, 0xd0, "Memory Card Technology"}, + { 1, 0x51, "CKD"}, + { 1, 0x52, "Capital Instruments"}, + { 1, 0xd3, "Aica Kogyo"}, + { 1, 0x54, "Linvex Technology"}, + { 1, 0xd5, "MSC Vertriebs"}, + { 1, 0xd6, "AKM Company"}, + { 1, 0x57, "Dynamem"}, + { 1, 0x58, "NERA ASA"}, + { 1, 0xd9, "GSI Technology"}, + { 1, 0xda, "Dane-Elec (C Memory)"}, + { 1, 0x5b, "Acorn Computers"}, + { 1, 0xdc, "Lara Technology"}, + { 1, 0x5d, "Oak Technology"}, + { 1, 0x5e, "Itec Memory"}, + { 1, 0xdf, "Tanisys Technology"}, + { 1, 0xe0, "Truevision"}, + { 1, 0x61, "Wintec Industries"}, + { 1, 0x62, "Super PC Memory"}, + { 1, 0xe3, "MGV Memory"}, + { 1, 0x64, "Galvantech"}, + { 1, 0xe5, "Gadzoox Networks"}, + { 1, 0xe6, "Multi Dimensional Cons."}, + { 1, 0x67, "GateField"}, + { 1, 0x68, "Integrated Memory System"}, + { 1, 0xe9, "Triscend"}, + { 1, 0xea, "XaQti"}, + { 1, 0x6b, "Goldenram"}, + { 1, 0xec, "Clear Logic"}, + { 1, 0x6d, "Cimaron Communications"}, + { 1, 0x6e, "Nippon Steel Semi. Corp."}, + { 1, 0xef, "Advantage Memory"}, + { 1, 0x70, "AMCC"}, + { 1, 0xf1, "LeCroy"}, + { 1, 0xf2, "Yamaha"}, + { 1, 0x73, "Digital Microwave"}, + { 1, 0xf4, "NetLogic Microsystems"}, + { 1, 0x75, "MIMOS Semiconductor"}, + { 1, 0x76, "Advanced Fibre"}, + { 1, 0xf7, "BF Goodrich Data."}, + { 1, 0xf8, "Epigram"}, + { 1, 0x79, "Acbel Polytech"}, + { 1, 0x7a, "Apacer Technology"}, + { 1, 0xfb, "Admor Memory"}, + { 1, 0x7c, "FOXCONN"}, + { 1, 0xfd, "Quadratics Superconductor"}, + { 1, 0xfe, "3COM"}, + { 2, 0x01, "Camintonn"}, + { 2, 0x02, "ISOA"}, + { 2, 0x83, "Agate Semiconductor"}, + { 2, 0x04, "ADMtek"}, + { 2, 0x85, "HYPERTEC"}, + { 2, 0x86, "Adhoc Technologies"}, + { 2, 0x07, "MOSAID Technologies"}, + { 2, 0x08, "Ardent Technologies"}, + { 2, 0x89, "Switchcore"}, + { 2, 0x8a, "Cisco Systems"}, + { 2, 0x0b, "Allayer Technologies"}, + { 2, 0x8c, "WorkX AG (Wichman)"}, + { 2, 0x0d, "Oasis Semiconductor"}, + { 2, 0x0e, "Novanet Semiconductor"}, + { 2, 0x8f, "E-M Solutions"}, + { 2, 0x10, "Power General"}, + { 2, 0x91, "Advanced Hardware Arch."}, + { 2, 0x92, "Inova Semiconductors"}, + { 2, 0x13, "Telocity"}, + { 2, 0x94, "Delkin Devices"}, + { 2, 0x15, "Symagery Microsystems"}, + { 2, 0x16, "C-Port"}, + { 2, 0x97, "SiberCore Technologies"}, + { 2, 0x98, "Southland Microsystems"}, + { 2, 0x19, "Malleable Technologies"}, + { 2, 0x1a, "Kendin Communications"}, + { 2, 0x9b, "Great Technology Microcomputer"}, + { 2, 0x1c, "Sanmina"}, + { 2, 0x9d, "HADCO"}, + { 2, 0x9e, "Corsair"}, + { 2, 0x1f, "Actrans System"}, + { 2, 0x20, "ALPHA Technologies"}, + { 2, 0xa1, "Silicon Laboratories (Cygnal)"}, + { 2, 0xa2, "Artesyn Technologies"}, + { 2, 0x23, "Align Manufacturing"}, + { 2, 0xa4, "Peregrine Semiconductor"}, + { 2, 0x25, "Chameleon Systems"}, + { 2, 0x26, "Aplus Flash Technology"}, + { 2, 0xa7, "MIPS Technologies"}, + { 2, 0xa8, "Chrysalis ITS"}, + { 2, 0x29, "ADTEC"}, + { 2, 0x2a, "Kentron Technologies"}, + { 2, 0xab, "Win Technologies"}, + { 2, 0x2c, "Tachyon Semiconductor (ASIC)"}, + { 2, 0xad, "Extreme Packet Devices"}, + { 2, 0xae, "RF Micro Devices"}, + { 2, 0x2f, "Siemens AG"}, + { 2, 0xb0, "Sarnoff"}, + { 2, 0x31, "Itautec SA"}, + { 2, 0x32, "Radiata"}, + { 2, 0xb3, "Benchmark Elect. (AVEX)"}, + { 2, 0x34, "Legend"}, + { 2, 0xb5, "SpecTek"}, + { 2, 0xb6, "Hi/fn"}, + { 2, 0x37, "Enikia"}, + { 2, 0x38, "SwitchOn Networks"}, + { 2, 0xb9, "AANetcom"}, + { 2, 0xba, "Micro Memory Bank"}, + { 2, 0x3b, "ESS Technology"}, + { 2, 0xbc, "Virata"}, + { 2, 0x3d, "Excess Bandwidth"}, + { 2, 0x3e, "West Bay Semiconductor"}, + { 2, 0xbf, "DSP Group"}, + { 2, 0x40, "Newport Communications"}, + { 2, 0xc1, "Chip2Chip"}, + { 2, 0xc2, "Phobos"}, + { 2, 0x43, "Intellitech"}, + { 2, 0xc4, "Nordic VLSI ASA"}, + { 2, 0x45, "Ishoni Networks"}, + { 2, 0x46, "Silicon Spice"}, + { 2, 0xc7, "Alchemy Semiconductor"}, + { 2, 0xc8, "Agilent Technologies"}, + { 2, 0x49, "Centillium Communications"}, + { 2, 0x4a, "W.L. Gore"}, + { 2, 0xcb, "HanBit Electronics"}, + { 2, 0x4c, "GlobeSpan"}, + { 2, 0xcd, "Element 14"}, + { 2, 0xce, "Pycon"}, + { 2, 0x4f, "Saifun Semiconductors"}, + { 2, 0xd0, "Sibyte,"}, + { 2, 0x51, "MetaLink Technologies"}, + { 2, 0x52, "Feiya Technology"}, + { 2, 0xd3, "I & C Technology"}, + { 2, 0x54, "Shikatronics"}, + { 2, 0xd5, "Elektrobit"}, + { 2, 0xd6, "Megic"}, + { 2, 0x57, "Com-Tier"}, + { 2, 0x58, "Malaysia Micro Solutions"}, + { 2, 0xd9, "Hyperchip"}, + { 2, 0xda, "Gemstone Communications"}, + { 2, 0x5b, "Anadigm (Anadyne)"}, + { 2, 0xdc, "3ParData"}, + { 2, 0x5d, "Mellanox Technologies"}, + { 2, 0x5e, "Tenx Technologies"}, + { 2, 0xdf, "Helix AG"}, + { 2, 0xe0, "Domosys"}, + { 2, 0x61, "Skyup Technology"}, + { 2, 0x62, "HiNT"}, + { 2, 0xe3, "Chiaro"}, + { 2, 0x64, "MDT Technologies"}, + { 2, 0xe5, "Exbit Technology A/S"}, + { 2, 0xe6, "Integrated Technology Express"}, + { 2, 0x67, "AVED Memory"}, + { 2, 0x68, "Legerity"}, + { 2, 0xe9, "Jasmine Networks"}, + { 2, 0xea, "Caspian Networks"}, + { 2, 0x6b, "nCUBE"}, + { 2, 0xec, "Silicon Access Networks"}, + { 2, 0x6d, "FDK"}, + { 2, 0x6e, "High Bandwidth Access"}, + { 2, 0xef, "MultiLink Technology"}, + { 2, 0x70, "BRECIS"}, + { 2, 0xf1, "World Wide Packets"}, + { 2, 0xf2, "APW"}, + { 2, 0x73, "Chicory Systems"}, + { 2, 0xf4, "Xstream Logic"}, + { 2, 0x75, "Fast-Chip"}, + { 2, 0x76, "Zucotto Wireless"}, + { 2, 0xf7, "Realchip"}, + { 2, 0xf8, "Galaxy Power"}, + { 2, 0x79, "eSilicon"}, + { 2, 0x7a, "Morphics Technology"}, + { 2, 0xfb, "Accelerant Networks"}, + { 2, 0x7c, "Silicon Wave"}, + { 2, 0xfd, "SandCraft"}, + { 2, 0xfe, "Elpida"}, + { 3, 0x01, "Solectron"}, + { 3, 0x02, "Optosys Technologies"}, + { 3, 0x83, "Buffalo (Formerly Melco)"}, + { 3, 0x04, "TriMedia Technologies"}, + { 3, 0x85, "Cyan Technologies"}, + { 3, 0x86, "Global Locate"}, + { 3, 0x07, "Optillion"}, + { 3, 0x08, "Terago Communications"}, + { 3, 0x89, "Ikanos Communications"}, + { 3, 0x8a, "Preton Technology"}, + { 3, 0x0b, "Nanya Technology"}, + { 3, 0x8c, "Elite Flash Storage"}, + { 3, 0x0d, "Mysticom"}, + { 3, 0x0e, "LightSand Communications"}, + { 3, 0x8f, "ATI Technologies"}, + { 3, 0x10, "Agere Systems"}, + { 3, 0x91, "NeoMagic"}, + { 3, 0x92, "AuroraNetics"}, + { 3, 0x13, "Geil"}, + { 3, 0x94, "Mushkin"}, + { 3, 0x15, "Tioga Technologies"}, + { 3, 0x16, "Netlist"}, + { 3, 0x97, "TeraLogic"}, + { 3, 0x98, "Cicada Semiconductor"}, + { 3, 0x19, "Centon Electronics"}, + { 3, 0x1a, "Tyco Electronics"}, + { 3, 0x9b, "Magis Works"}, + { 3, 0x1c, "Zettacom"}, + { 3, 0x9d, "Cogency Semiconductor"}, + { 3, 0x9e, "Chipcon AS"}, + { 3, 0x1f, "Aspex Technology"}, + { 3, 0x20, "F5 Networks"}, + { 3, 0xa1, "Programmable Silicon Solutions"}, + { 3, 0xa2, "ChipWrights"}, + { 3, 0x23, "Acorn Networks"}, + { 3, 0xa4, "Quicklogic"}, + { 3, 0x25, "Kingmax Semiconductor"}, + { 3, 0x26, "BOPS"}, + { 3, 0xa7, "Flasys"}, + { 3, 0xa8, "BitBlitz Communications"}, + { 3, 0x29, "eMemory Technology"}, + { 3, 0x2a, "Procket Networks"}, + { 3, 0xab, "Purple Ray"}, + { 3, 0x2c, "Trebia Networks"}, + { 3, 0xad, "Delta Electronics"}, + { 3, 0xae, "Onex Communications"}, + { 3, 0x2f, "Ample Communications"}, + { 3, 0xb0, "Memory Experts Intl"}, + { 3, 0x31, "Astute Networks"}, + { 3, 0x32, "Azanda Network Devices"}, + { 3, 0xb3, "Dibcom"}, + { 3, 0x34, "Tekmos"}, + { 3, 0xb5, "API NetWorks"}, + { 3, 0xb6, "Bay Microsystems"}, + { 3, 0x37, "Firecron"}, + { 3, 0x38, "Resonext Communications"}, + { 3, 0xb9, "Tachys Technologies"}, + { 3, 0xba, "Equator Technology"}, + { 3, 0x3b, "Concept Computer"}, + { 3, 0xbc, "SILCOM"}, + { 3, 0x3d, "3Dlabs"}, + { 3, 0x3e, "c?t Magazine"}, + { 3, 0xbf, "Sanera Systems"}, + { 3, 0x40, "Silicon Packets"}, + { 3, 0xc1, "Viasystems Group"}, + { 3, 0xc2, "Simtek"}, + { 3, 0x43, "Semicon Devices Singapore"}, + { 3, 0xc4, "Satron Handelsges"}, + { 3, 0x45, "Improv Systems"}, + { 3, 0x46, "INDUSYS"}, + { 3, 0xc7, "Corrent"}, + { 3, 0xc8, "Infrant Technologies"}, + { 3, 0x49, "Ritek Corp"}, + { 3, 0x4a, "empowerTel Networks"}, + { 3, 0xcb, "Hypertec"}, + { 3, 0x4c, "Cavium Networks"}, + { 3, 0xcd, "PLX Technology"}, + { 3, 0xce, "Massana Design"}, + { 3, 0x4f, "Intrinsity"}, + { 3, 0xd0, "Valence Semiconductor"}, + { 3, 0x51, "Terawave Communications"}, + { 3, 0x52, "IceFyre Semiconductor"}, + { 3, 0xd3, "Primarion"}, + { 3, 0x54, "Picochip Designs"}, + { 3, 0xd5, "Silverback Systems"}, + { 3, 0xd6, "Jade Star Technologies"}, + { 3, 0x57, "Pijnenburg Securealink"}, + { 3, 0x58, "takeMS International AG"}, + { 3, 0xd9, "Cambridge Silicon Radio"}, + { 3, 0xda, "Swissbit"}, + { 3, 0x5b, "Nazomi Communications"}, + { 3, 0xdc, "eWave System"}, + { 3, 0x5d, "Rockwell Collins"}, + { 3, 0x5e, "Picocel Co. (Paion)"}, + { 3, 0xdf, "Alphamosaic"}, + { 3, 0xe0, "Sandburst"}, + { 3, 0x61, "SiCon Video"}, + { 3, 0x62, "NanoAmp Solutions"}, + { 3, 0xe3, "Ericsson Technology"}, + { 3, 0x64, "PrairieComm"}, + { 3, 0xe5, "Mitac International"}, + { 3, 0xe6, "Layer N Networks"}, + { 3, 0x67, "MtekVision (Atsana)"}, + { 3, 0x68, "Allegro Networks"}, + { 3, 0xe9, "Marvell Semiconductors"}, + { 3, 0xea, "Netergy Microelectronic"}, + { 3, 0x6b, "NVIDIA"}, + { 3, 0xec, "Internet Machines"}, + { 3, 0x6d, "Peak Electronics"}, + { 3, 0x6e, "Litchfield Communication"}, + { 3, 0xef, "Accton Technology"}, + { 3, 0x70, "Teradiant Networks"}, + { 3, 0xf1, "Scaleo Chip"}, + { 3, 0xf2, "Cortina Systems"}, + { 3, 0x73, "RAM Components"}, + { 3, 0xf4, "Raqia Networks"}, + { 3, 0x75, "ClearSpeed"}, + { 3, 0x76, "Matsushita Battery"}, + { 3, 0xf7, "Xelerated"}, + { 3, 0xf8, "SimpleTech"}, + { 3, 0x79, "Utron Technology"}, + { 3, 0x7a, "Astec International"}, + { 3, 0xfb, "AVM"}, + { 3, 0x7c, "Redux Communications"}, + { 3, 0xfd, "Dot Hill Systems"}, + { 3, 0xfe, "TeraChip"}, + { 4, 0x01, "T-RAM"}, + { 4, 0x02, "Innovics Wireless"}, + { 4, 0x83, "Teknovus"}, + { 4, 0x04, "KeyEye Communications"}, + { 4, 0x85, "Runcom Technologies"}, + { 4, 0x86, "RedSwitch"}, + { 4, 0x07, "Dotcast"}, + { 4, 0x08, "Silicon Mountain Memory"}, + { 4, 0x89, "Signia Technologies"}, + { 4, 0x8a, "Pixim"}, + { 4, 0x0b, "Galazar Networks"}, + { 4, 0x8c, "White Electronic Designs"}, + { 4, 0x0d, "Patriot Scientific"}, + { 4, 0x0e, "Neoaxiom"}, + { 4, 0x8f, "3Y Power Technology"}, + { 4, 0x10, "Scaleo Chip"}, + { 4, 0x91, "Potentia Power Systems"}, + { 4, 0x92, "C-guys"}, + { 4, 0x13, "Digital Communications Technology"}, + { 4, 0x94, "Silicon-Based Technology"}, + { 4, 0x15, "Fulcrum Microsystems"}, + { 4, 0x16, "Positivo Informatica"}, + { 4, 0x97, "XIOtech"}, + { 4, 0x98, "PortalPlayer"}, + { 4, 0x19, "Zhiying Software"}, + { 4, 0x1a, "ParkerVision"}, + { 4, 0x9b, "Phonex Broadband"}, + { 4, 0x1c, "Skyworks Solutions"}, + { 4, 0x9d, "Entropic Communications"}, + { 4, 0x9e, "Pacific Force Technology"}, + { 4, 0x1f, "Zensys A/S"}, + { 4, 0x20, "Legend Silicon Corp."}, + { 4, 0xa1, "Sci-worx"}, + { 4, 0xa2, "SMSC (Standard Microsystems)"}, + { 4, 0x23, "Renesas Technology"}, + { 4, 0xa4, "Raza Microelectronics"}, + { 4, 0x25, "Phyworks"}, + { 4, 0x26, "MediaTek"}, + { 4, 0xa7, "Non-cents Productions"}, + { 4, 0xa8, "US Modular"}, + { 4, 0x29, "Wintegra"}, + { 4, 0x2a, "Mathstar"}, + { 4, 0xab, "StarCore"}, + { 4, 0x2c, "Oplus Technologies"}, + { 4, 0xad, "Mindspeed"}, + { 4, 0xae, "Just Young Computer"}, + { 4, 0x2f, "Radia Communications"}, + { 4, 0xb0, "OCZ"}, + { 4, 0x31, "Emuzed"}, + { 4, 0x32, "LOGIC Devices"}, + { 4, 0xb3, "Inphi"}, + { 4, 0x34, "Quake Technologies"}, + { 4, 0xb5, "Vixel"}, + { 4, 0xb6, "SolusTek"}, + { 4, 0x37, "Kongsberg Maritime"}, + { 4, 0x38, "Faraday Technology"}, + { 4, 0xb9, "Altium"}, + { 4, 0xba, "Insyte"}, + { 4, 0x3b, "ARM"}, + { 4, 0xbc, "DigiVision"}, + { 4, 0x3d, "Vativ Technologies"}, + { 4, 0x3e, "Endicott Interconnect Technologies"}, + { 4, 0xbf, "Pericom"}, + { 4, 0x40, "Bandspeed"}, + { 4, 0xc1, "LeWiz Communications"}, + { 4, 0xc2, "CPU Technology"}, + { 4, 0x43, "Ramaxel Technology"}, + { 4, 0xc4, "DSP Group"}, + { 4, 0x45, "Axis Communications"}, + { 4, 0x46, "Legacy Electronics"}, + { 4, 0xc7, "Chrontel"}, + { 4, 0xc8, "Powerchip Semiconductor"}, + { 4, 0x49, "MobilEye Technologies"}, + { 4, 0x4a, "Excel Semiconductor"}, + { 4, 0xcb, "A-DATA Technology"}, + { 4, 0x4c, "VirtualDigm"}, + { 4, 0xcd, "G Skill Intl"}, + { 4, 0xce, "Quanta Computer"}, + { 4, 0x4f, "Yield Microelectronics"}, + { 4, 0xd0, "Afa Technologies"}, + { 4, 0x51, "KINGBOX Technology Co."}, + { 4, 0x52, "Ceva"}, + { 4, 0xd3, "iStor Networks"}, + { 4, 0x54, "Advance Modules"}, + { 4, 0xd5, "Microsoft"}, + { 4, 0xd6, "Open-Silicon"}, + { 4, 0x57, "Goal Semiconductor"}, + { 4, 0x58, "ARC International"}, + { 4, 0xd9, "Simmtec"}, + { 4, 0xda, "Metanoia"}, + { 4, 0x5b, "Key Stream"}, + { 4, 0xdc, "Lowrance Electronics"}, + { 4, 0x5d, "Adimos"}, + { 4, 0x5e, "SiGe Semiconductor"}, + { 4, 0xdf, "Fodus Communications"}, + { 4, 0xe0, "Credence Systems Corp."}, + { 4, 0x61, "Genesis Microchip"}, + { 4, 0x62, "Vihana"}, + { 4, 0xe3, "WIS Technologies"}, + { 4, 0x64, "GateChange Technologies"}, + { 4, 0xe5, "High Density Devices AS"}, + { 4, 0xe6, "Synopsys"}, + { 4, 0x67, "Gigaram"}, + { 4, 0x68, "Enigma Semiconductor"}, + { 4, 0xe9, "Century Micro"}, + { 4, 0xea, "Icera Semiconductor"}, + { 4, 0x6b, "Mediaworks Integrated Systems"}, + { 4, 0xec, "O?Neil Product Development"}, + { 4, 0x6d, "Supreme Top Technology"}, + { 4, 0x6e, "MicroDisplay"}, + { 4, 0xef, "Team Group"}, + { 4, 0x70, "Sinett"}, + { 4, 0xf1, "Toshiba"}, + { 4, 0xf2, "Tensilica"}, + { 4, 0x73, "SiRF Technology"}, + { 4, 0xf4, "Bacoc"}, + { 4, 0x75, "SMaL Camera Technologies"}, + { 4, 0x76, "Thomson SC"}, + { 4, 0xf7, "Airgo Networks"}, + { 4, 0xf8, "Wisair"}, + { 4, 0x79, "SigmaTel"}, + { 4, 0x7a, "Arkados"}, + { 4, 0xfb, "Compete IT Co. KG"}, + { 4, 0x7c, "Eudar Technology"}, + { 4, 0xfd, "Focus Enhancements"}, + { 4, 0xfe, "Xyratex"}, + { 5, 0x01, "Specular Networks"}, + { 5, 0x02, "PDP Systems"}, + { 5, 0x83, "U-Chip Technology Corp."}, + { 5, 0x04, "Silicon Optix"}, + { 5, 0x85, "Greenfield Networks"}, + { 5, 0x86, "CompuRAM"}, + { 5, 0x07, "Stargen"}, + { 5, 0x08, "NetCell"}, + { 5, 0x89, "Excalibrus Technologies"}, + { 5, 0x8a, "SCM Microsystems"}, + { 5, 0x0b, "Xsigo Systems"}, + { 5, 0x8c, "CHIPS & Systems"}, + { 5, 0x0d, "Tier"}, + { 5, 0x0e, "CWRL Labs"}, + { 5, 0x8f, "Teradici"}, + { 5, 0x10, "Gigaram"}, + { 5, 0x91, "g2 Microsystems"}, + { 5, 0x92, "PowerFlash Semiconductor"}, + { 5, 0x13, "P.A. Semi"}, + { 5, 0x94, "NovaTech Solutions, S.A."}, + { 5, 0x15, "c2 Microsystems"}, + { 5, 0x16, "Level5 Networks"}, + { 5, 0x97, "COS Memory AG"}, + { 5, 0x98, "Innovasic Semiconductor"}, + { 5, 0x19, "02IC Co."}, + { 5, 0x1a, "Tabula,"}, + { 5, 0x9b, "Crucial Technology"}, + { 5, 0x1c, "Chelsio Communications"}, + { 5, 0x9d, "Solarflare Communications"}, + { 5, 0x9e, "Xambala"}, + { 5, 0x1f, "EADS Astrium"}, + { 5, 0x20, "Terra Semiconductor"}, + { 5, 0xa1, "Imaging Works"}, + { 5, 0xa2, "Astute Networks"}, + { 5, 0x23, "Tzero"}, + { 5, 0xa4, "Emulex"}, + { 5, 0x25, "Power-One"}, + { 5, 0x26, "Pulse~LINK"}, + { 5, 0xa7, "Hon Hai Precision Industry"}, + { 5, 0xa8, "White Rock Networks"}, + { 5, 0x29, "Telegent Systems USA"}, + { 5, 0x2a, "Atrua Technologies"}, + { 5, 0xab, "Acbel Polytech"}, + { 5, 0x2c, "eRide"}, + { 5, 0xad, "ULi Electronics"}, + { 5, 0xae, "Magnum Semiconductor"}, + { 5, 0x2f, "neoOne Technology"}, + { 5, 0xb0, "Connex Technology"}, + { 5, 0x31, "Stream Processors"}, + { 5, 0x32, "Focus Enhancements"}, + { 5, 0xb3, "Telecis Wireless"}, + { 5, 0x34, "uNav Microelectronics"}, + { 5, 0xb5, "Tarari"}, + { 5, 0xb6, "Ambric"}, + { 5, 0x37, "Newport Media"}, + { 5, 0x38, "VMTS"}, + { 5, 0xb9, "Enuclia Semiconductor"}, + { 5, 0xba, "Virtium Technology"}, + { 5, 0x3b, "Solid State System Co."}, + { 5, 0xbc, "Kian Tech LLC"}, + { 5, 0x3d, "Artimi"}, + { 5, 0x3e, "Power Quotient International"}, + { 5, 0xbf, "Avago Technologies"}, + { 5, 0x40, "ADTechnology"}, + { 5, 0xc1, "Sigma Designs"}, + { 5, 0xc2, "SiCortex"}, + { 5, 0x43, "Ventura Technology Group"}, + { 5, 0xc4, "eASIC"}, + { 5, 0x45, "M.H.S. SAS"}, + { 5, 0x46, "Micro Star International"}, + { 5, 0xc7, "Rapport"}, + { 5, 0xc8, "Makway International"}, + { 5, 0x49, "Broad Reach Engineering Co."}, + { 5, 0x4a, "Semiconductor Mfg Intl Corp"}, + { 5, 0xcb, "SiConnect"}, + { 5, 0x4c, "FCI USA"}, + { 5, 0xcd, "Validity Sensors"}, + { 5, 0xce, "Coney Technology Co."}, + { 5, 0x4f, "Spans Logic"}, + { 5, 0xd0, "Neterion"}, + { 5, 0x51, "Qimonda"}, + { 5, 0x52, "New Japan Radio Co."}, + { 5, 0xd3, "Velogix"}, + { 5, 0x54, "Montalvo Systems"}, + { 5, 0xd5, "iVivity"}, + { 5, 0xd6, "Walton Chaintech"}, + { 5, 0x57, "AENEON"}, + { 5, 0x58, "Lorom Industrial Co."}, + { 5, 0xd9, "Radiospire Networks"}, + { 5, 0xda, "Sensio Technologies"}, + { 5, 0x5b, "Nethra Imaging"}, + { 5, 0xdc, "Hexon Technology Pte"}, + { 5, 0x5d, "CompuStocx (CSX)"}, + { 5, 0x5e, "Methode Electronics"}, + { 5, 0xdf, "Connect One"}, + { 5, 0xe0, "Opulan Technologies"}, + { 5, 0x61, "Septentrio NV"}, + { 5, 0x62, "Goldenmars Technology"}, + { 5, 0xe3, "Kreton"}, + { 5, 0x64, "Cochlear"}, + { 5, 0xe5, "Altair Semiconductor"}, + { 5, 0xe6, "NetEffect"}, + { 5, 0x67, "Spansion"}, + { 5, 0x68, "Taiwan Semiconductor Mfg"}, + { 5, 0xe9, "Emphany Systems"}, + { 5, 0xea, "ApaceWave Technologies"}, + { 5, 0x6b, "Mobilygen"}, + { 5, 0xec, "Tego"}, + { 5, 0x6d, "Cswitch"}, + { 5, 0x6e, "Haier (Beijing) IC Design Co."}, + { 5, 0xef, "MetaRAM"}, + { 5, 0x70, "Axel Electronics Co."}, + { 5, 0xf1, "Tilera"}, + { 5, 0xf2, "Aquantia"}, + { 5, 0x73, "Vivace Semiconductor"}, + { 5, 0xf4, "Redpine Signals"}, + { 5, 0x75, "Octalica"}, + { 5, 0x76, "InterDigital Communications"}, + { 5, 0xf7, "Avant Technology"}, + { 5, 0xf8, "Asrock"}, + { 5, 0x79, "Availink"}, + { 5, 0x7a, "Quartics"}, + { 5, 0xfb, "Element CXI"}, + { 5, 0x7c, "Innovaciones Microelectronicas"}, + { 5, 0xfd, "VeriSilicon Microelectronics"}, + { 5, 0xfe, "W5 Networks"}, + { 6, 0x01, "MOVEKING"}, + { 6, 0x02, "Mavrix Technology"}, + { 6, 0x83, "CellGuide"}, + { 6, 0x04, "Faraday Technology"}, + { 6, 0x85, "Diablo Technologies"}, + { 6, 0x86, "Jennic"}, + { 6, 0x07, "Octasic"}, + { 6, 0x08, "Molex"}, + { 6, 0x89, "3Leaf Networks"}, + { 6, 0x8a, "Bright Micron Technology"}, + { 6, 0x0b, "Netxen"}, + { 6, 0x8c, "NextWave Broadband"}, + { 6, 0x0d, "DisplayLink"}, + { 6, 0x0e, "ZMOS Technology"}, + { 6, 0x8f, "Tec-Hill"}, + { 6, 0x10, "Multigig"}, + { 6, 0x91, "Amimon"}, + { 6, 0x92, "Euphonic Technologies"}, + { 6, 0x13, "BRN Phoenix"}, + { 6, 0x94, "InSilica"}, + { 6, 0x15, "Ember"}, + { 6, 0x16, "Avexir Technologies"}, + { 6, 0x97, "Echelon"}, + { 6, 0x98, "Edgewater Computer Systems"}, + { 6, 0x19, "XMOS Semiconductor"}, + { 6, 0x1a, "GENUSION"}, + { 6, 0x9b, "Memory Corp NV"}, + { 6, 0x1c, "SiliconBlue Technologies"}, + { 6, 0x9d, "Rambus"}, + { 6, 0x9e, "Andes Technology"}, + { 6, 0x1f, "Coronis Systems"}, + { 6, 0x20, "Achronix Semiconductor"}, + { 6, 0xa1, "Siano Mobile Silicon"}, + { 6, 0xa2, "Semtech"}, + { 6, 0x23, "Pixelworks"}, + { 6, 0xa4, "Gaisler Research AB"}, + { 6, 0x25, "Teranetics"}, + { 6, 0x26, "Toppan Printing Co."}, + { 6, 0xa7, "Kingxcon"}, + { 6, 0xa8, "Silicon Integrated Systems"}, + { 6, 0x29, "I-O Data Device"}, + { 6, 0x2a, "NDS Americas"}, + { 6, 0xab, "Solomon Systech Limited"}, + { 6, 0x2c, "On Demand Microelectronics"}, + { 6, 0xad, "Amicus Wireless"}, + { 6, 0xae, "SMARDTV SNC"}, + { 6, 0x2f, "Comsys Communication"}, + { 6, 0xb0, "Movidia"}, + { 6, 0x31, "Javad GNSS"}, + { 6, 0x32, "Montage Technology Group"}, + { 6, 0xb3, "Trident Microsystems"}, + { 6, 0x34, "Super Talent"}, + { 6, 0xb5, "Optichron"}, + { 6, 0xb6, "Future Waves UK"}, + { 6, 0x37, "SiBEAM"}, + { 6, 0x38, "Inicore,"}, + { 6, 0xb9, "Virident Systems"}, + { 6, 0xba, "M2000"}, + { 6, 0x3b, "ZeroG Wireless"}, + { 6, 0xbc, "Gingle Technology Co."}, + { 6, 0x3d, "Space Micro"}, + { 6, 0x3e, "Wilocity"}, + { 6, 0xbf, "Novafora, Ic."}, + { 6, 0x40, "iKoa"}, + { 6, 0xc1, "ASint Technology"}, + { 6, 0xc2, "Ramtron"}, + { 6, 0x43, "Plato Networks"}, + { 6, 0xc4, "IPtronics AS"}, + { 6, 0x45, "Infinite-Memories"}, + { 6, 0x46, "Parade Technologies"}, + { 6, 0xc7, "Dune Networks"}, + { 6, 0xc8, "GigaDevice Semiconductor"}, + { 6, 0x49, "Modu"}, + { 6, 0x4a, "CEITEC"}, + { 6, 0xcb, "Northrop Grumman"}, + { 6, 0x4c, "XRONET"}, + { 6, 0xcd, "Sicon Semiconductor AB"}, + { 6, 0xce, "Atla Electronics Co."}, + { 6, 0x4f, "TOPRAM Technology"}, + { 6, 0xd0, "Silego Technology"}, + { 6, 0x51, "Kinglife"}, + { 6, 0x52, "Ability Industries"}, + { 6, 0xd3, "Silicon Power Computer & Communications"}, + { 6, 0x54, "Augusta Technology"}, + { 6, 0xd5, "Nantronics Semiconductors"}, + { 6, 0xd6, "Hilscher Gesellschaft"}, + { 6, 0x57, "Quixant"}, + { 6, 0x58, "Percello"}, + { 6, 0xd9, "NextIO"}, + { 6, 0xda, "Scanimetrics"}, + { 6, 0x5b, "FS-Semi Company"}, + { 6, 0xdc, "Infinera"}, + { 6, 0x5d, "SandForce"}, + { 6, 0x5e, "Lexar Media"}, + { 6, 0xdf, "Teradyne"}, + { 6, 0xe0, "Memory Exchange Corp."}, + { 6, 0x61, "Suzhou Smartek Electronics"}, + { 6, 0x62, "Avantium"}, + { 6, 0xe3, "ATP Electronics"}, + { 6, 0x64, "Valens Semiconductor"}, + { 6, 0xe5, "Agate Logic"}, + { 6, 0xe6, "Netronome"}, + { 6, 0x67, "Zenverge"}, + { 6, 0x68, "N-trig"}, + { 6, 0xe9, "SanMax Technologies"}, + { 6, 0xea, "Contour Semiconductor"}, + { 6, 0x6b, "TwinMOS"}, + { 6, 0xec, "Silicon Systems"}, + { 6, 0x6d, "V-Color Technology"}, + { 6, 0x6e, "Certicom"}, + { 6, 0xef, "JSC ICC Milandr"}, + { 6, 0x70, "PhotoFast Global"}, + { 6, 0xf1, "InnoDisk"}, + { 6, 0xf2, "Muscle Power"}, + { 6, 0x73, "Energy Micro"}, + { 6, 0xf4, "Innofidei"}, + { 9, 0xff, ""} +}; + +#define VEN_MAP_SIZE (sizeof(vendorMap)/sizeof(VenIdName)) + +#endif diff --git a/i386/libsaio/.svn/text-base/misc.c.svn-base b/i386/libsaio/.svn/text-base/misc.c.svn-base new file mode 100644 index 0000000..f26fd87 --- /dev/null +++ b/i386/libsaio/.svn/text-base/misc.c.svn-base @@ -0,0 +1,120 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" + +/* + * keyboard controller (8042) I/O port addresses + */ +#define PORT_A 0x60 /* port A */ +#define PORT_B 0x64 /* port B */ + +/* + * keyboard controller command + */ +#define CMD_WOUT 0xd1 /* write controller's output port */ + +/* + * keyboard controller status flags + */ +#define KB_INFULL 0x2 /* input buffer full */ +#define KB_OUTFULL 0x1 /* output buffer full */ + +#define KB_A20 0x9f /* enable A20, + enable output buffer full interrupt + enable data line + disable clock line */ + +//========================================================================== +// Enable A20 gate to be able to access memory above 1MB + +static inline void flushKeyboardInputBuffer() +{ + unsigned char ret; + /* Apparently all flags on means that they're invalid and that the code + should stop trying to check them because they'll never change */ + do + { + ret = inb(PORT_B); + } while( (ret != 0xff) && (ret & KB_INFULL)); +} + +void enableA20() +{ + /* make sure that the input buffer is empty */ + flushKeyboardInputBuffer(); + + /* make sure that the output buffer is empty */ + if (inb(PORT_B) & KB_OUTFULL) + (void)inb(PORT_A); + + /* make sure that the input buffer is empty */ + flushKeyboardInputBuffer(); + + /* write output port */ + outb(PORT_B, CMD_WOUT); + delay(100); + + /* wait until command is accepted */ + flushKeyboardInputBuffer(); + + outb(PORT_A, KB_A20); + delay(100); + + /* wait until done */ + flushKeyboardInputBuffer(); +} + +//========================================================================== +// Return the platform name for this hardware. +// +#ifndef BOOT1 +void +getPlatformName(char *nameBuf) +{ + strcpy(nameBuf, "ACPI"); +} +#endif diff --git a/i386/libsaio/.svn/text-base/msdos.c.svn-base b/i386/libsaio/.svn/text-base/msdos.c.svn-base new file mode 100644 index 0000000..f428ed9 --- /dev/null +++ b/i386/libsaio/.svn/text-base/msdos.c.svn-base @@ -0,0 +1,952 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "libsaio.h" +#include "sl.h" +#include "msdos_private.h" +#include "msdos.h" + +#define LABEL_LENGTH 11 +#define MSDOS_CACHE_BLOCKSIZE BPS + +#define CLUST_FIRST 2/* reserved cluster range */ +#define CLUST_RSRVD32 0x0ffffff8 /* reserved cluster range */ +#define CLUST_RSRVD16 0xfff8 /* reserved cluster range */ +#define CLUST_RSRVD12 0xff8 /* reserved cluster range */ + +#define tolower(c) (((c)>='A' && c<='Z')?((c) | 0x20):(c)) + +static int msdosressector=0; +static int msdosnfats = 0; +static int msdosfatsecs = 0; +static int msdosbps = 0; +static int msdosclustersize = 0; +static int msdosrootDirSectors = 0; +static CICell msdoscurrent = 0; +static int msdosrootcluster = 0; +static int msdosfatbits = 0; + +#if UNUSED +/* + * Check a volume label. + */ +static int +oklabel(const char *src) +{ + int c, i; + + for (i = 0, c = 0; i <= 11; i++) { + c = (u_char)*src++; + if (c < ' ' + !i || strchr("\"*+,./:;<=>?[\\]|", c)) + break; + } + return i && !c; +} +#endif /* UNUSED */ + +void MSDOSFree(CICell ih) +{ + if(msdoscurrent == ih) + msdoscurrent = 0; + free(ih); +} + +int MSDOSProbe(const void * buffer) +{ + union bootsector *bsp; + struct bpb33 *b33; + struct bpb50 *b50; + struct bpb710 *b710; + u_int16_t bps; + u_int8_t spc; + + bsp = (union bootsector *)buffer; + b33 = (struct bpb33 *)bsp->bs33.bsBPB; + b50 = (struct bpb50 *)bsp->bs50.bsBPB; + b710 = (struct bpb710 *)bsp->bs710.bsBPB; + + /* We only work with 512, 1024, and 2048 byte sectors */ + bps = OSSwapLittleToHostInt16(b33->bpbBytesPerSec); + if ((bps < 0x200) || (bps & (bps - 1)) || (bps > 0x800)) + return 0; + + /* Check to make sure valid sectors per cluster */ + spc = b33->bpbSecPerClust; + if ((spc == 0 ) || (spc & (spc - 1))) + return 0; + + if (OSSwapLittleToHostInt16(b50->bpbRootDirEnts) == 0) { /* It's FAT32 */ + if (!memcmp(((struct extboot *)bsp->bs710.bsExt)->exFileSysType, "FAT32 ", 8)) + return 32; + } + else if (((struct extboot *)bsp->bs50.bsExt)->exBootSignature == EXBOOTSIG) { + if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT16 ", 8)) + return 16; + if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT12 ", 8)) + return 12; + } + + return 0; +} + + +long +MSDOSInitPartition (CICell ih) +{ + union bootsector *bsp; + struct bpb33 *b33; + struct bpb50 *b50; + struct bpb710 *b710; + u_int8_t spc; + char *buf; + + if (msdoscurrent == ih) + { + CacheInit(ih, MSDOS_CACHE_BLOCKSIZE); + return 0; + } + + buf=malloc (512); + /* + * Read the boot sector of the filesystem, and then check the + * boot signature. If not a dos boot sector then error out. + * + * NOTE: 2048 is a maximum sector size in current... + */ + Seek(ih, 0); + Read(ih, (long)buf, 512); + + bsp = (union bootsector *)buf; + b33 = (struct bpb33 *)bsp->bs33.bsBPB; + b50 = (struct bpb50 *)bsp->bs50.bsBPB; + b710 = (struct bpb710 *)bsp->bs710.bsBPB; + + + /* We only work with 512, 1024, and 2048 byte sectors */ + msdosbps = OSSwapLittleToHostInt16(b33->bpbBytesPerSec); + if ((msdosbps < 0x200) || (msdosbps & (msdosbps - 1)) || (msdosbps > 0x800)) + { + free (buf); + return -1; + } + + /* Check to make sure valid sectors per cluster */ + spc = b33->bpbSecPerClust; + if ((spc == 0 ) || (spc & (spc - 1))) + return -1; + + if (OSSwapLittleToHostInt16(b50->bpbRootDirEnts) == 0) { /* It's FAT32 */ + if (memcmp(((struct extboot *)bsp->bs710.bsExt)->exFileSysType, "FAT32 ", 8)) + { + free (buf); + return -1; + } + msdosressector = OSSwapLittleToHostInt16(b710->bpbResSectors); + msdosnfats = b710->bpbFATs; + msdosfatsecs = OSSwapLittleToHostInt16(b710->bpbBigFATsecs); + msdosrootcluster = OSSwapLittleToHostInt32(b710->bpbRootClust); + msdosrootDirSectors = 0; + msdosfatbits = 32; + } + else if (((struct extboot *)bsp->bs50.bsExt)->exBootSignature == EXBOOTSIG) { + if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT16 ", 8)) + msdosfatbits = 16; + else if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT12 ", 8)) + msdosfatbits = 12; + else + { + free (buf); + return -1; + } + + msdosressector = OSSwapLittleToHostInt16(b33->bpbResSectors); + msdosnfats = b33->bpbFATs; + msdosfatsecs = OSSwapLittleToHostInt16(b33->bpbFATsecs); + msdosrootcluster = 0; + msdosrootDirSectors = ((OSSwapLittleToHostInt16(b50->bpbRootDirEnts) * sizeof(struct direntry)) + + (msdosbps-1)) / msdosbps; + } else { + free (buf); + return -1; + } + + msdosclustersize = msdosbps * spc; + msdoscurrent = ih; + + CacheInit(ih, MSDOS_CACHE_BLOCKSIZE); + free (buf); + return 0; +} + +static int +readSector(CICell ih, off_t readOffset, char *buf, int size) +{ + // Caching only FAT entries (4 bytes) by utlizing the cache with sector aligned read requests. + if (size < BPS) + { + long long sectorOffset = (uint64_t)readOffset / BPS * BPS; + long relOffset = readOffset % BPS; + char *cacheBuffer; + + cacheBuffer = malloc(MSDOS_CACHE_BLOCKSIZE); + CacheRead(ih, cacheBuffer, sectorOffset, MSDOS_CACHE_BLOCKSIZE, true); + bcopy(cacheBuffer + relOffset, buf, size); + free(cacheBuffer); + } + else + { + Seek(ih, readOffset); + Read(ih, (long)buf, size); + } + + return 0; +} + +static int +msdosreadcluster (CICell ih, uint8_t *buf, int size, off_t *cluster) +{ + off_t readOffset; + char tmpbuf[8]; + off_t clusn; + + switch (msdosfatbits) { + case 32: + if (*cluster < CLUST_FIRST ||*cluster >= CLUST_RSRVD32) + return 0; + clusn = *cluster - CLUST_FIRST; + break; + case 16: + if (*cluster < CLUST_FIRST ||*cluster >= CLUST_RSRVD16) + return 0; + clusn = *cluster - CLUST_FIRST; + break; + case 12: + if (*cluster < CLUST_FIRST ||*cluster >= CLUST_RSRVD12) + return 0; + clusn = *cluster - CLUST_FIRST; + break; + default: + return 0; + } + + /* Find sector where clusters start */ + readOffset = (msdosressector + + (msdosnfats * msdosfatsecs)+msdosrootDirSectors)*msdosbps; + /* Find sector where "cluster" starts */ + readOffset += clusn * msdosclustersize; + + /* Read in "cluster" */ + if (buf) + { + Seek(ih, readOffset); + Read(ih, (long)buf, size); + } + + /* Find first sector of FAT */ + readOffset = msdosressector * msdosbps; + + /* Find sector containing "cluster" entry in FAT */ + readOffset += ((uint64_t)*cluster * (uint64_t)msdosfatbits) / 8; + + /* Read one sector of the FAT */ + readSector(ih, readOffset, tmpbuf, 4); + + switch (msdosfatbits) { + case 32: + *cluster = OSReadLittleInt32(tmpbuf, 0); + *cluster &= 0x0FFFFFFF; // ignore reserved upper bits + return 1; + case 16: + *cluster = OSReadLittleInt16(tmpbuf, 0); + return 1; + case 12: + *cluster = OSReadLittleInt16(tmpbuf, 0)>>(((uint64_t)*cluster * (uint64_t)msdosfatbits)%8); + *cluster &= 0xfff; + return 1; + default: + return 0; + } +} + +struct msdosdirstate +{ + struct direntry *buf; + uint8_t vfatchecksum; + int root16; + off_t cluster; + int nument; + int vfatnumber; +}; + +static struct direntry * +getnextdirent (CICell ih, uint16_t *longname, struct msdosdirstate *st) +{ + struct direntry *dirp; + while (1) + { + if (st->root16) + { + if (st->cluster >= msdosrootDirSectors && st->nument == 0) + return 0; + if (st->nument == 0) + { + Seek(ih, (msdosressector + + (msdosnfats * msdosfatsecs)+st->cluster)*msdosbps); + Read(ih, (long)st->buf, msdosbps); + st->cluster++; + } + } else if (st->nument == 0 && !msdosreadcluster (ih, (uint8_t *)st->buf, msdosclustersize, &(st->cluster))) + return 0; + + dirp=st->buf+st->nument; + + if (dirp->deName[0] == SLOT_EMPTY) + return 0; + else if (dirp->deName[0] == SLOT_DELETED) + st->vfatnumber = 0; + else if (dirp->deAttributes == ATTR_WIN95) + { + struct winentry *wdirp = (struct winentry *)dirp; + int num; + if (wdirp->weCnt & 0x80) + continue; + num=(wdirp->weCnt&0x3f); + if (WIN_CHARS * num > WIN_MAXLEN) + continue; + if (st->vfatchecksum!=wdirp->weChksum) + { + st->vfatnumber = 0; + st->vfatchecksum = wdirp->weChksum; + } + if (st->vfatnumber < num) + st->vfatnumber = num; + bcopy (&(wdirp->wePart1),longname+WIN_CHARS*(num-1),sizeof (wdirp->wePart1)); + bcopy (&(wdirp->wePart2),longname+WIN_CHARS*(num-1)+5,sizeof (wdirp->wePart2)); + bcopy (&(wdirp->wePart3),longname+WIN_CHARS*(num-1)+11,sizeof (wdirp->wePart3)); + } else { + uint8_t labelchecksum; + int i; + longname[st->vfatnumber*WIN_CHARS]=0; + + labelchecksum=0; + for(i=0;i<LABEL_LENGTH;i++) + labelchecksum=(labelchecksum>>1)+(labelchecksum<<7)+dirp->deName[i]; + if (!(labelchecksum==st->vfatchecksum && st->vfatnumber)) + longname[0]=0; + st->vfatnumber = 0; + st->vfatchecksum = 0; + st->vfatnumber = 0; + st->nument++; + if ((!st->root16 &&st->nument * sizeof (struct direntry)>=msdosclustersize) + || (st->root16 &&st->nument * sizeof (struct direntry)>=msdosbps)) + st->nument = 0; + return dirp; + } + st->nument++; + if ((!st->root16 &&st->nument * sizeof (struct direntry)>=msdosclustersize) + || (st->root16 &&st->nument * sizeof (struct direntry)>=msdosbps)) + st->nument = 0; + } +} + +static void +initRoot (struct msdosdirstate *st) +{ + if (msdosrootDirSectors) { /* FAT12 or FAT16 */ + st->root16 = 1; + st->vfatchecksum = 0; + st->nument = 0; + st->cluster = 0; + st->vfatnumber = 0; + } else { /* FAT32 */ + st->root16 = 0; + st->vfatchecksum = 0; + st->nument = 0; + st->cluster = msdosrootcluster; + st->vfatnumber = 0; + } +} + +/* First comes lowercase, then uppercase*/ +static uint16_t cp850[128][2]= +{ +{0x00E7,0x00C7}, +{0x00FC,0x00DC}, +{0x00E9,0x00C9}, +{0x00E2,0x00C2}, +{0x00E4,0x00C4}, +{0x00E0,0x00C0}, +{0x00E5,0x00C5}, +{0x00E7,0x00C7}, +{0x00EA,0x00CA}, +{0x00EB,0x00CB}, +{0x00E8,0x00C8}, +{0x00EF,0x00CF}, +{0x00EE,0x00CE}, +{0x00EC,0x00CC}, +{0x00E4,0x00C4}, +{0x00E5,0x00C5}, +{0x00E9,0x00C9}, +{0x00E6,0x00C6}, +{0x00E6,0x00C6}, +{0x00F4,0x00D4}, +{0x00F6,0x00D6}, +{0x00F2,0x00D2}, +{0x00FB,0x00DB}, +{0x00F9,0x00D9}, +{0x00FF,0x0178}, +{0x00F6,0x00D6}, +{0x00FC,0x00DC}, +{0x00F8,0x00D8}, +{0x00A3,0x00A3}, +{0x00F8,0x00D8}, +{0x00D7,0x00D7}, +{0x0192,0x0191}, +{0x00E1,0x00C1}, +{0x00ED,0x00CD}, +{0x00F3,0x00D3}, +{0x00FA,0x00DA}, +{0x00F1,0x00D1}, +{0x00F1,0x00D1}, +{0x00AA,0x00AA}, +{0x00BA,0x00BA}, +{0x00BF,0x00BF}, +{0x00AE,0x00AE}, +{0x00AC,0x00AC}, +{0x00BD,0x00BD}, +{0x00BC,0x00BC}, +{0x00A1,0x00A1}, +{0x00AB,0x00AB}, +{0x00BB,0x00BB}, +{0x2591,0x2591}, +{0x2592,0x2592}, +{0x2593,0x2593}, +{0x2502,0x2502}, +{0x2524,0x2524}, +{0x00E1,0x00C1}, +{0x00E2,0x00C2}, +{0x00E0,0x00C0}, +{0x00A9,0x00A9}, +{0x2563,0x2563}, +{0x2551,0x2551}, +{0x2557,0x2557}, +{0x255D,0x255D}, +{0x00A2,0x00A2}, +{0x00A5,0x00A5}, +{0x2510,0x2510}, +{0x2514,0x2514}, +{0x2534,0x2534}, +{0x252C,0x252C}, +{0x251C,0x251C}, +{0x2500,0x2500}, +{0x253C,0x253C}, +{0x00E3,0x00C3}, +{0x00E3,0x00C3}, +{0x255A,0x255A}, +{0x2554,0x2554}, +{0x2569,0x2569}, +{0x2566,0x2566}, +{0x2560,0x2560}, +{0x2550,0x2550}, +{0x256C,0x256C}, +{0x00A4,0x00A4}, +{0x00F0,0x00D0}, +{0x00F0,0x00D0}, +{0x00EA,0x00CA}, +{0x00EB,0x00CB}, +{0x00E8,0x00C8}, +{0x0131,0x0049}, +{0x00ED,0x00CD}, +{0x00EE,0x00CE}, +{0x00EF,0x00CF}, +{0x2518,0x2518}, +{0x250C,0x250C}, +{0x2588,0x2588}, +{0x2584,0x2584}, +{0x00A6,0x00A6}, +{0x00EC,0x00CC}, +{0x2580,0x2580}, +{0x00F3,0x00D3}, +{0x00DF,0x00DF}, +{0x00F4,0x00D4}, +{0x00F2,0x00D2}, +{0x00F5,0x00D5}, +{0x00F5,0x00D5}, +{0x00B5,0x00B5}, +{0x00FE,0x00DE}, +{0x00FE,0x00DE}, +{0x00FA,0x00DA}, +{0x00FB,0x00DB}, +{0x00F9,0x00D9}, +{0x00FD,0x00DD}, +{0x00FD,0x00DD}, +{0x00AF,0x00AF}, +{0x00B4,0x00B4}, +{0x00AD,0x00AD}, +{0x00B1,0x00B1}, +{0x2017,0x2017}, +{0x00BE,0x00BE}, +{0x00B6,0x00B6}, +{0x00A7,0x00A7}, +{0x00F7,0x00F7}, +{0x00B8,0x00B8}, +{0x00B0,0x00B0}, +{0x00A8,0x00A8}, +{0x00B7,0x00B7}, +{0x00B9,0x00B9}, +{0x00B3,0x00B3}, +{0x00B2,0x00B2}, +{0x25A0,0x25A0}, +{0x00A0,0x00A0} +}; + +static int +checkname (uint16_t *ucsname, int ucslen, struct direntry *dirp, uint16_t *vfatname) +{ + uint16_t tmp[15]; + if (vfatname[0]) + { + int i; + for (i=0;vfatname[i];i++); + return !FastUnicodeCompare (ucsname, ucslen, vfatname, i, OSLittleEndian); + } + else + { + int i, j, k; + for (i=7;i>=0;i--) + if (dirp->deName[i]!=' ') + break; + j=i+1; + tmp[i+1]=0; + for(;i>=0;i--) + tmp[i]=SWAP_LE16((dirp->deName[i]>=128)?cp850[dirp->deName[i]-128][0]:tolower(dirp->deName[i])); + for (i=2;i>=0;i--) + if (dirp->deName[8+i]!=' ') + break; + if (i>=0) + { + tmp[j++]='.'; + tmp[j+i+1]=0; + k=j+i+1; + for(;i>=0;i--) + tmp[j+i]=SWAP_LE16((dirp->deName[i+8]>=128)?cp850[dirp->deName[i+8]-128][0]:tolower(dirp->deName[i+8])); + j=k; + } + return !FastUnicodeCompare (ucsname, ucslen, tmp, j, OSLittleEndian); + } + +} + +static struct direntry * +getdirpfrompath (CICell ih, char *dirspec, uint8_t *buf) +{ + struct msdosdirstate st; + struct direntry *dirp; + uint8_t * ptr; + uint8_t *slash; + char c; + uint16_t vfatname[WIN_MAXLEN+2*WIN_CHARS]; + uint16_t ucsname[WIN_MAXLEN+1]; + uint16_t ucslen; + int ucslenhost; + initRoot (&st); + st.buf = (struct direntry *)buf; + ptr=(uint8_t*)dirspec; + for (slash=ptr;*slash && *slash!='/';slash++); + c=*slash; + *slash=0; + utf_decodestr (ptr, ucsname, &ucslen, WIN_MAXLEN, OSLittleEndian); + ucslenhost = OSReadLittleInt16 (&ucslen,0); + ucsname[ucslenhost]=0; + *slash=c; + while ((dirp = getnextdirent (ih, vfatname, &st))) + { + if (checkname (ucsname, ucslenhost, dirp, vfatname)) + { + for (;*ptr && *ptr!='/';ptr++); + if (!*ptr) + return dirp; + ptr++; + if (!*ptr) + return dirp; + for (slash=ptr;*slash && *slash!='/';slash++); + c=*slash; + *slash=0; + utf_decodestr (ptr, ucsname, &ucslen, WIN_MAXLEN, OSLittleEndian); + ucslenhost = OSReadLittleInt16 (&ucslen,0); + ucsname[ucslenhost]=0; + *slash=c; + if (!(dirp->deAttributes & ATTR_DIRECTORY)) + return 0; + st.root16 = 0; + st.vfatchecksum = 0; + st.nument = 0; + st.cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + if (msdosfatbits == 32) + st.cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + st.vfatnumber = 0; + } + } + return 0; +} + +long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + struct msdosdirstate *st; + struct direntry *dirp; + uint16_t vfatname[WIN_MAXLEN+2*WIN_CHARS]; + if (MSDOSInitPartition (ih)<0) + return -1; + if (dirPath[0] == '/') + dirPath++; + st = (struct msdosdirstate *)(long) *dirIndex; + if (!st) + { + st=malloc (sizeof (*st)); + if (dirPath[0]) + { + uint8_t *buf=malloc(msdosclustersize); + dirp = getdirpfrompath (ih, dirPath, buf); + if (!dirp || !(dirp->deAttributes & ATTR_DIRECTORY)) + { + free (buf); + free (st); + return -1; + } + st->buf = (struct direntry *)buf; + st->root16 = 0; + st->vfatchecksum = 0; + st->nument = 0; + st->cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + st->vfatnumber = 0; + if (msdosfatbits == 32) + st->cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + } + else + initRoot (st); + *dirIndex = (long long) (long) st; + } + while((dirp = getnextdirent (ih, vfatname, st))&& (dirp->deAttributes & ATTR_VOLUME)); + if (!dirp) + { + free (st->buf); + free (st); + return -1; + } + if (vfatname[0]) + { + int i; + for (i=0;vfatname[i];i++); + *name = malloc (256); + utf_encodestr(vfatname, i, (u_int8_t *)*name, 255, OSLittleEndian ); + } + else + { + int i, j, k; + uint16_t tmp[13]; + *name = malloc (26); + for (i=7;i>=0;i--) + if (dirp->deName[i]!=' ') + break; + j=i+1; + tmp[i+1]=0; + for(;i>=0;i--) + tmp[i]=(dirp->deName[i]>=128)?cp850[dirp->deName[i]-128][0]:tolower(dirp->deName[i]); + for (i=2;i>=0;i--) + if (dirp->deName[8+i]!=' ') + break; + + if (i>=0) + { + tmp[j++]='.'; + tmp[j+i+1]=0; + k=j+i+1; + for(;i>=0;i--) + tmp[j+i]=(dirp->deName[i]>=128)?cp850[dirp->deName[i+8]-128][0]:tolower(dirp->deName[i+8]); + j=k; + } + + utf_encodestr(tmp, j, (uint8_t*)*name, 25, OSHostByteOrder() ); + } + if (dirp->deAttributes & ATTR_DIRECTORY) + *flags = kFileTypeDirectory; + else + *flags = kFileTypeFlat; + + // Calculate a fake timestamp using modification date and time values. + *time = (dirp->deMDate & 0x7FFF) << 16 + dirp->deMTime; + + if (infoValid) + *infoValid = 1; + + return 0; +} + +long +MSDOSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length) +{ + uint8_t *buf; + off_t cluster; + uint64_t size; + uint64_t nskip; + int toread, wastoread; + char *ptr = (char *)base; + struct direntry *dirp; + int i; + char devStr[12]; + + if (MSDOSInitPartition (ih)<0) + return -1; + if (filePath[0] == '/') + filePath++; + buf = malloc(msdosclustersize); + dirp = getdirpfrompath (ih, filePath, buf); + + if (!dirp || (dirp->deAttributes & ATTR_DIRECTORY)) + { + free (buf); + return -1; + } + cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + if (msdosfatbits == 32) + cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + size = (uint32_t)OSReadLittleInt32 ((dirp->deFileSize),0); + if (size<=offset) + return -1; + nskip=offset/msdosclustersize; + for (i=0;i<nskip;i++) + msdosreadcluster (ih, 0, 0, &cluster); + msdosreadcluster (ih, buf, msdosclustersize, &cluster); + toread=length; + if (length==0 || length>size-offset) + toread=size-offset; + wastoread=toread; + bcopy (buf+(offset%msdosclustersize),ptr,MIN(msdosclustersize-(offset%msdosclustersize), toread)); + ptr+=msdosclustersize-(offset%msdosclustersize); + toread-=msdosclustersize-(offset%msdosclustersize); + while (toread>0 && msdosreadcluster (ih, (uint8_t *)ptr, MIN(msdosclustersize,toread), &cluster)) + { + ptr+=msdosclustersize; + toread-=msdosclustersize; + } + + getDeviceDescription(ih, devStr); + verbose("Read FAT%d file: [%s/%s] %d bytes.\n", + msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread); + free (buf); + if (toread<0) + return wastoread; + else + return wastoread-toread; +} + +long +MSDOSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock) +{ + uint8_t *buf; + off_t cluster; + struct direntry *dirp; + if (MSDOSInitPartition (ih)<0) + return -1; + if (filePath[0] == '/') + filePath++; + buf = malloc(msdosclustersize); + dirp = getdirpfrompath (ih, filePath, buf); + if (!dirp || (dirp->deAttributes & ATTR_DIRECTORY)) + { + free (buf); + return -1; + } + cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + if (msdosfatbits == 32) + cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + + off_t clusn; + + switch (msdosfatbits) { + case 32: + if (cluster < CLUST_FIRST ||cluster >= CLUST_RSRVD32) + return -1; + clusn = cluster - CLUST_FIRST; + break; + case 16: + if (cluster < CLUST_FIRST ||cluster >= CLUST_RSRVD16) + return 0; + clusn = cluster - CLUST_FIRST; + break; + case 12: + + if (cluster < CLUST_FIRST ||cluster >= CLUST_RSRVD12) + return 0; + clusn = cluster - CLUST_FIRST; + break; + default: + return 0; + } + + *firstBlock = ((msdosressector + + (msdosnfats * msdosfatsecs))*msdosbps + clusn * msdosclustersize)/512; + free (buf); + return 0; +} + + +long MSDOSLoadFile(CICell ih, char * filePath) +{ + return MSDOSReadFile(ih, filePath, (void *)gFSLoadAddress, 0, 0); +} + +/* Fix up volume label. */ +static void +fixLabel(uint8_t *label, char *str, long strMaxLen) +{ + int i, len; + uint16_t labelucs[13]; + //unsigned char labelUTF8[LABEL_LENGTH*3]; + + /* Convert leading 0x05 to 0xE5 for multibyte languages like Japanese */ + if (label[0] == 0x05) + label[0] = 0xE5; + + /* Remove any trailing spaces */ + for (i=LABEL_LENGTH-1; i>=0; --i) { + if (label[i] == ' ') + label[i] = 0; + else + break; + } + labelucs[i++]=0; + len=i; + for (;i>=0;--i) + labelucs[i]=label[i]>=128?cp850[label[i]-128][1]:(label[i]); + + utf_encodestr(labelucs, len, (uint8_t *)str, strMaxLen, OSHostByteOrder() ); +} + + +void +MSDOSGetDescription(CICell ih, char *str, long strMaxLen) +{ + struct direntry *dirp; + uint8_t label[LABEL_LENGTH+1]; + uint16_t vfatlabel[WIN_MAXLEN+2*WIN_CHARS]; + struct msdosdirstate st; + int labelfound = 0; + + if (MSDOSInitPartition (ih)<0) + { + str[0]=0; + return; + } + + label[0] = '\0'; + + initRoot (&st); + st.buf = malloc(msdosclustersize); + while ((dirp = getnextdirent (ih, vfatlabel, &st))) + if (dirp->deAttributes & ATTR_VOLUME) { + strncpy((char *)label, (char *)dirp->deName, LABEL_LENGTH); + labelfound = 1; + break; + } + + free(st.buf); + + if (vfatlabel[0] && labelfound) + { + int i; + for (i=0;vfatlabel[i];i++); + utf_encodestr(vfatlabel, i, (u_int8_t *)str, strMaxLen, OSLittleEndian ); + } + else if (labelfound) + fixLabel(label, str, strMaxLen); + + /* else look in the boot blocks */ + if (!labelfound || str[0] == '\0') { + char *buf = malloc (512); + union bootsector *bsp = (union bootsector *)buf; + Seek(ih, 0); + Read(ih, (long)buf, 512); + if (msdosfatbits == 32) { /* It's FAT32 */ + strncpy((char *)label, (char *)((struct extboot *)bsp->bs710.bsExt)->exVolumeLabel, LABEL_LENGTH); + } + else if (msdosfatbits == 16) { + strncpy((char *)label, (char *)((struct extboot *)bsp->bs50.bsExt)->exVolumeLabel, LABEL_LENGTH); + } + free (buf); + fixLabel(label, str, strMaxLen); + } + + return; +} + +long +MSDOSGetUUID(CICell ih, char *uuidStr) +{ + char *buf = malloc (512); + union bootsector *bsp = (union bootsector *)buf; + + if (MSDOSInitPartition (ih)<0) + { + return -1; + } + bzero (uuidStr, 16); + Seek(ih, 0); + Read(ih, (long)buf, 512); + if (msdosfatbits == 32) { /* It's FAT32 */ + memcpy(uuidStr+12, (char *)((struct extboot *)bsp->bs710.bsExt)->exVolumeID, 4); + } + else if (msdosfatbits == 16) { + memcpy(uuidStr+12, (char *)((struct extboot *)bsp->bs50.bsExt)->exVolumeID, 4); + } + free (buf); + return 0; + +} diff --git a/i386/libsaio/.svn/text-base/msdos.h.svn-base b/i386/libsaio/.svn/text-base/msdos.h.svn-base new file mode 100644 index 0000000..2526d93 --- /dev/null +++ b/i386/libsaio/.svn/text-base/msdos.h.svn-base @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern void MSDOSGetDescription(CICell ih, char *str, long strMaxLen); +extern long MSDOSInitPartition(CICell ih); +extern long MSDOSLoadFile(CICell ih, char * filePath); +extern long MSDOSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length); +extern long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +extern long MSDOSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); +extern long MSDOSGetUUID(CICell ih, char *uuidStr); +extern void MSDOSFree(CICell ih); +extern int MSDOSProbe (const void *buf); diff --git a/i386/libsaio/.svn/text-base/msdos_private.h.svn-base b/i386/libsaio/.svn/text-base/msdos_private.h.svn-base new file mode 100644 index 0000000..fca1ff8 --- /dev/null +++ b/i386/libsaio/.svn/text-base/msdos_private.h.svn-base @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Written by Paul Popelka (paulp@uts.amdahl.com) + * + * You can do anything you want with this software, just don't say you wrote + * it, and don't remove this notice. + * + * This software is provided "as is". + * + * The author supplies this software to be publicly redistributed on the + * understanding that the author is not responsible for the correct + * functioning of this software in any circumstances and is not liable for + * any damages caused by this software. + * + * October 1992 + */ + +/* + * Format of a boot sector. This is the first sector on a DOS floppy disk + * or the fist sector of a partition on a hard disk. But, it is not the + * first sector of a partitioned hard disk. + */ +struct bootsector33 { + u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + int8_t bsOemName[8]; /* OEM name and version */ + int8_t bsBPB[19]; /* BIOS parameter block */ + int8_t bsDriveNumber; /* drive number (0x80) */ + int8_t bsBootCode[479]; /* pad so struct is 512b */ + u_int8_t bsBootSectSig0; + u_int8_t bsBootSectSig1; +#define BOOTSIG0 0x55 +#define BOOTSIG1 0xaa +}; + +struct extboot { + int8_t exDriveNumber; /* drive number (0x80) */ + int8_t exReserved1; /* reserved */ + int8_t exBootSignature; /* ext. boot signature (0x29) */ +#define EXBOOTSIG 0x29 + int8_t exVolumeID[4]; /* volume ID number */ + int8_t exVolumeLabel[11]; /* volume label */ + int8_t exFileSysType[8]; /* fs type (FAT12 or FAT16) */ +}; + +struct bootsector50 { + u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + int8_t bsOemName[8]; /* OEM name and version */ + int8_t bsBPB[25]; /* BIOS parameter block */ + int8_t bsExt[26]; /* Bootsector Extension */ + int8_t bsBootCode[448]; /* pad so structure is 512b */ + u_int8_t bsBootSectSig0; + u_int8_t bsBootSectSig1; +#define BOOTSIG0 0x55 +#define BOOTSIG1 0xaa +}; + +struct bootsector710 { + u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + int8_t bsOEMName[8]; /* OEM name and version */ + int8_t bsBPB[53]; /* BIOS parameter block */ + int8_t bsExt[26]; /* Bootsector Extension */ + int8_t bsBootCode[420]; /* pad so structure is 512b */ + u_int8_t bsBootSectSig0; + u_int8_t bsBootSectSig1; +#define BOOTSIG0 0x55 +#define BOOTSIG1 0xaa +}; + +union bootsector { + struct bootsector33 bs33; + struct bootsector50 bs50; + struct bootsector710 bs710; +}; + + +/* BPB */ + +/* + * BIOS Parameter Block (BPB) for DOS 3.3 + */ +struct bpb33 { + u_int16_t bpbBytesPerSec; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int16_t bpbResSectors; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int16_t bpbRootDirEnts; /* number of root directory entries */ + u_int16_t bpbSectors; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int16_t bpbFATsecs; /* number of sectors per FAT */ + u_int16_t bpbSecPerTrack; /* sectors per track */ + u_int16_t bpbHeads; /* number of heads */ + u_int16_t bpbHiddenSecs; /* number of hidden sectors */ +} __attribute__((packed)); + +/* + * BPB for DOS 5.0 The difference is bpbHiddenSecs is a short for DOS 3.3, + * and bpbHugeSectors is not in the 3.3 bpb. + */ +struct bpb50 { + u_int16_t bpbBytesPerSec; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int16_t bpbResSectors; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int16_t bpbRootDirEnts; /* number of root directory entries */ + u_int16_t bpbSectors; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int16_t bpbFATsecs; /* number of sectors per FAT */ + u_int16_t bpbSecPerTrack; /* sectors per track */ + u_int16_t bpbHeads; /* number of heads */ + u_int32_t bpbHiddenSecs; /* # of hidden sectors */ + u_int32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ +} __attribute__((packed)); + +/* + * BPB for DOS 7.10 (FAT32). This one has a few extensions to bpb50. + */ +struct bpb710 { + u_int16_t bpbBytesPerSec; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int16_t bpbResSectors; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int16_t bpbRootDirEnts; /* number of root directory entries */ + u_int16_t bpbSectors; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int16_t bpbFATsecs; /* number of sectors per FAT */ + u_int16_t bpbSecPerTrack; /* sectors per track */ + u_int16_t bpbHeads; /* number of heads */ + u_int32_t bpbHiddenSecs; /* # of hidden sectors */ + u_int32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ + u_int32_t bpbBigFATsecs; /* like bpbFATsecs for FAT32 */ + u_int16_t bpbExtFlags; /* extended flags: */ +#define FATNUM 0xf /* mask for numbering active FAT */ +#define FATMIRROR 0x80 /* FAT is mirrored (like it always was) */ + u_int16_t bpbFSVers; /* filesystem version */ +#define FSVERS 0 /* currently only 0 is understood */ + u_int32_t bpbRootClust; /* start cluster for root directory */ + u_int16_t bpbFSInfo; /* filesystem info structure sector */ + u_int16_t bpbBackup; /* backup boot sector */ + /* There is a 12 byte filler here, but we ignore it */ +} __attribute__((packed)); + +#if 0 +/* + * BIOS Parameter Block (BPB) for DOS 3.3 + */ +struct byte_bpb33 { + int8_t bpbBytesPerSec[2]; /* bytes per sector */ + int8_t bpbSecPerClust; /* sectors per cluster */ + int8_t bpbResSectors[2]; /* number of reserved sectors */ + int8_t bpbFATs; /* number of FATs */ + int8_t bpbRootDirEnts[2]; /* number of root directory entries */ + int8_t bpbSectors[2]; /* total number of sectors */ + int8_t bpbMedia; /* media descriptor */ + int8_t bpbFATsecs[2]; /* number of sectors per FAT */ + int8_t bpbSecPerTrack[2]; /* sectors per track */ + int8_t bpbHeads[2]; /* number of heads */ + int8_t bpbHiddenSecs[2]; /* number of hidden sectors */ +}; + +/* + * BPB for DOS 5.0 The difference is bpbHiddenSecs is a short for DOS 3.3, + * and bpbHugeSectors is not in the 3.3 bpb. + */ +struct byte_bpb50 { + int8_t bpbBytesPerSec[2]; /* bytes per sector */ + int8_t bpbSecPerClust; /* sectors per cluster */ + int8_t bpbResSectors[2]; /* number of reserved sectors */ + int8_t bpbFATs; /* number of FATs */ + int8_t bpbRootDirEnts[2]; /* number of root directory entries */ + int8_t bpbSectors[2]; /* total number of sectors */ + int8_t bpbMedia; /* media descriptor */ + int8_t bpbFATsecs[2]; /* number of sectors per FAT */ + int8_t bpbSecPerTrack[2]; /* sectors per track */ + int8_t bpbHeads[2]; /* number of heads */ + int8_t bpbHiddenSecs[4]; /* number of hidden sectors */ + int8_t bpbHugeSectors[4]; /* # of sectors if bpbSectors == 0 */ +}; + +/* + * BPB for DOS 7.10 (FAT32). This one has a few extensions to bpb50. + */ +struct byte_bpb710 { + u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int8_t bpbResSectors[2]; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int8_t bpbRootDirEnts[2]; /* number of root directory entries */ + u_int8_t bpbSectors[2]; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int8_t bpbFATsecs[2]; /* number of sectors per FAT */ + u_int8_t bpbSecPerTrack[2]; /* sectors per track */ + u_int8_t bpbHeads[2]; /* number of heads */ + u_int8_t bpbHiddenSecs[4]; /* # of hidden sectors */ + u_int8_t bpbHugeSectors[4]; /* # of sectors if bpbSectors == 0 */ + u_int8_t bpbBigFATsecs[4]; /* like bpbFATsecs for FAT32 */ + u_int8_t bpbExtFlags[2]; /* extended flags: */ + u_int8_t bpbFSVers[2]; /* filesystem version */ + u_int8_t bpbRootClust[4]; /* start cluster for root directory */ + u_int8_t bpbFSInfo[2]; /* filesystem info structure sector */ + u_int8_t bpbBackup[2]; /* backup boot sector */ + /* There is a 12 byte filler here, but we ignore it */ +}; +#endif + +/* + * FAT32 FSInfo block. + */ +struct fsinfo { + u_int8_t fsisig1[4]; + u_int8_t fsifill1[480]; + u_int8_t fsisig2[4]; + u_int8_t fsinfree[4]; + u_int8_t fsinxtfree[4]; + u_int8_t fsifill2[12]; + u_int8_t fsisig3[4]; +}; + + +/* direntry */ + +/*- + * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. + * Copyright (C) 1994, 1995, 1997 TooLs GmbH. + * All rights reserved. + * Original code by Paul Popelka (paulp@uts.amdahl.com) (see above). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Structure of a dos directory entry. + */ +struct direntry { + u_int8_t deName[8]; /* filename, blank filled */ +#define SLOT_EMPTY 0x00 /* slot has never been used */ +#define SLOT_E5 0x05 /* the real value is 0xe5 */ +#define SLOT_DELETED 0xe5 /* file in this slot deleted */ + u_int8_t deExtension[3]; /* extension, blank filled */ + u_int8_t deAttributes; /* file attributes */ +#define ATTR_NORMAL 0x00 /* normal file */ +#define ATTR_READONLY 0x01 /* file is read-only (immutable) */ +#define ATTR_HIDDEN 0x02 /* file is hidden */ +#define ATTR_SYSTEM 0x04 /* file is a system file */ +#define ATTR_VOLUME 0x08 /* entry is a volume label */ +#define ATTR_DIRECTORY 0x10 /* entry is a directory name */ +#define ATTR_ARCHIVE 0x20 /* file is new or modified */ + u_int8_t deLowerCase; /* NT VFAT lower case flags */ +#define LCASE_BASE 0x08 /* filename base in lower case */ +#define LCASE_EXT 0x10 /* filename extension in lower case */ + u_int8_t deCHundredth; /* hundredth of seconds in CTime */ + u_int8_t deCTime[2]; /* create time */ + u_int8_t deCDate[2]; /* create date */ + u_int8_t deADate[2]; /* access date */ + u_int8_t deHighClust[2]; /* high bytes of cluster number */ + u_int16_t deMTime; /* last update time */ + u_int16_t deMDate; /* last update date */ + u_int8_t deStartCluster[2]; /* starting cluster of file */ + u_int8_t deFileSize[4]; /* size of file in bytes */ +}; + +/* + * Structure of a Win95 long name directory entry + */ +struct winentry { + u_int8_t weCnt; +#define WIN_LAST 0x40 +#define WIN_CNT 0x3f + u_int8_t wePart1[10]; + u_int8_t weAttributes; +#define ATTR_WIN95 0x0f + u_int8_t weReserved1; + u_int8_t weChksum; + u_int8_t wePart2[12]; + u_int16_t weReserved2; + u_int8_t wePart3[4]; +}; +#define WIN_CHARS 13 /* Number of chars per winentry */ + +/* + * Maximum filename length in Win95 + * Note: Must be < sizeof(dirent.d_name) + */ +#define WIN_MAXLEN 255 + +/* + * This is the format of the contents of the deTime field in the direntry + * structure. + * We don't use bitfields because we don't know how compilers for + * arbitrary machines will lay them out. + */ +#define DT_2SECONDS_MASK 0x1F /* seconds divided by 2 */ +#define DT_2SECONDS_SHIFT 0 +#define DT_MINUTES_MASK 0x7E0 /* minutes */ +#define DT_MINUTES_SHIFT 5 +#define DT_HOURS_MASK 0xF800 /* hours */ +#define DT_HOURS_SHIFT 11 + +/* + * This is the format of the contents of the deDate field in the direntry + * structure. + */ +#define DD_DAY_MASK 0x1F /* day of month */ +#define DD_DAY_SHIFT 0 +#define DD_MONTH_MASK 0x1E0 /* month */ +#define DD_MONTH_SHIFT 5 +#define DD_YEAR_MASK 0xFE00 /* year - 1980 */ +#define DD_YEAR_SHIFT 9 + diff --git a/i386/libsaio/.svn/text-base/nbp.c.svn-base b/i386/libsaio/.svn/text-base/nbp.c.svn-base new file mode 100644 index 0000000..853efe4 --- /dev/null +++ b/i386/libsaio/.svn/text-base/nbp.c.svn-base @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "libsaio.h" + +/* This NBP code is pretty useless because it just blindly calls INT 2B. + Presumably INT 2B was implemented by some first-stage bootloader that + is long gone. + + One good reason to disable this is that nbpScanBootVolumes always + succeeds. The scanBootVolumes function thus never fails because + it always falls back to NBP. This is a problem because there is + other code in the booter (for example, in open) which needs to + fail instead of attempting to use this NBP which will often + hang the machine. + */ +#ifndef NBP_SUPPORT +#define NBP_SUPPORT 0 +#endif + +#if NBP_SUPPORT + +/* + * Convert zero-based linear address to far pointer. + */ +#define GET_FP(x) ( (((x) & 0xffff0000) << (16 - 4)) | ((x) & 0xffff) ) + +/*========================================================================== + * Issue a command to the network loader. + * + * The 'cmd' command structure should be allocated on the stack to + * ensure that it resides within the addressable range for the + * network loader, which runs in real mode. + */ +static UInt32 nbp(nbpCommandCode_t code, nbpCommand_u * cmd) +{ + loader(code, GET_FP((UInt32) cmd)); + + // Must re-enable the A20 address line, the PXE firmware will + // disable the A20 line control. + // + enableA20(); + + return cmd->header.status; +} + +/*========================================================================== + * Unload Base Code Stack command. + */ +UInt32 nbpUnloadBaseCode() +{ + return nbp(nbpCommandUnloadBaseCode, (nbpCommand_u *) 0); +} + +/*========================================================================== + * TFTP Read File command. + */ +static long NBPLoadFile(CICell ih, char * filePath) +{ + nbpCommandTFTPReadFile_s cmd; + UInt32 ret; + + strcpy((char *)cmd.filename, filePath); + cmd.status = nbpStatusFailed; + cmd.bufferSize = TFTP_LEN; + cmd.buffer = TFTP_ADDR; + + verbose("Loading file: %s\n", filePath); + + ret = nbp(nbpCommandTFTPReadFile, (nbpCommand_u *) &cmd); + + return (ret == nbpStatusSuccess) ? (long)cmd.bufferSize : -1; +} + +/*========================================================================== + * GetDirEntry is not supported. + */ +static long NBPGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + return -1; +} + +//========================================================================== + +static void NBPGetDescription(CICell ih, char * str, long strMaxLen) +{ + sprintf( str, "Ethernet PXE Client" ); +} + +//========================================================================== + +BVRef nbpScanBootVolumes( int biosdev, int * countPtr ) +{ + static BVRef gNetBVR = NULL; + + if ( countPtr ) *countPtr = 1; + + if ( !gNetBVR ) + { + gNetBVR = malloc( sizeof(*gNetBVR) ); + if ( gNetBVR ) + { + bzero(gNetBVR, sizeof(*gNetBVR)); + gNetBVR->biosdev = biosdev; + gNetBVR->flags = kBVFlagPrimary | kBVFlagNativeBoot; + gNetBVR->description = NBPGetDescription; + gNetBVR->fs_loadfile = NBPLoadFile; + gNetBVR->fs_getdirentry = NBPGetDirEntry; + } + } + return gNetBVR; +} +#else +BVRef nbpScanBootVolumes( int biosdev, int * countPtr ) +{ + return NULL; +} +UInt32 nbpUnloadBaseCode() +{ + return 0; +} +#endif diff --git a/i386/libsaio/.svn/text-base/nbp_cmd.h.svn-base b/i386/libsaio/.svn/text-base/nbp_cmd.h.svn-base new file mode 100644 index 0000000..1b3585d --- /dev/null +++ b/i386/libsaio/.svn/text-base/nbp_cmd.h.svn-base @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_NBP_CMD_H +#define __LIBSAIO_NBP_CMD_H + +#include <IOKit/IOTypes.h> + +/*========================================================================== + * NBP return status codes. + */ +typedef enum { + nbpStatusSuccess = 0, + nbpStatusFailed, + nbpStatusInvalid, +} nbpStatus_t; + +/*========================================================================== + * NBP commands codes. + */ +typedef enum { + nbpCommandTFTPReadFile = 1, + nbpCommandTFTPGetFileSize, + nbpCommandUnloadBaseCode, +} nbpCommandCode_t; + +/*========================================================================== + * NBP commands. + */ +typedef struct { + UInt32 status; /* return code from NBP */ +} nbpCommandHeader_s; + +typedef struct { + UInt32 status; /* return code from NBP */ + UInt8 filename[128]; /* name of file to be downloaded */ + UInt32 bufferSize; /* size of the download buffer */ + UInt32 buffer; /* physical address of the download buffer */ +} nbpCommandTFTPReadFile_s; + +typedef struct { + UInt32 status; /* return code from NBP */ + UInt8 filename[128]; /* name of file to be downloaded */ + UInt32 filesize; /* size of the file specified */ +} nbpCommandTFTPGetFileSize_s; + +typedef struct { + UInt32 status; /* return code from NBP */ + UInt8 sname[64]; /* server name */ + UInt32 CIP; /* client IP address */ + UInt32 SIP; /* server IP address */ + UInt32 GIP; /* gateway IP address */ +} nbpCommandGetNetworkInfo_s; + +/*========================================================================== + * An union of all NBP command structures. + */ +typedef union { + nbpCommandHeader_s header; + nbpCommandTFTPReadFile_s tftpReadFile; + nbpCommandTFTPGetFileSize_s tftpFileSize; +} nbpCommand_u; + +#endif /* !__LIBSAIO_NBP_CMD_H */ diff --git a/i386/libsaio/.svn/text-base/ntfs.c.svn-base b/i386/libsaio/.svn/text-base/ntfs.c.svn-base new file mode 100644 index 0000000..05fda3f --- /dev/null +++ b/i386/libsaio/.svn/text-base/ntfs.c.svn-base @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2004 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "libsaio.h" +#include "sl.h" + +/* + * dmazar, 14/7/2011 - support for EXFAT volume label reading + */ +#include "exfat.h" + +#define BYTE_ORDER_MARK 0xFEFF + +#include "ntfs_private.h" + +#define FS_TYPE "ntfs" +#define FS_NAME_FILE "NTFS" + +#define MAX_BLOCK_SIZE 2048 +#define MAX_CLUSTER_SIZE 32768 + +#define LABEL_LENGTH 1024 +#define UNKNOWN_LABEL "Untitled NTFS" + +#define FSUR_IO_FAIL -1 +#define FSUR_UNRECOGNIZED -1 +#define FSUR_RECOGNIZED 0 + +#define ERROR -1 + +/* + * Process per-sector "fixups" that NTFS uses to detect corruption of + * multi-sector data structures, like MFT records. + */ +static int +ntfs_fixup( + char *buf, + size_t len, + u_int32_t magic, + u_int32_t bytesPerSector) +{ + struct fixuphdr *fhp = (struct fixuphdr *) buf; + int i; + u_int16_t fixup; + u_int16_t *fxp; + u_int16_t *cfxp; + u_int32_t fixup_magic; + u_int16_t fixup_count; + u_int16_t fixup_offset; + + fixup_magic = OSReadLittleInt32(&fhp->fh_magic,0); + if (fixup_magic != magic) { + error("ntfs_fixup: magic doesn't match: %08x != %08x\n", + fixup_magic, magic); + return (ERROR); + } + fixup_count = OSReadLittleInt16(&fhp->fh_fnum,0); + if ((fixup_count - 1) * bytesPerSector != len) { + error("ntfs_fixup: " \ + "bad fixups number: %d for %ld bytes block\n", + fixup_count, (long)len); /* XXX printf kludge */ + return (ERROR); + } + fixup_offset = OSReadLittleInt16(&fhp->fh_foff,0); + if (fixup_offset >= len) { + error("ntfs_fixup: invalid offset: %x", fixup_offset); + return (ERROR); + } + fxp = (u_int16_t *) (buf + fixup_offset); + cfxp = (u_int16_t *) (buf + bytesPerSector - 2); + fixup = *fxp++; + for (i = 1; i < fixup_count; i++, fxp++) { + if (*cfxp != fixup) { + error("ntfs_fixup: fixup %d doesn't match\n", i); + return (ERROR); + } + *cfxp = *fxp; + cfxp = (u_int16_t *)(((caddr_t)cfxp) + bytesPerSector); + } + return (0); +} + +/* + * Find a resident attribute of a given type. Returns a pointer to the + * attribute data, and its size in bytes. + */ +static int +ntfs_find_attr( + char *buf, + u_int32_t attrType, + void **attrData, + size_t *attrSize) +{ + struct filerec *filerec; + struct attr *attr; + u_int16_t offset; + + filerec = (struct filerec *) buf; + offset = OSReadLittleInt16(&filerec->fr_attroff,0); + attr = (struct attr *) (buf + offset); + + /* Should we also check offset < buffer size? */ + while (attr->a_hdr.a_type != 0xFFFFFFFF) /* same for big/little endian */ + { + if (OSReadLittleInt32(&attr->a_hdr.a_type,0) == attrType) + { + if (attr->a_hdr.a_flag != 0) + { + //verbose("NTFS: attriubte 0x%X is non-resident\n", attrType); + return 1; + } + + *attrSize = OSReadLittleInt16(&attr->a_r.a_datalen,0); + *attrData = buf + offset + OSReadLittleInt16(&attr->a_r.a_dataoff,0); + return 0; /* found it! */ + } + + /* Skip to the next attribute */ + offset += OSReadLittleInt32(&attr->a_hdr.reclen,0); + attr = (struct attr *) (buf + offset); + } + + return 1; /* No matching attrType found */ +} + +/* + * Examine a volume to see if we recognize it as a mountable. + */ +void +NTFSGetDescription(CICell ih, char *str, long strMaxLen) +{ + struct bootfile *boot; + unsigned bytesPerSector; + unsigned sectorsPerCluster; + int mftRecordSize; + u_int64_t totalClusters; + u_int64_t cluster, mftCluster; + size_t mftOffset; + void *nameAttr; + size_t nameSize; + char *buf; + + buf = (char *)malloc(MAX_CLUSTER_SIZE); + if (buf == 0) { + goto error; + } + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + boot = (struct bootfile *) buf; + + /* + * The first three bytes are an Intel x86 jump instruction. I assume it + * can be the same forms as DOS FAT: + * 0xE9 0x?? 0x?? + * 0xEC 0x?? 0x90 + * where 0x?? means any byte value is OK. + */ + if (boot->reserved1[0] != 0xE9 + && (boot->reserved1[0] != 0xEB || boot->reserved1[2] != 0x90)) + { + goto error; + } + + /* + * Check the "NTFS " signature. + */ + if (memcmp((const char *)boot->bf_sysid, "NTFS ", 8) != 0) + { + /* + * Check for EXFAT. Finish by jumping to error to free buf, + * although if it is EXFAT then it's no an error. + */ + EXFATGetDescription(ih, str, strMaxLen); + goto error; + } + + /* + * Make sure the bytes per sector and sectors per cluster are + * powers of two, and within reasonable ranges. + */ + bytesPerSector = OSReadLittleInt16(&boot->bf_bps,0); + if ((bytesPerSector & (bytesPerSector-1)) || bytesPerSector < 512 || bytesPerSector > 32768) + { + //verbose("NTFS: invalid bytes per sector (%d)\n", bytesPerSector); + goto error; + } + + sectorsPerCluster = boot->bf_spc; /* Just one byte; no swapping needed */ + if ((sectorsPerCluster & (sectorsPerCluster-1)) || sectorsPerCluster > 128) + { + //verbose("NTFS: invalid sectors per cluster (%d)\n", bytesPerSector); + goto error; + } + + /* + * Calculate the number of clusters from the number of sectors. + * Then bounds check the $MFT and $MFTMirr clusters. + */ + totalClusters = OSReadLittleInt64(&boot->bf_spv,0) / sectorsPerCluster; + mftCluster = OSReadLittleInt64(&boot->bf_mftcn,0); + if (mftCluster > totalClusters) + { + ////verbose("NTFS: invalid $MFT cluster (%lld)\n", mftCluster); + goto error; + } + cluster = OSReadLittleInt64(&boot->bf_mftmirrcn,0); + if (cluster > totalClusters) + { + //verbose("NTFS: invalid $MFTMirr cluster (%lld)\n", cluster); + goto error; + } + + /* + * Determine the size of an MFT record. + */ + mftRecordSize = (int8_t) boot->bf_mftrecsz; + if (mftRecordSize < 0) + mftRecordSize = 1 << -mftRecordSize; + else + mftRecordSize *= bytesPerSector * sectorsPerCluster; + //verbose("NTFS: MFT record size = %d\n", mftRecordSize); + + /* + * Read the MFT record for $Volume. This assumes the first four + * file records in the MFT are contiguous; if they aren't, we + * would have to map the $MFT itself. + * + * This will fail if the device sector size is larger than the + * MFT record size, since the $Volume record won't be aligned + * on a sector boundary. + */ + mftOffset = mftCluster * sectorsPerCluster * bytesPerSector; + mftOffset += mftRecordSize * NTFS_VOLUMEINO; + + Seek(ih, mftOffset); + Read(ih, (long)buf, mftRecordSize); +#if UNUSED + if (lseek(fd, mftOffset, SEEK_SET) == -1) + { + //verbose("NTFS: lseek to $Volume failed: %s\n", strerror(errno)); + goto error; + } + if (read(fd, buf, mftRecordSize) != mftRecordSize) + { + //verbose("NTFS: error reading MFT $Volume record: %s\n", + strerror(errno)); + goto error; + } +#endif + + if (ntfs_fixup(buf, mftRecordSize, NTFS_FILEMAGIC, bytesPerSector) != 0) + { + //verbose("NTFS: block fixup failed\n"); + goto error; + } + + /* + * Loop over the attributes, looking for $VOLUME_NAME (0x60). + */ + if(ntfs_find_attr(buf, NTFS_A_VOLUMENAME, &nameAttr, &nameSize) != 0) + { + //verbose("NTFS: $VOLUME_NAME attribute not found\n"); + goto error; + } + + str[0] = '\0'; + + utf_encodestr( nameAttr, nameSize / 2, (u_int8_t *)str, strMaxLen, OSLittleEndian ); + + free(buf); + return; + + error: + if (buf) free(buf); + return; +} + +long NTFSGetUUID(CICell ih, char *uuidStr) +{ + bool NTFSProbe(const void*); + + struct bootfile *boot; + void *buf = malloc(MAX_BLOCK_SIZE); + if ( !buf ) + return -1; + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + boot = (struct bootfile *) buf; + + // Check for NTFS signature + if ( memcmp((void*)boot->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) != 0 ) { + // If not NTFS, maybe it is EXFAT + return EXFATGetUUID(ih, uuidStr); + } + + // Check for non-null volume serial number + if( !boot->bf_volsn ) + return -1; + + // Use UUID like the one you get on Windows + sprintf(uuidStr, "%04X-%04X", (unsigned short)(boot->bf_volsn >> 16) & 0xFFFF, + (unsigned short)boot->bf_volsn & 0xFFFF); + + return 0; +} + +bool NTFSProbe(const void * buffer) +{ + bool result = false; + + const struct bootfile * part_bootfile = buffer; // NTFS boot sector structure + + // Looking for NTFS signature. + if (strncmp((const char *)part_bootfile->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) == 0) + result = true; + + // If not NTFS, maybe it is EXFAT + if (!result) + result = EXFATProbe(buffer); + + return result; +} diff --git a/i386/libsaio/.svn/text-base/ntfs.h.svn-base b/i386/libsaio/.svn/text-base/ntfs.h.svn-base new file mode 100644 index 0000000..dac62ba --- /dev/null +++ b/i386/libsaio/.svn/text-base/ntfs.h.svn-base @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern void NTFSGetDescription(CICell ih, char *str, long strMaxLen); +extern bool NTFSProbe (const void *buf); +extern long NTFSGetUUID(CICell ih, char *uuidStr); diff --git a/i386/libsaio/.svn/text-base/ntfs_private.h.svn-base b/i386/libsaio/.svn/text-base/ntfs_private.h.svn-base new file mode 100644 index 0000000..127136f --- /dev/null +++ b/i386/libsaio/.svn/text-base/ntfs_private.h.svn-base @@ -0,0 +1,399 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: ntfs.h,v 1.9 1999/10/31 19:45:26 jdolecek Exp $ */ + +/*- + * Copyright (c) 1998, 1999 Semen Ustimenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/fs/ntfs/ntfs.h,v 1.14 2001/11/27 00:18:33 jhb Exp $ + */ + +/*#define NTFS_DEBUG 1*/ + +#ifdef APPLE +/* We're using FreeBSD style byte order macros in the source. */ +#include <libkern/OSByteOrder.h> +#define le16toh(x) OSSwapLittleToHostInt16(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) + +/* FreeBSD mutexes correspond to Darwin's simple locks */ +#define mtx_lock(lock) simple_lock(lock) +#define mtx_unlock(lock) simple_unlock(lock) +#define mtx_destroy(lock) /* Nothing. */ + +#define lockdestroy(lock) /* Nothing. */ + +#endif + +typedef u_int64_t cn_t; +typedef u_int16_t wchar; + +#pragma pack(1) +#define BBSIZE 1024 +#define BBOFF ((off_t)(0)) +#define BBLOCK ((daddr_t)(0)) +#define NTFS_MFTINO 0 +#define NTFS_VOLUMEINO 3 +#define NTFS_ATTRDEFINO 4 +#define NTFS_ROOTINO 5 +#define NTFS_BITMAPINO 6 +#define NTFS_BOOTINO 7 +#define NTFS_BADCLUSINO 8 +#define NTFS_UPCASEINO 10 +#define NTFS_MAXFILENAME 255 + +struct fixuphdr { + u_int32_t fh_magic; + u_int16_t fh_foff; + u_int16_t fh_fnum; +}; + +#define NTFS_AF_INRUN 0x00000001 +struct attrhdr { + u_int32_t a_type; + u_int32_t reclen; + u_int8_t a_flag; + u_int8_t a_namelen; + u_int8_t a_nameoff; + u_int8_t reserved1; + u_int8_t a_compression; + u_int8_t reserved2; + u_int16_t a_index; +}; +#define NTFS_A_STD 0x10 +#define NTFS_A_ATTRLIST 0x20 +#define NTFS_A_NAME 0x30 +#define NTFS_A_VOLUMENAME 0x60 +#define NTFS_A_DATA 0x80 +#define NTFS_A_INDXROOT 0x90 +#define NTFS_A_INDX 0xA0 +#define NTFS_A_INDXBITMAP 0xB0 + +#define NTFS_MAXATTRNAME 255 +struct attr { + struct attrhdr a_hdr; + union { + struct { + u_int16_t a_datalen; + u_int16_t reserved1; + u_int16_t a_dataoff; + u_int16_t a_indexed; + } a_S_r; + struct { + cn_t a_vcnstart; + cn_t a_vcnend; + u_int16_t a_dataoff; + u_int16_t a_compressalg; + u_int32_t reserved1; + u_int64_t a_allocated; + u_int64_t a_datalen; + u_int64_t a_initialized; + } a_S_nr; + } a_S; +}; +#define a_r a_S.a_S_r +#define a_nr a_S.a_S_nr + +typedef struct { + u_int64_t t_create; + u_int64_t t_write; + u_int64_t t_mftwrite; + u_int64_t t_access; +} ntfs_times_t; + +#define NTFS_FFLAG_RDONLY 0x01LL +#define NTFS_FFLAG_HIDDEN 0x02LL +#define NTFS_FFLAG_SYSTEM 0x04LL +#define NTFS_FFLAG_ARCHIVE 0x20LL +#define NTFS_FFLAG_COMPRESSED 0x0800LL +#define NTFS_FFLAG_DIR 0x10000000LL + +struct attr_name { + u_int32_t n_pnumber; /* Parent ntnode */ + u_int32_t reserved; + ntfs_times_t n_times; + u_int64_t n_size; + u_int64_t n_attrsz; + u_int64_t n_flag; + u_int8_t n_namelen; + u_int8_t n_nametype; + u_int16_t n_name[1]; +}; + +#define NTFS_IRFLAG_INDXALLOC 0x00000001 +struct attr_indexroot { + u_int32_t ir_unkn1; /* attribute type (0x30 for $FILE_NAME) */ + u_int32_t ir_unkn2; /* collation rule (0x01 for file names) */ + u_int32_t ir_size; /* size of index allocation entry */ + u_int32_t ir_unkn3; /* clusters per index record, and 3 bytes padding */ + u_int32_t ir_unkn4; /* (offset to first index entry?) always 0x10 */ + u_int32_t ir_datalen; /* (total size of index enties?) sizeof something */ + u_int32_t ir_allocated; /* (allocated size of index entries?) */ + u_int8_t ir_flag; /* 1=index allocation needed (large index) */ + u_int8_t ir_pad1; /* padding */ + u_int16_t ir_pad2; /* padding */ +}; + +struct attr_attrlist { + u_int32_t al_type; /* Attribute type */ + u_int16_t reclen; /* length of this entry */ + u_int8_t al_namelen; /* Attribute name len */ + u_int8_t al_nameoff; /* Name offset from entry start */ + u_int64_t al_vcnstart; /* VCN number */ + u_int32_t al_inumber; /* Parent ntnode */ + u_int32_t reserved; + u_int16_t al_index; /* Attribute index in MFT record */ + u_int16_t al_name[1]; /* Name */ +}; + +#define NTFS_INDXMAGIC (u_int32_t)(0x58444E49) +struct attr_indexalloc { + struct fixuphdr ia_fixup; + u_int64_t unknown1; + cn_t ia_bufcn; + u_int16_t ia_hdrsize; + u_int16_t unknown2; + u_int32_t ia_inuse; + u_int32_t ia_allocated; +}; + +#define NTFS_IEFLAG_SUBNODE 0x00000001 +#define NTFS_IEFLAG_LAST 0x00000002 + +struct attr_indexentry { + u_int32_t ie_number; + u_int32_t unknown1; + u_int16_t reclen; + u_int16_t ie_size; + u_int32_t ie_flag;/* 1 - has subnodes, 2 - last */ + u_int32_t ie_fpnumber; + u_int32_t unknown2; + ntfs_times_t ie_ftimes; + u_int64_t ie_fallocated; + u_int64_t ie_fsize; + u_int32_t ie_fflag; + u_int32_t unknown3; /* used by reparse points and external attributes? */ + u_int8_t ie_fnamelen; + u_int8_t ie_fnametype; + wchar ie_fname[NTFS_MAXFILENAME]; + /* cn_t ie_bufcn; buffer with subnodes */ +}; + +#define NTFS_FILEMAGIC (u_int32_t)(0x454C4946) +#define NTFS_FRFLAG_DIR 0x0002 +struct filerec { + struct fixuphdr fr_fixup; + u_int8_t reserved[8]; + u_int16_t fr_seqnum; /* Sequence number */ + u_int16_t fr_nlink; + u_int16_t fr_attroff; /* offset to attributes */ + u_int16_t fr_flags; /* 1-nonresident attr, 2-directory */ + u_int32_t fr_size;/* hdr + attributes */ + u_int32_t fr_allocated; /* allocated length of record */ + u_int64_t fr_mainrec; /* main record */ + u_int16_t fr_attrnum; /* maximum attr number + 1 ??? */ +}; + +#define NTFS_ATTRNAME_MAXLEN 0x40 +#define NTFS_ADFLAG_NONRES 0x0080 /* Attrib can be non resident */ +#define NTFS_ADFLAG_INDEX 0x0002 /* Attrib can be indexed */ +struct attrdef { + wchar ad_name[NTFS_ATTRNAME_MAXLEN]; + u_int32_t ad_type; + u_int32_t reserved1[2]; + u_int32_t ad_flag; + u_int64_t ad_minlen; + u_int64_t ad_maxlen; /* -1 for nonlimited */ +}; + +struct ntvattrdef { + char ad_name[0x40]; + int ad_namelen; + u_int32_t ad_type; +}; + +#define NTFS_BBID "NTFS " +#define NTFS_BBIDLEN 8 +struct bootfile { + u_int8_t reserved1[3]; /* asm jmp near ... */ + u_int8_t bf_sysid[8]; /* 'NTFS ' */ + u_int16_t bf_bps; /* bytes per sector */ + u_int8_t bf_spc; /* sectors per cluster */ + u_int8_t reserved2[7]; /* unused (zeroed) */ + u_int8_t bf_media; /* media desc. (0xF8) */ + u_int8_t reserved3[2]; + u_int16_t bf_spt; /* sectors per track */ + u_int16_t bf_heads; /* number of heads */ + u_int8_t reserver4[12]; + u_int64_t bf_spv; /* sectors per volume */ + cn_t bf_mftcn; /* $MFT cluster number */ + cn_t bf_mftmirrcn; /* $MFTMirr cn */ + u_int8_t bf_mftrecsz; /* MFT record size (clust) */ + /* 0xF6 inducates 1/4 */ + u_int8_t reserved5[3]; + u_int8_t bf_ibsz; /* index buffer size */ + u_int8_t reserved6[3]; + u_int64_t bf_volsn; /* volume ser. num. */ +}; + +/* + * Darwin's ntfs.util needs to include this file to get definitions + * for the on-disk structures. It doesn't need the ntfsmount structure. + * In fact, since it doesn't #define KERNEL, the struct netexport below + * won't be defined. + * + * So, I'm using #ifdef KERNEL around the things that are only relevant + * to the in-kernel implementation. + * + * I don't know if FreeBSD defines KERNEL, or if I need to use or + * invent a different conditional here. + */ +#ifdef KERNEL + +#define NTFS_SYSNODESNUM 0x0B +struct ntfsmount { + struct mount *ntm_mountp; /* filesystem vfs structure */ + struct bootfile ntm_bootfile; + dev_t ntm_dev; /* device mounted */ + struct vnode *ntm_devvp; /* block device mounted vnode */ + struct vnode *ntm_sysvn[NTFS_SYSNODESNUM]; + u_int32_t ntm_bpmftrec; + uid_t ntm_uid; + gid_t ntm_gid; + mode_t ntm_mode; + u_long ntm_flag; + cn_t ntm_cfree; + struct ntvattrdef *ntm_ad; /* attribute names are stored in native byte order */ + int ntm_adnum; + wchar * ntm_82u; /* 8bit to Unicode */ + char ** ntm_u28; /* Unicode to 8 bit */ +#ifdef APPLE + struct netexport ntm_export; /* NFS export information */ +#endif +}; + +#define ntm_mftcn ntm_bootfile.bf_mftcn +#define ntm_mftmirrcn ntm_bootfile.bf_mftmirrcn +#define ntm_mftrecsz ntm_bootfile.bf_mftrecsz +#define ntm_spc ntm_bootfile.bf_spc +#define ntm_bps ntm_bootfile.bf_bps + +#pragma pack() + +#define NTFS_NEXTREC(s, type) ((type)(((caddr_t) s) + le16toh((s)->reclen))) + +/* Convert mount ptr to ntfsmount ptr. */ +#define VFSTONTFS(mp) ((struct ntfsmount *)((mp)->mnt_data)) +#define VTONT(v) FTONT(VTOF(v)) +#define VTOF(v) ((struct fnode *)((v)->v_data)) +#define FTOV(f) ((f)->f_vp) +#define FTONT(f) ((f)->f_ip) +#define ntfs_cntobn(cn) ((daddr_t)(cn) * (ntmp->ntm_spc)) +#define ntfs_cntob(cn) ((off_t)(cn) * (ntmp)->ntm_spc * (ntmp)->ntm_bps) +#define ntfs_btocn(off) (cn_t)((off) / ((ntmp)->ntm_spc * (ntmp)->ntm_bps)) +#define ntfs_btocl(off) (cn_t)((off + ntfs_cntob(1) - 1) / ((ntmp)->ntm_spc * (ntmp)->ntm_bps)) +#define ntfs_btocnoff(off) (off_t)((off) % ((ntmp)->ntm_spc * (ntmp)->ntm_bps)) +#define ntfs_bntob(bn) (daddr_t)((bn) * (ntmp)->ntm_bps) + +#define ntfs_bpbl (daddr_t)((ntmp)->ntm_bps) + +#ifdef MALLOC_DECLARE +MALLOC_DECLARE(M_NTFSMNT); +MALLOC_DECLARE(M_NTFSNTNODE); +MALLOC_DECLARE(M_NTFSFNODE); +MALLOC_DECLARE(M_NTFSDIR); +MALLOC_DECLARE(M_NTFSNTHASH); +#endif + +#ifndef M_NTFSMNT +#define M_NTFSMNT M_TEMP +#endif +#ifndef M_NTFSNTNODE +#define M_NTFSNTNODE M_TEMP +#endif +#ifndef M_NTFSFNODE +#define M_NTFSFNODE M_TEMP +#endif +#ifndef M_NTFSDIR +#define M_NTFSDIR M_TEMP +#endif +#ifndef M_NTFSNTHASH +#define M_NTFSNTHASH M_TEMP +#endif +#ifndef M_NTFSRUN +#define M_NTFSRUN M_TEMP +#endif +#ifndef M_NTFSRDATA +#define M_NTFSRDATA M_TEMP +#endif +#ifndef M_NTFSNTVATTR +#define M_NTFSNTVATTR M_TEMP +#endif +#ifndef M_NTFSDECOMP +#define M_NTFSDECOMP M_TEMP +#endif +#define VT_NTFS VT_OTHER + +#if defined(NTFS_DEBUG) +#define dprintf(a) printf a +#if NTFS_DEBUG > 1 +#define ddprintf(a) printf a +#else +#define ddprintf(a) +#endif +#else +#define dprintf(a) +#define ddprintf(a) +#endif + +#ifdef APPLE +typedef int vop_t(void *); +#else +#endif +extern vop_t **ntfs_vnodeop_p; +#endif /* KERNEL */ diff --git a/i386/libsaio/.svn/text-base/nvidia.c.svn-base b/i386/libsaio/.svn/text-base/nvidia.c.svn-base new file mode 100644 index 0000000..ad3ce16 --- /dev/null +++ b/i386/libsaio/.svn/text-base/nvidia.c.svn-base @@ -0,0 +1,2139 @@ +/* + * NVidia injector + * + * Copyright (C) 2009 Jasmin Fazlic, iNDi + * + * NVidia injector modified by Fabio (ErmaC) on May 2012, + * for allow the cosmetics injection also based on SubVendorID and SubDeviceID. + * + * NVidia injector is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * NVidia driver and injector is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NVidia injector. If not, see <http://www.gnu.org/licenses/>. + * + * Alternatively you can choose to comply with APSL + * + * DCB-Table parsing is based on software (nouveau driver) originally distributed under following license: + * + * + * Copyright 2005-2006 Erik Waling + * Copyright 2006 Stephane Marchesin + * Copyright 2007-2009 Stuart Bennett + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "device_inject.h" +#include "nvidia.h" +#include "nvidia_helper.h" + +#ifndef DEBUG_NVIDIA +#define DEBUG_NVIDIA 0 +#endif + +#if DEBUG_NVIDIA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +#define NVIDIA_ROM_SIZE 0x20000 +#define PATCH_ROM_SUCCESS 1 +#define PATCH_ROM_SUCCESS_HAS_LVDS 2 +#define PATCH_ROM_FAILED 0 +#define MAX_NUM_DCB_ENTRIES 16 +#define TYPE_GROUPED 0xff +#define READ_BYTE(rom, offset) (*(u_char *)(rom + offset)) +#define READ_LE_SHORT(rom, offset) (READ_BYTE(rom, offset+1) << 8 | READ_BYTE(rom, offset)) +#define READ_LE_INT(rom, offset) (READ_LE_SHORT(rom, offset+2) << 16 | READ_LE_SHORT(rom, offset)) +#define WRITE_LE_SHORT(data) (((data) << 8 & 0xff00) | ((data) >> 8 & 0x00ff )) +#define WRITE_LE_INT(data) (WRITE_LE_SHORT(data) << 16 | WRITE_LE_SHORT(data >> 16)) + +extern uint32_t devices_number; + +const char *nvidia_compatible_0[] = { "@0,compatible", "NVDA,NVMac" }; +const char *nvidia_compatible_1[] = { "@1,compatible", "NVDA,NVMac" }; +const char *nvidia_device_type_0[] = { "@0,device_type", "display" }; +const char *nvidia_device_type_1[] = { "@1,device_type", "display" }; +const char *nvidia_device_type[] = { "device_type", "NVDA,Parent" }; +const char *nvidia_device_type_child[] = { "device_type", "NVDA,Child" }; +const char *nvidia_name_0[] = { "@0,name", "NVDA,Display-A" }; +const char *nvidia_name_1[] = { "@1,name", "NVDA,Display-B" }; +const char *nvidia_slot_name[] = { "AAPL,slot-name", "Slot-1" }; + +static uint8_t default_NVCAP[]= { + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x00, 0x00 +}; + +#define NVCAP_LEN ( sizeof(default_NVCAP) / sizeof(uint8_t) ) + +static uint8_t default_dcfg_0[] = {0x03, 0x01, 0x03, 0x00}; +static uint8_t default_dcfg_1[] = {0xff, 0xff, 0x00, 0x01}; + +#define DCFG0_LEN ( sizeof(default_dcfg_0) / sizeof(uint8_t) ) +#define DCFG1_LEN ( sizeof(default_dcfg_1) / sizeof(uint8_t) ) + +static uint8_t default_NVPM[]= { + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +#define NVPM_LEN ( sizeof(default_NVPM) / sizeof(uint8_t) ) + +/*static nvidia_pci_info_t nvidia_card_vendors[] = { + { 0x10190000, "Elitegroup" }, + { 0x10250000, "Acer" }, + { 0x10280000, "Dell" }, + { 0x10330000, "NEC" }, + { 0x103C0000, "HP" }, + { 0x10430000, "Asus" }, + { 0x104D0000, "Sony" }, + { 0x105B0000, "Foxconn" }, + { 0x106B0000, "Apple" }, + { 0x10710000, "Mitac" }, + { 0x107B0000, "Gateway" }, + { 0x107D0000, "Leadtek" }, + { 0x109F0000, "Trigem" }, + { 0x10B00000, "Gainward" }, + { 0x10CF0000, "Fujitsu" }, + { 0x10DE0000, "nVidia" }, + { 0x11790000, "Toshiba" }, + { 0x12970000, "Shuttle" }, + { 0x13DC0000, "Netbost" }, + { 0x144D0000, "Samsung" }, + { 0x14580000, "Gigabyte" }, + { 0x14620000, "MSi" }, + { 0x14C00000, "Compal" }, + { 0x152D0000, "Quanta" }, + { 0x15540000, "Prolink" }, + { 0x15580000, "Clevo" }, + { 0x15690000, "Palit" }, + { 0x161F0000, "Arima" }, + { 0x16310000, "NEC" }, + { 0x16420000, "Bitland" }, + { 0x16820000, "XFX" }, + { 0x17340000, "Fujitsu" }, + { 0x174B0000, "PC Partner" }, + { 0x17AA0000, "Lenovo" }, + { 0x17C00000, "Wistron" }, + { 0x17FF0000, "Benq" }, + { 0x18490000, "ASRock" }, + { 0x18540000, "LG" }, + { 0x18640000, "LG" }, + { 0x18940000, "LG" }, + { 0x19610000, "ESS" }, + { 0x196E0000, "PNY" }, + { 0x19910000, "Topstar" }, + { 0x19DA0000, "Zotac" }, + { 0x19F10000, "BFG" }, + { 0x1ACC0000, "Point of View" }, + { 0x1B0A0000, "Pegatron" }, + { 0x1B130000, "Jaton" }, + { 0x34420000, "Bihl" }, + { 0x38420000, "EVGA" }, + { 0x73770000, "Colorful" }, +}; */ + +static nvidia_pci_info_t nvidia_card_generic[] = { + // 0000 - 0040 + { 0x10DE0000, "Unknown" }, + // 0040 - 004F + { 0x10DE0040, "GeForce 6800 Ultra" }, + { 0x10DE0041, "GeForce 6800" }, + { 0x10DE0042, "GeForce 6800 LE" }, + { 0x10DE0043, "GeForce 6800 XE" }, + { 0x10DE0044, "GeForce 6800 XT" }, + { 0x10DE0045, "GeForce 6800 GT" }, + { 0x10DE0046, "GeForce 6800 GT" }, + { 0x10DE0047, "GeForce 6800 GS" }, + { 0x10DE0048, "GeForce 6800 XT" }, + { 0x10DE004D, "Quadro FX 3400" }, + { 0x10DE004E, "Quadro FX 4000" }, + // 0050 - 005F + // 0060 - 006F + // 0070 - 007F + // 0080 - 008F + // 0090 - 009F + { 0x10DE0090, "GeForce 7800 GTX" }, + { 0x10DE0091, "GeForce 7800 GTX" }, + { 0x10DE0092, "GeForce 7800 GT" }, + { 0x10DE0093, "GeForce 7800 GS" }, + { 0x10DE0095, "GeForce 7800 SLI" }, + { 0x10DE0098, "GeForce Go 7800" }, + { 0x10DE0099, "GeForce Go 7800 GTX" }, + { 0x10DE009D, "Quadro FX 4500" }, + // 00A0 - 00AF + // 00B0 - 00BF + // 00C0 - 00CF + { 0x10DE00C0, "GeForce 6800 GS" }, + { 0x10DE00C1, "GeForce 6800" }, + { 0x10DE00C2, "GeForce 6800 LE" }, + { 0x10DE00C3, "GeForce 6800 XT" }, + { 0x10DE00C8, "GeForce Go 6800" }, + { 0x10DE00C9, "GeForce Go 6800 Ultra" }, + { 0x10DE00CC, "Quadro FX Go1400" }, + { 0x10DE00CD, "Quadro FX 3450/4000 SDI" }, + { 0x10DE00CE, "Quadro FX 1400" }, + // 00D0 - 00DF + // 00E0 - 00EF + // 00F0 - 00FF + { 0x10DE00F1, "GeForce 6600 GT" }, + { 0x10DE00F2, "GeForce 6600" }, + { 0x10DE00F3, "GeForce 6200" }, + { 0x10DE00F4, "GeForce 6600 LE" }, + { 0x10DE00F5, "GeForce 7800 GS" }, + { 0x10DE00F6, "GeForce 6800 GS/XT" }, + { 0x10DE00F8, "Quadro FX 3400/4400" }, + { 0x10DE00F9, "GeForce 6800 Series GPU" }, + // 0100 - 010F + // 0110 - 011F + // 0120 - 012F + // 0130 - 013F + // 0140 - 014F + { 0x10DE0140, "GeForce 6600 GT" }, + { 0x10DE0141, "GeForce 6600" }, + { 0x10DE0142, "GeForce 6600 LE" }, + { 0x10DE0143, "GeForce 6600 VE" }, + { 0x10DE0144, "GeForce Go 6600" }, + { 0x10DE0145, "GeForce 6610 XL" }, + { 0x10DE0146, "GeForce Go 6600 TE/6200 TE" }, + { 0x10DE0147, "GeForce 6700 XL" }, + { 0x10DE0148, "GeForce Go 6600" }, + { 0x10DE0149, "GeForce Go 6600 GT" }, + { 0x10DE014A, "Quadro NVS 440" }, + { 0x10DE014C, "Quadro FX 550" }, + { 0x10DE014D, "Quadro FX 550" }, + { 0x10DE014E, "Quadro FX 540" }, + { 0x10DE014F, "GeForce 6200" }, + // 0150 - 015F + // 0160 - 016F + { 0x10DE0160, "GeForce 6500" }, + { 0x10DE0161, "GeForce 6200 TurboCache(TM)" }, + { 0x10DE0162, "GeForce 6200SE TurboCache(TM)" }, + { 0x10DE0163, "GeForce 6200 LE" }, + { 0x10DE0164, "GeForce Go 6200" }, + { 0x10DE0165, "Quadro NVS 285" }, + { 0x10DE0166, "GeForce Go 6400" }, + { 0x10DE0167, "GeForce Go 6200" }, + { 0x10DE0168, "GeForce Go 6400" }, + { 0x10DE0169, "GeForce 6250" }, + { 0x10DE016A, "GeForce 7100 GS" }, + { 0x10DE016C, "NVIDIA NV44GLM" }, + { 0x10DE016D, "NVIDIA NV44GLM" }, + // 0170 - 017F + // 0180 - 018F + // 0190 - 019F + { 0x10DE0191, "GeForce 8800 GTX" }, + { 0x10DE0193, "GeForce 8800 GTS" }, + { 0x10DE0194, "GeForce 8800 Ultra" }, + { 0x10DE0197, "Tesla C870" }, + { 0x10DE019D, "Quadro FX 5600" }, + { 0x10DE019E, "Quadro FX 4600" }, + // 01A0 - 01AF + // 01B0 - 01BF + // 01C0 - 01CF + // 01D0 - 01DF + { 0x10DE01D0, "GeForce 7350 LE" }, + { 0x10DE01D1, "GeForce 7300 LE" }, + { 0x10DE01D2, "GeForce 7550 LE" }, + { 0x10DE01D3, "GeForce 7300 SE/7200 GS" }, + { 0x10DE01D6, "GeForce Go 7200" }, + { 0x10DE01D7, "GeForce Go 7300" }, + { 0x10DE01D8, "GeForce Go 7400" }, + { 0x10DE01D9, "GeForce Go 7450" }, + { 0x10DE01DA, "Quadro NVS 110M" }, + { 0x10DE01DB, "Quadro NVS 120M" }, + { 0x10DE01DC, "Quadro FX 350M" }, + { 0x10DE01DD, "GeForce 7500 LE" }, + { 0x10DE01DE, "Quadro FX 350" }, + { 0x10DE01DF, "GeForce 7300 GS" }, + // 01E0 - 01EF + // 01F0 - 01FF + { 0x10DE01F0, "GeForce4 MX" }, + // 0200 - 020F + // 0210 - 021F + { 0x10DE0211, "GeForce 6800" }, + { 0x10DE0212, "GeForce 6800 LE" }, + { 0x10DE0215, "GeForce 6800 GT" }, + { 0x10DE0218, "GeForce 6800 XT" }, + // 0220 - 022F + { 0x10DE0221, "GeForce 6200" }, + { 0x10DE0222, "GeForce 6200 A-LE" }, + { 0x10DE0228, "NVIDIA NV44M" }, + // 0230 - 023F + // 0240 - 024F + { 0x10DE0240, "GeForce 6150" }, + { 0x10DE0241, "GeForce 6150 LE" }, + { 0x10DE0242, "GeForce 6100" }, + { 0x10DE0243, "NVIDIA C51" }, + { 0x10DE0244, "GeForce Go 6150" }, + { 0x10DE0245, "Quadro NVS 210S / GeForce 6150LE" }, + { 0x10DE0247, "GeForce Go 6100" }, + // 0250 - 025F + { 0x10DE025B, "Quadro4 700 XGL" }, + // 0260 - 026F + // 0270 - 027F + // 0280 - 028F + // 0290 - 029F + { 0x10DE0290, "GeForce 7900 GTX" }, + { 0x10DE0291, "GeForce 7900 GT/GTO" }, + { 0x10DE0292, "GeForce 7900 GS" }, + { 0x10DE0293, "GeForce 7950 GX2" }, + { 0x10DE0294, "GeForce 7950 GX2" }, + { 0x10DE0295, "GeForce 7950 GT" }, + { 0x10DE0298, "GeForce Go 7900 GS" }, + { 0x10DE0299, "GeForce Go 7900 GTX" }, + { 0x10DE029A, "Quadro FX 2500M" }, + { 0x10DE029B, "Quadro FX 1500M" }, + { 0x10DE029C, "Quadro FX 5500" }, + { 0x10DE029D, "Quadro FX 3500" }, + { 0x10DE029E, "Quadro FX 1500" }, + { 0x10DE029F, "Quadro FX 4500 X2" }, + // 02A0 - 02AF + // 02B0 - 02BF + // 02C0 - 02CF + // 02D0 - 02DF + // 02E0 - 02EF + { 0x10DE02E0, "GeForce 7600 GT" }, + { 0x10DE02E1, "GeForce 7600 GS" }, + { 0x10DE02E2, "GeForce 7300 GT" }, + { 0x10DE02E3, "GeForce 7900 GS" }, + { 0x10DE02E4, "GeForce 7950 GT" }, + // 02F0 - 02FF + // 0300 - 030F + { 0x10DE0301, "GeForce FX 5800 Ultra" }, + { 0x10DE0302, "GeForce FX 5800" }, + { 0x10DE0308, "Quadro FX 2000" }, + { 0x10DE0309, "Quadro FX 1000" }, + // 0310 - 031F + { 0x10DE0311, "GeForce FX 5600 Ultra" }, + { 0x10DE0312, "GeForce FX 5600" }, + { 0x10DE0314, "GeForce FX 5600XT" }, + { 0x10DE031A, "GeForce FX Go5600" }, + { 0x10DE031B, "GeForce FX Go5650" }, + { 0x10DE031C, "Quadro FX Go700" }, + // 0320 - 032F + { 0x10DE0320, "GeForce FX 5200" }, + { 0x10DE0321, "GeForce FX 5200 Ultra" }, + { 0x10DE0322, "GeForce FX 5200" }, + { 0x10DE0323, "GeForce FX 5200 LE" }, + { 0x10DE0324, "GeForce FX Go5200" }, + { 0x10DE0325, "GeForce FX Go5250" }, + { 0x10DE0326, "GeForce FX 5500" }, + { 0x10DE0328, "GeForce FX Go5200 32M/64M" }, + { 0x10DE0329, "GeForce FX Go5200" }, + { 0x10DE032A, "Quadro NVS 55/280 PCI" }, + { 0x10DE032B, "Quadro FX 500/600 PCI" }, + { 0x10DE032C, "GeForce FX Go53xx Series" }, + { 0x10DE032D, "GeForce FX Go5100" }, + { 0x10DE032F, "NV34GL" }, + // 0330 - 033F + { 0x10DE0330, "GeForce FX 5900 Ultra" }, + { 0x10DE0331, "GeForce FX 5900" }, + { 0x10DE0332, "GeForce FX 5900XT" }, + { 0x10DE0333, "GeForce FX 5950 Ultra" }, + { 0x10DE0334, "GeForce FX 5900ZT" }, + { 0x10DE0338, "Quadro FX 3000" }, + { 0x10DE033F, "Quadro FX 700" }, + // 0340 - 034F + { 0x10DE0341, "GeForce FX 5700 Ultra" }, + { 0x10DE0342, "GeForce FX 5700" }, + { 0x10DE0343, "GeForce FX 5700LE" }, + { 0x10DE0344, "GeForce FX 5700VE" }, + { 0x10DE0345, "NV36.5" }, + { 0x10DE0347, "GeForce FX Go5700" }, + { 0x10DE0348, "GeForce FX Go5700" }, + { 0x10DE0349, "NV36M Pro" }, + { 0x10DE034B, "NV36MAP" }, + { 0x10DE034C, "Quadro FX Go1000" }, + { 0x10DE034E, "Quadro FX 1100" }, + { 0x10DE034F, "NV36GL" }, + // 0350 - 035F + // 0360 - 036F + // 0370 - 037F + // 0380 - 038F + { 0x10DE038B, "GeForce 7650 GS" }, + // 0390 - 039F + { 0x10DE0390, "GeForce 7650 GS" }, + { 0x10DE0391, "GeForce 7600 GT" }, + { 0x10DE0392, "GeForce 7600 GS" }, + { 0x10DE0393, "GeForce 7300 GT" }, + { 0x10DE0394, "GeForce 7600 LE" }, + { 0x10DE0395, "GeForce 7300 GT" }, + { 0x10DE0397, "GeForce Go 7700" }, + { 0x10DE0398, "GeForce Go 7600" }, + { 0x10DE0399, "GeForce Go 7600 GT"}, + { 0x10DE039A, "Quadro NVS 300M" }, + { 0x10DE039B, "GeForce Go 7900 SE" }, + { 0x10DE039C, "Quadro FX 560M" }, + { 0x10DE039E, "Quadro FX 560" }, + // 03A0 - 03AF + // 03B0 - 03BF + // 03C0 - 03CF + // 03D0 - 03DF + { 0x10DE03D0, "GeForce 6150SE nForce 430" }, + { 0x10DE03D1, "GeForce 6100 nForce 405" }, + { 0x10DE03D2, "GeForce 6100 nForce 400" }, + { 0x10DE03D5, "GeForce 6100 nForce 420" }, + { 0x10DE03D6, "GeForce 7025 / nForce 630a" }, + // 03E0 - 03EF + // 03F0 - 03FF + // 0400 - 040F + { 0x10DE0400, "GeForce 8600 GTS" }, + { 0x10DE0401, "GeForce 8600 GT" }, + { 0x10DE0402, "GeForce 8600 GT" }, + { 0x10DE0403, "GeForce 8600 GS" }, + { 0x10DE0404, "GeForce 8400 GS" }, + { 0x10DE0405, "GeForce 9500M GS" }, + { 0x10DE0406, "GeForce 8300 GS" }, + { 0x10DE0407, "GeForce 8600M GT" }, + { 0x10DE0408, "GeForce 9650M GS" }, + { 0x10DE0409, "GeForce 8700M GT" }, + { 0x10DE040A, "Quadro FX 370" }, + { 0x10DE040B, "Quadro NVS 320M" }, + { 0x10DE040C, "Quadro FX 570M" }, + { 0x10DE040D, "Quadro FX 1600M" }, + { 0x10DE040E, "Quadro FX 570" }, + { 0x10DE040F, "Quadro FX 1700" }, + // 0410 - 041F + { 0x10DE0410, "GeForce GT 330" }, + // 0420 - 042F + { 0x10DE0420, "GeForce 8400 SE" }, + { 0x10DE0421, "GeForce 8500 GT" }, + { 0x10DE0422, "GeForce 8400 GS" }, + { 0x10DE0423, "GeForce 8300 GS" }, + { 0x10DE0424, "GeForce 8400 GS" }, + { 0x10DE0425, "GeForce 8600M GS" }, + { 0x10DE0426, "GeForce 8400M GT" }, + { 0x10DE0427, "GeForce 8400M GS" }, + { 0x10DE0428, "GeForce 8400M G" }, + { 0x10DE0429, "Quadro NVS 140M" }, + { 0x10DE042A, "Quadro NVS 130M" }, + { 0x10DE042B, "Quadro NVS 135M" }, + { 0x10DE042C, "GeForce 9400 GT" }, + { 0x10DE042D, "Quadro FX 360M" }, + { 0x10DE042E, "GeForce 9300M G" }, + { 0x10DE042F, "Quadro NVS 290" }, + // 0430 - 043F + // 0440 - 044F + // 0450 - 045F + // 0460 - 046F + // 0470 - 047F + // 0480 - 048F + // 0490 - 049F + // 04A0 - 04AF + // 04B0 - 04BF + // 04C0 - 04CF + { 0x10DE04C0, "NVIDIA G78" }, + { 0x10DE04C1, "NVIDIA G78" }, + { 0x10DE04C2, "NVIDIA G78" }, + { 0x10DE04C3, "NVIDIA G78" }, + { 0x10DE04C4, "NVIDIA G78" }, + { 0x10DE04C5, "NVIDIA G78" }, + { 0x10DE04C6, "NVIDIA G78" }, + { 0x10DE04C7, "NVIDIA G78" }, + { 0x10DE04C8, "NVIDIA G78" }, + { 0x10DE04C9, "NVIDIA G78" }, + { 0x10DE04CA, "NVIDIA G78" }, + { 0x10DE04CB, "NVIDIA G78" }, + { 0x10DE04CC, "NVIDIA G78" }, + { 0x10DE04CD, "NVIDIA G78" }, + { 0x10DE04CE, "NVIDIA G78" }, + { 0x10DE04CF, "NVIDIA G78" }, + // 04D0 - 04DF + // 04E0 - 04EF + // 04F0 - 04FF + // 0500 - 050F + // 0510 - 051F + // 0520 - 052F + // 0530 - 053F + { 0x10DE0530, "GeForce 7190M / nForce 650M" }, + { 0x10DE0531, "GeForce 7150M / nForce 630M" }, + { 0x10DE0533, "GeForce 7000M / nForce 610M" }, + { 0x10DE053A, "GeForce 7050 PV / nForce 630a" }, + { 0x10DE053B, "GeForce 7050 PV / nForce 630a" }, + { 0x10DE053E, "GeForce 7025 / nForce 630a" }, + // 0540 - 054F + // 0550 - 055F + // 0560 - 056F + // 0570 - 057F + // 0580 - 058F + // 0590 - 059F + // 05A0 - 05AF + // 05B0 - 05BF + // 05C0 - 05CF + // 05D0 - 05DF + // 05E0 - 05EF + { 0x10DE05E0, "GeForce GTX 295" }, + { 0x10DE05E1, "GeForce GTX 280" }, + { 0x10DE05E2, "GeForce GTX 260" }, + { 0x10DE05E3, "GeForce GTX 285" }, + { 0x10DE05E4, "NVIDIA GT200" }, + { 0x10DE05E5, "NVIDIA GT200" }, + { 0x10DE05E6, "GeForce GTX 275" }, + { 0x10DE05E7, "nVidia Tesla C1060" }, + { 0x10DE05E8, "NVIDIA GT200" }, + { 0x10DE05E9, "NVIDIA GT200" }, + { 0x10DE05EA, "GeForce GTX 260" }, + { 0x10DE05EB, "GeForce GTX 295" }, + { 0x10DE05EC, "NVIDIA GT200" }, + { 0x10DE05ED, "Quadroplex 2200 D2" }, + { 0x10DE05EE, "NVIDIA GT200" }, + { 0x10DE05EF, "NVIDIA GT200" }, + // 05F0 - 05FF + { 0x10DE05F0, "NVIDIA GT200" }, + { 0x10DE05F1, "NVIDIA GT200" }, + { 0x10DE05F2, "NVIDIA GT200" }, + { 0x10DE05F3, "NVIDIA GT200" }, + { 0x10DE05F4, "NVIDIA GT200" }, + { 0x10DE05F5, "NVIDIA GT200" }, + { 0x10DE05F6, "NVIDIA GT200" }, + { 0x10DE05F7, "NVIDIA GT200" }, + { 0x10DE05F8, "Quadroplex 2200 S4" }, + { 0x10DE05F9, "NVIDIA Quadro CX" }, + { 0x10DE05FA, "NVIDIA GT200" }, + { 0x10DE05FB, "NVIDIA GT200" }, + { 0x10DE05FC, "NVIDIA GT200" }, + { 0x10DE05FD, "Quadro FX 5800" }, + { 0x10DE05FE, "Quadro FX 4800" }, + { 0x10DE05FF, "Quadro FX 3800" }, + // 0600 - 060F + { 0x10DE0600, "GeForce 8800 GTS" }, + { 0x10DE0601, "GeForce 9800 GT" }, + { 0x10DE0602, "GeForce 8800 GT" }, + { 0x10DE0603, "GeForce GT 230" }, + { 0x10DE0604, "GeForce 9800 GX2" }, + { 0x10DE0605, "GeForce 9800 GT" }, + { 0x10DE0606, "GeForce 8800 GS" }, + { 0x10DE0607, "GeForce GTS 240" }, + { 0x10DE0608, "GeForce 9800M GTX" }, + { 0x10DE0609, "GeForce 8800M GTS" }, + { 0x10DE060A, "GeForce GTX 280M" }, + { 0x10DE060B, "GeForce 9800M GT" }, + { 0x10DE060C, "GeForce 8800M GTX" }, + { 0x10DE060D, "GeForce 8800 GS" }, + { 0x10DE060F, "GeForce GTX 285M" }, + // 0610 - 061F + { 0x10DE0610, "GeForce 9600 GSO" }, + { 0x10DE0611, "GeForce 8800 GT" }, + { 0x10DE0612, "GeForce 9800 GTX" }, + { 0x10DE0613, "GeForce 9800 GTX+" }, + { 0x10DE0614, "GeForce 9800 GT" }, + { 0x10DE0615, "GeForce GTS 250" }, + { 0x10DE0617, "GeForce 9800M GTX" }, + { 0x10DE0618, "GeForce GTX 260M" }, + { 0x10DE0619, "Quadro FX 4700 X2" }, + { 0x10DE061A, "Quadro FX 3700" }, + { 0x10DE061B, "Quadro VX 200" }, + { 0x10DE061C, "Quadro FX 3600M" }, + { 0x10DE061D, "Quadro FX 2800M" }, + { 0x10DE061E, "Quadro FX 3700M" }, + { 0x10DE061F, "Quadro FX 3800M" }, + // 0620 - 062F + { 0x10DE0620, "NVIDIA G94" }, + { 0x10DE0621, "GeForce GT 230" }, + { 0x10DE0622, "GeForce 9600 GT" }, + { 0x10DE0623, "GeForce 9600 GS" }, + { 0x10DE0624, "NVIDIA G94" }, + { 0x10DE0625, "GeForce 9600 GSO 512"}, + { 0x10DE0626, "GeForce GT 130" }, + { 0x10DE0627, "GeForce GT 140" }, + { 0x10DE0628, "GeForce 9800M GTS" }, + { 0x10DE0629, "NVIDIA G94" }, + { 0x10DE062A, "GeForce 9700M GTS" }, + { 0x10DE062B, "GeForce 9800M GS" }, + { 0x10DE062C, "GeForce 9800M GTS" }, + { 0x10DE062D, "GeForce 9600 GT" }, + { 0x10DE062E, "GeForce 9600 GT" }, + { 0x10DE062F, "GeForce 9800 S" }, + // 0630 - 063F + { 0x10DE0630, "GeForce 9700 S" }, + { 0x10DE0631, "GeForce GTS 160M" }, + { 0x10DE0632, "GeForce GTS 150M" }, + { 0x10DE0633, "NVIDIA G94" }, + { 0x10DE0634, "NVIDIA G94" }, + { 0x10DE0635, "GeForce 9600 GSO" }, + { 0x10DE0636, "NVIDIA G94" }, + { 0x10DE0637, "GeForce 9600 GT" }, + { 0x10DE0638, "Quadro FX 1800" }, + { 0x10DE0639, "NVIDIA G94" }, + { 0x10DE063A, "Quadro FX 2700M" }, + { 0x10DE063B, "NVIDIA G94" }, + { 0x10DE063C, "NVIDIA G94" }, + { 0x10DE063D, "NVIDIA G94" }, + { 0x10DE063E, "NVIDIA G94" }, + { 0x10DE063F, "NVIDIA G94" }, + // 0640 - 064F + { 0x10DE0640, "GeForce 9500 GT" }, + { 0x10DE0641, "GeForce 9400 GT" }, + { 0x10DE0642, "GeForce 8400 GS" }, + { 0x10DE0643, "GeForce 9500 GT" }, + { 0x10DE0644, "GeForce 9500 GS" }, + { 0x10DE0645, "GeForce 9500 GS" }, + { 0x10DE0646, "GeForce GT 120" }, + { 0x10DE0647, "GeForce 9600M GT" }, + { 0x10DE0648, "GeForce 9600M GS" }, + { 0x10DE0649, "GeForce 9600M GT" }, + { 0x10DE064A, "GeForce 9700M GT" }, + { 0x10DE064B, "GeForce 9500M G" }, + { 0x10DE064C, "GeForce 9650M GT" }, + // 0650 - 065F + { 0x10DE0650, "NVIDIA G96-825" }, + { 0x10DE0651, "GeForce G 110M" }, + { 0x10DE0652, "GeForce GT 130M" }, + { 0x10DE0653, "GeForce GT 120M" }, + { 0x10DE0654, "GeForce GT 220M" }, + { 0x10DE0655, "GeForce GT 120" }, + { 0x10DE0656, "GeForce 9650 S" }, + { 0x10DE0657, "NVIDIA G96" }, + { 0x10DE0658, "Quadro FX 380" }, + { 0x10DE0659, "Quadro FX 580" }, + { 0x10DE065A, "Quadro FX 1700M" }, + { 0x10DE065B, "GeForce 9400 GT" }, + { 0x10DE065C, "Quadro FX 770M" }, + { 0x10DE065D, "NVIDIA G96" }, + { 0x10DE065E, "NVIDIA G96" }, + { 0x10DE065F, "GeForce G210" }, + // 0660 - 066F + // 0670 - 067F + // 0680 - 068F + // 0690 - 069F + // 06A0 - 06AF + { 0x10DE06A0, "NVIDIA GT214" }, + // 06B0 - 06BF + { 0x10DE06B0, "NVIDIA GT214" }, + // 06C0 - 06CF + { 0x10DE06C0, "GeForce GTX 480" }, + { 0x10DE06C3, "GeForce GTX D12U" }, + { 0x10DE06C4, "GeForce GTX 465" }, + { 0x10DE06CA, "GeForce GTX 480M" }, + { 0x10DE06CD, "GeForce GTX 470" }, + // 06D0 - 06DF + { 0x10DE06D1, "Tesla C2050" }, + { 0x10DE06D2, "Tesla M2070" }, + { 0x10DE06D8, "Quadro 6000" }, + { 0x10DE06D9, "Quadro 5000" }, + { 0x10DE06DA, "Quadro 5000M" }, + { 0x10DE06DC, "Quadro 6000" }, + { 0x10DE06DD, "Quadro 4000" }, + { 0x10DE06DE, "Tesla M2050" }, + { 0x10DE06DF, "Tesla M2070-Q" }, + // 06E0 - 06EF + { 0x10DE06E0, "GeForce 9300 GE" }, + { 0x10DE06E1, "GeForce 9300 GS" }, + { 0x10DE06E2, "GeForce 8400" }, + { 0x10DE06E3, "GeForce 8400 SE" }, + { 0x10DE06E4, "GeForce 8400 GS" }, + { 0x10DE06E5, "GeForce 9300M GS" }, + { 0x10DE06E6, "GeForce G100" }, + { 0x10DE06E7, "GeForce 9300 SE" }, + { 0x10DE06E8, "GeForce 9200M GE" }, + { 0x10DE06E9, "GeForce 9300M GS" }, + { 0x10DE06EA, "Quadro NVS 150M" }, + { 0x10DE06EB, "Quadro NVS 160M" }, + { 0x10DE06EC, "GeForce G 105M" }, + { 0x10DE06ED, "NVIDIA G98" }, + { 0x10DE06EF, "GeForce G 103M" }, + // 06F0 - 06FF + { 0x10DE06F0, "NVIDIA G98" }, + { 0x10DE06F1, "GeForce G105M" }, + { 0x10DE06F2, "NVIDIA G98" }, + { 0x10DE06F3, "NVIDIA G98" }, + { 0x10DE06F4, "NVIDIA G98" }, + { 0x10DE06F5, "NVIDIA G98" }, + { 0x10DE06F6, "NVIDIA G98" }, + { 0x10DE06F7, "NVIDIA G98" }, + { 0x10DE06F8, "Quadro NVS 420" }, + { 0x10DE06F9, "Quadro FX 370 LP" }, + { 0x10DE06FA, "Quadro NVS 450" }, + { 0x10DE06FB, "Quadro FX 370M" }, + { 0x10DE06FC, "NVIDIA G98" }, + { 0x10DE06FD, "Quadro NVS 295" }, + { 0x10DE06FE, "NVIDIA G98" }, + { 0x10DE06FF, "HICx16 + Graphics" }, + // 0700 - 070F + // 0710 - 071F + // 0720 - 072F + // 0730 - 073F + // 0740 - 074F + // 0750 - 075F + // 0760 - 076F + // 0770 - 077F + // 0780 - 078F + // 0790 - 079F + // 07A0 - 07AF + // 07B0 - 07BF + // 07C0 - 07CF + // 07D0 - 07DF + // 07E0 - 07EF + { 0x10DE07E0, "GeForce 7150 / nForce 630i" }, + { 0x10DE07E1, "GeForce 7100 / nForce 630i" }, + { 0x10DE07E2, "GeForce 7050 / nForce 630i" }, + { 0x10DE07E3, "GeForce 7050 / nForce 610i" }, + { 0x10DE07E5, "GeForce 7050 / nForce 620i" }, + // 07F0 - 07FF + // 0800 - 080F + // 0810 - 081F + // 0820 - 082F + // 0830 - 083F + // 0840 - 084F + { 0x10DE0840, "GeForce 8200M" }, + { 0x10DE0844, "GeForce 9100M G" }, + { 0x10DE0845, "GeForce 8200M G" }, + { 0x10DE0846, "GeForce 9200" }, + { 0x10DE0847, "GeForce 9100" }, + { 0x10DE0848, "GeForce 8300" }, + { 0x10DE0849, "GeForce 8200" }, + { 0x10DE084A, "nForce 730a" }, + { 0x10DE084B, "GeForce 9200" }, + { 0x10DE084C, "nForce 980a/780a SLI" }, + { 0x10DE084D, "nForce 750a SLI" }, + { 0x10DE084F, "GeForce 8100 / nForce 720a" }, + // 0850 - 085F + // 0860 - 086F + { 0x10DE0860, "GeForce 9300" }, + { 0x10DE0861, "GeForce 9400" }, + { 0x10DE0862, "GeForce 9400M G" }, + { 0x10DE0863, "GeForce 9400M" }, + { 0x10DE0864, "GeForce 9300" }, + { 0x10DE0865, "GeForce 9300" }, + { 0x10DE0866, "GeForce 9400M G" }, + { 0x10DE0867, "GeForce 9400" }, + { 0x10DE0868, "nForce 760i SLI" }, + { 0x10DE0869, "GeForce 9400" }, + { 0x10DE086A, "GeForce 9400" }, + { 0x10DE086C, "GeForce 9300 / nForce 730i" }, + { 0x10DE086D, "GeForce 9200" }, + { 0x10DE086E, "GeForce 9100M G" }, + { 0x10DE086F, "GeForce 8200M G" }, + // 0870 - 087F + { 0x10DE0870, "GeForce 9400M" }, + { 0x10DE0871, "GeForce 9200" }, + { 0x10DE0872, "GeForce G102M" }, + { 0x10DE0873, "GeForce G205M" }, + { 0x10DE0874, "ION 9300M" }, + { 0x10DE0876, "ION 9400M" }, + { 0x10DE087A, "GeForce 9400" }, + { 0x10DE087D, "ION 9400M" }, + { 0x10DE087E, "ION LE" }, + { 0x10DE087F, "ION LE" }, // Tesla M2070-Q ?? + // 0880 - 088F + // 0890 - 089F + // 08A0 - 08AF + { 0x10DE08A0, "GeForce 320M" }, + { 0x10DE08A1, "MCP89-MZT" }, + { 0x10DE08A2, "GeForce 320M" }, + { 0x10DE08A3, "GeForce 320M" }, + { 0x10DE08A4, "GeForce 320M" }, + { 0x10DE08A5, "GeForce 320M" }, + // 08B0 - 08BF + { 0x10DE08B0, "MCP83 MMD" }, + { 0x10DE08B1, "GeForce 300M" }, + { 0x10DE08B2, "GeForce 300M" }, // MCP83-MJ + { 0x10DE08B3, "MCP89 MM9" }, + // 08C0 - 08CF + // 08D0 - 08DF + // 08E0 - 08EF + // 08F0 - 08FF + // 0900 - 090F + // 0910 - 091F + // 0920 - 092F + // 0930 - 093F + // 0940 - 094F + // 0950 - 095F + // 0960 - 096F + // 0970 - 097F + // 0980 - 098F + // 0990 - 099F + // 09A0 - 09AF + // 09B0 - 09BF + // 09C0 - 09CF + // 09D0 - 09DF + // 09E0 - 09EF + // 09F0 - 09FF + // 0A00 - 0A0F + // { 0x10DE0A00, "NVIDIA GT212" }, + // 0A10 - 0A1F + // { 0x10DE0A10, "NVIDIA GT212" }, + // 0A20 - 0A2F + { 0x10DE0A20, "GeForce GT 220" }, + { 0x10DE0A21, "D10M2-20" }, + { 0x10DE0A22, "GeForce 315" }, + { 0x10DE0A23, "GeForce 210" }, + { 0x10DE0A26, "GeForce 405" }, + { 0x10DE0A27, "GeForce 405" }, + { 0x10DE0A28, "GeForce GT 230" }, + { 0x10DE0A29, "GeForce GT 330M" }, + { 0x10DE0A2A, "GeForce GT 230M" }, + { 0x10DE0A2B, "GeForce GT 330M" }, + { 0x10DE0A2C, "NVS 5100M" }, + { 0x10DE0A2D, "GeForce GT 320M" }, + // 0A30 - 0A3F + { 0x10DE0A30, "GeForce GT 330M" }, + { 0x10DE0A32, "GeForce GT 415" }, + { 0x10DE0A34, "GeForce GT 240M" }, + { 0x10DE0A35, "GeForce GT 325M" }, + { 0x10DE0A38, "Quadro 400" }, + { 0x10DE0A3C, "Quadro FX 880M" }, + { 0x10DE0A3D, "N10P-ES" }, + { 0x10DE0A3F, "GT216-INT" }, + // 0A40 - 0A4F + // 0A50 - 0A5F + // 0A60 - 0A6F + { 0x10DE0A60, "GeForce G210" }, + { 0x10DE0A61, "NVS 2100" }, + { 0x10DE0A62, "GeForce 205" }, + { 0x10DE0A63, "GeForce 310" }, + { 0x10DE0A64, "ION" }, + { 0x10DE0A65, "GeForce 210" }, + { 0x10DE0A66, "GeForce 310" }, + { 0x10DE0A67, "GeForce 315" }, + { 0x10DE0A68, "GeForce G105M" }, + { 0x10DE0A69, "GeForce G105M" }, + { 0x10DE0A6A, "NVS 2100M" }, + { 0x10DE0A6C, "NVS 3100M" }, + { 0x10DE0A6E, "GeForce 305M" }, + { 0x10DE0A6F, "ION" }, + // 0A70 - 0A7F + { 0x10DE0A70, "GeForce 310M" }, + { 0x10DE0A71, "GeForce 305M" }, + { 0x10DE0A72, "GeForce 310M" }, + { 0x10DE0A73, "GeForce 305M" }, + { 0x10DE0A74, "GeForce G210M" }, + { 0x10DE0A75, "GeForce G310M" }, + { 0x10DE0A76, "ION" }, + { 0x10DE0A78, "Quadro FX 380 LP" }, + // { 0x10DE0A79, "N12M-NS-S" }, + { 0x10DE0A7A, "GeForce 315M" }, + { 0x10DE0A7B, "GeForce 505" }, + { 0x10DE0A7C, "Quadro FX 380M" }, + { 0x10DE0A7D, "N11M-ES" }, //SUBIDS + { 0x10DE0A7E, "GT218-INT-S" }, + { 0x10DE0A7F, "GT218-INT-B" }, + // 0A80 - 0A8F + // 0A90 - 0A9F + // 0AA0 - 0AAF + // 0AB0 - 0ABF + // 0AC0 - 0ACF + // 0AD0 - 0ADF + // 0AE0 - 0AEF + // 0AF0 - 0AFF + // 0B00 - 0B0F + // 0B10 - 0B1F + // 0B20 - 0B2F + // 0B30 - 0B3F + // 0B40 - 0B4F + // 0B50 - 0B5F + // 0B60 - 0B6F + // 0B70 - 0B7F + // 0B80 - 0B8F + // 0B90 - 0B9F + // 0BA0 - 0BAF + // 0BB0 - 0BBF + // 0BC0 - 0BCF + // 0BD0 - 0BDF + // 0BE0 - 0BEF + // 0BF0 - 0BFF + // 0C00 - 0C0F + // 0C10 - 0C1F + // 0C20 - 0C2F + // 0C30 - 0C3F + // 0C40 - 0C4F + // 0C50 - 0C5F + // 0C60 - 0C6F + // 0C70 - 0C7F + // 0C80 - 0C8F + // 0C90 - 0C9F + // 0CA0 - 0CAF + { 0x10DE0CA0, "GeForce GT 330 " }, + { 0x10DE0CA2, "GeForce GT 320" }, + { 0x10DE0CA3, "GeForce GT 240" }, + { 0x10DE0CA4, "GeForce GT 340" }, + { 0x10DE0CA5, "GeForce GT 220" }, + { 0x10DE0CA7, "GeForce GT 330" }, + { 0x10DE0CA8, "GeForce GTS 260M" }, + { 0x10DE0CA9, "GeForce GTS 250M" }, + { 0x10DE0CAC, "GeForce GT 220" }, + { 0x10DE0CAD, "N10E-ES" }, // SUBIDS + { 0x10DE0CAE, "GT215-INT" }, + { 0x10DE0CAF, "GeForce GT 335M" }, + // 0CB0 - 0CBF + { 0x10DE0CB0, "GeForce GTS 350M" }, + { 0x10DE0CB1, "GeForce GTS 360M" }, + { 0x10DE0CBC, "Quadro FX 1800M" }, + // 0CC0 - 0CCF + // 0CD0 - 0CDF + // 0CE0 - 0CEF + // 0CF0 - 0CFF + // 0D00 - 0D0F + // 0D10 - 0D1F + // 0D20 - 0D2F + // 0D30 - 0D3F + // 0D40 - 0D4F + // 0D50 - 0D5F + // 0D60 - 0D6F + // 0D70 - 0D7F + // 0D80 - 0D8F + // 0D90 - 0D9F + // 0DA0 - 0DAF + // 0DB0 - 0DBF + // 0DC0 - 0DCF + { 0x10DE0DC0, "GeForce GT 440" }, + // { 0x10DE0DC1, "D12-P1-35" }, + // { 0x10DE0DC2, "D12-P1-35" }, + { 0x10DE0DC4, "GeForce GTS 450" }, + { 0x10DE0DC5, "GeForce GTS 450" }, + { 0x10DE0DC6, "GeForce GTS 450" }, + // { 0x10DE0DCA, "GF10x" }, + // { 0x10DE0DCC, "N12E-GS" }, + { 0x10DE0DCD, "GeForce GT 555M" }, + { 0x10DE0DCE, "GeForce GT 555M" }, + // { 0x10DE0DCF, "N12P-GT-B" }, + // 0DD0 - 0DDF + // { 0x10DE0DD0, "N11E-GT" }, + { 0x10DE0DD1, "GeForce GTX 460M" }, + { 0x10DE0DD2, "GeForce GT 445M" }, + { 0x10DE0DD3, "GeForce GT 435M" }, + { 0x10DE0DD6, "GeForce GT 550M" }, + { 0x10DE0DD8, "Quadro 2000" }, + { 0x10DE0DDA, "Quadro 2000M" }, + { 0x10DE0DDE, "GF106-ES" }, + // { 0x10DE0DDF, "GF106-INT" }, + // 0DE0 - 0DEF + { 0x10DE0DE0, "GeForce GT 440" }, + { 0x10DE0DE1, "GeForce GT 430" }, + { 0x10DE0DE2, "GeForce GT 420" }, + { 0x10DE0DE3, "GeForce GT 635M" }, + { 0x10DE0DE4, "GeForce GT 520" }, + { 0x10DE0DE5, "GeForce GT 530" }, + { 0x10DE0DE8, "GeForce GT 620M" }, + { 0x10DE0DE9, "GeForce GT 630M" }, + { 0x10DE0DEA, "GeForce GT 610M" }, + { 0x10DE0DEB, "GeForce GT 555M" }, + { 0x10DE0DEC, "GeForce GT 525M" }, + { 0x10DE0DED, "GeForce GT 520M" }, + { 0x10DE0DEE, "GeForce GT 415M" }, + { 0x10DE0DEF, "N13P-NS1-A1" }, + // 0DF0 - 0DFF + { 0x10DE0DF0, "GeForce GT 425M" }, + { 0x10DE0DF1, "GeForce GT 420M" }, + { 0x10DE0DF2, "GeForce GT 435M" }, + { 0x10DE0DF3, "GeForce GT 420M" }, + { 0x10DE0DF4, "GeForce GT 540M" }, + { 0x10DE0DF5, "GeForce GT 525M" }, + { 0x10DE0DF6, "GeForce GT 550M" }, + { 0x10DE0DF7, "GeForce GT 520M" }, + { 0x10DE0DF8, "Quadro 600" }, + { 0x10DE0DF9, "Quadro 500M" }, + { 0x10DE0DFA, "Quadro 1000M" }, + { 0x10DE0DFC, "NVS 5200M" }, + { 0x10DE0DFE, "GF108 ES" }, + // { 0x10DE0DFF, "GF108 INT" }, + // 0E00 - 0E0F + // 0E10 - 0E1F + // 0E20 - 0E2F + { 0x10DE0E21, "D12U-25" }, + { 0x10DE0E22, "GeForce GTX 460" }, + { 0x10DE0E23, "GeForce GTX 460 SE" }, + { 0x10DE0E24, "GeForce GTX 460" }, + // { 0x10DE0E25, "D12U-50" }, + { 0x10DE0E28, "GeForce GTX 460" }, + // 0E30 - 0E3F + { 0x10DE0E30, "GeForce GTX 470M" }, + { 0x10DE0E31, "GeForce GTX 485M" }, + // { 0x10DE0E32, "N12E-GT" }, + { 0x10DE0E38, "GF104GL" }, + { 0x10DE0E3A, "Quadro 3000M" }, + { 0x10DE0E3B, "Quadro 4000M" }, + // { 0x10DE0E3E, "GF104-ES" }, + // { 0x10DE0E3F, "GF104-INT" }, + // 0E40 - 0E4F + // 0E50 - 0E5F + // 0E60 - 0E6F + // 0E70 - 0E7F + // 0E80 - 0E8F + // 0E90 - 0E9F + // 0EA0 - 0EAF + // 0EB0 - 0EBF + // 0EC0 - 0ECF + // 0ED0 - 0EDF + // 0EE0 - 0EEF + // 0EF0 - 0EFF + // 0F00 - 0F0F + { 0x10DE0F00, "GeForce GT 630" }, + { 0x10DE0F01, "GeForce GT 620" }, + // 0F10 - 0F1F + // 0F20 - 0F2F + // 0F30 - 0F3F + // 0F40 - 0F4F + // 0F50 - 0F5F + // 0F60 - 0F6F + // 0F70 - 0F7F + // 0F80 - 0F8F + // 0F90 - 0F9F + // 0FA0 - 0FAF + // 0FB0 - 0FBF + // 0FC0 - 0FCF + { 0x10DE0FC0, "GeForce GT 640" }, + { 0x10DE0FC1, "GeForce GT 640" }, + { 0x10DE0FC2, "GeForce GT 630" }, + { 0x10DE0FC6, "GeForce GTX 650" }, + // 0FD0 - 0FDF + { 0x10DE0FD1, "GeForce GT 650M" }, + { 0x10DE0FD2, "GeForce GT 640M" }, + { 0x10DE0FD3, "GeForce GT 640M LE" }, + { 0x10DE0FD4, "GeForce GTX 660M" }, + { 0x10DE0FD5, "GeForce GT 650M" }, + { 0x10DE0FD8, "GeForce GT 640M" }, + { 0x10DE0FD9, "GeForce GT 645M" }, + { 0x10DE0FDB, "GK107-ESP-A1" }, + { 0x10DE0FDF, "GeForce GT 740M" }, + // 0FE0 - 0FEF + { 0x10DE0FE0, "GeForce GTX 660M" }, + { 0x10DE0FE1, "GeForce GT 730M" }, + { 0x10DE0FE3, "GeForce GT 745M" }, + { 0x10DE0FE4, "GeForce GT 750M" }, + // 0FF0 - 0FFF + { 0x10DE0FF2, "VGX K1" }, + { 0x10DE0FF8, "Quadro K500M" }, + { 0x10DE0FF9, "Quadro K2000D" }, + { 0x10DE0FFA, "Quadro K600" }, + { 0x10DE0FFB, "Quadro K2000M" }, + { 0x10DE0FFC, "Quadro K1000M" }, + { 0x10DE0FFD, "NVS 510" }, + { 0x10DE0FFE, "Quadro K2000" }, + { 0x10DE0FFF, "Quadro 410" }, + // 1000 - 100F + { 0x10DE1003, "GeForce GTX Titan LE" }, + { 0x10DE1004, "GeForce GTX 780" }, + { 0x10DE1005, "GeForce GTX Titan" }, + // 1010 - 101F + { 0x10DE101F, "Tesla K20" }, + // 1020 - 102F + { 0x10DE1020, "Tesla K20X" }, + { 0x10DE1021, "Tesla K20Xm" }, + { 0x10DE1022, "Tesla K20c" }, + { 0x10DE1026, "Tesla K20s" }, + { 0x10DE1028, "Tesla K20m" }, + // 1030 - 103F + // 1040 - 104F + { 0x10DE1040, "GeForce GT 520" }, + // { 0x10DE1041, "D13M1-45" }, + { 0x10DE1042, "GeForce 510" }, + { 0x10DE1048, "GeForce 605" }, + { 0x10DE1049, "GeForce GT 620" }, + { 0x10DE104A, "GeForce GT 610" }, + { 0x10DE104B, "GeForce GT 625" }, + // 1050 - 105F + { 0x10DE1050, "GeForce GT 520M" }, + { 0x10DE1051, "GeForce GT 520MX" }, + { 0x10DE1052, "GeForce GT 520M" }, + { 0x10DE1054, "GeForce GT 410M" }, + { 0x10DE1055, "GeForce 410M" }, + { 0x10DE1056, "Quadro NVS 4200M" }, + { 0x10DE1057, "Quadro NVS 4200M" }, + { 0x10DE1058, "GeForce GT 610M" }, + { 0x10DE1059, "GeForce 610M" }, + { 0x10DE105A, "GeForce 610M" }, + { 0x10DE105B, "GeForce 705A" }, + // 1060 - 106F + // 1070 - 107F + { 0x10DE107C, "Quadro NVS 315" }, + { 0x10DE107D, "Quadro NVS 310" }, + // { 0x10DE107E, "GF119-INT" }, + { 0x10DE107F, "GF119-ES" }, + // 1080 - 108F + { 0x10DE1080, "GeForce GTX 580" }, + { 0x10DE1081, "GeForce GTX 570" }, + { 0x10DE1082, "GeForce GTX 560 Ti" }, + { 0x10DE1083, "D13U" }, + { 0x10DE1084, "GeForce GTX 560" }, + { 0x10DE1086, "GeForce GTX 570 HD" }, + { 0x10DE1087, "GeForce GTX 560 Ti-448" }, + { 0x10DE1088, "GeForce GTX 590" }, + { 0x10DE1089, "GeForce GTX 580" }, + { 0x10DE108B, "GeForce GTX 590" }, + // { 0x10DE108C, "D13U" }, + { 0x10DE108E, "Tesla C2090" }, + // 1090 - 109F + { 0x10DE1091, "Tesla M2090" }, // X2090 + { 0x10DE1094, "Tesla M2075" }, + { 0x10DE1096, "Tesla C2075" }, + { 0x10DE1098, "D13U" }, + { 0x10DE109A, "Quadro 5010M" }, + { 0x10DE109B, "Quadro 7000" }, + // 10A0 - 10AF + // 10B0 - 10BF + // 10C0 - 10CF + { 0x10DE10C0, "GeForce 9300 GS" }, + { 0x10DE10C3, "GeForce 8400 GS" }, + { 0x10DE10C4, "ION" }, + { 0x10DE10C5, "GeForce 405" }, + // 10D0 - 10DF + { 0x10DE10D8, "Quadro NVS 300" }, + // 10E0 - 10EF + // 10F0 - 10FF + // 1100 - 110F + // 1110 - 111F + // 1120 - 112F + // 1130 - 113F + // 1140 - 114F + { 0x10DE1140, "GeForce GT 610M" }, + { 0x10DE1141, "GeForce 610M" }, + { 0x10DE1142, "GeForce 620M" }, + // { 0x10DE1143, "N13P-GV" }, + // { 0x10DE1144, "GF117" }, + // { 0x10DE1145, "GF117" }, + // { 0x10DE1146, "GF117" }, + // { 0x10DE1147, "GF117" }, + { 0x10DE1149, "GF117-ES" }, + // { 0x10DE114A, "GF117-INT" }, + // { 0x10DE114B, "PCI-GEN3-B" }, + // 1150 - 115F + // 1160 - 116F + // 1170 - 117F + // 1180 - 118F + { 0x10DE1180, "GeForce GTX 680" }, + { 0x10DE1183, "GeForce GTX 660 Ti" }, + { 0x10DE1185, "GeForce GTX 660" }, + { 0x10DE1188, "GeForce GTX 690" }, + { 0x10DE1189, "GeForce GTX 670" }, + { 0x10DE118F, "Tesla K10" }, + // 1190 - 119F + { 0x10DE119F, "GeForce GTX 780M" }, + // 11A0 - 11AF + { 0x10DE11A0, "GeForce GTX 680M" }, + { 0x10DE11A1, "GeForce GTX 670MX" }, + { 0x10DE11A2, "GeForce GTX 675MX" }, + { 0x10DE11A3, "GeForce GTX 680MX" }, + { 0x10DE11A7, "GeForce GTX 675MX" }, + // 11B0 - 11BF + { 0x10DE11BA, "Quadro K5000" }, + { 0x10DE11BC, "Quadro K5000M" }, + { 0x10DE11BD, "Quadro K4000M" }, + { 0x10DE11BE, "Quadro K3000M" }, + { 0x10DE11BF, "VGX K2" }, + // 11C0 - 11CF + { 0x10DE11C0, "GeForce GTX 660" }, + { 0x10DE11C2, "GeForce GTX 650 Ti BOOST" }, + { 0x10DE11C3, "GeForce GTX 650 Ti" }, + { 0x10DE11C4, "GeForce GTX 645" }, + { 0x10DE11C6, "GeForce GTX 650 Ti" }, + // 11D0 - 11DF + // 11E0 - 11EF + { 0x10DE11E0, "GeForce GTX 770M" }, + { 0x10DE11E1, "N14E-GE-B-A1" }, + { 0x10DE11E2, "GeForce GTX 765M" }, + { 0x10DE11E3, "GeForce GTX 760M" }, + // 11F0 - 11FF + { 0x10DE11FA, "Quadro K4000" }, + // 1200 - 120F + { 0x10DE1200, "GeForce GTX 560 Ti" }, + { 0x10DE1201, "GeForce GTX 560" }, + { 0x10DE1202, "GeForce GTX 560 Ti" }, + { 0x10DE1203, "GeForce GTX 460 SE v2" }, + { 0x10DE1205, "GeForce GTX 460 v2" }, + { 0x10DE1206, "GeForce GTX 555" }, + { 0x10DE1207, "GeForce GT 645" }, + { 0x10DE1208, "GeForce GTX 560 SE" }, + { 0x10DE1210, "GeForce GTX 570M" }, + { 0x10DE1211, "GeForce GTX 580M" }, + { 0x10DE1212, "GeForce GTX 675M" }, + { 0x10DE1213, "GeForce GTX 670M" }, + { 0x10DE1240, "GeForce GT 620M" }, + { 0x10DE1241, "GeForce GT 545" }, + { 0x10DE1243, "GeForce GT 545" }, + { 0x10DE1244, "GeForce GTX 550 Ti" }, + { 0x10DE1245, "GeForce GTS 450" }, + { 0x10DE1246, "GeForce GT 550M" }, + { 0x10DE1247, "GeForce GT 555M" }, + { 0x10DE1248, "GeForce GT 555M" }, + { 0x10DE1249, "GeForce GTS 450" }, + { 0x10DE124B, "GeForce GT 640" }, + { 0x10DE124D, "GeForce GT 555M" }, + // { 0x10DE1250, "GF116-INT" }, + { 0x10DE1251, "GeForce GTX 560M" }, + // 1260 - 126F + // 1270 - 127F + // 1280 - 128F + { 0x10DE1280, "GeForce GT 635" }, + // 1290 - 129F + { 0x10DE1290, "GeForce GT 730M" }, + { 0x10DE1291, "GeForce GT 735M" }, + { 0x10DE1292, "GeForce GT 740M" }, + { 0x10DE1293, "GeForce GT 730M" }, + { 0x10DE1294, "GeForce GT 740M" }, + // 12A0 - 12AF + //{ 0x10DE12A0, "GeForce GT ???" }, + // 12B0 - 12BF + // 12C0 - 12CF + // 12D0 - 12DF + // 12E0 - 12EF + // 12F0 - 12FF +}; + +static nvidia_card_info_t nvidia_card_exceptions[] = { + /* ======================================================================================== + * Layout is device(VendorId + DeviceId), subdev (SubvendorId + SubdeviceId), display name. + * ======================================================================================== + */ + /* ------ Specific DeviceID and SubDevID. ------ */ + // 0000 - 00FF + { 0x10DE0040, 0x10438178, "Asus V9999 Ultra V62.11" }, + { 0x10DE0040, 0x1043817D, "Asus V9999GT V61.21" }, + { 0x10DE0040, 0x7FFFFFFF, "GeForce 6800 Ultra [NV40.0]" }, + // 0100 - 01FF + { 0x10DE01D7, 0x102801C2, "Dell Quadro NVS 110M" }, + { 0x10DE01D7, 0x102801CC, "Dell Quadro NVS 110M" }, + { 0x10DE01D7, 0x10DE014B, "nVidia Quadro NVS 110M" }, + + { 0x10DE01D8, 0x102801CC, "Dell Quadro NVS 120M" }, + { 0x10DE01D8, 0x10282003, "Dell Quadro NVS 120M" }, + + { 0x10DE01DA, 0x10280407, "Dell GeForce 7300 LE" }, + // 0200 - 02FF + { 0x10DE025B, 0x10480D23, "ELSA Gloria4 700XGL" }, + // 0300 - 03FF + { 0x10DE0391, 0x10DE047A, "Galaxy GeForce 7600 GT" }, + { 0x10DE0391, 0x19F120DE, "Galaxy GeForce 7600 GT" }, + + { 0x10DE0393, 0x00000400, "Apple GeForce 7300GT" }, + // 0400 - 04FF + { 0x10DE0402, 0x10DE0439, "Galaxy 8600GT" }, + { 0x10DE0402, 0x10DE0505, "Galaxy 8600GT" }, + // 0500 - 05FF + { 0x10DE05E2, 0x104382EB, "ASUS ENGTX260" }, + { 0x10DE05E2, 0x16822390, "HFX GeForce GTX 260" }, + { 0x10DE05E2, 0x17870000, "HIS GeForce GTX 260" }, + + { 0x10DE05E6, 0x10B00401, "Gainward GeForce GTX 285" }, + + { 0x10DE05E7, 0x10DE0595, "nVidia Tesla T10 Processor" }, + { 0x10DE05E7, 0x10DE066A, "nVidia Tesla C1060" }, + { 0x10DE05E7, 0x10DE068F, "nVidia Tesla T10 Processor" }, + { 0x10DE05E7, 0x10DE0697, "nVidia Tesla M1060" }, + { 0x10DE05E7, 0x10DE0714, "nVidia Tesla M1060" }, + { 0x10DE05E7, 0x10DE0743, "nVidia Tesla M1060" }, + // 0600 - 06FF + { 0x10DE0600, 0x10DE0000, "Abit GeForce 8800 GTS" }, + + { 0x10DE0605, 0x145834A2, "Gigabyte GV-N98TOC-512H" }, + + { 0x10DE0608, 0x15880577, "Solidum GeForce 9800M GTX" }, + + { 0x10DE0609, 0x11700121, "Inventec GeForce 8800M GTS" }, + + { 0x10DE0612, 0x104382A6, "Asus GeForce 9800 GTX+" }, + { 0x10DE0612, 0x10DE0571, "nVidia GeForce 9800 GTX+" }, + { 0x10DE0612, 0x10DE0592, "nVidia GeForce 9800 GTX+" }, + { 0x10DE0612, 0x3842C842, "EVGA GeForce 9800 GTX+" }, + { 0x10DE0612, 0x3842C875, "EVGA GeForce 9800 GTX+" }, + + { 0x10DE0615, 0x10480F67, "ELSA GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0592, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0593, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0652, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0719, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE079E, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x11503842, "TMC GeForce GTS 250" }, // Thinking Machines Corporation + { 0x10DE0615, 0x11513842, "JAE GeForce GTS 250" }, + { 0x10DE0615, 0x11553842, "Pine GeForce GTS 250" }, + { 0x10DE0615, 0x11563842, "Periscope GeForce GTS 250" }, + + { 0x10DE0618, 0x10432028, "Asus GeForce GTX 170M" }, + { 0x10DE0618, 0x1043202B, "Asus GeForce GTX 680" }, + + { 0x10DE0622, 0x104382AC, "Asus EN9600GT Magic" }, + + { 0x10DE0640, 0x10DE077F, "Inno3D GeForce 9500GT HDMI" }, + + { 0x10DE0649, 0x1043202D, "Asus GeForce GT 220M" }, + + { 0x10DE06CD, 0x10DE079F, "Point of View GeForce GTX 470" }, + { 0x10DE06CD, 0x14622220, "MSi GeForce GTX 470 Twin Frozr II" }, + + { 0x10DE06D1, 0x10DE0772, "nVidia Tesla C2070" }, + + { 0x10DE06D2, 0x10DE088F, "nVidia Tesla X2070" }, + + { 0x10DE06DE, 0x10DE0773, "nVidia Tesla S2050" }, + { 0x10DE06DE, 0x10DE0830, "nVidia Tesla M2070" }, + { 0x10DE06DE, 0x10DE0831, "nVidia Tesla M2070" }, + { 0x10DE06DE, 0x10DE0832, "nVidia Tesla M2070" }, + { 0x10DE06DE, 0x10DE0840, "nVidia Tesla X2070" }, + + { 0x10DE06E4, 0x10438322, "Asus EN8400GS" }, + { 0x10DE06E4, 0x14583475, "GV-NX84S256HE [GeForce 8400 GS]" }, + + { 0x10DE06E8, 0x10280262, "Dell GeForce 9200M GS" }, + { 0x10DE06E8, 0x10280271, "Dell GeForce 9200M GS" }, + { 0x10DE06E8, 0x10280272, "Dell GeForce 9200M GS" }, + { 0x10DE06E8, 0x103C30F4, "HP GeForce 9200M GS" }, + { 0x10DE06E8, 0x103C30F7, "HP GeForce 9200M GS" }, + { 0x10DE06E8, 0x103C3603, "HP GeForce 9200M GS" }, + // 0700 - 07FF + // 0800 - 08FF + { 0x10DE0873, 0x104319B4, "Asus GeForce G102M" }, + // 0900 - 09FF + // 0A00 - 0AFF + { 0x10DE0A6F, 0x12974003, "Shuttle XS 3510MA" }, + + { 0x10DE0A70, 0x17AA3605, "Lenovo ION" }, + + { 0x10DE0A73, 0x17AA3607, "Lenovo ION" }, + { 0x10DE0A73, 0x17AA3610, "Lenovo ION" }, + + { 0x10DE0A75, 0x17AA3605, "Lenovo ION" }, + // 0B00 - 0BFF + // 0C00 - 0CFF + { 0x10DE0CA3, 0x14628041, "MSi VN240GT-MD1G" }, + { 0x10DE0CA3, 0x16423926, "Bitland GeForce GT 230" }, + // 0D00 - 0DFF + { 0x10DE0DD8, 0x10DE0914, "nVidia Quadro 2000D" }, + + { 0x10DE0DEF, 0x17AA21F3, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA21F4, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA21F5, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA21F6, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA5005, "Lenovo NVS 5400M" }, + + // 0E00 - 0EFF + { 0x10DE0E22, 0x1043835D, "Asus ENGTX460" }, + + { 0x10DE0E23, 0x10B00401, "Gainward GeForce GTX 460" }, + // 0F00 - 0FFF + { 0x10DE0FD2, 0x10280595, "Dell GeForce GT 640M LE" }, + { 0x10DE0FD2, 0x102805B2, "Dell GeForce GT 640M LE" }, + // 1000 - 10FF + { 0x10DE1080, 0x14622561, "MSI N580GTX Lightning" }, + { 0x10DE1080, 0x14622563, "MSI N580GTX Lightning" }, + + { 0x10DE1086, 0x10DE0871, "Inno3D GeForce GTX 570" }, + + { 0x10DE1087, 0x104383D6, "Asus ENGTX560Ti448 DCII" }, + + { 0x10DE1091, 0x10DE088E, "nVidia Tesla X2090" }, + { 0x10DE1091, 0x10DE0891, "nVidia Tesla X2090" }, + // 1100 - 11FF + { 0x10DE1140, 0x1025064A, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x1025064C, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250680, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250692, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250694, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250702, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250719, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250725, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250728, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x1025072B, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x1025072E, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250732, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10280565, "Dell GeForce GT 630M" }, + { 0x10DE1140, 0x10280568, "Dell GeForce GT 630M" }, + { 0x10DE1140, 0x144DC0D5, "Samsung GeForce GT 630M" }, + { 0x10DE1140, 0x17AA500D, "Lenovo GeForce GT 620M" }, + { 0x10DE1140, 0x1B0A20DD, "Pegatron GeForce GT 620M" }, + { 0x10DE1140, 0x1B0A20FD, "Pegatron GeForce GT 620M" }, + + { 0x10DE1180, 0x00001255, "Afox GTX 680" }, + { 0x10DE1180, 0x104383F0, "Asus GTX680-2GD5" }, + { 0x10DE1180, 0x104383F6, "Asus GTX 680 Direct CU II" }, + { 0x10DE1180, 0x104383F7, "Asus GTX 680 Direct CU II" }, + { 0x10DE1180, 0x1458353C, "GV-N680OC-2GD WindForce GTX 680 OC" }, + { 0x10DE1180, 0x14622820, "MSi N680GTX TwinFrozer" }, + { 0x10DE1180, 0x14622830, "MSi GTX 680 Lightning" }, + { 0x10DE1180, 0x14622831, "MSi GTX 680 Lightning LN2" }, + { 0x10DE1180, 0x15691180, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x15691181, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x15691189, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x38422682, "EVGA GTX 680 SC" }, + { 0x10DE1180, 0x38422683, "EVGA GTX 680 SC" }, + + { 0x10DE1189, 0x10438405, "Asus GTX 670 Direct CU II TOP" }, + { 0x10DE1189, 0x15691189, "Palit GTX 670 JetStream" }, + { 0x10DE1189, 0x19DA1255, "Zotac GTX 670 AMP! Edition" }, + + { 0x10DE11A1, 0x15587102, "Clevo N13E-GR" }, + + { 0x10DE11C0, 0x10DE0995, "Inno3D GeForce GTX660" }, + + { 0x10DE11C6, 0x1043842A, "GTX650TI-1GD5" }, + // 1200 - 12FF + { 0x10DE1247, 0x10432119, "Asus GeForce GT 670M" }, + { 0x10DE1247, 0x10432120, "Asus GeForce GT 670M" }, + { 0x10DE1247, 0x1043212A, "Asus GeForce GT 635M" }, + { 0x10DE1247, 0x1043212B, "Asus GeForce GT 635M" }, + { 0x10DE1247, 0x1043212C, "Asus GeForce GT 635M" }, + { 0x10DE1247, 0x152D0930, "Quanta GeForce GT 635M" }, + + { 0x10DE1248, 0x152D0930, "Quanta GeForce GT 635M" }, + + { 0x10DE124D, 0x146210CC, "MSi GeForce GT 635M" }, +}; + +static int patch_nvidia_rom(uint8_t *rom) +{ + if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) { + printf("False ROM signature: 0x%02x%02x\n", rom[0], rom[1]); + return PATCH_ROM_FAILED; + } + + uint16_t dcbptr = READ_LE_SHORT(rom, 0x36); + + if (!dcbptr) { + printf("no dcb table found\n"); + return PATCH_ROM_FAILED; + } +// else +// printf("dcb table at offset 0x%04x\n", dcbptr); + + uint8_t *dcbtable = &rom[dcbptr]; + uint8_t dcbtable_version = dcbtable[0]; + uint8_t headerlength = 0; + uint8_t numentries = 0; + uint8_t recordlength = 0; + + if (dcbtable_version >= 0x20) + { + uint32_t sig; + + if (dcbtable_version >= 0x30) + { + headerlength = dcbtable[1]; + numentries = dcbtable[2]; + recordlength = dcbtable[3]; + + sig = READ_LE_INT(dcbtable, 6); + } + else + { + sig = READ_LE_INT(dcbtable, 4); + headerlength = 8; + } + + if (sig != 0x4edcbdcb) + { + printf("Bad display config block signature (0x%8x)\n", sig); //Azi: issue #48 + return PATCH_ROM_FAILED; + } + } + else if (dcbtable_version >= 0x14) /* some NV15/16, and NV11+ */ + { + char sig[8] = { 0 }; + + strncpy(sig, (char *)&dcbtable[-7], 7); + recordlength = 10; + + if (strcmp(sig, "DEV_REC")) + { + printf("Bad Display Configuration Block signature (%s)\n", sig); + return PATCH_ROM_FAILED; + } + } + else + { + printf("ERROR: dcbtable_version is 0x%X\n", dcbtable_version); + return PATCH_ROM_FAILED; + } + + if (numentries >= MAX_NUM_DCB_ENTRIES) + numentries = MAX_NUM_DCB_ENTRIES; + + uint8_t num_outputs = 0, i = 0; + + struct dcbentry + { + uint8_t type; + uint8_t index; + uint8_t *heads; + } entries[numentries]; + + for (i = 0; i < numentries; i++) + { + uint32_t connection; + connection = READ_LE_INT(dcbtable,headerlength + recordlength * i); + + /* Should we allow discontinuous DCBs? Certainly DCB I2C tables can be discontinuous */ + if ((connection & 0x0000000f) == 0x0000000f) /* end of records */ + continue; + if (connection == 0x00000000) /* seen on an NV11 with DCB v1.5 */ + continue; + if ((connection & 0xf) == 0x6) /* we skip type 6 as it doesnt appear on macbook nvcaps */ + continue; + + entries[num_outputs].type = connection & 0xf; + entries[num_outputs].index = num_outputs; + entries[num_outputs++].heads = (uint8_t*)&(dcbtable[(headerlength + recordlength * i) + 1]); + + } + + int has_lvds = false; + uint8_t channel1 = 0, channel2 = 0; + + for (i = 0; i < num_outputs; i++) + { + if (entries[i].type == 3) + { + has_lvds = true; + //printf("found LVDS\n"); + channel1 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + } + } + + // if we have a LVDS output, we group the rest to the second channel + if (has_lvds) + { + for (i = 0; i < num_outputs; i++) + { + if (entries[i].type == TYPE_GROUPED) + continue; + + channel2 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + } + } + else + { + int x; + // we loop twice as we need to generate two channels + for (x = 0; x <= 1; x++) + { + for (i=0; i<num_outputs; i++) + { + if (entries[i].type == TYPE_GROUPED) + continue; + // if type is TMDS, the prior output is ANALOG + // we always group ANALOG and TMDS + // if there is a TV output after TMDS, we group it to that channel as well + if (i && entries[i].type == 0x2) + { + switch (x) + { + case 0: + //printf("group channel 1\n"); + channel1 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + + if (entries[i-1].type == 0x0) + { + channel1 |= ( 0x1 << entries[i-1].index); + entries[i-1].type = TYPE_GROUPED; + } + // group TV as well if there is one + if ( ((i+1) < num_outputs) && (entries[i+1].type == 0x1) ) + { + // printf("group tv1\n"); + channel1 |= ( 0x1 << entries[i+1].index); + entries[i+1].type = TYPE_GROUPED; + } + break; + + case 1: + //printf("group channel 2 : %d\n", i); + channel2 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + + if (entries[i - 1].type == 0x0) + { + channel2 |= ( 0x1 << entries[i-1].index); + entries[i-1].type = TYPE_GROUPED; + } + // group TV as well if there is one + if ( ((i+1) < num_outputs) && (entries[i+1].type == 0x1) ) + { + // printf("group tv2\n"); + channel2 |= ( 0x1 << entries[i+1].index); + entries[i+1].type = TYPE_GROUPED; + } + break; + default: + break; + } + break; + } + } + } + } + + // if we have left ungrouped outputs merge them to the empty channel + uint8_t *togroup;// = (channel1 ? (channel2 ? NULL : &channel2) : &channel1); + togroup = &channel2; + + for (i = 0; i < num_outputs; i++) + { + if (entries[i].type != TYPE_GROUPED) + { + //printf("%d not grouped\n", i); + if (togroup) + { + *togroup |= ( 0x1 << entries[i].index); + } + entries[i].type = TYPE_GROUPED; + } + } + + if (channel1 > channel2) + { + uint8_t buff = channel1; + channel1 = channel2; + channel2 = buff; + } + + default_NVCAP[6] = channel1; + default_NVCAP[8] = channel2; + + // patching HEADS + for (i = 0; i < num_outputs; i++) + { + if (channel1 & (1 << i)) + { + *entries[i].heads = 1; + } + else if(channel2 & (1 << i)) + { + *entries[i].heads = 2; + } + } + return (has_lvds ? PATCH_ROM_SUCCESS_HAS_LVDS : PATCH_ROM_SUCCESS); +} + +static char *get_nvidia_model(uint32_t device_id, uint32_t subsys_id) +{ +// int i, j; + int i; +// static char name_model[128]; + + // First check in the plist, (for e.g this can override any hardcoded devices) + cardList_t * nvcard = FindCardWithIds(device_id, subsys_id); + if (nvcard) + { + if (nvcard->model) + { + return nvcard->model; + } + } + + // Then check the exceptions table + if (subsys_id) + { + for (i = 0; i < (sizeof(nvidia_card_exceptions) / sizeof(nvidia_card_exceptions[0])); i++) + { + if ((nvidia_card_exceptions[i].device == device_id) && + (nvidia_card_exceptions[i].subdev == subsys_id)) + { + return nvidia_card_exceptions[i].name; + } + } + } + + // At last try the generic names + for (i = 1; i < (sizeof(nvidia_card_generic) / sizeof(nvidia_card_generic[0])); i++) + { + if (nvidia_card_generic[i].device == device_id) + { +/* if (subsys_id) + { + for (j = 0; j < (sizeof(nvidia_card_vendors) / sizeof(nvidia_card_vendors[0])); j++) + { + if (nvidia_card_vendors[j].device == (subsys_id & 0xffff0000)) + { + sprintf(name_model, "%s %s", + nvidia_card_vendors[j].name, nvidia_card_generic[i].name); + name_model[sizeof(name_model) - 1] = '\0'; + return name_model; + } + } + } */ + return nvidia_card_generic[i].name; + } + } + return nvidia_card_generic[0].name; +} + +static uint32_t load_nvidia_bios_file(const char *filename, uint8_t **buf) +{ + int fd; + int size; + + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) + { + return 0; + } + + size = file_size(fd); + if(size) + { + *buf = malloc(size); + size = read(fd, (char *)buf, size); + } + close(fd); + + return size > 0 ? size : 0; +} + +static int devprop_add_nvidia_template(struct DevPropDevice *device) +{ + char tmp[16]; + + if (!device) + return 0; + + if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_0)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_0)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_name_0)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_1)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_1)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_name_1)) + return 0; + if (devices_number == 1) + { + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type)) + return 0; + } + else + { + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_child)) + return 0; + } + + // Rek : Dont use sprintf return, it does not WORK !! our custom sprintf() always return 0! + // len = sprintf(tmp, "Slot-%x", devices_number); + sprintf(tmp, "Slot-%x",devices_number); + devprop_add_value(device, "AAPL,slot-name", (uint8_t *) tmp, strlen(tmp)); + devices_number++; + + return 1; +} + +int hex2bin(const char *hex, uint8_t *bin, int len) +{ + char *p; + int i; + char buf[3]; + + if (hex == NULL || bin == NULL || len <= 0 || strlen(hex) != len * 2) { + printf("[ERROR] bin2hex input error\n"); + return -1; + } + + buf[2] = '\0'; + p = (char *) hex; + + for (i = 0; i < len; i++) + { + if (p[0] == '\0' || p[1] == '\0' || !isxdigit(p[0]) || !isxdigit(p[1])) { + printf("[ERROR] bin2hex '%s' syntax error\n", hex); + return -2; + } + buf[0] = *p++; + buf[1] = *p++; + bin[i] = (unsigned char) strtoul(buf, NULL, 16); + } + return 0; +} + +unsigned long long mem_detect(volatile uint8_t *regs, uint8_t nvCardType, pci_dt_t *nvda_dev, uint32_t device_id, uint32_t subsys_id) +{ + unsigned long long vram_size = 0; + + // First check if any value exist in the plist + cardList_t * nvcard = FindCardWithIds(device_id, subsys_id); + if (nvcard) + { + if (nvcard->videoRam > 0) + { + vram_size = nvcard->videoRam * 1024 * 1024; + + return vram_size; + } + } + + // Then, Workaround for 9600M GT, GT 210/420/430/440/525M/540M & GTX 560M + switch (nvda_dev->device_id) + { + case 0x0647: // 9600M GT 0647 + vram_size = 512*1024*1024; // 512 MB + break; + case 0x0649: // 9600M GT 0649 + // 10DE06491043202D 1GB VRAM + if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x1043202D ) + { + vram_size = 1024*1024*1024; // 1 GB + } + break; + case 0x0A65: // GT 210 + case 0x0DE0: // GT 440 + case 0x0DE1: // GT 430 + case 0x0DE2: // GT 420 + case 0x0DEC: // GT 525M 0DEC + vram_size = 1024*1024*1024; // 1 GB + break; + case 0x0DE9: // GT 630M + // 10DE0DE9103C181D 1GB VRAM + if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x103C181D ) + { + vram_size = 1024*1024*1024; // 1 GB + } + break; + case 0x0DF4: // GT 540M + case 0x0DF5: // GT 525M 0DF5 + vram_size = 1024*1024*1024; // 1 GB + break; + case 0x11C6: // GTX650TI 11C6 + // 10DE11C61043842A 1GB VRAM + if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x1043842A ) + { + vram_size = 1024*1024*1024; // 1 GB + } + break; + case 0x1251: // GTX 560M + vram_size = 1536*1024*1024; // 1.5 GB + break; + default: + break; + } + + if (!vram_size) + { // Finally, if vram_size still not set do the calculation with our own method + if (nvCardType < NV_ARCH_50) + { + vram_size = REG32(NV04_PFB_FIFO_DATA); + vram_size &= NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK; + } + else if (nvCardType < NV_ARCH_C0) + { + vram_size = REG32(NV04_PFB_FIFO_DATA); + vram_size |= (vram_size & 0xff) << 32; + vram_size &= 0xffffffff00ll; + } + else // >= NV_ARCH_C0 + { + vram_size = REG32(NVC0_MEM_CTRLR_RAM_AMOUNT) << 20; + vram_size *= REG32(NVC0_MEM_CTRLR_COUNT); + } + } + + return vram_size; +} + +static bool checkNvRomSig(uint8_t * aRom){ + return aRom != NULL && (aRom[0] == 0x55 && aRom[1] == 0xaa); +} + +bool setup_nvidia_devprop(pci_dt_t *nvda_dev) +{ + struct DevPropDevice *device; + char *devicepath; + option_rom_pci_header_t *rom_pci_header; + volatile uint8_t *regs; + uint8_t *rom; + uint8_t *nvRom; + uint8_t nvCardType; + unsigned long long videoRam; + uint32_t nvBiosOveride; + uint32_t bar[7]; + uint32_t boot_display; + int nvPatch; + int len; + char biosVersion[32]; + char nvFilename[32]; + char kNVCAP[12]; + char *model; + const char *value; + bool doit; + + fill_card_list(); + + devicepath = get_pci_dev_path(nvda_dev); + bar[0] = pci_config_read32(nvda_dev->dev.addr, 0x10 ); + regs = (uint8_t *) (bar[0] & ~0x0f); + + // get card type + nvCardType = (REG32(0) >> 20) & 0x1ff; + + model = get_nvidia_model(((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id)); + + // Amount of VRAM in kilobytes + videoRam = mem_detect(regs, nvCardType, nvda_dev,((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) ); + + sprintf(nvFilename, "/Extra/%04x_%04x.rom", (uint16_t)nvda_dev->vendor_id, + (uint16_t)nvda_dev->device_id); + + if (getBoolForKey(kUseNvidiaROM, &doit, &bootInfo->chameleonConfig) && doit) + { + verbose("Looking for nvidia video bios file %s\n", nvFilename); + nvBiosOveride = load_nvidia_bios_file(nvFilename, &rom); + + if (nvBiosOveride > 0) + { + verbose("Using nVidia Video BIOS File %s (%d Bytes)\n", nvFilename, nvBiosOveride); + DBG("%s Signature 0x%02x%02x %d bytes\n", nvFilename, rom[0], rom[1], nvBiosOveride); + } + else + { + printf("ERROR: unable to open nVidia Video BIOS File %s\n", nvFilename); + free(rom); + return false; + } + } + else + { + rom = malloc(NVIDIA_ROM_SIZE); + + // Otherwise read bios from card + nvBiosOveride = 0; + + // PROM first + // Enable PROM access + (REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED; + nvRom = (uint8_t*)®s[NV_PROM_OFFSET]; + + // Valid Signature ? + if (checkNvRomSig(nvRom)) + { + bcopy((uint8_t *)nvRom, rom, NVIDIA_ROM_SIZE); + DBG("PROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); + } + else + { + + // disable PROM access + (REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED; + + //PRAM next + nvRom = (uint8_t*)®s[NV_PRAMIN_OFFSET]; + + if(checkNvRomSig(nvRom)) + { + bcopy((uint32_t *)nvRom, rom, NVIDIA_ROM_SIZE); + DBG("PRAM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); + } + else + { + // 0xC0000 last + bcopy((char *)0xc0000, rom, NVIDIA_ROM_SIZE); + + // Valid Signature ? + if (!checkNvRomSig(rom)) + { + printf("ERROR: Unable to locate nVidia Video BIOS\n"); + return false; + } + else + { + DBG("ROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); + } + }//end PRAM check + }//end PROM check + }//end load rom from bios + + if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) + { + printf("ERROR: nVidia ROM Patching Failed!\n"); + //return false; + } + + rom_pci_header = (option_rom_pci_header_t*)(rom + *(uint16_t *)&rom[24]); + + // check for 'PCIR' sig + if (rom_pci_header->signature == 0x50434952) + { + if (rom_pci_header->device_id != nvda_dev->device_id) + { + // Get Model from the OpROM + model = get_nvidia_model(((rom_pci_header->vendor_id << 16) | rom_pci_header->device_id), 0); + + // Get VRAM again + videoRam = mem_detect(regs, nvCardType, nvda_dev, ((rom_pci_header->vendor_id << 16) | rom_pci_header->device_id), 0); + + } + else + { + printf("nVidia incorrect PCI ROM signature: 0x%x\n", rom_pci_header->signature); + } + } + + verbose("%s %dMB NV%02x [%04x:%04x]-[%04x:%04x] :: %s device number: %d\n", + model, (uint32_t)(videoRam / 1024 / 1024), + (REG32(0) >> 20) & 0x1ff, nvda_dev->vendor_id, nvda_dev->device_id, + nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id, + devicepath, devices_number); + + if (!string) { + string = devprop_create_string(); + } + device = devprop_add_device(string, devicepath); + + /* FIXME: for primary graphics card only */ + boot_display = 1; + if (devices_number == 1) + { + devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t*)&boot_display, 4); + } + + if (nvPatch == PATCH_ROM_SUCCESS_HAS_LVDS) { + uint8_t built_in = 0x01; + devprop_add_value(device, "@0,built-in", &built_in, 1); + } + + // get bios version + const int MAX_BIOS_VERSION_LENGTH = 32; + char* version_str = (char*)malloc(MAX_BIOS_VERSION_LENGTH); + + memset(version_str, 0, MAX_BIOS_VERSION_LENGTH); + + int i, version_start; + int crlf_count = 0; + + // only search the first 384 bytes + for (i = 0; i < 0x180; i++) + { + if (rom[i] == 0x0D && rom[i+1] == 0x0A) + { + crlf_count++; + // second 0x0D0A was found, extract bios version + if (crlf_count == 2) + { + if (rom[i-1] == 0x20) i--; // strip last " " + + for (version_start = i; version_start > (i-MAX_BIOS_VERSION_LENGTH); version_start--) + { + // find start + if (rom[version_start] == 0x00) + { + version_start++; + + // strip "Version " + if (strncmp((const char*)rom+version_start, "Version ", 8) == 0) + { + version_start += 8; + } + + strncpy(version_str, (const char*)rom+version_start, i-version_start); + break; + } + } + break; + } + } + } + + sprintf(biosVersion, "%s", (nvBiosOveride > 0) ? nvFilename : version_str); + sprintf(kNVCAP, "NVCAP_%04x", nvda_dev->device_id); + + if (getValueForKey(kNVCAP, &value, &len, &bootInfo->chameleonConfig) && len == NVCAP_LEN * 2) + { + uint8_t new_NVCAP[NVCAP_LEN]; + + if (hex2bin(value, new_NVCAP, NVCAP_LEN) == 0) + { + verbose("Using user supplied NVCAP for %s :: %s\n", model, devicepath); + memcpy(default_NVCAP, new_NVCAP, NVCAP_LEN); + } + } + + if (getValueForKey(kDcfg0, &value, &len, &bootInfo->chameleonConfig) && len == DCFG0_LEN * 2) + { + uint8_t new_dcfg0[DCFG0_LEN]; + + if (hex2bin(value, new_dcfg0, DCFG0_LEN) == 0) + { + memcpy(default_dcfg_0, new_dcfg0, DCFG0_LEN); + + verbose("Using user supplied @0,display-cfg\n"); + printf("@0,display-cfg: %02x%02x%02x%02x\n", + default_dcfg_0[0], default_dcfg_0[1], default_dcfg_0[2], default_dcfg_0[3]); + } + } + + if (getValueForKey(kDcfg1, &value, &len, &bootInfo->chameleonConfig) && len == DCFG1_LEN * 2) + { + uint8_t new_dcfg1[DCFG1_LEN]; + + if (hex2bin(value, new_dcfg1, DCFG1_LEN) == 0) + { + memcpy(default_dcfg_1, new_dcfg1, DCFG1_LEN); + + verbose("Using user supplied @1,display-cfg\n"); + printf("@1,display-cfg: %02x%02x%02x%02x\n", + default_dcfg_1[0], default_dcfg_1[1], default_dcfg_1[2], default_dcfg_1[3]); + } + } + +#if DEBUG_NVCAP + printf("NVCAP: %02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x\n", + default_NVCAP[0], default_NVCAP[1], default_NVCAP[2], default_NVCAP[3], + default_NVCAP[4], default_NVCAP[5], default_NVCAP[6], default_NVCAP[7], + default_NVCAP[8], default_NVCAP[9], default_NVCAP[10], default_NVCAP[11], + default_NVCAP[12], default_NVCAP[13], default_NVCAP[14], default_NVCAP[15], + default_NVCAP[16], default_NVCAP[17], default_NVCAP[18], default_NVCAP[19]); +#endif + + devprop_add_nvidia_template(device); + devprop_add_value(device, "NVCAP", default_NVCAP, NVCAP_LEN); + devprop_add_value(device, "NVPM", default_NVPM, NVPM_LEN); + devprop_add_value(device, "VRAM,totalsize", (uint8_t*)&videoRam, 4); + devprop_add_value(device, "model", (uint8_t*)model, strlen(model) + 1); + devprop_add_value(device, "rom-revision", (uint8_t*)biosVersion, strlen(biosVersion) + 1); + devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN); + devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN); + + if (getBoolForKey(kVBIOS, &doit, &bootInfo->chameleonConfig) && doit) + { + devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512)); + } + + //add HDMI Audio back to nvidia + doit = false; + //http://forge.voodooprojects.org/p/chameleon/issues/67/ + if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit) + { + static uint8_t connector_type_1[]= {0x00, 0x08, 0x00, 0x00}; + devprop_add_value(device, "@1,connector-type",connector_type_1, 4); + } + //end Nvidia HDMI Audio + + stringdata = malloc(sizeof(uint8_t) * string->length); + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + + free(rom); + return true; +} diff --git a/i386/libsaio/.svn/text-base/nvidia.h.svn-base b/i386/libsaio/.svn/text-base/nvidia.h.svn-base new file mode 100644 index 0000000..d894347 --- /dev/null +++ b/i386/libsaio/.svn/text-base/nvidia.h.svn-base @@ -0,0 +1,148 @@ +/* + * NVidia injector + * + * Copyright (C) 2009 Jasmin Fazlic, iNDi + * + * NVidia injector modified by Fabio (ErmaC) on May 2012, + * for allow the cosmetics injection also based on SubVendorID and SubDeviceID. + * + * NVidia injector is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * NVidia driver and injector is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NVidia injector. If not, see <http://www.gnu.org/licenses/>. + * + * Alternatively you can choose to comply with APSL + * + * DCB-Table parsing is based on software (nouveau driver) originally distributed under following license: + * + * + * Copyright 2005-2006 Erik Waling + * Copyright 2006 Stephane Marchesin + * Copyright 2007-2009 Stuart Bennett + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef __LIBSAIO_NVIDIA_H +#define __LIBSAIO_NVIDIA_H + +bool setup_nvidia_devprop(pci_dt_t *nvda_dev); + +typedef struct { + uint32_t device; // VendorID + DeviceID + char *name; +} nvidia_pci_info_t; + +typedef struct { + uint32_t device; // VendorID + DeviceID + uint32_t subdev; // SubdeviceID + SubvendorID + char *name; + //bool kEnableHDMIAudio // HDMi + //VRAM +} nvidia_card_info_t; + +#define DCB_MAX_NUM_ENTRIES 16 +#define DCB_MAX_NUM_I2C_ENTRIES 16 + +#define DCB_LOC_ON_CHIP 0 + +struct bios { + uint16_t signature; /* 0x55AA */ + uint8_t size; /* Size in multiples of 512 */ +}; + +#define NV_PMC_OFFSET 0x000000 +#define NV_PMC_SIZE 0x2ffff +#define NV_PDISPLAY_OFFSET 0x610000 +#define NV_PDISPLAY_SIZE 0x10000 + +#define NV_PROM_OFFSET 0x300000 +#define NV_PROM_SIZE 0x0000ffff +#define NV_PRAMIN_OFFSET 0x00700000 +#define NV_PRAMIN_SIZE 0x00100000 +#define NV04_PFB_FIFO_DATA 0x0010020c +#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK 0xfff00000 +#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_SHIFT 20 +#define NVC0_MEM_CTRLR_COUNT 0x00121c74 +#define NVC0_MEM_CTRLR_RAM_AMOUNT 0x0010f20c + +#define NV_PBUS_PCI_NV_20 0x00001850 +#define NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED (0 << 0) +#define NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED (1 << 0) + +#define REG8(reg) ((volatile uint8_t *)regs)[(reg)] +#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1] +#define REG32(reg) ((volatile uint32_t *)regs)[(reg) >> 2] + +#define NV_ARCH_03 0x03 +#define NV_ARCH_04 0x04 +#define NV_ARCH_10 0x10 +#define NV_ARCH_20 0x20 +#define NV_ARCH_30 0x30 +#define NV_ARCH_40 0x40 +#define NV_ARCH_50 0x50 +#define NV_ARCH_C0 0xC0 + +#define CHIPSET_NV03 0x0010 +#define CHIPSET_NV04 0x0020 +#define CHIPSET_NV10 0x0100 +#define CHIPSET_NV11 0x0110 +#define CHIPSET_NV15 0x0150 +#define CHIPSET_NV17 0x0170 +#define CHIPSET_NV18 0x0180 +#define CHIPSET_NFORCE 0x01A0 +#define CHIPSET_NFORCE2 0x01F0 +#define CHIPSET_NV20 0x0200 +#define CHIPSET_NV25 0x0250 +#define CHIPSET_NV28 0x0280 +#define CHIPSET_NV30 0x0300 +#define CHIPSET_NV31 0x0310 +#define CHIPSET_NV34 0x0320 +#define CHIPSET_NV35 0x0330 +#define CHIPSET_NV36 0x0340 +#define CHIPSET_NV40 0x0040 +#define CHIPSET_NV41 0x00C0 +#define CHIPSET_NV43 0x0140 +#define CHIPSET_NV44 0x0160 +#define CHIPSET_NV44A 0x0220 +#define CHIPSET_NV45 0x0210 +#define CHIPSET_NV50 0x0190 +#define CHIPSET_NV84 0x0400 +#define CHIPSET_MISC_BRIDGED 0x00F0 +#define CHIPSET_G70 0x0090 +#define CHIPSET_G71 0x0290 +#define CHIPSET_G72 0x01D0 +#define CHIPSET_G73 0x0390 + +// integrated GeForces (6100, 6150) +#define CHIPSET_C51 0x0240 + +// variant of C51, seems based on a G70 design +#define CHIPSET_C512 0x03D0 +#define CHIPSET_G73_BRIDGED 0x02E0 + +#endif /* !__LIBSAIO_NVIDIA_H */ diff --git a/i386/libsaio/.svn/text-base/nvidia_helper.c.svn-base b/i386/libsaio/.svn/text-base/nvidia_helper.c.svn-base new file mode 100644 index 0000000..bb6f5f4 --- /dev/null +++ b/i386/libsaio/.svn/text-base/nvidia_helper.c.svn-base @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "xml.h" +#include "nvidia_helper.h" +#include "pci.h" +#include "nvidia.h" + +/* + + NVIDIA card injection usage e.g (to be placed in the boot.plist): + + <key>NVIDIA</key> + <array> + <dict> + <key>Chipset Name</key> + <string>Quadro FX 380</string> + <key>IOPCIPrimaryMatch</key> + <string>0x10DE0658</string> + <key>VRam Size</key> + <string>256</string> + </dict> + <dict> + <key>Chipset Name</key> + <string>YOUR_CARD_NAME</string> + <key>IOPCIPrimaryMatch</key> + <string>YOUR_CARD_ID</string> + <key>IOPCISubDevId</key> + <string>YOUR_CARD_SUB_ID(if necessary)</string> + <key>VRam Size</key> + <string>YOUR_CARD_VRAM_SIZE</string> + </dict> + <dict> + <key>Chipset Name</key> + <string>YOUR_SECOND_CARD_NAME</string> + <key>IOPCIPrimaryMatch</key> + <string>YOUR_SECOND_CARD_ID</string> + <key>IOPCISubDevId</key> + <string>YOUR_SECOND_CARD_SUB_ID(if necessary)</string> + <key>VRam Size</key> + <string>YOUR_SECOND_CARD_VRAM_SIZE</string> + </dict> + . + . + . + . + </array> + + */ + +cardList_t* cardList = NULL; + +void add_card(char* model, uint32_t id, uint32_t subid, uint64_t videoRam) +{ + + cardList_t* new_card = malloc(sizeof(cardList_t)); + if (new_card) + { + new_card->next = cardList; + + cardList = new_card; + + new_card->id = id; + new_card->subid = subid; + new_card->videoRam = videoRam; + new_card->model = model; + } +} + +cardList_t* FindCardWithIds(uint32_t id, uint32_t subid) +{ + cardList_t* entry = cardList; + while(entry) + { + if((entry->id == id) && (entry->subid == subid)) + { + return entry; + } + else + { + entry = entry->next; + } + + } + + // LET A SECOND CHANCE by seaching only for the device-id + entry = cardList; + while(entry) + { + if(entry->id == id) + { + return entry; + } + else + { + entry = entry->next; + } + + } + + return NULL; +} + +void fill_card_list(void) +{ + unsigned int i, count; + TagPtr NVDIATag; + char *model_name = NULL, *match_id = NULL, *sub_id = NULL, *vram_size = NULL; + uint32_t dev_id = 0, subdev_id = 0; + uint64_t VramSize = 0; + + if ((NVDIATag = XMLCastArray(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"NVIDIA")))) + { + count = XMLTagCount(NVDIATag); + + for (i=0; i<count; i++) + { + TagPtr element = XMLGetElement( NVDIATag, i ); + if (element) + { + match_id = XMLCastString(XMLGetProperty(element, (const char*)"IOPCIPrimaryMatch")); //device-id + sub_id = XMLCastString(XMLGetProperty(element, (const char*)"IOPCISubDevId")); //sub device-id + model_name = XMLCastString(XMLGetProperty(element, (const char*)"Chipset Name")); + vram_size = XMLCastString(XMLGetProperty(element, (const char*)"VRam Size")); + + if (match_id) { + dev_id = strtoul(match_id, NULL, 16); + } + + if (sub_id) { + subdev_id = strtoul(sub_id, NULL, 16); + } + + if (vram_size) { + VramSize = strtoul(vram_size, NULL, 10); + } + + add_card(model_name, dev_id, subdev_id, VramSize); + } + } + } +} diff --git a/i386/libsaio/.svn/text-base/nvidia_helper.h.svn-base b/i386/libsaio/.svn/text-base/nvidia_helper.h.svn-base new file mode 100644 index 0000000..f502194 --- /dev/null +++ b/i386/libsaio/.svn/text-base/nvidia_helper.h.svn-base @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + + +#ifndef __LIBSAIO_NVIDIA_HELPER_H +#define __LIBSAIO_NVIDIA_HELPER_H + +typedef struct cardList_t +{ + char* model; + uint32_t id; + uint32_t subid; + uint64_t videoRam; + struct cardList_t* next; +} cardList_t; + +void add_card(char* model, uint32_t id, uint32_t subid, uint64_t videoRam); +void fill_card_list(void); +cardList_t* FindCardWithIds(uint32_t id, uint32_t subid); + +#endif //__LIBSAIO_NVIDIA_HELPER_H \ No newline at end of file diff --git a/i386/libsaio/.svn/text-base/openbsd.c.svn-base b/i386/libsaio/.svn/text-base/openbsd.c.svn-base new file mode 100644 index 0000000..dea35f0 --- /dev/null +++ b/i386/libsaio/.svn/text-base/openbsd.c.svn-base @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "openbsd.h" + +#define OpenBSDProbeSize 2048 + +bool OpenBSDProbe (const void *buf) +{ + return (OSReadLittleInt32(buf+0x200,0)==0x82564557); +} +void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc(OpenBSDProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, OpenBSDProbeSize); + if (!OpenBSDProbe (buf)) + { + free (buf); + return; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x478, MIN (strMaxLen, 32)); + free (buf); +} diff --git a/i386/libsaio/.svn/text-base/openbsd.h.svn-base b/i386/libsaio/.svn/text-base/openbsd.h.svn-base new file mode 100644 index 0000000..6d4eedb --- /dev/null +++ b/i386/libsaio/.svn/text-base/openbsd.h.svn-base @@ -0,0 +1,2 @@ +extern bool OpenBSDProbe (const void *buf); +extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file diff --git a/i386/libsaio/.svn/text-base/pci.c.svn-base b/i386/libsaio/.svn/text-base/pci.c.svn-base new file mode 100644 index 0000000..d66196f --- /dev/null +++ b/i386/libsaio/.svn/text-base/pci.c.svn-base @@ -0,0 +1,191 @@ +/* + * + * Copyright 2008 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "pci.h" +#include "pci_root.h" + +#ifndef DEBUG_PCI +#define DEBUG_PCI 0 +#endif + +#if DEBUG_PCI +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +pci_dt_t *root_pci_dev; + + +uint8_t pci_config_read8(uint32_t pci_addr, uint8_t reg) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + return inb(PCI_DATA_REG + (reg & 3)); +} + +uint16_t pci_config_read16(uint32_t pci_addr, uint8_t reg) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + return inw(PCI_DATA_REG + (reg & 2)); +} + +uint32_t pci_config_read32(uint32_t pci_addr, uint8_t reg) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + return inl(PCI_DATA_REG); +} + +void pci_config_write8(uint32_t pci_addr, uint8_t reg, uint8_t data) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + outb(PCI_DATA_REG + (reg & 3), data); +} + +void pci_config_write16(uint32_t pci_addr, uint8_t reg, uint16_t data) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + outw(PCI_DATA_REG + (reg & 2), data); +} + +void pci_config_write32(uint32_t pci_addr, uint8_t reg, uint32_t data) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + outl(PCI_DATA_REG, data); +} + +void scan_pci_bus(pci_dt_t *start, uint8_t bus) +{ + pci_dt_t *new; + pci_dt_t **current = &start->children; + uint32_t id; + uint32_t pci_addr; + uint8_t dev = 0; + uint8_t func = 0; + uint8_t secondary_bus; + uint8_t header_type; + + for (dev = 0; dev < 32; dev++) { + for (func = 0; func < 8; func++) { + pci_addr = PCIADDR(bus, dev, func); + id = pci_config_read32(pci_addr, PCI_VENDOR_ID); + if (!id || id == 0xffffffff) { + continue; + } + new = (pci_dt_t*)malloc(sizeof(pci_dt_t)); + bzero(new, sizeof(pci_dt_t)); + new->dev.addr = pci_addr; + new->vendor_id = id & 0xffff; + new->device_id = (id >> 16) & 0xffff; + new->progif = pci_config_read8(pci_addr, PCI_CLASS_PROG); + new->revision_id = pci_config_read8(pci_addr, PCI_CLASS_REVISION); + new->subsys_id.subsys_id = pci_config_read32(pci_addr, PCI_SUBSYSTEM_VENDOR_ID); + new->class_id = pci_config_read16(pci_addr, PCI_CLASS_DEVICE); + new->parent = start; + + header_type = pci_config_read8(pci_addr, PCI_HEADER_TYPE); + switch (header_type & 0x7f) { + case PCI_HEADER_TYPE_BRIDGE: + case PCI_HEADER_TYPE_CARDBUS: + secondary_bus = pci_config_read8(pci_addr, PCI_SECONDARY_BUS); + if (secondary_bus != 0) { + scan_pci_bus(new, secondary_bus); + } + break; + } + *current = new; + current = &new->next; + + if ((func == 0) && ((header_type & 0x80) == 0)) { + break; + } + } + } +} + +void enable_pci_devs(void) +{ + uint16_t id; + uint32_t rcba, *fd; + + id = pci_config_read16(PCIADDR(0, 0x00, 0), 0x00); + /* make sure we're on Intel chipset */ + if (id != 0x8086) + return; + rcba = pci_config_read32(PCIADDR(0, 0x1f, 0), 0xf0) & ~1; + fd = (uint32_t *)(rcba + 0x3418); + /* set SMBus Disable (SD) to 0 */ + *fd &= ~0x8; + /* and all devices? */ + //*fd = 0x1; +} + + +void build_pci_dt(void) +{ + root_pci_dev = malloc(sizeof(pci_dt_t)); + bzero(root_pci_dev, sizeof(pci_dt_t)); + enable_pci_devs(); + scan_pci_bus(root_pci_dev, 0); + +#if DEBUG_PCI + dump_pci_dt(root_pci_dev->children); + pause(); +#endif +} + +static char dev_path[256]; +char *get_pci_dev_path(pci_dt_t *pci_dt) +{ + pci_dt_t *current; + pci_dt_t *end; + char tmp[64]; + + dev_path[0] = 0; + end = root_pci_dev; + + int uid = getPciRootUID(); + while (end != pci_dt) + { + current = pci_dt; + while (current->parent != end) + current = current->parent; + end = current; + if (current->parent == root_pci_dev) + { + sprintf(tmp, "PciRoot(0x%x)/Pci(0x%x,0x%x)", uid, + current->dev.bits.dev, current->dev.bits.func); + } else { + sprintf(tmp, "/Pci(0x%x,0x%x)", + current->dev.bits.dev, current->dev.bits.func); + } + strcat(dev_path, tmp); + } + return dev_path; +} + +void dump_pci_dt(pci_dt_t *pci_dt) +{ + pci_dt_t *current; + + current = pci_dt; + while (current) { + printf("%02x:%02x.%x [%04x%02x] [%04x:%04x] (subsys [%04x:%04x]):: %s\n", + current->dev.bits.bus, current->dev.bits.dev, current->dev.bits.func, + current->class_id, current->vendor_id, current->device_id, + current->subsys_id.subsys.vendor_id, current->subsys_id.subsys.device_id, + get_pci_dev_path(current)); + dump_pci_dt(current->children); + current = current->next; + } +} diff --git a/i386/libsaio/.svn/text-base/pci.h.svn-base b/i386/libsaio/.svn/text-base/pci.h.svn-base new file mode 100644 index 0000000..2e569c1 --- /dev/null +++ b/i386/libsaio/.svn/text-base/pci.h.svn-base @@ -0,0 +1,947 @@ +/* + * + * Copyright 2008 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#ifndef __LIBSAIO_PCI_H +#define __LIBSAIO_PCI_H + +/* + * 31 24 16 15 11 10 8 + * +---------------------------------------------------------------+ + * |1| 0 | BUS | DEV |FUNC | 0 | + * +---------------------------------------------------------------+ + */ + +typedef struct { + uint32_t :2; + uint32_t reg :6; + uint32_t func:3; + uint32_t dev :5; + uint32_t bus :8; + uint32_t :7; + uint32_t eb :1; +} pci_addr_t; + +typedef union { + pci_addr_t bits; + uint32_t addr; +} pci_dev_t; + +typedef struct pci_dt_t { + pci_dev_t dev; + + uint16_t vendor_id; /* Specifies a vendor ID. The PCI bus configuration code obtains this + vendor ID from the vendor ID device register. */ + uint16_t device_id; /* Specifies a device ID that identifies the specific device. The PCI + bus configuration code obtains this device ID from the device ID + device register. */ + + union { + struct { + uint16_t vendor_id; /* Specifies a subsystem vendor ID. */ + uint16_t device_id; /* Specifies a subsystem device ID that identifies the specific device. */ + } subsys; + uint32_t subsys_id; + } subsys_id; + + uint8_t progif; /* A read-only register that specifies a register-level programming interface the device has, if it has any at all. */ + + uint8_t revision_id; /* PCI revision ID. Specifies a revision identifier for a particular device. Where valid IDs are allocated by the vendor. */ + + uint16_t class_id; /* Specifies a class code. This member is a data structure that stores information related to the device's class code device register. */ + + struct pci_dt_t *parent; + struct pci_dt_t *children; + struct pci_dt_t *next; +} pci_dt_t; + +#define PCIADDR(bus, dev, func) ((1 << 31) | (bus << 16) | (dev << 11) | (func << 8)) +#define PCI_ADDR_REG 0xcf8 +#define PCI_DATA_REG 0xcfc + +extern pci_dt_t *root_pci_dev; +extern uint8_t pci_config_read8(uint32_t, uint8_t); +extern uint16_t pci_config_read16(uint32_t, uint8_t); +extern uint32_t pci_config_read32(uint32_t, uint8_t); +extern void pci_config_write8(uint32_t, uint8_t, uint8_t); +extern void pci_config_write16(uint32_t, uint8_t, uint16_t); +extern void pci_config_write32(uint32_t, uint8_t, uint32_t); +extern char *get_pci_dev_path(pci_dt_t *); +extern void build_pci_dt(void); +extern void dump_pci_dt(pci_dt_t *); + +/* Option ROM header */ +typedef struct { + uint16_t signature; // 0xAA55 + uint8_t rom_size; + uint32_t entry_point; + uint8_t reserved[15]; + uint16_t pci_header_offset; + uint16_t expansion_header_offset; +} option_rom_header_t; + +/* Option ROM PCI Data Structure */ +typedef struct { + uint32_t signature; // ati - 0x52494350, nvidia - 0x50434952, 'PCIR' + uint16_t vendor_id; + uint16_t device_id; + uint16_t vital_product_data_offset; + uint16_t structure_length; + uint8_t structure_revision; + uint8_t class_code[3]; + uint16_t image_length; + uint16_t image_revision; + uint8_t code_type; + uint8_t indicator; + uint16_t reserved; +} option_rom_pci_header_t; + +//----------------------------------------------------------------------------- +// added by iNDi + +typedef struct { + uint32_t signature; // 0x24506E50 '$PnP' + uint8_t revision; // 1 + uint8_t length; + uint16_t offset; + uint8_t checksum; + uint32_t identifier; + uint16_t manufacturer; + uint16_t product; + uint8_t class[3]; + uint8_t indicators; + uint16_t boot_vector; + uint16_t disconnect_vector; + uint16_t bootstrap_vector; + uint16_t reserved; + uint16_t resource_vector; +} option_rom_pnp_header_t; + +/* + * Under PCI, each device has 256 bytes of configuration address space, + * of which the first 64 bytes are standardized as follows: + * + * register name offset + *******************************************************/ +#define PCI_VENDOR_ID 0x00 /* 16 bits */ +#define PCI_DEVICE_ID 0x02 /* 16 bits */ +#define PCI_COMMAND 0x04 /* 16 bits */ +#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ +#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ +#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ +#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ +#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ +#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ +#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ +#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ +#define PCI_COMMAND_SERR 0x100 /* Enable SERR */ +#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ +#define PCI_COMMAND_DISABLE_INTx 0x400 /* PCIE: Disable INTx interrupts */ + +#define PCI_STATUS 0x06 /* 16 bits */ +#define PCI_STATUS_INTx 0x08 /* PCIE: INTx interrupt pending */ +#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ +#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ +#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ +#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ +#define PCI_STATUS_PARITY 0x100 /* Detected parity error */ +#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ +#define PCI_STATUS_DEVSEL_FAST 0x000 +#define PCI_STATUS_DEVSEL_MEDIUM 0x200 +#define PCI_STATUS_DEVSEL_SLOW 0x400 +#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ +#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ +#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ +#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ +#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ + +#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */ +#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface know also as PCI_PROG_IF */ +#define PCI_CLASS_DEVICE 0x0a /* Device subclass */ +//#define PCI_SUBCLASS_DEVICE 0x0b /* Device class */ + +#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ +#define PCI_LATENCY_TIMER 0x0d /* 8 bits */ +#define PCI_HEADER_TYPE 0x0e /* 8 bits */ +#define PCI_HEADER_TYPE_NORMAL 0 +#define PCI_HEADER_TYPE_BRIDGE 1 +#define PCI_HEADER_TYPE_CARDBUS 2 + +#define PCI_BIST 0x0f /* 8 bits */ +#define PCI_BIST_CODE_MASK 0x0f /* Return result */ +#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ +#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ + +/* + * Base addresses specify locations in memory or I/O space. + * Decoded size can be determined by writing a value of + * 0xffffffff to the register, and reading it back. Only + * 1 bits are decoded. + */ +#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ +#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ +#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ +#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ +#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ +#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ +#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ +#define PCI_BASE_ADDRESS_SPACE_IO 0x01 +#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 +#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 +#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ +#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ +#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ +#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ +#define PCI_BASE_ADDRESS_MEM_MASK (~(pciaddr_t)0x0f) +#define PCI_BASE_ADDRESS_IO_MASK (~(pciaddr_t)0x03) +/* bit 1 is reserved if address_space = 1 */ + +/* Header type 0 (normal devices) */ +#define PCI_CARDBUS_CIS 0x28 +#define PCI_SUBSYSTEM_VENDOR_ID 0x2c +#define PCI_SUBSYSTEM_ID 0x2e +#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ +#define PCI_ROM_ADDRESS_ENABLE 0x01 +#define PCI_ROM_ADDRESS_MASK (~(pciaddr_t)0x7ff) + +#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ + +/* 0x35-0x3b are reserved */ +#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ +#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ +#define PCI_MIN_GNT 0x3e /* 8 bits */ +#define PCI_MAX_LAT 0x3f /* 8 bits */ + +/* Header type 1 (PCI-to-PCI bridges) */ +#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ +#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ +#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ +#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ +#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ +#define PCI_IO_LIMIT 0x1d +#define PCI_IO_RANGE_TYPE_MASK 0x0f /* I/O bridging type */ +#define PCI_IO_RANGE_TYPE_16 0x00 +#define PCI_IO_RANGE_TYPE_32 0x01 +#define PCI_IO_RANGE_MASK ~0x0f +#define PCI_SEC_STATUS 0x1e /* Secondary status register */ +#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ +#define PCI_MEMORY_LIMIT 0x22 +#define PCI_MEMORY_RANGE_TYPE_MASK 0x0f +#define PCI_MEMORY_RANGE_MASK ~0x0f +#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ +#define PCI_PREF_MEMORY_LIMIT 0x26 +#define PCI_PREF_RANGE_TYPE_MASK 0x0f +#define PCI_PREF_RANGE_TYPE_32 0x00 +#define PCI_PREF_RANGE_TYPE_64 0x01 +#define PCI_PREF_RANGE_MASK ~0x0f +#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ +#define PCI_PREF_LIMIT_UPPER32 0x2c +#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ +#define PCI_IO_LIMIT_UPPER16 0x32 +/* 0x34 same as for htype 0 */ +/* 0x35-0x3b is reserved */ +#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_BRIDGE_CONTROL 0x3e +#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ +#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ +#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ +#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ +#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ +#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ +#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ +#define PCI_BRIDGE_CTL_PRI_DISCARD_TIMER 0x100 /* PCI-X? */ +#define PCI_BRIDGE_CTL_SEC_DISCARD_TIMER 0x200 /* PCI-X? */ +#define PCI_BRIDGE_CTL_DISCARD_TIMER_STATUS 0x400 /* PCI-X? */ +#define PCI_BRIDGE_CTL_DISCARD_TIMER_SERR_EN 0x800 /* PCI-X? */ + +/* Header type 2 (CardBus bridges) */ +/* 0x14-0x15 reserved */ +#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ +#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ +#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ +#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ +#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ +#define PCI_CB_MEMORY_BASE_0 0x1c +#define PCI_CB_MEMORY_LIMIT_0 0x20 +#define PCI_CB_MEMORY_BASE_1 0x24 +#define PCI_CB_MEMORY_LIMIT_1 0x28 +#define PCI_CB_IO_BASE_0 0x2c +#define PCI_CB_IO_BASE_0_HI 0x2e +#define PCI_CB_IO_LIMIT_0 0x30 +#define PCI_CB_IO_LIMIT_0_HI 0x32 +#define PCI_CB_IO_BASE_1 0x34 +#define PCI_CB_IO_BASE_1_HI 0x36 +#define PCI_CB_IO_LIMIT_1 0x38 +#define PCI_CB_IO_LIMIT_1_HI 0x3a +#define PCI_CB_IO_RANGE_MASK ~0x03 +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_CB_BRIDGE_CONTROL 0x3e +#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ +#define PCI_CB_BRIDGE_CTL_SERR 0x02 +#define PCI_CB_BRIDGE_CTL_ISA 0x04 +#define PCI_CB_BRIDGE_CTL_VGA 0x08 +#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 +#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ +#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ +#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ +#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 +#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 +#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 +#define PCI_CB_SUBSYSTEM_ID 0x42 +#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ +/* 0x48-0x7f reserved */ + +/* Capability Identification Numbers list */ +#define PCI_CAP_LIST_ID 0 /* Capability ID */ +#define PCI_CAP_ID_PM 0x01 /* Power Management */ +#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ +#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ +#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ +#define PCI_CAP_ID_MSI 0x05 /* Message Signaled Interrupts */ +#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ +#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ +#define PCI_CAP_ID_HT 0x08 /* HyperTransport */ +#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */ +#define PCI_CAP_ID_DBG 0x0A /* Debug port */ +#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */ +#define PCI_CAP_ID_HOTPLUG 0x0C /* PCI hot-plug */ +#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ +#define PCI_CAP_ID_AGP3 0x0E /* AGP 8x */ +#define PCI_CAP_ID_SECURE 0x0F /* Secure device (?) */ +#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ +#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ +#define PCI_CAP_ID_SATA 0x12 /* Serial-ATA HBA */ +#define PCI_CAP_ID_AF 0x13 /* Advanced features of PCI devices integrated in PCIe root cplx */ +#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ +#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ +#define PCI_CAP_SIZEOF 4 + +/* Capabilities residing in the + PCI Express extended configuration space */ +#define PCI_EXT_CAP_ID_AER 0x01 /* Advanced Error Reporting */ +#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel */ +#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ +#define PCI_EXT_CAP_ID_PB 0x04 /* Power Budgeting */ +#define PCI_EXT_CAP_ID_RCLINK 0x05 /* Root Complex Link Declaration */ +#define PCI_EXT_CAP_ID_RCILINK 0x06 /* Root Complex Internal Link Declaration */ +#define PCI_EXT_CAP_ID_RCECOLL 0x07 /* Root Complex Event Collector */ +#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function Virtual Channel */ +#define PCI_EXT_CAP_ID_RBCB 0x0a /* Root Bridge Control Block */ +#define PCI_EXT_CAP_ID_VNDR 0x0b /* Vendor specific */ +#define PCI_EXT_CAP_ID_ACS 0x0d /* Access Controls */ +#define PCI_EXT_CAP_ID_ARI 0x0e /* Alternative Routing-ID Interpretation */ +#define PCI_EXT_CAP_ID_ATS 0x0f /* Address Translation Service */ +#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */ + +/* Power Management Registers */ +#define PCI_PM_CAP_VER_MASK 0x0007 /* Version (2=PM1.1) */ +#define PCI_PM_CAP_PME_CLOCK 0x0008 /* Clock required for PME generation */ +#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization required */ +#define PCI_PM_CAP_AUX_C_MASK 0x01c0 /* Maximum aux current required in D3cold */ +#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */ +#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */ +#define PCI_PM_CAP_PME_D0 0x0800 /* PME can be asserted from D0 */ +#define PCI_PM_CAP_PME_D1 0x1000 /* PME can be asserted from D1 */ +#define PCI_PM_CAP_PME_D2 0x2000 /* PME can be asserted from D2 */ +#define PCI_PM_CAP_PME_D3_HOT 0x4000 /* PME can be asserted from D3hot */ +#define PCI_PM_CAP_PME_D3_COLD 0x8000 /* PME can be asserted from D3cold */ +#define PCI_PM_CTRL 4 /* PM control and status register */ +#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ +#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ +#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* PM table data index */ +#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* PM table data scaling factor */ +#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */ +#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions */ +#define PCI_PM_PPB_B2_B3 0x40 /* If bridge enters D3hot, bus enters: 0=B3, 1=B2 */ +#define PCI_PM_BPCC_ENABLE 0x80 /* Secondary bus is power managed */ +#define PCI_PM_DATA_REGISTER 7 /* PM table contents read here */ +#define PCI_PM_SIZEOF 8 + +/* AGP registers */ +#define PCI_AGP_VERSION 2 /* BCD version number */ +#define PCI_AGP_RFU 3 /* Rest of capability flags */ +#define PCI_AGP_STATUS 4 /* Status register */ +#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ +#define PCI_AGP_STATUS_ISOCH 0x10000 /* Isochronous transactions supported */ +#define PCI_AGP_STATUS_ARQSZ_MASK 0xe000 /* log2(optimum async req size in bytes) - 4 */ +#define PCI_AGP_STATUS_CAL_MASK 0x1c00 /* Calibration cycle timing */ +#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ +#define PCI_AGP_STATUS_ITA_COH 0x0100 /* In-aperture accesses always coherent */ +#define PCI_AGP_STATUS_GART64 0x0080 /* 64-bit GART entries supported */ +#define PCI_AGP_STATUS_HTRANS 0x0040 /* If 0, core logic can xlate host CPU accesses thru aperture */ +#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing cycles supported */ +#define PCI_AGP_STATUS_FW 0x0010 /* Fast write transfers supported */ +#define PCI_AGP_STATUS_AGP3 0x0008 /* AGP3 mode supported */ +#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported (RFU in AGP3 mode) */ +#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported (8x in AGP3 mode) */ +#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported (4x in AGP3 mode) */ +#define PCI_AGP_COMMAND 8 /* Control register */ +#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ +#define PCI_AGP_COMMAND_ARQSZ_MASK 0xe000 /* log2(optimum async req size in bytes) - 4 */ +#define PCI_AGP_COMMAND_CAL_MASK 0x1c00 /* Calibration cycle timing */ +#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ +#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ +#define PCI_AGP_COMMAND_GART64 0x0080 /* 64-bit GART entries enabled */ +#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow generation of 64-bit addr cycles */ +#define PCI_AGP_COMMAND_FW 0x0010 /* Enable FW transfers */ +#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate (RFU in AGP3 mode) */ +#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate (8x in AGP3 mode) */ +#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate (4x in AGP3 mode) */ +#define PCI_AGP_SIZEOF 12 + +/* Vital Product Data */ +#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */ +#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ +#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ +#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ + +/* Slot Identification */ +#define PCI_SID_ESR 2 /* Expansion Slot Register */ +#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ +#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */ +#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */ + +/* Message Signaled Interrupts registers */ +#define PCI_MSI_FLAGS 2 /* Various flags */ +#define PCI_MSI_FLAGS_MASK_BIT 0x100 /* interrupt masking & reporting supported */ +#define PCI_MSI_FLAGS_64BIT 0x080 /* 64-bit addresses allowed */ +#define PCI_MSI_FLAGS_QSIZE 0x070 /* Message queue size configured */ +#define PCI_MSI_FLAGS_QMASK 0x00e /* Maximum queue size available */ +#define PCI_MSI_FLAGS_ENABLE 0x001 /* MSI feature enabled */ +#define PCI_MSI_RFU 3 /* Rest of capability flags */ +#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ +#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ +#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ +#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ +#define PCI_MSI_MASK_BIT_32 12 /* per-vector masking for 32-bit devices */ +#define PCI_MSI_MASK_BIT_64 16 /* per-vector masking for 64-bit devices */ +#define PCI_MSI_PENDING_32 16 /* per-vector interrupt pending for 32-bit devices */ +#define PCI_MSI_PENDING_64 20 /* per-vector interrupt pending for 64-bit devices */ + +/* PCI-X */ +#define PCI_PCIX_COMMAND 2 /* Command register offset */ +#define PCI_PCIX_COMMAND_DPERE 0x0001 /* Data Parity Error Recover Enable */ +#define PCI_PCIX_COMMAND_ERO 0x0002 /* Enable Relaxed Ordering */ +#define PCI_PCIX_COMMAND_MAX_MEM_READ_BYTE_COUNT 0x000c /* Maximum Memory Read Byte Count */ +#define PCI_PCIX_COMMAND_MAX_OUTSTANDING_SPLIT_TRANS 0x0070 +#define PCI_PCIX_COMMAND_RESERVED 0xf80 +#define PCI_PCIX_STATUS 4 /* Status register offset */ +#define PCI_PCIX_STATUS_FUNCTION 0x00000007 +#define PCI_PCIX_STATUS_DEVICE 0x000000f8 +#define PCI_PCIX_STATUS_BUS 0x0000ff00 +#define PCI_PCIX_STATUS_64BIT 0x00010000 +#define PCI_PCIX_STATUS_133MHZ 0x00020000 +#define PCI_PCIX_STATUS_SC_DISCARDED 0x00040000 /* Split Completion Discarded */ +#define PCI_PCIX_STATUS_UNEXPECTED_SC 0x00080000 /* Unexpected Split Completion */ +#define PCI_PCIX_STATUS_DEVICE_COMPLEXITY 0x00100000 /* 0 = simple device, 1 = bridge device */ +#define PCI_PCIX_STATUS_DESIGNED_MAX_MEM_READ_BYTE_COUNT 0x00600000 /* 0 = 512 bytes, 1 = 1024, 2 = 2048, 3 = 4096 */ +#define PCI_PCIX_STATUS_DESIGNED_MAX_OUTSTANDING_SPLIT_TRANS 0x03800000 +#define PCI_PCIX_STATUS_DESIGNED_MAX_CUMULATIVE_READ_SIZE 0x1c000000 +#define PCI_PCIX_STATUS_RCVD_SC_ERR_MESS 0x20000000 /* Received Split Completion Error Message */ +#define PCI_PCIX_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ +#define PCI_PCIX_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ +#define PCI_PCIX_SIZEOF 4 + + +/* PCI-X Bridges */ +#define PCI_PCIX_BRIDGE_SEC_STATUS 2 /* Secondary bus status register offset */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_64BIT 0x0001 +#define PCI_PCIX_BRIDGE_SEC_STATUS_133MHZ 0x0002 +#define PCI_PCIX_BRIDGE_SEC_STATUS_SC_DISCARDED 0x0004 /* Split Completion Discarded on secondary bus */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_UNEXPECTED_SC 0x0008 /* Unexpected Split Completion on secondary bus */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_SC_OVERRUN 0x0010 /* Split Completion Overrun on secondary bus */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_SPLIT_REQUEST_DELAYED 0x0020 +#define PCI_PCIX_BRIDGE_SEC_STATUS_CLOCK_FREQ 0x01c0 +#define PCI_PCIX_BRIDGE_SEC_STATUS_RESERVED 0xfe00 +#define PCI_PCIX_BRIDGE_STATUS 4 /* Primary bus status register offset */ +#define PCI_PCIX_BRIDGE_STATUS_FUNCTION 0x00000007 +#define PCI_PCIX_BRIDGE_STATUS_DEVICE 0x000000f8 +#define PCI_PCIX_BRIDGE_STATUS_BUS 0x0000ff00 +#define PCI_PCIX_BRIDGE_STATUS_64BIT 0x00010000 +#define PCI_PCIX_BRIDGE_STATUS_133MHZ 0x00020000 +#define PCI_PCIX_BRIDGE_STATUS_SC_DISCARDED 0x00040000 /* Split Completion Discarded */ +#define PCI_PCIX_BRIDGE_STATUS_UNEXPECTED_SC 0x00080000 /* Unexpected Split Completion */ +#define PCI_PCIX_BRIDGE_STATUS_SC_OVERRUN 0x00100000 /* Split Completion Overrun */ +#define PCI_PCIX_BRIDGE_STATUS_SPLIT_REQUEST_DELAYED 0x00200000 +#define PCI_PCIX_BRIDGE_STATUS_RESERVED 0xffc00000 +#define PCI_PCIX_BRIDGE_UPSTREAM_SPLIT_TRANS_CTRL 8 /* Upstream Split Transaction Register offset */ +#define PCI_PCIX_BRIDGE_DOWNSTREAM_SPLIT_TRANS_CTRL 12 /* Downstream Split Transaction Register offset */ +#define PCI_PCIX_BRIDGE_STR_CAPACITY 0x0000ffff +#define PCI_PCIX_BRIDGE_STR_COMMITMENT_LIMIT 0xffff0000 +#define PCI_PCIX_BRIDGE_SIZEOF 12 + +/* PCI Express */ +#define PCI_EXP_FLAGS 0x2 /* Capabilities register */ +#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */ +#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */ +#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */ +#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */ +#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ +#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ +#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ +#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ +#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIE Bridge */ +#define PCI_EXP_TYPE_ROOT_INT_EP 0x9 /* Root Complex Integrated Endpoint */ +#define PCI_EXP_TYPE_ROOT_EC 0xa /* Root Complex Event Collector */ +#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ +#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ +#define PCI_EXP_DEVCAP 0x4 /* Device capabilities */ +#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ +#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ +#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ +#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ +#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ +#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ +#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ +#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ +#define PCI_EXP_DEVCAP_RBE 0x8000 /* Role-Based Error Reporting */ +#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ +#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ +#define PCI_EXP_DEVCAP_FLRESET 0x10000000 /* Function-Level Reset */ +#define PCI_EXP_DEVCTL 0x8 /* Device Control */ +#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ +#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ +#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */ +#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ +#define PCI_EXP_DEVCTL_RELAXED 0x0010 /* Enable Relaxed Ordering */ +#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ +#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ +#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ +#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ +#define PCI_EXP_DEVCTL_NOSNOOP 0x0800 /* Enable No Snoop */ +#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ +#define PCI_EXP_DEVCTL_BCRE 0x8000 /* Bridge Configuration Retry Enable */ +#define PCI_EXP_DEVCTL_FLRESET 0x8000 /* Function-Level Reset [bit shared with BCRE] */ +#define PCI_EXP_DEVSTA 0xa /* Device Status */ +#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ +#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ +#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ +#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ +#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ +#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ +#define PCI_EXP_LNKCAP 0xc /* Link Capabilities */ +#define PCI_EXP_LNKCAP_SPEED 0x0000f /* Maximum Link Speed */ +#define PCI_EXP_LNKCAP_WIDTH 0x003f0 /* Maximum Link Width */ +#define PCI_EXP_LNKCAP_ASPM 0x00c00 /* Active State Power Management */ +#define PCI_EXP_LNKCAP_L0S 0x07000 /* L0s Acceptable Latency */ +#define PCI_EXP_LNKCAP_L1 0x38000 /* L1 Acceptable Latency */ +#define PCI_EXP_LNKCAP_CLOCKPM 0x40000 /* Clock Power Management */ +#define PCI_EXP_LNKCAP_SURPRISE 0x80000 /* Surprise Down Error Reporting */ +#define PCI_EXP_LNKCAP_DLLA 0x100000 /* Data Link Layer Active Reporting */ +#define PCI_EXP_LNKCAP_LBNC 0x200000 /* Link Bandwidth Notification Capability */ +#define PCI_EXP_LNKCAP_PORT 0xff000000 /* Port Number */ +#define PCI_EXP_LNKCTL 0x10 /* Link Control */ +#define PCI_EXP_LNKCTL_ASPM 0x0003 /* ASPM Control */ +#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ +#define PCI_EXP_LNKCTL_DISABLE 0x0010 /* Link Disable */ +#define PCI_EXP_LNKCTL_RETRAIN 0x0020 /* Retrain Link */ +#define PCI_EXP_LNKCTL_CLOCK 0x0040 /* Common Clock Configuration */ +#define PCI_EXP_LNKCTL_XSYNCH 0x0080 /* Extended Synch */ +#define PCI_EXP_LNKCTL_CLOCKPM 0x0100 /* Clock Power Management */ +#define PCI_EXP_LNKCTL_HWAUTWD 0x0200 /* Hardware Autonomous Width Disable */ +#define PCI_EXP_LNKCTL_BWMIE 0x0400 /* Bandwidth Mgmt Interrupt Enable */ +#define PCI_EXP_LNKCTL_AUTBWIE 0x0800 /* Autonomous Bandwidth Mgmt Interrupt Enable */ +#define PCI_EXP_LNKSTA 0x12 /* Link Status */ +#define PCI_EXP_LNKSTA_SPEED 0x000f /* Negotiated Link Speed */ +#define PCI_EXP_LNKSTA_WIDTH 0x03f0 /* Negotiated Link Width */ +#define PCI_EXP_LNKSTA_TR_ERR 0x0400 /* Training Error (obsolete) */ +#define PCI_EXP_LNKSTA_TRAIN 0x0800 /* Link Training */ +#define PCI_EXP_LNKSTA_SL_CLK 0x1000 /* Slot Clock Configuration */ +#define PCI_EXP_LNKSTA_DL_ACT 0x2000 /* Data Link Layer in DL_Active State */ +#define PCI_EXP_LNKSTA_BWMGMT 0x4000 /* Bandwidth Mgmt Status */ +#define PCI_EXP_LNKSTA_AUTBW 0x8000 /* Autonomous Bandwidth Mgmt Status */ +#define PCI_EXP_SLTCAP 0x14 /* Slot Capabilities */ +#define PCI_EXP_SLTCAP_ATNB 0x0001 /* Attention Button Present */ +#define PCI_EXP_SLTCAP_PWRC 0x0002 /* Power Controller Present */ +#define PCI_EXP_SLTCAP_MRL 0x0004 /* MRL Sensor Present */ +#define PCI_EXP_SLTCAP_ATNI 0x0008 /* Attention Indicator Present */ +#define PCI_EXP_SLTCAP_PWRI 0x0010 /* Power Indicator Present */ +#define PCI_EXP_SLTCAP_HPS 0x0020 /* Hot-Plug Surprise */ +#define PCI_EXP_SLTCAP_HPC 0x0040 /* Hot-Plug Capable */ +#define PCI_EXP_SLTCAP_PWR_VAL 0x00007f80 /* Slot Power Limit Value */ +#define PCI_EXP_SLTCAP_PWR_SCL 0x00018000 /* Slot Power Limit Scale */ +#define PCI_EXP_SLTCAP_INTERLOCK 0x020000 /* Electromechanical Interlock Present */ +#define PCI_EXP_SLTCAP_NOCMDCOMP 0x040000 /* No Command Completed Support */ +#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ +#define PCI_EXP_SLTCTL 0x18 /* Slot Control */ +#define PCI_EXP_SLTCTL_ATNB 0x0001 /* Attention Button Pressed Enable */ +#define PCI_EXP_SLTCTL_PWRF 0x0002 /* Power Fault Detected Enable */ +#define PCI_EXP_SLTCTL_MRLS 0x0004 /* MRL Sensor Changed Enable */ +#define PCI_EXP_SLTCTL_PRSD 0x0008 /* Presence Detect Changed Enable */ +#define PCI_EXP_SLTCTL_CMDC 0x0010 /* Command Completed Interrupt Enable */ +#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ +#define PCI_EXP_SLTCTL_ATNI 0x00c0 /* Attention Indicator Control */ +#define PCI_EXP_SLTCTL_PWRI 0x0300 /* Power Indicator Control */ +#define PCI_EXP_SLTCTL_PWRC 0x0400 /* Power Controller Control */ +#define PCI_EXP_SLTCTL_INTERLOCK 0x0800 /* Electromechanical Interlock Control */ +#define PCI_EXP_SLTCTL_LLCHG 0x1000 /* Data Link Layer State Changed Enable */ +#define PCI_EXP_SLTSTA 0x1a /* Slot Status */ +#define PCI_EXP_SLTSTA_ATNB 0x0001 /* Attention Button Pressed */ +#define PCI_EXP_SLTSTA_PWRF 0x0002 /* Power Fault Detected */ +#define PCI_EXP_SLTSTA_MRLS 0x0004 /* MRL Sensor Changed */ +#define PCI_EXP_SLTSTA_PRSD 0x0008 /* Presence Detect Changed */ +#define PCI_EXP_SLTSTA_CMDC 0x0010 /* Command Completed */ +#define PCI_EXP_SLTSTA_MRL_ST 0x0020 /* MRL Sensor State */ +#define PCI_EXP_SLTSTA_PRES 0x0040 /* Presence Detect State */ +#define PCI_EXP_SLTSTA_INTERLOCK 0x0080 /* Electromechanical Interlock Status */ +#define PCI_EXP_SLTSTA_LLCHG 0x0100 /* Data Link Layer State Changed */ +#define PCI_EXP_RTCTL 0x1c /* Root Control */ +#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */ +#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */ +#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */ +#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */ +#define PCI_EXP_RTCTL_CRSVIS 0x0010 /* Configuration Request Retry Status Visible to SW */ +#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */ +#define PCI_EXP_RTCAP_CRSVIS 0x0010 /* Configuration Request Retry Status Visible to SW */ +#define PCI_EXP_RTSTA 0x20 /* Root Status */ +#define PCI_EXP_RTSTA_PME_REQID 0x0000ffff /* PME Requester ID */ +#define PCI_EXP_RTSTA_PME_STATUS 0x00010000 /* PME Status */ +#define PCI_EXP_RTSTA_PME_PENDING 0x00020000 /* PME is Pending */ +#define PCI_EXP_DEVCAP2 0x24 /* Device capabilities 2 */ +#define PCI_EXP_DEVCTL2 0x28 /* Device Control */ +#define PCI_EXP_DEV2_TIMEOUT_RANGE(x) ((x) & 0xf) /* Completion Timeout Ranges Supported */ +#define PCI_EXP_DEV2_TIMEOUT_VALUE(x) ((x) & 0xf) /* Completion Timeout Value */ +#define PCI_EXP_DEV2_TIMEOUT_DIS 0x0010 /* Completion Timeout Disable Supported */ +#define PCI_EXP_DEV2_ARI 0x0020 /* ARI Forwarding */ +#define PCI_EXP_DEVSTA2 0x2a /* Device Status */ +#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities */ +#define PCI_EXP_LNKCTL2 0x30 /* Link Control */ +#define PCI_EXP_LNKCTL2_SPEED(x) ((x) & 0xf) /* Target Link Speed */ +#define PCI_EXP_LNKCTL2_CMPLNC 0x0010 /* Enter Compliance */ +#define PCI_EXP_LNKCTL2_SPEED_DIS 0x0020 /* Hardware Autonomous Speed Disable */ +#define PCI_EXP_LNKCTL2_DEEMPHASIS(x) (((x) >> 6) & 1) /* Selectable De-emphasis */ +#define PCI_EXP_LNKCTL2_MARGIN(x) (((x) >> 7) & 7) /* Transmit Margin */ +#define PCI_EXP_LNKCTL2_MOD_CMPLNC 0x0400 /* Enter Modified Compliance */ +#define PCI_EXP_LNKCTL2_CMPLNC_SOS 0x0800 /* Compliance SOS */ +#define PCI_EXP_LNKCTL2_COM_DEEMPHASIS(x) (((x) >> 12) & 1) /* Compliance De-emphasis */ +#define PCI_EXP_LNKSTA2 0x32 /* Link Status */ +#define PCI_EXP_LINKSTA2_DEEMPHASIS(x) ((x) & 1) /* Current De-emphasis Level */ +#define PCI_EXP_SLTCAP2 0x34 /* Slot Capabilities */ +#define PCI_EXP_SLTCTL2 0x38 /* Slot Control */ +#define PCI_EXP_SLTSTA2 0x3a /* Slot Status */ + +/* MSI-X */ +#define PCI_MSIX_ENABLE 0x8000 +#define PCI_MSIX_MASK 0x4000 +#define PCI_MSIX_TABSIZE 0x03ff +#define PCI_MSIX_TABLE 4 +#define PCI_MSIX_PBA 8 +#define PCI_MSIX_BIR 0x7 + +/* Subsystem vendor/device ID for PCI bridges */ +#define PCI_SSVID_VENDOR 4 +#define PCI_SSVID_DEVICE 6 + +/* Advanced Error Reporting */ +#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ +#define PCI_ERR_UNC_TRAIN 0x00000001 /* Undefined in PCIe rev1.1 & 2.0 spec */ +#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ +#define PCI_ERR_UNC_SDES 0x00000020 /* Surprise Down Error */ +#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ +#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ +#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ +#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */ +#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */ +#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */ +#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ +#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ +#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ +#define PCI_ERR_UNC_ACS_VIOL 0x00200000 /* ACS Violation */ +#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ +/* Same bits as above */ +#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ +/* Same bits as above */ +#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */ +#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */ +#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */ +#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ +#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ +#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ +#define PCI_ERR_COR_REP_ANFE 0x00002000 /* Advisory Non-Fatal Error */ +#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ +/* Same bits as above */ +#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ +#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */ +#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */ +#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */ +#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */ +#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ +#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ +#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ +#define PCI_ERR_ROOT_STATUS 48 +#define PCI_ERR_ROOT_COR_SRC 52 +#define PCI_ERR_ROOT_SRC 54 + +/* Virtual Channel */ +#define PCI_VC_PORT_REG1 4 +#define PCI_VC_PORT_REG2 8 +#define PCI_VC_PORT_CTRL 12 +#define PCI_VC_PORT_STATUS 14 +#define PCI_VC_RES_CAP 16 +#define PCI_VC_RES_CTRL 20 +#define PCI_VC_RES_STATUS 26 + +/* Power Budgeting */ +#define PCI_PWR_DSR 4 /* Data Select Register */ +#define PCI_PWR_DATA 8 /* Data Register */ +#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */ +#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */ +#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */ +#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */ +#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */ +#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ +#define PCI_PWR_CAP 12 /* Capability */ +#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ + +/* Access Control Services */ +#define PCI_ACS_CAP 0x04 /* ACS Capability Register */ +#define PCI_ACS_CAP_VALID 0x0001 /* ACS Source Validation */ +#define PCI_ACS_CAP_BLOCK 0x0002 /* ACS Translation Blocking */ +#define PCI_ACS_CAP_REQ_RED 0x0004 /* ACS P2P Request Redirect */ +#define PCI_ACS_CAP_CMPLT_RED 0x0008 /* ACS P2P Completion Redirect */ +#define PCI_ACS_CAP_FORWARD 0x0010 /* ACS Upstream Forwarding */ +#define PCI_ACS_CAP_EGRESS 0x0020 /* ACS P2P Egress Control */ +#define PCI_ACS_CAP_TRANS 0x0040 /* ACS Direct Translated P2P */ +#define PCI_ACS_CAP_VECTOR(x) (((x) >> 8) & 0xff) /* Egress Control Vector Size */ +#define PCI_ACS_CTRL 0x06 /* ACS Control Register */ +#define PCI_ACS_CTRL_VALID 0x0001 /* ACS Source Validation Enable */ +#define PCI_ACS_CTRL_BLOCK 0x0002 /* ACS Translation Blocking Enable */ +#define PCI_ACS_CTRL_REQ_RED 0x0004 /* ACS P2P Request Redirect Enable */ +#define PCI_ACS_CTRL_CMPLT_RED 0x0008 /* ACS P2P Completion Redirect Enable */ +#define PCI_ACS_CTRL_FORWARD 0x0010 /* ACS Upstream Forwarding Enable */ +#define PCI_ACS_CTRL_EGRESS 0x0020 /* ACS P2P Egress Control Enable */ +#define PCI_ACS_CTRL_TRANS 0x0040 /* ACS Direct Translated P2P Enable */ +#define PCI_ACS_EGRESS_CTRL 0x08 /* Egress Control Vector */ + +/* Alternative Routing-ID Interpretation */ +#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ +#define PCI_ARI_CAP_MFVC 0x0001 /* MFVC Function Groups Capability */ +#define PCI_ARI_CAP_ACS 0x0002 /* ACS Function Groups Capability */ +#define PCI_ARI_CAP_NFN(x) (((x) >> 8) & 0xff) /* Next Function Number */ +#define PCI_ARI_CTRL 0x06 /* ARI Control Register */ +#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ +#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ +#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ + +/* Address Translation Service */ +#define PCI_ATS_CAP 0x04 /* ATS Capability Register */ +#define PCI_ATS_CAP_IQD(x) ((x) & 0x1f) /* Invalidate Queue Depth */ +#define PCI_ATS_CTRL 0x06 /* ATS Control Register */ +#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ +#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ + +/* Single Root I/O Virtualization */ +#define PCI_IOV_CAP 0x04 /* SR-IOV Capability Register */ +#define PCI_IOV_CAP_VFM 0x00000001 /* VF Migration Capable */ +#define PCI_IOV_CAP_IMN(x) ((x) >> 21) /* VF Migration Interrupt Message Number */ +#define PCI_IOV_CTRL 0x08 /* SR-IOV Control Register */ +#define PCI_IOV_CTRL_VFE 0x0001 /* VF Enable */ +#define PCI_IOV_CTRL_VFME 0x0002 /* VF Migration Enable */ +#define PCI_IOV_CTRL_VFMIE 0x0004 /* VF Migration Interrupt Enable */ +#define PCI_IOV_CTRL_MSE 0x0008 /* VF MSE */ +#define PCI_IOV_CTRL_ARI 0x0010 /* ARI Capable Hierarchy */ +#define PCI_IOV_STATUS 0x0a /* SR-IOV Status Register */ +#define PCI_IOV_STATUS_MS 0x0001 /* VF Migration Status */ +#define PCI_IOV_INITIALVF 0x0c /* Number of VFs that are initially associated */ +#define PCI_IOV_TOTALVF 0x0e /* Maximum number of VFs that could be associated */ +#define PCI_IOV_NUMVF 0x10 /* Number of VFs that are available */ +#define PCI_IOV_FDL 0x12 /* Function Dependency Link */ +#define PCI_IOV_OFFSET 0x14 /* First VF Offset */ +#define PCI_IOV_STRIDE 0x16 /* Routing ID offset from one VF to the next one */ +#define PCI_IOV_DID 0x1a /* VF Device ID */ +#define PCI_IOV_SUPPS 0x1c /* Supported Page Sizes */ +#define PCI_IOV_SYSPS 0x20 /* System Page Size */ +#define PCI_IOV_BAR_BASE 0x24 /* VF BAR0, VF BAR1, ... VF BAR5 */ +#define PCI_IOV_NUM_BAR 6 /* Number of VF BARs */ +#define PCI_IOV_MSAO 0x3c /* VF Migration State Array Offset */ +#define PCI_IOV_MSA_BIR(x) ((x) & 7) /* VF Migration State BIR */ +#define PCI_IOV_MSA_OFFSET(x) ((x) & 0xfffffff8) /* VF Migration State Offset */ + +/* + * The PCI interface treats multi-function devices as independent + * devices. The slot/function address of each device is encoded + * in a single byte as follows: + * + * 7:3 = slot + * 2:0 = function + */ +#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) +#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) +#define PCI_FUNC(devfn) ((devfn) & 0x07) + +/* Device classes and subclasses */ +#define PCI_CLASS_NOT_DEFINED 0x0000 +#define PCI_CLASS_NOT_DEFINED_VGA 0x0001 + +// values for the class_sub field for class_base = 0x00 (Device was built prior definition of the class code field) + +// values for the class_sub field for class_base = 0x01 (Mass Storage Controller) +#define PCI_BASE_CLASS_STORAGE 0x01 +#define PCI_CLASS_STORAGE_SCSI 0x0100 +#define PCI_CLASS_STORAGE_IDE 0x0101 +#define PCI_CLASS_STORAGE_FLOPPY 0x0102 +#define PCI_CLASS_STORAGE_IPI 0x0103 +#define PCI_CLASS_STORAGE_RAID 0x0104 +#define PCI_CLASS_STORAGE_ATA 0x0105 +#define PCI_CLASS_STORAGE_SATA 0x0106 +#define PCI_CLASS_STORAGE_SATA_AHCI 0x010601 +#define PCI_CLASS_STORAGE_SAS 0x0107 +#define PCI_CLASS_STORAGE_OTHER 0x0180 + +// values for the class_sub field for class_base = 0x02 (Network Controller) +#define PCI_BASE_CLASS_NETWORK 0x02 +#define PCI_CLASS_NETWORK_ETHERNET 0x0200 +#define PCI_CLASS_NETWORK_TOKEN_RING 0x0201 +#define PCI_CLASS_NETWORK_FDDI 0x0202 +#define PCI_CLASS_NETWORK_ATM 0x0203 +#define PCI_CLASS_NETWORK_ISDN 0x0204 +#define PCI_CLASS_NETWORK_OTHER 0x0280 + +// values for the class_sub field for class_base = 0x03 (Display Controller) +#define PCI_BASE_CLASS_DISPLAY 0x03 +#define PCI_CLASS_DISPLAY_VGA 0x0300 +#define PCI_CLASS_DISPLAY_XGA 0x0301 +#define PCI_CLASS_DISPLAY_3D 0x0302 +#define PCI_CLASS_DISPLAY_OTHER 0x0380 + +// values for the class_sub field for class_base = 0x04 (Multimedia Controller) +#define PCI_BASE_CLASS_MULTIMEDIA 0x04 +#define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400 /* video */ +#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401 /* audio */ +#define PCI_CLASS_MULTIMEDIA_PHONE 0x0402 +#define PCI_CLASS_MULTIMEDIA_AUDIO_DEV 0x0403 /* HD audio */ +#define PCI_CLASS_MULTIMEDIA_OTHER 0x0480 + +// values for the class_sub field for class_base = 0x05 (Memory Controller) +#define PCI_BASE_CLASS_MEMORY 0x05 +#define PCI_CLASS_MEMORY_RAM 0x0500 +#define PCI_CLASS_MEMORY_FLASH 0x0501 +#define PCI_CLASS_MEMORY_OTHER 0x0580 + +// values for the class_sub field for class_base = 0x06 (Bridge Device) +#define PCI_BASE_CLASS_BRIDGE 0x06 +#define PCI_CLASS_BRIDGE_HOST 0x0600 +#define PCI_CLASS_BRIDGE_ISA 0x0601 +#define PCI_CLASS_BRIDGE_EISA 0x0602 +#define PCI_CLASS_BRIDGE_MC 0x0603 +#define PCI_CLASS_BRIDGE_PCI 0x0604 +#define PCI_CLASS_BRIDGE_PCMCIA 0x0605 +#define PCI_CLASS_BRIDGE_NUBUS 0x0606 +#define PCI_CLASS_BRIDGE_CARDBUS 0x0607 +#define PCI_CLASS_BRIDGE_RACEWAY 0x0608 +#define PCI_CLASS_BRIDGE_PCI_SEMI 0x0609 +#define PCI_CLASS_BRIDGE_IB_TO_PCI 0x060a +#define PCI_CLASS_BRIDGE_OTHER 0x0680 + +// values for the class_sub field for class_base = 0x07 (Simple Communications Controllers) +#define PCI_BASE_CLASS_COMMUNICATION 0x07 +#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700 +#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701 +#define PCI_CLASS_COMMUNICATION_MSERIAL 0x0702 +#define PCI_CLASS_COMMUNICATION_MODEM 0x0703 +#define PCI_CLASS_COMMUNICATION_OTHER 0x0780 + +// values for the class_sub field for class_base = 0x08 (Base System Peripherals) +#define PCI_BASE_CLASS_SYSTEM 0x08 +#define PCI_CLASS_SYSTEM_PIC 0x0800 +#define PCI_CLASS_SYSTEM_PIC_IOAPIC 0x080010 +#define PCI_CLASS_SYSTEM_PIC_IOXAPIC 0x080020 /* I/O APIC interrupt controller , 32 bye none-prefectable memory. */ +#define PCI_CLASS_SYSTEM_DMA 0x0801 +#define PCI_CLASS_SYSTEM_TIMER 0x0802 +#define PCI_CLASS_SYSTEM_RTC 0x0803 +#define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 /* HotPlug Controller */ +#define PCI_CLASS_SYSTEM_SDHCI 0x0805 +#define PCI_CLASS_SYSTEM_OTHER 0x0880 + +// values for the class_sub field for class_base = 0x09 (Input Devices) +#define PCI_BASE_CLASS_INPUT 0x09 +#define PCI_CLASS_INPUT_KEYBOARD 0x0900 +#define PCI_CLASS_INPUT_PEN 0x0901 +#define PCI_CLASS_INPUT_MOUSE 0x0902 +#define PCI_CLASS_INPUT_SCANNER 0x0903 +#define PCI_CLASS_INPUT_GAMEPORT 0x0904 +#define PCI_CLASS_INPUT_OTHER 0x0980 + +// values for the class_sub field for class_base = 0x0a (Docking Stations) +#define PCI_BASE_CLASS_DOCKING 0x0a +#define PCI_CLASS_DOCKING_GENERIC 0x0a00 +#define PCI_CLASS_DOCKING_OTHER 0x0a80 + +// values for the class_sub field for class_base = 0x0b (processor) +#define PCI_BASE_CLASS_PROCESSOR 0x0b +#define PCI_CLASS_PROCESSOR_386 0x0b00 +#define PCI_CLASS_PROCESSOR_486 0x0b01 +#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02 +#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10 +#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 +#define PCI_CLASS_PROCESSOR_MIPS 0x0b30 +#define PCI_CLASS_PROCESSOR_CO 0x0b40 /* Co-Processor */ + +// values for the class_sub field for class_base = 0x0c (serial bus controller) +#define PCI_BASE_CLASS_SERIAL 0x0c +#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00 /* FireWire (IEEE 1394) */ +#define PCI_CLASS_SERIAL_FIREWIRE_OHCI 0x0c10 +#define PCI_CLASS_SERIAL_ACCESS 0x0c01 +#define PCI_CLASS_SERIAL_SSA 0x0c02 +#define PCI_CLASS_SERIAL_USB 0x0c03 /* Universal Serial Bus */ +#define PCI_IF_UHCI 0x00 /* Universal Host Controller Interface */ +#define PCI_IF_OHCI 0x10 /* Open Host Controller Interface */ +#define PCI_IF_EHCI 0x20 /* Enhanced Host Controller Interface */ +#define PCI_IF_XHCI 0x30 /* Extensible Host Controller Interface */ +#define PCI_CLASS_SERIAL_FIBER 0x0c04 +#define PCI_CLASS_SERIAL_SMBUS 0x0c05 +#define PCI_CLASS_SERIAL_INFINIBAND 0x0c06 + +// values for the class_sub field for class_base = 0x0d (Wireless Controller) +#define PCI_BASE_CLASS_WIRELESS 0x0d +#define PCI_CLASS_WIRELESS_IRDA 0x0d00 +#define PCI_CLASS_WIRELESS_IR 0x0d01 +#define PCI_CLASS_WIRELESS_RF 0x0d10 +#define PCI_CLASS_WIRELESS_BLUETOOTH 0x0d11 +#define PCI_CLASS_WIRELESS_BROADBAND 0x0d12 +#define PCI_CLASS_WIRELESS_80211A 0x0d20 +#define PCI_CLASS_WIRELESS_80211B 0x0d21 +#define PCI_CLASS_WIRELESS_WHCI 0x0d1010 +#define PCI_CLASS_WIRELESS_OTHER 0x80 + +// values for the class_sub field for class_base = 0x0e (Intelligent I/O Controller) +#define PCI_BASE_CLASS_INTELLIGENT 0x0e +#define PCI_CLASS_INTELLIGENT_I2O 0x0e00 + +// values for the class_sub field for class_base = 0x0f (Satellite Communication Controller) +#define PCI_BASE_CLASS_SATELLITE 0x0f +#define PCI_CLASS_SATELLITE_TV 0x0f00 +#define PCI_CLASS_SATELLITE_AUDIO 0x0f01 +#define PCI_CLASS_SATELLITE_VOICE 0x0f03 +#define PCI_CLASS_SATELLITE_DATA 0x0f04 + +// values for the class_sub field for class_base = 0x10 (Encryption and decryption controller) +#define PCI_BASE_CLASS_CRYPT 0x10 +#define PCI_CLASS_CRYPT_NETWORK 0x1000 +#define PCI_CLASS_CRYPT_ENTERTAINMENT 0x1010 +#define PCI_CLASS_CRYPT_OTHER 0x1080 + +// values for the class_sub field for class_base = 0x11 (Data Acquisition and Signal Processing Controllers) +#define PCI_BASE_CLASS_SIGNAL 0x11 +#define PCI_CLASS_SIGNAL_DPIO 0x1100 +#define PCI_CLASS_SIGNAL_PERF_CTR 0x1101 +#define PCI_CLASS_SIGNAL_SYNCHRONIZER 0x1110 +#define PCI_CLASS_SIGNAL_OTHER 0x1180 + +// values for the class_sub field for class_base = 0xff (Device does not fit any defined class) +#define PCI_CLASS_OTHERS 0xff + +/* Several ID's we need in the library */ +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_VENDOR_ID_AMD 0x1022 +#define PCI_VENDOR_ID_ATI 0x1002 +#define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_VENDOR_ID_NVIDIA 0x10de +#define PCI_VENDOR_ID_REALTEK 0x10ec +#define PCI_VENDOR_ID_TEXAS_INSTRUMENTS 0x104c +#define PCI_VENDOR_ID_VIA 0x1106 + +#endif /* !__LIBSAIO_PCI_H */ diff --git a/i386/libsaio/.svn/text-base/pci_root.c.svn-base b/i386/libsaio/.svn/text-base/pci_root.c.svn-base new file mode 100644 index 0000000..4fe1a45 --- /dev/null +++ b/i386/libsaio/.svn/text-base/pci_root.c.svn-base @@ -0,0 +1,126 @@ +/* + * Copyright 2009 netkas + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" + +#ifndef DEBUG_PCIROOT +#define DEBUG_PCIROOT 1 +#endif + +#if DEBUG_PCIROOT +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +static int rootuid = 10; //value means function wasnt ran yet + +static unsigned int findrootuid(unsigned char * dsdt, int len) +{ + int i; + for (i=0; i<64 && i<len-5; i++) //not far than 64 symbols from pci root + { + if(dsdt[i] == '_' && dsdt[i+1] == 'U' && dsdt[i+2] == 'I' && dsdt[i+3] == 'D' && dsdt[i+5] == 0x08) + { + return dsdt[i+4]; + } + } + return 11; +} + +static unsigned int findpciroot(unsigned char * dsdt,int len) +{ + int i; + + for (i=0; i<len-4; i++) { + if(dsdt[i] == 'P' && dsdt[i+1] == 'C' && dsdt[i+2] == 'I' && (dsdt[i+3] == 0x08 || dsdt [i+4] == 0x08)) { + return findrootuid(dsdt+i, len-i); + } + } + return 10; +} + +int getPciRootUID(void) +{ + char dsdt_dirSpec[128]; + + void *new_dsdt; + const char *val; + int len,fsize; + const char * dsdt_filename=NULL; + extern int search_and_get_acpi_fd(const char *, const char **); + + if (rootuid < 10) return rootuid; + rootuid = 0; /* default uid = 0 */ + + if (getValueForKey(kPCIRootUID, &val, &len, &bootInfo->chameleonConfig)) { + if (isdigit(val[0])) rootuid = val[0] - '0'; + goto out; + } + /* Chameleon compatibility */ + else if (getValueForKey("PciRoot", &val, &len, &bootInfo->chameleonConfig)) { + if (isdigit(val[0])) rootuid = val[0] - '0'; + goto out; + } + /* PCEFI compatibility */ + else if (getValueForKey("-pci0", &val, &len, &bootInfo->chameleonConfig)) { + rootuid = 0; + goto out; + } + else if (getValueForKey("-pci1", &val, &len, &bootInfo->chameleonConfig)) { + rootuid = 1; + goto out; + } + + + // Try using the file specified with the DSDT option + if (getValueForKey(kDSDT, &dsdt_filename, &len, &bootInfo->chameleonConfig)) + { + sprintf(dsdt_dirSpec, dsdt_filename); + } + else + { + sprintf(dsdt_dirSpec, "DSDT.aml"); + } + + int fd = search_and_get_acpi_fd(dsdt_dirSpec, &dsdt_filename); + + // Check booting partition + if (fd<0) + { + verbose("No DSDT found, using 0 as uid value.\n"); + rootuid = 0; + goto out; + } + + fsize = file_size(fd); + + if ((new_dsdt = malloc(fsize)) == NULL) { + verbose("[ERROR] alloc DSDT memory failed\n"); + close (fd); + goto out; + } + if (read (fd, new_dsdt, fsize) != fsize) { + verbose("[ERROR] read %s failed\n", dsdt_filename); + close (fd); + goto out; + } + close (fd); + + rootuid = findpciroot(new_dsdt, fsize); + free(new_dsdt); + + // make sure it really works: + if (rootuid == 11) rootuid=0; //usually when _UID isnt present, it means uid is zero + else if (rootuid < 0 || rootuid > 9) + { + printf("PciRoot uid value wasnt found, using 0, if you want it to be 1, use -PciRootUID flag"); + rootuid = 0; + } +out: + verbose("Using PCI-Root-UID value: %d\n", rootuid); + return rootuid; +} diff --git a/i386/libsaio/.svn/text-base/pci_root.h.svn-base b/i386/libsaio/.svn/text-base/pci_root.h.svn-base new file mode 100644 index 0000000..9c870b8 --- /dev/null +++ b/i386/libsaio/.svn/text-base/pci_root.h.svn-base @@ -0,0 +1,13 @@ +/* + * Copyright 2008 mackerintel + */ + +#ifndef __LIBSAIO_PCI_ROOT_H +#define __LIBSAIO_PCI_ROOT_H + +#include "libsaio.h" + + +extern int getPciRootUID(void); + +#endif /* !__LIBSAIO_DSDT_PATCHER_H */ diff --git a/i386/libsaio/.svn/text-base/pci_setup.c.svn-base b/i386/libsaio/.svn/text-base/pci_setup.c.svn-base new file mode 100644 index 0000000..0248ff4 --- /dev/null +++ b/i386/libsaio/.svn/text-base/pci_setup.c.svn-base @@ -0,0 +1,78 @@ +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "gma.h" +#include "nvidia.h" +#include "modules.h" + + +extern bool setup_ati_devprop(pci_dt_t *ati_dev); +extern void set_eth_builtin(pci_dt_t *eth_dev); +extern void notify_usb_dev(pci_dt_t *pci_dev); +extern void force_enable_hpet(pci_dt_t *lpc_dev); + +extern pci_dt_t *dram_controller_dev; + +void setup_pci_devs(pci_dt_t *pci_dt) +{ + char *devicepath; + bool do_eth_devprop, do_gfx_devprop, do_enable_hpet; + pci_dt_t *current = pci_dt; + + do_eth_devprop = do_gfx_devprop = do_enable_hpet = false; + + getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->chameleonConfig); + getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->chameleonConfig); + getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->chameleonConfig); + + while (current) + { + devicepath = get_pci_dev_path(current); + + switch (current->class_id) + { + case PCI_CLASS_BRIDGE_HOST: + if (current->dev.addr == PCIADDR(0, 0, 0)) + dram_controller_dev = current; + break; + + case PCI_CLASS_NETWORK_ETHERNET: + if (do_eth_devprop) + set_eth_builtin(current); + break; + + case PCI_CLASS_DISPLAY_VGA: + if (do_gfx_devprop) + switch (current->vendor_id) + { + case PCI_VENDOR_ID_ATI: + setup_ati_devprop(current); + break; + + case PCI_VENDOR_ID_INTEL: + setup_gma_devprop(current); + break; + + case PCI_VENDOR_ID_NVIDIA: + setup_nvidia_devprop(current); + break; + } + break; + + case PCI_CLASS_SERIAL_USB: + notify_usb_dev(current); + break; + + case PCI_CLASS_BRIDGE_ISA: + if (do_enable_hpet) + force_enable_hpet(current); + break; + } + + execute_hook("PCIDevice", current, NULL, NULL, NULL); + + setup_pci_devs(current->children); + current = current->next; + } +} diff --git a/i386/libsaio/.svn/text-base/platform.c.svn-base b/i386/libsaio/.svn/text-base/platform.c.svn-base new file mode 100644 index 0000000..0fba999 --- /dev/null +++ b/i386/libsaio/.svn/text-base/platform.c.svn-base @@ -0,0 +1,71 @@ +/* + * platform.c + * + * AsereBLN: cleanup + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "cpu.h" +#include "spd.h" +#include "dram_controllers.h" + +#ifndef DEBUG_PLATFORM +#define DEBUG_PLATFORM 0 +#endif + +#if DEBUG_PLATFORM +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +PlatformInfo_t Platform; +pci_dt_t * dram_controller_dev = NULL; + +/** Return if a CPU feature specified by feature is activated (true) or not (false) */ +bool platformCPUFeature(uint32_t feature) +{ + if (Platform.CPU.Features & feature) { + return true; + } else { + return false; + } +} + +/** scan mem for memory autodection purpose */ +void scan_mem() { + static bool done = false; + if (done) return; + + /* our code only works on Intel chipsets so make sure here */ + if (pci_config_read16(PCIADDR(0, 0x00, 0), 0x00) != 0x8086) + bootInfo->memDetect = false; + else + bootInfo->memDetect = true; + /* manually */ + getBoolForKey(kUseMemDetect, &bootInfo->memDetect, &bootInfo->chameleonConfig); + + if (bootInfo->memDetect) { + if (dram_controller_dev != NULL) { + scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ... + } + scan_spd(&Platform); + } + done = true; +} + +/** + Scan platform hardware information, called by the main entry point (common_boot() ) + _before_ bootConfig xml parsing settings are loaded +*/ +void scan_platform(void) +{ + memset(&Platform, 0, sizeof(Platform)); + build_pci_dt(); + scan_cpu(&Platform); + //scan_mem(); Rek: called after pci devs init in fake_efi now ... +} diff --git a/i386/libsaio/.svn/text-base/platform.h.svn-base b/i386/libsaio/.svn/text-base/platform.h.svn-base new file mode 100644 index 0000000..9eb8e0f --- /dev/null +++ b/i386/libsaio/.svn/text-base/platform.h.svn-base @@ -0,0 +1,166 @@ +/* + * platform.h + * AsereBLN: reworked and extended + * + */ + +#ifndef __LIBSAIO_PLATFORM_H +#define __LIBSAIO_PLATFORM_H + +//#include "libsaio.h" + +extern bool platformCPUFeature(uint32_t); +extern void scan_platform(void); +extern void dumpPhysAddr(const char * title, void * a, int len); + +/* CPUID Vendor */ +#define CPUID_VENDOR_INTEL 0x756E6547 +#define CPUID_VENDOR_AMD 0x68747541 + +/* CPUID index into cpuid_raw */ +#define CPUID_0 0 +#define CPUID_1 1 +#define CPUID_2 2 +#define CPUID_3 3 +#define CPUID_4 4 +#define CPUID_5 5 +#define CPUID_6 6 +#define CPUID_80 7 +#define CPUID_81 8 +#define CPUID_88 9 +#define CPUID_MAX 10 + +#define CPU_MODEL_DOTHAN 0x0D // Dothan +#define CPU_MODEL_YONAH 0x0E // Sossaman, Yonah +#define CPU_MODEL_MEROM 0x0F // Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom +#define CPU_MODEL_PENRYN 0x17 // Wolfdale, Yorkfield, Harpertown, Penryn +#define CPU_MODEL_NEHALEM 0x1A // Bloomfield. Nehalem-EP, Nehalem-WS, Gainestown +#define CPU_MODEL_ATOM 0x1C // Atom +#define CPU_MODEL_FIELDS 0x1E // Lynnfield, Clarksfield, Jasper Forest +#define CPU_MODEL_DALES 0x1F // Havendale, Auburndale +#define CPU_MODEL_DALES_32NM 0x25 // Clarkdale, Arrandale +#define CPU_MODEL_SANDYBRIDGE 0x2A // Sandy Bridge +#define CPU_MODEL_WESTMERE 0x2C // Gulftown, Westmere-EP, Westmere-WS +#define CPU_MODEL_JAKETOWN 0x2D // Sandy Bridge-E, Sandy Bridge-EP +#define CPU_MODEL_NEHALEM_EX 0x2E // Beckton +#define CPU_MODEL_WESTMERE_EX 0x2F // Westmere-EX +#define CPU_MODEL_IVYBRIDGE 0x3A // Ivy Bridge +#define CPU_MODEL_HASWELL 0x3C // Haswell + +/* CPU Features */ +#define CPU_FEATURE_MMX 0x00000001 // MMX Instruction Set +#define CPU_FEATURE_SSE 0x00000002 // SSE Instruction Set +#define CPU_FEATURE_SSE2 0x00000004 // SSE2 Instruction Set +#define CPU_FEATURE_SSE3 0x00000008 // SSE3 Instruction Set +#define CPU_FEATURE_SSE41 0x00000010 // SSE41 Instruction Set +#define CPU_FEATURE_SSE42 0x00000020 // SSE42 Instruction Set +#define CPU_FEATURE_EM64T 0x00000040 // 64Bit Support +#define CPU_FEATURE_HTT 0x00000080 // HyperThreading +#define CPU_FEATURE_MOBILE 0x00000100 // Mobile CPU +#define CPU_FEATURE_MSR 0x00000200 // MSR Support + +/* SMBIOS Memory Types */ +#define SMB_MEM_TYPE_UNDEFINED 0 +#define SMB_MEM_TYPE_OTHER 1 +#define SMB_MEM_TYPE_UNKNOWN 2 +#define SMB_MEM_TYPE_DRAM 3 +#define SMB_MEM_TYPE_EDRAM 4 +#define SMB_MEM_TYPE_VRAM 5 +#define SMB_MEM_TYPE_SRAM 6 +#define SMB_MEM_TYPE_RAM 7 +#define SMB_MEM_TYPE_ROM 8 +#define SMB_MEM_TYPE_FLASH 9 +#define SMB_MEM_TYPE_EEPROM 10 +#define SMB_MEM_TYPE_FEPROM 11 +#define SMB_MEM_TYPE_EPROM 12 +#define SMB_MEM_TYPE_CDRAM 13 +#define SMB_MEM_TYPE_3DRAM 14 +#define SMB_MEM_TYPE_SDRAM 15 +#define SMB_MEM_TYPE_SGRAM 16 +#define SMB_MEM_TYPE_RDRAM 17 +#define SMB_MEM_TYPE_DDR 18 +#define SMB_MEM_TYPE_DDR2 19 +#define SMB_MEM_TYPE_FBDIMM 20 +#define SMB_MEM_TYPE_DDR3 24 // Supported in 10.5.6+ AppleSMBIOS + +/* Memory Configuration Types */ +#define SMB_MEM_CHANNEL_UNKNOWN 0 +#define SMB_MEM_CHANNEL_SINGLE 1 +#define SMB_MEM_CHANNEL_DUAL 2 +#define SMB_MEM_CHANNEL_TRIPLE 3 + +/* Maximum number of ram slots */ +#define MAX_RAM_SLOTS 8 +#define RAM_SLOT_ENUMERATOR {0, 2, 4, 1, 3, 5, 6, 8, 10, 7, 9, 11} + +/* Maximum number of SPD bytes */ +#define MAX_SPD_SIZE 256 + +/* Size of SMBIOS UUID in bytes */ +#define UUID_LEN 16 + +typedef struct _RamSlotInfo_t { + uint32_t ModuleSize; // Size of Module in MB + uint32_t Frequency; // in Mhz + const char* Vendor; + const char* PartNo; + const char* SerialNo; + char* spd; // SPD Dump + bool InUse; + uint8_t Type; + uint8_t BankConnections; // table type 6, see (3.3.7) + uint8_t BankConnCnt; +} RamSlotInfo_t; + +typedef struct _PlatformInfo_t { + struct CPU { + uint32_t Features; // CPU Features like MMX, SSE2, VT, MobileCPU + uint32_t Vendor; // Vendor + uint32_t Signature; // Signature + uint32_t Stepping; // Stepping + uint32_t Model; // Model + uint32_t ExtModel; // Extended Model + uint32_t Family; // Family + uint32_t ExtFamily; // Extended Family + uint32_t NoCores; // No Cores per Package + uint32_t NoThreads; // Threads per Package + uint8_t MaxCoef; // Max Multiplier + uint8_t MaxDiv; + uint8_t CurrCoef; // Current Multiplier + uint8_t CurrDiv; + uint64_t TSCFrequency; // TSC Frequency Hz + uint64_t FSBFrequency; // FSB Frequency Hz + uint64_t CPUFrequency; // CPU Frequency Hz + uint32_t MaxRatio; // Max Bus Ratio + uint32_t MinRatio; // Min Bus Ratio + char BrandString[48]; // 48 Byte Branding String + uint32_t CPUID[CPUID_MAX][4]; // CPUID 0..4, 80..81 Raw Values + } CPU; + + struct RAM { + uint64_t Frequency; // Ram Frequency + uint32_t Divider; // Memory divider + uint8_t CAS; // CAS 1/2/2.5/3/4/5/6/7 + uint8_t TRC; + uint8_t TRP; + uint8_t RAS; + uint8_t Channels; // Channel Configuration Single,Dual or Triple + uint8_t NoSlots; // Maximum no of slots available + uint8_t Type; // Standard SMBIOS v2.5 Memory Type + RamSlotInfo_t DIMM[MAX_RAM_SLOTS]; // Information about each slot + } RAM; + + struct DMI { + int MaxMemorySlots; // number of memory slots populated by SMBIOS + int CntMemorySlots; // number of memory slots counted + int MemoryModules; // number of memory modules installed + int DIMM[MAX_RAM_SLOTS]; // Information and SPD mapping for each slot + } DMI; + + uint8_t Type; // System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FACP: PM_Profile) + uint8_t *UUID; +} PlatformInfo_t; + +extern PlatformInfo_t Platform; + +#endif /* !__LIBSAIO_PLATFORM_H */ diff --git a/i386/libsaio/.svn/text-base/saio_internal.h.svn-base b/i386/libsaio/.svn/text-base/saio_internal.h.svn-base new file mode 100644 index 0000000..840aa62 --- /dev/null +++ b/i386/libsaio/.svn/text-base/saio_internal.h.svn-base @@ -0,0 +1,224 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_SAIO_INTERNAL_H +#define __LIBSAIO_SAIO_INTERNAL_H + +#include "saio_types.h" + +/* asm.s */ +extern void real_to_prot(void); +extern void prot_to_real(void); +extern void halt(void); +extern void startprog(unsigned int address, void *arg); +extern void loader(UInt32 code, UInt32 cmdptr); + +/* bios.s */ +extern void bios(biosBuf_t *bb); + +/* biosfn.c */ +#ifdef EISA_SUPPORT +extern bool eisa_present(void); +#endif +extern int bgetc(void); +extern int biosread(int dev, int cyl, int head, int sec, int num); +extern int ebiosread(int dev, unsigned long long sec, int count); +extern int ebioswrite(int dev, long sec, int count); +extern int get_drive_info(int drive, struct driveInfo *dp); +extern int ebiosEjectMedia(int biosdev); +extern void bios_putchar(int ch); +extern void putca(int ch, int attr, int repeat); +extern int readKeyboardStatus(void); +extern int readKeyboardShiftFlags(void); +extern unsigned int time18(void); +extern void delay(int ms); +extern unsigned int get_diskinfo(int dev); +#if APM_SUPPORT +extern int APMPresent(void); +extern int APMConnect32(void); +#endif +extern int memsize(int i); +extern void video_mode(int mode); +extern void setCursorPosition(int x, int y, int page); +extern void setCursorType(int type); +extern void getCursorPositionAndType(int *x, int *y, int *type); +extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir); +extern void clearScreenRows(int y1, int y2); +extern void setActiveDisplayPage( int page ); +extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount, + unsigned long * conMemSizePtr, unsigned long * extMemSizePtr); +extern unsigned long getExtendedMemorySize(); +extern unsigned long getConventionalMemorySize(); +extern void sleep(int n); + +/* bootstruct.c */ +extern void initKernBootStruct(void); +extern void reserveKernBootStruct(void); +extern void copyKernBootStruct(void); +extern void finalizeBootStruct(void); + +/* cache.c */ +extern void CacheReset(); +extern void CacheInit(CICell ih, long blockSize); +extern long CacheRead(CICell ih, char *buffer, long long offset, + long length, long cache); + +/* console.c */ +extern bool gVerboseMode; +extern bool gErrors; +extern void initBooterLog(void); +extern void msglog(const char * format, ...); +extern void setupBooterLog(void); +extern int putchar(int ch); +extern int getchar(void); +extern int printf(const char *format, ...); +extern int error(const char *format, ...); +extern int verbose(const char *format, ...); +extern void stop(const char *format, ...); +//Azi: replace getc/getchar with ? console.c +extern void pause(); + +/* disk.c */ +extern void rescanBIOSDevice(int biosdev); +extern struct DiskBVMap* diskResetBootVolumes(int biosdev); +extern void diskFreeMap(struct DiskBVMap *map); +extern int testBiosread( int biosdev, unsigned long long secno ); +extern BVRef diskScanBootVolumes(int biosdev, int *count); +extern void diskSeek(BVRef bvr, long long position); +extern int diskRead(BVRef bvr, long addr, long length); +extern int diskIsCDROM(BVRef bvr); +extern int biosDevIsCDROM(int biosdev); +extern BVRef getBVChainForBIOSDev(int biosdev); +extern BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count); +extern int freeFilteredBVChain(const BVRef chain); +extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); +extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); +extern int readBootSector(int biosdev, unsigned int secno, void *buffer); +extern void turnOffFloppy(void); +extern int testFAT32EFIBootSector( int biosdev, unsigned int secno, void * buffer ); + +/* hfs_compare.c */ +extern int32_t FastUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, + u_int16_t *uniStr2, u_int32_t len2, int byte_order); +extern void utf_encodestr( const u_int16_t * ucsp, int ucslen, + u_int8_t * utf8p, u_int32_t bufsize, int byte_order ); +extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp, + u_int16_t *ucslen, u_int32_t bufsize, int byte_order ); + +/* load.c */ +extern bool gHaveKernelCache; +extern long ThinFatFile(void **binary, unsigned long *length); +extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize); + +/* memory.c */ +long AllocateKernelMemory( long inSize ); +long AllocateMemoryRange(char * rangeName, long start, long length, long type); + +/* misc.c */ +extern void enableA20(void); +extern int checkForSupportedHardware(); +extern int isLaptop(); +extern void getPlatformName(char *nameBuf); + +/* nbp.c */ +extern UInt32 nbpUnloadBaseCode(); +extern BVRef nbpScanBootVolumes(int biosdev, int *count); + +/* stringTable.c */ +extern char * newStringFromList(char **list, int *size); +extern int stringLength(const char *table, int compress); +extern bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size); +extern bool removeKeyFromTable(const char *key, char *table); +extern char * newStringForStringTableKey(config_file_t *config, char *key); +extern char * newStringForKey(char *key, config_file_t *configBuff); +extern bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len); +extern bool getValueForKey(const char *key, const char **val, int *size, config_file_t *configBuff); +extern const char * getStringForKey(const char * key, config_file_t *config); +extern bool getBoolForKey(const char *key, bool *val, config_file_t *configBuff); +extern bool getIntForKey(const char *key, int *val, config_file_t *configBuff); +extern bool getColorForKey(const char *key, unsigned int *val, config_file_t *configBuff); +extern bool getDimensionForKey( const char *key, unsigned int *value, config_file_t *config, unsigned int dimension_max, unsigned int object_size ); +extern int loadConfigFile(const char *configFile, config_file_t *configBuff); +extern int loadSystemConfig(config_file_t *configBuff); +extern int loadHelperConfig(config_file_t *configBuff); +extern int loadChameleonConfig(config_file_t *configBuff); +extern char * newString(const char *oldString); +extern char * getNextArg(char ** ptr, char * val); +extern int ParseXMLFile( char * buffer, TagPtr * dict ); + +/* sys.c */ +extern BVRef getBootVolumeRef( const char * path, const char ** outPath ); +extern long LoadVolumeFile(BVRef bvr, const char *fileSpec); +extern long LoadFile(const char *fileSpec); +extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length); +extern long LoadThinFatFile(const char *fileSpec, void **binary); +extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name, + long *flags, long *time); +extern long GetFileInfo(const char *dirSpec, const char *name, + long *flags, long *time); +extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock); +extern long GetFSUUID(char *spec, char *uuidStr); +extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr); +extern int openmem(char *buf, int len); +extern int open(const char *str, int how); +extern int open_bvdev(const char *bvd, const char *path, int flags); +extern int close(int fdesc); +extern int file_size(int fdesc); +extern int read(int fdesc, char *buf, int count); +extern int write(int fdesc, const char *buf, int count); +extern int writebyte(int fdesc, char value); +extern int writeint(int fdesc, int value); +extern int b_lseek(int fdesc, int addr, int ptr); +extern int tell(int fdesc); +extern const char * systemConfigDir(void); +extern struct dirstuff * opendir(const char *path); +extern struct dirstuff * vol_opendir(BVRef bvr, const char *path); +extern int closedir(struct dirstuff *dirp); +extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time); +extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, + long * time, FinderInfo *finderInfo, long *infoValid); +extern void flushdev(void); +extern void scanBootVolumes(int biosdev, int *count); +extern void scanDisks(int biosdev, int *count); +extern BVRef selectBootVolume(BVRef chain); +extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose); +extern void setRootVolume(BVRef volume); +extern void setBootGlobals(BVRef chain); +extern int getDeviceDescription(BVRef volume, char *str); + +extern int gBIOSDev; +extern int gBootFileType; +extern BVRef gBootVolume; +extern BVRef gBIOSBootVolume; + +// Function pointer to be filled in if ramdisks are available +extern int (*p_get_ramdisk_info)(int biosdev, struct driveInfo *dip); +extern int (*p_ramdiskReadBytes)( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ); + +// Base64-decode.c +char *BASE64Decode(const char* src, int in_len, int* out_len); + +#endif /* !__LIBSAIO_SAIO_INTERNAL_H */ diff --git a/i386/libsaio/.svn/text-base/saio_types.h.svn-base b/i386/libsaio/.svn/text-base/saio_types.h.svn-base new file mode 100644 index 0000000..e35915f --- /dev/null +++ b/i386/libsaio/.svn/text-base/saio_types.h.svn-base @@ -0,0 +1,275 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Useful types. */ + +#ifndef __LIBSAIO_SAIO_TYPES_H +#define __LIBSAIO_SAIO_TYPES_H + +#include <sys/reboot.h> +#include <sys/types.h> +#include <sys/param.h> +#include "bios.h" +#include "nbp_cmd.h" +#include "bootargs.h" + +#if DEBUG +#define DEBUG_DISK(x) printf x +#else +#define DEBUG_DISK(x) +#endif + +typedef unsigned long entry_t; + +typedef struct { + unsigned int sectors:8; + unsigned int heads:8; + unsigned int cylinders:16; +} compact_diskinfo_t; + +struct driveParameters { + int cylinders; + int sectors; + int heads; + int totalDrives; +}; + +struct Tag { + long type; + char *string; + long offset; + struct Tag *tag; + struct Tag *tagNext; +}; +typedef struct Tag Tag, *TagPtr; + +/* + * Max size fo config data array, in bytes. + */ +#define IO_CONFIG_DATA_SIZE 40960 // was 4096 // was 163840 + +typedef struct { + char plist[IO_CONFIG_DATA_SIZE]; // buffer for plist + TagPtr dictionary; // buffer for xml dictionary + bool canOverride; // flag to mark a dictionary can be overriden +} config_file_t; + +/* + * BIOS drive information. + */ +struct boot_drive_info { + struct drive_params { + unsigned short buf_size; + unsigned short info_flags; + unsigned long phys_cyls; + unsigned long phys_heads; + unsigned long phys_spt; + unsigned long long phys_sectors; + unsigned short phys_nbps; + unsigned short dpte_offset; + unsigned short dpte_segment; + unsigned short key; + unsigned char path_len; + unsigned char reserved1; + unsigned short reserved2; + unsigned char bus_type[4]; + unsigned char interface_type[8]; + unsigned char interface_path[8]; + unsigned char dev_path[8]; + unsigned char reserved3; + unsigned char checksum; + } params; + struct drive_dpte { + unsigned short io_port_base; + unsigned short control_port_base; + unsigned char head_flags; + unsigned char vendor_info; + unsigned char irq : 4; + unsigned char irq_unused : 4; + unsigned char block_count; + unsigned char dma_channel : 4; + unsigned char dma_type : 4; + unsigned char pio_type : 4; + unsigned char pio_unused : 4; + unsigned short option_flags; + unsigned short reserved; + unsigned char revision; + unsigned char checksum; + } dpte; +} __attribute__((packed)); +typedef struct boot_drive_info boot_drive_info_t; + +struct driveInfo { + boot_drive_info_t di; + int uses_ebios; + int no_emulation; + int biosdev; + int valid; +}; + +typedef struct FinderInfo { + unsigned char data[16]; +} FinderInfo; + +struct BootVolume; +typedef struct BootVolume * BVRef; +typedef struct BootVolume * CICell; + +typedef long (*FSInit)(CICell ih); +typedef long (*FSLoadFile)(CICell ih, char * filePath); +typedef long (*FSReadFile)(CICell ih, char *filePath, void *base, uint64_t offset, uint64_t length); +typedef long (*FSGetFileBlock)(CICell ih, char *filePath, unsigned long long *firstBlock); +typedef long (*FSGetDirEntry)(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +typedef long (*FSGetUUID)(CICell ih, char *uuidStr); +typedef void (*BVGetDescription)(CICell ih, char * str, long strMaxLen); +// Can be just pointed to free or a special free function +typedef void (*BVFree)(CICell ih); + +struct iob { + unsigned int i_flgs; /* see F_* below */ + unsigned int i_offset; /* seek byte offset in file */ + int i_filesize; /* size of file */ + char * i_buf; /* file load address */ +}; + +#define BPS 512 /* sector size of the device */ +#define F_READ 0x1 /* file opened for reading */ +#define F_WRITE 0x2 /* file opened for writing */ +#define F_ALLOC 0x4 /* buffer allocated */ +#define F_FILE 0x8 /* file instead of device */ +#define F_NBSF 0x10 /* no bad sector forwarding */ +#define F_SSI 0x40 /* set skip sector inhibit */ +#define F_MEM 0x80 /* memory instead of file or device */ + +struct dirstuff { + char * dir_path; /* directory path */ + long long dir_index; /* directory entry index */ + BVRef dir_bvr; /* volume reference */ +}; + +#define BVSTRLEN 32 + +struct BootVolume { + BVRef next; /* list linkage pointer */ + int biosdev; /* BIOS device number */ + int type; /* device type (floppy, hd, network) */ + unsigned int flags; /* attribute flags */ + BVGetDescription description; /* BVGetDescription function */ + int part_no; /* partition number (1 based) */ + unsigned int part_boff; /* partition block offset */ + unsigned int part_type; /* partition type */ + unsigned int fs_boff; /* 1st block # of next read */ + unsigned int fs_byteoff; /* Byte offset for read within block */ + FSLoadFile fs_loadfile; /* FSLoadFile function */ + FSReadFile fs_readfile; /* FSReadFile function */ + FSGetDirEntry fs_getdirentry; /* FSGetDirEntry function */ + FSGetFileBlock fs_getfileblock; /* FSGetFileBlock function */ + FSGetUUID fs_getuuid; /* FSGetUUID function */ + unsigned int bps; /* bytes per sector for this device */ + char name[BVSTRLEN]; /* (name of partition) */ + char type_name[BVSTRLEN]; /* (type of partition, eg. Apple_HFS) */ + BVFree bv_free; /* BVFree function */ + uint32_t modTime; + char label[BVSTRLEN]; /* partition volume label */ + char altlabel[BVSTRLEN]; /* partition volume label */ + bool filtered; /* newFilteredBVChain() will set to TRUE */ + bool visible; /* will shown in the device list */ + char OSVersion[8]; + bool OSisServer; /* 1 = OS X server , 0 = OS X client */ + bool OSisInstaller; /* 1 = OS X Install partition / recover partition , 0 = OS X Install */ + +}; + +enum { + kBVFlagPrimary = 0x01, + kBVFlagNativeBoot = 0x02, + kBVFlagForeignBoot = 0x04, + kBVFlagBootable = 0x08, + kBVFlagEFISystem = 0x10, + kBVFlagBooter = 0x20, + kBVFlagSystemVolume = 0x40 +}; + +enum { + kBIOSDevTypeFloppy = 0x00, + kBIOSDevTypeHardDrive = 0x80, + kBIOSDevTypeNetwork = 0xE0, + kBIOSDevUnitMask = 0x0F, + kBIOSDevTypeMask = 0xF0, + kBIOSDevMask = 0xFF +}; + +enum { + kPartitionTypeHFS = 0xAF, + kPartitionTypeHPFS = 0x07, + kPartitionTypeFAT16 = 0x06, + kPartitionTypeFAT32 = 0x0c, + kPartitionTypeEXT3 = 0x83, + kPartitionTypeBEFS = 0xEB, + kPartitionTypeFreeBSD = 0xa5, + kPartitionTypeOpenBSD = 0xa6 +}; + +//#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) +#define BIOS_DEV_UNIT(bvr) ((bvr)->biosdev - (bvr)->type) + +/* + * KernBootStruct device types. + */ +enum { + DEV_SD = 0, + DEV_HD = 1, + DEV_FD = 2, + DEV_EN = 3 +}; + +/* + * min/max Macros. + * counting and rounding Macros. + * + * Azi: defined on <sys/param.h>, + * i386/include/IOKit/IOLib.h (min/max), and others... + * +#ifndef MIN +#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) ) +#endif +#ifndef MAX +#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) ) +#endif + +#define round2(x, m) (((x) + (m / 2)) & ~(m - 1)) +#define roundup2(x, m) (((x) + m - 1) & ~(m - 1))*/ + +enum { + kNetworkDeviceType = kBIOSDevTypeNetwork, + kBlockDeviceType = kBIOSDevTypeHardDrive +}; //gBootFileType_t; + +enum { + kCursorTypeHidden = 0x0100, + kCursorTypeUnderline = 0x0607 +}; + +#endif /* !__LIBSAIO_SAIO_TYPES_H */ diff --git a/i386/libsaio/.svn/text-base/sl.h.svn-base b/i386/libsaio/.svn/text-base/sl.h.svn-base new file mode 100644 index 0000000..1ccf60c --- /dev/null +++ b/i386/libsaio/.svn/text-base/sl.h.svn-base @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_SL_H +#define __LIBSAIO_SL_H + +#include <sys/types.h> +#include <sys/param.h> +#include <mach/i386/thread_status.h> +#include "libsaio.h" + +#define SWAP_BE16(x) OSSwapBigToHostInt16(x) +#define SWAP_LE16(x) OSSwapLittleToHostInt16(x) +#define SWAP_BE32(x) OSSwapBigToHostInt32(x) +#define SWAP_LE32(x) OSSwapLittleToHostInt32(x) +#define SWAP_BE64(x) OSSwapBigToHostInt64(x) +#define SWAP_LE64(x) OSSwapLittleToHostInt64(x) + +// File Permissions and Types +enum { + kPermOtherExecute = 1 << 0, + kPermOtherWrite = 1 << 1, + kPermOtherRead = 1 << 2, + kPermGroupExecute = 1 << 3, + kPermGroupWrite = 1 << 4, + kPermGroupRead = 1 << 5, + kPermOwnerExecute = 1 << 6, + kPermOwnerWrite = 1 << 7, + kPermOwnerRead = 1 << 8, + kPermMask = 0x1FF, + kOwnerNotRoot = 1 << 9, + kFileTypeUnknown = 0x0 << 16, + kFileTypeFlat = 0x1 << 16, + kFileTypeDirectory = 0x2 << 16, + kFileTypeLink = 0x3 << 16, + kFileTypeMask = 0x3 << 16 +}; + +#define Seek(c, p) diskSeek(c, p); +#define Read(c, a, l) diskRead(c, a, l); + +extern void * gFSLoadAddress; +extern cpu_type_t archCpuType; +cpu_type_t detectCpuType (); + +#endif /* !__LIBSAIO_SL_H */ diff --git a/i386/libsaio/.svn/text-base/smbios.c.svn-base b/i386/libsaio/.svn/text-base/smbios.c.svn-base new file mode 100644 index 0000000..cd74c0b --- /dev/null +++ b/i386/libsaio/.svn/text-base/smbios.c.svn-base @@ -0,0 +1,837 @@ +/* + * SMBIOS Table Patcher, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + + +#include "boot.h" +#include "bootstruct.h" +#include "smbios_getters.h" + +#ifndef DEBUG_SMBIOS +#define DEBUG_SMBIOS 0 +#endif + +#if DEBUG_SMBIOS +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +#define SMBPlist &bootInfo->smbiosConfig +/* ASSUMPTION: 16KB should be enough for the whole thing */ +#define SMB_ALLOC_SIZE 16384 + + +//------------------------------------------------------------------------------------------------------------------------- +// SMBIOS Plist Keys +//------------------------------------------------------------------------------------------------------------------------- +/* BIOS Information */ +#define kSMBBIOSInformationVendorKey "SMbiosvendor" +#define kSMBBIOSInformationVersionKey "SMbiosversion" +#define kSMBBIOSInformationReleaseDateKey "SMbiosdate" + +/* System Information */ +#define kSMBSystemInformationManufacturerKey "SMmanufacturer" +#define kSMBSystemInformationProductNameKey "SMproductname" +#define kSMBSystemInformationVersionKey "SMsystemversion" +#define kSMBSystemInformationSerialNumberKey "SMserial" +#define kSMBSystemInformationFamilyKey "SMfamily" + +/* Base Board */ +#define kSMBBaseBoardManufacturerKey "SMboardmanufacturer" +#define kSMBBaseBoardProductKey "SMboardproduct" + +/* Processor Information */ +#define kSMBProcessorInformationExternalClockKey "SMexternalclock" +#define kSMBProcessorInformationMaximumClockKey "SMmaximalclock" + +/* Memory Device */ +#define kSMBMemoryDeviceDeviceLocatorKey "SMmemdevloc" +#define kSMBMemoryDeviceBankLocatorKey "SMmembankloc" +#define kSMBMemoryDeviceMemoryTypeKey "SMmemtype" +#define kSMBMemoryDeviceMemorySpeedKey "SMmemspeed" +#define kSMBMemoryDeviceManufacturerKey "SMmemmanufacturer" +#define kSMBMemoryDeviceSerialNumberKey "SMmemserial" +#define kSMBMemoryDevicePartNumberKey "SMmempart" + +/* Apple Specific */ +#define kSMBOemProcessorTypeKey "SMcputype" +#define kSMBOemProcessorBusSpeedKey "SMbusspeed" + +//------------------------------------------------------------------------------------------------------------------------- +// Default SMBIOS Data +//------------------------------------------------------------------------------------------------------------------------- +/* Rewrite: use a struct */ + +#define kDefaultVendorManufacturer "Apple Inc." +#define kDefaultBIOSReleaseDate "11/06/2009" +#define kDefaultSerialNumber "SOMESRLNMBR" +#define kDefaultBoardProduct "Mac-F4208DC8" +#define kDefaultSystemVersion "1.0" + +// defaults for a Mac mini +#define kDefaultMacminiFamily "Macmini" +#define kDefaultMacmini "Macmini1,1" +#define kDefaultMacminiBIOSVersion " MM21.88Z.009A.B00.0903051113" + +// defaults for a MacBook +#define kDefaultMacBookFamily "MacBook" +#define kDefaultMacBook "MacBook4,1" +#define kDefaultMacBookBIOSVersion " MB41.88Z.0073.B00.0903051113" + +// defaults for a MacBook Pro +#define kDefaultMacBookProFamily "MacBookPro" +#define kDefaultMacBookPro "MacBookPro4,1" +#define kDefaultMacBookProBIOSVersion " MBP41.88Z.0073.B00.0903051113" + +// defaults for an iMac +#define kDefaultiMacFamily "iMac" +#define kDefaultiMac "iMac8,1" +#define kDefaultiMacBIOSVersion " IM81.88Z.00C1.B00.0903051113" +// defaults for an iMac11,1 core i3/i5/i7 +#define kDefaultiMacNehalem "iMac11,1" +#define kDefaultiMacNehalemBIOSVersion " IM111.88Z.0034.B00.0903051113" +// defaults for an iMac12,1 +#define kDefaultiMacSandy "iMac12,1" +#define kDefaultiMacSandyBIOSVersion " IM121.88Z.0047.B00.1102091756" + +// defaults for a Mac Pro +#define kDefaultMacProFamily "MacPro" +#define kDefaultMacPro "MacPro3,1" +#define kDefaultMacProBIOSVersion " MP31.88Z.006C.B05.0903051113" +// defaults for a Mac Pro 4,1 core i7/Xeon +#define kDefaultMacProNehalem "MacPro4,1" +#define kDefaultMacProNehalemBIOSVersion " MP41.88Z.0081.B04.0903051113" +// defaults for a Mac Pro 5,1 core i7/Xeon +#define kDefaultMacProWestmere "MacPro5,1" +#define kDefaultMacProWestmereBIOSVersion " MP51.88Z.007F.B00.1008031144" +#define kDefaulMacProWestmereBIOSReleaseDate "08/03/10" +//------------------------------------------------------------------------------------------------------------------------- + + +#define getFieldOffset(struct, field) ((uint8_t)(uint32_t)&(((struct *)0)->field)) + +typedef struct { + SMBStructHeader *orig; + SMBStructHeader *new; +} SMBStructPtrs; + +struct { + char *vendor; + char *version; + char *releaseDate; +} defaultBIOSInfo; + +struct { + char *manufacturer; + char *productName; + char *version; + char *serialNumber; + char *family; +} defaultSystemInfo; + +struct { + char *manufacturer; + char *product; +} defaultBaseBoard; + + +typedef struct { + uint8_t type; + SMBValueType valueType; + uint8_t fieldOffset; + char *keyString; + bool (*getSMBValue)(returnType *); + char **defaultValue; +} SMBValueSetter; + +SMBValueSetter SMBSetters[] = +{ + //------------------------------------------------------------------------------------------------------------------------- + // BIOSInformation + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, vendor), kSMBBIOSInformationVendorKey, + NULL, &defaultBIOSInfo.vendor }, + + {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, version), kSMBBIOSInformationVersionKey, + NULL, &defaultBIOSInfo.version }, + + {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, releaseDate), kSMBBIOSInformationReleaseDateKey, + NULL, &defaultBIOSInfo.releaseDate }, + + //------------------------------------------------------------------------------------------------------------------------- + // SystemInformation + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, manufacturer), kSMBSystemInformationManufacturerKey, + NULL, &defaultSystemInfo.manufacturer }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, productName), kSMBSystemInformationProductNameKey, + NULL, &defaultSystemInfo.productName }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, version), kSMBSystemInformationVersionKey, + NULL, &defaultSystemInfo.version }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, serialNumber), kSMBSystemInformationSerialNumberKey, + NULL, &defaultSystemInfo.serialNumber }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, skuNumber), NULL, + NULL, NULL }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, family), kSMBSystemInformationFamilyKey, + NULL, &defaultSystemInfo.family }, + + + //------------------------------------------------------------------------------------------------------------------------- + // BaseBoard + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, manufacturer), kSMBBaseBoardManufacturerKey, + NULL, &defaultBaseBoard.manufacturer }, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, product), kSMBBaseBoardProductKey, + NULL, &defaultBaseBoard.product }, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, version), NULL, NULL, NULL}, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, serialNumber), NULL, NULL, NULL}, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, assetTagNumber), NULL, NULL, NULL}, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, locationInChassis), NULL, NULL, NULL}, + + + //------------------------------------------------------------------------------------------------------------------------- + // ProcessorInformation + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, socketDesignation), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, manufacturer), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, processorVersion), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, externalClock), kSMBProcessorInformationExternalClockKey, + getProcessorInformationExternalClock, NULL}, + + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, maximumClock), kSMBProcessorInformationMaximumClockKey, + getProcessorInformationMaximumClock, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, serialNumber), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, assetTag), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, partNumber), NULL, NULL, NULL}, + + //------------------------------------------------------------------------------------------------------------------------- + // Memory Device + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, deviceLocator), kSMBMemoryDeviceDeviceLocatorKey, + NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, bankLocator), kSMBMemoryDeviceBankLocatorKey, + NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBByte, getFieldOffset(SMBMemoryDevice, memoryType), kSMBMemoryDeviceMemoryTypeKey, + getSMBMemoryDeviceMemoryType, NULL}, + + {kSMBTypeMemoryDevice, kSMBWord, getFieldOffset(SMBMemoryDevice, memorySpeed), kSMBMemoryDeviceMemorySpeedKey, + getSMBMemoryDeviceMemorySpeed, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, manufacturer), kSMBMemoryDeviceManufacturerKey, + getSMBMemoryDeviceManufacturer, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, serialNumber), kSMBMemoryDeviceSerialNumberKey, + getSMBMemoryDeviceSerialNumber, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, assetTag), NULL, NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, partNumber), kSMBMemoryDevicePartNumberKey, + getSMBMemoryDevicePartNumber, NULL}, + + + //------------------------------------------------------------------------------------------------------------------------- + // Apple Specific + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeOemProcessorType, kSMBWord, getFieldOffset(SMBOemProcessorType, ProcessorType), kSMBOemProcessorTypeKey, + getSMBOemProcessorType, NULL}, + + {kSMBTypeOemProcessorBusSpeed, kSMBWord, getFieldOffset(SMBOemProcessorBusSpeed, ProcessorBusSpeed), kSMBOemProcessorBusSpeedKey, + getSMBOemProcessorBusSpeed, NULL} +}; + +int numOfSetters = sizeof(SMBSetters) / sizeof(SMBValueSetter); + + +SMBEntryPoint *origeps = 0; +SMBEntryPoint *neweps = 0; + +static uint8_t stringIndex; // increament when a string is added and set the field value accordingly +static uint8_t stringsSize; // add string size + +static SMBWord tableLength = 0; +static SMBWord handle = 0; +static SMBWord maxStructSize = 0; +static SMBWord structureCount = 0; + +/* Rewrite this function */ +void setDefaultSMBData(void) +{ + defaultBIOSInfo.vendor = kDefaultVendorManufacturer; + defaultBIOSInfo.releaseDate = kDefaultBIOSReleaseDate; + + defaultSystemInfo.manufacturer = kDefaultVendorManufacturer; + defaultSystemInfo.version = kDefaultSystemVersion; + defaultSystemInfo.serialNumber = kDefaultSerialNumber; + + defaultBaseBoard.manufacturer = kDefaultVendorManufacturer; + defaultBaseBoard.product = kDefaultBoardProduct; + + if (platformCPUFeature(CPU_FEATURE_MOBILE)) + { + if (Platform.CPU.NoCores > 1) + { + defaultBIOSInfo.version = kDefaultMacBookProBIOSVersion; + defaultSystemInfo.productName = kDefaultMacBookPro; + defaultSystemInfo.family = kDefaultMacBookProFamily; + } + else + { + defaultBIOSInfo.version = kDefaultMacBookBIOSVersion; + defaultSystemInfo.productName = kDefaultMacBook; + defaultSystemInfo.family = kDefaultMacBookFamily; + } + } + else + { + switch (Platform.CPU.NoCores) + { + case 1: + defaultBIOSInfo.version = kDefaultMacminiBIOSVersion; + defaultSystemInfo.productName = kDefaultMacmini; + defaultSystemInfo.family = kDefaultMacminiFamily; + break; + + case 2: + defaultBIOSInfo.version = kDefaultiMacBIOSVersion; + defaultSystemInfo.productName = kDefaultiMac; + defaultSystemInfo.family = kDefaultiMacFamily; + break; + default: + { + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + defaultBIOSInfo.version = kDefaultiMacNehalemBIOSVersion; + defaultSystemInfo.productName = kDefaultiMacNehalem; + defaultSystemInfo.family = kDefaultiMacFamily; + break; + + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + defaultBIOSInfo.version = kDefaultiMacSandyBIOSVersion; + defaultSystemInfo.productName = kDefaultiMacSandy; + defaultSystemInfo.family = kDefaultiMacFamily; + break; + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + defaultBIOSInfo.version = kDefaultMacProNehalemBIOSVersion; + defaultSystemInfo.productName = kDefaultMacProNehalem; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + defaultBIOSInfo.version = kDefaultMacProWestmereBIOSVersion; + defaultBIOSInfo.releaseDate = kDefaulMacProWestmereBIOSReleaseDate; + defaultSystemInfo.productName = kDefaultMacProWestmere; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + + default: + defaultBIOSInfo.version = kDefaultMacProBIOSVersion; + defaultSystemInfo.productName = kDefaultMacPro; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + } + break; + } + default: + defaultBIOSInfo.version = kDefaultMacProBIOSVersion; + defaultSystemInfo.productName = kDefaultMacPro; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + } + break; + } + } + } +} + +/* Used for SM*n smbios.plist keys */ +bool getSMBValueForKey(SMBStructHeader *structHeader, const char *keyString, const char **string, returnType *value) +{ + static int idx = -1; + static int current = -1; + int len; + char key[24]; + + if (current != structHeader->handle) + { + idx++; + current = structHeader->handle; + } + + sprintf(key, "%s%d", keyString, idx); + + if (value) + { + if (getIntForKey(key, (int *)&(value->dword), SMBPlist)) + return true; + } + else + { + if (getValueForKey(key, string, &len, SMBPlist)) + return true; + } + + return false; +} + +char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field) +{ + uint8_t *stringPtr = (uint8_t *)structHeader + structHeader->length; + + if (!field) + return NULL; + + for (field--; field != 0 && strlen((char *)stringPtr) > 0; + field--, stringPtr = (uint8_t *)((uint32_t)stringPtr + strlen((char *)stringPtr) + 1)); + + return (char *)stringPtr; +} + +void setSMBStringForField(SMBStructHeader *structHeader, const char *string, uint8_t *field) +{ + int strSize; + + if (!field) + return; + if (!string) + { + *field = 0; + return; + } + + strSize = strlen(string); + + // remove any spaces found at the end + while ((strSize != 0) && (string[strSize - 1] == ' ')) + strSize--; + + if (strSize == 0) + { + *field = 0; + return; + } + + memcpy((uint8_t *)structHeader + structHeader->length + stringsSize, string, strSize); + *field = stringIndex; + + stringIndex++; + stringsSize += strSize + 1; +} + +bool setSMBValue(SMBStructPtrs *structPtr, int idx, returnType *value) +{ + const char *string = 0; + int len; + bool parsed; + int val; + + if (numOfSetters <= idx) + return false; + + switch (SMBSetters[idx].valueType) + { + case kSMBString: + if (SMBSetters[idx].keyString) + { + if (getValueForKey(SMBSetters[idx].keyString, &string, &len, SMBPlist)) + break; + else + if (structPtr->orig->type == kSMBTypeMemoryDevice) // MemoryDevice only + if (getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, &string, NULL)) + break; + } + if (SMBSetters[idx].getSMBValue) + if (SMBSetters[idx].getSMBValue((returnType *)&string)) + break; + if ((SMBSetters[idx].defaultValue) && *(SMBSetters[idx].defaultValue)) + { + string = *(SMBSetters[idx].defaultValue); + break; + } + string = getSMBStringForField(structPtr->orig, *(uint8_t *)value); + break; + + case kSMBByte: + case kSMBWord: + case kSMBDWord: + //case kSMBQWord: + if (SMBSetters[idx].keyString) + { + parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist); + if (!parsed) + if (structPtr->orig->type == kSMBTypeMemoryDevice) // MemoryDevice only + parsed = getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, NULL, (returnType *)&val); + if (parsed) + { + switch (SMBSetters[idx].valueType) + { + case kSMBByte: + value->byte = (uint8_t)val; + break; + case kSMBWord: + value->word = (uint16_t)val; + break; + case kSMBDWord: + default: + value->dword = (uint32_t)val; + break; + } + return true; + } + } + + if (SMBSetters[idx].getSMBValue) + if (SMBSetters[idx].getSMBValue(value)) + return true; +#if 0 + if (*(SMBSetters[idx].defaultValue)) + { + value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue); + return true; + } +#endif + break; + } + + if (SMBSetters[idx].valueType == kSMBString && string) + setSMBStringForField(structPtr->new, string, &value->byte); + + return true; +} + +//------------------------------------------------------------------------------------------------------------------------- +// Apple Specific +//------------------------------------------------------------------------------------------------------------------------- +void addSMBFirmwareVolume(SMBStructPtrs *structPtr) +{ + return; +} + +void addSMBMemorySPD(SMBStructPtrs *structPtr) +{ + /* SPD data from Platform.RAM.spd */ + return; +} + +void addSMBOemProcessorType(SMBStructPtrs *structPtr) +{ + SMBOemProcessorType *p = (SMBOemProcessorType *)structPtr->new; + + p->header.type = kSMBTypeOemProcessorType; + p->header.length = sizeof(SMBOemProcessorType); + p->header.handle = handle++; + + setSMBValue(structPtr, numOfSetters - 2 , (returnType *)&(p->ProcessorType)); + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBOemProcessorType) + 2); + tableLength += sizeof(SMBOemProcessorType) + 2; + structureCount++; +} + +void addSMBOemProcessorBusSpeed(SMBStructPtrs *structPtr) +{ + SMBOemProcessorBusSpeed *p = (SMBOemProcessorBusSpeed *)structPtr->new; + + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1155 (22nm) + break; + + default: + return; + } + } + } + + p->header.type = kSMBTypeOemProcessorBusSpeed; + p->header.length = sizeof(SMBOemProcessorBusSpeed); + p->header.handle = handle++; + + setSMBValue(structPtr, numOfSetters -1, (returnType *)&(p->ProcessorBusSpeed)); + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBOemProcessorBusSpeed) + 2); + tableLength += sizeof(SMBOemProcessorBusSpeed) + 2; + structureCount++; +} + +//------------------------------------------------------------------------------------------------------------------------- +// EndOfTable +//------------------------------------------------------------------------------------------------------------------------- +void addSMBEndOfTable(SMBStructPtrs *structPtr) +{ + structPtr->new->type = kSMBTypeEndOfTable; + structPtr->new->length = sizeof(SMBStructHeader); + structPtr->new->handle = handle++; + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBStructHeader) + 2); + tableLength += sizeof(SMBStructHeader) + 2; + structureCount++; +} + +void setSMBStruct(SMBStructPtrs *structPtr) +{ + bool setterFound = false; + + uint8_t *ptr; + SMBWord structSize; + int i; + + stringIndex = 1; + stringsSize = 0; + + if (handle < structPtr->orig->handle) + handle = structPtr->orig->handle; + + memcpy((void *)structPtr->new, structPtr->orig, structPtr->orig->length); + + for (i = 0; i < numOfSetters; i++) + if ((structPtr->orig->type == SMBSetters[i].type) && (SMBSetters[i].fieldOffset < structPtr->orig->length)) + { + setterFound = true; + setSMBValue(structPtr, i, (returnType *)((uint8_t *)structPtr->new + SMBSetters[i].fieldOffset)); + } + + if (setterFound) + { + ptr = (uint8_t *)structPtr->new + structPtr->orig->length; + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structSize = ptr - (uint8_t *)structPtr->new; + } + else + { + ptr = (uint8_t *)structPtr->orig + structPtr->orig->length; + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structSize = ptr - (uint8_t *)structPtr->orig; + memcpy((void *)structPtr->new, structPtr->orig, structSize); + } + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + structSize); + + tableLength += structSize; + + if (structSize > maxStructSize) + maxStructSize = structSize; + + structureCount++; +} + +void setupNewSMBIOSTable(SMBEntryPoint *eps, SMBStructPtrs *structPtr) +{ + uint8_t *ptr = (uint8_t *)eps->dmi.tableAddress; + structPtr->orig = (SMBStructHeader *)ptr; + + for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structPtr->orig + sizeof(SMBStructHeader)));) + { + switch (structPtr->orig->type) + { + /* Skip all Apple Specific Structures */ + case kSMBTypeFirmwareVolume: + case kSMBTypeMemorySPD: + case kSMBTypeOemProcessorType: + case kSMBTypeOemProcessorBusSpeed: + /* And this one too, to be added at the end */ + case kSMBTypeEndOfTable: + break; + + default: + /* Add */ + setSMBStruct(structPtr); + break; + } + + ptr = (uint8_t *)((uint32_t)structPtr->orig + structPtr->orig->length); + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structPtr->orig = (SMBStructHeader *)ptr; + } + + addSMBFirmwareVolume(structPtr); + addSMBMemorySPD(structPtr); + addSMBOemProcessorType(structPtr); + addSMBOemProcessorBusSpeed(structPtr); + + addSMBEndOfTable(structPtr); +} + +void setupSMBIOSTable(void) +{ + SMBStructPtrs *structPtr; + uint8_t *buffer; + bool setSMB = true; + + if (!origeps) + return; + + neweps = origeps; + + structPtr = (SMBStructPtrs *)malloc(sizeof(SMBStructPtrs)); + if (!structPtr) + return; + + buffer = malloc(SMB_ALLOC_SIZE); + if (!buffer) + return; + + bzero(buffer, SMB_ALLOC_SIZE); + structPtr->new = (SMBStructHeader *)buffer; + + getBoolForKey(kSMBIOSdefaults, &setSMB, &bootInfo->chameleonConfig); + if (setSMB) + setDefaultSMBData(); + + setupNewSMBIOSTable(origeps, structPtr); + + neweps = (SMBEntryPoint *)AllocateKernelMemory(sizeof(SMBEntryPoint)); + if (!neweps) + return; + bzero(neweps, sizeof(SMBEntryPoint)); + + neweps->anchor[0] = '_'; + neweps->anchor[1] = 'S'; + neweps->anchor[2] = 'M'; + neweps->anchor[3] = '_'; + neweps->entryPointLength = sizeof(SMBEntryPoint); + neweps->majorVersion = 2; + neweps->minorVersion = 4; + neweps->maxStructureSize = maxStructSize; + neweps->entryPointRevision = 0; + + neweps->dmi.anchor[0] = '_'; + neweps->dmi.anchor[1] = 'D'; + neweps->dmi.anchor[2] = 'M'; + neweps->dmi.anchor[3] = 'I'; + neweps->dmi.anchor[4] = '_'; + neweps->dmi.tableLength = tableLength; + neweps->dmi.tableAddress = AllocateKernelMemory(tableLength); + neweps->dmi.structureCount = structureCount; + neweps->dmi.bcdRevision = 0x24; + + if (!neweps->dmi.tableAddress) + return; + + memcpy((void *)neweps->dmi.tableAddress, buffer, tableLength); + + neweps->dmi.checksum = 0; + neweps->dmi.checksum = 0x100 - checksum8(&neweps->dmi, sizeof(DMIEntryPoint)); + + neweps->checksum = 0; + neweps->checksum = 0x100 - checksum8(neweps, sizeof(SMBEntryPoint)); + + free(buffer); + decodeSMBIOSTable(neweps); +} + +void *getSmbios(int which) +{ + switch (which) + { + case SMBIOS_ORIGINAL: + if (!origeps) + origeps = getAddressOfSmbiosTable(); + return origeps; + case SMBIOS_PATCHED: + return neweps; + } + + return 0; +} + +/* Collect any information needed later */ +void readSMBIOSInfo(SMBEntryPoint *eps) +{ + uint8_t *structPtr = (uint8_t *)eps->dmi.tableAddress; + SMBStructHeader *structHeader = (SMBStructHeader *)structPtr; + + int dimmnbr = 0; + Platform.DMI.MaxMemorySlots = 0; + Platform.DMI.CntMemorySlots = 0; + Platform.DMI.MemoryModules = 0; + + for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structHeader + sizeof(SMBStructHeader)));) + { + switch (structHeader->type) + { + case kSMBTypeSystemInformation: + Platform.UUID = ((SMBSystemInformation *)structHeader)->uuid; + break; + + case kSMBTypePhysicalMemoryArray: + Platform.DMI.MaxMemorySlots += ((SMBPhysicalMemoryArray *)structHeader)->numMemoryDevices; + break; + + case kSMBTypeMemoryDevice: + Platform.DMI.CntMemorySlots++; + if (((SMBMemoryDevice *)structHeader)->memorySize != 0) + Platform.DMI.MemoryModules++; + if (((SMBMemoryDevice *)structHeader)->memorySpeed > 0) + Platform.RAM.DIMM[dimmnbr].Frequency = ((SMBMemoryDevice *)structHeader)->memorySpeed; + dimmnbr++; + break; + } + + structPtr = (uint8_t *)((uint32_t)structHeader + structHeader->length); + for (; ((uint16_t *)structPtr)[0] != 0; structPtr++); + + if (((uint16_t *)structPtr)[0] == 0) + structPtr += 2; + + structHeader = (SMBStructHeader *)structPtr; + } +} + diff --git a/i386/libsaio/.svn/text-base/smbios.h.svn-base b/i386/libsaio/.svn/text-base/smbios.h.svn-base new file mode 100644 index 0000000..7078149 --- /dev/null +++ b/i386/libsaio/.svn/text-base/smbios.h.svn-base @@ -0,0 +1,423 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_SMBIOS_H +#define __LIBSAIO_SMBIOS_H + +// +// Based on System Management BIOS Reference Specification v2.5 +// + +typedef uint8_t SMBString; +typedef uint8_t SMBByte; +typedef uint16_t SMBWord; +typedef uint32_t SMBDWord; +typedef uint64_t SMBQWord; + + +typedef struct DMIEntryPoint { + SMBByte anchor[5]; + SMBByte checksum; + SMBWord tableLength; + SMBDWord tableAddress; + SMBWord structureCount; + SMBByte bcdRevision; +} __attribute__((packed)) DMIEntryPoint; + +typedef struct SMBEntryPoint { + SMBByte anchor[4]; + SMBByte checksum; + SMBByte entryPointLength; + SMBByte majorVersion; + SMBByte minorVersion; + SMBWord maxStructureSize; + SMBByte entryPointRevision; + SMBByte formattedArea[5]; + DMIEntryPoint dmi; +} __attribute__((packed)) SMBEntryPoint; + +// +// Header common to all SMBIOS structures +// + +typedef struct SMBStructHeader { + SMBByte type; + SMBByte length; + SMBWord handle; +} __attribute__((packed)) SMBStructHeader; + +#define SMB_STRUCT_HEADER SMBStructHeader header; + +typedef struct SMBAnchor +{ + const SMBStructHeader * header; + const uint8_t * next; + const uint8_t * end; +} SMBAnchor; + +#define SMB_ANCHOR_IS_VALID(x) \ + ((x) && ((x)->header) && ((x)->next) && ((x)->end)) + +#define SMB_ANCHOR_RESET(x) \ + bzero(x, sizeof(typedef struct SMBAnchor)); + +// +// SMBIOS structure types. +// + +enum { + kSMBTypeBIOSInformation = 0, + kSMBTypeSystemInformation = 1, + kSMBTypeBaseBoard = 2, + kSMBTypeSystemEnclosure = 3, + kSMBTypeProcessorInformation = 4, + kSMBTypeMemoryModule = 6, + kSMBTypeCacheInformation = 7, + kSMBTypeSystemSlot = 9, + kSMBTypePhysicalMemoryArray = 16, + kSMBTypeMemoryDevice = 17, + kSMBType32BitMemoryErrorInfo = 18, + kSMBType64BitMemoryErrorInfo = 33, + + kSMBTypeEndOfTable = 127, + + /* Apple Specific Structures */ + kSMBTypeFirmwareVolume = 128, + kSMBTypeMemorySPD = 130, + kSMBTypeOemProcessorType = 131, + kSMBTypeOemProcessorBusSpeed = 132 +}; + +// +// BIOS Information (Type 0) +// +typedef struct SMBBIOSInformation { + SMB_STRUCT_HEADER // Type 0 + SMBString vendor; // BIOS vendor name + SMBString version; // BIOS version + SMBWord startSegment; // BIOS segment start + SMBString releaseDate; // BIOS release date + SMBByte romSize; // (n); 64K * (n+1) bytes + SMBQWord characteristics; // supported BIOS functions +} __attribute__((packed)) SMBBIOSInformation; + +// +// System Information (Type 1) +// + +typedef struct SMBSystemInformation { + // 2.0+ spec (8 bytes) + SMB_STRUCT_HEADER // Type 1 + SMBString manufacturer; + SMBString productName; + SMBString version; + SMBString serialNumber; + // 2.1+ spec (25 bytes) + SMBByte uuid[16]; // can be all 0 or all 1's + SMBByte wakeupReason; // reason for system wakeup + // 2.4+ spec (27 bytes) + SMBString skuNumber; + SMBString family; +} __attribute__((packed)) SMBSystemInformation; + +// +// Base Board (Type 2) +// + +typedef struct SMBBaseBoard { + SMB_STRUCT_HEADER // Type 2 + SMBString manufacturer; + SMBString product; + SMBString version; + SMBString serialNumber; + SMBString assetTagNumber; + SMBByte featureFlags; + SMBString locationInChassis; + SMBWord chassisHandle; + SMBByte boardType; + SMBByte numberOfContainedHandles; + // 0 - 255 contained handles go here but we do not include + // them in our structure. Be careful to use numberOfContainedHandles + // times sizeof(SMBWord) when computing the actual record size, + // if you need it. +} __attribute__((packed)) SMBBaseBoard; + +// Values for boardType in Type 2 records +enum { + kSMBBaseBoardUnknown = 0x01, + kSMBBaseBoardOther = 0x02, + kSMBBaseBoardServerBlade = 0x03, + kSMBBaseBoardConnectivitySwitch = 0x04, + kSMBBaseBoardSystemMgmtModule = 0x05, + kSMBBaseBoardProcessorModule = 0x06, + kSMBBaseBoardIOModule = 0x07, + kSMBBaseBoardMemoryModule = 0x08, + kSMBBaseBoardDaughter = 0x09, + kSMBBaseBoardMotherboard = 0x0A, + kSMBBaseBoardProcessorMemoryModule = 0x0B, + kSMBBaseBoardProcessorIOModule = 0x0C, + kSMBBaseBoardInterconnect = 0x0D, +}; + + +// +// System Enclosure (Type 3) +// + +typedef struct SMBSystemEnclosure { + SMB_STRUCT_HEADER // Type 3 + SMBString manufacturer; + SMBByte type; + SMBString version; + SMBString serialNumber; + SMBString assetTagNumber; + SMBByte bootupState; + SMBByte powerSupplyState; + SMBByte thermalState; + SMBByte securityStatus; + SMBDWord oemDefined; +} __attribute__((packed)) SMBSystemEnclosure; + +// +// Processor Information (Type 4) +// + +typedef struct SMBProcessorInformation { + // 2.0+ spec (26 bytes) + SMB_STRUCT_HEADER // Type 4 + SMBString socketDesignation; + SMBByte processorType; // CPU = 3 + SMBByte processorFamily; // processor family enum + SMBString manufacturer; + SMBQWord processorID; // based on CPUID + SMBString processorVersion; + SMBByte voltage; // bit7 cleared indicate legacy mode + SMBWord externalClock; // external clock in MHz + SMBWord maximumClock; // max internal clock in MHz + SMBWord currentClock; // current internal clock in MHz + SMBByte status; + SMBByte processorUpgrade; // processor upgrade enum + // 2.1+ spec (32 bytes) + SMBWord L1CacheHandle; + SMBWord L2CacheHandle; + SMBWord L3CacheHandle; + // 2.3+ spec (35 bytes) + SMBString serialNumber; + SMBString assetTag; + SMBString partNumber; +} __attribute__((packed)) SMBProcessorInformation; + +#define kSMBProcessorInformationMinSize 26 + +// +// Memory Module Information (Type 6) +// Obsoleted since SMBIOS version 2.1 +// + +typedef struct SMBMemoryModule { + SMB_STRUCT_HEADER // Type 6 + SMBString socketDesignation; + SMBByte bankConnections; + SMBByte currentSpeed; + SMBWord currentMemoryType; + SMBByte installedSize; + SMBByte enabledSize; + SMBByte errorStatus; +} __attribute__((packed)) SMBMemoryModule; + +#define kSMBMemoryModuleSizeNotDeterminable 0x7D +#define kSMBMemoryModuleSizeNotEnabled 0x7E +#define kSMBMemoryModuleSizeNotInstalled 0x7F + +// +// Cache Information (Type 7) +// + +typedef struct SMBCacheInformation { + SMB_STRUCT_HEADER // Type 7 + SMBString socketDesignation; + SMBWord cacheConfiguration; + SMBWord maximumCacheSize; + SMBWord installedSize; + SMBWord supportedSRAMType; + SMBWord currentSRAMType; + SMBByte cacheSpeed; + SMBByte errorCorrectionType; + SMBByte systemCacheType; + SMBByte associativity; +} __attribute__((packed)) SMBCacheInformation; + +typedef struct SMBSystemSlot { + // 2.0+ spec (12 bytes) + SMB_STRUCT_HEADER // Type 9 + SMBString slotDesignation; + SMBByte slotType; + SMBByte slotDataBusWidth; + SMBByte currentUsage; + SMBByte slotLength; + SMBWord slotID; + SMBByte slotCharacteristics1; + // 2.1+ spec (13 bytes) + SMBByte slotCharacteristics2; +} __attribute__((packed)) SMBSystemSlot; + +// +// Physical Memory Array (Type 16) +// + +typedef struct SMBPhysicalMemoryArray { + // 2.1+ spec (15 bytes) + SMB_STRUCT_HEADER // Type 16 + SMBByte physicalLocation; // physical location + SMBByte arrayUse; // the use for the memory array + SMBByte errorCorrection; // error correction/detection method + SMBDWord maximumCapacity; // maximum memory capacity in kilobytes + SMBWord errorHandle; // handle of a previously detected error + SMBWord numMemoryDevices; // number of memory slots or sockets +} __attribute__((packed)) SMBPhysicalMemoryArray; + +// Memory Array - Use +enum { + kSMBMemoryArrayUseOther = 0x01, + kSMBMemoryArrayUseUnknown = 0x02, + kSMBMemoryArrayUseSystemMemory = 0x03, + kSMBMemoryArrayUseVideoMemory = 0x04, + kSMBMemoryArrayUseFlashMemory = 0x05, + kSMBMemoryArrayUseNonVolatileMemory = 0x06, + kSMBMemoryArrayUseCacheMemory = 0x07 +}; + +// Memory Array - Error Correction Types +enum { + kSMBMemoryArrayErrorCorrectionTypeOther = 0x01, + kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02, + kSMBMemoryArrayErrorCorrectionTypeNone = 0x03, + kSMBMemoryArrayErrorCorrectionTypeParity = 0x04, + kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05, + kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06, + kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07 +}; + +// +// Memory Device (Type 17) +// + +typedef struct SMBMemoryDevice { + // 2.1+ spec (21 bytes) + SMB_STRUCT_HEADER // Type 17 + SMBWord arrayHandle; // handle of the parent memory array + SMBWord errorHandle; // handle of a previously detected error + SMBWord totalWidth; // total width in bits; including ECC bits + SMBWord dataWidth; // data width in bits + SMBWord memorySize; // bit15 is scale, 0 = MB, 1 = KB + SMBByte formFactor; // memory device form factor + SMBByte deviceSet; // parent set of identical memory devices + SMBString deviceLocator; // labeled socket; e.g. "SIMM 3" + SMBString bankLocator; // labeled bank; e.g. "Bank 0" or "A" + SMBByte memoryType; // type of memory + SMBWord memoryTypeDetail; // additional detail on memory type + // 2.3+ spec (27 bytes) + SMBWord memorySpeed; // speed of device in MHz (0 for unknown) + SMBString manufacturer; + SMBString serialNumber; + SMBString assetTag; + SMBString partNumber; +} __attribute__((packed)) SMBMemoryDevice; + +// +// Firmware Volume Description (Apple Specific - Type 128) +// + +enum { + FW_REGION_RESERVED = 0, + FW_REGION_RECOVERY = 1, + FW_REGION_MAIN = 2, + FW_REGION_NVRAM = 3, + FW_REGION_CONFIG = 4, + FW_REGION_DIAGVAULT = 5, + + NUM_FLASHMAP_ENTRIES = 8 +}; + +typedef struct FW_REGION_INFO +{ + SMBDWord StartAddress; + SMBDWord EndAddress; +} __attribute__((packed)) FW_REGION_INFO; + +typedef struct SMBFirmwareVolume { + SMB_STRUCT_HEADER // Type 128 + SMBByte RegionCount; + SMBByte Reserved[3]; + SMBDWord FirmwareFeatures; + SMBDWord FirmwareFeaturesMask; + SMBByte RegionType[ NUM_FLASHMAP_ENTRIES ]; + FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ]; +} __attribute__((packed)) SMBFirmwareVolume; + +// +// Memory SPD Data (Apple Specific - Type 130) +// + +typedef struct SMBMemorySPD { + SMB_STRUCT_HEADER // Type 130 + SMBWord Type17Handle; + SMBWord Offset; + SMBWord Size; + SMBWord Data[]; +} __attribute__((packed)) SMBMemorySPD; + + +// +// OEM Processor Type (Apple Specific - Type 131) +// + +typedef struct SMBOemProcessorType { + SMB_STRUCT_HEADER + SMBWord ProcessorType; +} __attribute__((packed)) SMBOemProcessorType; + +// +// OEM Processor Bus Speed (Apple Specific - Type 132) +// +typedef struct SMBOemProcessorBusSpeed { + SMB_STRUCT_HEADER + SMBWord ProcessorBusSpeed; // MT/s unit +} __attribute__((packed)) SMBOemProcessorBusSpeed; + +//---------------------------------------------------------------------------------------------------------- + +/* From Foundation/Efi/Guid/Smbios/SmBios.h */ +/* Modified to wrap Data4 array init with {} */ +#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}} + +#define SMBIOS_ORIGINAL 0 +#define SMBIOS_PATCHED 1 + +extern void *getSmbios(int which); +extern void readSMBIOSInfo(SMBEntryPoint *eps); +extern void setupSMBIOSTable(void); + +extern void decodeSMBIOSTable(SMBEntryPoint *eps); + + +#endif /* !__LIBSAIO_SMBIOS_H */ diff --git a/i386/libsaio/.svn/text-base/smbios_decode.c.svn-base b/i386/libsaio/.svn/text-base/smbios_decode.c.svn-base new file mode 100644 index 0000000..5fdf700 --- /dev/null +++ b/i386/libsaio/.svn/text-base/smbios_decode.c.svn-base @@ -0,0 +1,265 @@ +/* + * A very simple SMBIOS Table decoder, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include "libsaio.h" +#include "smbios.h" + +#ifndef DEBUG_SMBIOS +#define DEBUG_SMBIOS 0 +#endif + +#if DEBUG_SMBIOS +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +static SMBWord minorVersion; + +extern char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field); + +static const char * +SMBMemoryDeviceTypes[] = +{ + "RAM", /* 00h Undefined */ + "RAM", /* 01h Other */ + "RAM", /* 02h Unknown */ + "DRAM", /* 03h DRAM */ + "EDRAM", /* 04h EDRAM */ + "VRAM", /* 05h VRAM */ + "SRAM", /* 06h SRAM */ + "RAM", /* 07h RAM */ + "ROM", /* 08h ROM */ + "FLASH", /* 09h FLASH */ + "EEPROM", /* 0Ah EEPROM */ + "FEPROM", /* 0Bh FEPROM */ + "EPROM", /* 0Ch EPROM */ + "CDRAM", /* 0Dh CDRAM */ + "3DRAM", /* 0Eh 3DRAM */ + "SDRAM", /* 0Fh SDRAM */ + "SGRAM", /* 10h SGRAM */ + "RDRAM", /* 11h RDRAM */ + "DDR SDRAM", /* 12h DDR */ + "DDR2 SDRAM", /* 13h DDR2 */ + "DDR2 FB-DIMM", /* 14h DDR2 FB-DIMM */ + "RAM", /* 15h unused */ + "RAM", /* 16h unused */ + "RAM", /* 17h unused */ + "DDR3", /* 18h DDR3, chosen in [5776134] */ +}; + +static const int +kSMBMemoryDeviceTypeCount = sizeof(SMBMemoryDeviceTypes) / +sizeof(SMBMemoryDeviceTypes[0]); + +//------------------------------------------------------------------------------------------------------------------------- +// BIOSInformation +//------------------------------------------------------------------------------------------------------------------------- +void decodeBIOSInformation(SMBBIOSInformation *structHeader) +{ + DBG("BIOSInformation:\n"); + DBG("\tvendor: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->vendor)); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\treleaseDate: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->releaseDate)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// SystemInformation +//------------------------------------------------------------------------------------------------------------------------- +void decodeSystemInformation(SMBSystemInformation *structHeader) +{ + DBG("SystemInformation:\n"); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tproductName: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->productName)); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + + if (minorVersion < 1 || structHeader->header.length < 25) + return; + uint8_t *uuid = structHeader->uuid; + DBG("\tuuid: %02X%02X%02X%02X-%02X%02X-%02X%02X-%02x%02X-%02X%02X%02X%02X%02X%02X\n", + uuid[0], uuid[1], uuid[2], uuid[3], + uuid[4], uuid[5], + uuid[6], uuid[7], + uuid[8], uuid[9], + uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); + DBG("\twakeupReason: 0x%x\n", structHeader->wakeupReason); + + if (minorVersion < 4 || structHeader->header.length < 27) + return; + DBG("\tskuNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->skuNumber)); + DBG("\tfamily: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->family)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// BaseBoard +//------------------------------------------------------------------------------------------------------------------------- +void decodeBaseBoard(SMBBaseBoard *structHeader) +{ + DBG("BaseBoard:\n"); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tproduct: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->product)); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTagNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTagNumber)); + DBG("\tlocationInChassis: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->locationInChassis)); + DBG("\tboardType: 0x%X\n", structHeader->boardType); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// SystemEnclosure +//------------------------------------------------------------------------------------------------------------------------- +void decodeSystemEnclosure(SMBSystemEnclosure *structHeader) +{ + DBG("SystemEnclosure:\n"); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\ttype: %d\n", structHeader->type); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTagNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTagNumber)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// ProcessorInformation +//------------------------------------------------------------------------------------------------------------------------- +void decodeProcessorInformation(SMBProcessorInformation *structHeader) +{ + DBG("ProcessorInformation:\n"); + DBG("\tsocketDesignation: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->socketDesignation)); + DBG("\tprocessorType: %d\n", structHeader->processorType); + DBG("\tprocessorFamily: 0x%X\n", structHeader->processorFamily); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tprocessorID: 0x%llX\n", structHeader->processorID); + DBG("\tprocessorVersion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->processorVersion)); + DBG("\texternalClock: %dMHz\n", structHeader->externalClock); + DBG("\tmaximumClock: %dMHz\n", structHeader->maximumClock); + DBG("\tcurrentClock: %dMHz\n", structHeader->currentClock); + + if (minorVersion < 3 || structHeader->header.length < 35) + return; + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTag: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTag)); + DBG("\tpartNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->partNumber)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// MemoryDevice +//------------------------------------------------------------------------------------------------------------------------- +void decodeMemoryDevice(SMBMemoryDevice *structHeader) +{ + DBG("MemoryDevice:\n"); + DBG("\tdeviceLocator: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->deviceLocator)); + DBG("\tbankLocator: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->bankLocator)); + DBG("\tmemoryType: %s\n", SMBMemoryDeviceTypes[structHeader->memoryType]); + + if (minorVersion < 3 || structHeader->header.length < 27) + return; + DBG("\tmemorySpeed: %dMHz\n", structHeader->memorySpeed); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTag: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTag)); + DBG("\tpartNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->partNumber)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// Apple Specific +//------------------------------------------------------------------------------------------------------------------------- +void decodeOemProcessorType(SMBOemProcessorType *structHeader) +{ + DBG("AppleProcessorType:\n"); + DBG("\tProcessorType: 0x%x\n", ((SMBOemProcessorType *)structHeader)->ProcessorType); + DBG("\n"); +} + +void decodeOemProcessorBusSpeed(SMBOemProcessorBusSpeed *structHeader) +{ + DBG("AppleProcessorBusSpeed:\n"); + DBG("\tProcessorBusSpeed (QPI): %d.%dGT/s\n", + ((SMBOemProcessorBusSpeed *)structHeader)->ProcessorBusSpeed / 1000, + (((SMBOemProcessorBusSpeed *)structHeader)->ProcessorBusSpeed / 100) % 10); + DBG("\n"); +} +//------------------------------------------------------------------------------------------------------------------------- + + +void decodeSMBIOSTable(SMBEntryPoint *eps) +{ + uint8_t *ptr = (uint8_t *)eps->dmi.tableAddress; + SMBStructHeader *structHeader = (SMBStructHeader *)ptr; + + minorVersion = eps->minorVersion; + + DBG("\n"); + for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structHeader + sizeof(SMBStructHeader)));) + { + DBG("Type: %d, Length: %d, Handle: 0x%x\n", + structHeader->type, structHeader->length, structHeader->handle); + + switch (structHeader->type) + { + case kSMBTypeBIOSInformation: + decodeBIOSInformation((SMBBIOSInformation *)structHeader); + break; + + case kSMBTypeSystemInformation: + decodeSystemInformation((SMBSystemInformation *)structHeader); + break; + + case kSMBTypeBaseBoard: + decodeBaseBoard((SMBBaseBoard *)structHeader); + break; + + case kSMBTypeSystemEnclosure: + decodeSystemEnclosure((SMBSystemEnclosure *)structHeader); + break; + + case kSMBTypeProcessorInformation: + decodeProcessorInformation((SMBProcessorInformation *)structHeader); + break; + + case kSMBTypeMemoryDevice: + decodeMemoryDevice((SMBMemoryDevice *)structHeader); + break; + + /* Skip all Apple Specific Structures */ + case kSMBTypeFirmwareVolume: + case kSMBTypeMemorySPD: + break; + + case kSMBTypeOemProcessorType: + decodeOemProcessorType((SMBOemProcessorType *)structHeader); + break; + + case kSMBTypeOemProcessorBusSpeed: + decodeOemProcessorBusSpeed((SMBOemProcessorBusSpeed *)structHeader); + break; + + case kSMBTypeEndOfTable: + /* Skip, to be added at the end */ + break; + + default: + break; + } + + ptr = (uint8_t *)((uint32_t)structHeader + structHeader->length); + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structHeader = (SMBStructHeader *)ptr; + } + DBG("\n"); +} + diff --git a/i386/libsaio/.svn/text-base/smbios_getters.c.svn-base b/i386/libsaio/.svn/text-base/smbios_getters.c.svn-base new file mode 100644 index 0000000..17481c1 --- /dev/null +++ b/i386/libsaio/.svn/text-base/smbios_getters.c.svn-base @@ -0,0 +1,360 @@ +/* + * Add (c) here + * + * Copyright .... All rights reserved. + * + */ + +#include "smbios_getters.h" +#include "bootstruct.h" + +#ifndef DEBUG_SMBIOS +#define DEBUG_SMBIOS 0 +#endif + +#if DEBUG_SMBIOS +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + + +bool getProcessorInformationExternalClock(returnType *value) +{ + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel + { + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + // set external clock to 0 for SANDY + // removes FSB info from system profiler as on real mac's. + case CPU_MODEL_SANDYBRIDGE: + case CPU_MODEL_IVYBRIDGE: + case CPU_MODEL_HASWELL: + value->word = 0; + break; + default: + value->word = Platform.CPU.FSBFrequency/1000000; + } + } + break; + + default: + value->word = Platform.CPU.FSBFrequency/1000000; + } + } + else + { + value->word = Platform.CPU.FSBFrequency/1000000; + } + + return true; +} + +bool getProcessorInformationMaximumClock(returnType *value) +{ + value->word = Platform.CPU.CPUFrequency/1000000; + return true; +} + +bool getSMBOemProcessorBusSpeed(returnType *value) +{ + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel + { + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: // Intel Pentium M + case CPU_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPU_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPU_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPU_MODEL_ATOM: // Intel Atom (45nm) + return false; + + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + { + // thanks to dgobe for i3/i5/i7 bus speed detection + int nhm_bus = 0x3F; + static long possible_nhm_bus[] = {0xFF, 0x7F, 0x3F}; + unsigned long did, vid; + int i; + + // Nehalem supports Scrubbing + // First, locate the PCI bus where the MCH is located + for(i = 0; i < sizeof(possible_nhm_bus); i++) + { + vid = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), 0x00); + did = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), 0x02); + vid &= 0xFFFF; + did &= 0xFF00; + + if(vid == 0x8086 && did >= 0x2C00) + nhm_bus = possible_nhm_bus[i]; + } + + unsigned long qpimult, qpibusspeed; + qpimult = pci_config_read32(PCIADDR(nhm_bus, 2, 1), 0x50); + qpimult &= 0x7F; + DBG("qpimult %d\n", qpimult); + qpibusspeed = (qpimult * 2 * (Platform.CPU.FSBFrequency/1000000)); + // Rek: rounding decimals to match original mac profile info + if (qpibusspeed%100 != 0)qpibusspeed = ((qpibusspeed+50)/100)*100; + DBG("qpibusspeed %d\n", qpibusspeed); + value->word = qpibusspeed; + return true; + } + } + } + } + } + return false; +} + +uint16_t simpleGetSMBOemProcessorType(void) +{ + if (Platform.CPU.NoCores >= 4) + { + return 0x0501; // Quad-Core Xeon + } + else if (Platform.CPU.NoCores == 1) + { + return 0x0201; // Core Solo + }; + + return 0x0301; // Core 2 Duo +} + +bool getSMBOemProcessorType(returnType *value) +{ + static bool done = false; + + value->word = simpleGetSMBOemProcessorType(); + + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel + { + if (!done) + { + verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, Platform.CPU.Family, Platform.CPU.Model); + done = true; + } + + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: // Intel Pentium M + case CPU_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPU_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPU_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPU_MODEL_ATOM: // Intel Atom (45nm) + return true; + + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + if (strstr(Platform.CPU.BrandString, "Xeon(R)")) + value->word = 0x0501; // Xeon + else + value->word = 0x0701; // Core i7 + return true; + + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + if (strstr(Platform.CPU.BrandString, "Xeon(R)")) + value->word = 0x0501;// Xeon + else + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + value->word = 0x0601; // Core i5 + else + value->word = 0x0701; // Core i7 + return true; + + case CPU_MODEL_DALES: + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + value->word = 0x0601; // Core i5 + else + value->word = 0x0701; // Core i7 + return true; + + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1155 (22nm) + if (strstr(Platform.CPU.BrandString, "Xeon(R)")) + value->word = 0x0501; // Xeon + else + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + value->word = 0x0901; // Core i3 + else + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + value->word = 0x0601; // Core i5 + else + value->word = 0x0701; // Core i7 + return true; + } + } + } + } + + return false; +} + +bool getSMBMemoryDeviceMemoryType(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && Platform.RAM.DIMM[map].Type != 0) + { + DBG("RAM Detected Type = %d\n", Platform.RAM.DIMM[map].Type); + value->byte = Platform.RAM.DIMM[map].Type; + return true; + } + } + + return false; +// value->byte = SMB_MEM_TYPE_DDR2; +// return true; +} + +bool getSMBMemoryDeviceMemorySpeed(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && Platform.RAM.DIMM[map].Frequency != 0) + { + DBG("RAM Detected Freq = %d Mhz\n", Platform.RAM.DIMM[map].Frequency); + value->dword = Platform.RAM.DIMM[map].Frequency; + return true; + } + } + + return false; +// value->dword = 800; +// return true; +} + +bool getSMBMemoryDeviceManufacturer(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && strlen(Platform.RAM.DIMM[map].Vendor) > 0) + { + DBG("RAM Detected Vendor[%d]='%s'\n", idx, Platform.RAM.DIMM[map].Vendor); + value->string = Platform.RAM.DIMM[map].Vendor; + return true; + } + } + + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; +} + +bool getSMBMemoryDeviceSerialNumber(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + + DBG("getSMBMemoryDeviceSerialNumber index: %d, MAX_RAM_SLOTS: %d\n",idx,MAX_RAM_SLOTS); + + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && strlen(Platform.RAM.DIMM[map].SerialNo) > 0) + { + DBG("map=%d, RAM Detected SerialNo[%d]='%s'\n", map, idx, Platform.RAM.DIMM[map].SerialNo); + value->string = Platform.RAM.DIMM[map].SerialNo; + return true; + } + } + + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; +} + +bool getSMBMemoryDevicePartNumber(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && strlen(Platform.RAM.DIMM[map].PartNo) > 0) + { + DBG("map=%d, RAM Detected PartNo[%d]='%s'\n", map, idx, Platform.RAM.DIMM[map].PartNo); + value->string = Platform.RAM.DIMM[map].PartNo; + return true; + } + } + + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; +} + + +// getting smbios addr with fast compare ops, late checksum testing ... +#define COMPARE_DWORD(a,b) ( *((uint32_t *) a) == *((uint32_t *) b) ) +static const char * const SMTAG = "_SM_"; +static const char* const DMITAG = "_DMI_"; + +SMBEntryPoint *getAddressOfSmbiosTable(void) +{ + SMBEntryPoint *smbios; + /* + * The logic is to start at 0xf0000 and end at 0xfffff iterating 16 bytes at a time looking + * for the SMBIOS entry-point structure anchor (literal ASCII "_SM_"). + */ + smbios = (SMBEntryPoint*)SMBIOS_RANGE_START; + while (smbios <= (SMBEntryPoint *)SMBIOS_RANGE_END) { + if (COMPARE_DWORD(smbios->anchor, SMTAG) && + COMPARE_DWORD(smbios->dmi.anchor, DMITAG) && + smbios->dmi.anchor[4] == DMITAG[4] && + checksum8(smbios, sizeof(SMBEntryPoint)) == 0) + { + return smbios; + } + smbios = (SMBEntryPoint*)(((char*)smbios) + 16); + } + printf("ERROR: Unable to find SMBIOS!\n"); + pause(); + return NULL; +} + diff --git a/i386/libsaio/.svn/text-base/smbios_getters.h.svn-base b/i386/libsaio/.svn/text-base/smbios_getters.h.svn-base new file mode 100644 index 0000000..9322246 --- /dev/null +++ b/i386/libsaio/.svn/text-base/smbios_getters.h.svn-base @@ -0,0 +1,43 @@ + +#include "libsaio.h" +#include "smbios.h" +#include "platform.h" +#include "pci.h" + +#ifndef __LIBSAIO_SMBIOS_GETTERS_H +#define __LIBSAIO_SMBIOS_GETTERS_H + +#define SMBIOS_RANGE_START 0x000F0000 +#define SMBIOS_RANGE_END 0x000FFFFF + +#define NOT_AVAILABLE "N/A" + +typedef enum { + kSMBString, + kSMBByte, + kSMBWord, + kSMBDWord +// kSMBQWord +} SMBValueType; + +typedef union { + const char *string; + uint8_t byte; + uint16_t word; + uint32_t dword; +// uint64_t qword; +} returnType; + +extern bool getProcessorInformationExternalClock(returnType *value); +extern bool getProcessorInformationMaximumClock(returnType *value); +extern bool getSMBOemProcessorBusSpeed(returnType *value); +extern bool getSMBOemProcessorType(returnType *value); +extern bool getSMBMemoryDeviceMemoryType(returnType *value); +extern bool getSMBMemoryDeviceMemorySpeed(returnType *value); +extern bool getSMBMemoryDeviceManufacturer(returnType *value); +extern bool getSMBMemoryDeviceSerialNumber(returnType *value); +extern bool getSMBMemoryDevicePartNumber(returnType *value); + +SMBEntryPoint *getAddressOfSmbiosTable(void); + +#endif /* !__LIBSAIO_SMBIOS_GETTERS_H */ diff --git a/i386/libsaio/.svn/text-base/spd.c.svn-base b/i386/libsaio/.svn/text-base/spd.c.svn-base new file mode 100644 index 0000000..cbfd1af --- /dev/null +++ b/i386/libsaio/.svn/text-base/spd.c.svn-base @@ -0,0 +1,414 @@ +/* + * spd.c - serial presence detect memory information + * + * Originally restored from pcefi10.5 + * Dynamic mem detection original impl. by Rekursor + * System profiler fix and other fixes by Mozodojo. + */ + +#include "libsaio.h" +#include "pci.h" +#include "platform.h" +#include "spd.h" +#include "cpu.h" +#include "saio_internal.h" +#include "bootstruct.h" +#include "memvendors.h" + +#ifndef DEBUG_SPD +#define DEBUG_SPD 0 +#endif + +#if DEBUG_SPD +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +static const char *spd_memory_types[] = +{ + "RAM", /* 00h Undefined */ + "FPM", /* 01h FPM */ + "EDO", /* 02h EDO */ + "", /* 03h PIPELINE NIBBLE */ + "SDRAM", /* 04h SDRAM */ + "", /* 05h MULTIPLEXED ROM */ + "DDR SGRAM", /* 06h SGRAM DDR */ + "DDR SDRAM", /* 07h SDRAM DDR */ + "DDR2 SDRAM", /* 08h SDRAM DDR 2 */ + "", /* 09h Undefined */ + "", /* 0Ah Undefined */ + "DDR3 SDRAM" /* 0Bh SDRAM DDR 3 */ +}; + +#define UNKNOWN_MEM_TYPE 2 +static uint8_t spd_mem_to_smbios[] = +{ + UNKNOWN_MEM_TYPE, /* 00h Undefined */ + UNKNOWN_MEM_TYPE, /* 01h FPM */ + UNKNOWN_MEM_TYPE, /* 02h EDO */ + UNKNOWN_MEM_TYPE, /* 03h PIPELINE NIBBLE */ + SMB_MEM_TYPE_SDRAM, /* 04h SDRAM */ + SMB_MEM_TYPE_ROM, /* 05h MULTIPLEXED ROM */ + SMB_MEM_TYPE_SGRAM, /* 06h SGRAM DDR */ + SMB_MEM_TYPE_DDR, /* 07h SDRAM DDR */ + SMB_MEM_TYPE_DDR2, /* 08h SDRAM DDR 2 */ + UNKNOWN_MEM_TYPE, /* 09h Undefined */ + UNKNOWN_MEM_TYPE, /* 0Ah Undefined */ + SMB_MEM_TYPE_DDR3 /* 0Bh SDRAM DDR 3 */ +}; +#define SPD_TO_SMBIOS_SIZE (sizeof(spd_mem_to_smbios)/sizeof(uint8_t)) + +#define rdtsc(low,high) \ +__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) + +#define SMBHSTSTS 0 +#define SMBHSTCNT 2 +#define SMBHSTCMD 3 +#define SMBHSTADD 4 +#define SMBHSTDAT 5 +#define SBMBLKDAT 7 + +/** Read one byte from the intel i2c, used for reading SPD on intel chipsets only. */ +unsigned char smb_read_byte_intel(uint32_t base, uint8_t adr, uint8_t cmd) +{ + int l1, h1, l2, h2; + unsigned long long t; + + outb(base + SMBHSTSTS, 0x1f); // reset SMBus Controller + outb(base + SMBHSTDAT, 0xff); + + rdtsc(l1, h1); + while ( inb(base + SMBHSTSTS) & 0x01) // wait until read + { + rdtsc(l2, h2); + t = ((h2 - h1) * 0xffffffff + (l2 - l1)) / (Platform.CPU.TSCFrequency / 100); + if (t > 5) + return 0xFF; // break + } + + outb(base + SMBHSTCMD, cmd); + outb(base + SMBHSTADD, (adr << 1) | 0x01 ); + outb(base + SMBHSTCNT, 0x48 ); + + rdtsc(l1, h1); + + while (!( inb(base + SMBHSTSTS) & 0x02)) // wait til command finished + { + rdtsc(l2, h2); + t = ((h2 - h1) * 0xffffffff + (l2 - l1)) / (Platform.CPU.TSCFrequency / 100); + if (t > 5) + break; // break after 5ms + } + return inb(base + SMBHSTDAT); +} + +/* SPD i2c read optimization: prefetch only what we need, read non prefetcheable bytes on the fly */ +#define READ_SPD(spd, base, slot, x) spd[x] = smb_read_byte_intel(base, 0x50 + slot, x) + +int spd_indexes[] = { + SPD_MEMORY_TYPE, + SPD_DDR3_MEMORY_BANK, + SPD_DDR3_MEMORY_CODE, + SPD_NUM_ROWS, + SPD_NUM_COLUMNS, + SPD_NUM_DIMM_BANKS, + SPD_NUM_BANKS_PER_SDRAM, + 4,7,8,9,12,64, /* TODO: give names to these values */ + 95,96,97,98, 122,123,124,125 /* UIS */ +}; +#define SPD_INDEXES_SIZE (sizeof(spd_indexes) / sizeof(int)) + +/** Read from spd *used* values only*/ +static void init_spd(char * spd, uint32_t base, int slot) +{ + int i; + for (i=0; i< SPD_INDEXES_SIZE; i++) { + READ_SPD(spd, base, slot, spd_indexes[i]); + } +} + +/** Get Vendor Name from spd, 2 cases handled DDR3 and DDR2, + have different formats, always return a valid ptr.*/ +const char * getVendorName(RamSlotInfo_t* slot, uint32_t base, int slot_num) +{ + uint8_t bank = 0; + uint8_t code = 0; + int i = 0; + uint8_t * spd = (uint8_t *) slot->spd; + + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { // DDR3 + bank = (spd[SPD_DDR3_MEMORY_BANK] & 0x07f); // constructors like Patriot use b7=1 + code = spd[SPD_DDR3_MEMORY_CODE]; + for (i=0; i < VEN_MAP_SIZE; i++) + if (bank==vendorMap[i].bank && code==vendorMap[i].code) + return vendorMap[i].name; + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + if(spd[64]==0x7f) { + for (i=64; i<72 && spd[i]==0x7f;i++) { + bank++; + READ_SPD(spd, base, slot_num,i+1); // prefetch next spd byte to read for next loop + } + READ_SPD(spd, base, slot_num,i); + code = spd[i]; + } else { + code = spd[64]; + bank = 0; + } + for (i=0; i < VEN_MAP_SIZE; i++) + if (bank==vendorMap[i].bank && code==vendorMap[i].code) + return vendorMap[i].name; + } + /* OK there is no vendor id here lets try to match the partnum if it exists */ + if (strstr(slot->PartNo,"GU332") == slot->PartNo) // Unifosa fingerprint + return "Unifosa"; + return "NoName"; +} + +/** Get Default Memory Module Speed (no overclocking handled) */ +int getDDRspeedMhz(const char * spd) +{ + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { + switch(spd[12]) { + case 0x0f: + return 1066; + case 0x0c: + return 1333; + case 0x0a: + return 1600; + case 0x14: + default: + return 800; + } + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + switch(spd[9]) { + case 0x50: + return 400; + case 0x3d: + return 533; + case 0x30: + return 667; + case 0x25: + default: + return 800; + } + } + return 800; // default freq for unknown types +} + +#define SMST(a) ((uint8_t)((spd[a] & 0xf0) >> 4)) +#define SLST(a) ((uint8_t)(spd[a] & 0x0f)) + +/** Get DDR3 or DDR2 serial number, 0 most of the times, always return a valid ptr */ +const char *getDDRSerial(const char* spd) +{ + static char asciiSerial[16]; + + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) // DDR3 + { + sprintf(asciiSerial, "%X%X%X%X%X%X%X%X", SMST(122) /*& 0x7*/, SLST(122), SMST(123), SLST(123), SMST(124), SLST(124), SMST(125), SLST(125)); + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) // DDR2 or DDR + { + sprintf(asciiSerial, "%X%X%X%X%X%X%X%X", SMST(95) /*& 0x7*/, SLST(95), SMST(96), SLST(96), SMST(97), SLST(97), SMST(98), SLST(98)); + } + + return strdup(asciiSerial); +} + +/** Get DDR3 or DDR2 Part Number, always return a valid ptr */ +const char * getDDRPartNum(char* spd, uint32_t base, int slot) +{ + static char asciiPartNo[32]; + int i, start=0, index = 0; + + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { + start = 128; + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + start = 73; + } + + // Check that the spd part name is zero terminated and that it is ascii: + bzero(asciiPartNo, sizeof(asciiPartNo)); + char c; + for (i=start; i < start + sizeof(asciiPartNo); i++) { + READ_SPD(spd, base, slot, i); // only read once the corresponding model part (ddr3 or ddr2) + c = spd[i]; + if (isalpha(c) || isdigit(c) || ispunct(c)) // It seems that System Profiler likes only letters and digits... + asciiPartNo[index++] = c; + else if (!isascii(c)) + break; + } + + return strdup(asciiPartNo); +} + +int mapping []= {0,2,1,3,4,6,5,7,8,10,9,11}; + + +/** Read from smbus the SPD content and interpret it for detecting memory attributes */ +static void read_smb_intel(pci_dt_t *smbus_dev) +{ + int i, speed; + uint8_t spd_size, spd_type; + uint32_t base, mmio, hostc; +// bool dump = false; + RamSlotInfo_t* slot; + + uint16_t cmd = pci_config_read16(smbus_dev->dev.addr, 0x04); + DBG("SMBus CmdReg: 0x%x\n", cmd); + pci_config_write16(smbus_dev->dev.addr, 0x04, cmd | 1); + + mmio = pci_config_read32(smbus_dev->dev.addr, 0x10);// & ~0x0f; + base = pci_config_read16(smbus_dev->dev.addr, 0x20) & 0xFFFE; + hostc = pci_config_read8(smbus_dev->dev.addr, 0x40); + verbose("Scanning SMBus [%04x:%04x], mmio: 0x%x, ioport: 0x%x, hostc: 0x%x\n", + smbus_dev->vendor_id, smbus_dev->device_id, mmio, base, hostc); + +//Azi: no use for this! +// getBoolForKey("DumpSPD", &dump, &bootInfo->chameleonConfig); + // needed at least for laptops + bool fullBanks = Platform.DMI.MemoryModules == Platform.DMI.CntMemorySlots; + + char spdbuf[MAX_SPD_SIZE]; + // Search MAX_RAM_SLOTS slots + for (i = 0; i < MAX_RAM_SLOTS; i++){ + slot = &Platform.RAM.DIMM[i]; + spd_size = smb_read_byte_intel(base, 0x50 + i, 0); + DBG("SPD[0] (size): %d @0x%x\n", spd_size, 0x50 + i); + // Check spd is present + if (spd_size && (spd_size != 0xff)) + { + + slot->spd = spdbuf; + slot->InUse = true; + + bzero(slot->spd, spd_size); + + // Copy spd data into buffer + + //for (x = 0; x < spd_size; x++) slot->spd[x] = smb_read_byte_intel(base, 0x50 + i, x); + init_spd(slot->spd, base, i); + + switch (slot->spd[SPD_MEMORY_TYPE]) { + case SPD_MEMORY_TYPE_SDRAM_DDR2: + + slot->ModuleSize = ((1 << (slot->spd[SPD_NUM_ROWS] & 0x0f) + (slot->spd[SPD_NUM_COLUMNS] & 0x0f) - 17) * + ((slot->spd[SPD_NUM_DIMM_BANKS] & 0x7) + 1) * slot->spd[SPD_NUM_BANKS_PER_SDRAM]); + break; + + case SPD_MEMORY_TYPE_SDRAM_DDR3: + + slot->ModuleSize = ((slot->spd[4] & 0x0f) + 28 ) + ((slot->spd[8] & 0x7) + 3 ); + slot->ModuleSize -= (slot->spd[7] & 0x7) + 25; + slot->ModuleSize = ((1 << slot->ModuleSize) * (((slot->spd[7] >> 3) & 0x1f) + 1)); + + break; + } + + spd_type = (slot->spd[SPD_MEMORY_TYPE] < ((char) 12) ? slot->spd[SPD_MEMORY_TYPE] : 0); + slot->Type = spd_mem_to_smbios[spd_type]; + slot->PartNo = getDDRPartNum(slot->spd, base, i); + slot->Vendor = getVendorName(slot, base, i); + slot->SerialNo = getDDRSerial(slot->spd); + + // determine spd speed + speed = getDDRspeedMhz(slot->spd); + if (slot->Frequency<speed) slot->Frequency = speed; + + // pci memory controller if available, is more reliable + if (Platform.RAM.Frequency > 0) { + uint32_t freq = (uint32_t)Platform.RAM.Frequency / 500000; + // now round off special cases + uint32_t fmod100 = freq %100; + switch(fmod100) { + case 1: freq--; break; + case 32: freq++; break; + case 65: freq++; break; + case 98: freq+=2;break; + case 99: freq++; break; + } + slot->Frequency = freq; + } + + verbose("Slot: %d Type %d %dMB (%s) %dMHz Vendor=%s\n PartNo=%s SerialNo=%s\n", + i, + (int)slot->Type, + slot->ModuleSize, + spd_memory_types[spd_type], + slot->Frequency, + slot->Vendor, + slot->PartNo, + slot->SerialNo); + + + } + + // laptops sometimes show slot 0 and 2 with slot 1 empty when only 2 slots are presents so: + Platform.DMI.DIMM[i]= + i>0 && Platform.RAM.DIMM[1].InUse==false && fullBanks && Platform.DMI.CntMemorySlots == 2 ? + mapping[i] : i; // for laptops case, mapping setup would need to be more generic than this + + + + slot->spd = NULL; + + } // for +} + +static struct smbus_controllers_t smbus_controllers[] = { + + {0x8086, 0x269B, "ESB2", read_smb_intel }, + {0x8086, 0x24C3, "ICH4", read_smb_intel }, + {0x8086, 0x24D3, "ICH5", read_smb_intel }, + {0x8086, 0x266A, "ICH6", read_smb_intel }, + {0x8086, 0x27DA, "ICH7", read_smb_intel }, + {0x8086, 0x283E, "ICH8", read_smb_intel }, + {0x8086, 0x2930, "ICH9", read_smb_intel }, + {0x8086, 0x3A30, "ICH10R", read_smb_intel }, + {0x8086, 0x3A60, "ICH10B", read_smb_intel }, + {0x8086, 0x3B30, "5 Series", read_smb_intel }, + {0x8086, 0x1C22, "6 Series", read_smb_intel }, + {0x8086, 0x1E22, "7 Series", read_smb_intel }, + {0x8086, 0x8C22, "8 Series", read_smb_intel }, + {0x8086, 0x1D22, "X79 Series", read_smb_intel }, + +}; + +// initial call : pci_dt = root_pci_dev; +// find_and_read_smbus_controller(root_pci_dev); +bool find_and_read_smbus_controller(pci_dt_t* pci_dt) +{ + pci_dt_t *current = pci_dt; + int i; + + while (current) { +#if 0 + printf("%02x:%02x.%x [%04x] [%04x:%04x] :: %s\n", + current->dev.bits.bus, current->dev.bits.dev, current->dev.bits.func, + current->class_id, current->vendor_id, current->device_id, + get_pci_dev_path(current)); +#endif + for ( i = 0; i < sizeof(smbus_controllers) / sizeof(smbus_controllers[0]); i++ ) + { + if (current->vendor_id == smbus_controllers[i].vendor && + current->device_id == smbus_controllers[i].device) + { + smbus_controllers[i].read_smb(current); // read smb + return true; + } + } + find_and_read_smbus_controller(current->children); + current = current->next; + } + return false; // not found +} + +void scan_spd(PlatformInfo_t *p) +{ + find_and_read_smbus_controller(root_pci_dev); +} + diff --git a/i386/libsaio/.svn/text-base/spd.h.svn-base b/i386/libsaio/.svn/text-base/spd.h.svn-base new file mode 100644 index 0000000..59a67fd --- /dev/null +++ b/i386/libsaio/.svn/text-base/spd.h.svn-base @@ -0,0 +1,160 @@ +/* + * Copyright 2010 AsereBLN. All rights reserved. <aserebln@googlemail.com> + * + * spd.h + */ + +#ifndef __LIBSAIO_SPD_H +#define __LIBSAIO_SPD_H + +#include "platform.h" +#include "libsaio.h" + +void scan_spd(PlatformInfo_t *p); + +struct smbus_controllers_t { + uint32_t vendor; + uint32_t device; + char *name; + void (*read_smb)(pci_dt_t *smbus_dev); +}; + + +/* + * Serial Presence Detect (SPD) data stored on SDRAM modules. + * + * Datasheet: + * - Name: PC SDRAM Serial Presence Detect (SPD) Specification + * Revision 1.2A, December, 1997 + * - PDF: http://www.intel.com/design/chipsets/memory/spdsd12a.pdf + * + * Datasheet (alternative): + * - Name: SERIAL PRESENCE DETECT STANDARD, General Standard + * JEDEC Standard No. 21-C + * - PDF: http://www.jedec.org/download/search/4_01_02_00R9.PDF + */ + + +/* Byte numbers. */ +#define SPD_NUM_MANUFACTURER_BYTES 0 /* Number of bytes used by module manufacturer */ +#define SPD_TOTAL_SPD_MEMORY_SIZE 1 /* Total SPD memory size */ +#define SPD_MEMORY_TYPE 2 /* (Fundamental) memory type */ +#define SPD_NUM_ROWS 3 /* Number of row address bits */ +#define SPD_NUM_COLUMNS 4 /* Number of column address bits */ +#define SPD_NUM_DIMM_BANKS 5 /* Number of module rows (banks) */ +#define SPD_MODULE_DATA_WIDTH_LSB 6 /* Module data width (LSB) */ +#define SPD_MODULE_DATA_WIDTH_MSB 7 /* Module data width (MSB) */ +#define SPD_MODULE_VOLTAGE 8 /* Module interface signal levels */ +#define SPD_MIN_CYCLE_TIME_AT_CAS_MAX 9 /* SDRAM cycle time (highest CAS latency), RAS access time (tRAC) */ +#define SPD_ACCESS_TIME_FROM_CLOCK 10 /* SDRAM access time from clock (highest CAS latency), CAS access time (Tac, tCAC) */ +#define SPD_DIMM_CONFIG_TYPE 11 /* Module configuration type */ +#define SPD_REFRESH 12 /* Refresh rate/type */ +#define SPD_PRIMARY_SDRAM_WIDTH 13 /* SDRAM width (primary SDRAM) */ +#define SPD_ERROR_CHECKING_SDRAM_WIDTH 14 /* Error checking SDRAM (data) width */ +#define SPD_MIN_CLOCK_DELAY_B2B_RAND_COLUMN 15 /* SDRAM device attributes, minimum clock delay for back to back random column */ +#define SPD_SUPPORTED_BURST_LENGTHS 16 /* SDRAM device attributes, burst lengths supported */ +#define SPD_NUM_BANKS_PER_SDRAM 17 /* SDRAM device attributes, number of banks on SDRAM device */ +#define SPD_ACCEPTABLE_CAS_LATENCIES 18 /* SDRAM device attributes, CAS latency */ +#define SPD_CS_LATENCY 19 /* SDRAM device attributes, CS latency */ +#define SPD_WE_LATENCY 20 /* SDRAM device attributes, WE latency */ +#define SPD_MODULE_ATTRIBUTES 21 /* SDRAM module attributes */ +#define SPD_DEVICE_ATTRIBUTES_GENERAL 22 /* SDRAM device attributes, general */ +#define SPD_SDRAM_CYCLE_TIME_2ND 23 /* SDRAM cycle time (2nd highest CAS latency) */ +#define SPD_ACCESS_TIME_FROM_CLOCK_2ND 24 /* SDRAM access from clock (2nd highest CAS latency) */ +#define SPD_SDRAM_CYCLE_TIME_3RD 25 /* SDRAM cycle time (3rd highest CAS latency) */ +#define SPD_ACCESS_TIME_FROM_CLOCK_3RD 26 /* SDRAM access from clock (3rd highest CAS latency) */ +#define SPD_MIN_ROW_PRECHARGE_TIME 27 /* Minimum row precharge time (Trp) */ +#define SPD_MIN_ROWACTIVE_TO_ROWACTIVE 28 /* Minimum row active to row active (Trrd) */ +#define SPD_MIN_RAS_TO_CAS_DELAY 29 /* Minimum RAS to CAS delay (Trcd) */ +#define SPD_MIN_ACTIVE_TO_PRECHARGE_DELAY 30 /* Minimum RAS pulse width (Tras) */ +#define SPD_DENSITY_OF_EACH_ROW_ON_MODULE 31 /* Density of each row on module */ +#define SPD_CMD_SIGNAL_INPUT_SETUP_TIME 32 /* Command and address signal input setup time */ +#define SPD_CMD_SIGNAL_INPUT_HOLD_TIME 33 /* Command and address signal input hold time */ +#define SPD_DATA_SIGNAL_INPUT_SETUP_TIME 34 /* Data signal input setup time */ +#define SPD_DATA_SIGNAL_INPUT_HOLD_TIME 35 /* Data signal input hold time */ +#define SPD_WRITE_RECOVERY_TIME 36 /* Write recovery time (tWR) */ +#define SPD_INT_WRITE_TO_READ_DELAY 37 /* Internal write to read command delay (tWTR) */ +#define SPD_INT_READ_TO_PRECHARGE_DELAY 38 /* Internal read to precharge command delay (tRTP) */ +#define SPD_MEM_ANALYSIS_PROBE_PARAMS 39 /* Memory analysis probe characteristics */ +#define SPD_BYTE_41_42_EXTENSION 40 /* Extension of byte 41 (tRC) and byte 42 (tRFC) */ +#define SPD_MIN_ACT_TO_ACT_AUTO_REFRESH 41 /* Minimum active to active auto refresh (tRCmin) */ +#define SPD_MIN_AUTO_REFRESH_TO_ACT 42 /* Minimum auto refresh to active/auto refresh (tRFC) */ +#define SPD_MAX_DEVICE_CYCLE_TIME 43 /* Maximum device cycle time (tCKmax) */ +#define SPD_MAX_DQS_DQ_SKEW 44 /* Maximum skew between DQS and DQ (tDQSQ) */ +#define SPD_MAX_READ_DATAHOLD_SKEW 45 /* Maximum read data-hold skew factor (tQHS) */ +#define SPD_PLL_RELOCK_TIME 46 /* PLL relock time */ +#define SPD_SPD_DATA_REVISION_CODE 62 /* SPD data revision code */ +#define SPD_CHECKSUM_FOR_BYTES_0_TO_62 63 /* Checksum for bytes 0-62 */ +#define SPD_MANUFACTURER_JEDEC_ID_CODE 64 /* Manufacturer's JEDEC ID code, per EIA/JEP106 (bytes 64-71) */ +#define SPD_MANUFACTURING_LOCATION 72 /* Manufacturing location */ +#define SPD_MANUFACTURER_PART_NUMBER 73 /* Manufacturer's part number, in 6-bit ASCII (bytes 73-90) */ +#define SPD_REVISION_CODE 91 /* Revision code (bytes 91-92) */ +#define SPD_MANUFACTURING_DATE 93 /* Manufacturing date (byte 93: year, byte 94: week) */ +#define SPD_ASSEMBLY_SERIAL_NUMBER 95 /* Assembly serial number (bytes 95-98) */ +#define SPD_MANUFACTURER_SPECIFIC_DATA 99 /* Manufacturer specific data (bytes 99-125) */ +#define SPD_INTEL_SPEC_FOR_FREQUENCY 126 /* Intel specification for frequency */ +#define SPD_INTEL_SPEC_100_MHZ 127 /* Intel specification details for 100MHz support */ +#define SPD_DDR3_MEMORY_BANK 0x75 +#define SPD_DDR3_MEMORY_CODE 0x76 + +/* DRAM specifications use the following naming conventions for SPD locations */ +#define SPD_tRP SPD_MIN_ROW_PRECHARGE_TIME +#define SPD_tRRD SPD_MIN_ROWACTIVE_TO_ROWACTIVE +#define SPD_tRCD SPD_MIN_RAS_TO_CAS_DELAY +#define SPD_tRAS SPD_MIN_ACTIVE_TO_PRECHARGE_DELAY +#define SPD_BANK_DENSITY SPD_DENSITY_OF_EACH_ROW_ON_MODULE +#define SPD_ADDRESS_CMD_HOLD SPD_CMD_SIGNAL_INPUT_HOLD_TIME +#define SPD_tRC 41 /* SDRAM Device Minimum Active to Active/Auto Refresh Time (tRC) */ +#define SPD_tRFC 42 /* SDRAM Device Minimum Auto Refresh to Active/Auto Refresh (tRFC) */ + + +/* SPD_MEMORY_TYPE values. */ +#define SPD_MEMORY_TYPE_FPM_DRAM 1 +#define SPD_MEMORY_TYPE_EDO 2 +#define SPD_MEMORY_TYPE_PIPELINED_NIBBLE 3 +#define SPD_MEMORY_TYPE_SDRAM 4 +#define SPD_MEMORY_TYPE_MULTIPLEXED_ROM 5 +#define SPD_MEMORY_TYPE_SGRAM_DDR 6 +#define SPD_MEMORY_TYPE_SDRAM_DDR 7 +#define SPD_MEMORY_TYPE_SDRAM_DDR2 8 +#define SPD_MEMORY_TYPE_SDRAM_DDR3 0xb + +/* SPD_MODULE_VOLTAGE values. */ +#define SPD_VOLTAGE_TTL 0 /* 5.0 Volt/TTL */ +#define SPD_VOLTAGE_LVTTL 1 /* LVTTL */ +#define SPD_VOLTAGE_HSTL 2 /* HSTL 1.5 */ +#define SPD_VOLTAGE_SSTL3 3 /* SSTL 3.3 */ +#define SPD_VOLTAGE_SSTL2 4 /* SSTL 2.5 */ + +/* SPD_DIMM_CONFIG_TYPE values. */ +#define ERROR_SCHEME_NONE 0 +#define ERROR_SCHEME_PARITY 1 +#define ERROR_SCHEME_ECC 2 + +/* SPD_ACCEPTABLE_CAS_LATENCIES values. */ +// TODO: Check values. +#define SPD_CAS_LATENCY_1_0 0x01 +#define SPD_CAS_LATENCY_1_5 0x02 +#define SPD_CAS_LATENCY_2_0 0x04 +#define SPD_CAS_LATENCY_2_5 0x08 +#define SPD_CAS_LATENCY_3_0 0x10 +#define SPD_CAS_LATENCY_3_5 0x20 +#define SPD_CAS_LATENCY_4_0 0x40 + +#define SPD_CAS_LATENCY_DDR2_3 (1 << 3) +#define SPD_CAS_LATENCY_DDR2_4 (1 << 4) +#define SPD_CAS_LATENCY_DDR2_5 (1 << 5) +#define SPD_CAS_LATENCY_DDR2_6 (1 << 6) + +/* SPD_SUPPORTED_BURST_LENGTHS values. */ +#define SPD_BURST_LENGTH_1 1 +#define SPD_BURST_LENGTH_2 2 +#define SPD_BURST_LENGTH_4 4 +#define SPD_BURST_LENGTH_8 8 +#define SPD_BURST_LENGTH_PAGE (1 << 7) + +/* SPD_MODULE_ATTRIBUTES values. */ +#define MODULE_BUFFERED 1 +#define MODULE_REGISTERED 2 + +#endif /* !__LIBSAIO_SPD_H */ diff --git a/i386/libsaio/.svn/text-base/stringTable.c.svn-base b/i386/libsaio/.svn/text-base/stringTable.c.svn-base new file mode 100644 index 0000000..8159d3d --- /dev/null +++ b/i386/libsaio/.svn/text-base/stringTable.c.svn-base @@ -0,0 +1,790 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "bootstruct.h" +#include "libsaio.h" +#include "boot.h" +#include "xml.h" + +extern char *Language; +extern char *LoadableFamilies; + +bool sysConfigValid; + +/* + * Compare a string to a key with quoted characters + */ +static inline int +keyncmp(const char *str, const char *key, int n) +{ + int c; + while (n--) { + c = *key++; + if (c == '\\') { + switch(c = *key++) { + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 't': + c = '\t'; + break; + default: + break; + } + } else if (c == '\"') { + /* Premature end of key */ + return 1; + } + if (c != *str++) { + return 1; + } + } + return 0; +} + +#if UNUSED + +static void eatThru(char val, const char **table_p) +{ + register const char *table = *table_p; + register bool found = false; + + while (*table && !found) + { + if (*table == '\\') table += 2; + else + { + if (*table == val) found = true; + table++; + } + } + *table_p = table; +} + +/* Remove key and its associated value from the table. */ + +bool +removeKeyFromTable(const char *key, char *table) +{ + register int len; + register char *tab; + char *buf; + + len = strlen(key); + tab = (char *)table; + buf = (char *)malloc(len + 3); + + sprintf(buf, "\"%s\"", key); + len = strlen(buf); + + while(*tab) { + if(strncmp(buf, tab, len) == 0) { + char c; + + while((c = *(tab + len)) != ';') { + if(c == 0) { + len = -1; + goto out; + } + len++; + } + len++; + if(*(tab + len) == '\n') len++; + goto out; + } + tab++; + } + len = -1; +out: + free(buf); + + if(len == -1) return false; + + while((*tab = *(tab + len))) { + tab++; + } + + return true; +} + +char * +newStringFromList( + char **list, + int *size +) +{ + char *begin = *list, *end; + char *newstr; + int newsize = *size; + int bufsize; + + while (*begin && newsize && isspace(*begin)) { + begin++; + newsize--; + } + end = begin; + while (*end && newsize && !isspace(*end)) { + end++; + newsize--; + } + if (begin == end) + return 0; + bufsize = end - begin + 1; + newstr = malloc(bufsize); + strlcpy(newstr, begin, bufsize); + *list = end; + *size = newsize; + return newstr; +} + +#endif + +/* + * compress == compress escaped characters to one character + */ +int stringLength(const char *table, int compress) +{ + int ret = 0; + + while (*table) + { + if (*table == '\\') + { + table += 2; + ret += 1 + (compress ? 0 : 1); + } + else + { + if (*table == '\"') return ret; + ret++; + table++; + } + } + return ret; +} + + +bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size) +{ + if (config->dictionary != 0 ) { + // Look up key in XML dictionary + TagPtr value; + value = XMLGetProperty(config->dictionary, key); + if (value != 0) { + if (value->type != kTagTypeString) { + error("Non-string tag '%s' found in config file\n", + key); + return false; + } + *val = value->string; + *size = strlen(value->string); + return true; + } + } else { + + // Legacy plist-style table + + } + + return false; +} + +#if UNUSED + +/* + * Returns a new malloc'ed string if one is found + * in the string table matching 'key'. Also translates + * \n escapes in the string. + */ +char *newStringForStringTableKey( + char *table, + char *key, + config_file_t *config +) +{ + const char *val; + char *newstr, *p; + int size; + + if (getValueForConfigTableKey(config, key, &val, &size)) { + newstr = (char *)malloc(size+1); + for (p = newstr; size; size--, p++, val++) { + if ((*p = *val) == '\\') { + switch (*++val) { + case 'r': + *p = '\r'; + break; + case 'n': + *p = '\n'; + break; + case 't': + *p = '\t'; + break; + default: + *p = *val; + break; + } + size--; + } + } + *p = '\0'; + return newstr; + } else { + return 0; + } +} + +#endif + +char * +newStringForKey(char *key, config_file_t *config) +{ + const char *val; + char *newstr; + int size; + + if (getValueForKey(key, &val, &size, config) && size) { + newstr = (char *)malloc(size + 1); + strlcpy(newstr, val, size + 1); + return newstr; + } else { + return 0; + } +} + +/* parse a command line + * in the form: [<argument> ...] [<option>=<value> ...] + * both <option> and <value> must be either composed of + * non-whitespace characters, or enclosed in quotes. + */ + +static const char *getToken(const char *line, const char **begin, int *len) +{ + if (*line == '\"') { + *begin = ++line; + while (*line && *line != '\"') + line++; + *len = line++ - *begin; + } else { + *begin = line; + while (*line && !isspace(*line) && *line != '=') + line++; + *len = line - *begin; + } + return line; +} + +bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len) +{ + const char *key, *value; + int key_len, value_len; + bool retval = false; + + while (*line) { + /* look for keyword or argument */ + while (isspace(*line)) line++; + + /* now look for '=' or whitespace */ + line = getToken(line, &key, &key_len); + /* line now points to '=' or space */ + if (*line && !isspace(*line)) { + line = getToken(++line, &value, &value_len); + } else { + value = line; + value_len = 0; + } + if ((strlen(match) == key_len) + && strncmp(match, key, key_len) == 0) { + // create a new string + char* newstr = malloc(value_len + 1); + strncpy(newstr, value, value_len); + newstr[value_len] = 0; + + *matchval = newstr; + *len = value_len; + retval = true; + /* Continue to look for this key; last one wins. */ + } + } + + + return retval; +} + +/* Return NULL if no option has been successfully retrieved, or the string otherwise */ +const char * getStringForKey(const char * key, config_file_t *config) +{ + static const char* value =0; + int len=0; + if(!getValueForKey(key, &value, &len, config)) value = 0; + return value; +} + + +/* Returns TRUE if a value was found, FALSE otherwise. + * The boolean value of the key is stored in 'val'. + */ + +bool getBoolForKey( const char *key, bool *result_val, config_file_t *config ) +{ + const char *key_val; + int size; + + if (getValueForKey(key, &key_val, &size, config)) { + if ( (size >= 1) && (key_val[0] == 'Y' || key_val[0] == 'y') ) { + *result_val = true; + } else { + *result_val = false; + } + return true; + } + return false; +} + +bool getIntForKey( const char *key, int *value, config_file_t *config ) +{ + const char *val; + int size, sum; + bool negative = false; + + if (getValueForKey(key, &val, &size, config)) + { + if ( size ) + { + if (*val == '-') + { + negative = true; + val++; + size--; + } + + for (sum = 0; size > 0; size--) + { + if (*val < '0' || *val > '9') + return false; + + sum = (sum * 10) + (*val++ - '0'); + } + + if (negative) + sum = -sum; + + *value = sum; + return true; + } + } + return false; +} + +/* + * + */ + +bool getDimensionForKey( const char *key, unsigned int *value, config_file_t *config, unsigned int dimension_max, unsigned int object_size ) +{ + const char *val; + + int size = 0; + int sum = 0; + + bool negative = false; + bool percentage = false; + + if (getValueForKey(key, &val, &size, config)) + { + if ( size ) + { + if (*val == '-') + { + negative = true; + val++; + size--; + } + + if (val[size-1] == '%') + { + percentage = true; + size--; + } + + // convert string to integer + for (sum = 0; size > 0; size--) + { + if (*val < '0' || *val > '9') + return false; + + sum = (sum * 10) + (*val++ - '0'); + } + + if (percentage) + sum = ( dimension_max * sum ) / 100; + + // calculate offset from opposite origin + if (negative) + sum = ( ( dimension_max - object_size ) - sum ); + + } else { + + // null value calculate center + sum = ( dimension_max - object_size ) / 2; + + } + + *value = (uint16_t) sum; + return true; + } + + // key not found + return false; +} + +/* + * get color value from plist format #RRGGBB + */ + +bool getColorForKey( const char *key, unsigned int *value, config_file_t *config ) +{ + const char *val; + int size; + + if (getValueForKey(key, &val, &size, config)) + { + if (*val == '#') + { + val++; + *value = strtol(val, NULL, 16); + return true; + } + } + return false; +} + +bool getValueForKey( const char *key, const char **val, int *size, config_file_t *config ) +{ + const char *overrideVal; + int overrideSize; + bool override, ret; + + if (getValueForBootKey(bootArgs->CommandLine, key, val, size)) + return true; + + ret = getValueForConfigTableKey(config, key, val, size); + + // Try to find alternate keys in bootInfo->chameleonConfig (if config can be overriden) + // and prefer its values with the exceptions for + // "Kernel"="mach_kernel" and "Kernel Flags"="". + + if (config->canOverride) + { + if (getValueForConfigTableKey(&bootInfo->chameleonConfig, key, &overrideVal, &overrideSize)) + { + override = true; + + // NOTE: Values are defined by apple as being in com.apple.Boot.plist + // kHelperRootUUIDKey, kKernelArchKey, kMKextCacheKey, kKernelCacheKey, kKernelNameKey, kKernelFlagsKey + if (ret && (strcmp(key, kKernelNameKey) == 0) && (overrideSize == 0)) + override = false; + + if (ret && (strcmp(key, kKernelFlagsKey) == 0) && (overrideSize == 0)) + override = false; + + if (override) + { + *val = overrideVal; + *size = overrideSize; + return true; + } + } + } + + return ret; +} + + +#if UNUSED +void +printSystemConfig(char *p1) +{ + char *p2 = p1, tmp; + + while (*p1 != '\0') { + while (*p2 != '\0' && *p2 != '\n') p2++; + tmp = *p2; + *p2 = '\0'; + printf("%s\n", p1); + *p2 = tmp; + if (tmp == '\0') break; + p1 = ++p2; + } +} +#endif + +//========================================================================== +// ParseXMLFile +// Modifies the input buffer. +// Expects to see one dictionary in the XML file. +// Puts the first dictionary it finds in the +// tag pointer and returns 0, or returns -1 if not found +// (and does not modify dict pointer). +// Prints an error message if there is a parsing error. +// +int ParseXMLFile( char * buffer, TagPtr * dict ) +{ + long length, pos; + TagPtr tag; + pos = 0; + char *configBuffer; + + configBuffer = malloc(strlen(buffer)+1); + strcpy(configBuffer, buffer); + + while (1) + { + length = XMLParseNextTag(configBuffer + pos, &tag); + if (length == -1) break; + + pos += length; + + if (tag == 0) continue; + if (tag->type == kTagTypeDict) break; + + XMLFreeTag(tag); + } + free(configBuffer); + if (length < 0) { + error ("Error parsing plist file\n"); + return -1; + } + *dict = tag; + return 0; +} + +/* loadConfigFile + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadConfigFile (const char *configFile, config_file_t *config) +{ + int fd, count; + + if ((fd = open_bvdev("bt(0,0)", configFile, 0)) < 0) { + return -1; + } + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + return 0; +} + + +/* loadSystemConfig + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadSystemConfig(config_file_t *config) +{ + char *dirspec[] = { + "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/OS X Install Data/com.apple.Boot.plist", + }; + + int i, fd, count, ret=-1; + + for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) + { + if ((fd = open(dirspec[i], 0)) >= 0) + { + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + ret=0; + + break; + } + } + + if(ret == -1) ret = loadHelperConfig(config); + + // Always enable canOverride flag (for SystemConfig) + config->canOverride = true; + + return ret; +} + +/* loadChameleonConfig + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadChameleonConfig(config_file_t *config) +{ + char *dirspec[] = { + "rd(0,0)/Extra/org.chameleon.Boot.plist", + "/Extra/org.chameleon.Boot.plist", + "bt(0,0)/Extra/org.chameleon.Boot.plist", + + "rd(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */ + "/Extra/com.apple.Boot.plist", /* DEPRECIATED */ + "bt(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */ + }; + + int i, fd, count, ret=-1; + + for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) + { + if ((fd = open(dirspec[i], 0)) >= 0) + { + // Check for depreciated file names and annoy the user about it. + if(strstr(dirspec[i], "com.apple.Boot.plist")) + { + printf("%s is depreciated.\n", dirspec[i]); + dirspec[i][strlen(dirspec[i]) - strlen("com.apple.Boot.plist")] = 0; + printf("Please use the file %sorg.chameleon.Boot.plist instead.\n", dirspec[i]); + pause(); + } + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + ret=0; + break; + } + } + return ret; +} + +/* loadHelperConfig + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadHelperConfig(config_file_t *config) +{ + char *dirspec[] = { + "/com.apple.boot.P/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/com.apple.boot.R/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/com.apple.boot.S/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" + }; + + int i, fd, count, ret=-1; + + for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) + { + if ((fd = open(dirspec[i], 0)) >= 0) + { + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + ret=0; + break; + } + } + return ret; +} + +char * newString(const char * oldString) +{ + if ( oldString ) + return strcpy(malloc(strlen(oldString)+1), oldString); + else + return NULL; +} + +/* + * Extracts the next argument from the command line, double quotes are allowed here. + */ +char * getNextArg(char ** argPtr, char * val) +{ + char * ptr = *argPtr; + const char * strStart; + int len = 0; + bool isQuoted = false; + + *val = '\0'; + + // Scan for the next non-whitespace character. + while ( *ptr && (*ptr == ' ' || *ptr == '=') ) + { + ptr++; + } + + strStart = ptr; + + // Skip the leading double quote character. + if (*ptr == '\"') + { + isQuoted = true; + ptr++; + strStart++; + } + + // Scan for the argument terminator character. + // This can be either a NULL character - in case we reach the end of the string, + // a double quote in case of quoted argument, + // or a whitespace character (' ' or '=') for non-quoted argument. + while (*ptr && !( (isQuoted && (*ptr == '\"')) || + (!isQuoted && (*ptr == ' ' || *ptr == '=')) ) + ) + { + ptr++; + } + + len = ptr - strStart; + + // Skip the closing double quote character and adjust + // the starting pointer for the next getNextArg call. + if (*ptr && isQuoted && *ptr == '\"') + ptr++; + + // Copy the extracted argument to val. + strncat(val, strStart, len); + + // Set command line pointer. + *argPtr = ptr; + + return ptr; +} diff --git a/i386/libsaio/.svn/text-base/sys.c.svn-base b/i386/libsaio/.svn/text-base/sys.c.svn-base new file mode 100644 index 0000000..775ebc0 --- /dev/null +++ b/i386/libsaio/.svn/text-base/sys.c.svn-base @@ -0,0 +1,1092 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * Copyright (c) 1988 Carnegie-Mellon University + * Copyright (c) 1987 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + * + */ +/* + * HISTORY + * Revision 2.3 88/08/08 13:47:07 rvb + * Allocate buffers dynamically vs statically. + * Now b[i] and i_fs and i_buf, are allocated dynamically. + * boot_calloc(size) allocates and zeros a buffer rounded to a NPG + * boundary. + * Generalize boot spec to allow, xx()/mach, xx(n,[a..h])/mach, + * xx([a..h])/mach, ... + * Also default "xx" if unspecified and alloc just "/mach", + * where everything is defaulted + * Add routine, ptol(), to parse partition letters. + * + */ + +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sys.c 7.1 (Berkeley) 6/5/86 + */ + +/* Copyright 2007 VMware Inc. + "Preboot" ramdisk support added by David Elliott + */ + + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "disk.h" +#include "ramdisk.h" +#include "xml.h" + +#include <libkern/crypto/md5.h> +//#include <uuid/uuid.h> + +#if 0 /* No OS X release has ever included this. */ +#include <Kernel/uuid/namespace.h> +#else +// from our uuid/namespace.h (UFS and HFS uuids can live in the same space?) +static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC}; +#endif + +extern int multiboot_partition; +extern int multiboot_partition_set; +extern int multiboot_skip_partition; +extern int multiboot_skip_partition_set; + +struct devsw { + const char * name; + // size increased from char to short to handle non-BIOS internal devices + unsigned short biosdev; + int type; +}; + +// Device entries must be ordered by bios device numbers. +static struct devsw devsw[] = +{ + { "hd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_HD */ + { "en", 0xE0, kBIOSDevTypeNetwork }, /* DEV_EN */ + { "rd", 0x100, kBIOSDevTypeHardDrive }, + { "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition + { 0, 0 } +}; + +// Pseudo BIOS devices +enum { + kPseudoBIOSDevRAMDisk = 0x100, + kPseudoBIOSDevBooter = 0x101 +}; + +/* + * Max number of file descriptors. + */ +#define NFILES 6 + +static struct iob iob[NFILES]; + +void * gFSLoadAddress = 0; + +// Turbo - save what we think is our original BIOS boot volume if we have one 0xab +BVRef gBIOSBootVolume = NULL; +BVRef gBootVolume; + +//static BVRef getBootVolumeRef( const char * path, const char ** outPath ); +static BVRef newBootVolumeRef( int biosdev, int partno ); + +//========================================================================== +// LoadVolumeFile - LOW-LEVEL FILESYSTEM FUNCTION. +// Load the specified file from the specified volume +// to the load buffer at LOAD_ADDR. +// If the file is fat, load only the i386 portion. + +long LoadVolumeFile(BVRef bvr, const char *filePath) +{ + long fileSize; + + // Read file into load buffer. The data in the load buffer will be + // overwritten by the next LoadFile() call. + + gFSLoadAddress = (void *) LOAD_ADDR; + + fileSize = bvr->fs_loadfile(bvr, (char *)filePath); + + // Return the size of the file, or -1 if load failed. + + return fileSize; +} + +//========================================================================== +// LoadFile - LOW-LEVEL FILESYSTEM FUNCTION. +// Load the specified file to the load buffer at LOAD_ADDR. +// If the file is fat, load only the i386 portion. + +long LoadFile(const char * fileSpec) +{ + const char * filePath; + BVRef bvr; + + // Resolve the boot volume from the file spec. + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) + return -1; + + return LoadVolumeFile(bvr, filePath); +} + +long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length) +{ + const char *filePath; + BVRef bvr; + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) + return -1; + + if (bvr->fs_readfile == NULL) + return -1; + + return bvr->fs_readfile(bvr, (char *)filePath, buffer, offset, length); +} + +long LoadThinFatFile(const char *fileSpec, void **binary) +{ + const char *filePath; + FSReadFile readFile; + BVRef bvr; + unsigned long length, length2; + + // Resolve the boot volume from the file spec. + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) + return -1; + + *binary = (void *)kLoadAddr; + + // Read file into load buffer. The data in the load buffer will be + // overwritten by the next LoadFile() call. + + gFSLoadAddress = (void *) LOAD_ADDR; + + readFile = bvr->fs_readfile; + + if (readFile != NULL) { + // Read the first 4096 bytes (fat header) + length = readFile(bvr, (char *)filePath, *binary, 0, 0x1000); + if (length > 0) { + if (ThinFatFile(binary, &length) == 0) { + if (length == 0) + return 0; + // We found a fat binary; read only the thin part + length = readFile(bvr, (char *)filePath, + (void *)kLoadAddr, (unsigned long)(*binary) - kLoadAddr, length); + *binary = (void *)kLoadAddr; + } else { + // Not a fat binary; read the rest of the file + length2 = readFile(bvr, (char *)filePath, (void *)(kLoadAddr + length), length, 0); + if (length2 == -1) return -1; + length += length2; + } + } + } else { + length = bvr->fs_loadfile(bvr, (char *)filePath); + if (length > 0) { + ThinFatFile(binary, &length); + } + } + + return length; +} + +#if UNUSED +long GetFSUUID(char *spec, char *uuidStr) +{ + BVRef bvr; + long rval = -1; + const char *devSpec; + + if ((bvr = getBootVolumeRef(spec, &devSpec)) == NULL) + return -1; + + if(bvr->fs_getuuid) + rval = bvr->fs_getuuid(bvr, uuidStr); + + return rval; +} +#endif + +// filesystem-specific getUUID functions call this shared string generator +long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr) +{ + unsigned fmtbase, fmtidx, i; + uint8_t uuidfmt[] = { 4, 2, 2, 2, 6 }; + char *p = uuidStr; + MD5_CTX md5c; + uint8_t mdresult[16]; + + bzero(mdresult, sizeof(mdresult)); + + // just like AppleFileSystemDriver + MD5Init(&md5c); + MD5Update(&md5c, kFSUUIDNamespaceSHA1, sizeof(kFSUUIDNamespaceSHA1)); + MD5Update(&md5c, uubytes, nbytes); + MD5Final(mdresult, &md5c); + + // this UUID has been made version 3 style (i.e. via namespace) + // see "-uuid-urn-" IETF draft (which otherwise copies byte for byte) + mdresult[6] = 0x30 | ( mdresult[6] & 0x0F ); + mdresult[8] = 0x80 | ( mdresult[8] & 0x3F ); + + + // generate the text: e.g. 5EB1869F-C4FA-3502-BDEB-3B8ED5D87292 + i = 0; fmtbase = 0; + for(fmtidx = 0; fmtidx < sizeof(uuidfmt); fmtidx++) { + for(i=0; i < uuidfmt[fmtidx]; i++) { + uint8_t byte = mdresult[fmtbase+i]; + char nib; + + nib = byte >> 4; + *p = nib + '0'; // 0x4 -> '4' + if(*p > '9') *p = (nib - 9 + ('A'-1)); // 0xB -> 'B' + p++; + + nib = byte & 0xf; + *p = nib + '0'; // 0x4 -> '4' + if(*p > '9') *p = (nib - 9 + ('A'-1)); // 0xB -> 'B' + p++; + + } + fmtbase += i; + if(fmtidx < sizeof(uuidfmt)-1) + *(p++) = '-'; + else + *p = '\0'; + } + + return 0; +} + + +//========================================================================== +// GetDirEntry - LOW-LEVEL FILESYSTEM FUNCTION. +// Fetch the next directory entry for the given directory. + +long GetDirEntry(const char * dirSpec, long long * dirIndex, const char ** name, + long * flags, long * time) +{ + const char * dirPath; + BVRef bvr; + + // Resolve the boot volume from the dir spec. + + if ((bvr = getBootVolumeRef(dirSpec, &dirPath)) == NULL) + return -1; + + // Return 0 on success, or -1 if there are no additional entries. + + return bvr->fs_getdirentry( bvr, + /* dirPath */ (char *)dirPath, + /* dirIndex */ dirIndex, + /* dirEntry */ (char **)name, flags, time, 0, 0 ); +} + +//========================================================================== +// GetFileInfo - LOW-LEVEL FILESYSTEM FUNCTION. +// Get attributes for the specified file. + +static char* gMakeDirSpec; + +long GetFileInfo(const char * dirSpec, const char * name, + long * flags, long * time) +{ + long long index = 0; + const char * entryName; + + if (gMakeDirSpec == 0) + gMakeDirSpec = (char *)malloc(1024); + + if (!dirSpec) { + long idx, len; + + len = strlen(name); + + for (idx = len; idx && (name[idx] != '/' && name[idx] != '\\'); idx--) {} + if (idx == 0) { + if(name[idx] == '/' || name[idx] == '\\') ++name; // todo: ensure other functions handel \ properly + gMakeDirSpec[0] = '/'; + gMakeDirSpec[1] = '\0'; + } else { + idx++; + strncpy(gMakeDirSpec, name, idx); + gMakeDirSpec[idx] = '\0'; + name += idx; + } + dirSpec = gMakeDirSpec; + } + + while (GetDirEntry(dirSpec, &index, &entryName, flags, time) == 0) + { + if (strcmp(entryName, name) == 0) + return 0; // success + } + return -1; // file not found +} + +long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock) +{ + const char * filePath; + BVRef bvr; + + // Resolve the boot volume from the file spec. + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) { + printf("Boot volume for '%s' is bogus\n", fileSpec); + return -1; + } + + return bvr->fs_getfileblock(bvr, (char *)filePath, firstBlock); +} + +//========================================================================== +// GetFreeFD() + +static int GetFreeFd(void) +{ + int fd; + + // Locate a free descriptor slot. + for (fd = 0; fd < NFILES; fd++) { + if (iob[fd].i_flgs == 0) { + return fd; + } + } + stop("Out of file descriptors"); + // not reached + return -1; +} + +//========================================================================== +// iob_from_fdesc() +// +// Return a pointer to an allocated 'iob' based on the file descriptor +// provided. Returns NULL if the file descriptor given is invalid. + +static struct iob * iob_from_fdesc(int fdesc) +{ + register struct iob * io; + + if (fdesc < 0 || fdesc >= NFILES || + ((io = &iob[fdesc])->i_flgs & F_ALLOC) == 0) + return NULL; + else + return io; +} + +//========================================================================== +// openmem() + +int openmem(char * buf, int len) +{ + int fdesc; + struct iob * io; + + fdesc = GetFreeFd(); + io = &iob[fdesc]; + bzero(io, sizeof(*io)); + + // Mark the descriptor as taken. Set the F_MEM flag to indicate + // that the file buffer is provided by the caller. + + io->i_flgs = F_ALLOC | F_MEM; + io->i_buf = buf; + io->i_filesize = len; + + return fdesc; +} + +//========================================================================== +// open() - Open the file specified by 'path' for reading. + +static int open_bvr(BVRef bvr, const char *filePath, int flags) +{ + struct iob *io; + int fdesc; + int i; + + if (bvr == NULL) { + return -1; + } + + fdesc = GetFreeFd(); + io = &iob[fdesc]; + bzero(io, sizeof(*io)); + + // Mark the descriptor as taken. + io->i_flgs = F_ALLOC; + + // Find the next available memory block in the download buffer. + io->i_buf = (char *) LOAD_ADDR; + for (i = 0; i < NFILES; i++) { + if ((iob[i].i_flgs != F_ALLOC) || (i == fdesc)) { + continue; + } + io->i_buf = MAX(iob[i].i_filesize + iob[i].i_buf, io->i_buf); + } + + // Load entire file into memory. Unnecessary open() calls must be avoided. + gFSLoadAddress = io->i_buf; + io->i_filesize = bvr->fs_loadfile(bvr, (char *)filePath); + if (io->i_filesize < 0) { + close(fdesc); + return -1; + } + return fdesc; +} + +int open(const char *path, int flags) +{ + const char *filepath; + BVRef bvr; + + // Resolve the boot volume from the file spec. + if ((bvr = getBootVolumeRef(path, &filepath)) != NULL) { + return open_bvr(bvr, filepath, flags); + } + return -1; +} + +int open_bvdev(const char *bvd, const char *path, int flags) +{ + const struct devsw *dp; + const char *cp; + BVRef bvr; + int i; + int len; + int unit; + int partition; + + if ((i = open(path, flags)) >= 0) { + return i; + } + + if (bvd == NULL || (len = strlen(bvd)) < 2) { + return -1; + } + + for (dp=devsw; dp->name; dp++) { + if (bvd[0] == dp->name[0] && bvd[1] == dp->name[1]) { + unit = 0; + partition = 0; + /* get optional unit and partition */ + if (len >= 5 && bvd[2] == '(') { /* min must be present xx(0) */ + cp = &bvd[3]; + i = 0; + while ((cp - path) < len && isdigit(*cp)) { + i = i * 10 + *cp++ - '0'; + unit = i; + } + if (*cp++ == ',') { + i = 0; + while ((cp - path) < len && isdigit(*cp)) { + i = i * 10 + *cp++ - '0'; + partition = i; + } + } + } + bvr = newBootVolumeRef(dp->biosdev + unit, partition); + return open_bvr(bvr, path, flags); + } + } + return -1; +} + +//========================================================================== +// close() - Close a file descriptor. + +int close(int fdesc) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + io->i_flgs = 0; + + return 0; +} + +//========================================================================== +// lseek() - Reposition the byte offset of the file descriptor from the +// beginning of the file. Returns the relocated offset. + +int b_lseek(int fdesc, int offset, int ptr) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + io->i_offset = offset; + + return offset; +} + +//========================================================================== +// tell() - Returns the byte offset of the file descriptor. + +int tell(int fdesc) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return 0; + + return io->i_offset; +} + +//========================================================================== +// read() - Read up to 'count' bytes of data from the file descriptor +// into the buffer pointed to by buf. + +int read(int fdesc, char * buf, int count) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + count) > (unsigned int)io->i_filesize) + count = io->i_filesize - io->i_offset; + + if (count <= 0) + return 0; // end of file + + bcopy(io->i_buf + io->i_offset, buf, count); + + io->i_offset += count; + + return count; +} + +//========================================================================== +// write() - Write up to 'count' bytes of data to the file descriptor +// from the buffer pointed to by buf. + +int write(int fdesc, const char * buf, int count) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + count) > (unsigned int)io->i_filesize) + count = io->i_filesize - io->i_offset; + + if (count <= 0) + return 0; // end of file + + bcopy(buf, io->i_buf + io->i_offset, count); + + io->i_offset += count; + + return count; +} + +int writebyte(int fdesc, char value) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + 1) > (unsigned int)io->i_filesize) + return 0; // end of file + + io->i_buf[io->i_offset++] = value; + + return 1; +} + +int writeint(int fdesc, int value) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + 4) > (unsigned int)io->i_filesize) + return 0; // end of file + + bcopy(&value, io->i_buf + io->i_offset, 4); + + io->i_offset += 4; + + return 4; +} + +//========================================================================== +// file_size() - Returns the size of the file described by the file +// descriptor. + +int file_size(int fdesc) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == 0) + return 0; + + return io->i_filesize; +} + +//========================================================================== + +struct dirstuff * vol_opendir(BVRef bvr, const char * path) +{ + struct dirstuff * dirp = 0; + + dirp = (struct dirstuff *) malloc(sizeof(struct dirstuff)); + if (dirp == NULL) + goto error; + + dirp->dir_path = newString(path); + if (dirp->dir_path == NULL) + goto error; + + dirp->dir_bvr = bvr; + + return dirp; + +error: + closedir(dirp); + return NULL; +} + +//========================================================================== + +struct dirstuff * opendir(const char * path) +{ + struct dirstuff * dirp = 0; + const char * dirPath; + BVRef bvr; + + if ((bvr = getBootVolumeRef(path, &dirPath)) == NULL) + goto error; + + dirp = (struct dirstuff *) malloc(sizeof(struct dirstuff)); + if (dirp == NULL) + goto error; + + dirp->dir_path = newString(dirPath); + if (dirp->dir_path == NULL) + goto error; + + dirp->dir_bvr = bvr; + + return dirp; + +error: + closedir(dirp); + return NULL; +} + +//========================================================================== + +int closedir(struct dirstuff * dirp) +{ + if (dirp) { + if (dirp->dir_path) free(dirp->dir_path); + free(dirp); + } + return 0; +} + +//========================================================================== + +int readdir(struct dirstuff * dirp, const char ** name, long * flags, + long * time) +{ + return dirp->dir_bvr->fs_getdirentry( dirp->dir_bvr, + /* dirPath */ dirp->dir_path, + /* dirIndex */ &dirp->dir_index, + /* dirEntry */ (char **)name, flags, time, + 0, 0); +} + +//========================================================================== + +int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, + long * time, FinderInfo *finderInfo, long *infoValid) +{ + return dirp->dir_bvr->fs_getdirentry( dirp->dir_bvr, + /* dirPath */ dirp->dir_path, + /* dirIndex */ &dirp->dir_index, + /* dirEntry */ (char **)name, + flags, time, + finderInfo, infoValid); +} + +//========================================================================== + +const char * systemConfigDir() +{ + if (gBootFileType == kNetworkDeviceType) + return ""; + return "/Library/Preferences/SystemConfiguration"; +} + +//========================================================================== + +int gBootFileType; + +void scanBootVolumes( int biosdev, int * count ) +{ + BVRef bvr = 0; + + bvr = diskScanBootVolumes(biosdev, count); + if (bvr == NULL) + { + bvr = nbpScanBootVolumes(biosdev, count); + if (bvr != NULL) + { + gBootFileType = kNetworkDeviceType; + } + } + else + { + gBootFileType = kBlockDeviceType; + } +} + +//========================================================================== + +void scanDisks(int biosdev, int *count) +{ + #define MAX_HDD_COUNT 32 + int bvCount; + int hd = 0; + + // Testing up to MAX_HDD_COUNT hard drives. + while(!testBiosread(0x80 + hd, 0) && hd < MAX_HDD_COUNT) + { + bvCount = 0; + scanBootVolumes(0x80 + hd, &bvCount); + hd++; + } + + // Also scanning CD/DVD drive. + if (biosDevIsCDROM(gBIOSDev)) + { + bvCount = 0; + scanBootVolumes(gBIOSDev, &bvCount); + } +} + +//========================================================================== + +BVRef selectBootVolume( BVRef chain ) +{ + bool filteredChain = false; + bool foundPrimary = false; + BVRef bvr, bvr1 = 0, bvr2 = 0; + + if (chain->filtered) filteredChain = true; + + if (multiboot_partition_set) + for ( bvr = chain; bvr; bvr = bvr->next ) + if ( bvr->part_no == multiboot_partition && bvr->biosdev == gBIOSDev ) + return bvr; + + /* + * Checking "Default Partition" key in system configuration - use format: hd(x,y), the volume UUID or label - + * to override the default selection. + * We accept only kBVFlagSystemVolume or kBVFlagForeignBoot volumes. + */ + char *val = XMLDecode(getStringForKey(kDefaultPartition, &bootInfo->chameleonConfig)); + if (val) { + for ( bvr = chain; bvr; bvr = bvr->next ) { + if (matchVolumeToString(bvr, val, false)) { + free(val); + return bvr; + } + } + free(val); + } + + /* + * Scannig the volume chain backwards and trying to find + * a HFS+ volume with valid boot record signature. + * If not found any active partition then we will + * select this volume as the boot volume. + */ + for ( bvr = chain; bvr; bvr = bvr->next ) + { + if (multiboot_skip_partition_set) { + if (bvr->part_no == multiboot_skip_partition) continue; + } + if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) foundPrimary = true; + // zhell -- Undo a regression that was introduced from r491 to 492. + // if gBIOSBootVolume is set already, no change is required + if ( bvr->flags & (kBVFlagBootable|kBVFlagSystemVolume) + && gBIOSBootVolume + && (!filteredChain || (filteredChain && bvr->visible)) + && bvr->biosdev == gBIOSDev ) + bvr2 = bvr; + // zhell -- if gBIOSBootVolume is NOT set, we use the "if" statement + // from r491, + if ( bvr->flags & kBVFlagBootable + && ! gBIOSBootVolume + && bvr->biosdev == gBIOSDev ) + bvr2 = bvr; + } + + + /* + * Use the standrad method for selecting the boot volume. + */ + if (foundPrimary) + { + for ( bvr = chain; bvr; bvr = bvr->next ) + { + if ( bvr->flags & kBVFlagNativeBoot && bvr->biosdev == gBIOSDev ) bvr1 = bvr; + if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) bvr2 = bvr; + } + } + + bvr = bvr2 ? bvr2 : + bvr1 ? bvr1 : chain; + + return bvr; +} + +//========================================================================== + +#define LP '(' +#define RP ')' +int gBIOSDev; + +/*! + This is like boot2's gBootVolume except it is for the internal use of + libsaio to track which volume an unqualified path should be relative to. + This replaces bootInfo->kernDev as the carrier of this information. + */ +static BVRef gRootVolume; + +void setRootVolume(BVRef volume) +{ + gRootVolume = volume; + // Veto non-native FS. Basically that means don't allow the root volume to + // be set to a volume we can't read files from. + if(gRootVolume != NULL && ((gRootVolume->flags & kBVFlagNativeBoot) == 0)) + gRootVolume = NULL; +} + +void setBootGlobals(BVRef chain) +{ + // Record default boot device. + gBootVolume = selectBootVolume(chain); + + // turbo - Save the ORIGINAL boot volume too for loading our mkext + if (!gBIOSBootVolume) gBIOSBootVolume = gBootVolume; + + setRootVolume(gBootVolume); +} + +/*! + Extracts the volume selector from the pathname, returns the selected + BVRef, and sets *outPath to the remainder of the path. + If the path did not include a volume selector then the current volume + is used. When called with a volume selector the current volume + is changed to the selected volume unless the volume selector is + that of a ramdisk. + */ +BVRef getBootVolumeRef( const char * path, const char ** outPath ) +{ + const char * cp; + BVRef bvr = gRootVolume; + int biosdev = gBIOSDev; + + // Search for left parenthesis in the path specification. + + for (cp = path; *cp; cp++) { + if (*cp == LP || *cp == '/') break; + } + + if (*cp != LP) // no left paren found + { + // Path is using the implicit current device so if there is + // no current device, then we must fail. + cp = path; + if ( gRootVolume == NULL ) + return NULL; + } + else if ((cp - path) == 2) // found "xx(" + { + const struct devsw * dp; + const char * xp = path; + int i; + int unit = -1; + int part = -1; + + cp++; + + // Check the 2 character device name pointed by 'xp'. + + for (dp = devsw; dp->name; dp++) + { + if ((xp[0] == dp->name[0]) && (xp[1] == dp->name[1])) + break; // found matching entry + } + if (dp->name == NULL) + { + error("Unknown device '%c%c'\n", xp[0], xp[1]); + return NULL; + } + + // Extract the optional unit number from the specification. + // hd(unit) or hd(unit, part). + + i = 0; + while (*cp >= '0' && *cp <= '9') + { + i = i * 10 + *cp++ - '0'; + unit = i; + } + + // Unit is no longer optional and never really was. + // If the user failed to specify it then the unit number from the previous kernDev + // would have been used which makes little sense anyway. + // For example, if the user did fd()/foobar and the current root device was the + // second hard disk (i.e. unit 1) then fd() would select the second floppy drive! + if(unit == -1) + return NULL; + + // Extract the optional partition number from the specification. + + if (*cp == ',') + part = atoi(++cp); + + // If part is not specified part will be -1 whereas before it would have been + // whatever the last partition was which makes about zero sense if the device + // has been switched. + + // Skip past the right paren. + + for ( ; *cp && *cp != RP; cp++) /* LOOP */; + if (*cp == RP) cp++; + + biosdev = dp->biosdev + unit; + bvr = newBootVolumeRef(biosdev, part); + + if(bvr == NULL) + return NULL; + } + else + { + // Bad device specifier, skip past the right paren. + + for ( cp++; *cp && *cp != RP; cp++) /* LOOP */; + if (*cp == RP) cp++; + // If gRootVolume was NULL, then bvr will be NULL as well which + // should be caught by the caller. + } + + // Returns the file path following the device spec. + // e.g. 'hd(1,b)mach_kernel' is reduced to 'mach_kernel'. + + *outPath = cp; + + return bvr; +} + +//========================================================================== +// Function name is a misnomer as scanBootVolumes usually calls diskScanBootVolumes +// which caches the information. So it's only allocated on the first run. +static BVRef newBootVolumeRef( int biosdev, int partno ) +{ + BVRef bvr, bvr1, bvrChain; + + bvr = bvr1 = NULL; + + // Try resolving "rd" and "bt" devices first. + if (biosdev == kPseudoBIOSDevRAMDisk) + { + if (gRAMDiskVolume) + bvr1 = gRAMDiskVolume; + } + else if (biosdev == kPseudoBIOSDevBooter) + { + if (gRAMDiskVolume != NULL && gRAMDiskBTAliased) + bvr1 = gRAMDiskVolume; + else + bvr1 = gBIOSBootVolume; + } + else + { + // Fetch the volume list from the device. + + scanBootVolumes( biosdev, NULL ); + bvrChain = getBVChainForBIOSDev(biosdev); + + // Look for a perfect match based on device and partition number. + + for ( bvr1 = NULL, bvr = bvrChain; bvr; bvr = bvr->next ) + { + if ( ( bvr->flags & kBVFlagNativeBoot ) == 0 ) continue; + + bvr1 = bvr; + if ( bvr->part_no == partno ) break; + } + } + + return bvr ? bvr : bvr1; +} + +//========================================================================== +// getDeviceDescription() - Extracts unit number and partition number +// from bvr structure into "dw(u,p)" format. +// Returns length of the out string +int getDeviceDescription(BVRef bvr, char *str) +{ + if(!str) + return 0; + + *str = '\0'; + + if (bvr) + { + const struct devsw *dp = devsw; + while(dp->name && bvr->biosdev >= dp->biosdev) + dp++; + + dp--; + if (dp->name) + return sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no); + } + + return 0; +} diff --git a/i386/libsaio/.svn/text-base/table.c.svn-base b/i386/libsaio/.svn/text-base/table.c.svn-base new file mode 100644 index 0000000..2e7da0f --- /dev/null +++ b/i386/libsaio/.svn/text-base/table.c.svn-base @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "memory.h" + +/* Segment Descriptor + * + * 31 24 19 16 7 0 + * ------------------------------------------------------------ + * | | |B| |A| | | |1|0|E|W|A| | + * | BASE 31..24 |G|/|0|V| LIMIT |P|DPL| TYPE | BASE 23:16 | + * | | |D| |L| 19..16| | |1|1|C|R|A| | + * ------------------------------------------------------------ + * | | | + * | BASE 15..0 | LIMIT 15..0 | + * | | | + * ------------------------------------------------------------ + */ + +struct seg_desc { + unsigned short limit_15_0; + unsigned short base_15_0; + unsigned char base_23_16; + unsigned char bit_15_8; + unsigned char bit_23_16; + unsigned char base_31_24; +}; + +// turbo - GDT must be in first 64k segment +struct seg_desc __attribute__ ((section("__INIT,__data"))) Gdt[ NGDTENT ] = { + /* 0x0 : null */ + {0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00}, + + /* 0x8 : boot protected mode 32-bit code segment + byte granularity, 1MB limit, MEMBASE offset */ + //{0xFFFF, MEMBASE, 0x00, 0x9E, 0x4F, 0x00}, + {0xFFFF, 0x0000, 0x00, 0x9E, 0xCF, 0x00}, + + /* 0x10 : boot protected mode data segment + page granularity, 4GB limit, MEMBASE offset */ + {0xFFFF, MEMBASE, 0x00, 0x92, 0xCF, 0x00}, + + /* 0x18 : boot protected mode 16-bit code segment + byte granularity, 1MB limit, MEMBASE offset */ + {0xFFFF, MEMBASE, 0x00, 0x9E, 0x0F, 0x00}, + + /* 0x20 : kernel init 32-bit data segment + page granularity, 4GB limit, zero offset */ + {0xFFFF, 0x0000, 0x00, 0x92, 0xCF, 0x00}, + + /* 0x28 : kernel init 32-bit code segment + page granularity, 4GB limit, zero offset */ + {0xFFFF, 0x0000, 0x00, 0x9E, 0xCF, 0x00}, + + /* 0x30 : boot real mode data/stack segment + byte granularity, 64K limit, MEMBASE offset, expand-up */ + {0xFFFF, MEMBASE, 0x00, 0x92, 0x00, 0x00}, +}; diff --git a/i386/libsaio/.svn/text-base/term.h.svn-base b/i386/libsaio/.svn/text-base/term.h.svn-base new file mode 100644 index 0000000..a89a1a7 --- /dev/null +++ b/i386/libsaio/.svn/text-base/term.h.svn-base @@ -0,0 +1,59 @@ +/* + * term.h + * Chameleon + * + * Created by JrCs on 30/08/11. + * Copyright 2011. All rights reserved. + * + */ + +#ifndef __LIBSAIO_TERM_H +#define __LIBSAIO_TERM_H + +#define ASCII_KEY_MASK 0x7f +#define ASCII_KEY(x) ((x & ASCII_KEY_MASK)) + +#define KEY_BKSP 0x0008 +#define KEY_TAB 0x0009 +#define KEY_ENTER 0x000d +#define KEY_ESC 0x001b +#define KEY_PRTSC 0x002a +#define KEY_LEFT 0x4b00 +#define KEY_RIGHT 0x4d00 +#define KEY_UP 0x4800 +#define KEY_DOWN 0x5000 +#define KEY_HOME 0x4700 +#define KEY_END 0x4f00 +#define KEY_CENTER 0x4c00 +#define KEY_INS 0x5200 +#define KEY_DEL 0x5300 +#define KEY_PGUP 0x4900 +#define KEY_PGDN 0x5100 +#define KEY_F1 0x3b00 +#define KEY_F2 0x3c00 +#define KEY_F3 0x3d00 +#define KEY_F4 0x3e00 +#define KEY_F5 0x3f00 +#define KEY_F6 0x4000 +#define KEY_F7 0x4100 +#define KEY_F8 0x4200 +#define KEY_F9 0x4300 +#define KEY_F10 0x4400 +#define KEY_F11 0x5700 +#define KEY_F12 0x5800 + +// Key code for input that shouldn't echoed back +#define KEY_NOECHO 0xff00 + +/* Bitmasks for modifier keys */ +#define STATUS_RSHIFT (1 << 0) +#define STATUS_LSHIFT (1 << 1) +#define STATUS_RCTRL (1 << 2) +#define STATUS_RALT (1 << 3) +#define STATUS_SCROLL (1 << 4) +#define STATUS_NUM (1 << 5) +#define STATUS_CAPS (1 << 6) +#define STATUS_LCTRL (1 << 8) +#define STATUS_LALT (1 << 9) + +#endif /* !__LIBSAIO_TERM_H */ diff --git a/i386/libsaio/.svn/text-base/ufs.h.svn-base b/i386/libsaio/.svn/text-base/ufs.h.svn-base new file mode 100644 index 0000000..3da8f65 --- /dev/null +++ b/i386/libsaio/.svn/text-base/ufs.h.svn-base @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern long UFSInitPartition(CICell ih); +extern long UFSLoadFile(CICell ih, char * filePath); +extern long UFSReadFile( CICell ih, char * filePath, void * base, uint64_t offset, uint64_t length ); +extern long UFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +extern void UFSGetDescription(CICell ih, char *str, long strMaxLen); +extern long UFSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); +extern long UFSGetUUID(CICell ih, char *uuidStr); +extern void UFSFree(CICell ih); + diff --git a/i386/libsaio/.svn/text-base/ufs_byteorder.h.svn-base b/i386/libsaio/.svn/text-base/ufs_byteorder.h.svn-base new file mode 100644 index 0000000..2e5f20f --- /dev/null +++ b/i386/libsaio/.svn/text-base/ufs_byteorder.h.svn-base @@ -0,0 +1,55 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * UFS byte swapping routines to make a big endian file system useful on a + * little endian machine. + * + * HISTORY + * + * 8 Jul 1992 Brian Pinkerton at NeXT + * Created. + */ + +#ifndef __LIBSAIO_UFS_BYTEORDER_H +#define __LIBSAIO_UFS_BYTEORDER_H + +//#include <sys/vnode.h> +#include <ufs/ffs/fs.h> +#include <sys/buf.h> +#include <sys/disk.h> +#include <ufs/ufs/dinode.h> +#include <ufs/ufs/dir.h> + +void byte_swap_ints(unsigned int *array, int count); +void byte_swap_shorts(unsigned short *array, int count); +void byte_swap_longlongs(unsigned long long *array, int count); + +void byte_swap_superblock(struct fs *sb); +void byte_swap_dinode_in(struct dinode *di); +void byte_swap_dir_block_in(char *addr, int count); +void byte_swap_inode_in(struct dinode *dc, struct dinode *ic); + +#endif /* !__LIBSAIO_UFS_BYTEORDER_H */ diff --git a/i386/libsaio/.svn/text-base/usb.c.svn-base b/i386/libsaio/.svn/text-base/usb.c.svn-base new file mode 100644 index 0000000..15534ca --- /dev/null +++ b/i386/libsaio/.svn/text-base/usb.c.svn-base @@ -0,0 +1,344 @@ +/* + * usb.c + * + * + * Created by mackerintel on 12/20/08. + * Copyright 2008 mackerintel. All rights reserved. + * + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" + +#ifndef DEBUG_USB +#define DEBUG_USB 0 +#endif + +#if DEBUG_USB +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + + +struct pciList +{ + pci_dt_t* pciDev; + struct pciList* next; +}; + +struct pciList* usbList = NULL; + +int legacy_off (pci_dt_t *pci_dev); +int ehci_acquire (pci_dt_t *pci_dev); +int uhci_reset (pci_dt_t *pci_dev); + +// Add usb device to the list +void notify_usb_dev(pci_dt_t *pci_dev) +{ + struct pciList* current = usbList; + if(!usbList) + { + usbList = (struct pciList*)malloc(sizeof(struct pciList)); + usbList->next = NULL; + usbList->pciDev = pci_dev; + + } + else + { + while(current != NULL && current->next != NULL) + { + current = current->next; + } + current->next = (struct pciList*)malloc(sizeof(struct pciList)); + current = current->next; + + current->pciDev = pci_dev; + current->next = NULL; + } +} + +// Loop through the list and call the apropriate patch function +int usb_loop() +{ + int retVal = 1; + bool fix_ehci, fix_uhci, fix_usb, fix_legacy; + fix_ehci = fix_uhci = fix_usb = fix_legacy = false; + + if (getBoolForKey(kUSBBusFix, &fix_usb, &bootInfo->chameleonConfig)) + { + fix_ehci = fix_uhci = fix_legacy = fix_usb; // Disable all if none set + } + else + { + getBoolForKey(kEHCIacquire, &fix_ehci, &bootInfo->chameleonConfig); + getBoolForKey(kUHCIreset, &fix_uhci, &bootInfo->chameleonConfig); + getBoolForKey(kLegacyOff, &fix_legacy, &bootInfo->chameleonConfig); + } + + struct pciList* current = usbList; + + while(current) + { + switch (pci_config_read8(current->pciDev->dev.addr, PCI_CLASS_PROG)) + { + // EHCI + case 0x20: + if(fix_ehci) retVal &= ehci_acquire(current->pciDev); + if(fix_legacy) retVal &= legacy_off(current->pciDev); + + break; + + // UHCI + case 0x00: + if (fix_uhci) retVal &= uhci_reset(current->pciDev); + + break; + } + + current = current->next; + } + return retVal; +} + +int legacy_off (pci_dt_t *pci_dev) +{ + // Set usb legacy off modification by Signal64 + // NOTE: This *must* be called after the last file is loaded from the drive in the event that we are booting form usb. + // NOTE2: This should be called after any getc()/getchar() call. (aka, after the Wait=y keyworkd is used) + // AKA: Make this run immediatly before the kernel is called + uint32_t capaddr, opaddr; + uint8_t eecp; + uint32_t usbcmd, usbsts, usbintr; + uint32_t usblegsup, usblegctlsts; + + int isOSowned; + int isBIOSowned; + + verbose("Setting Legacy USB Off on controller [%04x:%04x] at %02x:%2x.%x\n", + pci_dev->vendor_id, pci_dev->device_id, + pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func); + + + // capaddr = Capability Registers = dev.addr + offset stored in dev.addr + 0x10 (USBBASE) + capaddr = pci_config_read32(pci_dev->dev.addr, 0x10); + + // opaddr = Operational Registers = capaddr + offset (8bit CAPLENGTH in Capability Registers + offset 0) + opaddr = capaddr + *((unsigned char*)(capaddr)); + + // eecp = EHCI Extended Capabilities offset = capaddr HCCPARAMS bits 15:8 + eecp=*((unsigned char*)(capaddr + 9)); + + DBG("capaddr=%x opaddr=%x eecp=%x\n", capaddr, opaddr, eecp); + + usbcmd = *((unsigned int*)(opaddr)); // Command Register + usbsts = *((unsigned int*)(opaddr + 4)); // Status Register + usbintr = *((unsigned int*)(opaddr + 8)); // Interrupt Enable Register + + DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr); + + // read PCI Config 32bit USBLEGSUP (eecp+0) + usblegsup = pci_config_read32(pci_dev->dev.addr, eecp); + + // informational only + isBIOSowned = !!((usblegsup) & (1 << (16))); + isOSowned = !!((usblegsup) & (1 << (24))); + + // read PCI Config 32bit USBLEGCTLSTS (eecp+4) + usblegctlsts = pci_config_read32(pci_dev->dev.addr, eecp + 4); + + DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); + + // Reset registers to Legacy OFF + DBG("Clearing USBLEGCTLSTS\n"); + pci_config_write32(pci_dev->dev.addr, eecp + 4, 0); //usblegctlsts + + // if delay value is in milliseconds it doesn't appear to work. + // setting value to anything up to 65535 does not add the expected delay here. + delay(100); + + usbcmd = *((unsigned int*)(opaddr)); + usbsts = *((unsigned int*)(opaddr + 4)); + usbintr = *((unsigned int*)(opaddr + 8)); + + DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr); + + DBG("Clearing Registers\n"); + + // clear registers to default + usbcmd = (usbcmd & 0xffffff00); + *((unsigned int*)(opaddr)) = usbcmd; + *((unsigned int*)(opaddr + 8)) = 0; //usbintr - clear interrupt registers + *((unsigned int*)(opaddr + 4)) = 0x1000; //usbsts - clear status registers + pci_config_write32(pci_dev->dev.addr, eecp, 1); //usblegsup + + // get the results + usbcmd = *((unsigned int*)(opaddr)); + usbsts = *((unsigned int*)(opaddr + 4)); + usbintr = *((unsigned int*)(opaddr + 8)); + + DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr); + + // read 32bit USBLEGSUP (eecp+0) + usblegsup = pci_config_read32(pci_dev->dev.addr, eecp); + + // informational only + isBIOSowned = !!((usblegsup) & (1 << (16))); + isOSowned = !!((usblegsup) & (1 << (24))); + + // read 32bit USBLEGCTLSTS (eecp+4) + usblegctlsts = pci_config_read32(pci_dev->dev.addr, eecp + 4); + + DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); + + verbose("Legacy USB Off Done\n"); + return 1; +} + +int ehci_acquire (pci_dt_t *pci_dev) +{ + int j, k; + uint32_t base; + uint8_t eecp; + uint8_t legacy[8]; + bool isOwnershipConflict; + bool alwaysHardBIOSReset; + + alwaysHardBIOSReset = false; + if (!getBoolForKey(kEHCIhard, &alwaysHardBIOSReset, &bootInfo->chameleonConfig)) { + alwaysHardBIOSReset = true; + } + + pci_config_write16(pci_dev->dev.addr, 0x04, 0x0002); + base = pci_config_read32(pci_dev->dev.addr, 0x10); + + verbose("EHCI controller [%04x:%04x] at %02x:%2x.%x DMA @%x\n", + pci_dev->vendor_id, pci_dev->device_id, + pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func, + base); + + if (*((unsigned char*)base) < 0xc) + { + DBG("Config space too small: no legacy implementation\n"); + return 1; + } + eecp = *((unsigned char*)(base + 9)); + if (!eecp) { + DBG("No extended capabilities: no legacy implementation\n"); + return 1; + } + + DBG("eecp=%x\n",eecp); + + // bad way to do it + // pci_conf_write(pci_dev->dev.addr, eecp, 4, 0x01000001); + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + DBG("%02x ", legacy[j]); + } + DBG("\n"); + + //Real Job: based on orByte's AppleUSBEHCI.cpp + //We try soft reset first - some systems hang on reboot with hard reset + // Definitely needed during reboot on 10.4.6 + + isOwnershipConflict = (((legacy[3] & 1) != 0) && ((legacy[2] & 1) != 0)); + if (!alwaysHardBIOSReset && isOwnershipConflict) { + DBG("EHCI - Ownership conflict - attempting soft reset ...\n"); + DBG("EHCI - toggle OS Ownership to 0\n"); + pci_config_write8(pci_dev->dev.addr, eecp + 3, 0); + for (k = 0; k < 25; k++) { + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + if (legacy[3] == 0) { + break; + } + delay(10); + } + } + + DBG("Found USBLEGSUP_ID - value %x:%x - writing OSOwned\n", legacy[3],legacy[2]); + pci_config_write8(pci_dev->dev.addr, eecp + 3, 1); + + // wait for kEHCI_USBLEGSUP_BIOSOwned bit to clear + for (k = 0; k < 25; k++) { + for (j = 0;j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + DBG ("%x:%x,",legacy[3],legacy[2]); + if (legacy[2] == 0) { + break; + } + delay(10); + } + + for (j = 0;j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + isOwnershipConflict = ((legacy[2]) != 0); + if (isOwnershipConflict) { + // Soft reset has failed. Assume SMI being ignored + // Hard reset + // Force Clear BIOS BIT + DBG("EHCI - Ownership conflict - attempting hard reset ...\n"); + DBG ("%x:%x\n",legacy[3],legacy[2]); + DBG("EHCI - Force BIOS Ownership to 0\n"); + + pci_config_write8(pci_dev->dev.addr, eecp + 2, 0); + for (k = 0; k < 25; k++) { + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + DBG ("%x:%x,",legacy[3],legacy[2]); + + if ((legacy[2]) == 0) { + break; + } + delay(10); + } + // Disable further SMI events + for (j = 4; j < 8; j++) { + pci_config_write8(pci_dev->dev.addr, eecp + j, 0); + } + } + + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + + DBG ("%x:%x\n",legacy[3],legacy[2]); + + // Final Ownership Resolution Check... + if (legacy[2] & 1) { + DBG("EHCI controller unable to take control from BIOS\n"); + return 0; + } + + DBG("EHCI Acquire OS Ownership done\n"); + return 1; +} + +int uhci_reset (pci_dt_t *pci_dev) +{ + uint32_t base, port_base; + + base = pci_config_read32(pci_dev->dev.addr, 0x20); + port_base = (base >> 5) & 0x07ff; + + verbose("UHCI controller [%04x:%04x] at %02x:%2x.%x base %x(%x)\n", + pci_dev->vendor_id, pci_dev->device_id, + pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func, + port_base, base); + + pci_config_write16(pci_dev->dev.addr, 0xc0, 0x8f00); + + outw (port_base, 0x0002); + delay(10); + outw (port_base+4,0); + delay(10); + outw (port_base,0); + return 1; +} diff --git a/i386/libsaio/.svn/text-base/vbe.c.svn-base b/i386/libsaio/.svn/text-base/vbe.c.svn-base new file mode 100644 index 0000000..a1dc242 --- /dev/null +++ b/i386/libsaio/.svn/text-base/vbe.c.svn-base @@ -0,0 +1,310 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" +#include "vbe.h" + +/* + * Various inline routines for video I/O + */ +static inline void +outi (int port, int index, int val) +{ + outw (port, (val << 8) | index); +} + +static inline void +outib (int port, int index, int val) +{ + outb (port, index); + outb (port + 1, val); +} + +static inline int +ini (int port, int index) +{ + outb (port, index); + return inb (port + 1); +} + +static inline void +rmwi (int port, int index, int clear, int set) +{ + outb (port, index); + outb (port + 1, (inb (port + 1) & ~clear) | set); +} + +/* + * Globals + */ +static biosBuf_t bb; + +int getVBEInfo( void * infoBlock ) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetControllerInfo; + bb.es = SEG( infoBlock ); + bb.edi.rr = OFF( infoBlock ); + bios( &bb ); + return(bb.eax.r.h); +} + +int getVBEModeInfo( int mode, void * minfo_p ) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetModeInfo; + bb.ecx.rr = mode; + bb.es = SEG(minfo_p); + bb.edi.rr = OFF(minfo_p); + bios(&bb); + return(bb.eax.r.h); +} + +int getVBEDACFormat(unsigned char *format) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteFormat; + bb.ebx.r.l = subfuncGet; + bios(&bb); + *format = bb.ebx.r.h; + return(bb.eax.r.h); +} + +int setVBEDACFormat(unsigned char format) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteFormat; + bb.ebx.r.l = subfuncSet; + bb.ebx.r.h = format; + bios(&bb); + return(bb.eax.r.h); +} + +/* + * Default GTF parameter values. + */ +#define kCellGranularity 8.0 // character cell granularity +#define kMinVSyncPlusBP 550.0 // min VSync + BP interval (us) +#define kMinFrontPorch 1.0 // minimum front porch in lines(V)/cells(H) +#define kVSyncLines 3.0 // width of VSync in lines +#define kHSyncWidth 8.0 // HSync as a percent of total line width +#define kC 30.0 // C = (C'-J) * (K/256) + J +#define kM 300.0 // M = K/256 * M' + +int Round(double f) +{ + return (int)(f + 0.5); +} + +/* + * from http://www.azillionmonkeys.com/qed/sqroot.html + */ + +double Sqrt( double y ) +{ + double x, z, tempf; + unsigned long *tfptr = ((unsigned long *)&tempf) + 1; + + tempf = y; + *tfptr = (0xbfcdd90a - *tfptr)>>1; /* estimate of 1/sqrt(y) */ + x = tempf; + z = y*0.5; /* hoist out the “/2” */ + x = (1.5*x) - (x*x)*(x*z); /* iteration formula */ + x = (1.5*x) - (x*x)*(x*z); + x = (1.5*x) - (x*x)*(x*z); + x = (1.5*x) - (x*x)*(x*z); + x = (1.5*x) - (x*x)*(x*z); + return x*y; +} + +int generateCRTCTiming( unsigned short width, + unsigned short height, + unsigned long paramValue, + int paramType, + VBECRTCInfoBlock * timing ) +{ + double h_period_est, h_freq, h_period, h_total_pixels, h_sync_pixels; + double h_active_pixels, h_ideal_duty_cycle, h_blank_pixels, pixel_freq = 0; + double v_sync_plus_bp = 0, v_total_lines = 0, v_field_rate_est, v_frame_rate = 0; + const double h_pixels = (double) width; + const double v_lines = (double) height; + + enum { + left_margin_pixels = 0, + right_margin_pixels = 0, + top_margin_lines = 0, + bot_margin_lines = 0, + interlace = 0 + }; + + // Total number of active pixels in image and both margins + h_active_pixels = h_pixels + left_margin_pixels + right_margin_pixels; + + if (paramType == kCRTCParamPixelClock) + { + // Pixel clock provided in MHz + pixel_freq = (double) paramValue / 1000000; + + // Ideal horizontal period from the blanking duty cycle equation + h_period = ((kC - 100) + (Sqrt(((100 - kC) * (100 - kC)) + (0.4 * kM * + (h_active_pixels + right_margin_pixels + left_margin_pixels) / + pixel_freq)))) / 2.0 / kM * 1000; + } + else /* kCRTCParamRefreshRate */ + { + double v_field_rate_in = (double) paramValue; + + // Estimate the horizontal period + h_period_est = ((1 / v_field_rate_in) - kMinVSyncPlusBP / 1000000) / + (v_lines + (2 * top_margin_lines) + kMinFrontPorch + interlace) * + 1000000; + + // Number of lines in Vsync + back porch + v_sync_plus_bp = Round(kMinVSyncPlusBP / h_period_est); + + // Total number of lines in Vetical field period + v_total_lines = v_lines + top_margin_lines + bot_margin_lines + + v_sync_plus_bp + interlace + kMinFrontPorch; + + // Estimate the vertical field frequency + v_field_rate_est = 1 / h_period_est / v_total_lines * 1000000; + + // Find the actual horizontal period + h_period = h_period_est / (v_field_rate_in / v_field_rate_est); + + // Find the vertical frame rate (no interlace) + v_frame_rate = 1 / h_period / v_total_lines * 1000000; + } + + // Ideal blanking duty cycle from the blanking duty cycle equation + h_ideal_duty_cycle = kC - (kM * h_period / 1000); + + // Number of pixels in the blanking time to the nearest double character cell + h_blank_pixels = Round(h_active_pixels * h_ideal_duty_cycle / + (100 - h_ideal_duty_cycle) / (2 * kCellGranularity)) * + (2 * kCellGranularity); + + // Total number of horizontal pixels + h_total_pixels = h_active_pixels + h_blank_pixels; + + if (paramType == kCRTCParamPixelClock) + { + // Horizontal frequency + h_freq = pixel_freq / h_total_pixels * 1000; + + // Number of lines in V sync + back porch + v_sync_plus_bp = Round(kMinVSyncPlusBP * h_freq / 1000); + + // Total number of lines in vertical field period + v_total_lines = v_lines + top_margin_lines + bot_margin_lines + + interlace + v_sync_plus_bp + kMinFrontPorch; + + // Vertical frame frequency + v_frame_rate = Round(h_freq / v_total_lines * 1000); + } + else + { + // Find pixel clock frequency + pixel_freq = Round(h_total_pixels / h_period); + } + + h_sync_pixels = Round(h_total_pixels * kHSyncWidth / 100 / kCellGranularity) * + kCellGranularity; + + timing->HTotal = h_total_pixels; + timing->HSyncStart = h_active_pixels + (h_blank_pixels / 2) - h_sync_pixels; + timing->HSyncEnd = timing->HSyncStart + h_sync_pixels; + timing->VTotal = v_total_lines; + timing->VSyncStart = v_total_lines - v_sync_plus_bp; + timing->VSyncEnd = timing->VSyncStart + kVSyncLines; + timing->Flags = kCRTCNegativeHorizontalSync; + timing->PixelClock = pixel_freq * 1000000; + timing->RefreshRate = v_frame_rate * 100; + + return 0; +} + +int setVBEMode(unsigned short mode, const VBECRTCInfoBlock * timing) +{ + bb.intno = 0x10; + bb.eax.rr = funcSetMode; + bb.ebx.rr = mode; + if (timing) { + bb.es = SEG(timing); + bb.edi.rr = OFF(timing); + } + bios(&bb); + return(bb.eax.r.h); +} + +int setVBEPalette(void *palette) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteData; + bb.ebx.r.l = subfuncSet; + bb.ecx.rr = 256; + bb.edx.rr = 0; + bb.es = SEG(palette); + bb.edi.rr = OFF(palette); + bios(&bb); + return(bb.eax.r.h); +} + +int getVBEPalette(void *palette) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteData; + bb.ebx.r.l = subfuncGet; + bb.ecx.rr = 256; + bb.edx.rr = 0; + bb.es = SEG(palette); + bb.edi.rr = OFF(palette); + bios(&bb); + return(bb.eax.r.h); +} + +int getVBECurrentMode(unsigned short *mode) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetCurrentMode; + bios(&bb); + *mode = bb.ebx.rr; + return(bb.eax.r.h); +} + +int getVBEPixelClock(unsigned short mode, unsigned long * pixelClock) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPixelClock; + bb.ebx.r.l = 0; + bb.ecx.rx = *pixelClock; + bb.edx.rr = mode; + bios(&bb); + *pixelClock = bb.ecx.rx; + return(bb.eax.r.h); +} diff --git a/i386/libsaio/.svn/text-base/vbe.h.svn-base b/i386/libsaio/.svn/text-base/vbe.h.svn-base new file mode 100644 index 0000000..0f37ffb --- /dev/null +++ b/i386/libsaio/.svn/text-base/vbe.h.svn-base @@ -0,0 +1,286 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +// Copyright 1997 by Apple Computer, Inc., all rights reserved. +/* Copyright 1996-1997 NeXT Software, Inc. + * + * vesa.h - mode info obtained via int10 + * + * Revision History + * ---------------- + * 30 Jul 1996 Doug Mitchell at NeXT + * Created. + */ + +#ifndef __LIBSAIO_VBE_H +#define __LIBSAIO_VBE_H + +#define MIN_VESA_VERSION 0x200 + +#define SEG(address) \ + ((unsigned short)(((unsigned long)address & 0xffff0000) >> 4)) + +#define OFF(address) \ + ((unsigned short)((unsigned long)address & 0x0000ffff)) + +#define VBEMakeUInt32(x) \ + (((unsigned long)x##_high << 24) | \ + ((unsigned long)x##_2 << 16) | \ + ((unsigned long)x##_1 << 8) | \ + (unsigned long)x##_low) + +#define VBEDecodeFP(t, fp) \ + ((t)(((fp ## _low) | ((fp ## _1 ) << 8)) + \ + (((fp ## _2) << 4) | ((fp ## _high ) << 12)))) + +/* + * Functions + */ +enum { + funcGetControllerInfo = 0x4F00, + funcGetModeInfo = 0x4F01, + funcSetMode = 0x4F02, + funcGetCurrentMode = 0x4F03, + funcSaveRestoreState = 0x4F04, + funcWindowControl = 0x4F05, + funcGetSetScanLineLength = 0x4F06, + funcGetSetDisplayStart = 0x4F07, + funcGetSetPaletteFormat = 0x4F08, + funcGetSetPaletteData = 0x4F09, + funcGetProtModeInterdace = 0x4F0A, + funcGetSetPixelClock = 0x4F0B +}; + +enum { + subfuncSet = 0x00, + subfuncGet = 0x01, + subfuncSetSecondary = 0x02, + subfuncGetSecondary = 0x03 +}; + +/* + * errors. + */ +enum { + errSuccess = 0, + errFuncFailed = 1, + errFuncNotSupported = 2, + errFuncInvalid = 3 +}; + +/* + * Per-controller info, returned in function 4f00. + */ +typedef struct { + unsigned char VESASignature[4]; + unsigned short VESAVersion; + /* + * Avoid packing problem... + */ + unsigned char OEMStringPtr_low; + unsigned char OEMStringPtr_1; + unsigned char OEMStringPtr_2; + unsigned char OEMStringPtr_high; + unsigned char Capabilities_low; + unsigned char Capabilities_1; + unsigned char Capabilities_2; + unsigned char Capabilities_high; + unsigned char VideoModePtr_low; + unsigned char VideoModePtr_1; + unsigned char VideoModePtr_2; + unsigned char VideoModePtr_high; + unsigned short TotalMemory; + unsigned char Reserved[236]; + unsigned char OEMData[256]; +} VBEInfoBlock; + +/* + * Capabilites + */ +enum { + capDACWidthIsSwitchableBit = (1 << 0), /* 1 = yes; 0 = no */ + capControllerIsNotVGACompatableBit = (1 << 1), /* 1 = no; 0 = yes */ + capOldRAMDAC = (1 << 2) /* 1 = yes; 0 = no */ +}; + +/* + * Per-mode info, returned in function 4f02. + */ +typedef struct { + unsigned short ModeAttributes; + unsigned char WinAAttributes; + unsigned char WinBAttributes; + unsigned short WinGranularity; + unsigned short WinSize; + unsigned short WinASegment; + unsigned short WinABegment; + void * WinFuncPtr; + unsigned short BytesPerScanline; + unsigned short XResolution; + unsigned short YResolution; + unsigned char XCharSize; + unsigned char YCharSize; + unsigned char NumberOfPlanes; + unsigned char BitsPerPixel; + unsigned char NumberOfBanks; + unsigned char MemoryModel; + unsigned char BankSize; + unsigned char NumberOfImagePages; + unsigned char Reserved; + unsigned char RedMaskSize; + unsigned char RedFieldPosition; + unsigned char GreenMaskSize; + unsigned char GreenFieldPosition; + unsigned char BlueMaskSize; + unsigned char BlueFieldPosition; + unsigned char RsvdMaskSize; + unsigned char RsvdFieldPosition; + unsigned char DirectColorModeInfo; + unsigned char PhysBasePtr_low; + unsigned char PhysBasePtr_1; + unsigned char PhysBasePtr_2; + unsigned char PhysBasePtr_high; + void * OffScreenMemOffset; + unsigned short OffScreenMemSize; + unsigned char Reserved1[206]; +} VBEModeInfoBlock; + +/* + * ModeAttributes bits + */ +enum { + maModeIsSupportedBit = (1 << 0), /* mode is supported */ + maExtendedInfoAvailableBit = (1 << 1), /* extended info available */ + maOutputFuncSupportedBit = (1 << 2), /* output functions supported */ + maColorModeBit = (1 << 3), /* 1 = color; 0 = mono */ + maGraphicsModeBit = (1 << 4), /* 1 = graphics; 0 = text */ + maModeIsNotVGACompatableBit = (1 << 5), /* 1 = not compat; 0 = compat */ + maVGAMemoryModeNotAvailBit = (1 << 6), /* 1 = not avail; 0 = avail */ + maLinearFrameBufferAvailBit = (1 << 7) /* 1 = avail; 0 = not avail */ +}; + +/* + * Modes + */ +enum { + mode640x400x256 = 0x100, + mode640x480x256 = 0x101, + mode800x600x16 = 0x102, + mode800x600x256 = 0x103, + mode1024x768x16 = 0x104, + mode1024x768x256 = 0x105, + mode1280x1024x16 = 0x106, + mode1280x1024x256 = 0x107, + mode80Cx60R = 0x108, + mode132Cx25R = 0x109, + mode132Cx43R = 0x10A, + mode132Cx50R = 0x10B, + mode132Cx60R = 0x10C, + mode320x200x555 = 0x10D, + mode320x200x565 = 0x10E, + mode320x200x888 = 0x10F, + mode640x480x555 = 0x110, + mode640x480x565 = 0x111, + mode640x480x888 = 0x112, + mode800x600x555 = 0x113, + mode800x600x565 = 0x114, + mode800x600x888 = 0x115, + mode1024x768x555 = 0x116, + mode1024x768x565 = 0x117, + mode1024x768x888 = 0x118, + mode1280x1024x555 = 0x119, + mode1280x1024x565 = 0x11A, + mode1280x1024x888 = 0x11B, + modeSpecial = 0x81FF, + modeEndOfList = 0xFFFF +}; + +/* + * Get/Set VBE Mode parameters + */ +enum { + kCustomRefreshRateBit = (1 << 11), + kLinearFrameBufferBit = (1 << 14), + kPreserveMemoryBit = (1 << 15) +}; + +/* + * CRTC information block passed to function 4F02 + * to override default refresh rate. + */ +#pragma pack(1) + +typedef struct { + unsigned short HTotal; + unsigned short HSyncStart; + unsigned short HSyncEnd; + unsigned short VTotal; + unsigned short VSyncStart; + unsigned short VSyncEnd; + unsigned char Flags; + unsigned long PixelClock; /* in Hz */ + unsigned short RefreshRate; /* units of 0.01 Hz */ + unsigned char Reserved[40]; +} VBECRTCInfoBlock; + +#pragma pack() + +/* + * Defined flags for 'Flags' field in VBECRTCInfoBlock. + */ +enum { + kCRTCDoubleScannedMode = (1 << 0), + kCRTCInterlacedMode = (1 << 1), + kCRTCNegativeHorizontalSync = (1 << 2), + kCRTCNegativeVerticalSync = (1 << 3) +}; + +/* + * The type of paramter passed to generateCRTCTimings(). + */ +enum { + kCRTCParamRefreshRate, + kCRTCParamPixelClock +}; + +/* + * Palette + */ +typedef unsigned long VBEPalette[256]; + +extern int getVBEInfo(void *vinfo_p); +extern int getVBEModeInfo(int mode, void *minfo_p); +extern int getVBEDACFormat(unsigned char *format); +extern int setVBEDACFormat(unsigned char format); +extern int setVBEPalette(void *palette); +extern int getVBEPalette(void *palette); +extern int setVBEMode(unsigned short mode, const VBECRTCInfoBlock *timing); +extern int getVBECurrentMode(unsigned short *mode); +extern int getVBEPixelClock(unsigned short mode, unsigned long *pixelClock); +extern int generateCRTCTiming(unsigned short width, + unsigned short height, + unsigned long paramValue, + int paramType, + VBECRTCInfoBlock * timing); + +#endif /* !__LIBSAIO_VBE_H */ diff --git a/i386/libsaio/.svn/text-base/xml.c.svn-base b/i386/libsaio/.svn/text-base/xml.c.svn-base new file mode 100644 index 0000000..d1bdc85 --- /dev/null +++ b/i386/libsaio/.svn/text-base/xml.c.svn-base @@ -0,0 +1,1243 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights + * Reserved. + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "bootstruct.h" +#include "libsaio.h" +#include "sl.h" +#include "xml.h" + +string_ref *ref_strings = NULL; + +/// TODO: remove below +static char* buffer_start = NULL; +// TODO: redo the next two functions +void SaveRefString(char* string, int id) +{ + //printf("Adding Ref String %d (%s)\n", id, string); + string_ref* tmp = ref_strings; + while(tmp) + { + if(tmp->id == id) + { + tmp->string = malloc(strlen(string)+1); + sprintf(tmp->string, "%s", string); + return; + } + tmp = tmp->next; + } + + string_ref* new_ref = malloc(sizeof(string_ref)); + new_ref->string = malloc(strlen(string)+1); + sprintf(new_ref->string, "%s", string); + new_ref->id = id; + new_ref->next = ref_strings; + ref_strings = new_ref; +} + +char* GetRefString(int id) +{ + string_ref* tmp = ref_strings; + while(tmp) + { + if(tmp->id == id) return tmp->string; + tmp = tmp->next; + } + //verbose("Unable to locate Ref String %d\n", id); + return ""; +} + +struct Module { + struct Module *nextModule; + long willLoad; + TagPtr dict; + char *plistAddr; + long plistLength; + char *driverPath; +}; +typedef struct Module Module, *ModulePtr; + +struct DriverInfo { + char *plistAddr; + long plistLength; + void *moduleAddr; + long moduleLength; +}; +typedef struct DriverInfo DriverInfo, *DriverInfoPtr; + +#define kDriverPackageSignature1 'MKXT' +#define kDriverPackageSignature2 'MOSX' + +struct DriversPackage { + unsigned long signature1; + unsigned long signature2; + unsigned long length; + unsigned long adler32; + unsigned long version; + unsigned long numDrivers; + unsigned long reserved1; + unsigned long reserved2; +}; +typedef struct DriversPackage DriversPackage; + +enum { + kCFBundleType2, + kCFBundleType3 +}; + + +#define DOFREE 1 + +static long ParseTagList(char *buffer, TagPtr *tag, long type, long empty); +static long ParseTagKey(char *buffer, TagPtr *tag); +static long ParseTagString(char *buffer, TagPtr *tag); +static long ParseTagInteger(char *buffer, TagPtr *tag); +static long ParseTagData(char *buffer, TagPtr *tag); +static long ParseTagDate(char *buffer, TagPtr *tag); +static long GetNextTag(char *buffer, char **tag, long *start); +static long FixDataMatchingTag(char *buffer, char *tag); +static TagPtr NewTag(void); +static char *NewSymbol(char *string); +#if DOFREE +static void FreeSymbol(char *string); +#endif + + +//========================================================================== +// XMLGetProperty + +TagPtr +XMLGetProperty( TagPtr dict, const char * key ) +{ + TagPtr tagList, tag; + + if (dict->type != kTagTypeDict) return 0; + + tag = 0; + tagList = dict->tag; + while (tagList) + { + tag = tagList; + tagList = tag->tagNext; + + if ((tag->type != kTagTypeKey) || (tag->string == 0)) continue; + + if (!strcmp(tag->string, key)) return tag->tag; + } + + return 0; +} + +//========================================================================== +// XMLGetProperty + +TagPtr +XMLGetKey( TagPtr dict, int id ) +{ + TagPtr tagList, tag; + + if (dict->type != kTagTypeDict) return 0; + + tag = 0; + int element = 0; + tagList = dict->tag; + while (tagList && element != id) + { + tag = tagList; + tagList = tag->tagNext; + + if ((tag->type != kTagTypeKey) || (tag->string == 0)) continue; + element++; + if(id == element) return tag; + } + return 0; +} + +TagPtr XMLGetValueForKey(TagPtr key) +{ + if (!key || + key->type != kTagTypeKey) return 0; + + return key->tag; +} + + +// XMLGetTag(int index) + +// XMLTagCount( TagPtr dict ) +int XMLTagCount( TagPtr dict ) +{ + int count = 0; + TagPtr tagList, tag; + + if (dict->type != kTagTypeDict && dict->type != kTagTypeArray) return 0; + tag = 0; + tagList = dict->tag; + while (tagList) + { + tag = tagList; + tagList = tag->tagNext; + + if (((tag->type != kTagTypeKey) && ((tag->string == 0) || (tag->string[0] == 0))) + && (dict->type != kTagTypeArray) // If we are an array, any element is valid + ) continue; + + //if(tag->type == kTagTypeKey) printf("Located key %s\n", tag->string); + + count++; + } + + return count; +} + +TagPtr XMLGetElement( TagPtr dict, int id ) +{ + if(dict->type != kTagTypeArray) return 0; + + int element = 0; + TagPtr tmp = dict->tag; + + while(element < id) + { + element++; + tmp = tmp->tagNext; + } + + return tmp; +} +/* Function for basic XML character entities parsing */ + +char* +XMLDecode(const char* src) +{ + typedef const struct XMLEntity { + const char* name; + size_t nameLen; + char value; + } XMLEntity; + + /* This is ugly, but better than specifying the lengths by hand */ + #define _e(str,c) {str,sizeof(str)-1,c} + const XMLEntity ents[] = { + _e("quot;",'"'), _e("apos;",'\''), + _e("lt;", '<'), _e("gt;", '>'), + _e("amp;", '&') + }; + + size_t len; + const char *s; + char *out, *o; + + if ( !src || !(len = strlen(src)) || !(out = malloc(len+1)) ) + return 0; + + o = out; + s = src; + while (s <= src+len) /* Make sure the terminator is also copied */ + { + if ( *s == '&' ) + { + bool entFound = false; + int i; + + s++; + for ( i = 0; i < sizeof(ents)/sizeof(ents[0]); i++) + { + if ( strncmp(s, ents[i].name, ents[i].nameLen) == 0 ) + { + entFound = true; + break; + } + } + if ( entFound ) + { + *o++ = ents[i].value; + s += ents[i].nameLen; + continue; + } + } + + *o++ = *s++; + } + + return out; +} + +//#if UNUSED +//========================================================================== +// XMLParseFile +// Expects to see one dictionary in the XML file, the final pos will be returned +// If the pos is not equal to the strlen, then there are multiple dicts +// Puts the first dictionary it finds in the +// tag pointer and returns the end of the dic, or returns -1 if not found. +// +long +XMLParseFile( char * buffer, TagPtr * dict ) +{ + long length, pos; + TagPtr tag; + pos = 0; + char *configBuffer; + + int strlength = strlen(buffer); + configBuffer = malloc(strlength+1); + bcopy(buffer, configBuffer, strlength); + configBuffer[strlength] = 0; + + buffer_start = configBuffer; + + while (1) + { + length = XMLParseNextTag(configBuffer + pos, &tag); + if (length == -1) break; + + pos += length; + + if (tag == 0) continue; + if (tag->type == kTagTypeDict) break; + + XMLFreeTag(tag); + } + free(configBuffer); + if (length < 0) { + return -1; + } + *dict = tag; + return pos; +} +//#endif /* UNUSED */ + +//========================================================================== +// ParseNextTag +// TODO: cleanup +long +XMLParseNextTag( char * buffer, TagPtr * tag ) +{ + long length, pos; + char * tagName; + + length = GetNextTag(buffer, &tagName, 0); + if (length == -1) return -1; + + pos = length; + if (!strncmp(tagName, kXMLTagPList, 6)) + { + length = 0; + } + /***** dict ****/ + else if (!strcmp(tagName, kXMLTagDict)) + { + length = ParseTagList(buffer + pos, tag, kTagTypeDict, 0); + } + else if (!strncmp(tagName, kXMLTagDict, strlen(kXMLTagDict)) && tagName[strlen(tagName)-1] == '/') + { + length = ParseTagList(buffer + pos, tag, kTagTypeDict, 1); + } + else if (!strncmp(tagName, kXMLTagDict " ", strlen(kXMLTagDict " "))) + { + length = ParseTagList(buffer + pos, tag, kTagTypeDict, 0); + } + /***** key ****/ + else if (!strcmp(tagName, kXMLTagKey)) + { + length = ParseTagKey(buffer + pos, tag); + } + + /***** string ****/ + else if (!strcmp(tagName, kXMLTagString)) + { + length = ParseTagString(buffer + pos, tag); + } + else if (!strncmp(tagName, kXMLTagString " ", strlen(kXMLTagString " "))) + { + // TODO: save tag if if found + if(!strncmp(tagName + strlen(kXMLTagString " "), kXMLStringID, strlen(kXMLStringID))) + { + // ID= + int id = 0; + int cnt = strlen(kXMLTagString " " kXMLStringID "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagString " " kXMLStringID "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseStringID error (0x%x)\n", *val); + getchar(); + return -1; + } + } + length = ParseTagString(buffer + pos, tag); + + SaveRefString(buffer + pos, id); + } + else if(!strncmp(tagName + strlen(kXMLTagString " "), kXMLStringIDRef, strlen(kXMLStringIDRef))) + { + // IDREF= + int id = 0; + int cnt = strlen(kXMLTagString " " kXMLStringIDRef "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagString " " kXMLStringIDRef "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseStringIDREF error (0x%x)\n", *val); + getchar(); + return -1; + } + } + char* str = GetRefString(id); + + TagPtr tmpTag = NewTag(); + tmpTag->type = kTagTypeString; + tmpTag->string = str; + tmpTag->tag = 0; + tmpTag->tagNext = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start + pos : 0; + *tag = tmpTag; + + length = 0; + //printf("Located IDREF, id = %d, string = %s\n", id, str); + } + } + + /***** integer ****/ + else if (!strcmp(tagName, kXMLTagInteger)) + { + length = ParseTagInteger(buffer + pos, tag); + } + else if (!strncmp(tagName, kXMLTagInteger " ", strlen(kXMLTagInteger " "))) + { + if(!strncmp(tagName + strlen(kXMLTagInteger " "), kXMLStringID, strlen(kXMLStringID))) + { + // ID= + int id = 0; + int cnt = strlen(kXMLTagInteger " " kXMLStringID "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagInteger " " kXMLStringID "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseIntegerID error (0x%x)\n", *val); + getchar(); + return -1; + } + } + length = ParseTagInteger(buffer + pos, tag); + + SaveRefString((*tag)->string, id); + } + else if(!strncmp(tagName + strlen(kXMLTagInteger " "), kXMLStringIDRef, strlen(kXMLStringIDRef))) + { + // IDREF= + int id = 0; + int cnt = strlen(kXMLTagInteger " " kXMLStringIDRef "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagInteger " " kXMLStringIDRef "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseStringIDREF error (0x%x)\n", *val); + getchar(); + return -1; + } + } + int integer = (int)GetRefString(id); + + TagPtr tmpTag = NewTag(); + tmpTag->type = kTagTypeInteger; + tmpTag->string = (char*) integer; + tmpTag->tag = 0; + tmpTag->tagNext = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start + pos : 0; + + *tag = tmpTag; + + length = 0; + //printf("Located IDREF, id = %d, string = %s\n", id, str); + } + else + { + length = ParseTagInteger(buffer + pos, tag); + } + } + + /***** data ****/ + else if (!strcmp(tagName, kXMLTagData)) + { + length = ParseTagData(buffer + pos, tag); + } + else if (!strncmp(tagName, kXMLTagData " ", strlen(kXMLTagData " "))) + { + length = ParseTagData(buffer + pos, tag); + } + else if (!strcmp(tagName, kXMLTagDate)) + { + length = ParseTagDate(buffer + pos, tag); + } + + /***** date ****/ + else if (!strncmp(tagName, kXMLTagDate " ", strlen(kXMLTagDate " "))) + { + length = ParseTagDate(buffer + pos, tag); + } + + /***** false ****/ + else if (!strcmp(tagName, kXMLTagFalse)) + { + length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse); + } + /***** true ****/ + else if (!strcmp(tagName, kXMLTagTrue)) + { + length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue); + } + + /***** array ****/ + else if (!strcmp(tagName, kXMLTagArray)) + { + length = ParseTagList(buffer + pos, tag, kTagTypeArray, 0); + } + else if (!strncmp(tagName, kXMLTagArray " ", strlen(kXMLTagArray " "))) + { + length = ParseTagList(buffer + pos, tag, kTagTypeArray, 0); + } + else if (!strcmp(tagName, kXMLTagArray "/")) + { + length = ParseTagList(buffer + pos, tag, kTagTypeArray, 1); + } + + /***** unknown ****/ + else + { + *tag = 0; + length = 0; + } + + if (length == -1) return -1; + + return pos + length; +} + +//========================================================================== +// ParseTagList + +static long +ParseTagList( char * buffer, TagPtr * tag, long type, long empty ) +{ + long length, pos; + TagPtr tagList, tmpTag; + + tagList = 0; + pos = 0; + + if (!empty) + { + while (1) + { + length = XMLParseNextTag(buffer + pos, &tmpTag); + if (length == -1) break; + + pos += length; + + if (tmpTag == 0) break; + tmpTag->tagNext = tagList; + tagList = tmpTag; + } + + if (length == -1) + { + XMLFreeTag(tagList); + return -1; + } + } + + tmpTag = NewTag(); + if (tmpTag == 0) + { + XMLFreeTag(tagList); + return -1; + } + + tmpTag->type = type; + tmpTag->string = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start : 0; + tmpTag->tag = tagList; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return pos; +} + +//========================================================================== +// ParseTagKey + +static long +ParseTagKey( char * buffer, TagPtr * tag ) +{ + long length, length2; + char *string; + TagPtr tmpTag, subTag; + + length = FixDataMatchingTag(buffer, kXMLTagKey); + if (length == -1) return -1; + + length2 = XMLParseNextTag(buffer + length, &subTag); + if (length2 == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) + { + XMLFreeTag(subTag); + return -1; + } + + string = NewSymbol(buffer); + if (string == 0) + { + XMLFreeTag(subTag); + XMLFreeTag(tmpTag); + return -1; + } + + tmpTag->type = kTagTypeKey; + tmpTag->string = string; + tmpTag->tag = subTag; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length + length2; +} + +//========================================================================== +// ParseTagString + +static long +ParseTagString( char * buffer, TagPtr * tag ) +{ + long length; + char * string; + + length = FixDataMatchingTag(buffer, kXMLTagString); + if (length == -1) return -1; + + TagPtr tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + string = NewSymbol(buffer); + if (string == 0) + { + XMLFreeTag(tmpTag); + return -1; + } + + tmpTag->type = kTagTypeString; + tmpTag->string = string; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + return length; +} + +//========================================================================== +// ParseTagInteger + +static long +ParseTagInteger( char * buffer, TagPtr * tag ) +{ + long length, integer; + bool negative = false; + TagPtr tmpTag; + char* val = buffer; + int size; + + if(buffer[0] == '<') + { + printf("Warning integer is non existant\n"); + getchar(); + tmpTag = NewTag(); + tmpTag->type = kTagTypeInteger; + tmpTag->string = 0; + tmpTag->tag = 0; + tmpTag->offset = 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return 0; + } + + size = length = FixDataMatchingTag(buffer, kXMLTagInteger); + if (length == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + integer = 0; + + if(size > 1 && (val[1] == 'x' || val[1] == 'X')) // Hex value + { + val += 2; + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + integer = (integer * 16) + (*val++ - '0'); + } + else if ((*val >= 'a' && *val <= 'f')) // a - f + { + integer = (integer * 16) + (*val++ - 'a' + 10); + } + else if ((*val >= 'A' && *val <= 'F')) // A - F + { + integer = (integer * 16) + (*val++ - 'a' + 10); + } + else + { + printf("ParseTagInteger hex error (0x%x) in buffer %s\n", *val, buffer); + getchar(); + return -1; + } + } + } + else if ( size ) // Decimal value + { + if (*val == '-') + { + negative = true; + val++; + size--; + } + + for (integer = 0; size > 0; size--) + { + if(*val) // UGLY HACK, fix me. + { + if (*val < '0' || *val > '9') + { + printf("ParseTagInteger decimal error (0x%x) in buffer %s\n", *val, buffer); + getchar(); + return -1; + } + + integer = (integer * 10) + (*val++ - '0'); + } + } + + if (negative) + integer = -integer; + } + + tmpTag->type = kTagTypeInteger; + tmpTag->string = (char *)integer; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length; +} + +//========================================================================== +// ParseTagData + +static long +ParseTagData( char * buffer, TagPtr * tag ) +{ + int actuallen = 0; + long length; + TagPtr tmpTag; + + length = FixDataMatchingTag(buffer, kXMLTagData); + if (length == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + //printf("ParseTagData unimplimented\n"); + //printf("Data: %s\n", buffer); + // getchar(); + + char* string = BASE64Decode(buffer, strlen(buffer), &actuallen); + tmpTag->type = kTagTypeData; + tmpTag->string = string; + tmpTag->tag = 0; + tmpTag->offset = actuallen; // buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length; +} + +//========================================================================== +// ParseTagDate + +static long +ParseTagDate( char * buffer, TagPtr * tag ) +{ + long length; + TagPtr tmpTag; + + length = FixDataMatchingTag(buffer, kXMLTagDate); + if (length == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + printf("ParseTagDate unimplimented\n"); + getchar(); + + tmpTag->type = kTagTypeDate; + tmpTag->string = 0; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length; +} + +//========================================================================== +// ParseTagBoolean + +long +ParseTagBoolean( char * buffer, TagPtr * tag, long type ) +{ + TagPtr tmpTag; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + tmpTag->type = type; + tmpTag->string = 0; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return 0; +} + +//========================================================================== +// GetNextTag + +static long +GetNextTag( char * buffer, char ** tag, long * start ) +{ + long cnt, cnt2; + + if (tag == 0) return -1; + + // Find the start of the tag. + cnt = 0; + while ((buffer[cnt] != '\0') && (buffer[cnt] != '<')) cnt++; + if (buffer[cnt] == '\0') return -1; + + // Find the end of the tag. + cnt2 = cnt + 1; + while ((buffer[cnt2] != '\0') && (buffer[cnt2] != '>')) cnt2++; + if (buffer[cnt2] == '\0') return -1; + + // Fix the tag data. + *tag = buffer + cnt + 1; + buffer[cnt2] = '\0'; + if (start) *start = cnt; + + return cnt2 + 1; +} + +//========================================================================== +// FixDataMatchingTag +// Modifies 'buffer' to add a '\0' at the end of the tag matching 'tag'. +// Returns the length of the data found, counting the end tag, +// or -1 if the end tag was not found. + +static long +FixDataMatchingTag( char * buffer, char * tag ) +{ + long length, start, stop; + char * endTag; + + start = 0; + while (1) + { + length = GetNextTag(buffer + start, &endTag, &stop); + if (length == -1) return -1; + + if ((*endTag == '/') && !strcmp(endTag + 1, tag)) break; + start += length; + } + + buffer[start + stop] = '\0'; + + return start + length; +} + +//========================================================================== +// NewTag + +#define kTagsPerBlock (0x1000) + +static TagPtr gTagsFree; + +static TagPtr +NewTag( void ) +{ + long cnt; + TagPtr tag; + + if (gTagsFree == 0) + { + tag = (TagPtr)malloc(kTagsPerBlock * sizeof(Tag)); + if (tag == 0) return 0; + + // Initalize the new tags. + for (cnt = 0; cnt < kTagsPerBlock; cnt++) + { + tag[cnt].type = kTagTypeNone; + tag[cnt].string = 0; + tag[cnt].tag = 0; + tag[cnt].tagNext = tag + cnt + 1; + } + tag[kTagsPerBlock - 1].tagNext = 0; + + gTagsFree = tag; + } + + tag = gTagsFree; + gTagsFree = tag->tagNext; + + return tag; +} + +//========================================================================== +// XMLFreeTag + +void +XMLFreeTag( TagPtr tag ) +{ +#if DOFREE + if (tag == 0) return; + + if (!XMLIsInteger(tag) && tag->string) FreeSymbol(tag->string); + + XMLFreeTag(tag->tag); + XMLFreeTag(tag->tagNext); + + // Clear and free the tag. + tag->type = kTagTypeNone; + tag->string = 0; + tag->tag = 0; + tag->offset = 0; + tag->tagNext = gTagsFree; + gTagsFree = tag; +#else + return; +#endif +} + +//========================================================================== +// Symbol object. + +struct Symbol +{ + long refCount; + struct Symbol *next; + char string[]; +}; +typedef struct Symbol Symbol, *SymbolPtr; + +static SymbolPtr FindSymbol(char * string, SymbolPtr * prevSymbol); + +static SymbolPtr gSymbolsHead; + +//========================================================================== +// NewSymbol + +static char * +NewSymbol( char * string ) +{ +static SymbolPtr lastGuy = 0; + SymbolPtr symbol; + + // Look for string in the list of symbols. + symbol = FindSymbol(string, 0); + + // Add the new symbol. + if (symbol == 0) + { + symbol = (SymbolPtr)malloc(sizeof(Symbol) + 1 + strlen(string)); + if (symbol == 0) //return 0; + stop("NULL symbol!"); + + // Set the symbol's data. + symbol->refCount = 0; + strcpy(symbol->string, string); + + // Add the symbol to the list. + symbol->next = gSymbolsHead; + gSymbolsHead = symbol; + } + + // Update the refCount and return the string. + symbol->refCount++; + + if (lastGuy && lastGuy->next != 0) stop("last guy not last!"); + return symbol->string; +} + +//========================================================================== +// FreeSymbol + +#if DOFREE +static void +FreeSymbol( char * string ) +{ + SymbolPtr symbol, prev; + prev = 0; + + // Look for string in the list of symbols. + symbol = FindSymbol(string, &prev); + if (symbol == 0) return; + + // Update the refCount. + symbol->refCount--; + + if (symbol->refCount != 0) return; + + // Remove the symbol from the list. + if (prev != 0) prev->next = symbol->next; + else gSymbolsHead = symbol->next; + + // Free the symbol's memory. + free(symbol); +} +#endif + +//========================================================================== +// FindSymbol + +static SymbolPtr +FindSymbol( char * string, SymbolPtr * prevSymbol ) +{ + SymbolPtr symbol, prev; + + symbol = gSymbolsHead; + prev = 0; + + while (symbol != 0) { + if (!strcmp(symbol->string, string)) break; + + prev = symbol; + symbol = symbol->next; + } + + if ((symbol != 0) && (prevSymbol != 0)) *prevSymbol = prev; + + return symbol; +} + +bool XMLIsType(TagPtr dict, enum xmltype type) +{ + if(!dict) return (type == kTagTypeNone); + return (dict->type == type); +} + +/*** Cast functions ***/ +bool XMLIsArray(TagPtr entry) +{ + return entry && (entry->type == kTagTypeArray); +} + +TagPtr XMLCastArray(TagPtr dict) +{ + if(!dict) return NULL; + if(dict->type == kTagTypeArray) return dict; + else return NULL; +} + +bool XMLIsDict(TagPtr entry) +{ + return entry && (entry->type == kTagTypeDict); +} + +bool XMLIsData(TagPtr entry) +{ + return entry && (entry->type == kTagTypeData); +} + +TagPtr XMLCastDict(TagPtr dict) +{ + if(!dict) return NULL; + if(dict->type == kTagTypeDict) return dict; + else return NULL; +} + +bool XMLIsString(TagPtr entry) +{ + return entry && + ((entry->type == kTagTypeString) || + (entry->type == kTagTypeKey)); +} + +char* XMLCastString(TagPtr dict) +{ + if(!dict) return NULL; + + if((dict->type == kTagTypeString) || + (dict->type == kTagTypeKey)) return dict->string; + + return NULL; +} + +char* XMLCastData(TagPtr dict, int* length) +{ + if(!dict) return NULL; + + if((dict->type == kTagTypeData) || + (dict->type == kTagTypeKey)) + { + *length = dict->offset; + return dict->string; + } + *length = 0; + return NULL; +} + +long XMLCastStringOffset(TagPtr dict) +{ + if(dict && + ((dict->type == kTagTypeString) || + (dict->type == kTagTypeKey))) + { + return dict->offset; + } + else + { + return -1; + } +} + +bool XMLIsBoolean(TagPtr entry) +{ + return entry && + ((entry->type == kTagTypeTrue) || + (entry->type == kTagTypeFalse)); +} + +bool XMLCastBoolean(TagPtr dict) +{ + if(!dict) return false; + if(dict->type == kTagTypeTrue) return true; + return false; +} + +bool XMLIsInteger(TagPtr entry) +{ + return entry && (entry->type == kTagTypeInteger); +} + +int XMLCastInteger(TagPtr dict) +{ + if(!dict) + { + //printf("XMLCastInteger: null dict\n"); + return 0; + } + if(dict->type == kTagTypeInteger) return (int)(dict->string); + return 0; +} + +bool XMLAddTagToDictionary(TagPtr dict, char* key, TagPtr value) +{ + if (!dict || dict->type != kTagTypeDict) return false; + + TagPtr tmpTag; + char* string; + + tmpTag = NewTag(); + if (tmpTag == 0) + { + return false; + } + + string = NewSymbol(key); + if (string == 0) + { + XMLFreeTag(tmpTag); + return false; + } + + tmpTag->type = kTagTypeKey; + tmpTag->string = string; + tmpTag->tag = value; + tmpTag->offset = 0; + tmpTag->tagNext = 0; + + TagPtr tagList = dict->tag; + if(!tagList) + { + // First tag + dict->tag = tmpTag; + return true; + } + while(tagList && tagList->tagNext) tagList = tagList->tagNext; + if(tagList) + { + tagList->tagNext = tmpTag; + return true; + } + return false; +} diff --git a/i386/libsaio/.svn/text-base/xml.h.svn-base b/i386/libsaio/.svn/text-base/xml.h.svn-base new file mode 100644 index 0000000..3f0bcb6 --- /dev/null +++ b/i386/libsaio/.svn/text-base/xml.h.svn-base @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_XML_H +#define __LIBSAIO_XML_H + +enum xmltype { + kTagTypeNone = 0, + kTagTypeDict, + kTagTypeKey, + kTagTypeString, + kTagTypeInteger, + kTagTypeData, + kTagTypeDate, + kTagTypeFalse, + kTagTypeTrue, + kTagTypeArray +}; + +struct string_ref +{ + char* string; + int id; + struct string_ref* next; +}; +typedef struct string_ref string_ref; + +extern string_ref* ref_strings; + +#define kXMLTagPList "plist " +#define kXMLTagDict "dict" +#define kXMLTagKey "key" +#define kXMLTagString "string" +#define kXMLTagInteger "integer" +#define kXMLTagData "data" +#define kXMLTagDate "date" +#define kXMLTagFalse "false/" +#define kXMLTagTrue "true/" +#define kXMLTagArray "array" + +#define kXMLStringID "ID=" +#define kXMLStringIDRef "IDREF=" + +#define kPropCFBundleIdentifier ("CFBundleIdentifier") +#define kPropCFBundleExecutable ("CFBundleExecutable") +#define kPropOSBundleRequired ("OSBundleRequired") +#define kPropOSBundleLibraries ("OSBundleLibraries") +#define kPropIOKitPersonalities ("IOKitPersonalities") +#define kPropIONameMatch ("IONameMatch") + +/* +struct Tag { + long type; + char *string; + struct Tag *tag; + struct Tag *tagNext; +}; +typedef struct Tag Tag, *TagPtr; + */ + +extern long gImageFirstBootXAddr; +extern long gImageLastKernelAddr; + +TagPtr XMLGetProperty( TagPtr dict, const char * key ); +TagPtr XMLGetElement( TagPtr dict, int id ); +TagPtr XMLGetKey( TagPtr dict, int id ); +TagPtr XMLGetValueForKey(TagPtr key); + +int XMLTagCount( TagPtr dict ); + +bool XMLIsType(TagPtr dict, enum xmltype type); + +bool XMLCastBoolean( TagPtr dict ); +char* XMLCastString( TagPtr dict ); +long XMLCastStringOffset(TagPtr dict); +int XMLCastInteger ( TagPtr dict ); +TagPtr XMLCastDict ( TagPtr dict ); +TagPtr XMLCastArray( TagPtr dict ); +char* XMLCastData( TagPtr dict, int* length ); + +bool XMLIsBoolean(TagPtr entry); +bool XMLIsString (TagPtr entry); +bool XMLIsInteger(TagPtr entry); +bool XMLIsDict (TagPtr entry); +bool XMLIsArray (TagPtr entry); +bool XMLIsData (TagPtr entry); + +bool XMLAddTagToDictionary(TagPtr dict, char* key, TagPtr value); + +long XMLParseNextTag(char *buffer, TagPtr *tag); +void XMLFreeTag(TagPtr tag); +char* XMLDecode(const char *in); +//========================================================================== +// XMLParseFile +// Expects to see one dictionary in the XML file. +// Puts the first dictionary it finds in the +// tag pointer and returns 0, or returns -1 if not found. +// +long XMLParseFile( char * buffer, TagPtr * dict ); + +//========================================================================== +// ParseTag* +long ParseTagBoolean( char * buffer, TagPtr * tag, long type ); + + +#endif /* __LIBSAIO_XML_H */ diff --git a/i386/libsaio/Cconfig b/i386/libsaio/Cconfig new file mode 100644 index 0000000..e69de29 diff --git a/i386/libsaio/Makefile b/i386/libsaio/Makefile new file mode 100644 index 0000000..3ec1a27 --- /dev/null +++ b/i386/libsaio/Makefile @@ -0,0 +1,65 @@ +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/libsaio +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +DIR = libsaio +include ${SRCROOT}/Make.rules + +UTILDIR = ../util +LIBSADIR = ../libsa +BOOT2DIR = ../boot2 + +DEFINES = -DNOTHING +#DEFINES = -DDEBUG_CPU=1 -DDEBUG_MEM=1 -DDEBUG_SPD=1 -DDEBUG_PCI=1 -DDEBUG_SMBIOS=1 + +CFLAGS := $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \ + -D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \ + -DRCZ_COMPRESSED_FILE_SUPPORT -fno-stack-protector \ + -fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc++ + +INC = -I. -I$(SRCROOT) -I$(SYMROOT) -I$(LIBSADIR) -I$(BOOT2DIR) -I${SRCROOT}/i386/include + +SAIO_OBJS = table.o asm.o bios.o biosfn.o \ + disk.o sys.o cache.o bootstruct.o \ + stringTable.o load.o pci.o allocate.o misc.o \ + befs.o freebsd.o openbsd.o \ + vbe.o nbp.o hfs.o hfs_compare.o \ + xml.o ntfs.o msdos.o md5c.o device_tree.o \ + cpu.o platform.o acpi_patcher.o \ + smbios.o smbios_getters.o smbios_decode.o \ + fake_efi.o ext2fs.o \ + hpet.o dram_controllers.o spd.o usb.o pci_setup.o \ + device_inject.o nvidia_helper.o nvidia.o ati.o gma.o pci_root.o \ + convert.o aml_generator.o console.o exfat.o base64-decode.o + +SAIO_OBJS := $(addprefix $(OBJROOT)/, $(SAIO_OBJS)) + +LIBS = libsaio.a +LIBS := $(addprefix $(SYMROOT)/, $(LIBS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + + +all: $(DIRS_NEEDED) $(CONFIG_HEADERS) $(LIBS) all-recursive + +$(LIBS): $(SAIO_OBJS) + @echo "\t[RM] $@" + @rm -f $@ + @echo "\t[AR] $(@F)" + @ar q $@ $^ &> /dev/null + @echo "\t[RANLIB] $(@F)" + @ranlib $(SYMROOT)/$(@F) + +clean-local: + @rm -f $(LIBS) $(SAIO_OBJS) + +# dependencies +-include $(OBJROOT)/Makedep diff --git a/i386/libsaio/acpi.h b/i386/libsaio/acpi.h new file mode 100644 index 0000000..bc8c770 --- /dev/null +++ b/i386/libsaio/acpi.h @@ -0,0 +1,153 @@ +#ifndef __LIBSAIO_ACPI_H +#define __LIBSAIO_ACPI_H + +#define ACPI_RANGE_START (0x0E0000) +#define ACPI_RANGE_END (0x0FFFFF) + +#define UINT64_LE_FROM_CHARS(a,b,c,d,e,f,g,h) \ +( ((uint64_t)h << 56) \ +| ((uint64_t)g << 48) \ +| ((uint64_t)f << 40) \ +| ((uint64_t)e << 32) \ +| ((uint64_t)d << 24) \ +| ((uint64_t)c << 16) \ +| ((uint64_t)b << 8) \ +| ((uint64_t)a << 0) \ +) + +#define ACPI_SIGNATURE_UINT64_LE UINT64_LE_FROM_CHARS('R','S','D',' ','P','T','R',' ') + +/* Per ACPI 3.0a spec */ + +// TODO Migrate +struct acpi_2_rsdp { + char Signature[8]; + uint8_t Checksum; + char OEMID[6]; + uint8_t Revision; + uint32_t RsdtAddress; + uint32_t Length; + uint64_t XsdtAddress; + uint8_t ExtendedChecksum; + char Reserved[3]; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_rsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_xsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_ssdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_dsdt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; +} __attribute__((packed)); + +// TODO Migrate +struct acpi_2_fadt { + char Signature[4]; + uint32_t Length; + uint8_t Revision; + uint8_t Checksum; + char OEMID[6]; + char OEMTableId[8]; + uint32_t OEMRevision; + uint32_t CreatorId; + uint32_t CreatorRevision; + uint32_t FIRMWARE_CTRL; + uint32_t DSDT; + uint8_t Model; // JrCs + uint8_t PM_Profile; // JrCs + uint16_t SCI_Interrupt; + uint32_t SMI_Command_Port; + uint8_t ACPI_Enable; + uint8_t ACPI_Disable; + uint8_t S4BIOS_Command; + uint8_t PState_Control; + uint32_t PM1A_Event_Block_Address; + uint32_t PM1B_Event_Block_Address; + uint32_t PM1A_Control_Block_Address; + uint32_t PM1B_Control_Block_Address; + uint32_t PM2_Control_Block_Address; + uint32_t PM_Timer_Block_Address; + uint32_t GPE0_Block_Address; + uint32_t GPE1_Block_Address; + uint8_t PM1_Event_Block_Length; + uint8_t PM1_Control_Block_Length; + uint8_t PM2_Control_Block_Length; + uint8_t PM_Timer_Block_Length; + uint8_t GPE0_Block_Length; + uint8_t GPE1_Block_Length; + uint8_t GPE1_Base_Offset; + uint8_t CST_Support; + uint16_t C2_Latency; + uint16_t C3_Latency; + uint16_t CPU_Cache_Size; + uint16_t Cache_Flush_Stride; + uint8_t Duty_Cycle_Offset; + uint8_t Duty_Cycle_Width; + uint8_t RTC_Day_Alarm_Index; + uint8_t RTC_Month_Alarm_Index; + uint8_t RTC_Century_Index; + uint16_t Boot_Flags; + uint8_t Reserved0; +/* Begin Asere */ + //Reset Fix + uint32_t Flags; + uint8_t Reset_SpaceID; + uint8_t Reset_BitWidth; + uint8_t Reset_BitOffset; + uint8_t Reset_AccessWidth; + uint64_t Reset_Address; + uint8_t Reset_Value; + uint8_t Reserved[3]; + + uint64_t X_FIRMWARE_CTRL; + uint64_t X_DSDT; +/* End Asere */ + /*We absolutely don't care about theese fields*/ + uint8_t notimp2[96]; +} __attribute__((packed)); + +#endif /* !__LIBSAIO_ACPI_H */ diff --git a/i386/libsaio/acpi_patcher.c b/i386/libsaio/acpi_patcher.c new file mode 100644 index 0000000..7528a16 --- /dev/null +++ b/i386/libsaio/acpi_patcher.c @@ -0,0 +1,1177 @@ +/* + * Copyright 2008 mackerintel + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "acpi.h" +#include "efi_tables.h" +#include "fake_efi.h" +#include "acpi_patcher.h" +#include "platform.h" +#include "cpu.h" +#include "aml_generator.h" + +#ifndef DEBUG_ACPI +#define DEBUG_ACPI 0 +#endif + +#if DEBUG_ACPI==2 +#define DBG(x...) {printf(x); sleep(1);} +#elif DEBUG_ACPI==1 +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +// Slice: New signature compare function +boolean_t tableSign(char *table, const char *sgn) +{ + int i; + for (i=0; i<4; i++) { + if ((table[i] &~0x20) != (sgn[i] &~0x20)) { + return false; + } + } + return true; +} + +/* Gets the ACPI 1.0 RSDP address */ +static struct acpi_2_rsdp* getAddressOfAcpiTable() +{ + /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ + + void *acpi_addr = (void*)ACPI_RANGE_START; + for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) + { + if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) + { + uint8_t csum = checksum8(acpi_addr, 20); + if(csum == 0) + { + // Only return the table if it is a true version 1.0 table (Revision 0) + if(((struct acpi_2_rsdp*)acpi_addr)->Revision == 0) + return acpi_addr; + } + } + } + return NULL; +} + +/* Gets the ACPI 2.0 RSDP address */ +static struct acpi_2_rsdp* getAddressOfAcpi20Table() +{ + /* TODO: Before searching the BIOS space we are supposed to search the first 1K of the EBDA */ + + void *acpi_addr = (void*)ACPI_RANGE_START; + for(; acpi_addr <= (void*)ACPI_RANGE_END; acpi_addr += 16) + { + if(*(uint64_t *)acpi_addr == ACPI_SIGNATURE_UINT64_LE) + { + uint8_t csum = checksum8(acpi_addr, 20); + + /* Only assume this is a 2.0 or better table if the revision is greater than 0 + * NOTE: ACPI 3.0 spec only seems to say that 1.0 tables have revision 1 + * and that the current revision is 2.. I am going to assume that rev > 0 is 2.0. + */ + + if(csum == 0 && (((struct acpi_2_rsdp*)acpi_addr)->Revision > 0)) + { + uint8_t csum2 = checksum8(acpi_addr, sizeof(struct acpi_2_rsdp)); + if(csum2 == 0) + return acpi_addr; + } + } + } + return NULL; +} +/** The folowing ACPI Table search algo. should be reused anywhere needed:*/ +int search_and_get_acpi_fd(const char * filename, const char ** outDirspec) +{ + int fd = 0; + char dirSpec[512]; + + // Try finding 'filename' in the usual places + // Start searching any potential location for ACPI Table + sprintf(dirSpec, "%s", filename); + fd = open(dirSpec, 0); + if (fd < 0) + { + sprintf(dirSpec, "/Extra/%s", filename); + fd = open(dirSpec, 0); + if (fd < 0) + { + sprintf(dirSpec, "bt(0,0)/Extra/%s", filename); + fd = open(dirSpec, 0); + } + } + + if (fd < 0) + { + // NOT FOUND: + verbose("ACPI table not found: %s\n", filename); + *dirSpec = '\0'; + } + + if (outDirspec) *outDirspec = dirSpec; + return fd; +} + + +void *loadACPITable (const char * filename) +{ + void *tableAddr; + const char * dirspec=NULL; + + int fd = search_and_get_acpi_fd(filename, &dirspec); + + if (fd>=0) + { + tableAddr=(void*)AllocateKernelMemory(file_size (fd)); + if (tableAddr) + { + if (read (fd, tableAddr, file_size (fd))!=file_size (fd)) + { + printf("Couldn't read table %s\n",dirspec); + free (tableAddr); + close (fd); + return NULL; + } + + DBG("Table %s read and stored at: %x\n", dirspec, tableAddr); + close (fd); + return tableAddr; + } + close (fd); + printf("Couldn't allocate memory for table \n", dirspec); + } + //printf("Couldn't find table %s\n", filename); + return NULL; +} + +uint8_t acpi_cpu_count = 0; +char* acpi_cpu_name[32]; +uint32_t acpi_cpu_p_blk = 0; + +void get_acpi_cpu_names(unsigned char* dsdt, uint32_t length) +{ + uint32_t i; + + DBG("start finding cpu names. length %d\n", length); + + for (i=0; i<length-7; i++) + { + if (dsdt[i] == 0x5B && dsdt[i+1] == 0x83) // ProcessorOP + { + DBG("dsdt: %x%x\n", dsdt[i], dsdt[i+1]); + + uint32_t offset = i + 3 + (dsdt[i+2] >> 6); + + bool add_name = true; + + uint8_t j; + + for (j=0; j<4; j++) + { + char c = dsdt[offset+j]; + + if (!aml_isvalidchar(c)) + { + add_name = false; + verbose("Invalid character found in ProcessorOP 0x%x!\n", c); + break; + } + } + + if (add_name) + { + acpi_cpu_name[acpi_cpu_count] = malloc(4); + memcpy(acpi_cpu_name[acpi_cpu_count], dsdt+offset, 4); + i = offset + 5; + + if (acpi_cpu_count == 0) + acpi_cpu_p_blk = dsdt[i] | (dsdt[i+1] << 8); + + verbose("Found ACPI CPU: %c%c%c%c\n", acpi_cpu_name[acpi_cpu_count][0], acpi_cpu_name[acpi_cpu_count][1], acpi_cpu_name[acpi_cpu_count][2], acpi_cpu_name[acpi_cpu_count][3]); + + if (++acpi_cpu_count == 32) return; + } + } + } + + DBG("end finding cpu names: cpu names found: %d\n", acpi_cpu_count); +} + +struct acpi_2_ssdt *generate_cst_ssdt(struct acpi_2_fadt* fadt) +{ + char ssdt_header[] = + { + 0x53, 0x53, 0x44, 0x54, 0xE7, 0x00, 0x00, 0x00, /* SSDT.... */ + 0x01, 0x17, 0x50, 0x6D, 0x52, 0x65, 0x66, 0x41, /* ..PmRefA */ + 0x43, 0x70, 0x75, 0x43, 0x73, 0x74, 0x00, 0x00, /* CpuCst.. */ + 0x00, 0x10, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* ....INTL */ + 0x31, 0x03, 0x10, 0x20 /* 1.._ */ + }; + + char resource_template_register_fixedhw[] = + { + 0x11, 0x14, 0x0A, 0x11, 0x82, 0x0C, 0x00, 0x7F, + 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x79, 0x00 + }; + + char resource_template_register_systemio[] = + { + 0x11, 0x14, 0x0A, 0x11, 0x82, 0x0C, 0x00, 0x01, + 0x08, 0x00, 0x00, 0x15, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x79, 0x00, + }; + + if (Platform.CPU.Vendor != 0x756E6547) { + verbose ("Not an Intel platform: C-States will not be generated !!!\n"); + return NULL; + } + + if (fadt == NULL) { + verbose ("FACP not exists: C-States will not be generated !!!\n"); + return NULL; + } + + struct acpi_2_dsdt* dsdt = (void*)fadt->DSDT; + + if (dsdt == NULL) { + verbose ("DSDT not found: C-States will not be generated !!!\n"); + return NULL; + } + + if (acpi_cpu_count == 0) + get_acpi_cpu_names((void*)dsdt, dsdt->Length); + + if (acpi_cpu_count > 0) + { + bool c2_enabled = false; + bool c3_enabled = false; + bool c4_enabled = false; + bool cst_using_systemio = false; + + getBoolForKey(kEnableC2State, &c2_enabled, &bootInfo->chameleonConfig); + getBoolForKey(kEnableC3State, &c3_enabled, &bootInfo->chameleonConfig); + getBoolForKey(kEnableC4State, &c4_enabled, &bootInfo->chameleonConfig); + getBoolForKey(kCSTUsingSystemIO, &cst_using_systemio, &bootInfo->chameleonConfig); + + c2_enabled = c2_enabled | (fadt->C2_Latency < 100); + c3_enabled = c3_enabled | (fadt->C3_Latency < 1000); + + unsigned char cstates_count = 1 + (c2_enabled ? 1 : 0) + (c3_enabled ? 1 : 0); + + struct aml_chunk* root = aml_create_node(NULL); + aml_add_buffer(root, ssdt_header, sizeof(ssdt_header)); // SSDT header + struct aml_chunk* scop = aml_add_scope(root, "\\_PR_"); + struct aml_chunk* name = aml_add_name(scop, "CST_"); + struct aml_chunk* pack = aml_add_package(name); + aml_add_byte(pack, cstates_count); + + struct aml_chunk* tmpl = aml_add_package(pack); + if (cst_using_systemio) + { + // C1 + resource_template_register_fixedhw[8] = 0x00; + resource_template_register_fixedhw[9] = 0x00; + resource_template_register_fixedhw[18] = 0x00; + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x01); // C1 + aml_add_word(tmpl, 0x0001); // Latency + aml_add_dword(tmpl, 0x000003e8); // Power + + uint8_t p_blk_lo, p_blk_hi; + + if (c2_enabled) // C2 + { + p_blk_lo = acpi_cpu_p_blk + 4; + p_blk_hi = (acpi_cpu_p_blk + 4) >> 8; + + tmpl = aml_add_package(pack); + resource_template_register_systemio[11] = p_blk_lo; // C2 + resource_template_register_systemio[12] = p_blk_hi; // C2 + aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio)); + aml_add_byte(tmpl, 0x02); // C2 + aml_add_word(tmpl, 0x0040); // Latency + aml_add_dword(tmpl, 0x000001f4); // Power + } + + if (c4_enabled) // C4 + { + p_blk_lo = acpi_cpu_p_blk + 5; + p_blk_hi = (acpi_cpu_p_blk + 5) >> 8; + + tmpl = aml_add_package(pack); + resource_template_register_systemio[11] = p_blk_lo; // C4 + resource_template_register_systemio[12] = p_blk_hi; // C4 + aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio)); + aml_add_byte(tmpl, 0x04); // C4 + aml_add_word(tmpl, 0x0080); // Latency + aml_add_dword(tmpl, 0x000000C8); // Power + } + else if (c3_enabled) // C3 + { + p_blk_lo = acpi_cpu_p_blk + 5; + p_blk_hi = (acpi_cpu_p_blk + 5) >> 8; + + tmpl = aml_add_package(pack); + resource_template_register_systemio[11] = p_blk_lo; // C3 + resource_template_register_systemio[12] = p_blk_hi; // C3 + aml_add_buffer(tmpl, resource_template_register_systemio, sizeof(resource_template_register_systemio)); + aml_add_byte(tmpl, 0x03); // C3 + aml_add_word(tmpl, 0x0060); // Latency + aml_add_dword(tmpl, 0x0000015e); // Power + } + } + else + { + // C1 + resource_template_register_fixedhw[11] = 0x00; // C1 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x01); // C1 + aml_add_word(tmpl, 0x0001); // Latency + aml_add_dword(tmpl, 0x000003e8); // Power + + resource_template_register_fixedhw[18] = 0x03; + + if (c2_enabled) // C2 + { + tmpl = aml_add_package(pack); + resource_template_register_fixedhw[11] = 0x10; // C2 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x02); // C2 + aml_add_word(tmpl, 0x0040); // Latency + aml_add_dword(tmpl, 0x000001f4); // Power + } + + if (c4_enabled) // C4 + { + tmpl = aml_add_package(pack); + resource_template_register_fixedhw[11] = 0x30; // C4 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x04); // C4 + aml_add_word(tmpl, 0x0080); // Latency + aml_add_dword(tmpl, 0x000000C8); // Power + } + else if (c3_enabled) + { + tmpl = aml_add_package(pack); + resource_template_register_fixedhw[11] = 0x20; // C3 + aml_add_buffer(tmpl, resource_template_register_fixedhw, sizeof(resource_template_register_fixedhw)); + aml_add_byte(tmpl, 0x03); // C3 + aml_add_word(tmpl, 0x0060); // Latency + aml_add_dword(tmpl, 0x0000015e); // Power + } + } + + // Aliaces + int i; + for (i = 0; i < acpi_cpu_count; i++) + { + char name[9]; + sprintf(name, "_PR_%c%c%c%c", acpi_cpu_name[i][0], acpi_cpu_name[i][1], acpi_cpu_name[i][2], acpi_cpu_name[i][3]); + + scop = aml_add_scope(root, name); + aml_add_alias(scop, "CST_", "_CST"); + } + + aml_calculate_size(root); + + struct acpi_2_ssdt *ssdt = (struct acpi_2_ssdt *)AllocateKernelMemory(root->Size); + + aml_write_node(root, (void*)ssdt, 0); + + ssdt->Length = root->Size; + ssdt->Checksum = 0; + ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length); + + aml_destroy_node(root); + + // dumpPhysAddr("C-States SSDT content: ", ssdt, ssdt->Length); + + verbose ("SSDT with CPU C-States generated successfully\n"); + + return ssdt; + } + else + { + verbose ("ACPI CPUs not found: C-States not generated !!!\n"); + } + + return NULL; +} + +struct acpi_2_ssdt *generate_pss_ssdt(struct acpi_2_dsdt* dsdt) +{ + char ssdt_header[] = + { + 0x53, 0x53, 0x44, 0x54, 0x7E, 0x00, 0x00, 0x00, /* SSDT.... */ + 0x01, 0x6A, 0x50, 0x6D, 0x52, 0x65, 0x66, 0x00, /* ..PmRef. */ + 0x43, 0x70, 0x75, 0x50, 0x6D, 0x00, 0x00, 0x00, /* CpuPm... */ + 0x00, 0x30, 0x00, 0x00, 0x49, 0x4E, 0x54, 0x4C, /* .0..INTL */ + 0x31, 0x03, 0x10, 0x20, /* 1.._ */ + }; + + if (Platform.CPU.Vendor != 0x756E6547) { + verbose ("Not an Intel platform: P-States will not be generated !!!\n"); + return NULL; + } + + if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) { + verbose ("Unsupported CPU: P-States will not be generated !!!\n"); + return NULL; + } + + if (acpi_cpu_count == 0) + get_acpi_cpu_names((void*)dsdt, dsdt->Length); + + if (acpi_cpu_count > 0) + { + struct p_state initial, maximum, minimum, p_states[32]; + uint8_t p_states_count = 0; + + // Retrieving P-States, ported from code by superhai (c) + switch (Platform.CPU.Family) { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: // Intel Pentium M + case CPU_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPU_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPU_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPU_MODEL_ATOM: // Intel Atom (45nm) + { + bool cpu_dynamic_fsb = false; + + if (rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 27)) + { + wrmsr64(MSR_IA32_EXT_CONFIG, (rdmsr64(MSR_IA32_EXT_CONFIG) | (1 << 28))); + delay(1); + cpu_dynamic_fsb = rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 28); + } + + bool cpu_noninteger_bus_ratio = (rdmsr64(MSR_IA32_PERF_STATUS) & (1ULL << 46)); + + initial.Control = rdmsr64(MSR_IA32_PERF_STATUS); + + maximum.Control = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 32) & 0x1F3F) | (0x4000 * cpu_noninteger_bus_ratio); + maximum.CID = ((maximum.FID & 0x1F) << 1) | cpu_noninteger_bus_ratio; + + minimum.FID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 24) & 0x1F) | (0x80 * cpu_dynamic_fsb); + minimum.VID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 48) & 0x3F); + + if (minimum.FID == 0) + { + uint64_t msr; + uint8_t i; + // Probe for lowest fid + for (i = maximum.FID; i >= 0x6; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (i << 8) | minimum.VID); + intel_waitforsts(); + minimum.FID = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0x1F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + if (minimum.VID == maximum.VID) + { + uint64_t msr; + uint8_t i; + // Probe for lowest vid + for (i = maximum.VID; i > 0xA; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (minimum.FID << 8) | i); + intel_waitforsts(); + minimum.VID = rdmsr64(MSR_IA32_PERF_STATUS) & 0x3F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + minimum.CID = ((minimum.FID & 0x1F) << 1) >> cpu_dynamic_fsb; + + // Sanity check + if (maximum.CID < minimum.CID) + { + DBG("Insane FID values!"); + p_states_count = 0; + } + else + { + // Finalize P-States + // Find how many P-States machine supports + p_states_count = maximum.CID - minimum.CID + 1; + + if (p_states_count > 32) + p_states_count = 32; + + uint8_t vidstep; + uint8_t i = 0, u, invalid = 0; + + vidstep = ((maximum.VID << 2) - (minimum.VID << 2)) / (p_states_count - 1); + + for (u = 0; u < p_states_count; u++) + { + i = u - invalid; + + p_states[i].CID = maximum.CID - u; + p_states[i].FID = (p_states[i].CID >> 1); + + if (p_states[i].FID < 0x6) + { + if (cpu_dynamic_fsb) + p_states[i].FID = (p_states[i].FID << 1) | 0x80; + } + else if (cpu_noninteger_bus_ratio) + { + p_states[i].FID = p_states[i].FID | (0x40 * (p_states[i].CID & 0x1)); + } + + if (i && p_states[i].FID == p_states[i-1].FID) + invalid++; + + p_states[i].VID = ((maximum.VID << 2) - (vidstep * u)) >> 2; + + uint32_t multiplier = p_states[i].FID & 0x1f; // = 0x08 + bool half = p_states[i].FID & 0x40; // = 0x01 + bool dfsb = p_states[i].FID & 0x80; // = 0x00 + uint32_t fsb = Platform.CPU.FSBFrequency / 1000000; // = 400 + uint32_t halffsb = (fsb + 1) >> 1; // = 200 + uint32_t frequency = (multiplier * fsb); // = 3200 + + p_states[i].Frequency = (frequency + (half * halffsb)) >> dfsb; // = 3200 + 200 = 3400 + } + + p_states_count -= invalid; + } + + break; + } + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65xx + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1155 (22nm) + + { + if ((Platform.CPU.Model == CPU_MODEL_SANDYBRIDGE) || + (Platform.CPU.Model == CPU_MODEL_JAKETOWN) || + (Platform.CPU.Model == CPU_MODEL_HASWELL)) + { + maximum.Control = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0xff; + } else { + maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; + } + minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff; + + verbose("P-States: min %d, max %d\n", minimum.Control, maximum.Control); + + // Sanity check + if (maximum.Control < minimum.Control) + { + DBG("Insane control values!"); + p_states_count = 0; + } + else + { + uint8_t i; + p_states_count = 0; + + for (i = maximum.Control; i >= minimum.Control; i--) + { + p_states[p_states_count].Control = i; + p_states[p_states_count].CID = p_states[p_states_count].Control << 1; + p_states[p_states_count].Frequency = (Platform.CPU.FSBFrequency / 1000000) * i; + p_states_count++; + } + } + + break; + } + default: + verbose ("Unsupported CPU: P-States not generated !!!\n"); + break; + } + } + } + + // Generating SSDT + if (p_states_count > 0) + { + int i; + + struct aml_chunk* root = aml_create_node(NULL); + aml_add_buffer(root, ssdt_header, sizeof(ssdt_header)); // SSDT header + struct aml_chunk* scop = aml_add_scope(root, "\\_PR_"); + struct aml_chunk* name = aml_add_name(scop, "PSS_"); + struct aml_chunk* pack = aml_add_package(name); + + for (i = 0; i < p_states_count; i++) + { + struct aml_chunk* pstt = aml_add_package(pack); + + aml_add_dword(pstt, p_states[i].Frequency); + aml_add_dword(pstt, 0x00000000); // Power + aml_add_dword(pstt, 0x0000000A); // Latency + aml_add_dword(pstt, 0x0000000A); // Latency + aml_add_dword(pstt, p_states[i].Control); + aml_add_dword(pstt, i+1); // Status + } + + // Add aliaces + for (i = 0; i < acpi_cpu_count; i++) + { + char name[9]; + sprintf(name, "_PR_%c%c%c%c", acpi_cpu_name[i][0], acpi_cpu_name[i][1], acpi_cpu_name[i][2], acpi_cpu_name[i][3]); + + scop = aml_add_scope(root, name); + aml_add_alias(scop, "PSS_", "_PSS"); + } + + aml_calculate_size(root); + + struct acpi_2_ssdt *ssdt = (struct acpi_2_ssdt *)AllocateKernelMemory(root->Size); + + aml_write_node(root, (void*)ssdt, 0); + + ssdt->Length = root->Size; + ssdt->Checksum = 0; + ssdt->Checksum = 256 - checksum8(ssdt, ssdt->Length); + + aml_destroy_node(root); + + //dumpPhysAddr("P-States SSDT content: ", ssdt, ssdt->Length); + + verbose ("SSDT with CPU P-States generated successfully\n"); + + return ssdt; + } + } + else + { + verbose ("ACPI CPUs not found: P-States not generated !!!\n"); + } + + return NULL; +} + +struct acpi_2_fadt *patch_fadt(struct acpi_2_fadt *fadt, struct acpi_2_dsdt *new_dsdt) +{ + extern void setupSystemType(); + + struct acpi_2_fadt *fadt_mod; + bool fadt_rev2_needed = false; + bool fix_restart; + bool fix_restart_ps2; + const char * value; + + // Restart Fix + if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */ + fix_restart = true; + fix_restart_ps2 = false; + if ( getBoolForKey(kPS2RestartFix, &fix_restart_ps2, &bootInfo->chameleonConfig) && fix_restart_ps2) + fix_restart = true; + else + getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig); + + } else { + verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); + fix_restart = false; + } + + if (fix_restart) fadt_rev2_needed = true; + + // Allocate new fadt table + if (fadt->Length < 0x84 && fadt_rev2_needed) + { + fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(0x84); + memcpy(fadt_mod, fadt, fadt->Length); + fadt_mod->Length = 0x84; + fadt_mod->Revision = 0x02; // FADT rev 2 (ACPI 1.0B MS extensions) + } + else + { + fadt_mod=(struct acpi_2_fadt *)AllocateKernelMemory(fadt->Length); + memcpy(fadt_mod, fadt, fadt->Length); + } + // Determine system type / PM_Model + if ( (value=getStringForKey(kSystemType, &bootInfo->chameleonConfig))!=NULL) + { + if (Platform.Type > 6) + { + if(fadt_mod->PM_Profile<=6) + Platform.Type = fadt_mod->PM_Profile; // get the fadt if correct + else + Platform.Type = 1; /* Set a fixed value (Desktop) */ + verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type); + } + else + Platform.Type = (unsigned char) strtoul(value, NULL, 10); + } + // Set PM_Profile from System-type if only user wanted this value to be forced + if (fadt_mod->PM_Profile != Platform.Type) + { + if (value) + { // user has overriden the SystemType so take care of it in FACP + verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type); + fadt_mod->PM_Profile = Platform.Type; + } + else + { // PM_Profile has a different value and no override has been set, so reflect the user value to ioregs + Platform.Type = fadt_mod->PM_Profile <= 6 ? fadt_mod->PM_Profile : 1; + } + } + // We now have to write the systemm-type in ioregs: we cannot do it before in setupDeviceTree() + // because we need to take care of facp original content, if it is correct. + setupSystemType(); + + // Patch FADT to fix restart + if (fix_restart) + { + if (fix_restart_ps2) { + fadt_mod->Flags|= 0x400; + fadt_mod->Reset_SpaceID = 0x01; // System I/O + fadt_mod->Reset_BitWidth = 0x08; // 1 byte + fadt_mod->Reset_BitOffset = 0x00; // Offset 0 + fadt_mod->Reset_AccessWidth = 0x01; // Byte access + fadt_mod->Reset_Address = 0x64; // Address of the register + fadt_mod->Reset_Value = 0xfe; // Value to write to reset the system + msglog("FADT: PS2 Restart Fix applied!\n"); + } + else { + fadt_mod->Flags|= 0x400; + fadt_mod->Reset_SpaceID = 0x01; // System I/O + fadt_mod->Reset_BitWidth = 0x08; // 1 byte + fadt_mod->Reset_BitOffset = 0x00; // Offset 0 + fadt_mod->Reset_AccessWidth = 0x01; // Byte access + fadt_mod->Reset_Address = 0x0cf9; // Address of the register + fadt_mod->Reset_Value = 0x06; // Value to write to reset the system + verbose("FADT: ACPI Restart Fix applied!\n"); + } + + } + + // Patch DSDT Address if we have loaded DSDT.aml + if(new_dsdt) + { + DBG("DSDT: Old @%x,%x, ",fadt_mod->DSDT,fadt_mod->X_DSDT); + + fadt_mod->DSDT=(uint32_t)new_dsdt; + if ((uint32_t)(&(fadt_mod->X_DSDT))-(uint32_t)fadt_mod+8<=fadt_mod->Length) + fadt_mod->X_DSDT=(uint32_t)new_dsdt; + + DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT); + + verbose("FADT: Using custom DSDT!\n"); + } + + // Correct the checksum + fadt_mod->Checksum=0; + fadt_mod->Checksum=256-checksum8(fadt_mod,fadt_mod->Length); + + return fadt_mod; +} + +/* Setup ACPI without replacing DSDT. */ +int setupAcpiNoMod() +{ + // addConfigurationTable(&gEfiAcpiTableGuid, getAddressOfAcpiTable(), "ACPI"); + // addConfigurationTable(&gEfiAcpi20TableGuid, getAddressOfAcpi20Table(), "ACPI_20"); + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi10_p = (uint32_t)getAddressOfAcpiTable(); + acpi20_p = (uint32_t)getAddressOfAcpi20Table(); + addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); + if(acpi20_p) addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); + return 1; +} + +/* Setup ACPI. Replace DSDT if DSDT.aml is found */ +int setupAcpi(void) +{ + int version; + void *new_dsdt; + + + const char *filename; + char dirSpec[128]; + int len = 0; + + // always reset cpu count to 0 when injecting new acpi + acpi_cpu_count = 0; + + // Try using the file specified with the DSDT option + if (getValueForKey(kDSDT, &filename, &len, &bootInfo->chameleonConfig)) + { + sprintf(dirSpec, filename); + } + else + { + sprintf(dirSpec, "DSDT.aml"); + } + + // Load replacement DSDT + new_dsdt = loadACPITable(dirSpec); + // Mozodojo: going to patch FACP and load SSDT's even if DSDT.aml is not present + /*if (!new_dsdt) + { + return setupAcpiNoMod(); + }*/ + + // Mozodojo: Load additional SSDTs + struct acpi_2_ssdt *new_ssdt[32]; // 30 + 2 additional tables for pss & cst + int ssdt_count=0; + + // SSDT Options + bool drop_ssdt=false, generate_pstates=false, generate_cstates=false; + + getBoolForKey(kDropSSDT, &drop_ssdt, &bootInfo->chameleonConfig); + getBoolForKey(kGeneratePStates, &generate_pstates, &bootInfo->chameleonConfig); + getBoolForKey(kGenerateCStates, &generate_cstates, &bootInfo->chameleonConfig); + + DBG("Generating P-states config: %d\n", generate_pstates); + DBG("Generating C-states config: %d\n", generate_cstates); + + { + int i; + + for (i=0; i<30; i++) + { + char filename[512]; + + sprintf(filename, i>0?"SSDT-%d.aml":"SSDT.aml", i); + + if ( (new_ssdt[ssdt_count] = loadACPITable(filename)) ) + { + ssdt_count++; + } + else + { + break; + } + } + } + + // Do the same procedure for both versions of ACPI + for (version=0; version<2; version++) { + struct acpi_2_rsdp *rsdp, *rsdp_mod; + struct acpi_2_rsdt *rsdt, *rsdt_mod; + int rsdplength; + + // Find original rsdp + rsdp=(struct acpi_2_rsdp *)(version?getAddressOfAcpi20Table():getAddressOfAcpiTable()); + if (!rsdp) + { + DBG("No ACPI version %d found. Ignoring\n", version+1); + if (version) + addConfigurationTable(&gEfiAcpi20TableGuid, NULL, "ACPI_20"); + else + addConfigurationTable(&gEfiAcpiTableGuid, NULL, "ACPI"); + continue; + } + rsdplength=version?rsdp->Length:20; + + DBG("RSDP version %d found @%x. Length=%d\n",version+1,rsdp,rsdplength); + + /* FIXME: no check that memory allocation succeeded + * Copy and patch RSDP,RSDT, XSDT and FADT + * For more info see ACPI Specification pages 110 and following + */ + + rsdp_mod=(struct acpi_2_rsdp *) AllocateKernelMemory(rsdplength); + memcpy(rsdp_mod, rsdp, rsdplength); + rsdt=(struct acpi_2_rsdt *)(rsdp->RsdtAddress); + + DBG("RSDT @%x, Length %d\n",rsdt, rsdt->Length); + + if (rsdt && (uint32_t)rsdt !=0xffffffff && rsdt->Length<0x10000) + { + uint32_t *rsdt_entries; + int rsdt_entries_num; + int dropoffset=0, i; + + // mozo: using malloc cos I didn't found how to free already allocated kernel memory + rsdt_mod=(struct acpi_2_rsdt *)malloc(rsdt->Length); + memcpy (rsdt_mod, rsdt, rsdt->Length); + rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; + rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; + rsdt_entries=(uint32_t *)(rsdt_mod+1); + for (i=0;i<rsdt_entries_num;i++) + { + char *table=(char *)(rsdt_entries[i]); + if (!table) + continue; + + DBG("TABLE %c%c%c%c,",table[0],table[1],table[2],table[3]); + + rsdt_entries[i-dropoffset]=rsdt_entries[i]; + + if (drop_ssdt && tableSign(table, "SSDT")) + { + dropoffset++; + continue; + } + if (tableSign(table, "DSDT")) + { + DBG("DSDT found\n"); + + if(new_dsdt) + rsdt_entries[i-dropoffset]=(uint32_t)new_dsdt; + + continue; + } + if (tableSign(table, "FACP")) + { + struct acpi_2_fadt *fadt, *fadt_mod; + fadt=(struct acpi_2_fadt *)rsdt_entries[i]; + + DBG("FADT found @%x, Length %d\n",fadt, fadt->Length); + + if (!fadt || (uint32_t)fadt == 0xffffffff || fadt->Length>0x10000) + { + printf("FADT incorrect. Not modified\n"); + continue; + } + + fadt_mod = patch_fadt(fadt, new_dsdt); + rsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; + + // Generate _CST SSDT + if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) + { + DBG("C-states generated\n"); + generate_cstates = false; // Generate SSDT only once! + ssdt_count++; + } + + // Generating _PSS SSDT + if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) + { + DBG("P-states generated\n"); + generate_pstates = false; // Generate SSDT only once! + ssdt_count++; + } + + continue; + } + } + DBG("\n"); + + // Allocate rsdt in Kernel memory area + rsdt_mod->Length += 4*ssdt_count - 4*dropoffset; + struct acpi_2_rsdt *rsdt_copy = (struct acpi_2_rsdt *)AllocateKernelMemory(rsdt_mod->Length); + memcpy (rsdt_copy, rsdt_mod, rsdt_mod->Length); + free(rsdt_mod); rsdt_mod = rsdt_copy; + rsdp_mod->RsdtAddress=(uint32_t)rsdt_mod; + rsdt_entries_num=(rsdt_mod->Length-sizeof(struct acpi_2_rsdt))/4; + rsdt_entries=(uint32_t *)(rsdt_mod+1); + + // Mozodojo: Insert additional SSDTs into RSDT + if(ssdt_count>0) + { + int j; + + for (j=0; j<ssdt_count; j++) + rsdt_entries[i-dropoffset+j]=(uint32_t)new_ssdt[j]; + + verbose("RSDT: Added %d SSDT table(s)\n", ssdt_count); + } + + // Correct the checksum of RSDT + DBG("RSDT: Original checksum %d, ", rsdt_mod->Checksum); + + rsdt_mod->Checksum=0; + rsdt_mod->Checksum=256-checksum8(rsdt_mod,rsdt_mod->Length); + + DBG("New checksum %d at %x\n", rsdt_mod->Checksum,rsdt_mod); + } + else + { + rsdp_mod->RsdtAddress=0; + printf("RSDT not found or RSDT incorrect\n"); + } + + if (version) + { + struct acpi_2_xsdt *xsdt, *xsdt_mod; + + // FIXME: handle 64-bit address correctly + + xsdt=(struct acpi_2_xsdt*) ((uint32_t)rsdp->XsdtAddress); + DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, + xsdt->Length); + if (xsdt && (uint64_t)rsdp->XsdtAddress<0xffffffff && xsdt->Length<0x10000) + { + uint64_t *xsdt_entries; + int xsdt_entries_num, i; + int dropoffset=0; + + // mozo: using malloc cos I didn't found how to free already allocated kernel memory + xsdt_mod=(struct acpi_2_xsdt*)malloc(xsdt->Length); + memcpy(xsdt_mod, xsdt, xsdt->Length); + rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; + xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; + xsdt_entries=(uint64_t *)(xsdt_mod+1); + for (i=0;i<xsdt_entries_num;i++) + { + char *table=(char *)((uint32_t)(xsdt_entries[i])); + if (!table) + continue; + + xsdt_entries[i-dropoffset]=xsdt_entries[i]; + + if (drop_ssdt && tableSign(table, "SSDT")) + { + dropoffset++; + continue; + } + if (tableSign(table, "DSDT")) + { + DBG("DSDT found\n"); + + if (new_dsdt) + xsdt_entries[i-dropoffset]=(uint32_t)new_dsdt; + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + continue; + } + if (tableSign(table, "FACP")) + { + struct acpi_2_fadt *fadt, *fadt_mod; + fadt=(struct acpi_2_fadt *)(uint32_t)xsdt_entries[i]; + + DBG("FADT found @%x,%x, Length %d\n",(uint32_t)(xsdt_entries[i]>>32),fadt, + fadt->Length); + + if (!fadt || (uint64_t)xsdt_entries[i] >= 0xffffffff || fadt->Length>0x10000) + { + verbose("FADT incorrect or after 4GB. Dropping XSDT\n"); + goto drop_xsdt; + } + + fadt_mod = patch_fadt(fadt, new_dsdt); + xsdt_entries[i-dropoffset]=(uint32_t)fadt_mod; + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + // Generate _CST SSDT + if (generate_cstates && (new_ssdt[ssdt_count] = generate_cst_ssdt(fadt_mod))) + { + generate_cstates = false; // Generate SSDT only once! + ssdt_count++; + } + + // Generating _PSS SSDT + if (generate_pstates && (new_ssdt[ssdt_count] = generate_pss_ssdt((void*)fadt_mod->DSDT))) + { + generate_pstates = false; // Generate SSDT only once! + ssdt_count++; + } + + continue; + } + + DBG("TABLE %c%c%c%c@%x,",table[0],table[1],table[2],table[3],xsdt_entries[i]); + + } + + // Allocate xsdt in Kernel memory area + xsdt_mod->Length += 8*ssdt_count - 8*dropoffset; + struct acpi_2_xsdt *xsdt_copy = (struct acpi_2_xsdt *)AllocateKernelMemory(xsdt_mod->Length); + memcpy(xsdt_copy, xsdt_mod, xsdt_mod->Length); + free(xsdt_mod); xsdt_mod = xsdt_copy; + rsdp_mod->XsdtAddress=(uint32_t)xsdt_mod; + xsdt_entries_num=(xsdt_mod->Length-sizeof(struct acpi_2_xsdt))/8; + xsdt_entries=(uint64_t *)(xsdt_mod+1); + + // Mozodojo: Insert additional SSDTs into XSDT + if(ssdt_count>0) + { + int j; + + for (j=0; j<ssdt_count; j++) + xsdt_entries[i-dropoffset+j]=(uint32_t)new_ssdt[j]; + + verbose("Added %d SSDT table(s) into XSDT\n", ssdt_count); + } + + // Correct the checksum of XSDT + xsdt_mod->Checksum=0; + xsdt_mod->Checksum=256-checksum8(xsdt_mod,xsdt_mod->Length); + } + else + { + drop_xsdt: + + DBG("About to drop XSDT\n"); + + /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT. + * A Better strategy would be to generate + */ + + rsdp_mod->XsdtAddress=0xffffffffffffffffLL; + verbose("XSDT not found or XSDT incorrect\n"); + } + } + + // Correct the checksum of RSDP + + DBG("RSDP: Original checksum %d, ", rsdp_mod->Checksum); + + rsdp_mod->Checksum=0; + rsdp_mod->Checksum=256-checksum8(rsdp_mod,20); + + DBG("New checksum %d\n", rsdp_mod->Checksum); + + if (version) + { + DBG("RSDP: Original extended checksum %d", rsdp_mod->ExtendedChecksum); + + rsdp_mod->ExtendedChecksum=0; + rsdp_mod->ExtendedChecksum=256-checksum8(rsdp_mod,rsdp_mod->Length); + + DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + } + + //verbose("Patched ACPI version %d DSDT\n", version+1); + if (version) + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi20_p = (uint32_t)rsdp_mod; + addConfigurationTable(&gEfiAcpi20TableGuid, &acpi20_p, "ACPI_20"); + } + else + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + acpi10_p = (uint32_t)rsdp_mod; + addConfigurationTable(&gEfiAcpiTableGuid, &acpi10_p, "ACPI"); + } + } +#if DEBUG_ACPI + printf("Press a key to continue... (DEBUG_ACPI)\n"); + getchar(); +#endif + return 1; +} diff --git a/i386/libsaio/acpi_patcher.h b/i386/libsaio/acpi_patcher.h new file mode 100644 index 0000000..4f5a35d --- /dev/null +++ b/i386/libsaio/acpi_patcher.h @@ -0,0 +1,37 @@ +/* + * Copyright 2008 mackerintel + */ + +#ifndef __LIBSAIO_ACPI_PATCHER_H +#define __LIBSAIO_ACPI_PATCHER_H + +#include "libsaio.h" + +uint64_t acpi10_p; +uint64_t acpi20_p; +uint64_t smbios_p; + +extern int setupAcpi(); + +extern EFI_STATUS addConfigurationTable(); + +extern EFI_GUID gEfiAcpiTableGuid; +extern EFI_GUID gEfiAcpi20TableGuid; + +struct p_state +{ + union + { + uint16_t Control; + struct + { + uint8_t VID; // Voltage ID + uint8_t FID; // Frequency ID + }; + }; + + uint8_t CID; // Compare ID + uint32_t Frequency; +}; + +#endif /* !__LIBSAIO_ACPI_PATCHER_H */ diff --git a/i386/libsaio/allocate.c b/i386/libsaio/allocate.c new file mode 100644 index 0000000..717e05b --- /dev/null +++ b/i386/libsaio/allocate.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "sl.h" +#include "saio_internal.h" +#include "bootstruct.h" +#include "device_tree.h" + +static long gImageLastKernelAddr; + +#define kPageSize 4096 +#define RoundPage(x) ((((unsigned)(x)) + kPageSize - 1) & ~(kPageSize - 1)) + + +long +AllocateMemoryRange(char * rangeName, long start, long length, long type) +{ + char *nameBuf; + uint32_t *buffer; + + nameBuf = malloc(strlen(rangeName) + 1); + if (nameBuf == 0) return -1; + strcpy(nameBuf, rangeName); + + buffer = malloc(2 * sizeof(uint32_t)); + if (buffer == 0) return -1; + + buffer[0] = start; + buffer[1] = length; + + DT__AddProperty(gMemoryMapNode, nameBuf, 2 * sizeof(uint32_t), (char *)buffer); + + return 0; +} + +long +AllocateKernelMemory( long inSize ) +{ + long addr; + + if (gImageLastKernelAddr == 0) { + gImageLastKernelAddr = RoundPage( bootArgs->kaddr + + bootArgs->ksize ); + } + addr = gImageLastKernelAddr; + gImageLastKernelAddr += RoundPage(inSize); + + if ( gImageLastKernelAddr >= (KERNEL_ADDR + KERNEL_LEN) ) { + stop ("AllocateKernelMemory error"); + } + + bootArgs->ksize = gImageLastKernelAddr - bootArgs->kaddr; + + return addr; +} diff --git a/i386/libsaio/aml_generator.c b/i386/libsaio/aml_generator.c new file mode 100644 index 0000000..6d24451 --- /dev/null +++ b/i386/libsaio/aml_generator.c @@ -0,0 +1,498 @@ +/* + * aml_generator.c + * Chameleon + * + * Created by Mozodojo on 20/07/10. + * Copyright 2010 mozo. All rights reserved. + * + */ + +#include "aml_generator.h" + +bool aml_add_to_parent(struct aml_chunk* parent, struct aml_chunk* node) +{ + if (parent && node) + { + switch (parent->Type) + { + case AML_CHUNK_NONE: + case AML_CHUNK_BYTE: + case AML_CHUNK_WORD: + case AML_CHUNK_DWORD: + case AML_CHUNK_QWORD: + case AML_CHUNK_ALIAS: + verbose("aml_add_to_parent: node doesn't support child nodes!\n"); + return false; + case AML_CHUNK_NAME: + if (parent->First) + { + verbose("aml_add_to_parent: name node supports only one child node!\n"); + return false; + } + break; + + default: + break; + } + + if (!parent->First) + parent->First = node; + + if (parent->Last) + parent->Last->Next = node; + + parent->Last = node; + + return true; + } + + return false; +} + +struct aml_chunk* aml_create_node(struct aml_chunk* parent) +{ + struct aml_chunk* node = (struct aml_chunk*)malloc(sizeof(struct aml_chunk)); + + aml_add_to_parent(parent, node); + + return node; +} + +void aml_destroy_node(struct aml_chunk* node) +{ + // Delete child nodes + struct aml_chunk* child = node->First; + + while (child) + { + struct aml_chunk* next = child->Next; + + if (child->Buffer) + free(child->Buffer); + + free(child); + + child = next; + } + + // Free node + if (node->Buffer) + free(node->Buffer); + + free(node); +} + +struct aml_chunk* aml_add_buffer(struct aml_chunk* parent, const char* buffer, unsigned int size) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_NONE; + node->Length = size; + node->Buffer = malloc(node->Length); + memcpy(node->Buffer, buffer, node->Length); + } + + return node; +} + +struct aml_chunk* aml_add_byte(struct aml_chunk* parent, unsigned char value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_BYTE; + + node->Length = 1; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value; + } + + return node; +} + +struct aml_chunk* aml_add_word(struct aml_chunk* parent, unsigned int value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_WORD; + node->Length = 2; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = value >> 8; + } + + return node; +} + +struct aml_chunk* aml_add_dword(struct aml_chunk* parent, unsigned long value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_DWORD; + node->Length = 4; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = (value >> 8) & 0xff; + node->Buffer[2] = (value >> 16) & 0xff; + node->Buffer[3] = (value >> 24) & 0xff; + } + + return node; +} + +struct aml_chunk* aml_add_qword(struct aml_chunk* parent, unsigned long long value) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_QWORD; + node->Length = 8; + node->Buffer = malloc(node->Length); + node->Buffer[0] = value & 0xff; + node->Buffer[1] = (value >> 8) & 0xff; + node->Buffer[2] = (value >> 16) & 0xff; + node->Buffer[3] = (value >> 24) & 0xff; + node->Buffer[4] = (value >> 32) & 0xff; + node->Buffer[5] = (value >> 40) & 0xff; + node->Buffer[6] = (value >> 48) & 0xff; + node->Buffer[7] = (value >> 56) & 0xff; + } + + return node; +} + +unsigned int aml_fill_simple_name(char* buffer, const char* name) +{ + if (strlen(name) < 4) + { + verbose("aml_fill_simple_name: simple name %s has incorrect lengh! Must be 4.\n", name); + return 0; + } + + memcpy(buffer, name, 4); + return 4; +} + +unsigned int aml_fill_name(struct aml_chunk* node, const char* name) +{ + if (!node) + return 0; + + int len = strlen(name), offset = 0, count = len / 4; + + if ((len % 4) > 1 || count == 0) + { + verbose("aml_fill_name: pathname %s has incorrect length! Must be 4, 8, 12, 16, etc...\n", name); + return 0; + } + + unsigned int root = 0; + + if ((len % 4) == 1 && name[0] == '\\') + root++; + + if (count == 1) + { + node->Length = 4 + root; + node->Buffer = malloc(node->Length); + memcpy(node->Buffer, name, 4 + root); + return node->Length; + } + + if (count == 2) + { + node->Length = 2 + 8; + node->Buffer = malloc(node->Length); + node->Buffer[offset++] = 0x5c; // Root Char + node->Buffer[offset++] = 0x2e; // Double name + memcpy(node->Buffer+offset, name + root, 8); + return node->Length; + } + + node->Length = 3 + count*4; + node->Buffer = malloc(node->Length); + node->Buffer[offset++] = 0x5c; // Root Char + node->Buffer[offset++] = 0x2f; // Multi name + node->Buffer[offset++] = count; // Names count + memcpy(node->Buffer+offset, name + root, count*4); + + return node->Length; +} + +struct aml_chunk* aml_add_scope(struct aml_chunk* parent, const char* name) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_SCOPE; + + aml_fill_name(node, name); + } + + return node; +} + +struct aml_chunk* aml_add_name(struct aml_chunk* parent, const char* name) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_NAME; + + aml_fill_name(node, name); + } + + return node; +} + +struct aml_chunk* aml_add_package(struct aml_chunk* parent) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_PACKAGE; + + node->Length = 1; + node->Buffer = malloc(node->Length); + } + + return node; +} + +struct aml_chunk* aml_add_alias(struct aml_chunk* parent, const char* name1, const char* name2) +{ + struct aml_chunk* node = aml_create_node(parent); + + if (node) + { + node->Type = AML_CHUNK_ALIAS; + + node->Length = 8; + node->Buffer = malloc(node->Length); + aml_fill_simple_name(node->Buffer, name1); + aml_fill_simple_name(node->Buffer+4, name2); + } + + return node; +} + +unsigned char aml_get_size_length(unsigned int size) +{ + if (size + 1 <= 0x3f) + return 1; + else if (size + 2 <= 0x3fff) + return 2; + else if (size + 3 <= 0x3fffff) + return 3; + + return 4; +} + +unsigned int aml_calculate_size(struct aml_chunk* node) +{ + if (node) + { + node->Size = 0; + + // Calculate child nodes size + struct aml_chunk* child = node->First; + unsigned char child_count = 0; + + while (child) + { + child_count++; + + node->Size += aml_calculate_size(child); + + child = child->Next; + } + + switch (node->Type) + { + case AML_CHUNK_NONE: + node->Size += node->Length; + break; + case AML_CHUNK_SCOPE: + node->Size += 1 + node->Length; + node->Size += aml_get_size_length(node->Size); + break; + case AML_CHUNK_PACKAGE: + node->Buffer[0] = child_count; + node->Size += 1 + node->Length; + node->Size += aml_get_size_length(node->Size); + break; + + case AML_CHUNK_BYTE: + if (node->Buffer[0] == 0x0 || node->Buffer[0] == 0x1) + { + node->Size += node->Length; + } + else + { + node->Size += 1 + node->Length; + } + + break; + + case AML_CHUNK_WORD: + case AML_CHUNK_DWORD: + case AML_CHUNK_QWORD: + case AML_CHUNK_ALIAS: + case AML_CHUNK_NAME: + node->Size += 1 + node->Length; + break; + } + + return node->Size; + } + + return 0; +} + +unsigned int aml_write_byte(unsigned char value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value; + + return offset; +} + +unsigned int aml_write_word(unsigned int value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value & 0xff; + buffer[offset++] = value >> 8; + + return offset; +} + +unsigned int aml_write_dword(unsigned long value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value & 0xff; + buffer[offset++] = (value >> 8) & 0xff; + buffer[offset++] = (value >> 16) & 0xff; + buffer[offset++] = (value >> 24) & 0xff; + + return offset; +} + +unsigned int aml_write_qword(unsigned long long value, char* buffer, unsigned int offset) +{ + buffer[offset++] = value & 0xff; + buffer[offset++] = (value >> 8) & 0xff; + buffer[offset++] = (value >> 16) & 0xff; + buffer[offset++] = (value >> 24) & 0xff; + buffer[offset++] = (value >> 32) & 0xff; + buffer[offset++] = (value >> 40) & 0xff; + buffer[offset++] = (value >> 48) & 0xff; + buffer[offset++] = (value >> 56) & 0xff; + + return offset; +} + +unsigned int aml_write_buffer(const char* value, unsigned int size, char* buffer, unsigned int offset) +{ + if (size > 0) + { + memcpy(buffer + offset, value, size); + } + + return offset + size; +} + +unsigned int aml_write_size(unsigned int size, char* buffer, unsigned int offset) +{ + if (size <= 0x3f) + { + buffer[offset++] = size; + } + else if (size <= 0x3fff) + { + buffer[offset++] = 0x40 | (size & 0xf); + buffer[offset++] = (size >> 4) & 0xff; + } + else if (size <= 0x3fffff) + { + buffer[offset++] = 0x80 | (size & 0xf); + buffer[offset++] = (size >> 4) & 0xff; + buffer[offset++] = (size >> 12) & 0xff; + } + else + { + buffer[offset++] = 0xc0 | (size & 0xf); + buffer[offset++] = (size >> 4) & 0xff; + buffer[offset++] = (size >> 12) & 0xff; + buffer[offset++] = (size >> 20) & 0xff; + } + + return offset; +} + +unsigned int aml_write_node(struct aml_chunk* node, char* buffer, unsigned int offset) +{ + if (node && buffer) + { + unsigned int old = offset; + + switch (node->Type) + { + case AML_CHUNK_NONE: + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + break; + + case AML_CHUNK_SCOPE: + case AML_CHUNK_PACKAGE: + offset = aml_write_byte(node->Type, buffer, offset); + offset = aml_write_size(node->Size-1, buffer, offset); + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + break; + + case AML_CHUNK_BYTE: + if (node->Buffer[0] == 0x0 || node->Buffer[0] == 0x1) + { + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + } + else + { + offset = aml_write_byte(node->Type, buffer, offset); + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + } + break; + + case AML_CHUNK_WORD: + case AML_CHUNK_DWORD: + case AML_CHUNK_QWORD: + case AML_CHUNK_ALIAS: + case AML_CHUNK_NAME: + offset = aml_write_byte(node->Type, buffer, offset); + offset = aml_write_buffer(node->Buffer, node->Length, buffer, offset); + break; + + default: + break; + } + + struct aml_chunk* child = node->First; + + while (child) + { + offset = aml_write_node(child, buffer, offset); + + child = child->Next; + } + + if (offset - old != node->Size) + verbose("Node size incorrect: 0x%x\n", node->Type); + } + + return offset; +} diff --git a/i386/libsaio/aml_generator.h b/i386/libsaio/aml_generator.h new file mode 100644 index 0000000..70d3c77 --- /dev/null +++ b/i386/libsaio/aml_generator.h @@ -0,0 +1,61 @@ +/* + * aml_generator.h + * Chameleon + * + * Created by Mozodojo on 20/07/10. + * Copyright 2010 mozo. All rights reserved. + * + */ + +#ifndef __LIBSAIO_AML_GENERATOR_H +#define __LIBSAIO_AML_GENERATOR_H + +#include "libsaio.h" + +#define AML_CHUNK_NONE 0xff +#define AML_CHUNK_ZERO 0x00 +#define AML_CHUNK_ONE 0x01 +#define AML_CHUNK_ALIAS 0x06 +#define AML_CHUNK_NAME 0x08 +#define AML_CHUNK_BYTE 0x0A +#define AML_CHUNK_WORD 0x0B +#define AML_CHUNK_DWORD 0x0C +#define AML_CHUNK_STRING 0x0D +#define AML_CHUNK_QWORD 0x0E +#define AML_CHUNK_SCOPE 0x10 +#define AML_CHUNK_PACKAGE 0x12 + +struct aml_chunk +{ + unsigned char Type; + unsigned int Length; + char* Buffer; + + unsigned int Size; + + struct aml_chunk* Next; + struct aml_chunk* First; + struct aml_chunk* Last; +}; + +static inline bool aml_isvalidchar(char c) +{ + return isupper(c) || isdigit(c) || c == '_'; +}; + +bool aml_add_to_parent(struct aml_chunk* parent, struct aml_chunk* node); +struct aml_chunk* aml_create_node(struct aml_chunk* parent); +void aml_destroy_node(struct aml_chunk* node); +struct aml_chunk* aml_add_buffer(struct aml_chunk* parent, const char* buffer, unsigned int size); +struct aml_chunk* aml_add_byte(struct aml_chunk* parent, unsigned char value); +struct aml_chunk* aml_add_word(struct aml_chunk* parent, unsigned int value); +struct aml_chunk* aml_add_dword(struct aml_chunk* parent, unsigned long value); +struct aml_chunk* aml_add_qword(struct aml_chunk* parent, unsigned long long value); +struct aml_chunk* aml_add_scope(struct aml_chunk* parent, const char* name); +struct aml_chunk* aml_add_name(struct aml_chunk* parent, const char* name); +struct aml_chunk* aml_add_package(struct aml_chunk* parent); +struct aml_chunk* aml_add_alias(struct aml_chunk* parent, const char* name1, const char* name2); +unsigned int aml_calculate_size(struct aml_chunk* node); +unsigned int aml_write_node(struct aml_chunk* node, char* buffer, unsigned int offset); + +#endif /* !__LIBSAIO_AML_GENERATOR_H */ \ No newline at end of file diff --git a/i386/libsaio/asm.s b/i386/libsaio/asm.s new file mode 100644 index 0000000..21ce6a4 --- /dev/null +++ b/i386/libsaio/asm.s @@ -0,0 +1,497 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ +/* + * HISTORY + * $Log: asm.s,v $ + * Revision 1.8 2005/06/24 22:47:12 curtisg + * Merging changes for 4159531 to pass data to the kernel in EFI format. + * + * Revision 1.7 2004/05/13 17:58:38 curtisg + * Integrating: + * <rdar://problem/3094680>: (Silent boot) + * <rdar://problem/3363893>: (5 sec boot timeout is too short) + * <rdar://problem/3533781>: (Boot option to display graphics modes) + * <rdar://problem/3545539>: (Default graphics mode should be 32-bit) + * <rdar://problem/3643065>: (Booter should always find a video mode) + * <rdar://problem/3643815>: (Booter displays "0MB" VRAM) + * + * Revision 1.6 2003/11/05 20:51:02 curtisg + * Integrated 3069695,3331770,3370488,3371823 + * + * Revision 1.5.26.1 2003/10/27 23:57:59 curtisg + * Added printing of volume names, better handling of extended + * partitions, and updated Apple license strings. + * New chain booter should work better with foreign operating + * systems. + * + * Revision 1.5 2002/11/05 20:34:26 jliu + * Integrating: + * 3051234 boot shouldnt require Graphics = Yes + * 3091627 Need support for refresh rate adjustment + * + * Revision 1.4 2002/10/02 00:06:18 curtisg + * Integrating PR-3032510. + * + * Revision 1.3.6.1 2002/08/30 21:16:29 curtisg + * KERNBOOTSTRUCT is going away in favor of KernelBootArgs_t in <pexpert/i386/boot.h>. + * + * Revision 1.3 2002/07/09 14:06:21 jliu + * Merging changes from PR-2954224 branch in boot/i386. + * + * Revision 1.2.30.1 2002/07/05 16:24:51 jliu + * Merged UFS/HFS/HFS+ filesystem support from BootX. + * Moved boot2 load address due to increased size. boot0/boot1 also changed. + * Updated boot graphics and CLUT. + * Added support to chain load foreign booters. + * Fixed param passing bug in network loader. + * Misc cleanup in libsaio. + * + * Revision 1.2 2000/05/23 23:01:11 lindak + * Merged PR-2309530 into Kodiak (liu i386 booter: does not support label-less + * ufs partitions) + * + * Revision 1.1.1.2.4.1 2000/05/13 17:07:39 jliu + * New boot0 (boot1 has been deprecated). Booter must now reside in its own partition, no disk label required. + * + * Revision 1.1.1.2 1999/08/04 21:16:57 wsanchez + * Impoort of boot-66 + * + * Revision 1.3 1999/08/04 21:12:12 wsanchez + * Update APSL + * + * Revision 1.2 1999/03/25 05:48:30 wsanchez + * Add APL. + * Remove unused gzip code. + * Remove unused Adobe fonts. + * + * Revision 1.1.1.1.66.2 1999/03/16 16:08:54 wsanchez + * Substitute License + * + * Revision 1.1.1.1.66.1 1999/03/16 07:33:21 wsanchez + * Add APL + * + * Revision 1.1.1.1 1997/12/05 21:57:57 wsanchez + * Import of boot-25 (~mwatson) + * + * Revision 2.1.1.2 90//03//22 17:59:50 rvb + * Added _sp() => where is the stack at. [kupfer] + * + * Revision 2.1.1.1 90//02//09 17:25:04 rvb + * Add Intel copyright + * [90//02//09 rvb] + * + */ + + +// INTEL CORPORATION PROPRIETARY INFORMATION +// +// This software is supplied under the terms of a license agreement or +// nondisclosure agreement with Intel Corporation and may not be copied +// nor disclosed except in accordance with the terms of that agreement. +// +// Copyright 1988 Intel Corporation +// Copyright 1988, 1989 by Intel Corporation +// + +#include <architecture/i386/asm_help.h> +#include "memory.h" + +#define data32 .byte 0x66 +#define addr32 .byte 0x67 + + .file "asm.s" + +CR0_PE_ON = 0x1 +#ifdef BOOT1 +CR0_PE_OFF = 0x7ffffffe +#else +CR0_PE_OFF = 0x7ffffff0 +#endif + +STACK32_BASE = ADDR32(STACK_SEG, 0) +STACK16_SEG = STACK_SEG +CODE32_BASE = ADDR32(BASE_SEG, 0) +CODE16_SEG = BASE_SEG + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Pointer to 6-bytes in memory that contains the base address and the limit +// (size of GDT table in bytes) of the GDT. The LGDT is the only instruction +// that directly loads a linear address (not a segment relative address) and +// a limit in protected mode. + +.globl _Gdtr + //.data + .section __INIT,__data // turbo - Data that must be in the first segment + .align 2, 0x90 +_Gdtr: + .word GDTLIMIT + .long vtop(_Gdt) + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// IDTR representing real-mode IVT. The values are constant. + //.const + .section __INIT,__data // turbo - Data that must be in the first segment +// Real mode IDT + .align 2 +.globl _Idtr_real +_Idtr_real: + .word 0x03ff + .long 0x00000000 + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// IDTR representing protected-mode IDT. It is initially NULL which tells the +// procesor that no IDT is available. After we get into protected mode we can +// allocate memory for a proper IDT and update this IDTR to point to it. + //.data + .section __INIT,__data // turbo - Data that must be in the first segment + .align 2 +.globl _Idtr_prot +_Idtr_prot: + .word 0 + .long 0 + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Data area for __switch_stack. +// +save_sp: .long STACK_OFS +save_ss: .long STACK_SEG + + //.text + .section __INIT,__text // turbo - This code must reside within the first segment +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// real_to_prot() +// +// Transfer from real mode to protected mode. +// Preserves all registers except EAX. +// +LABEL(__real_to_prot) + + // Interrupts are disabled in protected mode. + + cli + + // Load the Global Descriptor Table Register (GDTR). + + addr32 + data32 + lgdt OFFSET16(_Gdtr) + + // Enter protected mode by setting the PE bit in CR0. + + mov %cr0, %eax + data32 + or $CR0_PE_ON, %eax + mov %eax, %cr0 + + // Make intrasegment jump to flush the processor pipeline and + // reload CS register. + + data32 + ljmp $0x08, $xprot + +xprot: + // we are in USE32 mode now + // set up the protected mode segment registers : DS, SS, ES, FS, GS + + mov $0x10, %eax + movw %ax, %ds + movw %ax, %ss + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + + // set up the PM IDT + lidt _Idtr_prot + + // Convert STACK_SEG:SP to 32-bit linear stack pointer. + + movzwl %sp, %eax + addl $STACK32_BASE, %eax + movl %eax, %esp + + // Convert STACK_SEG:BP to 32-bit linear base pointer. + + movzwl %bp, %eax + addl $STACK32_BASE, %eax + movl %eax, %ebp + + // Modify the caller's return address on the stack from + // segment offset to linear address. + + popl %eax + addl $CODE32_BASE, %eax + pushl %eax + + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// prot_to_real() +// +// Transfer from protected mode to real mode. +// Preserves all registers except EAX. +// +LABEL(__prot_to_real) + + // Load real-mode IDT while we're still in USE32 mode so we don't need + // 32-bit addressing prefixes. + lidt _Idtr_real + + // Set up segment registers appropriate for real mode. + + movw $0x30, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movw %ax, %ss + + ljmp $0x18, $x16 // change to USE16 mode + +x16: + mov %cr0, %eax // clear the PE bit of CR0 + data32 + and $CR0_PE_OFF, %eax + mov %eax, %cr0 + + // make intersegment jmp to flush the processor pipeline + // and reload CS register + + data32 + ljmp $CODE16_SEG, $xreal - CODE32_BASE + +xreal: + // we are in real mode now + // set up the real mode segment registers : DS, DS, ES, FS, GS + + movw %cs, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + + // load stack segment register SS. + + data32 + movl $STACK16_SEG, %eax + movw %ax, %ss + + // clear top 16-bits of ESP and EBP. + + data32 + movzwl %sp, %esp + data32 + movzwl %bp, %ebp + + // Modify caller's return address on the stack + // from linear address to segment offset. + + data32 + popl %eax + data32 + movzwl %ax, %eax + data32 + pushl %eax + + // Reenable maskable interrupts. + + sti + + data32 + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// halt() +// +LABEL(_halt) +#ifdef BOOT1 + hlt +#else + call _bgetc +#endif + jmp _halt + +#ifndef BOOT1 +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// startprog(phyaddr, arg) +// Start the program on protected mode where phyaddr is the entry point. +// Passes arg to the program in %eax. +// +LABEL(_startprog) + push %ebp + mov %esp, %ebp + + mov 0xc(%ebp), %eax // argument to program + mov 0x8(%ebp), %ecx // entry offset + mov $0x28, %ebx // segment + push %ebx + push %ecx + + // set up %ds and %es + + mov $0x20, %ebx + movw %bx, %ds + movw %bx, %es + + lret +#endif + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Returns the current stack pointer. +// +LABEL(__sp) + mov %esp, %eax + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Returns the current frame pointer. +// +LABEL(__bp) + mov %ebp, %eax + ret + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// switch_stack() +// +// Switches stack pointer between SS:SP and memory save_ss:save_sp. +// Call this function from real mode only!!! +// +// AX, DI, and SI are clobbered. +// +LABEL(__switch_stack) + popl %eax # save return address + popl %edi # discard upper 16-bit + + data32 + addr32 + movl OFFSET16(save_ss), %esi # new SS to SI + + data32 + addr32 + movl OFFSET16(save_sp), %edi # new SP to DI + + addr32 + mov %ss, OFFSET16(save_ss) # save current SS to memory + + data32 + addr32 + movl %esp, OFFSET16(save_sp) # save current SP to memory + + cli + mov %si, %ss # switch stack + mov %di, %sp + sti + + pushl %eax # push IP of caller onto the new stack + + xorl %eax, %eax + xorl %esi, %esi + xorl %edi, %edi + + ret + +#ifndef BOOT1 +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// loader() +// +// Issue a request to the network loader. +// +LABEL(_loader) + enter $0, $0 + pushal + + # + # Pass a far pointer to the command structure + # to the INT call through DX:CX. + # + # The command code is in BX. + # + + movw 8(%ebp), %bx # 8[EBP] = command code + movw 12(%ebp), %cx # 12[EBP] = command structure offset + movw 14(%ebp), %dx # 14[EBP] = command structure segment + + call __prot_to_real # Revert to real mode + + ###### Real Mode Begin ###### + + data32 + call __switch_stack # Switch to NBP stack + + int $0x2b # Call NBP + + data32 + call __switch_stack # Restore stack + + data32 + call __real_to_prot # Back to protected mode + + ###### Real Mode End ###### + + popal + leave + ret +#endif + +#if UNUSED +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// pcpy(src, dst, cnt) +// where src is a virtual address and dst is a physical address +// +LABEL(_pcpy) + push %ebp + mov %esp, %ebp + push %es + push %esi + push %edi + push %ecx + + cld + + // set %es to point at the flat segment + + mov $0x20, %eax + movw %ax , %es + + mov 0x8(%ebp), %esi // source + mov 0xc(%ebp), %edi // destination + mov 0x10(%ebp), %ecx // count + + rep + movsb + + pop %ecx + pop %edi + pop %esi + pop %es + pop %ebp + + ret +#endif diff --git a/i386/libsaio/ati.c b/i386/libsaio/ati.c new file mode 100644 index 0000000..e6587f2 --- /dev/null +++ b/i386/libsaio/ati.c @@ -0,0 +1,2322 @@ +/* + * ATI Graphics Card Enabler, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include "ati.h" + + +static const char *chip_family_name[] = { + "UNKNOW", + "R420", + "RV410", + "RV515", + "R520", + "RV530", + "RV560", + "RV570", + "R580", + /* IGP */ + "RS600", + "RS690", + "RS740", + "RS780", + "RS880", + /* R600 */ + "R600", + "RV610", + "RV620", + "RV630", + "RV635", + "RV670", + /* R700 */ + "RV710", + "RV730", + "RV740", + "RV772", + "RV770", + "RV790", + /* Evergreen */ + "Cedar", + "Cypress", + "Hemlock", + "Juniper", + "Redwood", + "Broadway", + // "Madison", + // "Park", + /* Northern Islands */ + // "Antilles", + "Barts", + "Caicos", + "Cayman", + "Turks", + /* Southern Islands */ + "Tahiti", + "Pitcairn", + // "CapeVerde", + // "Thames", + // "Lombok", + // "NewZealand", + "" +}; + +static card_config_t card_configs[] = { + {NULL, 0}, + /* OLDController */ + {"Wormy", 2}, + {"Alopias", 2}, + {"Caretta", 1}, + {"Kakapo", 3}, + {"Kipunji", 4}, + {"Peregrine", 2}, + {"Raven", 3}, + {"Sphyrna", 1}, + /* AMD2400Controller */ + {"Iago", 2}, + /* AMD2600Controller */ + {"Hypoprion", 2}, + {"Lamna", 2}, + /* AMD3800Controller */ + {"Megalodon", 3}, + {"Triakis", 2}, + /* AMD4600Controller */ + {"Flicker", 3}, + {"Gliff", 3}, + {"Shrike", 3}, + /* AMD4800Controller */ + {"Cardinal", 2}, + {"Motmot", 2}, + {"Quail", 3}, + /* AMD5000Controller */ + {"Douc", 2}, + {"Langur", 3}, + {"Uakari", 4}, + {"Zonalis", 6}, + {"Alouatta", 4}, + {"Hoolock", 3}, + {"Vervet", 4}, + {"Baboon", 3}, + {"Eulemur", 3}, + {"Galago", 2}, + {"Colobus", 2}, + {"Mangabey", 2}, + {"Nomascus", 4}, + {"Orangutan", 2}, + /* AMD6000Controller */ + {"Pithecia", 3}, + {"Bulrushes", 6}, + {"Cattail", 4}, + {"Hydrilla", 5}, + {"Duckweed", 4}, + {"Fanwort", 4}, + {"Elodea", 5}, + {"Kudzu", 2}, + {"Gibba", 5}, + {"Lotus", 3}, + {"Ipomoea", 3}, + {"Muskgrass", 4}, + {"Juncus", 4}, + {"Osmunda", 4}, + {"Pondweed", 3}, + {"Spikerush", 4}, + {"Typha", 5}, + /* AMD7000Controller */ + {"Aji", 4}, + {"Buri", 4}, + {"Chutoro", 5}, + {"Dashimaki", 4}, + {"Ebi", 5}, + {"Gari", 5}, + {"Futomaki", 4}, + {"Hamachi", 4}, + {"OPM", 6}, + {"Ikura", 6}, + {"IkuraS", 1} +}; + +static radeon_card_info_t radeon_cards[] = { + + // Earlier cards are not supported + // + // Layout is device_id, subsys_id (subsystem id plus vendor id), chip_family_name, display name, frame buffer + // Cards are grouped by device id and vendor id then sorted by subsystem id to make it easier to add new cards + // + + { 0x9400, 0x01611043, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9400, 0x021E1043, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9400, 0x25521002, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9400, 0x30001002, CHIP_FAMILY_R600, "ATI Radeon HD 2900 PRO", kNull }, + { 0x9400, 0x31421002, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + + { 0x9440, 0x05021002, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x0851174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x114A174B, CHIP_FAMILY_RV770, "ATI Radeon HD4870 Vapor-X", kCardinal }, + { 0x9440, 0x24401682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x24411682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x24441682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + { 0x9440, 0x24451682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870", kMotmot }, + + { 0x9441, 0x02601043, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9441, 0x02841043, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9441, 0x24401682, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9441, 0x25421002, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + + { 0x9442, 0x05021002, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0x080110B0, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0x24701682, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0x24711682, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0xE104174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x9442, 0xE810174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + + { 0x944A, 0x02A21028, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001043, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001458, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001462, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001545, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001682, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x3000174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x30001787, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + { 0x944A, 0x300017AF, CHIP_FAMILY_RV770, "ATI Radeon HD 4850", kMotmot }, + + { 0x944C, 0x05021002, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + { 0x944C, 0x20031787, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + { 0x944C, 0x24801682, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + { 0x944C, 0x24811682, CHIP_FAMILY_RV770, "ATI Radeon HD 4830", kMotmot }, + + { 0x944E, 0x30001787, CHIP_FAMILY_RV770, "ATI Radeon HD 4730", kMotmot }, + { 0x944E, 0x30101787, CHIP_FAMILY_RV770, "ATI Radeon HD 4810", kMotmot }, + { 0x944E, 0x31001787, CHIP_FAMILY_RV770, "ATI Radeon HD 4820", kMotmot }, + { 0x944E, 0x3260174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4810", kMotmot }, + { 0x944E, 0x3261174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4810", kMotmot }, + + { 0x9460, 0x27021682, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, + { 0x9460, 0xE115174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, + { 0x9460, 0xE118174B, CHIP_FAMILY_RV770, "ATI Radeon HD 4890", kMotmot }, + + { 0x9480, 0x01211025, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kGliff }, + { 0x9480, 0x03111025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x03121025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x031C1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x031D1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x036C1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x036D1025, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0x3628103C, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kGliff }, + { 0x9480, 0x9035104D, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kGliff }, + { 0x9480, 0xFD001179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFDD01179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFD121179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFD501179, CHIP_FAMILY_RV730, "ATI Radeon HD 4650M", kPeregrine }, + { 0x9480, 0xFF001179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF151179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF221179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF501179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF801179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFF821179, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + { 0x9480, 0xFFA01179, CHIP_FAMILY_RV730, "ATI Radeon HD 4600M", kPeregrine }, + { 0x9480, 0xFFA21179, CHIP_FAMILY_RV730, "ATI Radeon HD 5165M", kPeregrine }, + + { 0x9490, 0x20031787, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kFlicker }, + { 0x9490, 0x25421028, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kFlicker }, + { 0x9490, 0x30501787, CHIP_FAMILY_RV730, "ATI Radeon HD 4710", kPeregrine }, + { 0x9490, 0x300017AF, CHIP_FAMILY_RV730, "ATI Radeon HD 4710", kPeregrine }, + { 0x9490, 0x4710174B, CHIP_FAMILY_RV730, "ATI Radeon HD 4710", kPeregrine }, + + { 0x9498, 0x10001043, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kPeregrine }, + { 0x9498, 0x20091787, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x21CF1458, CHIP_FAMILY_RV730, "ATI Radeon HD 4600", kPeregrine }, + { 0x9498, 0x24511682, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x24521682, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x24541682, CHIP_FAMILY_RV730, "ATI Radeon HD 4650", kPeregrine }, + { 0x9498, 0x29331682, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kPeregrine }, + { 0x9498, 0x29341682, CHIP_FAMILY_RV730, "ATI Radeon HD 4670", kPeregrine }, + { 0x9498, 0x30501787, CHIP_FAMILY_RV730, "ATI Radeon HD 4700", kPeregrine }, + { 0x9498, 0x31001787, CHIP_FAMILY_RV730, "ATI Radeon HD 4720", kPeregrine }, + + { 0x94B3, 0x0D001002, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B3, 0x1170174B, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B3, 0x29001682, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + + { 0x94C1, 0x0D021002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x10021002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Pro", kNull }, + { 0x94C1, 0x0D021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x21741458, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x10331462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x10401462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + { 0x94C1, 0x11101462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 XT", kNull }, + + { 0x94C3, 0x03421002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x01011A93, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x03021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x03421002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x04021028, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x10321462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x10411462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x11041462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x11051462, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x203817AF, CHIP_FAMILY_RV610, "ATI Radeon HD 2400", kNull }, + { 0x94C3, 0x216A1458, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x21721458, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x2247148C, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 LE", kNull }, + { 0x94C3, 0x22471787, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 LE", kNull }, + { 0x94C3, 0x30001025, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x30001458, CHIP_FAMILY_RV610, "ATI Radeon HD 3410", kNull }, + { 0x94C3, 0x30001462, CHIP_FAMILY_RV610, "ATI Radeon HD 3410", kNull }, + { 0x94C3, 0x3000148C, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x30001642, CHIP_FAMILY_RV610, "ATI Radeon HD 3410", kNull }, + { 0x94C3, 0x3000174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x30001787, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kNull }, + { 0x94C3, 0x37161642, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0x94C31002, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0xE370174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + { 0x94C3, 0xE400174B, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO", kNull }, + + { 0x9501, 0x25421002, CHIP_FAMILY_RV670, "ATI Radeon HD 3870", kNull }, + { 0x9501, 0x30001002, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9501, 0x3000174B, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9501, 0x30001787, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9501, 0x4750174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + + { 0x9505, 0x024A1043, CHIP_FAMILY_RV670, "ATI Radeon HD 3850", kNull }, + { 0x9505, 0x25421002, CHIP_FAMILY_RV670, "ATI Radeon HD 3850", kNull }, + { 0x9505, 0x30001002, CHIP_FAMILY_RV630, "ATI Radeon HD 3690", kNull }, + { 0x9505, 0x3000148C, CHIP_FAMILY_RV670, "ATI Radeon HD 3850", kNull }, + { 0x9505, 0x3000174B, CHIP_FAMILY_RV670, "ATI Radeon HD 3690", kNull }, + { 0x9505, 0x30001787, CHIP_FAMILY_RV630, "ATI Radeon HD 3690", kNull }, + { 0x9505, 0x30011043, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0x3001148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0x3001174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x3002148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0x3003148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x3004148C, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x3010174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x301017AF, CHIP_FAMILY_RV670, "ATI Radeon HD 4750", kNull }, + { 0x9505, 0x4730174B, CHIP_FAMILY_RV670, "ATI Radeon HD 4730", kNull }, + { 0x9505, 0xE630174B, CHIP_FAMILY_RV670, "ATI Radeon HD 3800 Series", kNull }, + + { 0x9540, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4590", kPeregrine }, + { 0x9540, 0x4590174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4590", kPeregrine }, + + { 0x954F, 0x16131462, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0x20081787, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kPeregrine }, + { 0x954F, 0x29201682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0x29211682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0x3000174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kPeregrine }, + { 0x954F, 0x301017AF, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kPeregrine }, + { 0x954F, 0x30501787, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kPeregrine }, + { 0x954F, 0x30901682, CHIP_FAMILY_RV710, "XFX Radeon HD 4570", kPeregrine }, + { 0x954F, 0x31001787, CHIP_FAMILY_RV710, "ATI Radeon HD 4520", kPeregrine }, + { 0x954F, 0x4450174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4450", kPeregrine }, + { 0x954F, 0x4570174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4570", kPeregrine }, + { 0x954F, 0x66661043, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kPeregrine }, + { 0x954F, 0xE990174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kPeregrine }, + + { 0x9552, 0x04341028, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4330", kShrike }, + { 0x9552, 0x21AC1458, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x21ED1458, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x308B103C, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4330", kShrike }, + { 0x9552, 0x3000148C, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x3000174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x30001787, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x300017AF, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500", kPeregrine }, + { 0x9552, 0x44721545, CHIP_FAMILY_RV710, "VisionTek Radeon 4350", kPeregrine }, + + { 0x9553, 0x18751043, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4570", kShrike }, + { 0x9553, 0x1B321043, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4570", kShrike }, + { 0x9553, 0x215B17AA, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4530/4570", kShrike }, + { 0x9553, 0x3092174B, CHIP_FAMILY_RV710, "ATI Radeon HD 4300/4500 Series", kPeregrine }, + { 0x9553, 0x39291642, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4570", kPeregrine }, + { 0x9553, 0xFD001179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFD121179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFD501179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFD921179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFDD01179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFF001179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF151179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF161179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFF221179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF401179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF501179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF801179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFF821179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFFA01179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 5145", kPeregrine }, + { 0x9553, 0xFFA21179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + { 0x9553, 0xFFC01179, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500", kPeregrine }, + + { 0x9555, 0x29241682, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kNull }, + { 0x9555, 0x24651682, CHIP_FAMILY_RV710, "ATI Radeon HD4300/HD4500", kNull }, + { 0x9555, 0x3711174B, CHIP_FAMILY_RV710, "ATI Radeon HD4300/HD4500", kNull }, + + { 0x9581, 0x011F1025, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x0562107B, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x15621043, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x3000148C, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9581, 0x30C5103C, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x3C2D17AA, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x63F61462, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0x95811002, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9581, 0xFF001179, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + { 0x9581, 0xFF011179, CHIP_FAMILY_RV630, "ATI Radeon HD 2600", kNull }, + + { 0x9583, 0x0083106B, CHIP_FAMILY_RV630, "ATI Mobility Radeon HD 2600 XT", kNull }, + { 0x9583, 0x11071734, CHIP_FAMILY_RV630, "ATI Mobility Radeon HD 2600 XT", kNull }, + { 0x9583, 0x3000148C, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9583, 0x30D4103C, CHIP_FAMILY_RV630, "ATI Mobility Radeon HD 2600 XT", kNull }, + + { 0x9588, 0x01021A93, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 XT", kNull }, + + { 0x9589, 0x01001A93, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 PRO", kNull }, + { 0x9589, 0x0E41174B, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + { 0x9589, 0x30001462, CHIP_FAMILY_RV630, "ATI Radeon HD 3610", kNull }, + { 0x9589, 0x30001642, CHIP_FAMILY_RV630, "ATI Radeon HD 3610", kNull }, + { 0x9589, 0x30001787, CHIP_FAMILY_RV630, "ATI Radeon HD 3600", kNull }, + + { 0x9591, 0x15453992, CHIP_FAMILY_RV635, "ATI Radeon HD 3600", kNull }, + { 0x9591, 0x2303148C, CHIP_FAMILY_RV635, "ATI Radeon HD 2600/3600 Series", kNull }, + + { 0x9598, 0xB3831002, CHIP_FAMILY_RV635, "ATI All-in-Wonder HD", kNull }, + { 0x9598, 0x30001043, CHIP_FAMILY_RV635, "ATI Radeon HD 3730", kNull }, + { 0x9598, 0x3000148C, CHIP_FAMILY_RV635, "ATI Radeon HD 3730", kNull }, + { 0x9598, 0x30001545, CHIP_FAMILY_RV635, "ATI Radeon HD 2600 XT", kNull }, + { 0x9598, 0x3000174B, CHIP_FAMILY_RV635, "ATI Radeon HD 3730", kNull }, + { 0x9598, 0x30011043, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x3001148C, CHIP_FAMILY_RV635, "ATI Radeon HD 4580", kNull }, + { 0x9598, 0x3031148C, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x30011545, CHIP_FAMILY_RV635, "ATI Radeon HD 2600 Pro", kNull }, + { 0x9598, 0x3001174B, CHIP_FAMILY_RV635, "ATI Radeon HD 3750", kNull }, + { 0x9598, 0x300117AF, CHIP_FAMILY_RV635, "ATI Radeon HD 3750", kNull }, + { 0x9598, 0x301017AF, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x301117AF, CHIP_FAMILY_RV635, "ATI Radeon HD 4580", kNull }, + { 0x9598, 0x30501787, CHIP_FAMILY_RV635, "ATI Radeon HD 4610", kNull }, + { 0x9598, 0x4570174B, CHIP_FAMILY_RV635, "ATI Radeon HD 4570", kNull }, + { 0x9598, 0x4580174B, CHIP_FAMILY_RV635, "ATI Radeon HD 4580", kNull }, + { 0x9598, 0x4610174B, CHIP_FAMILY_RV635, "ATI Radeon HD 4610", kNull }, + + { 0x95C0, 0x3000148C, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + { 0x95C0, 0x3000174B, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + { 0x95C0, 0x3002174B, CHIP_FAMILY_RV620, "ATI Radeon HD 3570", kNull }, + { 0x95C0, 0x3020174B, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C0, 0xE3901745, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + + { 0x95C5, 0x01041A93, CHIP_FAMILY_RV620, "ATI Radeon HD 3450", kNull }, + { 0x95C5, 0x01051A93, CHIP_FAMILY_RV620, "ATI Radeon HD 3450", kNull }, + { 0x95C5, 0x3000148C, CHIP_FAMILY_RV620, "ATI Radeon HD 3450", kNull }, + { 0x95C5, 0x3001148C, CHIP_FAMILY_RV620, "ATI Radeon HD 3550", kNull }, + { 0x95C5, 0x3002148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4230", kNull }, + { 0x95C5, 0x3003148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x3010174B, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x301017AF, CHIP_FAMILY_RV620, "ATI Radeon HD 4230", kNull }, + { 0x95C5, 0x3032148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x3033148C, CHIP_FAMILY_RV620, "ATI Radeon HD 4230", kNull }, + { 0x95C5, 0x30501787, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + { 0x95C5, 0x4250174B, CHIP_FAMILY_RV620, "ATI Radeon HD 4250", kNull }, + + /* Evergreen */ + { 0x6898, 0x00D0106B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kLangur }, + { 0x6898, 0x032E1043, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + { 0x6898, 0x038C1043, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kNull }, + { 0x6898, 0x0B001002, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kZonalis }, + { 0x6898, 0x21E51458, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + { 0x6898, 0x29611682, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + { 0x6898, 0xE140174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5870", kUakari }, + + { 0x6899, 0x200A1787, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0x21E41458, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0x22901787, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0xE140174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + { 0x6899, 0xE174174B, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5850", kUakari }, + + { 0x689C, 0x034A1043, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + { 0x689C, 0x03521043, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5870 X2", kUakari }, + { 0x689C, 0x039E1043, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5870", kUakari }, + { 0x689C, 0x25421002, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + { 0x689C, 0x30201682, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5970", kUakari }, + + { 0x68A0, 0x03081025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5830", kNomascus }, + { 0x68A0, 0x030A1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5830", kNomascus }, + { 0x68A0, 0x043A1028, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5870", kNomascus }, + + { 0x68A1, 0x03081025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x030A1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x03671025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x03681025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x038B1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x038C1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x042E1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x042F1025, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x144D103C, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kNomascus }, + { 0x68A1, 0x1522103C, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x22411462, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + { 0x68A1, 0x39961462, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5850", kHoolock }, + + { 0x68A8, 0x04421025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x04511025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x048F1028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x04901028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x04B91028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x04BA1028, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6870M", kHoolock }, + { 0x68A8, 0x050A1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050B1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050C1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050E1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x050F1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05131025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05141025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05151025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05161025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05251025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x05261025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x056D1025, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0x159B103C, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + { 0x68A8, 0xC0AD144D, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6850M", kUakari }, + + { 0x68B8, 0x00CF106B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kHoolock }, + { 0x68B8, 0x0044144D, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770", kVervet }, + { 0x68B8, 0x1482174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x200A1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x200B1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x21D71458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x21F61458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x25431002, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x25431458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x29901682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x29911682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x30001002, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6700", kVervet }, + { 0x68B8, 0x6880103C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0x6881103C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770", kVervet }, + { 0x68B8, 0xE144174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kHoolock }, + { 0x68B8, 0xE147174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0xE160174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770", kVervet }, + { 0x68B8, 0xEA60174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6770", kVervet }, + + { 0x68BA, 0x03FE1043, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x1482174B, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x174B1482, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x200A1787, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x21421462, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x25431458, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x31501682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x31521682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0x31531682, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + { 0x68BA, 0xE144174B, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6770", kVervet }, + + { 0x68BE, 0x200A1787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5750", kVervet }, + { 0x68BE, 0x22881787, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5750", kVervet }, + { 0x68BE, 0x3000148C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + { 0x68BE, 0x3000174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + { 0x68BE, 0x300017AF, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + { 0x68BE, 0x39821642, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kNull }, + + { 0x68BF, 0x220E1458, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0x3000148C, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0x31401682, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0x6750174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kVervet }, + { 0x68BF, 0xE144174B, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6750", kHoolock }, + + { 0x68C0, 0x1594103C, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6570M", kNull }, + { 0x68C0, 0x392717AA, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5730", kNull }, + { 0x68C0, 0x395217AA, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5730", kNull }, + { 0x68C0, 0x84721043, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5000", kNull }, + + { 0x68C1, 0x02051025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x02961025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x030A1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x033D1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x033E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x03471025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03561025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03581025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x035A1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x035C1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03641025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x036D1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x03791025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x037E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x03821025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5750", kNull }, + { 0x68C1, 0x04121025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x042E1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x042F1025, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kNull }, + { 0x68C1, 0x9071104D, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0x1449103C, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFD001179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFD121179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFD501179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + { 0x68C1, 0xFDD01179, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5650", kEulemur }, + + { 0x68C8, 0x2306103C, CHIP_FAMILY_REDWOOD, "ATI FirePro V4800 (FireGL)", kNull }, + { 0x68C8, 0x240A1002, CHIP_FAMILY_REDWOOD, "ATI FirePro V4800 (FireGL)", kNull }, + { 0x68C8, 0x240A1028, CHIP_FAMILY_REDWOOD, "ATI FirePro V4800 (FireGL)", kNull }, + + { 0x68D8, 0x03561043, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, + { 0x68D8, 0x03C01043, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0x20091787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0x200B1787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, // catalinz + { 0x68D8, 0x21D91458, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, + { 0x68D8, 0x21F41458, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0x22051462, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x22941787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x30001787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5730", kNull }, + { 0x68D8, 0x301017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5730", kNull }, + { 0x68D8, 0x301117AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x30601682, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x30651682, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x56701545, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x5690174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5690", kNull }, + { 0x68D8, 0x5730174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5730", kNull }, + { 0x68D8, 0x68E01028, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kBaboon }, + { 0x68D8, 0xE151174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kEulemur }, + { 0x68D8, 0xE155174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kNull }, + { 0x68D8, 0xE166174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670", kUakari }, + + { 0x68D9, 0x03CE1043, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5550", kNull }, + { 0x68D9, 0x22401462, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5570", kNull }, + { 0x68D9, 0x3000148C, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6510", kNull }, + { 0x68D9, 0x3000174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6510", kNull }, + { 0x68D9, 0x301017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + { 0x68D9, 0x39691642, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5570", kNull }, + + { 0x68DA, 0x3000148C, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6390", kNull }, + { 0x68DA, 0x3000174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6390", kNull }, + { 0x68DA, 0x30001787, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + { 0x68DA, 0x300017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 6390", kNull }, + { 0x68DA, 0x301017AF, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + { 0x68DA, 0x5630174B, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5630", kNull }, + + { 0x68E0, 0x02931025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x03581025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x03591025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x035C1025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x035D1025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x036D1025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kLangur }, + { 0x68E0, 0x04471028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x04561028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x04831025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x1433103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x1441103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x144A103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0x1BF21043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kNull }, + { 0x68E0, 0x848F1043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kNull }, + { 0x68E0, 0xFD001179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFD121179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFD501179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFD921179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E0, 0xFDD01179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + + { 0x68E1, 0x04661028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x10021B61, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450M", kEulemur }, + { 0x68E1, 0x10501462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x1426103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x142A103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 545vM", kEulemur }, + { 0x68E1, 0x14E110CF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5400M", kEulemur }, + { 0x68E1, 0x21D81458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x21E21458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x21F11458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x22021458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x23421462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x23431462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x25481458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5400M", kEulemur }, + { 0x68E1, 0x254A1458, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5000M", kEulemur }, + { 0x68E1, 0x30001043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3000148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x30001682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3000174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68E1, 0x30001787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, // 5430M ??? + { 0x68E1, 0x300017AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3001148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x301417AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68E1, 0x3002148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x3003148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450M", kEulemur }, + { 0x68E1, 0x54501545, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x5470174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470M", kEulemur }, + { 0x68E1, 0x60001092, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x60001682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x6000174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + { 0x68E1, 0x6230174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68E1, 0x6350174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68E1, 0xFDD01179, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5430M", kEulemur }, + + { 0x68E4, 0x04821025, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x1426103C, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x1C921043, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x397917AA, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + { 0x68E4, 0x397F17AA, CHIP_FAMILY_CEDAR, "AMD Radeon HD 7370M", kNull }, + { 0x68E4, 0x84A01043, CHIP_FAMILY_CEDAR, "AMD Radeon HD 6370M", kNull }, + + { 0x68F9, 0x00011019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x00021019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x00191019, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x010E1002, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x010E1028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x03741043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x03CA1043, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x05181025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x05191025, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x174B3000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, + { 0x68F9, 0x174B6250, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, + { 0x68F9, 0x174B6290, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, + { 0x68F9, 0x174BE164, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x20091787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x21261028, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x2126103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x21301462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21311462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21331462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kEulemur }, + { 0x68F9, 0x21801462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21811462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x21821462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x21831462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x22911787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x22301462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x22311462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x23401462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x24951462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x2AAC103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x2AEC103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x30001787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x300017AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, + { 0x68F9, 0x3001148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6250", kNull }, + { 0x68F9, 0x30011787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5530", kNull }, + { 0x68F9, 0x3002148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, + { 0x68F9, 0x30021787, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, + { 0x68F9, 0x300217AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6290", kNull }, + { 0x68F9, 0x3003148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, + { 0x68F9, 0x301117AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x301217AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, + { 0x68F9, 0x301317AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x301417AF, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x30321682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x303A1682, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x3580103C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x360217AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x360317AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x360F17AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x361917AA, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x39831642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x39841642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x39871642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x3987174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x39971462, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0x3A051642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kNull }, + { 0x68F9, 0x3B311642, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350A", kNull }, + { 0x68F9, 0x5470174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470", kNull }, + { 0x68F9, 0x5490174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5490", kNull }, + { 0x68F9, 0x5530174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5530", kNull }, + { 0x68F9, 0x6230174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6230", kNull }, + { 0x68F9, 0x6350174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6350", kNull }, + { 0x68F9, 0x7350148C, CHIP_FAMILY_CEDAR, "ATI Radeon HD 7350", kNull }, + { 0x68F9, 0xE127174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE145174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE153174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + { 0x68F9, 0xE164174B, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5450", kEulemur }, + + /* Northen Islands */ + { 0x6718, 0x03B81043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x03BC1043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x0B001002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x20101458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x20101787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x22001458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x22011458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x23061787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, // HIS + { 0x6718, 0x23701462, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, // MSI + { 0x6718, 0x24701462, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, // MSI + { 0x6718, 0x31301682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0x67181002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0xE182174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + { 0x6718, 0xE203174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970", kGibba }, + + { 0x6719, 0x03BE1043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x03D41043, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x0B001002, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x186B174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x20101787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x21FD1458, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x23071787, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x24611462, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x31211682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0x31221682, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + { 0x6719, 0xE189174B, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950", kGibba }, + +// { 0x671D, 0x0B2A1002, CHIP_FAMILY_ANTILLES, "AMD Radeon HD 6990", kNull }, +// { 0x671D, 0x1B2A1002, CHIP_FAMILY_ANTILLES, "AMD Radeon HD 6990", kNull }, +// { 0x671D, 0x31601682, CHIP_FAMILY_ANTILLES, "AMD Radeon HD 6990", kNull }, + + { 0x6720, 0x048F1028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x04901028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x04A41028, CHIP_FAMILY_BARTS, "AMD FirePro M8900M", kElodea }, + { 0x6720, 0x04B91028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x04BA1028, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x51021558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x51041558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6990M", kElodea }, + { 0x6720, 0x71001558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x72001558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + { 0x6720, 0x72011558, CHIP_FAMILY_BARTS, "AMD Radeon HD 6990M", kElodea }, + { 0x6720, 0xC0AD144D, CHIP_FAMILY_BARTS, "AMD Radeon HD 6970M", kElodea }, + + { 0x6738, 0x00D01002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x03AE1043, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x03C61043, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kBulrushes }, // ?? kDuckweed ?? + { 0x6738, 0x20101787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x21FA1002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x21FA1458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x23051787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x25101462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31031682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31041682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31071682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0x31081682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, // ?? kJuncus ?? + { 0x6738, 0x67381002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + { 0x6738, 0xE178174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870", kDuckweed }, + + { 0x6739, 0x03B41043, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x200F1787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x21F81458, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kBulrushes }, + { 0x6739, 0x23041787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x24001462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x24411462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x25201462, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x30001787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31101682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31131682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31141682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31161682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x31171682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0x67391002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xAA881002, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xE174174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xE177174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + { 0x6739, 0xE183174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850", kDuckweed }, + + { 0x673E, 0x174B174B, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + { 0x673E, 0x23101787, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + { 0x673E, 0x31701682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + { 0x673E, 0x31721682, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790", kNull }, + + { 0x6740, 0x04A31028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, // ?? + { 0x6740, 0x1D121043, CHIP_FAMILY_TURKS, "AMD Radeon HD 6730M", kNull }, + { 0x6740, 0x1631103C, CHIP_FAMILY_TURKS, "AMD FirePro M5950", kNull }, + { 0x6740, 0x1657103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x165A103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x3388103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, + { 0x6740, 0x3389103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, // ?? kHydrilla ?? + { 0x6740, 0x6740106B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M", kNull }, // ?? + + { 0x6741, 0x050E1025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, + { 0x6741, 0x050F1025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, + { 0x6741, 0x05131025, CHIP_FAMILY_TURKS, "AMD Radeon HD 6650M", kNull }, + { 0x6741, 0x1646103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6750M", kNull }, + { 0x6741, 0x1688103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 7690M", kNull }, + { 0x6741, 0x358D103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6630M/6650M/6750M", kNull }, + { 0x6741, 0x9080104D, CHIP_FAMILY_TURKS, "AMD Radeon HD 6630M", kNull }, + + { 0x6758, 0x00121028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x0B0E1002, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kPithecia }, + { 0x6758, 0x0B0E1028, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x20121787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kPithecia }, + { 0x6758, 0x20141787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x22051458, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x31811682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x31831682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x67581002, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0x6882103C, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0xE181174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0xE1941746, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kBulrushes }, + { 0x6758, 0xE194174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670", kMangabey }, + + { 0x6759, 0x20121787, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kPithecia }, + { 0x6759, 0x31951682, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kGibba }, + { 0x6759, 0x32801682, CHIP_FAMILY_TURKS, "AMD Radeon HD 7570", kPithecia }, + { 0x6759, 0xE193174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570", kPithecia }, + + { 0x675F, 0x23141787, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + { 0x675F, 0x254B1458, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + { 0x675F, 0x6510148C, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + { 0x675F, 0x6510174B, CHIP_FAMILY_TURKS, "AMD Radeon HD 5570", kNull }, + + { 0x6760, 0x00031179, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x04C11028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x04CA1028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x04CC1028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x101C1043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450M", kIpomoea }, + { 0x6760, 0x165A103C, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x167D103C, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x1CB21043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x20011043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6470M", kIpomoea }, + { 0x6760, 0x85171043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470M", kNull }, + + { 0x6778, 0x00241019, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470", kBulrushes }, // Elitegroup + { 0x6778, 0x00271019, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // Elitegroup + { 0x6778, 0x21201028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7470", kBulrushes }, // Dell + { 0x6778, 0xB4911462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // MSi + { 0x6778, 0xB4921462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // MSi + { 0x6778, 0xB4931462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 8470", kBulrushes }, // MSi + + { 0x6779, 0x00001002, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x03DA1043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x03DC1043, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x20121787, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x21201028, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x21251462, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x22031458, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x22041458, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x23111787, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x32001682, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x64501092, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0x909D1B0A, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0xE164174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kIpomoea }, + { 0x6779, 0xE180174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kPithecia }, + { 0x6779, 0xE190174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + { 0x6779, 0xE199174B, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450", kBulrushes }, + + /* Southen Islands */ + + { 0x6798, 0x04181043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x041C1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04201043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04421043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04441043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04461043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x04481043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x044A1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x044C1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x044E1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x0B001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, // 7990 ??? + { 0x6798, 0x23171787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x254D1458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x27701462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x30001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x30001787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32101682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32111682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32121682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x32131682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + { 0x6798, 0x99991043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7990", kAji }, // Asus + { 0x6798, 0xE208174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970", kAji }, + + { 0x679A, 0x04241043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x04261043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x0B001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x0B011002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8900", kAji }, + { 0x679A, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x23161787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x254C1458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x27601462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x27711462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8950", kAji }, + { 0x679A, 0x3000174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32121682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32201682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32211682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x32221682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x6616103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x30001002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0x7950174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0xE207174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + { 0x679A, 0xE208174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950", kAji }, + + { 0x6800, 0x03711558, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05501028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05511028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05544028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x057B1028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05861028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05871028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + { 0x6800, 0x05881028, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kDashimaki }, + + { 0x6818, 0x042F1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x04311043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x0B041002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x0B051002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8800", kAji }, + { 0x6818, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x23211787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x25541458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x27401462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x32501682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kChutoro }, + { 0x6818, 0x32511682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x7870174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + { 0x6818, 0x8B04174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8860", kAji }, + { 0x6818, 0xE217174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870", kAji }, + + { 0x6819, 0x042C1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x04311043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x04331043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x043A1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x045B1043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Asus + { 0x6819, 0x0B041002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // ATI + { 0x6819, 0x201C1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // HIS + { 0x6819, 0x23201787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // HIS + { 0x6819, 0x25531458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Gigabyte + { 0x6819, 0x27301462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // MSI + { 0x6819, 0x27311462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // MSI + { 0x6819, 0x27321462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // MSI + { 0x6819, 0x32601682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // XFX + { 0x6819, 0x32621682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // XFX + { 0x6819, 0x32641682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // XFX + { 0x6819, 0xE218174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Sapphire + { 0x6819, 0xE221174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850", kAji }, // Sapphire + + { 0x682F, 0x15271043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7700M", kAji }, + { 0x682F, 0x1831103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0x1832103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0x1834103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0x18A7103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + { 0x682F, 0xC0DA144D, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7730M", kAji }, + + { 0x683D, 0x00301002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8760", kAji }, // VERDE? + { 0x683D, 0x00301019, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8760", kAji }, // VERDE? + { 0x683D, 0x04211043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x23041002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7700", kAji }, + { 0x683D, 0x25561458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x27101462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x2B301002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x32331682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + { 0x683D, 0x6886103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7700", kAji }, + { 0x683D, 0x6890103C, CHIP_FAMILY_TAHITI, "AMD Radeon HD 8760", kAji }, // VERDE? + { 0x683D, 0xE214174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7770", kAji }, + + { 0x683F, 0x04231043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x04271043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x04591043, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x200B1787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x23181787, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x25511458, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x27921462, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x2B301002, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x32411682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x32421682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0x32451682, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0xE2131019, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0xE213174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + { 0x683F, 0xE215174B, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7750", kChutoro }, + + { 0x6840, 0x01241002, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M", kPondweed }, + { 0x6840, 0x01341002, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M", kPondweed }, + { 0x6840, 0x050E1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x050F1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x05131025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x05141025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x056D1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x059A1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x059B1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x059E1025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06001025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06061025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06961025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06971025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06981025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x06991025, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x100A1043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x104B1043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x10DC1043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1813103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7590M", kPondweed }, + { 0x6840, 0x182F103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1830103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1835103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x183A103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x183C103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x183E103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1840103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1842103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1844103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1848103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x184A103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x184C103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1895103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x1897103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x18A5103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x18A7103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x18F4103C, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21211043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21221043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21231043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21251043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x21271043, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x397017AA, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0x397B17AA, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xC0C5144D, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 6000M", kPondweed }, + { 0x6840, 0xC0CE144D, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xC0DA144D, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB111179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB221179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB231179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB2C1179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB311179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB321179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB381179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB391179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB3A1179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB401179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB411179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB471179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB481179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB511179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB521179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB531179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB811179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB821179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFB831179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFC561179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFCD41179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + { 0x6840, 0xFCEE1179, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M", kPondweed }, + + /*old series*/ + + { 0x5D48, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Mobile ", kNull }, + { 0x5D49, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Mobile ", kNull }, + { 0x5D4A, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Mobile ", kNull }, + + { 0x5D4C, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D4D, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D4E, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D4F, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + { 0x5D50, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + + { 0x5D52, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + + { 0x5D57, 0x00000000, CHIP_FAMILY_R420, "ATI Radeon HD Desktop ", kNull }, + + { 0x5E48, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + + { 0x5E4A, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + { 0x5E4B, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + { 0x5E4C, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + { 0x5E4D, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + + { 0x5E4F, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ", kNull }, + + { 0x7100, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7101, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7102, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7103, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7104, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7105, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7106, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ", kNull }, + { 0x7108, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x7109, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710A, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710B, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710C, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + + { 0x710E, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + { 0x710F, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ", kNull }, + + { 0x7140, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7141, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7142, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7143, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7144, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x7145, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x7146, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7147, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7149, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714A, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714C, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x714D, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x714E, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x714F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7151, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7152, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7153, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x715E, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x715F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7180, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7181, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7183, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7186, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x7187, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + { 0x7188, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + + { 0x718A, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x718B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x718C, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + { 0x718D, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + + { 0x718F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7193, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x7196, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kCaretta }, + + { 0x719B, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x719F, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kCaretta }, + + { 0x71C0, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C1, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C2, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C3, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C4, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + + { 0x71C5, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD 1600 Mobile ", kWormy }, + { 0x71C6, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71C7, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71CD, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + { 0x71CE, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71D2, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71D4, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + { 0x71D5, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + { 0x71D6, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Mobile ", kWormy }, + + { 0x71DA, 0x00000000, CHIP_FAMILY_RV530, "ATI Radeon HD Desktop ", kWormy }, + + { 0x71DE, 0x00000000, CHIP_FAMILY_RV530, "ASUS M66 ATI Radeon Mobile ", kWormy }, + + { 0x7200, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Desktop ", kWormy }, + + { 0x7210, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kWormy }, + { 0x7211, 0x00000000, CHIP_FAMILY_RV515, "ATI Radeon HD Mobile ", kWormy }, + + { 0x7240, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7243, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7244, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7245, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7246, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7247, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7248, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7249, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724A, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724B, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724C, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724D, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724E, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + { 0x724F, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7280, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD X1950 Pro ", kAlopias }, + { 0x7281, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7283, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7284, 0x00000000, CHIP_FAMILY_R580, "ATI Radeon HD Mobile ", kAlopias }, + + { 0x7287, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7288, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7289, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x728B, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + { 0x728C, 0x00000000, CHIP_FAMILY_RV570, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7290, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + { 0x7291, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7293, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + + { 0x7297, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ", kAlopias }, + + /* IGP */ + + { 0x791E, 0x00000000, CHIP_FAMILY_RS690, "ATI Radeon IGP ", kNull }, + { 0x791F, 0x00000000, CHIP_FAMILY_RS690, "ATI Radeon IGP ", kNull }, + { 0x796C, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + { 0x796D, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + { 0x796E, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + { 0x796F, 0x00000000, CHIP_FAMILY_RS740, "ATI Radeon IGP ", kNull }, + + /* standard/default models */ + + { 0x9400, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 XT", kNull }, + { 0x9401, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x9402, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x9403, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x9405, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x940A, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x940B, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + { 0x940F, 0x00000000, CHIP_FAMILY_R600, "ATI Radeon HD 2900 GT", kNull }, + + { 0x9440, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 ", kMotmot }, + { 0x9441, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4870 X2", kMotmot }, + { 0x9442, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4850 Series", kMotmot }, + { 0x9443, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4850 X2", kMotmot }, + { 0x9444, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8750 (FireGL)", kMotmot }, + { 0x9446, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V7770 (FireGL)", kMotmot }, + { 0x9447, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8700 Duo (FireGL)", kMotmot }, + { 0x944A, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4850", kMotmot }, + { 0x944B, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4850 X2", kMotmot }, + { 0x944C, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4830 Series", kMotmot }, + { 0x944E, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4810 Series", kMotmot }, + + { 0x9450, 0x00000000, CHIP_FAMILY_RV770, "AMD FireStream 9270", kMotmot }, + { 0x9452, 0x00000000, CHIP_FAMILY_RV770, "AMD FireStream 9250", kMotmot }, + + { 0x9456, 0x00000000, CHIP_FAMILY_RV770, "ATI FirePro V8700 (FireGL)", kMotmot }, + { 0x945A, 0x00000000, CHIP_FAMILY_RV770, "ATI Mobility Radeon HD 4870", kMotmot }, + + { 0x9460, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4800 Series", kMotmot }, + { 0x9462, 0x00000000, CHIP_FAMILY_RV770, "ATI Radeon HD 4800 Series", kMotmot }, + + { 0x9480, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4650 Series", kGliff }, + + { 0x9487, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x9488, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4650 Series", kGliff }, + { 0x9489, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x948A, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x948F, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD Series", kGliff }, + { 0x9490, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4710 Series", kGliff }, + { 0x9491, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4600 Series", kGliff }, + { 0x9495, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4650 Series", kGliff }, + + { 0x9498, 0x00000000, CHIP_FAMILY_RV730, "ATI Radeon HD 4710 Series", kGliff }, + { 0x949C, 0x00000000, CHIP_FAMILY_RV730, "ATI FirePro V7750 (FireGL)", kGliff }, + { 0x949E, 0x00000000, CHIP_FAMILY_RV730, "ATI FirePro V5700 (FireGL)", kGliff }, + { 0x949F, 0x00000000, CHIP_FAMILY_RV730, "ATI FirePro V3750 (FireGL)", kGliff }, + + { 0x94A0, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4830M", kFlicker }, + { 0x94A1, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4860M", kFlicker }, + { 0x94A3, 0x00000000, CHIP_FAMILY_RV740, "ATI FirePro M7740", kFlicker }, + { 0x94B1, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD", kFlicker }, + { 0x94B3, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B4, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4700 Series", kFlicker }, + { 0x94B5, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD 4770", kFlicker }, + { 0x94B9, 0x00000000, CHIP_FAMILY_RV740, "ATI Radeon HD", kFlicker }, + + { 0x94C0, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD Series", kIago }, + { 0x94C1, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + + { 0x94C3, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2350 Series", kIago }, + { 0x94C4, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C5, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C6, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C7, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2350", kIago }, + { 0x94C8, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94C9, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + + { 0x94CB, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94CC, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 Series", kIago }, + { 0x94CD, 0x00000000, CHIP_FAMILY_RV610, "ATI Radeon HD 2400 PRO Series", kIago }, + + { 0x9500, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3800 Series", kMegalodon }, + { 0x9501, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3690 Series", kMegalodon }, + + { 0x9504, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850M Series", kMegalodon }, + { 0x9505, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3800 Series", kMegalodon }, + { 0x9506, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850 X2 M Series", kMegalodon }, + { 0x9507, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3830", kMegalodon }, + { 0x9508, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3870M Series", kMegalodon }, + { 0x9509, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3870 X2 MSeries", kMegalodon }, + + { 0x950F, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3870 X2", kMegalodon }, + + { 0x9511, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850 X2", kMegalodon }, + + { 0x9513, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3850 X2", kMegalodon }, + { 0x9515, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD 3850 Series", kMegalodon }, + { 0x9517, 0x00000000, CHIP_FAMILY_RV670, "ATI Radeon HD Series", kMegalodon }, + + { 0x9519, 0x00000000, CHIP_FAMILY_RV670, "AMD FireStream 9170", kMegalodon }, + + { 0x9540, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD 4550", kFlicker }, + { 0x9541, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD", kFlicker }, + { 0x9542, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD", kFlicker }, + { 0x954E, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD", kFlicker }, + { 0x954F, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD 4350", kFlicker }, + + { 0x9552, 0x00000000, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4300/4500 Series", kShrike }, + { 0x9553, 0x00000000, CHIP_FAMILY_RV710, "ATI Mobility Radeon HD 4500M/5100M Series",kShrike }, + + { 0x9555, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD4300/HD4500 series", kShrike }, + + { 0x9557, 0x00000000, CHIP_FAMILY_RV710, "ATI FirePro RG220", kFlicker }, + + { 0x955F, 0x00000000, CHIP_FAMILY_RV710, "ATI Radeon HD 4330M series", kFlicker }, + + { 0x9580, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD Series", kHypoprion }, + { 0x9581, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3600 Series", kHypoprion }, + + { 0x9583, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3600 Series", kHypoprion }, + + { 0x9586, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 XT Series", kHypoprion }, + { 0x9587, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 Pro Series", kHypoprion }, + { 0x9588, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 XT", kHypoprion }, + { 0x9589, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3610 Series", kHypoprion }, + { 0x958A, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958B, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958C, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958D, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958E, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 2600 X2 Series", kLamna }, + { 0x958F, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD Series", kHypoprion }, + + { 0x9591, 0x00000000, CHIP_FAMILY_RV635, "ATI Radeon HD 3600 Series", kMegalodon }, + + { 0x9598, 0x00000000, CHIP_FAMILY_RV630, "ATI Radeon HD 3600 Series", kMegalodon }, + + { 0x95C0, 0x00000000, CHIP_FAMILY_RV620, "ATI Radeon HD 3550 Series", kIago }, + + { 0x95C4, 0x00000000, CHIP_FAMILY_RV620, "ATI Radeon HD 3470 Series", kIago }, + + { 0x95C5, 0x00000000, CHIP_FAMILY_RV620, "ATI Radeon HD 3450 Series", kIago }, + + /* IGP */ + { 0x9610, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon HD 3200 Graphics", kNull }, + { 0x9611, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon 3100 Graphics", kNull }, + + { 0x9614, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon HD 3300 Graphics", kNull }, + + { 0x9616, 0x00000000, CHIP_FAMILY_RS780, "ATI Radeon 3000 Graphics", kNull }, + + { 0x9710, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 4200 Series", kNull }, + + { 0x9714, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 4290 Series", kNull }, + { 0x9715, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 4250 Series", kNull }, + + { 0x9723, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 5450 Series", kNull }, + + { 0x9802, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6310 Series", kNull }, + { 0x9803, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6310 Series", kNull }, + { 0x9804, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6310 Series", kNull }, + { 0x9805, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6250 Series", kNull }, + { 0x9806, 0x00000000, CHIP_FAMILY_RS880, "ATI Radeon HD 6320 Series", kNull }, + + /* Evergreen */ + { 0x688D, 0x00000000, CHIP_FAMILY_CYPRESS, "AMD FireStream 9350 Series", kUakari }, + + { 0x6898, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800 Series", kUakari }, + { 0x6899, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Radeon HD 5800 Series", kUakari }, + +// { 0x689B, 0x00000000, CHIP_FAMILY_???, "AMD Radeon HD 6800 Series", kNull }, + { 0x689C, 0x00000000, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5900 Series", kUakari }, + + { 0x689E, 0x00000000, CHIP_FAMILY_HEMLOCK, "ATI Radeon HD 5800 Series", kUakari }, + + { 0x68A0, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5800 Series", kNomascus }, // CHIP_FAMILY_BROADWAY ?? + { 0x68A1, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Mobility Radeon HD 5800 Series", kNomascus }, // CHIP_FAMILY_BROADWAY ?? + + { 0x68A8, 0x00000000, CHIP_FAMILY_JUNIPER, "AMD Mobility Radeon HD 6800 Series", kNomascus }, + { 0x68A9, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI FirePro V5800 (FireGL)", kNull }, + + + { 0x68B0, 0x00000000, CHIP_FAMILY_CYPRESS, "ATI Mobility Radeon HD 5800 Series", kHoolock }, // CHIP_FAMILY_BROADWAY ?? + { 0x68B1, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5770 Series", kHoolock }, + + { 0x68B8, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5700 Series", kHoolock }, + { 0x68B9, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5600 Series", kHoolock }, + { 0x68BA, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 6700 Series", kHoolock }, + + { 0x68BE, 0x00000000, CHIP_FAMILY_JUNIPER, "ATI Radeon HD 5700 Series", kHoolock }, + { 0x68BF, 0x00000000, CHIP_FAMILY_JUNIPER, "AMD Radeon HD 6700 Series", kHoolock }, + + { 0x68C0, 0x00000000, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6570M/5700 Series", kBaboon }, + { 0x68C1, 0x00000000, CHIP_FAMILY_REDWOOD, "AMD Radeon HD 6500M/5600/5700 Series", kBaboon }, + { 0x68C8, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5650 Series", kVervet }, + { 0x68C9, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI FirePro V3800 (FireGL)", kBaboon }, + + { 0x68D8, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5670 Series", kBaboon }, + { 0x68D9, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5500/5600 Series", kBaboon }, + { 0x68DA, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD 5500 Series", kBaboon }, + +// { 0x68DE, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Radeon HD ??? Series", kNull }, + + + { 0x68E0, 0x00000000, CHIP_FAMILY_REDWOOD, "ATI Mobility Radeon HD 5400 Series", kEulemur }, + { 0x68E1, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Mobility Radeon HD 5400 Series", kEulemur }, + + { 0x68E4, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6370M Series", kEulemur }, + { 0x68E5, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 6300M Series", kEulemur }, + +// { 0x68E8, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, +// { 0x68E9, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, + +// { 0x68F8, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, + { 0x68F9, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 5470 Series", kEulemur }, + { 0x68FA, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD 7300 Series", kNull }, + +// { 0x68FE, 0x00000000, CHIP_FAMILY_CEDAR, "ATI Radeon HD ??? Series", kNull }, + + + /* Northen Islands */ + { 0x6718, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970 Series", kLotus }, + { 0x6719, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950 Series", kGibba }, + + { 0x671C, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6970 Series", kLotus }, + { 0x671D, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6950 Series", kLotus }, + + { 0x671F, 0x00000000, CHIP_FAMILY_CAYMAN, "AMD Radeon HD 6930 Series", kLotus }, + + { 0x6720, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kFanwort }, + + { 0x6722, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kFanwort }, + { 0x6729, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6900M Series", kFanwort }, + { 0x6738, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6870 Series", kDuckweed }, + { 0x6739, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6850 Series", kDuckweed }, + + { 0x673E, 0x00000000, CHIP_FAMILY_BARTS, "AMD Radeon HD 6790 Series", kDuckweed }, + + { 0x6740, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6770M Series", kCattail }, + { 0x6741, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6750M Series", kCattail }, + + { 0x6745, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600M Series", kCattail }, + { 0x6749, 0x00000000, CHIP_FAMILY_TURKS, "ATI Radeon FirePro V4900", kPithecia }, + { 0x674A, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600M Series", kCattail }, + { 0x6750, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6600A Series", kPithecia }, + + { 0x6758, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6670 Series", kPithecia }, + { 0x6759, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570/7570 Series", kPithecia }, + + { 0x675D, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 7570M Series", kCattail }, + + { 0x675F, 0x00000000, CHIP_FAMILY_TURKS, "AMD Radeon HD 6570 Series", kBulrushes }, + { 0x6760, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400M Series", kHydrilla }, + { 0x6761, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6430M Series", kHydrilla }, + { 0x6768, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400M Series", kHydrilla }, + + { 0x6770, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6400 Series", kBulrushes }, + + { 0x6772, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7400A Series", kBulrushes }, + + { 0x6778, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7000 Series", kBulrushes }, + { 0x6779, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 6450 Series", kBulrushes }, + + { 0x677B, 0x00000000, CHIP_FAMILY_CAICOS, "AMD Radeon HD 7400 Series", kBulrushes }, + + /* Southen Islands */ + + { 0x6780, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, // ATI7000Controller.kext + +// { 0x6784, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD ??? Series", kFutomaki }, + +// { 0x6788, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD ??? Series", kFutomaki }, + + { 0x678A, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + + { 0x6790, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, // ATI7000Controller.kext + { 0x6791, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + { 0x6792, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + + { 0x6798, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970 X-Edition", kFutomaki }, // ATI7000Controller.kext + { 0x6799, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7990 Series", kAji }, + { 0x679A, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950 Series", kFutomaki }, // ATI7000Controller.kext + { 0x679B, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7900 Series", kFutomaki }, + + { 0x679E, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7870 XT", kFutomaki }, // ATI7000Controller.kext + { 0x679F, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7950 Series", kFutomaki }, + + { 0x6800, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7970M", kFutomaki }, // ATI7000Controller.kext +// { 0x6801, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ???M Series", kFutomaki }, +// { 0x6802, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ???M Series", kFutomaki }, + + { 0x6806, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7600 Series", kFutomaki }, // ATI7000Controller.kext + + { 0x6808, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7600 Series", kFutomaki }, // ATI7000Controller.kext +// { 0x6809, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ??? Series", kNull }, +// { 0x6810, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ??? Series", kNull }, + + { 0x6818, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7800 Series", kFutomaki }, // CHIP_FAMILY_PITCAIRN ??// ATI7000Controller.kext + { 0x6819, 0x00000000, CHIP_FAMILY_TAHITI, "AMD Radeon HD 7850 Series", kFutomaki },// CHIP_FAMILY_PITCAIRN ?? + { 0x6820, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + { 0x6821, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + +// { 0x6823, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 8800M Series", kBuri }, +// { 0x6824, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700M Series", kBuri }, + { 0x6825, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7870 Series", kBuri }, // ATI7000Controller.kext + { 0x6826, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, + { 0x6827, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7850M/8850M Series", kBuri }, // ATI7000Controller.kext +// { 0x6828, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD ??? Series", kBuri }, +// { 0x6829, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD ??? Series", kBuri }, + + { 0x682B, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 8800M Series", kBuri }, + + { 0x682D, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + + { 0x682F, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7730 Series", kBuri }, // ATI7000Controller.kext + + { 0x6830, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7800M Series", kBuri }, + { 0x6831, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, + + { 0x6837, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, +// { 0x6838, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD ??? Series", kBuri }, + { 0x6839, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + + { 0x683B, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7700 Series", kBuri }, // ATI7000Controller.kext + + { 0x683D, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7770 Series", kBuri }, // ATI7000Controller.kext + + { 0x683F, 0x00000000, CHIP_FAMILY_VERDE, "AMD Radeon HD 7750 Series", kBuri }, // ATI7000Controller.kext + + { 0x6840, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7670M Series", kPondweed }, // THAMES?? + { 0x6841, 0x00000000, CHIP_FAMILY_THAMES, "AMD Radeon HD 7500M/7600M Series", kPondweed }, + { 0x6842, 0x00000000, CHIP_FAMILY_THAMES, "AMD Radeon HD 7000M Series", kPondweed }, + { 0x6843, 0x00000000, CHIP_FAMILY_THAMES, "AMD Radeon HD 7670M Series", kPondweed }, + { 0x6849, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M Series", kPondweed }, + +// { 0x684C, 0x00000000, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD ??? Series", kNull }, + { 0x6850, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M Series", kPondweed }, + { 0x6858, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7400 Series", kPondweed }, + { 0x6859, 0x00000000, CHIP_FAMILY_LOMBOK, "AMD Radeon HD 7600M Series", kPondweed }, + + { 0x0000, 0x00000000, CHIP_FAMILY_UNKNOW, NULL, kNull } +}; + + +dev_prop_t ati_devprop_list[] = { + {FLAGTRUE, false, "@0,AAPL,boot-display", get_bootdisplay_val, NULVAL }, +// {FLAGTRUE, false, "@0,ATY,EFIDisplay", NULL, STRVAL("TMDSA") }, + +// {FLAGTRUE, true, "@0,AAPL,vram-memory", get_vrammemory_val, NULVAL }, +// {FLAGTRUE, true, "@0,compatible", get_name_val, NULVAL }, +// {FLAGTRUE, true, "@0,connector-type", get_conntype_val, NULVAL }, +// {FLAGTRUE, true, "@0,device_type", NULL, STRVAL("display") }, +// {FLAGTRUE, false, "@0,display-connect-flags", NULL, DWRVAL((uint32_t)0) }, +// {FLAGTRUE, true, "@0,display-type", NULL, STRVAL("NONE") }, + {FLAGTRUE, true, "@0,name", get_name_val, NULVAL }, +// {FLAGTRUE, true, "@0,VRAM,memsize", get_vrammemsize_val, NULVAL }, + +// {FLAGTRUE, false, "AAPL,aux-power-connected", NULL, DWRVAL((uint32_t)1) }, +// {FLAGTRUE, false, "AAPL,backlight-control", NULL, DWRVAL((uint32_t)0) }, + {FLAGTRUE, false, "ATY,bin_image", get_binimage_val, NULVAL }, + {FLAGTRUE, false, "ATY,Copyright", NULL, STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2010") }, + {FLAGTRUE, false, "ATY,Card#", get_romrevision_val, NULVAL }, + {FLAGTRUE, false, "ATY,VendorID", NULL, WRDVAL((uint16_t)0x1002) }, + {FLAGTRUE, false, "ATY,DeviceID", get_deviceid_val, NULVAL }, + +// {FLAGTRUE, false, "ATY,MCLK", get_mclk_val, NULVAL }, +// {FLAGTRUE, false, "ATY,SCLK", get_sclk_val, NULVAL }, +// {FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL((uint32_t)0x0a8c) }, + +// {FLAGTRUE, false, "ATY,PlatformInfo", get_platforminfo_val, NULVAL }, + + {FLAGTRUE, false, "name", get_nameparent_val, NULVAL }, + {FLAGTRUE, false, "device_type", get_nameparent_val, NULVAL }, + {FLAGTRUE, false, "model", get_model_val, STRVAL("ATI Radeon") }, +// {FLAGTRUE, false, "VRAM,totalsize", get_vramtotalsize_val, NULVAL }, + {FLAGTRUE, false, "hda-gfx", get_hdmiaudio, NULVAL}, + + {FLAGTRUE, false, NULL, NULL, NULVAL } +}; + +bool get_hdmiaudio(value_t * val) +{ + bool doit = false; + if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit){ + val->type = kStr; + val->size = strlen("onboard-1") + 1; + val->data = (uint8_t *)"onboard-1"; + + return true; + } + return false; +} + +bool get_bootdisplay_val(value_t *val) +{ + static uint32_t v = 0; + + if (v) + { + return false; + } + if (!card->posted) + { + return false; + } + v = 1; + val->type = kCst; + val->size = 4; + val->data = (uint8_t *)&v; + + return true; +} + +bool get_vrammemory_val(value_t *val) +{ + return false; +} + +bool get_name_val(value_t *val) +{ + val->type = aty_name.type; + val->size = aty_name.size; + val->data = aty_name.data; + + return true; +} + +bool get_nameparent_val(value_t *val) +{ + val->type = aty_nameparent.type; + val->size = aty_nameparent.size; + val->data = aty_nameparent.data; + + return true; +} + +bool get_model_val(value_t *val) +{ + if (!card->info->model_name) + return false; + + val->type = kStr; + val->size = strlen(card->info->model_name) + 1; + val->data = (uint8_t *)card->info->model_name; + + return true; +} + +bool get_conntype_val(value_t *val) +{ +//Connector types: +//0x00000010: VGA +//0x00000004: DL DVI-I +//0x00000200: SL DVI-I +//0x00000080: S-V +//0x00000800: HDMI +//0x00000400: DisplayPort +//0x00000002: LVDS + + return false; +} + +bool get_vrammemsize_val(value_t *val) +{ + static int idx = -1; + static uint64_t memsize; + + idx++; + memsize = ((uint64_t)card->vram_size << 32); + if (idx == 0) + { + memsize = memsize | (uint64_t)card->vram_size; + } + val->type = kCst; + val->size = 8; + val->data = (uint8_t *)&memsize; + + return true; +} + +bool get_binimage_val(value_t *val) +{ + if (!card->rom) + { + return false; + } + val->type = kPtr; + val->size = card->rom_size; + val->data = card->rom; + + return true; +} + +bool get_romrevision_val(value_t *val) +{ + uint8_t *rev; + if (!card->rom) + { + return false; + } + + rev = card->rom + *(uint8_t *)(card->rom + OFFSET_TO_GET_ATOMBIOS_STRINGS_START); + + val->type = kPtr; + val->size = strlen((char *)rev); + val->data = malloc(val->size); + + if (!val->data) + { + return false; + } + + memcpy(val->data, rev, val->size); + + return true; +} + +bool get_deviceid_val(value_t *val) +{ + val->type = kCst; + val->size = 2; + val->data = (uint8_t *)&card->pci_dev->device_id; + + return true; +} + +bool get_mclk_val(value_t *val) +{ + return false; +} + +bool get_sclk_val(value_t *val) +{ + return false; +} + +bool get_refclk_val(value_t *val) +{ + return false; +} + +bool get_platforminfo_val(value_t *val) +{ + val->data = malloc(0x80); + if (!val->data) + { + return false; + } + bzero(val->data, 0x80); + + val->type = kPtr; + val->size = 0x80; + val->data[0] = 1; + + return true; +} + +bool get_vramtotalsize_val(value_t *val) +{ + + val->type = kCst; + val->size = 4; + val->data = (uint8_t *)&card->vram_size; + + return true; +} + +void free_val(value_t *val) +{ + if (val->type == kPtr) + { + free(val->data); + } + + bzero(val, sizeof(value_t)); +} + +void devprop_add_list(dev_prop_t devprop_list[]) +{ + int i, pnum; + value_t *val = malloc(sizeof(value_t)); + + for (i = 0; devprop_list[i].name != NULL; i++) + { + if ((devprop_list[i].flags == FLAGTRUE) || (devprop_list[i].flags | card->flags)) + { + if (devprop_list[i].get_value && devprop_list[i].get_value(val)) + { + devprop_add_value(card->device, devprop_list[i].name, val->data, val->size); + free_val(val); + + if (devprop_list[i].all_ports) + { + for (pnum = 1; pnum < card->ports; pnum++) + { + if (devprop_list[i].get_value(val)) + { + devprop_list[i].name[1] = 0x30 + pnum; // convert to ascii + devprop_add_value(card->device, devprop_list[i].name, val->data, val->size); + free_val(val); + } + } + devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card + } + } + else + { + if (devprop_list[i].default_val.type != kNul) + { + devprop_add_value(card->device, devprop_list[i].name, + devprop_list[i].default_val.type == kCst ? + (uint8_t *)&(devprop_list[i].default_val.data) : devprop_list[i].default_val.data, + devprop_list[i].default_val.size); + } + + if (devprop_list[i].all_ports) + { + for (pnum = 1; pnum < card->ports; pnum++) + { + if (devprop_list[i].default_val.type != kNul) + { + devprop_list[i].name[1] = 0x30 + pnum; // convert to ascii + devprop_add_value(card->device, devprop_list[i].name, + devprop_list[i].default_val.type == kCst ? + (uint8_t *)&(devprop_list[i].default_val.data) : devprop_list[i].default_val.data, + devprop_list[i].default_val.size); + } + } + devprop_list[i].name[1] = 0x30; // write back our "@0," for a next possible card + } + } + } + } + + free(val); +} + +bool validate_rom(option_rom_header_t *rom_header, pci_dt_t *pci_dev) +{ + option_rom_pci_header_t *rom_pci_header; + + if (rom_header->signature != 0xaa55) + { + return false; + } + + rom_pci_header = (option_rom_pci_header_t *)((uint8_t *)rom_header + rom_header->pci_header_offset); + + if (rom_pci_header->signature != 0x52494350) + { + return false; + } + + if (rom_pci_header->vendor_id != pci_dev->vendor_id || rom_pci_header->device_id != pci_dev->device_id) + { + return false; + } + + return true; +} + +bool load_vbios_file(const char *key, uint16_t vendor_id, uint16_t device_id, uint32_t subsys_id) +{ + int fd; + char file_name[24]; + bool do_load = false; + + getBoolForKey(key, &do_load, &bootInfo->chameleonConfig); + if (!do_load) + { + return false; + } + + sprintf(file_name, "/Extra/%04x_%04x_%08x.rom", vendor_id, device_id, subsys_id); + if ((fd = open_bvdev("bt(0,0)", file_name, 0)) < 0) + { + return false; + } + + card->rom_size = file_size(fd); + card->rom = malloc(card->rom_size); + if (!card->rom) + { + return false; + } + + read(fd, (char *)card->rom, card->rom_size); + + if (!validate_rom((option_rom_header_t *)card->rom, card->pci_dev)) + { + card->rom_size = 0; + card->rom = 0; + return false; + } + + card->rom_size = ((option_rom_header_t *)card->rom)->rom_size * 512; + + close(fd); + + return true; +} + +void get_vram_size(void) +{ + ati_chip_family_t chip_family = card->info->chip_family; + + card->vram_size = 0; + + if (chip_family >= CHIP_FAMILY_CEDAR) + { + // size in MB on evergreen + // XXX watch for overflow!!! + card->vram_size = RegRead32(R600_CONFIG_MEMSIZE) * 1024 * 1024; + } + else + { + if (chip_family >= CHIP_FAMILY_R600) + { + card->vram_size = RegRead32(R600_CONFIG_MEMSIZE); + } + } +} + +bool read_vbios(bool from_pci) +{ + option_rom_header_t *rom_addr; + + if (from_pci) + { + rom_addr = (option_rom_header_t *)(pci_config_read32(card->pci_dev->dev.addr, PCI_ROM_ADDRESS) & ~0x7ff); + verbose(" @0x%x\n", rom_addr); + } + else + { + rom_addr = (option_rom_header_t *)0xc0000; + } + + if (!validate_rom(rom_addr, card->pci_dev)) + { + return false; + } + card->rom_size = rom_addr->rom_size * 512; + if (!card->rom_size) + { + return false; + } + + card->rom = malloc(card->rom_size); + if (!card->rom) + { + return false; + } + + memcpy(card->rom, (void *)rom_addr, card->rom_size); + + return true; +} + +bool read_disabled_vbios(void) +{ + bool ret = false; + ati_chip_family_t chip_family = card->info->chip_family; + + if (chip_family >= CHIP_FAMILY_RV770) + { + uint32_t viph_control = RegRead32(RADEON_VIPH_CONTROL); + uint32_t bus_cntl = RegRead32(RADEON_BUS_CNTL); + uint32_t d1vga_control = RegRead32(AVIVO_D1VGA_CONTROL); + uint32_t d2vga_control = RegRead32(AVIVO_D2VGA_CONTROL); + uint32_t vga_render_control = RegRead32(AVIVO_VGA_RENDER_CONTROL); + uint32_t rom_cntl = RegRead32(R600_ROM_CNTL); + uint32_t cg_spll_func_cntl = 0; + uint32_t cg_spll_status; + + // disable VIP + RegWrite32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); + + // enable the rom + RegWrite32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); + + // Disable VGA mode + RegWrite32(AVIVO_D1VGA_CONTROL, (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_D2VGA_CONTROL, (d2vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, (vga_render_control & ~AVIVO_VGA_VSTATUS_CNTL_MASK)); + + if (chip_family == CHIP_FAMILY_RV730) + { + cg_spll_func_cntl = RegRead32(R600_CG_SPLL_FUNC_CNTL); + + // enable bypass mode + RegWrite32(R600_CG_SPLL_FUNC_CNTL, (cg_spll_func_cntl | R600_SPLL_BYPASS_EN)); + + // wait for SPLL_CHG_STATUS to change to 1 + cg_spll_status = 0; + while (!(cg_spll_status & R600_SPLL_CHG_STATUS)) + { + cg_spll_status = RegRead32(R600_CG_SPLL_STATUS); + } + + RegWrite32(R600_ROM_CNTL, (rom_cntl & ~R600_SCK_OVERWRITE)); + } + else + { + RegWrite32(R600_ROM_CNTL, (rom_cntl | R600_SCK_OVERWRITE)); + } + + ret = read_vbios(true); + + // restore regs + if (chip_family == CHIP_FAMILY_RV730) + { + RegWrite32(R600_CG_SPLL_FUNC_CNTL, cg_spll_func_cntl); + + // wait for SPLL_CHG_STATUS to change to 1 + cg_spll_status = 0; + while (!(cg_spll_status & R600_SPLL_CHG_STATUS)) + cg_spll_status = RegRead32(R600_CG_SPLL_STATUS); + } + RegWrite32(RADEON_VIPH_CONTROL, viph_control); + RegWrite32(RADEON_BUS_CNTL, bus_cntl); + RegWrite32(AVIVO_D1VGA_CONTROL, d1vga_control); + RegWrite32(AVIVO_D2VGA_CONTROL, d2vga_control); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); + RegWrite32(R600_ROM_CNTL, rom_cntl); + } + else + if (chip_family >= CHIP_FAMILY_R600) + { + uint32_t viph_control = RegRead32(RADEON_VIPH_CONTROL); + uint32_t bus_cntl = RegRead32(RADEON_BUS_CNTL); + uint32_t d1vga_control = RegRead32(AVIVO_D1VGA_CONTROL); + uint32_t d2vga_control = RegRead32(AVIVO_D2VGA_CONTROL); + uint32_t vga_render_control = RegRead32(AVIVO_VGA_RENDER_CONTROL); + uint32_t rom_cntl = RegRead32(R600_ROM_CNTL); + uint32_t general_pwrmgt = RegRead32(R600_GENERAL_PWRMGT); + uint32_t low_vid_lower_gpio_cntl = RegRead32(R600_LOW_VID_LOWER_GPIO_CNTL); + uint32_t medium_vid_lower_gpio_cntl = RegRead32(R600_MEDIUM_VID_LOWER_GPIO_CNTL); + uint32_t high_vid_lower_gpio_cntl = RegRead32(R600_HIGH_VID_LOWER_GPIO_CNTL); + uint32_t ctxsw_vid_lower_gpio_cntl = RegRead32(R600_CTXSW_VID_LOWER_GPIO_CNTL); + uint32_t lower_gpio_enable = RegRead32(R600_LOWER_GPIO_ENABLE); + + // disable VIP + RegWrite32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); + + // enable the rom + RegWrite32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); + + // Disable VGA mode + RegWrite32(AVIVO_D1VGA_CONTROL, (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_D2VGA_CONTROL, (d2vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | AVIVO_DVGA_CONTROL_TIMING_SELECT))); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, (vga_render_control & ~AVIVO_VGA_VSTATUS_CNTL_MASK)); + RegWrite32(R600_ROM_CNTL, ((rom_cntl & ~R600_SCK_PRESCALE_CRYSTAL_CLK_MASK) | (1 << R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT) | R600_SCK_OVERWRITE)); + RegWrite32(R600_GENERAL_PWRMGT, (general_pwrmgt & ~R600_OPEN_DRAIN_PADS)); + RegWrite32(R600_LOW_VID_LOWER_GPIO_CNTL, (low_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_MEDIUM_VID_LOWER_GPIO_CNTL, (medium_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_HIGH_VID_LOWER_GPIO_CNTL, (high_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_CTXSW_VID_LOWER_GPIO_CNTL, (ctxsw_vid_lower_gpio_cntl & ~0x400)); + RegWrite32(R600_LOWER_GPIO_ENABLE, (lower_gpio_enable | 0x400)); + + ret = read_vbios(true); + + // restore regs + RegWrite32(RADEON_VIPH_CONTROL, viph_control); + RegWrite32(RADEON_BUS_CNTL, bus_cntl); + RegWrite32(AVIVO_D1VGA_CONTROL, d1vga_control); + RegWrite32(AVIVO_D2VGA_CONTROL, d2vga_control); + RegWrite32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); + RegWrite32(R600_ROM_CNTL, rom_cntl); + RegWrite32(R600_GENERAL_PWRMGT, general_pwrmgt); + RegWrite32(R600_LOW_VID_LOWER_GPIO_CNTL, low_vid_lower_gpio_cntl); + RegWrite32(R600_MEDIUM_VID_LOWER_GPIO_CNTL, medium_vid_lower_gpio_cntl); + RegWrite32(R600_HIGH_VID_LOWER_GPIO_CNTL, high_vid_lower_gpio_cntl); + RegWrite32(R600_CTXSW_VID_LOWER_GPIO_CNTL, ctxsw_vid_lower_gpio_cntl); + RegWrite32(R600_LOWER_GPIO_ENABLE, lower_gpio_enable); + } + + return ret; +} + +bool radeon_card_posted(void) +{ + uint32_t reg; + + // first check CRTCs + reg = RegRead32(RADEON_CRTC_GEN_CNTL) | RegRead32(RADEON_CRTC2_GEN_CNTL); + if (reg & RADEON_CRTC_EN) + { + return true; + } + + // then check MEM_SIZE, in case something turned the crtcs off + reg = RegRead32(R600_CONFIG_MEMSIZE); + if (reg) + { + return true; + } + + return false; +} + +#if 0 +bool devprop_add_pci_config_space(void) +{ + int offset; + + uint8_t *config_space = malloc(0x100); + if (!config_space) + { + return false; + } + + for (offset = 0; offset < 0x100; offset += 4) + { + config_space[offset / 4] = pci_config_read32(card->pci_dev->dev.addr, offset); + } + + devprop_add_value(card->device, "ATY,PCIConfigSpace", config_space, 0x100); + free(config_space); + + return true; +} +#endif + +static bool init_card(pci_dt_t *pci_dev) +{ + bool add_vbios = true; + char name[24]; + char name_parent[24]; + int i; + int n_ports = 0; + + card = malloc(sizeof(card_t)); + if (!card) + { + return false; + } + bzero(card, sizeof(card_t)); + + card->pci_dev = pci_dev; + + for (i = 0; radeon_cards[i].device_id ; i++) + { + if (radeon_cards[i].device_id == pci_dev->device_id) + { + if ((radeon_cards[i].subsys_id == 0x00000000) || (radeon_cards[i].subsys_id == pci_dev->subsys_id.subsys_id)) + { + card->info = &radeon_cards[i]; + break; + } + } + } + + if (card->info == NULL) // Jief + { + verbose("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%04x:%04x] \n", + pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys.vendor_id, pci_dev->subsys_id.subsys.device_id); + return false; + } + + card->fb = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_0) & ~0x0f); + card->mmio = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f); + card->io = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_4) & ~0x03); + + verbose("ATI Framebuffer Addr: @0x%08X MMIO Addr: @0x%08X I/O Port Addr: @0x%08X ROM Addr: @0x%08X\n", + card->fb, card->mmio, card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS)); + + card->posted = radeon_card_posted(); + verbose("ATI card %s, ", card->posted ? "POSTed" : "non-POSTed"); + + get_vram_size(); + + getBoolForKey(kATYbinimage, &add_vbios, &bootInfo->chameleonConfig); + + if (add_vbios) + { + if (!load_vbios_file(kUseAtiROM, pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id)) + { + verbose("reading Video BIOS from %s", card->posted ? "legacy space" : "PCI ROM"); + if (card->posted) + { + read_vbios(false); + } + else + { + read_disabled_vbios(); + } + verbose("\n"); + } + } + + + if (card->info->chip_family >= CHIP_FAMILY_CEDAR) + { + card->flags |= EVERGREEN; + } + + + // Check AtiConfig key for a framebuffer name, + card->cfg_name = getStringForKey(kAtiConfig, &bootInfo->chameleonConfig); + + // if none, + if (!card->cfg_name) + { + // use cfg_name on radeon_cards, to retrive the default name from card_configs, + card->cfg_name = card_configs[card->info->cfg_name].name; + + // which means one of the fb's or kNull + verbose("Framebuffer set to: %s using device's default.\n", card->cfg_name); + } + else + { + // else, use the fb name returned by AtiConfig. + verbose("Framebuffer set to: %s using AtiConfig=%s\n", card->cfg_name, card->cfg_name); + } + + // Check AtiPorts key for nr of ports, + card->ports = getIntForKey(kAtiPorts, &n_ports, &bootInfo->chameleonConfig); + // if a value bigger than 0 ?? is found, (do we need >= 0 ?? that's null FB on card_configs) + if (n_ports > 0) + { + card->ports = n_ports; // use it. + verbose("Number of ports set to: %d using AtiPorts=%d\n", card->ports, card->ports); + } + else + { + // else, match cfg_name with card_configs list and retrive default nr of ports. + for (i = 0; i < kCfgEnd; i++) + if (strcmp(card->cfg_name, card_configs[i].name) == 0) + { + card->ports = card_configs[i].ports; // default + } + + verbose("Number of ports set to: %d using framebuffer's default.\n", card->ports); + } + + + sprintf(name, "ATY,%s", card->cfg_name); + aty_name.type = kStr; + aty_name.size = strlen(name) + 1; + aty_name.data = (uint8_t *)name; + + sprintf(name_parent, "ATY,%sParent", card->cfg_name); + aty_nameparent.type = kStr; + aty_nameparent.size = strlen(name_parent) + 1; + aty_nameparent.data = (uint8_t *)name_parent; + + return true; +} + +bool setup_ati_devprop(pci_dt_t *ati_dev) +{ + char *devicepath; + + if (!init_card(ati_dev)) + { + return false; + } + + // ------------------------------------------------- + // Find a better way to do this (in device_inject.c) + if (!string) + { + string = devprop_create_string(); + } + devicepath = get_pci_dev_path(ati_dev); + card->device = devprop_add_device(string, devicepath); + if (!card->device) + { + return false; + } + // ------------------------------------------------- + +#if 0 + uint64_t fb = (uint32_t)card->fb; + uint64_t mmio = (uint32_t)card->mmio; + uint64_t io = (uint32_t)card->io; + devprop_add_value(card->device, "ATY,FrameBufferOffset", &fb, 8); + devprop_add_value(card->device, "ATY,RegisterSpaceOffset", &mmio, 8); + devprop_add_value(card->device, "ATY,IOSpaceOffset", &io, 8); +#endif + + devprop_add_list(ati_devprop_list); + + // ------------------------------------------------- + // Find a better way to do this (in device_inject.c) + //Azi: XXX tried to fix a malloc error in vain; this is related to XCode 4 compilation! + stringdata = malloc(sizeof(uint8_t) * string->length); + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + // ------------------------------------------------- + + verbose("%s %dMB [%04x:%04x] (subsys [%04x:%04x]) (%s:%s) :: %s\n", + chip_family_name[card->info->chip_family], card->info->model_name, + (uint32_t)(card->vram_size / (1024 * 1024)), card->cfg_name, + ati_dev->vendor_id, ati_dev->device_id, + ati_dev->subsys_id.subsys.vendor_id, ati_dev->subsys_id.subsys.device_id, + chip_family_name[card->info->chip_family], card->cfg_name, + devicepath); + + free(card); + + return true; +} diff --git a/i386/libsaio/ati.h b/i386/libsaio/ati.h new file mode 100644 index 0000000..c6b6d39 --- /dev/null +++ b/i386/libsaio/ati.h @@ -0,0 +1,253 @@ +// +// ati.h +// Chameleon +// +// Created by Chris Morton on 1/30/13. +// +// + +#ifndef Chameleon_ati_h +#define Chameleon_ati_h + +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "device_inject.h" +#include "ati_reg.h" + + + +/* DEFINES */ +#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e + +#define Reg32(reg) (*(volatile uint32_t *)(card->mmio + reg)) +#define RegRead32(reg) (Reg32(reg)) +#define RegWrite32(reg, value) (Reg32(reg) = value) + +/* Flags */ +#define MKFLAG(n) (1 << n) +#define FLAGTRUE MKFLAG(0) +#define EVERGREEN MKFLAG(1) + +#define DATVAL(x) {kPtr, sizeof(x), (uint8_t *)x} +#define STRVAL(x) {kStr, sizeof(x), (uint8_t *)x} +#define BYTVAL(x) {kCst, 1, (uint8_t *)x} +#define WRDVAL(x) {kCst, 2, (uint8_t *)x} +#define DWRVAL(x) {kCst, 4, (uint8_t *)x} +#define QWRVAL(x) {kCst, 8, (uint8_t *)x} +#define NULVAL {kNul, 0, (uint8_t *)NULL} + + +/*Typedefs ENUMS*/ +typedef enum { + kNul, + kStr, + kPtr, + kCst +} type_t; + +typedef enum { + CHIP_FAMILY_UNKNOW, + /* Old */ + CHIP_FAMILY_R420, + CHIP_FAMILY_RV410, + CHIP_FAMILY_RV515, + CHIP_FAMILY_R520, + CHIP_FAMILY_RV530, + CHIP_FAMILY_RV560, + CHIP_FAMILY_RV570, + CHIP_FAMILY_R580, + /* IGP */ + CHIP_FAMILY_RS600, + CHIP_FAMILY_RS690, + CHIP_FAMILY_RS740, + CHIP_FAMILY_RS780, + CHIP_FAMILY_RS880, + /* R600 */ + CHIP_FAMILY_R600, + CHIP_FAMILY_RV610, + CHIP_FAMILY_RV620, + CHIP_FAMILY_RV630, + CHIP_FAMILY_RV635, + CHIP_FAMILY_RV670, + /* R700 */ + CHIP_FAMILY_RV710, + CHIP_FAMILY_RV730, + CHIP_FAMILY_RV740, + CHIP_FAMILY_RV770, + CHIP_FAMILY_RV772, + CHIP_FAMILY_RV790, + /* Evergreen */ + CHIP_FAMILY_CEDAR, + CHIP_FAMILY_CYPRESS, + CHIP_FAMILY_HEMLOCK, + CHIP_FAMILY_JUNIPER, + CHIP_FAMILY_REDWOOD, + CHIP_FAMILY_BROADWAY, + // CHIP_FAMILY_MADISON, + // CHIP_FAMILY_PARK, + /* Northern Islands */ + // CHIP_FAMILY_ANTILLES, + CHIP_FAMILY_BARTS, + CHIP_FAMILY_CAICOS, + CHIP_FAMILY_CAYMAN, + CHIP_FAMILY_TURKS, + /* Southern Islands */ + CHIP_FAMILY_TAHITI, + CHIP_FAMILY_PITCAIRN, + CHIP_FAMILY_VERDE, + CHIP_FAMILY_THAMES, + CHIP_FAMILY_LOMBOK, + // CHIP_FAMILY_NEWZEALAND, + CHIP_FAMILY_LAST +} ati_chip_family_t; + +typedef enum { + kNull, + /* OLDController */ + kWormy, + kAlopias, + kCaretta, + kKakapo, + kKipunji, + kPeregrine, + kRaven, + kSphyrna, + /* AMD2400Controller */ + kIago, + /* AMD2600Controller */ + kHypoprion, + kLamna, + /* AMD3800Controller */ + kMegalodon, + kTriakis, + /* AMD4600Controller */ + kFlicker, + kGliff, + kShrike, + /* AMD4800Controller */ + kCardinal, + kMotmot, + kQuail, + /* AMD5000Controller */ + kDouc, + kLangur, + kUakari, + kZonalis, + kAlouatta, + kHoolock, + kVervet, + kBaboon, + kEulemur, + kGalago, + kColobus, + kMangabey, + kNomascus, + kOrangutan, + /* AMD6000Controller */ + kPithecia, + kBulrushes, + kCattail, + kHydrilla, + kDuckweed, + kFanwort, + kElodea, + kKudzu, + kGibba, + kLotus, + kIpomoea, + kMuskgrass, + kJuncus, + kOsmunda, + kPondweed, + kSpikerush, + kTypha, + /* AMD7000Controller */ + kAji, // TESTING + kBuri, // TESTING + kChutoro, // TESTING + kDashimaki, // TESTING + kEbi, // TESTING + kGari, // TESTING + kFutomaki, // TESTING + kHamachi, // TESTING + kOPM, // TESTING + kIkura, // TESTING + kIkuraS, // TESTING + kCfgEnd +} ati_config_name_t; + +/* Typedefs STRUCTS */ +typedef struct { + type_t type; + uint32_t size; + uint8_t *data; +} value_t; + +//card to #ports +typedef struct { + const char *name; + uint8_t ports; +} card_config_t; + +//radeon card (includes teh AtiConfig) +typedef struct { + uint16_t device_id; + uint32_t subsys_id; + ati_chip_family_t chip_family; + const char *model_name; + ati_config_name_t cfg_name; +} radeon_card_info_t; + +// dev_tree representation +typedef struct { + uint32_t flags; + bool all_ports; + char *name; + bool (*get_value)(value_t *val); + value_t default_val; +} dev_prop_t; + +typedef struct { + struct DevPropDevice *device; + radeon_card_info_t *info; + pci_dt_t *pci_dev; + uint8_t *fb; + uint8_t *mmio; + uint8_t *io; + uint8_t *rom; + uint64_t rom_size; + uint64_t vram_size; + const char *cfg_name; + uint8_t ports; + uint32_t flags; + bool posted; +} card_t; + + + +/* functions */ +bool get_bootdisplay_val(value_t *val); +bool get_vrammemory_val(value_t *val); +bool get_name_val(value_t *val); +bool get_nameparent_val(value_t *val); +bool get_model_val(value_t *val); +bool get_conntype_val(value_t *val); +bool get_vrammemsize_val(value_t *val); +bool get_binimage_val(value_t *val); +bool get_romrevision_val(value_t *val); +bool get_deviceid_val(value_t *val); +bool get_mclk_val(value_t *val); +bool get_sclk_val(value_t *val); +bool get_refclk_val(value_t *val); +bool get_platforminfo_val(value_t *val); +bool get_vramtotalsize_val(value_t *val); +bool get_hdmiaudio(value_t * val); + +/* vals */ +static value_t aty_name; +static value_t aty_nameparent; +card_t *card; + +#endif diff --git a/i386/libsaio/ati_reg.h b/i386/libsaio/ati_reg.h new file mode 100644 index 0000000..46a072d --- /dev/null +++ b/i386/libsaio/ati_reg.h @@ -0,0 +1,5672 @@ +/* + * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and + * VA Linux Systems Inc., Fremont, California. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation on the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR + * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/* + * Authors: + * Kevin E. Martin <martin@xfree86.org> + * Rickard E. Faith <faith@valinux.com> + * Alan Hourihane <alanh@fairlite.demon.co.uk> + * + * References: + * + * !!!! FIXME !!!! + * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical + * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April + * 1999. + * + * !!!! FIXME !!!! + * RAGE 128 Software Development Manual (Technical Reference Manual P/N + * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999. + * + */ + +/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h + * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT + * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */ + +#ifndef _ATI_REG_H_ +#define _ATI_REG_H_ + +#define ATI_DATATYPE_VQ 0 +#define ATI_DATATYPE_CI4 1 +#define ATI_DATATYPE_CI8 2 +#define ATI_DATATYPE_ARGB1555 3 +#define ATI_DATATYPE_RGB565 4 +#define ATI_DATATYPE_RGB888 5 +#define ATI_DATATYPE_ARGB8888 6 +#define ATI_DATATYPE_RGB332 7 +#define ATI_DATATYPE_Y8 8 +#define ATI_DATATYPE_RGB8 9 +#define ATI_DATATYPE_CI16 10 +#define ATI_DATATYPE_VYUY_422 11 +#define ATI_DATATYPE_YVYU_422 12 +#define ATI_DATATYPE_AYUV_444 14 +#define ATI_DATATYPE_ARGB4444 15 + + /* Registers for 2D/Video/Overlay */ +#define RADEON_ADAPTER_ID 0x0f2c /* PCI */ +#define RADEON_AGP_BASE 0x0170 +#define RADEON_AGP_CNTL 0x0174 +# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0) +# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0) +# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0) +# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0) +# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0) +# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0) +# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0) +# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0) +#define RADEON_STATUS_PCI_CONFIG 0x06 +# define RADEON_CAP_LIST 0x100000 +#define RADEON_CAPABILITIES_PTR_PCI_CONFIG 0x34 /* offset in PCI config*/ +# define RADEON_CAP_PTR_MASK 0xfc /* mask off reserved bits of CAP_PTR */ +# define RADEON_CAP_ID_NULL 0x00 /* End of capability list */ +# define RADEON_CAP_ID_AGP 0x02 /* AGP capability ID */ +# define RADEON_CAP_ID_EXP 0x10 /* PCI Express */ +#define RADEON_AGP_COMMAND 0x0f60 /* PCI */ +#define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/ +# define RADEON_AGP_ENABLE (1<<8) +#define RADEON_AGP_PLL_CNTL 0x000b /* PLL */ +#define RADEON_AGP_STATUS 0x0f5c /* PCI */ +# define RADEON_AGP_1X_MODE 0x01 +# define RADEON_AGP_2X_MODE 0x02 +# define RADEON_AGP_4X_MODE 0x04 +# define RADEON_AGP_FW_MODE 0x10 +# define RADEON_AGP_MODE_MASK 0x17 +# define RADEON_AGPv3_MODE 0x08 +# define RADEON_AGPv3_4X_MODE 0x01 +# define RADEON_AGPv3_8X_MODE 0x02 +#define RADEON_ATTRDR 0x03c1 /* VGA */ +#define RADEON_ATTRDW 0x03c0 /* VGA */ +#define RADEON_ATTRX 0x03c0 /* VGA */ +#define RADEON_AUX_WINDOW_HORZ_CNTL 0x02d8 +#define RADEON_AUX_WINDOW_VERT_CNTL 0x02dc + +#define RADEON_BASE_CODE 0x0f0b +#define RADEON_BIOS_0_SCRATCH 0x0010 +# define RADEON_FP_PANEL_SCALABLE (1 << 16) +# define RADEON_FP_PANEL_SCALE_EN (1 << 17) +# define RADEON_FP_CHIP_SCALE_EN (1 << 18) +# define RADEON_DRIVER_BRIGHTNESS_EN (1 << 26) +# define RADEON_DISPLAY_ROT_MASK (3 << 28) +# define RADEON_DISPLAY_ROT_00 (0 << 28) +# define RADEON_DISPLAY_ROT_90 (1 << 28) +# define RADEON_DISPLAY_ROT_180 (2 << 28) +# define RADEON_DISPLAY_ROT_270 (3 << 28) +#define RADEON_BIOS_1_SCRATCH 0x0014 +#define RADEON_BIOS_2_SCRATCH 0x0018 +#define RADEON_BIOS_3_SCRATCH 0x001c +#define RADEON_BIOS_4_SCRATCH 0x0020 +# define RADEON_CRT1_ATTACHED_MASK (3 << 0) +# define RADEON_CRT1_ATTACHED_MONO (1 << 0) +# define RADEON_CRT1_ATTACHED_COLOR (2 << 0) +# define RADEON_LCD1_ATTACHED (1 << 2) +# define RADEON_DFP1_ATTACHED (1 << 3) +# define RADEON_TV1_ATTACHED_MASK (3 << 4) +# define RADEON_TV1_ATTACHED_COMP (1 << 4) +# define RADEON_TV1_ATTACHED_SVIDEO (2 << 4) +# define RADEON_CRT2_ATTACHED_MASK (3 << 8) +# define RADEON_CRT2_ATTACHED_MONO (1 << 8) +# define RADEON_CRT2_ATTACHED_COLOR (2 << 8) +# define RADEON_DFP2_ATTACHED (1 << 11) +#define RADEON_BIOS_5_SCRATCH 0x0024 +# define RADEON_LCD1_ON (1 << 0) +# define RADEON_CRT1_ON (1 << 1) +# define RADEON_TV1_ON (1 << 2) +# define RADEON_DFP1_ON (1 << 3) +# define RADEON_CRT2_ON (1 << 5) +# define RADEON_CV1_ON (1 << 6) +# define RADEON_DFP2_ON (1 << 7) +# define RADEON_LCD1_CRTC_MASK (1 << 8) +# define RADEON_LCD1_CRTC_SHIFT 8 +# define RADEON_CRT1_CRTC_MASK (1 << 9) +# define RADEON_CRT1_CRTC_SHIFT 9 +# define RADEON_TV1_CRTC_MASK (1 << 10) +# define RADEON_TV1_CRTC_SHIFT 10 +# define RADEON_DFP1_CRTC_MASK (1 << 11) +# define RADEON_DFP1_CRTC_SHIFT 11 +# define RADEON_CRT2_CRTC_MASK (1 << 12) +# define RADEON_CRT2_CRTC_SHIFT 12 +# define RADEON_CV1_CRTC_MASK (1 << 13) +# define RADEON_CV1_CRTC_SHIFT 13 +# define RADEON_DFP2_CRTC_MASK (1 << 14) +# define RADEON_DFP2_CRTC_SHIFT 14 +#define RADEON_BIOS_6_SCRATCH 0x0028 +# define RADEON_ACC_MODE_CHANGE (1 << 2) +# define RADEON_EXT_DESKTOP_MODE (1 << 3) +# define RADEON_LCD_DPMS_ON (1 << 20) +# define RADEON_CRT_DPMS_ON (1 << 21) +# define RADEON_TV_DPMS_ON (1 << 22) +# define RADEON_DFP_DPMS_ON (1 << 23) +# define RADEON_DPMS_MASK (3 << 24) +# define RADEON_DPMS_ON (0 << 24) +# define RADEON_DPMS_STANDBY (1 << 24) +# define RADEON_DPMS_SUSPEND (2 << 24) +# define RADEON_DPMS_OFF (3 << 24) +# define RADEON_SCREEN_BLANKING (1 << 26) +# define RADEON_DRIVER_CRITICAL (1 << 27) +# define RADEON_DISPLAY_SWITCHING_DIS (1 << 30) +#define RADEON_BIOS_7_SCRATCH 0x002c +# define RADEON_SYS_HOTKEY (1 << 10) +# define RADEON_DRV_LOADED (1 << 12) +#define RADEON_BIOS_ROM 0x0f30 /* PCI */ +#define RADEON_BIST 0x0f0f /* PCI */ +#define RADEON_BRUSH_DATA0 0x1480 +#define RADEON_BRUSH_DATA1 0x1484 +#define RADEON_BRUSH_DATA10 0x14a8 +#define RADEON_BRUSH_DATA11 0x14ac +#define RADEON_BRUSH_DATA12 0x14b0 +#define RADEON_BRUSH_DATA13 0x14b4 +#define RADEON_BRUSH_DATA14 0x14b8 +#define RADEON_BRUSH_DATA15 0x14bc +#define RADEON_BRUSH_DATA16 0x14c0 +#define RADEON_BRUSH_DATA17 0x14c4 +#define RADEON_BRUSH_DATA18 0x14c8 +#define RADEON_BRUSH_DATA19 0x14cc +#define RADEON_BRUSH_DATA2 0x1488 +#define RADEON_BRUSH_DATA20 0x14d0 +#define RADEON_BRUSH_DATA21 0x14d4 +#define RADEON_BRUSH_DATA22 0x14d8 +#define RADEON_BRUSH_DATA23 0x14dc +#define RADEON_BRUSH_DATA24 0x14e0 +#define RADEON_BRUSH_DATA25 0x14e4 +#define RADEON_BRUSH_DATA26 0x14e8 +#define RADEON_BRUSH_DATA27 0x14ec +#define RADEON_BRUSH_DATA28 0x14f0 +#define RADEON_BRUSH_DATA29 0x14f4 +#define RADEON_BRUSH_DATA3 0x148c +#define RADEON_BRUSH_DATA30 0x14f8 +#define RADEON_BRUSH_DATA31 0x14fc +#define RADEON_BRUSH_DATA32 0x1500 +#define RADEON_BRUSH_DATA33 0x1504 +#define RADEON_BRUSH_DATA34 0x1508 +#define RADEON_BRUSH_DATA35 0x150c +#define RADEON_BRUSH_DATA36 0x1510 +#define RADEON_BRUSH_DATA37 0x1514 +#define RADEON_BRUSH_DATA38 0x1518 +#define RADEON_BRUSH_DATA39 0x151c +#define RADEON_BRUSH_DATA4 0x1490 +#define RADEON_BRUSH_DATA40 0x1520 +#define RADEON_BRUSH_DATA41 0x1524 +#define RADEON_BRUSH_DATA42 0x1528 +#define RADEON_BRUSH_DATA43 0x152c +#define RADEON_BRUSH_DATA44 0x1530 +#define RADEON_BRUSH_DATA45 0x1534 +#define RADEON_BRUSH_DATA46 0x1538 +#define RADEON_BRUSH_DATA47 0x153c +#define RADEON_BRUSH_DATA48 0x1540 +#define RADEON_BRUSH_DATA49 0x1544 +#define RADEON_BRUSH_DATA5 0x1494 +#define RADEON_BRUSH_DATA50 0x1548 +#define RADEON_BRUSH_DATA51 0x154c +#define RADEON_BRUSH_DATA52 0x1550 +#define RADEON_BRUSH_DATA53 0x1554 +#define RADEON_BRUSH_DATA54 0x1558 +#define RADEON_BRUSH_DATA55 0x155c +#define RADEON_BRUSH_DATA56 0x1560 +#define RADEON_BRUSH_DATA57 0x1564 +#define RADEON_BRUSH_DATA58 0x1568 +#define RADEON_BRUSH_DATA59 0x156c +#define RADEON_BRUSH_DATA6 0x1498 +#define RADEON_BRUSH_DATA60 0x1570 +#define RADEON_BRUSH_DATA61 0x1574 +#define RADEON_BRUSH_DATA62 0x1578 +#define RADEON_BRUSH_DATA63 0x157c +#define RADEON_BRUSH_DATA7 0x149c +#define RADEON_BRUSH_DATA8 0x14a0 +#define RADEON_BRUSH_DATA9 0x14a4 +#define RADEON_BRUSH_SCALE 0x1470 +#define RADEON_BRUSH_Y_X 0x1474 +#define RADEON_BUS_CNTL 0x0030 +# define RADEON_BUS_MASTER_DIS (1 << 6) +# define RADEON_BUS_BIOS_DIS_ROM (1 << 12) +# define RADEON_BUS_RD_DISCARD_EN (1 << 24) +# define RADEON_BUS_RD_ABORT_EN (1 << 25) +# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28) +# define RADEON_BUS_WRT_BURST (1 << 29) +# define RADEON_BUS_READ_BURST (1 << 30) +#define RADEON_BUS_CNTL1 0x0034 +# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) + +#define RADEON_PCIE_INDEX 0x0030 +#define RADEON_PCIE_DATA 0x0034 +#define R600_PCIE_PORT_INDEX 0x0038 +#define R600_PCIE_PORT_DATA 0x003c +/* PCIE_LC_LINK_WIDTH_CNTL is PCIE on r1xx-r5xx, PCIE_PORT on r6xx-r7xx */ +#define RADEON_PCIE_LC_LINK_WIDTH_CNTL 0xa2 /* PCIE */ +# define RADEON_PCIE_LC_LINK_WIDTH_SHIFT 0 +# define RADEON_PCIE_LC_LINK_WIDTH_MASK 0x7 +# define RADEON_PCIE_LC_LINK_WIDTH_X0 0 +# define RADEON_PCIE_LC_LINK_WIDTH_X1 1 +# define RADEON_PCIE_LC_LINK_WIDTH_X2 2 +# define RADEON_PCIE_LC_LINK_WIDTH_X4 3 +# define RADEON_PCIE_LC_LINK_WIDTH_X8 4 +# define RADEON_PCIE_LC_LINK_WIDTH_X12 5 +# define RADEON_PCIE_LC_LINK_WIDTH_X16 6 +# define RADEON_PCIE_LC_LINK_WIDTH_RD_SHIFT 4 +# define RADEON_PCIE_LC_LINK_WIDTH_RD_MASK 0x70 +# define R600_PCIE_LC_RECONFIG_ARC_MISSING_ESCAPE (1 << 7) +# define RADEON_PCIE_LC_RECONFIG_NOW (1 << 8) +# define RADEON_PCIE_LC_RECONFIG_LATER (1 << 9) +# define RADEON_PCIE_LC_SHORT_RECONFIG_EN (1 << 10) +# define R600_PCIE_LC_RENEGOTIATE_EN (1 << 10) +# define R600_PCIE_LC_SHORT_RECONFIG_EN (1 << 11) +#define R600_TARGET_AND_CURRENT_PROFILE_INDEX 0x70c +#define R700_TARGET_AND_CURRENT_PROFILE_INDEX 0x66c + +#define RADEON_CACHE_CNTL 0x1724 +#define RADEON_CACHE_LINE 0x0f0c /* PCI */ +#define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */ +#define RADEON_CAPABILITIES_PTR 0x0f34 /* PCI */ +#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */ +# define RADEON_DONT_USE_XTALIN (1 << 4) +# define RADEON_SCLK_DYN_START_CNTL (1 << 15) +#define RADEON_CLOCK_CNTL_DATA 0x000c +#define RADEON_CLOCK_CNTL_INDEX 0x0008 +# define RADEON_PLL_WR_EN (1 << 7) +# define RADEON_PLL_DIV_SEL (3 << 8) +# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8) +#define RADEON_M_SPLL_REF_FB_DIV 0x000a /* PLL */ +# define RADEON_M_SPLL_REF_DIV_MASK 0xff +# define RADEON_M_SPLL_REF_DIV_SHIFT 0 +# define RADEON_MPLL_FB_DIV_MASK 0xff +# define RADEON_MPLL_FB_DIV_SHIFT 8 +# define RADEON_SPLL_FB_DIV_MASK 0xff +# define RADEON_SPLL_FB_DIV_SHIFT 16 +#define RADEON_SPLL_CNTL 0x000c /* PLL */ +# define RADEON_SPLL_SLEEP (1 << 0) +# define RADEON_SPLL_RESET (1 << 1) +# define RADEON_SPLL_PCP_MASK 0x7 +# define RADEON_SPLL_PCP_SHIFT 8 +# define RADEON_SPLL_PVG_MASK 0x7 +# define RADEON_SPLL_PVG_SHIFT 11 +# define RADEON_SPLL_PDC_MASK 0x3 +# define RADEON_SPLL_PDC_SHIFT 14 +#define RADEON_CLK_PWRMGT_CNTL 0x0014 /* PLL */ +# define RADEON_ENGIN_DYNCLK_MODE (1 << 12) +# define RADEON_ACTIVE_HILO_LAT_MASK (3 << 13) +# define RADEON_ACTIVE_HILO_LAT_SHIFT 13 +# define RADEON_DISP_DYN_STOP_LAT_MASK (1 << 12) +# define RADEON_MC_BUSY (1 << 16) +# define RADEON_DLL_READY (1 << 19) +# define RADEON_CG_NO1_DEBUG_0 (1 << 24) +# define RADEON_CG_NO1_DEBUG_MASK (0x1f << 24) +# define RADEON_DYN_STOP_MODE_MASK (7 << 21) +# define RADEON_TVPLL_PWRMGT_OFF (1 << 30) +# define RADEON_TVCLK_TURNOFF (1 << 31) +#define RADEON_PLL_PWRMGT_CNTL 0x0015 /* PLL */ +# define RADEON_TCL_BYPASS_DISABLE (1 << 20) +#define RADEON_CLR_CMP_CLR_3D 0x1a24 +#define RADEON_CLR_CMP_CLR_DST 0x15c8 +#define RADEON_CLR_CMP_CLR_SRC 0x15c4 +#define RADEON_CLR_CMP_CNTL 0x15c0 +# define RADEON_SRC_CMP_EQ_COLOR (4 << 0) +# define RADEON_SRC_CMP_NEQ_COLOR (5 << 0) +# define RADEON_CLR_CMP_SRC_SOURCE (1 << 24) +#define RADEON_CLR_CMP_MASK 0x15cc +# define RADEON_CLR_CMP_MSK 0xffffffff +#define RADEON_CLR_CMP_MASK_3D 0x1A28 +#define RADEON_COMMAND 0x0f04 /* PCI */ +#define RADEON_COMPOSITE_SHADOW_ID 0x1a0c +#define RADEON_CONFIG_APER_0_BASE 0x0100 +#define RADEON_CONFIG_APER_1_BASE 0x0104 +#define RADEON_CONFIG_APER_SIZE 0x0108 +#define RADEON_CONFIG_BONDS 0x00e8 +#define RADEON_CONFIG_CNTL 0x00e0 +# define RADEON_CFG_ATI_REV_A11 (0 << 16) +# define RADEON_CFG_ATI_REV_A12 (1 << 16) +# define RADEON_CFG_ATI_REV_A13 (2 << 16) +# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16) +#define RADEON_CONFIG_MEMSIZE 0x00f8 +#define RADEON_CONFIG_MEMSIZE_EMBEDDED 0x0114 +#define RADEON_CONFIG_REG_1_BASE 0x010c +#define RADEON_CONFIG_REG_APER_SIZE 0x0110 +#define RADEON_CONFIG_XSTRAP 0x00e4 +#define RADEON_CONSTANT_COLOR_C 0x1d34 +# define RADEON_CONSTANT_COLOR_MASK 0x00ffffff +# define RADEON_CONSTANT_COLOR_ONE 0x00ffffff +# define RADEON_CONSTANT_COLOR_ZERO 0x00000000 +#define RADEON_CRC_CMDFIFO_ADDR 0x0740 +#define RADEON_CRC_CMDFIFO_DOUT 0x0744 +#define RADEON_GRPH_BUFFER_CNTL 0x02f0 +# define RADEON_GRPH_START_REQ_MASK (0x7f) +# define RADEON_GRPH_START_REQ_SHIFT 0 +# define RADEON_GRPH_STOP_REQ_MASK (0x7f<<8) +# define RADEON_GRPH_STOP_REQ_SHIFT 8 +# define RADEON_GRPH_CRITICAL_POINT_MASK (0x7f<<16) +# define RADEON_GRPH_CRITICAL_POINT_SHIFT 16 +# define RADEON_GRPH_CRITICAL_CNTL (1<<28) +# define RADEON_GRPH_BUFFER_SIZE (1<<29) +# define RADEON_GRPH_CRITICAL_AT_SOF (1<<30) +# define RADEON_GRPH_STOP_CNTL (1<<31) +#define RADEON_GRPH2_BUFFER_CNTL 0x03f0 +# define RADEON_GRPH2_START_REQ_MASK (0x7f) +# define RADEON_GRPH2_START_REQ_SHIFT 0 +# define RADEON_GRPH2_STOP_REQ_MASK (0x7f<<8) +# define RADEON_GRPH2_STOP_REQ_SHIFT 8 +# define RADEON_GRPH2_CRITICAL_POINT_MASK (0x7f<<16) +# define RADEON_GRPH2_CRITICAL_POINT_SHIFT 16 +# define RADEON_GRPH2_CRITICAL_CNTL (1<<28) +# define RADEON_GRPH2_BUFFER_SIZE (1<<29) +# define RADEON_GRPH2_CRITICAL_AT_SOF (1<<30) +# define RADEON_GRPH2_STOP_CNTL (1<<31) +#define RADEON_CRTC_CRNT_FRAME 0x0214 +#define RADEON_CRTC_EXT_CNTL 0x0054 +# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0) +# define RADEON_VGA_ATI_LINEAR (1 << 3) +# define RADEON_XCRT_CNT_EN (1 << 6) +# define RADEON_CRTC_HSYNC_DIS (1 << 8) +# define RADEON_CRTC_VSYNC_DIS (1 << 9) +# define RADEON_CRTC_DISPLAY_DIS (1 << 10) +# define RADEON_CRTC_SYNC_TRISTAT (1 << 11) +# define RADEON_CRTC_CRT_ON (1 << 15) +#define RADEON_CRTC_EXT_CNTL_DPMS_BYTE 0x0055 +# define RADEON_CRTC_HSYNC_DIS_BYTE (1 << 0) +# define RADEON_CRTC_VSYNC_DIS_BYTE (1 << 1) +# define RADEON_CRTC_DISPLAY_DIS_BYTE (1 << 2) +#define RADEON_CRTC_GEN_CNTL 0x0050 +# define RADEON_CRTC_DBL_SCAN_EN (1 << 0) +# define RADEON_CRTC_INTERLACE_EN (1 << 1) +# define RADEON_CRTC_CSYNC_EN (1 << 4) +# define RADEON_CRTC_ICON_EN (1 << 15) +# define RADEON_CRTC_CUR_EN (1 << 16) +# define RADEON_CRTC_CUR_MODE_MASK (7 << 20) +# define RADEON_CRTC_EXT_DISP_EN (1 << 24) +# define RADEON_CRTC_EN (1 << 25) +# define RADEON_CRTC_DISP_REQ_EN_B (1 << 26) +#define RADEON_CRTC2_GEN_CNTL 0x03f8 +# define RADEON_CRTC2_DBL_SCAN_EN (1 << 0) +# define RADEON_CRTC2_INTERLACE_EN (1 << 1) +# define RADEON_CRTC2_SYNC_TRISTAT (1 << 4) +# define RADEON_CRTC2_HSYNC_TRISTAT (1 << 5) +# define RADEON_CRTC2_VSYNC_TRISTAT (1 << 6) +# define RADEON_CRTC2_CRT2_ON (1 << 7) +# define RADEON_CRTC2_PIX_WIDTH_SHIFT 8 +# define RADEON_CRTC2_PIX_WIDTH_MASK (0xf << 8) +# define RADEON_CRTC2_ICON_EN (1 << 15) +# define RADEON_CRTC2_CUR_EN (1 << 16) +# define RADEON_CRTC2_CUR_MODE_MASK (7 << 20) +# define RADEON_CRTC2_DISP_DIS (1 << 23) +# define RADEON_CRTC2_EN (1 << 25) +# define RADEON_CRTC2_DISP_REQ_EN_B (1 << 26) +# define RADEON_CRTC2_CSYNC_EN (1 << 27) +# define RADEON_CRTC2_HSYNC_DIS (1 << 28) +# define RADEON_CRTC2_VSYNC_DIS (1 << 29) +#define RADEON_CRTC_MORE_CNTL 0x27c +# define RADEON_CRTC_AUTO_HORZ_CENTER_EN (1<<2) +# define RADEON_CRTC_AUTO_VERT_CENTER_EN (1<<3) +# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4) +# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5) +#define RADEON_CRTC_GUI_TRIG_VLINE 0x0218 +# define RADEON_CRTC_GUI_TRIG_VLINE_START_SHIFT 0 +# define RADEON_CRTC_GUI_TRIG_VLINE_INV (1 << 15) +# define RADEON_CRTC_GUI_TRIG_VLINE_END_SHIFT 16 +# define RADEON_CRTC_GUI_TRIG_VLINE_STALL (1 << 30) +#define RADEON_CRTC_H_SYNC_STRT_WID 0x0204 +# define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0) +# define RADEON_CRTC_H_SYNC_STRT_CHAR (0x3ff << 3) +# define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3 +# define RADEON_CRTC_H_SYNC_WID (0x3f << 16) +# define RADEON_CRTC_H_SYNC_WID_SHIFT 16 +# define RADEON_CRTC_H_SYNC_POL (1 << 23) +#define RADEON_CRTC2_H_SYNC_STRT_WID 0x0304 +# define RADEON_CRTC2_H_SYNC_STRT_PIX (0x07 << 0) +# define RADEON_CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3) +# define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3 +# define RADEON_CRTC2_H_SYNC_WID (0x3f << 16) +# define RADEON_CRTC2_H_SYNC_WID_SHIFT 16 +# define RADEON_CRTC2_H_SYNC_POL (1 << 23) +#define RADEON_CRTC_H_TOTAL_DISP 0x0200 +# define RADEON_CRTC_H_TOTAL (0x03ff << 0) +# define RADEON_CRTC_H_TOTAL_SHIFT 0 +# define RADEON_CRTC_H_DISP (0x01ff << 16) +# define RADEON_CRTC_H_DISP_SHIFT 16 +#define RADEON_CRTC2_H_TOTAL_DISP 0x0300 +# define RADEON_CRTC2_H_TOTAL (0x03ff << 0) +# define RADEON_CRTC2_H_TOTAL_SHIFT 0 +# define RADEON_CRTC2_H_DISP (0x01ff << 16) +# define RADEON_CRTC2_H_DISP_SHIFT 16 + +#define RADEON_CRTC_OFFSET_RIGHT 0x0220 +#define RADEON_CRTC_OFFSET 0x0224 +# define RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET (1<<30) +# define RADEON_CRTC_OFFSET__OFFSET_LOCK (1<<31) + +#define RADEON_CRTC2_OFFSET 0x0324 +# define RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET (1<<30) +# define RADEON_CRTC2_OFFSET__OFFSET_LOCK (1<<31) +#define RADEON_CRTC_OFFSET_CNTL 0x0228 +# define RADEON_CRTC_TILE_LINE_SHIFT 0 +# define RADEON_CRTC_TILE_LINE_RIGHT_SHIFT 4 +# define R300_CRTC_X_Y_MODE_EN_RIGHT (1 << 6) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_MASK (3 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_AUTO (0 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_SINGLE (1 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DOUBLE (2 << 7) +# define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DIS (3 << 7) +# define R300_CRTC_X_Y_MODE_EN (1 << 9) +# define R300_CRTC_MICRO_TILE_BUFFER_MASK (3 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_AUTO (0 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_SINGLE (1 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_DOUBLE (2 << 10) +# define R300_CRTC_MICRO_TILE_BUFFER_DIS (3 << 10) +# define R300_CRTC_MICRO_TILE_EN_RIGHT (1 << 12) +# define R300_CRTC_MICRO_TILE_EN (1 << 13) +# define R300_CRTC_MACRO_TILE_EN_RIGHT (1 << 14) +# define R300_CRTC_MACRO_TILE_EN (1 << 15) +# define RADEON_CRTC_TILE_EN_RIGHT (1 << 14) +# define RADEON_CRTC_TILE_EN (1 << 15) +# define RADEON_CRTC_OFFSET_FLIP_CNTL (1 << 16) +# define RADEON_CRTC_STEREO_OFFSET_EN (1 << 17) + +#define R300_CRTC_TILE_X0_Y0 0x0350 +#define R300_CRTC2_TILE_X0_Y0 0x0358 + +#define RADEON_CRTC2_OFFSET_CNTL 0x0328 +# define RADEON_CRTC2_OFFSET_FLIP_CNTL (1 << 16) +# define RADEON_CRTC2_TILE_EN (1 << 15) +#define RADEON_CRTC_PITCH 0x022c +# define RADEON_CRTC_PITCH__SHIFT 0 +# define RADEON_CRTC_PITCH__RIGHT_SHIFT 16 + +#define RADEON_CRTC2_PITCH 0x032c +#define RADEON_CRTC_STATUS 0x005c +# define RADEON_CRTC_VBLANK_SAVE (1 << 1) +# define RADEON_CRTC_VBLANK_SAVE_CLEAR (1 << 1) +#define RADEON_CRTC2_STATUS 0x03fc +# define RADEON_CRTC2_VBLANK_SAVE (1 << 1) +# define RADEON_CRTC2_VBLANK_SAVE_CLEAR (1 << 1) +#define RADEON_CRTC_V_SYNC_STRT_WID 0x020c +# define RADEON_CRTC_V_SYNC_STRT (0x7ff << 0) +# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0 +# define RADEON_CRTC_V_SYNC_WID (0x1f << 16) +# define RADEON_CRTC_V_SYNC_WID_SHIFT 16 +# define RADEON_CRTC_V_SYNC_POL (1 << 23) +#define RADEON_CRTC2_V_SYNC_STRT_WID 0x030c +# define RADEON_CRTC2_V_SYNC_STRT (0x7ff << 0) +# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0 +# define RADEON_CRTC2_V_SYNC_WID (0x1f << 16) +# define RADEON_CRTC2_V_SYNC_WID_SHIFT 16 +# define RADEON_CRTC2_V_SYNC_POL (1 << 23) +#define RADEON_CRTC_V_TOTAL_DISP 0x0208 +# define RADEON_CRTC_V_TOTAL (0x07ff << 0) +# define RADEON_CRTC_V_TOTAL_SHIFT 0 +# define RADEON_CRTC_V_DISP (0x07ff << 16) +# define RADEON_CRTC_V_DISP_SHIFT 16 +#define RADEON_CRTC2_V_TOTAL_DISP 0x0308 +# define RADEON_CRTC2_V_TOTAL (0x07ff << 0) +# define RADEON_CRTC2_V_TOTAL_SHIFT 0 +# define RADEON_CRTC2_V_DISP (0x07ff << 16) +# define RADEON_CRTC2_V_DISP_SHIFT 16 +#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210 +# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16) +#define RADEON_CRTC2_CRNT_FRAME 0x0314 +#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318 +#define RADEON_CRTC2_STATUS 0x03fc +#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310 +#define RADEON_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */ +#define RADEON_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */ +#define RADEON_CUR_CLR0 0x026c +#define RADEON_CUR_CLR1 0x0270 +#define RADEON_CUR_HORZ_VERT_OFF 0x0268 +#define RADEON_CUR_HORZ_VERT_POSN 0x0264 +#define RADEON_CUR_OFFSET 0x0260 +# define RADEON_CUR_LOCK (1 << 31) +#define RADEON_CUR2_CLR0 0x036c +#define RADEON_CUR2_CLR1 0x0370 +#define RADEON_CUR2_HORZ_VERT_OFF 0x0368 +#define RADEON_CUR2_HORZ_VERT_POSN 0x0364 +#define RADEON_CUR2_OFFSET 0x0360 +# define RADEON_CUR2_LOCK (1 << 31) + +#define RADEON_DAC_CNTL 0x0058 +# define RADEON_DAC_RANGE_CNTL (3 << 0) +# define RADEON_DAC_RANGE_CNTL_PS2 (2 << 0) +# define RADEON_DAC_RANGE_CNTL_MASK 0x03 +# define RADEON_DAC_BLANKING (1 << 2) +# define RADEON_DAC_CMP_EN (1 << 3) +# define RADEON_DAC_CMP_OUTPUT (1 << 7) +# define RADEON_DAC_8BIT_EN (1 << 8) +# define RADEON_DAC_TVO_EN (1 << 10) +# define RADEON_DAC_VGA_ADR_EN (1 << 13) +# define RADEON_DAC_PDWN (1 << 15) +# define RADEON_DAC_MASK_ALL (0xff << 24) +#define RADEON_DAC_CNTL2 0x007c +# define RADEON_DAC2_TV_CLK_SEL (0 << 1) +# define RADEON_DAC2_DAC_CLK_SEL (1 << 0) +# define RADEON_DAC2_DAC2_CLK_SEL (1 << 1) +# define RADEON_DAC2_PALETTE_ACC_CTL (1 << 5) +# define RADEON_DAC2_CMP_EN (1 << 7) +# define RADEON_DAC2_CMP_OUT_R (1 << 8) +# define RADEON_DAC2_CMP_OUT_G (1 << 9) +# define RADEON_DAC2_CMP_OUT_B (1 << 10) +# define RADEON_DAC2_CMP_OUTPUT (1 << 11) +#define RADEON_DAC_EXT_CNTL 0x0280 +# define RADEON_DAC2_FORCE_BLANK_OFF_EN (1 << 0) +# define RADEON_DAC2_FORCE_DATA_EN (1 << 1) +# define RADEON_DAC_FORCE_BLANK_OFF_EN (1 << 4) +# define RADEON_DAC_FORCE_DATA_EN (1 << 5) +# define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_R (0 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_G (1 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_B (2 << 6) +# define RADEON_DAC_FORCE_DATA_SEL_RGB (3 << 6) +# define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00 +# define RADEON_DAC_FORCE_DATA_SHIFT 8 +#define RADEON_DAC_MACRO_CNTL 0x0d04 +# define RADEON_DAC_PDWN_R (1 << 16) +# define RADEON_DAC_PDWN_G (1 << 17) +# define RADEON_DAC_PDWN_B (1 << 18) +#define RADEON_TV_DAC_CNTL 0x088c +# define RADEON_TV_DAC_NBLANK (1 << 0) +# define RADEON_TV_DAC_NHOLD (1 << 1) +# define RADEON_TV_DAC_PEDESTAL (1 << 2) +# define RADEON_TV_MONITOR_DETECT_EN (1 << 4) +# define RADEON_TV_DAC_CMPOUT (1 << 5) +# define RADEON_TV_DAC_STD_MASK (3 << 8) +# define RADEON_TV_DAC_STD_PAL (0 << 8) +# define RADEON_TV_DAC_STD_NTSC (1 << 8) +# define RADEON_TV_DAC_STD_PS2 (2 << 8) +# define RADEON_TV_DAC_STD_RS343 (3 << 8) +# define RADEON_TV_DAC_BGSLEEP (1 << 6) +# define RADEON_TV_DAC_BGADJ_MASK (0xf << 16) +# define RADEON_TV_DAC_BGADJ_SHIFT 16 +# define RADEON_TV_DAC_DACADJ_MASK (0xf << 20) +# define RADEON_TV_DAC_DACADJ_SHIFT 20 +# define RADEON_TV_DAC_RDACPD (1 << 24) +# define RADEON_TV_DAC_GDACPD (1 << 25) +# define RADEON_TV_DAC_BDACPD (1 << 26) +# define RADEON_TV_DAC_RDACDET (1 << 29) +# define RADEON_TV_DAC_GDACDET (1 << 30) +# define RADEON_TV_DAC_BDACDET (1 << 31) +# define R420_TV_DAC_DACADJ_MASK (0x1f << 20) +# define R420_TV_DAC_RDACPD (1 << 25) +# define R420_TV_DAC_GDACPD (1 << 26) +# define R420_TV_DAC_BDACPD (1 << 27) +# define R420_TV_DAC_TVENABLE (1 << 28) +#define RADEON_DISP_HW_DEBUG 0x0d14 +# define RADEON_CRT2_DISP1_SEL (1 << 5) +#define RADEON_DISP_OUTPUT_CNTL 0x0d64 +# define RADEON_DISP_DAC_SOURCE_MASK 0x03 +# define RADEON_DISP_DAC2_SOURCE_MASK 0x0c +# define RADEON_DISP_DAC_SOURCE_CRTC2 0x01 +# define RADEON_DISP_DAC_SOURCE_RMX 0x02 +# define RADEON_DISP_DAC_SOURCE_LTU 0x03 +# define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04 +# define RADEON_DISP_TVDAC_SOURCE_MASK (0x03 << 2) +# define RADEON_DISP_TVDAC_SOURCE_CRTC 0x0 +# define RADEON_DISP_TVDAC_SOURCE_CRTC2 (0x01 << 2) +# define RADEON_DISP_TVDAC_SOURCE_RMX (0x02 << 2) +# define RADEON_DISP_TVDAC_SOURCE_LTU (0x03 << 2) +# define RADEON_DISP_TRANS_MATRIX_MASK (0x03 << 4) +# define RADEON_DISP_TRANS_MATRIX_ALPHA_MSB (0x00 << 4) +# define RADEON_DISP_TRANS_MATRIX_GRAPHICS (0x01 << 4) +# define RADEON_DISP_TRANS_MATRIX_VIDEO (0x02 << 4) +# define RADEON_DISP_TV_SOURCE_CRTC (1 << 16) /* crtc1 or crtc2 */ +# define RADEON_DISP_TV_SOURCE_LTU (0 << 16) /* linear transform unit */ +#define RADEON_DISP_TV_OUT_CNTL 0x0d6c +# define RADEON_DISP_TV_PATH_SRC_CRTC2 (1 << 16) +# define RADEON_DISP_TV_PATH_SRC_CRTC1 (0 << 16) +#define RADEON_DAC_CRC_SIG 0x02cc +#define RADEON_DAC_DATA 0x03c9 /* VGA */ +#define RADEON_DAC_MASK 0x03c6 /* VGA */ +#define RADEON_DAC_R_INDEX 0x03c7 /* VGA */ +#define RADEON_DAC_W_INDEX 0x03c8 /* VGA */ +#define RADEON_DDA_CONFIG 0x02e0 +#define RADEON_DDA_ON_OFF 0x02e4 +#define RADEON_DEFAULT_OFFSET 0x16e0 +#define RADEON_DEFAULT_PITCH 0x16e4 +#define RADEON_DEFAULT_SC_BOTTOM_RIGHT 0x16e8 +# define RADEON_DEFAULT_SC_RIGHT_MAX (0x1fff << 0) +# define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16) +#define RADEON_DESTINATION_3D_CLR_CMP_VAL 0x1820 +#define RADEON_DESTINATION_3D_CLR_CMP_MSK 0x1824 +#define RADEON_DEVICE_ID 0x0f02 /* PCI */ +#define RADEON_DISP_MISC_CNTL 0x0d00 +# define RADEON_SOFT_RESET_GRPH_PP (1 << 0) +#define RADEON_DISP_MERGE_CNTL 0x0d60 +# define RADEON_DISP_ALPHA_MODE_MASK 0x03 +# define RADEON_DISP_ALPHA_MODE_KEY 0 +# define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1 +# define RADEON_DISP_ALPHA_MODE_GLOBAL 2 +# define RADEON_DISP_RGB_OFFSET_EN (1 << 8) +# define RADEON_DISP_GRPH_ALPHA_MASK (0xff << 16) +# define RADEON_DISP_OV0_ALPHA_MASK (0xff << 24) +# define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9) +#define RADEON_DISP2_MERGE_CNTL 0x0d68 +# define RADEON_DISP2_RGB_OFFSET_EN (1 << 8) +#define RADEON_DISP_LIN_TRANS_GRPH_A 0x0d80 +#define RADEON_DISP_LIN_TRANS_GRPH_B 0x0d84 +#define RADEON_DISP_LIN_TRANS_GRPH_C 0x0d88 +#define RADEON_DISP_LIN_TRANS_GRPH_D 0x0d8c +#define RADEON_DISP_LIN_TRANS_GRPH_E 0x0d90 +#define RADEON_DISP_LIN_TRANS_GRPH_F 0x0d98 +#define RADEON_DP_BRUSH_BKGD_CLR 0x1478 +#define RADEON_DP_BRUSH_FRGD_CLR 0x147c +#define RADEON_DP_CNTL 0x16c0 +# define RADEON_DST_X_LEFT_TO_RIGHT (1 << 0) +# define RADEON_DST_Y_TOP_TO_BOTTOM (1 << 1) +# define RADEON_DP_DST_TILE_LINEAR (0 << 3) +# define RADEON_DP_DST_TILE_MACRO (1 << 3) +# define RADEON_DP_DST_TILE_MICRO (2 << 3) +# define RADEON_DP_DST_TILE_BOTH (3 << 3) +#define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0 +# define RADEON_DST_Y_MAJOR (1 << 2) +# define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15) +# define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31) +#define RADEON_DP_DATATYPE 0x16c4 +# define RADEON_HOST_BIG_ENDIAN_EN (1 << 29) +#define RADEON_DP_GUI_MASTER_CNTL 0x146c +# define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0) +# define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1) +# define RADEON_GMC_SRC_CLIPPING (1 << 2) +# define RADEON_GMC_DST_CLIPPING (1 << 3) +# define RADEON_GMC_BRUSH_DATATYPE_MASK (0x0f << 4) +# define RADEON_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4) +# define RADEON_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4) +# define RADEON_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4) +# define RADEON_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4) +# define RADEON_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4) +# define RADEON_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4) +# define RADEON_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4) +# define RADEON_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4) +# define RADEON_GMC_BRUSH_8x8_COLOR (10 << 4) +# define RADEON_GMC_BRUSH_1X8_COLOR (12 << 4) +# define RADEON_GMC_BRUSH_SOLID_COLOR (13 << 4) +# define RADEON_GMC_BRUSH_NONE (15 << 4) +# define RADEON_GMC_DST_8BPP_CI (2 << 8) +# define RADEON_GMC_DST_15BPP (3 << 8) +# define RADEON_GMC_DST_16BPP (4 << 8) +# define RADEON_GMC_DST_24BPP (5 << 8) +# define RADEON_GMC_DST_32BPP (6 << 8) +# define RADEON_GMC_DST_8BPP_RGB (7 << 8) +# define RADEON_GMC_DST_Y8 (8 << 8) +# define RADEON_GMC_DST_RGB8 (9 << 8) +# define RADEON_GMC_DST_VYUY (11 << 8) +# define RADEON_GMC_DST_YVYU (12 << 8) +# define RADEON_GMC_DST_AYUV444 (14 << 8) +# define RADEON_GMC_DST_ARGB4444 (15 << 8) +# define RADEON_GMC_DST_DATATYPE_MASK (0x0f << 8) +# define RADEON_GMC_DST_DATATYPE_SHIFT 8 +# define RADEON_GMC_SRC_DATATYPE_MASK (3 << 12) +# define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12) +# define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12) +# define RADEON_GMC_SRC_DATATYPE_COLOR (3 << 12) +# define RADEON_GMC_BYTE_PIX_ORDER (1 << 14) +# define RADEON_GMC_BYTE_MSB_TO_LSB (0 << 14) +# define RADEON_GMC_BYTE_LSB_TO_MSB (1 << 14) +# define RADEON_GMC_CONVERSION_TEMP (1 << 15) +# define RADEON_GMC_CONVERSION_TEMP_6500 (0 << 15) +# define RADEON_GMC_CONVERSION_TEMP_9300 (1 << 15) +# define RADEON_GMC_ROP3_MASK (0xff << 16) +# define RADEON_DP_SRC_SOURCE_MASK (7 << 24) +# define RADEON_DP_SRC_SOURCE_MEMORY (2 << 24) +# define RADEON_DP_SRC_SOURCE_HOST_DATA (3 << 24) +# define RADEON_GMC_3D_FCN_EN (1 << 27) +# define RADEON_GMC_CLR_CMP_CNTL_DIS (1 << 28) +# define RADEON_GMC_AUX_CLIP_DIS (1 << 29) +# define RADEON_GMC_WR_MSK_DIS (1 << 30) +# define RADEON_GMC_LD_BRUSH_Y_X (1 << 31) +# define RADEON_ROP3_ZERO 0x00000000 +# define RADEON_ROP3_DSa 0x00880000 +# define RADEON_ROP3_SDna 0x00440000 +# define RADEON_ROP3_S 0x00cc0000 +# define RADEON_ROP3_DSna 0x00220000 +# define RADEON_ROP3_D 0x00aa0000 +# define RADEON_ROP3_DSx 0x00660000 +# define RADEON_ROP3_DSo 0x00ee0000 +# define RADEON_ROP3_DSon 0x00110000 +# define RADEON_ROP3_DSxn 0x00990000 +# define RADEON_ROP3_Dn 0x00550000 +# define RADEON_ROP3_SDno 0x00dd0000 +# define RADEON_ROP3_Sn 0x00330000 +# define RADEON_ROP3_DSno 0x00bb0000 +# define RADEON_ROP3_DSan 0x00770000 +# define RADEON_ROP3_ONE 0x00ff0000 +# define RADEON_ROP3_DPa 0x00a00000 +# define RADEON_ROP3_PDna 0x00500000 +# define RADEON_ROP3_P 0x00f00000 +# define RADEON_ROP3_DPna 0x000a0000 +# define RADEON_ROP3_D 0x00aa0000 +# define RADEON_ROP3_DPx 0x005a0000 +# define RADEON_ROP3_DPo 0x00fa0000 +# define RADEON_ROP3_DPon 0x00050000 +# define RADEON_ROP3_PDxn 0x00a50000 +# define RADEON_ROP3_PDno 0x00f50000 +# define RADEON_ROP3_Pn 0x000f0000 +# define RADEON_ROP3_DPno 0x00af0000 +# define RADEON_ROP3_DPan 0x005f0000 +#define RADEON_DP_GUI_MASTER_CNTL_C 0x1c84 +#define RADEON_DP_MIX 0x16c8 +#define RADEON_DP_SRC_BKGD_CLR 0x15dc +#define RADEON_DP_SRC_FRGD_CLR 0x15d8 +#define RADEON_DP_WRITE_MASK 0x16cc +#define RADEON_DST_BRES_DEC 0x1630 +#define RADEON_DST_BRES_ERR 0x1628 +#define RADEON_DST_BRES_INC 0x162c +#define RADEON_DST_BRES_LNTH 0x1634 +#define RADEON_DST_BRES_LNTH_SUB 0x1638 +#define RADEON_DST_HEIGHT 0x1410 +#define RADEON_DST_HEIGHT_WIDTH 0x143c +#define RADEON_DST_HEIGHT_WIDTH_8 0x158c +#define RADEON_DST_HEIGHT_WIDTH_BW 0x15b4 +#define RADEON_DST_HEIGHT_Y 0x15a0 +#define RADEON_DST_LINE_START 0x1600 +#define RADEON_DST_LINE_END 0x1604 +#define RADEON_DST_LINE_PATCOUNT 0x1608 +# define RADEON_BRES_CNTL_SHIFT 8 +#define RADEON_DST_OFFSET 0x1404 +#define RADEON_DST_PITCH 0x1408 +#define RADEON_DST_PITCH_OFFSET 0x142c +#define RADEON_DST_PITCH_OFFSET_C 0x1c80 +# define RADEON_PITCH_SHIFT 21 +# define RADEON_DST_TILE_LINEAR (0 << 30) +# define RADEON_DST_TILE_MACRO (1 << 30) +# define RADEON_DST_TILE_MICRO (2 << 30) +# define RADEON_DST_TILE_BOTH (3 << 30) +#define RADEON_DST_WIDTH 0x140c +#define RADEON_DST_WIDTH_HEIGHT 0x1598 +#define RADEON_DST_WIDTH_X 0x1588 +#define RADEON_DST_WIDTH_X_INCY 0x159c +#define RADEON_DST_X 0x141c +#define RADEON_DST_X_SUB 0x15a4 +#define RADEON_DST_X_Y 0x1594 +#define RADEON_DST_Y 0x1420 +#define RADEON_DST_Y_SUB 0x15a8 +#define RADEON_DST_Y_X 0x1438 + +#define RADEON_FCP_CNTL 0x0910 +# define RADEON_FCP0_SRC_PCICLK 0 +# define RADEON_FCP0_SRC_PCLK 1 +# define RADEON_FCP0_SRC_PCLKb 2 +# define RADEON_FCP0_SRC_HREF 3 +# define RADEON_FCP0_SRC_GND 4 +# define RADEON_FCP0_SRC_HREFb 5 +#define RADEON_FLUSH_1 0x1704 +#define RADEON_FLUSH_2 0x1708 +#define RADEON_FLUSH_3 0x170c +#define RADEON_FLUSH_4 0x1710 +#define RADEON_FLUSH_5 0x1714 +#define RADEON_FLUSH_6 0x1718 +#define RADEON_FLUSH_7 0x171c +#define RADEON_FOG_3D_TABLE_START 0x1810 +#define RADEON_FOG_3D_TABLE_END 0x1814 +#define RADEON_FOG_3D_TABLE_DENSITY 0x181c +#define RADEON_FOG_TABLE_INDEX 0x1a14 +#define RADEON_FOG_TABLE_DATA 0x1a18 +#define RADEON_FP_CRTC_H_TOTAL_DISP 0x0250 +#define RADEON_FP_CRTC_V_TOTAL_DISP 0x0254 +# define RADEON_FP_CRTC_H_TOTAL_MASK 0x000003ff +# define RADEON_FP_CRTC_H_DISP_MASK 0x01ff0000 +# define RADEON_FP_CRTC_V_TOTAL_MASK 0x00000fff +# define RADEON_FP_CRTC_V_DISP_MASK 0x0fff0000 +# define RADEON_FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8 +# define RADEON_FP_H_SYNC_WID_MASK 0x003f0000 +# define RADEON_FP_V_SYNC_STRT_MASK 0x00000fff +# define RADEON_FP_V_SYNC_WID_MASK 0x001f0000 +# define RADEON_FP_CRTC_H_TOTAL_SHIFT 0x00000000 +# define RADEON_FP_CRTC_H_DISP_SHIFT 0x00000010 +# define RADEON_FP_CRTC_V_TOTAL_SHIFT 0x00000000 +# define RADEON_FP_CRTC_V_DISP_SHIFT 0x00000010 +# define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003 +# define RADEON_FP_H_SYNC_WID_SHIFT 0x00000010 +# define RADEON_FP_V_SYNC_STRT_SHIFT 0x00000000 +# define RADEON_FP_V_SYNC_WID_SHIFT 0x00000010 +#define RADEON_FP_GEN_CNTL 0x0284 +# define RADEON_FP_FPON (1 << 0) +# define RADEON_FP_BLANK_EN (1 << 1) +# define RADEON_FP_TMDS_EN (1 << 2) +# define RADEON_FP_PANEL_FORMAT (1 << 3) +# define RADEON_FP_EN_TMDS (1 << 7) +# define RADEON_FP_DETECT_SENSE (1 << 8) +# define R200_FP_SOURCE_SEL_MASK (3 << 10) +# define R200_FP_SOURCE_SEL_CRTC1 (0 << 10) +# define R200_FP_SOURCE_SEL_CRTC2 (1 << 10) +# define R200_FP_SOURCE_SEL_RMX (2 << 10) +# define R200_FP_SOURCE_SEL_TRANS (3 << 10) +# define RADEON_FP_SEL_CRTC1 (0 << 13) +# define RADEON_FP_SEL_CRTC2 (1 << 13) +# define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15) +# define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16) +# define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17) +# define RADEON_FP_CRTC_USE_SHADOW_VEND (1 << 18) +# define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20) +# define RADEON_FP_DFP_SYNC_SEL (1 << 21) +# define RADEON_FP_CRTC_LOCK_8DOT (1 << 22) +# define RADEON_FP_CRT_SYNC_SEL (1 << 23) +# define RADEON_FP_USE_SHADOW_EN (1 << 24) +# define RADEON_FP_CRT_SYNC_ALT (1 << 26) +#define RADEON_FP2_GEN_CNTL 0x0288 +# define RADEON_FP2_BLANK_EN (1 << 1) +# define RADEON_FP2_ON (1 << 2) +# define RADEON_FP2_PANEL_FORMAT (1 << 3) +# define RADEON_FP2_DETECT_SENSE (1 << 8) +# define R200_FP2_SOURCE_SEL_MASK (3 << 10) +# define R200_FP2_SOURCE_SEL_CRTC1 (0 << 10) +# define R200_FP2_SOURCE_SEL_CRTC2 (1 << 10) +# define R200_FP2_SOURCE_SEL_RMX (2 << 10) +# define R200_FP2_SOURCE_SEL_TRANS_UNIT (3 << 10) +# define RADEON_FP2_SRC_SEL_MASK (3 << 13) +# define RADEON_FP2_SRC_SEL_CRTC2 (1 << 13) +# define RADEON_FP2_FP_POL (1 << 16) +# define RADEON_FP2_LP_POL (1 << 17) +# define RADEON_FP2_SCK_POL (1 << 18) +# define RADEON_FP2_LCD_CNTL_MASK (7 << 19) +# define RADEON_FP2_PAD_FLOP_EN (1 << 22) +# define RADEON_FP2_CRC_EN (1 << 23) +# define RADEON_FP2_CRC_READ_EN (1 << 24) +# define RADEON_FP2_DVO_EN (1 << 25) +# define RADEON_FP2_DVO_RATE_SEL_SDR (1 << 26) +# define R200_FP2_DVO_RATE_SEL_SDR (1 << 27) +# define R200_FP2_DVO_CLOCK_MODE_SINGLE (1 << 28) +# define R300_FP2_DVO_DUAL_CHANNEL_EN (1 << 29) +#define RADEON_FP_H_SYNC_STRT_WID 0x02c4 +#define RADEON_FP_H2_SYNC_STRT_WID 0x03c4 +#define RADEON_FP_HORZ_STRETCH 0x028c +#define RADEON_FP_HORZ2_STRETCH 0x038c +# define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff +# define RADEON_HORZ_STRETCH_RATIO_MAX 4096 +# define RADEON_HORZ_PANEL_SIZE (0x1ff << 16) +# define RADEON_HORZ_PANEL_SHIFT 16 +# define RADEON_HORZ_STRETCH_PIXREP (0 << 25) +# define RADEON_HORZ_STRETCH_BLEND (1 << 26) +# define RADEON_HORZ_STRETCH_ENABLE (1 << 25) +# define RADEON_HORZ_AUTO_RATIO (1 << 27) +# define RADEON_HORZ_FP_LOOP_STRETCH (0x7 << 28) +# define RADEON_HORZ_AUTO_RATIO_INC (1 << 31) +#define RADEON_FP_HORZ_VERT_ACTIVE 0x0278 +#define RADEON_FP_V_SYNC_STRT_WID 0x02c8 +#define RADEON_FP_VERT_STRETCH 0x0290 +#define RADEON_FP_V2_SYNC_STRT_WID 0x03c8 +#define RADEON_FP_VERT2_STRETCH 0x0390 +# define RADEON_VERT_PANEL_SIZE (0xfff << 12) +# define RADEON_VERT_PANEL_SHIFT 12 +# define RADEON_VERT_STRETCH_RATIO_MASK 0xfff +# define RADEON_VERT_STRETCH_RATIO_SHIFT 0 +# define RADEON_VERT_STRETCH_RATIO_MAX 4096 +# define RADEON_VERT_STRETCH_ENABLE (1 << 25) +# define RADEON_VERT_STRETCH_LINEREP (0 << 26) +# define RADEON_VERT_STRETCH_BLEND (1 << 26) +# define RADEON_VERT_AUTO_RATIO_EN (1 << 27) +# define RADEON_VERT_AUTO_RATIO_INC (1 << 31) +# define RADEON_VERT_STRETCH_RESERVED 0x71000000 +#define RS400_FP_2ND_GEN_CNTL 0x0384 +# define RS400_FP_2ND_ON (1 << 0) +# define RS400_FP_2ND_BLANK_EN (1 << 1) +# define RS400_TMDS_2ND_EN (1 << 2) +# define RS400_PANEL_FORMAT_2ND (1 << 3) +# define RS400_FP_2ND_EN_TMDS (1 << 7) +# define RS400_FP_2ND_DETECT_SENSE (1 << 8) +# define RS400_FP_2ND_SOURCE_SEL_MASK (3 << 10) +# define RS400_FP_2ND_SOURCE_SEL_CRTC1 (0 << 10) +# define RS400_FP_2ND_SOURCE_SEL_CRTC2 (1 << 10) +# define RS400_FP_2ND_SOURCE_SEL_RMX (2 << 10) +# define RS400_FP_2ND_DETECT_EN (1 << 12) +# define RS400_HPD_2ND_SEL (1 << 13) +#define RS400_FP2_2_GEN_CNTL 0x0388 +# define RS400_FP2_2_BLANK_EN (1 << 1) +# define RS400_FP2_2_ON (1 << 2) +# define RS400_FP2_2_PANEL_FORMAT (1 << 3) +# define RS400_FP2_2_DETECT_SENSE (1 << 8) +# define RS400_FP2_2_SOURCE_SEL_MASK (3 << 10) +# define RS400_FP2_2_SOURCE_SEL_CRTC1 (0 << 10) +# define RS400_FP2_2_SOURCE_SEL_CRTC2 (1 << 10) +# define RS400_FP2_2_SOURCE_SEL_RMX (2 << 10) +# define RS400_FP2_2_DVO2_EN (1 << 25) +#define RS400_TMDS2_CNTL 0x0394 +#define RS400_TMDS2_TRANSMITTER_CNTL 0x03a4 +# define RS400_TMDS2_PLLEN (1 << 0) +# define RS400_TMDS2_PLLRST (1 << 1) + +#define RADEON_GEN_INT_CNTL 0x0040 +#define RADEON_GEN_INT_STATUS 0x0044 +# define RADEON_VSYNC_INT_AK (1 << 2) +# define RADEON_VSYNC_INT (1 << 2) +# define RADEON_VSYNC2_INT_AK (1 << 6) +# define RADEON_VSYNC2_INT (1 << 6) +#define RADEON_GENENB 0x03c3 /* VGA */ +#define RADEON_GENFC_RD 0x03ca /* VGA */ +#define RADEON_GENFC_WT 0x03da /* VGA, 0x03ba */ +#define RADEON_GENMO_RD 0x03cc /* VGA */ +#define RADEON_GENMO_WT 0x03c2 /* VGA */ +#define RADEON_GENS0 0x03c2 /* VGA */ +#define RADEON_GENS1 0x03da /* VGA, 0x03ba */ +#define RADEON_GPIO_MONID 0x0068 /* DDC interface via I2C */ /* DDC3 */ +#define RADEON_GPIO_MONIDB 0x006c +#define RADEON_GPIO_CRT2_DDC 0x006c +#define RADEON_GPIO_DVI_DDC 0x0064 /* DDC2 */ +#define RADEON_GPIO_VGA_DDC 0x0060 /* DDC1 */ +# define RADEON_GPIO_A_0 (1 << 0) +# define RADEON_GPIO_A_1 (1 << 1) +# define RADEON_GPIO_Y_0 (1 << 8) +# define RADEON_GPIO_Y_1 (1 << 9) +# define RADEON_GPIO_Y_SHIFT_0 8 +# define RADEON_GPIO_Y_SHIFT_1 9 +# define RADEON_GPIO_EN_0 (1 << 16) +# define RADEON_GPIO_EN_1 (1 << 17) +# define RADEON_GPIO_MASK_0 (1 << 24) /*??*/ +# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/ +#define RADEON_GRPH8_DATA 0x03cf /* VGA */ +#define RADEON_GRPH8_IDX 0x03ce /* VGA */ +#define RADEON_GUI_SCRATCH_REG0 0x15e0 +#define RADEON_GUI_SCRATCH_REG1 0x15e4 +#define RADEON_GUI_SCRATCH_REG2 0x15e8 +#define RADEON_GUI_SCRATCH_REG3 0x15ec +#define RADEON_GUI_SCRATCH_REG4 0x15f0 +#define RADEON_GUI_SCRATCH_REG5 0x15f4 + +#define RADEON_HEADER 0x0f0e /* PCI */ +#define RADEON_HOST_DATA0 0x17c0 +#define RADEON_HOST_DATA1 0x17c4 +#define RADEON_HOST_DATA2 0x17c8 +#define RADEON_HOST_DATA3 0x17cc +#define RADEON_HOST_DATA4 0x17d0 +#define RADEON_HOST_DATA5 0x17d4 +#define RADEON_HOST_DATA6 0x17d8 +#define RADEON_HOST_DATA7 0x17dc +#define RADEON_HOST_DATA_LAST 0x17e0 +#define RADEON_HOST_PATH_CNTL 0x0130 +# define RADEON_HDP_SOFT_RESET (1 << 26) +# define RADEON_HDP_APER_CNTL (1 << 23) +#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */ +# define RADEON_HTOT_CNTL_VGA_EN (1 << 28) +#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */ + + /* Multimedia I2C bus */ +#define RADEON_I2C_CNTL_0 0x0090 +#define RADEON_I2C_DONE (1 << 0) +#define RADEON_I2C_NACK (1 << 1) +#define RADEON_I2C_HALT (1 << 2) +#define RADEON_I2C_SOFT_RST (1 << 5) +#define RADEON_I2C_DRIVE_EN (1 << 6) +#define RADEON_I2C_DRIVE_SEL (1 << 7) +#define RADEON_I2C_START (1 << 8) +#define RADEON_I2C_STOP (1 << 9) +#define RADEON_I2C_RECEIVE (1 << 10) +#define RADEON_I2C_ABORT (1 << 11) +#define RADEON_I2C_GO (1 << 12) +#define RADEON_I2C_CNTL_1 0x0094 +#define RADEON_I2C_SEL (1 << 16) +#define RADEON_I2C_EN (1 << 17) +#define RADEON_I2C_DATA 0x0098 + +#define RADEON_DVI_I2C_CNTL_0 0x02e0 +# define R200_DVI_I2C_PIN_SEL(x) ((x) << 3) +# define R200_SEL_DDC1 0 /* 0x60 - VGA_DDC */ +# define R200_SEL_DDC2 1 /* 0x64 - DVI_DDC */ +# define R200_SEL_DDC3 2 /* 0x68 - MONID_DDC */ +#define RADEON_DVI_I2C_CNTL_1 0x02e4 +#define RADEON_DVI_I2C_DATA 0x02e8 + +#define RADEON_INTERRUPT_LINE 0x0f3c /* PCI */ +#define RADEON_INTERRUPT_PIN 0x0f3d /* PCI */ +#define RADEON_IO_BASE 0x0f14 /* PCI */ + +#define RADEON_LATENCY 0x0f0d /* PCI */ +#define RADEON_LEAD_BRES_DEC 0x1608 +#define RADEON_LEAD_BRES_LNTH 0x161c +#define RADEON_LEAD_BRES_LNTH_SUB 0x1624 +#define RADEON_LVDS_GEN_CNTL 0x02d0 +# define RADEON_LVDS_ON (1 << 0) +# define RADEON_LVDS_DISPLAY_DIS (1 << 1) +# define RADEON_LVDS_PANEL_TYPE (1 << 2) +# define RADEON_LVDS_PANEL_FORMAT (1 << 3) +# define RADEON_LVDS_RST_FM (1 << 6) +# define RADEON_LVDS_EN (1 << 7) +# define RADEON_LVDS_BL_MOD_LEVEL_SHIFT 8 +# define RADEON_LVDS_BL_MOD_LEVEL_MASK (0xff << 8) +# define RADEON_LVDS_BL_MOD_EN (1 << 16) +# define RADEON_LVDS_DIGON (1 << 18) +# define RADEON_LVDS_BLON (1 << 19) +# define RADEON_LVDS_SEL_CRTC2 (1 << 23) +#define RADEON_LVDS_PLL_CNTL 0x02d4 +# define RADEON_HSYNC_DELAY_SHIFT 28 +# define RADEON_HSYNC_DELAY_MASK (0xf << 28) +# define RADEON_LVDS_PLL_EN (1 << 16) +# define RADEON_LVDS_PLL_RESET (1 << 17) +# define R300_LVDS_SRC_SEL_MASK (3 << 18) +# define R300_LVDS_SRC_SEL_CRTC1 (0 << 18) +# define R300_LVDS_SRC_SEL_CRTC2 (1 << 18) +# define R300_LVDS_SRC_SEL_RMX (2 << 18) + +#define RADEON_MAX_LATENCY 0x0f3f /* PCI */ +#define RADEON_MC_AGP_LOCATION 0x014c +#define RADEON_MC_FB_LOCATION 0x0148 +#define RADEON_DISPLAY_BASE_ADDR 0x23c +#define RADEON_DISPLAY2_BASE_ADDR 0x33c +#define RADEON_OV0_BASE_ADDR 0x43c +#define RADEON_NB_TOM 0x15c +#define R300_MC_INIT_MISC_LAT_TIMER 0x180 +# define R300_MC_DISP0R_INIT_LAT_SHIFT 8 +# define R300_MC_DISP0R_INIT_LAT_MASK 0xf +# define R300_MC_DISP1R_INIT_LAT_SHIFT 12 +# define R300_MC_DISP1R_INIT_LAT_MASK 0xf +#define RADEON_MCLK_CNTL 0x0012 /* PLL */ +# define RADEON_FORCEON_MCLKA (1 << 16) +# define RADEON_FORCEON_MCLKB (1 << 17) +# define RADEON_FORCEON_YCLKA (1 << 18) +# define RADEON_FORCEON_YCLKB (1 << 19) +# define RADEON_FORCEON_MC (1 << 20) +# define RADEON_FORCEON_AIC (1 << 21) +# define R300_DISABLE_MC_MCLKA (1 << 21) +# define R300_DISABLE_MC_MCLKB (1 << 21) +#define RADEON_MCLK_MISC 0x001f /* PLL */ +# define RADEON_MC_MCLK_MAX_DYN_STOP_LAT (1 << 12) +# define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1 << 13) +# define RADEON_MC_MCLK_DYN_ENABLE (1 << 14) +# define RADEON_IO_MCLK_DYN_ENABLE (1 << 15) +#define RADEON_LCD_GPIO_MASK 0x01a0 +#define RADEON_GPIOPAD_EN 0x01a0 +#define RADEON_LCD_GPIO_Y_REG 0x01a4 +#define RADEON_MDGPIO_A_REG 0x01ac +#define RADEON_MDGPIO_EN_REG 0x01b0 +#define RADEON_MDGPIO_MASK 0x0198 +#define RADEON_GPIOPAD_MASK 0x0198 +#define RADEON_GPIOPAD_A 0x019c +#define RADEON_MDGPIO_Y_REG 0x01b4 +#define RADEON_MEM_ADDR_CONFIG 0x0148 +#define RADEON_MEM_BASE 0x0f10 /* PCI */ +#define RADEON_MEM_CNTL 0x0140 +# define RADEON_MEM_NUM_CHANNELS_MASK 0x01 +# define RADEON_MEM_USE_B_CH_ONLY (1 << 1) +# define RV100_HALF_MODE (1 << 3) +# define R300_MEM_NUM_CHANNELS_MASK 0x03 +# define R300_MEM_USE_CD_CH_ONLY (1 << 2) +#define RADEON_MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */ +#define RADEON_MEM_INIT_LAT_TIMER 0x0154 +#define RADEON_MEM_INTF_CNTL 0x014c +#define RADEON_MEM_SDRAM_MODE_REG 0x0158 +# define RADEON_SDRAM_MODE_MASK 0xffff0000 +# define RADEON_B3MEM_RESET_MASK 0x6fffffff +# define RADEON_MEM_CFG_TYPE_DDR (1 << 30) +#define RADEON_MEM_STR_CNTL 0x0150 +# define RADEON_MEM_PWRUP_COMPL_A (1 << 0) +# define RADEON_MEM_PWRUP_COMPL_B (1 << 1) +# define R300_MEM_PWRUP_COMPL_C (1 << 2) +# define R300_MEM_PWRUP_COMPL_D (1 << 3) +# define RADEON_MEM_PWRUP_COMPLETE 0x03 +# define R300_MEM_PWRUP_COMPLETE 0x0f +#define RADEON_MC_STATUS 0x0150 +# define RADEON_MC_IDLE (1 << 2) +# define R300_MC_IDLE (1 << 4) +#define RADEON_MEM_VGA_RP_SEL 0x003c +#define RADEON_MEM_VGA_WP_SEL 0x0038 +#define RADEON_MIN_GRANT 0x0f3e /* PCI */ +#define RADEON_MM_DATA 0x0004 +#define RADEON_MM_INDEX 0x0000 +#define RADEON_MPLL_CNTL 0x000e /* PLL */ +#define RADEON_MPP_TB_CONFIG 0x01c0 /* ? */ +#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */ +#define RADEON_SEPROM_CNTL1 0x01c0 +# define RADEON_SCK_PRESCALE_SHIFT 24 +# define RADEON_SCK_PRESCALE_MASK (0xff << 24) +#define R300_MC_IND_INDEX 0x01f8 +# define R300_MC_IND_ADDR_MASK 0x3f +# define R300_MC_IND_WR_EN (1 << 8) +#define R300_MC_IND_DATA 0x01fc +#define R300_MC_READ_CNTL_AB 0x017c +# define R300_MEM_RBS_POSITION_A_MASK 0x03 +#define R300_MC_READ_CNTL_CD_mcind 0x24 +# define R300_MEM_RBS_POSITION_C_MASK 0x03 + +#define RADEON_N_VIF_COUNT 0x0248 + +#define RADEON_OV0_AUTO_FLIP_CNTL 0x0470 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM 0x00000007 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD 0x00000008 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD 0x00000010 +# define RADEON_OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020 +# define RADEON_OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE 0x00000040 +# define RADEON_OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT 0x00000300 +# define RADEON_OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN 0x00010000 +# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN 0x00040000 +# define RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN 0x00080000 +# define RADEON_OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE 0x00800000 + +#define RADEON_OV0_COLOUR_CNTL 0x04E0 +#define RADEON_OV0_DEINTERLACE_PATTERN 0x0474 +#define RADEON_OV0_EXCLUSIVE_HORZ 0x0408 +# define RADEON_EXCL_HORZ_START_MASK 0x000000ff +# define RADEON_EXCL_HORZ_END_MASK 0x0000ff00 +# define RADEON_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000 +# define RADEON_EXCL_HORZ_EXCLUSIVE_EN 0x80000000 +#define RADEON_OV0_EXCLUSIVE_VERT 0x040C +# define RADEON_EXCL_VERT_START_MASK 0x000003ff +# define RADEON_EXCL_VERT_END_MASK 0x03ff0000 +#define RADEON_OV0_FILTER_CNTL 0x04A0 +# define RADEON_FILTER_PROGRAMMABLE_COEF 0x0 +# define RADEON_FILTER_HC_COEF_HORZ_Y 0x1 +# define RADEON_FILTER_HC_COEF_HORZ_UV 0x2 +# define RADEON_FILTER_HC_COEF_VERT_Y 0x4 +# define RADEON_FILTER_HC_COEF_VERT_UV 0x8 +# define RADEON_FILTER_HARDCODED_COEF 0xf +# define RADEON_FILTER_COEF_MASK 0xf + +#define RADEON_OV0_FOUR_TAP_COEF_0 0x04B0 +#define RADEON_OV0_FOUR_TAP_COEF_1 0x04B4 +#define RADEON_OV0_FOUR_TAP_COEF_2 0x04B8 +#define RADEON_OV0_FOUR_TAP_COEF_3 0x04BC +#define RADEON_OV0_FOUR_TAP_COEF_4 0x04C0 +#define RADEON_OV0_FLAG_CNTL 0x04DC +#define RADEON_OV0_GAMMA_000_00F 0x0d40 +#define RADEON_OV0_GAMMA_010_01F 0x0d44 +#define RADEON_OV0_GAMMA_020_03F 0x0d48 +#define RADEON_OV0_GAMMA_040_07F 0x0d4c +#define RADEON_OV0_GAMMA_080_0BF 0x0e00 +#define RADEON_OV0_GAMMA_0C0_0FF 0x0e04 +#define RADEON_OV0_GAMMA_100_13F 0x0e08 +#define RADEON_OV0_GAMMA_140_17F 0x0e0c +#define RADEON_OV0_GAMMA_180_1BF 0x0e10 +#define RADEON_OV0_GAMMA_1C0_1FF 0x0e14 +#define RADEON_OV0_GAMMA_200_23F 0x0e18 +#define RADEON_OV0_GAMMA_240_27F 0x0e1c +#define RADEON_OV0_GAMMA_280_2BF 0x0e20 +#define RADEON_OV0_GAMMA_2C0_2FF 0x0e24 +#define RADEON_OV0_GAMMA_300_33F 0x0e28 +#define RADEON_OV0_GAMMA_340_37F 0x0e2c +#define RADEON_OV0_GAMMA_380_3BF 0x0d50 +#define RADEON_OV0_GAMMA_3C0_3FF 0x0d54 +#define RADEON_OV0_GRAPHICS_KEY_CLR_LOW 0x04EC +#define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH 0x04F0 +#define RADEON_OV0_H_INC 0x0480 +#define RADEON_OV0_KEY_CNTL 0x04F4 +# define RADEON_VIDEO_KEY_FN_MASK 0x00000003L +# define RADEON_VIDEO_KEY_FN_FALSE 0x00000000L +# define RADEON_VIDEO_KEY_FN_TRUE 0x00000001L +# define RADEON_VIDEO_KEY_FN_EQ 0x00000002L +# define RADEON_VIDEO_KEY_FN_NE 0x00000003L +# define RADEON_GRAPHIC_KEY_FN_MASK 0x00000030L +# define RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L +# define RADEON_GRAPHIC_KEY_FN_TRUE 0x00000010L +# define RADEON_GRAPHIC_KEY_FN_EQ 0x00000020L +# define RADEON_GRAPHIC_KEY_FN_NE 0x00000030L +# define RADEON_CMP_MIX_MASK 0x00000100L +# define RADEON_CMP_MIX_OR 0x00000000L +# define RADEON_CMP_MIX_AND 0x00000100L +#define RADEON_OV0_LIN_TRANS_A 0x0d20 +#define RADEON_OV0_LIN_TRANS_B 0x0d24 +#define RADEON_OV0_LIN_TRANS_C 0x0d28 +#define RADEON_OV0_LIN_TRANS_D 0x0d2c +#define RADEON_OV0_LIN_TRANS_E 0x0d30 +#define RADEON_OV0_LIN_TRANS_F 0x0d34 +#define RADEON_OV0_P1_BLANK_LINES_AT_TOP 0x0430 +# define RADEON_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL +# define RADEON_P1_ACTIVE_LINES_M1 0x0fff0000L +#define RADEON_OV0_P1_H_ACCUM_INIT 0x0488 +#define RADEON_OV0_P1_V_ACCUM_INIT 0x0428 +# define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L +# define RADEON_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L +#define RADEON_OV0_P1_X_START_END 0x0494 +#define RADEON_OV0_P2_X_START_END 0x0498 +#define RADEON_OV0_P23_BLANK_LINES_AT_TOP 0x0434 +# define RADEON_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL +# define RADEON_P23_ACTIVE_LINES_M1 0x07ff0000L +#define RADEON_OV0_P23_H_ACCUM_INIT 0x048C +#define RADEON_OV0_P23_V_ACCUM_INIT 0x042C +#define RADEON_OV0_P3_X_START_END 0x049C +#define RADEON_OV0_REG_LOAD_CNTL 0x0410 +# define RADEON_REG_LD_CTL_LOCK 0x00000001L +# define RADEON_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L +# define RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L +# define RADEON_REG_LD_CTL_LOCK_READBACK 0x00000008L +# define RADEON_REG_LD_CTL_FLIP_READBACK 0x00000010L +#define RADEON_OV0_SCALE_CNTL 0x0420 +# define RADEON_SCALER_HORZ_PICK_NEAREST 0x00000004L +# define RADEON_SCALER_VERT_PICK_NEAREST 0x00000008L +# define RADEON_SCALER_SIGNED_UV 0x00000010L +# define RADEON_SCALER_GAMMA_SEL_MASK 0x00000060L +# define RADEON_SCALER_GAMMA_SEL_BRIGHT 0x00000000L +# define RADEON_SCALER_GAMMA_SEL_G22 0x00000020L +# define RADEON_SCALER_GAMMA_SEL_G18 0x00000040L +# define RADEON_SCALER_GAMMA_SEL_G14 0x00000060L +# define RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L +# define RADEON_SCALER_SURFAC_FORMAT 0x00000f00L +# define RADEON_SCALER_SOURCE_15BPP 0x00000300L +# define RADEON_SCALER_SOURCE_16BPP 0x00000400L +# define RADEON_SCALER_SOURCE_32BPP 0x00000600L +# define RADEON_SCALER_SOURCE_YUV9 0x00000900L +# define RADEON_SCALER_SOURCE_YUV12 0x00000A00L +# define RADEON_SCALER_SOURCE_VYUY422 0x00000B00L +# define RADEON_SCALER_SOURCE_YVYU422 0x00000C00L +# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L +# define RADEON_SCALER_TEMPORAL_DEINT 0x00002000L +# define RADEON_SCALER_CRTC_SEL 0x00004000L +# define RADEON_SCALER_SMART_SWITCH 0x00008000L +# define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L +# define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L +# define RADEON_SCALER_DIS_LIMIT 0x08000000L +# define RADEON_SCALER_LIN_TRANS_BYPASS 0x10000000L +# define RADEON_SCALER_INT_EMU 0x20000000L +# define RADEON_SCALER_ENABLE 0x40000000L +# define RADEON_SCALER_SOFT_RESET 0x80000000L +#define RADEON_OV0_STEP_BY 0x0484 +#define RADEON_OV0_TEST 0x04F8 +#define RADEON_OV0_V_INC 0x0424 +#define RADEON_OV0_VID_BUF_PITCH0_VALUE 0x0460 +#define RADEON_OV0_VID_BUF_PITCH1_VALUE 0x0464 +#define RADEON_OV0_VID_BUF0_BASE_ADRS 0x0440 +# define RADEON_VIF_BUF0_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF0_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF1_BASE_ADRS 0x0444 +# define RADEON_VIF_BUF1_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF1_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF2_BASE_ADRS 0x0448 +# define RADEON_VIF_BUF2_PITCH_SEL 0x00000001L +# define RADEON_VIF_BUF2_TILE_ADRS 0x00000002L +# define RADEON_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L +# define RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L +#define RADEON_OV0_VID_BUF3_BASE_ADRS 0x044C +#define RADEON_OV0_VID_BUF4_BASE_ADRS 0x0450 +#define RADEON_OV0_VID_BUF5_BASE_ADRS 0x0454 +#define RADEON_OV0_VIDEO_KEY_CLR_HIGH 0x04E8 +#define RADEON_OV0_VIDEO_KEY_CLR_LOW 0x04E4 +#define RADEON_OV0_Y_X_START 0x0400 +#define RADEON_OV0_Y_X_END 0x0404 +#define RADEON_OV1_Y_X_START 0x0600 +#define RADEON_OV1_Y_X_END 0x0604 +#define RADEON_OVR_CLR 0x0230 +#define RADEON_OVR_WID_LEFT_RIGHT 0x0234 +#define RADEON_OVR_WID_TOP_BOTTOM 0x0238 + +/* first capture unit */ + +#define RADEON_CAP0_BUF0_OFFSET 0x0920 +#define RADEON_CAP0_BUF1_OFFSET 0x0924 +#define RADEON_CAP0_BUF0_EVEN_OFFSET 0x0928 +#define RADEON_CAP0_BUF1_EVEN_OFFSET 0x092C + +#define RADEON_CAP0_BUF_PITCH 0x0930 +#define RADEON_CAP0_V_WINDOW 0x0934 +#define RADEON_CAP0_H_WINDOW 0x0938 +#define RADEON_CAP0_VBI0_OFFSET 0x093C +#define RADEON_CAP0_VBI1_OFFSET 0x0940 +#define RADEON_CAP0_VBI_V_WINDOW 0x0944 +#define RADEON_CAP0_VBI_H_WINDOW 0x0948 +#define RADEON_CAP0_PORT_MODE_CNTL 0x094C +#define RADEON_CAP0_TRIG_CNTL 0x0950 +#define RADEON_CAP0_DEBUG 0x0954 +#define RADEON_CAP0_CONFIG 0x0958 +# define RADEON_CAP0_CONFIG_CONTINUOS 0x00000001 +# define RADEON_CAP0_CONFIG_START_FIELD_EVEN 0x00000002 +# define RADEON_CAP0_CONFIG_START_BUF_GET 0x00000004 +# define RADEON_CAP0_CONFIG_START_BUF_SET 0x00000008 +# define RADEON_CAP0_CONFIG_BUF_TYPE_ALT 0x00000010 +# define RADEON_CAP0_CONFIG_BUF_TYPE_FRAME 0x00000020 +# define RADEON_CAP0_CONFIG_ONESHOT_MODE_FRAME 0x00000040 +# define RADEON_CAP0_CONFIG_BUF_MODE_DOUBLE 0x00000080 +# define RADEON_CAP0_CONFIG_BUF_MODE_TRIPLE 0x00000100 +# define RADEON_CAP0_CONFIG_MIRROR_EN 0x00000200 +# define RADEON_CAP0_CONFIG_ONESHOT_MIRROR_EN 0x00000400 +# define RADEON_CAP0_CONFIG_VIDEO_SIGNED_UV 0x00000800 +# define RADEON_CAP0_CONFIG_ANC_DECODE_EN 0x00001000 +# define RADEON_CAP0_CONFIG_VBI_EN 0x00002000 +# define RADEON_CAP0_CONFIG_SOFT_PULL_DOWN_EN 0x00004000 +# define RADEON_CAP0_CONFIG_VIP_EXTEND_FLAG_EN 0x00008000 +# define RADEON_CAP0_CONFIG_FAKE_FIELD_EN 0x00010000 +# define RADEON_CAP0_CONFIG_ODD_ONE_MORE_LINE 0x00020000 +# define RADEON_CAP0_CONFIG_EVEN_ONE_MORE_LINE 0x00040000 +# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_2 0x00080000 +# define RADEON_CAP0_CONFIG_HORZ_DIVIDE_4 0x00100000 +# define RADEON_CAP0_CONFIG_VERT_DIVIDE_2 0x00200000 +# define RADEON_CAP0_CONFIG_VERT_DIVIDE_4 0x00400000 +# define RADEON_CAP0_CONFIG_FORMAT_BROOKTREE 0x00000000 +# define RADEON_CAP0_CONFIG_FORMAT_CCIR656 0x00800000 +# define RADEON_CAP0_CONFIG_FORMAT_ZV 0x01000000 +# define RADEON_CAP0_CONFIG_FORMAT_VIP 0x01800000 +# define RADEON_CAP0_CONFIG_FORMAT_TRANSPORT 0x02000000 +# define RADEON_CAP0_CONFIG_HORZ_DECIMATOR 0x04000000 +# define RADEON_CAP0_CONFIG_VIDEO_IN_YVYU422 0x00000000 +# define RADEON_CAP0_CONFIG_VIDEO_IN_VYUY422 0x20000000 +# define RADEON_CAP0_CONFIG_VBI_DIVIDE_2 0x40000000 +# define RADEON_CAP0_CONFIG_VBI_DIVIDE_4 0x80000000 +#define RADEON_CAP0_ANC_ODD_OFFSET 0x095C +#define RADEON_CAP0_ANC_EVEN_OFFSET 0x0960 +#define RADEON_CAP0_ANC_H_WINDOW 0x0964 +#define RADEON_CAP0_VIDEO_SYNC_TEST 0x0968 +#define RADEON_CAP0_ONESHOT_BUF_OFFSET 0x096C +#define RADEON_CAP0_BUF_STATUS 0x0970 +/* #define RADEON_CAP0_DWNSC_XRATIO 0x0978 */ +/* #define RADEON_CAP0_XSHARPNESS 0x097C */ +#define RADEON_CAP0_VBI2_OFFSET 0x0980 +#define RADEON_CAP0_VBI3_OFFSET 0x0984 +#define RADEON_CAP0_ANC2_OFFSET 0x0988 +#define RADEON_CAP0_ANC3_OFFSET 0x098C +#define RADEON_VID_BUFFER_CONTROL 0x0900 + +/* second capture unit */ + +#define RADEON_CAP1_BUF0_OFFSET 0x0990 +#define RADEON_CAP1_BUF1_OFFSET 0x0994 +#define RADEON_CAP1_BUF0_EVEN_OFFSET 0x0998 +#define RADEON_CAP1_BUF1_EVEN_OFFSET 0x099C + +#define RADEON_CAP1_BUF_PITCH 0x09A0 +#define RADEON_CAP1_V_WINDOW 0x09A4 +#define RADEON_CAP1_H_WINDOW 0x09A8 +#define RADEON_CAP1_VBI_ODD_OFFSET 0x09AC +#define RADEON_CAP1_VBI_EVEN_OFFSET 0x09B0 +#define RADEON_CAP1_VBI_V_WINDOW 0x09B4 +#define RADEON_CAP1_VBI_H_WINDOW 0x09B8 +#define RADEON_CAP1_PORT_MODE_CNTL 0x09BC +#define RADEON_CAP1_TRIG_CNTL 0x09C0 +#define RADEON_CAP1_DEBUG 0x09C4 +#define RADEON_CAP1_CONFIG 0x09C8 +#define RADEON_CAP1_ANC_ODD_OFFSET 0x09CC +#define RADEON_CAP1_ANC_EVEN_OFFSET 0x09D0 +#define RADEON_CAP1_ANC_H_WINDOW 0x09D4 +#define RADEON_CAP1_VIDEO_SYNC_TEST 0x09D8 +#define RADEON_CAP1_ONESHOT_BUF_OFFSET 0x09DC +#define RADEON_CAP1_BUF_STATUS 0x09E0 +#define RADEON_CAP1_DWNSC_XRATIO 0x09E8 +#define RADEON_CAP1_XSHARPNESS 0x09EC + +/* misc multimedia registers */ + +#define RADEON_IDCT_RUNS 0x1F80 +#define RADEON_IDCT_LEVELS 0x1F84 +#define RADEON_IDCT_CONTROL 0x1FBC +#define RADEON_IDCT_AUTH_CONTROL 0x1F88 +#define RADEON_IDCT_AUTH 0x1F8C + +#define RADEON_P2PLL_CNTL 0x002a /* P2PLL */ +# define RADEON_P2PLL_RESET (1 << 0) +# define RADEON_P2PLL_SLEEP (1 << 1) +# define RADEON_P2PLL_PVG_MASK (7 << 11) +# define RADEON_P2PLL_PVG_SHIFT 11 +# define RADEON_P2PLL_ATOMIC_UPDATE_EN (1 << 16) +# define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17) +# define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18) +#define RADEON_P2PLL_DIV_0 0x002c +# define RADEON_P2PLL_FB0_DIV_MASK 0x07ff +# define RADEON_P2PLL_POST0_DIV_MASK 0x00070000 +#define RADEON_P2PLL_REF_DIV 0x002B /* PLL */ +# define RADEON_P2PLL_REF_DIV_MASK 0x03ff +# define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ +# define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ +# define R300_PPLL_REF_DIV_ACC_MASK (0x3ff << 18) +# define R300_PPLL_REF_DIV_ACC_SHIFT 18 +#define RADEON_PALETTE_DATA 0x00b4 +#define RADEON_PALETTE_30_DATA 0x00b8 +#define RADEON_PALETTE_INDEX 0x00b0 +#define RADEON_PCI_GART_PAGE 0x017c +#define RADEON_PIXCLKS_CNTL 0x002d +# define RADEON_PIX2CLK_SRC_SEL_MASK 0x03 +# define RADEON_PIX2CLK_SRC_SEL_CPUCLK 0x00 +# define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01 +# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03 +# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6) +# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7) +# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8) +# define RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9) +# define R300_DVOCLK_ALWAYS_ONb (1 << 10) +# define RADEON_PIXCLK_BLEND_ALWAYS_ONb (1 << 11) +# define RADEON_PIXCLK_GV_ALWAYS_ONb (1 << 12) +# define RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13) +# define R300_PIXCLK_DVO_ALWAYS_ONb (1 << 13) +# define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) +# define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15) +# define R300_PIXCLK_TRANS_ALWAYS_ONb (1 << 16) +# define R300_PIXCLK_TVO_ALWAYS_ONb (1 << 17) +# define R300_P2G2CLK_ALWAYS_ONb (1 << 18) +# define R300_P2G2CLK_DAC_ALWAYS_ONb (1 << 19) +# define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23) +#define RADEON_PLANE_3D_MASK_C 0x1d44 +#define RADEON_PLL_TEST_CNTL 0x0013 /* PLL */ +# define RADEON_PLL_MASK_READ_B (1 << 9) +#define RADEON_PMI_CAP_ID 0x0f5c /* PCI */ +#define RADEON_PMI_DATA 0x0f63 /* PCI */ +#define RADEON_PMI_NXT_CAP_PTR 0x0f5d /* PCI */ +#define RADEON_PMI_PMC_REG 0x0f5e /* PCI */ +#define RADEON_PMI_PMCSR_REG 0x0f60 /* PCI */ +#define RADEON_PMI_REGISTER 0x0f5c /* PCI */ +#define RADEON_PPLL_CNTL 0x0002 /* PLL */ +# define RADEON_PPLL_RESET (1 << 0) +# define RADEON_PPLL_SLEEP (1 << 1) +# define RADEON_PPLL_PVG_MASK (7 << 11) +# define RADEON_PPLL_PVG_SHIFT 11 +# define RADEON_PPLL_ATOMIC_UPDATE_EN (1 << 16) +# define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17) +# define RADEON_PPLL_ATOMIC_UPDATE_VSYNC (1 << 18) +#define RADEON_PPLL_DIV_0 0x0004 /* PLL */ +#define RADEON_PPLL_DIV_1 0x0005 /* PLL */ +#define RADEON_PPLL_DIV_2 0x0006 /* PLL */ +#define RADEON_PPLL_DIV_3 0x0007 /* PLL */ +# define RADEON_PPLL_FB3_DIV_MASK 0x07ff +# define RADEON_PPLL_POST3_DIV_MASK 0x00070000 +#define RADEON_PPLL_REF_DIV 0x0003 /* PLL */ +# define RADEON_PPLL_REF_DIV_MASK 0x03ff +# define RADEON_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */ +# define RADEON_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */ +#define RADEON_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */ + +#define RADEON_RBBM_GUICNTL 0x172c +# define RADEON_HOST_DATA_SWAP_NONE (0 << 0) +# define RADEON_HOST_DATA_SWAP_16BIT (1 << 0) +# define RADEON_HOST_DATA_SWAP_32BIT (2 << 0) +# define RADEON_HOST_DATA_SWAP_HDW (3 << 0) +#define RADEON_RBBM_SOFT_RESET 0x00f0 +# define RADEON_SOFT_RESET_CP (1 << 0) +# define RADEON_SOFT_RESET_HI (1 << 1) +# define RADEON_SOFT_RESET_SE (1 << 2) +# define RADEON_SOFT_RESET_RE (1 << 3) +# define RADEON_SOFT_RESET_PP (1 << 4) +# define RADEON_SOFT_RESET_E2 (1 << 5) +# define RADEON_SOFT_RESET_RB (1 << 6) +# define RADEON_SOFT_RESET_HDP (1 << 7) +#define RADEON_RBBM_STATUS 0x0e40 +# define RADEON_RBBM_FIFOCNT_MASK 0x007f +# define RADEON_RBBM_ACTIVE (1 << 31) +#define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c +# define RADEON_RB2D_DC_FLUSH (3 << 0) +# define RADEON_RB2D_DC_FREE (3 << 2) +# define RADEON_RB2D_DC_FLUSH_ALL 0xf +# define RADEON_RB2D_DC_BUSY (1 << 31) +#define RADEON_RB2D_DSTCACHE_MODE 0x3428 +#define RADEON_DSTCACHE_CTLSTAT 0x1714 + +#define RADEON_RB3D_ZCACHE_MODE 0x3250 +#define RADEON_RB3D_ZCACHE_CTLSTAT 0x3254 +# define RADEON_RB3D_ZC_FLUSH_ALL 0x5 +#define RADEON_RB3D_DSTCACHE_MODE 0x3258 +# define RADEON_RB3D_DC_CACHE_ENABLE (0) +# define RADEON_RB3D_DC_2D_CACHE_DISABLE (1) +# define RADEON_RB3D_DC_3D_CACHE_DISABLE (2) +# define RADEON_RB3D_DC_CACHE_DISABLE (3) +# define RADEON_RB3D_DC_2D_CACHE_LINESIZE_128 (1 << 2) +# define RADEON_RB3D_DC_3D_CACHE_LINESIZE_128 (2 << 2) +# define RADEON_RB3D_DC_2D_CACHE_AUTOFLUSH (1 << 8) +# define RADEON_RB3D_DC_3D_CACHE_AUTOFLUSH (2 << 8) +# define R200_RB3D_DC_2D_CACHE_AUTOFREE (1 << 10) +# define R200_RB3D_DC_3D_CACHE_AUTOFREE (2 << 10) +# define RADEON_RB3D_DC_FORCE_RMW (1 << 16) +# define RADEON_RB3D_DC_DISABLE_RI_FILL (1 << 24) +# define RADEON_RB3D_DC_DISABLE_RI_READ (1 << 25) + +#define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325C +# define RADEON_RB3D_DC_FLUSH (3 << 0) +# define RADEON_RB3D_DC_FREE (3 << 2) +# define RADEON_RB3D_DC_FLUSH_ALL 0xf +# define RADEON_RB3D_DC_BUSY (1 << 31) + +#define RADEON_REG_BASE 0x0f18 /* PCI */ +#define RADEON_REGPROG_INF 0x0f09 /* PCI */ +#define RADEON_REVISION_ID 0x0f08 /* PCI */ + +#define RADEON_SC_BOTTOM 0x164c +#define RADEON_SC_BOTTOM_RIGHT 0x16f0 +#define RADEON_SC_BOTTOM_RIGHT_C 0x1c8c +#define RADEON_SC_LEFT 0x1640 +#define RADEON_SC_RIGHT 0x1644 +#define RADEON_SC_TOP 0x1648 +#define RADEON_SC_TOP_LEFT 0x16ec +#define RADEON_SC_TOP_LEFT_C 0x1c88 +# define RADEON_SC_SIGN_MASK_LO 0x8000 +# define RADEON_SC_SIGN_MASK_HI 0x80000000 +#define RADEON_SCLK_CNTL 0x000d /* PLL */ +# define RADEON_SCLK_SRC_SEL_MASK 0x0007 +# define RADEON_DYN_STOP_LAT_MASK 0x00007ff8 +# define RADEON_CP_MAX_DYN_STOP_LAT 0x0008 +# define RADEON_SCLK_FORCEON_MASK 0xffff8000 +# define RADEON_SCLK_FORCE_DISP2 (1<<15) +# define RADEON_SCLK_FORCE_CP (1<<16) +# define RADEON_SCLK_FORCE_HDP (1<<17) +# define RADEON_SCLK_FORCE_DISP1 (1<<18) +# define RADEON_SCLK_FORCE_TOP (1<<19) +# define RADEON_SCLK_FORCE_E2 (1<<20) +# define RADEON_SCLK_FORCE_SE (1<<21) +# define RADEON_SCLK_FORCE_IDCT (1<<22) +# define RADEON_SCLK_FORCE_VIP (1<<23) +# define RADEON_SCLK_FORCE_RE (1<<24) +# define RADEON_SCLK_FORCE_PB (1<<25) +# define RADEON_SCLK_FORCE_TAM (1<<26) +# define RADEON_SCLK_FORCE_TDM (1<<27) +# define RADEON_SCLK_FORCE_RB (1<<28) +# define RADEON_SCLK_FORCE_TV_SCLK (1<<29) +# define RADEON_SCLK_FORCE_SUBPIC (1<<30) +# define RADEON_SCLK_FORCE_OV0 (1<<31) +# define R300_SCLK_FORCE_VAP (1<<21) +# define R300_SCLK_FORCE_SR (1<<25) +# define R300_SCLK_FORCE_PX (1<<26) +# define R300_SCLK_FORCE_TX (1<<27) +# define R300_SCLK_FORCE_US (1<<28) +# define R300_SCLK_FORCE_SU (1<<30) +#define R300_SCLK_CNTL2 0x1e /* PLL */ +# define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10) +# define R300_SCLK_GA_MAX_DYN_STOP_LAT (1<<11) +# define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12) +# define R300_SCLK_FORCE_TCL (1<<13) +# define R300_SCLK_FORCE_CBA (1<<14) +# define R300_SCLK_FORCE_GA (1<<15) +#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */ +# define RADEON_SCLK_MORE_MAX_DYN_STOP_LAT 0x0007 +# define RADEON_SCLK_MORE_FORCEON 0x0700 +#define RADEON_SDRAM_MODE_REG 0x0158 +#define RADEON_SEQ8_DATA 0x03c5 /* VGA */ +#define RADEON_SEQ8_IDX 0x03c4 /* VGA */ +#define RADEON_SNAPSHOT_F_COUNT 0x0244 +#define RADEON_SNAPSHOT_VH_COUNTS 0x0240 +#define RADEON_SNAPSHOT_VIF_COUNT 0x024c +#define RADEON_SRC_OFFSET 0x15ac +#define RADEON_SRC_PITCH 0x15b0 +#define RADEON_SRC_PITCH_OFFSET 0x1428 +#define RADEON_SRC_SC_BOTTOM 0x165c +#define RADEON_SRC_SC_BOTTOM_RIGHT 0x16f4 +#define RADEON_SRC_SC_RIGHT 0x1654 +#define RADEON_SRC_X 0x1414 +#define RADEON_SRC_X_Y 0x1590 +#define RADEON_SRC_Y 0x1418 +#define RADEON_SRC_Y_X 0x1434 +#define RADEON_STATUS 0x0f06 /* PCI */ +#define RADEON_SUBPIC_CNTL 0x0540 /* ? */ +#define RADEON_SUB_CLASS 0x0f0a /* PCI */ +#define RADEON_SURFACE_CNTL 0x0b00 +# define RADEON_SURF_TRANSLATION_DIS (1 << 8) +# define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20) +# define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21) +# define RADEON_NONSURF_AP1_SWP_16BPP (1 << 22) +# define RADEON_NONSURF_AP1_SWP_32BPP (1 << 23) +#define RADEON_SURFACE0_INFO 0x0b0c +# define RADEON_SURF_TILE_COLOR_MACRO (0 << 16) +# define RADEON_SURF_TILE_COLOR_BOTH (1 << 16) +# define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16) +# define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16) +# define R200_SURF_TILE_NONE (0 << 16) +# define R200_SURF_TILE_COLOR_MACRO (1 << 16) +# define R200_SURF_TILE_COLOR_MICRO (2 << 16) +# define R200_SURF_TILE_COLOR_BOTH (3 << 16) +# define R200_SURF_TILE_DEPTH_32BPP (4 << 16) +# define R200_SURF_TILE_DEPTH_16BPP (5 << 16) +# define R300_SURF_TILE_NONE (0 << 16) +# define R300_SURF_TILE_COLOR_MACRO (1 << 16) +# define R300_SURF_TILE_DEPTH_32BPP (2 << 16) +# define RADEON_SURF_AP0_SWP_16BPP (1 << 20) +# define RADEON_SURF_AP0_SWP_32BPP (1 << 21) +# define RADEON_SURF_AP1_SWP_16BPP (1 << 22) +# define RADEON_SURF_AP1_SWP_32BPP (1 << 23) +#define RADEON_SURFACE0_LOWER_BOUND 0x0b04 +#define RADEON_SURFACE0_UPPER_BOUND 0x0b08 +#define RADEON_SURFACE1_INFO 0x0b1c +#define RADEON_SURFACE1_LOWER_BOUND 0x0b14 +#define RADEON_SURFACE1_UPPER_BOUND 0x0b18 +#define RADEON_SURFACE2_INFO 0x0b2c +#define RADEON_SURFACE2_LOWER_BOUND 0x0b24 +#define RADEON_SURFACE2_UPPER_BOUND 0x0b28 +#define RADEON_SURFACE3_INFO 0x0b3c +#define RADEON_SURFACE3_LOWER_BOUND 0x0b34 +#define RADEON_SURFACE3_UPPER_BOUND 0x0b38 +#define RADEON_SURFACE4_INFO 0x0b4c +#define RADEON_SURFACE4_LOWER_BOUND 0x0b44 +#define RADEON_SURFACE4_UPPER_BOUND 0x0b48 +#define RADEON_SURFACE5_INFO 0x0b5c +#define RADEON_SURFACE5_LOWER_BOUND 0x0b54 +#define RADEON_SURFACE5_UPPER_BOUND 0x0b58 +#define RADEON_SURFACE6_INFO 0x0b6c +#define RADEON_SURFACE6_LOWER_BOUND 0x0b64 +#define RADEON_SURFACE6_UPPER_BOUND 0x0b68 +#define RADEON_SURFACE7_INFO 0x0b7c +#define RADEON_SURFACE7_LOWER_BOUND 0x0b74 +#define RADEON_SURFACE7_UPPER_BOUND 0x0b78 +#define RADEON_SW_SEMAPHORE 0x013c + +#define RADEON_TEST_DEBUG_CNTL 0x0120 +#define RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001 + +#define RADEON_TEST_DEBUG_MUX 0x0124 +#define RADEON_TEST_DEBUG_OUT 0x012c +#define RADEON_TMDS_PLL_CNTL 0x02a8 +#define RADEON_TMDS_TRANSMITTER_CNTL 0x02a4 +# define RADEON_TMDS_TRANSMITTER_PLLEN 1 +# define RADEON_TMDS_TRANSMITTER_PLLRST 2 +#define RADEON_TRAIL_BRES_DEC 0x1614 +#define RADEON_TRAIL_BRES_ERR 0x160c +#define RADEON_TRAIL_BRES_INC 0x1610 +#define RADEON_TRAIL_X 0x1618 +#define RADEON_TRAIL_X_SUB 0x1620 + +#define RADEON_VCLK_ECP_CNTL 0x0008 /* PLL */ +# define RADEON_VCLK_SRC_SEL_MASK 0x03 +# define RADEON_VCLK_SRC_SEL_CPUCLK 0x00 +# define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01 +# define RADEON_VCLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_VCLK_SRC_SEL_PPLLCLK 0x03 +# define RADEON_PIXCLK_ALWAYS_ONb (1<<6) +# define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7) +# define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23) + +#define RADEON_VENDOR_ID 0x0f00 /* PCI */ +#define RADEON_VGA_DDA_CONFIG 0x02e8 +#define RADEON_VGA_DDA_ON_OFF 0x02ec +#define RADEON_VID_BUFFER_CONTROL 0x0900 +#define RADEON_VIDEOMUX_CNTL 0x0190 + + /* VIP bus */ +#define RADEON_VIPH_CH0_DATA 0x0c00 +#define RADEON_VIPH_CH1_DATA 0x0c04 +#define RADEON_VIPH_CH2_DATA 0x0c08 +#define RADEON_VIPH_CH3_DATA 0x0c0c +#define RADEON_VIPH_CH0_ADDR 0x0c10 +#define RADEON_VIPH_CH1_ADDR 0x0c14 +#define RADEON_VIPH_CH2_ADDR 0x0c18 +#define RADEON_VIPH_CH3_ADDR 0x0c1c +#define RADEON_VIPH_CH0_SBCNT 0x0c20 +#define RADEON_VIPH_CH1_SBCNT 0x0c24 +#define RADEON_VIPH_CH2_SBCNT 0x0c28 +#define RADEON_VIPH_CH3_SBCNT 0x0c2c +#define RADEON_VIPH_CH0_ABCNT 0x0c30 +#define RADEON_VIPH_CH1_ABCNT 0x0c34 +#define RADEON_VIPH_CH2_ABCNT 0x0c38 +#define RADEON_VIPH_CH3_ABCNT 0x0c3c +#define RADEON_VIPH_CONTROL 0x0c40 +# define RADEON_VIP_BUSY 0 +# define RADEON_VIP_IDLE 1 +# define RADEON_VIP_RESET 2 +# define RADEON_VIPH_EN (1 << 21) +#define RADEON_VIPH_DV_LAT 0x0c44 +#define RADEON_VIPH_BM_CHUNK 0x0c48 +#define RADEON_VIPH_DV_INT 0x0c4c +#define RADEON_VIPH_TIMEOUT_STAT 0x0c50 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_AK 0x00000010 +#define RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000 + +#define RADEON_VIPH_REG_DATA 0x0084 +#define RADEON_VIPH_REG_ADDR 0x0080 + + +#define RADEON_WAIT_UNTIL 0x1720 +# define RADEON_WAIT_CRTC_PFLIP (1 << 0) +# define RADEON_WAIT_RE_CRTC_VLINE (1 << 1) +# define RADEON_WAIT_FE_CRTC_VLINE (1 << 2) +# define RADEON_WAIT_CRTC_VLINE (1 << 3) +# define RADEON_WAIT_DMA_VID_IDLE (1 << 8) +# define RADEON_WAIT_DMA_GUI_IDLE (1 << 9) +# define RADEON_WAIT_CMDFIFO (1 << 10) /* wait for CMDFIFO_ENTRIES */ +# define RADEON_WAIT_OV0_FLIP (1 << 11) +# define RADEON_WAIT_AGP_FLUSH (1 << 13) +# define RADEON_WAIT_2D_IDLE (1 << 14) +# define RADEON_WAIT_3D_IDLE (1 << 15) +# define RADEON_WAIT_2D_IDLECLEAN (1 << 16) +# define RADEON_WAIT_3D_IDLECLEAN (1 << 17) +# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18) +# define RADEON_CMDFIFO_ENTRIES_SHIFT 10 +# define RADEON_CMDFIFO_ENTRIES_MASK 0x7f +# define RADEON_WAIT_VAP_IDLE (1 << 28) +# define RADEON_WAIT_BOTH_CRTC_PFLIP (1 << 30) +# define RADEON_ENG_DISPLAY_SELECT_CRTC0 (0 << 31) +# define RADEON_ENG_DISPLAY_SELECT_CRTC1 (1 << 31) + +#define RADEON_X_MPLL_REF_FB_DIV 0x000a /* PLL */ +#define RADEON_XCLK_CNTL 0x000d /* PLL */ +#define RADEON_XDLL_CNTL 0x000c /* PLL */ +#define RADEON_XPLL_CNTL 0x000b /* PLL */ + + + + /* Registers for 3D/TCL */ +#define RADEON_PP_BORDER_COLOR_0 0x1d40 +#define RADEON_PP_BORDER_COLOR_1 0x1d44 +#define RADEON_PP_BORDER_COLOR_2 0x1d48 +#define RADEON_PP_CNTL 0x1c38 +# define RADEON_STIPPLE_ENABLE (1 << 0) +# define RADEON_SCISSOR_ENABLE (1 << 1) +# define RADEON_PATTERN_ENABLE (1 << 2) +# define RADEON_SHADOW_ENABLE (1 << 3) +# define RADEON_TEX_ENABLE_MASK (0xf << 4) +# define RADEON_TEX_0_ENABLE (1 << 4) +# define RADEON_TEX_1_ENABLE (1 << 5) +# define RADEON_TEX_2_ENABLE (1 << 6) +# define RADEON_TEX_3_ENABLE (1 << 7) +# define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12) +# define RADEON_TEX_BLEND_0_ENABLE (1 << 12) +# define RADEON_TEX_BLEND_1_ENABLE (1 << 13) +# define RADEON_TEX_BLEND_2_ENABLE (1 << 14) +# define RADEON_TEX_BLEND_3_ENABLE (1 << 15) +# define RADEON_PLANAR_YUV_ENABLE (1 << 20) +# define RADEON_SPECULAR_ENABLE (1 << 21) +# define RADEON_FOG_ENABLE (1 << 22) +# define RADEON_ALPHA_TEST_ENABLE (1 << 23) +# define RADEON_ANTI_ALIAS_NONE (0 << 24) +# define RADEON_ANTI_ALIAS_LINE (1 << 24) +# define RADEON_ANTI_ALIAS_POLY (2 << 24) +# define RADEON_ANTI_ALIAS_LINE_POLY (3 << 24) +# define RADEON_BUMP_MAP_ENABLE (1 << 26) +# define RADEON_BUMPED_MAP_T0 (0 << 27) +# define RADEON_BUMPED_MAP_T1 (1 << 27) +# define RADEON_BUMPED_MAP_T2 (2 << 27) +# define RADEON_TEX_3D_ENABLE_0 (1 << 29) +# define RADEON_TEX_3D_ENABLE_1 (1 << 30) +# define RADEON_MC_ENABLE (1 << 31) +#define RADEON_PP_FOG_COLOR 0x1c18 +# define RADEON_FOG_COLOR_MASK 0x00ffffff +# define RADEON_FOG_VERTEX (0 << 24) +# define RADEON_FOG_TABLE (1 << 24) +# define RADEON_FOG_USE_DEPTH (0 << 25) +# define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25) +# define RADEON_FOG_USE_SPEC_ALPHA (3 << 25) +#define RADEON_PP_LUM_MATRIX 0x1d00 +#define RADEON_PP_MISC 0x1c14 +# define RADEON_REF_ALPHA_MASK 0x000000ff +# define RADEON_ALPHA_TEST_FAIL (0 << 8) +# define RADEON_ALPHA_TEST_LESS (1 << 8) +# define RADEON_ALPHA_TEST_LEQUAL (2 << 8) +# define RADEON_ALPHA_TEST_EQUAL (3 << 8) +# define RADEON_ALPHA_TEST_GEQUAL (4 << 8) +# define RADEON_ALPHA_TEST_GREATER (5 << 8) +# define RADEON_ALPHA_TEST_NEQUAL (6 << 8) +# define RADEON_ALPHA_TEST_PASS (7 << 8) +# define RADEON_ALPHA_TEST_OP_MASK (7 << 8) +# define RADEON_CHROMA_FUNC_FAIL (0 << 16) +# define RADEON_CHROMA_FUNC_PASS (1 << 16) +# define RADEON_CHROMA_FUNC_NEQUAL (2 << 16) +# define RADEON_CHROMA_FUNC_EQUAL (3 << 16) +# define RADEON_CHROMA_KEY_NEAREST (0 << 18) +# define RADEON_CHROMA_KEY_ZERO (1 << 18) +# define RADEON_SHADOW_ID_AUTO_INC (1 << 20) +# define RADEON_SHADOW_FUNC_EQUAL (0 << 21) +# define RADEON_SHADOW_FUNC_NEQUAL (1 << 21) +# define RADEON_SHADOW_PASS_1 (0 << 22) +# define RADEON_SHADOW_PASS_2 (1 << 22) +# define RADEON_RIGHT_HAND_CUBE_D3D (0 << 24) +# define RADEON_RIGHT_HAND_CUBE_OGL (1 << 24) +#define RADEON_PP_ROT_MATRIX_0 0x1d58 +#define RADEON_PP_ROT_MATRIX_1 0x1d5c +#define RADEON_PP_TXFILTER_0 0x1c54 +#define RADEON_PP_TXFILTER_1 0x1c6c +#define RADEON_PP_TXFILTER_2 0x1c84 +# define RADEON_MAG_FILTER_NEAREST (0 << 0) +# define RADEON_MAG_FILTER_LINEAR (1 << 0) +# define RADEON_MAG_FILTER_MASK (1 << 0) +# define RADEON_MIN_FILTER_NEAREST (0 << 1) +# define RADEON_MIN_FILTER_LINEAR (1 << 1) +# define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) +# define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) +# define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) +# define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST (8 << 1) +# define RADEON_MIN_FILTER_ANISO_LINEAR (9 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) +# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) +# define RADEON_MIN_FILTER_MASK (15 << 1) +# define RADEON_MAX_ANISO_1_TO_1 (0 << 5) +# define RADEON_MAX_ANISO_2_TO_1 (1 << 5) +# define RADEON_MAX_ANISO_4_TO_1 (2 << 5) +# define RADEON_MAX_ANISO_8_TO_1 (3 << 5) +# define RADEON_MAX_ANISO_16_TO_1 (4 << 5) +# define RADEON_MAX_ANISO_MASK (7 << 5) +# define RADEON_LOD_BIAS_MASK (0xff << 8) +# define RADEON_LOD_BIAS_SHIFT 8 +# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16) +# define RADEON_MAX_MIP_LEVEL_SHIFT 16 +# define RADEON_YUV_TO_RGB (1 << 20) +# define RADEON_YUV_TEMPERATURE_COOL (0 << 21) +# define RADEON_YUV_TEMPERATURE_HOT (1 << 21) +# define RADEON_YUV_TEMPERATURE_MASK (1 << 21) +# define RADEON_WRAPEN_S (1 << 22) +# define RADEON_CLAMP_S_WRAP (0 << 23) +# define RADEON_CLAMP_S_MIRROR (1 << 23) +# define RADEON_CLAMP_S_CLAMP_LAST (2 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) +# define RADEON_CLAMP_S_CLAMP_BORDER (4 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +# define RADEON_CLAMP_S_CLAMP_GL (6 << 23) +# define RADEON_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) +# define RADEON_CLAMP_S_MASK (7 << 23) +# define RADEON_WRAPEN_T (1 << 26) +# define RADEON_CLAMP_T_WRAP (0 << 27) +# define RADEON_CLAMP_T_MIRROR (1 << 27) +# define RADEON_CLAMP_T_CLAMP_LAST (2 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) +# define RADEON_CLAMP_T_CLAMP_BORDER (4 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +# define RADEON_CLAMP_T_CLAMP_GL (6 << 27) +# define RADEON_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) +# define RADEON_CLAMP_T_MASK (7 << 27) +# define RADEON_BORDER_MODE_OGL (0 << 31) +# define RADEON_BORDER_MODE_D3D (1 << 31) +#define RADEON_PP_TXFORMAT_0 0x1c58 +#define RADEON_PP_TXFORMAT_1 0x1c70 +#define RADEON_PP_TXFORMAT_2 0x1c88 +# define RADEON_TXFORMAT_I8 (0 << 0) +# define RADEON_TXFORMAT_AI88 (1 << 0) +# define RADEON_TXFORMAT_RGB332 (2 << 0) +# define RADEON_TXFORMAT_ARGB1555 (3 << 0) +# define RADEON_TXFORMAT_RGB565 (4 << 0) +# define RADEON_TXFORMAT_ARGB4444 (5 << 0) +# define RADEON_TXFORMAT_ARGB8888 (6 << 0) +# define RADEON_TXFORMAT_RGBA8888 (7 << 0) +# define RADEON_TXFORMAT_Y8 (8 << 0) +# define RADEON_TXFORMAT_VYUY422 (10 << 0) +# define RADEON_TXFORMAT_YVYU422 (11 << 0) +# define RADEON_TXFORMAT_DXT1 (12 << 0) +# define RADEON_TXFORMAT_DXT23 (14 << 0) +# define RADEON_TXFORMAT_DXT45 (15 << 0) +# define RADEON_TXFORMAT_FORMAT_MASK (31 << 0) +# define RADEON_TXFORMAT_FORMAT_SHIFT 0 +# define RADEON_TXFORMAT_APPLE_YUV_MODE (1 << 5) +# define RADEON_TXFORMAT_ALPHA_IN_MAP (1 << 6) +# define RADEON_TXFORMAT_NON_POWER2 (1 << 7) +# define RADEON_TXFORMAT_WIDTH_MASK (15 << 8) +# define RADEON_TXFORMAT_WIDTH_SHIFT 8 +# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12) +# define RADEON_TXFORMAT_HEIGHT_SHIFT 12 +# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16) +# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16 +# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20) +# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20 +# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) +# define RADEON_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) +# define RADEON_TXFORMAT_ENDIAN_NO_SWAP (0 << 26) +# define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26) +# define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26) +# define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26) +# define RADEON_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) +# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) +# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) +# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31) +#define RADEON_PP_CUBIC_FACES_0 0x1d24 +#define RADEON_PP_CUBIC_FACES_1 0x1d28 +#define RADEON_PP_CUBIC_FACES_2 0x1d2c +# define RADEON_FACE_WIDTH_1_SHIFT 0 +# define RADEON_FACE_HEIGHT_1_SHIFT 4 +# define RADEON_FACE_WIDTH_1_MASK (0xf << 0) +# define RADEON_FACE_HEIGHT_1_MASK (0xf << 4) +# define RADEON_FACE_WIDTH_2_SHIFT 8 +# define RADEON_FACE_HEIGHT_2_SHIFT 12 +# define RADEON_FACE_WIDTH_2_MASK (0xf << 8) +# define RADEON_FACE_HEIGHT_2_MASK (0xf << 12) +# define RADEON_FACE_WIDTH_3_SHIFT 16 +# define RADEON_FACE_HEIGHT_3_SHIFT 20 +# define RADEON_FACE_WIDTH_3_MASK (0xf << 16) +# define RADEON_FACE_HEIGHT_3_MASK (0xf << 20) +# define RADEON_FACE_WIDTH_4_SHIFT 24 +# define RADEON_FACE_HEIGHT_4_SHIFT 28 +# define RADEON_FACE_WIDTH_4_MASK (0xf << 24) +# define RADEON_FACE_HEIGHT_4_MASK (0xf << 28) + +#define RADEON_PP_TXOFFSET_0 0x1c5c +#define RADEON_PP_TXOFFSET_1 0x1c74 +#define RADEON_PP_TXOFFSET_2 0x1c8c +# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0) +# define RADEON_TXO_ENDIAN_BYTE_SWAP (1 << 0) +# define RADEON_TXO_ENDIAN_WORD_SWAP (2 << 0) +# define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0) +# define RADEON_TXO_MACRO_LINEAR (0 << 2) +# define RADEON_TXO_MACRO_TILE (1 << 2) +# define RADEON_TXO_MICRO_LINEAR (0 << 3) +# define RADEON_TXO_MICRO_TILE_X2 (1 << 3) +# define RADEON_TXO_MICRO_TILE_OPT (2 << 3) +# define RADEON_TXO_OFFSET_MASK 0xffffffe0 +# define RADEON_TXO_OFFSET_SHIFT 5 + +#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */ +#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4 +#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8 +#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc +#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0 +#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00 +#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04 +#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08 +#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c +#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10 +#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14 +#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18 +#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c +#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20 +#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24 + +#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */ +#define RADEON_PP_TEX_SIZE_1 0x1d0c +#define RADEON_PP_TEX_SIZE_2 0x1d14 +# define RADEON_TEX_USIZE_MASK (0x7ff << 0) +# define RADEON_TEX_USIZE_SHIFT 0 +# define RADEON_TEX_VSIZE_MASK (0x7ff << 16) +# define RADEON_TEX_VSIZE_SHIFT 16 +# define RADEON_SIGNED_RGB_MASK (1 << 30) +# define RADEON_SIGNED_RGB_SHIFT 30 +# define RADEON_SIGNED_ALPHA_MASK (1 << 31) +# define RADEON_SIGNED_ALPHA_SHIFT 31 +#define RADEON_PP_TEX_PITCH_0 0x1d08 /* NPOT */ +#define RADEON_PP_TEX_PITCH_1 0x1d10 /* NPOT */ +#define RADEON_PP_TEX_PITCH_2 0x1d18 /* NPOT */ +/* note: bits 13-5: 32 byte aligned stride of texture map */ + +#define RADEON_PP_TXCBLEND_0 0x1c60 +#define RADEON_PP_TXCBLEND_1 0x1c78 +#define RADEON_PP_TXCBLEND_2 0x1c90 +# define RADEON_COLOR_ARG_A_SHIFT 0 +# define RADEON_COLOR_ARG_A_MASK (0x1f << 0) +# define RADEON_COLOR_ARG_A_ZERO (0 << 0) +# define RADEON_COLOR_ARG_A_CURRENT_COLOR (2 << 0) +# define RADEON_COLOR_ARG_A_CURRENT_ALPHA (3 << 0) +# define RADEON_COLOR_ARG_A_DIFFUSE_COLOR (4 << 0) +# define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0) +# define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6 << 0) +# define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7 << 0) +# define RADEON_COLOR_ARG_A_TFACTOR_COLOR (8 << 0) +# define RADEON_COLOR_ARG_A_TFACTOR_ALPHA (9 << 0) +# define RADEON_COLOR_ARG_A_T0_COLOR (10 << 0) +# define RADEON_COLOR_ARG_A_T0_ALPHA (11 << 0) +# define RADEON_COLOR_ARG_A_T1_COLOR (12 << 0) +# define RADEON_COLOR_ARG_A_T1_ALPHA (13 << 0) +# define RADEON_COLOR_ARG_A_T2_COLOR (14 << 0) +# define RADEON_COLOR_ARG_A_T2_ALPHA (15 << 0) +# define RADEON_COLOR_ARG_A_T3_COLOR (16 << 0) +# define RADEON_COLOR_ARG_A_T3_ALPHA (17 << 0) +# define RADEON_COLOR_ARG_B_SHIFT 5 +# define RADEON_COLOR_ARG_B_MASK (0x1f << 5) +# define RADEON_COLOR_ARG_B_ZERO (0 << 5) +# define RADEON_COLOR_ARG_B_CURRENT_COLOR (2 << 5) +# define RADEON_COLOR_ARG_B_CURRENT_ALPHA (3 << 5) +# define RADEON_COLOR_ARG_B_DIFFUSE_COLOR (4 << 5) +# define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5) +# define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6 << 5) +# define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7 << 5) +# define RADEON_COLOR_ARG_B_TFACTOR_COLOR (8 << 5) +# define RADEON_COLOR_ARG_B_TFACTOR_ALPHA (9 << 5) +# define RADEON_COLOR_ARG_B_T0_COLOR (10 << 5) +# define RADEON_COLOR_ARG_B_T0_ALPHA (11 << 5) +# define RADEON_COLOR_ARG_B_T1_COLOR (12 << 5) +# define RADEON_COLOR_ARG_B_T1_ALPHA (13 << 5) +# define RADEON_COLOR_ARG_B_T2_COLOR (14 << 5) +# define RADEON_COLOR_ARG_B_T2_ALPHA (15 << 5) +# define RADEON_COLOR_ARG_B_T3_COLOR (16 << 5) +# define RADEON_COLOR_ARG_B_T3_ALPHA (17 << 5) +# define RADEON_COLOR_ARG_C_SHIFT 10 +# define RADEON_COLOR_ARG_C_MASK (0x1f << 10) +# define RADEON_COLOR_ARG_C_ZERO (0 << 10) +# define RADEON_COLOR_ARG_C_CURRENT_COLOR (2 << 10) +# define RADEON_COLOR_ARG_C_CURRENT_ALPHA (3 << 10) +# define RADEON_COLOR_ARG_C_DIFFUSE_COLOR (4 << 10) +# define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10) +# define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6 << 10) +# define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7 << 10) +# define RADEON_COLOR_ARG_C_TFACTOR_COLOR (8 << 10) +# define RADEON_COLOR_ARG_C_TFACTOR_ALPHA (9 << 10) +# define RADEON_COLOR_ARG_C_T0_COLOR (10 << 10) +# define RADEON_COLOR_ARG_C_T0_ALPHA (11 << 10) +# define RADEON_COLOR_ARG_C_T1_COLOR (12 << 10) +# define RADEON_COLOR_ARG_C_T1_ALPHA (13 << 10) +# define RADEON_COLOR_ARG_C_T2_COLOR (14 << 10) +# define RADEON_COLOR_ARG_C_T2_ALPHA (15 << 10) +# define RADEON_COLOR_ARG_C_T3_COLOR (16 << 10) +# define RADEON_COLOR_ARG_C_T3_ALPHA (17 << 10) +# define RADEON_COMP_ARG_A (1 << 15) +# define RADEON_COMP_ARG_A_SHIFT 15 +# define RADEON_COMP_ARG_B (1 << 16) +# define RADEON_COMP_ARG_B_SHIFT 16 +# define RADEON_COMP_ARG_C (1 << 17) +# define RADEON_COMP_ARG_C_SHIFT 17 +# define RADEON_BLEND_CTL_MASK (7 << 18) +# define RADEON_BLEND_CTL_ADD (0 << 18) +# define RADEON_BLEND_CTL_SUBTRACT (1 << 18) +# define RADEON_BLEND_CTL_ADDSIGNED (2 << 18) +# define RADEON_BLEND_CTL_BLEND (3 << 18) +# define RADEON_BLEND_CTL_DOT3 (4 << 18) +# define RADEON_SCALE_SHIFT 21 +# define RADEON_SCALE_MASK (3 << 21) +# define RADEON_SCALE_1X (0 << 21) +# define RADEON_SCALE_2X (1 << 21) +# define RADEON_SCALE_4X (2 << 21) +# define RADEON_CLAMP_TX (1 << 23) +# define RADEON_T0_EQ_TCUR (1 << 24) +# define RADEON_T1_EQ_TCUR (1 << 25) +# define RADEON_T2_EQ_TCUR (1 << 26) +# define RADEON_T3_EQ_TCUR (1 << 27) +# define RADEON_COLOR_ARG_MASK 0x1f +# define RADEON_COMP_ARG_SHIFT 15 +#define RADEON_PP_TXABLEND_0 0x1c64 +#define RADEON_PP_TXABLEND_1 0x1c7c +#define RADEON_PP_TXABLEND_2 0x1c94 +# define RADEON_ALPHA_ARG_A_SHIFT 0 +# define RADEON_ALPHA_ARG_A_MASK (0xf << 0) +# define RADEON_ALPHA_ARG_A_ZERO (0 << 0) +# define RADEON_ALPHA_ARG_A_CURRENT_ALPHA (1 << 0) +# define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0) +# define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0) +# define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0) +# define RADEON_ALPHA_ARG_A_T0_ALPHA (5 << 0) +# define RADEON_ALPHA_ARG_A_T1_ALPHA (6 << 0) +# define RADEON_ALPHA_ARG_A_T2_ALPHA (7 << 0) +# define RADEON_ALPHA_ARG_A_T3_ALPHA (8 << 0) +# define RADEON_ALPHA_ARG_B_SHIFT 4 +# define RADEON_ALPHA_ARG_B_MASK (0xf << 4) +# define RADEON_ALPHA_ARG_B_ZERO (0 << 4) +# define RADEON_ALPHA_ARG_B_CURRENT_ALPHA (1 << 4) +# define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4) +# define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4) +# define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4) +# define RADEON_ALPHA_ARG_B_T0_ALPHA (5 << 4) +# define RADEON_ALPHA_ARG_B_T1_ALPHA (6 << 4) +# define RADEON_ALPHA_ARG_B_T2_ALPHA (7 << 4) +# define RADEON_ALPHA_ARG_B_T3_ALPHA (8 << 4) +# define RADEON_ALPHA_ARG_C_SHIFT 8 +# define RADEON_ALPHA_ARG_C_MASK (0xf << 8) +# define RADEON_ALPHA_ARG_C_ZERO (0 << 8) +# define RADEON_ALPHA_ARG_C_CURRENT_ALPHA (1 << 8) +# define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8) +# define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8) +# define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8) +# define RADEON_ALPHA_ARG_C_T0_ALPHA (5 << 8) +# define RADEON_ALPHA_ARG_C_T1_ALPHA (6 << 8) +# define RADEON_ALPHA_ARG_C_T2_ALPHA (7 << 8) +# define RADEON_ALPHA_ARG_C_T3_ALPHA (8 << 8) +# define RADEON_DOT_ALPHA_DONT_REPLICATE (1 << 9) +# define RADEON_ALPHA_ARG_MASK 0xf + +#define RADEON_PP_TFACTOR_0 0x1c68 +#define RADEON_PP_TFACTOR_1 0x1c80 +#define RADEON_PP_TFACTOR_2 0x1c98 + +#define RADEON_RB3D_BLENDCNTL 0x1c20 +# define RADEON_COMB_FCN_MASK (3 << 12) +# define RADEON_COMB_FCN_ADD_CLAMP (0 << 12) +# define RADEON_COMB_FCN_ADD_NOCLAMP (1 << 12) +# define RADEON_COMB_FCN_SUB_CLAMP (2 << 12) +# define RADEON_COMB_FCN_SUB_NOCLAMP (3 << 12) +# define RADEON_SRC_BLEND_GL_ZERO (32 << 16) +# define RADEON_SRC_BLEND_GL_ONE (33 << 16) +# define RADEON_SRC_BLEND_GL_SRC_COLOR (34 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16) +# define RADEON_SRC_BLEND_GL_DST_COLOR (36 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16) +# define RADEON_SRC_BLEND_GL_SRC_ALPHA (38 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16) +# define RADEON_SRC_BLEND_GL_DST_ALPHA (40 << 16) +# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16) +# define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16) +# define RADEON_SRC_BLEND_MASK (63 << 16) +# define RADEON_DST_BLEND_GL_ZERO (32 << 24) +# define RADEON_DST_BLEND_GL_ONE (33 << 24) +# define RADEON_DST_BLEND_GL_SRC_COLOR (34 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24) +# define RADEON_DST_BLEND_GL_DST_COLOR (36 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24) +# define RADEON_DST_BLEND_GL_SRC_ALPHA (38 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24) +# define RADEON_DST_BLEND_GL_DST_ALPHA (40 << 24) +# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24) +# define RADEON_DST_BLEND_MASK (63 << 24) +#define RADEON_RB3D_CNTL 0x1c3c +# define RADEON_ALPHA_BLEND_ENABLE (1 << 0) +# define RADEON_PLANE_MASK_ENABLE (1 << 1) +# define RADEON_DITHER_ENABLE (1 << 2) +# define RADEON_ROUND_ENABLE (1 << 3) +# define RADEON_SCALE_DITHER_ENABLE (1 << 4) +# define RADEON_DITHER_INIT (1 << 5) +# define RADEON_ROP_ENABLE (1 << 6) +# define RADEON_STENCIL_ENABLE (1 << 7) +# define RADEON_Z_ENABLE (1 << 8) +# define RADEON_DEPTH_XZ_OFFEST_ENABLE (1 << 9) +# define RADEON_COLOR_FORMAT_ARGB1555 (3 << 10) +# define RADEON_COLOR_FORMAT_RGB565 (4 << 10) +# define RADEON_COLOR_FORMAT_ARGB8888 (6 << 10) +# define RADEON_COLOR_FORMAT_RGB332 (7 << 10) +# define RADEON_COLOR_FORMAT_Y8 (8 << 10) +# define RADEON_COLOR_FORMAT_RGB8 (9 << 10) +# define RADEON_COLOR_FORMAT_YUV422_VYUY (11 << 10) +# define RADEON_COLOR_FORMAT_YUV422_YVYU (12 << 10) +# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10) +# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10) +# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14) +#define RADEON_RB3D_COLOROFFSET 0x1c40 +# define RADEON_COLOROFFSET_MASK 0xfffffff0 +#define RADEON_RB3D_COLORPITCH 0x1c48 +# define RADEON_COLORPITCH_MASK 0x000001ff8 +# define RADEON_COLOR_TILE_ENABLE (1 << 16) +# define RADEON_COLOR_MICROTILE_ENABLE (1 << 17) +# define RADEON_COLOR_ENDIAN_NO_SWAP (0 << 18) +# define RADEON_COLOR_ENDIAN_WORD_SWAP (1 << 18) +# define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18) +#define RADEON_RB3D_DEPTHOFFSET 0x1c24 +#define RADEON_RB3D_DEPTHPITCH 0x1c28 +# define RADEON_DEPTHPITCH_MASK 0x00001ff8 +# define RADEON_DEPTH_ENDIAN_NO_SWAP (0 << 18) +# define RADEON_DEPTH_ENDIAN_WORD_SWAP (1 << 18) +# define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18) +#define RADEON_RB3D_PLANEMASK 0x1d84 +#define RADEON_RB3D_ROPCNTL 0x1d80 +# define RADEON_ROP_MASK (15 << 8) +# define RADEON_ROP_CLEAR (0 << 8) +# define RADEON_ROP_NOR (1 << 8) +# define RADEON_ROP_AND_INVERTED (2 << 8) +# define RADEON_ROP_COPY_INVERTED (3 << 8) +# define RADEON_ROP_AND_REVERSE (4 << 8) +# define RADEON_ROP_INVERT (5 << 8) +# define RADEON_ROP_XOR (6 << 8) +# define RADEON_ROP_NAND (7 << 8) +# define RADEON_ROP_AND (8 << 8) +# define RADEON_ROP_EQUIV (9 << 8) +# define RADEON_ROP_NOOP (10 << 8) +# define RADEON_ROP_OR_INVERTED (11 << 8) +# define RADEON_ROP_COPY (12 << 8) +# define RADEON_ROP_OR_REVERSE (13 << 8) +# define RADEON_ROP_OR (14 << 8) +# define RADEON_ROP_SET (15 << 8) +#define RADEON_RB3D_STENCILREFMASK 0x1d7c +# define RADEON_STENCIL_REF_SHIFT 0 +# define RADEON_STENCIL_REF_MASK (0xff << 0) +# define RADEON_STENCIL_MASK_SHIFT 16 +# define RADEON_STENCIL_VALUE_MASK (0xff << 16) +# define RADEON_STENCIL_WRITEMASK_SHIFT 24 +# define RADEON_STENCIL_WRITE_MASK (0xff << 24) +#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c +# define RADEON_DEPTH_FORMAT_MASK (0xf << 0) +# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_INT_Z (4 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0) +# define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0) +# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0) +# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0) +# define RADEON_Z_TEST_NEVER (0 << 4) +# define RADEON_Z_TEST_LESS (1 << 4) +# define RADEON_Z_TEST_LEQUAL (2 << 4) +# define RADEON_Z_TEST_EQUAL (3 << 4) +# define RADEON_Z_TEST_GEQUAL (4 << 4) +# define RADEON_Z_TEST_GREATER (5 << 4) +# define RADEON_Z_TEST_NEQUAL (6 << 4) +# define RADEON_Z_TEST_ALWAYS (7 << 4) +# define RADEON_Z_TEST_MASK (7 << 4) +# define RADEON_STENCIL_TEST_NEVER (0 << 12) +# define RADEON_STENCIL_TEST_LESS (1 << 12) +# define RADEON_STENCIL_TEST_LEQUAL (2 << 12) +# define RADEON_STENCIL_TEST_EQUAL (3 << 12) +# define RADEON_STENCIL_TEST_GEQUAL (4 << 12) +# define RADEON_STENCIL_TEST_GREATER (5 << 12) +# define RADEON_STENCIL_TEST_NEQUAL (6 << 12) +# define RADEON_STENCIL_TEST_ALWAYS (7 << 12) +# define RADEON_STENCIL_TEST_MASK (0x7 << 12) +# define RADEON_STENCIL_FAIL_KEEP (0 << 16) +# define RADEON_STENCIL_FAIL_ZERO (1 << 16) +# define RADEON_STENCIL_FAIL_REPLACE (2 << 16) +# define RADEON_STENCIL_FAIL_INC (3 << 16) +# define RADEON_STENCIL_FAIL_DEC (4 << 16) +# define RADEON_STENCIL_FAIL_INVERT (5 << 16) +# define RADEON_STENCIL_FAIL_MASK (0x7 << 16) +# define RADEON_STENCIL_ZPASS_KEEP (0 << 20) +# define RADEON_STENCIL_ZPASS_ZERO (1 << 20) +# define RADEON_STENCIL_ZPASS_REPLACE (2 << 20) +# define RADEON_STENCIL_ZPASS_INC (3 << 20) +# define RADEON_STENCIL_ZPASS_DEC (4 << 20) +# define RADEON_STENCIL_ZPASS_INVERT (5 << 20) +# define RADEON_STENCIL_ZPASS_MASK (0x7 << 20) +# define RADEON_STENCIL_ZFAIL_KEEP (0 << 24) +# define RADEON_STENCIL_ZFAIL_ZERO (1 << 24) +# define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24) +# define RADEON_STENCIL_ZFAIL_INC (3 << 24) +# define RADEON_STENCIL_ZFAIL_DEC (4 << 24) +# define RADEON_STENCIL_ZFAIL_INVERT (5 << 24) +# define RADEON_STENCIL_ZFAIL_MASK (0x7 << 24) +# define RADEON_Z_COMPRESSION_ENABLE (1 << 28) +# define RADEON_FORCE_Z_DIRTY (1 << 29) +# define RADEON_Z_WRITE_ENABLE (1 << 30) +#define RADEON_RE_LINE_PATTERN 0x1cd0 +# define RADEON_LINE_PATTERN_MASK 0x0000ffff +# define RADEON_LINE_REPEAT_COUNT_SHIFT 16 +# define RADEON_LINE_PATTERN_START_SHIFT 24 +# define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28) +# define RADEON_LINE_PATTERN_BIG_BIT_ORDER (1 << 28) +# define RADEON_LINE_PATTERN_AUTO_RESET (1 << 29) +#define RADEON_RE_LINE_STATE 0x1cd4 +# define RADEON_LINE_CURRENT_PTR_SHIFT 0 +# define RADEON_LINE_CURRENT_COUNT_SHIFT 8 +#define RADEON_RE_MISC 0x26c4 +# define RADEON_STIPPLE_COORD_MASK 0x1f +# define RADEON_STIPPLE_X_OFFSET_SHIFT 0 +# define RADEON_STIPPLE_X_OFFSET_MASK (0x1f << 0) +# define RADEON_STIPPLE_Y_OFFSET_SHIFT 8 +# define RADEON_STIPPLE_Y_OFFSET_MASK (0x1f << 8) +# define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16) +# define RADEON_STIPPLE_BIG_BIT_ORDER (1 << 16) +#define RADEON_RE_SOLID_COLOR 0x1c1c +#define RADEON_RE_TOP_LEFT 0x26c0 +# define RADEON_RE_LEFT_SHIFT 0 +# define RADEON_RE_TOP_SHIFT 16 +#define RADEON_RE_WIDTH_HEIGHT 0x1c44 +# define RADEON_RE_WIDTH_SHIFT 0 +# define RADEON_RE_HEIGHT_SHIFT 16 + +#define RADEON_SE_CNTL 0x1c4c +# define RADEON_FFACE_CULL_CW (0 << 0) +# define RADEON_FFACE_CULL_CCW (1 << 0) +# define RADEON_FFACE_CULL_DIR_MASK (1 << 0) +# define RADEON_BFACE_CULL (0 << 1) +# define RADEON_BFACE_SOLID (3 << 1) +# define RADEON_FFACE_CULL (0 << 3) +# define RADEON_FFACE_SOLID (3 << 3) +# define RADEON_FFACE_CULL_MASK (3 << 3) +# define RADEON_BADVTX_CULL_DISABLE (1 << 5) +# define RADEON_FLAT_SHADE_VTX_0 (0 << 6) +# define RADEON_FLAT_SHADE_VTX_1 (1 << 6) +# define RADEON_FLAT_SHADE_VTX_2 (2 << 6) +# define RADEON_FLAT_SHADE_VTX_LAST (3 << 6) +# define RADEON_DIFFUSE_SHADE_SOLID (0 << 8) +# define RADEON_DIFFUSE_SHADE_FLAT (1 << 8) +# define RADEON_DIFFUSE_SHADE_GOURAUD (2 << 8) +# define RADEON_DIFFUSE_SHADE_MASK (3 << 8) +# define RADEON_ALPHA_SHADE_SOLID (0 << 10) +# define RADEON_ALPHA_SHADE_FLAT (1 << 10) +# define RADEON_ALPHA_SHADE_GOURAUD (2 << 10) +# define RADEON_ALPHA_SHADE_MASK (3 << 10) +# define RADEON_SPECULAR_SHADE_SOLID (0 << 12) +# define RADEON_SPECULAR_SHADE_FLAT (1 << 12) +# define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12) +# define RADEON_SPECULAR_SHADE_MASK (3 << 12) +# define RADEON_FOG_SHADE_SOLID (0 << 14) +# define RADEON_FOG_SHADE_FLAT (1 << 14) +# define RADEON_FOG_SHADE_GOURAUD (2 << 14) +# define RADEON_FOG_SHADE_MASK (3 << 14) +# define RADEON_ZBIAS_ENABLE_POINT (1 << 16) +# define RADEON_ZBIAS_ENABLE_LINE (1 << 17) +# define RADEON_ZBIAS_ENABLE_TRI (1 << 18) +# define RADEON_WIDELINE_ENABLE (1 << 20) +# define RADEON_VPORT_XY_XFORM_ENABLE (1 << 24) +# define RADEON_VPORT_Z_XFORM_ENABLE (1 << 25) +# define RADEON_VTX_PIX_CENTER_D3D (0 << 27) +# define RADEON_VTX_PIX_CENTER_OGL (1 << 27) +# define RADEON_ROUND_MODE_TRUNC (0 << 28) +# define RADEON_ROUND_MODE_ROUND (1 << 28) +# define RADEON_ROUND_MODE_ROUND_EVEN (2 << 28) +# define RADEON_ROUND_MODE_ROUND_ODD (3 << 28) +# define RADEON_ROUND_PREC_16TH_PIX (0 << 30) +# define RADEON_ROUND_PREC_8TH_PIX (1 << 30) +# define RADEON_ROUND_PREC_4TH_PIX (2 << 30) +# define RADEON_ROUND_PREC_HALF_PIX (3 << 30) +#define R200_RE_CNTL 0x1c50 +# define R200_STIPPLE_ENABLE 0x1 +# define R200_SCISSOR_ENABLE 0x2 +# define R200_PATTERN_ENABLE 0x4 +# define R200_PERSPECTIVE_ENABLE 0x8 +# define R200_POINT_SMOOTH 0x20 +# define R200_VTX_STQ0_D3D 0x00010000 +# define R200_VTX_STQ1_D3D 0x00040000 +# define R200_VTX_STQ2_D3D 0x00100000 +# define R200_VTX_STQ3_D3D 0x00400000 +# define R200_VTX_STQ4_D3D 0x01000000 +# define R200_VTX_STQ5_D3D 0x04000000 +#define R200_RE_SCISSOR_TL_0 0x1cd8 +#define R200_RE_SCISSOR_BR_0 0x1cdc +#define R200_RE_SCISSOR_TL_1 0x1ce0 +#define R200_RE_SCISSOR_BR_1 0x1ce4 +#define R200_RE_SCISSOR_TL_2 0x1ce8 +#define R200_RE_SCISSOR_BR_2 0x1cec +# define R200_SCISSOR_X_SHIFT 0 +# define R200_SCISSOR_Y_SHIFT 16 +#define RADEON_SE_CNTL_STATUS 0x2140 +# define RADEON_VC_NO_SWAP (0 << 0) +# define RADEON_VC_16BIT_SWAP (1 << 0) +# define RADEON_VC_32BIT_SWAP (2 << 0) +# define RADEON_VC_HALF_DWORD_SWAP (3 << 0) +# define RADEON_TCL_BYPASS (1 << 8) +#define RADEON_SE_COORD_FMT 0x1c50 +# define RADEON_VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0) +# define RADEON_VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1) +# define RADEON_VTX_ST0_NONPARAMETRIC (1 << 8) +# define RADEON_VTX_ST1_NONPARAMETRIC (1 << 9) +# define RADEON_VTX_ST2_NONPARAMETRIC (1 << 10) +# define RADEON_VTX_ST3_NONPARAMETRIC (1 << 11) +# define RADEON_VTX_W0_NORMALIZE (1 << 12) +# define RADEON_VTX_W0_IS_NOT_1_OVER_W0 (1 << 16) +# define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17) +# define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19) +# define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21) +# define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23) +# define RADEON_TEX1_W_ROUTING_USE_W0 (0 << 26) +# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26) +#define RADEON_SE_LINE_WIDTH 0x1db8 +#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c +# define RADEON_LIGHTING_ENABLE (1 << 0) +# define RADEON_LIGHT_IN_MODELSPACE (1 << 1) +# define RADEON_LOCAL_VIEWER (1 << 2) +# define RADEON_NORMALIZE_NORMALS (1 << 3) +# define RADEON_RESCALE_NORMALS (1 << 4) +# define RADEON_SPECULAR_LIGHTS (1 << 5) +# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6) +# define RADEON_LIGHT_ALPHA (1 << 7) +# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8) +# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9) +# define RADEON_LM_SOURCE_STATE_PREMULT 0 +# define RADEON_LM_SOURCE_STATE_MULT 1 +# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2 +# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3 +# define RADEON_EMISSIVE_SOURCE_SHIFT 16 +# define RADEON_AMBIENT_SOURCE_SHIFT 18 +# define RADEON_DIFFUSE_SOURCE_SHIFT 20 +# define RADEON_SPECULAR_SOURCE_SHIFT 22 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228 +#define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED 0x2230 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238 +#define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218 +#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c +#define RADEON_SE_TCL_MATERIAL_SPECULAR_RED 0x2240 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248 +#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c +#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c +# define RADEON_MODELVIEW_0_SHIFT 0 +# define RADEON_MODELVIEW_1_SHIFT 4 +# define RADEON_MODELVIEW_2_SHIFT 8 +# define RADEON_MODELVIEW_3_SHIFT 12 +# define RADEON_IT_MODELVIEW_0_SHIFT 16 +# define RADEON_IT_MODELVIEW_1_SHIFT 20 +# define RADEON_IT_MODELVIEW_2_SHIFT 24 +# define RADEON_IT_MODELVIEW_3_SHIFT 28 +#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260 +# define RADEON_MODELPROJECT_0_SHIFT 0 +# define RADEON_MODELPROJECT_1_SHIFT 4 +# define RADEON_MODELPROJECT_2_SHIFT 8 +# define RADEON_MODELPROJECT_3_SHIFT 12 +# define RADEON_TEXMAT_0_SHIFT 16 +# define RADEON_TEXMAT_1_SHIFT 20 +# define RADEON_TEXMAT_2_SHIFT 24 +# define RADEON_TEXMAT_3_SHIFT 28 + + +#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254 +# define RADEON_TCL_VTX_W0 (1 << 0) +# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1) +# define RADEON_TCL_VTX_FP_ALPHA (1 << 2) +# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3) +# define RADEON_TCL_VTX_FP_SPEC (1 << 4) +# define RADEON_TCL_VTX_FP_FOG (1 << 5) +# define RADEON_TCL_VTX_PK_SPEC (1 << 6) +# define RADEON_TCL_VTX_ST0 (1 << 7) +# define RADEON_TCL_VTX_ST1 (1 << 8) +# define RADEON_TCL_VTX_Q1 (1 << 9) +# define RADEON_TCL_VTX_ST2 (1 << 10) +# define RADEON_TCL_VTX_Q2 (1 << 11) +# define RADEON_TCL_VTX_ST3 (1 << 12) +# define RADEON_TCL_VTX_Q3 (1 << 13) +# define RADEON_TCL_VTX_Q0 (1 << 14) +# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15 +# define RADEON_TCL_VTX_NORM0 (1 << 18) +# define RADEON_TCL_VTX_XY1 (1 << 27) +# define RADEON_TCL_VTX_Z1 (1 << 28) +# define RADEON_TCL_VTX_W1 (1 << 29) +# define RADEON_TCL_VTX_NORM1 (1 << 30) +# define RADEON_TCL_VTX_Z0 (1 << 31) + +#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258 +# define RADEON_TCL_COMPUTE_XYZW (1 << 0) +# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1) +# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2) +# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3) +# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4) +# define RADEON_TCL_TEX_INPUT_TEX_0 0 +# define RADEON_TCL_TEX_INPUT_TEX_1 1 +# define RADEON_TCL_TEX_INPUT_TEX_2 2 +# define RADEON_TCL_TEX_INPUT_TEX_3 3 +# define RADEON_TCL_TEX_COMPUTED_TEX_0 8 +# define RADEON_TCL_TEX_COMPUTED_TEX_1 9 +# define RADEON_TCL_TEX_COMPUTED_TEX_2 10 +# define RADEON_TCL_TEX_COMPUTED_TEX_3 11 +# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16 +# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20 +# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24 +# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28 + +#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270 +# define RADEON_LIGHT_0_ENABLE (1 << 0) +# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1) +# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2) +# define RADEON_LIGHT_0_IS_LOCAL (1 << 3) +# define RADEON_LIGHT_0_IS_SPOT (1 << 4) +# define RADEON_LIGHT_0_DUAL_CONE (1 << 5) +# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6) +# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7) +# define RADEON_LIGHT_0_SHIFT 0 +# define RADEON_LIGHT_1_ENABLE (1 << 16) +# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17) +# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18) +# define RADEON_LIGHT_1_IS_LOCAL (1 << 19) +# define RADEON_LIGHT_1_IS_SPOT (1 << 20) +# define RADEON_LIGHT_1_DUAL_CONE (1 << 21) +# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22) +# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23) +# define RADEON_LIGHT_1_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274 +# define RADEON_LIGHT_2_SHIFT 0 +# define RADEON_LIGHT_3_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278 +# define RADEON_LIGHT_4_SHIFT 0 +# define RADEON_LIGHT_5_SHIFT 16 +#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c +# define RADEON_LIGHT_6_SHIFT 0 +# define RADEON_LIGHT_7_SHIFT 16 + +#define RADEON_SE_TCL_SHININESS 0x2250 + +#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268 +# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0) +# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1) +# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2) +# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3) +# define RADEON_TEXMAT_0_ENABLE (1 << 4) +# define RADEON_TEXMAT_1_ENABLE (1 << 5) +# define RADEON_TEXMAT_2_ENABLE (1 << 6) +# define RADEON_TEXMAT_3_ENABLE (1 << 7) +# define RADEON_TEXGEN_INPUT_MASK 0xf +# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0 +# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1 +# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2 +# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3 +# define RADEON_TEXGEN_INPUT_OBJ 4 +# define RADEON_TEXGEN_INPUT_EYE 5 +# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6 +# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7 +# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8 +# define RADEON_TEXGEN_0_INPUT_SHIFT 16 +# define RADEON_TEXGEN_1_INPUT_SHIFT 20 +# define RADEON_TEXGEN_2_INPUT_SHIFT 24 +# define RADEON_TEXGEN_3_INPUT_SHIFT 28 + +#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264 +# define RADEON_UCP_IN_CLIP_SPACE (1 << 0) +# define RADEON_UCP_IN_MODEL_SPACE (1 << 1) +# define RADEON_UCP_ENABLE_0 (1 << 2) +# define RADEON_UCP_ENABLE_1 (1 << 3) +# define RADEON_UCP_ENABLE_2 (1 << 4) +# define RADEON_UCP_ENABLE_3 (1 << 5) +# define RADEON_UCP_ENABLE_4 (1 << 6) +# define RADEON_UCP_ENABLE_5 (1 << 7) +# define RADEON_TCL_FOG_MASK (3 << 8) +# define RADEON_TCL_FOG_DISABLE (0 << 8) +# define RADEON_TCL_FOG_EXP (1 << 8) +# define RADEON_TCL_FOG_EXP2 (2 << 8) +# define RADEON_TCL_FOG_LINEAR (3 << 8) +# define RADEON_RNG_BASED_FOG (1 << 10) +# define RADEON_LIGHT_TWOSIDE (1 << 11) +# define RADEON_BLEND_OP_COUNT_MASK (7 << 12) +# define RADEON_BLEND_OP_COUNT_SHIFT 12 +# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16) +# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17) +# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (1 << 18) +# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18) +# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (1 << 19) +# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19) +# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (1 << 20) +# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20) +# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (1 << 21) +# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21) +# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22) +# define RADEON_CULL_FRONT_IS_CW (0 << 28) +# define RADEON_CULL_FRONT_IS_CCW (1 << 28) +# define RADEON_CULL_FRONT (1 << 29) +# define RADEON_CULL_BACK (1 << 30) +# define RADEON_FORCE_W_TO_ONE (1 << 31) + +#define RADEON_SE_VPORT_XSCALE 0x1d98 +#define RADEON_SE_VPORT_XOFFSET 0x1d9c +#define RADEON_SE_VPORT_YSCALE 0x1da0 +#define RADEON_SE_VPORT_YOFFSET 0x1da4 +#define RADEON_SE_VPORT_ZSCALE 0x1da8 +#define RADEON_SE_VPORT_ZOFFSET 0x1dac +#define RADEON_SE_ZBIAS_FACTOR 0x1db0 +#define RADEON_SE_ZBIAS_CONSTANT 0x1db4 + +#define RADEON_SE_VTX_FMT 0x2080 +# define RADEON_SE_VTX_FMT_XY 0x00000000 +# define RADEON_SE_VTX_FMT_W0 0x00000001 +# define RADEON_SE_VTX_FMT_FPCOLOR 0x00000002 +# define RADEON_SE_VTX_FMT_FPALPHA 0x00000004 +# define RADEON_SE_VTX_FMT_PKCOLOR 0x00000008 +# define RADEON_SE_VTX_FMT_FPSPEC 0x00000010 +# define RADEON_SE_VTX_FMT_FPFOG 0x00000020 +# define RADEON_SE_VTX_FMT_PKSPEC 0x00000040 +# define RADEON_SE_VTX_FMT_ST0 0x00000080 +# define RADEON_SE_VTX_FMT_ST1 0x00000100 +# define RADEON_SE_VTX_FMT_Q1 0x00000200 +# define RADEON_SE_VTX_FMT_ST2 0x00000400 +# define RADEON_SE_VTX_FMT_Q2 0x00000800 +# define RADEON_SE_VTX_FMT_ST3 0x00001000 +# define RADEON_SE_VTX_FMT_Q3 0x00002000 +# define RADEON_SE_VTX_FMT_Q0 0x00004000 +# define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000 +# define RADEON_SE_VTX_FMT_N0 0x00040000 +# define RADEON_SE_VTX_FMT_XY1 0x08000000 +# define RADEON_SE_VTX_FMT_Z1 0x10000000 +# define RADEON_SE_VTX_FMT_W1 0x20000000 +# define RADEON_SE_VTX_FMT_N1 0x40000000 +# define RADEON_SE_VTX_FMT_Z 0x80000000 + +#define RADEON_SE_VF_CNTL 0x2084 +# define RADEON_VF_PRIM_TYPE_POINT_LIST 1 +# define RADEON_VF_PRIM_TYPE_LINE_LIST 2 +# define RADEON_VF_PRIM_TYPE_LINE_STRIP 3 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_LIST 4 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_FAN 5 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_STRIP 6 +# define RADEON_VF_PRIM_TYPE_TRIANGLE_FLAG 7 +# define RADEON_VF_PRIM_TYPE_RECTANGLE_LIST 8 +# define RADEON_VF_PRIM_TYPE_POINT_LIST_3 9 +# define RADEON_VF_PRIM_TYPE_LINE_LIST_3 10 +# define RADEON_VF_PRIM_TYPE_SPIRIT_LIST 11 +# define RADEON_VF_PRIM_TYPE_LINE_LOOP 12 +# define RADEON_VF_PRIM_TYPE_QUAD_LIST 13 +# define RADEON_VF_PRIM_TYPE_QUAD_STRIP 14 +# define RADEON_VF_PRIM_TYPE_POLYGON 15 +# define RADEON_VF_PRIM_WALK_STATE (0<<4) +# define RADEON_VF_PRIM_WALK_INDEX (1<<4) +# define RADEON_VF_PRIM_WALK_LIST (2<<4) +# define RADEON_VF_PRIM_WALK_DATA (3<<4) +# define RADEON_VF_COLOR_ORDER_RGBA (1<<6) +# define RADEON_VF_RADEON_MODE (1<<8) +# define RADEON_VF_TCL_OUTPUT_CTL_ENA (1<<9) +# define RADEON_VF_PROG_STREAM_ENA (1<<10) +# define RADEON_VF_INDEX_SIZE_SHIFT 11 +# define RADEON_VF_NUM_VERTICES_SHIFT 16 + +#define RADEON_SE_PORT_DATA0 0x2000 + +#define R200_SE_VAP_CNTL 0x2080 +# define R200_VAP_TCL_ENABLE 0x00000001 +# define R200_VAP_SINGLE_BUF_STATE_ENABLE 0x00000010 +# define R200_VAP_FORCE_W_TO_ONE 0x00010000 +# define R200_VAP_D3D_TEX_DEFAULT 0x00020000 +# define R200_VAP_VF_MAX_VTX_NUM__SHIFT 18 +# define R200_VAP_VF_MAX_VTX_NUM (9 << 18) +# define R200_VAP_DX_CLIP_SPACE_DEF 0x00400000 +#define R200_VF_MAX_VTX_INDX 0x210c +#define R200_VF_MIN_VTX_INDX 0x2110 +#define R200_SE_VTE_CNTL 0x20b0 +# define R200_VPORT_X_SCALE_ENA 0x00000001 +# define R200_VPORT_X_OFFSET_ENA 0x00000002 +# define R200_VPORT_Y_SCALE_ENA 0x00000004 +# define R200_VPORT_Y_OFFSET_ENA 0x00000008 +# define R200_VPORT_Z_SCALE_ENA 0x00000010 +# define R200_VPORT_Z_OFFSET_ENA 0x00000020 +# define R200_VTX_XY_FMT 0x00000100 +# define R200_VTX_Z_FMT 0x00000200 +# define R200_VTX_W0_FMT 0x00000400 +# define R200_VTX_W0_NORMALIZE 0x00000800 +# define R200_VTX_ST_DENORMALIZED 0x00001000 +#define R200_SE_VAP_CNTL_STATUS 0x2140 +# define R200_VC_NO_SWAP (0 << 0) +# define R200_VC_16BIT_SWAP (1 << 0) +# define R200_VC_32BIT_SWAP (2 << 0) +#define R200_RE_AUX_SCISSOR_CNTL 0x26f0 +# define R200_EXCLUSIVE_SCISSOR_0 0x01000000 +# define R200_EXCLUSIVE_SCISSOR_1 0x02000000 +# define R200_EXCLUSIVE_SCISSOR_2 0x04000000 +# define R200_SCISSOR_ENABLE_0 0x10000000 +# define R200_SCISSOR_ENABLE_1 0x20000000 +# define R200_SCISSOR_ENABLE_2 0x40000000 +#define R200_PP_TXFILTER_0 0x2c00 +#define R200_PP_TXFILTER_1 0x2c20 +#define R200_PP_TXFILTER_2 0x2c40 +#define R200_PP_TXFILTER_3 0x2c60 +#define R200_PP_TXFILTER_4 0x2c80 +#define R200_PP_TXFILTER_5 0x2ca0 +# define R200_MAG_FILTER_NEAREST (0 << 0) +# define R200_MAG_FILTER_LINEAR (1 << 0) +# define R200_MAG_FILTER_MASK (1 << 0) +# define R200_MIN_FILTER_NEAREST (0 << 1) +# define R200_MIN_FILTER_LINEAR (1 << 1) +# define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1) +# define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1) +# define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1) +# define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST (8 << 1) +# define R200_MIN_FILTER_ANISO_LINEAR (9 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1) +# define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1) +# define R200_MIN_FILTER_MASK (15 << 1) +# define R200_MAX_ANISO_1_TO_1 (0 << 5) +# define R200_MAX_ANISO_2_TO_1 (1 << 5) +# define R200_MAX_ANISO_4_TO_1 (2 << 5) +# define R200_MAX_ANISO_8_TO_1 (3 << 5) +# define R200_MAX_ANISO_16_TO_1 (4 << 5) +# define R200_MAX_ANISO_MASK (7 << 5) +# define R200_MAX_MIP_LEVEL_MASK (0x0f << 16) +# define R200_MAX_MIP_LEVEL_SHIFT 16 +# define R200_YUV_TO_RGB (1 << 20) +# define R200_YUV_TEMPERATURE_COOL (0 << 21) +# define R200_YUV_TEMPERATURE_HOT (1 << 21) +# define R200_YUV_TEMPERATURE_MASK (1 << 21) +# define R200_WRAPEN_S (1 << 22) +# define R200_CLAMP_S_WRAP (0 << 23) +# define R200_CLAMP_S_MIRROR (1 << 23) +# define R200_CLAMP_S_CLAMP_LAST (2 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23) +# define R200_CLAMP_S_CLAMP_BORDER (4 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23) +# define R200_CLAMP_S_CLAMP_GL (6 << 23) +# define R200_CLAMP_S_MIRROR_CLAMP_GL (7 << 23) +# define R200_CLAMP_S_MASK (7 << 23) +# define R200_WRAPEN_T (1 << 26) +# define R200_CLAMP_T_WRAP (0 << 27) +# define R200_CLAMP_T_MIRROR (1 << 27) +# define R200_CLAMP_T_CLAMP_LAST (2 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27) +# define R200_CLAMP_T_CLAMP_BORDER (4 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27) +# define R200_CLAMP_T_CLAMP_GL (6 << 27) +# define R200_CLAMP_T_MIRROR_CLAMP_GL (7 << 27) +# define R200_CLAMP_T_MASK (7 << 27) +# define R200_KILL_LT_ZERO (1 << 30) +# define R200_BORDER_MODE_OGL (0 << 31) +# define R200_BORDER_MODE_D3D (1 << 31) +#define R200_PP_TXFORMAT_0 0x2c04 +#define R200_PP_TXFORMAT_1 0x2c24 +#define R200_PP_TXFORMAT_2 0x2c44 +#define R200_PP_TXFORMAT_3 0x2c64 +#define R200_PP_TXFORMAT_4 0x2c84 +#define R200_PP_TXFORMAT_5 0x2ca4 +# define R200_TXFORMAT_I8 (0 << 0) +# define R200_TXFORMAT_AI88 (1 << 0) +# define R200_TXFORMAT_RGB332 (2 << 0) +# define R200_TXFORMAT_ARGB1555 (3 << 0) +# define R200_TXFORMAT_RGB565 (4 << 0) +# define R200_TXFORMAT_ARGB4444 (5 << 0) +# define R200_TXFORMAT_ARGB8888 (6 << 0) +# define R200_TXFORMAT_RGBA8888 (7 << 0) +# define R200_TXFORMAT_Y8 (8 << 0) +# define R200_TXFORMAT_AVYU4444 (9 << 0) +# define R200_TXFORMAT_VYUY422 (10 << 0) +# define R200_TXFORMAT_YVYU422 (11 << 0) +# define R200_TXFORMAT_DXT1 (12 << 0) +# define R200_TXFORMAT_DXT23 (14 << 0) +# define R200_TXFORMAT_DXT45 (15 << 0) +# define R200_TXFORMAT_ABGR8888 (22 << 0) +# define R200_TXFORMAT_FORMAT_MASK (31 << 0) +# define R200_TXFORMAT_FORMAT_SHIFT 0 +# define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6) +# define R200_TXFORMAT_NON_POWER2 (1 << 7) +# define R200_TXFORMAT_WIDTH_MASK (15 << 8) +# define R200_TXFORMAT_WIDTH_SHIFT 8 +# define R200_TXFORMAT_HEIGHT_MASK (15 << 12) +# define R200_TXFORMAT_HEIGHT_SHIFT 12 +# define R200_TXFORMAT_F5_WIDTH_MASK (15 << 16) /* cube face 5 */ +# define R200_TXFORMAT_F5_WIDTH_SHIFT 16 +# define R200_TXFORMAT_F5_HEIGHT_MASK (15 << 20) +# define R200_TXFORMAT_F5_HEIGHT_SHIFT 20 +# define R200_TXFORMAT_ST_ROUTE_STQ0 (0 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ1 (1 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ2 (2 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ3 (3 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ4 (4 << 24) +# define R200_TXFORMAT_ST_ROUTE_STQ5 (5 << 24) +# define R200_TXFORMAT_ST_ROUTE_MASK (7 << 24) +# define R200_TXFORMAT_ST_ROUTE_SHIFT 24 +# define R200_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28) +# define R200_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29) +# define R200_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30) +#define R200_PP_TXFORMAT_X_0 0x2c08 +#define R200_PP_TXFORMAT_X_1 0x2c28 +#define R200_PP_TXFORMAT_X_2 0x2c48 +#define R200_PP_TXFORMAT_X_3 0x2c68 +#define R200_PP_TXFORMAT_X_4 0x2c88 +#define R200_PP_TXFORMAT_X_5 0x2ca8 + +#define R200_PP_TXSIZE_0 0x2c0c /* NPOT only */ +#define R200_PP_TXSIZE_1 0x2c2c /* NPOT only */ +#define R200_PP_TXSIZE_2 0x2c4c /* NPOT only */ +#define R200_PP_TXSIZE_3 0x2c6c /* NPOT only */ +#define R200_PP_TXSIZE_4 0x2c8c /* NPOT only */ +#define R200_PP_TXSIZE_5 0x2cac /* NPOT only */ + +#define R200_PP_TXPITCH_0 0x2c10 /* NPOT only */ +#define R200_PP_TXPITCH_1 0x2c30 /* NPOT only */ +#define R200_PP_TXPITCH_2 0x2c50 /* NPOT only */ +#define R200_PP_TXPITCH_3 0x2c70 /* NPOT only */ +#define R200_PP_TXPITCH_4 0x2c90 /* NPOT only */ +#define R200_PP_TXPITCH_5 0x2cb0 /* NPOT only */ + +#define R200_PP_TXOFFSET_0 0x2d00 +# define R200_TXO_ENDIAN_NO_SWAP (0 << 0) +# define R200_TXO_ENDIAN_BYTE_SWAP (1 << 0) +# define R200_TXO_ENDIAN_WORD_SWAP (2 << 0) +# define R200_TXO_ENDIAN_HALFDW_SWAP (3 << 0) +# define R200_TXO_MACRO_LINEAR (0 << 2) +# define R200_TXO_MACRO_TILE (1 << 2) +# define R200_TXO_MICRO_LINEAR (0 << 3) +# define R200_TXO_MICRO_TILE (1 << 3) +# define R200_TXO_OFFSET_MASK 0xffffffe0 +# define R200_TXO_OFFSET_SHIFT 5 +#define R200_PP_TXOFFSET_1 0x2d18 +#define R200_PP_TXOFFSET_2 0x2d30 +#define R200_PP_TXOFFSET_3 0x2d48 +#define R200_PP_TXOFFSET_4 0x2d60 +#define R200_PP_TXOFFSET_5 0x2d78 + +#define R200_PP_TFACTOR_0 0x2ee0 +#define R200_PP_TFACTOR_1 0x2ee4 +#define R200_PP_TFACTOR_2 0x2ee8 +#define R200_PP_TFACTOR_3 0x2eec +#define R200_PP_TFACTOR_4 0x2ef0 +#define R200_PP_TFACTOR_5 0x2ef4 + +#define R200_PP_TXCBLEND_0 0x2f00 +# define R200_TXC_ARG_A_ZERO (0) +# define R200_TXC_ARG_A_CURRENT_COLOR (2) +# define R200_TXC_ARG_A_CURRENT_ALPHA (3) +# define R200_TXC_ARG_A_DIFFUSE_COLOR (4) +# define R200_TXC_ARG_A_DIFFUSE_ALPHA (5) +# define R200_TXC_ARG_A_SPECULAR_COLOR (6) +# define R200_TXC_ARG_A_SPECULAR_ALPHA (7) +# define R200_TXC_ARG_A_TFACTOR_COLOR (8) +# define R200_TXC_ARG_A_TFACTOR_ALPHA (9) +# define R200_TXC_ARG_A_R0_COLOR (10) +# define R200_TXC_ARG_A_R0_ALPHA (11) +# define R200_TXC_ARG_A_R1_COLOR (12) +# define R200_TXC_ARG_A_R1_ALPHA (13) +# define R200_TXC_ARG_A_R2_COLOR (14) +# define R200_TXC_ARG_A_R2_ALPHA (15) +# define R200_TXC_ARG_A_R3_COLOR (16) +# define R200_TXC_ARG_A_R3_ALPHA (17) +# define R200_TXC_ARG_A_R4_COLOR (18) +# define R200_TXC_ARG_A_R4_ALPHA (19) +# define R200_TXC_ARG_A_R5_COLOR (20) +# define R200_TXC_ARG_A_R5_ALPHA (21) +# define R200_TXC_ARG_A_TFACTOR1_COLOR (26) +# define R200_TXC_ARG_A_TFACTOR1_ALPHA (27) +# define R200_TXC_ARG_A_MASK (31 << 0) +# define R200_TXC_ARG_A_SHIFT 0 +# define R200_TXC_ARG_B_ZERO (0 << 5) +# define R200_TXC_ARG_B_CURRENT_COLOR (2 << 5) +# define R200_TXC_ARG_B_CURRENT_ALPHA (3 << 5) +# define R200_TXC_ARG_B_DIFFUSE_COLOR (4 << 5) +# define R200_TXC_ARG_B_DIFFUSE_ALPHA (5 << 5) +# define R200_TXC_ARG_B_SPECULAR_COLOR (6 << 5) +# define R200_TXC_ARG_B_SPECULAR_ALPHA (7 << 5) +# define R200_TXC_ARG_B_TFACTOR_COLOR (8 << 5) +# define R200_TXC_ARG_B_TFACTOR_ALPHA (9 << 5) +# define R200_TXC_ARG_B_R0_COLOR (10 << 5) +# define R200_TXC_ARG_B_R0_ALPHA (11 << 5) +# define R200_TXC_ARG_B_R1_COLOR (12 << 5) +# define R200_TXC_ARG_B_R1_ALPHA (13 << 5) +# define R200_TXC_ARG_B_R2_COLOR (14 << 5) +# define R200_TXC_ARG_B_R2_ALPHA (15 << 5) +# define R200_TXC_ARG_B_R3_COLOR (16 << 5) +# define R200_TXC_ARG_B_R3_ALPHA (17 << 5) +# define R200_TXC_ARG_B_R4_COLOR (18 << 5) +# define R200_TXC_ARG_B_R4_ALPHA (19 << 5) +# define R200_TXC_ARG_B_R5_COLOR (20 << 5) +# define R200_TXC_ARG_B_R5_ALPHA (21 << 5) +# define R200_TXC_ARG_B_TFACTOR1_COLOR (26 << 5) +# define R200_TXC_ARG_B_TFACTOR1_ALPHA (27 << 5) +# define R200_TXC_ARG_B_MASK (31 << 5) +# define R200_TXC_ARG_B_SHIFT 5 +# define R200_TXC_ARG_C_ZERO (0 << 10) +# define R200_TXC_ARG_C_CURRENT_COLOR (2 << 10) +# define R200_TXC_ARG_C_CURRENT_ALPHA (3 << 10) +# define R200_TXC_ARG_C_DIFFUSE_COLOR (4 << 10) +# define R200_TXC_ARG_C_DIFFUSE_ALPHA (5 << 10) +# define R200_TXC_ARG_C_SPECULAR_COLOR (6 << 10) +# define R200_TXC_ARG_C_SPECULAR_ALPHA (7 << 10) +# define R200_TXC_ARG_C_TFACTOR_COLOR (8 << 10) +# define R200_TXC_ARG_C_TFACTOR_ALPHA (9 << 10) +# define R200_TXC_ARG_C_R0_COLOR (10 << 10) +# define R200_TXC_ARG_C_R0_ALPHA (11 << 10) +# define R200_TXC_ARG_C_R1_COLOR (12 << 10) +# define R200_TXC_ARG_C_R1_ALPHA (13 << 10) +# define R200_TXC_ARG_C_R2_COLOR (14 << 10) +# define R200_TXC_ARG_C_R2_ALPHA (15 << 10) +# define R200_TXC_ARG_C_R3_COLOR (16 << 10) +# define R200_TXC_ARG_C_R3_ALPHA (17 << 10) +# define R200_TXC_ARG_C_R4_COLOR (18 << 10) +# define R200_TXC_ARG_C_R4_ALPHA (19 << 10) +# define R200_TXC_ARG_C_R5_COLOR (20 << 10) +# define R200_TXC_ARG_C_R5_ALPHA (21 << 10) +# define R200_TXC_ARG_C_TFACTOR1_COLOR (26 << 10) +# define R200_TXC_ARG_C_TFACTOR1_ALPHA (27 << 10) +# define R200_TXC_ARG_C_MASK (31 << 10) +# define R200_TXC_ARG_C_SHIFT 10 +# define R200_TXC_COMP_ARG_A (1 << 16) +# define R200_TXC_COMP_ARG_A_SHIFT (16) +# define R200_TXC_BIAS_ARG_A (1 << 17) +# define R200_TXC_SCALE_ARG_A (1 << 18) +# define R200_TXC_NEG_ARG_A (1 << 19) +# define R200_TXC_COMP_ARG_B (1 << 20) +# define R200_TXC_COMP_ARG_B_SHIFT (20) +# define R200_TXC_BIAS_ARG_B (1 << 21) +# define R200_TXC_SCALE_ARG_B (1 << 22) +# define R200_TXC_NEG_ARG_B (1 << 23) +# define R200_TXC_COMP_ARG_C (1 << 24) +# define R200_TXC_COMP_ARG_C_SHIFT (24) +# define R200_TXC_BIAS_ARG_C (1 << 25) +# define R200_TXC_SCALE_ARG_C (1 << 26) +# define R200_TXC_NEG_ARG_C (1 << 27) +# define R200_TXC_OP_MADD (0 << 28) +# define R200_TXC_OP_CND0 (2 << 28) +# define R200_TXC_OP_LERP (3 << 28) +# define R200_TXC_OP_DOT3 (4 << 28) +# define R200_TXC_OP_DOT4 (5 << 28) +# define R200_TXC_OP_CONDITIONAL (6 << 28) +# define R200_TXC_OP_DOT2_ADD (7 << 28) +# define R200_TXC_OP_MASK (7 << 28) +#define R200_PP_TXCBLEND2_0 0x2f04 +# define R200_TXC_TFACTOR_SEL_SHIFT 0 +# define R200_TXC_TFACTOR_SEL_MASK 0x7 +# define R200_TXC_TFACTOR1_SEL_SHIFT 4 +# define R200_TXC_TFACTOR1_SEL_MASK (0x7 << 4) +# define R200_TXC_SCALE_SHIFT 8 +# define R200_TXC_SCALE_MASK (7 << 8) +# define R200_TXC_SCALE_1X (0 << 8) +# define R200_TXC_SCALE_2X (1 << 8) +# define R200_TXC_SCALE_4X (2 << 8) +# define R200_TXC_SCALE_8X (3 << 8) +# define R200_TXC_SCALE_INV2 (5 << 8) +# define R200_TXC_SCALE_INV4 (6 << 8) +# define R200_TXC_SCALE_INV8 (7 << 8) +# define R200_TXC_CLAMP_SHIFT 12 +# define R200_TXC_CLAMP_MASK (3 << 12) +# define R200_TXC_CLAMP_WRAP (0 << 12) +# define R200_TXC_CLAMP_0_1 (1 << 12) +# define R200_TXC_CLAMP_8_8 (2 << 12) +# define R200_TXC_OUTPUT_REG_MASK (7 << 16) +# define R200_TXC_OUTPUT_REG_NONE (0 << 16) +# define R200_TXC_OUTPUT_REG_R0 (1 << 16) +# define R200_TXC_OUTPUT_REG_R1 (2 << 16) +# define R200_TXC_OUTPUT_REG_R2 (3 << 16) +# define R200_TXC_OUTPUT_REG_R3 (4 << 16) +# define R200_TXC_OUTPUT_REG_R4 (5 << 16) +# define R200_TXC_OUTPUT_REG_R5 (6 << 16) +# define R200_TXC_OUTPUT_MASK_MASK (7 << 20) +# define R200_TXC_OUTPUT_MASK_RGB (0 << 20) +# define R200_TXC_OUTPUT_MASK_RG (1 << 20) +# define R200_TXC_OUTPUT_MASK_RB (2 << 20) +# define R200_TXC_OUTPUT_MASK_R (3 << 20) +# define R200_TXC_OUTPUT_MASK_GB (4 << 20) +# define R200_TXC_OUTPUT_MASK_G (5 << 20) +# define R200_TXC_OUTPUT_MASK_B (6 << 20) +# define R200_TXC_OUTPUT_MASK_NONE (7 << 20) +# define R200_TXC_REPL_NORMAL 0 +# define R200_TXC_REPL_RED 1 +# define R200_TXC_REPL_GREEN 2 +# define R200_TXC_REPL_BLUE 3 +# define R200_TXC_REPL_ARG_A_SHIFT 26 +# define R200_TXC_REPL_ARG_A_MASK (3 << 26) +# define R200_TXC_REPL_ARG_B_SHIFT 28 +# define R200_TXC_REPL_ARG_B_MASK (3 << 28) +# define R200_TXC_REPL_ARG_C_SHIFT 30 +# define R200_TXC_REPL_ARG_C_MASK (3 << 30) +#define R200_PP_TXABLEND_0 0x2f08 +# define R200_TXA_ARG_A_ZERO (0) +# define R200_TXA_ARG_A_CURRENT_ALPHA (2) /* guess */ +# define R200_TXA_ARG_A_CURRENT_BLUE (3) /* guess */ +# define R200_TXA_ARG_A_DIFFUSE_ALPHA (4) +# define R200_TXA_ARG_A_DIFFUSE_BLUE (5) +# define R200_TXA_ARG_A_SPECULAR_ALPHA (6) +# define R200_TXA_ARG_A_SPECULAR_BLUE (7) +# define R200_TXA_ARG_A_TFACTOR_ALPHA (8) +# define R200_TXA_ARG_A_TFACTOR_BLUE (9) +# define R200_TXA_ARG_A_R0_ALPHA (10) +# define R200_TXA_ARG_A_R0_BLUE (11) +# define R200_TXA_ARG_A_R1_ALPHA (12) +# define R200_TXA_ARG_A_R1_BLUE (13) +# define R200_TXA_ARG_A_R2_ALPHA (14) +# define R200_TXA_ARG_A_R2_BLUE (15) +# define R200_TXA_ARG_A_R3_ALPHA (16) +# define R200_TXA_ARG_A_R3_BLUE (17) +# define R200_TXA_ARG_A_R4_ALPHA (18) +# define R200_TXA_ARG_A_R4_BLUE (19) +# define R200_TXA_ARG_A_R5_ALPHA (20) +# define R200_TXA_ARG_A_R5_BLUE (21) +# define R200_TXA_ARG_A_TFACTOR1_ALPHA (26) +# define R200_TXA_ARG_A_TFACTOR1_BLUE (27) +# define R200_TXA_ARG_A_MASK (31 << 0) +# define R200_TXA_ARG_A_SHIFT 0 +# define R200_TXA_ARG_B_ZERO (0 << 5) +# define R200_TXA_ARG_B_CURRENT_ALPHA (2 << 5) /* guess */ +# define R200_TXA_ARG_B_CURRENT_BLUE (3 << 5) /* guess */ +# define R200_TXA_ARG_B_DIFFUSE_ALPHA (4 << 5) +# define R200_TXA_ARG_B_DIFFUSE_BLUE (5 << 5) +# define R200_TXA_ARG_B_SPECULAR_ALPHA (6 << 5) +# define R200_TXA_ARG_B_SPECULAR_BLUE (7 << 5) +# define R200_TXA_ARG_B_TFACTOR_ALPHA (8 << 5) +# define R200_TXA_ARG_B_TFACTOR_BLUE (9 << 5) +# define R200_TXA_ARG_B_R0_ALPHA (10 << 5) +# define R200_TXA_ARG_B_R0_BLUE (11 << 5) +# define R200_TXA_ARG_B_R1_ALPHA (12 << 5) +# define R200_TXA_ARG_B_R1_BLUE (13 << 5) +# define R200_TXA_ARG_B_R2_ALPHA (14 << 5) +# define R200_TXA_ARG_B_R2_BLUE (15 << 5) +# define R200_TXA_ARG_B_R3_ALPHA (16 << 5) +# define R200_TXA_ARG_B_R3_BLUE (17 << 5) +# define R200_TXA_ARG_B_R4_ALPHA (18 << 5) +# define R200_TXA_ARG_B_R4_BLUE (19 << 5) +# define R200_TXA_ARG_B_R5_ALPHA (20 << 5) +# define R200_TXA_ARG_B_R5_BLUE (21 << 5) +# define R200_TXA_ARG_B_TFACTOR1_ALPHA (26 << 5) +# define R200_TXA_ARG_B_TFACTOR1_BLUE (27 << 5) +# define R200_TXA_ARG_B_MASK (31 << 5) +# define R200_TXA_ARG_B_SHIFT 5 +# define R200_TXA_ARG_C_ZERO (0 << 10) +# define R200_TXA_ARG_C_CURRENT_ALPHA (2 << 10) /* guess */ +# define R200_TXA_ARG_C_CURRENT_BLUE (3 << 10) /* guess */ +# define R200_TXA_ARG_C_DIFFUSE_ALPHA (4 << 10) +# define R200_TXA_ARG_C_DIFFUSE_BLUE (5 << 10) +# define R200_TXA_ARG_C_SPECULAR_ALPHA (6 << 10) +# define R200_TXA_ARG_C_SPECULAR_BLUE (7 << 10) +# define R200_TXA_ARG_C_TFACTOR_ALPHA (8 << 10) +# define R200_TXA_ARG_C_TFACTOR_BLUE (9 << 10) +# define R200_TXA_ARG_C_R0_ALPHA (10 << 10) +# define R200_TXA_ARG_C_R0_BLUE (11 << 10) +# define R200_TXA_ARG_C_R1_ALPHA (12 << 10) +# define R200_TXA_ARG_C_R1_BLUE (13 << 10) +# define R200_TXA_ARG_C_R2_ALPHA (14 << 10) +# define R200_TXA_ARG_C_R2_BLUE (15 << 10) +# define R200_TXA_ARG_C_R3_ALPHA (16 << 10) +# define R200_TXA_ARG_C_R3_BLUE (17 << 10) +# define R200_TXA_ARG_C_R4_ALPHA (18 << 10) +# define R200_TXA_ARG_C_R4_BLUE (19 << 10) +# define R200_TXA_ARG_C_R5_ALPHA (20 << 10) +# define R200_TXA_ARG_C_R5_BLUE (21 << 10) +# define R200_TXA_ARG_C_TFACTOR1_ALPHA (26 << 10) +# define R200_TXA_ARG_C_TFACTOR1_BLUE (27 << 10) +# define R200_TXA_ARG_C_MASK (31 << 10) +# define R200_TXA_ARG_C_SHIFT 10 +# define R200_TXA_COMP_ARG_A (1 << 16) +# define R200_TXA_COMP_ARG_A_SHIFT (16) +# define R200_TXA_BIAS_ARG_A (1 << 17) +# define R200_TXA_SCALE_ARG_A (1 << 18) +# define R200_TXA_NEG_ARG_A (1 << 19) +# define R200_TXA_COMP_ARG_B (1 << 20) +# define R200_TXA_COMP_ARG_B_SHIFT (20) +# define R200_TXA_BIAS_ARG_B (1 << 21) +# define R200_TXA_SCALE_ARG_B (1 << 22) +# define R200_TXA_NEG_ARG_B (1 << 23) +# define R200_TXA_COMP_ARG_C (1 << 24) +# define R200_TXA_COMP_ARG_C_SHIFT (24) +# define R200_TXA_BIAS_ARG_C (1 << 25) +# define R200_TXA_SCALE_ARG_C (1 << 26) +# define R200_TXA_NEG_ARG_C (1 << 27) +# define R200_TXA_OP_MADD (0 << 28) +# define R200_TXA_OP_CND0 (2 << 28) +# define R200_TXA_OP_LERP (3 << 28) +# define R200_TXA_OP_CONDITIONAL (6 << 28) +# define R200_TXA_OP_MASK (7 << 28) +#define R200_PP_TXABLEND2_0 0x2f0c +# define R200_TXA_TFACTOR_SEL_SHIFT 0 +# define R200_TXA_TFACTOR_SEL_MASK 0x7 +# define R200_TXA_TFACTOR1_SEL_SHIFT 4 +# define R200_TXA_TFACTOR1_SEL_MASK (0x7 << 4) +# define R200_TXA_SCALE_SHIFT 8 +# define R200_TXA_SCALE_MASK (7 << 8) +# define R200_TXA_SCALE_1X (0 << 8) +# define R200_TXA_SCALE_2X (1 << 8) +# define R200_TXA_SCALE_4X (2 << 8) +# define R200_TXA_SCALE_8X (3 << 8) +# define R200_TXA_SCALE_INV2 (5 << 8) +# define R200_TXA_SCALE_INV4 (6 << 8) +# define R200_TXA_SCALE_INV8 (7 << 8) +# define R200_TXA_CLAMP_SHIFT 12 +# define R200_TXA_CLAMP_MASK (3 << 12) +# define R200_TXA_CLAMP_WRAP (0 << 12) +# define R200_TXA_CLAMP_0_1 (1 << 12) +# define R200_TXA_CLAMP_8_8 (2 << 12) +# define R200_TXA_OUTPUT_REG_MASK (7 << 16) +# define R200_TXA_OUTPUT_REG_NONE (0 << 16) +# define R200_TXA_OUTPUT_REG_R0 (1 << 16) +# define R200_TXA_OUTPUT_REG_R1 (2 << 16) +# define R200_TXA_OUTPUT_REG_R2 (3 << 16) +# define R200_TXA_OUTPUT_REG_R3 (4 << 16) +# define R200_TXA_OUTPUT_REG_R4 (5 << 16) +# define R200_TXA_OUTPUT_REG_R5 (6 << 16) +# define R200_TXA_DOT_ALPHA (1 << 20) +# define R200_TXA_REPL_NORMAL 0 +# define R200_TXA_REPL_RED 1 +# define R200_TXA_REPL_GREEN 2 +# define R200_TXA_REPL_ARG_A_SHIFT 26 +# define R200_TXA_REPL_ARG_A_MASK (3 << 26) +# define R200_TXA_REPL_ARG_B_SHIFT 28 +# define R200_TXA_REPL_ARG_B_MASK (3 << 28) +# define R200_TXA_REPL_ARG_C_SHIFT 30 +# define R200_TXA_REPL_ARG_C_MASK (3 << 30) +#define R200_PP_TXCBLEND_1 0x2f10 +#define R200_PP_TXCBLEND2_1 0x2f14 +#define R200_PP_TXABLEND_1 0x2f18 +#define R200_PP_TXABLEND2_1 0x2f1c +#define R200_PP_TXCBLEND_2 0x2f20 +#define R200_PP_TXCBLEND2_2 0x2f24 +#define R200_PP_TXABLEND_2 0x2f28 +#define R200_PP_TXABLEND2_2 0x2f2c +#define R200_PP_TXCBLEND_3 0x2f30 +#define R200_PP_TXCBLEND2_3 0x2f34 +#define R200_PP_TXABLEND_3 0x2f38 +#define R200_PP_TXABLEND2_3 0x2f3c + +#define R200_SE_VTX_FMT_0 0x2088 +# define R200_VTX_XY 0 /* always have xy */ +# define R200_VTX_Z0 (1<<0) +# define R200_VTX_W0 (1<<1) +# define R200_VTX_WEIGHT_COUNT_SHIFT (2) +# define R200_VTX_PV_MATRIX_SEL (1<<5) +# define R200_VTX_N0 (1<<6) +# define R200_VTX_POINT_SIZE (1<<7) +# define R200_VTX_DISCRETE_FOG (1<<8) +# define R200_VTX_SHININESS_0 (1<<9) +# define R200_VTX_SHININESS_1 (1<<10) +# define R200_VTX_COLOR_NOT_PRESENT 0 +# define R200_VTX_PK_RGBA 1 +# define R200_VTX_FP_RGB 2 +# define R200_VTX_FP_RGBA 3 +# define R200_VTX_COLOR_MASK 3 +# define R200_VTX_COLOR_0_SHIFT 11 +# define R200_VTX_COLOR_1_SHIFT 13 +# define R200_VTX_COLOR_2_SHIFT 15 +# define R200_VTX_COLOR_3_SHIFT 17 +# define R200_VTX_COLOR_4_SHIFT 19 +# define R200_VTX_COLOR_5_SHIFT 21 +# define R200_VTX_COLOR_6_SHIFT 23 +# define R200_VTX_COLOR_7_SHIFT 25 +# define R200_VTX_XY1 (1<<28) +# define R200_VTX_Z1 (1<<29) +# define R200_VTX_W1 (1<<30) +# define R200_VTX_N1 (1<<31) +#define R200_SE_VTX_FMT_1 0x208c +# define R200_VTX_TEX0_COMP_CNT_SHIFT 0 +# define R200_VTX_TEX1_COMP_CNT_SHIFT 3 +# define R200_VTX_TEX2_COMP_CNT_SHIFT 6 +# define R200_VTX_TEX3_COMP_CNT_SHIFT 9 +# define R200_VTX_TEX4_COMP_CNT_SHIFT 12 +# define R200_VTX_TEX5_COMP_CNT_SHIFT 15 + +#define R200_SE_TCL_OUTPUT_VTX_FMT_0 0x2090 +#define R200_SE_TCL_OUTPUT_VTX_FMT_1 0x2094 +#define R200_SE_TCL_OUTPUT_VTX_COMP_SEL 0x2250 +# define R200_OUTPUT_XYZW (1<<0) +# define R200_OUTPUT_COLOR_0 (1<<8) +# define R200_OUTPUT_COLOR_1 (1<<9) +# define R200_OUTPUT_TEX_0 (1<<16) +# define R200_OUTPUT_TEX_1 (1<<17) +# define R200_OUTPUT_TEX_2 (1<<18) +# define R200_OUTPUT_TEX_3 (1<<19) +# define R200_OUTPUT_TEX_4 (1<<20) +# define R200_OUTPUT_TEX_5 (1<<21) +# define R200_OUTPUT_TEX_MASK (0x3f<<16) +# define R200_OUTPUT_DISCRETE_FOG (1<<24) +# define R200_OUTPUT_PT_SIZE (1<<25) +# define R200_FORCE_INORDER_PROC (1<<31) +#define R200_PP_CNTL_X 0x2cc4 +#define R200_PP_TXMULTI_CTL_0 0x2c1c +#define R200_SE_VTX_STATE_CNTL 0x2180 +# define R200_UPDATE_USER_COLOR_0_ENA_MASK (1<<16) + + /* Registers for CP and Microcode Engine */ +#define RADEON_CP_ME_RAM_ADDR 0x07d4 +#define RADEON_CP_ME_RAM_RADDR 0x07d8 +#define RADEON_CP_ME_RAM_DATAH 0x07dc +#define RADEON_CP_ME_RAM_DATAL 0x07e0 + +#define RADEON_CP_RB_BASE 0x0700 +#define RADEON_CP_RB_CNTL 0x0704 +#define RADEON_CP_RB_RPTR_ADDR 0x070c +#define RADEON_CP_RB_RPTR 0x0710 +#define RADEON_CP_RB_WPTR 0x0714 + +#define RADEON_CP_IB_BASE 0x0738 +#define RADEON_CP_IB_BUFSZ 0x073c + +#define RADEON_CP_CSQ_CNTL 0x0740 +# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0) +# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28) +# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28) +# define RADEON_CSQ_PRIBM_INDDIS (2 << 28) +# define RADEON_CSQ_PRIPIO_INDBM (3 << 28) +# define RADEON_CSQ_PRIBM_INDBM (4 << 28) +# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28) +#define RADEON_CP_CSQ_STAT 0x07f8 +# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0) +# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8) +# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16) +# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24) +#define RADEON_CP_CSQ_ADDR 0x07f0 +#define RADEON_CP_CSQ_DATA 0x07f4 +#define RADEON_CP_CSQ_APER_PRIMARY 0x1000 +#define RADEON_CP_CSQ_APER_INDIRECT 0x1300 + +#define RADEON_CP_RB_WPTR_DELAY 0x0718 +# define RADEON_PRE_WRITE_TIMER_SHIFT 0 +# define RADEON_PRE_WRITE_LIMIT_SHIFT 23 + +#define RADEON_AIC_CNTL 0x01d0 +# define RADEON_PCIGART_TRANSLATE_EN (1 << 0) +#define RADEON_AIC_LO_ADDR 0x01dc + + + + /* Constants */ +#define RADEON_LAST_FRAME_REG RADEON_GUI_SCRATCH_REG0 +#define RADEON_LAST_CLEAR_REG RADEON_GUI_SCRATCH_REG2 + + + + /* CP packet types */ +#define RADEON_CP_PACKET0 0x00000000 +#define RADEON_CP_PACKET1 0x40000000 +#define RADEON_CP_PACKET2 0x80000000 +#define RADEON_CP_PACKET3 0xC0000000 +# define RADEON_CP_PACKET_MASK 0xC0000000 +# define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000 +# define RADEON_CP_PACKET_MAX_DWORDS (1 << 12) +# define RADEON_CP_PACKET0_REG_MASK 0x000007ff +# define RADEON_CP_PACKET1_REG0_MASK 0x000007ff +# define RADEON_CP_PACKET1_REG1_MASK 0x003ff800 + +#define RADEON_CP_PACKET0_ONE_REG_WR 0x00008000 + +#define RADEON_CP_PACKET3_NOP 0xC0001000 +#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900 +#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00 +#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00 +#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300 +#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400 +#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600 +#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800 +#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900 +#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00 +#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00 +#define R200_CP_PACKET3_3D_DRAW_IMMD_2 0xc0003500 +#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00 +#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100 +#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200 +#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300 +#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400 +#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500 +#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800 +#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00 +#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00 +#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00 + + +#define RADEON_CP_VC_FRMT_XY 0x00000000 +#define RADEON_CP_VC_FRMT_W0 0x00000001 +#define RADEON_CP_VC_FRMT_FPCOLOR 0x00000002 +#define RADEON_CP_VC_FRMT_FPALPHA 0x00000004 +#define RADEON_CP_VC_FRMT_PKCOLOR 0x00000008 +#define RADEON_CP_VC_FRMT_FPSPEC 0x00000010 +#define RADEON_CP_VC_FRMT_FPFOG 0x00000020 +#define RADEON_CP_VC_FRMT_PKSPEC 0x00000040 +#define RADEON_CP_VC_FRMT_ST0 0x00000080 +#define RADEON_CP_VC_FRMT_ST1 0x00000100 +#define RADEON_CP_VC_FRMT_Q1 0x00000200 +#define RADEON_CP_VC_FRMT_ST2 0x00000400 +#define RADEON_CP_VC_FRMT_Q2 0x00000800 +#define RADEON_CP_VC_FRMT_ST3 0x00001000 +#define RADEON_CP_VC_FRMT_Q3 0x00002000 +#define RADEON_CP_VC_FRMT_Q0 0x00004000 +#define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK 0x00038000 +#define RADEON_CP_VC_FRMT_N0 0x00040000 +#define RADEON_CP_VC_FRMT_XY1 0x08000000 +#define RADEON_CP_VC_FRMT_Z1 0x10000000 +#define RADEON_CP_VC_FRMT_W1 0x20000000 +#define RADEON_CP_VC_FRMT_N1 0x40000000 +#define RADEON_CP_VC_FRMT_Z 0x80000000 + +#define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE 0x00000000 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT 0x00000001 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE 0x00000002 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP 0x00000003 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2 0x00000007 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST 0x00000008 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009 +#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST 0x0000000a +#define RADEON_CP_VC_CNTL_PRIM_TYPE_QUAD_LIST 0x0000000d +#define RADEON_CP_VC_CNTL_PRIM_WALK_IND 0x00000010 +#define RADEON_CP_VC_CNTL_PRIM_WALK_LIST 0x00000020 +#define RADEON_CP_VC_CNTL_PRIM_WALK_RING 0x00000030 +#define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA 0x00000000 +#define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA 0x00000040 +#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080 +#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000 +#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100 +#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000 +#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200 +#define RADEON_CP_VC_CNTL_NUM_SHIFT 16 + +#define RADEON_VS_MATRIX_0_ADDR 0 +#define RADEON_VS_MATRIX_1_ADDR 4 +#define RADEON_VS_MATRIX_2_ADDR 8 +#define RADEON_VS_MATRIX_3_ADDR 12 +#define RADEON_VS_MATRIX_4_ADDR 16 +#define RADEON_VS_MATRIX_5_ADDR 20 +#define RADEON_VS_MATRIX_6_ADDR 24 +#define RADEON_VS_MATRIX_7_ADDR 28 +#define RADEON_VS_MATRIX_8_ADDR 32 +#define RADEON_VS_MATRIX_9_ADDR 36 +#define RADEON_VS_MATRIX_10_ADDR 40 +#define RADEON_VS_MATRIX_11_ADDR 44 +#define RADEON_VS_MATRIX_12_ADDR 48 +#define RADEON_VS_MATRIX_13_ADDR 52 +#define RADEON_VS_MATRIX_14_ADDR 56 +#define RADEON_VS_MATRIX_15_ADDR 60 +#define RADEON_VS_LIGHT_AMBIENT_ADDR 64 +#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72 +#define RADEON_VS_LIGHT_SPECULAR_ADDR 80 +#define RADEON_VS_LIGHT_DIRPOS_ADDR 88 +#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96 +#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104 +#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112 +#define RADEON_VS_UCP_ADDR 116 +#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122 +#define RADEON_VS_FOG_PARAM_ADDR 123 +#define RADEON_VS_EYE_VECTOR_ADDR 124 + +#define RADEON_SS_LIGHT_DCD_ADDR 0 +#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8 +#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16 +#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24 +#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32 +#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48 +#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49 +#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50 +#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51 +#define RADEON_SS_SHININESS 60 + +#define RADEON_TV_MASTER_CNTL 0x0800 +# define RADEON_TV_ASYNC_RST (1 << 0) +# define RADEON_CRT_ASYNC_RST (1 << 1) +# define RADEON_RESTART_PHASE_FIX (1 << 3) +# define RADEON_TV_FIFO_ASYNC_RST (1 << 4) +# define RADEON_VIN_ASYNC_RST (1 << 5) +# define RADEON_AUD_ASYNC_RST (1 << 6) +# define RADEON_DVS_ASYNC_RST (1 << 7) +# define RADEON_CRT_FIFO_CE_EN (1 << 9) +# define RADEON_TV_FIFO_CE_EN (1 << 10) +# define RADEON_RE_SYNC_NOW_SEL_MASK (3 << 14) +# define RADEON_TVCLK_ALWAYS_ONb (1 << 30) +# define RADEON_TV_ON (1 << 31) +#define RADEON_TV_PRE_DAC_MUX_CNTL 0x0888 +# define RADEON_Y_RED_EN (1 << 0) +# define RADEON_C_GRN_EN (1 << 1) +# define RADEON_CMP_BLU_EN (1 << 2) +# define RADEON_DAC_DITHER_EN (1 << 3) +# define RADEON_RED_MX_FORCE_DAC_DATA (6 << 4) +# define RADEON_GRN_MX_FORCE_DAC_DATA (6 << 8) +# define RADEON_BLU_MX_FORCE_DAC_DATA (6 << 12) +# define RADEON_TV_FORCE_DAC_DATA_SHIFT 16 +#define RADEON_TV_RGB_CNTL 0x0804 +# define RADEON_SWITCH_TO_BLUE (1 << 4) +# define RADEON_RGB_DITHER_EN (1 << 5) +# define RADEON_RGB_SRC_SEL_MASK (3 << 8) +# define RADEON_RGB_SRC_SEL_CRTC1 (0 << 8) +# define RADEON_RGB_SRC_SEL_RMX (1 << 8) +# define RADEON_RGB_SRC_SEL_CRTC2 (2 << 8) +# define RADEON_RGB_CONVERT_BY_PASS (1 << 10) +# define RADEON_UVRAM_READ_MARGIN_SHIFT 16 +# define RADEON_FIFORAM_FFMACRO_READ_MARGIN_SHIFT 20 +# define RADEON_RGB_ATTEN_SEL(x) ((x) << 24) +# define RADEON_TVOUT_SCALE_EN (1 << 26) +# define RADEON_RGB_ATTEN_VAL(x) ((x) << 28) +#define RADEON_TV_SYNC_CNTL 0x0808 +# define RADEON_SYNC_OE (1 << 0) +# define RADEON_SYNC_OUT (1 << 1) +# define RADEON_SYNC_IN (1 << 2) +# define RADEON_SYNC_PUB (1 << 3) +# define RADEON_SYNC_PD (1 << 4) +# define RADEON_TV_SYNC_IO_DRIVE (1 << 5) +#define RADEON_TV_HTOTAL 0x080c +#define RADEON_TV_HDISP 0x0810 +#define RADEON_TV_HSTART 0x0818 +#define RADEON_TV_HCOUNT 0x081C +#define RADEON_TV_VTOTAL 0x0820 +#define RADEON_TV_VDISP 0x0824 +#define RADEON_TV_VCOUNT 0x0828 +#define RADEON_TV_FTOTAL 0x082c +#define RADEON_TV_FCOUNT 0x0830 +#define RADEON_TV_FRESTART 0x0834 +#define RADEON_TV_HRESTART 0x0838 +#define RADEON_TV_VRESTART 0x083c +#define RADEON_TV_HOST_READ_DATA 0x0840 +#define RADEON_TV_HOST_WRITE_DATA 0x0844 +#define RADEON_TV_HOST_RD_WT_CNTL 0x0848 +# define RADEON_HOST_FIFO_RD (1 << 12) +# define RADEON_HOST_FIFO_RD_ACK (1 << 13) +# define RADEON_HOST_FIFO_WT (1 << 14) +# define RADEON_HOST_FIFO_WT_ACK (1 << 15) +#define RADEON_TV_VSCALER_CNTL1 0x084c +# define RADEON_UV_INC_MASK 0xffff +# define RADEON_UV_INC_SHIFT 0 +# define RADEON_Y_W_EN (1 << 24) +# define RADEON_RESTART_FIELD (1 << 29) /* restart on field 0 */ +# define RADEON_Y_DEL_W_SIG_SHIFT 26 +#define RADEON_TV_TIMING_CNTL 0x0850 +# define RADEON_H_INC_MASK 0xfff +# define RADEON_H_INC_SHIFT 0 +# define RADEON_REQ_Y_FIRST (1 << 19) +# define RADEON_FORCE_BURST_ALWAYS (1 << 21) +# define RADEON_UV_POST_SCALE_BYPASS (1 << 23) +# define RADEON_UV_OUTPUT_POST_SCALE_SHIFT 24 +#define RADEON_TV_VSCALER_CNTL2 0x0854 +# define RADEON_DITHER_MODE (1 << 0) +# define RADEON_Y_OUTPUT_DITHER_EN (1 << 1) +# define RADEON_UV_OUTPUT_DITHER_EN (1 << 2) +# define RADEON_UV_TO_BUF_DITHER_EN (1 << 3) +#define RADEON_TV_Y_FALL_CNTL 0x0858 +# define RADEON_Y_FALL_PING_PONG (1 << 16) +# define RADEON_Y_COEF_EN (1 << 17) +#define RADEON_TV_Y_RISE_CNTL 0x085c +# define RADEON_Y_RISE_PING_PONG (1 << 16) +#define RADEON_TV_Y_SAW_TOOTH_CNTL 0x0860 +#define RADEON_TV_UPSAMP_AND_GAIN_CNTL 0x0864 +# define RADEON_YUPSAMP_EN (1 << 0) +# define RADEON_UVUPSAMP_EN (1 << 2) +#define RADEON_TV_GAIN_LIMIT_SETTINGS 0x0868 +# define RADEON_Y_GAIN_LIMIT_SHIFT 0 +# define RADEON_UV_GAIN_LIMIT_SHIFT 16 +#define RADEON_TV_LINEAR_GAIN_SETTINGS 0x086c +# define RADEON_Y_GAIN_SHIFT 0 +# define RADEON_UV_GAIN_SHIFT 16 +#define RADEON_TV_MODULATOR_CNTL1 0x0870 +# define RADEON_YFLT_EN (1 << 2) +# define RADEON_UVFLT_EN (1 << 3) +# define RADEON_ALT_PHASE_EN (1 << 6) +# define RADEON_SYNC_TIP_LEVEL (1 << 7) +# define RADEON_BLANK_LEVEL_SHIFT 8 +# define RADEON_SET_UP_LEVEL_SHIFT 16 +# define RADEON_SLEW_RATE_LIMIT (1 << 23) +# define RADEON_CY_FILT_BLEND_SHIFT 28 +#define RADEON_TV_MODULATOR_CNTL2 0x0874 +# define RADEON_TV_U_BURST_LEVEL_MASK 0x1ff +# define RADEON_TV_V_BURST_LEVEL_MASK 0x1ff +# define RADEON_TV_V_BURST_LEVEL_SHIFT 16 +#define RADEON_TV_CRC_CNTL 0x0890 +#define RADEON_TV_UV_ADR 0x08ac +# define RADEON_MAX_UV_ADR_MASK 0x000000ff +# define RADEON_MAX_UV_ADR_SHIFT 0 +# define RADEON_TABLE1_BOT_ADR_MASK 0x0000ff00 +# define RADEON_TABLE1_BOT_ADR_SHIFT 8 +# define RADEON_TABLE3_TOP_ADR_MASK 0x00ff0000 +# define RADEON_TABLE3_TOP_ADR_SHIFT 16 +# define RADEON_HCODE_TABLE_SEL_MASK 0x06000000 +# define RADEON_HCODE_TABLE_SEL_SHIFT 25 +# define RADEON_VCODE_TABLE_SEL_MASK 0x18000000 +# define RADEON_VCODE_TABLE_SEL_SHIFT 27 +# define RADEON_TV_MAX_FIFO_ADDR 0x1a7 +# define RADEON_TV_MAX_FIFO_ADDR_INTERNAL 0x1ff +#define RADEON_TV_PLL_FINE_CNTL 0x0020 /* PLL */ +#define RADEON_TV_PLL_CNTL 0x0021 /* PLL */ +# define RADEON_TV_M0LO_MASK 0xff +# define RADEON_TV_M0HI_MASK 0x7 +# define RADEON_TV_M0HI_SHIFT 18 +# define RADEON_TV_N0LO_MASK 0x1ff +# define RADEON_TV_N0LO_SHIFT 8 +# define RADEON_TV_N0HI_MASK 0x3 +# define RADEON_TV_N0HI_SHIFT 21 +# define RADEON_TV_P_MASK 0xf +# define RADEON_TV_P_SHIFT 24 +# define RADEON_TV_SLIP_EN (1 << 23) +# define RADEON_TV_DTO_EN (1 << 28) +#define RADEON_TV_PLL_CNTL1 0x0022 /* PLL */ +# define RADEON_TVPLL_RESET (1 << 1) +# define RADEON_TVPLL_SLEEP (1 << 3) +# define RADEON_TVPLL_REFCLK_SEL (1 << 4) +# define RADEON_TVPCP_SHIFT 8 +# define RADEON_TVPCP_MASK (7 << 8) +# define RADEON_TVPVG_SHIFT 11 +# define RADEON_TVPVG_MASK (7 << 11) +# define RADEON_TVPDC_SHIFT 14 +# define RADEON_TVPDC_MASK (3 << 14) +# define RADEON_TVPLL_TEST_DIS (1 << 31) +# define RADEON_TVCLK_SRC_SEL_TVPLL (1 << 30) + +#define RS400_DISP2_REQ_CNTL1 0xe30 +# define RS400_DISP2_START_REQ_LEVEL_SHIFT 0 +# define RS400_DISP2_START_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP2_STOP_REQ_LEVEL_SHIFT 12 +# define RS400_DISP2_STOP_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP2_ALLOW_FID_LEVEL_SHIFT 22 +# define RS400_DISP2_ALLOW_FID_LEVEL_MASK 0x3ff +#define RS400_DISP2_REQ_CNTL2 0xe34 +# define RS400_DISP2_CRITICAL_POINT_START_SHIFT 12 +# define RS400_DISP2_CRITICAL_POINT_START_MASK 0x3ff +# define RS400_DISP2_CRITICAL_POINT_STOP_SHIFT 22 +# define RS400_DISP2_CRITICAL_POINT_STOP_MASK 0x3ff +#define RS400_DMIF_MEM_CNTL1 0xe38 +# define RS400_DISP2_START_ADR_SHIFT 0 +# define RS400_DISP2_START_ADR_MASK 0x3ff +# define RS400_DISP1_CRITICAL_POINT_START_SHIFT 12 +# define RS400_DISP1_CRITICAL_POINT_START_MASK 0x3ff +# define RS400_DISP1_CRITICAL_POINT_STOP_SHIFT 22 +# define RS400_DISP1_CRITICAL_POINT_STOP_MASK 0x3ff +#define RS400_DISP1_REQ_CNTL1 0xe3c +# define RS400_DISP1_START_REQ_LEVEL_SHIFT 0 +# define RS400_DISP1_START_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP1_STOP_REQ_LEVEL_SHIFT 12 +# define RS400_DISP1_STOP_REQ_LEVEL_MASK 0x3ff +# define RS400_DISP1_ALLOW_FID_LEVEL_SHIFT 22 +# define RS400_DISP1_ALLOW_FID_LEVEL_MASK 0x3ff + +#define RS690_MC_INDEX 0x78 +# define RS690_MC_INDEX_MASK 0x1ff +# define RS690_MC_INDEX_WR_EN (1 << 9) +# define RS690_MC_INDEX_WR_ACK 0x7f +#define RS690_MC_DATA 0x7c + +#define RS690_MC_FB_LOCATION 0x100 +#define RS690_MC_AGP_LOCATION 0x101 +#define RS690_MC_AGP_BASE 0x102 +#define RS690_MC_AGP_BASE_2 0x103 +#define RS690_MC_INIT_MISC_LAT_TIMER 0x104 +#define RS690_MC_STATUS 0x90 +#define RS690_MC_STATUS_IDLE (1 << 0) + +#define RS600_MC_INDEX 0x70 +# define RS600_MC_ADDR_MASK 0xffff +# define RS600_MC_IND_SEQ_RBS_0 (1 << 16) +# define RS600_MC_IND_SEQ_RBS_1 (1 << 17) +# define RS600_MC_IND_SEQ_RBS_2 (1 << 18) +# define RS600_MC_IND_SEQ_RBS_3 (1 << 19) +# define RS600_MC_IND_AIC_RBS (1 << 20) +# define RS600_MC_IND_CITF_ARB0 (1 << 21) +# define RS600_MC_IND_CITF_ARB1 (1 << 22) +# define RS600_MC_IND_WR_EN (1 << 23) +#define RS600_MC_DATA 0x74 + +#define RS600_MC_STATUS 0x0 +# define RS600_MC_IDLE (1 << 1) +#define RS600_MC_FB_LOCATION 0x4 +#define RS600_MC_AGP_LOCATION 0x5 +#define RS600_AGP_BASE 0x6 +#define RS600_AGP_BASE2 0x7 + +#define AVIVO_MC_INDEX 0x0070 +#define R520_MC_STATUS 0x00 +# define R520_MC_STATUS_IDLE (1 << 1) +#define RV515_MC_STATUS 0x08 +# define RV515_MC_STATUS_IDLE (1 << 4) +#define RV515_MC_INIT_MISC_LAT_TIMER 0x09 +#define AVIVO_MC_DATA 0x0074 + +#define RV515_MC_FB_LOCATION 0x1 +#define RV515_MC_AGP_LOCATION 0x2 +#define RV515_MC_AGP_BASE 0x3 +#define RV515_MC_AGP_BASE_2 0x4 +#define RV515_MC_CNTL 0x5 +# define RV515_MEM_NUM_CHANNELS_MASK 0x3 +#define R520_MC_FB_LOCATION 0x4 +#define R520_MC_AGP_LOCATION 0x5 +#define R520_MC_AGP_BASE 0x6 +#define R520_MC_AGP_BASE_2 0x7 +#define R520_MC_CNTL0 0x8 +# define R520_MEM_NUM_CHANNELS_MASK (0x3 << 24) +# define R520_MEM_NUM_CHANNELS_SHIFT 24 +# define R520_MC_CHANNEL_SIZE (1 << 23) + +#define RS780_MC_INDEX 0x28f8 +# define RS780_MC_INDEX_MASK 0x1ff +# define RS780_MC_INDEX_WR_EN (1 << 9) +#define RS780_MC_DATA 0x28fc + +#define R600_RAMCFG 0x2408 +# define R600_CHANSIZE (1 << 7) +# define R600_CHANSIZE_OVERRIDE (1 << 10) + +#define R600_SRBM_STATUS 0x0e50 + +#define AVIVO_CP_DYN_CNTL 0x000f /* PLL */ +# define AVIVO_CP_FORCEON (1 << 0) +#define AVIVO_E2_DYN_CNTL 0x0011 /* PLL */ +# define AVIVO_E2_FORCEON (1 << 0) +#define AVIVO_IDCT_DYN_CNTL 0x0013 /* PLL */ +# define AVIVO_IDCT_FORCEON (1 << 0) + +#define AVIVO_HDP_FB_LOCATION 0x134 + +#define AVIVO_VGA_RENDER_CONTROL 0x0300 +# define AVIVO_VGA_VSTATUS_CNTL_MASK (3 << 16) +#define AVIVO_D1VGA_CONTROL 0x0330 +# define AVIVO_DVGA_CONTROL_MODE_ENABLE (1<<0) +# define AVIVO_DVGA_CONTROL_TIMING_SELECT (1<<8) +# define AVIVO_DVGA_CONTROL_SYNC_POLARITY_SELECT (1<<9) +# define AVIVO_DVGA_CONTROL_OVERSCAN_TIMING_SELECT (1<<10) +# define AVIVO_DVGA_CONTROL_OVERSCAN_COLOR_EN (1<<16) +# define AVIVO_DVGA_CONTROL_ROTATE (1<<24) +#define AVIVO_D2VGA_CONTROL 0x0338 + +#define AVIVO_VGA25_PPLL_REF_DIV_SRC 0x0360 +#define AVIVO_VGA25_PPLL_REF_DIV 0x0364 +#define AVIVO_VGA28_PPLL_REF_DIV_SRC 0x0368 +#define AVIVO_VGA28_PPLL_REF_DIV 0x036c +#define AVIVO_VGA41_PPLL_REF_DIV_SRC 0x0370 +#define AVIVO_VGA41_PPLL_REF_DIV 0x0374 +#define AVIVO_VGA25_PPLL_FB_DIV 0x0378 +#define AVIVO_VGA28_PPLL_FB_DIV 0x037c +#define AVIVO_VGA41_PPLL_FB_DIV 0x0380 +#define AVIVO_VGA25_PPLL_POST_DIV_SRC 0x0384 +#define AVIVO_VGA25_PPLL_POST_DIV 0x0388 +#define AVIVO_VGA28_PPLL_POST_DIV_SRC 0x038c +#define AVIVO_VGA28_PPLL_POST_DIV 0x0390 +#define AVIVO_VGA41_PPLL_POST_DIV_SRC 0x0394 +#define AVIVO_VGA41_PPLL_POST_DIV 0x0398 +#define AVIVO_VGA25_PPLL_CNTL 0x039c +#define AVIVO_VGA28_PPLL_CNTL 0x03a0 +#define AVIVO_VGA41_PPLL_CNTL 0x03a4 + +#define AVIVO_EXT1_PPLL_REF_DIV_SRC 0x400 +#define AVIVO_EXT1_PPLL_REF_DIV 0x404 +#define AVIVO_EXT1_PPLL_UPDATE_LOCK 0x408 +#define AVIVO_EXT1_PPLL_UPDATE_CNTL 0x40c + +#define AVIVO_EXT2_PPLL_REF_DIV_SRC 0x410 +#define AVIVO_EXT2_PPLL_REF_DIV 0x414 +#define AVIVO_EXT2_PPLL_UPDATE_LOCK 0x418 +#define AVIVO_EXT2_PPLL_UPDATE_CNTL 0x41c + +#define AVIVO_EXT1_PPLL_FB_DIV 0x430 +#define AVIVO_EXT2_PPLL_FB_DIV 0x434 + +#define AVIVO_EXT1_PPLL_POST_DIV_SRC 0x438 +#define AVIVO_EXT1_PPLL_POST_DIV 0x43c + +#define AVIVO_EXT2_PPLL_POST_DIV_SRC 0x440 +#define AVIVO_EXT2_PPLL_POST_DIV 0x444 + +#define AVIVO_EXT1_PPLL_CNTL 0x448 +#define AVIVO_EXT2_PPLL_CNTL 0x44c + +#define AVIVO_P1PLL_CNTL 0x450 +#define AVIVO_P2PLL_CNTL 0x454 +#define AVIVO_P1PLL_INT_SS_CNTL 0x458 +#define AVIVO_P2PLL_INT_SS_CNTL 0x45c +#define AVIVO_P1PLL_TMDSA_CNTL 0x460 +#define AVIVO_P2PLL_LVTMA_CNTL 0x464 + +#define AVIVO_PCLK_CRTC1_CNTL 0x480 +#define AVIVO_PCLK_CRTC2_CNTL 0x484 + +#define AVIVO_D1CRTC_H_TOTAL 0x6000 +#define AVIVO_D1CRTC_H_BLANK_START_END 0x6004 +#define AVIVO_D1CRTC_H_SYNC_A 0x6008 +#define AVIVO_D1CRTC_H_SYNC_A_CNTL 0x600c +#define AVIVO_D1CRTC_H_SYNC_B 0x6010 +#define AVIVO_D1CRTC_H_SYNC_B_CNTL 0x6014 + +#define AVIVO_D1CRTC_V_TOTAL 0x6020 +#define AVIVO_D1CRTC_V_BLANK_START_END 0x6024 +#define AVIVO_D1CRTC_V_SYNC_A 0x6028 +#define AVIVO_D1CRTC_V_SYNC_A_CNTL 0x602c +#define AVIVO_D1CRTC_V_SYNC_B 0x6030 +#define AVIVO_D1CRTC_V_SYNC_B_CNTL 0x6034 + +#define AVIVO_D1CRTC_CONTROL 0x6080 +# define AVIVO_CRTC_EN (1<<0) +#define AVIVO_D1CRTC_BLANK_CONTROL 0x6084 +#define AVIVO_D1CRTC_INTERLACE_CONTROL 0x6088 +#define AVIVO_D1CRTC_INTERLACE_STATUS 0x608c +#define AVIVO_D1CRTC_STEREO_CONTROL 0x60c4 + +/* master controls */ +#define AVIVO_DC_CRTC_MASTER_EN 0x60f8 +#define AVIVO_DC_CRTC_TV_CONTROL 0x60fc + +#define AVIVO_D1GRPH_ENABLE 0x6100 +#define AVIVO_D1GRPH_CONTROL 0x6104 +# define AVIVO_D1GRPH_CONTROL_DEPTH_8BPP (0<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_16BPP (1<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_32BPP (2<<0) +# define AVIVO_D1GRPH_CONTROL_DEPTH_64BPP (3<<0) + +# define AVIVO_D1GRPH_CONTROL_8BPP_INDEXED (0<<8) + +# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB1555 (0<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_RGB565 (1<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_ARGB4444 (2<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_AI88 (3<<8) +# define AVIVO_D1GRPH_CONTROL_16BPP_MONO16 (4<<8) + +# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB8888 (0<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_ARGB2101010 (1<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_DIGITAL (2<<8) +# define AVIVO_D1GRPH_CONTROL_32BPP_8B_ARGB2101010 (3<<8) + + +# define AVIVO_D1GRPH_CONTROL_64BPP_ARGB16161616 (0<<8) + +# define AVIVO_D1GRPH_SWAP_RB (1<<16) +# define AVIVO_D1GRPH_TILED (1<<20) +# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1<<21) + +#define AVIVO_D1GRPH_LUT_SEL 0x6108 + +#define R600_D1GRPH_SWAP_CONTROL 0x610C +# define R600_D1GRPH_SWAP_ENDIAN_NONE (0 << 0) +# define R600_D1GRPH_SWAP_ENDIAN_16BIT (1 << 0) +# define R600_D1GRPH_SWAP_ENDIAN_32BIT (2 << 0) +# define R600_D1GRPH_SWAP_ENDIAN_64BIT (3 << 0) + +/* the *_HIGH surface regs are backwards; the D1 regs are in the D2 + * block and vice versa. This applies to GRPH, CUR, etc. + */ + +#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 +#define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914 +#define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114 +#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 +#define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x691c +#define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x611c +#define AVIVO_D1GRPH_PITCH 0x6120 +#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 +#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 +#define AVIVO_D1GRPH_X_START 0x612c +#define AVIVO_D1GRPH_Y_START 0x6130 +#define AVIVO_D1GRPH_X_END 0x6134 +#define AVIVO_D1GRPH_Y_END 0x6138 +#define AVIVO_D1GRPH_UPDATE 0x6144 +# define AVIVO_D1GRPH_UPDATE_LOCK (1<<16) +#define AVIVO_D1GRPH_FLIP_CONTROL 0x6148 + +#define AVIVO_D1GRPH_COLOR_MATRIX_TRANSFORMATION_CNTL 0x6380 + +#define AVIVO_D1CUR_CONTROL 0x6400 +# define AVIVO_D1CURSOR_EN (1<<0) +# define AVIVO_D1CURSOR_MODE_SHIFT 8 +# define AVIVO_D1CURSOR_MODE_MASK (0x3<<8) +# define AVIVO_D1CURSOR_MODE_24BPP (0x2) +#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 +#define R700_D1CUR_SURFACE_ADDRESS_HIGH 0x6c0c +#define R700_D2CUR_SURFACE_ADDRESS_HIGH 0x640c +#define AVIVO_D1CUR_SIZE 0x6410 +#define AVIVO_D1CUR_POSITION 0x6414 +#define AVIVO_D1CUR_HOT_SPOT 0x6418 +#define AVIVO_D1CUR_UPDATE 0x6424 +# define AVIVO_D1CURSOR_UPDATE_LOCK (1 << 16) + +#define AVIVO_DC_LUT_RW_SELECT 0x6480 +#define AVIVO_DC_LUT_RW_MODE 0x6484 +#define AVIVO_DC_LUT_RW_INDEX 0x6488 +#define AVIVO_DC_LUT_SEQ_COLOR 0x648c +#define AVIVO_DC_LUT_PWL_DATA 0x6490 +#define AVIVO_DC_LUT_30_COLOR 0x6494 +#define AVIVO_DC_LUT_READ_PIPE_SELECT 0x6498 +#define AVIVO_DC_LUT_WRITE_EN_MASK 0x649c +#define AVIVO_DC_LUT_AUTOFILL 0x64a0 + +#define AVIVO_DC_LUTA_CONTROL 0x64c0 +#define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE 0x64c4 +#define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN 0x64c8 +#define AVIVO_DC_LUTA_BLACK_OFFSET_RED 0x64cc +#define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE 0x64d0 +#define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN 0x64d4 +#define AVIVO_DC_LUTA_WHITE_OFFSET_RED 0x64d8 + +#define AVIVO_DC_LB_MEMORY_SPLIT 0x6520 +# define AVIVO_DC_LB_MEMORY_SPLIT_MASK 0x3 +# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT 0 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1HALF_D2HALF 0 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_3Q_D2_1Q 1 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_ONLY 2 +# define AVIVO_DC_LB_MEMORY_SPLIT_D1_1Q_D2_3Q 3 +# define AVIVO_DC_LB_MEMORY_SPLIT_SHIFT_MODE (1 << 2) +# define AVIVO_DC_LB_DISP1_END_ADR_SHIFT 4 +# define AVIVO_DC_LB_DISP1_END_ADR_MASK 0x7ff +#define AVIVO_D1MODE_PRIORITY_A_CNT 0x6548 +# define AVIVO_DxMODE_PRIORITY_MARK_MASK 0x7fff +# define AVIVO_DxMODE_PRIORITY_OFF (1 << 16) +# define AVIVO_DxMODE_PRIORITY_ALWAYS_ON (1 << 20) +# define AVIVO_DxMODE_PRIORITY_FORCE_MASK (1 << 24) +#define AVIVO_D1MODE_PRIORITY_B_CNT 0x654c +#define AVIVO_D2MODE_PRIORITY_A_CNT 0x6d48 +#define AVIVO_D2MODE_PRIORITY_B_CNT 0x6d4c +#define AVIVO_LB_MAX_REQ_OUTSTANDING 0x6d58 +# define AVIVO_LB_D1_MAX_REQ_OUTSTANDING_MASK 0xf +# define AVIVO_LB_D1_MAX_REQ_OUTSTANDING_SHIFT 0 +# define AVIVO_LB_D2_MAX_REQ_OUTSTANDING_MASK 0xf +# define AVIVO_LB_D2_MAX_REQ_OUTSTANDING_SHIFT 16 + +#define AVIVO_D1MODE_DATA_FORMAT 0x6528 +# define AVIVO_D1MODE_INTERLEAVE_EN (1 << 0) +#define AVIVO_D1MODE_DESKTOP_HEIGHT 0x652c +#define AVIVO_D1MODE_VLINE_START_END 0x6538 +# define AVIVO_D1MODE_VLINE_START_SHIFT 0 +# define AVIVO_D1MODE_VLINE_END_SHIFT 16 +# define AVIVO_D1MODE_VLINE_INV (1 << 31) +#define AVIVO_D1MODE_VLINE_STATUS 0x653c +# define AVIVO_D1MODE_VLINE_STAT (1 << 12) +#define AVIVO_D1MODE_VIEWPORT_START 0x6580 +#define AVIVO_D1MODE_VIEWPORT_SIZE 0x6584 +#define AVIVO_D1MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6588 +#define AVIVO_D1MODE_EXT_OVERSCAN_TOP_BOTTOM 0x658c + +#define AVIVO_D1SCL_SCALER_ENABLE 0x6590 +#define AVIVO_D1SCL_SCALER_TAP_CONTROL 0x6594 +#define AVIVO_D1SCL_UPDATE 0x65cc +# define AVIVO_D1SCL_UPDATE_LOCK (1<<16) + +/* second crtc */ +#define AVIVO_D2CRTC_H_TOTAL 0x6800 +#define AVIVO_D2CRTC_H_BLANK_START_END 0x6804 +#define AVIVO_D2CRTC_H_SYNC_A 0x6808 +#define AVIVO_D2CRTC_H_SYNC_A_CNTL 0x680c +#define AVIVO_D2CRTC_H_SYNC_B 0x6810 +#define AVIVO_D2CRTC_H_SYNC_B_CNTL 0x6814 + +#define AVIVO_D2CRTC_V_TOTAL 0x6820 +#define AVIVO_D2CRTC_V_BLANK_START_END 0x6824 +#define AVIVO_D2CRTC_V_SYNC_A 0x6828 +#define AVIVO_D2CRTC_V_SYNC_A_CNTL 0x682c +#define AVIVO_D2CRTC_V_SYNC_B 0x6830 +#define AVIVO_D2CRTC_V_SYNC_B_CNTL 0x6834 + +#define AVIVO_D2CRTC_CONTROL 0x6880 +#define AVIVO_D2CRTC_BLANK_CONTROL 0x6884 +#define AVIVO_D2CRTC_INTERLACE_CONTROL 0x6888 +#define AVIVO_D2CRTC_INTERLACE_STATUS 0x688c +#define AVIVO_D2CRTC_STEREO_CONTROL 0x68c4 + +#define AVIVO_D2GRPH_ENABLE 0x6900 +#define AVIVO_D2GRPH_CONTROL 0x6904 +#define AVIVO_D2GRPH_LUT_SEL 0x6908 +#define AVIVO_D2GRPH_PRIMARY_SURFACE_ADDRESS 0x6910 +#define AVIVO_D2GRPH_SECONDARY_SURFACE_ADDRESS 0x6918 +#define AVIVO_D2GRPH_PITCH 0x6920 +#define AVIVO_D2GRPH_SURFACE_OFFSET_X 0x6924 +#define AVIVO_D2GRPH_SURFACE_OFFSET_Y 0x6928 +#define AVIVO_D2GRPH_X_START 0x692c +#define AVIVO_D2GRPH_Y_START 0x6930 +#define AVIVO_D2GRPH_X_END 0x6934 +#define AVIVO_D2GRPH_Y_END 0x6938 +#define AVIVO_D2GRPH_UPDATE 0x6944 +#define AVIVO_D2GRPH_FLIP_CONTROL 0x6948 + +#define AVIVO_D2CUR_CONTROL 0x6c00 +#define AVIVO_D2CUR_SURFACE_ADDRESS 0x6c08 +#define AVIVO_D2CUR_SIZE 0x6c10 +#define AVIVO_D2CUR_POSITION 0x6c14 + +#define RS690_DCP_CONTROL 0x6c9c + +#define AVIVO_D2MODE_DATA_FORMAT 0x6d28 +#define AVIVO_D2MODE_DESKTOP_HEIGHT 0x6d2c +#define AVIVO_D2MODE_VIEWPORT_START 0x6d80 +#define AVIVO_D2MODE_VIEWPORT_SIZE 0x6d84 +#define AVIVO_D2MODE_EXT_OVERSCAN_LEFT_RIGHT 0x6d88 +#define AVIVO_D2MODE_EXT_OVERSCAN_TOP_BOTTOM 0x6d8c + +#define AVIVO_D2SCL_SCALER_ENABLE 0x6d90 +#define AVIVO_D2SCL_SCALER_TAP_CONTROL 0x6d94 +#define AVIVO_D2SCL_UPDATE 0x6dcc + +#define AVIVO_DDIA_BIT_DEPTH_CONTROL 0x7214 + +#define AVIVO_DACA_ENABLE 0x7800 +# define AVIVO_DAC_ENABLE (1 << 0) +#define AVIVO_DACA_SOURCE_SELECT 0x7804 +# define AVIVO_DAC_SOURCE_CRTC1 (0 << 0) +# define AVIVO_DAC_SOURCE_CRTC2 (1 << 0) +# define AVIVO_DAC_SOURCE_TV (2 << 0) + +#define AVIVO_DACA_FORCE_OUTPUT_CNTL 0x783c +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) +# define AVIVO_DACA_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) +#define AVIVO_DACA_POWERDOWN 0x7850 +# define AVIVO_DACA_POWERDOWN_POWERDOWN (1 << 0) +# define AVIVO_DACA_POWERDOWN_BLUE (1 << 8) +# define AVIVO_DACA_POWERDOWN_GREEN (1 << 16) +# define AVIVO_DACA_POWERDOWN_RED (1 << 24) + +#define AVIVO_DACB_ENABLE 0x7a00 +#define AVIVO_DACB_SOURCE_SELECT 0x7a04 +#define AVIVO_DACB_FORCE_OUTPUT_CNTL 0x7a3c +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_FORCE_DATA_EN (1 << 0) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_SHIFT (8) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_BLUE (1 << 0) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_GREEN (1 << 1) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_SEL_RED (1 << 2) +# define AVIVO_DACB_FORCE_OUTPUT_CNTL_DATA_ON_BLANKB_ONLY (1 << 24) +#define AVIVO_DACB_POWERDOWN 0x7a50 +# define AVIVO_DACB_POWERDOWN_POWERDOWN (1 << 0) +# define AVIVO_DACB_POWERDOWN_BLUE (1 << 8) +# define AVIVO_DACB_POWERDOWN_GREEN (1 << 16) +# define AVIVO_DACB_POWERDOWN_RED + +#define AVIVO_TMDSA_CNTL 0x7880 +# define AVIVO_TMDSA_CNTL_ENABLE (1 << 0) +# define AVIVO_TMDSA_CNTL_HPD_MASK (1 << 4) +# define AVIVO_TMDSA_CNTL_HPD_SELECT (1 << 8) +# define AVIVO_TMDSA_CNTL_SYNC_PHASE (1 << 12) +# define AVIVO_TMDSA_CNTL_PIXEL_ENCODING (1 << 16) +# define AVIVO_TMDSA_CNTL_DUAL_LINK_ENABLE (1 << 24) +# define AVIVO_TMDSA_CNTL_SWAP (1 << 28) +#define AVIVO_TMDSA_SOURCE_SELECT 0x7884 +/* 78a8 appears to be some kind of (reasonably tolerant) clock? + * 78d0 definitely hits the transmitter, definitely clock. */ +/* MYSTERY1 This appears to control dithering? */ +#define AVIVO_TMDSA_BIT_DEPTH_CONTROL 0x7894 +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) +# define AVIVO_TMDS_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) +#define AVIVO_TMDSA_DCBALANCER_CONTROL 0x78d0 +# define AVIVO_TMDSA_DCBALANCER_CONTROL_EN (1 << 0) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_EN (1 << 8) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) +# define AVIVO_TMDSA_DCBALANCER_CONTROL_FORCE (1 << 24) +#define AVIVO_TMDSA_DATA_SYNCHRONIZATION 0x78d8 +# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) +# define AVIVO_TMDSA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) +#define AVIVO_TMDSA_CLOCK_ENABLE 0x7900 +#define AVIVO_TMDSA_TRANSMITTER_ENABLE 0x7904 +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX0_ENABLE (1 << 0) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX1_ENABLE (1 << 8) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_TX_ENABLE_HPD_MASK (1 << 16) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) +# define AVIVO_TMDSA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) + +#define AVIVO_TMDSA_TRANSMITTER_CONTROL 0x7910 +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK (1 << 8) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK (1 << 14) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) +# define AVIVO_TMDSA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) + +#define AVIVO_LVTMA_CNTL 0x7a80 +# define AVIVO_LVTMA_CNTL_ENABLE (1 << 0) +# define AVIVO_LVTMA_CNTL_HPD_MASK (1 << 4) +# define AVIVO_LVTMA_CNTL_HPD_SELECT (1 << 8) +# define AVIVO_LVTMA_CNTL_SYNC_PHASE (1 << 12) +# define AVIVO_LVTMA_CNTL_PIXEL_ENCODING (1 << 16) +# define AVIVO_LVTMA_CNTL_DUAL_LINK_ENABLE (1 << 24) +# define AVIVO_LVTMA_CNTL_SWAP (1 << 28) +#define AVIVO_LVTMA_SOURCE_SELECT 0x7a84 +#define AVIVO_LVTMA_COLOR_FORMAT 0x7a88 +#define AVIVO_LVTMA_BIT_DEPTH_CONTROL 0x7a94 +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_EN (1 << 0) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TRUNCATE_DEPTH (1 << 4) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_EN (1 << 8) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_SPATIAL_DITHER_DEPTH (1 << 12) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_EN (1 << 16) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_DEPTH (1 << 20) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_LEVEL (1 << 24) +# define AVIVO_LVTMA_BIT_DEPTH_CONTROL_TEMPORAL_DITHER_RESET (1 << 26) + + + +#define AVIVO_LVTMA_DCBALANCER_CONTROL 0x7ad0 +# define AVIVO_LVTMA_DCBALANCER_CONTROL_EN (1 << 0) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_EN (1 << 8) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_TEST_IN_SHIFT (16) +# define AVIVO_LVTMA_DCBALANCER_CONTROL_FORCE (1 << 24) + +#define AVIVO_LVTMA_DATA_SYNCHRONIZATION 0x78d8 +# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_DSYNSEL (1 << 0) +# define AVIVO_LVTMA_DATA_SYNCHRONIZATION_PFREQCHG (1 << 8) +#define R500_LVTMA_CLOCK_ENABLE 0x7b00 +#define R600_LVTMA_CLOCK_ENABLE 0x7b04 + +#define R500_LVTMA_TRANSMITTER_ENABLE 0x7b04 +#define R600_LVTMA_TRANSMITTER_ENABLE 0x7b08 +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC0EN (1 << 1) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD00EN (1 << 2) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD01EN (1 << 3) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD02EN (1 << 4) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD03EN (1 << 5) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKC1EN (1 << 9) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD10EN (1 << 10) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD11EN (1 << 11) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKD12EN (1 << 12) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKCEN_HPD_MASK (1 << 17) +# define AVIVO_LVTMA_TRANSMITTER_ENABLE_LNKDEN_HPD_MASK (1 << 18) + +#define R500_LVTMA_TRANSMITTER_CONTROL 0x7b10 +#define R600_LVTMA_TRANSMITTER_CONTROL 0x7b14 +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_ENABLE (1 << 0) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_RESET (1 << 1) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_HPD_MASK_SHIFT (2) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_IDSCKSEL (1 << 4) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BGSLEEP (1 << 5) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_PLL_PWRUP_SEQ_EN (1 << 6) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK (1 << 8) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TMCLK_FROM_PADS (1 << 13) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK (1 << 14) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_TDCLK_FROM_PADS (1 << 15) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_CLK_PATTERN_SHIFT (16) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_BYPASS_PLL (1 << 28) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_USE_CLK_DATA (1 << 29) +# define AVIVO_LVTMA_TRANSMITTER_CONTROL_INPUT_TEST_CLK_SEL (1 << 31) + +#define R500_LVTMA_PWRSEQ_CNTL 0x7af0 +#define R600_LVTMA_PWRSEQ_CNTL 0x7af4 +# define AVIVO_LVTMA_PWRSEQ_EN (1 << 0) +# define AVIVO_LVTMA_PWRSEQ_PLL_ENABLE_MASK (1 << 2) +# define AVIVO_LVTMA_PWRSEQ_PLL_RESET_MASK (1 << 3) +# define AVIVO_LVTMA_PWRSEQ_TARGET_STATE (1 << 4) +# define AVIVO_LVTMA_SYNCEN (1 << 8) +# define AVIVO_LVTMA_SYNCEN_OVRD (1 << 9) +# define AVIVO_LVTMA_SYNCEN_POL (1 << 10) +# define AVIVO_LVTMA_DIGON (1 << 16) +# define AVIVO_LVTMA_DIGON_OVRD (1 << 17) +# define AVIVO_LVTMA_DIGON_POL (1 << 18) +# define AVIVO_LVTMA_BLON (1 << 24) +# define AVIVO_LVTMA_BLON_OVRD (1 << 25) +# define AVIVO_LVTMA_BLON_POL (1 << 26) + +#define R500_LVTMA_PWRSEQ_STATE 0x7af4 +#define R600_LVTMA_PWRSEQ_STATE 0x7af8 +# define AVIVO_LVTMA_PWRSEQ_STATE_TARGET_STATE_R (1 << 0) +# define AVIVO_LVTMA_PWRSEQ_STATE_DIGON (1 << 1) +# define AVIVO_LVTMA_PWRSEQ_STATE_SYNCEN (1 << 2) +# define AVIVO_LVTMA_PWRSEQ_STATE_BLON (1 << 3) +# define AVIVO_LVTMA_PWRSEQ_STATE_DONE (1 << 4) +# define AVIVO_LVTMA_PWRSEQ_STATE_STATUS_SHIFT (8) + +#define AVIVO_LVDS_BACKLIGHT_CNTL 0x7af8 +# define AVIVO_LVDS_BACKLIGHT_CNTL_EN (1 << 0) +# define AVIVO_LVDS_BACKLIGHT_LEVEL_MASK 0x0000ff00 +# define AVIVO_LVDS_BACKLIGHT_LEVEL_SHIFT 8 + +#define AVIVO_DVOA_BIT_DEPTH_CONTROL 0x7988 + +#define AVIVO_GPIO_0 0x7e30 +#define AVIVO_GPIO_1 0x7e40 +#define AVIVO_GPIO_2 0x7e50 +#define AVIVO_GPIO_3 0x7e60 + +#define AVIVO_DC_GPIO_HPD_MASK 0x7e90 +#define AVIVO_DC_GPIO_HPD_A 0x7e94 +#define AVIVO_DC_GPIO_HPD_EN 0x7e98 +#define AVIVO_DC_GPIO_HPD_Y 0x7e9c + +#define AVIVO_I2C_STATUS 0x7d30 +# define AVIVO_I2C_STATUS_DONE (1 << 0) +# define AVIVO_I2C_STATUS_NACK (1 << 1) +# define AVIVO_I2C_STATUS_HALT (1 << 2) +# define AVIVO_I2C_STATUS_GO (1 << 3) +# define AVIVO_I2C_STATUS_MASK 0x7 +/* If radeon_mm_i2c is to be believed, this is HALT, NACK, and maybe + * DONE? */ +# define AVIVO_I2C_STATUS_CMD_RESET 0x7 +# define AVIVO_I2C_STATUS_CMD_WAIT (1 << 3) +#define AVIVO_I2C_STOP 0x7d34 +#define AVIVO_I2C_START_CNTL 0x7d38 +# define AVIVO_I2C_START (1 << 8) +# define AVIVO_I2C_CONNECTOR0 (0 << 16) +# define AVIVO_I2C_CONNECTOR1 (1 << 16) +#define R520_I2C_START (1<<0) +#define R520_I2C_STOP (1<<1) +#define R520_I2C_RX (1<<2) +#define R520_I2C_EN (1<<8) +#define R520_I2C_DDC1 (0<<16) +#define R520_I2C_DDC2 (1<<16) +#define R520_I2C_DDC3 (2<<16) +#define R520_I2C_DDC_MASK (3<<16) +#define AVIVO_I2C_CONTROL2 0x7d3c +# define AVIVO_I2C_7D3C_SIZE_SHIFT 8 +# define AVIVO_I2C_7D3C_SIZE_MASK (0xf << 8) +#define AVIVO_I2C_CONTROL3 0x7d40 +/* Reading is done 4 bytes at a time: read the bottom 8 bits from + * 7d44, four times in a row. + * Writing is a little more complex. First write DATA with + * 0xnnnnnnzz, then 0xnnnnnnyy, where nnnnnn is some non-deterministic + * magic number, zz is, I think, the slave address, and yy is the byte + * you want to write. */ +#define AVIVO_I2C_DATA 0x7d44 +#define R520_I2C_ADDR_COUNT_MASK (0x7) +#define R520_I2C_DATA_COUNT_SHIFT (8) +#define R520_I2C_DATA_COUNT_MASK (0xF00) +#define AVIVO_I2C_CNTL 0x7d50 +# define AVIVO_I2C_EN (1 << 0) +# define AVIVO_I2C_RESET (1 << 8) + +#define R600_GENERAL_PWRMGT 0x618 +# define R600_OPEN_DRAIN_PADS (1 << 11) + +#define R600_LOWER_GPIO_ENABLE 0x710 +#define R600_CTXSW_VID_LOWER_GPIO_CNTL 0x718 +#define R600_HIGH_VID_LOWER_GPIO_CNTL 0x71c +#define R600_MEDIUM_VID_LOWER_GPIO_CNTL 0x720 +#define R600_LOW_VID_LOWER_GPIO_CNTL 0x724 + +#define R600_MC_VM_FB_LOCATION 0x2180 +#define R600_MC_VM_AGP_TOP 0x2184 +#define R600_MC_VM_AGP_BOT 0x2188 +#define R600_MC_VM_AGP_BASE 0x218c +#define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2190 +#define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2194 +#define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x2198 + +#define R700_MC_VM_FB_LOCATION 0x2024 +#define R700_MC_VM_AGP_TOP 0x2028 +#define R700_MC_VM_AGP_BOT 0x202c +#define R700_MC_VM_AGP_BASE 0x2030 + +#define R600_HDP_NONSURFACE_BASE 0x2c04 + +#define R600_BUS_CNTL 0x5420 +#define R600_CONFIG_CNTL 0x5424 +#define R600_CONFIG_MEMSIZE 0x5428 +#define R600_CONFIG_F0_BASE 0x542C +#define R600_CONFIG_APER_SIZE 0x5430 + +#define R600_ROM_CNTL 0x1600 +# define R600_SCK_OVERWRITE (1 << 1) +# define R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT 28 +# define R600_SCK_PRESCALE_CRYSTAL_CLK_MASK (0xf << 28) + +#define R600_CG_SPLL_FUNC_CNTL 0x600 +# define R600_SPLL_BYPASS_EN (1 << 3) +#define R600_CG_SPLL_STATUS 0x60c +# define R600_SPLL_CHG_STATUS (1 << 1) + +#define R600_BIOS_0_SCRATCH 0x1724 +#define R600_BIOS_1_SCRATCH 0x1728 +#define R600_BIOS_2_SCRATCH 0x172c +#define R600_BIOS_3_SCRATCH 0x1730 +#define R600_BIOS_4_SCRATCH 0x1734 +#define R600_BIOS_5_SCRATCH 0x1738 +#define R600_BIOS_6_SCRATCH 0x173c +#define R600_BIOS_7_SCRATCH 0x1740 + +/* evergreen */ +#define EVERGREEN_VGA_MEMORY_BASE_ADDRESS 0x310 +#define EVERGREEN_VGA_MEMORY_BASE_ADDRESS_HIGH 0x324 +#define EVERGREEN_D3VGA_CONTROL 0x3e0 +#define EVERGREEN_D4VGA_CONTROL 0x3e4 +#define EVERGREEN_D5VGA_CONTROL 0x3e8 +#define EVERGREEN_D6VGA_CONTROL 0x3ec + +#define EVERGREEN_P1PLL_SS_CNTL 0x414 +#define EVERGREEN_P2PLL_SS_CNTL 0x454 +# define EVERGREEN_PxPLL_SS_EN (1 << 12) +/* GRPH blocks at 0x6800, 0x7400, 0x10000, 0x10c00, 0x11800, 0x12400 */ +#define EVERGREEN_GRPH_ENABLE 0x6800 +#define EVERGREEN_GRPH_CONTROL 0x6804 +# define EVERGREEN_GRPH_DEPTH(x) (((x) & 0x3) << 0) +# define EVERGREEN_GRPH_DEPTH_8BPP 0 +# define EVERGREEN_GRPH_DEPTH_16BPP 1 +# define EVERGREEN_GRPH_DEPTH_32BPP 2 +# define EVERGREEN_GRPH_FORMAT(x) (((x) & 0x7) << 8) +/* 8 BPP */ +# define EVERGREEN_GRPH_FORMAT_INDEXED 0 +/* 16 BPP */ +# define EVERGREEN_GRPH_FORMAT_ARGB1555 0 +# define EVERGREEN_GRPH_FORMAT_ARGB565 1 +# define EVERGREEN_GRPH_FORMAT_ARGB4444 2 +# define EVERGREEN_GRPH_FORMAT_AI88 3 +# define EVERGREEN_GRPH_FORMAT_MONO16 4 +# define EVERGREEN_GRPH_FORMAT_BGRA5551 5 +/* 32 BPP */ +# define EVERGREEN_GRPH_FORMAT_ARGB8888 0 +# define EVERGREEN_GRPH_FORMAT_ARGB2101010 1 +# define EVERGREEN_GRPH_FORMAT_32BPP_DIG 2 +# define EVERGREEN_GRPH_FORMAT_8B_ARGB2101010 3 +# define EVERGREEN_GRPH_FORMAT_BGRA1010102 4 +# define EVERGREEN_GRPH_FORMAT_8B_BGRA1010102 5 +# define EVERGREEN_GRPH_FORMAT_RGB111110 6 +# define EVERGREEN_GRPH_FORMAT_BGR101111 7 +#define EVERGREEN_GRPH_SWAP_CONTROL 0x680c +# define EVERGREEN_GRPH_ENDIAN_SWAP(x) (((x) & 0x3) << 0) +# define EVERGREEN_GRPH_ENDIAN_NONE 0 +# define EVERGREEN_GRPH_ENDIAN_8IN16 1 +# define EVERGREEN_GRPH_ENDIAN_8IN32 2 +# define EVERGREEN_GRPH_ENDIAN_8IN64 3 +# define EVERGREEN_GRPH_RED_CROSSBAR(x) (((x) & 0x3) << 4) +# define EVERGREEN_GRPH_RED_SEL_R 0 +# define EVERGREEN_GRPH_RED_SEL_G 1 +# define EVERGREEN_GRPH_RED_SEL_B 2 +# define EVERGREEN_GRPH_RED_SEL_A 3 +# define EVERGREEN_GRPH_GREEN_CROSSBAR(x) (((x) & 0x3) << 6) +# define EVERGREEN_GRPH_GREEN_SEL_G 0 +# define EVERGREEN_GRPH_GREEN_SEL_B 1 +# define EVERGREEN_GRPH_GREEN_SEL_A 2 +# define EVERGREEN_GRPH_GREEN_SEL_R 3 +# define EVERGREEN_GRPH_BLUE_CROSSBAR(x) (((x) & 0x3) << 8) +# define EVERGREEN_GRPH_BLUE_SEL_B 0 +# define EVERGREEN_GRPH_BLUE_SEL_A 1 +# define EVERGREEN_GRPH_BLUE_SEL_R 2 +# define EVERGREEN_GRPH_BLUE_SEL_G 3 +# define EVERGREEN_GRPH_ALPHA_CROSSBAR(x) (((x) & 0x3) << 10) +# define EVERGREEN_GRPH_ALPHA_SEL_A 0 +# define EVERGREEN_GRPH_ALPHA_SEL_R 1 +# define EVERGREEN_GRPH_ALPHA_SEL_G 2 +# define EVERGREEN_GRPH_ALPHA_SEL_B 3 +#define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS 0x6810 +#define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS 0x6814 +# define EVERGREEN_GRPH_DFQ_ENABLE (1 << 0) +# define EVERGREEN_GRPH_SURFACE_ADDRESS_MASK 0xffffff00 +#define EVERGREEN_GRPH_PITCH 0x6818 +#define EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x681c +#define EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x6820 +#define EVERGREEN_GRPH_SURFACE_OFFSET_X 0x6824 +#define EVERGREEN_GRPH_SURFACE_OFFSET_Y 0x6828 +#define EVERGREEN_GRPH_X_START 0x682c +#define EVERGREEN_GRPH_Y_START 0x6830 +#define EVERGREEN_GRPH_X_END 0x6834 +#define EVERGREEN_GRPH_Y_END 0x6838 + +/* CUR blocks at 0x6998, 0x7598, 0x10198, 0x10d98, 0x11998, 0x12598 */ +#define EVERGREEN_CUR_CONTROL 0x6998 +# define EVERGREEN_CURSOR_EN (1 << 0) +# define EVERGREEN_CURSOR_MODE(x) (((x) & 0x3) << 8) +# define EVERGREEN_CURSOR_MONO 0 +# define EVERGREEN_CURSOR_24_1 1 +# define EVERGREEN_CURSOR_24_8_PRE_MULT 2 +# define EVERGREEN_CURSOR_24_8_UNPRE_MULT 3 +# define EVERGREEN_CURSOR_2X_MAGNIFY (1 << 16) +# define EVERGREEN_CURSOR_FORCE_MC_ON (1 << 20) +# define EVERGREEN_CURSOR_URGENT_CONTROL(x) (((x) & 0x7) << 24) +# define EVERGREEN_CURSOR_URGENT_ALWAYS 0 +# define EVERGREEN_CURSOR_URGENT_1_8 1 +# define EVERGREEN_CURSOR_URGENT_1_4 2 +# define EVERGREEN_CURSOR_URGENT_3_8 3 +# define EVERGREEN_CURSOR_URGENT_1_2 4 +#define EVERGREEN_CUR_SURFACE_ADDRESS 0x699c +# define EVERGREEN_CUR_SURFACE_ADDRESS_MASK 0xfffff000 +#define EVERGREEN_CUR_SIZE 0x69a0 +#define EVERGREEN_CUR_SURFACE_ADDRESS_HIGH 0x69a4 +#define EVERGREEN_CUR_POSITION 0x69a8 +#define EVERGREEN_CUR_HOT_SPOT 0x69ac +#define EVERGREEN_CUR_COLOR1 0x69b0 +#define EVERGREEN_CUR_COLOR2 0x69b4 +#define EVERGREEN_CUR_UPDATE 0x69b8 +# define EVERGREEN_CURSOR_UPDATE_PENDING (1 << 0) +# define EVERGREEN_CURSOR_UPDATE_TAKEN (1 << 1) +# define EVERGREEN_CURSOR_UPDATE_LOCK (1 << 16) +# define EVERGREEN_CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24) + +/* LUT blocks at 0x69e0, 0x75e0, 0x101e0, 0x10de0, 0x119e0, 0x125e0 */ +#define EVERGREEN_DC_LUT_RW_MODE 0x69e0 +#define EVERGREEN_DC_LUT_RW_INDEX 0x69e4 +#define EVERGREEN_DC_LUT_SEQ_COLOR 0x69e8 +#define EVERGREEN_DC_LUT_PWL_DATA 0x69ec +#define EVERGREEN_DC_LUT_30_COLOR 0x69f0 +#define EVERGREEN_DC_LUT_VGA_ACCESS_ENABLE 0x69f4 +#define EVERGREEN_DC_LUT_WRITE_EN_MASK 0x69f8 +#define EVERGREEN_DC_LUT_AUTOFILL 0x69fc +#define EVERGREEN_DC_LUT_CONTROL 0x6a00 +#define EVERGREEN_DC_LUT_BLACK_OFFSET_BLUE 0x6a04 +#define EVERGREEN_DC_LUT_BLACK_OFFSET_GREEN 0x6a08 +#define EVERGREEN_DC_LUT_BLACK_OFFSET_RED 0x6a0c +#define EVERGREEN_DC_LUT_WHITE_OFFSET_BLUE 0x6a10 +#define EVERGREEN_DC_LUT_WHITE_OFFSET_GREEN 0x6a14 +#define EVERGREEN_DC_LUT_WHITE_OFFSET_RED 0x6a18 + +#define EVERGREEN_DATA_FORMAT 0x6b00 +# define EVERGREEN_INTERLEAVE_EN (1 << 0) +#define EVERGREEN_DESKTOP_HEIGHT 0x6b04 + +#define EVERGREEN_VIEWPORT_START 0x6d70 +#define EVERGREEN_VIEWPORT_SIZE 0x6d74 + +/* display controller offsets used for crtc/cur/lut/grph/viewport/etc. */ +#define EVERGREEN_CRTC0_REGISTER_OFFSET (0x6df0 - 0x6df0) +#define EVERGREEN_CRTC1_REGISTER_OFFSET (0x79f0 - 0x6df0) +#define EVERGREEN_CRTC2_REGISTER_OFFSET (0x105f0 - 0x6df0) +#define EVERGREEN_CRTC3_REGISTER_OFFSET (0x111f0 - 0x6df0) +#define EVERGREEN_CRTC4_REGISTER_OFFSET (0x11df0 - 0x6df0) +#define EVERGREEN_CRTC5_REGISTER_OFFSET (0x129f0 - 0x6df0) + +/* CRTC blocks at 0x6df0, 0x79f0, 0x105f0, 0x111f0, 0x11df0, 0x129f0 */ +#define EVERGREEN_CRTC_CONTROL 0x6e70 +# define EVERGREEN_CRTC_MASTER_EN (1 << 0) +#define EVERGREEN_CRTC_UPDATE_LOCK 0x6ed4 + +#define EVERGREEN_DC_GPIO_HPD_MASK 0x64b0 +#define EVERGREEN_DC_GPIO_HPD_A 0x64b4 +#define EVERGREEN_DC_GPIO_HPD_EN 0x64b8 +#define EVERGREEN_DC_GPIO_HPD_Y 0x64bc + +#define R300_GB_TILE_CONFIG 0x4018 +# define R300_ENABLE_TILING (1 << 0) +# define R300_PIPE_COUNT_RV350 (0 << 1) +# define R300_PIPE_COUNT_R300 (3 << 1) +# define R300_PIPE_COUNT_R420_3P (6 << 1) +# define R300_PIPE_COUNT_R420 (7 << 1) +# define R300_TILE_SIZE_8 (0 << 4) +# define R300_TILE_SIZE_16 (1 << 4) +# define R300_TILE_SIZE_32 (2 << 4) +# define R300_SUBPIXEL_1_12 (0 << 16) +# define R300_SUBPIXEL_1_16 (1 << 16) +#define R300_GB_SELECT 0x401c +#define R300_GB_ENABLE 0x4008 +#define R300_GB_AA_CONFIG 0x4020 +#define R400_GB_PIPE_SELECT 0x402c +#define R300_GB_MSPOS0 0x4010 +# define R300_MS_X0_SHIFT 0 +# define R300_MS_Y0_SHIFT 4 +# define R300_MS_X1_SHIFT 8 +# define R300_MS_Y1_SHIFT 12 +# define R300_MS_X2_SHIFT 16 +# define R300_MS_Y2_SHIFT 20 +# define R300_MSBD0_Y_SHIFT 24 +# define R300_MSBD0_X_SHIFT 28 +#define R300_GB_MSPOS1 0x4014 +# define R300_MS_X3_SHIFT 0 +# define R300_MS_Y3_SHIFT 4 +# define R300_MS_X4_SHIFT 8 +# define R300_MS_Y4_SHIFT 12 +# define R300_MS_X5_SHIFT 16 +# define R300_MS_Y5_SHIFT 20 +# define R300_MSBD1_SHIFT 24 + +#define R300_GA_ENHANCE 0x4274 +# define R300_GA_DEADLOCK_CNTL (1 << 0) +# define R300_GA_FASTSYNC_CNTL (1 << 1) + +#define R300_GA_POLY_MODE 0x4288 +# define R300_FRONT_PTYPE_POINT (0 << 4) +# define R300_FRONT_PTYPE_LINE (1 << 4) +# define R300_FRONT_PTYPE_TRIANGE (2 << 4) +# define R300_BACK_PTYPE_POINT (0 << 7) +# define R300_BACK_PTYPE_LINE (1 << 7) +# define R300_BACK_PTYPE_TRIANGE (2 << 7) +#define R300_GA_ROUND_MODE 0x428c +# define R300_GEOMETRY_ROUND_TRUNC (0 << 0) +# define R300_GEOMETRY_ROUND_NEAREST (1 << 0) +# define R300_COLOR_ROUND_TRUNC (0 << 2) +# define R300_COLOR_ROUND_NEAREST (1 << 2) +#define R300_GA_COLOR_CONTROL 0x4278 +# define R300_RGB0_SHADING_SOLID (0 << 0) +# define R300_RGB0_SHADING_FLAT (1 << 0) +# define R300_RGB0_SHADING_GOURAUD (2 << 0) +# define R300_ALPHA0_SHADING_SOLID (0 << 2) +# define R300_ALPHA0_SHADING_FLAT (1 << 2) +# define R300_ALPHA0_SHADING_GOURAUD (2 << 2) +# define R300_RGB1_SHADING_SOLID (0 << 4) +# define R300_RGB1_SHADING_FLAT (1 << 4) +# define R300_RGB1_SHADING_GOURAUD (2 << 4) +# define R300_ALPHA1_SHADING_SOLID (0 << 6) +# define R300_ALPHA1_SHADING_FLAT (1 << 6) +# define R300_ALPHA1_SHADING_GOURAUD (2 << 6) +# define R300_RGB2_SHADING_SOLID (0 << 8) +# define R300_RGB2_SHADING_FLAT (1 << 8) +# define R300_RGB2_SHADING_GOURAUD (2 << 8) +# define R300_ALPHA2_SHADING_SOLID (0 << 10) +# define R300_ALPHA2_SHADING_FLAT (1 << 10) +# define R300_ALPHA2_SHADING_GOURAUD (2 << 10) +# define R300_RGB3_SHADING_SOLID (0 << 12) +# define R300_RGB3_SHADING_FLAT (1 << 12) +# define R300_RGB3_SHADING_GOURAUD (2 << 12) +# define R300_ALPHA3_SHADING_SOLID (0 << 14) +# define R300_ALPHA3_SHADING_FLAT (1 << 14) +# define R300_ALPHA3_SHADING_GOURAUD (2 << 14) +#define R300_GA_OFFSET 0x4290 + +#define R500_SU_REG_DEST 0x42c8 + +#define R300_VAP_CNTL_STATUS 0x2140 +# define R300_PVS_BYPASS (1 << 8) +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 +#define R300_VAP_CNTL 0x2080 +# define R300_PVS_NUM_SLOTS_SHIFT 0 +# define R300_PVS_NUM_CNTLRS_SHIFT 4 +# define R300_PVS_NUM_FPUS_SHIFT 8 +# define R300_VF_MAX_VTX_NUM_SHIFT 18 +# define R300_GL_CLIP_SPACE_DEF (0 << 22) +# define R300_DX_CLIP_SPACE_DEF (1 << 22) +# define R500_TCL_STATE_OPTIMIZATION (1 << 23) +#define R300_VAP_VTE_CNTL 0x20B0 +# define R300_VPORT_X_SCALE_ENA (1 << 0) +# define R300_VPORT_X_OFFSET_ENA (1 << 1) +# define R300_VPORT_Y_SCALE_ENA (1 << 2) +# define R300_VPORT_Y_OFFSET_ENA (1 << 3) +# define R300_VPORT_Z_SCALE_ENA (1 << 4) +# define R300_VPORT_Z_OFFSET_ENA (1 << 5) +# define R300_VTX_XY_FMT (1 << 8) +# define R300_VTX_Z_FMT (1 << 9) +# define R300_VTX_W0_FMT (1 << 10) +#define R300_VAP_VTX_STATE_CNTL 0x2180 +#define R300_VAP_PSC_SGN_NORM_CNTL 0x21DC +#define R300_VAP_PROG_STREAM_CNTL_0 0x2150 +# define R300_DATA_TYPE_0_SHIFT 0 +# define R300_DATA_TYPE_FLOAT_1 0 +# define R300_DATA_TYPE_FLOAT_2 1 +# define R300_DATA_TYPE_FLOAT_3 2 +# define R300_DATA_TYPE_FLOAT_4 3 +# define R300_DATA_TYPE_BYTE 4 +# define R300_DATA_TYPE_D3DCOLOR 5 +# define R300_DATA_TYPE_SHORT_2 6 +# define R300_DATA_TYPE_SHORT_4 7 +# define R300_DATA_TYPE_VECTOR_3_TTT 8 +# define R300_DATA_TYPE_VECTOR_3_EET 9 +# define R300_SKIP_DWORDS_0_SHIFT 4 +# define R300_DST_VEC_LOC_0_SHIFT 8 +# define R300_LAST_VEC_0 (1 << 13) +# define R300_SIGNED_0 (1 << 14) +# define R300_NORMALIZE_0 (1 << 15) +# define R300_DATA_TYPE_1_SHIFT 16 +# define R300_SKIP_DWORDS_1_SHIFT 20 +# define R300_DST_VEC_LOC_1_SHIFT 24 +# define R300_LAST_VEC_1 (1 << 29) +# define R300_SIGNED_1 (1 << 30) +# define R300_NORMALIZE_1 (1 << 31) +#define R300_VAP_PROG_STREAM_CNTL_1 0x2154 +# define R300_DATA_TYPE_2_SHIFT 0 +# define R300_SKIP_DWORDS_2_SHIFT 4 +# define R300_DST_VEC_LOC_2_SHIFT 8 +# define R300_LAST_VEC_2 (1 << 13) +# define R300_SIGNED_2 (1 << 14) +# define R300_NORMALIZE_2 (1 << 15) +# define R300_DATA_TYPE_3_SHIFT 16 +# define R300_SKIP_DWORDS_3_SHIFT 20 +# define R300_DST_VEC_LOC_3_SHIFT 24 +# define R300_LAST_VEC_3 (1 << 29) +# define R300_SIGNED_3 (1 << 30) +# define R300_NORMALIZE_3 (1 << 31) +#define R300_VAP_PROG_STREAM_CNTL_EXT_0 0x21e0 +# define R300_SWIZZLE_SELECT_X_0_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_0_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_0_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_0_SHIFT 9 +# define R300_SWIZZLE_SELECT_X 0 +# define R300_SWIZZLE_SELECT_Y 1 +# define R300_SWIZZLE_SELECT_Z 2 +# define R300_SWIZZLE_SELECT_W 3 +# define R300_SWIZZLE_SELECT_FP_ZERO 4 +# define R300_SWIZZLE_SELECT_FP_ONE 5 +# define R300_WRITE_ENA_0_SHIFT 12 +# define R300_WRITE_ENA_X 1 +# define R300_WRITE_ENA_Y 2 +# define R300_WRITE_ENA_Z 4 +# define R300_WRITE_ENA_W 8 +# define R300_SWIZZLE_SELECT_X_1_SHIFT 16 +# define R300_SWIZZLE_SELECT_Y_1_SHIFT 19 +# define R300_SWIZZLE_SELECT_Z_1_SHIFT 22 +# define R300_SWIZZLE_SELECT_W_1_SHIFT 25 +# define R300_WRITE_ENA_1_SHIFT 28 +#define R300_VAP_PROG_STREAM_CNTL_EXT_1 0x21e4 +# define R300_SWIZZLE_SELECT_X_2_SHIFT 0 +# define R300_SWIZZLE_SELECT_Y_2_SHIFT 3 +# define R300_SWIZZLE_SELECT_Z_2_SHIFT 6 +# define R300_SWIZZLE_SELECT_W_2_SHIFT 9 +# define R300_WRITE_ENA_2_SHIFT 12 +# define R300_SWIZZLE_SELECT_X_3_SHIFT 16 +# define R300_SWIZZLE_SELECT_Y_3_SHIFT 19 +# define R300_SWIZZLE_SELECT_Z_3_SHIFT 22 +# define R300_SWIZZLE_SELECT_W_3_SHIFT 25 +# define R300_WRITE_ENA_3_SHIFT 28 +#define R300_VAP_PVS_CODE_CNTL_0 0x22D0 +# define R300_PVS_FIRST_INST_SHIFT 0 +# define R300_PVS_XYZW_VALID_INST_SHIFT 10 +# define R300_PVS_LAST_INST_SHIFT 20 +#define R300_VAP_PVS_CODE_CNTL_1 0x22D8 +# define R300_PVS_LAST_VTX_SRC_INST_SHIFT 0 +#define R300_VAP_PVS_VECTOR_INDX_REG 0x2200 +# define R300_PVS_CODE_START 0 +# define R300_PVS_CONST_START 512 +# define R500_PVS_CONST_START 1024 +# define R300_PVS_VECTOR_INST_INDEX(x) ((x) + R300_PVS_CODE_START) +# define R300_PVS_VECTOR_CONST_INDEX(x) ((x) + R300_PVS_CONST_START) +# define R500_PVS_VECTOR_CONST_INDEX(x) ((x) + R500_PVS_CONST_START) +#define R300_VAP_PVS_VECTOR_DATA_REG 0x2204 +/* PVS instructions */ +/* Opcode and dst instruction */ +#define R300_PVS_DST_OPCODE(x) ((x) << 0) +/* Vector ops */ +# define R300_VECTOR_NO_OP 0 +# define R300_VE_DOT_PRODUCT 1 +# define R300_VE_MULTIPLY 2 +# define R300_VE_ADD 3 +# define R300_VE_MULTIPLY_ADD 4 +# define R300_VE_DISTANCE_VECTOR 5 +# define R300_VE_FRACTION 6 +# define R300_VE_MAXIMUM 7 +# define R300_VE_MINIMUM 8 +# define R300_VE_SET_GREATER_THAN_EQUAL 9 +# define R300_VE_SET_LESS_THAN 10 +# define R300_VE_MULTIPLYX2_ADD 11 +# define R300_VE_MULTIPLY_CLAMP 12 +# define R300_VE_FLT2FIX_DX 13 +# define R300_VE_FLT2FIX_DX_RND 14 +/* R500 additions */ +# define R500_VE_PRED_SET_EQ_PUSH 15 +# define R500_VE_PRED_SET_GT_PUSH 16 +# define R500_VE_PRED_SET_GTE_PUSH 17 +# define R500_VE_PRED_SET_NEQ_PUSH 18 +# define R500_VE_COND_WRITE_EQ 19 +# define R500_VE_COND_WRITE_GT 20 +# define R500_VE_COND_WRITE_GTE 21 +# define R500_VE_COND_WRITE_NEQ 22 +# define R500_VE_COND_MUX_EQ 23 +# define R500_VE_COND_MUX_GT 24 +# define R500_VE_COND_MUX_GTE 25 +# define R500_VE_SET_GREATER_THAN 26 +# define R500_VE_SET_EQUAL 27 +# define R500_VE_SET_NOT_EQUAL 28 +/* Math ops */ +# define R300_MATH_NO_OP 0 +# define R300_ME_EXP_BASE2_DX 1 +# define R300_ME_LOG_BASE2_DX 2 +# define R300_ME_EXP_BASEE_FF 3 +# define R300_ME_LIGHT_COEFF_DX 4 +# define R300_ME_POWER_FUNC_FF 5 +# define R300_ME_RECIP_DX 6 +# define R300_ME_RECIP_FF 7 +# define R300_ME_RECIP_SQRT_DX 8 +# define R300_ME_RECIP_SQRT_FF 9 +# define R300_ME_MULTIPLY 10 +# define R300_ME_EXP_BASE2_FULL_DX 11 +# define R300_ME_LOG_BASE2_FULL_DX 12 +# define R300_ME_POWER_FUNC_FF_CLAMP_B 13 +# define R300_ME_POWER_FUNC_FF_CLAMP_B1 14 +# define R300_ME_POWER_FUNC_FF_CLAMP_01 15 +# define R300_ME_SIN 16 +# define R300_ME_COS 17 +/* R500 additions */ +# define R500_ME_LOG_BASE2_IEEE 18 +# define R500_ME_RECIP_IEEE 19 +# define R500_ME_RECIP_SQRT_IEEE 20 +# define R500_ME_PRED_SET_EQ 21 +# define R500_ME_PRED_SET_GT 22 +# define R500_ME_PRED_SET_GTE 23 +# define R500_ME_PRED_SET_NEQ 24 +# define R500_ME_PRED_SET_CLR 25 +# define R500_ME_PRED_SET_INV 26 +# define R500_ME_PRED_SET_POP 27 +# define R500_ME_PRED_SET_RESTORE 28 +/* macro */ +# define R300_PVS_MACRO_OP_2CLK_MADD 0 +# define R300_PVS_MACRO_OP_2CLK_M2X_ADD 1 +#define R300_PVS_DST_MATH_INST (1 << 6) +#define R300_PVS_DST_MACRO_INST (1 << 7) +#define R300_PVS_DST_REG_TYPE(x) ((x) << 8) +# define R300_PVS_DST_REG_TEMPORARY 0 +# define R300_PVS_DST_REG_A0 1 +# define R300_PVS_DST_REG_OUT 2 +# define R500_PVS_DST_REG_OUT_REPL_X 3 +# define R300_PVS_DST_REG_ALT_TEMPORARY 4 +# define R300_PVS_DST_REG_INPUT 5 +#define R300_PVS_DST_ADDR_MODE_1 (1 << 12) +#define R300_PVS_DST_OFFSET(x) ((x) << 13) +#define R300_PVS_DST_WE_X (1 << 20) +#define R300_PVS_DST_WE_Y (1 << 21) +#define R300_PVS_DST_WE_Z (1 << 22) +#define R300_PVS_DST_WE_W (1 << 23) +#define R300_PVS_DST_VE_SAT (1 << 24) +#define R300_PVS_DST_ME_SAT (1 << 25) +#define R300_PVS_DST_PRED_ENABLE (1 << 26) +#define R300_PVS_DST_PRED_SENSE (1 << 27) +#define R300_PVS_DST_DUAL_MATH_OP (1 << 28) +#define R300_PVS_DST_ADDR_SEL(x) ((x) << 29) +#define R300_PVS_DST_ADDR_MODE_0 (1 << 31) +/* src operand instruction */ +#define R300_PVS_SRC_REG_TYPE(x) ((x) << 0) +# define R300_PVS_SRC_REG_TEMPORARY 0 +# define R300_PVS_SRC_REG_INPUT 1 +# define R300_PVS_SRC_REG_CONSTANT 2 +# define R300_PVS_SRC_REG_ALT_TEMPORARY 3 +#define R300_SPARE_0 (1 << 2) +#define R300_PVS_SRC_ABS_XYZW (1 << 3) +#define R300_PVS_SRC_ADDR_MODE_0 (1 << 4) +#define R300_PVS_SRC_OFFSET(x) ((x) << 5) +#define R300_PVS_SRC_SWIZZLE_X(x) ((x) << 13) +#define R300_PVS_SRC_SWIZZLE_Y(x) ((x) << 16) +#define R300_PVS_SRC_SWIZZLE_Z(x) ((x) << 19) +#define R300_PVS_SRC_SWIZZLE_W(x) ((x) << 22) +# define R300_PVS_SRC_SELECT_X 0 +# define R300_PVS_SRC_SELECT_Y 1 +# define R300_PVS_SRC_SELECT_Z 2 +# define R300_PVS_SRC_SELECT_W 3 +# define R300_PVS_SRC_SELECT_FORCE_0 4 +# define R300_PVS_SRC_SELECT_FORCE_1 5 +#define R300_PVS_SRC_NEG_X (1 << 25) +#define R300_PVS_SRC_NEG_Y (1 << 26) +#define R300_PVS_SRC_NEG_Z (1 << 27) +#define R300_PVS_SRC_NEG_W (1 << 28) +#define R300_PVS_SRC_ADDR_SEL(x) ((x) << 29) +#define R300_PVS_SRC_ADDR_MODE_1 (1 << 31) + +#define R300_VAP_PVS_CONST_CNTL 0x22d4 +# define R300_PVS_CONST_BASE_OFFSET(x) ((x) << 0) +# define R300_PVS_MAX_CONST_ADDR(x) ((x) << 16) + +#define R300_VAP_PVS_FLOW_CNTL_OPC 0x22dc +#define R300_VAP_OUT_VTX_FMT_0 0x2090 +# define R300_VTX_POS_PRESENT (1 << 0) +# define R300_VTX_COLOR_0_PRESENT (1 << 1) +# define R300_VTX_COLOR_1_PRESENT (1 << 2) +# define R300_VTX_COLOR_2_PRESENT (1 << 3) +# define R300_VTX_COLOR_3_PRESENT (1 << 4) +# define R300_VTX_PT_SIZE_PRESENT (1 << 16) +#define R300_VAP_OUT_VTX_FMT_1 0x2094 +# define R300_TEX_0_COMP_CNT_SHIFT 0 +# define R300_TEX_1_COMP_CNT_SHIFT 3 +# define R300_TEX_2_COMP_CNT_SHIFT 6 +# define R300_TEX_3_COMP_CNT_SHIFT 9 +# define R300_TEX_4_COMP_CNT_SHIFT 12 +# define R300_TEX_5_COMP_CNT_SHIFT 15 +# define R300_TEX_6_COMP_CNT_SHIFT 18 +# define R300_TEX_7_COMP_CNT_SHIFT 21 +#define R300_VAP_VTX_SIZE 0x20b4 +#define R300_VAP_GB_VERT_CLIP_ADJ 0x2220 +#define R300_VAP_GB_VERT_DISC_ADJ 0x2224 +#define R300_VAP_GB_HORZ_CLIP_ADJ 0x2228 +#define R300_VAP_GB_HORZ_DISC_ADJ 0x222c +#define R300_VAP_CLIP_CNTL 0x221c +# define R300_UCP_ENA_0 (1 << 0) +# define R300_UCP_ENA_1 (1 << 1) +# define R300_UCP_ENA_2 (1 << 2) +# define R300_UCP_ENA_3 (1 << 3) +# define R300_UCP_ENA_4 (1 << 4) +# define R300_UCP_ENA_5 (1 << 5) +# define R300_PS_UCP_MODE_SHIFT 14 +# define R300_CLIP_DISABLE (1 << 16) +# define R300_UCP_CULL_ONLY_ENA (1 << 17) +# define R300_BOUNDARY_EDGE_FLAG_ENA (1 << 18) +#define R300_VAP_PVS_STATE_FLUSH_REG 0x2284 + +#define R500_VAP_INDEX_OFFSET 0x208c + +#define R300_SU_TEX_WRAP 0x42a0 +#define R300_SU_POLY_OFFSET_ENABLE 0x42b4 +#define R300_SU_CULL_MODE 0x42b8 +# define R300_CULL_FRONT (1 << 0) +# define R300_CULL_BACK (1 << 1) +# define R300_FACE_POS (0 << 2) +# define R300_FACE_NEG (1 << 2) +#define R300_SU_DEPTH_SCALE 0x42c0 +#define R300_SU_DEPTH_OFFSET 0x42c4 + +#define R300_RS_COUNT 0x4300 +# define R300_RS_COUNT_IT_COUNT_SHIFT 0 +# define R300_RS_COUNT_IC_COUNT_SHIFT 7 +# define R300_RS_COUNT_HIRES_EN (1 << 18) + +#define R300_RS_IP_0 0x4310 +#define R300_RS_IP_1 0x4314 +# define R300_RS_TEX_PTR(x) ((x) << 0) +# define R300_RS_COL_PTR(x) ((x) << 6) +# define R300_RS_COL_FMT(x) ((x) << 9) +# define R300_RS_COL_FMT_RGBA 0 +# define R300_RS_COL_FMT_RGB0 2 +# define R300_RS_COL_FMT_RGB1 3 +# define R300_RS_COL_FMT_000A 4 +# define R300_RS_COL_FMT_0000 5 +# define R300_RS_COL_FMT_0001 6 +# define R300_RS_COL_FMT_111A 8 +# define R300_RS_COL_FMT_1110 9 +# define R300_RS_COL_FMT_1111 10 +# define R300_RS_SEL_S(x) ((x) << 13) +# define R300_RS_SEL_T(x) ((x) << 16) +# define R300_RS_SEL_R(x) ((x) << 19) +# define R300_RS_SEL_Q(x) ((x) << 22) +# define R300_RS_SEL_C0 0 +# define R300_RS_SEL_C1 1 +# define R300_RS_SEL_C2 2 +# define R300_RS_SEL_C3 3 +# define R300_RS_SEL_K0 4 +# define R300_RS_SEL_K1 5 +#define R300_RS_INST_COUNT 0x4304 +# define R300_INST_COUNT_RS(x) ((x) << 0) +# define R300_RS_W_EN (1 << 4) +# define R300_TX_OFFSET_RS(x) ((x) << 5) +#define R300_RS_INST_0 0x4330 +#define R300_RS_INST_1 0x4334 +# define R300_INST_TEX_ID(x) ((x) << 0) +# define R300_RS_INST_TEX_CN_WRITE (1 << 3) +# define R300_INST_TEX_ADDR(x) ((x) << 6) + +#define R300_TX_INVALTAGS 0x4100 +#define R300_TX_FILTER0_0 0x4400 +#define R300_TX_FILTER0_1 0x4404 +#define R300_TX_FILTER0_2 0x4408 +# define R300_TX_CLAMP_S(x) ((x) << 0) +# define R300_TX_CLAMP_T(x) ((x) << 3) +# define R300_TX_CLAMP_R(x) ((x) << 6) +# define R300_TX_CLAMP_WRAP 0 +# define R300_TX_CLAMP_MIRROR 1 +# define R300_TX_CLAMP_CLAMP_LAST 2 +# define R300_TX_CLAMP_MIRROR_CLAMP_LAST 3 +# define R300_TX_CLAMP_CLAMP_BORDER 4 +# define R300_TX_CLAMP_MIRROR_CLAMP_BORDER 5 +# define R300_TX_CLAMP_CLAMP_GL 6 +# define R300_TX_CLAMP_MIRROR_CLAMP_GL 7 +# define R300_TX_MAG_FILTER_NEAREST (1 << 9) +# define R300_TX_MIN_FILTER_NEAREST (1 << 11) +# define R300_TX_MAG_FILTER_LINEAR (2 << 9) +# define R300_TX_MIN_FILTER_LINEAR (2 << 11) +# define R300_TX_ID_SHIFT 28 +#define R300_TX_FILTER1_0 0x4440 +#define R300_TX_FILTER1_1 0x4444 +#define R300_TX_FILTER1_2 0x4448 +#define R300_TX_FORMAT0_0 0x4480 +#define R300_TX_FORMAT0_1 0x4484 +#define R300_TX_FORMAT0_2 0x4488 +# define R300_TXWIDTH_SHIFT 0 +# define R300_TXHEIGHT_SHIFT 11 +# define R300_NUM_LEVELS_SHIFT 26 +# define R300_NUM_LEVELS_MASK 0x +# define R300_TXPROJECTED (1 << 30) +# define R300_TXPITCH_EN (1 << 31) +#define R300_TX_FORMAT1_0 0x44c0 +#define R300_TX_FORMAT1_1 0x44c4 +#define R300_TX_FORMAT1_2 0x44c8 +# define R300_TX_FORMAT_X8 0x0 +# define R300_TX_FORMAT_X16 0x1 +# define R300_TX_FORMAT_Y4X4 0x2 +# define R300_TX_FORMAT_Y8X8 0x3 +# define R300_TX_FORMAT_Y16X16 0x4 +# define R300_TX_FORMAT_Z3Y3X2 0x5 +# define R300_TX_FORMAT_Z5Y6X5 0x6 +# define R300_TX_FORMAT_Z6Y5X5 0x7 +# define R300_TX_FORMAT_Z11Y11X10 0x8 +# define R300_TX_FORMAT_Z10Y11X11 0x9 +# define R300_TX_FORMAT_W4Z4Y4X4 0xA +# define R300_TX_FORMAT_W1Z5Y5X5 0xB +# define R300_TX_FORMAT_W8Z8Y8X8 0xC +# define R300_TX_FORMAT_W2Z10Y10X10 0xD +# define R300_TX_FORMAT_W16Z16Y16X16 0xE +# define R300_TX_FORMAT_DXT1 0xF +# define R300_TX_FORMAT_DXT3 0x10 +# define R300_TX_FORMAT_DXT5 0x11 +# define R300_TX_FORMAT_D3DMFT_CxV8U8 0x12 /* no swizzle */ +# define R300_TX_FORMAT_A8R8G8B8 0x13 /* no swizzle */ +# define R300_TX_FORMAT_B8G8_B8G8 0x14 /* no swizzle */ +# define R300_TX_FORMAT_G8R8_G8B8 0x15 /* no swizzle */ +# define R300_TX_FORMAT_VYUY422 0x14 /* no swizzle */ +# define R300_TX_FORMAT_YVYU422 0x15 /* no swizzle */ +# define R300_TX_FORMAT_X24_Y8 0x1e +# define R300_TX_FORMAT_X32 0x1e + /* Floating point formats */ + /* Note - hardware supports both 16 and 32 bit floating point */ +# define R300_TX_FORMAT_FL_I16 0x18 +# define R300_TX_FORMAT_FL_I16A16 0x19 +# define R300_TX_FORMAT_FL_R16G16B16A16 0x1A +# define R300_TX_FORMAT_FL_I32 0x1B +# define R300_TX_FORMAT_FL_I32A32 0x1C +# define R300_TX_FORMAT_FL_R32G32B32A32 0x1D + /* alpha modes, convenience mostly */ + /* if you have alpha, pick constant appropriate to the + number of channels (1 for I8, 2 for I8A8, 4 for R8G8B8A8, etc */ +# define R300_TX_FORMAT_ALPHA_1CH 0x000 +# define R300_TX_FORMAT_ALPHA_2CH 0x200 +# define R300_TX_FORMAT_ALPHA_4CH 0x600 +# define R300_TX_FORMAT_ALPHA_NONE 0xA00 + /* Swizzling */ + /* constants */ +# define R300_TX_FORMAT_X 0 +# define R300_TX_FORMAT_Y 1 +# define R300_TX_FORMAT_Z 2 +# define R300_TX_FORMAT_W 3 +# define R300_TX_FORMAT_ZERO 4 +# define R300_TX_FORMAT_ONE 5 + /* 2.0*Z, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_Z 6 + /* 2.0*W, everything above 1.0 is set to 0.0 */ +# define R300_TX_FORMAT_CUT_W 7 + +# define R300_TX_FORMAT_B_SHIFT 18 +# define R300_TX_FORMAT_G_SHIFT 15 +# define R300_TX_FORMAT_R_SHIFT 12 +# define R300_TX_FORMAT_A_SHIFT 9 + + /* Convenience macro to take care of layout and swizzling */ +# define R300_EASY_TX_FORMAT(B, G, R, A, FMT) ( \ + ((R300_TX_FORMAT_##B)<<R300_TX_FORMAT_B_SHIFT) \ + | ((R300_TX_FORMAT_##G)<<R300_TX_FORMAT_G_SHIFT) \ + | ((R300_TX_FORMAT_##R)<<R300_TX_FORMAT_R_SHIFT) \ + | ((R300_TX_FORMAT_##A)<<R300_TX_FORMAT_A_SHIFT) \ + | (R300_TX_FORMAT_##FMT) \ + ) + +# define R300_TX_FORMAT_YUV_TO_RGB_CLAMP (1 << 22) +# define R300_TX_FORMAT_YUV_TO_RGB_NO_CLAMP (2 << 22) +# define R300_TX_FORMAT_SWAP_YUV (1 << 24) + +# define R300_TX_FORMAT_CACHE_WHOLE (0 << 27) +# define R300_TX_FORMAT_CACHE_HALF_REGION_0 (2 << 27) +# define R300_TX_FORMAT_CACHE_HALF_REGION_1 (3 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_0 (4 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_1 (5 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_2 (6 << 27) +# define R300_TX_FORMAT_CACHE_FOURTH_REGION_3 (7 << 27) + +#define R300_TX_FORMAT2_0 0x4500 +#define R300_TX_FORMAT2_1 0x4504 +#define R300_TX_FORMAT2_2 0x4508 +# define R500_TXWIDTH_11 (1 << 15) +# define R500_TXHEIGHT_11 (1 << 16) + +#define R300_TX_OFFSET_0 0x4540 +#define R300_TX_OFFSET_1 0x4544 +#define R300_TX_OFFSET_2 0x4548 +# define R300_ENDIAN_SWAP_16_BIT (1 << 0) +# define R300_ENDIAN_SWAP_32_BIT (2 << 0) +# define R300_ENDIAN_SWAP_HALF_DWORD (3 << 0) +# define R300_MACRO_TILE (1 << 2) + +#define R300_TX_BORDER_COLOR_0 0x45c0 + +#define R300_TX_ENABLE 0x4104 +# define R300_TEX_0_ENABLE (1 << 0) +# define R300_TEX_1_ENABLE (1 << 1) +# define R300_TEX_2_ENABLE (1 << 2) + +#define R300_US_W_FMT 0x46b4 +#define R300_US_OUT_FMT_1 0x46a8 +#define R300_US_OUT_FMT_2 0x46ac +#define R300_US_OUT_FMT_3 0x46b0 +#define R300_US_OUT_FMT_0 0x46a4 +# define R300_OUT_FMT_C4_8 (0 << 0) +# define R300_OUT_FMT_C4_10 (1 << 0) +# define R300_OUT_FMT_C4_10_GAMMA (2 << 0) +# define R300_OUT_FMT_C_16 (3 << 0) +# define R300_OUT_FMT_C2_16 (4 << 0) +# define R300_OUT_FMT_C4_16 (5 << 0) +# define R300_OUT_FMT_C_16_MPEG (6 << 0) +# define R300_OUT_FMT_C2_16_MPEG (7 << 0) +# define R300_OUT_FMT_C2_4 (8 << 0) +# define R300_OUT_FMT_C_3_3_2 (9 << 0) +# define R300_OUT_FMT_C_5_6_5 (10 << 0) +# define R300_OUT_FMT_C_11_11_10 (11 << 0) +# define R300_OUT_FMT_C_10_11_11 (12 << 0) +# define R300_OUT_FMT_C_2_10_10_10 (13 << 0) +# define R300_OUT_FMT_UNUSED (15 << 0) +# define R300_OUT_FMT_C_16_FP (16 << 0) +# define R300_OUT_FMT_C2_16_FP (17 << 0) +# define R300_OUT_FMT_C4_16_FP (18 << 0) +# define R300_OUT_FMT_C_32_FP (19 << 0) +# define R300_OUT_FMT_C2_32_FP (20 << 0) +# define R300_OUT_FMT_C4_32_FP (21 << 0) +# define R300_OUT_FMT_C0_SEL_ALPHA (0 << 8) +# define R300_OUT_FMT_C0_SEL_RED (1 << 8) +# define R300_OUT_FMT_C0_SEL_GREEN (2 << 8) +# define R300_OUT_FMT_C0_SEL_BLUE (3 << 8) +# define R300_OUT_FMT_C1_SEL_ALPHA (0 << 10) +# define R300_OUT_FMT_C1_SEL_RED (1 << 10) +# define R300_OUT_FMT_C1_SEL_GREEN (2 << 10) +# define R300_OUT_FMT_C1_SEL_BLUE (3 << 10) +# define R300_OUT_FMT_C2_SEL_ALPHA (0 << 12) +# define R300_OUT_FMT_C2_SEL_RED (1 << 12) +# define R300_OUT_FMT_C2_SEL_GREEN (2 << 12) +# define R300_OUT_FMT_C2_SEL_BLUE (3 << 12) +# define R300_OUT_FMT_C3_SEL_ALPHA (0 << 14) +# define R300_OUT_FMT_C3_SEL_RED (1 << 14) +# define R300_OUT_FMT_C3_SEL_GREEN (2 << 14) +# define R300_OUT_FMT_C3_SEL_BLUE (3 << 14) +#define R300_US_CONFIG 0x4600 +# define R300_NLEVEL_SHIFT 0 +# define R300_FIRST_TEX (1 << 3) +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) +#define R300_US_PIXSIZE 0x4604 +#define R300_US_CODE_OFFSET 0x4608 +# define R300_ALU_CODE_OFFSET(x) ((x) << 0) +# define R300_ALU_CODE_SIZE(x) ((x) << 6) +# define R300_TEX_CODE_OFFSET(x) ((x) << 13) +# define R300_TEX_CODE_SIZE(x) ((x) << 18) +#define R300_US_CODE_ADDR_0 0x4610 +# define R300_ALU_START(x) ((x) << 0) +# define R300_ALU_SIZE(x) ((x) << 6) +# define R300_TEX_START(x) ((x) << 12) +# define R300_TEX_SIZE(x) ((x) << 17) +# define R300_RGBA_OUT (1 << 22) +# define R300_W_OUT (1 << 23) +#define R300_US_CODE_ADDR_1 0x4614 +#define R300_US_CODE_ADDR_2 0x4618 +#define R300_US_CODE_ADDR_3 0x461c +#define R300_US_TEX_INST_0 0x4620 +#define R300_US_TEX_INST_1 0x4624 +#define R300_US_TEX_INST_2 0x4628 +#define R300_US_TEX_INST(x) (R300_US_TEX_INST_0 + (x)*4) +# define R300_TEX_SRC_ADDR(x) ((x) << 0) +# define R300_TEX_DST_ADDR(x) ((x) << 6) +# define R300_TEX_ID(x) ((x) << 11) +# define R300_TEX_INST(x) ((x) << 15) +# define R300_TEX_INST_NOP 0 +# define R300_TEX_INST_LD 1 +# define R300_TEX_INST_TEXKILL 2 +# define R300_TEX_INST_PROJ 3 +# define R300_TEX_INST_LODBIAS 4 +#define R300_US_ALU_RGB_ADDR_0 0x46c0 +#define R300_US_ALU_RGB_ADDR_1 0x46c4 +#define R300_US_ALU_RGB_ADDR_2 0x46c8 +#define R300_US_ALU_RGB_ADDR(x) (R300_US_ALU_RGB_ADDR_0 + (x)*4) +/* for ADDR0-2, values 0-31 specify a location in the pixel stack, + values 32-63 specify a constant */ +# define R300_ALU_RGB_ADDR0(x) ((x) << 0) +# define R300_ALU_RGB_ADDR1(x) ((x) << 6) +# define R300_ALU_RGB_ADDR2(x) ((x) << 12) +# define R300_ALU_RGB_CONST(x) ((x) | (1 << 5)) +/* ADDRD - where on the pixel stack the result of this instruction + will be written */ +# define R300_ALU_RGB_ADDRD(x) ((x) << 18) +# define R300_ALU_RGB_WMASK(x) ((x) << 23) +# define R300_ALU_RGB_OMASK(x) ((x) << 26) +# define R300_ALU_RGB_MASK_NONE 0 +# define R300_ALU_RGB_MASK_R 1 +# define R300_ALU_RGB_MASK_G 2 +# define R300_ALU_RGB_MASK_B 4 +# define R300_ALU_RGB_MASK_RGB 7 +# define R300_ALU_RGB_TARGET_A (0 << 29) +# define R300_ALU_RGB_TARGET_B (1 << 29) +# define R300_ALU_RGB_TARGET_C (2 << 29) +# define R300_ALU_RGB_TARGET_D (3 << 29) +#define R300_US_ALU_RGB_INST_0 0x48c0 +#define R300_US_ALU_RGB_INST_1 0x48c4 +#define R300_US_ALU_RGB_INST_2 0x48c8 +#define R300_US_ALU_RGB_INST(x) (R300_US_ALU_RGB_INST_0 + (x)*4) +# define R300_ALU_RGB_SEL_A(x) ((x) << 0) +# define R300_ALU_RGB_SRC0_RGB 0 +# define R300_ALU_RGB_SRC0_RRR 1 +# define R300_ALU_RGB_SRC0_GGG 2 +# define R300_ALU_RGB_SRC0_BBB 3 +# define R300_ALU_RGB_SRC1_RGB 4 +# define R300_ALU_RGB_SRC1_RRR 5 +# define R300_ALU_RGB_SRC1_GGG 6 +# define R300_ALU_RGB_SRC1_BBB 7 +# define R300_ALU_RGB_SRC2_RGB 8 +# define R300_ALU_RGB_SRC2_RRR 9 +# define R300_ALU_RGB_SRC2_GGG 10 +# define R300_ALU_RGB_SRC2_BBB 11 +# define R300_ALU_RGB_SRC0_AAA 12 +# define R300_ALU_RGB_SRC1_AAA 13 +# define R300_ALU_RGB_SRC2_AAA 14 +# define R300_ALU_RGB_SRCP_RGB 15 +# define R300_ALU_RGB_SRCP_RRR 16 +# define R300_ALU_RGB_SRCP_GGG 17 +# define R300_ALU_RGB_SRCP_BBB 18 +# define R300_ALU_RGB_SRCP_AAA 19 +# define R300_ALU_RGB_0_0 20 +# define R300_ALU_RGB_1_0 21 +# define R300_ALU_RGB_0_5 22 +# define R300_ALU_RGB_SRC0_GBR 23 +# define R300_ALU_RGB_SRC1_GBR 24 +# define R300_ALU_RGB_SRC2_GBR 25 +# define R300_ALU_RGB_SRC0_BRG 26 +# define R300_ALU_RGB_SRC1_BRG 27 +# define R300_ALU_RGB_SRC2_BRG 28 +# define R300_ALU_RGB_SRC0_ABG 29 +# define R300_ALU_RGB_SRC1_ABG 30 +# define R300_ALU_RGB_SRC2_ABG 31 +# define R300_ALU_RGB_MOD_A(x) ((x) << 5) +# define R300_ALU_RGB_MOD_NOP 0 +# define R300_ALU_RGB_MOD_NEG 1 +# define R300_ALU_RGB_MOD_ABS 2 +# define R300_ALU_RGB_MOD_NAB 3 +# define R300_ALU_RGB_SEL_B(x) ((x) << 7) +# define R300_ALU_RGB_MOD_B(x) ((x) << 12) +# define R300_ALU_RGB_SEL_C(x) ((x) << 14) +# define R300_ALU_RGB_MOD_C(x) ((x) << 19) +# define R300_ALU_RGB_SRCP_OP(x) ((x) << 21) +# define R300_ALU_RGB_SRCP_OP_1_MINUS_2RGB0 0 +# define R300_ALU_RGB_SRCP_OP_RGB1_MINUS_RGB0 1 +# define R300_ALU_RGB_SRCP_OP_RGB1_PLUS_RGB0 2 +# define R300_ALU_RGB_SRCP_OP_1_MINUS_RGB0 3 +# define R300_ALU_RGB_OP(x) ((x) << 23) +# define R300_ALU_RGB_OP_MAD 0 +# define R300_ALU_RGB_OP_DP3 1 +# define R300_ALU_RGB_OP_DP4 2 +# define R300_ALU_RGB_OP_D2A 3 +# define R300_ALU_RGB_OP_MIN 4 +# define R300_ALU_RGB_OP_MAX 5 +# define R300_ALU_RGB_OP_CND 7 +# define R300_ALU_RGB_OP_CMP 8 +# define R300_ALU_RGB_OP_FRC 9 +# define R300_ALU_RGB_OP_SOP 10 +# define R300_ALU_RGB_OMOD(x) ((x) << 27) +# define R300_ALU_RGB_OMOD_NONE 0 +# define R300_ALU_RGB_OMOD_MUL_2 1 +# define R300_ALU_RGB_OMOD_MUL_4 2 +# define R300_ALU_RGB_OMOD_MUL_8 3 +# define R300_ALU_RGB_OMOD_DIV_2 4 +# define R300_ALU_RGB_OMOD_DIV_4 5 +# define R300_ALU_RGB_OMOD_DIV_8 6 +# define R300_ALU_RGB_CLAMP (1 << 30) +# define R300_ALU_RGB_INSERT_NOP (1 << 31) +#define R300_US_ALU_ALPHA_ADDR_0 0x47c0 +#define R300_US_ALU_ALPHA_ADDR_1 0x47c4 +#define R300_US_ALU_ALPHA_ADDR_2 0x47c8 +#define R300_US_ALU_ALPHA_ADDR(x) (R300_US_ALU_ALPHA_ADDR_0 + (x)*4) +/* for ADDR0-2, values 0-31 specify a location in the pixel stack, + values 32-63 specify a constant */ +# define R300_ALU_ALPHA_ADDR0(x) ((x) << 0) +# define R300_ALU_ALPHA_ADDR1(x) ((x) << 6) +# define R300_ALU_ALPHA_ADDR2(x) ((x) << 12) +# define R300_ALU_ALPHA_CONST(x) ((x) | (1 << 5)) +/* ADDRD - where on the pixel stack the result of this instruction + will be written */ +# define R300_ALU_ALPHA_ADDRD(x) ((x) << 18) +# define R300_ALU_ALPHA_WMASK(x) ((x) << 23) +# define R300_ALU_ALPHA_OMASK(x) ((x) << 24) +# define R300_ALU_ALPHA_OMASK_W(x) ((x) << 27) +# define R300_ALU_ALPHA_MASK_NONE 0 +# define R300_ALU_ALPHA_MASK_A 1 +# define R300_ALU_ALPHA_TARGET_A (0 << 25) +# define R300_ALU_ALPHA_TARGET_B (1 << 25) +# define R300_ALU_ALPHA_TARGET_C (2 << 25) +# define R300_ALU_ALPHA_TARGET_D (3 << 25) +#define R300_US_ALU_ALPHA_INST_0 0x49c0 +#define R300_US_ALU_ALPHA_INST_1 0x49c4 +#define R300_US_ALU_ALPHA_INST_2 0x49c8 +#define R300_US_ALU_ALPHA_INST(x) (R300_US_ALU_ALPHA_INST_0 + (x)*4) +# define R300_ALU_ALPHA_SEL_A(x) ((x) << 0) +# define R300_ALU_ALPHA_SRC0_R 0 +# define R300_ALU_ALPHA_SRC0_G 1 +# define R300_ALU_ALPHA_SRC0_B 2 +# define R300_ALU_ALPHA_SRC1_R 3 +# define R300_ALU_ALPHA_SRC1_G 4 +# define R300_ALU_ALPHA_SRC1_B 5 +# define R300_ALU_ALPHA_SRC2_R 6 +# define R300_ALU_ALPHA_SRC2_G 7 +# define R300_ALU_ALPHA_SRC2_B 8 +# define R300_ALU_ALPHA_SRC0_A 9 +# define R300_ALU_ALPHA_SRC1_A 10 +# define R300_ALU_ALPHA_SRC2_A 11 +# define R300_ALU_ALPHA_SRCP_R 12 +# define R300_ALU_ALPHA_SRCP_G 13 +# define R300_ALU_ALPHA_SRCP_B 14 +# define R300_ALU_ALPHA_SRCP_A 15 +# define R300_ALU_ALPHA_0_0 16 +# define R300_ALU_ALPHA_1_0 17 +# define R300_ALU_ALPHA_0_5 18 +# define R300_ALU_ALPHA_MOD_A(x) ((x) << 5) +# define R300_ALU_ALPHA_MOD_NOP 0 +# define R300_ALU_ALPHA_MOD_NEG 1 +# define R300_ALU_ALPHA_MOD_ABS 2 +# define R300_ALU_ALPHA_MOD_NAB 3 +# define R300_ALU_ALPHA_SEL_B(x) ((x) << 7) +# define R300_ALU_ALPHA_MOD_B(x) ((x) << 12) +# define R300_ALU_ALPHA_SEL_C(x) ((x) << 14) +# define R300_ALU_ALPHA_MOD_C(x) ((x) << 19) +# define R300_ALU_ALPHA_SRCP_OP(x) ((x) << 21) +# define R300_ALU_ALPHA_SRCP_OP_1_MINUS_2RGB0 0 +# define R300_ALU_ALPHA_SRCP_OP_RGB1_MINUS_RGB0 1 +# define R300_ALU_ALPHA_SRCP_OP_RGB1_PLUS_RGB0 2 +# define R300_ALU_ALPHA_SRCP_OP_1_MINUS_RGB0 3 +# define R300_ALU_ALPHA_OP(x) ((x) << 23) +# define R300_ALU_ALPHA_OP_MAD 0 +# define R300_ALU_ALPHA_OP_DP 1 +# define R300_ALU_ALPHA_OP_MIN 2 +# define R300_ALU_ALPHA_OP_MAX 3 +# define R300_ALU_ALPHA_OP_CND 5 +# define R300_ALU_ALPHA_OP_CMP 6 +# define R300_ALU_ALPHA_OP_FRC 7 +# define R300_ALU_ALPHA_OP_EX2 8 +# define R300_ALU_ALPHA_OP_LN2 9 +# define R300_ALU_ALPHA_OP_RCP 10 +# define R300_ALU_ALPHA_OP_RSQ 11 +# define R300_ALU_ALPHA_OMOD(x) ((x) << 27) +# define R300_ALU_ALPHA_OMOD_NONE 0 +# define R300_ALU_ALPHA_OMOD_MUL_2 1 +# define R300_ALU_ALPHA_OMOD_MUL_4 2 +# define R300_ALU_ALPHA_OMOD_MUL_8 3 +# define R300_ALU_ALPHA_OMOD_DIV_2 4 +# define R300_ALU_ALPHA_OMOD_DIV_4 5 +# define R300_ALU_ALPHA_OMOD_DIV_8 6 +# define R300_ALU_ALPHA_CLAMP (1 << 30) + +#define R300_US_ALU_CONST_R_0 0x4c00 +#define R300_US_ALU_CONST_R(x) (R300_US_ALU_CONST_R_0 + (x)*16) +#define R300_US_ALU_CONST_G_0 0x4c04 +#define R300_US_ALU_CONST_G(x) (R300_US_ALU_CONST_G_0 + (x)*16) +#define R300_US_ALU_CONST_B_0 0x4c08 +#define R300_US_ALU_CONST_B(x) (R300_US_ALU_CONST_B_0 + (x)*16) +#define R300_US_ALU_CONST_A_0 0x4c0c +#define R300_US_ALU_CONST_A(x) (R300_US_ALU_CONST_A_0 + (x)*16) + +#define R300_FG_DEPTH_SRC 0x4bd8 +#define R300_FG_FOG_BLEND 0x4bc0 +#define R300_FG_ALPHA_FUNC 0x4bd4 + +#define R300_DST_PIPE_CONFIG 0x170c +# define R300_PIPE_AUTO_CONFIG (1 << 31) +#define R300_RB2D_DSTCACHE_MODE 0x3428 +#define R300_RB2D_DSTCACHE_MODE 0x3428 +# define R300_DC_AUTOFLUSH_ENABLE (1 << 8) +# define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17) +#define R300_RB2D_DSTCACHE_CTLSTAT 0x342c /* use DSTCACHE_CTLSTAT instead */ +#define R300_DSTCACHE_CTLSTAT 0x1714 +# define R300_DC_FLUSH_2D (1 << 0) +# define R300_DC_FREE_2D (1 << 2) +# define R300_RB2D_DC_FLUSH_ALL (R300_DC_FLUSH_2D | R300_DC_FREE_2D) +# define R300_RB2D_DC_BUSY (1 << 31) +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +# define R300_DC_FLUSH_3D (2 << 0) +# define R300_DC_FREE_3D (2 << 2) +# define R300_RB3D_DC_FLUSH_ALL (R300_DC_FLUSH_3D | R300_DC_FREE_3D) +# define R300_DC_FINISH_3D (1 << 4) +#define R300_RB3D_ZCACHE_CTLSTAT 0x4f18 +# define R300_ZC_FLUSH (1 << 0) +# define R300_ZC_FREE (1 << 1) +# define R300_ZC_FLUSH_ALL 0x3 +#define R300_RB3D_ZSTENCILCNTL 0x4f04 +#define R300_RB3D_ZCACHE_CTLSTAT 0x4f18 +#define R300_RB3D_BW_CNTL 0x4f1c +#define R300_RB3D_ZCNTL 0x4f00 +#define R300_RB3D_ZTOP 0x4f14 +#define R300_RB3D_ROPCNTL 0x4e18 +#define R300_RB3D_BLENDCNTL 0x4e04 +# define R300_ALPHA_BLEND_ENABLE (1 << 0) +# define R300_SEPARATE_ALPHA_ENABLE (1 << 1) +# define R300_READ_ENABLE (1 << 2) +#define R300_RB3D_ABLENDCNTL 0x4e08 +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +#define R300_RB3D_COLOROFFSET0 0x4e28 +#define R300_RB3D_COLORPITCH0 0x4e38 +# define R300_COLORTILE (1 << 16) +# define R300_COLORENDIAN_WORD (1 << 19) +# define R300_COLORENDIAN_DWORD (2 << 19) +# define R300_COLORENDIAN_HALF_DWORD (3 << 19) +# define R300_COLORFORMAT_ARGB1555 (3 << 21) +# define R300_COLORFORMAT_RGB565 (4 << 21) +# define R300_COLORFORMAT_ARGB8888 (6 << 21) +# define R300_COLORFORMAT_ARGB32323232 (7 << 21) +# define R300_COLORFORMAT_I8 (9 << 21) +# define R300_COLORFORMAT_ARGB16161616 (10 << 21) +# define R300_COLORFORMAT_VYUY (11 << 21) +# define R300_COLORFORMAT_YVYU (12 << 21) +# define R300_COLORFORMAT_UV88 (13 << 21) +# define R300_COLORFORMAT_ARGB4444 (15 << 21) + +#define R300_RB3D_AARESOLVE_CTL 0x4e88 +#define R300_RB3D_COLOR_CHANNEL_MASK 0x4e0c +# define R300_BLUE_MASK_EN (1 << 0) +# define R300_GREEN_MASK_EN (1 << 1) +# define R300_RED_MASK_EN (1 << 2) +# define R300_ALPHA_MASK_EN (1 << 3) +#define R300_RB3D_COLOR_CLEAR_VALUE 0x4e14 +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +#define R300_RB3D_CCTL 0x4e00 +#define R300_RB3D_DITHER_CTL 0x4e50 + +#define R300_SC_EDGERULE 0x43a8 +#define R300_SC_SCISSOR0 0x43e0 +#define R300_SC_SCISSOR1 0x43e4 +# define R300_SCISSOR_X_SHIFT 0 +# define R300_SCISSOR_Y_SHIFT 13 +#define R300_SC_CLIP_0_A 0x43b0 +#define R300_SC_CLIP_0_B 0x43b4 +# define R300_CLIP_X_SHIFT 0 +# define R300_CLIP_Y_SHIFT 13 +#define R300_SC_CLIP_RULE 0x43d0 +#define R300_SC_SCREENDOOR 0x43e8 + +/* R500 US has to be loaded through an index/data pair */ +#define R500_GA_US_VECTOR_INDEX 0x4250 +# define R500_US_VECTOR_TYPE_INST (0 << 16) +# define R500_US_VECTOR_TYPE_CONST (1 << 16) +# define R500_US_VECTOR_CLAMP (1 << 17) +# define R500_US_VECTOR_INST_INDEX(x) ((x) | R500_US_VECTOR_TYPE_INST) +# define R500_US_VECTOR_CONST_INDEX(x) ((x) | R500_US_VECTOR_TYPE_CONST) +#define R500_GA_US_VECTOR_DATA 0x4254 + +/* + * The R500 unified shader (US) registers come in banks of 512 each, one + * for each instruction slot in the shader. You can't touch them directly. + * R500_US_VECTOR_INDEX() sets the base instruction to modify; successive + * writes to R500_GA_US_VECTOR_DATA autoincrement the index after the + * instruction is fully specified. + */ +#define R500_US_ALU_ALPHA_INST_0 0xa800 +# define R500_ALPHA_OP_MAD 0 +# define R500_ALPHA_OP_DP 1 +# define R500_ALPHA_OP_MIN 2 +# define R500_ALPHA_OP_MAX 3 +/* #define R500_ALPHA_OP_RESERVED 4 */ +# define R500_ALPHA_OP_CND 5 +# define R500_ALPHA_OP_CMP 6 +# define R500_ALPHA_OP_FRC 7 +# define R500_ALPHA_OP_EX2 8 +# define R500_ALPHA_OP_LN2 9 +# define R500_ALPHA_OP_RCP 10 +# define R500_ALPHA_OP_RSQ 11 +# define R500_ALPHA_OP_SIN 12 +# define R500_ALPHA_OP_COS 13 +# define R500_ALPHA_OP_MDH 14 +# define R500_ALPHA_OP_MDV 15 +# define R500_ALPHA_ADDRD(x) ((x) << 4) +# define R500_ALPHA_ADDRD_REL (1 << 11) +# define R500_ALPHA_SEL_A_SRC0 (0 << 12) +# define R500_ALPHA_SEL_A_SRC1 (1 << 12) +# define R500_ALPHA_SEL_A_SRC2 (2 << 12) +# define R500_ALPHA_SEL_A_SRCP (3 << 12) +# define R500_ALPHA_SWIZ_A_R (0 << 14) +# define R500_ALPHA_SWIZ_A_G (1 << 14) +# define R500_ALPHA_SWIZ_A_B (2 << 14) +# define R500_ALPHA_SWIZ_A_A (3 << 14) +# define R500_ALPHA_SWIZ_A_0 (4 << 14) +# define R500_ALPHA_SWIZ_A_HALF (5 << 14) +# define R500_ALPHA_SWIZ_A_1 (6 << 14) +/* #define R500_ALPHA_SWIZ_A_UNUSED (7 << 14) */ +# define R500_ALPHA_MOD_A_NOP (0 << 17) +# define R500_ALPHA_MOD_A_NEG (1 << 17) +# define R500_ALPHA_MOD_A_ABS (2 << 17) +# define R500_ALPHA_MOD_A_NAB (3 << 17) +# define R500_ALPHA_SEL_B_SRC0 (0 << 19) +# define R500_ALPHA_SEL_B_SRC1 (1 << 19) +# define R500_ALPHA_SEL_B_SRC2 (2 << 19) +# define R500_ALPHA_SEL_B_SRCP (3 << 19) +# define R500_ALPHA_SWIZ_B_R (0 << 21) +# define R500_ALPHA_SWIZ_B_G (1 << 21) +# define R500_ALPHA_SWIZ_B_B (2 << 21) +# define R500_ALPHA_SWIZ_B_A (3 << 21) +# define R500_ALPHA_SWIZ_B_0 (4 << 21) +# define R500_ALPHA_SWIZ_B_HALF (5 << 21) +# define R500_ALPHA_SWIZ_B_1 (6 << 21) +/* #define R500_ALPHA_SWIZ_B_UNUSED (7 << 21) */ +# define R500_ALPHA_MOD_B_NOP (0 << 24) +# define R500_ALPHA_MOD_B_NEG (1 << 24) +# define R500_ALPHA_MOD_B_ABS (2 << 24) +# define R500_ALPHA_MOD_B_NAB (3 << 24) +# define R500_ALPHA_OMOD_IDENTITY (0 << 26) +# define R500_ALPHA_OMOD_MUL_2 (1 << 26) +# define R500_ALPHA_OMOD_MUL_4 (2 << 26) +# define R500_ALPHA_OMOD_MUL_8 (3 << 26) +# define R500_ALPHA_OMOD_DIV_2 (4 << 26) +# define R500_ALPHA_OMOD_DIV_4 (5 << 26) +# define R500_ALPHA_OMOD_DIV_8 (6 << 26) +# define R500_ALPHA_OMOD_DISABLE (7 << 26) +# define R500_ALPHA_TARGET(x) ((x) << 29) +# define R500_ALPHA_W_OMASK (1 << 31) +#define R500_US_ALU_ALPHA_ADDR_0 0x9800 +# define R500_ALPHA_ADDR0(x) ((x) << 0) +# define R500_ALPHA_ADDR0_CONST (1 << 8) +# define R500_ALPHA_ADDR0_REL (1 << 9) +# define R500_ALPHA_ADDR1(x) ((x) << 10) +# define R500_ALPHA_ADDR1_CONST (1 << 18) +# define R500_ALPHA_ADDR1_REL (1 << 19) +# define R500_ALPHA_ADDR2(x) ((x) << 20) +# define R500_ALPHA_ADDR2_CONST (1 << 28) +# define R500_ALPHA_ADDR2_REL (1 << 29) +# define R500_ALPHA_SRCP_OP_1_MINUS_2A0 (0 << 30) +# define R500_ALPHA_SRCP_OP_A1_MINUS_A0 (1 << 30) +# define R500_ALPHA_SRCP_OP_A1_PLUS_A0 (2 << 30) +# define R500_ALPHA_SRCP_OP_1_MINUS_A0 (3 << 30) +#define R500_US_ALU_RGBA_INST_0 0xb000 +# define R500_ALU_RGBA_OP_MAD (0 << 0) +# define R500_ALU_RGBA_OP_DP3 (1 << 0) +# define R500_ALU_RGBA_OP_DP4 (2 << 0) +# define R500_ALU_RGBA_OP_D2A (3 << 0) +# define R500_ALU_RGBA_OP_MIN (4 << 0) +# define R500_ALU_RGBA_OP_MAX (5 << 0) +/* #define R500_ALU_RGBA_OP_RESERVED (6 << 0) */ +# define R500_ALU_RGBA_OP_CND (7 << 0) +# define R500_ALU_RGBA_OP_CMP (8 << 0) +# define R500_ALU_RGBA_OP_FRC (9 << 0) +# define R500_ALU_RGBA_OP_SOP (10 << 0) +# define R500_ALU_RGBA_OP_MDH (11 << 0) +# define R500_ALU_RGBA_OP_MDV (12 << 0) +# define R500_ALU_RGBA_ADDRD(x) ((x) << 4) +# define R500_ALU_RGBA_ADDRD_REL (1 << 11) +# define R500_ALU_RGBA_SEL_C_SRC0 (0 << 12) +# define R500_ALU_RGBA_SEL_C_SRC1 (1 << 12) +# define R500_ALU_RGBA_SEL_C_SRC2 (2 << 12) +# define R500_ALU_RGBA_SEL_C_SRCP (3 << 12) +# define R500_ALU_RGBA_R_SWIZ_R (0 << 14) +# define R500_ALU_RGBA_R_SWIZ_G (1 << 14) +# define R500_ALU_RGBA_R_SWIZ_B (2 << 14) +# define R500_ALU_RGBA_R_SWIZ_A (3 << 14) +# define R500_ALU_RGBA_R_SWIZ_0 (4 << 14) +# define R500_ALU_RGBA_R_SWIZ_HALF (5 << 14) +# define R500_ALU_RGBA_R_SWIZ_1 (6 << 14) +/* #define R500_ALU_RGBA_R_SWIZ_UNUSED (7 << 14) */ +# define R500_ALU_RGBA_G_SWIZ_R (0 << 17) +# define R500_ALU_RGBA_G_SWIZ_G (1 << 17) +# define R500_ALU_RGBA_G_SWIZ_B (2 << 17) +# define R500_ALU_RGBA_G_SWIZ_A (3 << 17) +# define R500_ALU_RGBA_G_SWIZ_0 (4 << 17) +# define R500_ALU_RGBA_G_SWIZ_HALF (5 << 17) +# define R500_ALU_RGBA_G_SWIZ_1 (6 << 17) +/* #define R500_ALU_RGBA_G_SWIZ_UNUSED (7 << 17) */ +# define R500_ALU_RGBA_B_SWIZ_R (0 << 20) +# define R500_ALU_RGBA_B_SWIZ_G (1 << 20) +# define R500_ALU_RGBA_B_SWIZ_B (2 << 20) +# define R500_ALU_RGBA_B_SWIZ_A (3 << 20) +# define R500_ALU_RGBA_B_SWIZ_0 (4 << 20) +# define R500_ALU_RGBA_B_SWIZ_HALF (5 << 20) +# define R500_ALU_RGBA_B_SWIZ_1 (6 << 20) +/* #define R500_ALU_RGBA_B_SWIZ_UNUSED (7 << 20) */ +# define R500_ALU_RGBA_MOD_C_NOP (0 << 23) +# define R500_ALU_RGBA_MOD_C_NEG (1 << 23) +# define R500_ALU_RGBA_MOD_C_ABS (2 << 23) +# define R500_ALU_RGBA_MOD_C_NAB (3 << 23) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC0 (0 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC1 (1 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRC2 (2 << 25) +# define R500_ALU_RGBA_ALPHA_SEL_C_SRCP (3 << 25) +# define R500_ALU_RGBA_A_SWIZ_R (0 << 27) +# define R500_ALU_RGBA_A_SWIZ_G (1 << 27) +# define R500_ALU_RGBA_A_SWIZ_B (2 << 27) +# define R500_ALU_RGBA_A_SWIZ_A (3 << 27) +# define R500_ALU_RGBA_A_SWIZ_0 (4 << 27) +# define R500_ALU_RGBA_A_SWIZ_HALF (5 << 27) +# define R500_ALU_RGBA_A_SWIZ_1 (6 << 27) +/* #define R500_ALU_RGBA_A_SWIZ_UNUSED (7 << 27) */ +# define R500_ALU_RGBA_ALPHA_MOD_C_NOP (0 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_NEG (1 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_ABS (2 << 30) +# define R500_ALU_RGBA_ALPHA_MOD_C_NAB (3 << 30) +#define R500_US_ALU_RGB_INST_0 0xa000 +# define R500_ALU_RGB_SEL_A_SRC0 (0 << 0) +# define R500_ALU_RGB_SEL_A_SRC1 (1 << 0) +# define R500_ALU_RGB_SEL_A_SRC2 (2 << 0) +# define R500_ALU_RGB_SEL_A_SRCP (3 << 0) +# define R500_ALU_RGB_R_SWIZ_A_R (0 << 2) +# define R500_ALU_RGB_R_SWIZ_A_G (1 << 2) +# define R500_ALU_RGB_R_SWIZ_A_B (2 << 2) +# define R500_ALU_RGB_R_SWIZ_A_A (3 << 2) +# define R500_ALU_RGB_R_SWIZ_A_0 (4 << 2) +# define R500_ALU_RGB_R_SWIZ_A_HALF (5 << 2) +# define R500_ALU_RGB_R_SWIZ_A_1 (6 << 2) +/* #define R500_ALU_RGB_R_SWIZ_A_UNUSED (7 << 2) */ +# define R500_ALU_RGB_G_SWIZ_A_R (0 << 5) +# define R500_ALU_RGB_G_SWIZ_A_G (1 << 5) +# define R500_ALU_RGB_G_SWIZ_A_B (2 << 5) +# define R500_ALU_RGB_G_SWIZ_A_A (3 << 5) +# define R500_ALU_RGB_G_SWIZ_A_0 (4 << 5) +# define R500_ALU_RGB_G_SWIZ_A_HALF (5 << 5) +# define R500_ALU_RGB_G_SWIZ_A_1 (6 << 5) +/* #define R500_ALU_RGB_G_SWIZ_A_UNUSED (7 << 5) */ +# define R500_ALU_RGB_B_SWIZ_A_R (0 << 8) +# define R500_ALU_RGB_B_SWIZ_A_G (1 << 8) +# define R500_ALU_RGB_B_SWIZ_A_B (2 << 8) +# define R500_ALU_RGB_B_SWIZ_A_A (3 << 8) +# define R500_ALU_RGB_B_SWIZ_A_0 (4 << 8) +# define R500_ALU_RGB_B_SWIZ_A_HALF (5 << 8) +# define R500_ALU_RGB_B_SWIZ_A_1 (6 << 8) +/* #define R500_ALU_RGB_B_SWIZ_A_UNUSED (7 << 8) */ +# define R500_ALU_RGB_MOD_A_NOP (0 << 11) +# define R500_ALU_RGB_MOD_A_NEG (1 << 11) +# define R500_ALU_RGB_MOD_A_ABS (2 << 11) +# define R500_ALU_RGB_MOD_A_NAB (3 << 11) +# define R500_ALU_RGB_SEL_B_SRC0 (0 << 13) +# define R500_ALU_RGB_SEL_B_SRC1 (1 << 13) +# define R500_ALU_RGB_SEL_B_SRC2 (2 << 13) +# define R500_ALU_RGB_SEL_B_SRCP (3 << 13) +# define R500_ALU_RGB_R_SWIZ_B_R (0 << 15) +# define R500_ALU_RGB_R_SWIZ_B_G (1 << 15) +# define R500_ALU_RGB_R_SWIZ_B_B (2 << 15) +# define R500_ALU_RGB_R_SWIZ_B_A (3 << 15) +# define R500_ALU_RGB_R_SWIZ_B_0 (4 << 15) +# define R500_ALU_RGB_R_SWIZ_B_HALF (5 << 15) +# define R500_ALU_RGB_R_SWIZ_B_1 (6 << 15) +/* #define R500_ALU_RGB_R_SWIZ_B_UNUSED (7 << 15) */ +# define R500_ALU_RGB_G_SWIZ_B_R (0 << 18) +# define R500_ALU_RGB_G_SWIZ_B_G (1 << 18) +# define R500_ALU_RGB_G_SWIZ_B_B (2 << 18) +# define R500_ALU_RGB_G_SWIZ_B_A (3 << 18) +# define R500_ALU_RGB_G_SWIZ_B_0 (4 << 18) +# define R500_ALU_RGB_G_SWIZ_B_HALF (5 << 18) +# define R500_ALU_RGB_G_SWIZ_B_1 (6 << 18) +/* #define R500_ALU_RGB_G_SWIZ_B_UNUSED (7 << 18) */ +# define R500_ALU_RGB_B_SWIZ_B_R (0 << 21) +# define R500_ALU_RGB_B_SWIZ_B_G (1 << 21) +# define R500_ALU_RGB_B_SWIZ_B_B (2 << 21) +# define R500_ALU_RGB_B_SWIZ_B_A (3 << 21) +# define R500_ALU_RGB_B_SWIZ_B_0 (4 << 21) +# define R500_ALU_RGB_B_SWIZ_B_HALF (5 << 21) +# define R500_ALU_RGB_B_SWIZ_B_1 (6 << 21) +/* #define R500_ALU_RGB_B_SWIZ_B_UNUSED (7 << 21) */ +# define R500_ALU_RGB_MOD_B_NOP (0 << 24) +# define R500_ALU_RGB_MOD_B_NEG (1 << 24) +# define R500_ALU_RGB_MOD_B_ABS (2 << 24) +# define R500_ALU_RGB_MOD_B_NAB (3 << 24) +# define R500_ALU_RGB_OMOD_IDENTITY (0 << 26) +# define R500_ALU_RGB_OMOD_MUL_2 (1 << 26) +# define R500_ALU_RGB_OMOD_MUL_4 (2 << 26) +# define R500_ALU_RGB_OMOD_MUL_8 (3 << 26) +# define R500_ALU_RGB_OMOD_DIV_2 (4 << 26) +# define R500_ALU_RGB_OMOD_DIV_4 (5 << 26) +# define R500_ALU_RGB_OMOD_DIV_8 (6 << 26) +# define R500_ALU_RGB_OMOD_DISABLE (7 << 26) +# define R500_ALU_RGB_TARGET(x) ((x) << 29) +# define R500_ALU_RGB_WMASK (1 << 31) +#define R500_US_ALU_RGB_ADDR_0 0x9000 +# define R500_RGB_ADDR0(x) ((x) << 0) +# define R500_RGB_ADDR0_CONST (1 << 8) +# define R500_RGB_ADDR0_REL (1 << 9) +# define R500_RGB_ADDR1(x) ((x) << 10) +# define R500_RGB_ADDR1_CONST (1 << 18) +# define R500_RGB_ADDR1_REL (1 << 19) +# define R500_RGB_ADDR2(x) ((x) << 20) +# define R500_RGB_ADDR2_CONST (1 << 28) +# define R500_RGB_ADDR2_REL (1 << 29) +# define R500_RGB_SRCP_OP_1_MINUS_2RGB0 (0 << 30) +# define R500_RGB_SRCP_OP_RGB1_MINUS_RGB0 (1 << 30) +# define R500_RGB_SRCP_OP_RGB1_PLUS_RGB0 (2 << 30) +# define R500_RGB_SRCP_OP_1_MINUS_RGB0 (3 << 30) +#define R500_US_CMN_INST_0 0xb800 +# define R500_INST_TYPE_ALU (0 << 0) +# define R500_INST_TYPE_OUT (1 << 0) +# define R500_INST_TYPE_FC (2 << 0) +# define R500_INST_TYPE_TEX (3 << 0) +# define R500_INST_TEX_SEM_WAIT (1 << 2) +# define R500_INST_RGB_PRED_SEL_NONE (0 << 3) +# define R500_INST_RGB_PRED_SEL_RGBA (1 << 3) +# define R500_INST_RGB_PRED_SEL_RRRR (2 << 3) +# define R500_INST_RGB_PRED_SEL_GGGG (3 << 3) +# define R500_INST_RGB_PRED_SEL_BBBB (4 << 3) +# define R500_INST_RGB_PRED_SEL_AAAA (5 << 3) +# define R500_INST_RGB_PRED_INV (1 << 6) +# define R500_INST_WRITE_INACTIVE (1 << 7) +# define R500_INST_LAST (1 << 8) +# define R500_INST_NOP (1 << 9) +# define R500_INST_ALU_WAIT (1 << 10) +# define R500_INST_RGB_WMASK_R (1 << 11) +# define R500_INST_RGB_WMASK_G (1 << 12) +# define R500_INST_RGB_WMASK_B (1 << 13) +# define R500_INST_ALPHA_WMASK (1 << 14) +# define R500_INST_RGB_OMASK_R (1 << 15) +# define R500_INST_RGB_OMASK_G (1 << 16) +# define R500_INST_RGB_OMASK_B (1 << 17) +# define R500_INST_ALPHA_OMASK (1 << 18) +# define R500_INST_RGB_CLAMP (1 << 19) +# define R500_INST_ALPHA_CLAMP (1 << 20) +# define R500_INST_ALU_RESULT_SEL (1 << 21) +# define R500_INST_ALPHA_PRED_INV (1 << 22) +# define R500_INST_ALU_RESULT_OP_EQ (0 << 23) +# define R500_INST_ALU_RESULT_OP_LT (1 << 23) +# define R500_INST_ALU_RESULT_OP_GE (2 << 23) +# define R500_INST_ALU_RESULT_OP_NE (3 << 23) +# define R500_INST_ALPHA_PRED_SEL_NONE (0 << 25) +# define R500_INST_ALPHA_PRED_SEL_RGBA (1 << 25) +# define R500_INST_ALPHA_PRED_SEL_RRRR (2 << 25) +# define R500_INST_ALPHA_PRED_SEL_GGGG (3 << 25) +# define R500_INST_ALPHA_PRED_SEL_BBBB (4 << 25) +# define R500_INST_ALPHA_PRED_SEL_AAAA (5 << 25) +/* XXX next four are kind of guessed */ +# define R500_INST_STAT_WE_R (1 << 28) +# define R500_INST_STAT_WE_G (1 << 29) +# define R500_INST_STAT_WE_B (1 << 30) +# define R500_INST_STAT_WE_A (1 << 31) +/* note that these are 8 bit lengths, despite the offsets, at least for R500 */ +#define R500_US_CODE_ADDR 0x4630 +# define R500_US_CODE_START_ADDR(x) ((x) << 0) +# define R500_US_CODE_END_ADDR(x) ((x) << 16) +#define R500_US_CODE_OFFSET 0x4638 +# define R500_US_CODE_OFFSET_ADDR(x) ((x) << 0) +#define R500_US_CODE_RANGE 0x4634 +# define R500_US_CODE_RANGE_ADDR(x) ((x) << 0) +# define R500_US_CODE_RANGE_SIZE(x) ((x) << 16) +#define R500_US_CONFIG 0x4600 +# define R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO (1 << 1) +#define R500_US_FC_ADDR_0 0xa000 +# define R500_FC_BOOL_ADDR(x) ((x) << 0) +# define R500_FC_INT_ADDR(x) ((x) << 8) +# define R500_FC_JUMP_ADDR(x) ((x) << 16) +# define R500_FC_JUMP_GLOBAL (1 << 31) +#define R500_US_FC_BOOL_CONST 0x4620 +# define R500_FC_KBOOL(x) (x) +#define R500_US_FC_CTRL 0x4624 +# define R500_FC_TEST_EN (1 << 30) +# define R500_FC_FULL_FC_EN (1 << 31) +#define R500_US_FC_INST_0 0x9800 +# define R500_FC_OP_JUMP (0 << 0) +# define R500_FC_OP_LOOP (1 << 0) +# define R500_FC_OP_ENDLOOP (2 << 0) +# define R500_FC_OP_REP (3 << 0) +# define R500_FC_OP_ENDREP (4 << 0) +# define R500_FC_OP_BREAKLOOP (5 << 0) +# define R500_FC_OP_BREAKREP (6 << 0) +# define R500_FC_OP_CONTINUE (7 << 0) +# define R500_FC_B_ELSE (1 << 4) +# define R500_FC_JUMP_ANY (1 << 5) +# define R500_FC_A_OP_NONE (0 << 6) +# define R500_FC_A_OP_POP (1 << 6) +# define R500_FC_A_OP_PUSH (2 << 6) +# define R500_FC_JUMP_FUNC(x) ((x) << 8) +# define R500_FC_B_POP_CNT(x) ((x) << 16) +# define R500_FC_B_OP0_NONE (0 << 24) +# define R500_FC_B_OP0_DECR (1 << 24) +# define R500_FC_B_OP0_INCR (2 << 24) +# define R500_FC_B_OP1_DECR (0 << 26) +# define R500_FC_B_OP1_NONE (1 << 26) +# define R500_FC_B_OP1_INCR (2 << 26) +# define R500_FC_IGNORE_UNCOVERED (1 << 28) +#define R500_US_FC_INT_CONST_0 0x4c00 +# define R500_FC_INT_CONST_KR(x) ((x) << 0) +# define R500_FC_INT_CONST_KG(x) ((x) << 8) +# define R500_FC_INT_CONST_KB(x) ((x) << 16) +/* _0 through _15 */ +#define R500_US_FORMAT0_0 0x4640 +# define R500_FORMAT_TXWIDTH(x) ((x) << 0) +# define R500_FORMAT_TXHEIGHT(x) ((x) << 11) +# define R500_FORMAT_TXDEPTH(x) ((x) << 22) +/* _0 through _3 */ +#define R500_US_OUT_FMT_0 0x46a4 +# define R500_OUT_FMT_C4_8 (0 << 0) +# define R500_OUT_FMT_C4_10 (1 << 0) +# define R500_OUT_FMT_C4_10_GAMMA (2 << 0) +# define R500_OUT_FMT_C_16 (3 << 0) +# define R500_OUT_FMT_C2_16 (4 << 0) +# define R500_OUT_FMT_C4_16 (5 << 0) +# define R500_OUT_FMT_C_16_MPEG (6 << 0) +# define R500_OUT_FMT_C2_16_MPEG (7 << 0) +# define R500_OUT_FMT_C2_4 (8 << 0) +# define R500_OUT_FMT_C_3_3_2 (9 << 0) +# define R500_OUT_FMT_C_6_5_6 (10 << 0) +# define R500_OUT_FMT_C_11_11_10 (11 << 0) +# define R500_OUT_FMT_C_10_11_11 (12 << 0) +# define R500_OUT_FMT_C_2_10_10_10 (13 << 0) +/* #define R500_OUT_FMT_RESERVED (14 << 0) */ +# define R500_OUT_FMT_UNUSED (15 << 0) +# define R500_OUT_FMT_C_16_FP (16 << 0) +# define R500_OUT_FMT_C2_16_FP (17 << 0) +# define R500_OUT_FMT_C4_16_FP (18 << 0) +# define R500_OUT_FMT_C_32_FP (19 << 0) +# define R500_OUT_FMT_C2_32_FP (20 << 0) +# define R500_OUT_FMT_C4_32_FP (21 << 0) +# define R500_C0_SEL_A (0 << 8) +# define R500_C0_SEL_R (1 << 8) +# define R500_C0_SEL_G (2 << 8) +# define R500_C0_SEL_B (3 << 8) +# define R500_C1_SEL_A (0 << 10) +# define R500_C1_SEL_R (1 << 10) +# define R500_C1_SEL_G (2 << 10) +# define R500_C1_SEL_B (3 << 10) +# define R500_C2_SEL_A (0 << 12) +# define R500_C2_SEL_R (1 << 12) +# define R500_C2_SEL_G (2 << 12) +# define R500_C2_SEL_B (3 << 12) +# define R500_C3_SEL_A (0 << 14) +# define R500_C3_SEL_R (1 << 14) +# define R500_C3_SEL_G (2 << 14) +# define R500_C3_SEL_B (3 << 14) +# define R500_OUT_SIGN(x) ((x) << 16) +# define R500_ROUND_ADJ (1 << 20) +#define R500_US_PIXSIZE 0x4604 +# define R500_PIX_SIZE(x) (x) +#define R500_US_TEX_ADDR_0 0x9800 +# define R500_TEX_SRC_ADDR(x) ((x) << 0) +# define R500_TEX_SRC_ADDR_REL (1 << 7) +# define R500_TEX_SRC_S_SWIZ_R (0 << 8) +# define R500_TEX_SRC_S_SWIZ_G (1 << 8) +# define R500_TEX_SRC_S_SWIZ_B (2 << 8) +# define R500_TEX_SRC_S_SWIZ_A (3 << 8) +# define R500_TEX_SRC_T_SWIZ_R (0 << 10) +# define R500_TEX_SRC_T_SWIZ_G (1 << 10) +# define R500_TEX_SRC_T_SWIZ_B (2 << 10) +# define R500_TEX_SRC_T_SWIZ_A (3 << 10) +# define R500_TEX_SRC_R_SWIZ_R (0 << 12) +# define R500_TEX_SRC_R_SWIZ_G (1 << 12) +# define R500_TEX_SRC_R_SWIZ_B (2 << 12) +# define R500_TEX_SRC_R_SWIZ_A (3 << 12) +# define R500_TEX_SRC_Q_SWIZ_R (0 << 14) +# define R500_TEX_SRC_Q_SWIZ_G (1 << 14) +# define R500_TEX_SRC_Q_SWIZ_B (2 << 14) +# define R500_TEX_SRC_Q_SWIZ_A (3 << 14) +# define R500_TEX_DST_ADDR(x) ((x) << 16) +# define R500_TEX_DST_ADDR_REL (1 << 23) +# define R500_TEX_DST_R_SWIZ_R (0 << 24) +# define R500_TEX_DST_R_SWIZ_G (1 << 24) +# define R500_TEX_DST_R_SWIZ_B (2 << 24) +# define R500_TEX_DST_R_SWIZ_A (3 << 24) +# define R500_TEX_DST_G_SWIZ_R (0 << 26) +# define R500_TEX_DST_G_SWIZ_G (1 << 26) +# define R500_TEX_DST_G_SWIZ_B (2 << 26) +# define R500_TEX_DST_G_SWIZ_A (3 << 26) +# define R500_TEX_DST_B_SWIZ_R (0 << 28) +# define R500_TEX_DST_B_SWIZ_G (1 << 28) +# define R500_TEX_DST_B_SWIZ_B (2 << 28) +# define R500_TEX_DST_B_SWIZ_A (3 << 28) +# define R500_TEX_DST_A_SWIZ_R (0 << 30) +# define R500_TEX_DST_A_SWIZ_G (1 << 30) +# define R500_TEX_DST_A_SWIZ_B (2 << 30) +# define R500_TEX_DST_A_SWIZ_A (3 << 30) +#define R500_US_TEX_ADDR_DXDY_0 0xa000 +# define R500_DX_ADDR(x) ((x) << 0) +# define R500_DX_ADDR_REL (1 << 7) +# define R500_DX_S_SWIZ_R (0 << 8) +# define R500_DX_S_SWIZ_G (1 << 8) +# define R500_DX_S_SWIZ_B (2 << 8) +# define R500_DX_S_SWIZ_A (3 << 8) +# define R500_DX_T_SWIZ_R (0 << 10) +# define R500_DX_T_SWIZ_G (1 << 10) +# define R500_DX_T_SWIZ_B (2 << 10) +# define R500_DX_T_SWIZ_A (3 << 10) +# define R500_DX_R_SWIZ_R (0 << 12) +# define R500_DX_R_SWIZ_G (1 << 12) +# define R500_DX_R_SWIZ_B (2 << 12) +# define R500_DX_R_SWIZ_A (3 << 12) +# define R500_DX_Q_SWIZ_R (0 << 14) +# define R500_DX_Q_SWIZ_G (1 << 14) +# define R500_DX_Q_SWIZ_B (2 << 14) +# define R500_DX_Q_SWIZ_A (3 << 14) +# define R500_DY_ADDR(x) ((x) << 16) +# define R500_DY_ADDR_REL (1 << 17) +# define R500_DY_S_SWIZ_R (0 << 24) +# define R500_DY_S_SWIZ_G (1 << 24) +# define R500_DY_S_SWIZ_B (2 << 24) +# define R500_DY_S_SWIZ_A (3 << 24) +# define R500_DY_T_SWIZ_R (0 << 26) +# define R500_DY_T_SWIZ_G (1 << 26) +# define R500_DY_T_SWIZ_B (2 << 26) +# define R500_DY_T_SWIZ_A (3 << 26) +# define R500_DY_R_SWIZ_R (0 << 28) +# define R500_DY_R_SWIZ_G (1 << 28) +# define R500_DY_R_SWIZ_B (2 << 28) +# define R500_DY_R_SWIZ_A (3 << 28) +# define R500_DY_Q_SWIZ_R (0 << 30) +# define R500_DY_Q_SWIZ_G (1 << 30) +# define R500_DY_Q_SWIZ_B (2 << 30) +# define R500_DY_Q_SWIZ_A (3 << 30) +#define R500_US_TEX_INST_0 0x9000 +# define R500_TEX_ID(x) ((x) << 16) +# define R500_TEX_INST_NOP (0 << 22) +# define R500_TEX_INST_LD (1 << 22) +# define R500_TEX_INST_TEXKILL (2 << 22) +# define R500_TEX_INST_PROJ (3 << 22) +# define R500_TEX_INST_LODBIAS (4 << 22) +# define R500_TEX_INST_LOD (5 << 22) +# define R500_TEX_INST_DXDY (6 << 22) +# define R500_TEX_SEM_ACQUIRE (1 << 25) +# define R500_TEX_IGNORE_UNCOVERED (1 << 26) +# define R500_TEX_UNSCALED (1 << 27) +#define R500_US_W_FMT 0x46b4 +# define R500_W_FMT_W0 (0 << 0) +# define R500_W_FMT_W24 (1 << 0) +# define R500_W_FMT_W24FP (2 << 0) +# define R500_W_SRC_US (0 << 2) +# define R500_W_SRC_RAS (1 << 2) + +#define R500_RS_INST_0 0x4320 +#define R500_RS_INST_1 0x4324 +# define R500_RS_INST_TEX_ID_SHIFT 0 +# define R500_RS_INST_TEX_CN_WRITE (1 << 4) +# define R500_RS_INST_TEX_ADDR_SHIFT 5 +# define R500_RS_INST_COL_ID_SHIFT 12 +# define R500_RS_INST_COL_CN_NO_WRITE (0 << 16) +# define R500_RS_INST_COL_CN_WRITE (1 << 16) +# define R500_RS_INST_COL_CN_WRITE_FBUFFER (2 << 16) +# define R500_RS_INST_COL_CN_WRITE_BACKFACE (3 << 16) +# define R500_RS_INST_COL_COL_ADDR_SHIFT 18 +# define R500_RS_INST_TEX_ADJ (1 << 25) +# define R500_RS_INST_W_CN (1 << 26) + +#define R500_US_FC_CTRL 0x4624 +#define R500_US_CODE_ADDR 0x4630 +#define R500_US_CODE_RANGE 0x4634 +#define R500_US_CODE_OFFSET 0x4638 + +#define R500_RS_IP_0 0x4074 +#define R500_RS_IP_1 0x4078 +# define R500_RS_IP_PTR_K0 62 +# define R500_RS_IP_PTR_K1 63 +# define R500_RS_IP_TEX_PTR_S_SHIFT 0 +# define R500_RS_IP_TEX_PTR_T_SHIFT 6 +# define R500_RS_IP_TEX_PTR_R_SHIFT 12 +# define R500_RS_IP_TEX_PTR_Q_SHIFT 18 +# define R500_RS_IP_COL_PTR_SHIFT 24 +# define R500_RS_IP_COL_FMT_SHIFT 27 +# define R500_RS_IP_COL_FMT_RGBA (0 << 27) +# define R500_RS_IP_OFFSET_EN (1 << 31) + +#define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ + +/* r6xx/r7xx stuff */ +#define R600_GRBM_STATUS 0x8010 +# define R600_CMDFIFO_AVAIL_MASK 0x1f +# define R700_CMDFIFO_AVAIL_MASK 0xf +# define R600_GUI_ACTIVE (1 << 31) + +#define R600_GRBM_SOFT_RESET 0x8020 +# define R600_SOFT_RESET_CP (1 << 0) + +#define R600_WAIT_UNTIL 0x8040 + +#define R600_CP_ME_CNTL 0x86d8 +# define R600_CP_ME_HALT (1 << 28) + +#define R600_CP_RB_BASE 0xc100 +#define R600_CP_RB_CNTL 0xc104 +# define R600_RB_NO_UPDATE (1 << 27) +# define R600_RB_RPTR_WR_ENA (1 << 31) +#define R600_CP_RB_RPTR_WR 0xc108 +#define R600_CP_RB_RPTR_ADDR 0xc10c +#define R600_CP_RB_RPTR_ADDR_HI 0xc110 +#define R600_CP_RB_WPTR 0xc114 +#define R600_CP_RB_WPTR_ADDR 0xc118 +#define R600_CP_RB_WPTR_ADDR_HI 0xc11c + +#define R600_CP_RB_RPTR 0x8700 +#define R600_CP_RB_WPTR_DELAY 0x8704 + +#endif diff --git a/i386/libsaio/base64-decode.c b/i386/libsaio/base64-decode.c new file mode 100644 index 0000000..0cf3307 --- /dev/null +++ b/i386/libsaio/base64-decode.c @@ -0,0 +1,71 @@ +/* + * This code implements the BASE64 algorithm. + * This code is in the public domain; do with it what you wish. + * + * @file base64.c + * @brief This code implements the BASE64 algorithm + * @author Matthieu Speder + */ +#include <libsaio.h> + +//static const char base64_chars[] = +//"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static const char base64_digits[] = +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + +char *BASE64Decode(const char* src, int in_len, int* out_len) +{ + int endpad = 0; + char* dest; + char* result; + + if (in_len % 4) + { + /* Wrong base64 string length */ + return NULL; + + } + result = dest = malloc(in_len / 4 * 3 + 1); + if (result == NULL) + return NULL; /* out of memory */ + while (*src) { + char a = base64_digits[(unsigned char)*(src++)]; + char b = base64_digits[(unsigned char)*(src++)]; + char c = base64_digits[(unsigned char)*(src++)]; + char d = base64_digits[(unsigned char)*(src++)]; + *(dest++) = (a << 2) | ((b & 0x30) >> 4); + if (c == (char)-1) + { + // padding char. + endpad += 2; + break; + } + *(dest++) = ((b & 0x0f) << 4) | ((c & 0x3c) >> 2); + if (d == (char)-1) + { + // padding char. + endpad += 1; + break; + } + *(dest++) = ((c & 0x03) << 6) | d; + } + *dest = 0; + *out_len = in_len / 4 * 3 - endpad; // not including NULL terminator + return result; +} + + +/* end of base64.c */ \ No newline at end of file diff --git a/i386/libsaio/befs.c b/i386/libsaio/befs.c new file mode 100644 index 0000000..367ef01 --- /dev/null +++ b/i386/libsaio/befs.c @@ -0,0 +1,43 @@ +/* + * befs.c + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "befs.h" + +#define BeFSProbeSize 2048 + +#define SUPER_BLOCK_MAGIC1 0x42465331 /* BFS1 */ +#define SUPER_BLOCK_MAGIC2 0xdd121031 +#define SUPER_BLOCK_MAGIC3 0x15b6830e + +/* Find BeFS signature */ +bool BeFSProbe (const void *buf) +{ + return (OSReadLittleInt32(buf+0x220,0)==SUPER_BLOCK_MAGIC1); +} + +/* Find BeFS volume label */ +void BeFSGetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc (BeFSProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, BeFSProbeSize); + if (!BeFSProbe (buf)) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x200, MIN (strMaxLen, 32)); + free (buf); +} diff --git a/i386/libsaio/befs.h b/i386/libsaio/befs.h new file mode 100644 index 0000000..01cd062 --- /dev/null +++ b/i386/libsaio/befs.h @@ -0,0 +1,11 @@ +/* + * befs.h + * + * + * Created by scorpius + * Copyright 2010 + * + */ + +extern bool BeFSProbe (const void *buf); +extern void BeFSGetDescription(CICell ih, char *str, long strMaxLen); diff --git a/i386/libsaio/bios.h b/i386/libsaio/bios.h new file mode 100644 index 0000000..52c98ce --- /dev/null +++ b/i386/libsaio/bios.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1994 NeXT Computer, Inc. + * All rights reserved. + */ + +#ifndef __LIBSAIO_BIOS_H +#define __LIBSAIO_BIOS_H + +#include "bootargs.h" + +typedef union { + unsigned int rx; + unsigned short rr; + struct { + unsigned char l; + unsigned char h; + } r; +} machineRegister_t; + +typedef struct { + unsigned short cf :1; + unsigned short :1; + unsigned short pf :1; + unsigned short :1; + unsigned short af :1; + unsigned short :1; + unsigned short zf :1; + unsigned short sf :1; + unsigned short tf :1; + unsigned short _if :1; + unsigned short df :1; + unsigned short of :1; + unsigned short iopl:2; + unsigned short nt :1; +} machineFlags_t; + +typedef struct { + unsigned int intno; + machineRegister_t eax; + machineRegister_t ebx; + machineRegister_t ecx; + machineRegister_t edx; + machineRegister_t edi; + machineRegister_t esi; + machineRegister_t ebp; + unsigned short cs; + unsigned short ds; + unsigned short es; + machineFlags_t flags; +} biosBuf_t; + +#define EBIOS_FIXED_DISK_ACCESS 0x01 +#define EBIOS_LOCKING_ACCESS 0x02 +#define EBIOS_ENHANCED_DRIVE_INFO 0x04 + +#define BASE_HD_DRIVE 0x80 + +#if 0 +/* + * ACPI defined memory range types. + */ +enum { + kMemoryRangeUsable = 1, // RAM usable by the OS. + kMemoryRangeReserved = 2, // Reserved. (Do not use) + kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed. + kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use) + + /* Undefined types should be treated as kMemoryRangeReserved */ +}; +#endif + +/* + * Memory range descriptor. + */ +typedef struct MemoryRange { + unsigned long long base; // 64-bit base address + unsigned long long length; // 64-bit length in bytes + unsigned long type; // type of memory range + unsigned long reserved; +} MemoryRange; + +#endif /* !__LIBSAIO_BIOS_H */ diff --git a/i386/libsaio/bios.s b/i386/libsaio/bios.s new file mode 100644 index 0000000..b36be6c --- /dev/null +++ b/i386/libsaio/bios.s @@ -0,0 +1,184 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + * + * Harness for calling real-mode BIOS functions. + */ + +/* Copyright 2007 David Elliott + 2007-12-30 dfe + - Enhanced code to use specified DS register when doing BIOS interrupt + - Fixed movl %ax,new_es bug which assembler was interpreting as + movl %eax,new_es which was overwriting the next word. + */ +#include <architecture/i386/asm_help.h> +#include "memory.h" + +#define data32 .byte 0x66 +#define addr32 .byte 0x67 + +#define O_INT 0 +#define O_EAX 4 +#define O_EBX 8 +#define O_ECX 12 +#define O_EDX 16 +#define O_EDI 20 +#define O_ESI 24 +#define O_EBP 28 +#define O_CS 32 +#define O_DS 34 +#define O_ES 36 +#define O_FLG 38 + + .section __INIT,__data // turbo - Data that must be in the first segment + +/* Saved registers: + These used to be (and in theory ought to be) located in __DATA,__bss. + The problem is that the larger the binary grows, more of the BSS gets + pushed into the next real-mode segment. Doing it this way we waste 24 + bytes in the binary that our loader (e.g. boot1) must now load. But the + advantage is that we relocate this data to ensure it stays in the first + real-mode segment. Therefore, depending on link order, quite a lot of + new data, and possibly a lot of new executable code can be added to the + binary since with this change the BSS and most of the DATA is now only + accessed from protected mode where real-mode segment limits don't apply. + + With this change, plus the earlier change to respect DS (e.g. use huge + pointers), the binary can grow much larger, currently up to exactly 63.5k + which is the maximum that the first-stage bootsectors can handle. To get + more than that more changes are needed. In that case we would have to + play with Mach-O segments to ensure real-mode code and data got stuffed + well within the first 63.5k. Furthermore, we'd have to adjust the boot + sectors to allow them to span segments. + + Since this change alone only gains us about 4k more than where we're at + now (which is not anything to scoff at) it won't be very long before we + need to start using Mach-O segments to force the linker to locate certain + bits of code and data within the first 63.5k and modify the loaders to + be able to load more than 63.5k. + */ + .align 2 +save_eax: .space 4 + .align 2 +save_edx: .space 4 + .align 1 +save_es: .space 2 + .align 1 +save_flag: .space 2 + .align 2 +new_eax: .space 4 + .align 2 +new_edx: .space 4 + .align 1 +new_es: .space 2 + .align 1 +new_ds: .space 2 + + .section __INIT,__text // turbo - This code must reside within the first segment + + +/*============================================================================ + * Call real-mode BIOS INT functions. + * + */ +LABEL(_bios) + enter $0, $0 + pushal + + movl 8(%ebp), %edx // address of save area + movb O_INT(%edx), %al // save int number + movb %al, do_int+1 + + movl O_EBX(%edx), %ebx + movl O_ECX(%edx), %ecx + movl O_EDI(%edx), %edi + movl O_ESI(%edx), %esi + movl O_EBP(%edx), %ebp + movl %edx, save_edx + movl O_EAX(%edx), %eax + movl %eax, new_eax + movl O_EDX(%edx), %eax + movl %eax, new_edx + movw O_ES(%edx), %ax + movw %ax, new_es + movw O_DS(%edx), %ax + movw %ax, new_ds + + call __prot_to_real + + data32 + addr32 + mov OFFSET16(new_eax), %eax + data32 + addr32 + mov OFFSET16(new_edx), %edx + data32 + addr32 + mov OFFSET16(new_es), %es + + push %ds // Save DS + // Replace DS. WARNING: Don't access data until it's restored! + addr32 + data32 + mov OFFSET16(new_ds), %ds + +do_int: + int $0x00 + pop %ds // Restore DS before we do anything else + + pushf + data32 + addr32 + movl %eax, OFFSET16(save_eax) + popl %eax // actually pop %ax + addr32 + movl %eax, OFFSET16(save_flag) // actually movw + mov %es, %ax + addr32 + movl %eax, OFFSET16(save_es) // actually movw + data32 + call __real_to_prot + + movl %edx, new_edx // save new edx before clobbering + movl save_edx, %edx + movl new_edx, %eax // now move it into buffer + movl %eax, O_EDX(%edx) + movl save_eax, %eax + movl %eax, O_EAX(%edx) + movw save_es, %ax + movw %ax, O_ES(%edx) + movw save_flag, %ax + movw %ax, O_FLG(%edx) + movl %ebx, O_EBX(%edx) + movl %ecx, O_ECX(%edx) + movl %edi, O_EDI(%edx) + movl %esi, O_ESI(%edx) + movl %ebp, O_EBP(%edx) + + popal + leave + + ret diff --git a/i386/libsaio/biosfn.c b/i386/libsaio/biosfn.c new file mode 100644 index 0000000..dc1ec45 --- /dev/null +++ b/i386/libsaio/biosfn.c @@ -0,0 +1,959 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + */ + +/* Copyright 2007 David Elliott + 2007-12-30 dfe + - Enhanced code to normalize segment/offset to huge pointers so that any + linear address within the first MB of memory can be passed to BIOS + functions. This allows some of the __DATA sections to span into the + next segment and also allows stack variables to be used whereas the + old code could only operate on static data in the first 64k. + NOTE: Requires bios.s change to respect DS. + */ +/* Copyright 2007 VMware Inc. + 2007-12-29 dfe + - Added ebiosEjectMedia + */ + +#include "bootstruct.h" +#include "libsaio.h" + + +#define MAX_DRIVES 8 + +static biosBuf_t bb; + +int bgetc(void) +{ + /* Poll for the next character. Most real BIOS do not need this as the + INT 16h,AH=0h function will block until one is received. + Unfortunately, Apple's EFI CSM will never wake up. This idea is lifted + from the grub-a20.patch to GRUB's stage2/asm.S file. + */ + while(!readKeyboardStatus()) + ; + bb.intno = 0x16; + bb.eax.r.h = 0x00; + bios(&bb); + return bb.eax.rr; +} + +int readKeyboardStatus(void) +{ + bb.intno = 0x16; + bb.eax.r.h = 0x01; + bios(&bb); + if (bb.flags.zf) { + return 0; + } else { + return bb.eax.rr; + } +} + +int readKeyboardShiftFlags(void) +{ + bb.intno = 0x16; + bb.eax.r.h = 0x02; + bios(&bb); + return bb.eax.r.l; +} + +unsigned int time18(void) +{ + union { + struct { + unsigned int low:16; + unsigned int high:16; + } s; + unsigned int i; + } time; + + bb.intno = 0x1a; + bb.eax.r.h = 0x00; + bios(&bb); + time.s.low = bb.edx.rr; + time.s.high = bb.ecx.rr; + return time.i; +} + +#if 0 +static unsigned long rerangeMemoryMap(unsigned long count) +{ + int i, still_changing, newcount = count; + + MemoryRange * range = (MemoryRange *)BIOS_ADDR; + struct MemoryRange change_tmp; + + /* sort map list by memory addresses (low -> high) */ + still_changing = 1; + while (still_changing) { + still_changing = 0; + for (i=1; i<count; i++) { + /* if <current_addr> > <last_addr>, swap */ + if (range[i].base < range[i-1].base) { + change_tmp.base = range[i].base; + change_tmp.length = range[i].length; + change_tmp.type = range[i].type; + + range[i].base = range[i-1].base; + range[i].length = range[i-1].length; + range[i].type = range[i-1].type; + + range[i-1].base = change_tmp.base; + range[i-1].length = change_tmp.length; + range[i-1].type = change_tmp.type; + + still_changing=1; + } + } + } + + /* clear overlaps */ + /* linux's arch/i386/kern/setup.c may have better algorithm */ + for (i=1; i<count; i++) { + if ( range[i-1].base + range[i-1].length > range[i].base ) { + range[newcount].base = range[i].base + range[i].length; + range[newcount].length = range[i-1].base + range[i-1].length - range[newcount].base; + range[newcount].type = range[i-1].type; + newcount++; + + range[i-1].length = range[i].base - range[i-1].base; + } + } + + /* + * 0xb0000000 : 0x10000000 NG + * 0xc0000400 NG + * 0xf2000000 NG + */ + range[newcount].base = 0xb0000000; + range[newcount].length = 0x0f000000; + range[newcount].type = kMemoryRangeUsable; + newcount++; + + return newcount; +} +#endif + +unsigned long getMemoryMap( MemoryRange * rangeArray, + unsigned long maxRangeCount, + unsigned long * conMemSizePtr, + unsigned long * extMemSizePtr ) +{ + #define kMemoryMapSignature 'SMAP' + #define kDescriptorSizeMin 20 + + MemoryRange * range = (MemoryRange *)BIOS_ADDR; + unsigned long count = 0; + // unsigned long rerangedCount; + unsigned long long conMemSize = 0; + unsigned long long extMemSize = 0; + + // Prepare for the INT15 E820h call. Each call returns a single + // memory range. A continuation value is returned that must be + // provided on a subsequent call to fetch the next range. + // + // Certain BIOSes (Award 6.00PG) expect the upper word in EAX + // to be cleared on entry, otherwise only a single range will + // be reported. + // + // Some BIOSes will simply ignore the value of ECX on entry. + // Probably best to keep its value at 20 to avoid surprises. + + //printf("Get memory map 0x%x, %d\n", rangeArray); getchar(); + if (maxRangeCount > (BIOS_LEN / sizeof(MemoryRange))) { + maxRangeCount = (BIOS_LEN / sizeof(MemoryRange)); + } + bb.ebx.rx = 0; // Initial continuation value must be zero. + + while ( count < maxRangeCount ) + { + bb.intno = 0x15; + bb.eax.rx = 0xe820; + bb.ecx.rx = kDescriptorSizeMin; + bb.edx.rx = kMemoryMapSignature; + bb.edi.rr = NORMALIZED_OFFSET( (unsigned long) range ); + bb.es = NORMALIZED_SEGMENT( (unsigned long) range ); + bios(&bb); + + // Check for errors. + + if ( bb.flags.cf + || bb.eax.rx != kMemoryMapSignature + || bb.ecx.rx != kDescriptorSizeMin ) { + //printf("Got an error %x %x %x\n", bb.flags.cf, + // bb.eax.rx, bb.ecx.rx); + break; + } + + // Tally up the conventional/extended memory sizes. + + if ( range->type == kMemoryRangeUsable || + range->type == kMemoryRangeACPI || + range->type == kMemoryRangeNVS ) + { + // Tally the conventional memory ranges. + if ( range->base + range->length <= 0xa0000 ) { + conMemSize += range->length; + } + + // Record the top of extended memory. + if ( range->base >= EXTENDED_ADDR ) { + extMemSize += range->length; + } + } + + range++; + count++; + + // Is this the last address range? + + if ( bb.ebx.rx == 0 ) { + //printf("last range\n"); + break; + } + } + *conMemSizePtr = conMemSize / 1024; // size in KB + *extMemSizePtr = extMemSize / 1024; // size in KB + +#if 0 + rerangedCount = rerangeMemoryMap(count); + range += rerangedCount - count; +#endif + + // Copy out data + bcopy((char *)BIOS_ADDR, rangeArray, ((char *)range - (char *)BIOS_ADDR)); + +#if DEBUG + { + int i; + printf("%d total ranges\n", count); getchar(); + for (i=0, range = rangeArray; i<count; i++, range++) { + printf("range: type %d, base 0x%x, length 0x%x\n", + range->type, (unsigned int)range->base, (unsigned int)range->length); getchar(); + } + } +#endif + + return count; +} + +unsigned long getExtendedMemorySize() +{ + // Get extended memory size for large configurations. Not used unless + // the INT15, E820H call (Get System Address Map) failed. + // + // Input: + // + // AX Function Code E801h + // + // Outputs: + // + // CF Carry Flag Carry cleared indicates no error. + // AX Extended 1 Number of contiguous KB between 1 and 16 MB, + // maximum 0x3C00 = 15 MB. + // BX Extended 2 Number of contiguous 64 KB blocks between + // 16 MB and 4 GB. + // CX Configured 1 Number of contiguous KB between 1 and 16 MB, + // maximum 0x3C00 = 15 MB. + // DX Configured 2 Number of contiguous 64 KB blocks between + // 16 MB and 4 GB. + + bb.intno = 0x15; + bb.eax.rx = 0xe801; + bios(&bb); + + // Return the size of memory above 1MB (extended memory) in kilobytes. + + if ( bb.flags.cf == 0 ) return (bb.ebx.rr * 64 + bb.eax.rr); + + // Get Extended memory size. Called on last resort since the return + // value is limited to 16-bits (a little less than 64MB max). May + // not be supported by modern BIOSes. + // + // Input: + // + // AX Function Code E801h + // + // Outputs: + // + // CF Carry Flag Carry cleared indicates no error. + // AX Memory Count Number of contiguous KB above 1MB. + + bb.intno = 0x15; + bb.eax.rx = 0x88; + bios(&bb); + + // Return the size of memory above 1MB (extended memory) in kilobytes. + + return bb.flags.cf ? 0 : bb.eax.rr; +} + +unsigned long getConventionalMemorySize() +{ + bb.intno = 0x12; + bios(&bb); + return bb.eax.rr; // kilobytes +} + +void video_mode(int mode) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x00; + bb.eax.r.l = mode; + bios(&bb); +} + +int biosread(int dev, int cyl, int head, int sec, int num) +{ + int i; + + bb.intno = 0x13; + sec += 1; /* sector numbers start at 1 */ + + for (i=0;;) { + bb.ecx.r.h = cyl; + bb.ecx.r.l = ((cyl & 0x300) >> 2) | (sec & 0x3F); + bb.edx.r.h = head; + bb.edx.r.l = dev; + bb.eax.r.l = num; + bb.ebx.rr = OFFSET(ptov(BIOS_ADDR)); + bb.es = SEGMENT(ptov(BIOS_ADDR)); + + bb.eax.r.h = 0x02; + bios(&bb); + + /* In case of a successful call, make sure we set AH (return code) to zero. */ + if (bb.flags.cf == 0) + bb.eax.r.h = 0; + + /* Now we can really check for the return code (AH) value. */ + if ((bb.eax.r.h == 0x00) || (i++ >= 5)) + break; + + /* reset disk subsystem and try again */ + bb.eax.r.h = 0x00; + bios(&bb); + } + return bb.eax.r.h; +} + +int ebiosread(int dev, unsigned long long sec, int count) +{ + int i; + static struct { + unsigned char size; + unsigned char reserved; + unsigned char numblocks; + unsigned char reserved2; + unsigned short bufferOffset; + unsigned short bufferSegment; + unsigned long long startblock; + } addrpacket __attribute__((aligned(16))) = {0}; + addrpacket.size = sizeof(addrpacket); + + for (i=0;;) { + bb.intno = 0x13; + bb.eax.r.h = 0x42; + bb.edx.r.l = dev; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&addrpacket); + bb.ds = NORMALIZED_SEGMENT((unsigned)&addrpacket); + addrpacket.reserved = addrpacket.reserved2 = 0; + addrpacket.numblocks = count; + addrpacket.bufferOffset = OFFSET(ptov(BIOS_ADDR)); + addrpacket.bufferSegment = SEGMENT(ptov(BIOS_ADDR)); + addrpacket.startblock = sec; + bios(&bb); + + /* In case of a successful call, make sure we set AH (return code) to zero. */ + if (bb.flags.cf == 0) + bb.eax.r.h = 0; + + /* Now we can really check for the return code (AH) value. */ + if ((bb.eax.r.h == 0x00) || (i++ >= 5)) + break; + + /* reset disk subsystem and try again */ + bb.eax.r.h = 0x00; + bios(&bb); + } + return bb.eax.r.h; +} + +int ebioswrite(int dev, long sec, int count) +{ + int i; + static struct { + unsigned char size; + unsigned char reserved; + unsigned char numblocks; + unsigned char reserved2; + unsigned short bufferOffset; + unsigned short bufferSegment; + unsigned long long startblock; + } addrpacket __attribute__((aligned(16))) = {0}; + addrpacket.size = sizeof(addrpacket); + + for (i=0;;) { + bb.intno = 0x13; + bb.eax.r.l = 0; /* Don't verify */ + bb.eax.r.h = 0x43; + bb.edx.r.l = dev; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&addrpacket); + bb.ds = NORMALIZED_SEGMENT((unsigned)&addrpacket); + addrpacket.reserved = addrpacket.reserved2 = 0; + addrpacket.numblocks = count; + addrpacket.bufferOffset = OFFSET(ptov(BIOS_ADDR)); + addrpacket.bufferSegment = SEGMENT(ptov(BIOS_ADDR)); + addrpacket.startblock = sec; + bios(&bb); + + /* In case of a successful call, make sure we set AH (return code) to zero. */ + if (bb.flags.cf == 0) + bb.eax.r.h = 0; + + /* Now we can really check for the return code (AH) value. */ + if ((bb.eax.r.h == 0x00) || (i++ >= 5)) + break; + + /* reset disk subsystem and try again */ + bb.eax.r.h = 0x00; + bios(&bb); + } + return bb.eax.r.h; +} + +void bios_putchar(int ch) +{ + bb.intno = 0x10; + bb.ebx.r.h = 0x00; /* background black */ + bb.ebx.r.l = 0x0F; /* foreground white */ + bb.eax.r.h = 0x0e; + bb.eax.r.l = ch; + bios(&bb); +} + +void putca(int ch, int attr, int repeat) +{ + bb.intno = 0x10; + bb.ebx.r.h = 0x00; /* page number */ + bb.ebx.r.l = attr; /* attribute */ + bb.eax.r.h = 0x9; + bb.eax.r.l = ch; + bb.ecx.rx = repeat; /* repeat count */ + bios(&bb); +} + +/* Check to see if the passed-in drive is in El Torito no-emulation mode. */ +int is_no_emulation(int drive) +{ + struct packet { + unsigned char packet_size; + unsigned char media_type; + unsigned char drive_num; + unsigned char ctrlr_index; + unsigned long lba; + unsigned short device_spec; + unsigned short buffer_segment; + unsigned short load_segment; + unsigned short sector_count; + unsigned char cyl_count; + unsigned char sec_count; + unsigned char head_count; + unsigned char reseved; + } __attribute__((packed)); + static struct packet pkt; + + bzero(&pkt, sizeof(pkt)); + pkt.packet_size = 0x13; + + bb.intno = 0x13; + bb.eax.r.h = 0x4b; + bb.eax.r.l = 0x01; // subfunc: get info + bb.edx.r.l = drive; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&pkt); + bb.ds = NORMALIZED_SEGMENT((unsigned)&pkt); + + bios(&bb); +#if DEBUG + printf("el_torito info drive %x\n", drive); + + printf("--> cf %x, eax %x\n", bb.flags.cf, bb.eax.rr); + + printf("pkt_size: %x\n", pkt.packet_size); + printf("media_type: %x\n", pkt.media_type); + printf("drive_num: %x\n", pkt.drive_num); + printf("device_spec: %x\n", pkt.device_spec); + pause(); +#endif + + /* Some BIOSes erroneously return cf = 1 */ + /* Just check to see if the drive number is the same. */ + if (pkt.drive_num == drive) { + if ((pkt.media_type & 0x0F) == 0) { + /* We are in no-emulation mode. */ + return 1; + } + } + return 0; +} + +#if DEBUG +/* + * BIOS drive information. + */ +void print_drive_info(boot_drive_info_t *dp) +{ +// printf("buf_size = %x\n", dp->params.buf_size); + printf("info_flags = %x\n", dp->params.info_flags); + printf("phys_cyls = %lx\n", dp->params. phys_cyls); + printf("phys_heads = %lx\n", dp->params. phys_heads); + printf("phys_spt = %lx\n", dp->params. phys_spt); + printf("phys_sectors = %lx%lx\n", ((unsigned long *)(&dp->params.phys_sectors))[1], + ((unsigned long *)(&dp->params.phys_sectors))[0]); + printf("phys_nbps = %x\n", dp->params.phys_nbps); +// printf("dpte_offset = %x\n", dp->params.dpte_offset); +// printf("dpte_segment = %x\n", dp->params.dpte_segment); +// printf("key = %x\n", dp->params.key); +// printf("path_len = %x\n", dp->params. path_len); +// printf("reserved1 = %x\n", dp->params. reserved1); +// printf("reserved2 = %x\n", dp->params.reserved2); +// printf("bus_type[4] = %x\n", dp->params. bus_type[4]); +// printf("interface_type[8] = %x\n", dp->params. interface_type[8]); +// printf("interface_path[8] = %x\n", dp->params. interface_path[8]); +// printf("dev_path[8] = %x\n", dp->params. dev_path[8]); +// printf("reserved3 = %x\n", dp->params. reserved3); +// printf("checksum = %x\n", dp->params. checksum); + printf("io_port_base = %x\n", dp->dpte.io_port_base); + printf("control_port_base = %x\n", dp->dpte.control_port_base); + printf("head_flags = %x\n", dp->dpte. head_flags); + printf("vendor_info = %x\n", dp->dpte. vendor_info); + printf("irq = %x\n", dp->dpte. irq); +// printf("irq_unused = %x\n", dp->dpte. irq_unused); + printf("block_count = %x\n", dp->dpte. block_count); + printf("dma_channe = %x\n", dp->dpte. dma_channel); + printf("dma_type = %x\n", dp->dpte. dma_type); + printf("pio_type = %x\n", dp->dpte. pio_type); + printf("pio_unused = %x\n", dp->dpte. pio_unused); + printf("option_flags = %x\n", dp->dpte.option_flags); +// printf("reserved = %x\n", dp->dpte.reserved); + printf("revision = %x\n", dp->dpte. revision); +// printf("checksum = %x\n", dp->dpte. checksum); +} + +#endif + +int get_drive_info(int drive, struct driveInfo *dp) +{ + boot_drive_info_t *di = &dp->di; + int ret = 0; + +#if UNUSED + if (maxhd == 0) { + bb.intno = 0x13; + bb.eax.r.h = 0x08; + bb.edx.r.l = 0x80; + bios(&bb); + if (bb.flags.cf == 0) + maxhd = 0x7f + bb.edx.r.l; + }; + + if (drive > maxhd) + return 0; +#endif + + bzero(dp, sizeof(struct driveInfo)); + dp->biosdev = drive; + + /* Check for El Torito no-emulation mode. */ + dp->no_emulation = is_no_emulation(drive); + + /* Check drive for EBIOS support. */ + bb.intno = 0x13; + bb.eax.r.h = 0x41; + bb.edx.r.l = drive; + bb.ebx.rr = 0x55aa; + bios(&bb); + + if ((bb.ebx.rr == 0xaa55) && (bb.flags.cf == 0)) { + /* Get flags for supported operations. */ + dp->uses_ebios = bb.ecx.r.l; + } + + if (dp->uses_ebios & (EBIOS_ENHANCED_DRIVE_INFO | EBIOS_LOCKING_ACCESS | EBIOS_FIXED_DISK_ACCESS)) { + /* Get EBIOS drive info. */ + static struct drive_params params; + + params.buf_size = sizeof(params); + bb.intno = 0x13; + bb.eax.r.h = 0x48; + bb.edx.r.l = drive; + bb.esi.rr = NORMALIZED_OFFSET((unsigned)¶ms); + bb.ds = NORMALIZED_SEGMENT((unsigned)¶ms); + bios(&bb); + + if (bb.flags.cf != 0 /* || params.phys_sectors < 2097152 */) { + dp->uses_ebios = 0; + di->params.buf_size = 1; + } + else + { + bcopy(¶ms, &di->params, sizeof(params)); + + if (drive >= BASE_HD_DRIVE && + (dp->uses_ebios & EBIOS_ENHANCED_DRIVE_INFO) && + di->params.buf_size >= 30 && + !(di->params.dpte_offset == 0xFFFF && di->params.dpte_segment == 0xFFFF)) { + void *ptr = (void *)(di->params.dpte_offset + ((unsigned int)di->params.dpte_segment << 4)); + bcopy(ptr, &di->dpte, sizeof(di->dpte)); + } + } + } + +/* + * zef: This code will fail on recent JMicron and Intel option ROMs + */ +// if (di->params.phys_heads == 0 || di->params.phys_spt == 0) { +// /* Either it's not EBIOS, or EBIOS didn't tell us. */ +// bb.intno = 0x13; +// bb.eax.r.h = 0x08; +// bb.edx.r.l = drive; +// bios(&bb); +// if (bb.flags.cf == 0 && bb.eax.r.h == 0) { +// unsigned long cyl; +// unsigned long sec; +// unsigned long hds; +// +// hds = bb.edx.r.h; +// sec = bb.ecx.r.l & 0x3F; +// if ((dp->uses_ebios & EBIOS_ENHANCED_DRIVE_INFO) && (sec != 0)) { +// cyl = (di->params.phys_sectors / ((hds + 1) * sec)) - 1; +// } else { +// cyl = bb.ecx.r.h | ((bb.ecx.r.l & 0xC0) << 2); +// } +// di->params.phys_heads = hds; +// di->params.phys_spt = sec; +// di->params.phys_cyls = cyl; +// } else { +// ret = -1; +// } +// } + + if (dp->no_emulation) { + /* Some BIOSes give us erroneous EBIOS support information. + * Assume that if you're on a CD, then you can use + * EBIOS disk calls. + */ + dp->uses_ebios |= EBIOS_FIXED_DISK_ACCESS; + } +#if DEBUG + print_drive_info(di); + printf("uses_ebios = 0x%x\n", dp->uses_ebios); + printf("result %d\n", ret); + pause(); +#endif + + if (ret == 0) { + dp->valid = 1; + } + return ret; +} + +int ebiosEjectMedia(int biosdev) +{ + bb.intno = 0x13; + bb.eax.r.h = 0x46; + bb.eax.r.l = 0; + bb.edx.rx = biosdev; + bios(&bb); + return bb.eax.r.h; +} + +void setCursorPosition(int x, int y, int page) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x02; + bb.ebx.r.h = page; /* page 0 for graphics */ + bb.edx.r.l = x; + bb.edx.r.h = y; + bios(&bb); +} + +void setCursorType(int type) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x01; + bb.ecx.rr = type; + bios(&bb); +} + +void getCursorPositionAndType(int * x, int * y, int * type) +{ + bb.intno = 0x10; + bb.eax.r.h = 0x03; + bios(&bb); + *x = bb.edx.r.l; + *y = bb.edx.r.h; + *type = bb.ecx.rr; +} + +void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir) +{ + bb.intno = 0x10; + bb.eax.r.h = (dir > 0) ? 0x06 : 0x07; + bb.eax.r.l = rows; + bb.ebx.r.h = attr; + bb.ecx.r.h = y1; + bb.ecx.r.l = x1; + bb.edx.r.h = y2; + bb.edx.r.l = x2; + bios(&bb); +} + +void clearScreenRows( int y1, int y2 ) +{ + scollPage( 0, y1, 80 - 1, y2, 0x07, y2 - y1 + 1, 1 ); +} + +void setActiveDisplayPage( int page ) +{ + bb.intno = 0x10; + bb.eax.r.h = 5; + bb.eax.r.l = page; + bios(&bb); +} + +#if DEBUG + +int terminateDiskEmulation() +{ + static char cd_spec[0x13]; + + bb.intno = 0x13; + bb.eax.r.h = 0x4b; + bb.eax.r.l = 0; // subfunc: terminate emulation + bb.esi.rr = NORMALIZED_OFFSET((unsigned)&cd_spec); + bb.ds = NORMALIZED_SEGMENT((unsigned)&cd_spec); + bios(&bb); + return bb.eax.r.h; +} + +int readDriveParameters(int drive, struct driveParameters *dp) +{ + bb.intno = 0x13; + bb.edx.r.l = drive; + bb.eax.r.h = 0x08; + bios(&bb); + if (bb.eax.r.h == 0) { + dp->heads = bb.edx.r.h; + dp->sectors = bb.ecx.r.l & 0x3F; + dp->cylinders = bb.ecx.r.h | ((bb.ecx.r.l & 0xC0) << 2); + dp->totalDrives = bb.edx.r.l; + } else { + bzero(dp, sizeof(*dp)); + } + return bb.eax.r.h; + +} +#endif + +#ifdef APM_SUPPORT + +#define APM_INTNO 0x15 +#define APM_INTCODE 0x53 + +int +APMPresent(void) +{ + bb.intno = APM_INTNO; + bb.eax.r.h = APM_INTCODE; + bb.eax.r.l = 0x00; + bb.ebx.rr = 0x0000; + bios(&bb); + if ((bb.flags.cf == 0) && + (bb.ebx.r.h == 'P') && + (bb.ebx.r.l == 'M')) { + /* Success */ + bootArgs->apmConfig.major_vers = bb.eax.r.h; + bootArgs->apmConfig.minor_vers = bb.eax.r.l; + bootArgs->apmConfig.flags.data = bb.ecx.rr; + return 1; + } + return 0; +} + +int +APMConnect32(void) +{ + bb.intno = APM_INTNO; + bb.eax.r.h = APM_INTCODE; + bb.eax.r.l = 0x03; + bb.ebx.rr = 0x0000; + bios(&bb); + if (bb.flags.cf == 0) { + /* Success */ + bootArgs->apmConfig.cs32_base = (bb.eax.rr) << 4; + bootArgs->apmConfig.entry_offset = bb.ebx.rx; + bootArgs->apmConfig.cs16_base = (bb.ecx.rr) << 4; + bootArgs->apmConfig.ds_base = (bb.edx.rr) << 4; + if (bootArgs->apmConfig.major_vers >= 1 && + bootArgs->apmConfig.minor_vers >= 1) { + bootArgs->apmConfig.cs_length = bb.esi.rr; + bootArgs->apmConfig.ds_length = bb.edi.rr; + } else { + bootArgs->apmConfig.cs_length = + bootArgs->apmConfig.ds_length = 64 * 1024; + } + bootArgs->apmConfig.connected = 1; + return 1; + } + return 0; +} + +#endif /* APM_SUPPORT */ + +#ifdef EISA_SUPPORT +bool eisa_present(void) +{ + static bool checked = false; + static bool isEISA; + + if (!checked) { + if (strncmp((char *)0xfffd9, "EISA", 4) == 0) + isEISA = true; + + checked = true; + } + + return (isEISA); +} + +int +ReadEISASlotInfo(EISA_slot_info_t *ep, int slot) +{ + union { + struct { + unsigned char char2h :2; + unsigned char char1 :5; + unsigned char char3 :5; + unsigned char char2l :3; + unsigned char d2 :4; + unsigned char d1 :4; + unsigned char d4 :4; + unsigned char d3 :4; + } s; + unsigned char data[4]; + } u; + static char hex[0x10] = "0123456789ABCDEF"; + + + bb.intno = 0x15; + bb.eax.r.h = 0xd8; + bb.eax.r.l = 0x00; + bb.ecx.r.l = slot; + bios(&bb); + if (bb.flags.cf) + return bb.eax.r.h; + ep->u_ID.d = bb.eax.r.l; + ep->configMajor = bb.ebx.r.h; + ep->configMinor = bb.ebx.r.l; + ep->checksum = bb.ecx.rr; + ep->numFunctions = bb.edx.r.h; + ep->u_resources.d = bb.edx.r.l; + u.data[0] = bb.edi.r.l; + u.data[1] = bb.edi.r.h; + u.data[2] = bb.esi.r.l; + u.data[3] = bb.esi.r.h; + ep->id[0] = u.s.char1 + ('A' - 1); + ep->id[1] = (u.s.char2l | (u.s.char2h << 3)) + ('A' - 1); + ep->id[2] = u.s.char3 + ('A' - 1); + ep->id[3] = hex[u.s.d1]; + ep->id[4] = hex[u.s.d2]; + ep->id[5] = hex[u.s.d3]; + ep->id[6] = hex[u.s.d4]; + ep->id[7] = 0; + return 0; +} + +/* + * Note: ep must point to an address below 64k. + */ + +int +ReadEISAFuncInfo(EISA_func_info_t *ep, int slot, int function) +{ + bb.intno = 0x15; + bb.eax.r.h = 0xd8; + bb.eax.r.l = 0x01; + bb.ecx.r.l = slot; + bb.ecx.r.h = function; + bb.esi.rr = (unsigned int)ep->data; + bios(&bb); + if (bb.eax.r.h == 0) { + ep->slot = slot; + ep->function = function; + } + return bb.eax.r.h; +} +#endif /* EISA_SUPPORT */ + +#define PCI_SIGNATURE 0x20494350 /* "PCI " */ + +int +ReadPCIBusInfo(PCI_bus_info_t *pp) +{ + bb.intno = 0x1a; + bb.eax.r.h = 0xb1; + bb.eax.r.l = 0x01; + bios(&bb); + if ((bb.eax.r.h == 0) && (bb.edx.rx == PCI_SIGNATURE)) { + pp->BIOSPresent = 1; + pp->u_bus.d = bb.eax.r.l; + pp->majorVersion = bb.ebx.r.h; + pp->minorVersion = bb.ebx.r.l; + pp->maxBusNum = bb.ecx.r.l; + return 0; + } + return -1; +} + +void sleep(int n) +{ + unsigned int endtime = (time18() + 18*n); + while (time18() < endtime); +} + +void delay(int ms) +{ + bb.intno = 0x15; + bb.eax.r.h = 0x86; + bb.ecx.rr = ms >> 16; + bb.edx.rr = ms & 0xFFFF; + bios(&bb); +} + diff --git a/i386/libsaio/bootargs.h b/i386/libsaio/bootargs.h new file mode 100644 index 0000000..b0bd909 --- /dev/null +++ b/i386/libsaio/bootargs.h @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +#ifndef _PEXPERT_I386_BOOT_H +#define _PEXPERT_I386_BOOT_H + +#include <stdint.h> + +/* + * What the booter leaves behind for the kernel. + */ + +/* + * Types of boot driver that may be loaded by the booter. + */ +enum { + kBootDriverTypeInvalid = 0, + kBootDriverTypeKEXT = 1, + kBootDriverTypeMKEXT = 2 +}; + +enum { + kEfiReservedMemoryType = 0, + kEfiLoaderCode = 1, + kEfiLoaderData = 2, + kEfiBootServicesCode = 3, + kEfiBootServicesData = 4, + kEfiRuntimeServicesCode = 5, + kEfiRuntimeServicesData = 6, + kEfiConventionalMemory = 7, + kEfiUnusableMemory = 8, + kEfiACPIReclaimMemory = 9, + kEfiACPIMemoryNVS = 10, + kEfiMemoryMappedIO = 11, + kEfiMemoryMappedIOPortSpace = 12, + kEfiPalCode = 13, + kEfiMaxMemoryType = 14 +}; + +/* + * Memory range descriptor. + */ +typedef struct EfiMemoryRange { + uint32_t Type; + uint32_t Pad; + uint64_t PhysicalStart; + uint64_t VirtualStart; + uint64_t NumberOfPages; + uint64_t Attribute; +} EfiMemoryRange; + +#define BOOT_LINE_LENGTH 1024 +#define BOOT_STRING_LEN BOOT_LINE_LENGTH + +/* + * Video information.. + */ + +struct Boot_Video { + uint32_t v_baseAddr; /* Base address of video memory */ + uint32_t v_display; /* Display Code (if Applicable */ + uint32_t v_rowBytes; /* Number of bytes per pixel row */ + uint32_t v_width; /* Width */ + uint32_t v_height; /* Height */ + uint32_t v_depth; /* Pixel Depth */ +}; + +typedef struct Boot_Video Boot_Video; + +/* Values for v_display */ + +#define GRAPHICS_MODE 1 +#define FB_TEXT_MODE 2 + +/* Boot argument structure - passed into Mach kernel at boot time. + * "Revision" can be incremented for compatible changes + */ +// Lion +#define kBootArgsRevision 0 +#define kBootArgsVersion 2 + +// Snow Leopard and older +#define kBootArgsPreLionRevision 6 +#define kBootArgsPreLionVersion 1 + +/* Snapshot constants of previous revisions that are supported */ + +#define kBootArgsEfiMode32 32 +#define kBootArgsEfiMode64 64 + +typedef struct boot_args { + uint16_t Revision; /* Revision of boot_args structure */ + uint16_t Version; /* Version of boot_args structure */ + + uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ + uint8_t debugMode; /* Bit field with behavior changes */ + uint8_t __reserved1[2]; + + char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */ + + uint32_t MemoryMap; /* Physical address of memory map */ + uint32_t MemoryMapSize; + uint32_t MemoryMapDescriptorSize; + uint32_t MemoryMapDescriptorVersion; + + Boot_Video Video; /* Video Information */ + + uint32_t deviceTreeP; /* Physical address of flattened device tree */ + uint32_t deviceTreeLength; /* Length of flattened tree */ + + uint32_t kaddr; /* Physical address of beginning of kernel text */ + uint32_t ksize; /* Size of combined kernel text+data+efi */ + + uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */ + uint32_t efiRuntimeServicesPageCount; + uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ + + uint32_t efiSystemTable; /* physical address of system table in runtime area */ + uint32_t __reserved2; + + uint32_t performanceDataStart; /* physical address of log */ + uint32_t performanceDataSize; + + uint32_t keyStoreDataStart; /* physical address of key store data */ + uint32_t keyStoreDataSize; + uint64_t bootMemStart; + uint64_t bootMemSize; + uint64_t PhysicalMemorySize; + uint64_t FSBFrequency; + uint32_t __reserved4[734]; + +} boot_args; + +typedef struct boot_args_pre_lion { + uint16_t Revision; /* Revision of boot_args structure */ + uint16_t Version; /* Version of boot_args structure */ + + char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */ + + uint32_t MemoryMap; /* Physical address of memory map */ + uint32_t MemoryMapSize; + uint32_t MemoryMapDescriptorSize; + uint32_t MemoryMapDescriptorVersion; + + Boot_Video Video; /* Video Information */ + + uint32_t deviceTreeP; /* Physical address of flattened device tree */ + uint32_t deviceTreeLength; /* Length of flattened tree */ + + uint32_t kaddr; /* Physical address of beginning of kernel text */ + uint32_t ksize; /* Size of combined kernel text+data+efi */ + + uint32_t efiRuntimeServicesPageStart; /* physical address of defragmented runtime pages */ + uint32_t efiRuntimeServicesPageCount; + uint32_t efiSystemTable; /* physical address of system table in runtime area */ + + uint8_t efiMode; /* 32 = 32-bit, 64 = 64-bit */ + uint8_t __reserved1[3]; + uint32_t __reserved2[1]; + uint32_t performanceDataStart; /* physical address of log */ + uint32_t performanceDataSize; + uint64_t efiRuntimeServicesVirtualPageStart; /* virtual address of defragmented runtime pages */ + uint32_t __reserved3[2]; + +} boot_args_pre_lion; + +extern char gMacOSVersion[8]; + +#endif /* _PEXPERT_I386_BOOT_H */ diff --git a/i386/libsaio/bootstruct.c b/i386/libsaio/bootstruct.c new file mode 100644 index 0000000..f287806 --- /dev/null +++ b/i386/libsaio/bootstruct.c @@ -0,0 +1,214 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" +#include "bootstruct.h" + +/*========================================================================== + * Initialize the structure of parameters passed to + * the kernel by the booter. + */ + +boot_args *bootArgs; +boot_args_pre_lion *bootArgsPreLion; +PrivateBootInfo_t *bootInfo; +Node *gMemoryMapNode; + +static char platformName[64]; + +void initKernBootStruct( void ) +{ + Node *node; + int nameLen; + static int init_done = 0; + + if ( !init_done ) + { + bootArgs = (boot_args *)malloc(sizeof(boot_args)); + bootArgsPreLion = (boot_args_pre_lion *)malloc(sizeof(boot_args_pre_lion)); + bootInfo = (PrivateBootInfo_t *)malloc(sizeof(PrivateBootInfo_t)); + if (bootArgs == 0 || bootInfo == 0) + stop("Couldn't allocate boot info\n"); + + bzero(bootArgs, sizeof(boot_args)); + bzero(bootArgsPreLion, sizeof(boot_args_pre_lion)); + bzero(bootInfo, sizeof(PrivateBootInfo_t)); + + // Get system memory map. Also update the size of the + // conventional/extended memory for backwards compatibility. + + bootInfo->memoryMapCount = + getMemoryMap( bootInfo->memoryMap, kMemoryMapCountMax, + (unsigned long *) &bootInfo->convmem, + (unsigned long *) &bootInfo->extmem ); + + if ( bootInfo->memoryMapCount == 0 ) + { + // BIOS did not provide a memory map, systems with + // discontiguous memory or unusual memory hole locations + // may have problems. + + bootInfo->convmem = getConventionalMemorySize(); + bootInfo->extmem = getExtendedMemorySize(); + } + + bootInfo->configEnd = bootInfo->config; + bootArgs->Video.v_display = VGA_TEXT_MODE; + + DT__Initialize(); + + node = DT__FindNode("/", true); + if (node == 0) { + stop("Couldn't create root node"); + } + getPlatformName(platformName); + nameLen = strlen(platformName) + 1; + DT__AddProperty(node, "compatible", nameLen, platformName); + DT__AddProperty(node, "model", nameLen, platformName); + + gMemoryMapNode = DT__FindNode("/chosen/memory-map", true); + + bootArgs->Version = kBootArgsVersion; + bootArgs->Revision = kBootArgsRevision; + + bootArgsPreLion->Version = kBootArgsPreLionVersion; + bootArgsPreLion->Revision = kBootArgsPreLionRevision; + + init_done = 1; + } +} + + +/* Copy boot args after kernel and record address. */ + +void +reserveKernBootStruct(void) +{ + if ((gMacOSVersion[0] == '1') && (gMacOSVersion[1] == '0') + && (gMacOSVersion[2] == '.') && (gMacOSVersion[3] == '7' || gMacOSVersion[3] == '8' || gMacOSVersion[3] == '9')) + { + void *oldAddr = bootArgs; + bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args)); + bcopy(oldAddr, bootArgs, sizeof(boot_args)); + } + else + { + void *oldAddr = bootArgsPreLion; + bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion)); + bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion)); + } +} + +void +finalizeBootStruct(void) +{ + uint32_t size; + void *addr; + int i; + EfiMemoryRange *memoryMap; + MemoryRange *range; + int memoryMapCount = bootInfo->memoryMapCount; + + if (memoryMapCount == 0) { + // XXX could make a two-part map here + stop("Unable to convert memory map into proper format\n"); + } + + // convert memory map to boot_args memory map + memoryMap = (EfiMemoryRange *)AllocateKernelMemory(sizeof(EfiMemoryRange) * memoryMapCount); + bootArgs->MemoryMap = (uint32_t)memoryMap; + bootArgs->MemoryMapSize = sizeof(EfiMemoryRange) * memoryMapCount; + bootArgs->MemoryMapDescriptorSize = sizeof(EfiMemoryRange); + bootArgs->MemoryMapDescriptorVersion = 0; + + for (i = 0; i < memoryMapCount; i++, memoryMap++) { + range = &bootInfo->memoryMap[i]; + switch(range->type) { + case kMemoryRangeACPI: + memoryMap->Type = kEfiACPIReclaimMemory; + break; + case kMemoryRangeNVS: + memoryMap->Type = kEfiACPIMemoryNVS; + break; + case kMemoryRangeUsable: + memoryMap->Type = kEfiConventionalMemory; + break; + case kMemoryRangeReserved: + default: + memoryMap->Type = kEfiReservedMemoryType; + break; + } + memoryMap->PhysicalStart = range->base; + memoryMap->VirtualStart = range->base; + memoryMap->NumberOfPages = range->length >> I386_PGSHIFT; + memoryMap->Attribute = 0; + } + + // copy bootFile into device tree + // XXX + + // add PCI info somehow into device tree + // XXX + + // Flatten device tree + DT__FlattenDeviceTree(0, &size); + addr = (void *)AllocateKernelMemory(size); + if (addr == 0) { + stop("Couldn't allocate device tree\n"); + } + + DT__FlattenDeviceTree((void **)&addr, &size); + bootArgs->deviceTreeP = (uint32_t)addr; + bootArgs->deviceTreeLength = size; + + // Copy BootArgs values to older structure + + memcpy(&bootArgsPreLion->CommandLine, &bootArgs->CommandLine, BOOT_LINE_LENGTH); + memcpy(&bootArgsPreLion->Video, &bootArgs->Video, sizeof(Boot_Video)); + + bootArgsPreLion->MemoryMap = bootArgs->MemoryMap; + bootArgsPreLion->MemoryMapSize = bootArgs->MemoryMapSize; + bootArgsPreLion->MemoryMapDescriptorSize = bootArgs->MemoryMapDescriptorSize; + bootArgsPreLion->MemoryMapDescriptorVersion = bootArgs->MemoryMapDescriptorVersion; + + bootArgsPreLion->deviceTreeP = bootArgs->deviceTreeP; + bootArgsPreLion->deviceTreeLength = bootArgs->deviceTreeLength; + + bootArgsPreLion->kaddr = bootArgs->kaddr; + bootArgsPreLion->ksize = bootArgs->ksize; + + bootArgsPreLion->efiRuntimeServicesPageStart = bootArgs->efiRuntimeServicesPageStart; + bootArgsPreLion->efiRuntimeServicesPageCount = bootArgs->efiRuntimeServicesPageCount; + bootArgsPreLion->efiSystemTable = bootArgs->efiSystemTable; + + bootArgsPreLion->efiMode = bootArgs->efiMode; + + bootArgsPreLion->performanceDataStart = bootArgs->performanceDataStart; + bootArgsPreLion->performanceDataSize = bootArgs->performanceDataSize; + bootArgsPreLion->efiRuntimeServicesVirtualPageStart = bootArgs->efiRuntimeServicesVirtualPageStart; +} diff --git a/i386/libsaio/bootstruct.h b/i386/libsaio/bootstruct.h new file mode 100644 index 0000000..f99d7fc --- /dev/null +++ b/i386/libsaio/bootstruct.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2002-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __BOOTSTRUCT_H +#define __BOOTSTRUCT_H + +#include "bootargs.h" +#include "saio_types.h" +#include "bios.h" +#include "device_tree.h" + +/*! + Kernel boot args global also used by booter for its own data. + */ +extern boot_args *bootArgs; +extern boot_args_pre_lion *bootArgsPreLion; +extern Node *gMemoryMapNode; + +#define VGA_TEXT_MODE 0 +//defined in /usr/../boot.h + +//#define GRAPHICS_MODE 1 +//#define FB_TEXT_MODE 2 + + + +/* + * Maximum number of boot drivers that can be loaded. + */ +#define NDRIVERS 500 + +#define CONFIG_SIZE (40 * 4096) + +#define kMemoryMapCountMax 1000 + +/* + * PCI bus information. + */ +typedef struct _PCI_bus_info_t { + union { + struct { + unsigned char configMethod1 :1; + unsigned char configMethod2 :1; + unsigned char :2; + unsigned char specialCycle1 :1; + unsigned char specialCycle2 :1; + } s; + unsigned char d; + } u_bus; + unsigned char maxBusNum; + unsigned char majorVersion; + unsigned char minorVersion; + unsigned char BIOSPresent; +} PCI_bus_info_t; + +typedef struct { + unsigned long address; // address where driver was loaded + unsigned long size; // number of bytes + unsigned long type; // driver type +} driver_config_t; + +/* + * INT15, E820h - Query System Address Map. + * + * Documented in ACPI Specification Rev 2.0, + * Chapter 15 (System Address Map Interfaces). + */ + +/* + * ACPI defined memory range types. + */ +enum { + kMemoryRangeUsable = 1, // RAM usable by the OS. + kMemoryRangeReserved = 2, // Reserved. (Do not use) + kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed. + kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use) + + /* Undefined types should be treated as kMemoryRangeReserved */ +}; + +/*! + PrivateBootInfo has fields used by the booter that used to be part of + KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure + completely changed to boot_args *bootArgs. This (new to boot-132) structure + contains the fields the kernel no longer cares about but the booter still + uses internally. Some fields (e.g. the video information) remain interesting + to the kernel and are thus located in bootArgs although with different field names. + */ +typedef struct PrivateBootInfo { + int convmem; // conventional memory + int extmem; // extended memory +#if 0 + int numBootDrivers; // number of drivers loaded +#endif + char bootFile[128]; // kernel file name + + unsigned long memoryMapCount; + MemoryRange memoryMap[kMemoryMapCountMax]; + + PCI_bus_info_t pciInfo; + +#if 0 + driver_config_t driverConfig[NDRIVERS]; +#endif + char * configEnd; // pointer to end of config files + char config[CONFIG_SIZE]; + + config_file_t bootConfig; // com.apple.Boot.plist + config_file_t chameleonConfig; // org.chameleon.Boot.plist which can override bootConfig keys + config_file_t themeConfig; // theme.plist + config_file_t smbiosConfig; // smbios.plist + config_file_t helperConfig; // boot helper partition's boot.plist + config_file_t ramdiskConfig; // RAMDisk.plist + + bool memDetect; +} PrivateBootInfo_t; + +extern PrivateBootInfo_t *bootInfo; + +#endif /* __BOOTSTRUCT_H */ diff --git a/i386/libsaio/cache.c b/i386/libsaio/cache.c new file mode 100644 index 0000000..9d70e86 --- /dev/null +++ b/i386/libsaio/cache.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * cache.c - A simple cache for file systems meta-data. + * + * Copyright (c) 2000 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include <sl.h> +// #include <fs.h> + +struct CacheEntry { + CICell ih; + long time; + long long offset; +}; +typedef struct CacheEntry CacheEntry; + +#define kCacheSize (0x100000) +#define kCacheMinBlockSize (0x200) +#define kCacheMaxBlockSize (0x8000) +#define kCacheMaxEntries (kCacheSize / kCacheMinBlockSize) + +static CICell gCacheIH; +static long gCacheBlockSize; +static long gCacheNumEntries; +static long gCacheTime; + +#ifdef __i386__ +static CacheEntry *gCacheEntries; +static char *gCacheBuffer; +#else +static CacheEntry gCacheEntries[kCacheMaxEntries]; +static char gCacheBuffer[kCacheSize]; +#endif + +#if CACHE_STATS +unsigned long gCacheHits; +unsigned long gCacheMisses; +unsigned long gCacheEvicts; +#endif + +void CacheReset() +{ + gCacheIH = NULL; +} + +void CacheInit( CICell ih, long blockSize ) +{ +#ifdef __i386__ + if ((ih == gCacheIH) && (blockSize == gCacheBlockSize)) + return; +#endif + + if ((blockSize < kCacheMinBlockSize) || + (blockSize > kCacheMaxBlockSize)) + return; + + gCacheBlockSize = blockSize; + gCacheNumEntries = kCacheSize / gCacheBlockSize; + gCacheTime = 0; + +#if CACHE_STATS + gCacheHits = 0; + gCacheMisses = 0; + gCacheEvicts = 0; +#endif + + gCacheIH = ih; + +#ifdef __i386__ + if (!gCacheBuffer) gCacheBuffer = (char *) malloc(kCacheSize); + if (!gCacheEntries) gCacheEntries = (CacheEntry *) malloc(kCacheMaxEntries * sizeof(CacheEntry)); + if ( !gCacheBuffer || !gCacheEntries ) + { + gCacheIH = 0; // invalidate cache + return; + } +#endif + + bzero(gCacheEntries, kCacheMaxEntries * sizeof(CacheEntry)); +} + +long CacheRead( CICell ih, char * buffer, long long offset, + long length, long cache ) +{ + long cnt, oldestEntry = 0, oldestTime, loadCache = 0; + CacheEntry *entry; + + // See if the data can be cached. + if (cache && (gCacheIH == ih) && (length == gCacheBlockSize)) { + // Look for the data in the cache. + for (cnt = 0; cnt < gCacheNumEntries; cnt++) { + entry = &gCacheEntries[cnt]; + if ((entry->ih == ih) && (entry->offset == offset)) { + entry->time = ++gCacheTime; + break; + } + } + + // If the data was found copy it to the caller. + if (cnt != gCacheNumEntries) { + bcopy(gCacheBuffer + cnt * gCacheBlockSize, buffer, gCacheBlockSize); +#if CACHE_STATS + gCacheHits++; +#endif + return gCacheBlockSize; + } + + // Could not find the data in the cache. + loadCache = 1; + } + + // Read the data from the disk. + Seek(ih, offset); + Read(ih, (long)buffer, length); +#if CACHE_STATS + if (cache) gCacheMisses++; +#endif + + // Put the data from the disk in the cache if needed. + if (loadCache) { + // Find a free entry. + oldestTime = gCacheTime; + for (cnt = 0; cnt < gCacheNumEntries; cnt++) { + entry = &gCacheEntries[cnt]; + + // Found a free entry. + if (entry->ih == 0) break; + + if (entry->time < oldestTime) { + oldestTime = entry->time; + oldestEntry = cnt; + } + } + + // If no free entry was found, use the oldest. + if (cnt == gCacheNumEntries) { + cnt = oldestEntry; +#if CACHE_STATS + gCacheEvicts++; +#endif + } + + // Copy the data from disk to the new entry. + entry = &gCacheEntries[cnt]; + entry->ih = ih; + entry->time = ++gCacheTime; + entry->offset = offset; + bcopy(buffer, gCacheBuffer + cnt * gCacheBlockSize, gCacheBlockSize); + } + + return length; +} diff --git a/i386/libsaio/console.c b/i386/libsaio/console.c new file mode 100644 index 0000000..f7844c7 --- /dev/null +++ b/i386/libsaio/console.c @@ -0,0 +1,267 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include <vers.h> + +extern int vprf(const char * fmt, va_list ap); + +bool gVerboseMode; +bool gErrors; + +/* + * Azi: Doubled available log size; this seems to fix some hangs and instant reboots caused by + * booting with -f (ignore caches). 96kb are enough to hold full log, booting with -f; even so, + * this depends on how much we "play" at the boot prompt and with what patches we're playing, + * depending on how much they print to the log. + * + * Kabyl: BooterLog + */ +#define BOOTER_LOG_SIZE (128 * 1024) +#define SAFE_LOG_SIZE 134 + +char *msgbuf = 0; +char *cursor = 0; + +struct putc_info //Azi: exists on gui.c & printf.c +{ + char * str; + char * last_str; +}; + +static int +sputc(int c, struct putc_info * pi) //Azi: same as above +{ + if (pi->last_str) + if (pi->str == pi->last_str) + { + *(pi->str) = '\0'; + return 0; + } + *(pi->str)++ = c; + return c; +} + +void initBooterLog(void) +{ + msgbuf = malloc(BOOTER_LOG_SIZE); + bzero(msgbuf, BOOTER_LOG_SIZE); + cursor = msgbuf; + msglog("%s\n", "Chimera " I386BOOT_CHAMELEONVERSION " (svn-r" I386BOOT_CHAMELEONREVISION ")" " [" I386BOOT_BUILDDATE "]"); +} + +void msglog(const char * fmt, ...) +{ + va_list ap; + struct putc_info pi; + + if (!msgbuf) + return; + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) + return; + + va_start(ap, fmt); + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + va_end(ap); + cursor += strlen((char *)cursor); +} + +void setupBooterLog(void) +{ + if (!msgbuf) + return; + + Node *node = DT__FindNode("/", false); + if (node) + DT__AddProperty(node, "boot-log", strlen((char *)msgbuf) + 1, msgbuf); +} +/* Kabyl: !BooterLog */ + +/* + * write one character to console + */ +int putchar(int c) +{ + if ( c == '\t' ) + { + for (c = 0; c < 8; c++) bios_putchar(' '); + return c; + } + + if ( c == '\n' ) + { + bios_putchar('\r'); + } + + bios_putchar(c); + + return c; +} + +int getc() +{ + int c = bgetc(); + + if ((c & 0xff) == 0) + return c; + else + return (c & 0xff); +} + +// Read and echo a character from console. This doesn't echo backspace +// since that screws up higher level handling + +int getchar() +{ + register int c = getc(); + +// if ( c == '\r' ) c = '\n'; + +// if ( c >= ' ' && c < 0x7f) putchar(c); + + return (c); +} + +int printf(const char * fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + prf(fmt, ap, putchar, 0); + else + vprf(fmt, ap); + + { + // Kabyl: BooterLog + struct putc_info pi; + + if (!msgbuf) + return 0; + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) + return 0; + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + cursor += strlen((char *)cursor); + } + + va_end(ap); + return 0; +} + +int verbose(const char * fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (gVerboseMode) + { + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + prf(fmt, ap, putchar, 0); + else + vprf(fmt, ap); + } + + { + // Kabyl: BooterLog + struct putc_info pi; + + if (!msgbuf) + return 0; + + if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE))) + return 0; + pi.str = cursor; + pi.last_str = 0; + prf(fmt, ap, sputc, &pi); + cursor += strlen((char *)cursor); + } + + va_end(ap); + return(0); +} + +int error(const char * fmt, ...) +{ + va_list ap; + gErrors = true; + va_start(ap, fmt); + if (bootArgs->Video.v_display == VGA_TEXT_MODE) + prf(fmt, ap, putchar, 0); + else + vprf(fmt, ap); + va_end(ap); + return(0); +} + +void stop(const char * fmt, ...) +{ + va_list ap; + + printf("\n"); + va_start(ap, fmt); + if (bootArgs->Video.v_display == VGA_TEXT_MODE) { + prf(fmt, ap, putchar, 0); + } else { + vprf(fmt, ap); + } + va_end(ap); + printf("\nThis is a non recoverable error! System HALTED!!!"); + halt(); + while (1); +} + +/** Print a "Press a key to continue..." message and wait for a key press. */ +void pause() +{ + printf("Press a key to continue...\n"); + getchar(); // replace getchar() by pause() were useful. +} diff --git a/i386/libsaio/convert.c b/i386/libsaio/convert.c new file mode 100644 index 0000000..912c4e5 --- /dev/null +++ b/i386/libsaio/convert.c @@ -0,0 +1,153 @@ +/* + * Convert.c + * Implement conversion utility functions + * Create UUID parsing functions and gather other conversion routines + * --Rek + */ + +#include "convert.h" + +/** Transform a 16 bytes hexadecimal value UUID to a string */ +const char * getStringFromUUID(const EFI_CHAR8* eUUID) +{ + static char msg[UUID_LEN*2 + 8] = ""; + if (!eUUID) return ""; + const unsigned char * uuid = (unsigned char*) eUUID; + sprintf(msg, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + uuid[0], uuid[1], uuid[2], uuid[3], + uuid[4], uuid[5], uuid[6], uuid[7], + uuid[8], uuid[9], uuid[10],uuid[11], + uuid[12],uuid[13],uuid[14],uuid[15]); + return msg ; +} + +/** Parse an UUID string into an (EFI_CHAR8*) buffer */ +EFI_CHAR8* getUUIDFromString(const char *source) +{ + if (!source) return 0; + + char *p = (char *)source; + int i; + char buf[3]; + static EFI_CHAR8 uuid[UUID_LEN+1]=""; + + buf[2] = '\0'; + for (i=0; i<UUID_LEN; i++) { + if (p[0] == '\0' || p[1] == '\0' || !isxdigit(p[0]) || !isxdigit(p[1])) { + verbose("[ERROR] UUID='%s' syntax error\n", source); + return 0; + } + buf[0] = *p++; + buf[1] = *p++; + uuid[i] = (unsigned char) strtoul(buf, NULL, 16); + if (*p == '-' && (i % 2) == 1 && i < UUID_LEN - 1) { + p++; + } + } + uuid[UUID_LEN]='\0'; + + if (*p != '\0') { + verbose("[ERROR] UUID='%s' syntax error\n", source); + return 0; + } + return uuid; +} + +/** XXX AsereBLN replace by strtoul */ +uint32_t ascii_hex_to_int(char *buff) +{ + uint32_t value = 0, i, digit; + for(i = 0; i < strlen(buff); i++) + { + if (buff[i] >= 48 && buff[i] <= 57) // '0' through '9' + digit = buff[i] - 48; + else if (buff[i] >= 65 && buff[i] <= 70) // 'A' through 'F' + digit = buff[i] - 55; + else if (buff[i] >= 97 && buff[i] <= 102) // 'a' through 'f' + digit = buff[i] - 87; + else + return value; + + value = digit + 16 * value; + } + return value; +} + +void *convertHexStr2Binary(const char *hexStr, int *outLength) +{ + int len; + char hexNibble; + char hexByte[2]; + uint8_t binChar; + uint8_t *binStr; + int hexStrIdx, binStrIdx, hexNibbleIdx; + + len = strlen(hexStr); + if (len > 1) + { + // the resulting binary will be the half size of the input hex string + binStr = malloc(len / 2); + binStrIdx = 0; + hexNibbleIdx = 0; + for (hexStrIdx = 0; hexStrIdx < len; hexStrIdx++) + { + hexNibble = hexStr[hexStrIdx]; + + // ignore all chars except valid hex numbers + if ( (hexNibble >= '0' && hexNibble <= '9') || + (hexNibble >= 'A' && hexNibble <= 'F') || + (hexNibble >= 'a' && hexNibble <= 'f') ) + { + hexByte[hexNibbleIdx++] = hexNibble; + + // found both two nibbles, convert to binary + if (hexNibbleIdx == 2) + { + binChar = 0; + + for (hexNibbleIdx = 0; hexNibbleIdx < sizeof(hexByte); hexNibbleIdx++) + { + if (hexNibbleIdx > 0) binChar = binChar << 4; + + if (hexByte[hexNibbleIdx] <= '9') binChar += hexByte[hexNibbleIdx] - '0'; + else if (hexByte[hexNibbleIdx] <= 'F') binChar += hexByte[hexNibbleIdx] - ('A' - 10); + else if (hexByte[hexNibbleIdx] <= 'f') binChar += hexByte[hexNibbleIdx] - ('a' - 10); + } + + binStr[binStrIdx++] = binChar; + hexNibbleIdx = 0; + } + } + } + *outLength = binStrIdx; + return binStr; + } + else + { + *outLength = 0; + return NULL; + } +} + +// FIXME: can't use my original code here, +// Ironically, trying to reuse convertHexStr2Binary() would RESET the system! +/* +static EFI_CHAR8* getUUIDFromString2(const char * szInUUID) +{ + char szUUID[UUID_LEN+1], *p=szUUID; + int size=0; + void* ret; + + if (!szInUUID || strlen(szInUUID)<UUID_LEN) return (EFI_CHAR8*) 0; + + while(*szInUUID) if (*szInUUID!='-') *p++=*szInUUID++; else szInUUID++; + *p='\0'; + ret = convertHexStr2Binary(szUUID, &size); + if (!ret || size!=UUID_LEN) + { + verbose("UUID: cannot convert string <%s> to valid UUID.\n", szUUID); + return (EFI_CHAR8*) 0; + } + return (EFI_CHAR8*) ret; // new allocated buffer containing the converted string to bin +} +*/ diff --git a/i386/libsaio/convert.h b/i386/libsaio/convert.h new file mode 100644 index 0000000..c2883ca --- /dev/null +++ b/i386/libsaio/convert.h @@ -0,0 +1,33 @@ +/* + * Convert.h + * Declare conversion utility functions + * --Rek + */ + +#ifndef __CONVERT_H +#define __CONVERT_H +#include "libsaio.h" +#include "efi.h" + +#define UUID_LEN 16 + +const char * getStringFromUUID(const EFI_CHAR8* uuid); +EFI_CHAR8* getUUIDFromString(const char *source); +void *convertHexStr2Binary(const char *hexStr, int *outLength); +uint32_t ascii_hex_to_int(char *buff); + +static inline uint16_t dp_swap16(uint16_t toswap) +{ + return (((toswap & 0x00FF) << 8) | ((toswap & 0xFF00) >> 8)); +} + +static inline uint32_t dp_swap32(uint32_t toswap) +{ + return ((toswap & 0x000000FF) << 24) | + ((toswap & 0x0000FF00) << 8 ) | + ((toswap & 0x00FF0000) >> 8 ) | + ((toswap & 0xFF000000) >> 24); +} + + +#endif diff --git a/i386/libsaio/cpu.c b/i386/libsaio/cpu.c new file mode 100644 index 0000000..717e95d --- /dev/null +++ b/i386/libsaio/cpu.c @@ -0,0 +1,621 @@ +/* + * Copyright 2008 Islam Ahmed Zaid. All rights reserved. <azismed@gmail.com> + * AsereBLN: 2009: cleanup and bugfix + */ + +#include "libsaio.h" +#include "platform.h" +#include "cpu.h" +#include "bootstruct.h" +#include "boot.h" + +#ifndef DEBUG_CPU +#define DEBUG_CPU 0 +#endif + +#if DEBUG_CPU +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +/* + * timeRDTSC() + * This routine sets up PIT counter 2 to count down 1/20 of a second. + * It pauses until the value is latched in the counter + * and then reads the time stamp counter to return to the caller. + */ +uint64_t timeRDTSC(void) +{ + int attempts = 0; + uint64_t latchTime; + uint64_t saveTime,intermediate; + unsigned int timerValue, lastValue; + //boolean_t int_enabled; + /* + * Table of correction factors to account for + * - timer counter quantization errors, and + * - undercounts 0..5 + */ +#define SAMPLE_CLKS_EXACT (((double) CLKNUM) / 20.0) +#define SAMPLE_CLKS_INT ((int) CLKNUM / 20) +#define SAMPLE_NSECS (2000000000LL) +#define SAMPLE_MULTIPLIER (((double)SAMPLE_NSECS)*SAMPLE_CLKS_EXACT) +#define ROUND64(x) ((uint64_t)((x) + 0.5)) + uint64_t scale[6] = { + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-0)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-1)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-2)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-3)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-4)), + ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-5)) + }; + +restart: + if (attempts >= 9) // increase to up to 9 attempts. + // This will flash-reboot. TODO: Use tscPanic instead. + printf("Timestamp counter calibation failed with %d attempts\n", attempts); + attempts++; + enable_PIT2(); // turn on PIT2 + set_PIT2(0); // reset timer 2 to be zero + latchTime = rdtsc64(); // get the time stamp to time + latchTime = get_PIT2(&timerValue) - latchTime; // time how long this takes + set_PIT2(SAMPLE_CLKS_INT); // set up the timer for (almost) 1/20th a second + saveTime = rdtsc64(); // now time how long a 20th a second is... + get_PIT2(&lastValue); + get_PIT2(&lastValue); // read twice, first value may be unreliable + do { + intermediate = get_PIT2(&timerValue); + if (timerValue > lastValue) { + // Timer wrapped + set_PIT2(0); + disable_PIT2(); + goto restart; + } + lastValue = timerValue; + } while (timerValue > 5); + printf("timerValue %d\n",timerValue); + printf("intermediate 0x%016llx\n",intermediate); + printf("saveTime 0x%016llx\n",saveTime); + + intermediate -= saveTime; // raw count for about 1/20 second + intermediate *= scale[timerValue]; // rescale measured time spent + intermediate /= SAMPLE_NSECS; // so its exactly 1/20 a second + intermediate += latchTime; // add on our save fudge + + set_PIT2(0); // reset timer 2 to be zero + disable_PIT2(); // turn off PIT 2 + + return intermediate; +} + +/* + * DFE: Measures the TSC frequency in Hz (64-bit) using the ACPI PM timer + */ +static uint64_t measure_tsc_frequency(void) +{ + uint64_t tscStart; + uint64_t tscEnd; + uint64_t tscDelta = 0xffffffffffffffffULL; + unsigned long pollCount; + uint64_t retval = 0; + int i; + + /* Time how many TSC ticks elapse in 30 msec using the 8254 PIT + * counter 2. We run this loop 3 times to make sure the cache + * is hot and we take the minimum delta from all of the runs. + * That is to say that we're biased towards measuring the minimum + * number of TSC ticks that occur while waiting for the timer to + * expire. That theoretically helps avoid inconsistencies when + * running under a VM if the TSC is not virtualized and the host + * steals time. The TSC is normally virtualized for VMware. + */ + for(i = 0; i < 10; ++i) + { + enable_PIT2(); + set_PIT2_mode0(CALIBRATE_LATCH); + tscStart = rdtsc64(); + pollCount = poll_PIT2_gate(); + tscEnd = rdtsc64(); + /* The poll loop must have run at least a few times for accuracy */ + if (pollCount <= 1) + continue; + /* The TSC must increment at LEAST once every millisecond. + * We should have waited exactly 30 msec so the TSC delta should + * be >= 30. Anything less and the processor is way too slow. + */ + if ((tscEnd - tscStart) <= CALIBRATE_TIME_MSEC) + continue; + // tscDelta = MIN(tscDelta, (tscEnd - tscStart)) + if ( (tscEnd - tscStart) < tscDelta ) + tscDelta = tscEnd - tscStart; + } + /* tscDelta is now the least number of TSC ticks the processor made in + * a timespan of 0.03 s (e.g. 30 milliseconds) + * Linux thus divides by 30 which gives the answer in kiloHertz because + * 1 / ms = kHz. But we're xnu and most of the rest of the code uses + * Hz so we need to convert our milliseconds to seconds. Since we're + * dividing by the milliseconds, we simply multiply by 1000. + */ + + /* Unlike linux, we're not limited to 32-bit, but we do need to take care + * that we're going to multiply by 1000 first so we do need at least some + * arithmetic headroom. For now, 32-bit should be enough. + * Also unlike Linux, our compiler can do 64-bit integer arithmetic. + */ + if (tscDelta > (1ULL<<32)) + retval = 0; + else + { + retval = tscDelta * 1000 / 30; + } + disable_PIT2(); + return retval; +} + +/* + * Original comment/code: + * "DFE: Measures the Max Performance Frequency in Hz (64-bit)" + * + * Measures the Actual Performance Frequency in Hz (64-bit) + * (just a naming change, mperf --> aperf ) + */ +static uint64_t measure_aperf_frequency(void) +{ + uint64_t aperfStart; + uint64_t aperfEnd; + uint64_t aperfDelta = 0xffffffffffffffffULL; + unsigned long pollCount; + uint64_t retval = 0; + int i; + + /* Time how many APERF ticks elapse in 30 msec using the 8254 PIT + * counter 2. We run this loop 3 times to make sure the cache + * is hot and we take the minimum delta from all of the runs. + * That is to say that we're biased towards measuring the minimum + * number of APERF ticks that occur while waiting for the timer to + * expire. + */ + for(i = 0; i < 10; ++i) + { + enable_PIT2(); + set_PIT2_mode0(CALIBRATE_LATCH); + aperfStart = rdmsr64(MSR_AMD_APERF); + pollCount = poll_PIT2_gate(); + aperfEnd = rdmsr64(MSR_AMD_APERF); + /* The poll loop must have run at least a few times for accuracy */ + if (pollCount <= 1) + continue; + /* The TSC must increment at LEAST once every millisecond. + * We should have waited exactly 30 msec so the APERF delta should + * be >= 30. Anything less and the processor is way too slow. + */ + if ((aperfEnd - aperfStart) <= CALIBRATE_TIME_MSEC) + continue; + // tscDelta = MIN(tscDelta, (tscEnd - tscStart)) + if ( (aperfEnd - aperfStart) < aperfDelta ) + aperfDelta = aperfEnd - aperfStart; + } + /* mperfDelta is now the least number of MPERF ticks the processor made in + * a timespan of 0.03 s (e.g. 30 milliseconds) + */ + + if (aperfDelta > (1ULL<<32)) + retval = 0; + else + { + retval = aperfDelta * 1000 / 30; + } + disable_PIT2(); + return retval; +} + +/* + * Calculates the FSB and CPU frequencies using specific MSRs for each CPU + * - multi. is read from a specific MSR. In the case of Intel, there is: + * a max multi. (used to calculate the FSB freq.), + * and a current multi. (used to calculate the CPU freq.) + * - fsbFrequency = tscFrequency / multi + * - cpuFrequency = fsbFrequency * multi + */ +void scan_cpu(PlatformInfo_t *p) +{ + uint64_t tscFrequency = 0; + uint64_t fsbFrequency = 0; + uint64_t cpuFrequency =0; + uint64_t msr = 0; + uint64_t flex_ratio = 0; + uint32_t max_ratio = 0; + uint32_t min_ratio = 0; + uint8_t bus_ratio_max = 0; + uint8_t bus_ratio_min = 0; + uint8_t currdiv = 0; + uint8_t currcoef = 0; + uint8_t maxdiv = 0; + uint8_t maxcoef = 0; + + const char *newratio; + int len = 0; + + /* get cpuid values */ + do_cpuid(0x00000000, p->CPU.CPUID[CPUID_0]); + do_cpuid(0x00000001, p->CPU.CPUID[CPUID_1]); + do_cpuid(0x00000002, p->CPU.CPUID[CPUID_2]); + do_cpuid(0x00000003, p->CPU.CPUID[CPUID_3]); + do_cpuid2(0x00000004, 0, p->CPU.CPUID[CPUID_4]); + do_cpuid(0x80000000, p->CPU.CPUID[CPUID_80]); + if (p->CPU.CPUID[CPUID_0][0] >= 0x5) { + do_cpuid(5, p->CPU.CPUID[CPUID_5]); + } + if (p->CPU.CPUID[CPUID_0][0] >= 6) { + do_cpuid(6, p->CPU.CPUID[CPUID_6]); + } + if ((p->CPU.CPUID[CPUID_80][0] & 0x0000000f) >= 8) { + do_cpuid(0x80000008, p->CPU.CPUID[CPUID_88]); + do_cpuid(0x80000001, p->CPU.CPUID[CPUID_81]); + } + else if ((p->CPU.CPUID[CPUID_80][0] & 0x0000000f) >= 1) { + do_cpuid(0x80000001, p->CPU.CPUID[CPUID_81]); + } + +#if DEBUG_CPU + { + int i; + printf("CPUID Raw Values:\n"); + for (i=0; i<CPUID_MAX; i++) { + printf("%02d: %08x-%08x-%08x-%08x\n", i, + p->CPU.CPUID[i][0], p->CPU.CPUID[i][1], + p->CPU.CPUID[i][2], p->CPU.CPUID[i][3]); + } + } +#endif + + p->CPU.Vendor = p->CPU.CPUID[CPUID_0][1]; + p->CPU.Signature = p->CPU.CPUID[CPUID_1][0]; + p->CPU.Stepping = bitfield(p->CPU.CPUID[CPUID_1][0], 3, 0); + p->CPU.Model = bitfield(p->CPU.CPUID[CPUID_1][0], 7, 4); + p->CPU.Family = bitfield(p->CPU.CPUID[CPUID_1][0], 11, 8); + p->CPU.ExtModel = bitfield(p->CPU.CPUID[CPUID_1][0], 19, 16); + p->CPU.ExtFamily = bitfield(p->CPU.CPUID[CPUID_1][0], 27, 20); + + p->CPU.Model += (p->CPU.ExtModel << 4); + + if (p->CPU.Vendor == CPUID_VENDOR_INTEL && + p->CPU.Family == 0x06 && + p->CPU.Model >= CPU_MODEL_NEHALEM && + p->CPU.Model != CPU_MODEL_ATOM // MSR is *NOT* available on the Intel Atom CPU + ) + { + msr = rdmsr64(MSR_CORE_THREAD_COUNT); // Undocumented MSR in Nehalem and newer CPUs + p->CPU.NoCores = bitfield((uint32_t)msr, 31, 16); // Using undocumented MSR to get actual values + p->CPU.NoThreads = bitfield((uint32_t)msr, 15, 0); // Using undocumented MSR to get actual values + } + else if (p->CPU.Vendor == CPUID_VENDOR_AMD) + { + p->CPU.NoThreads = bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16); + p->CPU.NoCores = bitfield(p->CPU.CPUID[CPUID_88][2], 7, 0) + 1; + } + else + { + // Use previous method for Cores and Threads + p->CPU.NoThreads = bitfield(p->CPU.CPUID[CPUID_1][1], 23, 16); + p->CPU.NoCores = bitfield(p->CPU.CPUID[CPUID_4][0], 31, 26) + 1; + } + + /* get brand string (if supported) */ + /* Copyright: from Apple's XNU cpuid.c */ + if (p->CPU.CPUID[CPUID_80][0] > 0x80000004) { + uint32_t reg[4]; + char str[128], *s; + /* + * The brand string 48 bytes (max), guaranteed to + * be NULL terminated. + */ + do_cpuid(0x80000002, reg); + bcopy((char *)reg, &str[0], 16); + do_cpuid(0x80000003, reg); + bcopy((char *)reg, &str[16], 16); + do_cpuid(0x80000004, reg); + bcopy((char *)reg, &str[32], 16); + for (s = str; *s != '\0'; s++) { + if (*s != ' ') break; + } + + strlcpy(p->CPU.BrandString, s, sizeof(p->CPU.BrandString)); + + if (!strncmp(p->CPU.BrandString, CPU_STRING_UNKNOWN, MIN(sizeof(p->CPU.BrandString), strlen(CPU_STRING_UNKNOWN) + 1))) { + /* + * This string means we have a firmware-programmable brand string, + * and the firmware couldn't figure out what sort of CPU we have. + */ + p->CPU.BrandString[0] = '\0'; + } + } + + /* setup features */ + if ((bit(23) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_MMX; + } + if ((bit(25) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE; + } + if ((bit(26) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE2; + } + if ((bit(0) & p->CPU.CPUID[CPUID_1][2]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE3; + } + if ((bit(19) & p->CPU.CPUID[CPUID_1][2]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE41; + } + if ((bit(20) & p->CPU.CPUID[CPUID_1][2]) != 0) { + p->CPU.Features |= CPU_FEATURE_SSE42; + } + if ((bit(29) & p->CPU.CPUID[CPUID_81][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_EM64T; + } + if ((bit(5) & p->CPU.CPUID[CPUID_1][3]) != 0) { + p->CPU.Features |= CPU_FEATURE_MSR; + } + //if ((bit(28) & p->CPU.CPUID[CPUID_1][3]) != 0) { + if (p->CPU.NoThreads > p->CPU.NoCores) { + p->CPU.Features |= CPU_FEATURE_HTT; + } + + tscFrequency = measure_tsc_frequency(); +// /* if usual method failed */ +// if ( tscFrequency < 1000 ) +// { +// tscFrequency = timeRDTSC() * 20; +// } +// fsbFrequency = 0; +// cpuFrequency = 0; + + if ((p->CPU.Vendor == CPUID_VENDOR_INTEL) && ((p->CPU.Family == 0x06) || (p->CPU.Family == 0x0f))) { + int intelCPU = p->CPU.Model; + if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0c) || (p->CPU.Family == 0x0f && p->CPU.Model >= 0x03)) { + /* Nehalem CPU model */ + if (p->CPU.Family == 0x06 && (p->CPU.Model == CPU_MODEL_NEHALEM || + p->CPU.Model == CPU_MODEL_FIELDS || + p->CPU.Model == CPU_MODEL_DALES || + p->CPU.Model == CPU_MODEL_DALES_32NM || + p->CPU.Model == CPU_MODEL_WESTMERE || + p->CPU.Model == CPU_MODEL_NEHALEM_EX || + p->CPU.Model == CPU_MODEL_WESTMERE_EX || + p->CPU.Model == CPU_MODEL_SANDYBRIDGE || + p->CPU.Model == CPU_MODEL_JAKETOWN || + p->CPU.Model == CPU_MODEL_IVYBRIDGE || + p->CPU.Model == CPU_MODEL_HASWELL )){ + msr = rdmsr64(MSR_PLATFORM_INFO); +// DBG("msr(%d): platform_info %08x\n", __LINE__, bitfield(msr, 31, 0)); + bus_ratio_max = bitfield(msr, 15, 8); //MacMan: Changed bitfield to match Apple tsc.c + bus_ratio_min = bitfield(msr, 47, 40); //MacMan: Changed bitfield to match Apple tsc.c + msr = rdmsr64(MSR_FLEX_RATIO); +// DBG("msr(%d): flex_ratio %08x\n", __LINE__, bitfield(msr, 31, 0)); + if (bitfield(msr, 16, 16)) { + flex_ratio = bitfield(msr, 15, 8); //MacMan: Changed bitfield to match Apple tsc.c + if (flex_ratio == 0) { + /* Clear bit 16 (evidently the presence bit) */ + wrmsr64(MSR_FLEX_RATIO, (msr & 0xFFFFFFFFFFFEFFFFULL)); + msr = rdmsr64(MSR_FLEX_RATIO); +// verbose("Unusable flex ratio detected. Patched MSR now %08x\n", bitfield(msr, 31, 0)); + } else { + if (bus_ratio_max > flex_ratio) { + bus_ratio_max = flex_ratio; + } + } + } + + if (bus_ratio_max) { + fsbFrequency = (tscFrequency / bus_ratio_max); + } + //MacMan: Turbo Ratio Limit + switch (intelCPU) + { + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65xx + { + cpuFrequency = tscFrequency; + DBG("cpu.c (%d)CPU_MODEL_NEHALEM_EX or CPU_MODEL_WESTMERE_EX Found\n", __LINE__); + break; + } + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1050 (22nm) + { + msr = rdmsr64(MSR_IA32_PERF_STATUS); + currcoef = bitfield(msr, 15, 8); + cpuFrequency = currcoef * fsbFrequency; + maxcoef = bus_ratio_max; + break; + } + default: + { + msr = rdmsr64(MSR_IA32_PERF_STATUS); + currcoef = bitfield(msr, 7, 0); + cpuFrequency = currcoef * fsbFrequency; + maxcoef = bus_ratio_max; + break; + } + } + + if ((getValueForKey(kbusratio, &newratio, &len, &bootInfo->chameleonConfig)) && (len <= 4)) { + max_ratio = atoi(newratio); + max_ratio = (max_ratio * 10); + if (len >= 3) max_ratio = (max_ratio + 5); + + verbose("Bus-Ratio: min=%d, max=%s\n", bus_ratio_min, newratio); + + // extreme overclockers may love 320 ;) + if ((max_ratio >= min_ratio) && (max_ratio <= 320)) { + cpuFrequency = (fsbFrequency * max_ratio) / 10; + if (len >= 3) maxdiv = 1; + else maxdiv = 0; + } else { + max_ratio = (bus_ratio_max * 10); + } + } + p->CPU.MaxRatio = bus_ratio_max; + p->CPU.MinRatio = bus_ratio_min; + } else { + msr = rdmsr64(MSR_IA32_PERF_STATUS); + DBG("msr(%d): ia32_perf_stat 0x%08x\n", __LINE__, bitfield(msr, 31, 0)); + currcoef = bitfield(msr, 12, 8); + /* Non-integer bus ratio for the max-multi*/ + maxdiv = bitfield(msr, 46, 46); + /* Non-integer bus ratio for the current-multi (undocumented)*/ + currdiv = bitfield(msr, 14, 14); + + // This will always be model >= 3 + if ((p->CPU.Family == 0x06 && p->CPU.Model >= 0x0e) || (p->CPU.Family == 0x0f)) + { + /* On these models, maxcoef defines TSC freq */ + maxcoef = bitfield(msr, 44, 40); + } else { + /* On lower models, currcoef defines TSC freq */ + /* XXX */ + maxcoef = currcoef; + } + + if (maxcoef) { + if (maxdiv) { + fsbFrequency = ((tscFrequency * 2) / ((maxcoef * 2) + 1)); + } else { + fsbFrequency = (tscFrequency / maxcoef); + } + if (currdiv) { + cpuFrequency = (fsbFrequency * ((currcoef * 2) + 1) / 2); + } else { + cpuFrequency = (fsbFrequency * currcoef); + } + DBG("max: %d%s current: %d%s\n", maxcoef, maxdiv ? ".5" : "",currcoef, currdiv ? ".5" : ""); + } + } + } + /* Mobile CPU */ + if (rdmsr64(MSR_IA32_PLATFORM_ID) & (1<<28)) { + p->CPU.Features |= CPU_FEATURE_MOBILE; + } + } + else if ((p->CPU.Vendor == CPUID_VENDOR_AMD) && (p->CPU.Family == 0x0f)) + { + switch(p->CPU.ExtFamily) + { + case 0x00: /* K8 */ + msr = rdmsr64(K8_FIDVID_STATUS); + maxcoef = bitfield(msr, 21, 16) / 2 + 4; + currcoef = bitfield(msr, 5, 0) / 2 + 4; + break; + + case 0x01: /* K10 */ + msr = rdmsr64(K10_COFVID_STATUS); + do_cpuid2(0x00000006, 0, p->CPU.CPUID[CPUID_6]); + // EffFreq: effective frequency interface + if (bitfield(p->CPU.CPUID[CPUID_6][2], 0, 0) == 1) + { + //uint64_t mperf = measure_mperf_frequency(); + uint64_t aperf = measure_aperf_frequency(); + cpuFrequency = aperf; + } + // NOTE: tsc runs at the maccoeff (non turbo) + // *not* at the turbo frequency. + maxcoef = bitfield(msr, 54, 49) / 2 + 4; + currcoef = bitfield(msr, 5, 0) + 0x10; + currdiv = 2 << bitfield(msr, 8, 6); + + break; + + case 0x05: /* K14 */ + msr = rdmsr64(K10_COFVID_STATUS); + currcoef = (bitfield(msr, 54, 49) + 0x10) << 2; + currdiv = (bitfield(msr, 8, 4) + 1) << 2; + currdiv += bitfield(msr, 3, 0); + + break; + + case 0x02: /* K11 */ + // not implimented + break; + } + + if (maxcoef) + { + if (currdiv) + { + if (!currcoef) currcoef = maxcoef; + if (!cpuFrequency) + fsbFrequency = ((tscFrequency * currdiv) / currcoef); + else + fsbFrequency = ((cpuFrequency * currdiv) / currcoef); + + DBG("%d.%d\n", currcoef / currdiv, ((currcoef % currdiv) * 100) / currdiv); + } else { + if (!cpuFrequency) + fsbFrequency = (tscFrequency / maxcoef); + else + fsbFrequency = (cpuFrequency / maxcoef); + DBG("%d\n", currcoef); + } + } + else if (currcoef) + { + if (currdiv) + { + fsbFrequency = ((tscFrequency * currdiv) / currcoef); + DBG("%d.%d\n", currcoef / currdiv, ((currcoef % currdiv) * 100) / currdiv); + } else { + fsbFrequency = (tscFrequency / currcoef); + DBG("%d\n", currcoef); + } + } + if (!cpuFrequency) cpuFrequency = tscFrequency; + } + +#if 0 + if (!fsbFrequency) { + fsbFrequency = (DEFAULT_FSB * 1000); + cpuFrequency = tscFrequency; + DBG("0 ! using the default value for FSB !\n"); + } +#endif + + p->CPU.MaxCoef = maxcoef; + if (maxdiv == 0){ + p->CPU.MaxDiv = bus_ratio_max; + } + else { + p->CPU.MaxDiv = maxdiv; + } + p->CPU.CurrCoef = currcoef; + if (currdiv == 0){ + p->CPU.CurrDiv = currcoef; + } + else { + p->CPU.CurrDiv = currdiv; + } + p->CPU.TSCFrequency = tscFrequency; + p->CPU.FSBFrequency = fsbFrequency; + p->CPU.CPUFrequency = cpuFrequency; + + // keep formatted with spaces instead of tabs + DBG("CPU: Brand String: %s\n", p->CPU.BrandString); + DBG("CPU: Vendor: 0x%x\n", p->CPU.Vendor); + DBG("CPU: Family / ExtFamily: 0x%x / 0x%x\n", p->CPU.Family, p->CPU.ExtFamily); + DBG("CPU: Model / ExtModel / Stepping: 0x%x / 0x%x / 0x%x\n", p->CPU.Model, p->CPU.ExtModel, p->CPU.Stepping); + DBG("CPU: Number of Cores / Threads: %d / %d\n", p->CPU.NoCores, p->CPU.NoThreads); + DBG("CPU: Features: 0x%08x\n", p->CPU.Features); + DBG("CPU: TSC Frequency: %d MHz\n", p->CPU.TSCFrequency / 1000000); + DBG("CPU: FSB Frequency: %d MHz\n", p->CPU.FSBFrequency / 1000000); + DBG("CPU: CPU Frequency: %d MHz\n", p->CPU.CPUFrequency / 1000000); + DBG("CPU: Minimum Bus Ratio: %d\n", p->CPU.MinRatio); + DBG("CPU: Maximum Bus Ratio: %d\n", p->CPU.MaxRatio); + DBG("CPU: Current Bus Ratio: %d\n", p->CPU.CurrCoef); +// DBG("CPU: Maximum Multiplier: %d\n", p->CPU.MaxCoef); +// DBG("CPU: Maximum Divider: %d\n", p->CPU.MaxDiv); +// DBG("CPU: Current Divider: %d\n", p->CPU.CurrDiv); + +#if DEBUG_CPU + pause(); +#endif +} diff --git a/i386/libsaio/cpu.h b/i386/libsaio/cpu.h new file mode 100644 index 0000000..0b72454 --- /dev/null +++ b/i386/libsaio/cpu.h @@ -0,0 +1,217 @@ +/* + * Copyright 2008 Islam Ahmed Zaid. All rights reserved. <azismed@gmail.com> + * AsereBLN: 2009: cleanup and bugfix + */ + +#ifndef __LIBSAIO_CPU_H +#define __LIBSAIO_CPU_H + +//#include "libsaio.h" + +extern void scan_cpu(PlatformInfo_t *); + +#define bit(n) (1ULL << (n)) +#define bitmask(h,l) ((bit(h)|(bit(h)-1)) & ~(bit(l)-1)) +#define bitfield(x,h,l) (((x) & bitmask(h,l)) >> l) + +#define CPU_STRING_UNKNOWN "Unknown CPU Type" + +#define MSR_CORE_THREAD_COUNT 0x35 // Undocumented. Nehalem and newer only +#define MSR_FLEX_RATIO 0x194 // Undocumented. +#define MSR_IA32_EXT_CONFIG 0xEE // Undocumented. Core Solo and Core Duo only +#define MSR_PKG_CST_CONFIG_CTL 0xE2 +#define MSR_IA32_PERF_STATUS 0x198 +#define MSR_IA32_PERF_CONTROL 0x199 +#define MSR_IA32_PLATFORM_ID 0x17 +#define MSR_PLATFORM_INFO 0xCE +#define MSR_TURBO_RATIO_LIMIT 0x1AD + +#define K8_FIDVID_STATUS 0xC0010042 +#define K10_COFVID_STATUS 0xC0010071 + +#define MSR_AMD_MPERF 0x000000E7 +#define MSR_AMD_APERF 0x000000E8 + +#define DEFAULT_FSB 100000 /* for now, hardcoding 100MHz for old CPUs */ + +// DFE: This constant comes from older xnu: +#define CLKNUM 1193182 /* formerly 1193167 */ + +// DFE: These two constants come from Linux except CLOCK_TICK_RATE replaced with CLKNUM +#define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ +#define CALIBRATE_LATCH ((CLKNUM * CALIBRATE_TIME_MSEC + 1000/2)/1000) + +static inline uint64_t rdtsc64(void) +{ + uint64_t ret; + __asm__ volatile("rdtsc" : "=A" (ret)); + return ret; +} + +static inline uint64_t rdmsr64(uint32_t msr) +{ + uint64_t ret; + __asm__ volatile("rdmsr" : "=A" (ret) : "c" (msr)); + return ret; +} + +static inline void wrmsr64(uint32_t msr, uint64_t val) +{ + __asm__ volatile("wrmsr" : : "c" (msr), "A" (val)); +} + +static inline void intel_waitforsts(void) { + uint32_t inline_timeout = 100000; + while (rdmsr64(MSR_IA32_PERF_STATUS) & (1 << 21)) { if (!inline_timeout--) break; } +} + +static inline void do_cpuid(uint32_t selector, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a" (selector)); +} + +static inline void do_cpuid2(uint32_t selector, uint32_t selector2, uint32_t *data) +{ + asm volatile ("cpuid" + : "=a" (data[0]), + "=b" (data[1]), + "=c" (data[2]), + "=d" (data[3]) + : "a" (selector), "c" (selector2)); +} + +// DFE: enable_PIT2 and disable_PIT2 come from older xnu + +/* + * Enable or disable timer 2. + * Port 0x61 controls timer 2: + * bit 0 gates the clock, + * bit 1 gates output to speaker. + */ +static inline void enable_PIT2(void) +{ + /* Enable gate, disable speaker */ + __asm__ volatile( + " inb $0x61,%%al \n\t" + " and $0xFC,%%al \n\t" /* & ~0x03 */ + " or $1,%%al \n\t" + " outb %%al,$0x61 \n\t" + : : : "%al" ); +} + +static inline void disable_PIT2(void) +{ + /* Disable gate and output to speaker */ + __asm__ volatile( + " inb $0x61,%%al \n\t" + " and $0xFC,%%al \n\t" /* & ~0x03 */ + " outb %%al,$0x61 \n\t" + : : : "%al" ); +} + +// DFE: set_PIT2_mode0, poll_PIT2_gate, and measure_tsc_frequency are +// roughly based on Linux code + +/* Set the 8254 channel 2 to mode 0 with the specified value. + In mode 0, the counter will initially set its gate low when the + timer expires. For this to be useful, you ought to set it high + before calling this function. The enable_PIT2 function does this. + */ +static inline void set_PIT2_mode0(uint16_t value) +{ + __asm__ volatile( + " movb $0xB0,%%al \n\t" + " outb %%al,$0x43 \n\t" + " movb %%dl,%%al \n\t" + " outb %%al,$0x42 \n\t" + " movb %%dh,%%al \n\t" + " outb %%al,$0x42" + : : "d"(value) /*: no clobber */ ); +} + +/* Returns the number of times the loop ran before the PIT2 signaled */ +static inline unsigned long poll_PIT2_gate(void) +{ + unsigned long count = 0; + unsigned char nmi_sc_val; + do { + ++count; + __asm__ volatile( + "inb $0x61,%0" + : "=q"(nmi_sc_val) /*:*/ /* no input */ /*:*/ /* no clobber */); + } while( (nmi_sc_val & 0x20) == 0); + return count; +} + + +inline static void +set_PIT2(int value) +{ +/* + * First, tell the clock we are going to write 16 bits to the counter + * and enable one-shot mode (command 0xB8 to port 0x43) + * Then write the two bytes into the PIT2 clock register (port 0x42). + * Loop until the value is "realized" in the clock, + * this happens on the next tick. + */ + asm volatile( + " movb $0xB8,%%al \n\t" + " outb %%al,$0x43 \n\t" + " movb %%dl,%%al \n\t" + " outb %%al,$0x42 \n\t" + " movb %%dh,%%al \n\t" + " outb %%al,$0x42 \n" +"1: inb $0x42,%%al \n\t" + " inb $0x42,%%al \n\t" + " cmp %%al,%%dh \n\t" + " jne 1b" + : : "d"(value) : "%al"); +} + + +inline static uint64_t +get_PIT2(unsigned int *value) +{ + register uint64_t result; +/* + * This routine first latches the time (command 0x80 to port 0x43), + * then gets the time stamp so we know how long the read will take later. + * Read (from port 0x42) and return the current value of the timer. + */ +#ifdef __i386__ + asm volatile( + " xorl %%ecx,%%ecx \n\t" + " movb $0x80,%%al \n\t" + " outb %%al,$0x43 \n\t" + " rdtsc \n\t" + " pushl %%eax \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%cl \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%ch \n\t" + " popl %%eax " + : "=A"(result), "=c"(*value)); +#else /* __x86_64__ */ + asm volatile( + " xorq %%rcx,%%rcx \n\t" + " movb $0x80,%%al \n\t" + " outb %%al,$0x43 \n\t" + " rdtsc \n\t" + " pushq %%rax \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%cl \n\t" + " inb $0x42,%%al \n\t" + " movb %%al,%%ch \n\t" + " popq %%rax " + : "=A"(result), "=c"(*value)); +#endif + + return result; +} + +#endif /* !__LIBSAIO_CPU_H */ diff --git a/i386/libsaio/device_inject.c b/i386/libsaio/device_inject.c new file mode 100644 index 0000000..895fd1a --- /dev/null +++ b/i386/libsaio/device_inject.c @@ -0,0 +1,360 @@ +/* + * Copyright 2009 Jasmin Fazlic All rights reserved. + */ +/* + * Cleaned and merged by iNDi + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "pci_root.h" +#include "device_inject.h" +#include "convert.h" + +#ifndef DEBUG_INJECT +#define DEBUG_INJECT 0 +#endif + +#if DEBUG_INJECT +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +uint32_t devices_number = 1; +uint32_t builtin_set = 0; +struct DevPropString *string = 0; +uint8_t *stringdata = 0; +uint32_t stringlength = 0; + +char *efi_inject_get_devprop_string(uint32_t *len) +{ + if(string) { + *len = string->length; + return devprop_generate_string(string); + } + verbose("efi_inject_get_devprop_string NULL trying stringdata\n"); + return NULL; +} + +void setupDeviceProperties(Node *node) +{ + const char *val; + uint8_t *binStr; + int cnt, cnt2; + + static char DEVICE_PROPERTIES_PROP[] = "device-properties"; + + /* Generate devprop string. + */ + uint32_t strlength; + char *string = efi_inject_get_devprop_string(&strlength); + + /* Use the static "device-properties" boot config key contents if available, + * otheriwse use the generated one. + */ + if (!getValueForKey(kDeviceProperties, &val, &cnt, &bootInfo->chameleonConfig) && string) + { + val = (const char*)string; + cnt = strlength * 2; + } + + if (cnt > 1) + { + binStr = convertHexStr2Binary(val, &cnt2); + if (cnt2 > 0) DT__AddProperty(node, DEVICE_PROPERTIES_PROP, cnt2, binStr); + } +} + +struct DevPropString *devprop_create_string(void) +{ + string = (struct DevPropString*)malloc(sizeof(struct DevPropString)); + + if(string == NULL) + return NULL; + + memset(string, 0, sizeof(struct DevPropString)); + string->length = 12; + string->WHAT2 = 0x01000000; + return string; +} + +struct DevPropDevice *devprop_add_device(struct DevPropString *string, char *path) +{ + struct DevPropDevice *device; + const char pciroot_string[] = "PciRoot(0x"; + const char pci_device_string[] = "Pci(0x"; + + if (string == NULL || path == NULL) { + return NULL; + } + device = malloc(sizeof(struct DevPropDevice)); + + if (strncmp(path, pciroot_string, strlen(pciroot_string))) { + printf("ERROR parsing device path\n"); + return NULL; + } + + memset(device, 0, sizeof(struct DevPropDevice)); + device->acpi_dev_path._UID = getPciRootUID(); + + int numpaths = 0; + int x, curr = 0; + char buff[] = "00"; + + for (x = 0; x < strlen(path); x++) { + if (!strncmp(&path[x], pci_device_string, strlen(pci_device_string))) { + x+=strlen(pci_device_string); + curr=x; + while(path[++x] != ','); + if(x-curr == 2) + sprintf(buff, "%c%c", path[curr], path[curr+1]); + else if(x-curr == 1) + sprintf(buff, "%c", path[curr]); + else + { + printf("ERROR parsing device path\n"); + numpaths = 0; + break; + } + device->pci_dev_path[numpaths].device = ascii_hex_to_int(buff); + + x += 3; // 0x + curr = x; + while(path[++x] != ')'); + if(x-curr == 2) + sprintf(buff, "%c%c", path[curr], path[curr+1]); + else if(x-curr == 1) + sprintf(buff, "%c", path[curr]); + else + { + printf("ERROR parsing device path\n"); + numpaths = 0; + break; + } + device->pci_dev_path[numpaths].function = ascii_hex_to_int(buff); // TODO: find dev from char *path + + numpaths++; + } + } + + if(!numpaths) + return NULL; + + device->numentries = 0x00; + + device->acpi_dev_path.length = 0x0c; + device->acpi_dev_path.type = 0x02; + device->acpi_dev_path.subtype = 0x01; + device->acpi_dev_path._HID = 0xd041030a; + + device->num_pci_devpaths = numpaths; + device->length = 24 + (6*numpaths); + + int i; + + for(i = 0; i < numpaths; i++) + { + device->pci_dev_path[i].length = 0x06; + device->pci_dev_path[i].type = 0x01; + device->pci_dev_path[i].subtype = 0x01; + } + + device->path_end.length = 0x04; + device->path_end.type = 0x7f; + device->path_end.subtype = 0xff; + + device->string = string; + device->data = NULL; + string->length += device->length; + + if(!string->entries) + if((string->entries = (struct DevPropDevice**)malloc(sizeof(device)*DEV_PROP_DEVICE_MAX_ENTRIES))== NULL) + return 0; + + string->entries[string->numentries++] = (struct DevPropDevice*)malloc(sizeof(device)); + string->entries[string->numentries-1] = device; + + return device; +} + +int devprop_add_value(struct DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len) +{ + + if(!nm || !vl || !len) + return 0; + + uint32_t length = ((strlen(nm) * 2) + len + (2 * sizeof(uint32_t)) + 2); + uint8_t *data = (uint8_t*)malloc(length); + { + if(!data) + return 0; + + memset(data, 0, length); + uint32_t off= 0; + data[off+1] = ((strlen(nm) * 2) + 6) >> 8; + data[off] = ((strlen(nm) * 2) + 6) & 0x00FF; + + off += 4; + uint32_t i=0, l = strlen(nm); + for(i = 0 ; i < l ; i++, off += 2) + { + data[off] = *nm++; + } + + off += 2; + l = len; + uint32_t *datalength = (uint32_t*)&data[off]; + *datalength = l + 4; + off += 4; + for(i = 0 ; i < l ; i++, off++) + { + data[off] = *vl++; + } + } + + uint32_t offset = device->length - (24 + (6 * device->num_pci_devpaths)); + + uint8_t *newdata = (uint8_t*)malloc((length + offset)); + if(!newdata) + return 0; + if(device->data) + if(offset > 1) + memcpy(newdata, device->data, offset); + + memcpy(newdata + offset, data, length); + + device->length += length; + device->string->length += length; + device->numentries++; + + if(!device->data) + device->data = (uint8_t*)malloc(sizeof(uint8_t)); + else + free(device->data); + + free(data); + device->data = newdata; + + return 1; +} + +char *devprop_generate_string(struct DevPropString *string) +{ + char *buffer = (char*)malloc(string->length * 2); + char *ptr = buffer; + + if(!buffer) + return NULL; + + sprintf(buffer, "%08x%08x%04x%04x", dp_swap32(string->length), string->WHAT2, + dp_swap16(string->numentries), string->WHAT3); + buffer += 24; + int i = 0, x = 0; + + while(i < string->numentries) + { + sprintf(buffer, "%08x%04x%04x", dp_swap32(string->entries[i]->length), + dp_swap16(string->entries[i]->numentries), string->entries[i]->WHAT2); + + buffer += 16; + sprintf(buffer, "%02x%02x%04x%08x%08x", string->entries[i]->acpi_dev_path.type, + string->entries[i]->acpi_dev_path.subtype, + dp_swap16(string->entries[i]->acpi_dev_path.length), + string->entries[i]->acpi_dev_path._HID, + dp_swap32(string->entries[i]->acpi_dev_path._UID)); + + buffer += 24; + for(x=0;x < string->entries[i]->num_pci_devpaths; x++) + { + sprintf(buffer, "%02x%02x%04x%02x%02x", string->entries[i]->pci_dev_path[x].type, + string->entries[i]->pci_dev_path[x].subtype, + dp_swap16(string->entries[i]->pci_dev_path[x].length), + string->entries[i]->pci_dev_path[x].function, + string->entries[i]->pci_dev_path[x].device); + buffer += 12; + } + + sprintf(buffer, "%02x%02x%04x", string->entries[i]->path_end.type, + string->entries[i]->path_end.subtype, + dp_swap16(string->entries[i]->path_end.length)); + + buffer += 8; + uint8_t *dataptr = string->entries[i]->data; + for(x = 0; x < (string->entries[i]->length) - (24 + (6 * string->entries[i]->num_pci_devpaths)) ; x++) + { + sprintf(buffer, "%02x", *dataptr++); + buffer += 2; + } + i++; + } + return ptr; +} + +void devprop_free_string(struct DevPropString *string) +{ + if(!string) + return; + + int i; + for(i = 0; i < string->numentries; i++) + { + if(string->entries[i]) + { + if(string->entries[i]->data) + { + free(string->entries[i]->data); + string->entries[i]->data = NULL; + } + free(string->entries[i]); + string->entries[i] = NULL; + } + } + + free(string); + string = NULL; +} + +/* a fine place for this code */ + +int devprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id) +{ + if(!device) + return 0; + uint8_t builtin = 0x0; + if((vendor_id != 0x168c) && (builtin_set == 0)) + { + builtin_set = 1; + builtin = 0x01; + } + if(!devprop_add_value(device, "built-in", (uint8_t*)&builtin, 1)) + return 0; + devices_number++; + return 1; +} + +void set_eth_builtin(pci_dt_t *eth_dev) +{ + char *devicepath = get_pci_dev_path(eth_dev); + struct DevPropDevice *device = (struct DevPropDevice*)malloc(sizeof(struct DevPropDevice)); + + verbose("LAN Controller [%04x:%04x] :: %s\n", eth_dev->vendor_id, eth_dev->device_id, devicepath); + + if (!string) + string = devprop_create_string(); + + device = devprop_add_device(string, devicepath); + if(device) + { + verbose("Setting up lan keys\n"); + devprop_add_network_template(device, eth_dev->vendor_id); + stringdata = (uint8_t*)malloc(sizeof(uint8_t) * string->length); + if(stringdata) + { + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + } + } +} diff --git a/i386/libsaio/device_inject.h b/i386/libsaio/device_inject.h new file mode 100644 index 0000000..ade9996 --- /dev/null +++ b/i386/libsaio/device_inject.h @@ -0,0 +1,75 @@ +/* + * Copyright 2009 Jasmin Fazlic All rights reserved. + */ +/* + * Cleaned and merged by iNDi + */ + +#ifndef __LIBSAIO_DEVICE_INJECT_H +#define __LIBSAIO_DEVICE_INJECT_H + +#define DP_ADD_TEMP_VAL(dev, val) devprop_add_value(dev, (char*)val[0], (uint8_t*)val[1], strlen(val[1]) + 1) +#define DP_ADD_TEMP_VAL_DATA(dev, val) devprop_add_value(dev, (char*)val.name, (uint8_t*)val.data, val.size) +#define MAX_PCI_DEV_PATHS 4 +#define DEV_PROP_DEVICE_MAX_ENTRIES 64 + +extern struct DevPropString *string; +extern uint8_t *stringdata; +extern uint32_t stringlength; + +extern void setupDeviceProperties(Node *node); + +struct ACPIDevPath { + uint8_t type; // = 2 ACPI device-path + uint8_t subtype; // = 1 ACPI Device-path + uint16_t length; // = 0x0c + uint32_t _HID; // = 0xD041030A ? + uint32_t _UID; // = 0x00000000 PCI ROOT +}; + +struct PCIDevPath { + uint8_t type; // = 1 Hardware device-path + uint8_t subtype; // = 1 PCI + uint16_t length; // = 6 + uint8_t function; // pci func number + uint8_t device; // pci dev number +}; + +struct DevicePathEnd { + uint8_t type; // = 0x7f + uint8_t subtype; // = 0xff + uint16_t length; // = 4; +}; + +struct DevPropDevice { + uint32_t length; + uint16_t numentries; + uint16_t WHAT2; // 0x0000 ? + struct ACPIDevPath acpi_dev_path; // = 0x02010c00 0xd041030a + struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS]; // = 0x01010600 func dev + struct DevicePathEnd path_end; // = 0x7fff0400 + uint8_t *data; + + // ------------------------ + uint8_t num_pci_devpaths; + struct DevPropString *string; + // ------------------------ +}; + +struct DevPropString { + uint32_t length; + uint32_t WHAT2; // 0x01000000 ? + uint16_t numentries; + uint16_t WHAT3; // 0x0000 ? + struct DevPropDevice **entries; +}; + +char *efi_inject_get_devprop_string(uint32_t *len); +int devprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id); +struct DevPropString *devprop_create_string(void); +struct DevPropDevice *devprop_add_device(struct DevPropString *string, char *path); +int devprop_add_value(struct DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len); +char *devprop_generate_string(struct DevPropString *string); +void devprop_free_string(struct DevPropString *string); + +#endif /* !__LIBSAIO_DEVICE_INJECT_H */ diff --git a/i386/libsaio/device_tree.c b/i386/libsaio/device_tree.c new file mode 100644 index 0000000..d17e384 --- /dev/null +++ b/i386/libsaio/device_tree.c @@ -0,0 +1,540 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All Rights Reserved. + */ + +#if 1 +/* + + Structures for a Flattened Device Tree + */ + +#define kPropNameLength 32 + +typedef struct DeviceTreeNodeProperty { + char name[kPropNameLength]; // NUL terminated property name + unsigned long length; // Length (bytes) of folloing prop value + // unsigned long value[1]; // Variable length value of property + // Padded to a multiple of a longword? +} DeviceTreeNodeProperty; + +typedef struct OpaqueDTEntry { + unsigned long nProperties; // Number of props[] elements (0 => end) + unsigned long nChildren; // Number of children[] elements + // DeviceTreeNodeProperty props[];// array size == nProperties + // DeviceTreeNode children[]; // array size == nChildren +} DeviceTreeNode; + +typedef char DTPropertyNameBuf[32]; +/* Entry Name Definitions (Entry Names are C-Strings)*/ +enum { + kDTMaxEntryNameLength = 31 /* Max length of a C-String Entry Name (terminator not included) */ +}; + +/* length of DTEntryNameBuf = kDTMaxEntryNameLength +1*/ +typedef char DTEntryNameBuf[32]; +#endif + +#include "libsaio.h" +#include "device_tree.h" + +#if DEBUG +#define DPRINTF(args...) printf(args) +void +DT__PrintTree(Node *node); +#else +#define DPRINTF(args...) +#endif + + +#define RoundToLong(x) (((x) + 3) & ~3) + +static struct _DTSizeInfo { + uint32_t numNodes; + uint32_t numProperties; + uint32_t totalPropertySize; +} DTInfo; + +#define kAllocSize 4096 + +static Node *rootNode; + +static Node *freeNodes, *allocedNodes; +static Property *freeProperties, *allocedProperties; + +Property * +DT__AddProperty(Node *node, const char *name, uint32_t length, void *value) +{ + Property *prop; + + DPRINTF("DT__AddProperty([Node '%s'], '%s', %d, 0x%x)\n", DT__GetName(node), name, length, value); + if (freeProperties == NULL) { + void *buf = malloc(kAllocSize); + int i; + + DPRINTF("Allocating more free properties\n"); + if (buf == 0) return 0; + bzero(buf, kAllocSize); + // Use the first property to record the allocated buffer + // for later freeing. + prop = (Property *)buf; + prop->next = allocedProperties; + allocedProperties = prop; + prop->value = buf; + prop++; + for (i=1; i<(kAllocSize / sizeof(Property)); i++) { + prop->next = freeProperties; + freeProperties = prop; + prop++; + } + } + prop = freeProperties; + freeProperties = prop->next; + + prop->name = name; + prop->length = length; + prop->value = value; + + // Always add to end of list + if (node->properties == 0) { + node->properties = prop; + } else { + node->last_prop->next = prop; + } + node->last_prop = prop; + prop->next = 0; + + DPRINTF("Done [0x%x]\n", prop); + + DTInfo.numProperties++; + DTInfo.totalPropertySize += RoundToLong(length); + + return prop; +} + +Node * +DT__AddChild(Node *parent, const char *name) +{ + Node *node; + + if (freeNodes == NULL) { + void *buf = malloc(kAllocSize); + int i; + + DPRINTF("Allocating more free nodes\n"); + if (buf == 0) return 0; + bzero(buf, kAllocSize); + node = (Node *)buf; + // Use the first node to record the allocated buffer + // for later freeing. + node->next = allocedNodes; + allocedNodes = node; + node->children = (Node *)buf; + node++; + for (i=1; i<(kAllocSize / sizeof(Node)); i++) { + node->next = freeNodes; + freeNodes = node; + node++; + } + } + DPRINTF("DT__AddChild(0x%x, '%s')\n", parent, name); + node = freeNodes; + freeNodes = node->next; + DPRINTF("Got free node 0x%x\n", node); + DPRINTF("prop = 0x%x, children = 0x%x, next = 0x%x\n", node->properties, node->children, node->next); + + if (parent == NULL) { + rootNode = node; + node->next = 0; + } else { + node->next = parent->children; + parent->children = node; + } + DTInfo.numNodes++; + DT__AddProperty(node, "name", strlen(name) + 1, (void *) name); + return node; +} + +void +DT__FreeProperty(Property *prop) +{ + prop->next = freeProperties; + freeProperties = prop; +} +void +DT__FreeNode(Node *node) +{ + node->next = freeNodes; + freeNodes = node; +} + +void +DT__Initialize(void) +{ + DPRINTF("DT__Initialize\n"); + + freeNodes = 0; + allocedNodes = 0; + freeProperties = 0; + allocedProperties = 0; + + DTInfo.numNodes = 0; + DTInfo.numProperties = 0; + DTInfo.totalPropertySize = 0; + + rootNode = DT__AddChild(NULL, "/"); + DPRINTF("DT__Initialize done\n"); +} + +/* + * Free up memory used by in-memory representation + * of device tree. + */ +void +DT__Finalize(void) +{ + Node *node; + Property *prop; + + DPRINTF("DT__Finalize\n"); + for (prop = allocedProperties; prop != NULL; prop = prop->next) { + free(prop->value); + } + allocedProperties = NULL; + freeProperties = NULL; + + for (node = allocedNodes; node != NULL; node = node->next) { + free((void *)node->children); + } + allocedNodes = NULL; + freeNodes = NULL; + rootNode = NULL; + + // XXX leaks any created strings + + DTInfo.numNodes = 0; + DTInfo.numProperties = 0; + DTInfo.totalPropertySize = 0; +} + +static void * +FlattenNodes(Node *node, void *buffer) +{ + Property *prop; + DeviceTreeNode *flatNode; + DeviceTreeNodeProperty *flatProp; + int count; + + if (node == 0) return buffer; + + flatNode = (DeviceTreeNode *)buffer; + buffer += sizeof(DeviceTreeNode); + + for (count = 0, prop = node->properties; prop != 0; count++, prop = prop->next) { + flatProp = (DeviceTreeNodeProperty *)buffer; + strcpy(flatProp->name, prop->name); + flatProp->length = prop->length; + buffer += sizeof(DeviceTreeNodeProperty); + bcopy(prop->value, buffer, prop->length); + buffer += RoundToLong(prop->length); + } + flatNode->nProperties = count; + + for (count = 0, node = node->children; node != 0; count++, node = node->next) { + buffer = FlattenNodes(node, buffer); + } + flatNode->nChildren = count; + + return buffer; +} + +/* + * Flatten the in-memory representation of the device tree + * into a binary DT block. + * To get the buffer size needed, call with result = 0. + * To have a buffer allocated for you, call with *result = 0. + * To use your own buffer, call with *result = &buffer. + */ + +void +DT__FlattenDeviceTree(void **buffer_p, uint32_t *length) +{ + uint32_t totalSize; + void *buf; + + DPRINTF("DT__FlattenDeviceTree(0x%x, 0x%x)\n", buffer_p, length); +#if DEBUG + if (buffer_p) DT__PrintTree(rootNode); +#endif + + totalSize = DTInfo.numNodes * sizeof(DeviceTreeNode) + + DTInfo.numProperties * sizeof(DeviceTreeNodeProperty) + + DTInfo.totalPropertySize; + + DPRINTF("Total size 0x%x\n", totalSize); + if (buffer_p != 0) { + if (totalSize == 0) { + buf = 0; + } else { + if (*buffer_p == 0) { + buf = malloc(totalSize); + } else { + buf = *buffer_p; + } + bzero(buf, totalSize); + + FlattenNodes(rootNode, buf); + } + *buffer_p = buf; + } + if (length) + *length = totalSize; +} + +char * +DT__GetName(Node *node) +{ + Property *prop; + + //DPRINTF("DT__GetName(0x%x)\n", node); + //DPRINTF("Node properties = 0x%x\n", node->properties); + for (prop = node->properties; prop; prop = prop->next) { + //DPRINTF("Prop '%s'\n", prop->name); + if (strcmp(prop->name, "name") == 0) { + return prop->value; + } + } + //DPRINTF("DT__GetName returns 0\n"); + return "(null)"; +} + +Node * +DT__FindNode(const char *path, bool createIfMissing) +{ + Node *node, *child; + DTPropertyNameBuf nameBuf; + char *bp; + int i; + + DPRINTF("DT__FindNode('%s', %d)\n", path, createIfMissing); + + // Start at root + node = rootNode; + DPRINTF("root = 0x%x\n", rootNode); + + while (node) { + // Skip leading slash + while (*path == '/') path++; + + for (i=0, bp = nameBuf; ++i < kDTMaxEntryNameLength && *path && *path != '/'; bp++, path++) *bp = *path; + *bp = '\0'; + + if (nameBuf[0] == '\0') { + // last path entry + break; + } + DPRINTF("Node '%s'\n", nameBuf); + + for (child = node->children; child != 0; child = child->next) { + DPRINTF("Child 0x%x\n", child); + if (strcmp(DT__GetName(child), nameBuf) == 0) { + break; + } + } + if (child == 0 && createIfMissing) { + DPRINTF("Creating node\n"); + char *str = malloc(strlen(nameBuf) + 1); + // XXX this will leak + strcpy(str, nameBuf); + + child = DT__AddChild(node, str); + } + node = child; + } + return node; +} + +#if DEBUG + +void +DT__PrintNode(Node *node, int level) +{ + char spaces[10], *cp = spaces; + Property *prop; + + if (level > 9) level = 9; + while (level--) *cp++ = ' '; + *cp = '\0'; + + printf("%s===Node===\n", spaces); + for (prop = node->properties; prop; prop = prop->next) { + char c = *((char *)prop->value); + if (prop->length < 64 && ( + strcmp(prop->name, "name") == 0 || + (c >= '0' && c <= '9') || + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || c == '_')) { + printf("%s Property '%s' [%d] = '%s'\n", spaces, prop->name, prop->length, prop->value); + } else { + printf("%s Property '%s' [%d] = (data)\n", spaces, prop->name, prop->length); + } + } + printf("%s==========\n", spaces); +} + +static void +_PrintTree(Node *node, int level) +{ + DT__PrintNode(node, level); + level++; + for (node = node->children; node; node = node->next) + _PrintTree(node, level); +} + +void +DT__PrintTree(Node *node) +{ + if (node == 0) node = rootNode; + _PrintTree(node, 0); +} + +void +DT__PrintFlattenedNode(DTEntry entry, int level) +{ + char spaces[10], *cp = spaces; + DTPropertyIterator propIter; + char *name; + void *prop; + int propSize; + + if (level > 9) level = 9; + while (level--) *cp++ = ' '; + *cp = '\0'; + + printf("%s===Entry %p===\n", spaces, entry); + if (kSuccess != DTCreatePropertyIterator(entry, &propIter)) { + printf("Couldn't create property iterator\n"); + return; + } + while( kSuccess == DTIterateProperties( propIter, &name)) { + if( kSuccess != DTGetProperty( entry, name, &prop, &propSize )) + continue; + printf("%s Property %s = %s\n", spaces, name, prop); + } + DTDisposePropertyIterator(propIter); + + printf("%s==========\n", spaces); +} + +static void +_PrintFlattenedTree(DTEntry entry, int level) +{ + DTEntryIterator entryIter; + + PrintFlattenedNode(entry, level); + + if (kSuccess != DTCreateEntryIterator(entry, &entryIter)) { + printf("Couldn't create entry iterator\n"); + return; + } + level++; + while (kSuccess == DTIterateEntries( entryIter, &entry )) { + _PrintFlattenedTree(entry, level); + } + DTDisposeEntryIterator(entryIter); +} + +void +DT__PrintFlattenedTree(DTEntry entry) +{ + _PrintFlattenedTree(entry, 0); +} + + +int +main(int argc, char **argv) +{ + DTEntry dtEntry; + DTPropertyIterator propIter; + DTEntryIterator entryIter; + void *prop; + int propSize; + char *name; + void *flatTree; + uint32_t flatSize; + + Node *node; + + node = AddChild(NULL, "device-tree"); + AddProperty(node, "potato", 4, "foo"); + AddProperty(node, "chemistry", 4, "bar"); + AddProperty(node, "physics", 4, "baz"); + + node = AddChild(node, "dev"); + AddProperty(node, "one", 4, "one"); + AddProperty(node, "two", 4, "two"); + AddProperty(node, "three", 6, "three"); + + node = AddChild(rootNode, "foo"); + AddProperty(node, "aaa", 4, "aab"); + AddProperty(node, "bbb", 4, "bbc"); + AddProperty(node, "cccc", 6, "ccccd"); + + node = FindNode("/this/is/a/test", 1); + AddProperty(node, "dddd", 12, "abcdefghijk"); + + printf("In-memory tree:\n\n"); + + PrintTree(rootNode); + + FlattenDeviceTree(&flatTree, &flatSize); + + printf("Flat tree = %p, size %d\n", flatTree, flatSize); + + dtEntry = (DTEntry)flatTree; + + printf("\n\nPrinting flat tree\n\n"); + + DTInit(dtEntry); + + PrintFlattenedTree((DTEntry)flatTree); +#if 0 + printf("=== Entry %p ===\n", dtEntry); + if (kSuccess != DTCreatePropertyIterator(dtEntry, &propIter)) { + printf("Couldn't create property iterator\n"); + return 1; + } + while( kSuccess == DTIterateProperties( propIter, &name)) { + if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize )) + continue; + printf(" Property %s = %s\n", name, prop); + } + DTDisposePropertyIterator(propIter); + printf("========\n"); + + if (kSuccess != DTCreateEntryIterator(dtEntry, &entryIter)) { + printf("Couldn't create entry iterator\n"); + return 1; + } + while (kSuccess == DTIterateEntries( entryIter, &dtEntry )) { + printf("=== Entry %p ===\n", dtEntry); + + if (kSuccess != DTCreatePropertyIterator(dtEntry, &propIter)) { + printf("Couldn't create property iterator\n"); + return 1; + } + while( kSuccess == DTIterateProperties( propIter, &name)) { + if( kSuccess != DTGetProperty( dtEntry, name, &prop, &propSize )) + continue; + printf(" Property %s = %s\n", name, prop); + } + DTDisposePropertyIterator(propIter); + printf("========\n"); + } + DTDisposeEntryIterator(entryIter); +#endif + + return 0; +} + +#endif + diff --git a/i386/libsaio/device_tree.h b/i386/libsaio/device_tree.h new file mode 100644 index 0000000..a401bbf --- /dev/null +++ b/i386/libsaio/device_tree.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All Rights Reserved. + */ + +#ifndef __DEVICE_TREE_H +#define __DEVICE_TREE_H + +#include <stdbool.h> +#include <stdint.h> + +typedef struct _Property { + const char * name; + uint32_t length; + void * value; + + struct _Property * next; +} Property; + +typedef struct _Node { + struct _Property * properties; + struct _Property * last_prop; + + struct _Node * children; + + struct _Node * next; +} Node; + + +extern Property * +DT__AddProperty(Node *node, const char *name, uint32_t length, void *value); + +extern Node * +DT__AddChild(Node *parent, const char *name); + +Node * +DT__FindNode(const char *path, bool createIfMissing); + +extern void +DT__FreeProperty(Property *prop); + +extern void +DT__FreeNode(Node *node); + +extern char * +DT__GetName(Node *node); + +void +DT__Initialize(void); + +/* + * Free up memory used by in-memory representation + * of device tree. + */ +extern void +DT__Finalize(void); + +void +DT__FlattenDeviceTree(void **result, uint32_t *length); + + +#endif /* __DEVICE_TREE_H */ diff --git a/i386/libsaio/disk.c b/i386/libsaio/disk.c new file mode 100644 index 0000000..edf03e0 --- /dev/null +++ b/i386/libsaio/disk.c @@ -0,0 +1,2124 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT Computer, Inc. + * All rights reserved. + */ + +/* + * Copyright 2007 VMware Inc. + * "Preboot" ramdisk support added by David Elliott + * GPT support added by David Elliott. Based on IOGUIDPartitionScheme.cpp. + */ + +//Azi: style the rest later... + +// Allow UFS_SUPPORT to be overridden with preprocessor option. +#ifndef UFS_SUPPORT +// zef: Disabled UFS support +#define UFS_SUPPORT 0 +#endif + +#if UFS_SUPPORT +#include "ufs.h" +#endif +#include <limits.h> +#include <IOKit/storage/IOApplePartitionScheme.h> +#include <IOKit/storage/IOGUIDPartitionScheme.h> +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "memory.h" +#include "fdisk.h" +#include "hfs.h" +#include "ntfs.h" +#include "msdos.h" +#include "ext2fs.h" +#include "befs.h" +#include "freebsd.h" +#include "openbsd.h" +#include "xml.h" +#include "disk.h" +// For EFI_GUID +#include "efi.h" +#include "efi_tables.h" + +typedef struct gpt_hdr gpt_hdr; +typedef struct gpt_ent gpt_ent; + +#define PROBEFS_SIZE BPS * 4 /* buffer size for filesystem probe */ +#define CD_BPS 2048 /* CD-ROM block size */ +#define N_CACHE_SECS (BIOS_LEN / BPS) /* Must be a multiple of 4 for CD-ROMs */ +#define UFS_FRONT_PORCH 0 +#define kAPMSector 2 /* Sector number of Apple partition map */ +#define kAPMCDSector 8 /* Translated sector of Apple partition map on a CD */ + +/* + * IORound and IOTrunc convenience functions, in the spirit + * of vm's round_page() and trunc_page(). + */ +#define IORound(value,multiple) \ + ((((value) + (multiple) - 1) / (multiple)) * (multiple)) + +#define IOTrunc(value,multiple) \ + (((value) / (multiple)) * (multiple)); + +/* + * trackbuf points to the start of the track cache. Biosread() + * will store the sectors read from disk to this memory area. + * + * biosbuf points to a sector within the track cache, and is + * updated by Biosread(). + */ +static char * const trackbuf = (char *) ptov(BIOS_ADDR); +static char * biosbuf; + +/* + * Map a disk drive to bootable volumes contained within. + */ +struct DiskBVMap { + int biosdev; // BIOS device number (unique) + BVRef bvr; // chain of boot volumes on the disk + int bvrcnt; // number of boot volumes + struct DiskBVMap * next; // linkage to next mapping +}; + +static struct DiskBVMap * gDiskBVMap = NULL; +static struct disk_blk0 * gBootSector = NULL; + +// Function pointers to be filled in if ramdisks are available: +int (*p_ramdiskReadBytes)( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ) = NULL; +int (*p_get_ramdisk_info)(int biosdev, struct driveInfo *dip) = NULL; + +static bool getOSVersion(BVRef bvr, char *str); + +extern void spinActivityIndicator(int sectors); + +//========================================================================== + +static int getDriveInfo( int biosdev, struct driveInfo *dip ) +{ + static struct driveInfo cached_di; + int cc; + + // Real BIOS devices are 8-bit, so anything above that is for internal use. + // Don't cache ramdisk drive info since it doesn't require several BIOS + // calls and is thus not worth it. + if(biosdev >= 0x100) + { + if(p_get_ramdisk_info != NULL) + cc = (*p_get_ramdisk_info)(biosdev, dip); + else + cc = -1; + if(cc < 0) + { + dip->valid = 0; + return -1; + } + else + return 0; + } + + if ( !cached_di.valid || biosdev != cached_di.biosdev ) + { + cc = get_drive_info(biosdev, &cached_di); + if (cc < 0) { + cached_di.valid = 0; + DEBUG_DISK(("get_drive_info returned error\n")); + return (-1); // BIOS call error + } + } + + bcopy(&cached_di, dip, sizeof(cached_di)); + + return 0; +} + +//========================================================================== +// Maps (E)BIOS return codes to message strings. + +struct NamedValue { + unsigned char value; + const char * name; +}; + +static const char * getNameForValue( const struct NamedValue * nameTable, + unsigned char value ) +{ + const struct NamedValue * np; + + for ( np = nameTable; np->value; np++) + if (np->value == value) + return np->name; + + return NULL; +} + +#define ECC_CORRECTED_ERR 0x11 + +static const struct NamedValue bios_errors[] = { + { 0x10, "Media error" }, + { 0x11, "Corrected ECC error" }, + { 0x20, "Controller or device error" }, + { 0x40, "Seek failed" }, + { 0x80, "Device timeout" }, + { 0xAA, "Drive not ready" }, + { 0x00, 0 } +}; + +static const char * bios_error(int errnum) +{ + static char errorstr[] = "Error 0x00"; + const char * errname; + + errname = getNameForValue( bios_errors, errnum ); + if ( errname ) return errname; + + sprintf(errorstr, "Error 0x%02x", errnum); + return errorstr; // No string, print error code only +} + +//========================================================================== +// Use BIOS INT13 calls to read the sector specified. This function will +// also perform read-ahead to cache a few subsequent sector to the sector +// cache. +// +// Return: +// 0 on success, or an error code from INT13/F2 or INT13/F42 BIOS call. + +static bool cache_valid = false; + +static int Biosread( int biosdev, unsigned long long secno ) +{ + static int xbiosdev, xcyl, xhead; + static unsigned int xsec, xnsecs; + struct driveInfo di; + + int rc = -1; + int cyl, head, sec; + int tries = 0; + int bps, divisor; + + if (getDriveInfo(biosdev, &di) < 0) { + return -1; + } + if (di.no_emulation) { + /* Always assume 2k block size; BIOS may lie about geometry */ + bps = 2048; + } else { + bps = di.di.params.phys_nbps; + if (bps == 0) { + return -1; + } + } + divisor = bps / BPS; + + DEBUG_DISK(("Biosread dev %x sec %d bps %d\n", biosdev, secno, bps)); + + // To read the disk sectors, use EBIOS if we can. Otherwise, + // revert to the standard BIOS calls. + + if ((biosdev >= kBIOSDevTypeHardDrive) && + (di.uses_ebios & EBIOS_FIXED_DISK_ACCESS)) + { + if (cache_valid && + (biosdev == xbiosdev) && + (secno >= xsec) && + ((unsigned int)secno < (xsec + xnsecs))) + { + biosbuf = trackbuf + (BPS * (secno - xsec)); + return 0; + } + + xnsecs = N_CACHE_SECS; + xsec = (secno / divisor) * divisor; + cache_valid = false; + + while ((rc = ebiosread(biosdev, secno / divisor, xnsecs / divisor)) && (++tries < 5)) + { + if (rc == ECC_CORRECTED_ERR) { + /* Ignore corrected ECC errors */ + rc = 0; + break; + } + error(" EBIOS read error: %s\n", bios_error(rc), rc); + error(" Block 0x%x Sectors %d\n", secno, xnsecs); + sleep(1); + } + } + else + { + /* spc = spt * heads */ + int spc = (di.di.params.phys_spt * di.di.params.phys_heads); + cyl = secno / spc; + head = (secno % spc) / di.di.params.phys_spt; + sec = secno % di.di.params.phys_spt; + + if (cache_valid && + (biosdev == xbiosdev) && + (cyl == xcyl) && + (head == xhead) && + ((unsigned int)sec >= xsec) && + ((unsigned int)sec < (xsec + xnsecs))) + { + // this sector is in trackbuf cache + biosbuf = trackbuf + (BPS * (sec - xsec)); + return 0; + } + + // Cache up to a track worth of sectors, but do not cross a + // track boundary. + + xcyl = cyl; + xhead = head; + xsec = sec; + xnsecs = ((unsigned int)(sec + N_CACHE_SECS) > di.di.params.phys_spt) ? (di.di.params.phys_spt - sec) : N_CACHE_SECS; + cache_valid = false; + + while ((rc = biosread(biosdev, cyl, head, sec, xnsecs)) && + (++tries < 5)) + { + if (rc == ECC_CORRECTED_ERR) { + /* Ignore corrected ECC errors */ + rc = 0; + break; + } + error(" BIOS read error: %s\n", bios_error(rc), rc); + error(" Block %d, Cyl %d Head %d Sector %d\n", + secno, cyl, head, sec); + sleep(1); + } + } + + // If the BIOS reported success, mark the sector cache as valid. + + if (rc == 0) { + cache_valid = true; + } + biosbuf = trackbuf + (secno % divisor) * BPS; + xbiosdev = biosdev; + + spinActivityIndicator(xnsecs); + + return rc; +} + +//========================================================================== + +int testBiosread( int biosdev, unsigned long long secno ) +{ + return Biosread(biosdev, secno); +} + +//========================================================================== + +static int readBytes( int biosdev, unsigned long long blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ) +{ + // ramdisks require completely different code for reading. + if(p_ramdiskReadBytes != NULL && biosdev >= 0x100) + return (*p_ramdiskReadBytes)(biosdev, blkno, byteoff, byteCount, buffer); + + char * cbuf = (char *) buffer; + int error; + int copy_len; + + DEBUG_DISK(("%s: dev %x block %x [%d] -> 0x%x...", __FUNCTION__, + biosdev, blkno, byteCount, (unsigned)cbuf)); + + for ( ; byteCount; cbuf += copy_len, blkno++ ) + { + error = Biosread( biosdev, blkno ); + if ( error ) + { + DEBUG_DISK(("error\n")); + return (-1); + } + + copy_len = ((byteCount + byteoff) > BPS) ? (BPS - byteoff) : byteCount; + bcopy( biosbuf + byteoff, cbuf, copy_len ); + byteCount -= copy_len; + byteoff = 0; + } + + DEBUG_DISK(("done\n")); + + return 0; +} + +//========================================================================== + +static int isExtendedFDiskPartition( const struct fdisk_part * part ) +{ + static unsigned char extParts[] = + { + 0x05, /* Extended */ + 0x0f, /* Win95 extended */ + 0x85, /* Linux extended */ + }; + + unsigned int i; + + for (i = 0; i < sizeof(extParts)/sizeof(extParts[0]); i++) + { + if (extParts[i] == part->systid) return 1; + } + return 0; +} + +//========================================================================== + +static int getNextFDiskPartition( int biosdev, int * partno, + const struct fdisk_part ** outPart ) +{ + static int sBiosdev = -1; + static int sNextPartNo; + static unsigned int sFirstBase; + static unsigned int sExtBase; + static unsigned int sExtDepth; + static struct fdisk_part * sExtPart; + struct fdisk_part * part; + + if ( sBiosdev != biosdev || *partno < 0 ) + { + // Fetch MBR. + if ( readBootSector( biosdev, DISK_BLK0, 0 ) ) return 0; + + sBiosdev = biosdev; + sNextPartNo = 0; + sFirstBase = 0; + sExtBase = 0; + sExtDepth = 0; + sExtPart = NULL; + } + + while (1) + { + part = NULL; + + if ( sNextPartNo < FDISK_NPART ) + { + part = (struct fdisk_part *) gBootSector->parts[sNextPartNo]; + } + else if ( sExtPart ) + { + unsigned int blkno = sExtPart->relsect + sFirstBase; + + // Save the block offset of the first extended partition. + + if (sExtDepth == 0) { + sFirstBase = blkno; + } + sExtBase = blkno; + + // Load extended partition table. + + if ( readBootSector( biosdev, blkno, 0 ) == 0 ) + { + sNextPartNo = 0; + sExtDepth++; + sExtPart = NULL; + continue; + } + // Fall through to part == NULL + } + + if ( part == NULL ) break; // Reached end of partition chain. + + // Advance to next partition number. + + sNextPartNo++; + + if ( isExtendedFDiskPartition(part) ) + { + sExtPart = part; + continue; + } + + // Skip empty slots. + + if ( part->systid == 0x00 ) + { + continue; + } + + // Change relative offset to an absolute offset. + part->relsect += sExtBase; + + *outPart = part; + *partno = sExtDepth ? (int)(sExtDepth + FDISK_NPART) : sNextPartNo; + + break; + } + + return (part != NULL); +} + +//========================================================================== + +static BVRef newFDiskBVRef( int biosdev, int partno, unsigned int blkoff, + const struct fdisk_part * part, + FSInit initFunc, FSLoadFile loadFunc, + FSReadFile readFunc, + FSGetDirEntry getdirFunc, + FSGetFileBlock getBlockFunc, + FSGetUUID getUUIDFunc, + BVGetDescription getDescriptionFunc, + BVFree bvFreeFunc, + int probe, int type, unsigned int bvrFlags ) +{ + BVRef bvr = (BVRef) malloc( sizeof(*bvr) ); + if ( bvr ) + { + bzero(bvr, sizeof(*bvr)); + + bvr->biosdev = biosdev; + bvr->part_no = partno; + bvr->part_boff = blkoff; + bvr->part_type = part->systid; + bvr->fs_loadfile = loadFunc; + bvr->fs_readfile = readFunc; + bvr->fs_getdirentry = getdirFunc; + bvr->fs_getfileblock= getBlockFunc; + bvr->fs_getuuid = getUUIDFunc; + bvr->description = getDescriptionFunc; + bvr->type = type; + bvr->bv_free = bvFreeFunc; + + if ((part->bootid & FDISK_ACTIVE) && (part->systid == FDISK_HFS)) + bvr->flags |= kBVFlagPrimary; + + // Probe the filesystem. + + if ( initFunc ) + { + bvr->flags |= kBVFlagNativeBoot; + + if ( probe && initFunc( bvr ) != 0 ) + { + // filesystem probe failed. + + DEBUG_DISK(("%s: failed probe on dev %x part %d\n", + __FUNCTION__, biosdev, partno)); + + (*bvr->bv_free)(bvr); + bvr = NULL; + } + if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagBootable; + } + } + else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagForeignBoot; + } + else + { + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + if (bvr) bvr->flags |= bvrFlags; + return bvr; +} + +//========================================================================== + +BVRef newAPMBVRef( int biosdev, int partno, unsigned int blkoff, + const DPME * part, + FSInit initFunc, FSLoadFile loadFunc, + FSReadFile readFunc, + FSGetDirEntry getdirFunc, + FSGetFileBlock getBlockFunc, + FSGetUUID getUUIDFunc, + BVGetDescription getDescriptionFunc, + BVFree bvFreeFunc, + int probe, int type, unsigned int bvrFlags ) +{ + BVRef bvr = (BVRef) malloc( sizeof(*bvr) ); + if ( bvr ) + { + bzero(bvr, sizeof(*bvr)); + + bvr->biosdev = biosdev; + bvr->part_no = partno; + bvr->part_boff = blkoff; + bvr->fs_loadfile = loadFunc; + bvr->fs_readfile = readFunc; + bvr->fs_getdirentry = getdirFunc; + bvr->fs_getfileblock= getBlockFunc; + bvr->fs_getuuid = getUUIDFunc; + bvr->description = getDescriptionFunc; + bvr->type = type; + bvr->bv_free = bvFreeFunc; + strlcpy(bvr->name, part->dpme_name, DPISTRLEN); + strlcpy(bvr->type_name, part->dpme_type, DPISTRLEN); + + /* + if ( part->bootid & FDISK_ACTIVE ) + bvr->flags |= kBVFlagPrimary; + */ + + // Probe the filesystem. + + if ( initFunc ) + { + bvr->flags |= kBVFlagNativeBoot | kBVFlagBootable | kBVFlagSystemVolume; + + if ( probe && initFunc( bvr ) != 0 ) + { + // filesystem probe failed. + + DEBUG_DISK(("%s: failed probe on dev %x part %d\n", + __FUNCTION__, biosdev, partno)); + + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + /* + else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagForeignBoot; + } + */ + else + { + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + if (bvr) bvr->flags |= bvrFlags; + return bvr; +} + +//========================================================================== + +// GUID's in LE form: +// HFS+ partition - 48465300-0000-11AA-AA11-00306543ECAC +EFI_GUID const GPT_HFS_GUID = { 0x48465300, 0x0000, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; + +// turbo - Apple Boot Partition - 426F6F74-0000-11AA-AA11-00306543ECAC +EFI_GUID const GPT_BOOT_GUID = { 0x426F6F74, 0x0000, 0x11AA, { 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC } }; + +// turbo - or an EFI System Partition - C12A7328-F81F-11D2-BA4B-00A0C93EC93B +EFI_GUID const GPT_EFISYS_GUID = { 0xC12A7328, 0xF81F, 0x11D2, { 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B } }; + +// zef - Basic Data Partition - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 for foreign OS support +EFI_GUID const GPT_BASICDATA_GUID = { 0xEBD0A0A2, 0xB9E5, 0x4433, { 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7 } }; + +// Microsoft Reserved Partition - E3C9E316-0B5C-4DB8-817DF92DF00215AE +EFI_GUID const GPT_BASICDATA2_GUID = { 0xE3C9E316, 0x0B5C, 0x4DB8, { 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE } }; + + +BVRef newGPTBVRef( int biosdev, int partno, unsigned int blkoff, + const gpt_ent * part, + FSInit initFunc, FSLoadFile loadFunc, + FSReadFile readFunc, + FSGetDirEntry getdirFunc, + FSGetFileBlock getBlockFunc, + FSGetUUID getUUIDFunc, + BVGetDescription getDescriptionFunc, + BVFree bvFreeFunc, + int probe, int type, unsigned int bvrFlags ) +{ + BVRef bvr = (BVRef) malloc( sizeof(*bvr) ); + if ( bvr ) + { + bzero(bvr, sizeof(*bvr)); + + bvr->biosdev = biosdev; + bvr->part_no = partno; + bvr->part_boff = blkoff; + bvr->fs_loadfile = loadFunc; + bvr->fs_readfile = readFunc; + bvr->fs_getdirentry = getdirFunc; + bvr->fs_getfileblock= getBlockFunc; + bvr->fs_getuuid = getUUIDFunc; + bvr->description = getDescriptionFunc; + bvr->type = type; + bvr->bv_free = bvFreeFunc; + // FIXME: UCS-2 -> UTF-8 the name + strlcpy(bvr->name, "----", DPISTRLEN); + if ( (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const*)part->ent_type) == 0) || + (efi_guid_compare(&GPT_HFS_GUID, (EFI_GUID const*)part->ent_type) == 0) ) + strlcpy(bvr->type_name, "GPT HFS+", DPISTRLEN); + else + strlcpy(bvr->type_name, "GPT Unknown", DPISTRLEN); + + /* + if ( part->bootid & FDISK_ACTIVE ) + bvr->flags |= kBVFlagPrimary; + */ + + // Probe the filesystem. + + if ( initFunc ) + { + bvr->flags |= kBVFlagNativeBoot; + + if ( probe && initFunc( bvr ) != 0 ) + { + // filesystem probe failed. + + DEBUG_DISK(("%s: failed probe on dev %x part %d\n", + __FUNCTION__, biosdev, partno)); + + (*bvr->bv_free)(bvr); + bvr = NULL; + } + if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagBootable; + } + } + else if ( readBootSector( biosdev, blkoff, (void *)0x7e00 ) == 0 ) + { + bvr->flags |= kBVFlagForeignBoot; + } + else + { + (*bvr->bv_free)(bvr); + bvr = NULL; + } + } + if (bvr) bvr->flags |= bvrFlags; + return bvr; +} + +//========================================================================== + +/* A note on partition numbers: + * IOKit makes the primary partitions numbers 1-4, and then + * extended partitions are numbered consecutively 5 and up. + * So, for example, if you have two primary partitions and + * one extended partition they will be numbered 1, 2, 5. + */ + +static BVRef diskScanFDiskBootVolumes( int biosdev, int * countPtr ) +{ + const struct fdisk_part * part; + struct DiskBVMap * map; + int partno = -1; + BVRef bvr; +#if UFS_SUPPORT + BVRef booterUFS = NULL; +#endif + int spc; + struct driveInfo di; + boot_drive_info_t *dp; + + /* Initialize disk info */ + if (getDriveInfo(biosdev, &di) != 0) { + return NULL; + } + dp = &di.di; + spc = (dp->params.phys_spt * dp->params.phys_heads); + if (spc == 0) { + /* This is probably a CD-ROM; punt on the geometry. */ + spc = 1; + } + + do { + // Create a new mapping. + + map = (struct DiskBVMap *) malloc( sizeof(*map) ); + if ( map ) + { + map->biosdev = biosdev; + map->bvr = NULL; + map->bvrcnt = 0; + map->next = gDiskBVMap; + gDiskBVMap = map; + + // Create a record for each partition found on the disk. + + while ( getNextFDiskPartition( biosdev, &partno, &part ) ) + { + DEBUG_DISK(("%s: part %d [%x]\n", __FUNCTION__, + partno, part->systid)); + bvr = 0; + + switch ( part->systid ) + { +#if UFS_SUPPORT + case FDISK_UFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect + UFS_FRONT_PORCH/BPS, + part, + UFSInitPartition, + UFSLoadFile, + UFSReadFile, + UFSGetDirEntry, + UFSGetFileBlock, + UFSGetUUID, + UFSGetDescription, + UFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; +#endif + + case FDISK_HFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; + + // turbo - we want the booter type scanned also + case FDISK_BOOTER: + if (part->bootid & FDISK_ACTIVE) + gBIOSBootVolume = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; + +#if UFS_SUPPORT + case FDISK_BOOTER: + booterUFS = newFDiskBVRef( + biosdev, partno, + ((part->relsect + spc - 1) / spc) * spc, + part, + UFSInitPartition, + UFSLoadFile, + UFSReadFile, + UFSGetDirEntry, + UFSGetFileBlock, + UFSGetUUID, + UFSGetDescription, + UFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; +#endif + + case FDISK_FAT32: + case FDISK_DOS12: + case FDISK_DOS16S: + case FDISK_DOS16B: + case FDISK_SMALLFAT32: + case FDISK_DOS16SLBA: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + MSDOSInitPartition, + MSDOSLoadFile, + MSDOSReadFile, + MSDOSGetDirEntry, + MSDOSGetFileBlock, + MSDOSGetUUID, + MSDOSGetDescription, + MSDOSFree, + 0, + kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_NTFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, + NTFSGetUUID, + NTFSGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_LINUX: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, + EX2GetUUID, + EX2GetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_BEFS: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, + BeFSGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_FREEBSD: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, + FreeBSDGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_OPENBSD: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, + OpenBSDGetDescription, + (BVFree)free, + 0, kBIOSDevTypeHardDrive, 0); + break; + + default: + bvr = newFDiskBVRef( + biosdev, partno, + part->relsect, + part, + 0, 0, 0, 0, 0, 0, 0, + (BVFree)free, + 0, + kBIOSDevTypeHardDrive, 0); + break; + } + + if ( bvr ) + { + bvr->next = map->bvr; + map->bvr = bvr; + map->bvrcnt++; + } + } + +#if UFS_SUPPORT + // Booting from a CD with an UFS filesystem embedded + // in a booter partition. + + if ( booterUFS ) + { + if ( map->bvrcnt == 0 ) + { + map->bvr = booterUFS; + map->bvrcnt++; + } + else free( booterUFS ); + } +#endif + } + } while (0); + + /* + * If no FDisk partition, then we will check for + * an Apple partition map elsewhere. + */ +#if UNUSED + if (map->bvrcnt == 0) { + static struct fdisk_part cdpart; + cdpart.systid = 0xCD; + + /* Let's try assuming we are on a hybrid HFS/ISO9660 CD. */ + bvr = newFDiskBVRef( + biosdev, 0, + 0, + &cdpart, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + 0, + kBIOSDevTypeHardDrive); + bvr->next = map->bvr; + map->bvr = bvr; + map->bvrcnt++; + } +#endif + // Actually this should always be true given the above code + if(map == gDiskBVMap) + { + // Don't leave a null map in the chain + if(map->bvrcnt == 0 && map->bvr == NULL) + { + gDiskBVMap = map->next; + free(map); + map = NULL; + } + } + + if (countPtr) *countPtr = map ? map->bvrcnt : 0; + + return map ? map->bvr : NULL; +} + +//========================================================================== + +static BVRef diskScanAPMBootVolumes( int biosdev, int * countPtr ) +{ + struct DiskBVMap * map; + struct Block0 *block0_p; + unsigned int blksize; + unsigned int factor; + void *buffer = malloc(BPS); + + /* Check for alternate block size */ + if (readBytes( biosdev, 0, 0, BPS, buffer ) != 0) { + return NULL; + } + block0_p = buffer; + if (OSSwapBigToHostInt16(block0_p->sbSig) == BLOCK0_SIGNATURE) { + blksize = OSSwapBigToHostInt16(block0_p->sbBlkSize); + if (blksize != BPS) { + free(buffer); + buffer = malloc(blksize); + } + factor = blksize / BPS; + } else { + blksize = BPS; + factor = 1; + } + + do { + // Create a new mapping. + + map = (struct DiskBVMap *) malloc( sizeof(*map) ); + if ( map ) + { + int error; + DPME *dpme_p = (DPME *)buffer; + UInt32 i, npart = UINT_MAX; + BVRef bvr; + + map->biosdev = biosdev; + map->bvr = NULL; + map->bvrcnt = 0; + map->next = gDiskBVMap; + gDiskBVMap = map; + + for (i=0; i<npart; i++) { + error = readBytes( biosdev, (kAPMSector + i) * factor, 0, blksize, buffer ); + + if (error || OSSwapBigToHostInt16(dpme_p->dpme_signature) != DPME_SIGNATURE) { + break; + } + + if (i==0) { + npart = OSSwapBigToHostInt32(dpme_p->dpme_map_entries); + } + /* + printf("name = %s, %s%s %d -> %d [%d -> %d] {%d}\n", + dpme.dpme_name, dpme.dpme_type, (dpme.dpme_flags & DPME_FLAGS_BOOTABLE) ? "(bootable)" : "", + dpme.dpme_pblock_start, dpme.dpme_pblocks, + dpme.dpme_lblock_start, dpme.dpme_lblocks, + dpme.dpme_boot_block); + */ + + if (strcmp(dpme_p->dpme_type, "Apple_HFS") == 0) { + bvr = newAPMBVRef(biosdev, + i, + OSSwapBigToHostInt32(dpme_p->dpme_pblock_start) * factor, + dpme_p, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, 0); + bvr->next = map->bvr; + map->bvr = bvr; + map->bvrcnt++; + } + } + } + } while (0); + + free(buffer); + + if (countPtr) *countPtr = map ? map->bvrcnt : 0; + + return map ? map->bvr : NULL; +} + +//========================================================================== + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +/* + * Trying to figure out the filsystem type of a given partition. + */ +static int probeFileSystem(int biosdev, unsigned int blkoff) +{ + // detected filesystem type; + int result = -1; + int fatbits; + + // Allocating buffer for 4 sectors. + const void * probeBuffer = malloc(PROBEFS_SIZE); + if (probeBuffer == NULL) + goto exit; + + // Reading first 4 sectors of current partition + int error = readBytes(biosdev, blkoff, 0, PROBEFS_SIZE, (void *)probeBuffer); + if (error) + goto exit; + + if (HFSProbe(probeBuffer)) + result = FDISK_HFS; + else if (EX2Probe(probeBuffer)) + result = FDISK_LINUX; + else if (FreeBSDProbe(probeBuffer)) + result = FDISK_FREEBSD; + else if (OpenBSDProbe(probeBuffer)) + result = FDISK_OPENBSD; + else if (NTFSProbe(probeBuffer)) + result = FDISK_NTFS; + else if (BeFSProbe(probeBuffer)) + result = FDISK_BEFS; + else if ( (fatbits = MSDOSProbe(probeBuffer)) ) + { + switch (fatbits) + { + case 32: + default: + result = FDISK_FAT32; + break; + case 16: + result = FDISK_DOS16B; + break; + case 12: + result = FDISK_DOS12; + break; + } + } + else + // Couldn't detect filesystem type + result = 0; + +exit: + if (probeBuffer != NULL) free((void *)probeBuffer); + return result; +} + +static bool isPartitionUsed(gpt_ent * partition) +{ + // + // Ask whether the given partition is used. + // + + return efi_guid_is_null((EFI_GUID const*)partition->ent_type) ? false : true; +} + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +static BVRef diskScanGPTBootVolumes( int biosdev, int * countPtr ) +{ + struct DiskBVMap * map = NULL; + void *buffer = malloc(BPS); + int error; + if ( (error = readBytes( biosdev, /*secno*/0, 0, BPS, buffer )) != 0) { + verbose("Failed to read boot sector from BIOS device %02xh. Error=%d\n", biosdev, error); + goto scanErr; + } + struct REAL_disk_blk0 *fdiskMap = buffer; + if ( OSSwapLittleToHostInt16(fdiskMap->signature) != DISK_SIGNATURE ) + { + verbose("Failed to find boot signature on BIOS device %02xh\n", biosdev); + goto scanErr; + } + + int fdiskID = 0; + unsigned index; + for ( index = 0; index < FDISK_NPART; index++ ) + { + if ( fdiskMap->parts[index].systid ) + { + if ( fdiskMap->parts[index].systid == 0xEE ) + { + // Fail if two 0xEE partitions are present which + // means the FDISK code will wind up parsing it. + if ( fdiskID ) goto scanErr; + + fdiskID = index + 1; + } + } + } + + if ( fdiskID == 0 ) goto scanErr; + verbose("Attempting to read GPT\n"); + + if(readBytes(biosdev, 1, 0, BPS, buffer) != 0) + goto scanErr; + + gpt_hdr *headerMap = buffer; + + // Determine whether the partition header signature is present. + + if ( memcmp(headerMap->hdr_sig, GPT_HDR_SIG, strlen(GPT_HDR_SIG)) ) + { + goto scanErr; + } + + // Determine whether the partition header size is valid. + + UInt32 headerCheck = OSSwapLittleToHostInt32(headerMap->hdr_crc_self); + UInt32 headerSize = OSSwapLittleToHostInt32(headerMap->hdr_size); + + if ( headerSize < offsetof(gpt_hdr, padding) ) + { + goto scanErr; + } + + if ( headerSize > BPS ) + { + goto scanErr; + } + + // Determine whether the partition header checksum is valid. + + headerMap->hdr_crc_self = 0; + + if ( crc32(0, headerMap, headerSize) != headerCheck ) + { + goto scanErr; + } + + // Determine whether the partition entry size is valid. + + UInt64 gptBlock = 0; + UInt32 gptCheck = 0; + UInt32 gptCount = 0; + UInt32 gptID = 0; + gpt_ent * gptMap = 0; + UInt32 gptSize = 0; + + gptBlock = OSSwapLittleToHostInt64(headerMap->hdr_lba_table); + gptCheck = OSSwapLittleToHostInt32(headerMap->hdr_crc_table); + gptCount = OSSwapLittleToHostInt32(headerMap->hdr_entries); + gptSize = OSSwapLittleToHostInt32(headerMap->hdr_entsz); + + if ( gptSize < sizeof(gpt_ent) ) + { + goto scanErr; + } + + // Allocate a buffer large enough to hold one map, rounded to a media block. + free(buffer); + buffer = NULL; + + UInt32 bufferSize = IORound(gptCount * gptSize, BPS); + if(bufferSize == 0) + goto scanErr; + buffer = malloc(bufferSize); + + if(readBytes(biosdev, gptBlock, 0, bufferSize, buffer) != 0) + goto scanErr; + + verbose("Read GPT\n"); + + // Allocate a new map for this BIOS device and insert it into the chain + map = malloc(sizeof(*map)); + map->biosdev = biosdev; + map->bvr = NULL; + map->bvrcnt = 0; + map->next = gDiskBVMap; + gDiskBVMap = map; + + // fdisk like partition type id. + int fsType = 0; + + for(gptID = 1; gptID <= gptCount; ++gptID) + { + BVRef bvr = NULL; + unsigned int bvrFlags = 0; + + // size on disk can be larger than sizeof(gpt_ent) + gptMap = (gpt_ent *) ( buffer + ( (gptID - 1) * gptSize) ); + + // NOTE: EFI_GUID's are in LE and we know we're on an x86. + // The IOGUIDPartitionScheme.cpp code uses byte-based UUIDs, we don't. + + if (isPartitionUsed(gptMap)) + { + char stringuuid[100]; + efi_guid_unparse_upper((EFI_GUID*)gptMap->ent_type, stringuuid); + verbose("Reading GPT partition %d, type %s\n", gptID, stringuuid); + + // Getting fdisk like partition type. + fsType = probeFileSystem(biosdev, gptMap->ent_lba_start); + + if ( (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) || + (efi_guid_compare(&GPT_HFS_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ) + { + bvrFlags = (efi_guid_compare(&GPT_BOOT_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ? kBVFlagBooter : 0; + bvr = newGPTBVRef(biosdev, + gptID, + gptMap->ent_lba_start, + gptMap, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, + kBIOSDevTypeHardDrive, bvrFlags); + } + + // zef - foreign OS support + if ( (efi_guid_compare(&GPT_BASICDATA_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) || + (efi_guid_compare(&GPT_BASICDATA2_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ) + { + switch (fsType) + { + case FDISK_NTFS: + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + 0, 0, 0, 0, 0, 0, NTFSGetDescription, + (BVFree)free, 0, kBIOSDevTypeHardDrive, 0); + break; + + case FDISK_LINUX: + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + 0, 0, 0, 0, 0, 0, EX2GetDescription, + (BVFree)free, 0, kBIOSDevTypeHardDrive, 0); + break; + + default: + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + 0, 0, 0, 0, 0, 0, 0, + (BVFree)free, 0, kBIOSDevTypeHardDrive, 0); + break; + } + + } + + // turbo - save our booter partition + // zef - only on original boot device + if ( (efi_guid_compare(&GPT_EFISYS_GUID, (EFI_GUID const*)gptMap->ent_type) == 0) ) + { + switch (fsType) + { + case FDISK_HFS: + if (readBootSector( biosdev, gptMap->ent_lba_start, (void *)0x7e00 ) == 0) + { + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + HFSInitPartition, + HFSLoadFile, + HFSReadFile, + HFSGetDirEntry, + HFSGetFileBlock, + HFSGetUUID, + HFSGetDescription, + HFSFree, + 0, kBIOSDevTypeHardDrive, kBVFlagEFISystem); + } + break; + + case FDISK_FAT32: + if (testFAT32EFIBootSector( biosdev, gptMap->ent_lba_start, (void *)0x7e00 ) == 0) + { + bvr = newGPTBVRef(biosdev, gptID, gptMap->ent_lba_start, gptMap, + MSDOSInitPartition, + MSDOSLoadFile, + MSDOSReadFile, + MSDOSGetDirEntry, + MSDOSGetFileBlock, + MSDOSGetUUID, + MSDOSGetDescription, + MSDOSFree, + 0, kBIOSDevTypeHardDrive, kBVFlagEFISystem); + } + break; + + if (biosdev == gBIOSDev) + gBIOSBootVolume = bvr; + } + } + + if (bvr) + { + // Fixup bvr with the fake fdisk partition type. + if (fsType > 0) bvr->part_type = fsType; + + bvr->next = map->bvr; + map->bvr = bvr; + ++map->bvrcnt; + } + + } + } + +scanErr: + free(buffer); + + if(map) + { + if(countPtr) *countPtr = map->bvrcnt; + return map->bvr; + } + else + { + if(countPtr) *countPtr = 0; + return NULL; + } +} + +static bool getOSVersion(BVRef bvr, char *str) +{ + bool valid = false; + config_file_t systemVersion; + char dirSpec[512]; + + sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no); + + if (!loadConfigFile(dirSpec, &systemVersion)) + { + valid = true; + } + else + { + sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no); + + if (!loadConfigFile(dirSpec, &systemVersion)) + { + bvr->OSisServer = true; + valid = true; + } + } + + if (valid) + { + const char *val; + int len; + + if (getValueForKey(kProductVersion, &val, &len, &systemVersion)) + { + // getValueForKey uses const char for val + // so copy it and trim + *str = '\0'; + strncat(str, val, MIN(len, 4)); + } + else + valid = false; + } + + if(!valid) + { + int fh = -1; + sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no); + fh = open(dirSpec, 0); + + if (fh >= 0) + { + valid = true; + bvr->OSisInstaller = true; + strcpy(bvr->OSVersion, "10.7"); // 10.7 + + } + else + { + close(fh); + } + } + + return valid; +} + +//========================================================================== + +static void scanFSLevelBVRSettings(BVRef chain) +{ + BVRef bvr; + char dirSpec[512], fileSpec[512]; + char label[BVSTRLEN]; + int ret; + long flags, time; + int fh, fileSize, error; + + for (bvr = chain; bvr; bvr = bvr->next) + { + ret = -1; + error = 0; + + // + // Check for alternate volume label on boot helper partitions. + // + if (bvr->flags & kBVFlagBooter) + { + sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/", BIOS_DEV_UNIT(bvr), bvr->part_no); + strcpy(fileSpec, ".disk_label.contentDetails"); + ret = GetFileInfo(dirSpec, fileSpec, &flags, &time); + if (!ret) + { + fh = open(strcat(dirSpec, fileSpec), 0); + fileSize = file_size(fh); + if (fileSize > 0 && fileSize < BVSTRLEN) + { + if (read(fh, label, fileSize) != fileSize) + error = -1; + } + else + error = -1; + + close(fh); + + if (!error) + { + label[fileSize] = '\0'; + strcpy(bvr->altlabel, label); + } + } + } + + // + // Check for SystemVersion.plist or ServerVersion.plist + // to determine if a volume hosts an installed system. + // + if (bvr->flags & kBVFlagNativeBoot) + { + if (getOSVersion(bvr,bvr->OSVersion) == true) + { + bvr->flags |= kBVFlagSystemVolume; + } + } + + } +} + +void rescanBIOSDevice(int biosdev) +{ + struct DiskBVMap *oldMap = diskResetBootVolumes(biosdev); + CacheReset(); + diskFreeMap(oldMap); + oldMap = NULL; + scanBootVolumes(biosdev, 0); +} + +struct DiskBVMap* diskResetBootVolumes(int biosdev) +{ + struct DiskBVMap * map; + struct DiskBVMap *prevMap = NULL; + for ( map = gDiskBVMap; map; prevMap = map, map = map->next ) { + if ( biosdev == map->biosdev ) { + break; + } + } + if(map != NULL) + { + verbose("Resetting BIOS device %xh\n", biosdev); + // Reset the biosbuf cache + cache_valid = false; + if(map == gDiskBVMap) + gDiskBVMap = map->next; + else if(prevMap != NULL) + prevMap->next = map->next; + else + stop(""); + } + // Return the old map, either to be freed, or reinserted later + return map; +} + +// Frees a DiskBVMap and all of its BootVolume's +void diskFreeMap(struct DiskBVMap *map) +{ + if(map != NULL) + { + while(map->bvr != NULL) + { + BVRef bvr = map->bvr; + map->bvr = bvr->next; + (*bvr->bv_free)(bvr); + } + free(map); + } +} + +BVRef diskScanBootVolumes( int biosdev, int * countPtr ) +{ + struct DiskBVMap * map; + BVRef bvr; + int count = 0; + + // Find an existing mapping for this device. + + for ( map = gDiskBVMap; map; map = map->next ) { + if ( biosdev == map->biosdev ) { + count = map->bvrcnt; + break; + } + } + + if (map == NULL) { + bvr = diskScanGPTBootVolumes(biosdev, &count); + if (bvr == NULL) { + bvr = diskScanFDiskBootVolumes(biosdev, &count); + } + if (bvr == NULL) { + bvr = diskScanAPMBootVolumes(biosdev, &count); + } + if (bvr) + { + scanFSLevelBVRSettings(bvr); + } + } else { + bvr = map->bvr; + } + if (countPtr) *countPtr += count; + return bvr; +} + +BVRef getBVChainForBIOSDev(int biosdev) +{ + BVRef chain = NULL; + struct DiskBVMap * map = NULL; + + for (map = gDiskBVMap; map; map = map->next) + { + if (map->biosdev == biosdev) + { + chain = map->bvr; + break; + } + } + + return chain; +} + +BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count) +{ + BVRef chain = NULL; + BVRef bvr = NULL; + BVRef newBVR = NULL; + BVRef prevBVR = NULL; + + struct DiskBVMap * map = NULL; + int bvCount = 0; + + const char *raw = 0; + char* val = 0; + int len; + + getValueForKey(kHidePartition, &raw, &len, &bootInfo->chameleonConfig); + if(raw) + { + val = XMLDecode(raw); + } + + /* + * Traverse gDISKBVmap to get references for + * individual bvr chains of each drive. + */ + for (map = gDiskBVMap; map; map = map->next) + { + for (bvr = map->bvr; bvr; bvr = bvr->next) + { + /* + * Save the last bvr. + */ + if (newBVR) prevBVR = newBVR; + + /* + * Allocate and copy the matched bvr entry into a new one. + */ + newBVR = (BVRef) malloc(sizeof(*newBVR)); + bcopy(bvr, newBVR, sizeof(*newBVR)); + + /* + * Adjust the new bvr's fields. + */ + newBVR->next = NULL; + newBVR->filtered = true; + + if ( (!allowFlags || newBVR->flags & allowFlags) + && (!denyFlags || !(newBVR->flags & denyFlags) ) + && (newBVR->biosdev >= minBIOSDev && newBVR->biosdev <= maxBIOSDev) + ) + newBVR->visible = true; + + /* + * Looking for "Hide Partition" entries in 'hd(x,y)|uuid|"label" hd(m,n)|uuid|"label"' format, + * to be able to hide foreign partitions from the boot menu. + * + */ + if ( (newBVR->flags & kBVFlagForeignBoot) ) + { + char *start, *next = val; + long len = 0; + do + { + start = strbreak(next, &next, &len); + if(len && matchVolumeToString(newBVR, start, len) ) + newBVR->visible = false; + } + while ( next && *next ); + } + + /* + * Use the first bvr entry as the starting chain pointer. + */ + if (!chain) + chain = newBVR; + + /* + * Update the previous bvr's link pointer to use the new memory area. + */ + if (prevBVR) + prevBVR->next = newBVR; + + if (newBVR->visible) + bvCount++; + } + } + +#if DEBUG //Azi: warning - too big for boot-log.. far too big.. i mean HUGE!! :P + for (bvr = chain; bvr; bvr = bvr->next) + { + printf(" bvr: %d, dev: %d, part: %d, flags: %d, vis: %d\n", bvr, bvr->biosdev, bvr->part_no, bvr->flags, bvr->visible); + } + printf("count: %d\n", bvCount); + getchar(); +#endif + + *count = bvCount; + + free(val); + return chain; +} + +int freeFilteredBVChain(const BVRef chain) +{ + int ret = 1; + BVRef bvr = chain; + BVRef nextBVR = NULL; + + while (bvr) + { + nextBVR = bvr->next; + + if (bvr->filtered) + { + free(bvr); + } + else + { + ret = 0; + break; + } + + bvr = nextBVR; + } + + return ret; +} + +//========================================================================== + +static const struct NamedValue fdiskTypes[] = +{ + { FDISK_NTFS, "Windows NTFS" }, + { FDISK_DOS12, "Windows FAT12" }, + { FDISK_DOS16B, "Windows FAT16" }, + { FDISK_DOS16S, "Windows FAT16" }, + { FDISK_DOS16SLBA, "Windows FAT16" }, + { FDISK_SMALLFAT32, "Windows FAT32" }, + { FDISK_FAT32, "Windows FAT32" }, + { FDISK_FREEBSD, "FreeBSD" }, + { FDISK_OPENBSD, "OpenBSD" }, + { FDISK_LINUX, "Linux" }, + { FDISK_UFS, "Apple UFS" }, + { FDISK_HFS, "Apple HFS" }, + { FDISK_BOOTER, "Apple Boot/UFS" }, + { FDISK_BEFS, "Haiku" }, + { 0xCD, "CD-ROM" }, + { 0x00, 0 } /* must be last */ +}; + +//========================================================================== + +bool matchVolumeToString( BVRef bvr, const char* match, long matchLen) +{ + char testStr[128]; + + if ( !bvr || !match || !*match) + return 0; + + if ( bvr->biosdev < 0x80 || bvr->biosdev >= 0x100 ) + return 0; + + // Try to match hd(x,y) first. + sprintf(testStr, "hd(%d,%d)", BIOS_DEV_UNIT(bvr), bvr->part_no); + if ( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) ) + return true; + + // Try to match volume UUID. + if ( bvr->fs_getuuid && bvr->fs_getuuid(bvr, testStr) == 0) + { + if( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) ) + return true; + } + + // Try to match volume label (always quoted). + if ( bvr->description ) + { + bvr->description(bvr, testStr, sizeof(testStr)-1); + if( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) ) + return true; + } + + return false; +} + +/* If Rename Partition has defined an alias, then extract it for description purpose. + * The format for the rename string is the following: + * hd(x,y)|uuid|"label" "alias";hd(m,n)|uuid|"label" "alias"; etc... + */ + +bool getVolumeLabelAlias(BVRef bvr, char* str, long strMaxLen) +{ + char *aliasList, *entryStart, *entryNext; + + if ( !str || strMaxLen <= 0) + return false; + + aliasList = XMLDecode(getStringForKey(kRenamePartition, &bootInfo->chameleonConfig)); + if ( !aliasList ) + return false; + + for ( entryStart = entryNext = aliasList; + entryNext && *entryNext; + entryStart = entryNext ) + { + char *volStart, *volEnd, *aliasStart; + long volLen, aliasLen; + + // Delimit current entry + entryNext = strchr(entryStart, ';'); + if ( entryNext ) + { + *entryNext = '\0'; + entryNext++; + } + + volStart = strbreak(entryStart, &volEnd, &volLen); + if(!volLen) + continue; + + aliasStart = strbreak(volEnd, 0, &aliasLen); + if(!aliasLen) + continue; + + if ( matchVolumeToString(bvr, volStart, volLen) ) + { + strncat(str, aliasStart, MIN(strMaxLen, aliasLen)); + free(aliasList); + + return true; + } + } + + free(aliasList); + return false; +} + +void getBootVolumeDescription( BVRef bvr, char * str, long strMaxLen, bool useDeviceDescription ) +{ + unsigned char type; + char *p = str; + + if(!bvr || !p || strMaxLen <= 0) + return; + + type = (unsigned char) bvr->part_type; + + if (useDeviceDescription) + { + int len = getDeviceDescription(bvr, str); + if(len >= strMaxLen) + return; + + strcpy(str + len, bvr->OSisInstaller ? " (Installer) " : " "); + len += bvr->OSisInstaller ? 13 : 1; + strMaxLen -= len; + p += len; + } + + /* See if a partition rename is preferred */ + if(getVolumeLabelAlias(bvr, p, strMaxLen)) { + strncpy(bvr->label, p, strMaxLen); + return; // we're done here no need to seek for real name + } + + // + // Get the volume label using filesystem specific functions + // or use the alternate volume label if available. + // + if (*bvr->altlabel != '\0') + strncpy(p, bvr->altlabel, strMaxLen); + else if (bvr->description) + bvr->description(bvr, p, strMaxLen); + + if (*p == '\0') { + const char * name = getNameForValue( fdiskTypes, type ); + if (name == NULL) { + name = bvr->type_name; + } + if (name == NULL) { + sprintf(p, "TYPE %02x", type); + } else { + strncpy(p, name, strMaxLen); + } + } + + // Set the devices label + sprintf(bvr->label, p); +} + +//========================================================================== +int readBootSector( int biosdev, unsigned int secno, void * buffer ) +{ + struct disk_blk0 * bootSector = (struct disk_blk0 *) buffer; + int error; + + if ( bootSector == NULL ) + { + if ( gBootSector == NULL ) + { + gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector)); + if ( gBootSector == NULL ) return -1; + } + bootSector = gBootSector; + } + + error = readBytes( biosdev, secno, 0, BPS, bootSector ); + if ( error || bootSector->signature != DISK_SIGNATURE ) + return -1; + + return 0; +} + +/* + * Format of boot1f32 block. + */ + +#define BOOT1F32_MAGIC "BOOT " +#define BOOT1F32_MAGICLEN 11 + +struct disk_boot1f32_blk { + unsigned char init[3]; + unsigned char fsheader[87]; + unsigned char magic[BOOT1F32_MAGICLEN]; + unsigned char bootcode[409]; + unsigned short signature; +}; + +int testFAT32EFIBootSector( int biosdev, unsigned int secno, void * buffer ) +{ + struct disk_boot1f32_blk * bootSector = (struct disk_boot1f32_blk *) buffer; + int error; + + if ( bootSector == NULL ) + { + if ( gBootSector == NULL ) + { + gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector)); + if ( gBootSector == NULL ) return -1; + } + bootSector = (struct disk_boot1f32_blk *) gBootSector; + } + + error = readBytes( biosdev, secno, 0, BPS, bootSector ); + if ( error || bootSector->signature != DISK_SIGNATURE + || strncmp((const char *)bootSector->magic, BOOT1F32_MAGIC, BOOT1F32_MAGICLEN) ) + return -1; + + return 0; +} + +//========================================================================== +// Handle seek request from filesystem modules. + +void diskSeek( BVRef bvr, long long position ) +{ + bvr->fs_boff = position / BPS; + bvr->fs_byteoff = position % BPS; +} + +//========================================================================== +// Handle read request from filesystem modules. + +int diskRead( BVRef bvr, long addr, long length ) +{ + return readBytes( bvr->biosdev, + bvr->fs_boff + bvr->part_boff, + bvr->fs_byteoff, + length, + (void *) addr ); +} + +int rawDiskRead( BVRef bvr, unsigned int secno, void *buffer, unsigned int len ) +{ + int secs; + unsigned char *cbuf = (unsigned char *)buffer; + unsigned int copy_len; + int rc; + + if ((len & (BPS-1)) != 0) { + error("raw disk read not sector aligned"); + return -1; + } + secno += bvr->part_boff; + + cache_valid = false; + + while (len > 0) { + secs = len / BPS; + if (secs > N_CACHE_SECS) secs = N_CACHE_SECS; + copy_len = secs * BPS; + + //printf("rdr: ebiosread(%d, %d, %d)\n", bvr->biosdev, secno, secs); + if ((rc = ebiosread(bvr->biosdev, secno, secs)) != 0) { + /* Ignore corrected ECC errors */ + if (rc != ECC_CORRECTED_ERR) { + error(" EBIOS read error: %s\n", bios_error(rc), rc); + error(" Block %d Sectors %d\n", secno, secs); + return rc; + } + } + bcopy( trackbuf, cbuf, copy_len ); + len -= copy_len; + cbuf += copy_len; + secno += secs; + spinActivityIndicator(secs); + } + + return 0; +} + +int rawDiskWrite( BVRef bvr, unsigned int secno, void *buffer, unsigned int len ) +{ + int secs; + unsigned char *cbuf = (unsigned char *)buffer; + unsigned int copy_len; + int rc; + + if ((len & (BPS-1)) != 0) { + error("raw disk write not sector aligned"); + return -1; + } + secno += bvr->part_boff; + + cache_valid = false; + + while (len > 0) { + secs = len / BPS; + if (secs > N_CACHE_SECS) secs = N_CACHE_SECS; + copy_len = secs * BPS; + + bcopy( cbuf, trackbuf, copy_len ); + //printf("rdr: ebioswrite(%d, %d, %d)\n", bvr->biosdev, secno, secs); + if ((rc = ebioswrite(bvr->biosdev, secno, secs)) != 0) { + error(" EBIOS write error: %s\n", bios_error(rc), rc); + error(" Block %d Sectors %d\n", secno, secs); + return rc; + } + len -= copy_len; + cbuf += copy_len; + secno += secs; + spinActivityIndicator(secs); + } + + return 0; +} + +int diskIsCDROM(BVRef bvr) +{ + struct driveInfo di; + + if (getDriveInfo(bvr->biosdev, &di) == 0 && di.no_emulation) { + return 1; + } + return 0; +} + +int biosDevIsCDROM(int biosdev) +{ + struct driveInfo di; + + if (getDriveInfo(biosdev, &di) == 0 && di.no_emulation) + { + return 1; + } + return 0; +} diff --git a/i386/libsaio/disk.h b/i386/libsaio/disk.h new file mode 100644 index 0000000..ea1584d --- /dev/null +++ b/i386/libsaio/disk.h @@ -0,0 +1,14 @@ +/* + * disk.h + * Chameleon + * + * Created by Daniel Miranda on 27/07/10. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ +#ifndef __LIBSAIO_DISK_H +#define __LIBSAIO_DISK_H + +bool matchVolumeToString( BVRef bvr, const char* match, long strMaxLen); + +#endif /* __LIBSAIO_DISK_H */ \ No newline at end of file diff --git a/i386/libsaio/dram_controllers.c b/i386/libsaio/dram_controllers.c new file mode 100644 index 0000000..5e7c168 --- /dev/null +++ b/i386/libsaio/dram_controllers.c @@ -0,0 +1,562 @@ +/* + * dram controller access and scan from the pci host controller + * Integrated and adapted for chameleon 2.0 RC5 by Rekursor from bs0d work + * original source comes from: + * + * memtest86 + * + * Released under version 2 of the Gnu Public License. + * By Chris Brady, cbrady@sgi.com + * ---------------------------------------------------- + * MemTest86+ V4.00 Specific code (GPL V2.0) + * By Samuel DEMEULEMEESTER, sdemeule@memtest.org + * http://www.canardpc.com - http://www.memtest.org + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "dram_controllers.h" + +#ifndef DEBUG_DRAM +#define DEBUG_DRAM 0 +#endif + +#if DEBUG_DRAM +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +/* + * Initialise memory controller functions + */ + +// Setup P35 Memory Controller +static void setup_p35(pci_dt_t *dram_dev) +{ + uint32_t dev0; + + // Activate MMR I/O + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + if (!(dev0 & 0x1)) + pci_config_write8(dram_dev->dev.addr, 0x48, (dev0 | 1)); +} + +int nhm_bus = 0x3F; + +// Setup Nehalem Integrated Memory Controller +static void setup_nhm(pci_dt_t *dram_dev) +{ + static long possible_nhm_bus[] = {0xFF, 0x7F, 0x3F}; + unsigned long did, vid; + int i; + + // Nehalem supports Scrubbing + // First, locate the PCI bus where the MCH is located + for(i = 0; i < sizeof(possible_nhm_bus); i++) + { + vid = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), PCI_VENDOR_ID); + did = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), PCI_DEVICE_ID); + vid &= 0xFFFF; + did &= 0xFF00; + + if(vid == 0x8086 && did >= 0x2C00) + nhm_bus = possible_nhm_bus[i]; + } +} + +/* + * Retrieve memory controller fsb functions + */ + + +// Get i965 Memory Speed +static void get_fsb_i965(pci_dt_t *dram_dev) +{ + uint32_t dev0, mch_ratio, mch_cfg, mch_fsb; + + long *ptr; + + // Find Ratio + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + ptr = (long*)(dev0 + 0xC00); + mch_cfg = *ptr & 0xFFFF; + + mch_ratio = 100000; + + switch (mch_cfg & 7) + { + case 0: mch_fsb = 1066; break; + case 1: mch_fsb = 533; break; + default: + case 2: mch_fsb = 800; break; + case 3: mch_fsb = 667; break; + case 4: mch_fsb = 1333; break; + case 6: mch_fsb = 1600; break; + } + + DBG("mch_fsb %d\n", mch_fsb); + + switch (mch_fsb) + { + case 533: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 200000; break; + case 2: mch_ratio = 250000; break; + case 3: mch_ratio = 300000; break; + } + break; + + default: + case 800: + switch ((mch_cfg >> 4) & 7) + { + case 0: mch_ratio = 100000; break; + case 1: mch_ratio = 125000; break; + case 2: mch_ratio = 166667; break; // 1.666666667 + case 3: mch_ratio = 200000; break; + case 4: mch_ratio = 266667; break; // 2.666666667 + case 5: mch_ratio = 333333; break; // 3.333333333 + } + break; + + case 1066: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 100000; break; + case 2: mch_ratio = 125000; break; + case 3: mch_ratio = 150000; break; + case 4: mch_ratio = 200000; break; + case 5: mch_ratio = 250000; break; + } + break; + + case 1333: + switch ((mch_cfg >> 4) & 7) + { + case 2: mch_ratio = 100000; break; + case 3: mch_ratio = 120000; break; + case 4: mch_ratio = 160000; break; + case 5: mch_ratio = 200000; break; + } + break; + + case 1600: + switch ((mch_cfg >> 4) & 7) + { + case 3: mch_ratio = 100000; break; + case 4: mch_ratio = 133333; break; // 1.333333333 + case 5: mch_ratio = 150000; break; + case 6: mch_ratio = 200000; break; + } + break; + } + + DBG("mch_ratio %d\n", mch_ratio); + + // Compute RAM Frequency + Platform.RAM.Frequency = (Platform.CPU.FSBFrequency * mch_ratio) / 100000; + + DBG("ram_fsb %d\n", Platform.RAM.Frequency); + +} + +// Get i965m Memory Speed +static void get_fsb_im965(pci_dt_t *dram_dev) +{ + uint32_t dev0, mch_ratio, mch_cfg, mch_fsb; + + long *ptr; + + // Find Ratio + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + ptr = (long*)(dev0 + 0xC00); + mch_cfg = *ptr & 0xFFFF; + + mch_ratio = 100000; + + switch (mch_cfg & 7) + { + case 1: mch_fsb = 533; break; + default: + case 2: mch_fsb = 800; break; + case 3: mch_fsb = 667; break; + case 6: mch_fsb = 1066; break; + } + + switch (mch_fsb) + { + case 533: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 125000; break; + case 2: mch_ratio = 150000; break; + case 3: mch_ratio = 200000; break; + } + break; + + case 667: + switch ((mch_cfg >> 4)& 7) + { + case 1: mch_ratio = 100000; break; + case 2: mch_ratio = 120000; break; + case 3: mch_ratio = 160000; break; + case 4: mch_ratio = 200000; break; + case 5: mch_ratio = 240000; break; + } + break; + + default: + case 800: + switch ((mch_cfg >> 4) & 7) + { + case 1: mch_ratio = 83333; break; // 0.833333333 + case 2: mch_ratio = 100000; break; + case 3: mch_ratio = 133333; break; // 1.333333333 + case 4: mch_ratio = 166667; break; // 1.666666667 + case 5: mch_ratio = 200000; break; + } + break; + case 1066: + switch ((mch_cfg >> 4)&7) { + case 5: mch_ratio = 150000; break; + case 6: mch_ratio = 200000; break; + } + + } + + // Compute RAM Frequency + Platform.RAM.Frequency = (Platform.CPU.FSBFrequency * mch_ratio) / 100000; +} + + +// Get iCore7 Memory Speed +static void get_fsb_nhm(pci_dt_t *dram_dev) +{ + uint32_t mch_ratio, mc_dimm_clk_ratio; + + // Get the clock ratio + mc_dimm_clk_ratio = pci_config_read16(PCIADDR(nhm_bus, 3, 4), 0x54 ); + mch_ratio = (mc_dimm_clk_ratio & 0x1F); + + // Compute RAM Frequency + Platform.RAM.Frequency = Platform.CPU.FSBFrequency * mch_ratio / 2; +} + +/* + * Retrieve memory controller info functions + */ + +// Get i965 Memory Timings +static void get_timings_i965(pci_dt_t *dram_dev) +{ + // Thanks for CDH optis + uint32_t dev0, c0ckectrl, c1ckectrl, offset; + uint32_t ODT_Control_Register, Precharge_Register, ACT_Register, Read_Register, Misc_Register; + + long *ptr; + + // Read MMR Base Address + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + + ptr = (long*)(dev0 + 0x260); + c0ckectrl = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + 0x660); + c1ckectrl = *ptr & 0xFFFFFFFF; + + // If DIMM 0 not populated, check DIMM 1 + ((c0ckectrl) >> 20 & 0xF) ? (offset = 0) : (offset = 0x400); + + ptr = (long*)(dev0 + offset + 0x29C); + ODT_Control_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x250); + Precharge_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x252); + ACT_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x258); + Read_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x244); + Misc_Register = *ptr & 0xFFFFFFFF; + + // 965 Series only support DDR2 + Platform.RAM.Type = SMB_MEM_TYPE_DDR2; + + // CAS Latency (tCAS) + Platform.RAM.CAS = ((ODT_Control_Register >> 17) & 7) + 3; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = (Read_Register >> 16) & 0xF; + + // RAS Precharge (tRP) + Platform.RAM.TRP = (ACT_Register >> 13) & 0xF; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = (Precharge_Register >> 11) & 0x1F; + + if ((c0ckectrl >> 20 & 0xF) && (c1ckectrl >> 20 & 0xF)) + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; +} + +// Get im965 Memory Timings +static void get_timings_im965(pci_dt_t *dram_dev) +{ + // Thanks for CDH optis + uint32_t dev0, c0ckectrl, c1ckectrl, offset, ODT_Control_Register, Precharge_Register; + long *ptr; + + // Read MMR Base Address + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + + ptr = (long*)(dev0 + 0x1200); + c0ckectrl = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + 0x1300); + c1ckectrl = *ptr & 0xFFFFFFFF; + + // If DIMM 0 not populated, check DIMM 1 + ((c0ckectrl) >> 20 & 0xF) ? (offset = 0) : (offset = 0x100); + + ptr = (long*)(dev0 + offset + 0x121C); + ODT_Control_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x1214); + Precharge_Register = *ptr & 0xFFFFFFFF; + + // Series only support DDR2 + Platform.RAM.Type = SMB_MEM_TYPE_DDR2; + + // CAS Latency (tCAS) + Platform.RAM.CAS = ((ODT_Control_Register >> 23) & 7) + 3; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = ((Precharge_Register >> 5) & 7) + 2; + + // RAS Precharge (tRP) + Platform.RAM.TRP= (Precharge_Register & 7) + 2; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = (Precharge_Register >> 21) & 0x1F; + + if ((c0ckectrl >> 20 & 0xF) && (c1ckectrl >> 20 & 0xF)) + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; +} + +// Get P35 Memory Timings +static void get_timings_p35(pci_dt_t *dram_dev) +{ + // Thanks for CDH optis + unsigned long dev0, Memory_Check, c0ckectrl, c1ckectrl, offset; + unsigned long ODT_Control_Register, Precharge_Register, ACT_Register, Read_Register, Misc_Register; + long *ptr; + + //Device_ID = pci_config_read16(dram_dev->dev.addr, 0x02); + //Device_ID &= 0xFFFF; + + // Now, read MMR Base Address + dev0 = pci_config_read32(dram_dev->dev.addr, 0x48); + dev0 &= 0xFFFFC000; + + ptr = (long*)(dev0 + 0x260); + c0ckectrl = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + 0x660); + c1ckectrl = *ptr & 0xFFFFFFFF; + + // If DIMM 0 not populated, check DIMM 1 + ((c0ckectrl) >> 20 & 0xF) ? (offset = 0) : (offset = 0x400); + + ptr = (long*)(dev0 + offset + 0x265); + ODT_Control_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x25D); + Precharge_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x252); + ACT_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x258); + Read_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x244); + Misc_Register = *ptr & 0xFFFFFFFF; + + ptr = (long*)(dev0 + offset + 0x1E8); + Memory_Check = *ptr & 0xFFFFFFFF; + + // On P45, check 1A8 + if(dram_dev->device_id > 0x2E00) { + ptr = (long*)(dev0 + offset + 0x1A8); + Memory_Check = *ptr & 0xFFFFFFFF; + Memory_Check >>= 2; + Memory_Check &= 1; + Memory_Check = !Memory_Check; + } else { + ptr = (long*)(dev0 + offset + 0x1E8); + Memory_Check = *ptr & 0xFFFFFFFF; + } + + // Determine DDR-II or DDR-III + if (Memory_Check & 1) + Platform.RAM.Type = SMB_MEM_TYPE_DDR2; + else + Platform.RAM.Type = SMB_MEM_TYPE_DDR3; + + // CAS Latency (tCAS) + if(dram_dev->device_id > 0x2E00) + Platform.RAM.CAS = ((ODT_Control_Register >> 8) & 0x3F) - 6; + else + Platform.RAM.CAS = ((ODT_Control_Register >> 8) & 0x3F) - 9; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = (Read_Register >> 17) & 0xF; + + // RAS Precharge (tRP) + Platform.RAM.TRP = (ACT_Register >> 13) & 0xF; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = Precharge_Register & 0x3F; + + // Channel configuration + if (((c0ckectrl >> 20) & 0xF) && ((c1ckectrl >> 20) & 0xF)) + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; +} + +// Get Nehalem Memory Timings +static void get_timings_nhm(pci_dt_t *dram_dev) +{ + unsigned long mc_channel_bank_timing, mc_control, mc_channel_mrs_value; + int fvc_bn = 4; + + // Find which channels are populated + mc_control = pci_config_read16(PCIADDR(nhm_bus, 3, 0), 0x48); + mc_control = (mc_control >> 8) & 0x7; + + // DDR-III + Platform.RAM.Type = SMB_MEM_TYPE_DDR3; + + // Get the first valid channel + if(mc_control & 1) + fvc_bn = 4; + else if(mc_control & 2) + fvc_bn = 5; + else if(mc_control & 7) + fvc_bn = 6; + + // Now, detect timings + mc_channel_bank_timing = pci_config_read32(PCIADDR(nhm_bus, fvc_bn, 0), 0x88); + mc_channel_mrs_value = pci_config_read32(PCIADDR(nhm_bus, fvc_bn, 0), 0x70); + + // CAS Latency (tCAS) + Platform.RAM.CAS = ((mc_channel_mrs_value >> 4) & 0xF ) + 4; + + // RAS-To-CAS (tRCD) + Platform.RAM.TRC = (mc_channel_bank_timing >> 9) & 0xF; + + // RAS Active to precharge (tRAS) + Platform.RAM.RAS = (mc_channel_bank_timing >> 4) & 0x1F; + + // RAS Precharge (tRP) + Platform.RAM.TRP = mc_channel_bank_timing & 0xF; + + // Single , Dual or Triple Channels + if (mc_control == 1 || mc_control == 2 || mc_control == 4 ) + Platform.RAM.Channels = SMB_MEM_CHANNEL_SINGLE; + else if (mc_control == 7) + Platform.RAM.Channels = SMB_MEM_CHANNEL_TRIPLE; + else + Platform.RAM.Channels = SMB_MEM_CHANNEL_DUAL; +} + +static struct mem_controller_t dram_controllers[] = { + + // Default unknown chipset + { 0, 0, "", NULL, NULL, NULL }, + + // Intel + { 0x8086, 0x7190, "VMWare", NULL, NULL, NULL }, + + { 0x8086, 0x1A30, "i845", NULL, NULL, NULL }, + + { 0x8086, 0x2970, "i946PL/GZ", setup_p35, get_fsb_i965, get_timings_i965 }, + { 0x8086, 0x2990, "Q963/Q965", setup_p35, get_fsb_i965, get_timings_i965 }, + { 0x8086, 0x29A0, "P965/G965", setup_p35, get_fsb_i965, get_timings_i965 }, + + { 0x8086, 0x2A00, "GM965/GL960", setup_p35, get_fsb_im965, get_timings_im965 }, + { 0x8086, 0x2A10, "GME965/GLE960", setup_p35, get_fsb_im965, get_timings_im965 }, + { 0x8086, 0x2A40, "PM/GM45/47", setup_p35, get_fsb_im965, get_timings_im965 }, + + { 0x8086, 0x29B0, "Q35", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x29C0, "P35/G33", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x29D0, "Q33", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x29E0, "X38/X48", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E00, "Eaglelake", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E10, "Q45/Q43", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E20, "P45/G45", setup_p35, get_fsb_i965, get_timings_p35 }, + { 0x8086, 0x2E30, "G41", setup_p35, get_fsb_i965, get_timings_p35 }, + + { 0x8086, 0xD131, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0xD132, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3400, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3401, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3402, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3403, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3404, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3405, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3406, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, + { 0x8086, 0x3407, "NHM IMC", setup_nhm, get_fsb_nhm, get_timings_nhm }, +}; + +static const char *memory_channel_types[] = +{ + "Unknown", "Single", "Dual", "Triple" +}; + +void scan_dram_controller(pci_dt_t *dram_dev) +{ + int i; + for(i = 1; i < sizeof(dram_controllers) / sizeof(dram_controllers[0]); i++) + if ((dram_controllers[i].vendor == dram_dev->vendor_id) + && (dram_controllers[i].device == dram_dev->device_id)) + { + verbose("%s%s DRAM Controller [%4x:%4x] at %02x:%02x.%x\n", + (dram_dev->vendor_id == 0x8086) ? "Intel " : "" , + dram_controllers[i].name, dram_dev->vendor_id, dram_dev->device_id, + dram_dev->dev.bits.bus, dram_dev->dev.bits.dev, dram_dev->dev.bits.func); + + if (dram_controllers[i].initialise != NULL) + dram_controllers[i].initialise(dram_dev); + + if (dram_controllers[i].poll_timings != NULL) + dram_controllers[i].poll_timings(dram_dev); + + if (dram_controllers[i].poll_speed != NULL) + dram_controllers[i].poll_speed(dram_dev); + + verbose("Frequency detected: %d MHz (%d) %s Channel \n\tCAS:%d tRC:%d tRP:%d RAS:%d (%d-%d-%d-%d)\n", + (uint32_t)Platform.RAM.Frequency / 1000000, + (uint32_t)Platform.RAM.Frequency / 500000, + memory_channel_types[Platform.RAM.Channels] + ,Platform.RAM.CAS, Platform.RAM.TRC, Platform.RAM.TRP, Platform.RAM.RAS + ,Platform.RAM.CAS, Platform.RAM.TRC, Platform.RAM.TRP, Platform.RAM.RAS + ); +// getchar(); + } +} diff --git a/i386/libsaio/dram_controllers.h b/i386/libsaio/dram_controllers.h new file mode 100644 index 0000000..984f73c --- /dev/null +++ b/i386/libsaio/dram_controllers.h @@ -0,0 +1,32 @@ +/* + * dram controller access and scan from the pci host controller + * Integrated and adapted for chameleon 2.0 RC5 by Rekursor from bs0d work + * original source comes from: + * + * memtest86 + * + * Released under version 2 of the Gnu Public License. + * By Chris Brady, cbrady@sgi.com + * ---------------------------------------------------- + * MemTest86+ V4.00 Specific code (GPL V2.0) + * By Samuel DEMEULEMEESTER, sdemeule@memtest.org + * http://www.canardpc.com - http://www.memtest.org + */ + +#ifndef __LIBSAIO_DRAM_CONTROLLERS_H +#define __LIBSAIO_DRAM_CONTROLLERS_H + +#include "libsaio.h" + +void scan_dram_controller(); + +struct mem_controller_t { + uint16_t vendor; + uint16_t device; + char *name; + void (*initialise)(pci_dt_t *dram_dev); + void (*poll_speed)(pci_dt_t *dram_dev); + void (*poll_timings)(pci_dt_t *dram_dev); +}; + +#endif /* !__LIBSAIO_DRAM_CONTROLLERS_H */ diff --git a/i386/libsaio/efi.h b/i386/libsaio/efi.h new file mode 100644 index 0000000..5ef7a5b --- /dev/null +++ b/i386/libsaio/efi.h @@ -0,0 +1,558 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ + +#ifndef _PEXPERT_I386_EFI_H +#define _PEXPERT_I386_EFI_H + +#include <stdint.h> + +typedef uint8_t EFI_UINT8; +typedef uint16_t EFI_UINT16; +typedef uint32_t EFI_UINT32; +typedef uint64_t EFI_UINT64; + +typedef uint32_t EFI_UINTN; /* natural size for firmware, not kernel */ + +typedef int8_t EFI_INT8; +typedef int16_t EFI_INT16; +typedef int32_t EFI_INT32; +typedef int64_t EFI_INT64; + +typedef int8_t EFI_CHAR8; +typedef int16_t EFI_CHAR16; +typedef int32_t EFI_CHAR32; +typedef int64_t EFI_CHAR64; + +typedef uint32_t EFI_STATUS; +typedef uint8_t EFI_BOOLEAN; +typedef void VOID; + +typedef uint32_t EFI_PTR32; +typedef uint32_t EFI_HANDLE32; + +typedef uint64_t EFI_PTR64; +typedef uint64_t EFI_HANDLE64; +/* + +Portions Copyright 2004, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +*/ + + +// +// Modifiers for EFI Runtime and Boot Services +// +#define EFI_RUNTIMESERVICE +#define EFIAPI +#define IN +#define OUT +#define OPTIONAL + +#define EFI_MAX_BIT 0x80000000 + +// +// Set the upper bit to indicate EFI Error. +// +#define EFIERR(a) (EFI_MAX_BIT | (a)) + +#define EFIWARN(a) (a) +#define EFI_ERROR(a) (((INTN) (a)) < 0) + +#define EFI_SUCCESS 0 +#define EFI_LOAD_ERROR EFIERR (1) +#define EFI_INVALID_PARAMETER EFIERR (2) +#define EFI_UNSUPPORTED EFIERR (3) +#define EFI_BAD_BUFFER_SIZE EFIERR (4) +#define EFI_BUFFER_TOO_SMALL EFIERR (5) +#define EFI_NOT_READY EFIERR (6) +#define EFI_DEVICE_ERROR EFIERR (7) +#define EFI_WRITE_PROTECTED EFIERR (8) +#define EFI_OUT_OF_RESOURCES EFIERR (9) +#define EFI_VOLUME_CORRUPTED EFIERR (10) +#define EFI_VOLUME_FULL EFIERR (11) +#define EFI_NO_MEDIA EFIERR (12) +#define EFI_MEDIA_CHANGED EFIERR (13) +#define EFI_NOT_FOUND EFIERR (14) +#define EFI_ACCESS_DENIED EFIERR (15) +#define EFI_NO_RESPONSE EFIERR (16) +#define EFI_NO_MAPPING EFIERR (17) +#define EFI_TIMEOUT EFIERR (18) +#define EFI_NOT_STARTED EFIERR (19) +#define EFI_ALREADY_STARTED EFIERR (20) +#define EFI_ABORTED EFIERR (21) +#define EFI_ICMP_ERROR EFIERR (22) +#define EFI_TFTP_ERROR EFIERR (23) +#define EFI_PROTOCOL_ERROR EFIERR (24) +#define EFI_INCOMPATIBLE_VERSION EFIERR (25) +#define EFI_SECURITY_VIOLATION EFIERR (26) +#define EFI_CRC_ERROR EFIERR (27) + +#define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1) +#define EFI_WARN_DELETE_FAILURE EFIWARN (2) +#define EFI_WARN_WRITE_FAILURE EFIWARN (3) +#define EFI_WARN_BUFFER_TOO_SMALL EFIWARN (4) + +// +// EFI Specification Revision information +// +#define EFI_SPECIFICATION_MAJOR_REVISION 1 +#define EFI_SPECIFICATION_MINOR_REVISION 10 + +typedef struct { + EFI_UINT32 Data1; + EFI_UINT16 Data2; + EFI_UINT16 Data3; + EFI_UINT8 Data4[8]; +} EFI_GUID; + +#define APPLE_VENDOR_GUID \ + {0xAC39C713, 0x7E50, 0x423D, {0x88, 0x9D, 0x27,0x8F, 0xCC, 0x34, 0x22, 0xB6} } + +#define EFI_GLOBAL_VARIABLE_GUID \ + {0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } + +typedef union { + EFI_GUID Guid; + EFI_UINT8 Raw[16]; +} EFI_GUID_UNION; + +// +// EFI Time Abstraction: +// Year: 2000 - 20XX +// Month: 1 - 12 +// Day: 1 - 31 +// Hour: 0 - 23 +// Minute: 0 - 59 +// Second: 0 - 59 +// Nanosecond: 0 - 999,999,999 +// TimeZone: -1440 to 1440 or 2047 +// +typedef struct { + EFI_UINT16 Year; + EFI_UINT8 Month; + EFI_UINT8 Day; + EFI_UINT8 Hour; + EFI_UINT8 Minute; + EFI_UINT8 Second; + EFI_UINT8 Pad1; + EFI_UINT32 Nanosecond; + EFI_INT16 TimeZone; + EFI_UINT8 Daylight; + EFI_UINT8 Pad2; +} EFI_TIME; + +// +// Bit definitions for EFI_TIME.Daylight +// +#define EFI_TIME_ADJUST_DAYLIGHT 0x01 +#define EFI_TIME_IN_DAYLIGHT 0x02 + +// +// Value definition for EFI_TIME.TimeZone +// +#define EFI_UNSPECIFIED_TIMEZONE 0x07FF + +typedef enum { + EfiReservedMemoryType, + EfiLoaderCode, + EfiLoaderData, + EfiBootServicesCode, + EfiBootServicesData, + EfiRuntimeServicesCode, + EfiRuntimeServicesData, + EfiConventionalMemory, + EfiUnusableMemory, + EfiACPIReclaimMemory, + EfiACPIMemoryNVS, + EfiMemoryMappedIO, + EfiMemoryMappedIOPortSpace, + EfiPalCode, + EfiMaxMemoryType +} EFI_MEMORY_TYPE; + +typedef struct { + EFI_UINT64 Signature; + EFI_UINT32 Revision; + EFI_UINT32 HeaderSize; + EFI_UINT32 CRC32; + EFI_UINT32 Reserved; +} __attribute__((aligned(8))) EFI_TABLE_HEADER; + +// +// possible caching types for the memory range +// +#define EFI_MEMORY_UC 0x0000000000000001ULL +#define EFI_MEMORY_WC 0x0000000000000002ULL +#define EFI_MEMORY_WT 0x0000000000000004ULL +#define EFI_MEMORY_WB 0x0000000000000008ULL +#define EFI_MEMORY_UCE 0x0000000000000010ULL + +// +// physical memory protection on range +// +#define EFI_MEMORY_WP 0x0000000000001000ULL +#define EFI_MEMORY_RP 0x0000000000002000ULL +#define EFI_MEMORY_XP 0x0000000000004000ULL + +// +// range requires a runtime mapping +// +#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL + +typedef EFI_UINT64 EFI_PHYSICAL_ADDRESS; +typedef EFI_UINT64 EFI_VIRTUAL_ADDRESS; + +#define EFI_MEMORY_DESCRIPTOR_VERSION 1 +typedef struct { + EFI_UINT32 Type; + EFI_UINT32 Pad; + EFI_PHYSICAL_ADDRESS PhysicalStart; + EFI_VIRTUAL_ADDRESS VirtualStart; + EFI_UINT64 NumberOfPages; + EFI_UINT64 Attribute; +} __attribute__((aligned(8))) EFI_MEMORY_DESCRIPTOR; + + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) ( + IN EFI_UINTN MemoryMapSize, + IN EFI_UINTN DescriptorSize, + IN EFI_UINT32 DescriptorVersion, + IN EFI_MEMORY_DESCRIPTOR * VirtualMap + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_CONVERT_POINTER) ( + IN EFI_UINTN DebugDisposition, + IN OUT VOID **Address + ) __attribute__((regparm(0))); + +// +// Variable attributes +// +#define EFI_VARIABLE_NON_VOLATILE 0x00000001 +#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 +#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_READ_ONLY 0x00000008 + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_VARIABLE) ( + IN EFI_CHAR16 * VariableName, + IN EFI_GUID * VendorGuid, + OUT EFI_UINT32 * Attributes OPTIONAL, + IN OUT EFI_UINTN * DataSize, + OUT VOID * Data + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) ( + IN OUT EFI_UINTN * VariableNameSize, + IN OUT EFI_CHAR16 * VariableName, + IN OUT EFI_GUID * VendorGuid + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_VARIABLE) ( + IN EFI_CHAR16 * VariableName, + IN EFI_GUID * VendorGuid, + IN EFI_UINT32 Attributes, + IN EFI_UINTN DataSize, + IN VOID * Data + ) __attribute__((regparm(0))); + +// +// EFI Time +// +typedef struct { + EFI_UINT32 Resolution; + EFI_UINT32 Accuracy; + EFI_BOOLEAN SetsToZero; +} __attribute__((aligned(4))) EFI_TIME_CAPABILITIES; + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_TIME) ( + OUT EFI_TIME * Time, + OUT EFI_TIME_CAPABILITIES * Capabilities OPTIONAL + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_TIME) ( + IN EFI_TIME * Time + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_WAKEUP_TIME) ( + OUT EFI_BOOLEAN * Enabled, + OUT EFI_BOOLEAN * Pending, + OUT EFI_TIME * Time + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_SET_WAKEUP_TIME) ( + IN EFI_BOOLEAN Enable, + IN EFI_TIME * Time OPTIONAL + ) __attribute((regparm(0))); + +typedef enum { + EfiResetCold, + EfiResetWarm, + EfiResetShutdown, + +#ifdef TIANO_EXTENSION_FLAG + EfiResetUpdate +#endif + +} EFI_RESET_TYPE; + +typedef +EFI_RUNTIMESERVICE +VOID +(EFIAPI *EFI_RESET_SYSTEM) ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN EFI_UINTN DataSize, + IN EFI_CHAR16 * ResetData OPTIONAL + ) __attribute__((regparm(0))); + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) ( + OUT EFI_UINT32 * HighCount + ) __attribute__((regparm(0))); + +// +// Definition of Status Code extended data header +// +// HeaderSize The size of the architecture. This is specified to enable +// the future expansion +// +// Size The size of the data in bytes. This does not include the size +// of the header structure. +// +// Type A GUID defining the type of the data +// +// +#ifdef TIANO_EXTENSION_FLAG + +typedef +EFI_RUNTIMESERVICE +EFI_STATUS +(EFIAPI *EFI_REPORT_STATUS_CODE) ( + IN EFI_STATUS_CODE_TYPE Type, + IN EFI_STATUS_CODE_VALUE Value, + IN EFI_UINT32 Instance, + IN EFI_GUID * CallerId OPTIONAL, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) __attribute__((regparm(0))); + +#endif +// +// EFI Runtime Services Table +// +#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL +#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION)) + +typedef struct { + EFI_TABLE_HEADER Hdr; + + // + // Time services + // + EFI_PTR32 GetTime; + EFI_PTR32 SetTime; + EFI_PTR32 GetWakeupTime; + EFI_PTR32 SetWakeupTime; + + // + // Virtual memory services + // + EFI_PTR32 SetVirtualAddressMap; + EFI_PTR32 ConvertPointer; + + // + // Variable services + // + EFI_PTR32 GetVariable; + EFI_PTR32 GetNextVariableName; + EFI_PTR32 SetVariable; + + // + // Misc + // + EFI_PTR32 GetNextHighMonotonicCount; + EFI_PTR32 ResetSystem; + +#ifdef TIANO_EXTENSION_FLAG + // + // //////////////////////////////////////////////////// + // Extended EFI Services + ////////////////////////////////////////////////////// + // + EFI_PTR32 ReportStatusCode; +#endif + +} __attribute__((aligned(8))) EFI_RUNTIME_SERVICES_32; + +typedef struct { + EFI_TABLE_HEADER Hdr; + + // + // Time services + // + EFI_PTR64 GetTime; + EFI_PTR64 SetTime; + EFI_PTR64 GetWakeupTime; + EFI_PTR64 SetWakeupTime; + + // + // Virtual memory services + // + EFI_PTR64 SetVirtualAddressMap; + EFI_PTR64 ConvertPointer; + + // + // Variable services + // + EFI_PTR64 GetVariable; + EFI_PTR64 GetNextVariableName; + EFI_PTR64 SetVariable; + + // + // Misc + // + EFI_PTR64 GetNextHighMonotonicCount; + EFI_PTR64 ResetSystem; + +#ifdef TIANO_EXTENSION_FLAG + // + // //////////////////////////////////////////////////// + // Extended EFI Services + ////////////////////////////////////////////////////// + // + EFI_PTR64 ReportStatusCode; +#endif + +} __attribute__((aligned(8))) EFI_RUNTIME_SERVICES_64; + +// +// EFI Configuration Table +// +typedef struct { + EFI_GUID VendorGuid; + EFI_PTR32 VendorTable; +} EFI_CONFIGURATION_TABLE_32; + +typedef struct { + EFI_GUID VendorGuid; + EFI_PTR64 VendorTable; +} __attribute__((aligned(8))) EFI_CONFIGURATION_TABLE_64; + +// +// EFI System Table +// +#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL +#define EFI_SYSTEM_TABLE_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION)) +#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | 00) +#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | 02) +#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | 10) + +typedef struct EFI_SYSTEM_TABLE_32 { + EFI_TABLE_HEADER Hdr; + + EFI_PTR32 FirmwareVendor; + EFI_UINT32 FirmwareRevision; + + EFI_HANDLE32 ConsoleInHandle; + EFI_PTR32 ConIn; + + EFI_HANDLE32 ConsoleOutHandle; + EFI_PTR32 ConOut; + + EFI_HANDLE32 StandardErrorHandle; + EFI_PTR32 StdErr; + + EFI_PTR32 RuntimeServices; + EFI_PTR32 BootServices; + + EFI_UINT32 NumberOfTableEntries; + EFI_PTR32 ConfigurationTable; + +} __attribute__((aligned(8))) EFI_SYSTEM_TABLE_32; + +typedef struct EFI_SYSTEM_TABLE_64 { + EFI_TABLE_HEADER Hdr; + + EFI_PTR64 FirmwareVendor; + EFI_UINT32 FirmwareRevision; + + EFI_UINT32 __pad; + + EFI_HANDLE64 ConsoleInHandle; + EFI_PTR64 ConIn; + + EFI_HANDLE64 ConsoleOutHandle; + EFI_PTR64 ConOut; + + EFI_HANDLE64 StandardErrorHandle; + EFI_PTR64 StdErr; + + EFI_PTR64 RuntimeServices; + EFI_PTR64 BootServices; + + EFI_UINT64 NumberOfTableEntries; + EFI_PTR64 ConfigurationTable; + +} __attribute__((aligned(8))) EFI_SYSTEM_TABLE_64; + +#endif /* _PEXPERT_I386_EFI_H */ diff --git a/i386/libsaio/exfat.c b/i386/libsaio/exfat.c new file mode 100644 index 0000000..197b261 --- /dev/null +++ b/i386/libsaio/exfat.c @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2004 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * dmazar, 14/7/2011 + * support for EXFAT volume label reading + * EXFAT info from: http://www.ntfs.com/exfat-overview.htm + * + * EXFAT shares partition type with NTFS (0x7) and easiest way of + * adding it was through ntfs.c module. All functions here are called + * from similar ntfs.c funcs as fallback (if not NTFS, maybe it's EXFAT). + */ + +#include "libsaio.h" +#include "sl.h" + +#ifndef DEBUG_EXFAT +#define DEBUG_EXFAT 0 +#endif + +#if DEBUG_EXFAT +#define DBG(x...) printf(x) +#define PAUSE() getchar() +#else +#define DBG(x...) +#define PAUSE() +#endif + +#define EXFAT_BBID "EXFAT " +#define EXFAT_BBIDLEN 8 + +#define MAX_BLOCK_SIZE 4096 +#define MAX_CLUSTER_SIZE 32 * 1024 * 1024 + +#define ERROR -1 + + +/* + * boot sector of the partition + * http://www.ntfs.com/exfat-boot-sector.htm + */ +struct exfatbootfile { + u_int8_t reserved1[3]; /* JumpBoot: 0xEB7690 */ + u_int8_t bf_sysid[8]; /* FileSystemName: 'EXFAT ' */ + u_int8_t reserved2[53]; /* MustBeZero */ + u_int64_t bf_prtoff; /* PartitionOffset: In sectors; if 0, shall be ignored */ + u_int64_t bf_vollen; /* VolumeLength: Size of exFAT volume in sectors */ + u_int32_t bf_fatoff; /* FatOffset: In sectors */ + u_int32_t bf_fatlen; /* FatLength: In sectors. May exceed the required space in order to align the second FAT */ + u_int32_t bf_cloff; /* ClusterHeapOffset: In sectors. */ + u_int32_t bf_clcnt; /* ClusterCount: 2^32-11 is the maximum number of clusters could be described. */ + u_int32_t bf_rdircl; /* RootDirectoryCluster. */ + u_int32_t bf_volsn; /* VolumeSerialNumber. */ + u_int16_t bf_fsrev; /* FileSystemRevision: as MAJOR.minor, major revision is high byte, minor is low byte; currently 01.00. */ + u_int16_t bf_volflags; /* VolumeFlags. */ + u_int8_t bf_bpss; /* BytesPerSectorShift: Power of 2. Minimum 9 (512 bytes per sector), maximum 12 (4096 bytes per sector) */ + u_int8_t bf_spcs; /* SectorsPerClusterShift: Power of 2. Minimum 0 (1 sector per cluster), maximum 25 BytesPerSectorShift, so max cluster size is 32 MB */ + u_int8_t bf_nfats; /* NumberOfFats: 2 is for TexFAT only */ + u_int8_t bf_drvs; /* DriveSelect: Extended INT 13h drive number; typically 0x80 */ + u_int8_t bf_pused; /* PercentInUse: 0..100 percentage of allocated clusters rounded down to the integer 0xFF percentage is not available */ + u_int8_t reserved3[7]; /* Reserved */ + u_int8_t bootcode[390]; /* BootCode */ + u_int16_t bf_bsig; /* BootSignature: 0xAA55 */ +}; + +struct direntry_label { + u_int8_t type; /* EntryType: 0x83 (or 0x03 if label is empty) */ + u_int8_t llen; /* CharacterCount: Length in Unicode characters (max 11) */ + u_int16_t label[11]; /* VolumeLabel: Unicode characters (max 11) */ + u_int8_t reserved1[8]; /* Reserved */ +}; + + +/** + * Reads volume label into str. + * Reads boot sector, performs dome checking, loads root dir + * and parses volume label. + */ +void +EXFATGetDescription(CICell ih, char *str, long strMaxLen) +{ + struct exfatbootfile *boot; + u_int32_t bytesPerSector = 0; + u_int32_t sectorsPerCluster = 0; + long long rdirOffset = 0; + char *buf = NULL; + struct direntry_label *dire = NULL; + int loopControl = 0; + + DBG("EXFAT: start %x:%x\n", ih->biosdev, ih->part_no); + + buf = (char *)malloc(MAX_BLOCK_SIZE); + if (buf == 0) + { + goto error; + } + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + // take our boot structure + boot = (struct exfatbootfile *) buf; + + /* + * The first three bytes are an Intel x86 jump instruction. I assume it + * can be the same forms as DOS FAT: + * 0xE9 0x?? 0x?? + * 0xEC 0x?? 0x90 + * where 0x?? means any byte value is OK. + */ + if (boot->reserved1[0] != 0xE9 + && (boot->reserved1[0] != 0xEB || boot->reserved1[2] != 0x90)) + { + goto error; + } + + // Check the "EXFAT " signature. + if (memcmp((const char *)boot->bf_sysid, EXFAT_BBID, EXFAT_BBIDLEN) != 0) + { + goto error; + } + + /* + * Make sure the bytes per sector and sectors per cluster are + * powers of two, and within reasonable ranges. + */ + bytesPerSector = 1 << boot->bf_bpss; /* Just one byte; no swapping needed */ + DBG("EXFAT: bpss=%d, bytesPerSector=%d\n", boot->bf_bpss, bytesPerSector); + if (boot->bf_bpss < 9 || boot->bf_bpss > 12) + { + DBG("EXFAT: invalid bytes per sector shift(%d)\n", boot->bf_bpss); + goto error; + } + + sectorsPerCluster = 1 << boot->bf_spcs; /* Just one byte; no swapping needed */ + DBG("EXFAT: spcs=%d, sectorsPerCluster=%d\n", boot->bf_spcs, sectorsPerCluster); + if (boot->bf_spcs > (25 - boot->bf_bpss)) + { + DBG("EXFAT: invalid sectors per cluster shift (%d)\n", boot->bf_spcs); + goto error; + } + + // calculate root dir cluster offset + rdirOffset = boot->bf_cloff + (boot->bf_rdircl - 2) * sectorsPerCluster; + DBG("EXFAT: rdirOffset=%d\n", rdirOffset); + + // load MAX_BLOCK_SIZE bytes of root dir + Seek(ih, rdirOffset * bytesPerSector); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + DBG("buf 0 1 2 = %x %x %x\n", 0x00ff & buf[0], 0x00ff & buf[1], 0x00ff & buf[2]); + + str[0] = '\0'; + + /* + * Search for volume label dir entry (type 0x83), convert from unicode and put to str. + * Set loopControl var to avoid searching outside of buf. + */ + loopControl = MAX_BLOCK_SIZE / sizeof(struct direntry_label); + dire = (struct direntry_label *)buf; + while (loopControl && dire->type && dire->type != 0x83) + { + dire++; + loopControl--; + } + if (dire->type == 0x83 && dire->llen > 0 && dire->llen <= 11) + { + utf_encodestr( dire->label, (int)dire->llen, (u_int8_t *)str, strMaxLen, OSLittleEndian ); + } + DBG("EXFAT: label=%s\n", str); + + free(buf); + PAUSE(); + return; + + error: + if (buf) free(buf); + DBG("EXFAT: error\n"); + PAUSE(); + return; +} + +/** + * Sets UUID to uuidStr. + * Reads the boot sector, does some checking, generates UUID + * (like the one you get on Windows???) + */ +long EXFATGetUUID(CICell ih, char *uuidStr) +{ + struct exfatbootfile *boot; + void *buf = malloc(MAX_BLOCK_SIZE); + if ( !buf ) + return -1; + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + boot = (struct exfatbootfile *) buf; + + /* + * Check the "EXFAT " signature. + */ + if (memcmp((const char *)boot->bf_sysid, EXFAT_BBID, EXFAT_BBIDLEN) != 0) + return -1; + + // Check for non-null volume serial number + if( !boot->bf_volsn ) + return -1; + + // Use UUID like the one you get on Windows + sprintf(uuidStr, "%04X-%04X", (unsigned short)(boot->bf_volsn >> 16) & 0xFFFF, + (unsigned short)boot->bf_volsn & 0xFFFF); + + DBG("EXFATGetUUID: %x:%x = %s\n", ih->biosdev, ih->part_no, uuidStr); + return 0; +} + +/** + * Returns true if given buffer is the boot rec of the EXFAT volume. + */ +bool EXFATProbe(const void * buffer) +{ + bool result = false; + + // boot sector structure + const struct exfatbootfile * boot = buffer; + + // Looking for EXFAT signature. + if (memcmp((const char *)boot->bf_sysid, EXFAT_BBID, EXFAT_BBIDLEN) == 0) + result = true; + + DBG("EXFATProbe: %d\n", result ? 1 : 0); + return result; +} diff --git a/i386/libsaio/exfat.h b/i386/libsaio/exfat.h new file mode 100644 index 0000000..ce36a59 --- /dev/null +++ b/i386/libsaio/exfat.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * dmazar, 14/7/2011 + * support for EXFAT volume label reading + * + */ + +extern void EXFATGetDescription(CICell ih, char *str, long strMaxLen); +extern bool EXFATProbe (const void *buf); +extern long EXFATGetUUID(CICell ih, char *uuidStr); diff --git a/i386/libsaio/ext2fs.c b/i386/libsaio/ext2fs.c new file mode 100644 index 0000000..3051e49 --- /dev/null +++ b/i386/libsaio/ext2fs.c @@ -0,0 +1,71 @@ +/* + * ext2fs.c + * + * + * Created by mackerintel on 1/26/09. + * Copyright 2009 __MyCompanyName__. All rights reserved. + * + */ + +#include "libsaio.h" +#include "sl.h" +#include "ext2fs.h" + +#define EX2ProbeSize 2048 + +bool EX2Probe (const void *buf) +{ + return (OSReadLittleInt16(buf+0x438,0)==0xEF53); +} + +void EX2GetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc (EX2ProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, EX2ProbeSize); + if (!EX2Probe (buf)) + { + free (buf); + return; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x478, MIN(strMaxLen, 16)); + free (buf); +} + +long EX2GetUUID(CICell ih, char *uuidStr) +{ + uint8_t *b, *buf=malloc (EX2ProbeSize); + if (!buf) + return -1; + Seek(ih, 0); + Read(ih, (long)buf, EX2ProbeSize); + if (!EX2Probe (buf)) + { + free (buf); + return -1; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return -1; + } + b=buf+0x468; + sprintf(uuidStr, + "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", + b[0], b[1], b[2], b[3], + b[4], b[5], + b[6], b[7], + b[8], b[9], + b[10], b[11], b[12], b[13], b[14], b[15]); + free (buf); + return 0; +} diff --git a/i386/libsaio/ext2fs.h b/i386/libsaio/ext2fs.h new file mode 100644 index 0000000..2a83698 --- /dev/null +++ b/i386/libsaio/ext2fs.h @@ -0,0 +1,12 @@ +/* + * ext2fs.h + * + * + * Created by mackerintel on 1/26/09. + * Copyright 2009 __MyCompanyName__. All rights reserved. + * + */ + +extern bool EX2Probe (const void *buf); +extern void EX2GetDescription(CICell ih, char *str, long strMaxLen); +extern long EX2GetUUID(CICell ih, char *uuidStr); diff --git a/i386/libsaio/fake_efi.c b/i386/libsaio/fake_efi.c new file mode 100644 index 0000000..cae3d91 --- /dev/null +++ b/i386/libsaio/fake_efi.c @@ -0,0 +1,769 @@ + +/* + * Copyright 2007 David F. Elliott. All rights reserved. + */ + +#include "saio_types.h" +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "efi.h" +#include "acpi.h" +#include "fake_efi.h" +#include "efi_tables.h" +#include "platform.h" +#include "acpi_patcher.h" +#include "smbios.h" +#include "device_inject.h" +#include "convert.h" +#include "pci.h" +#include "sl.h" + +extern void setup_pci_devs(pci_dt_t *pci_dt); + +/* + * Modern Darwin kernels require some amount of EFI because Apple machines all + * have EFI. Modifying the kernel source to not require EFI is of course + * possible but would have to be maintained as a separate patch because it is + * unlikely that Apple wishes to add legacy support to their kernel. + * + * As you can see from the Apple-supplied code in bootstruct.c, it seems that + * the intention was clearly to modify this booter to provide EFI-like structures + * to the kernel rather than modifying the kernel to handle non-EFI stuff. This + * makes a lot of sense from an engineering point of view as it means the kernel + * for the as yet unreleased EFI-only Macs could still be booted by the non-EFI + * DTK systems so long as the kernel checked to ensure the boot tables were + * filled in appropriately. Modern xnu requires a system table and a runtime + * services table and performs no checks whatsoever to ensure the pointers to + * these tables are non-NULL. Therefore, any modern xnu kernel will page fault + * early on in the boot process if the system table pointer is zero. + * + * Even before that happens, the tsc_init function in modern xnu requires the FSB + * Frequency to be a property in the /efi/platform node of the device tree or else + * it panics the bootstrap process very early on. + * + * As of this writing, the current implementation found here is good enough + * to make the currently available xnu kernel boot without modification on a + * system with an appropriate processor. With a minor source modification to + * the tsc_init function to remove the explicit check for Core or Core 2 + * processors the kernel can be made to boot on other processors so long as + * the code can be executed by the processor and the machine contains the + * necessary hardware. + */ + +/*========================================================================== + * Utility function to make a device tree string from an EFI_GUID + */ +static inline char * mallocStringForGuid(EFI_GUID const *pGuid) +{ + char *string = malloc(37); + efi_guid_unparse_upper(pGuid, string); + return string; +} + +/*========================================================================== + * Function to map 32 bit physical address to 64 bit virtual address + */ +static uint64_t ptov64(uint32_t addr) +{ + return ((uint64_t)addr | 0xFFFFFF8000000000ULL); +} + +/*========================================================================== + * Fake EFI implementation + */ + +/* Identify ourselves as the EFI firmware vendor */ +static EFI_CHAR16 const FIRMWARE_VENDOR[] = {'C','h','a','m','e','l','e','o','n','_','2','.','2', 0}; +static EFI_UINT32 const FIRMWARE_REVISION = 132; /* FIXME: Find a constant for this. */ + +/* Default platform system_id (fix by IntVar) */ +static EFI_CHAR8 const SYSTEM_ID[] = "0123456789ABCDEF"; //random value gen by uuidgen + +/* Just a ret instruction */ +static uint8_t const VOIDRET_INSTRUCTIONS[] = {0xc3}; + +/* movl $0x80000003,%eax; ret */ +static uint8_t const UNSUPPORTEDRET_INSTRUCTIONS_32[] = {0xb8, 0x03, 0x00, 0x00, 0x80, 0xc3}; +static uint8_t const UNSUPPORTEDRET_INSTRUCTIONS_64[] = {0x48, 0xb8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc3}; + +EFI_SYSTEM_TABLE_32 *gST32 = NULL; +EFI_SYSTEM_TABLE_64 *gST64 = NULL; +Node *gEfiConfigurationTableNode = NULL; + +extern EFI_STATUS addConfigurationTable(EFI_GUID const *pGuid, void *table, char const *alias) +{ + EFI_UINTN i = 0; + + //Azi: as is, cpu's with em64t will use EFI64 on pre 10.6 systems, + // wich seems to cause no problem. In case it does, force i386 arch. + if (archCpuType == CPU_TYPE_I386) + { + i = gST32->NumberOfTableEntries; + } + else + { + i = gST64->NumberOfTableEntries; + } + + // We only do adds, not modifications and deletes like InstallConfigurationTable + if (i >= MAX_CONFIGURATION_TABLE_ENTRIES) + stop("Ran out of space for configuration tables. Increase the reserved size in the code.\n"); + + if (pGuid == NULL) + return EFI_INVALID_PARAMETER; + + if (table != NULL) + { + // FIXME + //((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorGuid = *pGuid; + //((EFI_CONFIGURATION_TABLE_64 *)gST->ConfigurationTable)[i].VendorTable = (EFI_PTR64)table; + + //++gST->NumberOfTableEntries; + + Node *tableNode = DT__AddChild(gEfiConfigurationTableNode, mallocStringForGuid(pGuid)); + + // Use the pointer to the GUID we just stuffed into the system table + DT__AddProperty(tableNode, "guid", sizeof(EFI_GUID), (void*)pGuid); + + // The "table" property is the 32-bit (in our implementation) physical address of the table + DT__AddProperty(tableNode, "table", sizeof(void*) * 2, table); + + // Assume the alias pointer is a global or static piece of data + if (alias != NULL) + DT__AddProperty(tableNode, "alias", strlen(alias)+1, (char*)alias); + + return EFI_SUCCESS; + } + return EFI_UNSUPPORTED; +} + +//Azi: crc32 done in place, on the cases were it wasn't. +/*static inline void fixupEfiSystemTableCRC32(EFI_SYSTEM_TABLE_64 *efiSystemTable) +{ + efiSystemTable->Hdr.CRC32 = 0; + efiSystemTable->Hdr.CRC32 = crc32(0L, efiSystemTable, efiSystemTable->Hdr.HeaderSize); +}*/ + +/* + * What we do here is simply allocate a fake EFI system table and a fake EFI + * runtime services table. + * + * Because we build against modern headers with kBootArgsRevision 4 we + * also take care to set efiMode = 32. + */ +void setupEfiTables32(void) +{ + // We use the fake_efi_pages struct so that we only need to do one kernel + // memory allocation for all needed EFI data. Otherwise, small allocations + // like the FIRMWARE_VENDOR string would take up an entire page. + // NOTE WELL: Do NOT assume this struct has any particular layout within itself. + // It is absolutely not intended to be publicly exposed anywhere + // We say pages (plural) although right now we are well within the 1 page size + // and probably will stay that way. + struct fake_efi_pages + { + EFI_SYSTEM_TABLE_32 efiSystemTable; + EFI_RUNTIME_SERVICES_32 efiRuntimeServices; + EFI_CONFIGURATION_TABLE_32 efiConfigurationTable[MAX_CONFIGURATION_TABLE_ENTRIES]; + EFI_CHAR16 firmwareVendor[sizeof(FIRMWARE_VENDOR)/sizeof(EFI_CHAR16)]; + uint8_t voidret_instructions[sizeof(VOIDRET_INSTRUCTIONS)/sizeof(uint8_t)]; + uint8_t unsupportedret_instructions[sizeof(UNSUPPORTEDRET_INSTRUCTIONS_32)/sizeof(uint8_t)]; + }; + + struct fake_efi_pages *fakeEfiPages = (struct fake_efi_pages*)AllocateKernelMemory(sizeof(struct fake_efi_pages)); + + // Zero out all the tables in case fields are added later + //bzero(fakeEfiPages, sizeof(struct fake_efi_pages)); + + // -------------------------------------------------------------------- + // Initialize some machine code that will return EFI_UNSUPPORTED for + // functions returning int and simply return for void functions. + memcpy(fakeEfiPages->voidret_instructions, VOIDRET_INSTRUCTIONS, sizeof(VOIDRET_INSTRUCTIONS)); + memcpy(fakeEfiPages->unsupportedret_instructions, UNSUPPORTEDRET_INSTRUCTIONS_32, sizeof(UNSUPPORTEDRET_INSTRUCTIONS_32)); + + // -------------------------------------------------------------------- + // System table + EFI_SYSTEM_TABLE_32 *efiSystemTable = gST32 = &fakeEfiPages->efiSystemTable; + efiSystemTable->Hdr.Signature = EFI_SYSTEM_TABLE_SIGNATURE; + efiSystemTable->Hdr.Revision = EFI_SYSTEM_TABLE_REVISION; + efiSystemTable->Hdr.HeaderSize = sizeof(EFI_SYSTEM_TABLE_32); + efiSystemTable->Hdr.CRC32 = 0; // Initialize to zero and then do CRC32 + efiSystemTable->Hdr.Reserved = 0; + + efiSystemTable->FirmwareVendor = (EFI_PTR32)&fakeEfiPages->firmwareVendor; + memcpy(fakeEfiPages->firmwareVendor, FIRMWARE_VENDOR, sizeof(FIRMWARE_VENDOR)); + efiSystemTable->FirmwareRevision = FIRMWARE_REVISION; + + // XXX: We may need to have basic implementations of ConIn/ConOut/StdErr + // The EFI spec states that all handles are invalid after boot services have been + // exited so we can probably get by with leaving the handles as zero. + efiSystemTable->ConsoleInHandle = 0; + efiSystemTable->ConIn = 0; + + efiSystemTable->ConsoleOutHandle = 0; + efiSystemTable->ConOut = 0; + + efiSystemTable->StandardErrorHandle = 0; + efiSystemTable->StdErr = 0; + + efiSystemTable->RuntimeServices = (EFI_PTR32)&fakeEfiPages->efiRuntimeServices; + + // According to the EFI spec, BootServices aren't valid after the + // boot process is exited so we can probably do without it. + // Apple didn't provide a definition for it in pexpert/i386/efi.h + // so I'm guessing they don't use it. + efiSystemTable->BootServices = 0; + + efiSystemTable->NumberOfTableEntries = 0; + efiSystemTable->ConfigurationTable = (EFI_PTR32)fakeEfiPages->efiConfigurationTable; + + // We're done. Now CRC32 the thing so the kernel will accept it. + // Must be initialized to zero before CRC32, done above. + gST32->Hdr.CRC32 = crc32(0L, gST32, gST32->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Runtime services + EFI_RUNTIME_SERVICES_32 *efiRuntimeServices = &fakeEfiPages->efiRuntimeServices; + efiRuntimeServices->Hdr.Signature = EFI_RUNTIME_SERVICES_SIGNATURE; + efiRuntimeServices->Hdr.Revision = EFI_RUNTIME_SERVICES_REVISION; + efiRuntimeServices->Hdr.HeaderSize = sizeof(EFI_RUNTIME_SERVICES_32); + efiRuntimeServices->Hdr.CRC32 = 0; + efiRuntimeServices->Hdr.Reserved = 0; + + // There are a number of function pointers in the efiRuntimeServices table. + // These are the Foundation (e.g. core) services and are expected to be present on + // all EFI-compliant machines. Some kernel extensions (notably AppleEFIRuntime) + // will call these without checking to see if they are null. + // + // We don't really feel like doing an EFI implementation in the bootloader + // but it is nice if we can at least prevent a complete crash by + // at least providing some sort of implementation until one can be provided + // nicely in a kext. + void (*voidret_fp)() = (void*)fakeEfiPages->voidret_instructions; + void (*unsupportedret_fp)() = (void*)fakeEfiPages->unsupportedret_instructions; + efiRuntimeServices->GetTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetWakeupTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetWakeupTime = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetVirtualAddressMap = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->ConvertPointer = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetVariable = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetNextVariableName = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->SetVariable = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->GetNextHighMonotonicCount = (EFI_PTR32)unsupportedret_fp; + efiRuntimeServices->ResetSystem = (EFI_PTR32)voidret_fp; + + // We're done. Now CRC32 the thing so the kernel will accept it + efiRuntimeServices->Hdr.CRC32 = crc32(0L, efiRuntimeServices, efiRuntimeServices->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Finish filling in the rest of the boot args that we need. + bootArgs->efiSystemTable = (uint32_t)efiSystemTable; + bootArgs->efiMode = kBootArgsEfiMode32; + + // The bootArgs structure as a whole is bzero'd so we don't need to fill in + // things like efiRuntimeServices* and what not. + // + // In fact, the only code that seems to use that is the hibernate code so it + // knows not to save the pages. It even checks to make sure its nonzero. +} + +void setupEfiTables64(void) +{ + struct fake_efi_pages + { + EFI_SYSTEM_TABLE_64 efiSystemTable; + EFI_RUNTIME_SERVICES_64 efiRuntimeServices; + EFI_CONFIGURATION_TABLE_64 efiConfigurationTable[MAX_CONFIGURATION_TABLE_ENTRIES]; + EFI_CHAR16 firmwareVendor[sizeof(FIRMWARE_VENDOR)/sizeof(EFI_CHAR16)]; + uint8_t voidret_instructions[sizeof(VOIDRET_INSTRUCTIONS)/sizeof(uint8_t)]; + uint8_t unsupportedret_instructions[sizeof(UNSUPPORTEDRET_INSTRUCTIONS_64)/sizeof(uint8_t)]; + }; + + struct fake_efi_pages *fakeEfiPages = (struct fake_efi_pages*)AllocateKernelMemory(sizeof(struct fake_efi_pages)); + + // Zero out all the tables in case fields are added later + //bzero(fakeEfiPages, sizeof(struct fake_efi_pages)); + + // -------------------------------------------------------------------- + // Initialize some machine code that will return EFI_UNSUPPORTED for + // functions returning int and simply return for void functions. + memcpy(fakeEfiPages->voidret_instructions, VOIDRET_INSTRUCTIONS, sizeof(VOIDRET_INSTRUCTIONS)); + memcpy(fakeEfiPages->unsupportedret_instructions, UNSUPPORTEDRET_INSTRUCTIONS_64, sizeof(UNSUPPORTEDRET_INSTRUCTIONS_64)); + + // -------------------------------------------------------------------- + // System table + EFI_SYSTEM_TABLE_64 *efiSystemTable = gST64 = &fakeEfiPages->efiSystemTable; + efiSystemTable->Hdr.Signature = EFI_SYSTEM_TABLE_SIGNATURE; + efiSystemTable->Hdr.Revision = EFI_SYSTEM_TABLE_REVISION; + efiSystemTable->Hdr.HeaderSize = sizeof(EFI_SYSTEM_TABLE_64); + efiSystemTable->Hdr.CRC32 = 0; // Initialize to zero and then do CRC32 + efiSystemTable->Hdr.Reserved = 0; + + efiSystemTable->FirmwareVendor = ptov64((EFI_PTR32)&fakeEfiPages->firmwareVendor); + memcpy(fakeEfiPages->firmwareVendor, FIRMWARE_VENDOR, sizeof(FIRMWARE_VENDOR)); + efiSystemTable->FirmwareRevision = FIRMWARE_REVISION; + + // XXX: We may need to have basic implementations of ConIn/ConOut/StdErr + // The EFI spec states that all handles are invalid after boot services have been + // exited so we can probably get by with leaving the handles as zero. + efiSystemTable->ConsoleInHandle = 0; + efiSystemTable->ConIn = 0; + + efiSystemTable->ConsoleOutHandle = 0; + efiSystemTable->ConOut = 0; + + efiSystemTable->StandardErrorHandle = 0; + efiSystemTable->StdErr = 0; + + efiSystemTable->RuntimeServices = ptov64((EFI_PTR32)&fakeEfiPages->efiRuntimeServices); + // According to the EFI spec, BootServices aren't valid after the + // boot process is exited so we can probably do without it. + // Apple didn't provide a definition for it in pexpert/i386/efi.h + // so I'm guessing they don't use it. + efiSystemTable->BootServices = 0; + + efiSystemTable->NumberOfTableEntries = 0; + efiSystemTable->ConfigurationTable = ptov64((EFI_PTR32)fakeEfiPages->efiConfigurationTable); + + // We're done. Now CRC32 the thing so the kernel will accept it + gST64->Hdr.CRC32 = crc32(0L, gST64, gST64->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Runtime services + EFI_RUNTIME_SERVICES_64 *efiRuntimeServices = &fakeEfiPages->efiRuntimeServices; + efiRuntimeServices->Hdr.Signature = EFI_RUNTIME_SERVICES_SIGNATURE; + efiRuntimeServices->Hdr.Revision = EFI_RUNTIME_SERVICES_REVISION; + efiRuntimeServices->Hdr.HeaderSize = sizeof(EFI_RUNTIME_SERVICES_64); + efiRuntimeServices->Hdr.CRC32 = 0; + efiRuntimeServices->Hdr.Reserved = 0; + + // There are a number of function pointers in the efiRuntimeServices table. + // These are the Foundation (e.g. core) services and are expected to be present on + // all EFI-compliant machines. Some kernel extensions (notably AppleEFIRuntime) + // will call these without checking to see if they are null. + // + // We don't really feel like doing an EFI implementation in the bootloader + // but it is nice if we can at least prevent a complete crash by + // at least providing some sort of implementation until one can be provided + // nicely in a kext. + + void (*voidret_fp)() = (void*)fakeEfiPages->voidret_instructions; + void (*unsupportedret_fp)() = (void*)fakeEfiPages->unsupportedret_instructions; + efiRuntimeServices->GetTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetWakeupTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetWakeupTime = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetVirtualAddressMap = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->ConvertPointer = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetVariable = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetNextVariableName = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->SetVariable = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->GetNextHighMonotonicCount = ptov64((EFI_PTR32)unsupportedret_fp); + efiRuntimeServices->ResetSystem = ptov64((EFI_PTR32)voidret_fp); + + // We're done. Now CRC32 the thing so the kernel will accept it + efiRuntimeServices->Hdr.CRC32 = crc32(0L, efiRuntimeServices, efiRuntimeServices->Hdr.HeaderSize); + + // -------------------------------------------------------------------- + // Finish filling in the rest of the boot args that we need. + bootArgs->efiSystemTable = (uint32_t)efiSystemTable; + bootArgs->efiMode = kBootArgsEfiMode64; + + // The bootArgs structure as a whole is bzero'd so we don't need to fill in + // things like efiRuntimeServices* and what not. + // + // In fact, the only code that seems to use that is the hibernate code so it + // knows not to save the pages. It even checks to make sure its nonzero. +} + +/* + * In addition to the EFI tables there is also the EFI device tree node. + * In particular, we need /efi/platform to have an FSBFrequency key. Without it, + * the tsc_init function will panic very early on in kernel startup, before + * the console is available. + */ + +/*========================================================================== + * FSB Frequency detection + */ + +/* These should be const but DT__AddProperty takes char* */ +static const char TSC_Frequency_prop[] = "TSCFrequency"; +static const char FSB_Frequency_prop[] = "FSBFrequency"; +static const char CPU_Frequency_prop[] = "CPUFrequency"; + +/*========================================================================== + * SMBIOS + */ + +/* From Foundation/Efi/Guid/Smbios/SmBios.c */ +EFI_GUID const gEfiSmbiosTableGuid = EFI_SMBIOS_TABLE_GUID; + +#define SMBIOS_RANGE_START 0x000F0000 +#define SMBIOS_RANGE_END 0x000FFFFF + +/* '_SM_' in little endian: */ +#define SMBIOS_ANCHOR_UINT32_LE 0x5f4d535f + +#define EFI_ACPI_TABLE_GUID \ +{ \ + 0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ +} + +#define EFI_ACPI_20_TABLE_GUID \ +{ \ + 0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ +} + +EFI_GUID gEfiAcpiTableGuid = EFI_ACPI_TABLE_GUID; +EFI_GUID gEfiAcpi20TableGuid = EFI_ACPI_20_TABLE_GUID; + + +/*========================================================================== + * Fake EFI implementation + */ + +/* These should be const but DT__AddProperty takes char* */ +static const char FIRMWARE_REVISION_PROP[] = "firmware-revision"; +static const char FIRMWARE_ABI_PROP[] = "firmware-abi"; +static const char FIRMWARE_VENDOR_PROP[] = "firmware-vendor"; +static const char FIRMWARE_ABI_32_PROP_VALUE[] = "EFI32"; +static const char FIRMWARE_ABI_64_PROP_VALUE[] = "EFI64"; +static const char SYSTEM_ID_PROP[] = "system-id"; +static const char SYSTEM_SERIAL_PROP[] = "SystemSerialNumber"; +static const char SYSTEM_TYPE_PROP[] = "system-type"; +static const char MODEL_PROP[] = "Model"; +static const char BOARDID_PROP[] = "board-id"; + +/* + * Get an smbios option string option to convert to EFI_CHAR16 string + */ +static EFI_CHAR16* getSmbiosChar16(const char * key, size_t* len) +{ + const char *src = getStringForKey(key, &bootInfo->smbiosConfig); + EFI_CHAR16* dst = 0; + size_t i = 0; + + if (!key || !(*key) || !len || !src) return 0; + + *len = strlen(src); + dst = (EFI_CHAR16*) malloc( ((*len)+1) * 2 ); + for (; i < (*len); i++) dst[i] = src[i]; + dst[(*len)] = '\0'; + *len = ((*len)+1)*2; // return the CHAR16 bufsize in cluding zero terminated CHAR16 + return dst; +} + +/* + * Get the SystemID from the bios dmi info + */ +static EFI_CHAR8* getSmbiosUUID() +{ + static EFI_CHAR8 uuid[UUID_LEN]; + int i, isZero, isOnes; + SMBByte *p; + + p = (SMBByte*)Platform.UUID; + + for (i=0, isZero=1, isOnes=1; i<UUID_LEN; i++) + { + if (p[i] != 0x00) isZero = 0; + if (p[i] != 0xff) isOnes = 0; + } + + if (isZero || isOnes) // empty or setable means: no uuid present + { + verbose("No UUID present in SMBIOS System Information Table\n"); + return 0; + } + + memcpy(uuid, p, UUID_LEN); + return uuid; +} + +/* + * return a binary UUID value from the overriden SystemID and SMUUID if found, + * or from the bios if not, or from a fixed value if no bios value is found + */ +static EFI_CHAR8* getSystemID() +{ + // unable to determine UUID for host. Error: 35 fix + // Rek: new SMsystemid option conforming to smbios notation standards, this option should + // belong to smbios config only ... + const char *sysId = getStringForKey(kSystemID, &bootInfo->chameleonConfig); + EFI_CHAR8* ret = getUUIDFromString(sysId); + + if (!sysId || !ret) // try bios dmi info UUID extraction + { + ret = getSmbiosUUID(); + sysId = 0; + } + + if (!ret) // no bios dmi UUID available, set a fixed value for system-id + ret=getUUIDFromString((sysId = (const char*) SYSTEM_ID)); + + verbose("Customizing SystemID with : %s\n", getStringFromUUID(ret)); // apply a nice formatting to the displayed output + return ret; +} + +/* + * Must be called AFTER setup Acpi because we need to take care of correct + * facp content to reflect in ioregs + */ +void setupSystemType() +{ + Node *node = DT__FindNode("/", false); + if (node == 0) stop("Couldn't get root node"); + // we need to write this property after facp parsing + // Export system-type only if it has been overrriden by the SystemType option + DT__AddProperty(node, SYSTEM_TYPE_PROP, sizeof(Platform.Type), &Platform.Type); +} + +void setupEfiDeviceTree(void) +{ + EFI_CHAR8* ret = 0; + EFI_CHAR16* ret16 = 0; + size_t len = 0; + Node *node; + + node = DT__FindNode("/", false); + + if (node == 0) stop("Couldn't get root node"); + + // We could also just do DT__FindNode("/efi/platform", true) + // But I think eventually we want to fill stuff in the efi node + // too so we might as well create it so we have a pointer for it too. + node = DT__AddChild(node, "efi"); + + if (archCpuType == CPU_TYPE_I386) + { + DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_32_PROP_VALUE), (char*)FIRMWARE_ABI_32_PROP_VALUE); + } + else + { + DT__AddProperty(node, FIRMWARE_ABI_PROP, sizeof(FIRMWARE_ABI_64_PROP_VALUE), (char*)FIRMWARE_ABI_64_PROP_VALUE); + } + + DT__AddProperty(node, FIRMWARE_REVISION_PROP, sizeof(FIRMWARE_REVISION), (EFI_UINT32*)&FIRMWARE_REVISION); + DT__AddProperty(node, FIRMWARE_VENDOR_PROP, sizeof(FIRMWARE_VENDOR), (EFI_CHAR16*)FIRMWARE_VENDOR); + + // TODO: Fill in other efi properties if necessary + + // Set up the /efi/runtime-services table node similar to the way a child node of configuration-table + // is set up. That is, name and table properties + Node *runtimeServicesNode = DT__AddChild(node, "runtime-services"); + + if (archCpuType == CPU_TYPE_I386) + { + // The value of the table property is the 32-bit physical address for the RuntimeServices table. + // Since the EFI system table already has a pointer to it, we simply use the address of that pointer + // for the pointer to the property data. Warning.. DT finalization calls free on that but we're not + // the only thing to use a non-malloc'd pointer for something in the DT + + DT__AddProperty(runtimeServicesNode, "table", sizeof(uint64_t), &gST32->RuntimeServices); + } + else + { + DT__AddProperty(runtimeServicesNode, "table", sizeof(uint64_t), &gST64->RuntimeServices); + } + + // Set up the /efi/configuration-table node which will eventually have several child nodes for + // all of the configuration tables needed by various kernel extensions. + gEfiConfigurationTableNode = DT__AddChild(node, "configuration-table"); + + // Now fill in the /efi/platform Node + Node *efiPlatformNode = DT__AddChild(node, "platform"); + + // NOTE WELL: If you do add FSB Frequency detection, make sure to store + // the value in the fsbFrequency global and not an malloc'd pointer + // because the DT_AddProperty function does not copy its args. + + if (Platform.CPU.FSBFrequency != 0) + DT__AddProperty(efiPlatformNode, FSB_Frequency_prop, sizeof(uint64_t), &Platform.CPU.FSBFrequency); + + // Export TSC and CPU frequencies for use by the kernel or KEXTs + if (Platform.CPU.TSCFrequency != 0) + DT__AddProperty(efiPlatformNode, TSC_Frequency_prop, sizeof(uint64_t), &Platform.CPU.TSCFrequency); + + if (Platform.CPU.CPUFrequency != 0) + DT__AddProperty(efiPlatformNode, CPU_Frequency_prop, sizeof(uint64_t), &Platform.CPU.CPUFrequency); + + // Export system-id. Can be disabled with SystemId=No in com.apple.Boot.plist + if ((ret=getSystemID())) + DT__AddProperty(efiPlatformNode, SYSTEM_ID_PROP, UUID_LEN, (EFI_UINT32*) ret); + + // Export SystemSerialNumber if present + if ((ret16=getSmbiosChar16("SMserial", &len))) + DT__AddProperty(efiPlatformNode, SYSTEM_SERIAL_PROP, len, ret16); + + // Export Model if present + if ((ret16=getSmbiosChar16("SMproductname", &len))) + DT__AddProperty(efiPlatformNode, MODEL_PROP, len, ret16); + + // Fill /efi/device-properties node. + setupDeviceProperties(node); +} + +/* + * Must be called AFTER getSmbios + */ +void setupBoardId() +{ + Node *node; + node = DT__FindNode("/", false); + if (node == 0) { + stop("Couldn't get root node"); + } + const char *boardid = getStringForKey("SMboardproduct", &bootInfo->smbiosConfig); + if (boardid) + DT__AddProperty(node, BOARDID_PROP, strlen(boardid)+1, (EFI_CHAR16*)boardid); +} + +/* + * Populate the chosen node + */ +void setupChosenNode() +{ + Node *chosenNode; + chosenNode = DT__FindNode("/chosen", false); + if (chosenNode == 0) + stop("Couldn't get chosen node"); + + int bootUUIDLength = strlen(gBootUUIDString); + if (bootUUIDLength) + DT__AddProperty(chosenNode, "boot-uuid", bootUUIDLength + 1, gBootUUIDString); +} + +/* + * Load the smbios.plist override config file if any + */ +static void setupSmbiosConfigFile(const char *filename) +{ + char dirSpecSMBIOS[128]; + const char *override_pathname = NULL; + int len = 0, err = 0; + extern void scan_mem(); + + // Take in account user overriding + if (getValueForKey(kSMBIOSKey, &override_pathname, &len, &bootInfo->chameleonConfig) && len > 0) + { + // Specify a path to a file, e.g. SMBIOS=/Extra/macProXY.plist + sprintf(dirSpecSMBIOS, override_pathname); + err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig); + } + else + { + // Check selected volume's Extra. + sprintf(dirSpecSMBIOS, "/Extra/%s", filename); + if ( (err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig)) ) + { + // Check booter volume/rdbt Extra. + sprintf(dirSpecSMBIOS, "bt(0,0)/Extra/%s", filename); + err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig); + } + } + + if (err) + { + verbose("No SMBIOS replacement found.\n"); + } + + // get a chance to scan mem dynamically if user asks for it while having the config options + // loaded as well, as opposed to when it was in scan_platform(); also load the orig. smbios + // so that we can access dmi info, without patching the smbios yet. + scan_mem(); +} + +/* + * Installs all the needed configuration table entries + */ +static void setupEfiConfigurationTable() +{ + smbios_p = (EFI_PTR32)getSmbios(SMBIOS_PATCHED); + addConfigurationTable(&gEfiSmbiosTableGuid, &smbios_p, NULL); + + setupBoardId(); //need to be called after getSmbios + + // Setup ACPI with DSDT overrides (mackerintel's patch) + setupAcpi(); + + // We've obviously changed the count.. so fix up the CRC32 + if (archCpuType == CPU_TYPE_I386) + { + gST32->Hdr.CRC32 = 0; + gST32->Hdr.CRC32 = crc32(0L, gST32, gST32->Hdr.HeaderSize); + } + else + { + gST64->Hdr.CRC32 = 0; + gST64->Hdr.CRC32 = crc32(0L, gST64, gST64->Hdr.HeaderSize); + } + + // Setup the chosen node + setupChosenNode(); +} + +void saveOriginalSMBIOS(void) +{ + Node *node; + SMBEntryPoint *origeps; + void *tableAddress; + + node = DT__FindNode("/efi/platform", false); + if (!node) + { + verbose("/efi/platform node not found\n"); + return; + } + + origeps = getSmbios(SMBIOS_ORIGINAL); + if (!origeps) + { + return; + } + + tableAddress = (void *)AllocateKernelMemory(origeps->dmi.tableLength); + if (!tableAddress) + { + return; + } + + memcpy(tableAddress, (void *)origeps->dmi.tableAddress, origeps->dmi.tableLength); + DT__AddProperty(node, "SMBIOS", origeps->dmi.tableLength, tableAddress); +} + +/* + * Entrypoint from boot.c + */ +void setupFakeEfi(void) +{ + // Generate efi device strings + setup_pci_devs(root_pci_dev); + + readSMBIOSInfo(getSmbios(SMBIOS_ORIGINAL)); + + // load smbios.plist file if any + setupSmbiosConfigFile("smbios.plist"); + + setupSMBIOSTable(); + + // Initialize the base table + if (archCpuType == CPU_TYPE_I386) + { + setupEfiTables32(); + } + else + { + setupEfiTables64(); + } + + // Initialize the device tree + setupEfiDeviceTree(); + + saveOriginalSMBIOS(); + + // Add configuration table entries to both the services table and the device tree + setupEfiConfigurationTable(); +} diff --git a/i386/libsaio/fake_efi.h b/i386/libsaio/fake_efi.h new file mode 100644 index 0000000..460139e --- /dev/null +++ b/i386/libsaio/fake_efi.h @@ -0,0 +1,13 @@ +/* + * Copyright 2007 David F. Elliott. All rights reserved. + */ + +#ifndef __LIBSAIO_FAKE_EFI_H +#define __LIBSAIO_FAKE_EFI_H + +/* Set up space for up to 10 configuration table entries */ +#define MAX_CONFIGURATION_TABLE_ENTRIES 10 + +extern void setupFakeEfi(void); + +#endif /* !__LIBSAIO_FAKE_EFI_H */ diff --git a/i386/libsaio/fdisk.h b/i386/libsaio/fdisk.h new file mode 100644 index 0000000..6c46410 --- /dev/null +++ b/i386/libsaio/fdisk.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * IBM PC disk partitioning data structures. + * + * HISTORY + * + * 8 July 1992 David E. Bohman at NeXT + * Created. + */ + +#ifndef __LIBSAIO_FDISK_H +#define __LIBSAIO_FDISK_H + +#define DISK_BLK0 0 /* blkno of boot block */ +#define DISK_BLK0SZ 512 /* size of boot block */ +#define DISK_BOOTSZ 446 /* size of boot code in boot block */ +#define DISK_SIGNATURE 0xAA55 /* signature of the boot record */ +#define FDISK_NPART 4 /* number of entries in fdisk table */ +#define FDISK_ACTIVE 0x80 /* indicator of active partition */ +#define FDISK_NEXTNAME 0xA7 /* indicator of NeXT partition */ +#define FDISK_DOS12 0x01 /* 12-bit fat < 10MB dos partition */ +#define FDISK_DOS16S 0x04 /* 16-bit fat < 32MB dos partition */ +#define FDISK_DOSEXT 0x05 /* extended dos partition */ +#define FDISK_DOS16B 0x06 /* 16-bit fat >= 32MB dos partition */ +#define FDISK_NTFS 0x07 /* NTFS partition */ +#define FDISK_SMALLFAT32 0x0b /* FAT32 partition */ +#define FDISK_FAT32 0x0c /* FAT32 partition */ +#define FDISK_DOS16SLBA 0x0e +#define FDISK_LINUX 0x83 +#define FDISK_OPENBSD 0xa6 /* OpenBSD FFS partition */ +#define FDISK_FREEBSD 0xa5 /* FreeBSD UFS2 partition */ +#define FDISK_BEFS 0xeb /* Haiku BeFS partition */ +#define FDISK_UFS 0xa8 /* Apple UFS partition */ +#define FDISK_HFS 0xaf /* Apple HFS partition */ +#define FDISK_BOOTER 0xab /* Apple booter partition */ + +/* + * Format of fdisk partion entry (if present). + */ +struct fdisk_part { + unsigned char bootid; /* bootable or not */ + unsigned char beghead; /* begining head, sector, cylinder */ + unsigned char begsect; /* begcyl is a 10-bit number */ + unsigned char begcyl; /* High 2 bits are in begsect */ + unsigned char systid; /* OS type */ + unsigned char endhead; /* ending head, sector, cylinder */ + unsigned char endsect; /* endcyl is a 10-bit number */ + unsigned char endcyl; /* High 2 bits are in endsect */ + unsigned long relsect; /* partion physical offset on disk */ + unsigned long numsect; /* number of sectors in partition */ +} __attribute__((packed)); + +/* + * Format of boot block. + */ +struct disk_blk0 { + unsigned char bootcode[DISK_BOOTSZ]; + unsigned char parts[FDISK_NPART][sizeof (struct fdisk_part)]; + unsigned short signature; +}; + +struct REAL_disk_blk0 { + unsigned char bootcode[DISK_BOOTSZ]; + struct fdisk_part parts[FDISK_NPART]; + unsigned short signature; +} __attribute__((packed)); + +#endif /* !__LIBSAIO_FDISK_H */ diff --git a/i386/libsaio/freebsd.c b/i386/libsaio/freebsd.c new file mode 100644 index 0000000..30fec68 --- /dev/null +++ b/i386/libsaio/freebsd.c @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "freebsd.h" + +#define FreeBSDProbeSize 2048 + +bool FreeBSDProbe (const void *buf) +{ + return (OSReadLittleInt32(buf+0xA55C,0)==0x19540119); +} +void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc(FreeBSDProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, FreeBSDProbeSize); + if (!FreeBSDProbe (buf)) + { + free (buf); + return; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x478, MIN (strMaxLen, 32)); + free (buf); +} diff --git a/i386/libsaio/freebsd.h b/i386/libsaio/freebsd.h new file mode 100644 index 0000000..4068f2b --- /dev/null +++ b/i386/libsaio/freebsd.h @@ -0,0 +1,2 @@ +extern bool FreeBSDProbe (const void *buf); +extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file diff --git a/i386/libsaio/gma.c b/i386/libsaio/gma.c new file mode 100644 index 0000000..c040e57 --- /dev/null +++ b/i386/libsaio/gma.c @@ -0,0 +1,323 @@ +/* + Original patch by Nawcom + http://forum.voodooprojects.org/index.php/topic,1029.0.html + + Original Intel HDx000 code from valv +*/ + +#include "libsa.h" +#include "saio_internal.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "device_inject.h" +#include "gma.h" +#include "vbe.h" +#include "graphics.h" + +#ifndef DEBUG_GMA +#define DEBUG_GMA 0 +#endif + +#if DEBUG_GMA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +uint8_t GMAX3100_vals[22][4] = { + { 0x01,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x08 }, + { 0x64,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x08 }, + { 0x01,0x00,0x00,0x00 }, + { 0x20,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x20,0x03,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x08,0x52,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, + { 0x3B,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 } +}; + +uint8_t HD2000_vals[16][4] = { + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xfa,0x00,0x00,0x00 }, + { 0x2c,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xf4,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, +}; + +uint8_t HD3000_vals[16][4] = { + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xfa,0x00,0x00,0x00 }, + { 0x2c,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x14,0x00,0x00,0x00 }, + { 0xf4,0x01,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x00,0x00,0x00,0x00 }, + { 0x01,0x00,0x00,0x00 }, +}; + +uint8_t HD2000_tbl_info[18] = { + 0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x01,0x02,0x02,0x02,0x00,0x01,0x02,0x02 +}; +uint8_t HD2000_os_info[20] = { + 0x30,0x49,0x01,0x11,0x11,0x11,0x08,0x00,0x00,0x01, + 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 +}; + +// The following values came from a Sandy Bridge MacBook Air +uint8_t HD3000_tbl_info[18] = { + 0x30,0x44,0x02,0x02,0x02,0x02,0x00,0x00,0x00, + 0x00,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01 +}; + +// The following values came from a Sandy Bridge MacBook Air +uint8_t HD3000_os_info[20] = { + 0x30,0x49,0x01,0x12,0x12,0x12,0x08,0x00,0x00,0x01, + 0xf0,0x1f,0x01,0x00,0x00,0x00,0x10,0x07,0x00,0x00 +}; + + +uint8_t reg_TRUE[] = { 0x01, 0x00, 0x00, 0x00 }; +uint8_t reg_FALSE[] = { 0x00, 0x00, 0x00, 0x00 }; + +static struct gma_gpu_t KnownGPUS[] = { + { 0x00000000, "Unknown" }, + { 0x808627A2, "Mobile GMA950" }, + { 0x808627AE, "Mobile GMA950" }, + { 0x808627A6, "Mobile GMA950" }, + { 0x8086A011, "Mobile GMA3150" }, + { 0x8086A012, "Mobile GMA3150" }, + { 0x80862772, "Desktop GMA950" }, + { 0x80862776, "Desktop GMA950" }, + { 0x8086A001, "Mobile GMA3150" }, + { 0x8086A002, "Desktop GMA3150" }, + { 0x80862A02, "GMAX3100" }, + { 0x80862A03, "GMAX3100" }, + { 0x80862A12, "GMAX3100" }, + { 0x80862A13, "GMAX3100" }, + { 0x80862A42, "GMAX3100" }, + { 0x80862A43, "GMAX3100" }, + { 0x80860102, "Intel HD Graphics 2000" }, + { 0x80860106, "Intel HD Graphics 2000 Mobile" }, + { 0x80860112, "Intel HD Graphics 3000" }, + { 0x80860116, "Intel HD Graphics 3000 Mobile" }, + { 0x80860122, "Intel HD Graphics 3000" }, + { 0x80860126, "Intel HD Graphics 3000 Mobile" }, + { 0x80860152, "Intel HD Graphics 2500" }, + { 0x80860156, "Intel HD Graphics 2500 Mobile" }, + { 0x80860162, "Intel HD Graphics 4000" }, + { 0x80860166, "Intel HD Graphics 4000 Mobile" }, +}; + +char *get_gma_model(uint32_t id) { + int i = 0; + + for (i = 0; i < (sizeof(KnownGPUS) / sizeof(KnownGPUS[0])); i++) + { + if (KnownGPUS[i].device == id) + return KnownGPUS[i].name; + } + return KnownGPUS[0].name; +} + +bool setup_gma_devprop(pci_dt_t *gma_dev) +{ + char *devicepath; + volatile uint8_t *regs; + uint32_t bar[7]; + char *model; + unsigned int device_id; + uint8_t BuiltIn = 0x00; + uint8_t ClassFix[4] = { 0x00, 0x00, 0x03, 0x00 }; + uint8_t hd3k_device_id[4] = { 0x26, 0x01, 0x00, 0x00 }; + uint8_t hd4k_device_id[4] = { 0x66, 0x01, 0x00, 0x00 }; + uint8_t ig_id[4] = { 0x0A, 0x00, 0x66, 0x01 }; + uint8_t ig_id_mobile[4] = { 0x09, 0x00, 0x66, 0x01 }; + + devicepath = get_pci_dev_path(gma_dev); + + bar[0] = pci_config_read32(gma_dev->dev.addr, 0x10); + regs = (uint8_t *) (bar[0] & ~0x0f); + + model = get_gma_model((gma_dev->vendor_id << 16) | gma_dev->device_id); + device_id = gma_dev->device_id; + + verbose("Intel %s [%04x:%04x] :: %s\n", + model, gma_dev->vendor_id, gma_dev->device_id, devicepath); + + if (!string) + string = devprop_create_string(); + + struct DevPropDevice *device = malloc(sizeof(struct DevPropDevice)); + device = devprop_add_device(string, devicepath); + + if (!device) + { + printf("Failed initializing dev-prop string dev-entry.\n"); + pause(); + return false; + } + + devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1)); +// devprop_add_value(device, "device_type", (uint8_t*)"display", 8); + + if ((model == (char *)&"Mobile GMA950") + || (model == (char *)&"Mobile GMA3150")) + { + devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4); + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + } + else if ((model == (char *)&"Desktop GMA950") + || (model == (char *)&"Desktop GMA3150")) + { + BuiltIn = 0x01; + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + } + else if (model == (char *)&"GMAX3100") + { + devprop_add_value(device, "AAPL,HasPanel", GMAX3100_vals[0], 4); + devprop_add_value(device, "AAPL,SelfRefreshSupported", GMAX3100_vals[1], 4); + devprop_add_value(device, "AAPL,aux-power-connected", GMAX3100_vals[2], 4); + devprop_add_value(device, "AAPL,backlight-control", GMAX3100_vals[3], 4); + devprop_add_value(device, "AAPL00,blackscreen-preferences", GMAX3100_vals[4], 4); + devprop_add_value(device, "AAPL01,BacklightIntensity", GMAX3100_vals[5], 4); + devprop_add_value(device, "AAPL01,blackscreen-preferences", GMAX3100_vals[6], 4); + devprop_add_value(device, "AAPL01,DataJustify", GMAX3100_vals[7], 4); + devprop_add_value(device, "AAPL01,Depth", GMAX3100_vals[8], 4); + devprop_add_value(device, "AAPL01,Dither", GMAX3100_vals[9], 4); + devprop_add_value(device, "AAPL01,DualLink", GMAX3100_vals[10], 4); + devprop_add_value(device, "AAPL01,Height", GMAX3100_vals[11], 4); + devprop_add_value(device, "AAPL01,Interlace", GMAX3100_vals[12], 4); + devprop_add_value(device, "AAPL01,Inverter", GMAX3100_vals[13], 4); + devprop_add_value(device, "AAPL01,InverterCurrent", GMAX3100_vals[14], 4); + devprop_add_value(device, "AAPL01,InverterCurrency", GMAX3100_vals[15], 4); + devprop_add_value(device, "AAPL01,LinkFormat", GMAX3100_vals[16], 4); + devprop_add_value(device, "AAPL01,LinkType", GMAX3100_vals[17], 4); + devprop_add_value(device, "AAPL01,Pipe", GMAX3100_vals[18], 4); + devprop_add_value(device, "AAPL01,PixelFormat", GMAX3100_vals[19], 4); + devprop_add_value(device, "AAPL01,Refresh", GMAX3100_vals[20], 4); + devprop_add_value(device, "AAPL01,Stretch", GMAX3100_vals[21], 4); + devprop_add_value(device, "class-code", ClassFix, 4); + } + else if (model == (char *)&"Intel HD Graphics 2000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); + } + else if (model == (char *)&"Intel HD Graphics 2000 Mobile") + { + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "graphic-options", HD2000_vals[13], 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4); + devprop_add_value(device, "AAPL00,Dither", HD2000_vals[11], 4); + devprop_add_value(device, "AAPL00,DualLink", HD2000_vals[10], 4); + devprop_add_value(device, "AAPL00,LinkFormat", HD2000_vals[9], 4); + devprop_add_value(device, "AAPL00,LinkType", HD2000_vals[8], 4); + devprop_add_value(device, "AAPL00,PixelFormat", HD2000_vals[0], 4); + devprop_add_value(device, "AAPL00,T1", HD2000_vals[1], 4); + devprop_add_value(device, "AAPL00,T2", HD2000_vals[2], 4); + devprop_add_value(device, "AAPL00,T3", HD2000_vals[3], 4); + devprop_add_value(device, "AAPL00,T4", HD2000_vals[4], 4); + devprop_add_value(device, "AAPL00,T5", HD2000_vals[5], 4); + devprop_add_value(device, "AAPL00,T6", HD2000_vals[6], 4); + devprop_add_value(device, "AAPL00,T7", HD2000_vals[7], 4); + devprop_add_value(device, "AAPL,os-info", HD2000_os_info, 20); + devprop_add_value(device, "AAPL,tbl-info", HD2000_tbl_info, 18); + } + else if (model == (char *)&"Intel HD Graphics 3000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd3k_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); + } + else if (model == (char *)&"Intel HD Graphics 3000 Mobile") + { + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "graphic-options", HD3000_vals[13], 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL00,DataJustify", HD3000_vals[12], 4); + devprop_add_value(device, "AAPL00,Dither", HD3000_vals[11], 4); + devprop_add_value(device, "AAPL00,DualLink", HD3000_vals[10], 4); + devprop_add_value(device, "AAPL00,LinkFormat", HD3000_vals[9], 4); + devprop_add_value(device, "AAPL00,LinkType", HD3000_vals[8], 4); + devprop_add_value(device, "AAPL00,PixelFormat", HD3000_vals[0], 4); + devprop_add_value(device, "AAPL00,T1", HD3000_vals[1], 4); + devprop_add_value(device, "AAPL00,T2", HD3000_vals[2], 4); + devprop_add_value(device, "AAPL00,T3", HD3000_vals[3], 4); + devprop_add_value(device, "AAPL00,T4", HD3000_vals[4], 4); + devprop_add_value(device, "AAPL00,T5", HD3000_vals[5], 4); + devprop_add_value(device, "AAPL00,T6", HD3000_vals[6], 4); + devprop_add_value(device, "AAPL00,T7", HD3000_vals[7], 4); + devprop_add_value(device, "AAPL,os-info", HD3000_os_info, 20); + devprop_add_value(device, "AAPL,tbl-info", HD3000_tbl_info, 18); + } + else if (model == (char *)&"Intel HD Graphics 4000") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "device-id", hd4k_device_id, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,ig-platform-id", ig_id, 4); + } + else if (model == (char *)&"Intel HD Graphics 4000 Mobile") + { + devprop_add_value(device, "built-in", &BuiltIn, 1); + devprop_add_value(device, "class-code", ClassFix, 4); + devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10); + devprop_add_value(device, "AAPL,ig-platform-id", ig_id_mobile, 4); + } + + stringdata = malloc(sizeof(uint8_t) * string->length); + if (!stringdata) + { + printf("No stringdata.\n"); + pause(); + return false; + } + + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + + return true; +} diff --git a/i386/libsaio/gma.h b/i386/libsaio/gma.h new file mode 100644 index 0000000..afbc605 --- /dev/null +++ b/i386/libsaio/gma.h @@ -0,0 +1,16 @@ +#ifndef __LIBSAIO_GMA_H +#define __LIBSAIO_GMA_H + +bool setup_gma_devprop(pci_dt_t *gma_dev); + +struct gma_gpu_t { + unsigned device; + char *name; +}; + +#define REG8(reg) ((volatile uint8_t *)regs)[(reg)] +#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1] +#define REG32(reg) ((volatile uint32_t *)regs)[(reg) >> 2] + + +#endif /* !__LIBSAIO_GMA_H */ diff --git a/i386/libsaio/hfs.c b/i386/libsaio/hfs.c new file mode 100644 index 0000000..e2e0aec --- /dev/null +++ b/i386/libsaio/hfs.c @@ -0,0 +1,1064 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * hfs.c - File System Module for HFS and HFS+. + * + * Copyright (c) 1999-2002 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include <sl.h> +#include <hfs/hfs_format.h> + +#include "hfs.h" + +#define kBlockSize (0x200) + +#define kMDBBaseOffset (2 * kBlockSize) + +#define kBTreeCatalog (0) +#define kBTreeExtents (1) + +#ifdef __i386__ + +static CICell gCurrentIH; +static long long gAllocationOffset; +static long gIsHFSPlus; +static long gCaseSensitive; +static long gBlockSize; +static long gCacheBlockSize; +static char *gBTreeHeaderBuffer; +static BTHeaderRec *gBTHeaders[2]; +static char *gHFSMdbVib; +static HFSMasterDirectoryBlock *gHFSMDB; +static char *gHFSPlusHeader; +static HFSPlusVolumeHeader *gHFSPlus; +static char *gLinkTemp; +static long long gVolID; +static char *gTempStr; + +#else /* !__i386__ */ + +static CICell gCurrentIH; +static long long gAllocationOffset; +static long gIsHFSPlus; +static long gBlockSize; +static long gCaseSensitive; +static long gCacheBlockSize; +static char gBTreeHeaderBuffer[512]; +static BTHeaderRec *gBTHeaders[2]; +static char gHFSMdbVib[kBlockSize]; +static HFSMasterDirectoryBlock *gHFSMDB =(HFSMasterDirectoryBlock*)gHFSMdbVib; +static char gHFSPlusHeader[kBlockSize]; +static HFSPlusVolumeHeader *gHFSPlus =(HFSPlusVolumeHeader*)gHFSPlusHeader; +static char gLinkTemp[64]; +static long long gVolID; + +#endif /* !__i386__ */ + +static long ReadFile(void *file, uint64_t *length, void *base, uint64_t offset); +static long GetCatalogEntryInfo(void *entry, long *flags, long *time, + FinderInfo *finderInfo, long *infoValid); +static long ResolvePathToCatalogEntry(char *filePath, long *flags, + void *entry, long dirID, long long *dirIndex); + +static long GetCatalogEntry(long long *dirIndex, char **name, + long *flags, long *time, + FinderInfo *finderInfo, long *infoValid); +static long ReadCatalogEntry(char *fileName, long dirID, void *entry, + long long *dirIndex); +static long ReadExtentsEntry(long fileID, long startBlock, void *entry); + +static long ReadBTreeEntry(long btree, void *key, char *entry, long long *dirIndex); +static void GetBTreeRecord(long index, char *nodeBuffer, long nodeSize, + char **key, char **data); + +static long ReadExtent(char *extent, uint64_t extentSize, long extentFile, + uint64_t offset, uint64_t size, void *buffer, long cache); + +static long GetExtentStart(void *extents, long index); +static long GetExtentSize(void *extents, long index); + +static long CompareHFSCatalogKeys(void *key, void *testKey); +static long CompareHFSPlusCatalogKeys(void *key, void *testKey); +static long CompareHFSExtentsKeys(void *key, void *testKey); +static long CompareHFSPlusExtentsKeys(void *key, void *testKey); + +extern long FastRelString(u_int8_t *str1, u_int8_t *str2); +extern long BinaryUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, + u_int16_t *uniStr2, u_int32_t len2); + + +static void SwapFinderInfo(FndrFileInfo *dst, FndrFileInfo *src) +{ + dst->fdType = SWAP_BE32(src->fdType); + dst->fdCreator = SWAP_BE32(src->fdCreator); + dst->fdFlags = SWAP_BE16(src->fdFlags); + // Don't bother with location +} + +void HFSFree(CICell ih) +{ + if(gCurrentIH == ih) + gCurrentIH = 0; + free(ih); +} + +bool HFSProbe (const void *buf) +{ + const HFSMasterDirectoryBlock *mdb; + const HFSPlusVolumeHeader *header; + mdb=(const HFSMasterDirectoryBlock *)(((const char*)buf)+kMDBBaseOffset); + header=(const HFSPlusVolumeHeader *)(((const char*)buf)+kMDBBaseOffset); + + if ( SWAP_BE16(mdb->drSigWord) == kHFSSigWord ) + return true; + if (SWAP_BE16(header->signature) != kHFSPlusSigWord && + SWAP_BE16(header->signature) != kHFSXSigWord) + return false; + return true; +} + +long HFSInitPartition(CICell ih) +{ + long extentSize, extentFile, nodeSize; + void *extent; + + if (ih == gCurrentIH) { +#ifdef __i386__ + CacheInit(ih, gCacheBlockSize); +#endif + return 0; + } + +#ifdef __i386__ + if (!gTempStr) gTempStr = (char *)malloc(4096); + if (!gLinkTemp) gLinkTemp = (char *)malloc(64); + if (!gBTreeHeaderBuffer) gBTreeHeaderBuffer = (char *)malloc(512); + if (!gHFSMdbVib) { + gHFSMdbVib = (char *)malloc(kBlockSize); + gHFSMDB = (HFSMasterDirectoryBlock *)gHFSMdbVib; + } + if (!gHFSPlusHeader) { + gHFSPlusHeader = (char *)malloc(kBlockSize); + gHFSPlus = (HFSPlusVolumeHeader *)gHFSPlusHeader; + } + if (!gTempStr || !gLinkTemp || !gBTreeHeaderBuffer || + !gHFSMdbVib || !gHFSPlusHeader) return -1; +#endif /* __i386__ */ + + gAllocationOffset = 0; + gIsHFSPlus = 0; + gCaseSensitive = 0; + gBTHeaders[0] = 0; + gBTHeaders[1] = 0; + + // Look for the HFS MDB + Seek(ih, kMDBBaseOffset); + Read(ih, (long)gHFSMdbVib, kBlockSize); + + if ( SWAP_BE16(gHFSMDB->drSigWord) == kHFSSigWord ) { + gAllocationOffset = SWAP_BE16(gHFSMDB->drAlBlSt) * kBlockSize; + + // See if it is HFSPlus + if (SWAP_BE16(gHFSMDB->drEmbedSigWord) != kHFSPlusSigWord) { + // Normal HFS; + gCacheBlockSize = gBlockSize = SWAP_BE32(gHFSMDB->drAlBlkSiz); + CacheInit(ih, gCacheBlockSize); + gCurrentIH = ih; + + // grab the 64 bit volume ID + bcopy(&gHFSMDB->drFndrInfo[6], &gVolID, 8); + + // Get the Catalog BTree node size. + extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drCTFlSize); + extentFile = kHFSCatalogFileID; + ReadExtent(extent, extentSize, extentFile, 0, 256, + gBTreeHeaderBuffer + kBTreeCatalog * 256, 0); + + nodeSize = SWAP_BE16(((BTHeaderRec *)(gBTreeHeaderBuffer + kBTreeCatalog * 256 + + sizeof(BTNodeDescriptor)))->nodeSize); + + // If the BTree node size is larger than the block size, reset the cache. + if (nodeSize > gBlockSize) { + gCacheBlockSize = nodeSize; + CacheInit(ih, gCacheBlockSize); + } + + return 0; + } + + // Calculate the offset to the embeded HFSPlus volume. + gAllocationOffset += (long long)SWAP_BE16(gHFSMDB->drEmbedExtent.startBlock) * + SWAP_BE32(gHFSMDB->drAlBlkSiz); + } + + // Look for the HFSPlus Header + Seek(ih, gAllocationOffset + kMDBBaseOffset); + Read(ih, (long)gHFSPlusHeader, kBlockSize); + + // Not a HFS+ or HFSX volume. + if (SWAP_BE16(gHFSPlus->signature) != kHFSPlusSigWord && + SWAP_BE16(gHFSPlus->signature) != kHFSXSigWord) { + verbose("HFS signature was not present.\n"); + gCurrentIH = 0; + return -1; + } + + gIsHFSPlus = 1; + gCacheBlockSize = gBlockSize = SWAP_BE32(gHFSPlus->blockSize); + CacheInit(ih, gCacheBlockSize); + gCurrentIH = ih; + + ih->modTime = SWAP_BE32(gHFSPlus->modifyDate) - 2082844800; + + // grab the 64 bit volume ID + bcopy(&gHFSPlus->finderInfo[24], &gVolID, 8); + + // Get the Catalog BTree node size. + extent = &gHFSPlus->catalogFile.extents; + extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize); + extentFile = kHFSCatalogFileID; + + ReadExtent(extent, extentSize, extentFile, 0, 256, + gBTreeHeaderBuffer + kBTreeCatalog * 256, 0); + + nodeSize = SWAP_BE16(((BTHeaderRec *)(gBTreeHeaderBuffer + kBTreeCatalog * 256 + + sizeof(BTNodeDescriptor)))->nodeSize); + + // If the BTree node size is larger than the block size, reset the cache. + if (nodeSize > gBlockSize) { + gCacheBlockSize = nodeSize; + CacheInit(ih, gCacheBlockSize); + } + + return 0; +} + +long HFSLoadFile(CICell ih, char * filePath) +{ + return HFSReadFile(ih, filePath, (void *)gFSLoadAddress, 0, 0); +} + +long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length) +{ + char entry[512]; + char devStr[12]; + long dirID, result, flags; + + if (HFSInitPartition(ih) == -1) return -1; + + dirID = kHFSRootFolderID; + // Skip a lead '\'. Start in the system folder if there are two. + if (filePath[0] == '/') { + if (filePath[1] == '/') { + if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); + else dirID = SWAP_BE32(gHFSMDB->drFndrInfo[5]); + if (dirID == 0) { + return -1; + } + filePath++; + } + filePath++; + } + + result = ResolvePathToCatalogEntry(filePath, &flags, entry, dirID, 0); + if ((result == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { + return -1; + } + +#if UNUSED + // Not yet for Intel. System.config/Default.table will fail this check. + // Check file owner and permissions. + if (flags & (kOwnerNotRoot | kPermGroupWrite | kPermOtherWrite)) return -1; +#endif + + result = ReadFile(entry, &length, base, offset); + if (result == -1) { + return -1; + } + + getDeviceDescription(ih, devStr); + verbose("Read HFS%s file: [%s/%s] %d bytes.\n", + (gIsHFSPlus ? "+" : ""), devStr, filePath, (uint32_t)length); + + return length; +} + +long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, char ** name, + long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + char entry[512]; + long dirID, dirFlags; + + if (HFSInitPartition(ih) == -1) return -1; + + if (*dirIndex == -1) return -1; + + dirID = kHFSRootFolderID; + // Skip a lead '\'. Start in the system folder if there are two. + if (dirPath[0] == '/') { + if (dirPath[1] == '/') { + if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); + else dirID = SWAP_BE32(gHFSMDB->drFndrInfo[5]); + if (dirID == 0) return -1; + dirPath++; + } + dirPath++; + } + + if (*dirIndex == 0) { + ResolvePathToCatalogEntry(dirPath, &dirFlags, entry, dirID, dirIndex); + if (*dirIndex == 0) *dirIndex = -1; + if ((dirFlags & kFileTypeMask) != kFileTypeUnknown) return -1; + } + + GetCatalogEntry(dirIndex, name, flags, time, finderInfo, infoValid); + if (*dirIndex == 0) *dirIndex = -1; + if ((*flags & kFileTypeMask) == kFileTypeUnknown) return -1; + + return 0; +} + +void +HFSGetDescription(CICell ih, char *str, long strMaxLen) +{ + + UInt16 nodeSize; + UInt32 firstLeafNode; + long long dirIndex; + char *name; + long flags, time; + + if (HFSInitPartition(ih) == -1) { return; } + + /* Fill some crucial data structures by side effect. */ + dirIndex = 0; + HFSGetDirEntry(ih, "/", &dirIndex, &name, &flags, &time, 0, 0); + + /* Now we can loook up the volume name node. */ + nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize); + firstLeafNode = SWAP_BE32(gBTHeaders[kBTreeCatalog]->firstLeafNode); + + dirIndex = (long long) firstLeafNode * nodeSize; + + GetCatalogEntry(&dirIndex, &name, &flags, &time, 0, 0); + + strncpy(str, name, strMaxLen); + str[strMaxLen] = '\0'; +} + + +long +HFSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock) +{ + char entry[512]; + long dirID, result, flags; + void *extents; + HFSCatalogFile *hfsFile = (void *)entry; + HFSPlusCatalogFile *hfsPlusFile = (void *)entry; + + if (HFSInitPartition(ih) == -1) return -1; + + dirID = kHFSRootFolderID; + // Skip a lead '\'. Start in the system folder if there are two. + if (filePath[0] == '/') { + if (filePath[1] == '/') { + if (gIsHFSPlus) dirID = SWAP_BE32(((long *)gHFSPlus->finderInfo)[5]); + else dirID = SWAP_BE32(gHFSMDB->drFndrInfo[5]); + if (dirID == 0) { + return -1; + } + filePath++; + } + filePath++; + } + + result = ResolvePathToCatalogEntry(filePath, &flags, entry, dirID, 0); + if ((result == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { + printf("HFS: Resolve path %s failed\n", filePath); + return -1; + } + + if (gIsHFSPlus) { + extents = &hfsPlusFile->dataFork.extents; + } else { + extents = &hfsFile->dataExtents; + } + +#if DEBUG + printf("extent start 0x%x\n", (unsigned long)GetExtentStart(extents, 0)); + printf("block size 0x%x\n", (unsigned long)gBlockSize); + printf("Allocation offset 0x%x\n", (unsigned long)gAllocationOffset); +#endif + *firstBlock = ((unsigned long long)GetExtentStart(extents, 0) * (unsigned long long) gBlockSize + gAllocationOffset) / 512ULL; + return 0; +} + +long HFSGetUUID(CICell ih, char *uuidStr) +{ + if (HFSInitPartition(ih) == -1) return -1; + if (gVolID == 0LL) return -1; + + return CreateUUIDString((uint8_t*)(&gVolID), sizeof(gVolID), uuidStr); +} + +// Private Functions + +static long ReadFile(void * file, uint64_t * length, void * base, uint64_t offset) +{ + void *extents; + long fileID; + uint64_t fileLength; + HFSCatalogFile *hfsFile = file; + HFSPlusCatalogFile *hfsPlusFile = file; + + if (gIsHFSPlus) { + fileID = SWAP_BE32(hfsPlusFile->fileID); + fileLength = (uint64_t)SWAP_BE64(hfsPlusFile->dataFork.logicalSize); + extents = &hfsPlusFile->dataFork.extents; + } else { + fileID = SWAP_BE32(hfsFile->fileID); + fileLength = SWAP_BE32(hfsFile->dataLogicalSize); + extents = &hfsFile->dataExtents; + } + + if (offset > fileLength) { + printf("Offset is too large.\n"); + return -1; + } + + if ((*length == 0) || ((offset + *length) > fileLength)) { + *length = fileLength - offset; + } + +/* if (*length > kLoadSize) { + printf("File is too large.\n"); + return -1; + }*/ + + *length = ReadExtent((char *)extents, fileLength, fileID, + offset, *length, (char *)base, 0); + + return 0; +} + +static long GetCatalogEntryInfo(void * entry, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + long tmpTime = 0; + long valid = 0; + + // Get information about the file. + + switch ( SWAP_BE16(*(short *)entry) ) + { + case kHFSFolderRecord : + *flags = kFileTypeDirectory; + tmpTime = SWAP_BE32(((HFSCatalogFolder *)entry)->modifyDate); + break; + + case kHFSPlusFolderRecord : + *flags = kFileTypeDirectory | + (SWAP_BE16(((HFSPlusCatalogFolder *)entry)->bsdInfo.fileMode) & kPermMask); + if (SWAP_BE32(((HFSPlusCatalogFolder *)entry)->bsdInfo.ownerID) != 0) + *flags |= kOwnerNotRoot; + tmpTime = SWAP_BE32(((HFSPlusCatalogFolder *)entry)->contentModDate); + break; + + case kHFSFileRecord : + *flags = kFileTypeFlat; + tmpTime = SWAP_BE32(((HFSCatalogFile *)entry)->modifyDate); + if (finderInfo) { + SwapFinderInfo((FndrFileInfo *)finderInfo, &((HFSCatalogFile *)entry)->userInfo); + valid = 1; + } + break; + + case kHFSPlusFileRecord : + *flags = kFileTypeFlat | + (SWAP_BE16(((HFSPlusCatalogFile *)entry)->bsdInfo.fileMode) & kPermMask); + if (SWAP_BE32(((HFSPlusCatalogFile *)entry)->bsdInfo.ownerID) != 0) + *flags |= kOwnerNotRoot; + tmpTime = SWAP_BE32(((HFSPlusCatalogFile *)entry)->contentModDate); + if (finderInfo) { + SwapFinderInfo((FndrFileInfo *)finderInfo, &((HFSPlusCatalogFile *)entry)->userInfo); + valid = 1; + } + break; + + case kHFSFileThreadRecord : + case kHFSPlusFileThreadRecord : + case kHFSFolderThreadRecord : + case kHFSPlusFolderThreadRecord : + *flags = kFileTypeUnknown; + tmpTime = 0; + break; + } + + if (time != 0) { + // Convert base time from 1904 to 1970. + *time = tmpTime - 2082844800; + } + if (infoValid) *infoValid = valid; + + return 0; +} + +static long ResolvePathToCatalogEntry(char * filePath, long * flags, + void * entry, long dirID, long long * dirIndex) +{ + char *restPath; + long result, cnt, subFolderID = 0; + long long tmpDirIndex; + HFSPlusCatalogFile *hfsPlusFile; + + // Copy the file name to gTempStr + cnt = 0; + while ((filePath[cnt] != '/') && (filePath[cnt] != '\0')) cnt++; + strlcpy(gTempStr, filePath, cnt+1); + + // Move restPath to the right place. + if (filePath[cnt] != '\0') cnt++; + restPath = filePath + cnt; + + // gTempStr is a name in the current Dir. + // restPath is the rest of the path if any. + + result = ReadCatalogEntry(gTempStr, dirID, entry, dirIndex); + if (result == -1) { + return -1; + } + + GetCatalogEntryInfo(entry, flags, 0, 0, 0); + + if ((*flags & kFileTypeMask) == kFileTypeDirectory) { + if (gIsHFSPlus) + subFolderID = SWAP_BE32(((HFSPlusCatalogFolder *)entry)->folderID); + else + subFolderID = SWAP_BE32(((HFSCatalogFolder *)entry)->folderID); + } + + if ((*flags & kFileTypeMask) == kFileTypeDirectory) + result = ResolvePathToCatalogEntry(restPath, flags, entry, + subFolderID, dirIndex); + + if (gIsHFSPlus && ((*flags & kFileTypeMask) == kFileTypeFlat)) { + hfsPlusFile = (HFSPlusCatalogFile *)entry; + if ((SWAP_BE32(hfsPlusFile->userInfo.fdType) == kHardLinkFileType) && + (SWAP_BE32(hfsPlusFile->userInfo.fdCreator) == kHFSPlusCreator)) { + sprintf(gLinkTemp, "%s/%s%ld", HFSPLUSMETADATAFOLDER, + HFS_INODE_PREFIX, SWAP_BE32(hfsPlusFile->bsdInfo.special.iNodeNum)); + result = ResolvePathToCatalogEntry(gLinkTemp, flags, entry, + kHFSRootFolderID, &tmpDirIndex); + } + } + + return result; +} + +static long GetCatalogEntry(long long * dirIndex, char ** name, + long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + long extentSize, nodeSize, curNode, index; + void *extent; + char *nodeBuf, *testKey, *entry; + BTNodeDescriptor *node; + + if (gIsHFSPlus) { + extent = &gHFSPlus->catalogFile.extents; + extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize); + } else { + extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drCTFlSize); + } + + nodeSize = SWAP_BE16(gBTHeaders[kBTreeCatalog]->nodeSize); + nodeBuf = (char *)malloc(nodeSize); + node = (BTNodeDescriptor *)nodeBuf; + + index = (long) (*dirIndex % nodeSize); + curNode = (long) (*dirIndex / nodeSize); + + // Read the BTree node and get the record for index. + ReadExtent(extent, extentSize, kHFSCatalogFileID, + (long long) curNode * nodeSize, nodeSize, nodeBuf, 1); + GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &entry); + + GetCatalogEntryInfo(entry, flags, time, finderInfo, infoValid); + + // Get the file name. + if (gIsHFSPlus) { + utf_encodestr(((HFSPlusCatalogKey *)testKey)->nodeName.unicode, + SWAP_BE16(((HFSPlusCatalogKey *)testKey)->nodeName.length), + (u_int8_t *)gTempStr, 256, OSBigEndian); + } else { + strncpy(gTempStr, + (const char *)&((HFSCatalogKey *)testKey)->nodeName[1], + ((HFSCatalogKey *)testKey)->nodeName[0]); + gTempStr[((HFSCatalogKey *)testKey)->nodeName[0]] = '\0'; + } + *name = gTempStr; + + // Update dirIndex. + index++; + if (index == SWAP_BE16(node->numRecords)) { + index = 0; + curNode = SWAP_BE32(node->fLink); + } + *dirIndex = (long long) curNode * nodeSize + index; + + free(nodeBuf); + + return 0; +} + +static long ReadCatalogEntry(char * fileName, long dirID, + void * entry, long long * dirIndex) +{ + long length; + char key[sizeof(HFSPlusCatalogKey)]; + HFSCatalogKey *hfsKey = (HFSCatalogKey *)key; + HFSPlusCatalogKey *hfsPlusKey = (HFSPlusCatalogKey *)key; + + // Make the catalog key. + if ( gIsHFSPlus ) + { + hfsPlusKey->parentID = SWAP_BE32(dirID); + length = strlen(fileName); + if (length > 255) length = 255; + utf_decodestr((u_int8_t *)fileName, hfsPlusKey->nodeName.unicode, + &(hfsPlusKey->nodeName.length), 512, OSBigEndian); + } else { + hfsKey->parentID = SWAP_BE32(dirID); + length = strlen(fileName); + if (length > 31) length = 31; + hfsKey->nodeName[0] = length; + strncpy((char *)(hfsKey->nodeName + 1), fileName, length); + } + + return ReadBTreeEntry(kBTreeCatalog, &key, entry, dirIndex); +} + +static long ReadExtentsEntry(long fileID, long startBlock, void * entry) +{ + char key[sizeof(HFSPlusExtentKey)]; + HFSExtentKey *hfsKey = (HFSExtentKey *)key; + HFSPlusExtentKey *hfsPlusKey = (HFSPlusExtentKey *)key; + + // Make the extents key. + if (gIsHFSPlus) { + hfsPlusKey->forkType = 0; + hfsPlusKey->fileID = SWAP_BE32(fileID); + hfsPlusKey->startBlock = SWAP_BE32(startBlock); + } else { + hfsKey->forkType = 0; + hfsKey->fileID = SWAP_BE32(fileID); + hfsKey->startBlock = SWAP_BE16(startBlock); + } + + return ReadBTreeEntry(kBTreeExtents, &key, entry, 0); +} + +static long ReadBTreeEntry(long btree, void * key, char * entry, long long * dirIndex) +{ + long extentSize; + void *extent; + short extentFile; + char *nodeBuf; + BTNodeDescriptor *node; + long nodeSize, result = 0, entrySize = 0; + long curNode, index = 0, lowerBound, upperBound; + char *testKey, *recordData; + + // Figure out which tree is being looked at. + if (btree == kBTreeCatalog) { + if (gIsHFSPlus) { + extent = &gHFSPlus->catalogFile.extents; + extentSize = SWAP_BE64(gHFSPlus->catalogFile.logicalSize); + } else { + extent = (HFSExtentDescriptor *)&gHFSMDB->drCTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drCTFlSize); + } + extentFile = kHFSCatalogFileID; + } else { + if (gIsHFSPlus) { + extent = &gHFSPlus->extentsFile.extents; + extentSize = SWAP_BE64(gHFSPlus->extentsFile.logicalSize); + } else { + extent = (HFSExtentDescriptor *)&gHFSMDB->drXTExtRec; + extentSize = SWAP_BE32(gHFSMDB->drXTFlSize); + } + extentFile = kHFSExtentsFileID; + } + + // Read the BTree Header if needed. + if (gBTHeaders[btree] == 0) { + ReadExtent(extent, extentSize, extentFile, 0, 256, + gBTreeHeaderBuffer + btree * 256, 0); + gBTHeaders[btree] = (BTHeaderRec *)(gBTreeHeaderBuffer + btree * 256 + + sizeof(BTNodeDescriptor)); + if ((gIsHFSPlus && btree == kBTreeCatalog) && + (gBTHeaders[btree]->keyCompareType == kHFSBinaryCompare)) { + gCaseSensitive = 1; + } + } + + curNode = SWAP_BE32(gBTHeaders[btree]->rootNode); + nodeSize = SWAP_BE16(gBTHeaders[btree]->nodeSize); + nodeBuf = (char *)malloc(nodeSize); + node = (BTNodeDescriptor *)nodeBuf; + + while (1) { + // Read the current node. + ReadExtent(extent, extentSize, extentFile, + (long long) curNode * nodeSize, nodeSize, nodeBuf, 1); + + // Find the matching key. + lowerBound = 0; + upperBound = SWAP_BE16(node->numRecords) - 1; + while (lowerBound <= upperBound) { + index = (lowerBound + upperBound) / 2; + + GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &recordData); + + if (gIsHFSPlus) { + if (btree == kBTreeCatalog) { + result = CompareHFSPlusCatalogKeys(key, testKey); + } else { + result = CompareHFSPlusExtentsKeys(key, testKey); + } + } else { + if (btree == kBTreeCatalog) { + result = CompareHFSCatalogKeys(key, testKey); + } else { + result = CompareHFSExtentsKeys(key, testKey); + } + } + + if (result < 0) upperBound = index - 1; // search < trial + else if (result > 0) lowerBound = index + 1; // search > trial + else break; // search = trial + } + + if (result < 0) { + index = upperBound; + GetBTreeRecord(index, nodeBuf, nodeSize, &testKey, &recordData); + } + + // Found the closest key... Recurse on it if this is an index node. + if (node->kind == kBTIndexNode) { + curNode = SWAP_BE32( *((long *)recordData) ); + } else break; + } + + // Return error if the file was not found. + if (result != 0) { free(nodeBuf); return -1; } + + if (btree == kBTreeCatalog) { + switch (SWAP_BE16(*(short *)recordData)) { + case kHFSFolderRecord : entrySize = 70; break; + case kHFSFileRecord : entrySize = 102; break; + case kHFSFolderThreadRecord : entrySize = 46; break; + case kHFSFileThreadRecord : entrySize = 46; break; + case kHFSPlusFolderRecord : entrySize = 88; break; + case kHFSPlusFileRecord : entrySize = 248; break; + case kHFSPlusFolderThreadRecord : entrySize = 264; break; + case kHFSPlusFileThreadRecord : entrySize = 264; break; + } + } else { + if (gIsHFSPlus) entrySize = sizeof(HFSPlusExtentRecord); + else entrySize = sizeof(HFSExtentRecord); + } + + bcopy(recordData, entry, entrySize); + + // Update dirIndex. + if (dirIndex != 0) { + index++; + if (index == SWAP_BE16(node->numRecords)) { + index = 0; + curNode = SWAP_BE32(node->fLink); + } + *dirIndex = (long long) curNode * nodeSize + index; + } + + free(nodeBuf); + + return 0; +} + +static void GetBTreeRecord(long index, char * nodeBuffer, long nodeSize, + char ** key, char ** data) +{ + long keySize; + long recordOffset; + + recordOffset = SWAP_BE16(*((short *)(nodeBuffer + (nodeSize - 2 * index - 2)))); + *key = nodeBuffer + recordOffset; + if (gIsHFSPlus) { + keySize = SWAP_BE16(*(short *)*key); + *data = *key + 2 + keySize; + } else { + keySize = **key; + *data = *key + 2 + keySize - (keySize & 1); + } +} + +static long ReadExtent(char * extent, uint64_t extentSize, + long extentFile, uint64_t offset, uint64_t size, + void * buffer, long cache) +{ + uint64_t lastOffset; + long long blockNumber, countedBlocks = 0; + long long nextExtent = 0, sizeRead = 0, readSize; + long long nextExtentBlock, currentExtentBlock = 0; + long long readOffset; + long long extentDensity, sizeofExtent, currentExtentSize; + char *currentExtent, *extentBuffer = 0, *bufferPos = buffer; + + if (offset >= extentSize) return 0; + + if (gIsHFSPlus) { + extentDensity = kHFSPlusExtentDensity; + sizeofExtent = sizeof(HFSPlusExtentDescriptor); + } else { + extentDensity = kHFSExtentDensity; + sizeofExtent = sizeof(HFSExtentDescriptor); + } + + lastOffset = offset + size; + while (offset < lastOffset) { + blockNumber = offset / gBlockSize; + + // Find the extent for the offset. + for (; ; nextExtent++) { + if (nextExtent < extentDensity) { + if ((countedBlocks+GetExtentSize(extent, nextExtent)-1)<blockNumber) { + countedBlocks += GetExtentSize(extent, nextExtent); + continue; + } + + currentExtent = extent + nextExtent * sizeofExtent; + break; + } + + if (extentBuffer == 0) { + extentBuffer = malloc(sizeofExtent * extentDensity); + if (extentBuffer == 0) return -1; + } + + nextExtentBlock = nextExtent / extentDensity; + if (currentExtentBlock != nextExtentBlock) { + ReadExtentsEntry(extentFile, countedBlocks, extentBuffer); + currentExtentBlock = nextExtentBlock; + } + + currentExtentSize = GetExtentSize(extentBuffer, nextExtent % extentDensity); + + if ((countedBlocks + currentExtentSize - 1) >= blockNumber) { + currentExtent = extentBuffer + sizeofExtent * (nextExtent % extentDensity); + break; + } + + countedBlocks += currentExtentSize; + } + + readOffset = ((blockNumber - countedBlocks) * gBlockSize) + + (offset % gBlockSize); + + // MacWen: fix overflow in multiplication by forcing 64bit multiplication + readSize = (long long)GetExtentSize(currentExtent, 0) * gBlockSize - readOffset; + if (readSize > (size - sizeRead)) readSize = size - sizeRead; + + readOffset += (long long)GetExtentStart(currentExtent, 0) * gBlockSize; + + CacheRead(gCurrentIH, bufferPos, gAllocationOffset + readOffset, + readSize, cache); + + sizeRead += readSize; + offset += readSize; + bufferPos += readSize; + } + + if (extentBuffer) free(extentBuffer); + + return sizeRead; +} + +static long GetExtentStart(void * extents, long index) +{ + long start; + HFSExtentDescriptor *hfsExtents = extents; + HFSPlusExtentDescriptor *hfsPlusExtents = extents; + + if (gIsHFSPlus) start = SWAP_BE32(hfsPlusExtents[index].startBlock); + else start = SWAP_BE16(hfsExtents[index].startBlock); + + return start; +} + +static long GetExtentSize(void * extents, long index) +{ + long size; + HFSExtentDescriptor *hfsExtents = extents; + HFSPlusExtentDescriptor *hfsPlusExtents = extents; + + if (gIsHFSPlus) size = SWAP_BE32(hfsPlusExtents[index].blockCount); + else size = SWAP_BE16(hfsExtents[index].blockCount); + + return size; +} + +static long CompareHFSCatalogKeys(void * key, void * testKey) +{ + HFSCatalogKey *searchKey, *trialKey; + long result, searchParentID, trialParentID; + + searchKey = key; + trialKey = testKey; + + searchParentID = SWAP_BE32(searchKey->parentID); + trialParentID = SWAP_BE32(trialKey->parentID); + + // parent dirID is unsigned + if (searchParentID > trialParentID) result = 1; + else if (searchParentID < trialParentID) result = -1; + else { + // parent dirID's are equal, compare names + result = FastRelString(searchKey->nodeName, trialKey->nodeName); + } + + return result; +} + +static long CompareHFSPlusCatalogKeys(void * key, void * testKey) +{ + HFSPlusCatalogKey *searchKey, *trialKey; + long result, searchParentID, trialParentID; + + searchKey = key; + trialKey = testKey; + + searchParentID = SWAP_BE32(searchKey->parentID); + trialParentID = SWAP_BE32(trialKey->parentID); + + // parent dirID is unsigned + if (searchParentID > trialParentID) result = 1; + else if (searchParentID < trialParentID) result = -1; + else { + // parent dirID's are equal, compare names + if ((searchKey->nodeName.length == 0) || (trialKey->nodeName.length == 0)) + result = searchKey->nodeName.length - trialKey->nodeName.length; + else + if (gCaseSensitive) { + result = BinaryUnicodeCompare(&searchKey->nodeName.unicode[0], + SWAP_BE16(searchKey->nodeName.length), + &trialKey->nodeName.unicode[0], + SWAP_BE16(trialKey->nodeName.length)); + } else { + result = FastUnicodeCompare(&searchKey->nodeName.unicode[0], + SWAP_BE16(searchKey->nodeName.length), + &trialKey->nodeName.unicode[0], + SWAP_BE16(trialKey->nodeName.length), OSBigEndian); + } + } + + return result; +} + +static long CompareHFSExtentsKeys(void * key, void * testKey) +{ + HFSExtentKey *searchKey, *trialKey; + long result; + + searchKey = key; + trialKey = testKey; + + // assume searchKey < trialKey + result = -1; + + if (searchKey->fileID == trialKey->fileID) { + // FileNum's are equal; compare fork types + if (searchKey->forkType == trialKey->forkType) { + // Fork types are equal; compare allocation block number + if (searchKey->startBlock == trialKey->startBlock) { + // Everything is equal + result = 0; + } else { + // Allocation block numbers differ; determine sign + if (SWAP_BE16(searchKey->startBlock) > SWAP_BE16(trialKey->startBlock)) + result = 1; + } + } else { + // Fork types differ; determine sign + if (searchKey->forkType > trialKey->forkType) result = 1; + } + } else { + // FileNums differ; determine sign + if (SWAP_BE32(searchKey->fileID) > SWAP_BE32(trialKey->fileID)) + result = 1; + } + + return result; +} + +static long CompareHFSPlusExtentsKeys(void * key, void * testKey) +{ + HFSPlusExtentKey *searchKey, *trialKey; + long result; + + searchKey = key; + trialKey = testKey; + + // assume searchKey < trialKey + result = -1; + + if (searchKey->fileID == trialKey->fileID) { + // FileNum's are equal; compare fork types + if (searchKey->forkType == trialKey->forkType) { + // Fork types are equal; compare allocation block number + if (searchKey->startBlock == trialKey->startBlock) { + // Everything is equal + result = 0; + } else { + // Allocation block numbers differ; determine sign + if (SWAP_BE32(searchKey->startBlock) > SWAP_BE32(trialKey->startBlock)) + result = 1; + } + } else { + // Fork types differ; determine sign + if (searchKey->forkType > trialKey->forkType) result = 1; + } + } else { + // FileNums differ; determine sign + if (SWAP_BE32(searchKey->fileID) > SWAP_BE32(trialKey->fileID)) + result = 1; + } + + return result; +} + diff --git a/i386/libsaio/hfs.h b/i386/libsaio/hfs.h new file mode 100644 index 0000000..407f163 --- /dev/null +++ b/i386/libsaio/hfs.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern long HFSInitPartition(CICell ih); +extern long HFSLoadFile(CICell ih, char * filePath); +extern long HFSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length); +extern long HFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +extern void HFSGetDescription(CICell ih, char *str, long strMaxLen); +extern long HFSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); +extern long HFSGetUUID(CICell ih, char *uuidStr); +extern void HFSFree(CICell ih); +extern bool HFSProbe (const void *buf); diff --git a/i386/libsaio/hfs_CaseTables.h b/i386/libsaio/hfs_CaseTables.h new file mode 100644 index 0000000..105007c --- /dev/null +++ b/i386/libsaio/hfs_CaseTables.h @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + File: CaseTables.h +*/ + + +/* The lower case table consists of a 256-entry high-byte table followed by some number of + 256-entry subtables. The high-byte table contains either an offset to the subtable for + characters with that high byte or zero, which means that there are no case mappings or + ignored characters in that block. Ignored characters are mapped to zero. + */ + +#if UNCOMPRESSED +u_int16_t gLowerCaseTable[] = { + + // High-byte indices ( == 0 iff no case mapping and no ignorables ) + + /* 0 */ 0x0100, 0x0200, 0x0000, 0x0300, 0x0400, 0x0500, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 1 */ 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 2 */ 0x0700, 0x0800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 3 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 4 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 5 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 6 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 7 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 8 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 9 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* A */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* B */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* C */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* D */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* E */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* F */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0900, 0x0A00, + + // Table 1 (for high byte 0x00) + + /* 0 */ 0xFFFF, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, + /* 1 */ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, + /* 2 */ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + /* 3 */ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + /* 4 */ 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + /* 5 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + /* 6 */ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + /* 7 */ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, + /* 8 */ 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + /* 9 */ 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + /* A */ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + /* B */ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + /* C */ 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00E6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, + /* D */ 0x00F0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00F8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00FE, 0x00DF, + /* E */ 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + /* F */ 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, + + // Table 2 (for high byte 0x01) + + /* 0 */ 0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, 0x010B, 0x010C, 0x010D, 0x010E, 0x010F, + /* 1 */ 0x0111, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, 0x0119, 0x011A, 0x011B, 0x011C, 0x011D, 0x011E, 0x011F, + /* 2 */ 0x0120, 0x0121, 0x0122, 0x0123, 0x0124, 0x0125, 0x0127, 0x0127, 0x0128, 0x0129, 0x012A, 0x012B, 0x012C, 0x012D, 0x012E, 0x012F, + /* 3 */ 0x0130, 0x0131, 0x0133, 0x0133, 0x0134, 0x0135, 0x0136, 0x0137, 0x0138, 0x0139, 0x013A, 0x013B, 0x013C, 0x013D, 0x013E, 0x0140, + /* 4 */ 0x0140, 0x0142, 0x0142, 0x0143, 0x0144, 0x0145, 0x0146, 0x0147, 0x0148, 0x0149, 0x014B, 0x014B, 0x014C, 0x014D, 0x014E, 0x014F, + /* 5 */ 0x0150, 0x0151, 0x0153, 0x0153, 0x0154, 0x0155, 0x0156, 0x0157, 0x0158, 0x0159, 0x015A, 0x015B, 0x015C, 0x015D, 0x015E, 0x015F, + /* 6 */ 0x0160, 0x0161, 0x0162, 0x0163, 0x0164, 0x0165, 0x0167, 0x0167, 0x0168, 0x0169, 0x016A, 0x016B, 0x016C, 0x016D, 0x016E, 0x016F, + /* 7 */ 0x0170, 0x0171, 0x0172, 0x0173, 0x0174, 0x0175, 0x0176, 0x0177, 0x0178, 0x0179, 0x017A, 0x017B, 0x017C, 0x017D, 0x017E, 0x017F, + /* 8 */ 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, 0x0188, 0x0256, 0x0257, 0x018C, 0x018C, 0x018D, 0x01DD, 0x0259, + /* 9 */ 0x025B, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, 0x0199, 0x0199, 0x019A, 0x019B, 0x026F, 0x0272, 0x019E, 0x0275, + /* A */ 0x01A0, 0x01A1, 0x01A3, 0x01A3, 0x01A5, 0x01A5, 0x01A6, 0x01A8, 0x01A8, 0x0283, 0x01AA, 0x01AB, 0x01AD, 0x01AD, 0x0288, 0x01AF, + /* B */ 0x01B0, 0x028A, 0x028B, 0x01B4, 0x01B4, 0x01B6, 0x01B6, 0x0292, 0x01B9, 0x01B9, 0x01BA, 0x01BB, 0x01BD, 0x01BD, 0x01BE, 0x01BF, + /* C */ 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9, 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC, 0x01CD, 0x01CE, 0x01CF, + /* D */ 0x01D0, 0x01D1, 0x01D2, 0x01D3, 0x01D4, 0x01D5, 0x01D6, 0x01D7, 0x01D8, 0x01D9, 0x01DA, 0x01DB, 0x01DC, 0x01DD, 0x01DE, 0x01DF, + /* E */ 0x01E0, 0x01E1, 0x01E2, 0x01E3, 0x01E5, 0x01E5, 0x01E6, 0x01E7, 0x01E8, 0x01E9, 0x01EA, 0x01EB, 0x01EC, 0x01ED, 0x01EE, 0x01EF, + /* F */ 0x01F0, 0x01F3, 0x01F3, 0x01F3, 0x01F4, 0x01F5, 0x01F6, 0x01F7, 0x01F8, 0x01F9, 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, + + // Table 3 (for high byte 0x03) + + /* 0 */ 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, 0x0308, 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E, 0x030F, + /* 1 */ 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, 0x0318, 0x0319, 0x031A, 0x031B, 0x031C, 0x031D, 0x031E, 0x031F, + /* 2 */ 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327, 0x0328, 0x0329, 0x032A, 0x032B, 0x032C, 0x032D, 0x032E, 0x032F, + /* 3 */ 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337, 0x0338, 0x0339, 0x033A, 0x033B, 0x033C, 0x033D, 0x033E, 0x033F, + /* 4 */ 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x0345, 0x0346, 0x0347, 0x0348, 0x0349, 0x034A, 0x034B, 0x034C, 0x034D, 0x034E, 0x034F, + /* 5 */ 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357, 0x0358, 0x0359, 0x035A, 0x035B, 0x035C, 0x035D, 0x035E, 0x035F, + /* 6 */ 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367, 0x0368, 0x0369, 0x036A, 0x036B, 0x036C, 0x036D, 0x036E, 0x036F, + /* 7 */ 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377, 0x0378, 0x0379, 0x037A, 0x037B, 0x037C, 0x037D, 0x037E, 0x037F, + /* 8 */ 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0386, 0x0387, 0x0388, 0x0389, 0x038A, 0x038B, 0x038C, 0x038D, 0x038E, 0x038F, + /* 9 */ 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + /* A */ 0x03C0, 0x03C1, 0x03A2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + /* B */ 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + /* C */ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x03CF, + /* D */ 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, 0x03D5, 0x03D6, 0x03D7, 0x03D8, 0x03D9, 0x03DA, 0x03DB, 0x03DC, 0x03DD, 0x03DE, 0x03DF, + /* E */ 0x03E0, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7, 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF, + /* F */ 0x03F0, 0x03F1, 0x03F2, 0x03F3, 0x03F4, 0x03F5, 0x03F6, 0x03F7, 0x03F8, 0x03F9, 0x03FA, 0x03FB, 0x03FC, 0x03FD, 0x03FE, 0x03FF, + + // Table 4 (for high byte 0x04) + + /* 0 */ 0x0400, 0x0401, 0x0452, 0x0403, 0x0454, 0x0455, 0x0456, 0x0407, 0x0458, 0x0459, 0x045A, 0x045B, 0x040C, 0x040D, 0x040E, 0x045F, + /* 1 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0419, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + /* 2 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + /* 3 */ 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + /* 4 */ 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + /* 5 */ 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, + /* 6 */ 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, 0x0469, 0x0469, 0x046B, 0x046B, 0x046D, 0x046D, 0x046F, 0x046F, + /* 7 */ 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0476, 0x0477, 0x0479, 0x0479, 0x047B, 0x047B, 0x047D, 0x047D, 0x047F, 0x047F, + /* 8 */ 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, 0x0488, 0x0489, 0x048A, 0x048B, 0x048C, 0x048D, 0x048E, 0x048F, + /* 9 */ 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, 0x0499, 0x0499, 0x049B, 0x049B, 0x049D, 0x049D, 0x049F, 0x049F, + /* A */ 0x04A1, 0x04A1, 0x04A3, 0x04A3, 0x04A5, 0x04A5, 0x04A7, 0x04A7, 0x04A9, 0x04A9, 0x04AB, 0x04AB, 0x04AD, 0x04AD, 0x04AF, 0x04AF, + /* B */ 0x04B1, 0x04B1, 0x04B3, 0x04B3, 0x04B5, 0x04B5, 0x04B7, 0x04B7, 0x04B9, 0x04B9, 0x04BB, 0x04BB, 0x04BD, 0x04BD, 0x04BF, 0x04BF, + /* C */ 0x04C0, 0x04C1, 0x04C2, 0x04C4, 0x04C4, 0x04C5, 0x04C6, 0x04C8, 0x04C8, 0x04C9, 0x04CA, 0x04CC, 0x04CC, 0x04CD, 0x04CE, 0x04CF, + /* D */ 0x04D0, 0x04D1, 0x04D2, 0x04D3, 0x04D4, 0x04D5, 0x04D6, 0x04D7, 0x04D8, 0x04D9, 0x04DA, 0x04DB, 0x04DC, 0x04DD, 0x04DE, 0x04DF, + /* E */ 0x04E0, 0x04E1, 0x04E2, 0x04E3, 0x04E4, 0x04E5, 0x04E6, 0x04E7, 0x04E8, 0x04E9, 0x04EA, 0x04EB, 0x04EC, 0x04ED, 0x04EE, 0x04EF, + /* F */ 0x04F0, 0x04F1, 0x04F2, 0x04F3, 0x04F4, 0x04F5, 0x04F6, 0x04F7, 0x04F8, 0x04F9, 0x04FA, 0x04FB, 0x04FC, 0x04FD, 0x04FE, 0x04FF, + + // Table 5 (for high byte 0x05) + + /* 0 */ 0x0500, 0x0501, 0x0502, 0x0503, 0x0504, 0x0505, 0x0506, 0x0507, 0x0508, 0x0509, 0x050A, 0x050B, 0x050C, 0x050D, 0x050E, 0x050F, + /* 1 */ 0x0510, 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517, 0x0518, 0x0519, 0x051A, 0x051B, 0x051C, 0x051D, 0x051E, 0x051F, + /* 2 */ 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527, 0x0528, 0x0529, 0x052A, 0x052B, 0x052C, 0x052D, 0x052E, 0x052F, + /* 3 */ 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + /* 4 */ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + /* 5 */ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557, 0x0558, 0x0559, 0x055A, 0x055B, 0x055C, 0x055D, 0x055E, 0x055F, + /* 6 */ 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + /* 7 */ 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + /* 8 */ 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587, 0x0588, 0x0589, 0x058A, 0x058B, 0x058C, 0x058D, 0x058E, 0x058F, + /* 9 */ 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597, 0x0598, 0x0599, 0x059A, 0x059B, 0x059C, 0x059D, 0x059E, 0x059F, + /* A */ 0x05A0, 0x05A1, 0x05A2, 0x05A3, 0x05A4, 0x05A5, 0x05A6, 0x05A7, 0x05A8, 0x05A9, 0x05AA, 0x05AB, 0x05AC, 0x05AD, 0x05AE, 0x05AF, + /* B */ 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, 0x05B8, 0x05B9, 0x05BA, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, + /* C */ 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05C4, 0x05C5, 0x05C6, 0x05C7, 0x05C8, 0x05C9, 0x05CA, 0x05CB, 0x05CC, 0x05CD, 0x05CE, 0x05CF, + /* D */ 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + /* E */ 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, 0x05E8, 0x05E9, 0x05EA, 0x05EB, 0x05EC, 0x05ED, 0x05EE, 0x05EF, + /* F */ 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x05F5, 0x05F6, 0x05F7, 0x05F8, 0x05F9, 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF, + + // Table 6 (for high byte 0x10) + + /* 0 */ 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009, 0x100A, 0x100B, 0x100C, 0x100D, 0x100E, 0x100F, + /* 1 */ 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017, 0x1018, 0x1019, 0x101A, 0x101B, 0x101C, 0x101D, 0x101E, 0x101F, + /* 2 */ 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027, 0x1028, 0x1029, 0x102A, 0x102B, 0x102C, 0x102D, 0x102E, 0x102F, + /* 3 */ 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037, 0x1038, 0x1039, 0x103A, 0x103B, 0x103C, 0x103D, 0x103E, 0x103F, + /* 4 */ 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049, 0x104A, 0x104B, 0x104C, 0x104D, 0x104E, 0x104F, + /* 5 */ 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057, 0x1058, 0x1059, 0x105A, 0x105B, 0x105C, 0x105D, 0x105E, 0x105F, + /* 6 */ 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067, 0x1068, 0x1069, 0x106A, 0x106B, 0x106C, 0x106D, 0x106E, 0x106F, + /* 7 */ 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077, 0x1078, 0x1079, 0x107A, 0x107B, 0x107C, 0x107D, 0x107E, 0x107F, + /* 8 */ 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087, 0x1088, 0x1089, 0x108A, 0x108B, 0x108C, 0x108D, 0x108E, 0x108F, + /* 9 */ 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097, 0x1098, 0x1099, 0x109A, 0x109B, 0x109C, 0x109D, 0x109E, 0x109F, + /* A */ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + /* B */ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + /* C */ 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10C6, 0x10C7, 0x10C8, 0x10C9, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, + /* D */ 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + /* E */ 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + /* F */ 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10F6, 0x10F7, 0x10F8, 0x10F9, 0x10FA, 0x10FB, 0x10FC, 0x10FD, 0x10FE, 0x10FF, + + // Table 7 (for high byte 0x20) + + /* 0 */ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x200B, 0x0000, 0x0000, 0x0000, 0x0000, + /* 1 */ 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017, 0x2018, 0x2019, 0x201A, 0x201B, 0x201C, 0x201D, 0x201E, 0x201F, + /* 2 */ 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027, 0x2028, 0x2029, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x202F, + /* 3 */ 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037, 0x2038, 0x2039, 0x203A, 0x203B, 0x203C, 0x203D, 0x203E, 0x203F, + /* 4 */ 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2045, 0x2046, 0x2047, 0x2048, 0x2049, 0x204A, 0x204B, 0x204C, 0x204D, 0x204E, 0x204F, + /* 5 */ 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057, 0x2058, 0x2059, 0x205A, 0x205B, 0x205C, 0x205D, 0x205E, 0x205F, + /* 6 */ 0x2060, 0x2061, 0x2062, 0x2063, 0x2064, 0x2065, 0x2066, 0x2067, 0x2068, 0x2069, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 7 */ 0x2070, 0x2071, 0x2072, 0x2073, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079, 0x207A, 0x207B, 0x207C, 0x207D, 0x207E, 0x207F, + /* 8 */ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x208A, 0x208B, 0x208C, 0x208D, 0x208E, 0x208F, + /* 9 */ 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x2095, 0x2096, 0x2097, 0x2098, 0x2099, 0x209A, 0x209B, 0x209C, 0x209D, 0x209E, 0x209F, + /* A */ 0x20A0, 0x20A1, 0x20A2, 0x20A3, 0x20A4, 0x20A5, 0x20A6, 0x20A7, 0x20A8, 0x20A9, 0x20AA, 0x20AB, 0x20AC, 0x20AD, 0x20AE, 0x20AF, + /* B */ 0x20B0, 0x20B1, 0x20B2, 0x20B3, 0x20B4, 0x20B5, 0x20B6, 0x20B7, 0x20B8, 0x20B9, 0x20BA, 0x20BB, 0x20BC, 0x20BD, 0x20BE, 0x20BF, + /* C */ 0x20C0, 0x20C1, 0x20C2, 0x20C3, 0x20C4, 0x20C5, 0x20C6, 0x20C7, 0x20C8, 0x20C9, 0x20CA, 0x20CB, 0x20CC, 0x20CD, 0x20CE, 0x20CF, + /* D */ 0x20D0, 0x20D1, 0x20D2, 0x20D3, 0x20D4, 0x20D5, 0x20D6, 0x20D7, 0x20D8, 0x20D9, 0x20DA, 0x20DB, 0x20DC, 0x20DD, 0x20DE, 0x20DF, + /* E */ 0x20E0, 0x20E1, 0x20E2, 0x20E3, 0x20E4, 0x20E5, 0x20E6, 0x20E7, 0x20E8, 0x20E9, 0x20EA, 0x20EB, 0x20EC, 0x20ED, 0x20EE, 0x20EF, + /* F */ 0x20F0, 0x20F1, 0x20F2, 0x20F3, 0x20F4, 0x20F5, 0x20F6, 0x20F7, 0x20F8, 0x20F9, 0x20FA, 0x20FB, 0x20FC, 0x20FD, 0x20FE, 0x20FF, + + // Table 8 (for high byte 0x21) + + /* 0 */ 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, 0x2108, 0x2109, 0x210A, 0x210B, 0x210C, 0x210D, 0x210E, 0x210F, + /* 1 */ 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, 0x2118, 0x2119, 0x211A, 0x211B, 0x211C, 0x211D, 0x211E, 0x211F, + /* 2 */ 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x2126, 0x2127, 0x2128, 0x2129, 0x212A, 0x212B, 0x212C, 0x212D, 0x212E, 0x212F, + /* 3 */ 0x2130, 0x2131, 0x2132, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137, 0x2138, 0x2139, 0x213A, 0x213B, 0x213C, 0x213D, 0x213E, 0x213F, + /* 4 */ 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147, 0x2148, 0x2149, 0x214A, 0x214B, 0x214C, 0x214D, 0x214E, 0x214F, + /* 5 */ 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215A, 0x215B, 0x215C, 0x215D, 0x215E, 0x215F, + /* 6 */ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + /* 7 */ 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + /* 8 */ 0x2180, 0x2181, 0x2182, 0x2183, 0x2184, 0x2185, 0x2186, 0x2187, 0x2188, 0x2189, 0x218A, 0x218B, 0x218C, 0x218D, 0x218E, 0x218F, + /* 9 */ 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197, 0x2198, 0x2199, 0x219A, 0x219B, 0x219C, 0x219D, 0x219E, 0x219F, + /* A */ 0x21A0, 0x21A1, 0x21A2, 0x21A3, 0x21A4, 0x21A5, 0x21A6, 0x21A7, 0x21A8, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21AE, 0x21AF, + /* B */ 0x21B0, 0x21B1, 0x21B2, 0x21B3, 0x21B4, 0x21B5, 0x21B6, 0x21B7, 0x21B8, 0x21B9, 0x21BA, 0x21BB, 0x21BC, 0x21BD, 0x21BE, 0x21BF, + /* C */ 0x21C0, 0x21C1, 0x21C2, 0x21C3, 0x21C4, 0x21C5, 0x21C6, 0x21C7, 0x21C8, 0x21C9, 0x21CA, 0x21CB, 0x21CC, 0x21CD, 0x21CE, 0x21CF, + /* D */ 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x21D4, 0x21D5, 0x21D6, 0x21D7, 0x21D8, 0x21D9, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21DE, 0x21DF, + /* E */ 0x21E0, 0x21E1, 0x21E2, 0x21E3, 0x21E4, 0x21E5, 0x21E6, 0x21E7, 0x21E8, 0x21E9, 0x21EA, 0x21EB, 0x21EC, 0x21ED, 0x21EE, 0x21EF, + /* F */ 0x21F0, 0x21F1, 0x21F2, 0x21F3, 0x21F4, 0x21F5, 0x21F6, 0x21F7, 0x21F8, 0x21F9, 0x21FA, 0x21FB, 0x21FC, 0x21FD, 0x21FE, 0x21FF, + + // Table 9 (for high byte 0xFE) + + /* 0 */ 0xFE00, 0xFE01, 0xFE02, 0xFE03, 0xFE04, 0xFE05, 0xFE06, 0xFE07, 0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, 0xFE0E, 0xFE0F, + /* 1 */ 0xFE10, 0xFE11, 0xFE12, 0xFE13, 0xFE14, 0xFE15, 0xFE16, 0xFE17, 0xFE18, 0xFE19, 0xFE1A, 0xFE1B, 0xFE1C, 0xFE1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9D, 0xFF9E, 0xFF9F, + /* A */ 0xFFA0, 0xFFA1, 0xFFA2, 0xFFA3, 0xFFA4, 0xFFA5, 0xFFA6, 0xFFA7, 0xFFA8, 0xFFA9, 0xFFAA, 0xFFAB, 0xFFAC, 0xFFAD, 0xFFAE, 0xFFAF, + /* B */ 0xFFB0, 0xFFB1, 0xFFB2, 0xFFB3, 0xFFB4, 0xFFB5, 0xFFB6, 0xFFB7, 0xFFB8, 0xFFB9, 0xFFBA, 0xFFBB, 0xFFBC, 0xFFBD, 0xFFBE, 0xFFBF, + /* C */ 0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC4, 0xFFC5, 0xFFC6, 0xFFC7, 0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, 0xFFCE, 0xFFCF, + /* D */ 0xFFD0, 0xFFD1, 0xFFD2, 0xFFD3, 0xFFD4, 0xFFD5, 0xFFD6, 0xFFD7, 0xFFD8, 0xFFD9, 0xFFDA, 0xFFDB, 0xFFDC, 0xFFDD, 0xFFDE, 0xFFDF, + /* E */ 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE3, 0xFFE4, 0xFFE5, 0xFFE6, 0xFFE7, 0xFFE8, 0xFFE9, 0xFFEA, 0xFFEB, 0xFFEC, 0xFFED, 0xFFEE, 0xFFEF, + /* F */ 0xFFF0, 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6, 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF, +}; + +/* RelString case folding table */ + +unsigned short gCompareTable[] = { + + /* 0 */ 0x0000, 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0700, 0x0800, 0x0900, 0x0A00, 0x0B00, 0x0C00, 0x0D00, 0x0E00, 0x0F00, + /* 1 */ 0x1000, 0x1100, 0x1200, 0x1300, 0x1400, 0x1500, 0x1600, 0x1700, 0x1800, 0x1900, 0x1A00, 0x1B00, 0x1C00, 0x1D00, 0x1E00, 0x1F00, + /* 2 */ 0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2600, 0x2700, 0x2800, 0x2900, 0x2A00, 0x2B00, 0x2C00, 0x2D00, 0x2E00, 0x2F00, + /* 3 */ 0x3000, 0x3100, 0x3200, 0x3300, 0x3400, 0x3500, 0x3600, 0x3700, 0x3800, 0x3900, 0x3A00, 0x3B00, 0x3C00, 0x3D00, 0x3E00, 0x3F00, + /* 4 */ 0x4000, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, + /* 5 */ 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x5C00, 0x5D00, 0x5E00, 0x5F00, + + // 0x60 maps to 'a' + // range 0x61 to 0x7a ('a' to 'z') map to upper case + + /* 6 */ 0x4180, 0x4100, 0x4200, 0x4300, 0x4400, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00, 0x4B00, 0x4C00, 0x4D00, 0x4E00, 0x4F00, + /* 7 */ 0x5000, 0x5100, 0x5200, 0x5300, 0x5400, 0x5500, 0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x7B00, 0x7C00, 0x7D00, 0x7E00, 0x7F00, + + // range 0x80 to 0xd8 gets mapped... + + /* 8 */ 0x4108, 0x410C, 0x4310, 0x4502, 0x4E0A, 0x4F08, 0x5508, 0x4182, 0x4104, 0x4186, 0x4108, 0x410A, 0x410C, 0x4310, 0x4502, 0x4584, + /* 9 */ 0x4586, 0x4588, 0x4982, 0x4984, 0x4986, 0x4988, 0x4E0A, 0x4F82, 0x4F84, 0x4F86, 0x4F08, 0x4F0A, 0x5582, 0x5584, 0x5586, 0x5508, + /* A */ 0xA000, 0xA100, 0xA200, 0xA300, 0xA400, 0xA500, 0xA600, 0x5382, 0xA800, 0xA900, 0xAA00, 0xAB00, 0xAC00, 0xAD00, 0x4114, 0x4F0E, + /* B */ 0xB000, 0xB100, 0xB200, 0xB300, 0xB400, 0xB500, 0xB600, 0xB700, 0xB800, 0xB900, 0xBA00, 0x4192, 0x4F92, 0xBD00, 0x4114, 0x4F0E, + /* C */ 0xC000, 0xC100, 0xC200, 0xC300, 0xC400, 0xC500, 0xC600, 0x2206, 0x2208, 0xC900, 0x2000, 0x4104, 0x410A, 0x4F0A, 0x4F14, 0x4F14, + /* D */ 0xD000, 0xD100, 0x2202, 0x2204, 0x2702, 0x2704, 0xD600, 0xD700, 0x5988, 0xD900, 0xDA00, 0xDB00, 0xDC00, 0xDD00, 0xDE00, 0xDF00, + + /* E */ 0xE000, 0xE100, 0xE200, 0xE300, 0xE400, 0xE500, 0xE600, 0xE700, 0xE800, 0xE900, 0xEA00, 0xEB00, 0xEC00, 0xED00, 0xEE00, 0xEF00, + /* F */ 0xF000, 0xF100, 0xF200, 0xF300, 0xF400, 0xF500, 0xF600, 0xF700, 0xF800, 0xF900, 0xFA00, 0xFB00, 0xFC00, 0xFD00, 0xFE00, 0xFF00, + +}; +#else /* ! UNCOMPRESSED */ + +enum { + kTypeLiteral = 0, + kTypeAscending = 1, + kTypeAscending256 = 2 +}; + +struct compressed_block { + unsigned char type; + unsigned char count; + unsigned short data; +}; + +unsigned short *gLowerCaseTable; + +struct compressed_block gLowerCaseTableCompressed[] = { + {0x0, 0x1, 0x100}, + {0x0, 0x1, 0x200}, + {0x0, 0x1, 0x0}, + {0x0, 0x1, 0x300}, + {0x0, 0x1, 0x400}, + {0x0, 0x1, 0x500}, + {0x0, 0xa, 0x0}, + {0x0, 0x1, 0x600}, + {0x0, 0xf, 0x0}, + {0x0, 0x1, 0x700}, + {0x0, 0x1, 0x800}, + {0x0, 0xdc, 0x0}, + {0x0, 0x1, 0x900}, + {0x0, 0x1, 0xa00}, + {0x0, 0x1, 0xffff}, + {0x1, 0x40, 0x1}, + {0x1, 0x1a, 0x61}, + {0x1, 0x6b, 0x5b}, + {0x0, 0x1, 0xe6}, + {0x1, 0x9, 0xc7}, + {0x0, 0x1, 0xf0}, + {0x1, 0x7, 0xd1}, + {0x0, 0x1, 0xf8}, + {0x1, 0x5, 0xd9}, + {0x0, 0x1, 0xfe}, + {0x1, 0x31, 0xdf}, + {0x0, 0x2, 0x111}, + {0x1, 0x14, 0x112}, + {0x0, 0x2, 0x127}, + {0x1, 0xa, 0x128}, + {0x0, 0x2, 0x133}, + {0x1, 0xb, 0x134}, + {0x0, 0x2, 0x140}, + {0x0, 0x2, 0x142}, + {0x1, 0x7, 0x143}, + {0x0, 0x2, 0x14b}, + {0x1, 0x6, 0x14c}, + {0x0, 0x2, 0x153}, + {0x1, 0x12, 0x154}, + {0x0, 0x2, 0x167}, + {0x1, 0x19, 0x168}, + {0x0, 0x1, 0x253}, + {0x0, 0x2, 0x183}, + {0x0, 0x2, 0x185}, + {0x0, 0x1, 0x254}, + {0x0, 0x2, 0x188}, + {0x1, 0x2, 0x256}, + {0x0, 0x2, 0x18c}, + {0x0, 0x1, 0x18d}, + {0x0, 0x1, 0x1dd}, + {0x0, 0x1, 0x259}, + {0x0, 0x1, 0x25b}, + {0x0, 0x2, 0x192}, + {0x0, 0x1, 0x260}, + {0x0, 0x1, 0x263}, + {0x0, 0x1, 0x195}, + {0x0, 0x1, 0x269}, + {0x0, 0x1, 0x268}, + {0x0, 0x2, 0x199}, + {0x1, 0x2, 0x19a}, + {0x0, 0x1, 0x26f}, + {0x0, 0x1, 0x272}, + {0x0, 0x1, 0x19e}, + {0x0, 0x1, 0x275}, + {0x1, 0x2, 0x1a0}, + {0x0, 0x2, 0x1a3}, + {0x0, 0x2, 0x1a5}, + {0x0, 0x1, 0x1a6}, + {0x0, 0x2, 0x1a8}, + {0x0, 0x1, 0x283}, + {0x1, 0x2, 0x1aa}, + {0x0, 0x2, 0x1ad}, + {0x0, 0x1, 0x288}, + {0x1, 0x2, 0x1af}, + {0x1, 0x2, 0x28a}, + {0x0, 0x2, 0x1b4}, + {0x0, 0x2, 0x1b6}, + {0x0, 0x1, 0x292}, + {0x0, 0x2, 0x1b9}, + {0x1, 0x2, 0x1ba}, + {0x0, 0x2, 0x1bd}, + {0x1, 0x6, 0x1be}, + {0x0, 0x3, 0x1c6}, + {0x0, 0x3, 0x1c9}, + {0x0, 0x3, 0x1cc}, + {0x1, 0x17, 0x1cd}, + {0x0, 0x2, 0x1e5}, + {0x1, 0xb, 0x1e6}, + {0x0, 0x3, 0x1f3}, + {0x1, 0xc, 0x1f4}, + {0x1, 0x91, 0x300}, + {0x1, 0x11, 0x3b1}, + {0x0, 0x1, 0x3a2}, + {0x1, 0x7, 0x3c3}, + {0x1, 0x38, 0x3aa}, + {0x0, 0x2, 0x3e3}, + {0x0, 0x2, 0x3e5}, + {0x0, 0x2, 0x3e7}, + {0x0, 0x2, 0x3e9}, + {0x0, 0x2, 0x3eb}, + {0x0, 0x2, 0x3ed}, + {0x0, 0x2, 0x3ef}, + {0x1, 0x12, 0x3f0}, + {0x0, 0x1, 0x452}, + {0x0, 0x1, 0x403}, + {0x1, 0x3, 0x454}, + {0x0, 0x1, 0x407}, + {0x1, 0x4, 0x458}, + {0x1, 0x3, 0x40c}, + {0x0, 0x1, 0x45f}, + {0x1, 0x9, 0x430}, + {0x0, 0x1, 0x419}, + {0x1, 0x16, 0x43a}, + {0x1, 0x30, 0x430}, + {0x0, 0x2, 0x461}, + {0x0, 0x2, 0x463}, + {0x0, 0x2, 0x465}, + {0x0, 0x2, 0x467}, + {0x0, 0x2, 0x469}, + {0x0, 0x2, 0x46b}, + {0x0, 0x2, 0x46d}, + {0x0, 0x2, 0x46f}, + {0x0, 0x2, 0x471}, + {0x0, 0x2, 0x473}, + {0x0, 0x2, 0x475}, + {0x1, 0x2, 0x476}, + {0x0, 0x2, 0x479}, + {0x0, 0x2, 0x47b}, + {0x0, 0x2, 0x47d}, + {0x0, 0x2, 0x47f}, + {0x0, 0x2, 0x481}, + {0x1, 0xe, 0x482}, + {0x0, 0x2, 0x491}, + {0x0, 0x2, 0x493}, + {0x0, 0x2, 0x495}, + {0x0, 0x2, 0x497}, + {0x0, 0x2, 0x499}, + {0x0, 0x2, 0x49b}, + {0x0, 0x2, 0x49d}, + {0x0, 0x2, 0x49f}, + {0x0, 0x2, 0x4a1}, + {0x0, 0x2, 0x4a3}, + {0x0, 0x2, 0x4a5}, + {0x0, 0x2, 0x4a7}, + {0x0, 0x2, 0x4a9}, + {0x0, 0x2, 0x4ab}, + {0x0, 0x2, 0x4ad}, + {0x0, 0x2, 0x4af}, + {0x0, 0x2, 0x4b1}, + {0x0, 0x2, 0x4b3}, + {0x0, 0x2, 0x4b5}, + {0x0, 0x2, 0x4b7}, + {0x0, 0x2, 0x4b9}, + {0x0, 0x2, 0x4bb}, + {0x0, 0x2, 0x4bd}, + {0x0, 0x2, 0x4bf}, + {0x1, 0x3, 0x4c0}, + {0x0, 0x2, 0x4c4}, + {0x1, 0x2, 0x4c5}, + {0x0, 0x2, 0x4c8}, + {0x1, 0x2, 0x4c9}, + {0x0, 0x2, 0x4cc}, + {0x1, 0x64, 0x4cd}, + {0x1, 0x26, 0x561}, + {0x1, 0xa9, 0x557}, + {0x1, 0xa0, 0x1000}, + {0x1, 0x26, 0x10d0}, + {0x1, 0x3a, 0x10c6}, + {0x1, 0xc, 0x2000}, + {0x0, 0x4, 0x0}, + {0x1, 0x1a, 0x2010}, + {0x0, 0x5, 0x0}, + {0x1, 0x3b, 0x202f}, + {0x0, 0x6, 0x0}, + {0x1, 0xf0, 0x2070}, + {0x1, 0x10, 0x2170}, + {0x1, 0x90, 0x2170}, + {0x1, 0xff, 0xfe00}, + {0x0, 0x1, 0x0}, + {0x1, 0x21, 0xff00}, + {0x1, 0x1a, 0xff41}, + {0x1, 0xc5, 0xff3b}, +}; +// Please update count if you add/remove entries but also please just let +// the compiler calculate it so you don't get it wrong. +//#define kLowerCaseTableNBlocks 182 +#define kLowerCaseTableNBlocks (sizeof(gLowerCaseTableCompressed)/sizeof(*gLowerCaseTableCompressed)) +// WARNING: The expanded size MUST be updated if you change the table and +// cannot be calculated at compile time. +#define kLowerCaseTableDataSize 5632 /* size of uncompressed structure in bytes */ + +unsigned short *gCompareTable; + +struct compressed_block gCompareTableCompressed[] = { + {0x2, 0x60, 0x0}, + {0x0, 0x1, 0x4180}, + {0x2, 0x1a, 0x4100}, + {0x2, 0x5, 0x7b00}, + {0x0, 0x1, 0x4108}, + {0x0, 0x1, 0x410c}, + {0x0, 0x1, 0x4310}, + {0x0, 0x1, 0x4502}, + {0x0, 0x1, 0x4e0a}, + {0x0, 0x1, 0x4f08}, + {0x0, 0x1, 0x5508}, + {0x0, 0x1, 0x4182}, + {0x0, 0x1, 0x4104}, + {0x0, 0x1, 0x4186}, + {0x0, 0x1, 0x4108}, + {0x0, 0x1, 0x410a}, + {0x0, 0x1, 0x410c}, + {0x0, 0x1, 0x4310}, + {0x0, 0x1, 0x4502}, + {0x0, 0x1, 0x4584}, + {0x0, 0x1, 0x4586}, + {0x0, 0x1, 0x4588}, + {0x0, 0x1, 0x4982}, + {0x0, 0x1, 0x4984}, + {0x0, 0x1, 0x4986}, + {0x0, 0x1, 0x4988}, + {0x0, 0x1, 0x4e0a}, + {0x0, 0x1, 0x4f82}, + {0x0, 0x1, 0x4f84}, + {0x0, 0x1, 0x4f86}, + {0x0, 0x1, 0x4f08}, + {0x0, 0x1, 0x4f0a}, + {0x0, 0x1, 0x5582}, + {0x0, 0x1, 0x5584}, + {0x0, 0x1, 0x5586}, + {0x0, 0x1, 0x5508}, + {0x2, 0x7, 0xa000}, + {0x0, 0x1, 0x5382}, + {0x2, 0x6, 0xa800}, + {0x0, 0x1, 0x4114}, + {0x0, 0x1, 0x4f0e}, + {0x2, 0xb, 0xb000}, + {0x0, 0x1, 0x4192}, + {0x0, 0x1, 0x4f92}, + {0x0, 0x1, 0xbd00}, + {0x0, 0x1, 0x4114}, + {0x0, 0x1, 0x4f0e}, + {0x2, 0x7, 0xc000}, + {0x0, 0x1, 0x2206}, + {0x0, 0x1, 0x2208}, + {0x0, 0x1, 0xc900}, + {0x0, 0x1, 0x2000}, + {0x0, 0x1, 0x4104}, + {0x0, 0x1, 0x410a}, + {0x0, 0x1, 0x4f0a}, + {0x0, 0x2, 0x4f14}, + {0x2, 0x2, 0xd000}, + {0x0, 0x1, 0x2202}, + {0x0, 0x1, 0x2204}, + {0x0, 0x1, 0x2702}, + {0x0, 0x1, 0x2704}, + {0x2, 0x2, 0xd600}, + {0x0, 0x1, 0x5988}, + {0x2, 0x27, 0xd900}, +}; +// Please update count if you add/remove entries but also please just let +// the compiler calculate it so you don't get it wrong. +//#define kCompareTableNBlocks 64 +#define kCompareTableNBlocks (sizeof(gCompareTableCompressed)/sizeof(*gCompareTableCompressed)) +// WARNING: The expanded size MUST be updated if you change the table and +// cannot be calculated at compile time. +#define kCompareTableDataSize 512 /* size of uncompressed structure in bytes */ + +#endif /* UNCOMPRESSED */ diff --git a/i386/libsaio/hfs_compare.c b/i386/libsaio/hfs_compare.c new file mode 100644 index 0000000..abf2ba2 --- /dev/null +++ b/i386/libsaio/hfs_compare.c @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * HFSCompare.c - Functions for working with and comparing HFS nams. + * + * Copyright (c) 1999-2000 Apple Computer, Inc. + * + * DRI: Josh de Cesare + */ + +#include <sl.h> +#include "hfs_CaseTables.h" + +#if ! UNCOMPRESSED + +static unsigned short * +UncompressStructure(struct compressed_block *bp, int count, int size) +{ + unsigned short *out = malloc(size); + unsigned short *op = out; + unsigned short data; + int i, j; + + for (i=0; i<count; i++, bp++) { + // If this happens (it shouldn't) please fix size and/or double check that count really is + // the number of elements in the array. + // This was a very hard bug to find, so please leave this code here. + if(out + size <= op + bp->count) + { + stop("HFS+ Unicode tables are malformed\n"); + } + data = bp->data; + for (j=0; j<bp->count; j++) { + *op++ = data; + if (bp->type == kTypeAscending) data++; + else if (bp->type == kTypeAscending256) data += 256; + } + } + return out; +} + +static void +InitCompareTables(void) +{ + if (gCompareTable == 0) { + gCompareTable = UncompressStructure(gCompareTableCompressed, + kCompareTableNBlocks, kCompareTableDataSize); + gLowerCaseTable = UncompressStructure(gLowerCaseTableCompressed, + kLowerCaseTableNBlocks, kLowerCaseTableDataSize); + } +} + +#endif /* ! UNCOMPRESSED */ + +//_______________________________________________________________________ +// +// Routine: FastRelString +// +// Output: returns -1 if str1 < str2 +// returns 1 if str1 > str2 +// return 0 if equal +// +//_______________________________________________________________________ + +int32_t FastRelString(u_int8_t * str1, u_int8_t * str2) +{ + int32_t bestGuess; + u_int8_t length, length2; + +#if ! UNCOMPRESED + InitCompareTables(); +#endif + + length = *(str1++); + length2 = *(str2++); + + if (length == length2) + bestGuess = 0; + else if (length < length2) + bestGuess = -1; + else + { + bestGuess = 1; + length = length2; + } + + while (length--) + { + u_int32_t aChar, bChar; + + aChar = *(str1++); + bChar = *(str2++); + + if (aChar != bChar) /* If they don't match exacly, do case conversion */ + { + u_int16_t aSortWord, bSortWord; + + aSortWord = gCompareTable[aChar]; + bSortWord = gCompareTable[bChar]; + + if (aSortWord > bSortWord) + return 1; + + if (aSortWord < bSortWord) + return -1; + } + + /* + * If characters match exactly, then go on to next character + * immediately without doing any extra work. + */ + } + + /* if you got to here, then return bestGuess */ + return bestGuess; +} + + +// +// FastUnicodeCompare - Compare two Unicode strings; produce a relative ordering +// +// IF RESULT +// -------------------------- +// str1 < str2 => -1 +// str1 = str2 => 0 +// str1 > str2 => +1 +// +// The lower case table starts with 256 entries (one for each of the upper bytes +// of the original Unicode char). If that entry is zero, then all characters with +// that upper byte are already case folded. If the entry is non-zero, then it is +// the _index_ (not byte offset) of the start of the sub-table for the characters +// with that upper byte. All ignorable characters are folded to the value zero. +// +// In pseudocode: +// +// Let c = source Unicode character +// Let table[] = lower case table +// +// lower = table[highbyte(c)] +// if (lower == 0) +// lower = c +// else +// lower = table[lower+lowbyte(c)] +// +// if (lower == 0) +// ignore this character +// +// To handle ignorable characters, we now need a loop to find the next valid character. +// Also, we can't pre-compute the number of characters to compare; the string length might +// be larger than the number of non-ignorable characters. Further, we must be able to handle +// ignorable characters at any point in the string, including as the first or last characters. +// We use a zero value as a sentinel to detect both end-of-string and ignorable characters. +// Since the File Manager doesn't prevent the NUL character (value zero) as part of a filename, +// the case mapping table is assumed to map u+0000 to some non-zero value (like 0xFFFF, which is +// an invalid Unicode character). +// +// Pseudocode: +// +// while (1) { +// c1 = GetNextValidChar(str1) // returns zero if at end of string +// c2 = GetNextValidChar(str2) +// +// if (c1 != c2) break // found a difference +// +// if (c1 == 0) // reached end of string on both strings at once? +// return 0; // yes, so strings are equal +// } +// +// // When we get here, c1 != c2. So, we just need to determine which one is less. +// if (c1 < c2) +// return -1; +// else +// return 1; +// + +int32_t FastUnicodeCompare( u_int16_t * str1, register u_int32_t length1, + u_int16_t * str2, register u_int32_t length2, int byte_order ) +{ + register u_int16_t c1,c2; + register u_int16_t temp; + +#if ! UNCOMPRESSED + InitCompareTables(); +#endif + + while (1) { + /* Set default values for c1, c2 in case there are no more valid chars */ + c1 = 0; + c2 = 0; + + /* Find next non-ignorable char from str1, or zero if no more */ + while (length1 && c1 == 0) { + if (byte_order == OSBigEndian) + c1 = SWAP_BE16(*(str1++)); + else + c1 = SWAP_LE16(*(str1++)); + --length1; + if ((temp = gLowerCaseTable[c1>>8]) != 0) // is there a subtable for this upper byte? + c1 = gLowerCaseTable[temp + (c1 & 0x00FF)]; // yes, so fold the char + } + + /* Find next non-ignorable char from str2, or zero if no more */ + while (length2 && c2 == 0) { + if (byte_order == OSBigEndian) + c2 = SWAP_BE16(*(str2++)); + else + c2 = SWAP_LE16(*(str2++)); + --length2; + if ((temp = gLowerCaseTable[c2>>8]) != 0) // is there a subtable for this upper byte? + c2 = gLowerCaseTable[temp + (c2 & 0x00FF)]; // yes, so fold the char + } + + if (c1 != c2) /* found a difference, so stop looping */ + break; + + if (c1 == 0) /* did we reach the end of both strings at the same time? */ + return 0; /* yes, so strings are equal */ + } + + if (c1 < c2) + return -1; + else + return 1; +} + + +// +// BinaryUnicodeCompare - Compare two Unicode strings; produce a relative ordering +// Compared using a 16-bit binary comparison (no case folding) +// +int32_t BinaryUnicodeCompare (u_int16_t * str1, u_int32_t length1, + u_int16_t * str2, u_int32_t length2) +{ + register u_int16_t c1, c2; + int32_t bestGuess; + u_int32_t length; + + bestGuess = 0; + + if (length1 < length2) { + length = length1; + --bestGuess; + } else if (length1 > length2) { + length = length2; + ++bestGuess; + } else { + length = length1; + } + + while (length--) { + c1 = *(str1++); + c2 = *(str2++); + + if (c1 > c2) + return (1); + if (c1 < c2) + return (-1); + } + + return (bestGuess); +} + + +/* + * UTF-8 (UCS Transformation Format) + * + * The following subset of UTF-8 is used to encode UCS-2 filenames. It + * requires a maximum of three 3 bytes per UCS-2 character. Only the + * shortest encoding required to represent the significant UCS-2 bits + * is legal. + * + * UTF-8 Multibyte Codes + * + * Bytes Bits UCS-2 Min UCS-2 Max UTF-8 Byte Sequence (binary) + * ------------------------------------------------------------------- + * 1 7 0x0000 0x007F 0xxxxxxx + * 2 11 0x0080 0x07FF 110xxxxx 10xxxxxx + * 3 16 0x0800 0xFFFF 1110xxxx 10xxxxxx 10xxxxxx + * ------------------------------------------------------------------- + */ + + +/* + * utf_encodestr - Encodes the UCS-2 (Unicode) string at ucsp into a + * null terminated UTF-8 string at utf8p. + * + * ucslen is the number of UCS-2 input characters (not bytes) + * bufsize is the size of the output buffer in bytes + */ +void +utf_encodestr( const u_int16_t * ucsp, int ucslen, + u_int8_t * utf8p, u_int32_t bufsize, int byte_order ) +{ + u_int8_t *bufend; + u_int16_t ucs_ch; + + bufend = utf8p + bufsize; + + while (ucslen-- > 0) { + if (byte_order == OSBigEndian) + ucs_ch = SWAP_BE16(*ucsp++); + else + ucs_ch = SWAP_LE16(*ucsp++); + + if (ucs_ch < 0x0080) { + if (utf8p >= bufend) + break; + if (ucs_ch == '\0') + continue; /* skip over embedded NULLs */ + *utf8p++ = ucs_ch; + + } else if (ucs_ch < 0x800) { + if ((utf8p + 1) >= bufend) + break; + *utf8p++ = (ucs_ch >> 6) | 0xc0; + *utf8p++ = (ucs_ch & 0x3f) | 0x80; + + } else { + if ((utf8p + 2) >= bufend) + break; + *utf8p++ = (ucs_ch >> 12) | 0xe0; + *utf8p++ = ((ucs_ch >> 6) & 0x3f) | 0x80; + *utf8p++ = ((ucs_ch) & 0x3f) | 0x80; + } + } + + *utf8p = '\0'; +} + + +/* + * utf_decodestr - Decodes the null terminated UTF-8 string at + * utf8p into a UCS-2 (Unicode) string at ucsp. + * + * ucslen is the number of UCS-2 output characters (not bytes) + * bufsize is the size of the output buffer in bytes + */ +void utf_decodestr(const u_int8_t * utf8p, u_int16_t * ucsp, u_int16_t * ucslen, u_int32_t bufsize, int byte_order) +{ + u_int16_t *bufstart; + u_int16_t *bufend; + u_int16_t ucs_ch; + u_int8_t byte; + + bufstart = ucsp; + bufend = (u_int16_t *)((u_int8_t *)ucsp + bufsize); + + while ((byte = *utf8p++) != '\0') { + if (ucsp >= bufend) + break; + + /* check for ascii */ + if (byte < 0x80) { + ucs_ch = byte; + + if (byte_order == OSBigEndian) + *ucsp++ = SWAP_BE16(ucs_ch); + else + *ucsp++ = SWAP_LE16(ucs_ch); + + continue; + } + + switch (byte & 0xf0) { + /* 2 byte sequence*/ + case 0xc0: + case 0xd0: + /* extract bits 6 - 10 from first byte */ + ucs_ch = (byte & 0x1F) << 6; + break; + /* 3 byte sequence*/ + case 0xe0: + /* extract bits 12 - 15 from first byte */ + ucs_ch = (byte & 0x0F) << 6; + + /* extract bits 6 - 11 from second byte */ + if (((byte = *utf8p++) & 0xc0) != 0x80) + goto stop; + + ucs_ch += (byte & 0x3F); + ucs_ch <<= 6; + break; + default: + goto stop; + } + + /* extract bits 0 - 5 from final byte */ + if (((byte = *utf8p++) & 0xc0) != 0x80) + goto stop; + ucs_ch += (byte & 0x3F); + + if (byte_order == OSBigEndian) + *ucsp++ = SWAP_BE16(ucs_ch); + else + *ucsp++ = SWAP_LE16(ucs_ch); + } +stop: + if (byte_order == OSBigEndian) + *ucslen = SWAP_BE16(ucsp - bufstart); + else + *ucslen = SWAP_LE16(ucsp - bufstart); +} diff --git a/i386/libsaio/hpet.c b/i386/libsaio/hpet.c new file mode 100644 index 0000000..8c73bda --- /dev/null +++ b/i386/libsaio/hpet.c @@ -0,0 +1,103 @@ +/* + * + */ + +#include "libsaio.h" +#include "pci.h" +#include "hpet.h" + +#ifndef DEBUG_HPET +#define DEBUG_HPET 0 +#endif + +#if DEBUG_HPET +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +static struct lpc_controller_t lpc_controllers[] = { + + // Default unknown chipset + { 0, 0, "" }, + + // Intel + { 0x8086, 0x24dc, "ICH5" }, + { 0x8086, 0x2640, "ICH6" }, + { 0x8086, 0x2641, "ICH6M" }, + + { 0x8086, 0x27b0, "ICH7 DH" }, + { 0x8086, 0x27b8, "ICH7" }, + { 0x8086, 0x27b9, "ICH7M" }, + { 0x8086, 0x27bd, "ICH7M DH" }, + + { 0x8086, 0x2810, "ICH8R" }, + { 0x8086, 0x2811, "ICH8M-E" }, + { 0x8086, 0x2812, "ICH8DH" }, + { 0x8086, 0x2814, "ICH8DO" }, + { 0x8086, 0x2815, "ICH8M" }, + + { 0x8086, 0x2912, "ICH9DH" }, + { 0x8086, 0x2914, "ICH9DO" }, + { 0x8086, 0x2916, "ICH9R" }, + { 0x8086, 0x2917, "ICH9M-E" }, + { 0x8086, 0x2918, "ICH9" }, + { 0x8086, 0x2919, "ICH9M" }, + + { 0x8086, 0x3a14, "ICH10DO" }, + { 0x8086, 0x3a16, "ICH10R" }, + { 0x8086, 0x3a18, "ICH10" }, + { 0x8086, 0x3a1a, "ICH10D" }, + +}; + +void force_enable_hpet(pci_dt_t *lpc_dev) +{ + int i; + uint32_t val, hpet_address = 0xFED00000; + void *rcba; + + /* LPC on Intel ICH is always (?) at 00:1f.0 */ + for(i = 1; i < sizeof(lpc_controllers) / sizeof(lpc_controllers[0]); i++) + if ((lpc_controllers[i].vendor == lpc_dev->vendor_id) + && (lpc_controllers[i].device == lpc_dev->device_id)) + { + rcba = (void *)(pci_config_read32(lpc_dev->dev.addr, 0xF0) & 0xFFFFC000); + + DBG("Intel(R) %s LPC Interface [%04x:%04x], MMIO @ 0x%lx\n", + lpc_controllers[i].name, lpc_dev->vendor_id, lpc_dev->device_id, rcba); + + if (rcba == 0) + printf(" RCBA disabled; cannot force enable HPET\n"); + else + { + val = REG32(rcba, 0x3404); + if (val & 0x80) + { + // HPET is enabled in HPTC. Just not reported by BIOS + DBG(" HPET is enabled in HPTC, just not reported by BIOS\n"); + hpet_address |= (val & 3) << 12 ; + DBG(" HPET MMIO @ 0x%lx\n", hpet_address); + } + else + { + // HPET disabled in HPTC. Trying to enable + DBG(" HPET is disabled in HPTC, trying to enable\n"); + REG32(rcba, 0x3404) = val | 0x80; + hpet_address |= (val & 3) << 12 ; + DBG(" Force enabled HPET, MMIO @ 0x%lx\n", hpet_address); + } + + // verify if the job is done + val = REG32(rcba, 0x3404); + if (!(val & 0x80)) + printf(" Failed to force enable HPET\n"); + } + break; + } + +#if DEBUG_HPET + printf("Press [Enter] to continue...\n"); + getchar(); +#endif +} diff --git a/i386/libsaio/hpet.h b/i386/libsaio/hpet.h new file mode 100644 index 0000000..498e37b --- /dev/null +++ b/i386/libsaio/hpet.h @@ -0,0 +1,20 @@ +/* + * + */ + +#ifndef __LIBSAIO_HPET_H +#define __LIBSAIO_HPET_H + +#include "libsaio.h" + +#define REG32(base, reg) ((volatile uint32_t *)base)[(reg) >> 2] + +void force_enable_hpet(pci_dt_t *lpc_dev); + +struct lpc_controller_t { + unsigned vendor; + unsigned device; + char *name; +}; + +#endif /* !__LIBSAIO_HPET_H */ diff --git a/i386/libsaio/io_inline.h b/i386/libsaio/io_inline.h new file mode 100644 index 0000000..0535c10 --- /dev/null +++ b/i386/libsaio/io_inline.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * Inlines for io space access. + * + * HISTORY + * + * 20 May 1992 ? at NeXT + * Created. + */ + +#ifndef __LIBSAIO_IO_INLINE_H +#define __LIBSAIO_IO_INLINE_H + +/* + *############################################################################ + * + * x86 IN/OUT I/O inline functions. + * + * IN : inb, inw, inl + * IN(port) + * + * OUT: outb, outw, outl + * OUT(port, data) + * + *############################################################################ + */ + +#define __IN(s, u) \ +static inline unsigned u \ +in##s(unsigned short port) \ +{ \ + unsigned u data; \ + asm volatile ( \ + "in" #s " %1,%0" \ + : "=a" (data) \ + : "d" (port)); \ + return (data); \ +} + +#define __OUT(s, u) \ +static inline void \ +out##s(unsigned short port, unsigned u data) \ +{ \ + asm volatile ( \ + "out" #s " %1,%0" \ + : \ + : "d" (port), "a" (data)); \ +} + +__IN(b, char) /* inb() */ +__IN(w, short) /* inw() */ +__IN(l, long) /* inl() */ + +__OUT(b, char) /* outb() */ +__OUT(w, short) /* outw() */ +__OUT(l, long) /* outl() */ + +#endif /* !__LIBSAIO_IO_INLINE_H */ diff --git a/i386/libsaio/libsaio.h b/i386/libsaio/libsaio.h new file mode 100644 index 0000000..6eee4d1 --- /dev/null +++ b/i386/libsaio/libsaio.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* libsaio.h */ + +#ifndef __LIBSAIO_LIBSAIO_H +#define __LIBSAIO_LIBSAIO_H + +#include "libsa.h" +#include "memory.h" +#include "io_inline.h" +#include "saio_types.h" +#include "saio_internal.h" + +#endif /* !__LIBSAIO_LIBSAIO_H */ diff --git a/i386/libsaio/load.c b/i386/libsaio/load.c new file mode 100644 index 0000000..ac3d161 --- /dev/null +++ b/i386/libsaio/load.c @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * load.c - Functions for decoding a Mach-o Kernel. + * + * Copyright (c) 1998-2003 Apple Computer, Inc. + * + */ + +#include <mach-o/fat.h> +#include <mach-o/loader.h> +#include <mach/machine/thread_status.h> + +#include <sl.h> + +static long DecodeSegment(long cmdBase, unsigned int*load_addr, unsigned int *load_size); +static long DecodeUnixThread(long cmdBase, unsigned int *entry); +static long DecodeSymbolTable(long cmdBase); + + +static unsigned long gBinaryAddress; +bool gHaveKernelCache; /* XXX aserebln: uninitialized? and only set to true, never to false */ +cpu_type_t archCpuType=CPU_TYPE_I386; + +// Public Functions + +long ThinFatFile(void **binary, unsigned long *length) +{ + unsigned long nfat, swapped, size = 0; + struct fat_header *fhp = (struct fat_header *)*binary; + struct fat_arch *fap = + (struct fat_arch *)((unsigned long)*binary + sizeof(struct fat_header)); + cpu_type_t fapcputype; + uint32_t fapoffset; + uint32_t fapsize; + + if (fhp->magic == FAT_MAGIC) { + nfat = fhp->nfat_arch; + swapped = 0; + } else if (fhp->magic == FAT_CIGAM) { + nfat = OSSwapInt32(fhp->nfat_arch); + swapped = 1; + } else { + return -1; + } + + for (; nfat > 0; nfat--, fap++) { + if (swapped) { + fapcputype = OSSwapInt32(fap->cputype); + fapoffset = OSSwapInt32(fap->offset); + fapsize = OSSwapInt32(fap->size); + } + else + { + fapcputype = fap->cputype; + fapoffset = fap->offset; + fapsize = fap->size; + } + + if (fapcputype == archCpuType) { + *binary = (void *) ((unsigned long)*binary + fapoffset); + size = fapsize; + break; + } + } + + if (length != 0) *length = size; + + return 0; +} + +long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize) +{ + struct mach_header *mH; + unsigned long ncmds, cmdBase, cmd, cmdsize, cmdstart; + // long headerBase, headerAddr, headerSize; + unsigned int vmaddr = ~0; + unsigned int vmend = 0; + unsigned long cnt; + long ret = -1; + unsigned int entry = 0; + + gBinaryAddress = (unsigned long)binary; + + mH = (struct mach_header *)(gBinaryAddress); + switch (archCpuType) + { + case CPU_TYPE_I386: + if (mH->magic != MH_MAGIC) { + error("Mach-O file has bad magic number\n"); + return -1; + } + cmdstart = (unsigned long)gBinaryAddress + sizeof(struct mach_header); + break; + case CPU_TYPE_X86_64: + if (mH->magic != MH_MAGIC_64 && mH->magic == MH_MAGIC) + return -1; + if (mH->magic != MH_MAGIC_64) { + error("Mach-O file has bad magic number\n"); + return -1; + } + cmdstart = (unsigned long)gBinaryAddress + sizeof(struct mach_header_64); + break; + default: + error("Unknown CPU type\n"); + return -1; + } + + cmdBase = cmdstart; + +#if DEBUG + printf("magic: %x\n", (unsigned)mH->magic); + printf("cputype: %x\n", (unsigned)mH->cputype); + printf("cpusubtype: %x\n", (unsigned)mH->cpusubtype); + printf("filetype: %x\n", (unsigned)mH->filetype); + printf("ncmds: %x\n", (unsigned)mH->ncmds); + printf("sizeofcmds: %x\n", (unsigned)mH->sizeofcmds); + printf("flags: %x\n", (unsigned)mH->flags); + getchar(); +#endif + + ncmds = mH->ncmds; + + for (cnt = 0; cnt < ncmds; cnt++) { + cmd = ((long *)cmdBase)[0]; + cmdsize = ((long *)cmdBase)[1]; + unsigned int load_addr; + unsigned int load_size; + + switch (cmd) { + case LC_SEGMENT_64: + case LC_SEGMENT: + ret = DecodeSegment(cmdBase, &load_addr, &load_size); + if (ret == 0 && load_size != 0 && load_addr >= KERNEL_ADDR) { + vmaddr = MIN(vmaddr, load_addr); + vmend = MAX(vmend, load_addr + load_size); + } + break; + + case LC_UNIXTHREAD: + ret = DecodeUnixThread(cmdBase, &entry); + break; + + case LC_SYMTAB: + break; + + default: +#if NOTDEF + printf("Ignoring cmd type %d.\n", (unsigned)cmd); +#endif + break; + } + + if (ret != 0) return -1; + + cmdBase += cmdsize; + } + + *rentry = (entry_t)( (unsigned long) entry & 0x3fffffff ); + *rsize = vmend - vmaddr; + *raddr = (char *)vmaddr; + + cmdBase = cmdstart; + for (cnt = 0; cnt < ncmds; cnt++) { + cmd = ((long *)cmdBase)[0]; + cmdsize = ((long *)cmdBase)[1]; + + if(cmd==LC_SYMTAB) + if (DecodeSymbolTable(cmdBase)!=0) + return -1; + + cmdBase += cmdsize; + } + + return ret; +} + +// Private Functions + +static long DecodeSegment(long cmdBase, unsigned int *load_addr, unsigned int *load_size) +{ + unsigned long vmaddr, fileaddr; + long vmsize, filesize; + char *segname; + + if (((long *)cmdBase)[0]==LC_SEGMENT_64) + { + struct segment_command_64 *segCmd; + + segCmd = (struct segment_command_64 *)cmdBase; + + vmaddr = (segCmd->vmaddr & 0x3fffffff); + vmsize = segCmd->vmsize; + fileaddr = (gBinaryAddress + segCmd->fileoff); + filesize = segCmd->filesize; + + segname=segCmd->segname; + +#ifdef DEBUG + printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n", + segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize, + (unsigned) segCmd->nsects, (unsigned)segCmd->flags); + getchar(); +#endif + } + else + { + struct segment_command *segCmd; + + segCmd = (struct segment_command *)cmdBase; + + vmaddr = (segCmd->vmaddr & 0x3fffffff); + vmsize = segCmd->vmsize; + fileaddr = (gBinaryAddress + segCmd->fileoff); + filesize = segCmd->filesize; + + segname=segCmd->segname; + +#ifdef DEBUG + printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n", + segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize, + (unsigned) segCmd->nsects, (unsigned)segCmd->flags); + getchar(); +#endif + } + + if (vmsize == 0 || filesize == 0) { + *load_addr = ~0; + *load_size = 0; + return 0; + } + + if (! ((vmaddr >= KERNEL_ADDR && + (vmaddr + vmsize) <= (KERNEL_ADDR + KERNEL_LEN)) || + (vmaddr >= HIB_ADDR && + (vmaddr + vmsize) <= (HIB_ADDR + HIB_LEN)))) { + stop("Kernel overflows available space"); + } + + if (vmsize && ((strcmp(segname, "__PRELINK_INFO") == 0) || (strcmp(segname, "__PRELINK") == 0))) + gHaveKernelCache = true; + + // Copy from file load area. + if (vmsize>0 && filesize>0) + bcopy((char *)fileaddr, (char *)vmaddr, vmsize>filesize?filesize:vmsize); + + // Zero space at the end of the segment. + if (vmsize > filesize) + bzero((char *)(vmaddr + filesize), vmsize - filesize); + + *load_addr = vmaddr; + *load_size = vmsize; + + return 0; +} + +static long DecodeUnixThread(long cmdBase, unsigned int *entry) +{ + switch (archCpuType) + { + case CPU_TYPE_I386: + { + i386_thread_state_t *i386ThreadState; + + i386ThreadState = (i386_thread_state_t *) + (cmdBase + sizeof(struct thread_command) + 8); + + *entry = i386ThreadState->eip; + return 0; + } + + case CPU_TYPE_X86_64: + { + x86_thread_state64_t *x86_64ThreadState; + + x86_64ThreadState = (x86_thread_state64_t *) + (cmdBase + sizeof(struct thread_command) + 8); + + *entry = x86_64ThreadState->rip; + return 0; + } + + default: + error("Unknown CPU type\n"); + return -1; + } +} + +static long DecodeSymbolTable(long cmdBase) +{ + struct symtab_command *symTab, *symTableSave; + long tmpAddr, symsSize, totalSize; + long gSymbolTableAddr; + long gSymbolTableSize; + + symTab = (struct symtab_command *)cmdBase; + +#if DEBUG + printf("symoff: %x, nsyms: %x, stroff: %x, strsize: %x\n", + symTab->symoff, symTab->nsyms, symTab->stroff, symTab->strsize); + getchar(); +#endif + + symsSize = symTab->stroff - symTab->symoff; + totalSize = symsSize + symTab->strsize; + + gSymbolTableSize = totalSize + sizeof(struct symtab_command); + gSymbolTableAddr = AllocateKernelMemory(gSymbolTableSize); + // Add the SymTab to the memory-map. + AllocateMemoryRange("Kernel-__SYMTAB", gSymbolTableAddr, gSymbolTableSize, -1); + + symTableSave = (struct symtab_command *)gSymbolTableAddr; + tmpAddr = gSymbolTableAddr + sizeof(struct symtab_command); + + symTableSave->symoff = tmpAddr; + symTableSave->nsyms = symTab->nsyms; + symTableSave->stroff = tmpAddr + symsSize; + symTableSave->strsize = symTab->strsize; + + bcopy((char *)(gBinaryAddress + symTab->symoff), + (char *)tmpAddr, totalSize); + return 0; +} diff --git a/i386/libsaio/md5c.c b/i386/libsaio/md5c.c new file mode 100644 index 0000000..ec4ec6d --- /dev/null +++ b/i386/libsaio/md5c.c @@ -0,0 +1,293 @@ +/* + * MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm + * + * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + * rights reserved. + * + * License to copy and use this software is granted provided that it + * is identified as the "RSA Data Security, Inc. MD5 Message-Digest + * Algorithm" in all material mentioning or referencing this software + * or this function. + * + * License is also granted to make and use derivative works provided + * that such works are identified as "derived from the RSA Data + * Security, Inc. MD5 Message-Digest Algorithm" in all material + * mentioning or referencing the derived work. + * + * RSA Data Security, Inc. makes no representations concerning either + * the merchantability of this software or the suitability of this + * software for any particular purpose. It is provided "as is" + * without express or implied warranty of any kind. + * + * These notices must be retained in any copies of any part of this + * documentation and/or software. + * + * $Id: md5c.c,v 1.1 2005/06/24 22:47:12 curtisg Exp $ + * + * This code is the same as the code published by RSA Inc. It has been + * edited for clarity and style only. + */ + +#include "libsaio.h" +#include <libkern/crypto/md5.h> + + +#define Encode memcpy +#define Decode memcpy + +static unsigned char PADDING[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* F, G, H and I are basic MD5 functions. */ +#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) +#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) +#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define I(x, y, z) ((y) ^ ((x) | (~z))) + +/* ROTATE_LEFT rotates x left n bits. */ +#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* + * FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. + * Rotation is separate from addition to prevent recomputation. + */ +#define FF(a, b, c, d, x, s, ac) { \ + (a) += F ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define GG(a, b, c, d, x, s, ac) { \ + (a) += G ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define HH(a, b, c, d, x, s, ac) { \ + (a) += H ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } +#define II(a, b, c, d, x, s, ac) { \ + (a) += I ((b), (c), (d)) + (x) + (u_int32_t)(ac); \ + (a) = ROTATE_LEFT ((a), (s)); \ + (a) += (b); \ + } + +static void MD5Transform (u_int32_t state[4], const unsigned char block[64]); + +/* MD5 initialization. Begins an MD5 operation, writing a new context. */ + +void +MD5Init (context) + MD5_CTX *context; +{ + + context->count[0] = context->count[1] = 0; + + /* Load magic initialization constants. */ + context->state[0] = 0x67452301; + context->state[1] = 0xefcdab89; + context->state[2] = 0x98badcfe; + context->state[3] = 0x10325476; +} + +/* + * MD5 block update operation. Continues an MD5 message-digest + * operation, processing another message block, and updating the + * context. + */ + +void +MD5Update (context, input, inputLen) + MD5_CTX *context; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + const void *input; +#else + const unsigned char *input; +#endif + unsigned int inputLen; +{ + unsigned int i, index, partLen; + + /* Compute number of bytes mod 64 */ + index = (unsigned int)((context->count[0] >> 3) & 0x3F); + + /* Update number of bits */ + if ((context->count[0] += ((u_int32_t)inputLen << 3)) + < ((u_int32_t)inputLen << 3)) + context->count[1]++; + context->count[1] += ((u_int32_t)inputLen >> 29); + + partLen = 64 - index; + + /* Transform as many times as possible. */ + if (inputLen >= partLen) { + memcpy((void *)&context->buffer[index], (const void *)input, + partLen); + MD5Transform (context->state, context->buffer); + + for (i = partLen; i + 63 < inputLen; i += 64) + MD5Transform (context->state, &((const unsigned char *)input)[i]); + + index = 0; + } + else + i = 0; + + /* Buffer remaining input */ + memcpy ((void *)&context->buffer[index], (const void *)&((const unsigned char*)input)[i], + inputLen-i); +} + +/* + * MD5 padding. Adds padding followed by original length. + */ + +void +MD5Pad (context) + MD5_CTX *context; +{ + unsigned char bits[8]; + unsigned int index, padLen; + + /* Save number of bits */ + Encode (bits, context->count, 8); + + /* Pad out to 56 mod 64. */ + index = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (index < 56) ? (56 - index) : (120 - index); + MD5Update (context, PADDING, padLen); + + /* Append length (before padding) */ + MD5Update (context, bits, 8); +} + +/* + * MD5 finalization. Ends an MD5 message-digest operation, writing the + * the message digest and zeroizing the context. + */ + +void +MD5Final (digest, context) + unsigned char digest[16]; + MD5_CTX *context; +{ + /* Do padding. */ + MD5Pad (context); + + /* Store state in digest */ + Encode (digest, context->state, 16); + + /* Zeroize sensitive information. */ + memset ((void *)context, 0, sizeof (*context)); +} + +/* MD5 basic transformation. Transforms state based on block. */ + +static void +MD5Transform (state, block) + u_int32_t state[4]; + const unsigned char block[64]; +{ + u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16]; + + Decode (x, block, 64); + + /* Round 1 */ +#define S11 7 +#define S12 12 +#define S13 17 +#define S14 22 + FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ + FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ + FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ + FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ + FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ + FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ + FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ + FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ + FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ + FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ + FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ + FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ + FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ + FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ + FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ + FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ + + /* Round 2 */ +#define S21 5 +#define S22 9 +#define S23 14 +#define S24 20 + GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ + GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ + GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ + GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ + GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ + GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ + GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ + GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ + GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ + GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ + GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ + GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ + GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ + GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ + GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ + GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ + + /* Round 3 */ +#define S31 4 +#define S32 11 +#define S33 16 +#define S34 23 + HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ + HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ + HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ + HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ + HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ + HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ + HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ + HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ + HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ + HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ + HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ + HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ + HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ + HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ + HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ + HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ + + /* Round 4 */ +#define S41 6 +#define S42 10 +#define S43 15 +#define S44 21 + II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ + II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ + II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ + II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ + II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ + II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ + II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ + II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ + II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ + II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ + II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ + II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ + II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ + II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ + II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ + II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + + /* Zeroize sensitive information. */ + memset ((void *)x, 0, sizeof (x)); +} diff --git a/i386/libsaio/memvendors.h b/i386/libsaio/memvendors.h new file mode 100644 index 0000000..782fc6c --- /dev/null +++ b/i386/libsaio/memvendors.h @@ -0,0 +1,894 @@ +/* + * Memory module vendors as published by JEDEC 106AA + * + * Special thanks to indi, memtest and theking for the table + * + */ +#ifndef __MEMVEN_H +#define __MEMVEN_H + +typedef struct _vidTag { + uint8_t bank; + uint8_t code; + const char* name; +} VenIdName; + +VenIdName vendorMap[] = { + { 0, 0x01, "AMD"}, + { 0, 0x02, "AMI"}, + { 0, 0x83, "Fairchild"}, + { 0, 0x04, "Fujitsu"}, + { 0, 0x85, "GTE"}, + { 0, 0x86, "Harris"}, + { 0, 0x07, "Hitachi"}, + { 0, 0x08, "Inmos"}, + { 0, 0x89, "Intel"}, + { 0, 0x8a, "I.T.T."}, + { 0, 0x0b, "Intersil"}, + { 0, 0x8c, "Monolithic Memories"}, + { 0, 0x0d, "Mostek"}, + { 0, 0x0e, "Freescale (Motorola)"}, + { 0, 0x8f, "National"}, + { 0, 0x10, "NEC"}, + { 0, 0x91, "RCA"}, + { 0, 0x92, "Raytheon"}, + { 0, 0x13, "Conexant (Rockwell)"}, + { 0, 0x94, "Seeq"}, + { 0, 0x15, "NXP (Philips)"}, + { 0, 0x16, "Synertek"}, + { 0, 0x97, "Texas Instruments"}, + { 0, 0x98, "Toshiba"}, + { 0, 0x19, "Xicor"}, + { 0, 0x1a, "Zilog"}, + { 0, 0x9b, "Eurotechnique"}, + { 0, 0x1c, "Mitsubishi"}, + { 0, 0x9d, "Lucent (AT&T)"}, + { 0, 0x9e, "Exel"}, + { 0, 0x1f, "Atmel"}, + { 0, 0x20, "SGS/Thomson"}, + { 0, 0xa1, "Lattice Semi."}, + { 0, 0xa2, "NCR"}, + { 0, 0x23, "Wafer Scale Integration"}, + { 0, 0xa4, "IBM"}, + { 0, 0x25, "Tristar"}, + { 0, 0x26, "Visic"}, + { 0, 0xa7, "Intl. CMOS Technology"}, + { 0, 0xa8, "SSSI"}, + { 0, 0x29, "MicrochipTechnology"}, + { 0, 0x2a, "Ricoh"}, + { 0, 0xab, "VLSI"}, + { 0, 0x2c, "Micron Technology"}, + { 0, 0xad, "Hynix Semiconductor"}, + { 0, 0xae, "OKI Semiconductor"}, + { 0, 0x2f, "ACTEL"}, + { 0, 0xb0, "Sharp"}, + { 0, 0x31, "Catalyst"}, + { 0, 0x32, "Panasonic"}, + { 0, 0xb3, "IDT"}, + { 0, 0x34, "Cypress"}, + { 0, 0xb5, "DEC"}, + { 0, 0xb6, "LSI Logic"}, + { 0, 0x37, "Zarlink (Plessey)"}, + { 0, 0x38, "UTMC"}, + { 0, 0xb9, "Thinking Machine"}, + { 0, 0xba, "Thomson CSF"}, + { 0, 0x3b, "Integrated CMOS (Vertex)"}, + { 0, 0xbc, "Honeywell"}, + { 0, 0x3d, "Tektronix"}, + { 0, 0x3e, "Sun Microsystems"}, + { 0, 0xbf, "SST"}, + { 0, 0x40, "ProMos/Mosel Vitelic"}, + { 0, 0xc1, "Infineon (Siemens)"}, + { 0, 0xc2, "Macronix"}, + { 0, 0x43, "Xerox"}, + { 0, 0xc4, "Plus Logic"}, + { 0, 0x45, "SanDisk"}, + { 0, 0x46, "Elan Circuit Tech."}, + { 0, 0xc7, "European Silicon Str."}, + { 0, 0xc8, "Apple Computer"}, + { 0, 0x49, "Xilinx"}, + { 0, 0x4a, "Compaq"}, + { 0, 0xcb, "Protocol Engines"}, + { 0, 0x4c, "SCI"}, + { 0, 0xcd, "Seiko Instruments"}, + { 0, 0xce, "Samsung"}, + { 0, 0x4f, "I3 Design System"}, + { 0, 0xd0, "Klic"}, + { 0, 0x51, "Crosspoint Solutions"}, + { 0, 0x52, "Alliance Semiconductor"}, + { 0, 0xd3, "Tandem"}, + { 0, 0x54, "Hewlett-Packard"}, + { 0, 0xd5, "Intg. Silicon Solutions"}, + { 0, 0xd6, "Brooktree"}, + { 0, 0x57, "New Media"}, + { 0, 0x58, "MHS Electronic"}, + { 0, 0xd9, "Performance Semi."}, + { 0, 0xda, "Winbond Electronic"}, + { 0, 0x5b, "Kawasaki Steel"}, + { 0, 0xdc, "Bright Micro"}, + { 0, 0x5d, "TECMAR"}, + { 0, 0x5e, "Exar"}, + { 0, 0xdf, "PCMCIA"}, + { 0, 0xe0, "LG Semi (Goldstar)"}, + { 0, 0x61, "Northern Telecom"}, + { 0, 0x62, "Sanyo"}, + { 0, 0xe3, "Array Microsystems"}, + { 0, 0x64, "Crystal Semiconductor"}, + { 0, 0xe5, "Analog Devices"}, + { 0, 0xe6, "PMC-Sierra"}, + { 0, 0x67, "Asparix"}, + { 0, 0x68, "Convex Computer"}, + { 0, 0xe9, "Quality Semiconductor"}, + { 0, 0xea, "Nimbus Technology"}, + { 0, 0x6b, "Transwitch"}, + { 0, 0xec, "Micronas (ITT Intermetall)"}, + { 0, 0x6d, "Cannon"}, + { 0, 0x6e, "Altera"}, + { 0, 0xef, "NEXCOM"}, + { 0, 0x70, "QUALCOMM"}, + { 0, 0xf1, "Sony"}, + { 0, 0xf2, "Cray Research"}, + { 0, 0x73, "AMS(Austria Micro)"}, + { 0, 0xf4, "Vitesse"}, + { 0, 0x75, "Aster Electronics"}, + { 0, 0x76, "Bay Networks (Synoptic)"}, + { 0, 0xf7, "Zentrum/ZMD"}, + { 0, 0xf8, "TRW"}, + { 0, 0x79, "Thesys"}, + { 0, 0x7a, "Solbourne Computer"}, + { 0, 0xfb, "Allied-Signal"}, + { 0, 0x7c, "Dialog"}, + { 0, 0xfd, "Media Vision"}, + { 0, 0xfe, "Numonyx"}, + { 1, 0x01, "Cirrus Logic"}, + { 1, 0x02, "National Instruments"}, + { 1, 0x83, "ILC Data Device"}, + { 1, 0x04, "Alcatel Mietec"}, + { 1, 0x85, "Micro Linear"}, + { 1, 0x86, "Univ. of NC"}, + { 1, 0x07, "JTAG Technologies"}, + { 1, 0x08, "BAE Systems (Loral)"}, + { 1, 0x89, "Nchip"}, + { 1, 0x8a, "Galileo Tech"}, + { 1, 0x0b, "Bestlink Systems"}, + { 1, 0x8c, "Graychip"}, + { 1, 0x0d, "GENNUM"}, + { 1, 0x0e, "VideoLogic"}, + { 1, 0x8f, "Robert Bosch"}, + { 1, 0x10, "Chip Express"}, + { 1, 0x91, "DATARAM"}, + { 1, 0x92, "United Microelectronics Corp."}, + { 1, 0x13, "TCSI"}, + { 1, 0x94, "Smart Modular"}, + { 1, 0x15, "Hughes Aircraft"}, + { 1, 0x16, "Lanstar Semiconductor"}, + { 1, 0x97, "Qlogic"}, + { 1, 0x98, "Kingston"}, + { 1, 0x19, "Music Semi"}, + { 1, 0x1a, "Ericsson Components"}, + { 1, 0x9b, "SpaSE"}, + { 1, 0x1c, "Eon Silicon Devices"}, + { 1, 0x9d, "Programmable Micro Corp"}, + { 1, 0x9e, "DoD"}, + { 1, 0x1f, "Integ. Memories Tech."}, + { 1, 0x20, "Corollary"}, + { 1, 0xa1, "Dallas Semiconductor"}, + { 1, 0xa2, "Omnivision"}, + { 1, 0x23, "EIV(Switzerland)"}, + { 1, 0xa4, "Novatel Wireless"}, + { 1, 0x25, "Zarlink (Mitel)"}, + { 1, 0x26, "Clearpoint"}, + { 1, 0xa7, "Cabletron"}, + { 1, 0xa8, "STEC (Silicon Tech)"}, + { 1, 0x29, "Vanguard"}, + { 1, 0x2a, "Hagiwara Sys-Com"}, + { 1, 0xab, "Vantis"}, + { 1, 0x2c, "Celestica"}, + { 1, 0xad, "Century"}, + { 1, 0xae, "Hal Computers"}, + { 1, 0x2f, "Rohm Company"}, + { 1, 0xb0, "Juniper Networks"}, + { 1, 0x31, "Libit Signal Processing"}, + { 1, 0x32, "Mushkin Enhanced Memory"}, + { 1, 0xb3, "Tundra Semiconductor"}, + { 1, 0x34, "Adaptec"}, + { 1, 0xb5, "LightSpeed Semi."}, + { 1, 0xb6, "ZSP Corp."}, + { 1, 0x37, "AMIC Technology"}, + { 1, 0x38, "Adobe Systems"}, + { 1, 0xb9, "Dynachip"}, + { 1, 0xba, "PNY Electronics"}, + { 1, 0x3b, "Newport Digital"}, + { 1, 0xbc, "MMC Networks"}, + { 1, 0x3d, "T Square"}, + { 1, 0x3e, "Seiko Epson"}, + { 1, 0xbf, "Broadcom"}, + { 1, 0x40, "Viking Components"}, + { 1, 0xc1, "V3 Semiconductor"}, + { 1, 0xc2, "Flextronics (Orbit Semiconductor)"}, + { 1, 0x43, "Suwa Electronics"}, + { 1, 0xc4, "Transmeta"}, + { 1, 0x45, "Micron CMS"}, + { 1, 0x46, "American Computer & Digital Components"}, + { 1, 0xc7, "Enhance 3000"}, + { 1, 0xc8, "Tower Semiconductor"}, + { 1, 0x49, "CPU Design"}, + { 1, 0x4a, "Price Point"}, + { 1, 0xcb, "Maxim Integrated Product"}, + { 1, 0x4c, "Tellabs"}, + { 1, 0xcd, "Centaur Technology"}, + { 1, 0xce, "Unigen"}, + { 1, 0x4f, "Transcend Information"}, + { 1, 0xd0, "Memory Card Technology"}, + { 1, 0x51, "CKD"}, + { 1, 0x52, "Capital Instruments"}, + { 1, 0xd3, "Aica Kogyo"}, + { 1, 0x54, "Linvex Technology"}, + { 1, 0xd5, "MSC Vertriebs"}, + { 1, 0xd6, "AKM Company"}, + { 1, 0x57, "Dynamem"}, + { 1, 0x58, "NERA ASA"}, + { 1, 0xd9, "GSI Technology"}, + { 1, 0xda, "Dane-Elec (C Memory)"}, + { 1, 0x5b, "Acorn Computers"}, + { 1, 0xdc, "Lara Technology"}, + { 1, 0x5d, "Oak Technology"}, + { 1, 0x5e, "Itec Memory"}, + { 1, 0xdf, "Tanisys Technology"}, + { 1, 0xe0, "Truevision"}, + { 1, 0x61, "Wintec Industries"}, + { 1, 0x62, "Super PC Memory"}, + { 1, 0xe3, "MGV Memory"}, + { 1, 0x64, "Galvantech"}, + { 1, 0xe5, "Gadzoox Networks"}, + { 1, 0xe6, "Multi Dimensional Cons."}, + { 1, 0x67, "GateField"}, + { 1, 0x68, "Integrated Memory System"}, + { 1, 0xe9, "Triscend"}, + { 1, 0xea, "XaQti"}, + { 1, 0x6b, "Goldenram"}, + { 1, 0xec, "Clear Logic"}, + { 1, 0x6d, "Cimaron Communications"}, + { 1, 0x6e, "Nippon Steel Semi. Corp."}, + { 1, 0xef, "Advantage Memory"}, + { 1, 0x70, "AMCC"}, + { 1, 0xf1, "LeCroy"}, + { 1, 0xf2, "Yamaha"}, + { 1, 0x73, "Digital Microwave"}, + { 1, 0xf4, "NetLogic Microsystems"}, + { 1, 0x75, "MIMOS Semiconductor"}, + { 1, 0x76, "Advanced Fibre"}, + { 1, 0xf7, "BF Goodrich Data."}, + { 1, 0xf8, "Epigram"}, + { 1, 0x79, "Acbel Polytech"}, + { 1, 0x7a, "Apacer Technology"}, + { 1, 0xfb, "Admor Memory"}, + { 1, 0x7c, "FOXCONN"}, + { 1, 0xfd, "Quadratics Superconductor"}, + { 1, 0xfe, "3COM"}, + { 2, 0x01, "Camintonn"}, + { 2, 0x02, "ISOA"}, + { 2, 0x83, "Agate Semiconductor"}, + { 2, 0x04, "ADMtek"}, + { 2, 0x85, "HYPERTEC"}, + { 2, 0x86, "Adhoc Technologies"}, + { 2, 0x07, "MOSAID Technologies"}, + { 2, 0x08, "Ardent Technologies"}, + { 2, 0x89, "Switchcore"}, + { 2, 0x8a, "Cisco Systems"}, + { 2, 0x0b, "Allayer Technologies"}, + { 2, 0x8c, "WorkX AG (Wichman)"}, + { 2, 0x0d, "Oasis Semiconductor"}, + { 2, 0x0e, "Novanet Semiconductor"}, + { 2, 0x8f, "E-M Solutions"}, + { 2, 0x10, "Power General"}, + { 2, 0x91, "Advanced Hardware Arch."}, + { 2, 0x92, "Inova Semiconductors"}, + { 2, 0x13, "Telocity"}, + { 2, 0x94, "Delkin Devices"}, + { 2, 0x15, "Symagery Microsystems"}, + { 2, 0x16, "C-Port"}, + { 2, 0x97, "SiberCore Technologies"}, + { 2, 0x98, "Southland Microsystems"}, + { 2, 0x19, "Malleable Technologies"}, + { 2, 0x1a, "Kendin Communications"}, + { 2, 0x9b, "Great Technology Microcomputer"}, + { 2, 0x1c, "Sanmina"}, + { 2, 0x9d, "HADCO"}, + { 2, 0x9e, "Corsair"}, + { 2, 0x1f, "Actrans System"}, + { 2, 0x20, "ALPHA Technologies"}, + { 2, 0xa1, "Silicon Laboratories (Cygnal)"}, + { 2, 0xa2, "Artesyn Technologies"}, + { 2, 0x23, "Align Manufacturing"}, + { 2, 0xa4, "Peregrine Semiconductor"}, + { 2, 0x25, "Chameleon Systems"}, + { 2, 0x26, "Aplus Flash Technology"}, + { 2, 0xa7, "MIPS Technologies"}, + { 2, 0xa8, "Chrysalis ITS"}, + { 2, 0x29, "ADTEC"}, + { 2, 0x2a, "Kentron Technologies"}, + { 2, 0xab, "Win Technologies"}, + { 2, 0x2c, "Tachyon Semiconductor (ASIC)"}, + { 2, 0xad, "Extreme Packet Devices"}, + { 2, 0xae, "RF Micro Devices"}, + { 2, 0x2f, "Siemens AG"}, + { 2, 0xb0, "Sarnoff"}, + { 2, 0x31, "Itautec SA"}, + { 2, 0x32, "Radiata"}, + { 2, 0xb3, "Benchmark Elect. (AVEX)"}, + { 2, 0x34, "Legend"}, + { 2, 0xb5, "SpecTek"}, + { 2, 0xb6, "Hi/fn"}, + { 2, 0x37, "Enikia"}, + { 2, 0x38, "SwitchOn Networks"}, + { 2, 0xb9, "AANetcom"}, + { 2, 0xba, "Micro Memory Bank"}, + { 2, 0x3b, "ESS Technology"}, + { 2, 0xbc, "Virata"}, + { 2, 0x3d, "Excess Bandwidth"}, + { 2, 0x3e, "West Bay Semiconductor"}, + { 2, 0xbf, "DSP Group"}, + { 2, 0x40, "Newport Communications"}, + { 2, 0xc1, "Chip2Chip"}, + { 2, 0xc2, "Phobos"}, + { 2, 0x43, "Intellitech"}, + { 2, 0xc4, "Nordic VLSI ASA"}, + { 2, 0x45, "Ishoni Networks"}, + { 2, 0x46, "Silicon Spice"}, + { 2, 0xc7, "Alchemy Semiconductor"}, + { 2, 0xc8, "Agilent Technologies"}, + { 2, 0x49, "Centillium Communications"}, + { 2, 0x4a, "W.L. Gore"}, + { 2, 0xcb, "HanBit Electronics"}, + { 2, 0x4c, "GlobeSpan"}, + { 2, 0xcd, "Element 14"}, + { 2, 0xce, "Pycon"}, + { 2, 0x4f, "Saifun Semiconductors"}, + { 2, 0xd0, "Sibyte,"}, + { 2, 0x51, "MetaLink Technologies"}, + { 2, 0x52, "Feiya Technology"}, + { 2, 0xd3, "I & C Technology"}, + { 2, 0x54, "Shikatronics"}, + { 2, 0xd5, "Elektrobit"}, + { 2, 0xd6, "Megic"}, + { 2, 0x57, "Com-Tier"}, + { 2, 0x58, "Malaysia Micro Solutions"}, + { 2, 0xd9, "Hyperchip"}, + { 2, 0xda, "Gemstone Communications"}, + { 2, 0x5b, "Anadigm (Anadyne)"}, + { 2, 0xdc, "3ParData"}, + { 2, 0x5d, "Mellanox Technologies"}, + { 2, 0x5e, "Tenx Technologies"}, + { 2, 0xdf, "Helix AG"}, + { 2, 0xe0, "Domosys"}, + { 2, 0x61, "Skyup Technology"}, + { 2, 0x62, "HiNT"}, + { 2, 0xe3, "Chiaro"}, + { 2, 0x64, "MDT Technologies"}, + { 2, 0xe5, "Exbit Technology A/S"}, + { 2, 0xe6, "Integrated Technology Express"}, + { 2, 0x67, "AVED Memory"}, + { 2, 0x68, "Legerity"}, + { 2, 0xe9, "Jasmine Networks"}, + { 2, 0xea, "Caspian Networks"}, + { 2, 0x6b, "nCUBE"}, + { 2, 0xec, "Silicon Access Networks"}, + { 2, 0x6d, "FDK"}, + { 2, 0x6e, "High Bandwidth Access"}, + { 2, 0xef, "MultiLink Technology"}, + { 2, 0x70, "BRECIS"}, + { 2, 0xf1, "World Wide Packets"}, + { 2, 0xf2, "APW"}, + { 2, 0x73, "Chicory Systems"}, + { 2, 0xf4, "Xstream Logic"}, + { 2, 0x75, "Fast-Chip"}, + { 2, 0x76, "Zucotto Wireless"}, + { 2, 0xf7, "Realchip"}, + { 2, 0xf8, "Galaxy Power"}, + { 2, 0x79, "eSilicon"}, + { 2, 0x7a, "Morphics Technology"}, + { 2, 0xfb, "Accelerant Networks"}, + { 2, 0x7c, "Silicon Wave"}, + { 2, 0xfd, "SandCraft"}, + { 2, 0xfe, "Elpida"}, + { 3, 0x01, "Solectron"}, + { 3, 0x02, "Optosys Technologies"}, + { 3, 0x83, "Buffalo (Formerly Melco)"}, + { 3, 0x04, "TriMedia Technologies"}, + { 3, 0x85, "Cyan Technologies"}, + { 3, 0x86, "Global Locate"}, + { 3, 0x07, "Optillion"}, + { 3, 0x08, "Terago Communications"}, + { 3, 0x89, "Ikanos Communications"}, + { 3, 0x8a, "Preton Technology"}, + { 3, 0x0b, "Nanya Technology"}, + { 3, 0x8c, "Elite Flash Storage"}, + { 3, 0x0d, "Mysticom"}, + { 3, 0x0e, "LightSand Communications"}, + { 3, 0x8f, "ATI Technologies"}, + { 3, 0x10, "Agere Systems"}, + { 3, 0x91, "NeoMagic"}, + { 3, 0x92, "AuroraNetics"}, + { 3, 0x13, "Geil"}, + { 3, 0x94, "Mushkin"}, + { 3, 0x15, "Tioga Technologies"}, + { 3, 0x16, "Netlist"}, + { 3, 0x97, "TeraLogic"}, + { 3, 0x98, "Cicada Semiconductor"}, + { 3, 0x19, "Centon Electronics"}, + { 3, 0x1a, "Tyco Electronics"}, + { 3, 0x9b, "Magis Works"}, + { 3, 0x1c, "Zettacom"}, + { 3, 0x9d, "Cogency Semiconductor"}, + { 3, 0x9e, "Chipcon AS"}, + { 3, 0x1f, "Aspex Technology"}, + { 3, 0x20, "F5 Networks"}, + { 3, 0xa1, "Programmable Silicon Solutions"}, + { 3, 0xa2, "ChipWrights"}, + { 3, 0x23, "Acorn Networks"}, + { 3, 0xa4, "Quicklogic"}, + { 3, 0x25, "Kingmax Semiconductor"}, + { 3, 0x26, "BOPS"}, + { 3, 0xa7, "Flasys"}, + { 3, 0xa8, "BitBlitz Communications"}, + { 3, 0x29, "eMemory Technology"}, + { 3, 0x2a, "Procket Networks"}, + { 3, 0xab, "Purple Ray"}, + { 3, 0x2c, "Trebia Networks"}, + { 3, 0xad, "Delta Electronics"}, + { 3, 0xae, "Onex Communications"}, + { 3, 0x2f, "Ample Communications"}, + { 3, 0xb0, "Memory Experts Intl"}, + { 3, 0x31, "Astute Networks"}, + { 3, 0x32, "Azanda Network Devices"}, + { 3, 0xb3, "Dibcom"}, + { 3, 0x34, "Tekmos"}, + { 3, 0xb5, "API NetWorks"}, + { 3, 0xb6, "Bay Microsystems"}, + { 3, 0x37, "Firecron"}, + { 3, 0x38, "Resonext Communications"}, + { 3, 0xb9, "Tachys Technologies"}, + { 3, 0xba, "Equator Technology"}, + { 3, 0x3b, "Concept Computer"}, + { 3, 0xbc, "SILCOM"}, + { 3, 0x3d, "3Dlabs"}, + { 3, 0x3e, "c?t Magazine"}, + { 3, 0xbf, "Sanera Systems"}, + { 3, 0x40, "Silicon Packets"}, + { 3, 0xc1, "Viasystems Group"}, + { 3, 0xc2, "Simtek"}, + { 3, 0x43, "Semicon Devices Singapore"}, + { 3, 0xc4, "Satron Handelsges"}, + { 3, 0x45, "Improv Systems"}, + { 3, 0x46, "INDUSYS"}, + { 3, 0xc7, "Corrent"}, + { 3, 0xc8, "Infrant Technologies"}, + { 3, 0x49, "Ritek Corp"}, + { 3, 0x4a, "empowerTel Networks"}, + { 3, 0xcb, "Hypertec"}, + { 3, 0x4c, "Cavium Networks"}, + { 3, 0xcd, "PLX Technology"}, + { 3, 0xce, "Massana Design"}, + { 3, 0x4f, "Intrinsity"}, + { 3, 0xd0, "Valence Semiconductor"}, + { 3, 0x51, "Terawave Communications"}, + { 3, 0x52, "IceFyre Semiconductor"}, + { 3, 0xd3, "Primarion"}, + { 3, 0x54, "Picochip Designs"}, + { 3, 0xd5, "Silverback Systems"}, + { 3, 0xd6, "Jade Star Technologies"}, + { 3, 0x57, "Pijnenburg Securealink"}, + { 3, 0x58, "takeMS International AG"}, + { 3, 0xd9, "Cambridge Silicon Radio"}, + { 3, 0xda, "Swissbit"}, + { 3, 0x5b, "Nazomi Communications"}, + { 3, 0xdc, "eWave System"}, + { 3, 0x5d, "Rockwell Collins"}, + { 3, 0x5e, "Picocel Co. (Paion)"}, + { 3, 0xdf, "Alphamosaic"}, + { 3, 0xe0, "Sandburst"}, + { 3, 0x61, "SiCon Video"}, + { 3, 0x62, "NanoAmp Solutions"}, + { 3, 0xe3, "Ericsson Technology"}, + { 3, 0x64, "PrairieComm"}, + { 3, 0xe5, "Mitac International"}, + { 3, 0xe6, "Layer N Networks"}, + { 3, 0x67, "MtekVision (Atsana)"}, + { 3, 0x68, "Allegro Networks"}, + { 3, 0xe9, "Marvell Semiconductors"}, + { 3, 0xea, "Netergy Microelectronic"}, + { 3, 0x6b, "NVIDIA"}, + { 3, 0xec, "Internet Machines"}, + { 3, 0x6d, "Peak Electronics"}, + { 3, 0x6e, "Litchfield Communication"}, + { 3, 0xef, "Accton Technology"}, + { 3, 0x70, "Teradiant Networks"}, + { 3, 0xf1, "Scaleo Chip"}, + { 3, 0xf2, "Cortina Systems"}, + { 3, 0x73, "RAM Components"}, + { 3, 0xf4, "Raqia Networks"}, + { 3, 0x75, "ClearSpeed"}, + { 3, 0x76, "Matsushita Battery"}, + { 3, 0xf7, "Xelerated"}, + { 3, 0xf8, "SimpleTech"}, + { 3, 0x79, "Utron Technology"}, + { 3, 0x7a, "Astec International"}, + { 3, 0xfb, "AVM"}, + { 3, 0x7c, "Redux Communications"}, + { 3, 0xfd, "Dot Hill Systems"}, + { 3, 0xfe, "TeraChip"}, + { 4, 0x01, "T-RAM"}, + { 4, 0x02, "Innovics Wireless"}, + { 4, 0x83, "Teknovus"}, + { 4, 0x04, "KeyEye Communications"}, + { 4, 0x85, "Runcom Technologies"}, + { 4, 0x86, "RedSwitch"}, + { 4, 0x07, "Dotcast"}, + { 4, 0x08, "Silicon Mountain Memory"}, + { 4, 0x89, "Signia Technologies"}, + { 4, 0x8a, "Pixim"}, + { 4, 0x0b, "Galazar Networks"}, + { 4, 0x8c, "White Electronic Designs"}, + { 4, 0x0d, "Patriot Scientific"}, + { 4, 0x0e, "Neoaxiom"}, + { 4, 0x8f, "3Y Power Technology"}, + { 4, 0x10, "Scaleo Chip"}, + { 4, 0x91, "Potentia Power Systems"}, + { 4, 0x92, "C-guys"}, + { 4, 0x13, "Digital Communications Technology"}, + { 4, 0x94, "Silicon-Based Technology"}, + { 4, 0x15, "Fulcrum Microsystems"}, + { 4, 0x16, "Positivo Informatica"}, + { 4, 0x97, "XIOtech"}, + { 4, 0x98, "PortalPlayer"}, + { 4, 0x19, "Zhiying Software"}, + { 4, 0x1a, "ParkerVision"}, + { 4, 0x9b, "Phonex Broadband"}, + { 4, 0x1c, "Skyworks Solutions"}, + { 4, 0x9d, "Entropic Communications"}, + { 4, 0x9e, "Pacific Force Technology"}, + { 4, 0x1f, "Zensys A/S"}, + { 4, 0x20, "Legend Silicon Corp."}, + { 4, 0xa1, "Sci-worx"}, + { 4, 0xa2, "SMSC (Standard Microsystems)"}, + { 4, 0x23, "Renesas Technology"}, + { 4, 0xa4, "Raza Microelectronics"}, + { 4, 0x25, "Phyworks"}, + { 4, 0x26, "MediaTek"}, + { 4, 0xa7, "Non-cents Productions"}, + { 4, 0xa8, "US Modular"}, + { 4, 0x29, "Wintegra"}, + { 4, 0x2a, "Mathstar"}, + { 4, 0xab, "StarCore"}, + { 4, 0x2c, "Oplus Technologies"}, + { 4, 0xad, "Mindspeed"}, + { 4, 0xae, "Just Young Computer"}, + { 4, 0x2f, "Radia Communications"}, + { 4, 0xb0, "OCZ"}, + { 4, 0x31, "Emuzed"}, + { 4, 0x32, "LOGIC Devices"}, + { 4, 0xb3, "Inphi"}, + { 4, 0x34, "Quake Technologies"}, + { 4, 0xb5, "Vixel"}, + { 4, 0xb6, "SolusTek"}, + { 4, 0x37, "Kongsberg Maritime"}, + { 4, 0x38, "Faraday Technology"}, + { 4, 0xb9, "Altium"}, + { 4, 0xba, "Insyte"}, + { 4, 0x3b, "ARM"}, + { 4, 0xbc, "DigiVision"}, + { 4, 0x3d, "Vativ Technologies"}, + { 4, 0x3e, "Endicott Interconnect Technologies"}, + { 4, 0xbf, "Pericom"}, + { 4, 0x40, "Bandspeed"}, + { 4, 0xc1, "LeWiz Communications"}, + { 4, 0xc2, "CPU Technology"}, + { 4, 0x43, "Ramaxel Technology"}, + { 4, 0xc4, "DSP Group"}, + { 4, 0x45, "Axis Communications"}, + { 4, 0x46, "Legacy Electronics"}, + { 4, 0xc7, "Chrontel"}, + { 4, 0xc8, "Powerchip Semiconductor"}, + { 4, 0x49, "MobilEye Technologies"}, + { 4, 0x4a, "Excel Semiconductor"}, + { 4, 0xcb, "A-DATA Technology"}, + { 4, 0x4c, "VirtualDigm"}, + { 4, 0xcd, "G Skill Intl"}, + { 4, 0xce, "Quanta Computer"}, + { 4, 0x4f, "Yield Microelectronics"}, + { 4, 0xd0, "Afa Technologies"}, + { 4, 0x51, "KINGBOX Technology Co."}, + { 4, 0x52, "Ceva"}, + { 4, 0xd3, "iStor Networks"}, + { 4, 0x54, "Advance Modules"}, + { 4, 0xd5, "Microsoft"}, + { 4, 0xd6, "Open-Silicon"}, + { 4, 0x57, "Goal Semiconductor"}, + { 4, 0x58, "ARC International"}, + { 4, 0xd9, "Simmtec"}, + { 4, 0xda, "Metanoia"}, + { 4, 0x5b, "Key Stream"}, + { 4, 0xdc, "Lowrance Electronics"}, + { 4, 0x5d, "Adimos"}, + { 4, 0x5e, "SiGe Semiconductor"}, + { 4, 0xdf, "Fodus Communications"}, + { 4, 0xe0, "Credence Systems Corp."}, + { 4, 0x61, "Genesis Microchip"}, + { 4, 0x62, "Vihana"}, + { 4, 0xe3, "WIS Technologies"}, + { 4, 0x64, "GateChange Technologies"}, + { 4, 0xe5, "High Density Devices AS"}, + { 4, 0xe6, "Synopsys"}, + { 4, 0x67, "Gigaram"}, + { 4, 0x68, "Enigma Semiconductor"}, + { 4, 0xe9, "Century Micro"}, + { 4, 0xea, "Icera Semiconductor"}, + { 4, 0x6b, "Mediaworks Integrated Systems"}, + { 4, 0xec, "O?Neil Product Development"}, + { 4, 0x6d, "Supreme Top Technology"}, + { 4, 0x6e, "MicroDisplay"}, + { 4, 0xef, "Team Group"}, + { 4, 0x70, "Sinett"}, + { 4, 0xf1, "Toshiba"}, + { 4, 0xf2, "Tensilica"}, + { 4, 0x73, "SiRF Technology"}, + { 4, 0xf4, "Bacoc"}, + { 4, 0x75, "SMaL Camera Technologies"}, + { 4, 0x76, "Thomson SC"}, + { 4, 0xf7, "Airgo Networks"}, + { 4, 0xf8, "Wisair"}, + { 4, 0x79, "SigmaTel"}, + { 4, 0x7a, "Arkados"}, + { 4, 0xfb, "Compete IT Co. KG"}, + { 4, 0x7c, "Eudar Technology"}, + { 4, 0xfd, "Focus Enhancements"}, + { 4, 0xfe, "Xyratex"}, + { 5, 0x01, "Specular Networks"}, + { 5, 0x02, "PDP Systems"}, + { 5, 0x83, "U-Chip Technology Corp."}, + { 5, 0x04, "Silicon Optix"}, + { 5, 0x85, "Greenfield Networks"}, + { 5, 0x86, "CompuRAM"}, + { 5, 0x07, "Stargen"}, + { 5, 0x08, "NetCell"}, + { 5, 0x89, "Excalibrus Technologies"}, + { 5, 0x8a, "SCM Microsystems"}, + { 5, 0x0b, "Xsigo Systems"}, + { 5, 0x8c, "CHIPS & Systems"}, + { 5, 0x0d, "Tier"}, + { 5, 0x0e, "CWRL Labs"}, + { 5, 0x8f, "Teradici"}, + { 5, 0x10, "Gigaram"}, + { 5, 0x91, "g2 Microsystems"}, + { 5, 0x92, "PowerFlash Semiconductor"}, + { 5, 0x13, "P.A. Semi"}, + { 5, 0x94, "NovaTech Solutions, S.A."}, + { 5, 0x15, "c2 Microsystems"}, + { 5, 0x16, "Level5 Networks"}, + { 5, 0x97, "COS Memory AG"}, + { 5, 0x98, "Innovasic Semiconductor"}, + { 5, 0x19, "02IC Co."}, + { 5, 0x1a, "Tabula,"}, + { 5, 0x9b, "Crucial Technology"}, + { 5, 0x1c, "Chelsio Communications"}, + { 5, 0x9d, "Solarflare Communications"}, + { 5, 0x9e, "Xambala"}, + { 5, 0x1f, "EADS Astrium"}, + { 5, 0x20, "Terra Semiconductor"}, + { 5, 0xa1, "Imaging Works"}, + { 5, 0xa2, "Astute Networks"}, + { 5, 0x23, "Tzero"}, + { 5, 0xa4, "Emulex"}, + { 5, 0x25, "Power-One"}, + { 5, 0x26, "Pulse~LINK"}, + { 5, 0xa7, "Hon Hai Precision Industry"}, + { 5, 0xa8, "White Rock Networks"}, + { 5, 0x29, "Telegent Systems USA"}, + { 5, 0x2a, "Atrua Technologies"}, + { 5, 0xab, "Acbel Polytech"}, + { 5, 0x2c, "eRide"}, + { 5, 0xad, "ULi Electronics"}, + { 5, 0xae, "Magnum Semiconductor"}, + { 5, 0x2f, "neoOne Technology"}, + { 5, 0xb0, "Connex Technology"}, + { 5, 0x31, "Stream Processors"}, + { 5, 0x32, "Focus Enhancements"}, + { 5, 0xb3, "Telecis Wireless"}, + { 5, 0x34, "uNav Microelectronics"}, + { 5, 0xb5, "Tarari"}, + { 5, 0xb6, "Ambric"}, + { 5, 0x37, "Newport Media"}, + { 5, 0x38, "VMTS"}, + { 5, 0xb9, "Enuclia Semiconductor"}, + { 5, 0xba, "Virtium Technology"}, + { 5, 0x3b, "Solid State System Co."}, + { 5, 0xbc, "Kian Tech LLC"}, + { 5, 0x3d, "Artimi"}, + { 5, 0x3e, "Power Quotient International"}, + { 5, 0xbf, "Avago Technologies"}, + { 5, 0x40, "ADTechnology"}, + { 5, 0xc1, "Sigma Designs"}, + { 5, 0xc2, "SiCortex"}, + { 5, 0x43, "Ventura Technology Group"}, + { 5, 0xc4, "eASIC"}, + { 5, 0x45, "M.H.S. SAS"}, + { 5, 0x46, "Micro Star International"}, + { 5, 0xc7, "Rapport"}, + { 5, 0xc8, "Makway International"}, + { 5, 0x49, "Broad Reach Engineering Co."}, + { 5, 0x4a, "Semiconductor Mfg Intl Corp"}, + { 5, 0xcb, "SiConnect"}, + { 5, 0x4c, "FCI USA"}, + { 5, 0xcd, "Validity Sensors"}, + { 5, 0xce, "Coney Technology Co."}, + { 5, 0x4f, "Spans Logic"}, + { 5, 0xd0, "Neterion"}, + { 5, 0x51, "Qimonda"}, + { 5, 0x52, "New Japan Radio Co."}, + { 5, 0xd3, "Velogix"}, + { 5, 0x54, "Montalvo Systems"}, + { 5, 0xd5, "iVivity"}, + { 5, 0xd6, "Walton Chaintech"}, + { 5, 0x57, "AENEON"}, + { 5, 0x58, "Lorom Industrial Co."}, + { 5, 0xd9, "Radiospire Networks"}, + { 5, 0xda, "Sensio Technologies"}, + { 5, 0x5b, "Nethra Imaging"}, + { 5, 0xdc, "Hexon Technology Pte"}, + { 5, 0x5d, "CompuStocx (CSX)"}, + { 5, 0x5e, "Methode Electronics"}, + { 5, 0xdf, "Connect One"}, + { 5, 0xe0, "Opulan Technologies"}, + { 5, 0x61, "Septentrio NV"}, + { 5, 0x62, "Goldenmars Technology"}, + { 5, 0xe3, "Kreton"}, + { 5, 0x64, "Cochlear"}, + { 5, 0xe5, "Altair Semiconductor"}, + { 5, 0xe6, "NetEffect"}, + { 5, 0x67, "Spansion"}, + { 5, 0x68, "Taiwan Semiconductor Mfg"}, + { 5, 0xe9, "Emphany Systems"}, + { 5, 0xea, "ApaceWave Technologies"}, + { 5, 0x6b, "Mobilygen"}, + { 5, 0xec, "Tego"}, + { 5, 0x6d, "Cswitch"}, + { 5, 0x6e, "Haier (Beijing) IC Design Co."}, + { 5, 0xef, "MetaRAM"}, + { 5, 0x70, "Axel Electronics Co."}, + { 5, 0xf1, "Tilera"}, + { 5, 0xf2, "Aquantia"}, + { 5, 0x73, "Vivace Semiconductor"}, + { 5, 0xf4, "Redpine Signals"}, + { 5, 0x75, "Octalica"}, + { 5, 0x76, "InterDigital Communications"}, + { 5, 0xf7, "Avant Technology"}, + { 5, 0xf8, "Asrock"}, + { 5, 0x79, "Availink"}, + { 5, 0x7a, "Quartics"}, + { 5, 0xfb, "Element CXI"}, + { 5, 0x7c, "Innovaciones Microelectronicas"}, + { 5, 0xfd, "VeriSilicon Microelectronics"}, + { 5, 0xfe, "W5 Networks"}, + { 6, 0x01, "MOVEKING"}, + { 6, 0x02, "Mavrix Technology"}, + { 6, 0x83, "CellGuide"}, + { 6, 0x04, "Faraday Technology"}, + { 6, 0x85, "Diablo Technologies"}, + { 6, 0x86, "Jennic"}, + { 6, 0x07, "Octasic"}, + { 6, 0x08, "Molex"}, + { 6, 0x89, "3Leaf Networks"}, + { 6, 0x8a, "Bright Micron Technology"}, + { 6, 0x0b, "Netxen"}, + { 6, 0x8c, "NextWave Broadband"}, + { 6, 0x0d, "DisplayLink"}, + { 6, 0x0e, "ZMOS Technology"}, + { 6, 0x8f, "Tec-Hill"}, + { 6, 0x10, "Multigig"}, + { 6, 0x91, "Amimon"}, + { 6, 0x92, "Euphonic Technologies"}, + { 6, 0x13, "BRN Phoenix"}, + { 6, 0x94, "InSilica"}, + { 6, 0x15, "Ember"}, + { 6, 0x16, "Avexir Technologies"}, + { 6, 0x97, "Echelon"}, + { 6, 0x98, "Edgewater Computer Systems"}, + { 6, 0x19, "XMOS Semiconductor"}, + { 6, 0x1a, "GENUSION"}, + { 6, 0x9b, "Memory Corp NV"}, + { 6, 0x1c, "SiliconBlue Technologies"}, + { 6, 0x9d, "Rambus"}, + { 6, 0x9e, "Andes Technology"}, + { 6, 0x1f, "Coronis Systems"}, + { 6, 0x20, "Achronix Semiconductor"}, + { 6, 0xa1, "Siano Mobile Silicon"}, + { 6, 0xa2, "Semtech"}, + { 6, 0x23, "Pixelworks"}, + { 6, 0xa4, "Gaisler Research AB"}, + { 6, 0x25, "Teranetics"}, + { 6, 0x26, "Toppan Printing Co."}, + { 6, 0xa7, "Kingxcon"}, + { 6, 0xa8, "Silicon Integrated Systems"}, + { 6, 0x29, "I-O Data Device"}, + { 6, 0x2a, "NDS Americas"}, + { 6, 0xab, "Solomon Systech Limited"}, + { 6, 0x2c, "On Demand Microelectronics"}, + { 6, 0xad, "Amicus Wireless"}, + { 6, 0xae, "SMARDTV SNC"}, + { 6, 0x2f, "Comsys Communication"}, + { 6, 0xb0, "Movidia"}, + { 6, 0x31, "Javad GNSS"}, + { 6, 0x32, "Montage Technology Group"}, + { 6, 0xb3, "Trident Microsystems"}, + { 6, 0x34, "Super Talent"}, + { 6, 0xb5, "Optichron"}, + { 6, 0xb6, "Future Waves UK"}, + { 6, 0x37, "SiBEAM"}, + { 6, 0x38, "Inicore,"}, + { 6, 0xb9, "Virident Systems"}, + { 6, 0xba, "M2000"}, + { 6, 0x3b, "ZeroG Wireless"}, + { 6, 0xbc, "Gingle Technology Co."}, + { 6, 0x3d, "Space Micro"}, + { 6, 0x3e, "Wilocity"}, + { 6, 0xbf, "Novafora, Ic."}, + { 6, 0x40, "iKoa"}, + { 6, 0xc1, "ASint Technology"}, + { 6, 0xc2, "Ramtron"}, + { 6, 0x43, "Plato Networks"}, + { 6, 0xc4, "IPtronics AS"}, + { 6, 0x45, "Infinite-Memories"}, + { 6, 0x46, "Parade Technologies"}, + { 6, 0xc7, "Dune Networks"}, + { 6, 0xc8, "GigaDevice Semiconductor"}, + { 6, 0x49, "Modu"}, + { 6, 0x4a, "CEITEC"}, + { 6, 0xcb, "Northrop Grumman"}, + { 6, 0x4c, "XRONET"}, + { 6, 0xcd, "Sicon Semiconductor AB"}, + { 6, 0xce, "Atla Electronics Co."}, + { 6, 0x4f, "TOPRAM Technology"}, + { 6, 0xd0, "Silego Technology"}, + { 6, 0x51, "Kinglife"}, + { 6, 0x52, "Ability Industries"}, + { 6, 0xd3, "Silicon Power Computer & Communications"}, + { 6, 0x54, "Augusta Technology"}, + { 6, 0xd5, "Nantronics Semiconductors"}, + { 6, 0xd6, "Hilscher Gesellschaft"}, + { 6, 0x57, "Quixant"}, + { 6, 0x58, "Percello"}, + { 6, 0xd9, "NextIO"}, + { 6, 0xda, "Scanimetrics"}, + { 6, 0x5b, "FS-Semi Company"}, + { 6, 0xdc, "Infinera"}, + { 6, 0x5d, "SandForce"}, + { 6, 0x5e, "Lexar Media"}, + { 6, 0xdf, "Teradyne"}, + { 6, 0xe0, "Memory Exchange Corp."}, + { 6, 0x61, "Suzhou Smartek Electronics"}, + { 6, 0x62, "Avantium"}, + { 6, 0xe3, "ATP Electronics"}, + { 6, 0x64, "Valens Semiconductor"}, + { 6, 0xe5, "Agate Logic"}, + { 6, 0xe6, "Netronome"}, + { 6, 0x67, "Zenverge"}, + { 6, 0x68, "N-trig"}, + { 6, 0xe9, "SanMax Technologies"}, + { 6, 0xea, "Contour Semiconductor"}, + { 6, 0x6b, "TwinMOS"}, + { 6, 0xec, "Silicon Systems"}, + { 6, 0x6d, "V-Color Technology"}, + { 6, 0x6e, "Certicom"}, + { 6, 0xef, "JSC ICC Milandr"}, + { 6, 0x70, "PhotoFast Global"}, + { 6, 0xf1, "InnoDisk"}, + { 6, 0xf2, "Muscle Power"}, + { 6, 0x73, "Energy Micro"}, + { 6, 0xf4, "Innofidei"}, + { 9, 0xff, ""} +}; + +#define VEN_MAP_SIZE (sizeof(vendorMap)/sizeof(VenIdName)) + +#endif diff --git a/i386/libsaio/misc.c b/i386/libsaio/misc.c new file mode 100644 index 0000000..f26fd87 --- /dev/null +++ b/i386/libsaio/misc.c @@ -0,0 +1,120 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" + +/* + * keyboard controller (8042) I/O port addresses + */ +#define PORT_A 0x60 /* port A */ +#define PORT_B 0x64 /* port B */ + +/* + * keyboard controller command + */ +#define CMD_WOUT 0xd1 /* write controller's output port */ + +/* + * keyboard controller status flags + */ +#define KB_INFULL 0x2 /* input buffer full */ +#define KB_OUTFULL 0x1 /* output buffer full */ + +#define KB_A20 0x9f /* enable A20, + enable output buffer full interrupt + enable data line + disable clock line */ + +//========================================================================== +// Enable A20 gate to be able to access memory above 1MB + +static inline void flushKeyboardInputBuffer() +{ + unsigned char ret; + /* Apparently all flags on means that they're invalid and that the code + should stop trying to check them because they'll never change */ + do + { + ret = inb(PORT_B); + } while( (ret != 0xff) && (ret & KB_INFULL)); +} + +void enableA20() +{ + /* make sure that the input buffer is empty */ + flushKeyboardInputBuffer(); + + /* make sure that the output buffer is empty */ + if (inb(PORT_B) & KB_OUTFULL) + (void)inb(PORT_A); + + /* make sure that the input buffer is empty */ + flushKeyboardInputBuffer(); + + /* write output port */ + outb(PORT_B, CMD_WOUT); + delay(100); + + /* wait until command is accepted */ + flushKeyboardInputBuffer(); + + outb(PORT_A, KB_A20); + delay(100); + + /* wait until done */ + flushKeyboardInputBuffer(); +} + +//========================================================================== +// Return the platform name for this hardware. +// +#ifndef BOOT1 +void +getPlatformName(char *nameBuf) +{ + strcpy(nameBuf, "ACPI"); +} +#endif diff --git a/i386/libsaio/msdos.c b/i386/libsaio/msdos.c new file mode 100644 index 0000000..f428ed9 --- /dev/null +++ b/i386/libsaio/msdos.c @@ -0,0 +1,952 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "libsaio.h" +#include "sl.h" +#include "msdos_private.h" +#include "msdos.h" + +#define LABEL_LENGTH 11 +#define MSDOS_CACHE_BLOCKSIZE BPS + +#define CLUST_FIRST 2/* reserved cluster range */ +#define CLUST_RSRVD32 0x0ffffff8 /* reserved cluster range */ +#define CLUST_RSRVD16 0xfff8 /* reserved cluster range */ +#define CLUST_RSRVD12 0xff8 /* reserved cluster range */ + +#define tolower(c) (((c)>='A' && c<='Z')?((c) | 0x20):(c)) + +static int msdosressector=0; +static int msdosnfats = 0; +static int msdosfatsecs = 0; +static int msdosbps = 0; +static int msdosclustersize = 0; +static int msdosrootDirSectors = 0; +static CICell msdoscurrent = 0; +static int msdosrootcluster = 0; +static int msdosfatbits = 0; + +#if UNUSED +/* + * Check a volume label. + */ +static int +oklabel(const char *src) +{ + int c, i; + + for (i = 0, c = 0; i <= 11; i++) { + c = (u_char)*src++; + if (c < ' ' + !i || strchr("\"*+,./:;<=>?[\\]|", c)) + break; + } + return i && !c; +} +#endif /* UNUSED */ + +void MSDOSFree(CICell ih) +{ + if(msdoscurrent == ih) + msdoscurrent = 0; + free(ih); +} + +int MSDOSProbe(const void * buffer) +{ + union bootsector *bsp; + struct bpb33 *b33; + struct bpb50 *b50; + struct bpb710 *b710; + u_int16_t bps; + u_int8_t spc; + + bsp = (union bootsector *)buffer; + b33 = (struct bpb33 *)bsp->bs33.bsBPB; + b50 = (struct bpb50 *)bsp->bs50.bsBPB; + b710 = (struct bpb710 *)bsp->bs710.bsBPB; + + /* We only work with 512, 1024, and 2048 byte sectors */ + bps = OSSwapLittleToHostInt16(b33->bpbBytesPerSec); + if ((bps < 0x200) || (bps & (bps - 1)) || (bps > 0x800)) + return 0; + + /* Check to make sure valid sectors per cluster */ + spc = b33->bpbSecPerClust; + if ((spc == 0 ) || (spc & (spc - 1))) + return 0; + + if (OSSwapLittleToHostInt16(b50->bpbRootDirEnts) == 0) { /* It's FAT32 */ + if (!memcmp(((struct extboot *)bsp->bs710.bsExt)->exFileSysType, "FAT32 ", 8)) + return 32; + } + else if (((struct extboot *)bsp->bs50.bsExt)->exBootSignature == EXBOOTSIG) { + if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT16 ", 8)) + return 16; + if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT12 ", 8)) + return 12; + } + + return 0; +} + + +long +MSDOSInitPartition (CICell ih) +{ + union bootsector *bsp; + struct bpb33 *b33; + struct bpb50 *b50; + struct bpb710 *b710; + u_int8_t spc; + char *buf; + + if (msdoscurrent == ih) + { + CacheInit(ih, MSDOS_CACHE_BLOCKSIZE); + return 0; + } + + buf=malloc (512); + /* + * Read the boot sector of the filesystem, and then check the + * boot signature. If not a dos boot sector then error out. + * + * NOTE: 2048 is a maximum sector size in current... + */ + Seek(ih, 0); + Read(ih, (long)buf, 512); + + bsp = (union bootsector *)buf; + b33 = (struct bpb33 *)bsp->bs33.bsBPB; + b50 = (struct bpb50 *)bsp->bs50.bsBPB; + b710 = (struct bpb710 *)bsp->bs710.bsBPB; + + + /* We only work with 512, 1024, and 2048 byte sectors */ + msdosbps = OSSwapLittleToHostInt16(b33->bpbBytesPerSec); + if ((msdosbps < 0x200) || (msdosbps & (msdosbps - 1)) || (msdosbps > 0x800)) + { + free (buf); + return -1; + } + + /* Check to make sure valid sectors per cluster */ + spc = b33->bpbSecPerClust; + if ((spc == 0 ) || (spc & (spc - 1))) + return -1; + + if (OSSwapLittleToHostInt16(b50->bpbRootDirEnts) == 0) { /* It's FAT32 */ + if (memcmp(((struct extboot *)bsp->bs710.bsExt)->exFileSysType, "FAT32 ", 8)) + { + free (buf); + return -1; + } + msdosressector = OSSwapLittleToHostInt16(b710->bpbResSectors); + msdosnfats = b710->bpbFATs; + msdosfatsecs = OSSwapLittleToHostInt16(b710->bpbBigFATsecs); + msdosrootcluster = OSSwapLittleToHostInt32(b710->bpbRootClust); + msdosrootDirSectors = 0; + msdosfatbits = 32; + } + else if (((struct extboot *)bsp->bs50.bsExt)->exBootSignature == EXBOOTSIG) { + if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT16 ", 8)) + msdosfatbits = 16; + else if (!memcmp((char *)((struct extboot *)bsp->bs50.bsExt)->exFileSysType, "FAT12 ", 8)) + msdosfatbits = 12; + else + { + free (buf); + return -1; + } + + msdosressector = OSSwapLittleToHostInt16(b33->bpbResSectors); + msdosnfats = b33->bpbFATs; + msdosfatsecs = OSSwapLittleToHostInt16(b33->bpbFATsecs); + msdosrootcluster = 0; + msdosrootDirSectors = ((OSSwapLittleToHostInt16(b50->bpbRootDirEnts) * sizeof(struct direntry)) + + (msdosbps-1)) / msdosbps; + } else { + free (buf); + return -1; + } + + msdosclustersize = msdosbps * spc; + msdoscurrent = ih; + + CacheInit(ih, MSDOS_CACHE_BLOCKSIZE); + free (buf); + return 0; +} + +static int +readSector(CICell ih, off_t readOffset, char *buf, int size) +{ + // Caching only FAT entries (4 bytes) by utlizing the cache with sector aligned read requests. + if (size < BPS) + { + long long sectorOffset = (uint64_t)readOffset / BPS * BPS; + long relOffset = readOffset % BPS; + char *cacheBuffer; + + cacheBuffer = malloc(MSDOS_CACHE_BLOCKSIZE); + CacheRead(ih, cacheBuffer, sectorOffset, MSDOS_CACHE_BLOCKSIZE, true); + bcopy(cacheBuffer + relOffset, buf, size); + free(cacheBuffer); + } + else + { + Seek(ih, readOffset); + Read(ih, (long)buf, size); + } + + return 0; +} + +static int +msdosreadcluster (CICell ih, uint8_t *buf, int size, off_t *cluster) +{ + off_t readOffset; + char tmpbuf[8]; + off_t clusn; + + switch (msdosfatbits) { + case 32: + if (*cluster < CLUST_FIRST ||*cluster >= CLUST_RSRVD32) + return 0; + clusn = *cluster - CLUST_FIRST; + break; + case 16: + if (*cluster < CLUST_FIRST ||*cluster >= CLUST_RSRVD16) + return 0; + clusn = *cluster - CLUST_FIRST; + break; + case 12: + if (*cluster < CLUST_FIRST ||*cluster >= CLUST_RSRVD12) + return 0; + clusn = *cluster - CLUST_FIRST; + break; + default: + return 0; + } + + /* Find sector where clusters start */ + readOffset = (msdosressector + + (msdosnfats * msdosfatsecs)+msdosrootDirSectors)*msdosbps; + /* Find sector where "cluster" starts */ + readOffset += clusn * msdosclustersize; + + /* Read in "cluster" */ + if (buf) + { + Seek(ih, readOffset); + Read(ih, (long)buf, size); + } + + /* Find first sector of FAT */ + readOffset = msdosressector * msdosbps; + + /* Find sector containing "cluster" entry in FAT */ + readOffset += ((uint64_t)*cluster * (uint64_t)msdosfatbits) / 8; + + /* Read one sector of the FAT */ + readSector(ih, readOffset, tmpbuf, 4); + + switch (msdosfatbits) { + case 32: + *cluster = OSReadLittleInt32(tmpbuf, 0); + *cluster &= 0x0FFFFFFF; // ignore reserved upper bits + return 1; + case 16: + *cluster = OSReadLittleInt16(tmpbuf, 0); + return 1; + case 12: + *cluster = OSReadLittleInt16(tmpbuf, 0)>>(((uint64_t)*cluster * (uint64_t)msdosfatbits)%8); + *cluster &= 0xfff; + return 1; + default: + return 0; + } +} + +struct msdosdirstate +{ + struct direntry *buf; + uint8_t vfatchecksum; + int root16; + off_t cluster; + int nument; + int vfatnumber; +}; + +static struct direntry * +getnextdirent (CICell ih, uint16_t *longname, struct msdosdirstate *st) +{ + struct direntry *dirp; + while (1) + { + if (st->root16) + { + if (st->cluster >= msdosrootDirSectors && st->nument == 0) + return 0; + if (st->nument == 0) + { + Seek(ih, (msdosressector + + (msdosnfats * msdosfatsecs)+st->cluster)*msdosbps); + Read(ih, (long)st->buf, msdosbps); + st->cluster++; + } + } else if (st->nument == 0 && !msdosreadcluster (ih, (uint8_t *)st->buf, msdosclustersize, &(st->cluster))) + return 0; + + dirp=st->buf+st->nument; + + if (dirp->deName[0] == SLOT_EMPTY) + return 0; + else if (dirp->deName[0] == SLOT_DELETED) + st->vfatnumber = 0; + else if (dirp->deAttributes == ATTR_WIN95) + { + struct winentry *wdirp = (struct winentry *)dirp; + int num; + if (wdirp->weCnt & 0x80) + continue; + num=(wdirp->weCnt&0x3f); + if (WIN_CHARS * num > WIN_MAXLEN) + continue; + if (st->vfatchecksum!=wdirp->weChksum) + { + st->vfatnumber = 0; + st->vfatchecksum = wdirp->weChksum; + } + if (st->vfatnumber < num) + st->vfatnumber = num; + bcopy (&(wdirp->wePart1),longname+WIN_CHARS*(num-1),sizeof (wdirp->wePart1)); + bcopy (&(wdirp->wePart2),longname+WIN_CHARS*(num-1)+5,sizeof (wdirp->wePart2)); + bcopy (&(wdirp->wePart3),longname+WIN_CHARS*(num-1)+11,sizeof (wdirp->wePart3)); + } else { + uint8_t labelchecksum; + int i; + longname[st->vfatnumber*WIN_CHARS]=0; + + labelchecksum=0; + for(i=0;i<LABEL_LENGTH;i++) + labelchecksum=(labelchecksum>>1)+(labelchecksum<<7)+dirp->deName[i]; + if (!(labelchecksum==st->vfatchecksum && st->vfatnumber)) + longname[0]=0; + st->vfatnumber = 0; + st->vfatchecksum = 0; + st->vfatnumber = 0; + st->nument++; + if ((!st->root16 &&st->nument * sizeof (struct direntry)>=msdosclustersize) + || (st->root16 &&st->nument * sizeof (struct direntry)>=msdosbps)) + st->nument = 0; + return dirp; + } + st->nument++; + if ((!st->root16 &&st->nument * sizeof (struct direntry)>=msdosclustersize) + || (st->root16 &&st->nument * sizeof (struct direntry)>=msdosbps)) + st->nument = 0; + } +} + +static void +initRoot (struct msdosdirstate *st) +{ + if (msdosrootDirSectors) { /* FAT12 or FAT16 */ + st->root16 = 1; + st->vfatchecksum = 0; + st->nument = 0; + st->cluster = 0; + st->vfatnumber = 0; + } else { /* FAT32 */ + st->root16 = 0; + st->vfatchecksum = 0; + st->nument = 0; + st->cluster = msdosrootcluster; + st->vfatnumber = 0; + } +} + +/* First comes lowercase, then uppercase*/ +static uint16_t cp850[128][2]= +{ +{0x00E7,0x00C7}, +{0x00FC,0x00DC}, +{0x00E9,0x00C9}, +{0x00E2,0x00C2}, +{0x00E4,0x00C4}, +{0x00E0,0x00C0}, +{0x00E5,0x00C5}, +{0x00E7,0x00C7}, +{0x00EA,0x00CA}, +{0x00EB,0x00CB}, +{0x00E8,0x00C8}, +{0x00EF,0x00CF}, +{0x00EE,0x00CE}, +{0x00EC,0x00CC}, +{0x00E4,0x00C4}, +{0x00E5,0x00C5}, +{0x00E9,0x00C9}, +{0x00E6,0x00C6}, +{0x00E6,0x00C6}, +{0x00F4,0x00D4}, +{0x00F6,0x00D6}, +{0x00F2,0x00D2}, +{0x00FB,0x00DB}, +{0x00F9,0x00D9}, +{0x00FF,0x0178}, +{0x00F6,0x00D6}, +{0x00FC,0x00DC}, +{0x00F8,0x00D8}, +{0x00A3,0x00A3}, +{0x00F8,0x00D8}, +{0x00D7,0x00D7}, +{0x0192,0x0191}, +{0x00E1,0x00C1}, +{0x00ED,0x00CD}, +{0x00F3,0x00D3}, +{0x00FA,0x00DA}, +{0x00F1,0x00D1}, +{0x00F1,0x00D1}, +{0x00AA,0x00AA}, +{0x00BA,0x00BA}, +{0x00BF,0x00BF}, +{0x00AE,0x00AE}, +{0x00AC,0x00AC}, +{0x00BD,0x00BD}, +{0x00BC,0x00BC}, +{0x00A1,0x00A1}, +{0x00AB,0x00AB}, +{0x00BB,0x00BB}, +{0x2591,0x2591}, +{0x2592,0x2592}, +{0x2593,0x2593}, +{0x2502,0x2502}, +{0x2524,0x2524}, +{0x00E1,0x00C1}, +{0x00E2,0x00C2}, +{0x00E0,0x00C0}, +{0x00A9,0x00A9}, +{0x2563,0x2563}, +{0x2551,0x2551}, +{0x2557,0x2557}, +{0x255D,0x255D}, +{0x00A2,0x00A2}, +{0x00A5,0x00A5}, +{0x2510,0x2510}, +{0x2514,0x2514}, +{0x2534,0x2534}, +{0x252C,0x252C}, +{0x251C,0x251C}, +{0x2500,0x2500}, +{0x253C,0x253C}, +{0x00E3,0x00C3}, +{0x00E3,0x00C3}, +{0x255A,0x255A}, +{0x2554,0x2554}, +{0x2569,0x2569}, +{0x2566,0x2566}, +{0x2560,0x2560}, +{0x2550,0x2550}, +{0x256C,0x256C}, +{0x00A4,0x00A4}, +{0x00F0,0x00D0}, +{0x00F0,0x00D0}, +{0x00EA,0x00CA}, +{0x00EB,0x00CB}, +{0x00E8,0x00C8}, +{0x0131,0x0049}, +{0x00ED,0x00CD}, +{0x00EE,0x00CE}, +{0x00EF,0x00CF}, +{0x2518,0x2518}, +{0x250C,0x250C}, +{0x2588,0x2588}, +{0x2584,0x2584}, +{0x00A6,0x00A6}, +{0x00EC,0x00CC}, +{0x2580,0x2580}, +{0x00F3,0x00D3}, +{0x00DF,0x00DF}, +{0x00F4,0x00D4}, +{0x00F2,0x00D2}, +{0x00F5,0x00D5}, +{0x00F5,0x00D5}, +{0x00B5,0x00B5}, +{0x00FE,0x00DE}, +{0x00FE,0x00DE}, +{0x00FA,0x00DA}, +{0x00FB,0x00DB}, +{0x00F9,0x00D9}, +{0x00FD,0x00DD}, +{0x00FD,0x00DD}, +{0x00AF,0x00AF}, +{0x00B4,0x00B4}, +{0x00AD,0x00AD}, +{0x00B1,0x00B1}, +{0x2017,0x2017}, +{0x00BE,0x00BE}, +{0x00B6,0x00B6}, +{0x00A7,0x00A7}, +{0x00F7,0x00F7}, +{0x00B8,0x00B8}, +{0x00B0,0x00B0}, +{0x00A8,0x00A8}, +{0x00B7,0x00B7}, +{0x00B9,0x00B9}, +{0x00B3,0x00B3}, +{0x00B2,0x00B2}, +{0x25A0,0x25A0}, +{0x00A0,0x00A0} +}; + +static int +checkname (uint16_t *ucsname, int ucslen, struct direntry *dirp, uint16_t *vfatname) +{ + uint16_t tmp[15]; + if (vfatname[0]) + { + int i; + for (i=0;vfatname[i];i++); + return !FastUnicodeCompare (ucsname, ucslen, vfatname, i, OSLittleEndian); + } + else + { + int i, j, k; + for (i=7;i>=0;i--) + if (dirp->deName[i]!=' ') + break; + j=i+1; + tmp[i+1]=0; + for(;i>=0;i--) + tmp[i]=SWAP_LE16((dirp->deName[i]>=128)?cp850[dirp->deName[i]-128][0]:tolower(dirp->deName[i])); + for (i=2;i>=0;i--) + if (dirp->deName[8+i]!=' ') + break; + if (i>=0) + { + tmp[j++]='.'; + tmp[j+i+1]=0; + k=j+i+1; + for(;i>=0;i--) + tmp[j+i]=SWAP_LE16((dirp->deName[i+8]>=128)?cp850[dirp->deName[i+8]-128][0]:tolower(dirp->deName[i+8])); + j=k; + } + return !FastUnicodeCompare (ucsname, ucslen, tmp, j, OSLittleEndian); + } + +} + +static struct direntry * +getdirpfrompath (CICell ih, char *dirspec, uint8_t *buf) +{ + struct msdosdirstate st; + struct direntry *dirp; + uint8_t * ptr; + uint8_t *slash; + char c; + uint16_t vfatname[WIN_MAXLEN+2*WIN_CHARS]; + uint16_t ucsname[WIN_MAXLEN+1]; + uint16_t ucslen; + int ucslenhost; + initRoot (&st); + st.buf = (struct direntry *)buf; + ptr=(uint8_t*)dirspec; + for (slash=ptr;*slash && *slash!='/';slash++); + c=*slash; + *slash=0; + utf_decodestr (ptr, ucsname, &ucslen, WIN_MAXLEN, OSLittleEndian); + ucslenhost = OSReadLittleInt16 (&ucslen,0); + ucsname[ucslenhost]=0; + *slash=c; + while ((dirp = getnextdirent (ih, vfatname, &st))) + { + if (checkname (ucsname, ucslenhost, dirp, vfatname)) + { + for (;*ptr && *ptr!='/';ptr++); + if (!*ptr) + return dirp; + ptr++; + if (!*ptr) + return dirp; + for (slash=ptr;*slash && *slash!='/';slash++); + c=*slash; + *slash=0; + utf_decodestr (ptr, ucsname, &ucslen, WIN_MAXLEN, OSLittleEndian); + ucslenhost = OSReadLittleInt16 (&ucslen,0); + ucsname[ucslenhost]=0; + *slash=c; + if (!(dirp->deAttributes & ATTR_DIRECTORY)) + return 0; + st.root16 = 0; + st.vfatchecksum = 0; + st.nument = 0; + st.cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + if (msdosfatbits == 32) + st.cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + st.vfatnumber = 0; + } + } + return 0; +} + +long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + struct msdosdirstate *st; + struct direntry *dirp; + uint16_t vfatname[WIN_MAXLEN+2*WIN_CHARS]; + if (MSDOSInitPartition (ih)<0) + return -1; + if (dirPath[0] == '/') + dirPath++; + st = (struct msdosdirstate *)(long) *dirIndex; + if (!st) + { + st=malloc (sizeof (*st)); + if (dirPath[0]) + { + uint8_t *buf=malloc(msdosclustersize); + dirp = getdirpfrompath (ih, dirPath, buf); + if (!dirp || !(dirp->deAttributes & ATTR_DIRECTORY)) + { + free (buf); + free (st); + return -1; + } + st->buf = (struct direntry *)buf; + st->root16 = 0; + st->vfatchecksum = 0; + st->nument = 0; + st->cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + st->vfatnumber = 0; + if (msdosfatbits == 32) + st->cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + } + else + initRoot (st); + *dirIndex = (long long) (long) st; + } + while((dirp = getnextdirent (ih, vfatname, st))&& (dirp->deAttributes & ATTR_VOLUME)); + if (!dirp) + { + free (st->buf); + free (st); + return -1; + } + if (vfatname[0]) + { + int i; + for (i=0;vfatname[i];i++); + *name = malloc (256); + utf_encodestr(vfatname, i, (u_int8_t *)*name, 255, OSLittleEndian ); + } + else + { + int i, j, k; + uint16_t tmp[13]; + *name = malloc (26); + for (i=7;i>=0;i--) + if (dirp->deName[i]!=' ') + break; + j=i+1; + tmp[i+1]=0; + for(;i>=0;i--) + tmp[i]=(dirp->deName[i]>=128)?cp850[dirp->deName[i]-128][0]:tolower(dirp->deName[i]); + for (i=2;i>=0;i--) + if (dirp->deName[8+i]!=' ') + break; + + if (i>=0) + { + tmp[j++]='.'; + tmp[j+i+1]=0; + k=j+i+1; + for(;i>=0;i--) + tmp[j+i]=(dirp->deName[i]>=128)?cp850[dirp->deName[i+8]-128][0]:tolower(dirp->deName[i+8]); + j=k; + } + + utf_encodestr(tmp, j, (uint8_t*)*name, 25, OSHostByteOrder() ); + } + if (dirp->deAttributes & ATTR_DIRECTORY) + *flags = kFileTypeDirectory; + else + *flags = kFileTypeFlat; + + // Calculate a fake timestamp using modification date and time values. + *time = (dirp->deMDate & 0x7FFF) << 16 + dirp->deMTime; + + if (infoValid) + *infoValid = 1; + + return 0; +} + +long +MSDOSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length) +{ + uint8_t *buf; + off_t cluster; + uint64_t size; + uint64_t nskip; + int toread, wastoread; + char *ptr = (char *)base; + struct direntry *dirp; + int i; + char devStr[12]; + + if (MSDOSInitPartition (ih)<0) + return -1; + if (filePath[0] == '/') + filePath++; + buf = malloc(msdosclustersize); + dirp = getdirpfrompath (ih, filePath, buf); + + if (!dirp || (dirp->deAttributes & ATTR_DIRECTORY)) + { + free (buf); + return -1; + } + cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + if (msdosfatbits == 32) + cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + size = (uint32_t)OSReadLittleInt32 ((dirp->deFileSize),0); + if (size<=offset) + return -1; + nskip=offset/msdosclustersize; + for (i=0;i<nskip;i++) + msdosreadcluster (ih, 0, 0, &cluster); + msdosreadcluster (ih, buf, msdosclustersize, &cluster); + toread=length; + if (length==0 || length>size-offset) + toread=size-offset; + wastoread=toread; + bcopy (buf+(offset%msdosclustersize),ptr,MIN(msdosclustersize-(offset%msdosclustersize), toread)); + ptr+=msdosclustersize-(offset%msdosclustersize); + toread-=msdosclustersize-(offset%msdosclustersize); + while (toread>0 && msdosreadcluster (ih, (uint8_t *)ptr, MIN(msdosclustersize,toread), &cluster)) + { + ptr+=msdosclustersize; + toread-=msdosclustersize; + } + + getDeviceDescription(ih, devStr); + verbose("Read FAT%d file: [%s/%s] %d bytes.\n", + msdosfatbits, devStr, filePath, (uint32_t)( toread<0 ) ? wastoread : wastoread-toread); + free (buf); + if (toread<0) + return wastoread; + else + return wastoread-toread; +} + +long +MSDOSGetFileBlock(CICell ih, char *filePath, unsigned long long *firstBlock) +{ + uint8_t *buf; + off_t cluster; + struct direntry *dirp; + if (MSDOSInitPartition (ih)<0) + return -1; + if (filePath[0] == '/') + filePath++; + buf = malloc(msdosclustersize); + dirp = getdirpfrompath (ih, filePath, buf); + if (!dirp || (dirp->deAttributes & ATTR_DIRECTORY)) + { + free (buf); + return -1; + } + cluster = OSReadLittleInt16 ((dirp->deStartCluster),0); + if (msdosfatbits == 32) + cluster |= ((uint32_t)OSReadLittleInt16 ((dirp->deHighClust),0)) <<16; + + off_t clusn; + + switch (msdosfatbits) { + case 32: + if (cluster < CLUST_FIRST ||cluster >= CLUST_RSRVD32) + return -1; + clusn = cluster - CLUST_FIRST; + break; + case 16: + if (cluster < CLUST_FIRST ||cluster >= CLUST_RSRVD16) + return 0; + clusn = cluster - CLUST_FIRST; + break; + case 12: + + if (cluster < CLUST_FIRST ||cluster >= CLUST_RSRVD12) + return 0; + clusn = cluster - CLUST_FIRST; + break; + default: + return 0; + } + + *firstBlock = ((msdosressector + + (msdosnfats * msdosfatsecs))*msdosbps + clusn * msdosclustersize)/512; + free (buf); + return 0; +} + + +long MSDOSLoadFile(CICell ih, char * filePath) +{ + return MSDOSReadFile(ih, filePath, (void *)gFSLoadAddress, 0, 0); +} + +/* Fix up volume label. */ +static void +fixLabel(uint8_t *label, char *str, long strMaxLen) +{ + int i, len; + uint16_t labelucs[13]; + //unsigned char labelUTF8[LABEL_LENGTH*3]; + + /* Convert leading 0x05 to 0xE5 for multibyte languages like Japanese */ + if (label[0] == 0x05) + label[0] = 0xE5; + + /* Remove any trailing spaces */ + for (i=LABEL_LENGTH-1; i>=0; --i) { + if (label[i] == ' ') + label[i] = 0; + else + break; + } + labelucs[i++]=0; + len=i; + for (;i>=0;--i) + labelucs[i]=label[i]>=128?cp850[label[i]-128][1]:(label[i]); + + utf_encodestr(labelucs, len, (uint8_t *)str, strMaxLen, OSHostByteOrder() ); +} + + +void +MSDOSGetDescription(CICell ih, char *str, long strMaxLen) +{ + struct direntry *dirp; + uint8_t label[LABEL_LENGTH+1]; + uint16_t vfatlabel[WIN_MAXLEN+2*WIN_CHARS]; + struct msdosdirstate st; + int labelfound = 0; + + if (MSDOSInitPartition (ih)<0) + { + str[0]=0; + return; + } + + label[0] = '\0'; + + initRoot (&st); + st.buf = malloc(msdosclustersize); + while ((dirp = getnextdirent (ih, vfatlabel, &st))) + if (dirp->deAttributes & ATTR_VOLUME) { + strncpy((char *)label, (char *)dirp->deName, LABEL_LENGTH); + labelfound = 1; + break; + } + + free(st.buf); + + if (vfatlabel[0] && labelfound) + { + int i; + for (i=0;vfatlabel[i];i++); + utf_encodestr(vfatlabel, i, (u_int8_t *)str, strMaxLen, OSLittleEndian ); + } + else if (labelfound) + fixLabel(label, str, strMaxLen); + + /* else look in the boot blocks */ + if (!labelfound || str[0] == '\0') { + char *buf = malloc (512); + union bootsector *bsp = (union bootsector *)buf; + Seek(ih, 0); + Read(ih, (long)buf, 512); + if (msdosfatbits == 32) { /* It's FAT32 */ + strncpy((char *)label, (char *)((struct extboot *)bsp->bs710.bsExt)->exVolumeLabel, LABEL_LENGTH); + } + else if (msdosfatbits == 16) { + strncpy((char *)label, (char *)((struct extboot *)bsp->bs50.bsExt)->exVolumeLabel, LABEL_LENGTH); + } + free (buf); + fixLabel(label, str, strMaxLen); + } + + return; +} + +long +MSDOSGetUUID(CICell ih, char *uuidStr) +{ + char *buf = malloc (512); + union bootsector *bsp = (union bootsector *)buf; + + if (MSDOSInitPartition (ih)<0) + { + return -1; + } + bzero (uuidStr, 16); + Seek(ih, 0); + Read(ih, (long)buf, 512); + if (msdosfatbits == 32) { /* It's FAT32 */ + memcpy(uuidStr+12, (char *)((struct extboot *)bsp->bs710.bsExt)->exVolumeID, 4); + } + else if (msdosfatbits == 16) { + memcpy(uuidStr+12, (char *)((struct extboot *)bsp->bs50.bsExt)->exVolumeID, 4); + } + free (buf); + return 0; + +} diff --git a/i386/libsaio/msdos.h b/i386/libsaio/msdos.h new file mode 100644 index 0000000..2526d93 --- /dev/null +++ b/i386/libsaio/msdos.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern void MSDOSGetDescription(CICell ih, char *str, long strMaxLen); +extern long MSDOSInitPartition(CICell ih); +extern long MSDOSLoadFile(CICell ih, char * filePath); +extern long MSDOSReadFile(CICell ih, char * filePath, void *base, uint64_t offset, uint64_t length); +extern long MSDOSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +extern long MSDOSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); +extern long MSDOSGetUUID(CICell ih, char *uuidStr); +extern void MSDOSFree(CICell ih); +extern int MSDOSProbe (const void *buf); diff --git a/i386/libsaio/msdos_private.h b/i386/libsaio/msdos_private.h new file mode 100644 index 0000000..fca1ff8 --- /dev/null +++ b/i386/libsaio/msdos_private.h @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Written by Paul Popelka (paulp@uts.amdahl.com) + * + * You can do anything you want with this software, just don't say you wrote + * it, and don't remove this notice. + * + * This software is provided "as is". + * + * The author supplies this software to be publicly redistributed on the + * understanding that the author is not responsible for the correct + * functioning of this software in any circumstances and is not liable for + * any damages caused by this software. + * + * October 1992 + */ + +/* + * Format of a boot sector. This is the first sector on a DOS floppy disk + * or the fist sector of a partition on a hard disk. But, it is not the + * first sector of a partitioned hard disk. + */ +struct bootsector33 { + u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + int8_t bsOemName[8]; /* OEM name and version */ + int8_t bsBPB[19]; /* BIOS parameter block */ + int8_t bsDriveNumber; /* drive number (0x80) */ + int8_t bsBootCode[479]; /* pad so struct is 512b */ + u_int8_t bsBootSectSig0; + u_int8_t bsBootSectSig1; +#define BOOTSIG0 0x55 +#define BOOTSIG1 0xaa +}; + +struct extboot { + int8_t exDriveNumber; /* drive number (0x80) */ + int8_t exReserved1; /* reserved */ + int8_t exBootSignature; /* ext. boot signature (0x29) */ +#define EXBOOTSIG 0x29 + int8_t exVolumeID[4]; /* volume ID number */ + int8_t exVolumeLabel[11]; /* volume label */ + int8_t exFileSysType[8]; /* fs type (FAT12 or FAT16) */ +}; + +struct bootsector50 { + u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + int8_t bsOemName[8]; /* OEM name and version */ + int8_t bsBPB[25]; /* BIOS parameter block */ + int8_t bsExt[26]; /* Bootsector Extension */ + int8_t bsBootCode[448]; /* pad so structure is 512b */ + u_int8_t bsBootSectSig0; + u_int8_t bsBootSectSig1; +#define BOOTSIG0 0x55 +#define BOOTSIG1 0xaa +}; + +struct bootsector710 { + u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + int8_t bsOEMName[8]; /* OEM name and version */ + int8_t bsBPB[53]; /* BIOS parameter block */ + int8_t bsExt[26]; /* Bootsector Extension */ + int8_t bsBootCode[420]; /* pad so structure is 512b */ + u_int8_t bsBootSectSig0; + u_int8_t bsBootSectSig1; +#define BOOTSIG0 0x55 +#define BOOTSIG1 0xaa +}; + +union bootsector { + struct bootsector33 bs33; + struct bootsector50 bs50; + struct bootsector710 bs710; +}; + + +/* BPB */ + +/* + * BIOS Parameter Block (BPB) for DOS 3.3 + */ +struct bpb33 { + u_int16_t bpbBytesPerSec; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int16_t bpbResSectors; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int16_t bpbRootDirEnts; /* number of root directory entries */ + u_int16_t bpbSectors; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int16_t bpbFATsecs; /* number of sectors per FAT */ + u_int16_t bpbSecPerTrack; /* sectors per track */ + u_int16_t bpbHeads; /* number of heads */ + u_int16_t bpbHiddenSecs; /* number of hidden sectors */ +} __attribute__((packed)); + +/* + * BPB for DOS 5.0 The difference is bpbHiddenSecs is a short for DOS 3.3, + * and bpbHugeSectors is not in the 3.3 bpb. + */ +struct bpb50 { + u_int16_t bpbBytesPerSec; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int16_t bpbResSectors; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int16_t bpbRootDirEnts; /* number of root directory entries */ + u_int16_t bpbSectors; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int16_t bpbFATsecs; /* number of sectors per FAT */ + u_int16_t bpbSecPerTrack; /* sectors per track */ + u_int16_t bpbHeads; /* number of heads */ + u_int32_t bpbHiddenSecs; /* # of hidden sectors */ + u_int32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ +} __attribute__((packed)); + +/* + * BPB for DOS 7.10 (FAT32). This one has a few extensions to bpb50. + */ +struct bpb710 { + u_int16_t bpbBytesPerSec; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int16_t bpbResSectors; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int16_t bpbRootDirEnts; /* number of root directory entries */ + u_int16_t bpbSectors; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int16_t bpbFATsecs; /* number of sectors per FAT */ + u_int16_t bpbSecPerTrack; /* sectors per track */ + u_int16_t bpbHeads; /* number of heads */ + u_int32_t bpbHiddenSecs; /* # of hidden sectors */ + u_int32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ + u_int32_t bpbBigFATsecs; /* like bpbFATsecs for FAT32 */ + u_int16_t bpbExtFlags; /* extended flags: */ +#define FATNUM 0xf /* mask for numbering active FAT */ +#define FATMIRROR 0x80 /* FAT is mirrored (like it always was) */ + u_int16_t bpbFSVers; /* filesystem version */ +#define FSVERS 0 /* currently only 0 is understood */ + u_int32_t bpbRootClust; /* start cluster for root directory */ + u_int16_t bpbFSInfo; /* filesystem info structure sector */ + u_int16_t bpbBackup; /* backup boot sector */ + /* There is a 12 byte filler here, but we ignore it */ +} __attribute__((packed)); + +#if 0 +/* + * BIOS Parameter Block (BPB) for DOS 3.3 + */ +struct byte_bpb33 { + int8_t bpbBytesPerSec[2]; /* bytes per sector */ + int8_t bpbSecPerClust; /* sectors per cluster */ + int8_t bpbResSectors[2]; /* number of reserved sectors */ + int8_t bpbFATs; /* number of FATs */ + int8_t bpbRootDirEnts[2]; /* number of root directory entries */ + int8_t bpbSectors[2]; /* total number of sectors */ + int8_t bpbMedia; /* media descriptor */ + int8_t bpbFATsecs[2]; /* number of sectors per FAT */ + int8_t bpbSecPerTrack[2]; /* sectors per track */ + int8_t bpbHeads[2]; /* number of heads */ + int8_t bpbHiddenSecs[2]; /* number of hidden sectors */ +}; + +/* + * BPB for DOS 5.0 The difference is bpbHiddenSecs is a short for DOS 3.3, + * and bpbHugeSectors is not in the 3.3 bpb. + */ +struct byte_bpb50 { + int8_t bpbBytesPerSec[2]; /* bytes per sector */ + int8_t bpbSecPerClust; /* sectors per cluster */ + int8_t bpbResSectors[2]; /* number of reserved sectors */ + int8_t bpbFATs; /* number of FATs */ + int8_t bpbRootDirEnts[2]; /* number of root directory entries */ + int8_t bpbSectors[2]; /* total number of sectors */ + int8_t bpbMedia; /* media descriptor */ + int8_t bpbFATsecs[2]; /* number of sectors per FAT */ + int8_t bpbSecPerTrack[2]; /* sectors per track */ + int8_t bpbHeads[2]; /* number of heads */ + int8_t bpbHiddenSecs[4]; /* number of hidden sectors */ + int8_t bpbHugeSectors[4]; /* # of sectors if bpbSectors == 0 */ +}; + +/* + * BPB for DOS 7.10 (FAT32). This one has a few extensions to bpb50. + */ +struct byte_bpb710 { + u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int8_t bpbResSectors[2]; /* number of reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int8_t bpbRootDirEnts[2]; /* number of root directory entries */ + u_int8_t bpbSectors[2]; /* total number of sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int8_t bpbFATsecs[2]; /* number of sectors per FAT */ + u_int8_t bpbSecPerTrack[2]; /* sectors per track */ + u_int8_t bpbHeads[2]; /* number of heads */ + u_int8_t bpbHiddenSecs[4]; /* # of hidden sectors */ + u_int8_t bpbHugeSectors[4]; /* # of sectors if bpbSectors == 0 */ + u_int8_t bpbBigFATsecs[4]; /* like bpbFATsecs for FAT32 */ + u_int8_t bpbExtFlags[2]; /* extended flags: */ + u_int8_t bpbFSVers[2]; /* filesystem version */ + u_int8_t bpbRootClust[4]; /* start cluster for root directory */ + u_int8_t bpbFSInfo[2]; /* filesystem info structure sector */ + u_int8_t bpbBackup[2]; /* backup boot sector */ + /* There is a 12 byte filler here, but we ignore it */ +}; +#endif + +/* + * FAT32 FSInfo block. + */ +struct fsinfo { + u_int8_t fsisig1[4]; + u_int8_t fsifill1[480]; + u_int8_t fsisig2[4]; + u_int8_t fsinfree[4]; + u_int8_t fsinxtfree[4]; + u_int8_t fsifill2[12]; + u_int8_t fsisig3[4]; +}; + + +/* direntry */ + +/*- + * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. + * Copyright (C) 1994, 1995, 1997 TooLs GmbH. + * All rights reserved. + * Original code by Paul Popelka (paulp@uts.amdahl.com) (see above). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Structure of a dos directory entry. + */ +struct direntry { + u_int8_t deName[8]; /* filename, blank filled */ +#define SLOT_EMPTY 0x00 /* slot has never been used */ +#define SLOT_E5 0x05 /* the real value is 0xe5 */ +#define SLOT_DELETED 0xe5 /* file in this slot deleted */ + u_int8_t deExtension[3]; /* extension, blank filled */ + u_int8_t deAttributes; /* file attributes */ +#define ATTR_NORMAL 0x00 /* normal file */ +#define ATTR_READONLY 0x01 /* file is read-only (immutable) */ +#define ATTR_HIDDEN 0x02 /* file is hidden */ +#define ATTR_SYSTEM 0x04 /* file is a system file */ +#define ATTR_VOLUME 0x08 /* entry is a volume label */ +#define ATTR_DIRECTORY 0x10 /* entry is a directory name */ +#define ATTR_ARCHIVE 0x20 /* file is new or modified */ + u_int8_t deLowerCase; /* NT VFAT lower case flags */ +#define LCASE_BASE 0x08 /* filename base in lower case */ +#define LCASE_EXT 0x10 /* filename extension in lower case */ + u_int8_t deCHundredth; /* hundredth of seconds in CTime */ + u_int8_t deCTime[2]; /* create time */ + u_int8_t deCDate[2]; /* create date */ + u_int8_t deADate[2]; /* access date */ + u_int8_t deHighClust[2]; /* high bytes of cluster number */ + u_int16_t deMTime; /* last update time */ + u_int16_t deMDate; /* last update date */ + u_int8_t deStartCluster[2]; /* starting cluster of file */ + u_int8_t deFileSize[4]; /* size of file in bytes */ +}; + +/* + * Structure of a Win95 long name directory entry + */ +struct winentry { + u_int8_t weCnt; +#define WIN_LAST 0x40 +#define WIN_CNT 0x3f + u_int8_t wePart1[10]; + u_int8_t weAttributes; +#define ATTR_WIN95 0x0f + u_int8_t weReserved1; + u_int8_t weChksum; + u_int8_t wePart2[12]; + u_int16_t weReserved2; + u_int8_t wePart3[4]; +}; +#define WIN_CHARS 13 /* Number of chars per winentry */ + +/* + * Maximum filename length in Win95 + * Note: Must be < sizeof(dirent.d_name) + */ +#define WIN_MAXLEN 255 + +/* + * This is the format of the contents of the deTime field in the direntry + * structure. + * We don't use bitfields because we don't know how compilers for + * arbitrary machines will lay them out. + */ +#define DT_2SECONDS_MASK 0x1F /* seconds divided by 2 */ +#define DT_2SECONDS_SHIFT 0 +#define DT_MINUTES_MASK 0x7E0 /* minutes */ +#define DT_MINUTES_SHIFT 5 +#define DT_HOURS_MASK 0xF800 /* hours */ +#define DT_HOURS_SHIFT 11 + +/* + * This is the format of the contents of the deDate field in the direntry + * structure. + */ +#define DD_DAY_MASK 0x1F /* day of month */ +#define DD_DAY_SHIFT 0 +#define DD_MONTH_MASK 0x1E0 /* month */ +#define DD_MONTH_SHIFT 5 +#define DD_YEAR_MASK 0xFE00 /* year - 1980 */ +#define DD_YEAR_SHIFT 9 + diff --git a/i386/libsaio/nbp.c b/i386/libsaio/nbp.c new file mode 100644 index 0000000..853efe4 --- /dev/null +++ b/i386/libsaio/nbp.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "libsaio.h" + +/* This NBP code is pretty useless because it just blindly calls INT 2B. + Presumably INT 2B was implemented by some first-stage bootloader that + is long gone. + + One good reason to disable this is that nbpScanBootVolumes always + succeeds. The scanBootVolumes function thus never fails because + it always falls back to NBP. This is a problem because there is + other code in the booter (for example, in open) which needs to + fail instead of attempting to use this NBP which will often + hang the machine. + */ +#ifndef NBP_SUPPORT +#define NBP_SUPPORT 0 +#endif + +#if NBP_SUPPORT + +/* + * Convert zero-based linear address to far pointer. + */ +#define GET_FP(x) ( (((x) & 0xffff0000) << (16 - 4)) | ((x) & 0xffff) ) + +/*========================================================================== + * Issue a command to the network loader. + * + * The 'cmd' command structure should be allocated on the stack to + * ensure that it resides within the addressable range for the + * network loader, which runs in real mode. + */ +static UInt32 nbp(nbpCommandCode_t code, nbpCommand_u * cmd) +{ + loader(code, GET_FP((UInt32) cmd)); + + // Must re-enable the A20 address line, the PXE firmware will + // disable the A20 line control. + // + enableA20(); + + return cmd->header.status; +} + +/*========================================================================== + * Unload Base Code Stack command. + */ +UInt32 nbpUnloadBaseCode() +{ + return nbp(nbpCommandUnloadBaseCode, (nbpCommand_u *) 0); +} + +/*========================================================================== + * TFTP Read File command. + */ +static long NBPLoadFile(CICell ih, char * filePath) +{ + nbpCommandTFTPReadFile_s cmd; + UInt32 ret; + + strcpy((char *)cmd.filename, filePath); + cmd.status = nbpStatusFailed; + cmd.bufferSize = TFTP_LEN; + cmd.buffer = TFTP_ADDR; + + verbose("Loading file: %s\n", filePath); + + ret = nbp(nbpCommandTFTPReadFile, (nbpCommand_u *) &cmd); + + return (ret == nbpStatusSuccess) ? (long)cmd.bufferSize : -1; +} + +/*========================================================================== + * GetDirEntry is not supported. + */ +static long NBPGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid) +{ + return -1; +} + +//========================================================================== + +static void NBPGetDescription(CICell ih, char * str, long strMaxLen) +{ + sprintf( str, "Ethernet PXE Client" ); +} + +//========================================================================== + +BVRef nbpScanBootVolumes( int biosdev, int * countPtr ) +{ + static BVRef gNetBVR = NULL; + + if ( countPtr ) *countPtr = 1; + + if ( !gNetBVR ) + { + gNetBVR = malloc( sizeof(*gNetBVR) ); + if ( gNetBVR ) + { + bzero(gNetBVR, sizeof(*gNetBVR)); + gNetBVR->biosdev = biosdev; + gNetBVR->flags = kBVFlagPrimary | kBVFlagNativeBoot; + gNetBVR->description = NBPGetDescription; + gNetBVR->fs_loadfile = NBPLoadFile; + gNetBVR->fs_getdirentry = NBPGetDirEntry; + } + } + return gNetBVR; +} +#else +BVRef nbpScanBootVolumes( int biosdev, int * countPtr ) +{ + return NULL; +} +UInt32 nbpUnloadBaseCode() +{ + return 0; +} +#endif diff --git a/i386/libsaio/nbp_cmd.h b/i386/libsaio/nbp_cmd.h new file mode 100644 index 0000000..1b3585d --- /dev/null +++ b/i386/libsaio/nbp_cmd.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_NBP_CMD_H +#define __LIBSAIO_NBP_CMD_H + +#include <IOKit/IOTypes.h> + +/*========================================================================== + * NBP return status codes. + */ +typedef enum { + nbpStatusSuccess = 0, + nbpStatusFailed, + nbpStatusInvalid, +} nbpStatus_t; + +/*========================================================================== + * NBP commands codes. + */ +typedef enum { + nbpCommandTFTPReadFile = 1, + nbpCommandTFTPGetFileSize, + nbpCommandUnloadBaseCode, +} nbpCommandCode_t; + +/*========================================================================== + * NBP commands. + */ +typedef struct { + UInt32 status; /* return code from NBP */ +} nbpCommandHeader_s; + +typedef struct { + UInt32 status; /* return code from NBP */ + UInt8 filename[128]; /* name of file to be downloaded */ + UInt32 bufferSize; /* size of the download buffer */ + UInt32 buffer; /* physical address of the download buffer */ +} nbpCommandTFTPReadFile_s; + +typedef struct { + UInt32 status; /* return code from NBP */ + UInt8 filename[128]; /* name of file to be downloaded */ + UInt32 filesize; /* size of the file specified */ +} nbpCommandTFTPGetFileSize_s; + +typedef struct { + UInt32 status; /* return code from NBP */ + UInt8 sname[64]; /* server name */ + UInt32 CIP; /* client IP address */ + UInt32 SIP; /* server IP address */ + UInt32 GIP; /* gateway IP address */ +} nbpCommandGetNetworkInfo_s; + +/*========================================================================== + * An union of all NBP command structures. + */ +typedef union { + nbpCommandHeader_s header; + nbpCommandTFTPReadFile_s tftpReadFile; + nbpCommandTFTPGetFileSize_s tftpFileSize; +} nbpCommand_u; + +#endif /* !__LIBSAIO_NBP_CMD_H */ diff --git a/i386/libsaio/ntfs.c b/i386/libsaio/ntfs.c new file mode 100644 index 0000000..05fda3f --- /dev/null +++ b/i386/libsaio/ntfs.c @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2004 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "libsaio.h" +#include "sl.h" + +/* + * dmazar, 14/7/2011 - support for EXFAT volume label reading + */ +#include "exfat.h" + +#define BYTE_ORDER_MARK 0xFEFF + +#include "ntfs_private.h" + +#define FS_TYPE "ntfs" +#define FS_NAME_FILE "NTFS" + +#define MAX_BLOCK_SIZE 2048 +#define MAX_CLUSTER_SIZE 32768 + +#define LABEL_LENGTH 1024 +#define UNKNOWN_LABEL "Untitled NTFS" + +#define FSUR_IO_FAIL -1 +#define FSUR_UNRECOGNIZED -1 +#define FSUR_RECOGNIZED 0 + +#define ERROR -1 + +/* + * Process per-sector "fixups" that NTFS uses to detect corruption of + * multi-sector data structures, like MFT records. + */ +static int +ntfs_fixup( + char *buf, + size_t len, + u_int32_t magic, + u_int32_t bytesPerSector) +{ + struct fixuphdr *fhp = (struct fixuphdr *) buf; + int i; + u_int16_t fixup; + u_int16_t *fxp; + u_int16_t *cfxp; + u_int32_t fixup_magic; + u_int16_t fixup_count; + u_int16_t fixup_offset; + + fixup_magic = OSReadLittleInt32(&fhp->fh_magic,0); + if (fixup_magic != magic) { + error("ntfs_fixup: magic doesn't match: %08x != %08x\n", + fixup_magic, magic); + return (ERROR); + } + fixup_count = OSReadLittleInt16(&fhp->fh_fnum,0); + if ((fixup_count - 1) * bytesPerSector != len) { + error("ntfs_fixup: " \ + "bad fixups number: %d for %ld bytes block\n", + fixup_count, (long)len); /* XXX printf kludge */ + return (ERROR); + } + fixup_offset = OSReadLittleInt16(&fhp->fh_foff,0); + if (fixup_offset >= len) { + error("ntfs_fixup: invalid offset: %x", fixup_offset); + return (ERROR); + } + fxp = (u_int16_t *) (buf + fixup_offset); + cfxp = (u_int16_t *) (buf + bytesPerSector - 2); + fixup = *fxp++; + for (i = 1; i < fixup_count; i++, fxp++) { + if (*cfxp != fixup) { + error("ntfs_fixup: fixup %d doesn't match\n", i); + return (ERROR); + } + *cfxp = *fxp; + cfxp = (u_int16_t *)(((caddr_t)cfxp) + bytesPerSector); + } + return (0); +} + +/* + * Find a resident attribute of a given type. Returns a pointer to the + * attribute data, and its size in bytes. + */ +static int +ntfs_find_attr( + char *buf, + u_int32_t attrType, + void **attrData, + size_t *attrSize) +{ + struct filerec *filerec; + struct attr *attr; + u_int16_t offset; + + filerec = (struct filerec *) buf; + offset = OSReadLittleInt16(&filerec->fr_attroff,0); + attr = (struct attr *) (buf + offset); + + /* Should we also check offset < buffer size? */ + while (attr->a_hdr.a_type != 0xFFFFFFFF) /* same for big/little endian */ + { + if (OSReadLittleInt32(&attr->a_hdr.a_type,0) == attrType) + { + if (attr->a_hdr.a_flag != 0) + { + //verbose("NTFS: attriubte 0x%X is non-resident\n", attrType); + return 1; + } + + *attrSize = OSReadLittleInt16(&attr->a_r.a_datalen,0); + *attrData = buf + offset + OSReadLittleInt16(&attr->a_r.a_dataoff,0); + return 0; /* found it! */ + } + + /* Skip to the next attribute */ + offset += OSReadLittleInt32(&attr->a_hdr.reclen,0); + attr = (struct attr *) (buf + offset); + } + + return 1; /* No matching attrType found */ +} + +/* + * Examine a volume to see if we recognize it as a mountable. + */ +void +NTFSGetDescription(CICell ih, char *str, long strMaxLen) +{ + struct bootfile *boot; + unsigned bytesPerSector; + unsigned sectorsPerCluster; + int mftRecordSize; + u_int64_t totalClusters; + u_int64_t cluster, mftCluster; + size_t mftOffset; + void *nameAttr; + size_t nameSize; + char *buf; + + buf = (char *)malloc(MAX_CLUSTER_SIZE); + if (buf == 0) { + goto error; + } + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + boot = (struct bootfile *) buf; + + /* + * The first three bytes are an Intel x86 jump instruction. I assume it + * can be the same forms as DOS FAT: + * 0xE9 0x?? 0x?? + * 0xEC 0x?? 0x90 + * where 0x?? means any byte value is OK. + */ + if (boot->reserved1[0] != 0xE9 + && (boot->reserved1[0] != 0xEB || boot->reserved1[2] != 0x90)) + { + goto error; + } + + /* + * Check the "NTFS " signature. + */ + if (memcmp((const char *)boot->bf_sysid, "NTFS ", 8) != 0) + { + /* + * Check for EXFAT. Finish by jumping to error to free buf, + * although if it is EXFAT then it's no an error. + */ + EXFATGetDescription(ih, str, strMaxLen); + goto error; + } + + /* + * Make sure the bytes per sector and sectors per cluster are + * powers of two, and within reasonable ranges. + */ + bytesPerSector = OSReadLittleInt16(&boot->bf_bps,0); + if ((bytesPerSector & (bytesPerSector-1)) || bytesPerSector < 512 || bytesPerSector > 32768) + { + //verbose("NTFS: invalid bytes per sector (%d)\n", bytesPerSector); + goto error; + } + + sectorsPerCluster = boot->bf_spc; /* Just one byte; no swapping needed */ + if ((sectorsPerCluster & (sectorsPerCluster-1)) || sectorsPerCluster > 128) + { + //verbose("NTFS: invalid sectors per cluster (%d)\n", bytesPerSector); + goto error; + } + + /* + * Calculate the number of clusters from the number of sectors. + * Then bounds check the $MFT and $MFTMirr clusters. + */ + totalClusters = OSReadLittleInt64(&boot->bf_spv,0) / sectorsPerCluster; + mftCluster = OSReadLittleInt64(&boot->bf_mftcn,0); + if (mftCluster > totalClusters) + { + ////verbose("NTFS: invalid $MFT cluster (%lld)\n", mftCluster); + goto error; + } + cluster = OSReadLittleInt64(&boot->bf_mftmirrcn,0); + if (cluster > totalClusters) + { + //verbose("NTFS: invalid $MFTMirr cluster (%lld)\n", cluster); + goto error; + } + + /* + * Determine the size of an MFT record. + */ + mftRecordSize = (int8_t) boot->bf_mftrecsz; + if (mftRecordSize < 0) + mftRecordSize = 1 << -mftRecordSize; + else + mftRecordSize *= bytesPerSector * sectorsPerCluster; + //verbose("NTFS: MFT record size = %d\n", mftRecordSize); + + /* + * Read the MFT record for $Volume. This assumes the first four + * file records in the MFT are contiguous; if they aren't, we + * would have to map the $MFT itself. + * + * This will fail if the device sector size is larger than the + * MFT record size, since the $Volume record won't be aligned + * on a sector boundary. + */ + mftOffset = mftCluster * sectorsPerCluster * bytesPerSector; + mftOffset += mftRecordSize * NTFS_VOLUMEINO; + + Seek(ih, mftOffset); + Read(ih, (long)buf, mftRecordSize); +#if UNUSED + if (lseek(fd, mftOffset, SEEK_SET) == -1) + { + //verbose("NTFS: lseek to $Volume failed: %s\n", strerror(errno)); + goto error; + } + if (read(fd, buf, mftRecordSize) != mftRecordSize) + { + //verbose("NTFS: error reading MFT $Volume record: %s\n", + strerror(errno)); + goto error; + } +#endif + + if (ntfs_fixup(buf, mftRecordSize, NTFS_FILEMAGIC, bytesPerSector) != 0) + { + //verbose("NTFS: block fixup failed\n"); + goto error; + } + + /* + * Loop over the attributes, looking for $VOLUME_NAME (0x60). + */ + if(ntfs_find_attr(buf, NTFS_A_VOLUMENAME, &nameAttr, &nameSize) != 0) + { + //verbose("NTFS: $VOLUME_NAME attribute not found\n"); + goto error; + } + + str[0] = '\0'; + + utf_encodestr( nameAttr, nameSize / 2, (u_int8_t *)str, strMaxLen, OSLittleEndian ); + + free(buf); + return; + + error: + if (buf) free(buf); + return; +} + +long NTFSGetUUID(CICell ih, char *uuidStr) +{ + bool NTFSProbe(const void*); + + struct bootfile *boot; + void *buf = malloc(MAX_BLOCK_SIZE); + if ( !buf ) + return -1; + + /* + * Read the boot sector, check signatures, and do some minimal + * sanity checking. NOTE: the size of the read below is intended + * to be a multiple of all supported block sizes, so we don't + * have to determine or change the device's block size. + */ + Seek(ih, 0); + Read(ih, (long)buf, MAX_BLOCK_SIZE); + + boot = (struct bootfile *) buf; + + // Check for NTFS signature + if ( memcmp((void*)boot->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) != 0 ) { + // If not NTFS, maybe it is EXFAT + return EXFATGetUUID(ih, uuidStr); + } + + // Check for non-null volume serial number + if( !boot->bf_volsn ) + return -1; + + // Use UUID like the one you get on Windows + sprintf(uuidStr, "%04X-%04X", (unsigned short)(boot->bf_volsn >> 16) & 0xFFFF, + (unsigned short)boot->bf_volsn & 0xFFFF); + + return 0; +} + +bool NTFSProbe(const void * buffer) +{ + bool result = false; + + const struct bootfile * part_bootfile = buffer; // NTFS boot sector structure + + // Looking for NTFS signature. + if (strncmp((const char *)part_bootfile->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) == 0) + result = true; + + // If not NTFS, maybe it is EXFAT + if (!result) + result = EXFATProbe(buffer); + + return result; +} diff --git a/i386/libsaio/ntfs.h b/i386/libsaio/ntfs.h new file mode 100644 index 0000000..dac62ba --- /dev/null +++ b/i386/libsaio/ntfs.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern void NTFSGetDescription(CICell ih, char *str, long strMaxLen); +extern bool NTFSProbe (const void *buf); +extern long NTFSGetUUID(CICell ih, char *uuidStr); diff --git a/i386/libsaio/ntfs_private.h b/i386/libsaio/ntfs_private.h new file mode 100644 index 0000000..127136f --- /dev/null +++ b/i386/libsaio/ntfs_private.h @@ -0,0 +1,399 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* $NetBSD: ntfs.h,v 1.9 1999/10/31 19:45:26 jdolecek Exp $ */ + +/*- + * Copyright (c) 1998, 1999 Semen Ustimenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/fs/ntfs/ntfs.h,v 1.14 2001/11/27 00:18:33 jhb Exp $ + */ + +/*#define NTFS_DEBUG 1*/ + +#ifdef APPLE +/* We're using FreeBSD style byte order macros in the source. */ +#include <libkern/OSByteOrder.h> +#define le16toh(x) OSSwapLittleToHostInt16(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) + +/* FreeBSD mutexes correspond to Darwin's simple locks */ +#define mtx_lock(lock) simple_lock(lock) +#define mtx_unlock(lock) simple_unlock(lock) +#define mtx_destroy(lock) /* Nothing. */ + +#define lockdestroy(lock) /* Nothing. */ + +#endif + +typedef u_int64_t cn_t; +typedef u_int16_t wchar; + +#pragma pack(1) +#define BBSIZE 1024 +#define BBOFF ((off_t)(0)) +#define BBLOCK ((daddr_t)(0)) +#define NTFS_MFTINO 0 +#define NTFS_VOLUMEINO 3 +#define NTFS_ATTRDEFINO 4 +#define NTFS_ROOTINO 5 +#define NTFS_BITMAPINO 6 +#define NTFS_BOOTINO 7 +#define NTFS_BADCLUSINO 8 +#define NTFS_UPCASEINO 10 +#define NTFS_MAXFILENAME 255 + +struct fixuphdr { + u_int32_t fh_magic; + u_int16_t fh_foff; + u_int16_t fh_fnum; +}; + +#define NTFS_AF_INRUN 0x00000001 +struct attrhdr { + u_int32_t a_type; + u_int32_t reclen; + u_int8_t a_flag; + u_int8_t a_namelen; + u_int8_t a_nameoff; + u_int8_t reserved1; + u_int8_t a_compression; + u_int8_t reserved2; + u_int16_t a_index; +}; +#define NTFS_A_STD 0x10 +#define NTFS_A_ATTRLIST 0x20 +#define NTFS_A_NAME 0x30 +#define NTFS_A_VOLUMENAME 0x60 +#define NTFS_A_DATA 0x80 +#define NTFS_A_INDXROOT 0x90 +#define NTFS_A_INDX 0xA0 +#define NTFS_A_INDXBITMAP 0xB0 + +#define NTFS_MAXATTRNAME 255 +struct attr { + struct attrhdr a_hdr; + union { + struct { + u_int16_t a_datalen; + u_int16_t reserved1; + u_int16_t a_dataoff; + u_int16_t a_indexed; + } a_S_r; + struct { + cn_t a_vcnstart; + cn_t a_vcnend; + u_int16_t a_dataoff; + u_int16_t a_compressalg; + u_int32_t reserved1; + u_int64_t a_allocated; + u_int64_t a_datalen; + u_int64_t a_initialized; + } a_S_nr; + } a_S; +}; +#define a_r a_S.a_S_r +#define a_nr a_S.a_S_nr + +typedef struct { + u_int64_t t_create; + u_int64_t t_write; + u_int64_t t_mftwrite; + u_int64_t t_access; +} ntfs_times_t; + +#define NTFS_FFLAG_RDONLY 0x01LL +#define NTFS_FFLAG_HIDDEN 0x02LL +#define NTFS_FFLAG_SYSTEM 0x04LL +#define NTFS_FFLAG_ARCHIVE 0x20LL +#define NTFS_FFLAG_COMPRESSED 0x0800LL +#define NTFS_FFLAG_DIR 0x10000000LL + +struct attr_name { + u_int32_t n_pnumber; /* Parent ntnode */ + u_int32_t reserved; + ntfs_times_t n_times; + u_int64_t n_size; + u_int64_t n_attrsz; + u_int64_t n_flag; + u_int8_t n_namelen; + u_int8_t n_nametype; + u_int16_t n_name[1]; +}; + +#define NTFS_IRFLAG_INDXALLOC 0x00000001 +struct attr_indexroot { + u_int32_t ir_unkn1; /* attribute type (0x30 for $FILE_NAME) */ + u_int32_t ir_unkn2; /* collation rule (0x01 for file names) */ + u_int32_t ir_size; /* size of index allocation entry */ + u_int32_t ir_unkn3; /* clusters per index record, and 3 bytes padding */ + u_int32_t ir_unkn4; /* (offset to first index entry?) always 0x10 */ + u_int32_t ir_datalen; /* (total size of index enties?) sizeof something */ + u_int32_t ir_allocated; /* (allocated size of index entries?) */ + u_int8_t ir_flag; /* 1=index allocation needed (large index) */ + u_int8_t ir_pad1; /* padding */ + u_int16_t ir_pad2; /* padding */ +}; + +struct attr_attrlist { + u_int32_t al_type; /* Attribute type */ + u_int16_t reclen; /* length of this entry */ + u_int8_t al_namelen; /* Attribute name len */ + u_int8_t al_nameoff; /* Name offset from entry start */ + u_int64_t al_vcnstart; /* VCN number */ + u_int32_t al_inumber; /* Parent ntnode */ + u_int32_t reserved; + u_int16_t al_index; /* Attribute index in MFT record */ + u_int16_t al_name[1]; /* Name */ +}; + +#define NTFS_INDXMAGIC (u_int32_t)(0x58444E49) +struct attr_indexalloc { + struct fixuphdr ia_fixup; + u_int64_t unknown1; + cn_t ia_bufcn; + u_int16_t ia_hdrsize; + u_int16_t unknown2; + u_int32_t ia_inuse; + u_int32_t ia_allocated; +}; + +#define NTFS_IEFLAG_SUBNODE 0x00000001 +#define NTFS_IEFLAG_LAST 0x00000002 + +struct attr_indexentry { + u_int32_t ie_number; + u_int32_t unknown1; + u_int16_t reclen; + u_int16_t ie_size; + u_int32_t ie_flag;/* 1 - has subnodes, 2 - last */ + u_int32_t ie_fpnumber; + u_int32_t unknown2; + ntfs_times_t ie_ftimes; + u_int64_t ie_fallocated; + u_int64_t ie_fsize; + u_int32_t ie_fflag; + u_int32_t unknown3; /* used by reparse points and external attributes? */ + u_int8_t ie_fnamelen; + u_int8_t ie_fnametype; + wchar ie_fname[NTFS_MAXFILENAME]; + /* cn_t ie_bufcn; buffer with subnodes */ +}; + +#define NTFS_FILEMAGIC (u_int32_t)(0x454C4946) +#define NTFS_FRFLAG_DIR 0x0002 +struct filerec { + struct fixuphdr fr_fixup; + u_int8_t reserved[8]; + u_int16_t fr_seqnum; /* Sequence number */ + u_int16_t fr_nlink; + u_int16_t fr_attroff; /* offset to attributes */ + u_int16_t fr_flags; /* 1-nonresident attr, 2-directory */ + u_int32_t fr_size;/* hdr + attributes */ + u_int32_t fr_allocated; /* allocated length of record */ + u_int64_t fr_mainrec; /* main record */ + u_int16_t fr_attrnum; /* maximum attr number + 1 ??? */ +}; + +#define NTFS_ATTRNAME_MAXLEN 0x40 +#define NTFS_ADFLAG_NONRES 0x0080 /* Attrib can be non resident */ +#define NTFS_ADFLAG_INDEX 0x0002 /* Attrib can be indexed */ +struct attrdef { + wchar ad_name[NTFS_ATTRNAME_MAXLEN]; + u_int32_t ad_type; + u_int32_t reserved1[2]; + u_int32_t ad_flag; + u_int64_t ad_minlen; + u_int64_t ad_maxlen; /* -1 for nonlimited */ +}; + +struct ntvattrdef { + char ad_name[0x40]; + int ad_namelen; + u_int32_t ad_type; +}; + +#define NTFS_BBID "NTFS " +#define NTFS_BBIDLEN 8 +struct bootfile { + u_int8_t reserved1[3]; /* asm jmp near ... */ + u_int8_t bf_sysid[8]; /* 'NTFS ' */ + u_int16_t bf_bps; /* bytes per sector */ + u_int8_t bf_spc; /* sectors per cluster */ + u_int8_t reserved2[7]; /* unused (zeroed) */ + u_int8_t bf_media; /* media desc. (0xF8) */ + u_int8_t reserved3[2]; + u_int16_t bf_spt; /* sectors per track */ + u_int16_t bf_heads; /* number of heads */ + u_int8_t reserver4[12]; + u_int64_t bf_spv; /* sectors per volume */ + cn_t bf_mftcn; /* $MFT cluster number */ + cn_t bf_mftmirrcn; /* $MFTMirr cn */ + u_int8_t bf_mftrecsz; /* MFT record size (clust) */ + /* 0xF6 inducates 1/4 */ + u_int8_t reserved5[3]; + u_int8_t bf_ibsz; /* index buffer size */ + u_int8_t reserved6[3]; + u_int64_t bf_volsn; /* volume ser. num. */ +}; + +/* + * Darwin's ntfs.util needs to include this file to get definitions + * for the on-disk structures. It doesn't need the ntfsmount structure. + * In fact, since it doesn't #define KERNEL, the struct netexport below + * won't be defined. + * + * So, I'm using #ifdef KERNEL around the things that are only relevant + * to the in-kernel implementation. + * + * I don't know if FreeBSD defines KERNEL, or if I need to use or + * invent a different conditional here. + */ +#ifdef KERNEL + +#define NTFS_SYSNODESNUM 0x0B +struct ntfsmount { + struct mount *ntm_mountp; /* filesystem vfs structure */ + struct bootfile ntm_bootfile; + dev_t ntm_dev; /* device mounted */ + struct vnode *ntm_devvp; /* block device mounted vnode */ + struct vnode *ntm_sysvn[NTFS_SYSNODESNUM]; + u_int32_t ntm_bpmftrec; + uid_t ntm_uid; + gid_t ntm_gid; + mode_t ntm_mode; + u_long ntm_flag; + cn_t ntm_cfree; + struct ntvattrdef *ntm_ad; /* attribute names are stored in native byte order */ + int ntm_adnum; + wchar * ntm_82u; /* 8bit to Unicode */ + char ** ntm_u28; /* Unicode to 8 bit */ +#ifdef APPLE + struct netexport ntm_export; /* NFS export information */ +#endif +}; + +#define ntm_mftcn ntm_bootfile.bf_mftcn +#define ntm_mftmirrcn ntm_bootfile.bf_mftmirrcn +#define ntm_mftrecsz ntm_bootfile.bf_mftrecsz +#define ntm_spc ntm_bootfile.bf_spc +#define ntm_bps ntm_bootfile.bf_bps + +#pragma pack() + +#define NTFS_NEXTREC(s, type) ((type)(((caddr_t) s) + le16toh((s)->reclen))) + +/* Convert mount ptr to ntfsmount ptr. */ +#define VFSTONTFS(mp) ((struct ntfsmount *)((mp)->mnt_data)) +#define VTONT(v) FTONT(VTOF(v)) +#define VTOF(v) ((struct fnode *)((v)->v_data)) +#define FTOV(f) ((f)->f_vp) +#define FTONT(f) ((f)->f_ip) +#define ntfs_cntobn(cn) ((daddr_t)(cn) * (ntmp->ntm_spc)) +#define ntfs_cntob(cn) ((off_t)(cn) * (ntmp)->ntm_spc * (ntmp)->ntm_bps) +#define ntfs_btocn(off) (cn_t)((off) / ((ntmp)->ntm_spc * (ntmp)->ntm_bps)) +#define ntfs_btocl(off) (cn_t)((off + ntfs_cntob(1) - 1) / ((ntmp)->ntm_spc * (ntmp)->ntm_bps)) +#define ntfs_btocnoff(off) (off_t)((off) % ((ntmp)->ntm_spc * (ntmp)->ntm_bps)) +#define ntfs_bntob(bn) (daddr_t)((bn) * (ntmp)->ntm_bps) + +#define ntfs_bpbl (daddr_t)((ntmp)->ntm_bps) + +#ifdef MALLOC_DECLARE +MALLOC_DECLARE(M_NTFSMNT); +MALLOC_DECLARE(M_NTFSNTNODE); +MALLOC_DECLARE(M_NTFSFNODE); +MALLOC_DECLARE(M_NTFSDIR); +MALLOC_DECLARE(M_NTFSNTHASH); +#endif + +#ifndef M_NTFSMNT +#define M_NTFSMNT M_TEMP +#endif +#ifndef M_NTFSNTNODE +#define M_NTFSNTNODE M_TEMP +#endif +#ifndef M_NTFSFNODE +#define M_NTFSFNODE M_TEMP +#endif +#ifndef M_NTFSDIR +#define M_NTFSDIR M_TEMP +#endif +#ifndef M_NTFSNTHASH +#define M_NTFSNTHASH M_TEMP +#endif +#ifndef M_NTFSRUN +#define M_NTFSRUN M_TEMP +#endif +#ifndef M_NTFSRDATA +#define M_NTFSRDATA M_TEMP +#endif +#ifndef M_NTFSNTVATTR +#define M_NTFSNTVATTR M_TEMP +#endif +#ifndef M_NTFSDECOMP +#define M_NTFSDECOMP M_TEMP +#endif +#define VT_NTFS VT_OTHER + +#if defined(NTFS_DEBUG) +#define dprintf(a) printf a +#if NTFS_DEBUG > 1 +#define ddprintf(a) printf a +#else +#define ddprintf(a) +#endif +#else +#define dprintf(a) +#define ddprintf(a) +#endif + +#ifdef APPLE +typedef int vop_t(void *); +#else +#endif +extern vop_t **ntfs_vnodeop_p; +#endif /* KERNEL */ diff --git a/i386/libsaio/nvidia.c b/i386/libsaio/nvidia.c new file mode 100644 index 0000000..ad3ce16 --- /dev/null +++ b/i386/libsaio/nvidia.c @@ -0,0 +1,2139 @@ +/* + * NVidia injector + * + * Copyright (C) 2009 Jasmin Fazlic, iNDi + * + * NVidia injector modified by Fabio (ErmaC) on May 2012, + * for allow the cosmetics injection also based on SubVendorID and SubDeviceID. + * + * NVidia injector is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * NVidia driver and injector is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NVidia injector. If not, see <http://www.gnu.org/licenses/>. + * + * Alternatively you can choose to comply with APSL + * + * DCB-Table parsing is based on software (nouveau driver) originally distributed under following license: + * + * + * Copyright 2005-2006 Erik Waling + * Copyright 2006 Stephane Marchesin + * Copyright 2007-2009 Stuart Bennett + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "device_inject.h" +#include "nvidia.h" +#include "nvidia_helper.h" + +#ifndef DEBUG_NVIDIA +#define DEBUG_NVIDIA 0 +#endif + +#if DEBUG_NVIDIA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +#define NVIDIA_ROM_SIZE 0x20000 +#define PATCH_ROM_SUCCESS 1 +#define PATCH_ROM_SUCCESS_HAS_LVDS 2 +#define PATCH_ROM_FAILED 0 +#define MAX_NUM_DCB_ENTRIES 16 +#define TYPE_GROUPED 0xff +#define READ_BYTE(rom, offset) (*(u_char *)(rom + offset)) +#define READ_LE_SHORT(rom, offset) (READ_BYTE(rom, offset+1) << 8 | READ_BYTE(rom, offset)) +#define READ_LE_INT(rom, offset) (READ_LE_SHORT(rom, offset+2) << 16 | READ_LE_SHORT(rom, offset)) +#define WRITE_LE_SHORT(data) (((data) << 8 & 0xff00) | ((data) >> 8 & 0x00ff )) +#define WRITE_LE_INT(data) (WRITE_LE_SHORT(data) << 16 | WRITE_LE_SHORT(data >> 16)) + +extern uint32_t devices_number; + +const char *nvidia_compatible_0[] = { "@0,compatible", "NVDA,NVMac" }; +const char *nvidia_compatible_1[] = { "@1,compatible", "NVDA,NVMac" }; +const char *nvidia_device_type_0[] = { "@0,device_type", "display" }; +const char *nvidia_device_type_1[] = { "@1,device_type", "display" }; +const char *nvidia_device_type[] = { "device_type", "NVDA,Parent" }; +const char *nvidia_device_type_child[] = { "device_type", "NVDA,Child" }; +const char *nvidia_name_0[] = { "@0,name", "NVDA,Display-A" }; +const char *nvidia_name_1[] = { "@1,name", "NVDA,Display-B" }; +const char *nvidia_slot_name[] = { "AAPL,slot-name", "Slot-1" }; + +static uint8_t default_NVCAP[]= { + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x00, 0x00, 0x00, 0x00 +}; + +#define NVCAP_LEN ( sizeof(default_NVCAP) / sizeof(uint8_t) ) + +static uint8_t default_dcfg_0[] = {0x03, 0x01, 0x03, 0x00}; +static uint8_t default_dcfg_1[] = {0xff, 0xff, 0x00, 0x01}; + +#define DCFG0_LEN ( sizeof(default_dcfg_0) / sizeof(uint8_t) ) +#define DCFG1_LEN ( sizeof(default_dcfg_1) / sizeof(uint8_t) ) + +static uint8_t default_NVPM[]= { + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 +}; + +#define NVPM_LEN ( sizeof(default_NVPM) / sizeof(uint8_t) ) + +/*static nvidia_pci_info_t nvidia_card_vendors[] = { + { 0x10190000, "Elitegroup" }, + { 0x10250000, "Acer" }, + { 0x10280000, "Dell" }, + { 0x10330000, "NEC" }, + { 0x103C0000, "HP" }, + { 0x10430000, "Asus" }, + { 0x104D0000, "Sony" }, + { 0x105B0000, "Foxconn" }, + { 0x106B0000, "Apple" }, + { 0x10710000, "Mitac" }, + { 0x107B0000, "Gateway" }, + { 0x107D0000, "Leadtek" }, + { 0x109F0000, "Trigem" }, + { 0x10B00000, "Gainward" }, + { 0x10CF0000, "Fujitsu" }, + { 0x10DE0000, "nVidia" }, + { 0x11790000, "Toshiba" }, + { 0x12970000, "Shuttle" }, + { 0x13DC0000, "Netbost" }, + { 0x144D0000, "Samsung" }, + { 0x14580000, "Gigabyte" }, + { 0x14620000, "MSi" }, + { 0x14C00000, "Compal" }, + { 0x152D0000, "Quanta" }, + { 0x15540000, "Prolink" }, + { 0x15580000, "Clevo" }, + { 0x15690000, "Palit" }, + { 0x161F0000, "Arima" }, + { 0x16310000, "NEC" }, + { 0x16420000, "Bitland" }, + { 0x16820000, "XFX" }, + { 0x17340000, "Fujitsu" }, + { 0x174B0000, "PC Partner" }, + { 0x17AA0000, "Lenovo" }, + { 0x17C00000, "Wistron" }, + { 0x17FF0000, "Benq" }, + { 0x18490000, "ASRock" }, + { 0x18540000, "LG" }, + { 0x18640000, "LG" }, + { 0x18940000, "LG" }, + { 0x19610000, "ESS" }, + { 0x196E0000, "PNY" }, + { 0x19910000, "Topstar" }, + { 0x19DA0000, "Zotac" }, + { 0x19F10000, "BFG" }, + { 0x1ACC0000, "Point of View" }, + { 0x1B0A0000, "Pegatron" }, + { 0x1B130000, "Jaton" }, + { 0x34420000, "Bihl" }, + { 0x38420000, "EVGA" }, + { 0x73770000, "Colorful" }, +}; */ + +static nvidia_pci_info_t nvidia_card_generic[] = { + // 0000 - 0040 + { 0x10DE0000, "Unknown" }, + // 0040 - 004F + { 0x10DE0040, "GeForce 6800 Ultra" }, + { 0x10DE0041, "GeForce 6800" }, + { 0x10DE0042, "GeForce 6800 LE" }, + { 0x10DE0043, "GeForce 6800 XE" }, + { 0x10DE0044, "GeForce 6800 XT" }, + { 0x10DE0045, "GeForce 6800 GT" }, + { 0x10DE0046, "GeForce 6800 GT" }, + { 0x10DE0047, "GeForce 6800 GS" }, + { 0x10DE0048, "GeForce 6800 XT" }, + { 0x10DE004D, "Quadro FX 3400" }, + { 0x10DE004E, "Quadro FX 4000" }, + // 0050 - 005F + // 0060 - 006F + // 0070 - 007F + // 0080 - 008F + // 0090 - 009F + { 0x10DE0090, "GeForce 7800 GTX" }, + { 0x10DE0091, "GeForce 7800 GTX" }, + { 0x10DE0092, "GeForce 7800 GT" }, + { 0x10DE0093, "GeForce 7800 GS" }, + { 0x10DE0095, "GeForce 7800 SLI" }, + { 0x10DE0098, "GeForce Go 7800" }, + { 0x10DE0099, "GeForce Go 7800 GTX" }, + { 0x10DE009D, "Quadro FX 4500" }, + // 00A0 - 00AF + // 00B0 - 00BF + // 00C0 - 00CF + { 0x10DE00C0, "GeForce 6800 GS" }, + { 0x10DE00C1, "GeForce 6800" }, + { 0x10DE00C2, "GeForce 6800 LE" }, + { 0x10DE00C3, "GeForce 6800 XT" }, + { 0x10DE00C8, "GeForce Go 6800" }, + { 0x10DE00C9, "GeForce Go 6800 Ultra" }, + { 0x10DE00CC, "Quadro FX Go1400" }, + { 0x10DE00CD, "Quadro FX 3450/4000 SDI" }, + { 0x10DE00CE, "Quadro FX 1400" }, + // 00D0 - 00DF + // 00E0 - 00EF + // 00F0 - 00FF + { 0x10DE00F1, "GeForce 6600 GT" }, + { 0x10DE00F2, "GeForce 6600" }, + { 0x10DE00F3, "GeForce 6200" }, + { 0x10DE00F4, "GeForce 6600 LE" }, + { 0x10DE00F5, "GeForce 7800 GS" }, + { 0x10DE00F6, "GeForce 6800 GS/XT" }, + { 0x10DE00F8, "Quadro FX 3400/4400" }, + { 0x10DE00F9, "GeForce 6800 Series GPU" }, + // 0100 - 010F + // 0110 - 011F + // 0120 - 012F + // 0130 - 013F + // 0140 - 014F + { 0x10DE0140, "GeForce 6600 GT" }, + { 0x10DE0141, "GeForce 6600" }, + { 0x10DE0142, "GeForce 6600 LE" }, + { 0x10DE0143, "GeForce 6600 VE" }, + { 0x10DE0144, "GeForce Go 6600" }, + { 0x10DE0145, "GeForce 6610 XL" }, + { 0x10DE0146, "GeForce Go 6600 TE/6200 TE" }, + { 0x10DE0147, "GeForce 6700 XL" }, + { 0x10DE0148, "GeForce Go 6600" }, + { 0x10DE0149, "GeForce Go 6600 GT" }, + { 0x10DE014A, "Quadro NVS 440" }, + { 0x10DE014C, "Quadro FX 550" }, + { 0x10DE014D, "Quadro FX 550" }, + { 0x10DE014E, "Quadro FX 540" }, + { 0x10DE014F, "GeForce 6200" }, + // 0150 - 015F + // 0160 - 016F + { 0x10DE0160, "GeForce 6500" }, + { 0x10DE0161, "GeForce 6200 TurboCache(TM)" }, + { 0x10DE0162, "GeForce 6200SE TurboCache(TM)" }, + { 0x10DE0163, "GeForce 6200 LE" }, + { 0x10DE0164, "GeForce Go 6200" }, + { 0x10DE0165, "Quadro NVS 285" }, + { 0x10DE0166, "GeForce Go 6400" }, + { 0x10DE0167, "GeForce Go 6200" }, + { 0x10DE0168, "GeForce Go 6400" }, + { 0x10DE0169, "GeForce 6250" }, + { 0x10DE016A, "GeForce 7100 GS" }, + { 0x10DE016C, "NVIDIA NV44GLM" }, + { 0x10DE016D, "NVIDIA NV44GLM" }, + // 0170 - 017F + // 0180 - 018F + // 0190 - 019F + { 0x10DE0191, "GeForce 8800 GTX" }, + { 0x10DE0193, "GeForce 8800 GTS" }, + { 0x10DE0194, "GeForce 8800 Ultra" }, + { 0x10DE0197, "Tesla C870" }, + { 0x10DE019D, "Quadro FX 5600" }, + { 0x10DE019E, "Quadro FX 4600" }, + // 01A0 - 01AF + // 01B0 - 01BF + // 01C0 - 01CF + // 01D0 - 01DF + { 0x10DE01D0, "GeForce 7350 LE" }, + { 0x10DE01D1, "GeForce 7300 LE" }, + { 0x10DE01D2, "GeForce 7550 LE" }, + { 0x10DE01D3, "GeForce 7300 SE/7200 GS" }, + { 0x10DE01D6, "GeForce Go 7200" }, + { 0x10DE01D7, "GeForce Go 7300" }, + { 0x10DE01D8, "GeForce Go 7400" }, + { 0x10DE01D9, "GeForce Go 7450" }, + { 0x10DE01DA, "Quadro NVS 110M" }, + { 0x10DE01DB, "Quadro NVS 120M" }, + { 0x10DE01DC, "Quadro FX 350M" }, + { 0x10DE01DD, "GeForce 7500 LE" }, + { 0x10DE01DE, "Quadro FX 350" }, + { 0x10DE01DF, "GeForce 7300 GS" }, + // 01E0 - 01EF + // 01F0 - 01FF + { 0x10DE01F0, "GeForce4 MX" }, + // 0200 - 020F + // 0210 - 021F + { 0x10DE0211, "GeForce 6800" }, + { 0x10DE0212, "GeForce 6800 LE" }, + { 0x10DE0215, "GeForce 6800 GT" }, + { 0x10DE0218, "GeForce 6800 XT" }, + // 0220 - 022F + { 0x10DE0221, "GeForce 6200" }, + { 0x10DE0222, "GeForce 6200 A-LE" }, + { 0x10DE0228, "NVIDIA NV44M" }, + // 0230 - 023F + // 0240 - 024F + { 0x10DE0240, "GeForce 6150" }, + { 0x10DE0241, "GeForce 6150 LE" }, + { 0x10DE0242, "GeForce 6100" }, + { 0x10DE0243, "NVIDIA C51" }, + { 0x10DE0244, "GeForce Go 6150" }, + { 0x10DE0245, "Quadro NVS 210S / GeForce 6150LE" }, + { 0x10DE0247, "GeForce Go 6100" }, + // 0250 - 025F + { 0x10DE025B, "Quadro4 700 XGL" }, + // 0260 - 026F + // 0270 - 027F + // 0280 - 028F + // 0290 - 029F + { 0x10DE0290, "GeForce 7900 GTX" }, + { 0x10DE0291, "GeForce 7900 GT/GTO" }, + { 0x10DE0292, "GeForce 7900 GS" }, + { 0x10DE0293, "GeForce 7950 GX2" }, + { 0x10DE0294, "GeForce 7950 GX2" }, + { 0x10DE0295, "GeForce 7950 GT" }, + { 0x10DE0298, "GeForce Go 7900 GS" }, + { 0x10DE0299, "GeForce Go 7900 GTX" }, + { 0x10DE029A, "Quadro FX 2500M" }, + { 0x10DE029B, "Quadro FX 1500M" }, + { 0x10DE029C, "Quadro FX 5500" }, + { 0x10DE029D, "Quadro FX 3500" }, + { 0x10DE029E, "Quadro FX 1500" }, + { 0x10DE029F, "Quadro FX 4500 X2" }, + // 02A0 - 02AF + // 02B0 - 02BF + // 02C0 - 02CF + // 02D0 - 02DF + // 02E0 - 02EF + { 0x10DE02E0, "GeForce 7600 GT" }, + { 0x10DE02E1, "GeForce 7600 GS" }, + { 0x10DE02E2, "GeForce 7300 GT" }, + { 0x10DE02E3, "GeForce 7900 GS" }, + { 0x10DE02E4, "GeForce 7950 GT" }, + // 02F0 - 02FF + // 0300 - 030F + { 0x10DE0301, "GeForce FX 5800 Ultra" }, + { 0x10DE0302, "GeForce FX 5800" }, + { 0x10DE0308, "Quadro FX 2000" }, + { 0x10DE0309, "Quadro FX 1000" }, + // 0310 - 031F + { 0x10DE0311, "GeForce FX 5600 Ultra" }, + { 0x10DE0312, "GeForce FX 5600" }, + { 0x10DE0314, "GeForce FX 5600XT" }, + { 0x10DE031A, "GeForce FX Go5600" }, + { 0x10DE031B, "GeForce FX Go5650" }, + { 0x10DE031C, "Quadro FX Go700" }, + // 0320 - 032F + { 0x10DE0320, "GeForce FX 5200" }, + { 0x10DE0321, "GeForce FX 5200 Ultra" }, + { 0x10DE0322, "GeForce FX 5200" }, + { 0x10DE0323, "GeForce FX 5200 LE" }, + { 0x10DE0324, "GeForce FX Go5200" }, + { 0x10DE0325, "GeForce FX Go5250" }, + { 0x10DE0326, "GeForce FX 5500" }, + { 0x10DE0328, "GeForce FX Go5200 32M/64M" }, + { 0x10DE0329, "GeForce FX Go5200" }, + { 0x10DE032A, "Quadro NVS 55/280 PCI" }, + { 0x10DE032B, "Quadro FX 500/600 PCI" }, + { 0x10DE032C, "GeForce FX Go53xx Series" }, + { 0x10DE032D, "GeForce FX Go5100" }, + { 0x10DE032F, "NV34GL" }, + // 0330 - 033F + { 0x10DE0330, "GeForce FX 5900 Ultra" }, + { 0x10DE0331, "GeForce FX 5900" }, + { 0x10DE0332, "GeForce FX 5900XT" }, + { 0x10DE0333, "GeForce FX 5950 Ultra" }, + { 0x10DE0334, "GeForce FX 5900ZT" }, + { 0x10DE0338, "Quadro FX 3000" }, + { 0x10DE033F, "Quadro FX 700" }, + // 0340 - 034F + { 0x10DE0341, "GeForce FX 5700 Ultra" }, + { 0x10DE0342, "GeForce FX 5700" }, + { 0x10DE0343, "GeForce FX 5700LE" }, + { 0x10DE0344, "GeForce FX 5700VE" }, + { 0x10DE0345, "NV36.5" }, + { 0x10DE0347, "GeForce FX Go5700" }, + { 0x10DE0348, "GeForce FX Go5700" }, + { 0x10DE0349, "NV36M Pro" }, + { 0x10DE034B, "NV36MAP" }, + { 0x10DE034C, "Quadro FX Go1000" }, + { 0x10DE034E, "Quadro FX 1100" }, + { 0x10DE034F, "NV36GL" }, + // 0350 - 035F + // 0360 - 036F + // 0370 - 037F + // 0380 - 038F + { 0x10DE038B, "GeForce 7650 GS" }, + // 0390 - 039F + { 0x10DE0390, "GeForce 7650 GS" }, + { 0x10DE0391, "GeForce 7600 GT" }, + { 0x10DE0392, "GeForce 7600 GS" }, + { 0x10DE0393, "GeForce 7300 GT" }, + { 0x10DE0394, "GeForce 7600 LE" }, + { 0x10DE0395, "GeForce 7300 GT" }, + { 0x10DE0397, "GeForce Go 7700" }, + { 0x10DE0398, "GeForce Go 7600" }, + { 0x10DE0399, "GeForce Go 7600 GT"}, + { 0x10DE039A, "Quadro NVS 300M" }, + { 0x10DE039B, "GeForce Go 7900 SE" }, + { 0x10DE039C, "Quadro FX 560M" }, + { 0x10DE039E, "Quadro FX 560" }, + // 03A0 - 03AF + // 03B0 - 03BF + // 03C0 - 03CF + // 03D0 - 03DF + { 0x10DE03D0, "GeForce 6150SE nForce 430" }, + { 0x10DE03D1, "GeForce 6100 nForce 405" }, + { 0x10DE03D2, "GeForce 6100 nForce 400" }, + { 0x10DE03D5, "GeForce 6100 nForce 420" }, + { 0x10DE03D6, "GeForce 7025 / nForce 630a" }, + // 03E0 - 03EF + // 03F0 - 03FF + // 0400 - 040F + { 0x10DE0400, "GeForce 8600 GTS" }, + { 0x10DE0401, "GeForce 8600 GT" }, + { 0x10DE0402, "GeForce 8600 GT" }, + { 0x10DE0403, "GeForce 8600 GS" }, + { 0x10DE0404, "GeForce 8400 GS" }, + { 0x10DE0405, "GeForce 9500M GS" }, + { 0x10DE0406, "GeForce 8300 GS" }, + { 0x10DE0407, "GeForce 8600M GT" }, + { 0x10DE0408, "GeForce 9650M GS" }, + { 0x10DE0409, "GeForce 8700M GT" }, + { 0x10DE040A, "Quadro FX 370" }, + { 0x10DE040B, "Quadro NVS 320M" }, + { 0x10DE040C, "Quadro FX 570M" }, + { 0x10DE040D, "Quadro FX 1600M" }, + { 0x10DE040E, "Quadro FX 570" }, + { 0x10DE040F, "Quadro FX 1700" }, + // 0410 - 041F + { 0x10DE0410, "GeForce GT 330" }, + // 0420 - 042F + { 0x10DE0420, "GeForce 8400 SE" }, + { 0x10DE0421, "GeForce 8500 GT" }, + { 0x10DE0422, "GeForce 8400 GS" }, + { 0x10DE0423, "GeForce 8300 GS" }, + { 0x10DE0424, "GeForce 8400 GS" }, + { 0x10DE0425, "GeForce 8600M GS" }, + { 0x10DE0426, "GeForce 8400M GT" }, + { 0x10DE0427, "GeForce 8400M GS" }, + { 0x10DE0428, "GeForce 8400M G" }, + { 0x10DE0429, "Quadro NVS 140M" }, + { 0x10DE042A, "Quadro NVS 130M" }, + { 0x10DE042B, "Quadro NVS 135M" }, + { 0x10DE042C, "GeForce 9400 GT" }, + { 0x10DE042D, "Quadro FX 360M" }, + { 0x10DE042E, "GeForce 9300M G" }, + { 0x10DE042F, "Quadro NVS 290" }, + // 0430 - 043F + // 0440 - 044F + // 0450 - 045F + // 0460 - 046F + // 0470 - 047F + // 0480 - 048F + // 0490 - 049F + // 04A0 - 04AF + // 04B0 - 04BF + // 04C0 - 04CF + { 0x10DE04C0, "NVIDIA G78" }, + { 0x10DE04C1, "NVIDIA G78" }, + { 0x10DE04C2, "NVIDIA G78" }, + { 0x10DE04C3, "NVIDIA G78" }, + { 0x10DE04C4, "NVIDIA G78" }, + { 0x10DE04C5, "NVIDIA G78" }, + { 0x10DE04C6, "NVIDIA G78" }, + { 0x10DE04C7, "NVIDIA G78" }, + { 0x10DE04C8, "NVIDIA G78" }, + { 0x10DE04C9, "NVIDIA G78" }, + { 0x10DE04CA, "NVIDIA G78" }, + { 0x10DE04CB, "NVIDIA G78" }, + { 0x10DE04CC, "NVIDIA G78" }, + { 0x10DE04CD, "NVIDIA G78" }, + { 0x10DE04CE, "NVIDIA G78" }, + { 0x10DE04CF, "NVIDIA G78" }, + // 04D0 - 04DF + // 04E0 - 04EF + // 04F0 - 04FF + // 0500 - 050F + // 0510 - 051F + // 0520 - 052F + // 0530 - 053F + { 0x10DE0530, "GeForce 7190M / nForce 650M" }, + { 0x10DE0531, "GeForce 7150M / nForce 630M" }, + { 0x10DE0533, "GeForce 7000M / nForce 610M" }, + { 0x10DE053A, "GeForce 7050 PV / nForce 630a" }, + { 0x10DE053B, "GeForce 7050 PV / nForce 630a" }, + { 0x10DE053E, "GeForce 7025 / nForce 630a" }, + // 0540 - 054F + // 0550 - 055F + // 0560 - 056F + // 0570 - 057F + // 0580 - 058F + // 0590 - 059F + // 05A0 - 05AF + // 05B0 - 05BF + // 05C0 - 05CF + // 05D0 - 05DF + // 05E0 - 05EF + { 0x10DE05E0, "GeForce GTX 295" }, + { 0x10DE05E1, "GeForce GTX 280" }, + { 0x10DE05E2, "GeForce GTX 260" }, + { 0x10DE05E3, "GeForce GTX 285" }, + { 0x10DE05E4, "NVIDIA GT200" }, + { 0x10DE05E5, "NVIDIA GT200" }, + { 0x10DE05E6, "GeForce GTX 275" }, + { 0x10DE05E7, "nVidia Tesla C1060" }, + { 0x10DE05E8, "NVIDIA GT200" }, + { 0x10DE05E9, "NVIDIA GT200" }, + { 0x10DE05EA, "GeForce GTX 260" }, + { 0x10DE05EB, "GeForce GTX 295" }, + { 0x10DE05EC, "NVIDIA GT200" }, + { 0x10DE05ED, "Quadroplex 2200 D2" }, + { 0x10DE05EE, "NVIDIA GT200" }, + { 0x10DE05EF, "NVIDIA GT200" }, + // 05F0 - 05FF + { 0x10DE05F0, "NVIDIA GT200" }, + { 0x10DE05F1, "NVIDIA GT200" }, + { 0x10DE05F2, "NVIDIA GT200" }, + { 0x10DE05F3, "NVIDIA GT200" }, + { 0x10DE05F4, "NVIDIA GT200" }, + { 0x10DE05F5, "NVIDIA GT200" }, + { 0x10DE05F6, "NVIDIA GT200" }, + { 0x10DE05F7, "NVIDIA GT200" }, + { 0x10DE05F8, "Quadroplex 2200 S4" }, + { 0x10DE05F9, "NVIDIA Quadro CX" }, + { 0x10DE05FA, "NVIDIA GT200" }, + { 0x10DE05FB, "NVIDIA GT200" }, + { 0x10DE05FC, "NVIDIA GT200" }, + { 0x10DE05FD, "Quadro FX 5800" }, + { 0x10DE05FE, "Quadro FX 4800" }, + { 0x10DE05FF, "Quadro FX 3800" }, + // 0600 - 060F + { 0x10DE0600, "GeForce 8800 GTS" }, + { 0x10DE0601, "GeForce 9800 GT" }, + { 0x10DE0602, "GeForce 8800 GT" }, + { 0x10DE0603, "GeForce GT 230" }, + { 0x10DE0604, "GeForce 9800 GX2" }, + { 0x10DE0605, "GeForce 9800 GT" }, + { 0x10DE0606, "GeForce 8800 GS" }, + { 0x10DE0607, "GeForce GTS 240" }, + { 0x10DE0608, "GeForce 9800M GTX" }, + { 0x10DE0609, "GeForce 8800M GTS" }, + { 0x10DE060A, "GeForce GTX 280M" }, + { 0x10DE060B, "GeForce 9800M GT" }, + { 0x10DE060C, "GeForce 8800M GTX" }, + { 0x10DE060D, "GeForce 8800 GS" }, + { 0x10DE060F, "GeForce GTX 285M" }, + // 0610 - 061F + { 0x10DE0610, "GeForce 9600 GSO" }, + { 0x10DE0611, "GeForce 8800 GT" }, + { 0x10DE0612, "GeForce 9800 GTX" }, + { 0x10DE0613, "GeForce 9800 GTX+" }, + { 0x10DE0614, "GeForce 9800 GT" }, + { 0x10DE0615, "GeForce GTS 250" }, + { 0x10DE0617, "GeForce 9800M GTX" }, + { 0x10DE0618, "GeForce GTX 260M" }, + { 0x10DE0619, "Quadro FX 4700 X2" }, + { 0x10DE061A, "Quadro FX 3700" }, + { 0x10DE061B, "Quadro VX 200" }, + { 0x10DE061C, "Quadro FX 3600M" }, + { 0x10DE061D, "Quadro FX 2800M" }, + { 0x10DE061E, "Quadro FX 3700M" }, + { 0x10DE061F, "Quadro FX 3800M" }, + // 0620 - 062F + { 0x10DE0620, "NVIDIA G94" }, + { 0x10DE0621, "GeForce GT 230" }, + { 0x10DE0622, "GeForce 9600 GT" }, + { 0x10DE0623, "GeForce 9600 GS" }, + { 0x10DE0624, "NVIDIA G94" }, + { 0x10DE0625, "GeForce 9600 GSO 512"}, + { 0x10DE0626, "GeForce GT 130" }, + { 0x10DE0627, "GeForce GT 140" }, + { 0x10DE0628, "GeForce 9800M GTS" }, + { 0x10DE0629, "NVIDIA G94" }, + { 0x10DE062A, "GeForce 9700M GTS" }, + { 0x10DE062B, "GeForce 9800M GS" }, + { 0x10DE062C, "GeForce 9800M GTS" }, + { 0x10DE062D, "GeForce 9600 GT" }, + { 0x10DE062E, "GeForce 9600 GT" }, + { 0x10DE062F, "GeForce 9800 S" }, + // 0630 - 063F + { 0x10DE0630, "GeForce 9700 S" }, + { 0x10DE0631, "GeForce GTS 160M" }, + { 0x10DE0632, "GeForce GTS 150M" }, + { 0x10DE0633, "NVIDIA G94" }, + { 0x10DE0634, "NVIDIA G94" }, + { 0x10DE0635, "GeForce 9600 GSO" }, + { 0x10DE0636, "NVIDIA G94" }, + { 0x10DE0637, "GeForce 9600 GT" }, + { 0x10DE0638, "Quadro FX 1800" }, + { 0x10DE0639, "NVIDIA G94" }, + { 0x10DE063A, "Quadro FX 2700M" }, + { 0x10DE063B, "NVIDIA G94" }, + { 0x10DE063C, "NVIDIA G94" }, + { 0x10DE063D, "NVIDIA G94" }, + { 0x10DE063E, "NVIDIA G94" }, + { 0x10DE063F, "NVIDIA G94" }, + // 0640 - 064F + { 0x10DE0640, "GeForce 9500 GT" }, + { 0x10DE0641, "GeForce 9400 GT" }, + { 0x10DE0642, "GeForce 8400 GS" }, + { 0x10DE0643, "GeForce 9500 GT" }, + { 0x10DE0644, "GeForce 9500 GS" }, + { 0x10DE0645, "GeForce 9500 GS" }, + { 0x10DE0646, "GeForce GT 120" }, + { 0x10DE0647, "GeForce 9600M GT" }, + { 0x10DE0648, "GeForce 9600M GS" }, + { 0x10DE0649, "GeForce 9600M GT" }, + { 0x10DE064A, "GeForce 9700M GT" }, + { 0x10DE064B, "GeForce 9500M G" }, + { 0x10DE064C, "GeForce 9650M GT" }, + // 0650 - 065F + { 0x10DE0650, "NVIDIA G96-825" }, + { 0x10DE0651, "GeForce G 110M" }, + { 0x10DE0652, "GeForce GT 130M" }, + { 0x10DE0653, "GeForce GT 120M" }, + { 0x10DE0654, "GeForce GT 220M" }, + { 0x10DE0655, "GeForce GT 120" }, + { 0x10DE0656, "GeForce 9650 S" }, + { 0x10DE0657, "NVIDIA G96" }, + { 0x10DE0658, "Quadro FX 380" }, + { 0x10DE0659, "Quadro FX 580" }, + { 0x10DE065A, "Quadro FX 1700M" }, + { 0x10DE065B, "GeForce 9400 GT" }, + { 0x10DE065C, "Quadro FX 770M" }, + { 0x10DE065D, "NVIDIA G96" }, + { 0x10DE065E, "NVIDIA G96" }, + { 0x10DE065F, "GeForce G210" }, + // 0660 - 066F + // 0670 - 067F + // 0680 - 068F + // 0690 - 069F + // 06A0 - 06AF + { 0x10DE06A0, "NVIDIA GT214" }, + // 06B0 - 06BF + { 0x10DE06B0, "NVIDIA GT214" }, + // 06C0 - 06CF + { 0x10DE06C0, "GeForce GTX 480" }, + { 0x10DE06C3, "GeForce GTX D12U" }, + { 0x10DE06C4, "GeForce GTX 465" }, + { 0x10DE06CA, "GeForce GTX 480M" }, + { 0x10DE06CD, "GeForce GTX 470" }, + // 06D0 - 06DF + { 0x10DE06D1, "Tesla C2050" }, + { 0x10DE06D2, "Tesla M2070" }, + { 0x10DE06D8, "Quadro 6000" }, + { 0x10DE06D9, "Quadro 5000" }, + { 0x10DE06DA, "Quadro 5000M" }, + { 0x10DE06DC, "Quadro 6000" }, + { 0x10DE06DD, "Quadro 4000" }, + { 0x10DE06DE, "Tesla M2050" }, + { 0x10DE06DF, "Tesla M2070-Q" }, + // 06E0 - 06EF + { 0x10DE06E0, "GeForce 9300 GE" }, + { 0x10DE06E1, "GeForce 9300 GS" }, + { 0x10DE06E2, "GeForce 8400" }, + { 0x10DE06E3, "GeForce 8400 SE" }, + { 0x10DE06E4, "GeForce 8400 GS" }, + { 0x10DE06E5, "GeForce 9300M GS" }, + { 0x10DE06E6, "GeForce G100" }, + { 0x10DE06E7, "GeForce 9300 SE" }, + { 0x10DE06E8, "GeForce 9200M GE" }, + { 0x10DE06E9, "GeForce 9300M GS" }, + { 0x10DE06EA, "Quadro NVS 150M" }, + { 0x10DE06EB, "Quadro NVS 160M" }, + { 0x10DE06EC, "GeForce G 105M" }, + { 0x10DE06ED, "NVIDIA G98" }, + { 0x10DE06EF, "GeForce G 103M" }, + // 06F0 - 06FF + { 0x10DE06F0, "NVIDIA G98" }, + { 0x10DE06F1, "GeForce G105M" }, + { 0x10DE06F2, "NVIDIA G98" }, + { 0x10DE06F3, "NVIDIA G98" }, + { 0x10DE06F4, "NVIDIA G98" }, + { 0x10DE06F5, "NVIDIA G98" }, + { 0x10DE06F6, "NVIDIA G98" }, + { 0x10DE06F7, "NVIDIA G98" }, + { 0x10DE06F8, "Quadro NVS 420" }, + { 0x10DE06F9, "Quadro FX 370 LP" }, + { 0x10DE06FA, "Quadro NVS 450" }, + { 0x10DE06FB, "Quadro FX 370M" }, + { 0x10DE06FC, "NVIDIA G98" }, + { 0x10DE06FD, "Quadro NVS 295" }, + { 0x10DE06FE, "NVIDIA G98" }, + { 0x10DE06FF, "HICx16 + Graphics" }, + // 0700 - 070F + // 0710 - 071F + // 0720 - 072F + // 0730 - 073F + // 0740 - 074F + // 0750 - 075F + // 0760 - 076F + // 0770 - 077F + // 0780 - 078F + // 0790 - 079F + // 07A0 - 07AF + // 07B0 - 07BF + // 07C0 - 07CF + // 07D0 - 07DF + // 07E0 - 07EF + { 0x10DE07E0, "GeForce 7150 / nForce 630i" }, + { 0x10DE07E1, "GeForce 7100 / nForce 630i" }, + { 0x10DE07E2, "GeForce 7050 / nForce 630i" }, + { 0x10DE07E3, "GeForce 7050 / nForce 610i" }, + { 0x10DE07E5, "GeForce 7050 / nForce 620i" }, + // 07F0 - 07FF + // 0800 - 080F + // 0810 - 081F + // 0820 - 082F + // 0830 - 083F + // 0840 - 084F + { 0x10DE0840, "GeForce 8200M" }, + { 0x10DE0844, "GeForce 9100M G" }, + { 0x10DE0845, "GeForce 8200M G" }, + { 0x10DE0846, "GeForce 9200" }, + { 0x10DE0847, "GeForce 9100" }, + { 0x10DE0848, "GeForce 8300" }, + { 0x10DE0849, "GeForce 8200" }, + { 0x10DE084A, "nForce 730a" }, + { 0x10DE084B, "GeForce 9200" }, + { 0x10DE084C, "nForce 980a/780a SLI" }, + { 0x10DE084D, "nForce 750a SLI" }, + { 0x10DE084F, "GeForce 8100 / nForce 720a" }, + // 0850 - 085F + // 0860 - 086F + { 0x10DE0860, "GeForce 9300" }, + { 0x10DE0861, "GeForce 9400" }, + { 0x10DE0862, "GeForce 9400M G" }, + { 0x10DE0863, "GeForce 9400M" }, + { 0x10DE0864, "GeForce 9300" }, + { 0x10DE0865, "GeForce 9300" }, + { 0x10DE0866, "GeForce 9400M G" }, + { 0x10DE0867, "GeForce 9400" }, + { 0x10DE0868, "nForce 760i SLI" }, + { 0x10DE0869, "GeForce 9400" }, + { 0x10DE086A, "GeForce 9400" }, + { 0x10DE086C, "GeForce 9300 / nForce 730i" }, + { 0x10DE086D, "GeForce 9200" }, + { 0x10DE086E, "GeForce 9100M G" }, + { 0x10DE086F, "GeForce 8200M G" }, + // 0870 - 087F + { 0x10DE0870, "GeForce 9400M" }, + { 0x10DE0871, "GeForce 9200" }, + { 0x10DE0872, "GeForce G102M" }, + { 0x10DE0873, "GeForce G205M" }, + { 0x10DE0874, "ION 9300M" }, + { 0x10DE0876, "ION 9400M" }, + { 0x10DE087A, "GeForce 9400" }, + { 0x10DE087D, "ION 9400M" }, + { 0x10DE087E, "ION LE" }, + { 0x10DE087F, "ION LE" }, // Tesla M2070-Q ?? + // 0880 - 088F + // 0890 - 089F + // 08A0 - 08AF + { 0x10DE08A0, "GeForce 320M" }, + { 0x10DE08A1, "MCP89-MZT" }, + { 0x10DE08A2, "GeForce 320M" }, + { 0x10DE08A3, "GeForce 320M" }, + { 0x10DE08A4, "GeForce 320M" }, + { 0x10DE08A5, "GeForce 320M" }, + // 08B0 - 08BF + { 0x10DE08B0, "MCP83 MMD" }, + { 0x10DE08B1, "GeForce 300M" }, + { 0x10DE08B2, "GeForce 300M" }, // MCP83-MJ + { 0x10DE08B3, "MCP89 MM9" }, + // 08C0 - 08CF + // 08D0 - 08DF + // 08E0 - 08EF + // 08F0 - 08FF + // 0900 - 090F + // 0910 - 091F + // 0920 - 092F + // 0930 - 093F + // 0940 - 094F + // 0950 - 095F + // 0960 - 096F + // 0970 - 097F + // 0980 - 098F + // 0990 - 099F + // 09A0 - 09AF + // 09B0 - 09BF + // 09C0 - 09CF + // 09D0 - 09DF + // 09E0 - 09EF + // 09F0 - 09FF + // 0A00 - 0A0F + // { 0x10DE0A00, "NVIDIA GT212" }, + // 0A10 - 0A1F + // { 0x10DE0A10, "NVIDIA GT212" }, + // 0A20 - 0A2F + { 0x10DE0A20, "GeForce GT 220" }, + { 0x10DE0A21, "D10M2-20" }, + { 0x10DE0A22, "GeForce 315" }, + { 0x10DE0A23, "GeForce 210" }, + { 0x10DE0A26, "GeForce 405" }, + { 0x10DE0A27, "GeForce 405" }, + { 0x10DE0A28, "GeForce GT 230" }, + { 0x10DE0A29, "GeForce GT 330M" }, + { 0x10DE0A2A, "GeForce GT 230M" }, + { 0x10DE0A2B, "GeForce GT 330M" }, + { 0x10DE0A2C, "NVS 5100M" }, + { 0x10DE0A2D, "GeForce GT 320M" }, + // 0A30 - 0A3F + { 0x10DE0A30, "GeForce GT 330M" }, + { 0x10DE0A32, "GeForce GT 415" }, + { 0x10DE0A34, "GeForce GT 240M" }, + { 0x10DE0A35, "GeForce GT 325M" }, + { 0x10DE0A38, "Quadro 400" }, + { 0x10DE0A3C, "Quadro FX 880M" }, + { 0x10DE0A3D, "N10P-ES" }, + { 0x10DE0A3F, "GT216-INT" }, + // 0A40 - 0A4F + // 0A50 - 0A5F + // 0A60 - 0A6F + { 0x10DE0A60, "GeForce G210" }, + { 0x10DE0A61, "NVS 2100" }, + { 0x10DE0A62, "GeForce 205" }, + { 0x10DE0A63, "GeForce 310" }, + { 0x10DE0A64, "ION" }, + { 0x10DE0A65, "GeForce 210" }, + { 0x10DE0A66, "GeForce 310" }, + { 0x10DE0A67, "GeForce 315" }, + { 0x10DE0A68, "GeForce G105M" }, + { 0x10DE0A69, "GeForce G105M" }, + { 0x10DE0A6A, "NVS 2100M" }, + { 0x10DE0A6C, "NVS 3100M" }, + { 0x10DE0A6E, "GeForce 305M" }, + { 0x10DE0A6F, "ION" }, + // 0A70 - 0A7F + { 0x10DE0A70, "GeForce 310M" }, + { 0x10DE0A71, "GeForce 305M" }, + { 0x10DE0A72, "GeForce 310M" }, + { 0x10DE0A73, "GeForce 305M" }, + { 0x10DE0A74, "GeForce G210M" }, + { 0x10DE0A75, "GeForce G310M" }, + { 0x10DE0A76, "ION" }, + { 0x10DE0A78, "Quadro FX 380 LP" }, + // { 0x10DE0A79, "N12M-NS-S" }, + { 0x10DE0A7A, "GeForce 315M" }, + { 0x10DE0A7B, "GeForce 505" }, + { 0x10DE0A7C, "Quadro FX 380M" }, + { 0x10DE0A7D, "N11M-ES" }, //SUBIDS + { 0x10DE0A7E, "GT218-INT-S" }, + { 0x10DE0A7F, "GT218-INT-B" }, + // 0A80 - 0A8F + // 0A90 - 0A9F + // 0AA0 - 0AAF + // 0AB0 - 0ABF + // 0AC0 - 0ACF + // 0AD0 - 0ADF + // 0AE0 - 0AEF + // 0AF0 - 0AFF + // 0B00 - 0B0F + // 0B10 - 0B1F + // 0B20 - 0B2F + // 0B30 - 0B3F + // 0B40 - 0B4F + // 0B50 - 0B5F + // 0B60 - 0B6F + // 0B70 - 0B7F + // 0B80 - 0B8F + // 0B90 - 0B9F + // 0BA0 - 0BAF + // 0BB0 - 0BBF + // 0BC0 - 0BCF + // 0BD0 - 0BDF + // 0BE0 - 0BEF + // 0BF0 - 0BFF + // 0C00 - 0C0F + // 0C10 - 0C1F + // 0C20 - 0C2F + // 0C30 - 0C3F + // 0C40 - 0C4F + // 0C50 - 0C5F + // 0C60 - 0C6F + // 0C70 - 0C7F + // 0C80 - 0C8F + // 0C90 - 0C9F + // 0CA0 - 0CAF + { 0x10DE0CA0, "GeForce GT 330 " }, + { 0x10DE0CA2, "GeForce GT 320" }, + { 0x10DE0CA3, "GeForce GT 240" }, + { 0x10DE0CA4, "GeForce GT 340" }, + { 0x10DE0CA5, "GeForce GT 220" }, + { 0x10DE0CA7, "GeForce GT 330" }, + { 0x10DE0CA8, "GeForce GTS 260M" }, + { 0x10DE0CA9, "GeForce GTS 250M" }, + { 0x10DE0CAC, "GeForce GT 220" }, + { 0x10DE0CAD, "N10E-ES" }, // SUBIDS + { 0x10DE0CAE, "GT215-INT" }, + { 0x10DE0CAF, "GeForce GT 335M" }, + // 0CB0 - 0CBF + { 0x10DE0CB0, "GeForce GTS 350M" }, + { 0x10DE0CB1, "GeForce GTS 360M" }, + { 0x10DE0CBC, "Quadro FX 1800M" }, + // 0CC0 - 0CCF + // 0CD0 - 0CDF + // 0CE0 - 0CEF + // 0CF0 - 0CFF + // 0D00 - 0D0F + // 0D10 - 0D1F + // 0D20 - 0D2F + // 0D30 - 0D3F + // 0D40 - 0D4F + // 0D50 - 0D5F + // 0D60 - 0D6F + // 0D70 - 0D7F + // 0D80 - 0D8F + // 0D90 - 0D9F + // 0DA0 - 0DAF + // 0DB0 - 0DBF + // 0DC0 - 0DCF + { 0x10DE0DC0, "GeForce GT 440" }, + // { 0x10DE0DC1, "D12-P1-35" }, + // { 0x10DE0DC2, "D12-P1-35" }, + { 0x10DE0DC4, "GeForce GTS 450" }, + { 0x10DE0DC5, "GeForce GTS 450" }, + { 0x10DE0DC6, "GeForce GTS 450" }, + // { 0x10DE0DCA, "GF10x" }, + // { 0x10DE0DCC, "N12E-GS" }, + { 0x10DE0DCD, "GeForce GT 555M" }, + { 0x10DE0DCE, "GeForce GT 555M" }, + // { 0x10DE0DCF, "N12P-GT-B" }, + // 0DD0 - 0DDF + // { 0x10DE0DD0, "N11E-GT" }, + { 0x10DE0DD1, "GeForce GTX 460M" }, + { 0x10DE0DD2, "GeForce GT 445M" }, + { 0x10DE0DD3, "GeForce GT 435M" }, + { 0x10DE0DD6, "GeForce GT 550M" }, + { 0x10DE0DD8, "Quadro 2000" }, + { 0x10DE0DDA, "Quadro 2000M" }, + { 0x10DE0DDE, "GF106-ES" }, + // { 0x10DE0DDF, "GF106-INT" }, + // 0DE0 - 0DEF + { 0x10DE0DE0, "GeForce GT 440" }, + { 0x10DE0DE1, "GeForce GT 430" }, + { 0x10DE0DE2, "GeForce GT 420" }, + { 0x10DE0DE3, "GeForce GT 635M" }, + { 0x10DE0DE4, "GeForce GT 520" }, + { 0x10DE0DE5, "GeForce GT 530" }, + { 0x10DE0DE8, "GeForce GT 620M" }, + { 0x10DE0DE9, "GeForce GT 630M" }, + { 0x10DE0DEA, "GeForce GT 610M" }, + { 0x10DE0DEB, "GeForce GT 555M" }, + { 0x10DE0DEC, "GeForce GT 525M" }, + { 0x10DE0DED, "GeForce GT 520M" }, + { 0x10DE0DEE, "GeForce GT 415M" }, + { 0x10DE0DEF, "N13P-NS1-A1" }, + // 0DF0 - 0DFF + { 0x10DE0DF0, "GeForce GT 425M" }, + { 0x10DE0DF1, "GeForce GT 420M" }, + { 0x10DE0DF2, "GeForce GT 435M" }, + { 0x10DE0DF3, "GeForce GT 420M" }, + { 0x10DE0DF4, "GeForce GT 540M" }, + { 0x10DE0DF5, "GeForce GT 525M" }, + { 0x10DE0DF6, "GeForce GT 550M" }, + { 0x10DE0DF7, "GeForce GT 520M" }, + { 0x10DE0DF8, "Quadro 600" }, + { 0x10DE0DF9, "Quadro 500M" }, + { 0x10DE0DFA, "Quadro 1000M" }, + { 0x10DE0DFC, "NVS 5200M" }, + { 0x10DE0DFE, "GF108 ES" }, + // { 0x10DE0DFF, "GF108 INT" }, + // 0E00 - 0E0F + // 0E10 - 0E1F + // 0E20 - 0E2F + { 0x10DE0E21, "D12U-25" }, + { 0x10DE0E22, "GeForce GTX 460" }, + { 0x10DE0E23, "GeForce GTX 460 SE" }, + { 0x10DE0E24, "GeForce GTX 460" }, + // { 0x10DE0E25, "D12U-50" }, + { 0x10DE0E28, "GeForce GTX 460" }, + // 0E30 - 0E3F + { 0x10DE0E30, "GeForce GTX 470M" }, + { 0x10DE0E31, "GeForce GTX 485M" }, + // { 0x10DE0E32, "N12E-GT" }, + { 0x10DE0E38, "GF104GL" }, + { 0x10DE0E3A, "Quadro 3000M" }, + { 0x10DE0E3B, "Quadro 4000M" }, + // { 0x10DE0E3E, "GF104-ES" }, + // { 0x10DE0E3F, "GF104-INT" }, + // 0E40 - 0E4F + // 0E50 - 0E5F + // 0E60 - 0E6F + // 0E70 - 0E7F + // 0E80 - 0E8F + // 0E90 - 0E9F + // 0EA0 - 0EAF + // 0EB0 - 0EBF + // 0EC0 - 0ECF + // 0ED0 - 0EDF + // 0EE0 - 0EEF + // 0EF0 - 0EFF + // 0F00 - 0F0F + { 0x10DE0F00, "GeForce GT 630" }, + { 0x10DE0F01, "GeForce GT 620" }, + // 0F10 - 0F1F + // 0F20 - 0F2F + // 0F30 - 0F3F + // 0F40 - 0F4F + // 0F50 - 0F5F + // 0F60 - 0F6F + // 0F70 - 0F7F + // 0F80 - 0F8F + // 0F90 - 0F9F + // 0FA0 - 0FAF + // 0FB0 - 0FBF + // 0FC0 - 0FCF + { 0x10DE0FC0, "GeForce GT 640" }, + { 0x10DE0FC1, "GeForce GT 640" }, + { 0x10DE0FC2, "GeForce GT 630" }, + { 0x10DE0FC6, "GeForce GTX 650" }, + // 0FD0 - 0FDF + { 0x10DE0FD1, "GeForce GT 650M" }, + { 0x10DE0FD2, "GeForce GT 640M" }, + { 0x10DE0FD3, "GeForce GT 640M LE" }, + { 0x10DE0FD4, "GeForce GTX 660M" }, + { 0x10DE0FD5, "GeForce GT 650M" }, + { 0x10DE0FD8, "GeForce GT 640M" }, + { 0x10DE0FD9, "GeForce GT 645M" }, + { 0x10DE0FDB, "GK107-ESP-A1" }, + { 0x10DE0FDF, "GeForce GT 740M" }, + // 0FE0 - 0FEF + { 0x10DE0FE0, "GeForce GTX 660M" }, + { 0x10DE0FE1, "GeForce GT 730M" }, + { 0x10DE0FE3, "GeForce GT 745M" }, + { 0x10DE0FE4, "GeForce GT 750M" }, + // 0FF0 - 0FFF + { 0x10DE0FF2, "VGX K1" }, + { 0x10DE0FF8, "Quadro K500M" }, + { 0x10DE0FF9, "Quadro K2000D" }, + { 0x10DE0FFA, "Quadro K600" }, + { 0x10DE0FFB, "Quadro K2000M" }, + { 0x10DE0FFC, "Quadro K1000M" }, + { 0x10DE0FFD, "NVS 510" }, + { 0x10DE0FFE, "Quadro K2000" }, + { 0x10DE0FFF, "Quadro 410" }, + // 1000 - 100F + { 0x10DE1003, "GeForce GTX Titan LE" }, + { 0x10DE1004, "GeForce GTX 780" }, + { 0x10DE1005, "GeForce GTX Titan" }, + // 1010 - 101F + { 0x10DE101F, "Tesla K20" }, + // 1020 - 102F + { 0x10DE1020, "Tesla K20X" }, + { 0x10DE1021, "Tesla K20Xm" }, + { 0x10DE1022, "Tesla K20c" }, + { 0x10DE1026, "Tesla K20s" }, + { 0x10DE1028, "Tesla K20m" }, + // 1030 - 103F + // 1040 - 104F + { 0x10DE1040, "GeForce GT 520" }, + // { 0x10DE1041, "D13M1-45" }, + { 0x10DE1042, "GeForce 510" }, + { 0x10DE1048, "GeForce 605" }, + { 0x10DE1049, "GeForce GT 620" }, + { 0x10DE104A, "GeForce GT 610" }, + { 0x10DE104B, "GeForce GT 625" }, + // 1050 - 105F + { 0x10DE1050, "GeForce GT 520M" }, + { 0x10DE1051, "GeForce GT 520MX" }, + { 0x10DE1052, "GeForce GT 520M" }, + { 0x10DE1054, "GeForce GT 410M" }, + { 0x10DE1055, "GeForce 410M" }, + { 0x10DE1056, "Quadro NVS 4200M" }, + { 0x10DE1057, "Quadro NVS 4200M" }, + { 0x10DE1058, "GeForce GT 610M" }, + { 0x10DE1059, "GeForce 610M" }, + { 0x10DE105A, "GeForce 610M" }, + { 0x10DE105B, "GeForce 705A" }, + // 1060 - 106F + // 1070 - 107F + { 0x10DE107C, "Quadro NVS 315" }, + { 0x10DE107D, "Quadro NVS 310" }, + // { 0x10DE107E, "GF119-INT" }, + { 0x10DE107F, "GF119-ES" }, + // 1080 - 108F + { 0x10DE1080, "GeForce GTX 580" }, + { 0x10DE1081, "GeForce GTX 570" }, + { 0x10DE1082, "GeForce GTX 560 Ti" }, + { 0x10DE1083, "D13U" }, + { 0x10DE1084, "GeForce GTX 560" }, + { 0x10DE1086, "GeForce GTX 570 HD" }, + { 0x10DE1087, "GeForce GTX 560 Ti-448" }, + { 0x10DE1088, "GeForce GTX 590" }, + { 0x10DE1089, "GeForce GTX 580" }, + { 0x10DE108B, "GeForce GTX 590" }, + // { 0x10DE108C, "D13U" }, + { 0x10DE108E, "Tesla C2090" }, + // 1090 - 109F + { 0x10DE1091, "Tesla M2090" }, // X2090 + { 0x10DE1094, "Tesla M2075" }, + { 0x10DE1096, "Tesla C2075" }, + { 0x10DE1098, "D13U" }, + { 0x10DE109A, "Quadro 5010M" }, + { 0x10DE109B, "Quadro 7000" }, + // 10A0 - 10AF + // 10B0 - 10BF + // 10C0 - 10CF + { 0x10DE10C0, "GeForce 9300 GS" }, + { 0x10DE10C3, "GeForce 8400 GS" }, + { 0x10DE10C4, "ION" }, + { 0x10DE10C5, "GeForce 405" }, + // 10D0 - 10DF + { 0x10DE10D8, "Quadro NVS 300" }, + // 10E0 - 10EF + // 10F0 - 10FF + // 1100 - 110F + // 1110 - 111F + // 1120 - 112F + // 1130 - 113F + // 1140 - 114F + { 0x10DE1140, "GeForce GT 610M" }, + { 0x10DE1141, "GeForce 610M" }, + { 0x10DE1142, "GeForce 620M" }, + // { 0x10DE1143, "N13P-GV" }, + // { 0x10DE1144, "GF117" }, + // { 0x10DE1145, "GF117" }, + // { 0x10DE1146, "GF117" }, + // { 0x10DE1147, "GF117" }, + { 0x10DE1149, "GF117-ES" }, + // { 0x10DE114A, "GF117-INT" }, + // { 0x10DE114B, "PCI-GEN3-B" }, + // 1150 - 115F + // 1160 - 116F + // 1170 - 117F + // 1180 - 118F + { 0x10DE1180, "GeForce GTX 680" }, + { 0x10DE1183, "GeForce GTX 660 Ti" }, + { 0x10DE1185, "GeForce GTX 660" }, + { 0x10DE1188, "GeForce GTX 690" }, + { 0x10DE1189, "GeForce GTX 670" }, + { 0x10DE118F, "Tesla K10" }, + // 1190 - 119F + { 0x10DE119F, "GeForce GTX 780M" }, + // 11A0 - 11AF + { 0x10DE11A0, "GeForce GTX 680M" }, + { 0x10DE11A1, "GeForce GTX 670MX" }, + { 0x10DE11A2, "GeForce GTX 675MX" }, + { 0x10DE11A3, "GeForce GTX 680MX" }, + { 0x10DE11A7, "GeForce GTX 675MX" }, + // 11B0 - 11BF + { 0x10DE11BA, "Quadro K5000" }, + { 0x10DE11BC, "Quadro K5000M" }, + { 0x10DE11BD, "Quadro K4000M" }, + { 0x10DE11BE, "Quadro K3000M" }, + { 0x10DE11BF, "VGX K2" }, + // 11C0 - 11CF + { 0x10DE11C0, "GeForce GTX 660" }, + { 0x10DE11C2, "GeForce GTX 650 Ti BOOST" }, + { 0x10DE11C3, "GeForce GTX 650 Ti" }, + { 0x10DE11C4, "GeForce GTX 645" }, + { 0x10DE11C6, "GeForce GTX 650 Ti" }, + // 11D0 - 11DF + // 11E0 - 11EF + { 0x10DE11E0, "GeForce GTX 770M" }, + { 0x10DE11E1, "N14E-GE-B-A1" }, + { 0x10DE11E2, "GeForce GTX 765M" }, + { 0x10DE11E3, "GeForce GTX 760M" }, + // 11F0 - 11FF + { 0x10DE11FA, "Quadro K4000" }, + // 1200 - 120F + { 0x10DE1200, "GeForce GTX 560 Ti" }, + { 0x10DE1201, "GeForce GTX 560" }, + { 0x10DE1202, "GeForce GTX 560 Ti" }, + { 0x10DE1203, "GeForce GTX 460 SE v2" }, + { 0x10DE1205, "GeForce GTX 460 v2" }, + { 0x10DE1206, "GeForce GTX 555" }, + { 0x10DE1207, "GeForce GT 645" }, + { 0x10DE1208, "GeForce GTX 560 SE" }, + { 0x10DE1210, "GeForce GTX 570M" }, + { 0x10DE1211, "GeForce GTX 580M" }, + { 0x10DE1212, "GeForce GTX 675M" }, + { 0x10DE1213, "GeForce GTX 670M" }, + { 0x10DE1240, "GeForce GT 620M" }, + { 0x10DE1241, "GeForce GT 545" }, + { 0x10DE1243, "GeForce GT 545" }, + { 0x10DE1244, "GeForce GTX 550 Ti" }, + { 0x10DE1245, "GeForce GTS 450" }, + { 0x10DE1246, "GeForce GT 550M" }, + { 0x10DE1247, "GeForce GT 555M" }, + { 0x10DE1248, "GeForce GT 555M" }, + { 0x10DE1249, "GeForce GTS 450" }, + { 0x10DE124B, "GeForce GT 640" }, + { 0x10DE124D, "GeForce GT 555M" }, + // { 0x10DE1250, "GF116-INT" }, + { 0x10DE1251, "GeForce GTX 560M" }, + // 1260 - 126F + // 1270 - 127F + // 1280 - 128F + { 0x10DE1280, "GeForce GT 635" }, + // 1290 - 129F + { 0x10DE1290, "GeForce GT 730M" }, + { 0x10DE1291, "GeForce GT 735M" }, + { 0x10DE1292, "GeForce GT 740M" }, + { 0x10DE1293, "GeForce GT 730M" }, + { 0x10DE1294, "GeForce GT 740M" }, + // 12A0 - 12AF + //{ 0x10DE12A0, "GeForce GT ???" }, + // 12B0 - 12BF + // 12C0 - 12CF + // 12D0 - 12DF + // 12E0 - 12EF + // 12F0 - 12FF +}; + +static nvidia_card_info_t nvidia_card_exceptions[] = { + /* ======================================================================================== + * Layout is device(VendorId + DeviceId), subdev (SubvendorId + SubdeviceId), display name. + * ======================================================================================== + */ + /* ------ Specific DeviceID and SubDevID. ------ */ + // 0000 - 00FF + { 0x10DE0040, 0x10438178, "Asus V9999 Ultra V62.11" }, + { 0x10DE0040, 0x1043817D, "Asus V9999GT V61.21" }, + { 0x10DE0040, 0x7FFFFFFF, "GeForce 6800 Ultra [NV40.0]" }, + // 0100 - 01FF + { 0x10DE01D7, 0x102801C2, "Dell Quadro NVS 110M" }, + { 0x10DE01D7, 0x102801CC, "Dell Quadro NVS 110M" }, + { 0x10DE01D7, 0x10DE014B, "nVidia Quadro NVS 110M" }, + + { 0x10DE01D8, 0x102801CC, "Dell Quadro NVS 120M" }, + { 0x10DE01D8, 0x10282003, "Dell Quadro NVS 120M" }, + + { 0x10DE01DA, 0x10280407, "Dell GeForce 7300 LE" }, + // 0200 - 02FF + { 0x10DE025B, 0x10480D23, "ELSA Gloria4 700XGL" }, + // 0300 - 03FF + { 0x10DE0391, 0x10DE047A, "Galaxy GeForce 7600 GT" }, + { 0x10DE0391, 0x19F120DE, "Galaxy GeForce 7600 GT" }, + + { 0x10DE0393, 0x00000400, "Apple GeForce 7300GT" }, + // 0400 - 04FF + { 0x10DE0402, 0x10DE0439, "Galaxy 8600GT" }, + { 0x10DE0402, 0x10DE0505, "Galaxy 8600GT" }, + // 0500 - 05FF + { 0x10DE05E2, 0x104382EB, "ASUS ENGTX260" }, + { 0x10DE05E2, 0x16822390, "HFX GeForce GTX 260" }, + { 0x10DE05E2, 0x17870000, "HIS GeForce GTX 260" }, + + { 0x10DE05E6, 0x10B00401, "Gainward GeForce GTX 285" }, + + { 0x10DE05E7, 0x10DE0595, "nVidia Tesla T10 Processor" }, + { 0x10DE05E7, 0x10DE066A, "nVidia Tesla C1060" }, + { 0x10DE05E7, 0x10DE068F, "nVidia Tesla T10 Processor" }, + { 0x10DE05E7, 0x10DE0697, "nVidia Tesla M1060" }, + { 0x10DE05E7, 0x10DE0714, "nVidia Tesla M1060" }, + { 0x10DE05E7, 0x10DE0743, "nVidia Tesla M1060" }, + // 0600 - 06FF + { 0x10DE0600, 0x10DE0000, "Abit GeForce 8800 GTS" }, + + { 0x10DE0605, 0x145834A2, "Gigabyte GV-N98TOC-512H" }, + + { 0x10DE0608, 0x15880577, "Solidum GeForce 9800M GTX" }, + + { 0x10DE0609, 0x11700121, "Inventec GeForce 8800M GTS" }, + + { 0x10DE0612, 0x104382A6, "Asus GeForce 9800 GTX+" }, + { 0x10DE0612, 0x10DE0571, "nVidia GeForce 9800 GTX+" }, + { 0x10DE0612, 0x10DE0592, "nVidia GeForce 9800 GTX+" }, + { 0x10DE0612, 0x3842C842, "EVGA GeForce 9800 GTX+" }, + { 0x10DE0612, 0x3842C875, "EVGA GeForce 9800 GTX+" }, + + { 0x10DE0615, 0x10480F67, "ELSA GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0592, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0593, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0652, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE0719, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x10DE079E, "Palit GeForce GTS 250" }, + { 0x10DE0615, 0x11503842, "TMC GeForce GTS 250" }, // Thinking Machines Corporation + { 0x10DE0615, 0x11513842, "JAE GeForce GTS 250" }, + { 0x10DE0615, 0x11553842, "Pine GeForce GTS 250" }, + { 0x10DE0615, 0x11563842, "Periscope GeForce GTS 250" }, + + { 0x10DE0618, 0x10432028, "Asus GeForce GTX 170M" }, + { 0x10DE0618, 0x1043202B, "Asus GeForce GTX 680" }, + + { 0x10DE0622, 0x104382AC, "Asus EN9600GT Magic" }, + + { 0x10DE0640, 0x10DE077F, "Inno3D GeForce 9500GT HDMI" }, + + { 0x10DE0649, 0x1043202D, "Asus GeForce GT 220M" }, + + { 0x10DE06CD, 0x10DE079F, "Point of View GeForce GTX 470" }, + { 0x10DE06CD, 0x14622220, "MSi GeForce GTX 470 Twin Frozr II" }, + + { 0x10DE06D1, 0x10DE0772, "nVidia Tesla C2070" }, + + { 0x10DE06D2, 0x10DE088F, "nVidia Tesla X2070" }, + + { 0x10DE06DE, 0x10DE0773, "nVidia Tesla S2050" }, + { 0x10DE06DE, 0x10DE0830, "nVidia Tesla M2070" }, + { 0x10DE06DE, 0x10DE0831, "nVidia Tesla M2070" }, + { 0x10DE06DE, 0x10DE0832, "nVidia Tesla M2070" }, + { 0x10DE06DE, 0x10DE0840, "nVidia Tesla X2070" }, + + { 0x10DE06E4, 0x10438322, "Asus EN8400GS" }, + { 0x10DE06E4, 0x14583475, "GV-NX84S256HE [GeForce 8400 GS]" }, + + { 0x10DE06E8, 0x10280262, "Dell GeForce 9200M GS" }, + { 0x10DE06E8, 0x10280271, "Dell GeForce 9200M GS" }, + { 0x10DE06E8, 0x10280272, "Dell GeForce 9200M GS" }, + { 0x10DE06E8, 0x103C30F4, "HP GeForce 9200M GS" }, + { 0x10DE06E8, 0x103C30F7, "HP GeForce 9200M GS" }, + { 0x10DE06E8, 0x103C3603, "HP GeForce 9200M GS" }, + // 0700 - 07FF + // 0800 - 08FF + { 0x10DE0873, 0x104319B4, "Asus GeForce G102M" }, + // 0900 - 09FF + // 0A00 - 0AFF + { 0x10DE0A6F, 0x12974003, "Shuttle XS 3510MA" }, + + { 0x10DE0A70, 0x17AA3605, "Lenovo ION" }, + + { 0x10DE0A73, 0x17AA3607, "Lenovo ION" }, + { 0x10DE0A73, 0x17AA3610, "Lenovo ION" }, + + { 0x10DE0A75, 0x17AA3605, "Lenovo ION" }, + // 0B00 - 0BFF + // 0C00 - 0CFF + { 0x10DE0CA3, 0x14628041, "MSi VN240GT-MD1G" }, + { 0x10DE0CA3, 0x16423926, "Bitland GeForce GT 230" }, + // 0D00 - 0DFF + { 0x10DE0DD8, 0x10DE0914, "nVidia Quadro 2000D" }, + + { 0x10DE0DEF, 0x17AA21F3, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA21F4, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA21F5, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA21F6, "Lenovo NVS 5400M" }, + { 0x10DE0DEF, 0x17AA5005, "Lenovo NVS 5400M" }, + + // 0E00 - 0EFF + { 0x10DE0E22, 0x1043835D, "Asus ENGTX460" }, + + { 0x10DE0E23, 0x10B00401, "Gainward GeForce GTX 460" }, + // 0F00 - 0FFF + { 0x10DE0FD2, 0x10280595, "Dell GeForce GT 640M LE" }, + { 0x10DE0FD2, 0x102805B2, "Dell GeForce GT 640M LE" }, + // 1000 - 10FF + { 0x10DE1080, 0x14622561, "MSI N580GTX Lightning" }, + { 0x10DE1080, 0x14622563, "MSI N580GTX Lightning" }, + + { 0x10DE1086, 0x10DE0871, "Inno3D GeForce GTX 570" }, + + { 0x10DE1087, 0x104383D6, "Asus ENGTX560Ti448 DCII" }, + + { 0x10DE1091, 0x10DE088E, "nVidia Tesla X2090" }, + { 0x10DE1091, 0x10DE0891, "nVidia Tesla X2090" }, + // 1100 - 11FF + { 0x10DE1140, 0x1025064A, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x1025064C, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250680, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250692, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250694, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250702, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250719, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250725, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250728, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x1025072B, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x1025072E, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10250732, "Acer GeForce GT 620M" }, + { 0x10DE1140, 0x10280565, "Dell GeForce GT 630M" }, + { 0x10DE1140, 0x10280568, "Dell GeForce GT 630M" }, + { 0x10DE1140, 0x144DC0D5, "Samsung GeForce GT 630M" }, + { 0x10DE1140, 0x17AA500D, "Lenovo GeForce GT 620M" }, + { 0x10DE1140, 0x1B0A20DD, "Pegatron GeForce GT 620M" }, + { 0x10DE1140, 0x1B0A20FD, "Pegatron GeForce GT 620M" }, + + { 0x10DE1180, 0x00001255, "Afox GTX 680" }, + { 0x10DE1180, 0x104383F0, "Asus GTX680-2GD5" }, + { 0x10DE1180, 0x104383F6, "Asus GTX 680 Direct CU II" }, + { 0x10DE1180, 0x104383F7, "Asus GTX 680 Direct CU II" }, + { 0x10DE1180, 0x1458353C, "GV-N680OC-2GD WindForce GTX 680 OC" }, + { 0x10DE1180, 0x14622820, "MSi N680GTX TwinFrozer" }, + { 0x10DE1180, 0x14622830, "MSi GTX 680 Lightning" }, + { 0x10DE1180, 0x14622831, "MSi GTX 680 Lightning LN2" }, + { 0x10DE1180, 0x15691180, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x15691181, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x15691189, "Palit GTX 680 JetStream" }, + { 0x10DE1180, 0x38422682, "EVGA GTX 680 SC" }, + { 0x10DE1180, 0x38422683, "EVGA GTX 680 SC" }, + + { 0x10DE1189, 0x10438405, "Asus GTX 670 Direct CU II TOP" }, + { 0x10DE1189, 0x15691189, "Palit GTX 670 JetStream" }, + { 0x10DE1189, 0x19DA1255, "Zotac GTX 670 AMP! Edition" }, + + { 0x10DE11A1, 0x15587102, "Clevo N13E-GR" }, + + { 0x10DE11C0, 0x10DE0995, "Inno3D GeForce GTX660" }, + + { 0x10DE11C6, 0x1043842A, "GTX650TI-1GD5" }, + // 1200 - 12FF + { 0x10DE1247, 0x10432119, "Asus GeForce GT 670M" }, + { 0x10DE1247, 0x10432120, "Asus GeForce GT 670M" }, + { 0x10DE1247, 0x1043212A, "Asus GeForce GT 635M" }, + { 0x10DE1247, 0x1043212B, "Asus GeForce GT 635M" }, + { 0x10DE1247, 0x1043212C, "Asus GeForce GT 635M" }, + { 0x10DE1247, 0x152D0930, "Quanta GeForce GT 635M" }, + + { 0x10DE1248, 0x152D0930, "Quanta GeForce GT 635M" }, + + { 0x10DE124D, 0x146210CC, "MSi GeForce GT 635M" }, +}; + +static int patch_nvidia_rom(uint8_t *rom) +{ + if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) { + printf("False ROM signature: 0x%02x%02x\n", rom[0], rom[1]); + return PATCH_ROM_FAILED; + } + + uint16_t dcbptr = READ_LE_SHORT(rom, 0x36); + + if (!dcbptr) { + printf("no dcb table found\n"); + return PATCH_ROM_FAILED; + } +// else +// printf("dcb table at offset 0x%04x\n", dcbptr); + + uint8_t *dcbtable = &rom[dcbptr]; + uint8_t dcbtable_version = dcbtable[0]; + uint8_t headerlength = 0; + uint8_t numentries = 0; + uint8_t recordlength = 0; + + if (dcbtable_version >= 0x20) + { + uint32_t sig; + + if (dcbtable_version >= 0x30) + { + headerlength = dcbtable[1]; + numentries = dcbtable[2]; + recordlength = dcbtable[3]; + + sig = READ_LE_INT(dcbtable, 6); + } + else + { + sig = READ_LE_INT(dcbtable, 4); + headerlength = 8; + } + + if (sig != 0x4edcbdcb) + { + printf("Bad display config block signature (0x%8x)\n", sig); //Azi: issue #48 + return PATCH_ROM_FAILED; + } + } + else if (dcbtable_version >= 0x14) /* some NV15/16, and NV11+ */ + { + char sig[8] = { 0 }; + + strncpy(sig, (char *)&dcbtable[-7], 7); + recordlength = 10; + + if (strcmp(sig, "DEV_REC")) + { + printf("Bad Display Configuration Block signature (%s)\n", sig); + return PATCH_ROM_FAILED; + } + } + else + { + printf("ERROR: dcbtable_version is 0x%X\n", dcbtable_version); + return PATCH_ROM_FAILED; + } + + if (numentries >= MAX_NUM_DCB_ENTRIES) + numentries = MAX_NUM_DCB_ENTRIES; + + uint8_t num_outputs = 0, i = 0; + + struct dcbentry + { + uint8_t type; + uint8_t index; + uint8_t *heads; + } entries[numentries]; + + for (i = 0; i < numentries; i++) + { + uint32_t connection; + connection = READ_LE_INT(dcbtable,headerlength + recordlength * i); + + /* Should we allow discontinuous DCBs? Certainly DCB I2C tables can be discontinuous */ + if ((connection & 0x0000000f) == 0x0000000f) /* end of records */ + continue; + if (connection == 0x00000000) /* seen on an NV11 with DCB v1.5 */ + continue; + if ((connection & 0xf) == 0x6) /* we skip type 6 as it doesnt appear on macbook nvcaps */ + continue; + + entries[num_outputs].type = connection & 0xf; + entries[num_outputs].index = num_outputs; + entries[num_outputs++].heads = (uint8_t*)&(dcbtable[(headerlength + recordlength * i) + 1]); + + } + + int has_lvds = false; + uint8_t channel1 = 0, channel2 = 0; + + for (i = 0; i < num_outputs; i++) + { + if (entries[i].type == 3) + { + has_lvds = true; + //printf("found LVDS\n"); + channel1 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + } + } + + // if we have a LVDS output, we group the rest to the second channel + if (has_lvds) + { + for (i = 0; i < num_outputs; i++) + { + if (entries[i].type == TYPE_GROUPED) + continue; + + channel2 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + } + } + else + { + int x; + // we loop twice as we need to generate two channels + for (x = 0; x <= 1; x++) + { + for (i=0; i<num_outputs; i++) + { + if (entries[i].type == TYPE_GROUPED) + continue; + // if type is TMDS, the prior output is ANALOG + // we always group ANALOG and TMDS + // if there is a TV output after TMDS, we group it to that channel as well + if (i && entries[i].type == 0x2) + { + switch (x) + { + case 0: + //printf("group channel 1\n"); + channel1 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + + if (entries[i-1].type == 0x0) + { + channel1 |= ( 0x1 << entries[i-1].index); + entries[i-1].type = TYPE_GROUPED; + } + // group TV as well if there is one + if ( ((i+1) < num_outputs) && (entries[i+1].type == 0x1) ) + { + // printf("group tv1\n"); + channel1 |= ( 0x1 << entries[i+1].index); + entries[i+1].type = TYPE_GROUPED; + } + break; + + case 1: + //printf("group channel 2 : %d\n", i); + channel2 |= ( 0x1 << entries[i].index); + entries[i].type = TYPE_GROUPED; + + if (entries[i - 1].type == 0x0) + { + channel2 |= ( 0x1 << entries[i-1].index); + entries[i-1].type = TYPE_GROUPED; + } + // group TV as well if there is one + if ( ((i+1) < num_outputs) && (entries[i+1].type == 0x1) ) + { + // printf("group tv2\n"); + channel2 |= ( 0x1 << entries[i+1].index); + entries[i+1].type = TYPE_GROUPED; + } + break; + default: + break; + } + break; + } + } + } + } + + // if we have left ungrouped outputs merge them to the empty channel + uint8_t *togroup;// = (channel1 ? (channel2 ? NULL : &channel2) : &channel1); + togroup = &channel2; + + for (i = 0; i < num_outputs; i++) + { + if (entries[i].type != TYPE_GROUPED) + { + //printf("%d not grouped\n", i); + if (togroup) + { + *togroup |= ( 0x1 << entries[i].index); + } + entries[i].type = TYPE_GROUPED; + } + } + + if (channel1 > channel2) + { + uint8_t buff = channel1; + channel1 = channel2; + channel2 = buff; + } + + default_NVCAP[6] = channel1; + default_NVCAP[8] = channel2; + + // patching HEADS + for (i = 0; i < num_outputs; i++) + { + if (channel1 & (1 << i)) + { + *entries[i].heads = 1; + } + else if(channel2 & (1 << i)) + { + *entries[i].heads = 2; + } + } + return (has_lvds ? PATCH_ROM_SUCCESS_HAS_LVDS : PATCH_ROM_SUCCESS); +} + +static char *get_nvidia_model(uint32_t device_id, uint32_t subsys_id) +{ +// int i, j; + int i; +// static char name_model[128]; + + // First check in the plist, (for e.g this can override any hardcoded devices) + cardList_t * nvcard = FindCardWithIds(device_id, subsys_id); + if (nvcard) + { + if (nvcard->model) + { + return nvcard->model; + } + } + + // Then check the exceptions table + if (subsys_id) + { + for (i = 0; i < (sizeof(nvidia_card_exceptions) / sizeof(nvidia_card_exceptions[0])); i++) + { + if ((nvidia_card_exceptions[i].device == device_id) && + (nvidia_card_exceptions[i].subdev == subsys_id)) + { + return nvidia_card_exceptions[i].name; + } + } + } + + // At last try the generic names + for (i = 1; i < (sizeof(nvidia_card_generic) / sizeof(nvidia_card_generic[0])); i++) + { + if (nvidia_card_generic[i].device == device_id) + { +/* if (subsys_id) + { + for (j = 0; j < (sizeof(nvidia_card_vendors) / sizeof(nvidia_card_vendors[0])); j++) + { + if (nvidia_card_vendors[j].device == (subsys_id & 0xffff0000)) + { + sprintf(name_model, "%s %s", + nvidia_card_vendors[j].name, nvidia_card_generic[i].name); + name_model[sizeof(name_model) - 1] = '\0'; + return name_model; + } + } + } */ + return nvidia_card_generic[i].name; + } + } + return nvidia_card_generic[0].name; +} + +static uint32_t load_nvidia_bios_file(const char *filename, uint8_t **buf) +{ + int fd; + int size; + + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) + { + return 0; + } + + size = file_size(fd); + if(size) + { + *buf = malloc(size); + size = read(fd, (char *)buf, size); + } + close(fd); + + return size > 0 ? size : 0; +} + +static int devprop_add_nvidia_template(struct DevPropDevice *device) +{ + char tmp[16]; + + if (!device) + return 0; + + if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_0)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_0)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_name_0)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_1)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_1)) + return 0; + if (!DP_ADD_TEMP_VAL(device, nvidia_name_1)) + return 0; + if (devices_number == 1) + { + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type)) + return 0; + } + else + { + if (!DP_ADD_TEMP_VAL(device, nvidia_device_type_child)) + return 0; + } + + // Rek : Dont use sprintf return, it does not WORK !! our custom sprintf() always return 0! + // len = sprintf(tmp, "Slot-%x", devices_number); + sprintf(tmp, "Slot-%x",devices_number); + devprop_add_value(device, "AAPL,slot-name", (uint8_t *) tmp, strlen(tmp)); + devices_number++; + + return 1; +} + +int hex2bin(const char *hex, uint8_t *bin, int len) +{ + char *p; + int i; + char buf[3]; + + if (hex == NULL || bin == NULL || len <= 0 || strlen(hex) != len * 2) { + printf("[ERROR] bin2hex input error\n"); + return -1; + } + + buf[2] = '\0'; + p = (char *) hex; + + for (i = 0; i < len; i++) + { + if (p[0] == '\0' || p[1] == '\0' || !isxdigit(p[0]) || !isxdigit(p[1])) { + printf("[ERROR] bin2hex '%s' syntax error\n", hex); + return -2; + } + buf[0] = *p++; + buf[1] = *p++; + bin[i] = (unsigned char) strtoul(buf, NULL, 16); + } + return 0; +} + +unsigned long long mem_detect(volatile uint8_t *regs, uint8_t nvCardType, pci_dt_t *nvda_dev, uint32_t device_id, uint32_t subsys_id) +{ + unsigned long long vram_size = 0; + + // First check if any value exist in the plist + cardList_t * nvcard = FindCardWithIds(device_id, subsys_id); + if (nvcard) + { + if (nvcard->videoRam > 0) + { + vram_size = nvcard->videoRam * 1024 * 1024; + + return vram_size; + } + } + + // Then, Workaround for 9600M GT, GT 210/420/430/440/525M/540M & GTX 560M + switch (nvda_dev->device_id) + { + case 0x0647: // 9600M GT 0647 + vram_size = 512*1024*1024; // 512 MB + break; + case 0x0649: // 9600M GT 0649 + // 10DE06491043202D 1GB VRAM + if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x1043202D ) + { + vram_size = 1024*1024*1024; // 1 GB + } + break; + case 0x0A65: // GT 210 + case 0x0DE0: // GT 440 + case 0x0DE1: // GT 430 + case 0x0DE2: // GT 420 + case 0x0DEC: // GT 525M 0DEC + vram_size = 1024*1024*1024; // 1 GB + break; + case 0x0DE9: // GT 630M + // 10DE0DE9103C181D 1GB VRAM + if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x103C181D ) + { + vram_size = 1024*1024*1024; // 1 GB + } + break; + case 0x0DF4: // GT 540M + case 0x0DF5: // GT 525M 0DF5 + vram_size = 1024*1024*1024; // 1 GB + break; + case 0x11C6: // GTX650TI 11C6 + // 10DE11C61043842A 1GB VRAM + if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x1043842A ) + { + vram_size = 1024*1024*1024; // 1 GB + } + break; + case 0x1251: // GTX 560M + vram_size = 1536*1024*1024; // 1.5 GB + break; + default: + break; + } + + if (!vram_size) + { // Finally, if vram_size still not set do the calculation with our own method + if (nvCardType < NV_ARCH_50) + { + vram_size = REG32(NV04_PFB_FIFO_DATA); + vram_size &= NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK; + } + else if (nvCardType < NV_ARCH_C0) + { + vram_size = REG32(NV04_PFB_FIFO_DATA); + vram_size |= (vram_size & 0xff) << 32; + vram_size &= 0xffffffff00ll; + } + else // >= NV_ARCH_C0 + { + vram_size = REG32(NVC0_MEM_CTRLR_RAM_AMOUNT) << 20; + vram_size *= REG32(NVC0_MEM_CTRLR_COUNT); + } + } + + return vram_size; +} + +static bool checkNvRomSig(uint8_t * aRom){ + return aRom != NULL && (aRom[0] == 0x55 && aRom[1] == 0xaa); +} + +bool setup_nvidia_devprop(pci_dt_t *nvda_dev) +{ + struct DevPropDevice *device; + char *devicepath; + option_rom_pci_header_t *rom_pci_header; + volatile uint8_t *regs; + uint8_t *rom; + uint8_t *nvRom; + uint8_t nvCardType; + unsigned long long videoRam; + uint32_t nvBiosOveride; + uint32_t bar[7]; + uint32_t boot_display; + int nvPatch; + int len; + char biosVersion[32]; + char nvFilename[32]; + char kNVCAP[12]; + char *model; + const char *value; + bool doit; + + fill_card_list(); + + devicepath = get_pci_dev_path(nvda_dev); + bar[0] = pci_config_read32(nvda_dev->dev.addr, 0x10 ); + regs = (uint8_t *) (bar[0] & ~0x0f); + + // get card type + nvCardType = (REG32(0) >> 20) & 0x1ff; + + model = get_nvidia_model(((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id)); + + // Amount of VRAM in kilobytes + videoRam = mem_detect(regs, nvCardType, nvda_dev,((nvda_dev->vendor_id << 16) | nvda_dev->device_id),((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) ); + + sprintf(nvFilename, "/Extra/%04x_%04x.rom", (uint16_t)nvda_dev->vendor_id, + (uint16_t)nvda_dev->device_id); + + if (getBoolForKey(kUseNvidiaROM, &doit, &bootInfo->chameleonConfig) && doit) + { + verbose("Looking for nvidia video bios file %s\n", nvFilename); + nvBiosOveride = load_nvidia_bios_file(nvFilename, &rom); + + if (nvBiosOveride > 0) + { + verbose("Using nVidia Video BIOS File %s (%d Bytes)\n", nvFilename, nvBiosOveride); + DBG("%s Signature 0x%02x%02x %d bytes\n", nvFilename, rom[0], rom[1], nvBiosOveride); + } + else + { + printf("ERROR: unable to open nVidia Video BIOS File %s\n", nvFilename); + free(rom); + return false; + } + } + else + { + rom = malloc(NVIDIA_ROM_SIZE); + + // Otherwise read bios from card + nvBiosOveride = 0; + + // PROM first + // Enable PROM access + (REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED; + nvRom = (uint8_t*)®s[NV_PROM_OFFSET]; + + // Valid Signature ? + if (checkNvRomSig(nvRom)) + { + bcopy((uint8_t *)nvRom, rom, NVIDIA_ROM_SIZE); + DBG("PROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); + } + else + { + + // disable PROM access + (REG32(NV_PBUS_PCI_NV_20)) = NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED; + + //PRAM next + nvRom = (uint8_t*)®s[NV_PRAMIN_OFFSET]; + + if(checkNvRomSig(nvRom)) + { + bcopy((uint32_t *)nvRom, rom, NVIDIA_ROM_SIZE); + DBG("PRAM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); + } + else + { + // 0xC0000 last + bcopy((char *)0xc0000, rom, NVIDIA_ROM_SIZE); + + // Valid Signature ? + if (!checkNvRomSig(rom)) + { + printf("ERROR: Unable to locate nVidia Video BIOS\n"); + return false; + } + else + { + DBG("ROM Address 0x%x Signature 0x%02x%02x\n", nvRom, rom[0], rom[1]); + } + }//end PRAM check + }//end PROM check + }//end load rom from bios + + if ((nvPatch = patch_nvidia_rom(rom)) == PATCH_ROM_FAILED) + { + printf("ERROR: nVidia ROM Patching Failed!\n"); + //return false; + } + + rom_pci_header = (option_rom_pci_header_t*)(rom + *(uint16_t *)&rom[24]); + + // check for 'PCIR' sig + if (rom_pci_header->signature == 0x50434952) + { + if (rom_pci_header->device_id != nvda_dev->device_id) + { + // Get Model from the OpROM + model = get_nvidia_model(((rom_pci_header->vendor_id << 16) | rom_pci_header->device_id), 0); + + // Get VRAM again + videoRam = mem_detect(regs, nvCardType, nvda_dev, ((rom_pci_header->vendor_id << 16) | rom_pci_header->device_id), 0); + + } + else + { + printf("nVidia incorrect PCI ROM signature: 0x%x\n", rom_pci_header->signature); + } + } + + verbose("%s %dMB NV%02x [%04x:%04x]-[%04x:%04x] :: %s device number: %d\n", + model, (uint32_t)(videoRam / 1024 / 1024), + (REG32(0) >> 20) & 0x1ff, nvda_dev->vendor_id, nvda_dev->device_id, + nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id, + devicepath, devices_number); + + if (!string) { + string = devprop_create_string(); + } + device = devprop_add_device(string, devicepath); + + /* FIXME: for primary graphics card only */ + boot_display = 1; + if (devices_number == 1) + { + devprop_add_value(device, "@0,AAPL,boot-display", (uint8_t*)&boot_display, 4); + } + + if (nvPatch == PATCH_ROM_SUCCESS_HAS_LVDS) { + uint8_t built_in = 0x01; + devprop_add_value(device, "@0,built-in", &built_in, 1); + } + + // get bios version + const int MAX_BIOS_VERSION_LENGTH = 32; + char* version_str = (char*)malloc(MAX_BIOS_VERSION_LENGTH); + + memset(version_str, 0, MAX_BIOS_VERSION_LENGTH); + + int i, version_start; + int crlf_count = 0; + + // only search the first 384 bytes + for (i = 0; i < 0x180; i++) + { + if (rom[i] == 0x0D && rom[i+1] == 0x0A) + { + crlf_count++; + // second 0x0D0A was found, extract bios version + if (crlf_count == 2) + { + if (rom[i-1] == 0x20) i--; // strip last " " + + for (version_start = i; version_start > (i-MAX_BIOS_VERSION_LENGTH); version_start--) + { + // find start + if (rom[version_start] == 0x00) + { + version_start++; + + // strip "Version " + if (strncmp((const char*)rom+version_start, "Version ", 8) == 0) + { + version_start += 8; + } + + strncpy(version_str, (const char*)rom+version_start, i-version_start); + break; + } + } + break; + } + } + } + + sprintf(biosVersion, "%s", (nvBiosOveride > 0) ? nvFilename : version_str); + sprintf(kNVCAP, "NVCAP_%04x", nvda_dev->device_id); + + if (getValueForKey(kNVCAP, &value, &len, &bootInfo->chameleonConfig) && len == NVCAP_LEN * 2) + { + uint8_t new_NVCAP[NVCAP_LEN]; + + if (hex2bin(value, new_NVCAP, NVCAP_LEN) == 0) + { + verbose("Using user supplied NVCAP for %s :: %s\n", model, devicepath); + memcpy(default_NVCAP, new_NVCAP, NVCAP_LEN); + } + } + + if (getValueForKey(kDcfg0, &value, &len, &bootInfo->chameleonConfig) && len == DCFG0_LEN * 2) + { + uint8_t new_dcfg0[DCFG0_LEN]; + + if (hex2bin(value, new_dcfg0, DCFG0_LEN) == 0) + { + memcpy(default_dcfg_0, new_dcfg0, DCFG0_LEN); + + verbose("Using user supplied @0,display-cfg\n"); + printf("@0,display-cfg: %02x%02x%02x%02x\n", + default_dcfg_0[0], default_dcfg_0[1], default_dcfg_0[2], default_dcfg_0[3]); + } + } + + if (getValueForKey(kDcfg1, &value, &len, &bootInfo->chameleonConfig) && len == DCFG1_LEN * 2) + { + uint8_t new_dcfg1[DCFG1_LEN]; + + if (hex2bin(value, new_dcfg1, DCFG1_LEN) == 0) + { + memcpy(default_dcfg_1, new_dcfg1, DCFG1_LEN); + + verbose("Using user supplied @1,display-cfg\n"); + printf("@1,display-cfg: %02x%02x%02x%02x\n", + default_dcfg_1[0], default_dcfg_1[1], default_dcfg_1[2], default_dcfg_1[3]); + } + } + +#if DEBUG_NVCAP + printf("NVCAP: %02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x\n", + default_NVCAP[0], default_NVCAP[1], default_NVCAP[2], default_NVCAP[3], + default_NVCAP[4], default_NVCAP[5], default_NVCAP[6], default_NVCAP[7], + default_NVCAP[8], default_NVCAP[9], default_NVCAP[10], default_NVCAP[11], + default_NVCAP[12], default_NVCAP[13], default_NVCAP[14], default_NVCAP[15], + default_NVCAP[16], default_NVCAP[17], default_NVCAP[18], default_NVCAP[19]); +#endif + + devprop_add_nvidia_template(device); + devprop_add_value(device, "NVCAP", default_NVCAP, NVCAP_LEN); + devprop_add_value(device, "NVPM", default_NVPM, NVPM_LEN); + devprop_add_value(device, "VRAM,totalsize", (uint8_t*)&videoRam, 4); + devprop_add_value(device, "model", (uint8_t*)model, strlen(model) + 1); + devprop_add_value(device, "rom-revision", (uint8_t*)biosVersion, strlen(biosVersion) + 1); + devprop_add_value(device, "@0,display-cfg", default_dcfg_0, DCFG0_LEN); + devprop_add_value(device, "@1,display-cfg", default_dcfg_1, DCFG1_LEN); + + if (getBoolForKey(kVBIOS, &doit, &bootInfo->chameleonConfig) && doit) + { + devprop_add_value(device, "vbios", rom, (nvBiosOveride > 0) ? nvBiosOveride : (rom[2] * 512)); + } + + //add HDMI Audio back to nvidia + doit = false; + //http://forge.voodooprojects.org/p/chameleon/issues/67/ + if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit) + { + static uint8_t connector_type_1[]= {0x00, 0x08, 0x00, 0x00}; + devprop_add_value(device, "@1,connector-type",connector_type_1, 4); + } + //end Nvidia HDMI Audio + + stringdata = malloc(sizeof(uint8_t) * string->length); + memcpy(stringdata, (uint8_t*)devprop_generate_string(string), string->length); + stringlength = string->length; + + free(rom); + return true; +} diff --git a/i386/libsaio/nvidia.h b/i386/libsaio/nvidia.h new file mode 100644 index 0000000..d894347 --- /dev/null +++ b/i386/libsaio/nvidia.h @@ -0,0 +1,148 @@ +/* + * NVidia injector + * + * Copyright (C) 2009 Jasmin Fazlic, iNDi + * + * NVidia injector modified by Fabio (ErmaC) on May 2012, + * for allow the cosmetics injection also based on SubVendorID and SubDeviceID. + * + * NVidia injector is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * NVidia driver and injector is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with NVidia injector. If not, see <http://www.gnu.org/licenses/>. + * + * Alternatively you can choose to comply with APSL + * + * DCB-Table parsing is based on software (nouveau driver) originally distributed under following license: + * + * + * Copyright 2005-2006 Erik Waling + * Copyright 2006 Stephane Marchesin + * Copyright 2007-2009 Stuart Bennett + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef __LIBSAIO_NVIDIA_H +#define __LIBSAIO_NVIDIA_H + +bool setup_nvidia_devprop(pci_dt_t *nvda_dev); + +typedef struct { + uint32_t device; // VendorID + DeviceID + char *name; +} nvidia_pci_info_t; + +typedef struct { + uint32_t device; // VendorID + DeviceID + uint32_t subdev; // SubdeviceID + SubvendorID + char *name; + //bool kEnableHDMIAudio // HDMi + //VRAM +} nvidia_card_info_t; + +#define DCB_MAX_NUM_ENTRIES 16 +#define DCB_MAX_NUM_I2C_ENTRIES 16 + +#define DCB_LOC_ON_CHIP 0 + +struct bios { + uint16_t signature; /* 0x55AA */ + uint8_t size; /* Size in multiples of 512 */ +}; + +#define NV_PMC_OFFSET 0x000000 +#define NV_PMC_SIZE 0x2ffff +#define NV_PDISPLAY_OFFSET 0x610000 +#define NV_PDISPLAY_SIZE 0x10000 + +#define NV_PROM_OFFSET 0x300000 +#define NV_PROM_SIZE 0x0000ffff +#define NV_PRAMIN_OFFSET 0x00700000 +#define NV_PRAMIN_SIZE 0x00100000 +#define NV04_PFB_FIFO_DATA 0x0010020c +#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK 0xfff00000 +#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_SHIFT 20 +#define NVC0_MEM_CTRLR_COUNT 0x00121c74 +#define NVC0_MEM_CTRLR_RAM_AMOUNT 0x0010f20c + +#define NV_PBUS_PCI_NV_20 0x00001850 +#define NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED (0 << 0) +#define NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED (1 << 0) + +#define REG8(reg) ((volatile uint8_t *)regs)[(reg)] +#define REG16(reg) ((volatile uint16_t *)regs)[(reg) >> 1] +#define REG32(reg) ((volatile uint32_t *)regs)[(reg) >> 2] + +#define NV_ARCH_03 0x03 +#define NV_ARCH_04 0x04 +#define NV_ARCH_10 0x10 +#define NV_ARCH_20 0x20 +#define NV_ARCH_30 0x30 +#define NV_ARCH_40 0x40 +#define NV_ARCH_50 0x50 +#define NV_ARCH_C0 0xC0 + +#define CHIPSET_NV03 0x0010 +#define CHIPSET_NV04 0x0020 +#define CHIPSET_NV10 0x0100 +#define CHIPSET_NV11 0x0110 +#define CHIPSET_NV15 0x0150 +#define CHIPSET_NV17 0x0170 +#define CHIPSET_NV18 0x0180 +#define CHIPSET_NFORCE 0x01A0 +#define CHIPSET_NFORCE2 0x01F0 +#define CHIPSET_NV20 0x0200 +#define CHIPSET_NV25 0x0250 +#define CHIPSET_NV28 0x0280 +#define CHIPSET_NV30 0x0300 +#define CHIPSET_NV31 0x0310 +#define CHIPSET_NV34 0x0320 +#define CHIPSET_NV35 0x0330 +#define CHIPSET_NV36 0x0340 +#define CHIPSET_NV40 0x0040 +#define CHIPSET_NV41 0x00C0 +#define CHIPSET_NV43 0x0140 +#define CHIPSET_NV44 0x0160 +#define CHIPSET_NV44A 0x0220 +#define CHIPSET_NV45 0x0210 +#define CHIPSET_NV50 0x0190 +#define CHIPSET_NV84 0x0400 +#define CHIPSET_MISC_BRIDGED 0x00F0 +#define CHIPSET_G70 0x0090 +#define CHIPSET_G71 0x0290 +#define CHIPSET_G72 0x01D0 +#define CHIPSET_G73 0x0390 + +// integrated GeForces (6100, 6150) +#define CHIPSET_C51 0x0240 + +// variant of C51, seems based on a G70 design +#define CHIPSET_C512 0x03D0 +#define CHIPSET_G73_BRIDGED 0x02E0 + +#endif /* !__LIBSAIO_NVIDIA_H */ diff --git a/i386/libsaio/nvidia_helper.c b/i386/libsaio/nvidia_helper.c new file mode 100644 index 0000000..bb6f5f4 --- /dev/null +++ b/i386/libsaio/nvidia_helper.c @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "xml.h" +#include "nvidia_helper.h" +#include "pci.h" +#include "nvidia.h" + +/* + + NVIDIA card injection usage e.g (to be placed in the boot.plist): + + <key>NVIDIA</key> + <array> + <dict> + <key>Chipset Name</key> + <string>Quadro FX 380</string> + <key>IOPCIPrimaryMatch</key> + <string>0x10DE0658</string> + <key>VRam Size</key> + <string>256</string> + </dict> + <dict> + <key>Chipset Name</key> + <string>YOUR_CARD_NAME</string> + <key>IOPCIPrimaryMatch</key> + <string>YOUR_CARD_ID</string> + <key>IOPCISubDevId</key> + <string>YOUR_CARD_SUB_ID(if necessary)</string> + <key>VRam Size</key> + <string>YOUR_CARD_VRAM_SIZE</string> + </dict> + <dict> + <key>Chipset Name</key> + <string>YOUR_SECOND_CARD_NAME</string> + <key>IOPCIPrimaryMatch</key> + <string>YOUR_SECOND_CARD_ID</string> + <key>IOPCISubDevId</key> + <string>YOUR_SECOND_CARD_SUB_ID(if necessary)</string> + <key>VRam Size</key> + <string>YOUR_SECOND_CARD_VRAM_SIZE</string> + </dict> + . + . + . + . + </array> + + */ + +cardList_t* cardList = NULL; + +void add_card(char* model, uint32_t id, uint32_t subid, uint64_t videoRam) +{ + + cardList_t* new_card = malloc(sizeof(cardList_t)); + if (new_card) + { + new_card->next = cardList; + + cardList = new_card; + + new_card->id = id; + new_card->subid = subid; + new_card->videoRam = videoRam; + new_card->model = model; + } +} + +cardList_t* FindCardWithIds(uint32_t id, uint32_t subid) +{ + cardList_t* entry = cardList; + while(entry) + { + if((entry->id == id) && (entry->subid == subid)) + { + return entry; + } + else + { + entry = entry->next; + } + + } + + // LET A SECOND CHANCE by seaching only for the device-id + entry = cardList; + while(entry) + { + if(entry->id == id) + { + return entry; + } + else + { + entry = entry->next; + } + + } + + return NULL; +} + +void fill_card_list(void) +{ + unsigned int i, count; + TagPtr NVDIATag; + char *model_name = NULL, *match_id = NULL, *sub_id = NULL, *vram_size = NULL; + uint32_t dev_id = 0, subdev_id = 0; + uint64_t VramSize = 0; + + if ((NVDIATag = XMLCastArray(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"NVIDIA")))) + { + count = XMLTagCount(NVDIATag); + + for (i=0; i<count; i++) + { + TagPtr element = XMLGetElement( NVDIATag, i ); + if (element) + { + match_id = XMLCastString(XMLGetProperty(element, (const char*)"IOPCIPrimaryMatch")); //device-id + sub_id = XMLCastString(XMLGetProperty(element, (const char*)"IOPCISubDevId")); //sub device-id + model_name = XMLCastString(XMLGetProperty(element, (const char*)"Chipset Name")); + vram_size = XMLCastString(XMLGetProperty(element, (const char*)"VRam Size")); + + if (match_id) { + dev_id = strtoul(match_id, NULL, 16); + } + + if (sub_id) { + subdev_id = strtoul(sub_id, NULL, 16); + } + + if (vram_size) { + VramSize = strtoul(vram_size, NULL, 10); + } + + add_card(model_name, dev_id, subdev_id, VramSize); + } + } + } +} diff --git a/i386/libsaio/nvidia_helper.h b/i386/libsaio/nvidia_helper.h new file mode 100644 index 0000000..f502194 --- /dev/null +++ b/i386/libsaio/nvidia_helper.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + + +#ifndef __LIBSAIO_NVIDIA_HELPER_H +#define __LIBSAIO_NVIDIA_HELPER_H + +typedef struct cardList_t +{ + char* model; + uint32_t id; + uint32_t subid; + uint64_t videoRam; + struct cardList_t* next; +} cardList_t; + +void add_card(char* model, uint32_t id, uint32_t subid, uint64_t videoRam); +void fill_card_list(void); +cardList_t* FindCardWithIds(uint32_t id, uint32_t subid); + +#endif //__LIBSAIO_NVIDIA_HELPER_H \ No newline at end of file diff --git a/i386/libsaio/openbsd.c b/i386/libsaio/openbsd.c new file mode 100644 index 0000000..dea35f0 --- /dev/null +++ b/i386/libsaio/openbsd.c @@ -0,0 +1,32 @@ +#include "libsaio.h" +#include "sl.h" +#include "openbsd.h" + +#define OpenBSDProbeSize 2048 + +bool OpenBSDProbe (const void *buf) +{ + return (OSReadLittleInt32(buf+0x200,0)==0x82564557); +} +void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen) +{ + char * buf=malloc(OpenBSDProbeSize); + str[0]=0; + if (!buf) + return; + Seek(ih, 0); + Read(ih, (long)buf, OpenBSDProbeSize); + if (!OpenBSDProbe (buf)) + { + free (buf); + return; + } + if (OSReadLittleInt32 (buf+0x44c,0)<1) + { + free (buf); + return; + } + str[strMaxLen]=0; + strncpy (str, buf+0x478, MIN (strMaxLen, 32)); + free (buf); +} diff --git a/i386/libsaio/openbsd.h b/i386/libsaio/openbsd.h new file mode 100644 index 0000000..6d4eedb --- /dev/null +++ b/i386/libsaio/openbsd.h @@ -0,0 +1,2 @@ +extern bool OpenBSDProbe (const void *buf); +extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen); \ No newline at end of file diff --git a/i386/libsaio/pci.c b/i386/libsaio/pci.c new file mode 100644 index 0000000..d66196f --- /dev/null +++ b/i386/libsaio/pci.c @@ -0,0 +1,191 @@ +/* + * + * Copyright 2008 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "pci.h" +#include "pci_root.h" + +#ifndef DEBUG_PCI +#define DEBUG_PCI 0 +#endif + +#if DEBUG_PCI +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +pci_dt_t *root_pci_dev; + + +uint8_t pci_config_read8(uint32_t pci_addr, uint8_t reg) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + return inb(PCI_DATA_REG + (reg & 3)); +} + +uint16_t pci_config_read16(uint32_t pci_addr, uint8_t reg) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + return inw(PCI_DATA_REG + (reg & 2)); +} + +uint32_t pci_config_read32(uint32_t pci_addr, uint8_t reg) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + return inl(PCI_DATA_REG); +} + +void pci_config_write8(uint32_t pci_addr, uint8_t reg, uint8_t data) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + outb(PCI_DATA_REG + (reg & 3), data); +} + +void pci_config_write16(uint32_t pci_addr, uint8_t reg, uint16_t data) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + outw(PCI_DATA_REG + (reg & 2), data); +} + +void pci_config_write32(uint32_t pci_addr, uint8_t reg, uint32_t data) +{ + pci_addr |= reg & ~3; + outl(PCI_ADDR_REG, pci_addr); + outl(PCI_DATA_REG, data); +} + +void scan_pci_bus(pci_dt_t *start, uint8_t bus) +{ + pci_dt_t *new; + pci_dt_t **current = &start->children; + uint32_t id; + uint32_t pci_addr; + uint8_t dev = 0; + uint8_t func = 0; + uint8_t secondary_bus; + uint8_t header_type; + + for (dev = 0; dev < 32; dev++) { + for (func = 0; func < 8; func++) { + pci_addr = PCIADDR(bus, dev, func); + id = pci_config_read32(pci_addr, PCI_VENDOR_ID); + if (!id || id == 0xffffffff) { + continue; + } + new = (pci_dt_t*)malloc(sizeof(pci_dt_t)); + bzero(new, sizeof(pci_dt_t)); + new->dev.addr = pci_addr; + new->vendor_id = id & 0xffff; + new->device_id = (id >> 16) & 0xffff; + new->progif = pci_config_read8(pci_addr, PCI_CLASS_PROG); + new->revision_id = pci_config_read8(pci_addr, PCI_CLASS_REVISION); + new->subsys_id.subsys_id = pci_config_read32(pci_addr, PCI_SUBSYSTEM_VENDOR_ID); + new->class_id = pci_config_read16(pci_addr, PCI_CLASS_DEVICE); + new->parent = start; + + header_type = pci_config_read8(pci_addr, PCI_HEADER_TYPE); + switch (header_type & 0x7f) { + case PCI_HEADER_TYPE_BRIDGE: + case PCI_HEADER_TYPE_CARDBUS: + secondary_bus = pci_config_read8(pci_addr, PCI_SECONDARY_BUS); + if (secondary_bus != 0) { + scan_pci_bus(new, secondary_bus); + } + break; + } + *current = new; + current = &new->next; + + if ((func == 0) && ((header_type & 0x80) == 0)) { + break; + } + } + } +} + +void enable_pci_devs(void) +{ + uint16_t id; + uint32_t rcba, *fd; + + id = pci_config_read16(PCIADDR(0, 0x00, 0), 0x00); + /* make sure we're on Intel chipset */ + if (id != 0x8086) + return; + rcba = pci_config_read32(PCIADDR(0, 0x1f, 0), 0xf0) & ~1; + fd = (uint32_t *)(rcba + 0x3418); + /* set SMBus Disable (SD) to 0 */ + *fd &= ~0x8; + /* and all devices? */ + //*fd = 0x1; +} + + +void build_pci_dt(void) +{ + root_pci_dev = malloc(sizeof(pci_dt_t)); + bzero(root_pci_dev, sizeof(pci_dt_t)); + enable_pci_devs(); + scan_pci_bus(root_pci_dev, 0); + +#if DEBUG_PCI + dump_pci_dt(root_pci_dev->children); + pause(); +#endif +} + +static char dev_path[256]; +char *get_pci_dev_path(pci_dt_t *pci_dt) +{ + pci_dt_t *current; + pci_dt_t *end; + char tmp[64]; + + dev_path[0] = 0; + end = root_pci_dev; + + int uid = getPciRootUID(); + while (end != pci_dt) + { + current = pci_dt; + while (current->parent != end) + current = current->parent; + end = current; + if (current->parent == root_pci_dev) + { + sprintf(tmp, "PciRoot(0x%x)/Pci(0x%x,0x%x)", uid, + current->dev.bits.dev, current->dev.bits.func); + } else { + sprintf(tmp, "/Pci(0x%x,0x%x)", + current->dev.bits.dev, current->dev.bits.func); + } + strcat(dev_path, tmp); + } + return dev_path; +} + +void dump_pci_dt(pci_dt_t *pci_dt) +{ + pci_dt_t *current; + + current = pci_dt; + while (current) { + printf("%02x:%02x.%x [%04x%02x] [%04x:%04x] (subsys [%04x:%04x]):: %s\n", + current->dev.bits.bus, current->dev.bits.dev, current->dev.bits.func, + current->class_id, current->vendor_id, current->device_id, + current->subsys_id.subsys.vendor_id, current->subsys_id.subsys.device_id, + get_pci_dev_path(current)); + dump_pci_dt(current->children); + current = current->next; + } +} diff --git a/i386/libsaio/pci.h b/i386/libsaio/pci.h new file mode 100644 index 0000000..2e569c1 --- /dev/null +++ b/i386/libsaio/pci.h @@ -0,0 +1,947 @@ +/* + * + * Copyright 2008 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#ifndef __LIBSAIO_PCI_H +#define __LIBSAIO_PCI_H + +/* + * 31 24 16 15 11 10 8 + * +---------------------------------------------------------------+ + * |1| 0 | BUS | DEV |FUNC | 0 | + * +---------------------------------------------------------------+ + */ + +typedef struct { + uint32_t :2; + uint32_t reg :6; + uint32_t func:3; + uint32_t dev :5; + uint32_t bus :8; + uint32_t :7; + uint32_t eb :1; +} pci_addr_t; + +typedef union { + pci_addr_t bits; + uint32_t addr; +} pci_dev_t; + +typedef struct pci_dt_t { + pci_dev_t dev; + + uint16_t vendor_id; /* Specifies a vendor ID. The PCI bus configuration code obtains this + vendor ID from the vendor ID device register. */ + uint16_t device_id; /* Specifies a device ID that identifies the specific device. The PCI + bus configuration code obtains this device ID from the device ID + device register. */ + + union { + struct { + uint16_t vendor_id; /* Specifies a subsystem vendor ID. */ + uint16_t device_id; /* Specifies a subsystem device ID that identifies the specific device. */ + } subsys; + uint32_t subsys_id; + } subsys_id; + + uint8_t progif; /* A read-only register that specifies a register-level programming interface the device has, if it has any at all. */ + + uint8_t revision_id; /* PCI revision ID. Specifies a revision identifier for a particular device. Where valid IDs are allocated by the vendor. */ + + uint16_t class_id; /* Specifies a class code. This member is a data structure that stores information related to the device's class code device register. */ + + struct pci_dt_t *parent; + struct pci_dt_t *children; + struct pci_dt_t *next; +} pci_dt_t; + +#define PCIADDR(bus, dev, func) ((1 << 31) | (bus << 16) | (dev << 11) | (func << 8)) +#define PCI_ADDR_REG 0xcf8 +#define PCI_DATA_REG 0xcfc + +extern pci_dt_t *root_pci_dev; +extern uint8_t pci_config_read8(uint32_t, uint8_t); +extern uint16_t pci_config_read16(uint32_t, uint8_t); +extern uint32_t pci_config_read32(uint32_t, uint8_t); +extern void pci_config_write8(uint32_t, uint8_t, uint8_t); +extern void pci_config_write16(uint32_t, uint8_t, uint16_t); +extern void pci_config_write32(uint32_t, uint8_t, uint32_t); +extern char *get_pci_dev_path(pci_dt_t *); +extern void build_pci_dt(void); +extern void dump_pci_dt(pci_dt_t *); + +/* Option ROM header */ +typedef struct { + uint16_t signature; // 0xAA55 + uint8_t rom_size; + uint32_t entry_point; + uint8_t reserved[15]; + uint16_t pci_header_offset; + uint16_t expansion_header_offset; +} option_rom_header_t; + +/* Option ROM PCI Data Structure */ +typedef struct { + uint32_t signature; // ati - 0x52494350, nvidia - 0x50434952, 'PCIR' + uint16_t vendor_id; + uint16_t device_id; + uint16_t vital_product_data_offset; + uint16_t structure_length; + uint8_t structure_revision; + uint8_t class_code[3]; + uint16_t image_length; + uint16_t image_revision; + uint8_t code_type; + uint8_t indicator; + uint16_t reserved; +} option_rom_pci_header_t; + +//----------------------------------------------------------------------------- +// added by iNDi + +typedef struct { + uint32_t signature; // 0x24506E50 '$PnP' + uint8_t revision; // 1 + uint8_t length; + uint16_t offset; + uint8_t checksum; + uint32_t identifier; + uint16_t manufacturer; + uint16_t product; + uint8_t class[3]; + uint8_t indicators; + uint16_t boot_vector; + uint16_t disconnect_vector; + uint16_t bootstrap_vector; + uint16_t reserved; + uint16_t resource_vector; +} option_rom_pnp_header_t; + +/* + * Under PCI, each device has 256 bytes of configuration address space, + * of which the first 64 bytes are standardized as follows: + * + * register name offset + *******************************************************/ +#define PCI_VENDOR_ID 0x00 /* 16 bits */ +#define PCI_DEVICE_ID 0x02 /* 16 bits */ +#define PCI_COMMAND 0x04 /* 16 bits */ +#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ +#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ +#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ +#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ +#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ +#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ +#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ +#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ +#define PCI_COMMAND_SERR 0x100 /* Enable SERR */ +#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ +#define PCI_COMMAND_DISABLE_INTx 0x400 /* PCIE: Disable INTx interrupts */ + +#define PCI_STATUS 0x06 /* 16 bits */ +#define PCI_STATUS_INTx 0x08 /* PCIE: INTx interrupt pending */ +#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ +#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ +#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ +#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ +#define PCI_STATUS_PARITY 0x100 /* Detected parity error */ +#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ +#define PCI_STATUS_DEVSEL_FAST 0x000 +#define PCI_STATUS_DEVSEL_MEDIUM 0x200 +#define PCI_STATUS_DEVSEL_SLOW 0x400 +#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ +#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ +#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ +#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ +#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ + +#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */ +#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface know also as PCI_PROG_IF */ +#define PCI_CLASS_DEVICE 0x0a /* Device subclass */ +//#define PCI_SUBCLASS_DEVICE 0x0b /* Device class */ + +#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ +#define PCI_LATENCY_TIMER 0x0d /* 8 bits */ +#define PCI_HEADER_TYPE 0x0e /* 8 bits */ +#define PCI_HEADER_TYPE_NORMAL 0 +#define PCI_HEADER_TYPE_BRIDGE 1 +#define PCI_HEADER_TYPE_CARDBUS 2 + +#define PCI_BIST 0x0f /* 8 bits */ +#define PCI_BIST_CODE_MASK 0x0f /* Return result */ +#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ +#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ + +/* + * Base addresses specify locations in memory or I/O space. + * Decoded size can be determined by writing a value of + * 0xffffffff to the register, and reading it back. Only + * 1 bits are decoded. + */ +#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ +#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ +#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ +#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ +#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ +#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ +#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ +#define PCI_BASE_ADDRESS_SPACE_IO 0x01 +#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 +#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 +#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ +#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ +#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ +#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ +#define PCI_BASE_ADDRESS_MEM_MASK (~(pciaddr_t)0x0f) +#define PCI_BASE_ADDRESS_IO_MASK (~(pciaddr_t)0x03) +/* bit 1 is reserved if address_space = 1 */ + +/* Header type 0 (normal devices) */ +#define PCI_CARDBUS_CIS 0x28 +#define PCI_SUBSYSTEM_VENDOR_ID 0x2c +#define PCI_SUBSYSTEM_ID 0x2e +#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ +#define PCI_ROM_ADDRESS_ENABLE 0x01 +#define PCI_ROM_ADDRESS_MASK (~(pciaddr_t)0x7ff) + +#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ + +/* 0x35-0x3b are reserved */ +#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ +#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ +#define PCI_MIN_GNT 0x3e /* 8 bits */ +#define PCI_MAX_LAT 0x3f /* 8 bits */ + +/* Header type 1 (PCI-to-PCI bridges) */ +#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ +#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ +#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ +#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ +#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ +#define PCI_IO_LIMIT 0x1d +#define PCI_IO_RANGE_TYPE_MASK 0x0f /* I/O bridging type */ +#define PCI_IO_RANGE_TYPE_16 0x00 +#define PCI_IO_RANGE_TYPE_32 0x01 +#define PCI_IO_RANGE_MASK ~0x0f +#define PCI_SEC_STATUS 0x1e /* Secondary status register */ +#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ +#define PCI_MEMORY_LIMIT 0x22 +#define PCI_MEMORY_RANGE_TYPE_MASK 0x0f +#define PCI_MEMORY_RANGE_MASK ~0x0f +#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ +#define PCI_PREF_MEMORY_LIMIT 0x26 +#define PCI_PREF_RANGE_TYPE_MASK 0x0f +#define PCI_PREF_RANGE_TYPE_32 0x00 +#define PCI_PREF_RANGE_TYPE_64 0x01 +#define PCI_PREF_RANGE_MASK ~0x0f +#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ +#define PCI_PREF_LIMIT_UPPER32 0x2c +#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ +#define PCI_IO_LIMIT_UPPER16 0x32 +/* 0x34 same as for htype 0 */ +/* 0x35-0x3b is reserved */ +#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_BRIDGE_CONTROL 0x3e +#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ +#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ +#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ +#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ +#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ +#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ +#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ +#define PCI_BRIDGE_CTL_PRI_DISCARD_TIMER 0x100 /* PCI-X? */ +#define PCI_BRIDGE_CTL_SEC_DISCARD_TIMER 0x200 /* PCI-X? */ +#define PCI_BRIDGE_CTL_DISCARD_TIMER_STATUS 0x400 /* PCI-X? */ +#define PCI_BRIDGE_CTL_DISCARD_TIMER_SERR_EN 0x800 /* PCI-X? */ + +/* Header type 2 (CardBus bridges) */ +/* 0x14-0x15 reserved */ +#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ +#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ +#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ +#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ +#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ +#define PCI_CB_MEMORY_BASE_0 0x1c +#define PCI_CB_MEMORY_LIMIT_0 0x20 +#define PCI_CB_MEMORY_BASE_1 0x24 +#define PCI_CB_MEMORY_LIMIT_1 0x28 +#define PCI_CB_IO_BASE_0 0x2c +#define PCI_CB_IO_BASE_0_HI 0x2e +#define PCI_CB_IO_LIMIT_0 0x30 +#define PCI_CB_IO_LIMIT_0_HI 0x32 +#define PCI_CB_IO_BASE_1 0x34 +#define PCI_CB_IO_BASE_1_HI 0x36 +#define PCI_CB_IO_LIMIT_1 0x38 +#define PCI_CB_IO_LIMIT_1_HI 0x3a +#define PCI_CB_IO_RANGE_MASK ~0x03 +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_CB_BRIDGE_CONTROL 0x3e +#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ +#define PCI_CB_BRIDGE_CTL_SERR 0x02 +#define PCI_CB_BRIDGE_CTL_ISA 0x04 +#define PCI_CB_BRIDGE_CTL_VGA 0x08 +#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 +#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ +#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ +#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ +#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 +#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 +#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 +#define PCI_CB_SUBSYSTEM_ID 0x42 +#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ +/* 0x48-0x7f reserved */ + +/* Capability Identification Numbers list */ +#define PCI_CAP_LIST_ID 0 /* Capability ID */ +#define PCI_CAP_ID_PM 0x01 /* Power Management */ +#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ +#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ +#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ +#define PCI_CAP_ID_MSI 0x05 /* Message Signaled Interrupts */ +#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ +#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ +#define PCI_CAP_ID_HT 0x08 /* HyperTransport */ +#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */ +#define PCI_CAP_ID_DBG 0x0A /* Debug port */ +#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */ +#define PCI_CAP_ID_HOTPLUG 0x0C /* PCI hot-plug */ +#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ +#define PCI_CAP_ID_AGP3 0x0E /* AGP 8x */ +#define PCI_CAP_ID_SECURE 0x0F /* Secure device (?) */ +#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ +#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ +#define PCI_CAP_ID_SATA 0x12 /* Serial-ATA HBA */ +#define PCI_CAP_ID_AF 0x13 /* Advanced features of PCI devices integrated in PCIe root cplx */ +#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ +#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ +#define PCI_CAP_SIZEOF 4 + +/* Capabilities residing in the + PCI Express extended configuration space */ +#define PCI_EXT_CAP_ID_AER 0x01 /* Advanced Error Reporting */ +#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel */ +#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ +#define PCI_EXT_CAP_ID_PB 0x04 /* Power Budgeting */ +#define PCI_EXT_CAP_ID_RCLINK 0x05 /* Root Complex Link Declaration */ +#define PCI_EXT_CAP_ID_RCILINK 0x06 /* Root Complex Internal Link Declaration */ +#define PCI_EXT_CAP_ID_RCECOLL 0x07 /* Root Complex Event Collector */ +#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function Virtual Channel */ +#define PCI_EXT_CAP_ID_RBCB 0x0a /* Root Bridge Control Block */ +#define PCI_EXT_CAP_ID_VNDR 0x0b /* Vendor specific */ +#define PCI_EXT_CAP_ID_ACS 0x0d /* Access Controls */ +#define PCI_EXT_CAP_ID_ARI 0x0e /* Alternative Routing-ID Interpretation */ +#define PCI_EXT_CAP_ID_ATS 0x0f /* Address Translation Service */ +#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */ + +/* Power Management Registers */ +#define PCI_PM_CAP_VER_MASK 0x0007 /* Version (2=PM1.1) */ +#define PCI_PM_CAP_PME_CLOCK 0x0008 /* Clock required for PME generation */ +#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization required */ +#define PCI_PM_CAP_AUX_C_MASK 0x01c0 /* Maximum aux current required in D3cold */ +#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */ +#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */ +#define PCI_PM_CAP_PME_D0 0x0800 /* PME can be asserted from D0 */ +#define PCI_PM_CAP_PME_D1 0x1000 /* PME can be asserted from D1 */ +#define PCI_PM_CAP_PME_D2 0x2000 /* PME can be asserted from D2 */ +#define PCI_PM_CAP_PME_D3_HOT 0x4000 /* PME can be asserted from D3hot */ +#define PCI_PM_CAP_PME_D3_COLD 0x8000 /* PME can be asserted from D3cold */ +#define PCI_PM_CTRL 4 /* PM control and status register */ +#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ +#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ +#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* PM table data index */ +#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* PM table data scaling factor */ +#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */ +#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions */ +#define PCI_PM_PPB_B2_B3 0x40 /* If bridge enters D3hot, bus enters: 0=B3, 1=B2 */ +#define PCI_PM_BPCC_ENABLE 0x80 /* Secondary bus is power managed */ +#define PCI_PM_DATA_REGISTER 7 /* PM table contents read here */ +#define PCI_PM_SIZEOF 8 + +/* AGP registers */ +#define PCI_AGP_VERSION 2 /* BCD version number */ +#define PCI_AGP_RFU 3 /* Rest of capability flags */ +#define PCI_AGP_STATUS 4 /* Status register */ +#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ +#define PCI_AGP_STATUS_ISOCH 0x10000 /* Isochronous transactions supported */ +#define PCI_AGP_STATUS_ARQSZ_MASK 0xe000 /* log2(optimum async req size in bytes) - 4 */ +#define PCI_AGP_STATUS_CAL_MASK 0x1c00 /* Calibration cycle timing */ +#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ +#define PCI_AGP_STATUS_ITA_COH 0x0100 /* In-aperture accesses always coherent */ +#define PCI_AGP_STATUS_GART64 0x0080 /* 64-bit GART entries supported */ +#define PCI_AGP_STATUS_HTRANS 0x0040 /* If 0, core logic can xlate host CPU accesses thru aperture */ +#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing cycles supported */ +#define PCI_AGP_STATUS_FW 0x0010 /* Fast write transfers supported */ +#define PCI_AGP_STATUS_AGP3 0x0008 /* AGP3 mode supported */ +#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported (RFU in AGP3 mode) */ +#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported (8x in AGP3 mode) */ +#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported (4x in AGP3 mode) */ +#define PCI_AGP_COMMAND 8 /* Control register */ +#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ +#define PCI_AGP_COMMAND_ARQSZ_MASK 0xe000 /* log2(optimum async req size in bytes) - 4 */ +#define PCI_AGP_COMMAND_CAL_MASK 0x1c00 /* Calibration cycle timing */ +#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ +#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ +#define PCI_AGP_COMMAND_GART64 0x0080 /* 64-bit GART entries enabled */ +#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow generation of 64-bit addr cycles */ +#define PCI_AGP_COMMAND_FW 0x0010 /* Enable FW transfers */ +#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate (RFU in AGP3 mode) */ +#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate (8x in AGP3 mode) */ +#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate (4x in AGP3 mode) */ +#define PCI_AGP_SIZEOF 12 + +/* Vital Product Data */ +#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */ +#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ +#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ +#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ + +/* Slot Identification */ +#define PCI_SID_ESR 2 /* Expansion Slot Register */ +#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ +#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */ +#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */ + +/* Message Signaled Interrupts registers */ +#define PCI_MSI_FLAGS 2 /* Various flags */ +#define PCI_MSI_FLAGS_MASK_BIT 0x100 /* interrupt masking & reporting supported */ +#define PCI_MSI_FLAGS_64BIT 0x080 /* 64-bit addresses allowed */ +#define PCI_MSI_FLAGS_QSIZE 0x070 /* Message queue size configured */ +#define PCI_MSI_FLAGS_QMASK 0x00e /* Maximum queue size available */ +#define PCI_MSI_FLAGS_ENABLE 0x001 /* MSI feature enabled */ +#define PCI_MSI_RFU 3 /* Rest of capability flags */ +#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ +#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ +#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ +#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ +#define PCI_MSI_MASK_BIT_32 12 /* per-vector masking for 32-bit devices */ +#define PCI_MSI_MASK_BIT_64 16 /* per-vector masking for 64-bit devices */ +#define PCI_MSI_PENDING_32 16 /* per-vector interrupt pending for 32-bit devices */ +#define PCI_MSI_PENDING_64 20 /* per-vector interrupt pending for 64-bit devices */ + +/* PCI-X */ +#define PCI_PCIX_COMMAND 2 /* Command register offset */ +#define PCI_PCIX_COMMAND_DPERE 0x0001 /* Data Parity Error Recover Enable */ +#define PCI_PCIX_COMMAND_ERO 0x0002 /* Enable Relaxed Ordering */ +#define PCI_PCIX_COMMAND_MAX_MEM_READ_BYTE_COUNT 0x000c /* Maximum Memory Read Byte Count */ +#define PCI_PCIX_COMMAND_MAX_OUTSTANDING_SPLIT_TRANS 0x0070 +#define PCI_PCIX_COMMAND_RESERVED 0xf80 +#define PCI_PCIX_STATUS 4 /* Status register offset */ +#define PCI_PCIX_STATUS_FUNCTION 0x00000007 +#define PCI_PCIX_STATUS_DEVICE 0x000000f8 +#define PCI_PCIX_STATUS_BUS 0x0000ff00 +#define PCI_PCIX_STATUS_64BIT 0x00010000 +#define PCI_PCIX_STATUS_133MHZ 0x00020000 +#define PCI_PCIX_STATUS_SC_DISCARDED 0x00040000 /* Split Completion Discarded */ +#define PCI_PCIX_STATUS_UNEXPECTED_SC 0x00080000 /* Unexpected Split Completion */ +#define PCI_PCIX_STATUS_DEVICE_COMPLEXITY 0x00100000 /* 0 = simple device, 1 = bridge device */ +#define PCI_PCIX_STATUS_DESIGNED_MAX_MEM_READ_BYTE_COUNT 0x00600000 /* 0 = 512 bytes, 1 = 1024, 2 = 2048, 3 = 4096 */ +#define PCI_PCIX_STATUS_DESIGNED_MAX_OUTSTANDING_SPLIT_TRANS 0x03800000 +#define PCI_PCIX_STATUS_DESIGNED_MAX_CUMULATIVE_READ_SIZE 0x1c000000 +#define PCI_PCIX_STATUS_RCVD_SC_ERR_MESS 0x20000000 /* Received Split Completion Error Message */ +#define PCI_PCIX_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ +#define PCI_PCIX_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ +#define PCI_PCIX_SIZEOF 4 + + +/* PCI-X Bridges */ +#define PCI_PCIX_BRIDGE_SEC_STATUS 2 /* Secondary bus status register offset */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_64BIT 0x0001 +#define PCI_PCIX_BRIDGE_SEC_STATUS_133MHZ 0x0002 +#define PCI_PCIX_BRIDGE_SEC_STATUS_SC_DISCARDED 0x0004 /* Split Completion Discarded on secondary bus */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_UNEXPECTED_SC 0x0008 /* Unexpected Split Completion on secondary bus */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_SC_OVERRUN 0x0010 /* Split Completion Overrun on secondary bus */ +#define PCI_PCIX_BRIDGE_SEC_STATUS_SPLIT_REQUEST_DELAYED 0x0020 +#define PCI_PCIX_BRIDGE_SEC_STATUS_CLOCK_FREQ 0x01c0 +#define PCI_PCIX_BRIDGE_SEC_STATUS_RESERVED 0xfe00 +#define PCI_PCIX_BRIDGE_STATUS 4 /* Primary bus status register offset */ +#define PCI_PCIX_BRIDGE_STATUS_FUNCTION 0x00000007 +#define PCI_PCIX_BRIDGE_STATUS_DEVICE 0x000000f8 +#define PCI_PCIX_BRIDGE_STATUS_BUS 0x0000ff00 +#define PCI_PCIX_BRIDGE_STATUS_64BIT 0x00010000 +#define PCI_PCIX_BRIDGE_STATUS_133MHZ 0x00020000 +#define PCI_PCIX_BRIDGE_STATUS_SC_DISCARDED 0x00040000 /* Split Completion Discarded */ +#define PCI_PCIX_BRIDGE_STATUS_UNEXPECTED_SC 0x00080000 /* Unexpected Split Completion */ +#define PCI_PCIX_BRIDGE_STATUS_SC_OVERRUN 0x00100000 /* Split Completion Overrun */ +#define PCI_PCIX_BRIDGE_STATUS_SPLIT_REQUEST_DELAYED 0x00200000 +#define PCI_PCIX_BRIDGE_STATUS_RESERVED 0xffc00000 +#define PCI_PCIX_BRIDGE_UPSTREAM_SPLIT_TRANS_CTRL 8 /* Upstream Split Transaction Register offset */ +#define PCI_PCIX_BRIDGE_DOWNSTREAM_SPLIT_TRANS_CTRL 12 /* Downstream Split Transaction Register offset */ +#define PCI_PCIX_BRIDGE_STR_CAPACITY 0x0000ffff +#define PCI_PCIX_BRIDGE_STR_COMMITMENT_LIMIT 0xffff0000 +#define PCI_PCIX_BRIDGE_SIZEOF 12 + +/* PCI Express */ +#define PCI_EXP_FLAGS 0x2 /* Capabilities register */ +#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */ +#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */ +#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */ +#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */ +#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ +#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ +#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ +#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ +#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIE Bridge */ +#define PCI_EXP_TYPE_ROOT_INT_EP 0x9 /* Root Complex Integrated Endpoint */ +#define PCI_EXP_TYPE_ROOT_EC 0xa /* Root Complex Event Collector */ +#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ +#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ +#define PCI_EXP_DEVCAP 0x4 /* Device capabilities */ +#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ +#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ +#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ +#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ +#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ +#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ +#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ +#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ +#define PCI_EXP_DEVCAP_RBE 0x8000 /* Role-Based Error Reporting */ +#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ +#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ +#define PCI_EXP_DEVCAP_FLRESET 0x10000000 /* Function-Level Reset */ +#define PCI_EXP_DEVCTL 0x8 /* Device Control */ +#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ +#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ +#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */ +#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ +#define PCI_EXP_DEVCTL_RELAXED 0x0010 /* Enable Relaxed Ordering */ +#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ +#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ +#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ +#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ +#define PCI_EXP_DEVCTL_NOSNOOP 0x0800 /* Enable No Snoop */ +#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ +#define PCI_EXP_DEVCTL_BCRE 0x8000 /* Bridge Configuration Retry Enable */ +#define PCI_EXP_DEVCTL_FLRESET 0x8000 /* Function-Level Reset [bit shared with BCRE] */ +#define PCI_EXP_DEVSTA 0xa /* Device Status */ +#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ +#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ +#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ +#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ +#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ +#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ +#define PCI_EXP_LNKCAP 0xc /* Link Capabilities */ +#define PCI_EXP_LNKCAP_SPEED 0x0000f /* Maximum Link Speed */ +#define PCI_EXP_LNKCAP_WIDTH 0x003f0 /* Maximum Link Width */ +#define PCI_EXP_LNKCAP_ASPM 0x00c00 /* Active State Power Management */ +#define PCI_EXP_LNKCAP_L0S 0x07000 /* L0s Acceptable Latency */ +#define PCI_EXP_LNKCAP_L1 0x38000 /* L1 Acceptable Latency */ +#define PCI_EXP_LNKCAP_CLOCKPM 0x40000 /* Clock Power Management */ +#define PCI_EXP_LNKCAP_SURPRISE 0x80000 /* Surprise Down Error Reporting */ +#define PCI_EXP_LNKCAP_DLLA 0x100000 /* Data Link Layer Active Reporting */ +#define PCI_EXP_LNKCAP_LBNC 0x200000 /* Link Bandwidth Notification Capability */ +#define PCI_EXP_LNKCAP_PORT 0xff000000 /* Port Number */ +#define PCI_EXP_LNKCTL 0x10 /* Link Control */ +#define PCI_EXP_LNKCTL_ASPM 0x0003 /* ASPM Control */ +#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ +#define PCI_EXP_LNKCTL_DISABLE 0x0010 /* Link Disable */ +#define PCI_EXP_LNKCTL_RETRAIN 0x0020 /* Retrain Link */ +#define PCI_EXP_LNKCTL_CLOCK 0x0040 /* Common Clock Configuration */ +#define PCI_EXP_LNKCTL_XSYNCH 0x0080 /* Extended Synch */ +#define PCI_EXP_LNKCTL_CLOCKPM 0x0100 /* Clock Power Management */ +#define PCI_EXP_LNKCTL_HWAUTWD 0x0200 /* Hardware Autonomous Width Disable */ +#define PCI_EXP_LNKCTL_BWMIE 0x0400 /* Bandwidth Mgmt Interrupt Enable */ +#define PCI_EXP_LNKCTL_AUTBWIE 0x0800 /* Autonomous Bandwidth Mgmt Interrupt Enable */ +#define PCI_EXP_LNKSTA 0x12 /* Link Status */ +#define PCI_EXP_LNKSTA_SPEED 0x000f /* Negotiated Link Speed */ +#define PCI_EXP_LNKSTA_WIDTH 0x03f0 /* Negotiated Link Width */ +#define PCI_EXP_LNKSTA_TR_ERR 0x0400 /* Training Error (obsolete) */ +#define PCI_EXP_LNKSTA_TRAIN 0x0800 /* Link Training */ +#define PCI_EXP_LNKSTA_SL_CLK 0x1000 /* Slot Clock Configuration */ +#define PCI_EXP_LNKSTA_DL_ACT 0x2000 /* Data Link Layer in DL_Active State */ +#define PCI_EXP_LNKSTA_BWMGMT 0x4000 /* Bandwidth Mgmt Status */ +#define PCI_EXP_LNKSTA_AUTBW 0x8000 /* Autonomous Bandwidth Mgmt Status */ +#define PCI_EXP_SLTCAP 0x14 /* Slot Capabilities */ +#define PCI_EXP_SLTCAP_ATNB 0x0001 /* Attention Button Present */ +#define PCI_EXP_SLTCAP_PWRC 0x0002 /* Power Controller Present */ +#define PCI_EXP_SLTCAP_MRL 0x0004 /* MRL Sensor Present */ +#define PCI_EXP_SLTCAP_ATNI 0x0008 /* Attention Indicator Present */ +#define PCI_EXP_SLTCAP_PWRI 0x0010 /* Power Indicator Present */ +#define PCI_EXP_SLTCAP_HPS 0x0020 /* Hot-Plug Surprise */ +#define PCI_EXP_SLTCAP_HPC 0x0040 /* Hot-Plug Capable */ +#define PCI_EXP_SLTCAP_PWR_VAL 0x00007f80 /* Slot Power Limit Value */ +#define PCI_EXP_SLTCAP_PWR_SCL 0x00018000 /* Slot Power Limit Scale */ +#define PCI_EXP_SLTCAP_INTERLOCK 0x020000 /* Electromechanical Interlock Present */ +#define PCI_EXP_SLTCAP_NOCMDCOMP 0x040000 /* No Command Completed Support */ +#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ +#define PCI_EXP_SLTCTL 0x18 /* Slot Control */ +#define PCI_EXP_SLTCTL_ATNB 0x0001 /* Attention Button Pressed Enable */ +#define PCI_EXP_SLTCTL_PWRF 0x0002 /* Power Fault Detected Enable */ +#define PCI_EXP_SLTCTL_MRLS 0x0004 /* MRL Sensor Changed Enable */ +#define PCI_EXP_SLTCTL_PRSD 0x0008 /* Presence Detect Changed Enable */ +#define PCI_EXP_SLTCTL_CMDC 0x0010 /* Command Completed Interrupt Enable */ +#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ +#define PCI_EXP_SLTCTL_ATNI 0x00c0 /* Attention Indicator Control */ +#define PCI_EXP_SLTCTL_PWRI 0x0300 /* Power Indicator Control */ +#define PCI_EXP_SLTCTL_PWRC 0x0400 /* Power Controller Control */ +#define PCI_EXP_SLTCTL_INTERLOCK 0x0800 /* Electromechanical Interlock Control */ +#define PCI_EXP_SLTCTL_LLCHG 0x1000 /* Data Link Layer State Changed Enable */ +#define PCI_EXP_SLTSTA 0x1a /* Slot Status */ +#define PCI_EXP_SLTSTA_ATNB 0x0001 /* Attention Button Pressed */ +#define PCI_EXP_SLTSTA_PWRF 0x0002 /* Power Fault Detected */ +#define PCI_EXP_SLTSTA_MRLS 0x0004 /* MRL Sensor Changed */ +#define PCI_EXP_SLTSTA_PRSD 0x0008 /* Presence Detect Changed */ +#define PCI_EXP_SLTSTA_CMDC 0x0010 /* Command Completed */ +#define PCI_EXP_SLTSTA_MRL_ST 0x0020 /* MRL Sensor State */ +#define PCI_EXP_SLTSTA_PRES 0x0040 /* Presence Detect State */ +#define PCI_EXP_SLTSTA_INTERLOCK 0x0080 /* Electromechanical Interlock Status */ +#define PCI_EXP_SLTSTA_LLCHG 0x0100 /* Data Link Layer State Changed */ +#define PCI_EXP_RTCTL 0x1c /* Root Control */ +#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */ +#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */ +#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */ +#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */ +#define PCI_EXP_RTCTL_CRSVIS 0x0010 /* Configuration Request Retry Status Visible to SW */ +#define PCI_EXP_RTCAP 0x1e /* Root Capabilities */ +#define PCI_EXP_RTCAP_CRSVIS 0x0010 /* Configuration Request Retry Status Visible to SW */ +#define PCI_EXP_RTSTA 0x20 /* Root Status */ +#define PCI_EXP_RTSTA_PME_REQID 0x0000ffff /* PME Requester ID */ +#define PCI_EXP_RTSTA_PME_STATUS 0x00010000 /* PME Status */ +#define PCI_EXP_RTSTA_PME_PENDING 0x00020000 /* PME is Pending */ +#define PCI_EXP_DEVCAP2 0x24 /* Device capabilities 2 */ +#define PCI_EXP_DEVCTL2 0x28 /* Device Control */ +#define PCI_EXP_DEV2_TIMEOUT_RANGE(x) ((x) & 0xf) /* Completion Timeout Ranges Supported */ +#define PCI_EXP_DEV2_TIMEOUT_VALUE(x) ((x) & 0xf) /* Completion Timeout Value */ +#define PCI_EXP_DEV2_TIMEOUT_DIS 0x0010 /* Completion Timeout Disable Supported */ +#define PCI_EXP_DEV2_ARI 0x0020 /* ARI Forwarding */ +#define PCI_EXP_DEVSTA2 0x2a /* Device Status */ +#define PCI_EXP_LNKCAP2 0x2c /* Link Capabilities */ +#define PCI_EXP_LNKCTL2 0x30 /* Link Control */ +#define PCI_EXP_LNKCTL2_SPEED(x) ((x) & 0xf) /* Target Link Speed */ +#define PCI_EXP_LNKCTL2_CMPLNC 0x0010 /* Enter Compliance */ +#define PCI_EXP_LNKCTL2_SPEED_DIS 0x0020 /* Hardware Autonomous Speed Disable */ +#define PCI_EXP_LNKCTL2_DEEMPHASIS(x) (((x) >> 6) & 1) /* Selectable De-emphasis */ +#define PCI_EXP_LNKCTL2_MARGIN(x) (((x) >> 7) & 7) /* Transmit Margin */ +#define PCI_EXP_LNKCTL2_MOD_CMPLNC 0x0400 /* Enter Modified Compliance */ +#define PCI_EXP_LNKCTL2_CMPLNC_SOS 0x0800 /* Compliance SOS */ +#define PCI_EXP_LNKCTL2_COM_DEEMPHASIS(x) (((x) >> 12) & 1) /* Compliance De-emphasis */ +#define PCI_EXP_LNKSTA2 0x32 /* Link Status */ +#define PCI_EXP_LINKSTA2_DEEMPHASIS(x) ((x) & 1) /* Current De-emphasis Level */ +#define PCI_EXP_SLTCAP2 0x34 /* Slot Capabilities */ +#define PCI_EXP_SLTCTL2 0x38 /* Slot Control */ +#define PCI_EXP_SLTSTA2 0x3a /* Slot Status */ + +/* MSI-X */ +#define PCI_MSIX_ENABLE 0x8000 +#define PCI_MSIX_MASK 0x4000 +#define PCI_MSIX_TABSIZE 0x03ff +#define PCI_MSIX_TABLE 4 +#define PCI_MSIX_PBA 8 +#define PCI_MSIX_BIR 0x7 + +/* Subsystem vendor/device ID for PCI bridges */ +#define PCI_SSVID_VENDOR 4 +#define PCI_SSVID_DEVICE 6 + +/* Advanced Error Reporting */ +#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ +#define PCI_ERR_UNC_TRAIN 0x00000001 /* Undefined in PCIe rev1.1 & 2.0 spec */ +#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ +#define PCI_ERR_UNC_SDES 0x00000020 /* Surprise Down Error */ +#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ +#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ +#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ +#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */ +#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */ +#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */ +#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ +#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ +#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ +#define PCI_ERR_UNC_ACS_VIOL 0x00200000 /* ACS Violation */ +#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ +/* Same bits as above */ +#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ +/* Same bits as above */ +#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */ +#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */ +#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */ +#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ +#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ +#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ +#define PCI_ERR_COR_REP_ANFE 0x00002000 /* Advisory Non-Fatal Error */ +#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ +/* Same bits as above */ +#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ +#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */ +#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */ +#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */ +#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */ +#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ +#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ +#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ +#define PCI_ERR_ROOT_STATUS 48 +#define PCI_ERR_ROOT_COR_SRC 52 +#define PCI_ERR_ROOT_SRC 54 + +/* Virtual Channel */ +#define PCI_VC_PORT_REG1 4 +#define PCI_VC_PORT_REG2 8 +#define PCI_VC_PORT_CTRL 12 +#define PCI_VC_PORT_STATUS 14 +#define PCI_VC_RES_CAP 16 +#define PCI_VC_RES_CTRL 20 +#define PCI_VC_RES_STATUS 26 + +/* Power Budgeting */ +#define PCI_PWR_DSR 4 /* Data Select Register */ +#define PCI_PWR_DATA 8 /* Data Register */ +#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */ +#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */ +#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */ +#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */ +#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */ +#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ +#define PCI_PWR_CAP 12 /* Capability */ +#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ + +/* Access Control Services */ +#define PCI_ACS_CAP 0x04 /* ACS Capability Register */ +#define PCI_ACS_CAP_VALID 0x0001 /* ACS Source Validation */ +#define PCI_ACS_CAP_BLOCK 0x0002 /* ACS Translation Blocking */ +#define PCI_ACS_CAP_REQ_RED 0x0004 /* ACS P2P Request Redirect */ +#define PCI_ACS_CAP_CMPLT_RED 0x0008 /* ACS P2P Completion Redirect */ +#define PCI_ACS_CAP_FORWARD 0x0010 /* ACS Upstream Forwarding */ +#define PCI_ACS_CAP_EGRESS 0x0020 /* ACS P2P Egress Control */ +#define PCI_ACS_CAP_TRANS 0x0040 /* ACS Direct Translated P2P */ +#define PCI_ACS_CAP_VECTOR(x) (((x) >> 8) & 0xff) /* Egress Control Vector Size */ +#define PCI_ACS_CTRL 0x06 /* ACS Control Register */ +#define PCI_ACS_CTRL_VALID 0x0001 /* ACS Source Validation Enable */ +#define PCI_ACS_CTRL_BLOCK 0x0002 /* ACS Translation Blocking Enable */ +#define PCI_ACS_CTRL_REQ_RED 0x0004 /* ACS P2P Request Redirect Enable */ +#define PCI_ACS_CTRL_CMPLT_RED 0x0008 /* ACS P2P Completion Redirect Enable */ +#define PCI_ACS_CTRL_FORWARD 0x0010 /* ACS Upstream Forwarding Enable */ +#define PCI_ACS_CTRL_EGRESS 0x0020 /* ACS P2P Egress Control Enable */ +#define PCI_ACS_CTRL_TRANS 0x0040 /* ACS Direct Translated P2P Enable */ +#define PCI_ACS_EGRESS_CTRL 0x08 /* Egress Control Vector */ + +/* Alternative Routing-ID Interpretation */ +#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ +#define PCI_ARI_CAP_MFVC 0x0001 /* MFVC Function Groups Capability */ +#define PCI_ARI_CAP_ACS 0x0002 /* ACS Function Groups Capability */ +#define PCI_ARI_CAP_NFN(x) (((x) >> 8) & 0xff) /* Next Function Number */ +#define PCI_ARI_CTRL 0x06 /* ARI Control Register */ +#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ +#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ +#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ + +/* Address Translation Service */ +#define PCI_ATS_CAP 0x04 /* ATS Capability Register */ +#define PCI_ATS_CAP_IQD(x) ((x) & 0x1f) /* Invalidate Queue Depth */ +#define PCI_ATS_CTRL 0x06 /* ATS Control Register */ +#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ +#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ + +/* Single Root I/O Virtualization */ +#define PCI_IOV_CAP 0x04 /* SR-IOV Capability Register */ +#define PCI_IOV_CAP_VFM 0x00000001 /* VF Migration Capable */ +#define PCI_IOV_CAP_IMN(x) ((x) >> 21) /* VF Migration Interrupt Message Number */ +#define PCI_IOV_CTRL 0x08 /* SR-IOV Control Register */ +#define PCI_IOV_CTRL_VFE 0x0001 /* VF Enable */ +#define PCI_IOV_CTRL_VFME 0x0002 /* VF Migration Enable */ +#define PCI_IOV_CTRL_VFMIE 0x0004 /* VF Migration Interrupt Enable */ +#define PCI_IOV_CTRL_MSE 0x0008 /* VF MSE */ +#define PCI_IOV_CTRL_ARI 0x0010 /* ARI Capable Hierarchy */ +#define PCI_IOV_STATUS 0x0a /* SR-IOV Status Register */ +#define PCI_IOV_STATUS_MS 0x0001 /* VF Migration Status */ +#define PCI_IOV_INITIALVF 0x0c /* Number of VFs that are initially associated */ +#define PCI_IOV_TOTALVF 0x0e /* Maximum number of VFs that could be associated */ +#define PCI_IOV_NUMVF 0x10 /* Number of VFs that are available */ +#define PCI_IOV_FDL 0x12 /* Function Dependency Link */ +#define PCI_IOV_OFFSET 0x14 /* First VF Offset */ +#define PCI_IOV_STRIDE 0x16 /* Routing ID offset from one VF to the next one */ +#define PCI_IOV_DID 0x1a /* VF Device ID */ +#define PCI_IOV_SUPPS 0x1c /* Supported Page Sizes */ +#define PCI_IOV_SYSPS 0x20 /* System Page Size */ +#define PCI_IOV_BAR_BASE 0x24 /* VF BAR0, VF BAR1, ... VF BAR5 */ +#define PCI_IOV_NUM_BAR 6 /* Number of VF BARs */ +#define PCI_IOV_MSAO 0x3c /* VF Migration State Array Offset */ +#define PCI_IOV_MSA_BIR(x) ((x) & 7) /* VF Migration State BIR */ +#define PCI_IOV_MSA_OFFSET(x) ((x) & 0xfffffff8) /* VF Migration State Offset */ + +/* + * The PCI interface treats multi-function devices as independent + * devices. The slot/function address of each device is encoded + * in a single byte as follows: + * + * 7:3 = slot + * 2:0 = function + */ +#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) +#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) +#define PCI_FUNC(devfn) ((devfn) & 0x07) + +/* Device classes and subclasses */ +#define PCI_CLASS_NOT_DEFINED 0x0000 +#define PCI_CLASS_NOT_DEFINED_VGA 0x0001 + +// values for the class_sub field for class_base = 0x00 (Device was built prior definition of the class code field) + +// values for the class_sub field for class_base = 0x01 (Mass Storage Controller) +#define PCI_BASE_CLASS_STORAGE 0x01 +#define PCI_CLASS_STORAGE_SCSI 0x0100 +#define PCI_CLASS_STORAGE_IDE 0x0101 +#define PCI_CLASS_STORAGE_FLOPPY 0x0102 +#define PCI_CLASS_STORAGE_IPI 0x0103 +#define PCI_CLASS_STORAGE_RAID 0x0104 +#define PCI_CLASS_STORAGE_ATA 0x0105 +#define PCI_CLASS_STORAGE_SATA 0x0106 +#define PCI_CLASS_STORAGE_SATA_AHCI 0x010601 +#define PCI_CLASS_STORAGE_SAS 0x0107 +#define PCI_CLASS_STORAGE_OTHER 0x0180 + +// values for the class_sub field for class_base = 0x02 (Network Controller) +#define PCI_BASE_CLASS_NETWORK 0x02 +#define PCI_CLASS_NETWORK_ETHERNET 0x0200 +#define PCI_CLASS_NETWORK_TOKEN_RING 0x0201 +#define PCI_CLASS_NETWORK_FDDI 0x0202 +#define PCI_CLASS_NETWORK_ATM 0x0203 +#define PCI_CLASS_NETWORK_ISDN 0x0204 +#define PCI_CLASS_NETWORK_OTHER 0x0280 + +// values for the class_sub field for class_base = 0x03 (Display Controller) +#define PCI_BASE_CLASS_DISPLAY 0x03 +#define PCI_CLASS_DISPLAY_VGA 0x0300 +#define PCI_CLASS_DISPLAY_XGA 0x0301 +#define PCI_CLASS_DISPLAY_3D 0x0302 +#define PCI_CLASS_DISPLAY_OTHER 0x0380 + +// values for the class_sub field for class_base = 0x04 (Multimedia Controller) +#define PCI_BASE_CLASS_MULTIMEDIA 0x04 +#define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400 /* video */ +#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401 /* audio */ +#define PCI_CLASS_MULTIMEDIA_PHONE 0x0402 +#define PCI_CLASS_MULTIMEDIA_AUDIO_DEV 0x0403 /* HD audio */ +#define PCI_CLASS_MULTIMEDIA_OTHER 0x0480 + +// values for the class_sub field for class_base = 0x05 (Memory Controller) +#define PCI_BASE_CLASS_MEMORY 0x05 +#define PCI_CLASS_MEMORY_RAM 0x0500 +#define PCI_CLASS_MEMORY_FLASH 0x0501 +#define PCI_CLASS_MEMORY_OTHER 0x0580 + +// values for the class_sub field for class_base = 0x06 (Bridge Device) +#define PCI_BASE_CLASS_BRIDGE 0x06 +#define PCI_CLASS_BRIDGE_HOST 0x0600 +#define PCI_CLASS_BRIDGE_ISA 0x0601 +#define PCI_CLASS_BRIDGE_EISA 0x0602 +#define PCI_CLASS_BRIDGE_MC 0x0603 +#define PCI_CLASS_BRIDGE_PCI 0x0604 +#define PCI_CLASS_BRIDGE_PCMCIA 0x0605 +#define PCI_CLASS_BRIDGE_NUBUS 0x0606 +#define PCI_CLASS_BRIDGE_CARDBUS 0x0607 +#define PCI_CLASS_BRIDGE_RACEWAY 0x0608 +#define PCI_CLASS_BRIDGE_PCI_SEMI 0x0609 +#define PCI_CLASS_BRIDGE_IB_TO_PCI 0x060a +#define PCI_CLASS_BRIDGE_OTHER 0x0680 + +// values for the class_sub field for class_base = 0x07 (Simple Communications Controllers) +#define PCI_BASE_CLASS_COMMUNICATION 0x07 +#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700 +#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701 +#define PCI_CLASS_COMMUNICATION_MSERIAL 0x0702 +#define PCI_CLASS_COMMUNICATION_MODEM 0x0703 +#define PCI_CLASS_COMMUNICATION_OTHER 0x0780 + +// values for the class_sub field for class_base = 0x08 (Base System Peripherals) +#define PCI_BASE_CLASS_SYSTEM 0x08 +#define PCI_CLASS_SYSTEM_PIC 0x0800 +#define PCI_CLASS_SYSTEM_PIC_IOAPIC 0x080010 +#define PCI_CLASS_SYSTEM_PIC_IOXAPIC 0x080020 /* I/O APIC interrupt controller , 32 bye none-prefectable memory. */ +#define PCI_CLASS_SYSTEM_DMA 0x0801 +#define PCI_CLASS_SYSTEM_TIMER 0x0802 +#define PCI_CLASS_SYSTEM_RTC 0x0803 +#define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 /* HotPlug Controller */ +#define PCI_CLASS_SYSTEM_SDHCI 0x0805 +#define PCI_CLASS_SYSTEM_OTHER 0x0880 + +// values for the class_sub field for class_base = 0x09 (Input Devices) +#define PCI_BASE_CLASS_INPUT 0x09 +#define PCI_CLASS_INPUT_KEYBOARD 0x0900 +#define PCI_CLASS_INPUT_PEN 0x0901 +#define PCI_CLASS_INPUT_MOUSE 0x0902 +#define PCI_CLASS_INPUT_SCANNER 0x0903 +#define PCI_CLASS_INPUT_GAMEPORT 0x0904 +#define PCI_CLASS_INPUT_OTHER 0x0980 + +// values for the class_sub field for class_base = 0x0a (Docking Stations) +#define PCI_BASE_CLASS_DOCKING 0x0a +#define PCI_CLASS_DOCKING_GENERIC 0x0a00 +#define PCI_CLASS_DOCKING_OTHER 0x0a80 + +// values for the class_sub field for class_base = 0x0b (processor) +#define PCI_BASE_CLASS_PROCESSOR 0x0b +#define PCI_CLASS_PROCESSOR_386 0x0b00 +#define PCI_CLASS_PROCESSOR_486 0x0b01 +#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02 +#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10 +#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 +#define PCI_CLASS_PROCESSOR_MIPS 0x0b30 +#define PCI_CLASS_PROCESSOR_CO 0x0b40 /* Co-Processor */ + +// values for the class_sub field for class_base = 0x0c (serial bus controller) +#define PCI_BASE_CLASS_SERIAL 0x0c +#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00 /* FireWire (IEEE 1394) */ +#define PCI_CLASS_SERIAL_FIREWIRE_OHCI 0x0c10 +#define PCI_CLASS_SERIAL_ACCESS 0x0c01 +#define PCI_CLASS_SERIAL_SSA 0x0c02 +#define PCI_CLASS_SERIAL_USB 0x0c03 /* Universal Serial Bus */ +#define PCI_IF_UHCI 0x00 /* Universal Host Controller Interface */ +#define PCI_IF_OHCI 0x10 /* Open Host Controller Interface */ +#define PCI_IF_EHCI 0x20 /* Enhanced Host Controller Interface */ +#define PCI_IF_XHCI 0x30 /* Extensible Host Controller Interface */ +#define PCI_CLASS_SERIAL_FIBER 0x0c04 +#define PCI_CLASS_SERIAL_SMBUS 0x0c05 +#define PCI_CLASS_SERIAL_INFINIBAND 0x0c06 + +// values for the class_sub field for class_base = 0x0d (Wireless Controller) +#define PCI_BASE_CLASS_WIRELESS 0x0d +#define PCI_CLASS_WIRELESS_IRDA 0x0d00 +#define PCI_CLASS_WIRELESS_IR 0x0d01 +#define PCI_CLASS_WIRELESS_RF 0x0d10 +#define PCI_CLASS_WIRELESS_BLUETOOTH 0x0d11 +#define PCI_CLASS_WIRELESS_BROADBAND 0x0d12 +#define PCI_CLASS_WIRELESS_80211A 0x0d20 +#define PCI_CLASS_WIRELESS_80211B 0x0d21 +#define PCI_CLASS_WIRELESS_WHCI 0x0d1010 +#define PCI_CLASS_WIRELESS_OTHER 0x80 + +// values for the class_sub field for class_base = 0x0e (Intelligent I/O Controller) +#define PCI_BASE_CLASS_INTELLIGENT 0x0e +#define PCI_CLASS_INTELLIGENT_I2O 0x0e00 + +// values for the class_sub field for class_base = 0x0f (Satellite Communication Controller) +#define PCI_BASE_CLASS_SATELLITE 0x0f +#define PCI_CLASS_SATELLITE_TV 0x0f00 +#define PCI_CLASS_SATELLITE_AUDIO 0x0f01 +#define PCI_CLASS_SATELLITE_VOICE 0x0f03 +#define PCI_CLASS_SATELLITE_DATA 0x0f04 + +// values for the class_sub field for class_base = 0x10 (Encryption and decryption controller) +#define PCI_BASE_CLASS_CRYPT 0x10 +#define PCI_CLASS_CRYPT_NETWORK 0x1000 +#define PCI_CLASS_CRYPT_ENTERTAINMENT 0x1010 +#define PCI_CLASS_CRYPT_OTHER 0x1080 + +// values for the class_sub field for class_base = 0x11 (Data Acquisition and Signal Processing Controllers) +#define PCI_BASE_CLASS_SIGNAL 0x11 +#define PCI_CLASS_SIGNAL_DPIO 0x1100 +#define PCI_CLASS_SIGNAL_PERF_CTR 0x1101 +#define PCI_CLASS_SIGNAL_SYNCHRONIZER 0x1110 +#define PCI_CLASS_SIGNAL_OTHER 0x1180 + +// values for the class_sub field for class_base = 0xff (Device does not fit any defined class) +#define PCI_CLASS_OTHERS 0xff + +/* Several ID's we need in the library */ +#define PCI_VENDOR_ID_APPLE 0x106b +#define PCI_VENDOR_ID_AMD 0x1022 +#define PCI_VENDOR_ID_ATI 0x1002 +#define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_VENDOR_ID_NVIDIA 0x10de +#define PCI_VENDOR_ID_REALTEK 0x10ec +#define PCI_VENDOR_ID_TEXAS_INSTRUMENTS 0x104c +#define PCI_VENDOR_ID_VIA 0x1106 + +#endif /* !__LIBSAIO_PCI_H */ diff --git a/i386/libsaio/pci_root.c b/i386/libsaio/pci_root.c new file mode 100644 index 0000000..4fe1a45 --- /dev/null +++ b/i386/libsaio/pci_root.c @@ -0,0 +1,126 @@ +/* + * Copyright 2009 netkas + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" + +#ifndef DEBUG_PCIROOT +#define DEBUG_PCIROOT 1 +#endif + +#if DEBUG_PCIROOT +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +static int rootuid = 10; //value means function wasnt ran yet + +static unsigned int findrootuid(unsigned char * dsdt, int len) +{ + int i; + for (i=0; i<64 && i<len-5; i++) //not far than 64 symbols from pci root + { + if(dsdt[i] == '_' && dsdt[i+1] == 'U' && dsdt[i+2] == 'I' && dsdt[i+3] == 'D' && dsdt[i+5] == 0x08) + { + return dsdt[i+4]; + } + } + return 11; +} + +static unsigned int findpciroot(unsigned char * dsdt,int len) +{ + int i; + + for (i=0; i<len-4; i++) { + if(dsdt[i] == 'P' && dsdt[i+1] == 'C' && dsdt[i+2] == 'I' && (dsdt[i+3] == 0x08 || dsdt [i+4] == 0x08)) { + return findrootuid(dsdt+i, len-i); + } + } + return 10; +} + +int getPciRootUID(void) +{ + char dsdt_dirSpec[128]; + + void *new_dsdt; + const char *val; + int len,fsize; + const char * dsdt_filename=NULL; + extern int search_and_get_acpi_fd(const char *, const char **); + + if (rootuid < 10) return rootuid; + rootuid = 0; /* default uid = 0 */ + + if (getValueForKey(kPCIRootUID, &val, &len, &bootInfo->chameleonConfig)) { + if (isdigit(val[0])) rootuid = val[0] - '0'; + goto out; + } + /* Chameleon compatibility */ + else if (getValueForKey("PciRoot", &val, &len, &bootInfo->chameleonConfig)) { + if (isdigit(val[0])) rootuid = val[0] - '0'; + goto out; + } + /* PCEFI compatibility */ + else if (getValueForKey("-pci0", &val, &len, &bootInfo->chameleonConfig)) { + rootuid = 0; + goto out; + } + else if (getValueForKey("-pci1", &val, &len, &bootInfo->chameleonConfig)) { + rootuid = 1; + goto out; + } + + + // Try using the file specified with the DSDT option + if (getValueForKey(kDSDT, &dsdt_filename, &len, &bootInfo->chameleonConfig)) + { + sprintf(dsdt_dirSpec, dsdt_filename); + } + else + { + sprintf(dsdt_dirSpec, "DSDT.aml"); + } + + int fd = search_and_get_acpi_fd(dsdt_dirSpec, &dsdt_filename); + + // Check booting partition + if (fd<0) + { + verbose("No DSDT found, using 0 as uid value.\n"); + rootuid = 0; + goto out; + } + + fsize = file_size(fd); + + if ((new_dsdt = malloc(fsize)) == NULL) { + verbose("[ERROR] alloc DSDT memory failed\n"); + close (fd); + goto out; + } + if (read (fd, new_dsdt, fsize) != fsize) { + verbose("[ERROR] read %s failed\n", dsdt_filename); + close (fd); + goto out; + } + close (fd); + + rootuid = findpciroot(new_dsdt, fsize); + free(new_dsdt); + + // make sure it really works: + if (rootuid == 11) rootuid=0; //usually when _UID isnt present, it means uid is zero + else if (rootuid < 0 || rootuid > 9) + { + printf("PciRoot uid value wasnt found, using 0, if you want it to be 1, use -PciRootUID flag"); + rootuid = 0; + } +out: + verbose("Using PCI-Root-UID value: %d\n", rootuid); + return rootuid; +} diff --git a/i386/libsaio/pci_root.h b/i386/libsaio/pci_root.h new file mode 100644 index 0000000..9c870b8 --- /dev/null +++ b/i386/libsaio/pci_root.h @@ -0,0 +1,13 @@ +/* + * Copyright 2008 mackerintel + */ + +#ifndef __LIBSAIO_PCI_ROOT_H +#define __LIBSAIO_PCI_ROOT_H + +#include "libsaio.h" + + +extern int getPciRootUID(void); + +#endif /* !__LIBSAIO_DSDT_PATCHER_H */ diff --git a/i386/libsaio/pci_setup.c b/i386/libsaio/pci_setup.c new file mode 100644 index 0000000..0248ff4 --- /dev/null +++ b/i386/libsaio/pci_setup.c @@ -0,0 +1,78 @@ +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "gma.h" +#include "nvidia.h" +#include "modules.h" + + +extern bool setup_ati_devprop(pci_dt_t *ati_dev); +extern void set_eth_builtin(pci_dt_t *eth_dev); +extern void notify_usb_dev(pci_dt_t *pci_dev); +extern void force_enable_hpet(pci_dt_t *lpc_dev); + +extern pci_dt_t *dram_controller_dev; + +void setup_pci_devs(pci_dt_t *pci_dt) +{ + char *devicepath; + bool do_eth_devprop, do_gfx_devprop, do_enable_hpet; + pci_dt_t *current = pci_dt; + + do_eth_devprop = do_gfx_devprop = do_enable_hpet = false; + + getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->chameleonConfig); + getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->chameleonConfig); + getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->chameleonConfig); + + while (current) + { + devicepath = get_pci_dev_path(current); + + switch (current->class_id) + { + case PCI_CLASS_BRIDGE_HOST: + if (current->dev.addr == PCIADDR(0, 0, 0)) + dram_controller_dev = current; + break; + + case PCI_CLASS_NETWORK_ETHERNET: + if (do_eth_devprop) + set_eth_builtin(current); + break; + + case PCI_CLASS_DISPLAY_VGA: + if (do_gfx_devprop) + switch (current->vendor_id) + { + case PCI_VENDOR_ID_ATI: + setup_ati_devprop(current); + break; + + case PCI_VENDOR_ID_INTEL: + setup_gma_devprop(current); + break; + + case PCI_VENDOR_ID_NVIDIA: + setup_nvidia_devprop(current); + break; + } + break; + + case PCI_CLASS_SERIAL_USB: + notify_usb_dev(current); + break; + + case PCI_CLASS_BRIDGE_ISA: + if (do_enable_hpet) + force_enable_hpet(current); + break; + } + + execute_hook("PCIDevice", current, NULL, NULL, NULL); + + setup_pci_devs(current->children); + current = current->next; + } +} diff --git a/i386/libsaio/platform.c b/i386/libsaio/platform.c new file mode 100644 index 0000000..0fba999 --- /dev/null +++ b/i386/libsaio/platform.c @@ -0,0 +1,71 @@ +/* + * platform.c + * + * AsereBLN: cleanup + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" +#include "platform.h" +#include "cpu.h" +#include "spd.h" +#include "dram_controllers.h" + +#ifndef DEBUG_PLATFORM +#define DEBUG_PLATFORM 0 +#endif + +#if DEBUG_PLATFORM +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +PlatformInfo_t Platform; +pci_dt_t * dram_controller_dev = NULL; + +/** Return if a CPU feature specified by feature is activated (true) or not (false) */ +bool platformCPUFeature(uint32_t feature) +{ + if (Platform.CPU.Features & feature) { + return true; + } else { + return false; + } +} + +/** scan mem for memory autodection purpose */ +void scan_mem() { + static bool done = false; + if (done) return; + + /* our code only works on Intel chipsets so make sure here */ + if (pci_config_read16(PCIADDR(0, 0x00, 0), 0x00) != 0x8086) + bootInfo->memDetect = false; + else + bootInfo->memDetect = true; + /* manually */ + getBoolForKey(kUseMemDetect, &bootInfo->memDetect, &bootInfo->chameleonConfig); + + if (bootInfo->memDetect) { + if (dram_controller_dev != NULL) { + scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ... + } + scan_spd(&Platform); + } + done = true; +} + +/** + Scan platform hardware information, called by the main entry point (common_boot() ) + _before_ bootConfig xml parsing settings are loaded +*/ +void scan_platform(void) +{ + memset(&Platform, 0, sizeof(Platform)); + build_pci_dt(); + scan_cpu(&Platform); + //scan_mem(); Rek: called after pci devs init in fake_efi now ... +} diff --git a/i386/libsaio/platform.h b/i386/libsaio/platform.h new file mode 100644 index 0000000..9eb8e0f --- /dev/null +++ b/i386/libsaio/platform.h @@ -0,0 +1,166 @@ +/* + * platform.h + * AsereBLN: reworked and extended + * + */ + +#ifndef __LIBSAIO_PLATFORM_H +#define __LIBSAIO_PLATFORM_H + +//#include "libsaio.h" + +extern bool platformCPUFeature(uint32_t); +extern void scan_platform(void); +extern void dumpPhysAddr(const char * title, void * a, int len); + +/* CPUID Vendor */ +#define CPUID_VENDOR_INTEL 0x756E6547 +#define CPUID_VENDOR_AMD 0x68747541 + +/* CPUID index into cpuid_raw */ +#define CPUID_0 0 +#define CPUID_1 1 +#define CPUID_2 2 +#define CPUID_3 3 +#define CPUID_4 4 +#define CPUID_5 5 +#define CPUID_6 6 +#define CPUID_80 7 +#define CPUID_81 8 +#define CPUID_88 9 +#define CPUID_MAX 10 + +#define CPU_MODEL_DOTHAN 0x0D // Dothan +#define CPU_MODEL_YONAH 0x0E // Sossaman, Yonah +#define CPU_MODEL_MEROM 0x0F // Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom +#define CPU_MODEL_PENRYN 0x17 // Wolfdale, Yorkfield, Harpertown, Penryn +#define CPU_MODEL_NEHALEM 0x1A // Bloomfield. Nehalem-EP, Nehalem-WS, Gainestown +#define CPU_MODEL_ATOM 0x1C // Atom +#define CPU_MODEL_FIELDS 0x1E // Lynnfield, Clarksfield, Jasper Forest +#define CPU_MODEL_DALES 0x1F // Havendale, Auburndale +#define CPU_MODEL_DALES_32NM 0x25 // Clarkdale, Arrandale +#define CPU_MODEL_SANDYBRIDGE 0x2A // Sandy Bridge +#define CPU_MODEL_WESTMERE 0x2C // Gulftown, Westmere-EP, Westmere-WS +#define CPU_MODEL_JAKETOWN 0x2D // Sandy Bridge-E, Sandy Bridge-EP +#define CPU_MODEL_NEHALEM_EX 0x2E // Beckton +#define CPU_MODEL_WESTMERE_EX 0x2F // Westmere-EX +#define CPU_MODEL_IVYBRIDGE 0x3A // Ivy Bridge +#define CPU_MODEL_HASWELL 0x3C // Haswell + +/* CPU Features */ +#define CPU_FEATURE_MMX 0x00000001 // MMX Instruction Set +#define CPU_FEATURE_SSE 0x00000002 // SSE Instruction Set +#define CPU_FEATURE_SSE2 0x00000004 // SSE2 Instruction Set +#define CPU_FEATURE_SSE3 0x00000008 // SSE3 Instruction Set +#define CPU_FEATURE_SSE41 0x00000010 // SSE41 Instruction Set +#define CPU_FEATURE_SSE42 0x00000020 // SSE42 Instruction Set +#define CPU_FEATURE_EM64T 0x00000040 // 64Bit Support +#define CPU_FEATURE_HTT 0x00000080 // HyperThreading +#define CPU_FEATURE_MOBILE 0x00000100 // Mobile CPU +#define CPU_FEATURE_MSR 0x00000200 // MSR Support + +/* SMBIOS Memory Types */ +#define SMB_MEM_TYPE_UNDEFINED 0 +#define SMB_MEM_TYPE_OTHER 1 +#define SMB_MEM_TYPE_UNKNOWN 2 +#define SMB_MEM_TYPE_DRAM 3 +#define SMB_MEM_TYPE_EDRAM 4 +#define SMB_MEM_TYPE_VRAM 5 +#define SMB_MEM_TYPE_SRAM 6 +#define SMB_MEM_TYPE_RAM 7 +#define SMB_MEM_TYPE_ROM 8 +#define SMB_MEM_TYPE_FLASH 9 +#define SMB_MEM_TYPE_EEPROM 10 +#define SMB_MEM_TYPE_FEPROM 11 +#define SMB_MEM_TYPE_EPROM 12 +#define SMB_MEM_TYPE_CDRAM 13 +#define SMB_MEM_TYPE_3DRAM 14 +#define SMB_MEM_TYPE_SDRAM 15 +#define SMB_MEM_TYPE_SGRAM 16 +#define SMB_MEM_TYPE_RDRAM 17 +#define SMB_MEM_TYPE_DDR 18 +#define SMB_MEM_TYPE_DDR2 19 +#define SMB_MEM_TYPE_FBDIMM 20 +#define SMB_MEM_TYPE_DDR3 24 // Supported in 10.5.6+ AppleSMBIOS + +/* Memory Configuration Types */ +#define SMB_MEM_CHANNEL_UNKNOWN 0 +#define SMB_MEM_CHANNEL_SINGLE 1 +#define SMB_MEM_CHANNEL_DUAL 2 +#define SMB_MEM_CHANNEL_TRIPLE 3 + +/* Maximum number of ram slots */ +#define MAX_RAM_SLOTS 8 +#define RAM_SLOT_ENUMERATOR {0, 2, 4, 1, 3, 5, 6, 8, 10, 7, 9, 11} + +/* Maximum number of SPD bytes */ +#define MAX_SPD_SIZE 256 + +/* Size of SMBIOS UUID in bytes */ +#define UUID_LEN 16 + +typedef struct _RamSlotInfo_t { + uint32_t ModuleSize; // Size of Module in MB + uint32_t Frequency; // in Mhz + const char* Vendor; + const char* PartNo; + const char* SerialNo; + char* spd; // SPD Dump + bool InUse; + uint8_t Type; + uint8_t BankConnections; // table type 6, see (3.3.7) + uint8_t BankConnCnt; +} RamSlotInfo_t; + +typedef struct _PlatformInfo_t { + struct CPU { + uint32_t Features; // CPU Features like MMX, SSE2, VT, MobileCPU + uint32_t Vendor; // Vendor + uint32_t Signature; // Signature + uint32_t Stepping; // Stepping + uint32_t Model; // Model + uint32_t ExtModel; // Extended Model + uint32_t Family; // Family + uint32_t ExtFamily; // Extended Family + uint32_t NoCores; // No Cores per Package + uint32_t NoThreads; // Threads per Package + uint8_t MaxCoef; // Max Multiplier + uint8_t MaxDiv; + uint8_t CurrCoef; // Current Multiplier + uint8_t CurrDiv; + uint64_t TSCFrequency; // TSC Frequency Hz + uint64_t FSBFrequency; // FSB Frequency Hz + uint64_t CPUFrequency; // CPU Frequency Hz + uint32_t MaxRatio; // Max Bus Ratio + uint32_t MinRatio; // Min Bus Ratio + char BrandString[48]; // 48 Byte Branding String + uint32_t CPUID[CPUID_MAX][4]; // CPUID 0..4, 80..81 Raw Values + } CPU; + + struct RAM { + uint64_t Frequency; // Ram Frequency + uint32_t Divider; // Memory divider + uint8_t CAS; // CAS 1/2/2.5/3/4/5/6/7 + uint8_t TRC; + uint8_t TRP; + uint8_t RAS; + uint8_t Channels; // Channel Configuration Single,Dual or Triple + uint8_t NoSlots; // Maximum no of slots available + uint8_t Type; // Standard SMBIOS v2.5 Memory Type + RamSlotInfo_t DIMM[MAX_RAM_SLOTS]; // Information about each slot + } RAM; + + struct DMI { + int MaxMemorySlots; // number of memory slots populated by SMBIOS + int CntMemorySlots; // number of memory slots counted + int MemoryModules; // number of memory modules installed + int DIMM[MAX_RAM_SLOTS]; // Information and SPD mapping for each slot + } DMI; + + uint8_t Type; // System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FACP: PM_Profile) + uint8_t *UUID; +} PlatformInfo_t; + +extern PlatformInfo_t Platform; + +#endif /* !__LIBSAIO_PLATFORM_H */ diff --git a/i386/libsaio/saio_internal.h b/i386/libsaio/saio_internal.h new file mode 100644 index 0000000..840aa62 --- /dev/null +++ b/i386/libsaio/saio_internal.h @@ -0,0 +1,224 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_SAIO_INTERNAL_H +#define __LIBSAIO_SAIO_INTERNAL_H + +#include "saio_types.h" + +/* asm.s */ +extern void real_to_prot(void); +extern void prot_to_real(void); +extern void halt(void); +extern void startprog(unsigned int address, void *arg); +extern void loader(UInt32 code, UInt32 cmdptr); + +/* bios.s */ +extern void bios(biosBuf_t *bb); + +/* biosfn.c */ +#ifdef EISA_SUPPORT +extern bool eisa_present(void); +#endif +extern int bgetc(void); +extern int biosread(int dev, int cyl, int head, int sec, int num); +extern int ebiosread(int dev, unsigned long long sec, int count); +extern int ebioswrite(int dev, long sec, int count); +extern int get_drive_info(int drive, struct driveInfo *dp); +extern int ebiosEjectMedia(int biosdev); +extern void bios_putchar(int ch); +extern void putca(int ch, int attr, int repeat); +extern int readKeyboardStatus(void); +extern int readKeyboardShiftFlags(void); +extern unsigned int time18(void); +extern void delay(int ms); +extern unsigned int get_diskinfo(int dev); +#if APM_SUPPORT +extern int APMPresent(void); +extern int APMConnect32(void); +#endif +extern int memsize(int i); +extern void video_mode(int mode); +extern void setCursorPosition(int x, int y, int page); +extern void setCursorType(int type); +extern void getCursorPositionAndType(int *x, int *y, int *type); +extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir); +extern void clearScreenRows(int y1, int y2); +extern void setActiveDisplayPage( int page ); +extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount, + unsigned long * conMemSizePtr, unsigned long * extMemSizePtr); +extern unsigned long getExtendedMemorySize(); +extern unsigned long getConventionalMemorySize(); +extern void sleep(int n); + +/* bootstruct.c */ +extern void initKernBootStruct(void); +extern void reserveKernBootStruct(void); +extern void copyKernBootStruct(void); +extern void finalizeBootStruct(void); + +/* cache.c */ +extern void CacheReset(); +extern void CacheInit(CICell ih, long blockSize); +extern long CacheRead(CICell ih, char *buffer, long long offset, + long length, long cache); + +/* console.c */ +extern bool gVerboseMode; +extern bool gErrors; +extern void initBooterLog(void); +extern void msglog(const char * format, ...); +extern void setupBooterLog(void); +extern int putchar(int ch); +extern int getchar(void); +extern int printf(const char *format, ...); +extern int error(const char *format, ...); +extern int verbose(const char *format, ...); +extern void stop(const char *format, ...); +//Azi: replace getc/getchar with ? console.c +extern void pause(); + +/* disk.c */ +extern void rescanBIOSDevice(int biosdev); +extern struct DiskBVMap* diskResetBootVolumes(int biosdev); +extern void diskFreeMap(struct DiskBVMap *map); +extern int testBiosread( int biosdev, unsigned long long secno ); +extern BVRef diskScanBootVolumes(int biosdev, int *count); +extern void diskSeek(BVRef bvr, long long position); +extern int diskRead(BVRef bvr, long addr, long length); +extern int diskIsCDROM(BVRef bvr); +extern int biosDevIsCDROM(int biosdev); +extern BVRef getBVChainForBIOSDev(int biosdev); +extern BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count); +extern int freeFilteredBVChain(const BVRef chain); +extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); +extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); +extern int readBootSector(int biosdev, unsigned int secno, void *buffer); +extern void turnOffFloppy(void); +extern int testFAT32EFIBootSector( int biosdev, unsigned int secno, void * buffer ); + +/* hfs_compare.c */ +extern int32_t FastUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, + u_int16_t *uniStr2, u_int32_t len2, int byte_order); +extern void utf_encodestr( const u_int16_t * ucsp, int ucslen, + u_int8_t * utf8p, u_int32_t bufsize, int byte_order ); +extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp, + u_int16_t *ucslen, u_int32_t bufsize, int byte_order ); + +/* load.c */ +extern bool gHaveKernelCache; +extern long ThinFatFile(void **binary, unsigned long *length); +extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize); + +/* memory.c */ +long AllocateKernelMemory( long inSize ); +long AllocateMemoryRange(char * rangeName, long start, long length, long type); + +/* misc.c */ +extern void enableA20(void); +extern int checkForSupportedHardware(); +extern int isLaptop(); +extern void getPlatformName(char *nameBuf); + +/* nbp.c */ +extern UInt32 nbpUnloadBaseCode(); +extern BVRef nbpScanBootVolumes(int biosdev, int *count); + +/* stringTable.c */ +extern char * newStringFromList(char **list, int *size); +extern int stringLength(const char *table, int compress); +extern bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size); +extern bool removeKeyFromTable(const char *key, char *table); +extern char * newStringForStringTableKey(config_file_t *config, char *key); +extern char * newStringForKey(char *key, config_file_t *configBuff); +extern bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len); +extern bool getValueForKey(const char *key, const char **val, int *size, config_file_t *configBuff); +extern const char * getStringForKey(const char * key, config_file_t *config); +extern bool getBoolForKey(const char *key, bool *val, config_file_t *configBuff); +extern bool getIntForKey(const char *key, int *val, config_file_t *configBuff); +extern bool getColorForKey(const char *key, unsigned int *val, config_file_t *configBuff); +extern bool getDimensionForKey( const char *key, unsigned int *value, config_file_t *config, unsigned int dimension_max, unsigned int object_size ); +extern int loadConfigFile(const char *configFile, config_file_t *configBuff); +extern int loadSystemConfig(config_file_t *configBuff); +extern int loadHelperConfig(config_file_t *configBuff); +extern int loadChameleonConfig(config_file_t *configBuff); +extern char * newString(const char *oldString); +extern char * getNextArg(char ** ptr, char * val); +extern int ParseXMLFile( char * buffer, TagPtr * dict ); + +/* sys.c */ +extern BVRef getBootVolumeRef( const char * path, const char ** outPath ); +extern long LoadVolumeFile(BVRef bvr, const char *fileSpec); +extern long LoadFile(const char *fileSpec); +extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length); +extern long LoadThinFatFile(const char *fileSpec, void **binary); +extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name, + long *flags, long *time); +extern long GetFileInfo(const char *dirSpec, const char *name, + long *flags, long *time); +extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock); +extern long GetFSUUID(char *spec, char *uuidStr); +extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr); +extern int openmem(char *buf, int len); +extern int open(const char *str, int how); +extern int open_bvdev(const char *bvd, const char *path, int flags); +extern int close(int fdesc); +extern int file_size(int fdesc); +extern int read(int fdesc, char *buf, int count); +extern int write(int fdesc, const char *buf, int count); +extern int writebyte(int fdesc, char value); +extern int writeint(int fdesc, int value); +extern int b_lseek(int fdesc, int addr, int ptr); +extern int tell(int fdesc); +extern const char * systemConfigDir(void); +extern struct dirstuff * opendir(const char *path); +extern struct dirstuff * vol_opendir(BVRef bvr, const char *path); +extern int closedir(struct dirstuff *dirp); +extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time); +extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, + long * time, FinderInfo *finderInfo, long *infoValid); +extern void flushdev(void); +extern void scanBootVolumes(int biosdev, int *count); +extern void scanDisks(int biosdev, int *count); +extern BVRef selectBootVolume(BVRef chain); +extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, bool verbose); +extern void setRootVolume(BVRef volume); +extern void setBootGlobals(BVRef chain); +extern int getDeviceDescription(BVRef volume, char *str); + +extern int gBIOSDev; +extern int gBootFileType; +extern BVRef gBootVolume; +extern BVRef gBIOSBootVolume; + +// Function pointer to be filled in if ramdisks are available +extern int (*p_get_ramdisk_info)(int biosdev, struct driveInfo *dip); +extern int (*p_ramdiskReadBytes)( int biosdev, unsigned int blkno, + unsigned int byteoff, + unsigned int byteCount, void * buffer ); + +// Base64-decode.c +char *BASE64Decode(const char* src, int in_len, int* out_len); + +#endif /* !__LIBSAIO_SAIO_INTERNAL_H */ diff --git a/i386/libsaio/saio_types.h b/i386/libsaio/saio_types.h new file mode 100644 index 0000000..e35915f --- /dev/null +++ b/i386/libsaio/saio_types.h @@ -0,0 +1,275 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* Useful types. */ + +#ifndef __LIBSAIO_SAIO_TYPES_H +#define __LIBSAIO_SAIO_TYPES_H + +#include <sys/reboot.h> +#include <sys/types.h> +#include <sys/param.h> +#include "bios.h" +#include "nbp_cmd.h" +#include "bootargs.h" + +#if DEBUG +#define DEBUG_DISK(x) printf x +#else +#define DEBUG_DISK(x) +#endif + +typedef unsigned long entry_t; + +typedef struct { + unsigned int sectors:8; + unsigned int heads:8; + unsigned int cylinders:16; +} compact_diskinfo_t; + +struct driveParameters { + int cylinders; + int sectors; + int heads; + int totalDrives; +}; + +struct Tag { + long type; + char *string; + long offset; + struct Tag *tag; + struct Tag *tagNext; +}; +typedef struct Tag Tag, *TagPtr; + +/* + * Max size fo config data array, in bytes. + */ +#define IO_CONFIG_DATA_SIZE 40960 // was 4096 // was 163840 + +typedef struct { + char plist[IO_CONFIG_DATA_SIZE]; // buffer for plist + TagPtr dictionary; // buffer for xml dictionary + bool canOverride; // flag to mark a dictionary can be overriden +} config_file_t; + +/* + * BIOS drive information. + */ +struct boot_drive_info { + struct drive_params { + unsigned short buf_size; + unsigned short info_flags; + unsigned long phys_cyls; + unsigned long phys_heads; + unsigned long phys_spt; + unsigned long long phys_sectors; + unsigned short phys_nbps; + unsigned short dpte_offset; + unsigned short dpte_segment; + unsigned short key; + unsigned char path_len; + unsigned char reserved1; + unsigned short reserved2; + unsigned char bus_type[4]; + unsigned char interface_type[8]; + unsigned char interface_path[8]; + unsigned char dev_path[8]; + unsigned char reserved3; + unsigned char checksum; + } params; + struct drive_dpte { + unsigned short io_port_base; + unsigned short control_port_base; + unsigned char head_flags; + unsigned char vendor_info; + unsigned char irq : 4; + unsigned char irq_unused : 4; + unsigned char block_count; + unsigned char dma_channel : 4; + unsigned char dma_type : 4; + unsigned char pio_type : 4; + unsigned char pio_unused : 4; + unsigned short option_flags; + unsigned short reserved; + unsigned char revision; + unsigned char checksum; + } dpte; +} __attribute__((packed)); +typedef struct boot_drive_info boot_drive_info_t; + +struct driveInfo { + boot_drive_info_t di; + int uses_ebios; + int no_emulation; + int biosdev; + int valid; +}; + +typedef struct FinderInfo { + unsigned char data[16]; +} FinderInfo; + +struct BootVolume; +typedef struct BootVolume * BVRef; +typedef struct BootVolume * CICell; + +typedef long (*FSInit)(CICell ih); +typedef long (*FSLoadFile)(CICell ih, char * filePath); +typedef long (*FSReadFile)(CICell ih, char *filePath, void *base, uint64_t offset, uint64_t length); +typedef long (*FSGetFileBlock)(CICell ih, char *filePath, unsigned long long *firstBlock); +typedef long (*FSGetDirEntry)(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +typedef long (*FSGetUUID)(CICell ih, char *uuidStr); +typedef void (*BVGetDescription)(CICell ih, char * str, long strMaxLen); +// Can be just pointed to free or a special free function +typedef void (*BVFree)(CICell ih); + +struct iob { + unsigned int i_flgs; /* see F_* below */ + unsigned int i_offset; /* seek byte offset in file */ + int i_filesize; /* size of file */ + char * i_buf; /* file load address */ +}; + +#define BPS 512 /* sector size of the device */ +#define F_READ 0x1 /* file opened for reading */ +#define F_WRITE 0x2 /* file opened for writing */ +#define F_ALLOC 0x4 /* buffer allocated */ +#define F_FILE 0x8 /* file instead of device */ +#define F_NBSF 0x10 /* no bad sector forwarding */ +#define F_SSI 0x40 /* set skip sector inhibit */ +#define F_MEM 0x80 /* memory instead of file or device */ + +struct dirstuff { + char * dir_path; /* directory path */ + long long dir_index; /* directory entry index */ + BVRef dir_bvr; /* volume reference */ +}; + +#define BVSTRLEN 32 + +struct BootVolume { + BVRef next; /* list linkage pointer */ + int biosdev; /* BIOS device number */ + int type; /* device type (floppy, hd, network) */ + unsigned int flags; /* attribute flags */ + BVGetDescription description; /* BVGetDescription function */ + int part_no; /* partition number (1 based) */ + unsigned int part_boff; /* partition block offset */ + unsigned int part_type; /* partition type */ + unsigned int fs_boff; /* 1st block # of next read */ + unsigned int fs_byteoff; /* Byte offset for read within block */ + FSLoadFile fs_loadfile; /* FSLoadFile function */ + FSReadFile fs_readfile; /* FSReadFile function */ + FSGetDirEntry fs_getdirentry; /* FSGetDirEntry function */ + FSGetFileBlock fs_getfileblock; /* FSGetFileBlock function */ + FSGetUUID fs_getuuid; /* FSGetUUID function */ + unsigned int bps; /* bytes per sector for this device */ + char name[BVSTRLEN]; /* (name of partition) */ + char type_name[BVSTRLEN]; /* (type of partition, eg. Apple_HFS) */ + BVFree bv_free; /* BVFree function */ + uint32_t modTime; + char label[BVSTRLEN]; /* partition volume label */ + char altlabel[BVSTRLEN]; /* partition volume label */ + bool filtered; /* newFilteredBVChain() will set to TRUE */ + bool visible; /* will shown in the device list */ + char OSVersion[8]; + bool OSisServer; /* 1 = OS X server , 0 = OS X client */ + bool OSisInstaller; /* 1 = OS X Install partition / recover partition , 0 = OS X Install */ + +}; + +enum { + kBVFlagPrimary = 0x01, + kBVFlagNativeBoot = 0x02, + kBVFlagForeignBoot = 0x04, + kBVFlagBootable = 0x08, + kBVFlagEFISystem = 0x10, + kBVFlagBooter = 0x20, + kBVFlagSystemVolume = 0x40 +}; + +enum { + kBIOSDevTypeFloppy = 0x00, + kBIOSDevTypeHardDrive = 0x80, + kBIOSDevTypeNetwork = 0xE0, + kBIOSDevUnitMask = 0x0F, + kBIOSDevTypeMask = 0xF0, + kBIOSDevMask = 0xFF +}; + +enum { + kPartitionTypeHFS = 0xAF, + kPartitionTypeHPFS = 0x07, + kPartitionTypeFAT16 = 0x06, + kPartitionTypeFAT32 = 0x0c, + kPartitionTypeEXT3 = 0x83, + kPartitionTypeBEFS = 0xEB, + kPartitionTypeFreeBSD = 0xa5, + kPartitionTypeOpenBSD = 0xa6 +}; + +//#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask) +#define BIOS_DEV_UNIT(bvr) ((bvr)->biosdev - (bvr)->type) + +/* + * KernBootStruct device types. + */ +enum { + DEV_SD = 0, + DEV_HD = 1, + DEV_FD = 2, + DEV_EN = 3 +}; + +/* + * min/max Macros. + * counting and rounding Macros. + * + * Azi: defined on <sys/param.h>, + * i386/include/IOKit/IOLib.h (min/max), and others... + * +#ifndef MIN +#define MIN(a,b) ( ((a) < (b)) ? (a) : (b) ) +#endif +#ifndef MAX +#define MAX(a,b) ( ((a) > (b)) ? (a) : (b) ) +#endif + +#define round2(x, m) (((x) + (m / 2)) & ~(m - 1)) +#define roundup2(x, m) (((x) + m - 1) & ~(m - 1))*/ + +enum { + kNetworkDeviceType = kBIOSDevTypeNetwork, + kBlockDeviceType = kBIOSDevTypeHardDrive +}; //gBootFileType_t; + +enum { + kCursorTypeHidden = 0x0100, + kCursorTypeUnderline = 0x0607 +}; + +#endif /* !__LIBSAIO_SAIO_TYPES_H */ diff --git a/i386/libsaio/sl.h b/i386/libsaio/sl.h new file mode 100644 index 0000000..1ccf60c --- /dev/null +++ b/i386/libsaio/sl.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_SL_H +#define __LIBSAIO_SL_H + +#include <sys/types.h> +#include <sys/param.h> +#include <mach/i386/thread_status.h> +#include "libsaio.h" + +#define SWAP_BE16(x) OSSwapBigToHostInt16(x) +#define SWAP_LE16(x) OSSwapLittleToHostInt16(x) +#define SWAP_BE32(x) OSSwapBigToHostInt32(x) +#define SWAP_LE32(x) OSSwapLittleToHostInt32(x) +#define SWAP_BE64(x) OSSwapBigToHostInt64(x) +#define SWAP_LE64(x) OSSwapLittleToHostInt64(x) + +// File Permissions and Types +enum { + kPermOtherExecute = 1 << 0, + kPermOtherWrite = 1 << 1, + kPermOtherRead = 1 << 2, + kPermGroupExecute = 1 << 3, + kPermGroupWrite = 1 << 4, + kPermGroupRead = 1 << 5, + kPermOwnerExecute = 1 << 6, + kPermOwnerWrite = 1 << 7, + kPermOwnerRead = 1 << 8, + kPermMask = 0x1FF, + kOwnerNotRoot = 1 << 9, + kFileTypeUnknown = 0x0 << 16, + kFileTypeFlat = 0x1 << 16, + kFileTypeDirectory = 0x2 << 16, + kFileTypeLink = 0x3 << 16, + kFileTypeMask = 0x3 << 16 +}; + +#define Seek(c, p) diskSeek(c, p); +#define Read(c, a, l) diskRead(c, a, l); + +extern void * gFSLoadAddress; +extern cpu_type_t archCpuType; +cpu_type_t detectCpuType (); + +#endif /* !__LIBSAIO_SL_H */ diff --git a/i386/libsaio/smbios.c b/i386/libsaio/smbios.c new file mode 100644 index 0000000..cd74c0b --- /dev/null +++ b/i386/libsaio/smbios.c @@ -0,0 +1,837 @@ +/* + * SMBIOS Table Patcher, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + + +#include "boot.h" +#include "bootstruct.h" +#include "smbios_getters.h" + +#ifndef DEBUG_SMBIOS +#define DEBUG_SMBIOS 0 +#endif + +#if DEBUG_SMBIOS +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +#define SMBPlist &bootInfo->smbiosConfig +/* ASSUMPTION: 16KB should be enough for the whole thing */ +#define SMB_ALLOC_SIZE 16384 + + +//------------------------------------------------------------------------------------------------------------------------- +// SMBIOS Plist Keys +//------------------------------------------------------------------------------------------------------------------------- +/* BIOS Information */ +#define kSMBBIOSInformationVendorKey "SMbiosvendor" +#define kSMBBIOSInformationVersionKey "SMbiosversion" +#define kSMBBIOSInformationReleaseDateKey "SMbiosdate" + +/* System Information */ +#define kSMBSystemInformationManufacturerKey "SMmanufacturer" +#define kSMBSystemInformationProductNameKey "SMproductname" +#define kSMBSystemInformationVersionKey "SMsystemversion" +#define kSMBSystemInformationSerialNumberKey "SMserial" +#define kSMBSystemInformationFamilyKey "SMfamily" + +/* Base Board */ +#define kSMBBaseBoardManufacturerKey "SMboardmanufacturer" +#define kSMBBaseBoardProductKey "SMboardproduct" + +/* Processor Information */ +#define kSMBProcessorInformationExternalClockKey "SMexternalclock" +#define kSMBProcessorInformationMaximumClockKey "SMmaximalclock" + +/* Memory Device */ +#define kSMBMemoryDeviceDeviceLocatorKey "SMmemdevloc" +#define kSMBMemoryDeviceBankLocatorKey "SMmembankloc" +#define kSMBMemoryDeviceMemoryTypeKey "SMmemtype" +#define kSMBMemoryDeviceMemorySpeedKey "SMmemspeed" +#define kSMBMemoryDeviceManufacturerKey "SMmemmanufacturer" +#define kSMBMemoryDeviceSerialNumberKey "SMmemserial" +#define kSMBMemoryDevicePartNumberKey "SMmempart" + +/* Apple Specific */ +#define kSMBOemProcessorTypeKey "SMcputype" +#define kSMBOemProcessorBusSpeedKey "SMbusspeed" + +//------------------------------------------------------------------------------------------------------------------------- +// Default SMBIOS Data +//------------------------------------------------------------------------------------------------------------------------- +/* Rewrite: use a struct */ + +#define kDefaultVendorManufacturer "Apple Inc." +#define kDefaultBIOSReleaseDate "11/06/2009" +#define kDefaultSerialNumber "SOMESRLNMBR" +#define kDefaultBoardProduct "Mac-F4208DC8" +#define kDefaultSystemVersion "1.0" + +// defaults for a Mac mini +#define kDefaultMacminiFamily "Macmini" +#define kDefaultMacmini "Macmini1,1" +#define kDefaultMacminiBIOSVersion " MM21.88Z.009A.B00.0903051113" + +// defaults for a MacBook +#define kDefaultMacBookFamily "MacBook" +#define kDefaultMacBook "MacBook4,1" +#define kDefaultMacBookBIOSVersion " MB41.88Z.0073.B00.0903051113" + +// defaults for a MacBook Pro +#define kDefaultMacBookProFamily "MacBookPro" +#define kDefaultMacBookPro "MacBookPro4,1" +#define kDefaultMacBookProBIOSVersion " MBP41.88Z.0073.B00.0903051113" + +// defaults for an iMac +#define kDefaultiMacFamily "iMac" +#define kDefaultiMac "iMac8,1" +#define kDefaultiMacBIOSVersion " IM81.88Z.00C1.B00.0903051113" +// defaults for an iMac11,1 core i3/i5/i7 +#define kDefaultiMacNehalem "iMac11,1" +#define kDefaultiMacNehalemBIOSVersion " IM111.88Z.0034.B00.0903051113" +// defaults for an iMac12,1 +#define kDefaultiMacSandy "iMac12,1" +#define kDefaultiMacSandyBIOSVersion " IM121.88Z.0047.B00.1102091756" + +// defaults for a Mac Pro +#define kDefaultMacProFamily "MacPro" +#define kDefaultMacPro "MacPro3,1" +#define kDefaultMacProBIOSVersion " MP31.88Z.006C.B05.0903051113" +// defaults for a Mac Pro 4,1 core i7/Xeon +#define kDefaultMacProNehalem "MacPro4,1" +#define kDefaultMacProNehalemBIOSVersion " MP41.88Z.0081.B04.0903051113" +// defaults for a Mac Pro 5,1 core i7/Xeon +#define kDefaultMacProWestmere "MacPro5,1" +#define kDefaultMacProWestmereBIOSVersion " MP51.88Z.007F.B00.1008031144" +#define kDefaulMacProWestmereBIOSReleaseDate "08/03/10" +//------------------------------------------------------------------------------------------------------------------------- + + +#define getFieldOffset(struct, field) ((uint8_t)(uint32_t)&(((struct *)0)->field)) + +typedef struct { + SMBStructHeader *orig; + SMBStructHeader *new; +} SMBStructPtrs; + +struct { + char *vendor; + char *version; + char *releaseDate; +} defaultBIOSInfo; + +struct { + char *manufacturer; + char *productName; + char *version; + char *serialNumber; + char *family; +} defaultSystemInfo; + +struct { + char *manufacturer; + char *product; +} defaultBaseBoard; + + +typedef struct { + uint8_t type; + SMBValueType valueType; + uint8_t fieldOffset; + char *keyString; + bool (*getSMBValue)(returnType *); + char **defaultValue; +} SMBValueSetter; + +SMBValueSetter SMBSetters[] = +{ + //------------------------------------------------------------------------------------------------------------------------- + // BIOSInformation + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, vendor), kSMBBIOSInformationVendorKey, + NULL, &defaultBIOSInfo.vendor }, + + {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, version), kSMBBIOSInformationVersionKey, + NULL, &defaultBIOSInfo.version }, + + {kSMBTypeBIOSInformation, kSMBString, getFieldOffset(SMBBIOSInformation, releaseDate), kSMBBIOSInformationReleaseDateKey, + NULL, &defaultBIOSInfo.releaseDate }, + + //------------------------------------------------------------------------------------------------------------------------- + // SystemInformation + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, manufacturer), kSMBSystemInformationManufacturerKey, + NULL, &defaultSystemInfo.manufacturer }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, productName), kSMBSystemInformationProductNameKey, + NULL, &defaultSystemInfo.productName }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, version), kSMBSystemInformationVersionKey, + NULL, &defaultSystemInfo.version }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, serialNumber), kSMBSystemInformationSerialNumberKey, + NULL, &defaultSystemInfo.serialNumber }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, skuNumber), NULL, + NULL, NULL }, + + {kSMBTypeSystemInformation, kSMBString, getFieldOffset(SMBSystemInformation, family), kSMBSystemInformationFamilyKey, + NULL, &defaultSystemInfo.family }, + + + //------------------------------------------------------------------------------------------------------------------------- + // BaseBoard + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, manufacturer), kSMBBaseBoardManufacturerKey, + NULL, &defaultBaseBoard.manufacturer }, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, product), kSMBBaseBoardProductKey, + NULL, &defaultBaseBoard.product }, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, version), NULL, NULL, NULL}, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, serialNumber), NULL, NULL, NULL}, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, assetTagNumber), NULL, NULL, NULL}, + + {kSMBTypeBaseBoard, kSMBString, getFieldOffset(SMBBaseBoard, locationInChassis), NULL, NULL, NULL}, + + + //------------------------------------------------------------------------------------------------------------------------- + // ProcessorInformation + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, socketDesignation), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, manufacturer), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, processorVersion), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, externalClock), kSMBProcessorInformationExternalClockKey, + getProcessorInformationExternalClock, NULL}, + + {kSMBTypeProcessorInformation, kSMBWord, getFieldOffset(SMBProcessorInformation, maximumClock), kSMBProcessorInformationMaximumClockKey, + getProcessorInformationMaximumClock, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, serialNumber), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, assetTag), NULL, NULL, NULL}, + + {kSMBTypeProcessorInformation, kSMBString, getFieldOffset(SMBProcessorInformation, partNumber), NULL, NULL, NULL}, + + //------------------------------------------------------------------------------------------------------------------------- + // Memory Device + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, deviceLocator), kSMBMemoryDeviceDeviceLocatorKey, + NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, bankLocator), kSMBMemoryDeviceBankLocatorKey, + NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBByte, getFieldOffset(SMBMemoryDevice, memoryType), kSMBMemoryDeviceMemoryTypeKey, + getSMBMemoryDeviceMemoryType, NULL}, + + {kSMBTypeMemoryDevice, kSMBWord, getFieldOffset(SMBMemoryDevice, memorySpeed), kSMBMemoryDeviceMemorySpeedKey, + getSMBMemoryDeviceMemorySpeed, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, manufacturer), kSMBMemoryDeviceManufacturerKey, + getSMBMemoryDeviceManufacturer, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, serialNumber), kSMBMemoryDeviceSerialNumberKey, + getSMBMemoryDeviceSerialNumber, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, assetTag), NULL, NULL, NULL}, + + {kSMBTypeMemoryDevice, kSMBString, getFieldOffset(SMBMemoryDevice, partNumber), kSMBMemoryDevicePartNumberKey, + getSMBMemoryDevicePartNumber, NULL}, + + + //------------------------------------------------------------------------------------------------------------------------- + // Apple Specific + //------------------------------------------------------------------------------------------------------------------------- + {kSMBTypeOemProcessorType, kSMBWord, getFieldOffset(SMBOemProcessorType, ProcessorType), kSMBOemProcessorTypeKey, + getSMBOemProcessorType, NULL}, + + {kSMBTypeOemProcessorBusSpeed, kSMBWord, getFieldOffset(SMBOemProcessorBusSpeed, ProcessorBusSpeed), kSMBOemProcessorBusSpeedKey, + getSMBOemProcessorBusSpeed, NULL} +}; + +int numOfSetters = sizeof(SMBSetters) / sizeof(SMBValueSetter); + + +SMBEntryPoint *origeps = 0; +SMBEntryPoint *neweps = 0; + +static uint8_t stringIndex; // increament when a string is added and set the field value accordingly +static uint8_t stringsSize; // add string size + +static SMBWord tableLength = 0; +static SMBWord handle = 0; +static SMBWord maxStructSize = 0; +static SMBWord structureCount = 0; + +/* Rewrite this function */ +void setDefaultSMBData(void) +{ + defaultBIOSInfo.vendor = kDefaultVendorManufacturer; + defaultBIOSInfo.releaseDate = kDefaultBIOSReleaseDate; + + defaultSystemInfo.manufacturer = kDefaultVendorManufacturer; + defaultSystemInfo.version = kDefaultSystemVersion; + defaultSystemInfo.serialNumber = kDefaultSerialNumber; + + defaultBaseBoard.manufacturer = kDefaultVendorManufacturer; + defaultBaseBoard.product = kDefaultBoardProduct; + + if (platformCPUFeature(CPU_FEATURE_MOBILE)) + { + if (Platform.CPU.NoCores > 1) + { + defaultBIOSInfo.version = kDefaultMacBookProBIOSVersion; + defaultSystemInfo.productName = kDefaultMacBookPro; + defaultSystemInfo.family = kDefaultMacBookProFamily; + } + else + { + defaultBIOSInfo.version = kDefaultMacBookBIOSVersion; + defaultSystemInfo.productName = kDefaultMacBook; + defaultSystemInfo.family = kDefaultMacBookFamily; + } + } + else + { + switch (Platform.CPU.NoCores) + { + case 1: + defaultBIOSInfo.version = kDefaultMacminiBIOSVersion; + defaultSystemInfo.productName = kDefaultMacmini; + defaultSystemInfo.family = kDefaultMacminiFamily; + break; + + case 2: + defaultBIOSInfo.version = kDefaultiMacBIOSVersion; + defaultSystemInfo.productName = kDefaultiMac; + defaultSystemInfo.family = kDefaultiMacFamily; + break; + default: + { + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + defaultBIOSInfo.version = kDefaultiMacNehalemBIOSVersion; + defaultSystemInfo.productName = kDefaultiMacNehalem; + defaultSystemInfo.family = kDefaultiMacFamily; + break; + + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + defaultBIOSInfo.version = kDefaultiMacSandyBIOSVersion; + defaultSystemInfo.productName = kDefaultiMacSandy; + defaultSystemInfo.family = kDefaultiMacFamily; + break; + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + defaultBIOSInfo.version = kDefaultMacProNehalemBIOSVersion; + defaultSystemInfo.productName = kDefaultMacProNehalem; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + defaultBIOSInfo.version = kDefaultMacProWestmereBIOSVersion; + defaultBIOSInfo.releaseDate = kDefaulMacProWestmereBIOSReleaseDate; + defaultSystemInfo.productName = kDefaultMacProWestmere; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + + default: + defaultBIOSInfo.version = kDefaultMacProBIOSVersion; + defaultSystemInfo.productName = kDefaultMacPro; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + } + break; + } + default: + defaultBIOSInfo.version = kDefaultMacProBIOSVersion; + defaultSystemInfo.productName = kDefaultMacPro; + defaultSystemInfo.family = kDefaultMacProFamily; + break; + } + break; + } + } + } +} + +/* Used for SM*n smbios.plist keys */ +bool getSMBValueForKey(SMBStructHeader *structHeader, const char *keyString, const char **string, returnType *value) +{ + static int idx = -1; + static int current = -1; + int len; + char key[24]; + + if (current != structHeader->handle) + { + idx++; + current = structHeader->handle; + } + + sprintf(key, "%s%d", keyString, idx); + + if (value) + { + if (getIntForKey(key, (int *)&(value->dword), SMBPlist)) + return true; + } + else + { + if (getValueForKey(key, string, &len, SMBPlist)) + return true; + } + + return false; +} + +char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field) +{ + uint8_t *stringPtr = (uint8_t *)structHeader + structHeader->length; + + if (!field) + return NULL; + + for (field--; field != 0 && strlen((char *)stringPtr) > 0; + field--, stringPtr = (uint8_t *)((uint32_t)stringPtr + strlen((char *)stringPtr) + 1)); + + return (char *)stringPtr; +} + +void setSMBStringForField(SMBStructHeader *structHeader, const char *string, uint8_t *field) +{ + int strSize; + + if (!field) + return; + if (!string) + { + *field = 0; + return; + } + + strSize = strlen(string); + + // remove any spaces found at the end + while ((strSize != 0) && (string[strSize - 1] == ' ')) + strSize--; + + if (strSize == 0) + { + *field = 0; + return; + } + + memcpy((uint8_t *)structHeader + structHeader->length + stringsSize, string, strSize); + *field = stringIndex; + + stringIndex++; + stringsSize += strSize + 1; +} + +bool setSMBValue(SMBStructPtrs *structPtr, int idx, returnType *value) +{ + const char *string = 0; + int len; + bool parsed; + int val; + + if (numOfSetters <= idx) + return false; + + switch (SMBSetters[idx].valueType) + { + case kSMBString: + if (SMBSetters[idx].keyString) + { + if (getValueForKey(SMBSetters[idx].keyString, &string, &len, SMBPlist)) + break; + else + if (structPtr->orig->type == kSMBTypeMemoryDevice) // MemoryDevice only + if (getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, &string, NULL)) + break; + } + if (SMBSetters[idx].getSMBValue) + if (SMBSetters[idx].getSMBValue((returnType *)&string)) + break; + if ((SMBSetters[idx].defaultValue) && *(SMBSetters[idx].defaultValue)) + { + string = *(SMBSetters[idx].defaultValue); + break; + } + string = getSMBStringForField(structPtr->orig, *(uint8_t *)value); + break; + + case kSMBByte: + case kSMBWord: + case kSMBDWord: + //case kSMBQWord: + if (SMBSetters[idx].keyString) + { + parsed = getIntForKey(SMBSetters[idx].keyString, &val, SMBPlist); + if (!parsed) + if (structPtr->orig->type == kSMBTypeMemoryDevice) // MemoryDevice only + parsed = getSMBValueForKey(structPtr->orig, SMBSetters[idx].keyString, NULL, (returnType *)&val); + if (parsed) + { + switch (SMBSetters[idx].valueType) + { + case kSMBByte: + value->byte = (uint8_t)val; + break; + case kSMBWord: + value->word = (uint16_t)val; + break; + case kSMBDWord: + default: + value->dword = (uint32_t)val; + break; + } + return true; + } + } + + if (SMBSetters[idx].getSMBValue) + if (SMBSetters[idx].getSMBValue(value)) + return true; +#if 0 + if (*(SMBSetters[idx].defaultValue)) + { + value->dword = *(uint32_t *)(SMBSetters[idx].defaultValue); + return true; + } +#endif + break; + } + + if (SMBSetters[idx].valueType == kSMBString && string) + setSMBStringForField(structPtr->new, string, &value->byte); + + return true; +} + +//------------------------------------------------------------------------------------------------------------------------- +// Apple Specific +//------------------------------------------------------------------------------------------------------------------------- +void addSMBFirmwareVolume(SMBStructPtrs *structPtr) +{ + return; +} + +void addSMBMemorySPD(SMBStructPtrs *structPtr) +{ + /* SPD data from Platform.RAM.spd */ + return; +} + +void addSMBOemProcessorType(SMBStructPtrs *structPtr) +{ + SMBOemProcessorType *p = (SMBOemProcessorType *)structPtr->new; + + p->header.type = kSMBTypeOemProcessorType; + p->header.length = sizeof(SMBOemProcessorType); + p->header.handle = handle++; + + setSMBValue(structPtr, numOfSetters - 2 , (returnType *)&(p->ProcessorType)); + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBOemProcessorType) + 2); + tableLength += sizeof(SMBOemProcessorType) + 2; + structureCount++; +} + +void addSMBOemProcessorBusSpeed(SMBStructPtrs *structPtr) +{ + SMBOemProcessorBusSpeed *p = (SMBOemProcessorBusSpeed *)structPtr->new; + + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1155 (22nm) + break; + + default: + return; + } + } + } + + p->header.type = kSMBTypeOemProcessorBusSpeed; + p->header.length = sizeof(SMBOemProcessorBusSpeed); + p->header.handle = handle++; + + setSMBValue(structPtr, numOfSetters -1, (returnType *)&(p->ProcessorBusSpeed)); + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBOemProcessorBusSpeed) + 2); + tableLength += sizeof(SMBOemProcessorBusSpeed) + 2; + structureCount++; +} + +//------------------------------------------------------------------------------------------------------------------------- +// EndOfTable +//------------------------------------------------------------------------------------------------------------------------- +void addSMBEndOfTable(SMBStructPtrs *structPtr) +{ + structPtr->new->type = kSMBTypeEndOfTable; + structPtr->new->length = sizeof(SMBStructHeader); + structPtr->new->handle = handle++; + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + sizeof(SMBStructHeader) + 2); + tableLength += sizeof(SMBStructHeader) + 2; + structureCount++; +} + +void setSMBStruct(SMBStructPtrs *structPtr) +{ + bool setterFound = false; + + uint8_t *ptr; + SMBWord structSize; + int i; + + stringIndex = 1; + stringsSize = 0; + + if (handle < structPtr->orig->handle) + handle = structPtr->orig->handle; + + memcpy((void *)structPtr->new, structPtr->orig, structPtr->orig->length); + + for (i = 0; i < numOfSetters; i++) + if ((structPtr->orig->type == SMBSetters[i].type) && (SMBSetters[i].fieldOffset < structPtr->orig->length)) + { + setterFound = true; + setSMBValue(structPtr, i, (returnType *)((uint8_t *)structPtr->new + SMBSetters[i].fieldOffset)); + } + + if (setterFound) + { + ptr = (uint8_t *)structPtr->new + structPtr->orig->length; + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structSize = ptr - (uint8_t *)structPtr->new; + } + else + { + ptr = (uint8_t *)structPtr->orig + structPtr->orig->length; + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structSize = ptr - (uint8_t *)structPtr->orig; + memcpy((void *)structPtr->new, structPtr->orig, structSize); + } + + structPtr->new = (SMBStructHeader *)((uint8_t *)structPtr->new + structSize); + + tableLength += structSize; + + if (structSize > maxStructSize) + maxStructSize = structSize; + + structureCount++; +} + +void setupNewSMBIOSTable(SMBEntryPoint *eps, SMBStructPtrs *structPtr) +{ + uint8_t *ptr = (uint8_t *)eps->dmi.tableAddress; + structPtr->orig = (SMBStructHeader *)ptr; + + for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structPtr->orig + sizeof(SMBStructHeader)));) + { + switch (structPtr->orig->type) + { + /* Skip all Apple Specific Structures */ + case kSMBTypeFirmwareVolume: + case kSMBTypeMemorySPD: + case kSMBTypeOemProcessorType: + case kSMBTypeOemProcessorBusSpeed: + /* And this one too, to be added at the end */ + case kSMBTypeEndOfTable: + break; + + default: + /* Add */ + setSMBStruct(structPtr); + break; + } + + ptr = (uint8_t *)((uint32_t)structPtr->orig + structPtr->orig->length); + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structPtr->orig = (SMBStructHeader *)ptr; + } + + addSMBFirmwareVolume(structPtr); + addSMBMemorySPD(structPtr); + addSMBOemProcessorType(structPtr); + addSMBOemProcessorBusSpeed(structPtr); + + addSMBEndOfTable(structPtr); +} + +void setupSMBIOSTable(void) +{ + SMBStructPtrs *structPtr; + uint8_t *buffer; + bool setSMB = true; + + if (!origeps) + return; + + neweps = origeps; + + structPtr = (SMBStructPtrs *)malloc(sizeof(SMBStructPtrs)); + if (!structPtr) + return; + + buffer = malloc(SMB_ALLOC_SIZE); + if (!buffer) + return; + + bzero(buffer, SMB_ALLOC_SIZE); + structPtr->new = (SMBStructHeader *)buffer; + + getBoolForKey(kSMBIOSdefaults, &setSMB, &bootInfo->chameleonConfig); + if (setSMB) + setDefaultSMBData(); + + setupNewSMBIOSTable(origeps, structPtr); + + neweps = (SMBEntryPoint *)AllocateKernelMemory(sizeof(SMBEntryPoint)); + if (!neweps) + return; + bzero(neweps, sizeof(SMBEntryPoint)); + + neweps->anchor[0] = '_'; + neweps->anchor[1] = 'S'; + neweps->anchor[2] = 'M'; + neweps->anchor[3] = '_'; + neweps->entryPointLength = sizeof(SMBEntryPoint); + neweps->majorVersion = 2; + neweps->minorVersion = 4; + neweps->maxStructureSize = maxStructSize; + neweps->entryPointRevision = 0; + + neweps->dmi.anchor[0] = '_'; + neweps->dmi.anchor[1] = 'D'; + neweps->dmi.anchor[2] = 'M'; + neweps->dmi.anchor[3] = 'I'; + neweps->dmi.anchor[4] = '_'; + neweps->dmi.tableLength = tableLength; + neweps->dmi.tableAddress = AllocateKernelMemory(tableLength); + neweps->dmi.structureCount = structureCount; + neweps->dmi.bcdRevision = 0x24; + + if (!neweps->dmi.tableAddress) + return; + + memcpy((void *)neweps->dmi.tableAddress, buffer, tableLength); + + neweps->dmi.checksum = 0; + neweps->dmi.checksum = 0x100 - checksum8(&neweps->dmi, sizeof(DMIEntryPoint)); + + neweps->checksum = 0; + neweps->checksum = 0x100 - checksum8(neweps, sizeof(SMBEntryPoint)); + + free(buffer); + decodeSMBIOSTable(neweps); +} + +void *getSmbios(int which) +{ + switch (which) + { + case SMBIOS_ORIGINAL: + if (!origeps) + origeps = getAddressOfSmbiosTable(); + return origeps; + case SMBIOS_PATCHED: + return neweps; + } + + return 0; +} + +/* Collect any information needed later */ +void readSMBIOSInfo(SMBEntryPoint *eps) +{ + uint8_t *structPtr = (uint8_t *)eps->dmi.tableAddress; + SMBStructHeader *structHeader = (SMBStructHeader *)structPtr; + + int dimmnbr = 0; + Platform.DMI.MaxMemorySlots = 0; + Platform.DMI.CntMemorySlots = 0; + Platform.DMI.MemoryModules = 0; + + for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structHeader + sizeof(SMBStructHeader)));) + { + switch (structHeader->type) + { + case kSMBTypeSystemInformation: + Platform.UUID = ((SMBSystemInformation *)structHeader)->uuid; + break; + + case kSMBTypePhysicalMemoryArray: + Platform.DMI.MaxMemorySlots += ((SMBPhysicalMemoryArray *)structHeader)->numMemoryDevices; + break; + + case kSMBTypeMemoryDevice: + Platform.DMI.CntMemorySlots++; + if (((SMBMemoryDevice *)structHeader)->memorySize != 0) + Platform.DMI.MemoryModules++; + if (((SMBMemoryDevice *)structHeader)->memorySpeed > 0) + Platform.RAM.DIMM[dimmnbr].Frequency = ((SMBMemoryDevice *)structHeader)->memorySpeed; + dimmnbr++; + break; + } + + structPtr = (uint8_t *)((uint32_t)structHeader + structHeader->length); + for (; ((uint16_t *)structPtr)[0] != 0; structPtr++); + + if (((uint16_t *)structPtr)[0] == 0) + structPtr += 2; + + structHeader = (SMBStructHeader *)structPtr; + } +} + diff --git a/i386/libsaio/smbios.h b/i386/libsaio/smbios.h new file mode 100644 index 0000000..7078149 --- /dev/null +++ b/i386/libsaio/smbios.h @@ -0,0 +1,423 @@ +/* + * Copyright (c) 1998-2009 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_SMBIOS_H +#define __LIBSAIO_SMBIOS_H + +// +// Based on System Management BIOS Reference Specification v2.5 +// + +typedef uint8_t SMBString; +typedef uint8_t SMBByte; +typedef uint16_t SMBWord; +typedef uint32_t SMBDWord; +typedef uint64_t SMBQWord; + + +typedef struct DMIEntryPoint { + SMBByte anchor[5]; + SMBByte checksum; + SMBWord tableLength; + SMBDWord tableAddress; + SMBWord structureCount; + SMBByte bcdRevision; +} __attribute__((packed)) DMIEntryPoint; + +typedef struct SMBEntryPoint { + SMBByte anchor[4]; + SMBByte checksum; + SMBByte entryPointLength; + SMBByte majorVersion; + SMBByte minorVersion; + SMBWord maxStructureSize; + SMBByte entryPointRevision; + SMBByte formattedArea[5]; + DMIEntryPoint dmi; +} __attribute__((packed)) SMBEntryPoint; + +// +// Header common to all SMBIOS structures +// + +typedef struct SMBStructHeader { + SMBByte type; + SMBByte length; + SMBWord handle; +} __attribute__((packed)) SMBStructHeader; + +#define SMB_STRUCT_HEADER SMBStructHeader header; + +typedef struct SMBAnchor +{ + const SMBStructHeader * header; + const uint8_t * next; + const uint8_t * end; +} SMBAnchor; + +#define SMB_ANCHOR_IS_VALID(x) \ + ((x) && ((x)->header) && ((x)->next) && ((x)->end)) + +#define SMB_ANCHOR_RESET(x) \ + bzero(x, sizeof(typedef struct SMBAnchor)); + +// +// SMBIOS structure types. +// + +enum { + kSMBTypeBIOSInformation = 0, + kSMBTypeSystemInformation = 1, + kSMBTypeBaseBoard = 2, + kSMBTypeSystemEnclosure = 3, + kSMBTypeProcessorInformation = 4, + kSMBTypeMemoryModule = 6, + kSMBTypeCacheInformation = 7, + kSMBTypeSystemSlot = 9, + kSMBTypePhysicalMemoryArray = 16, + kSMBTypeMemoryDevice = 17, + kSMBType32BitMemoryErrorInfo = 18, + kSMBType64BitMemoryErrorInfo = 33, + + kSMBTypeEndOfTable = 127, + + /* Apple Specific Structures */ + kSMBTypeFirmwareVolume = 128, + kSMBTypeMemorySPD = 130, + kSMBTypeOemProcessorType = 131, + kSMBTypeOemProcessorBusSpeed = 132 +}; + +// +// BIOS Information (Type 0) +// +typedef struct SMBBIOSInformation { + SMB_STRUCT_HEADER // Type 0 + SMBString vendor; // BIOS vendor name + SMBString version; // BIOS version + SMBWord startSegment; // BIOS segment start + SMBString releaseDate; // BIOS release date + SMBByte romSize; // (n); 64K * (n+1) bytes + SMBQWord characteristics; // supported BIOS functions +} __attribute__((packed)) SMBBIOSInformation; + +// +// System Information (Type 1) +// + +typedef struct SMBSystemInformation { + // 2.0+ spec (8 bytes) + SMB_STRUCT_HEADER // Type 1 + SMBString manufacturer; + SMBString productName; + SMBString version; + SMBString serialNumber; + // 2.1+ spec (25 bytes) + SMBByte uuid[16]; // can be all 0 or all 1's + SMBByte wakeupReason; // reason for system wakeup + // 2.4+ spec (27 bytes) + SMBString skuNumber; + SMBString family; +} __attribute__((packed)) SMBSystemInformation; + +// +// Base Board (Type 2) +// + +typedef struct SMBBaseBoard { + SMB_STRUCT_HEADER // Type 2 + SMBString manufacturer; + SMBString product; + SMBString version; + SMBString serialNumber; + SMBString assetTagNumber; + SMBByte featureFlags; + SMBString locationInChassis; + SMBWord chassisHandle; + SMBByte boardType; + SMBByte numberOfContainedHandles; + // 0 - 255 contained handles go here but we do not include + // them in our structure. Be careful to use numberOfContainedHandles + // times sizeof(SMBWord) when computing the actual record size, + // if you need it. +} __attribute__((packed)) SMBBaseBoard; + +// Values for boardType in Type 2 records +enum { + kSMBBaseBoardUnknown = 0x01, + kSMBBaseBoardOther = 0x02, + kSMBBaseBoardServerBlade = 0x03, + kSMBBaseBoardConnectivitySwitch = 0x04, + kSMBBaseBoardSystemMgmtModule = 0x05, + kSMBBaseBoardProcessorModule = 0x06, + kSMBBaseBoardIOModule = 0x07, + kSMBBaseBoardMemoryModule = 0x08, + kSMBBaseBoardDaughter = 0x09, + kSMBBaseBoardMotherboard = 0x0A, + kSMBBaseBoardProcessorMemoryModule = 0x0B, + kSMBBaseBoardProcessorIOModule = 0x0C, + kSMBBaseBoardInterconnect = 0x0D, +}; + + +// +// System Enclosure (Type 3) +// + +typedef struct SMBSystemEnclosure { + SMB_STRUCT_HEADER // Type 3 + SMBString manufacturer; + SMBByte type; + SMBString version; + SMBString serialNumber; + SMBString assetTagNumber; + SMBByte bootupState; + SMBByte powerSupplyState; + SMBByte thermalState; + SMBByte securityStatus; + SMBDWord oemDefined; +} __attribute__((packed)) SMBSystemEnclosure; + +// +// Processor Information (Type 4) +// + +typedef struct SMBProcessorInformation { + // 2.0+ spec (26 bytes) + SMB_STRUCT_HEADER // Type 4 + SMBString socketDesignation; + SMBByte processorType; // CPU = 3 + SMBByte processorFamily; // processor family enum + SMBString manufacturer; + SMBQWord processorID; // based on CPUID + SMBString processorVersion; + SMBByte voltage; // bit7 cleared indicate legacy mode + SMBWord externalClock; // external clock in MHz + SMBWord maximumClock; // max internal clock in MHz + SMBWord currentClock; // current internal clock in MHz + SMBByte status; + SMBByte processorUpgrade; // processor upgrade enum + // 2.1+ spec (32 bytes) + SMBWord L1CacheHandle; + SMBWord L2CacheHandle; + SMBWord L3CacheHandle; + // 2.3+ spec (35 bytes) + SMBString serialNumber; + SMBString assetTag; + SMBString partNumber; +} __attribute__((packed)) SMBProcessorInformation; + +#define kSMBProcessorInformationMinSize 26 + +// +// Memory Module Information (Type 6) +// Obsoleted since SMBIOS version 2.1 +// + +typedef struct SMBMemoryModule { + SMB_STRUCT_HEADER // Type 6 + SMBString socketDesignation; + SMBByte bankConnections; + SMBByte currentSpeed; + SMBWord currentMemoryType; + SMBByte installedSize; + SMBByte enabledSize; + SMBByte errorStatus; +} __attribute__((packed)) SMBMemoryModule; + +#define kSMBMemoryModuleSizeNotDeterminable 0x7D +#define kSMBMemoryModuleSizeNotEnabled 0x7E +#define kSMBMemoryModuleSizeNotInstalled 0x7F + +// +// Cache Information (Type 7) +// + +typedef struct SMBCacheInformation { + SMB_STRUCT_HEADER // Type 7 + SMBString socketDesignation; + SMBWord cacheConfiguration; + SMBWord maximumCacheSize; + SMBWord installedSize; + SMBWord supportedSRAMType; + SMBWord currentSRAMType; + SMBByte cacheSpeed; + SMBByte errorCorrectionType; + SMBByte systemCacheType; + SMBByte associativity; +} __attribute__((packed)) SMBCacheInformation; + +typedef struct SMBSystemSlot { + // 2.0+ spec (12 bytes) + SMB_STRUCT_HEADER // Type 9 + SMBString slotDesignation; + SMBByte slotType; + SMBByte slotDataBusWidth; + SMBByte currentUsage; + SMBByte slotLength; + SMBWord slotID; + SMBByte slotCharacteristics1; + // 2.1+ spec (13 bytes) + SMBByte slotCharacteristics2; +} __attribute__((packed)) SMBSystemSlot; + +// +// Physical Memory Array (Type 16) +// + +typedef struct SMBPhysicalMemoryArray { + // 2.1+ spec (15 bytes) + SMB_STRUCT_HEADER // Type 16 + SMBByte physicalLocation; // physical location + SMBByte arrayUse; // the use for the memory array + SMBByte errorCorrection; // error correction/detection method + SMBDWord maximumCapacity; // maximum memory capacity in kilobytes + SMBWord errorHandle; // handle of a previously detected error + SMBWord numMemoryDevices; // number of memory slots or sockets +} __attribute__((packed)) SMBPhysicalMemoryArray; + +// Memory Array - Use +enum { + kSMBMemoryArrayUseOther = 0x01, + kSMBMemoryArrayUseUnknown = 0x02, + kSMBMemoryArrayUseSystemMemory = 0x03, + kSMBMemoryArrayUseVideoMemory = 0x04, + kSMBMemoryArrayUseFlashMemory = 0x05, + kSMBMemoryArrayUseNonVolatileMemory = 0x06, + kSMBMemoryArrayUseCacheMemory = 0x07 +}; + +// Memory Array - Error Correction Types +enum { + kSMBMemoryArrayErrorCorrectionTypeOther = 0x01, + kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02, + kSMBMemoryArrayErrorCorrectionTypeNone = 0x03, + kSMBMemoryArrayErrorCorrectionTypeParity = 0x04, + kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05, + kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06, + kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07 +}; + +// +// Memory Device (Type 17) +// + +typedef struct SMBMemoryDevice { + // 2.1+ spec (21 bytes) + SMB_STRUCT_HEADER // Type 17 + SMBWord arrayHandle; // handle of the parent memory array + SMBWord errorHandle; // handle of a previously detected error + SMBWord totalWidth; // total width in bits; including ECC bits + SMBWord dataWidth; // data width in bits + SMBWord memorySize; // bit15 is scale, 0 = MB, 1 = KB + SMBByte formFactor; // memory device form factor + SMBByte deviceSet; // parent set of identical memory devices + SMBString deviceLocator; // labeled socket; e.g. "SIMM 3" + SMBString bankLocator; // labeled bank; e.g. "Bank 0" or "A" + SMBByte memoryType; // type of memory + SMBWord memoryTypeDetail; // additional detail on memory type + // 2.3+ spec (27 bytes) + SMBWord memorySpeed; // speed of device in MHz (0 for unknown) + SMBString manufacturer; + SMBString serialNumber; + SMBString assetTag; + SMBString partNumber; +} __attribute__((packed)) SMBMemoryDevice; + +// +// Firmware Volume Description (Apple Specific - Type 128) +// + +enum { + FW_REGION_RESERVED = 0, + FW_REGION_RECOVERY = 1, + FW_REGION_MAIN = 2, + FW_REGION_NVRAM = 3, + FW_REGION_CONFIG = 4, + FW_REGION_DIAGVAULT = 5, + + NUM_FLASHMAP_ENTRIES = 8 +}; + +typedef struct FW_REGION_INFO +{ + SMBDWord StartAddress; + SMBDWord EndAddress; +} __attribute__((packed)) FW_REGION_INFO; + +typedef struct SMBFirmwareVolume { + SMB_STRUCT_HEADER // Type 128 + SMBByte RegionCount; + SMBByte Reserved[3]; + SMBDWord FirmwareFeatures; + SMBDWord FirmwareFeaturesMask; + SMBByte RegionType[ NUM_FLASHMAP_ENTRIES ]; + FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ]; +} __attribute__((packed)) SMBFirmwareVolume; + +// +// Memory SPD Data (Apple Specific - Type 130) +// + +typedef struct SMBMemorySPD { + SMB_STRUCT_HEADER // Type 130 + SMBWord Type17Handle; + SMBWord Offset; + SMBWord Size; + SMBWord Data[]; +} __attribute__((packed)) SMBMemorySPD; + + +// +// OEM Processor Type (Apple Specific - Type 131) +// + +typedef struct SMBOemProcessorType { + SMB_STRUCT_HEADER + SMBWord ProcessorType; +} __attribute__((packed)) SMBOemProcessorType; + +// +// OEM Processor Bus Speed (Apple Specific - Type 132) +// +typedef struct SMBOemProcessorBusSpeed { + SMB_STRUCT_HEADER + SMBWord ProcessorBusSpeed; // MT/s unit +} __attribute__((packed)) SMBOemProcessorBusSpeed; + +//---------------------------------------------------------------------------------------------------------- + +/* From Foundation/Efi/Guid/Smbios/SmBios.h */ +/* Modified to wrap Data4 array init with {} */ +#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}} + +#define SMBIOS_ORIGINAL 0 +#define SMBIOS_PATCHED 1 + +extern void *getSmbios(int which); +extern void readSMBIOSInfo(SMBEntryPoint *eps); +extern void setupSMBIOSTable(void); + +extern void decodeSMBIOSTable(SMBEntryPoint *eps); + + +#endif /* !__LIBSAIO_SMBIOS_H */ diff --git a/i386/libsaio/smbios_decode.c b/i386/libsaio/smbios_decode.c new file mode 100644 index 0000000..5fdf700 --- /dev/null +++ b/i386/libsaio/smbios_decode.c @@ -0,0 +1,265 @@ +/* + * A very simple SMBIOS Table decoder, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include "libsaio.h" +#include "smbios.h" + +#ifndef DEBUG_SMBIOS +#define DEBUG_SMBIOS 0 +#endif + +#if DEBUG_SMBIOS +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +static SMBWord minorVersion; + +extern char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field); + +static const char * +SMBMemoryDeviceTypes[] = +{ + "RAM", /* 00h Undefined */ + "RAM", /* 01h Other */ + "RAM", /* 02h Unknown */ + "DRAM", /* 03h DRAM */ + "EDRAM", /* 04h EDRAM */ + "VRAM", /* 05h VRAM */ + "SRAM", /* 06h SRAM */ + "RAM", /* 07h RAM */ + "ROM", /* 08h ROM */ + "FLASH", /* 09h FLASH */ + "EEPROM", /* 0Ah EEPROM */ + "FEPROM", /* 0Bh FEPROM */ + "EPROM", /* 0Ch EPROM */ + "CDRAM", /* 0Dh CDRAM */ + "3DRAM", /* 0Eh 3DRAM */ + "SDRAM", /* 0Fh SDRAM */ + "SGRAM", /* 10h SGRAM */ + "RDRAM", /* 11h RDRAM */ + "DDR SDRAM", /* 12h DDR */ + "DDR2 SDRAM", /* 13h DDR2 */ + "DDR2 FB-DIMM", /* 14h DDR2 FB-DIMM */ + "RAM", /* 15h unused */ + "RAM", /* 16h unused */ + "RAM", /* 17h unused */ + "DDR3", /* 18h DDR3, chosen in [5776134] */ +}; + +static const int +kSMBMemoryDeviceTypeCount = sizeof(SMBMemoryDeviceTypes) / +sizeof(SMBMemoryDeviceTypes[0]); + +//------------------------------------------------------------------------------------------------------------------------- +// BIOSInformation +//------------------------------------------------------------------------------------------------------------------------- +void decodeBIOSInformation(SMBBIOSInformation *structHeader) +{ + DBG("BIOSInformation:\n"); + DBG("\tvendor: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->vendor)); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\treleaseDate: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->releaseDate)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// SystemInformation +//------------------------------------------------------------------------------------------------------------------------- +void decodeSystemInformation(SMBSystemInformation *structHeader) +{ + DBG("SystemInformation:\n"); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tproductName: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->productName)); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + + if (minorVersion < 1 || structHeader->header.length < 25) + return; + uint8_t *uuid = structHeader->uuid; + DBG("\tuuid: %02X%02X%02X%02X-%02X%02X-%02X%02X-%02x%02X-%02X%02X%02X%02X%02X%02X\n", + uuid[0], uuid[1], uuid[2], uuid[3], + uuid[4], uuid[5], + uuid[6], uuid[7], + uuid[8], uuid[9], + uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]); + DBG("\twakeupReason: 0x%x\n", structHeader->wakeupReason); + + if (minorVersion < 4 || structHeader->header.length < 27) + return; + DBG("\tskuNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->skuNumber)); + DBG("\tfamily: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->family)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// BaseBoard +//------------------------------------------------------------------------------------------------------------------------- +void decodeBaseBoard(SMBBaseBoard *structHeader) +{ + DBG("BaseBoard:\n"); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tproduct: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->product)); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTagNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTagNumber)); + DBG("\tlocationInChassis: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->locationInChassis)); + DBG("\tboardType: 0x%X\n", structHeader->boardType); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// SystemEnclosure +//------------------------------------------------------------------------------------------------------------------------- +void decodeSystemEnclosure(SMBSystemEnclosure *structHeader) +{ + DBG("SystemEnclosure:\n"); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\ttype: %d\n", structHeader->type); + DBG("\tversion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->version)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTagNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTagNumber)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// ProcessorInformation +//------------------------------------------------------------------------------------------------------------------------- +void decodeProcessorInformation(SMBProcessorInformation *structHeader) +{ + DBG("ProcessorInformation:\n"); + DBG("\tsocketDesignation: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->socketDesignation)); + DBG("\tprocessorType: %d\n", structHeader->processorType); + DBG("\tprocessorFamily: 0x%X\n", structHeader->processorFamily); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tprocessorID: 0x%llX\n", structHeader->processorID); + DBG("\tprocessorVersion: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->processorVersion)); + DBG("\texternalClock: %dMHz\n", structHeader->externalClock); + DBG("\tmaximumClock: %dMHz\n", structHeader->maximumClock); + DBG("\tcurrentClock: %dMHz\n", structHeader->currentClock); + + if (minorVersion < 3 || structHeader->header.length < 35) + return; + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTag: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTag)); + DBG("\tpartNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->partNumber)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// MemoryDevice +//------------------------------------------------------------------------------------------------------------------------- +void decodeMemoryDevice(SMBMemoryDevice *structHeader) +{ + DBG("MemoryDevice:\n"); + DBG("\tdeviceLocator: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->deviceLocator)); + DBG("\tbankLocator: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->bankLocator)); + DBG("\tmemoryType: %s\n", SMBMemoryDeviceTypes[structHeader->memoryType]); + + if (minorVersion < 3 || structHeader->header.length < 27) + return; + DBG("\tmemorySpeed: %dMHz\n", structHeader->memorySpeed); + DBG("\tmanufacturer: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->manufacturer)); + DBG("\tserialNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->serialNumber)); + DBG("\tassetTag: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->assetTag)); + DBG("\tpartNumber: %s\n", getSMBStringForField((SMBStructHeader *)structHeader, structHeader->partNumber)); + DBG("\n"); +} + +//------------------------------------------------------------------------------------------------------------------------- +// Apple Specific +//------------------------------------------------------------------------------------------------------------------------- +void decodeOemProcessorType(SMBOemProcessorType *structHeader) +{ + DBG("AppleProcessorType:\n"); + DBG("\tProcessorType: 0x%x\n", ((SMBOemProcessorType *)structHeader)->ProcessorType); + DBG("\n"); +} + +void decodeOemProcessorBusSpeed(SMBOemProcessorBusSpeed *structHeader) +{ + DBG("AppleProcessorBusSpeed:\n"); + DBG("\tProcessorBusSpeed (QPI): %d.%dGT/s\n", + ((SMBOemProcessorBusSpeed *)structHeader)->ProcessorBusSpeed / 1000, + (((SMBOemProcessorBusSpeed *)structHeader)->ProcessorBusSpeed / 100) % 10); + DBG("\n"); +} +//------------------------------------------------------------------------------------------------------------------------- + + +void decodeSMBIOSTable(SMBEntryPoint *eps) +{ + uint8_t *ptr = (uint8_t *)eps->dmi.tableAddress; + SMBStructHeader *structHeader = (SMBStructHeader *)ptr; + + minorVersion = eps->minorVersion; + + DBG("\n"); + for (;((eps->dmi.tableAddress + eps->dmi.tableLength) > ((uint32_t)(uint8_t *)structHeader + sizeof(SMBStructHeader)));) + { + DBG("Type: %d, Length: %d, Handle: 0x%x\n", + structHeader->type, structHeader->length, structHeader->handle); + + switch (structHeader->type) + { + case kSMBTypeBIOSInformation: + decodeBIOSInformation((SMBBIOSInformation *)structHeader); + break; + + case kSMBTypeSystemInformation: + decodeSystemInformation((SMBSystemInformation *)structHeader); + break; + + case kSMBTypeBaseBoard: + decodeBaseBoard((SMBBaseBoard *)structHeader); + break; + + case kSMBTypeSystemEnclosure: + decodeSystemEnclosure((SMBSystemEnclosure *)structHeader); + break; + + case kSMBTypeProcessorInformation: + decodeProcessorInformation((SMBProcessorInformation *)structHeader); + break; + + case kSMBTypeMemoryDevice: + decodeMemoryDevice((SMBMemoryDevice *)structHeader); + break; + + /* Skip all Apple Specific Structures */ + case kSMBTypeFirmwareVolume: + case kSMBTypeMemorySPD: + break; + + case kSMBTypeOemProcessorType: + decodeOemProcessorType((SMBOemProcessorType *)structHeader); + break; + + case kSMBTypeOemProcessorBusSpeed: + decodeOemProcessorBusSpeed((SMBOemProcessorBusSpeed *)structHeader); + break; + + case kSMBTypeEndOfTable: + /* Skip, to be added at the end */ + break; + + default: + break; + } + + ptr = (uint8_t *)((uint32_t)structHeader + structHeader->length); + for (; ((uint16_t *)ptr)[0] != 0; ptr++); + + if (((uint16_t *)ptr)[0] == 0) + ptr += 2; + + structHeader = (SMBStructHeader *)ptr; + } + DBG("\n"); +} + diff --git a/i386/libsaio/smbios_getters.c b/i386/libsaio/smbios_getters.c new file mode 100644 index 0000000..17481c1 --- /dev/null +++ b/i386/libsaio/smbios_getters.c @@ -0,0 +1,360 @@ +/* + * Add (c) here + * + * Copyright .... All rights reserved. + * + */ + +#include "smbios_getters.h" +#include "bootstruct.h" + +#ifndef DEBUG_SMBIOS +#define DEBUG_SMBIOS 0 +#endif + +#if DEBUG_SMBIOS +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + + +bool getProcessorInformationExternalClock(returnType *value) +{ + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel + { + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + // set external clock to 0 for SANDY + // removes FSB info from system profiler as on real mac's. + case CPU_MODEL_SANDYBRIDGE: + case CPU_MODEL_IVYBRIDGE: + case CPU_MODEL_HASWELL: + value->word = 0; + break; + default: + value->word = Platform.CPU.FSBFrequency/1000000; + } + } + break; + + default: + value->word = Platform.CPU.FSBFrequency/1000000; + } + } + else + { + value->word = Platform.CPU.FSBFrequency/1000000; + } + + return true; +} + +bool getProcessorInformationMaximumClock(returnType *value) +{ + value->word = Platform.CPU.CPUFrequency/1000000; + return true; +} + +bool getSMBOemProcessorBusSpeed(returnType *value) +{ + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel + { + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: // Intel Pentium M + case CPU_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPU_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPU_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPU_MODEL_ATOM: // Intel Atom (45nm) + return false; + + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_NEHALEM_EX: // Intel Xeon X75xx, Xeon X65xx, Xeon E75xx, Xeon E65x + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + { + // thanks to dgobe for i3/i5/i7 bus speed detection + int nhm_bus = 0x3F; + static long possible_nhm_bus[] = {0xFF, 0x7F, 0x3F}; + unsigned long did, vid; + int i; + + // Nehalem supports Scrubbing + // First, locate the PCI bus where the MCH is located + for(i = 0; i < sizeof(possible_nhm_bus); i++) + { + vid = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), 0x00); + did = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), 0x02); + vid &= 0xFFFF; + did &= 0xFF00; + + if(vid == 0x8086 && did >= 0x2C00) + nhm_bus = possible_nhm_bus[i]; + } + + unsigned long qpimult, qpibusspeed; + qpimult = pci_config_read32(PCIADDR(nhm_bus, 2, 1), 0x50); + qpimult &= 0x7F; + DBG("qpimult %d\n", qpimult); + qpibusspeed = (qpimult * 2 * (Platform.CPU.FSBFrequency/1000000)); + // Rek: rounding decimals to match original mac profile info + if (qpibusspeed%100 != 0)qpibusspeed = ((qpibusspeed+50)/100)*100; + DBG("qpibusspeed %d\n", qpibusspeed); + value->word = qpibusspeed; + return true; + } + } + } + } + } + return false; +} + +uint16_t simpleGetSMBOemProcessorType(void) +{ + if (Platform.CPU.NoCores >= 4) + { + return 0x0501; // Quad-Core Xeon + } + else if (Platform.CPU.NoCores == 1) + { + return 0x0201; // Core Solo + }; + + return 0x0301; // Core 2 Duo +} + +bool getSMBOemProcessorType(returnType *value) +{ + static bool done = false; + + value->word = simpleGetSMBOemProcessorType(); + + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) // Intel + { + if (!done) + { + verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, Platform.CPU.Family, Platform.CPU.Model); + done = true; + } + + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: // Intel Pentium M + case CPU_MODEL_YONAH: // Intel Mobile Core Solo, Duo + case CPU_MODEL_MEROM: // Intel Mobile Core 2 Solo, Duo, Xeon 30xx, Xeon 51xx, Xeon X53xx, Xeon E53xx, Xeon X32xx + case CPU_MODEL_PENRYN: // Intel Core 2 Solo, Duo, Quad, Extreme, Xeon X54xx, Xeon X33xx + case CPU_MODEL_ATOM: // Intel Atom (45nm) + return true; + + case CPU_MODEL_NEHALEM: // Intel Core i7, Xeon W35xx, Xeon X55xx, Xeon E55xx LGA1366 (45nm) + case CPU_MODEL_WESTMERE: // Intel Core i7, Xeon X56xx, Xeon E56xx, Xeon W36xx LGA1366 (32nm) 6 Core + case CPU_MODEL_WESTMERE_EX: // Intel Xeon E7 + case CPU_MODEL_JAKETOWN: // Intel Core i7, Xeon E5 LGA2011 (32nm) + if (strstr(Platform.CPU.BrandString, "Xeon(R)")) + value->word = 0x0501; // Xeon + else + value->word = 0x0701; // Core i7 + return true; + + case CPU_MODEL_FIELDS: // Intel Core i5, i7, Xeon X34xx LGA1156 (45nm) + if (strstr(Platform.CPU.BrandString, "Xeon(R)")) + value->word = 0x0501;// Xeon + else + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + value->word = 0x0601; // Core i5 + else + value->word = 0x0701; // Core i7 + return true; + + case CPU_MODEL_DALES: + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + value->word = 0x0601; // Core i5 + else + value->word = 0x0701; // Core i7 + return true; + + case CPU_MODEL_SANDYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (32nm) + case CPU_MODEL_IVYBRIDGE: // Intel Core i3, i5, i7 LGA1155 (22nm) + case CPU_MODEL_DALES_32NM: // Intel Core i3, i5 LGA1156 (32nm) + case CPU_MODEL_HASWELL: // Intel Core i3, i5, i7, Xeon E3 LGA1155 (22nm) + if (strstr(Platform.CPU.BrandString, "Xeon(R)")) + value->word = 0x0501; // Xeon + else + if (strstr(Platform.CPU.BrandString, "Core(TM) i3")) + value->word = 0x0901; // Core i3 + else + if (strstr(Platform.CPU.BrandString, "Core(TM) i5")) + value->word = 0x0601; // Core i5 + else + value->word = 0x0701; // Core i7 + return true; + } + } + } + } + + return false; +} + +bool getSMBMemoryDeviceMemoryType(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && Platform.RAM.DIMM[map].Type != 0) + { + DBG("RAM Detected Type = %d\n", Platform.RAM.DIMM[map].Type); + value->byte = Platform.RAM.DIMM[map].Type; + return true; + } + } + + return false; +// value->byte = SMB_MEM_TYPE_DDR2; +// return true; +} + +bool getSMBMemoryDeviceMemorySpeed(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && Platform.RAM.DIMM[map].Frequency != 0) + { + DBG("RAM Detected Freq = %d Mhz\n", Platform.RAM.DIMM[map].Frequency); + value->dword = Platform.RAM.DIMM[map].Frequency; + return true; + } + } + + return false; +// value->dword = 800; +// return true; +} + +bool getSMBMemoryDeviceManufacturer(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && strlen(Platform.RAM.DIMM[map].Vendor) > 0) + { + DBG("RAM Detected Vendor[%d]='%s'\n", idx, Platform.RAM.DIMM[map].Vendor); + value->string = Platform.RAM.DIMM[map].Vendor; + return true; + } + } + + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; +} + +bool getSMBMemoryDeviceSerialNumber(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + + DBG("getSMBMemoryDeviceSerialNumber index: %d, MAX_RAM_SLOTS: %d\n",idx,MAX_RAM_SLOTS); + + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && strlen(Platform.RAM.DIMM[map].SerialNo) > 0) + { + DBG("map=%d, RAM Detected SerialNo[%d]='%s'\n", map, idx, Platform.RAM.DIMM[map].SerialNo); + value->string = Platform.RAM.DIMM[map].SerialNo; + return true; + } + } + + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; +} + +bool getSMBMemoryDevicePartNumber(returnType *value) +{ + static int idx = -1; + int map; + + idx++; + if (idx < MAX_RAM_SLOTS) + { + map = Platform.DMI.DIMM[idx]; + if (Platform.RAM.DIMM[map].InUse && strlen(Platform.RAM.DIMM[map].PartNo) > 0) + { + DBG("map=%d, RAM Detected PartNo[%d]='%s'\n", map, idx, Platform.RAM.DIMM[map].PartNo); + value->string = Platform.RAM.DIMM[map].PartNo; + return true; + } + } + + if (!bootInfo->memDetect) + return false; + value->string = NOT_AVAILABLE; + return true; +} + + +// getting smbios addr with fast compare ops, late checksum testing ... +#define COMPARE_DWORD(a,b) ( *((uint32_t *) a) == *((uint32_t *) b) ) +static const char * const SMTAG = "_SM_"; +static const char* const DMITAG = "_DMI_"; + +SMBEntryPoint *getAddressOfSmbiosTable(void) +{ + SMBEntryPoint *smbios; + /* + * The logic is to start at 0xf0000 and end at 0xfffff iterating 16 bytes at a time looking + * for the SMBIOS entry-point structure anchor (literal ASCII "_SM_"). + */ + smbios = (SMBEntryPoint*)SMBIOS_RANGE_START; + while (smbios <= (SMBEntryPoint *)SMBIOS_RANGE_END) { + if (COMPARE_DWORD(smbios->anchor, SMTAG) && + COMPARE_DWORD(smbios->dmi.anchor, DMITAG) && + smbios->dmi.anchor[4] == DMITAG[4] && + checksum8(smbios, sizeof(SMBEntryPoint)) == 0) + { + return smbios; + } + smbios = (SMBEntryPoint*)(((char*)smbios) + 16); + } + printf("ERROR: Unable to find SMBIOS!\n"); + pause(); + return NULL; +} + diff --git a/i386/libsaio/smbios_getters.h b/i386/libsaio/smbios_getters.h new file mode 100644 index 0000000..9322246 --- /dev/null +++ b/i386/libsaio/smbios_getters.h @@ -0,0 +1,43 @@ + +#include "libsaio.h" +#include "smbios.h" +#include "platform.h" +#include "pci.h" + +#ifndef __LIBSAIO_SMBIOS_GETTERS_H +#define __LIBSAIO_SMBIOS_GETTERS_H + +#define SMBIOS_RANGE_START 0x000F0000 +#define SMBIOS_RANGE_END 0x000FFFFF + +#define NOT_AVAILABLE "N/A" + +typedef enum { + kSMBString, + kSMBByte, + kSMBWord, + kSMBDWord +// kSMBQWord +} SMBValueType; + +typedef union { + const char *string; + uint8_t byte; + uint16_t word; + uint32_t dword; +// uint64_t qword; +} returnType; + +extern bool getProcessorInformationExternalClock(returnType *value); +extern bool getProcessorInformationMaximumClock(returnType *value); +extern bool getSMBOemProcessorBusSpeed(returnType *value); +extern bool getSMBOemProcessorType(returnType *value); +extern bool getSMBMemoryDeviceMemoryType(returnType *value); +extern bool getSMBMemoryDeviceMemorySpeed(returnType *value); +extern bool getSMBMemoryDeviceManufacturer(returnType *value); +extern bool getSMBMemoryDeviceSerialNumber(returnType *value); +extern bool getSMBMemoryDevicePartNumber(returnType *value); + +SMBEntryPoint *getAddressOfSmbiosTable(void); + +#endif /* !__LIBSAIO_SMBIOS_GETTERS_H */ diff --git a/i386/libsaio/spd.c b/i386/libsaio/spd.c new file mode 100644 index 0000000..cbfd1af --- /dev/null +++ b/i386/libsaio/spd.c @@ -0,0 +1,414 @@ +/* + * spd.c - serial presence detect memory information + * + * Originally restored from pcefi10.5 + * Dynamic mem detection original impl. by Rekursor + * System profiler fix and other fixes by Mozodojo. + */ + +#include "libsaio.h" +#include "pci.h" +#include "platform.h" +#include "spd.h" +#include "cpu.h" +#include "saio_internal.h" +#include "bootstruct.h" +#include "memvendors.h" + +#ifndef DEBUG_SPD +#define DEBUG_SPD 0 +#endif + +#if DEBUG_SPD +#define DBG(x...) printf(x) +#else +#define DBG(x...) msglog(x) +#endif + +static const char *spd_memory_types[] = +{ + "RAM", /* 00h Undefined */ + "FPM", /* 01h FPM */ + "EDO", /* 02h EDO */ + "", /* 03h PIPELINE NIBBLE */ + "SDRAM", /* 04h SDRAM */ + "", /* 05h MULTIPLEXED ROM */ + "DDR SGRAM", /* 06h SGRAM DDR */ + "DDR SDRAM", /* 07h SDRAM DDR */ + "DDR2 SDRAM", /* 08h SDRAM DDR 2 */ + "", /* 09h Undefined */ + "", /* 0Ah Undefined */ + "DDR3 SDRAM" /* 0Bh SDRAM DDR 3 */ +}; + +#define UNKNOWN_MEM_TYPE 2 +static uint8_t spd_mem_to_smbios[] = +{ + UNKNOWN_MEM_TYPE, /* 00h Undefined */ + UNKNOWN_MEM_TYPE, /* 01h FPM */ + UNKNOWN_MEM_TYPE, /* 02h EDO */ + UNKNOWN_MEM_TYPE, /* 03h PIPELINE NIBBLE */ + SMB_MEM_TYPE_SDRAM, /* 04h SDRAM */ + SMB_MEM_TYPE_ROM, /* 05h MULTIPLEXED ROM */ + SMB_MEM_TYPE_SGRAM, /* 06h SGRAM DDR */ + SMB_MEM_TYPE_DDR, /* 07h SDRAM DDR */ + SMB_MEM_TYPE_DDR2, /* 08h SDRAM DDR 2 */ + UNKNOWN_MEM_TYPE, /* 09h Undefined */ + UNKNOWN_MEM_TYPE, /* 0Ah Undefined */ + SMB_MEM_TYPE_DDR3 /* 0Bh SDRAM DDR 3 */ +}; +#define SPD_TO_SMBIOS_SIZE (sizeof(spd_mem_to_smbios)/sizeof(uint8_t)) + +#define rdtsc(low,high) \ +__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) + +#define SMBHSTSTS 0 +#define SMBHSTCNT 2 +#define SMBHSTCMD 3 +#define SMBHSTADD 4 +#define SMBHSTDAT 5 +#define SBMBLKDAT 7 + +/** Read one byte from the intel i2c, used for reading SPD on intel chipsets only. */ +unsigned char smb_read_byte_intel(uint32_t base, uint8_t adr, uint8_t cmd) +{ + int l1, h1, l2, h2; + unsigned long long t; + + outb(base + SMBHSTSTS, 0x1f); // reset SMBus Controller + outb(base + SMBHSTDAT, 0xff); + + rdtsc(l1, h1); + while ( inb(base + SMBHSTSTS) & 0x01) // wait until read + { + rdtsc(l2, h2); + t = ((h2 - h1) * 0xffffffff + (l2 - l1)) / (Platform.CPU.TSCFrequency / 100); + if (t > 5) + return 0xFF; // break + } + + outb(base + SMBHSTCMD, cmd); + outb(base + SMBHSTADD, (adr << 1) | 0x01 ); + outb(base + SMBHSTCNT, 0x48 ); + + rdtsc(l1, h1); + + while (!( inb(base + SMBHSTSTS) & 0x02)) // wait til command finished + { + rdtsc(l2, h2); + t = ((h2 - h1) * 0xffffffff + (l2 - l1)) / (Platform.CPU.TSCFrequency / 100); + if (t > 5) + break; // break after 5ms + } + return inb(base + SMBHSTDAT); +} + +/* SPD i2c read optimization: prefetch only what we need, read non prefetcheable bytes on the fly */ +#define READ_SPD(spd, base, slot, x) spd[x] = smb_read_byte_intel(base, 0x50 + slot, x) + +int spd_indexes[] = { + SPD_MEMORY_TYPE, + SPD_DDR3_MEMORY_BANK, + SPD_DDR3_MEMORY_CODE, + SPD_NUM_ROWS, + SPD_NUM_COLUMNS, + SPD_NUM_DIMM_BANKS, + SPD_NUM_BANKS_PER_SDRAM, + 4,7,8,9,12,64, /* TODO: give names to these values */ + 95,96,97,98, 122,123,124,125 /* UIS */ +}; +#define SPD_INDEXES_SIZE (sizeof(spd_indexes) / sizeof(int)) + +/** Read from spd *used* values only*/ +static void init_spd(char * spd, uint32_t base, int slot) +{ + int i; + for (i=0; i< SPD_INDEXES_SIZE; i++) { + READ_SPD(spd, base, slot, spd_indexes[i]); + } +} + +/** Get Vendor Name from spd, 2 cases handled DDR3 and DDR2, + have different formats, always return a valid ptr.*/ +const char * getVendorName(RamSlotInfo_t* slot, uint32_t base, int slot_num) +{ + uint8_t bank = 0; + uint8_t code = 0; + int i = 0; + uint8_t * spd = (uint8_t *) slot->spd; + + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { // DDR3 + bank = (spd[SPD_DDR3_MEMORY_BANK] & 0x07f); // constructors like Patriot use b7=1 + code = spd[SPD_DDR3_MEMORY_CODE]; + for (i=0; i < VEN_MAP_SIZE; i++) + if (bank==vendorMap[i].bank && code==vendorMap[i].code) + return vendorMap[i].name; + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + if(spd[64]==0x7f) { + for (i=64; i<72 && spd[i]==0x7f;i++) { + bank++; + READ_SPD(spd, base, slot_num,i+1); // prefetch next spd byte to read for next loop + } + READ_SPD(spd, base, slot_num,i); + code = spd[i]; + } else { + code = spd[64]; + bank = 0; + } + for (i=0; i < VEN_MAP_SIZE; i++) + if (bank==vendorMap[i].bank && code==vendorMap[i].code) + return vendorMap[i].name; + } + /* OK there is no vendor id here lets try to match the partnum if it exists */ + if (strstr(slot->PartNo,"GU332") == slot->PartNo) // Unifosa fingerprint + return "Unifosa"; + return "NoName"; +} + +/** Get Default Memory Module Speed (no overclocking handled) */ +int getDDRspeedMhz(const char * spd) +{ + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { + switch(spd[12]) { + case 0x0f: + return 1066; + case 0x0c: + return 1333; + case 0x0a: + return 1600; + case 0x14: + default: + return 800; + } + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + switch(spd[9]) { + case 0x50: + return 400; + case 0x3d: + return 533; + case 0x30: + return 667; + case 0x25: + default: + return 800; + } + } + return 800; // default freq for unknown types +} + +#define SMST(a) ((uint8_t)((spd[a] & 0xf0) >> 4)) +#define SLST(a) ((uint8_t)(spd[a] & 0x0f)) + +/** Get DDR3 or DDR2 serial number, 0 most of the times, always return a valid ptr */ +const char *getDDRSerial(const char* spd) +{ + static char asciiSerial[16]; + + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) // DDR3 + { + sprintf(asciiSerial, "%X%X%X%X%X%X%X%X", SMST(122) /*& 0x7*/, SLST(122), SMST(123), SLST(123), SMST(124), SLST(124), SMST(125), SLST(125)); + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) // DDR2 or DDR + { + sprintf(asciiSerial, "%X%X%X%X%X%X%X%X", SMST(95) /*& 0x7*/, SLST(95), SMST(96), SLST(96), SMST(97), SLST(97), SMST(98), SLST(98)); + } + + return strdup(asciiSerial); +} + +/** Get DDR3 or DDR2 Part Number, always return a valid ptr */ +const char * getDDRPartNum(char* spd, uint32_t base, int slot) +{ + static char asciiPartNo[32]; + int i, start=0, index = 0; + + if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR3) { + start = 128; + } + else if (spd[SPD_MEMORY_TYPE]==SPD_MEMORY_TYPE_SDRAM_DDR2) { + start = 73; + } + + // Check that the spd part name is zero terminated and that it is ascii: + bzero(asciiPartNo, sizeof(asciiPartNo)); + char c; + for (i=start; i < start + sizeof(asciiPartNo); i++) { + READ_SPD(spd, base, slot, i); // only read once the corresponding model part (ddr3 or ddr2) + c = spd[i]; + if (isalpha(c) || isdigit(c) || ispunct(c)) // It seems that System Profiler likes only letters and digits... + asciiPartNo[index++] = c; + else if (!isascii(c)) + break; + } + + return strdup(asciiPartNo); +} + +int mapping []= {0,2,1,3,4,6,5,7,8,10,9,11}; + + +/** Read from smbus the SPD content and interpret it for detecting memory attributes */ +static void read_smb_intel(pci_dt_t *smbus_dev) +{ + int i, speed; + uint8_t spd_size, spd_type; + uint32_t base, mmio, hostc; +// bool dump = false; + RamSlotInfo_t* slot; + + uint16_t cmd = pci_config_read16(smbus_dev->dev.addr, 0x04); + DBG("SMBus CmdReg: 0x%x\n", cmd); + pci_config_write16(smbus_dev->dev.addr, 0x04, cmd | 1); + + mmio = pci_config_read32(smbus_dev->dev.addr, 0x10);// & ~0x0f; + base = pci_config_read16(smbus_dev->dev.addr, 0x20) & 0xFFFE; + hostc = pci_config_read8(smbus_dev->dev.addr, 0x40); + verbose("Scanning SMBus [%04x:%04x], mmio: 0x%x, ioport: 0x%x, hostc: 0x%x\n", + smbus_dev->vendor_id, smbus_dev->device_id, mmio, base, hostc); + +//Azi: no use for this! +// getBoolForKey("DumpSPD", &dump, &bootInfo->chameleonConfig); + // needed at least for laptops + bool fullBanks = Platform.DMI.MemoryModules == Platform.DMI.CntMemorySlots; + + char spdbuf[MAX_SPD_SIZE]; + // Search MAX_RAM_SLOTS slots + for (i = 0; i < MAX_RAM_SLOTS; i++){ + slot = &Platform.RAM.DIMM[i]; + spd_size = smb_read_byte_intel(base, 0x50 + i, 0); + DBG("SPD[0] (size): %d @0x%x\n", spd_size, 0x50 + i); + // Check spd is present + if (spd_size && (spd_size != 0xff)) + { + + slot->spd = spdbuf; + slot->InUse = true; + + bzero(slot->spd, spd_size); + + // Copy spd data into buffer + + //for (x = 0; x < spd_size; x++) slot->spd[x] = smb_read_byte_intel(base, 0x50 + i, x); + init_spd(slot->spd, base, i); + + switch (slot->spd[SPD_MEMORY_TYPE]) { + case SPD_MEMORY_TYPE_SDRAM_DDR2: + + slot->ModuleSize = ((1 << (slot->spd[SPD_NUM_ROWS] & 0x0f) + (slot->spd[SPD_NUM_COLUMNS] & 0x0f) - 17) * + ((slot->spd[SPD_NUM_DIMM_BANKS] & 0x7) + 1) * slot->spd[SPD_NUM_BANKS_PER_SDRAM]); + break; + + case SPD_MEMORY_TYPE_SDRAM_DDR3: + + slot->ModuleSize = ((slot->spd[4] & 0x0f) + 28 ) + ((slot->spd[8] & 0x7) + 3 ); + slot->ModuleSize -= (slot->spd[7] & 0x7) + 25; + slot->ModuleSize = ((1 << slot->ModuleSize) * (((slot->spd[7] >> 3) & 0x1f) + 1)); + + break; + } + + spd_type = (slot->spd[SPD_MEMORY_TYPE] < ((char) 12) ? slot->spd[SPD_MEMORY_TYPE] : 0); + slot->Type = spd_mem_to_smbios[spd_type]; + slot->PartNo = getDDRPartNum(slot->spd, base, i); + slot->Vendor = getVendorName(slot, base, i); + slot->SerialNo = getDDRSerial(slot->spd); + + // determine spd speed + speed = getDDRspeedMhz(slot->spd); + if (slot->Frequency<speed) slot->Frequency = speed; + + // pci memory controller if available, is more reliable + if (Platform.RAM.Frequency > 0) { + uint32_t freq = (uint32_t)Platform.RAM.Frequency / 500000; + // now round off special cases + uint32_t fmod100 = freq %100; + switch(fmod100) { + case 1: freq--; break; + case 32: freq++; break; + case 65: freq++; break; + case 98: freq+=2;break; + case 99: freq++; break; + } + slot->Frequency = freq; + } + + verbose("Slot: %d Type %d %dMB (%s) %dMHz Vendor=%s\n PartNo=%s SerialNo=%s\n", + i, + (int)slot->Type, + slot->ModuleSize, + spd_memory_types[spd_type], + slot->Frequency, + slot->Vendor, + slot->PartNo, + slot->SerialNo); + + + } + + // laptops sometimes show slot 0 and 2 with slot 1 empty when only 2 slots are presents so: + Platform.DMI.DIMM[i]= + i>0 && Platform.RAM.DIMM[1].InUse==false && fullBanks && Platform.DMI.CntMemorySlots == 2 ? + mapping[i] : i; // for laptops case, mapping setup would need to be more generic than this + + + + slot->spd = NULL; + + } // for +} + +static struct smbus_controllers_t smbus_controllers[] = { + + {0x8086, 0x269B, "ESB2", read_smb_intel }, + {0x8086, 0x24C3, "ICH4", read_smb_intel }, + {0x8086, 0x24D3, "ICH5", read_smb_intel }, + {0x8086, 0x266A, "ICH6", read_smb_intel }, + {0x8086, 0x27DA, "ICH7", read_smb_intel }, + {0x8086, 0x283E, "ICH8", read_smb_intel }, + {0x8086, 0x2930, "ICH9", read_smb_intel }, + {0x8086, 0x3A30, "ICH10R", read_smb_intel }, + {0x8086, 0x3A60, "ICH10B", read_smb_intel }, + {0x8086, 0x3B30, "5 Series", read_smb_intel }, + {0x8086, 0x1C22, "6 Series", read_smb_intel }, + {0x8086, 0x1E22, "7 Series", read_smb_intel }, + {0x8086, 0x8C22, "8 Series", read_smb_intel }, + {0x8086, 0x1D22, "X79 Series", read_smb_intel }, + +}; + +// initial call : pci_dt = root_pci_dev; +// find_and_read_smbus_controller(root_pci_dev); +bool find_and_read_smbus_controller(pci_dt_t* pci_dt) +{ + pci_dt_t *current = pci_dt; + int i; + + while (current) { +#if 0 + printf("%02x:%02x.%x [%04x] [%04x:%04x] :: %s\n", + current->dev.bits.bus, current->dev.bits.dev, current->dev.bits.func, + current->class_id, current->vendor_id, current->device_id, + get_pci_dev_path(current)); +#endif + for ( i = 0; i < sizeof(smbus_controllers) / sizeof(smbus_controllers[0]); i++ ) + { + if (current->vendor_id == smbus_controllers[i].vendor && + current->device_id == smbus_controllers[i].device) + { + smbus_controllers[i].read_smb(current); // read smb + return true; + } + } + find_and_read_smbus_controller(current->children); + current = current->next; + } + return false; // not found +} + +void scan_spd(PlatformInfo_t *p) +{ + find_and_read_smbus_controller(root_pci_dev); +} + diff --git a/i386/libsaio/spd.h b/i386/libsaio/spd.h new file mode 100644 index 0000000..59a67fd --- /dev/null +++ b/i386/libsaio/spd.h @@ -0,0 +1,160 @@ +/* + * Copyright 2010 AsereBLN. All rights reserved. <aserebln@googlemail.com> + * + * spd.h + */ + +#ifndef __LIBSAIO_SPD_H +#define __LIBSAIO_SPD_H + +#include "platform.h" +#include "libsaio.h" + +void scan_spd(PlatformInfo_t *p); + +struct smbus_controllers_t { + uint32_t vendor; + uint32_t device; + char *name; + void (*read_smb)(pci_dt_t *smbus_dev); +}; + + +/* + * Serial Presence Detect (SPD) data stored on SDRAM modules. + * + * Datasheet: + * - Name: PC SDRAM Serial Presence Detect (SPD) Specification + * Revision 1.2A, December, 1997 + * - PDF: http://www.intel.com/design/chipsets/memory/spdsd12a.pdf + * + * Datasheet (alternative): + * - Name: SERIAL PRESENCE DETECT STANDARD, General Standard + * JEDEC Standard No. 21-C + * - PDF: http://www.jedec.org/download/search/4_01_02_00R9.PDF + */ + + +/* Byte numbers. */ +#define SPD_NUM_MANUFACTURER_BYTES 0 /* Number of bytes used by module manufacturer */ +#define SPD_TOTAL_SPD_MEMORY_SIZE 1 /* Total SPD memory size */ +#define SPD_MEMORY_TYPE 2 /* (Fundamental) memory type */ +#define SPD_NUM_ROWS 3 /* Number of row address bits */ +#define SPD_NUM_COLUMNS 4 /* Number of column address bits */ +#define SPD_NUM_DIMM_BANKS 5 /* Number of module rows (banks) */ +#define SPD_MODULE_DATA_WIDTH_LSB 6 /* Module data width (LSB) */ +#define SPD_MODULE_DATA_WIDTH_MSB 7 /* Module data width (MSB) */ +#define SPD_MODULE_VOLTAGE 8 /* Module interface signal levels */ +#define SPD_MIN_CYCLE_TIME_AT_CAS_MAX 9 /* SDRAM cycle time (highest CAS latency), RAS access time (tRAC) */ +#define SPD_ACCESS_TIME_FROM_CLOCK 10 /* SDRAM access time from clock (highest CAS latency), CAS access time (Tac, tCAC) */ +#define SPD_DIMM_CONFIG_TYPE 11 /* Module configuration type */ +#define SPD_REFRESH 12 /* Refresh rate/type */ +#define SPD_PRIMARY_SDRAM_WIDTH 13 /* SDRAM width (primary SDRAM) */ +#define SPD_ERROR_CHECKING_SDRAM_WIDTH 14 /* Error checking SDRAM (data) width */ +#define SPD_MIN_CLOCK_DELAY_B2B_RAND_COLUMN 15 /* SDRAM device attributes, minimum clock delay for back to back random column */ +#define SPD_SUPPORTED_BURST_LENGTHS 16 /* SDRAM device attributes, burst lengths supported */ +#define SPD_NUM_BANKS_PER_SDRAM 17 /* SDRAM device attributes, number of banks on SDRAM device */ +#define SPD_ACCEPTABLE_CAS_LATENCIES 18 /* SDRAM device attributes, CAS latency */ +#define SPD_CS_LATENCY 19 /* SDRAM device attributes, CS latency */ +#define SPD_WE_LATENCY 20 /* SDRAM device attributes, WE latency */ +#define SPD_MODULE_ATTRIBUTES 21 /* SDRAM module attributes */ +#define SPD_DEVICE_ATTRIBUTES_GENERAL 22 /* SDRAM device attributes, general */ +#define SPD_SDRAM_CYCLE_TIME_2ND 23 /* SDRAM cycle time (2nd highest CAS latency) */ +#define SPD_ACCESS_TIME_FROM_CLOCK_2ND 24 /* SDRAM access from clock (2nd highest CAS latency) */ +#define SPD_SDRAM_CYCLE_TIME_3RD 25 /* SDRAM cycle time (3rd highest CAS latency) */ +#define SPD_ACCESS_TIME_FROM_CLOCK_3RD 26 /* SDRAM access from clock (3rd highest CAS latency) */ +#define SPD_MIN_ROW_PRECHARGE_TIME 27 /* Minimum row precharge time (Trp) */ +#define SPD_MIN_ROWACTIVE_TO_ROWACTIVE 28 /* Minimum row active to row active (Trrd) */ +#define SPD_MIN_RAS_TO_CAS_DELAY 29 /* Minimum RAS to CAS delay (Trcd) */ +#define SPD_MIN_ACTIVE_TO_PRECHARGE_DELAY 30 /* Minimum RAS pulse width (Tras) */ +#define SPD_DENSITY_OF_EACH_ROW_ON_MODULE 31 /* Density of each row on module */ +#define SPD_CMD_SIGNAL_INPUT_SETUP_TIME 32 /* Command and address signal input setup time */ +#define SPD_CMD_SIGNAL_INPUT_HOLD_TIME 33 /* Command and address signal input hold time */ +#define SPD_DATA_SIGNAL_INPUT_SETUP_TIME 34 /* Data signal input setup time */ +#define SPD_DATA_SIGNAL_INPUT_HOLD_TIME 35 /* Data signal input hold time */ +#define SPD_WRITE_RECOVERY_TIME 36 /* Write recovery time (tWR) */ +#define SPD_INT_WRITE_TO_READ_DELAY 37 /* Internal write to read command delay (tWTR) */ +#define SPD_INT_READ_TO_PRECHARGE_DELAY 38 /* Internal read to precharge command delay (tRTP) */ +#define SPD_MEM_ANALYSIS_PROBE_PARAMS 39 /* Memory analysis probe characteristics */ +#define SPD_BYTE_41_42_EXTENSION 40 /* Extension of byte 41 (tRC) and byte 42 (tRFC) */ +#define SPD_MIN_ACT_TO_ACT_AUTO_REFRESH 41 /* Minimum active to active auto refresh (tRCmin) */ +#define SPD_MIN_AUTO_REFRESH_TO_ACT 42 /* Minimum auto refresh to active/auto refresh (tRFC) */ +#define SPD_MAX_DEVICE_CYCLE_TIME 43 /* Maximum device cycle time (tCKmax) */ +#define SPD_MAX_DQS_DQ_SKEW 44 /* Maximum skew between DQS and DQ (tDQSQ) */ +#define SPD_MAX_READ_DATAHOLD_SKEW 45 /* Maximum read data-hold skew factor (tQHS) */ +#define SPD_PLL_RELOCK_TIME 46 /* PLL relock time */ +#define SPD_SPD_DATA_REVISION_CODE 62 /* SPD data revision code */ +#define SPD_CHECKSUM_FOR_BYTES_0_TO_62 63 /* Checksum for bytes 0-62 */ +#define SPD_MANUFACTURER_JEDEC_ID_CODE 64 /* Manufacturer's JEDEC ID code, per EIA/JEP106 (bytes 64-71) */ +#define SPD_MANUFACTURING_LOCATION 72 /* Manufacturing location */ +#define SPD_MANUFACTURER_PART_NUMBER 73 /* Manufacturer's part number, in 6-bit ASCII (bytes 73-90) */ +#define SPD_REVISION_CODE 91 /* Revision code (bytes 91-92) */ +#define SPD_MANUFACTURING_DATE 93 /* Manufacturing date (byte 93: year, byte 94: week) */ +#define SPD_ASSEMBLY_SERIAL_NUMBER 95 /* Assembly serial number (bytes 95-98) */ +#define SPD_MANUFACTURER_SPECIFIC_DATA 99 /* Manufacturer specific data (bytes 99-125) */ +#define SPD_INTEL_SPEC_FOR_FREQUENCY 126 /* Intel specification for frequency */ +#define SPD_INTEL_SPEC_100_MHZ 127 /* Intel specification details for 100MHz support */ +#define SPD_DDR3_MEMORY_BANK 0x75 +#define SPD_DDR3_MEMORY_CODE 0x76 + +/* DRAM specifications use the following naming conventions for SPD locations */ +#define SPD_tRP SPD_MIN_ROW_PRECHARGE_TIME +#define SPD_tRRD SPD_MIN_ROWACTIVE_TO_ROWACTIVE +#define SPD_tRCD SPD_MIN_RAS_TO_CAS_DELAY +#define SPD_tRAS SPD_MIN_ACTIVE_TO_PRECHARGE_DELAY +#define SPD_BANK_DENSITY SPD_DENSITY_OF_EACH_ROW_ON_MODULE +#define SPD_ADDRESS_CMD_HOLD SPD_CMD_SIGNAL_INPUT_HOLD_TIME +#define SPD_tRC 41 /* SDRAM Device Minimum Active to Active/Auto Refresh Time (tRC) */ +#define SPD_tRFC 42 /* SDRAM Device Minimum Auto Refresh to Active/Auto Refresh (tRFC) */ + + +/* SPD_MEMORY_TYPE values. */ +#define SPD_MEMORY_TYPE_FPM_DRAM 1 +#define SPD_MEMORY_TYPE_EDO 2 +#define SPD_MEMORY_TYPE_PIPELINED_NIBBLE 3 +#define SPD_MEMORY_TYPE_SDRAM 4 +#define SPD_MEMORY_TYPE_MULTIPLEXED_ROM 5 +#define SPD_MEMORY_TYPE_SGRAM_DDR 6 +#define SPD_MEMORY_TYPE_SDRAM_DDR 7 +#define SPD_MEMORY_TYPE_SDRAM_DDR2 8 +#define SPD_MEMORY_TYPE_SDRAM_DDR3 0xb + +/* SPD_MODULE_VOLTAGE values. */ +#define SPD_VOLTAGE_TTL 0 /* 5.0 Volt/TTL */ +#define SPD_VOLTAGE_LVTTL 1 /* LVTTL */ +#define SPD_VOLTAGE_HSTL 2 /* HSTL 1.5 */ +#define SPD_VOLTAGE_SSTL3 3 /* SSTL 3.3 */ +#define SPD_VOLTAGE_SSTL2 4 /* SSTL 2.5 */ + +/* SPD_DIMM_CONFIG_TYPE values. */ +#define ERROR_SCHEME_NONE 0 +#define ERROR_SCHEME_PARITY 1 +#define ERROR_SCHEME_ECC 2 + +/* SPD_ACCEPTABLE_CAS_LATENCIES values. */ +// TODO: Check values. +#define SPD_CAS_LATENCY_1_0 0x01 +#define SPD_CAS_LATENCY_1_5 0x02 +#define SPD_CAS_LATENCY_2_0 0x04 +#define SPD_CAS_LATENCY_2_5 0x08 +#define SPD_CAS_LATENCY_3_0 0x10 +#define SPD_CAS_LATENCY_3_5 0x20 +#define SPD_CAS_LATENCY_4_0 0x40 + +#define SPD_CAS_LATENCY_DDR2_3 (1 << 3) +#define SPD_CAS_LATENCY_DDR2_4 (1 << 4) +#define SPD_CAS_LATENCY_DDR2_5 (1 << 5) +#define SPD_CAS_LATENCY_DDR2_6 (1 << 6) + +/* SPD_SUPPORTED_BURST_LENGTHS values. */ +#define SPD_BURST_LENGTH_1 1 +#define SPD_BURST_LENGTH_2 2 +#define SPD_BURST_LENGTH_4 4 +#define SPD_BURST_LENGTH_8 8 +#define SPD_BURST_LENGTH_PAGE (1 << 7) + +/* SPD_MODULE_ATTRIBUTES values. */ +#define MODULE_BUFFERED 1 +#define MODULE_REGISTERED 2 + +#endif /* !__LIBSAIO_SPD_H */ diff --git a/i386/libsaio/stringTable.c b/i386/libsaio/stringTable.c new file mode 100644 index 0000000..8159d3d --- /dev/null +++ b/i386/libsaio/stringTable.c @@ -0,0 +1,790 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "bootstruct.h" +#include "libsaio.h" +#include "boot.h" +#include "xml.h" + +extern char *Language; +extern char *LoadableFamilies; + +bool sysConfigValid; + +/* + * Compare a string to a key with quoted characters + */ +static inline int +keyncmp(const char *str, const char *key, int n) +{ + int c; + while (n--) { + c = *key++; + if (c == '\\') { + switch(c = *key++) { + case 'n': + c = '\n'; + break; + case 'r': + c = '\r'; + break; + case 't': + c = '\t'; + break; + default: + break; + } + } else if (c == '\"') { + /* Premature end of key */ + return 1; + } + if (c != *str++) { + return 1; + } + } + return 0; +} + +#if UNUSED + +static void eatThru(char val, const char **table_p) +{ + register const char *table = *table_p; + register bool found = false; + + while (*table && !found) + { + if (*table == '\\') table += 2; + else + { + if (*table == val) found = true; + table++; + } + } + *table_p = table; +} + +/* Remove key and its associated value from the table. */ + +bool +removeKeyFromTable(const char *key, char *table) +{ + register int len; + register char *tab; + char *buf; + + len = strlen(key); + tab = (char *)table; + buf = (char *)malloc(len + 3); + + sprintf(buf, "\"%s\"", key); + len = strlen(buf); + + while(*tab) { + if(strncmp(buf, tab, len) == 0) { + char c; + + while((c = *(tab + len)) != ';') { + if(c == 0) { + len = -1; + goto out; + } + len++; + } + len++; + if(*(tab + len) == '\n') len++; + goto out; + } + tab++; + } + len = -1; +out: + free(buf); + + if(len == -1) return false; + + while((*tab = *(tab + len))) { + tab++; + } + + return true; +} + +char * +newStringFromList( + char **list, + int *size +) +{ + char *begin = *list, *end; + char *newstr; + int newsize = *size; + int bufsize; + + while (*begin && newsize && isspace(*begin)) { + begin++; + newsize--; + } + end = begin; + while (*end && newsize && !isspace(*end)) { + end++; + newsize--; + } + if (begin == end) + return 0; + bufsize = end - begin + 1; + newstr = malloc(bufsize); + strlcpy(newstr, begin, bufsize); + *list = end; + *size = newsize; + return newstr; +} + +#endif + +/* + * compress == compress escaped characters to one character + */ +int stringLength(const char *table, int compress) +{ + int ret = 0; + + while (*table) + { + if (*table == '\\') + { + table += 2; + ret += 1 + (compress ? 0 : 1); + } + else + { + if (*table == '\"') return ret; + ret++; + table++; + } + } + return ret; +} + + +bool getValueForConfigTableKey(config_file_t *config, const char *key, const char **val, int *size) +{ + if (config->dictionary != 0 ) { + // Look up key in XML dictionary + TagPtr value; + value = XMLGetProperty(config->dictionary, key); + if (value != 0) { + if (value->type != kTagTypeString) { + error("Non-string tag '%s' found in config file\n", + key); + return false; + } + *val = value->string; + *size = strlen(value->string); + return true; + } + } else { + + // Legacy plist-style table + + } + + return false; +} + +#if UNUSED + +/* + * Returns a new malloc'ed string if one is found + * in the string table matching 'key'. Also translates + * \n escapes in the string. + */ +char *newStringForStringTableKey( + char *table, + char *key, + config_file_t *config +) +{ + const char *val; + char *newstr, *p; + int size; + + if (getValueForConfigTableKey(config, key, &val, &size)) { + newstr = (char *)malloc(size+1); + for (p = newstr; size; size--, p++, val++) { + if ((*p = *val) == '\\') { + switch (*++val) { + case 'r': + *p = '\r'; + break; + case 'n': + *p = '\n'; + break; + case 't': + *p = '\t'; + break; + default: + *p = *val; + break; + } + size--; + } + } + *p = '\0'; + return newstr; + } else { + return 0; + } +} + +#endif + +char * +newStringForKey(char *key, config_file_t *config) +{ + const char *val; + char *newstr; + int size; + + if (getValueForKey(key, &val, &size, config) && size) { + newstr = (char *)malloc(size + 1); + strlcpy(newstr, val, size + 1); + return newstr; + } else { + return 0; + } +} + +/* parse a command line + * in the form: [<argument> ...] [<option>=<value> ...] + * both <option> and <value> must be either composed of + * non-whitespace characters, or enclosed in quotes. + */ + +static const char *getToken(const char *line, const char **begin, int *len) +{ + if (*line == '\"') { + *begin = ++line; + while (*line && *line != '\"') + line++; + *len = line++ - *begin; + } else { + *begin = line; + while (*line && !isspace(*line) && *line != '=') + line++; + *len = line - *begin; + } + return line; +} + +bool getValueForBootKey(const char *line, const char *match, const char **matchval, int *len) +{ + const char *key, *value; + int key_len, value_len; + bool retval = false; + + while (*line) { + /* look for keyword or argument */ + while (isspace(*line)) line++; + + /* now look for '=' or whitespace */ + line = getToken(line, &key, &key_len); + /* line now points to '=' or space */ + if (*line && !isspace(*line)) { + line = getToken(++line, &value, &value_len); + } else { + value = line; + value_len = 0; + } + if ((strlen(match) == key_len) + && strncmp(match, key, key_len) == 0) { + // create a new string + char* newstr = malloc(value_len + 1); + strncpy(newstr, value, value_len); + newstr[value_len] = 0; + + *matchval = newstr; + *len = value_len; + retval = true; + /* Continue to look for this key; last one wins. */ + } + } + + + return retval; +} + +/* Return NULL if no option has been successfully retrieved, or the string otherwise */ +const char * getStringForKey(const char * key, config_file_t *config) +{ + static const char* value =0; + int len=0; + if(!getValueForKey(key, &value, &len, config)) value = 0; + return value; +} + + +/* Returns TRUE if a value was found, FALSE otherwise. + * The boolean value of the key is stored in 'val'. + */ + +bool getBoolForKey( const char *key, bool *result_val, config_file_t *config ) +{ + const char *key_val; + int size; + + if (getValueForKey(key, &key_val, &size, config)) { + if ( (size >= 1) && (key_val[0] == 'Y' || key_val[0] == 'y') ) { + *result_val = true; + } else { + *result_val = false; + } + return true; + } + return false; +} + +bool getIntForKey( const char *key, int *value, config_file_t *config ) +{ + const char *val; + int size, sum; + bool negative = false; + + if (getValueForKey(key, &val, &size, config)) + { + if ( size ) + { + if (*val == '-') + { + negative = true; + val++; + size--; + } + + for (sum = 0; size > 0; size--) + { + if (*val < '0' || *val > '9') + return false; + + sum = (sum * 10) + (*val++ - '0'); + } + + if (negative) + sum = -sum; + + *value = sum; + return true; + } + } + return false; +} + +/* + * + */ + +bool getDimensionForKey( const char *key, unsigned int *value, config_file_t *config, unsigned int dimension_max, unsigned int object_size ) +{ + const char *val; + + int size = 0; + int sum = 0; + + bool negative = false; + bool percentage = false; + + if (getValueForKey(key, &val, &size, config)) + { + if ( size ) + { + if (*val == '-') + { + negative = true; + val++; + size--; + } + + if (val[size-1] == '%') + { + percentage = true; + size--; + } + + // convert string to integer + for (sum = 0; size > 0; size--) + { + if (*val < '0' || *val > '9') + return false; + + sum = (sum * 10) + (*val++ - '0'); + } + + if (percentage) + sum = ( dimension_max * sum ) / 100; + + // calculate offset from opposite origin + if (negative) + sum = ( ( dimension_max - object_size ) - sum ); + + } else { + + // null value calculate center + sum = ( dimension_max - object_size ) / 2; + + } + + *value = (uint16_t) sum; + return true; + } + + // key not found + return false; +} + +/* + * get color value from plist format #RRGGBB + */ + +bool getColorForKey( const char *key, unsigned int *value, config_file_t *config ) +{ + const char *val; + int size; + + if (getValueForKey(key, &val, &size, config)) + { + if (*val == '#') + { + val++; + *value = strtol(val, NULL, 16); + return true; + } + } + return false; +} + +bool getValueForKey( const char *key, const char **val, int *size, config_file_t *config ) +{ + const char *overrideVal; + int overrideSize; + bool override, ret; + + if (getValueForBootKey(bootArgs->CommandLine, key, val, size)) + return true; + + ret = getValueForConfigTableKey(config, key, val, size); + + // Try to find alternate keys in bootInfo->chameleonConfig (if config can be overriden) + // and prefer its values with the exceptions for + // "Kernel"="mach_kernel" and "Kernel Flags"="". + + if (config->canOverride) + { + if (getValueForConfigTableKey(&bootInfo->chameleonConfig, key, &overrideVal, &overrideSize)) + { + override = true; + + // NOTE: Values are defined by apple as being in com.apple.Boot.plist + // kHelperRootUUIDKey, kKernelArchKey, kMKextCacheKey, kKernelCacheKey, kKernelNameKey, kKernelFlagsKey + if (ret && (strcmp(key, kKernelNameKey) == 0) && (overrideSize == 0)) + override = false; + + if (ret && (strcmp(key, kKernelFlagsKey) == 0) && (overrideSize == 0)) + override = false; + + if (override) + { + *val = overrideVal; + *size = overrideSize; + return true; + } + } + } + + return ret; +} + + +#if UNUSED +void +printSystemConfig(char *p1) +{ + char *p2 = p1, tmp; + + while (*p1 != '\0') { + while (*p2 != '\0' && *p2 != '\n') p2++; + tmp = *p2; + *p2 = '\0'; + printf("%s\n", p1); + *p2 = tmp; + if (tmp == '\0') break; + p1 = ++p2; + } +} +#endif + +//========================================================================== +// ParseXMLFile +// Modifies the input buffer. +// Expects to see one dictionary in the XML file. +// Puts the first dictionary it finds in the +// tag pointer and returns 0, or returns -1 if not found +// (and does not modify dict pointer). +// Prints an error message if there is a parsing error. +// +int ParseXMLFile( char * buffer, TagPtr * dict ) +{ + long length, pos; + TagPtr tag; + pos = 0; + char *configBuffer; + + configBuffer = malloc(strlen(buffer)+1); + strcpy(configBuffer, buffer); + + while (1) + { + length = XMLParseNextTag(configBuffer + pos, &tag); + if (length == -1) break; + + pos += length; + + if (tag == 0) continue; + if (tag->type == kTagTypeDict) break; + + XMLFreeTag(tag); + } + free(configBuffer); + if (length < 0) { + error ("Error parsing plist file\n"); + return -1; + } + *dict = tag; + return 0; +} + +/* loadConfigFile + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadConfigFile (const char *configFile, config_file_t *config) +{ + int fd, count; + + if ((fd = open_bvdev("bt(0,0)", configFile, 0)) < 0) { + return -1; + } + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + return 0; +} + + +/* loadSystemConfig + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadSystemConfig(config_file_t *config) +{ + char *dirspec[] = { + "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/OS X Install Data/com.apple.Boot.plist", + }; + + int i, fd, count, ret=-1; + + for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) + { + if ((fd = open(dirspec[i], 0)) >= 0) + { + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + ret=0; + + break; + } + } + + if(ret == -1) ret = loadHelperConfig(config); + + // Always enable canOverride flag (for SystemConfig) + config->canOverride = true; + + return ret; +} + +/* loadChameleonConfig + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadChameleonConfig(config_file_t *config) +{ + char *dirspec[] = { + "rd(0,0)/Extra/org.chameleon.Boot.plist", + "/Extra/org.chameleon.Boot.plist", + "bt(0,0)/Extra/org.chameleon.Boot.plist", + + "rd(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */ + "/Extra/com.apple.Boot.plist", /* DEPRECIATED */ + "bt(0,0)/Extra/com.apple.Boot.plist", /* DEPRECIATED */ + }; + + int i, fd, count, ret=-1; + + for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) + { + if ((fd = open(dirspec[i], 0)) >= 0) + { + // Check for depreciated file names and annoy the user about it. + if(strstr(dirspec[i], "com.apple.Boot.plist")) + { + printf("%s is depreciated.\n", dirspec[i]); + dirspec[i][strlen(dirspec[i]) - strlen("com.apple.Boot.plist")] = 0; + printf("Please use the file %sorg.chameleon.Boot.plist instead.\n", dirspec[i]); + pause(); + } + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + ret=0; + break; + } + } + return ret; +} + +/* loadHelperConfig + * + * Returns 0 - successful. + * -1 - unsuccesful. + */ +int loadHelperConfig(config_file_t *config) +{ + char *dirspec[] = { + "/com.apple.boot.P/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/com.apple.boot.R/Library/Preferences/SystemConfiguration/com.apple.Boot.plist", + "/com.apple.boot.S/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" + }; + + int i, fd, count, ret=-1; + + for(i = 0; i< sizeof(dirspec)/sizeof(dirspec[0]); i++) + { + if ((fd = open(dirspec[i], 0)) >= 0) + { + // read file + count = read(fd, config->plist, IO_CONFIG_DATA_SIZE); + close(fd); + + // build xml dictionary + ParseXMLFile(config->plist, &config->dictionary); + sysConfigValid = true; + ret=0; + break; + } + } + return ret; +} + +char * newString(const char * oldString) +{ + if ( oldString ) + return strcpy(malloc(strlen(oldString)+1), oldString); + else + return NULL; +} + +/* + * Extracts the next argument from the command line, double quotes are allowed here. + */ +char * getNextArg(char ** argPtr, char * val) +{ + char * ptr = *argPtr; + const char * strStart; + int len = 0; + bool isQuoted = false; + + *val = '\0'; + + // Scan for the next non-whitespace character. + while ( *ptr && (*ptr == ' ' || *ptr == '=') ) + { + ptr++; + } + + strStart = ptr; + + // Skip the leading double quote character. + if (*ptr == '\"') + { + isQuoted = true; + ptr++; + strStart++; + } + + // Scan for the argument terminator character. + // This can be either a NULL character - in case we reach the end of the string, + // a double quote in case of quoted argument, + // or a whitespace character (' ' or '=') for non-quoted argument. + while (*ptr && !( (isQuoted && (*ptr == '\"')) || + (!isQuoted && (*ptr == ' ' || *ptr == '=')) ) + ) + { + ptr++; + } + + len = ptr - strStart; + + // Skip the closing double quote character and adjust + // the starting pointer for the next getNextArg call. + if (*ptr && isQuoted && *ptr == '\"') + ptr++; + + // Copy the extracted argument to val. + strncat(val, strStart, len); + + // Set command line pointer. + *argPtr = ptr; + + return ptr; +} diff --git a/i386/libsaio/sys.c b/i386/libsaio/sys.c new file mode 100644 index 0000000..775ebc0 --- /dev/null +++ b/i386/libsaio/sys.c @@ -0,0 +1,1092 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * Copyright (c) 1988 Carnegie-Mellon University + * Copyright (c) 1987 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + * + */ +/* + * HISTORY + * Revision 2.3 88/08/08 13:47:07 rvb + * Allocate buffers dynamically vs statically. + * Now b[i] and i_fs and i_buf, are allocated dynamically. + * boot_calloc(size) allocates and zeros a buffer rounded to a NPG + * boundary. + * Generalize boot spec to allow, xx()/mach, xx(n,[a..h])/mach, + * xx([a..h])/mach, ... + * Also default "xx" if unspecified and alloc just "/mach", + * where everything is defaulted + * Add routine, ptol(), to parse partition letters. + * + */ + +/* + * Copyright (c) 1982, 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)sys.c 7.1 (Berkeley) 6/5/86 + */ + +/* Copyright 2007 VMware Inc. + "Preboot" ramdisk support added by David Elliott + */ + + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "disk.h" +#include "ramdisk.h" +#include "xml.h" + +#include <libkern/crypto/md5.h> +//#include <uuid/uuid.h> + +#if 0 /* No OS X release has ever included this. */ +#include <Kernel/uuid/namespace.h> +#else +// from our uuid/namespace.h (UFS and HFS uuids can live in the same space?) +static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC}; +#endif + +extern int multiboot_partition; +extern int multiboot_partition_set; +extern int multiboot_skip_partition; +extern int multiboot_skip_partition_set; + +struct devsw { + const char * name; + // size increased from char to short to handle non-BIOS internal devices + unsigned short biosdev; + int type; +}; + +// Device entries must be ordered by bios device numbers. +static struct devsw devsw[] = +{ + { "hd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_HD */ + { "en", 0xE0, kBIOSDevTypeNetwork }, /* DEV_EN */ + { "rd", 0x100, kBIOSDevTypeHardDrive }, + { "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition + { 0, 0 } +}; + +// Pseudo BIOS devices +enum { + kPseudoBIOSDevRAMDisk = 0x100, + kPseudoBIOSDevBooter = 0x101 +}; + +/* + * Max number of file descriptors. + */ +#define NFILES 6 + +static struct iob iob[NFILES]; + +void * gFSLoadAddress = 0; + +// Turbo - save what we think is our original BIOS boot volume if we have one 0xab +BVRef gBIOSBootVolume = NULL; +BVRef gBootVolume; + +//static BVRef getBootVolumeRef( const char * path, const char ** outPath ); +static BVRef newBootVolumeRef( int biosdev, int partno ); + +//========================================================================== +// LoadVolumeFile - LOW-LEVEL FILESYSTEM FUNCTION. +// Load the specified file from the specified volume +// to the load buffer at LOAD_ADDR. +// If the file is fat, load only the i386 portion. + +long LoadVolumeFile(BVRef bvr, const char *filePath) +{ + long fileSize; + + // Read file into load buffer. The data in the load buffer will be + // overwritten by the next LoadFile() call. + + gFSLoadAddress = (void *) LOAD_ADDR; + + fileSize = bvr->fs_loadfile(bvr, (char *)filePath); + + // Return the size of the file, or -1 if load failed. + + return fileSize; +} + +//========================================================================== +// LoadFile - LOW-LEVEL FILESYSTEM FUNCTION. +// Load the specified file to the load buffer at LOAD_ADDR. +// If the file is fat, load only the i386 portion. + +long LoadFile(const char * fileSpec) +{ + const char * filePath; + BVRef bvr; + + // Resolve the boot volume from the file spec. + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) + return -1; + + return LoadVolumeFile(bvr, filePath); +} + +long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length) +{ + const char *filePath; + BVRef bvr; + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) + return -1; + + if (bvr->fs_readfile == NULL) + return -1; + + return bvr->fs_readfile(bvr, (char *)filePath, buffer, offset, length); +} + +long LoadThinFatFile(const char *fileSpec, void **binary) +{ + const char *filePath; + FSReadFile readFile; + BVRef bvr; + unsigned long length, length2; + + // Resolve the boot volume from the file spec. + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) + return -1; + + *binary = (void *)kLoadAddr; + + // Read file into load buffer. The data in the load buffer will be + // overwritten by the next LoadFile() call. + + gFSLoadAddress = (void *) LOAD_ADDR; + + readFile = bvr->fs_readfile; + + if (readFile != NULL) { + // Read the first 4096 bytes (fat header) + length = readFile(bvr, (char *)filePath, *binary, 0, 0x1000); + if (length > 0) { + if (ThinFatFile(binary, &length) == 0) { + if (length == 0) + return 0; + // We found a fat binary; read only the thin part + length = readFile(bvr, (char *)filePath, + (void *)kLoadAddr, (unsigned long)(*binary) - kLoadAddr, length); + *binary = (void *)kLoadAddr; + } else { + // Not a fat binary; read the rest of the file + length2 = readFile(bvr, (char *)filePath, (void *)(kLoadAddr + length), length, 0); + if (length2 == -1) return -1; + length += length2; + } + } + } else { + length = bvr->fs_loadfile(bvr, (char *)filePath); + if (length > 0) { + ThinFatFile(binary, &length); + } + } + + return length; +} + +#if UNUSED +long GetFSUUID(char *spec, char *uuidStr) +{ + BVRef bvr; + long rval = -1; + const char *devSpec; + + if ((bvr = getBootVolumeRef(spec, &devSpec)) == NULL) + return -1; + + if(bvr->fs_getuuid) + rval = bvr->fs_getuuid(bvr, uuidStr); + + return rval; +} +#endif + +// filesystem-specific getUUID functions call this shared string generator +long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr) +{ + unsigned fmtbase, fmtidx, i; + uint8_t uuidfmt[] = { 4, 2, 2, 2, 6 }; + char *p = uuidStr; + MD5_CTX md5c; + uint8_t mdresult[16]; + + bzero(mdresult, sizeof(mdresult)); + + // just like AppleFileSystemDriver + MD5Init(&md5c); + MD5Update(&md5c, kFSUUIDNamespaceSHA1, sizeof(kFSUUIDNamespaceSHA1)); + MD5Update(&md5c, uubytes, nbytes); + MD5Final(mdresult, &md5c); + + // this UUID has been made version 3 style (i.e. via namespace) + // see "-uuid-urn-" IETF draft (which otherwise copies byte for byte) + mdresult[6] = 0x30 | ( mdresult[6] & 0x0F ); + mdresult[8] = 0x80 | ( mdresult[8] & 0x3F ); + + + // generate the text: e.g. 5EB1869F-C4FA-3502-BDEB-3B8ED5D87292 + i = 0; fmtbase = 0; + for(fmtidx = 0; fmtidx < sizeof(uuidfmt); fmtidx++) { + for(i=0; i < uuidfmt[fmtidx]; i++) { + uint8_t byte = mdresult[fmtbase+i]; + char nib; + + nib = byte >> 4; + *p = nib + '0'; // 0x4 -> '4' + if(*p > '9') *p = (nib - 9 + ('A'-1)); // 0xB -> 'B' + p++; + + nib = byte & 0xf; + *p = nib + '0'; // 0x4 -> '4' + if(*p > '9') *p = (nib - 9 + ('A'-1)); // 0xB -> 'B' + p++; + + } + fmtbase += i; + if(fmtidx < sizeof(uuidfmt)-1) + *(p++) = '-'; + else + *p = '\0'; + } + + return 0; +} + + +//========================================================================== +// GetDirEntry - LOW-LEVEL FILESYSTEM FUNCTION. +// Fetch the next directory entry for the given directory. + +long GetDirEntry(const char * dirSpec, long long * dirIndex, const char ** name, + long * flags, long * time) +{ + const char * dirPath; + BVRef bvr; + + // Resolve the boot volume from the dir spec. + + if ((bvr = getBootVolumeRef(dirSpec, &dirPath)) == NULL) + return -1; + + // Return 0 on success, or -1 if there are no additional entries. + + return bvr->fs_getdirentry( bvr, + /* dirPath */ (char *)dirPath, + /* dirIndex */ dirIndex, + /* dirEntry */ (char **)name, flags, time, 0, 0 ); +} + +//========================================================================== +// GetFileInfo - LOW-LEVEL FILESYSTEM FUNCTION. +// Get attributes for the specified file. + +static char* gMakeDirSpec; + +long GetFileInfo(const char * dirSpec, const char * name, + long * flags, long * time) +{ + long long index = 0; + const char * entryName; + + if (gMakeDirSpec == 0) + gMakeDirSpec = (char *)malloc(1024); + + if (!dirSpec) { + long idx, len; + + len = strlen(name); + + for (idx = len; idx && (name[idx] != '/' && name[idx] != '\\'); idx--) {} + if (idx == 0) { + if(name[idx] == '/' || name[idx] == '\\') ++name; // todo: ensure other functions handel \ properly + gMakeDirSpec[0] = '/'; + gMakeDirSpec[1] = '\0'; + } else { + idx++; + strncpy(gMakeDirSpec, name, idx); + gMakeDirSpec[idx] = '\0'; + name += idx; + } + dirSpec = gMakeDirSpec; + } + + while (GetDirEntry(dirSpec, &index, &entryName, flags, time) == 0) + { + if (strcmp(entryName, name) == 0) + return 0; // success + } + return -1; // file not found +} + +long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock) +{ + const char * filePath; + BVRef bvr; + + // Resolve the boot volume from the file spec. + + if ((bvr = getBootVolumeRef(fileSpec, &filePath)) == NULL) { + printf("Boot volume for '%s' is bogus\n", fileSpec); + return -1; + } + + return bvr->fs_getfileblock(bvr, (char *)filePath, firstBlock); +} + +//========================================================================== +// GetFreeFD() + +static int GetFreeFd(void) +{ + int fd; + + // Locate a free descriptor slot. + for (fd = 0; fd < NFILES; fd++) { + if (iob[fd].i_flgs == 0) { + return fd; + } + } + stop("Out of file descriptors"); + // not reached + return -1; +} + +//========================================================================== +// iob_from_fdesc() +// +// Return a pointer to an allocated 'iob' based on the file descriptor +// provided. Returns NULL if the file descriptor given is invalid. + +static struct iob * iob_from_fdesc(int fdesc) +{ + register struct iob * io; + + if (fdesc < 0 || fdesc >= NFILES || + ((io = &iob[fdesc])->i_flgs & F_ALLOC) == 0) + return NULL; + else + return io; +} + +//========================================================================== +// openmem() + +int openmem(char * buf, int len) +{ + int fdesc; + struct iob * io; + + fdesc = GetFreeFd(); + io = &iob[fdesc]; + bzero(io, sizeof(*io)); + + // Mark the descriptor as taken. Set the F_MEM flag to indicate + // that the file buffer is provided by the caller. + + io->i_flgs = F_ALLOC | F_MEM; + io->i_buf = buf; + io->i_filesize = len; + + return fdesc; +} + +//========================================================================== +// open() - Open the file specified by 'path' for reading. + +static int open_bvr(BVRef bvr, const char *filePath, int flags) +{ + struct iob *io; + int fdesc; + int i; + + if (bvr == NULL) { + return -1; + } + + fdesc = GetFreeFd(); + io = &iob[fdesc]; + bzero(io, sizeof(*io)); + + // Mark the descriptor as taken. + io->i_flgs = F_ALLOC; + + // Find the next available memory block in the download buffer. + io->i_buf = (char *) LOAD_ADDR; + for (i = 0; i < NFILES; i++) { + if ((iob[i].i_flgs != F_ALLOC) || (i == fdesc)) { + continue; + } + io->i_buf = MAX(iob[i].i_filesize + iob[i].i_buf, io->i_buf); + } + + // Load entire file into memory. Unnecessary open() calls must be avoided. + gFSLoadAddress = io->i_buf; + io->i_filesize = bvr->fs_loadfile(bvr, (char *)filePath); + if (io->i_filesize < 0) { + close(fdesc); + return -1; + } + return fdesc; +} + +int open(const char *path, int flags) +{ + const char *filepath; + BVRef bvr; + + // Resolve the boot volume from the file spec. + if ((bvr = getBootVolumeRef(path, &filepath)) != NULL) { + return open_bvr(bvr, filepath, flags); + } + return -1; +} + +int open_bvdev(const char *bvd, const char *path, int flags) +{ + const struct devsw *dp; + const char *cp; + BVRef bvr; + int i; + int len; + int unit; + int partition; + + if ((i = open(path, flags)) >= 0) { + return i; + } + + if (bvd == NULL || (len = strlen(bvd)) < 2) { + return -1; + } + + for (dp=devsw; dp->name; dp++) { + if (bvd[0] == dp->name[0] && bvd[1] == dp->name[1]) { + unit = 0; + partition = 0; + /* get optional unit and partition */ + if (len >= 5 && bvd[2] == '(') { /* min must be present xx(0) */ + cp = &bvd[3]; + i = 0; + while ((cp - path) < len && isdigit(*cp)) { + i = i * 10 + *cp++ - '0'; + unit = i; + } + if (*cp++ == ',') { + i = 0; + while ((cp - path) < len && isdigit(*cp)) { + i = i * 10 + *cp++ - '0'; + partition = i; + } + } + } + bvr = newBootVolumeRef(dp->biosdev + unit, partition); + return open_bvr(bvr, path, flags); + } + } + return -1; +} + +//========================================================================== +// close() - Close a file descriptor. + +int close(int fdesc) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + io->i_flgs = 0; + + return 0; +} + +//========================================================================== +// lseek() - Reposition the byte offset of the file descriptor from the +// beginning of the file. Returns the relocated offset. + +int b_lseek(int fdesc, int offset, int ptr) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + io->i_offset = offset; + + return offset; +} + +//========================================================================== +// tell() - Returns the byte offset of the file descriptor. + +int tell(int fdesc) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return 0; + + return io->i_offset; +} + +//========================================================================== +// read() - Read up to 'count' bytes of data from the file descriptor +// into the buffer pointed to by buf. + +int read(int fdesc, char * buf, int count) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + count) > (unsigned int)io->i_filesize) + count = io->i_filesize - io->i_offset; + + if (count <= 0) + return 0; // end of file + + bcopy(io->i_buf + io->i_offset, buf, count); + + io->i_offset += count; + + return count; +} + +//========================================================================== +// write() - Write up to 'count' bytes of data to the file descriptor +// from the buffer pointed to by buf. + +int write(int fdesc, const char * buf, int count) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + count) > (unsigned int)io->i_filesize) + count = io->i_filesize - io->i_offset; + + if (count <= 0) + return 0; // end of file + + bcopy(buf, io->i_buf + io->i_offset, count); + + io->i_offset += count; + + return count; +} + +int writebyte(int fdesc, char value) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + 1) > (unsigned int)io->i_filesize) + return 0; // end of file + + io->i_buf[io->i_offset++] = value; + + return 1; +} + +int writeint(int fdesc, int value) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == NULL) + return (-1); + + if ((io->i_offset + 4) > (unsigned int)io->i_filesize) + return 0; // end of file + + bcopy(&value, io->i_buf + io->i_offset, 4); + + io->i_offset += 4; + + return 4; +} + +//========================================================================== +// file_size() - Returns the size of the file described by the file +// descriptor. + +int file_size(int fdesc) +{ + struct iob * io; + + if ((io = iob_from_fdesc(fdesc)) == 0) + return 0; + + return io->i_filesize; +} + +//========================================================================== + +struct dirstuff * vol_opendir(BVRef bvr, const char * path) +{ + struct dirstuff * dirp = 0; + + dirp = (struct dirstuff *) malloc(sizeof(struct dirstuff)); + if (dirp == NULL) + goto error; + + dirp->dir_path = newString(path); + if (dirp->dir_path == NULL) + goto error; + + dirp->dir_bvr = bvr; + + return dirp; + +error: + closedir(dirp); + return NULL; +} + +//========================================================================== + +struct dirstuff * opendir(const char * path) +{ + struct dirstuff * dirp = 0; + const char * dirPath; + BVRef bvr; + + if ((bvr = getBootVolumeRef(path, &dirPath)) == NULL) + goto error; + + dirp = (struct dirstuff *) malloc(sizeof(struct dirstuff)); + if (dirp == NULL) + goto error; + + dirp->dir_path = newString(dirPath); + if (dirp->dir_path == NULL) + goto error; + + dirp->dir_bvr = bvr; + + return dirp; + +error: + closedir(dirp); + return NULL; +} + +//========================================================================== + +int closedir(struct dirstuff * dirp) +{ + if (dirp) { + if (dirp->dir_path) free(dirp->dir_path); + free(dirp); + } + return 0; +} + +//========================================================================== + +int readdir(struct dirstuff * dirp, const char ** name, long * flags, + long * time) +{ + return dirp->dir_bvr->fs_getdirentry( dirp->dir_bvr, + /* dirPath */ dirp->dir_path, + /* dirIndex */ &dirp->dir_index, + /* dirEntry */ (char **)name, flags, time, + 0, 0); +} + +//========================================================================== + +int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, + long * time, FinderInfo *finderInfo, long *infoValid) +{ + return dirp->dir_bvr->fs_getdirentry( dirp->dir_bvr, + /* dirPath */ dirp->dir_path, + /* dirIndex */ &dirp->dir_index, + /* dirEntry */ (char **)name, + flags, time, + finderInfo, infoValid); +} + +//========================================================================== + +const char * systemConfigDir() +{ + if (gBootFileType == kNetworkDeviceType) + return ""; + return "/Library/Preferences/SystemConfiguration"; +} + +//========================================================================== + +int gBootFileType; + +void scanBootVolumes( int biosdev, int * count ) +{ + BVRef bvr = 0; + + bvr = diskScanBootVolumes(biosdev, count); + if (bvr == NULL) + { + bvr = nbpScanBootVolumes(biosdev, count); + if (bvr != NULL) + { + gBootFileType = kNetworkDeviceType; + } + } + else + { + gBootFileType = kBlockDeviceType; + } +} + +//========================================================================== + +void scanDisks(int biosdev, int *count) +{ + #define MAX_HDD_COUNT 32 + int bvCount; + int hd = 0; + + // Testing up to MAX_HDD_COUNT hard drives. + while(!testBiosread(0x80 + hd, 0) && hd < MAX_HDD_COUNT) + { + bvCount = 0; + scanBootVolumes(0x80 + hd, &bvCount); + hd++; + } + + // Also scanning CD/DVD drive. + if (biosDevIsCDROM(gBIOSDev)) + { + bvCount = 0; + scanBootVolumes(gBIOSDev, &bvCount); + } +} + +//========================================================================== + +BVRef selectBootVolume( BVRef chain ) +{ + bool filteredChain = false; + bool foundPrimary = false; + BVRef bvr, bvr1 = 0, bvr2 = 0; + + if (chain->filtered) filteredChain = true; + + if (multiboot_partition_set) + for ( bvr = chain; bvr; bvr = bvr->next ) + if ( bvr->part_no == multiboot_partition && bvr->biosdev == gBIOSDev ) + return bvr; + + /* + * Checking "Default Partition" key in system configuration - use format: hd(x,y), the volume UUID or label - + * to override the default selection. + * We accept only kBVFlagSystemVolume or kBVFlagForeignBoot volumes. + */ + char *val = XMLDecode(getStringForKey(kDefaultPartition, &bootInfo->chameleonConfig)); + if (val) { + for ( bvr = chain; bvr; bvr = bvr->next ) { + if (matchVolumeToString(bvr, val, false)) { + free(val); + return bvr; + } + } + free(val); + } + + /* + * Scannig the volume chain backwards and trying to find + * a HFS+ volume with valid boot record signature. + * If not found any active partition then we will + * select this volume as the boot volume. + */ + for ( bvr = chain; bvr; bvr = bvr->next ) + { + if (multiboot_skip_partition_set) { + if (bvr->part_no == multiboot_skip_partition) continue; + } + if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) foundPrimary = true; + // zhell -- Undo a regression that was introduced from r491 to 492. + // if gBIOSBootVolume is set already, no change is required + if ( bvr->flags & (kBVFlagBootable|kBVFlagSystemVolume) + && gBIOSBootVolume + && (!filteredChain || (filteredChain && bvr->visible)) + && bvr->biosdev == gBIOSDev ) + bvr2 = bvr; + // zhell -- if gBIOSBootVolume is NOT set, we use the "if" statement + // from r491, + if ( bvr->flags & kBVFlagBootable + && ! gBIOSBootVolume + && bvr->biosdev == gBIOSDev ) + bvr2 = bvr; + } + + + /* + * Use the standrad method for selecting the boot volume. + */ + if (foundPrimary) + { + for ( bvr = chain; bvr; bvr = bvr->next ) + { + if ( bvr->flags & kBVFlagNativeBoot && bvr->biosdev == gBIOSDev ) bvr1 = bvr; + if ( bvr->flags & kBVFlagPrimary && bvr->biosdev == gBIOSDev ) bvr2 = bvr; + } + } + + bvr = bvr2 ? bvr2 : + bvr1 ? bvr1 : chain; + + return bvr; +} + +//========================================================================== + +#define LP '(' +#define RP ')' +int gBIOSDev; + +/*! + This is like boot2's gBootVolume except it is for the internal use of + libsaio to track which volume an unqualified path should be relative to. + This replaces bootInfo->kernDev as the carrier of this information. + */ +static BVRef gRootVolume; + +void setRootVolume(BVRef volume) +{ + gRootVolume = volume; + // Veto non-native FS. Basically that means don't allow the root volume to + // be set to a volume we can't read files from. + if(gRootVolume != NULL && ((gRootVolume->flags & kBVFlagNativeBoot) == 0)) + gRootVolume = NULL; +} + +void setBootGlobals(BVRef chain) +{ + // Record default boot device. + gBootVolume = selectBootVolume(chain); + + // turbo - Save the ORIGINAL boot volume too for loading our mkext + if (!gBIOSBootVolume) gBIOSBootVolume = gBootVolume; + + setRootVolume(gBootVolume); +} + +/*! + Extracts the volume selector from the pathname, returns the selected + BVRef, and sets *outPath to the remainder of the path. + If the path did not include a volume selector then the current volume + is used. When called with a volume selector the current volume + is changed to the selected volume unless the volume selector is + that of a ramdisk. + */ +BVRef getBootVolumeRef( const char * path, const char ** outPath ) +{ + const char * cp; + BVRef bvr = gRootVolume; + int biosdev = gBIOSDev; + + // Search for left parenthesis in the path specification. + + for (cp = path; *cp; cp++) { + if (*cp == LP || *cp == '/') break; + } + + if (*cp != LP) // no left paren found + { + // Path is using the implicit current device so if there is + // no current device, then we must fail. + cp = path; + if ( gRootVolume == NULL ) + return NULL; + } + else if ((cp - path) == 2) // found "xx(" + { + const struct devsw * dp; + const char * xp = path; + int i; + int unit = -1; + int part = -1; + + cp++; + + // Check the 2 character device name pointed by 'xp'. + + for (dp = devsw; dp->name; dp++) + { + if ((xp[0] == dp->name[0]) && (xp[1] == dp->name[1])) + break; // found matching entry + } + if (dp->name == NULL) + { + error("Unknown device '%c%c'\n", xp[0], xp[1]); + return NULL; + } + + // Extract the optional unit number from the specification. + // hd(unit) or hd(unit, part). + + i = 0; + while (*cp >= '0' && *cp <= '9') + { + i = i * 10 + *cp++ - '0'; + unit = i; + } + + // Unit is no longer optional and never really was. + // If the user failed to specify it then the unit number from the previous kernDev + // would have been used which makes little sense anyway. + // For example, if the user did fd()/foobar and the current root device was the + // second hard disk (i.e. unit 1) then fd() would select the second floppy drive! + if(unit == -1) + return NULL; + + // Extract the optional partition number from the specification. + + if (*cp == ',') + part = atoi(++cp); + + // If part is not specified part will be -1 whereas before it would have been + // whatever the last partition was which makes about zero sense if the device + // has been switched. + + // Skip past the right paren. + + for ( ; *cp && *cp != RP; cp++) /* LOOP */; + if (*cp == RP) cp++; + + biosdev = dp->biosdev + unit; + bvr = newBootVolumeRef(biosdev, part); + + if(bvr == NULL) + return NULL; + } + else + { + // Bad device specifier, skip past the right paren. + + for ( cp++; *cp && *cp != RP; cp++) /* LOOP */; + if (*cp == RP) cp++; + // If gRootVolume was NULL, then bvr will be NULL as well which + // should be caught by the caller. + } + + // Returns the file path following the device spec. + // e.g. 'hd(1,b)mach_kernel' is reduced to 'mach_kernel'. + + *outPath = cp; + + return bvr; +} + +//========================================================================== +// Function name is a misnomer as scanBootVolumes usually calls diskScanBootVolumes +// which caches the information. So it's only allocated on the first run. +static BVRef newBootVolumeRef( int biosdev, int partno ) +{ + BVRef bvr, bvr1, bvrChain; + + bvr = bvr1 = NULL; + + // Try resolving "rd" and "bt" devices first. + if (biosdev == kPseudoBIOSDevRAMDisk) + { + if (gRAMDiskVolume) + bvr1 = gRAMDiskVolume; + } + else if (biosdev == kPseudoBIOSDevBooter) + { + if (gRAMDiskVolume != NULL && gRAMDiskBTAliased) + bvr1 = gRAMDiskVolume; + else + bvr1 = gBIOSBootVolume; + } + else + { + // Fetch the volume list from the device. + + scanBootVolumes( biosdev, NULL ); + bvrChain = getBVChainForBIOSDev(biosdev); + + // Look for a perfect match based on device and partition number. + + for ( bvr1 = NULL, bvr = bvrChain; bvr; bvr = bvr->next ) + { + if ( ( bvr->flags & kBVFlagNativeBoot ) == 0 ) continue; + + bvr1 = bvr; + if ( bvr->part_no == partno ) break; + } + } + + return bvr ? bvr : bvr1; +} + +//========================================================================== +// getDeviceDescription() - Extracts unit number and partition number +// from bvr structure into "dw(u,p)" format. +// Returns length of the out string +int getDeviceDescription(BVRef bvr, char *str) +{ + if(!str) + return 0; + + *str = '\0'; + + if (bvr) + { + const struct devsw *dp = devsw; + while(dp->name && bvr->biosdev >= dp->biosdev) + dp++; + + dp--; + if (dp->name) + return sprintf(str, "%s(%d,%d)", dp->name, bvr->biosdev - dp->biosdev, bvr->part_no); + } + + return 0; +} diff --git a/i386/libsaio/table.c b/i386/libsaio/table.c new file mode 100644 index 0000000..2e7da0f --- /dev/null +++ b/i386/libsaio/table.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Mach Operating System + * Copyright (c) 1990 Carnegie-Mellon University + * Copyright (c) 1989 Carnegie-Mellon University + * All rights reserved. The CMU software License Agreement specifies + * the terms and conditions for use and redistribution. + */ + +/* + * INTEL CORPORATION PROPRIETARY INFORMATION + * + * This software is supplied under the terms of a license agreement or + * nondisclosure agreement with Intel Corporation and may not be copied + * nor disclosed except in accordance with the terms of that agreement. + * + * Copyright 1988, 1989 Intel Corporation + */ + +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "memory.h" + +/* Segment Descriptor + * + * 31 24 19 16 7 0 + * ------------------------------------------------------------ + * | | |B| |A| | | |1|0|E|W|A| | + * | BASE 31..24 |G|/|0|V| LIMIT |P|DPL| TYPE | BASE 23:16 | + * | | |D| |L| 19..16| | |1|1|C|R|A| | + * ------------------------------------------------------------ + * | | | + * | BASE 15..0 | LIMIT 15..0 | + * | | | + * ------------------------------------------------------------ + */ + +struct seg_desc { + unsigned short limit_15_0; + unsigned short base_15_0; + unsigned char base_23_16; + unsigned char bit_15_8; + unsigned char bit_23_16; + unsigned char base_31_24; +}; + +// turbo - GDT must be in first 64k segment +struct seg_desc __attribute__ ((section("__INIT,__data"))) Gdt[ NGDTENT ] = { + /* 0x0 : null */ + {0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00}, + + /* 0x8 : boot protected mode 32-bit code segment + byte granularity, 1MB limit, MEMBASE offset */ + //{0xFFFF, MEMBASE, 0x00, 0x9E, 0x4F, 0x00}, + {0xFFFF, 0x0000, 0x00, 0x9E, 0xCF, 0x00}, + + /* 0x10 : boot protected mode data segment + page granularity, 4GB limit, MEMBASE offset */ + {0xFFFF, MEMBASE, 0x00, 0x92, 0xCF, 0x00}, + + /* 0x18 : boot protected mode 16-bit code segment + byte granularity, 1MB limit, MEMBASE offset */ + {0xFFFF, MEMBASE, 0x00, 0x9E, 0x0F, 0x00}, + + /* 0x20 : kernel init 32-bit data segment + page granularity, 4GB limit, zero offset */ + {0xFFFF, 0x0000, 0x00, 0x92, 0xCF, 0x00}, + + /* 0x28 : kernel init 32-bit code segment + page granularity, 4GB limit, zero offset */ + {0xFFFF, 0x0000, 0x00, 0x9E, 0xCF, 0x00}, + + /* 0x30 : boot real mode data/stack segment + byte granularity, 64K limit, MEMBASE offset, expand-up */ + {0xFFFF, MEMBASE, 0x00, 0x92, 0x00, 0x00}, +}; diff --git a/i386/libsaio/term.h b/i386/libsaio/term.h new file mode 100644 index 0000000..a89a1a7 --- /dev/null +++ b/i386/libsaio/term.h @@ -0,0 +1,59 @@ +/* + * term.h + * Chameleon + * + * Created by JrCs on 30/08/11. + * Copyright 2011. All rights reserved. + * + */ + +#ifndef __LIBSAIO_TERM_H +#define __LIBSAIO_TERM_H + +#define ASCII_KEY_MASK 0x7f +#define ASCII_KEY(x) ((x & ASCII_KEY_MASK)) + +#define KEY_BKSP 0x0008 +#define KEY_TAB 0x0009 +#define KEY_ENTER 0x000d +#define KEY_ESC 0x001b +#define KEY_PRTSC 0x002a +#define KEY_LEFT 0x4b00 +#define KEY_RIGHT 0x4d00 +#define KEY_UP 0x4800 +#define KEY_DOWN 0x5000 +#define KEY_HOME 0x4700 +#define KEY_END 0x4f00 +#define KEY_CENTER 0x4c00 +#define KEY_INS 0x5200 +#define KEY_DEL 0x5300 +#define KEY_PGUP 0x4900 +#define KEY_PGDN 0x5100 +#define KEY_F1 0x3b00 +#define KEY_F2 0x3c00 +#define KEY_F3 0x3d00 +#define KEY_F4 0x3e00 +#define KEY_F5 0x3f00 +#define KEY_F6 0x4000 +#define KEY_F7 0x4100 +#define KEY_F8 0x4200 +#define KEY_F9 0x4300 +#define KEY_F10 0x4400 +#define KEY_F11 0x5700 +#define KEY_F12 0x5800 + +// Key code for input that shouldn't echoed back +#define KEY_NOECHO 0xff00 + +/* Bitmasks for modifier keys */ +#define STATUS_RSHIFT (1 << 0) +#define STATUS_LSHIFT (1 << 1) +#define STATUS_RCTRL (1 << 2) +#define STATUS_RALT (1 << 3) +#define STATUS_SCROLL (1 << 4) +#define STATUS_NUM (1 << 5) +#define STATUS_CAPS (1 << 6) +#define STATUS_LCTRL (1 << 8) +#define STATUS_LALT (1 << 9) + +#endif /* !__LIBSAIO_TERM_H */ diff --git a/i386/libsaio/ufs.h b/i386/libsaio/ufs.h new file mode 100644 index 0000000..3da8f65 --- /dev/null +++ b/i386/libsaio/ufs.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +extern long UFSInitPartition(CICell ih); +extern long UFSLoadFile(CICell ih, char * filePath); +extern long UFSReadFile( CICell ih, char * filePath, void * base, uint64_t offset, uint64_t length ); +extern long UFSGetDirEntry(CICell ih, char * dirPath, long long * dirIndex, + char ** name, long * flags, long * time, + FinderInfo * finderInfo, long * infoValid); +extern void UFSGetDescription(CICell ih, char *str, long strMaxLen); +extern long UFSGetFileBlock(CICell ih, char *str, unsigned long long *firstBlock); +extern long UFSGetUUID(CICell ih, char *uuidStr); +extern void UFSFree(CICell ih); + diff --git a/i386/libsaio/ufs_byteorder.h b/i386/libsaio/ufs_byteorder.h new file mode 100644 index 0000000..2e5f20f --- /dev/null +++ b/i386/libsaio/ufs_byteorder.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1992 NeXT Computer, Inc. + * + * UFS byte swapping routines to make a big endian file system useful on a + * little endian machine. + * + * HISTORY + * + * 8 Jul 1992 Brian Pinkerton at NeXT + * Created. + */ + +#ifndef __LIBSAIO_UFS_BYTEORDER_H +#define __LIBSAIO_UFS_BYTEORDER_H + +//#include <sys/vnode.h> +#include <ufs/ffs/fs.h> +#include <sys/buf.h> +#include <sys/disk.h> +#include <ufs/ufs/dinode.h> +#include <ufs/ufs/dir.h> + +void byte_swap_ints(unsigned int *array, int count); +void byte_swap_shorts(unsigned short *array, int count); +void byte_swap_longlongs(unsigned long long *array, int count); + +void byte_swap_superblock(struct fs *sb); +void byte_swap_dinode_in(struct dinode *di); +void byte_swap_dir_block_in(char *addr, int count); +void byte_swap_inode_in(struct dinode *dc, struct dinode *ic); + +#endif /* !__LIBSAIO_UFS_BYTEORDER_H */ diff --git a/i386/libsaio/usb.c b/i386/libsaio/usb.c new file mode 100644 index 0000000..15534ca --- /dev/null +++ b/i386/libsaio/usb.c @@ -0,0 +1,344 @@ +/* + * usb.c + * + * + * Created by mackerintel on 12/20/08. + * Copyright 2008 mackerintel. All rights reserved. + * + */ + +#include "libsaio.h" +#include "boot.h" +#include "bootstruct.h" +#include "pci.h" + +#ifndef DEBUG_USB +#define DEBUG_USB 0 +#endif + +#if DEBUG_USB +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + + +struct pciList +{ + pci_dt_t* pciDev; + struct pciList* next; +}; + +struct pciList* usbList = NULL; + +int legacy_off (pci_dt_t *pci_dev); +int ehci_acquire (pci_dt_t *pci_dev); +int uhci_reset (pci_dt_t *pci_dev); + +// Add usb device to the list +void notify_usb_dev(pci_dt_t *pci_dev) +{ + struct pciList* current = usbList; + if(!usbList) + { + usbList = (struct pciList*)malloc(sizeof(struct pciList)); + usbList->next = NULL; + usbList->pciDev = pci_dev; + + } + else + { + while(current != NULL && current->next != NULL) + { + current = current->next; + } + current->next = (struct pciList*)malloc(sizeof(struct pciList)); + current = current->next; + + current->pciDev = pci_dev; + current->next = NULL; + } +} + +// Loop through the list and call the apropriate patch function +int usb_loop() +{ + int retVal = 1; + bool fix_ehci, fix_uhci, fix_usb, fix_legacy; + fix_ehci = fix_uhci = fix_usb = fix_legacy = false; + + if (getBoolForKey(kUSBBusFix, &fix_usb, &bootInfo->chameleonConfig)) + { + fix_ehci = fix_uhci = fix_legacy = fix_usb; // Disable all if none set + } + else + { + getBoolForKey(kEHCIacquire, &fix_ehci, &bootInfo->chameleonConfig); + getBoolForKey(kUHCIreset, &fix_uhci, &bootInfo->chameleonConfig); + getBoolForKey(kLegacyOff, &fix_legacy, &bootInfo->chameleonConfig); + } + + struct pciList* current = usbList; + + while(current) + { + switch (pci_config_read8(current->pciDev->dev.addr, PCI_CLASS_PROG)) + { + // EHCI + case 0x20: + if(fix_ehci) retVal &= ehci_acquire(current->pciDev); + if(fix_legacy) retVal &= legacy_off(current->pciDev); + + break; + + // UHCI + case 0x00: + if (fix_uhci) retVal &= uhci_reset(current->pciDev); + + break; + } + + current = current->next; + } + return retVal; +} + +int legacy_off (pci_dt_t *pci_dev) +{ + // Set usb legacy off modification by Signal64 + // NOTE: This *must* be called after the last file is loaded from the drive in the event that we are booting form usb. + // NOTE2: This should be called after any getc()/getchar() call. (aka, after the Wait=y keyworkd is used) + // AKA: Make this run immediatly before the kernel is called + uint32_t capaddr, opaddr; + uint8_t eecp; + uint32_t usbcmd, usbsts, usbintr; + uint32_t usblegsup, usblegctlsts; + + int isOSowned; + int isBIOSowned; + + verbose("Setting Legacy USB Off on controller [%04x:%04x] at %02x:%2x.%x\n", + pci_dev->vendor_id, pci_dev->device_id, + pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func); + + + // capaddr = Capability Registers = dev.addr + offset stored in dev.addr + 0x10 (USBBASE) + capaddr = pci_config_read32(pci_dev->dev.addr, 0x10); + + // opaddr = Operational Registers = capaddr + offset (8bit CAPLENGTH in Capability Registers + offset 0) + opaddr = capaddr + *((unsigned char*)(capaddr)); + + // eecp = EHCI Extended Capabilities offset = capaddr HCCPARAMS bits 15:8 + eecp=*((unsigned char*)(capaddr + 9)); + + DBG("capaddr=%x opaddr=%x eecp=%x\n", capaddr, opaddr, eecp); + + usbcmd = *((unsigned int*)(opaddr)); // Command Register + usbsts = *((unsigned int*)(opaddr + 4)); // Status Register + usbintr = *((unsigned int*)(opaddr + 8)); // Interrupt Enable Register + + DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr); + + // read PCI Config 32bit USBLEGSUP (eecp+0) + usblegsup = pci_config_read32(pci_dev->dev.addr, eecp); + + // informational only + isBIOSowned = !!((usblegsup) & (1 << (16))); + isOSowned = !!((usblegsup) & (1 << (24))); + + // read PCI Config 32bit USBLEGCTLSTS (eecp+4) + usblegctlsts = pci_config_read32(pci_dev->dev.addr, eecp + 4); + + DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); + + // Reset registers to Legacy OFF + DBG("Clearing USBLEGCTLSTS\n"); + pci_config_write32(pci_dev->dev.addr, eecp + 4, 0); //usblegctlsts + + // if delay value is in milliseconds it doesn't appear to work. + // setting value to anything up to 65535 does not add the expected delay here. + delay(100); + + usbcmd = *((unsigned int*)(opaddr)); + usbsts = *((unsigned int*)(opaddr + 4)); + usbintr = *((unsigned int*)(opaddr + 8)); + + DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr); + + DBG("Clearing Registers\n"); + + // clear registers to default + usbcmd = (usbcmd & 0xffffff00); + *((unsigned int*)(opaddr)) = usbcmd; + *((unsigned int*)(opaddr + 8)) = 0; //usbintr - clear interrupt registers + *((unsigned int*)(opaddr + 4)) = 0x1000; //usbsts - clear status registers + pci_config_write32(pci_dev->dev.addr, eecp, 1); //usblegsup + + // get the results + usbcmd = *((unsigned int*)(opaddr)); + usbsts = *((unsigned int*)(opaddr + 4)); + usbintr = *((unsigned int*)(opaddr + 8)); + + DBG("usbcmd=%08x usbsts=%08x usbintr=%08x\n", usbcmd, usbsts, usbintr); + + // read 32bit USBLEGSUP (eecp+0) + usblegsup = pci_config_read32(pci_dev->dev.addr, eecp); + + // informational only + isBIOSowned = !!((usblegsup) & (1 << (16))); + isOSowned = !!((usblegsup) & (1 << (24))); + + // read 32bit USBLEGCTLSTS (eecp+4) + usblegctlsts = pci_config_read32(pci_dev->dev.addr, eecp + 4); + + DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); + + verbose("Legacy USB Off Done\n"); + return 1; +} + +int ehci_acquire (pci_dt_t *pci_dev) +{ + int j, k; + uint32_t base; + uint8_t eecp; + uint8_t legacy[8]; + bool isOwnershipConflict; + bool alwaysHardBIOSReset; + + alwaysHardBIOSReset = false; + if (!getBoolForKey(kEHCIhard, &alwaysHardBIOSReset, &bootInfo->chameleonConfig)) { + alwaysHardBIOSReset = true; + } + + pci_config_write16(pci_dev->dev.addr, 0x04, 0x0002); + base = pci_config_read32(pci_dev->dev.addr, 0x10); + + verbose("EHCI controller [%04x:%04x] at %02x:%2x.%x DMA @%x\n", + pci_dev->vendor_id, pci_dev->device_id, + pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func, + base); + + if (*((unsigned char*)base) < 0xc) + { + DBG("Config space too small: no legacy implementation\n"); + return 1; + } + eecp = *((unsigned char*)(base + 9)); + if (!eecp) { + DBG("No extended capabilities: no legacy implementation\n"); + return 1; + } + + DBG("eecp=%x\n",eecp); + + // bad way to do it + // pci_conf_write(pci_dev->dev.addr, eecp, 4, 0x01000001); + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + DBG("%02x ", legacy[j]); + } + DBG("\n"); + + //Real Job: based on orByte's AppleUSBEHCI.cpp + //We try soft reset first - some systems hang on reboot with hard reset + // Definitely needed during reboot on 10.4.6 + + isOwnershipConflict = (((legacy[3] & 1) != 0) && ((legacy[2] & 1) != 0)); + if (!alwaysHardBIOSReset && isOwnershipConflict) { + DBG("EHCI - Ownership conflict - attempting soft reset ...\n"); + DBG("EHCI - toggle OS Ownership to 0\n"); + pci_config_write8(pci_dev->dev.addr, eecp + 3, 0); + for (k = 0; k < 25; k++) { + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + if (legacy[3] == 0) { + break; + } + delay(10); + } + } + + DBG("Found USBLEGSUP_ID - value %x:%x - writing OSOwned\n", legacy[3],legacy[2]); + pci_config_write8(pci_dev->dev.addr, eecp + 3, 1); + + // wait for kEHCI_USBLEGSUP_BIOSOwned bit to clear + for (k = 0; k < 25; k++) { + for (j = 0;j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + DBG ("%x:%x,",legacy[3],legacy[2]); + if (legacy[2] == 0) { + break; + } + delay(10); + } + + for (j = 0;j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + isOwnershipConflict = ((legacy[2]) != 0); + if (isOwnershipConflict) { + // Soft reset has failed. Assume SMI being ignored + // Hard reset + // Force Clear BIOS BIT + DBG("EHCI - Ownership conflict - attempting hard reset ...\n"); + DBG ("%x:%x\n",legacy[3],legacy[2]); + DBG("EHCI - Force BIOS Ownership to 0\n"); + + pci_config_write8(pci_dev->dev.addr, eecp + 2, 0); + for (k = 0; k < 25; k++) { + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + DBG ("%x:%x,",legacy[3],legacy[2]); + + if ((legacy[2]) == 0) { + break; + } + delay(10); + } + // Disable further SMI events + for (j = 4; j < 8; j++) { + pci_config_write8(pci_dev->dev.addr, eecp + j, 0); + } + } + + for (j = 0; j < 8; j++) { + legacy[j] = pci_config_read8(pci_dev->dev.addr, eecp + j); + } + + DBG ("%x:%x\n",legacy[3],legacy[2]); + + // Final Ownership Resolution Check... + if (legacy[2] & 1) { + DBG("EHCI controller unable to take control from BIOS\n"); + return 0; + } + + DBG("EHCI Acquire OS Ownership done\n"); + return 1; +} + +int uhci_reset (pci_dt_t *pci_dev) +{ + uint32_t base, port_base; + + base = pci_config_read32(pci_dev->dev.addr, 0x20); + port_base = (base >> 5) & 0x07ff; + + verbose("UHCI controller [%04x:%04x] at %02x:%2x.%x base %x(%x)\n", + pci_dev->vendor_id, pci_dev->device_id, + pci_dev->dev.bits.bus, pci_dev->dev.bits.dev, pci_dev->dev.bits.func, + port_base, base); + + pci_config_write16(pci_dev->dev.addr, 0xc0, 0x8f00); + + outw (port_base, 0x0002); + delay(10); + outw (port_base+4,0); + delay(10); + outw (port_base,0); + return 1; +} diff --git a/i386/libsaio/vbe.c b/i386/libsaio/vbe.c new file mode 100644 index 0000000..a1dc242 --- /dev/null +++ b/i386/libsaio/vbe.c @@ -0,0 +1,310 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Copyright 1993 NeXT, Inc. + * All rights reserved. + */ + +#include "libsaio.h" +#include "vbe.h" + +/* + * Various inline routines for video I/O + */ +static inline void +outi (int port, int index, int val) +{ + outw (port, (val << 8) | index); +} + +static inline void +outib (int port, int index, int val) +{ + outb (port, index); + outb (port + 1, val); +} + +static inline int +ini (int port, int index) +{ + outb (port, index); + return inb (port + 1); +} + +static inline void +rmwi (int port, int index, int clear, int set) +{ + outb (port, index); + outb (port + 1, (inb (port + 1) & ~clear) | set); +} + +/* + * Globals + */ +static biosBuf_t bb; + +int getVBEInfo( void * infoBlock ) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetControllerInfo; + bb.es = SEG( infoBlock ); + bb.edi.rr = OFF( infoBlock ); + bios( &bb ); + return(bb.eax.r.h); +} + +int getVBEModeInfo( int mode, void * minfo_p ) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetModeInfo; + bb.ecx.rr = mode; + bb.es = SEG(minfo_p); + bb.edi.rr = OFF(minfo_p); + bios(&bb); + return(bb.eax.r.h); +} + +int getVBEDACFormat(unsigned char *format) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteFormat; + bb.ebx.r.l = subfuncGet; + bios(&bb); + *format = bb.ebx.r.h; + return(bb.eax.r.h); +} + +int setVBEDACFormat(unsigned char format) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteFormat; + bb.ebx.r.l = subfuncSet; + bb.ebx.r.h = format; + bios(&bb); + return(bb.eax.r.h); +} + +/* + * Default GTF parameter values. + */ +#define kCellGranularity 8.0 // character cell granularity +#define kMinVSyncPlusBP 550.0 // min VSync + BP interval (us) +#define kMinFrontPorch 1.0 // minimum front porch in lines(V)/cells(H) +#define kVSyncLines 3.0 // width of VSync in lines +#define kHSyncWidth 8.0 // HSync as a percent of total line width +#define kC 30.0 // C = (C'-J) * (K/256) + J +#define kM 300.0 // M = K/256 * M' + +int Round(double f) +{ + return (int)(f + 0.5); +} + +/* + * from http://www.azillionmonkeys.com/qed/sqroot.html + */ + +double Sqrt( double y ) +{ + double x, z, tempf; + unsigned long *tfptr = ((unsigned long *)&tempf) + 1; + + tempf = y; + *tfptr = (0xbfcdd90a - *tfptr)>>1; /* estimate of 1/sqrt(y) */ + x = tempf; + z = y*0.5; /* hoist out the “/2” */ + x = (1.5*x) - (x*x)*(x*z); /* iteration formula */ + x = (1.5*x) - (x*x)*(x*z); + x = (1.5*x) - (x*x)*(x*z); + x = (1.5*x) - (x*x)*(x*z); + x = (1.5*x) - (x*x)*(x*z); + return x*y; +} + +int generateCRTCTiming( unsigned short width, + unsigned short height, + unsigned long paramValue, + int paramType, + VBECRTCInfoBlock * timing ) +{ + double h_period_est, h_freq, h_period, h_total_pixels, h_sync_pixels; + double h_active_pixels, h_ideal_duty_cycle, h_blank_pixels, pixel_freq = 0; + double v_sync_plus_bp = 0, v_total_lines = 0, v_field_rate_est, v_frame_rate = 0; + const double h_pixels = (double) width; + const double v_lines = (double) height; + + enum { + left_margin_pixels = 0, + right_margin_pixels = 0, + top_margin_lines = 0, + bot_margin_lines = 0, + interlace = 0 + }; + + // Total number of active pixels in image and both margins + h_active_pixels = h_pixels + left_margin_pixels + right_margin_pixels; + + if (paramType == kCRTCParamPixelClock) + { + // Pixel clock provided in MHz + pixel_freq = (double) paramValue / 1000000; + + // Ideal horizontal period from the blanking duty cycle equation + h_period = ((kC - 100) + (Sqrt(((100 - kC) * (100 - kC)) + (0.4 * kM * + (h_active_pixels + right_margin_pixels + left_margin_pixels) / + pixel_freq)))) / 2.0 / kM * 1000; + } + else /* kCRTCParamRefreshRate */ + { + double v_field_rate_in = (double) paramValue; + + // Estimate the horizontal period + h_period_est = ((1 / v_field_rate_in) - kMinVSyncPlusBP / 1000000) / + (v_lines + (2 * top_margin_lines) + kMinFrontPorch + interlace) * + 1000000; + + // Number of lines in Vsync + back porch + v_sync_plus_bp = Round(kMinVSyncPlusBP / h_period_est); + + // Total number of lines in Vetical field period + v_total_lines = v_lines + top_margin_lines + bot_margin_lines + + v_sync_plus_bp + interlace + kMinFrontPorch; + + // Estimate the vertical field frequency + v_field_rate_est = 1 / h_period_est / v_total_lines * 1000000; + + // Find the actual horizontal period + h_period = h_period_est / (v_field_rate_in / v_field_rate_est); + + // Find the vertical frame rate (no interlace) + v_frame_rate = 1 / h_period / v_total_lines * 1000000; + } + + // Ideal blanking duty cycle from the blanking duty cycle equation + h_ideal_duty_cycle = kC - (kM * h_period / 1000); + + // Number of pixels in the blanking time to the nearest double character cell + h_blank_pixels = Round(h_active_pixels * h_ideal_duty_cycle / + (100 - h_ideal_duty_cycle) / (2 * kCellGranularity)) * + (2 * kCellGranularity); + + // Total number of horizontal pixels + h_total_pixels = h_active_pixels + h_blank_pixels; + + if (paramType == kCRTCParamPixelClock) + { + // Horizontal frequency + h_freq = pixel_freq / h_total_pixels * 1000; + + // Number of lines in V sync + back porch + v_sync_plus_bp = Round(kMinVSyncPlusBP * h_freq / 1000); + + // Total number of lines in vertical field period + v_total_lines = v_lines + top_margin_lines + bot_margin_lines + + interlace + v_sync_plus_bp + kMinFrontPorch; + + // Vertical frame frequency + v_frame_rate = Round(h_freq / v_total_lines * 1000); + } + else + { + // Find pixel clock frequency + pixel_freq = Round(h_total_pixels / h_period); + } + + h_sync_pixels = Round(h_total_pixels * kHSyncWidth / 100 / kCellGranularity) * + kCellGranularity; + + timing->HTotal = h_total_pixels; + timing->HSyncStart = h_active_pixels + (h_blank_pixels / 2) - h_sync_pixels; + timing->HSyncEnd = timing->HSyncStart + h_sync_pixels; + timing->VTotal = v_total_lines; + timing->VSyncStart = v_total_lines - v_sync_plus_bp; + timing->VSyncEnd = timing->VSyncStart + kVSyncLines; + timing->Flags = kCRTCNegativeHorizontalSync; + timing->PixelClock = pixel_freq * 1000000; + timing->RefreshRate = v_frame_rate * 100; + + return 0; +} + +int setVBEMode(unsigned short mode, const VBECRTCInfoBlock * timing) +{ + bb.intno = 0x10; + bb.eax.rr = funcSetMode; + bb.ebx.rr = mode; + if (timing) { + bb.es = SEG(timing); + bb.edi.rr = OFF(timing); + } + bios(&bb); + return(bb.eax.r.h); +} + +int setVBEPalette(void *palette) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteData; + bb.ebx.r.l = subfuncSet; + bb.ecx.rr = 256; + bb.edx.rr = 0; + bb.es = SEG(palette); + bb.edi.rr = OFF(palette); + bios(&bb); + return(bb.eax.r.h); +} + +int getVBEPalette(void *palette) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPaletteData; + bb.ebx.r.l = subfuncGet; + bb.ecx.rr = 256; + bb.edx.rr = 0; + bb.es = SEG(palette); + bb.edi.rr = OFF(palette); + bios(&bb); + return(bb.eax.r.h); +} + +int getVBECurrentMode(unsigned short *mode) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetCurrentMode; + bios(&bb); + *mode = bb.ebx.rr; + return(bb.eax.r.h); +} + +int getVBEPixelClock(unsigned short mode, unsigned long * pixelClock) +{ + bb.intno = 0x10; + bb.eax.rr = funcGetSetPixelClock; + bb.ebx.r.l = 0; + bb.ecx.rx = *pixelClock; + bb.edx.rr = mode; + bios(&bb); + *pixelClock = bb.ecx.rx; + return(bb.eax.r.h); +} diff --git a/i386/libsaio/vbe.h b/i386/libsaio/vbe.h new file mode 100644 index 0000000..0f37ffb --- /dev/null +++ b/i386/libsaio/vbe.h @@ -0,0 +1,286 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +// Copyright 1997 by Apple Computer, Inc., all rights reserved. +/* Copyright 1996-1997 NeXT Software, Inc. + * + * vesa.h - mode info obtained via int10 + * + * Revision History + * ---------------- + * 30 Jul 1996 Doug Mitchell at NeXT + * Created. + */ + +#ifndef __LIBSAIO_VBE_H +#define __LIBSAIO_VBE_H + +#define MIN_VESA_VERSION 0x200 + +#define SEG(address) \ + ((unsigned short)(((unsigned long)address & 0xffff0000) >> 4)) + +#define OFF(address) \ + ((unsigned short)((unsigned long)address & 0x0000ffff)) + +#define VBEMakeUInt32(x) \ + (((unsigned long)x##_high << 24) | \ + ((unsigned long)x##_2 << 16) | \ + ((unsigned long)x##_1 << 8) | \ + (unsigned long)x##_low) + +#define VBEDecodeFP(t, fp) \ + ((t)(((fp ## _low) | ((fp ## _1 ) << 8)) + \ + (((fp ## _2) << 4) | ((fp ## _high ) << 12)))) + +/* + * Functions + */ +enum { + funcGetControllerInfo = 0x4F00, + funcGetModeInfo = 0x4F01, + funcSetMode = 0x4F02, + funcGetCurrentMode = 0x4F03, + funcSaveRestoreState = 0x4F04, + funcWindowControl = 0x4F05, + funcGetSetScanLineLength = 0x4F06, + funcGetSetDisplayStart = 0x4F07, + funcGetSetPaletteFormat = 0x4F08, + funcGetSetPaletteData = 0x4F09, + funcGetProtModeInterdace = 0x4F0A, + funcGetSetPixelClock = 0x4F0B +}; + +enum { + subfuncSet = 0x00, + subfuncGet = 0x01, + subfuncSetSecondary = 0x02, + subfuncGetSecondary = 0x03 +}; + +/* + * errors. + */ +enum { + errSuccess = 0, + errFuncFailed = 1, + errFuncNotSupported = 2, + errFuncInvalid = 3 +}; + +/* + * Per-controller info, returned in function 4f00. + */ +typedef struct { + unsigned char VESASignature[4]; + unsigned short VESAVersion; + /* + * Avoid packing problem... + */ + unsigned char OEMStringPtr_low; + unsigned char OEMStringPtr_1; + unsigned char OEMStringPtr_2; + unsigned char OEMStringPtr_high; + unsigned char Capabilities_low; + unsigned char Capabilities_1; + unsigned char Capabilities_2; + unsigned char Capabilities_high; + unsigned char VideoModePtr_low; + unsigned char VideoModePtr_1; + unsigned char VideoModePtr_2; + unsigned char VideoModePtr_high; + unsigned short TotalMemory; + unsigned char Reserved[236]; + unsigned char OEMData[256]; +} VBEInfoBlock; + +/* + * Capabilites + */ +enum { + capDACWidthIsSwitchableBit = (1 << 0), /* 1 = yes; 0 = no */ + capControllerIsNotVGACompatableBit = (1 << 1), /* 1 = no; 0 = yes */ + capOldRAMDAC = (1 << 2) /* 1 = yes; 0 = no */ +}; + +/* + * Per-mode info, returned in function 4f02. + */ +typedef struct { + unsigned short ModeAttributes; + unsigned char WinAAttributes; + unsigned char WinBAttributes; + unsigned short WinGranularity; + unsigned short WinSize; + unsigned short WinASegment; + unsigned short WinABegment; + void * WinFuncPtr; + unsigned short BytesPerScanline; + unsigned short XResolution; + unsigned short YResolution; + unsigned char XCharSize; + unsigned char YCharSize; + unsigned char NumberOfPlanes; + unsigned char BitsPerPixel; + unsigned char NumberOfBanks; + unsigned char MemoryModel; + unsigned char BankSize; + unsigned char NumberOfImagePages; + unsigned char Reserved; + unsigned char RedMaskSize; + unsigned char RedFieldPosition; + unsigned char GreenMaskSize; + unsigned char GreenFieldPosition; + unsigned char BlueMaskSize; + unsigned char BlueFieldPosition; + unsigned char RsvdMaskSize; + unsigned char RsvdFieldPosition; + unsigned char DirectColorModeInfo; + unsigned char PhysBasePtr_low; + unsigned char PhysBasePtr_1; + unsigned char PhysBasePtr_2; + unsigned char PhysBasePtr_high; + void * OffScreenMemOffset; + unsigned short OffScreenMemSize; + unsigned char Reserved1[206]; +} VBEModeInfoBlock; + +/* + * ModeAttributes bits + */ +enum { + maModeIsSupportedBit = (1 << 0), /* mode is supported */ + maExtendedInfoAvailableBit = (1 << 1), /* extended info available */ + maOutputFuncSupportedBit = (1 << 2), /* output functions supported */ + maColorModeBit = (1 << 3), /* 1 = color; 0 = mono */ + maGraphicsModeBit = (1 << 4), /* 1 = graphics; 0 = text */ + maModeIsNotVGACompatableBit = (1 << 5), /* 1 = not compat; 0 = compat */ + maVGAMemoryModeNotAvailBit = (1 << 6), /* 1 = not avail; 0 = avail */ + maLinearFrameBufferAvailBit = (1 << 7) /* 1 = avail; 0 = not avail */ +}; + +/* + * Modes + */ +enum { + mode640x400x256 = 0x100, + mode640x480x256 = 0x101, + mode800x600x16 = 0x102, + mode800x600x256 = 0x103, + mode1024x768x16 = 0x104, + mode1024x768x256 = 0x105, + mode1280x1024x16 = 0x106, + mode1280x1024x256 = 0x107, + mode80Cx60R = 0x108, + mode132Cx25R = 0x109, + mode132Cx43R = 0x10A, + mode132Cx50R = 0x10B, + mode132Cx60R = 0x10C, + mode320x200x555 = 0x10D, + mode320x200x565 = 0x10E, + mode320x200x888 = 0x10F, + mode640x480x555 = 0x110, + mode640x480x565 = 0x111, + mode640x480x888 = 0x112, + mode800x600x555 = 0x113, + mode800x600x565 = 0x114, + mode800x600x888 = 0x115, + mode1024x768x555 = 0x116, + mode1024x768x565 = 0x117, + mode1024x768x888 = 0x118, + mode1280x1024x555 = 0x119, + mode1280x1024x565 = 0x11A, + mode1280x1024x888 = 0x11B, + modeSpecial = 0x81FF, + modeEndOfList = 0xFFFF +}; + +/* + * Get/Set VBE Mode parameters + */ +enum { + kCustomRefreshRateBit = (1 << 11), + kLinearFrameBufferBit = (1 << 14), + kPreserveMemoryBit = (1 << 15) +}; + +/* + * CRTC information block passed to function 4F02 + * to override default refresh rate. + */ +#pragma pack(1) + +typedef struct { + unsigned short HTotal; + unsigned short HSyncStart; + unsigned short HSyncEnd; + unsigned short VTotal; + unsigned short VSyncStart; + unsigned short VSyncEnd; + unsigned char Flags; + unsigned long PixelClock; /* in Hz */ + unsigned short RefreshRate; /* units of 0.01 Hz */ + unsigned char Reserved[40]; +} VBECRTCInfoBlock; + +#pragma pack() + +/* + * Defined flags for 'Flags' field in VBECRTCInfoBlock. + */ +enum { + kCRTCDoubleScannedMode = (1 << 0), + kCRTCInterlacedMode = (1 << 1), + kCRTCNegativeHorizontalSync = (1 << 2), + kCRTCNegativeVerticalSync = (1 << 3) +}; + +/* + * The type of paramter passed to generateCRTCTimings(). + */ +enum { + kCRTCParamRefreshRate, + kCRTCParamPixelClock +}; + +/* + * Palette + */ +typedef unsigned long VBEPalette[256]; + +extern int getVBEInfo(void *vinfo_p); +extern int getVBEModeInfo(int mode, void *minfo_p); +extern int getVBEDACFormat(unsigned char *format); +extern int setVBEDACFormat(unsigned char format); +extern int setVBEPalette(void *palette); +extern int getVBEPalette(void *palette); +extern int setVBEMode(unsigned short mode, const VBECRTCInfoBlock *timing); +extern int getVBECurrentMode(unsigned short *mode); +extern int getVBEPixelClock(unsigned short mode, unsigned long *pixelClock); +extern int generateCRTCTiming(unsigned short width, + unsigned short height, + unsigned long paramValue, + int paramType, + VBECRTCInfoBlock * timing); + +#endif /* !__LIBSAIO_VBE_H */ diff --git a/i386/libsaio/xml.c b/i386/libsaio/xml.c new file mode 100644 index 0000000..d1bdc85 --- /dev/null +++ b/i386/libsaio/xml.c @@ -0,0 +1,1243 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights + * Reserved. + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 2.0 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "bootstruct.h" +#include "libsaio.h" +#include "sl.h" +#include "xml.h" + +string_ref *ref_strings = NULL; + +/// TODO: remove below +static char* buffer_start = NULL; +// TODO: redo the next two functions +void SaveRefString(char* string, int id) +{ + //printf("Adding Ref String %d (%s)\n", id, string); + string_ref* tmp = ref_strings; + while(tmp) + { + if(tmp->id == id) + { + tmp->string = malloc(strlen(string)+1); + sprintf(tmp->string, "%s", string); + return; + } + tmp = tmp->next; + } + + string_ref* new_ref = malloc(sizeof(string_ref)); + new_ref->string = malloc(strlen(string)+1); + sprintf(new_ref->string, "%s", string); + new_ref->id = id; + new_ref->next = ref_strings; + ref_strings = new_ref; +} + +char* GetRefString(int id) +{ + string_ref* tmp = ref_strings; + while(tmp) + { + if(tmp->id == id) return tmp->string; + tmp = tmp->next; + } + //verbose("Unable to locate Ref String %d\n", id); + return ""; +} + +struct Module { + struct Module *nextModule; + long willLoad; + TagPtr dict; + char *plistAddr; + long plistLength; + char *driverPath; +}; +typedef struct Module Module, *ModulePtr; + +struct DriverInfo { + char *plistAddr; + long plistLength; + void *moduleAddr; + long moduleLength; +}; +typedef struct DriverInfo DriverInfo, *DriverInfoPtr; + +#define kDriverPackageSignature1 'MKXT' +#define kDriverPackageSignature2 'MOSX' + +struct DriversPackage { + unsigned long signature1; + unsigned long signature2; + unsigned long length; + unsigned long adler32; + unsigned long version; + unsigned long numDrivers; + unsigned long reserved1; + unsigned long reserved2; +}; +typedef struct DriversPackage DriversPackage; + +enum { + kCFBundleType2, + kCFBundleType3 +}; + + +#define DOFREE 1 + +static long ParseTagList(char *buffer, TagPtr *tag, long type, long empty); +static long ParseTagKey(char *buffer, TagPtr *tag); +static long ParseTagString(char *buffer, TagPtr *tag); +static long ParseTagInteger(char *buffer, TagPtr *tag); +static long ParseTagData(char *buffer, TagPtr *tag); +static long ParseTagDate(char *buffer, TagPtr *tag); +static long GetNextTag(char *buffer, char **tag, long *start); +static long FixDataMatchingTag(char *buffer, char *tag); +static TagPtr NewTag(void); +static char *NewSymbol(char *string); +#if DOFREE +static void FreeSymbol(char *string); +#endif + + +//========================================================================== +// XMLGetProperty + +TagPtr +XMLGetProperty( TagPtr dict, const char * key ) +{ + TagPtr tagList, tag; + + if (dict->type != kTagTypeDict) return 0; + + tag = 0; + tagList = dict->tag; + while (tagList) + { + tag = tagList; + tagList = tag->tagNext; + + if ((tag->type != kTagTypeKey) || (tag->string == 0)) continue; + + if (!strcmp(tag->string, key)) return tag->tag; + } + + return 0; +} + +//========================================================================== +// XMLGetProperty + +TagPtr +XMLGetKey( TagPtr dict, int id ) +{ + TagPtr tagList, tag; + + if (dict->type != kTagTypeDict) return 0; + + tag = 0; + int element = 0; + tagList = dict->tag; + while (tagList && element != id) + { + tag = tagList; + tagList = tag->tagNext; + + if ((tag->type != kTagTypeKey) || (tag->string == 0)) continue; + element++; + if(id == element) return tag; + } + return 0; +} + +TagPtr XMLGetValueForKey(TagPtr key) +{ + if (!key || + key->type != kTagTypeKey) return 0; + + return key->tag; +} + + +// XMLGetTag(int index) + +// XMLTagCount( TagPtr dict ) +int XMLTagCount( TagPtr dict ) +{ + int count = 0; + TagPtr tagList, tag; + + if (dict->type != kTagTypeDict && dict->type != kTagTypeArray) return 0; + tag = 0; + tagList = dict->tag; + while (tagList) + { + tag = tagList; + tagList = tag->tagNext; + + if (((tag->type != kTagTypeKey) && ((tag->string == 0) || (tag->string[0] == 0))) + && (dict->type != kTagTypeArray) // If we are an array, any element is valid + ) continue; + + //if(tag->type == kTagTypeKey) printf("Located key %s\n", tag->string); + + count++; + } + + return count; +} + +TagPtr XMLGetElement( TagPtr dict, int id ) +{ + if(dict->type != kTagTypeArray) return 0; + + int element = 0; + TagPtr tmp = dict->tag; + + while(element < id) + { + element++; + tmp = tmp->tagNext; + } + + return tmp; +} +/* Function for basic XML character entities parsing */ + +char* +XMLDecode(const char* src) +{ + typedef const struct XMLEntity { + const char* name; + size_t nameLen; + char value; + } XMLEntity; + + /* This is ugly, but better than specifying the lengths by hand */ + #define _e(str,c) {str,sizeof(str)-1,c} + const XMLEntity ents[] = { + _e("quot;",'"'), _e("apos;",'\''), + _e("lt;", '<'), _e("gt;", '>'), + _e("amp;", '&') + }; + + size_t len; + const char *s; + char *out, *o; + + if ( !src || !(len = strlen(src)) || !(out = malloc(len+1)) ) + return 0; + + o = out; + s = src; + while (s <= src+len) /* Make sure the terminator is also copied */ + { + if ( *s == '&' ) + { + bool entFound = false; + int i; + + s++; + for ( i = 0; i < sizeof(ents)/sizeof(ents[0]); i++) + { + if ( strncmp(s, ents[i].name, ents[i].nameLen) == 0 ) + { + entFound = true; + break; + } + } + if ( entFound ) + { + *o++ = ents[i].value; + s += ents[i].nameLen; + continue; + } + } + + *o++ = *s++; + } + + return out; +} + +//#if UNUSED +//========================================================================== +// XMLParseFile +// Expects to see one dictionary in the XML file, the final pos will be returned +// If the pos is not equal to the strlen, then there are multiple dicts +// Puts the first dictionary it finds in the +// tag pointer and returns the end of the dic, or returns -1 if not found. +// +long +XMLParseFile( char * buffer, TagPtr * dict ) +{ + long length, pos; + TagPtr tag; + pos = 0; + char *configBuffer; + + int strlength = strlen(buffer); + configBuffer = malloc(strlength+1); + bcopy(buffer, configBuffer, strlength); + configBuffer[strlength] = 0; + + buffer_start = configBuffer; + + while (1) + { + length = XMLParseNextTag(configBuffer + pos, &tag); + if (length == -1) break; + + pos += length; + + if (tag == 0) continue; + if (tag->type == kTagTypeDict) break; + + XMLFreeTag(tag); + } + free(configBuffer); + if (length < 0) { + return -1; + } + *dict = tag; + return pos; +} +//#endif /* UNUSED */ + +//========================================================================== +// ParseNextTag +// TODO: cleanup +long +XMLParseNextTag( char * buffer, TagPtr * tag ) +{ + long length, pos; + char * tagName; + + length = GetNextTag(buffer, &tagName, 0); + if (length == -1) return -1; + + pos = length; + if (!strncmp(tagName, kXMLTagPList, 6)) + { + length = 0; + } + /***** dict ****/ + else if (!strcmp(tagName, kXMLTagDict)) + { + length = ParseTagList(buffer + pos, tag, kTagTypeDict, 0); + } + else if (!strncmp(tagName, kXMLTagDict, strlen(kXMLTagDict)) && tagName[strlen(tagName)-1] == '/') + { + length = ParseTagList(buffer + pos, tag, kTagTypeDict, 1); + } + else if (!strncmp(tagName, kXMLTagDict " ", strlen(kXMLTagDict " "))) + { + length = ParseTagList(buffer + pos, tag, kTagTypeDict, 0); + } + /***** key ****/ + else if (!strcmp(tagName, kXMLTagKey)) + { + length = ParseTagKey(buffer + pos, tag); + } + + /***** string ****/ + else if (!strcmp(tagName, kXMLTagString)) + { + length = ParseTagString(buffer + pos, tag); + } + else if (!strncmp(tagName, kXMLTagString " ", strlen(kXMLTagString " "))) + { + // TODO: save tag if if found + if(!strncmp(tagName + strlen(kXMLTagString " "), kXMLStringID, strlen(kXMLStringID))) + { + // ID= + int id = 0; + int cnt = strlen(kXMLTagString " " kXMLStringID "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagString " " kXMLStringID "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseStringID error (0x%x)\n", *val); + getchar(); + return -1; + } + } + length = ParseTagString(buffer + pos, tag); + + SaveRefString(buffer + pos, id); + } + else if(!strncmp(tagName + strlen(kXMLTagString " "), kXMLStringIDRef, strlen(kXMLStringIDRef))) + { + // IDREF= + int id = 0; + int cnt = strlen(kXMLTagString " " kXMLStringIDRef "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagString " " kXMLStringIDRef "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseStringIDREF error (0x%x)\n", *val); + getchar(); + return -1; + } + } + char* str = GetRefString(id); + + TagPtr tmpTag = NewTag(); + tmpTag->type = kTagTypeString; + tmpTag->string = str; + tmpTag->tag = 0; + tmpTag->tagNext = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start + pos : 0; + *tag = tmpTag; + + length = 0; + //printf("Located IDREF, id = %d, string = %s\n", id, str); + } + } + + /***** integer ****/ + else if (!strcmp(tagName, kXMLTagInteger)) + { + length = ParseTagInteger(buffer + pos, tag); + } + else if (!strncmp(tagName, kXMLTagInteger " ", strlen(kXMLTagInteger " "))) + { + if(!strncmp(tagName + strlen(kXMLTagInteger " "), kXMLStringID, strlen(kXMLStringID))) + { + // ID= + int id = 0; + int cnt = strlen(kXMLTagInteger " " kXMLStringID "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagInteger " " kXMLStringID "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseIntegerID error (0x%x)\n", *val); + getchar(); + return -1; + } + } + length = ParseTagInteger(buffer + pos, tag); + + SaveRefString((*tag)->string, id); + } + else if(!strncmp(tagName + strlen(kXMLTagInteger " "), kXMLStringIDRef, strlen(kXMLStringIDRef))) + { + // IDREF= + int id = 0; + int cnt = strlen(kXMLTagInteger " " kXMLStringIDRef "\"") + 1; + while ((tagName[cnt] != '\0') && (tagName[cnt] != '"')) cnt++; + tagName[cnt] = 0; + char* val = tagName + strlen(kXMLTagInteger " " kXMLStringIDRef "\""); + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + id = (id * 10) + (*val++ - '0'); + } + else + { + printf("ParseStringIDREF error (0x%x)\n", *val); + getchar(); + return -1; + } + } + int integer = (int)GetRefString(id); + + TagPtr tmpTag = NewTag(); + tmpTag->type = kTagTypeInteger; + tmpTag->string = (char*) integer; + tmpTag->tag = 0; + tmpTag->tagNext = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start + pos : 0; + + *tag = tmpTag; + + length = 0; + //printf("Located IDREF, id = %d, string = %s\n", id, str); + } + else + { + length = ParseTagInteger(buffer + pos, tag); + } + } + + /***** data ****/ + else if (!strcmp(tagName, kXMLTagData)) + { + length = ParseTagData(buffer + pos, tag); + } + else if (!strncmp(tagName, kXMLTagData " ", strlen(kXMLTagData " "))) + { + length = ParseTagData(buffer + pos, tag); + } + else if (!strcmp(tagName, kXMLTagDate)) + { + length = ParseTagDate(buffer + pos, tag); + } + + /***** date ****/ + else if (!strncmp(tagName, kXMLTagDate " ", strlen(kXMLTagDate " "))) + { + length = ParseTagDate(buffer + pos, tag); + } + + /***** false ****/ + else if (!strcmp(tagName, kXMLTagFalse)) + { + length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse); + } + /***** true ****/ + else if (!strcmp(tagName, kXMLTagTrue)) + { + length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue); + } + + /***** array ****/ + else if (!strcmp(tagName, kXMLTagArray)) + { + length = ParseTagList(buffer + pos, tag, kTagTypeArray, 0); + } + else if (!strncmp(tagName, kXMLTagArray " ", strlen(kXMLTagArray " "))) + { + length = ParseTagList(buffer + pos, tag, kTagTypeArray, 0); + } + else if (!strcmp(tagName, kXMLTagArray "/")) + { + length = ParseTagList(buffer + pos, tag, kTagTypeArray, 1); + } + + /***** unknown ****/ + else + { + *tag = 0; + length = 0; + } + + if (length == -1) return -1; + + return pos + length; +} + +//========================================================================== +// ParseTagList + +static long +ParseTagList( char * buffer, TagPtr * tag, long type, long empty ) +{ + long length, pos; + TagPtr tagList, tmpTag; + + tagList = 0; + pos = 0; + + if (!empty) + { + while (1) + { + length = XMLParseNextTag(buffer + pos, &tmpTag); + if (length == -1) break; + + pos += length; + + if (tmpTag == 0) break; + tmpTag->tagNext = tagList; + tagList = tmpTag; + } + + if (length == -1) + { + XMLFreeTag(tagList); + return -1; + } + } + + tmpTag = NewTag(); + if (tmpTag == 0) + { + XMLFreeTag(tagList); + return -1; + } + + tmpTag->type = type; + tmpTag->string = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start : 0; + tmpTag->tag = tagList; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return pos; +} + +//========================================================================== +// ParseTagKey + +static long +ParseTagKey( char * buffer, TagPtr * tag ) +{ + long length, length2; + char *string; + TagPtr tmpTag, subTag; + + length = FixDataMatchingTag(buffer, kXMLTagKey); + if (length == -1) return -1; + + length2 = XMLParseNextTag(buffer + length, &subTag); + if (length2 == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) + { + XMLFreeTag(subTag); + return -1; + } + + string = NewSymbol(buffer); + if (string == 0) + { + XMLFreeTag(subTag); + XMLFreeTag(tmpTag); + return -1; + } + + tmpTag->type = kTagTypeKey; + tmpTag->string = string; + tmpTag->tag = subTag; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length + length2; +} + +//========================================================================== +// ParseTagString + +static long +ParseTagString( char * buffer, TagPtr * tag ) +{ + long length; + char * string; + + length = FixDataMatchingTag(buffer, kXMLTagString); + if (length == -1) return -1; + + TagPtr tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + string = NewSymbol(buffer); + if (string == 0) + { + XMLFreeTag(tmpTag); + return -1; + } + + tmpTag->type = kTagTypeString; + tmpTag->string = string; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + return length; +} + +//========================================================================== +// ParseTagInteger + +static long +ParseTagInteger( char * buffer, TagPtr * tag ) +{ + long length, integer; + bool negative = false; + TagPtr tmpTag; + char* val = buffer; + int size; + + if(buffer[0] == '<') + { + printf("Warning integer is non existant\n"); + getchar(); + tmpTag = NewTag(); + tmpTag->type = kTagTypeInteger; + tmpTag->string = 0; + tmpTag->tag = 0; + tmpTag->offset = 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return 0; + } + + size = length = FixDataMatchingTag(buffer, kXMLTagInteger); + if (length == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + integer = 0; + + if(size > 1 && (val[1] == 'x' || val[1] == 'X')) // Hex value + { + val += 2; + while(*val) + { + if ((*val >= '0' && *val <= '9')) // 0 - 9 + { + integer = (integer * 16) + (*val++ - '0'); + } + else if ((*val >= 'a' && *val <= 'f')) // a - f + { + integer = (integer * 16) + (*val++ - 'a' + 10); + } + else if ((*val >= 'A' && *val <= 'F')) // A - F + { + integer = (integer * 16) + (*val++ - 'a' + 10); + } + else + { + printf("ParseTagInteger hex error (0x%x) in buffer %s\n", *val, buffer); + getchar(); + return -1; + } + } + } + else if ( size ) // Decimal value + { + if (*val == '-') + { + negative = true; + val++; + size--; + } + + for (integer = 0; size > 0; size--) + { + if(*val) // UGLY HACK, fix me. + { + if (*val < '0' || *val > '9') + { + printf("ParseTagInteger decimal error (0x%x) in buffer %s\n", *val, buffer); + getchar(); + return -1; + } + + integer = (integer * 10) + (*val++ - '0'); + } + } + + if (negative) + integer = -integer; + } + + tmpTag->type = kTagTypeInteger; + tmpTag->string = (char *)integer; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length; +} + +//========================================================================== +// ParseTagData + +static long +ParseTagData( char * buffer, TagPtr * tag ) +{ + int actuallen = 0; + long length; + TagPtr tmpTag; + + length = FixDataMatchingTag(buffer, kXMLTagData); + if (length == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + //printf("ParseTagData unimplimented\n"); + //printf("Data: %s\n", buffer); + // getchar(); + + char* string = BASE64Decode(buffer, strlen(buffer), &actuallen); + tmpTag->type = kTagTypeData; + tmpTag->string = string; + tmpTag->tag = 0; + tmpTag->offset = actuallen; // buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length; +} + +//========================================================================== +// ParseTagDate + +static long +ParseTagDate( char * buffer, TagPtr * tag ) +{ + long length; + TagPtr tmpTag; + + length = FixDataMatchingTag(buffer, kXMLTagDate); + if (length == -1) return -1; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + printf("ParseTagDate unimplimented\n"); + getchar(); + + tmpTag->type = kTagTypeDate; + tmpTag->string = 0; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return length; +} + +//========================================================================== +// ParseTagBoolean + +long +ParseTagBoolean( char * buffer, TagPtr * tag, long type ) +{ + TagPtr tmpTag; + + tmpTag = NewTag(); + if (tmpTag == 0) return -1; + + tmpTag->type = type; + tmpTag->string = 0; + tmpTag->tag = 0; + tmpTag->offset = buffer_start ? buffer - buffer_start: 0; + tmpTag->tagNext = 0; + + *tag = tmpTag; + + return 0; +} + +//========================================================================== +// GetNextTag + +static long +GetNextTag( char * buffer, char ** tag, long * start ) +{ + long cnt, cnt2; + + if (tag == 0) return -1; + + // Find the start of the tag. + cnt = 0; + while ((buffer[cnt] != '\0') && (buffer[cnt] != '<')) cnt++; + if (buffer[cnt] == '\0') return -1; + + // Find the end of the tag. + cnt2 = cnt + 1; + while ((buffer[cnt2] != '\0') && (buffer[cnt2] != '>')) cnt2++; + if (buffer[cnt2] == '\0') return -1; + + // Fix the tag data. + *tag = buffer + cnt + 1; + buffer[cnt2] = '\0'; + if (start) *start = cnt; + + return cnt2 + 1; +} + +//========================================================================== +// FixDataMatchingTag +// Modifies 'buffer' to add a '\0' at the end of the tag matching 'tag'. +// Returns the length of the data found, counting the end tag, +// or -1 if the end tag was not found. + +static long +FixDataMatchingTag( char * buffer, char * tag ) +{ + long length, start, stop; + char * endTag; + + start = 0; + while (1) + { + length = GetNextTag(buffer + start, &endTag, &stop); + if (length == -1) return -1; + + if ((*endTag == '/') && !strcmp(endTag + 1, tag)) break; + start += length; + } + + buffer[start + stop] = '\0'; + + return start + length; +} + +//========================================================================== +// NewTag + +#define kTagsPerBlock (0x1000) + +static TagPtr gTagsFree; + +static TagPtr +NewTag( void ) +{ + long cnt; + TagPtr tag; + + if (gTagsFree == 0) + { + tag = (TagPtr)malloc(kTagsPerBlock * sizeof(Tag)); + if (tag == 0) return 0; + + // Initalize the new tags. + for (cnt = 0; cnt < kTagsPerBlock; cnt++) + { + tag[cnt].type = kTagTypeNone; + tag[cnt].string = 0; + tag[cnt].tag = 0; + tag[cnt].tagNext = tag + cnt + 1; + } + tag[kTagsPerBlock - 1].tagNext = 0; + + gTagsFree = tag; + } + + tag = gTagsFree; + gTagsFree = tag->tagNext; + + return tag; +} + +//========================================================================== +// XMLFreeTag + +void +XMLFreeTag( TagPtr tag ) +{ +#if DOFREE + if (tag == 0) return; + + if (!XMLIsInteger(tag) && tag->string) FreeSymbol(tag->string); + + XMLFreeTag(tag->tag); + XMLFreeTag(tag->tagNext); + + // Clear and free the tag. + tag->type = kTagTypeNone; + tag->string = 0; + tag->tag = 0; + tag->offset = 0; + tag->tagNext = gTagsFree; + gTagsFree = tag; +#else + return; +#endif +} + +//========================================================================== +// Symbol object. + +struct Symbol +{ + long refCount; + struct Symbol *next; + char string[]; +}; +typedef struct Symbol Symbol, *SymbolPtr; + +static SymbolPtr FindSymbol(char * string, SymbolPtr * prevSymbol); + +static SymbolPtr gSymbolsHead; + +//========================================================================== +// NewSymbol + +static char * +NewSymbol( char * string ) +{ +static SymbolPtr lastGuy = 0; + SymbolPtr symbol; + + // Look for string in the list of symbols. + symbol = FindSymbol(string, 0); + + // Add the new symbol. + if (symbol == 0) + { + symbol = (SymbolPtr)malloc(sizeof(Symbol) + 1 + strlen(string)); + if (symbol == 0) //return 0; + stop("NULL symbol!"); + + // Set the symbol's data. + symbol->refCount = 0; + strcpy(symbol->string, string); + + // Add the symbol to the list. + symbol->next = gSymbolsHead; + gSymbolsHead = symbol; + } + + // Update the refCount and return the string. + symbol->refCount++; + + if (lastGuy && lastGuy->next != 0) stop("last guy not last!"); + return symbol->string; +} + +//========================================================================== +// FreeSymbol + +#if DOFREE +static void +FreeSymbol( char * string ) +{ + SymbolPtr symbol, prev; + prev = 0; + + // Look for string in the list of symbols. + symbol = FindSymbol(string, &prev); + if (symbol == 0) return; + + // Update the refCount. + symbol->refCount--; + + if (symbol->refCount != 0) return; + + // Remove the symbol from the list. + if (prev != 0) prev->next = symbol->next; + else gSymbolsHead = symbol->next; + + // Free the symbol's memory. + free(symbol); +} +#endif + +//========================================================================== +// FindSymbol + +static SymbolPtr +FindSymbol( char * string, SymbolPtr * prevSymbol ) +{ + SymbolPtr symbol, prev; + + symbol = gSymbolsHead; + prev = 0; + + while (symbol != 0) { + if (!strcmp(symbol->string, string)) break; + + prev = symbol; + symbol = symbol->next; + } + + if ((symbol != 0) && (prevSymbol != 0)) *prevSymbol = prev; + + return symbol; +} + +bool XMLIsType(TagPtr dict, enum xmltype type) +{ + if(!dict) return (type == kTagTypeNone); + return (dict->type == type); +} + +/*** Cast functions ***/ +bool XMLIsArray(TagPtr entry) +{ + return entry && (entry->type == kTagTypeArray); +} + +TagPtr XMLCastArray(TagPtr dict) +{ + if(!dict) return NULL; + if(dict->type == kTagTypeArray) return dict; + else return NULL; +} + +bool XMLIsDict(TagPtr entry) +{ + return entry && (entry->type == kTagTypeDict); +} + +bool XMLIsData(TagPtr entry) +{ + return entry && (entry->type == kTagTypeData); +} + +TagPtr XMLCastDict(TagPtr dict) +{ + if(!dict) return NULL; + if(dict->type == kTagTypeDict) return dict; + else return NULL; +} + +bool XMLIsString(TagPtr entry) +{ + return entry && + ((entry->type == kTagTypeString) || + (entry->type == kTagTypeKey)); +} + +char* XMLCastString(TagPtr dict) +{ + if(!dict) return NULL; + + if((dict->type == kTagTypeString) || + (dict->type == kTagTypeKey)) return dict->string; + + return NULL; +} + +char* XMLCastData(TagPtr dict, int* length) +{ + if(!dict) return NULL; + + if((dict->type == kTagTypeData) || + (dict->type == kTagTypeKey)) + { + *length = dict->offset; + return dict->string; + } + *length = 0; + return NULL; +} + +long XMLCastStringOffset(TagPtr dict) +{ + if(dict && + ((dict->type == kTagTypeString) || + (dict->type == kTagTypeKey))) + { + return dict->offset; + } + else + { + return -1; + } +} + +bool XMLIsBoolean(TagPtr entry) +{ + return entry && + ((entry->type == kTagTypeTrue) || + (entry->type == kTagTypeFalse)); +} + +bool XMLCastBoolean(TagPtr dict) +{ + if(!dict) return false; + if(dict->type == kTagTypeTrue) return true; + return false; +} + +bool XMLIsInteger(TagPtr entry) +{ + return entry && (entry->type == kTagTypeInteger); +} + +int XMLCastInteger(TagPtr dict) +{ + if(!dict) + { + //printf("XMLCastInteger: null dict\n"); + return 0; + } + if(dict->type == kTagTypeInteger) return (int)(dict->string); + return 0; +} + +bool XMLAddTagToDictionary(TagPtr dict, char* key, TagPtr value) +{ + if (!dict || dict->type != kTagTypeDict) return false; + + TagPtr tmpTag; + char* string; + + tmpTag = NewTag(); + if (tmpTag == 0) + { + return false; + } + + string = NewSymbol(key); + if (string == 0) + { + XMLFreeTag(tmpTag); + return false; + } + + tmpTag->type = kTagTypeKey; + tmpTag->string = string; + tmpTag->tag = value; + tmpTag->offset = 0; + tmpTag->tagNext = 0; + + TagPtr tagList = dict->tag; + if(!tagList) + { + // First tag + dict->tag = tmpTag; + return true; + } + while(tagList && tagList->tagNext) tagList = tagList->tagNext; + if(tagList) + { + tagList->tagNext = tmpTag; + return true; + } + return false; +} diff --git a/i386/libsaio/xml.h b/i386/libsaio/xml.h new file mode 100644 index 0000000..3f0bcb6 --- /dev/null +++ b/i386/libsaio/xml.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#ifndef __LIBSAIO_XML_H +#define __LIBSAIO_XML_H + +enum xmltype { + kTagTypeNone = 0, + kTagTypeDict, + kTagTypeKey, + kTagTypeString, + kTagTypeInteger, + kTagTypeData, + kTagTypeDate, + kTagTypeFalse, + kTagTypeTrue, + kTagTypeArray +}; + +struct string_ref +{ + char* string; + int id; + struct string_ref* next; +}; +typedef struct string_ref string_ref; + +extern string_ref* ref_strings; + +#define kXMLTagPList "plist " +#define kXMLTagDict "dict" +#define kXMLTagKey "key" +#define kXMLTagString "string" +#define kXMLTagInteger "integer" +#define kXMLTagData "data" +#define kXMLTagDate "date" +#define kXMLTagFalse "false/" +#define kXMLTagTrue "true/" +#define kXMLTagArray "array" + +#define kXMLStringID "ID=" +#define kXMLStringIDRef "IDREF=" + +#define kPropCFBundleIdentifier ("CFBundleIdentifier") +#define kPropCFBundleExecutable ("CFBundleExecutable") +#define kPropOSBundleRequired ("OSBundleRequired") +#define kPropOSBundleLibraries ("OSBundleLibraries") +#define kPropIOKitPersonalities ("IOKitPersonalities") +#define kPropIONameMatch ("IONameMatch") + +/* +struct Tag { + long type; + char *string; + struct Tag *tag; + struct Tag *tagNext; +}; +typedef struct Tag Tag, *TagPtr; + */ + +extern long gImageFirstBootXAddr; +extern long gImageLastKernelAddr; + +TagPtr XMLGetProperty( TagPtr dict, const char * key ); +TagPtr XMLGetElement( TagPtr dict, int id ); +TagPtr XMLGetKey( TagPtr dict, int id ); +TagPtr XMLGetValueForKey(TagPtr key); + +int XMLTagCount( TagPtr dict ); + +bool XMLIsType(TagPtr dict, enum xmltype type); + +bool XMLCastBoolean( TagPtr dict ); +char* XMLCastString( TagPtr dict ); +long XMLCastStringOffset(TagPtr dict); +int XMLCastInteger ( TagPtr dict ); +TagPtr XMLCastDict ( TagPtr dict ); +TagPtr XMLCastArray( TagPtr dict ); +char* XMLCastData( TagPtr dict, int* length ); + +bool XMLIsBoolean(TagPtr entry); +bool XMLIsString (TagPtr entry); +bool XMLIsInteger(TagPtr entry); +bool XMLIsDict (TagPtr entry); +bool XMLIsArray (TagPtr entry); +bool XMLIsData (TagPtr entry); + +bool XMLAddTagToDictionary(TagPtr dict, char* key, TagPtr value); + +long XMLParseNextTag(char *buffer, TagPtr *tag); +void XMLFreeTag(TagPtr tag); +char* XMLDecode(const char *in); +//========================================================================== +// XMLParseFile +// Expects to see one dictionary in the XML file. +// Puts the first dictionary it finds in the +// tag pointer and returns 0, or returns -1 if not found. +// +long XMLParseFile( char * buffer, TagPtr * dict ); + +//========================================================================== +// ParseTag* +long ParseTagBoolean( char * buffer, TagPtr * tag, long type ); + + +#endif /* __LIBSAIO_XML_H */ diff --git a/i386/modules/.svn/all-wcprops b/i386/modules/.svn/all-wcprops new file mode 100644 index 0000000..0f10fcd --- /dev/null +++ b/i386/modules/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 58 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/modules +END +MakeInc.dir +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/MakeInc.dir +END +Modules.txt +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Modules.txt +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/modules/Cconfig +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2256/branches/Chimera/i386/modules/Makefile +END diff --git a/i386/modules/.svn/entries b/i386/modules/.svn/entries new file mode 100644 index 0000000..3c1b7fd --- /dev/null +++ b/i386/modules/.svn/entries @@ -0,0 +1,188 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules +http://forge.voodooprojects.org/svn/chameleon + + + +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +uClibcxx +dir + +Resolution +dir + +include +dir + +klibc +dir + +MakeInc.dir +file + + + + +2013-08-27T23:55:05.000000Z +24eb08751ba6ba4965bdb9289e28515f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5307 + +Keylayout +dir + +Modules.txt +file + + + + +2013-08-27T23:55:05.000000Z +dedcccfa181b00f556fcc3a3b07d73f2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5385 + +Sata +dir + +Cconfig +file + + + + +2013-08-27T23:55:05.000000Z +f59b4c25e0bf305eb943f905457e24de +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +320 + +AcpiCodec +dir + +HelloWorld +dir + +Makefile +file + + + + +2013-08-27T23:55:05.000000Z +c59bb9a3a174193190224a759a2247e2 +2013-08-08T01:50:15.189979Z +2256 +macman + + + + + + + + + + + + + + + + + + + + + +2047 + diff --git a/i386/modules/.svn/text-base/Cconfig.svn-base b/i386/modules/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..f2b8a4a --- /dev/null +++ b/i386/modules/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,13 @@ +# +# Chameleon Modules +# + +menu "Modules" +source "i386/modules/Resolution/Cconfig" +source "i386/modules/klibc/Cconfig" +source "i386/modules/uClibcxx/Cconfig" +source "i386/modules/HelloWorld/Cconfig" +source "i386/modules/Sata/Cconfig" +source "i386/modules/Keylayout/Cconfig" +source "i386/modules/ACPIcodec/Cconfig" +endmenu diff --git a/i386/modules/.svn/text-base/MakeInc.dir.svn-base b/i386/modules/.svn/text-base/MakeInc.dir.svn-base new file mode 100644 index 0000000..61e2819 --- /dev/null +++ b/i386/modules/.svn/text-base/MakeInc.dir.svn-base @@ -0,0 +1,173 @@ +SRCROOT = $(abspath $(CURDIR)/../../..) +OBJROOT = $(SRCROOT)/obj/i386/modules/$(DIR) +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +ifeq ($(BUILT_IN),yes) +override OBJROOT = $(SRCROOT)/obj/i386/boot2_modules/$(DIR) +override SYMROOT = $(SRCROOT)/obj/i386/ +endif + +include ${SRCROOT}/Make.rules + + +ifeq ($(BUILT_IN),yes) + +CFLAGS := $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h + +else + +CFLAGS := $(CLFAGS) -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h + +endif + + +UTILDIR = ../../util +LIBSADIR = ../../libsa +LIBSAIODIR = ../../libsaio +BOOT2DIR = ../../boot2 + +MODULE_INCLUDES := $(foreach x,$(MODULE_DEPENDENCIES),-I$(SRCROOT)/i386/modules/$(x)/include/) + + +INC = -I$(SRCROOT)/i386/modules/include/ -Iinclude/ -I$(SRCROOT)/i386/libsaio/ -I$(SRCROOT)/i386/libsa/ -I$(SRCROOT)/i386/include/ -I$(SRCROOT)/i386/boot2/ $(MODULE_INCLUDES) +DEFINES := -D__KLIBC__ $(DEFINES) + +MODULE_DEPENDENCIES := $(wildcard $(foreach x,$(MODULE_DEPENDENCIES),$(SYMROOT)/modules/$(x).dylib)) \ + $(wildcard $(foreach x,$(MODULE_DEPENDENCIES),$(OBJROOT)/../$(x).dylib)) + +MODULE_DEPENDENCIES_CMD := $(foreach x,$(MODULE_DEPENDENCIES), -weak_library $(x)) + +INSTALLDIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/standalone + +MODULE_DEFINITION := $(CONFIG_$(shell echo $(MODULE_NAME) | tr '[:lower:]' '[:upper:]')_MODULE) + + +ifeq ($(MODULE_DEFINITION),m) +ifneq ($(BUILT_IN),yes) + +# Make this as a *MODULE* +all: $(CONFIG_HEADERS) $(HEADER_VERSION) dylib all-recursive + +else +# Module not selected to be compiled as a module +all: $(CONFIG_HEADERS) $(HEADER_VERSION) all-recursive + +endif + +else + +ifeq ($(MODULE_DEFINITION),y) +ifeq ($(BUILT_IN),yes) + +# Make this *BUILT IN* +all: $(CONFIG_HEADERS) $(HEADER_VERSION) dylib_LINKER all-recursive + +else +# Module not selected to be built in +all: $(CONFIG_HEADERS) $(HEADER_VERSION) all-recursive + +endif +else + +# Don't compile this module +all: + +endif +endif + + +dylib_LINKER: $(SRCROOT)/sym/i386/boot_modules.c $(SRCROOT)/sym/i386/boot_modules.h dylib + +dylib: ${SYMROOT}/modules/ ${OBJROOT} $(SYMROOT)/modules/$(MODULE_NAME).dylib + +MODULE_OBJS := $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) + +ifeq ($(BUILT_IN),yes) + +$(SYMROOT)/modules/$(MODULE_NAME).dylib: $(MODULE_OBJS) $(MODULE_DEPENDENCIES) $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author Makefile + @echo "\t[LD] $(MODULE_NAME).dylib" + @ld -arch i386 -undefined dynamic_lookup \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + -current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \ + -final_output $(MODULE_NAME) \ + $(filter %.o,$^) \ + -macosx_version_min 10.6 \ + -sectcreate __INFO __author $(OBJROOT)/$(MODULE_NAME).author \ + -sectcreate __INFO __description $(OBJROOT)/$(MODULE_NAME).desc \ + -o $(SYMROOT)/modules/$(MODULE_NAME).dylib + +else + +$(SYMROOT)/modules/$(MODULE_NAME).dylib: $(MODULE_OBJS) $(MODULE_DEPENDENCIES) $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author $(SRCROOT)/obj/i386/boot2/Symbols_LINKER_ONLY.dylib Makefile + @echo "\t[LD] $(MODULE_NAME).dylib" + + @ld -arch i386 \ + -alias _$(MODULE_START) start \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + -current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \ + -final_output $(MODULE_NAME) \ + $(filter %.o,$^) \ + -weak_library $(SRCROOT)/obj/i386/boot2/Symbols_LINKER_ONLY.dylib \ + $(MODULE_DEPENDENCIES_CMD) \ + -sectcreate __INFO __author $(OBJROOT)/$(MODULE_NAME).author \ + -sectcreate __INFO __description $(OBJROOT)/$(MODULE_NAME).desc \ + -macosx_version_min 10.6 \ + -o $@ + +endif + + +clean-local: + @if [ -f "$(SYMROOT)/modules/$(MODULE_NAME).dylib" ];then \ + echo "\t[RM] $(SYMROOT)/modules/$(MODULE_NAME).dylib";\ + fi + @for o in $(MODULE_OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(SYMROOT)/modules/$(MODULE_NAME).dylib + @rm -rf $(OBJROOT) + + +${SYMROOT}/modules/: + @echo "\t[MKDIR] $@" + @$(MKDIRS) $@ + +.PHONY: $(SRCROOT)/sym/i386/boot_modules.h +.PHONY: $(SRCROOT)/sym/i386/boot_modules.c + +$(SRCROOT)/sym/i386/boot_modules.c: + @echo "\tstart_built_in_module(\"$(MODULE_NAME)\", \"$(MODULE_AUTHOR)\", \"$(MODULE_DESCRIPTION)\", 0, 0, &$(MODULE_START));" >> $@ + +$(SRCROOT)/sym/i386/boot_modules.h: + @echo "void $(MODULE_START)(); // $(MODULE_NAME)" >> $@ + +$(OBJROOT)/$(MODULE_NAME).author: Makefile + @echo "$(MODULE_AUTHOR)" > $@ + +$(OBJROOT)/$(MODULE_NAME).desc: Makefile + @echo "$(MODULE_DESCRIPTION)" > $@ + +#dependencies +-include $(OBJROOT)/Makedep diff --git a/i386/modules/.svn/text-base/Makefile.svn-base b/i386/modules/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..37c1e1b --- /dev/null +++ b/i386/modules/.svn/text-base/Makefile.svn-base @@ -0,0 +1,85 @@ +# Makefile for i386 modules +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/modules/ +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +include ${SRCROOT}/Make.rules + +# The order of building modules is important. + +ifdef CONFIG_KLIBC_MODULE +SUBDIRS += klibc +endif + +ifdef CONFIG_UCLIBCXX_MODULE +SUBDIRS += uClibcxx +endif + +ifdef CONFIG_RESOLUTION_MODULE +SUBDIRS += Resolution +endif + +ifdef CONFIG_HELLOWORLD_MODULE +SUBDIRS += HelloWorld +endif + +ifdef CONFIG_KEYLAYOUT_MODULE +SUBDIRS += Keylayout +endif + +ifdef CONFIG_SATA_MODULE +SUBDIRS += Sata +endif + +ifdef CONFIG_ACPICODEC_MODULE +SUBDIRS += AcpiCodec +endif + +CFLAGS= -O3 $(MORECPP) -arch i386 -g -static +DEFINES= +CONFIG = hd +LIBSAIODIR = $(SRCROOT)/i386/libsaio +INC = -I$(LIBSAIODIR) + +ifeq (${CONFIG_MODULES}, y) +all: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h all-recursive + @# Finish up boot_modules.c + @echo "}" >> $(SYMROOT)/boot_modules.c + + +else +all: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h all-recursive + @# Finish up boot_modules.c + @echo "}" >> $(SYMROOT)/boot_modules.c + +endif + +.PHONY: objroot_dirs +.PHONY: $(SYMROOT)/boot_modules.h +.PHONY: $(SYMROOT)/boot_modules.c + +objroot_dirs: + @${MKDIRS} "$(SYMROOT)/modules/" + + +$(SYMROOT)/boot_modules.c: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) +ifeq ($(BUILT_IN),yes) + @echo "// Autogenerated - do not modify" > $@ + @echo "#include <modules.h>" >> $@ + @echo "#include \"boot_modules.h\"" >> $@ + @echo "void start_built_in_modules() {" >> $@ +endif + +$(SYMROOT)/boot_modules.h: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) +ifeq ($(BUILT_IN),yes) + @echo "// Autogenerated - do not modify" > $@ + @echo "void start_built_in_modules(); " > $@ +endif + +clean-local: + @rm -f $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h diff --git a/i386/modules/.svn/text-base/Modules.txt.svn-base b/i386/modules/.svn/text-base/Modules.txt.svn-base new file mode 100644 index 0000000..dba8394 --- /dev/null +++ b/i386/modules/.svn/text-base/Modules.txt.svn-base @@ -0,0 +1,61 @@ +NOTE: This is a work in progress + +Table Of Contents + 1) Introduction + 2) How to use a module + 3) How modules work + 4) How to create a module + +------------- 1 - Introduction ------------- + The modules system incorporated in chameleon allows for a user or developer to extend the core functionality of chameleon without replacing the main boot file. + + +------------- 2 - How to use a module ------------- + In order for a user to install and use a module, they simply have to ensure that the main boot partition contains the /Extra/modules/ folder. Any file ending in the .dylib extension will be loaded up and started by chameleon automatically. + + +------------- 3 - How modules work ------------- + The module system in chameleon works by loading up a dynamic library at runtime, rebasing it to the loaded address, and binding any missing symbols with ones that chameleon already knows about. When the module system first starts up, it reads in the Symbols.dylib module which was embedded into the boot file as a means of initializing known symbols for boot. This allows modules to link with and modify the core boot file. Every time a new module is loaded, the symbols exported by that module are added to the internal list to allow for modules to link with each other. Additionally, modules may export a property that states if they have any other module dependencies. In the event that a module dependency is not already loaded, the module system will suspend loading of the current module and load the dependency. + +The module system initialization routine follows this flow: + 1) Module system determines if Symbols.dylib was embedded. If not, it exits out + 2) The module system begins by loading the Symbol.dylib file as if it were a standard module. + 3) The module system runs the Symbols.dylib's start function. This function has been specially crafted by the Symbols.dylib generator (dyldsymboltool) to point to an internal symbol, load_all_modules, which causes any module in /Extra/modules/ to be loaded. + +The module system runs through the following routine to load a module by name. + 1) The module system looks for the module in it's internal list. If found, it exits early + 2) The module system looks for the module in the /Extra/modules folder. If nonexistent, it exits early. + 3) The module system allocates a mock of memory equal to the size of the <module>.dylib file + 4) The <module>.dylib file is read into the allocated memory + 5) the <module>.dylib is passed to the macho parser. + 6) The macho parser verifies the integrity of the macho file. + 7) The macho parser reads through the dependency list and calls the load_module function (this one) to ensure that all dependencies are loaded + 8) the macho parser scans the symbol table and adds symbols to the internal list. + 9) The macho parser uses the modules rebase info to modify the executable for the new load address + 10) The macho parser uses the modules bind information, as well as the list of known symbols, to bind unknown symbol addresses in the binary. + 11) If all dependencies were satisfied, the macho parser returns the address of the start function. If errors were encounter, 0xFFFFFFFF is returned instead. + 12) If a valid start function was returned, the module system calls the start routine. + 13) The module system records in the internal list that the given module was loaded. + + +------------- 4 - How to create a module ------------- +The simplest way to create a module is to begin with the HelloWorld template. This template shows an example of creating a c++ module, however you may also create a c module instead. + +The standard directory structure for a module is as follows: +<module>/ The main container directory +<module>/Makefile The makefile script. Contains information about how to compile the module, as well as versioning + naming +<module>/include Global include files that will by copied to ./module_includes. These files may be used by other modules +<module>/*.c C Source files. +<module>/*.cpp C++ Source files. +<module>/*.h Private Headers. +Do note that additional subdirectories can be created as needed, however this document does not go over the needed changes needed to ensure that any subdirectories are compiled. + +In order to setup the setting for the module, the Makefile needs to be updated. The makefile contains various properties, the important ones will be listed and described here: +MODULE_NAME = HelloWorld This is the name of the module. +MODULE_VERSION = "1.0.0" This is the version if the module. It is currently unused by chameleon, however it may be used in the future. +MODULE_COMPAT_VERSION = "1.0.0" This is the compatibility version of the module. As above, it is unused at the moment. +MODULE_START = _$(MODULE_NAME)_start This is the symbol name of the start function. The In this case "void HelloWorld_start()" is the function. If this is a c++ file, it shoal deb wrapped in extern "C" to ensure that the compiler generates the proper symbol name. +MODULE_DEPENDENCIES = uClibc++ A list of all module dependencies used. These must be located in the sym/modules/ folder at compile time to ensure proper linking +MODULE_OBJS = HelloWorld.o A list of object files to generate. In this case, either HellowWorld.c or HelloWorld.cpp file satisfy the dependencies. This will be compiled automatically and linked together by the build system. + + diff --git a/i386/modules/AcpiCodec/.svn/all-wcprops b/i386/modules/AcpiCodec/.svn/all-wcprops new file mode 100644 index 0000000..8f5dc97 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/all-wcprops @@ -0,0 +1,53 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/modules/AcpiCodec +END +acpidecode.c +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/acpidecode.c +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/Cconfig +END +acpicode.c +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/acpicode.c +END +acpi_codec.c +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/modules/AcpiCodec/acpi_codec.c +END +ACPICodec.c +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/ACPICodec.c +END +Readme.txt +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/Readme.txt +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/Makefile +END +acpi_tools.c +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/acpi_tools.c +END diff --git a/i386/modules/AcpiCodec/.svn/entries b/i386/modules/AcpiCodec/.svn/entries new file mode 100644 index 0000000..5b2ea43 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/entries @@ -0,0 +1,303 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/AcpiCodec +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +acpidecode.c +file + + + + +2013-08-27T23:55:05.000000Z +d6e6d18c3e88feb676e9146e36e0499c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +26723 + +include +dir + +Cconfig +file + + + + +2013-08-27T23:55:05.000000Z +b7d8365391118a1b2b1669bf1dc3dcf5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +162 + +acpicode.c +file + + + + +2013-08-27T23:55:05.000000Z +c80eaeb4f0fb9f2fb3e2c92861c60453 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +19923 + +acpi_codec.c +file + + + + +2013-08-27T23:55:05.000000Z +9358ad9d6368fd5cb19fa2bd65f0dd1c +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +165104 + +ACPICodec.c +file + + + + +2013-08-27T23:55:05.000000Z +58fc3dcb3c1eb7dcafa47aaeaebf24da +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +301 + +Readme.txt +file + + + + +2013-08-27T23:55:05.000000Z +199207a692b7cd301662e481458a3dc1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4999 + +Makefile +file + + + + +2013-08-27T23:55:05.000000Z +eedeb4607ae87aaff36be4b7ff1e5dae +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +368 + +acpi_tools.c +file + + + + +2013-08-27T23:55:05.000000Z +ac5aaedf4205b167e5d9bd3b6b55c9cf +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +12648 + diff --git a/i386/modules/AcpiCodec/.svn/prop-base/ACPICodec.c.svn-base b/i386/modules/AcpiCodec/.svn/prop-base/ACPICodec.c.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/prop-base/ACPICodec.c.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/.svn/prop-base/Makefile.svn-base b/i386/modules/AcpiCodec/.svn/prop-base/Makefile.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/prop-base/Makefile.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/.svn/prop-base/acpi_codec.c.svn-base b/i386/modules/AcpiCodec/.svn/prop-base/acpi_codec.c.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/prop-base/acpi_codec.c.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/.svn/prop-base/acpi_tools.c.svn-base b/i386/modules/AcpiCodec/.svn/prop-base/acpi_tools.c.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/prop-base/acpi_tools.c.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/.svn/prop-base/acpidecode.c.svn-base b/i386/modules/AcpiCodec/.svn/prop-base/acpidecode.c.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/prop-base/acpidecode.c.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/.svn/text-base/ACPICodec.c.svn-base b/i386/modules/AcpiCodec/.svn/text-base/ACPICodec.c.svn-base new file mode 100644 index 0000000..6e2f502 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/ACPICodec.c.svn-base @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2010,2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "modules.h" +#include "bootstruct.h" +#include "acpi_codec.h" + +void ACPICodec_start(void); +void ACPICodec_start(void) +{ + replace_function("_setupAcpi",&AcpiSetup); +} \ No newline at end of file diff --git a/i386/modules/AcpiCodec/.svn/text-base/Cconfig.svn-base b/i386/modules/AcpiCodec/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..239c2b9 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config ACPICODEC_MODULE + tristate "ACPICodec Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/AcpiCodec/.svn/text-base/Makefile.svn-base b/i386/modules/AcpiCodec/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..7470183 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/Makefile.svn-base @@ -0,0 +1,13 @@ +MODULE_NAME = ACPICodec +MODULE_DESCRIPTION = This module provides a remplacement for the internal acpi patcher +MODULE_AUTHOR = "Cparm" +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = ACPICodec + +MODULE_OBJS = ACPICodec.o acpi_tools.o acpi_codec.o acpidecode.o acpicode.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/AcpiCodec/.svn/text-base/Readme.txt.svn-base b/i386/modules/AcpiCodec/.svn/text-base/Readme.txt.svn-base new file mode 100644 index 0000000..9f8ee15 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/Readme.txt.svn-base @@ -0,0 +1,130 @@ +Module: ACPICodec +Description: This module provides a remplacement for the internal acpi patcher +Dependencies: none + +Help: + +AcpiCodec module: (Warning: acpi signature not implemented) +------------------ + IMPORTANT NOTE: 1- with AcpiCodec all aml files must be placed in /Extra/Acpi/, alternate or overridden path is no longer supported + + 2- the name of the aml file(s) is not important anymore but it must contain the extention .aml, for example let suppose that you have 3 aml files: dsdt.aml, ssdt-0.aml and ssdt-1.aml + you can rename your dsdt file into blablabr.aml, and rename your ssdt files into blablablaen.aml and blablablablada.aml, acpicodec will auto-magically detect those files as 2 ssdt and one dsdt + + RestartFix=Yes|No Enable/Disable internal restart fix patch (Enabled by default, only available for intel platform). + + ResetType=0|1 0 : PCI reset (Default) + 1 : keyboard reset + + EnableSpeedStep=Yes|No Enable/Disable GenerateCStates & GeneratePStates (Disabled by default). + + GeneratePStates=Yes|No Enable/Disable Generate P-states SSDT table (Disabled by default). + GenerateCStates=Yes|No Enable/Disable Generate C-states SSDT table (Disabled by default). + EnableC4State=Yes|No Enable C4 state in C-states SSDT table, GenerateCStates=Yes is needed (Disabled by default). + + StripAPICTable=Yes|No Enable/Disable Generate a stripped MADT (APIC) table (Enabled by default). + + IntelFADTSpec=Yes|No Enable/Disable Intel recommendations for the FADT table (Enabled by default). + Warning : When enabled, this setting disable the C2 and C3 C-states, but be aware that these are the Intel's recommendations for the newest CPU, + if you really need those c-states please disable IntelFADTSpec. + + P-States=<dict> P-States fine tuning method, see usage below(GeneratePStates=Yes is needed). + ACPIDropTables=<dict> drop acpi table(s) method (can drop any unwanted tables), see usage below. + C-States=<dict> C-States fine tuning method, see usage below(GenerateCStates=Yes is needed). + + + UpdateACPI=Yes|No Enable/Disable ACPI version update(Disabled by default). + + MaxBusRatio=<n> (was BusRatio) Set the current Bus Ratio to n, + n must be a multiple of 10, + (eg. if you want to set a bus ratio to 8.5, n will be + 8.5*10=85), + if n = 0, MaxBusRatio = Disable, + if set, Acpipatcher will drop every P-states with + a bus ratio higher than n. + + MinBusRatio=<n> Set the Minimum Bus Ratio to n, + n must be a multiple of 10, + (eg. if you want to set the bus ratio to 8.5, n will be + 8.5*10=85), if set Acpipatcher will drop every + P-states with a bus ratio lower than n, + if n = 0, MinBusRatio = Disable. + + P-States usage e.g: (by default all numbers must be expressed in base 16, + except the pss statue key and base key itself) + + <key>P-States</key> + <dict> + <key>0</key> // the pss status (must be expressed in Base 10) + <dict> + <key>Bus Master Latency</key> + <string>10</string> + <key>Control</key> + <string>18719</string> + <key>CoreFreq</key> + <string>3164</string> + <key>Transition Latency</key> + <string>10</string> + </dict> + <key>1</key> // the pss status (must be expressed in Base 10) + . + . + . + <dict/> + <key>2</key> // the pss status (must be expressed in Base 10) + . + . + . + <dict/> + <key>X</key> // the pss status (must be expressed in Base 10) + . + . + . + <dict/> + <key>Base</key> + <string>10</string> // must always be expressed in Base 10 + <key>Mode</key> + <string>Default</string> + </dict> + + + C-States usage e.g: (by default all numbers must be expressed in base 16, + except the base key itself) + + <key>C-states</key> + <dict> + <key>C1</key> + <dict> + <key>Latency</key> + <string>THE LATENCY FOR THIS STATE</string> + <key>Power</key> + <string>THE POWER FOR THIS STATE</string> + </dict> + . + . + <key>C4</key> + <dict> + <key>Latency</key> + <string>THE LATENCY FOR THIS STATE</string> + <key>Power</key> + <string>THE POWER FOR THIS STATE</string> + </dict> + </dict> + + ACPIDropTables usage e.g: + + <key>ACPIDropTables</key> + <dict> + <key>SSDT</key> + <string></string> // drop SSDT table(s) + <key>TAMG</key> + <string>Yes</string> //drop TAMG table + <key>ECDT</key> + <string>ANY_VALUE_EXCEPT_NO</string> //drop ECDT table + <key>XXXX</key> + <string></string> //drop XXXX table (if exist) + <key>YYYY</key> + <string>No</string> //do not drop YYYY table (if exist) + </dict> + +EE2D707564081AB603703E236BBA252A8F712D0B2BA5D7AB3D4DFDB59C97570912EBD6FEE4868CEE130E8473FECE30BD272128A255BE1DFDB9CEB0FAF0504B0102140314030100630004731141000000007D0000008B00000003000B00000000000000208080810000000062696E0199070002004145030800504B050600000000010001003C000000A90000000000 diff --git a/i386/modules/AcpiCodec/.svn/text-base/acpi_codec.c.svn-base b/i386/modules/AcpiCodec/.svn/text-base/acpi_codec.c.svn-base new file mode 100644 index 0000000..8e737a0 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/acpi_codec.c.svn-base @@ -0,0 +1,5179 @@ +/* + * Copyright 2008 mackerintel + */ + +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright (c) 2011,2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "acpi.h" +#include "acpidecode.h" +#include "acpicode.h" +#include "efi_tables.h" +#include "fake_efi.h" +#include "acpi_codec.h" +#include "platform.h" +#include "cpu.h" +#include "xml.h" +#include "sl.h" +#include "convert.h" +#include "modules.h" +#include "pci.h" +#include "pci_root.h" + +U64 rsd_p; +ACPI_TABLES acpi_tables; +U32 uuid32; +U32 Model32; +bool checkOem = false; + +extern EFI_STATUS addConfigurationTable(); + +extern EFI_GUID gEfiAcpiTableGuid; +extern EFI_GUID gEfiAcpi20TableGuid; + +#ifndef DEBUG_ACPI +#define DEBUG_ACPI 0 +#endif + +#if DEBUG_ACPI==2 +#define DBG(x...) {printf(x); sleep(1);} +#elif DEBUG_ACPI==1 +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +#define OLD_SSDT 0 +#define BETA 0 +#define BUILD_ACPI_TSS 0 +#define pstate_power_support 1 + +#if BETA +#ifdef pstate_power_support +#undef pstate_power_support +#endif +#define pstate_power_support 1 +#endif + +#if DEBUG_ACPI +static void print_nameseg(U32 i); +#endif + +static ACPI_TABLE_HEADER * get_new_table_in_list(U32 *new_table_list, U32 Signature, U8 *retIndex ); +static U8 get_number_of_tables_in_list(U32 *new_table_list, U32 Signature ); +static U8 get_0ul_index_in_list(U32 *new_table_list, bool reserved ); +static void sanitize_new_table_list(U32 *new_table_list ); +static void move_table_list_to_kmem(U32 *new_table_list ); +static ACPI_TABLE_RSDP * gen_alloc_rsdp_v2_from_v1(ACPI_TABLE_RSDP *rsdp ); +static ACPI_TABLE_RSDT * gen_alloc_rsdt_from_xsdt(ACPI_TABLE_XSDT *xsdt); +static ACPI_TABLE_XSDT * gen_alloc_xsdt_from_rsdt(ACPI_TABLE_RSDT *rsdt); +#if 0 +static void MakeAcpiSgn(void); +#endif +static void *loadACPITable(U32 *new_table_list, char *dirspec, const char *filename ); +static int generate_cpu_map_from_acpi(ACPI_TABLE_DSDT * DsdtPointer); +static ACPI_GENERIC_ADDRESS FillGASStruct(U32 Address, U8 Length); +static U32 process_xsdt (ACPI_TABLE_RSDP *rsdp_mod , U32 *new_table_list); +static U32 process_rsdt(ACPI_TABLE_RSDP *rsdp_mod , bool gen_xsdt, U32 *new_table_list); +static ACPI_TABLE_FADT * patch_fadt(ACPI_TABLE_FADT *fadt, ACPI_TABLE_DSDT *new_dsdt, bool UpdateFADT); + + +#define IA32_MISC_ENABLES 0x01A0 +#define MSR_TURBO_POWER_CURRENT_LIMIT 0x1AC +#define MSR_PKG_CST_CONFIG_CONTROL 0x00E2 +#define MSR_RAPL_POWER_UNIT 0x606 +#define MSR_PKG_RAPL_POWER_LIMIT 0x610 +static U32 turbo_enabled = 0; +static U32 ProcessMadt(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info, void * buffer, U32 bufferSize, U32 NB_CPU); +static U32 buildMADT(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info); +static U32 BuildSsdt(MADT_INFO * madt_info, ACPI_TABLE_DSDT *dsdt, void * buffer, U32 bufferSize, bool enable_cstates, bool enable_pstates, bool enable_tstates); +static bool is_sandybridge(void); +static bool is_jaketown(void); +static U32 encode_pstate(U32 ratio); +static void collect_cpu_info(CPU_DETAILS * cpu); +#ifndef BETA +//static U32 BuildCoreIPstateInfo(CPU_DETAILS * cpu); +#endif +static U32 BuildCstateInfo(CPU_DETAILS * cpu, U32 pmbase); +static U32 BuildPstateInfo(CPU_DETAILS * cpu); +static U32 ProcessSsdt(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info, bool enable_cstates, bool enable_pstates, bool enable_tstates ); +static void * buildCpuScope (void * current, U32 cpu_namespace, PROCESSOR_NUMBER_TO_NAMESEG * aslCpuNamePath); +static void * buildPDC(void * current); +static void * buildOSC(void * current); +static void * buildPSS(void * current, PKG_PSTATES * pkg_pstates); +static void * buildPSD(void * current, U32 domain, U32 cpusInDomain, U32 pstate_coordination); +static void * buildPPC(void * current); +static void * buildPCT(void * current); +static void * buildCstate(void * current, ACPI_GENERIC_ADDRESS * gas, CSTATE * cstate); +static void * buildReturnPackageCST(void * current, PKG_CSTATES * pkg_cstates); +static void * buildCST(void * current, PKG_CSTATES * mwait_pkg_cstates, PKG_CSTATES * io_pkg_cstates); +#if BUILD_ACPI_CSD +static void * buildCSD(void * current, U32 domain, U32 cpusInDomain, PKG_CSTATES * pkg_cstates); +#endif +#if BUILD_ACPI_TSS +static U32 BuildTstateInfo(CPU_DETAILS * cpu); +static void * buildTPC(void * current); +static void * buildPTC(void * current); +static void * buildTSS(void * current, PKG_TSTATES * pkg_tstates); +static void * buildTSD(void * current, U32 domain, U32 cpusInDomain); +#endif +#if pstate_power_support +static U64 mulU64byU64(U64 a, U64 b, U64 * high); +static U32 compute_pstate_power(CPU_DETAILS * cpu, U32 ratio, U32 TDP); +#endif +#if BUILD_ACPI_TSS || pstate_power_support +static U64 divU64byU64(U64 n, U64 d, U64 * rem); +static U32 compute_tdp(CPU_DETAILS * cpu); +#endif +static bool is_sandybridge(void); +static bool is_jaketown(void); +static U32 get_bclk(void); +static void GetMaxRatio(U32 * max_non_turbo_ratio); +//static U32 computePstateRatio(const U32 max, const U32 min, const U32 turboEnabled, const U32 numStates, const U32 pstate); +//static U32 computeNumPstates(const U32 max, const U32 min, const U32 turboEnabled, const U32 pssLimit); + +#if UNUSED +static ACPI_TABLE_FACS* generate_facs(bool updatefacs ); +#endif + +#define MAX_NON_SSDT_TABLE 15 +#define MAX_SSDT_TABLE 15 // 15 additional SSDT tables +#define MAX_ACPI_TABLE MAX_NON_SSDT_TABLE + MAX_SSDT_TABLE + +// Security space for SSDT , FACP & MADT table generation, +// the size can be increased +// note: the table will not placed in the reserved space if the 'normal' space is not full +#define RESERVED_AERA 3 + +#define ACPI_TABLE_LIST_FULL MAX_ACPI_TABLE + RESERVED_AERA + 1 + +#define ACPI_TABLE_LIST_FULL_NON_RESERVED MAX_ACPI_TABLE + 1 + +#ifndef ULONG_MAX_32 +#define ULONG_MAX_32 4294967295UL +#endif + +#define __RES(s, u) \ +static inline unsigned u \ +resolve_##s(unsigned u defaultentry, char *str, int base) \ +{ \ +unsigned u entry = defaultentry; \ +if (str && (strcmp(str,"Default") != 0)) { \ +entry = strtoul((const char *)str, NULL,base); \ +} \ +return entry; \ +} + +__RES(pss, long) +__RES(cst, int) + +static ACPI_TABLE_HEADER * get_new_table_in_list(U32 *new_table_list, U32 Signature, U8 *retIndex ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + *retIndex = 0; + + for (index = 0; index < (MAX_ACPI_TABLE + RESERVED_AERA); index++) + { + if (*(U32 *) (table_array[index]->Signature) == Signature) + { + *retIndex = index; + return table_array[index] ; + } + } + return (void*)0ul; +} + +static U8 get_number_of_tables_in_list(U32 *new_table_list, U32 Signature ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + U8 InstalledTables = 0; + + for (index = 0; index < (MAX_ACPI_TABLE + RESERVED_AERA); index++) + { + if (*(U32 *) (table_array[index]->Signature) == Signature) + { + InstalledTables++ ; + } + } + return InstalledTables; +} + +static U8 get_0ul_index_in_list(U32 *new_table_list, bool reserved ) +{ + U8 index ; + + U8 maximum = (reserved == true) ? MAX_ACPI_TABLE + RESERVED_AERA : MAX_ACPI_TABLE; + + for (index = 0; index < maximum; index++) + { + if (new_table_list[index] == 0ul) + { + return index ; + } + } + return (reserved == true)? ACPI_TABLE_LIST_FULL : ACPI_TABLE_LIST_FULL_NON_RESERVED; +} + +/* cparm : This time we check it by the acpi signature */ +static void sanitize_new_table_list(U32 *new_table_list ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + + for (index = 0; index < MAX_ACPI_TABLE; index++) + { + U32 current_sig = *(U32 *) (table_array[index]->Signature); + + if ((current_sig == NAMESEG(ACPI_SIG_FACS) /* not supported */ ) + || (current_sig == NAMESEG(ACPI_SIG_XSDT)) + || (current_sig == NAMESEG(ACPI_SIG_RSDT)) || (*(volatile U64 *)table_array[index] == NAMESEG64(ACPI_SIG_RSDP)) ) + { + + void *buf = (void*)new_table_list[index]; + free(buf); + new_table_list[index] = 0ul ; + } + } +} + +/* cparm : move all tables to kernel memory */ +static void move_table_list_to_kmem(U32 *new_table_list ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + + for (index = 0; index < MAX_ACPI_TABLE; index++) + { + if (new_table_list[index] != 0ul) + { + + U32 current_sig = *(U32 *) (table_array[index]->Signature); + if ((current_sig != NAMESEG(ACPI_SIG_FACS) /* not supported */ ) + && (current_sig != NAMESEG(ACPI_SIG_XSDT)) + && (current_sig != NAMESEG(ACPI_SIG_RSDT)) && (*(volatile U64 *)table_array[index] != NAMESEG64(ACPI_SIG_RSDP)) + && (GetChecksum(table_array[index], table_array[index]->Length) == 0)) + { + + void *tableAddr=(void*)AllocateKernelMemory(table_array[index]->Length); + if (!tableAddr) { + printf("Unable to allocate kernel memory for aml file "); + + void *buf = (void*)new_table_list[index]; + free(buf); + new_table_list[index] = 0ul ; + continue; + } + bcopy(table_array[index], tableAddr, table_array[index]->Length); + new_table_list[index] = 0ul ; + new_table_list[index] = (U32)tableAddr ; + + } + else + { + + void *buf = (void*)new_table_list[index]; + free(buf); + new_table_list[index] = 0ul ; + } + } + } +} + +static ACPI_TABLE_RSDP * gen_alloc_rsdp_v2_from_v1(ACPI_TABLE_RSDP *rsdp ) +{ + + ACPI_TABLE_RSDP * rsdp_conv = (ACPI_TABLE_RSDP *)AllocateKernelMemory(sizeof(ACPI_TABLE_RSDP)); + + if (rsdp_conv) { + bzero(rsdp_conv, sizeof(ACPI_TABLE_RSDP)); + memcpy(rsdp_conv, rsdp, ACPI_RSDP_REV0_SIZE); + + /* Add/change fields */ + rsdp_conv->Revision = 2; /* ACPI version 3 */ + rsdp_conv->Length = sizeof(ACPI_TABLE_RSDP); + + /* Correct checksums */ + setRsdpchecksum(rsdp_conv); + setRsdpXchecksum(rsdp_conv); + } + + return (rsdp_conv) ? rsdp_conv : (void*)0ul ; +} + +static ACPI_TABLE_RSDT * gen_alloc_rsdt_from_xsdt(ACPI_TABLE_XSDT *xsdt) +{ + U32 index; + U32 num_tables; + + DBG("Attempting to generate RSDT from XSDT \n"); + + num_tables= get_num_tables64(xsdt); + + ACPI_TABLE_RSDT * rsdt_conv=(ACPI_TABLE_RSDT *)AllocateKernelMemory(sizeof(ACPI_TABLE_HEADER)+(num_tables * 4)); + if (!rsdt_conv) + { + printf("Unable to allocate kernel memory for rsdt conv\n"); + return (void*)0ul; + } + + + bzero(rsdt_conv, sizeof(ACPI_TABLE_HEADER)+(num_tables * 4)); + memcpy(&rsdt_conv->Header, &xsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + rsdt_conv->Header.Signature[0] = 'R'; + rsdt_conv->Header.Signature[1] = 'S'; + rsdt_conv->Header.Signature[2] = 'D'; + rsdt_conv->Header.Signature[3] = 'T'; + rsdt_conv->Header.Length = sizeof(ACPI_TABLE_HEADER)+(num_tables * 4); + + for (index=0;index<num_tables;index++) + { + U64 ptr = xsdt->TableOffsetEntry[index]; + + { + if (ptr > ULONG_MAX) + { +#if DEBUG_ACPI + printf("Warning xsdt->TableOffsetEntry[%d]: Beyond addressable memory in this CPU mode, ignored !!!\n",index); +#endif + continue; + } +#if DEBUG_ACPI + printf("* Processing : "); + print_nameseg(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature); + printf("\n"); +#endif + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(((ACPI_TABLE_HEADER *) (unsigned long)ptr), + ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning : Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + { + if (*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature == NAMESEG(ACPI_SIG_FADT)) + { + ACPI_TABLE_FADT *fadt=(ACPI_TABLE_FADT *)((U32)ptr); + + ACPI_TABLE_FADT *fadt_conv = (void*)0ul; + + if (fadt->Header.Revision > 1) + { + U8 buffer[0x74]; + DBG("Downgrading ACPI V%d FADT to ACPI V1 FADT \n", fadt->Header.Revision); + fadt_conv=(ACPI_TABLE_FADT *)buffer; + memcpy(fadt_conv, fadt, 0x74); + fadt_conv->Header.Length = 0x74; + fadt_conv->Header.Revision = 0x01; + SetChecksum(&fadt_conv->Header); + } + else + { + fadt_conv = fadt; + } + + ACPI_TABLE_FADT *fadt_mod = patch_fadt(fadt_conv, ((ACPI_TABLE_DSDT*)((U32)fadt->XDsdt)), false); + if (fadt_mod == (void*)0ul) + { + printf("Error: Failed to patch FADT Table, trying wiht the original fadt pointer\n"); + fadt_mod = fadt; + } + + rsdt_conv->TableOffsetEntry[index] = ((U32)fadt_mod); +#if DEBUG_ACPI + print_nameseg(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature); + printf(" table converted and added succesfully\n"); +#endif + continue; + } + } + + { + rsdt_conv->TableOffsetEntry[index] = (U32)ptr; +#if DEBUG_ACPI + print_nameseg(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature); + printf(" table converted and added succesfully\n"); +#endif + } + + } + DBG("RSDT_CONV : Original checksum %d\n", rsdt_conv->Header.Checksum); + SetChecksum(&rsdt_conv->Header); + DBG("New checksum %d\n", rsdt_conv->Header.Checksum); + + return rsdt_conv; +} + +static ACPI_TABLE_XSDT * gen_alloc_xsdt_from_rsdt(ACPI_TABLE_RSDT *rsdt) +{ + U32 index; + U32 num_tables; + + DBG("Attempting to generate XSDT from RSDT \n"); + + num_tables= get_num_tables(rsdt); + + ACPI_TABLE_XSDT * xsdt_conv=(ACPI_TABLE_XSDT *)AllocateKernelMemory(sizeof(ACPI_TABLE_HEADER)+(num_tables * 8)); + + if (!xsdt_conv) { + printf("Unable to allocate kernel memory for xsdt conv\n"); + return (void*)0ul; + } + + bzero(xsdt_conv, sizeof(ACPI_TABLE_HEADER)+(num_tables * 8)); + memcpy(&xsdt_conv->Header, &rsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + xsdt_conv->Header.Signature[0] = 'X'; + xsdt_conv->Header.Signature[1] = 'S'; + xsdt_conv->Header.Signature[2] = 'D'; + xsdt_conv->Header.Signature[3] = 'T'; + xsdt_conv->Header.Length = sizeof(ACPI_TABLE_HEADER)+(num_tables * 8); + + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) rsdt->TableOffsetEntry; + + for (index=0;index<num_tables;index++) + { + { +#if DEBUG_ACPI + printf("* Processing : "); + print_nameseg(*(U32*) (table_array[index]->Signature)); + printf("\n"); +#endif + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(table_array[index], table_array[index]->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning : Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + { + if (*(U32 *) (table_array[index]->Signature) == NAMESEG(ACPI_SIG_FADT)) + { + ACPI_TABLE_FADT *FacpPointer = ((ACPI_TABLE_FADT*)table_array[index]); + ACPI_TABLE_FADT *fadt_mod = (ACPI_TABLE_FADT *)patch_fadt(FacpPointer,((ACPI_TABLE_DSDT*)FacpPointer->Dsdt),true); + if (fadt_mod == (void*)0ul) + { + printf("Error: Failed to patch (& update) FADT Table, fallback to original fadt pointer\n"); + fadt_mod = FacpPointer; + } + xsdt_conv->TableOffsetEntry[index] = ((U64)((U32)fadt_mod)); + + continue; + } + } + + xsdt_conv->TableOffsetEntry[index] = ((U64)((U32)table_array[index])); + } + DBG("XSDT_CONV : Original checksum %d\n", xsdt_conv->Header.Checksum); + SetChecksum(&xsdt_conv->Header); + DBG("New checksum %d\n", xsdt_conv->Header.Checksum); + + return xsdt_conv; +} + +#if ACPISGN +static void MakeAcpiSgn(void) +{ + + char * DefaultplatformName = NULL; + Model32 = 0; + + if ((DefaultplatformName = readDefaultPlatformName())) + { + Model32 = OSSwapHostToBigInt32(adler32( (unsigned char *) DefaultplatformName, strlen(DefaultplatformName))); + } + + uuid32 = 0; + + const char *uuidStr = getStringFromUUID((int8_t*)(uint32_t)get_env(envSysId)); + + if (strlen(uuidStr)) + { + uuid32 = OSSwapHostToBigInt32(adler32( (unsigned char *) uuidStr, UUID_STR_LEN )); + } + +} +#endif + +static void *loadACPITable(U32 *new_table_list, char *dirspec, const char *filename ) +{ + int fd = -1; + char acpi_file[512]; + + DBG("Searching for %s file ...\n", filename); + // Check booting partition + + sprintf(acpi_file, "%s%s",dirspec, filename); + + fd=open(acpi_file,0); + + if (fd<0) + { + DBG("Couldn't open ACPI Table: %s\n", acpi_file); + return (void *)0ul ; + } + + void *tableAddr=(void*)malloc(file_size (fd)); + + if (tableAddr) + { + if (read (fd, tableAddr, file_size (fd))!=file_size (fd)) + { + printf("Couldn't read table %s\n",acpi_file); + free (tableAddr); + close (fd); + return (void *)0ul ; + } + + close (fd); + + ACPI_TABLE_HEADER * header = (ACPI_TABLE_HEADER *)tableAddr; + + if (*(U32*)(header->Signature) != NAMESEG("SSDT")) + { + U8 dummy = 0; + if (get_new_table_in_list(new_table_list, *(U32*)(header->Signature), &dummy)) + { +#if DEBUG_ACPI + printf("Warning: A "); + print_nameseg(*(U32*) (header->Signature)); + printf(" Aml file is already loaded and registred, file skipped !!\n"); +#endif + free(tableAddr); + return (void*)0ul; + } + } + else + { + if (get_number_of_tables_in_list(new_table_list, NAMESEG("SSDT")) >= MAX_SSDT_TABLE) + { + DBG("Warning: Max number of SSDT aml files reached, file skipped !!\n"); + free(tableAddr); + return (void*)0ul; + } + } + + + if (checkOem == true) + { + if (header->OemRevision == Model32) + { + goto continue_loading; + } + + if (header->OemRevision == uuid32) + { + goto continue_loading; + } + + DBG("Bad signature aka Oem Revision (0x%08lx) for Aml file (%s), file skipped !!\n", header->OemRevision, acpi_file); + DBG("uuid32 (0x%08lx) , model32 (0x%08lx)\n", uuid32, Model32); + + free(tableAddr); + return (void*)0ul; + } + + continue_loading: + + if (GetChecksum(header, header->Length) == 0) + { + DBG("Found valid AML file : %s ", filename); + verbose("[ %s ] read and stored at: %x", acpi_file, tableAddr); + printf("\n"); + return tableAddr; + } + else + { + printf("Warning : Incorrect cheksum for the file : %s,", acpi_file); + printf(" this file will be dropped.\n"); + free(tableAddr); + return (void*)0ul; + } + } + else + { + printf("Couldn't allocate memory for table %s\n", acpi_file); + close (fd); + } + + return (void *)0ul ; +} + +static U32 pmbase; +static short cpuNamespace; +PROCESSOR_NUMBER_TO_NAMESEG cpu_map[CPU_MAP_LIMIT]; +unsigned int cpu_map_count; +int cpu_map_error; + +#if DEBUG_ACPI +static void print_nameseg(U32 i) +{ + printf("%c%c%c%c", + (int)(i & 0x000000ff), + (int)((i & 0x0000ff00) >> 8), + (int)((i & 0x00ff0000) >> 16), + (int)(i >> 24)); +} +#endif + +static int generate_cpu_map_from_acpi(ACPI_TABLE_DSDT * DsdtPointer) +{ + PROCESSOR_NUMBER_TO_NAMESEG *map = cpu_map; + U32 processor_namespace = 0; + U32 cpu; + U8 *current, *end; + ACPI_TABLE_HEADER *header; + struct acpi_namespace ns; + + if ((cpu_map_error == 1) || (DsdtPointer == (void*)0ul)) + return 1; + else if (cpu_map_count > 0) + return 0; + + DBG("Attempting to autodetect CPU map from ACPI DSDT; wish me luck\n"); + + current = (U8 *) DsdtPointer; + current = decodeTableHeader(current, &header); + end = current - sizeof(*header) + header->Length; + ns.depth = 0; + acpi_processor_count = 0; + //DBG("* DSDT debug start\n"); + parse_acpi_termlist(&ns, current, end); + //DBG("* DSDT debug end\n"); + + if (acpi_processor_count > CPU_MAP_LIMIT) + { + verbose("Too many processors: found %u processors\n", acpi_processor_count); + return (cpu_map_error = 1); + } + if (acpi_processor_count == 0) + { + verbose( "Found no processors in ACPI\n"); + return (cpu_map_error = 1); + } + for (cpu = 0; cpu < acpi_processor_count; cpu++) + { + U32 nameseg; + if (acpi_processors[cpu].pmbase) + { + U32 cpu_pmbase = acpi_processors[cpu].pmbase - 0x10; + if (pmbase && cpu_pmbase != pmbase) + { + verbose("Found inconsistent pmbase addresses in ACPI: 0x%x and 0x%x\n", pmbase, cpu_pmbase); + return (cpu_map_error = 1); + } + pmbase = cpu_pmbase; + } + if (acpi_processors[cpu].ns.depth > MAX_SUPPORTED_CPU_NAMESEGS + 1) + { + verbose("Processor path too deep: depth %u\n", acpi_processors[cpu].ns.depth); + return (cpu_map_error = 1); + } + if (processor_namespace && acpi_processors[cpu].ns.nameseg[0] != processor_namespace) + { + verbose("Processor namespaces inconsistent\n"); + return (cpu_map_error = 1); + } + processor_namespace = acpi_processors[cpu].ns.nameseg[0]; + map->acpi_processor_number = acpi_processors[cpu].id; + map->seg_count = acpi_processors[cpu].ns.depth - 1; + for (nameseg = 0; nameseg < map->seg_count; nameseg++) + map->nameseg[nameseg] = acpi_processors[cpu].ns.nameseg[nameseg + 1]; + map++; + } + if (!pmbase) + { + verbose("No pmbase found in ACPI\n"); + return (cpu_map_error = 1); + } + if (processor_namespace == NAMESEG("_PR_")) + cpuNamespace = CPU_NAMESPACE_PR; + else if (processor_namespace == NAMESEG("_SB_")) + cpuNamespace = CPU_NAMESPACE_SB; + else + { + verbose("Found processors in invalid namespace; not _PR_ or _SB_\n"); + return (cpu_map_error = 1); + } + cpu_map_count = map - cpu_map; + +#if DEBUG_ACPI + verbose("Found %d processors in ACPI, pmbase : 0x%x, cpu_map_count : %d, namespace : ",acpi_processor_count, pmbase, cpu_map_count ); + print_nameseg(processor_namespace); + verbose("\n"); + U32 i; + verbose("Found processors name : \n" ); + for ( i = 0; i<cpu_map_count; i++) + { + U32 nseg = *(U32*)cpu_map[i].nameseg; + print_nameseg(nseg); + verbose(" "); + } + verbose("\n"); +#endif + + // TODO: Save the cpu map into the device tree + return (cpu_map_error = 0); +} + +static bool is_sandybridge(void) +{ + return Platform.CPU.Model == CPU_MODEL_SANDYBRIDGE; +} + +static bool is_jaketown(void) +{ + return Platform.CPU.Model == CPU_MODEL_JAKETOWN; +} + +static U32 get_bclk(void) +{ + return (is_jaketown() || is_sandybridge()) ? 100 : 133; +} +/* + //----------------------------------------------------------------------------- + static U32 computePstateRatio(const U32 max, const U32 min, const U32 turboEnabled, const U32 numStates, const U32 pstate) + { + U32 ratiorange = max-min; + U32 numGaps = numStates-1-turboEnabled; + U32 adjPstate = pstate-turboEnabled; + return (pstate == 0) ? (max + turboEnabled) : + (ratiorange == 0) ? max : + max-(((adjPstate*ratiorange)+(numGaps/2))/numGaps); + } + //----------------------------------------------------------------------------- + static U32 computeNumPstates(const U32 max, const U32 min, const U32 turboEnabled, const U32 pssLimit) + { + U32 ratiorange, maxStates, numStates; + + ratiorange = max - min + 1; + maxStates = ratiorange + (turboEnabled ? 1 : 0); + numStates = (pssLimit < maxStates) ? pssLimit : maxStates; + return (numStates < 2) ? 0 : numStates; + } + */ +#if BUILD_ACPI_TSS || pstate_power_support +static U64 divU64byU64(U64 n, U64 d, U64 * rem) +{ + U32 i; + U64 q = n; + U64 r = 0; + + for (i = 0; i < 64; i++) { + r <<= 1; + r |= (q & (1ULL << 63)) >> 63; + q <<= 1; + if (r >= d) { + r -= d; + q |= 1; + } + } + if (rem) + *rem = r; + return q; +} + +static U32 compute_tdp(CPU_DETAILS * cpu) +{ + { + if (is_jaketown() || is_sandybridge()) + { + U64 power_limit_1 = cpu->package_power_limit & ((1ULL << 15) - 1); + U64 power_unit = cpu->package_power_sku_unit & ((1ULL << 4) - 1); + U64 tdp = divU64byU64(power_limit_1, 1 << power_unit, NULL); + return (U32)tdp; + } + else + { + // tdp = (TURBO_POWER_CURRENT_LIMIT MSR 1ACh bit [14:0] / 8) Watts + return cpu->tdp_limit / 8; + } + } + return (0); +} +#endif // BUILD_ACPI_TSS || pstate_power_support + +#if pstate_power_support +static U64 mulU64byU64(U64 a, U64 b, U64 * high) +{ + U64 b_high = 0; + U64 r_high = 0, r_low = 0; + U64 bit; + + for (bit = 1; bit; bit <<= 1) { + if (a & bit) { + if (r_low + b < r_low) + r_high++; + r_low += b; + r_high += b_high; + } + b_high <<= 1; + b_high |= (b & (1ULL << 63)) >> 63; + b <<= 1; + } + + if (high) + *high = r_high; + return r_low; +} + +static U32 compute_pstate_power(CPU_DETAILS * cpu, U32 ratio, U32 TDP) +{ + if (is_jaketown() || is_sandybridge()) + { + U32 P1_Ratio = cpu->max_ratio_as_mfg; + U64 M, pstate_power; + + // M = ((1.1 - ((P1_ratio - ratio) * 0.00625)) / 1.1) ^2 + // To prevent loss of precision compute M * 10^5 (preserves 5 decimal places) + M = (P1_Ratio - ratio) * 625; + M = (110000 - M); + M = divU64byU64(M, 11, NULL); + M = divU64byU64(mulU64byU64(M, M, NULL), 1000, NULL); + + // pstate_power = ((ratio/p1_ratio) * M * TDP) + // Divide the final answer by 10^5 to remove the precision factor + pstate_power = mulU64byU64(ratio, M, NULL); + pstate_power = mulU64byU64(pstate_power, TDP, NULL); + pstate_power = divU64byU64(pstate_power, P1_Ratio, NULL); + pstate_power = divU64byU64(pstate_power, 100000, NULL); + return (U32)pstate_power; // in Watts + } + else + { + // pstate_power[ratio] = (ratio/P1_ratio)^3 * Core_TDP + Uncore_TDP + + // Core_TDP = (TURBO_POWER_CURRENT_LIMIT MSR 1ACh bit [30:16] / 8) Watts + U32 Core_TDP = cpu->tdc_limit / 8; + + // Uncore_TDP = TDP - Core_TDP + U32 Uncore_TDP = TDP - Core_TDP; + + // max_ratio_as_mfg = P1_Ratio derived from Brand String returned by CPUID instruction + U32 P1_Ratio = cpu->max_ratio_as_mfg; + +#define PRECISION_FACTOR (U32) 30 +#define PRECISION_FACTOR_CUBED (U32) (PRECISION_FACTOR * PRECISION_FACTOR * PRECISION_FACTOR) + + U32 ratio_factor = (ratio * PRECISION_FACTOR)/P1_Ratio; + return ((ratio_factor * ratio_factor * ratio_factor * Core_TDP) / PRECISION_FACTOR_CUBED) + Uncore_TDP; + } + return (0); +} +#endif // pstate_power_support + +static U32 encode_pstate(U32 ratio) +{ + if (is_jaketown() || is_sandybridge()) + return ratio << 8; + return ratio; +} + +//----------------------------------------------------------------------------- +static void GetMaxRatio(U32 * max_non_turbo_ratio) +{ + U32 index; + U32 max_ratio=0; + U32 frequency=0; + U32 multiplier = 0; + char *BrandString; + // Verify CPUID brand string function is supported + if (Platform.CPU.CPUID[CPUID_80][0] < 80000004) + { + *max_non_turbo_ratio = max_ratio; + return; + } + BrandString = (char *)Platform.CPU.BrandString; + // -2 to prevent buffer overrun because looking for y in yHz, so z is +2 from y + for (index=0; index<48-2; index++) { + // format is either “x.xxyHz” or “xxxxyHz”, where y=M,G,T and x is digits + // Search brand string for “yHz” where y is M, G, or T + // Set multiplier so frequency is in MHz + if ( BrandString[index+1] == 'H' && BrandString[index+2] == 'z') + { + if (BrandString[index] == 'M') + multiplier = 1; + else if (BrandString[index] == 'G') + multiplier = 1000; + else if (BrandString[index] == 'T') + multiplier = 1000000; + } + if (multiplier > 0 && index >= 4 /* who can i call that, buffer underflow :-) ??*/) + { + // Copy 7 characters (length of “x.xxyHz”) + // index is at position of y in “x.xxyHz” + + // Compute frequency (in MHz) from brand string + if (BrandString[index-3] == '.') + { // If format is “x.xx” + if (isdigit(BrandString[index-4]) && isdigit(BrandString[index-2]) && + isdigit(BrandString[index-1])) + { + frequency = (U32)(BrandString[index-4] - '0') * multiplier; + frequency += (U32)(BrandString[index-2] - '0') * (multiplier / 10); + frequency += (U32)(BrandString[index-1] - '0') * (multiplier / 100); + } + } + else + { // If format is xxxx + if (isdigit(BrandString[index-4]) && isdigit(BrandString[index-3]) && + isdigit(BrandString[index-2]) && isdigit(BrandString[index-1])) + { + frequency = (U32)(BrandString[index-4] - '0') * 1000; + frequency += (U32)(BrandString[index-3] - '0') * 100; + frequency += (U32)(BrandString[index-2] - '0') * 10; + frequency += (U32)(BrandString[index-1] - '0'); + frequency *= multiplier; + } + + } + + max_ratio = frequency / get_bclk(); + break; + } + } + + // Return non-zero Max Non-Turbo Ratio obtained from CPUID brand string + // or return 0 indicating Max Non-Turbo Ratio not available + *max_non_turbo_ratio = max_ratio; +} + +//----------------------------------------------------------------------------- +static void collect_cpu_info(CPU_DETAILS * cpu) +{ + boolean_t dynamic_acceleration = 0; + U32 sub_Cstates = 0; + U32 extensions = 0; + boolean_t invariant_APIC_timer = 0; + boolean_t fine_grain_clock_mod = 0; + +#if BUILD_ACPI_TSS || pstate_power_support + if (Platform.CPU.CPUID[CPUID_0][0] >= 0x5) { + /* + * Extract the Monitor/Mwait Leaf info: + */ + sub_Cstates = Platform.CPU.CPUID[CPUID_5][3]; + extensions = Platform.CPU.CPUID[CPUID_5][2]; + } + + if (Platform.CPU.CPUID[CPUID_0][0] >= 6) { + dynamic_acceleration = bitfield(Platform.CPU.CPUID[CPUID_6][0], 1, 1); // "Dynamic Acceleration Technology (Turbo Mode)" + invariant_APIC_timer = bitfield(Platform.CPU.CPUID[CPUID_6][0], 2, 2); // "Invariant APIC Timer" + fine_grain_clock_mod = bitfield(Platform.CPU.CPUID[CPUID_6][0], 4, 4); + } + cpu->turbo_available = (U32)dynamic_acceleration; + + { + U32 temp32 = 0; + U64 temp64= 0; + int tdp; + if (getIntForKey("TDP", &tdp, &bootInfo->chameleonConfig)) + { + temp32 = (U32) (tdp*8) ; + + int tdc; + if (getIntForKey("TDC", &tdc, &bootInfo->chameleonConfig)) + { + temp32 = (U32) (temp32) | tdc<<16 ; + + } + else if (tdp) + { + temp32 = (U32) (temp32) | ((tdp)*8)<<16 ; + } + + } + else if (!is_sandybridge() && !is_jaketown()) + { + if (turbo_enabled && cpu->turbo_available) + { + temp64 = rdmsr64(MSR_TURBO_POWER_CURRENT_LIMIT); + temp32 = (U32)temp64; + } + else + { + // Unfortunately, Intel don't provide a better method for non turbo processors + // and it will give a TDP of 95w (for ex. mine is 65w) , to fix this issue, + // you can set this value by simply adding the option TDP = XX (XX is an integer) + // in your boot.plist + temp32 = (U32)0x02a802f8; + } + + } + if (temp32) { + cpu->tdp_limit = ( temp32 & 0x7fff ); + cpu->tdc_limit = ( (temp32 >> 16) & 0x7fff ); + } + } + +#endif + + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: + case CPU_MODEL_YONAH: // Yonah + case CPU_MODEL_MEROM: // Merom + case CPU_MODEL_PENRYN: // Penryn + case CPU_MODEL_ATOM: // Intel Atom (45nm) + { + + cpu->core_c1_supported = ((sub_Cstates >> 4) & 0xf) ? 1 : 0; + cpu->core_c4_supported = ((sub_Cstates >> 16) & 0xf) ? 1 : 0; + + if (Platform.CPU.Model == CPU_MODEL_ATOM) + { + cpu->core_c2_supported = cpu->core_c3_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0; + cpu->core_c6_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0; + + } + else + { + cpu->core_c3_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0; + cpu->core_c2_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0; + cpu->core_c6_supported = 0; + + } + + cpu->core_c7_supported = 0; + +#if BETA + GetMaxRatio(&cpu->max_ratio_as_mfg); + U64 msr = rdmsr64(MSR_IA32_PERF_STATUS); + U16 idlo = (msr >> 48) & 0xffff; + U16 idhi = (msr >> 32) & 0xffff; + cpu->min_ratio = (U32) (idlo >> 8) & 0xff; + cpu->max_ratio_as_cfg = (U32) (idhi >> 8) & 0xff; + +#else + if (Platform.CPU.MaxCoef) + { + if (Platform.CPU.MaxDiv) + { + cpu->max_ratio_as_cfg = cpu->max_ratio_as_mfg = (U32) (Platform.CPU.MaxCoef * 10) + 5; + } + else + { + cpu->max_ratio_as_cfg = cpu->max_ratio_as_mfg = (U32) Platform.CPU.MaxCoef * 10; + } + } +#endif + + break; + } + case CPU_MODEL_FIELDS: + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: + case CPU_MODEL_NEHALEM: + case CPU_MODEL_NEHALEM_EX: + case CPU_MODEL_WESTMERE: + case CPU_MODEL_WESTMERE_EX: + case CPU_MODEL_SANDYBRIDGE: + case CPU_MODEL_JAKETOWN: + { + + cpu->core_c1_supported = ((sub_Cstates >> 4) & 0xf) ? 1 : 0; + cpu->core_c3_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0; + cpu->core_c6_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0; + cpu->core_c7_supported = ((sub_Cstates >> 16) & 0xf) ? 1 : 0; + cpu->core_c2_supported = 0; + cpu->core_c4_supported = 0; + + GetMaxRatio(&cpu->max_ratio_as_mfg); + U64 platform_info = rdmsr64(MSR_PLATFORM_INFO); + cpu->max_ratio_as_cfg = (U32) ((U32)platform_info >> 8) & 0xff; + cpu->min_ratio = (U32) ((platform_info >> 40) & 0xff); + + cpu->tdc_tdp_limits_for_turbo_flag = (platform_info & (1ULL << 29)) ? 1 : 0; + cpu->ratio_limits_for_turbo_flag = (platform_info & (1ULL << 28)) ? 1 : 0; + cpu->xe_available = cpu->tdc_tdp_limits_for_turbo_flag | cpu->ratio_limits_for_turbo_flag; + + + + if (is_sandybridge() || is_jaketown()) + { + cpu->package_power_limit = rdmsr64(MSR_PKG_RAPL_POWER_LIMIT); + cpu->package_power_sku_unit = rdmsr64(MSR_RAPL_POWER_UNIT); + } + break; + } + default: + verbose ("Unsupported CPU\n"); + return /*(0)*/; + break; + } + } + default: + break; + } + + cpu->mwait_supported = (extensions & (1UL << 0)) ? 1 : 0; + + cpu->invariant_apic_timer_flag = (U32)invariant_APIC_timer; + +#if DEBUG_ACPI + printf("CPU INFO : \n"); +#if BETA + printf("min_ratio : %d\n", cpu->min_ratio); +#endif + printf("max_ratio_as_cfg : %d\n", cpu->max_ratio_as_cfg); + printf("max_ratio_as_mfg : %d\n", cpu->max_ratio_as_mfg); + + printf("turbo_available : %d\n",cpu->turbo_available); + + printf("core_c1_supported : %d\n",cpu->core_c1_supported); + printf("core_c2_supported : %d\n",cpu->core_c1_supported); + printf("core_c3_supported : %d\n",cpu->core_c3_supported); + printf("core_c6_supported : %d\n",cpu->core_c6_supported); + printf("core_c7_supported : %d\n",cpu->core_c7_supported); + printf("mwait_supported : %d\n",cpu->mwait_supported); + +#if BUILD_ACPI_TSS || pstate_power_support + if (is_sandybridge() || is_jaketown()) + { + + printf("package_power_limit : %d\n",cpu->package_power_limit); + printf("package_power_sku_unit : %d\n",cpu->package_power_sku_unit); + + } +#endif + + DBG("invariant_apic_timer_flag : %d\n",cpu->invariant_apic_timer_flag); + + +#endif +} + +#if BETA +//----------------------------------------------------------------------------- +static U32 BuildPstateInfo(CPU_DETAILS * cpu) +{ + // Build P-state table info based on verified options + + // Compute the number of p-states based on the ratio range + cpu->pkg_pstates.num_pstates = computeNumPstates(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, MAX_PSTATES); + + if (!cpu->pkg_pstates.num_pstates) + { + return (0); + } + + // Compute pstate data + { + U32 TDP = compute_tdp(cpu); + + U32 index; + for (index=0; index < cpu->pkg_pstates.num_pstates; index ++) + { + PSTATE * pstate = &cpu->pkg_pstates.pstate[index]; + + // Set ratio + pstate->ratio = computePstateRatio(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, cpu->pkg_pstates.num_pstates, index); + + // Compute frequency based on ratio + if ((index != 0) || (cpu->turbo_available == 0)) + pstate->frequency = pstate->ratio * get_bclk(); + else + pstate->frequency = ((pstate->ratio - 1) * get_bclk()) + 1; + + // Compute power based on ratio and other data + if (pstate->ratio >= cpu->max_ratio_as_mfg) + // Use max power in mW + pstate->power = TDP * 1000; + else + { + pstate->power = compute_pstate_power(cpu, pstate->ratio, TDP); + + // Convert to mW + pstate->power*= 1000; + } + } + } + + return (1); +} +#else +/* + //----------------------------------------------------------------------------- + static U32 BuildCoreIPstateInfo(CPU_DETAILS * cpu) + { + // Build P-state table info based on verified options + + // Compute the number of p-states based on the ratio range + cpu->pkg_pstates.num_pstates = computeNumPstates(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, MAX_PSTATES); + + if (!cpu->pkg_pstates.num_pstates) + { + return (0); + } + + // Compute pstate data + { + #ifdef pstate_power_support + U32 TDP = compute_tdp(cpu); + #endif + + U32 index; + for (index=0; index < cpu->pkg_pstates.num_pstates; index ++) + { + PSTATE * pstate = &cpu->pkg_pstates.pstate[index]; + + // Set ratio + pstate->ratio = computePstateRatio(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, cpu->pkg_pstates.num_pstates, index); + + // Compute frequency based on ratio + if ((index != 0) || (cpu->turbo_available == 0)) + pstate->frequency = pstate->ratio * get_bclk(); + else + pstate->frequency = ((pstate->ratio - 1) * get_bclk()) + 1; + + #ifdef pstate_power_support + // Compute power based on ratio and other data + if (pstate->ratio >= cpu->max_ratio_as_mfg) + // Use max power in mW + pstate->power = TDP * 1000; + else + { + pstate->power = compute_pstate_power(cpu, pstate->ratio, TDP); + + // Convert to mW + pstate->power*= 1000; + } + #else + pstate->power = 0; + #endif + } + } + + return (1); + } + */ +//----------------------------------------------------------------------------- +static U32 BuildPstateInfo(CPU_DETAILS * cpu) +{ + + struct p_state p_states[32]; + U8 p_states_count = 0; + + if (!cpu) + { + return (0); + } + + { +#if UNUSED + struct p_state initial; +#endif + struct p_state maximum, minimum; + // Retrieving P-States, ported from code by superhai (c) + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: + case CPU_MODEL_YONAH: // Yonah + case CPU_MODEL_MEROM: // Merom + case CPU_MODEL_PENRYN: // Penryn + case CPU_MODEL_ATOM: // Intel Atom (45nm) + { + bool cpu_dynamic_fsb = false; + + if (rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 27)) + { + wrmsr64(MSR_IA32_EXT_CONFIG, (rdmsr64(MSR_IA32_EXT_CONFIG) | (1 << 28))); + delay(1); + cpu_dynamic_fsb = rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 28); + } + + bool cpu_noninteger_bus_ratio = (rdmsr64(MSR_IA32_PERF_STATUS) & (1ULL << 46)); +#if UNUSED + //initial.Control = rdmsr64(MSR_IA32_PERF_STATUS); +#endif + maximum.Control = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 32) & 0x1F3F) | (0x4000 * cpu_noninteger_bus_ratio); + maximum.CID = ((maximum.FID & 0x1F) << 1) | cpu_noninteger_bus_ratio; + + minimum.FID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 24) & 0x1F) | (0x80 * cpu_dynamic_fsb); + minimum.VID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 48) & 0x3F); + + if (minimum.FID == 0) + { + U64 msr; + U8 i; + // Probe for lowest fid + for (i = maximum.FID; i >= 0x6; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (i << 8) | minimum.VID); + intel_waitforsts(); + minimum.FID = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0x1F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + if (minimum.VID == maximum.VID) + { + U64 msr; + U8 i; + // Probe for lowest vid + for (i = maximum.VID; i > 0xA; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (minimum.FID << 8) | i); + intel_waitforsts(); + minimum.VID = rdmsr64(MSR_IA32_PERF_STATUS) & 0x3F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + minimum.CID = ((minimum.FID & 0x1F) << 1) >> cpu_dynamic_fsb; + + // Sanity check + if (maximum.CID < minimum.CID) + { + DBG("Insane FID values!"); + p_states_count = 0; + } + else + { + // Finalize P-States + // Find how many P-States machine supports + p_states_count = maximum.CID - minimum.CID + 1; + + if (p_states_count > MAX_PSTATES) // was 32 + p_states_count = MAX_PSTATES; // was 32 + + U8 vidstep; + U8 i = 0, u, invalid = 0; + + vidstep = ((maximum.VID << 2) - (minimum.VID << 2)) / (p_states_count - 1); + + U32 fsb = (U32)divU64byU64(Platform.CPU.FSBFrequency , 1000000 , NULL); + + for (u = 0; u < p_states_count; u++) + { + i = u - invalid; + + p_states[i].CID = maximum.CID - u; + p_states[i].FID = (p_states[i].CID >> 1); + + if (p_states[i].FID < 0x6) + { + if (cpu_dynamic_fsb) + p_states[i].FID = (p_states[i].FID << 1) | 0x80; + } + else if (cpu_noninteger_bus_ratio) + { + p_states[i].FID = p_states[i].FID | (0x40 * (p_states[i].CID & 0x1)); + } + + if (i && p_states[i].FID == p_states[i-1].FID) + invalid++; + + p_states[i].VID = ((maximum.VID << 2) - (vidstep * u)) >> 2; + + U32 multiplier = p_states[i].FID & 0x1f; // = 0x08 + bool half = p_states[i].FID & 0x40; // = 0x01 + bool dfsb = p_states[i].FID & 0x80; // = 0x00 + //U32 fsb = (U32)get_env(envFSBFreq) / 1000000; // = 400 + U32 halffsb = (fsb + 1) >> 1; // = 200 + U32 frequency = (multiplier * fsb); // = 3200 + + p_states[i].Frequency = (frequency + (half * halffsb)) >> dfsb; // = 3200 + 200 = 3400 + } + + p_states_count -= invalid; + } + break; + } + case CPU_MODEL_FIELDS: + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: + case CPU_MODEL_NEHALEM: + case CPU_MODEL_NEHALEM_EX: + case CPU_MODEL_WESTMERE: + case CPU_MODEL_WESTMERE_EX: + case CPU_MODEL_SANDYBRIDGE: + case CPU_MODEL_JAKETOWN: + { + + maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; // Seems it always contains maximum multiplier value (with turbo, that's we need)... + minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff; + + DBG("P-States: min 0x%x, max 0x%x\n", minimum.Control, maximum.Control); + + // Sanity check + if (maximum.Control < minimum.Control) + { + DBG("Insane control values!"); + p_states_count = 0; + } + else + { + U8 i; + p_states_count = 0; + U32 fsb = (U32)divU64byU64(Platform.CPU.FSBFrequency , 1000000, NULL) ; + for (i = maximum.Control; i >= minimum.Control; i--) + { + p_states[p_states_count].Control = i; + p_states[p_states_count].CID = p_states[p_states_count].Control << 1; + p_states[p_states_count].Frequency = (U32)fsb * i; + p_states_count++; + if (p_states_count >= MAX_PSTATES) { // was 32 + + if (p_states_count > MAX_PSTATES) // was 32 + p_states_count = MAX_PSTATES; // was 32 + + break; + } + } + } + + /* + U32 sta = BuildCoreIPstateInfo(cpu); + if (sta) + { + DBG("_PSS PGK generated successfully\n"); + return (1); + + } + else + { + verbose("CoreI _PSS Generation failed !!\n"); + return (0); + } + */ + break; + } + default: + verbose ("Unsupported CPU: P-States will not be generated !!!\n"); + return (0); + break; + } + } + default: + break; + } + } + + // Generating Pstate PKG + if (p_states_count > 0) + { + U32 fsb = (U32)Platform.CPU.FSBFrequency; + U8 minPSratio = divU64byU64(p_states[p_states_count-1].Frequency , divU64byU64(fsb , 10000000 , NULL ) , NULL); + U8 maxPSratio = divU64byU64(p_states[0].Frequency , divU64byU64(fsb , 10000000 , NULL ) , NULL); + U8 cpu_ratio = 0; + + { + U8 cpu_div = (U8)Platform.CPU.CurrDiv; + U8 cpu_coef = (U8)Platform.CPU.CurrCoef; + + if (cpu_div) + cpu_ratio = (cpu_coef * 10) + 5; + else + cpu_ratio = cpu_coef * 10; + } + + + { + int user_max_ratio = 0; + getIntForKey(kMaxRatio, &user_max_ratio, &bootInfo->chameleonConfig); + if (user_max_ratio >= minPSratio && maxPSratio >= user_max_ratio) + { + + U8 maxcurrdiv = 0, maxcurrcoef = (int)divU64byU64(user_max_ratio , 10, NULL); + + U8 maxdiv = user_max_ratio - (maxcurrcoef * 10); + if (maxdiv > 0) + maxcurrdiv = 1; + + if (maxcurrdiv) + cpu_ratio = (maxcurrcoef * 10) + 5; + else + cpu_ratio = maxcurrcoef * 10; + } + } + + { + int user_min_ratio = 0; + getIntForKey(kMinRatio, &user_min_ratio, &bootInfo->chameleonConfig); + if (user_min_ratio >= minPSratio && cpu_ratio >= user_min_ratio) + { + + U8 mincurrdiv = 0, mincurrcoef = (int)divU64byU64(user_min_ratio , 10 , NULL); + + U8 mindiv = user_min_ratio - (mincurrcoef * 10); + + if (mindiv > 0) + mincurrdiv = 1; + + if (mincurrdiv) + minPSratio = (mincurrcoef * 10) + 5; + else + minPSratio = mincurrcoef * 10; + + } + } + + + if (maxPSratio >= cpu_ratio && cpu_ratio >= minPSratio) maxPSratio = cpu_ratio; + + { + int base = 16; + U8 expert = 0; /* Default: 0 , mean mixed mode + * expert mode : 1 , mean add only p-states found in boot.plist + */ + + TagPtr PstateTag; + U32 pstate_tag_count = 0; + + { + + + if (bootInfo->chameleonConfig.dictionary) + { + PstateTag = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"P-States")); + if (PstateTag) pstate_tag_count = XMLTagCount(PstateTag) ; + } + + if (!pstate_tag_count) + if ((PstateTag = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"P-States")))) pstate_tag_count = XMLTagCount(PstateTag); + + + if ((pstate_tag_count > 0) && PstateTag) + { + char *tmpstr = XMLCastString(XMLGetProperty(PstateTag, (const char*)"Mode")); + + if (strcmp(tmpstr,"Expert") == 0) + { + p_states_count = pstate_tag_count - 1 ; // - 1 = - ("Mode" tag) + expert = 1; + } + + + if ((tmpstr = XMLCastString(XMLGetProperty(PstateTag, (const char*)"Base")))) + { + + if (expert) p_states_count--; // -= ("Base" tag) + + int mybase = strtol(tmpstr, NULL, 10); + + if (mybase == 8 || mybase == 10 || mybase == 16 ) + base = mybase; + } + } + + } + + { + U32 dropPSS = 0, Pstatus = 0; + char MatchStat[5]; +#ifdef pstate_power_support + U32 TDP = compute_tdp(cpu); +#endif + U32 i; + U32 fsb = (U32)Platform.CPU.FSBFrequency; + for (i = 0; i < p_states_count; i++) + { + char *Lat1 = NULL, *clk = NULL, *Pw = NULL, *Lat2 = NULL, *Ctrl = NULL ; + + if ((pstate_tag_count > 0) && PstateTag) + { + sprintf(MatchStat, "%d",i); + TagPtr match_Status = XMLGetProperty(PstateTag, (const char*)MatchStat); + + if (match_Status && (XMLTagCount(match_Status) > 0)) + { + + clk = XMLCastString(XMLGetProperty(match_Status, (const char*)"CoreFreq")); + Pw = XMLCastString(XMLGetProperty(match_Status, (const char*)"Power")); + Lat1 = XMLCastString(XMLGetProperty(match_Status, (const char*)"Transition Latency")); + Lat2 = XMLCastString(XMLGetProperty(match_Status, (const char*)"Bus Master Latency")); + Ctrl = XMLCastString(XMLGetProperty(match_Status, (const char*)"Control")); + + + } else if (expert) + continue; + } + + unsigned long Frequency = 0x00000000; + + if (!expert || !pstate_tag_count) Frequency = p_states[i].Frequency; + + if (clk) + Frequency = strtoul((const char *)clk, NULL,base); + + if (!Frequency || Frequency > p_states[0].Frequency ) continue; + + U8 curr_ratio = (U8)divU64byU64(Frequency , divU64byU64(fsb , 10000000, NULL ), NULL); + + + { + U8 fixed_ratio = (U8)divU64byU64(Frequency , divU64byU64(fsb , 1000000 , NULL ) , NULL) * 10; + U8 diff = curr_ratio - fixed_ratio ; + + if (diff) + { + if (diff < 5) + { + curr_ratio = fixed_ratio; + } + else + { + curr_ratio = fixed_ratio + 5; + } + } + + } + + if (curr_ratio > maxPSratio || minPSratio > curr_ratio) + goto dropPstate; + + { + PSTATE * pstate = &cpu->pkg_pstates.pstate[Pstatus]; + + pstate->ratio = curr_ratio; + + pstate->frequency = Frequency; // CoreFreq (in MHz). + + U32 power = 0x00000000; +#ifdef pstate_power_support + // Compute power based on ratio and other data + if (pstate->ratio >= cpu->max_ratio_as_mfg) + // Use max power in mW + power = TDP * 1000; + else + { + power = compute_pstate_power(cpu, pstate->ratio, TDP); + + // Convert to mW + power*= 1000; + } +#endif + pstate->power = resolve_pss(power, Pw, base); // Power (in milliWatts) + pstate->translatency = resolve_pss(0x0000000A, Lat1, base); // Transition Latency (in microseconds). + pstate->bmlatency = resolve_pss(0x0000000A, Lat2, base); // Bus Master Latency (in microseconds). + + { + U32 Control = 0 /*encode_pstate(curr_ratio)*/ ; + if (!expert || !pstate_tag_count) Control = p_states[i].Control; + pstate->control = resolve_pss(Control, Ctrl, base); // Control + } + + pstate->status = Pstatus+1; // Status + + DBG("state :: frequency :%d power: %d translatency: %d bmlatency: %d control: %d status: %d ratio :%d :: registred !! \n",pstate->frequency,pstate->power, + pstate->translatency,pstate->bmlatency,pstate->control,pstate->status,pstate->ratio ); + } + + + Pstatus++; + continue; + + dropPstate: + DBG("state with cpu frequency :%d and ratio :%d will be dropped\n",p_states[i].Frequency,curr_ratio); + dropPSS++; + + + } + + if (Pstatus == 0) + { + verbose("No suitable P-states found, P-States will not be generated !!!\n"); + return (0); + } + cpu->pkg_pstates.num_pstates = Pstatus; + } + } + } + else + { + verbose("ACPI CPUs not found: P-States will not be generated !!!\n"); + return (0); + } + + DBG("_PSS PGK generated successfully\n"); + return (1); +} +#endif // BETA + +//----------------------------------------------------------------------------- +static U32 BuildCstateInfo(CPU_DETAILS * cpu, U32 pmbase) +{ + { + + TagPtr CstateTag = NULL; + U32 entry_count = 0; + + if (bootInfo->chameleonConfig.dictionary) + { + CstateTag = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"C-States")); + } + + if (CstateTag) + { + int base = 16; + + entry_count = XMLTagCount(CstateTag); + + if (entry_count > 0) + { + { + char *tmpstr; + + if ((tmpstr = XMLCastString(XMLGetProperty(CstateTag, (const char*)"Base")))) + { + + entry_count--; // -= ("Base" tag) + + int mybase = strtol(tmpstr, NULL, 10); + + if (mybase == 8 || mybase == 10 || mybase == 16 ) + base = mybase; + } + } + + cpu->pkg_io_cstates.num_cstates = 0; + cpu->pkg_mwait_cstates.num_cstates = 0; + U32 num_cstates = 0; + + { + U32 i; + char MatchStat[5]; + + for (i = 0; i < 32 ; i++) + { + char *Lat = NULL, *Pw = NULL, *BWidth= NULL, *BOffset= NULL, *Address= NULL, *AccessSize= NULL, *index= NULL; + + sprintf(MatchStat, "C%d",i); + TagPtr match_Status = XMLGetProperty(CstateTag, (const char*)MatchStat); + if (match_Status) + { + Pw = XMLCastString(XMLGetProperty(match_Status, (const char*)"Power")); + Lat = XMLCastString(XMLGetProperty(match_Status, (const char*)"Latency")); + BWidth= XMLCastString(XMLGetProperty(match_Status, (const char*)"BitWidth")); + + BOffset = XMLCastString(XMLGetProperty(match_Status, (const char*)"BitOffset")); + Address = XMLCastString(XMLGetProperty(match_Status, (const char*)"Latency")); + AccessSize = XMLCastString(XMLGetProperty(match_Status, (const char*)"AccessSize")); + index = XMLCastString(XMLGetProperty(match_Status, (const char*)"index")); + + if (Pw && Lat && BWidth && BOffset && Address && AccessSize && index) + { + U32 bw = strtoul((const char *)BWidth, NULL,base); + U32 boff = strtoul((const char *)BOffset, NULL,base); + U32 acs = strtoul((const char *)AccessSize, NULL,base); + U32 addr = strtoul((const char *)Address, NULL,base); + U32 idx = strtoul((const char *)index, NULL,base); + U32 lat = strtoul((const char *)Lat, NULL,base); + U32 pw = strtoul((const char *)Pw, NULL,base); + + ACPI_GENERIC_ADDRESS mwait_gas = {GAS_TYPE_FFH,bw,boff,acs,addr}; + ACPI_GENERIC_ADDRESS io_gas = {(i == 1) ? GAS_TYPE_FFH : GAS_TYPE_SYSTEM_IO,bw,boff,acs,addr}; + + CSTATE mwait_cstate = {idx,lat,pw}; + CSTATE io_cstate = {idx,lat,pw}; + + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas; + cpu->pkg_mwait_cstates.num_cstates++; + } + + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas; + cpu->pkg_io_cstates.num_cstates++; + } + num_cstates++; + + if (num_cstates >= MAX_CSTATES) + { + break; + } + } + } + } + } + + if (num_cstates) + { + return (1); + } + } + } + } + + { + static const ACPI_GENERIC_ADDRESS mwait_gas[] = { + {GAS_TYPE_FFH,1,2,1,0x00}, // processor C1 + {GAS_TYPE_FFH,1,2,1,0x10}, // processor C3 as ACPI C2 + {GAS_TYPE_FFH,1,2,1,0x10}, // processor C3 as ACPI C3 + {GAS_TYPE_FFH,1,2,1,0x10}, // processor C3 as ACPI C4 + {GAS_TYPE_FFH,1,2,1,0x20}, // processor C6 + {GAS_TYPE_FFH,1,2,1,0x30}, // processor C7 + }; + + static const ACPI_GENERIC_ADDRESS io_gas[] = { + {GAS_TYPE_FFH, 0,0,0,0x00}, // processor C1 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x14}, // processor C3 as ACPI C2 or processor C2 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x14}, // processor C3 as ACPI C3 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x15}, // processor C4 as ACPI C4 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x15}, // processor C6 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x16}, // processor C7 + }; + + static const CSTATE mwait_cstate [] = { + {1,0x01,0x3e8}, // processor C1 + {2,0x40,0x1f4}, // processor C3 as ACPI C2 or processor C2 + {3,0x40,0x1f4}, // processor C3 as ACPI C3 + {4,0x40,0x1f4}, // processor C4 + {6/*was 3*/,0x60,0x15e}, // processor C6 + {7/*was 3*/,0x60,0x0c8}, // processor C7 + }; + + static const CSTATE io_cstate [] = { + {1,0x01,0x3e8}, // processor C1 + {2,0x40,0x1f4}, // processor C3 as ACPI C2 or processor C2 + {3,0x40,0x1f4}, // processor C3 as ACPI C3 + {4,0x40,0x1f4}, // processor C4 + {6/*was 3*/,0x60,0x15e}, // processor C6 + {7/*was 3*/,0x60,0x0c8}, // processor C7 + }; + + static const U32 cstate_2_index [] = {0,0,0,1,2,3,4,5}; + + // Build C-state table info based on verified options + + // Desired state for the processor core C3 state included in the _CST as an + // ACPI C2 state. + // 1= processor core C3 can be used as an ACPI C2 state + // 0= processor core C3 cannot be used as an ACPI C2 state + int c2_enabled = 0; + + // Desired state for the processor core C3 state included in the _CST + // 0= processor core C3 cannot be used as an ACPI C state + // 2= processor core C3 can be used as an ACPI C2 state + // 3= processor core C3 can be used as an ACPI C3 state + // 4= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else not used as ACPI C state + // 5= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else APIC C3 state + // 6= processor core C3 can be used as an ACPI C4 state + int c3_enabled = 3; + + // Desired state for the processor core C3 state included in the _CST as an + // ACPI C4 state. + // 1= processor core C3 can be used as an ACPI C4 state + // 0= processor core C3 cannot be used as an ACPI C4 state + int c4_enabled = 0; + + // Desired state for the processor core C6 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C6 can be used as an ACPI C3 state + // 0= processor core C6 cannot be used as an ACPI C3 state + int c6_enabled = 0; + + // Desired state for the processor core C7 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C7 can be used as an ACPI C7 state + // 0= processor core C7 cannot be used as an ACPI C7 state + int c7_enabled = 0; + + { + bool tmpval; + + + if (getBoolForKey(kEnableC2State, &tmpval, &bootInfo->chameleonConfig)) + { + c2_enabled = tmpval; + } + + if (!getIntForKey("C3StateOption", &c3_enabled, &bootInfo->chameleonConfig)) + { + c3_enabled = (getBoolForKey(kEnableC3State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 3 : 0; + } + if (c3_enabled == 6) + { + c4_enabled = 1; + } + else + { + c4_enabled = (getBoolForKey(kEnableC4State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 1 : 0; + } + c6_enabled = (getBoolForKey(kEnableC6State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 1 : 0; + c7_enabled = (getBoolForKey(kEnableC7State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 1 : 0; + } + + cpu->pkg_mwait_cstates.num_cstates = 0; + { + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C1]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C1]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + if (((cpu->core_c3_supported || cpu->core_c2_supported) && (c2_enabled)) && ((c3_enabled == 2) || + ((c3_enabled == 4) && cpu->invariant_apic_timer_flag))) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + if (cpu->core_c4_supported && c4_enabled) + { + + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C4]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C4]]; + cpu->pkg_mwait_cstates.num_cstates++; + + } + else + { + + if (cpu->core_c3_supported && ((c3_enabled == 3) || + ((c3_enabled == 4) && !cpu->invariant_apic_timer_flag))) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + } + + + if (cpu->core_c6_supported && c6_enabled) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C6]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C6]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + if (cpu->core_c7_supported && c7_enabled) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C7]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C7]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + } + + cpu->pkg_io_cstates.num_cstates = 0; + { + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C1]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C1]]; + cpu->pkg_io_cstates.num_cstates++; + } + if ((cpu->core_c3_supported || cpu->core_c2_supported) && (c2_enabled || (c3_enabled == 2) || + ((c3_enabled == 4) && cpu->invariant_apic_timer_flag))) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + if (cpu->core_c4_supported && c4_enabled) + { + + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C4]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C4]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + + } + else + { + + if (cpu->core_c3_supported && ((c3_enabled == 3) || + ((c3_enabled == 4) && !cpu->invariant_apic_timer_flag))) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + } + + if (cpu->core_c6_supported && c6_enabled) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C6]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C6]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + if (cpu->core_c7_supported && c7_enabled) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C7]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C7]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + } + } + + return (1); +} + +#if BUILD_ACPI_TSS +//----------------------------------------------------------------------------- +static U32 BuildTstateInfo(CPU_DETAILS * cpu) +{ + // Coarse grained clock modulation is available if cpuid.6.eax[5] = 0 + // Max of 8 T-states using 12.5% increments + static const TSTATE tstate_coarse_grain [] = { + {100,0,0,0x00,0}, + { 88,0,0,0x1e,0}, + { 75,0,0,0x1c,0}, + { 63,0,0,0x1a,0}, + { 50,0,0,0x18,0}, + { 38,0,0,0x16,0}, + { 25,0,0,0x14,0}, + { 13,0,0,0x12,0}, + }; + + // Fine grained clock modulation is available if cpuid.6.eax[5] = 1 + // Max of 15 T-states using 6.25% increments + static const TSTATE tstate_fine_grain [] = { + {100,0,0,0x00,0}, + { 94,0,0,0x1f,0}, + { 88,0,0,0x1e,0}, + { 81,0,0,0x1d,0}, + { 75,0,0,0x1c,0}, + { 69,0,0,0x1b,0}, + { 63,0,0,0x1a,0}, + { 56,0,0,0x19,0}, + { 50,0,0,0x18,0}, + { 44,0,0,0x17,0}, + { 38,0,0,0x16,0}, + { 31,0,0,0x15,0}, + { 25,0,0,0x14,0}, + { 19,0,0,0x13,0}, + { 13,0,0,0x12,0}, + }; + + // Build T-state table info based on verified options + U32 num_cpu; + const TSTATE * tstate; + U32 num_tstates; + + for (num_cpu = 0; num_cpu < cpu_map_count; num_cpu ++) + { + // Check if fine or coarse grained clock modulation is available + if (get_env(envFineGrainClockMod)) + { + // Fine grain thermal throttling is available + num_tstates = 15; + tstate = tstate_fine_grain; + } + else + { + // Coarse grain thermal throttling is available + num_tstates = 8; + tstate = tstate_coarse_grain; + } + + cpu->pkg_tstates.num_tstates = num_tstates; + { + U32 index; + for (index = 0; index < num_tstates; index++) + { + cpu->pkg_tstates.tstate[index] = tstate[index]; + cpu->pkg_tstates.tstate[index].power = 1000 * (compute_tdp(cpu) * (num_tstates - index)) / num_tstates; + } + } + + + } + return (1); +} +#endif // BUILD_ACPI_TSS + +//----------------------------------------------------------------------------- +U32 ProcessMadt(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info, void * buffer, U32 bufferSize, U32 nb_cpu) +{ + void *current; + void *currentOut; + void *end; + void * endOut; + + U32 LOCAL_APIC_NMI_CNT = 0, LOCAL_SAPIC_CNT = 0, INT_SRC_CNT = 0, Length = 0; + + // Quick sanity check for a valid MADT + if (madt == 0ul || !nb_cpu) + return (0); + + // Confirm a valid MADT buffer was provided + if (!buffer) + { + printf("Error: Invalid Buffer Address for MADT\n"); + return(0); + } + + // Confirm a valid MADT buffer length was provided + if (!bufferSize) + { + printf("Error: Invalid Buffer Length for MADT\n"); + return(0); + } + + madt_info->lapic_count = 0; + + memcpy(buffer, madt, sizeof(ACPI_TABLE_MADT)); + + // Search MADT for Sub-tables with needed data + current = madt + 1; + currentOut = buffer + sizeof(ACPI_TABLE_MADT) ; + + end = (U8 *) madt + madt->Header.Length; + endOut = (U8 *)buffer + bufferSize; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + Length += sizeof(ACPI_TABLE_MADT); + + while (current < end) + { + ACPI_SUBTABLE_HEADER *subtable = current; + ACPI_SUBTABLE_HEADER *subtableOut = currentOut; + + + switch (subtable->Type) + { + + case ACPI_MADT_TYPE_LOCAL_APIC: + { + + // Process sub-tables with Type as 0: Processor Local APIC + ACPI_MADT_LOCAL_APIC *lapic = current; + current = lapic + 1; + + if (!(lapic->LapicFlags & ACPI_MADT_ENABLED)) + continue; + + if (madt_info->lapic_count >= nb_cpu) + continue; + + // copy subtable + { + + memcpy(currentOut, lapic, lapic->Header.Length); + + currentOut = currentOut + lapic->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + } + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->processorId = lapic->ProcessorId; + lapic_info->apicId = lapic->Id; + lapic_info->madt_type = ACPI_MADT_TYPE_LOCAL_APIC; + } + + madt_info->lapic_count++; + + Length += lapic->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_X2APIC: + { + + // Process sub-tables with Type as 9: Processor X2APIC + ACPI_MADT_X2APIC *x2apic = current; + current = x2apic + 1; + + if (!(x2apic->x2apicFlags & ACPI_MADT_ENABLED)) + continue; + + if (madt_info->lapic_count >= nb_cpu) + continue; + + // copy subtable + { + memcpy(currentOut, x2apic, x2apic->Header.Length); + + currentOut = currentOut + x2apic->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + } + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->uid = x2apic->UID; + lapic_info->apicId = x2apic->x2apicId; + lapic_info->madt_type = ACPI_MADT_TYPE_X2APIC; + } + + madt_info->lapic_count++; + + Length += x2apic->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_LOCAL_APIC_NMI: + { + // Process sub-tables with Type as 4: Local APIC NMI + ACPI_MADT_LOCAL_APIC_NMI *nmi = current; + current = nmi + 1; + /* + if (!(nmi->IntiFlags & ACPI_MADT_ENABLED)) + continue; + */ + if (LOCAL_APIC_NMI_CNT >= nb_cpu) + continue; + + memcpy(currentOut, nmi, nmi->Header.Length); + + currentOut = currentOut + nmi->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + + LOCAL_APIC_NMI_CNT++; + + Length += nmi->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (LOCAL_APIC_NMI_CNT > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_LOCAL_SAPIC: + { + // Process sub-tables with Type as 7: Local Sapic + ACPI_MADT_LOCAL_SAPIC *sapic = current; + current = sapic + 1; + /* + if (!(sapic->LapicFlags & ACPI_MADT_ENABLED)) + continue; + */ + if (LOCAL_SAPIC_CNT >= nb_cpu) + continue; + + memcpy(currentOut, sapic, sapic->Header.Length); + + currentOut = currentOut + sapic->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + + LOCAL_SAPIC_CNT++; + + Length += sapic->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (LOCAL_SAPIC_CNT > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_INTERRUPT_SOURCE: + { + // Process sub-tables with Type as 8: Platform Interrupt Source + ACPI_MADT_INTERRUPT_SOURCE *intsrc = current; + current = intsrc + 1; + /* + if (!(intsrc->IntiFlags & ACPI_MADT_ENABLED)) + continue; + */ + if (INT_SRC_CNT >= nb_cpu) + continue; + + memcpy(currentOut, intsrc, intsrc->Header.Length); + + currentOut = currentOut + intsrc->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + + INT_SRC_CNT++; + + Length += intsrc->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (INT_SRC_CNT > MAX_LOGICAL_CPU) + return (0); + + break; + } + + default: + { + + // Process all other sub-tables + current = (U8 *) subtable + subtable->Length; + currentOut = (U8 *) subtableOut + subtable->Length; + + memcpy(subtableOut, subtable, subtable->Length); + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + Length += subtable->Length; + + break; + } + } // switch + + } // while + + { + ACPI_TABLE_MADT * new_madt = (ACPI_TABLE_MADT * )buffer; + + // Update the Lenght of the new MADT table + new_madt->Header.Length = Length; + + // Update the checksum of the new MADT table + SetChecksum(&new_madt->Header); + } + + return (1); +} + +static U32 buildMADT(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info) +{ + DBG("Build MADT\n"); + + ACPI_TABLE_MADT * madt_file = (void*)0ul; + ACPI_TABLE_MADT * MadtPointer = (void*)0ul; + bool oem_apic=false; + U8 new_table_index = 0; + + // Check that we have a valid cpu_map (if it's not already done, it will try to generate it) + if (generate_cpu_map_from_acpi(dsdt) != 0) + { + return(0); + } + + { + bool tmpval; + oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } + + if (oem_apic == true) + { + return(0); + } + + if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul) + { + MadtPointer = (ACPI_TABLE_MADT *)madt_file; + + new_table_list[new_table_index] = 0ul; // This way, the non-patched table will not be added in our new rsdt/xsdt table list + } + else + { + MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer; + + new_table_index = get_0ul_index_in_list(new_table_list, true); + + // Check to confirm space is available + if (new_table_index == ACPI_TABLE_LIST_FULL) + { + printf("Error: not enought reserved space in the new acpi list for the MADT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + return(0); + } + } + + // Create buffer for MADT + //U8 memory_for_madt[2 * 1024]; // seems to bug with xcode4, need to found out what is going on (not enough memory in the stack ?) + U8 *memory_for_madt = (U8*)AllocateKernelMemory(2 * 1024); + + // Build the new MADT + if ( (ProcessMadt(MadtPointer, madt_info, memory_for_madt, 2 * 1024, cpu_map_count))== 0) + { + printf("Error: Failed to build MADT table\n"); + return (0); + } + + // insert MADT in the new_table_list + { + // Create pointer to MADT just built in the stack buffer + ACPI_TABLE_MADT * old_madt = (ACPI_TABLE_MADT *)memory_for_madt; + + // Reserved kernel memory for the madt table + ACPI_TABLE_MADT *new_madt = (ACPI_TABLE_MADT *)AllocateKernelMemory(old_madt->Header.Length); + + if (!new_madt) + { + printf("Unable to allocate kernel memory for MADT "); + return (0); + } + // Move the old stack buffer to kernel memory + memcpy(new_madt, old_madt, old_madt->Header.Length); + + // Add the new madt into an empty space of the new_table_list + new_table_list[new_table_index] = (U32)new_madt; + } + + verbose ("MADT table successfully patched\n"); + return(1); +} + +static U32 ProcessSsdt(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info, bool enable_cstates, bool enable_pstates, bool enable_tstates ) +{ + DBG("Processing SSDT\n"); + + // Check we are on an intel platform + if (Platform.CPU.Vendor != CPUID_VENDOR_INTEL) { + verbose ("Not an Intel platform: SSDT will not be generated !!!\n"); + return(0); + } + + // Check for the msr feature flag + if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) { + verbose ("Unsupported CPU: SSDT will not be generated !!!\n"); + return(0); + } + + if (dsdt == (void *)0ul) { + verbose ("DSDT not found: SSDT will not be generated !!!\n"); + return (0); + } + + // Get an empty space in the new_talbe_list (true = allow reserved space) + U8 empty = get_0ul_index_in_list(new_table_list, true); + + // Check to confirm space is available + if (empty == ACPI_TABLE_LIST_FULL) + { + printf("Error: not enought reserved space in the new acpi list for the SSDT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + return(0); + } + + // Create buffer for SSDT + //U8 memory_for_ssdt[20 * 1024]; // seems to bug with xcode4, need to found out what is going on (not enough memory in the stack ?) + U8 *memory_for_ssdt =(U8*)AllocateKernelMemory(20 * 1024); + + // Build the SSDT + if ( (BuildSsdt(madt_info, dsdt, memory_for_ssdt, 20 * 1024 /*sizeof(memory_for_ssdt)*/, enable_cstates, enable_pstates, enable_tstates)) == 0) + { + printf("Error: Failed to build SSDT table\n"); + return (0); + } + + // insert SSDT in the new_table_list + { + // Create pointer to SSDT just built in the stack buffer + ACPI_TABLE_SSDT * old_ssdt = (ACPI_TABLE_SSDT *)memory_for_ssdt; + + // Reserved kernel memory for the ssdt table + ACPI_TABLE_SSDT *new_ssdt = (ACPI_TABLE_SSDT *)AllocateKernelMemory(old_ssdt->Header.Length); + + if (!new_ssdt) + { + printf("Unable to allocate kernel memory for SSDT "); + return (0); + } + // Move the old stack buffer to kernel memory + memcpy(new_ssdt, old_ssdt, old_ssdt->Header.Length); + + // Add the new ssdt into an empty space of the new_table_list + new_table_list[empty] = (U32)new_ssdt; + } + + verbose ("SSDT table generated successfully\n"); + return(1); +} + +//----------------------------------------------------------------------------- +static void * buildCpuScope (void * current, U32 cpu_namespace, PROCESSOR_NUMBER_TO_NAMESEG * aslCpuNamePath) +{ + ACPI_SCOPE * scope = current; + current = scope + 1; + + scope->scopeOpcode = AML_SCOPE_OP; + scope->rootChar = AML_ROOT_PREFIX; + + if (aslCpuNamePath->seg_count == 1) + { + DUAL_NAME_PATH * dualNamePath = current; + current = dualNamePath + 1; + dualNamePath->prefix = AML_DUAL_NAME_PREFIX; + dualNamePath->nameseg[0] = cpu_namespace; + dualNamePath->nameseg[1] = aslCpuNamePath->nameseg[0]; + } + else + { + MULTI_NAME_PATH * multiNamePath = current; + current = multiNamePath + 1; + multiNamePath->prefix = AML_MULTI_NAME_PREFIX; + // the nameseg count includes the root prefix and all other namesegs + multiNamePath->segCount = (U8) aslCpuNamePath->seg_count+1; + multiNamePath->nameseg[0] = cpu_namespace; + { + U32 i; + for (i=0; i<aslCpuNamePath->seg_count; i++) + multiNamePath->nameseg[i+1] = aslCpuNamePath->nameseg[i]; + } + } + return (current); +} +//----------------------------------------------------------------------------- +static void * buildPDC(void * current) +{ + ACPI_METHOD * pdc = current; + current = buildMethod(current, NAMESEG("_PDC"), 1); + + // CreateDWordField (Arg0, 0x08, CAPA) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x08); + current = buildNameSeg(current, NAMESEG("CAPA")); + + // Store (CAPA, TYPE) + current = buildOpCode(current, AML_STORE_OP); + current = buildNameSeg(current, NAMESEG("CAPA")); + current = buildNameSeg(current, NAMESEG("TYPE")); + + // CreateDWordField (Arg0, 0x00, REVS) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("REVS")); + + // CreateDWordField (Arg0, 0x04, SIZE) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("SIZE")); + + // Store(SizeOf(Arg0), Local0) + current = buildOpCode(current, AML_STORE_OP); + current = buildOpCode(current, AML_SIZEOF_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildOpCode(current, AML_LOCAL0_OP); + + // Store(Subtract(Local0, 0x08),Local1) + current = buildOpCode(current, AML_STORE_OP); + current = buildOpCode(current, AML_SUBTRACT_OP); + current = buildOpCode(current, AML_LOCAL0_OP); + current = buildByteConst(current, 0x08); + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_LOCAL1_OP); + + // CreateField (Arg0, 0x40, Multiply (Local1, 0x08), TEMP) + current = buildOpCode(current, AML_EXT_OP_PREFIX); + current = buildOpCode(current, AML_CREATE_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x40); + current = buildOpCode(current, AML_MULTIPLY_OP); + current = buildOpCode(current, AML_LOCAL1_OP); + current = buildByteConst(current, 0x08); + current = buildOpCode(current, AML_ZERO_OP); + current = buildNameSeg(current, NAMESEG("TEMP")); + + // Name (STS0, Buffer (0x04) {0x00, 0x00, 0x00, 0x00}) + // Create STS0 as named buffer + current = buildNamePath(current, NAMESEG("STS0")); + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + // count of buffer elements + current = buildByteConst(current, 4); + + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_ZERO_OP); + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + + //Concatenate (STS0, TEMP, Local2) + current = buildOpCode(current, AML_CONCAT_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildNameSeg(current, NAMESEG("TEMP")); + current = buildOpCode(current, AML_LOCAL2_OP); + + //_OSC (Buffer (0x10) + // { + // /* 0000 */ 0x16, 0xA6, 0x77, 0x40, 0x0C, 0x29, 0xBE, 0x47, + // /* 0008 */ 0x9E, 0xBD, 0xD8, 0x70, 0x58, 0x71, 0x39, 0x53 + // }, REVS, SIZE, Local2) + current = buildNameSeg(current, NAMESEG("_OSC")); + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + // count of buffer elements + current = buildByteConst(current, 0x10); + + current = buildOpCode(current, 0x16); + current = buildOpCode(current, 0xa6); + current = buildOpCode(current, 0x77); + current = buildOpCode(current, 0x40); + current = buildOpCode(current, 0x0c); + current = buildOpCode(current, 0x29); + current = buildOpCode(current, 0xbe); + current = buildOpCode(current, 0x47); + current = buildOpCode(current, 0x9e); + current = buildOpCode(current, 0xbd); + current = buildOpCode(current, 0xd8); + current = buildOpCode(current, 0x70); + current = buildOpCode(current, 0x58); + current = buildOpCode(current, 0x71); + current = buildOpCode(current, 0x39); + current = buildOpCode(current, 0x53); + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + current = buildNameSeg(current, NAMESEG("REVS")); + current = buildNameSeg(current, NAMESEG("SIZE")); + current = buildOpCode(current, AML_LOCAL2_OP); + + // Update package length in PDC object + //pdc->packageLength = (U8)((U8 *)current - (U8 *)&pdc->packageLength); + setPackageLength(&pdc->pkgLength, (U8 *)current - (U8 *)&pdc->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildOSC(void * current) +{ + // + // + ACPI_METHOD * osc = current; + current = buildMethod(current, NAMESEG("_OSC"), 4); + + // CreateDWordField (Arg3, 0x04, CAPA) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG3_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("CAPA")); + + // Store (CAPA, TYPE) + current = buildOpCode(current, AML_STORE_OP); + current = buildNameSeg(current, NAMESEG("CAPA")); + current = buildNameSeg(current, NAMESEG("TYPE")); + + // CreateDWordField (Arg3, 0x00, STS0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG3_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("STS0")); + + // CreateDWordField (Arg3, 0x04, CAP0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG3_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("CAP0")); + + // CreateDWordField (Arg0, 0x00, IID0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("IID0")); + + // CreateDWordField (Arg0, 0x04, IID1) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("IID1")); + + // CreateDWordField (Arg0, 0x08, IID2) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x08); + current = buildNameSeg(current, NAMESEG("IID2")); + + // CreateDWordField (Arg0, 0x0C, IID3) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x0C); + current = buildNameSeg(current, NAMESEG("IID3")); + + // Name (UID0, Buffer (0x10) + // { + // 0x16, 0xA6, 0x77, 0x40, 0x0C, 0x29, 0xBE, 0x47, + // 0x9E, 0xBD, 0xD8, 0x70, 0x58, 0x71, 0x39, 0x53 + // }) + current = buildNamePath(current, NAMESEG("UID0")); + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + // count of buffer elements + current = buildByteConst(current, 0x10); + + current = buildOpCode(current, 0x16); + current = buildOpCode(current, 0xa6); + current = buildOpCode(current, 0x77); + current = buildOpCode(current, 0x40); + current = buildOpCode(current, 0x0c); + current = buildOpCode(current, 0x29); + current = buildOpCode(current, 0xbe); + current = buildOpCode(current, 0x47); + current = buildOpCode(current, 0x9e); + current = buildOpCode(current, 0xbd); + current = buildOpCode(current, 0xd8); + current = buildOpCode(current, 0x70); + current = buildOpCode(current, 0x58); + current = buildOpCode(current, 0x71); + current = buildOpCode(current, 0x39); + current = buildOpCode(current, 0x53); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + + // CreateDWordField (UID0, 0x00, EID0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("EID0")); + + // CreateDWordField (UID0, 0x04, EID1) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("EID1")); + + // CreateDWordField (UID0, 0x08, EID2) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x08); + current = buildNameSeg(current, NAMESEG("EID2")); + + // CreateDWordField (UID0, 0x0C, EID3) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x0C); + current = buildNameSeg(current, NAMESEG("EID3")); + + // If (LNot (LAnd (LAnd (LEqual (IID0, EID0), LEqual (IID1, EID1)), + // LAnd (LEqual (IID2, EID2), LEqual (IID3, EID3))))) + // { + // Store (0x06, Index (STS0, 0x00)) + // Return (Arg3) + // } + { + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + current = buildOpCode(current, AML_LNOT_OP); + current = buildOpCode(current, AML_LAND_OP); + current = buildOpCode(current, AML_LAND_OP); + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID0")); + current = buildNameSeg(current, NAMESEG("EID0")); + + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID1")); + current = buildNameSeg(current, NAMESEG("EID1")); + + current = buildOpCode(current, AML_LAND_OP); + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID2")); + current = buildNameSeg(current, NAMESEG("EID2")); + + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID3")); + current = buildNameSeg(current, NAMESEG("EID3")); + + // Store (0x06, Index (STS0, 0x00)) + current = buildOpCode(current, AML_STORE_OP); + current = buildByteConst(current, 0x06); + current = buildOpCode(current, AML_INDEX_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildByteConst(current, 0x00); + current = buildOpCode(current, AML_ZERO_OP); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + } + + // If (LNotEqual (Arg1, 0x01)) + // { + // Store (0x0A, Index (STS0, 0x00)) + // Return (Arg3) + // } + { + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // If ("LNotEqual (Arg1, 0x01)") + current = buildOpCode(current, AML_LNOT_OP); + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildOpCode(current, AML_ARG1_OP); + current = buildByteConst(current, 0x01); + + // Store (0x0A, Index (STS0, 0x00)) + current = buildOpCode(current, AML_STORE_OP); + current = buildByteConst(current, 0x0A); + current = buildOpCode(current, AML_INDEX_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildByteConst(current, 0x00); + current = buildOpCode(current, AML_ZERO_OP); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + } + + // If (And (STS0, 0x01)) + // { + // And (CAP0, 0x0BFF, CAP0) + // Return (Arg3) + // } + { + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // If ("And (STS0, 0x01)") + current = buildOpCode(current, AML_AND_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildByteConst(current, 0x01); + current = buildOpCode(current, AML_ZERO_OP); + + // And (CAP0, 0x0BFF, CAP0) + current = buildOpCode(current, AML_AND_OP); + current = buildNameSeg(current, NAMESEG("CAP0")); + current = buildWordConst(current, 0x0BFF); + current = buildNameSeg(current, NAMESEG("CAP0")); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + } + + // And (CAP0, 0x0BFF, CAP0) + current = buildOpCode(current, AML_AND_OP); + current = buildNameSeg(current, NAMESEG("CAP0")); + current = buildWordConst(current, 0x0BFF); + current = buildNameSeg(current, NAMESEG("CAP0")); + + // Store (CAP0, TYPE) + current = buildOpCode(current, AML_STORE_OP); + current = buildNameSeg(current, NAMESEG("CAP0")); + current = buildNameSeg(current, NAMESEG("TYPE")); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + // Set package length for the OSC object + setPackageLength(&osc->pkgLength, (U8 *)current - (U8 *)&osc->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPSS(void * current, PKG_PSTATES * pkg_pstates) +{ + // + // IF (PSEN) + // { + // Return (Package of Pstate Packages) + // } + // Return(Zero) + // + ACPI_METHOD * pss = current; + current = buildMethod(current, NAMESEG("_PSS"), 0); + + { + // "IF" (PSEN) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF "(PSEN)" -- IF Predicate + current = buildNameSeg(current, NAMESEG("PSEN")); + + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_pstates->num_pstates); + + // (3.3.3) For each P-state + { + U32 pstateIndex = 0; + for (pstateIndex=0; pstateIndex < pkg_pstates->num_pstates; pstateIndex++) + { + // (3.3.3.1) Create P-state package + ACPI_PSTATE_PACKAGE * pstate = current; + current = pstate + 1; + + setSmallPackage(&pstate->package, 6); + pstate->package.packageLength = (U8)(sizeof(ACPI_PSTATE_PACKAGE) - 1); + + setDwordConst(&pstate->CoreFreq, pkg_pstates->pstate[pstateIndex].frequency);// CoreFreq (in MHz). + setDwordConst(&pstate->Power, pkg_pstates->pstate[pstateIndex].power);// Power (in milliWatts). + setDwordConst(&pstate->TransLatency, pkg_pstates->pstate[pstateIndex].translatency);// Transition Latency (in microseconds). + setDwordConst(&pstate->BMLatency, pkg_pstates->pstate[pstateIndex].bmlatency);// Bus Master Latency (in microseconds). + setDwordConst(&pstate->Control, pkg_pstates->pstate[pstateIndex].control); // Control. + + setDwordConst(&pstate->Status, encode_pstate(pkg_pstates->pstate[pstateIndex].ratio));// Status. + } // for + } // for block + + // (3.3.4) Update package length in return package + setPackageLength(&returnPkg->package.pkgLength, (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // "IF (PSEN) and its body" -- Set package length + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Set package length for the _PSS object + setPackageLength(&pss->pkgLength, (U8 *)current - (U8 *)&pss->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPSD(void * current, U32 domain, U32 cpusInDomain, U32 pstate_coordination) +{ + // If (And(TYPE, 0x0820)) + // { + // Return (PSD Package) + // } + // Return(Zero) + + ACPI_METHOD * psdMethod = current; + current = buildMethod(current, NAMESEG("_PSD"), 0); + { + // "IF" (And(TYPE, 0x0820)) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("And"(TYPE, 0x820)) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (And("TYPE", 0x820)) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (And(TYPE, "0x0820")) -- DWORD Value Term + current = buildDwordConst(current, 0x820); + + // IF ("And(TYPE, 0x200)") -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build return package containing PSD package + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 1); + + { + // Create PSD package + ACPI_PSD_PACKAGE * psd = current; + current = psd + 1; + + setSmallPackage(&psd->package, 5); + psd->package.packageLength = (U8)(sizeof(ACPI_PSD_PACKAGE) - 1); + + setByteConst(&psd->NumberOfEntries, 5); + setByteConst(&psd->Revision, 0); + setDwordConst(&psd->Domain, domain); + setDwordConst(&psd->CoordType, pstate_coordination); + setDwordConst(&psd->NumProcessors, cpusInDomain); + + } // PSD package + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _PSD method + setPackageLength(&psdMethod->pkgLength, (U8 *)current - (U8 *)&psdMethod->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPPC(void * current/*, U8 valueToReturn*/) +{ + ACPI_SMALL_METHOD * ppc = current; + current = buildSmallMethod(current, NAMESEG("_PPC"), 0); + + current = buildReturnZero(current); + + //current = buildReturnOpcode(current, valueToReturn); + + // Update package length in PPC object + ppc->packageLength = (U8) ( (U8 *)current - (U8 *)&ppc->packageLength ); + + return(current); +} + +#if UNUSED +//----------------------------------------------------------------------------- +static void * buildPDL(void * current, U8 valueToReturn) +{ + ACPI_SMALL_METHOD * pdl = current; + current = buildSmallMethod(current, NAMESEG("_PDL"), 0); + + current = buildReturnOpcode(current, valueToReturn); + + // Update package length in PDL object + pdl->packageLength = (U8) ( (U8 *)current - (U8 *)&pdl->packageLength ); + + return(current); +} +#endif + +//----------------------------------------------------------------------------- +static void * buildPCT(void * current) +{ + static const ACPI_GENERIC_ADDRESS pct_gas[] = { + {0x7f,0x40,0,0,0x199}, + {0x7f,0x10,0,0,0x198}, + }; + + ACPI_SMALL_METHOD * pct = current; + current = buildSmallMethod(current, NAMESEG("_PCT"), 0); + + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 2); + + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &pct_gas[0]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &pct_gas[1]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + + } + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // Update package length in PCT object + pct->packageLength = (U8)((U8 *)current - (U8 *)&pct->packageLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildCstate(void * current, ACPI_GENERIC_ADDRESS * gas, CSTATE * cstate) +{ + // + // Build a C-state + // + ACPI_SMALL_PACKAGE * pkg1 = current; + current = buildSmallPackage(current, 4); + + { + { + ACPI_SMALL_BUFFER * buffer = current; + current = buildSmallBuffer(current); + + { + // Buffer length + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, gas); + current = buildEndTag(current); + } + { + U32 length = (U8 *)current - (U8 *)buffer; + buffer->packageLength = (U8)length - 1; + } + } + + { + current = buildByteConst(current, cstate->type); + current = buildWordConst(current, cstate->latency); + current = buildDwordConst(current, cstate->power); + } + } + pkg1->packageLength = (U8)((U8 *)current - (U8 *)&pkg1->packageLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildReturnPackageCST(void * current, PKG_CSTATES * pkg_cstates) +{ + // Create package returning C-states + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_cstates->num_cstates + 1); + + { + // Include number of C-states + current = buildByteConst(current, (U8)pkg_cstates->num_cstates); + + { + U32 cstateIndex = 0; + for (cstateIndex=0; cstateIndex < pkg_cstates->num_cstates; cstateIndex++) + // Build C-state + current = buildCstate(current, &pkg_cstates->gas[cstateIndex], &pkg_cstates->cstate[cstateIndex]); + } + } + + // Update package length in return package + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildCST(void * current, PKG_CSTATES * mwait_pkg_cstates, PKG_CSTATES * io_pkg_cstates) +{ + // + // IF (CSEN) + // { + // IF (LAnd(MWOS, And(TYPE, 0x200))) + // { + // Return package containing MWAIT C-states + // } + // Return package containing IO C-states + // } + // Return(Zero) + // + ACPI_METHOD * cst = current; + current = buildMethod(current, NAMESEG("_CST"), 0); + { + // "IF" CSEN -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength1 = current; + current = buildPackageLength(current, 0); + + // IF "(CSEN)" -- IF Predicate + current = buildNameSeg(current, NAMESEG("CSEN")); + + // "IF" (LAnd(MWOS, And(TYPE, 0x200))) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength2 = current; + current = buildPackageLength(current, 0); + + // IF ("LAnd"(MWOS, And(TYPE, 0x200))) -- LAND Opcode + current = buildOpCode(current, AML_LAND_OP); + + // IF (LAnd("MWOS", And(TYPE, 0x200))) -- MWOS Term + current = buildNameSeg(current, NAMESEG("MWOS")); + + // IF (LAnd(MWOS, "And"(TYPE, 0x200))) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (LAnd(MWOS, And("TYPE", 0x200))) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (LAnd(MWOS, And(TYPE, "0x200"))) -- DWORD Value Term + current = buildWordConst(current, 0x200); + + // IF (LAnd(MWOS, "And(TYPE, 0x200)")) -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build return package for mwait c-states + current = buildReturnPackageCST(current, mwait_pkg_cstates); + + setPackageLength(packageLength2, + (U8 *)current - (U8 *)packageLength2); + } + + // Build return package for io c-states + current = buildReturnPackageCST(current, io_pkg_cstates); + + setPackageLength(packageLength1, + (U8 *)current - (U8 *)packageLength1); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _CST method + setPackageLength(&cst->pkgLength, (U8 *)current - (U8 *)&cst->pkgLength); + + return(current); +} + +#if BUILD_ACPI_CSD +//----------------------------------------------------------------------------- +static void * buildCSD(void * current, U32 domain, U32 cpusInDomain, PKG_CSTATES * pkg_cstates) +{ + // If (And(TYPE, 0x0040)) + // { + // Return (CSD Package) + // } + // Return(Zero) + + ACPI_METHOD * csdMethod = current; + current = buildMethod(current, NAMESEG("_CSD"), 0); + { + // "IF" (And(TYPE, 0x0040)) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("And"(TYPE, 0x0040)) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (And("TYPE", 0x0040)) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (And(TYPE, "0x0040")) -- DWORD Value Term + current = buildDwordConst(current, 0x0040); + + // IF ("And(TYPE, 0x0040)") -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build return package containing CSD package(s) + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_cstates->num_cstates - 1); + + { + U32 cstateIndex; + for (cstateIndex=1; cstateIndex < pkg_cstates->num_cstates; cstateIndex++) + { + // Build CSD for this C-state + + // Create CSD package + ACPI_CSD_PACKAGE * csd = current; + current = csd + 1; + + setSmallPackage(&csd->package, 6); + csd->package.packageLength = (U8)(sizeof(ACPI_CSD_PACKAGE) - 1); + + setByteConst(&csd->NumberOfEntries, 6); + setByteConst(&csd->Revision, 0); + setDwordConst(&csd->Domain, domain); + setDwordConst(&csd->CoordType, ACPI_COORD_TYPE_HW_ALL); + setDwordConst(&csd->NumProcessors, cpusInDomain); + setDwordConst(&csd->Index, cstateIndex); + } + } + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _CSD method + setPackageLength(&csdMethod->pkgLength, (U8 *)current - (U8 *)&csdMethod->pkgLength); + + return(current); +} +#endif // BUILD_ACPI_CSD + +#if BUILD_ACPI_TSS +//----------------------------------------------------------------------------- +static void * buildTPC(void * current) +{ + ACPI_SMALL_METHOD * tpc = current; + current = buildSmallMethod(current, NAMESEG("_TPC"), 0); + + current = buildReturnZero(current); + + // Update package length in PPC object + tpc->packageLength = (U8) ( (U8 *)current - (U8 *)&tpc->packageLength ); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPTC(void * current) +{ + static const ACPI_GENERIC_ADDRESS ptc_gas[] = { + {0x7f,0x00,0,0,0}, + {0x7f,0x00,0,0,0}, + }; + + ACPI_SMALL_METHOD * ptc = current; + current = buildSmallMethod(current, NAMESEG("_PTC"), 0); + + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 2); + + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &ptc_gas[0]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &ptc_gas[1]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // Update package length in PTC object + ptc->packageLength = (U8)((U8 *)current - (U8 *)&ptc->packageLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildTSS(void * current, PKG_TSTATES * pkg_tstates) +{ + // + // IF (LAnd(TSEN, And(TYPE,4))) + // { + // Return (Package of Tstate Packages) + // } + // Return(Zero) + // + ACPI_METHOD * tss = current; + current = buildMethod(current, NAMESEG("_TSS"), 0); + + { + // "IF" (LAnd(TSEN, And(TYPE,4))) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("LAnd"(TSEN, And(TYPE, 4))) -- LAND Opcode + current = buildOpCode(current, AML_LAND_OP); + + // IF (LAnd("TSEN", And(TYPE, 4))) -- TSEN Term + current = buildNameSeg(current, NAMESEG("TSEN")); + + // IF (LAnd(TSEN, "And"(TYPE, 4))) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (LAnd(TSEN, And("TYPE", 4))) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (LAnd(TSEN, And(TYPE, "4"))) -- DWORD Value Term + current = buildWordConst(current, 4); + + // IF (LAnd(MWOS, "And(TYPE, 4)")) -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Return (Package of Tstate Packages) + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_tstates->num_tstates); + + // (3.3.3) For each T-state + { + U32 tstateIndex = 0; + for (tstateIndex=0; tstateIndex < pkg_tstates->num_tstates; tstateIndex++) + { + // (3.3.3.1) Create T-state package + ACPI_TSTATE_PACKAGE * tstate = current; + current = tstate + 1; + + setSmallPackage(&tstate->package, 5); + tstate->package.packageLength = (U8)(sizeof(ACPI_TSTATE_PACKAGE) - 1); + + setDwordConst(&tstate->FreqPercent, pkg_tstates->tstate[tstateIndex].freqpercent); + setDwordConst(&tstate->Power, pkg_tstates->tstate[tstateIndex].power); + setDwordConst(&tstate->TransLatency, pkg_tstates->tstate[tstateIndex].latency); + setDwordConst(&tstate->Control, pkg_tstates->tstate[tstateIndex].control); + setDwordConst(&tstate->Status, pkg_tstates->tstate[tstateIndex].status); + } // for + } // for block + + // (3.3.4) Update package length in return package + setPackageLength(&returnPkg->package.pkgLength, (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // "IF (LAnd(TSEN, And(TYPE,4))) and its body" -- Set package length + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Set package length for the _TSS object + setPackageLength(&tss->pkgLength, (U8 *)current - (U8 *)&tss->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildTSD(void * current, U32 domain, U32 cpusInDomain) +{ + // If (And(TYPE, 0x0080)) + // { + // Return (Package containing TSD package) + // } + // Return(Zero) + + ACPI_METHOD * tsdMethod = current; + current = buildMethod(current, NAMESEG("_TSD"), 0); + { + // "IF" (And(TYPE, 0x0080)) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("And"(TYPE, 0x0080)) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (And("TYPE", 0x0080)) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (And(TYPE, "0x0080")) -- DWORD Value Term + current = buildDwordConst(current, 0x0080); + + // IF ("And(TYPE, 0x0080)") -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build package containing TSD package + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 1); + + { + // Create PSD package + ACPI_TSD_PACKAGE * tsd = current; + current = tsd + 1; + + setSmallPackage(&tsd->package, 5); + tsd->package.packageLength = (U8)(sizeof(ACPI_TSD_PACKAGE) - 1); + + setByteConst(&tsd->NumberOfEntries, 5); + setByteConst(&tsd->Revision, 0); + setDwordConst(&tsd->Domain, domain); + setDwordConst(&tsd->CoordType, ACPI_COORD_TYPE_SW_ANY); + setDwordConst(&tsd->NumProcessors, cpusInDomain); + + } // TSD package + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _TSD method + setPackageLength(&tsdMethod->pkgLength, (U8 *)current - (U8 *)&tsdMethod->pkgLength); + + return(current); +} +#endif // BUILD_ACPI_TSS + +//----------------------------------------------------------------------------- +static U32 BuildSsdt(MADT_INFO * madt_info, ACPI_TABLE_DSDT *dsdt, void * buffer, U32 bufferSize, bool enable_cstates, bool enable_pstates, bool enable_tstates) +{ + // Build SSDT + { + // (1) Setup pointers to SSDT memory location + // (2) Create SSDT Definition Block + // (2.1) Save pointer to SSDT package length and checksum fields + // (2.2) Create variables in SSDT scope + // (3) For each logical processor CPUn + // (3.1) Create scope for CPUn + // (3.2) Create variables in CPU scope + // (3.3) Create _OSC and/or _PDC Methods + // (3.4) Create P-state related structures + // (3.4.1) Create _PSS Method + // (3.4.2) Create _PCT Object + // (3.4.3) Create _PPC Method + // (3.4.4) Create _PSD Object + // (3.5) Create C-state related structures + // (3.5.1) Create _CST Method + // (3.5.2) Create _CSD Method + // (3.6) Create T-state related structures (Optional) + // (3.6.1) Create _TPC Method + // (3.6.2) Create _PTC Method + // (3.6.3) Create _TSS Method + // (3.6.4) Create _TSD Method + // (3.7) Update length in CPUn Scope + // (4) Update length and checksum in SSDT Definition Block + DBG("Attempting to build SSDT\n"); + + U32 pstates_enabled = 0; + U32 cstates_enabled = 0; + CPU_DETAILS cpu; + cpu.max_ratio_as_mfg = 0; + cpu.package_power_limit = 0; + + U8 ACPI_COORD_TYPE = ACPI_COORD_TYPE_SW_ANY; // default + ACPI_TABLE_SSDT *SsdtPointer = (void*)0ul; + + // Desired state for providing alternate ACPI _CST structure using MWAIT + // extensions + // 1= Alternate _CST using MWAIT extension is enabled for OSPM use + // 0= Alternate _CST using MWAIT extension is disabled for OSPM use + bool enable_mwait = 1; + + // (1) Setup pointers to SSDT memory location + void * current = buffer; + void * end = (U8 *)buffer + bufferSize; + + // Confirm a valid SSDT buffer was provided + if (!buffer) + { + printf("Error: Invalid Buffer Address for SSDT\n"); + return(0); + } + + // Confirm a valid SSDT buffer length was provided + if (!bufferSize) + { + printf("Error: Invalid Buffer Length for SSDT\n"); + return(0); + } + + if (madt_info == (void*) 0ul) + { + return(0); + } + + if (dsdt == (void*) 0ul) + { + return(0); + } + + // Check that we have a valid cpu_map (if it's not already done, it will try to generate it) + if (generate_cpu_map_from_acpi(dsdt) != 0) + { + return(0); + } + + collect_cpu_info(&cpu); + + if (enable_cstates && pmbase) + { + DBG("Building Cstate Info\n"); + + cstates_enabled = BuildCstateInfo(&cpu, pmbase); + if (cstates_enabled) + { + getBoolForKey(KEnableMwait, &enable_mwait, &bootInfo->chameleonConfig); + } + } + + if (enable_pstates) + { + DBG("Building Pstate Info\n"); + + pstates_enabled = BuildPstateInfo(&cpu); + if (pstates_enabled) + { + const char *str = getStringForKey(KAcpiCoordType, &bootInfo->chameleonConfig); + U8 tmp = (U8)strtoul(str, NULL,16); + if ((tmp == ACPI_COORD_TYPE_SW_ALL) || (tmp == ACPI_COORD_TYPE_SW_ANY) || (tmp == ACPI_COORD_TYPE_HW_ALL) ) + { + ACPI_COORD_TYPE = tmp; + } + } + } +#if BUILD_ACPI_TSS + U32 tstates_enabled = 0; + if (enable_tstates) + { + DBG("Building Pstate Info\n"); + + tstates_enabled = BuildTstateInfo(&cpu); + } +#endif + + SsdtPointer = (ACPI_TABLE_SSDT *)buffer; + + // (2) Create SSDT Definition Block + // (2.1) Save pointer to SSDT package length and checksum fields + current = buildTableHeader(current, NAMESEG("SSDT"), NAMESEG64("PPM RCM ")); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3) For each logical processor CPUn + // We will use the dsdt datas in place of madt,for the cpu(s) detection. + // 'Cause most users use the dsdt table to change the numbers of cpu(s) that the OS and the bootloader should use, + // Note also that due to chameleon limit we use the same package per each cpu(s) for all objects and methods + // (package detection for each cpu(s) is still in progress) + { + U32 lapic_index; + for (lapic_index=0; lapic_index < cpu_map_count; lapic_index++) + { + // (3.1) Create scope for CPUn + ACPI_SCOPE * scope = current; + + { + DBG("Building CPU Scope\n"); + U32 cpu_namespace = (cpuNamespace == CPU_NAMESPACE_SB) ? NAMESEG("_SB_") : NAMESEG("_PR_"); + PROCESSOR_NUMBER_TO_NAMESEG * namepath = &cpu_map[lapic_index]; + current = buildCpuScope (current, cpu_namespace, namepath ); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.2) Create variables in CPU scope + DBG("Creating variables in CPU scope\n"); // Build Type variable used to store PDC capabilities + current = buildNamedDword(current, NAMESEG("TYPE"), 0); + + // Build PSEN variable used to store state of P-State Enable setup option + current = buildNamedDword(current, NAMESEG("PSEN"), pstates_enabled); + + // Build CSEN variable used to store state of C-State Enable setup option + current = buildNamedDword(current, NAMESEG("CSEN"), cstates_enabled); + + // Build MWOS variable used to store state of MWAIT OS setup option + current = buildNamedDword(current, NAMESEG("MWOS"), (U32)(enable_mwait&&cpu.mwait_supported)); + + // (3.3) Create _OSC and/or _PDC Methods + { + // Build _PDC method + DBG("Building PDC method\n"); + current = buildPDC(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // Build _OSC method + DBG("Building _OSC method\n"); + current = buildOSC(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + } + + // (3.4) Create P-state related structures + if (pstates_enabled == 1) + { + // (3.4.1) Create _PSS Method + { + DBG("Building _PSS method\n"); + PKG_PSTATES * pkg_pstates = &cpu.pkg_pstates; + current = buildPSS(current, pkg_pstates); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.4.2) Create _PCT Object + DBG("Building _PCT Object\n"); + current = buildPCT(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.4.3) Create _PPC Method + DBG("Building _PPC Method\n"); + current = buildPPC(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.4.4) Create PSD with hardware coordination + { + DBG("Building _PSD Method\n"); + U32 domain = madt_info->lapic[lapic_index].pkg_index; + + // In this (bad?) implementation we use the nb of cpu found in the dsdt + U32 cpusInDomain = cpu_map_count; + current = buildPSD(current, domain, cpusInDomain, ACPI_COORD_TYPE); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + } + + // (3.5) Create C-state related structures + if (cstates_enabled == 1) + { + { + PKG_CSTATES * mwait_pkg_cstates = &cpu.pkg_mwait_cstates; + PKG_CSTATES * io_pkg_cstates = &cpu.pkg_io_cstates; + + // Build CST + DBG("Building _CST Method\n"); + current = buildCST(current, mwait_pkg_cstates, io_pkg_cstates); + } + +#if BUILD_ACPI_CSD + { + // Use core_apic_id as domain + U32 domain = lapic->core_apic_id; + + // In this (bad?) implementation we use the nb of cpu found in the dsdt + U32 cpusInDomain = cpu_map_count; + + // Create CSD + current = buildCSD(current, domain, cpusInDomain, io_pkg_cstates); + } +#endif + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + } +#if BUILD_ACPI_TSS + // (3.6) Create T-state related structures + if (tstates_enabled == 1) + { + // (3.6.1) Create _TPC Method + current = buildTPC(current); + + // (3.6.2) Create _PTC Method + current = buildPTC(current); + + // (3.6.3) Create _TSS Method + { + PKG_TSTATES * pkg_tstates = &cpu.pkg_tstates; + current = buildTSS(current, pkg_tstates); + } + + // (3.6.4) Create _TSD Method + { + LAPIC_INFO * lapic = &madt_info.lapic[lapic_index]; + + // Use core_apic_id as domain + U32 domain = lapic->core_apic_id; + + // In this (bad?) implementation we use the nb of cpu found in the dsdt + U32 cpusInDomain = cpu_map_count; + + current = buildTSD(current, domain, cpusInDomain); + } + } +#endif + // (3.7) Update length in CPUn Scope + setPackageLength(&scope->pkgLength, (U8 *)current - (U8 *)&scope->pkgLength); + + } // End for + + // (4) Update length and checksum in SSDT Definition Block + { + DBG("Updating length and checksum in SSDT Definition Block\n"); + + SsdtPointer->Header.Length = (U8 *)current - (U8 *)SsdtPointer; + SetChecksum(&SsdtPointer->Header); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + } // End build SSDT + + } // SSDT + + return(1); +} + +#if UNUSED +static ACPI_TABLE_FACS* generate_facs(bool updatefacs ) +{ + ACPI_TABLE_FACS* facs_mod=(ACPI_TABLE_FACS *)AllocateKernelMemory(sizeof(ACPI_TABLE_FACS)); + if (!facs_mod) + { + printf("Unable to allocate kernel memory for facs mod\n"); + return (void*)0ul; + } + bzero(facs_mod, sizeof(ACPI_TABLE_FACS)); + + ACPI_TABLE_FACS * FacsPointer =(acpi_tables.FacsPointer64 != (void *)0ul) ? + (ACPI_TABLE_FACS *)acpi_tables.FacsPointer64 : (ACPI_TABLE_FACS *)acpi_tables.FacsPointer; + + memcpy(facs_mod, FacsPointer , FacsPointer->Length); + facs_mod->Length = sizeof(ACPI_TABLE_FACS); + + if (FacsPointer->Length < sizeof(ACPI_TABLE_FACS)) + { + facs_mod->FirmwareWakingVector = 0; + facs_mod->GlobalLock = 0; + facs_mod->Flags = 0; + } + + if (updatefacs && FacsPointer->Version < 2) + { + if (FacsPointer->Version > 0) + { + facs_mod->XFirmwareWakingVector = FacsPointer->XFirmwareWakingVector; + } + else + { + facs_mod->XFirmwareWakingVector = (U64)facs_mod->FirmwareWakingVector; + } + + facs_mod->Version = 2; /* ACPI 1.0: 0, ACPI 2.0/3.0: 1, ACPI 4.0: 2 */ + + } + + return facs_mod; +} +#endif + +static ACPI_GENERIC_ADDRESS FillGASStruct(U32 Address, U8 Length) +{ + ACPI_GENERIC_ADDRESS TmpGAS; + + TmpGAS.SpaceId = 1; /* I/O Address */ + + if (Address == 0) + { + TmpGAS.BitWidth = 0; + } + else + { + TmpGAS.BitWidth = Length * 8; + } + + TmpGAS.BitOffset = 0; + TmpGAS.AccessWidth = 0; /* Not set for Legacy reasons... */ + TmpGAS.Address = (U64)Address; + + return (TmpGAS); +} + +static ACPI_TABLE_FADT * +patch_fadt(ACPI_TABLE_FADT *fadt, ACPI_TABLE_DSDT *new_dsdt, bool UpdateFADT) +{ + ACPI_TABLE_FADT *fadt_mod = (void*)0; + bool fadt_rev2_needed = false; + bool fix_restart = false; + const char * value; + + // Restart Fix + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) + { + fix_restart = true; + getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig); + + } else { + verbose ("Not an Intel platform: Restart Fix disabled !!!\n"); + } + + if (fix_restart) + fadt_rev2_needed = true; + + // Allocate new fadt table + if (UpdateFADT) + { + if (fadt->Header.Length < 0xF4) + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(0xF4); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + bzero(fadt_mod, 0xF4); + memcpy(fadt_mod, fadt, fadt->Header.Length); + fadt_mod->Header.Length = 0xF4; + + } + else + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(fadt->Header.Length); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + memcpy(fadt_mod, fadt, fadt->Header.Length); + } + + + //fadt_mod->Header.Revision = 0x04; // FADT rev 4 + fadt_mod->ResetRegister = FillGASStruct(0, 0); + fadt_mod->ResetValue = 0; + fadt_mod->Reserved4[0] = 0; + fadt_mod->Reserved4[1] = 0; + fadt_mod->Reserved4[2] = 0; + + fadt_mod->XPm1aEventBlock = FillGASStruct(fadt_mod->Pm1aEventBlock, fadt_mod->Pm1EventLength); + fadt_mod->XPm1bEventBlock = FillGASStruct(fadt_mod->Pm1bEventBlock, fadt_mod->Pm1EventLength); + fadt_mod->XPm1aControlBlock = FillGASStruct(fadt_mod->Pm1aControlBlock, fadt_mod->Pm1ControlLength); + fadt_mod->XPm1bControlBlock = FillGASStruct(fadt_mod->Pm1bControlBlock, fadt_mod->Pm1ControlLength); + fadt_mod->XPm2ControlBlock = FillGASStruct(fadt_mod->Pm2ControlBlock, fadt_mod->Pm2ControlLength); + fadt_mod->XPmTimerBlock = FillGASStruct(fadt_mod->PmTimerBlock, fadt_mod->PmTimerLength); + fadt_mod->XGpe0Block = FillGASStruct(fadt_mod->Gpe0Block, fadt_mod->Gpe0BlockLength); + fadt_mod->XGpe1Block = FillGASStruct(fadt_mod->Gpe1Block, fadt_mod->Gpe1BlockLength); + if (fadt->Header.Revision < 4) + { + fadt_mod->Header.Revision = 0x04; // FADT rev 4 + verbose("Converted ACPI V%d FADT to ACPI V4 FADT\n", fadt->Header.Revision); + + } + } + else + { + + if (fadt_rev2_needed) + { + if (fadt->Header.Length < 0x84 ) + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(0x84); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + bzero(fadt_mod, 0x84); + memcpy(fadt_mod, fadt, fadt->Header.Length); + fadt_mod->Header.Length = 0x84; + } + else + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(fadt->Header.Length); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + memcpy(fadt_mod, fadt, fadt->Header.Length); + } + + if (fadt->Header.Revision < 2) + { + fadt_mod->Header.Revision = 0x02; // FADT rev 2 (ACPI 1.0B MS extensions) + verbose("Converted ACPI V%d FADT to ACPI V2 FADT\n", fadt->Header.Revision ); + } + } + else + { + if (fadt->Header.Length < 0x74 ) + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(0x74); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + bzero(fadt_mod, 0x74); + memcpy(fadt_mod, fadt, fadt->Header.Length); + fadt_mod->Header.Length = 0x74; + fadt_mod->Header.Revision = 0x01; + verbose("Warning: ACPI FADT length was < 0x74 which is the minimum for the ACPI FADT V1 specification, \n", fadt->Header.Revision ); + verbose(" trying to convert it to Version 1. \n"); + + } + else + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(fadt->Header.Length); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + memcpy(fadt_mod, fadt, fadt->Header.Length); + } + } + } + bool intelfadtspec = true; + U8 Type = PMProfileError; + // Determine system type / PM_Model + + // Fix System-type if needed (should never happen) + if (Platform.Type > MaxSupportedPMProfile) + { + if(fadt_mod->PreferredProfile <= MaxSupportedPMProfile) + Platform.Type = fadt_mod->PreferredProfile;// get the fadt if correct + else + Platform.Type = 1; /* Set a fixed value (Desktop) */ + } + + // If needed, set System-type from PM_Profile (if valid) else set PM_Profile with a fixed the System-type + // Give prior to the FADT pm profile, allow to also control this value with a patched FADT table + if (fadt_mod->PreferredProfile != Platform.Type) + { + bool val = false; + getBoolForKey("PreferInternalProfileDetect", &val, &bootInfo->chameleonConfig); // if true Give prior to the profile resolved trought the CPU model + + //val = get_env(envIsServer) ; + + if (fadt_mod->PreferredProfile <= MaxSupportedPMProfile && !val) + { + Platform.Type = fadt_mod->PreferredProfile; + } + else + { + fadt_mod->PreferredProfile = (U8)Platform.Type; + } + + } + + // Set PM_Profile and System-type if user wanted this value to be forced + if ( (value=getStringForKey("SystemType", &bootInfo->chameleonConfig))!=NULL) + { + if ((Type = (unsigned char) strtoul(value, NULL, 10) ) <= MaxSupportedPMProfile) + { + if (fadt_mod->PreferredProfile != Type) + { + verbose("FADT: changing Preferred_PM_Profile from %d to %d\n", fadt->PreferredProfile, Type); + + Platform.Type = (fadt_mod->PreferredProfile = Type); + } + else + { + DBG("FADT: Preferred_PM_Profile was already set to %d, no need to be changed\n",Type); + } + + } else printf("Error: system-type must be 0..6. Defaulting to %d !\n", (U8)Platform.Type); + } + + getBoolForKey(KIntelFADT, &intelfadtspec, &bootInfo->chameleonConfig); + if ((pmbase == 0) && (cpu_map_error == 0) && (intelfadtspec == true)) + { + ACPI_TABLE_DSDT *DsdtPointer ; + if (new_dsdt != (void*)0ul) + DsdtPointer = new_dsdt; + else if ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0ul)) + DsdtPointer = (ACPI_TABLE_DSDT *)((U32)fadt_mod->XDsdt); + else + DsdtPointer = (ACPI_TABLE_DSDT *)fadt_mod->Dsdt; + + generate_cpu_map_from_acpi(DsdtPointer); + } + + // Patch DSDT Address if we have loaded a DSDT table + if(new_dsdt != (void*)0ul) + fadt_mod->Dsdt=(U32)new_dsdt; + + fadt_mod->Facs= fadt->Facs; + //fadt_mod->Facs=(U32)generate_facs(false); + + // Patch FADT to fix restart + if (fadt_mod->Header.Revision >= 2 && fix_restart) + { + fadt_mod->Flags|= 0x400; + + int type = PCI_RESET_TYPE; + getIntForKey(KResetType, &type, &bootInfo->chameleonConfig); + if (type == KEYBOARD_RESET_TYPE) + { + //Azi: keyboard reset; http://forum.voodooprojects.org/index.php/topic,1056.msg9802.html#msg9802 + fadt_mod->ResetRegister = FillGASStruct(0x64, 1); + fadt_mod->ResetValue = 0xfe; + } + else + { + fadt_mod->ResetRegister = FillGASStruct(0x0cf9, 1); + fadt_mod->ResetValue = 0x06; + } + verbose("FADT: Restart Fix applied (Type : %s) !\n", (type == 0) ? "PCI": "KEYBOARD"); + } + + if (fadt_mod->Header.Revision >= 3) + { + + + if (UpdateFADT) + { + + //fadt_mod->XFacs= (U64)((U32)generate_facs(true)); + fadt_mod->XFacs=(U64)fadt->Facs; + + } + else + { + fadt_mod->XFacs=(U64)fadt->XFacs; + } + + + if(new_dsdt != (void*)0ul) + fadt_mod->XDsdt=((U64)(U32)new_dsdt); + else if (UpdateFADT) + fadt_mod->XDsdt=(U64)fadt_mod->Dsdt; + + + //safe_set_env(envHardwareSignature,((ACPI_TABLE_FACS *)((U32)fadt_mod->XFacs))->HardwareSignature); + + + } +#if 0 + else + { + + safe_set_env(envHardwareSignature,((ACPI_TABLE_FACS *)fadt_mod->Facs)->HardwareSignature); + + } + + + DBG("setting hardware_signature to %x \n",(U32)get_env(envHardwareSignature)); +#endif + + + + if (pmbase && (intelfadtspec == true)) + ProcessFadt(fadt_mod, pmbase); // The checksum correction will be done by ProcessFadt + else + SetChecksum(&fadt_mod->Header); // Correct the checksum + + return fadt_mod; +} + +static U32 process_xsdt (ACPI_TABLE_RSDP *rsdp_mod , U32 *new_table_list) +{ + TagPtr DropTables_p = 0; + int DropTables_tag_count = 0; + + if (bootInfo->chameleonConfig.dictionary) + { + DropTables_p = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"ACPIDropTables")); + if (DropTables_p) DropTables_tag_count = XMLTagCount(DropTables_p) ; + } + + U32 new_table = 0ul; + U8 new_table_index = 0, table_added = 0; + ACPI_TABLE_XSDT *xsdt = (void*)0ul, *xsdt_mod = (void*)0ul; + ACPI_TABLE_RSDT *rsdt_conv = (void *)0ul; + + // FIXME: handle 64-bit address correctly + + xsdt=(ACPI_TABLE_XSDT *)acpi_tables.XsdtPointer; + + verbose("* Processing XSDT: \n"); + + DBG(" XSDT @%x, Length=%d\n", (U32)xsdt, + xsdt->Header.Length); + + if (xsdt != (void *)0ul) + { + U32 dropoffset=0, index; + table_added = 0; + + xsdt_mod=(ACPI_TABLE_XSDT *)AllocateKernelMemory(xsdt->Header.Length); + if (!xsdt_mod) + { + printf("Unable to allocate kernel memory for xsdt mod\n"); + return (0); + } + bzero(xsdt_mod, xsdt->Header.Length); + memcpy(&xsdt_mod->Header, &xsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + U32 num_tables=get_num_tables64(xsdt); + + for (index = 0; index < num_tables; index++) + { + + U64 ptr = xsdt->TableOffsetEntry[index]; + + { + if (ptr > ULONG_MAX) + { +#if DEBUG_ACPI + printf("Warning xsdt->TableOffsetEntry[%d]: Beyond addressable memory in this CPU mode, ignored !!!\n",index); +#endif + continue; + } + + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(((ACPI_TABLE_HEADER *) (unsigned long)ptr), + ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning xsdt->TableOffsetEntry[%d]: Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + xsdt_mod->TableOffsetEntry[index-dropoffset]=ptr; + + char tableSig[5]; + strlcpy(tableSig, (char*)((U32)ptr), sizeof(tableSig)); + + DBG("** Processing %s,", tableSig ); + + DBG(" @%x, Length=%d\n", (U32)ptr, + ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length); + + { + bool oem = false; + char oemOption[OEMOPT_SIZE]; + sprintf(oemOption, "oem%s",tableSig ); + if (getBoolForKey(oemOption, &oem, &bootInfo->chameleonConfig) && oem) // This method don't work for DSDT and FACS + { + + DBG(" %s required\n", oemOption); + + if (get_new_table_in_list(new_table_list,(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature), &new_table_index) != (void*)0ul) + new_table_list[new_table_index] = 0ul; // This way new table will not be added to the new rsdt list !! + + continue; + } + } + + if ((DropTables_tag_count > 0) && DropTables_p) + { + TagPtr match_drop = XMLGetProperty(DropTables_p, (const char*)tableSig); + if ( match_drop ) + { + char *tmp = XMLCastString(match_drop); + if (tmp && (strcmp(tmp,"No") != 0)) + { + dropoffset++; + DBG(" %s table dropped\n",tableSig); + continue; + } + } + } + + { + if ((new_table = (U32)get_new_table_in_list(new_table_list,(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature), &new_table_index)) != 0ul) + { + DBG(" Found replacement for table %s\n",tableSig); + xsdt_mod->TableOffsetEntry[index-dropoffset]=(U64)new_table; + new_table_list[new_table_index] = 0ul; // table replaced !! + continue; + } + } + + } + + + { + U8 i; + for (i = 0; i< (MAX_ACPI_TABLE + RESERVED_AERA); i++) + { + if (new_table_list[i] != 0ul) + { +#if DEBUG_ACPI + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + printf("Adding table : "); + print_nameseg(*(U32 *) (table_array[i]->Signature)); + printf("\n"); +#endif + xsdt_mod->TableOffsetEntry[index-dropoffset]=(U64)new_table_list[i]; + table_added++; + index++; + } + } + } + + // Correct the checksum of XSDT + xsdt_mod->Header.Length-=8*dropoffset; + xsdt_mod->Header.Length+=8*table_added; + + SetChecksum(&xsdt_mod->Header); + + update_rsdp_with_xsdt(rsdp_mod, xsdt_mod); + + verbose("* Creating new RSDT from XSDT table\n"); + + rsdt_conv = (ACPI_TABLE_RSDT *)gen_alloc_rsdt_from_xsdt(xsdt_mod); + + if (rsdt_conv != (void*)0ul) + { +#if DEBUG_ACPI + DBG("Attempting to update RSDP with RSDT \n"); + { + U32 ret = update_rsdp_with_rsdt(rsdp_mod, rsdt_conv); + if (ret) + DBG("RSDP update with RSDT successfully !!! \n"); + } +#else + update_rsdp_with_rsdt(rsdp_mod, rsdt_conv); +#endif + } + + } + else + { + DBG("About to drop XSDT\n"); + + /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT. + * A Better strategy would be to generate + */ + + rsdp_mod->XsdtPhysicalAddress=0xffffffffffffffffLL; + verbose("XSDT not found or XSDT incorrect\n"); + } + return (1); + +} + +static U32 process_rsdt(ACPI_TABLE_RSDP *rsdp_mod , bool gen_xsdt, U32 *new_table_list) +{ + TagPtr DropTables_p = 0; + int DropTables_tag_count = 0; + + if (bootInfo->chameleonConfig.dictionary) + { + DropTables_p = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"ACPIDropTables")); + if (DropTables_p) DropTables_tag_count = XMLTagCount(DropTables_p) ; + } + + U32 new_table = 0ul; + U8 new_table_index = 0, table_added = 0; + U32 dropoffset=0, index; + ACPI_TABLE_RSDT *rsdt = (void *)0ul, *rsdt_mod = (void *)0ul; + ACPI_TABLE_XSDT *xsdt_conv = (void *)0ul; + + rsdt=(ACPI_TABLE_RSDT *)acpi_tables.RsdtPointer; + + rsdt_mod=(ACPI_TABLE_RSDT *)AllocateKernelMemory(rsdt->Header.Length); + + if (!rsdt_mod) + { + printf("Unable to allocate kernel memory for rsdt mod\n"); + return (0); + } + + bzero(rsdt_mod, rsdt->Header.Length); + memcpy (&rsdt_mod->Header, &rsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + // Compute number of table pointers included in RSDT + U32 num_tables = get_num_tables(rsdt); + + verbose("* Processing RSDT: \n"); + + DBG(" RSDT @%x, Length %d\n",rsdt, rsdt->Header.Length); + + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) rsdt->TableOffsetEntry; + + for (index = 0; index < num_tables; index++) + { + + { + + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(table_array[index], table_array[index]->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning rsdt->TableOffsetEntry[%d]: Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + rsdt_mod->TableOffsetEntry[index-dropoffset]=rsdt->TableOffsetEntry[index]; + + char tableSig[5]; + strlcpy(tableSig, (char*)(rsdt->TableOffsetEntry[index]), sizeof(tableSig)); + + DBG("** Processing %s,", tableSig ); + + DBG(" @%x, Length=%d\n", (U32)table_array[index], + table_array[index]->Length); + + { + bool oem = false; + char oemOption[OEMOPT_SIZE]; + sprintf(oemOption, "oem%s",tableSig ); + if (getBoolForKey(oemOption, &oem, &bootInfo->chameleonConfig) && oem) // This method don't work for DSDT and FACS + { + DBG(" %s required\n", oemOption); + + if (get_new_table_in_list(new_table_list,(*(U32 *) (table_array[index]->Signature)), &new_table_index) != (void*)0ul ) + new_table_list[new_table_index] = 0ul; // This way new table will not be added to the new rsdt list !! + + continue; + } + } + + if ((DropTables_tag_count > 0) && DropTables_p) + { + TagPtr match_drop = XMLGetProperty(DropTables_p, (const char*)tableSig); + if ( match_drop ) + { + char *tmp = XMLCastString(match_drop); + if (strcmp(tmp,"No") != 0) + { + dropoffset++; + DBG(" %s table dropped\n",tableSig); + continue; + } + } + } + + { + if ((new_table = (U32)get_new_table_in_list(new_table_list,(*(U32 *) (table_array[index]->Signature)), &new_table_index)) != 0ul) + { + DBG(" Found replacement for table %s\n",tableSig); + + rsdt_mod->TableOffsetEntry[index-dropoffset]=new_table; + new_table_list[new_table_index] = 0ul; // table replaced !! + continue; + } + } + + } + DBG("\n"); + + { + U8 i; + for (i = 0; i< (MAX_ACPI_TABLE + RESERVED_AERA); i++) + { + if (new_table_list[i] != 0ul) + { +#if DEBUG_ACPI + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + printf("Adding table : "); + print_nameseg(*(U32 *) (table_array[i]->Signature)); + printf("\n"); +#endif + rsdt_mod->TableOffsetEntry[index-dropoffset]=new_table_list[i]; + table_added++; + index++; + } + } + } + + // Correct the checksum of RSDT + rsdt_mod->Header.Length-=4*dropoffset; + rsdt_mod->Header.Length+=4*table_added; + + DBG("RSDT: Original checksum %d\n", rsdt_mod->Header.Checksum); + + SetChecksum(&rsdt_mod->Header); + + DBG("New checksum %d at %x\n", rsdt_mod->Header.Checksum,rsdt_mod); + + update_rsdp_with_rsdt(rsdp_mod, rsdt_mod); + + if (gen_xsdt) + { + verbose("* Creating new XSDT from RSDT table\n"); + xsdt_conv = (ACPI_TABLE_XSDT *)gen_alloc_xsdt_from_rsdt(rsdt_mod); + + if (xsdt_conv != (void *)0ul ) + { +#if DEBUG_ACPI + DBG("Attempting to update RSDP with XSDT \n"); + { + U32 ret = update_rsdp_with_xsdt(rsdp_mod, xsdt_conv); + if (ret) + DBG("RSDP update with XSDT successfully !!! \n"); + } +#else + update_rsdp_with_xsdt(rsdp_mod, xsdt_conv); +#endif + + } + + } + return (1); +} + +EFI_STATUS setup_Acpi(void) +{ + U8 Revision = 0; + + cpu_map_error = 0; + cpu_map_count = 0; + pmbase = 0; + + EFI_STATUS Status = EFI_ABORTED; + + U32 new_table_list[MAX_ACPI_TABLE + RESERVED_AERA]; //max table + reserved aera + U8 new_table_index = 0; + + ACPI_TABLE_DSDT* DsdtPtr = (void *)0ul; // a Pointer to the dsdt table present in fadt_mod + + ACPI_TABLE_DSDT *new_dsdt = (void *)0ul; // a Pointer to the dsdt file + ACPI_TABLE_FADT *fadt_mod = (void *)0ul; // a Pointer to the patched FACP table + ACPI_TABLE_FADT *fadt_file = (void *)0ul; // a Pointer to the (non-patched) fadt file + ACPI_TABLE_FADT *FacpPointer = (void *)0ul; // a Pointer to the non-patched FACP table, it can be a file or the FACP table found in the RSDT/XSDT + ACPI_TABLE_RSDP *rsdp_mod = (void *)0ul, *rsdp_conv = (void *)0ul; + + U32 rsdplength; + + bool update_acpi=false, gen_xsdt=false; + + bool gen_csta=false, gen_psta=false, speed_step=false; + bool gen_ssdt=false; // will force to generate ssdt even if gen_csta and gen_psta = false + bool gen_tsta=false; + bool oem_dsdt=false, oem_fadt=false; + + // Find original rsdp + if (!FindAcpiTables(&acpi_tables)) + { + printf("Error: AcpiCodec Failed to detect ACPI tables.\n"); + getchar(); + return EFI_NOT_FOUND; + } + + { + U8 i; + + for (i=0; i<(MAX_ACPI_TABLE + RESERVED_AERA); i++) + { + new_table_list[i] = 0ul; + } + bool tmpval; + + oem_dsdt=getBoolForKey(kOEMDSDT, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + oem_fadt=getBoolForKey(kOEMFADT, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + + gen_csta=getBoolForKey(kGenerateCStates, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + gen_psta=getBoolForKey(kGeneratePStates, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + gen_ssdt=getBoolForKey(KForceSSDT, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + update_acpi=getBoolForKey(kUpdateACPI, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + + speed_step=getBoolForKey(kSpeedstep, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + turbo_enabled=(U32)getBoolForKey(kCoreTurbo, &tmpval, &bootInfo->chameleonConfig)&&tmpval; +#if BUILD_ACPI_TSS + gen_tsta=(U32)getBoolForKey(kGenerateTStates, &tmpval, &bootInfo->chameleonConfig)&&tmpval; +#endif + checkOem=getBoolForKey(kOnlySignedAml, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } + + { + long ret, length, flags, time; + long long index = 0; + const char * name; + + U8 i = 0; + char dirspec[512]; + bool acpidir_found = false; + + ret = GetFileInfo("rd(0,0)/Extra/", "Acpi", &flags, &time); + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) + { + sprintf(dirspec, "rd(0,0)/Extra/Acpi/"); + acpidir_found = true; + + } + else + { + + ret = GetFileInfo("/Extra/", "Acpi", &flags, &time); + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) + { + sprintf(dirspec, "/Extra/Acpi/"); + acpidir_found = true; + + } + else + { + ret = GetFileInfo("bt(0,0)/Extra/", "Acpi", &flags, &time); + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) + { + sprintf(dirspec, "bt(0,0)/Extra/Acpi/"); + acpidir_found = true; + + } + } + } + + if (acpidir_found == true) + { +#if ACPISGN + if (checkOem == true) + { + MakeAcpiSgn(); + } +#endif + + while (1) { + ret = GetDirEntry(dirspec, &index, &name, &flags, &time); + if (ret == -1) break; +#if DEBUG_ACPI + printf("testing %s\n", name); +#endif + // Make sure this is a directory. + if ((flags & kFileTypeMask) == kFileTypeDirectory) continue; + + // Make sure this is a kext. + length = strlen(name); + if (strcmp(name + length - 4, ".aml")) + { +#if DEBUG_ACPI + printf("Ignoring %s\n", name); +#endif + continue; + } + + // Some simple verifications to save time in case of those tables simply named as follow: + if ((strncmp(name, "RSDT", 4) == 0) || (strncmp(name, "rsdt", 4) == 0) || + (strncmp(name, "XSDT", 4) == 0) || (strncmp(name, "xsdt", 4) == 0) || + (strncmp(name, "RSDP", 4) == 0) || (strncmp(name, "rsdp", 4) == 0)) + { +#if DEBUG_ACPI + printf("Ignoring %s\n", name); +#endif + continue; + } + + if ((strncmp(name, "FACS", 4) == 0) || (strncmp(name, "facs", 4) == 0)) // FACS is not supported + { +#if DEBUG_ACPI + printf("Ignoring %s\n", name); +#endif + continue; + } + + DBG("* Attempting to load acpi table: %s\n", name); + if ( (new_table_list[i]=(U32)loadACPITable(new_table_list,dirspec,name))) + { + if (i < MAX_ACPI_TABLE) + { + i++; + } + else + { + DBG("Max nb of allowed aml files reached, exiting ."); + break; + } + } + } + + if (i) + { + //sanitize the new tables list + sanitize_new_table_list(new_table_list); + + //move to kernel memory + move_table_list_to_kmem(new_table_list); + + DBG("New ACPI tables Loaded in memory\n"); + } + + + } + + } +#if HARDCODED_DSDT + do { +#include "dsdt_PRLSACPI.h" + + U8 index = 0; + + if ((get_new_table_in_list(new_table_list, NAMESEG("DSDT"), &new_table_index)) != (void*)0ul ) + { + index = new_table_index; + } + else + { + U8 empty = get_0ul_index_in_list(new_table_list, false); + if (empty != ACPI_TABLE_LIST_FULL_NON_RESERVED) + { + index = empty; + } + else + { + printf("Error: not enought reserved space in the new acpi list for the Harcoded DSDT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + + break; + } + } + + if (index) + { + + ACPI_TABLE_DSDT *tmp = (ACPI_TABLE_DSDT *)DsdtAmlCode; + ACPI_TABLE_DSDT *hardcoded_dsdt = (void *)0ul; + + hardcoded_dsdt = (ACPI_TABLE_DSDT *)AllocateKernelMemory(tmp->Header.Length); + memcpy(hardcoded_dsdt, tmp, tmp->Header.Length); + new_table_list[index] = (U32)hardcoded_dsdt; // add the patched table to the list + } + else + { + printf("Error: not enought reserved space in the new acpi list for the Harcoded DSDT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + + break; + } + } while (0); +#endif + if (speed_step) + { + gen_psta= true; + gen_csta= true; + } + + + ACPI_TABLE_RSDP *rsdp=(ACPI_TABLE_RSDP *)acpi_tables.RsdPointer; + + if (rsdp == (void*)0ul || (GetChecksum(rsdp, (rsdp->Revision == 0) ? ACPI_RSDP_REV0_SIZE:sizeof(ACPI_TABLE_RSDP)) != 0) ) + { + printf("Error : ACPI RSD PTR Revision %d checksum is incorrect or table not found \n",rsdp->Revision ); + return EFI_UNSUPPORTED; + } + + if ((update_acpi) && (rsdp->Revision == 0)) + { + + rsdp_conv = (ACPI_TABLE_RSDP *)gen_alloc_rsdp_v2_from_v1(rsdp); + if (rsdp_conv != (void *)0ul) + { + gen_xsdt = true; + rsdp = rsdp_conv; + verbose("Converted ACPI RSD PTR Revision 0 to Revision 2\n"); + } + + } + + Revision = rsdp->Revision ; + rsdplength=(Revision == 2)?rsdp->Length:ACPI_RSDP_REV0_SIZE; + + DBG("RSDP Revision %d found @%x. Length=%d\n",Revision,rsdp,rsdplength); + + if (gen_xsdt) + { + rsdp_mod=rsdp_conv; + } + else + { + rsdp_mod=(ACPI_TABLE_RSDP *) AllocateKernelMemory(rsdplength); + + if (!rsdp_mod) return EFI_OUT_OF_RESOURCES; + + memcpy(rsdp_mod, rsdp, rsdplength); + } + + + if ((fadt_file = (ACPI_TABLE_FADT *)get_new_table_in_list(new_table_list, NAMESEG("FACP"), &new_table_index)) != (void *)0ul) + { + + if (oem_fadt == false) + FacpPointer = (ACPI_TABLE_FADT *)fadt_file; + + new_table_list[new_table_index] = 0ul; // This way, the non-patched table will not be added in our new rsdt/xsdt table list + + } else + FacpPointer = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + +#if DEBUG_ACPI + if ((FacpPointer != (void *)0ul) || (oem_fadt == false)) + { + printf("FADT found @%x, Length %d\n",FacpPointer, FacpPointer->Header.Length); + printf("Attempting to patch FADT entry of %s\n",(acpi_tables.FacpPointer64 != (void *)0ul) ? ACPI_SIG_XSDT : ACPI_SIG_RSDT); + } + else if (oem_fadt == true) + { + ACPI_TABLE_FADT * FacpPtr = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + + printf("FADT found @%x ( Length %d ) in %s \n",FacpPtr, FacpPtr->Header.Length, (acpi_tables.FacpPointer64 != (void *)0ul) ? ACPI_SIG_XSDT : ACPI_SIG_RSDT); + } +#endif + + if ((new_dsdt = (ACPI_TABLE_DSDT *)get_new_table_in_list(new_table_list, NAMESEG("DSDT"), &new_table_index)) != (void*)0ul ) + { + new_table_list[new_table_index] = 0ul; // This way, the DSDT file will not be added in our new rsdt/xsdt table list, and it shouldn't be anyway + } + + if (oem_fadt == false) + { + + fadt_mod = patch_fadt(FacpPointer, (oem_dsdt == false) ? new_dsdt : (void*)0ul , (acpi_tables.FacpPointer64 != (void *)0ul )); + + if (fadt_mod != (void*)0ul) + { + DsdtPtr = ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0)) ? (ACPI_TABLE_DSDT*)((U32)fadt_mod->XDsdt):(ACPI_TABLE_DSDT*)fadt_mod->Dsdt; + + U8 empty = get_0ul_index_in_list(new_table_list,true); + if (empty != ACPI_TABLE_LIST_FULL) + { + new_table_list[empty] = (U32)fadt_mod; // add the patched table to the list + } + else + { + printf("Error: not enought reserved space in the new acpi list for the Patched FACP table,\n "); + printf(" please increase the RESERVED_AERA\n"); + } + + } + else + { + printf("Error: Failed to patch the FADT Table, trying fallback to the FADT original pointer\n"); + fadt_mod = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + + DsdtPtr = ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0)) ? (ACPI_TABLE_DSDT*)((U32)fadt_mod->XDsdt):(ACPI_TABLE_DSDT*)fadt_mod->Dsdt; + + U8 empty = get_0ul_index_in_list(new_table_list,true); + if (empty != ACPI_TABLE_LIST_FULL) + { + new_table_list[empty] = (U32)fadt_mod; + } + else + { + printf("Error: not enought reserved space in the new acpi list for the FACP table,\n "); + printf(" please increase the RESERVED_AERA\n"); + } + } + + if (oem_dsdt == false) + { + if (generate_cpu_map_from_acpi(DsdtPtr) == 0) + { + U8 new_uid = (U8)getPciRootUID(); + + /* WARNING: THIS METHOD WORK PERFECTLY BUT IT CAN RESULT TO AN INCORRECT CHECKSUM */ + + if (ProcessDsdt(DsdtPtr, UIDPointer, new_uid)) + { + printf("PCI0 _UID patched to %d in the DSDT table\n", new_uid); + } + + } + } + + + } + else + { + + // here we use the variable fadt_mod only for SSDT Generation + + fadt_mod = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + + DsdtPtr = ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0)) ? (ACPI_TABLE_DSDT*)((U32)fadt_mod->XDsdt) + :(ACPI_TABLE_DSDT*)fadt_mod->Dsdt; + } + + { + MADT_INFO madt_info; + bool strip_madt = true; + + getBoolForKey(kSTRIPAPIC, &strip_madt, &bootInfo->chameleonConfig); + + if ((strip_madt == false) || (!buildMADT(new_table_list, DsdtPtr, &madt_info ))) + { + + ACPI_TABLE_MADT * madt_file = (void*)0ul; + ACPI_TABLE_MADT * MadtPointer = (void*)0ul; + bool oem_apic=false; + + { + bool tmpval; + oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } + + if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul) + { + if (oem_apic == false) + { + MadtPointer = (ACPI_TABLE_MADT *)madt_file; + } + + } else + MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer; + + ProcessMadtInfo(MadtPointer, &madt_info); + + } + + if (gen_ssdt || gen_csta || gen_psta || gen_tsta) + { + ProcessSsdt(new_table_list, DsdtPtr, &madt_info, gen_csta, gen_psta, gen_tsta ); + } + } + + if (rsdp_mod == (void *)0ul) + { + printf("Error: rsdp_mod == null \n"); + return EFI_ABORTED; + } + + if (!(rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE)) + { + printf("Error: rsdp_mod size is incorrect \n"); + return EFI_ABORTED; + + } + + do { + + if ((rsdp_mod->Revision == 0) || (gen_xsdt == true)) + { + if (process_rsdt(rsdp_mod, gen_xsdt, new_table_list)) + break; + printf("Error : ACPI RSD PTR Revision 1 is incorrect, \n"); + } + + if ((GetChecksum(rsdp_mod, sizeof(ACPI_TABLE_RSDP)) == 0) && + (Revision == 2) && + (rsdplength == sizeof(ACPI_TABLE_RSDP))) + { + if (process_xsdt(rsdp_mod, new_table_list)) + break; + printf("Error : ACPI RSD PTR Revision 2 is incorrect \n"); + } + + Revision = 0; // fallback to Revision 0 + + if (process_rsdt(rsdp_mod, false, new_table_list)) + break; + + printf("Error: Incorect ACPI RSD PTR or not found \n"); + return EFI_ABORTED; + + } while (0); + + + // Correct the checksum of RSDP + + DBG("RSDP: Original checksum %d\n", rsdp_mod->Checksum); + + setRsdpchecksum(rsdp_mod); + + DBG("New checksum %d\n", rsdp_mod->Checksum); + + if (Revision == 2) + { + DBG("RSDP: Original extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + setRsdpXchecksum(rsdp_mod); + + DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + } + + verbose("ACPI Revision %d successfully patched\n", Revision); + + if (Revision == 2) + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + rsd_p = (U32)rsdp_mod; + addConfigurationTable(&gEfiAcpi20TableGuid, &rsd_p, "ACPI_20"); + } + else + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + rsd_p = (U32)rsdp_mod; + addConfigurationTable(&gEfiAcpiTableGuid, &rsd_p, "ACPI"); + } + + +#if DEBUG_ACPI==2 + printf("Press a key to continue... (DEBUG_ACPI)\n"); + getc(); +#endif + return Status; +} + +int AcpiSetup(void) +{ + EFI_STATUS status = setup_Acpi(); + + return (status == EFI_SUCCESS); +} diff --git a/i386/modules/AcpiCodec/.svn/text-base/acpi_tools.c.svn-base b/i386/modules/AcpiCodec/.svn/text-base/acpi_tools.c.svn-base new file mode 100644 index 0000000..b999daf --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/acpi_tools.c.svn-base @@ -0,0 +1,328 @@ +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "libsaio.h" +#include "bootstruct.h" +#include "datatype.h" +#include "intel_acpi.h" +#include "ppm.h" +#include "acpi.h" + +static U32 GetRsdtPointer(void *mem_addr, U32 mem_size, ACPI_TABLES * acpi_tables); +static U32 GetXsdtPointer(ACPI_TABLES * acpi_tables); +static ACPI_TABLE_HEADER *GetTablePtr(ACPI_TABLE_RSDT * rsdt, U32 signature); +static ACPI_TABLE_HEADER *GetTablePtr64(ACPI_TABLE_XSDT * xsdt, U32 signature); + +//------------------------------------------------------------------------------- +// +// Procedure: FindAcpiTables - Collects addresses for RSDP, RSDT, FADT, & DSDT. +// +// Description: Finds the differentiated system description table pointer +// by scanning and checking ACPI tables. This function will +// get and store the following ACPI Table Pointers: +// 1) RSD Pointer in RsdPointer Variable +// 2) RSDT Pointer in RsdtPointer Variable (RSDP->RSDT) +// 3) XSDT Pointer in XsdtPointer Variable (RSDP->XSDT) +// 4) FACP Pointer in FacpPointer Variable (RSDP->RSDT->FACP) +// 5) FACP(64) Pointer in FacpPointer64 Variable (RSDP->XSDT->FACP) +// 6) DSDT Pointer in DsdtPointer Variable (RSDP->RSDT->FACP->DSDT) +// 7) DSDT(64) Pointer in DsdtPointer64 Variable (RSDP->XSDT->FACP->XDSDT) +// 8) FACS Pointer in FacsPointer Variable (RSDP->RSDT->FACP->FACS) +// 9) FACS(64) Pointer in FacsPointer64 Variable (RSDP->XSDT->FACP->XFACS) +// A) MADT Pointer in FacsPointer Variable (RSDP->RSDT->APIC) +// B) MADT(64) Pointer in MadtPointer64 Variable (RSDP->XSDT->APIC) +// +//------------------------------------------------------------------------------- +U32 FindAcpiTables(ACPI_TABLES * acpi_tables) +{ + U32 success = 0ul; + + // Perform init of ACPI table pointers + { + void *null = 0ul; + acpi_tables->DsdtPointer = null; + acpi_tables->DsdtPointer64 = null; + acpi_tables->FacpPointer = null; + acpi_tables->FacsPointer = null; + acpi_tables->FacsPointer64 = null; + acpi_tables->RsdPointer = null; + acpi_tables->RsdtPointer = null; + acpi_tables->MadtPointer = null; + acpi_tables->MadtPointer64 = null; + acpi_tables->XsdtPointer = null; + acpi_tables->FacpPointer64 = null; + } + + // Find the RSDT pointer by scanning EBDA/E000/F000 segments. + + // Init memory address as EBDA and scan 1KB region + success = GetRsdtPointer((void *)(((U32) * (U16 *) 0x40E) << 4), 0x400, acpi_tables); + + // Init memory address as E000 segment and scan 64KB region + if (!success) + success = GetRsdtPointer((void *)0x0E0000, 0x10000, acpi_tables); + + // Init memory address as F000 segment and scan 64KB region + if (!success) + success = GetRsdtPointer((void *)0x0F0000, 0x10000, acpi_tables); + + if (!success || (acpi_tables->RsdtPointer == 0ul)) + return (0ul); + + success = GetXsdtPointer(acpi_tables); + + // Find FACP table pointer which is one of table pointers in the RDST + acpi_tables->FacpPointer = (ACPI_TABLE_FADT *) + GetTablePtr(acpi_tables->RsdtPointer, NAMESEG("FACP")); + if (acpi_tables->FacpPointer == 0ul) + return (0ul); + + // Find the DSDT which is included in the FACP table + acpi_tables->DsdtPointer = (ACPI_TABLE_DSDT *) acpi_tables->FacpPointer->Dsdt; + if ((acpi_tables->DsdtPointer == 0ul) || (*(U32 *) (acpi_tables->DsdtPointer->Header.Signature) != NAMESEG("DSDT")) || + (GetChecksum(acpi_tables->DsdtPointer, acpi_tables->DsdtPointer->Header.Length) != 0)) + return (0ul); + + // Find the FACS which is included in the FACP table + acpi_tables->FacsPointer = (ACPI_TABLE_FACS *) acpi_tables->FacpPointer->Facs; + if ((acpi_tables->FacsPointer == 0ul) || (*(U32 *) (acpi_tables->FacsPointer->Signature) != NAMESEG("FACS"))) + return (0ul); + + // Find the MADT table which is one of the table pointers in the RSDT + acpi_tables->MadtPointer = (ACPI_TABLE_MADT *) GetTablePtr(acpi_tables->RsdtPointer, NAMESEG("APIC")); + if (acpi_tables->MadtPointer == 0ul) + return (0ul); + + do { + + if (!success || (acpi_tables->XsdtPointer == 0ul)) + break; + + // Find FACP(64) table pointer which is one of table pointers in the XDST + acpi_tables->FacpPointer64 = (ACPI_TABLE_FADT *) + GetTablePtr64(acpi_tables->XsdtPointer, NAMESEG("FACP")); + + if (acpi_tables->FacpPointer64 == 0ul) + break; + + // Find the XDSDT which is included in the FACP(64) table + ACPI_TABLE_DSDT *DsdtPointer64 = (ACPI_TABLE_DSDT *)((U32)acpi_tables->FacpPointer64->XDsdt); + + if (DsdtPointer64 == 0ul) + break; + + if ((*(U32*) (DsdtPointer64->Header.Signature) == NAMESEG("DSDT")) && + (GetChecksum(DsdtPointer64, DsdtPointer64->Header.Length) == 0)) + acpi_tables->DsdtPointer64 = (ACPI_TABLE_DSDT *) DsdtPointer64; + + // Find the XFACS which is included in the FACP(64) table + ACPI_TABLE_FACS *FacsPointer64 = (ACPI_TABLE_FACS *)((U32)acpi_tables->FacpPointer64->XFacs); + + if (FacsPointer64 == 0ul) + break; + + if (*(U32*) (FacsPointer64->Signature) == NAMESEG("FACS")) + acpi_tables->FacsPointer64 = (ACPI_TABLE_FACS *) FacsPointer64; + + + // Find the MADT(64) table which is one of the table pointers in the XSDT + acpi_tables->MadtPointer64 = (ACPI_TABLE_MADT *) GetTablePtr64(acpi_tables->XsdtPointer, NAMESEG("APIC")); + + } while (0); + + + return (1ul); +} + +//----------------------------------------------------------------------------- +U32 get_num_tables(ACPI_TABLE_RSDT * rsdt) +{ + // Compute number of table pointers included in RSDT + return ((rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) + / sizeof(ACPI_TABLE_HEADER *)); +} + +//----------------------------------------------------------------------------- +U32 get_num_tables64(ACPI_TABLE_XSDT * xsdt) +{ + { + void *null = 0ul; + if (xsdt == null) + return 0ul; + } + + // Compute number of table pointers included in XSDT + return ((xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) + / sizeof(U64)); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetTablePtr - Find ACPI table in RSDT with input signature. +// +//------------------------------------------------------------------------------- +static ACPI_TABLE_HEADER *GetTablePtr(ACPI_TABLE_RSDT * rsdt, U32 signature) +{ + U32 index; + U32 num_tables; + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) rsdt->TableOffsetEntry; + + // Compute number of table pointers included in RSDT + num_tables = get_num_tables(rsdt); + + for (index = 0; index < num_tables; index++) { + if ((*(U32 *) (table_array[index]->Signature) == signature) && + (GetChecksum(table_array[index], table_array[index]->Length) == 0)) { + return (table_array[index]); + } + } + return (0); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetTablePtr64 - Find ACPI table in XSDT with input signature. +// +//------------------------------------------------------------------------------- +static ACPI_TABLE_HEADER *GetTablePtr64(ACPI_TABLE_XSDT * xsdt, U32 signature) +{ + U32 index; + U32 num_tables; + + int method; + + // Compute number of table pointers included in XSDT + num_tables = get_num_tables64(xsdt); + + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + switch (method) { + case 0x2: + { + for (index = 0; index < num_tables; index++) { + U64 ptr = xsdt->TableOffsetEntry[index]; + + if ((*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature == signature) && + (GetChecksum(((ACPI_TABLE_HEADER *) (unsigned long)ptr), ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length) == 0)) { + return (((ACPI_TABLE_HEADER *) (unsigned long)ptr)); + } + } + break; + } + case 0x1: + default: + { + ACPI_TABLE_HEADER *table = (ACPI_TABLE_HEADER *) xsdt->TableOffsetEntry; + + for (index = 0; index < num_tables; index++) { + if (((U32) (table->Signature) == signature) && + (GetChecksum(table, table->Length) == 0)) { + return (table); + } + // Move array pointer to next 64-bit pointer + table = (ACPI_TABLE_HEADER *) ((U32) table + sizeof(U64)); + } + break; + } + } + + return (0); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetChecksum - Performs byte checksum +// +//------------------------------------------------------------------------------- +U8 GetChecksum(void *mem_addr, U32 mem_size) +{ + U8 *current = mem_addr; + U8 *end = current + mem_size; + U8 checksum = 0; + + for (; current < end; current++) + checksum = checksum + *current; + + return (checksum); +} + +/*========================================================================== + * Function to map 32 bit physical address to 64 bit virtual address + */ + + +//------------------------------------------------------------------------------- +// +// Procedure: GetRsdtPointer - Scans given segment for RSDT pointer +// +// Description: Scans for root system description table pointer signature +// ('RSD PTR ') , verifies checksum, and returns pointer to +// RSDT table if found. +// +//------------------------------------------------------------------------------- +static U32 GetRsdtPointer(void *mem_addr, U32 mem_size, ACPI_TABLES * acpi_tables) +{ + U8 *current = mem_addr; + U8 *end = current + mem_size; + + // Quick sanity check for a valid start address + if (current == 0ul) + return (0ul); + + for (; current < end; current += 16) { + if (*(volatile U64 *)current == NAMESEG64("RSD PTR ")) { + if (GetChecksum(current, ACPI_RSDP_REV0_SIZE) == 0) { + // RSD pointer structure checksum okay, lookup the RSDT pointer. + acpi_tables->RsdPointer = (ACPI_TABLE_RSDP *)current; + acpi_tables->RsdtPointer = (ACPI_TABLE_RSDT *) acpi_tables->RsdPointer->RsdtPhysicalAddress; + if ((acpi_tables->RsdPointer != (void*)0ul) && (acpi_tables->RsdtPointer != (void*)0ul)) + return (1ul); + else + return (0ul); + } + } + } + + return (0); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetXsdtPointer +// +//------------------------------------------------------------------------------- +static U32 GetXsdtPointer(ACPI_TABLES * acpi_tables) +{ + if ((GetChecksum(acpi_tables->RsdPointer, sizeof(ACPI_TABLE_RSDP)) == 0) && + (acpi_tables->RsdPointer->Revision == 2) && + (acpi_tables->RsdPointer->Length == sizeof(ACPI_TABLE_RSDP))) { + // RSD pointer structure checksum okay, lookup the XSDT pointer. + acpi_tables->XsdtPointer = (ACPI_TABLE_XSDT *) (U32) acpi_tables->RsdPointer->XsdtPhysicalAddress; + return (1ul); + } + + return (0ul); +} diff --git a/i386/modules/AcpiCodec/.svn/text-base/acpicode.c.svn-base b/i386/modules/AcpiCodec/.svn/text-base/acpicode.c.svn-base new file mode 100644 index 0000000..26267a5 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/acpicode.c.svn-base @@ -0,0 +1,638 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "datatype.h" +#include "acpi.h" +#include "ppm.h" +#include "acpicode.h" + +static void setPackage(ACPI_PACKAGE * package, U8 numElements); +static void setNamePath(ACPI_NAME_PATH * namePath, U32 name); + +void SetChecksum(struct acpi_table_header *header) +{ + header->Checksum = 0; + header->Checksum = 0 - GetChecksum(header, header->Length); +} + +void setRsdpchecksum(ACPI_TABLE_RSDP *rsdp) +{ + rsdp->Checksum = 0; + rsdp->Checksum = 0 - GetChecksum(rsdp, ACPI_RSDP_REV0_SIZE); +} + +void setRsdpXchecksum(ACPI_TABLE_RSDP *rsdp) +{ + rsdp->ExtendedChecksum = 0; + rsdp->ExtendedChecksum = 0 - GetChecksum(rsdp, rsdp->Length); +} + +U32 update_rsdp_with_xsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_XSDT *xsdt) +{ + // 1. Update the XSDT pointer in the RSDP + // 2. Update the Xchecksum of the RSDP + + { + // 1. Update the XSDT pointer in the RSDP + rsdp->XsdtPhysicalAddress = ((U64)((U32)xsdt)); + } + + { + // 2. Update the Xchecksum of the RSDP + setRsdpXchecksum(rsdp); + } + + return (1); +} + +U32 update_rsdp_with_rsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_RSDT *rsdt) +{ + // 1. Update the RSDT pointer in the RSDP + // 2. Update the checksum of the RSDP + + { + // 1. Update the RSDT pointer in the RSDP + rsdp->RsdtPhysicalAddress = (U32)rsdt; + } + + { + // 2. Update the checksum of the RSDP + setRsdpchecksum(rsdp); + } + + return (1); +} + + +//----------------------------------------------------------------------------- +U32 ProcessMadtInfo(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info) +{ + void *current; + void *end; + + // Quick sanity check for a valid MADT + if (madt == 0ul) + return (0ul); + + madt_info->lapic_count = 0; + + // Search MADT for Sub-tables with needed data + current = madt + 1; + end = (U8 *) madt + madt->Header.Length; + + while (current < end) + { + ACPI_SUBTABLE_HEADER *subtable = current; + + switch (subtable->Type) + { + + case ACPI_MADT_TYPE_LOCAL_APIC: + { + // Process sub-tables with Type as 0: Processor Local APIC + ACPI_MADT_LOCAL_APIC *lapic = current; + current = lapic + 1; + + if (!(lapic->LapicFlags & ACPI_MADT_ENABLED)) + continue; + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->processorId = lapic->ProcessorId; + lapic_info->apicId = lapic->Id; + lapic_info->madt_type = ACPI_MADT_TYPE_LOCAL_APIC; + } + + madt_info->lapic_count++; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_X2APIC: + { + // Process sub-tables with Type as 9: Processor X2APIC + ACPI_MADT_X2APIC *x2apic = current; + current = x2apic + 1; + + if (!(x2apic->x2apicFlags & ACPI_MADT_ENABLED)) + continue; + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->uid = x2apic->UID; + lapic_info->apicId = x2apic->x2apicId; + lapic_info->madt_type = ACPI_MADT_TYPE_X2APIC; + } + + madt_info->lapic_count++; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + default: + { + // Process all other sub-tables + current = (U8 *) subtable + subtable->Length; + break; + } + } // switch + + } // while + + return (1); +} + +//------------------------------------------------------------------------------- +U32 ProcessDsdt(ACPI_TABLE_DSDT * DsdtPointer, U8 * PCIUIDPointer, U8 uid) +{ + // 1. Sanity check + // 2. Replace UID value with the new value + // 3. Update the checksum of the DSDT + + { + // 1. Sanity check + if ((memcmp(&uid, PCIUIDPointer, sizeof(U8)) == 0) || (PCIUIDPointer == (U8*)0) || (DsdtPointer == (void*)0ul)) + return (0); + } + + { + // 2. Replace UID value with the new value + buildOpCode((void*)PCIUIDPointer, uid); + } + + { + // 3. Update the checksum of the DSDT + SetChecksum(&DsdtPointer->Header); + } + + return (1); +} + +//------------------------------------------------------------------------------- +void MoveRsdtInsertSsdt(ACPI_TABLE_RSDP * RsdPointer, ACPI_TABLE_RSDT * OldRsdtPointer, ACPI_TABLE_RSDT * NewRsdtPointer, ACPI_TABLE_SSDT * SsdtPointer) +{ + // 1. Move the RSDT in memory to the new location + // 2. Add new pointer for the SSDT into the RSDT + // 3. Update the size of the RSDT + // 4. Update the checksum of the RSDT + // 5. Update the RSDT pointer in the RSDP + // 6. Update the checksum of the RSDP + + { + // 1. Move the RSDT in memory to the new location + memcpy(NewRsdtPointer, OldRsdtPointer, OldRsdtPointer->Header.Length); + } + + { + // 2. Add new pointer for the SSDT into the RSDT + // 3. Update the size of the RSDT + // 4. Update the checksum of the RSDT + InsertSsdt(NewRsdtPointer, SsdtPointer); + } + + { + // 5. Update the RSDT pointer in the RSDP + RsdPointer->RsdtPhysicalAddress = (U32) NewRsdtPointer; + } + + { + // 6. Update the checksum of the RSDP + setRsdpchecksum(RsdPointer); + } +} + +//------------------------------------------------------------------------------- +void InsertSsdt(ACPI_TABLE_RSDT * RsdtPointer, ACPI_TABLE_SSDT * SsdtPointer) +{ + // 1. Add new pointer for the SSDT into the RSDT + // 2. Update the size of the RSDT + // 3. Update the checksum of the RSDT + + { + // 1. Add new pointer for the SSDT into the RSDT + U32 index = get_num_tables(RsdtPointer); + RsdtPointer->TableOffsetEntry[index] = (U32) SsdtPointer; + } + + { + // 2. Update the size of the RSDT + RsdtPointer->Header.Length = RsdtPointer->Header.Length + sizeof(ACPI_TABLE_SSDT *); + } + + { + // 3. Update the checksum of the RSDT + SetChecksum(&RsdtPointer->Header); + } +} + +//------------------------------------------------------------------------------- +void InsertSsdt64(ACPI_TABLE_XSDT * XsdtPointer, ACPI_TABLE_SSDT * SsdtPointer) +{ + { + void *null = 0ul; + if (XsdtPointer == null) + return; + } + + // 1. Add new pointer for the SSDT into the XSDT + // 2. Update the size of the XSDT + // 3. Update the checksum of the XSDT + + { + // 1. Add new pointer for the SSDT into the XSDT + U32 index = get_num_tables64(XsdtPointer); + XsdtPointer->TableOffsetEntry[index] = (U64) ((U32) SsdtPointer); + } + + { + // 2. Update the size of the XSDT + XsdtPointer->Header.Length = XsdtPointer->Header.Length + sizeof(U64); + } + + { + // 3. Update the checksum of the XSDT + SetChecksum(&XsdtPointer->Header); + } +} + +//----------------------------------------------------------------------------- +void *buildNameSeg(void *current, U32 name) +{ + U32 *nameSeg = current; + current = nameSeg + 1; + + *nameSeg = name; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildOpCode(void *current, U8 opCode) +{ + U8 *op = current; + current = op + 1; + + *op = opCode; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildReturnPackage(void *current, U8 numElements) +{ + ACPI_RETURN_PACKAGE *returnPackage = current; + current = returnPackage + 1; + + returnPackage->returnOpcode = AML_RETURN_OP; + setPackage(&returnPackage->package, numElements); + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildReturnZero(void *current) +{ + ACPI_RETURN_ZERO *returnZero = current; + current = returnZero + 1; + + returnZero->returnOpcode = AML_RETURN_OP; + returnZero->zeroOpcode = AML_ZERO_OP; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildReturnOpcode(void *current, U8 opcodeToReturn) +{ + ACPI_RETURN_OPCODE *returnOpcode = current; + current = returnOpcode + 1; + + returnOpcode->returnOpcode = AML_RETURN_OP; + returnOpcode->opcodeToReturn = opcodeToReturn; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildMethod(void *current, U32 name, U8 methodFlags) +{ + ACPI_METHOD *method = current; + current = method + 1; + + method->methodOpcode = AML_METHOD_OP; + method->name = name; + method->methodFlags = methodFlags; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildSmallMethod(void *current, U32 name, U8 methodFlags) +{ + ACPI_SMALL_METHOD *method = current; + current = method + 1; + + method->methodOpcode = AML_METHOD_OP; + method->name = name; + method->methodFlags = methodFlags; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildNamedDword(void *current, U32 name, U32 dword) +{ + ACPI_NAMED_DWORD *namedDword = current; + current = namedDword + 1; + + setNamePath(&namedDword->namePath, name); + setDwordConst(&namedDword->dword, dword); + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildGenericRegister(void *current, const ACPI_GENERIC_ADDRESS * gas) +{ + ACPI_GENERIC_REGISTER *genReg = current; + current = genReg + 1; + + genReg->genericRegisterField = AML_GEN_REG_FIELD; + genReg->pkgLength.packageLength0 = 0x0c; + genReg->pkgLength.packageLength1 = 0; + + genReg->gas.SpaceId = gas->SpaceId; + genReg->gas.BitWidth = gas->BitWidth; + genReg->gas.BitOffset = gas->BitOffset; + genReg->gas.AccessWidth = gas->AccessWidth; + genReg->gas.Address = gas->Address; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildSmallBuffer(void *current) +{ + ACPI_SMALL_BUFFER *buffer = current; + current = buffer + 1; + + buffer->bufferOpcode = AML_BUFFER_OP; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildEndTag(void *current) +{ + ACPI_END_TAG *endTag = current; + current = endTag + 1; + + endTag->endTagField = AML_END_TAG_OP; + endTag->checksum = 0; + + return (current); +} + +//----------------------------------------------------------------------------- +void setSmallPackage(ACPI_SMALL_PACKAGE * package, U8 numElements) +{ + package->packageOpcode = AML_PACKAGE_OP; + package->numElements = numElements; +} + +//----------------------------------------------------------------------------- +void *buildSmallPackage(void *current, U8 numElements) +{ + ACPI_SMALL_PACKAGE *package = current; + current = package + 1; + setSmallPackage(package, numElements); + return (current); +} + +//----------------------------------------------------------------------------- +static void setPackage(ACPI_PACKAGE * package, U8 numElements) +{ + package->packageOpcode = AML_PACKAGE_OP; + package->numElements = numElements; +} + +//----------------------------------------------------------------------------- +void setPackageLength(ACPI_PACKAGE_LENGTH * packageLength, U32 length) +{ + packageLength->packageLength0 = 0x40 + (U8) (length & 0xf); + packageLength->packageLength1 = (U8) (length >> 4); +} + +//----------------------------------------------------------------------------- +void *buildPackageLength(void *current, U32 length) +{ + ACPI_PACKAGE_LENGTH *packageLength = current; + current = packageLength + 1; + setPackageLength(packageLength, length); + return (current); +} + +//----------------------------------------------------------------------------- +static void setNamePath(ACPI_NAME_PATH * namePath, U32 name) +{ + namePath->nameOpcode = AML_NAME_OP; + namePath->name = name; +} + +//----------------------------------------------------------------------------- +void *buildNamePath(void *current, U32 name) +{ + ACPI_NAME_PATH *namePath = current; + current = namePath + 1; + setNamePath(namePath, name); + return (current); +} + +//----------------------------------------------------------------------------- +static void setTableHeader(ACPI_TABLE_HEADER * tableHeader, U32 signature, U64 oemTableId) +{ + *(U32 *) &tableHeader->Signature = signature; + tableHeader->Length = 0; + tableHeader->Revision = 1; + tableHeader->Checksum = 0; + memcpy(&tableHeader->OemId[0], "INTEL ", 6); + *(U64 *) (tableHeader->OemTableId) = oemTableId; + tableHeader->OemRevision = 0x80000001; + *(U32 *) tableHeader->AslCompilerId = NAMESEG("INTL"); // ASCII ASL compiler vendor ID + tableHeader->AslCompilerRevision = 0x20061109; // ASL compiler version +} + +//----------------------------------------------------------------------------- +void *buildTableHeader(void *current, U32 signature, U64 oemTableId) +{ + ACPI_TABLE_HEADER *tableHeader = current; + current = tableHeader + 1; + setTableHeader(tableHeader, signature, oemTableId); + return (current); +} + +//----------------------------------------------------------------------------- +void setByteConst(ACPI_BYTE_CONST * byteConst, U8 byteData) +{ + byteConst->byteOpcode = AML_BYTE_OP; + byteConst->byteData = byteData; +} + +//----------------------------------------------------------------------------- +void *buildByteConst(void *current, U8 byteData) +{ + ACPI_BYTE_CONST *byteConst = current; + current = byteConst + 1; + setByteConst(byteConst, byteData); + return (current); +} + +//----------------------------------------------------------------------------- +void setWordConst(ACPI_WORD_CONST * wordConst, U16 wordData) +{ + wordConst->wordOpcode = AML_WORD_OP; + wordConst->wordData = wordData; +} + +//----------------------------------------------------------------------------- +void *buildWordConst(void *current, U16 wordData) +{ + ACPI_WORD_CONST *wordConst = current; + current = wordConst + 1; + setWordConst(wordConst, wordData); + return (current); +} + +//----------------------------------------------------------------------------- +void setDwordConst(ACPI_DWORD_CONST * dwordConst, U32 dwordData) +{ + dwordConst->dwordOpcode = AML_DWORD_OP; + dwordConst->dwordData = dwordData; +} + +//----------------------------------------------------------------------------- +void *buildDwordConst(void *current, U32 dwordData) +{ + ACPI_DWORD_CONST *dwordConst = current; + current = dwordConst + 1; + setDwordConst(dwordConst, dwordData); + return (current); +} + +//------------------------------------------------------------------------------- +U32 ProcessFadt(ACPI_TABLE_FADT * FadtPointer, U32 pmbase) +{ + { + // Update fields in FADT + + // Update ACPI 1.0 fields first + + FadtPointer->Pm1aEventBlock = pmbase; + FadtPointer->Pm1aControlBlock = pmbase + 4; + FadtPointer->Pm2ControlBlock = pmbase + 0x50; + FadtPointer->PmTimerBlock = pmbase + 8; + FadtPointer->Pm1EventLength = 4; + FadtPointer->Pm1ControlLength = 2; + FadtPointer->Pm2ControlLength = 1; + FadtPointer->PmTimerLength = 4; + + // No legacy C2 + FadtPointer->C2Latency = 101; + + // No legacy C3 + FadtPointer->C3Latency = 1001; + + // C1 power state is supported on all processors + FadtPointer->BootFlags |= 1UL << 2; + + // No legacy C2 on MP systems + FadtPointer->BootFlags &= ~(1UL << 3); + + // Update ACPI 2.0+ fields if supported + if (FadtPointer->Header.Revision >= 3) { + // Address space where struct or register exists - System IO + FadtPointer->XPm1aEventBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPm1aEventBlock.BitWidth = 0x20; + // Bit offset within the register + FadtPointer->XPm1aEventBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPm1aEventBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPm1aEventBlock.Address = pmbase; + + // Address space where struct or register exists - System IO + FadtPointer->XPm1aControlBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPm1aControlBlock.BitWidth = 0x10; + // Bit offset within the register + FadtPointer->XPm1aControlBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPm1aControlBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPm1aControlBlock.Address = pmbase + 4; + + // Address space where struct or register exists - System IO + FadtPointer->XPm2ControlBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPm2ControlBlock.BitWidth = 0x08; + // Bit offset within the register + FadtPointer->XPm2ControlBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPm2ControlBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPm2ControlBlock.Address = pmbase + 0x50; + + // Address space where struct or register exists - System IO + FadtPointer->XPmTimerBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPmTimerBlock.BitWidth = 0x20; + // Bit offset within the register + FadtPointer->XPmTimerBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPmTimerBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPmTimerBlock.Address = pmbase + 8; + } + } + + // Update checksum in FADT + SetChecksum(&FadtPointer->Header); + + return (1); +} diff --git a/i386/modules/AcpiCodec/.svn/text-base/acpidecode.c.svn-base b/i386/modules/AcpiCodec/.svn/text-base/acpidecode.c.svn-base new file mode 100644 index 0000000..0f6a9d4 --- /dev/null +++ b/i386/modules/AcpiCodec/.svn/text-base/acpidecode.c.svn-base @@ -0,0 +1,918 @@ +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "acpi.h" +#include "acpidecode.h" + +#define DEBUG_ACPI_DECODE 0 + +#if DEBUG_ACPI_DECODE==1 +#include "libsaio.h" +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +static U8 *parse_acpi_dataobject(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_package(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_termarg(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_termarglist(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_objectlist(const struct acpi_namespace *ns, U8 * current, U8 * end); +U8* UIDPointer = (U8*)0; + +void *decodeTableHeader(void *current, ACPI_TABLE_HEADER ** tableHeader) +{ + *tableHeader = current; + current = *tableHeader + 1; + return current; +} +void dprint_nameseg(U32 i) +{ + DBG("%c%c%c%c", + (int)(i & 0x000000ff), + (int)((i & 0x0000ff00) >> 8), + (int)((i & 0x00ff0000) >> 16), + (int)(i >> 24)); +} + +#if DEBUG_ACPI_DECODE +static void dprint_namespace(const struct acpi_namespace *ns) +{ + U32 i; + DBG( "\\"); + for (i = 0; i < ns->depth; i++) { + if (i != 0) + DBG( "."); + dprint_nameseg(ns->nameseg[i]); + } +} +#endif + +static void parsePackageLength(U8 * current, U32 * length, U32 * lengthEncoding) +{ + U32 i; + U8 len0 = *current; + U8 numBytes = len0 >> 6; + U32 total = 0; + + for (i = numBytes; i > 0; i--) { + total <<= 8; + total |= current[i]; + } + + total <<= 4; + total |= len0 & 0x3f; + *length = total; + *lengthEncoding = numBytes + 1; + DBG("Package length=0x%02x\n", *length); +} + +#if UNUSED +static bool ns_match(struct acpi_namespace *ns1, struct acpi_namespace *ns2) +{ + U32 i; + if (ns1->depth != ns2->depth) + return false; + + for (i = 0; i < ns1->depth; i++) + if (ns1->nameseg[i] != ns2->nameseg[i]) + return false; + + return true; +} + +U32 acpi_ns_found; +#endif + +static U8 *parse_acpi_namestring(const struct acpi_namespace *ns_context, struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + struct acpi_namespace dummy_ns; + + (void)end; + + if (!ns) + ns = &dummy_ns; + *ns = *ns_context; + + if (*current == AML_ROOT_PREFIX) { + ns->depth = 0; + current++; + } else + while (*current == AML_PARENT_PREFIX) { + if (ns->depth == 0) { + DBG( "Attempt to use parent prefix with no namespace left\n"); + return temp; + } + current++; + ns->depth--; + } + + switch (*current) { + case AML_DUAL_NAME_PREFIX: + if (ns->depth + 2 > ACPI_NAMESPACE_MAX_DEPTH) { + DBG( "Namespace got too deep\n"); + return temp; + } + current++; + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + break; + case AML_MULTI_NAME_PREFIX: + { + U8 nameseg_count; + current++; + nameseg_count = *current++; + if (ns->depth + nameseg_count > ACPI_NAMESPACE_MAX_DEPTH) { + DBG( "Namespace got too deep\n"); + return temp; + } + while (nameseg_count--) { + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + } + break; + } + case AML_NULL_NAME: + current++; + break; + default: + if (*current != '_' && (*current < 'A' || *current > 'Z')) { + DBG( "Invalid nameseg lead character: 0x%02x\n", *current); + return temp; + } + if (ns->depth + 1 > ACPI_NAMESPACE_MAX_DEPTH) { + DBG( "Namespace got too deep\n"); + return temp; + } + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + break; + } +#if DEBUG_ACPI_DECODE + DBG( "Found NameString: "); + dprint_namespace(ns); + DBG("\n"); +#endif + if (ns->nameseg[1] == NAMESEG("PCI0") && ns->nameseg[2] == NAMESEG("_UID")) { + UIDPointer = current; + } + +#if UNUSED + if (!acpi_ns_found) { + U32 index; + + for (index = 0; index < acpi_processor_count; index++) + if (ns_match(ns, &acpi_processors[index].ns)) { + acpi_ns_found = 1; + break; + } + } +#endif + return current; +} + +static U8 *parse_acpi_buffer(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U32 pkglen = 0, lengthEncoding = 0; + (void)ns; + (void)end; + if (*current != AML_BUFFER_OP) + return current; + current++; + parsePackageLength(current, &pkglen, &lengthEncoding); + current += pkglen; + return current; +} + +static U8 *parse_acpi_computationaldata(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_buffer(ns, current, end); + if (current != temp) + return current; + + switch (*current) { + case AML_BYTE_OP: + DBG("Found ByteOp\n"); + current += 1 + 1; + break; + case AML_WORD_OP: + DBG( "Found WordOp\n"); + current += 1 + 2; + break; + case AML_DWORD_OP: + DBG("Found DwordOp\n"); + current += 1 + 4; + break; + case AML_QWORD_OP: + DBG( "Found QwordOp\n"); + current += 1 + 8; + break; + case AML_STRING_OP: + DBG( "Found StringOp: \""); + current++; + while (*current) +#if DEBUG_ACPI_DECODE + if (*current < ' ' || *current > 0x7e) + printf( "\\x%02x", *current++); + else + printf( "%c", *current++); +#else + current++; +#endif + current++; /* Skip the \0 */ + DBG( "\"\n"); + break; + case AML_ZERO_OP: + DBG( "Found ZeroOp\n"); + current += 1; + break; + case AML_ONE_OP: + DBG( "Found OneOp\n"); + current += 1; + break; + case AML_ONES_OP: + DBG( "Found OneOp\n"); + current += 1; + break; + case AML_EXT_OP_PREFIX: + if (*(current + 1) == AML_REVISION_OP) + current += 2; + default: + break; + } + + return current; +} + +static U8 *parse_acpi_argobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + switch (*current) { + case AML_ARG0_OP: + DBG( "Found Arg0Op\n"); + current++; + break; + case AML_ARG1_OP: + DBG( "Found Arg1Op\n"); + current++; + break; + case AML_ARG2_OP: + DBG( "Found Arg2Op\n"); + current++; + break; + case AML_ARG3_OP: + DBG( "Found Arg3Op\n"); + current++; + break; + case AML_ARG4_OP: + DBG( "Found Arg4Op\n"); + current++; + break; + case AML_ARG5_OP: + DBG( "Found Arg5Op\n"); + current++; + break; + case AML_ARG6_OP: + DBG( "Found Arg6Op\n"); + current++; + break; + default: + break; + } + return current; +} + +static U8 *parse_acpi_localobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + switch (*current) { + case AML_LOCAL0_OP: + DBG( "Found Local0Op\n"); + current++; + break; + case AML_LOCAL1_OP: + DBG( "Found Local1Op\n"); + current++; + break; + case AML_LOCAL2_OP: + DBG( "Found Local2Op\n"); + current++; + break; + case AML_LOCAL3_OP: + DBG("Found Local3Op\n"); + current++; + break; + case AML_LOCAL4_OP: + DBG( "Found Local4Op\n"); + current++; + break; + case AML_LOCAL5_OP: + DBG( "Found Local5Op\n"); + current++; + break; + case AML_LOCAL6_OP: + DBG( "Found Local6Op\n"); + current++; + break; + case AML_LOCAL7_OP: + DBG( "Found Local7Op\n"); + current++; + break; + default: + break; + } + return current; +} + +static U8 *parse_acpi_debugobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + if ((*current == AML_EXT_OP_PREFIX) && (*(current + 1) == AML_DEBUG_OP)) { + current += 2; + DBG( "Found DebugOp\n"); + } + + return current; +} + +static U8 *parse_acpi_datarefobject(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + DBG( "Beginning datarefobject: 0x%02x at memory location %p\n", *current, current); + current = parse_acpi_dataobject(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_simplename(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_namestring(ns, NULL, current, end); + if (current != temp) + return current; + + current = parse_acpi_argobj(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_localobj(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_supername(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_simplename(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_debugobj(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_target(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_supername(ns, current, end); + if (current != temp) + return current; + + if (*current == AML_NULL_NAME) + current++; + + return current; +} + +static U8 *parse_acpi_method(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *new_end = current; + U8 *temp; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + + (void)end; + + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + + temp = current; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); + if (current == temp) + return new_end; + +#if DEBUG_ACPI_DECODE + DBG( "Found Method: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + // U8 methodFlags + current++; + + parse_acpi_termlist(&new_ns, current, new_end); + +#if DEBUG_ACPI_DECODE + DBG( "End of Method: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + + return new_end; +} + +U32 acpi_processor_count; +struct acpi_processor acpi_processors[CPU_MAP_LIMIT]; + +static void add_processor(const struct acpi_namespace *ns, U8 id, U32 pmbase) +{ + if (acpi_processor_count == CPU_MAP_LIMIT) { + DBG( "No more room for ACPI processor structures\n"); + return; + } + acpi_processors[acpi_processor_count].ns = *ns; + acpi_processors[acpi_processor_count].id = id; + acpi_processors[acpi_processor_count].pmbase = pmbase; + acpi_processor_count++; +} + +static U8 *parse_acpi_processor(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *new_end = current; + U8 *temp; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + U8 id; + U32 pmbase; + + (void)end; + + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + + temp = current; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); + if (current == temp) + return new_end; + + id = *current++; + pmbase = *(U32 *) current; + current += 4; + (void)current; // Silent a warning reported by the clang static analizer . + +#if DEBUG_ACPI_DECODE + DBG( "Found CPU object: "); + dprint_namespace(&new_ns); + DBG( " id = 0x%x pmbase = 0x%x\n", id, pmbase); +#endif + add_processor(&new_ns, id, pmbase); + + return new_end; +} + +static U8 *parse_acpi_namedobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning namedobj: 0x%02x at memory location %p\n", *current, current); + switch (*current) { + case AML_EXT_OP_PREFIX: + { + if (*(current + 1) == AML_MUTEX_OP) { + struct acpi_namespace new_ns; + + current += 2; + current = parse_acpi_namestring(ns, &new_ns, current, end); +#if DEBUG_ACPI_DECODE + DBG( "Mutex: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + current++; /* SyncFlags */ + } else if (*(current + 1) == AML_OPREGION_OP) { + struct acpi_namespace new_ns; + + current += 2; + DBG( "OpRegion at memory location %p\n", current); + current = parse_acpi_namestring(ns, &new_ns, current, end); +#if DEBUG_ACPI_DECODE + DBG( "OpRegion name: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + current++; + current = parse_acpi_termarg(ns, current, end); + current = parse_acpi_termarg(ns, current, end); +#if DEBUG_ACPI_DECODE + DBG( "End OpRegion: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + } else if (*(current + 1) == AML_FIELD_OP) { + U32 pkglen = 0; + U32 lengthEncoding = 0; + + current += 2; + DBG( "FieldOp at memory location %p\n", current); + parsePackageLength(current, &pkglen, &lengthEncoding); + current += pkglen; + } else if (*(current + 1) == AML_DEVICE_OP) { + U8 *new_end; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + + current += 2; + new_end = current; + DBG( "DeviceOp at memory location %p\n", current); + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); +#if DEBUG_ACPI_DECODE + DBG( "DeviceOp name: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + + parse_acpi_objectlist(&new_ns, current, new_end); + current = new_end; + } else if (*(current + 1) == AML_PROCESSOR_OP) { + current += 2; + current = parse_acpi_processor(ns, current, end); + } else if (*(current + 1) == AML_INDEXFIELD_OP) { + U8 *new_end; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + + current += 2; + new_end = current; + DBG( "IndexFieldOp at memory location %p\n", current); + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); +#if DEBUG_ACPI_DECODE + DBG( "IndexFieldOp name: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + parse_acpi_objectlist(&new_ns, current, new_end); + current = new_end; + } + break; + } + case AML_METHOD_OP: + { + current++; + current = parse_acpi_method(ns, current, end); + break; + } + default: + break; + } + return current; +} + +static U8 *parse_acpi_type1opcode(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning type1opcode: 0x%02x at memory location %p\n", *current, current); + switch (*current) { + case AML_IF_OP: + { + U8 *new_end; + U32 pkgLen = 0; + U32 lengthEncoding = 0; + + DBG( "Found IfOp\n"); + current++; + parsePackageLength(current, &pkgLen, &lengthEncoding); + new_end = current + pkgLen; + current += lengthEncoding; + + current = parse_acpi_termarg(ns, current, new_end); + parse_acpi_termlist(ns, current, new_end); + current = new_end; + break; + } + case AML_ELSE_OP: + { + U8 *new_end; + U32 pkgLen = 0; + U32 lengthEncoding = 0; + + DBG( "Found ElseOp\n"); + current++; + parsePackageLength(current, &pkgLen, &lengthEncoding); + new_end = current + pkgLen; + current += lengthEncoding; + + parse_acpi_termlist(ns, current, new_end); + current = new_end; + break; + } + case AML_RETURN_OP: + { + DBG( "Found ReturnOp\n"); + current++; + current = parse_acpi_termarg(ns, current, end); + break; + } + default: + break; + } + return current; +} + +static U8 *parse_acpi_type2opcode(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + DBG( "Beginning type2opcode: 0x%02x at memory location %p\n", *current, current); + + current = parse_acpi_package(ns, current, end); + if (current != temp) + return current; + + switch (*current) { + case AML_LNOT_OP: + current++; + DBG( "Found logical not operator\n"); + current = parse_acpi_termarg(ns, current, end); + break; + + case AML_LAND_OP: + case AML_LOR_OP: + case AML_LEQUAL_OP: + case AML_LGREATER_OP: + case AML_LLESS_OP: + DBG( "Found logical binary operator: %c\n", "&|!=><"[*current - AML_LAND_OP]); + current++; + current = parse_acpi_termarg(ns, current, end); + current = parse_acpi_termarg(ns, current, end); + break; + + case AML_EXT_OP_PREFIX: + { + if (*(current + 1) == AML_COND_REF_OF_OP) { + DBG( "Found CondRefOf\n"); + current += 2; + current = parse_acpi_supername(ns, current, end); + current = parse_acpi_target(ns, current, end); + } + break; + } + case AML_STORE_OP: + { + DBG( "Found StoreOp\n"); + current++; + current = parse_acpi_termarg(ns, current, end); + current = parse_acpi_supername(ns, current, end); + break; + } + default: + { + current = parse_acpi_namestring(ns, NULL, current, end); + if (current == temp) + break; + current = parse_acpi_termarglist(ns, current, end); + } + } + return current; +} + +static U8 *parse_acpi_package(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + if (*current == AML_PACKAGE_OP) { + U32 pkglen = 0; + U32 lengthEncoding = 0; + + DBG( "Found PackageOp\n"); + current++; + parsePackageLength(current, &pkglen, &lengthEncoding); + current += pkglen; + } + return current; +} + +static U8 *parse_acpi_dataobject(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_computationaldata(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_package(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_termarg(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + DBG( "Beginning termarg: 0x%02x at memory location %p\n", *current, current); + + current = parse_acpi_type2opcode(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_dataobject(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_argobj(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_localobj(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_namespacemodifierobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning namespacemodifierobj: 0x%02x at memory location %p\n", *current, current); + switch (*current) { + case AML_SCOPE_OP: + { + U8 *new_end; + struct acpi_namespace new_ns; + U32 scopeLen = 0; + U32 lengthEncoding = 0; + + current++; + parsePackageLength(current, &scopeLen, &lengthEncoding); + new_end = current + scopeLen; + + current = parse_acpi_namestring(ns, &new_ns, current + lengthEncoding, new_end); +#if DEBUG_ACPI_DECODE + DBG( "Found Scope: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + parse_acpi_termlist(&new_ns, current, new_end); +#if DEBUG_ACPI_DECODE + DBG( "End Scope: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + current = new_end; + break; + } + case AML_NAME_OP: + current++; + current = parse_acpi_namestring(ns, NULL, current, end); + current = parse_acpi_datarefobject(ns, current, end); + break; + case AML_ALIAS_OP: + current++; + current = parse_acpi_namestring(ns, NULL, current, end); + current = parse_acpi_namestring(ns, NULL, current, end); + break; + default: + break; + } + return current; +} + +static U8 *parse_acpi_objectlist(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning objectlist: 0x%02x at memory location %p end=%p\n", *current, current, end); + while (current < end) { + U8 *temp = current; + + DBG( "New iteration of objectlist: 0x%02x at memory location %p end=%p\n", *current, current, end); + + current = parse_acpi_namespacemodifierobj(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_namedobj(ns, current, end); + if (current != temp) + continue; + + if (current == temp) { + DBG( "Unhandled object in object list: 0x%02x at memory location %p\n", *current, current); +#if DEBUG_ACPI_DECODE + DBG( "namespace: "); + dprint_namespace(ns); + DBG( "\n"); +#endif + break; + } + } + DBG( "Ending objectlist: 0x%02x at memory location %p\n", *current, current); + return current; +} + +static U8 *parse_acpi_termarglist(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning termarglist: 0x%02x at memory location %p\n", *current, current); + while (current < end) { + U8 *temp = current; + + current = parse_acpi_termarg(ns, current, end); + if (current == temp) { + DBG( "Unhandled item in term arg list: 0x%02x at memory location %p\n", *current, current); +#if DEBUG_ACPI_DECODE + DBG( "namespace: "); + dprint_namespace(ns); + DBG( "\n"); +#endif + break; + } + } + return current; +} + +void parse_acpi_termlist(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + while (current < end) { + U8 *temp = current; + + DBG( "Beginning new term in term list: 0x%02x at memory location %p\n", *current, current); + + current = parse_acpi_namespacemodifierobj(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_namedobj(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_type1opcode(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_type2opcode(ns, current, end); + if (current != temp) + continue; + + switch (*current) { + default: + { + DBG( "Unhandled item in term list: 0x%02x at memory location %p\n", *current, current); +#if DEBUG_ACPI_DECODE + DBG( "namespace: "); + dprint_namespace(ns); + DBG( "\n"); +#endif + return; + } + } + } +} diff --git a/i386/modules/AcpiCodec/ACPICodec.c b/i386/modules/AcpiCodec/ACPICodec.c new file mode 100755 index 0000000..6e2f502 --- /dev/null +++ b/i386/modules/AcpiCodec/ACPICodec.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2010,2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "modules.h" +#include "bootstruct.h" +#include "acpi_codec.h" + +void ACPICodec_start(void); +void ACPICodec_start(void) +{ + replace_function("_setupAcpi",&AcpiSetup); +} \ No newline at end of file diff --git a/i386/modules/AcpiCodec/Cconfig b/i386/modules/AcpiCodec/Cconfig new file mode 100644 index 0000000..239c2b9 --- /dev/null +++ b/i386/modules/AcpiCodec/Cconfig @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config ACPICODEC_MODULE + tristate "ACPICodec Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/AcpiCodec/Makefile b/i386/modules/AcpiCodec/Makefile new file mode 100755 index 0000000..7470183 --- /dev/null +++ b/i386/modules/AcpiCodec/Makefile @@ -0,0 +1,13 @@ +MODULE_NAME = ACPICodec +MODULE_DESCRIPTION = This module provides a remplacement for the internal acpi patcher +MODULE_AUTHOR = "Cparm" +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = ACPICodec + +MODULE_OBJS = ACPICodec.o acpi_tools.o acpi_codec.o acpidecode.o acpicode.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/AcpiCodec/Readme.txt b/i386/modules/AcpiCodec/Readme.txt new file mode 100644 index 0000000..9f8ee15 --- /dev/null +++ b/i386/modules/AcpiCodec/Readme.txt @@ -0,0 +1,130 @@ +Module: ACPICodec +Description: This module provides a remplacement for the internal acpi patcher +Dependencies: none + +Help: + +AcpiCodec module: (Warning: acpi signature not implemented) +------------------ + IMPORTANT NOTE: 1- with AcpiCodec all aml files must be placed in /Extra/Acpi/, alternate or overridden path is no longer supported + + 2- the name of the aml file(s) is not important anymore but it must contain the extention .aml, for example let suppose that you have 3 aml files: dsdt.aml, ssdt-0.aml and ssdt-1.aml + you can rename your dsdt file into blablabr.aml, and rename your ssdt files into blablablaen.aml and blablablablada.aml, acpicodec will auto-magically detect those files as 2 ssdt and one dsdt + + RestartFix=Yes|No Enable/Disable internal restart fix patch (Enabled by default, only available for intel platform). + + ResetType=0|1 0 : PCI reset (Default) + 1 : keyboard reset + + EnableSpeedStep=Yes|No Enable/Disable GenerateCStates & GeneratePStates (Disabled by default). + + GeneratePStates=Yes|No Enable/Disable Generate P-states SSDT table (Disabled by default). + GenerateCStates=Yes|No Enable/Disable Generate C-states SSDT table (Disabled by default). + EnableC4State=Yes|No Enable C4 state in C-states SSDT table, GenerateCStates=Yes is needed (Disabled by default). + + StripAPICTable=Yes|No Enable/Disable Generate a stripped MADT (APIC) table (Enabled by default). + + IntelFADTSpec=Yes|No Enable/Disable Intel recommendations for the FADT table (Enabled by default). + Warning : When enabled, this setting disable the C2 and C3 C-states, but be aware that these are the Intel's recommendations for the newest CPU, + if you really need those c-states please disable IntelFADTSpec. + + P-States=<dict> P-States fine tuning method, see usage below(GeneratePStates=Yes is needed). + ACPIDropTables=<dict> drop acpi table(s) method (can drop any unwanted tables), see usage below. + C-States=<dict> C-States fine tuning method, see usage below(GenerateCStates=Yes is needed). + + + UpdateACPI=Yes|No Enable/Disable ACPI version update(Disabled by default). + + MaxBusRatio=<n> (was BusRatio) Set the current Bus Ratio to n, + n must be a multiple of 10, + (eg. if you want to set a bus ratio to 8.5, n will be + 8.5*10=85), + if n = 0, MaxBusRatio = Disable, + if set, Acpipatcher will drop every P-states with + a bus ratio higher than n. + + MinBusRatio=<n> Set the Minimum Bus Ratio to n, + n must be a multiple of 10, + (eg. if you want to set the bus ratio to 8.5, n will be + 8.5*10=85), if set Acpipatcher will drop every + P-states with a bus ratio lower than n, + if n = 0, MinBusRatio = Disable. + + P-States usage e.g: (by default all numbers must be expressed in base 16, + except the pss statue key and base key itself) + + <key>P-States</key> + <dict> + <key>0</key> // the pss status (must be expressed in Base 10) + <dict> + <key>Bus Master Latency</key> + <string>10</string> + <key>Control</key> + <string>18719</string> + <key>CoreFreq</key> + <string>3164</string> + <key>Transition Latency</key> + <string>10</string> + </dict> + <key>1</key> // the pss status (must be expressed in Base 10) + . + . + . + <dict/> + <key>2</key> // the pss status (must be expressed in Base 10) + . + . + . + <dict/> + <key>X</key> // the pss status (must be expressed in Base 10) + . + . + . + <dict/> + <key>Base</key> + <string>10</string> // must always be expressed in Base 10 + <key>Mode</key> + <string>Default</string> + </dict> + + + C-States usage e.g: (by default all numbers must be expressed in base 16, + except the base key itself) + + <key>C-states</key> + <dict> + <key>C1</key> + <dict> + <key>Latency</key> + <string>THE LATENCY FOR THIS STATE</string> + <key>Power</key> + <string>THE POWER FOR THIS STATE</string> + </dict> + . + . + <key>C4</key> + <dict> + <key>Latency</key> + <string>THE LATENCY FOR THIS STATE</string> + <key>Power</key> + <string>THE POWER FOR THIS STATE</string> + </dict> + </dict> + + ACPIDropTables usage e.g: + + <key>ACPIDropTables</key> + <dict> + <key>SSDT</key> + <string></string> // drop SSDT table(s) + <key>TAMG</key> + <string>Yes</string> //drop TAMG table + <key>ECDT</key> + <string>ANY_VALUE_EXCEPT_NO</string> //drop ECDT table + <key>XXXX</key> + <string></string> //drop XXXX table (if exist) + <key>YYYY</key> + <string>No</string> //do not drop YYYY table (if exist) + </dict> + +EE2D707564081AB603703E236BBA252A8F712D0B2BA5D7AB3D4DFDB59C97570912EBD6FEE4868CEE130E8473FECE30BD272128A255BE1DFDB9CEB0FAF0504B0102140314030100630004731141000000007D0000008B00000003000B00000000000000208080810000000062696E0199070002004145030800504B050600000000010001003C000000A90000000000 diff --git a/i386/modules/AcpiCodec/acpi_codec.c b/i386/modules/AcpiCodec/acpi_codec.c new file mode 100755 index 0000000..8e737a0 --- /dev/null +++ b/i386/modules/AcpiCodec/acpi_codec.c @@ -0,0 +1,5179 @@ +/* + * Copyright 2008 mackerintel + */ + +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright (c) 2011,2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "bootstruct.h" +#include "acpi.h" +#include "acpidecode.h" +#include "acpicode.h" +#include "efi_tables.h" +#include "fake_efi.h" +#include "acpi_codec.h" +#include "platform.h" +#include "cpu.h" +#include "xml.h" +#include "sl.h" +#include "convert.h" +#include "modules.h" +#include "pci.h" +#include "pci_root.h" + +U64 rsd_p; +ACPI_TABLES acpi_tables; +U32 uuid32; +U32 Model32; +bool checkOem = false; + +extern EFI_STATUS addConfigurationTable(); + +extern EFI_GUID gEfiAcpiTableGuid; +extern EFI_GUID gEfiAcpi20TableGuid; + +#ifndef DEBUG_ACPI +#define DEBUG_ACPI 0 +#endif + +#if DEBUG_ACPI==2 +#define DBG(x...) {printf(x); sleep(1);} +#elif DEBUG_ACPI==1 +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +#define OLD_SSDT 0 +#define BETA 0 +#define BUILD_ACPI_TSS 0 +#define pstate_power_support 1 + +#if BETA +#ifdef pstate_power_support +#undef pstate_power_support +#endif +#define pstate_power_support 1 +#endif + +#if DEBUG_ACPI +static void print_nameseg(U32 i); +#endif + +static ACPI_TABLE_HEADER * get_new_table_in_list(U32 *new_table_list, U32 Signature, U8 *retIndex ); +static U8 get_number_of_tables_in_list(U32 *new_table_list, U32 Signature ); +static U8 get_0ul_index_in_list(U32 *new_table_list, bool reserved ); +static void sanitize_new_table_list(U32 *new_table_list ); +static void move_table_list_to_kmem(U32 *new_table_list ); +static ACPI_TABLE_RSDP * gen_alloc_rsdp_v2_from_v1(ACPI_TABLE_RSDP *rsdp ); +static ACPI_TABLE_RSDT * gen_alloc_rsdt_from_xsdt(ACPI_TABLE_XSDT *xsdt); +static ACPI_TABLE_XSDT * gen_alloc_xsdt_from_rsdt(ACPI_TABLE_RSDT *rsdt); +#if 0 +static void MakeAcpiSgn(void); +#endif +static void *loadACPITable(U32 *new_table_list, char *dirspec, const char *filename ); +static int generate_cpu_map_from_acpi(ACPI_TABLE_DSDT * DsdtPointer); +static ACPI_GENERIC_ADDRESS FillGASStruct(U32 Address, U8 Length); +static U32 process_xsdt (ACPI_TABLE_RSDP *rsdp_mod , U32 *new_table_list); +static U32 process_rsdt(ACPI_TABLE_RSDP *rsdp_mod , bool gen_xsdt, U32 *new_table_list); +static ACPI_TABLE_FADT * patch_fadt(ACPI_TABLE_FADT *fadt, ACPI_TABLE_DSDT *new_dsdt, bool UpdateFADT); + + +#define IA32_MISC_ENABLES 0x01A0 +#define MSR_TURBO_POWER_CURRENT_LIMIT 0x1AC +#define MSR_PKG_CST_CONFIG_CONTROL 0x00E2 +#define MSR_RAPL_POWER_UNIT 0x606 +#define MSR_PKG_RAPL_POWER_LIMIT 0x610 +static U32 turbo_enabled = 0; +static U32 ProcessMadt(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info, void * buffer, U32 bufferSize, U32 NB_CPU); +static U32 buildMADT(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info); +static U32 BuildSsdt(MADT_INFO * madt_info, ACPI_TABLE_DSDT *dsdt, void * buffer, U32 bufferSize, bool enable_cstates, bool enable_pstates, bool enable_tstates); +static bool is_sandybridge(void); +static bool is_jaketown(void); +static U32 encode_pstate(U32 ratio); +static void collect_cpu_info(CPU_DETAILS * cpu); +#ifndef BETA +//static U32 BuildCoreIPstateInfo(CPU_DETAILS * cpu); +#endif +static U32 BuildCstateInfo(CPU_DETAILS * cpu, U32 pmbase); +static U32 BuildPstateInfo(CPU_DETAILS * cpu); +static U32 ProcessSsdt(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info, bool enable_cstates, bool enable_pstates, bool enable_tstates ); +static void * buildCpuScope (void * current, U32 cpu_namespace, PROCESSOR_NUMBER_TO_NAMESEG * aslCpuNamePath); +static void * buildPDC(void * current); +static void * buildOSC(void * current); +static void * buildPSS(void * current, PKG_PSTATES * pkg_pstates); +static void * buildPSD(void * current, U32 domain, U32 cpusInDomain, U32 pstate_coordination); +static void * buildPPC(void * current); +static void * buildPCT(void * current); +static void * buildCstate(void * current, ACPI_GENERIC_ADDRESS * gas, CSTATE * cstate); +static void * buildReturnPackageCST(void * current, PKG_CSTATES * pkg_cstates); +static void * buildCST(void * current, PKG_CSTATES * mwait_pkg_cstates, PKG_CSTATES * io_pkg_cstates); +#if BUILD_ACPI_CSD +static void * buildCSD(void * current, U32 domain, U32 cpusInDomain, PKG_CSTATES * pkg_cstates); +#endif +#if BUILD_ACPI_TSS +static U32 BuildTstateInfo(CPU_DETAILS * cpu); +static void * buildTPC(void * current); +static void * buildPTC(void * current); +static void * buildTSS(void * current, PKG_TSTATES * pkg_tstates); +static void * buildTSD(void * current, U32 domain, U32 cpusInDomain); +#endif +#if pstate_power_support +static U64 mulU64byU64(U64 a, U64 b, U64 * high); +static U32 compute_pstate_power(CPU_DETAILS * cpu, U32 ratio, U32 TDP); +#endif +#if BUILD_ACPI_TSS || pstate_power_support +static U64 divU64byU64(U64 n, U64 d, U64 * rem); +static U32 compute_tdp(CPU_DETAILS * cpu); +#endif +static bool is_sandybridge(void); +static bool is_jaketown(void); +static U32 get_bclk(void); +static void GetMaxRatio(U32 * max_non_turbo_ratio); +//static U32 computePstateRatio(const U32 max, const U32 min, const U32 turboEnabled, const U32 numStates, const U32 pstate); +//static U32 computeNumPstates(const U32 max, const U32 min, const U32 turboEnabled, const U32 pssLimit); + +#if UNUSED +static ACPI_TABLE_FACS* generate_facs(bool updatefacs ); +#endif + +#define MAX_NON_SSDT_TABLE 15 +#define MAX_SSDT_TABLE 15 // 15 additional SSDT tables +#define MAX_ACPI_TABLE MAX_NON_SSDT_TABLE + MAX_SSDT_TABLE + +// Security space for SSDT , FACP & MADT table generation, +// the size can be increased +// note: the table will not placed in the reserved space if the 'normal' space is not full +#define RESERVED_AERA 3 + +#define ACPI_TABLE_LIST_FULL MAX_ACPI_TABLE + RESERVED_AERA + 1 + +#define ACPI_TABLE_LIST_FULL_NON_RESERVED MAX_ACPI_TABLE + 1 + +#ifndef ULONG_MAX_32 +#define ULONG_MAX_32 4294967295UL +#endif + +#define __RES(s, u) \ +static inline unsigned u \ +resolve_##s(unsigned u defaultentry, char *str, int base) \ +{ \ +unsigned u entry = defaultentry; \ +if (str && (strcmp(str,"Default") != 0)) { \ +entry = strtoul((const char *)str, NULL,base); \ +} \ +return entry; \ +} + +__RES(pss, long) +__RES(cst, int) + +static ACPI_TABLE_HEADER * get_new_table_in_list(U32 *new_table_list, U32 Signature, U8 *retIndex ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + *retIndex = 0; + + for (index = 0; index < (MAX_ACPI_TABLE + RESERVED_AERA); index++) + { + if (*(U32 *) (table_array[index]->Signature) == Signature) + { + *retIndex = index; + return table_array[index] ; + } + } + return (void*)0ul; +} + +static U8 get_number_of_tables_in_list(U32 *new_table_list, U32 Signature ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + U8 InstalledTables = 0; + + for (index = 0; index < (MAX_ACPI_TABLE + RESERVED_AERA); index++) + { + if (*(U32 *) (table_array[index]->Signature) == Signature) + { + InstalledTables++ ; + } + } + return InstalledTables; +} + +static U8 get_0ul_index_in_list(U32 *new_table_list, bool reserved ) +{ + U8 index ; + + U8 maximum = (reserved == true) ? MAX_ACPI_TABLE + RESERVED_AERA : MAX_ACPI_TABLE; + + for (index = 0; index < maximum; index++) + { + if (new_table_list[index] == 0ul) + { + return index ; + } + } + return (reserved == true)? ACPI_TABLE_LIST_FULL : ACPI_TABLE_LIST_FULL_NON_RESERVED; +} + +/* cparm : This time we check it by the acpi signature */ +static void sanitize_new_table_list(U32 *new_table_list ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + + for (index = 0; index < MAX_ACPI_TABLE; index++) + { + U32 current_sig = *(U32 *) (table_array[index]->Signature); + + if ((current_sig == NAMESEG(ACPI_SIG_FACS) /* not supported */ ) + || (current_sig == NAMESEG(ACPI_SIG_XSDT)) + || (current_sig == NAMESEG(ACPI_SIG_RSDT)) || (*(volatile U64 *)table_array[index] == NAMESEG64(ACPI_SIG_RSDP)) ) + { + + void *buf = (void*)new_table_list[index]; + free(buf); + new_table_list[index] = 0ul ; + } + } +} + +/* cparm : move all tables to kernel memory */ +static void move_table_list_to_kmem(U32 *new_table_list ) +{ + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + U8 index ; + + for (index = 0; index < MAX_ACPI_TABLE; index++) + { + if (new_table_list[index] != 0ul) + { + + U32 current_sig = *(U32 *) (table_array[index]->Signature); + if ((current_sig != NAMESEG(ACPI_SIG_FACS) /* not supported */ ) + && (current_sig != NAMESEG(ACPI_SIG_XSDT)) + && (current_sig != NAMESEG(ACPI_SIG_RSDT)) && (*(volatile U64 *)table_array[index] != NAMESEG64(ACPI_SIG_RSDP)) + && (GetChecksum(table_array[index], table_array[index]->Length) == 0)) + { + + void *tableAddr=(void*)AllocateKernelMemory(table_array[index]->Length); + if (!tableAddr) { + printf("Unable to allocate kernel memory for aml file "); + + void *buf = (void*)new_table_list[index]; + free(buf); + new_table_list[index] = 0ul ; + continue; + } + bcopy(table_array[index], tableAddr, table_array[index]->Length); + new_table_list[index] = 0ul ; + new_table_list[index] = (U32)tableAddr ; + + } + else + { + + void *buf = (void*)new_table_list[index]; + free(buf); + new_table_list[index] = 0ul ; + } + } + } +} + +static ACPI_TABLE_RSDP * gen_alloc_rsdp_v2_from_v1(ACPI_TABLE_RSDP *rsdp ) +{ + + ACPI_TABLE_RSDP * rsdp_conv = (ACPI_TABLE_RSDP *)AllocateKernelMemory(sizeof(ACPI_TABLE_RSDP)); + + if (rsdp_conv) { + bzero(rsdp_conv, sizeof(ACPI_TABLE_RSDP)); + memcpy(rsdp_conv, rsdp, ACPI_RSDP_REV0_SIZE); + + /* Add/change fields */ + rsdp_conv->Revision = 2; /* ACPI version 3 */ + rsdp_conv->Length = sizeof(ACPI_TABLE_RSDP); + + /* Correct checksums */ + setRsdpchecksum(rsdp_conv); + setRsdpXchecksum(rsdp_conv); + } + + return (rsdp_conv) ? rsdp_conv : (void*)0ul ; +} + +static ACPI_TABLE_RSDT * gen_alloc_rsdt_from_xsdt(ACPI_TABLE_XSDT *xsdt) +{ + U32 index; + U32 num_tables; + + DBG("Attempting to generate RSDT from XSDT \n"); + + num_tables= get_num_tables64(xsdt); + + ACPI_TABLE_RSDT * rsdt_conv=(ACPI_TABLE_RSDT *)AllocateKernelMemory(sizeof(ACPI_TABLE_HEADER)+(num_tables * 4)); + if (!rsdt_conv) + { + printf("Unable to allocate kernel memory for rsdt conv\n"); + return (void*)0ul; + } + + + bzero(rsdt_conv, sizeof(ACPI_TABLE_HEADER)+(num_tables * 4)); + memcpy(&rsdt_conv->Header, &xsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + rsdt_conv->Header.Signature[0] = 'R'; + rsdt_conv->Header.Signature[1] = 'S'; + rsdt_conv->Header.Signature[2] = 'D'; + rsdt_conv->Header.Signature[3] = 'T'; + rsdt_conv->Header.Length = sizeof(ACPI_TABLE_HEADER)+(num_tables * 4); + + for (index=0;index<num_tables;index++) + { + U64 ptr = xsdt->TableOffsetEntry[index]; + + { + if (ptr > ULONG_MAX) + { +#if DEBUG_ACPI + printf("Warning xsdt->TableOffsetEntry[%d]: Beyond addressable memory in this CPU mode, ignored !!!\n",index); +#endif + continue; + } +#if DEBUG_ACPI + printf("* Processing : "); + print_nameseg(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature); + printf("\n"); +#endif + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(((ACPI_TABLE_HEADER *) (unsigned long)ptr), + ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning : Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + { + if (*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature == NAMESEG(ACPI_SIG_FADT)) + { + ACPI_TABLE_FADT *fadt=(ACPI_TABLE_FADT *)((U32)ptr); + + ACPI_TABLE_FADT *fadt_conv = (void*)0ul; + + if (fadt->Header.Revision > 1) + { + U8 buffer[0x74]; + DBG("Downgrading ACPI V%d FADT to ACPI V1 FADT \n", fadt->Header.Revision); + fadt_conv=(ACPI_TABLE_FADT *)buffer; + memcpy(fadt_conv, fadt, 0x74); + fadt_conv->Header.Length = 0x74; + fadt_conv->Header.Revision = 0x01; + SetChecksum(&fadt_conv->Header); + } + else + { + fadt_conv = fadt; + } + + ACPI_TABLE_FADT *fadt_mod = patch_fadt(fadt_conv, ((ACPI_TABLE_DSDT*)((U32)fadt->XDsdt)), false); + if (fadt_mod == (void*)0ul) + { + printf("Error: Failed to patch FADT Table, trying wiht the original fadt pointer\n"); + fadt_mod = fadt; + } + + rsdt_conv->TableOffsetEntry[index] = ((U32)fadt_mod); +#if DEBUG_ACPI + print_nameseg(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature); + printf(" table converted and added succesfully\n"); +#endif + continue; + } + } + + { + rsdt_conv->TableOffsetEntry[index] = (U32)ptr; +#if DEBUG_ACPI + print_nameseg(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature); + printf(" table converted and added succesfully\n"); +#endif + } + + } + DBG("RSDT_CONV : Original checksum %d\n", rsdt_conv->Header.Checksum); + SetChecksum(&rsdt_conv->Header); + DBG("New checksum %d\n", rsdt_conv->Header.Checksum); + + return rsdt_conv; +} + +static ACPI_TABLE_XSDT * gen_alloc_xsdt_from_rsdt(ACPI_TABLE_RSDT *rsdt) +{ + U32 index; + U32 num_tables; + + DBG("Attempting to generate XSDT from RSDT \n"); + + num_tables= get_num_tables(rsdt); + + ACPI_TABLE_XSDT * xsdt_conv=(ACPI_TABLE_XSDT *)AllocateKernelMemory(sizeof(ACPI_TABLE_HEADER)+(num_tables * 8)); + + if (!xsdt_conv) { + printf("Unable to allocate kernel memory for xsdt conv\n"); + return (void*)0ul; + } + + bzero(xsdt_conv, sizeof(ACPI_TABLE_HEADER)+(num_tables * 8)); + memcpy(&xsdt_conv->Header, &rsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + xsdt_conv->Header.Signature[0] = 'X'; + xsdt_conv->Header.Signature[1] = 'S'; + xsdt_conv->Header.Signature[2] = 'D'; + xsdt_conv->Header.Signature[3] = 'T'; + xsdt_conv->Header.Length = sizeof(ACPI_TABLE_HEADER)+(num_tables * 8); + + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) rsdt->TableOffsetEntry; + + for (index=0;index<num_tables;index++) + { + { +#if DEBUG_ACPI + printf("* Processing : "); + print_nameseg(*(U32*) (table_array[index]->Signature)); + printf("\n"); +#endif + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(table_array[index], table_array[index]->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning : Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + { + if (*(U32 *) (table_array[index]->Signature) == NAMESEG(ACPI_SIG_FADT)) + { + ACPI_TABLE_FADT *FacpPointer = ((ACPI_TABLE_FADT*)table_array[index]); + ACPI_TABLE_FADT *fadt_mod = (ACPI_TABLE_FADT *)patch_fadt(FacpPointer,((ACPI_TABLE_DSDT*)FacpPointer->Dsdt),true); + if (fadt_mod == (void*)0ul) + { + printf("Error: Failed to patch (& update) FADT Table, fallback to original fadt pointer\n"); + fadt_mod = FacpPointer; + } + xsdt_conv->TableOffsetEntry[index] = ((U64)((U32)fadt_mod)); + + continue; + } + } + + xsdt_conv->TableOffsetEntry[index] = ((U64)((U32)table_array[index])); + } + DBG("XSDT_CONV : Original checksum %d\n", xsdt_conv->Header.Checksum); + SetChecksum(&xsdt_conv->Header); + DBG("New checksum %d\n", xsdt_conv->Header.Checksum); + + return xsdt_conv; +} + +#if ACPISGN +static void MakeAcpiSgn(void) +{ + + char * DefaultplatformName = NULL; + Model32 = 0; + + if ((DefaultplatformName = readDefaultPlatformName())) + { + Model32 = OSSwapHostToBigInt32(adler32( (unsigned char *) DefaultplatformName, strlen(DefaultplatformName))); + } + + uuid32 = 0; + + const char *uuidStr = getStringFromUUID((int8_t*)(uint32_t)get_env(envSysId)); + + if (strlen(uuidStr)) + { + uuid32 = OSSwapHostToBigInt32(adler32( (unsigned char *) uuidStr, UUID_STR_LEN )); + } + +} +#endif + +static void *loadACPITable(U32 *new_table_list, char *dirspec, const char *filename ) +{ + int fd = -1; + char acpi_file[512]; + + DBG("Searching for %s file ...\n", filename); + // Check booting partition + + sprintf(acpi_file, "%s%s",dirspec, filename); + + fd=open(acpi_file,0); + + if (fd<0) + { + DBG("Couldn't open ACPI Table: %s\n", acpi_file); + return (void *)0ul ; + } + + void *tableAddr=(void*)malloc(file_size (fd)); + + if (tableAddr) + { + if (read (fd, tableAddr, file_size (fd))!=file_size (fd)) + { + printf("Couldn't read table %s\n",acpi_file); + free (tableAddr); + close (fd); + return (void *)0ul ; + } + + close (fd); + + ACPI_TABLE_HEADER * header = (ACPI_TABLE_HEADER *)tableAddr; + + if (*(U32*)(header->Signature) != NAMESEG("SSDT")) + { + U8 dummy = 0; + if (get_new_table_in_list(new_table_list, *(U32*)(header->Signature), &dummy)) + { +#if DEBUG_ACPI + printf("Warning: A "); + print_nameseg(*(U32*) (header->Signature)); + printf(" Aml file is already loaded and registred, file skipped !!\n"); +#endif + free(tableAddr); + return (void*)0ul; + } + } + else + { + if (get_number_of_tables_in_list(new_table_list, NAMESEG("SSDT")) >= MAX_SSDT_TABLE) + { + DBG("Warning: Max number of SSDT aml files reached, file skipped !!\n"); + free(tableAddr); + return (void*)0ul; + } + } + + + if (checkOem == true) + { + if (header->OemRevision == Model32) + { + goto continue_loading; + } + + if (header->OemRevision == uuid32) + { + goto continue_loading; + } + + DBG("Bad signature aka Oem Revision (0x%08lx) for Aml file (%s), file skipped !!\n", header->OemRevision, acpi_file); + DBG("uuid32 (0x%08lx) , model32 (0x%08lx)\n", uuid32, Model32); + + free(tableAddr); + return (void*)0ul; + } + + continue_loading: + + if (GetChecksum(header, header->Length) == 0) + { + DBG("Found valid AML file : %s ", filename); + verbose("[ %s ] read and stored at: %x", acpi_file, tableAddr); + printf("\n"); + return tableAddr; + } + else + { + printf("Warning : Incorrect cheksum for the file : %s,", acpi_file); + printf(" this file will be dropped.\n"); + free(tableAddr); + return (void*)0ul; + } + } + else + { + printf("Couldn't allocate memory for table %s\n", acpi_file); + close (fd); + } + + return (void *)0ul ; +} + +static U32 pmbase; +static short cpuNamespace; +PROCESSOR_NUMBER_TO_NAMESEG cpu_map[CPU_MAP_LIMIT]; +unsigned int cpu_map_count; +int cpu_map_error; + +#if DEBUG_ACPI +static void print_nameseg(U32 i) +{ + printf("%c%c%c%c", + (int)(i & 0x000000ff), + (int)((i & 0x0000ff00) >> 8), + (int)((i & 0x00ff0000) >> 16), + (int)(i >> 24)); +} +#endif + +static int generate_cpu_map_from_acpi(ACPI_TABLE_DSDT * DsdtPointer) +{ + PROCESSOR_NUMBER_TO_NAMESEG *map = cpu_map; + U32 processor_namespace = 0; + U32 cpu; + U8 *current, *end; + ACPI_TABLE_HEADER *header; + struct acpi_namespace ns; + + if ((cpu_map_error == 1) || (DsdtPointer == (void*)0ul)) + return 1; + else if (cpu_map_count > 0) + return 0; + + DBG("Attempting to autodetect CPU map from ACPI DSDT; wish me luck\n"); + + current = (U8 *) DsdtPointer; + current = decodeTableHeader(current, &header); + end = current - sizeof(*header) + header->Length; + ns.depth = 0; + acpi_processor_count = 0; + //DBG("* DSDT debug start\n"); + parse_acpi_termlist(&ns, current, end); + //DBG("* DSDT debug end\n"); + + if (acpi_processor_count > CPU_MAP_LIMIT) + { + verbose("Too many processors: found %u processors\n", acpi_processor_count); + return (cpu_map_error = 1); + } + if (acpi_processor_count == 0) + { + verbose( "Found no processors in ACPI\n"); + return (cpu_map_error = 1); + } + for (cpu = 0; cpu < acpi_processor_count; cpu++) + { + U32 nameseg; + if (acpi_processors[cpu].pmbase) + { + U32 cpu_pmbase = acpi_processors[cpu].pmbase - 0x10; + if (pmbase && cpu_pmbase != pmbase) + { + verbose("Found inconsistent pmbase addresses in ACPI: 0x%x and 0x%x\n", pmbase, cpu_pmbase); + return (cpu_map_error = 1); + } + pmbase = cpu_pmbase; + } + if (acpi_processors[cpu].ns.depth > MAX_SUPPORTED_CPU_NAMESEGS + 1) + { + verbose("Processor path too deep: depth %u\n", acpi_processors[cpu].ns.depth); + return (cpu_map_error = 1); + } + if (processor_namespace && acpi_processors[cpu].ns.nameseg[0] != processor_namespace) + { + verbose("Processor namespaces inconsistent\n"); + return (cpu_map_error = 1); + } + processor_namespace = acpi_processors[cpu].ns.nameseg[0]; + map->acpi_processor_number = acpi_processors[cpu].id; + map->seg_count = acpi_processors[cpu].ns.depth - 1; + for (nameseg = 0; nameseg < map->seg_count; nameseg++) + map->nameseg[nameseg] = acpi_processors[cpu].ns.nameseg[nameseg + 1]; + map++; + } + if (!pmbase) + { + verbose("No pmbase found in ACPI\n"); + return (cpu_map_error = 1); + } + if (processor_namespace == NAMESEG("_PR_")) + cpuNamespace = CPU_NAMESPACE_PR; + else if (processor_namespace == NAMESEG("_SB_")) + cpuNamespace = CPU_NAMESPACE_SB; + else + { + verbose("Found processors in invalid namespace; not _PR_ or _SB_\n"); + return (cpu_map_error = 1); + } + cpu_map_count = map - cpu_map; + +#if DEBUG_ACPI + verbose("Found %d processors in ACPI, pmbase : 0x%x, cpu_map_count : %d, namespace : ",acpi_processor_count, pmbase, cpu_map_count ); + print_nameseg(processor_namespace); + verbose("\n"); + U32 i; + verbose("Found processors name : \n" ); + for ( i = 0; i<cpu_map_count; i++) + { + U32 nseg = *(U32*)cpu_map[i].nameseg; + print_nameseg(nseg); + verbose(" "); + } + verbose("\n"); +#endif + + // TODO: Save the cpu map into the device tree + return (cpu_map_error = 0); +} + +static bool is_sandybridge(void) +{ + return Platform.CPU.Model == CPU_MODEL_SANDYBRIDGE; +} + +static bool is_jaketown(void) +{ + return Platform.CPU.Model == CPU_MODEL_JAKETOWN; +} + +static U32 get_bclk(void) +{ + return (is_jaketown() || is_sandybridge()) ? 100 : 133; +} +/* + //----------------------------------------------------------------------------- + static U32 computePstateRatio(const U32 max, const U32 min, const U32 turboEnabled, const U32 numStates, const U32 pstate) + { + U32 ratiorange = max-min; + U32 numGaps = numStates-1-turboEnabled; + U32 adjPstate = pstate-turboEnabled; + return (pstate == 0) ? (max + turboEnabled) : + (ratiorange == 0) ? max : + max-(((adjPstate*ratiorange)+(numGaps/2))/numGaps); + } + //----------------------------------------------------------------------------- + static U32 computeNumPstates(const U32 max, const U32 min, const U32 turboEnabled, const U32 pssLimit) + { + U32 ratiorange, maxStates, numStates; + + ratiorange = max - min + 1; + maxStates = ratiorange + (turboEnabled ? 1 : 0); + numStates = (pssLimit < maxStates) ? pssLimit : maxStates; + return (numStates < 2) ? 0 : numStates; + } + */ +#if BUILD_ACPI_TSS || pstate_power_support +static U64 divU64byU64(U64 n, U64 d, U64 * rem) +{ + U32 i; + U64 q = n; + U64 r = 0; + + for (i = 0; i < 64; i++) { + r <<= 1; + r |= (q & (1ULL << 63)) >> 63; + q <<= 1; + if (r >= d) { + r -= d; + q |= 1; + } + } + if (rem) + *rem = r; + return q; +} + +static U32 compute_tdp(CPU_DETAILS * cpu) +{ + { + if (is_jaketown() || is_sandybridge()) + { + U64 power_limit_1 = cpu->package_power_limit & ((1ULL << 15) - 1); + U64 power_unit = cpu->package_power_sku_unit & ((1ULL << 4) - 1); + U64 tdp = divU64byU64(power_limit_1, 1 << power_unit, NULL); + return (U32)tdp; + } + else + { + // tdp = (TURBO_POWER_CURRENT_LIMIT MSR 1ACh bit [14:0] / 8) Watts + return cpu->tdp_limit / 8; + } + } + return (0); +} +#endif // BUILD_ACPI_TSS || pstate_power_support + +#if pstate_power_support +static U64 mulU64byU64(U64 a, U64 b, U64 * high) +{ + U64 b_high = 0; + U64 r_high = 0, r_low = 0; + U64 bit; + + for (bit = 1; bit; bit <<= 1) { + if (a & bit) { + if (r_low + b < r_low) + r_high++; + r_low += b; + r_high += b_high; + } + b_high <<= 1; + b_high |= (b & (1ULL << 63)) >> 63; + b <<= 1; + } + + if (high) + *high = r_high; + return r_low; +} + +static U32 compute_pstate_power(CPU_DETAILS * cpu, U32 ratio, U32 TDP) +{ + if (is_jaketown() || is_sandybridge()) + { + U32 P1_Ratio = cpu->max_ratio_as_mfg; + U64 M, pstate_power; + + // M = ((1.1 - ((P1_ratio - ratio) * 0.00625)) / 1.1) ^2 + // To prevent loss of precision compute M * 10^5 (preserves 5 decimal places) + M = (P1_Ratio - ratio) * 625; + M = (110000 - M); + M = divU64byU64(M, 11, NULL); + M = divU64byU64(mulU64byU64(M, M, NULL), 1000, NULL); + + // pstate_power = ((ratio/p1_ratio) * M * TDP) + // Divide the final answer by 10^5 to remove the precision factor + pstate_power = mulU64byU64(ratio, M, NULL); + pstate_power = mulU64byU64(pstate_power, TDP, NULL); + pstate_power = divU64byU64(pstate_power, P1_Ratio, NULL); + pstate_power = divU64byU64(pstate_power, 100000, NULL); + return (U32)pstate_power; // in Watts + } + else + { + // pstate_power[ratio] = (ratio/P1_ratio)^3 * Core_TDP + Uncore_TDP + + // Core_TDP = (TURBO_POWER_CURRENT_LIMIT MSR 1ACh bit [30:16] / 8) Watts + U32 Core_TDP = cpu->tdc_limit / 8; + + // Uncore_TDP = TDP - Core_TDP + U32 Uncore_TDP = TDP - Core_TDP; + + // max_ratio_as_mfg = P1_Ratio derived from Brand String returned by CPUID instruction + U32 P1_Ratio = cpu->max_ratio_as_mfg; + +#define PRECISION_FACTOR (U32) 30 +#define PRECISION_FACTOR_CUBED (U32) (PRECISION_FACTOR * PRECISION_FACTOR * PRECISION_FACTOR) + + U32 ratio_factor = (ratio * PRECISION_FACTOR)/P1_Ratio; + return ((ratio_factor * ratio_factor * ratio_factor * Core_TDP) / PRECISION_FACTOR_CUBED) + Uncore_TDP; + } + return (0); +} +#endif // pstate_power_support + +static U32 encode_pstate(U32 ratio) +{ + if (is_jaketown() || is_sandybridge()) + return ratio << 8; + return ratio; +} + +//----------------------------------------------------------------------------- +static void GetMaxRatio(U32 * max_non_turbo_ratio) +{ + U32 index; + U32 max_ratio=0; + U32 frequency=0; + U32 multiplier = 0; + char *BrandString; + // Verify CPUID brand string function is supported + if (Platform.CPU.CPUID[CPUID_80][0] < 80000004) + { + *max_non_turbo_ratio = max_ratio; + return; + } + BrandString = (char *)Platform.CPU.BrandString; + // -2 to prevent buffer overrun because looking for y in yHz, so z is +2 from y + for (index=0; index<48-2; index++) { + // format is either “x.xxyHz” or “xxxxyHz”, where y=M,G,T and x is digits + // Search brand string for “yHz” where y is M, G, or T + // Set multiplier so frequency is in MHz + if ( BrandString[index+1] == 'H' && BrandString[index+2] == 'z') + { + if (BrandString[index] == 'M') + multiplier = 1; + else if (BrandString[index] == 'G') + multiplier = 1000; + else if (BrandString[index] == 'T') + multiplier = 1000000; + } + if (multiplier > 0 && index >= 4 /* who can i call that, buffer underflow :-) ??*/) + { + // Copy 7 characters (length of “x.xxyHz”) + // index is at position of y in “x.xxyHz” + + // Compute frequency (in MHz) from brand string + if (BrandString[index-3] == '.') + { // If format is “x.xx” + if (isdigit(BrandString[index-4]) && isdigit(BrandString[index-2]) && + isdigit(BrandString[index-1])) + { + frequency = (U32)(BrandString[index-4] - '0') * multiplier; + frequency += (U32)(BrandString[index-2] - '0') * (multiplier / 10); + frequency += (U32)(BrandString[index-1] - '0') * (multiplier / 100); + } + } + else + { // If format is xxxx + if (isdigit(BrandString[index-4]) && isdigit(BrandString[index-3]) && + isdigit(BrandString[index-2]) && isdigit(BrandString[index-1])) + { + frequency = (U32)(BrandString[index-4] - '0') * 1000; + frequency += (U32)(BrandString[index-3] - '0') * 100; + frequency += (U32)(BrandString[index-2] - '0') * 10; + frequency += (U32)(BrandString[index-1] - '0'); + frequency *= multiplier; + } + + } + + max_ratio = frequency / get_bclk(); + break; + } + } + + // Return non-zero Max Non-Turbo Ratio obtained from CPUID brand string + // or return 0 indicating Max Non-Turbo Ratio not available + *max_non_turbo_ratio = max_ratio; +} + +//----------------------------------------------------------------------------- +static void collect_cpu_info(CPU_DETAILS * cpu) +{ + boolean_t dynamic_acceleration = 0; + U32 sub_Cstates = 0; + U32 extensions = 0; + boolean_t invariant_APIC_timer = 0; + boolean_t fine_grain_clock_mod = 0; + +#if BUILD_ACPI_TSS || pstate_power_support + if (Platform.CPU.CPUID[CPUID_0][0] >= 0x5) { + /* + * Extract the Monitor/Mwait Leaf info: + */ + sub_Cstates = Platform.CPU.CPUID[CPUID_5][3]; + extensions = Platform.CPU.CPUID[CPUID_5][2]; + } + + if (Platform.CPU.CPUID[CPUID_0][0] >= 6) { + dynamic_acceleration = bitfield(Platform.CPU.CPUID[CPUID_6][0], 1, 1); // "Dynamic Acceleration Technology (Turbo Mode)" + invariant_APIC_timer = bitfield(Platform.CPU.CPUID[CPUID_6][0], 2, 2); // "Invariant APIC Timer" + fine_grain_clock_mod = bitfield(Platform.CPU.CPUID[CPUID_6][0], 4, 4); + } + cpu->turbo_available = (U32)dynamic_acceleration; + + { + U32 temp32 = 0; + U64 temp64= 0; + int tdp; + if (getIntForKey("TDP", &tdp, &bootInfo->chameleonConfig)) + { + temp32 = (U32) (tdp*8) ; + + int tdc; + if (getIntForKey("TDC", &tdc, &bootInfo->chameleonConfig)) + { + temp32 = (U32) (temp32) | tdc<<16 ; + + } + else if (tdp) + { + temp32 = (U32) (temp32) | ((tdp)*8)<<16 ; + } + + } + else if (!is_sandybridge() && !is_jaketown()) + { + if (turbo_enabled && cpu->turbo_available) + { + temp64 = rdmsr64(MSR_TURBO_POWER_CURRENT_LIMIT); + temp32 = (U32)temp64; + } + else + { + // Unfortunately, Intel don't provide a better method for non turbo processors + // and it will give a TDP of 95w (for ex. mine is 65w) , to fix this issue, + // you can set this value by simply adding the option TDP = XX (XX is an integer) + // in your boot.plist + temp32 = (U32)0x02a802f8; + } + + } + if (temp32) { + cpu->tdp_limit = ( temp32 & 0x7fff ); + cpu->tdc_limit = ( (temp32 >> 16) & 0x7fff ); + } + } + +#endif + + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: + case CPU_MODEL_YONAH: // Yonah + case CPU_MODEL_MEROM: // Merom + case CPU_MODEL_PENRYN: // Penryn + case CPU_MODEL_ATOM: // Intel Atom (45nm) + { + + cpu->core_c1_supported = ((sub_Cstates >> 4) & 0xf) ? 1 : 0; + cpu->core_c4_supported = ((sub_Cstates >> 16) & 0xf) ? 1 : 0; + + if (Platform.CPU.Model == CPU_MODEL_ATOM) + { + cpu->core_c2_supported = cpu->core_c3_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0; + cpu->core_c6_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0; + + } + else + { + cpu->core_c3_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0; + cpu->core_c2_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0; + cpu->core_c6_supported = 0; + + } + + cpu->core_c7_supported = 0; + +#if BETA + GetMaxRatio(&cpu->max_ratio_as_mfg); + U64 msr = rdmsr64(MSR_IA32_PERF_STATUS); + U16 idlo = (msr >> 48) & 0xffff; + U16 idhi = (msr >> 32) & 0xffff; + cpu->min_ratio = (U32) (idlo >> 8) & 0xff; + cpu->max_ratio_as_cfg = (U32) (idhi >> 8) & 0xff; + +#else + if (Platform.CPU.MaxCoef) + { + if (Platform.CPU.MaxDiv) + { + cpu->max_ratio_as_cfg = cpu->max_ratio_as_mfg = (U32) (Platform.CPU.MaxCoef * 10) + 5; + } + else + { + cpu->max_ratio_as_cfg = cpu->max_ratio_as_mfg = (U32) Platform.CPU.MaxCoef * 10; + } + } +#endif + + break; + } + case CPU_MODEL_FIELDS: + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: + case CPU_MODEL_NEHALEM: + case CPU_MODEL_NEHALEM_EX: + case CPU_MODEL_WESTMERE: + case CPU_MODEL_WESTMERE_EX: + case CPU_MODEL_SANDYBRIDGE: + case CPU_MODEL_JAKETOWN: + { + + cpu->core_c1_supported = ((sub_Cstates >> 4) & 0xf) ? 1 : 0; + cpu->core_c3_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0; + cpu->core_c6_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0; + cpu->core_c7_supported = ((sub_Cstates >> 16) & 0xf) ? 1 : 0; + cpu->core_c2_supported = 0; + cpu->core_c4_supported = 0; + + GetMaxRatio(&cpu->max_ratio_as_mfg); + U64 platform_info = rdmsr64(MSR_PLATFORM_INFO); + cpu->max_ratio_as_cfg = (U32) ((U32)platform_info >> 8) & 0xff; + cpu->min_ratio = (U32) ((platform_info >> 40) & 0xff); + + cpu->tdc_tdp_limits_for_turbo_flag = (platform_info & (1ULL << 29)) ? 1 : 0; + cpu->ratio_limits_for_turbo_flag = (platform_info & (1ULL << 28)) ? 1 : 0; + cpu->xe_available = cpu->tdc_tdp_limits_for_turbo_flag | cpu->ratio_limits_for_turbo_flag; + + + + if (is_sandybridge() || is_jaketown()) + { + cpu->package_power_limit = rdmsr64(MSR_PKG_RAPL_POWER_LIMIT); + cpu->package_power_sku_unit = rdmsr64(MSR_RAPL_POWER_UNIT); + } + break; + } + default: + verbose ("Unsupported CPU\n"); + return /*(0)*/; + break; + } + } + default: + break; + } + + cpu->mwait_supported = (extensions & (1UL << 0)) ? 1 : 0; + + cpu->invariant_apic_timer_flag = (U32)invariant_APIC_timer; + +#if DEBUG_ACPI + printf("CPU INFO : \n"); +#if BETA + printf("min_ratio : %d\n", cpu->min_ratio); +#endif + printf("max_ratio_as_cfg : %d\n", cpu->max_ratio_as_cfg); + printf("max_ratio_as_mfg : %d\n", cpu->max_ratio_as_mfg); + + printf("turbo_available : %d\n",cpu->turbo_available); + + printf("core_c1_supported : %d\n",cpu->core_c1_supported); + printf("core_c2_supported : %d\n",cpu->core_c1_supported); + printf("core_c3_supported : %d\n",cpu->core_c3_supported); + printf("core_c6_supported : %d\n",cpu->core_c6_supported); + printf("core_c7_supported : %d\n",cpu->core_c7_supported); + printf("mwait_supported : %d\n",cpu->mwait_supported); + +#if BUILD_ACPI_TSS || pstate_power_support + if (is_sandybridge() || is_jaketown()) + { + + printf("package_power_limit : %d\n",cpu->package_power_limit); + printf("package_power_sku_unit : %d\n",cpu->package_power_sku_unit); + + } +#endif + + DBG("invariant_apic_timer_flag : %d\n",cpu->invariant_apic_timer_flag); + + +#endif +} + +#if BETA +//----------------------------------------------------------------------------- +static U32 BuildPstateInfo(CPU_DETAILS * cpu) +{ + // Build P-state table info based on verified options + + // Compute the number of p-states based on the ratio range + cpu->pkg_pstates.num_pstates = computeNumPstates(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, MAX_PSTATES); + + if (!cpu->pkg_pstates.num_pstates) + { + return (0); + } + + // Compute pstate data + { + U32 TDP = compute_tdp(cpu); + + U32 index; + for (index=0; index < cpu->pkg_pstates.num_pstates; index ++) + { + PSTATE * pstate = &cpu->pkg_pstates.pstate[index]; + + // Set ratio + pstate->ratio = computePstateRatio(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, cpu->pkg_pstates.num_pstates, index); + + // Compute frequency based on ratio + if ((index != 0) || (cpu->turbo_available == 0)) + pstate->frequency = pstate->ratio * get_bclk(); + else + pstate->frequency = ((pstate->ratio - 1) * get_bclk()) + 1; + + // Compute power based on ratio and other data + if (pstate->ratio >= cpu->max_ratio_as_mfg) + // Use max power in mW + pstate->power = TDP * 1000; + else + { + pstate->power = compute_pstate_power(cpu, pstate->ratio, TDP); + + // Convert to mW + pstate->power*= 1000; + } + } + } + + return (1); +} +#else +/* + //----------------------------------------------------------------------------- + static U32 BuildCoreIPstateInfo(CPU_DETAILS * cpu) + { + // Build P-state table info based on verified options + + // Compute the number of p-states based on the ratio range + cpu->pkg_pstates.num_pstates = computeNumPstates(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, MAX_PSTATES); + + if (!cpu->pkg_pstates.num_pstates) + { + return (0); + } + + // Compute pstate data + { + #ifdef pstate_power_support + U32 TDP = compute_tdp(cpu); + #endif + + U32 index; + for (index=0; index < cpu->pkg_pstates.num_pstates; index ++) + { + PSTATE * pstate = &cpu->pkg_pstates.pstate[index]; + + // Set ratio + pstate->ratio = computePstateRatio(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, cpu->pkg_pstates.num_pstates, index); + + // Compute frequency based on ratio + if ((index != 0) || (cpu->turbo_available == 0)) + pstate->frequency = pstate->ratio * get_bclk(); + else + pstate->frequency = ((pstate->ratio - 1) * get_bclk()) + 1; + + #ifdef pstate_power_support + // Compute power based on ratio and other data + if (pstate->ratio >= cpu->max_ratio_as_mfg) + // Use max power in mW + pstate->power = TDP * 1000; + else + { + pstate->power = compute_pstate_power(cpu, pstate->ratio, TDP); + + // Convert to mW + pstate->power*= 1000; + } + #else + pstate->power = 0; + #endif + } + } + + return (1); + } + */ +//----------------------------------------------------------------------------- +static U32 BuildPstateInfo(CPU_DETAILS * cpu) +{ + + struct p_state p_states[32]; + U8 p_states_count = 0; + + if (!cpu) + { + return (0); + } + + { +#if UNUSED + struct p_state initial; +#endif + struct p_state maximum, minimum; + // Retrieving P-States, ported from code by superhai (c) + switch (Platform.CPU.Family) + { + case 0x06: + { + switch (Platform.CPU.Model) + { + case CPU_MODEL_DOTHAN: + case CPU_MODEL_YONAH: // Yonah + case CPU_MODEL_MEROM: // Merom + case CPU_MODEL_PENRYN: // Penryn + case CPU_MODEL_ATOM: // Intel Atom (45nm) + { + bool cpu_dynamic_fsb = false; + + if (rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 27)) + { + wrmsr64(MSR_IA32_EXT_CONFIG, (rdmsr64(MSR_IA32_EXT_CONFIG) | (1 << 28))); + delay(1); + cpu_dynamic_fsb = rdmsr64(MSR_IA32_EXT_CONFIG) & (1 << 28); + } + + bool cpu_noninteger_bus_ratio = (rdmsr64(MSR_IA32_PERF_STATUS) & (1ULL << 46)); +#if UNUSED + //initial.Control = rdmsr64(MSR_IA32_PERF_STATUS); +#endif + maximum.Control = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 32) & 0x1F3F) | (0x4000 * cpu_noninteger_bus_ratio); + maximum.CID = ((maximum.FID & 0x1F) << 1) | cpu_noninteger_bus_ratio; + + minimum.FID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 24) & 0x1F) | (0x80 * cpu_dynamic_fsb); + minimum.VID = ((rdmsr64(MSR_IA32_PERF_STATUS) >> 48) & 0x3F); + + if (minimum.FID == 0) + { + U64 msr; + U8 i; + // Probe for lowest fid + for (i = maximum.FID; i >= 0x6; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (i << 8) | minimum.VID); + intel_waitforsts(); + minimum.FID = (rdmsr64(MSR_IA32_PERF_STATUS) >> 8) & 0x1F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + if (minimum.VID == maximum.VID) + { + U64 msr; + U8 i; + // Probe for lowest vid + for (i = maximum.VID; i > 0xA; i--) + { + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (minimum.FID << 8) | i); + intel_waitforsts(); + minimum.VID = rdmsr64(MSR_IA32_PERF_STATUS) & 0x3F; + delay(1); + } + + msr = rdmsr64(MSR_IA32_PERF_CONTROL); + wrmsr64(MSR_IA32_PERF_CONTROL, (msr & 0xFFFFFFFFFFFF0000ULL) | (maximum.FID << 8) | maximum.VID); + intel_waitforsts(); + } + + minimum.CID = ((minimum.FID & 0x1F) << 1) >> cpu_dynamic_fsb; + + // Sanity check + if (maximum.CID < minimum.CID) + { + DBG("Insane FID values!"); + p_states_count = 0; + } + else + { + // Finalize P-States + // Find how many P-States machine supports + p_states_count = maximum.CID - minimum.CID + 1; + + if (p_states_count > MAX_PSTATES) // was 32 + p_states_count = MAX_PSTATES; // was 32 + + U8 vidstep; + U8 i = 0, u, invalid = 0; + + vidstep = ((maximum.VID << 2) - (minimum.VID << 2)) / (p_states_count - 1); + + U32 fsb = (U32)divU64byU64(Platform.CPU.FSBFrequency , 1000000 , NULL); + + for (u = 0; u < p_states_count; u++) + { + i = u - invalid; + + p_states[i].CID = maximum.CID - u; + p_states[i].FID = (p_states[i].CID >> 1); + + if (p_states[i].FID < 0x6) + { + if (cpu_dynamic_fsb) + p_states[i].FID = (p_states[i].FID << 1) | 0x80; + } + else if (cpu_noninteger_bus_ratio) + { + p_states[i].FID = p_states[i].FID | (0x40 * (p_states[i].CID & 0x1)); + } + + if (i && p_states[i].FID == p_states[i-1].FID) + invalid++; + + p_states[i].VID = ((maximum.VID << 2) - (vidstep * u)) >> 2; + + U32 multiplier = p_states[i].FID & 0x1f; // = 0x08 + bool half = p_states[i].FID & 0x40; // = 0x01 + bool dfsb = p_states[i].FID & 0x80; // = 0x00 + //U32 fsb = (U32)get_env(envFSBFreq) / 1000000; // = 400 + U32 halffsb = (fsb + 1) >> 1; // = 200 + U32 frequency = (multiplier * fsb); // = 3200 + + p_states[i].Frequency = (frequency + (half * halffsb)) >> dfsb; // = 3200 + 200 = 3400 + } + + p_states_count -= invalid; + } + break; + } + case CPU_MODEL_FIELDS: + case CPU_MODEL_DALES: + case CPU_MODEL_DALES_32NM: + case CPU_MODEL_NEHALEM: + case CPU_MODEL_NEHALEM_EX: + case CPU_MODEL_WESTMERE: + case CPU_MODEL_WESTMERE_EX: + case CPU_MODEL_SANDYBRIDGE: + case CPU_MODEL_JAKETOWN: + { + + maximum.Control = rdmsr64(MSR_IA32_PERF_STATUS) & 0xff; // Seems it always contains maximum multiplier value (with turbo, that's we need)... + minimum.Control = (rdmsr64(MSR_PLATFORM_INFO) >> 40) & 0xff; + + DBG("P-States: min 0x%x, max 0x%x\n", minimum.Control, maximum.Control); + + // Sanity check + if (maximum.Control < minimum.Control) + { + DBG("Insane control values!"); + p_states_count = 0; + } + else + { + U8 i; + p_states_count = 0; + U32 fsb = (U32)divU64byU64(Platform.CPU.FSBFrequency , 1000000, NULL) ; + for (i = maximum.Control; i >= minimum.Control; i--) + { + p_states[p_states_count].Control = i; + p_states[p_states_count].CID = p_states[p_states_count].Control << 1; + p_states[p_states_count].Frequency = (U32)fsb * i; + p_states_count++; + if (p_states_count >= MAX_PSTATES) { // was 32 + + if (p_states_count > MAX_PSTATES) // was 32 + p_states_count = MAX_PSTATES; // was 32 + + break; + } + } + } + + /* + U32 sta = BuildCoreIPstateInfo(cpu); + if (sta) + { + DBG("_PSS PGK generated successfully\n"); + return (1); + + } + else + { + verbose("CoreI _PSS Generation failed !!\n"); + return (0); + } + */ + break; + } + default: + verbose ("Unsupported CPU: P-States will not be generated !!!\n"); + return (0); + break; + } + } + default: + break; + } + } + + // Generating Pstate PKG + if (p_states_count > 0) + { + U32 fsb = (U32)Platform.CPU.FSBFrequency; + U8 minPSratio = divU64byU64(p_states[p_states_count-1].Frequency , divU64byU64(fsb , 10000000 , NULL ) , NULL); + U8 maxPSratio = divU64byU64(p_states[0].Frequency , divU64byU64(fsb , 10000000 , NULL ) , NULL); + U8 cpu_ratio = 0; + + { + U8 cpu_div = (U8)Platform.CPU.CurrDiv; + U8 cpu_coef = (U8)Platform.CPU.CurrCoef; + + if (cpu_div) + cpu_ratio = (cpu_coef * 10) + 5; + else + cpu_ratio = cpu_coef * 10; + } + + + { + int user_max_ratio = 0; + getIntForKey(kMaxRatio, &user_max_ratio, &bootInfo->chameleonConfig); + if (user_max_ratio >= minPSratio && maxPSratio >= user_max_ratio) + { + + U8 maxcurrdiv = 0, maxcurrcoef = (int)divU64byU64(user_max_ratio , 10, NULL); + + U8 maxdiv = user_max_ratio - (maxcurrcoef * 10); + if (maxdiv > 0) + maxcurrdiv = 1; + + if (maxcurrdiv) + cpu_ratio = (maxcurrcoef * 10) + 5; + else + cpu_ratio = maxcurrcoef * 10; + } + } + + { + int user_min_ratio = 0; + getIntForKey(kMinRatio, &user_min_ratio, &bootInfo->chameleonConfig); + if (user_min_ratio >= minPSratio && cpu_ratio >= user_min_ratio) + { + + U8 mincurrdiv = 0, mincurrcoef = (int)divU64byU64(user_min_ratio , 10 , NULL); + + U8 mindiv = user_min_ratio - (mincurrcoef * 10); + + if (mindiv > 0) + mincurrdiv = 1; + + if (mincurrdiv) + minPSratio = (mincurrcoef * 10) + 5; + else + minPSratio = mincurrcoef * 10; + + } + } + + + if (maxPSratio >= cpu_ratio && cpu_ratio >= minPSratio) maxPSratio = cpu_ratio; + + { + int base = 16; + U8 expert = 0; /* Default: 0 , mean mixed mode + * expert mode : 1 , mean add only p-states found in boot.plist + */ + + TagPtr PstateTag; + U32 pstate_tag_count = 0; + + { + + + if (bootInfo->chameleonConfig.dictionary) + { + PstateTag = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"P-States")); + if (PstateTag) pstate_tag_count = XMLTagCount(PstateTag) ; + } + + if (!pstate_tag_count) + if ((PstateTag = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"P-States")))) pstate_tag_count = XMLTagCount(PstateTag); + + + if ((pstate_tag_count > 0) && PstateTag) + { + char *tmpstr = XMLCastString(XMLGetProperty(PstateTag, (const char*)"Mode")); + + if (strcmp(tmpstr,"Expert") == 0) + { + p_states_count = pstate_tag_count - 1 ; // - 1 = - ("Mode" tag) + expert = 1; + } + + + if ((tmpstr = XMLCastString(XMLGetProperty(PstateTag, (const char*)"Base")))) + { + + if (expert) p_states_count--; // -= ("Base" tag) + + int mybase = strtol(tmpstr, NULL, 10); + + if (mybase == 8 || mybase == 10 || mybase == 16 ) + base = mybase; + } + } + + } + + { + U32 dropPSS = 0, Pstatus = 0; + char MatchStat[5]; +#ifdef pstate_power_support + U32 TDP = compute_tdp(cpu); +#endif + U32 i; + U32 fsb = (U32)Platform.CPU.FSBFrequency; + for (i = 0; i < p_states_count; i++) + { + char *Lat1 = NULL, *clk = NULL, *Pw = NULL, *Lat2 = NULL, *Ctrl = NULL ; + + if ((pstate_tag_count > 0) && PstateTag) + { + sprintf(MatchStat, "%d",i); + TagPtr match_Status = XMLGetProperty(PstateTag, (const char*)MatchStat); + + if (match_Status && (XMLTagCount(match_Status) > 0)) + { + + clk = XMLCastString(XMLGetProperty(match_Status, (const char*)"CoreFreq")); + Pw = XMLCastString(XMLGetProperty(match_Status, (const char*)"Power")); + Lat1 = XMLCastString(XMLGetProperty(match_Status, (const char*)"Transition Latency")); + Lat2 = XMLCastString(XMLGetProperty(match_Status, (const char*)"Bus Master Latency")); + Ctrl = XMLCastString(XMLGetProperty(match_Status, (const char*)"Control")); + + + } else if (expert) + continue; + } + + unsigned long Frequency = 0x00000000; + + if (!expert || !pstate_tag_count) Frequency = p_states[i].Frequency; + + if (clk) + Frequency = strtoul((const char *)clk, NULL,base); + + if (!Frequency || Frequency > p_states[0].Frequency ) continue; + + U8 curr_ratio = (U8)divU64byU64(Frequency , divU64byU64(fsb , 10000000, NULL ), NULL); + + + { + U8 fixed_ratio = (U8)divU64byU64(Frequency , divU64byU64(fsb , 1000000 , NULL ) , NULL) * 10; + U8 diff = curr_ratio - fixed_ratio ; + + if (diff) + { + if (diff < 5) + { + curr_ratio = fixed_ratio; + } + else + { + curr_ratio = fixed_ratio + 5; + } + } + + } + + if (curr_ratio > maxPSratio || minPSratio > curr_ratio) + goto dropPstate; + + { + PSTATE * pstate = &cpu->pkg_pstates.pstate[Pstatus]; + + pstate->ratio = curr_ratio; + + pstate->frequency = Frequency; // CoreFreq (in MHz). + + U32 power = 0x00000000; +#ifdef pstate_power_support + // Compute power based on ratio and other data + if (pstate->ratio >= cpu->max_ratio_as_mfg) + // Use max power in mW + power = TDP * 1000; + else + { + power = compute_pstate_power(cpu, pstate->ratio, TDP); + + // Convert to mW + power*= 1000; + } +#endif + pstate->power = resolve_pss(power, Pw, base); // Power (in milliWatts) + pstate->translatency = resolve_pss(0x0000000A, Lat1, base); // Transition Latency (in microseconds). + pstate->bmlatency = resolve_pss(0x0000000A, Lat2, base); // Bus Master Latency (in microseconds). + + { + U32 Control = 0 /*encode_pstate(curr_ratio)*/ ; + if (!expert || !pstate_tag_count) Control = p_states[i].Control; + pstate->control = resolve_pss(Control, Ctrl, base); // Control + } + + pstate->status = Pstatus+1; // Status + + DBG("state :: frequency :%d power: %d translatency: %d bmlatency: %d control: %d status: %d ratio :%d :: registred !! \n",pstate->frequency,pstate->power, + pstate->translatency,pstate->bmlatency,pstate->control,pstate->status,pstate->ratio ); + } + + + Pstatus++; + continue; + + dropPstate: + DBG("state with cpu frequency :%d and ratio :%d will be dropped\n",p_states[i].Frequency,curr_ratio); + dropPSS++; + + + } + + if (Pstatus == 0) + { + verbose("No suitable P-states found, P-States will not be generated !!!\n"); + return (0); + } + cpu->pkg_pstates.num_pstates = Pstatus; + } + } + } + else + { + verbose("ACPI CPUs not found: P-States will not be generated !!!\n"); + return (0); + } + + DBG("_PSS PGK generated successfully\n"); + return (1); +} +#endif // BETA + +//----------------------------------------------------------------------------- +static U32 BuildCstateInfo(CPU_DETAILS * cpu, U32 pmbase) +{ + { + + TagPtr CstateTag = NULL; + U32 entry_count = 0; + + if (bootInfo->chameleonConfig.dictionary) + { + CstateTag = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"C-States")); + } + + if (CstateTag) + { + int base = 16; + + entry_count = XMLTagCount(CstateTag); + + if (entry_count > 0) + { + { + char *tmpstr; + + if ((tmpstr = XMLCastString(XMLGetProperty(CstateTag, (const char*)"Base")))) + { + + entry_count--; // -= ("Base" tag) + + int mybase = strtol(tmpstr, NULL, 10); + + if (mybase == 8 || mybase == 10 || mybase == 16 ) + base = mybase; + } + } + + cpu->pkg_io_cstates.num_cstates = 0; + cpu->pkg_mwait_cstates.num_cstates = 0; + U32 num_cstates = 0; + + { + U32 i; + char MatchStat[5]; + + for (i = 0; i < 32 ; i++) + { + char *Lat = NULL, *Pw = NULL, *BWidth= NULL, *BOffset= NULL, *Address= NULL, *AccessSize= NULL, *index= NULL; + + sprintf(MatchStat, "C%d",i); + TagPtr match_Status = XMLGetProperty(CstateTag, (const char*)MatchStat); + if (match_Status) + { + Pw = XMLCastString(XMLGetProperty(match_Status, (const char*)"Power")); + Lat = XMLCastString(XMLGetProperty(match_Status, (const char*)"Latency")); + BWidth= XMLCastString(XMLGetProperty(match_Status, (const char*)"BitWidth")); + + BOffset = XMLCastString(XMLGetProperty(match_Status, (const char*)"BitOffset")); + Address = XMLCastString(XMLGetProperty(match_Status, (const char*)"Latency")); + AccessSize = XMLCastString(XMLGetProperty(match_Status, (const char*)"AccessSize")); + index = XMLCastString(XMLGetProperty(match_Status, (const char*)"index")); + + if (Pw && Lat && BWidth && BOffset && Address && AccessSize && index) + { + U32 bw = strtoul((const char *)BWidth, NULL,base); + U32 boff = strtoul((const char *)BOffset, NULL,base); + U32 acs = strtoul((const char *)AccessSize, NULL,base); + U32 addr = strtoul((const char *)Address, NULL,base); + U32 idx = strtoul((const char *)index, NULL,base); + U32 lat = strtoul((const char *)Lat, NULL,base); + U32 pw = strtoul((const char *)Pw, NULL,base); + + ACPI_GENERIC_ADDRESS mwait_gas = {GAS_TYPE_FFH,bw,boff,acs,addr}; + ACPI_GENERIC_ADDRESS io_gas = {(i == 1) ? GAS_TYPE_FFH : GAS_TYPE_SYSTEM_IO,bw,boff,acs,addr}; + + CSTATE mwait_cstate = {idx,lat,pw}; + CSTATE io_cstate = {idx,lat,pw}; + + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas; + cpu->pkg_mwait_cstates.num_cstates++; + } + + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas; + cpu->pkg_io_cstates.num_cstates++; + } + num_cstates++; + + if (num_cstates >= MAX_CSTATES) + { + break; + } + } + } + } + } + + if (num_cstates) + { + return (1); + } + } + } + } + + { + static const ACPI_GENERIC_ADDRESS mwait_gas[] = { + {GAS_TYPE_FFH,1,2,1,0x00}, // processor C1 + {GAS_TYPE_FFH,1,2,1,0x10}, // processor C3 as ACPI C2 + {GAS_TYPE_FFH,1,2,1,0x10}, // processor C3 as ACPI C3 + {GAS_TYPE_FFH,1,2,1,0x10}, // processor C3 as ACPI C4 + {GAS_TYPE_FFH,1,2,1,0x20}, // processor C6 + {GAS_TYPE_FFH,1,2,1,0x30}, // processor C7 + }; + + static const ACPI_GENERIC_ADDRESS io_gas[] = { + {GAS_TYPE_FFH, 0,0,0,0x00}, // processor C1 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x14}, // processor C3 as ACPI C2 or processor C2 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x14}, // processor C3 as ACPI C3 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x15}, // processor C4 as ACPI C4 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x15}, // processor C6 + {GAS_TYPE_SYSTEM_IO,8,0,0,0x16}, // processor C7 + }; + + static const CSTATE mwait_cstate [] = { + {1,0x01,0x3e8}, // processor C1 + {2,0x40,0x1f4}, // processor C3 as ACPI C2 or processor C2 + {3,0x40,0x1f4}, // processor C3 as ACPI C3 + {4,0x40,0x1f4}, // processor C4 + {6/*was 3*/,0x60,0x15e}, // processor C6 + {7/*was 3*/,0x60,0x0c8}, // processor C7 + }; + + static const CSTATE io_cstate [] = { + {1,0x01,0x3e8}, // processor C1 + {2,0x40,0x1f4}, // processor C3 as ACPI C2 or processor C2 + {3,0x40,0x1f4}, // processor C3 as ACPI C3 + {4,0x40,0x1f4}, // processor C4 + {6/*was 3*/,0x60,0x15e}, // processor C6 + {7/*was 3*/,0x60,0x0c8}, // processor C7 + }; + + static const U32 cstate_2_index [] = {0,0,0,1,2,3,4,5}; + + // Build C-state table info based on verified options + + // Desired state for the processor core C3 state included in the _CST as an + // ACPI C2 state. + // 1= processor core C3 can be used as an ACPI C2 state + // 0= processor core C3 cannot be used as an ACPI C2 state + int c2_enabled = 0; + + // Desired state for the processor core C3 state included in the _CST + // 0= processor core C3 cannot be used as an ACPI C state + // 2= processor core C3 can be used as an ACPI C2 state + // 3= processor core C3 can be used as an ACPI C3 state + // 4= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else not used as ACPI C state + // 5= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else APIC C3 state + // 6= processor core C3 can be used as an ACPI C4 state + int c3_enabled = 3; + + // Desired state for the processor core C3 state included in the _CST as an + // ACPI C4 state. + // 1= processor core C3 can be used as an ACPI C4 state + // 0= processor core C3 cannot be used as an ACPI C4 state + int c4_enabled = 0; + + // Desired state for the processor core C6 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C6 can be used as an ACPI C3 state + // 0= processor core C6 cannot be used as an ACPI C3 state + int c6_enabled = 0; + + // Desired state for the processor core C7 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C7 can be used as an ACPI C7 state + // 0= processor core C7 cannot be used as an ACPI C7 state + int c7_enabled = 0; + + { + bool tmpval; + + + if (getBoolForKey(kEnableC2State, &tmpval, &bootInfo->chameleonConfig)) + { + c2_enabled = tmpval; + } + + if (!getIntForKey("C3StateOption", &c3_enabled, &bootInfo->chameleonConfig)) + { + c3_enabled = (getBoolForKey(kEnableC3State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 3 : 0; + } + if (c3_enabled == 6) + { + c4_enabled = 1; + } + else + { + c4_enabled = (getBoolForKey(kEnableC4State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 1 : 0; + } + c6_enabled = (getBoolForKey(kEnableC6State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 1 : 0; + c7_enabled = (getBoolForKey(kEnableC7State, &tmpval, &bootInfo->chameleonConfig)&&tmpval) ? 1 : 0; + } + + cpu->pkg_mwait_cstates.num_cstates = 0; + { + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C1]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C1]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + if (((cpu->core_c3_supported || cpu->core_c2_supported) && (c2_enabled)) && ((c3_enabled == 2) || + ((c3_enabled == 4) && cpu->invariant_apic_timer_flag))) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + if (cpu->core_c4_supported && c4_enabled) + { + + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C4]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C4]]; + cpu->pkg_mwait_cstates.num_cstates++; + + } + else + { + + if (cpu->core_c3_supported && ((c3_enabled == 3) || + ((c3_enabled == 4) && !cpu->invariant_apic_timer_flag))) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + } + + + if (cpu->core_c6_supported && c6_enabled) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C6]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C6]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + if (cpu->core_c7_supported && c7_enabled) + { + cpu->pkg_mwait_cstates.cstate[cpu->pkg_mwait_cstates.num_cstates] = mwait_cstate[cstate_2_index[CPU_C7]]; + cpu->pkg_mwait_cstates.gas[cpu->pkg_mwait_cstates.num_cstates] = mwait_gas[cstate_2_index[CPU_C7]]; + cpu->pkg_mwait_cstates.num_cstates++; + } + } + + cpu->pkg_io_cstates.num_cstates = 0; + { + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C1]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C1]]; + cpu->pkg_io_cstates.num_cstates++; + } + if ((cpu->core_c3_supported || cpu->core_c2_supported) && (c2_enabled || (c3_enabled == 2) || + ((c3_enabled == 4) && cpu->invariant_apic_timer_flag))) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C3_ACPI_C2]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + if (cpu->core_c4_supported && c4_enabled) + { + + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C4]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C4]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + + } + else + { + + if (cpu->core_c3_supported && ((c3_enabled == 3) || + ((c3_enabled == 4) && !cpu->invariant_apic_timer_flag))) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C3_ACPI_C3]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + } + + if (cpu->core_c6_supported && c6_enabled) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C6]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C6]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + if (cpu->core_c7_supported && c7_enabled) + { + cpu->pkg_io_cstates.cstate[cpu->pkg_io_cstates.num_cstates] = io_cstate[cstate_2_index[CPU_C7]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates] = io_gas[cstate_2_index[CPU_C7]]; + cpu->pkg_io_cstates.gas[cpu->pkg_io_cstates.num_cstates].Address += pmbase; + cpu->pkg_io_cstates.num_cstates++; + } + } + } + + return (1); +} + +#if BUILD_ACPI_TSS +//----------------------------------------------------------------------------- +static U32 BuildTstateInfo(CPU_DETAILS * cpu) +{ + // Coarse grained clock modulation is available if cpuid.6.eax[5] = 0 + // Max of 8 T-states using 12.5% increments + static const TSTATE tstate_coarse_grain [] = { + {100,0,0,0x00,0}, + { 88,0,0,0x1e,0}, + { 75,0,0,0x1c,0}, + { 63,0,0,0x1a,0}, + { 50,0,0,0x18,0}, + { 38,0,0,0x16,0}, + { 25,0,0,0x14,0}, + { 13,0,0,0x12,0}, + }; + + // Fine grained clock modulation is available if cpuid.6.eax[5] = 1 + // Max of 15 T-states using 6.25% increments + static const TSTATE tstate_fine_grain [] = { + {100,0,0,0x00,0}, + { 94,0,0,0x1f,0}, + { 88,0,0,0x1e,0}, + { 81,0,0,0x1d,0}, + { 75,0,0,0x1c,0}, + { 69,0,0,0x1b,0}, + { 63,0,0,0x1a,0}, + { 56,0,0,0x19,0}, + { 50,0,0,0x18,0}, + { 44,0,0,0x17,0}, + { 38,0,0,0x16,0}, + { 31,0,0,0x15,0}, + { 25,0,0,0x14,0}, + { 19,0,0,0x13,0}, + { 13,0,0,0x12,0}, + }; + + // Build T-state table info based on verified options + U32 num_cpu; + const TSTATE * tstate; + U32 num_tstates; + + for (num_cpu = 0; num_cpu < cpu_map_count; num_cpu ++) + { + // Check if fine or coarse grained clock modulation is available + if (get_env(envFineGrainClockMod)) + { + // Fine grain thermal throttling is available + num_tstates = 15; + tstate = tstate_fine_grain; + } + else + { + // Coarse grain thermal throttling is available + num_tstates = 8; + tstate = tstate_coarse_grain; + } + + cpu->pkg_tstates.num_tstates = num_tstates; + { + U32 index; + for (index = 0; index < num_tstates; index++) + { + cpu->pkg_tstates.tstate[index] = tstate[index]; + cpu->pkg_tstates.tstate[index].power = 1000 * (compute_tdp(cpu) * (num_tstates - index)) / num_tstates; + } + } + + + } + return (1); +} +#endif // BUILD_ACPI_TSS + +//----------------------------------------------------------------------------- +U32 ProcessMadt(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info, void * buffer, U32 bufferSize, U32 nb_cpu) +{ + void *current; + void *currentOut; + void *end; + void * endOut; + + U32 LOCAL_APIC_NMI_CNT = 0, LOCAL_SAPIC_CNT = 0, INT_SRC_CNT = 0, Length = 0; + + // Quick sanity check for a valid MADT + if (madt == 0ul || !nb_cpu) + return (0); + + // Confirm a valid MADT buffer was provided + if (!buffer) + { + printf("Error: Invalid Buffer Address for MADT\n"); + return(0); + } + + // Confirm a valid MADT buffer length was provided + if (!bufferSize) + { + printf("Error: Invalid Buffer Length for MADT\n"); + return(0); + } + + madt_info->lapic_count = 0; + + memcpy(buffer, madt, sizeof(ACPI_TABLE_MADT)); + + // Search MADT for Sub-tables with needed data + current = madt + 1; + currentOut = buffer + sizeof(ACPI_TABLE_MADT) ; + + end = (U8 *) madt + madt->Header.Length; + endOut = (U8 *)buffer + bufferSize; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + Length += sizeof(ACPI_TABLE_MADT); + + while (current < end) + { + ACPI_SUBTABLE_HEADER *subtable = current; + ACPI_SUBTABLE_HEADER *subtableOut = currentOut; + + + switch (subtable->Type) + { + + case ACPI_MADT_TYPE_LOCAL_APIC: + { + + // Process sub-tables with Type as 0: Processor Local APIC + ACPI_MADT_LOCAL_APIC *lapic = current; + current = lapic + 1; + + if (!(lapic->LapicFlags & ACPI_MADT_ENABLED)) + continue; + + if (madt_info->lapic_count >= nb_cpu) + continue; + + // copy subtable + { + + memcpy(currentOut, lapic, lapic->Header.Length); + + currentOut = currentOut + lapic->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + } + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->processorId = lapic->ProcessorId; + lapic_info->apicId = lapic->Id; + lapic_info->madt_type = ACPI_MADT_TYPE_LOCAL_APIC; + } + + madt_info->lapic_count++; + + Length += lapic->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_X2APIC: + { + + // Process sub-tables with Type as 9: Processor X2APIC + ACPI_MADT_X2APIC *x2apic = current; + current = x2apic + 1; + + if (!(x2apic->x2apicFlags & ACPI_MADT_ENABLED)) + continue; + + if (madt_info->lapic_count >= nb_cpu) + continue; + + // copy subtable + { + memcpy(currentOut, x2apic, x2apic->Header.Length); + + currentOut = currentOut + x2apic->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + } + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->uid = x2apic->UID; + lapic_info->apicId = x2apic->x2apicId; + lapic_info->madt_type = ACPI_MADT_TYPE_X2APIC; + } + + madt_info->lapic_count++; + + Length += x2apic->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_LOCAL_APIC_NMI: + { + // Process sub-tables with Type as 4: Local APIC NMI + ACPI_MADT_LOCAL_APIC_NMI *nmi = current; + current = nmi + 1; + /* + if (!(nmi->IntiFlags & ACPI_MADT_ENABLED)) + continue; + */ + if (LOCAL_APIC_NMI_CNT >= nb_cpu) + continue; + + memcpy(currentOut, nmi, nmi->Header.Length); + + currentOut = currentOut + nmi->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + + LOCAL_APIC_NMI_CNT++; + + Length += nmi->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (LOCAL_APIC_NMI_CNT > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_LOCAL_SAPIC: + { + // Process sub-tables with Type as 7: Local Sapic + ACPI_MADT_LOCAL_SAPIC *sapic = current; + current = sapic + 1; + /* + if (!(sapic->LapicFlags & ACPI_MADT_ENABLED)) + continue; + */ + if (LOCAL_SAPIC_CNT >= nb_cpu) + continue; + + memcpy(currentOut, sapic, sapic->Header.Length); + + currentOut = currentOut + sapic->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + + LOCAL_SAPIC_CNT++; + + Length += sapic->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (LOCAL_SAPIC_CNT > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_INTERRUPT_SOURCE: + { + // Process sub-tables with Type as 8: Platform Interrupt Source + ACPI_MADT_INTERRUPT_SOURCE *intsrc = current; + current = intsrc + 1; + /* + if (!(intsrc->IntiFlags & ACPI_MADT_ENABLED)) + continue; + */ + if (INT_SRC_CNT >= nb_cpu) + continue; + + memcpy(currentOut, intsrc, intsrc->Header.Length); + + currentOut = currentOut + intsrc->Header.Length; + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + + INT_SRC_CNT++; + + Length += intsrc->Header.Length; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (INT_SRC_CNT > MAX_LOGICAL_CPU) + return (0); + + break; + } + + default: + { + + // Process all other sub-tables + current = (U8 *) subtable + subtable->Length; + currentOut = (U8 *) subtableOut + subtable->Length; + + memcpy(subtableOut, subtable, subtable->Length); + + // Check to confirm no MADT buffer overflow + if ( (U8 *)currentOut > (U8 *)endOut ) + { + printf("Error: MADT Buffer Length exceeded available space \n"); + return(0); + } + + Length += subtable->Length; + + break; + } + } // switch + + } // while + + { + ACPI_TABLE_MADT * new_madt = (ACPI_TABLE_MADT * )buffer; + + // Update the Lenght of the new MADT table + new_madt->Header.Length = Length; + + // Update the checksum of the new MADT table + SetChecksum(&new_madt->Header); + } + + return (1); +} + +static U32 buildMADT(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info) +{ + DBG("Build MADT\n"); + + ACPI_TABLE_MADT * madt_file = (void*)0ul; + ACPI_TABLE_MADT * MadtPointer = (void*)0ul; + bool oem_apic=false; + U8 new_table_index = 0; + + // Check that we have a valid cpu_map (if it's not already done, it will try to generate it) + if (generate_cpu_map_from_acpi(dsdt) != 0) + { + return(0); + } + + { + bool tmpval; + oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } + + if (oem_apic == true) + { + return(0); + } + + if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul) + { + MadtPointer = (ACPI_TABLE_MADT *)madt_file; + + new_table_list[new_table_index] = 0ul; // This way, the non-patched table will not be added in our new rsdt/xsdt table list + } + else + { + MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer; + + new_table_index = get_0ul_index_in_list(new_table_list, true); + + // Check to confirm space is available + if (new_table_index == ACPI_TABLE_LIST_FULL) + { + printf("Error: not enought reserved space in the new acpi list for the MADT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + return(0); + } + } + + // Create buffer for MADT + //U8 memory_for_madt[2 * 1024]; // seems to bug with xcode4, need to found out what is going on (not enough memory in the stack ?) + U8 *memory_for_madt = (U8*)AllocateKernelMemory(2 * 1024); + + // Build the new MADT + if ( (ProcessMadt(MadtPointer, madt_info, memory_for_madt, 2 * 1024, cpu_map_count))== 0) + { + printf("Error: Failed to build MADT table\n"); + return (0); + } + + // insert MADT in the new_table_list + { + // Create pointer to MADT just built in the stack buffer + ACPI_TABLE_MADT * old_madt = (ACPI_TABLE_MADT *)memory_for_madt; + + // Reserved kernel memory for the madt table + ACPI_TABLE_MADT *new_madt = (ACPI_TABLE_MADT *)AllocateKernelMemory(old_madt->Header.Length); + + if (!new_madt) + { + printf("Unable to allocate kernel memory for MADT "); + return (0); + } + // Move the old stack buffer to kernel memory + memcpy(new_madt, old_madt, old_madt->Header.Length); + + // Add the new madt into an empty space of the new_table_list + new_table_list[new_table_index] = (U32)new_madt; + } + + verbose ("MADT table successfully patched\n"); + return(1); +} + +static U32 ProcessSsdt(U32 * new_table_list, ACPI_TABLE_DSDT *dsdt, MADT_INFO * madt_info, bool enable_cstates, bool enable_pstates, bool enable_tstates ) +{ + DBG("Processing SSDT\n"); + + // Check we are on an intel platform + if (Platform.CPU.Vendor != CPUID_VENDOR_INTEL) { + verbose ("Not an Intel platform: SSDT will not be generated !!!\n"); + return(0); + } + + // Check for the msr feature flag + if (!(Platform.CPU.Features & CPU_FEATURE_MSR)) { + verbose ("Unsupported CPU: SSDT will not be generated !!!\n"); + return(0); + } + + if (dsdt == (void *)0ul) { + verbose ("DSDT not found: SSDT will not be generated !!!\n"); + return (0); + } + + // Get an empty space in the new_talbe_list (true = allow reserved space) + U8 empty = get_0ul_index_in_list(new_table_list, true); + + // Check to confirm space is available + if (empty == ACPI_TABLE_LIST_FULL) + { + printf("Error: not enought reserved space in the new acpi list for the SSDT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + return(0); + } + + // Create buffer for SSDT + //U8 memory_for_ssdt[20 * 1024]; // seems to bug with xcode4, need to found out what is going on (not enough memory in the stack ?) + U8 *memory_for_ssdt =(U8*)AllocateKernelMemory(20 * 1024); + + // Build the SSDT + if ( (BuildSsdt(madt_info, dsdt, memory_for_ssdt, 20 * 1024 /*sizeof(memory_for_ssdt)*/, enable_cstates, enable_pstates, enable_tstates)) == 0) + { + printf("Error: Failed to build SSDT table\n"); + return (0); + } + + // insert SSDT in the new_table_list + { + // Create pointer to SSDT just built in the stack buffer + ACPI_TABLE_SSDT * old_ssdt = (ACPI_TABLE_SSDT *)memory_for_ssdt; + + // Reserved kernel memory for the ssdt table + ACPI_TABLE_SSDT *new_ssdt = (ACPI_TABLE_SSDT *)AllocateKernelMemory(old_ssdt->Header.Length); + + if (!new_ssdt) + { + printf("Unable to allocate kernel memory for SSDT "); + return (0); + } + // Move the old stack buffer to kernel memory + memcpy(new_ssdt, old_ssdt, old_ssdt->Header.Length); + + // Add the new ssdt into an empty space of the new_table_list + new_table_list[empty] = (U32)new_ssdt; + } + + verbose ("SSDT table generated successfully\n"); + return(1); +} + +//----------------------------------------------------------------------------- +static void * buildCpuScope (void * current, U32 cpu_namespace, PROCESSOR_NUMBER_TO_NAMESEG * aslCpuNamePath) +{ + ACPI_SCOPE * scope = current; + current = scope + 1; + + scope->scopeOpcode = AML_SCOPE_OP; + scope->rootChar = AML_ROOT_PREFIX; + + if (aslCpuNamePath->seg_count == 1) + { + DUAL_NAME_PATH * dualNamePath = current; + current = dualNamePath + 1; + dualNamePath->prefix = AML_DUAL_NAME_PREFIX; + dualNamePath->nameseg[0] = cpu_namespace; + dualNamePath->nameseg[1] = aslCpuNamePath->nameseg[0]; + } + else + { + MULTI_NAME_PATH * multiNamePath = current; + current = multiNamePath + 1; + multiNamePath->prefix = AML_MULTI_NAME_PREFIX; + // the nameseg count includes the root prefix and all other namesegs + multiNamePath->segCount = (U8) aslCpuNamePath->seg_count+1; + multiNamePath->nameseg[0] = cpu_namespace; + { + U32 i; + for (i=0; i<aslCpuNamePath->seg_count; i++) + multiNamePath->nameseg[i+1] = aslCpuNamePath->nameseg[i]; + } + } + return (current); +} +//----------------------------------------------------------------------------- +static void * buildPDC(void * current) +{ + ACPI_METHOD * pdc = current; + current = buildMethod(current, NAMESEG("_PDC"), 1); + + // CreateDWordField (Arg0, 0x08, CAPA) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x08); + current = buildNameSeg(current, NAMESEG("CAPA")); + + // Store (CAPA, TYPE) + current = buildOpCode(current, AML_STORE_OP); + current = buildNameSeg(current, NAMESEG("CAPA")); + current = buildNameSeg(current, NAMESEG("TYPE")); + + // CreateDWordField (Arg0, 0x00, REVS) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("REVS")); + + // CreateDWordField (Arg0, 0x04, SIZE) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("SIZE")); + + // Store(SizeOf(Arg0), Local0) + current = buildOpCode(current, AML_STORE_OP); + current = buildOpCode(current, AML_SIZEOF_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildOpCode(current, AML_LOCAL0_OP); + + // Store(Subtract(Local0, 0x08),Local1) + current = buildOpCode(current, AML_STORE_OP); + current = buildOpCode(current, AML_SUBTRACT_OP); + current = buildOpCode(current, AML_LOCAL0_OP); + current = buildByteConst(current, 0x08); + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_LOCAL1_OP); + + // CreateField (Arg0, 0x40, Multiply (Local1, 0x08), TEMP) + current = buildOpCode(current, AML_EXT_OP_PREFIX); + current = buildOpCode(current, AML_CREATE_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x40); + current = buildOpCode(current, AML_MULTIPLY_OP); + current = buildOpCode(current, AML_LOCAL1_OP); + current = buildByteConst(current, 0x08); + current = buildOpCode(current, AML_ZERO_OP); + current = buildNameSeg(current, NAMESEG("TEMP")); + + // Name (STS0, Buffer (0x04) {0x00, 0x00, 0x00, 0x00}) + // Create STS0 as named buffer + current = buildNamePath(current, NAMESEG("STS0")); + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + // count of buffer elements + current = buildByteConst(current, 4); + + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_ZERO_OP); + current = buildOpCode(current, AML_ZERO_OP); + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + + //Concatenate (STS0, TEMP, Local2) + current = buildOpCode(current, AML_CONCAT_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildNameSeg(current, NAMESEG("TEMP")); + current = buildOpCode(current, AML_LOCAL2_OP); + + //_OSC (Buffer (0x10) + // { + // /* 0000 */ 0x16, 0xA6, 0x77, 0x40, 0x0C, 0x29, 0xBE, 0x47, + // /* 0008 */ 0x9E, 0xBD, 0xD8, 0x70, 0x58, 0x71, 0x39, 0x53 + // }, REVS, SIZE, Local2) + current = buildNameSeg(current, NAMESEG("_OSC")); + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + // count of buffer elements + current = buildByteConst(current, 0x10); + + current = buildOpCode(current, 0x16); + current = buildOpCode(current, 0xa6); + current = buildOpCode(current, 0x77); + current = buildOpCode(current, 0x40); + current = buildOpCode(current, 0x0c); + current = buildOpCode(current, 0x29); + current = buildOpCode(current, 0xbe); + current = buildOpCode(current, 0x47); + current = buildOpCode(current, 0x9e); + current = buildOpCode(current, 0xbd); + current = buildOpCode(current, 0xd8); + current = buildOpCode(current, 0x70); + current = buildOpCode(current, 0x58); + current = buildOpCode(current, 0x71); + current = buildOpCode(current, 0x39); + current = buildOpCode(current, 0x53); + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + current = buildNameSeg(current, NAMESEG("REVS")); + current = buildNameSeg(current, NAMESEG("SIZE")); + current = buildOpCode(current, AML_LOCAL2_OP); + + // Update package length in PDC object + //pdc->packageLength = (U8)((U8 *)current - (U8 *)&pdc->packageLength); + setPackageLength(&pdc->pkgLength, (U8 *)current - (U8 *)&pdc->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildOSC(void * current) +{ + // + // + ACPI_METHOD * osc = current; + current = buildMethod(current, NAMESEG("_OSC"), 4); + + // CreateDWordField (Arg3, 0x04, CAPA) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG3_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("CAPA")); + + // Store (CAPA, TYPE) + current = buildOpCode(current, AML_STORE_OP); + current = buildNameSeg(current, NAMESEG("CAPA")); + current = buildNameSeg(current, NAMESEG("TYPE")); + + // CreateDWordField (Arg3, 0x00, STS0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG3_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("STS0")); + + // CreateDWordField (Arg3, 0x04, CAP0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG3_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("CAP0")); + + // CreateDWordField (Arg0, 0x00, IID0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("IID0")); + + // CreateDWordField (Arg0, 0x04, IID1) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("IID1")); + + // CreateDWordField (Arg0, 0x08, IID2) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x08); + current = buildNameSeg(current, NAMESEG("IID2")); + + // CreateDWordField (Arg0, 0x0C, IID3) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x0C); + current = buildNameSeg(current, NAMESEG("IID3")); + + // Name (UID0, Buffer (0x10) + // { + // 0x16, 0xA6, 0x77, 0x40, 0x0C, 0x29, 0xBE, 0x47, + // 0x9E, 0xBD, 0xD8, 0x70, 0x58, 0x71, 0x39, 0x53 + // }) + current = buildNamePath(current, NAMESEG("UID0")); + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + // count of buffer elements + current = buildByteConst(current, 0x10); + + current = buildOpCode(current, 0x16); + current = buildOpCode(current, 0xa6); + current = buildOpCode(current, 0x77); + current = buildOpCode(current, 0x40); + current = buildOpCode(current, 0x0c); + current = buildOpCode(current, 0x29); + current = buildOpCode(current, 0xbe); + current = buildOpCode(current, 0x47); + current = buildOpCode(current, 0x9e); + current = buildOpCode(current, 0xbd); + current = buildOpCode(current, 0xd8); + current = buildOpCode(current, 0x70); + current = buildOpCode(current, 0x58); + current = buildOpCode(current, 0x71); + current = buildOpCode(current, 0x39); + current = buildOpCode(current, 0x53); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + + // CreateDWordField (UID0, 0x00, EID0) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x00); + current = buildNameSeg(current, NAMESEG("EID0")); + + // CreateDWordField (UID0, 0x04, EID1) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x04); + current = buildNameSeg(current, NAMESEG("EID1")); + + // CreateDWordField (UID0, 0x08, EID2) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x08); + current = buildNameSeg(current, NAMESEG("EID2")); + + // CreateDWordField (UID0, 0x0C, EID3) + current = buildOpCode(current, AML_CREATE_DWORD_FIELD_OP); + current = buildOpCode(current, AML_ARG0_OP); + current = buildByteConst(current, 0x0C); + current = buildNameSeg(current, NAMESEG("EID3")); + + // If (LNot (LAnd (LAnd (LEqual (IID0, EID0), LEqual (IID1, EID1)), + // LAnd (LEqual (IID2, EID2), LEqual (IID3, EID3))))) + // { + // Store (0x06, Index (STS0, 0x00)) + // Return (Arg3) + // } + { + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + current = buildOpCode(current, AML_LNOT_OP); + current = buildOpCode(current, AML_LAND_OP); + current = buildOpCode(current, AML_LAND_OP); + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID0")); + current = buildNameSeg(current, NAMESEG("EID0")); + + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID1")); + current = buildNameSeg(current, NAMESEG("EID1")); + + current = buildOpCode(current, AML_LAND_OP); + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID2")); + current = buildNameSeg(current, NAMESEG("EID2")); + + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildNameSeg(current, NAMESEG("IID3")); + current = buildNameSeg(current, NAMESEG("EID3")); + + // Store (0x06, Index (STS0, 0x00)) + current = buildOpCode(current, AML_STORE_OP); + current = buildByteConst(current, 0x06); + current = buildOpCode(current, AML_INDEX_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildByteConst(current, 0x00); + current = buildOpCode(current, AML_ZERO_OP); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + } + + // If (LNotEqual (Arg1, 0x01)) + // { + // Store (0x0A, Index (STS0, 0x00)) + // Return (Arg3) + // } + { + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // If ("LNotEqual (Arg1, 0x01)") + current = buildOpCode(current, AML_LNOT_OP); + current = buildOpCode(current, AML_LEQUAL_OP); + current = buildOpCode(current, AML_ARG1_OP); + current = buildByteConst(current, 0x01); + + // Store (0x0A, Index (STS0, 0x00)) + current = buildOpCode(current, AML_STORE_OP); + current = buildByteConst(current, 0x0A); + current = buildOpCode(current, AML_INDEX_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildByteConst(current, 0x00); + current = buildOpCode(current, AML_ZERO_OP); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + } + + // If (And (STS0, 0x01)) + // { + // And (CAP0, 0x0BFF, CAP0) + // Return (Arg3) + // } + { + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // If ("And (STS0, 0x01)") + current = buildOpCode(current, AML_AND_OP); + current = buildNameSeg(current, NAMESEG("STS0")); + current = buildByteConst(current, 0x01); + current = buildOpCode(current, AML_ZERO_OP); + + // And (CAP0, 0x0BFF, CAP0) + current = buildOpCode(current, AML_AND_OP); + current = buildNameSeg(current, NAMESEG("CAP0")); + current = buildWordConst(current, 0x0BFF); + current = buildNameSeg(current, NAMESEG("CAP0")); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + } + + // And (CAP0, 0x0BFF, CAP0) + current = buildOpCode(current, AML_AND_OP); + current = buildNameSeg(current, NAMESEG("CAP0")); + current = buildWordConst(current, 0x0BFF); + current = buildNameSeg(current, NAMESEG("CAP0")); + + // Store (CAP0, TYPE) + current = buildOpCode(current, AML_STORE_OP); + current = buildNameSeg(current, NAMESEG("CAP0")); + current = buildNameSeg(current, NAMESEG("TYPE")); + + // Return (Arg3) + current = buildReturnOpcode(current, AML_ARG3_OP); + + // Set package length for the OSC object + setPackageLength(&osc->pkgLength, (U8 *)current - (U8 *)&osc->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPSS(void * current, PKG_PSTATES * pkg_pstates) +{ + // + // IF (PSEN) + // { + // Return (Package of Pstate Packages) + // } + // Return(Zero) + // + ACPI_METHOD * pss = current; + current = buildMethod(current, NAMESEG("_PSS"), 0); + + { + // "IF" (PSEN) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF "(PSEN)" -- IF Predicate + current = buildNameSeg(current, NAMESEG("PSEN")); + + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_pstates->num_pstates); + + // (3.3.3) For each P-state + { + U32 pstateIndex = 0; + for (pstateIndex=0; pstateIndex < pkg_pstates->num_pstates; pstateIndex++) + { + // (3.3.3.1) Create P-state package + ACPI_PSTATE_PACKAGE * pstate = current; + current = pstate + 1; + + setSmallPackage(&pstate->package, 6); + pstate->package.packageLength = (U8)(sizeof(ACPI_PSTATE_PACKAGE) - 1); + + setDwordConst(&pstate->CoreFreq, pkg_pstates->pstate[pstateIndex].frequency);// CoreFreq (in MHz). + setDwordConst(&pstate->Power, pkg_pstates->pstate[pstateIndex].power);// Power (in milliWatts). + setDwordConst(&pstate->TransLatency, pkg_pstates->pstate[pstateIndex].translatency);// Transition Latency (in microseconds). + setDwordConst(&pstate->BMLatency, pkg_pstates->pstate[pstateIndex].bmlatency);// Bus Master Latency (in microseconds). + setDwordConst(&pstate->Control, pkg_pstates->pstate[pstateIndex].control); // Control. + + setDwordConst(&pstate->Status, encode_pstate(pkg_pstates->pstate[pstateIndex].ratio));// Status. + } // for + } // for block + + // (3.3.4) Update package length in return package + setPackageLength(&returnPkg->package.pkgLength, (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // "IF (PSEN) and its body" -- Set package length + setPackageLength(packageLength, + (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Set package length for the _PSS object + setPackageLength(&pss->pkgLength, (U8 *)current - (U8 *)&pss->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPSD(void * current, U32 domain, U32 cpusInDomain, U32 pstate_coordination) +{ + // If (And(TYPE, 0x0820)) + // { + // Return (PSD Package) + // } + // Return(Zero) + + ACPI_METHOD * psdMethod = current; + current = buildMethod(current, NAMESEG("_PSD"), 0); + { + // "IF" (And(TYPE, 0x0820)) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("And"(TYPE, 0x820)) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (And("TYPE", 0x820)) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (And(TYPE, "0x0820")) -- DWORD Value Term + current = buildDwordConst(current, 0x820); + + // IF ("And(TYPE, 0x200)") -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build return package containing PSD package + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 1); + + { + // Create PSD package + ACPI_PSD_PACKAGE * psd = current; + current = psd + 1; + + setSmallPackage(&psd->package, 5); + psd->package.packageLength = (U8)(sizeof(ACPI_PSD_PACKAGE) - 1); + + setByteConst(&psd->NumberOfEntries, 5); + setByteConst(&psd->Revision, 0); + setDwordConst(&psd->Domain, domain); + setDwordConst(&psd->CoordType, pstate_coordination); + setDwordConst(&psd->NumProcessors, cpusInDomain); + + } // PSD package + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _PSD method + setPackageLength(&psdMethod->pkgLength, (U8 *)current - (U8 *)&psdMethod->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPPC(void * current/*, U8 valueToReturn*/) +{ + ACPI_SMALL_METHOD * ppc = current; + current = buildSmallMethod(current, NAMESEG("_PPC"), 0); + + current = buildReturnZero(current); + + //current = buildReturnOpcode(current, valueToReturn); + + // Update package length in PPC object + ppc->packageLength = (U8) ( (U8 *)current - (U8 *)&ppc->packageLength ); + + return(current); +} + +#if UNUSED +//----------------------------------------------------------------------------- +static void * buildPDL(void * current, U8 valueToReturn) +{ + ACPI_SMALL_METHOD * pdl = current; + current = buildSmallMethod(current, NAMESEG("_PDL"), 0); + + current = buildReturnOpcode(current, valueToReturn); + + // Update package length in PDL object + pdl->packageLength = (U8) ( (U8 *)current - (U8 *)&pdl->packageLength ); + + return(current); +} +#endif + +//----------------------------------------------------------------------------- +static void * buildPCT(void * current) +{ + static const ACPI_GENERIC_ADDRESS pct_gas[] = { + {0x7f,0x40,0,0,0x199}, + {0x7f,0x10,0,0,0x198}, + }; + + ACPI_SMALL_METHOD * pct = current; + current = buildSmallMethod(current, NAMESEG("_PCT"), 0); + + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 2); + + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &pct_gas[0]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &pct_gas[1]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + + } + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // Update package length in PCT object + pct->packageLength = (U8)((U8 *)current - (U8 *)&pct->packageLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildCstate(void * current, ACPI_GENERIC_ADDRESS * gas, CSTATE * cstate) +{ + // + // Build a C-state + // + ACPI_SMALL_PACKAGE * pkg1 = current; + current = buildSmallPackage(current, 4); + + { + { + ACPI_SMALL_BUFFER * buffer = current; + current = buildSmallBuffer(current); + + { + // Buffer length + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, gas); + current = buildEndTag(current); + } + { + U32 length = (U8 *)current - (U8 *)buffer; + buffer->packageLength = (U8)length - 1; + } + } + + { + current = buildByteConst(current, cstate->type); + current = buildWordConst(current, cstate->latency); + current = buildDwordConst(current, cstate->power); + } + } + pkg1->packageLength = (U8)((U8 *)current - (U8 *)&pkg1->packageLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildReturnPackageCST(void * current, PKG_CSTATES * pkg_cstates) +{ + // Create package returning C-states + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_cstates->num_cstates + 1); + + { + // Include number of C-states + current = buildByteConst(current, (U8)pkg_cstates->num_cstates); + + { + U32 cstateIndex = 0; + for (cstateIndex=0; cstateIndex < pkg_cstates->num_cstates; cstateIndex++) + // Build C-state + current = buildCstate(current, &pkg_cstates->gas[cstateIndex], &pkg_cstates->cstate[cstateIndex]); + } + } + + // Update package length in return package + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildCST(void * current, PKG_CSTATES * mwait_pkg_cstates, PKG_CSTATES * io_pkg_cstates) +{ + // + // IF (CSEN) + // { + // IF (LAnd(MWOS, And(TYPE, 0x200))) + // { + // Return package containing MWAIT C-states + // } + // Return package containing IO C-states + // } + // Return(Zero) + // + ACPI_METHOD * cst = current; + current = buildMethod(current, NAMESEG("_CST"), 0); + { + // "IF" CSEN -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength1 = current; + current = buildPackageLength(current, 0); + + // IF "(CSEN)" -- IF Predicate + current = buildNameSeg(current, NAMESEG("CSEN")); + + // "IF" (LAnd(MWOS, And(TYPE, 0x200))) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength2 = current; + current = buildPackageLength(current, 0); + + // IF ("LAnd"(MWOS, And(TYPE, 0x200))) -- LAND Opcode + current = buildOpCode(current, AML_LAND_OP); + + // IF (LAnd("MWOS", And(TYPE, 0x200))) -- MWOS Term + current = buildNameSeg(current, NAMESEG("MWOS")); + + // IF (LAnd(MWOS, "And"(TYPE, 0x200))) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (LAnd(MWOS, And("TYPE", 0x200))) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (LAnd(MWOS, And(TYPE, "0x200"))) -- DWORD Value Term + current = buildWordConst(current, 0x200); + + // IF (LAnd(MWOS, "And(TYPE, 0x200)")) -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build return package for mwait c-states + current = buildReturnPackageCST(current, mwait_pkg_cstates); + + setPackageLength(packageLength2, + (U8 *)current - (U8 *)packageLength2); + } + + // Build return package for io c-states + current = buildReturnPackageCST(current, io_pkg_cstates); + + setPackageLength(packageLength1, + (U8 *)current - (U8 *)packageLength1); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _CST method + setPackageLength(&cst->pkgLength, (U8 *)current - (U8 *)&cst->pkgLength); + + return(current); +} + +#if BUILD_ACPI_CSD +//----------------------------------------------------------------------------- +static void * buildCSD(void * current, U32 domain, U32 cpusInDomain, PKG_CSTATES * pkg_cstates) +{ + // If (And(TYPE, 0x0040)) + // { + // Return (CSD Package) + // } + // Return(Zero) + + ACPI_METHOD * csdMethod = current; + current = buildMethod(current, NAMESEG("_CSD"), 0); + { + // "IF" (And(TYPE, 0x0040)) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("And"(TYPE, 0x0040)) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (And("TYPE", 0x0040)) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (And(TYPE, "0x0040")) -- DWORD Value Term + current = buildDwordConst(current, 0x0040); + + // IF ("And(TYPE, 0x0040)") -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build return package containing CSD package(s) + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_cstates->num_cstates - 1); + + { + U32 cstateIndex; + for (cstateIndex=1; cstateIndex < pkg_cstates->num_cstates; cstateIndex++) + { + // Build CSD for this C-state + + // Create CSD package + ACPI_CSD_PACKAGE * csd = current; + current = csd + 1; + + setSmallPackage(&csd->package, 6); + csd->package.packageLength = (U8)(sizeof(ACPI_CSD_PACKAGE) - 1); + + setByteConst(&csd->NumberOfEntries, 6); + setByteConst(&csd->Revision, 0); + setDwordConst(&csd->Domain, domain); + setDwordConst(&csd->CoordType, ACPI_COORD_TYPE_HW_ALL); + setDwordConst(&csd->NumProcessors, cpusInDomain); + setDwordConst(&csd->Index, cstateIndex); + } + } + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _CSD method + setPackageLength(&csdMethod->pkgLength, (U8 *)current - (U8 *)&csdMethod->pkgLength); + + return(current); +} +#endif // BUILD_ACPI_CSD + +#if BUILD_ACPI_TSS +//----------------------------------------------------------------------------- +static void * buildTPC(void * current) +{ + ACPI_SMALL_METHOD * tpc = current; + current = buildSmallMethod(current, NAMESEG("_TPC"), 0); + + current = buildReturnZero(current); + + // Update package length in PPC object + tpc->packageLength = (U8) ( (U8 *)current - (U8 *)&tpc->packageLength ); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildPTC(void * current) +{ + static const ACPI_GENERIC_ADDRESS ptc_gas[] = { + {0x7f,0x00,0,0,0}, + {0x7f,0x00,0,0,0}, + }; + + ACPI_SMALL_METHOD * ptc = current; + current = buildSmallMethod(current, NAMESEG("_PTC"), 0); + + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 2); + + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &ptc_gas[0]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + { + ACPI_SMALL_BUFFER * buff = current; + current = buildSmallBuffer(current); + + current = buildByteConst(current, sizeof(ACPI_GENERIC_REGISTER) + sizeof(ACPI_END_TAG) ); + current = buildGenericRegister(current, &ptc_gas[1]); + current = buildEndTag(current); + + { + U32 length = (U8 *)current - (U8 *)buff; + buff->packageLength = (U8)length - 1; + } + } + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // Update package length in PTC object + ptc->packageLength = (U8)((U8 *)current - (U8 *)&ptc->packageLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildTSS(void * current, PKG_TSTATES * pkg_tstates) +{ + // + // IF (LAnd(TSEN, And(TYPE,4))) + // { + // Return (Package of Tstate Packages) + // } + // Return(Zero) + // + ACPI_METHOD * tss = current; + current = buildMethod(current, NAMESEG("_TSS"), 0); + + { + // "IF" (LAnd(TSEN, And(TYPE,4))) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("LAnd"(TSEN, And(TYPE, 4))) -- LAND Opcode + current = buildOpCode(current, AML_LAND_OP); + + // IF (LAnd("TSEN", And(TYPE, 4))) -- TSEN Term + current = buildNameSeg(current, NAMESEG("TSEN")); + + // IF (LAnd(TSEN, "And"(TYPE, 4))) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (LAnd(TSEN, And("TYPE", 4))) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (LAnd(TSEN, And(TYPE, "4"))) -- DWORD Value Term + current = buildWordConst(current, 4); + + // IF (LAnd(MWOS, "And(TYPE, 4)")) -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Return (Package of Tstate Packages) + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, (U8)pkg_tstates->num_tstates); + + // (3.3.3) For each T-state + { + U32 tstateIndex = 0; + for (tstateIndex=0; tstateIndex < pkg_tstates->num_tstates; tstateIndex++) + { + // (3.3.3.1) Create T-state package + ACPI_TSTATE_PACKAGE * tstate = current; + current = tstate + 1; + + setSmallPackage(&tstate->package, 5); + tstate->package.packageLength = (U8)(sizeof(ACPI_TSTATE_PACKAGE) - 1); + + setDwordConst(&tstate->FreqPercent, pkg_tstates->tstate[tstateIndex].freqpercent); + setDwordConst(&tstate->Power, pkg_tstates->tstate[tstateIndex].power); + setDwordConst(&tstate->TransLatency, pkg_tstates->tstate[tstateIndex].latency); + setDwordConst(&tstate->Control, pkg_tstates->tstate[tstateIndex].control); + setDwordConst(&tstate->Status, pkg_tstates->tstate[tstateIndex].status); + } // for + } // for block + + // (3.3.4) Update package length in return package + setPackageLength(&returnPkg->package.pkgLength, (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + // "IF (LAnd(TSEN, And(TYPE,4))) and its body" -- Set package length + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Set package length for the _TSS object + setPackageLength(&tss->pkgLength, (U8 *)current - (U8 *)&tss->pkgLength); + + return(current); +} + +//----------------------------------------------------------------------------- +static void * buildTSD(void * current, U32 domain, U32 cpusInDomain) +{ + // If (And(TYPE, 0x0080)) + // { + // Return (Package containing TSD package) + // } + // Return(Zero) + + ACPI_METHOD * tsdMethod = current; + current = buildMethod(current, NAMESEG("_TSD"), 0); + { + // "IF" (And(TYPE, 0x0080)) -- IF Opcode + current = buildOpCode(current, AML_IF_OP); + { + ACPI_PACKAGE_LENGTH * packageLength = current; + current = buildPackageLength(current, 0); + + // IF ("And"(TYPE, 0x0080)) -- AND Opcode + current = buildOpCode(current, AML_AND_OP); + + // IF (And("TYPE", 0x0080)) -- TYPE Term + current = buildNameSeg(current, NAMESEG("TYPE")); + + // IF (And(TYPE, "0x0080")) -- DWORD Value Term + current = buildDwordConst(current, 0x0080); + + // IF ("And(TYPE, 0x0080)") -- Target for And term (unused) + current = buildOpCode(current, AML_ZERO_OP); + + // Build package containing TSD package + { + ACPI_RETURN_PACKAGE * returnPkg = current; + current = buildReturnPackage(current, 1); + + { + // Create PSD package + ACPI_TSD_PACKAGE * tsd = current; + current = tsd + 1; + + setSmallPackage(&tsd->package, 5); + tsd->package.packageLength = (U8)(sizeof(ACPI_TSD_PACKAGE) - 1); + + setByteConst(&tsd->NumberOfEntries, 5); + setByteConst(&tsd->Revision, 0); + setDwordConst(&tsd->Domain, domain); + setDwordConst(&tsd->CoordType, ACPI_COORD_TYPE_SW_ANY); + setDwordConst(&tsd->NumProcessors, cpusInDomain); + + } // TSD package + + setPackageLength(&returnPkg->package.pkgLength, + (U8 *)current - (U8 *)&returnPkg->package.pkgLength); + } + + setPackageLength(packageLength, (U8 *)current - (U8 *)packageLength); + } + // "Return (ZERO)" + current = buildReturnZero(current); + } + // Update length in _TSD method + setPackageLength(&tsdMethod->pkgLength, (U8 *)current - (U8 *)&tsdMethod->pkgLength); + + return(current); +} +#endif // BUILD_ACPI_TSS + +//----------------------------------------------------------------------------- +static U32 BuildSsdt(MADT_INFO * madt_info, ACPI_TABLE_DSDT *dsdt, void * buffer, U32 bufferSize, bool enable_cstates, bool enable_pstates, bool enable_tstates) +{ + // Build SSDT + { + // (1) Setup pointers to SSDT memory location + // (2) Create SSDT Definition Block + // (2.1) Save pointer to SSDT package length and checksum fields + // (2.2) Create variables in SSDT scope + // (3) For each logical processor CPUn + // (3.1) Create scope for CPUn + // (3.2) Create variables in CPU scope + // (3.3) Create _OSC and/or _PDC Methods + // (3.4) Create P-state related structures + // (3.4.1) Create _PSS Method + // (3.4.2) Create _PCT Object + // (3.4.3) Create _PPC Method + // (3.4.4) Create _PSD Object + // (3.5) Create C-state related structures + // (3.5.1) Create _CST Method + // (3.5.2) Create _CSD Method + // (3.6) Create T-state related structures (Optional) + // (3.6.1) Create _TPC Method + // (3.6.2) Create _PTC Method + // (3.6.3) Create _TSS Method + // (3.6.4) Create _TSD Method + // (3.7) Update length in CPUn Scope + // (4) Update length and checksum in SSDT Definition Block + DBG("Attempting to build SSDT\n"); + + U32 pstates_enabled = 0; + U32 cstates_enabled = 0; + CPU_DETAILS cpu; + cpu.max_ratio_as_mfg = 0; + cpu.package_power_limit = 0; + + U8 ACPI_COORD_TYPE = ACPI_COORD_TYPE_SW_ANY; // default + ACPI_TABLE_SSDT *SsdtPointer = (void*)0ul; + + // Desired state for providing alternate ACPI _CST structure using MWAIT + // extensions + // 1= Alternate _CST using MWAIT extension is enabled for OSPM use + // 0= Alternate _CST using MWAIT extension is disabled for OSPM use + bool enable_mwait = 1; + + // (1) Setup pointers to SSDT memory location + void * current = buffer; + void * end = (U8 *)buffer + bufferSize; + + // Confirm a valid SSDT buffer was provided + if (!buffer) + { + printf("Error: Invalid Buffer Address for SSDT\n"); + return(0); + } + + // Confirm a valid SSDT buffer length was provided + if (!bufferSize) + { + printf("Error: Invalid Buffer Length for SSDT\n"); + return(0); + } + + if (madt_info == (void*) 0ul) + { + return(0); + } + + if (dsdt == (void*) 0ul) + { + return(0); + } + + // Check that we have a valid cpu_map (if it's not already done, it will try to generate it) + if (generate_cpu_map_from_acpi(dsdt) != 0) + { + return(0); + } + + collect_cpu_info(&cpu); + + if (enable_cstates && pmbase) + { + DBG("Building Cstate Info\n"); + + cstates_enabled = BuildCstateInfo(&cpu, pmbase); + if (cstates_enabled) + { + getBoolForKey(KEnableMwait, &enable_mwait, &bootInfo->chameleonConfig); + } + } + + if (enable_pstates) + { + DBG("Building Pstate Info\n"); + + pstates_enabled = BuildPstateInfo(&cpu); + if (pstates_enabled) + { + const char *str = getStringForKey(KAcpiCoordType, &bootInfo->chameleonConfig); + U8 tmp = (U8)strtoul(str, NULL,16); + if ((tmp == ACPI_COORD_TYPE_SW_ALL) || (tmp == ACPI_COORD_TYPE_SW_ANY) || (tmp == ACPI_COORD_TYPE_HW_ALL) ) + { + ACPI_COORD_TYPE = tmp; + } + } + } +#if BUILD_ACPI_TSS + U32 tstates_enabled = 0; + if (enable_tstates) + { + DBG("Building Pstate Info\n"); + + tstates_enabled = BuildTstateInfo(&cpu); + } +#endif + + SsdtPointer = (ACPI_TABLE_SSDT *)buffer; + + // (2) Create SSDT Definition Block + // (2.1) Save pointer to SSDT package length and checksum fields + current = buildTableHeader(current, NAMESEG("SSDT"), NAMESEG64("PPM RCM ")); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3) For each logical processor CPUn + // We will use the dsdt datas in place of madt,for the cpu(s) detection. + // 'Cause most users use the dsdt table to change the numbers of cpu(s) that the OS and the bootloader should use, + // Note also that due to chameleon limit we use the same package per each cpu(s) for all objects and methods + // (package detection for each cpu(s) is still in progress) + { + U32 lapic_index; + for (lapic_index=0; lapic_index < cpu_map_count; lapic_index++) + { + // (3.1) Create scope for CPUn + ACPI_SCOPE * scope = current; + + { + DBG("Building CPU Scope\n"); + U32 cpu_namespace = (cpuNamespace == CPU_NAMESPACE_SB) ? NAMESEG("_SB_") : NAMESEG("_PR_"); + PROCESSOR_NUMBER_TO_NAMESEG * namepath = &cpu_map[lapic_index]; + current = buildCpuScope (current, cpu_namespace, namepath ); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.2) Create variables in CPU scope + DBG("Creating variables in CPU scope\n"); // Build Type variable used to store PDC capabilities + current = buildNamedDword(current, NAMESEG("TYPE"), 0); + + // Build PSEN variable used to store state of P-State Enable setup option + current = buildNamedDword(current, NAMESEG("PSEN"), pstates_enabled); + + // Build CSEN variable used to store state of C-State Enable setup option + current = buildNamedDword(current, NAMESEG("CSEN"), cstates_enabled); + + // Build MWOS variable used to store state of MWAIT OS setup option + current = buildNamedDword(current, NAMESEG("MWOS"), (U32)(enable_mwait&&cpu.mwait_supported)); + + // (3.3) Create _OSC and/or _PDC Methods + { + // Build _PDC method + DBG("Building PDC method\n"); + current = buildPDC(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // Build _OSC method + DBG("Building _OSC method\n"); + current = buildOSC(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + } + + // (3.4) Create P-state related structures + if (pstates_enabled == 1) + { + // (3.4.1) Create _PSS Method + { + DBG("Building _PSS method\n"); + PKG_PSTATES * pkg_pstates = &cpu.pkg_pstates; + current = buildPSS(current, pkg_pstates); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.4.2) Create _PCT Object + DBG("Building _PCT Object\n"); + current = buildPCT(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.4.3) Create _PPC Method + DBG("Building _PPC Method\n"); + current = buildPPC(current); + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + // (3.4.4) Create PSD with hardware coordination + { + DBG("Building _PSD Method\n"); + U32 domain = madt_info->lapic[lapic_index].pkg_index; + + // In this (bad?) implementation we use the nb of cpu found in the dsdt + U32 cpusInDomain = cpu_map_count; + current = buildPSD(current, domain, cpusInDomain, ACPI_COORD_TYPE); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + } + + // (3.5) Create C-state related structures + if (cstates_enabled == 1) + { + { + PKG_CSTATES * mwait_pkg_cstates = &cpu.pkg_mwait_cstates; + PKG_CSTATES * io_pkg_cstates = &cpu.pkg_io_cstates; + + // Build CST + DBG("Building _CST Method\n"); + current = buildCST(current, mwait_pkg_cstates, io_pkg_cstates); + } + +#if BUILD_ACPI_CSD + { + // Use core_apic_id as domain + U32 domain = lapic->core_apic_id; + + // In this (bad?) implementation we use the nb of cpu found in the dsdt + U32 cpusInDomain = cpu_map_count; + + // Create CSD + current = buildCSD(current, domain, cpusInDomain, io_pkg_cstates); + } +#endif + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)(current) > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + } +#if BUILD_ACPI_TSS + // (3.6) Create T-state related structures + if (tstates_enabled == 1) + { + // (3.6.1) Create _TPC Method + current = buildTPC(current); + + // (3.6.2) Create _PTC Method + current = buildPTC(current); + + // (3.6.3) Create _TSS Method + { + PKG_TSTATES * pkg_tstates = &cpu.pkg_tstates; + current = buildTSS(current, pkg_tstates); + } + + // (3.6.4) Create _TSD Method + { + LAPIC_INFO * lapic = &madt_info.lapic[lapic_index]; + + // Use core_apic_id as domain + U32 domain = lapic->core_apic_id; + + // In this (bad?) implementation we use the nb of cpu found in the dsdt + U32 cpusInDomain = cpu_map_count; + + current = buildTSD(current, domain, cpusInDomain); + } + } +#endif + // (3.7) Update length in CPUn Scope + setPackageLength(&scope->pkgLength, (U8 *)current - (U8 *)&scope->pkgLength); + + } // End for + + // (4) Update length and checksum in SSDT Definition Block + { + DBG("Updating length and checksum in SSDT Definition Block\n"); + + SsdtPointer->Header.Length = (U8 *)current - (U8 *)SsdtPointer; + SetChecksum(&SsdtPointer->Header); + } + + // Check to confirm no SSDT buffer overflow + if ( (U8 *)current > (U8 *)end ) + { + printf("Error: SSDT Buffer Length exceeded available space \n"); + return(0); + } + + } // End build SSDT + + } // SSDT + + return(1); +} + +#if UNUSED +static ACPI_TABLE_FACS* generate_facs(bool updatefacs ) +{ + ACPI_TABLE_FACS* facs_mod=(ACPI_TABLE_FACS *)AllocateKernelMemory(sizeof(ACPI_TABLE_FACS)); + if (!facs_mod) + { + printf("Unable to allocate kernel memory for facs mod\n"); + return (void*)0ul; + } + bzero(facs_mod, sizeof(ACPI_TABLE_FACS)); + + ACPI_TABLE_FACS * FacsPointer =(acpi_tables.FacsPointer64 != (void *)0ul) ? + (ACPI_TABLE_FACS *)acpi_tables.FacsPointer64 : (ACPI_TABLE_FACS *)acpi_tables.FacsPointer; + + memcpy(facs_mod, FacsPointer , FacsPointer->Length); + facs_mod->Length = sizeof(ACPI_TABLE_FACS); + + if (FacsPointer->Length < sizeof(ACPI_TABLE_FACS)) + { + facs_mod->FirmwareWakingVector = 0; + facs_mod->GlobalLock = 0; + facs_mod->Flags = 0; + } + + if (updatefacs && FacsPointer->Version < 2) + { + if (FacsPointer->Version > 0) + { + facs_mod->XFirmwareWakingVector = FacsPointer->XFirmwareWakingVector; + } + else + { + facs_mod->XFirmwareWakingVector = (U64)facs_mod->FirmwareWakingVector; + } + + facs_mod->Version = 2; /* ACPI 1.0: 0, ACPI 2.0/3.0: 1, ACPI 4.0: 2 */ + + } + + return facs_mod; +} +#endif + +static ACPI_GENERIC_ADDRESS FillGASStruct(U32 Address, U8 Length) +{ + ACPI_GENERIC_ADDRESS TmpGAS; + + TmpGAS.SpaceId = 1; /* I/O Address */ + + if (Address == 0) + { + TmpGAS.BitWidth = 0; + } + else + { + TmpGAS.BitWidth = Length * 8; + } + + TmpGAS.BitOffset = 0; + TmpGAS.AccessWidth = 0; /* Not set for Legacy reasons... */ + TmpGAS.Address = (U64)Address; + + return (TmpGAS); +} + +static ACPI_TABLE_FADT * +patch_fadt(ACPI_TABLE_FADT *fadt, ACPI_TABLE_DSDT *new_dsdt, bool UpdateFADT) +{ + ACPI_TABLE_FADT *fadt_mod = (void*)0; + bool fadt_rev2_needed = false; + bool fix_restart = false; + const char * value; + + // Restart Fix + if (Platform.CPU.Vendor == CPUID_VENDOR_INTEL) + { + fix_restart = true; + getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig); + + } else { + verbose ("Not an Intel platform: Restart Fix disabled !!!\n"); + } + + if (fix_restart) + fadt_rev2_needed = true; + + // Allocate new fadt table + if (UpdateFADT) + { + if (fadt->Header.Length < 0xF4) + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(0xF4); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + bzero(fadt_mod, 0xF4); + memcpy(fadt_mod, fadt, fadt->Header.Length); + fadt_mod->Header.Length = 0xF4; + + } + else + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(fadt->Header.Length); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + memcpy(fadt_mod, fadt, fadt->Header.Length); + } + + + //fadt_mod->Header.Revision = 0x04; // FADT rev 4 + fadt_mod->ResetRegister = FillGASStruct(0, 0); + fadt_mod->ResetValue = 0; + fadt_mod->Reserved4[0] = 0; + fadt_mod->Reserved4[1] = 0; + fadt_mod->Reserved4[2] = 0; + + fadt_mod->XPm1aEventBlock = FillGASStruct(fadt_mod->Pm1aEventBlock, fadt_mod->Pm1EventLength); + fadt_mod->XPm1bEventBlock = FillGASStruct(fadt_mod->Pm1bEventBlock, fadt_mod->Pm1EventLength); + fadt_mod->XPm1aControlBlock = FillGASStruct(fadt_mod->Pm1aControlBlock, fadt_mod->Pm1ControlLength); + fadt_mod->XPm1bControlBlock = FillGASStruct(fadt_mod->Pm1bControlBlock, fadt_mod->Pm1ControlLength); + fadt_mod->XPm2ControlBlock = FillGASStruct(fadt_mod->Pm2ControlBlock, fadt_mod->Pm2ControlLength); + fadt_mod->XPmTimerBlock = FillGASStruct(fadt_mod->PmTimerBlock, fadt_mod->PmTimerLength); + fadt_mod->XGpe0Block = FillGASStruct(fadt_mod->Gpe0Block, fadt_mod->Gpe0BlockLength); + fadt_mod->XGpe1Block = FillGASStruct(fadt_mod->Gpe1Block, fadt_mod->Gpe1BlockLength); + if (fadt->Header.Revision < 4) + { + fadt_mod->Header.Revision = 0x04; // FADT rev 4 + verbose("Converted ACPI V%d FADT to ACPI V4 FADT\n", fadt->Header.Revision); + + } + } + else + { + + if (fadt_rev2_needed) + { + if (fadt->Header.Length < 0x84 ) + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(0x84); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + bzero(fadt_mod, 0x84); + memcpy(fadt_mod, fadt, fadt->Header.Length); + fadt_mod->Header.Length = 0x84; + } + else + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(fadt->Header.Length); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + memcpy(fadt_mod, fadt, fadt->Header.Length); + } + + if (fadt->Header.Revision < 2) + { + fadt_mod->Header.Revision = 0x02; // FADT rev 2 (ACPI 1.0B MS extensions) + verbose("Converted ACPI V%d FADT to ACPI V2 FADT\n", fadt->Header.Revision ); + } + } + else + { + if (fadt->Header.Length < 0x74 ) + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(0x74); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + bzero(fadt_mod, 0x74); + memcpy(fadt_mod, fadt, fadt->Header.Length); + fadt_mod->Header.Length = 0x74; + fadt_mod->Header.Revision = 0x01; + verbose("Warning: ACPI FADT length was < 0x74 which is the minimum for the ACPI FADT V1 specification, \n", fadt->Header.Revision ); + verbose(" trying to convert it to Version 1. \n"); + + } + else + { + fadt_mod=(ACPI_TABLE_FADT *)AllocateKernelMemory(fadt->Header.Length); + if (!fadt_mod) + { + printf("Unable to allocate kernel memory for fadt mod\n"); + return (void*)0ul; + } + memcpy(fadt_mod, fadt, fadt->Header.Length); + } + } + } + bool intelfadtspec = true; + U8 Type = PMProfileError; + // Determine system type / PM_Model + + // Fix System-type if needed (should never happen) + if (Platform.Type > MaxSupportedPMProfile) + { + if(fadt_mod->PreferredProfile <= MaxSupportedPMProfile) + Platform.Type = fadt_mod->PreferredProfile;// get the fadt if correct + else + Platform.Type = 1; /* Set a fixed value (Desktop) */ + } + + // If needed, set System-type from PM_Profile (if valid) else set PM_Profile with a fixed the System-type + // Give prior to the FADT pm profile, allow to also control this value with a patched FADT table + if (fadt_mod->PreferredProfile != Platform.Type) + { + bool val = false; + getBoolForKey("PreferInternalProfileDetect", &val, &bootInfo->chameleonConfig); // if true Give prior to the profile resolved trought the CPU model + + //val = get_env(envIsServer) ; + + if (fadt_mod->PreferredProfile <= MaxSupportedPMProfile && !val) + { + Platform.Type = fadt_mod->PreferredProfile; + } + else + { + fadt_mod->PreferredProfile = (U8)Platform.Type; + } + + } + + // Set PM_Profile and System-type if user wanted this value to be forced + if ( (value=getStringForKey("SystemType", &bootInfo->chameleonConfig))!=NULL) + { + if ((Type = (unsigned char) strtoul(value, NULL, 10) ) <= MaxSupportedPMProfile) + { + if (fadt_mod->PreferredProfile != Type) + { + verbose("FADT: changing Preferred_PM_Profile from %d to %d\n", fadt->PreferredProfile, Type); + + Platform.Type = (fadt_mod->PreferredProfile = Type); + } + else + { + DBG("FADT: Preferred_PM_Profile was already set to %d, no need to be changed\n",Type); + } + + } else printf("Error: system-type must be 0..6. Defaulting to %d !\n", (U8)Platform.Type); + } + + getBoolForKey(KIntelFADT, &intelfadtspec, &bootInfo->chameleonConfig); + if ((pmbase == 0) && (cpu_map_error == 0) && (intelfadtspec == true)) + { + ACPI_TABLE_DSDT *DsdtPointer ; + if (new_dsdt != (void*)0ul) + DsdtPointer = new_dsdt; + else if ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0ul)) + DsdtPointer = (ACPI_TABLE_DSDT *)((U32)fadt_mod->XDsdt); + else + DsdtPointer = (ACPI_TABLE_DSDT *)fadt_mod->Dsdt; + + generate_cpu_map_from_acpi(DsdtPointer); + } + + // Patch DSDT Address if we have loaded a DSDT table + if(new_dsdt != (void*)0ul) + fadt_mod->Dsdt=(U32)new_dsdt; + + fadt_mod->Facs= fadt->Facs; + //fadt_mod->Facs=(U32)generate_facs(false); + + // Patch FADT to fix restart + if (fadt_mod->Header.Revision >= 2 && fix_restart) + { + fadt_mod->Flags|= 0x400; + + int type = PCI_RESET_TYPE; + getIntForKey(KResetType, &type, &bootInfo->chameleonConfig); + if (type == KEYBOARD_RESET_TYPE) + { + //Azi: keyboard reset; http://forum.voodooprojects.org/index.php/topic,1056.msg9802.html#msg9802 + fadt_mod->ResetRegister = FillGASStruct(0x64, 1); + fadt_mod->ResetValue = 0xfe; + } + else + { + fadt_mod->ResetRegister = FillGASStruct(0x0cf9, 1); + fadt_mod->ResetValue = 0x06; + } + verbose("FADT: Restart Fix applied (Type : %s) !\n", (type == 0) ? "PCI": "KEYBOARD"); + } + + if (fadt_mod->Header.Revision >= 3) + { + + + if (UpdateFADT) + { + + //fadt_mod->XFacs= (U64)((U32)generate_facs(true)); + fadt_mod->XFacs=(U64)fadt->Facs; + + } + else + { + fadt_mod->XFacs=(U64)fadt->XFacs; + } + + + if(new_dsdt != (void*)0ul) + fadt_mod->XDsdt=((U64)(U32)new_dsdt); + else if (UpdateFADT) + fadt_mod->XDsdt=(U64)fadt_mod->Dsdt; + + + //safe_set_env(envHardwareSignature,((ACPI_TABLE_FACS *)((U32)fadt_mod->XFacs))->HardwareSignature); + + + } +#if 0 + else + { + + safe_set_env(envHardwareSignature,((ACPI_TABLE_FACS *)fadt_mod->Facs)->HardwareSignature); + + } + + + DBG("setting hardware_signature to %x \n",(U32)get_env(envHardwareSignature)); +#endif + + + + if (pmbase && (intelfadtspec == true)) + ProcessFadt(fadt_mod, pmbase); // The checksum correction will be done by ProcessFadt + else + SetChecksum(&fadt_mod->Header); // Correct the checksum + + return fadt_mod; +} + +static U32 process_xsdt (ACPI_TABLE_RSDP *rsdp_mod , U32 *new_table_list) +{ + TagPtr DropTables_p = 0; + int DropTables_tag_count = 0; + + if (bootInfo->chameleonConfig.dictionary) + { + DropTables_p = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"ACPIDropTables")); + if (DropTables_p) DropTables_tag_count = XMLTagCount(DropTables_p) ; + } + + U32 new_table = 0ul; + U8 new_table_index = 0, table_added = 0; + ACPI_TABLE_XSDT *xsdt = (void*)0ul, *xsdt_mod = (void*)0ul; + ACPI_TABLE_RSDT *rsdt_conv = (void *)0ul; + + // FIXME: handle 64-bit address correctly + + xsdt=(ACPI_TABLE_XSDT *)acpi_tables.XsdtPointer; + + verbose("* Processing XSDT: \n"); + + DBG(" XSDT @%x, Length=%d\n", (U32)xsdt, + xsdt->Header.Length); + + if (xsdt != (void *)0ul) + { + U32 dropoffset=0, index; + table_added = 0; + + xsdt_mod=(ACPI_TABLE_XSDT *)AllocateKernelMemory(xsdt->Header.Length); + if (!xsdt_mod) + { + printf("Unable to allocate kernel memory for xsdt mod\n"); + return (0); + } + bzero(xsdt_mod, xsdt->Header.Length); + memcpy(&xsdt_mod->Header, &xsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + U32 num_tables=get_num_tables64(xsdt); + + for (index = 0; index < num_tables; index++) + { + + U64 ptr = xsdt->TableOffsetEntry[index]; + + { + if (ptr > ULONG_MAX) + { +#if DEBUG_ACPI + printf("Warning xsdt->TableOffsetEntry[%d]: Beyond addressable memory in this CPU mode, ignored !!!\n",index); +#endif + continue; + } + + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(((ACPI_TABLE_HEADER *) (unsigned long)ptr), + ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning xsdt->TableOffsetEntry[%d]: Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + xsdt_mod->TableOffsetEntry[index-dropoffset]=ptr; + + char tableSig[5]; + strlcpy(tableSig, (char*)((U32)ptr), sizeof(tableSig)); + + DBG("** Processing %s,", tableSig ); + + DBG(" @%x, Length=%d\n", (U32)ptr, + ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length); + + { + bool oem = false; + char oemOption[OEMOPT_SIZE]; + sprintf(oemOption, "oem%s",tableSig ); + if (getBoolForKey(oemOption, &oem, &bootInfo->chameleonConfig) && oem) // This method don't work for DSDT and FACS + { + + DBG(" %s required\n", oemOption); + + if (get_new_table_in_list(new_table_list,(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature), &new_table_index) != (void*)0ul) + new_table_list[new_table_index] = 0ul; // This way new table will not be added to the new rsdt list !! + + continue; + } + } + + if ((DropTables_tag_count > 0) && DropTables_p) + { + TagPtr match_drop = XMLGetProperty(DropTables_p, (const char*)tableSig); + if ( match_drop ) + { + char *tmp = XMLCastString(match_drop); + if (tmp && (strcmp(tmp,"No") != 0)) + { + dropoffset++; + DBG(" %s table dropped\n",tableSig); + continue; + } + } + } + + { + if ((new_table = (U32)get_new_table_in_list(new_table_list,(*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature), &new_table_index)) != 0ul) + { + DBG(" Found replacement for table %s\n",tableSig); + xsdt_mod->TableOffsetEntry[index-dropoffset]=(U64)new_table; + new_table_list[new_table_index] = 0ul; // table replaced !! + continue; + } + } + + } + + + { + U8 i; + for (i = 0; i< (MAX_ACPI_TABLE + RESERVED_AERA); i++) + { + if (new_table_list[i] != 0ul) + { +#if DEBUG_ACPI + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + printf("Adding table : "); + print_nameseg(*(U32 *) (table_array[i]->Signature)); + printf("\n"); +#endif + xsdt_mod->TableOffsetEntry[index-dropoffset]=(U64)new_table_list[i]; + table_added++; + index++; + } + } + } + + // Correct the checksum of XSDT + xsdt_mod->Header.Length-=8*dropoffset; + xsdt_mod->Header.Length+=8*table_added; + + SetChecksum(&xsdt_mod->Header); + + update_rsdp_with_xsdt(rsdp_mod, xsdt_mod); + + verbose("* Creating new RSDT from XSDT table\n"); + + rsdt_conv = (ACPI_TABLE_RSDT *)gen_alloc_rsdt_from_xsdt(xsdt_mod); + + if (rsdt_conv != (void*)0ul) + { +#if DEBUG_ACPI + DBG("Attempting to update RSDP with RSDT \n"); + { + U32 ret = update_rsdp_with_rsdt(rsdp_mod, rsdt_conv); + if (ret) + DBG("RSDP update with RSDT successfully !!! \n"); + } +#else + update_rsdp_with_rsdt(rsdp_mod, rsdt_conv); +#endif + } + + } + else + { + DBG("About to drop XSDT\n"); + + /*FIXME: Now we just hope that if MacOS doesn't find XSDT it reverts to RSDT. + * A Better strategy would be to generate + */ + + rsdp_mod->XsdtPhysicalAddress=0xffffffffffffffffLL; + verbose("XSDT not found or XSDT incorrect\n"); + } + return (1); + +} + +static U32 process_rsdt(ACPI_TABLE_RSDP *rsdp_mod , bool gen_xsdt, U32 *new_table_list) +{ + TagPtr DropTables_p = 0; + int DropTables_tag_count = 0; + + if (bootInfo->chameleonConfig.dictionary) + { + DropTables_p = XMLCastDict(XMLGetProperty(bootInfo->chameleonConfig.dictionary, (const char*)"ACPIDropTables")); + if (DropTables_p) DropTables_tag_count = XMLTagCount(DropTables_p) ; + } + + U32 new_table = 0ul; + U8 new_table_index = 0, table_added = 0; + U32 dropoffset=0, index; + ACPI_TABLE_RSDT *rsdt = (void *)0ul, *rsdt_mod = (void *)0ul; + ACPI_TABLE_XSDT *xsdt_conv = (void *)0ul; + + rsdt=(ACPI_TABLE_RSDT *)acpi_tables.RsdtPointer; + + rsdt_mod=(ACPI_TABLE_RSDT *)AllocateKernelMemory(rsdt->Header.Length); + + if (!rsdt_mod) + { + printf("Unable to allocate kernel memory for rsdt mod\n"); + return (0); + } + + bzero(rsdt_mod, rsdt->Header.Length); + memcpy (&rsdt_mod->Header, &rsdt->Header, sizeof(ACPI_TABLE_HEADER)); + + // Compute number of table pointers included in RSDT + U32 num_tables = get_num_tables(rsdt); + + verbose("* Processing RSDT: \n"); + + DBG(" RSDT @%x, Length %d\n",rsdt, rsdt->Header.Length); + + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) rsdt->TableOffsetEntry; + + for (index = 0; index < num_tables; index++) + { + + { + + int method = 0; + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + + + if (method != 0x2) + { + if (GetChecksum(table_array[index], table_array[index]->Length) != 0) + { +#if DEBUG_ACPI + printf("Warning rsdt->TableOffsetEntry[%d]: Invalide checksum, ignored !!!\n",index); +#endif + continue; + } + } + + } + + rsdt_mod->TableOffsetEntry[index-dropoffset]=rsdt->TableOffsetEntry[index]; + + char tableSig[5]; + strlcpy(tableSig, (char*)(rsdt->TableOffsetEntry[index]), sizeof(tableSig)); + + DBG("** Processing %s,", tableSig ); + + DBG(" @%x, Length=%d\n", (U32)table_array[index], + table_array[index]->Length); + + { + bool oem = false; + char oemOption[OEMOPT_SIZE]; + sprintf(oemOption, "oem%s",tableSig ); + if (getBoolForKey(oemOption, &oem, &bootInfo->chameleonConfig) && oem) // This method don't work for DSDT and FACS + { + DBG(" %s required\n", oemOption); + + if (get_new_table_in_list(new_table_list,(*(U32 *) (table_array[index]->Signature)), &new_table_index) != (void*)0ul ) + new_table_list[new_table_index] = 0ul; // This way new table will not be added to the new rsdt list !! + + continue; + } + } + + if ((DropTables_tag_count > 0) && DropTables_p) + { + TagPtr match_drop = XMLGetProperty(DropTables_p, (const char*)tableSig); + if ( match_drop ) + { + char *tmp = XMLCastString(match_drop); + if (strcmp(tmp,"No") != 0) + { + dropoffset++; + DBG(" %s table dropped\n",tableSig); + continue; + } + } + } + + { + if ((new_table = (U32)get_new_table_in_list(new_table_list,(*(U32 *) (table_array[index]->Signature)), &new_table_index)) != 0ul) + { + DBG(" Found replacement for table %s\n",tableSig); + + rsdt_mod->TableOffsetEntry[index-dropoffset]=new_table; + new_table_list[new_table_index] = 0ul; // table replaced !! + continue; + } + } + + } + DBG("\n"); + + { + U8 i; + for (i = 0; i< (MAX_ACPI_TABLE + RESERVED_AERA); i++) + { + if (new_table_list[i] != 0ul) + { +#if DEBUG_ACPI + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) new_table_list; + printf("Adding table : "); + print_nameseg(*(U32 *) (table_array[i]->Signature)); + printf("\n"); +#endif + rsdt_mod->TableOffsetEntry[index-dropoffset]=new_table_list[i]; + table_added++; + index++; + } + } + } + + // Correct the checksum of RSDT + rsdt_mod->Header.Length-=4*dropoffset; + rsdt_mod->Header.Length+=4*table_added; + + DBG("RSDT: Original checksum %d\n", rsdt_mod->Header.Checksum); + + SetChecksum(&rsdt_mod->Header); + + DBG("New checksum %d at %x\n", rsdt_mod->Header.Checksum,rsdt_mod); + + update_rsdp_with_rsdt(rsdp_mod, rsdt_mod); + + if (gen_xsdt) + { + verbose("* Creating new XSDT from RSDT table\n"); + xsdt_conv = (ACPI_TABLE_XSDT *)gen_alloc_xsdt_from_rsdt(rsdt_mod); + + if (xsdt_conv != (void *)0ul ) + { +#if DEBUG_ACPI + DBG("Attempting to update RSDP with XSDT \n"); + { + U32 ret = update_rsdp_with_xsdt(rsdp_mod, xsdt_conv); + if (ret) + DBG("RSDP update with XSDT successfully !!! \n"); + } +#else + update_rsdp_with_xsdt(rsdp_mod, xsdt_conv); +#endif + + } + + } + return (1); +} + +EFI_STATUS setup_Acpi(void) +{ + U8 Revision = 0; + + cpu_map_error = 0; + cpu_map_count = 0; + pmbase = 0; + + EFI_STATUS Status = EFI_ABORTED; + + U32 new_table_list[MAX_ACPI_TABLE + RESERVED_AERA]; //max table + reserved aera + U8 new_table_index = 0; + + ACPI_TABLE_DSDT* DsdtPtr = (void *)0ul; // a Pointer to the dsdt table present in fadt_mod + + ACPI_TABLE_DSDT *new_dsdt = (void *)0ul; // a Pointer to the dsdt file + ACPI_TABLE_FADT *fadt_mod = (void *)0ul; // a Pointer to the patched FACP table + ACPI_TABLE_FADT *fadt_file = (void *)0ul; // a Pointer to the (non-patched) fadt file + ACPI_TABLE_FADT *FacpPointer = (void *)0ul; // a Pointer to the non-patched FACP table, it can be a file or the FACP table found in the RSDT/XSDT + ACPI_TABLE_RSDP *rsdp_mod = (void *)0ul, *rsdp_conv = (void *)0ul; + + U32 rsdplength; + + bool update_acpi=false, gen_xsdt=false; + + bool gen_csta=false, gen_psta=false, speed_step=false; + bool gen_ssdt=false; // will force to generate ssdt even if gen_csta and gen_psta = false + bool gen_tsta=false; + bool oem_dsdt=false, oem_fadt=false; + + // Find original rsdp + if (!FindAcpiTables(&acpi_tables)) + { + printf("Error: AcpiCodec Failed to detect ACPI tables.\n"); + getchar(); + return EFI_NOT_FOUND; + } + + { + U8 i; + + for (i=0; i<(MAX_ACPI_TABLE + RESERVED_AERA); i++) + { + new_table_list[i] = 0ul; + } + bool tmpval; + + oem_dsdt=getBoolForKey(kOEMDSDT, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + oem_fadt=getBoolForKey(kOEMFADT, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + + gen_csta=getBoolForKey(kGenerateCStates, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + gen_psta=getBoolForKey(kGeneratePStates, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + gen_ssdt=getBoolForKey(KForceSSDT, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + update_acpi=getBoolForKey(kUpdateACPI, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + + speed_step=getBoolForKey(kSpeedstep, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + turbo_enabled=(U32)getBoolForKey(kCoreTurbo, &tmpval, &bootInfo->chameleonConfig)&&tmpval; +#if BUILD_ACPI_TSS + gen_tsta=(U32)getBoolForKey(kGenerateTStates, &tmpval, &bootInfo->chameleonConfig)&&tmpval; +#endif + checkOem=getBoolForKey(kOnlySignedAml, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } + + { + long ret, length, flags, time; + long long index = 0; + const char * name; + + U8 i = 0; + char dirspec[512]; + bool acpidir_found = false; + + ret = GetFileInfo("rd(0,0)/Extra/", "Acpi", &flags, &time); + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) + { + sprintf(dirspec, "rd(0,0)/Extra/Acpi/"); + acpidir_found = true; + + } + else + { + + ret = GetFileInfo("/Extra/", "Acpi", &flags, &time); + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) + { + sprintf(dirspec, "/Extra/Acpi/"); + acpidir_found = true; + + } + else + { + ret = GetFileInfo("bt(0,0)/Extra/", "Acpi", &flags, &time); + if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) + { + sprintf(dirspec, "bt(0,0)/Extra/Acpi/"); + acpidir_found = true; + + } + } + } + + if (acpidir_found == true) + { +#if ACPISGN + if (checkOem == true) + { + MakeAcpiSgn(); + } +#endif + + while (1) { + ret = GetDirEntry(dirspec, &index, &name, &flags, &time); + if (ret == -1) break; +#if DEBUG_ACPI + printf("testing %s\n", name); +#endif + // Make sure this is a directory. + if ((flags & kFileTypeMask) == kFileTypeDirectory) continue; + + // Make sure this is a kext. + length = strlen(name); + if (strcmp(name + length - 4, ".aml")) + { +#if DEBUG_ACPI + printf("Ignoring %s\n", name); +#endif + continue; + } + + // Some simple verifications to save time in case of those tables simply named as follow: + if ((strncmp(name, "RSDT", 4) == 0) || (strncmp(name, "rsdt", 4) == 0) || + (strncmp(name, "XSDT", 4) == 0) || (strncmp(name, "xsdt", 4) == 0) || + (strncmp(name, "RSDP", 4) == 0) || (strncmp(name, "rsdp", 4) == 0)) + { +#if DEBUG_ACPI + printf("Ignoring %s\n", name); +#endif + continue; + } + + if ((strncmp(name, "FACS", 4) == 0) || (strncmp(name, "facs", 4) == 0)) // FACS is not supported + { +#if DEBUG_ACPI + printf("Ignoring %s\n", name); +#endif + continue; + } + + DBG("* Attempting to load acpi table: %s\n", name); + if ( (new_table_list[i]=(U32)loadACPITable(new_table_list,dirspec,name))) + { + if (i < MAX_ACPI_TABLE) + { + i++; + } + else + { + DBG("Max nb of allowed aml files reached, exiting ."); + break; + } + } + } + + if (i) + { + //sanitize the new tables list + sanitize_new_table_list(new_table_list); + + //move to kernel memory + move_table_list_to_kmem(new_table_list); + + DBG("New ACPI tables Loaded in memory\n"); + } + + + } + + } +#if HARDCODED_DSDT + do { +#include "dsdt_PRLSACPI.h" + + U8 index = 0; + + if ((get_new_table_in_list(new_table_list, NAMESEG("DSDT"), &new_table_index)) != (void*)0ul ) + { + index = new_table_index; + } + else + { + U8 empty = get_0ul_index_in_list(new_table_list, false); + if (empty != ACPI_TABLE_LIST_FULL_NON_RESERVED) + { + index = empty; + } + else + { + printf("Error: not enought reserved space in the new acpi list for the Harcoded DSDT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + + break; + } + } + + if (index) + { + + ACPI_TABLE_DSDT *tmp = (ACPI_TABLE_DSDT *)DsdtAmlCode; + ACPI_TABLE_DSDT *hardcoded_dsdt = (void *)0ul; + + hardcoded_dsdt = (ACPI_TABLE_DSDT *)AllocateKernelMemory(tmp->Header.Length); + memcpy(hardcoded_dsdt, tmp, tmp->Header.Length); + new_table_list[index] = (U32)hardcoded_dsdt; // add the patched table to the list + } + else + { + printf("Error: not enought reserved space in the new acpi list for the Harcoded DSDT table,\n "); + printf(" please increase the RESERVED_AERA\n"); + + break; + } + } while (0); +#endif + if (speed_step) + { + gen_psta= true; + gen_csta= true; + } + + + ACPI_TABLE_RSDP *rsdp=(ACPI_TABLE_RSDP *)acpi_tables.RsdPointer; + + if (rsdp == (void*)0ul || (GetChecksum(rsdp, (rsdp->Revision == 0) ? ACPI_RSDP_REV0_SIZE:sizeof(ACPI_TABLE_RSDP)) != 0) ) + { + printf("Error : ACPI RSD PTR Revision %d checksum is incorrect or table not found \n",rsdp->Revision ); + return EFI_UNSUPPORTED; + } + + if ((update_acpi) && (rsdp->Revision == 0)) + { + + rsdp_conv = (ACPI_TABLE_RSDP *)gen_alloc_rsdp_v2_from_v1(rsdp); + if (rsdp_conv != (void *)0ul) + { + gen_xsdt = true; + rsdp = rsdp_conv; + verbose("Converted ACPI RSD PTR Revision 0 to Revision 2\n"); + } + + } + + Revision = rsdp->Revision ; + rsdplength=(Revision == 2)?rsdp->Length:ACPI_RSDP_REV0_SIZE; + + DBG("RSDP Revision %d found @%x. Length=%d\n",Revision,rsdp,rsdplength); + + if (gen_xsdt) + { + rsdp_mod=rsdp_conv; + } + else + { + rsdp_mod=(ACPI_TABLE_RSDP *) AllocateKernelMemory(rsdplength); + + if (!rsdp_mod) return EFI_OUT_OF_RESOURCES; + + memcpy(rsdp_mod, rsdp, rsdplength); + } + + + if ((fadt_file = (ACPI_TABLE_FADT *)get_new_table_in_list(new_table_list, NAMESEG("FACP"), &new_table_index)) != (void *)0ul) + { + + if (oem_fadt == false) + FacpPointer = (ACPI_TABLE_FADT *)fadt_file; + + new_table_list[new_table_index] = 0ul; // This way, the non-patched table will not be added in our new rsdt/xsdt table list + + } else + FacpPointer = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + +#if DEBUG_ACPI + if ((FacpPointer != (void *)0ul) || (oem_fadt == false)) + { + printf("FADT found @%x, Length %d\n",FacpPointer, FacpPointer->Header.Length); + printf("Attempting to patch FADT entry of %s\n",(acpi_tables.FacpPointer64 != (void *)0ul) ? ACPI_SIG_XSDT : ACPI_SIG_RSDT); + } + else if (oem_fadt == true) + { + ACPI_TABLE_FADT * FacpPtr = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + + printf("FADT found @%x ( Length %d ) in %s \n",FacpPtr, FacpPtr->Header.Length, (acpi_tables.FacpPointer64 != (void *)0ul) ? ACPI_SIG_XSDT : ACPI_SIG_RSDT); + } +#endif + + if ((new_dsdt = (ACPI_TABLE_DSDT *)get_new_table_in_list(new_table_list, NAMESEG("DSDT"), &new_table_index)) != (void*)0ul ) + { + new_table_list[new_table_index] = 0ul; // This way, the DSDT file will not be added in our new rsdt/xsdt table list, and it shouldn't be anyway + } + + if (oem_fadt == false) + { + + fadt_mod = patch_fadt(FacpPointer, (oem_dsdt == false) ? new_dsdt : (void*)0ul , (acpi_tables.FacpPointer64 != (void *)0ul )); + + if (fadt_mod != (void*)0ul) + { + DsdtPtr = ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0)) ? (ACPI_TABLE_DSDT*)((U32)fadt_mod->XDsdt):(ACPI_TABLE_DSDT*)fadt_mod->Dsdt; + + U8 empty = get_0ul_index_in_list(new_table_list,true); + if (empty != ACPI_TABLE_LIST_FULL) + { + new_table_list[empty] = (U32)fadt_mod; // add the patched table to the list + } + else + { + printf("Error: not enought reserved space in the new acpi list for the Patched FACP table,\n "); + printf(" please increase the RESERVED_AERA\n"); + } + + } + else + { + printf("Error: Failed to patch the FADT Table, trying fallback to the FADT original pointer\n"); + fadt_mod = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + + DsdtPtr = ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0)) ? (ACPI_TABLE_DSDT*)((U32)fadt_mod->XDsdt):(ACPI_TABLE_DSDT*)fadt_mod->Dsdt; + + U8 empty = get_0ul_index_in_list(new_table_list,true); + if (empty != ACPI_TABLE_LIST_FULL) + { + new_table_list[empty] = (U32)fadt_mod; + } + else + { + printf("Error: not enought reserved space in the new acpi list for the FACP table,\n "); + printf(" please increase the RESERVED_AERA\n"); + } + } + + if (oem_dsdt == false) + { + if (generate_cpu_map_from_acpi(DsdtPtr) == 0) + { + U8 new_uid = (U8)getPciRootUID(); + + /* WARNING: THIS METHOD WORK PERFECTLY BUT IT CAN RESULT TO AN INCORRECT CHECKSUM */ + + if (ProcessDsdt(DsdtPtr, UIDPointer, new_uid)) + { + printf("PCI0 _UID patched to %d in the DSDT table\n", new_uid); + } + + } + } + + + } + else + { + + // here we use the variable fadt_mod only for SSDT Generation + + fadt_mod = (acpi_tables.FacpPointer64 != (void *)0ul) ? + (ACPI_TABLE_FADT *)acpi_tables.FacpPointer64 : (ACPI_TABLE_FADT *)acpi_tables.FacpPointer; + + DsdtPtr = ((fadt_mod->Header.Revision >= 3) && (fadt_mod->XDsdt != 0)) ? (ACPI_TABLE_DSDT*)((U32)fadt_mod->XDsdt) + :(ACPI_TABLE_DSDT*)fadt_mod->Dsdt; + } + + { + MADT_INFO madt_info; + bool strip_madt = true; + + getBoolForKey(kSTRIPAPIC, &strip_madt, &bootInfo->chameleonConfig); + + if ((strip_madt == false) || (!buildMADT(new_table_list, DsdtPtr, &madt_info ))) + { + + ACPI_TABLE_MADT * madt_file = (void*)0ul; + ACPI_TABLE_MADT * MadtPointer = (void*)0ul; + bool oem_apic=false; + + { + bool tmpval; + oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval; + } + + if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul) + { + if (oem_apic == false) + { + MadtPointer = (ACPI_TABLE_MADT *)madt_file; + } + + } else + MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer; + + ProcessMadtInfo(MadtPointer, &madt_info); + + } + + if (gen_ssdt || gen_csta || gen_psta || gen_tsta) + { + ProcessSsdt(new_table_list, DsdtPtr, &madt_info, gen_csta, gen_psta, gen_tsta ); + } + } + + if (rsdp_mod == (void *)0ul) + { + printf("Error: rsdp_mod == null \n"); + return EFI_ABORTED; + } + + if (!(rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE)) + { + printf("Error: rsdp_mod size is incorrect \n"); + return EFI_ABORTED; + + } + + do { + + if ((rsdp_mod->Revision == 0) || (gen_xsdt == true)) + { + if (process_rsdt(rsdp_mod, gen_xsdt, new_table_list)) + break; + printf("Error : ACPI RSD PTR Revision 1 is incorrect, \n"); + } + + if ((GetChecksum(rsdp_mod, sizeof(ACPI_TABLE_RSDP)) == 0) && + (Revision == 2) && + (rsdplength == sizeof(ACPI_TABLE_RSDP))) + { + if (process_xsdt(rsdp_mod, new_table_list)) + break; + printf("Error : ACPI RSD PTR Revision 2 is incorrect \n"); + } + + Revision = 0; // fallback to Revision 0 + + if (process_rsdt(rsdp_mod, false, new_table_list)) + break; + + printf("Error: Incorect ACPI RSD PTR or not found \n"); + return EFI_ABORTED; + + } while (0); + + + // Correct the checksum of RSDP + + DBG("RSDP: Original checksum %d\n", rsdp_mod->Checksum); + + setRsdpchecksum(rsdp_mod); + + DBG("New checksum %d\n", rsdp_mod->Checksum); + + if (Revision == 2) + { + DBG("RSDP: Original extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + setRsdpXchecksum(rsdp_mod); + + DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum); + + } + + verbose("ACPI Revision %d successfully patched\n", Revision); + + if (Revision == 2) + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + rsd_p = (U32)rsdp_mod; + addConfigurationTable(&gEfiAcpi20TableGuid, &rsd_p, "ACPI_20"); + } + else + { + /* XXX aserebln why uint32 cast if pointer is uint64 ? */ + rsd_p = (U32)rsdp_mod; + addConfigurationTable(&gEfiAcpiTableGuid, &rsd_p, "ACPI"); + } + + +#if DEBUG_ACPI==2 + printf("Press a key to continue... (DEBUG_ACPI)\n"); + getc(); +#endif + return Status; +} + +int AcpiSetup(void) +{ + EFI_STATUS status = setup_Acpi(); + + return (status == EFI_SUCCESS); +} diff --git a/i386/modules/AcpiCodec/acpi_tools.c b/i386/modules/AcpiCodec/acpi_tools.c new file mode 100755 index 0000000..b999daf --- /dev/null +++ b/i386/modules/AcpiCodec/acpi_tools.c @@ -0,0 +1,328 @@ +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "libsaio.h" +#include "bootstruct.h" +#include "datatype.h" +#include "intel_acpi.h" +#include "ppm.h" +#include "acpi.h" + +static U32 GetRsdtPointer(void *mem_addr, U32 mem_size, ACPI_TABLES * acpi_tables); +static U32 GetXsdtPointer(ACPI_TABLES * acpi_tables); +static ACPI_TABLE_HEADER *GetTablePtr(ACPI_TABLE_RSDT * rsdt, U32 signature); +static ACPI_TABLE_HEADER *GetTablePtr64(ACPI_TABLE_XSDT * xsdt, U32 signature); + +//------------------------------------------------------------------------------- +// +// Procedure: FindAcpiTables - Collects addresses for RSDP, RSDT, FADT, & DSDT. +// +// Description: Finds the differentiated system description table pointer +// by scanning and checking ACPI tables. This function will +// get and store the following ACPI Table Pointers: +// 1) RSD Pointer in RsdPointer Variable +// 2) RSDT Pointer in RsdtPointer Variable (RSDP->RSDT) +// 3) XSDT Pointer in XsdtPointer Variable (RSDP->XSDT) +// 4) FACP Pointer in FacpPointer Variable (RSDP->RSDT->FACP) +// 5) FACP(64) Pointer in FacpPointer64 Variable (RSDP->XSDT->FACP) +// 6) DSDT Pointer in DsdtPointer Variable (RSDP->RSDT->FACP->DSDT) +// 7) DSDT(64) Pointer in DsdtPointer64 Variable (RSDP->XSDT->FACP->XDSDT) +// 8) FACS Pointer in FacsPointer Variable (RSDP->RSDT->FACP->FACS) +// 9) FACS(64) Pointer in FacsPointer64 Variable (RSDP->XSDT->FACP->XFACS) +// A) MADT Pointer in FacsPointer Variable (RSDP->RSDT->APIC) +// B) MADT(64) Pointer in MadtPointer64 Variable (RSDP->XSDT->APIC) +// +//------------------------------------------------------------------------------- +U32 FindAcpiTables(ACPI_TABLES * acpi_tables) +{ + U32 success = 0ul; + + // Perform init of ACPI table pointers + { + void *null = 0ul; + acpi_tables->DsdtPointer = null; + acpi_tables->DsdtPointer64 = null; + acpi_tables->FacpPointer = null; + acpi_tables->FacsPointer = null; + acpi_tables->FacsPointer64 = null; + acpi_tables->RsdPointer = null; + acpi_tables->RsdtPointer = null; + acpi_tables->MadtPointer = null; + acpi_tables->MadtPointer64 = null; + acpi_tables->XsdtPointer = null; + acpi_tables->FacpPointer64 = null; + } + + // Find the RSDT pointer by scanning EBDA/E000/F000 segments. + + // Init memory address as EBDA and scan 1KB region + success = GetRsdtPointer((void *)(((U32) * (U16 *) 0x40E) << 4), 0x400, acpi_tables); + + // Init memory address as E000 segment and scan 64KB region + if (!success) + success = GetRsdtPointer((void *)0x0E0000, 0x10000, acpi_tables); + + // Init memory address as F000 segment and scan 64KB region + if (!success) + success = GetRsdtPointer((void *)0x0F0000, 0x10000, acpi_tables); + + if (!success || (acpi_tables->RsdtPointer == 0ul)) + return (0ul); + + success = GetXsdtPointer(acpi_tables); + + // Find FACP table pointer which is one of table pointers in the RDST + acpi_tables->FacpPointer = (ACPI_TABLE_FADT *) + GetTablePtr(acpi_tables->RsdtPointer, NAMESEG("FACP")); + if (acpi_tables->FacpPointer == 0ul) + return (0ul); + + // Find the DSDT which is included in the FACP table + acpi_tables->DsdtPointer = (ACPI_TABLE_DSDT *) acpi_tables->FacpPointer->Dsdt; + if ((acpi_tables->DsdtPointer == 0ul) || (*(U32 *) (acpi_tables->DsdtPointer->Header.Signature) != NAMESEG("DSDT")) || + (GetChecksum(acpi_tables->DsdtPointer, acpi_tables->DsdtPointer->Header.Length) != 0)) + return (0ul); + + // Find the FACS which is included in the FACP table + acpi_tables->FacsPointer = (ACPI_TABLE_FACS *) acpi_tables->FacpPointer->Facs; + if ((acpi_tables->FacsPointer == 0ul) || (*(U32 *) (acpi_tables->FacsPointer->Signature) != NAMESEG("FACS"))) + return (0ul); + + // Find the MADT table which is one of the table pointers in the RSDT + acpi_tables->MadtPointer = (ACPI_TABLE_MADT *) GetTablePtr(acpi_tables->RsdtPointer, NAMESEG("APIC")); + if (acpi_tables->MadtPointer == 0ul) + return (0ul); + + do { + + if (!success || (acpi_tables->XsdtPointer == 0ul)) + break; + + // Find FACP(64) table pointer which is one of table pointers in the XDST + acpi_tables->FacpPointer64 = (ACPI_TABLE_FADT *) + GetTablePtr64(acpi_tables->XsdtPointer, NAMESEG("FACP")); + + if (acpi_tables->FacpPointer64 == 0ul) + break; + + // Find the XDSDT which is included in the FACP(64) table + ACPI_TABLE_DSDT *DsdtPointer64 = (ACPI_TABLE_DSDT *)((U32)acpi_tables->FacpPointer64->XDsdt); + + if (DsdtPointer64 == 0ul) + break; + + if ((*(U32*) (DsdtPointer64->Header.Signature) == NAMESEG("DSDT")) && + (GetChecksum(DsdtPointer64, DsdtPointer64->Header.Length) == 0)) + acpi_tables->DsdtPointer64 = (ACPI_TABLE_DSDT *) DsdtPointer64; + + // Find the XFACS which is included in the FACP(64) table + ACPI_TABLE_FACS *FacsPointer64 = (ACPI_TABLE_FACS *)((U32)acpi_tables->FacpPointer64->XFacs); + + if (FacsPointer64 == 0ul) + break; + + if (*(U32*) (FacsPointer64->Signature) == NAMESEG("FACS")) + acpi_tables->FacsPointer64 = (ACPI_TABLE_FACS *) FacsPointer64; + + + // Find the MADT(64) table which is one of the table pointers in the XSDT + acpi_tables->MadtPointer64 = (ACPI_TABLE_MADT *) GetTablePtr64(acpi_tables->XsdtPointer, NAMESEG("APIC")); + + } while (0); + + + return (1ul); +} + +//----------------------------------------------------------------------------- +U32 get_num_tables(ACPI_TABLE_RSDT * rsdt) +{ + // Compute number of table pointers included in RSDT + return ((rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) + / sizeof(ACPI_TABLE_HEADER *)); +} + +//----------------------------------------------------------------------------- +U32 get_num_tables64(ACPI_TABLE_XSDT * xsdt) +{ + { + void *null = 0ul; + if (xsdt == null) + return 0ul; + } + + // Compute number of table pointers included in XSDT + return ((xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) + / sizeof(U64)); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetTablePtr - Find ACPI table in RSDT with input signature. +// +//------------------------------------------------------------------------------- +static ACPI_TABLE_HEADER *GetTablePtr(ACPI_TABLE_RSDT * rsdt, U32 signature) +{ + U32 index; + U32 num_tables; + ACPI_TABLE_HEADER **table_array = (ACPI_TABLE_HEADER **) rsdt->TableOffsetEntry; + + // Compute number of table pointers included in RSDT + num_tables = get_num_tables(rsdt); + + for (index = 0; index < num_tables; index++) { + if ((*(U32 *) (table_array[index]->Signature) == signature) && + (GetChecksum(table_array[index], table_array[index]->Length) == 0)) { + return (table_array[index]); + } + } + return (0); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetTablePtr64 - Find ACPI table in XSDT with input signature. +// +//------------------------------------------------------------------------------- +static ACPI_TABLE_HEADER *GetTablePtr64(ACPI_TABLE_XSDT * xsdt, U32 signature) +{ + U32 index; + U32 num_tables; + + int method; + + // Compute number of table pointers included in XSDT + num_tables = get_num_tables64(xsdt); + + getIntForKey(kAcpiMethod, &method, &bootInfo->chameleonConfig); + switch (method) { + case 0x2: + { + for (index = 0; index < num_tables; index++) { + U64 ptr = xsdt->TableOffsetEntry[index]; + + if ((*(U32 *) ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Signature == signature) && + (GetChecksum(((ACPI_TABLE_HEADER *) (unsigned long)ptr), ((ACPI_TABLE_HEADER *) (unsigned long)ptr)->Length) == 0)) { + return (((ACPI_TABLE_HEADER *) (unsigned long)ptr)); + } + } + break; + } + case 0x1: + default: + { + ACPI_TABLE_HEADER *table = (ACPI_TABLE_HEADER *) xsdt->TableOffsetEntry; + + for (index = 0; index < num_tables; index++) { + if (((U32) (table->Signature) == signature) && + (GetChecksum(table, table->Length) == 0)) { + return (table); + } + // Move array pointer to next 64-bit pointer + table = (ACPI_TABLE_HEADER *) ((U32) table + sizeof(U64)); + } + break; + } + } + + return (0); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetChecksum - Performs byte checksum +// +//------------------------------------------------------------------------------- +U8 GetChecksum(void *mem_addr, U32 mem_size) +{ + U8 *current = mem_addr; + U8 *end = current + mem_size; + U8 checksum = 0; + + for (; current < end; current++) + checksum = checksum + *current; + + return (checksum); +} + +/*========================================================================== + * Function to map 32 bit physical address to 64 bit virtual address + */ + + +//------------------------------------------------------------------------------- +// +// Procedure: GetRsdtPointer - Scans given segment for RSDT pointer +// +// Description: Scans for root system description table pointer signature +// ('RSD PTR ') , verifies checksum, and returns pointer to +// RSDT table if found. +// +//------------------------------------------------------------------------------- +static U32 GetRsdtPointer(void *mem_addr, U32 mem_size, ACPI_TABLES * acpi_tables) +{ + U8 *current = mem_addr; + U8 *end = current + mem_size; + + // Quick sanity check for a valid start address + if (current == 0ul) + return (0ul); + + for (; current < end; current += 16) { + if (*(volatile U64 *)current == NAMESEG64("RSD PTR ")) { + if (GetChecksum(current, ACPI_RSDP_REV0_SIZE) == 0) { + // RSD pointer structure checksum okay, lookup the RSDT pointer. + acpi_tables->RsdPointer = (ACPI_TABLE_RSDP *)current; + acpi_tables->RsdtPointer = (ACPI_TABLE_RSDT *) acpi_tables->RsdPointer->RsdtPhysicalAddress; + if ((acpi_tables->RsdPointer != (void*)0ul) && (acpi_tables->RsdtPointer != (void*)0ul)) + return (1ul); + else + return (0ul); + } + } + } + + return (0); +} + +//------------------------------------------------------------------------------- +// +// Procedure: GetXsdtPointer +// +//------------------------------------------------------------------------------- +static U32 GetXsdtPointer(ACPI_TABLES * acpi_tables) +{ + if ((GetChecksum(acpi_tables->RsdPointer, sizeof(ACPI_TABLE_RSDP)) == 0) && + (acpi_tables->RsdPointer->Revision == 2) && + (acpi_tables->RsdPointer->Length == sizeof(ACPI_TABLE_RSDP))) { + // RSD pointer structure checksum okay, lookup the XSDT pointer. + acpi_tables->XsdtPointer = (ACPI_TABLE_XSDT *) (U32) acpi_tables->RsdPointer->XsdtPhysicalAddress; + return (1ul); + } + + return (0ul); +} diff --git a/i386/modules/AcpiCodec/acpicode.c b/i386/modules/AcpiCodec/acpicode.c new file mode 100644 index 0000000..26267a5 --- /dev/null +++ b/i386/modules/AcpiCodec/acpicode.c @@ -0,0 +1,638 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "datatype.h" +#include "acpi.h" +#include "ppm.h" +#include "acpicode.h" + +static void setPackage(ACPI_PACKAGE * package, U8 numElements); +static void setNamePath(ACPI_NAME_PATH * namePath, U32 name); + +void SetChecksum(struct acpi_table_header *header) +{ + header->Checksum = 0; + header->Checksum = 0 - GetChecksum(header, header->Length); +} + +void setRsdpchecksum(ACPI_TABLE_RSDP *rsdp) +{ + rsdp->Checksum = 0; + rsdp->Checksum = 0 - GetChecksum(rsdp, ACPI_RSDP_REV0_SIZE); +} + +void setRsdpXchecksum(ACPI_TABLE_RSDP *rsdp) +{ + rsdp->ExtendedChecksum = 0; + rsdp->ExtendedChecksum = 0 - GetChecksum(rsdp, rsdp->Length); +} + +U32 update_rsdp_with_xsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_XSDT *xsdt) +{ + // 1. Update the XSDT pointer in the RSDP + // 2. Update the Xchecksum of the RSDP + + { + // 1. Update the XSDT pointer in the RSDP + rsdp->XsdtPhysicalAddress = ((U64)((U32)xsdt)); + } + + { + // 2. Update the Xchecksum of the RSDP + setRsdpXchecksum(rsdp); + } + + return (1); +} + +U32 update_rsdp_with_rsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_RSDT *rsdt) +{ + // 1. Update the RSDT pointer in the RSDP + // 2. Update the checksum of the RSDP + + { + // 1. Update the RSDT pointer in the RSDP + rsdp->RsdtPhysicalAddress = (U32)rsdt; + } + + { + // 2. Update the checksum of the RSDP + setRsdpchecksum(rsdp); + } + + return (1); +} + + +//----------------------------------------------------------------------------- +U32 ProcessMadtInfo(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info) +{ + void *current; + void *end; + + // Quick sanity check for a valid MADT + if (madt == 0ul) + return (0ul); + + madt_info->lapic_count = 0; + + // Search MADT for Sub-tables with needed data + current = madt + 1; + end = (U8 *) madt + madt->Header.Length; + + while (current < end) + { + ACPI_SUBTABLE_HEADER *subtable = current; + + switch (subtable->Type) + { + + case ACPI_MADT_TYPE_LOCAL_APIC: + { + // Process sub-tables with Type as 0: Processor Local APIC + ACPI_MADT_LOCAL_APIC *lapic = current; + current = lapic + 1; + + if (!(lapic->LapicFlags & ACPI_MADT_ENABLED)) + continue; + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->processorId = lapic->ProcessorId; + lapic_info->apicId = lapic->Id; + lapic_info->madt_type = ACPI_MADT_TYPE_LOCAL_APIC; + } + + madt_info->lapic_count++; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + case ACPI_MADT_TYPE_X2APIC: + { + // Process sub-tables with Type as 9: Processor X2APIC + ACPI_MADT_X2APIC *x2apic = current; + current = x2apic + 1; + + if (!(x2apic->x2apicFlags & ACPI_MADT_ENABLED)) + continue; + + { + LAPIC_INFO *lapic_info = &madt_info->lapic[madt_info->lapic_count]; + + lapic_info->uid = x2apic->UID; + lapic_info->apicId = x2apic->x2apicId; + lapic_info->madt_type = ACPI_MADT_TYPE_X2APIC; + } + + madt_info->lapic_count++; + + // Sanity check to verify compile time limit for max logical CPU is not exceeded + if (madt_info->lapic_count > MAX_LOGICAL_CPU) + return (0); + + break; + } + + default: + { + // Process all other sub-tables + current = (U8 *) subtable + subtable->Length; + break; + } + } // switch + + } // while + + return (1); +} + +//------------------------------------------------------------------------------- +U32 ProcessDsdt(ACPI_TABLE_DSDT * DsdtPointer, U8 * PCIUIDPointer, U8 uid) +{ + // 1. Sanity check + // 2. Replace UID value with the new value + // 3. Update the checksum of the DSDT + + { + // 1. Sanity check + if ((memcmp(&uid, PCIUIDPointer, sizeof(U8)) == 0) || (PCIUIDPointer == (U8*)0) || (DsdtPointer == (void*)0ul)) + return (0); + } + + { + // 2. Replace UID value with the new value + buildOpCode((void*)PCIUIDPointer, uid); + } + + { + // 3. Update the checksum of the DSDT + SetChecksum(&DsdtPointer->Header); + } + + return (1); +} + +//------------------------------------------------------------------------------- +void MoveRsdtInsertSsdt(ACPI_TABLE_RSDP * RsdPointer, ACPI_TABLE_RSDT * OldRsdtPointer, ACPI_TABLE_RSDT * NewRsdtPointer, ACPI_TABLE_SSDT * SsdtPointer) +{ + // 1. Move the RSDT in memory to the new location + // 2. Add new pointer for the SSDT into the RSDT + // 3. Update the size of the RSDT + // 4. Update the checksum of the RSDT + // 5. Update the RSDT pointer in the RSDP + // 6. Update the checksum of the RSDP + + { + // 1. Move the RSDT in memory to the new location + memcpy(NewRsdtPointer, OldRsdtPointer, OldRsdtPointer->Header.Length); + } + + { + // 2. Add new pointer for the SSDT into the RSDT + // 3. Update the size of the RSDT + // 4. Update the checksum of the RSDT + InsertSsdt(NewRsdtPointer, SsdtPointer); + } + + { + // 5. Update the RSDT pointer in the RSDP + RsdPointer->RsdtPhysicalAddress = (U32) NewRsdtPointer; + } + + { + // 6. Update the checksum of the RSDP + setRsdpchecksum(RsdPointer); + } +} + +//------------------------------------------------------------------------------- +void InsertSsdt(ACPI_TABLE_RSDT * RsdtPointer, ACPI_TABLE_SSDT * SsdtPointer) +{ + // 1. Add new pointer for the SSDT into the RSDT + // 2. Update the size of the RSDT + // 3. Update the checksum of the RSDT + + { + // 1. Add new pointer for the SSDT into the RSDT + U32 index = get_num_tables(RsdtPointer); + RsdtPointer->TableOffsetEntry[index] = (U32) SsdtPointer; + } + + { + // 2. Update the size of the RSDT + RsdtPointer->Header.Length = RsdtPointer->Header.Length + sizeof(ACPI_TABLE_SSDT *); + } + + { + // 3. Update the checksum of the RSDT + SetChecksum(&RsdtPointer->Header); + } +} + +//------------------------------------------------------------------------------- +void InsertSsdt64(ACPI_TABLE_XSDT * XsdtPointer, ACPI_TABLE_SSDT * SsdtPointer) +{ + { + void *null = 0ul; + if (XsdtPointer == null) + return; + } + + // 1. Add new pointer for the SSDT into the XSDT + // 2. Update the size of the XSDT + // 3. Update the checksum of the XSDT + + { + // 1. Add new pointer for the SSDT into the XSDT + U32 index = get_num_tables64(XsdtPointer); + XsdtPointer->TableOffsetEntry[index] = (U64) ((U32) SsdtPointer); + } + + { + // 2. Update the size of the XSDT + XsdtPointer->Header.Length = XsdtPointer->Header.Length + sizeof(U64); + } + + { + // 3. Update the checksum of the XSDT + SetChecksum(&XsdtPointer->Header); + } +} + +//----------------------------------------------------------------------------- +void *buildNameSeg(void *current, U32 name) +{ + U32 *nameSeg = current; + current = nameSeg + 1; + + *nameSeg = name; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildOpCode(void *current, U8 opCode) +{ + U8 *op = current; + current = op + 1; + + *op = opCode; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildReturnPackage(void *current, U8 numElements) +{ + ACPI_RETURN_PACKAGE *returnPackage = current; + current = returnPackage + 1; + + returnPackage->returnOpcode = AML_RETURN_OP; + setPackage(&returnPackage->package, numElements); + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildReturnZero(void *current) +{ + ACPI_RETURN_ZERO *returnZero = current; + current = returnZero + 1; + + returnZero->returnOpcode = AML_RETURN_OP; + returnZero->zeroOpcode = AML_ZERO_OP; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildReturnOpcode(void *current, U8 opcodeToReturn) +{ + ACPI_RETURN_OPCODE *returnOpcode = current; + current = returnOpcode + 1; + + returnOpcode->returnOpcode = AML_RETURN_OP; + returnOpcode->opcodeToReturn = opcodeToReturn; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildMethod(void *current, U32 name, U8 methodFlags) +{ + ACPI_METHOD *method = current; + current = method + 1; + + method->methodOpcode = AML_METHOD_OP; + method->name = name; + method->methodFlags = methodFlags; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildSmallMethod(void *current, U32 name, U8 methodFlags) +{ + ACPI_SMALL_METHOD *method = current; + current = method + 1; + + method->methodOpcode = AML_METHOD_OP; + method->name = name; + method->methodFlags = methodFlags; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildNamedDword(void *current, U32 name, U32 dword) +{ + ACPI_NAMED_DWORD *namedDword = current; + current = namedDword + 1; + + setNamePath(&namedDword->namePath, name); + setDwordConst(&namedDword->dword, dword); + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildGenericRegister(void *current, const ACPI_GENERIC_ADDRESS * gas) +{ + ACPI_GENERIC_REGISTER *genReg = current; + current = genReg + 1; + + genReg->genericRegisterField = AML_GEN_REG_FIELD; + genReg->pkgLength.packageLength0 = 0x0c; + genReg->pkgLength.packageLength1 = 0; + + genReg->gas.SpaceId = gas->SpaceId; + genReg->gas.BitWidth = gas->BitWidth; + genReg->gas.BitOffset = gas->BitOffset; + genReg->gas.AccessWidth = gas->AccessWidth; + genReg->gas.Address = gas->Address; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildSmallBuffer(void *current) +{ + ACPI_SMALL_BUFFER *buffer = current; + current = buffer + 1; + + buffer->bufferOpcode = AML_BUFFER_OP; + + return (current); +} + +//----------------------------------------------------------------------------- +void *buildEndTag(void *current) +{ + ACPI_END_TAG *endTag = current; + current = endTag + 1; + + endTag->endTagField = AML_END_TAG_OP; + endTag->checksum = 0; + + return (current); +} + +//----------------------------------------------------------------------------- +void setSmallPackage(ACPI_SMALL_PACKAGE * package, U8 numElements) +{ + package->packageOpcode = AML_PACKAGE_OP; + package->numElements = numElements; +} + +//----------------------------------------------------------------------------- +void *buildSmallPackage(void *current, U8 numElements) +{ + ACPI_SMALL_PACKAGE *package = current; + current = package + 1; + setSmallPackage(package, numElements); + return (current); +} + +//----------------------------------------------------------------------------- +static void setPackage(ACPI_PACKAGE * package, U8 numElements) +{ + package->packageOpcode = AML_PACKAGE_OP; + package->numElements = numElements; +} + +//----------------------------------------------------------------------------- +void setPackageLength(ACPI_PACKAGE_LENGTH * packageLength, U32 length) +{ + packageLength->packageLength0 = 0x40 + (U8) (length & 0xf); + packageLength->packageLength1 = (U8) (length >> 4); +} + +//----------------------------------------------------------------------------- +void *buildPackageLength(void *current, U32 length) +{ + ACPI_PACKAGE_LENGTH *packageLength = current; + current = packageLength + 1; + setPackageLength(packageLength, length); + return (current); +} + +//----------------------------------------------------------------------------- +static void setNamePath(ACPI_NAME_PATH * namePath, U32 name) +{ + namePath->nameOpcode = AML_NAME_OP; + namePath->name = name; +} + +//----------------------------------------------------------------------------- +void *buildNamePath(void *current, U32 name) +{ + ACPI_NAME_PATH *namePath = current; + current = namePath + 1; + setNamePath(namePath, name); + return (current); +} + +//----------------------------------------------------------------------------- +static void setTableHeader(ACPI_TABLE_HEADER * tableHeader, U32 signature, U64 oemTableId) +{ + *(U32 *) &tableHeader->Signature = signature; + tableHeader->Length = 0; + tableHeader->Revision = 1; + tableHeader->Checksum = 0; + memcpy(&tableHeader->OemId[0], "INTEL ", 6); + *(U64 *) (tableHeader->OemTableId) = oemTableId; + tableHeader->OemRevision = 0x80000001; + *(U32 *) tableHeader->AslCompilerId = NAMESEG("INTL"); // ASCII ASL compiler vendor ID + tableHeader->AslCompilerRevision = 0x20061109; // ASL compiler version +} + +//----------------------------------------------------------------------------- +void *buildTableHeader(void *current, U32 signature, U64 oemTableId) +{ + ACPI_TABLE_HEADER *tableHeader = current; + current = tableHeader + 1; + setTableHeader(tableHeader, signature, oemTableId); + return (current); +} + +//----------------------------------------------------------------------------- +void setByteConst(ACPI_BYTE_CONST * byteConst, U8 byteData) +{ + byteConst->byteOpcode = AML_BYTE_OP; + byteConst->byteData = byteData; +} + +//----------------------------------------------------------------------------- +void *buildByteConst(void *current, U8 byteData) +{ + ACPI_BYTE_CONST *byteConst = current; + current = byteConst + 1; + setByteConst(byteConst, byteData); + return (current); +} + +//----------------------------------------------------------------------------- +void setWordConst(ACPI_WORD_CONST * wordConst, U16 wordData) +{ + wordConst->wordOpcode = AML_WORD_OP; + wordConst->wordData = wordData; +} + +//----------------------------------------------------------------------------- +void *buildWordConst(void *current, U16 wordData) +{ + ACPI_WORD_CONST *wordConst = current; + current = wordConst + 1; + setWordConst(wordConst, wordData); + return (current); +} + +//----------------------------------------------------------------------------- +void setDwordConst(ACPI_DWORD_CONST * dwordConst, U32 dwordData) +{ + dwordConst->dwordOpcode = AML_DWORD_OP; + dwordConst->dwordData = dwordData; +} + +//----------------------------------------------------------------------------- +void *buildDwordConst(void *current, U32 dwordData) +{ + ACPI_DWORD_CONST *dwordConst = current; + current = dwordConst + 1; + setDwordConst(dwordConst, dwordData); + return (current); +} + +//------------------------------------------------------------------------------- +U32 ProcessFadt(ACPI_TABLE_FADT * FadtPointer, U32 pmbase) +{ + { + // Update fields in FADT + + // Update ACPI 1.0 fields first + + FadtPointer->Pm1aEventBlock = pmbase; + FadtPointer->Pm1aControlBlock = pmbase + 4; + FadtPointer->Pm2ControlBlock = pmbase + 0x50; + FadtPointer->PmTimerBlock = pmbase + 8; + FadtPointer->Pm1EventLength = 4; + FadtPointer->Pm1ControlLength = 2; + FadtPointer->Pm2ControlLength = 1; + FadtPointer->PmTimerLength = 4; + + // No legacy C2 + FadtPointer->C2Latency = 101; + + // No legacy C3 + FadtPointer->C3Latency = 1001; + + // C1 power state is supported on all processors + FadtPointer->BootFlags |= 1UL << 2; + + // No legacy C2 on MP systems + FadtPointer->BootFlags &= ~(1UL << 3); + + // Update ACPI 2.0+ fields if supported + if (FadtPointer->Header.Revision >= 3) { + // Address space where struct or register exists - System IO + FadtPointer->XPm1aEventBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPm1aEventBlock.BitWidth = 0x20; + // Bit offset within the register + FadtPointer->XPm1aEventBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPm1aEventBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPm1aEventBlock.Address = pmbase; + + // Address space where struct or register exists - System IO + FadtPointer->XPm1aControlBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPm1aControlBlock.BitWidth = 0x10; + // Bit offset within the register + FadtPointer->XPm1aControlBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPm1aControlBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPm1aControlBlock.Address = pmbase + 4; + + // Address space where struct or register exists - System IO + FadtPointer->XPm2ControlBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPm2ControlBlock.BitWidth = 0x08; + // Bit offset within the register + FadtPointer->XPm2ControlBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPm2ControlBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPm2ControlBlock.Address = pmbase + 0x50; + + // Address space where struct or register exists - System IO + FadtPointer->XPmTimerBlock.SpaceId = 1; + // Size in bits of given register + FadtPointer->XPmTimerBlock.BitWidth = 0x20; + // Bit offset within the register + FadtPointer->XPmTimerBlock.BitOffset = 0; + // Minimum Access size (ACPI 3.0) + FadtPointer->XPmTimerBlock.AccessWidth = 0; + // 64-bit address of struct or register + FadtPointer->XPmTimerBlock.Address = pmbase + 8; + } + } + + // Update checksum in FADT + SetChecksum(&FadtPointer->Header); + + return (1); +} diff --git a/i386/modules/AcpiCodec/acpidecode.c b/i386/modules/AcpiCodec/acpidecode.c new file mode 100755 index 0000000..0f6a9d4 --- /dev/null +++ b/i386/modules/AcpiCodec/acpidecode.c @@ -0,0 +1,918 @@ +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "acpi.h" +#include "acpidecode.h" + +#define DEBUG_ACPI_DECODE 0 + +#if DEBUG_ACPI_DECODE==1 +#include "libsaio.h" +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +static U8 *parse_acpi_dataobject(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_package(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_termarg(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_termarglist(const struct acpi_namespace *ns, U8 * current, U8 * end); +static U8 *parse_acpi_objectlist(const struct acpi_namespace *ns, U8 * current, U8 * end); +U8* UIDPointer = (U8*)0; + +void *decodeTableHeader(void *current, ACPI_TABLE_HEADER ** tableHeader) +{ + *tableHeader = current; + current = *tableHeader + 1; + return current; +} +void dprint_nameseg(U32 i) +{ + DBG("%c%c%c%c", + (int)(i & 0x000000ff), + (int)((i & 0x0000ff00) >> 8), + (int)((i & 0x00ff0000) >> 16), + (int)(i >> 24)); +} + +#if DEBUG_ACPI_DECODE +static void dprint_namespace(const struct acpi_namespace *ns) +{ + U32 i; + DBG( "\\"); + for (i = 0; i < ns->depth; i++) { + if (i != 0) + DBG( "."); + dprint_nameseg(ns->nameseg[i]); + } +} +#endif + +static void parsePackageLength(U8 * current, U32 * length, U32 * lengthEncoding) +{ + U32 i; + U8 len0 = *current; + U8 numBytes = len0 >> 6; + U32 total = 0; + + for (i = numBytes; i > 0; i--) { + total <<= 8; + total |= current[i]; + } + + total <<= 4; + total |= len0 & 0x3f; + *length = total; + *lengthEncoding = numBytes + 1; + DBG("Package length=0x%02x\n", *length); +} + +#if UNUSED +static bool ns_match(struct acpi_namespace *ns1, struct acpi_namespace *ns2) +{ + U32 i; + if (ns1->depth != ns2->depth) + return false; + + for (i = 0; i < ns1->depth; i++) + if (ns1->nameseg[i] != ns2->nameseg[i]) + return false; + + return true; +} + +U32 acpi_ns_found; +#endif + +static U8 *parse_acpi_namestring(const struct acpi_namespace *ns_context, struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + struct acpi_namespace dummy_ns; + + (void)end; + + if (!ns) + ns = &dummy_ns; + *ns = *ns_context; + + if (*current == AML_ROOT_PREFIX) { + ns->depth = 0; + current++; + } else + while (*current == AML_PARENT_PREFIX) { + if (ns->depth == 0) { + DBG( "Attempt to use parent prefix with no namespace left\n"); + return temp; + } + current++; + ns->depth--; + } + + switch (*current) { + case AML_DUAL_NAME_PREFIX: + if (ns->depth + 2 > ACPI_NAMESPACE_MAX_DEPTH) { + DBG( "Namespace got too deep\n"); + return temp; + } + current++; + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + break; + case AML_MULTI_NAME_PREFIX: + { + U8 nameseg_count; + current++; + nameseg_count = *current++; + if (ns->depth + nameseg_count > ACPI_NAMESPACE_MAX_DEPTH) { + DBG( "Namespace got too deep\n"); + return temp; + } + while (nameseg_count--) { + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + } + break; + } + case AML_NULL_NAME: + current++; + break; + default: + if (*current != '_' && (*current < 'A' || *current > 'Z')) { + DBG( "Invalid nameseg lead character: 0x%02x\n", *current); + return temp; + } + if (ns->depth + 1 > ACPI_NAMESPACE_MAX_DEPTH) { + DBG( "Namespace got too deep\n"); + return temp; + } + ns->nameseg[ns->depth++] = *(U32 *) current; + current += 4; + break; + } +#if DEBUG_ACPI_DECODE + DBG( "Found NameString: "); + dprint_namespace(ns); + DBG("\n"); +#endif + if (ns->nameseg[1] == NAMESEG("PCI0") && ns->nameseg[2] == NAMESEG("_UID")) { + UIDPointer = current; + } + +#if UNUSED + if (!acpi_ns_found) { + U32 index; + + for (index = 0; index < acpi_processor_count; index++) + if (ns_match(ns, &acpi_processors[index].ns)) { + acpi_ns_found = 1; + break; + } + } +#endif + return current; +} + +static U8 *parse_acpi_buffer(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U32 pkglen = 0, lengthEncoding = 0; + (void)ns; + (void)end; + if (*current != AML_BUFFER_OP) + return current; + current++; + parsePackageLength(current, &pkglen, &lengthEncoding); + current += pkglen; + return current; +} + +static U8 *parse_acpi_computationaldata(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_buffer(ns, current, end); + if (current != temp) + return current; + + switch (*current) { + case AML_BYTE_OP: + DBG("Found ByteOp\n"); + current += 1 + 1; + break; + case AML_WORD_OP: + DBG( "Found WordOp\n"); + current += 1 + 2; + break; + case AML_DWORD_OP: + DBG("Found DwordOp\n"); + current += 1 + 4; + break; + case AML_QWORD_OP: + DBG( "Found QwordOp\n"); + current += 1 + 8; + break; + case AML_STRING_OP: + DBG( "Found StringOp: \""); + current++; + while (*current) +#if DEBUG_ACPI_DECODE + if (*current < ' ' || *current > 0x7e) + printf( "\\x%02x", *current++); + else + printf( "%c", *current++); +#else + current++; +#endif + current++; /* Skip the \0 */ + DBG( "\"\n"); + break; + case AML_ZERO_OP: + DBG( "Found ZeroOp\n"); + current += 1; + break; + case AML_ONE_OP: + DBG( "Found OneOp\n"); + current += 1; + break; + case AML_ONES_OP: + DBG( "Found OneOp\n"); + current += 1; + break; + case AML_EXT_OP_PREFIX: + if (*(current + 1) == AML_REVISION_OP) + current += 2; + default: + break; + } + + return current; +} + +static U8 *parse_acpi_argobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + switch (*current) { + case AML_ARG0_OP: + DBG( "Found Arg0Op\n"); + current++; + break; + case AML_ARG1_OP: + DBG( "Found Arg1Op\n"); + current++; + break; + case AML_ARG2_OP: + DBG( "Found Arg2Op\n"); + current++; + break; + case AML_ARG3_OP: + DBG( "Found Arg3Op\n"); + current++; + break; + case AML_ARG4_OP: + DBG( "Found Arg4Op\n"); + current++; + break; + case AML_ARG5_OP: + DBG( "Found Arg5Op\n"); + current++; + break; + case AML_ARG6_OP: + DBG( "Found Arg6Op\n"); + current++; + break; + default: + break; + } + return current; +} + +static U8 *parse_acpi_localobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + switch (*current) { + case AML_LOCAL0_OP: + DBG( "Found Local0Op\n"); + current++; + break; + case AML_LOCAL1_OP: + DBG( "Found Local1Op\n"); + current++; + break; + case AML_LOCAL2_OP: + DBG( "Found Local2Op\n"); + current++; + break; + case AML_LOCAL3_OP: + DBG("Found Local3Op\n"); + current++; + break; + case AML_LOCAL4_OP: + DBG( "Found Local4Op\n"); + current++; + break; + case AML_LOCAL5_OP: + DBG( "Found Local5Op\n"); + current++; + break; + case AML_LOCAL6_OP: + DBG( "Found Local6Op\n"); + current++; + break; + case AML_LOCAL7_OP: + DBG( "Found Local7Op\n"); + current++; + break; + default: + break; + } + return current; +} + +static U8 *parse_acpi_debugobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + if ((*current == AML_EXT_OP_PREFIX) && (*(current + 1) == AML_DEBUG_OP)) { + current += 2; + DBG( "Found DebugOp\n"); + } + + return current; +} + +static U8 *parse_acpi_datarefobject(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + DBG( "Beginning datarefobject: 0x%02x at memory location %p\n", *current, current); + current = parse_acpi_dataobject(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_simplename(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_namestring(ns, NULL, current, end); + if (current != temp) + return current; + + current = parse_acpi_argobj(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_localobj(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_supername(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_simplename(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_debugobj(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_target(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_supername(ns, current, end); + if (current != temp) + return current; + + if (*current == AML_NULL_NAME) + current++; + + return current; +} + +static U8 *parse_acpi_method(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *new_end = current; + U8 *temp; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + + (void)end; + + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + + temp = current; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); + if (current == temp) + return new_end; + +#if DEBUG_ACPI_DECODE + DBG( "Found Method: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + // U8 methodFlags + current++; + + parse_acpi_termlist(&new_ns, current, new_end); + +#if DEBUG_ACPI_DECODE + DBG( "End of Method: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + + return new_end; +} + +U32 acpi_processor_count; +struct acpi_processor acpi_processors[CPU_MAP_LIMIT]; + +static void add_processor(const struct acpi_namespace *ns, U8 id, U32 pmbase) +{ + if (acpi_processor_count == CPU_MAP_LIMIT) { + DBG( "No more room for ACPI processor structures\n"); + return; + } + acpi_processors[acpi_processor_count].ns = *ns; + acpi_processors[acpi_processor_count].id = id; + acpi_processors[acpi_processor_count].pmbase = pmbase; + acpi_processor_count++; +} + +static U8 *parse_acpi_processor(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *new_end = current; + U8 *temp; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + U8 id; + U32 pmbase; + + (void)end; + + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + + temp = current; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); + if (current == temp) + return new_end; + + id = *current++; + pmbase = *(U32 *) current; + current += 4; + (void)current; // Silent a warning reported by the clang static analizer . + +#if DEBUG_ACPI_DECODE + DBG( "Found CPU object: "); + dprint_namespace(&new_ns); + DBG( " id = 0x%x pmbase = 0x%x\n", id, pmbase); +#endif + add_processor(&new_ns, id, pmbase); + + return new_end; +} + +static U8 *parse_acpi_namedobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning namedobj: 0x%02x at memory location %p\n", *current, current); + switch (*current) { + case AML_EXT_OP_PREFIX: + { + if (*(current + 1) == AML_MUTEX_OP) { + struct acpi_namespace new_ns; + + current += 2; + current = parse_acpi_namestring(ns, &new_ns, current, end); +#if DEBUG_ACPI_DECODE + DBG( "Mutex: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + current++; /* SyncFlags */ + } else if (*(current + 1) == AML_OPREGION_OP) { + struct acpi_namespace new_ns; + + current += 2; + DBG( "OpRegion at memory location %p\n", current); + current = parse_acpi_namestring(ns, &new_ns, current, end); +#if DEBUG_ACPI_DECODE + DBG( "OpRegion name: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + current++; + current = parse_acpi_termarg(ns, current, end); + current = parse_acpi_termarg(ns, current, end); +#if DEBUG_ACPI_DECODE + DBG( "End OpRegion: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + } else if (*(current + 1) == AML_FIELD_OP) { + U32 pkglen = 0; + U32 lengthEncoding = 0; + + current += 2; + DBG( "FieldOp at memory location %p\n", current); + parsePackageLength(current, &pkglen, &lengthEncoding); + current += pkglen; + } else if (*(current + 1) == AML_DEVICE_OP) { + U8 *new_end; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + + current += 2; + new_end = current; + DBG( "DeviceOp at memory location %p\n", current); + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); +#if DEBUG_ACPI_DECODE + DBG( "DeviceOp name: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + + parse_acpi_objectlist(&new_ns, current, new_end); + current = new_end; + } else if (*(current + 1) == AML_PROCESSOR_OP) { + current += 2; + current = parse_acpi_processor(ns, current, end); + } else if (*(current + 1) == AML_INDEXFIELD_OP) { + U8 *new_end; + U32 pkglen = 0; + U32 lengthEncoding = 0; + struct acpi_namespace new_ns; + + current += 2; + new_end = current; + DBG( "IndexFieldOp at memory location %p\n", current); + parsePackageLength(current, &pkglen, &lengthEncoding); + current += lengthEncoding; + new_end += pkglen; + current = parse_acpi_namestring(ns, &new_ns, current, new_end); +#if DEBUG_ACPI_DECODE + DBG( "IndexFieldOp name: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + parse_acpi_objectlist(&new_ns, current, new_end); + current = new_end; + } + break; + } + case AML_METHOD_OP: + { + current++; + current = parse_acpi_method(ns, current, end); + break; + } + default: + break; + } + return current; +} + +static U8 *parse_acpi_type1opcode(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning type1opcode: 0x%02x at memory location %p\n", *current, current); + switch (*current) { + case AML_IF_OP: + { + U8 *new_end; + U32 pkgLen = 0; + U32 lengthEncoding = 0; + + DBG( "Found IfOp\n"); + current++; + parsePackageLength(current, &pkgLen, &lengthEncoding); + new_end = current + pkgLen; + current += lengthEncoding; + + current = parse_acpi_termarg(ns, current, new_end); + parse_acpi_termlist(ns, current, new_end); + current = new_end; + break; + } + case AML_ELSE_OP: + { + U8 *new_end; + U32 pkgLen = 0; + U32 lengthEncoding = 0; + + DBG( "Found ElseOp\n"); + current++; + parsePackageLength(current, &pkgLen, &lengthEncoding); + new_end = current + pkgLen; + current += lengthEncoding; + + parse_acpi_termlist(ns, current, new_end); + current = new_end; + break; + } + case AML_RETURN_OP: + { + DBG( "Found ReturnOp\n"); + current++; + current = parse_acpi_termarg(ns, current, end); + break; + } + default: + break; + } + return current; +} + +static U8 *parse_acpi_type2opcode(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + DBG( "Beginning type2opcode: 0x%02x at memory location %p\n", *current, current); + + current = parse_acpi_package(ns, current, end); + if (current != temp) + return current; + + switch (*current) { + case AML_LNOT_OP: + current++; + DBG( "Found logical not operator\n"); + current = parse_acpi_termarg(ns, current, end); + break; + + case AML_LAND_OP: + case AML_LOR_OP: + case AML_LEQUAL_OP: + case AML_LGREATER_OP: + case AML_LLESS_OP: + DBG( "Found logical binary operator: %c\n", "&|!=><"[*current - AML_LAND_OP]); + current++; + current = parse_acpi_termarg(ns, current, end); + current = parse_acpi_termarg(ns, current, end); + break; + + case AML_EXT_OP_PREFIX: + { + if (*(current + 1) == AML_COND_REF_OF_OP) { + DBG( "Found CondRefOf\n"); + current += 2; + current = parse_acpi_supername(ns, current, end); + current = parse_acpi_target(ns, current, end); + } + break; + } + case AML_STORE_OP: + { + DBG( "Found StoreOp\n"); + current++; + current = parse_acpi_termarg(ns, current, end); + current = parse_acpi_supername(ns, current, end); + break; + } + default: + { + current = parse_acpi_namestring(ns, NULL, current, end); + if (current == temp) + break; + current = parse_acpi_termarglist(ns, current, end); + } + } + return current; +} + +static U8 *parse_acpi_package(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + (void)ns; + (void)end; + if (*current == AML_PACKAGE_OP) { + U32 pkglen = 0; + U32 lengthEncoding = 0; + + DBG( "Found PackageOp\n"); + current++; + parsePackageLength(current, &pkglen, &lengthEncoding); + current += pkglen; + } + return current; +} + +static U8 *parse_acpi_dataobject(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + current = parse_acpi_computationaldata(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_package(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_termarg(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + U8 *temp = current; + + DBG( "Beginning termarg: 0x%02x at memory location %p\n", *current, current); + + current = parse_acpi_type2opcode(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_dataobject(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_argobj(ns, current, end); + if (current != temp) + return current; + + current = parse_acpi_localobj(ns, current, end); + if (current != temp) + return current; + + return current; +} + +static U8 *parse_acpi_namespacemodifierobj(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning namespacemodifierobj: 0x%02x at memory location %p\n", *current, current); + switch (*current) { + case AML_SCOPE_OP: + { + U8 *new_end; + struct acpi_namespace new_ns; + U32 scopeLen = 0; + U32 lengthEncoding = 0; + + current++; + parsePackageLength(current, &scopeLen, &lengthEncoding); + new_end = current + scopeLen; + + current = parse_acpi_namestring(ns, &new_ns, current + lengthEncoding, new_end); +#if DEBUG_ACPI_DECODE + DBG( "Found Scope: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + parse_acpi_termlist(&new_ns, current, new_end); +#if DEBUG_ACPI_DECODE + DBG( "End Scope: "); + dprint_namespace(&new_ns); + DBG( "\n"); +#endif + current = new_end; + break; + } + case AML_NAME_OP: + current++; + current = parse_acpi_namestring(ns, NULL, current, end); + current = parse_acpi_datarefobject(ns, current, end); + break; + case AML_ALIAS_OP: + current++; + current = parse_acpi_namestring(ns, NULL, current, end); + current = parse_acpi_namestring(ns, NULL, current, end); + break; + default: + break; + } + return current; +} + +static U8 *parse_acpi_objectlist(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning objectlist: 0x%02x at memory location %p end=%p\n", *current, current, end); + while (current < end) { + U8 *temp = current; + + DBG( "New iteration of objectlist: 0x%02x at memory location %p end=%p\n", *current, current, end); + + current = parse_acpi_namespacemodifierobj(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_namedobj(ns, current, end); + if (current != temp) + continue; + + if (current == temp) { + DBG( "Unhandled object in object list: 0x%02x at memory location %p\n", *current, current); +#if DEBUG_ACPI_DECODE + DBG( "namespace: "); + dprint_namespace(ns); + DBG( "\n"); +#endif + break; + } + } + DBG( "Ending objectlist: 0x%02x at memory location %p\n", *current, current); + return current; +} + +static U8 *parse_acpi_termarglist(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + DBG( "Beginning termarglist: 0x%02x at memory location %p\n", *current, current); + while (current < end) { + U8 *temp = current; + + current = parse_acpi_termarg(ns, current, end); + if (current == temp) { + DBG( "Unhandled item in term arg list: 0x%02x at memory location %p\n", *current, current); +#if DEBUG_ACPI_DECODE + DBG( "namespace: "); + dprint_namespace(ns); + DBG( "\n"); +#endif + break; + } + } + return current; +} + +void parse_acpi_termlist(const struct acpi_namespace *ns, U8 * current, U8 * end) +{ + while (current < end) { + U8 *temp = current; + + DBG( "Beginning new term in term list: 0x%02x at memory location %p\n", *current, current); + + current = parse_acpi_namespacemodifierobj(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_namedobj(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_type1opcode(ns, current, end); + if (current != temp) + continue; + + current = parse_acpi_type2opcode(ns, current, end); + if (current != temp) + continue; + + switch (*current) { + default: + { + DBG( "Unhandled item in term list: 0x%02x at memory location %p\n", *current, current); +#if DEBUG_ACPI_DECODE + DBG( "namespace: "); + dprint_namespace(ns); + DBG( "\n"); +#endif + return; + } + } + } +} diff --git a/i386/modules/AcpiCodec/include/.svn/all-wcprops b/i386/modules/AcpiCodec/include/.svn/all-wcprops new file mode 100644 index 0000000..85f1644 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/all-wcprops @@ -0,0 +1,59 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include +END +acpi_codec.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/acpi_codec.h +END +datatype.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/datatype.h +END +acpi.h +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/acpi.h +END +acpi_tools.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/acpi_tools.h +END +ppm.h +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/ppm.h +END +ppmsetup.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/ppmsetup.h +END +acpidecode.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/acpidecode.h +END +acpicode.h +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/acpicode.h +END +intel_acpi.h +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/AcpiCodec/include/intel_acpi.h +END diff --git a/i386/modules/AcpiCodec/include/.svn/entries b/i386/modules/AcpiCodec/include/.svn/entries new file mode 100644 index 0000000..7e5fd0f --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/entries @@ -0,0 +1,334 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/AcpiCodec/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +acpi_codec.h +file + + + + +2013-08-27T23:55:04.000000Z +a19f5c260e089fb7b8e959c21b30b34f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2308 + +datatype.h +file + + + + +2013-08-27T23:55:04.000000Z +a2523f6cf72455dea87fe8d87ee336e1 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1857 + +acpi.h +file + + + + +2013-08-27T23:55:04.000000Z +8d1da96385e9832e12d77f1f7ea99d42 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +751 + +acpi_tools.h +file + + + + +2013-08-27T23:55:04.000000Z +05f64f2998a2e876668ba78d0e4c2065 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1844 + +ppm.h +file + + + + +2013-08-27T23:55:04.000000Z +ae7e9d856b5a4c3242188060500fea5b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8560 + +ppmsetup.h +file + + + + +2013-08-27T23:55:04.000000Z +ff1e5c726ed076b77b5038788bc66491 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +14581 + +acpidecode.h +file + + + + +2013-08-27T23:55:04.000000Z +4b6a98effff77f3ca707b71a3927a0cb +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2628 + +acpicode.h +file + + + + +2013-08-27T23:55:04.000000Z +9b7689990bf1e301262f5e777cc926bc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3749 + +intel_acpi.h +file + + + + +2013-08-27T23:55:04.000000Z +a6ad5a09dfeeb01b635aaeef223179aa +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +25699 + diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/acpi_codec.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/acpi_codec.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/acpi_codec.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/acpi_tools.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/acpi_tools.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/acpi_tools.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/acpidecode.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/acpidecode.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/acpidecode.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/datatype.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/datatype.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/datatype.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/intel_acpi.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/intel_acpi.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/intel_acpi.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/ppm.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/ppm.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/ppm.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/prop-base/ppmsetup.h.svn-base b/i386/modules/AcpiCodec/include/.svn/prop-base/ppmsetup.h.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/prop-base/ppmsetup.h.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/acpi.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/acpi.h.svn-base new file mode 100644 index 0000000..1d9c30d --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/acpi.h.svn-base @@ -0,0 +1,25 @@ +#ifndef __LIBSAIO_ACPI_H +#define __LIBSAIO_ACPI_H + +#include "acpi_tools.h" + +#define ACPI_RANGE_START (0x0E0000) +#define ACPI_RANGE_END (0x0FFFFF) + + +#define Unspecified 0 +#define Desktop 1 +#define Mobile 2 +#define Workstation 3 +#define EnterpriseServer 4 +#define SOHOServer 5 +#define AppliancePC 6 +#define PerformanceServer 7 + +#define MaxSupportedPMProfile PerformanceServer // currently max profile supported +#define PMProfileError MaxSupportedPMProfile + 1 + +#define kAcpiMethod "Acpi2Method" // 2 (= method 2) for some machines that may hang on acpi 2 (aka acpi 64 bit) detection (replace the old kUnsafeACPI "UnsafeACPI") + + +#endif /* !__LIBSAIO_ACPI_H */ diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/acpi_codec.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/acpi_codec.h.svn-base new file mode 100644 index 0000000..fad5810 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/acpi_codec.h.svn-base @@ -0,0 +1,77 @@ +/* + * Copyright 2008 mackerintel + */ + +/* + * Copyright (c) 2011 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#ifndef __LIBSAIO_ACPI_CODEC_H +#define __LIBSAIO_ACPI_CODEC_H + +#include "libsaio.h" +#include "efi.h" + +#define OEMOPT_TEMPLATE "oemXXXX" +#define OEMOPT_SIZE sizeof(OEMOPT_TEMPLATE) + +#define kOEMDSDT "oemDSDT" /* acpi_codec.c */ +#define kOEMFADT "oemFADT" /* acpi_codec.c */ +#define kOEMAPIC "oemAPIC" /* acpi_codec.c */ + +#define KIntelFADT "IntelFADTSpec" /* acpi_codec.c */ + +#define kSTRIPAPIC "StripAPICTable" /* acpi_codec.c */ + +#define kRestartFix "RestartFix" /* acpi_codec.c */ +#define KResetType "ResetType" /* acpi_codec.c */ +#define PCI_RESET_TYPE 0 // (default) +#define KEYBOARD_RESET_TYPE 1 + +#define kGeneratePStates "GeneratePStates" /* acpi_codec.c */ +#define kGenerateCStates "GenerateCStates" /* acpi_codec.c */ +#define kGenerateTStates "GenerateTStates" /* acpi_codec.c */ + +#define kMaxRatio "MaxBusRatio" /* acpi_codec.c */ +#define kMinRatio "MinBusRatio" /* acpi_codec.c */ +#define kSpeedstep "EnableSpeedStep" /* acpi_codec.c */ +#define kEnableC2State "EnableC2State" /* acpi_codec.c */ +#define kEnableC3State "EnableC3State" /* acpi_codec.c */ +#define kEnableC4State "EnableC4State" /* acpi_codec.c */ +#define kEnableC6State "EnableC6State" /* acpi_codec.c */ +#define kEnableC7State "EnableC7State" /* acpi_codec.c */ +#define KEnableMwait "EnableMwait" /* acpi_codec.c */ +#define KForceSSDT "ForceGenSSDT" /* acpi_codec.c */ +#define KAcpiCoordType "PstateCoordination" /* acpi_codec.c */ +#define kCoreTurbo "EnableTurbo" /* acpi_codec.c */ + +#define kUpdateACPI "UpdateACPI" /* acpi_codec.c */ +//#define kUnsafeACPI "UnsafeACPI" /* acpi_codec.c */ // DEPRECATED, replaced by nacpi=0x2000 + +#define kOnlySignedAml "LoadSignedAmlOnly" /* acpi_codec.c */ + +#if UNUSED +#define kGenerateFACS "GenerateFACS" /* acpi_codec.c */ +#define kOEMFACS "oemFACS" /* acpi_codec.c */ +#endif + +extern int AcpiSetup(void); + +struct p_state +{ + union + { + uint16_t Control; + struct + { + uint8_t VID; // Voltage ID + uint8_t FID; // Frequency ID + }; + }; + + uint8_t CID; // Compare ID + uint32_t Frequency; +}; + +#endif /* !__LIBSAIO_ACPI_CODEC_H */ diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/acpi_tools.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/acpi_tools.h.svn-base new file mode 100644 index 0000000..86b8e84 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/acpi_tools.h.svn-base @@ -0,0 +1,41 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef acpi_tools_h +#define acpi_tools_h + +#include "datatype.h" +#include "intel_acpi.h" +#include "ppm.h" + +U32 get_num_tables(ACPI_TABLE_RSDT * rsdt); +U32 get_num_tables64(ACPI_TABLE_XSDT * xsdt); +U32 FindAcpiTables(ACPI_TABLES * acpi_tables); +U8 GetChecksum(void *mem_addr, U32 mem_size); + +#endif // acpi_tools_h diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/acpicode.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/acpicode.h.svn-base new file mode 100644 index 0000000..eef945d --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/acpicode.h.svn-base @@ -0,0 +1,75 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef acpi_code_h +#define acpi_code_h + +#include "datatype.h" +#include "acpi.h" +#include "ppm.h" + +void setRsdpchecksum(ACPI_TABLE_RSDP *rsdp); +void setRsdpXchecksum(ACPI_TABLE_RSDP *rsdp); +U32 update_rsdp_with_xsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_XSDT *xsdt); +U32 update_rsdp_with_rsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_RSDT *rsdt); + +void SetChecksum(struct acpi_table_header *header); +U32 ProcessMadtInfo(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info); +void MoveRsdtInsertSsdt(ACPI_TABLE_RSDP * RsdPointer, ACPI_TABLE_RSDT * OldRsdtPointer, ACPI_TABLE_RSDT * NewRsdtPointer, ACPI_TABLE_SSDT * SsdtPointer); +void InsertSsdt(ACPI_TABLE_RSDT * RsdtPointer, ACPI_TABLE_SSDT * SsdtPointer); +void InsertSsdt64(ACPI_TABLE_XSDT * XsdtPointer, ACPI_TABLE_SSDT * SsdtPointer); +U32 ProcessFadt(ACPI_TABLE_FADT * FadtPointer, U32 pmbase); +U32 ProcessDsdt(ACPI_TABLE_DSDT * DsdtPointer, U8 * PCIUIDPointer, U8 uid); + +void setByteConst(ACPI_BYTE_CONST * byteConst, U8 byteData); +void *buildByteConst(void *current, U8 byteData); +void setWordConst(ACPI_WORD_CONST * wordConst, U16 wordData); +void *buildWordConst(void *current, U16 wordData); +void setDwordConst(ACPI_DWORD_CONST * dwordConst, U32 dwordData); +void *buildDwordConst(void *current, U32 dwordData); +void *buildSmallBuffer(void *current); +void *buildEndTag(void *current); +void *buildGenericRegister(void *current, const ACPI_GENERIC_ADDRESS * gas); + +void *buildSmallMethod(void *current, U32 name, U8 methodFlags); +void *buildMethod(void *current, U32 name, U8 methodFlags); +void *buildReturnZero(void *current); +void *buildReturnOpcode(void *current, U8 opcodeToReturn); +void *buildReturnPackage(void *current, U8 numElements); +void *buildNamedDword(void *current, U32 name, U32 dword); +void *buildOpCode(void *current, U8 opCode); + +void *buildNameSeg(void *current, U32 name); +void setSmallPackage(ACPI_SMALL_PACKAGE * package, U8 numElements); +void *buildSmallPackage(void *current, U8 numElements); +void setPackageLength(ACPI_PACKAGE_LENGTH * packageLength, U32 length); +void *buildPackageLength(void *current, U32 Length); +void *buildNamePath(void *current, U32 name); +void *buildTableHeader(void *current, U32 signature, U64 oemTableId); + +#endif // acpi_code_h diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/acpidecode.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/acpidecode.h.svn-base new file mode 100644 index 0000000..5963af9 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/acpidecode.h.svn-base @@ -0,0 +1,69 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ACPI_DECODE_H +#define ACPI_DECODE_H + +#include "acpi_tools.h" + +/* acpidecode.h contains functions needed only for decoding ACPI to produce the + * inputs to the PPM code, but not needed for encoding ACPI as done inside the + * PPM code. */ + +#define ACPI_NAMESPACE_MAX_DEPTH 10 + +struct acpi_namespace { + U32 nameseg[ACPI_NAMESPACE_MAX_DEPTH]; + U32 depth; +}; + +void dprint_nameseg(U32 i); +void *decodeTableHeader(void *current, ACPI_TABLE_HEADER ** tableHeader); +void parse_acpi_termlist(const struct acpi_namespace *ns, U8 * current, U8 * end); + +/* Globals used for retrieving ACPI processor structures from the DSDT */ + +#define CPU_MAP_LIMIT 256 /* Any bigger than 256 and we'd have to support the x2APIC structures, which we don't yet anyway. */ + +struct acpi_processor { + struct acpi_namespace ns; + U8 id; + U32 pmbase; +}; + +extern U32 acpi_processor_count; +extern struct acpi_processor acpi_processors[CPU_MAP_LIMIT]; + +#if UNUSED +/* If 0, look for a processor namespace and set to 1 if found. */ +extern U32 acpi_ns_found; +#endif + +extern U8* UIDPointer; + +#endif /* ACPI_DECODE_H */ diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/datatype.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/datatype.h.svn-base new file mode 100644 index 0000000..d6cd5cc --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/datatype.h.svn-base @@ -0,0 +1,54 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef DATATYPE_H +#define DATATYPE_H + +#include "libsa.h" + +typedef uint8_t U8; +typedef uint16_t U16; +typedef uint32_t U32; +typedef uint64_t U64; + +#if 0 +typedef uint32_t bool; +#ifndef false +#define true 1 +#endif + +#ifndef false +#define false 0 +#endif + +#ifndef NULL +#define NULL ((void *) 0) +#endif +#endif + +#endif /* DATATYPE_H */ diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/intel_acpi.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/intel_acpi.h.svn-base new file mode 100644 index 0000000..9dc9351 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/intel_acpi.h.svn-base @@ -0,0 +1,692 @@ +/* Per ACPI 3.0a spec */ + +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __LIBSAIO_INTEL_ACPI_H +#define __LIBSAIO_INTEL_ACPI_H + +#include "datatype.h" +#include "ppmsetup.h" +// +// All tables and structures must be byte-packed to match the ACPI specification +//#pragma pack(1) + +#define ACPI_SIG_DSDT "DSDT" // Differentiated System Description Table +#define ACPI_SIG_FADT "FACP" // Fixed ACPI Description Table +#define ACPI_SIG_FACS "FACS" // Firmware ACPI Control Structure +#define ACPI_SIG_PSDT "PSDT" // Persistent System Description Table +#define ACPI_SIG_RSDP "RSD PTR " // Root System Description Pointer +#define ACPI_SIG_RSDT "RSDT" // Root System Description Table +#define ACPI_SIG_XSDT "XSDT" // Extended System Description Table +#define ACPI_SIG_SSDT "SSDT" // Secondary System Description Table +#define ACPI_RSDP_NAME "RSDP" // Short name for RSDP, not signature +#define ACPI_SIG_MADT "APIC" // Multiple APIC Description Table +#define ACPI_SIG_SBST "SBST" // Smart Battery Specification Table +#define ACPI_SIG_ECDT "ECDT" // Embedded Controller Boot Resources Table +#define ACPI_SIG_ASF "ASF!" // Alert Standard Format table +#define ACPI_SIG_DMAR "DMAR" // DMA Remapping table +#define ACPI_SIG_HPET "HPET" // High Precision Event Timer table +#define ACPI_SIG_MCFG "MCFG" // PCI Memory Mapped Configuration table +#define ACPI_SIG_UEFI "UEFI" // Uefi Boot Optimization Table + + +#ifndef nameseg_defined +#define nameseg_defined +#define NAMESEG(s) (((U32)(s[0]) << 0) \ +|((U32)(s[1]) << 8) \ +|((U32)(s[2]) << 16) \ +|((U32)(s[3]) << 24)) +#endif + +#define NAMESEG64(s) (((U64)(s[0]) << 0) \ +|((U64)(s[1]) << 8) \ +|((U64)(s[2]) << 16) \ +|((U64)(s[3]) << 24) \ +|((U64)(s[4]) << 32) \ +|((U64)(s[5]) << 40) \ +|((U64)(s[6]) << 48) \ +|((U64)(s[7]) << 56)) \ + + +// Data Objects Encoding values. +#define AML_EXT_OP_PREFIX 0x5B + +// Name Space Modifier Objects Encoding values. +#define AML_NAME_OP 0x08 // Name operator. +#define AML_SCOPE_OP 0x10 // Scope operator. + +// Named Objects Encoding values. +#define AML_MUTEX_OP 0x01 +#define AML_METHOD_OP 0x14 // Method operator. +#define AML_OPREGION_OP 0x80 // Operation Region operator. +#define AML_FIELD_OP 0x81 +#define AML_DEVICE_OP 0x82 +#define AML_PROCESSOR_OP 0x83 // Processor operator. + +// Type2 Opcodes Encoding values. +#define AML_NULL_NAME 0x00 +#define AML_ZERO_OP 0x00 +#define AML_ALIAS_OP 0x06 +#define AML_ONE_OP 0x01 +#define AML_BYTE_OP 0x0a +#define AML_WORD_OP 0x0b +#define AML_DWORD_OP 0x0c +#define AML_STRING_OP 0x0d +#define AML_QWORD_OP 0x0e +#define AML_BUFFER_OP 0x11 +#define AML_PACKAGE_OP 0x12 +#define AML_COND_REF_OF_OP 0x12 // Requires AML_EXT_OP_PREFIX +#define AML_CREATE_FIELD_OP 0x13 // Requires AML_EXT_OP_PREFIX +#define AML_DUAL_NAME_PREFIX 0x2e +#define AML_MULTI_NAME_PREFIX 0x2f +#define AML_REVISION_OP 0x30 // Requires AML_EXT_OP_PREFIX +#define AML_DEBUG_OP 0x31 +#define AML_ROOT_PREFIX 0x5c +#define AML_PARENT_PREFIX 0x5e +#define AML_LOCAL0_OP 0x60 +#define AML_LOCAL1_OP 0x61 +#define AML_LOCAL2_OP 0x62 +#define AML_LOCAL3_OP 0x63 +#define AML_LOCAL4_OP 0x64 +#define AML_LOCAL5_OP 0x65 +#define AML_LOCAL6_OP 0x66 +#define AML_LOCAL7_OP 0x67 +#define AML_ARG0_OP 0x68 +#define AML_ARG1_OP 0x69 +#define AML_ARG2_OP 0x6A +#define AML_ARG3_OP 0x6B +#define AML_ARG4_OP 0x6C +#define AML_ARG5_OP 0x6D +#define AML_ARG6_OP 0x6E +#define AML_STORE_OP 0x70 +#define AML_CONCAT_OP 0x73 +#define AML_SUBTRACT_OP 0x74 +#define AML_MULTIPLY_OP 0x77 +#define AML_AND_OP 0x7B +#define AML_END_TAG_OP 0x79 +#define AML_GEN_REG_FIELD 0x82 +#define AML_PROCESSOR_OP 0x83 +#define AML_INDEXFIELD_OP 0x86 // Requires AML_EXT_OP_PREFIX +#define AML_SIZEOF_OP 0x87 +#define AML_INDEX_OP 0x88 +#define AML_CREATE_DWORD_FIELD_OP 0x8A +#define AML_LAND_OP 0x90 +#define AML_LOR_OP 0x91 +#define AML_LNOT_OP 0x92 +#define AML_LEQUAL_OP 0x93 +#define AML_LGREATER_OP 0x94 +#define AML_LLESS_OP 0x95 +#define AML_IF_OP 0xA0 +#define AML_ELSE_OP 0xA1 +#define AML_RETURN_OP 0xA4 +#define AML_ONES_OP 0xFF + +#define GAS_TYPE_FFH 0x7f +#define GAS_TYPE_SYSTEM_IO 0x01 +#define GAS_VENDOR_INTEL 0x01 +#define GAS_CLASS_CODE_NATIVE 0x02 + +// Define the Generic System Description Table Structure. +// This common header is used by all tables except the RSDP and FACS. +// The define is used for direct inclusion of header into other ACPI tables +typedef struct acpi_table_header { + U8 Signature[4]; // ASCII table signature + U32 Length; // Length of table in bytes, including this header + U8 Revision; // ACPI Specification minor version # + U8 Checksum; // To make checksum of entire table == 0 + U8 OemId[6]; // ASCII OEM identification + U8 OemTableId[8]; // ASCII OEM table identification + U32 OemRevision; // OEM revision number + U8 AslCompilerId[4]; // ASCII ASL compiler vendor ID + U32 AslCompilerRevision; // ASL compiler version +} __attribute__((packed))ACPI_TABLE_HEADER; + +// GAS - Generic Address Structure (ACPI 2.0+) +typedef struct acpi_generic_address { + U8 SpaceId; // Address space where struct or register exists + U8 BitWidth; // Size in bits of given register + U8 BitOffset; // Bit offset within the register + U8 AccessWidth; // Minimum Access size (ACPI 3.0) + U64 Address; // 64-bit address of struct or register +} __attribute__((packed))ACPI_GENERIC_ADDRESS; + +// RSDP - Root System Description Pointer (Signature is "RSD PTR ") +typedef struct acpi_table_rsdp { + U8 Signature[8]; // ACPI signature, contains "RSD PTR " + U8 Checksum; // ACPI 1.0 checksum + U8 OemId[6]; // OEM identification + U8 Revision; // Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ + U32 RsdtPhysicalAddress; // 32-bit physical address of the RSDT + U32 Length; // Table length in bytes, including header (ACPI 2.0+) + U64 XsdtPhysicalAddress; // 64-bit physical address of the XSDT (ACPI 2.0+) + U8 ExtendedChecksum; // Checksum of entire table (ACPI 2.0+) + U8 Reserved[3]; // Reserved, must be zero +} __attribute__((packed))ACPI_TABLE_RSDP; + +#define ACPI_RSDP_REV0_SIZE 20 // Size of original ACPI 1.0 RSDP + +// RSDT - Root System Description Table +typedef struct acpi_table_rsdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 TableOffsetEntry[1]; // Array of pointers to ACPI tables +} __attribute__((packed))ACPI_TABLE_RSDT; + + +// XSDT - Root System Description Table +typedef struct acpi_table_xsdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U64 TableOffsetEntry[1]; // Array of pointers to ACPI tables +} __attribute__((packed))ACPI_TABLE_XSDT; + +// DSDT - Differentiated System Description Table +typedef struct acpi_table_dsdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 EntryStart; +} __attribute__((packed))ACPI_TABLE_DSDT; + +// FACS - Firmware ACPI Control Structure (FACS) +typedef struct acpi_table_facs { + U8 Signature[4]; // ASCII table signature + U32 Length; // Length of structure, in bytes + U32 HardwareSignature; // Hardware configuration signature + U32 FirmwareWakingVector; // 32-bit physical address of the Firmware Waking Vector + U32 GlobalLock; // Global Lock for shared hardware resources + U32 Flags; + U64 XFirmwareWakingVector; // 64-bit version of the Firmware Waking Vector (ACPI 2.0+) + U8 Version; // Version of this table (ACPI 2.0+) + U8 Reserved[31]; // Reserved, must be zero +} __attribute__((packed))ACPI_TABLE_FACS; + +// SBST - Smart Battery Specification Table - Version 1 +typedef struct acpi_table_sbst +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U32 WarningLevel; + U32 LowLevel; + U32 CriticalLevel; + +} __attribute__((packed))ACPI_TABLE_SBST; + +// ASF - Alert Standard Format table (Signature "ASF!") +typedef struct acpi_table_asf +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_ASF; + +// DMAR - DMA Remapping table - Version 1 +typedef struct acpi_table_dmar +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U8 Width; /* Host Address Width */ + U8 Flags; + U8 Reserved[10]; + +} __attribute__((packed))ACPI_TABLE_DMAR; + +// HPET - High Precision Event Timer table - Version 1 +typedef struct acpi_table_hpet +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U32 Id; /* Hardware ID of event timer block */ + ACPI_GENERIC_ADDRESS Address; /* Address of event timer block */ + U8 Sequence; /* HPET sequence number */ + U16 MinimumTick; /* Main counter min tick, periodic mode */ + U8 Flags; + +} __attribute__((packed))ACPI_TABLE_HPET; + +//MCFG - PCI Memory Mapped Configuration table and sub-table - Version 1 +typedef struct acpi_table_mcfg +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U8 Reserved[8]; + +} ACPI_TABLE_MCFG; + +//UEFI - UEFI Boot optimization Table - Version 1 +typedef struct acpi_table_uefi +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U8 Identifier[16]; /* UUID identifier */ + U16 DataOffset; /* Offset of remaining data in table */ + +} __attribute__((packed))ACPI_TABLE_UEFI; + +// ECDT - Embedded Controller Boot Resources Table - Version 1 +typedef struct acpi_table_ecdt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register */ + ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */ + U32 Uid; /* Unique ID - must be same as the EC _UID method */ + U8 Gpe; /* The GPE for the EC */ + U8 Id[1]; /* Full namepath of the EC in the ACPI namespace */ + +} __attribute__((packed))ACPI_TABLE_ECDT; + +// FADT - Fixed ACPI Description Table (Signature "FACP") +typedef struct acpi_table_fadt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 Facs; // 32-bit physical address of FACS + U32 Dsdt; // 32-bit physical address of DSDT + U8 Model; // System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ + U8 PreferredProfile; // Conveys preferred power management profile to OSPM. + U16 SciInterrupt; // System vector of SCI interrupt + U32 SmiCommand; // 32-bit Port address of SMI command port + U8 AcpiEnable; // Value to write to smi_cmd to enable ACPI + U8 AcpiDisable; // Value to write to smi_cmd to disable ACPI + U8 S4BiosRequest; // Value to write to SMI CMD to enter S4BIOS state + U8 PstateControl; // Processor performance state control + U32 Pm1aEventBlock; // 32-bit Port address of Power Mgt 1a Event Reg Blk + U32 Pm1bEventBlock; // 32-bit Port address of Power Mgt 1b Event Reg Blk + U32 Pm1aControlBlock; // 32-bit Port address of Power Mgt 1a Control Reg Blk + U32 Pm1bControlBlock; // 32-bit Port address of Power Mgt 1b Control Reg Blk + U32 Pm2ControlBlock; // 32-bit Port address of Power Mgt 2 Control Reg Blk + U32 PmTimerBlock; // 32-bit Port address of Power Mgt Timer Ctrl Reg Blk + U32 Gpe0Block; // 32-bit Port address of General Purpose Event 0 Reg Blk + U32 Gpe1Block; // 32-bit Port address of General Purpose Event 1 Reg Blk + U8 Pm1EventLength; // Byte Length of ports at Pm1xEventBlock + U8 Pm1ControlLength; // Byte Length of ports at Pm1xControlBlock + U8 Pm2ControlLength; // Byte Length of ports at Pm2ControlBlock + U8 PmTimerLength; // Byte Length of ports at PmTimerBlock + U8 Gpe0BlockLength; // Byte Length of ports at Gpe0Block + U8 Gpe1BlockLength; // Byte Length of ports at Gpe1Block + U8 Gpe1Base; // Offset in GPE number space where GPE1 events start + U8 CstControl; // Support for the _CST object and C States change notification + U16 C2Latency; // Worst case HW latency to enter/exit C2 state + U16 C3Latency; // Worst case HW latency to enter/exit C3 state + U16 FlushSize; // Processor's memory cache line width, in bytes + U16 FlushStride; // Number of flush strides that need to be read + U8 DutyOffset; // Processor duty cycle index in processor's P_CNT reg + U8 DutyWidth; // Processor duty cycle value bit width in P_CNT register. + U8 DayAlarm; // Index to day-of-month alarm in RTC CMOS RAM + U8 MonthAlarm; // Index to month-of-year alarm in RTC CMOS RAM + U8 Century; // Index to century in RTC CMOS RAM + U16 BootFlags; // IA-PC Boot Architecture Flags. See Table 5-10 for description + U8 Reserved; // Reserved, must be zero + U32 Flags; // Miscellaneous flag bits (see below for individual flags) + ACPI_GENERIC_ADDRESS ResetRegister; // 64-bit address of the Reset register + U8 ResetValue; // Value to write to the ResetRegister port to reset the system + U8 Reserved4[3]; // Reserved, must be zero + U64 XFacs; // 64-bit physical address of FACS + U64 XDsdt; // 64-bit physical address of DSDT + ACPI_GENERIC_ADDRESS XPm1aEventBlock; // 64-bit Extended Power Mgt 1a Event Reg Blk address + ACPI_GENERIC_ADDRESS XPm1bEventBlock; // 64-bit Extended Power Mgt 1b Event Reg Blk address + ACPI_GENERIC_ADDRESS XPm1aControlBlock; // 64-bit Extended Power Mgt 1a Control Reg Blk address + ACPI_GENERIC_ADDRESS XPm1bControlBlock; // 64-bit Extended Power Mgt 1b Control Reg Blk address + ACPI_GENERIC_ADDRESS XPm2ControlBlock; // 64-bit Extended Power Mgt 2 Control Reg Blk address + ACPI_GENERIC_ADDRESS XPmTimerBlock; // 64-bit Extended Power Mgt Timer Ctrl Reg Blk address + ACPI_GENERIC_ADDRESS XGpe0Block; // 64-bit Extended General Purpose Event 0 Reg Blk address + ACPI_GENERIC_ADDRESS XGpe1Block; // 64-bit Extended General Purpose Event 1 Reg Blk address +} __attribute__((packed))ACPI_TABLE_FADT; + +// SSDT - Secondary System Description Table +typedef struct acpi_table_ssdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header +} __attribute__((packed))ACPI_TABLE_SSDT; + +//MADT - Multiple APIC Description Table +typedef struct acpi_table_madt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 Address; // Physical address of local APIC + U32 Flags; +} __attribute__((packed))ACPI_TABLE_MADT; + + +// Values for subtable type in ACPI_SUBTABLE_HEADER +enum AcpiMadtType { + ACPI_MADT_TYPE_LOCAL_APIC = 0, + ACPI_MADT_TYPE_IO_APIC = 1, + ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, + ACPI_MADT_TYPE_NMI_SOURCE = 3, + ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, + ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, + ACPI_MADT_TYPE_IO_SAPIC = 6, + ACPI_MADT_TYPE_LOCAL_SAPIC = 7, + ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, + ACPI_MADT_TYPE_X2APIC = 9, + ACPI_MADT_TYPE_RESERVED = 10 // 10 and greater are reserved +}; + +// Common Sub-table header (used in MADT, SRAT, etc.) +typedef struct acpi_subtable_header { + U8 Type; + U8 Length; +} __attribute__((packed))ACPI_SUBTABLE_HEADER; + +// MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER + +// 0: Processor Local APIC +typedef struct acpi_madt_local_apic { + ACPI_SUBTABLE_HEADER Header; + U8 ProcessorId; // ACPI processor id + U8 Id; // Processor's local APIC id + U32 LapicFlags; +} __attribute__((packed))ACPI_MADT_LOCAL_APIC; + +// 1: IO APIC +typedef struct acpi_madt_io_apic { + ACPI_SUBTABLE_HEADER Header; + U8 Id; // I/O APIC ID + U8 Reserved; // Reserved - must be zero + U32 Address; // APIC physical address + U32 GlobalIrqBase; // Global system interrupt where INTI lines start +} __attribute__((packed))ACPI_MADT_IO_APIC; + +// 2: Interrupt Override +typedef struct acpi_madt_interrupt_override { + ACPI_SUBTABLE_HEADER Header; + U8 Bus; // 0 - ISA + U8 SourceIrq; // Interrupt source (IRQ) + U32 GlobalIrq; // Global system interrupt + U16 IntiFlags; +} __attribute__((packed))ACPI_MADT_INTERRUPT_OVERRIDE; + +// 3: NMI Source +typedef struct acpi_madt_nmi_source { + ACPI_SUBTABLE_HEADER Header; + U16 IntiFlags; + U32 GlobalIrq; // Global system interrupt +} __attribute__((packed))ACPI_MADT_NMI_SOURCE; + +// 4: Local APIC NMI +typedef struct acpi_madt_local_apic_nmi { + ACPI_SUBTABLE_HEADER Header; + U8 ProcessorId; // ACPI processor id + U16 IntiFlags; + U8 Lint; // LINTn to which NMI is connected +} __attribute__((packed))ACPI_MADT_LOCAL_APIC_NMI; + +// 5: Address Override +typedef struct acpi_madt_local_apic_override { + ACPI_SUBTABLE_HEADER Header; + U16 Reserved; // Reserved, must be zero + U64 Address; // APIC physical address +} __attribute__((packed))ACPI_MADT_LOCAL_APIC_OVERRIDE; + +// 6: I/O Sapic +typedef struct acpi_madt_io_sapic { + ACPI_SUBTABLE_HEADER Header; + U8 Id; // I/O SAPIC ID + U8 Reserved; // Reserved, must be zero + U32 GlobalIrqBase; // Global interrupt for SAPIC start + U64 Address; // SAPIC physical address +} __attribute__((packed))ACPI_MADT_IO_SAPIC; + +// 7: Local Sapic +typedef struct acpi_madt_local_sapic { + ACPI_SUBTABLE_HEADER Header; + U8 ProcessorId; // ACPI processor id + U8 Id; // SAPIC ID + U8 Eid; // SAPIC EID + U8 Reserved[3]; // Reserved, must be zero + U32 LapicFlags; + U32 Uid; // Numeric UID - ACPI 3.0 + char UidString[1]; // String UID - ACPI 3.0 +} __attribute__((packed))ACPI_MADT_LOCAL_SAPIC; + +// 8: Platform Interrupt Source +typedef struct acpi_madt_interrupt_source { + ACPI_SUBTABLE_HEADER Header; + U16 IntiFlags; + U8 Type; // 1=PMI, 2=INIT, 3=corrected + U8 Id; // Processor ID + U8 Eid; // Processor EID + U8 IoSapicVector; // Vector value for PMI interrupts + U32 GlobalIrq; // Global system interrupt + U32 Flags; // Interrupt Source Flags +} __attribute__((packed))ACPI_MADT_INTERRUPT_SOURCE; + +// 9: Processor X2APIC +typedef struct acpi_madt_x2apic { + ACPI_SUBTABLE_HEADER Header; + U16 Reserved; // Must be zero + U32 x2apicId; // Processor's X2APIC ID + U32 x2apicFlags; + U32 UID; +} __attribute__((packed))ACPI_MADT_X2APIC; + +// Common flags fields for MADT subtables + +// MADT Local APIC flags (LapicFlags) +#define ACPI_MADT_ENABLED (1) // 00: Processor is usable if set + +// MADT MPS INTI flags (IntiFlags) +#define ACPI_MADT_POLARITY_MASK (3) // 00-01: Polarity of APIC I/O input signals +#define ACPI_MADT_TRIGGER_MASK (3<<2) // 02-03: Trigger mode of APIC input signals + +// Values for MPS INTI flags +#define ACPI_MADT_POLARITY_CONFORMS 0 +#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1 +#define ACPI_MADT_POLARITY_RESERVED 2 +#define ACPI_MADT_POLARITY_ACTIVE_LOW 3 + +#define ACPI_MADT_TRIGGER_CONFORMS (0) +#define ACPI_MADT_TRIGGER_EDGE (1<<2) +#define ACPI_MADT_TRIGGER_RESERVED (2<<2) +#define ACPI_MADT_TRIGGER_LEVEL (3<<2) + +#define ACPI_COORD_TYPE_SW_ALL 0xFC +#define ACPI_COORD_TYPE_SW_ANY 0xFD +#define ACPI_COORD_TYPE_HW_ALL 0xFE + +typedef struct packageLength { + U8 packageLength0; + U8 packageLength1; +} __attribute__((packed))ACPI_PACKAGE_LENGTH; + +typedef struct acpi_scope { + U8 scopeOpcode; + ACPI_PACKAGE_LENGTH pkgLength; + U8 rootChar; +} __attribute__((packed))ACPI_SCOPE; + +typedef struct dual_name_path { + U8 prefix; + U32 nameseg[2]; +} __attribute__((packed))DUAL_NAME_PATH; + +typedef struct multi_name_path { + U8 prefix; + U8 segCount; + U32 nameseg[MAX_SUPPORTED_CPU_NAMESEGS]; +} __attribute__((packed))MULTI_NAME_PATH; + +typedef struct generic_register { + U8 genericRegisterField; + ACPI_PACKAGE_LENGTH pkgLength; + ACPI_GENERIC_ADDRESS gas; +} __attribute__((packed))ACPI_GENERIC_REGISTER; + +typedef struct package { + U8 packageOpcode; + ACPI_PACKAGE_LENGTH pkgLength; + U8 numElements; +} __attribute__((packed))ACPI_PACKAGE; + +typedef struct small_package { + U8 packageOpcode; + U8 packageLength; + U8 numElements; +} __attribute__((packed))ACPI_SMALL_PACKAGE; + +typedef struct small_buffer { + U8 bufferOpcode; + U8 packageLength; +} __attribute__((packed))ACPI_SMALL_BUFFER; + +typedef struct end_tag { + U8 endTagField; + U8 checksum; +} __attribute__((packed))ACPI_END_TAG; + +typedef struct return_name_seg { + U8 returnOpcode; + U32 name; +} __attribute__((packed))ACPI_RETURN_NAME_SEG; + +typedef struct return_package { + U8 returnOpcode; + ACPI_PACKAGE package; +} __attribute__((packed))ACPI_RETURN_PACKAGE; + +typedef struct return_zero { + U8 returnOpcode; + U8 zeroOpcode; +} __attribute__((packed))ACPI_RETURN_ZERO; + +typedef struct return_opcode { + U8 returnOpcode; + U8 opcodeToReturn; +} __attribute__((packed))ACPI_RETURN_OPCODE; + +typedef struct byteConst { + U8 byteOpcode; + U8 byteData; +} __attribute__((packed))ACPI_BYTE_CONST; + +typedef struct wordConst { + U8 wordOpcode; + U16 wordData; +} __attribute__((packed))ACPI_WORD_CONST; + +typedef struct dwordConst { + U8 dwordOpcode; + U32 dwordData; +} __attribute__((packed))ACPI_DWORD_CONST; + +typedef struct small_method { + U8 methodOpcode; + U8 packageLength; + U32 name; + U8 methodFlags; +} __attribute__((packed))ACPI_SMALL_METHOD; + +typedef struct method { + U8 methodOpcode; + ACPI_PACKAGE_LENGTH pkgLength; + U32 name; + U8 methodFlags; +} __attribute__((packed))ACPI_METHOD; + +typedef struct namePath { + U8 nameOpcode; + U32 name; +} __attribute__((packed))ACPI_NAME_PATH; + +typedef struct named_dword { + ACPI_NAME_PATH namePath; + ACPI_DWORD_CONST dword; +} __attribute__((packed))ACPI_NAMED_DWORD; + +typedef struct rootNamePath { + U8 nameOpcode; + U8 rootPrefix; + U32 name; +} ACPI_ROOT_NAME_PATH; + +typedef struct root_named_dword { + ACPI_ROOT_NAME_PATH rootNamePath; + ACPI_DWORD_CONST dword; +} __attribute__((packed))ACPI_ROOT_NAMED_DWORD; + +typedef struct named_object { + ACPI_NAME_PATH namePath; + ACPI_PACKAGE package; +} __attribute__((packed))ACPI_NAMED_OBJECT; + +typedef struct small_named_object { + ACPI_NAME_PATH namePath; + ACPI_SMALL_PACKAGE package; +} __attribute__((packed))ACPI_SMALL_NAMED_OBJECT; + +typedef struct create_dword_field { + ACPI_NAME_PATH namePath; + ACPI_SMALL_PACKAGE package; +} __attribute__((packed))ACPI_CREATE_DWORD_FIELD; + +typedef struct tstate_package { + ACPI_SMALL_PACKAGE package; + ACPI_DWORD_CONST FreqPercent; + ACPI_DWORD_CONST Power; + ACPI_DWORD_CONST TransLatency; + ACPI_DWORD_CONST Control; + ACPI_DWORD_CONST Status; +} __attribute__((packed))ACPI_TSTATE_PACKAGE; + +typedef struct pstate_package { + ACPI_SMALL_PACKAGE package; + ACPI_DWORD_CONST CoreFreq; + ACPI_DWORD_CONST Power; + ACPI_DWORD_CONST TransLatency; + ACPI_DWORD_CONST BMLatency; + ACPI_DWORD_CONST Control; + ACPI_DWORD_CONST Status; +} __attribute__((packed))ACPI_PSTATE_PACKAGE; + +typedef struct psd_package { + ACPI_SMALL_PACKAGE package; + ACPI_BYTE_CONST NumberOfEntries; + ACPI_BYTE_CONST Revision; + ACPI_DWORD_CONST Domain; + ACPI_DWORD_CONST CoordType; + ACPI_DWORD_CONST NumProcessors; +} __attribute__((packed))ACPI_PSD_PACKAGE; + +typedef struct csd_package { + ACPI_SMALL_PACKAGE package; + ACPI_BYTE_CONST NumberOfEntries; + ACPI_BYTE_CONST Revision; + ACPI_DWORD_CONST Domain; + ACPI_DWORD_CONST CoordType; + ACPI_DWORD_CONST NumProcessors; + ACPI_DWORD_CONST Index; +} __attribute__((packed))ACPI_CSD_PACKAGE; + +typedef struct tsd_package { + ACPI_SMALL_PACKAGE package; + ACPI_BYTE_CONST NumberOfEntries; + ACPI_BYTE_CONST Revision; + ACPI_DWORD_CONST Domain; + ACPI_DWORD_CONST CoordType; + ACPI_DWORD_CONST NumProcessors; +} __attribute__((packed))ACPI_TSD_PACKAGE; + +typedef struct processor { + U8 processorOpCode; + U8 packageLength; + U8 numElements; + ACPI_BYTE_CONST ProcID; + ACPI_DWORD_CONST PblkAddr; + ACPI_BYTE_CONST PblkLen; +} __attribute__((packed))ACPI_PROCESSOR; + +//#pragma pack() + +#endif /* !__LIBSAIO_INTEL_ACPI_H */ diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/ppm.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/ppm.h.svn-base new file mode 100644 index 0000000..379d958 --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/ppm.h.svn-base @@ -0,0 +1,289 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ppm_h +#define ppm_h + +#include "datatype.h" + +#define PROFILE_ALL +//#define PROFILE_NEHALEM_EP_DP +//#define PROFILE_WESTMERE_EP_UP_DP +//#define PROFILE_NEHALEM_EX_MP +//#define PROFILE_WESTMERE_EX_MP +//#define PROFILE_SANDYBRIDGE_UP + +#if defined(PROFILE_ALL) || defined(PROFILE_WESTMERE_EX_MP) + +#define MAX_CPU_SOCKETS 8 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 256 // max count of cpu found in MADT +#define MAX_CORES 32 // Based on full range of Core APID ID values (max of 5 bits for core APIC ID mask) + +#elif defined(PROFILE_NEHALEM_EX_MP) + +#define MAX_CPU_SOCKETS 8 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 128 // max count of cpu found in MADT +#define MAX_CORES 16 // Based on full range of Core APID ID values (max of 4 bits for core APIC ID mask) + +#elif defined(PROFILE_WESTMERE_EP_UP_DP) + +#define MAX_CPU_SOCKETS 2 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 64 // max count of cpu found in MADT +#define MAX_CORES 16 // Based on full range of Core APID ID values (max of 4 bits for core APIC ID mask) + +#elif defined(PROFILE_NEHALEM_EP_UP_DP) + +#define MAX_CPU_SOCKETS 2 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 32 // max count of cpu found in MADT +#define MAX_CORES 8 // Based on full range of Core APID ID values (max of 3 bits for core APIC ID mask) + +#elif defined(PROFILE_SANDY_BRIDGE_UP) + +#define MAX_CPU_SOCKETS 1 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 8 // max count of cpu found in MADT +#define MAX_CORES 4 + +#endif + +#define MAX_PSTATES 16 +#define MAX_CSTATES 4 +#define MAX_TSTATES 15 + +//Define ACPI_CSD to force building ACPI _CSD +//#define BUILD_ACPI_CSD + +#ifndef DWORD_REGS_TYPEDEF +#define DWORD_REGS_TYPEDEF +typedef struct dword_regs { + U32 _eax; + U32 _ebx; + U32 _ecx; + U32 _edx; +} DWORD_REGS; +#endif + +typedef struct acpi_tables { + // Define the Storage Locations for all the ACPI Table Pointers. + ACPI_TABLE_DSDT *DsdtPointer; // Differentiated System Description Table (RSDP->RSDT->FACP->DSDT) + ACPI_TABLE_DSDT *DsdtPointer64; // Differentiated System Description Table (RSDP->XSDT->FACP->XDSDT) + ACPI_TABLE_FADT *FacpPointer; // Fixed ACPI Description Table (RSDP->RSDT->FACP) + ACPI_TABLE_FACS *FacsPointer; // Firmware ACPI Control Structure (RSDP->RSDT->FACP->FACS) + ACPI_TABLE_FACS *FacsPointer64; // Firmware ACPI Control Structure (RSDP->XSDT->FACP->XFACS) + ACPI_TABLE_RSDP *RsdPointer; // Root System Description Pointer Structure (RSDP) + ACPI_TABLE_RSDT *RsdtPointer; // Root System Description Table (RSDP->RSDT) + ACPI_TABLE_MADT *MadtPointer; // Multiple APIC Description Table (RSDP->RSDT->APIC) + ACPI_TABLE_MADT *MadtPointer64; // Multiple APIC Description Table (RSDP->XSDT->APIC) + ACPI_TABLE_XSDT *XsdtPointer; // Extended Root System Description Table (RSDP->XSDT) + ACPI_TABLE_FADT *FacpPointer64; // Fixed ACPI Description Table (RSDP->XSDT->FACP) +} ACPI_TABLES; + +typedef struct pstate { + U32 frequency; + U32 power; + U32 ratio; + U32 translatency; + U32 bmlatency; + U32 control; + U32 status; +} PSTATE; + +typedef struct pkg_pstates { + U32 num_pstates; + PSTATE pstate[MAX_PSTATES]; +} PKG_PSTATES; + +typedef struct tstate { + U32 freqpercent; + U32 power; + U32 latency; + U32 control; + U32 status; +} TSTATE; + +typedef struct pkg_tstates { + U32 num_tstates; + TSTATE tstate[MAX_TSTATES]; +} PKG_TSTATES; + +typedef enum cstate_encoding { + IO_REDIRECTION = 0, + NATIVE_MWAIT = 1, +} CSTATE_ENCODING; + +typedef enum cpu_cstate { + CPU_C1 = 1, + //CPU_C2 = 2, + CPU_C3_ACPI_C2 = 3, + CPU_C3_ACPI_C3 = 4, + CPU_C4 = 5, + CPU_C6 = 6, + CPU_C7 = 7, +} CPU_CSTATE; + +typedef struct cstate { + U8 type; + U16 latency; + U32 power; +} CSTATE; + +typedef struct pkg_cstates { + U32 num_cstates; + CSTATE cstate[MAX_CSTATES]; + ACPI_GENERIC_ADDRESS gas[MAX_CSTATES]; +} PKG_CSTATES; + +typedef struct cpu_details { + U32 present; + U32 x2apic_id; + U32 socket_id; + U32 intra_package_mask_width; + U32 intra_package_mask; + U32 smt_mask_width; + U32 smt_select_mask; + U32 core_select_mask; + DWORD_REGS cpuid1; + DWORD_REGS cpuid5; + DWORD_REGS cpuid6; + DWORD_REGS cpuidB_0; + DWORD_REGS cpuidB_1; + U32 eist_cpuid_feature_flag; + U32 turbo_cpuid_feature_flag; + U32 turbo_misc_enables_feature_flag; + U32 invariant_apic_timer_flag; + U32 tdc_limit; + U32 tdp_limit; + U32 turbo_available; + U32 max_ratio_as_mfg; + U32 max_ratio_as_cfg; + U32 min_ratio; + U32 tdc_tdp_limits_for_turbo_flag; + U32 ratio_limits_for_turbo_flag; + U32 xe_available; + U32 logical_processor_count_from_madt; + U32 core_logical_processor_count_from_madt[MAX_CORES]; + + PKG_PSTATES pkg_pstates; + + PKG_CSTATES pkg_mwait_cstates; + PKG_CSTATES pkg_io_cstates; + + PKG_TSTATES pkg_tstates; + + U32 package_cstate_limit; + U32 core_c1_supported; + U32 core_c2_supported; + U32 core_c3_supported; + U32 core_c4_supported; + U32 core_c6_supported; + U32 core_c7_supported; + U32 mwait_supported; + U32 acpi_support_cpuid_feature_flag; + U32 energy_perf_bias_supported; + + U64 package_power_limit; + U64 package_power_sku_unit; +} CPU_DETAILS; + +typedef struct socket_info { + U32 signature; + U32 socket_count; + CPU_DETAILS cpu[MAX_CPU_SOCKETS]; +} SOCKET_INFO; + +typedef struct lapic_info { + U32 processorId; + U32 apicId; + U32 pkg_index; + U32 core_apic_id; + U32 core_index; + PROCESSOR_NUMBER_TO_NAMESEG *namepath; + U32 madt_type; + U32 uid; +} LAPIC_INFO; + +typedef struct proc_info { + U32 processorId; + U32 apicId; +} PROC_INFO; + +typedef struct madt_info { + U32 lapic_count; + LAPIC_INFO lapic[MAX_LOGICAL_CPU]; +} MADT_INFO; + +typedef struct rsdt_info { + U32 proc_count; + PROC_INFO processor[MAX_LOGICAL_CPU]; +} RSDT_INFO; + +typedef struct smp_exit_state { + U32 signature; + + // Number of Failure or Informative codes included in the buffer + U32 error_code_count; + + // Buffer of Failure or Informative codes + U32 error_codes[10]; +} SMP_EXIT_STATE; + +typedef enum smp_exit_code { + // Generic successful + SMP_EXIT_CODE_OK = 1, + + // Generic failure + EXIT_CODE_FAILED = 2, + + // First logical processor for this socket unable to find available structure + EXIT_CODE_FAILED_SOCKET_PROXY_SAVE = 3, +} SMP_EXIT_CODE; + +typedef struct ppm_host { + U32 signature; + + U32 pstates_enabled; + U32 pstate_coordination; + U32 turbo_enabled; + U32 cstates_enabled; + U32 tstates_enabled; + U32 performance_per_watt; + + ACPI_TABLES acpi_tables; + + + RSDT_INFO rsdt_info; + MADT_INFO madt_info; + SOCKET_INFO skt_info; + + PPM_SETUP_OPTIONS *options; + + SMP_EXIT_STATE smp_exit_state; + + U32 detected_cpu_family; +} PPM_HOST; + +#endif // ppm_h diff --git a/i386/modules/AcpiCodec/include/.svn/text-base/ppmsetup.h.svn-base b/i386/modules/AcpiCodec/include/.svn/text-base/ppmsetup.h.svn-base new file mode 100644 index 0000000..061bbae --- /dev/null +++ b/i386/modules/AcpiCodec/include/.svn/text-base/ppmsetup.h.svn-base @@ -0,0 +1,371 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ppmsetup_h +#define ppmsetup_h + +#include "datatype.h" + +#define CURRENT_PPM_RCM_INTERFACE_SPECIFICATION 11 + +#ifndef nameseg_defined +#define nameseg_defined +#define NAMESEG(s) (((U32)(s[0]) << 0) \ + |((U32)(s[1]) << 8) \ + |((U32)(s[2]) << 16) \ + |((U32)(s[3]) << 24)) +#endif + +typedef enum ssdt_loc_flag { + // Flag indicating the SSDT ACPI structure should be built in a stack-based + // buffer. If the SSDT is successfully created, then the following occurs: + // (1) the RSDT ACPI structure is moved lower in memory and updated to + // include a pointer to the new SSDT. + // (2) the SSDT APCI structure is copied into memory just above the moved + // RSDT structure + // (3) the RSD ACPI structure is updated to included the new location of + // the just moved RSDT ACPI structure + // Note: The XSDT is not updated! + // + // NOTE: THIS OPTION WILL DEPRECATED AND REMOVED + // IN A FUTURE VERSION OF THIS SPECIFICATION. + SSDT_LOC_FLAG_ACPI_RECLAIM = 0, + + // Flag indicating the SSDT should be built directly in the memory region + // provided by the ssdt_mem_addr option parameter. + // If the SSDT is successfully created, then the following occurs: + // (1) the RSDT ACPI structure is moved lower in memory and updated to + // include a pointer to the new SSDT. + // (2) the RSD ACPI structure is updated to include the new location of the + // RSDT ACPI structure. + // Note: The XSDT is not updated! + // + // NOTE: THIS OPTION WILL DEPRECATED AND REMOVED + // IN A FUTURE VERSION OF THIS SPECIFICATION. + SSDT_LOC_FLAG_ADDR_PROVIDED = 1, + + // Flag indicating the SSDT should be built directly in the memory region + // provided by the ssdt_mem_addr option parameter. + // After SSDT is successfully created, no further processing occurs. + SSDT_LOC_FLAG_ADDR_PROVIDED_NO_INSERT = 2, + + // Flag indicating the SSDT should be built directly in the memory region + // provided by the ssdt_mem_addr option parameter. + // After SSDT is successfully created, then the following occurs: + // (1) the RSDT ACPI structure is not moved but is updated to + // include a 32-bit pointer to the new SSDT. + // (2) If the XSDT exists, it is not moved but is updated to + // include a 64-bit pointer to the new SSDT. + SSDT_LOC_FLAG_ADDR_PROVIDED_INSERT = 3, +} SSDT_LOC_FLAG; + +typedef enum exit_code { + // PPM RCM completed all initialization successfully + EXIT_CODE_PPM_COMPLETED = 1, + + // Failed building P-state table + EXIT_CODE_FAILED_BUILD_PSTATES = 2, + + EXIT_CODE_PPM_EIST_DISABLED = 3, + + // Failed to find ACPI tables + EXIT_CODE_FAILED_FIND_ACPI_TABLES = 4, + + // Failed to process the ACPI MADT structure + EXIT_CODE_FAILED_PROCESS_MADT = 5, + + // Failed to resolve ACPI MADT structure against available logical + // processors + EXIT_CODE_FAILED_PROCESS_MADT_INFO = 6, + + // Failed to build ACPI SSDT structure + EXIT_CODE_FAILED_PROCESS_SSDT = 7, + + // Failed to build and intialize HOST structure + EXIT_CODE_FAILED_HOST_INIT = 8, + + // Failed during wake of all NBSP to gather processor information + EXIT_CODE_FAILED_COLLECT_SOCKET_INFO = 9, + + // Failed to resolve target configuration between desired options and + // processor features + EXIT_CODE_FAILED_DETERMINE_CONFIGURATION = 0x0a, + + // No SSDT ACPI struture was created + EXIT_CODE_NO_SSDT_CREATED = 0x0b, + + // Failed to build Cstates correctly + EXIT_CODE_FAILED_BUILD_CSTATES = 0x0c, + + // Failed to build Tstates correctly + EXIT_CODE_FAILED_BUILD_TSTATES = 0x0d, + + // Failed to find package index of logical processor listed in MADT ACPI table + EXIT_CODE_FAILED_FIND_PKG_INDEX_FROM_LAPIC = 0x0e, + + // Failed with invalid input provided for SSDT location flag + EXIT_CODE_FAILED_INVALID_SSDT_LOCATION_FLAG = 0x0f, + + // Failed with no logical processors found in MADT + EXIT_CODE_FAILED_NO_LAPIC_FOUND_IN_MADT = 0x10, + + // Failed with SSDT size exceeded during SSDT creation + EXIT_CODE_FAILED_SSDT_SIZE_EXCEEDED = 0x11, + + // Failed to build ACPI SSDT structure + EXIT_CODE_FAILED_BUILD_SSDT = 0x12, + + // Failed with core index of logical processor listed in MADT ACPI table exceeding max + EXIT_CODE_MAX_CORES_EXCEEDED = 0x13, + + // Failed to find CPU Scope from array of ACPI processor number to ACPI CPU NameSeg structures + EXIT_CODE_FAILED_FIND_CPU_SCOPE_NAME_SEG = 0x14, + + // Failed to update FADT + EXIT_CODE_FAILED_UPDATE_FADT = 0x15, + + // GPF detected + EXIT_CODE_GPF_DETECTED = 0x16, + + // Failed with invalid SSDT buffer address + EXIT_CODE_INVALID_SSDT_ADDR = 0x17, + + // Failed with invalid SSDT buffer length + EXIT_CODE_INVALID_SSDT_LEN = 0x18, +} EXIT_CODE; + +typedef struct exit_state { + // 1 = success, 0 = failure + U32 return_status; + + // Number of Failure or Informative codes included in the buffer + U32 error_code_count; + + // Buffer of Failure or Informative codes + U32 error_codes[10]; + + // This 32-bit physical memory address specifies the final location for the + // SSDT ACPI structure built by the PPM RC. + U32 ssdt_mem_addr; + + // This value specifies the final size of the SSDT ACPI structure for the + // SSDT ACPI structure built by the PPM RC. + U32 ssdt_mem_size; + + // The final state for the P-state initialization + // 1=enabled; 0=disabled + U32 pstates_enabled; + + // The final state for the Turbo feature initialization + // 1=enabled; 0=disabled + U32 turbo_enabled; + + // The final state for the C-state initialization + // 1=enabled; 0=disabled + U32 cstates_enabled; + + // The final state for the T-state initialization + // 1=enabled; 0=disabled + U32 tstates_enabled; +} EXIT_STATE; + +typedef enum cpu_namespace_flag { + // Flag indicating the SSDT ACPI structure should be built + // using ACPI 1.0 compliant processor namespace "_PR" + CPU_NAMESPACE_PR = 0, + + // Flag indicating the SSDT ACPI structure should be built + // using ACPI 2.0+ compliant processor namespace "_SB" + CPU_NAMESPACE_SB = 1, +} CPU_NAMESPACE_FLAG; + +// Define the total number of required NameSegs to reach the DSDT processor +// device or object declarations +#define MAX_SUPPORTED_CPU_NAMESEGS 3 + +typedef struct processor_number_to_nameseg { + // Contains one of the ACPI processor ID values used in a + // ACPI Declare Processor statement in the DSDT or XSDT + U32 acpi_processor_number; + + // Number of NameSpace segments in NamePath to processor devices/objects + U32 seg_count; + + // Contains the corresponding ACPI Name Scope in the form + // of a series of NameSegs constituting the NamePath to a + // processor device or object declaration + U32 nameseg[MAX_SUPPORTED_CPU_NAMESEGS]; +} PROCESSOR_NUMBER_TO_NAMESEG; + +typedef struct ppm_setup_options { + // This 32-bit physical memory address specifies a read-write memory region + // below 1MB. Minimum size is 8KB. This memory is used by the callback as + // the SIPI target and stack for each AP. This region is not required to be + // cacheable. + U32 mem_region_below_1M; + + // Number of CPU sockets which exist on the platform + U32 num_sockets; + + // Desired state for the P-state initialization + // 1=enabled; 0=disabled + U32 pstates_enabled; + + // Desired state for the P-state hardware coordination + // ACPI_PSD_COORD_TYPE_SW_ALL = 0xFC + // ACPI_PSD_COORD_TYPE_SW_ANY = 0xFD + // ACPI_PSD_COORD_TYPE_HW_ALL = 0xFE + U32 pstate_coordination; + + // Desired state for the Turbo state initialization + // 1=enabled; 0=disabled + U32 turbo_enabled; + + // Desired state for the C-state initialization + // 1=enabled; 0=disabled + U32 cstates_enabled; + + // Desired state for the C1E initialization + // 1=enabled; 0=disabled + U32 c1e_enabled; + + // Desired state for the processor core C3 state included in the _CST + // 0= processor core C3 cannot be used as an ACPI C state + // 2= processor core C3 can be used as an ACPI C2 state + // 3= processor core C3 can be used as an ACPI C3 state + // 4= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else not used as ACPI C state + // 5= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else APIC C3 state + U32 c3_enabled; + + // Desired state for the processor core C6 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C6 can be used as an ACPI C3 state + // 0= processor core C6 cannot be used as an ACPI C3 state + U32 c6_enabled; + + // Desired state for the processor core C7 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C7 can be used as an ACPI C7 state + // 0= processor core C7 cannot be used as an ACPI C7 state + U32 c7_enabled; + + // Desired state for providing alternate ACPI _CST structure using MWAIT + // extensions + // 1= Alternate _CST using MWAIT extension is enabled for OSPM use + // 0= Alternate _CST using MWAIT extension is disabled for OSPM use + U32 mwait_enabled; + + // Power management base address used for processors + U32 pmbase; + + // Desired state for the C-state package limit. + // Note: The C-state package limit may be further limited by the + // capabilities of the processor + // 000b = C0 (No package C-state support) + // 001b = C1 (Behavior is the same as 000b) + // 010b = C3 + // 011b = C6 + // 100b = C7 + // 111b = No package C-state limit + U32 package_cstate_limit; + + // Desired state for the T-state initialization + // 1=enabled; 0=disabled + U32 tstates_enabled; + + // This 32-bit physical memory address specifies a read-write memory region + // for the SSDT ACPI structure built by the PPM RC. Minimum size is 16KB. + U32 ssdt_mem_addr; + + // This value specifies the size of the SSDT memory region. Minimum size is + // 16KB. + U32 ssdt_mem_size; + + // This value specifies the PPM RCM behavior related to creation and + // incorporation of the new SSDT ACPI structure. See definition of the + // SSDT_LOC_FLAG for acceptable values. + U32 ssdt_loc_flag; + + // This value specifies the PPM RCM behavior related to creation and + // incorporation of the new SSDT ACPI structure. If all power management + // features are disabled by input options, the SSDT can still be created + // for debug review. + // 1 = Create SSDT even if all power management features are disabled + // 0 = Do not create SSDT if all power management features are disabled + U32 ssdt_force_creation; + + // Exit structure intended to convey state to the caller and/or subsequent + // init code + EXIT_STATE exit_state; + + // Flag indicating the processor namespace that should be used in the + // SSDT ACPI structure for each CPU. + // See definition of the CPU_NAMESPACE_FLAG for acceptable values. + U32 cpu_namespace_flag; + + // This version number identifies the PPM RCM specification. + // Specifically denotes the version of this structure definition is compliant + // with with file nehalem-ppm-rcm-vX.txt where X is the version number. + // PPMSETUP.C should always use the version definition from the top of + // this file called CURRENT_PPM_RCM_INTERFACE_SPECIFICATION. + U32 ppm_rcm_interface_specification; + + // This flag indicates whether or not after all AP Wakes are completed, + // that the AP should be forced to jump to the real mode address specified + // in the realmode_callback_address field below. + // realmode_callback = 0 means leave AP in INIT or Wait For SIPI (WFS) state + // realmode_callback = 1 means AP should jump to real mode address specified below + U32 realmode_callback_flag; + + // This file contains the real mode callback address which AP must jump to after + // INIT_SIPI_SIPI sequences used to force AP initalization for PPM. + // Upper 16-bits specify target real mode segment for a far 16-bit jump instruction + // Lower 16-bits specify target real mode offset for a far 16-bit jump instruction + U32 realmode_callback_address; + + // Number of ACPI processor number to ACPI CPU NameSeg structures + U32 cpu_map_count; + + // Array of ACPI processor number to ACPI CPU NameSeg structures + PROCESSOR_NUMBER_TO_NAMESEG *cpu_map; + + // This flag indicates whether or not PPM RC should update an existing ACPI FADT. + // modify_fadt_flag = 0 means do not modify existing ACPI FADT structure + // modify_fadt_flag = 1 means do check and if needed, modify existing ACPI FADT structure + U32 modify_fadt_flag; + + // Desired state for the performance_per_watt optimizations + // performance_per_watt = 2 means "Low Power" + // performance_per_watt = 1 means "Power Optimized or Power Balanced" + // performance_per_watt = 0 means "Traditional or Max Performance" + U32 performance_per_watt; +} PPM_SETUP_OPTIONS; + +#endif // ppmsetup_h diff --git a/i386/modules/AcpiCodec/include/acpi.h b/i386/modules/AcpiCodec/include/acpi.h new file mode 100644 index 0000000..1d9c30d --- /dev/null +++ b/i386/modules/AcpiCodec/include/acpi.h @@ -0,0 +1,25 @@ +#ifndef __LIBSAIO_ACPI_H +#define __LIBSAIO_ACPI_H + +#include "acpi_tools.h" + +#define ACPI_RANGE_START (0x0E0000) +#define ACPI_RANGE_END (0x0FFFFF) + + +#define Unspecified 0 +#define Desktop 1 +#define Mobile 2 +#define Workstation 3 +#define EnterpriseServer 4 +#define SOHOServer 5 +#define AppliancePC 6 +#define PerformanceServer 7 + +#define MaxSupportedPMProfile PerformanceServer // currently max profile supported +#define PMProfileError MaxSupportedPMProfile + 1 + +#define kAcpiMethod "Acpi2Method" // 2 (= method 2) for some machines that may hang on acpi 2 (aka acpi 64 bit) detection (replace the old kUnsafeACPI "UnsafeACPI") + + +#endif /* !__LIBSAIO_ACPI_H */ diff --git a/i386/modules/AcpiCodec/include/acpi_codec.h b/i386/modules/AcpiCodec/include/acpi_codec.h new file mode 100755 index 0000000..fad5810 --- /dev/null +++ b/i386/modules/AcpiCodec/include/acpi_codec.h @@ -0,0 +1,77 @@ +/* + * Copyright 2008 mackerintel + */ + +/* + * Copyright (c) 2011 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#ifndef __LIBSAIO_ACPI_CODEC_H +#define __LIBSAIO_ACPI_CODEC_H + +#include "libsaio.h" +#include "efi.h" + +#define OEMOPT_TEMPLATE "oemXXXX" +#define OEMOPT_SIZE sizeof(OEMOPT_TEMPLATE) + +#define kOEMDSDT "oemDSDT" /* acpi_codec.c */ +#define kOEMFADT "oemFADT" /* acpi_codec.c */ +#define kOEMAPIC "oemAPIC" /* acpi_codec.c */ + +#define KIntelFADT "IntelFADTSpec" /* acpi_codec.c */ + +#define kSTRIPAPIC "StripAPICTable" /* acpi_codec.c */ + +#define kRestartFix "RestartFix" /* acpi_codec.c */ +#define KResetType "ResetType" /* acpi_codec.c */ +#define PCI_RESET_TYPE 0 // (default) +#define KEYBOARD_RESET_TYPE 1 + +#define kGeneratePStates "GeneratePStates" /* acpi_codec.c */ +#define kGenerateCStates "GenerateCStates" /* acpi_codec.c */ +#define kGenerateTStates "GenerateTStates" /* acpi_codec.c */ + +#define kMaxRatio "MaxBusRatio" /* acpi_codec.c */ +#define kMinRatio "MinBusRatio" /* acpi_codec.c */ +#define kSpeedstep "EnableSpeedStep" /* acpi_codec.c */ +#define kEnableC2State "EnableC2State" /* acpi_codec.c */ +#define kEnableC3State "EnableC3State" /* acpi_codec.c */ +#define kEnableC4State "EnableC4State" /* acpi_codec.c */ +#define kEnableC6State "EnableC6State" /* acpi_codec.c */ +#define kEnableC7State "EnableC7State" /* acpi_codec.c */ +#define KEnableMwait "EnableMwait" /* acpi_codec.c */ +#define KForceSSDT "ForceGenSSDT" /* acpi_codec.c */ +#define KAcpiCoordType "PstateCoordination" /* acpi_codec.c */ +#define kCoreTurbo "EnableTurbo" /* acpi_codec.c */ + +#define kUpdateACPI "UpdateACPI" /* acpi_codec.c */ +//#define kUnsafeACPI "UnsafeACPI" /* acpi_codec.c */ // DEPRECATED, replaced by nacpi=0x2000 + +#define kOnlySignedAml "LoadSignedAmlOnly" /* acpi_codec.c */ + +#if UNUSED +#define kGenerateFACS "GenerateFACS" /* acpi_codec.c */ +#define kOEMFACS "oemFACS" /* acpi_codec.c */ +#endif + +extern int AcpiSetup(void); + +struct p_state +{ + union + { + uint16_t Control; + struct + { + uint8_t VID; // Voltage ID + uint8_t FID; // Frequency ID + }; + }; + + uint8_t CID; // Compare ID + uint32_t Frequency; +}; + +#endif /* !__LIBSAIO_ACPI_CODEC_H */ diff --git a/i386/modules/AcpiCodec/include/acpi_tools.h b/i386/modules/AcpiCodec/include/acpi_tools.h new file mode 100755 index 0000000..86b8e84 --- /dev/null +++ b/i386/modules/AcpiCodec/include/acpi_tools.h @@ -0,0 +1,41 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef acpi_tools_h +#define acpi_tools_h + +#include "datatype.h" +#include "intel_acpi.h" +#include "ppm.h" + +U32 get_num_tables(ACPI_TABLE_RSDT * rsdt); +U32 get_num_tables64(ACPI_TABLE_XSDT * xsdt); +U32 FindAcpiTables(ACPI_TABLES * acpi_tables); +U8 GetChecksum(void *mem_addr, U32 mem_size); + +#endif // acpi_tools_h diff --git a/i386/modules/AcpiCodec/include/acpicode.h b/i386/modules/AcpiCodec/include/acpicode.h new file mode 100644 index 0000000..eef945d --- /dev/null +++ b/i386/modules/AcpiCodec/include/acpicode.h @@ -0,0 +1,75 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef acpi_code_h +#define acpi_code_h + +#include "datatype.h" +#include "acpi.h" +#include "ppm.h" + +void setRsdpchecksum(ACPI_TABLE_RSDP *rsdp); +void setRsdpXchecksum(ACPI_TABLE_RSDP *rsdp); +U32 update_rsdp_with_xsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_XSDT *xsdt); +U32 update_rsdp_with_rsdt(ACPI_TABLE_RSDP *rsdp, ACPI_TABLE_RSDT *rsdt); + +void SetChecksum(struct acpi_table_header *header); +U32 ProcessMadtInfo(ACPI_TABLE_MADT * madt, MADT_INFO * madt_info); +void MoveRsdtInsertSsdt(ACPI_TABLE_RSDP * RsdPointer, ACPI_TABLE_RSDT * OldRsdtPointer, ACPI_TABLE_RSDT * NewRsdtPointer, ACPI_TABLE_SSDT * SsdtPointer); +void InsertSsdt(ACPI_TABLE_RSDT * RsdtPointer, ACPI_TABLE_SSDT * SsdtPointer); +void InsertSsdt64(ACPI_TABLE_XSDT * XsdtPointer, ACPI_TABLE_SSDT * SsdtPointer); +U32 ProcessFadt(ACPI_TABLE_FADT * FadtPointer, U32 pmbase); +U32 ProcessDsdt(ACPI_TABLE_DSDT * DsdtPointer, U8 * PCIUIDPointer, U8 uid); + +void setByteConst(ACPI_BYTE_CONST * byteConst, U8 byteData); +void *buildByteConst(void *current, U8 byteData); +void setWordConst(ACPI_WORD_CONST * wordConst, U16 wordData); +void *buildWordConst(void *current, U16 wordData); +void setDwordConst(ACPI_DWORD_CONST * dwordConst, U32 dwordData); +void *buildDwordConst(void *current, U32 dwordData); +void *buildSmallBuffer(void *current); +void *buildEndTag(void *current); +void *buildGenericRegister(void *current, const ACPI_GENERIC_ADDRESS * gas); + +void *buildSmallMethod(void *current, U32 name, U8 methodFlags); +void *buildMethod(void *current, U32 name, U8 methodFlags); +void *buildReturnZero(void *current); +void *buildReturnOpcode(void *current, U8 opcodeToReturn); +void *buildReturnPackage(void *current, U8 numElements); +void *buildNamedDword(void *current, U32 name, U32 dword); +void *buildOpCode(void *current, U8 opCode); + +void *buildNameSeg(void *current, U32 name); +void setSmallPackage(ACPI_SMALL_PACKAGE * package, U8 numElements); +void *buildSmallPackage(void *current, U8 numElements); +void setPackageLength(ACPI_PACKAGE_LENGTH * packageLength, U32 length); +void *buildPackageLength(void *current, U32 Length); +void *buildNamePath(void *current, U32 name); +void *buildTableHeader(void *current, U32 signature, U64 oemTableId); + +#endif // acpi_code_h diff --git a/i386/modules/AcpiCodec/include/acpidecode.h b/i386/modules/AcpiCodec/include/acpidecode.h new file mode 100755 index 0000000..5963af9 --- /dev/null +++ b/i386/modules/AcpiCodec/include/acpidecode.h @@ -0,0 +1,69 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ACPI_DECODE_H +#define ACPI_DECODE_H + +#include "acpi_tools.h" + +/* acpidecode.h contains functions needed only for decoding ACPI to produce the + * inputs to the PPM code, but not needed for encoding ACPI as done inside the + * PPM code. */ + +#define ACPI_NAMESPACE_MAX_DEPTH 10 + +struct acpi_namespace { + U32 nameseg[ACPI_NAMESPACE_MAX_DEPTH]; + U32 depth; +}; + +void dprint_nameseg(U32 i); +void *decodeTableHeader(void *current, ACPI_TABLE_HEADER ** tableHeader); +void parse_acpi_termlist(const struct acpi_namespace *ns, U8 * current, U8 * end); + +/* Globals used for retrieving ACPI processor structures from the DSDT */ + +#define CPU_MAP_LIMIT 256 /* Any bigger than 256 and we'd have to support the x2APIC structures, which we don't yet anyway. */ + +struct acpi_processor { + struct acpi_namespace ns; + U8 id; + U32 pmbase; +}; + +extern U32 acpi_processor_count; +extern struct acpi_processor acpi_processors[CPU_MAP_LIMIT]; + +#if UNUSED +/* If 0, look for a processor namespace and set to 1 if found. */ +extern U32 acpi_ns_found; +#endif + +extern U8* UIDPointer; + +#endif /* ACPI_DECODE_H */ diff --git a/i386/modules/AcpiCodec/include/datatype.h b/i386/modules/AcpiCodec/include/datatype.h new file mode 100755 index 0000000..d6cd5cc --- /dev/null +++ b/i386/modules/AcpiCodec/include/datatype.h @@ -0,0 +1,54 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef DATATYPE_H +#define DATATYPE_H + +#include "libsa.h" + +typedef uint8_t U8; +typedef uint16_t U16; +typedef uint32_t U32; +typedef uint64_t U64; + +#if 0 +typedef uint32_t bool; +#ifndef false +#define true 1 +#endif + +#ifndef false +#define false 0 +#endif + +#ifndef NULL +#define NULL ((void *) 0) +#endif +#endif + +#endif /* DATATYPE_H */ diff --git a/i386/modules/AcpiCodec/include/intel_acpi.h b/i386/modules/AcpiCodec/include/intel_acpi.h new file mode 100755 index 0000000..9dc9351 --- /dev/null +++ b/i386/modules/AcpiCodec/include/intel_acpi.h @@ -0,0 +1,692 @@ +/* Per ACPI 3.0a spec */ + +/* + Copyright (c) 2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __LIBSAIO_INTEL_ACPI_H +#define __LIBSAIO_INTEL_ACPI_H + +#include "datatype.h" +#include "ppmsetup.h" +// +// All tables and structures must be byte-packed to match the ACPI specification +//#pragma pack(1) + +#define ACPI_SIG_DSDT "DSDT" // Differentiated System Description Table +#define ACPI_SIG_FADT "FACP" // Fixed ACPI Description Table +#define ACPI_SIG_FACS "FACS" // Firmware ACPI Control Structure +#define ACPI_SIG_PSDT "PSDT" // Persistent System Description Table +#define ACPI_SIG_RSDP "RSD PTR " // Root System Description Pointer +#define ACPI_SIG_RSDT "RSDT" // Root System Description Table +#define ACPI_SIG_XSDT "XSDT" // Extended System Description Table +#define ACPI_SIG_SSDT "SSDT" // Secondary System Description Table +#define ACPI_RSDP_NAME "RSDP" // Short name for RSDP, not signature +#define ACPI_SIG_MADT "APIC" // Multiple APIC Description Table +#define ACPI_SIG_SBST "SBST" // Smart Battery Specification Table +#define ACPI_SIG_ECDT "ECDT" // Embedded Controller Boot Resources Table +#define ACPI_SIG_ASF "ASF!" // Alert Standard Format table +#define ACPI_SIG_DMAR "DMAR" // DMA Remapping table +#define ACPI_SIG_HPET "HPET" // High Precision Event Timer table +#define ACPI_SIG_MCFG "MCFG" // PCI Memory Mapped Configuration table +#define ACPI_SIG_UEFI "UEFI" // Uefi Boot Optimization Table + + +#ifndef nameseg_defined +#define nameseg_defined +#define NAMESEG(s) (((U32)(s[0]) << 0) \ +|((U32)(s[1]) << 8) \ +|((U32)(s[2]) << 16) \ +|((U32)(s[3]) << 24)) +#endif + +#define NAMESEG64(s) (((U64)(s[0]) << 0) \ +|((U64)(s[1]) << 8) \ +|((U64)(s[2]) << 16) \ +|((U64)(s[3]) << 24) \ +|((U64)(s[4]) << 32) \ +|((U64)(s[5]) << 40) \ +|((U64)(s[6]) << 48) \ +|((U64)(s[7]) << 56)) \ + + +// Data Objects Encoding values. +#define AML_EXT_OP_PREFIX 0x5B + +// Name Space Modifier Objects Encoding values. +#define AML_NAME_OP 0x08 // Name operator. +#define AML_SCOPE_OP 0x10 // Scope operator. + +// Named Objects Encoding values. +#define AML_MUTEX_OP 0x01 +#define AML_METHOD_OP 0x14 // Method operator. +#define AML_OPREGION_OP 0x80 // Operation Region operator. +#define AML_FIELD_OP 0x81 +#define AML_DEVICE_OP 0x82 +#define AML_PROCESSOR_OP 0x83 // Processor operator. + +// Type2 Opcodes Encoding values. +#define AML_NULL_NAME 0x00 +#define AML_ZERO_OP 0x00 +#define AML_ALIAS_OP 0x06 +#define AML_ONE_OP 0x01 +#define AML_BYTE_OP 0x0a +#define AML_WORD_OP 0x0b +#define AML_DWORD_OP 0x0c +#define AML_STRING_OP 0x0d +#define AML_QWORD_OP 0x0e +#define AML_BUFFER_OP 0x11 +#define AML_PACKAGE_OP 0x12 +#define AML_COND_REF_OF_OP 0x12 // Requires AML_EXT_OP_PREFIX +#define AML_CREATE_FIELD_OP 0x13 // Requires AML_EXT_OP_PREFIX +#define AML_DUAL_NAME_PREFIX 0x2e +#define AML_MULTI_NAME_PREFIX 0x2f +#define AML_REVISION_OP 0x30 // Requires AML_EXT_OP_PREFIX +#define AML_DEBUG_OP 0x31 +#define AML_ROOT_PREFIX 0x5c +#define AML_PARENT_PREFIX 0x5e +#define AML_LOCAL0_OP 0x60 +#define AML_LOCAL1_OP 0x61 +#define AML_LOCAL2_OP 0x62 +#define AML_LOCAL3_OP 0x63 +#define AML_LOCAL4_OP 0x64 +#define AML_LOCAL5_OP 0x65 +#define AML_LOCAL6_OP 0x66 +#define AML_LOCAL7_OP 0x67 +#define AML_ARG0_OP 0x68 +#define AML_ARG1_OP 0x69 +#define AML_ARG2_OP 0x6A +#define AML_ARG3_OP 0x6B +#define AML_ARG4_OP 0x6C +#define AML_ARG5_OP 0x6D +#define AML_ARG6_OP 0x6E +#define AML_STORE_OP 0x70 +#define AML_CONCAT_OP 0x73 +#define AML_SUBTRACT_OP 0x74 +#define AML_MULTIPLY_OP 0x77 +#define AML_AND_OP 0x7B +#define AML_END_TAG_OP 0x79 +#define AML_GEN_REG_FIELD 0x82 +#define AML_PROCESSOR_OP 0x83 +#define AML_INDEXFIELD_OP 0x86 // Requires AML_EXT_OP_PREFIX +#define AML_SIZEOF_OP 0x87 +#define AML_INDEX_OP 0x88 +#define AML_CREATE_DWORD_FIELD_OP 0x8A +#define AML_LAND_OP 0x90 +#define AML_LOR_OP 0x91 +#define AML_LNOT_OP 0x92 +#define AML_LEQUAL_OP 0x93 +#define AML_LGREATER_OP 0x94 +#define AML_LLESS_OP 0x95 +#define AML_IF_OP 0xA0 +#define AML_ELSE_OP 0xA1 +#define AML_RETURN_OP 0xA4 +#define AML_ONES_OP 0xFF + +#define GAS_TYPE_FFH 0x7f +#define GAS_TYPE_SYSTEM_IO 0x01 +#define GAS_VENDOR_INTEL 0x01 +#define GAS_CLASS_CODE_NATIVE 0x02 + +// Define the Generic System Description Table Structure. +// This common header is used by all tables except the RSDP and FACS. +// The define is used for direct inclusion of header into other ACPI tables +typedef struct acpi_table_header { + U8 Signature[4]; // ASCII table signature + U32 Length; // Length of table in bytes, including this header + U8 Revision; // ACPI Specification minor version # + U8 Checksum; // To make checksum of entire table == 0 + U8 OemId[6]; // ASCII OEM identification + U8 OemTableId[8]; // ASCII OEM table identification + U32 OemRevision; // OEM revision number + U8 AslCompilerId[4]; // ASCII ASL compiler vendor ID + U32 AslCompilerRevision; // ASL compiler version +} __attribute__((packed))ACPI_TABLE_HEADER; + +// GAS - Generic Address Structure (ACPI 2.0+) +typedef struct acpi_generic_address { + U8 SpaceId; // Address space where struct or register exists + U8 BitWidth; // Size in bits of given register + U8 BitOffset; // Bit offset within the register + U8 AccessWidth; // Minimum Access size (ACPI 3.0) + U64 Address; // 64-bit address of struct or register +} __attribute__((packed))ACPI_GENERIC_ADDRESS; + +// RSDP - Root System Description Pointer (Signature is "RSD PTR ") +typedef struct acpi_table_rsdp { + U8 Signature[8]; // ACPI signature, contains "RSD PTR " + U8 Checksum; // ACPI 1.0 checksum + U8 OemId[6]; // OEM identification + U8 Revision; // Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ + U32 RsdtPhysicalAddress; // 32-bit physical address of the RSDT + U32 Length; // Table length in bytes, including header (ACPI 2.0+) + U64 XsdtPhysicalAddress; // 64-bit physical address of the XSDT (ACPI 2.0+) + U8 ExtendedChecksum; // Checksum of entire table (ACPI 2.0+) + U8 Reserved[3]; // Reserved, must be zero +} __attribute__((packed))ACPI_TABLE_RSDP; + +#define ACPI_RSDP_REV0_SIZE 20 // Size of original ACPI 1.0 RSDP + +// RSDT - Root System Description Table +typedef struct acpi_table_rsdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 TableOffsetEntry[1]; // Array of pointers to ACPI tables +} __attribute__((packed))ACPI_TABLE_RSDT; + + +// XSDT - Root System Description Table +typedef struct acpi_table_xsdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U64 TableOffsetEntry[1]; // Array of pointers to ACPI tables +} __attribute__((packed))ACPI_TABLE_XSDT; + +// DSDT - Differentiated System Description Table +typedef struct acpi_table_dsdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 EntryStart; +} __attribute__((packed))ACPI_TABLE_DSDT; + +// FACS - Firmware ACPI Control Structure (FACS) +typedef struct acpi_table_facs { + U8 Signature[4]; // ASCII table signature + U32 Length; // Length of structure, in bytes + U32 HardwareSignature; // Hardware configuration signature + U32 FirmwareWakingVector; // 32-bit physical address of the Firmware Waking Vector + U32 GlobalLock; // Global Lock for shared hardware resources + U32 Flags; + U64 XFirmwareWakingVector; // 64-bit version of the Firmware Waking Vector (ACPI 2.0+) + U8 Version; // Version of this table (ACPI 2.0+) + U8 Reserved[31]; // Reserved, must be zero +} __attribute__((packed))ACPI_TABLE_FACS; + +// SBST - Smart Battery Specification Table - Version 1 +typedef struct acpi_table_sbst +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U32 WarningLevel; + U32 LowLevel; + U32 CriticalLevel; + +} __attribute__((packed))ACPI_TABLE_SBST; + +// ASF - Alert Standard Format table (Signature "ASF!") +typedef struct acpi_table_asf +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_ASF; + +// DMAR - DMA Remapping table - Version 1 +typedef struct acpi_table_dmar +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U8 Width; /* Host Address Width */ + U8 Flags; + U8 Reserved[10]; + +} __attribute__((packed))ACPI_TABLE_DMAR; + +// HPET - High Precision Event Timer table - Version 1 +typedef struct acpi_table_hpet +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U32 Id; /* Hardware ID of event timer block */ + ACPI_GENERIC_ADDRESS Address; /* Address of event timer block */ + U8 Sequence; /* HPET sequence number */ + U16 MinimumTick; /* Main counter min tick, periodic mode */ + U8 Flags; + +} __attribute__((packed))ACPI_TABLE_HPET; + +//MCFG - PCI Memory Mapped Configuration table and sub-table - Version 1 +typedef struct acpi_table_mcfg +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U8 Reserved[8]; + +} ACPI_TABLE_MCFG; + +//UEFI - UEFI Boot optimization Table - Version 1 +typedef struct acpi_table_uefi +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + U8 Identifier[16]; /* UUID identifier */ + U16 DataOffset; /* Offset of remaining data in table */ + +} __attribute__((packed))ACPI_TABLE_UEFI; + +// ECDT - Embedded Controller Boot Resources Table - Version 1 +typedef struct acpi_table_ecdt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register */ + ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */ + U32 Uid; /* Unique ID - must be same as the EC _UID method */ + U8 Gpe; /* The GPE for the EC */ + U8 Id[1]; /* Full namepath of the EC in the ACPI namespace */ + +} __attribute__((packed))ACPI_TABLE_ECDT; + +// FADT - Fixed ACPI Description Table (Signature "FACP") +typedef struct acpi_table_fadt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 Facs; // 32-bit physical address of FACS + U32 Dsdt; // 32-bit physical address of DSDT + U8 Model; // System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ + U8 PreferredProfile; // Conveys preferred power management profile to OSPM. + U16 SciInterrupt; // System vector of SCI interrupt + U32 SmiCommand; // 32-bit Port address of SMI command port + U8 AcpiEnable; // Value to write to smi_cmd to enable ACPI + U8 AcpiDisable; // Value to write to smi_cmd to disable ACPI + U8 S4BiosRequest; // Value to write to SMI CMD to enter S4BIOS state + U8 PstateControl; // Processor performance state control + U32 Pm1aEventBlock; // 32-bit Port address of Power Mgt 1a Event Reg Blk + U32 Pm1bEventBlock; // 32-bit Port address of Power Mgt 1b Event Reg Blk + U32 Pm1aControlBlock; // 32-bit Port address of Power Mgt 1a Control Reg Blk + U32 Pm1bControlBlock; // 32-bit Port address of Power Mgt 1b Control Reg Blk + U32 Pm2ControlBlock; // 32-bit Port address of Power Mgt 2 Control Reg Blk + U32 PmTimerBlock; // 32-bit Port address of Power Mgt Timer Ctrl Reg Blk + U32 Gpe0Block; // 32-bit Port address of General Purpose Event 0 Reg Blk + U32 Gpe1Block; // 32-bit Port address of General Purpose Event 1 Reg Blk + U8 Pm1EventLength; // Byte Length of ports at Pm1xEventBlock + U8 Pm1ControlLength; // Byte Length of ports at Pm1xControlBlock + U8 Pm2ControlLength; // Byte Length of ports at Pm2ControlBlock + U8 PmTimerLength; // Byte Length of ports at PmTimerBlock + U8 Gpe0BlockLength; // Byte Length of ports at Gpe0Block + U8 Gpe1BlockLength; // Byte Length of ports at Gpe1Block + U8 Gpe1Base; // Offset in GPE number space where GPE1 events start + U8 CstControl; // Support for the _CST object and C States change notification + U16 C2Latency; // Worst case HW latency to enter/exit C2 state + U16 C3Latency; // Worst case HW latency to enter/exit C3 state + U16 FlushSize; // Processor's memory cache line width, in bytes + U16 FlushStride; // Number of flush strides that need to be read + U8 DutyOffset; // Processor duty cycle index in processor's P_CNT reg + U8 DutyWidth; // Processor duty cycle value bit width in P_CNT register. + U8 DayAlarm; // Index to day-of-month alarm in RTC CMOS RAM + U8 MonthAlarm; // Index to month-of-year alarm in RTC CMOS RAM + U8 Century; // Index to century in RTC CMOS RAM + U16 BootFlags; // IA-PC Boot Architecture Flags. See Table 5-10 for description + U8 Reserved; // Reserved, must be zero + U32 Flags; // Miscellaneous flag bits (see below for individual flags) + ACPI_GENERIC_ADDRESS ResetRegister; // 64-bit address of the Reset register + U8 ResetValue; // Value to write to the ResetRegister port to reset the system + U8 Reserved4[3]; // Reserved, must be zero + U64 XFacs; // 64-bit physical address of FACS + U64 XDsdt; // 64-bit physical address of DSDT + ACPI_GENERIC_ADDRESS XPm1aEventBlock; // 64-bit Extended Power Mgt 1a Event Reg Blk address + ACPI_GENERIC_ADDRESS XPm1bEventBlock; // 64-bit Extended Power Mgt 1b Event Reg Blk address + ACPI_GENERIC_ADDRESS XPm1aControlBlock; // 64-bit Extended Power Mgt 1a Control Reg Blk address + ACPI_GENERIC_ADDRESS XPm1bControlBlock; // 64-bit Extended Power Mgt 1b Control Reg Blk address + ACPI_GENERIC_ADDRESS XPm2ControlBlock; // 64-bit Extended Power Mgt 2 Control Reg Blk address + ACPI_GENERIC_ADDRESS XPmTimerBlock; // 64-bit Extended Power Mgt Timer Ctrl Reg Blk address + ACPI_GENERIC_ADDRESS XGpe0Block; // 64-bit Extended General Purpose Event 0 Reg Blk address + ACPI_GENERIC_ADDRESS XGpe1Block; // 64-bit Extended General Purpose Event 1 Reg Blk address +} __attribute__((packed))ACPI_TABLE_FADT; + +// SSDT - Secondary System Description Table +typedef struct acpi_table_ssdt { + ACPI_TABLE_HEADER Header; // Common ACPI table header +} __attribute__((packed))ACPI_TABLE_SSDT; + +//MADT - Multiple APIC Description Table +typedef struct acpi_table_madt { + ACPI_TABLE_HEADER Header; // Common ACPI table header + U32 Address; // Physical address of local APIC + U32 Flags; +} __attribute__((packed))ACPI_TABLE_MADT; + + +// Values for subtable type in ACPI_SUBTABLE_HEADER +enum AcpiMadtType { + ACPI_MADT_TYPE_LOCAL_APIC = 0, + ACPI_MADT_TYPE_IO_APIC = 1, + ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, + ACPI_MADT_TYPE_NMI_SOURCE = 3, + ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, + ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, + ACPI_MADT_TYPE_IO_SAPIC = 6, + ACPI_MADT_TYPE_LOCAL_SAPIC = 7, + ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, + ACPI_MADT_TYPE_X2APIC = 9, + ACPI_MADT_TYPE_RESERVED = 10 // 10 and greater are reserved +}; + +// Common Sub-table header (used in MADT, SRAT, etc.) +typedef struct acpi_subtable_header { + U8 Type; + U8 Length; +} __attribute__((packed))ACPI_SUBTABLE_HEADER; + +// MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER + +// 0: Processor Local APIC +typedef struct acpi_madt_local_apic { + ACPI_SUBTABLE_HEADER Header; + U8 ProcessorId; // ACPI processor id + U8 Id; // Processor's local APIC id + U32 LapicFlags; +} __attribute__((packed))ACPI_MADT_LOCAL_APIC; + +// 1: IO APIC +typedef struct acpi_madt_io_apic { + ACPI_SUBTABLE_HEADER Header; + U8 Id; // I/O APIC ID + U8 Reserved; // Reserved - must be zero + U32 Address; // APIC physical address + U32 GlobalIrqBase; // Global system interrupt where INTI lines start +} __attribute__((packed))ACPI_MADT_IO_APIC; + +// 2: Interrupt Override +typedef struct acpi_madt_interrupt_override { + ACPI_SUBTABLE_HEADER Header; + U8 Bus; // 0 - ISA + U8 SourceIrq; // Interrupt source (IRQ) + U32 GlobalIrq; // Global system interrupt + U16 IntiFlags; +} __attribute__((packed))ACPI_MADT_INTERRUPT_OVERRIDE; + +// 3: NMI Source +typedef struct acpi_madt_nmi_source { + ACPI_SUBTABLE_HEADER Header; + U16 IntiFlags; + U32 GlobalIrq; // Global system interrupt +} __attribute__((packed))ACPI_MADT_NMI_SOURCE; + +// 4: Local APIC NMI +typedef struct acpi_madt_local_apic_nmi { + ACPI_SUBTABLE_HEADER Header; + U8 ProcessorId; // ACPI processor id + U16 IntiFlags; + U8 Lint; // LINTn to which NMI is connected +} __attribute__((packed))ACPI_MADT_LOCAL_APIC_NMI; + +// 5: Address Override +typedef struct acpi_madt_local_apic_override { + ACPI_SUBTABLE_HEADER Header; + U16 Reserved; // Reserved, must be zero + U64 Address; // APIC physical address +} __attribute__((packed))ACPI_MADT_LOCAL_APIC_OVERRIDE; + +// 6: I/O Sapic +typedef struct acpi_madt_io_sapic { + ACPI_SUBTABLE_HEADER Header; + U8 Id; // I/O SAPIC ID + U8 Reserved; // Reserved, must be zero + U32 GlobalIrqBase; // Global interrupt for SAPIC start + U64 Address; // SAPIC physical address +} __attribute__((packed))ACPI_MADT_IO_SAPIC; + +// 7: Local Sapic +typedef struct acpi_madt_local_sapic { + ACPI_SUBTABLE_HEADER Header; + U8 ProcessorId; // ACPI processor id + U8 Id; // SAPIC ID + U8 Eid; // SAPIC EID + U8 Reserved[3]; // Reserved, must be zero + U32 LapicFlags; + U32 Uid; // Numeric UID - ACPI 3.0 + char UidString[1]; // String UID - ACPI 3.0 +} __attribute__((packed))ACPI_MADT_LOCAL_SAPIC; + +// 8: Platform Interrupt Source +typedef struct acpi_madt_interrupt_source { + ACPI_SUBTABLE_HEADER Header; + U16 IntiFlags; + U8 Type; // 1=PMI, 2=INIT, 3=corrected + U8 Id; // Processor ID + U8 Eid; // Processor EID + U8 IoSapicVector; // Vector value for PMI interrupts + U32 GlobalIrq; // Global system interrupt + U32 Flags; // Interrupt Source Flags +} __attribute__((packed))ACPI_MADT_INTERRUPT_SOURCE; + +// 9: Processor X2APIC +typedef struct acpi_madt_x2apic { + ACPI_SUBTABLE_HEADER Header; + U16 Reserved; // Must be zero + U32 x2apicId; // Processor's X2APIC ID + U32 x2apicFlags; + U32 UID; +} __attribute__((packed))ACPI_MADT_X2APIC; + +// Common flags fields for MADT subtables + +// MADT Local APIC flags (LapicFlags) +#define ACPI_MADT_ENABLED (1) // 00: Processor is usable if set + +// MADT MPS INTI flags (IntiFlags) +#define ACPI_MADT_POLARITY_MASK (3) // 00-01: Polarity of APIC I/O input signals +#define ACPI_MADT_TRIGGER_MASK (3<<2) // 02-03: Trigger mode of APIC input signals + +// Values for MPS INTI flags +#define ACPI_MADT_POLARITY_CONFORMS 0 +#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1 +#define ACPI_MADT_POLARITY_RESERVED 2 +#define ACPI_MADT_POLARITY_ACTIVE_LOW 3 + +#define ACPI_MADT_TRIGGER_CONFORMS (0) +#define ACPI_MADT_TRIGGER_EDGE (1<<2) +#define ACPI_MADT_TRIGGER_RESERVED (2<<2) +#define ACPI_MADT_TRIGGER_LEVEL (3<<2) + +#define ACPI_COORD_TYPE_SW_ALL 0xFC +#define ACPI_COORD_TYPE_SW_ANY 0xFD +#define ACPI_COORD_TYPE_HW_ALL 0xFE + +typedef struct packageLength { + U8 packageLength0; + U8 packageLength1; +} __attribute__((packed))ACPI_PACKAGE_LENGTH; + +typedef struct acpi_scope { + U8 scopeOpcode; + ACPI_PACKAGE_LENGTH pkgLength; + U8 rootChar; +} __attribute__((packed))ACPI_SCOPE; + +typedef struct dual_name_path { + U8 prefix; + U32 nameseg[2]; +} __attribute__((packed))DUAL_NAME_PATH; + +typedef struct multi_name_path { + U8 prefix; + U8 segCount; + U32 nameseg[MAX_SUPPORTED_CPU_NAMESEGS]; +} __attribute__((packed))MULTI_NAME_PATH; + +typedef struct generic_register { + U8 genericRegisterField; + ACPI_PACKAGE_LENGTH pkgLength; + ACPI_GENERIC_ADDRESS gas; +} __attribute__((packed))ACPI_GENERIC_REGISTER; + +typedef struct package { + U8 packageOpcode; + ACPI_PACKAGE_LENGTH pkgLength; + U8 numElements; +} __attribute__((packed))ACPI_PACKAGE; + +typedef struct small_package { + U8 packageOpcode; + U8 packageLength; + U8 numElements; +} __attribute__((packed))ACPI_SMALL_PACKAGE; + +typedef struct small_buffer { + U8 bufferOpcode; + U8 packageLength; +} __attribute__((packed))ACPI_SMALL_BUFFER; + +typedef struct end_tag { + U8 endTagField; + U8 checksum; +} __attribute__((packed))ACPI_END_TAG; + +typedef struct return_name_seg { + U8 returnOpcode; + U32 name; +} __attribute__((packed))ACPI_RETURN_NAME_SEG; + +typedef struct return_package { + U8 returnOpcode; + ACPI_PACKAGE package; +} __attribute__((packed))ACPI_RETURN_PACKAGE; + +typedef struct return_zero { + U8 returnOpcode; + U8 zeroOpcode; +} __attribute__((packed))ACPI_RETURN_ZERO; + +typedef struct return_opcode { + U8 returnOpcode; + U8 opcodeToReturn; +} __attribute__((packed))ACPI_RETURN_OPCODE; + +typedef struct byteConst { + U8 byteOpcode; + U8 byteData; +} __attribute__((packed))ACPI_BYTE_CONST; + +typedef struct wordConst { + U8 wordOpcode; + U16 wordData; +} __attribute__((packed))ACPI_WORD_CONST; + +typedef struct dwordConst { + U8 dwordOpcode; + U32 dwordData; +} __attribute__((packed))ACPI_DWORD_CONST; + +typedef struct small_method { + U8 methodOpcode; + U8 packageLength; + U32 name; + U8 methodFlags; +} __attribute__((packed))ACPI_SMALL_METHOD; + +typedef struct method { + U8 methodOpcode; + ACPI_PACKAGE_LENGTH pkgLength; + U32 name; + U8 methodFlags; +} __attribute__((packed))ACPI_METHOD; + +typedef struct namePath { + U8 nameOpcode; + U32 name; +} __attribute__((packed))ACPI_NAME_PATH; + +typedef struct named_dword { + ACPI_NAME_PATH namePath; + ACPI_DWORD_CONST dword; +} __attribute__((packed))ACPI_NAMED_DWORD; + +typedef struct rootNamePath { + U8 nameOpcode; + U8 rootPrefix; + U32 name; +} ACPI_ROOT_NAME_PATH; + +typedef struct root_named_dword { + ACPI_ROOT_NAME_PATH rootNamePath; + ACPI_DWORD_CONST dword; +} __attribute__((packed))ACPI_ROOT_NAMED_DWORD; + +typedef struct named_object { + ACPI_NAME_PATH namePath; + ACPI_PACKAGE package; +} __attribute__((packed))ACPI_NAMED_OBJECT; + +typedef struct small_named_object { + ACPI_NAME_PATH namePath; + ACPI_SMALL_PACKAGE package; +} __attribute__((packed))ACPI_SMALL_NAMED_OBJECT; + +typedef struct create_dword_field { + ACPI_NAME_PATH namePath; + ACPI_SMALL_PACKAGE package; +} __attribute__((packed))ACPI_CREATE_DWORD_FIELD; + +typedef struct tstate_package { + ACPI_SMALL_PACKAGE package; + ACPI_DWORD_CONST FreqPercent; + ACPI_DWORD_CONST Power; + ACPI_DWORD_CONST TransLatency; + ACPI_DWORD_CONST Control; + ACPI_DWORD_CONST Status; +} __attribute__((packed))ACPI_TSTATE_PACKAGE; + +typedef struct pstate_package { + ACPI_SMALL_PACKAGE package; + ACPI_DWORD_CONST CoreFreq; + ACPI_DWORD_CONST Power; + ACPI_DWORD_CONST TransLatency; + ACPI_DWORD_CONST BMLatency; + ACPI_DWORD_CONST Control; + ACPI_DWORD_CONST Status; +} __attribute__((packed))ACPI_PSTATE_PACKAGE; + +typedef struct psd_package { + ACPI_SMALL_PACKAGE package; + ACPI_BYTE_CONST NumberOfEntries; + ACPI_BYTE_CONST Revision; + ACPI_DWORD_CONST Domain; + ACPI_DWORD_CONST CoordType; + ACPI_DWORD_CONST NumProcessors; +} __attribute__((packed))ACPI_PSD_PACKAGE; + +typedef struct csd_package { + ACPI_SMALL_PACKAGE package; + ACPI_BYTE_CONST NumberOfEntries; + ACPI_BYTE_CONST Revision; + ACPI_DWORD_CONST Domain; + ACPI_DWORD_CONST CoordType; + ACPI_DWORD_CONST NumProcessors; + ACPI_DWORD_CONST Index; +} __attribute__((packed))ACPI_CSD_PACKAGE; + +typedef struct tsd_package { + ACPI_SMALL_PACKAGE package; + ACPI_BYTE_CONST NumberOfEntries; + ACPI_BYTE_CONST Revision; + ACPI_DWORD_CONST Domain; + ACPI_DWORD_CONST CoordType; + ACPI_DWORD_CONST NumProcessors; +} __attribute__((packed))ACPI_TSD_PACKAGE; + +typedef struct processor { + U8 processorOpCode; + U8 packageLength; + U8 numElements; + ACPI_BYTE_CONST ProcID; + ACPI_DWORD_CONST PblkAddr; + ACPI_BYTE_CONST PblkLen; +} __attribute__((packed))ACPI_PROCESSOR; + +//#pragma pack() + +#endif /* !__LIBSAIO_INTEL_ACPI_H */ diff --git a/i386/modules/AcpiCodec/include/ppm.h b/i386/modules/AcpiCodec/include/ppm.h new file mode 100755 index 0000000..379d958 --- /dev/null +++ b/i386/modules/AcpiCodec/include/ppm.h @@ -0,0 +1,289 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ppm_h +#define ppm_h + +#include "datatype.h" + +#define PROFILE_ALL +//#define PROFILE_NEHALEM_EP_DP +//#define PROFILE_WESTMERE_EP_UP_DP +//#define PROFILE_NEHALEM_EX_MP +//#define PROFILE_WESTMERE_EX_MP +//#define PROFILE_SANDYBRIDGE_UP + +#if defined(PROFILE_ALL) || defined(PROFILE_WESTMERE_EX_MP) + +#define MAX_CPU_SOCKETS 8 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 256 // max count of cpu found in MADT +#define MAX_CORES 32 // Based on full range of Core APID ID values (max of 5 bits for core APIC ID mask) + +#elif defined(PROFILE_NEHALEM_EX_MP) + +#define MAX_CPU_SOCKETS 8 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 128 // max count of cpu found in MADT +#define MAX_CORES 16 // Based on full range of Core APID ID values (max of 4 bits for core APIC ID mask) + +#elif defined(PROFILE_WESTMERE_EP_UP_DP) + +#define MAX_CPU_SOCKETS 2 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 64 // max count of cpu found in MADT +#define MAX_CORES 16 // Based on full range of Core APID ID values (max of 4 bits for core APIC ID mask) + +#elif defined(PROFILE_NEHALEM_EP_UP_DP) + +#define MAX_CPU_SOCKETS 2 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 32 // max count of cpu found in MADT +#define MAX_CORES 8 // Based on full range of Core APID ID values (max of 3 bits for core APIC ID mask) + +#elif defined(PROFILE_SANDY_BRIDGE_UP) + +#define MAX_CPU_SOCKETS 1 // max count of cpu packages (any range of APIC IDs is ok) +#define MAX_LOGICAL_CPU 8 // max count of cpu found in MADT +#define MAX_CORES 4 + +#endif + +#define MAX_PSTATES 16 +#define MAX_CSTATES 4 +#define MAX_TSTATES 15 + +//Define ACPI_CSD to force building ACPI _CSD +//#define BUILD_ACPI_CSD + +#ifndef DWORD_REGS_TYPEDEF +#define DWORD_REGS_TYPEDEF +typedef struct dword_regs { + U32 _eax; + U32 _ebx; + U32 _ecx; + U32 _edx; +} DWORD_REGS; +#endif + +typedef struct acpi_tables { + // Define the Storage Locations for all the ACPI Table Pointers. + ACPI_TABLE_DSDT *DsdtPointer; // Differentiated System Description Table (RSDP->RSDT->FACP->DSDT) + ACPI_TABLE_DSDT *DsdtPointer64; // Differentiated System Description Table (RSDP->XSDT->FACP->XDSDT) + ACPI_TABLE_FADT *FacpPointer; // Fixed ACPI Description Table (RSDP->RSDT->FACP) + ACPI_TABLE_FACS *FacsPointer; // Firmware ACPI Control Structure (RSDP->RSDT->FACP->FACS) + ACPI_TABLE_FACS *FacsPointer64; // Firmware ACPI Control Structure (RSDP->XSDT->FACP->XFACS) + ACPI_TABLE_RSDP *RsdPointer; // Root System Description Pointer Structure (RSDP) + ACPI_TABLE_RSDT *RsdtPointer; // Root System Description Table (RSDP->RSDT) + ACPI_TABLE_MADT *MadtPointer; // Multiple APIC Description Table (RSDP->RSDT->APIC) + ACPI_TABLE_MADT *MadtPointer64; // Multiple APIC Description Table (RSDP->XSDT->APIC) + ACPI_TABLE_XSDT *XsdtPointer; // Extended Root System Description Table (RSDP->XSDT) + ACPI_TABLE_FADT *FacpPointer64; // Fixed ACPI Description Table (RSDP->XSDT->FACP) +} ACPI_TABLES; + +typedef struct pstate { + U32 frequency; + U32 power; + U32 ratio; + U32 translatency; + U32 bmlatency; + U32 control; + U32 status; +} PSTATE; + +typedef struct pkg_pstates { + U32 num_pstates; + PSTATE pstate[MAX_PSTATES]; +} PKG_PSTATES; + +typedef struct tstate { + U32 freqpercent; + U32 power; + U32 latency; + U32 control; + U32 status; +} TSTATE; + +typedef struct pkg_tstates { + U32 num_tstates; + TSTATE tstate[MAX_TSTATES]; +} PKG_TSTATES; + +typedef enum cstate_encoding { + IO_REDIRECTION = 0, + NATIVE_MWAIT = 1, +} CSTATE_ENCODING; + +typedef enum cpu_cstate { + CPU_C1 = 1, + //CPU_C2 = 2, + CPU_C3_ACPI_C2 = 3, + CPU_C3_ACPI_C3 = 4, + CPU_C4 = 5, + CPU_C6 = 6, + CPU_C7 = 7, +} CPU_CSTATE; + +typedef struct cstate { + U8 type; + U16 latency; + U32 power; +} CSTATE; + +typedef struct pkg_cstates { + U32 num_cstates; + CSTATE cstate[MAX_CSTATES]; + ACPI_GENERIC_ADDRESS gas[MAX_CSTATES]; +} PKG_CSTATES; + +typedef struct cpu_details { + U32 present; + U32 x2apic_id; + U32 socket_id; + U32 intra_package_mask_width; + U32 intra_package_mask; + U32 smt_mask_width; + U32 smt_select_mask; + U32 core_select_mask; + DWORD_REGS cpuid1; + DWORD_REGS cpuid5; + DWORD_REGS cpuid6; + DWORD_REGS cpuidB_0; + DWORD_REGS cpuidB_1; + U32 eist_cpuid_feature_flag; + U32 turbo_cpuid_feature_flag; + U32 turbo_misc_enables_feature_flag; + U32 invariant_apic_timer_flag; + U32 tdc_limit; + U32 tdp_limit; + U32 turbo_available; + U32 max_ratio_as_mfg; + U32 max_ratio_as_cfg; + U32 min_ratio; + U32 tdc_tdp_limits_for_turbo_flag; + U32 ratio_limits_for_turbo_flag; + U32 xe_available; + U32 logical_processor_count_from_madt; + U32 core_logical_processor_count_from_madt[MAX_CORES]; + + PKG_PSTATES pkg_pstates; + + PKG_CSTATES pkg_mwait_cstates; + PKG_CSTATES pkg_io_cstates; + + PKG_TSTATES pkg_tstates; + + U32 package_cstate_limit; + U32 core_c1_supported; + U32 core_c2_supported; + U32 core_c3_supported; + U32 core_c4_supported; + U32 core_c6_supported; + U32 core_c7_supported; + U32 mwait_supported; + U32 acpi_support_cpuid_feature_flag; + U32 energy_perf_bias_supported; + + U64 package_power_limit; + U64 package_power_sku_unit; +} CPU_DETAILS; + +typedef struct socket_info { + U32 signature; + U32 socket_count; + CPU_DETAILS cpu[MAX_CPU_SOCKETS]; +} SOCKET_INFO; + +typedef struct lapic_info { + U32 processorId; + U32 apicId; + U32 pkg_index; + U32 core_apic_id; + U32 core_index; + PROCESSOR_NUMBER_TO_NAMESEG *namepath; + U32 madt_type; + U32 uid; +} LAPIC_INFO; + +typedef struct proc_info { + U32 processorId; + U32 apicId; +} PROC_INFO; + +typedef struct madt_info { + U32 lapic_count; + LAPIC_INFO lapic[MAX_LOGICAL_CPU]; +} MADT_INFO; + +typedef struct rsdt_info { + U32 proc_count; + PROC_INFO processor[MAX_LOGICAL_CPU]; +} RSDT_INFO; + +typedef struct smp_exit_state { + U32 signature; + + // Number of Failure or Informative codes included in the buffer + U32 error_code_count; + + // Buffer of Failure or Informative codes + U32 error_codes[10]; +} SMP_EXIT_STATE; + +typedef enum smp_exit_code { + // Generic successful + SMP_EXIT_CODE_OK = 1, + + // Generic failure + EXIT_CODE_FAILED = 2, + + // First logical processor for this socket unable to find available structure + EXIT_CODE_FAILED_SOCKET_PROXY_SAVE = 3, +} SMP_EXIT_CODE; + +typedef struct ppm_host { + U32 signature; + + U32 pstates_enabled; + U32 pstate_coordination; + U32 turbo_enabled; + U32 cstates_enabled; + U32 tstates_enabled; + U32 performance_per_watt; + + ACPI_TABLES acpi_tables; + + + RSDT_INFO rsdt_info; + MADT_INFO madt_info; + SOCKET_INFO skt_info; + + PPM_SETUP_OPTIONS *options; + + SMP_EXIT_STATE smp_exit_state; + + U32 detected_cpu_family; +} PPM_HOST; + +#endif // ppm_h diff --git a/i386/modules/AcpiCodec/include/ppmsetup.h b/i386/modules/AcpiCodec/include/ppmsetup.h new file mode 100755 index 0000000..061bbae --- /dev/null +++ b/i386/modules/AcpiCodec/include/ppmsetup.h @@ -0,0 +1,371 @@ +/* +Copyright (c) 2010, Intel Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef ppmsetup_h +#define ppmsetup_h + +#include "datatype.h" + +#define CURRENT_PPM_RCM_INTERFACE_SPECIFICATION 11 + +#ifndef nameseg_defined +#define nameseg_defined +#define NAMESEG(s) (((U32)(s[0]) << 0) \ + |((U32)(s[1]) << 8) \ + |((U32)(s[2]) << 16) \ + |((U32)(s[3]) << 24)) +#endif + +typedef enum ssdt_loc_flag { + // Flag indicating the SSDT ACPI structure should be built in a stack-based + // buffer. If the SSDT is successfully created, then the following occurs: + // (1) the RSDT ACPI structure is moved lower in memory and updated to + // include a pointer to the new SSDT. + // (2) the SSDT APCI structure is copied into memory just above the moved + // RSDT structure + // (3) the RSD ACPI structure is updated to included the new location of + // the just moved RSDT ACPI structure + // Note: The XSDT is not updated! + // + // NOTE: THIS OPTION WILL DEPRECATED AND REMOVED + // IN A FUTURE VERSION OF THIS SPECIFICATION. + SSDT_LOC_FLAG_ACPI_RECLAIM = 0, + + // Flag indicating the SSDT should be built directly in the memory region + // provided by the ssdt_mem_addr option parameter. + // If the SSDT is successfully created, then the following occurs: + // (1) the RSDT ACPI structure is moved lower in memory and updated to + // include a pointer to the new SSDT. + // (2) the RSD ACPI structure is updated to include the new location of the + // RSDT ACPI structure. + // Note: The XSDT is not updated! + // + // NOTE: THIS OPTION WILL DEPRECATED AND REMOVED + // IN A FUTURE VERSION OF THIS SPECIFICATION. + SSDT_LOC_FLAG_ADDR_PROVIDED = 1, + + // Flag indicating the SSDT should be built directly in the memory region + // provided by the ssdt_mem_addr option parameter. + // After SSDT is successfully created, no further processing occurs. + SSDT_LOC_FLAG_ADDR_PROVIDED_NO_INSERT = 2, + + // Flag indicating the SSDT should be built directly in the memory region + // provided by the ssdt_mem_addr option parameter. + // After SSDT is successfully created, then the following occurs: + // (1) the RSDT ACPI structure is not moved but is updated to + // include a 32-bit pointer to the new SSDT. + // (2) If the XSDT exists, it is not moved but is updated to + // include a 64-bit pointer to the new SSDT. + SSDT_LOC_FLAG_ADDR_PROVIDED_INSERT = 3, +} SSDT_LOC_FLAG; + +typedef enum exit_code { + // PPM RCM completed all initialization successfully + EXIT_CODE_PPM_COMPLETED = 1, + + // Failed building P-state table + EXIT_CODE_FAILED_BUILD_PSTATES = 2, + + EXIT_CODE_PPM_EIST_DISABLED = 3, + + // Failed to find ACPI tables + EXIT_CODE_FAILED_FIND_ACPI_TABLES = 4, + + // Failed to process the ACPI MADT structure + EXIT_CODE_FAILED_PROCESS_MADT = 5, + + // Failed to resolve ACPI MADT structure against available logical + // processors + EXIT_CODE_FAILED_PROCESS_MADT_INFO = 6, + + // Failed to build ACPI SSDT structure + EXIT_CODE_FAILED_PROCESS_SSDT = 7, + + // Failed to build and intialize HOST structure + EXIT_CODE_FAILED_HOST_INIT = 8, + + // Failed during wake of all NBSP to gather processor information + EXIT_CODE_FAILED_COLLECT_SOCKET_INFO = 9, + + // Failed to resolve target configuration between desired options and + // processor features + EXIT_CODE_FAILED_DETERMINE_CONFIGURATION = 0x0a, + + // No SSDT ACPI struture was created + EXIT_CODE_NO_SSDT_CREATED = 0x0b, + + // Failed to build Cstates correctly + EXIT_CODE_FAILED_BUILD_CSTATES = 0x0c, + + // Failed to build Tstates correctly + EXIT_CODE_FAILED_BUILD_TSTATES = 0x0d, + + // Failed to find package index of logical processor listed in MADT ACPI table + EXIT_CODE_FAILED_FIND_PKG_INDEX_FROM_LAPIC = 0x0e, + + // Failed with invalid input provided for SSDT location flag + EXIT_CODE_FAILED_INVALID_SSDT_LOCATION_FLAG = 0x0f, + + // Failed with no logical processors found in MADT + EXIT_CODE_FAILED_NO_LAPIC_FOUND_IN_MADT = 0x10, + + // Failed with SSDT size exceeded during SSDT creation + EXIT_CODE_FAILED_SSDT_SIZE_EXCEEDED = 0x11, + + // Failed to build ACPI SSDT structure + EXIT_CODE_FAILED_BUILD_SSDT = 0x12, + + // Failed with core index of logical processor listed in MADT ACPI table exceeding max + EXIT_CODE_MAX_CORES_EXCEEDED = 0x13, + + // Failed to find CPU Scope from array of ACPI processor number to ACPI CPU NameSeg structures + EXIT_CODE_FAILED_FIND_CPU_SCOPE_NAME_SEG = 0x14, + + // Failed to update FADT + EXIT_CODE_FAILED_UPDATE_FADT = 0x15, + + // GPF detected + EXIT_CODE_GPF_DETECTED = 0x16, + + // Failed with invalid SSDT buffer address + EXIT_CODE_INVALID_SSDT_ADDR = 0x17, + + // Failed with invalid SSDT buffer length + EXIT_CODE_INVALID_SSDT_LEN = 0x18, +} EXIT_CODE; + +typedef struct exit_state { + // 1 = success, 0 = failure + U32 return_status; + + // Number of Failure or Informative codes included in the buffer + U32 error_code_count; + + // Buffer of Failure or Informative codes + U32 error_codes[10]; + + // This 32-bit physical memory address specifies the final location for the + // SSDT ACPI structure built by the PPM RC. + U32 ssdt_mem_addr; + + // This value specifies the final size of the SSDT ACPI structure for the + // SSDT ACPI structure built by the PPM RC. + U32 ssdt_mem_size; + + // The final state for the P-state initialization + // 1=enabled; 0=disabled + U32 pstates_enabled; + + // The final state for the Turbo feature initialization + // 1=enabled; 0=disabled + U32 turbo_enabled; + + // The final state for the C-state initialization + // 1=enabled; 0=disabled + U32 cstates_enabled; + + // The final state for the T-state initialization + // 1=enabled; 0=disabled + U32 tstates_enabled; +} EXIT_STATE; + +typedef enum cpu_namespace_flag { + // Flag indicating the SSDT ACPI structure should be built + // using ACPI 1.0 compliant processor namespace "_PR" + CPU_NAMESPACE_PR = 0, + + // Flag indicating the SSDT ACPI structure should be built + // using ACPI 2.0+ compliant processor namespace "_SB" + CPU_NAMESPACE_SB = 1, +} CPU_NAMESPACE_FLAG; + +// Define the total number of required NameSegs to reach the DSDT processor +// device or object declarations +#define MAX_SUPPORTED_CPU_NAMESEGS 3 + +typedef struct processor_number_to_nameseg { + // Contains one of the ACPI processor ID values used in a + // ACPI Declare Processor statement in the DSDT or XSDT + U32 acpi_processor_number; + + // Number of NameSpace segments in NamePath to processor devices/objects + U32 seg_count; + + // Contains the corresponding ACPI Name Scope in the form + // of a series of NameSegs constituting the NamePath to a + // processor device or object declaration + U32 nameseg[MAX_SUPPORTED_CPU_NAMESEGS]; +} PROCESSOR_NUMBER_TO_NAMESEG; + +typedef struct ppm_setup_options { + // This 32-bit physical memory address specifies a read-write memory region + // below 1MB. Minimum size is 8KB. This memory is used by the callback as + // the SIPI target and stack for each AP. This region is not required to be + // cacheable. + U32 mem_region_below_1M; + + // Number of CPU sockets which exist on the platform + U32 num_sockets; + + // Desired state for the P-state initialization + // 1=enabled; 0=disabled + U32 pstates_enabled; + + // Desired state for the P-state hardware coordination + // ACPI_PSD_COORD_TYPE_SW_ALL = 0xFC + // ACPI_PSD_COORD_TYPE_SW_ANY = 0xFD + // ACPI_PSD_COORD_TYPE_HW_ALL = 0xFE + U32 pstate_coordination; + + // Desired state for the Turbo state initialization + // 1=enabled; 0=disabled + U32 turbo_enabled; + + // Desired state for the C-state initialization + // 1=enabled; 0=disabled + U32 cstates_enabled; + + // Desired state for the C1E initialization + // 1=enabled; 0=disabled + U32 c1e_enabled; + + // Desired state for the processor core C3 state included in the _CST + // 0= processor core C3 cannot be used as an ACPI C state + // 2= processor core C3 can be used as an ACPI C2 state + // 3= processor core C3 can be used as an ACPI C3 state + // 4= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else not used as ACPI C state + // 5= processor core C3 can be used as an ACPI C2 state + // if Invariant APIC Timer detected, else APIC C3 state + U32 c3_enabled; + + // Desired state for the processor core C6 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C6 can be used as an ACPI C3 state + // 0= processor core C6 cannot be used as an ACPI C3 state + U32 c6_enabled; + + // Desired state for the processor core C7 state included in the _CST as an + // ACPI C3 state. + // 1= processor core C7 can be used as an ACPI C7 state + // 0= processor core C7 cannot be used as an ACPI C7 state + U32 c7_enabled; + + // Desired state for providing alternate ACPI _CST structure using MWAIT + // extensions + // 1= Alternate _CST using MWAIT extension is enabled for OSPM use + // 0= Alternate _CST using MWAIT extension is disabled for OSPM use + U32 mwait_enabled; + + // Power management base address used for processors + U32 pmbase; + + // Desired state for the C-state package limit. + // Note: The C-state package limit may be further limited by the + // capabilities of the processor + // 000b = C0 (No package C-state support) + // 001b = C1 (Behavior is the same as 000b) + // 010b = C3 + // 011b = C6 + // 100b = C7 + // 111b = No package C-state limit + U32 package_cstate_limit; + + // Desired state for the T-state initialization + // 1=enabled; 0=disabled + U32 tstates_enabled; + + // This 32-bit physical memory address specifies a read-write memory region + // for the SSDT ACPI structure built by the PPM RC. Minimum size is 16KB. + U32 ssdt_mem_addr; + + // This value specifies the size of the SSDT memory region. Minimum size is + // 16KB. + U32 ssdt_mem_size; + + // This value specifies the PPM RCM behavior related to creation and + // incorporation of the new SSDT ACPI structure. See definition of the + // SSDT_LOC_FLAG for acceptable values. + U32 ssdt_loc_flag; + + // This value specifies the PPM RCM behavior related to creation and + // incorporation of the new SSDT ACPI structure. If all power management + // features are disabled by input options, the SSDT can still be created + // for debug review. + // 1 = Create SSDT even if all power management features are disabled + // 0 = Do not create SSDT if all power management features are disabled + U32 ssdt_force_creation; + + // Exit structure intended to convey state to the caller and/or subsequent + // init code + EXIT_STATE exit_state; + + // Flag indicating the processor namespace that should be used in the + // SSDT ACPI structure for each CPU. + // See definition of the CPU_NAMESPACE_FLAG for acceptable values. + U32 cpu_namespace_flag; + + // This version number identifies the PPM RCM specification. + // Specifically denotes the version of this structure definition is compliant + // with with file nehalem-ppm-rcm-vX.txt where X is the version number. + // PPMSETUP.C should always use the version definition from the top of + // this file called CURRENT_PPM_RCM_INTERFACE_SPECIFICATION. + U32 ppm_rcm_interface_specification; + + // This flag indicates whether or not after all AP Wakes are completed, + // that the AP should be forced to jump to the real mode address specified + // in the realmode_callback_address field below. + // realmode_callback = 0 means leave AP in INIT or Wait For SIPI (WFS) state + // realmode_callback = 1 means AP should jump to real mode address specified below + U32 realmode_callback_flag; + + // This file contains the real mode callback address which AP must jump to after + // INIT_SIPI_SIPI sequences used to force AP initalization for PPM. + // Upper 16-bits specify target real mode segment for a far 16-bit jump instruction + // Lower 16-bits specify target real mode offset for a far 16-bit jump instruction + U32 realmode_callback_address; + + // Number of ACPI processor number to ACPI CPU NameSeg structures + U32 cpu_map_count; + + // Array of ACPI processor number to ACPI CPU NameSeg structures + PROCESSOR_NUMBER_TO_NAMESEG *cpu_map; + + // This flag indicates whether or not PPM RC should update an existing ACPI FADT. + // modify_fadt_flag = 0 means do not modify existing ACPI FADT structure + // modify_fadt_flag = 1 means do check and if needed, modify existing ACPI FADT structure + U32 modify_fadt_flag; + + // Desired state for the performance_per_watt optimizations + // performance_per_watt = 2 means "Low Power" + // performance_per_watt = 1 means "Power Optimized or Power Balanced" + // performance_per_watt = 0 means "Traditional or Max Performance" + U32 performance_per_watt; +} PPM_SETUP_OPTIONS; + +#endif // ppmsetup_h diff --git a/i386/modules/Cconfig b/i386/modules/Cconfig new file mode 100644 index 0000000..f2b8a4a --- /dev/null +++ b/i386/modules/Cconfig @@ -0,0 +1,13 @@ +# +# Chameleon Modules +# + +menu "Modules" +source "i386/modules/Resolution/Cconfig" +source "i386/modules/klibc/Cconfig" +source "i386/modules/uClibcxx/Cconfig" +source "i386/modules/HelloWorld/Cconfig" +source "i386/modules/Sata/Cconfig" +source "i386/modules/Keylayout/Cconfig" +source "i386/modules/ACPIcodec/Cconfig" +endmenu diff --git a/i386/modules/HelloWorld/.svn/all-wcprops b/i386/modules/HelloWorld/.svn/all-wcprops new file mode 100644 index 0000000..e4a4c4d --- /dev/null +++ b/i386/modules/HelloWorld/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/HelloWorld +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/HelloWorld/Cconfig +END +HelloWorld.cpp +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/HelloWorld/HelloWorld.cpp +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/HelloWorld/Makefile +END diff --git a/i386/modules/HelloWorld/.svn/entries b/i386/modules/HelloWorld/.svn/entries new file mode 100644 index 0000000..0ac1acc --- /dev/null +++ b/i386/modules/HelloWorld/.svn/entries @@ -0,0 +1,133 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/HelloWorld +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +include +dir + +Cconfig +file + + + + +2013-08-27T23:55:05.000000Z +3da365b7b0be93cad47b37cfcc801e8c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +192 + +HelloWorld.cpp +file + + + + +2013-08-27T23:55:05.000000Z +4e02b35563154c8057486a724da53399 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +996 + +Makefile +file + + + + +2013-08-27T23:55:05.000000Z +2287beeb95cd323585afe571a27446c5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +354 + diff --git a/i386/modules/HelloWorld/.svn/text-base/Cconfig.svn-base b/i386/modules/HelloWorld/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..f16edbf --- /dev/null +++ b/i386/modules/HelloWorld/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,11 @@ +# +# Chameleon Modules +# + +config HELLOWORLD_MODULE + tristate "HelloWorld Module" + default n + depends on UCLIBCXX_MODULE + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/HelloWorld/.svn/text-base/HelloWorld.cpp.svn-base b/i386/modules/HelloWorld/.svn/text-base/HelloWorld.cpp.svn-base new file mode 100644 index 0000000..81b20c5 --- /dev/null +++ b/i386/modules/HelloWorld/.svn/text-base/HelloWorld.cpp.svn-base @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009 Evan Lojewski. All rights reserved. + * + */ +#include <cstdlib> +#include <iostream> +#include <modules> + +extern "C" +{ + void HelloWorld_start(); +} + + +using namespace std; + +class HW { +private: + int id; +public: + virtual void setId( int id ); + virtual void printHello( void ); + virtual ~HW(); + +}; + +void helloWorld(void* binary, void* arg2, void* arg3, void* arg4) +{ + HW* obj = new HW; + HW* obj2 = new HW; + obj->setId(1); + obj->printHello(); + delete obj; + + obj2->setId(2); + obj2->printHello(); + delete obj2; + + printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary); + getchar(); +} + +void HelloWorld_start() +{ + //printf("Hooking 'ExecKernel'\n"); + register_hook_callback("ExecKernel", &helloWorld); + register_hook_callback("Kernel Start", &helloWorld); +} + +void HW::printHello() +{ + //cout << "[" << id << "] HelloWorld from a c++ function\n"; + printf("[%d] HelloWorld from a c++ function\n", id); +} + +void HW::setId(int id) +{ + this->id = id; +} + +HW::~HW() +{ +} diff --git a/i386/modules/HelloWorld/.svn/text-base/Makefile.svn-base b/i386/modules/HelloWorld/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..4bc0ce1 --- /dev/null +++ b/i386/modules/HelloWorld/.svn/text-base/Makefile.svn-base @@ -0,0 +1,13 @@ +MODULE_NAME = HelloWorld +MODULE_DESCRIPTION = This module provides an example implementation of a module. Should not be used for regular bootup +MODULE_AUTHOR = +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = uClibcxx + +DIR = HelloWorld + +MODULE_OBJS = HelloWorld.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/HelloWorld/Cconfig b/i386/modules/HelloWorld/Cconfig new file mode 100644 index 0000000..f16edbf --- /dev/null +++ b/i386/modules/HelloWorld/Cconfig @@ -0,0 +1,11 @@ +# +# Chameleon Modules +# + +config HELLOWORLD_MODULE + tristate "HelloWorld Module" + default n + depends on UCLIBCXX_MODULE + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/HelloWorld/HelloWorld.cpp b/i386/modules/HelloWorld/HelloWorld.cpp new file mode 100644 index 0000000..81b20c5 --- /dev/null +++ b/i386/modules/HelloWorld/HelloWorld.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2009 Evan Lojewski. All rights reserved. + * + */ +#include <cstdlib> +#include <iostream> +#include <modules> + +extern "C" +{ + void HelloWorld_start(); +} + + +using namespace std; + +class HW { +private: + int id; +public: + virtual void setId( int id ); + virtual void printHello( void ); + virtual ~HW(); + +}; + +void helloWorld(void* binary, void* arg2, void* arg3, void* arg4) +{ + HW* obj = new HW; + HW* obj2 = new HW; + obj->setId(1); + obj->printHello(); + delete obj; + + obj2->setId(2); + obj2->printHello(); + delete obj2; + + printf("Hello world from ExecKernel hook. Binary located at 0x%X\n", binary); + getchar(); +} + +void HelloWorld_start() +{ + //printf("Hooking 'ExecKernel'\n"); + register_hook_callback("ExecKernel", &helloWorld); + register_hook_callback("Kernel Start", &helloWorld); +} + +void HW::printHello() +{ + //cout << "[" << id << "] HelloWorld from a c++ function\n"; + printf("[%d] HelloWorld from a c++ function\n", id); +} + +void HW::setId(int id) +{ + this->id = id; +} + +HW::~HW() +{ +} diff --git a/i386/modules/HelloWorld/Makefile b/i386/modules/HelloWorld/Makefile new file mode 100644 index 0000000..4bc0ce1 --- /dev/null +++ b/i386/modules/HelloWorld/Makefile @@ -0,0 +1,13 @@ +MODULE_NAME = HelloWorld +MODULE_DESCRIPTION = This module provides an example implementation of a module. Should not be used for regular bootup +MODULE_AUTHOR = +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = uClibcxx + +DIR = HelloWorld + +MODULE_OBJS = HelloWorld.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/HelloWorld/include/.svn/all-wcprops b/i386/modules/HelloWorld/include/.svn/all-wcprops new file mode 100644 index 0000000..c1f5341 --- /dev/null +++ b/i386/modules/HelloWorld/include/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/HelloWorld/include +END diff --git a/i386/modules/HelloWorld/include/.svn/entries b/i386/modules/HelloWorld/include/.svn/entries new file mode 100644 index 0000000..ff077b0 --- /dev/null +++ b/i386/modules/HelloWorld/include/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/HelloWorld/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/i386/modules/Keylayout/.svn/all-wcprops b/i386/modules/Keylayout/.svn/all-wcprops new file mode 100644 index 0000000..d0629e9 --- /dev/null +++ b/i386/modules/Keylayout/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/modules/Keylayout +END +Keylayout.c +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2249/branches/Chimera/i386/modules/Keylayout/Keylayout.c +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/Cconfig +END +Readme.txt +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/Readme.txt +END +Keylayout.h +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/Keylayout.h +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/Makefile +END diff --git a/i386/modules/Keylayout/.svn/entries b/i386/modules/Keylayout/.svn/entries new file mode 100644 index 0000000..fa67a20 --- /dev/null +++ b/i386/modules/Keylayout/.svn/entries @@ -0,0 +1,201 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Keylayout +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +layouts +dir + +Keylayout.c +file + + + + +2013-08-27T23:55:03.000000Z +3b8181dcefdc98bfa41e06af66f60f58 +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + + + + + + + + +3355 + +Cconfig +file + + + + +2013-08-27T23:55:03.000000Z +be6a6b9238646fa6eba2f84b332b8077 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +162 + +Readme.txt +file + + + + +2013-08-27T23:55:03.000000Z +26f7eaced5fc74abfc5299b79818ca77 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +115 + +Keylayout.h +file + + + + +2013-08-27T23:55:03.000000Z +d9ccb324202e1306ca05b6e6cbdf3c85 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +658 + +Makefile +file + + + + +2013-08-27T23:55:03.000000Z +45b9435a6af196e427dc36215fb68b5a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +316 + diff --git a/i386/modules/Keylayout/.svn/text-base/Cconfig.svn-base b/i386/modules/Keylayout/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..3ef1b3c --- /dev/null +++ b/i386/modules/Keylayout/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config KEYLAYOUT_MODULE + tristate "Keylayout Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/Keylayout/.svn/text-base/Keylayout.c.svn-base b/i386/modules/Keylayout/.svn/text-base/Keylayout.c.svn-base new file mode 100644 index 0000000..3120b93 --- /dev/null +++ b/i386/modules/Keylayout/.svn/text-base/Keylayout.c.svn-base @@ -0,0 +1,131 @@ +/* + * Keymapper.c + * Chameleon + * + * Created by JrCs on 28/08/11. + * Copyright 2011. All rights reserved. + * + */ + +#include "libsaio.h" +#include "term.h" +#include "modules.h" +#include "Keylayout.h" +#include "bootstruct.h" + +#define kKeyboardLayout "KeyboardLayout" + +struct keyboard_layout *current_layout = NULL; + +int getchar_replacement() { + int code = bgetc(); + int status = readKeyboardShiftFlags(); + uint8_t scancode = code >> 8; + + // Special scancode sent when alt + some keys are pressed + if (scancode >= 0x78 && scancode <= 0x83) + scancode -= 0x76; + + if (scancode < KEYBOARD_MAP_SIZE && !(status & (STATUS_LCTRL| STATUS_RCTRL))) { + int key; + if ((status & (STATUS_LALT|STATUS_RALT)) && + (status & (STATUS_LSHIFT|STATUS_RSHIFT|STATUS_CAPS))) { + key=current_layout->keyboard_map_shift_alt[scancode]; + } + else if (status & (STATUS_LSHIFT|STATUS_RSHIFT|STATUS_CAPS)) + key=current_layout->keyboard_map_shift[scancode]; + else if (status & (STATUS_LALT|STATUS_RALT)) + key=current_layout->keyboard_map_alt[scancode]; + else + key=current_layout->keyboard_map[scancode]; + + if (key != 0) // do the mapping + code = key; + } + + if (ASCII_KEY(code) != 0) // if ascii not null return it + code = ASCII_KEY(code); + + //printf("Code: %04x\n",code); + return (code); +} + +static uint32_t load_keyboard_layout_file(const char *filename) { + int fd; + char magic[KEYBOARD_LAYOUTS_MAGIC_SIZE]; + uint32_t version; + + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) { + goto fail; // fail + } + + if (read(fd, magic, sizeof(magic)) != sizeof(magic)) { + printf("Can't find magic in keyboard layout file: %s\n", filename); + goto fail; + } + + if (memcmp (magic, KEYBOARD_LAYOUTS_MAGIC, KEYBOARD_LAYOUTS_MAGIC_SIZE) != 0) { + printf("Invalid magic code in keyboard layout file: %s\n", filename); + goto fail; + } + + if (read(fd, (char*) &version, sizeof(version)) != sizeof(version)) { + printf("Can't get version of keyboard layout file: %s\n", filename); + goto fail; + } + + if (version != KEYBOARD_LAYOUTS_VERSION) { + verbose("Bad version for keyboard layout file %s expected v%d found v%d\n", + filename, KEYBOARD_LAYOUTS_VERSION, version); + goto fail; + } + + if (current_layout) + free(current_layout); + + current_layout = malloc(sizeof(*current_layout)); + if (!current_layout) + goto fail; + + b_lseek(fd, KEYBOARD_LAYOUTS_MAP_OFFSET, 0); + + if (read(fd, (char*) current_layout, sizeof(*current_layout)) != sizeof(*current_layout)) { + printf("Wrong keyboard layout file %s size\n", filename); + goto fail; + } + + close(fd); + + return 1; + + fail: + + if (current_layout) { + free(current_layout); + current_layout = NULL; + } + return 0; +} + +void Keylayout_start() +{ + char layoutPath[512]; + const char *val; + int len; + + if (getValueForKey("KeyLayout", &val, &len, &bootInfo->chameleonConfig)) { + sprintf(layoutPath, "/Extra/Keymaps/%s", val); + // Add the extension if needed + if (len <= 4 || strcmp(val+len-4,".lyt") != 0) + strncat(layoutPath, ".lyt", sizeof(layoutPath) - strlen(layoutPath) - 1); + + if (!load_keyboard_layout_file(layoutPath)) { + printf("Can't load %s keyboard layout file. Keylayout will not be used !\n", + layoutPath); + sleep(2); + } else if (!replace_function("_getchar", &getchar_replacement)) { + printf("Can't replace function getchar: Keylayout module can't be used !\n"); + sleep(2); + } + } +} diff --git a/i386/modules/Keylayout/.svn/text-base/Keylayout.h.svn-base b/i386/modules/Keylayout/.svn/text-base/Keylayout.h.svn-base new file mode 100644 index 0000000..4e92d28 --- /dev/null +++ b/i386/modules/Keylayout/.svn/text-base/Keylayout.h.svn-base @@ -0,0 +1,29 @@ +/* + * Keylayout.h + * Chameleon + * + * Created by JrCs on 28/8/11. + * Copyright 2011. All rights reserved. + * + */ + + +#ifndef __KEYLAYOUT_H +#define __KEYLAYOUT_H + +#define KEYBOARD_LAYOUTS_MAGIC "CHAMLAYT" +#define KEYBOARD_LAYOUTS_MAGIC_SIZE (sizeof(KEYBOARD_LAYOUTS_MAGIC) - 1) +#define KEYBOARD_LAYOUTS_VERSION 3 +#define KEYBOARD_LAYOUTS_MAP_OFFSET 0x10 // 0x10 offset of the map in layout file + +#define KEYBOARD_MAP_SIZE 0x38 + +struct keyboard_layout +{ + uint16_t keyboard_map[KEYBOARD_MAP_SIZE]; + uint16_t keyboard_map_shift[KEYBOARD_MAP_SIZE]; + uint16_t keyboard_map_alt[KEYBOARD_MAP_SIZE]; + uint16_t keyboard_map_shift_alt[KEYBOARD_MAP_SIZE]; +}; + +#endif diff --git a/i386/modules/Keylayout/.svn/text-base/Makefile.svn-base b/i386/modules/Keylayout/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..e2148e5 --- /dev/null +++ b/i386/modules/Keylayout/.svn/text-base/Makefile.svn-base @@ -0,0 +1,14 @@ +MODULE_NAME = Keylayout +MODULE_DESCRIPTION = This module provides keylayout functionality +MODULE_AUTHOR = "JrCs" +MODULE_VERSION = "1.2.0" +MODULE_COMPAT_VERSION = "1.2.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = Keylayout +SUBDIRS += layouts + +MODULE_OBJS = Keylayout.o + +include ../MakeInc.dir diff --git a/i386/modules/Keylayout/.svn/text-base/Readme.txt.svn-base b/i386/modules/Keylayout/.svn/text-base/Readme.txt.svn-base new file mode 100644 index 0000000..6273e59 --- /dev/null +++ b/i386/modules/Keylayout/.svn/text-base/Readme.txt.svn-base @@ -0,0 +1,3 @@ +Module: Keylayout +Description: This module permits the user to define the keyboard key mappings +Dependencies: none diff --git a/i386/modules/Keylayout/Cconfig b/i386/modules/Keylayout/Cconfig new file mode 100644 index 0000000..3ef1b3c --- /dev/null +++ b/i386/modules/Keylayout/Cconfig @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config KEYLAYOUT_MODULE + tristate "Keylayout Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/Keylayout/Keylayout.c b/i386/modules/Keylayout/Keylayout.c new file mode 100644 index 0000000..3120b93 --- /dev/null +++ b/i386/modules/Keylayout/Keylayout.c @@ -0,0 +1,131 @@ +/* + * Keymapper.c + * Chameleon + * + * Created by JrCs on 28/08/11. + * Copyright 2011. All rights reserved. + * + */ + +#include "libsaio.h" +#include "term.h" +#include "modules.h" +#include "Keylayout.h" +#include "bootstruct.h" + +#define kKeyboardLayout "KeyboardLayout" + +struct keyboard_layout *current_layout = NULL; + +int getchar_replacement() { + int code = bgetc(); + int status = readKeyboardShiftFlags(); + uint8_t scancode = code >> 8; + + // Special scancode sent when alt + some keys are pressed + if (scancode >= 0x78 && scancode <= 0x83) + scancode -= 0x76; + + if (scancode < KEYBOARD_MAP_SIZE && !(status & (STATUS_LCTRL| STATUS_RCTRL))) { + int key; + if ((status & (STATUS_LALT|STATUS_RALT)) && + (status & (STATUS_LSHIFT|STATUS_RSHIFT|STATUS_CAPS))) { + key=current_layout->keyboard_map_shift_alt[scancode]; + } + else if (status & (STATUS_LSHIFT|STATUS_RSHIFT|STATUS_CAPS)) + key=current_layout->keyboard_map_shift[scancode]; + else if (status & (STATUS_LALT|STATUS_RALT)) + key=current_layout->keyboard_map_alt[scancode]; + else + key=current_layout->keyboard_map[scancode]; + + if (key != 0) // do the mapping + code = key; + } + + if (ASCII_KEY(code) != 0) // if ascii not null return it + code = ASCII_KEY(code); + + //printf("Code: %04x\n",code); + return (code); +} + +static uint32_t load_keyboard_layout_file(const char *filename) { + int fd; + char magic[KEYBOARD_LAYOUTS_MAGIC_SIZE]; + uint32_t version; + + if ((fd = open_bvdev("bt(0,0)", filename, 0)) < 0) { + goto fail; // fail + } + + if (read(fd, magic, sizeof(magic)) != sizeof(magic)) { + printf("Can't find magic in keyboard layout file: %s\n", filename); + goto fail; + } + + if (memcmp (magic, KEYBOARD_LAYOUTS_MAGIC, KEYBOARD_LAYOUTS_MAGIC_SIZE) != 0) { + printf("Invalid magic code in keyboard layout file: %s\n", filename); + goto fail; + } + + if (read(fd, (char*) &version, sizeof(version)) != sizeof(version)) { + printf("Can't get version of keyboard layout file: %s\n", filename); + goto fail; + } + + if (version != KEYBOARD_LAYOUTS_VERSION) { + verbose("Bad version for keyboard layout file %s expected v%d found v%d\n", + filename, KEYBOARD_LAYOUTS_VERSION, version); + goto fail; + } + + if (current_layout) + free(current_layout); + + current_layout = malloc(sizeof(*current_layout)); + if (!current_layout) + goto fail; + + b_lseek(fd, KEYBOARD_LAYOUTS_MAP_OFFSET, 0); + + if (read(fd, (char*) current_layout, sizeof(*current_layout)) != sizeof(*current_layout)) { + printf("Wrong keyboard layout file %s size\n", filename); + goto fail; + } + + close(fd); + + return 1; + + fail: + + if (current_layout) { + free(current_layout); + current_layout = NULL; + } + return 0; +} + +void Keylayout_start() +{ + char layoutPath[512]; + const char *val; + int len; + + if (getValueForKey("KeyLayout", &val, &len, &bootInfo->chameleonConfig)) { + sprintf(layoutPath, "/Extra/Keymaps/%s", val); + // Add the extension if needed + if (len <= 4 || strcmp(val+len-4,".lyt") != 0) + strncat(layoutPath, ".lyt", sizeof(layoutPath) - strlen(layoutPath) - 1); + + if (!load_keyboard_layout_file(layoutPath)) { + printf("Can't load %s keyboard layout file. Keylayout will not be used !\n", + layoutPath); + sleep(2); + } else if (!replace_function("_getchar", &getchar_replacement)) { + printf("Can't replace function getchar: Keylayout module can't be used !\n"); + sleep(2); + } + } +} diff --git a/i386/modules/Keylayout/Keylayout.h b/i386/modules/Keylayout/Keylayout.h new file mode 100644 index 0000000..4e92d28 --- /dev/null +++ b/i386/modules/Keylayout/Keylayout.h @@ -0,0 +1,29 @@ +/* + * Keylayout.h + * Chameleon + * + * Created by JrCs on 28/8/11. + * Copyright 2011. All rights reserved. + * + */ + + +#ifndef __KEYLAYOUT_H +#define __KEYLAYOUT_H + +#define KEYBOARD_LAYOUTS_MAGIC "CHAMLAYT" +#define KEYBOARD_LAYOUTS_MAGIC_SIZE (sizeof(KEYBOARD_LAYOUTS_MAGIC) - 1) +#define KEYBOARD_LAYOUTS_VERSION 3 +#define KEYBOARD_LAYOUTS_MAP_OFFSET 0x10 // 0x10 offset of the map in layout file + +#define KEYBOARD_MAP_SIZE 0x38 + +struct keyboard_layout +{ + uint16_t keyboard_map[KEYBOARD_MAP_SIZE]; + uint16_t keyboard_map_shift[KEYBOARD_MAP_SIZE]; + uint16_t keyboard_map_alt[KEYBOARD_MAP_SIZE]; + uint16_t keyboard_map_shift_alt[KEYBOARD_MAP_SIZE]; +}; + +#endif diff --git a/i386/modules/Keylayout/Makefile b/i386/modules/Keylayout/Makefile new file mode 100644 index 0000000..e2148e5 --- /dev/null +++ b/i386/modules/Keylayout/Makefile @@ -0,0 +1,14 @@ +MODULE_NAME = Keylayout +MODULE_DESCRIPTION = This module provides keylayout functionality +MODULE_AUTHOR = "JrCs" +MODULE_VERSION = "1.2.0" +MODULE_COMPAT_VERSION = "1.2.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = Keylayout +SUBDIRS += layouts + +MODULE_OBJS = Keylayout.o + +include ../MakeInc.dir diff --git a/i386/modules/Keylayout/Readme.txt b/i386/modules/Keylayout/Readme.txt new file mode 100644 index 0000000..6273e59 --- /dev/null +++ b/i386/modules/Keylayout/Readme.txt @@ -0,0 +1,3 @@ +Module: Keylayout +Description: This module permits the user to define the keyboard key mappings +Dependencies: none diff --git a/i386/modules/Keylayout/layouts/.svn/all-wcprops b/i386/modules/Keylayout/layouts/.svn/all-wcprops new file mode 100644 index 0000000..05fd4e5 --- /dev/null +++ b/i386/modules/Keylayout/layouts/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts +END +cham-mklayout.c +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/cham-mklayout.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/Makefile +END diff --git a/i386/modules/Keylayout/layouts/.svn/entries b/i386/modules/Keylayout/layouts/.svn/entries new file mode 100644 index 0000000..dc8e130 --- /dev/null +++ b/i386/modules/Keylayout/layouts/.svn/entries @@ -0,0 +1,99 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Keylayout/layouts +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +layouts-src +dir + +cham-mklayout.c +file + + + + +2013-08-27T23:55:03.000000Z +3fe1814608f3063c6c42a74cb187e3b7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9419 + +Makefile +file + + + + +2013-08-27T23:55:03.000000Z +e37376793edb7fe5e36d4f026e9d6f24 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1768 + diff --git a/i386/modules/Keylayout/layouts/.svn/text-base/Makefile.svn-base b/i386/modules/Keylayout/layouts/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..22a3fa5 --- /dev/null +++ b/i386/modules/Keylayout/layouts/.svn/text-base/Makefile.svn-base @@ -0,0 +1,57 @@ + +SRCROOT = $(abspath $(CURDIR)/../../../..) +OBJROOT = $(SRCROOT)/obj/i386/util +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +KEYMAPSROOT = $(SRCROOT)/Keymaps + +INC = -I$(SRCROOT)/i386/libsaio/ -I. -I.. + +OBJS = cham-mklayout.o32 cham-mklayout.o64 + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +MKLAYOUT = cham-mklayout +MKLAYOUT := $(addprefix $(SYMROOT)/, $(MKLAYOUT)) + +PROGRAMS = $(MKLAYOUT) + +LAYOUTS_SRC_DIR = layouts-src +KEYBOARD_LAYOUTS = $(patsubst $(LAYOUTS_SRC_DIR)/%.slt, $(KEYMAPSROOT)/%.lyt, \ + $(wildcard $(LAYOUTS_SRC_DIR)/*.slt)) + +DIRS_NEEDED = $(KEYMAPSROOT) + +include ${SRCROOT}/Make.rules + +all: $(DIRS_NEEDED) $(OBJROOT) $(SYMROOT) keymaps + +$(PROGRAMS): $(OBJS) + @echo "\t[LD32] $(@F)_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch i386 \ + -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32 + @echo "\t[LD64] $(@F)_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch x86_64 \ + -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64 + @echo "\t[LIPO] $(@F)" + @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 \ + -output $(SYMROOT)/$(@F) + @$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64 + +keymaps: $(KEYBOARD_LAYOUTS) + +$(KEYMAPSROOT)/%.lyt: $(LAYOUTS_SRC_DIR)/%.slt $(MKLAYOUT) + @echo "\t[LAYOUT] Creating keyboard layout: $*" + @$(MKLAYOUT) -i $< -o $@ + +#.PHONY layouts +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @for k in $(KEYBOARD_LAYOUTS); do if [ -f "$${k}" ];then echo "\t[RM] $${k}"; fi; done + @$(RM) -f $(PROGRAMS) $(OBJS) + +distclean-local: + @if [ -d "$(KEYMAPSROOT)" ];then echo "\t[RMDIR] $(KEYMAPSROOT)"; fi + @$(RM) -rf $(KEYMAPSROOT) diff --git a/i386/modules/Keylayout/layouts/.svn/text-base/cham-mklayout.c.svn-base b/i386/modules/Keylayout/layouts/.svn/text-base/cham-mklayout.c.svn-base new file mode 100644 index 0000000..a74e6f2 --- /dev/null +++ b/i386/modules/Keylayout/layouts/.svn/text-base/cham-mklayout.c.svn-base @@ -0,0 +1,373 @@ +/* + * cham-mklayout.c + * Chameleon + * + * Created by JrCs on 30/08/11. + * Copyright 2011. All rights reserved. + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <getopt.h> +#include <errno.h> +#include "stdint.h" +#include "term.h" +#include "Keylayout.h" + +#define PACKAGE_NAME "chameleon" +#define PROGRAM_VERSION "1.0" + +static struct keyboard_layout default_layout = { + .keyboard_map = { + /* 0x00 */ 0, KEY_ESC, '1', '2', '3', '4', '5', '6', + /* 0x08 */ '7', '8', '9', '0', '-', '=', KEY_BKSP, KEY_TAB, + /* 0x10 */ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', + /* 0x18 */ 'o', 'p', '[', ']', KEY_ENTER, 0, 'a', 's', + /* 0x20 */ 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', + /* 0x28 */ '\'', '`', 0, '\\', 'z', 'x', 'c', 'v', + /* 0x30 */ 'b', 'n', 'm', ',', '.', '/', 0, 0 + }, + .keyboard_map_shift = { + /* 0x00 */ 0, KEY_ESC, '!', '@', '#', '$', '%', '^', + /* 0x08 */ '&', '*', '(', ')', '_', '+', KEY_BKSP, 0, + /* 0x10 */ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', + /* 0x18 */ 'O', 'P', '{', '}', KEY_ENTER, 0, 'A', 'S', + /* 0x20 */ 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', + /* 0x28 */ '"', '~', 0, '|', 'Z', 'X', 'C', 'V', + /* 0x30 */ 'B', 'N', 'M', '<', '>', '?', 0, 0, + }, + .keyboard_map_alt = { + /* 0x00 */ 0, KEY_NOECHO, 0, 0, 0, 0, 0, 0, + /* 0x08 */ 0, 0, 0, 0, 0, 0, KEY_NOECHO, KEY_NOECHO, + /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, + /* 0x18 */ 0, 0, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, 0, 0, + /* 0x20 */ 0, 0, 0, 0, 0, 0, 0, KEY_NOECHO, + /* 0x28 */ KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, 0, 0, 0, 0, + /* 0x30 */ 0, 0, 0, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, + }, +}; + +const char* program_name; + +static struct option options[] = { + {"input", required_argument, 0, 'i'}, + {"output", required_argument, 0, 'o'}, + {"keysyms", no_argument, 0, 'k'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {0, 0, 0, 0} +}; + +struct hash +{ + const char *keysym; + int code; +}; + +static struct hash keysym_to_code[] = { + {"BackSpace", KEY_BKSP}, + {"Tab", KEY_TAB}, + {"Linefeed", 0x000a}, + {"Space", 0x0020}, + {"Exclam", 0x0021}, + {"QuoteDbl", 0x0022}, + {"NumberSign", 0x0023}, + {"Dollar", 0x0024}, + {"Percent", 0x0025}, + {"Ampersand", 0x0026}, + {"Apostrophe", 0x0027}, + {"Parenleft", 0x0028}, + {"Parenright", 0x0029}, + {"Asterisk", 0x002a}, + {"Plus", 0x002b}, + {"Comma", 0x002c}, + {"Minus", 0x002d}, + {"Period", 0x002e}, + {"Slash", 0x002f}, + {"Zero", 0x0030}, + {"One", 0x0031}, + {"Two", 0x0032}, + {"Three", 0x0033}, + {"Four", 0x0034}, + {"Five", 0x0035}, + {"Six", 0x0036}, + {"Seven", 0x0037}, + {"Eight", 0x0038}, + {"Nine", 0x0039}, + {"Colon", 0x003a}, + {"SemiColon", 0x003b}, + {"Less", 0x003c}, + {"Equal", 0x003d}, + {"Greater", 0x003e}, + {"Question", 0x003f}, + {"At", 0x0040}, + {"BracketLeft", 0x005b}, + {"Backslash", 0x005c}, + {"BracketRight",0x005d}, + {"AsciiCircum", 0x005e}, + {"Underscore", 0x005f}, + {"Grave", 0x0060}, + {"BraceLeft", 0x007b}, + {"Bar", 0x007c}, + {"BraceRight", 0x007d}, + {"AsciiTilde", 0x007e}, + {"Enter", KEY_ENTER}, + {"Escape", KEY_ESC}, + {"PrintScreen", KEY_PRTSC}, + {"Left", KEY_LEFT}, + {"Right", KEY_RIGHT}, + {"Up", KEY_UP}, + {"Down", KEY_DOWN}, + {"Home", KEY_HOME}, + {"End", KEY_END}, + {"Center", KEY_CENTER}, + {"Insert", KEY_INS}, + {"Delete", KEY_DEL}, + {"PageUp", KEY_PGUP}, + {"PageDown", KEY_PGDN}, + {"F1", KEY_F1}, + {"F2", KEY_F2}, + {"F3", KEY_F3}, + {"F4", KEY_F4}, + {"F5", KEY_F5}, + {"F6", KEY_F6}, + {"F7", KEY_F7}, + {"F8", KEY_F8}, + {"F9", KEY_F9}, + {"F10", KEY_F10}, + {"F11", KEY_F11}, + {"F12", KEY_F12}, + {"VoidSymbol", KEY_NOECHO}, + {NULL, 0} +}; + + +static void usage (int status) { + if (status) + fprintf (stderr, "Try `%s --help' for more information.\n", program_name); + else + printf ("\ +Usage: %s [OPTIONS]\n\ + -i, --input set input filename.\n\ + -o, --output set output filename.\n\ + -k, --keysyms list recognized keysyms.\n\ + -h, --help display this message and exit.\n\ + -V, --version print version information and exit.\n\ +\n", program_name); + + exit (status); +} + +static void list_keysyms (void) { + int i; + for (i = 0; keysym_to_code[i].keysym != NULL; i++) { + printf("0x%04x\t %s\n", keysym_to_code[i].code, keysym_to_code[i].keysym); + } +} + +static int hash_lookup (const char *keysym, unsigned int *code) { + int i; + for (i = 0; keysym_to_code[i].keysym != NULL; i++) { + if (strcasecmp (keysym, keysym_to_code[i].keysym) == 0) { + *code = keysym_to_code[i].code; + return 0; + } + } + return -1; +} + +static int parse_keysym(const char* str, unsigned int *code) { + // Single character + if (strlen(str) == 1) { + *code=(unsigned char)(str[0]); + if (*code > ASCII_KEY_MASK) + return -1; + return 0; + } + + // Hex character code + if (sscanf(str, "0x%x", code)) + return 0; + + // Keysym + if (hash_lookup(str, code) == 0) + return 0; + + return -1; +} + +int parse_scancode(int linenum, char* code, unsigned int* scancode) { + + char* tmp; + errno = 0; // clear errno + + float parse_value = strtof(code, &tmp); + int rest = strlen(code) - ((void*) tmp - (void*)code); + if (rest != 0 || errno != 0) { + printf("Ignoring line %d: invalid scancode `%s'\n", linenum, code); + return -1; + } + + *scancode = parse_value; + + // Only the first scancodes can be translated + if (*scancode >= KEYBOARD_MAP_SIZE) { + printf("Ignoring line %d: invalid scancode 0x%02x. Scancode must be <= 0x%02x.\n", linenum, *scancode, + KEYBOARD_MAP_SIZE); + return -1; + } + return 0; +} + +void assign_keycode(int linenum, unsigned int scancode, const char* arg, uint16_t* map) { + unsigned int value; + if (parse_keysym(arg, &value) == -1) { + printf("Warning line %d (keycode 0x%02x): invalid symbol %s (must be a true ascii character)\n", + linenum, scancode, arg); + value = KEY_NOECHO; // VoidSymbol + } + map[scancode] = value; +} + +struct keyboard_layout* create_keylayout(FILE* in) { + char line[128], code[sizeof(line)]; + char arg1[sizeof(line)], arg2[sizeof(line)], arg3[sizeof(line)], + arg4[sizeof(line)]; + int n, linenum = 0; + unsigned int scancode; + + struct keyboard_layout* new_layout= malloc(sizeof(*new_layout)); + if (!new_layout) + return NULL; + + // Initialize new keybord layout + memcpy(new_layout, &default_layout, sizeof(*new_layout)); + + while(fgets(line, sizeof(line), in)) { + linenum++; + n = sscanf (line, "keycode %s = %s %s %s %s", code, arg1, arg2, arg3, arg4); + if (n > 1) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + if (n >= 2) + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map); + if (n >= 3) + assign_keycode(linenum, scancode, arg2, + new_layout->keyboard_map_shift); + if (n >= 4) + assign_keycode(linenum, scancode, arg3, + new_layout->keyboard_map_alt); + if (n >= 5) + assign_keycode(linenum, scancode, arg4, + new_layout->keyboard_map_shift_alt); + } else if (sscanf (line, "shift keycode %s = %s", code, arg1) == 2) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map_shift); + } else if (sscanf (line, "alt keycode %s = %s", code, arg1) == 2) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map_alt); + } else if (sscanf (line, "shift alt keycode %s = %s", code, arg1) == 2) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map_shift_alt); + } + } + return new_layout; +} + +void write_layout(struct keyboard_layout* layout, FILE* out) { + // Create the header + uint32_t version = KEYBOARD_LAYOUTS_VERSION; + fwrite(KEYBOARD_LAYOUTS_MAGIC, KEYBOARD_LAYOUTS_MAGIC_SIZE, 1, out); + fwrite(&version, 1, sizeof(version), out); + // Seek to start of layout + fseek(out, KEYBOARD_LAYOUTS_MAP_OFFSET, SEEK_SET); + // Write layout + fwrite(layout, sizeof(*layout), 1, out); +} + +void set_program_name(const char* arg) { + const char* last_slash; + last_slash = strrchr(arg, '/'); + program_name = (last_slash != NULL) ? last_slash + 1 : arg; +} + +int main (int argc, char *argv[]) { + int ch; + char *infile_name = NULL; + char *outfile_name = NULL; + FILE *in, *out; + + set_program_name (argv[0]); + + /* Check for options. */ + while ((ch = getopt_long (argc, argv, "i:o:hkV", options, 0)) != -1) { + switch (ch) { + case 'h': + usage (0); + break; + + case 'k': + list_keysyms(); + exit(0); + break; + + case 'i': + infile_name = optarg; + break; + + case 'o': + outfile_name = optarg; + break; + + case 'V': + printf ("%s v%s (%s)\n", program_name, PROGRAM_VERSION, PACKAGE_NAME); + return 0; + + default: + usage (1); + break; + } + } + + if (infile_name == NULL) { + fprintf(stderr, "You must specify an input file\n"); + usage(1); + } + + if (outfile_name == NULL) { + fprintf(stderr, "You must specify an output file\n"); + usage(1); + } + + in = fopen (infile_name, "r"); + if (!in) { + fprintf(stderr, "Couldn't open input file `%s': %s\n", + infile_name, strerror (errno)); + exit(1); + } + + out = fopen (outfile_name, "wb"); + if (!out) { + fprintf(stderr, "Couldn't open output file `%s': %s\n", + outfile_name, strerror (errno)); + exit(1); + } + + struct keyboard_layout* new_layout = create_keylayout(in); + if (new_layout) + write_layout(new_layout, out); + + fclose(out); + fclose(in); + + return 0; +} diff --git a/i386/modules/Keylayout/layouts/Makefile b/i386/modules/Keylayout/layouts/Makefile new file mode 100644 index 0000000..22a3fa5 --- /dev/null +++ b/i386/modules/Keylayout/layouts/Makefile @@ -0,0 +1,57 @@ + +SRCROOT = $(abspath $(CURDIR)/../../../..) +OBJROOT = $(SRCROOT)/obj/i386/util +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +KEYMAPSROOT = $(SRCROOT)/Keymaps + +INC = -I$(SRCROOT)/i386/libsaio/ -I. -I.. + +OBJS = cham-mklayout.o32 cham-mklayout.o64 + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +MKLAYOUT = cham-mklayout +MKLAYOUT := $(addprefix $(SYMROOT)/, $(MKLAYOUT)) + +PROGRAMS = $(MKLAYOUT) + +LAYOUTS_SRC_DIR = layouts-src +KEYBOARD_LAYOUTS = $(patsubst $(LAYOUTS_SRC_DIR)/%.slt, $(KEYMAPSROOT)/%.lyt, \ + $(wildcard $(LAYOUTS_SRC_DIR)/*.slt)) + +DIRS_NEEDED = $(KEYMAPSROOT) + +include ${SRCROOT}/Make.rules + +all: $(DIRS_NEEDED) $(OBJROOT) $(SYMROOT) keymaps + +$(PROGRAMS): $(OBJS) + @echo "\t[LD32] $(@F)_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch i386 \ + -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32 + @echo "\t[LD64] $(@F)_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch x86_64 \ + -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64 + @echo "\t[LIPO] $(@F)" + @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 \ + -output $(SYMROOT)/$(@F) + @$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64 + +keymaps: $(KEYBOARD_LAYOUTS) + +$(KEYMAPSROOT)/%.lyt: $(LAYOUTS_SRC_DIR)/%.slt $(MKLAYOUT) + @echo "\t[LAYOUT] Creating keyboard layout: $*" + @$(MKLAYOUT) -i $< -o $@ + +#.PHONY layouts +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @for k in $(KEYBOARD_LAYOUTS); do if [ -f "$${k}" ];then echo "\t[RM] $${k}"; fi; done + @$(RM) -f $(PROGRAMS) $(OBJS) + +distclean-local: + @if [ -d "$(KEYMAPSROOT)" ];then echo "\t[RMDIR] $(KEYMAPSROOT)"; fi + @$(RM) -rf $(KEYMAPSROOT) diff --git a/i386/modules/Keylayout/layouts/cham-mklayout.c b/i386/modules/Keylayout/layouts/cham-mklayout.c new file mode 100644 index 0000000..a74e6f2 --- /dev/null +++ b/i386/modules/Keylayout/layouts/cham-mklayout.c @@ -0,0 +1,373 @@ +/* + * cham-mklayout.c + * Chameleon + * + * Created by JrCs on 30/08/11. + * Copyright 2011. All rights reserved. + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <getopt.h> +#include <errno.h> +#include "stdint.h" +#include "term.h" +#include "Keylayout.h" + +#define PACKAGE_NAME "chameleon" +#define PROGRAM_VERSION "1.0" + +static struct keyboard_layout default_layout = { + .keyboard_map = { + /* 0x00 */ 0, KEY_ESC, '1', '2', '3', '4', '5', '6', + /* 0x08 */ '7', '8', '9', '0', '-', '=', KEY_BKSP, KEY_TAB, + /* 0x10 */ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', + /* 0x18 */ 'o', 'p', '[', ']', KEY_ENTER, 0, 'a', 's', + /* 0x20 */ 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', + /* 0x28 */ '\'', '`', 0, '\\', 'z', 'x', 'c', 'v', + /* 0x30 */ 'b', 'n', 'm', ',', '.', '/', 0, 0 + }, + .keyboard_map_shift = { + /* 0x00 */ 0, KEY_ESC, '!', '@', '#', '$', '%', '^', + /* 0x08 */ '&', '*', '(', ')', '_', '+', KEY_BKSP, 0, + /* 0x10 */ 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', + /* 0x18 */ 'O', 'P', '{', '}', KEY_ENTER, 0, 'A', 'S', + /* 0x20 */ 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', + /* 0x28 */ '"', '~', 0, '|', 'Z', 'X', 'C', 'V', + /* 0x30 */ 'B', 'N', 'M', '<', '>', '?', 0, 0, + }, + .keyboard_map_alt = { + /* 0x00 */ 0, KEY_NOECHO, 0, 0, 0, 0, 0, 0, + /* 0x08 */ 0, 0, 0, 0, 0, 0, KEY_NOECHO, KEY_NOECHO, + /* 0x10 */ 0, 0, 0, 0, 0, 0, 0, 0, + /* 0x18 */ 0, 0, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, 0, 0, + /* 0x20 */ 0, 0, 0, 0, 0, 0, 0, KEY_NOECHO, + /* 0x28 */ KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, 0, 0, 0, 0, + /* 0x30 */ 0, 0, 0, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, KEY_NOECHO, + }, +}; + +const char* program_name; + +static struct option options[] = { + {"input", required_argument, 0, 'i'}, + {"output", required_argument, 0, 'o'}, + {"keysyms", no_argument, 0, 'k'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {0, 0, 0, 0} +}; + +struct hash +{ + const char *keysym; + int code; +}; + +static struct hash keysym_to_code[] = { + {"BackSpace", KEY_BKSP}, + {"Tab", KEY_TAB}, + {"Linefeed", 0x000a}, + {"Space", 0x0020}, + {"Exclam", 0x0021}, + {"QuoteDbl", 0x0022}, + {"NumberSign", 0x0023}, + {"Dollar", 0x0024}, + {"Percent", 0x0025}, + {"Ampersand", 0x0026}, + {"Apostrophe", 0x0027}, + {"Parenleft", 0x0028}, + {"Parenright", 0x0029}, + {"Asterisk", 0x002a}, + {"Plus", 0x002b}, + {"Comma", 0x002c}, + {"Minus", 0x002d}, + {"Period", 0x002e}, + {"Slash", 0x002f}, + {"Zero", 0x0030}, + {"One", 0x0031}, + {"Two", 0x0032}, + {"Three", 0x0033}, + {"Four", 0x0034}, + {"Five", 0x0035}, + {"Six", 0x0036}, + {"Seven", 0x0037}, + {"Eight", 0x0038}, + {"Nine", 0x0039}, + {"Colon", 0x003a}, + {"SemiColon", 0x003b}, + {"Less", 0x003c}, + {"Equal", 0x003d}, + {"Greater", 0x003e}, + {"Question", 0x003f}, + {"At", 0x0040}, + {"BracketLeft", 0x005b}, + {"Backslash", 0x005c}, + {"BracketRight",0x005d}, + {"AsciiCircum", 0x005e}, + {"Underscore", 0x005f}, + {"Grave", 0x0060}, + {"BraceLeft", 0x007b}, + {"Bar", 0x007c}, + {"BraceRight", 0x007d}, + {"AsciiTilde", 0x007e}, + {"Enter", KEY_ENTER}, + {"Escape", KEY_ESC}, + {"PrintScreen", KEY_PRTSC}, + {"Left", KEY_LEFT}, + {"Right", KEY_RIGHT}, + {"Up", KEY_UP}, + {"Down", KEY_DOWN}, + {"Home", KEY_HOME}, + {"End", KEY_END}, + {"Center", KEY_CENTER}, + {"Insert", KEY_INS}, + {"Delete", KEY_DEL}, + {"PageUp", KEY_PGUP}, + {"PageDown", KEY_PGDN}, + {"F1", KEY_F1}, + {"F2", KEY_F2}, + {"F3", KEY_F3}, + {"F4", KEY_F4}, + {"F5", KEY_F5}, + {"F6", KEY_F6}, + {"F7", KEY_F7}, + {"F8", KEY_F8}, + {"F9", KEY_F9}, + {"F10", KEY_F10}, + {"F11", KEY_F11}, + {"F12", KEY_F12}, + {"VoidSymbol", KEY_NOECHO}, + {NULL, 0} +}; + + +static void usage (int status) { + if (status) + fprintf (stderr, "Try `%s --help' for more information.\n", program_name); + else + printf ("\ +Usage: %s [OPTIONS]\n\ + -i, --input set input filename.\n\ + -o, --output set output filename.\n\ + -k, --keysyms list recognized keysyms.\n\ + -h, --help display this message and exit.\n\ + -V, --version print version information and exit.\n\ +\n", program_name); + + exit (status); +} + +static void list_keysyms (void) { + int i; + for (i = 0; keysym_to_code[i].keysym != NULL; i++) { + printf("0x%04x\t %s\n", keysym_to_code[i].code, keysym_to_code[i].keysym); + } +} + +static int hash_lookup (const char *keysym, unsigned int *code) { + int i; + for (i = 0; keysym_to_code[i].keysym != NULL; i++) { + if (strcasecmp (keysym, keysym_to_code[i].keysym) == 0) { + *code = keysym_to_code[i].code; + return 0; + } + } + return -1; +} + +static int parse_keysym(const char* str, unsigned int *code) { + // Single character + if (strlen(str) == 1) { + *code=(unsigned char)(str[0]); + if (*code > ASCII_KEY_MASK) + return -1; + return 0; + } + + // Hex character code + if (sscanf(str, "0x%x", code)) + return 0; + + // Keysym + if (hash_lookup(str, code) == 0) + return 0; + + return -1; +} + +int parse_scancode(int linenum, char* code, unsigned int* scancode) { + + char* tmp; + errno = 0; // clear errno + + float parse_value = strtof(code, &tmp); + int rest = strlen(code) - ((void*) tmp - (void*)code); + if (rest != 0 || errno != 0) { + printf("Ignoring line %d: invalid scancode `%s'\n", linenum, code); + return -1; + } + + *scancode = parse_value; + + // Only the first scancodes can be translated + if (*scancode >= KEYBOARD_MAP_SIZE) { + printf("Ignoring line %d: invalid scancode 0x%02x. Scancode must be <= 0x%02x.\n", linenum, *scancode, + KEYBOARD_MAP_SIZE); + return -1; + } + return 0; +} + +void assign_keycode(int linenum, unsigned int scancode, const char* arg, uint16_t* map) { + unsigned int value; + if (parse_keysym(arg, &value) == -1) { + printf("Warning line %d (keycode 0x%02x): invalid symbol %s (must be a true ascii character)\n", + linenum, scancode, arg); + value = KEY_NOECHO; // VoidSymbol + } + map[scancode] = value; +} + +struct keyboard_layout* create_keylayout(FILE* in) { + char line[128], code[sizeof(line)]; + char arg1[sizeof(line)], arg2[sizeof(line)], arg3[sizeof(line)], + arg4[sizeof(line)]; + int n, linenum = 0; + unsigned int scancode; + + struct keyboard_layout* new_layout= malloc(sizeof(*new_layout)); + if (!new_layout) + return NULL; + + // Initialize new keybord layout + memcpy(new_layout, &default_layout, sizeof(*new_layout)); + + while(fgets(line, sizeof(line), in)) { + linenum++; + n = sscanf (line, "keycode %s = %s %s %s %s", code, arg1, arg2, arg3, arg4); + if (n > 1) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + if (n >= 2) + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map); + if (n >= 3) + assign_keycode(linenum, scancode, arg2, + new_layout->keyboard_map_shift); + if (n >= 4) + assign_keycode(linenum, scancode, arg3, + new_layout->keyboard_map_alt); + if (n >= 5) + assign_keycode(linenum, scancode, arg4, + new_layout->keyboard_map_shift_alt); + } else if (sscanf (line, "shift keycode %s = %s", code, arg1) == 2) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map_shift); + } else if (sscanf (line, "alt keycode %s = %s", code, arg1) == 2) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map_alt); + } else if (sscanf (line, "shift alt keycode %s = %s", code, arg1) == 2) { + if (parse_scancode(linenum, code, &scancode) == -1) + continue; + assign_keycode(linenum, scancode, arg1, + new_layout->keyboard_map_shift_alt); + } + } + return new_layout; +} + +void write_layout(struct keyboard_layout* layout, FILE* out) { + // Create the header + uint32_t version = KEYBOARD_LAYOUTS_VERSION; + fwrite(KEYBOARD_LAYOUTS_MAGIC, KEYBOARD_LAYOUTS_MAGIC_SIZE, 1, out); + fwrite(&version, 1, sizeof(version), out); + // Seek to start of layout + fseek(out, KEYBOARD_LAYOUTS_MAP_OFFSET, SEEK_SET); + // Write layout + fwrite(layout, sizeof(*layout), 1, out); +} + +void set_program_name(const char* arg) { + const char* last_slash; + last_slash = strrchr(arg, '/'); + program_name = (last_slash != NULL) ? last_slash + 1 : arg; +} + +int main (int argc, char *argv[]) { + int ch; + char *infile_name = NULL; + char *outfile_name = NULL; + FILE *in, *out; + + set_program_name (argv[0]); + + /* Check for options. */ + while ((ch = getopt_long (argc, argv, "i:o:hkV", options, 0)) != -1) { + switch (ch) { + case 'h': + usage (0); + break; + + case 'k': + list_keysyms(); + exit(0); + break; + + case 'i': + infile_name = optarg; + break; + + case 'o': + outfile_name = optarg; + break; + + case 'V': + printf ("%s v%s (%s)\n", program_name, PROGRAM_VERSION, PACKAGE_NAME); + return 0; + + default: + usage (1); + break; + } + } + + if (infile_name == NULL) { + fprintf(stderr, "You must specify an input file\n"); + usage(1); + } + + if (outfile_name == NULL) { + fprintf(stderr, "You must specify an output file\n"); + usage(1); + } + + in = fopen (infile_name, "r"); + if (!in) { + fprintf(stderr, "Couldn't open input file `%s': %s\n", + infile_name, strerror (errno)); + exit(1); + } + + out = fopen (outfile_name, "wb"); + if (!out) { + fprintf(stderr, "Couldn't open output file `%s': %s\n", + outfile_name, strerror (errno)); + exit(1); + } + + struct keyboard_layout* new_layout = create_keylayout(in); + if (new_layout) + write_layout(new_layout, out); + + fclose(out); + fclose(in); + + return 0; +} diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/all-wcprops b/i386/modules/Keylayout/layouts/layouts-src/.svn/all-wcprops new file mode 100644 index 0000000..c263c7d --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src +END +mac-es.slt +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/mac-es.slt +END +mac-fr.slt +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/mac-fr.slt +END +mac-se.slt +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/mac-se.slt +END +mac-de.slt +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/mac-de.slt +END +pc-fr.slt +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/pc-fr.slt +END +mac-it.slt +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/mac-it.slt +END +README +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src/README +END diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/entries b/i386/modules/Keylayout/layouts/layouts-src/.svn/entries new file mode 100644 index 0000000..6841cbf --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/entries @@ -0,0 +1,266 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Keylayout/layouts/layouts-src +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +mac-es.slt +file + + + + +2013-08-27T23:55:03.000000Z +580e9a925cc486c5c620cd185c3e4428 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1791 + +mac-fr.slt +file + + + + +2013-08-27T23:55:03.000000Z +bde61ca266d23aaa402d3e0d4985c878 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1727 + +mac-se.slt +file + + + + +2013-08-27T23:55:03.000000Z +44652820049a066afce8284b6a93e70e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1761 + +mac-de.slt +file + + + + +2013-08-27T23:55:03.000000Z +dc59de9eef2fc02daeeb9ca02698b0f6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1671 + +pc-fr.slt +file + + + + +2013-08-27T23:55:03.000000Z +5e629ef29c70592151ea596654a379b3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1740 + +mac-it.slt +file + + + + +2013-08-27T23:55:03.000000Z +4950856cb15a6a83a0784f598f685c7f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1781 + +README +file + + + + +2013-08-27T23:55:03.000000Z +935609d6b1455b6e05d8bb690359a521 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +106 + diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/README.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/README.svn-base new file mode 100644 index 0000000..8755178 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/README.svn-base @@ -0,0 +1,2 @@ +You can create your own keylayout file with the cham-mklayout command with a +source file (*.slt) as input. \ No newline at end of file diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-de.slt.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-de.slt.svn-base new file mode 100644 index 0000000..c6b0281 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-de.slt.svn-base @@ -0,0 +1,58 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1rst Row +keycode 0x02 = 1 ! +keycode 0x03 = 2 " +keycode 0x04 = 3 VoidSymbol +keycode 0x05 = 4 $ +keycode 0x06 = 5 % [ +keycode 0x07 = 6 & ] +keycode 0x08 = 7 / | +keycode 0x09 = 8 ( { +keycode 0x0a = 9 ) } +keycode 0x0b = 0 = +keycode 0x0c = VoidSymbol ? +keycode 0x0d = VoidSymbol VoidSymbol +keycode 0x0e = Backspace + +# 2nd Row +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = w W +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol VoidSymbol +keycode 0x1b = + * + +# 3rd Row +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = VoidSymbol VoidSymbol +keycode 0x28 = VoidSymbol VoidSymbol +keycode 0x2b = # ' + +# 4th Row +keycode 0x29 = < > +keycode 0x2c = y Y +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N +keycode 0x32 = m M +keycode 0x33 = , ; +keycode 0x34 = . : +keycode 0x35 = minus underscore diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-es.slt.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-es.slt.svn-base new file mode 100644 index 0000000..e5c487a --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-es.slt.svn-base @@ -0,0 +1,59 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1rst Row +keycode 0x02 = 1 VoidSymbol +keycode 0x03 = 2 ! +keycode 0x04 = 3 # +keycode 0x05 = 4 $ +keycode 0x06 = 5 % [ +keycode 0x07 = 6 / \ +keycode 0x08 = 7 & | +keycode 0x09 = 8 * +keycode 0x0a = 9 ( +keycode 0x0b = 0 ) +keycode 0x0c = minus underscore minus +keycode 0x0d = = + +keycode 0x0e = Backspace + +# 2nd Row +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = w W +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I ^ +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol VoidSymbol +keycode 0x1b = ` VoidSymbol | + +# 3rd Row +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G @ , +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = VoidSymbol VoidSymbol ~ +keycode 0x28 = ; : +keycode 0x2b = ' " ] } + +# 4th Row +keycode 0x29 = < > [ { +keycode 0x2c = z Z +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +shift alt keycode 0x30 = < +keycode 0x31 = n N > > +keycode 0x32 = m M +keycode 0x33 = , VoidSymbol +keycode 0x34 = . ? +keycode 0x35 = VoidSymbol VoidSymbol diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-fr.slt.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-fr.slt.svn-base new file mode 100644 index 0000000..42542b2 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-fr.slt.svn-base @@ -0,0 +1,61 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1ère Ligne +keycode 0x02 = & 1 +keycode 0x03 = VoidSymbol 2 +keycode 0x04 = " 3 +keycode 0x05 = ' 4 +keycode 0x06 = ( 5 { [ +keycode 0x07 = VoidSymbol 6 +keycode 0x08 = VoidSymbol 7 +keycode 0x09 = ! 8 +keycode 0x0a = VoidSymbol 9 +keycode 0x0b = VoidSymbol 0 +keycode 0x0c = ) VoidSymbol } ] +keycode 0x0d = - _ +keycode 0x0e = Backspace + +# 2ème Ligne +keycode 0x0f = Tab +keycode 0x10 = a A +keycode 0x11 = z Z +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = ^ VoidSymbol +keycode 0x1b = $ * + +# 3ème Ligne +keycode 0x1e = q Q +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +shift alt keycode 0x26 = | +keycode 0x27 = m M +keycode 0x28 = VoidSymbol % +keycode 0x2b = ` VoidSymbol @ # + +# 4ème Ligne +keycode 0x29 = < > +keycode 0x2c = w W +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N ~ +keycode 0x32 = , ? +keycode 0x33 = ; . +keycode 0x34 = : / +shift alt keycode 0x34 = \ +keycode 0x35 = = + + diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-it.slt.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-it.slt.svn-base new file mode 100644 index 0000000..596495e --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-it.slt.svn-base @@ -0,0 +1,59 @@ +# Keycode Normal Shift Alt Shift+Alt + +# Prima riga +keycode 0x02 = ampersand one +keycode 0x03 = quotedbl two +keycode 0x04 = apostrophe three grave +keycode 0x05 = parenleft four braceleft bracketleft +keycode 0x06 = VoidSymbol five +keycode 0x07 = VoidSymbol six +keycode 0x08 = parenright seven braceright bracketright +keycode 0x09 = VoidSymbol eight +keycode 0x0a = VoidSymbol nine +keycode 0x0b = VoidSymbol zero +keycode 0x0c = minus underscore +keycode 0x0d = equal plus +keycode 0x0e = Backspace + +# Seconda riga +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = z Z +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol ^ +keycode 0x1b = $ * + +# Terza riga +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = m M +keycode 0x28 = VoidSymbol % +keycode 0x2b = ` VoidSymbol @ # + +# Quarta riga +keycode 0x29 = < > +keycode 0x2c = w W +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N ~ +keycode 0x32 = , ? +keycode 0x33 = ; . +shift alt keycode 0x33 = % +keycode 0x34 = : / | \ +keycode 0x35 = VoidSymbol ! diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-se.slt.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-se.slt.svn-base new file mode 100644 index 0000000..a45a872 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/mac-se.slt.svn-base @@ -0,0 +1,58 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1rst Row +keycode 0x02 = 1 ! +keycode 0x03 = 2 " +keycode 0x04 = 3 # +keycode 0x05 = 4 VoidSymbol $ +keycode 0x06 = 5 % +keycode 0x07 = 6 & +keycode 0x08 = 7 / | \ +keycode 0x09 = 8 ( [ { +keycode 0x0a = 9 ) ] } +keycode 0x0b = 0 = +keycode 0x0c = + ? +keycode 0x0d = VoidSymbol ` +keycode 0x0e = Backspace + +# 2nd Row +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = w W +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I ^ +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol VoidSymbol VoidSymbol +keycode 0x1b = VoidSymbol ^ ~ ^ + +# 3rd Row +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G , +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = VoidSymbol VoidSymbol +keycode 0x28 = VoidSymbol VoidSymbol +keycode 0x2b = ' * @ ' + +# 4th Row +keycode 0x29 = < > [ { +keycode 0x2c = z Z +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N +keycode 0x32 = m M +keycode 0x33 = , ; +keycode 0x34 = . : +keycode 0x35 = minus underscore diff --git a/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/pc-fr.slt.svn-base b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/pc-fr.slt.svn-base new file mode 100644 index 0000000..7b2c4cf --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/.svn/text-base/pc-fr.slt.svn-base @@ -0,0 +1,58 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1ère Ligne +keycode 0x29 = < > +keycode 0x02 = & 1 +keycode 0x03 = VoidSymbol 2 ~ +keycode 0x04 = " 3 # +keycode 0x05 = ' 4 { +keycode 0x06 = ( 5 [ +keycode 0x07 = minus 6 | +keycode 0x08 = VoidSymbol 7 ` +keycode 0x09 = underscore 8 \ +keycode 0x0a = VoidSymbol 9 ^ +keycode 0x0b = VoidSymbol 0 @ +keycode 0x0c = ) VoidSymbol ] +keycode 0x0d = = + } +keycode 0x0e = Backspace + +# 2ème Ligne +keycode 0x0f = Tab +keycode 0x10 = a A +keycode 0x11 = z Z +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = ^ VoidSymbol +keycode 0x1b = $ VoidSymbol + +# 3ème Ligne +keycode 0x1e = q Q +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = m M +keycode 0x28 = VoidSymbol % +keycode 0x2b = * VoidSymbol + +# 4ème Ligne +keycode 0x2c = w W +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N +keycode 0x32 = , ? +keycode 0x33 = ; . +keycode 0x34 = : / +keycode 0x35 = ! VoidSymbol diff --git a/i386/modules/Keylayout/layouts/layouts-src/README b/i386/modules/Keylayout/layouts/layouts-src/README new file mode 100644 index 0000000..8755178 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/README @@ -0,0 +1,2 @@ +You can create your own keylayout file with the cham-mklayout command with a +source file (*.slt) as input. \ No newline at end of file diff --git a/i386/modules/Keylayout/layouts/layouts-src/mac-de.slt b/i386/modules/Keylayout/layouts/layouts-src/mac-de.slt new file mode 100644 index 0000000..c6b0281 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/mac-de.slt @@ -0,0 +1,58 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1rst Row +keycode 0x02 = 1 ! +keycode 0x03 = 2 " +keycode 0x04 = 3 VoidSymbol +keycode 0x05 = 4 $ +keycode 0x06 = 5 % [ +keycode 0x07 = 6 & ] +keycode 0x08 = 7 / | +keycode 0x09 = 8 ( { +keycode 0x0a = 9 ) } +keycode 0x0b = 0 = +keycode 0x0c = VoidSymbol ? +keycode 0x0d = VoidSymbol VoidSymbol +keycode 0x0e = Backspace + +# 2nd Row +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = w W +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol VoidSymbol +keycode 0x1b = + * + +# 3rd Row +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = VoidSymbol VoidSymbol +keycode 0x28 = VoidSymbol VoidSymbol +keycode 0x2b = # ' + +# 4th Row +keycode 0x29 = < > +keycode 0x2c = y Y +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N +keycode 0x32 = m M +keycode 0x33 = , ; +keycode 0x34 = . : +keycode 0x35 = minus underscore diff --git a/i386/modules/Keylayout/layouts/layouts-src/mac-es.slt b/i386/modules/Keylayout/layouts/layouts-src/mac-es.slt new file mode 100644 index 0000000..e5c487a --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/mac-es.slt @@ -0,0 +1,59 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1rst Row +keycode 0x02 = 1 VoidSymbol +keycode 0x03 = 2 ! +keycode 0x04 = 3 # +keycode 0x05 = 4 $ +keycode 0x06 = 5 % [ +keycode 0x07 = 6 / \ +keycode 0x08 = 7 & | +keycode 0x09 = 8 * +keycode 0x0a = 9 ( +keycode 0x0b = 0 ) +keycode 0x0c = minus underscore minus +keycode 0x0d = = + +keycode 0x0e = Backspace + +# 2nd Row +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = w W +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I ^ +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol VoidSymbol +keycode 0x1b = ` VoidSymbol | + +# 3rd Row +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G @ , +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = VoidSymbol VoidSymbol ~ +keycode 0x28 = ; : +keycode 0x2b = ' " ] } + +# 4th Row +keycode 0x29 = < > [ { +keycode 0x2c = z Z +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +shift alt keycode 0x30 = < +keycode 0x31 = n N > > +keycode 0x32 = m M +keycode 0x33 = , VoidSymbol +keycode 0x34 = . ? +keycode 0x35 = VoidSymbol VoidSymbol diff --git a/i386/modules/Keylayout/layouts/layouts-src/mac-fr.slt b/i386/modules/Keylayout/layouts/layouts-src/mac-fr.slt new file mode 100644 index 0000000..42542b2 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/mac-fr.slt @@ -0,0 +1,61 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1ère Ligne +keycode 0x02 = & 1 +keycode 0x03 = VoidSymbol 2 +keycode 0x04 = " 3 +keycode 0x05 = ' 4 +keycode 0x06 = ( 5 { [ +keycode 0x07 = VoidSymbol 6 +keycode 0x08 = VoidSymbol 7 +keycode 0x09 = ! 8 +keycode 0x0a = VoidSymbol 9 +keycode 0x0b = VoidSymbol 0 +keycode 0x0c = ) VoidSymbol } ] +keycode 0x0d = - _ +keycode 0x0e = Backspace + +# 2ème Ligne +keycode 0x0f = Tab +keycode 0x10 = a A +keycode 0x11 = z Z +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = ^ VoidSymbol +keycode 0x1b = $ * + +# 3ème Ligne +keycode 0x1e = q Q +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +shift alt keycode 0x26 = | +keycode 0x27 = m M +keycode 0x28 = VoidSymbol % +keycode 0x2b = ` VoidSymbol @ # + +# 4ème Ligne +keycode 0x29 = < > +keycode 0x2c = w W +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N ~ +keycode 0x32 = , ? +keycode 0x33 = ; . +keycode 0x34 = : / +shift alt keycode 0x34 = \ +keycode 0x35 = = + + diff --git a/i386/modules/Keylayout/layouts/layouts-src/mac-it.slt b/i386/modules/Keylayout/layouts/layouts-src/mac-it.slt new file mode 100644 index 0000000..596495e --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/mac-it.slt @@ -0,0 +1,59 @@ +# Keycode Normal Shift Alt Shift+Alt + +# Prima riga +keycode 0x02 = ampersand one +keycode 0x03 = quotedbl two +keycode 0x04 = apostrophe three grave +keycode 0x05 = parenleft four braceleft bracketleft +keycode 0x06 = VoidSymbol five +keycode 0x07 = VoidSymbol six +keycode 0x08 = parenright seven braceright bracketright +keycode 0x09 = VoidSymbol eight +keycode 0x0a = VoidSymbol nine +keycode 0x0b = VoidSymbol zero +keycode 0x0c = minus underscore +keycode 0x0d = equal plus +keycode 0x0e = Backspace + +# Seconda riga +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = z Z +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol ^ +keycode 0x1b = $ * + +# Terza riga +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = m M +keycode 0x28 = VoidSymbol % +keycode 0x2b = ` VoidSymbol @ # + +# Quarta riga +keycode 0x29 = < > +keycode 0x2c = w W +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N ~ +keycode 0x32 = , ? +keycode 0x33 = ; . +shift alt keycode 0x33 = % +keycode 0x34 = : / | \ +keycode 0x35 = VoidSymbol ! diff --git a/i386/modules/Keylayout/layouts/layouts-src/mac-se.slt b/i386/modules/Keylayout/layouts/layouts-src/mac-se.slt new file mode 100644 index 0000000..a45a872 --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/mac-se.slt @@ -0,0 +1,58 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1rst Row +keycode 0x02 = 1 ! +keycode 0x03 = 2 " +keycode 0x04 = 3 # +keycode 0x05 = 4 VoidSymbol $ +keycode 0x06 = 5 % +keycode 0x07 = 6 & +keycode 0x08 = 7 / | \ +keycode 0x09 = 8 ( [ { +keycode 0x0a = 9 ) ] } +keycode 0x0b = 0 = +keycode 0x0c = + ? +keycode 0x0d = VoidSymbol ` +keycode 0x0e = Backspace + +# 2nd Row +keycode 0x0f = Tab +keycode 0x10 = q Q +keycode 0x11 = w W +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I ^ +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = VoidSymbol VoidSymbol VoidSymbol +keycode 0x1b = VoidSymbol ^ ~ ^ + +# 3rd Row +keycode 0x1e = a A +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G , +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = VoidSymbol VoidSymbol +keycode 0x28 = VoidSymbol VoidSymbol +keycode 0x2b = ' * @ ' + +# 4th Row +keycode 0x29 = < > [ { +keycode 0x2c = z Z +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N +keycode 0x32 = m M +keycode 0x33 = , ; +keycode 0x34 = . : +keycode 0x35 = minus underscore diff --git a/i386/modules/Keylayout/layouts/layouts-src/pc-fr.slt b/i386/modules/Keylayout/layouts/layouts-src/pc-fr.slt new file mode 100644 index 0000000..7b2c4cf --- /dev/null +++ b/i386/modules/Keylayout/layouts/layouts-src/pc-fr.slt @@ -0,0 +1,58 @@ +# Keycode Normal Shift Alt Shift+Alt + +# 1ère Ligne +keycode 0x29 = < > +keycode 0x02 = & 1 +keycode 0x03 = VoidSymbol 2 ~ +keycode 0x04 = " 3 # +keycode 0x05 = ' 4 { +keycode 0x06 = ( 5 [ +keycode 0x07 = minus 6 | +keycode 0x08 = VoidSymbol 7 ` +keycode 0x09 = underscore 8 \ +keycode 0x0a = VoidSymbol 9 ^ +keycode 0x0b = VoidSymbol 0 @ +keycode 0x0c = ) VoidSymbol ] +keycode 0x0d = = + } +keycode 0x0e = Backspace + +# 2ème Ligne +keycode 0x0f = Tab +keycode 0x10 = a A +keycode 0x11 = z Z +keycode 0x12 = e E +keycode 0x13 = r R +keycode 0x14 = t T +keycode 0x15 = y Y +keycode 0x16 = u U +keycode 0x17 = i I +keycode 0x18 = o O +keycode 0x19 = p P +keycode 0x1a = ^ VoidSymbol +keycode 0x1b = $ VoidSymbol + +# 3ème Ligne +keycode 0x1e = q Q +keycode 0x1f = s S +keycode 0x20 = d D +keycode 0x21 = f F +keycode 0x22 = g G +keycode 0x23 = h H +keycode 0x24 = j J +keycode 0x25 = k K +keycode 0x26 = l L +keycode 0x27 = m M +keycode 0x28 = VoidSymbol % +keycode 0x2b = * VoidSymbol + +# 4ème Ligne +keycode 0x2c = w W +keycode 0x2d = x X +keycode 0x2e = c C +keycode 0x2f = v V +keycode 0x30 = b B +keycode 0x31 = n N +keycode 0x32 = , ? +keycode 0x33 = ; . +keycode 0x34 = : / +keycode 0x35 = ! VoidSymbol diff --git a/i386/modules/MakeInc.dir b/i386/modules/MakeInc.dir new file mode 100644 index 0000000..61e2819 --- /dev/null +++ b/i386/modules/MakeInc.dir @@ -0,0 +1,173 @@ +SRCROOT = $(abspath $(CURDIR)/../../..) +OBJROOT = $(SRCROOT)/obj/i386/modules/$(DIR) +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +ifeq ($(BUILT_IN),yes) +override OBJROOT = $(SRCROOT)/obj/i386/boot2_modules/$(DIR) +override SYMROOT = $(SRCROOT)/obj/i386/ +endif + +include ${SRCROOT}/Make.rules + + +ifeq ($(BUILT_IN),yes) + +CFLAGS := $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \ + -fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h + +else + +CFLAGS := $(CLFAGS) -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h + +CPPFLAGS := $(CPPFLAGS) -nostdinc -Wmost -Werror \ + -fno-builtin -fno-stack-protector \ + -march=pentium4 -msse2 -msoft-float \ + -arch i386 -include $(SRCROOT)/autoconf.h + +endif + + +UTILDIR = ../../util +LIBSADIR = ../../libsa +LIBSAIODIR = ../../libsaio +BOOT2DIR = ../../boot2 + +MODULE_INCLUDES := $(foreach x,$(MODULE_DEPENDENCIES),-I$(SRCROOT)/i386/modules/$(x)/include/) + + +INC = -I$(SRCROOT)/i386/modules/include/ -Iinclude/ -I$(SRCROOT)/i386/libsaio/ -I$(SRCROOT)/i386/libsa/ -I$(SRCROOT)/i386/include/ -I$(SRCROOT)/i386/boot2/ $(MODULE_INCLUDES) +DEFINES := -D__KLIBC__ $(DEFINES) + +MODULE_DEPENDENCIES := $(wildcard $(foreach x,$(MODULE_DEPENDENCIES),$(SYMROOT)/modules/$(x).dylib)) \ + $(wildcard $(foreach x,$(MODULE_DEPENDENCIES),$(OBJROOT)/../$(x).dylib)) + +MODULE_DEPENDENCIES_CMD := $(foreach x,$(MODULE_DEPENDENCIES), -weak_library $(x)) + +INSTALLDIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/standalone + +MODULE_DEFINITION := $(CONFIG_$(shell echo $(MODULE_NAME) | tr '[:lower:]' '[:upper:]')_MODULE) + + +ifeq ($(MODULE_DEFINITION),m) +ifneq ($(BUILT_IN),yes) + +# Make this as a *MODULE* +all: $(CONFIG_HEADERS) $(HEADER_VERSION) dylib all-recursive + +else +# Module not selected to be compiled as a module +all: $(CONFIG_HEADERS) $(HEADER_VERSION) all-recursive + +endif + +else + +ifeq ($(MODULE_DEFINITION),y) +ifeq ($(BUILT_IN),yes) + +# Make this *BUILT IN* +all: $(CONFIG_HEADERS) $(HEADER_VERSION) dylib_LINKER all-recursive + +else +# Module not selected to be built in +all: $(CONFIG_HEADERS) $(HEADER_VERSION) all-recursive + +endif +else + +# Don't compile this module +all: + +endif +endif + + +dylib_LINKER: $(SRCROOT)/sym/i386/boot_modules.c $(SRCROOT)/sym/i386/boot_modules.h dylib + +dylib: ${SYMROOT}/modules/ ${OBJROOT} $(SYMROOT)/modules/$(MODULE_NAME).dylib + +MODULE_OBJS := $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) + +ifeq ($(BUILT_IN),yes) + +$(SYMROOT)/modules/$(MODULE_NAME).dylib: $(MODULE_OBJS) $(MODULE_DEPENDENCIES) $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author Makefile + @echo "\t[LD] $(MODULE_NAME).dylib" + @ld -arch i386 -undefined dynamic_lookup \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + -current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \ + -final_output $(MODULE_NAME) \ + $(filter %.o,$^) \ + -macosx_version_min 10.6 \ + -sectcreate __INFO __author $(OBJROOT)/$(MODULE_NAME).author \ + -sectcreate __INFO __description $(OBJROOT)/$(MODULE_NAME).desc \ + -o $(SYMROOT)/modules/$(MODULE_NAME).dylib + +else + +$(SYMROOT)/modules/$(MODULE_NAME).dylib: $(MODULE_OBJS) $(MODULE_DEPENDENCIES) $(OBJROOT)/$(MODULE_NAME).desc $(OBJROOT)/$(MODULE_NAME).author $(SRCROOT)/obj/i386/boot2/Symbols_LINKER_ONLY.dylib Makefile + @echo "\t[LD] $(MODULE_NAME).dylib" + + @ld -arch i386 \ + -alias _$(MODULE_START) start \ + -dylib -read_only_relocs suppress \ + -S -x -Z -dead_strip_dylibs \ + -no_uuid \ + -current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \ + -final_output $(MODULE_NAME) \ + $(filter %.o,$^) \ + -weak_library $(SRCROOT)/obj/i386/boot2/Symbols_LINKER_ONLY.dylib \ + $(MODULE_DEPENDENCIES_CMD) \ + -sectcreate __INFO __author $(OBJROOT)/$(MODULE_NAME).author \ + -sectcreate __INFO __description $(OBJROOT)/$(MODULE_NAME).desc \ + -macosx_version_min 10.6 \ + -o $@ + +endif + + +clean-local: + @if [ -f "$(SYMROOT)/modules/$(MODULE_NAME).dylib" ];then \ + echo "\t[RM] $(SYMROOT)/modules/$(MODULE_NAME).dylib";\ + fi + @for o in $(MODULE_OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(SYMROOT)/modules/$(MODULE_NAME).dylib + @rm -rf $(OBJROOT) + + +${SYMROOT}/modules/: + @echo "\t[MKDIR] $@" + @$(MKDIRS) $@ + +.PHONY: $(SRCROOT)/sym/i386/boot_modules.h +.PHONY: $(SRCROOT)/sym/i386/boot_modules.c + +$(SRCROOT)/sym/i386/boot_modules.c: + @echo "\tstart_built_in_module(\"$(MODULE_NAME)\", \"$(MODULE_AUTHOR)\", \"$(MODULE_DESCRIPTION)\", 0, 0, &$(MODULE_START));" >> $@ + +$(SRCROOT)/sym/i386/boot_modules.h: + @echo "void $(MODULE_START)(); // $(MODULE_NAME)" >> $@ + +$(OBJROOT)/$(MODULE_NAME).author: Makefile + @echo "$(MODULE_AUTHOR)" > $@ + +$(OBJROOT)/$(MODULE_NAME).desc: Makefile + @echo "$(MODULE_DESCRIPTION)" > $@ + +#dependencies +-include $(OBJROOT)/Makedep diff --git a/i386/modules/Makefile b/i386/modules/Makefile new file mode 100644 index 0000000..37c1e1b --- /dev/null +++ b/i386/modules/Makefile @@ -0,0 +1,85 @@ +# Makefile for i386 modules +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/modules/ +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + +include ${SRCROOT}/Make.rules + +# The order of building modules is important. + +ifdef CONFIG_KLIBC_MODULE +SUBDIRS += klibc +endif + +ifdef CONFIG_UCLIBCXX_MODULE +SUBDIRS += uClibcxx +endif + +ifdef CONFIG_RESOLUTION_MODULE +SUBDIRS += Resolution +endif + +ifdef CONFIG_HELLOWORLD_MODULE +SUBDIRS += HelloWorld +endif + +ifdef CONFIG_KEYLAYOUT_MODULE +SUBDIRS += Keylayout +endif + +ifdef CONFIG_SATA_MODULE +SUBDIRS += Sata +endif + +ifdef CONFIG_ACPICODEC_MODULE +SUBDIRS += AcpiCodec +endif + +CFLAGS= -O3 $(MORECPP) -arch i386 -g -static +DEFINES= +CONFIG = hd +LIBSAIODIR = $(SRCROOT)/i386/libsaio +INC = -I$(LIBSAIODIR) + +ifeq (${CONFIG_MODULES}, y) +all: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h all-recursive + @# Finish up boot_modules.c + @echo "}" >> $(SYMROOT)/boot_modules.c + + +else +all: $(SYMROOT) $(OBJROOT) objroot_dirs $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h all-recursive + @# Finish up boot_modules.c + @echo "}" >> $(SYMROOT)/boot_modules.c + +endif + +.PHONY: objroot_dirs +.PHONY: $(SYMROOT)/boot_modules.h +.PHONY: $(SYMROOT)/boot_modules.c + +objroot_dirs: + @${MKDIRS} "$(SYMROOT)/modules/" + + +$(SYMROOT)/boot_modules.c: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) +ifeq ($(BUILT_IN),yes) + @echo "// Autogenerated - do not modify" > $@ + @echo "#include <modules.h>" >> $@ + @echo "#include \"boot_modules.h\"" >> $@ + @echo "void start_built_in_modules() {" >> $@ +endif + +$(SYMROOT)/boot_modules.h: ${OBJROOT} ${SYMROOT}/modules/ ${OBJROOT} $(addprefix $(OBJROOT)/, ${MODULE_OBJS}) +ifeq ($(BUILT_IN),yes) + @echo "// Autogenerated - do not modify" > $@ + @echo "void start_built_in_modules(); " > $@ +endif + +clean-local: + @rm -f $(SYMROOT)/boot_modules.c $(SYMROOT)/boot_modules.h diff --git a/i386/modules/Modules.txt b/i386/modules/Modules.txt new file mode 100644 index 0000000..dba8394 --- /dev/null +++ b/i386/modules/Modules.txt @@ -0,0 +1,61 @@ +NOTE: This is a work in progress + +Table Of Contents + 1) Introduction + 2) How to use a module + 3) How modules work + 4) How to create a module + +------------- 1 - Introduction ------------- + The modules system incorporated in chameleon allows for a user or developer to extend the core functionality of chameleon without replacing the main boot file. + + +------------- 2 - How to use a module ------------- + In order for a user to install and use a module, they simply have to ensure that the main boot partition contains the /Extra/modules/ folder. Any file ending in the .dylib extension will be loaded up and started by chameleon automatically. + + +------------- 3 - How modules work ------------- + The module system in chameleon works by loading up a dynamic library at runtime, rebasing it to the loaded address, and binding any missing symbols with ones that chameleon already knows about. When the module system first starts up, it reads in the Symbols.dylib module which was embedded into the boot file as a means of initializing known symbols for boot. This allows modules to link with and modify the core boot file. Every time a new module is loaded, the symbols exported by that module are added to the internal list to allow for modules to link with each other. Additionally, modules may export a property that states if they have any other module dependencies. In the event that a module dependency is not already loaded, the module system will suspend loading of the current module and load the dependency. + +The module system initialization routine follows this flow: + 1) Module system determines if Symbols.dylib was embedded. If not, it exits out + 2) The module system begins by loading the Symbol.dylib file as if it were a standard module. + 3) The module system runs the Symbols.dylib's start function. This function has been specially crafted by the Symbols.dylib generator (dyldsymboltool) to point to an internal symbol, load_all_modules, which causes any module in /Extra/modules/ to be loaded. + +The module system runs through the following routine to load a module by name. + 1) The module system looks for the module in it's internal list. If found, it exits early + 2) The module system looks for the module in the /Extra/modules folder. If nonexistent, it exits early. + 3) The module system allocates a mock of memory equal to the size of the <module>.dylib file + 4) The <module>.dylib file is read into the allocated memory + 5) the <module>.dylib is passed to the macho parser. + 6) The macho parser verifies the integrity of the macho file. + 7) The macho parser reads through the dependency list and calls the load_module function (this one) to ensure that all dependencies are loaded + 8) the macho parser scans the symbol table and adds symbols to the internal list. + 9) The macho parser uses the modules rebase info to modify the executable for the new load address + 10) The macho parser uses the modules bind information, as well as the list of known symbols, to bind unknown symbol addresses in the binary. + 11) If all dependencies were satisfied, the macho parser returns the address of the start function. If errors were encounter, 0xFFFFFFFF is returned instead. + 12) If a valid start function was returned, the module system calls the start routine. + 13) The module system records in the internal list that the given module was loaded. + + +------------- 4 - How to create a module ------------- +The simplest way to create a module is to begin with the HelloWorld template. This template shows an example of creating a c++ module, however you may also create a c module instead. + +The standard directory structure for a module is as follows: +<module>/ The main container directory +<module>/Makefile The makefile script. Contains information about how to compile the module, as well as versioning + naming +<module>/include Global include files that will by copied to ./module_includes. These files may be used by other modules +<module>/*.c C Source files. +<module>/*.cpp C++ Source files. +<module>/*.h Private Headers. +Do note that additional subdirectories can be created as needed, however this document does not go over the needed changes needed to ensure that any subdirectories are compiled. + +In order to setup the setting for the module, the Makefile needs to be updated. The makefile contains various properties, the important ones will be listed and described here: +MODULE_NAME = HelloWorld This is the name of the module. +MODULE_VERSION = "1.0.0" This is the version if the module. It is currently unused by chameleon, however it may be used in the future. +MODULE_COMPAT_VERSION = "1.0.0" This is the compatibility version of the module. As above, it is unused at the moment. +MODULE_START = _$(MODULE_NAME)_start This is the symbol name of the start function. The In this case "void HelloWorld_start()" is the function. If this is a c++ file, it shoal deb wrapped in extern "C" to ensure that the compiler generates the proper symbol name. +MODULE_DEPENDENCIES = uClibc++ A list of all module dependencies used. These must be located in the sym/modules/ folder at compile time to ensure proper linking +MODULE_OBJS = HelloWorld.o A list of object files to generate. In this case, either HellowWorld.c or HelloWorld.cpp file satisfy the dependencies. This will be compiled automatically and linked together by the build system. + + diff --git a/i386/modules/Resolution/.svn/all-wcprops b/i386/modules/Resolution/.svn/all-wcprops new file mode 100644 index 0000000..a65f8ff --- /dev/null +++ b/i386/modules/Resolution/.svn/all-wcprops @@ -0,0 +1,53 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution +END +915resolution.c +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/915resolution.c +END +shortatombios.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/shortatombios.h +END +Resolution.c +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/Resolution.c +END +edid.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/edid.c +END +915resolution.h +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/915resolution.h +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/Cconfig +END +Readme.txt +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/Readme.txt +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/Makefile +END diff --git a/i386/modules/Resolution/.svn/entries b/i386/modules/Resolution/.svn/entries new file mode 100644 index 0000000..02ebbb0 --- /dev/null +++ b/i386/modules/Resolution/.svn/entries @@ -0,0 +1,303 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Resolution +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +include +dir + +915resolution.c +file + + + + +2013-08-27T23:55:02.000000Z +26e0e7ca384d4caffd9611d8ff4c4a1d +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +23593 + +shortatombios.h +file + + + + +2013-08-27T23:55:02.000000Z +df69639c69f1c08094c9c58e5976f662 +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +9034 + +Resolution.c +file + + + + +2013-08-27T23:55:02.000000Z +8f09ef801dd0d1c1ecc1df0e739afab4 +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +283 + +edid.c +file + + + + +2013-08-27T23:55:02.000000Z +b3b6618ce07b71c6c657098e8c08eed7 +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +10535 + +915resolution.h +file + + + + +2013-08-27T23:55:02.000000Z +6d6062ab071ed12780957e22727197cb +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +4434 + +Cconfig +file + + + + +2013-08-27T23:55:02.000000Z +37a906aa92e9b5df47f91089b7f3d929 +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +164 + +Readme.txt +file + + + + +2013-08-27T23:55:02.000000Z +50a471f3276b68f7658a2356d8a64456 +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +358 + +Makefile +file + + + + +2013-08-27T23:55:02.000000Z +452eb2c575d05b2286b09780221b256c +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +494 + diff --git a/i386/modules/Resolution/.svn/text-base/915resolution.c.svn-base b/i386/modules/Resolution/.svn/text-base/915resolution.c.svn-base new file mode 100644 index 0000000..8b1547c --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/915resolution.c.svn-base @@ -0,0 +1,937 @@ +/* + * resolution.h + * + * NOTE: I don't beleive this code is production ready / should be in trunk + * Atleast, not in it's current state. + * + * Created by Evan Lojewski on 3/4/10. + * Copyright 2009. All rights reserved. + * + */ +#ifndef _RESOLUTION_H_ +#define _RESOLUTION_H_ + +//#include "libsaio.h" +//#include "edid.h" //included +#include "915resolution.h" + + +void patchVideoBios() +{ + UInt32 x = 0, y = 0, bp = 0; + + verbose("Resolution:\n"); + getResolution(&x, &y, &bp); + + if (x != 0 && + y != 0 && + bp != 0) + { + vbios_map * map; + + map = open_vbios(CT_UNKNOWN); + if(map) + { + unlock_vbios(map); + + set_mode(map, x, y, bp, 0, 0); + + relock_vbios(map); + + close_vbios(map); + } + } +} + + +/* Copied from 915 resolution created by steve tomljenovic + * + * This code is based on the techniques used in : + * + * - 855patch. Many thanks to Christian Zietz (czietz gmx net) + * for demonstrating how to shadow the VBIOS into system RAM + * and then modify it. + * + * - 1280patch by Andrew Tipton (andrewtipton null li). + * + * - 855resolution by Alain Poirier + * + * This source code is into the public domain. + */ + +/** + ** + **/ + +#define CONFIG_MECH_ONE_ADDR 0xCF8 +#define CONFIG_MECH_ONE_DATA 0xCFC + +int freqs[] = { 60, 75, 85 }; + +UInt32 get_chipset_id(void) +{ + outl(CONFIG_MECH_ONE_ADDR, 0x80000000); + return inl(CONFIG_MECH_ONE_DATA); +} + +chipset_type get_chipset(UInt32 id) +{ + chipset_type type; + + switch (id) { + case 0x35758086: + type = CT_830; + break; + + case 0x25608086: + type = CT_845G; + break; + + case 0x35808086: + type = CT_855GM; + break; + + case 0x25708086: + type = CT_865G; + break; + + case 0x25808086: + type = CT_915G; + break; + + case 0x25908086: + type = CT_915GM; + break; + + case 0x27708086: + type = CT_945G; + break; + + case 0x27a08086: + type = CT_945GM; + break; + + case 0x27ac8086: + type = CT_945GME; + break; + + case 0x29708086: + type = CT_946GZ; + break; + + case 0x27748086: + type = CT_955X; + break; + + case 0x277c8086: + type = CT_975X; + break; + + case 0x29a08086: + type = CT_G965; + break; + + case 0x29908086: + type = CT_Q965; + break; + + case 0x81008086: + type = CT_500; + break; + + case 0x2e108086: + case 0X2e908086: + type = CT_B43; + break; + + case 0x2e208086: + type = CT_P45; + break; + + case 0x2e308086: + type = CT_G41; + break; + + case 0x29c08086: + type = CT_G31; + break; + + case 0x29208086: + type = CT_G45; + break; + + case 0xA0108086: // mobile + case 0xA0008086: // desktop + type = CT_3150; + break; + + case 0x2a008086: + type = CT_965GM; + break; + + case 0x29e08086: + type = CT_X48; + break; + + case 0x2a408086: + type = CT_GM45; + break; + + // + // Core processors + // http://pci-ids.ucw.cz/read/PC/8086 + // + case 0x00408086: // Core Processor DRAM Controller + case 0x00448086: // Core Processor DRAM Controller + case 0x00488086: // Core Processor DRAM Controller + case 0x00698086: // Core Processor DRAM Controller + + case 0x01008086: // 2nd Generation Core Processor Family DRAM Controller + case 0x01048086: // 2nd Generation Core Processor Family DRAM Controller + case 0x01088086: // Xeon E3-1200 2nd Generation Core Processor Family DRAM Controller + case 0x010c8086: // Xeon E3-1200 2nd Generation Core Processor Family DRAM Controller + + case 0x01508086: // 3rd Generation Core Processor Family DRAM Controller + case 0x01548086: // 3rd Generation Core Processor Family DRAM Controller + case 0x01588086: // 3rd Generation Core Processor Family DRAM Controller + case 0x015c8086: // 3rd Generation Core Processor Family DRAM Controller + verbose(" core proc identified\n"); + type = CT_CORE_PROC; + break; + + + default: + if((id & 0x0000FFFF) == 0x00008086) // Intel chipset + { + //printf("Unknown chipset 0x%llX, please email id to meklort@gmail.com", id); + //getc(); + type = CT_UNKNOWN_INTEL; + //type = CT_UNKNOWN; + + } + else + { + type = CT_UNKNOWN; + } + break; + } + return type; +} + +vbios_resolution_type1 * map_type1_resolution(vbios_map * map, UInt16 res) +{ + vbios_resolution_type1 * ptr = ((vbios_resolution_type1*)(map->bios_ptr + res)); + return ptr; +} + +vbios_resolution_type2 * map_type2_resolution(vbios_map * map, UInt16 res) +{ + vbios_resolution_type2 * ptr = ((vbios_resolution_type2*)(map->bios_ptr + res)); + return ptr; +} + +vbios_resolution_type3 * map_type3_resolution(vbios_map * map, UInt16 res) +{ + vbios_resolution_type3 * ptr = ((vbios_resolution_type3*)(map->bios_ptr + res)); + return ptr; +} + +char detect_bios_type(vbios_map * map, char modeline, int entry_size) +{ + UInt32 i; + UInt16 r1, r2; + + r1 = r2 = 32000; + + for (i=0; i < map->mode_table_size; i++) + { + if (map->mode_table[i].resolution <= r1) + { + r1 = map->mode_table[i].resolution; + } + else + { + if (map->mode_table[i].resolution <= r2) + { + r2 = map->mode_table[i].resolution; + } + } + + /*printf("r1 = %d r2 = %d\n", r1, r2);*/ + } + + return (r2-r1-6) % entry_size == 0; +} + +void close_vbios(vbios_map * map); + +char detect_ati_bios_type(vbios_map * map) +{ + return map->mode_table_size % sizeof(ATOM_MODE_TIMING) == 0; +} + + +vbios_map * open_vbios(chipset_type forced_chipset) +{ + UInt32 z; + vbios_map * map = malloc(sizeof(vbios_map)); + for(z=0; z<sizeof(vbios_map); z++) ((char*)map)[z]=0; + /* + * Determine chipset + */ + + if (forced_chipset == CT_UNKNOWN) + { + map->chipset_id = get_chipset_id(); + map->chipset = get_chipset(map->chipset_id); + } + else if (forced_chipset != CT_UNKNOWN) + { + map->chipset = forced_chipset; + } + + + if (map->chipset == CT_UNKNOWN) + { + verbose(" Unknown chipset type: %08x.\n", map->chipset_id); + //verbose("915resolution only works with Intel 800/900 series graphic chipsets.\n"); + //verbose("Chipset Id: %x\n", map->chipset_id); + close_vbios(map); + return 0; + } else { + verbose(" Detected chipset/proc id (DRAM controller): %08x\n", map->chipset_id); + } + + + verbose(" VBios: "); + /* + * Map the video bios to memory + */ + map->bios_ptr=(char*)VBIOS_START; + + /* + * check if we have ATI Radeon + */ + map->ati_tables.base = map->bios_ptr; + map->ati_tables.AtomRomHeader = (ATOM_ROM_HEADER *) (map->bios_ptr + *(unsigned short *) (map->bios_ptr + OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER)); + if (strcmp ((char *) map->ati_tables.AtomRomHeader->uaFirmWareSignature, "ATOM") == 0) + { + verbose("ATI"); + // ATI Radeon Card + map->bios = BT_ATI_1; + + map->ati_tables.MasterDataTables = (unsigned short *) &((ATOM_MASTER_DATA_TABLE *) (map->bios_ptr + map->ati_tables.AtomRomHeader->usMasterDataTableOffset))->ListOfDataTables; + unsigned short std_vesa_offset = (unsigned short) ((ATOM_MASTER_LIST_OF_DATA_TABLES *)map->ati_tables.MasterDataTables)->StandardVESA_Timing; + ATOM_STANDARD_VESA_TIMING * std_vesa = (ATOM_STANDARD_VESA_TIMING *) (map->bios_ptr + std_vesa_offset); + + map->ati_mode_table = (char *) &std_vesa->aModeTimings; + if (map->ati_mode_table == 0) + { + printf("Unable to locate the mode table.\n"); + printf("Please run the program 'dump_bios' as root and\n"); + printf("email the file 'vbios.dmp' to stomljen@yahoo.com.\n"); + printf("Chipset: %d\n", map->chipset); + close_vbios(map); + return 0; + } + map->mode_table_size = std_vesa->sHeader.usStructureSize - sizeof(ATOM_COMMON_TABLE_HEADER); + + if (!detect_ati_bios_type(map)) map->bios = BT_ATI_2; + + if (map->bios == BT_ATI_1) { + verbose(", BT_ATI_1\n"); + } else { + verbose(", BT_ATI_2\n"); + } + } + else { + + /* + * check if we have NVIDIA + */ + + int i = 0; + while (i < 512) + { // we don't need to look through the whole bios, just the first 512 bytes + if (( map->bios_ptr[i] == 'N') + && (map->bios_ptr[i+1] == 'V') + && (map->bios_ptr[i+2] == 'I') + && (map->bios_ptr[i+3] == 'D')) + { + verbose("nVidia\n"); + map->bios = BT_NVDA; + unsigned short nv_data_table_offset = 0; + unsigned short * nv_data_table; + NV_VESA_TABLE * std_vesa; + + int i = 0; + + while (i < 0x300) + { //We don't need to look for the table in the whole bios, the 768 first bytes only + if (( map->bios_ptr[i] == 0x44) + && (map->bios_ptr[i+1] == 0x01) + && (map->bios_ptr[i+2] == 0x04) + && (map->bios_ptr[i+3] == 0x00)) + { + nv_data_table_offset = (unsigned short) (map->bios_ptr[i+4] | (map->bios_ptr[i+5] << 8)); + break; + } + i++; + } + + nv_data_table = (unsigned short *) (map->bios_ptr + (nv_data_table_offset + OFFSET_TO_VESA_TABLE_INDEX)); + std_vesa = (NV_VESA_TABLE *) (map->bios_ptr + *nv_data_table); + + map->nv_mode_table = (char *) std_vesa->sModelines; + if (map->nv_mode_table == 0) + { + printf("Unable to locate the mode table.\n"); + printf("Please run the program 'dump_bios' as root and\n"); + printf("email the file 'vbios.dmp' to stomljen@yahoo.com.\n"); + printf("Chipset: %s\n", map->chipset); + close_vbios(map); + return 0; + } + map->mode_table_size = std_vesa->sHeader.usTable_Size; + + break; + } + i++; + } + } + + + /* + * check if we have Intel + */ + + /*if (map->chipset == CT_UNKNOWN && memmem(map->bios_ptr, VBIOS_SIZE, INTEL_SIGNATURE, strlen(INTEL_SIGNATURE))) { + printf( "Intel chipset detected. However, 915resolution was unable to determine the chipset type.\n"); + + printf("Chipset Id: %x\n", map->chipset_id); + + printf("Please report this problem to stomljen@yahoo.com\n"); + + close_vbios(map); + return 0; + }*/ + + /* + * check for others + */ + + + + /* + * Figure out where the mode table is + */ + if ((map->bios != BT_ATI_1) && (map->bios != BT_ATI_2) && (map->bios != BT_NVDA)) + { + char* p = map->bios_ptr + 16; + char* limit = map->bios_ptr + VBIOS_SIZE - (3 * sizeof(vbios_mode)); + + verbose("Other"); + while (p < limit && map->mode_table == 0) + { + vbios_mode * mode_ptr = (vbios_mode *) p; + + if (((mode_ptr[0].mode & 0xf0) == 0x30) && ((mode_ptr[1].mode & 0xf0) == 0x30) && + ((mode_ptr[2].mode & 0xf0) == 0x30) && ((mode_ptr[3].mode & 0xf0) == 0x30)) + { + map->mode_table = mode_ptr; + } + + p++; + } + + if (map->mode_table == 0) + { + close_vbios(map); + return 0; + } + } + + + /* + * Determine size of mode table + */ + if ((map->bios != BT_ATI_1) && (map->bios != BT_ATI_2) && (map->bios != BT_NVDA)) + { + vbios_mode * mode_ptr = map->mode_table; + + while (mode_ptr->mode != 0xff) + { + map->mode_table_size++; + mode_ptr++; + } + } + + /* + * Figure out what type of bios we have + * order of detection is important + */ + if ((map->bios != BT_ATI_1) && (map->bios != BT_ATI_2) && (map->bios != BT_NVDA)) + { + if (detect_bios_type(map, TRUE, sizeof(vbios_modeline_type3))) + { + map->bios = BT_3; + verbose(", BT_3\n"); + } + else if (detect_bios_type(map, TRUE, sizeof(vbios_modeline_type2))) + { + map->bios = BT_2; + verbose(", BT_2\n"); + } + else if (detect_bios_type(map, FALSE, sizeof(vbios_resolution_type1))) + { + map->bios = BT_1; + verbose(", BT_1\n"); + } + else { + verbose(" - unknown\n"); + return 0; + } + } + + return map; +} + +void close_vbios(vbios_map * map) +{ + free(map); +} + +void unlock_vbios(vbios_map * map) +{ + + map->unlocked = TRUE; + + switch (map->chipset) { + case CT_UNKNOWN: + break; + case CT_830: + case CT_855GM: + outl(CONFIG_MECH_ONE_ADDR, 0x8000005a); + map->b1 = inb(CONFIG_MECH_ONE_DATA + 2); + + outl(CONFIG_MECH_ONE_ADDR, 0x8000005a); + outb(CONFIG_MECH_ONE_DATA + 2, 0x33); + break; + case CT_845G: + case CT_865G: + case CT_915G: + case CT_915GM: + case CT_945G: + case CT_945GM: + case CT_945GME: + case CT_946GZ: + case CT_G965: + case CT_Q965: + case CT_965GM: + case CT_975X: + case CT_P35: + case CT_955X: + case CT_X48: + case CT_B43: + case CT_Q45: + case CT_P45: + case CT_GM45: + case CT_G45: + case CT_G41: + case CT_G31: + case CT_500: + case CT_3150: + outl(CONFIG_MECH_ONE_ADDR, 0x80000090); + map->b1 = inb(CONFIG_MECH_ONE_DATA + 1); + map->b2 = inb(CONFIG_MECH_ONE_DATA + 2); + outl(CONFIG_MECH_ONE_ADDR, 0x80000090); + outb(CONFIG_MECH_ONE_DATA + 1, 0x33); + outb(CONFIG_MECH_ONE_DATA + 2, 0x33); + break; + case CT_CORE_PROC: // Core procs - PAM regs are 80h - 86h + case CT_UNKNOWN_INTEL: // Assume newer intel chipset is the same as before + outl(CONFIG_MECH_ONE_ADDR, 0x80000080); + map->b1 = inb(CONFIG_MECH_ONE_DATA + 1); + map->b2 = inb(CONFIG_MECH_ONE_DATA + 2); + outl(CONFIG_MECH_ONE_ADDR, 0x80000080); + outb(CONFIG_MECH_ONE_DATA + 1, 0x33); + outb(CONFIG_MECH_ONE_DATA + 2, 0x33); + break; + } + +#if DEBUG + { + UInt32 t = inl(CONFIG_MECH_ONE_DATA); + verbose("unlock PAM: (0x%08x)\n", t); + } +#endif +} + +void relock_vbios(vbios_map * map) +{ + + map->unlocked = FALSE; + + switch (map->chipset) + { + case CT_UNKNOWN: + break; + case CT_830: + case CT_855GM: + outl(CONFIG_MECH_ONE_ADDR, 0x8000005a); + outb(CONFIG_MECH_ONE_DATA + 2, map->b1); + break; + case CT_845G: + case CT_865G: + case CT_915G: + case CT_915GM: + case CT_945G: + case CT_945GM: + case CT_945GME: + case CT_946GZ: + case CT_G965: + case CT_955X: + case CT_G45: + case CT_Q965: + case CT_965GM: + case CT_975X: + case CT_P35: + case CT_X48: + case CT_B43: + case CT_Q45: + case CT_P45: + case CT_GM45: + case CT_G41: + case CT_G31: + case CT_500: + case CT_3150: + outl(CONFIG_MECH_ONE_ADDR, 0x80000090); + outb(CONFIG_MECH_ONE_DATA + 1, map->b1); + outb(CONFIG_MECH_ONE_DATA + 2, map->b2); + break; + case CT_CORE_PROC: + case CT_UNKNOWN_INTEL: + outl(CONFIG_MECH_ONE_ADDR, 0x80000080); + outb(CONFIG_MECH_ONE_DATA + 1, map->b1); + outb(CONFIG_MECH_ONE_DATA + 2, map->b2); + break; + } + +#if DEBUG + { + UInt32 t = inl(CONFIG_MECH_ONE_DATA); + verbose("relock PAM: (0x%08x)\n", t); + } +#endif +} + + +int getMode(edid_mode *mode) +{ + char* edidInfo = readEDID(); + + if(!edidInfo) return 1; +//Slice + if(!fb_parse_edid((struct EDID *)edidInfo, mode) || !mode->h_active) + { + free( edidInfo ); + return 1; + } +/* mode->pixel_clock = (edidInfo[55] << 8) | edidInfo[54]; + mode->h_active = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4); + mode->h_blanking = ((edidInfo[58] & 0x0F) << 8) | edidInfo[57]; + mode->v_active = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4); + mode->v_blanking = ((edidInfo[61] & 0x0F) << 8) | edidInfo[60]; + mode->h_sync_offset = ((edidInfo[65] & 0xC0) >> 2) | edidInfo[62]; + mode->h_sync_width = (edidInfo[65] & 0x30) | edidInfo[63]; + mode->v_sync_offset = (edidInfo[65] & 0x0C) | ((edidInfo[64] & 0x0C) >> 2); + mode->v_sync_width = ((edidInfo[65] & 0x3) << 2) | (edidInfo[64] & 0x03); +*/ + + free( edidInfo ); + + return 0; + +} + + +static void gtf_timings(UInt32 x, UInt32 y, UInt32 freq, + unsigned long *clock, + UInt16 *hsyncstart, UInt16 *hsyncend, UInt16 *hblank, + UInt16 *vsyncstart, UInt16 *vsyncend, UInt16 *vblank) +{ + UInt32 hbl, vbl, vfreq; + + vbl = y + (y+1)/(20000.0/(11*freq) - 1) + 1.5; + vfreq = vbl * freq; + hbl = 16 * (int)(x * (30.0 - 300000.0 / vfreq) / + + (70.0 + 300000.0 / vfreq) / 16.0 + 0.5); + + *vsyncstart = y; + *vsyncend = y + 3; + *vblank = vbl - 1; + *hsyncstart = x + hbl / 2 - (x + hbl + 50) / 100 * 8 - 1; + *hsyncend = x + hbl / 2 - 1; + *hblank = x + hbl - 1; + *clock = (x + hbl) * vfreq / 1000; +} + +void set_mode(vbios_map * map, /*UInt32 mode,*/ UInt32 x, UInt32 y, UInt32 bp, UInt32 htotal, UInt32 vtotal) { + UInt32 xprev, yprev; + UInt32 i = 0, j; + // patch first available mode + + // for (i=0; i < map->mode_table_size; i++) { + // if (map->mode_table[0].mode == mode) { + verbose(" Patching: "); + switch(map->bios) { + case BT_INTEL: + verbose("BT_INTEL - not supported\n"); + return; + + case BT_1: + { + verbose("BT_1 patched.\n"); + vbios_resolution_type1 * res = map_type1_resolution(map, map->mode_table[i].resolution); + + if (bp) { + map->mode_table[i].bits_per_pixel = bp; + } + + res->x2 = (htotal?(((htotal-x) >> 8) & 0x0f) : (res->x2 & 0x0f)) | ((x >> 4) & 0xf0); + res->x1 = (x & 0xff); + + res->y2 = (vtotal?(((vtotal-y) >> 8) & 0x0f) : (res->y2 & 0x0f)) | ((y >> 4) & 0xf0); + res->y1 = (y & 0xff); + if (htotal) + res->x_total = ((htotal-x) & 0xff); + + if (vtotal) + res->y_total = ((vtotal-y) & 0xff); + + break; + } + case BT_2: + { + vbios_resolution_type2 * res = map_type2_resolution(map, map->mode_table[i].resolution); + + res->xchars = x / 8; + res->ychars = y / 16 - 1; + xprev = res->modelines[0].x1; + yprev = res->modelines[0].y1; + + for(j=0; j < 3; j++) { + vbios_modeline_type2 * modeline = &res->modelines[j]; + + if (modeline->x1 == xprev && modeline->y1 == yprev) { + modeline->x1 = modeline->x2 = x-1; + modeline->y1 = modeline->y2 = y-1; + + gtf_timings(x, y, freqs[j], &modeline->clock, + &modeline->hsyncstart, &modeline->hsyncend, + &modeline->hblank, &modeline->vsyncstart, + &modeline->vsyncend, &modeline->vblank); + + if (htotal) + modeline->htotal = htotal; + else + modeline->htotal = modeline->hblank; + + if (vtotal) + modeline->vtotal = vtotal; + else + modeline->vtotal = modeline->vblank; + } + } + verbose("BT_1 patched.\n"); + break; + } + case BT_3: + { + vbios_resolution_type3 * res = map_type3_resolution(map, map->mode_table[i].resolution); + + xprev = res->modelines[0].x1; + yprev = res->modelines[0].y1; + + for (j=0; j < 3; j++) { + vbios_modeline_type3 * modeline = &res->modelines[j]; + + if (modeline->x1 == xprev && modeline->y1 == yprev) { + modeline->x1 = modeline->x2 = x-1; + modeline->y1 = modeline->y2 = y-1; + + gtf_timings(x, y, freqs[j], &modeline->clock, + &modeline->hsyncstart, &modeline->hsyncend, + &modeline->hblank, &modeline->vsyncstart, + &modeline->vsyncend, &modeline->vblank); + if (htotal) + modeline->htotal = htotal; + else + modeline->htotal = modeline->hblank; + if (vtotal) + modeline->vtotal = vtotal; + else + modeline->vtotal = modeline->vblank; + + modeline->timing_h = y-1; + modeline->timing_v = x-1; + } + } + verbose("BT_3 patched.\n"); + break; + } + case BT_ATI_1: + { + verbose("BT_ATI_1"); + edid_mode mode; + + ATOM_MODE_TIMING *mode_timing = (ATOM_MODE_TIMING *) map->ati_mode_table; + + //if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) { + if (!getMode(&mode)) { + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode 0 patched!\n", mode.h_active, mode.v_active); + mode_timing->usCRTC_H_Total = mode.h_active + mode.h_blanking; + mode_timing->usCRTC_H_Disp = mode.h_active; + mode_timing->usCRTC_H_SyncStart = mode.h_active + mode.h_sync_offset; + mode_timing->usCRTC_H_SyncWidth = mode.h_sync_width; + + mode_timing->usCRTC_V_Total = mode.v_active + mode.v_blanking; + mode_timing->usCRTC_V_Disp = mode.v_active; + mode_timing->usCRTC_V_SyncStart = mode.v_active + mode.v_sync_offset; + mode_timing->usCRTC_V_SyncWidth = mode.v_sync_width; + + mode_timing->usPixelClock = mode.pixel_clock; + } else { + verbose(" Edid not found or invalid - vbios not patched!\n"); + } + /*else + { + vbios_modeline_type2 modeline; + + cvt_timings(x, y, freqs[0], &modeline.clock, + &modeline.hsyncstart, &modeline.hsyncend, + &modeline.hblank, &modeline.vsyncstart, + &modeline.vsyncend, &modeline.vblank, 0); + + mode_timing->usCRTC_H_Total = x + modeline.hblank; + mode_timing->usCRTC_H_Disp = x; + mode_timing->usCRTC_H_SyncStart = modeline.hsyncstart; + mode_timing->usCRTC_H_SyncWidth = modeline.hsyncend - modeline.hsyncstart; + + mode_timing->usCRTC_V_Total = y + modeline.vblank; + mode_timing->usCRTC_V_Disp = y; + mode_timing->usCRTC_V_SyncStart = modeline.vsyncstart; + mode_timing->usCRTC_V_SyncWidth = modeline.vsyncend - modeline.vsyncstart; + + mode_timing->usPixelClock = modeline.clock; + }*/ + + break; + } + case BT_ATI_2: + { + verbose("BT_ATI_2"); + edid_mode mode; + + ATOM_DTD_FORMAT *mode_timing = (ATOM_DTD_FORMAT *) map->ati_mode_table; + + /*if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) {*/ + if (!getMode(&mode)) { + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode 0 patched!\n", mode.h_active, mode.v_active); + mode_timing->usHBlanking_Time = mode.h_blanking; + mode_timing->usHActive = mode.h_active; + mode_timing->usHSyncOffset = mode.h_sync_offset; + mode_timing->usHSyncWidth = mode.h_sync_width; + + mode_timing->usVBlanking_Time = mode.v_blanking; + mode_timing->usVActive = mode.v_active; + mode_timing->usVSyncOffset = mode.v_sync_offset; + mode_timing->usVSyncWidth = mode.v_sync_width; + + mode_timing->usPixClk = mode.pixel_clock; + } else { + verbose(" Edid not found or invalid - vbios not patched!\n"); + } + /*else + { + vbios_modeline_type2 modeline; + + cvt_timings(x, y, freqs[0], &modeline.clock, + &modeline.hsyncstart, &modeline.hsyncend, + &modeline.hblank, &modeline.vsyncstart, + &modeline.vsyncend, &modeline.vblank, 0); + + mode_timing->usHBlanking_Time = modeline.hblank; + + mode_timing->usHActive = x; + + mode_timing->usHSyncOffset = modeline.hsyncstart - x; + + mode_timing->usHSyncWidth = modeline.hsyncend - modeline.hsyncstart; + + + + mode_timing->usVBlanking_Time = modeline.vblank; + + mode_timing->usVActive = y; + + mode_timing->usVSyncOffset = modeline.vsyncstart - y; + + mode_timing->usVSyncWidth = modeline.hsyncend - modeline.hsyncstart; + + + + mode_timing->usPixClk = modeline.clock; + + }*/ + + + break; + } + case BT_NVDA: + { + verbose("BT_NVDA"); + edid_mode mode; + + NV_MODELINE *mode_timing = (NV_MODELINE *) map->nv_mode_table; + + /*if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) {*/ + if (!getMode(&mode)) { + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode %d patched!\n", mode.h_active, mode.v_active, i); + mode_timing[i].usH_Total = mode.h_active + mode.h_blanking; + mode_timing[i].usH_Active = mode.h_active; + mode_timing[i].usH_SyncStart = mode.h_active + mode.h_sync_offset; + mode_timing[i].usH_SyncEnd = mode.h_active + mode.h_sync_offset + mode.h_sync_width; + + mode_timing[i].usV_Total = mode.v_active + mode.v_blanking; + mode_timing[i].usV_Active = mode.v_active; + mode_timing[i].usV_SyncStart = mode.v_active + mode.v_sync_offset; + mode_timing[i].usV_SyncEnd = mode.v_active + mode.v_sync_offset + mode.v_sync_width; + + mode_timing[i].usPixel_Clock = mode.pixel_clock; + } else { + verbose(" Edid not found or invalid - vbios not patched!\n"); + } + /*else + { + vbios_modeline_type2 modeline; + + cvt_timings(x, y, freqs[0], &modeline.clock, + &modeline.hsyncstart, &modeline.hsyncend, + &modeline.hblank, &modeline.vsyncstart, + &modeline.vsyncend, &modeline.vblank, 0); + + mode_timing[i].usH_Total = x + modeline.hblank - 1; + mode_timing[i].usH_Active = x; + mode_timing[i].usH_SyncStart = modeline.hsyncstart - 1; + mode_timing[i].usH_SyncEnd = modeline.hsyncend - 1; + + mode_timing[i].usV_Total = y + modeline.vblank - 1; + mode_timing[i].usV_Active = y; + mode_timing[i].usV_SyncStart = modeline.vsyncstart - 1; + mode_timing[i].usV_SyncEnd = modeline.vsyncend - 1; + + mode_timing[i].usPixel_Clock = modeline.clock; + }*/ + break; + } + case BT_UNKNOWN: + { + verbose(" Unknown - vbios not patched\n"); + break; + } + } + // } + // } +} + +#endif // _RESOLUTION_H_ \ No newline at end of file diff --git a/i386/modules/Resolution/.svn/text-base/915resolution.h.svn-base b/i386/modules/Resolution/.svn/text-base/915resolution.h.svn-base new file mode 100644 index 0000000..3db6f33 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/915resolution.h.svn-base @@ -0,0 +1,233 @@ +/* + * resolution.h + * + * + * Created by Evan Lojewski on 3/4/10. + * Copyright 2009. All rights reserved. + * + */ + + +#ifndef __RESOLUTION_H +#define __RESOLUTION_H + +#include "shortatombios.h" +#include "edid.h" + +//Slice - moved to edid.h +/* +typedef struct _edid_mode { + unsigned short pixel_clock; + unsigned short h_active; + unsigned short h_blanking; + unsigned short v_active; + unsigned short v_blanking; + unsigned short h_sync_offset; + unsigned short h_sync_width; + unsigned short v_sync_offset; + unsigned short v_sync_width; +} edid_mode; +*/ + + +void patchVideoBios(); + + + +/* Copied from 915 resolution created by steve tomljenovic + * + * This code is based on the techniques used in : + * + * - 855patch. Many thanks to Christian Zietz (czietz gmx net) + * for demonstrating how to shadow the VBIOS into system RAM + * and then modify it. + * + * - 1280patch by Andrew Tipton (andrewtipton null li). + * + * - 855resolution by Alain Poirier + * + * This source code is into the public domain. + */ + +#define VBIOS_START 0xc0000 +#define VBIOS_SIZE 0x10000 + +#define FALSE 0 +#define TRUE 1 + +#define MODE_TABLE_OFFSET_845G 617 + + +#define ATI_SIGNATURE1 "ATI MOBILITY RADEON" +#define ATI_SIGNATURE2 "ATI Technologies Inc" +#define NVIDIA_SIGNATURE "NVIDIA Corp" +#define INTEL_SIGNATURE "Intel Corp" + + + +/* + * NVidia Defines and structures + */ + +#define OFFSET_TO_VESA_TABLE_INDEX 2 + +typedef struct { + unsigned char ucTable_Major; + unsigned char ucTable_Minor; + unsigned char ucTable_Rev; + unsigned short usTable_Size; +} NV_COMMON_TABLE_HEADER; + +typedef struct { + short reserved1; + short reserved2; + short reserved3; +} NV_RESERVED; + +typedef struct { + unsigned short usPixel_Clock; + unsigned short usH_Active; + NV_RESERVED reserved1; + unsigned short usH_SyncStart; + unsigned short usH_SyncEnd; + unsigned short usH_Total; + unsigned short usV_Active; + NV_RESERVED reserved2; + unsigned short usV_SyncStart; + unsigned short usV_SyncEnd; + unsigned short usV_Total; + unsigned short reserved3; +} NV_MODELINE; + +typedef struct { + NV_COMMON_TABLE_HEADER sHeader; + NV_MODELINE * sModelines; +} NV_VESA_TABLE; + +/*---*/ + + +typedef enum { + CT_UNKNOWN, CT_UNKNOWN_INTEL, CT_830, CT_845G, CT_855GM, CT_865G, + CT_915G, CT_915GM, CT_945G, CT_945GM, CT_945GME, CT_946GZ, + CT_955X, CT_G965, CT_Q965, CT_965GM, CT_975X, + CT_P35, CT_X48, CT_B43, CT_Q45, CT_P45, + CT_GM45, CT_G41, CT_G31, CT_G45, CT_500, CT_3150, + CT_CORE_PROC +} chipset_type; + + + +typedef enum { + BT_UNKNOWN, BT_1, BT_2, BT_3, BT_ATI_1, BT_ATI_2, BT_NVDA, BT_INTEL +} bios_type; + + +typedef struct { + char *base; + ATOM_ROM_HEADER *AtomRomHeader; + unsigned short *MasterCommandTables; + unsigned short *MasterDataTables; +} bios_tables_t; + +typedef struct { + UInt8 mode; + UInt8 bits_per_pixel; + UInt16 resolution; + UInt8 unknown; +} __attribute__((packed)) vbios_mode; + +typedef struct { + UInt8 unknow1[2]; + UInt8 x1; + UInt8 x_total; + UInt8 x2; + UInt8 y1; + UInt8 y_total; + UInt8 y2; +} __attribute__((packed)) vbios_resolution_type1; + +typedef struct { + unsigned long clock; + + UInt16 x1; + UInt16 htotal; + UInt16 x2; + UInt16 hblank; + UInt16 hsyncstart; + UInt16 hsyncend; + UInt16 y1; + UInt16 vtotal; + UInt16 y2; + UInt16 vblank; + UInt16 vsyncstart; + UInt16 vsyncend; +} __attribute__((packed)) vbios_modeline_type2; + +typedef struct { + UInt8 xchars; + UInt8 ychars; + UInt8 unknown[4]; + + vbios_modeline_type2 modelines[]; +} __attribute__((packed)) vbios_resolution_type2; + +typedef struct { + unsigned long clock; + + UInt16 x1; + UInt16 htotal; + UInt16 x2; + UInt16 hblank; + UInt16 hsyncstart; + UInt16 hsyncend; + + UInt16 y1; + UInt16 vtotal; + UInt16 y2; + UInt16 vblank; + UInt16 vsyncstart; + UInt16 vsyncend; + + UInt16 timing_h; + UInt16 timing_v; + + UInt8 unknown[6]; +} __attribute__((packed)) vbios_modeline_type3; + +typedef struct { + unsigned char unknown[6]; + + vbios_modeline_type3 modelines[]; +} __attribute__((packed)) vbios_resolution_type3; + +typedef struct { + UInt32 chipset_id; + chipset_type chipset; + bios_type bios; + + bios_tables_t ati_tables; + + + UInt32 bios_fd; + char* bios_ptr; + + vbios_mode * mode_table; + char * ati_mode_table; + char * nv_mode_table; + + UInt32 mode_table_size; + UInt8 b1, b2; + + UInt8 unlocked; +} vbios_map; + + + +vbios_map * open_vbios(chipset_type); +void close_vbios (vbios_map*); +void unlock_vbios(vbios_map*); +void relock_vbios(vbios_map*); +void set_mode(vbios_map*, UInt32, UInt32, UInt32, UInt32, UInt32); + +#endif //__RESOLUTION_H diff --git a/i386/modules/Resolution/.svn/text-base/Cconfig.svn-base b/i386/modules/Resolution/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..e1059d9 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config RESOLUTION_MODULE + tristate "Resolution Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/Resolution/.svn/text-base/Makefile.svn-base b/i386/modules/Resolution/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..31b6558 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/Makefile.svn-base @@ -0,0 +1,14 @@ +MODULE_NAME = Resolution +MODULE_AUTHOR = Chameleon +MODULE_DESCRIPTION = This module reads the edid information from the monitor attached to the main display. The module will also patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting. +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + + +DIR = Resolution + +MODULE_OBJS = Resolution.o edid.o 915resolution.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/Resolution/.svn/text-base/Readme.txt.svn-base b/i386/modules/Resolution/.svn/text-base/Readme.txt.svn-base new file mode 100644 index 0000000..14bdb32 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/Readme.txt.svn-base @@ -0,0 +1,3 @@ +Module: Resolution +Description: This module reads the edid information from the monitor attached to the main display. The module is currently not integrated into trunk and has minimal uses as it stands. Additionally, the module will patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting. +Dependencies: none diff --git a/i386/modules/Resolution/.svn/text-base/Resolution.c.svn-base b/i386/modules/Resolution/.svn/text-base/Resolution.c.svn-base new file mode 100644 index 0000000..c4bbff3 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/Resolution.c.svn-base @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 Evan Lojewski. All rights reserved. + * + */ + +#include "915resolution.h" +#include "gui.h" + +void Resolution_start() +{ + UInt32 bp = 0; + UInt32 x, y; + patchVideoBios(); + getResolution(&x, &y, &bp); + gui.screen.width = x; + gui.screen.height = y; +} + diff --git a/i386/modules/Resolution/.svn/text-base/edid.c.svn-base b/i386/modules/Resolution/.svn/text-base/edid.c.svn-base new file mode 100644 index 0000000..c332151 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/edid.c.svn-base @@ -0,0 +1,409 @@ +/* + * edid.c + * + * + * Created by Evan Lojewski on 12/1/09. + * Copyright 2009. All rights reserved. + * + * Slice 2010, based on Joblo works + */ + + +//#include "libsaio.h" +#include "edid.h" +#include "vbe.h" +#include "graphics.h" +#include "boot.h" +//---------------------------------------------------------------------------------- + +#define FBMON_FIX_HEADER 1 +#define FBMON_FIX_INPUT 2 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +//---------------------------------------------------------------------------------- +/* +struct broken_edid { + const char manufacturer[4]; + UInt32 model; + UInt32 fix; +}; + +//---------------------------------------------------------------------------------- + +broken_edid brokendb[] = { + // DEC FR-PCXAV-YZ * + { "DEC", 0x073a, FBMON_FIX_HEADER,}, + // ViewSonic PF775a * + { "VSC", 0x5a44, FBMON_FIX_INPUT, } +}; +//---------------------------------------------------------------------------------- +*/ +const unsigned char edid_v1_header[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; + +//---------------------------------------------------------------------------------- +int edid_compare(unsigned char *edid1, unsigned char *edid2) +{ + int result = 0; + unsigned char *block = edid1 + ID_MANUFACTURER_NAME, manufacturer1[4], manufacturer2[4];; + manufacturer1[0] = ((block[0] & 0x7c) >> 2) + '@'; + manufacturer1[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@'; + manufacturer1[2] = (block[1] & 0x1f) + '@'; + manufacturer1[3] = 0; + + block = edid2 + ID_MANUFACTURER_NAME; + manufacturer2[0] = ((block[0] & 0x7c) >> 2) + '@'; + manufacturer2[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@'; + manufacturer2[2] = (block[1] & 0x1f) + '@'; + manufacturer2[3] = 0; + int x; + for(x = 0; x < 4; x++) + { + if(manufacturer1[x] == manufacturer2[x]) + result++; + } + + return result; +} + +int check_edid(unsigned char *edid) +{ + unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4]; + //unsigned char *b; + UInt32 model; + //int i, fix = 0, ret = 0; + + manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; + manufacturer[1] = ((block[0] & 0x03) << 3) + + ((block[1] & 0xe0) >> 5) + '@'; + manufacturer[2] = (block[1] & 0x1f) + '@'; + manufacturer[3] = 0; + model = block[2] + (block[3] << 8); +/* + for (i = 0; i < (int)ARRAY_SIZE(brokendb); i++) { + if (!strncmp((const char *)manufacturer, brokendb[i].manufacturer, 4) && + brokendb[i].model == model) { + DEBG("ATIFB: The EDID Block of " + "Manufacturer: %s Model: 0x%08lx is known to " + "be broken,\n", manufacturer, model); + fix = brokendb[i].fix; + break; + } + } + + switch (fix) { + case FBMON_FIX_HEADER: + for (i = 0; i < 8; i++) { + if (edid[i] != edid_v1_header[i]) + ret = fix; + } + break; + case FBMON_FIX_INPUT: + b = edid + EDID_STRUCT_DISPLAY; + /// Only if display is GTF capable will + //the input type be reset to analog * + if (b[4] & 0x01 && b[0] & 0x80) + ret = fix; + break; + } +*/ + return 0; //ret; +} + +//---------------------------------------------------------------------------------- + +static void fix_edid(unsigned char *edid, int fix) +{ + unsigned char *b; + + switch (fix) { + case FBMON_FIX_HEADER: + msglog("EDID: trying a header reconstruct\n"); + memcpy(edid, edid_v1_header, 8); + break; + case FBMON_FIX_INPUT: + msglog("EDID: trying to fix input type\n"); + b = edid + EDID_STRUCT_DISPLAY; + b[0] &= ~0x80; + edid[127] += 0x80; + } +} + +//---------------------------------------------------------------------------------- + +int edid_checksum(unsigned char *edid) +{ + unsigned char i, csum = 0, all_null = 0; + int err = 0, fix = check_edid(edid); + + if (fix) + fix_edid(edid, fix); + + for (i = 0; i < EDID_LENGTH; i++) { + csum += edid[i]; + all_null |= edid[i]; + } + + if (csum == 0x00 && all_null) { + /* checksum passed, everything's good */ + err = 1; + } + + return err; +} + +//---------------------------------------------------------------------------------- + +static int edid_check_header(unsigned char *edid) +{ + int i, err = 1, fix = check_edid(edid); + + if (fix) + fix_edid(edid, fix); + + for (i = 0; i < 8; i++) { + if (edid[i] != edid_v1_header[i]) + err = 0; + } + + return err; +} +//------------------------------------------------------------------------ +bool verifyEDID(unsigned char *edid) +{ + if (edid == NULL || !edid_checksum(edid) || !edid_check_header(edid)) + { + return false; + } + return true; +} + +int edid_is_timing_block(unsigned char *block) +{ + if ((block[0] != 0x00) || (block[1] != 0x00) || + (block[2] != 0x00) || (block[4] != 0x00)) + return 1; + else + return 0; +} +//---------------------------------------------------------------------------------- + +int fb_parse_edid(struct EDID *edid, edid_mode* var) //(struct EDID *edid, UInt32* x, UInt32* y) +{ + int i; + unsigned char *block; + + if(!verifyEDID((unsigned char *)edid)) return 0; + + block = (unsigned char *)edid + DETAILED_TIMING_DESCRIPTIONS_START; //54 + + for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { + if (edid_is_timing_block(block)) { + var->h_active = H_ACTIVE; + var->v_active = V_ACTIVE; + var->h_sync_offset = H_SYNC_OFFSET; + var->h_sync_width = H_SYNC_WIDTH; + var->h_blanking = H_BLANKING; + var->v_blanking = V_BLANKING; + var->pixel_clock = PIXEL_CLOCK; + var->v_sync_offset = V_SYNC_OFFSET; + var->v_sync_width = V_SYNC_WIDTH; + /* + var->xres = var->xres_virtual = H_ACTIVE; + var->yres = var->yres_virtual = V_ACTIVE; + var->height = var->width = -1; + var->right_margin = H_SYNC_OFFSET; + var->left_margin = (H_ACTIVE + H_BLANKING) - + (H_ACTIVE + H_SYNC_OFFSET + H_SYNC_WIDTH); + var->upper_margin = V_BLANKING - V_SYNC_OFFSET - + V_SYNC_WIDTH; + var->lower_margin = V_SYNC_OFFSET; + var->hsync_len = H_SYNC_WIDTH; + var->vsync_len = V_SYNC_WIDTH; + var->pixclock = PIXEL_CLOCK; + var->pixclock /= 1000; + var->pixclock = KHZ2PICOS(var->pixclock); + + if (HSYNC_POSITIVE) + var->sync |= FB_SYNC_HOR_HIGH_ACT; + if (VSYNC_POSITIVE) + var->sync |= FB_SYNC_VERT_HIGH_ACT; + */ + return 1; + } + } + return 0; +} + +void getResolution(UInt32* x, UInt32* y, UInt32* bp) +{ +// int val; + static UInt32 xResolution, yResolution, bpResolution; +/* + if(getIntForKey(kScreenWidth, &val, &bootInfo->chameleonConfig)) + { + xResolution = val; + } + + if(getIntForKey(kScreenHeight, &val, &bootInfo->chameleonConfig)) + { + yResolution = val; + } +*/ + bpResolution = 32; // assume 32bits + + + if(!xResolution || !yResolution || !bpResolution) + { + + char* edidInfo = readEDID(); + + if(!edidInfo) return; + + edid_mode mode; + // TODO: check *all* resolutions reported and either use the highest, or the native resolution (if there is a flag for that) + //xResolution = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4); + //yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4); + //Slice - done here + + if(fb_parse_edid((struct EDID *)edidInfo, &mode) == 0) + { + xResolution = DEFAULT_SCREEN_WIDTH; + yResolution = DEFAULT_SCREEN_HEIGHT; + } + else { + xResolution = mode.h_active; + yResolution = mode.v_active; + } + + /* + 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x32 0x0C + 0x00 0xDF 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0x00 + 0x0C 0xDF 0x00 0x00 0x12 0x03 0x21 0x78 0xE9 0x99 + 0x53 0x28 0xFF 0xFF 0x32 0xDF 0x00 0x12 0x80 0x78 + 0xD5 0x53 0x26 0x00 0x01 0x01 0x01 0x01 0xFF 0x00 + 0xDF 0x00 0x03 0x78 0x99 0x28 0x00 0x01 0x01 0x01 + 0x01 0x21 0x84 0x20 0xFF 0x0C 0x00 0x03 0x0A 0x53 + 0x54 0x01 0x01 0x01 0xDE 0x84 0x56 0x00 0xA0 0x30 + 0xFF 0xDF 0x12 0x78 0x53 0x00 0x01 0x01 0x01 0x84 + 0x00 0x18 0x84 0x00 0x00 0x57 0xFF 0x00 0x80 0x99 + 0x54 0x01 0x01 0x21 0x20 0x00 0x50 0x00 0x00 0x35 + 0x57 0xFE 0x00 0x00 0x78 0x28 0x01 0x01 0x21 0x20 + 0x18 0x30 0x00 0x57 0x34 0xFE 0xAA 0x9A + + */ + + //msglog("H Active = %d ", edidInfo[56] | ((edidInfo[58] & 0xF0) << 4) ); + //msglog("V Active = %d \n", edidInfo[59] | ((edidInfo[61] & 0xF0) << 4) ); + + free( edidInfo ); + + //if(!xResolution) xResolution = DEFAULT_SCREEN_WIDTH; + //if(!yResolution) yResolution = DEFAULT_SCREEN_HEIGHT; + + } + + *x = xResolution; + *y = yResolution; + *bp = bpResolution; + +} + +char* readEDID() +{ + SInt16 last_reported = -1; + UInt8 edidInfo[EDID_BLOCK_SIZE]; + + UInt8 header1[] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}; + UInt8 header2[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + + SInt16 status; + UInt16 blocks_left = 1; +// msglog("readEDID\n"); + do + { + // TODO: This currently only retrieves the *last* block, make the block buffer expand as needed / calculated from the first block + + bzero( edidInfo, EDID_BLOCK_SIZE); + + status = getEDID(edidInfo, blocks_left); + + /* + msglog("Buffer location: 0x%X status: %d\n", SEG(edidInfo) << 16 | OFF(edidInfo), status); + + int j, i; + for (j = 0; j < 8; j++) { + for(i = 0; i < 16; i++) msglog(" 0x%02X", edidInfo[((i+1) * (j + 1)) - 1]); + msglog("\n"); + } + */ + + + if(status == 0) + { + //if( edidInfo[0] == 0x00 || edidInfo[0] == 0xFF) + if((memcmp(edidInfo, header1, sizeof(header1)) != 0) || + (memcmp(edidInfo, header2, sizeof(header2)) != 0) ) + { + blocks_left--; + int reported = edidInfo[ EDID_V1_BLOCKS_TO_GO_OFFSET ]; + + if ( reported > blocks_left ) + { + + msglog("EDID claims %d more blocks left\n", reported); + } + + if ( (last_reported <= reported && last_reported != -1) + || reported == 0xff + /* 0xff frequently comes up in corrupt edids */ + //|| reported == MAGIC + ) + { + msglog("Last reported %d\n", last_reported); + msglog("EDID blocks left is wrong.\n" + "Your EDID is probably invalid.\n"); + return 0; + } + else + { + //printf("Reading EDID block\n"); + //printf("H Active = %d", ebiosInfo[56] | ((ebiosInfo[58] & 0xF0) << 4) ); + //printf("V Active = %d", ebiosInfo[59] | ((ebiosInfo[61] & 0xF0) << 4) ); + + last_reported = reported; + blocks_left = reported; + } + } + else + { + msglog("Invalid block %d\n", blocks_left); + msglog("Header1 = %d", memcmp(edidInfo, header1, sizeof(header1)) ); + msglog("Header2 = %d", memcmp(edidInfo, header2, sizeof(header2)) ); + return 0; + } + } + blocks_left = 0; + } while(blocks_left); + + char* ret = malloc(sizeof(edidInfo)); + memcpy(ret, edidInfo, sizeof(edidInfo)); + return ret; +} + + +int getEDID( void * edidBlock, UInt8 block) +{ + biosBuf_t bb; + + bzero(&bb, sizeof(bb)); + bb.intno = 0x10; + bb.eax.rr = 0x4F15; + bb.ebx.r.l= 0x01; + bb.edx.rr = block; + + bb.es = SEG( edidBlock ); + bb.edi.rr = OFF( edidBlock ); + + bios( &bb ); + return(bb.eax.r.h); +} diff --git a/i386/modules/Resolution/.svn/text-base/shortatombios.h.svn-base b/i386/modules/Resolution/.svn/text-base/shortatombios.h.svn-base new file mode 100644 index 0000000..4ca8e46 --- /dev/null +++ b/i386/modules/Resolution/.svn/text-base/shortatombios.h.svn-base @@ -0,0 +1,192 @@ +/****************************************************************************/ +/*Portion I: Definitions shared between VBIOS and Driver */ +/****************************************************************************/ + + +#ifndef _SHORT_ATOMBIOS_H +#define _SHORT_ATOMBIOS_H + +#define ATOM_VERSION_MAJOR 0x00020000 +#define ATOM_VERSION_MINOR 0x00000002 + +#define ATOM_HEADER_VERSION (ATOM_VERSION_MAJOR | ATOM_VERSION_MINOR) + +typedef unsigned char BOOLEAN; +typedef signed char INT8; +typedef unsigned char UINT8; +typedef signed short INT16; +typedef unsigned short UINT16; +typedef signed long INT32; +typedef unsigned long UINT32; +typedef unsigned char CHAR8; +typedef unsigned short CHAR16; +typedef unsigned short USHORT; +typedef unsigned char UCHAR; +typedef unsigned long ULONG; + +#pragma pack(1) /* BIOS data must use byte aligment */ + +/* Define offset to location of ROM header. */ + +#define OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER 0x00000048L +#define OFFSET_TO_ATOM_ROM_IMAGE_SIZE 0x00000002L + +typedef struct _ATOM_COMMON_TABLE_HEADER +{ + USHORT usStructureSize; + UCHAR ucTableFormatRevision; /*Change it when the Parser is not backward compatible */ + UCHAR ucTableContentRevision; /*Change it only when the table needs to change but the firmware */ + /*Image can't be updated, while Driver needs to carry the new table! */ +} ATOM_COMMON_TABLE_HEADER; + +typedef struct _ATOM_ROM_HEADER +{ + ATOM_COMMON_TABLE_HEADER sHeader; + UCHAR uaFirmWareSignature[4]; /*Signature to distinguish between Atombios and non-atombios, + + atombios should init it as "ATOM", don't change the position */ + USHORT usBiosRuntimeSegmentAddress; + USHORT usProtectedModeInfoOffset; + USHORT usConfigFilenameOffset; + USHORT usCRC_BlockOffset; + USHORT usBIOS_BootupMessageOffset; + USHORT usInt10Offset; + USHORT usPciBusDevInitCode; + USHORT usIoBaseAddress; + USHORT usSubsystemVendorID; + USHORT usSubsystemID; + USHORT usPCI_InfoOffset; + USHORT usMasterCommandTableOffset; /*Offset for SW to get all command table offsets, Don't change the position */ + USHORT usMasterDataTableOffset; /*Offset for SW to get all data table offsets, Don't change the position */ + UCHAR ucExtendedFunctionCode; + UCHAR ucReserved; +} ATOM_ROM_HEADER; + +/****************************************************************************/ +// Structure used in Data.mtb +/****************************************************************************/ +typedef struct _ATOM_MASTER_LIST_OF_DATA_TABLES +{ + USHORT UtilityPipeLine; // Offest for the utility to get parser info,Don't change this position! + USHORT MultimediaCapabilityInfo; // Only used by MM Lib,latest version 1.1, not configuable from Bios, need to include the table to build Bios + USHORT MultimediaConfigInfo; // Only used by MM Lib,latest version 2.1, not configuable from Bios, need to include the table to build Bios + USHORT StandardVESA_Timing; // Only used by Bios + USHORT FirmwareInfo; // Shared by various SW components,latest version 1.4 + USHORT DAC_Info; // Will be obsolete from R600 + USHORT LVDS_Info; // Shared by various SW components,latest version 1.1 + USHORT TMDS_Info; // Will be obsolete from R600 + USHORT AnalogTV_Info; // Shared by various SW components,latest version 1.1 + USHORT SupportedDevicesInfo; // Will be obsolete from R600 + USHORT GPIO_I2C_Info; // Shared by various SW components,latest version 1.2 will be used from R600 + USHORT VRAM_UsageByFirmware; // Shared by various SW components,latest version 1.3 will be used from R600 + USHORT GPIO_Pin_LUT; // Shared by various SW components,latest version 1.1 + USHORT VESA_ToInternalModeLUT; // Only used by Bios + USHORT ComponentVideoInfo; // Shared by various SW components,latest version 2.1 will be used from R600 + USHORT PowerPlayInfo; // Shared by various SW components,latest version 2.1,new design from R600 + USHORT CompassionateData; // Will be obsolete from R600 + USHORT SaveRestoreInfo; // Only used by Bios + USHORT PPLL_SS_Info; // Shared by various SW components,latest version 1.2, used to call SS_Info, change to new name because of int ASIC SS info + USHORT OemInfo; // Defined and used by external SW, should be obsolete soon + USHORT XTMDS_Info; // Will be obsolete from R600 + USHORT MclkSS_Info; // Shared by various SW components,latest version 1.1, only enabled when ext SS chip is used + USHORT Object_Header; // Shared by various SW components,latest version 1.1 + USHORT IndirectIOAccess; // Only used by Bios,this table position can't change at all!! + USHORT MC_InitParameter; // Only used by command table + USHORT ASIC_VDDC_Info; // Will be obsolete from R600 + USHORT ASIC_InternalSS_Info; // New tabel name from R600, used to be called "ASIC_MVDDC_Info" + USHORT TV_VideoMode; // Only used by command table + USHORT VRAM_Info; // Only used by command table, latest version 1.3 + USHORT MemoryTrainingInfo; // Used for VBIOS and Diag utility for memory training purpose since R600. the new table rev start from 2.1 + USHORT IntegratedSystemInfo; // Shared by various SW components + USHORT ASIC_ProfilingInfo; // New table name from R600, used to be called "ASIC_VDDCI_Info" for pre-R600 + USHORT VoltageObjectInfo; // Shared by various SW components, latest version 1.1 + USHORT PowerSourceInfo; // Shared by various SW components, latest versoin 1.1 +} ATOM_MASTER_LIST_OF_DATA_TABLES; + +typedef struct _ATOM_MASTER_DATA_TABLE +{ + ATOM_COMMON_TABLE_HEADER sHeader; + ATOM_MASTER_LIST_OF_DATA_TABLES ListOfDataTables; +} ATOM_MASTER_DATA_TABLE; + +typedef union _ATOM_MODE_MISC_INFO_ACCESS +{ + USHORT usAccess; +} ATOM_MODE_MISC_INFO_ACCESS; + +/****************************************************************************/ +// Structure used in StandardVESA_TimingTable +// AnalogTV_InfoTable +// ComponentVideoInfoTable +/****************************************************************************/ +typedef struct _ATOM_MODE_TIMING +{ + USHORT usCRTC_H_Total; + USHORT usCRTC_H_Disp; + USHORT usCRTC_H_SyncStart; + USHORT usCRTC_H_SyncWidth; + USHORT usCRTC_V_Total; + USHORT usCRTC_V_Disp; + USHORT usCRTC_V_SyncStart; + USHORT usCRTC_V_SyncWidth; + USHORT usPixelClock; //in 10Khz unit + ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo; + USHORT usCRTC_OverscanRight; + USHORT usCRTC_OverscanLeft; + USHORT usCRTC_OverscanBottom; + USHORT usCRTC_OverscanTop; + USHORT usReserve; + UCHAR ucInternalModeNumber; + UCHAR ucRefreshRate; +} ATOM_MODE_TIMING; + +typedef struct _ATOM_DTD_FORMAT +{ + USHORT usPixClk; + USHORT usHActive; + USHORT usHBlanking_Time; + USHORT usVActive; + USHORT usVBlanking_Time; + USHORT usHSyncOffset; + USHORT usHSyncWidth; + USHORT usVSyncOffset; + USHORT usVSyncWidth; + USHORT usImageHSize; + USHORT usImageVSize; + UCHAR ucHBorder; + UCHAR ucVBorder; + ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo; + UCHAR ucInternalModeNumber; + UCHAR ucRefreshRate; +} ATOM_DTD_FORMAT; + +typedef struct _ATOM_LVDS_INFO_V12 +{ + ATOM_COMMON_TABLE_HEADER sHeader; + ATOM_DTD_FORMAT sLCDTiming; + USHORT usExtInfoTableOffset; + USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec. + USHORT usOffDelayInMs; + UCHAR ucPowerSequenceDigOntoDEin10Ms; + UCHAR ucPowerSequenceDEtoBLOnin10Ms; + UCHAR ucLVDS_Misc; // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level} + // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888} + // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled} + // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled} + UCHAR ucPanelDefaultRefreshRate; + UCHAR ucPanelIdentification; + UCHAR ucSS_Id; + USHORT usLCDVenderID; + USHORT usLCDProductID; + UCHAR ucLCDPanel_SpecialHandlingCap; + UCHAR ucPanelInfoSize; // start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable + UCHAR ucReserved[2]; +} ATOM_LVDS_INFO_V12; + + +typedef struct _ATOM_STANDARD_VESA_TIMING +{ + ATOM_COMMON_TABLE_HEADER sHeader; + char * aModeTimings; // 16 is not the real array number, just for initial allocation +} ATOM_STANDARD_VESA_TIMING; + +#endif \ No newline at end of file diff --git a/i386/modules/Resolution/915resolution.c b/i386/modules/Resolution/915resolution.c new file mode 100644 index 0000000..8b1547c --- /dev/null +++ b/i386/modules/Resolution/915resolution.c @@ -0,0 +1,937 @@ +/* + * resolution.h + * + * NOTE: I don't beleive this code is production ready / should be in trunk + * Atleast, not in it's current state. + * + * Created by Evan Lojewski on 3/4/10. + * Copyright 2009. All rights reserved. + * + */ +#ifndef _RESOLUTION_H_ +#define _RESOLUTION_H_ + +//#include "libsaio.h" +//#include "edid.h" //included +#include "915resolution.h" + + +void patchVideoBios() +{ + UInt32 x = 0, y = 0, bp = 0; + + verbose("Resolution:\n"); + getResolution(&x, &y, &bp); + + if (x != 0 && + y != 0 && + bp != 0) + { + vbios_map * map; + + map = open_vbios(CT_UNKNOWN); + if(map) + { + unlock_vbios(map); + + set_mode(map, x, y, bp, 0, 0); + + relock_vbios(map); + + close_vbios(map); + } + } +} + + +/* Copied from 915 resolution created by steve tomljenovic + * + * This code is based on the techniques used in : + * + * - 855patch. Many thanks to Christian Zietz (czietz gmx net) + * for demonstrating how to shadow the VBIOS into system RAM + * and then modify it. + * + * - 1280patch by Andrew Tipton (andrewtipton null li). + * + * - 855resolution by Alain Poirier + * + * This source code is into the public domain. + */ + +/** + ** + **/ + +#define CONFIG_MECH_ONE_ADDR 0xCF8 +#define CONFIG_MECH_ONE_DATA 0xCFC + +int freqs[] = { 60, 75, 85 }; + +UInt32 get_chipset_id(void) +{ + outl(CONFIG_MECH_ONE_ADDR, 0x80000000); + return inl(CONFIG_MECH_ONE_DATA); +} + +chipset_type get_chipset(UInt32 id) +{ + chipset_type type; + + switch (id) { + case 0x35758086: + type = CT_830; + break; + + case 0x25608086: + type = CT_845G; + break; + + case 0x35808086: + type = CT_855GM; + break; + + case 0x25708086: + type = CT_865G; + break; + + case 0x25808086: + type = CT_915G; + break; + + case 0x25908086: + type = CT_915GM; + break; + + case 0x27708086: + type = CT_945G; + break; + + case 0x27a08086: + type = CT_945GM; + break; + + case 0x27ac8086: + type = CT_945GME; + break; + + case 0x29708086: + type = CT_946GZ; + break; + + case 0x27748086: + type = CT_955X; + break; + + case 0x277c8086: + type = CT_975X; + break; + + case 0x29a08086: + type = CT_G965; + break; + + case 0x29908086: + type = CT_Q965; + break; + + case 0x81008086: + type = CT_500; + break; + + case 0x2e108086: + case 0X2e908086: + type = CT_B43; + break; + + case 0x2e208086: + type = CT_P45; + break; + + case 0x2e308086: + type = CT_G41; + break; + + case 0x29c08086: + type = CT_G31; + break; + + case 0x29208086: + type = CT_G45; + break; + + case 0xA0108086: // mobile + case 0xA0008086: // desktop + type = CT_3150; + break; + + case 0x2a008086: + type = CT_965GM; + break; + + case 0x29e08086: + type = CT_X48; + break; + + case 0x2a408086: + type = CT_GM45; + break; + + // + // Core processors + // http://pci-ids.ucw.cz/read/PC/8086 + // + case 0x00408086: // Core Processor DRAM Controller + case 0x00448086: // Core Processor DRAM Controller + case 0x00488086: // Core Processor DRAM Controller + case 0x00698086: // Core Processor DRAM Controller + + case 0x01008086: // 2nd Generation Core Processor Family DRAM Controller + case 0x01048086: // 2nd Generation Core Processor Family DRAM Controller + case 0x01088086: // Xeon E3-1200 2nd Generation Core Processor Family DRAM Controller + case 0x010c8086: // Xeon E3-1200 2nd Generation Core Processor Family DRAM Controller + + case 0x01508086: // 3rd Generation Core Processor Family DRAM Controller + case 0x01548086: // 3rd Generation Core Processor Family DRAM Controller + case 0x01588086: // 3rd Generation Core Processor Family DRAM Controller + case 0x015c8086: // 3rd Generation Core Processor Family DRAM Controller + verbose(" core proc identified\n"); + type = CT_CORE_PROC; + break; + + + default: + if((id & 0x0000FFFF) == 0x00008086) // Intel chipset + { + //printf("Unknown chipset 0x%llX, please email id to meklort@gmail.com", id); + //getc(); + type = CT_UNKNOWN_INTEL; + //type = CT_UNKNOWN; + + } + else + { + type = CT_UNKNOWN; + } + break; + } + return type; +} + +vbios_resolution_type1 * map_type1_resolution(vbios_map * map, UInt16 res) +{ + vbios_resolution_type1 * ptr = ((vbios_resolution_type1*)(map->bios_ptr + res)); + return ptr; +} + +vbios_resolution_type2 * map_type2_resolution(vbios_map * map, UInt16 res) +{ + vbios_resolution_type2 * ptr = ((vbios_resolution_type2*)(map->bios_ptr + res)); + return ptr; +} + +vbios_resolution_type3 * map_type3_resolution(vbios_map * map, UInt16 res) +{ + vbios_resolution_type3 * ptr = ((vbios_resolution_type3*)(map->bios_ptr + res)); + return ptr; +} + +char detect_bios_type(vbios_map * map, char modeline, int entry_size) +{ + UInt32 i; + UInt16 r1, r2; + + r1 = r2 = 32000; + + for (i=0; i < map->mode_table_size; i++) + { + if (map->mode_table[i].resolution <= r1) + { + r1 = map->mode_table[i].resolution; + } + else + { + if (map->mode_table[i].resolution <= r2) + { + r2 = map->mode_table[i].resolution; + } + } + + /*printf("r1 = %d r2 = %d\n", r1, r2);*/ + } + + return (r2-r1-6) % entry_size == 0; +} + +void close_vbios(vbios_map * map); + +char detect_ati_bios_type(vbios_map * map) +{ + return map->mode_table_size % sizeof(ATOM_MODE_TIMING) == 0; +} + + +vbios_map * open_vbios(chipset_type forced_chipset) +{ + UInt32 z; + vbios_map * map = malloc(sizeof(vbios_map)); + for(z=0; z<sizeof(vbios_map); z++) ((char*)map)[z]=0; + /* + * Determine chipset + */ + + if (forced_chipset == CT_UNKNOWN) + { + map->chipset_id = get_chipset_id(); + map->chipset = get_chipset(map->chipset_id); + } + else if (forced_chipset != CT_UNKNOWN) + { + map->chipset = forced_chipset; + } + + + if (map->chipset == CT_UNKNOWN) + { + verbose(" Unknown chipset type: %08x.\n", map->chipset_id); + //verbose("915resolution only works with Intel 800/900 series graphic chipsets.\n"); + //verbose("Chipset Id: %x\n", map->chipset_id); + close_vbios(map); + return 0; + } else { + verbose(" Detected chipset/proc id (DRAM controller): %08x\n", map->chipset_id); + } + + + verbose(" VBios: "); + /* + * Map the video bios to memory + */ + map->bios_ptr=(char*)VBIOS_START; + + /* + * check if we have ATI Radeon + */ + map->ati_tables.base = map->bios_ptr; + map->ati_tables.AtomRomHeader = (ATOM_ROM_HEADER *) (map->bios_ptr + *(unsigned short *) (map->bios_ptr + OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER)); + if (strcmp ((char *) map->ati_tables.AtomRomHeader->uaFirmWareSignature, "ATOM") == 0) + { + verbose("ATI"); + // ATI Radeon Card + map->bios = BT_ATI_1; + + map->ati_tables.MasterDataTables = (unsigned short *) &((ATOM_MASTER_DATA_TABLE *) (map->bios_ptr + map->ati_tables.AtomRomHeader->usMasterDataTableOffset))->ListOfDataTables; + unsigned short std_vesa_offset = (unsigned short) ((ATOM_MASTER_LIST_OF_DATA_TABLES *)map->ati_tables.MasterDataTables)->StandardVESA_Timing; + ATOM_STANDARD_VESA_TIMING * std_vesa = (ATOM_STANDARD_VESA_TIMING *) (map->bios_ptr + std_vesa_offset); + + map->ati_mode_table = (char *) &std_vesa->aModeTimings; + if (map->ati_mode_table == 0) + { + printf("Unable to locate the mode table.\n"); + printf("Please run the program 'dump_bios' as root and\n"); + printf("email the file 'vbios.dmp' to stomljen@yahoo.com.\n"); + printf("Chipset: %d\n", map->chipset); + close_vbios(map); + return 0; + } + map->mode_table_size = std_vesa->sHeader.usStructureSize - sizeof(ATOM_COMMON_TABLE_HEADER); + + if (!detect_ati_bios_type(map)) map->bios = BT_ATI_2; + + if (map->bios == BT_ATI_1) { + verbose(", BT_ATI_1\n"); + } else { + verbose(", BT_ATI_2\n"); + } + } + else { + + /* + * check if we have NVIDIA + */ + + int i = 0; + while (i < 512) + { // we don't need to look through the whole bios, just the first 512 bytes + if (( map->bios_ptr[i] == 'N') + && (map->bios_ptr[i+1] == 'V') + && (map->bios_ptr[i+2] == 'I') + && (map->bios_ptr[i+3] == 'D')) + { + verbose("nVidia\n"); + map->bios = BT_NVDA; + unsigned short nv_data_table_offset = 0; + unsigned short * nv_data_table; + NV_VESA_TABLE * std_vesa; + + int i = 0; + + while (i < 0x300) + { //We don't need to look for the table in the whole bios, the 768 first bytes only + if (( map->bios_ptr[i] == 0x44) + && (map->bios_ptr[i+1] == 0x01) + && (map->bios_ptr[i+2] == 0x04) + && (map->bios_ptr[i+3] == 0x00)) + { + nv_data_table_offset = (unsigned short) (map->bios_ptr[i+4] | (map->bios_ptr[i+5] << 8)); + break; + } + i++; + } + + nv_data_table = (unsigned short *) (map->bios_ptr + (nv_data_table_offset + OFFSET_TO_VESA_TABLE_INDEX)); + std_vesa = (NV_VESA_TABLE *) (map->bios_ptr + *nv_data_table); + + map->nv_mode_table = (char *) std_vesa->sModelines; + if (map->nv_mode_table == 0) + { + printf("Unable to locate the mode table.\n"); + printf("Please run the program 'dump_bios' as root and\n"); + printf("email the file 'vbios.dmp' to stomljen@yahoo.com.\n"); + printf("Chipset: %s\n", map->chipset); + close_vbios(map); + return 0; + } + map->mode_table_size = std_vesa->sHeader.usTable_Size; + + break; + } + i++; + } + } + + + /* + * check if we have Intel + */ + + /*if (map->chipset == CT_UNKNOWN && memmem(map->bios_ptr, VBIOS_SIZE, INTEL_SIGNATURE, strlen(INTEL_SIGNATURE))) { + printf( "Intel chipset detected. However, 915resolution was unable to determine the chipset type.\n"); + + printf("Chipset Id: %x\n", map->chipset_id); + + printf("Please report this problem to stomljen@yahoo.com\n"); + + close_vbios(map); + return 0; + }*/ + + /* + * check for others + */ + + + + /* + * Figure out where the mode table is + */ + if ((map->bios != BT_ATI_1) && (map->bios != BT_ATI_2) && (map->bios != BT_NVDA)) + { + char* p = map->bios_ptr + 16; + char* limit = map->bios_ptr + VBIOS_SIZE - (3 * sizeof(vbios_mode)); + + verbose("Other"); + while (p < limit && map->mode_table == 0) + { + vbios_mode * mode_ptr = (vbios_mode *) p; + + if (((mode_ptr[0].mode & 0xf0) == 0x30) && ((mode_ptr[1].mode & 0xf0) == 0x30) && + ((mode_ptr[2].mode & 0xf0) == 0x30) && ((mode_ptr[3].mode & 0xf0) == 0x30)) + { + map->mode_table = mode_ptr; + } + + p++; + } + + if (map->mode_table == 0) + { + close_vbios(map); + return 0; + } + } + + + /* + * Determine size of mode table + */ + if ((map->bios != BT_ATI_1) && (map->bios != BT_ATI_2) && (map->bios != BT_NVDA)) + { + vbios_mode * mode_ptr = map->mode_table; + + while (mode_ptr->mode != 0xff) + { + map->mode_table_size++; + mode_ptr++; + } + } + + /* + * Figure out what type of bios we have + * order of detection is important + */ + if ((map->bios != BT_ATI_1) && (map->bios != BT_ATI_2) && (map->bios != BT_NVDA)) + { + if (detect_bios_type(map, TRUE, sizeof(vbios_modeline_type3))) + { + map->bios = BT_3; + verbose(", BT_3\n"); + } + else if (detect_bios_type(map, TRUE, sizeof(vbios_modeline_type2))) + { + map->bios = BT_2; + verbose(", BT_2\n"); + } + else if (detect_bios_type(map, FALSE, sizeof(vbios_resolution_type1))) + { + map->bios = BT_1; + verbose(", BT_1\n"); + } + else { + verbose(" - unknown\n"); + return 0; + } + } + + return map; +} + +void close_vbios(vbios_map * map) +{ + free(map); +} + +void unlock_vbios(vbios_map * map) +{ + + map->unlocked = TRUE; + + switch (map->chipset) { + case CT_UNKNOWN: + break; + case CT_830: + case CT_855GM: + outl(CONFIG_MECH_ONE_ADDR, 0x8000005a); + map->b1 = inb(CONFIG_MECH_ONE_DATA + 2); + + outl(CONFIG_MECH_ONE_ADDR, 0x8000005a); + outb(CONFIG_MECH_ONE_DATA + 2, 0x33); + break; + case CT_845G: + case CT_865G: + case CT_915G: + case CT_915GM: + case CT_945G: + case CT_945GM: + case CT_945GME: + case CT_946GZ: + case CT_G965: + case CT_Q965: + case CT_965GM: + case CT_975X: + case CT_P35: + case CT_955X: + case CT_X48: + case CT_B43: + case CT_Q45: + case CT_P45: + case CT_GM45: + case CT_G45: + case CT_G41: + case CT_G31: + case CT_500: + case CT_3150: + outl(CONFIG_MECH_ONE_ADDR, 0x80000090); + map->b1 = inb(CONFIG_MECH_ONE_DATA + 1); + map->b2 = inb(CONFIG_MECH_ONE_DATA + 2); + outl(CONFIG_MECH_ONE_ADDR, 0x80000090); + outb(CONFIG_MECH_ONE_DATA + 1, 0x33); + outb(CONFIG_MECH_ONE_DATA + 2, 0x33); + break; + case CT_CORE_PROC: // Core procs - PAM regs are 80h - 86h + case CT_UNKNOWN_INTEL: // Assume newer intel chipset is the same as before + outl(CONFIG_MECH_ONE_ADDR, 0x80000080); + map->b1 = inb(CONFIG_MECH_ONE_DATA + 1); + map->b2 = inb(CONFIG_MECH_ONE_DATA + 2); + outl(CONFIG_MECH_ONE_ADDR, 0x80000080); + outb(CONFIG_MECH_ONE_DATA + 1, 0x33); + outb(CONFIG_MECH_ONE_DATA + 2, 0x33); + break; + } + +#if DEBUG + { + UInt32 t = inl(CONFIG_MECH_ONE_DATA); + verbose("unlock PAM: (0x%08x)\n", t); + } +#endif +} + +void relock_vbios(vbios_map * map) +{ + + map->unlocked = FALSE; + + switch (map->chipset) + { + case CT_UNKNOWN: + break; + case CT_830: + case CT_855GM: + outl(CONFIG_MECH_ONE_ADDR, 0x8000005a); + outb(CONFIG_MECH_ONE_DATA + 2, map->b1); + break; + case CT_845G: + case CT_865G: + case CT_915G: + case CT_915GM: + case CT_945G: + case CT_945GM: + case CT_945GME: + case CT_946GZ: + case CT_G965: + case CT_955X: + case CT_G45: + case CT_Q965: + case CT_965GM: + case CT_975X: + case CT_P35: + case CT_X48: + case CT_B43: + case CT_Q45: + case CT_P45: + case CT_GM45: + case CT_G41: + case CT_G31: + case CT_500: + case CT_3150: + outl(CONFIG_MECH_ONE_ADDR, 0x80000090); + outb(CONFIG_MECH_ONE_DATA + 1, map->b1); + outb(CONFIG_MECH_ONE_DATA + 2, map->b2); + break; + case CT_CORE_PROC: + case CT_UNKNOWN_INTEL: + outl(CONFIG_MECH_ONE_ADDR, 0x80000080); + outb(CONFIG_MECH_ONE_DATA + 1, map->b1); + outb(CONFIG_MECH_ONE_DATA + 2, map->b2); + break; + } + +#if DEBUG + { + UInt32 t = inl(CONFIG_MECH_ONE_DATA); + verbose("relock PAM: (0x%08x)\n", t); + } +#endif +} + + +int getMode(edid_mode *mode) +{ + char* edidInfo = readEDID(); + + if(!edidInfo) return 1; +//Slice + if(!fb_parse_edid((struct EDID *)edidInfo, mode) || !mode->h_active) + { + free( edidInfo ); + return 1; + } +/* mode->pixel_clock = (edidInfo[55] << 8) | edidInfo[54]; + mode->h_active = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4); + mode->h_blanking = ((edidInfo[58] & 0x0F) << 8) | edidInfo[57]; + mode->v_active = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4); + mode->v_blanking = ((edidInfo[61] & 0x0F) << 8) | edidInfo[60]; + mode->h_sync_offset = ((edidInfo[65] & 0xC0) >> 2) | edidInfo[62]; + mode->h_sync_width = (edidInfo[65] & 0x30) | edidInfo[63]; + mode->v_sync_offset = (edidInfo[65] & 0x0C) | ((edidInfo[64] & 0x0C) >> 2); + mode->v_sync_width = ((edidInfo[65] & 0x3) << 2) | (edidInfo[64] & 0x03); +*/ + + free( edidInfo ); + + return 0; + +} + + +static void gtf_timings(UInt32 x, UInt32 y, UInt32 freq, + unsigned long *clock, + UInt16 *hsyncstart, UInt16 *hsyncend, UInt16 *hblank, + UInt16 *vsyncstart, UInt16 *vsyncend, UInt16 *vblank) +{ + UInt32 hbl, vbl, vfreq; + + vbl = y + (y+1)/(20000.0/(11*freq) - 1) + 1.5; + vfreq = vbl * freq; + hbl = 16 * (int)(x * (30.0 - 300000.0 / vfreq) / + + (70.0 + 300000.0 / vfreq) / 16.0 + 0.5); + + *vsyncstart = y; + *vsyncend = y + 3; + *vblank = vbl - 1; + *hsyncstart = x + hbl / 2 - (x + hbl + 50) / 100 * 8 - 1; + *hsyncend = x + hbl / 2 - 1; + *hblank = x + hbl - 1; + *clock = (x + hbl) * vfreq / 1000; +} + +void set_mode(vbios_map * map, /*UInt32 mode,*/ UInt32 x, UInt32 y, UInt32 bp, UInt32 htotal, UInt32 vtotal) { + UInt32 xprev, yprev; + UInt32 i = 0, j; + // patch first available mode + + // for (i=0; i < map->mode_table_size; i++) { + // if (map->mode_table[0].mode == mode) { + verbose(" Patching: "); + switch(map->bios) { + case BT_INTEL: + verbose("BT_INTEL - not supported\n"); + return; + + case BT_1: + { + verbose("BT_1 patched.\n"); + vbios_resolution_type1 * res = map_type1_resolution(map, map->mode_table[i].resolution); + + if (bp) { + map->mode_table[i].bits_per_pixel = bp; + } + + res->x2 = (htotal?(((htotal-x) >> 8) & 0x0f) : (res->x2 & 0x0f)) | ((x >> 4) & 0xf0); + res->x1 = (x & 0xff); + + res->y2 = (vtotal?(((vtotal-y) >> 8) & 0x0f) : (res->y2 & 0x0f)) | ((y >> 4) & 0xf0); + res->y1 = (y & 0xff); + if (htotal) + res->x_total = ((htotal-x) & 0xff); + + if (vtotal) + res->y_total = ((vtotal-y) & 0xff); + + break; + } + case BT_2: + { + vbios_resolution_type2 * res = map_type2_resolution(map, map->mode_table[i].resolution); + + res->xchars = x / 8; + res->ychars = y / 16 - 1; + xprev = res->modelines[0].x1; + yprev = res->modelines[0].y1; + + for(j=0; j < 3; j++) { + vbios_modeline_type2 * modeline = &res->modelines[j]; + + if (modeline->x1 == xprev && modeline->y1 == yprev) { + modeline->x1 = modeline->x2 = x-1; + modeline->y1 = modeline->y2 = y-1; + + gtf_timings(x, y, freqs[j], &modeline->clock, + &modeline->hsyncstart, &modeline->hsyncend, + &modeline->hblank, &modeline->vsyncstart, + &modeline->vsyncend, &modeline->vblank); + + if (htotal) + modeline->htotal = htotal; + else + modeline->htotal = modeline->hblank; + + if (vtotal) + modeline->vtotal = vtotal; + else + modeline->vtotal = modeline->vblank; + } + } + verbose("BT_1 patched.\n"); + break; + } + case BT_3: + { + vbios_resolution_type3 * res = map_type3_resolution(map, map->mode_table[i].resolution); + + xprev = res->modelines[0].x1; + yprev = res->modelines[0].y1; + + for (j=0; j < 3; j++) { + vbios_modeline_type3 * modeline = &res->modelines[j]; + + if (modeline->x1 == xprev && modeline->y1 == yprev) { + modeline->x1 = modeline->x2 = x-1; + modeline->y1 = modeline->y2 = y-1; + + gtf_timings(x, y, freqs[j], &modeline->clock, + &modeline->hsyncstart, &modeline->hsyncend, + &modeline->hblank, &modeline->vsyncstart, + &modeline->vsyncend, &modeline->vblank); + if (htotal) + modeline->htotal = htotal; + else + modeline->htotal = modeline->hblank; + if (vtotal) + modeline->vtotal = vtotal; + else + modeline->vtotal = modeline->vblank; + + modeline->timing_h = y-1; + modeline->timing_v = x-1; + } + } + verbose("BT_3 patched.\n"); + break; + } + case BT_ATI_1: + { + verbose("BT_ATI_1"); + edid_mode mode; + + ATOM_MODE_TIMING *mode_timing = (ATOM_MODE_TIMING *) map->ati_mode_table; + + //if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) { + if (!getMode(&mode)) { + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode 0 patched!\n", mode.h_active, mode.v_active); + mode_timing->usCRTC_H_Total = mode.h_active + mode.h_blanking; + mode_timing->usCRTC_H_Disp = mode.h_active; + mode_timing->usCRTC_H_SyncStart = mode.h_active + mode.h_sync_offset; + mode_timing->usCRTC_H_SyncWidth = mode.h_sync_width; + + mode_timing->usCRTC_V_Total = mode.v_active + mode.v_blanking; + mode_timing->usCRTC_V_Disp = mode.v_active; + mode_timing->usCRTC_V_SyncStart = mode.v_active + mode.v_sync_offset; + mode_timing->usCRTC_V_SyncWidth = mode.v_sync_width; + + mode_timing->usPixelClock = mode.pixel_clock; + } else { + verbose(" Edid not found or invalid - vbios not patched!\n"); + } + /*else + { + vbios_modeline_type2 modeline; + + cvt_timings(x, y, freqs[0], &modeline.clock, + &modeline.hsyncstart, &modeline.hsyncend, + &modeline.hblank, &modeline.vsyncstart, + &modeline.vsyncend, &modeline.vblank, 0); + + mode_timing->usCRTC_H_Total = x + modeline.hblank; + mode_timing->usCRTC_H_Disp = x; + mode_timing->usCRTC_H_SyncStart = modeline.hsyncstart; + mode_timing->usCRTC_H_SyncWidth = modeline.hsyncend - modeline.hsyncstart; + + mode_timing->usCRTC_V_Total = y + modeline.vblank; + mode_timing->usCRTC_V_Disp = y; + mode_timing->usCRTC_V_SyncStart = modeline.vsyncstart; + mode_timing->usCRTC_V_SyncWidth = modeline.vsyncend - modeline.vsyncstart; + + mode_timing->usPixelClock = modeline.clock; + }*/ + + break; + } + case BT_ATI_2: + { + verbose("BT_ATI_2"); + edid_mode mode; + + ATOM_DTD_FORMAT *mode_timing = (ATOM_DTD_FORMAT *) map->ati_mode_table; + + /*if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) {*/ + if (!getMode(&mode)) { + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode 0 patched!\n", mode.h_active, mode.v_active); + mode_timing->usHBlanking_Time = mode.h_blanking; + mode_timing->usHActive = mode.h_active; + mode_timing->usHSyncOffset = mode.h_sync_offset; + mode_timing->usHSyncWidth = mode.h_sync_width; + + mode_timing->usVBlanking_Time = mode.v_blanking; + mode_timing->usVActive = mode.v_active; + mode_timing->usVSyncOffset = mode.v_sync_offset; + mode_timing->usVSyncWidth = mode.v_sync_width; + + mode_timing->usPixClk = mode.pixel_clock; + } else { + verbose(" Edid not found or invalid - vbios not patched!\n"); + } + /*else + { + vbios_modeline_type2 modeline; + + cvt_timings(x, y, freqs[0], &modeline.clock, + &modeline.hsyncstart, &modeline.hsyncend, + &modeline.hblank, &modeline.vsyncstart, + &modeline.vsyncend, &modeline.vblank, 0); + + mode_timing->usHBlanking_Time = modeline.hblank; + + mode_timing->usHActive = x; + + mode_timing->usHSyncOffset = modeline.hsyncstart - x; + + mode_timing->usHSyncWidth = modeline.hsyncend - modeline.hsyncstart; + + + + mode_timing->usVBlanking_Time = modeline.vblank; + + mode_timing->usVActive = y; + + mode_timing->usVSyncOffset = modeline.vsyncstart - y; + + mode_timing->usVSyncWidth = modeline.hsyncend - modeline.hsyncstart; + + + + mode_timing->usPixClk = modeline.clock; + + }*/ + + + break; + } + case BT_NVDA: + { + verbose("BT_NVDA"); + edid_mode mode; + + NV_MODELINE *mode_timing = (NV_MODELINE *) map->nv_mode_table; + + /*if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) {*/ + if (!getMode(&mode)) { + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode %d patched!\n", mode.h_active, mode.v_active, i); + mode_timing[i].usH_Total = mode.h_active + mode.h_blanking; + mode_timing[i].usH_Active = mode.h_active; + mode_timing[i].usH_SyncStart = mode.h_active + mode.h_sync_offset; + mode_timing[i].usH_SyncEnd = mode.h_active + mode.h_sync_offset + mode.h_sync_width; + + mode_timing[i].usV_Total = mode.v_active + mode.v_blanking; + mode_timing[i].usV_Active = mode.v_active; + mode_timing[i].usV_SyncStart = mode.v_active + mode.v_sync_offset; + mode_timing[i].usV_SyncEnd = mode.v_active + mode.v_sync_offset + mode.v_sync_width; + + mode_timing[i].usPixel_Clock = mode.pixel_clock; + } else { + verbose(" Edid not found or invalid - vbios not patched!\n"); + } + /*else + { + vbios_modeline_type2 modeline; + + cvt_timings(x, y, freqs[0], &modeline.clock, + &modeline.hsyncstart, &modeline.hsyncend, + &modeline.hblank, &modeline.vsyncstart, + &modeline.vsyncend, &modeline.vblank, 0); + + mode_timing[i].usH_Total = x + modeline.hblank - 1; + mode_timing[i].usH_Active = x; + mode_timing[i].usH_SyncStart = modeline.hsyncstart - 1; + mode_timing[i].usH_SyncEnd = modeline.hsyncend - 1; + + mode_timing[i].usV_Total = y + modeline.vblank - 1; + mode_timing[i].usV_Active = y; + mode_timing[i].usV_SyncStart = modeline.vsyncstart - 1; + mode_timing[i].usV_SyncEnd = modeline.vsyncend - 1; + + mode_timing[i].usPixel_Clock = modeline.clock; + }*/ + break; + } + case BT_UNKNOWN: + { + verbose(" Unknown - vbios not patched\n"); + break; + } + } + // } + // } +} + +#endif // _RESOLUTION_H_ \ No newline at end of file diff --git a/i386/modules/Resolution/915resolution.h b/i386/modules/Resolution/915resolution.h new file mode 100644 index 0000000..3db6f33 --- /dev/null +++ b/i386/modules/Resolution/915resolution.h @@ -0,0 +1,233 @@ +/* + * resolution.h + * + * + * Created by Evan Lojewski on 3/4/10. + * Copyright 2009. All rights reserved. + * + */ + + +#ifndef __RESOLUTION_H +#define __RESOLUTION_H + +#include "shortatombios.h" +#include "edid.h" + +//Slice - moved to edid.h +/* +typedef struct _edid_mode { + unsigned short pixel_clock; + unsigned short h_active; + unsigned short h_blanking; + unsigned short v_active; + unsigned short v_blanking; + unsigned short h_sync_offset; + unsigned short h_sync_width; + unsigned short v_sync_offset; + unsigned short v_sync_width; +} edid_mode; +*/ + + +void patchVideoBios(); + + + +/* Copied from 915 resolution created by steve tomljenovic + * + * This code is based on the techniques used in : + * + * - 855patch. Many thanks to Christian Zietz (czietz gmx net) + * for demonstrating how to shadow the VBIOS into system RAM + * and then modify it. + * + * - 1280patch by Andrew Tipton (andrewtipton null li). + * + * - 855resolution by Alain Poirier + * + * This source code is into the public domain. + */ + +#define VBIOS_START 0xc0000 +#define VBIOS_SIZE 0x10000 + +#define FALSE 0 +#define TRUE 1 + +#define MODE_TABLE_OFFSET_845G 617 + + +#define ATI_SIGNATURE1 "ATI MOBILITY RADEON" +#define ATI_SIGNATURE2 "ATI Technologies Inc" +#define NVIDIA_SIGNATURE "NVIDIA Corp" +#define INTEL_SIGNATURE "Intel Corp" + + + +/* + * NVidia Defines and structures + */ + +#define OFFSET_TO_VESA_TABLE_INDEX 2 + +typedef struct { + unsigned char ucTable_Major; + unsigned char ucTable_Minor; + unsigned char ucTable_Rev; + unsigned short usTable_Size; +} NV_COMMON_TABLE_HEADER; + +typedef struct { + short reserved1; + short reserved2; + short reserved3; +} NV_RESERVED; + +typedef struct { + unsigned short usPixel_Clock; + unsigned short usH_Active; + NV_RESERVED reserved1; + unsigned short usH_SyncStart; + unsigned short usH_SyncEnd; + unsigned short usH_Total; + unsigned short usV_Active; + NV_RESERVED reserved2; + unsigned short usV_SyncStart; + unsigned short usV_SyncEnd; + unsigned short usV_Total; + unsigned short reserved3; +} NV_MODELINE; + +typedef struct { + NV_COMMON_TABLE_HEADER sHeader; + NV_MODELINE * sModelines; +} NV_VESA_TABLE; + +/*---*/ + + +typedef enum { + CT_UNKNOWN, CT_UNKNOWN_INTEL, CT_830, CT_845G, CT_855GM, CT_865G, + CT_915G, CT_915GM, CT_945G, CT_945GM, CT_945GME, CT_946GZ, + CT_955X, CT_G965, CT_Q965, CT_965GM, CT_975X, + CT_P35, CT_X48, CT_B43, CT_Q45, CT_P45, + CT_GM45, CT_G41, CT_G31, CT_G45, CT_500, CT_3150, + CT_CORE_PROC +} chipset_type; + + + +typedef enum { + BT_UNKNOWN, BT_1, BT_2, BT_3, BT_ATI_1, BT_ATI_2, BT_NVDA, BT_INTEL +} bios_type; + + +typedef struct { + char *base; + ATOM_ROM_HEADER *AtomRomHeader; + unsigned short *MasterCommandTables; + unsigned short *MasterDataTables; +} bios_tables_t; + +typedef struct { + UInt8 mode; + UInt8 bits_per_pixel; + UInt16 resolution; + UInt8 unknown; +} __attribute__((packed)) vbios_mode; + +typedef struct { + UInt8 unknow1[2]; + UInt8 x1; + UInt8 x_total; + UInt8 x2; + UInt8 y1; + UInt8 y_total; + UInt8 y2; +} __attribute__((packed)) vbios_resolution_type1; + +typedef struct { + unsigned long clock; + + UInt16 x1; + UInt16 htotal; + UInt16 x2; + UInt16 hblank; + UInt16 hsyncstart; + UInt16 hsyncend; + UInt16 y1; + UInt16 vtotal; + UInt16 y2; + UInt16 vblank; + UInt16 vsyncstart; + UInt16 vsyncend; +} __attribute__((packed)) vbios_modeline_type2; + +typedef struct { + UInt8 xchars; + UInt8 ychars; + UInt8 unknown[4]; + + vbios_modeline_type2 modelines[]; +} __attribute__((packed)) vbios_resolution_type2; + +typedef struct { + unsigned long clock; + + UInt16 x1; + UInt16 htotal; + UInt16 x2; + UInt16 hblank; + UInt16 hsyncstart; + UInt16 hsyncend; + + UInt16 y1; + UInt16 vtotal; + UInt16 y2; + UInt16 vblank; + UInt16 vsyncstart; + UInt16 vsyncend; + + UInt16 timing_h; + UInt16 timing_v; + + UInt8 unknown[6]; +} __attribute__((packed)) vbios_modeline_type3; + +typedef struct { + unsigned char unknown[6]; + + vbios_modeline_type3 modelines[]; +} __attribute__((packed)) vbios_resolution_type3; + +typedef struct { + UInt32 chipset_id; + chipset_type chipset; + bios_type bios; + + bios_tables_t ati_tables; + + + UInt32 bios_fd; + char* bios_ptr; + + vbios_mode * mode_table; + char * ati_mode_table; + char * nv_mode_table; + + UInt32 mode_table_size; + UInt8 b1, b2; + + UInt8 unlocked; +} vbios_map; + + + +vbios_map * open_vbios(chipset_type); +void close_vbios (vbios_map*); +void unlock_vbios(vbios_map*); +void relock_vbios(vbios_map*); +void set_mode(vbios_map*, UInt32, UInt32, UInt32, UInt32, UInt32); + +#endif //__RESOLUTION_H diff --git a/i386/modules/Resolution/Cconfig b/i386/modules/Resolution/Cconfig new file mode 100644 index 0000000..e1059d9 --- /dev/null +++ b/i386/modules/Resolution/Cconfig @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config RESOLUTION_MODULE + tristate "Resolution Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/Resolution/Makefile b/i386/modules/Resolution/Makefile new file mode 100644 index 0000000..31b6558 --- /dev/null +++ b/i386/modules/Resolution/Makefile @@ -0,0 +1,14 @@ +MODULE_NAME = Resolution +MODULE_AUTHOR = Chameleon +MODULE_DESCRIPTION = This module reads the edid information from the monitor attached to the main display. The module will also patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting. +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + + +DIR = Resolution + +MODULE_OBJS = Resolution.o edid.o 915resolution.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/Resolution/Readme.txt b/i386/modules/Resolution/Readme.txt new file mode 100644 index 0000000..14bdb32 --- /dev/null +++ b/i386/modules/Resolution/Readme.txt @@ -0,0 +1,3 @@ +Module: Resolution +Description: This module reads the edid information from the monitor attached to the main display. The module is currently not integrated into trunk and has minimal uses as it stands. Additionally, the module will patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting. +Dependencies: none diff --git a/i386/modules/Resolution/Resolution.c b/i386/modules/Resolution/Resolution.c new file mode 100644 index 0000000..c4bbff3 --- /dev/null +++ b/i386/modules/Resolution/Resolution.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2009 Evan Lojewski. All rights reserved. + * + */ + +#include "915resolution.h" +#include "gui.h" + +void Resolution_start() +{ + UInt32 bp = 0; + UInt32 x, y; + patchVideoBios(); + getResolution(&x, &y, &bp); + gui.screen.width = x; + gui.screen.height = y; +} + diff --git a/i386/modules/Resolution/edid.c b/i386/modules/Resolution/edid.c new file mode 100644 index 0000000..c332151 --- /dev/null +++ b/i386/modules/Resolution/edid.c @@ -0,0 +1,409 @@ +/* + * edid.c + * + * + * Created by Evan Lojewski on 12/1/09. + * Copyright 2009. All rights reserved. + * + * Slice 2010, based on Joblo works + */ + + +//#include "libsaio.h" +#include "edid.h" +#include "vbe.h" +#include "graphics.h" +#include "boot.h" +//---------------------------------------------------------------------------------- + +#define FBMON_FIX_HEADER 1 +#define FBMON_FIX_INPUT 2 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +//---------------------------------------------------------------------------------- +/* +struct broken_edid { + const char manufacturer[4]; + UInt32 model; + UInt32 fix; +}; + +//---------------------------------------------------------------------------------- + +broken_edid brokendb[] = { + // DEC FR-PCXAV-YZ * + { "DEC", 0x073a, FBMON_FIX_HEADER,}, + // ViewSonic PF775a * + { "VSC", 0x5a44, FBMON_FIX_INPUT, } +}; +//---------------------------------------------------------------------------------- +*/ +const unsigned char edid_v1_header[] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 }; + +//---------------------------------------------------------------------------------- +int edid_compare(unsigned char *edid1, unsigned char *edid2) +{ + int result = 0; + unsigned char *block = edid1 + ID_MANUFACTURER_NAME, manufacturer1[4], manufacturer2[4];; + manufacturer1[0] = ((block[0] & 0x7c) >> 2) + '@'; + manufacturer1[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@'; + manufacturer1[2] = (block[1] & 0x1f) + '@'; + manufacturer1[3] = 0; + + block = edid2 + ID_MANUFACTURER_NAME; + manufacturer2[0] = ((block[0] & 0x7c) >> 2) + '@'; + manufacturer2[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@'; + manufacturer2[2] = (block[1] & 0x1f) + '@'; + manufacturer2[3] = 0; + int x; + for(x = 0; x < 4; x++) + { + if(manufacturer1[x] == manufacturer2[x]) + result++; + } + + return result; +} + +int check_edid(unsigned char *edid) +{ + unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4]; + //unsigned char *b; + UInt32 model; + //int i, fix = 0, ret = 0; + + manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; + manufacturer[1] = ((block[0] & 0x03) << 3) + + ((block[1] & 0xe0) >> 5) + '@'; + manufacturer[2] = (block[1] & 0x1f) + '@'; + manufacturer[3] = 0; + model = block[2] + (block[3] << 8); +/* + for (i = 0; i < (int)ARRAY_SIZE(brokendb); i++) { + if (!strncmp((const char *)manufacturer, brokendb[i].manufacturer, 4) && + brokendb[i].model == model) { + DEBG("ATIFB: The EDID Block of " + "Manufacturer: %s Model: 0x%08lx is known to " + "be broken,\n", manufacturer, model); + fix = brokendb[i].fix; + break; + } + } + + switch (fix) { + case FBMON_FIX_HEADER: + for (i = 0; i < 8; i++) { + if (edid[i] != edid_v1_header[i]) + ret = fix; + } + break; + case FBMON_FIX_INPUT: + b = edid + EDID_STRUCT_DISPLAY; + /// Only if display is GTF capable will + //the input type be reset to analog * + if (b[4] & 0x01 && b[0] & 0x80) + ret = fix; + break; + } +*/ + return 0; //ret; +} + +//---------------------------------------------------------------------------------- + +static void fix_edid(unsigned char *edid, int fix) +{ + unsigned char *b; + + switch (fix) { + case FBMON_FIX_HEADER: + msglog("EDID: trying a header reconstruct\n"); + memcpy(edid, edid_v1_header, 8); + break; + case FBMON_FIX_INPUT: + msglog("EDID: trying to fix input type\n"); + b = edid + EDID_STRUCT_DISPLAY; + b[0] &= ~0x80; + edid[127] += 0x80; + } +} + +//---------------------------------------------------------------------------------- + +int edid_checksum(unsigned char *edid) +{ + unsigned char i, csum = 0, all_null = 0; + int err = 0, fix = check_edid(edid); + + if (fix) + fix_edid(edid, fix); + + for (i = 0; i < EDID_LENGTH; i++) { + csum += edid[i]; + all_null |= edid[i]; + } + + if (csum == 0x00 && all_null) { + /* checksum passed, everything's good */ + err = 1; + } + + return err; +} + +//---------------------------------------------------------------------------------- + +static int edid_check_header(unsigned char *edid) +{ + int i, err = 1, fix = check_edid(edid); + + if (fix) + fix_edid(edid, fix); + + for (i = 0; i < 8; i++) { + if (edid[i] != edid_v1_header[i]) + err = 0; + } + + return err; +} +//------------------------------------------------------------------------ +bool verifyEDID(unsigned char *edid) +{ + if (edid == NULL || !edid_checksum(edid) || !edid_check_header(edid)) + { + return false; + } + return true; +} + +int edid_is_timing_block(unsigned char *block) +{ + if ((block[0] != 0x00) || (block[1] != 0x00) || + (block[2] != 0x00) || (block[4] != 0x00)) + return 1; + else + return 0; +} +//---------------------------------------------------------------------------------- + +int fb_parse_edid(struct EDID *edid, edid_mode* var) //(struct EDID *edid, UInt32* x, UInt32* y) +{ + int i; + unsigned char *block; + + if(!verifyEDID((unsigned char *)edid)) return 0; + + block = (unsigned char *)edid + DETAILED_TIMING_DESCRIPTIONS_START; //54 + + for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { + if (edid_is_timing_block(block)) { + var->h_active = H_ACTIVE; + var->v_active = V_ACTIVE; + var->h_sync_offset = H_SYNC_OFFSET; + var->h_sync_width = H_SYNC_WIDTH; + var->h_blanking = H_BLANKING; + var->v_blanking = V_BLANKING; + var->pixel_clock = PIXEL_CLOCK; + var->v_sync_offset = V_SYNC_OFFSET; + var->v_sync_width = V_SYNC_WIDTH; + /* + var->xres = var->xres_virtual = H_ACTIVE; + var->yres = var->yres_virtual = V_ACTIVE; + var->height = var->width = -1; + var->right_margin = H_SYNC_OFFSET; + var->left_margin = (H_ACTIVE + H_BLANKING) - + (H_ACTIVE + H_SYNC_OFFSET + H_SYNC_WIDTH); + var->upper_margin = V_BLANKING - V_SYNC_OFFSET - + V_SYNC_WIDTH; + var->lower_margin = V_SYNC_OFFSET; + var->hsync_len = H_SYNC_WIDTH; + var->vsync_len = V_SYNC_WIDTH; + var->pixclock = PIXEL_CLOCK; + var->pixclock /= 1000; + var->pixclock = KHZ2PICOS(var->pixclock); + + if (HSYNC_POSITIVE) + var->sync |= FB_SYNC_HOR_HIGH_ACT; + if (VSYNC_POSITIVE) + var->sync |= FB_SYNC_VERT_HIGH_ACT; + */ + return 1; + } + } + return 0; +} + +void getResolution(UInt32* x, UInt32* y, UInt32* bp) +{ +// int val; + static UInt32 xResolution, yResolution, bpResolution; +/* + if(getIntForKey(kScreenWidth, &val, &bootInfo->chameleonConfig)) + { + xResolution = val; + } + + if(getIntForKey(kScreenHeight, &val, &bootInfo->chameleonConfig)) + { + yResolution = val; + } +*/ + bpResolution = 32; // assume 32bits + + + if(!xResolution || !yResolution || !bpResolution) + { + + char* edidInfo = readEDID(); + + if(!edidInfo) return; + + edid_mode mode; + // TODO: check *all* resolutions reported and either use the highest, or the native resolution (if there is a flag for that) + //xResolution = edidInfo[56] | ((edidInfo[58] & 0xF0) << 4); + //yResolution = edidInfo[59] | ((edidInfo[61] & 0xF0) << 4); + //Slice - done here + + if(fb_parse_edid((struct EDID *)edidInfo, &mode) == 0) + { + xResolution = DEFAULT_SCREEN_WIDTH; + yResolution = DEFAULT_SCREEN_HEIGHT; + } + else { + xResolution = mode.h_active; + yResolution = mode.v_active; + } + + /* + 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x32 0x0C + 0x00 0xDF 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0x00 + 0x0C 0xDF 0x00 0x00 0x12 0x03 0x21 0x78 0xE9 0x99 + 0x53 0x28 0xFF 0xFF 0x32 0xDF 0x00 0x12 0x80 0x78 + 0xD5 0x53 0x26 0x00 0x01 0x01 0x01 0x01 0xFF 0x00 + 0xDF 0x00 0x03 0x78 0x99 0x28 0x00 0x01 0x01 0x01 + 0x01 0x21 0x84 0x20 0xFF 0x0C 0x00 0x03 0x0A 0x53 + 0x54 0x01 0x01 0x01 0xDE 0x84 0x56 0x00 0xA0 0x30 + 0xFF 0xDF 0x12 0x78 0x53 0x00 0x01 0x01 0x01 0x84 + 0x00 0x18 0x84 0x00 0x00 0x57 0xFF 0x00 0x80 0x99 + 0x54 0x01 0x01 0x21 0x20 0x00 0x50 0x00 0x00 0x35 + 0x57 0xFE 0x00 0x00 0x78 0x28 0x01 0x01 0x21 0x20 + 0x18 0x30 0x00 0x57 0x34 0xFE 0xAA 0x9A + + */ + + //msglog("H Active = %d ", edidInfo[56] | ((edidInfo[58] & 0xF0) << 4) ); + //msglog("V Active = %d \n", edidInfo[59] | ((edidInfo[61] & 0xF0) << 4) ); + + free( edidInfo ); + + //if(!xResolution) xResolution = DEFAULT_SCREEN_WIDTH; + //if(!yResolution) yResolution = DEFAULT_SCREEN_HEIGHT; + + } + + *x = xResolution; + *y = yResolution; + *bp = bpResolution; + +} + +char* readEDID() +{ + SInt16 last_reported = -1; + UInt8 edidInfo[EDID_BLOCK_SIZE]; + + UInt8 header1[] = {0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}; + UInt8 header2[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + + SInt16 status; + UInt16 blocks_left = 1; +// msglog("readEDID\n"); + do + { + // TODO: This currently only retrieves the *last* block, make the block buffer expand as needed / calculated from the first block + + bzero( edidInfo, EDID_BLOCK_SIZE); + + status = getEDID(edidInfo, blocks_left); + + /* + msglog("Buffer location: 0x%X status: %d\n", SEG(edidInfo) << 16 | OFF(edidInfo), status); + + int j, i; + for (j = 0; j < 8; j++) { + for(i = 0; i < 16; i++) msglog(" 0x%02X", edidInfo[((i+1) * (j + 1)) - 1]); + msglog("\n"); + } + */ + + + if(status == 0) + { + //if( edidInfo[0] == 0x00 || edidInfo[0] == 0xFF) + if((memcmp(edidInfo, header1, sizeof(header1)) != 0) || + (memcmp(edidInfo, header2, sizeof(header2)) != 0) ) + { + blocks_left--; + int reported = edidInfo[ EDID_V1_BLOCKS_TO_GO_OFFSET ]; + + if ( reported > blocks_left ) + { + + msglog("EDID claims %d more blocks left\n", reported); + } + + if ( (last_reported <= reported && last_reported != -1) + || reported == 0xff + /* 0xff frequently comes up in corrupt edids */ + //|| reported == MAGIC + ) + { + msglog("Last reported %d\n", last_reported); + msglog("EDID blocks left is wrong.\n" + "Your EDID is probably invalid.\n"); + return 0; + } + else + { + //printf("Reading EDID block\n"); + //printf("H Active = %d", ebiosInfo[56] | ((ebiosInfo[58] & 0xF0) << 4) ); + //printf("V Active = %d", ebiosInfo[59] | ((ebiosInfo[61] & 0xF0) << 4) ); + + last_reported = reported; + blocks_left = reported; + } + } + else + { + msglog("Invalid block %d\n", blocks_left); + msglog("Header1 = %d", memcmp(edidInfo, header1, sizeof(header1)) ); + msglog("Header2 = %d", memcmp(edidInfo, header2, sizeof(header2)) ); + return 0; + } + } + blocks_left = 0; + } while(blocks_left); + + char* ret = malloc(sizeof(edidInfo)); + memcpy(ret, edidInfo, sizeof(edidInfo)); + return ret; +} + + +int getEDID( void * edidBlock, UInt8 block) +{ + biosBuf_t bb; + + bzero(&bb, sizeof(bb)); + bb.intno = 0x10; + bb.eax.rr = 0x4F15; + bb.ebx.r.l= 0x01; + bb.edx.rr = block; + + bb.es = SEG( edidBlock ); + bb.edi.rr = OFF( edidBlock ); + + bios( &bb ); + return(bb.eax.r.h); +} diff --git a/i386/modules/Resolution/include/.svn/all-wcprops b/i386/modules/Resolution/include/.svn/all-wcprops new file mode 100644 index 0000000..8d1b63c --- /dev/null +++ b/i386/modules/Resolution/include/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/include +END +edid.h +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2250/branches/Chimera/i386/modules/Resolution/include/edid.h +END diff --git a/i386/modules/Resolution/include/.svn/entries b/i386/modules/Resolution/include/.svn/entries new file mode 100644 index 0000000..2dfb034 --- /dev/null +++ b/i386/modules/Resolution/include/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Resolution/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +edid.h +file + + + + +2013-08-27T23:55:02.000000Z +a750a80dacfe6330bea8c1d4353f52b4 +2013-06-21T15:36:45.152000Z +2250 +macman + + + + + + + + + + + + + + + + + + + + + +5419 + diff --git a/i386/modules/Resolution/include/.svn/text-base/edid.h.svn-base b/i386/modules/Resolution/include/.svn/text-base/edid.h.svn-base new file mode 100644 index 0000000..a26f5ec --- /dev/null +++ b/i386/modules/Resolution/include/.svn/text-base/edid.h.svn-base @@ -0,0 +1,172 @@ +/* + * edid.h + * + * + * Created by Evan Lojewski on 12/1/09. + * Copyright 2009. All rights reserved. + * + * Slice 2010, based on Joblo works + */ +//#ifndef __EDID_H__ +//#define __EDID_H__ + + +#include "libsaio.h" + +#define EDID_BLOCK_SIZE 128 +#define EDID_V1_BLOCKS_TO_GO_OFFSET 126 +//Slice - some more info about EDID +#define EDID_LENGTH 0x80 +#define EDID_HEADER 0x00 +#define EDID_HEADER_END 0x07 + +#define ID_MANUFACTURER_NAME 0x08 +#define ID_MANUFACTURER_NAME_END 0x09 +#define ID_MODEL 0x0a + +#define ID_SERIAL_NUMBER 0x0c + +#define MANUFACTURE_WEEK 0x10 +#define MANUFACTURE_YEAR 0x11 + +#define EDID_STRUCT_VERSION 0x12 +#define EDID_STRUCT_REVISION 0x13 + +#define EDID_STRUCT_DISPLAY 0x14 + +#define DPMS_FLAGS 0x18 +#define ESTABLISHED_TIMING_1 0x23 +#define ESTABLISHED_TIMING_2 0x24 +#define MANUFACTURERS_TIMINGS 0x25 + +/* standard timings supported */ +#define STD_TIMING 8 +#define STD_TIMING_DESCRIPTION_SIZE 2 +#define STD_TIMING_DESCRIPTIONS_START 0x26 + +#define DETAILED_TIMING_DESCRIPTIONS_START 0x36 +#define DETAILED_TIMING_DESCRIPTION_SIZE 18 +#define NO_DETAILED_TIMING_DESCRIPTIONS 4 + +#define DETAILED_TIMING_DESCRIPTION_1 0x36 +#define DETAILED_TIMING_DESCRIPTION_2 0x48 +#define DETAILED_TIMING_DESCRIPTION_3 0x5a +#define DETAILED_TIMING_DESCRIPTION_4 0x6c + +#define DESCRIPTOR_DATA 5 + +#define UPPER_NIBBLE( x ) \ +(((128|64|32|16) & (x)) >> 4) + +#define LOWER_NIBBLE( x ) \ +((1|2|4|8) & (x)) + +#define COMBINE_HI_8LO( hi, lo ) \ +( (((unsigned)hi) << 8) | (unsigned)lo ) + +#define COMBINE_HI_4LO( hi, lo ) \ +( (((unsigned)hi) << 4) | (unsigned)lo ) + +#define PIXEL_CLOCK_LO (unsigned)block[ 0 ] +#define PIXEL_CLOCK_HI (unsigned)block[ 1 ] +#define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000) +#define H_ACTIVE_LO (unsigned)block[ 2 ] +#define H_BLANKING_LO (unsigned)block[ 3 ] +#define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] ) +#define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO ) +#define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] ) +#define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO ) + +#define V_ACTIVE_LO (unsigned)block[ 5 ] +#define V_BLANKING_LO (unsigned)block[ 6 ] +#define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] ) +#define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO ) +#define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] ) +#define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO ) + +#define H_SYNC_OFFSET_LO (unsigned)block[ 8 ] +#define H_SYNC_WIDTH_LO (unsigned)block[ 9 ] + +#define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)block[ 10 ] ) +#define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)block[ 10 ] ) + +#define V_SYNC_WIDTH_HI ((unsigned)block[ 11 ] & (1|2)) +#define V_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (4|8)) >> 2) + +#define H_SYNC_WIDTH_HI (((unsigned)block[ 11 ] & (16|32)) >> 4) +#define H_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (64|128)) >> 6) + +#define V_SYNC_WIDTH COMBINE_HI_4LO( V_SYNC_WIDTH_HI, V_SYNC_WIDTH_LO ) +#define V_SYNC_OFFSET COMBINE_HI_4LO( V_SYNC_OFFSET_HI, V_SYNC_OFFSET_LO ) + +#define H_SYNC_WIDTH COMBINE_HI_4LO( H_SYNC_WIDTH_HI, H_SYNC_WIDTH_LO ) +#define H_SYNC_OFFSET COMBINE_HI_4LO( H_SYNC_OFFSET_HI, H_SYNC_OFFSET_LO ) + +#define H_SIZE_LO (unsigned)block[ 12 ] +#define V_SIZE_LO (unsigned)block[ 13 ] + +#define H_SIZE_HI UPPER_NIBBLE( (unsigned)block[ 14 ] ) +#define V_SIZE_HI LOWER_NIBBLE( (unsigned)block[ 14 ] ) + +#define H_SIZE COMBINE_HI_8LO( H_SIZE_HI, H_SIZE_LO ) +#define V_SIZE COMBINE_HI_8LO( V_SIZE_HI, V_SIZE_LO ) + +#define H_BORDER (unsigned)block[ 15 ] +#define V_BORDER (unsigned)block[ 16 ] + +#define FLAGS (unsigned)block[ 17 ] + +#define INTERLACED (FLAGS&128) +#define SYNC_TYPE (FLAGS&3<<3) /* bits 4,3 */ +#define SYNC_SEPARATE (3<<3) +#define HSYNC_POSITIVE (FLAGS & 4) +#define VSYNC_POSITIVE (FLAGS & 2) + +#define V_MIN_RATE block[ 5 ] +#define V_MAX_RATE block[ 6 ] +#define H_MIN_RATE block[ 7 ] +#define H_MAX_RATE block[ 8 ] +#define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10) +#define GTF_SUPPORT block[10] + +#define DPMS_ACTIVE_OFF (1 << 5) +#define DPMS_SUSPEND (1 << 6) +#define DPMS_STANDBY (1 << 7) + +struct EDID +{ + UInt8 header[8]; //0 + UInt8 vendorProduct[4]; //8 + UInt8 serialNumber[4]; //12 + UInt8 weekOfManufacture; //16 + UInt8 yearOfManufacture; //17 + UInt8 version; //18 + UInt8 revision; //19 + UInt8 displayParams[5]; //20 + UInt8 colorCharacteristics[10]; //25 + UInt8 establishedTimings[3]; //35 + UInt16 standardTimings[8]; //38 + UInt8 detailedTimings[72]; //54 + UInt8 extension; //126 + UInt8 checksum; //127 +}; + + +typedef struct _edid_mode { + unsigned short pixel_clock; + unsigned short h_active; + unsigned short h_blanking; + unsigned short v_active; + unsigned short v_blanking; + unsigned short h_sync_offset; + unsigned short h_sync_width; + unsigned short v_sync_offset; + unsigned short v_sync_width; +} edid_mode; + + +char* readEDID(); +void getResolution(UInt32* x, UInt32* y, UInt32* bp); +int fb_parse_edid(struct EDID *edid, edid_mode* var); +int getEDID( void * edidBlock, UInt8 block); +//#endif \ No newline at end of file diff --git a/i386/modules/Resolution/include/edid.h b/i386/modules/Resolution/include/edid.h new file mode 100644 index 0000000..a26f5ec --- /dev/null +++ b/i386/modules/Resolution/include/edid.h @@ -0,0 +1,172 @@ +/* + * edid.h + * + * + * Created by Evan Lojewski on 12/1/09. + * Copyright 2009. All rights reserved. + * + * Slice 2010, based on Joblo works + */ +//#ifndef __EDID_H__ +//#define __EDID_H__ + + +#include "libsaio.h" + +#define EDID_BLOCK_SIZE 128 +#define EDID_V1_BLOCKS_TO_GO_OFFSET 126 +//Slice - some more info about EDID +#define EDID_LENGTH 0x80 +#define EDID_HEADER 0x00 +#define EDID_HEADER_END 0x07 + +#define ID_MANUFACTURER_NAME 0x08 +#define ID_MANUFACTURER_NAME_END 0x09 +#define ID_MODEL 0x0a + +#define ID_SERIAL_NUMBER 0x0c + +#define MANUFACTURE_WEEK 0x10 +#define MANUFACTURE_YEAR 0x11 + +#define EDID_STRUCT_VERSION 0x12 +#define EDID_STRUCT_REVISION 0x13 + +#define EDID_STRUCT_DISPLAY 0x14 + +#define DPMS_FLAGS 0x18 +#define ESTABLISHED_TIMING_1 0x23 +#define ESTABLISHED_TIMING_2 0x24 +#define MANUFACTURERS_TIMINGS 0x25 + +/* standard timings supported */ +#define STD_TIMING 8 +#define STD_TIMING_DESCRIPTION_SIZE 2 +#define STD_TIMING_DESCRIPTIONS_START 0x26 + +#define DETAILED_TIMING_DESCRIPTIONS_START 0x36 +#define DETAILED_TIMING_DESCRIPTION_SIZE 18 +#define NO_DETAILED_TIMING_DESCRIPTIONS 4 + +#define DETAILED_TIMING_DESCRIPTION_1 0x36 +#define DETAILED_TIMING_DESCRIPTION_2 0x48 +#define DETAILED_TIMING_DESCRIPTION_3 0x5a +#define DETAILED_TIMING_DESCRIPTION_4 0x6c + +#define DESCRIPTOR_DATA 5 + +#define UPPER_NIBBLE( x ) \ +(((128|64|32|16) & (x)) >> 4) + +#define LOWER_NIBBLE( x ) \ +((1|2|4|8) & (x)) + +#define COMBINE_HI_8LO( hi, lo ) \ +( (((unsigned)hi) << 8) | (unsigned)lo ) + +#define COMBINE_HI_4LO( hi, lo ) \ +( (((unsigned)hi) << 4) | (unsigned)lo ) + +#define PIXEL_CLOCK_LO (unsigned)block[ 0 ] +#define PIXEL_CLOCK_HI (unsigned)block[ 1 ] +#define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000) +#define H_ACTIVE_LO (unsigned)block[ 2 ] +#define H_BLANKING_LO (unsigned)block[ 3 ] +#define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] ) +#define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO ) +#define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] ) +#define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO ) + +#define V_ACTIVE_LO (unsigned)block[ 5 ] +#define V_BLANKING_LO (unsigned)block[ 6 ] +#define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] ) +#define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO ) +#define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] ) +#define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO ) + +#define H_SYNC_OFFSET_LO (unsigned)block[ 8 ] +#define H_SYNC_WIDTH_LO (unsigned)block[ 9 ] + +#define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)block[ 10 ] ) +#define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)block[ 10 ] ) + +#define V_SYNC_WIDTH_HI ((unsigned)block[ 11 ] & (1|2)) +#define V_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (4|8)) >> 2) + +#define H_SYNC_WIDTH_HI (((unsigned)block[ 11 ] & (16|32)) >> 4) +#define H_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (64|128)) >> 6) + +#define V_SYNC_WIDTH COMBINE_HI_4LO( V_SYNC_WIDTH_HI, V_SYNC_WIDTH_LO ) +#define V_SYNC_OFFSET COMBINE_HI_4LO( V_SYNC_OFFSET_HI, V_SYNC_OFFSET_LO ) + +#define H_SYNC_WIDTH COMBINE_HI_4LO( H_SYNC_WIDTH_HI, H_SYNC_WIDTH_LO ) +#define H_SYNC_OFFSET COMBINE_HI_4LO( H_SYNC_OFFSET_HI, H_SYNC_OFFSET_LO ) + +#define H_SIZE_LO (unsigned)block[ 12 ] +#define V_SIZE_LO (unsigned)block[ 13 ] + +#define H_SIZE_HI UPPER_NIBBLE( (unsigned)block[ 14 ] ) +#define V_SIZE_HI LOWER_NIBBLE( (unsigned)block[ 14 ] ) + +#define H_SIZE COMBINE_HI_8LO( H_SIZE_HI, H_SIZE_LO ) +#define V_SIZE COMBINE_HI_8LO( V_SIZE_HI, V_SIZE_LO ) + +#define H_BORDER (unsigned)block[ 15 ] +#define V_BORDER (unsigned)block[ 16 ] + +#define FLAGS (unsigned)block[ 17 ] + +#define INTERLACED (FLAGS&128) +#define SYNC_TYPE (FLAGS&3<<3) /* bits 4,3 */ +#define SYNC_SEPARATE (3<<3) +#define HSYNC_POSITIVE (FLAGS & 4) +#define VSYNC_POSITIVE (FLAGS & 2) + +#define V_MIN_RATE block[ 5 ] +#define V_MAX_RATE block[ 6 ] +#define H_MIN_RATE block[ 7 ] +#define H_MAX_RATE block[ 8 ] +#define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10) +#define GTF_SUPPORT block[10] + +#define DPMS_ACTIVE_OFF (1 << 5) +#define DPMS_SUSPEND (1 << 6) +#define DPMS_STANDBY (1 << 7) + +struct EDID +{ + UInt8 header[8]; //0 + UInt8 vendorProduct[4]; //8 + UInt8 serialNumber[4]; //12 + UInt8 weekOfManufacture; //16 + UInt8 yearOfManufacture; //17 + UInt8 version; //18 + UInt8 revision; //19 + UInt8 displayParams[5]; //20 + UInt8 colorCharacteristics[10]; //25 + UInt8 establishedTimings[3]; //35 + UInt16 standardTimings[8]; //38 + UInt8 detailedTimings[72]; //54 + UInt8 extension; //126 + UInt8 checksum; //127 +}; + + +typedef struct _edid_mode { + unsigned short pixel_clock; + unsigned short h_active; + unsigned short h_blanking; + unsigned short v_active; + unsigned short v_blanking; + unsigned short h_sync_offset; + unsigned short h_sync_width; + unsigned short v_sync_offset; + unsigned short v_sync_width; +} edid_mode; + + +char* readEDID(); +void getResolution(UInt32* x, UInt32* y, UInt32* bp); +int fb_parse_edid(struct EDID *edid, edid_mode* var); +int getEDID( void * edidBlock, UInt8 block); +//#endif \ No newline at end of file diff --git a/i386/modules/Resolution/shortatombios.h b/i386/modules/Resolution/shortatombios.h new file mode 100644 index 0000000..4ca8e46 --- /dev/null +++ b/i386/modules/Resolution/shortatombios.h @@ -0,0 +1,192 @@ +/****************************************************************************/ +/*Portion I: Definitions shared between VBIOS and Driver */ +/****************************************************************************/ + + +#ifndef _SHORT_ATOMBIOS_H +#define _SHORT_ATOMBIOS_H + +#define ATOM_VERSION_MAJOR 0x00020000 +#define ATOM_VERSION_MINOR 0x00000002 + +#define ATOM_HEADER_VERSION (ATOM_VERSION_MAJOR | ATOM_VERSION_MINOR) + +typedef unsigned char BOOLEAN; +typedef signed char INT8; +typedef unsigned char UINT8; +typedef signed short INT16; +typedef unsigned short UINT16; +typedef signed long INT32; +typedef unsigned long UINT32; +typedef unsigned char CHAR8; +typedef unsigned short CHAR16; +typedef unsigned short USHORT; +typedef unsigned char UCHAR; +typedef unsigned long ULONG; + +#pragma pack(1) /* BIOS data must use byte aligment */ + +/* Define offset to location of ROM header. */ + +#define OFFSET_TO_POINTER_TO_ATOM_ROM_HEADER 0x00000048L +#define OFFSET_TO_ATOM_ROM_IMAGE_SIZE 0x00000002L + +typedef struct _ATOM_COMMON_TABLE_HEADER +{ + USHORT usStructureSize; + UCHAR ucTableFormatRevision; /*Change it when the Parser is not backward compatible */ + UCHAR ucTableContentRevision; /*Change it only when the table needs to change but the firmware */ + /*Image can't be updated, while Driver needs to carry the new table! */ +} ATOM_COMMON_TABLE_HEADER; + +typedef struct _ATOM_ROM_HEADER +{ + ATOM_COMMON_TABLE_HEADER sHeader; + UCHAR uaFirmWareSignature[4]; /*Signature to distinguish between Atombios and non-atombios, + + atombios should init it as "ATOM", don't change the position */ + USHORT usBiosRuntimeSegmentAddress; + USHORT usProtectedModeInfoOffset; + USHORT usConfigFilenameOffset; + USHORT usCRC_BlockOffset; + USHORT usBIOS_BootupMessageOffset; + USHORT usInt10Offset; + USHORT usPciBusDevInitCode; + USHORT usIoBaseAddress; + USHORT usSubsystemVendorID; + USHORT usSubsystemID; + USHORT usPCI_InfoOffset; + USHORT usMasterCommandTableOffset; /*Offset for SW to get all command table offsets, Don't change the position */ + USHORT usMasterDataTableOffset; /*Offset for SW to get all data table offsets, Don't change the position */ + UCHAR ucExtendedFunctionCode; + UCHAR ucReserved; +} ATOM_ROM_HEADER; + +/****************************************************************************/ +// Structure used in Data.mtb +/****************************************************************************/ +typedef struct _ATOM_MASTER_LIST_OF_DATA_TABLES +{ + USHORT UtilityPipeLine; // Offest for the utility to get parser info,Don't change this position! + USHORT MultimediaCapabilityInfo; // Only used by MM Lib,latest version 1.1, not configuable from Bios, need to include the table to build Bios + USHORT MultimediaConfigInfo; // Only used by MM Lib,latest version 2.1, not configuable from Bios, need to include the table to build Bios + USHORT StandardVESA_Timing; // Only used by Bios + USHORT FirmwareInfo; // Shared by various SW components,latest version 1.4 + USHORT DAC_Info; // Will be obsolete from R600 + USHORT LVDS_Info; // Shared by various SW components,latest version 1.1 + USHORT TMDS_Info; // Will be obsolete from R600 + USHORT AnalogTV_Info; // Shared by various SW components,latest version 1.1 + USHORT SupportedDevicesInfo; // Will be obsolete from R600 + USHORT GPIO_I2C_Info; // Shared by various SW components,latest version 1.2 will be used from R600 + USHORT VRAM_UsageByFirmware; // Shared by various SW components,latest version 1.3 will be used from R600 + USHORT GPIO_Pin_LUT; // Shared by various SW components,latest version 1.1 + USHORT VESA_ToInternalModeLUT; // Only used by Bios + USHORT ComponentVideoInfo; // Shared by various SW components,latest version 2.1 will be used from R600 + USHORT PowerPlayInfo; // Shared by various SW components,latest version 2.1,new design from R600 + USHORT CompassionateData; // Will be obsolete from R600 + USHORT SaveRestoreInfo; // Only used by Bios + USHORT PPLL_SS_Info; // Shared by various SW components,latest version 1.2, used to call SS_Info, change to new name because of int ASIC SS info + USHORT OemInfo; // Defined and used by external SW, should be obsolete soon + USHORT XTMDS_Info; // Will be obsolete from R600 + USHORT MclkSS_Info; // Shared by various SW components,latest version 1.1, only enabled when ext SS chip is used + USHORT Object_Header; // Shared by various SW components,latest version 1.1 + USHORT IndirectIOAccess; // Only used by Bios,this table position can't change at all!! + USHORT MC_InitParameter; // Only used by command table + USHORT ASIC_VDDC_Info; // Will be obsolete from R600 + USHORT ASIC_InternalSS_Info; // New tabel name from R600, used to be called "ASIC_MVDDC_Info" + USHORT TV_VideoMode; // Only used by command table + USHORT VRAM_Info; // Only used by command table, latest version 1.3 + USHORT MemoryTrainingInfo; // Used for VBIOS and Diag utility for memory training purpose since R600. the new table rev start from 2.1 + USHORT IntegratedSystemInfo; // Shared by various SW components + USHORT ASIC_ProfilingInfo; // New table name from R600, used to be called "ASIC_VDDCI_Info" for pre-R600 + USHORT VoltageObjectInfo; // Shared by various SW components, latest version 1.1 + USHORT PowerSourceInfo; // Shared by various SW components, latest versoin 1.1 +} ATOM_MASTER_LIST_OF_DATA_TABLES; + +typedef struct _ATOM_MASTER_DATA_TABLE +{ + ATOM_COMMON_TABLE_HEADER sHeader; + ATOM_MASTER_LIST_OF_DATA_TABLES ListOfDataTables; +} ATOM_MASTER_DATA_TABLE; + +typedef union _ATOM_MODE_MISC_INFO_ACCESS +{ + USHORT usAccess; +} ATOM_MODE_MISC_INFO_ACCESS; + +/****************************************************************************/ +// Structure used in StandardVESA_TimingTable +// AnalogTV_InfoTable +// ComponentVideoInfoTable +/****************************************************************************/ +typedef struct _ATOM_MODE_TIMING +{ + USHORT usCRTC_H_Total; + USHORT usCRTC_H_Disp; + USHORT usCRTC_H_SyncStart; + USHORT usCRTC_H_SyncWidth; + USHORT usCRTC_V_Total; + USHORT usCRTC_V_Disp; + USHORT usCRTC_V_SyncStart; + USHORT usCRTC_V_SyncWidth; + USHORT usPixelClock; //in 10Khz unit + ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo; + USHORT usCRTC_OverscanRight; + USHORT usCRTC_OverscanLeft; + USHORT usCRTC_OverscanBottom; + USHORT usCRTC_OverscanTop; + USHORT usReserve; + UCHAR ucInternalModeNumber; + UCHAR ucRefreshRate; +} ATOM_MODE_TIMING; + +typedef struct _ATOM_DTD_FORMAT +{ + USHORT usPixClk; + USHORT usHActive; + USHORT usHBlanking_Time; + USHORT usVActive; + USHORT usVBlanking_Time; + USHORT usHSyncOffset; + USHORT usHSyncWidth; + USHORT usVSyncOffset; + USHORT usVSyncWidth; + USHORT usImageHSize; + USHORT usImageVSize; + UCHAR ucHBorder; + UCHAR ucVBorder; + ATOM_MODE_MISC_INFO_ACCESS susModeMiscInfo; + UCHAR ucInternalModeNumber; + UCHAR ucRefreshRate; +} ATOM_DTD_FORMAT; + +typedef struct _ATOM_LVDS_INFO_V12 +{ + ATOM_COMMON_TABLE_HEADER sHeader; + ATOM_DTD_FORMAT sLCDTiming; + USHORT usExtInfoTableOffset; + USHORT usSupportedRefreshRate; //Refer to panel info table in ATOMBIOS extension Spec. + USHORT usOffDelayInMs; + UCHAR ucPowerSequenceDigOntoDEin10Ms; + UCHAR ucPowerSequenceDEtoBLOnin10Ms; + UCHAR ucLVDS_Misc; // Bit0:{=0:single, =1:dual},Bit1 {=0:666RGB, =1:888RGB},Bit2:3:{Grey level} + // Bit4:{=0:LDI format for RGB888, =1 FPDI format for RGB888} + // Bit5:{=0:Spatial Dithering disabled;1 Spatial Dithering enabled} + // Bit6:{=0:Temporal Dithering disabled;1 Temporal Dithering enabled} + UCHAR ucPanelDefaultRefreshRate; + UCHAR ucPanelIdentification; + UCHAR ucSS_Id; + USHORT usLCDVenderID; + USHORT usLCDProductID; + UCHAR ucLCDPanel_SpecialHandlingCap; + UCHAR ucPanelInfoSize; // start from ATOM_DTD_FORMAT to end of panel info, include ExtInfoTable + UCHAR ucReserved[2]; +} ATOM_LVDS_INFO_V12; + + +typedef struct _ATOM_STANDARD_VESA_TIMING +{ + ATOM_COMMON_TABLE_HEADER sHeader; + char * aModeTimings; // 16 is not the real array number, just for initial allocation +} ATOM_STANDARD_VESA_TIMING; + +#endif \ No newline at end of file diff --git a/i386/modules/Sata/.svn/all-wcprops b/i386/modules/Sata/.svn/all-wcprops new file mode 100644 index 0000000..6fd5032 --- /dev/null +++ b/i386/modules/Sata/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Sata +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Sata/Cconfig +END +Sata.c +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Sata/Sata.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Sata/Makefile +END diff --git a/i386/modules/Sata/.svn/entries b/i386/modules/Sata/.svn/entries new file mode 100644 index 0000000..c093b01 --- /dev/null +++ b/i386/modules/Sata/.svn/entries @@ -0,0 +1,133 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Sata +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +include +dir + +Cconfig +file + + + + +2013-08-27T23:55:03.000000Z +443c085aefc5bce3703f9c01cbb25932 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +152 + +Sata.c +file + + + + +2013-08-27T23:55:03.000000Z +b0185d49b3d97a6e8de968165c177abe +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1419 + +Makefile +file + + + + +2013-08-27T23:55:03.000000Z +e3912316c75d0dd6e0dc9f47a1ad2181 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +295 + diff --git a/i386/modules/Sata/.svn/text-base/Cconfig.svn-base b/i386/modules/Sata/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..51a50c6 --- /dev/null +++ b/i386/modules/Sata/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config SATA_MODULE + tristate "Sata Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/Sata/.svn/text-base/Makefile.svn-base b/i386/modules/Sata/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..f3ab5c4 --- /dev/null +++ b/i386/modules/Sata/.svn/text-base/Makefile.svn-base @@ -0,0 +1,13 @@ +MODULE_NAME = Sata +MODULE_DESCRIPTION = This module help Sata devices to be recognized as internal +MODULE_AUTHOR = "Cparm" +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = Sata + +MODULE_OBJS = Sata.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/Sata/.svn/text-base/Sata.c.svn-base b/i386/modules/Sata/.svn/text-base/Sata.c.svn-base new file mode 100644 index 0000000..2e1750b --- /dev/null +++ b/i386/modules/Sata/.svn/text-base/Sata.c.svn-base @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011,2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "modules.h" +#include "bootstruct.h" +#include "pci.h" +#include "device_inject.h" +#include "platform.h" + +#ifndef DEBUG_SATA +#define DEBUG_SATA 0 +#endif + +#if DEBUG_SATA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +void SATA_hook(void* arg1, void* arg2, void* arg3, void* arg4); + +uint8_t default_SATA_ID[]= { + 0x81, 0x26, 0x00, 0x00 +}; +#define SATA_ID_LEN ( sizeof(default_SATA_ID) / sizeof(uint8_t) ) + +void SATA_hook(void* arg1, void* arg2, void* arg3, void* arg4) +{ + pci_dt_t* current = arg1; + struct DevPropDevice *device = NULL; + char *devicepath = NULL; + + if (current && current->class_id == PCI_CLASS_STORAGE_SATA) + { + if (!string) + { + string = devprop_create_string(); + if (!string) return; + } + devicepath = get_pci_dev_path(current); + if (!devicepath) return; + + device = devprop_add_device(string, devicepath); + if (!device) return; + + devprop_add_value(device, "device-id", default_SATA_ID, SATA_ID_LEN); + + verbose("SATA device : [%04x:%04x :: %04x], changed to ICH6 ESB2 \n", + current->vendor_id, current->device_id,current->class_id); + + } + +} + +void Sata_start(void); +void Sata_start(void) +{ + register_hook_callback("PCIDevice", &SATA_hook); +} + diff --git a/i386/modules/Sata/Cconfig b/i386/modules/Sata/Cconfig new file mode 100644 index 0000000..51a50c6 --- /dev/null +++ b/i386/modules/Sata/Cconfig @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config SATA_MODULE + tristate "Sata Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/Sata/Makefile b/i386/modules/Sata/Makefile new file mode 100644 index 0000000..f3ab5c4 --- /dev/null +++ b/i386/modules/Sata/Makefile @@ -0,0 +1,13 @@ +MODULE_NAME = Sata +MODULE_DESCRIPTION = This module help Sata devices to be recognized as internal +MODULE_AUTHOR = "Cparm" +MODULE_VERSION = "1.0.0" +MODULE_COMPAT_VERSION = "1.0.0" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = Sata + +MODULE_OBJS = Sata.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/Sata/Sata.c b/i386/modules/Sata/Sata.c new file mode 100644 index 0000000..2e1750b --- /dev/null +++ b/i386/modules/Sata/Sata.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2011,2012 cparm <armelcadetpetit@gmail.com>. All rights reserved. + * + */ + +#include "libsaio.h" +#include "modules.h" +#include "bootstruct.h" +#include "pci.h" +#include "device_inject.h" +#include "platform.h" + +#ifndef DEBUG_SATA +#define DEBUG_SATA 0 +#endif + +#if DEBUG_SATA +#define DBG(x...) printf(x) +#else +#define DBG(x...) +#endif + +void SATA_hook(void* arg1, void* arg2, void* arg3, void* arg4); + +uint8_t default_SATA_ID[]= { + 0x81, 0x26, 0x00, 0x00 +}; +#define SATA_ID_LEN ( sizeof(default_SATA_ID) / sizeof(uint8_t) ) + +void SATA_hook(void* arg1, void* arg2, void* arg3, void* arg4) +{ + pci_dt_t* current = arg1; + struct DevPropDevice *device = NULL; + char *devicepath = NULL; + + if (current && current->class_id == PCI_CLASS_STORAGE_SATA) + { + if (!string) + { + string = devprop_create_string(); + if (!string) return; + } + devicepath = get_pci_dev_path(current); + if (!devicepath) return; + + device = devprop_add_device(string, devicepath); + if (!device) return; + + devprop_add_value(device, "device-id", default_SATA_ID, SATA_ID_LEN); + + verbose("SATA device : [%04x:%04x :: %04x], changed to ICH6 ESB2 \n", + current->vendor_id, current->device_id,current->class_id); + + } + +} + +void Sata_start(void); +void Sata_start(void) +{ + register_hook_callback("PCIDevice", &SATA_hook); +} + diff --git a/i386/modules/Sata/include/.svn/all-wcprops b/i386/modules/Sata/include/.svn/all-wcprops new file mode 100644 index 0000000..c34d322 --- /dev/null +++ b/i386/modules/Sata/include/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/Sata/include +END diff --git a/i386/modules/Sata/include/.svn/entries b/i386/modules/Sata/include/.svn/entries new file mode 100644 index 0000000..c74360a --- /dev/null +++ b/i386/modules/Sata/include/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/Sata/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/i386/modules/include/.svn/all-wcprops b/i386/modules/include/.svn/all-wcprops new file mode 100644 index 0000000..3d84a17 --- /dev/null +++ b/i386/modules/include/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/include +END +modules +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/include/modules +END diff --git a/i386/modules/include/.svn/entries b/i386/modules/include/.svn/entries new file mode 100644 index 0000000..f70494a --- /dev/null +++ b/i386/modules/include/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +modules +file + + + + +2013-08-27T23:55:02.000000Z +9aa638493ed5e7c7a4414a08d9961cdc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2430 + diff --git a/i386/modules/include/.svn/text-base/modules.svn-base b/i386/modules/include/.svn/text-base/modules.svn-base new file mode 100644 index 0000000..8f13c80 --- /dev/null +++ b/i386/modules/include/.svn/text-base/modules.svn-base @@ -0,0 +1,104 @@ +extern "C" { +/* + * Module Loading functionality + * Copyright 2009 Evan Lojewski. All rights reserved. + * + */ + +#include <mach-o/loader.h> +#include <mach-o/nlist.h> + + +// There is a bug with the module system / rebasing / binding +// that causes static variables to be incorrectly rebased or bound +// Disable static variables for the moment +// #define static + +#ifndef __BOOT_MODULES_H +#define __BOOT_MODULES_H + +#define SYMBOLS_MODULE "Symbols.dylib" + +#define SYMBOL_LOOKUP_SYMBOL "_lookup_symbol" +#define STUB_ENTRY_SIZE 6 + +#define SECT_NON_LAZY_SYMBOL_PTR "__nl_symbol_ptr" +#define SECT_SYMBOL_STUBS "__symbol_stub" + + +#define VALID_FUNCTION(__x__) (__x__ && (void*)__x__ != (void*)0xFFFFFFFF) + +extern unsigned long long textAddress; +extern unsigned long long textSection; + + +typedef struct symbolList_t +{ + char* symbol; + unsigned int addr; + struct symbolList_t* next; +} symbolList_t; + +typedef struct moduleList_t +{ + char* module; + unsigned int version; + unsigned int compat; + struct moduleList_t* next; +} moduleList_t; + +typedef struct callbackList_t +{ + void(*callback)(void*, void*, void*, void*); + struct callbackList_t* next; +} callbackList_t; + +typedef struct moduleHook_t +{ + const char* name; + callbackList_t* callbacks; + struct moduleHook_t* next; +} moduleHook_t; + + + +int init_module_system(); +void load_all_modules(); + +/* + * Modules Interface + * execute_hook + * Exexutes a registered hook. All callbaks are + * called in the same order that they were added + * + * register_hook_callback + * registers a void function to be executed when a + * hook is executed. + */ +int execute_hook(const char* name, void*, void*, void*, void*); +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)); + + +int load_module(char* module); +int is_module_loaded(const char* name); +void module_loaded(const char* name/*, uint32_t version, uint32_t compat*/); + +long long add_symbol(char* symbol, long long addr, char is64); + +void* parse_mach(void* binary, + int(*dylib_loader)(char*), + long long(*symbol_handler)(char*, long long, char) + ); + +unsigned int handle_symtable(uint32_t base, struct symtab_command* symtabCommand, + long long(*symbol_handler)(char*, long long, char), + char is64); + +unsigned int lookup_all_symbols(const char* name); + +int replace_function(const char* symbol, void* newAddress); + +//extern unsigned int (*lookup_symbol)(const char*); + +#endif /* __BOOT_MODULES_H */ +} \ No newline at end of file diff --git a/i386/modules/include/modules b/i386/modules/include/modules new file mode 100644 index 0000000..8f13c80 --- /dev/null +++ b/i386/modules/include/modules @@ -0,0 +1,104 @@ +extern "C" { +/* + * Module Loading functionality + * Copyright 2009 Evan Lojewski. All rights reserved. + * + */ + +#include <mach-o/loader.h> +#include <mach-o/nlist.h> + + +// There is a bug with the module system / rebasing / binding +// that causes static variables to be incorrectly rebased or bound +// Disable static variables for the moment +// #define static + +#ifndef __BOOT_MODULES_H +#define __BOOT_MODULES_H + +#define SYMBOLS_MODULE "Symbols.dylib" + +#define SYMBOL_LOOKUP_SYMBOL "_lookup_symbol" +#define STUB_ENTRY_SIZE 6 + +#define SECT_NON_LAZY_SYMBOL_PTR "__nl_symbol_ptr" +#define SECT_SYMBOL_STUBS "__symbol_stub" + + +#define VALID_FUNCTION(__x__) (__x__ && (void*)__x__ != (void*)0xFFFFFFFF) + +extern unsigned long long textAddress; +extern unsigned long long textSection; + + +typedef struct symbolList_t +{ + char* symbol; + unsigned int addr; + struct symbolList_t* next; +} symbolList_t; + +typedef struct moduleList_t +{ + char* module; + unsigned int version; + unsigned int compat; + struct moduleList_t* next; +} moduleList_t; + +typedef struct callbackList_t +{ + void(*callback)(void*, void*, void*, void*); + struct callbackList_t* next; +} callbackList_t; + +typedef struct moduleHook_t +{ + const char* name; + callbackList_t* callbacks; + struct moduleHook_t* next; +} moduleHook_t; + + + +int init_module_system(); +void load_all_modules(); + +/* + * Modules Interface + * execute_hook + * Exexutes a registered hook. All callbaks are + * called in the same order that they were added + * + * register_hook_callback + * registers a void function to be executed when a + * hook is executed. + */ +int execute_hook(const char* name, void*, void*, void*, void*); +void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*)); + + +int load_module(char* module); +int is_module_loaded(const char* name); +void module_loaded(const char* name/*, uint32_t version, uint32_t compat*/); + +long long add_symbol(char* symbol, long long addr, char is64); + +void* parse_mach(void* binary, + int(*dylib_loader)(char*), + long long(*symbol_handler)(char*, long long, char) + ); + +unsigned int handle_symtable(uint32_t base, struct symtab_command* symtabCommand, + long long(*symbol_handler)(char*, long long, char), + char is64); + +unsigned int lookup_all_symbols(const char* name); + +int replace_function(const char* symbol, void* newAddress); + +//extern unsigned int (*lookup_symbol)(const char*); + +#endif /* __BOOT_MODULES_H */ +} \ No newline at end of file diff --git a/i386/modules/klibc/.svn/all-wcprops b/i386/modules/klibc/.svn/all-wcprops new file mode 100644 index 0000000..c6fd7ce --- /dev/null +++ b/i386/modules/klibc/.svn/all-wcprops @@ -0,0 +1,443 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc +END +strndup.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strndup.c +END +sha1hash.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/sha1hash.c +END +strtox.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtox.c +END +strcasecmp.c +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strcasecmp.c +END +__clzsi2.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__clzsi2.c +END +strtotimespec.c +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtotimespec.c +END +memmove.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/memmove.c +END +__udivdi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__udivdi3.c +END +onexit.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/onexit.c +END +limits.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/limits.h +END +exit.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/exit.c +END +jrand48.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/jrand48.c +END +memchr.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/memchr.c +END +lrand48.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/lrand48.c +END +mrand48.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/mrand48.c +END +nrand48.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/nrand48.c +END +srand48.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/srand48.c +END +__udivsi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__udivsi3.c +END +klibc.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/klibc.c +END +__ashldi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__ashldi3.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/Makefile +END +strtotimeval.c +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtotimeval.c +END +memrchr.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/memrchr.c +END +__umoddi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__umoddi3.c +END +memswap.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/memswap.c +END +atoll.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/atoll.c +END +strlcat.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strlcat.c +END +memmem.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/memmem.c +END +strsep.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strsep.c +END +strdup.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strdup.c +END +__umodsi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__umodsi3.c +END +strtotimex.c +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtotimex.c +END +strtok.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtok.c +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/Cconfig +END +vsnprintf.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/vsnprintf.c +END +strtoimax.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtoimax.c +END +atexit.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/atexit.c +END +atol.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/atol.c +END +snprintf.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/snprintf.c +END +atexit.h +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/atexit.h +END +vsscanf.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/vsscanf.c +END +strtoumax.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtoumax.c +END +bsearch.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/bsearch.c +END +strntoimax.c +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strntoimax.c +END +atox.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/atox.c +END +strtoul.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtoul.c +END +sscanf.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/sscanf.c +END +__divdi3.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__divdi3.c +END +strncasecmp.c +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strncasecmp.c +END +strntoumax.c +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strntoumax.c +END +strpbrk.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strpbrk.c +END +strtoull.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtoull.c +END +Readme.txt +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/Readme.txt +END +__ashrdi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__ashrdi3.c +END +seed48.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/seed48.c +END +__divsi3.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__divsi3.c +END +LICENSE +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/LICENSE +END +strtoll.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtoll.c +END +version +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/version +END +__udivmoddi4.c +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__udivmoddi4.c +END +__lshrdi3.c +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__lshrdi3.c +END +strtok_r.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtok_r.c +END +qsort.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/qsort.c +END +__moddi3.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__moddi3.c +END +strxspn.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strxspn.c +END +strnlen.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strnlen.c +END +__udivmodsi4.c +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__udivmodsi4.c +END +strxspn.h +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strxspn.h +END +strtol.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/strtol.c +END +__modsi3.c +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/__modsi3.c +END +atoi.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/atoi.c +END +calloc.c +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/calloc.c +END +memccpy.c +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/klibc/memccpy.c +END diff --git a/i386/modules/klibc/.svn/entries b/i386/modules/klibc/.svn/entries new file mode 100644 index 0000000..15773cd --- /dev/null +++ b/i386/modules/klibc/.svn/entries @@ -0,0 +1,2510 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/klibc +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +strndup.c +file + + + + +2013-08-27T23:55:03.000000Z +9aac060ed2d3f167751fa152c0e2679b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +209 + +sha1hash.c +file + + + + +2013-08-27T23:55:03.000000Z +d03a17dd70080d3e40c2138e8c501b48 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9960 + +strtox.c +file + + + + +2013-08-27T23:55:03.000000Z +2f154bd3b88e9c6a0a7467115f84711f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +331 + +strcasecmp.c +file + + + + +2013-08-27T23:55:03.000000Z +785220502b42699f06923153501189dc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +487 + +__clzsi2.c +file + + + + +2013-08-27T23:55:03.000000Z +624c4f6609e562aca8d5ac213d8f11e0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +402 + +strtotimespec.c +file + + + + +2013-08-27T23:55:03.000000Z +7afbbdcff092ffa13a88c228622d5f23 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +124 + +memmove.c +file + + + + +2013-08-27T23:55:03.000000Z +0dd8129127fd9217f018dd7f872ab034 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +536 + +__udivdi3.c +file + + + + +2013-08-27T23:55:03.000000Z +76977be0b700b41877a7baa6123ee290 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +244 + +onexit.c +file + + + + +2013-08-27T23:55:03.000000Z +6f6b420006a10129a43e22e9aa432d49 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +289 + +limits.h +file + + + + +2013-08-27T23:55:03.000000Z +29be71ae47e462870cdf3608d5ee2418 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +100 + +exit.c +file + + + + +2013-08-27T23:55:03.000000Z +be9cb698e86e2f9e174ba4a465afec16 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +624 + +jrand48.c +file + + + + +2013-08-27T23:55:03.000000Z +189191de43a889b7411bfcbf57ece18d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +509 + +memchr.c +file + + + + +2013-08-27T23:55:03.000000Z +811898c185fc53e4e82bc09600385464 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +235 + +lrand48.c +file + + + + +2013-08-27T23:55:03.000000Z +003f71139d37513e7e54e690f1c5e80a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +213 + +mrand48.c +file + + + + +2013-08-27T23:55:03.000000Z +56a6f0cf5d3beef5a5cde0e6413345ef +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +197 + +nrand48.c +file + + + + +2013-08-27T23:55:03.000000Z +d0eca9a2b04e2c84bfd88e24af67be3e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +152 + +srand48.c +file + + + + +2013-08-27T23:55:03.000000Z +a7d5c2a31adfbdfb1f6b9db5cf50892e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +310 + +__udivsi3.c +file + + + + +2013-08-27T23:55:03.000000Z +233af6b96a98222315fbc989d5811189 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +234 + +klibc.c +file + + + + +2013-08-27T23:55:03.000000Z +45874815f243d1848b05f8b3e253d75e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +510 + +__ashldi3.c +file + + + + +2013-08-27T23:55:03.000000Z +d075671765ee3c00a5356d2a639c9936 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +351 + +Makefile +file + + + + +2013-08-27T23:55:03.000000Z +b984c18aa9fee44cc5de1d38631ae980 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1095 + +strtotimeval.c +file + + + + +2013-08-27T23:55:03.000000Z +e5b017a543de3a0d40625bbc2feaba31 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +122 + +memrchr.c +file + + + + +2013-08-27T23:55:03.000000Z +48274fb1d31685d79ddc258b9be52d58 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +268 + +__umoddi3.c +file + + + + +2013-08-27T23:55:03.000000Z +732bce0527b521b1d3ab371634f9ec70 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +267 + +memswap.c +file + + + + +2013-08-27T23:55:03.000000Z +bf79a5bbe01d191a650bd92d434a77f9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +299 + +atoll.c +file + + + + +2013-08-27T23:55:03.000000Z +0a6cb87123b66f006987e2225072dc19 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +60 + +strlcat.c +file + + + + +2013-08-27T23:55:03.000000Z +ab45bec74ec8ab6dab3651bcbecd9b9c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +378 + +memmem.c +file + + + + +2013-08-27T23:55:03.000000Z +aab0eaba3095ff0af90a3b79813cb08a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +882 + +strsep.c +file + + + + +2013-08-27T23:55:03.000000Z +b5630b50b5448638a7634e2eac244eb4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +224 + +strdup.c +file + + + + +2013-08-27T23:55:03.000000Z +a68902075aa65142cfe5f3d95ba1a6f1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +160 + +__umodsi3.c +file + + + + +2013-08-27T23:55:03.000000Z +6445b0482ff04d943f47e6ddfbb48032 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +257 + +strtotimex.c +file + + + + +2013-08-27T23:55:03.000000Z +cb52cf1023ed96f1c710e91126b5bc63 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +747 + +strtok.c +file + + + + +2013-08-27T23:55:03.000000Z +624d73045c6a616743caf7dff64b0fe8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +146 + +Cconfig +file + + + + +2013-08-27T23:55:03.000000Z +5442cf5cd790a6272659c33908be158c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +154 + +vsnprintf.c +file + + + + +2013-08-27T23:55:03.000000Z +c313667b39996b43eae10fc992243861 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9974 + +strtoimax.c +file + + + + +2013-08-27T23:55:03.000000Z +8f629e5120e558b9074288bf5ce9b3f5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +65 + +atexit.c +file + + + + +2013-08-27T23:55:03.000000Z +b28e79c98a26b5306586d50a0764f88b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +196 + +atol.c +file + + + + +2013-08-27T23:55:03.000000Z +b24a269a4c95fb5531f722197875b0ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +54 + +snprintf.c +file + + + + +2013-08-27T23:55:03.000000Z +7e70ddf59fb559f5330f80ee4fb9b4a8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +299 + +atexit.h +file + + + + +2013-08-27T23:55:03.000000Z +3ee310fcaf7d425f546b124d916b3e04 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +274 + +vsscanf.c +file + + + + +2013-08-27T23:55:03.000000Z +3778ff17cd64a4394189cf018e1165b8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8257 + +strtoumax.c +file + + + + +2013-08-27T23:55:03.000000Z +719a6d00e4c3369761efb82200962dab +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +66 + +bsearch.c +file + + + + +2013-08-27T23:55:03.000000Z +ac3702140968228466b51f640fa27857 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +450 + +strntoimax.c +file + + + + +2013-08-27T23:55:03.000000Z +0c1703d83c433b88c4a8acede151ffdd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +300 + +atox.c +file + + + + +2013-08-27T23:55:03.000000Z +39bc8e3e95da79f73977340c11b6cad7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +290 + +strtoul.c +file + + + + +2013-08-27T23:55:03.000000Z +7f86803ccda6e6181d453f314a2135df +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +68 + +sscanf.c +file + + + + +2013-08-27T23:55:03.000000Z +e792940bd057ab36645373fdaf3b469e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +274 + +__divdi3.c +file + + + + +2013-08-27T23:55:03.000000Z +4e76983ed87655f446ecc80f839a64aa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +394 + +strncasecmp.c +file + + + + +2013-08-27T23:55:03.000000Z +42025a0dc14d2ff5eeac3706b9fdcc82 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +501 + +strntoumax.c +file + + + + +2013-08-27T23:55:03.000000Z +a35f5c41e86ab1a2eccf7cbaddf4d89a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1192 + +strpbrk.c +file + + + + +2013-08-27T23:55:03.000000Z +043f843c212bf7b95bd076b175ed3581 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +196 + +strtoull.c +file + + + + +2013-08-27T23:55:03.000000Z +04c06a12ffb051905cdd177a3202a298 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +74 + +Readme.txt +file + + + + +2013-08-27T23:55:03.000000Z +7ec0228e56e902e0155f47c851e96b38 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +270 + +__ashrdi3.c +file + + + + +2013-08-27T23:55:03.000000Z +b6fba0d56f11632ee9ef5238cdf8d31f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +388 + +seed48.c +file + + + + +2013-08-27T23:55:03.000000Z +3279a6eb33627bfd713592c7a2a9c103 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +295 + +__divsi3.c +file + + + + +2013-08-27T23:55:03.000000Z +e78d93c889ccf6cd17937ec4c9c3ad5c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +384 + +LICENSE +file + + + + +2013-08-27T23:55:03.000000Z +d75181f10e998c21eb147f6d2e43ce8b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3742 + +strtoll.c +file + + + + +2013-08-27T23:55:03.000000Z +aa3512047141c9ee2a56fc00a6e87868 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +71 + +version +file + + + + +2013-08-27T23:55:03.000000Z +c033c7649352cd5d6978b21605cc33a9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7 + +__udivmoddi4.c +file + + + + +2013-08-27T23:55:03.000000Z +e900315656cd3b5e82d5bddf47634336 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +489 + +__lshrdi3.c +file + + + + +2013-08-27T23:55:03.000000Z +b45f3d7a74003a177457662fee8a162b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +351 + +strtok_r.c +file + + + + +2013-08-27T23:55:03.000000Z +eae5ee07cd62ddc1fa4f44ef0d7d72ff +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +175 + +qsort.c +file + + + + +2013-08-27T23:55:03.000000Z +5e5c847d064bc0a44f28fa863edb1cb0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +852 + +__moddi3.c +file + + + + +2013-08-27T23:55:03.000000Z +2018a61371fd35e17d53f3ca0f0133b8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +408 + +strxspn.c +file + + + + +2013-08-27T23:55:03.000000Z +9a1b15bde8a22d071a9f139e44a9fc9f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +481 + +strnlen.c +file + + + + +2013-08-27T23:55:03.000000Z +ec40d197ed3a3096fd235f3920717fbc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +307 + +__udivmodsi4.c +file + + + + +2013-08-27T23:55:03.000000Z +e10e453937fa0ea673432ae8bd25599e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +487 + +strxspn.h +file + + + + +2013-08-27T23:55:03.000000Z +931c1f083e95ddbd5c1c84bcdb7a2cb7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +156 + +strtol.c +file + + + + +2013-08-27T23:55:03.000000Z +afd98d4092d82f1b84e4670204c41cb3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +65 + +__modsi3.c +file + + + + +2013-08-27T23:55:03.000000Z +9d50b6174bfab4a5600eadd2df4abacb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +398 + +atoi.c +file + + + + +2013-08-27T23:55:03.000000Z +a3f1f356a90ca2efd4b6f2c3ca0cb316 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +53 + +calloc.c +file + + + + +2013-08-27T23:55:03.000000Z +0c806b30120efe0b618ad1ceaeb36ee6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +242 + +memccpy.c +file + + + + +2013-08-27T23:55:03.000000Z +ce1e5ed78c77eef40bac32df5672a931 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +309 + diff --git a/i386/modules/klibc/.svn/text-base/Cconfig.svn-base b/i386/modules/klibc/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..d1e30f7 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config KLIBC_MODULE + tristate "klibc Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/klibc/.svn/text-base/LICENSE.svn-base b/i386/modules/klibc/.svn/text-base/LICENSE.svn-base new file mode 100644 index 0000000..aa6d7a7 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/LICENSE.svn-base @@ -0,0 +1,73 @@ +This license applies to all files in directory and its subdirectories, +unless otherwise noted in individual files. + + +Some files are derived from files derived from the include/ directory +of the Linux kernel, and are licensed under the terms of the GNU +General Public License, version 2, as released by the Free Software +Foundation, Inc.; incorporated herein by reference. + + ----- + +Some files are derived from files copyrighted by the Regents of The +University of California, and are available under the following +license: + +Note: The advertising clause in the license appearing on BSD Unix +files was officially rescinded by the Director of the Office of +Technology Licensing of the University of California on July 22 +1999. He states that clause 3 is "hereby deleted in its entirety." + + * Copyright (c) + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + + ----- + +For all remaining files, the following license applies: + + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * Any copyright notice(s) and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/i386/modules/klibc/.svn/text-base/Makefile.svn-base b/i386/modules/klibc/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..795a110 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/Makefile.svn-base @@ -0,0 +1,26 @@ +MODULE_NAME = klibc +MODULE_DESCRIPTION = This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. This is currently only used by the uClibc++ library. +MODULE_AUTHOR = +MODULE_VERSION = "1.5.20" +MODULE_COMPAT_VERSION = "1.5.20" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = klibc + +MODULE_OBJS = klibc.o \ + __ashldi3.o __ashrdi3.o __clzsi2.o __divdi3.o __divsi3.o \ + __lshrdi3.o __moddi3.o __modsi3.o __udivdi3.o \ + __udivmoddi4.o __udivmodsi4.o __udivsi3.o \ + __umoddi3.o __umodsi3.o \ + strntoumax.o strntoimax.o atol.o atoll.o \ + strcasecmp.o strncasecmp.o strlcat.o strndup.o strnlen.o \ + strsep.o strtoimax.o strtok_r.o strtok.o strtol.o strtoll.o strtotimespec.o strtotimeval.o \ + strtoul.o strtoull.o strtoumax.o strxspn.o strpbrk.o \ + bsearch.o calloc.o \ + jrand48.o lrand48.o mrand48.o srand48.o nrand48.o seed48.o \ + memccpy.o memchr.o memmem.o memmove.o memrchr.o memswap.o \ + qsort.o sha1hash.o onexit.o atexit.o exit.o \ + snprintf.o vsnprintf.o sscanf.o vsscanf.o\ + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/klibc/.svn/text-base/Readme.txt.svn-base b/i386/modules/klibc/.svn/text-base/Readme.txt.svn-base new file mode 100644 index 0000000..772fd7e --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/Readme.txt.svn-base @@ -0,0 +1,4 @@ +Module: klibc +Source: http://www.kernel.org/pub/linux/libs/klibc/ +Description: This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. This is currently only used by the uClibc++ library. +Dependencies: none diff --git a/i386/modules/klibc/.svn/text-base/__ashldi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__ashldi3.c.svn-base new file mode 100644 index 0000000..95937f0 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__ashldi3.c.svn-base @@ -0,0 +1,23 @@ +/* + * libgcc/__ashldi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +uint64_t __ashldi3(uint64_t v, int cnt) +{ + int c = cnt & 31; + uint32_t vl = (uint32_t) v; + uint32_t vh = (uint32_t) (v >> 32); + + if (cnt & 32) { + vh = (vl << c); + vl = 0; + } else { + vh = (vh << c) + (vl >> (32 - c)); + vl = (vl << c); + } + + return ((uint64_t) vh << 32) + vl; +} diff --git a/i386/modules/klibc/.svn/text-base/__ashrdi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__ashrdi3.c.svn-base new file mode 100644 index 0000000..14e6d18 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__ashrdi3.c.svn-base @@ -0,0 +1,23 @@ +/* + * libgcc/__ashrdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +uint64_t __ashrdi3(uint64_t v, int cnt) +{ + int c = cnt & 31; + uint32_t vl = (uint32_t) v; + uint32_t vh = (uint32_t) (v >> 32); + + if (cnt & 32) { + vl = ((int32_t) vh >> c); + vh = (int32_t) vh >> 31; + } else { + vl = (vl >> c) + (vh << (32 - c)); + vh = ((int32_t) vh >> c); + } + + return ((uint64_t) vh << 32) + vl; +} diff --git a/i386/modules/klibc/.svn/text-base/__clzsi2.c.svn-base b/i386/modules/klibc/.svn/text-base/__clzsi2.c.svn-base new file mode 100644 index 0000000..ebb11f0 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__clzsi2.c.svn-base @@ -0,0 +1,36 @@ +/* + * libgcc/__clzsi2.c + * + * Returns the leading number of 0 bits in the argument + */ + +#include <stdint.h> +#include <stddef.h> + +uint32_t __clzsi2(uint32_t v) +{ + int p = 31; + + if (v & 0xffff0000) { + p -= 16; + v >>= 16; + } + if (v & 0xff00) { + p -= 8; + v >>= 8; + } + if (v & 0xf0) { + p -= 4; + v >>= 4; + } + if (v & 0xc) { + p -= 2; + v >>= 2; + } + if (v & 0x2) { + p -= 1; + v >>= 1; + } + + return p; +} diff --git a/i386/modules/klibc/.svn/text-base/__divdi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__divdi3.c.svn-base new file mode 100644 index 0000000..973fe63 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__divdi3.c.svn-base @@ -0,0 +1,29 @@ +/* + * arch/i386/libgcc/__divdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +int64_t __divdi3(int64_t num, int64_t den) +{ + int minus = 0; + int64_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + v = __udivmoddi4(num, den, NULL); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/.svn/text-base/__divsi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__divsi3.c.svn-base new file mode 100644 index 0000000..35420f5 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__divsi3.c.svn-base @@ -0,0 +1,29 @@ +/* + * libgcc/__divsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +int32_t __divsi3(int32_t num, int32_t den) +{ + int minus = 0; + int32_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + v = __udivmodsi4(num, den, NULL); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/.svn/text-base/__lshrdi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__lshrdi3.c.svn-base new file mode 100644 index 0000000..765e1f2 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__lshrdi3.c.svn-base @@ -0,0 +1,23 @@ +/* + * libgcc/__lshrdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +uint64_t __lshrdi3(uint64_t v, int cnt) +{ + int c = cnt & 31; + uint32_t vl = (uint32_t) v; + uint32_t vh = (uint32_t) (v >> 32); + + if (cnt & 32) { + vl = (vh >> c); + vh = 0; + } else { + vl = (vl >> c) + (vh << (32 - c)); + vh = (vh >> c); + } + + return ((uint64_t) vh << 32) + vl; +} diff --git a/i386/modules/klibc/.svn/text-base/__moddi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__moddi3.c.svn-base new file mode 100644 index 0000000..0e7ed98 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__moddi3.c.svn-base @@ -0,0 +1,29 @@ +/* + * arch/i386/libgcc/__moddi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +int64_t __moddi3(int64_t num, int64_t den) +{ + int minus = 0; + int64_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + (void)__udivmoddi4(num, den, (uint64_t *) & v); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/.svn/text-base/__modsi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__modsi3.c.svn-base new file mode 100644 index 0000000..33a21ba --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__modsi3.c.svn-base @@ -0,0 +1,29 @@ +/* + * libgcc/__modsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +int32_t __modsi3(int32_t num, int32_t den) +{ + int minus = 0; + int32_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + (void)__udivmodsi4(num, den, (uint32_t *) & v); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/.svn/text-base/__udivdi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__udivdi3.c.svn-base new file mode 100644 index 0000000..5eea461 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__udivdi3.c.svn-base @@ -0,0 +1,13 @@ +/* + * arch/i386/libgcc/__divdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +uint64_t __udivdi3(uint64_t num, uint64_t den) +{ + return __udivmoddi4(num, den, NULL); +} diff --git a/i386/modules/klibc/.svn/text-base/__udivmoddi4.c.svn-base b/i386/modules/klibc/.svn/text-base/__udivmoddi4.c.svn-base new file mode 100644 index 0000000..eaec9c8 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__udivmoddi4.c.svn-base @@ -0,0 +1,33 @@ +#include "libsaio.h" + +extern void __divide_error(); + +uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem_p) +{ + uint64_t quot = 0, qbit = 1; + + if (den == 0) { + __divide_error(); + return 0; /* If trap returns... */ + } + + /* Left-justify denominator and count shift */ + while ((int64_t) den >= 0) { + den <<= 1; + qbit <<= 1; + } + + while (qbit) { + if (den <= num) { + num -= den; + quot += qbit; + } + den >>= 1; + qbit >>= 1; + } + + if (rem_p) + *rem_p = num; + + return quot; +} diff --git a/i386/modules/klibc/.svn/text-base/__udivmodsi4.c.svn-base b/i386/modules/klibc/.svn/text-base/__udivmodsi4.c.svn-base new file mode 100644 index 0000000..11d4b23 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__udivmodsi4.c.svn-base @@ -0,0 +1,31 @@ +#include "libsaio.h" +extern void __divide_error(); +uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem_p) +{ + uint32_t quot = 0, qbit = 1; + + if (den == 0) { + __divide_error(); + return 0; /* If trap returns... */ + } + + /* Left-justify denominator and count shift */ + while ((int32_t) den >= 0) { + den <<= 1; + qbit <<= 1; + } + + while (qbit) { + if (den <= num) { + num -= den; + quot += qbit; + } + den >>= 1; + qbit >>= 1; + } + + if (rem_p) + *rem_p = num; + + return quot; +} diff --git a/i386/modules/klibc/.svn/text-base/__udivsi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__udivsi3.c.svn-base new file mode 100644 index 0000000..5635f3f --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__udivsi3.c.svn-base @@ -0,0 +1,13 @@ +/* + * libgcc/__divsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +uint32_t __udivsi3(uint32_t num, uint32_t den) +{ + return __udivmodsi4(num, den, NULL); +} diff --git a/i386/modules/klibc/.svn/text-base/__umoddi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__umoddi3.c.svn-base new file mode 100644 index 0000000..1fc754a --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__umoddi3.c.svn-base @@ -0,0 +1,16 @@ +/* + * arch/i386/libgcc/__umoddi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +uint64_t __umoddi3(uint64_t num, uint64_t den) +{ + uint64_t v; + + (void)__udivmoddi4(num, den, &v); + return v; +} diff --git a/i386/modules/klibc/.svn/text-base/__umodsi3.c.svn-base b/i386/modules/klibc/.svn/text-base/__umodsi3.c.svn-base new file mode 100644 index 0000000..85e6e3c --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/__umodsi3.c.svn-base @@ -0,0 +1,16 @@ +/* + * libgcc/__umodsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +uint32_t __umodsi3(uint32_t num, uint32_t den) +{ + uint32_t v; + + (void)__udivmodsi4(num, den, &v); + return v; +} diff --git a/i386/modules/klibc/.svn/text-base/atexit.c.svn-base b/i386/modules/klibc/.svn/text-base/atexit.c.svn-base new file mode 100644 index 0000000..cdb3416 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/atexit.c.svn-base @@ -0,0 +1,16 @@ +/* + * atexit.c + */ + +#include <stdlib.h> + +int atexit(void (*fctn) (void)) +{ + return 0; +} + +int __cxa_atexit(void (*fctn) (void)) +{ + return 0; + //return on_exit((void (*)(int, void *))fctn, NULL); +} diff --git a/i386/modules/klibc/.svn/text-base/atexit.h.svn-base b/i386/modules/klibc/.svn/text-base/atexit.h.svn-base new file mode 100644 index 0000000..5018689 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/atexit.h.svn-base @@ -0,0 +1,18 @@ +/* + * atexit.h + * + * atexit()/on_exit() internal definitions + */ + +#ifndef ATEXIT_H +#define ATEXIT_H + +struct atexit { + void (*fctn) (int, void *); + void *arg; /* on_exit() parameter */ + struct atexit *next; +}; + +extern struct atexit *__atexit_list; + +#endif /* ATEXIT_H */ diff --git a/i386/modules/klibc/.svn/text-base/atoi.c.svn-base b/i386/modules/klibc/.svn/text-base/atoi.c.svn-base new file mode 100644 index 0000000..a6ec0bf --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/atoi.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE int +#define NAME atoi +#include "atox.c" diff --git a/i386/modules/klibc/.svn/text-base/atol.c.svn-base b/i386/modules/klibc/.svn/text-base/atol.c.svn-base new file mode 100644 index 0000000..e65484e --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/atol.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE long +#define NAME atol +#include "atox.c" diff --git a/i386/modules/klibc/.svn/text-base/atoll.c.svn-base b/i386/modules/klibc/.svn/text-base/atoll.c.svn-base new file mode 100644 index 0000000..25df79e --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/atoll.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE long long +#define NAME atoll +#include "atox.c" diff --git a/i386/modules/klibc/.svn/text-base/atox.c.svn-base b/i386/modules/klibc/.svn/text-base/atox.c.svn-base new file mode 100644 index 0000000..f6f8514 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/atox.c.svn-base @@ -0,0 +1,16 @@ +/* + * atox.c + * + * atoi(), atol(), atoll() + */ + +#include <inttypes.h> +#include <stdlib.h> +#include <stdio.h> + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +TYPE NAME(const char *nptr) +{ + return (TYPE) strntoumax(nptr, (char **)NULL, 10, ~(size_t) 0); +} diff --git a/i386/modules/klibc/.svn/text-base/bsearch.c.svn-base b/i386/modules/klibc/.svn/text-base/bsearch.c.svn-base new file mode 100644 index 0000000..1c8b07f --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/bsearch.c.svn-base @@ -0,0 +1,26 @@ +/* + * bsearch.c + */ + +#include <stdlib.h> + +void *bsearch(const void *key, const void *base, size_t nmemb, + size_t size, int (*cmp) (const void *, const void *)) +{ + while (nmemb) { + size_t mididx = nmemb / 2; + const void *midobj = base + mididx * size; + int diff = cmp(key, midobj); + + if (diff == 0) + return (void *)midobj; + + if (diff > 0) { + base = midobj + size; + nmemb -= mididx + 1; + } else + nmemb = mididx; + } + + return NULL; +} diff --git a/i386/modules/klibc/.svn/text-base/calloc.c.svn-base b/i386/modules/klibc/.svn/text-base/calloc.c.svn-base new file mode 100644 index 0000000..608feb3 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/calloc.c.svn-base @@ -0,0 +1,18 @@ +/* + * calloc.c + */ + +#include "libsaio.h" +/* FIXME: This should look for multiplication overflow */ + +void *calloc(size_t nmemb, size_t size) +{ + void *ptr; + + size *= nmemb; + ptr = malloc(size); + if (ptr) + memset(ptr, 0, size); + + return ptr; +} diff --git a/i386/modules/klibc/.svn/text-base/exit.c.svn-base b/i386/modules/klibc/.svn/text-base/exit.c.svn-base new file mode 100644 index 0000000..0898f04 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/exit.c.svn-base @@ -0,0 +1,30 @@ +/* + * exit.c + * + * exit(), including the handling of the atexit chain. + */ + +#include <stdlib.h> +#include <unistd.h> +#include <sys/syscall.h> +#include "atexit.h" + +/* Link chain for atexit/on_exit */ +struct atexit *__atexit_list; + +void exit(int rv) +{ + struct atexit *ap; + + for (ap = __atexit_list; ap; ap = ap->next) { + /* This assumes extra args are harmless. They should + be in all normal C ABIs, but if an architecture has + some particularly bizarre ABI this might be worth + watching out for. */ + ap->fctn(rv, ap->arg); + } + + /* Handle any library destructors if we ever start using them... */ + + _exit(rv); +} diff --git a/i386/modules/klibc/.svn/text-base/jrand48.c.svn-base b/i386/modules/klibc/.svn/text-base/jrand48.c.svn-base new file mode 100644 index 0000000..8e2b3ac --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/jrand48.c.svn-base @@ -0,0 +1,24 @@ +/* + * jrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +long jrand48(unsigned short xsubi[3]) +{ + uint64_t x; + + /* The xsubi[] array is littleendian by spec */ + x = (uint64_t) (uint16_t) xsubi[0] + + ((uint64_t) (uint16_t) xsubi[1] << 16) + + ((uint64_t) (uint16_t) xsubi[2] << 32); + + x = (0x5deece66dULL * x) + 0xb; + + xsubi[0] = (unsigned short)(uint16_t) x; + xsubi[1] = (unsigned short)(uint16_t) (x >> 16); + xsubi[2] = (unsigned short)(uint16_t) (x >> 32); + + return (long)(int32_t) (x >> 16); +} diff --git a/i386/modules/klibc/.svn/text-base/klibc.c.svn-base b/i386/modules/klibc/.svn/text-base/klibc.c.svn-base new file mode 100644 index 0000000..0545414 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/klibc.c.svn-base @@ -0,0 +1,38 @@ +/* + * klibc.c + * + * glue + initialization + */ + +#include "libsaio.h" + +int _DefaultRuneLocale; // todo: fixme + +void klibc_start() +{ +} + +void _exit(int status) +{ + stop("exit() called\n"); + while(1) halt(); // this is never reached +} + +char __toupper(char c) +{ + return ((c) & ~32); +} + +void __divide_error() +{ + stop("Divide by 0\n"); +} + +// hack +int +__maskrune(int _c, unsigned long _f) +{ + return 0; + //return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : + // _CurrentRuneLocale->__runetype[_c]) & _f; +} diff --git a/i386/modules/klibc/.svn/text-base/limits.h.svn-base b/i386/modules/klibc/.svn/text-base/limits.h.svn-base new file mode 100644 index 0000000..92b9bb9 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/limits.h.svn-base @@ -0,0 +1,6 @@ + +#define CHAR_BIT 8 + +#define UCHAR_MAX 255u +#define INT_MAX 2147483647 +#define UINT_MAX 4294967295u \ No newline at end of file diff --git a/i386/modules/klibc/.svn/text-base/lrand48.c.svn-base b/i386/modules/klibc/.svn/text-base/lrand48.c.svn-base new file mode 100644 index 0000000..a2fc87a --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/lrand48.c.svn-base @@ -0,0 +1,13 @@ +/* + * lrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +extern unsigned short __rand48_seed[3]; /* Common with mrand48.c, srand48.c */ + +long lrand48(void) +{ + return (uint32_t) jrand48(__rand48_seed) >> 1; +} diff --git a/i386/modules/klibc/.svn/text-base/memccpy.c.svn-base b/i386/modules/klibc/.svn/text-base/memccpy.c.svn-base new file mode 100644 index 0000000..83d02c9 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/memccpy.c.svn-base @@ -0,0 +1,23 @@ +/* + * memccpy.c + * + * memccpy() + */ + +#include <stddef.h> +#include <string.h> + +void *memccpy(void *dst, const void *src, int c, size_t n) +{ + char *q = dst; + const char *p = src; + char ch; + + while (n--) { + *q++ = ch = *p++; + if (ch == (char)c) + return q; + } + + return NULL; /* No instance of "c" found */ +} diff --git a/i386/modules/klibc/.svn/text-base/memchr.c.svn-base b/i386/modules/klibc/.svn/text-base/memchr.c.svn-base new file mode 100644 index 0000000..f1947fb --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/memchr.c.svn-base @@ -0,0 +1,19 @@ +/* + * memchr.c + */ + +#include <stddef.h> +#include <string.h> + +void *memchr(const void *s, int c, size_t n) +{ + const unsigned char *sp = s; + + while (n--) { + if (*sp == (unsigned char)c) + return (void *)sp; + sp++; + } + + return NULL; +} diff --git a/i386/modules/klibc/.svn/text-base/memmem.c.svn-base b/i386/modules/klibc/.svn/text-base/memmem.c.svn-base new file mode 100644 index 0000000..8b5faa0 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/memmem.c.svn-base @@ -0,0 +1,52 @@ +/* + * memmem.c + * + * Find a byte string inside a longer byte string + * + * This uses the "Not So Naive" algorithm, a very simple but + * usually effective algorithm, see: + * + * http://www-igm.univ-mlv.fr/~lecroq/string/ + */ + +#include <string.h> + +void *memmem(const void *haystack, size_t n, const void *needle, size_t m) +{ + const unsigned char *y = (const unsigned char *)haystack; + const unsigned char *x = (const unsigned char *)needle; + + size_t j, k, l; + + if (m > n || !m || !n) + return NULL; + + if (1 != m) { + if (x[0] == x[1]) { + k = 2; + l = 1; + } else { + k = 1; + l = 2; + } + + j = 0; + while (j <= n - m) { + if (x[1] != y[j + 1]) { + j += k; + } else { + if (!memcmp(x + 2, y + j + 2, m - 2) + && x[0] == y[j]) + return (void *)&y[j]; + j += l; + } + } + } else + do { + if (*y == *x) + return (void *)y; + y++; + } while (--n); + + return NULL; +} diff --git a/i386/modules/klibc/.svn/text-base/memmove.c.svn-base b/i386/modules/klibc/.svn/text-base/memmove.c.svn-base new file mode 100644 index 0000000..d8a4226 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/memmove.c.svn-base @@ -0,0 +1,36 @@ +/* + * memmove.c + */ + +#include "libsaio.h" + +void *memmove(void *dst, const void *src, size_t n) +{ + const char *p = src; + char *q = dst; +#if defined(__i386__) || defined(__x86_64__) + if (q < p) { + asm volatile("cld; rep; movsb" + : "+c" (n), "+S"(p), "+D"(q)); + } else { + p += (n - 1); + q += (n - 1); + asm volatile("std; rep; movsb; cld" + : "+c" (n), "+S"(p), "+D"(q)); + } +#else + if (q < p) { + while (n--) { + *q++ = *p++; + } + } else { + p += n; + q += n; + while (n--) { + *--q = *--p; + } + } +#endif + + return dst; +} diff --git a/i386/modules/klibc/.svn/text-base/memrchr.c.svn-base b/i386/modules/klibc/.svn/text-base/memrchr.c.svn-base new file mode 100644 index 0000000..ff6d711 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/memrchr.c.svn-base @@ -0,0 +1,19 @@ +/* + * memrchr.c + */ + +#include <stddef.h> +#include <string.h> + +void *memrchr(const void *s, int c, size_t n) +{ + const unsigned char *sp = (const unsigned char *)s + n - 1; + + while (n--) { + if (*sp == (unsigned char)c) + return (void *)sp; + sp--; + } + + return NULL; +} diff --git a/i386/modules/klibc/.svn/text-base/memswap.c.svn-base b/i386/modules/klibc/.svn/text-base/memswap.c.svn-base new file mode 100644 index 0000000..b32315c --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/memswap.c.svn-base @@ -0,0 +1,24 @@ +/* + * memswap() + * + * Swaps the contents of two nonoverlapping memory areas. + * This really could be done faster... + */ + +#include <string.h> + +void memswap(void *m1, void *m2, size_t n) +{ + char *p = m1; + char *q = m2; + char tmp; + + while (n--) { + tmp = *p; + *p = *q; + *q = tmp; + + p++; + q++; + } +} diff --git a/i386/modules/klibc/.svn/text-base/mrand48.c.svn-base b/i386/modules/klibc/.svn/text-base/mrand48.c.svn-base new file mode 100644 index 0000000..1a2383b --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/mrand48.c.svn-base @@ -0,0 +1,13 @@ +/* + * mrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +extern unsigned short __rand48_seed[3]; /* Common with lrand48.c, srand48.c */ + +long mrand48(void) +{ + return jrand48(__rand48_seed); +} diff --git a/i386/modules/klibc/.svn/text-base/nrand48.c.svn-base b/i386/modules/klibc/.svn/text-base/nrand48.c.svn-base new file mode 100644 index 0000000..cb3532b --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/nrand48.c.svn-base @@ -0,0 +1,11 @@ +/* + * nrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +long nrand48(unsigned short xsubi[3]) +{ + return (long)((uint32_t) jrand48(xsubi) >> 1); +} diff --git a/i386/modules/klibc/.svn/text-base/onexit.c.svn-base b/i386/modules/klibc/.svn/text-base/onexit.c.svn-base new file mode 100644 index 0000000..8f846bf --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/onexit.c.svn-base @@ -0,0 +1,22 @@ +/* + * onexit.c + */ + +#include "libsaio.h" +#include "atexit.h" + +int on_exit(void (*fctn) (int, void *), void *arg) +{ + struct atexit *as = malloc(sizeof(struct atexit)); + + if (!as) + return -1; + + as->fctn = fctn; + as->arg = arg; + + as->next = __atexit_list; + __atexit_list = as; + + return 0; +} diff --git a/i386/modules/klibc/.svn/text-base/qsort.c.svn-base b/i386/modules/klibc/.svn/text-base/qsort.c.svn-base new file mode 100644 index 0000000..66c2a17 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/qsort.c.svn-base @@ -0,0 +1,48 @@ +/* + * qsort.c + * + * This is actually combsort. It's an O(n log n) algorithm with + * simplicity/small code size being its main virtue. + */ + +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +extern void memswap(void *m1, void *m2, size_t n); + +static inline size_t newgap(size_t gap) +{ + gap = (gap * 10) / 13; + if (gap == 9 || gap == 10) + gap = 11; + + if (gap < 1) + gap = 1; + return gap; +} + +void qsort(void *base, size_t nmemb, size_t size, + int (*compar) (const void *, const void *)) +{ + size_t gap = nmemb; + size_t i, j; + char *p1, *p2; + int swapped; + + if (!nmemb) + return; + + do { + gap = newgap(gap); + swapped = 0; + + for (i = 0, p1 = base; i < nmemb - gap; i++, p1 += size) { + j = i + gap; + if (compar(p1, p2 = (char *)base + j * size) > 0) { + memswap(p1, p2, size); + swapped = 1; + } + } + } while (gap > 1 || swapped); +} diff --git a/i386/modules/klibc/.svn/text-base/seed48.c.svn-base b/i386/modules/klibc/.svn/text-base/seed48.c.svn-base new file mode 100644 index 0000000..4ae5224 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/seed48.c.svn-base @@ -0,0 +1,16 @@ +/* + * seed48.c + */ + +#include "libsaio.h" + +unsigned short __rand48_seed[3]; + +unsigned short *seed48(const unsigned short xsubi[3]) +{ + static unsigned short oldseed[3]; + memcpy(oldseed, __rand48_seed, sizeof __rand48_seed); + memcpy(__rand48_seed, xsubi, sizeof __rand48_seed); + + return oldseed; +} diff --git a/i386/modules/klibc/.svn/text-base/sha1hash.c.svn-base b/i386/modules/klibc/.svn/text-base/sha1hash.c.svn-base new file mode 100644 index 0000000..513bd69 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/sha1hash.c.svn-base @@ -0,0 +1,319 @@ +/* +SHA-1 in C +By Steve Reid <sreid@sea-to-sky.net> +100% Public Domain + +----------------- +Modified 7/98 +By James H. Brown <jbrown@burgoyne.com> +Still 100% Public Domain + +Corrected a problem which generated improper hash values on 16 bit machines +Routine SHA1Update changed from + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int +len) +to + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned +long len) + +The 'len' parameter was declared an int which works fine on 32 bit machines. +However, on 16 bit machines an int is too small for the shifts being done +against +it. This caused the hash function to generate incorrect values if len was +greater than 8191 (8K - 1) due to the 'len << 3' on line 3 of SHA1Update(). + +Since the file IO in main() reads 16K at a time, any file 8K or larger would +be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million +"a"s). + +I also changed the declaration of variables i & j in SHA1Update to +unsigned long from unsigned int for the same reason. + +These changes should make no difference to any 32 bit implementations since +an +int and a long are the same size in those environments. + +-- +I also corrected a few compiler warnings generated by Borland C. +1. Added #include <process.h> for exit() prototype +2. Removed unused variable 'j' in SHA1Final +3. Changed exit(0) to return(0) at end of main. + +ALL changes I made can be located by searching for comments containing 'JHB' +----------------- +Modified 8/98 +By Steve Reid <sreid@sea-to-sky.net> +Still 100% public domain + +1- Removed #include <process.h> and used return() instead of exit() +2- Fixed overwriting of finalcount in SHA1Final() (discovered by Chris Hall) +3- Changed email address from steve@edmweb.com to sreid@sea-to-sky.net + +----------------- +Modified 4/01 +By Saul Kravitz <Saul.Kravitz@celera.com> +Still 100% PD +Modified to run on Compaq Alpha hardware. + +----------------- +Modified 2/03 +By H. Peter Anvin <hpa@zytor.com> +Still 100% PD +Modified to run on any hardware with <inttypes.h> and <netinet/in.h> +Changed the driver program + +*/ + +/* +Test Vectors (from FIPS PUB 180-1) +"abc" + A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D +"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" + 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 +A million repetitions of "a" + 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F +*/ + +/* #define SHA1HANDSOFF */ + +#include <stdio.h> +#include <string.h> +#include <inttypes.h> +#include <netinet/in.h> /* For htonl/ntohl/htons/ntohs */ + +/* #include <process.h> */ /* prototype for exit() - JHB */ +/* Using return() instead of exit() - SWR */ + +typedef struct { + uint32_t state[5]; + uint32_t count[2]; + unsigned char buffer[64]; +} SHA1_CTX; + +void SHA1Transform(uint32_t state[5], unsigned char buffer[64]); +void SHA1Init(SHA1_CTX* context); +void SHA1Update(SHA1_CTX* context, unsigned char* data, uint32_t len); /* +JHB */ +void SHA1Final(unsigned char digest[20], SHA1_CTX* context); + +#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) + +/* blk0() and blk() perform the initial expand. */ +/* I got the idea of expanding during the round function from SSLeay */ +#define blk0(i) (block->l[i] = ntohl(block->l[i])) +#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ + ^block->l[(i+2)&15]^block->l[i&15],1)) + +/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ +#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); +#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); +#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); +#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); +#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); + + +#ifdef VERBOSE /* SAK */ +void SHAPrintContext(SHA1_CTX *context, char *msg){ + printf("%s (%d,%d) %x %x %x %x %x\n", + msg, + context->count[0], context->count[1], + context->state[0], + context->state[1], + context->state[2], + context->state[3], + context->state[4]); +} +#endif + +/* Hash a single 512-bit block. This is the core of the algorithm. */ + +void SHA1Transform(uint32_t state[5], unsigned char buffer[64]) +{ +uint32_t a, b, c, d, e; +typedef union { + unsigned char c[64]; + uint32_t l[16]; +} CHAR64LONG16; +CHAR64LONG16* block; +#ifdef SHA1HANDSOFF +static unsigned char workspace[64]; + block = (CHAR64LONG16*)workspace; + memcpy(block, buffer, 64); +#else + block = (CHAR64LONG16*)buffer; +#endif + /* Copy context->state[] to working vars */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + /* 4 rounds of 20 operations each. Loop unrolled. */ + R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); + R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); + R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); + R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); + R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); + R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); + R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); + R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); + R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); + R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); + R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); + R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); + R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); + R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); + R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); + R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); + R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); + R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); + R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); + R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); + /* Add the working vars back into context.state[] */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + /* Wipe variables */ + a = b = c = d = e = 0; +} + + +/* SHA1Init - Initialize new context */ + +void SHA1Init(SHA1_CTX* context) +{ + /* SHA1 initialization constants */ + context->state[0] = 0x67452301; + context->state[1] = 0xEFCDAB89; + context->state[2] = 0x98BADCFE; + context->state[3] = 0x10325476; + context->state[4] = 0xC3D2E1F0; + context->count[0] = context->count[1] = 0; +} + + +/* Run your data through this. */ + +void SHA1Update(SHA1_CTX* context, unsigned char* data, uint32_t len) /* +JHB */ +{ +uint32_t i, j; /* JHB */ + +#ifdef VERBOSE + SHAPrintContext(context, "before"); +#endif + j = (context->count[0] >> 3) & 63; + if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; + context->count[1] += (len >> 29); + if ((j + len) > 63) { + memcpy(&context->buffer[j], data, (i = 64-j)); + SHA1Transform(context->state, context->buffer); + for ( ; i + 63 < len; i += 64) { + SHA1Transform(context->state, &data[i]); + } + j = 0; + } + else i = 0; + memcpy(&context->buffer[j], &data[i], len - i); +#ifdef VERBOSE + SHAPrintContext(context, "after "); +#endif +} + + +/* Add padding and return the message digest. */ + +void SHA1Final(unsigned char digest[20], SHA1_CTX* context) +{ +uint32_t i; /* JHB */ +unsigned char finalcount[8]; + + for (i = 0; i < 8; i++) { + finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] + >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ + } + SHA1Update(context, (unsigned char *)"\200", 1); + while ((context->count[0] & 504) != 448) { + SHA1Update(context, (unsigned char *)"\0", 1); + } + SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() +*/ + for (i = 0; i < 20; i++) { + digest[i] = (unsigned char) + ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); + } + /* Wipe variables */ + i = 0; /* JHB */ + memset(context->buffer, 0, 64); + memset(context->state, 0, 20); + memset(context->count, 0, 8); + memset(finalcount, 0, 8); /* SWR */ +#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ + SHA1Transform(context->state, context->buffer); +#endif +} + +/*************************************************************/ + +/* This is not quite the MIME base64 algorithm: it uses _ instead of /, + and instead of padding the output with = characters we just make the + output shorter. */ +char *mybase64(uint8_t digest[20]) +{ + static const char charz[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + uint8_t input[21]; + static char output[28]; + int i, j; + uint8_t *p; + char *q; + uint32_t bv; + + memcpy(input, digest, 20); + input[20] = 0; /* Pad to multiple of 3 bytes */ + + p = input; q = output; + for ( i = 0 ; i < 7 ; i++ ) { + bv = (p[0] << 16) | (p[1] << 8) | p[2]; + p += 3; + for ( j = 0 ; j < 4 ; j++ ) { + *q++ = charz[(bv >> 18) & 0x3f]; + bv <<= 6; + } + } + *--q = '\0'; /* The last character is not significant */ + return output; +} + +#if 0 +int main(int argc, char** argv) +{ + int i; + SHA1_CTX context; + uint8_t digest[20], buffer[16384]; + FILE* file; + + if (argc < 2) { + file = stdin; + } + else { + if (!(file = fopen(argv[1], "rb"))) { + fputs("Unable to open file.", stderr); + return(-1); + } + } + SHA1Init(&context); + while (!feof(file)) { /* note: what if ferror(file) */ + i = fread(buffer, 1, 16384, file); + SHA1Update(&context, buffer, i); + } + SHA1Final(digest, &context); + fclose(file); + + puts(mybase64(digest)); + + return 0; +} +#endif diff --git a/i386/modules/klibc/.svn/text-base/snprintf.c.svn-base b/i386/modules/klibc/.svn/text-base/snprintf.c.svn-base new file mode 100644 index 0000000..6bc08e2 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/snprintf.c.svn-base @@ -0,0 +1,17 @@ +/* + * snprintf.c + */ + +#include "libsaio.h" +extern int vsnprintf(char *buffer, size_t n, const char *format, va_list ap); + +int snprintf(char *buffer, size_t n, const char *format, ...) +{ + va_list ap; + int rv; + + va_start(ap, format); + rv = vsnprintf(buffer, n, format, ap); + va_end(ap); + return rv; +} diff --git a/i386/modules/klibc/.svn/text-base/srand48.c.svn-base b/i386/modules/klibc/.svn/text-base/srand48.c.svn-base new file mode 100644 index 0000000..dd21127 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/srand48.c.svn-base @@ -0,0 +1,15 @@ +/* + * srand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +extern unsigned short __rand48_seed[3]; /* Common with mrand48.c, lrand48.c */ + +void srand48(long seedval) +{ + __rand48_seed[0] = 0x330e; + __rand48_seed[1] = (unsigned short)seedval; + __rand48_seed[2] = (unsigned short)((uint32_t) seedval >> 16); +} diff --git a/i386/modules/klibc/.svn/text-base/sscanf.c.svn-base b/i386/modules/klibc/.svn/text-base/sscanf.c.svn-base new file mode 100644 index 0000000..419e80c --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/sscanf.c.svn-base @@ -0,0 +1,17 @@ +/* + * sscanf() + */ + +#include "libsaio.h" +extern int vsscanf(const char *buffer, const char *format, va_list ap); +int sscanf(const char *str, const char *format, ...) +{ + va_list ap; + int rv; + + va_start(ap, format); + rv = vsscanf(str, format, ap); + va_end(ap); + + return rv; +} diff --git a/i386/modules/klibc/.svn/text-base/strcasecmp.c.svn-base b/i386/modules/klibc/.svn/text-base/strcasecmp.c.svn-base new file mode 100644 index 0000000..ee1f28b --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strcasecmp.c.svn-base @@ -0,0 +1,24 @@ +/* + * strcasecmp.c + */ + +#include <string.h> +#include <ctype.h> + +int strcasecmp(const char *s1, const char *s2) +{ + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; + unsigned char ch; + int d = 0; + + while (1) { + /* toupper() expects an unsigned char (implicitly cast to int) + as input, and returns an int, which is exactly what we want. */ + d = toupper(ch = *c1++) - toupper(*c2++); + if (d || !ch) + break; + } + + return d; +} diff --git a/i386/modules/klibc/.svn/text-base/strdup.c.svn-base b/i386/modules/klibc/.svn/text-base/strdup.c.svn-base new file mode 100644 index 0000000..f0b9355 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strdup.c.svn-base @@ -0,0 +1,16 @@ +/* + * strdup.c + */ + +#include "libsaio.h" + +char *strdup(const char *s) +{ + int l = strlen(s) + 1; + char *d = malloc(l); + + if (d) + memcpy(d, s, l); + + return d; +} diff --git a/i386/modules/klibc/.svn/text-base/strlcat.c.svn-base b/i386/modules/klibc/.svn/text-base/strlcat.c.svn-base new file mode 100644 index 0000000..6d95087 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strlcat.c.svn-base @@ -0,0 +1,30 @@ +/* + * strlcat.c + */ + +#include <string.h> + +size_t strlcat(char *dst, const char *src, size_t size) +{ + size_t bytes = 0; + char *q = dst; + const char *p = src; + char ch; + + while (bytes < size && *q) { + q++; + bytes++; + } + if (bytes == size) + return (bytes + strlen(src)); + + while ((ch = *p++)) { + if (bytes + 1 < size) + *q++ = ch; + + bytes++; + } + + *q = '\0'; + return bytes; +} diff --git a/i386/modules/klibc/.svn/text-base/strncasecmp.c.svn-base b/i386/modules/klibc/.svn/text-base/strncasecmp.c.svn-base new file mode 100644 index 0000000..0551935 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strncasecmp.c.svn-base @@ -0,0 +1,24 @@ +/* + * strncasecmp.c + */ + +#include <string.h> +#include <ctype.h> + +int strncasecmp(const char *s1, const char *s2, size_t n) +{ + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; + unsigned char ch; + int d = 0; + + while (n--) { + /* toupper() expects an unsigned char (implicitly cast to int) + as input, and returns an int, which is exactly what we want. */ + d = toupper(ch = *c1++) - toupper(*c2++); + if (d || !ch) + break; + } + + return d; +} diff --git a/i386/modules/klibc/.svn/text-base/strndup.c.svn-base b/i386/modules/klibc/.svn/text-base/strndup.c.svn-base new file mode 100644 index 0000000..ea63a39 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strndup.c.svn-base @@ -0,0 +1,16 @@ +/* + * strndup.c + */ + +#include "libsaio.h" + +char *strndup(const char *s, size_t n) +{ + int l = n > strlen(s) ? strlen(s) + 1 : n + 1; + char *d = malloc(l); + + if (d) + memcpy(d, s, l); + d[n] = '\0'; + return d; +} diff --git a/i386/modules/klibc/.svn/text-base/strnlen.c.svn-base b/i386/modules/klibc/.svn/text-base/strnlen.c.svn-base new file mode 100644 index 0000000..1678f4b --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strnlen.c.svn-base @@ -0,0 +1,18 @@ +/* + * strnlen() + */ + +#include <string.h> + +size_t strnlen(const char *s, size_t maxlen) +{ + const char *ss = s; + + /* Important: the maxlen test must precede the reference through ss; + since the byte beyond the maximum may segfault */ + while ((maxlen > 0) && *ss) { + ss++; + maxlen--; + } + return ss - s; +} diff --git a/i386/modules/klibc/.svn/text-base/strntoimax.c.svn-base b/i386/modules/klibc/.svn/text-base/strntoimax.c.svn-base new file mode 100644 index 0000000..c152862 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strntoimax.c.svn-base @@ -0,0 +1,15 @@ +/* + * strntoimax.c + * + * strntoimax() + */ + +#include <stddef.h> +#include <inttypes.h> + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +intmax_t strntoimax(const char *nptr, char **endptr, int base, size_t n) +{ + return (intmax_t) strntoumax(nptr, endptr, base, n); +} diff --git a/i386/modules/klibc/.svn/text-base/strntoumax.c.svn-base b/i386/modules/klibc/.svn/text-base/strntoumax.c.svn-base new file mode 100644 index 0000000..ab43349 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strntoumax.c.svn-base @@ -0,0 +1,73 @@ +/* + * strntoumax.c + * + * The strntoumax() function and associated + */ +#include "libsaio.h" + +static inline int digitval(int ch) +{ + if (ch >= '0' && ch <= '9') { + return ch - '0'; + } else if (ch >= 'A' && ch <= 'Z') { + return ch - 'A' + 10; + } else if (ch >= 'a' && ch <= 'z') { + return ch - 'a' + 10; + } else { + return -1; + } +} + +uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n) +{ + int minus = 0; + uintmax_t v = 0; + int d; + + while (n && isspace((unsigned char)*nptr)) { + nptr++; + n--; + } + + /* Single optional + or - */ + if (n) { + char c = *nptr; + if (c == '-' || c == '+') { + minus = (c == '-'); + nptr++; + n--; + } + } + + if (base == 0) { + if (n >= 2 && nptr[0] == '0' && + (nptr[1] == 'x' || nptr[1] == 'X')) { + n -= 2; + nptr += 2; + base = 16; + } else if (n >= 1 && nptr[0] == '0') { + n--; + nptr++; + base = 8; + } else { + base = 10; + } + } else if (base == 16) { + if (n >= 2 && nptr[0] == '0' && + (nptr[1] == 'x' || nptr[1] == 'X')) { + n -= 2; + nptr += 2; + } + } + + while (n && (d = digitval(*nptr)) >= 0 && d < base) { + v = v * base + d; + n--; + nptr++; + } + + if (endptr) + *endptr = (char *)nptr; + + return minus ? -v : v; +} diff --git a/i386/modules/klibc/.svn/text-base/strpbrk.c.svn-base b/i386/modules/klibc/.svn/text-base/strpbrk.c.svn-base new file mode 100644 index 0000000..300dbba --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strpbrk.c.svn-base @@ -0,0 +1,14 @@ +/* + * strpbrk + */ + +#include <string.h> + +#include "strxspn.h" + +char *strpbrk(const char *s, const char *accept) +{ + const char *ss = s + __strxspn(s, accept, 1); + + return *ss ? (char *)ss : NULL; +} diff --git a/i386/modules/klibc/.svn/text-base/strsep.c.svn-base b/i386/modules/klibc/.svn/text-base/strsep.c.svn-base new file mode 100644 index 0000000..44e76bd --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strsep.c.svn-base @@ -0,0 +1,21 @@ +/* + * strsep.c + */ + +#include <string.h> + +char *strsep(char **stringp, const char *delim) +{ + char *s = *stringp; + char *e; + + if (!s) + return NULL; + + e = strpbrk(s, delim); + if (e) + *e++ = '\0'; + + *stringp = e; + return s; +} diff --git a/i386/modules/klibc/.svn/text-base/strtoimax.c.svn-base b/i386/modules/klibc/.svn/text-base/strtoimax.c.svn-base new file mode 100644 index 0000000..0cdd088 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtoimax.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE intmax_t +#define NAME strtoimax +#include "strtox.c" diff --git a/i386/modules/klibc/.svn/text-base/strtok.c.svn-base b/i386/modules/klibc/.svn/text-base/strtok.c.svn-base new file mode 100644 index 0000000..6b169a1 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtok.c.svn-base @@ -0,0 +1,12 @@ +/* + * strtok.c + */ + +#include <string.h> + +char *strtok(char *s, const char *delim) +{ + static char *holder; + + return strtok_r(s, delim, &holder); +} diff --git a/i386/modules/klibc/.svn/text-base/strtok_r.c.svn-base b/i386/modules/klibc/.svn/text-base/strtok_r.c.svn-base new file mode 100644 index 0000000..695d516 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtok_r.c.svn-base @@ -0,0 +1,13 @@ +#include <string.h> + +char *strtok_r(char *s, const char *delim, char **holder) +{ + if (s) + *holder = s; + + do { + s = strsep(holder, delim); + } while (s && !*s); + + return s; +} diff --git a/i386/modules/klibc/.svn/text-base/strtol.c.svn-base b/i386/modules/klibc/.svn/text-base/strtol.c.svn-base new file mode 100644 index 0000000..9efc8b9 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtol.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE signed long +#define NAME strtol +#include "strtox.c" diff --git a/i386/modules/klibc/.svn/text-base/strtoll.c.svn-base b/i386/modules/klibc/.svn/text-base/strtoll.c.svn-base new file mode 100644 index 0000000..a9428c7 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtoll.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE signed long long +#define NAME strtoll +#include "strtox.c" diff --git a/i386/modules/klibc/.svn/text-base/strtotimespec.c.svn-base b/i386/modules/klibc/.svn/text-base/strtotimespec.c.svn-base new file mode 100644 index 0000000..b426bf8 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtotimespec.c.svn-base @@ -0,0 +1,5 @@ +#define NAME strtotimespec +#define TIMEX struct timespec +#define FSEC tv_nsec +#define DECIMALS 9 +#include "strtotimex.c" diff --git a/i386/modules/klibc/.svn/text-base/strtotimeval.c.svn-base b/i386/modules/klibc/.svn/text-base/strtotimeval.c.svn-base new file mode 100644 index 0000000..280d4bc --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtotimeval.c.svn-base @@ -0,0 +1,5 @@ +#define NAME strtotimeval +#define TIMEX struct timeval +#define FSEC tv_usec +#define DECIMALS 6 +#include "strtotimex.c" diff --git a/i386/modules/klibc/.svn/text-base/strtotimex.c.svn-base b/i386/modules/klibc/.svn/text-base/strtotimex.c.svn-base new file mode 100644 index 0000000..064c6f9 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtotimex.c.svn-base @@ -0,0 +1,42 @@ +/* + * strtotimex.c + * + * Nonstandard function which takes a string and converts it to a + * struct timespec/timeval. Returns a pointer to the first non-numeric + * character in the string. + * + */ + +#include <ctype.h> +#include <inttypes.h> +#include <stdlib.h> +#include <time.h> +#include <sys/time.h> + +uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +char *NAME(const char *str, TIMEX * ts) +{ + int n; + char *s, *s0; + __typeof__(ts->FSEC) fs; /* Fractional seconds */ + + ts->tv_sec = strntoumax(str, &s, 10, ~(size_t) 0); + fs = 0; + + if (*s == '.') { + s0 = s + 1; + + fs = strntoumax(s0, &s, 10, DECIMALS); + n = s - s0; + + while (isdigit(*s)) + s++; + + for (; n < DECIMALS; n++) + fs *= 10; + } + + ts->FSEC = fs; + return s; +} diff --git a/i386/modules/klibc/.svn/text-base/strtoul.c.svn-base b/i386/modules/klibc/.svn/text-base/strtoul.c.svn-base new file mode 100644 index 0000000..3189aaa --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtoul.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE unsigned long +#define NAME strtoul +#include "strtox.c" diff --git a/i386/modules/klibc/.svn/text-base/strtoull.c.svn-base b/i386/modules/klibc/.svn/text-base/strtoull.c.svn-base new file mode 100644 index 0000000..83c14e9 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtoull.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE unsigned long long +#define NAME strtoull +#include "strtox.c" diff --git a/i386/modules/klibc/.svn/text-base/strtoumax.c.svn-base b/i386/modules/klibc/.svn/text-base/strtoumax.c.svn-base new file mode 100644 index 0000000..a379710 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtoumax.c.svn-base @@ -0,0 +1,3 @@ +#define TYPE uintmax_t +#define NAME strtoumax +#include "strtox.c" diff --git a/i386/modules/klibc/.svn/text-base/strtox.c.svn-base b/i386/modules/klibc/.svn/text-base/strtox.c.svn-base new file mode 100644 index 0000000..02d1e1b --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strtox.c.svn-base @@ -0,0 +1,16 @@ +/* + * strtox.c + * + * strto...() functions, by macro definition + */ + +#include <stddef.h> +#include <stdlib.h> +#include <inttypes.h> + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +TYPE NAME(const char *nptr, char **endptr, int base) +{ + return (TYPE) strntoumax(nptr, endptr, base, ~(size_t) 0); +} diff --git a/i386/modules/klibc/.svn/text-base/strxspn.c.svn-base b/i386/modules/klibc/.svn/text-base/strxspn.c.svn-base new file mode 100644 index 0000000..8f32a08 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strxspn.c.svn-base @@ -0,0 +1,30 @@ +/* + * strpbrk + */ + +#include <limits.h> +#include "libsaio.h" +#include "strxspn.h" + + + + +size_t __strxspn(const char *s, const char *map, int parity) +{ + char matchmap[UCHAR_MAX + 1]; + size_t n = 0; + + /* Create bitmap */ + memset(matchmap, 0, sizeof matchmap); + while (*map) + matchmap[(unsigned char)*map++] = 1; + + /* Make sure the null character never matches */ + matchmap[0] = parity; + + /* Calculate span length */ + while (matchmap[(unsigned char)*s++] ^ parity) + n++; + + return n; +} diff --git a/i386/modules/klibc/.svn/text-base/strxspn.h.svn-base b/i386/modules/klibc/.svn/text-base/strxspn.h.svn-base new file mode 100644 index 0000000..ce56ff2 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/strxspn.h.svn-base @@ -0,0 +1,12 @@ +/* + * strxspn.h + */ + +#ifndef STRXSPN_H +#define STRXSPN_H + +#include <stddef.h> + +extern size_t __strxspn(const char *s, const char *map, int parity); + +#endif diff --git a/i386/modules/klibc/.svn/text-base/version.svn-base b/i386/modules/klibc/.svn/text-base/version.svn-base new file mode 100644 index 0000000..a7ccabd --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/version.svn-base @@ -0,0 +1 @@ +1.5.20 diff --git a/i386/modules/klibc/.svn/text-base/vsnprintf.c.svn-base b/i386/modules/klibc/.svn/text-base/vsnprintf.c.svn-base new file mode 100644 index 0000000..e25c834 --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/vsnprintf.c.svn-base @@ -0,0 +1,486 @@ +/* + * vsnprintf.c + * + * vsnprintf(), from which the rest of the printf() + * family is built + */ + +//#include "libsaio.h" +//Azi: "UCHAR_MAX" & "UINT_MAX" redefined error - limits.h is also present in i386/include. +#include "libsa.h" +#include "limits.h" + +enum flags { + FL_ZERO = 0x01, /* Zero modifier */ + FL_MINUS = 0x02, /* Minus modifier */ + FL_PLUS = 0x04, /* Plus modifier */ + FL_TICK = 0x08, /* ' modifier */ + FL_SPACE = 0x10, /* Space modifier */ + FL_HASH = 0x20, /* # modifier */ + FL_SIGNED = 0x40, /* Number is signed */ + FL_UPPER = 0x80 /* Upper case digits */ +}; + +/* These may have to be adjusted on certain implementations */ +enum ranks { + rank_char = -2, + rank_short = -1, + rank_int = 0, + rank_long = 1, + rank_longlong = 2 +}; + +#define MIN_RANK rank_char +#define MAX_RANK rank_longlong + +#define INTMAX_RANK rank_longlong +#define SIZE_T_RANK rank_long +#define PTRDIFF_T_RANK rank_long + +#define EMIT(x) ({ if (o<n){*q++ = (x);} o++; }) + +static size_t +format_int(char *q, size_t n, uintmax_t val, enum flags flags, + int base, int width, int prec) +{ + char *qq; + size_t o = 0, oo; + static const char lcdigits[] = "0123456789abcdef"; + static const char ucdigits[] = "0123456789ABCDEF"; + const char *digits; + uintmax_t tmpval; + int minus = 0; + int ndigits = 0, nchars; + int tickskip, b4tick; + + /* Select type of digits */ + digits = (flags & FL_UPPER) ? ucdigits : lcdigits; + + /* If signed, separate out the minus */ + if (flags & FL_SIGNED && (intmax_t) val < 0) { + minus = 1; + val = (uintmax_t) (-(intmax_t) val); + } + + /* Count the number of digits needed. This returns zero for 0. */ + tmpval = val; + while (tmpval) { + tmpval /= base; + ndigits++; + } + + /* Adjust ndigits for size of output */ + + if (flags & FL_HASH && base == 8) { + if (prec < ndigits + 1) + prec = ndigits + 1; + } + + if (ndigits < prec) { + ndigits = prec; /* Mandatory number padding */ + } else if (val == 0) { + ndigits = 1; /* Zero still requires space */ + } + + /* For ', figure out what the skip should be */ + if (flags & FL_TICK) { + tickskip = (base == 16) ? 4 : 3; + } else { + tickskip = ndigits; /* No tick marks */ + } + + /* Tick marks aren't digits, but generated by the number converter */ + ndigits += (ndigits - 1) / tickskip; + + /* Now compute the number of nondigits */ + nchars = ndigits; + + if (minus || (flags & (FL_PLUS | FL_SPACE))) + nchars++; /* Need space for sign */ + if ((flags & FL_HASH) && base == 16) { + nchars += 2; /* Add 0x for hex */ + } + + /* Emit early space padding */ + if (!(flags & (FL_MINUS | FL_ZERO)) && width > nchars) { + while (width > nchars) { + EMIT(' '); + width--; + } + } + + /* Emit nondigits */ + if (minus) + EMIT('-'); + else if (flags & FL_PLUS) + EMIT('+'); + else if (flags & FL_SPACE) + EMIT(' '); + + if ((flags & FL_HASH) && base == 16) { + EMIT('0'); + EMIT((flags & FL_UPPER) ? 'X' : 'x'); + } + + /* Emit zero padding */ + if ((flags & (FL_MINUS | FL_ZERO)) == FL_ZERO && width > ndigits) { + while (width > nchars) { + EMIT('0'); + width--; + } + } + + /* Generate the number. This is done from right to left. */ + q += ndigits; /* Advance the pointer to end of number */ + o += ndigits; + qq = q; + oo = o; /* Temporary values */ + + b4tick = tickskip; + while (ndigits > 0) { + if (!b4tick--) { + qq--; + oo--; + ndigits--; + if (oo < n) + *qq = '_'; + b4tick = tickskip - 1; + } + qq--; + oo--; + ndigits--; + if (oo < n) + *qq = digits[val % base]; + val /= base; + } + + /* Emit late space padding */ + while ((flags & FL_MINUS) && width > nchars) { + EMIT(' '); + width--; + } + + return o; +} + +int vsnprintf(char *buffer, size_t n, const char *format, va_list ap) +{ + const char *p = format; + char ch; + char *q = buffer; + size_t o = 0; /* Number of characters output */ + uintmax_t val = 0; + int rank = rank_int; /* Default rank */ + int width = 0; + int prec = -1; + int base; + size_t sz; + enum flags flags = 0; + enum { + st_normal, /* Ground state */ + st_flags, /* Special flags */ + st_width, /* Field width */ + st_prec, /* Field precision */ + st_modifiers /* Length or conversion modifiers */ + } state = st_normal; + const char *sarg; /* %s string argument */ + char carg; /* %c char argument */ + int slen; /* String length */ + + while ((ch = *p++)) { + switch (state) { + case st_normal: + if (ch == '%') { + state = st_flags; + flags = 0; + rank = rank_int; + width = 0; + prec = -1; + } else { + EMIT(ch); + } + break; + + case st_flags: + switch (ch) { + case '-': + flags |= FL_MINUS; + break; + case '+': + flags |= FL_PLUS; + break; + case '\'': + flags |= FL_TICK; + break; + case ' ': + flags |= FL_SPACE; + break; + case '#': + flags |= FL_HASH; + break; + case '0': + flags |= FL_ZERO; + break; + default: + state = st_width; + p--; /* Process this character again */ + break; + } + break; + + case st_width: + if (ch >= '0' && ch <= '9') { + width = width * 10 + (ch - '0'); + } else if (ch == '*') { + width = va_arg(ap, int); + if (width < 0) { + width = -width; + flags |= FL_MINUS; + } + } else if (ch == '.') { + prec = 0; /* Precision given */ + state = st_prec; + } else { + state = st_modifiers; + p--; /* Process this character again */ + } + break; + + case st_prec: + if (ch >= '0' && ch <= '9') { + prec = prec * 10 + (ch - '0'); + } else if (ch == '*') { + prec = va_arg(ap, int); + if (prec < 0) + prec = -1; + } else { + state = st_modifiers; + p--; /* Process this character again */ + } + break; + + case st_modifiers: + switch (ch) { + /* Length modifiers - nonterminal sequences */ + case 'h': + rank--; /* Shorter rank */ + break; + case 'l': + rank++; /* Longer rank */ + break; + case 'j': + rank = INTMAX_RANK; + break; + case 'z': + rank = SIZE_T_RANK; + break; + case 't': + rank = PTRDIFF_T_RANK; + break; + case 'L': + case 'q': + rank += 2; + break; + default: + /* Output modifiers - terminal sequences */ + + /* Next state will be normal */ + state = st_normal; + + /* Canonicalize rank */ + if (rank < MIN_RANK) + rank = MIN_RANK; + else if (rank > MAX_RANK) + rank = MAX_RANK; + + switch (ch) { + case 'P': /* Upper case pointer */ + flags |= FL_UPPER; + /* fall through */ + case 'p': /* Pointer */ + base = 16; + prec = (CHAR_BIT*sizeof(void *)+3)/4; + flags |= FL_HASH; + val = (uintmax_t)(uintptr_t) + va_arg(ap, void *); + goto is_integer; + + case 'd': /* Signed decimal output */ + case 'i': + base = 10; + flags |= FL_SIGNED; + switch (rank) { + case rank_char: + /* Yes, all these casts are + needed... */ + val = (uintmax_t)(intmax_t) + (signed char) + va_arg(ap, signed int); + break; + case rank_short: + val = (uintmax_t)(intmax_t) + (signed short) + va_arg(ap, signed int); + break; + case rank_int: + val = (uintmax_t)(intmax_t) + va_arg(ap, signed int); + break; + case rank_long: + val = (uintmax_t)(intmax_t) + va_arg(ap, signed long); + break; + case rank_longlong: + val = (uintmax_t)(intmax_t) + va_arg(ap, + signed long long); + break; + } + goto is_integer; + case 'o': /* Octal */ + base = 8; + goto is_unsigned; + case 'u': /* Unsigned decimal */ + base = 10; + goto is_unsigned; + case 'X': /* Upper case hexadecimal */ + flags |= FL_UPPER; + /* fall through */ + case 'x': /* Hexadecimal */ + base = 16; + goto is_unsigned; + + is_unsigned: + switch (rank) { + case rank_char: + val = (uintmax_t) + (unsigned char) + va_arg(ap, unsigned + int); + break; + case rank_short: + val = (uintmax_t) + (unsigned short) + va_arg(ap, unsigned + int); + break; + case rank_int: + val = (uintmax_t) + va_arg(ap, unsigned + int); + break; + case rank_long: + val = (uintmax_t) + va_arg(ap, unsigned + long); + break; + case rank_longlong: + val = (uintmax_t) + va_arg(ap, unsigned + long long); + break; + } + /* fall through */ + + is_integer: + sz = format_int(q, (o < n) ? n - o : 0, + val, flags, base, + width, prec); + q += sz; + o += sz; + break; + + case 'c': /* Character */ + carg = (char)va_arg(ap, int); + sarg = &carg; + slen = 1; + goto is_string; + case 's': /* String */ + sarg = va_arg(ap, const char *); + sarg = sarg ? sarg : "(null)"; + slen = strlen(sarg); + goto is_string; + + is_string: + { + char sch; + int i; + + if (prec != -1 && slen > prec) + slen = prec; + + if (width > slen + && !(flags & FL_MINUS)) { + char pad = + (flags & FL_ZERO) ? + '0' : ' '; + while (width > slen) { + EMIT(pad); + width--; + } + } + for (i = slen; i; i--) { + sch = *sarg++; + EMIT(sch); + } + if (width > slen + && (flags & FL_MINUS)) { + while (width > slen) { + EMIT(' '); + width--; + } + } + } + break; + + case 'n': + { + /* Output the number of + characters written */ + + switch (rank) { + case rank_char: + *va_arg(ap, + signed char *) + = o; + break; + case rank_short: + *va_arg(ap, + signed short *) + = o; + break; + case rank_int: + *va_arg(ap, + signed int *) + = o; + break; + case rank_long: + *va_arg(ap, + signed long *) + = o; + break; + case rank_longlong: + *va_arg(ap, + signed long long *) + = o; + break; + } + } + break; + + default: /* Anything else, including % */ + EMIT(ch); + break; + } + } + } + } + + /* Null-terminate the string */ + if (o < n) + *q = '\0'; /* No overflow */ + else if (n > 0) + buffer[n - 1] = '\0'; /* Overflow - terminate at end of buffer */ + + return o; +} diff --git a/i386/modules/klibc/.svn/text-base/vsscanf.c.svn-base b/i386/modules/klibc/.svn/text-base/vsscanf.c.svn-base new file mode 100644 index 0000000..f4fe33e --- /dev/null +++ b/i386/modules/klibc/.svn/text-base/vsscanf.c.svn-base @@ -0,0 +1,398 @@ +/* + * vsscanf.c + * + * vsscanf(), from which the rest of the scanf() + * family is built + */ + +//#include "libsaio.h" +//Azi: "UCHAR_MAX" & "UINT_MAX" redefined error - limits.h is also present in i386/include. +#include "libsa.h" +#include "limits.h" + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +#ifndef LONG_BIT +#define LONG_BIT (CHAR_BIT*sizeof(long)) +#endif + +enum flags { + FL_SPLAT = 0x01, /* Drop the value, do not assign */ + FL_INV = 0x02, /* Character-set with inverse */ + FL_WIDTH = 0x04, /* Field width specified */ + FL_MINUS = 0x08, /* Negative number */ +}; + +enum ranks { + rank_char = -2, + rank_short = -1, + rank_int = 0, + rank_long = 1, + rank_longlong = 2, + rank_ptr = INT_MAX /* Special value used for pointers */ +}; + +#define MIN_RANK rank_char +#define MAX_RANK rank_longlong + +#define INTMAX_RANK rank_longlong +#define SIZE_T_RANK rank_long +#define PTRDIFF_T_RANK rank_long + +enum bail { + bail_none = 0, /* No error condition */ + bail_eof, /* Hit EOF */ + bail_err /* Conversion mismatch */ +}; + +static inline const char *skipspace(const char *p) +{ + while (isspace((unsigned char)*p)) + p++; + return p; +} + +#undef set_bit +static inline void set_bit(unsigned long *bitmap, unsigned int bit) +{ + bitmap[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT); +} + +#undef test_bit +static inline int test_bit(unsigned long *bitmap, unsigned int bit) +{ + return (int)(bitmap[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1; +} + +int vsscanf(const char *buffer, const char *format, va_list ap) +{ + const char *p = format; + char ch; + unsigned char uc; + const char *q = buffer; + const char *qq; + uintmax_t val = 0; + int rank = rank_int; /* Default rank */ + unsigned int width = UINT_MAX; + int base; + enum flags flags = 0; + enum { + st_normal, /* Ground state */ + st_flags, /* Special flags */ + st_width, /* Field width */ + st_modifiers, /* Length or conversion modifiers */ + st_match_init, /* Initial state of %[ sequence */ + st_match, /* Main state of %[ sequence */ + st_match_range, /* After - in a %[ sequence */ + } state = st_normal; + char *sarg = NULL; /* %s %c or %[ string argument */ + enum bail bail = bail_none; + int sign; + int converted = 0; /* Successful conversions */ + unsigned long matchmap[((1 << CHAR_BIT) + (LONG_BIT - 1)) / LONG_BIT]; + int matchinv = 0; /* Is match map inverted? */ + unsigned char range_start = 0; + + while ((ch = *p++) && !bail) { + switch (state) { + case st_normal: + if (ch == '%') { + state = st_flags; + flags = 0; + rank = rank_int; + width = UINT_MAX; + } else if (isspace((unsigned char)ch)) { + q = skipspace(q); + } else { + if (*q == ch) + q++; + else + bail = bail_err; /* Match failure */ + } + break; + + case st_flags: + switch (ch) { + case '*': + flags |= FL_SPLAT; + break; + case '0'...'9': + width = (ch - '0'); + state = st_width; + flags |= FL_WIDTH; + break; + default: + state = st_modifiers; + p--; /* Process this character again */ + break; + } + break; + + case st_width: + if (ch >= '0' && ch <= '9') { + width = width * 10 + (ch - '0'); + } else { + state = st_modifiers; + p--; /* Process this character again */ + } + break; + + case st_modifiers: + switch (ch) { + /* Length modifiers - nonterminal sequences */ + case 'h': + rank--; /* Shorter rank */ + break; + case 'l': + rank++; /* Longer rank */ + break; + case 'j': + rank = INTMAX_RANK; + break; + case 'z': + rank = SIZE_T_RANK; + break; + case 't': + rank = PTRDIFF_T_RANK; + break; + case 'L': + case 'q': + rank = rank_longlong; /* long double/long long */ + break; + + default: + /* Output modifiers - terminal sequences */ + /* Next state will be normal */ + state = st_normal; + + /* Canonicalize rank */ + if (rank < MIN_RANK) + rank = MIN_RANK; + else if (rank > MAX_RANK) + rank = MAX_RANK; + + switch (ch) { + case 'P': /* Upper case pointer */ + case 'p': /* Pointer */ + rank = rank_ptr; + base = 0; + sign = 0; + goto scan_int; + + case 'i': /* Base-independent integer */ + base = 0; + sign = 1; + goto scan_int; + + case 'd': /* Decimal integer */ + base = 10; + sign = 1; + goto scan_int; + + case 'o': /* Octal integer */ + base = 8; + sign = 0; + goto scan_int; + + case 'u': /* Unsigned decimal integer */ + base = 10; + sign = 0; + goto scan_int; + + case 'x': /* Hexadecimal integer */ + case 'X': + base = 16; + sign = 0; + goto scan_int; + + case 'n': /* # of characters consumed */ + val = (q - buffer); + goto set_integer; + + scan_int: + q = skipspace(q); + if (!*q) { + bail = bail_eof; + break; + } + val = + strntoumax(q, (char **)&qq, base, + width); + if (qq == q) { + bail = bail_err; + break; + } + q = qq; + if (!(flags & FL_SPLAT)) + converted++; + /* fall through */ + + set_integer: + if (!(flags & FL_SPLAT)) { + switch (rank) { + case rank_char: + *va_arg(ap, + unsigned char *) + = val; + break; + case rank_short: + *va_arg(ap, + unsigned short + *) = val; + break; + case rank_int: + *va_arg(ap, + unsigned int *) + = val; + break; + case rank_long: + *va_arg(ap, + unsigned long *) + = val; + break; + case rank_longlong: + *va_arg(ap, + unsigned long + long *) = val; + break; + case rank_ptr: + *va_arg(ap, void **) = + (void *) + (uintptr_t)val; + break; + } + } + break; + + case 'c': /* Character */ + /* Default width == 1 */ + width = (flags & FL_WIDTH) ? width : 1; + if (flags & FL_SPLAT) { + while (width--) { + if (!*q) { + bail = bail_eof; + break; + } + } + } else { + sarg = va_arg(ap, char *); + while (width--) { + if (!*q) { + bail = bail_eof; + break; + } + *sarg++ = *q++; + } + if (!bail) + converted++; + } + break; + + case 's': /* String */ + uc = 1; /* Anything nonzero */ + if (flags & FL_SPLAT) { + while (width-- && (uc = *q) && + !isspace(uc)) { + q++; + } + } else { + char *sp; + sp = sarg = va_arg(ap, char *); + while (width-- && (uc = *q) && + !isspace(uc)) { + *sp++ = uc; + q++; + } + if (sarg != sp) { + /* Terminate output */ + *sp = '\0'; + converted++; + } + } + if (!uc) + bail = bail_eof; + break; + + case '[': /* Character range */ + sarg = (flags & FL_SPLAT) ? NULL + : va_arg(ap, char *); + state = st_match_init; + matchinv = 0; + memset(matchmap, 0, sizeof matchmap); + break; + + case '%': /* %% sequence */ + if (*q == '%') + q++; + else + bail = bail_err; + break; + + default: /* Anything else */ + /* Unknown sequence */ + bail = bail_err; + break; + } + } + break; + + case st_match_init: /* Initial state for %[ match */ + if (ch == '^' && !(flags & FL_INV)) { + matchinv = 1; + } else { + set_bit(matchmap, (unsigned char)ch); + state = st_match; + } + break; + + case st_match: /* Main state for %[ match */ + if (ch == ']') { + goto match_run; + } else if (ch == '-') { + range_start = (unsigned char)ch; + state = st_match_range; + } else { + set_bit(matchmap, (unsigned char)ch); + } + break; + + case st_match_range: /* %[ match after - */ + if (ch == ']') { + /* - was last character */ + set_bit(matchmap, (unsigned char)'-'); + goto match_run; + } else { + int i; + for (i = range_start; i < (unsigned char)ch; + i++) + set_bit(matchmap, i); + state = st_match; + } + break; + + match_run: /* Match expression finished */ + qq = q; + uc = 1; /* Anything nonzero */ + while (width && (uc = *q) + && test_bit(matchmap, uc)^matchinv) { + if (sarg) + *sarg++ = uc; + q++; + } + if (q != qq && sarg) { + *sarg = '\0'; + converted++; + } else { + bail = bail_err; + } + if (!uc) + bail = bail_eof; + break; + } + } + + if (bail == bail_eof && !converted) + converted = -1; /* Return EOF (-1) */ + + return converted; +} diff --git a/i386/modules/klibc/Cconfig b/i386/modules/klibc/Cconfig new file mode 100644 index 0000000..d1e30f7 --- /dev/null +++ b/i386/modules/klibc/Cconfig @@ -0,0 +1,10 @@ +# +# Chameleon Modules +# + +config KLIBC_MODULE + tristate "klibc Module" + default m + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/klibc/LICENSE b/i386/modules/klibc/LICENSE new file mode 100644 index 0000000..aa6d7a7 --- /dev/null +++ b/i386/modules/klibc/LICENSE @@ -0,0 +1,73 @@ +This license applies to all files in directory and its subdirectories, +unless otherwise noted in individual files. + + +Some files are derived from files derived from the include/ directory +of the Linux kernel, and are licensed under the terms of the GNU +General Public License, version 2, as released by the Free Software +Foundation, Inc.; incorporated herein by reference. + + ----- + +Some files are derived from files copyrighted by the Regents of The +University of California, and are available under the following +license: + +Note: The advertising clause in the license appearing on BSD Unix +files was officially rescinded by the Director of the Office of +Technology Licensing of the University of California on July 22 +1999. He states that clause 3 is "hereby deleted in its entirety." + + * Copyright (c) + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + + ----- + +For all remaining files, the following license applies: + + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * Any copyright notice(s) and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/i386/modules/klibc/Makefile b/i386/modules/klibc/Makefile new file mode 100644 index 0000000..795a110 --- /dev/null +++ b/i386/modules/klibc/Makefile @@ -0,0 +1,26 @@ +MODULE_NAME = klibc +MODULE_DESCRIPTION = This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. This is currently only used by the uClibc++ library. +MODULE_AUTHOR = +MODULE_VERSION = "1.5.20" +MODULE_COMPAT_VERSION = "1.5.20" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = + +DIR = klibc + +MODULE_OBJS = klibc.o \ + __ashldi3.o __ashrdi3.o __clzsi2.o __divdi3.o __divsi3.o \ + __lshrdi3.o __moddi3.o __modsi3.o __udivdi3.o \ + __udivmoddi4.o __udivmodsi4.o __udivsi3.o \ + __umoddi3.o __umodsi3.o \ + strntoumax.o strntoimax.o atol.o atoll.o \ + strcasecmp.o strncasecmp.o strlcat.o strndup.o strnlen.o \ + strsep.o strtoimax.o strtok_r.o strtok.o strtol.o strtoll.o strtotimespec.o strtotimeval.o \ + strtoul.o strtoull.o strtoumax.o strxspn.o strpbrk.o \ + bsearch.o calloc.o \ + jrand48.o lrand48.o mrand48.o srand48.o nrand48.o seed48.o \ + memccpy.o memchr.o memmem.o memmove.o memrchr.o memswap.o \ + qsort.o sha1hash.o onexit.o atexit.o exit.o \ + snprintf.o vsnprintf.o sscanf.o vsscanf.o\ + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/klibc/Readme.txt b/i386/modules/klibc/Readme.txt new file mode 100644 index 0000000..772fd7e --- /dev/null +++ b/i386/modules/klibc/Readme.txt @@ -0,0 +1,4 @@ +Module: klibc +Source: http://www.kernel.org/pub/linux/libs/klibc/ +Description: This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. This is currently only used by the uClibc++ library. +Dependencies: none diff --git a/i386/modules/klibc/__ashldi3.c b/i386/modules/klibc/__ashldi3.c new file mode 100644 index 0000000..95937f0 --- /dev/null +++ b/i386/modules/klibc/__ashldi3.c @@ -0,0 +1,23 @@ +/* + * libgcc/__ashldi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +uint64_t __ashldi3(uint64_t v, int cnt) +{ + int c = cnt & 31; + uint32_t vl = (uint32_t) v; + uint32_t vh = (uint32_t) (v >> 32); + + if (cnt & 32) { + vh = (vl << c); + vl = 0; + } else { + vh = (vh << c) + (vl >> (32 - c)); + vl = (vl << c); + } + + return ((uint64_t) vh << 32) + vl; +} diff --git a/i386/modules/klibc/__ashrdi3.c b/i386/modules/klibc/__ashrdi3.c new file mode 100644 index 0000000..14e6d18 --- /dev/null +++ b/i386/modules/klibc/__ashrdi3.c @@ -0,0 +1,23 @@ +/* + * libgcc/__ashrdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +uint64_t __ashrdi3(uint64_t v, int cnt) +{ + int c = cnt & 31; + uint32_t vl = (uint32_t) v; + uint32_t vh = (uint32_t) (v >> 32); + + if (cnt & 32) { + vl = ((int32_t) vh >> c); + vh = (int32_t) vh >> 31; + } else { + vl = (vl >> c) + (vh << (32 - c)); + vh = ((int32_t) vh >> c); + } + + return ((uint64_t) vh << 32) + vl; +} diff --git a/i386/modules/klibc/__clzsi2.c b/i386/modules/klibc/__clzsi2.c new file mode 100644 index 0000000..ebb11f0 --- /dev/null +++ b/i386/modules/klibc/__clzsi2.c @@ -0,0 +1,36 @@ +/* + * libgcc/__clzsi2.c + * + * Returns the leading number of 0 bits in the argument + */ + +#include <stdint.h> +#include <stddef.h> + +uint32_t __clzsi2(uint32_t v) +{ + int p = 31; + + if (v & 0xffff0000) { + p -= 16; + v >>= 16; + } + if (v & 0xff00) { + p -= 8; + v >>= 8; + } + if (v & 0xf0) { + p -= 4; + v >>= 4; + } + if (v & 0xc) { + p -= 2; + v >>= 2; + } + if (v & 0x2) { + p -= 1; + v >>= 1; + } + + return p; +} diff --git a/i386/modules/klibc/__divdi3.c b/i386/modules/klibc/__divdi3.c new file mode 100644 index 0000000..973fe63 --- /dev/null +++ b/i386/modules/klibc/__divdi3.c @@ -0,0 +1,29 @@ +/* + * arch/i386/libgcc/__divdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +int64_t __divdi3(int64_t num, int64_t den) +{ + int minus = 0; + int64_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + v = __udivmoddi4(num, den, NULL); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/__divsi3.c b/i386/modules/klibc/__divsi3.c new file mode 100644 index 0000000..35420f5 --- /dev/null +++ b/i386/modules/klibc/__divsi3.c @@ -0,0 +1,29 @@ +/* + * libgcc/__divsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +int32_t __divsi3(int32_t num, int32_t den) +{ + int minus = 0; + int32_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + v = __udivmodsi4(num, den, NULL); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/__lshrdi3.c b/i386/modules/klibc/__lshrdi3.c new file mode 100644 index 0000000..765e1f2 --- /dev/null +++ b/i386/modules/klibc/__lshrdi3.c @@ -0,0 +1,23 @@ +/* + * libgcc/__lshrdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +uint64_t __lshrdi3(uint64_t v, int cnt) +{ + int c = cnt & 31; + uint32_t vl = (uint32_t) v; + uint32_t vh = (uint32_t) (v >> 32); + + if (cnt & 32) { + vl = (vh >> c); + vh = 0; + } else { + vl = (vl >> c) + (vh << (32 - c)); + vh = (vh >> c); + } + + return ((uint64_t) vh << 32) + vl; +} diff --git a/i386/modules/klibc/__moddi3.c b/i386/modules/klibc/__moddi3.c new file mode 100644 index 0000000..0e7ed98 --- /dev/null +++ b/i386/modules/klibc/__moddi3.c @@ -0,0 +1,29 @@ +/* + * arch/i386/libgcc/__moddi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +int64_t __moddi3(int64_t num, int64_t den) +{ + int minus = 0; + int64_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + (void)__udivmoddi4(num, den, (uint64_t *) & v); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/__modsi3.c b/i386/modules/klibc/__modsi3.c new file mode 100644 index 0000000..33a21ba --- /dev/null +++ b/i386/modules/klibc/__modsi3.c @@ -0,0 +1,29 @@ +/* + * libgcc/__modsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +int32_t __modsi3(int32_t num, int32_t den) +{ + int minus = 0; + int32_t v; + + if (num < 0) { + num = -num; + minus = 1; + } + if (den < 0) { + den = -den; + minus ^= 1; + } + + (void)__udivmodsi4(num, den, (uint32_t *) & v); + if (minus) + v = -v; + + return v; +} diff --git a/i386/modules/klibc/__udivdi3.c b/i386/modules/klibc/__udivdi3.c new file mode 100644 index 0000000..5eea461 --- /dev/null +++ b/i386/modules/klibc/__udivdi3.c @@ -0,0 +1,13 @@ +/* + * arch/i386/libgcc/__divdi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +uint64_t __udivdi3(uint64_t num, uint64_t den) +{ + return __udivmoddi4(num, den, NULL); +} diff --git a/i386/modules/klibc/__udivmoddi4.c b/i386/modules/klibc/__udivmoddi4.c new file mode 100644 index 0000000..eaec9c8 --- /dev/null +++ b/i386/modules/klibc/__udivmoddi4.c @@ -0,0 +1,33 @@ +#include "libsaio.h" + +extern void __divide_error(); + +uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem_p) +{ + uint64_t quot = 0, qbit = 1; + + if (den == 0) { + __divide_error(); + return 0; /* If trap returns... */ + } + + /* Left-justify denominator and count shift */ + while ((int64_t) den >= 0) { + den <<= 1; + qbit <<= 1; + } + + while (qbit) { + if (den <= num) { + num -= den; + quot += qbit; + } + den >>= 1; + qbit >>= 1; + } + + if (rem_p) + *rem_p = num; + + return quot; +} diff --git a/i386/modules/klibc/__udivmodsi4.c b/i386/modules/klibc/__udivmodsi4.c new file mode 100644 index 0000000..11d4b23 --- /dev/null +++ b/i386/modules/klibc/__udivmodsi4.c @@ -0,0 +1,31 @@ +#include "libsaio.h" +extern void __divide_error(); +uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem_p) +{ + uint32_t quot = 0, qbit = 1; + + if (den == 0) { + __divide_error(); + return 0; /* If trap returns... */ + } + + /* Left-justify denominator and count shift */ + while ((int32_t) den >= 0) { + den <<= 1; + qbit <<= 1; + } + + while (qbit) { + if (den <= num) { + num -= den; + quot += qbit; + } + den >>= 1; + qbit >>= 1; + } + + if (rem_p) + *rem_p = num; + + return quot; +} diff --git a/i386/modules/klibc/__udivsi3.c b/i386/modules/klibc/__udivsi3.c new file mode 100644 index 0000000..5635f3f --- /dev/null +++ b/i386/modules/klibc/__udivsi3.c @@ -0,0 +1,13 @@ +/* + * libgcc/__divsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +uint32_t __udivsi3(uint32_t num, uint32_t den) +{ + return __udivmodsi4(num, den, NULL); +} diff --git a/i386/modules/klibc/__umoddi3.c b/i386/modules/klibc/__umoddi3.c new file mode 100644 index 0000000..1fc754a --- /dev/null +++ b/i386/modules/klibc/__umoddi3.c @@ -0,0 +1,16 @@ +/* + * arch/i386/libgcc/__umoddi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t * rem); + +uint64_t __umoddi3(uint64_t num, uint64_t den) +{ + uint64_t v; + + (void)__udivmoddi4(num, den, &v); + return v; +} diff --git a/i386/modules/klibc/__umodsi3.c b/i386/modules/klibc/__umodsi3.c new file mode 100644 index 0000000..85e6e3c --- /dev/null +++ b/i386/modules/klibc/__umodsi3.c @@ -0,0 +1,16 @@ +/* + * libgcc/__umodsi3.c + */ + +#include <stdint.h> +#include <stddef.h> + +extern uint32_t __udivmodsi4(uint32_t num, uint32_t den, uint32_t * rem); + +uint32_t __umodsi3(uint32_t num, uint32_t den) +{ + uint32_t v; + + (void)__udivmodsi4(num, den, &v); + return v; +} diff --git a/i386/modules/klibc/atexit.c b/i386/modules/klibc/atexit.c new file mode 100644 index 0000000..cdb3416 --- /dev/null +++ b/i386/modules/klibc/atexit.c @@ -0,0 +1,16 @@ +/* + * atexit.c + */ + +#include <stdlib.h> + +int atexit(void (*fctn) (void)) +{ + return 0; +} + +int __cxa_atexit(void (*fctn) (void)) +{ + return 0; + //return on_exit((void (*)(int, void *))fctn, NULL); +} diff --git a/i386/modules/klibc/atexit.h b/i386/modules/klibc/atexit.h new file mode 100644 index 0000000..5018689 --- /dev/null +++ b/i386/modules/klibc/atexit.h @@ -0,0 +1,18 @@ +/* + * atexit.h + * + * atexit()/on_exit() internal definitions + */ + +#ifndef ATEXIT_H +#define ATEXIT_H + +struct atexit { + void (*fctn) (int, void *); + void *arg; /* on_exit() parameter */ + struct atexit *next; +}; + +extern struct atexit *__atexit_list; + +#endif /* ATEXIT_H */ diff --git a/i386/modules/klibc/atoi.c b/i386/modules/klibc/atoi.c new file mode 100644 index 0000000..a6ec0bf --- /dev/null +++ b/i386/modules/klibc/atoi.c @@ -0,0 +1,3 @@ +#define TYPE int +#define NAME atoi +#include "atox.c" diff --git a/i386/modules/klibc/atol.c b/i386/modules/klibc/atol.c new file mode 100644 index 0000000..e65484e --- /dev/null +++ b/i386/modules/klibc/atol.c @@ -0,0 +1,3 @@ +#define TYPE long +#define NAME atol +#include "atox.c" diff --git a/i386/modules/klibc/atoll.c b/i386/modules/klibc/atoll.c new file mode 100644 index 0000000..25df79e --- /dev/null +++ b/i386/modules/klibc/atoll.c @@ -0,0 +1,3 @@ +#define TYPE long long +#define NAME atoll +#include "atox.c" diff --git a/i386/modules/klibc/atox.c b/i386/modules/klibc/atox.c new file mode 100644 index 0000000..f6f8514 --- /dev/null +++ b/i386/modules/klibc/atox.c @@ -0,0 +1,16 @@ +/* + * atox.c + * + * atoi(), atol(), atoll() + */ + +#include <inttypes.h> +#include <stdlib.h> +#include <stdio.h> + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +TYPE NAME(const char *nptr) +{ + return (TYPE) strntoumax(nptr, (char **)NULL, 10, ~(size_t) 0); +} diff --git a/i386/modules/klibc/bsearch.c b/i386/modules/klibc/bsearch.c new file mode 100644 index 0000000..1c8b07f --- /dev/null +++ b/i386/modules/klibc/bsearch.c @@ -0,0 +1,26 @@ +/* + * bsearch.c + */ + +#include <stdlib.h> + +void *bsearch(const void *key, const void *base, size_t nmemb, + size_t size, int (*cmp) (const void *, const void *)) +{ + while (nmemb) { + size_t mididx = nmemb / 2; + const void *midobj = base + mididx * size; + int diff = cmp(key, midobj); + + if (diff == 0) + return (void *)midobj; + + if (diff > 0) { + base = midobj + size; + nmemb -= mididx + 1; + } else + nmemb = mididx; + } + + return NULL; +} diff --git a/i386/modules/klibc/calloc.c b/i386/modules/klibc/calloc.c new file mode 100644 index 0000000..608feb3 --- /dev/null +++ b/i386/modules/klibc/calloc.c @@ -0,0 +1,18 @@ +/* + * calloc.c + */ + +#include "libsaio.h" +/* FIXME: This should look for multiplication overflow */ + +void *calloc(size_t nmemb, size_t size) +{ + void *ptr; + + size *= nmemb; + ptr = malloc(size); + if (ptr) + memset(ptr, 0, size); + + return ptr; +} diff --git a/i386/modules/klibc/exit.c b/i386/modules/klibc/exit.c new file mode 100644 index 0000000..0898f04 --- /dev/null +++ b/i386/modules/klibc/exit.c @@ -0,0 +1,30 @@ +/* + * exit.c + * + * exit(), including the handling of the atexit chain. + */ + +#include <stdlib.h> +#include <unistd.h> +#include <sys/syscall.h> +#include "atexit.h" + +/* Link chain for atexit/on_exit */ +struct atexit *__atexit_list; + +void exit(int rv) +{ + struct atexit *ap; + + for (ap = __atexit_list; ap; ap = ap->next) { + /* This assumes extra args are harmless. They should + be in all normal C ABIs, but if an architecture has + some particularly bizarre ABI this might be worth + watching out for. */ + ap->fctn(rv, ap->arg); + } + + /* Handle any library destructors if we ever start using them... */ + + _exit(rv); +} diff --git a/i386/modules/klibc/jrand48.c b/i386/modules/klibc/jrand48.c new file mode 100644 index 0000000..8e2b3ac --- /dev/null +++ b/i386/modules/klibc/jrand48.c @@ -0,0 +1,24 @@ +/* + * jrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +long jrand48(unsigned short xsubi[3]) +{ + uint64_t x; + + /* The xsubi[] array is littleendian by spec */ + x = (uint64_t) (uint16_t) xsubi[0] + + ((uint64_t) (uint16_t) xsubi[1] << 16) + + ((uint64_t) (uint16_t) xsubi[2] << 32); + + x = (0x5deece66dULL * x) + 0xb; + + xsubi[0] = (unsigned short)(uint16_t) x; + xsubi[1] = (unsigned short)(uint16_t) (x >> 16); + xsubi[2] = (unsigned short)(uint16_t) (x >> 32); + + return (long)(int32_t) (x >> 16); +} diff --git a/i386/modules/klibc/klibc.c b/i386/modules/klibc/klibc.c new file mode 100644 index 0000000..0545414 --- /dev/null +++ b/i386/modules/klibc/klibc.c @@ -0,0 +1,38 @@ +/* + * klibc.c + * + * glue + initialization + */ + +#include "libsaio.h" + +int _DefaultRuneLocale; // todo: fixme + +void klibc_start() +{ +} + +void _exit(int status) +{ + stop("exit() called\n"); + while(1) halt(); // this is never reached +} + +char __toupper(char c) +{ + return ((c) & ~32); +} + +void __divide_error() +{ + stop("Divide by 0\n"); +} + +// hack +int +__maskrune(int _c, unsigned long _f) +{ + return 0; + //return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) : + // _CurrentRuneLocale->__runetype[_c]) & _f; +} diff --git a/i386/modules/klibc/limits.h b/i386/modules/klibc/limits.h new file mode 100644 index 0000000..92b9bb9 --- /dev/null +++ b/i386/modules/klibc/limits.h @@ -0,0 +1,6 @@ + +#define CHAR_BIT 8 + +#define UCHAR_MAX 255u +#define INT_MAX 2147483647 +#define UINT_MAX 4294967295u \ No newline at end of file diff --git a/i386/modules/klibc/lrand48.c b/i386/modules/klibc/lrand48.c new file mode 100644 index 0000000..a2fc87a --- /dev/null +++ b/i386/modules/klibc/lrand48.c @@ -0,0 +1,13 @@ +/* + * lrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +extern unsigned short __rand48_seed[3]; /* Common with mrand48.c, srand48.c */ + +long lrand48(void) +{ + return (uint32_t) jrand48(__rand48_seed) >> 1; +} diff --git a/i386/modules/klibc/memccpy.c b/i386/modules/klibc/memccpy.c new file mode 100644 index 0000000..83d02c9 --- /dev/null +++ b/i386/modules/klibc/memccpy.c @@ -0,0 +1,23 @@ +/* + * memccpy.c + * + * memccpy() + */ + +#include <stddef.h> +#include <string.h> + +void *memccpy(void *dst, const void *src, int c, size_t n) +{ + char *q = dst; + const char *p = src; + char ch; + + while (n--) { + *q++ = ch = *p++; + if (ch == (char)c) + return q; + } + + return NULL; /* No instance of "c" found */ +} diff --git a/i386/modules/klibc/memchr.c b/i386/modules/klibc/memchr.c new file mode 100644 index 0000000..f1947fb --- /dev/null +++ b/i386/modules/klibc/memchr.c @@ -0,0 +1,19 @@ +/* + * memchr.c + */ + +#include <stddef.h> +#include <string.h> + +void *memchr(const void *s, int c, size_t n) +{ + const unsigned char *sp = s; + + while (n--) { + if (*sp == (unsigned char)c) + return (void *)sp; + sp++; + } + + return NULL; +} diff --git a/i386/modules/klibc/memmem.c b/i386/modules/klibc/memmem.c new file mode 100644 index 0000000..8b5faa0 --- /dev/null +++ b/i386/modules/klibc/memmem.c @@ -0,0 +1,52 @@ +/* + * memmem.c + * + * Find a byte string inside a longer byte string + * + * This uses the "Not So Naive" algorithm, a very simple but + * usually effective algorithm, see: + * + * http://www-igm.univ-mlv.fr/~lecroq/string/ + */ + +#include <string.h> + +void *memmem(const void *haystack, size_t n, const void *needle, size_t m) +{ + const unsigned char *y = (const unsigned char *)haystack; + const unsigned char *x = (const unsigned char *)needle; + + size_t j, k, l; + + if (m > n || !m || !n) + return NULL; + + if (1 != m) { + if (x[0] == x[1]) { + k = 2; + l = 1; + } else { + k = 1; + l = 2; + } + + j = 0; + while (j <= n - m) { + if (x[1] != y[j + 1]) { + j += k; + } else { + if (!memcmp(x + 2, y + j + 2, m - 2) + && x[0] == y[j]) + return (void *)&y[j]; + j += l; + } + } + } else + do { + if (*y == *x) + return (void *)y; + y++; + } while (--n); + + return NULL; +} diff --git a/i386/modules/klibc/memmove.c b/i386/modules/klibc/memmove.c new file mode 100644 index 0000000..d8a4226 --- /dev/null +++ b/i386/modules/klibc/memmove.c @@ -0,0 +1,36 @@ +/* + * memmove.c + */ + +#include "libsaio.h" + +void *memmove(void *dst, const void *src, size_t n) +{ + const char *p = src; + char *q = dst; +#if defined(__i386__) || defined(__x86_64__) + if (q < p) { + asm volatile("cld; rep; movsb" + : "+c" (n), "+S"(p), "+D"(q)); + } else { + p += (n - 1); + q += (n - 1); + asm volatile("std; rep; movsb; cld" + : "+c" (n), "+S"(p), "+D"(q)); + } +#else + if (q < p) { + while (n--) { + *q++ = *p++; + } + } else { + p += n; + q += n; + while (n--) { + *--q = *--p; + } + } +#endif + + return dst; +} diff --git a/i386/modules/klibc/memrchr.c b/i386/modules/klibc/memrchr.c new file mode 100644 index 0000000..ff6d711 --- /dev/null +++ b/i386/modules/klibc/memrchr.c @@ -0,0 +1,19 @@ +/* + * memrchr.c + */ + +#include <stddef.h> +#include <string.h> + +void *memrchr(const void *s, int c, size_t n) +{ + const unsigned char *sp = (const unsigned char *)s + n - 1; + + while (n--) { + if (*sp == (unsigned char)c) + return (void *)sp; + sp--; + } + + return NULL; +} diff --git a/i386/modules/klibc/memswap.c b/i386/modules/klibc/memswap.c new file mode 100644 index 0000000..b32315c --- /dev/null +++ b/i386/modules/klibc/memswap.c @@ -0,0 +1,24 @@ +/* + * memswap() + * + * Swaps the contents of two nonoverlapping memory areas. + * This really could be done faster... + */ + +#include <string.h> + +void memswap(void *m1, void *m2, size_t n) +{ + char *p = m1; + char *q = m2; + char tmp; + + while (n--) { + tmp = *p; + *p = *q; + *q = tmp; + + p++; + q++; + } +} diff --git a/i386/modules/klibc/mrand48.c b/i386/modules/klibc/mrand48.c new file mode 100644 index 0000000..1a2383b --- /dev/null +++ b/i386/modules/klibc/mrand48.c @@ -0,0 +1,13 @@ +/* + * mrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +extern unsigned short __rand48_seed[3]; /* Common with lrand48.c, srand48.c */ + +long mrand48(void) +{ + return jrand48(__rand48_seed); +} diff --git a/i386/modules/klibc/nrand48.c b/i386/modules/klibc/nrand48.c new file mode 100644 index 0000000..cb3532b --- /dev/null +++ b/i386/modules/klibc/nrand48.c @@ -0,0 +1,11 @@ +/* + * nrand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +long nrand48(unsigned short xsubi[3]) +{ + return (long)((uint32_t) jrand48(xsubi) >> 1); +} diff --git a/i386/modules/klibc/onexit.c b/i386/modules/klibc/onexit.c new file mode 100644 index 0000000..8f846bf --- /dev/null +++ b/i386/modules/klibc/onexit.c @@ -0,0 +1,22 @@ +/* + * onexit.c + */ + +#include "libsaio.h" +#include "atexit.h" + +int on_exit(void (*fctn) (int, void *), void *arg) +{ + struct atexit *as = malloc(sizeof(struct atexit)); + + if (!as) + return -1; + + as->fctn = fctn; + as->arg = arg; + + as->next = __atexit_list; + __atexit_list = as; + + return 0; +} diff --git a/i386/modules/klibc/qsort.c b/i386/modules/klibc/qsort.c new file mode 100644 index 0000000..66c2a17 --- /dev/null +++ b/i386/modules/klibc/qsort.c @@ -0,0 +1,48 @@ +/* + * qsort.c + * + * This is actually combsort. It's an O(n log n) algorithm with + * simplicity/small code size being its main virtue. + */ + +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +extern void memswap(void *m1, void *m2, size_t n); + +static inline size_t newgap(size_t gap) +{ + gap = (gap * 10) / 13; + if (gap == 9 || gap == 10) + gap = 11; + + if (gap < 1) + gap = 1; + return gap; +} + +void qsort(void *base, size_t nmemb, size_t size, + int (*compar) (const void *, const void *)) +{ + size_t gap = nmemb; + size_t i, j; + char *p1, *p2; + int swapped; + + if (!nmemb) + return; + + do { + gap = newgap(gap); + swapped = 0; + + for (i = 0, p1 = base; i < nmemb - gap; i++, p1 += size) { + j = i + gap; + if (compar(p1, p2 = (char *)base + j * size) > 0) { + memswap(p1, p2, size); + swapped = 1; + } + } + } while (gap > 1 || swapped); +} diff --git a/i386/modules/klibc/seed48.c b/i386/modules/klibc/seed48.c new file mode 100644 index 0000000..4ae5224 --- /dev/null +++ b/i386/modules/klibc/seed48.c @@ -0,0 +1,16 @@ +/* + * seed48.c + */ + +#include "libsaio.h" + +unsigned short __rand48_seed[3]; + +unsigned short *seed48(const unsigned short xsubi[3]) +{ + static unsigned short oldseed[3]; + memcpy(oldseed, __rand48_seed, sizeof __rand48_seed); + memcpy(__rand48_seed, xsubi, sizeof __rand48_seed); + + return oldseed; +} diff --git a/i386/modules/klibc/sha1hash.c b/i386/modules/klibc/sha1hash.c new file mode 100644 index 0000000..513bd69 --- /dev/null +++ b/i386/modules/klibc/sha1hash.c @@ -0,0 +1,319 @@ +/* +SHA-1 in C +By Steve Reid <sreid@sea-to-sky.net> +100% Public Domain + +----------------- +Modified 7/98 +By James H. Brown <jbrown@burgoyne.com> +Still 100% Public Domain + +Corrected a problem which generated improper hash values on 16 bit machines +Routine SHA1Update changed from + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int +len) +to + void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned +long len) + +The 'len' parameter was declared an int which works fine on 32 bit machines. +However, on 16 bit machines an int is too small for the shifts being done +against +it. This caused the hash function to generate incorrect values if len was +greater than 8191 (8K - 1) due to the 'len << 3' on line 3 of SHA1Update(). + +Since the file IO in main() reads 16K at a time, any file 8K or larger would +be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million +"a"s). + +I also changed the declaration of variables i & j in SHA1Update to +unsigned long from unsigned int for the same reason. + +These changes should make no difference to any 32 bit implementations since +an +int and a long are the same size in those environments. + +-- +I also corrected a few compiler warnings generated by Borland C. +1. Added #include <process.h> for exit() prototype +2. Removed unused variable 'j' in SHA1Final +3. Changed exit(0) to return(0) at end of main. + +ALL changes I made can be located by searching for comments containing 'JHB' +----------------- +Modified 8/98 +By Steve Reid <sreid@sea-to-sky.net> +Still 100% public domain + +1- Removed #include <process.h> and used return() instead of exit() +2- Fixed overwriting of finalcount in SHA1Final() (discovered by Chris Hall) +3- Changed email address from steve@edmweb.com to sreid@sea-to-sky.net + +----------------- +Modified 4/01 +By Saul Kravitz <Saul.Kravitz@celera.com> +Still 100% PD +Modified to run on Compaq Alpha hardware. + +----------------- +Modified 2/03 +By H. Peter Anvin <hpa@zytor.com> +Still 100% PD +Modified to run on any hardware with <inttypes.h> and <netinet/in.h> +Changed the driver program + +*/ + +/* +Test Vectors (from FIPS PUB 180-1) +"abc" + A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D +"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" + 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 +A million repetitions of "a" + 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F +*/ + +/* #define SHA1HANDSOFF */ + +#include <stdio.h> +#include <string.h> +#include <inttypes.h> +#include <netinet/in.h> /* For htonl/ntohl/htons/ntohs */ + +/* #include <process.h> */ /* prototype for exit() - JHB */ +/* Using return() instead of exit() - SWR */ + +typedef struct { + uint32_t state[5]; + uint32_t count[2]; + unsigned char buffer[64]; +} SHA1_CTX; + +void SHA1Transform(uint32_t state[5], unsigned char buffer[64]); +void SHA1Init(SHA1_CTX* context); +void SHA1Update(SHA1_CTX* context, unsigned char* data, uint32_t len); /* +JHB */ +void SHA1Final(unsigned char digest[20], SHA1_CTX* context); + +#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) + +/* blk0() and blk() perform the initial expand. */ +/* I got the idea of expanding during the round function from SSLeay */ +#define blk0(i) (block->l[i] = ntohl(block->l[i])) +#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ + ^block->l[(i+2)&15]^block->l[i&15],1)) + +/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ +#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); +#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); +#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); +#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); +#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); + + +#ifdef VERBOSE /* SAK */ +void SHAPrintContext(SHA1_CTX *context, char *msg){ + printf("%s (%d,%d) %x %x %x %x %x\n", + msg, + context->count[0], context->count[1], + context->state[0], + context->state[1], + context->state[2], + context->state[3], + context->state[4]); +} +#endif + +/* Hash a single 512-bit block. This is the core of the algorithm. */ + +void SHA1Transform(uint32_t state[5], unsigned char buffer[64]) +{ +uint32_t a, b, c, d, e; +typedef union { + unsigned char c[64]; + uint32_t l[16]; +} CHAR64LONG16; +CHAR64LONG16* block; +#ifdef SHA1HANDSOFF +static unsigned char workspace[64]; + block = (CHAR64LONG16*)workspace; + memcpy(block, buffer, 64); +#else + block = (CHAR64LONG16*)buffer; +#endif + /* Copy context->state[] to working vars */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + /* 4 rounds of 20 operations each. Loop unrolled. */ + R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); + R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); + R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); + R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); + R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); + R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); + R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); + R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); + R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); + R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); + R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); + R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); + R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); + R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); + R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); + R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); + R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); + R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); + R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); + R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); + /* Add the working vars back into context.state[] */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + /* Wipe variables */ + a = b = c = d = e = 0; +} + + +/* SHA1Init - Initialize new context */ + +void SHA1Init(SHA1_CTX* context) +{ + /* SHA1 initialization constants */ + context->state[0] = 0x67452301; + context->state[1] = 0xEFCDAB89; + context->state[2] = 0x98BADCFE; + context->state[3] = 0x10325476; + context->state[4] = 0xC3D2E1F0; + context->count[0] = context->count[1] = 0; +} + + +/* Run your data through this. */ + +void SHA1Update(SHA1_CTX* context, unsigned char* data, uint32_t len) /* +JHB */ +{ +uint32_t i, j; /* JHB */ + +#ifdef VERBOSE + SHAPrintContext(context, "before"); +#endif + j = (context->count[0] >> 3) & 63; + if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; + context->count[1] += (len >> 29); + if ((j + len) > 63) { + memcpy(&context->buffer[j], data, (i = 64-j)); + SHA1Transform(context->state, context->buffer); + for ( ; i + 63 < len; i += 64) { + SHA1Transform(context->state, &data[i]); + } + j = 0; + } + else i = 0; + memcpy(&context->buffer[j], &data[i], len - i); +#ifdef VERBOSE + SHAPrintContext(context, "after "); +#endif +} + + +/* Add padding and return the message digest. */ + +void SHA1Final(unsigned char digest[20], SHA1_CTX* context) +{ +uint32_t i; /* JHB */ +unsigned char finalcount[8]; + + for (i = 0; i < 8; i++) { + finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] + >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ + } + SHA1Update(context, (unsigned char *)"\200", 1); + while ((context->count[0] & 504) != 448) { + SHA1Update(context, (unsigned char *)"\0", 1); + } + SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() +*/ + for (i = 0; i < 20; i++) { + digest[i] = (unsigned char) + ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); + } + /* Wipe variables */ + i = 0; /* JHB */ + memset(context->buffer, 0, 64); + memset(context->state, 0, 20); + memset(context->count, 0, 8); + memset(finalcount, 0, 8); /* SWR */ +#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ + SHA1Transform(context->state, context->buffer); +#endif +} + +/*************************************************************/ + +/* This is not quite the MIME base64 algorithm: it uses _ instead of /, + and instead of padding the output with = characters we just make the + output shorter. */ +char *mybase64(uint8_t digest[20]) +{ + static const char charz[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + uint8_t input[21]; + static char output[28]; + int i, j; + uint8_t *p; + char *q; + uint32_t bv; + + memcpy(input, digest, 20); + input[20] = 0; /* Pad to multiple of 3 bytes */ + + p = input; q = output; + for ( i = 0 ; i < 7 ; i++ ) { + bv = (p[0] << 16) | (p[1] << 8) | p[2]; + p += 3; + for ( j = 0 ; j < 4 ; j++ ) { + *q++ = charz[(bv >> 18) & 0x3f]; + bv <<= 6; + } + } + *--q = '\0'; /* The last character is not significant */ + return output; +} + +#if 0 +int main(int argc, char** argv) +{ + int i; + SHA1_CTX context; + uint8_t digest[20], buffer[16384]; + FILE* file; + + if (argc < 2) { + file = stdin; + } + else { + if (!(file = fopen(argv[1], "rb"))) { + fputs("Unable to open file.", stderr); + return(-1); + } + } + SHA1Init(&context); + while (!feof(file)) { /* note: what if ferror(file) */ + i = fread(buffer, 1, 16384, file); + SHA1Update(&context, buffer, i); + } + SHA1Final(digest, &context); + fclose(file); + + puts(mybase64(digest)); + + return 0; +} +#endif diff --git a/i386/modules/klibc/snprintf.c b/i386/modules/klibc/snprintf.c new file mode 100644 index 0000000..6bc08e2 --- /dev/null +++ b/i386/modules/klibc/snprintf.c @@ -0,0 +1,17 @@ +/* + * snprintf.c + */ + +#include "libsaio.h" +extern int vsnprintf(char *buffer, size_t n, const char *format, va_list ap); + +int snprintf(char *buffer, size_t n, const char *format, ...) +{ + va_list ap; + int rv; + + va_start(ap, format); + rv = vsnprintf(buffer, n, format, ap); + va_end(ap); + return rv; +} diff --git a/i386/modules/klibc/srand48.c b/i386/modules/klibc/srand48.c new file mode 100644 index 0000000..dd21127 --- /dev/null +++ b/i386/modules/klibc/srand48.c @@ -0,0 +1,15 @@ +/* + * srand48.c + */ + +#include <stdlib.h> +#include <stdint.h> + +extern unsigned short __rand48_seed[3]; /* Common with mrand48.c, lrand48.c */ + +void srand48(long seedval) +{ + __rand48_seed[0] = 0x330e; + __rand48_seed[1] = (unsigned short)seedval; + __rand48_seed[2] = (unsigned short)((uint32_t) seedval >> 16); +} diff --git a/i386/modules/klibc/sscanf.c b/i386/modules/klibc/sscanf.c new file mode 100644 index 0000000..419e80c --- /dev/null +++ b/i386/modules/klibc/sscanf.c @@ -0,0 +1,17 @@ +/* + * sscanf() + */ + +#include "libsaio.h" +extern int vsscanf(const char *buffer, const char *format, va_list ap); +int sscanf(const char *str, const char *format, ...) +{ + va_list ap; + int rv; + + va_start(ap, format); + rv = vsscanf(str, format, ap); + va_end(ap); + + return rv; +} diff --git a/i386/modules/klibc/strcasecmp.c b/i386/modules/klibc/strcasecmp.c new file mode 100644 index 0000000..ee1f28b --- /dev/null +++ b/i386/modules/klibc/strcasecmp.c @@ -0,0 +1,24 @@ +/* + * strcasecmp.c + */ + +#include <string.h> +#include <ctype.h> + +int strcasecmp(const char *s1, const char *s2) +{ + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; + unsigned char ch; + int d = 0; + + while (1) { + /* toupper() expects an unsigned char (implicitly cast to int) + as input, and returns an int, which is exactly what we want. */ + d = toupper(ch = *c1++) - toupper(*c2++); + if (d || !ch) + break; + } + + return d; +} diff --git a/i386/modules/klibc/strdup.c b/i386/modules/klibc/strdup.c new file mode 100644 index 0000000..f0b9355 --- /dev/null +++ b/i386/modules/klibc/strdup.c @@ -0,0 +1,16 @@ +/* + * strdup.c + */ + +#include "libsaio.h" + +char *strdup(const char *s) +{ + int l = strlen(s) + 1; + char *d = malloc(l); + + if (d) + memcpy(d, s, l); + + return d; +} diff --git a/i386/modules/klibc/strlcat.c b/i386/modules/klibc/strlcat.c new file mode 100644 index 0000000..6d95087 --- /dev/null +++ b/i386/modules/klibc/strlcat.c @@ -0,0 +1,30 @@ +/* + * strlcat.c + */ + +#include <string.h> + +size_t strlcat(char *dst, const char *src, size_t size) +{ + size_t bytes = 0; + char *q = dst; + const char *p = src; + char ch; + + while (bytes < size && *q) { + q++; + bytes++; + } + if (bytes == size) + return (bytes + strlen(src)); + + while ((ch = *p++)) { + if (bytes + 1 < size) + *q++ = ch; + + bytes++; + } + + *q = '\0'; + return bytes; +} diff --git a/i386/modules/klibc/strncasecmp.c b/i386/modules/klibc/strncasecmp.c new file mode 100644 index 0000000..0551935 --- /dev/null +++ b/i386/modules/klibc/strncasecmp.c @@ -0,0 +1,24 @@ +/* + * strncasecmp.c + */ + +#include <string.h> +#include <ctype.h> + +int strncasecmp(const char *s1, const char *s2, size_t n) +{ + const unsigned char *c1 = (const unsigned char *)s1; + const unsigned char *c2 = (const unsigned char *)s2; + unsigned char ch; + int d = 0; + + while (n--) { + /* toupper() expects an unsigned char (implicitly cast to int) + as input, and returns an int, which is exactly what we want. */ + d = toupper(ch = *c1++) - toupper(*c2++); + if (d || !ch) + break; + } + + return d; +} diff --git a/i386/modules/klibc/strndup.c b/i386/modules/klibc/strndup.c new file mode 100644 index 0000000..ea63a39 --- /dev/null +++ b/i386/modules/klibc/strndup.c @@ -0,0 +1,16 @@ +/* + * strndup.c + */ + +#include "libsaio.h" + +char *strndup(const char *s, size_t n) +{ + int l = n > strlen(s) ? strlen(s) + 1 : n + 1; + char *d = malloc(l); + + if (d) + memcpy(d, s, l); + d[n] = '\0'; + return d; +} diff --git a/i386/modules/klibc/strnlen.c b/i386/modules/klibc/strnlen.c new file mode 100644 index 0000000..1678f4b --- /dev/null +++ b/i386/modules/klibc/strnlen.c @@ -0,0 +1,18 @@ +/* + * strnlen() + */ + +#include <string.h> + +size_t strnlen(const char *s, size_t maxlen) +{ + const char *ss = s; + + /* Important: the maxlen test must precede the reference through ss; + since the byte beyond the maximum may segfault */ + while ((maxlen > 0) && *ss) { + ss++; + maxlen--; + } + return ss - s; +} diff --git a/i386/modules/klibc/strntoimax.c b/i386/modules/klibc/strntoimax.c new file mode 100644 index 0000000..c152862 --- /dev/null +++ b/i386/modules/klibc/strntoimax.c @@ -0,0 +1,15 @@ +/* + * strntoimax.c + * + * strntoimax() + */ + +#include <stddef.h> +#include <inttypes.h> + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +intmax_t strntoimax(const char *nptr, char **endptr, int base, size_t n) +{ + return (intmax_t) strntoumax(nptr, endptr, base, n); +} diff --git a/i386/modules/klibc/strntoumax.c b/i386/modules/klibc/strntoumax.c new file mode 100644 index 0000000..ab43349 --- /dev/null +++ b/i386/modules/klibc/strntoumax.c @@ -0,0 +1,73 @@ +/* + * strntoumax.c + * + * The strntoumax() function and associated + */ +#include "libsaio.h" + +static inline int digitval(int ch) +{ + if (ch >= '0' && ch <= '9') { + return ch - '0'; + } else if (ch >= 'A' && ch <= 'Z') { + return ch - 'A' + 10; + } else if (ch >= 'a' && ch <= 'z') { + return ch - 'a' + 10; + } else { + return -1; + } +} + +uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n) +{ + int minus = 0; + uintmax_t v = 0; + int d; + + while (n && isspace((unsigned char)*nptr)) { + nptr++; + n--; + } + + /* Single optional + or - */ + if (n) { + char c = *nptr; + if (c == '-' || c == '+') { + minus = (c == '-'); + nptr++; + n--; + } + } + + if (base == 0) { + if (n >= 2 && nptr[0] == '0' && + (nptr[1] == 'x' || nptr[1] == 'X')) { + n -= 2; + nptr += 2; + base = 16; + } else if (n >= 1 && nptr[0] == '0') { + n--; + nptr++; + base = 8; + } else { + base = 10; + } + } else if (base == 16) { + if (n >= 2 && nptr[0] == '0' && + (nptr[1] == 'x' || nptr[1] == 'X')) { + n -= 2; + nptr += 2; + } + } + + while (n && (d = digitval(*nptr)) >= 0 && d < base) { + v = v * base + d; + n--; + nptr++; + } + + if (endptr) + *endptr = (char *)nptr; + + return minus ? -v : v; +} diff --git a/i386/modules/klibc/strpbrk.c b/i386/modules/klibc/strpbrk.c new file mode 100644 index 0000000..300dbba --- /dev/null +++ b/i386/modules/klibc/strpbrk.c @@ -0,0 +1,14 @@ +/* + * strpbrk + */ + +#include <string.h> + +#include "strxspn.h" + +char *strpbrk(const char *s, const char *accept) +{ + const char *ss = s + __strxspn(s, accept, 1); + + return *ss ? (char *)ss : NULL; +} diff --git a/i386/modules/klibc/strsep.c b/i386/modules/klibc/strsep.c new file mode 100644 index 0000000..44e76bd --- /dev/null +++ b/i386/modules/klibc/strsep.c @@ -0,0 +1,21 @@ +/* + * strsep.c + */ + +#include <string.h> + +char *strsep(char **stringp, const char *delim) +{ + char *s = *stringp; + char *e; + + if (!s) + return NULL; + + e = strpbrk(s, delim); + if (e) + *e++ = '\0'; + + *stringp = e; + return s; +} diff --git a/i386/modules/klibc/strtoimax.c b/i386/modules/klibc/strtoimax.c new file mode 100644 index 0000000..0cdd088 --- /dev/null +++ b/i386/modules/klibc/strtoimax.c @@ -0,0 +1,3 @@ +#define TYPE intmax_t +#define NAME strtoimax +#include "strtox.c" diff --git a/i386/modules/klibc/strtok.c b/i386/modules/klibc/strtok.c new file mode 100644 index 0000000..6b169a1 --- /dev/null +++ b/i386/modules/klibc/strtok.c @@ -0,0 +1,12 @@ +/* + * strtok.c + */ + +#include <string.h> + +char *strtok(char *s, const char *delim) +{ + static char *holder; + + return strtok_r(s, delim, &holder); +} diff --git a/i386/modules/klibc/strtok_r.c b/i386/modules/klibc/strtok_r.c new file mode 100644 index 0000000..695d516 --- /dev/null +++ b/i386/modules/klibc/strtok_r.c @@ -0,0 +1,13 @@ +#include <string.h> + +char *strtok_r(char *s, const char *delim, char **holder) +{ + if (s) + *holder = s; + + do { + s = strsep(holder, delim); + } while (s && !*s); + + return s; +} diff --git a/i386/modules/klibc/strtol.c b/i386/modules/klibc/strtol.c new file mode 100644 index 0000000..9efc8b9 --- /dev/null +++ b/i386/modules/klibc/strtol.c @@ -0,0 +1,3 @@ +#define TYPE signed long +#define NAME strtol +#include "strtox.c" diff --git a/i386/modules/klibc/strtoll.c b/i386/modules/klibc/strtoll.c new file mode 100644 index 0000000..a9428c7 --- /dev/null +++ b/i386/modules/klibc/strtoll.c @@ -0,0 +1,3 @@ +#define TYPE signed long long +#define NAME strtoll +#include "strtox.c" diff --git a/i386/modules/klibc/strtotimespec.c b/i386/modules/klibc/strtotimespec.c new file mode 100644 index 0000000..b426bf8 --- /dev/null +++ b/i386/modules/klibc/strtotimespec.c @@ -0,0 +1,5 @@ +#define NAME strtotimespec +#define TIMEX struct timespec +#define FSEC tv_nsec +#define DECIMALS 9 +#include "strtotimex.c" diff --git a/i386/modules/klibc/strtotimeval.c b/i386/modules/klibc/strtotimeval.c new file mode 100644 index 0000000..280d4bc --- /dev/null +++ b/i386/modules/klibc/strtotimeval.c @@ -0,0 +1,5 @@ +#define NAME strtotimeval +#define TIMEX struct timeval +#define FSEC tv_usec +#define DECIMALS 6 +#include "strtotimex.c" diff --git a/i386/modules/klibc/strtotimex.c b/i386/modules/klibc/strtotimex.c new file mode 100644 index 0000000..064c6f9 --- /dev/null +++ b/i386/modules/klibc/strtotimex.c @@ -0,0 +1,42 @@ +/* + * strtotimex.c + * + * Nonstandard function which takes a string and converts it to a + * struct timespec/timeval. Returns a pointer to the first non-numeric + * character in the string. + * + */ + +#include <ctype.h> +#include <inttypes.h> +#include <stdlib.h> +#include <time.h> +#include <sys/time.h> + +uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +char *NAME(const char *str, TIMEX * ts) +{ + int n; + char *s, *s0; + __typeof__(ts->FSEC) fs; /* Fractional seconds */ + + ts->tv_sec = strntoumax(str, &s, 10, ~(size_t) 0); + fs = 0; + + if (*s == '.') { + s0 = s + 1; + + fs = strntoumax(s0, &s, 10, DECIMALS); + n = s - s0; + + while (isdigit(*s)) + s++; + + for (; n < DECIMALS; n++) + fs *= 10; + } + + ts->FSEC = fs; + return s; +} diff --git a/i386/modules/klibc/strtoul.c b/i386/modules/klibc/strtoul.c new file mode 100644 index 0000000..3189aaa --- /dev/null +++ b/i386/modules/klibc/strtoul.c @@ -0,0 +1,3 @@ +#define TYPE unsigned long +#define NAME strtoul +#include "strtox.c" diff --git a/i386/modules/klibc/strtoull.c b/i386/modules/klibc/strtoull.c new file mode 100644 index 0000000..83c14e9 --- /dev/null +++ b/i386/modules/klibc/strtoull.c @@ -0,0 +1,3 @@ +#define TYPE unsigned long long +#define NAME strtoull +#include "strtox.c" diff --git a/i386/modules/klibc/strtoumax.c b/i386/modules/klibc/strtoumax.c new file mode 100644 index 0000000..a379710 --- /dev/null +++ b/i386/modules/klibc/strtoumax.c @@ -0,0 +1,3 @@ +#define TYPE uintmax_t +#define NAME strtoumax +#include "strtox.c" diff --git a/i386/modules/klibc/strtox.c b/i386/modules/klibc/strtox.c new file mode 100644 index 0000000..02d1e1b --- /dev/null +++ b/i386/modules/klibc/strtox.c @@ -0,0 +1,16 @@ +/* + * strtox.c + * + * strto...() functions, by macro definition + */ + +#include <stddef.h> +#include <stdlib.h> +#include <inttypes.h> + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +TYPE NAME(const char *nptr, char **endptr, int base) +{ + return (TYPE) strntoumax(nptr, endptr, base, ~(size_t) 0); +} diff --git a/i386/modules/klibc/strxspn.c b/i386/modules/klibc/strxspn.c new file mode 100644 index 0000000..8f32a08 --- /dev/null +++ b/i386/modules/klibc/strxspn.c @@ -0,0 +1,30 @@ +/* + * strpbrk + */ + +#include <limits.h> +#include "libsaio.h" +#include "strxspn.h" + + + + +size_t __strxspn(const char *s, const char *map, int parity) +{ + char matchmap[UCHAR_MAX + 1]; + size_t n = 0; + + /* Create bitmap */ + memset(matchmap, 0, sizeof matchmap); + while (*map) + matchmap[(unsigned char)*map++] = 1; + + /* Make sure the null character never matches */ + matchmap[0] = parity; + + /* Calculate span length */ + while (matchmap[(unsigned char)*s++] ^ parity) + n++; + + return n; +} diff --git a/i386/modules/klibc/strxspn.h b/i386/modules/klibc/strxspn.h new file mode 100644 index 0000000..ce56ff2 --- /dev/null +++ b/i386/modules/klibc/strxspn.h @@ -0,0 +1,12 @@ +/* + * strxspn.h + */ + +#ifndef STRXSPN_H +#define STRXSPN_H + +#include <stddef.h> + +extern size_t __strxspn(const char *s, const char *map, int parity); + +#endif diff --git a/i386/modules/klibc/version b/i386/modules/klibc/version new file mode 100644 index 0000000..a7ccabd --- /dev/null +++ b/i386/modules/klibc/version @@ -0,0 +1 @@ +1.5.20 diff --git a/i386/modules/klibc/vsnprintf.c b/i386/modules/klibc/vsnprintf.c new file mode 100644 index 0000000..e25c834 --- /dev/null +++ b/i386/modules/klibc/vsnprintf.c @@ -0,0 +1,486 @@ +/* + * vsnprintf.c + * + * vsnprintf(), from which the rest of the printf() + * family is built + */ + +//#include "libsaio.h" +//Azi: "UCHAR_MAX" & "UINT_MAX" redefined error - limits.h is also present in i386/include. +#include "libsa.h" +#include "limits.h" + +enum flags { + FL_ZERO = 0x01, /* Zero modifier */ + FL_MINUS = 0x02, /* Minus modifier */ + FL_PLUS = 0x04, /* Plus modifier */ + FL_TICK = 0x08, /* ' modifier */ + FL_SPACE = 0x10, /* Space modifier */ + FL_HASH = 0x20, /* # modifier */ + FL_SIGNED = 0x40, /* Number is signed */ + FL_UPPER = 0x80 /* Upper case digits */ +}; + +/* These may have to be adjusted on certain implementations */ +enum ranks { + rank_char = -2, + rank_short = -1, + rank_int = 0, + rank_long = 1, + rank_longlong = 2 +}; + +#define MIN_RANK rank_char +#define MAX_RANK rank_longlong + +#define INTMAX_RANK rank_longlong +#define SIZE_T_RANK rank_long +#define PTRDIFF_T_RANK rank_long + +#define EMIT(x) ({ if (o<n){*q++ = (x);} o++; }) + +static size_t +format_int(char *q, size_t n, uintmax_t val, enum flags flags, + int base, int width, int prec) +{ + char *qq; + size_t o = 0, oo; + static const char lcdigits[] = "0123456789abcdef"; + static const char ucdigits[] = "0123456789ABCDEF"; + const char *digits; + uintmax_t tmpval; + int minus = 0; + int ndigits = 0, nchars; + int tickskip, b4tick; + + /* Select type of digits */ + digits = (flags & FL_UPPER) ? ucdigits : lcdigits; + + /* If signed, separate out the minus */ + if (flags & FL_SIGNED && (intmax_t) val < 0) { + minus = 1; + val = (uintmax_t) (-(intmax_t) val); + } + + /* Count the number of digits needed. This returns zero for 0. */ + tmpval = val; + while (tmpval) { + tmpval /= base; + ndigits++; + } + + /* Adjust ndigits for size of output */ + + if (flags & FL_HASH && base == 8) { + if (prec < ndigits + 1) + prec = ndigits + 1; + } + + if (ndigits < prec) { + ndigits = prec; /* Mandatory number padding */ + } else if (val == 0) { + ndigits = 1; /* Zero still requires space */ + } + + /* For ', figure out what the skip should be */ + if (flags & FL_TICK) { + tickskip = (base == 16) ? 4 : 3; + } else { + tickskip = ndigits; /* No tick marks */ + } + + /* Tick marks aren't digits, but generated by the number converter */ + ndigits += (ndigits - 1) / tickskip; + + /* Now compute the number of nondigits */ + nchars = ndigits; + + if (minus || (flags & (FL_PLUS | FL_SPACE))) + nchars++; /* Need space for sign */ + if ((flags & FL_HASH) && base == 16) { + nchars += 2; /* Add 0x for hex */ + } + + /* Emit early space padding */ + if (!(flags & (FL_MINUS | FL_ZERO)) && width > nchars) { + while (width > nchars) { + EMIT(' '); + width--; + } + } + + /* Emit nondigits */ + if (minus) + EMIT('-'); + else if (flags & FL_PLUS) + EMIT('+'); + else if (flags & FL_SPACE) + EMIT(' '); + + if ((flags & FL_HASH) && base == 16) { + EMIT('0'); + EMIT((flags & FL_UPPER) ? 'X' : 'x'); + } + + /* Emit zero padding */ + if ((flags & (FL_MINUS | FL_ZERO)) == FL_ZERO && width > ndigits) { + while (width > nchars) { + EMIT('0'); + width--; + } + } + + /* Generate the number. This is done from right to left. */ + q += ndigits; /* Advance the pointer to end of number */ + o += ndigits; + qq = q; + oo = o; /* Temporary values */ + + b4tick = tickskip; + while (ndigits > 0) { + if (!b4tick--) { + qq--; + oo--; + ndigits--; + if (oo < n) + *qq = '_'; + b4tick = tickskip - 1; + } + qq--; + oo--; + ndigits--; + if (oo < n) + *qq = digits[val % base]; + val /= base; + } + + /* Emit late space padding */ + while ((flags & FL_MINUS) && width > nchars) { + EMIT(' '); + width--; + } + + return o; +} + +int vsnprintf(char *buffer, size_t n, const char *format, va_list ap) +{ + const char *p = format; + char ch; + char *q = buffer; + size_t o = 0; /* Number of characters output */ + uintmax_t val = 0; + int rank = rank_int; /* Default rank */ + int width = 0; + int prec = -1; + int base; + size_t sz; + enum flags flags = 0; + enum { + st_normal, /* Ground state */ + st_flags, /* Special flags */ + st_width, /* Field width */ + st_prec, /* Field precision */ + st_modifiers /* Length or conversion modifiers */ + } state = st_normal; + const char *sarg; /* %s string argument */ + char carg; /* %c char argument */ + int slen; /* String length */ + + while ((ch = *p++)) { + switch (state) { + case st_normal: + if (ch == '%') { + state = st_flags; + flags = 0; + rank = rank_int; + width = 0; + prec = -1; + } else { + EMIT(ch); + } + break; + + case st_flags: + switch (ch) { + case '-': + flags |= FL_MINUS; + break; + case '+': + flags |= FL_PLUS; + break; + case '\'': + flags |= FL_TICK; + break; + case ' ': + flags |= FL_SPACE; + break; + case '#': + flags |= FL_HASH; + break; + case '0': + flags |= FL_ZERO; + break; + default: + state = st_width; + p--; /* Process this character again */ + break; + } + break; + + case st_width: + if (ch >= '0' && ch <= '9') { + width = width * 10 + (ch - '0'); + } else if (ch == '*') { + width = va_arg(ap, int); + if (width < 0) { + width = -width; + flags |= FL_MINUS; + } + } else if (ch == '.') { + prec = 0; /* Precision given */ + state = st_prec; + } else { + state = st_modifiers; + p--; /* Process this character again */ + } + break; + + case st_prec: + if (ch >= '0' && ch <= '9') { + prec = prec * 10 + (ch - '0'); + } else if (ch == '*') { + prec = va_arg(ap, int); + if (prec < 0) + prec = -1; + } else { + state = st_modifiers; + p--; /* Process this character again */ + } + break; + + case st_modifiers: + switch (ch) { + /* Length modifiers - nonterminal sequences */ + case 'h': + rank--; /* Shorter rank */ + break; + case 'l': + rank++; /* Longer rank */ + break; + case 'j': + rank = INTMAX_RANK; + break; + case 'z': + rank = SIZE_T_RANK; + break; + case 't': + rank = PTRDIFF_T_RANK; + break; + case 'L': + case 'q': + rank += 2; + break; + default: + /* Output modifiers - terminal sequences */ + + /* Next state will be normal */ + state = st_normal; + + /* Canonicalize rank */ + if (rank < MIN_RANK) + rank = MIN_RANK; + else if (rank > MAX_RANK) + rank = MAX_RANK; + + switch (ch) { + case 'P': /* Upper case pointer */ + flags |= FL_UPPER; + /* fall through */ + case 'p': /* Pointer */ + base = 16; + prec = (CHAR_BIT*sizeof(void *)+3)/4; + flags |= FL_HASH; + val = (uintmax_t)(uintptr_t) + va_arg(ap, void *); + goto is_integer; + + case 'd': /* Signed decimal output */ + case 'i': + base = 10; + flags |= FL_SIGNED; + switch (rank) { + case rank_char: + /* Yes, all these casts are + needed... */ + val = (uintmax_t)(intmax_t) + (signed char) + va_arg(ap, signed int); + break; + case rank_short: + val = (uintmax_t)(intmax_t) + (signed short) + va_arg(ap, signed int); + break; + case rank_int: + val = (uintmax_t)(intmax_t) + va_arg(ap, signed int); + break; + case rank_long: + val = (uintmax_t)(intmax_t) + va_arg(ap, signed long); + break; + case rank_longlong: + val = (uintmax_t)(intmax_t) + va_arg(ap, + signed long long); + break; + } + goto is_integer; + case 'o': /* Octal */ + base = 8; + goto is_unsigned; + case 'u': /* Unsigned decimal */ + base = 10; + goto is_unsigned; + case 'X': /* Upper case hexadecimal */ + flags |= FL_UPPER; + /* fall through */ + case 'x': /* Hexadecimal */ + base = 16; + goto is_unsigned; + + is_unsigned: + switch (rank) { + case rank_char: + val = (uintmax_t) + (unsigned char) + va_arg(ap, unsigned + int); + break; + case rank_short: + val = (uintmax_t) + (unsigned short) + va_arg(ap, unsigned + int); + break; + case rank_int: + val = (uintmax_t) + va_arg(ap, unsigned + int); + break; + case rank_long: + val = (uintmax_t) + va_arg(ap, unsigned + long); + break; + case rank_longlong: + val = (uintmax_t) + va_arg(ap, unsigned + long long); + break; + } + /* fall through */ + + is_integer: + sz = format_int(q, (o < n) ? n - o : 0, + val, flags, base, + width, prec); + q += sz; + o += sz; + break; + + case 'c': /* Character */ + carg = (char)va_arg(ap, int); + sarg = &carg; + slen = 1; + goto is_string; + case 's': /* String */ + sarg = va_arg(ap, const char *); + sarg = sarg ? sarg : "(null)"; + slen = strlen(sarg); + goto is_string; + + is_string: + { + char sch; + int i; + + if (prec != -1 && slen > prec) + slen = prec; + + if (width > slen + && !(flags & FL_MINUS)) { + char pad = + (flags & FL_ZERO) ? + '0' : ' '; + while (width > slen) { + EMIT(pad); + width--; + } + } + for (i = slen; i; i--) { + sch = *sarg++; + EMIT(sch); + } + if (width > slen + && (flags & FL_MINUS)) { + while (width > slen) { + EMIT(' '); + width--; + } + } + } + break; + + case 'n': + { + /* Output the number of + characters written */ + + switch (rank) { + case rank_char: + *va_arg(ap, + signed char *) + = o; + break; + case rank_short: + *va_arg(ap, + signed short *) + = o; + break; + case rank_int: + *va_arg(ap, + signed int *) + = o; + break; + case rank_long: + *va_arg(ap, + signed long *) + = o; + break; + case rank_longlong: + *va_arg(ap, + signed long long *) + = o; + break; + } + } + break; + + default: /* Anything else, including % */ + EMIT(ch); + break; + } + } + } + } + + /* Null-terminate the string */ + if (o < n) + *q = '\0'; /* No overflow */ + else if (n > 0) + buffer[n - 1] = '\0'; /* Overflow - terminate at end of buffer */ + + return o; +} diff --git a/i386/modules/klibc/vsscanf.c b/i386/modules/klibc/vsscanf.c new file mode 100644 index 0000000..f4fe33e --- /dev/null +++ b/i386/modules/klibc/vsscanf.c @@ -0,0 +1,398 @@ +/* + * vsscanf.c + * + * vsscanf(), from which the rest of the scanf() + * family is built + */ + +//#include "libsaio.h" +//Azi: "UCHAR_MAX" & "UINT_MAX" redefined error - limits.h is also present in i386/include. +#include "libsa.h" +#include "limits.h" + +extern uintmax_t strntoumax(const char *nptr, char **endptr, int base, size_t n); + +#ifndef LONG_BIT +#define LONG_BIT (CHAR_BIT*sizeof(long)) +#endif + +enum flags { + FL_SPLAT = 0x01, /* Drop the value, do not assign */ + FL_INV = 0x02, /* Character-set with inverse */ + FL_WIDTH = 0x04, /* Field width specified */ + FL_MINUS = 0x08, /* Negative number */ +}; + +enum ranks { + rank_char = -2, + rank_short = -1, + rank_int = 0, + rank_long = 1, + rank_longlong = 2, + rank_ptr = INT_MAX /* Special value used for pointers */ +}; + +#define MIN_RANK rank_char +#define MAX_RANK rank_longlong + +#define INTMAX_RANK rank_longlong +#define SIZE_T_RANK rank_long +#define PTRDIFF_T_RANK rank_long + +enum bail { + bail_none = 0, /* No error condition */ + bail_eof, /* Hit EOF */ + bail_err /* Conversion mismatch */ +}; + +static inline const char *skipspace(const char *p) +{ + while (isspace((unsigned char)*p)) + p++; + return p; +} + +#undef set_bit +static inline void set_bit(unsigned long *bitmap, unsigned int bit) +{ + bitmap[bit / LONG_BIT] |= 1UL << (bit % LONG_BIT); +} + +#undef test_bit +static inline int test_bit(unsigned long *bitmap, unsigned int bit) +{ + return (int)(bitmap[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1; +} + +int vsscanf(const char *buffer, const char *format, va_list ap) +{ + const char *p = format; + char ch; + unsigned char uc; + const char *q = buffer; + const char *qq; + uintmax_t val = 0; + int rank = rank_int; /* Default rank */ + unsigned int width = UINT_MAX; + int base; + enum flags flags = 0; + enum { + st_normal, /* Ground state */ + st_flags, /* Special flags */ + st_width, /* Field width */ + st_modifiers, /* Length or conversion modifiers */ + st_match_init, /* Initial state of %[ sequence */ + st_match, /* Main state of %[ sequence */ + st_match_range, /* After - in a %[ sequence */ + } state = st_normal; + char *sarg = NULL; /* %s %c or %[ string argument */ + enum bail bail = bail_none; + int sign; + int converted = 0; /* Successful conversions */ + unsigned long matchmap[((1 << CHAR_BIT) + (LONG_BIT - 1)) / LONG_BIT]; + int matchinv = 0; /* Is match map inverted? */ + unsigned char range_start = 0; + + while ((ch = *p++) && !bail) { + switch (state) { + case st_normal: + if (ch == '%') { + state = st_flags; + flags = 0; + rank = rank_int; + width = UINT_MAX; + } else if (isspace((unsigned char)ch)) { + q = skipspace(q); + } else { + if (*q == ch) + q++; + else + bail = bail_err; /* Match failure */ + } + break; + + case st_flags: + switch (ch) { + case '*': + flags |= FL_SPLAT; + break; + case '0'...'9': + width = (ch - '0'); + state = st_width; + flags |= FL_WIDTH; + break; + default: + state = st_modifiers; + p--; /* Process this character again */ + break; + } + break; + + case st_width: + if (ch >= '0' && ch <= '9') { + width = width * 10 + (ch - '0'); + } else { + state = st_modifiers; + p--; /* Process this character again */ + } + break; + + case st_modifiers: + switch (ch) { + /* Length modifiers - nonterminal sequences */ + case 'h': + rank--; /* Shorter rank */ + break; + case 'l': + rank++; /* Longer rank */ + break; + case 'j': + rank = INTMAX_RANK; + break; + case 'z': + rank = SIZE_T_RANK; + break; + case 't': + rank = PTRDIFF_T_RANK; + break; + case 'L': + case 'q': + rank = rank_longlong; /* long double/long long */ + break; + + default: + /* Output modifiers - terminal sequences */ + /* Next state will be normal */ + state = st_normal; + + /* Canonicalize rank */ + if (rank < MIN_RANK) + rank = MIN_RANK; + else if (rank > MAX_RANK) + rank = MAX_RANK; + + switch (ch) { + case 'P': /* Upper case pointer */ + case 'p': /* Pointer */ + rank = rank_ptr; + base = 0; + sign = 0; + goto scan_int; + + case 'i': /* Base-independent integer */ + base = 0; + sign = 1; + goto scan_int; + + case 'd': /* Decimal integer */ + base = 10; + sign = 1; + goto scan_int; + + case 'o': /* Octal integer */ + base = 8; + sign = 0; + goto scan_int; + + case 'u': /* Unsigned decimal integer */ + base = 10; + sign = 0; + goto scan_int; + + case 'x': /* Hexadecimal integer */ + case 'X': + base = 16; + sign = 0; + goto scan_int; + + case 'n': /* # of characters consumed */ + val = (q - buffer); + goto set_integer; + + scan_int: + q = skipspace(q); + if (!*q) { + bail = bail_eof; + break; + } + val = + strntoumax(q, (char **)&qq, base, + width); + if (qq == q) { + bail = bail_err; + break; + } + q = qq; + if (!(flags & FL_SPLAT)) + converted++; + /* fall through */ + + set_integer: + if (!(flags & FL_SPLAT)) { + switch (rank) { + case rank_char: + *va_arg(ap, + unsigned char *) + = val; + break; + case rank_short: + *va_arg(ap, + unsigned short + *) = val; + break; + case rank_int: + *va_arg(ap, + unsigned int *) + = val; + break; + case rank_long: + *va_arg(ap, + unsigned long *) + = val; + break; + case rank_longlong: + *va_arg(ap, + unsigned long + long *) = val; + break; + case rank_ptr: + *va_arg(ap, void **) = + (void *) + (uintptr_t)val; + break; + } + } + break; + + case 'c': /* Character */ + /* Default width == 1 */ + width = (flags & FL_WIDTH) ? width : 1; + if (flags & FL_SPLAT) { + while (width--) { + if (!*q) { + bail = bail_eof; + break; + } + } + } else { + sarg = va_arg(ap, char *); + while (width--) { + if (!*q) { + bail = bail_eof; + break; + } + *sarg++ = *q++; + } + if (!bail) + converted++; + } + break; + + case 's': /* String */ + uc = 1; /* Anything nonzero */ + if (flags & FL_SPLAT) { + while (width-- && (uc = *q) && + !isspace(uc)) { + q++; + } + } else { + char *sp; + sp = sarg = va_arg(ap, char *); + while (width-- && (uc = *q) && + !isspace(uc)) { + *sp++ = uc; + q++; + } + if (sarg != sp) { + /* Terminate output */ + *sp = '\0'; + converted++; + } + } + if (!uc) + bail = bail_eof; + break; + + case '[': /* Character range */ + sarg = (flags & FL_SPLAT) ? NULL + : va_arg(ap, char *); + state = st_match_init; + matchinv = 0; + memset(matchmap, 0, sizeof matchmap); + break; + + case '%': /* %% sequence */ + if (*q == '%') + q++; + else + bail = bail_err; + break; + + default: /* Anything else */ + /* Unknown sequence */ + bail = bail_err; + break; + } + } + break; + + case st_match_init: /* Initial state for %[ match */ + if (ch == '^' && !(flags & FL_INV)) { + matchinv = 1; + } else { + set_bit(matchmap, (unsigned char)ch); + state = st_match; + } + break; + + case st_match: /* Main state for %[ match */ + if (ch == ']') { + goto match_run; + } else if (ch == '-') { + range_start = (unsigned char)ch; + state = st_match_range; + } else { + set_bit(matchmap, (unsigned char)ch); + } + break; + + case st_match_range: /* %[ match after - */ + if (ch == ']') { + /* - was last character */ + set_bit(matchmap, (unsigned char)'-'); + goto match_run; + } else { + int i; + for (i = range_start; i < (unsigned char)ch; + i++) + set_bit(matchmap, i); + state = st_match; + } + break; + + match_run: /* Match expression finished */ + qq = q; + uc = 1; /* Anything nonzero */ + while (width && (uc = *q) + && test_bit(matchmap, uc)^matchinv) { + if (sarg) + *sarg++ = uc; + q++; + } + if (q != qq && sarg) { + *sarg = '\0'; + converted++; + } else { + bail = bail_err; + } + if (!uc) + bail = bail_eof; + break; + } + } + + if (bail == bail_eof && !converted) + converted = -1; /* Return EOF (-1) */ + + return converted; +} diff --git a/i386/modules/uClibcxx/.svn/all-wcprops b/i386/modules/uClibcxx/.svn/all-wcprops new file mode 100644 index 0000000..7648839 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/all-wcprops @@ -0,0 +1,293 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx +END +exception.cpp +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/exception.cpp +END +locale.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/locale.cpp +END +eh_globals.cpp +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/eh_globals.cpp +END +del_op.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/del_op.cpp +END +numeric.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/numeric.cpp +END +vector.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/vector.cpp +END +deque.cpp +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/deque.cpp +END +stdexcept.cpp +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/stdexcept.cpp +END +utility.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/utility.cpp +END +eh_alloc.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/eh_alloc.cpp +END +list.cpp +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/list.cpp +END +map.cpp +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/map.cpp +END +new_opvnt.cpp +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/new_opvnt.cpp +END +queue.cpp +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/queue.cpp +END +del_opv.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/del_opv.cpp +END +streambuf.cpp +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/streambuf.cpp +END +new_opnt.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/new_opnt.cpp +END +iterator.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/iterator.cpp +END +ios.cpp +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/ios.cpp +END +Readme.txt +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/Readme.txt +END +bitset.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/bitset.cpp +END +abi.cpp +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/abi.cpp +END +set.cpp +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/set.cpp +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/Makefile +END +limits.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/limits.cpp +END +fstream.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/fstream.cpp +END +char_traits.cpp +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/char_traits.cpp +END +istream.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/istream.cpp +END +associative_base.cpp +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/associative_base.cpp +END +del_opnt.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/del_opnt.cpp +END +stack.cpp +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/stack.cpp +END +string.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/string.cpp +END +complex.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/complex.cpp +END +func_exception.cpp +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/func_exception.cpp +END +ostream.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/ostream.cpp +END +support.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/support.cpp +END +new_opv.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/new_opv.cpp +END +sstream.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/sstream.cpp +END +valarray.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/valarray.cpp +END +iostream.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/iostream.cpp +END +new_handler.cpp +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/new_handler.cpp +END +algorithm.cpp +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/algorithm.cpp +END +new_op.cpp +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/new_op.cpp +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/Cconfig +END +uClibc++.c +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/uClibc++.c +END +del_opvnt.cpp +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/del_opvnt.cpp +END +iomanip.cpp +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/iomanip.cpp +END +typeinfo.cpp +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/typeinfo.cpp +END diff --git a/i386/modules/uClibcxx/.svn/entries b/i386/modules/uClibcxx/.svn/entries new file mode 100644 index 0000000..6696da5 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/entries @@ -0,0 +1,1663 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/uClibcxx +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +exception.cpp +file + + + + +2013-08-27T23:55:02.000000Z +6a5ab71915ed415b7a1ea91aa4e2ec2f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2066 + +locale.cpp +file + + + + +2013-08-27T23:55:02.000000Z +0e3c8b2f9dcdbd234b0883498e0b58c4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +918 + +eh_globals.cpp +file + + + + +2013-08-27T23:55:02.000000Z +5248f9e04619d1493401b75ef33c1553 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1327 + +del_op.cpp +file + + + + +2013-08-27T23:55:02.000000Z +87477049c6ad3dbfd92632eaf30dafed +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +931 + +numeric.cpp +file + + + + +2013-08-27T23:55:02.000000Z +8d5efc6fa5e1794974c9bf1d2c23e8e5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +844 + +vector.cpp +file + + + + +2013-08-27T23:55:02.000000Z +59e242103bcb4836417c94e367e6bd66 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4252 + +deque.cpp +file + + + + +2013-08-27T23:55:02.000000Z +249b4be24068ff515d07ce5d50b384b7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +857 + +stdexcept.cpp +file + + + + +2013-08-27T23:55:02.000000Z +8d64663af651363fca914dc4f35f3346 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1566 + +utility.cpp +file + + + + +2013-08-27T23:55:02.000000Z +15aa35fe0407bed50f5b03e8e98d223a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +847 + +eh_alloc.cpp +file + + + + +2013-08-27T23:55:02.000000Z +3d6c411e35728b993cff34c0f732b901 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1570 + +list.cpp +file + + + + +2013-08-27T23:55:02.000000Z +46aa74d12553d1d34ea609a8d93ac3d1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +843 + +map.cpp +file + + + + +2013-08-27T23:55:02.000000Z +1dfcd0b173de0f3a168d6466a9e52684 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +846 + +new_opvnt.cpp +file + + + + +2013-08-27T23:55:02.000000Z +9aaab0ab7769fd63974b990775859335 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1043 + +queue.cpp +file + + + + +2013-08-27T23:55:02.000000Z +418758966de19d9cf969a96cba21be9d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +847 + +streambuf.cpp +file + + + + +2013-08-27T23:55:02.000000Z +19f5d1b6748f6b62eb70cf0e13208b26 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1634 + +del_opv.cpp +file + + + + +2013-08-27T23:55:02.000000Z +70ad6c3858b8c449b15c4768c3a2bd7d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +934 + +new_opnt.cpp +file + + + + +2013-08-27T23:55:02.000000Z +1185cfc74d1c7e62b46708ff69a813f8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1041 + +iterator.cpp +file + + + + +2013-08-27T23:55:02.000000Z +53b8c38c7bfed7cb0b66759a326d501e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +846 + +ios.cpp +file + + + + +2013-08-27T23:55:02.000000Z +72d5ade33bbdc306a16e763dbfda0db1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4660 + +Readme.txt +file + + + + +2013-08-27T23:55:02.000000Z +88f7a378f825630803121d3f1a0559a5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +350 + +bitset.cpp +file + + + + +2013-08-27T23:55:02.000000Z +691e5c1f1d294408e9785ddaab5c2e1d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +842 + +abi.cpp +file + + + + +2013-08-27T23:55:02.000000Z +5d76739529657ba7f51d6e48870f9595 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1300 + +set.cpp +file + + + + +2013-08-27T23:55:02.000000Z +fb5db808e0f4f56e8816453073e764da +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +846 + +Makefile +file + + + + +2013-08-27T23:55:02.000000Z +28d9bd8fc655d1c8366225bb04b7f778 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1009 + +limits.cpp +file + + + + +2013-08-27T23:55:02.000000Z +6962a63db627bbb5a8a785005922ebcf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +841 + +fstream.cpp +file + + + + +2013-08-27T23:55:02.000000Z +10844f497f19c3411f33d62e620ab80e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4944 + +include +dir + +char_traits.cpp +file + + + + +2013-08-27T23:55:02.000000Z +347b452e4ca36da25cc7df8d5f28196c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1710 + +istream.cpp +file + + + + +2013-08-27T23:55:02.000000Z +6a44e1c9e40df1d66f29ca457a45e4fd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2432 + +associative_base.cpp +file + + + + +2013-08-27T23:55:02.000000Z +744eddd7a3bea6a6de3088cc6c30c43d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +852 + +del_opnt.cpp +file + + + + +2013-08-27T23:55:02.000000Z +63a91df913c820088650db57b8659929 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +982 + +stack.cpp +file + + + + +2013-08-27T23:55:02.000000Z +4bf9264a9234efbe3dd176fea93ab80d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +847 + +string.cpp +file + + + + +2013-08-27T23:55:02.000000Z +c5a5e8ee80153317567db3ae2e286056 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5094 + +complex.cpp +file + + + + +2013-08-27T23:55:02.000000Z +e035380f405df9c1010b7c57e1df564a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +893 + +func_exception.cpp +file + + + + +2013-08-27T23:55:02.000000Z +ea873e102138df08f45949fa8168e2cb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1932 + +ostream.cpp +file + + + + +2013-08-27T23:55:02.000000Z +e53f47ce0486a6c1a30b6d6f97b88727 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2585 + +support.cpp +file + + + + +2013-08-27T23:55:02.000000Z +00b2b96effb4c02c9df33f4d467e0c02 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1751 + +new_opv.cpp +file + + + + +2013-08-27T23:55:02.000000Z +591ad850cbae9d4a96ba14e437ad9ac4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1202 + +sstream.cpp +file + + + + +2013-08-27T23:55:02.000000Z +8a041918a76b9ae8a38757c803f919fd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2420 + +valarray.cpp +file + + + + +2013-08-27T23:55:02.000000Z +4f7edb3997ccb6414ce4ecdff4c68b84 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +847 + +iostream.cpp +file + + + + +2013-08-27T23:55:02.000000Z +96ded4b53de4d6eb0e378344db363202 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1195 + +new_handler.cpp +file + + + + +2013-08-27T23:55:02.000000Z +abe5c56258e1811daeef083643cb1bb3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1108 + +algorithm.cpp +file + + + + +2013-08-27T23:55:02.000000Z +61cee7b35ce1d5eaeb64291c46942953 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +849 + +new_op.cpp +file + + + + +2013-08-27T23:55:02.000000Z +86ae72e5cc976f152255564435b2c2d7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1200 + +Cconfig +file + + + + +2013-08-27T23:55:02.000000Z +58d74989f556f5b828e00cb6649d80e9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +185 + +uClibc++.c +file + + + + +2013-08-27T23:55:02.000000Z +5e694b8c92d43783851a324805a31f49 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +97 + +del_opvnt.cpp +file + + + + +2013-08-27T23:55:02.000000Z +c0755667c91d19bd52fc1a64d9dc514b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +983 + +iomanip.cpp +file + + + + +2013-08-27T23:55:02.000000Z +a56633cb975ca2b6f38310b5b44c6ae8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +846 + +typeinfo.cpp +file + + + + +2013-08-27T23:55:02.000000Z +44166f07619039e172f93921ff263510 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +946 + diff --git a/i386/modules/uClibcxx/.svn/text-base/Cconfig.svn-base b/i386/modules/uClibcxx/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..db766d2 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,11 @@ +# +# Chameleon Modules +# + +config UCLIBCXX_MODULE + tristate "uClibc++ Module" + default m + depends on KLIBC_MODULE + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/uClibcxx/.svn/text-base/Makefile.svn-base b/i386/modules/uClibcxx/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..1a65f1d --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/Makefile.svn-base @@ -0,0 +1,22 @@ +MODULE_NAME = uClibcxx +MODULE_DESCRIPTION = This module provides a minimalistic c++ runtime library for use in other modules. This does not provide functionality by itself, instead it is used to allow for the c++ language to be used in other modules. Please note that rtti and exceptions has both been disabled. +MODULE_AUTHOR = +MODULE_VERSION = "0.2.2" +MODULE_COMPAT_VERSION = "0.2.2" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = klibc + +DIR = uClibc++ +# sstream.o fstream.o +MODULE_OBJS = uClibc++.o abi.o algorithm.o associative_base.o bitset.o \ + complex.o del_op.o del_opnt.o del_opv.o del_opvnt.o \ + deque.o eh_alloc.o eh_globals.o exception.o \ + func_exception.o iomanip.o char_traits.o \ + iterator.o limits.o list.o locale.o \ + map.o new_handler.o new_op.o new_opnt.o new_opv.o \ + new_opvnt.o numeric.o queue.o set.o \ + stack.o stdexcept.o streambuf.o string.o typeinfo.o \ + utility.o valarray.o vector.o support.o \ + ios.o iostream.o istream.o ostream.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/uClibcxx/.svn/text-base/Readme.txt.svn-base b/i386/modules/uClibcxx/.svn/text-base/Readme.txt.svn-base new file mode 100644 index 0000000..b2c8f68 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/Readme.txt.svn-base @@ -0,0 +1,4 @@ +Module: uClibc++ +Source: http://cxx.uclibc.org/ +Description: This module provides a minimalistic c++ runtime library for use in other modules. This does not provide functionality by itself, instead it is used to allow for the c++ language to be used in other modules. Please note that rtti and exceptions has both been disabled. +Dependencies: klibc diff --git a/i386/modules/uClibcxx/.svn/text-base/abi.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/abi.cpp.svn-base new file mode 100644 index 0000000..386f35a --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/abi.cpp.svn-base @@ -0,0 +1,39 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc C++ Library. This library is free + software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) + any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this library; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. +*/ + +#include <cstdlib> +#include <typeinfo> +#include <basic_definitions> + +/* This file implements a number of the language support features + * needed to deal with the C++ abi, as originally documented in the + * Itanium C++ ABI, though now industry standard + */ + +extern "C" { + + /* This function is called in the event that a non-overidden + * pure virtual function is called. The compiler should never + * let that happen. We get to choose what to do - we will abort + */ + void __cxa_pure_virtual (){ + abort(); + } + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/algorithm.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/algorithm.cpp.svn-base new file mode 100644 index 0000000..e21b14e --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/algorithm.cpp.svn-base @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <algorithm> + + +namespace std{ + + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/associative_base.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/associative_base.cpp.svn-base new file mode 100644 index 0000000..cc2d20e --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/associative_base.cpp.svn-base @@ -0,0 +1,26 @@ +/* Copyright (C) 2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <associative_base> + +namespace std{ + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/bitset.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/bitset.cpp.svn-base new file mode 100644 index 0000000..f1ece31 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/bitset.cpp.svn-base @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <bitset> + +namespace std{ + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/char_traits.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/char_traits.cpp.svn-base new file mode 100644 index 0000000..2a91bd9 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/char_traits.cpp.svn-base @@ -0,0 +1,69 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#define __UCLIBCXX_COMPILE_CHAR_TRAITS__ 1 + + +#include <basic_definitions> +#include <char_traits> + +namespace std{ + +_UCXXEXPORT const char_traits<char>::char_type* char_traits<char>::find(const char_type* s, int n, const char_type& a){ + for(int i=0; i < n; i++){ + if(eq(s[i], a)){ + return (s+i); + } + } + return 0; +} + +_UCXXEXPORT bool char_traits<char>::eq(const char_type& c1, const char_type& c2){ + if(strncmp(&c1, &c2, 1) == 0){ + return true; + } + return false; +} + +_UCXXEXPORT char_traits<char>::char_type char_traits<char>::to_char_type(const int_type & i){ + if(i > 0 && i <= 255){ + return (char)(unsigned char)i; + } + + //Out of range + return 0; +} + + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +_UCXXEXPORT const char_traits<wchar_t>::char_type* char_traits<wchar_t>::find(const char_type* s, int n, const char_type& a){ + for(int i=0; i < n; i++){ + if(eq(s[i], a)){ + return (s+i); + } + } + return 0; +} + +#endif + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/complex.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/complex.cpp.svn-base new file mode 100644 index 0000000..6b895a8 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/complex.cpp.svn-base @@ -0,0 +1,28 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <complex> + + +namespace std{ + + + template class _UCXXEXPORT complex<float>; + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/del_op.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/del_op.cpp.svn-base new file mode 100644 index 0000000..f5a3695 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/del_op.cpp.svn-base @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +_UCXXEXPORT void operator delete(void* ptr) throw(){ + free(ptr); +} diff --git a/i386/modules/uClibcxx/.svn/text-base/del_opnt.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/del_opnt.cpp.svn-base new file mode 100644 index 0000000..96cb03b --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/del_opnt.cpp.svn-base @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +#ifndef NO_NOTHROW +_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw() { + free(ptr); +} +#endif diff --git a/i386/modules/uClibcxx/.svn/text-base/del_opv.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/del_opv.cpp.svn-base new file mode 100644 index 0000000..028e86f --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/del_opv.cpp.svn-base @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +_UCXXEXPORT void operator delete[](void * ptr) throw(){ + free(ptr); +} diff --git a/i386/modules/uClibcxx/.svn/text-base/del_opvnt.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/del_opvnt.cpp.svn-base new file mode 100644 index 0000000..f2a2a36 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/del_opvnt.cpp.svn-base @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +#ifndef NO_NOTHROW +_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(){ + free(ptr); +} +#endif diff --git a/i386/modules/uClibcxx/.svn/text-base/deque.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/deque.cpp.svn-base new file mode 100644 index 0000000..c515580 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/deque.cpp.svn-base @@ -0,0 +1,42 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <deque> + + +namespace std{ + + + + + + + + + + + + + + +} + + + + diff --git a/i386/modules/uClibcxx/.svn/text-base/eh_alloc.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/eh_alloc.cpp.svn-base new file mode 100644 index 0000000..bc0ea00 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/eh_alloc.cpp.svn-base @@ -0,0 +1,46 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation, version 2.1 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstdlib> +#include <cstring> +#include <func_exception> + +//This is a system-specific header which does all of the error-handling management +#include <unwind-cxx.h> + +namespace __cxxabiv1{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw(){ + void *retval; + //The sizeof crap is required by Itanium ABI because we need to provide space for + //accounting information which is implementaion (gcc) specified + retval = malloc (thrown_size + sizeof(__cxa_exception)); + if(0 == retval){ + std::terminate(); + } + memset (retval, 0, sizeof(__cxa_exception)); + return (void *)((unsigned char *)retval + sizeof(__cxa_exception)); +} + +extern "C" void __cxa_free_exception(void *vptr) throw(){ + free( (char *)(vptr) - sizeof(__cxa_exception) ); +} +#endif +} diff --git a/i386/modules/uClibcxx/.svn/text-base/eh_globals.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/eh_globals.cpp.svn-base new file mode 100644 index 0000000..3d320db --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/eh_globals.cpp.svn-base @@ -0,0 +1,44 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation, version 2.1 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstdlib> +#include <cstring> +#include <func_exception> + +//This is a system-specific header which does all of the error-handling management +#include <unwind-cxx.h> + +//The following functionality is derived from reading of the GNU libstdc++ code and making it...simple + + +namespace __cxxabiv1{ +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +static __UCLIBCXX_TLS __cxa_eh_globals eh_globals; + +extern "C" __cxa_eh_globals* __cxa_get_globals() throw(){ + return &eh_globals; +} + +extern "C" __cxa_eh_globals* __cxa_get_globals_fast() throw(){ + return &eh_globals; +} +#endif + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/exception.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/exception.cpp.svn-base new file mode 100644 index 0000000..828933a --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/exception.cpp.svn-base @@ -0,0 +1,87 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <exception> +#include <func_exception> +#include <stdexcept> +#include <cstdlib> + +//We can't do this yet because gcc is too stupid to be able to handle +//different implementations of exception class. + +//#undef __UCLIBCXX_EXCEPTION_SUPPORT__ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + _UCXXEXPORT static const char * __std_exception_what_value = "exception"; + + //We are providing our own versions to be sneaky + + + _UCXXEXPORT exception::~exception() throw(){ + //Empty function + } + + _UCXXEXPORT const char* exception::what() const throw(){ + return __std_exception_what_value; + } + + _UCXXEXPORT bad_exception::~bad_exception() throw(){ + + } + +} +#else +namespace std{ + _UCXXEXPORT exception::~exception() { + abort(); + } + + _UCXXEXPORT const char* exception::what() const { + abort(); + } + + _UCXXEXPORT bad_exception::~bad_exception() { + abort(); + } + +} +#endif + +void +std::terminate() +{ +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + try + { +#endif // __UCLIBCXX_EXCEPTION_SUPPORT__ + (*std::terminate_handler())(); + // handler should not return + abort (); +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + } + catch (...) + { + // handler should not throw exception + abort (); + } +#endif // __UCLIBCXX_EXCEPTION_SUPPORT__ +} diff --git a/i386/modules/uClibcxx/.svn/text-base/fstream.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/fstream.cpp.svn-base new file mode 100644 index 0000000..535fe9a --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/fstream.cpp.svn-base @@ -0,0 +1,174 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_FSTREAM__ 1 + +#include <fstream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT filebuf::basic_filebuf(); + template _UCXXEXPORT filebuf::~basic_filebuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT filebuf::int_type filebuf::pbackfail(filebuf::int_type c); + template _UCXXEXPORT filebuf * filebuf::open(const char* s, ios_base::openmode mode); + template _UCXXEXPORT filebuf * filebuf::close(); + template _UCXXEXPORT filebuf::int_type filebuf::overflow(filebuf::int_type); + template _UCXXEXPORT filebuf::int_type filebuf::underflow (); + template _UCXXEXPORT streamsize filebuf::xsputn(const char* s, streamsize n); + + template _UCXXEXPORT basic_streambuf<char, char_traits<char> >* + filebuf::setbuf(char * s, streamsize n); + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(); + template _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(const char* s, ios_base::openmode mode); + template _UCXXEXPORT basic_ofstream<char, char_traits<char> >::~basic_ofstream(); + + template _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(); + template _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(const char* s, ios_base::openmode mode); + template _UCXXEXPORT basic_ifstream<char, char_traits<char> >::~basic_ifstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + +#endif + + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::overflow(int_type c) +{ + typedef basic_streambuf<wchar_t, char_traits<wchar_t> > wstreambuf; + typedef char_traits<wchar_t> wtraits; + + if(is_open() == false){ + //Can't do much + return wtraits::eof(); + } + + mbstate_t ps = { 0 }; + char out_array[8]; + size_t out_size; + + + if( wstreambuf::pbase() != 0 ){ + + //Write all possible character from the existing array first + size_t chars_written = 0; + while(wstreambuf::pbase() && (wstreambuf::pbase() + chars_written !=wstreambuf::pptr()) ){ + out_size = wcrtomb(out_array, wstreambuf::pbase()[chars_written], &ps); + if(out_size == (size_t)(-1) || fwrite(out_array, out_size, 1, fp) == 0){ + break; + } + ++chars_written; + } + + if( wstreambuf::pbase() + chars_written == wstreambuf::pptr() ){ + wstreambuf::pbump(-chars_written); + }else{ + //Shuffle data back into order + size_t chars_left = wstreambuf::pptr() - wstreambuf::pbase() - chars_written; + for(size_t i = 0; i < chars_left; ++i){ + wstreambuf::pbase()[i] = (wstreambuf::pptr() - chars_written)[i]; + } + return wtraits::eof(); + } + } + + if( !wtraits::eq_int_type(c, wtraits::eof()) ){ + out_size = wcrtomb(out_array, c, &ps); + if(out_size == (size_t)(-1) || fwrite(out_array, out_size, 1, fp) == 0){ + return wtraits::eof(); + } + return c; + } + + return wtraits::not_eof(c); +} + + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::underflow() +{ + /*Some variables used internally: + Buffer pointers: + + charT * mgbeg; + charT * mgnext; + charT * mgend; + + eback() returns mgbeg + gptr() returns mgnext + egptr() returns mgend + + gbump(int n) mgnext+=n + */ + + typedef char_traits<wchar_t> traits; + typedef basic_streambuf<wchar_t, traits> wstreambuf; + + + if(wstreambuf::eback() == wstreambuf::gptr() && 0 != wstreambuf::eback()){ //Buffer is full + return traits::to_int_type(*wstreambuf::gptr()); + } + + size_t in_size; + + wchar_t c = 0; + wint_t wi = 0; + in_size = 0; + + wi = fgetwc(fp); + if(WEOF == wi){ + fprintf(stderr, "WEOF returned by fgetwc\n"); + return traits::eof(); + } + + c = traits::to_char_type(wi); + + if(wstreambuf::eback() == 0){ + return traits::to_int_type(c); + } + + for(wchar_t * i = wstreambuf::gptr(); i < wstreambuf::egptr(); ++i){ + *(i-1) = *i; + } + + *(wstreambuf::egptr()-1) = c; + + wstreambuf::mgnext -= 1; + + return traits::to_int_type(*wstreambuf::gptr()); +} + +#endif // __UCLIBCXX_HAS_WCHAR__ + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/func_exception.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/func_exception.cpp.svn-base new file mode 100644 index 0000000..fab095f --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/func_exception.cpp.svn-base @@ -0,0 +1,87 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <func_exception> +#include <stdexcept> +#include <cstdlib> + +namespace std{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +_UCXXEXPORT void __throw_bad_alloc(){ + throw bad_alloc(); +} + +_UCXXEXPORT void __throw_out_of_range( const char * message){ + if(message == 0){ + throw out_of_range(); + } + throw out_of_range(message); +} + +_UCXXEXPORT void __throw_overflow_error( const char * message){ + if(message == 0){ + throw overflow_error(); + } + throw overflow_error(message); +} + +_UCXXEXPORT void __throw_length_error(const char * message){ + if(message == 0){ + throw length_error(); + } + throw length_error(message); +} + +_UCXXEXPORT void __throw_invalid_argument(const char * message){ + if(message == 0){ + throw invalid_argument(); + } + throw invalid_argument(message); +} + +#else + +_UCXXEXPORT void __throw_bad_alloc(){ + abort(); +} + +_UCXXEXPORT void __throw_out_of_range( const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_overflow_error( const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_length_error(const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_invalid_argument(const char *){ + abort(); +} + +#endif + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/iomanip.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/iomanip.cpp.svn-base new file mode 100644 index 0000000..c5e60cc --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/iomanip.cpp.svn-base @@ -0,0 +1,29 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <iomanip> + +namespace std{ + + + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/ios.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/ios.cpp.svn-base new file mode 100644 index 0000000..cf55fa3 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/ios.cpp.svn-base @@ -0,0 +1,189 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_IOS__ 1 + +#include <ios> +#include <ostream> +#include <istream> +#include <cstdio> +#include <fstream> + +namespace std{ + + +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + _UCXXLOCAL int ios_base::Init::init_cnt = 0; //Needed to ensure the static value is created + +//Create buffers first +#if __UCLIBCXX_SUPPORT_COUT__ + _UCXXEXPORT filebuf _cout_filebuf; +#endif +#if __UCLIBCXX_SUPPORT_CIN__ + _UCXXEXPORT filebuf _cin_filebuf; +#endif +#if __UCLIBCXX_SUPPORT_CERR__ + _UCXXEXPORT filebuf _cerr_filebuf; +#endif +#if __UCLIBCXX_SUPPORT_CLOG__ + _UCXXEXPORT filebuf _clog_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _UCXXEXPORT wfilebuf _wcout_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _UCXXEXPORT wfilebuf _wcin_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _UCXXEXPORT wfilebuf _wcerr_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _UCXXEXPORT wfilebuf _wclog_filebuf; +#endif + +//Then create streams +#if __UCLIBCXX_SUPPORT_COUT__ + _UCXXEXPORT ostream cout(&_cout_filebuf); +#endif +#if __UCLIBCXX_SUPPORT_CIN__ + _UCXXEXPORT istream cin(&_cin_filebuf); +#endif +#if __UCLIBCXX_SUPPORT_CERR__ + _UCXXEXPORT ostream cerr(&_cerr_filebuf); +#endif +#if __UCLIBCXX_SUPPORT_CLOG__ + _UCXXEXPORT ostream clog(&_clog_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _UCXXEXPORT wostream wcout(&_wcout_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _UCXXEXPORT wistream wcin(&_wcin_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _UCXXEXPORT wostream wcerr(&_wcerr_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _UCXXEXPORT wostream wclog(&_wclog_filebuf); +#endif + + + _UCXXEXPORT ios_base::Init::Init(){ + if(init_cnt == 0){ //Need to construct cout et al +#if __UCLIBCXX_SUPPORT_COUT__ + _cout_filebuf.fp = stdout; + _cout_filebuf.openedFor = ios_base::out; +#endif +#if __UCLIBCXX_SUPPORT_CERR__ + _cerr_filebuf.fp = stderr; + _cerr_filebuf.openedFor = ios_base::out; + cerr.mformat |= ios_base::unitbuf; +#endif +#if __UCLIBCXX_SUPPORT_CLOG__ + _clog_filebuf.fp = stderr; + _clog_filebuf.openedFor = ios_base::out; +#endif +#if __UCLIBCXX_SUPPORT_CIN__ + _cin_filebuf.fp = stdin; + _cin_filebuf.openedFor = ios_base::in; + +#if __UCLIBCXX_SUPPORT_COUT__ + cin.tie(&cout); +#endif + +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _wcout_filebuf.fp = stdout; + _wcout_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _wcerr_filebuf.fp = stderr; + _wcerr_filebuf.openedFor = ios_base::out; + wcerr.mformat |= ios_base::unitbuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _wclog_filebuf.fp = stderr; + _wclog_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _wcin_filebuf.fp = stdin; + _wcin_filebuf.openedFor = ios_base::in; + +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + wcin.tie(&wcout); +#endif + +#endif + } + init_cnt++; + } + + _UCXXEXPORT ios_base::Init::~Init(){ + --init_cnt; + if(init_cnt==0){ + + } + } +#endif + + +#ifdef __UCLIBCXX_EXPAND_IOS_CHAR__ + + template _UCXXEXPORT void basic_ios<char, char_traits<char> >::clear(iostate state); + template _UCXXEXPORT void basic_ios<char, char_traits<char> >::setstate(iostate state); + +#endif + + + _UCXXEXPORT ios_base::fmtflags ios_base::flags(fmtflags fmtfl){ + fmtflags temp = mformat; + mformat = fmtfl; + return temp; + } + + _UCXXEXPORT ios_base::fmtflags ios_base::setf(fmtflags fmtfl){ + return flags(flags() | fmtfl); + } + + _UCXXEXPORT ios_base::fmtflags ios_base::setf(fmtflags fmtfl, fmtflags mask ){ + return flags( (flags()& ~mask) | (fmtfl & mask)); + } + + _UCXXEXPORT streamsize ios_base::precision(streamsize prec){ + streamsize temp = mprecision; + mprecision = prec; + return temp; + } + + _UCXXEXPORT streamsize ios_base::width(streamsize wide){ + streamsize temp = mwidth; + mwidth = wide; + return temp; + } + + _UCXXEXPORT locale ios_base::imbue(const locale& loc){ + locale retval = mLocale; + mLocale = loc; + return retval; + } + +} + + + diff --git a/i386/modules/uClibcxx/.svn/text-base/iostream.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/iostream.cpp.svn-base new file mode 100644 index 0000000..7a190a2 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/iostream.cpp.svn-base @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_IOSTREAM__ 1 + +#include <iostream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template _UCXXEXPORT basic_iostream<char, char_traits<char> >:: + basic_iostream(basic_streambuf<char, char_traits<char> >* sb); + template _UCXXEXPORT basic_iostream<char, char_traits<char> >::~basic_iostream(); + +#endif +#endif + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/istream.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/istream.cpp.svn-base new file mode 100644 index 0000000..9e96139 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/istream.cpp.svn-base @@ -0,0 +1,75 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#define __UCLIBCXX_COMPILE_ISTREAM__ 1 + +#include <istream> + + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template <> _UCXXEXPORT string _readToken<char, char_traits<char> >(istream & stream) + { + string temp; + char_traits<char>::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != char_traits<char>::eof() && isspace(c) == false){ + stream.rdbuf()->sbumpc(); + temp.append(1, char_traits<char>::to_char_type(c)); + }else{ + break; + } + } + if (temp.size() == 0) + stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + + template _UCXXEXPORT istream::int_type istream::get(); + template _UCXXEXPORT istream & istream::get(char &c); + + template _UCXXEXPORT istream & istream::operator>>(bool &n); + template _UCXXEXPORT istream & istream::operator>>(short &n); + template _UCXXEXPORT istream & istream::operator>>(unsigned short &n); + template _UCXXEXPORT istream & istream::operator>>(int &n); + template _UCXXEXPORT istream & istream::operator>>(unsigned int &n); + template _UCXXEXPORT istream & istream::operator>>(long unsigned &n); + template _UCXXEXPORT istream & istream::operator>>(long int &n); + template _UCXXEXPORT istream & istream::operator>>(void *& p); + template _UCXXEXPORT istream & operator>>(istream & is, char & c); + + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template _UCXXEXPORT istream & istream::operator>>(float &f); + template _UCXXEXPORT istream & istream::operator>>(double &f); + template _UCXXEXPORT istream & istream::operator>>(long double &f); +#endif + + template _UCXXEXPORT void __skipws(basic_istream<char, char_traits<char> >& is); + +#endif + + +} + diff --git a/i386/modules/uClibcxx/.svn/text-base/iterator.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/iterator.cpp.svn-base new file mode 100644 index 0000000..2e21517 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/iterator.cpp.svn-base @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <iterator> + +namespace std{ + + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/limits.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/limits.cpp.svn-base new file mode 100644 index 0000000..0fd42d5 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/limits.cpp.svn-base @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <limits> + +namespace std{ + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/list.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/list.cpp.svn-base new file mode 100644 index 0000000..cfc44e0 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/list.cpp.svn-base @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <list> + +namespace std{ + + + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/locale.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/locale.cpp.svn-base new file mode 100644 index 0000000..bc41792 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/locale.cpp.svn-base @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <locale> +#include <cstring> +#include <string> +#include <stdexcept> +#include <cctype> + +namespace std{ + +} + diff --git a/i386/modules/uClibcxx/.svn/text-base/map.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/map.cpp.svn-base new file mode 100644 index 0000000..06e56a0 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/map.cpp.svn-base @@ -0,0 +1,33 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <map> + +namespace std{ + + + + + + + + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/new_handler.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/new_handler.cpp.svn-base new file mode 100644 index 0000000..1d85ee3 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/new_handler.cpp.svn-base @@ -0,0 +1,31 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> + +const std::nothrow_t std::nothrow = { }; + +//Name selected to be compatable with g++ code +std::new_handler __new_handler; + +_UCXXEXPORT std::new_handler std::set_new_handler(std::new_handler new_p) throw(){ + std::new_handler retval = __new_handler; + __new_handler = new_p; + return retval; +} diff --git a/i386/modules/uClibcxx/.svn/text-base/new_op.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/new_op.cpp.svn-base new file mode 100644 index 0000000..7fc7b1b --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/new_op.cpp.svn-base @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include <new> +#include <cstdlib> +#include <func_exception> + +extern "C" { +#include "libsaio.h" +}; + +_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc){ + //C++ stardard 5.3.4.8 requires that a valid pointer be returned for + //a call to new(0). Thus: + if(numBytes == 0){ + numBytes = 1; + } + void * p = malloc(numBytes); + if(p == 0){ + std::__throw_bad_alloc(); + } + return p; +} diff --git a/i386/modules/uClibcxx/.svn/text-base/new_opnt.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/new_opnt.cpp.svn-base new file mode 100644 index 0000000..68a2571 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/new_opnt.cpp.svn-base @@ -0,0 +1,31 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <new> +#include <cstdlib> +#include <func_exception> +extern "C" { +#include "libsaio.h" +}; +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(){ + return malloc(numBytes); +} +#endif diff --git a/i386/modules/uClibcxx/.svn/text-base/new_opv.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/new_opv.cpp.svn-base new file mode 100644 index 0000000..d156bdf --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/new_opv.cpp.svn-base @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <new> +#include <cstdlib> +#include <func_exception> +extern "C" { +#include "libsaio.h" +}; +_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc){ + //C++ stardard 5.3.4.8 requires that a valid pointer be returned for + //a call to new(0). Thus: + if(numBytes == 0){ + numBytes = 1; + } + void * p = malloc(numBytes); + if(p == 0){ + std::__throw_bad_alloc(); + } + return p; +} diff --git a/i386/modules/uClibcxx/.svn/text-base/new_opvnt.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/new_opvnt.cpp.svn-base new file mode 100644 index 0000000..57ccce8 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/new_opvnt.cpp.svn-base @@ -0,0 +1,31 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <new> +#include <cstdlib> +#include <func_exception> +extern "C" { +#include "libsaio.h" +}; +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(){ + return malloc(numBytes); +} +#endif diff --git a/i386/modules/uClibcxx/.svn/text-base/numeric.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/numeric.cpp.svn-base new file mode 100644 index 0000000..eb93f2e --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/numeric.cpp.svn-base @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <numeric> + +namespace std{ + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/ostream.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/ostream.cpp.svn-base new file mode 100644 index 0000000..0973871 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/ostream.cpp.svn-base @@ -0,0 +1,65 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_OSTREAM__ 1 + +#include <ostream> + +namespace std{ + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template _UCXXEXPORT ostream::~basic_ostream(); +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream & ostream::flush(); + + template _UCXXEXPORT ostream & ostream::operator<<(bool n); + template _UCXXEXPORT ostream & ostream::operator<<(short int n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned short int n); + template _UCXXEXPORT ostream & ostream::operator<<(int n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned int n); + template _UCXXEXPORT ostream & ostream::operator<<(long n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned long n); + template _UCXXEXPORT ostream & ostream::operator<<(float f); + template _UCXXEXPORT ostream & ostream::operator<<(double f); + template _UCXXEXPORT ostream & ostream::operator<<(long double f); + template _UCXXEXPORT ostream & ostream::operator<<(void* p); + template _UCXXEXPORT ostream & ostream::operator<<(basic_streambuf<char, char_traits<char> >* sb); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream::sentry::sentry(ostream & os); + template _UCXXEXPORT ostream::sentry::~sentry(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream & endl(ostream & os); + template _UCXXEXPORT ostream & flush(ostream & os); + template _UCXXEXPORT ostream & operator<<(ostream & out, char c); + template _UCXXEXPORT ostream & operator<<(ostream & out, const char* c); + template _UCXXEXPORT ostream & operator<<(ostream & out, unsigned char c); + template _UCXXEXPORT ostream & operator<<(ostream & out, const unsigned char* c); + +#endif + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/queue.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/queue.cpp.svn-base new file mode 100644 index 0000000..356efeb --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/queue.cpp.svn-base @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <queue> + + +namespace std{ + + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/set.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/set.cpp.svn-base new file mode 100644 index 0000000..61ec56a --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/set.cpp.svn-base @@ -0,0 +1,33 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <set> + +namespace std{ + + + + + + + + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/sstream.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/sstream.cpp.svn-base new file mode 100644 index 0000000..e712b67 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/sstream.cpp.svn-base @@ -0,0 +1,59 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_SSTREAM__ 1 + +#include <sstream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_SSTREAM_CHAR__ + + typedef char_traits<char> tr_ch; + typedef basic_stringbuf<char, tr_ch, allocator<char> > char_stringbuf; + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT char_stringbuf::basic_stringbuf(ios_base::openmode which); + template _UCXXEXPORT char_stringbuf::~basic_stringbuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_string<char, char_traits<char>, allocator<char> > char_stringbuf::str() const; + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::pbackfail(char_stringbuf::int_type c); + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::overflow(char_stringbuf::int_type c); + template _UCXXEXPORT char_stringbuf::pos_type + char_stringbuf::seekoff(char_stringbuf::off_type, ios_base::seekdir, ios_base::openmode); + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::underflow (); + template _UCXXEXPORT streamsize char_stringbuf::xsputn(const char* s, streamsize n); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_stringstream<char, tr_ch, allocator<char> >::basic_stringstream(ios_base::openmode which); + template _UCXXEXPORT basic_istringstream<char, tr_ch, allocator<char> >::~basic_istringstream(); + template _UCXXEXPORT basic_ostringstream<char, tr_ch, allocator<char> >::~basic_ostringstream(); + template _UCXXEXPORT basic_stringstream<char, tr_ch, allocator<char> >::~basic_stringstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/stack.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/stack.cpp.svn-base new file mode 100644 index 0000000..53a21bb --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/stack.cpp.svn-base @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <stack> + + +namespace std{ + + + + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/stdexcept.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/stdexcept.cpp.svn-base new file mode 100644 index 0000000..90dccc7 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/stdexcept.cpp.svn-base @@ -0,0 +1,63 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <stdexcept> + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + + _UCXXEXPORT logic_error::logic_error() throw() : mstring(){ + + } + + _UCXXEXPORT logic_error::logic_error(const string& what_arg) : mstring(what_arg){ + + } + + _UCXXEXPORT const char * logic_error::what() const throw(){ + return mstring.c_str(); + } + + + _UCXXEXPORT out_of_range::out_of_range() : logic_error(){ + + } + + _UCXXEXPORT out_of_range::out_of_range(const string & what_arg) : logic_error(what_arg) { + + } + + _UCXXEXPORT runtime_error::runtime_error() : mstring(){ + + } + + _UCXXEXPORT runtime_error::runtime_error(const string& what_arg) : mstring(what_arg){ + + } + + _UCXXEXPORT const char * runtime_error::what() const throw(){ + return mstring.c_str(); + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/.svn/text-base/streambuf.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/streambuf.cpp.svn-base new file mode 100644 index 0000000..5417324 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/streambuf.cpp.svn-base @@ -0,0 +1,49 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_STREAMBUF__ 1 + +#include <streambuf> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT streambuf::basic_streambuf(); + template _UCXXEXPORT streambuf::~basic_streambuf(); + +#endif + + template _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); + template _UCXXEXPORT streamsize streambuf::in_avail(); + template _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); + template _UCXXEXPORT streambuf::int_type streambuf::snextc(); + template _UCXXEXPORT streambuf::int_type streambuf::sgetc(); + template _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); + template _UCXXEXPORT streambuf::int_type streambuf::sungetc(); + template _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); + +#endif + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/string.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/string.cpp.svn-base new file mode 100644 index 0000000..1edf69b --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/string.cpp.svn-base @@ -0,0 +1,112 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_STRING__ 1 + +#include <basic_definitions> +#include <char_traits> +#include <string> +#include <string_iostream> +#include <string.h> +#include <ostream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT string::basic_string(const allocator<char> &); + template _UCXXEXPORT string::basic_string(size_type n, char c, const allocator<char> & ); + template _UCXXEXPORT string::basic_string(const char* s, const allocator<char>& al); + template _UCXXEXPORT string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator<char>& al); + template _UCXXEXPORT string::~basic_string(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT string & string::append(const char * s, size_type n); + + template _UCXXEXPORT string::size_type string::find(const string & str, size_type pos) const; + template _UCXXEXPORT string::size_type string::find(const char* s, size_type pos) const; + template _UCXXEXPORT string::size_type string::find (char c, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(const string & str, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(char c, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(const char* s, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_first_of(const string &, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_of(const char *, size_type pos, size_type n) const; + template _UCXXEXPORT string::size_type string::find_first_of(const char*, size_type pos) const; + template _UCXXEXPORT string::size_type string::find_first_of(char c, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_last_of (const string & , size_type pos) const; + template _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos, size_type n) const; + template _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos) const; + template _UCXXEXPORT string::size_type string::find_last_of (char c, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_first_not_of(const string &, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(char c, size_type) const; + + template _UCXXEXPORT int string::compare(const string & str) const; +// template _UCXXEXPORT int string::compare(size_type pos1, size_type n1, const string & str) const; + template _UCXXEXPORT int string::compare( + size_type pos1, size_type n1, const string & str, size_type pos2, size_type n2) const; + + template _UCXXEXPORT string string::substr(size_type pos, size_type n) const; + + template _UCXXEXPORT string & string::operator=(const string & str); + template _UCXXEXPORT string & string::operator=(const char * s); + + template _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); + template _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); + + template _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); + template _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); + + template _UCXXEXPORT string operator+(const string & lhs, const char* rhs); + template _UCXXEXPORT string operator+(const char* lhs, const string & rhs); + template _UCXXEXPORT string operator+(const string & lhs, const string & rhs); + + template _UCXXEXPORT bool operator> (const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator< (const string & lhs, const string & rhs); + + +//Functions dependent upon OSTREAM +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ + +template _UCXXEXPORT ostream & operator<<(ostream & os, const string & str); + +#endif + + +//Functions dependent upon ISTREAM +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + +template _UCXXEXPORT istream & operator>>(istream & is, string & str); + + +#endif + + +#endif + +} diff --git a/i386/modules/uClibcxx/.svn/text-base/support.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/support.cpp.svn-base new file mode 100644 index 0000000..afae7ac --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/support.cpp.svn-base @@ -0,0 +1,54 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <support> +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +extern "C" void *__cxa_allocate_exception(size_t thrown_size) +{ + void * retval; + + /*The amount of data needed is the size of the object *PLUS* + the size of the header. The header is of struct __cxa_exception + The address needs to be adjusted because the pointer we return + should not point to the start of the memory, but to the point + where the object being thrown actually starts*/ + + retval = malloc(thrown_size + sizeof(__cxa_exception)); + +// Check to see that we actuall allocated memory + if(retval == 0){ + std::terminate(); + } + + //Need to do a typecast to char* otherwize we are doing math with + //a void* which makes the compiler cranky (Like me) + return ((char *)retval + sizeof(__cxa_exception)); +} + +extern "C" void __cxa_free_exception(void *thrown_exception){ + + + +} + +extern "C" void __cxa_throw (void *thrown_exception, std::type_info *tinfo,void (*dest) (void *) ){ + +} +#endif + diff --git a/i386/modules/uClibcxx/.svn/text-base/typeinfo.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/typeinfo.cpp.svn-base new file mode 100644 index 0000000..b8ea301 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/typeinfo.cpp.svn-base @@ -0,0 +1,34 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <typeinfo> + +namespace std{ + + _UCXXEXPORT bad_cast::~bad_cast() throw(){ + + } + + _UCXXEXPORT bad_typeid::~bad_typeid() throw(){ + + } + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/uClibc++.c.svn-base b/i386/modules/uClibcxx/.svn/text-base/uClibc++.c.svn-base new file mode 100644 index 0000000..cdc6993 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/uClibc++.c.svn-base @@ -0,0 +1,12 @@ +#include "libsaio.h" + +void uClibcxx_start() +{ +} + +void abort() +{ + stop("uClibc+: abort()\n"); +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/utility.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/utility.cpp.svn-base new file mode 100644 index 0000000..b2f8995 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/utility.cpp.svn-base @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <utility> + + +namespace std{ + + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/valarray.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/valarray.cpp.svn-base new file mode 100644 index 0000000..e4bd504 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/valarray.cpp.svn-base @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <valarray> + +namespace std{ + + + + +} + + diff --git a/i386/modules/uClibcxx/.svn/text-base/vector.cpp.svn-base b/i386/modules/uClibcxx/.svn/text-base/vector.cpp.svn-base new file mode 100644 index 0000000..5ee0de1 --- /dev/null +++ b/i386/modules/uClibcxx/.svn/text-base/vector.cpp.svn-base @@ -0,0 +1,83 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_VECTOR__ 1 + + +#include <vector> + +namespace std{ + + +#ifdef __UCLIBCXX_EXPAND_VECTOR_BASIC__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + + template _UCXXEXPORT vector<char, allocator<char> >::~vector(); + template _UCXXEXPORT vector<unsigned char, allocator<unsigned char> >::~vector(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned char, allocator<unsigned char> >::reserve(size_type n); + template _UCXXEXPORT void vector<short int, allocator<short int> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned short int, allocator<unsigned short int> >::reserve(size_type n); + template _UCXXEXPORT void vector<int, allocator<int> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::reserve(size_type n); + template _UCXXEXPORT void vector<long int, allocator<long int> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned long int, allocator<unsigned long int> >::reserve(size_type n); + template _UCXXEXPORT void vector<float, allocator<float> >::reserve(size_type n); + template _UCXXEXPORT void vector<double, allocator<double> >::reserve(size_type n); + template _UCXXEXPORT void vector<bool, allocator<bool> >::reserve(size_type n); + + template _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + template _UCXXEXPORT void vector<unsigned char, allocator<unsigned char> >::resize(size_type sz, const unsigned char & c); + template _UCXXEXPORT void vector<short int, allocator<short int> >::resize(size_type sz, const short & c); + template _UCXXEXPORT void vector<unsigned short int, allocator<unsigned short int> > + ::resize(size_type sz, const unsigned short int & c); + template _UCXXEXPORT void vector<int, allocator<int> >::resize(size_type sz, const int & c); + template _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::resize(size_type sz, const unsigned int & c); + template _UCXXEXPORT void vector<long int, allocator<long int> >::resize(size_type sz, const long int & c); + template _UCXXEXPORT void vector<unsigned long int, allocator<unsigned long int> >:: + resize(size_type sz, const unsigned long int & c); + template _UCXXEXPORT void vector<float, allocator<float> >::resize(size_type sz, const float & c); + template _UCXXEXPORT void vector<double, allocator<double> >::resize(size_type sz, const double & c); + template _UCXXEXPORT void vector<bool, allocator<bool> >::resize(size_type sz, const bool & c); + +#elif defined __UCLIBCXX_EXPAND_STRING_CHAR__ + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + template _UCXXEXPORT vector<char, allocator<char> >::~vector(); +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + +#endif + + + + +} diff --git a/i386/modules/uClibcxx/Cconfig b/i386/modules/uClibcxx/Cconfig new file mode 100644 index 0000000..db766d2 --- /dev/null +++ b/i386/modules/uClibcxx/Cconfig @@ -0,0 +1,11 @@ +# +# Chameleon Modules +# + +config UCLIBCXX_MODULE + tristate "uClibc++ Module" + default m + depends on KLIBC_MODULE + ---help--- + Say Y here if you want to enable the use of this module. + diff --git a/i386/modules/uClibcxx/Makefile b/i386/modules/uClibcxx/Makefile new file mode 100644 index 0000000..1a65f1d --- /dev/null +++ b/i386/modules/uClibcxx/Makefile @@ -0,0 +1,22 @@ +MODULE_NAME = uClibcxx +MODULE_DESCRIPTION = This module provides a minimalistic c++ runtime library for use in other modules. This does not provide functionality by itself, instead it is used to allow for the c++ language to be used in other modules. Please note that rtti and exceptions has both been disabled. +MODULE_AUTHOR = +MODULE_VERSION = "0.2.2" +MODULE_COMPAT_VERSION = "0.2.2" +MODULE_START = $(MODULE_NAME)_start +MODULE_DEPENDENCIES = klibc + +DIR = uClibc++ +# sstream.o fstream.o +MODULE_OBJS = uClibc++.o abi.o algorithm.o associative_base.o bitset.o \ + complex.o del_op.o del_opnt.o del_opv.o del_opvnt.o \ + deque.o eh_alloc.o eh_globals.o exception.o \ + func_exception.o iomanip.o char_traits.o \ + iterator.o limits.o list.o locale.o \ + map.o new_handler.o new_op.o new_opnt.o new_opv.o \ + new_opvnt.o numeric.o queue.o set.o \ + stack.o stdexcept.o streambuf.o string.o typeinfo.o \ + utility.o valarray.o vector.o support.o \ + ios.o iostream.o istream.o ostream.o + +include ../MakeInc.dir \ No newline at end of file diff --git a/i386/modules/uClibcxx/Readme.txt b/i386/modules/uClibcxx/Readme.txt new file mode 100644 index 0000000..b2c8f68 --- /dev/null +++ b/i386/modules/uClibcxx/Readme.txt @@ -0,0 +1,4 @@ +Module: uClibc++ +Source: http://cxx.uclibc.org/ +Description: This module provides a minimalistic c++ runtime library for use in other modules. This does not provide functionality by itself, instead it is used to allow for the c++ language to be used in other modules. Please note that rtti and exceptions has both been disabled. +Dependencies: klibc diff --git a/i386/modules/uClibcxx/abi.cpp b/i386/modules/uClibcxx/abi.cpp new file mode 100644 index 0000000..386f35a --- /dev/null +++ b/i386/modules/uClibcxx/abi.cpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc C++ Library. This library is free + software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) + any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this library; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. +*/ + +#include <cstdlib> +#include <typeinfo> +#include <basic_definitions> + +/* This file implements a number of the language support features + * needed to deal with the C++ abi, as originally documented in the + * Itanium C++ ABI, though now industry standard + */ + +extern "C" { + + /* This function is called in the event that a non-overidden + * pure virtual function is called. The compiler should never + * let that happen. We get to choose what to do - we will abort + */ + void __cxa_pure_virtual (){ + abort(); + } + +} diff --git a/i386/modules/uClibcxx/algorithm.cpp b/i386/modules/uClibcxx/algorithm.cpp new file mode 100644 index 0000000..e21b14e --- /dev/null +++ b/i386/modules/uClibcxx/algorithm.cpp @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <algorithm> + + +namespace std{ + + + +} + + diff --git a/i386/modules/uClibcxx/associative_base.cpp b/i386/modules/uClibcxx/associative_base.cpp new file mode 100644 index 0000000..cc2d20e --- /dev/null +++ b/i386/modules/uClibcxx/associative_base.cpp @@ -0,0 +1,26 @@ +/* Copyright (C) 2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <associative_base> + +namespace std{ + + + +} diff --git a/i386/modules/uClibcxx/bitset.cpp b/i386/modules/uClibcxx/bitset.cpp new file mode 100644 index 0000000..f1ece31 --- /dev/null +++ b/i386/modules/uClibcxx/bitset.cpp @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <bitset> + +namespace std{ + + + +} diff --git a/i386/modules/uClibcxx/char_traits.cpp b/i386/modules/uClibcxx/char_traits.cpp new file mode 100644 index 0000000..2a91bd9 --- /dev/null +++ b/i386/modules/uClibcxx/char_traits.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#define __UCLIBCXX_COMPILE_CHAR_TRAITS__ 1 + + +#include <basic_definitions> +#include <char_traits> + +namespace std{ + +_UCXXEXPORT const char_traits<char>::char_type* char_traits<char>::find(const char_type* s, int n, const char_type& a){ + for(int i=0; i < n; i++){ + if(eq(s[i], a)){ + return (s+i); + } + } + return 0; +} + +_UCXXEXPORT bool char_traits<char>::eq(const char_type& c1, const char_type& c2){ + if(strncmp(&c1, &c2, 1) == 0){ + return true; + } + return false; +} + +_UCXXEXPORT char_traits<char>::char_type char_traits<char>::to_char_type(const int_type & i){ + if(i > 0 && i <= 255){ + return (char)(unsigned char)i; + } + + //Out of range + return 0; +} + + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +_UCXXEXPORT const char_traits<wchar_t>::char_type* char_traits<wchar_t>::find(const char_type* s, int n, const char_type& a){ + for(int i=0; i < n; i++){ + if(eq(s[i], a)){ + return (s+i); + } + } + return 0; +} + +#endif + +} diff --git a/i386/modules/uClibcxx/complex.cpp b/i386/modules/uClibcxx/complex.cpp new file mode 100644 index 0000000..6b895a8 --- /dev/null +++ b/i386/modules/uClibcxx/complex.cpp @@ -0,0 +1,28 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <complex> + + +namespace std{ + + + template class _UCXXEXPORT complex<float>; + + +} diff --git a/i386/modules/uClibcxx/del_op.cpp b/i386/modules/uClibcxx/del_op.cpp new file mode 100644 index 0000000..f5a3695 --- /dev/null +++ b/i386/modules/uClibcxx/del_op.cpp @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +_UCXXEXPORT void operator delete(void* ptr) throw(){ + free(ptr); +} diff --git a/i386/modules/uClibcxx/del_opnt.cpp b/i386/modules/uClibcxx/del_opnt.cpp new file mode 100644 index 0000000..96cb03b --- /dev/null +++ b/i386/modules/uClibcxx/del_opnt.cpp @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +#ifndef NO_NOTHROW +_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw() { + free(ptr); +} +#endif diff --git a/i386/modules/uClibcxx/del_opv.cpp b/i386/modules/uClibcxx/del_opv.cpp new file mode 100644 index 0000000..028e86f --- /dev/null +++ b/i386/modules/uClibcxx/del_opv.cpp @@ -0,0 +1,26 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +_UCXXEXPORT void operator delete[](void * ptr) throw(){ + free(ptr); +} diff --git a/i386/modules/uClibcxx/del_opvnt.cpp b/i386/modules/uClibcxx/del_opvnt.cpp new file mode 100644 index 0000000..f2a2a36 --- /dev/null +++ b/i386/modules/uClibcxx/del_opvnt.cpp @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstdlib> +#include <func_exception> + +#ifndef NO_NOTHROW +_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(){ + free(ptr); +} +#endif diff --git a/i386/modules/uClibcxx/deque.cpp b/i386/modules/uClibcxx/deque.cpp new file mode 100644 index 0000000..c515580 --- /dev/null +++ b/i386/modules/uClibcxx/deque.cpp @@ -0,0 +1,42 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <deque> + + +namespace std{ + + + + + + + + + + + + + + +} + + + + diff --git a/i386/modules/uClibcxx/eh_alloc.cpp b/i386/modules/uClibcxx/eh_alloc.cpp new file mode 100644 index 0000000..bc0ea00 --- /dev/null +++ b/i386/modules/uClibcxx/eh_alloc.cpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation, version 2.1 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstdlib> +#include <cstring> +#include <func_exception> + +//This is a system-specific header which does all of the error-handling management +#include <unwind-cxx.h> + +namespace __cxxabiv1{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw(){ + void *retval; + //The sizeof crap is required by Itanium ABI because we need to provide space for + //accounting information which is implementaion (gcc) specified + retval = malloc (thrown_size + sizeof(__cxa_exception)); + if(0 == retval){ + std::terminate(); + } + memset (retval, 0, sizeof(__cxa_exception)); + return (void *)((unsigned char *)retval + sizeof(__cxa_exception)); +} + +extern "C" void __cxa_free_exception(void *vptr) throw(){ + free( (char *)(vptr) - sizeof(__cxa_exception) ); +} +#endif +} diff --git a/i386/modules/uClibcxx/eh_globals.cpp b/i386/modules/uClibcxx/eh_globals.cpp new file mode 100644 index 0000000..3d320db --- /dev/null +++ b/i386/modules/uClibcxx/eh_globals.cpp @@ -0,0 +1,44 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation, version 2.1 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstdlib> +#include <cstring> +#include <func_exception> + +//This is a system-specific header which does all of the error-handling management +#include <unwind-cxx.h> + +//The following functionality is derived from reading of the GNU libstdc++ code and making it...simple + + +namespace __cxxabiv1{ +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +static __UCLIBCXX_TLS __cxa_eh_globals eh_globals; + +extern "C" __cxa_eh_globals* __cxa_get_globals() throw(){ + return &eh_globals; +} + +extern "C" __cxa_eh_globals* __cxa_get_globals_fast() throw(){ + return &eh_globals; +} +#endif + +} diff --git a/i386/modules/uClibcxx/exception.cpp b/i386/modules/uClibcxx/exception.cpp new file mode 100644 index 0000000..828933a --- /dev/null +++ b/i386/modules/uClibcxx/exception.cpp @@ -0,0 +1,87 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <exception> +#include <func_exception> +#include <stdexcept> +#include <cstdlib> + +//We can't do this yet because gcc is too stupid to be able to handle +//different implementations of exception class. + +//#undef __UCLIBCXX_EXCEPTION_SUPPORT__ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + _UCXXEXPORT static const char * __std_exception_what_value = "exception"; + + //We are providing our own versions to be sneaky + + + _UCXXEXPORT exception::~exception() throw(){ + //Empty function + } + + _UCXXEXPORT const char* exception::what() const throw(){ + return __std_exception_what_value; + } + + _UCXXEXPORT bad_exception::~bad_exception() throw(){ + + } + +} +#else +namespace std{ + _UCXXEXPORT exception::~exception() { + abort(); + } + + _UCXXEXPORT const char* exception::what() const { + abort(); + } + + _UCXXEXPORT bad_exception::~bad_exception() { + abort(); + } + +} +#endif + +void +std::terminate() +{ +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + try + { +#endif // __UCLIBCXX_EXCEPTION_SUPPORT__ + (*std::terminate_handler())(); + // handler should not return + abort (); +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + } + catch (...) + { + // handler should not throw exception + abort (); + } +#endif // __UCLIBCXX_EXCEPTION_SUPPORT__ +} diff --git a/i386/modules/uClibcxx/fstream.cpp b/i386/modules/uClibcxx/fstream.cpp new file mode 100644 index 0000000..535fe9a --- /dev/null +++ b/i386/modules/uClibcxx/fstream.cpp @@ -0,0 +1,174 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_FSTREAM__ 1 + +#include <fstream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT filebuf::basic_filebuf(); + template _UCXXEXPORT filebuf::~basic_filebuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT filebuf::int_type filebuf::pbackfail(filebuf::int_type c); + template _UCXXEXPORT filebuf * filebuf::open(const char* s, ios_base::openmode mode); + template _UCXXEXPORT filebuf * filebuf::close(); + template _UCXXEXPORT filebuf::int_type filebuf::overflow(filebuf::int_type); + template _UCXXEXPORT filebuf::int_type filebuf::underflow (); + template _UCXXEXPORT streamsize filebuf::xsputn(const char* s, streamsize n); + + template _UCXXEXPORT basic_streambuf<char, char_traits<char> >* + filebuf::setbuf(char * s, streamsize n); + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(); + template _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(const char* s, ios_base::openmode mode); + template _UCXXEXPORT basic_ofstream<char, char_traits<char> >::~basic_ofstream(); + + template _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(); + template _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(const char* s, ios_base::openmode mode); + template _UCXXEXPORT basic_ifstream<char, char_traits<char> >::~basic_ifstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + +#endif + + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::overflow(int_type c) +{ + typedef basic_streambuf<wchar_t, char_traits<wchar_t> > wstreambuf; + typedef char_traits<wchar_t> wtraits; + + if(is_open() == false){ + //Can't do much + return wtraits::eof(); + } + + mbstate_t ps = { 0 }; + char out_array[8]; + size_t out_size; + + + if( wstreambuf::pbase() != 0 ){ + + //Write all possible character from the existing array first + size_t chars_written = 0; + while(wstreambuf::pbase() && (wstreambuf::pbase() + chars_written !=wstreambuf::pptr()) ){ + out_size = wcrtomb(out_array, wstreambuf::pbase()[chars_written], &ps); + if(out_size == (size_t)(-1) || fwrite(out_array, out_size, 1, fp) == 0){ + break; + } + ++chars_written; + } + + if( wstreambuf::pbase() + chars_written == wstreambuf::pptr() ){ + wstreambuf::pbump(-chars_written); + }else{ + //Shuffle data back into order + size_t chars_left = wstreambuf::pptr() - wstreambuf::pbase() - chars_written; + for(size_t i = 0; i < chars_left; ++i){ + wstreambuf::pbase()[i] = (wstreambuf::pptr() - chars_written)[i]; + } + return wtraits::eof(); + } + } + + if( !wtraits::eq_int_type(c, wtraits::eof()) ){ + out_size = wcrtomb(out_array, c, &ps); + if(out_size == (size_t)(-1) || fwrite(out_array, out_size, 1, fp) == 0){ + return wtraits::eof(); + } + return c; + } + + return wtraits::not_eof(c); +} + + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::underflow() +{ + /*Some variables used internally: + Buffer pointers: + + charT * mgbeg; + charT * mgnext; + charT * mgend; + + eback() returns mgbeg + gptr() returns mgnext + egptr() returns mgend + + gbump(int n) mgnext+=n + */ + + typedef char_traits<wchar_t> traits; + typedef basic_streambuf<wchar_t, traits> wstreambuf; + + + if(wstreambuf::eback() == wstreambuf::gptr() && 0 != wstreambuf::eback()){ //Buffer is full + return traits::to_int_type(*wstreambuf::gptr()); + } + + size_t in_size; + + wchar_t c = 0; + wint_t wi = 0; + in_size = 0; + + wi = fgetwc(fp); + if(WEOF == wi){ + fprintf(stderr, "WEOF returned by fgetwc\n"); + return traits::eof(); + } + + c = traits::to_char_type(wi); + + if(wstreambuf::eback() == 0){ + return traits::to_int_type(c); + } + + for(wchar_t * i = wstreambuf::gptr(); i < wstreambuf::egptr(); ++i){ + *(i-1) = *i; + } + + *(wstreambuf::egptr()-1) = c; + + wstreambuf::mgnext -= 1; + + return traits::to_int_type(*wstreambuf::gptr()); +} + +#endif // __UCLIBCXX_HAS_WCHAR__ + + +} diff --git a/i386/modules/uClibcxx/func_exception.cpp b/i386/modules/uClibcxx/func_exception.cpp new file mode 100644 index 0000000..fab095f --- /dev/null +++ b/i386/modules/uClibcxx/func_exception.cpp @@ -0,0 +1,87 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <func_exception> +#include <stdexcept> +#include <cstdlib> + +namespace std{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +_UCXXEXPORT void __throw_bad_alloc(){ + throw bad_alloc(); +} + +_UCXXEXPORT void __throw_out_of_range( const char * message){ + if(message == 0){ + throw out_of_range(); + } + throw out_of_range(message); +} + +_UCXXEXPORT void __throw_overflow_error( const char * message){ + if(message == 0){ + throw overflow_error(); + } + throw overflow_error(message); +} + +_UCXXEXPORT void __throw_length_error(const char * message){ + if(message == 0){ + throw length_error(); + } + throw length_error(message); +} + +_UCXXEXPORT void __throw_invalid_argument(const char * message){ + if(message == 0){ + throw invalid_argument(); + } + throw invalid_argument(message); +} + +#else + +_UCXXEXPORT void __throw_bad_alloc(){ + abort(); +} + +_UCXXEXPORT void __throw_out_of_range( const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_overflow_error( const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_length_error(const char * ){ + abort(); +} + +_UCXXEXPORT void __throw_invalid_argument(const char *){ + abort(); +} + +#endif + + + +} diff --git a/i386/modules/uClibcxx/include/.svn/all-wcprops b/i386/modules/uClibcxx/include/.svn/all-wcprops new file mode 100644 index 0000000..0f1d192 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/all-wcprops @@ -0,0 +1,395 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include +END +iostream +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/iostream +END +cstdio +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cstdio +END +cstdarg +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cstdarg +END +unwind-cxx.h +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/unwind-cxx.h +END +map.old +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/map.old +END +iomanip +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/iomanip +END +numeric +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/numeric +END +utility +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/utility +END +type_traits +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/type_traits +END +cwchar +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cwchar +END +set.old +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/set.old +END +memory +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/memory +END +cstddef +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cstddef +END +map +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/map +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/Makefile +END +cstdlib +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cstdlib +END +cctype +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cctype +END +iterator +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/iterator +END +bitset +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/bitset +END +set +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/set +END +iosfwd +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/iosfwd +END +cmath +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cmath +END +system_configuration.h +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/system_configuration.h +END +limits +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/limits +END +functional +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/functional +END +types +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/types +END +istream +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/istream +END +stack +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/stack +END +csetjmp +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/csetjmp +END +string +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/string +END +complex +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/complex +END +cfloat +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cfloat +END +ostream +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/ostream +END +sstream +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/sstream +END +csignal +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/csignal +END +valarray +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/valarray +END +iterator_base +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/iterator_base +END +istream_helpers +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/istream_helpers +END +algorithm +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/algorithm +END +ostream_helpers +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/ostream_helpers +END +typeinfo +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/typeinfo +END +exception +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/exception +END +locale +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/locale +END +vector +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/vector +END +stdexcept +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/stdexcept +END +deque +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/deque +END +climits +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/climits +END +cstring +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cstring +END +list +K 25 +svn:wc:ra_dav:version-url +V 80 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/list +END +basic_definitions +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/basic_definitions +END +cwctype +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cwctype +END +queue +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/queue +END +streambuf +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/streambuf +END +cerrno +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cerrno +END +new +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/new +END +ios +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/ios +END +ctime +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/ctime +END +fstream +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/fstream +END +clocale +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/clocale +END +char_traits +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/char_traits +END +cassert +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/cassert +END +associative_base +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/associative_base +END +string_iostream +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/string_iostream +END +func_exception +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/func_exception +END +support +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/modules/uClibcxx/include/support +END diff --git a/i386/modules/uClibcxx/include/.svn/entries b/i386/modules/uClibcxx/include/.svn/entries new file mode 100644 index 0000000..e611f66 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/entries @@ -0,0 +1,2238 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/modules/uClibcxx/include +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +iostream +file + + + + +2013-08-27T23:55:02.000000Z +51678505f31fdf3bbe82edaad291de6c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2590 + +cstdio +file + + + + +2013-08-27T23:55:02.000000Z +9a1ec2d41c6ab9863a174462e070d453 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1594 + +cstdarg +file + + + + +2013-08-27T23:55:02.000000Z +4dfcfde28503cc82a31bf2825b8e2162 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2060 + +unwind-cxx.h +file + + + + +2013-08-27T23:55:02.000000Z +05b94f46446e8c2ae9762fd03890e5b3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5645 + +map.old +file + + + + +2013-08-27T23:55:02.000000Z +532de1844da8ec17272084d5a80b29b4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +36306 + +iomanip +file + + + + +2013-08-27T23:55:02.000000Z +a3d7e9e05cc00184c77f61196cef8404 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3573 + +numeric +file + + + + +2013-08-27T23:55:02.000000Z +9e7c1e1172eb1d6f3d4064ae7bf59e26 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3711 + +utility +file + + + + +2013-08-27T23:55:02.000000Z +e68c8c1274792287ec5fc50fab048c3c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2586 + +type_traits +file + + + + +2013-08-27T23:55:02.000000Z +58d8b747a9517a5068cc3ea6a38e0b5d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2107 + +cwchar +file + + + + +2013-08-27T23:55:02.000000Z +a048f5b85e47c89bb333f00c580f9c42 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1830 + +set.old +file + + + + +2013-08-27T23:55:02.000000Z +d6dba57edb3f5b13921173817424911e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +43625 + +memory +file + + + + +2013-08-27T23:55:02.000000Z +e2d3bb0a36930591b14a19f9f524d5e8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4472 + +cstddef +file + + + + +2013-08-27T23:55:02.000000Z +2aac2211314c34825ca2755d75f9714c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1964 + +map +file + + + + +2013-08-27T23:55:02.000000Z +c3d1b4133306e2451965a9a9f9c00dc9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9076 + +Makefile +file + + + + +2013-08-27T23:55:02.000000Z +b0312d64fd9ecdb89431e1ac3dd78889 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +255 + +cstdlib +file + + + + +2013-08-27T23:55:02.000000Z +ac44950854662bc12786bd0b5ea3dfcd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1538 + +cctype +file + + + + +2013-08-27T23:55:02.000000Z +398f0081e8d3ea035ca0752a9da99e09 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1076 + +iterator +file + + + + +2013-08-27T23:55:02.000000Z +4541e2dfaaf2ac9d2380815b0bbe2d80 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7408 + +bitset +file + + + + +2013-08-27T23:55:02.000000Z +198ebf8cd10e97b6056cae674db85bfb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +9148 + +set +file + + + + +2013-08-27T23:55:02.000000Z +b05afbde0ab432f3094bb2b4bcee6636 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12589 + +iosfwd +file + + + + +2013-08-27T23:55:02.000000Z +8aa14ea55514ca5f3a66d49037d68728 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3942 + +cmath +file + + + + +2013-08-27T23:55:02.000000Z +1f6332ff4059d87f7dfcb8bbf99e05dd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4479 + +system_configuration.h +file + + + + +2013-08-27T23:55:02.000000Z +570ede6ccccf5d0927e09509eaaa3f7e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1581 + +limits +file + + + + +2013-08-27T23:55:02.000000Z +4b347338aed00597ab578819c75a59d1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17207 + +functional +file + + + + +2013-08-27T23:55:02.000000Z +6573e6d62f24ed48a18b4ab3d771b636 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12830 + +types +file + + + + +2013-08-27T23:55:02.000000Z +09e750138079054deedbc37f237f756f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +34 + +istream +file + + + + +2013-08-27T23:55:02.000000Z +bb209d43da692d332af08a8dedf33d4d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17966 + +stack +file + + + + +2013-08-27T23:55:02.000000Z +5dcde9902a5f0fc8a62f5b8685e9091e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2396 + +csetjmp +file + + + + +2013-08-27T23:55:02.000000Z +5c26789aed68defa9a2441223c0c54b3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1117 + +string +file + + + + +2013-08-27T23:55:02.000000Z +475047f87f1fcabc1b47b3b976e3b915 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +29987 + +complex +file + + + + +2013-08-27T23:55:02.000000Z +84629a26196970e3da359e16128af6ab +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8756 + +cfloat +file + + + + +2013-08-27T23:55:02.000000Z +0da330173e39fe4e3c361bedb88c4dc6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +913 + +ostream +file + + + + +2013-08-27T23:55:02.000000Z +605fd25f265ae11b6e4a2a7d811b2ed3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15158 + +sstream +file + + + + +2013-08-27T23:55:02.000000Z +3238b6d70e24102054c16a6e96c098de +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11161 + +csignal +file + + + + +2013-08-27T23:55:02.000000Z +931704e74743597b83307a477bf96531 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2088 + +valarray +file + + + + +2013-08-27T23:55:02.000000Z +0747c0b52bb2afeda52d8763e5f598a9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +26092 + +iterator_base +file + + + + +2013-08-27T23:55:02.000000Z +6fc1c31daa942e1454f262a85fda0867 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11162 + +istream_helpers +file + + + + +2013-08-27T23:55:02.000000Z +2a0180155c4db2e6ed0ea3e52e5eca67 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +10016 + +algorithm +file + + + + +2013-08-27T23:55:02.000000Z +bf283df1bd2904f7ab01c72e23bd636e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +41823 + +ostream_helpers +file + + + + +2013-08-27T23:55:02.000000Z +bd7a5945a427b14759140f15ec54474b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15626 + +typeinfo +file + + + + +2013-08-27T23:55:02.000000Z +0c3dd9677832a89a527ee3eadc26942f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5331 + +exception +file + + + + +2013-08-27T23:55:02.000000Z +0366f6bccff5622c123dd3ea9d59984d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4567 + +locale +file + + + + +2013-08-27T23:55:02.000000Z +0a7a9dbd4b50a798ff639fc4f945dd41 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1815 + +vector +file + + + + +2013-08-27T23:55:02.000000Z +4404adc2f7d1655cca347842a68b0220 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +15514 + +stdexcept +file + + + + +2013-08-27T23:55:02.000000Z +999e94ecdc90dc30ac32c032da551a11 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2962 + +deque +file + + + + +2013-08-27T23:55:02.000000Z +c07f6ff79199fcfd376dece517e4ecd8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22129 + +climits +file + + + + +2013-08-27T23:55:02.000000Z +3a1c608ab9f2adb43a36ac440471568f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +895 + +cstring +file + + + + +2013-08-27T23:55:02.000000Z +d97e80b35288913ff0493fe033f0b9e0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1850 + +list +file + + + + +2013-08-27T23:55:02.000000Z +4ad5a792d2290c8eca214b227d4b918d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +22858 + +basic_definitions +file + + + + +2013-08-27T23:55:02.000000Z +47f834671933c2f966cd7efa32777adf +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1583 + +cwctype +file + + + + +2013-08-27T23:55:02.000000Z +b77c54f1206da3f95f1e4a8e0c9312c6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2893 + +queue +file + + + + +2013-08-27T23:55:02.000000Z +8beaaa263822aea3e6d8f44e07fff9f6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3713 + +streambuf +file + + + + +2013-08-27T23:55:02.000000Z +1f8a1628d028557b25c39622704ba150 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7910 + +cerrno +file + + + + +2013-08-27T23:55:02.000000Z +e9bfc8d2f7bd679305f5ce7963275418 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +821 + +new +file + + + + +2013-08-27T23:55:02.000000Z +d30cd04ed0608695997d5f85dc04330b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2090 + +ios +file + + + + +2013-08-27T23:55:02.000000Z +35ec0f327a52b71f17a5ca5caf7f2b52 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11861 + +ctime +file + + + + +2013-08-27T23:55:02.000000Z +397cedfb3a40007c4df08cf1bb77f70b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2374 + +fstream +file + + + + +2013-08-27T23:55:02.000000Z +7f2ca31d665b53f555941c94fc08ec95 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18842 + +clocale +file + + + + +2013-08-27T23:55:02.000000Z +8a810c330ecbab4b2895873748bdecc8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +991 + +char_traits +file + + + + +2013-08-27T23:55:02.000000Z +d3af9d190e77409d99303cf55402669f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3019 + +cassert +file + + + + +2013-08-27T23:55:02.000000Z +de4948e1bf9e3c1cb9ba0c3f4885a4b7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +822 + +associative_base +file + + + + +2013-08-27T23:55:02.000000Z +6671a3499117ffa632432352cf319823 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18210 + +func_exception +file + + + + +2013-08-27T23:55:02.000000Z +9c62f213774b6ebcce777ffd0b194f15 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1282 + +string_iostream +file + + + + +2013-08-27T23:55:02.000000Z +7c5b4c5d579347d09a27bb98f80f79e8 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3460 + +support +file + + + + +2013-08-27T23:55:02.000000Z +29bea9eee1180a234bcff4fd9b6a08d6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6172 + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/Makefile.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..b5c2694 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/Makefile.svn-base @@ -0,0 +1,13 @@ +TOPDIR=../ +include $(TOPDIR)Rules.mak + +all: + +clean: + +distclean: + +HEADERS = $(filter-out .svn CVS Makefile,$(wildcard *)) +install: + $(INSTALL) -d $(PREFIX)$(UCLIBCXX_RUNTIME_INCLUDEDIR) + $(INSTALL) -m 644 $(HEADERS) $(PREFIX)$(UCLIBCXX_RUNTIME_INCLUDEDIR) diff --git a/i386/modules/uClibcxx/include/.svn/text-base/algorithm.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/algorithm.svn-base new file mode 100644 index 0000000..f6b8856 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/algorithm.svn-base @@ -0,0 +1,1691 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstdlib> +#include <iterator> +#include <utility> +#include <functional> + +#ifndef __STD_HEADER_ALGORITHM +#define __STD_HEADER_ALGORITHM 1 + +//Elliminate any previously defined macro +#undef min +#undef max + +namespace std{ + + // subclause _lib.alg.nonmodifying_, non-modifying sequence operations: + template<class InputIterator, class Function> _UCXXEXPORT + Function for_each(InputIterator first, InputIterator last, Function f) + { + while(first !=last){ + f(*first); + ++first; + } + return f; + } + + + template<class InputIterator, class T> _UCXXEXPORT + InputIterator find(InputIterator first, InputIterator last, const T& value) + { + while(first !=last && *first != value){ + ++first; + } + return first; + } + + template<class InputIterator, class Predicate> _UCXXEXPORT + InputIterator find_if(InputIterator first, InputIterator last, Predicate pred) + { + while(first !=last && !pred(*first)){ + ++first; + } + return first; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT ForwardIterator1 + find_end(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2) + { + ForwardIterator1 retval = last1; + while(first1 !=last1){ + ForwardIterator1 temp1(first1); + ForwardIterator2 temp2(first2); + while(temp2!=last2 && temp1!= last1){ + if(*temp1 != *temp2){ + break; //Exit while loop + } + ++temp1; + ++temp2; + if(temp2 == last2){ //Have successfully checked the whole sequence + retval = first1; + } + } + } + return retval; + } + + template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> _UCXXEXPORT + ForwardIterator1 + find_end(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + BinaryPredicate pred) + { + ForwardIterator1 retval = last1; + while(first1 !=last1){ + ForwardIterator1 temp1(first1); + ForwardIterator2 temp2(first2); + while(temp2!=last2 && temp1!= last1){ + if( ! pred(*temp1, *temp2)){ + break; //Exit while loop + } + ++temp1; + ++temp2; + if(temp2 == last2){ //Have successfully checked the whole sequence + retval = first1; + } + } + } + return retval; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + ForwardIterator1 + find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2) + { + while(first1 != last1){ + ForwardIterator2 temp2(first2); + while(temp2 != last2 ){ + if(*temp2 == first1){ + return first1; + } + ++temp2; + } + + } + return last1; + } + + template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> _UCXXEXPORT + ForwardIterator1 + find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + BinaryPredicate pred) + { + while(first1 != last1){ + ForwardIterator2 temp2(first2); + while(temp2 != last2 ){ + if(*temp2 == first1){ + return first1; + } + ++temp2; + } + + } + return last1; + } + + template<class ForwardIterator> _UCXXEXPORT ForwardIterator + adjacent_find(ForwardIterator first, ForwardIterator last) + { + ForwardIterator temp; + while(first != last){ + temp = first; + ++temp; + if(*temp == *first){ + return first; + } + ++first; + } + return first; + } + + template<class ForwardIterator, class BinaryPredicate> _UCXXEXPORT + ForwardIterator + adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred) + { + ForwardIterator temp; + while(first != last){ + temp = first; + ++temp; + if( pred(*temp, *first)){ + return first; + } + ++first; + } + return first; + } + + template<class InputIterator, class T> _UCXXEXPORT + typename iterator_traits<InputIterator>::difference_type + count(InputIterator first, InputIterator last, const T& value) + { + typename iterator_traits<InputIterator>::difference_type i = 0; + while(first!=last){ + if(*first == value){ + ++i; + } + ++first; + } + return i; + } + + template<class InputIterator, class Predicate> _UCXXEXPORT + typename iterator_traits<InputIterator>::difference_type + count_if(InputIterator first, InputIterator last, Predicate pred) + { + typename iterator_traits<InputIterator>::difference_type i = 0; + while(first!=last){ + if( pred(*first) ){ + ++i; + } + ++first; + } + return i; + } + + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + pair<InputIterator1, InputIterator2> + mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) + { + while(first1 != last1){ + if(*first1 != *first2){ + break; + } + ++first1; + ++first2; + } + + pair<InputIterator1, InputIterator2> retval; + retval.first = first1; + retval.second = first2; + return retval; + } + + template<class InputIterator1, class InputIterator2, class BinaryPredicate> _UCXXEXPORT + pair<InputIterator1, InputIterator2> + mismatch(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, BinaryPredicate pred) + { + while(first1 != last1){ + if( !pred(*first1, *first2) ){ + break; + } + ++first1; + ++first2; + } + + pair<InputIterator1, InputIterator2> retval; + retval.first = first1; + retval.second = first2; + return retval; + } + + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + bool + equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) + { + while(first1 !=last1){ + if(*first1 != *first2){ + return false; + } + ++first1; + ++first2; + } + return true; + } + + template<class InputIterator1, class InputIterator2, class BinaryPredicate> _UCXXEXPORT + bool + equal(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, BinaryPredicate pred) + { + while(first1 !=last1){ + if( !pred(*first1, *first2) ){ + return false; + } + ++first1; + ++first2; + } + return true; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2) + { + equal_to<typename iterator_traits<ForwardIterator1>::value_type> c; + return search(first1, last1, first2, last2, c); + } + + + template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> _UCXXEXPORT + ForwardIterator1 + search(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + BinaryPredicate pred) + { + while(first1 != last1){ + ForwardIterator1 temp1(first1); + ForwardIterator2 temp2(first2); + while(temp2 != last2 && temp1 != last1){ + if( !pred(*temp2, *temp1) ){ + break; + } + ++temp1; + ++temp2; + if(temp2 == last2){ + return first1; + } + } + ++first1; + } + return last1; + } + + + template<class ForwardIterator, class Size, class T> _UCXXEXPORT + ForwardIterator + search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value) + { + while( first != last ){ + if(*first == value){ + ForwardIterator temp(first); + Size i = 1; + ++first; //Avoid doing the same comparison over again + while(i < count && *temp == value){ + ++first; + ++i; + } + if(i == count){ + return first; + } + } + ++first; + } + return first; + } + + + template<class ForwardIterator, class Size, class T, class BinaryPredicate> _UCXXEXPORT + ForwardIterator + search_n(ForwardIterator first, ForwardIterator last, + Size count, const T& value, BinaryPredicate pred) + { + while( first != last ){ + if( pred(*first, value) ){ + ForwardIterator temp(first); + Size i = 1; + ++first; //Avoid doing the same comparison over again + while(i < count && pred(*temp, value) ){ + ++first; + ++i; + } + if(i == count){ + return first; + } + } + ++first; + } + return first; + + } + + // subclause _lib.alg.modifying.operations_, modifying sequence operations: + + template<class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + copy(InputIterator first, InputIterator last, OutputIterator result) + { + while(first != last){ + *result = *first; + ++first; + ++result; + } + return result; + } + + template<class BidirectionalIterator1, class BidirectionalIterator2> _UCXXEXPORT + BidirectionalIterator2 + copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, + BidirectionalIterator2 result) + { + while(first !=last ){ + --result; + --last; + *result = *last; + } + return result; + } + + template<class T> _UCXXEXPORT void swap(T& a, T& b){ + T temp(a); + a = b; + b = temp; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + ForwardIterator2 + swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2) + { + while(first1 != last1){ + iter_swap(first1, first2); + ++first1; + ++first2; + } + return first2; + } + + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + void + iter_swap(ForwardIterator1 a, ForwardIterator2 b) + { + typename iterator_traits<ForwardIterator1>::value_type temp(*a); + *a = *b; + *b = temp; + } + + + template<class InputIterator, class OutputIterator, class UnaryOperation> _UCXXEXPORT + OutputIterator + transform(InputIterator first, InputIterator last, + OutputIterator result, UnaryOperation op) + { + while(first != last){ + *result = op(*first); + ++first; + ++result; + } + return result; + } + + + template<class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> _UCXXEXPORT + OutputIterator transform(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, OutputIterator result, + BinaryOperation binary_op) + { + while(first1 != last1){ + *result = binary_op(*first1, *first2); + ++first1; + ++first2; + ++result; + } + return result; + } + + + template<class ForwardIterator, class T> _UCXXEXPORT + void + replace(ForwardIterator first, ForwardIterator last, + const T& old_value, const T& new_value) + { + while(first != last){ + if(*first == old_value){ + *first = new_value; + } + ++first; + } + } + + template<class ForwardIterator, class Predicate, class T> _UCXXEXPORT + void + replace_if(ForwardIterator first, ForwardIterator last, + Predicate pred, const T& new_value) + { + while(first != last){ + if( pred(*first) ){ + *first = new_value; + } + ++first; + } + } + + + template<class InputIterator, class OutputIterator, class T> _UCXXEXPORT + OutputIterator + replace_copy(InputIterator first, InputIterator last, + OutputIterator result, const T& old_value, const T& new_value) + { + while(first != last){ + if(*first == old_value){ + *result = new_value; + }else{ + *result = *first; + } + ++first; + ++result; + } + return result; + } + + template<class Iterator, class OutputIterator, class Predicate, class T> _UCXXEXPORT + OutputIterator + replace_copy_if(Iterator first, Iterator last, + OutputIterator result, Predicate pred, const T& new_value) + { + while(first != last){ + if( pred(*first) ){ + *result = new_value; + }else{ + *result = *first; + } + ++first; + ++result; + } + return result; + } + + template<class ForwardIterator, class T> _UCXXEXPORT + void + fill(ForwardIterator first, ForwardIterator last, const T& value) + { + while(first != last){ + *first = value; + ++first; + } + } + + template<class OutputIterator, class Size, class T> _UCXXEXPORT + void + fill_n(OutputIterator first, Size n, const T& value) + { + while(n != 0){ + *first = value; + --n; + ++first; + } + } + + template<class ForwardIterator, class Generator> _UCXXEXPORT + void + generate(ForwardIterator first, ForwardIterator last, Generator gen) + { + while(first != last){ + *first = gen(); + ++first; + } + } + + template<class OutputIterator, class Size, class Generator> _UCXXEXPORT + void + generate_n(OutputIterator first, Size n, Generator gen) + { + while(n !=0){ + *first = gen(); + --n; + ++first; + } + } + + template<class ForwardIterator, class T> _UCXXEXPORT + ForwardIterator + remove(ForwardIterator first, ForwardIterator last, const T& value) + { + ForwardIterator temp(first); + while(temp !=last){ + if(*temp == value){ + + }else{ + *first = *temp; + ++first; + } + ++temp; + } + return first; + } + + template<class ForwardIterator, class Predicate> _UCXXEXPORT + ForwardIterator + remove_if(ForwardIterator first, ForwardIterator last, Predicate pred) + { + ForwardIterator temp(first); + while(temp !=last){ + if( pred(*temp) ){ + + }else{ + *first = *temp; + ++first; + } + ++temp; + } + return first; + } + + + template<class InputIterator, class OutputIterator, class T> _UCXXEXPORT + OutputIterator + remove_copy(InputIterator first, InputIterator last, + OutputIterator result, const T& value) + { + while(first !=last){ + if(*first != value){ + *result = *first; + ++result; + } + ++first; + } + return result; + } + + template<class InputIterator, class OutputIterator, class Predicate> _UCXXEXPORT + OutputIterator + remove_copy_if(InputIterator first, InputIterator last, + OutputIterator result, Predicate pred) + { + while(first !=last){ + if( !pred(*first) ){ + *result = *first; + ++result; + } + ++first; + } + return result; + } + + template<class ForwardIterator> _UCXXEXPORT + ForwardIterator + unique(ForwardIterator first, ForwardIterator last) + { + ForwardIterator new_val(first); + ForwardIterator old_val(first); + + while(new_val !=last){ + if(*new_val == *old_val && new_val != old_val){ + + }else{ + *first = *new_val; + old_val = new_val; + ++first; + } + ++new_val; + } + return first; + } + + template<class ForwardIterator, class BinaryPredicate> _UCXXEXPORT + ForwardIterator + unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred) + { + ForwardIterator new_val(first); + ForwardIterator old_val(first); + + while(new_val !=last){ + if( pred(*new_val, *old_val) && new_val != old_val){ + + }else{ + *first = *new_val; + old_val = new_val; + ++first; + } + ++new_val; + } + return first; + } + + template<class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + unique_copy(InputIterator first, InputIterator last, OutputIterator result) + { + InputIterator temp(first); + while(first !=last ){ + if(*first == *temp && first != temp){ + + }else{ + *result = *first; + temp = first; + ++result; + } + ++first; + } + return result; + } + + template<class InputIterator, class OutputIterator, class BinaryPredicate> _UCXXEXPORT + OutputIterator + unique_copy(InputIterator first, InputIterator last, + OutputIterator result, BinaryPredicate pred) + { + InputIterator temp(first); + while(first !=last ){ + if( pred(*first, *temp) && first != temp){ + + }else{ + *result = *first; + temp = first; + ++result; + } + ++first; + } + return result; + } + + template<class BidirectionalIterator> _UCXXEXPORT + void + reverse(BidirectionalIterator first, BidirectionalIterator last) + { + --last; //Don't work with one past the end element + while(first < last){ + iter_swap(first, last); + ++first; + --last; + } + } + + template<class BidirectionalIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + reverse_copy(BidirectionalIterator first, BidirectionalIterator last, + OutputIterator result) + { + while(last > first){ + --last; + *result = *last; + ++result; + } + return result; + } + + template<class ForwardIterator> _UCXXEXPORT + void + rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last) + { + if ((first == middle) || (last == middle)){ + return; + } + + ForwardIterator first2 = middle; + + do { + swap(*first, *first2); + first++; + first2++; + if(first == middle){ + middle = first2; + } + } while(first2 != last); + + first2 = middle; + + while (first2 != last) { + swap(*first, *first2); + first++; + first2++; + if (first == middle){ + middle = first2; + }else if (first2 == last){ + first2 = middle; + } + } + } + + template<class ForwardIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + rotate_copy(ForwardIterator first, ForwardIterator middle, + ForwardIterator last, OutputIterator result) + { + ForwardIterator temp(middle); + while(temp !=last){ + *result = *temp; + ++temp; + ++result; + } + while(first != middle){ + *result = *first; + ++first; + ++result; + } + return result; + } + + + template<class RandomAccessIterator> _UCXXEXPORT + void + random_shuffle(RandomAccessIterator first, RandomAccessIterator last) + { + --last; + while(first != last){ + iter_swap(first, (first + (rand() % (last - first) ) ) ); + ++first; + } + } + + template<class RandomAccessIterator, class RandomNumberGenerator> _UCXXEXPORT + void + random_shuffle(RandomAccessIterator first, RandomAccessIterator last, + RandomNumberGenerator& rand) + { + --last; + while(first != last){ + iter_swap(first, (first + (rand(last - first) ) ) ); + ++first; + } + } + + // _lib.alg.partitions_, partitions: + template<class BidirectionalIterator, class Predicate> _UCXXEXPORT BidirectionalIterator + partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred) + { + return stable_partition(first, last, pred); + } + + template<class BidirectionalIterator, class Predicate> _UCXXEXPORT BidirectionalIterator + stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred) + { + //first now points to the first non-desired element + while( first != last && pred(*first) ){ + ++first; + } + + BidirectionalIterator tempb; + BidirectionalIterator tempe = first; + + while( tempe != last ){ + //Find the next desired element + while( !pred(*tempe) ){ + ++tempe; + + //See if we should exit + if(tempe == last){ + return first; + } + } + + //Rotate the element back to the begining + tempb = tempe; + while(tempb != first){ + iter_swap(tempb, tempb-1 ); + --tempb; + } + //First now has a desired element + ++first; + } + + return first; + } + + template<class RandomAccessIterator> _UCXXEXPORT + void sort(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + sort(first, last, c ); + } + + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + stable_sort(first, last, comp); + } + + template<class RandomAccessIterator> _UCXXEXPORT + void stable_sort(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + stable_sort(first, last, c); + } + + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + //FIXME - bubble sort + RandomAccessIterator temp; + --last; + while(last - first > 0){ + temp = last; + while(temp != first){ + if( comp( *temp, *(temp-1) ) ){ + iter_swap( temp-1, temp); + } + --temp; + } + ++first; + } + } + + template<class RandomAccessIterator> _UCXXEXPORT + void partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + partial_sort(first, middle, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void partial_sort(RandomAccessIterator first, RandomAccessIterator middle, + RandomAccessIterator last, Compare comp) + { + //Fixme - partial bubble sort + RandomAccessIterator temp; + --last; + while(first < middle){ + temp = last; + while(temp != first){ + if( comp(*temp, *(temp -1 ) ) ) { + iter_swap( temp-1, temp); + } + --temp; + } + ++first; + } + } + template<class InputIterator, class RandomAccessIterator> _UCXXEXPORT + RandomAccessIterator + partial_sort_copy(InputIterator first, InputIterator last, + RandomAccessIterator result_first, RandomAccessIterator result_last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + return partial_sort_copy(first, last, result_first, result_last, c); + } + template<class InputIterator, class RandomAccessIterator, class Compare> _UCXXEXPORT + RandomAccessIterator + partial_sort_copy(InputIterator first, InputIterator last, + RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp) + { + size_t output_size = last-first; + size_t temp_size = result_last - result_first; + if(temp_size < output_size){ + output_size = temp_size; + } + + RandomAccessIterator middle = result_first + output_size; + RandomAccessIterator temp = result_first; + + while(temp != middle){ + *temp = *first; + ++temp; + ++first; + } + sort(result_first, middle, comp); + + while( first != last){ + if( comp( *first, *(middle-1) ) ){ + *(middle-1) = *first; + sort(result_first, middle, comp); + } + ++first; + } + + return middle; + } + template<class RandomAccessIterator> _UCXXEXPORT + void nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + nth_element(first, nth, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void nth_element(RandomAccessIterator first, RandomAccessIterator nth, + RandomAccessIterator last, Compare comp) + { + partial_sort(first, nth, last, comp); + } + + template<class ForwardIterator, class T> _UCXXEXPORT + ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, + const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return lower_bound(first, last, value, c); + } + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, + const T& value, Compare comp) + { + if(first == last){ + return last; + } + //If below or equal to the first element + if( comp(*first, value) == false){ + return first; + } + ForwardIterator middle; + + //If greater than the top element + middle = first; + advance(middle, distance(first, last) - 1); + if( comp(*middle, value) ){ + return last; + } + + //Now begin the actual search for the begining + while( distance(first, last) > 1 ){ + //Find middle + middle = first; + advance(middle, (distance(first, last)/2) ); + if( !comp(*middle, value) ){ + last = middle; + }else{ + first = middle; + } + } + + if( !comp(*first, value) ){ + return first; + } + return last; + } + + template<class ForwardIterator, class T> _UCXXEXPORT + ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, + const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return upper_bound(first, last, value, c); + } + + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, + const T& value, Compare comp) + { + if(first == last){ + return last; + } + //If below the first element + if( comp(value, *first) == true){ + return first; + } + + ForwardIterator middle; + + //If greater than the top element + middle = first; + advance(middle, distance(first, last) - 1); + if( comp(*middle, value) ){ + return last; + } + + //Now begin the actual search for the end + while( distance(first, last) > 1 ){ + //Find middle + middle = first; + advance(middle, (distance(first, last)/2) ); + if( comp(value, *middle) ){ + last = middle; + }else{ + first = middle; + } + } + + if( comp(value, *first) ){ + return first; + } + return last; + } + + + template<class ForwardIterator, class T> _UCXXEXPORT + pair<ForwardIterator, ForwardIterator> + equal_range(ForwardIterator first, ForwardIterator last, const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return equal_range(first, last, value, c); + } + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + pair<ForwardIterator, ForwardIterator> + equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp) + { + pair<ForwardIterator, ForwardIterator> retval; + retval.first = lower_bound(first, last, value, comp); + //Reuse retval.first in order to (possibly) save a few comparisons + retval.second = upper_bound(retval.first, last, value, comp); + return retval; + + } + + template<class ForwardIterator, class T> _UCXXEXPORT + bool binary_search(ForwardIterator first, ForwardIterator last, + const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return binary_search(first, last, value, c); + } + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + bool binary_search(ForwardIterator first, ForwardIterator last, + const T& value, Compare comp) + { + if( distance(first, last) == 0){ + return false; + } + + ForwardIterator middle; + + while( distance(first, last) > 1 ){ + //Set middle between first and last + middle = first; + advance(middle, distance(first, last)/2 ); + + if( comp(*middle, value ) == true){ + first = middle; + }else{ + last = middle; + } + } + + if( !comp(*first, value) && !comp(value, *first) ){ + return true; + } + if( !comp(*last, value) && !comp(value, *last) ){ + return true; + } + + return false; + } + + // _lib.alg.merge_, merge: + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator + merge(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return merge(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator + merge(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + //If in this order so first1 elements which are equal come first + if( comp(*first2, *first1) ){ + *result = *first2; + ++first2; + }else{ + *result = *first1; + ++first1; + } + ++result; + } + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++first1; + ++result; + } + while(first2 != last2){ + *result = *first2; + ++first2; + ++result; + } + return result; + } + template<class BidirectionalIterator> _UCXXEXPORT + void inplace_merge(BidirectionalIterator first, + BidirectionalIterator middle, BidirectionalIterator last) + { + less<typename iterator_traits<BidirectionalIterator>::value_type> c; + inplace_merge(first, middle, last, c); + } + template<class BidirectionalIterator, class Compare> _UCXXEXPORT + void inplace_merge(BidirectionalIterator first, + BidirectionalIterator middle, BidirectionalIterator last, Compare comp) + { + //FIXME - using a bubble exchange method + while(first != middle && middle !=last){ + if( comp(*middle, *first) ){ + BidirectionalIterator temp(middle); + while( temp != first){ + iter_swap(temp, temp-1); + --temp; + } + ++middle; + } + ++first; + } + } + + // _lib.alg.set.operations_, set operations: + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + bool includes(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return includes(first1, last1, first2, last2, c ); + } + + template<class InputIterator1, class InputIterator2, class Compare> _UCXXEXPORT + bool includes(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, Compare comp) + { + while(first2 != last2){ + //Advance the large set until no longer smaller than the element we are looking for + while( comp(*first1, *first2) ){ + ++first1; + //If we are at the end of the list, we don't have the desired element + if(first1 == last1){ + return false; + } + } + //If we are past the element we want, it isn't here + if( comp(*first2, *first1) ){ + return false; + } + ++first2; //Move to next element + } + return true; + } + + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_union(first1, last1, first2, last2, result, c); + } + + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first2, *first1) ){ + *result = *first2; + + //Elliminate duplicates + InputIterator2 temp = first2; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + }else{ + *result = *first1; + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + ++result; + } + + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + } + + while(first2 != last2){ + *result = *first2; + ++result; + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + return result; + } + + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_intersection(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first2, *first1) ){ + ++first2; + }else if( comp(*first1, *first2) ) { + ++first1; + }else{ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + ++first2; + } + } + return result; + } + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_difference(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first1, *first2) ){ + *result = *first1; + ++result; + + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + }else if( comp(*first2, *first1) ){ + + //Elliminate duplicates + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + + }else{ //They are identical - skip + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + } + + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + } + + return result; + } + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_symmetric_difference(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first1, *first2) ){ + *result = *first1; + ++result; + + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + }else if( comp(*first2, *first1) ){ + *result = *first2; + ++result; + + //Elliminate duplicates + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + + }else{ //They are identical - skip + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + } + + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + } + + while(first2 != last2){ + *result = *first2; + ++result; + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + + return result; + } + + // _lib.alg.heap.operations_, heap operations: + + template<class RandomAccessIterator> _UCXXEXPORT + void push_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + push_heap(first, last, c); + } + + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + // *(last - 1) is the last element + RandomAccessIterator begin, middle, end; + begin = first; + end = last - 2; + if(last - first < 2){ //Empty heap + return; + } + if ( comp(*(last-1), *end) ){ //Belongs past the end - already in place + return; + } + while(end - begin > 1){ + middle = begin + ((end - begin)/2); + if( comp(*middle, *(last-1) ) ){ + end = middle; + }else{ + begin = middle; + } + } + + if( comp(*begin, *(last-1)) ){ + middle = begin; + }else{ + middle = end; + } + + //Now all we do is swap the elements up to the begining + --last; + + while(last > middle){ + iter_swap(last, last-1); + --last; + } + } + + template<class RandomAccessIterator> _UCXXEXPORT + void pop_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + pop_heap(first, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare) + { + --last; + while(first < last){ + iter_swap( first, first+1); + ++first; + } + } + + template<class RandomAccessIterator> _UCXXEXPORT + void make_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + make_heap(first, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + sort( reverse_iterator<RandomAccessIterator>(last), reverse_iterator<RandomAccessIterator>(first), comp); + } + template<class RandomAccessIterator> _UCXXEXPORT + void sort_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + sort_heap(first, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + sort( first, last, comp); + } + + + // _lib.alg.min.max_, minimum and maximum: + template<class T> _UCXXEXPORT + const T& min(const T& a, const T& b) + { + if(b < a){ + return b; + } + return a; + } + + template<class T, class Compare> _UCXXEXPORT + const T& min(const T& a, const T& b, Compare comp) + { + if( comp(b, a) == true){ + return b; + } + return a; + } + + template<class T> _UCXXEXPORT + const T& max(const T& a, const T& b) + { + if( a < b){ + return b; + } + return a; + } + + template<class T, class Compare> _UCXXEXPORT + const T& max(const T& a, const T& b, Compare comp) + { + if( comp(a, b) ){ + return b; + } + return a; + } + + template<class ForwardIterator> _UCXXEXPORT + ForwardIterator min_element(ForwardIterator first, ForwardIterator last) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return min_element(first, last, c); + } + + template<class ForwardIterator, class Compare> _UCXXEXPORT + ForwardIterator min_element(ForwardIterator first, ForwardIterator last, Compare comp) + { + ForwardIterator retval = first; + ++first; + while(first != last){ + if( comp( *first, *retval) ){ + retval = first; + } + ++first; + } + return retval; + } + + template<class ForwardIterator> _UCXXEXPORT + ForwardIterator max_element(ForwardIterator first, ForwardIterator last) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return max_element(first, last, c); + } + + template<class ForwardIterator, class Compare> _UCXXEXPORT + ForwardIterator max_element(ForwardIterator first, ForwardIterator last, Compare comp) + { + ForwardIterator retval = first; + ++first; + while(first != last){ + if( comp( *retval, *first ) ){ + retval = first; + } + ++first; + } + return retval; + } + + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return lexicographical_compare(first1, last1, first2, last2, c); + } + + template<class InputIterator1, class InputIterator2, class Compare> _UCXXEXPORT + bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, Compare comp) + { + while(first1 != last1 && first2 != last2){ + if( comp(*first1, *first2) ){ + return true; + } + if( comp(*first2, *first1) ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + // _lib.alg.permutation.generators_, permutations + template<class BidirectionalIterator> _UCXXEXPORT + bool next_permutation(BidirectionalIterator first, BidirectionalIterator last) + { + less<typename iterator_traits<BidirectionalIterator>::value_type> c; + return next_permutation(first, last, c); + } + + template<class BidirectionalIterator, class Compare> _UCXXEXPORT + bool next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp) + { + if(first == last){ + return false; // No data + } + BidirectionalIterator i = last; + --i; + if(i == first){ + return false; //Only one element + } + BidirectionalIterator ii = i; + --ii; + //If the last two items are in order, swap them and call it done + if( comp(*ii, *i) ){ + iter_swap(ii, i); + return true; + } + + + //This part of the algorithm copied from G++ header files ver. 3.4.2 + i = last; + --i; + for(;;){ + ii = i; + --i; + if ( comp(*i, *ii) ){ + BidirectionalIterator j = last; + --j; + while ( !comp(*i, *j)){ + --j; + } + iter_swap(i, j); + reverse(ii, last); + return true; + } + if (i == first){ + reverse(first, last); + return false; + } + } + + + } + + template<class BidirectionalIterator> _UCXXEXPORT + bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last) + { + less<typename iterator_traits<BidirectionalIterator>::value_type> c; + return prev_permutation(first, last, c); + } + + template<class BidirectionalIterator, class Compare> _UCXXEXPORT + bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp) + { + if(first == last){ + return false; // No data + } + BidirectionalIterator i = last; + --i; + if(i == first){ + return false; //Only one element + } + BidirectionalIterator ii = i; + --ii; + //If the last two items are in reverse order, swap them and call it done + if( comp(*i, *ii) ){ + iter_swap(ii, i); + return true; + } + + //Copied from GNU GCC header files version 3.4.2 + i = last; + --i; + + for(;;){ + ii = i; + --i; + if ( comp(*ii, *i)){ + BidirectionalIterator j = last; + --j; + while ( !comp(*j, *i)){ + --j; + } + iter_swap(i, j); + reverse(ii, last); + return true; + } + if (i == first){ + reverse(first, last); + return false; + } + } + + } + +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/associative_base.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/associative_base.svn-base new file mode 100644 index 0000000..93d545a --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/associative_base.svn-base @@ -0,0 +1,639 @@ +/* Copyright (C) 2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include<functional> +#include<list> + + +#ifndef __STD_HEADER_ASSOCIATIVE_BASE +#define __STD_HEADER_ASSOCIATIVE_BASE + +namespace std{ + + +/* + * The basic premis here is that most of the code used by map, multimap, set and + * multiset is really common. There are a number of interface additions, and + * considerations about how to address multiple enteries with the same key. + * The goal is that the code tree/storage code should be here, and managing + * single or moultiple counts will be loeft to subclasses. + * Yes, inheritence for the purpose of code sharing is usually a bad idea. However, + * since our goal is to reduce tht total amount of code written and the overall binary + * size, this seems to be the best approach possible. + */ + +template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __base_associative; +template<class ValueType, class Compare, class Allocator> class _associative_iter; +template<class ValueType, class Compare, class Allocator> class _associative_citer; + +template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __single_associative; +template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __multi_associative; + +template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __base_associative{ + +protected: + +public: + typedef Key key_type; + typedef ValueType value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef __base_associative<Key, ValueType, Compare, Allocator> associative_type; + + typedef _associative_iter<value_type, Compare, Allocator> iterator; + typedef _associative_citer<value_type, Compare, Allocator> const_iterator; + typedef typename std::reverse_iterator<iterator> reverse_iterator; + typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator; + + + explicit __base_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type)) + : c(comp), value_to_key(v_to_k) { } +protected: + __base_associative(const associative_type& x) + : c(x.c), backing(x.backing), value_to_key(x.value_to_key) { } + +public: + ~__base_associative(){ + } + + bool empty() const{ + return backing.empty(); + } + size_type size() const{ + return backing.size(); + } + size_type max_size() const{ + return backing.max_size(); + } + + iterator begin(){ + return iterator(backing.begin()); + } + + const_iterator begin() const{ + return const_iterator(backing.begin()); + } + + iterator end() { + return iterator(backing.end()); + } + + const_iterator end() const{ + return const_iterator(backing.end()); + } + + reverse_iterator rbegin(){ + return reverse_iterator(end()); + } + + const_reverse_iterator rbegin() const{ + return const_reverse_iterator(end()); + } + + reverse_iterator rend(){ + return reverse_iterator(begin()); + } + + const_reverse_iterator rend() const{ + return const_reverse_iterator(begin()); + } + + + iterator lower_bound(const key_type &x); + const_iterator lower_bound(const key_type &x) const; + iterator upper_bound(const key_type &x); + const_iterator upper_bound(const key_type &x) const; + + pair<iterator,iterator> equal_range(const key_type& x){ + pair<iterator, iterator> retval; + retval.first = lower_bound(x); + retval.second = retval.first; + while(retval.second != end() && !c(x, value_to_key(*retval.second))){ + ++retval.second; + } + return retval; + } + pair<const_iterator,const_iterator> equal_range(const key_type& x) const{ + pair<const_iterator, const_iterator> retval; + retval.first = lower_bound(x); + retval.second = retval.first; + while(retval.second != end() && !c(x, value_to_key(*retval.second))){ + ++retval.second; + } + return retval; + } + + iterator find(const key_type& x){ + iterator retval = lower_bound(x); + if(retval == end()){ + return retval; + } + if(c(x, value_to_key(*retval))){ + return end(); + } + return retval; + } + const_iterator find(const key_type& x) const{ + const_iterator retval = lower_bound(x); + if(retval == end()){ + return retval; + } + if(c(x, value_to_key(*retval))){ + return end(); + } + return retval; + } + size_type count(const key_type& x) const{ + size_type retval(0); + const_iterator first = lower_bound(x); + while(first != end() && !c(x, value_to_key(*first))){ + ++retval; + ++first; + } + return retval; + } + + void clear(){ + backing.clear(); + } + + void erase(iterator pos){ + backing.erase(pos.base_iterator()); + } + size_type erase(const key_type& x){ + size_type count(0); + iterator start = lower_bound(x); + iterator end = upper_bound(x); + while(start != end){ + start = backing.erase(start.base_iterator()); + ++count; + } + return count; + } + void erase(iterator first, iterator last){ + while(first != last){ + backing.erase(first.base_iterator()); + ++first; + } + } + + key_compare key_comp() const{ + return c; + } + + __base_associative &operator=(const __base_associative & x){ + c = x.c; + backing = x.backing; + value_to_key = x.value_to_key; + return *this; + } + bool operator==(const __base_associative & x){ + return x.backing == backing; + } + bool operator!=(const __base_associative & x){ + return !(x.backing == backing); + } + +protected: + void swap(__base_associative & x); + + Compare c; + std::list<value_type> backing; + + const key_type (*value_to_key)(const value_type); + +}; + + +/* + * Tree interators for the base associative class + */ + +template<class ValueType, class Compare, class Allocator> class _associative_citer + : public std::iterator< + bidirectional_iterator_tag, + ValueType, + typename Allocator::difference_type, + ValueType*, + ValueType& + > +{ +protected: + typedef std::list<ValueType> listtype; + + typename listtype::const_iterator base_iter; + friend class _associative_iter<ValueType, Compare, Allocator>; +public: + _associative_citer() { } + _associative_citer(const _associative_citer & m) + : base_iter(m.base_iter) { } + _associative_citer(const typename listtype::const_iterator & m) + : base_iter(m) { } + ~_associative_citer() { } + ValueType operator*() const{ + return *base_iter; + } + const ValueType * operator->() const{ + return &(*base_iter); + } + _associative_citer & operator=(const _associative_citer & m){ + base_iter = m.base_iter; + return *this; + } + bool operator==(const _associative_citer & m) const{ + return m.base_iter == base_iter; + } + bool operator!=(const _associative_citer & m) const{ + return m.base_iter != base_iter; + } + _associative_citer & operator++(){ + ++base_iter; + return *this; + } + _associative_citer operator++(int){ + //The following approach ensures that we only need to + //provide code for ++ in one place (above) + _associative_citer temp(base_iter); + ++base_iter; + return temp; + } + _associative_citer & operator--(){ + --base_iter; + return *this; + } + _associative_citer operator--(int){ + //The following approach ensures that we only need to + //provide code for -- in one place (above) + _associative_citer temp(base_iter); + --base_iter; + return temp; + } + + //This is an implementation-defined function designed to make internals work correctly + typename listtype::const_iterator base_iterator(){ + return base_iter; + } + +}; + + +template<class ValueType, class Compare, class Allocator> class _associative_iter + : public std::iterator< + bidirectional_iterator_tag, + ValueType, + typename Allocator::difference_type, + ValueType*, + ValueType& + > +{ +protected: + typedef std::list<ValueType> listtype; + + typename listtype::iterator base_iter; + typedef _associative_citer<ValueType, Compare, Allocator> _associative_citer; + + +public: + _associative_iter() { } + _associative_iter(const _associative_iter & m) + : base_iter(m.base_iter) { } + _associative_iter(const typename listtype::iterator & m) + : base_iter(m) { } + ~_associative_iter() { } + const ValueType & operator*() const{ + return *base_iter; + } + ValueType & operator*(){ + return *base_iter; + } + ValueType * operator->(){ + return &(*base_iter); + } + const ValueType * operator->() const{ + return &(*base_iter); + } + _associative_iter & operator=(const _associative_iter & m){ + base_iter = m.base_iter; + return *this; + } + bool operator==(const _associative_iter & m) const{ + return m.base_iter == base_iter; + } + bool operator==(const _associative_citer & m) const{ + return m.base_iter == base_iter; + } + bool operator!=(const _associative_iter & m) const{ + return m.base_iter != base_iter; + } + bool operator!=(const _associative_citer & m) const{ + return m.base_iter != base_iter; + } + _associative_iter & operator++(){ + ++base_iter; + return *this; + } + _associative_iter operator++(int){ + //The following approach ensures that we only need to + //provide code for ++ in one place (above) + _associative_iter temp(base_iter); + ++base_iter; + return temp; + } + _associative_iter & operator--(){ + --base_iter; + return *this; + } + _associative_iter operator--(int){ + //The following approach ensures that we only need to + //provide code for -- in one place (above) + _associative_iter temp(base_iter); + --base_iter; + return temp; + } + operator _associative_citer() const{ + return _associative_citer(base_iter); + } + typename listtype::iterator base_iterator(){ + return base_iter; + } + const typename listtype::iterator base_iterator() const{ + return base_iter; + } + +}; + + + // The lower_bound code is really crappy linear search. However, it is a dead + // simple implimentation (easy to audit). It can also be easily replaced. + + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::iterator + __base_associative<Key, ValueType, Compare, Allocator>::lower_bound(const key_type &x) + { + iterator retval = begin(); + while(retval != end() && c(value_to_key(*retval), x)){ + ++retval; + } + return retval; + } + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::const_iterator + __base_associative<Key, ValueType, Compare, Allocator>::lower_bound(const key_type &x) const + { + const_iterator retval = begin(); + while(retval != end() && c(value_to_key(*retval), x)){ + ++retval; + } + return retval; + } + + // Upper bound search is linear from the point of lower_bound. This is likely the best solution + // in all but the most pathalogical of cases. + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::iterator + __base_associative<Key, ValueType, Compare, Allocator>::upper_bound(const key_type &x) + { + iterator retval = lower_bound(x); + while(retval != end() && !c(x, value_to_key(*retval))){ + ++retval; + } + return retval; + } + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::const_iterator + __base_associative<Key, ValueType, Compare, Allocator>::upper_bound(const key_type &x) const + { + const_iterator retval = begin(); + while(retval != end() && !c(x, value_to_key(*retval))){ + ++retval; + } + return retval; + } + + + template <class Key, class ValueType, class Compare, class Allocator> + void __base_associative<Key, ValueType, Compare, Allocator>::swap(__base_associative<Key, ValueType, Compare, Allocator>& m) + { + Compare n = c; + c = m.c; + m.c = n; + + m.backing.swap(backing); + } + + +template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __single_associative : + public __base_associative<Key, ValueType, Compare, Allocator> +{ +protected: + typedef __base_associative<Key, ValueType, Compare, Allocator> base; + using base::backing; + + using base::c; + +public: + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + using base::operator=; + using base::operator==; + using base::operator!=; + + explicit __single_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type)) + : base(comp, A, v_to_k) { } + + template <class InputIterator> __single_associative( + InputIterator first, + InputIterator last, + const Compare& comp, + const Allocator& A, + const key_type (*v_to_k)(const value_type) + ) : base(comp, A, v_to_k) { + insert(first, last); + } + + pair<iterator, bool> insert(const value_type& x){ + pair<iterator, bool> retval; + iterator location = lower_bound(this->value_to_key(x)); + retval.second = true; + //Empty list or need to insert at end + if(end() == location){ + backing.push_back(x); + retval.first = --(end()); + return retval; + } + //Something in the list + if(c(this->value_to_key(x), this->value_to_key(*location))){ + location = backing.insert(location.base_iterator(), x); + retval.first = location; + }else{ + retval.second = false; + retval.first = location; + } + return retval; + } + + iterator insert(iterator position, const value_type& x){ + // FIXME - this is cheeting and probably should be more efficient since we are + // now log(n) to find for inserts + return insert(x).first; + } + + template <class InputIterator> void insert(InputIterator first, InputIterator last){ + while(first != last){ + insert(*first); + ++first; + } + } + +}; + + +template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __multi_associative : + public __base_associative<Key, ValueType, Compare, Allocator> +{ +protected: + typedef __base_associative<Key, ValueType, Compare, Allocator> base; + using base::backing; + + using base::c; + +public: + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + using base::operator=; + using base::operator==; + + + explicit __multi_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type)) + : base(comp, A, v_to_k) { } + + template <class InputIterator> __multi_associative( + InputIterator first, + InputIterator last, + const Compare& comp, + const Allocator& A, + const key_type (*v_to_k)(const value_type) + ) : base(comp, A, v_to_k) { + insert(first, last); + } + + iterator insert(const value_type& x){ + iterator location = lower_bound(value_to_key(x)); + + if(location == begin()){ + backing.push_front(x); + location = begin(); + }else{ + location = backing.insert(location.base_iterator(), x); + } + return location; + } + + iterator insert(iterator position, const value_type& x){ + // FIXME - this is cheeting and probably should be more efficient since we are + // now log(n) to find for inserts + return insert(x); + } + + template <class InputIterator> void insert(InputIterator first, InputIterator last){ + while(first != last){ + insert(*first); + ++first; + } + } +}; + + + + +} + +#endif //__STD_HEADER_ASSOCIATIVE_BASE + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/basic_definitions.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/basic_definitions.svn-base new file mode 100644 index 0000000..dd8adad --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/basic_definitions.svn-base @@ -0,0 +1,62 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __BASIC_DEFINITIONS +#define __BASIC_DEFINITIONS 1 + +#include <system_configuration.h> + +//The following is used to support GCC symbol visibility patch + +#ifdef GCC_HASCLASSVISIBILITY + #define _UCXXEXPORT __attribute__ ((visibility("default"))) + #define _UCXXLOCAL __attribute__ ((visibility("hidden"))) +#else + #define _UCXXEXPORT + #define _UCXXLOCAL + +#endif + +#ifdef __GCC__ +#define __UCLIBCXX_NORETURN __attribute__ ((__noreturn__)) +#else +#define __UCLIBCXX_NORETURN +#endif + +#ifdef __UCLIBCXX_HAS_TLS__ + #define __UCLIBCXX_TLS __thread +#else + #define __UCLIBCXX_TLS +#endif + + + +//Testing purposes +#define __STRING_MAX_UNITS 65535 + +namespace std{ + typedef signed long int streamsize; +} + +#endif + + +#ifdef __DODEBUG__ + #define UCLIBCXX_DEBUG 1 +#else + #define UCLIBCXX_DEBUG 0 +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/bitset.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/bitset.svn-base new file mode 100644 index 0000000..192ed81 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/bitset.svn-base @@ -0,0 +1,419 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <climits> +#include <func_exception> +#include <string> +#include <iosfwd> + +#ifndef __STD_BITSET_HEADER +#define __STD_BITSET_HEADER 1 + +namespace std{ + template <size_t N> class bitset; + + + template <size_t N> bitset<N> operator&(const bitset<N>&, const bitset<N>&); + template <size_t N> bitset<N> operator|(const bitset<N>&, const bitset<N>&); + template <size_t N> bitset<N> operator^(const bitset<N>&, const bitset<N>&); + template <class charT, class traits, size_t N> basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, bitset<N>& x); + + template <class charT, class traits, size_t N> basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x); + + //Actual Code + + + template<size_t N> class _UCXXEXPORT bitset { + private: + //Number of characters allocated to hold the bits + static const size_t WORD_SIZE = CHAR_BIT; //Use int maybe? + static const size_t num_bytes = (N + WORD_SIZE - 1) / WORD_SIZE; + + //From the bit number, figure out which byte we are working with + size_t byte_num(size_t bit_num) const{ + if(WORD_SIZE == 8){ + return (bit_num >> 3); + } + if(WORD_SIZE == 16){ + return (bit_num >> 4); + } + if(WORD_SIZE == 32){ + return (bit_num >> 5); + } + if(WORD_SIZE == 64){ + return (bit_num >> 6); + } + return bit_num / WORD_SIZE; + } + //From the bit number, figure out which bit inside the byte we need + size_t bit_num(const size_t bit_num) const{ + return bit_num % WORD_SIZE; + } + + + //Point to the actual data + char data[num_bytes]; + public: + + class _UCXXEXPORT reference { + friend class bitset; + reference() : bit_num(0), parent(0) { } + size_t bit_num; + bitset * parent; + public: + ~reference() { } + reference& operator=(bool x){ // for b[i] = x; + parent->set(bit_num, x); + return *this; + } + reference& operator=(const reference& x){ // for b[i] = b[j]; + parent->set(bit_num, x); + return *this; + } + bool operator~() const{ // flips the bit + return !parent->test(bit_num); + } + operator bool() const{ // for x = b[i]; + return parent->test(bit_num); + } + reference& flip(){ // for b[i].flip(); + parent->flip(bit_num); + return *this; + } + }; + + bitset(){ + reset(); + } + bitset(unsigned long val){ + reset(); + size_t count = sizeof(val) * CHAR_BIT; + if(count > N){ + count = N; + } + for(size_t i = 0; i < count; ++i){ + set(i, ((val >> i) & 1)); + } + } + + bitset(const bitset & val){ + for(size_t i = 0; i < num_bytes; ++i){ + data[i] = val.data[i]; + } + } + + template<class charT, class traits, class Allocator> _UCXXEXPORT + explicit bitset( + const basic_string<charT,traits,Allocator>& str, + typename basic_string<charT,traits,Allocator>::size_type pos = 0, + typename basic_string<charT,traits,Allocator>::size_type n = + basic_string<charT>::npos + + ){ + reset(); + if(n > str.length()){ + n = str.length(); + } + size_t width = n; + if (width + pos > str.length()){ + width = str.length() - pos; + } + + for(size_t i = 0; i < width; ++i){ + switch(str[pos + width - i - 1]){ + case '0': + break; + case '1': + set(i); + break; + default: + __throw_invalid_argument(); + } + } + } + + bitset<N>& operator&=(const bitset<N>& rhs){ + for(size_t i =0; i < num_bytes; ++i){ + data[i] &= rhs.data[i]; + } + return *this; + } + + bitset<N>& operator|=(const bitset<N>& rhs){ + for(size_t i =0; i < num_bytes; ++i){ + data[i] |= rhs.data[i]; + } + return *this; + } + bitset<N>& operator^=(const bitset<N>& rhs){ + for(size_t i=0; i < num_bytes; ++i){ + data[i] ^= rhs.data[i]; + } + return *this; + } + + bitset<N>& operator<<=(size_t pos){ + for(size_t i = N-1; i >=pos; --i){ + set(i, test(i - pos)); + } + for(size_t i = 0; i < pos; ++i){ + reset(i); + } + return *this; + } + + bitset<N>& operator>>=(size_t pos){ + for(size_t i = 0; i < (N - pos); ++i){ + set(i, test(i + pos)); + } + for(size_t i = pos; i > 0; --i){ + reset(N - i); + } + return *this; + } + + bitset<N>& set(){ + size_t i; + for(i = 0; i < N ; ++i){ + data[byte_num(i)] |= (1<<bit_num(i)); + } + return *this; + } + bitset<N>& set(size_t pos, int val = true){ + if(val == true){ + data[byte_num(pos)] |= (1<<bit_num(pos)); + }else{ + data[byte_num(pos)] &= ~(1<<bit_num(pos)); + } + return *this; + } + bitset<N>& reset(){ + for(size_t i = 0; i <= num_bytes; ++i){ + data[i] = 0; + } + return *this; + } + bitset<N>& reset(size_t pos){ + data[byte_num(pos)] &= ~(1<<bit_num(pos)); + return *this; + } + bitset<N> operator~() const{ + bitset<N> retval(*this); + retval.flip(); + return retval; + } + + bitset<N>& flip(){ + for(size_t i = 0; i <= num_bytes; ++i){ + data[i] = ~data[i]; + } + return *this; + } + bitset<N>& flip(size_t pos){ + char temp = data[byte_num(pos)] & (1 << bit_num(pos)); + if(temp == 0){ //Bit was 0 + data[byte_num(pos)] |= (1 << bit_num(pos)); + }else{ //Bit was 1 + data[byte_num(pos)] &= ~(1<<bit_num(pos)); + } + return *this; + } + + reference operator[](size_t pos){ // for b[i]; + reference retval; + retval.parent = this; + retval.bit_num = pos; + return retval; + } + + unsigned long to_ulong() const{ + if(N > sizeof(unsigned long) * CHAR_BIT){ + __throw_overflow_error(); + } + unsigned long retval = 0; + size_t count = N; + for(size_t i = count; i > 0; --i){ + if(test(i)){ + retval +=1; + } + retval<<=1; + } + if(test(0)){ + retval +=1; + } + return retval; + } + + template <class charT, class traits, class Allocator> + basic_string<charT, traits, Allocator> to_string() const + { + basic_string<charT, traits, Allocator> retval; + retval.reserve(N); + for(size_t i = N ; i > 0; --i){ + if(test(i-1) == true){ + retval.append("1"); + }else{ + retval.append("0"); + } + } + return retval; + } + + + size_t count() const{ + size_t retval = 0; + for(size_t i =0; i < N; ++i){ + if(test(i)){ + ++retval; + } + } + return retval; + } + size_t size() const{ + return N; + } + + bitset<N>& operator=(const bitset<N> & rhs){ + if(&rhs == this){ + return *this; + } + for(size_t i = 0; i <= byte_num(N); ++i){ + data[i] = rhs.data[i]; + } + return *this; + } + + + bool operator==(const bitset<N>& rhs) const{ + for(size_t i =0; i< N; ++i){ + if(test(i) != rhs.test(i)){ + return false; + } + } + return true; + } + + bool operator!=(const bitset<N>& rhs) const{ + for(size_t i =0; i< N; ++i){ + if(test(i) != rhs.test(i)){ + return true; + } + } + return false; + } + + bool test(size_t pos) const{ + return (data[byte_num(pos)] & (1<<bit_num(pos)) ) != 0; + } + + bool any() const{ + for(size_t i = 0; i< N; ++i){ + if(test(i)==true){ + return true; + } + } + return false; + } + + bool none() const{ + if(any() == true){ + return false; + } + return true; + } + + bitset<N> operator<<(size_t pos) const{ + bitset retval(*this); + retval<<=pos; + return retval; + } + bitset<N> operator>>(size_t pos) const{ + bitset retval(*this); + retval>>=pos; + return retval; + } + }; + + //Non-member functions + + + template <size_t N> _UCXXEXPORT bitset<N> operator&(const bitset<N>& lhs, const bitset<N>& rhs){ + bitset<N> retval(lhs); + retval &= rhs; + return retval; + } + + template <size_t N> _UCXXEXPORT bitset<N> operator|(const bitset<N>& lhs, const bitset<N>& rhs){ + bitset<N> retval(lhs); + retval |= rhs; + return retval; + } + + template <size_t N> _UCXXEXPORT bitset<N> operator^(const bitset<N>& lhs, const bitset<N>& rhs){ + bitset<N> retval(lhs); + retval ^= rhs; + return retval; + } + + template <class charT, class traits, size_t N> _UCXXEXPORT basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, bitset<N>& x) + { + string s; + charT c; + for(size_t i = 0; i < N; ++i){ + is.get(c); + if(!is.good()){ + break; + } + if(c != '1' && c !='0'){ + is.putback(c); + break; + } + s+=c; + } + bitset<N> temp(s); + x = temp; + + return is; + } + + template <class charT, class traits, size_t N> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x) + { + for(size_t i = N ; i > 0; --i){ + if(x.test(i-1) == true){ + os << "1"; + }else{ + os << "0"; + } + } + return os; + } + + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cassert.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cassert.svn-base new file mode 100644 index 0000000..dc590dd --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cassert.svn-base @@ -0,0 +1,19 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <assert.h> diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cctype.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cctype.svn-base new file mode 100644 index 0000000..ef12b1f --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cctype.svn-base @@ -0,0 +1,37 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <ctype.h> + +namespace std{ + + using ::isalnum; + using ::isalpha; + using ::iscntrl; + using ::isdigit; + using ::isgraph; + using ::islower; + using ::isprint; + using ::ispunct; + using ::isspace; + using ::isupper; + using ::isxdigit; + using ::tolower; + using ::toupper; + +} diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cerrno.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cerrno.svn-base new file mode 100644 index 0000000..b779c5c --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cerrno.svn-base @@ -0,0 +1,19 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <errno.h> diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cfloat.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cfloat.svn-base new file mode 100644 index 0000000..d2ab703 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cfloat.svn-base @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <setjmp.h> + +#ifndef __STD_HEADER_CFLOAT +#define __STD_HEADER_CFLOAT 1 + + +#include <float.h> + + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/char_traits.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/char_traits.svn-base new file mode 100644 index 0000000..57bde4f --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/char_traits.svn-base @@ -0,0 +1,112 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <string.h> +#include <exception> +#include <memory> + + +#ifndef __HEADER_CHAR_TRAITS +#define __HEADER_CHAR_TRAITS 1 + +namespace std{ + /* Inlining all wrapped function calls to shrink the amount of code generated*/ + //Typedefs to use for stuff + typedef signed int char_traits_off_type; + + //Generic char_traits + template<class charT> struct _UCXXEXPORT char_traits { }; + + //Specialize for char + template<> struct _UCXXEXPORT char_traits<char> { + typedef char char_type; + typedef short int int_type; + typedef char_traits_off_type off_type; + typedef char_traits_off_type pos_type; + typedef char state_type; + + inline static void assign(char_type & c, const char_type & d) { c = d; } + + static bool eq(const char_type& c1, const char_type& c2); + + static char_type to_char_type(const int_type & i); + + inline static int_type to_int_type(const char_type & c){ + return (short int)(unsigned char)c; + } + + inline static bool eq_int_type(const int_type & a, const int_type & b){ + if(a==b){ + return true; + } + return false; + } + + + inline static bool lt(const char_type& c1, const char_type& c2){ + if(strncmp(&c1, &c2, 1) < 0){ + return true; + } + return false; + } + + inline static char_type* move(char_type* s1, const char_type* s2, size_t n){ + return (char*) memmove(s1, s2, n); + } + + inline static char_type* copy(char_type* s1, const char_type* s2, size_t n){ + for(unsigned long int i=0; i< n; ++i){ + assign(s1[i], s2[i]); + } + return s1 + n; + } + + inline static char_type* assign(char_type* s, size_t n, char_type a){ + return (char *)memset(s, a, n); + } + + inline static int compare(const char_type* s1, const char_type* s2, size_t n){ + return strncmp(s1, s2, n); + } + + inline static size_t length(const char_type* s){ + return strlen(s); + } + + static const char_type* find(const char_type* s, int n, const char_type& a); + + inline static char_type eos() { return 0; } + inline static int_type eof() { return -1; } + inline static int_type not_eof(const int_type & i) { + if(i == -1){ + return 0; + } else { + return i; + } + } + static state_type get_state(pos_type p){ + //p = p; + state_type a = 0; + return a; + } + }; +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/climits.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/climits.svn-base new file mode 100644 index 0000000..7d39780 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/climits.svn-base @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __STD_HEADER_CLIMITS +#define __STD_HEADER_CLIMITS 1 + + +#include <limits.h> + + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/clocale.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/clocale.svn-base new file mode 100644 index 0000000..4f3cd69 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/clocale.svn-base @@ -0,0 +1,30 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __STD_HEADER_CLOCALE +#define __STD_HEADER_CLOCALE 1 + +#include <locale.h> + +namespace std { + using ::lconv; + using ::setlocale; + using ::localeconv; +} + +#endif // __STD_HEADER_CLOCALE diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cmath.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cmath.svn-base new file mode 100644 index 0000000..29def58 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cmath.svn-base @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <math.h> + +#ifndef __STD_HEADER_CMATH +#define __STD_HEADER_CMATH 1 + +namespace std{ + using ::acos; + using ::asin; + using ::atan; + using ::atan2; + using ::ceil; + using ::cos; + using ::cosh; + using ::exp; + using ::fabs; + using ::floor; + using ::fmod; + using ::frexp; + using ::ldexp; + using ::log; + using ::log10; + using ::modf; + using ::pow; + using ::sin; + using ::sinh; + using ::sqrt; + using ::tan; + using ::tanh; + + inline float abs (float x){ + return fabsf(x); + } + inline float acos (float x){ + return acosf(x); + } + inline float asin (float x){ + return asinf(x); + } + inline float atan (float x){ + return atanf(x); + } + inline float atan2(float y, float x){ + return atan2f(y, x); + } + inline float ceil (float x){ + return ceilf(x); + } + inline float cos (float x){ + return cosf(x); + } + inline float cosh (float x){ + return coshf(x); + } + inline float exp (float x){ + return expf(x); + } + inline float fabs (float x){ + return fabsf(x); + } + inline float floor(float x){ + return floorf(x); + } + inline float fmod (float x, float y){ + return fmodf(x, y); + } + inline float frexp(float x, int* exp){ + return frexpf(x, exp); + } + inline float ldexp(float x, int exp){ + return ldexpf(x, exp); + } + inline float log (float x){ + return logf(x); + } + inline float log10(float x){ + return log10f(x); + } + inline float modf (float x, float* inptr){ + return modff(x, inptr); + } + inline float pow (float x, float y){ + return powf(x, y); + } + inline float pow (float x, int y){ + return pow((double)x, (double)y); + } + inline float sin (float x){ + return sinf(x); + } + inline float sinh (float x){ + return sinhf(x); + } + inline float sqrt (float x){ + return sqrtf(x); + } + inline float tan (float x){ + return tanf(x); + } + inline float tanh (float x){ + return tanhf(x); + } + inline double abs(double x){ + return fabs(x); + } + inline double pow(double x, int y){ + return pow((double)x, (double)y); + } + +#ifdef __UCLIBCXX_HAS_LONG_DOUBLE__ + inline long double abs (long double x){ + return fabsl(x); + } + inline long double acos (long double x){ + return acosl(x); + } + inline long double asin (long double x){ + return asinl(x); + } + inline long double atan (long double x){ + return atanl(x); + } + inline long double atan2(long double y, long double x){ + return atan2l(y, x); + } + inline long double ceil (long double x){ + return ceill(x); + } + inline long double cos (long double x){ + return cosl(x); + } + inline long double cosh (long double x){ + return coshl(x); + } + inline long double exp (long double x){ + return expl(x); + } + inline long double fabs (long double x){ + return fabsl(x); + } + inline long double floor(long double x){ + return floorl(x); + } + inline long double frexp(long double x, int* exp){ + return frexpl(x, exp); + } + inline long double fmod (long double x, long double y){ + return fmodl(x, y); + } + inline long double ldexp(long double x, int y){ + return ldexpl(x, y); + } + inline long double log (long double x){ + return logl(x); + } + inline long double log10(long double x){ + return log10l(x); + } + inline long double modf (long double x, long double* iptr){ + return modfl(x, iptr); + } + inline long double pow (long double x, long double y){ + return powl(x, y); + } + inline long double pow (long double x, int y){ + return powl(x, (long double)y ); + } + inline long double sin (long double x){ + return sinl(x); + } + inline long double sinh (long double x){ + return sinhl(x); + } + inline long double sqrt (long double x){ + return sqrtl(x); + } + inline long double tan (long double x){ + return tanl(x); + } + inline long double tanh (long double x){ + return tanhl(x); + } +#endif // __UCLIBCXX_HAS_LONG_DOUBLE__ +} + +#endif //__STD_HEADER_CMATH + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/complex.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/complex.svn-base new file mode 100644 index 0000000..2c3c82b --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/complex.svn-base @@ -0,0 +1,327 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <istream> +#include <ostream> + +#ifndef __STD_HEADER_COMPLEX +#define __STD_HEADER_COMPLEX 1 + + +namespace std { +// class complex<float>; +// class complex<double>; +// class complex<long double>; + + template<class T> class _UCXXEXPORT complex{ + public: + typedef T value_type; + + complex(const T& re = T(), const T& im = T()) : r(re), i(im) { } + complex(const complex& c): r(c.r), i(c.i){ } + template<class X> complex(const complex<X>& c): r(c.r), i(c.i){ } + + inline T real() const{ + return r; + } + inline T imag() const{ + return i; + } + + complex<T>& operator= (const T& v){ + r = v; + i = 0; + return *this; + } + complex<T>& operator+=(const T& v){ + r +=v; + return *this; + } + complex<T>& operator-=(const T& v){ + r -=v; + return *this; + } + complex<T>& operator*=(const T& v){ + r*=v; + i*=v; + return *this; + } + complex<T>& operator/=(const T& v){ + r/=v; + i/=v; + return *this; + } + complex& operator=(const complex& v){ + if(&v != this){ + r = v.r; + i = v.i; + } + return *this; + } + template<class X> complex<T>& operator= (const complex<X>& v){ + r = v.r; + i = v.i; + return *this; + } + template<class X> complex<T>& operator+=(const complex<X>& v){ + r+=v.r; + i+=v.i; + return *this; + } + template<class X> complex<T>& operator-=(const complex<X>& v){ + r-=v.r; + i-=v.i; + return *this; + } + template<class X> complex<T>& operator*=(const complex<X>& v){ + T tempr = r*v.r - i*v.i; + T tempi = r*v.i + i*v.r; + r = tempr; + i = tempi; + return *this; + } + template<class X> complex<T>& operator/=(const complex<X>& v){ + T tempr = (r*v.r + i*v.i) / (v.r*v.r + v.i*v.i); + T tempi = (i*v.r - r*v.i) / (v.r*v.r + v.i*v.i); + r = tempr; + i = tempi; + return *this; + } + private: + T r; + T i; + }; + + template<class T> _UCXXEXPORT complex<T> operator+(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval += rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator+(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + ls += rs; + return retval; + } + template<class T> _UCXXEXPORT inline complex<T> operator+(const T& ls, const complex<T>& rs){ + return rs + ls; + } + template<class T> _UCXXEXPORT complex<T> operator-(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval -= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator-(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + retval -= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator-(const T& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval -= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator*(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval *= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator*(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + retval *= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator*(const T& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval *=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator/(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval/=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator/(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + retval/=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator/(const T& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval/=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator+(const complex<T>& v){ + return v; + } + template<class T> _UCXXEXPORT complex<T> operator-(const complex<T>& v){ + return complex<T> (-v.real(), -v.imag()); + } + template<class T> _UCXXEXPORT bool operator==(const complex<T>& ls, const complex<T>& rs){ + if( ls.real() == rs.real() && ls.imag() == rs.image()){ + return true; + } + return false; + } + template<class T> _UCXXEXPORT bool operator==(const complex<T>& ls, const T& rs){ + if(ls.real() == rs && ls.imag() == T()){ + return true; + } + return false; + } + template<class T> _UCXXEXPORT bool operator==(const T& ls, const complex<T>& rs){ + if(ls == rs.real() && rs.imag() == T()){ + return true; + } + return false; + } + template<class T> _UCXXEXPORT bool operator!=(const complex<T>& ls, const complex<T>& rs){ + if(ls == rs){ + return false; + } + return true; + } + template<class T> _UCXXEXPORT bool operator!=(const complex<T>& ls, const T& rs){ + if(ls == rs){ + return false; + } + return true; + } + template<class T> _UCXXEXPORT bool operator!=(const T& ls, const complex<T>& rs){ + if(ls == rs){ + return false; + } + return true; + } + template<class T, class charT, class traits> _UCXXEXPORT basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, complex<T>& v) + { + T tempr; + T tempi; + is >> tempr; + is.get(); + is >> tempi; + v = complex<T>(tempr, tempi); + return is; + } + + template<class T, class charT, class traits> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const complex<T>&v) + { + os << v.real() << ", " << v.imag(); + return os; + } + + template<class T> _UCXXEXPORT T real(const complex<T>& v){ + return v.real(); + } + + template<class T> _UCXXEXPORT T imag(const complex<T>& v){ + return v.imag(); + } + + template<class T> _UCXXEXPORT T norm(const complex<T>& v){ + return (v.real() * v.real() + v.imag() * v.imag()); + } + + template<class T> _UCXXEXPORT complex<T> conj(const complex<T>& v){ + return complex<T>(v.real(), -v.imag()); + } + +#ifdef __UCLIBCXX_SUPPORT_MATH__ //Can we link with libm? + + template<class T> _UCXXEXPORT T abs(const complex<T>& v){ + return sqrt(v.real() * v.real() + v.imag() * v.imag()); + } + + template<class T> _UCXXEXPORT T arg(const complex<T>& v){ + return atan2(v.imag(), v.real()); + } + + template<class T> _UCXXEXPORT complex<T> polar(const T& rho, const T& theta){ + return complex<T>(rho * cos(theta), rho * sin(theta)); + } + + template<class T> _UCXXEXPORT complex<T> cos (const complex<T>& v){ + return complex<T>(cos(v.real()) * cosh(v.imag()), -sin(v.real()) * sinh(v.imag())); + } + + template<class T> _UCXXEXPORT complex<T> cosh (const complex<T>& v){ + return complex<T>(cosh(v.real()) * cos(v.imag()), sinh(v.real()) * sin(v.imag())); + } + + template<class T> _UCXXEXPORT complex<T> exp (const complex<T>& v){ + return polar(exp(v.real()), v.imag()); + } + + template<class T> _UCXXEXPORT complex<T> log (const complex<T>& v){ + return complex<T>(log(abs(v)), arg(v)); + } + + template<class T> _UCXXEXPORT complex<T> log10(const complex<T>& v){ + return (log(v) / log(T(10.0))); + } + + template<class T> _UCXXEXPORT complex<T> pow(const complex<T>& v, int p){ + T rho = pow(abs(v), p); + T theta = arg(v); + return complex<T>(rho * cos(p * theta), rho * sin(p * theta) ); + } + + template<class T> _UCXXEXPORT complex<T> pow(const complex<T>& v, const T& p){ + return polar( pow(abs(v),p), arg(v)*p ); + } + + template<class T> _UCXXEXPORT complex<T> pow(const complex<T>& v, const complex<T>& p){ + if(v == T()){ + //We are using "0" as the value + return T(); + } + return exp(p * log(v)); + } + + template<class T> _UCXXEXPORT complex<T> pow(const T& v, const complex<T>& p){ + if(v == T()){ + return T(); + } + return polar(pow(v,p.real()), y.imag() * log(x) ); + } + + template<class T> _UCXXEXPORT complex<T> sin (const complex<T>& v){ + return complex<T>(sin(v.real()) * cosh(v.imag()), cosh(v.real()) * sin(v.imag())); + } + + template<class T> _UCXXEXPORT complex<T> sinh (const complex<T>& v){ + return complext<T>(sinh(v.real()) * cos(v.imag()), cosh(v.real()) * sin(v.imag()) ); + } + + template<class T> _UCXXEXPORT complex<T> sqrt (const complex<T>&); + template<class T> _UCXXEXPORT complex<T> tan (const complex<T>& v){ + return sin(v) / cos(v); + } + + template<class T> _UCXXEXPORT complex<T> tanh (const complex<T>& v){ + return sinh(v) / cosh(v); + } + +#endif + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/csetjmp.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/csetjmp.svn-base new file mode 100644 index 0000000..a11f932 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/csetjmp.svn-base @@ -0,0 +1,44 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <setjmp.h> + +#ifndef __STD_HEADER_CSETJMP +#define __STD_HEADER_CSETJMP 1 + + +//From GCC Header files +#undef longjmp + +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef setjmp +#define setjmp(env) setjmp (env) +#endif + +//Mine again + + +namespace std{ + using ::longjmp; + using ::jmp_buf; +} + + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/csignal.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/csignal.svn-base new file mode 100644 index 0000000..eeec6e1 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/csignal.svn-base @@ -0,0 +1,59 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 20.4.6 C library +// + +/** @file csignal + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c signal.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CSIGNAL +#define _CPP_CSIGNAL 1 + +#include <signal.h> + +// Get rid of those macros defined in <signal.h> in lieu of real functions. +#undef raise + +namespace std +{ + using ::sig_atomic_t; + using ::signal; + using ::raise; +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cstdarg.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cstdarg.svn-base new file mode 100644 index 0000000..1bd83d7 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cstdarg.svn-base @@ -0,0 +1,58 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 20.4.6 C library +// + +/** @file cstdarg + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c stdarg.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CSTDARG +#define _CPP_CSTDARG 1 + +#include <stdarg.h> + +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef va_end +#define va_end(ap) va_end (ap) +#endif + +namespace std +{ + using ::va_list; +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cstddef.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cstddef.svn-base new file mode 100644 index 0000000..5d99d7a --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cstddef.svn-base @@ -0,0 +1,54 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 18.1 Types +// + +/** @file cstddef + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c stddef.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CSTDDEF +#define _CPP_CSTDDEF 1 + +#include <stddef.h> + +namespace std +{ + using ::ptrdiff_t; + using ::size_t; +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cstdio.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cstdio.svn-base new file mode 100644 index 0000000..aab1283 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cstdio.svn-base @@ -0,0 +1,75 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation version 2.1 + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <stdio.h> +#include <basic_definitions> + +#ifndef __HEADER_CSTDIO +#define __HEADER_CSTDIO 1 + + +namespace std{ + using ::FILE; + using ::fpos_t; + + using ::clearerr; + using ::fclose; + using ::feof; + using ::ferror; + using ::fflush; + using ::fgetc; + using ::fgetpos; + using ::fgets; + using ::fopen; + using ::fprintf; + using ::fputc; + using ::fputs; + using ::fread; + using ::freopen; + using ::fscanf; + using ::fseek; + using ::fsetpos; + using ::ftell; + using ::fwrite; + using ::getc; + using ::getchar; + using ::gets; + using ::perror; + using ::printf; + using ::putc; + using ::putchar; + using ::puts; + using ::remove; + using ::rename; + using ::rewind; + using ::scanf; + using ::setbuf; + using ::setvbuf; + using ::sprintf; + using ::sscanf; + using ::tmpfile; + using ::tmpnam; + using ::ungetc; + using ::vfprintf; + using ::vprintf; + using ::vsprintf; +} + + + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cstdlib.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cstdlib.svn-base new file mode 100644 index 0000000..b85ed36 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cstdlib.svn-base @@ -0,0 +1,71 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <stdlib.h> +#include <basic_definitions> + +#ifndef __HEADER_CSTDLIB +#define __HEADER_CSTDLIB 1 + + +namespace std{ + using ::abort; + using ::abs; + using ::atexit; + using ::atol; + using ::atof; + using ::atoi; + using ::bsearch; + using ::calloc; + using ::div; + using ::exit; + using ::free; + using ::getenv; + using ::labs; + using ::ldiv; + using ::malloc; + using ::qsort; + using ::rand; + using ::realloc; + using ::srand; + using ::strtod; + using ::strtol; + using ::strtoul; + using ::system; +#ifdef __UCLIBCXX_HAS_WCHAR__ + using ::mblen; + using ::mbstowcs; + using ::mbtowc; + using ::wctomb; + using ::wcstombs; +#endif + + inline long abs(long i){ + return labs(i); + } + + inline ldiv_t div(long i, long j){ + return ldiv(i, j); + } + +} + + + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cstring.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cstring.svn-base new file mode 100644 index 0000000..d7bf7e1 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cstring.svn-base @@ -0,0 +1,78 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstddef> +#include <string.h> + +#ifndef __HEADER_CSTRING +#define __HEADER_CSTRING 1 + + +namespace std{ + + using ::memchr; + using ::memcmp; + using ::memcpy; + using ::memmove; + using ::memset; + using ::strcat; + using ::strchr; + using ::strcmp; + using ::strcoll; + using ::strcpy; + using ::strcspn; + using ::strerror; + using ::strlen; + using ::strncat; + using ::strncmp; + using ::strncpy; + using ::strpbrk; + using ::strrchr; + using ::strspn; + using ::strstr; + using ::strtok; + using ::strxfrm; + + + //Extra definitions required in c++ spec + + + inline void* memchr(void* s, int c, size_t n){ + return memchr(const_cast<const void *>(s), c, n); + } + + inline char* strchr(char* s, int c){ + return strchr(const_cast<const char *>(s), c); + } + + inline char* strpbrk(char* s1, const char* s2){ + return strpbrk(const_cast<const char *>(s1), s2); + } + + inline char* strrchr(char* s, int c){ + return strrchr(const_cast<const char *>(s), c); + } + + inline char* strstr(char* s1, const char* s2){ + return strstr(const_cast<const char *>(s1), s2); + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/ctime.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/ctime.svn-base new file mode 100644 index 0000000..731fff3 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/ctime.svn-base @@ -0,0 +1,79 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 20.5 Date and time +// + +/** @file ctime + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c time.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CTIME +#define _CPP_CTIME 1 + +#include <cstddef> + +#include <time.h> + +// Get rid of those macros defined in <time.h> in lieu of real functions. +#undef clock +#undef difftime +#undef mktime +#undef time +#undef asctime +#undef ctime +#undef gmtime +#undef localtime +#undef strftime + +namespace std +{ + using ::clock_t; + using ::time_t; + using ::tm; + + using ::clock; + using ::difftime; + using ::mktime; + using ::time; + using ::asctime; + using ::ctime; + using ::gmtime; + using ::localtime; + using ::strftime; +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cwchar.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cwchar.svn-base new file mode 100644 index 0000000..03fae09 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cwchar.svn-base @@ -0,0 +1,86 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation version 2.1 + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <wchar.h> +#include <basic_definitions> + +#ifndef __HEADER_CWCHAR +#define __HEADER_CWCHAR 1 + + +namespace std{ + using ::mbstate_t; + using ::wint_t; + + using ::btowc; + using ::fgetwc; + using ::fgetws; + using ::fputwc; + using ::fputws; + using ::fwide; + using ::fwprintf; + using ::fwscanf; + using ::getwc; + using ::getwchar; + using ::mbrlen; + using ::mbrtowc; + using ::mbsinit; + using ::mbsrtowcs; + using ::putwc; + using ::putwchar; + using ::swprintf; + using ::swscanf; + using ::ungetwc; + using ::vfwprintf; + using ::vswprintf; + using ::vwprintf; + using ::wcrtomb; + using ::wcscat; + using ::wcschr; + using ::wcscmp; + using ::wcscoll; + using ::wcscpy; + using ::wcscspn; + using ::wcsftime; + using ::wcslen; + using ::wcsncat; + using ::wcsncmp; + using ::wcsncpy; + using ::wcspbrk; + using ::wcsrchr; + using ::wcsrtombs; + using ::wcsspn; + using ::wcsstr; + using ::wcstod; + using ::wcstok; + using ::wcstol; + using ::wcstoul; + using ::wcsxfrm; + using ::wctob; + using ::wmemchr; + using ::wmemcmp; + using ::wmemcpy; + using ::wmemmove; + using ::wmemset; + using ::wprintf; + using ::wscanf; +} + + + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/cwctype.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/cwctype.svn-base new file mode 100644 index 0000000..fc05f01 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/cwctype.svn-base @@ -0,0 +1,104 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: <cwctype> +// + +/** @file cwctype + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c wctype.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CWCTYPE +#define _CPP_CWCTYPE 1 + +//#include <bits/c++config.h> + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <wctype.h> +#endif + +// Get rid of those macros defined in <wctype.h> in lieu of real functions. +#undef iswalnum +#undef iswalpha +#undef iswblank +#undef iswcntrl +#undef iswdigit +#undef iswgraph +#undef iswlower +#undef iswprint +#undef iswprint +#undef iswpunct +#undef iswspace +#undef iswupper +#undef iswxdigit +#undef iswctype +#undef towlower +#undef towupper +#undef towctrans +#undef wctrans +#undef wctype + +#if __UCLIBCXX_HAS_WCHAR__ +namespace std +{ + using ::wint_t; // cwchar + + using ::wctype_t; + using ::wctrans_t; + + using ::iswalnum; + using ::iswalpha; + using ::iswblank; + using ::iswcntrl; + using ::iswdigit; + using ::iswgraph; + using ::iswlower; + using ::iswprint; + using ::iswprint; + using ::iswpunct; + using ::iswspace; + using ::iswupper; + using ::iswxdigit; + using ::iswctype; + using ::towlower; + using ::towupper; + using ::towctrans; + using ::wctrans; + using ::wctype; +} +#endif //__ULIBCXX_HAS_WCHAR__ + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/deque.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/deque.svn-base new file mode 100644 index 0000000..c866eec --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/deque.svn-base @@ -0,0 +1,807 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <memory> +#include <iterator> +#include <stdexcept> + +#ifndef __STD_HEADER_DEQUE +#define __STD_HEADER_DEQUE + + +namespace std{ + template <class T, class Allocator = allocator<T> > class deque; + template <class T, class Allocator> bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> void swap(deque<T,Allocator>& x, deque<T,Allocator>& y); + + template <class T, class Allocator> class _UCXXEXPORT deque { + public: + friend bool operator==<>(const deque<T, Allocator>& x, const deque<T, Allocator>& y); + friend class deque_iter; + friend class deque_citer; + class deque_iter; + class deque_citer; + + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef deque_iter iterator; + typedef deque_citer const_iterator; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef T value_type; + typedef Allocator allocator_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + + explicit deque(const Allocator& al = Allocator()); + explicit deque(size_type n, const T& value = T(), const Allocator& al = Allocator()); + template <class InputIterator> deque(InputIterator first, InputIterator last, const Allocator& = Allocator()); + deque(const deque<T,Allocator>& x); + ~deque(); + + deque<T,Allocator>& operator=(const deque<T,Allocator>& x); + template <class InputIterator> void assign(InputIterator first, InputIterator last); + template <class Size, class U> void assign(Size n, const U& u = U()); + allocator_type get_allocator() const; + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + size_type size() const; + size_type max_size() const; + void resize(size_type sz, T c = T()); + bool empty() const; + + reference operator[](size_type n); + const_reference operator[](size_type n) const; + reference at(size_type n); + const_reference at(size_type n) const; + reference front(); + const_reference front() const; + reference back(); + const_reference back() const; + + void push_front(const T& x); + void push_back(const T& x); + iterator insert(iterator position, const T& x = T()); + void insert(iterator position, size_type n, const T& x); + template <class InputIterator> void insert (iterator position, InputIterator first, InputIterator last); + void pop_front(); + void pop_back(); + + iterator erase(iterator position); + iterator erase(iterator first, iterator last); + void swap(deque<T,Allocator>&); + void clear(); + + protected: + void reserve(size_type n); + inline size_type array_element(size_type deque_element) const{ + if(deque_element < (data_size - first_element)){ + return first_element + deque_element; + } + return deque_element - (data_size - first_element); + } + inline size_type first_subtract(size_type sub_size) const{ + if(sub_size > first_element){ + return (data_size - first_element) - sub_size; + } + return first_element - sub_size; + } + + T * data; + size_type data_size; //Physical size of array + size_type elements; //Elements in array + size_type first_element; //Element number of array 0..n + size_type last_element; //Element number of array 0..n + Allocator a; + + }; + + + template<class T, class Allocator> class _UCXXEXPORT deque<T, Allocator>::deque_iter + : public std::iterator< + random_access_iterator_tag, + T, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + friend class deque<T, Allocator>; + protected: + deque<T, Allocator> * container; + typename Allocator::size_type element; + + public: + deque_iter() : container(0), element(0) { } + deque_iter(const deque_iter & d) : container (d.container), element(d.element) { } + deque_iter(deque<T, Allocator> * c, typename Allocator::size_type e) + : container(c), element(e) + { + return; + } + ~deque_iter() { } + deque_iter & operator=(const deque_iter & d){ + container = d.container; + element = d.element; + return *this; + } + T & operator*(){ + return container->data[container->array_element(element)]; + } + T * operator->(){ + return container->data + container->array_element(element); + } + const T & operator*() const{ + return container->data[container->array_element(element)]; + } + const T * operator->() const{ + return container->data + container->array_element(element); + } + bool operator==(const deque_iter & d) const{ + if(container == d.container && element == d.element){ + return true; + } + return false; + } + bool operator!=(const deque_iter & d) const{ + if(container != d.container || element != d.element){ + return true; + } + return false; + } + bool operator<(const deque_iter & d) const{ + if(element < d.element){ + return true; + } + return false; + } + bool operator<=(const deque_iter & d) const{ + if(element <= d.element){ + return true; + } + return false; + } + bool operator>(const deque_iter & d) const{ + if(element > d.element){ + return true; + } + return false; + } + bool operator>=(const deque_iter & d) const{ + if(element >= d.element){ + return true; + } + return false; + } + deque_iter & operator++(){ + ++element; + return *this; + } + deque_iter operator++(int){ + deque_iter temp(container, element); + ++element; + return temp; + } + deque_iter operator+(typename Allocator::size_type n){ + deque_iter temp(container, element + n); + return temp; + } + deque_iter & operator+=(typename Allocator::size_type n){ + element += n; + return *this; + } + deque_iter & operator--(){ + --element; + return *this; + } + deque_iter operator--(int){ + deque_iter temp(container, element); + --element; + return temp; + } + deque_iter operator-(typename Allocator::size_type n){ + deque_iter temp(container, element - n); + return temp; + } + deque_iter & operator-=(typename Allocator::size_type n){ + element -= n; + return *this; + } + typename Allocator::size_type operator-(const deque_iter & d){ + return element - d.element; + } + + }; + + template<class T, class Allocator> class _UCXXEXPORT deque<T, Allocator>::deque_citer + : public std::iterator< + random_access_iterator_tag, + T, + typename Allocator::difference_type, + typename Allocator::const_pointer, + typename Allocator::const_reference + > + { + friend class deque<T, Allocator>; + protected: + const deque<T, Allocator> * container; + typename Allocator::size_type element; + + public: + deque_citer() : container(0), element(0) { } + deque_citer(const deque_citer & d) : container (d.container), element(d.element) { } + deque_citer(const deque<T, Allocator> * c, typename Allocator::size_type e) + : container(c), element(e) + { + return; + } + ~deque_citer() { } + deque_citer & operator=(const deque_iter & d){ + container = d.container; + element = d.element; + return *this; + } + const T & operator*() const{ + return container->data[container->array_element(element)]; + } + const T * operator->() const{ + return container->data + container->array_element(element); + } + bool operator==(const deque_citer & d) const{ + if(container == d.container && element == d.element){ + return true; + } + return false; + } + bool operator!=(const deque_citer & d) const{ + if(container != d.container || element != d.element){ + return true; + } + return false; + } + bool operator<(const deque_citer & d) const{ + if(element < d.element){ + return true; + } + return false; + } + bool operator<=(const deque_citer & d) const{ + if(element <= d.element){ + return true; + } + return false; + } + bool operator>(const deque_citer & d) const{ + if(element > d.element){ + return true; + } + return false; + } + bool operator>=(const deque_citer & d){ + if(element >= d.element){ + return true; + } + return false; + } + deque_citer & operator++(){ + ++element; + return *this; + } + deque_citer operator++(int){ + deque_citer temp(container, element); + ++element; + return temp; + } + deque_citer operator+(typename Allocator::size_type n){ + deque_citer temp(container, element + n); + return temp; + } + deque_citer & operator+=(typename Allocator::size_type n){ + element += n; + return *this; + } + deque_citer & operator--(){ + --element; + return *this; + } + deque_citer operator--(int){ + deque_citer temp(container, element); + --element; + return temp; + } + deque_citer operator-(typename Allocator::size_type n){ + deque_citer temp(container, element - n); + return temp; + } + deque_citer & operator-=(typename Allocator::size_type n){ + element -= n; + return *this; + } + typename Allocator::size_type operator-(const deque_citer & d){ + return element - d.element; + } + + }; + + template<class T, class Allocator> deque<T, Allocator>::deque(const Allocator& al) + : data(0), + data_size(0), elements(0), first_element(0), last_element(0), a(al) + { + data_size = __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = data_size /2; + last_element = first_element; + } + + + template<class T, class Allocator> deque<T, Allocator>::deque( + size_type n, const T& value, const Allocator& al) + : data(0), + elements(n), first_element(0), last_element(0), a(al) + { + data_size = elements + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = (data_size - elements) / 2; + last_element = first_element; + + for(n=first_element ; n < last_element; ++n ){ + a.construct(data+n, value); + } + } + + + template<class T, class Allocator> template <class InputIterator> + deque<T, Allocator>::deque(InputIterator first, InputIterator last, const Allocator& al) + : data(0), + data_size(0), elements(0), first_element(0), last_element(0), a(al) + { + data_size = __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = data_size / 4; //Note sure how big, but let's add a little space... + last_element = first_element; + while(first != last){ + push_back(*first); + ++first; + } + } + + + template<class T, class Allocator> deque<T, Allocator>::deque(const deque<T,Allocator>& x) + : data(0), + elements(0), first_element(0), last_element(0), a(x.a) + { + data_size = x.elements + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = (data_size - x.elements) / 2; + last_element = first_element; + for(size_type i=0; i < x.elements; ++i){ + push_back(x[i]); + } + } + + + template<class T, class Allocator> deque<T, Allocator>::~deque(){ + clear(); + a.deallocate(data, data_size); + } + + template<class T, class Allocator> deque<T,Allocator>& deque<T, Allocator>:: + operator=(const deque<T,Allocator>& x) + { + if(&x == this){ + return *this; + } + resize(x.elements); + for(size_t i = 0; i < elements; ++i){ + data[array_element(i)] = x[i]; + } + return *this; + } + + + template<class T, class Allocator> template <class InputIterator> void + deque<T, Allocator>::assign(InputIterator first, InputIterator last) + { + clear(); + while(first !=last){ + push_back(*first); + ++first; + } + } + + + template<class T, class Allocator> template <class Size, class U> void + deque<T, Allocator>::assign(Size n, const U& u) + { + if(&u == this){ + return; + } + clear(); + for(size_type i = 0; i < n; ++i){ + push_back(u); + } + } + + + template<class T, class Allocator> typename deque<T, Allocator>::allocator_type + deque<T, Allocator>::get_allocator() const + { + return a; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::begin() + { + return deque_iter(this, 0); + } + + + template<class T, class Allocator> typename deque<T, Allocator>::const_iterator + deque<T, Allocator>::begin() const + { + return deque_citer(this, 0); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::end() + { + return deque_iter(this, elements); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_iterator deque<T, Allocator>::end() const + { + return deque_citer(this, elements); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reverse_iterator deque<T, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reverse_iterator deque<T, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reverse_iterator deque<T, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reverse_iterator deque<T, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::size_type deque<T, Allocator>::size() const + { + return elements; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::size_type deque<T, Allocator>::max_size() const + { + return ((size_type)(-1)) / sizeof(T); + } + + template<class T, class Allocator> void deque<T, Allocator>::resize(size_type sz, T c){ + reserve(sz); + while(sz > size()){ + push_back(c); + } + while(sz < size()){ + pop_back(); + } + } + + template<class T, class Allocator> bool deque<T, Allocator>::empty() const{ + return (elements == 0); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::operator[](size_type n) + { + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::operator[](size_type n) const + { + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::at(size_type n) + { + if(n > elements){ + __throw_out_of_range("Out of deque range"); + } + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::at(size_type n) const + { + if(n > elements){ + __throw_out_of_range("Out of deque range"); + } + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::front() + { + return data[first_element]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::front() const + { + return data[first_element]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::back() + { + return data[array_element(elements-1)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::back() const + { + return data[array_element(elements-1)]; + } + + template<class T, class Allocator> void deque<T, Allocator>::push_front(const T& x){ + reserve(elements + 1); + first_element = first_subtract(1); + a.construct(data + first_element, x); + ++elements; + } + + template<class T, class Allocator> void deque<T, Allocator>::push_back(const T& x){ + reserve(elements + 1); + a.construct(data + last_element, x); + ++elements; + last_element = array_element(elements); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::insert(iterator position, const T& x) + { + reserve(elements+1); + if(position.element > (elements/2)){ + //Push all elements back 1 + push_back(x); + for(size_type i = elements-1; i > position.element; --i){ + at(i) = at(i-1); + } + }else{ + //Push all elements forward 1 + push_front(x); + for(size_type i = 0; i < position.element; ++i){ + at(i) = at(i+1); + } + } + at(position.element) = x; + return deque_iter(this, position.element); + } + + template<class T, class Allocator> void deque<T, Allocator>:: + insert(typename deque<T, Allocator>::iterator position, size_type n, const T& x) + { + reserve(elements + n); + for(size_t i =0; i < n; ++i){ + position = insert(position, x); + } + } + + template<class T, class Allocator> template <class InputIterator> + void deque<T, Allocator>::insert (iterator position, InputIterator first, InputIterator last) + { + while(first != last){ + position = insert(position, *first); + ++first; + } + } + + template<class T, class Allocator> void deque<T, Allocator>::pop_front(){ + if(elements == 0){ + __throw_out_of_range("deque pop_front"); + } + a.destroy(data + first_element); + first_element = array_element(1); + --elements; + } + + template<class T, class Allocator> void deque<T, Allocator>::pop_back(){ + last_element = array_element(elements - 1); + a.destroy(data + last_element); + --elements; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::erase(typename deque<T, Allocator>::iterator position) + { + if(position.element > (elements /2)){ + for(size_type i = position.element; i < elements - 1; ++i){ + at(i) = at(i+1); + } + pop_back(); + }else{ + for(size_type i = position.element; i > 0; --i){ + at(i) = at(i-1); + } + pop_front(); + } + return deque_iter(this, position.element); + } + + template<class T, class Allocator> typename deque<T, Allocator>::iterator + deque<T, Allocator>:: + erase(typename deque<T, Allocator>::iterator first, typename deque<T, Allocator>::iterator last) + { + //Shift backwards + size_type num_move = last.element - first.element; + if( first.element > (elements - last.element) ){ + for(size_type i = last.element; i < elements ; ++i){ + at(i-num_move) = at(i); + } + for(size_type i = 0; i < num_move ; ++i){ + pop_back(); + } + }else{ + for(size_type i = 0; i < first.element ; ++i){ + at(last.element - i - 1) = at(first.element - i - 1); + } + for(size_type i = 0; i < num_move ; ++i){ + pop_front(); + } + } + return deque_iter(this, first.element); + } + + template<class T, class Allocator> void deque<T, Allocator>::swap(deque<T,Allocator>& x) + { + T * temp_data; + typename deque<T,Allocator>::size_type temp_size; + + //Swap data pointers + temp_data = x.data; + x.data = data; + data = temp_data; + + //Swap array sizes + temp_size = x.data_size; + x.data_size = data_size; + data_size = temp_size; + + //Swap num array elements + temp_size = x.elements; + x.elements = elements; + elements = temp_size; + + //Swap first_pointer + temp_size = x.first_element; + x.first_element = first_element; + first_element = temp_size; + + //Swap last_pointer + temp_size = x.last_element; + x.last_element = last_element; + last_element = temp_size; + } + + template<class T, class Allocator> void deque<T, Allocator>::clear() + { + while(elements > 0 ){ + pop_back(); + } + } + + + template<class T, class Allocator> void deque<T, Allocator>::reserve(typename deque<T, Allocator>::size_type n) + { + if(data_size >= n){ + return; + } + + size_type size_temp; + size_type first_temp; + T * data_temp; + size_temp = n + __UCLIBCXX_STL_BUFFER_SIZE__; //Reserve extra 'cause we can + data_temp = a.allocate(size_temp); + + first_temp = (size_temp - elements) / 2; + for(size_type i = 0; i < elements; ++i){ + a.construct(data_temp + first_temp + i, data[array_element(i)]); + a.destroy(data + array_element(i)); + } + + //Now shuffle pointers + a.deallocate(data, data_size); + data = data_temp; + data_size = size_temp; + first_element = first_temp; + last_element = first_element + elements; + } + + + template <class T, class Allocator> _UCXXEXPORT + bool + operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y) + { + if(x.elements != y.elements){ + return false; + } + for(typename deque<T,Allocator>::size_type i = 0; i < x.elements; ++i){ + if(x[i] < y[i] || y[i] < x[i]){ + return false; + } + } + return true; + } + + template <class T, class Allocator> bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> _UCXXEXPORT + bool + operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y) + { + if(x == y){ + return false; + } + return true; + } + template <class T, class Allocator> bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> _UCXXEXPORT void swap(deque<T,Allocator>& x, deque<T,Allocator>& y){ + x.swap(y); + } + + + +} + +#endif + + + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/exception.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/exception.svn-base new file mode 100644 index 0000000..87cb103 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/exception.svn-base @@ -0,0 +1,120 @@ +// Exception Handling support header for -*- C++ -*- + +// Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002 +// Free Software Foundation +// +// This file is part of GNU CC. +// +// GNU CC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GNU CC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU CC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +/** @file exception + * This header defines several types and functions relating to the + * handling of exceptions in a C++ program. + */ + +#ifndef __EXCEPTION__ +#define __EXCEPTION__ + +#include <basic_definitions> + +extern "C++" { + +namespace std +{ + /** + * @brief Base class for all library exceptions. + * + * This is the base class for all exceptions thrown by the standard + * library, and by certain language expressions. You are free to derive + * your own %exception classes, or use a different hierarchy, or to + * throw non-class data (e.g., fundamental types). + */ + class exception + { + public: + exception() throw() { } + virtual ~exception() throw(); + /** Returns a C-style character string describing the general cause + * of the current error. */ + virtual const char* what() const throw(); + }; + + /** If an %exception is thrown which is not listed in a function's + * %exception specification, one of these may be thrown. */ + class bad_exception : public exception + { + public: + bad_exception() throw() { } + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_exception() throw(); + }; + + /// If you write a replacement %terminate handler, it must be of this type. + typedef void (*terminate_handler) (); + /// If you write a replacement %unexpected handler, it must be of this type. + typedef void (*unexpected_handler) (); + + /// Takes a new handler function as an argument, returns the old function. + terminate_handler set_terminate(terminate_handler) throw(); + /** The runtime will call this function if %exception handling must be + * abandoned for any reason. */ + void terminate() __UCLIBCXX_NORETURN; + + /// Takes a new handler function as an argument, returns the old function. + unexpected_handler set_unexpected(unexpected_handler) throw(); + /** The runtime will call this function if an %exception is thrown which + * violates the function's %exception specification. */ + void unexpected() __UCLIBCXX_NORETURN; + + /** [18.6.4]/1: "Returns true after completing evaluation of a + * throw-expression until either completing initialization of the + * exception-declaration in the matching handler or entering @c unexpected() + * due to the throw; or after entering @c terminate() for any reason + * other than an explicit call to @c terminate(). [Note: This includes + * stack unwinding [15.2]. end note]" + * + * 2: "When @c uncaught_exception() is true, throwing an %exception can + * result in a call of @c terminate() (15.5.1)." + */ + bool uncaught_exception() throw(); +} // namespace std + +namespace __gnu_cxx +{ + /** A replacement for the standard terminate_handler which prints more + information about the terminating exception (if any) on stderr. Call + @code + std::set_terminate (__gnu_cxx::__verbose_terminate_handler) + @endcode + to use. For more info, see + http://gcc.gnu.org/onlinedocs/libstdc++/19_diagnostics/howto.html#4 + */ + void __verbose_terminate_handler (); +} // namespace __gnu_cxx + +} // extern "C++" + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/fstream.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/fstream.svn-base new file mode 100644 index 0000000..dce4dda --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/fstream.svn-base @@ -0,0 +1,674 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#if 0 +#ifndef __STD_HEADER_FSTREAM +#define __STD_HEADER_FSTREAM 1 + +//#if __UCLIBCXX_SUPPORT_FILEIO__ + +#include<basic_definitions> + +#include <cstdio> +#include <cstdlib> +#include <streambuf> +#include <istream> +#include <ostream> +#include <char_traits> + +#include <unistd.h> +#include <fcntl.h> +#include <errno.h> + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <cwchar> +#include <cwctype> +#endif //__UCLIBCXX_HAS_WCHAR__ + +namespace std{ + + template <class C, class T> class basic_filebuf; + + typedef basic_filebuf<char> filebuf; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_filebuf<wchar_t> wfilebuf; +#endif + + + template <class charT, class traits> class _UCXXEXPORT basic_filebuf + : public basic_streambuf<charT,traits> + { +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + friend ios_base::Init::Init(); //Needed for cout/cin stuff +#endif + public: + // Types (inherited from basic_streambuf: + typedef typename basic_streambuf<charT, traits>::char_type char_type; + typedef typename basic_streambuf<charT, traits>::int_type int_type; + typedef typename basic_streambuf<charT, traits>::pos_type pos_type; + typedef typename basic_streambuf<charT, traits>::off_type off_type; + typedef traits traits_type; + + //Constructors/destructor: + + _UCXXEXPORT basic_filebuf() : basic_streambuf<charT, traits>(), fp(0), pbuffer(0), gbuffer(0) + { + append=false; + pbuffer = new char_type[__UCLIBCXX_IOSTREAM_BUFSIZE__]; + gbuffer = new char_type[__UCLIBCXX_IOSTREAM_BUFSIZE__]; + + setp(pbuffer, pbuffer + __UCLIBCXX_IOSTREAM_BUFSIZE__); + //Position get buffer so that there is no data available + setg(gbuffer, gbuffer + __UCLIBCXX_IOSTREAM_BUFSIZE__, + gbuffer + __UCLIBCXX_IOSTREAM_BUFSIZE__); + } + + + _UCXXEXPORT virtual ~basic_filebuf(){ + sync(); + close(); + delete [] pbuffer; + delete [] gbuffer; + pbuffer = 0; + gbuffer = 0; + } + + + //Members: + + _UCXXEXPORT bool is_open() const{ + if(fp == 0){ + return false; + } + return true; + } + + _UCXXEXPORT basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode){ + bool move_end = (mode & ios_base::ate) != 0; + if(is_open() !=false){ //Must call close() first + return 0; + } + basic_streambuf<charT,traits>::openedFor = mode; + mode = mode & ~ios_base::ate; + + if(mode == ios_base::out || mode == (ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w" ); + }else if((mode & ios_base::app) && ! (mode & ios_base::trunc)){ + if(mode & ios_base::binary){ + if(mode & ios_base::in){ + fp = fopen(s, "a+b"); + }else{ + fp = fopen(s, "ab"); + } + }else{ + if(mode & ios_base::in){ + fp = fopen(s, "a+"); + }else{ + fp = fopen(s, "a"); + } + } + }else if(mode == ios_base::in){ + fp = fopen(s, "r"); + }else if(mode == (ios_base::in | ios_base::out)){ + fp = fopen(s, "r+"); + }else if(mode == (ios_base::in | ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w+"); + }else if(mode == (ios_base::binary | ios_base::out)){ + fp = fopen(s, "wb"); + }else if(mode == (ios_base::in | ios_base::binary)){ + fp = fopen(s, "rb"); + }else if(mode == (ios_base::in | ios_base::binary | ios_base::out)){ + fp = fopen(s, "r+b"); + }else if(mode==(ios_base::binary | ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w+b"); + }else if(mode == (ios_base::in | ios_base::binary | ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w+b"); + } + + if(fp == 0){ + return 0; + } + if(ferror(fp)){ + fclose(fp); + fp=0; + return 0; + } + int retval = 0; + + //Check to make sure the stream is good + if(move_end == true){ + retval = fseek(fp, 0, SEEK_END); + }else{ + retval = fseek(fp, 0, SEEK_SET); + } + if(retval!=0){ //Seek error + fclose(fp); + fp=0; + return 0; + } + + basic_streambuf<charT,traits>::mgnext = basic_streambuf<charT,traits>::mgend; + + return this; + } + _UCXXEXPORT basic_filebuf<charT,traits>* close(){ + if(fp != 0 && fp != stdin && fp != stdout && fp !=stderr ){ + overflow(); + sync(); + int retval = fclose(fp); + if(retval !=0){ //Error of some sort + return 0; + } + fp=0; + } + return this; + } + protected: + _UCXXEXPORT basic_filebuf(const basic_filebuf<charT,traits> &){ } + _UCXXEXPORT basic_filebuf<charT,traits> & operator=(const basic_filebuf<charT,traits> &){ return *this; } + + //Overridden virtual functions: + + virtual _UCXXEXPORT int showmanyc(){ + return basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr(); + } + virtual _UCXXEXPORT int_type underflow(){ + /* Some variables used internally: + Buffer pointers: + charT * mgbeg; + charT * mgnext; + charT * mgend; + + eback() returns mgbeg + gptr() returns mgnext + egptr() returns mgend + + gbump(int n) mgnext+=n + + */ + + if(!is_open()){ + return traits::eof(); + } + + if(basic_streambuf<charT,traits>::eback() == 0){ + //No buffer, so... + charT c; + int retval; + retval = fread(&c, sizeof(charT), 1, fp); + + if(retval == 0 || feof(fp) || ferror(fp) ){ + return traits::eof(); + } + return traits::to_int_type(c); + } + + if(basic_streambuf<charT,traits>::eback() == basic_streambuf<charT,traits>::gptr()){ //Buffer is full + return traits::to_int_type(*basic_streambuf<charT,traits>::gptr()); + } + //Shift entire buffer back to the begining + size_t offset = basic_streambuf<charT,traits>::gptr() - basic_streambuf<charT,traits>::eback(); + size_t amountData = basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr(); + + for(charT * i = basic_streambuf<charT,traits>::gptr(); i < basic_streambuf<charT,traits>::egptr(); ++i){ + *(i-offset) = *i; + } + + size_t retval = 0; + //Save operating flags from file descriptor + int fcntl_flags = fcntl(fileno(fp), F_GETFL); + retval = 0; + + //Set to non_blocking mode + fcntl(fileno(fp), F_SETFL, fcntl_flags | O_NONBLOCK); + + //Fill rest of buffer + retval = fread(basic_streambuf<charT,traits>::egptr() - + basic_streambuf<charT,traits>::gptr() + basic_streambuf<charT,traits>::eback(), + sizeof(charT), + offset, + fp + ); + + //Clear problems where we didn't read in enough characters + if(EAGAIN == errno){ + clearerr(fp); + } + + //Restore file descriptor clase + fcntl(fileno(fp), F_SETFL, fcntl_flags); + + //Now we are going to make sure that we read in at least one character. The hard way. + if(retval == 0){ + fcntl_flags = fcntl(fileno(fp), F_GETFL); + //Set to blocking mode + fcntl(fileno(fp), F_SETFL, fcntl_flags & ~O_NONBLOCK); + + retval = fread(basic_streambuf<charT,traits>::egptr() - + basic_streambuf<charT,traits>::gptr() + basic_streambuf<charT,traits>::eback(), + sizeof(charT), + 1, + fp + ); + + //Restore file descriptor clase + fcntl(fileno(fp), F_SETFL, fcntl_flags); + + } + + if(retval !=offset){ //Slide buffer forward again + for(size_t i = 0; i < amountData + retval; ++i){ + *(basic_streambuf<charT,traits>::egptr() - i - 1) = + *(basic_streambuf<charT,traits>::eback() + amountData + retval - i - 1); + } + } + + basic_streambuf<charT,traits>::mgnext -= retval; + + if( (retval <= 0 && feof(fp)) || ferror(fp) ){ + return traits::eof(); + } + + return traits::to_int_type(*basic_streambuf<charT,traits>::gptr()); + } + virtual _UCXXEXPORT int_type uflow(){ + bool dobump = (basic_streambuf<charT,traits>::gptr() != 0); + int_type retval = underflow(); + if(dobump){ + basic_streambuf<charT,traits>::gbump(1); + } + return retval; + } + virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()){ + if(is_open() == false || + basic_streambuf<charT,traits>::gptr() == basic_streambuf<charT,traits>::eback()) + { + return traits::eof(); + } + if(traits::eq_int_type(c,traits::eof()) == false){ + if(traits::eq(traits::to_char_type(c), basic_streambuf<charT,traits>::gptr()[-1]) == true){ + basic_streambuf<charT,traits>::gbump(-1); + }else{ + basic_streambuf<charT,traits>::gbump(-1); + basic_streambuf<charT,traits>::gptr()[0] = c; + } + return c; + }else{ + basic_streambuf<charT,traits>::gbump(-1); + return traits::not_eof(c); + } + } + + virtual _UCXXEXPORT int_type overflow(int_type c = traits::eof()){ + if(is_open() == false){ + //Can't do much + return traits::eof(); + } + if(basic_streambuf<charT,traits>::pbase() == 0){ //Unbuffered - elliminate dupe code below + if(fputc(c, fp) == EOF){ + return traits::eof(); + } + return c; + } + if(basic_streambuf<charT,traits>::pbase() == 0 && traits::eq_int_type(c,traits::eof()) ){ + //Nothing to flush + return traits::not_eof(c); + } + size_t r = basic_streambuf<charT,traits>::pptr() - basic_streambuf<charT,traits>::pbase(); + + if( r == 0 && traits::eq_int_type(c,traits::eof()) ){ + return traits::not_eof(c); + }else if (r == 0 ){ + if(fputc(c, fp) == EOF){ + return traits::eof(); + } + return c; + } + + size_t totalChars = r; + + char_type *buffer = 0; + if(traits::eq_int_type(c,traits::eof())){ + buffer = new char_type[r]; + }else{ + buffer = new char_type[r+1]; + buffer[r] = c; + totalChars++; + } + + traits::copy(buffer, basic_streambuf<charT,traits>::pbase(), r); +// memcpy(buffer, basic_streambuf<charT,traits>::pbase(), r); + + size_t retval = fwrite(buffer, sizeof(charT), totalChars, fp); + if(retval !=totalChars){ + if(retval == 0){ + delete [] buffer; + return traits::eof(); + } + basic_streambuf<charT,traits>::pbump(-retval); + fprintf(stderr, "***** Did not write the full buffer out. Should be: %d, actually: %d\n", + totalChars, retval); + }else{ + basic_streambuf<charT,traits>::pbump(-r); + } + + delete [] buffer; + return traits::not_eof(c); + } + + virtual _UCXXEXPORT basic_streambuf<charT,traits>* setbuf(char_type* s, streamsize n){ + if(s == 0 && n == 0){ //Unbuffered + if(pbuffer !=0){ + delete [] pbuffer; + } + if(gbuffer !=0){ + delete [] gbuffer; + } + pbuffer = 0; + gbuffer = 0; + }else if(basic_streambuf<charT,traits>::gptr() !=0 && + basic_streambuf<charT,traits>::gptr()==basic_streambuf<charT,traits>::egptr()) + { + delete [] pbuffer; + pbuffer = s; + } + return this; + } + virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way, + ios_base::openmode = ios_base::in | ios_base::out) + { + if(is_open() == false){ + return -1; + } + int whence = SEEK_SET; // if(way == basic_ios<charT>::beg) + off_type position = off; + + if(way == basic_ios<charT>::cur){ + whence = SEEK_CUR; + position -= (basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr()); + }else if(way == basic_ios<charT>::end){ + whence = SEEK_END; + } + + sync(); + + int retval = fseek( + fp, + sizeof(charT)*(position), + whence + ); + + //Invalidate read buffer + basic_streambuf<charT,traits>::gbump( + basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr() + ); + + if(-1 != retval){ + retval = ftell(fp); + } + + return retval; + } + virtual _UCXXEXPORT pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | ios_base::out){ + if(is_open() == false){ + return -1; + } + sync(); + + int retval = fseek(fp,sizeof(charT)* sp, SEEK_SET); + + //Invalidate read buffer + basic_streambuf<charT,traits>::gbump(basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr()); + if(retval > -1){ + return sp; + } + return -1; + } + virtual _UCXXEXPORT int sync(){ + if(pbuffer !=0){ + if(overflow() == traits::eof()){ + return -1; + } + } + if(0 != fp && 0 != fflush(fp)){ + return -1; + } + return 0; + } + virtual _UCXXEXPORT void imbue(const locale&){ + return; + } + + + virtual _UCXXEXPORT streamsize xsputn(const char_type* s, streamsize n){ + if(is_open() == false){ + return 0; + } + //Check to see if buffered + + //Check to see if we can buffer the data + streamsize buffer_avail = basic_streambuf<charT,traits>::epptr() - basic_streambuf<charT,traits>::pptr(); + + if(n > buffer_avail){ //Flush buffer and write directly + overflow(); //Flush the buffer + return fwrite(s, sizeof(charT), n, fp); + } + + //Add to buffer to be written later + + traits::copy(basic_streambuf<charT,traits>::pptr(), s, n); + basic_streambuf<charT,traits>::pbump(n); + + return n; + } + + FILE * fp; + char_type * pbuffer; + char_type * gbuffer; + bool append; + }; + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::overflow(int_type c); + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::underflow(); + +#endif //__UCLIBCXX_HAS_WCHAR__ + + + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_FSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT filebuf::basic_filebuf(); + template <> _UCXXEXPORT filebuf::~basic_filebuf(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT filebuf::int_type filebuf::pbackfail(filebuf::int_type c); + template <> _UCXXEXPORT filebuf * filebuf::open(const char* s, ios_base::openmode mode); + template <> _UCXXEXPORT filebuf * filebuf::close(); + template <> _UCXXEXPORT filebuf::int_type filebuf::overflow(filebuf::int_type c); + template <> _UCXXEXPORT filebuf::int_type filebuf::underflow (); + + template <> _UCXXEXPORT basic_streambuf<char, char_traits<char> > * filebuf::setbuf(char * s, streamsize n); + template <> _UCXXEXPORT streamsize filebuf::xsputn(const char* s, streamsize n); + +#endif +#endif + + + template <class charT, class traits> class _UCXXEXPORT basic_ifstream + : public basic_istream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + _UCXXEXPORT basic_ifstream(): basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb){ + //Passing the address of sb + } + explicit _UCXXEXPORT basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in) + : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb) + { + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + + virtual _UCXXEXPORT ~basic_ifstream(){ + + } + + _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{ + return (basic_filebuf<charT,traits>*)&sb; + } + _UCXXEXPORT bool is_open() const{ + return sb.is_open(); + } + _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::in){ + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + _UCXXEXPORT void close(){ + sb.close(); + } + private: + basic_filebuf<charT,traits> sb; + }; + + + template <class charT, class traits> class _UCXXEXPORT basic_ofstream + : public basic_ostream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + _UCXXEXPORT basic_ofstream() : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb){ + + } + + virtual _UCXXEXPORT ~basic_ofstream(); + + explicit _UCXXEXPORT basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc) : + basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb) + { + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + + _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{ + return (basic_filebuf<charT,traits>*)&sb; + } + + _UCXXEXPORT bool is_open() const{ + return sb.is_open(); + } + _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc){ + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + _UCXXEXPORT void close(){ + sb.close(); + } + private: + basic_filebuf<charT,traits> sb; + }; + + template <class charT, class traits> _UCXXEXPORT basic_ofstream<charT, traits>::~basic_ofstream(){ + basic_ostream<charT, traits>::flush(); + } + + + template <class charT, class traits> class _UCXXEXPORT basic_fstream + : public basic_iostream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type ins_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + _UCXXEXPORT basic_fstream(): basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb){ } + + explicit _UCXXEXPORT basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out): + basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb) + { + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + + _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{ + return (basic_filebuf<charT,traits>*)&sb; + } + _UCXXEXPORT bool is_open() const{ + return sb.is_open(); + } + _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out){ + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + _UCXXEXPORT void close(){ + sb.close(); + } + private: + basic_filebuf<charT,traits> sb; + }; + + + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_FSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(); + template <> _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(const char* s, ios_base::openmode mode); + template <> _UCXXEXPORT basic_ofstream<char, char_traits<char> >::~basic_ofstream(); + + template <> _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(); + template <> _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(const char* s, ios_base::openmode mode); + template <> _UCXXEXPORT basic_ifstream<char, char_traits<char> >::~basic_ifstream(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif +#endif + + + +} + +#endif + +#endif \ No newline at end of file diff --git a/i386/modules/uClibcxx/include/.svn/text-base/func_exception.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/func_exception.svn-base new file mode 100644 index 0000000..e0374dd --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/func_exception.svn-base @@ -0,0 +1,37 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> + + +#ifndef HEADER_IMPLEMENTATION_FUNC_EXCEPTION +#define HEADER_IMPLEMENTATION_FUNC_EXCEPTION + +namespace std{ + + _UCXXEXPORT void __throw_bad_alloc(); + _UCXXEXPORT void __throw_out_of_range(const char * message = 0); + _UCXXEXPORT void __throw_overflow_error(const char * message = 0); + _UCXXEXPORT void __throw_length_error(const char * message = 0); + _UCXXEXPORT void __throw_invalid_argument(const char * message = 0); +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/functional.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/functional.svn-base new file mode 100644 index 0000000..beb6eeb --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/functional.svn-base @@ -0,0 +1,435 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#ifndef __STD_HEADER_FUNCTIONAL +#define __STD_HEADER_FUNCTIONAL 1 + +#include <basic_definitions> + +namespace std{ + + template <class Arg, class Result> struct unary_function; + template <class Arg1, class Arg2, class Result> struct binary_function; + + template <class T> struct plus; + template <class T> struct minus; + template <class T> struct multiplies; + template <class T> struct divides; + template <class T> struct modulus; + template <class T> struct negate; + + template <class T> struct equal_to; + template <class T> struct not_equal_to; + template <class T> struct greater; + template <class T> struct less; + template <class T> struct greater_equal; + template <class T> struct less_equal; + + template <class T> struct logical_and; + template <class T> struct logical_or; + template <class T> struct logical_not; + + template <class Predicate> class unary_negate; + template <class Predicate> unary_negate<Predicate> not1(const Predicate&); + template <class Predicate> class binary_negate; + template <class Predicate> binary_negate<Predicate> not2(const Predicate&); + + + template <class Operation> class binder1st; + template <class Operation, class T> binder1st<Operation> bind1st(const Operation&, const T&); + template <class Operation> class binder2nd; + template <class Operation, class T> binder2nd<Operation> bind2nd(const Operation&, const T&); + + template <class Arg, class Result> class pointer_to_unary_function; + template <class Arg, class Result> pointer_to_unary_function<Arg,Result> ptr_fun(Result (*)(Arg)); + template <class Arg1, class Arg2, class Result> class pointer_to_binary_function; + template <class Arg1, class Arg2, class Result> + pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*)(Arg1,Arg2)); + + template<class S, class T> class mem_fun_t; + template<class S, class T, class A> class mem_fun1_t; + template<class S, class T> class const_mem_fun_t; + template<class S, class T, class A> class const_mem_fun1_t; + template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); + template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); + template<class S, class T> class mem_fun_ref_t; + template<class S, class T, class A> class mem_fun1_ref_t; + template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); + template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun1_ref(S (T::*f)(A)); + + //Implementation + + template <class Arg, class Result> struct _UCXXEXPORT unary_function{ + typedef Arg argument_type; + typedef Result result_type; + }; + + + template <class Arg1, class Arg2, class Result> struct _UCXXEXPORT binary_function{ + typedef Arg1 first_argument_type; + typedef Arg2 second_argument_type; + typedef Result result_type; + }; + + template <class T> struct _UCXXEXPORT plus : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x + y; + } + }; + + template <class T> struct _UCXXEXPORT minus : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x - y; + } + }; + + template <class T> struct _UCXXEXPORT multiplies : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x * y; + } + }; + + template <class T> struct _UCXXEXPORT divides : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x / y; + } + }; + + template <class T> struct _UCXXEXPORT modulus : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x % y; + } + }; + + template <class T> struct _UCXXEXPORT negate : unary_function<T,T>{ + T operator()(const T& x) const{ + return -x; + } + }; + + template <class T> struct _UCXXEXPORT equal_to : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x == y); + } + }; + + template <class T> struct _UCXXEXPORT not_equal_to : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x != y); + } + }; + + template <class T> struct _UCXXEXPORT greater : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x > y); + } + }; + + template <class T> struct _UCXXEXPORT less : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x < y); + } + }; + + template <class T> struct _UCXXEXPORT greater_equal : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x >= y); + } + }; + + template <class T> struct _UCXXEXPORT less_equal : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x <= y); + } + }; + + template <class T> struct _UCXXEXPORT logical_and : binary_function<T,T,bool> { + bool operator()(const T& x, const T& y) const{ + return (x && y); + } + }; + + template <class T> struct _UCXXEXPORT logical_or : binary_function<T,T,bool> { + bool operator()(const T& x, const T& y) const{ + return (x || y); + } + }; + + template <class T> struct _UCXXEXPORT logical_not : unary_function<T,bool> { + bool operator()(const T& x) const{ + return !x; + } + }; + + template <class Predicate> class _UCXXEXPORT unary_negate + : public unary_function<typename Predicate::argument_type,bool> + { + public: + explicit unary_negate(const Predicate& pred) : p(pred) { } + bool operator()(const typename Predicate::argument_type& x) const{ + return !p(x); + } + private: + Predicate p; + }; + + + template <class Predicate> _UCXXEXPORT unary_negate<Predicate> not1(const Predicate& pred){ + return unary_negate<Predicate>(pred); + } + + + template <class Predicate> class _UCXXEXPORT binary_negate : public + binary_function<typename Predicate::first_argument_type, + typename Predicate::second_argument_type, bool> + { + public: + explicit binary_negate(const Predicate& pred) : p(pred) { } + bool operator()(const typename Predicate::first_argument_type& x, + const typename Predicate::second_argument_type& y) const + { + return !p(x, y); + } + private: + Predicate p; + }; + + + template <class Predicate> _UCXXEXPORT binary_negate<Predicate> not2(const Predicate& pred){ + return binary_negate<Predicate>(pred); + } + + + template <class Operation> class _UCXXEXPORT binder1st + : public unary_function<typename Operation::second_argument_type, + typename Operation::result_type> + { + protected: + Operation op; + typename Operation::first_argument_type value; + public: + binder1st(const Operation& x, const typename Operation::first_argument_type& y) : op(x), value(y){ } + typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const{ + return op(value,x); + } + }; + + + template <class Operation, class T> _UCXXEXPORT binder1st<Operation> bind1st(const Operation& op, const T& x){ + return binder1st<Operation>(op, typename Operation::first_argument_type(x)); + } + + + template <class Operation> class _UCXXEXPORT binder2nd + : public unary_function<typename Operation::first_argument_type, + typename Operation::result_type> + { + protected: + Operation op; + typename Operation::second_argument_type value; + public: + binder2nd(const Operation& x, const typename Operation::second_argument_type& y) : op(x), value(y) { } + typename Operation::result_type operator()(const typename Operation::first_argument_type& x) const{ + return op(x,value); + } + }; + + + template <class Operation, class T> _UCXXEXPORT + binder2nd<Operation> bind2nd(const Operation& op, const T& x) + { + return binder2nd<Operation>(op, typename Operation::second_argument_type(x)); + } + + + template <class Arg, class Result> class _UCXXEXPORT + pointer_to_unary_function : public unary_function<Arg, Result> + { + protected: + Result (*func)(Arg); + public: + explicit pointer_to_unary_function(Result (*f)(Arg)) : func(f) { } + Result operator()(Arg x) const{ + return func(x); + } + }; + + + template <class Arg, class Result> _UCXXEXPORT pointer_to_unary_function<Arg, Result> ptr_fun(Result (*f)(Arg)){ + return pointer_to_unary_function<Arg, Result>(f); + } + + + template <class Arg1, class Arg2, class Result> class _UCXXEXPORT + pointer_to_binary_function : public binary_function<Arg1,Arg2,Result> + { + protected: + Result (*func)(Arg1, Arg2); + public: + explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)) : func(f) { } + Result operator()(Arg1 x, Arg2 y) const{ + return func(x, y); + } + }; + + template <class Arg1, class Arg2, class Result> _UCXXEXPORT + pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1, Arg2)) + { + return pointer_to_binary_function<Arg1,Arg2,Result>(f); + } + + + template <class S, class T> class _UCXXEXPORT mem_fun_t + : public unary_function<T*, S> + { + public: + explicit mem_fun_t(S (T::*p)()) : m(p) { } + S operator()(T* p) const { return (p->*m)(); } + private: + S (T::*m)(); + }; + + + template <class S, class T, class A> class _UCXXEXPORT mem_fun1_t + : public binary_function<T*, A, S> + { + public: + explicit mem_fun1_t(S (T::*p)(A)) : m(p) { } + S operator()(T* p, A x) const { return (p->*m)(x); } + private: + S (T::*m)(A); + }; + + + template <class S, class T> class _UCXXEXPORT const_mem_fun_t + : public unary_function<const T*, S> + { + public: + explicit const_mem_fun_t(S (T::*p)() const) : m(p) { } + S operator()(const T* p) const { return (p->*m)(); } + private: + S (T::*m)() const; + }; + + + template <class S, class T, class A> class _UCXXEXPORT const_mem_fun1_t + : public binary_function<T*, A, S> + { + public: + explicit const_mem_fun1_t(S (T::*p)(A) const) : m(p) { } + S operator()(const T* p, A x) const { return (p->*m)(x); } + private: + S (T::*m)(A) const; + }; + + + template<class S, class T> _UCXXEXPORT mem_fun_t<S,T> mem_fun(S (T::*f)()){ + return mem_fun_t<S, T>(f); + } + + template<class S, class T> _UCXXEXPORT const_mem_fun_t<S,T> mem_fun(S (T::*f)() const){ + return const_mem_fun_t<S, T>(f); + } + + template<class S, class T, class A> _UCXXEXPORT mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)){ + return mem_fun1_t<S, T, A>(f); + } + + template<class S, class T, class A> _UCXXEXPORT const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const){ + return const_mem_fun1_t<S, T, A>(f); + } + + template <class S, class T> class _UCXXEXPORT mem_fun_ref_t + : public unary_function<T, S> + { + public: + explicit mem_fun_ref_t(S (T::*p)()) : mf(p) { } + S operator()(T& p) { return (p.*mf)(); } + private: + S (T::*mf)(); + }; + + template <class S, class T, class A> class _UCXXEXPORT mem_fun1_ref_t + : public binary_function<T, A, S> + { + public: + explicit mem_fun1_ref_t(S (T::*p)(A)) : mf(p) { } + S operator()(T& p, A x) { return (p.*mf)(x); } + private: + S (T::*mf)(A); + }; + + template<class S, class T> _UCXXEXPORT mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()){ + return mem_fun_ref_t<S,T>(f); + } + + template<class S, class T, class A> _UCXXEXPORT mem_fun1_ref_t<S,T,A> mem_fun1_ref(S (T::*f)(A)){ + return mem_fun1_ref_t<S,T,A>(f); + } + + +} + + +//These are SGI extensions which are checked for by some conformance checks. They +// are *NOT* part of the C++ standard, however + +template <class Op1, class Op2> class _UCXXEXPORT unary_compose : + public std::unary_function<typename Op2::argument_type, + typename Op1::result_type> +{ +protected: + Op1 mf1; + Op2 mf2; +public: + unary_compose(const Op1& x, const Op2& y) : mf1(x), mf2(y) { } + typename Op1::result_type operator()(const typename Op2::argument_type& x) const { + return mf1(mf2(x)); + } +}; + +template <class Op1, class Op2> _UCXXEXPORT +inline unary_compose<Op1, Op2> +compose1(const Op1& fn1, const Op2& fn2){ + return unary_compose<Op1, Op2>(fn1, fn2); +} + +template <class Op1, class Op2, class Op3> class _UCXXEXPORT binary_compose : + public std::unary_function<typename Op2::argument_type, typename Op1::result_type> +{ +protected: + Op1 mf1; + Op2 mf2; + Op3 mf3; +public: + binary_compose(const Op1 & x, const Op2 & y, const Op3 & z) + : mf1(x), mf2(y), mf3(z){ } + typename Op1::result_type operator()(const typename Op2::argument_type & x) const { + return mf1(mf2(x), mf3(x)); + } +}; + +template <class Op1, class Op2, class Op3> inline _UCXXEXPORT binary_compose<Op1, Op2, Op3> +compose2(const Op1 & fn1, const Op2 & fn2, const Op3 & fn3){ + return binary_compose<Op1, Op2, Op3>(fn1, fn2, fn3); +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/iomanip.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/iomanip.svn-base new file mode 100644 index 0000000..e547587 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/iomanip.svn-base @@ -0,0 +1,166 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <ios> + +#ifndef __STD_IOMANIP +#define __STD_IOMANIP 1 + +namespace std{ + +// These are the helper classes which we are going to be using to +// hold the required data + +class _UCXXEXPORT __resetiosflags{ +public: + ios_base::fmtflags m; + _UCXXEXPORT __resetiosflags(ios_base::fmtflags mask) : m(mask){ } +}; + +class _UCXXEXPORT __setiosflags{ +public: + ios_base::fmtflags m; + _UCXXEXPORT __setiosflags(ios_base::fmtflags mask) : m(mask){ } +}; + +class _UCXXEXPORT __setbase{ +public: + int base; + _UCXXEXPORT __setbase(int b) : base(b){ } +}; + +class _UCXXEXPORT __setfill{ +public: + int character; + _UCXXEXPORT __setfill(int c): character(c){ } +}; + +class _UCXXEXPORT __setprecision{ +public: + int digits; + _UCXXEXPORT __setprecision(int n): digits(n) { } +}; + +class _UCXXEXPORT __setw{ +public: + int width; + _UCXXEXPORT __setw(int n): width(n) { } +}; + + +//Actual manipulator functions + +inline __resetiosflags resetiosflags(ios_base::fmtflags mask){ + return __resetiosflags(mask); +} + +inline __setiosflags setiosflags(ios_base::fmtflags mask){ + return __setiosflags(mask); +} + +inline __setbase setbase(int b){ + return __setbase(b); +} + +inline __setfill setfill(int c){ + return __setfill(c); +} + +inline __setprecision setprecision(int n){ + return __setprecision(n); +} + +inline __setw setw(int n){ + return __setw(n); +} + + +//How to handle interaction with [i|o]stream classes + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __resetiosflags s) +{ + os.setf(ios_base::fmtflags(0),s.m); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_istream<Ch, Tr>& + operator>>(basic_istream<Ch, Tr>& is, const __resetiosflags s) +{ + is.setf(ios_base::fmtflags(0),s.m); + return is; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setiosflags s) +{ + os.setf(s.m); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setbase s) +{ + ios_base::fmtflags f(0); + switch(s.base){ + case 8: + f = ios_base::oct; + break; + case 10: + f = ios_base::dec; + break; + case 16: + f = ios_base::hex; + break; + default: + break; + + } + os.setf(f, ios_base::basefield); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setfill s) +{ + os.fill(s.character); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setprecision s) +{ + os.precision(s.digits); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setw s) +{ + os.width(s.width); + return os; +} + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/ios.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/ios.svn-base new file mode 100644 index 0000000..ded00e4 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/ios.svn-base @@ -0,0 +1,497 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <locale> +#include <iosfwd> + +#ifndef __HEADER_STD_IOS +#define __HEADER_STD_IOS 1 + +namespace std{ + typedef signed long int streamoff; + + template <class stateT> class fpos; + + class _UCXXEXPORT ios_base { + public: + class failure; +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + class failure : public exception { + public: + explicit failure(const std::string& msg) { } + explicit failure() { } + virtual const char* what() const throw() { + return "std::ios_base failure exception"; + } + }; +#endif +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + class _UCXXLOCAL Init{ + public: + _UCXXEXPORT Init(); + _UCXXEXPORT ~Init(); + private: + static int init_cnt; + }; +#endif + + public: + + typedef unsigned short int fmtflags; + + static const fmtflags skipws = 0x0001; + + static const fmtflags left = 0x0002; + static const fmtflags right = 0x0004; + static const fmtflags internal = 0x0008; + + static const fmtflags boolalpha = 0x0010; + + static const fmtflags dec = 0x0020; + static const fmtflags oct = 0x0040; + static const fmtflags hex = 0x0080; + + static const fmtflags scientific = 0x0100; + static const fmtflags fixed = 0x0200; + + static const fmtflags showbase = 0x0400; + static const fmtflags showpoint = 0x0800; + static const fmtflags showpos = 0x1000; + static const fmtflags uppercase = 0x2000; + + static const fmtflags adjustfield = left | right | internal; + static const fmtflags basefield = dec | oct | hex; + static const fmtflags floatfield = fixed | scientific; + + static const fmtflags unitbuf = 0x4000; + + typedef unsigned char iostate; + static const iostate goodbit = 0x00; + static const iostate badbit = 0x01; + static const iostate eofbit = 0x02; + static const iostate failbit = 0x04; + + typedef unsigned char openmode; + static const openmode app = 0x01; + static const openmode ate = 0x02; + static const openmode binary = 0x04; + static const openmode in = 0x08; + static const openmode out = 0x10; + static const openmode trunc = 0x20; + + typedef unsigned char seekdir; + static const seekdir beg = 0x01; + static const seekdir cur = 0x02; + static const seekdir end = 0x04; + + _UCXXEXPORT fmtflags flags() const{ + return mformat; + } + _UCXXEXPORT fmtflags flags(fmtflags fmtfl); + + fmtflags setf(fmtflags fmtfl); + fmtflags setf(fmtflags fmtfl, fmtflags mask ); + + _UCXXEXPORT void unsetf(fmtflags mask){ + mformat&= ~mask; + } + + _UCXXEXPORT streamsize precision() const{ + return mprecision; + } + + _UCXXEXPORT streamsize precision(streamsize prec); + + _UCXXEXPORT streamsize width() const{ + return mwidth; + } + + _UCXXEXPORT streamsize width(streamsize wide); + + _UCXXEXPORT locale imbue(const locale& loc); + + _UCXXEXPORT locale getloc() const{ + return mLocale; + } + +// FIXME - These need to be implemented +// static int xalloc(); +// long& iword(int index); +// void*& pword(int index); + + _UCXXEXPORT ~ios_base() { } + + enum event { erase_event, imbue_event, copyfmt_event }; + + typedef void (*event_callback)(event, ios_base&, int index); +// void register_callback(event_call_back fn, int index); + + //We are going to wrap stdio so we don't need implementation of the following: + inline static bool sync_with_stdio(bool = true) { return true; } + + protected: + _UCXXEXPORT ios_base() : mLocale(), mformat(dec | skipws ), mstate(goodbit), + mmode(), mdir(), mprecision(6), mwidth(0) +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + ,mInit() +#endif + { + + } + locale mLocale; + fmtflags mformat; + iostate mstate; + openmode mmode; + seekdir mdir; + streamsize mprecision; + streamsize mwidth; +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + Init mInit; +#endif + }; + + + //ios_base manipulators + + + inline ios_base& boolalpha (ios_base& str){ + str.setf(ios_base::boolalpha); + return str; + } + inline ios_base& noboolalpha(ios_base& str){ + str.unsetf(ios_base::boolalpha); + return str; + } + inline ios_base& showbase (ios_base& str){ + str.setf(ios_base::showbase); + return str; + } + inline ios_base& noshowbase (ios_base& str){ + str.unsetf(ios_base::showbase); + return str; + } + inline ios_base& showpoint (ios_base& str){ + str.setf(ios_base::showpoint); + return str; + } + inline ios_base& noshowpoint(ios_base& str){ + str.unsetf(ios_base::showpoint); + return str; + } + inline ios_base& showpos (ios_base& str){ + str.setf(ios_base::showpos); + return str; + } + inline ios_base& noshowpos (ios_base& str){ + str.unsetf(ios_base::showpos); + return str; + } + inline ios_base& skipws (ios_base& str){ + str.setf(ios_base::skipws); + return str; + } + inline ios_base& noskipws (ios_base& str){ + str.unsetf(ios_base::skipws); + return str; + } + inline ios_base& uppercase (ios_base& str){ + str.setf(ios_base::uppercase); + return str; + } + inline ios_base& nouppercase(ios_base& str){ + str.unsetf(ios_base::uppercase); + return str; + } + + inline ios_base& unitbuf (ios_base& str){ + str.setf(ios_base::unitbuf); + return str; + } + inline ios_base& nounitbuf (ios_base& str){ + str.unsetf(ios_base::unitbuf); + return str; + } + inline ios_base& internal (ios_base& str){ + str.setf(ios_base::internal, ios_base::adjustfield); + return str; + } + inline ios_base& left (ios_base& str){ + str.setf(ios_base::left, ios_base::adjustfield); + return str; + } + inline ios_base& right (ios_base& str){ + str.setf(ios_base::right, ios_base::adjustfield); + return str; + } + + inline ios_base& dec (ios_base& str){ + str.setf(ios_base::dec, ios_base::basefield); + return str; + } + inline ios_base& hex (ios_base& str){ + str.setf(ios_base::hex, ios_base::basefield); + return str; + } + inline ios_base& oct (ios_base& str){ + str.setf(ios_base::oct, ios_base::basefield); + return str; + } + + inline ios_base& fixed (ios_base& str){ + str.setf(ios_base::fixed, ios_base::floatfield); + return str; + } + inline ios_base& scientific (ios_base& str){ + str.setf(ios_base::scientific, ios_base::floatfield); + return str; + } + + + //basic_ios class definition + + + template <class charT, class traits > class _UCXXEXPORT basic_ios + : public ios_base + { + public: + // Types: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef traits traits_type; + + _UCXXEXPORT operator void*() const{ + if(fail() ){ + return 0; + } + return (void *)(1); //Must return a non-NULL pointer (though it can be *any* pointer) + } + + _UCXXEXPORT bool operator!() const{ + return fail(); + } + _UCXXEXPORT iostate rdstate() const{ + return mstate; + } + _UCXXEXPORT void clear(iostate state = goodbit){ + if(rdbuf()!=0){ + mstate = state; + }else{ + mstate = state|ios_base::badbit; + } + } + _UCXXEXPORT void setstate(iostate state) { + clear(rdstate() | state); +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + if(rdstate() & throw_mask){ + throw failure(); + } +#endif + } + + _UCXXEXPORT bool good() const{ + return (rdstate() == 0); + } + _UCXXEXPORT bool eof() const{ + if(rdstate() & eofbit){ + return true; + } + return false; + } + _UCXXEXPORT bool fail() const{ + if( mstate & (failbit | badbit) ){ + return true; + } + return false; + } + + _UCXXEXPORT bool bad() const{ + if(mstate & badbit){ + return true; + } + return false; + } + + _UCXXEXPORT iostate exceptions() const{ + return throw_mask; + } + _UCXXEXPORT void exceptions(iostate except){ + throw_mask = except; + } + + explicit _UCXXEXPORT basic_ios(basic_streambuf<charT,traits>* sb) : fill_char(' '), mtied(0), mstreambuf(0){ + init(sb); + } + + basic_ios() : mtied(0), mstreambuf(0){ } + + virtual _UCXXEXPORT ~basic_ios(){ + } + + _UCXXEXPORT basic_ostream<charT,traits>* tie() const{ + return mtied; + } + _UCXXEXPORT basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr){ + basic_ostream<charT,traits>* retval= mtied; + mtied = tiestr; + return retval; + } + _UCXXEXPORT basic_streambuf<charT,traits>* rdbuf() const{ + return mstreambuf; + } + _UCXXEXPORT basic_streambuf<charT,traits>* rdbuf(basic_streambuf<charT,traits>* sb){ + basic_streambuf<charT,traits>* retval = mstreambuf; + mstreambuf = sb; + return retval; + } + _UCXXEXPORT basic_ios& copyfmt(const basic_ios& rhs); + _UCXXEXPORT char_type fill() const{ + return fill_char; + } + _UCXXEXPORT char_type fill(char_type ch){ + char_type temp = fill_char; + fill_char = ch; + return temp; + } + + _UCXXEXPORT locale imbue(const locale& loc){ + return ios_base::imbue(loc); + } + _UCXXEXPORT char narrow(char_type c, char dfault) const; + _UCXXEXPORT char_type widen(char c) const; + + protected: + char_type fill_char; + basic_ostream<charT,traits>* mtied; + basic_streambuf<charT,traits>* mstreambuf; + iostate throw_mask; + _UCXXEXPORT basic_ios(const basic_ios<charT,traits> &){ } + _UCXXEXPORT basic_ios<charT,traits> & operator=(const basic_ios<charT,traits> &){ return *this; } + _UCXXEXPORT void init(basic_streambuf<charT,traits>* sb){ + ios_base::mformat = skipws|dec; + mstreambuf = sb; + mstate = goodbit; + throw_mask = goodbit; + } + }; + +#ifdef __UCLIBCXX_EXPAND_IOS_CHAR__ +#ifndef __UCLIBCXX_COMPILE_IOS__ + + template <> _UCXXEXPORT void basic_ios<char, char_traits<char> >::clear(iostate state); + template <> _UCXXEXPORT void basic_ios<char, char_traits<char> >::setstate(iostate state); + +#endif +#endif + + + template <class charT, class traits> + inline char basic_ios<charT, traits>::narrow(char_type c, char dfault) const + { + return dfault; + } + + template <> + inline char basic_ios<char, char_traits<char> >::narrow(char_type c, char) const + { + return c; + } + +#ifdef __UCLIBCXX_HAS_WCHAR__ + + template <> + inline char basic_ios<wchar_t, char_traits<wchar_t> >::narrow(char_type c, char dfault) const + { + char retval = wctob (c); + if(retval == EOF){ + retval = dfault; + } + return retval; + } + +#endif //__UCLIBCXX_HAS_WCHAR__ + + template <class charT, class traits> + inline typename basic_ios<charT, traits>::char_type + basic_ios<charT, traits>::widen(char c) const + { + return c; + } + + template <> + inline basic_ios<char, char_traits<char> >::char_type + basic_ios<char, char_traits<char> >::widen(char c) const + { + return c; + } + +#ifdef __UCLIBCXX_HAS_WCHAR__ + + template <> + inline basic_ios<wchar_t, char_traits<wchar_t> >::char_type + basic_ios<wchar_t, char_traits<wchar_t> >::widen(char c) const + { + return btowc(c); + } + +#endif //__UCLIBCXX_HAS_WCHAR__ + + + template <class stateT> class _UCXXEXPORT fpos{ + public: + _UCXXEXPORT fpos(stateT s){ + st = s; + } + _UCXXEXPORT stateT state() const{ + return st; + } + _UCXXEXPORT void state(stateT s){ + st = s; + } + _UCXXEXPORT bool operator==(const fpos &rhs){ + return st == rhs.st; + } + _UCXXEXPORT bool operator!=(const fpos &rhs){ + return st == rhs.st; + } + _UCXXEXPORT fpos & operator+(const streamoff & o){ + st += o; + return *this; + } + _UCXXEXPORT fpos & operator-(const streamoff & o){ + st -= o; + return *this; + } + _UCXXEXPORT streamoff operator-(const fpos & rhs){ + return st - rhs.st; + } + + + private: + stateT st; + }; + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/iosfwd.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/iosfwd.svn-base new file mode 100644 index 0000000..dc5dc11 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/iosfwd.svn-base @@ -0,0 +1,110 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <char_traits> +#include <memory> + + +#ifndef __HEADER_STD_IOSFWD +#define __HEADER_STD_IOSFWD 1 + +namespace std { + class ios_base; + template<> struct char_traits<char>; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + template<> class char_traits<wchar_t>; +#endif + + template <class charT, class traits = char_traits<charT> > class basic_ios; + + template <class charT, class traits = char_traits<charT> > class basic_streambuf; + template <class charT, class traits = char_traits<charT> > class basic_istream; + template <class charT, class traits = char_traits<charT> > class basic_ostream; + template <class charT, class traits = char_traits<charT> > class basic_iostream; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_stringbuf; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_istringstream; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_ostringstream; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_stringstream; + + template <class charT, class traits = char_traits<charT> > class basic_filebuf; + + template <class charT, class traits = char_traits<charT> > class basic_ifstream; + + template <class charT, class traits = char_traits<charT> > class basic_ofstream; + + template <class charT, class traits = char_traits<charT> > class basic_fstream; + + template <class charT, class traits = char_traits<charT> > class basic_istreambuf_iterator; + + template <class charT, class traits = char_traits<charT> > class basic_ostreambuf_iterator; + + typedef basic_ios<char> ios; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_ios<wchar_t> wios; +#endif + + typedef basic_streambuf<char> streambuf; + typedef basic_istream<char> istream; + typedef basic_ostream<char> ostream; + typedef basic_iostream<char> iostream; + + typedef basic_stringbuf<char> stringbuf; + typedef basic_istringstream<char> istringstream; + typedef basic_ostringstream<char> ostringstream; + typedef basic_stringstream<char> stringstream; + + typedef basic_filebuf<char> filebuf; + typedef basic_ifstream<char> ifstream; + typedef basic_ofstream<char> ofstream; + typedef basic_fstream<char> fstream; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_streambuf<wchar_t> wstreambuf; + typedef basic_istream<wchar_t> wistream; + typedef basic_ostream<wchar_t> wostream; + typedef basic_iostream<wchar_t> wiostream; + + typedef basic_stringbuf<wchar_t> wstringbuf; + typedef basic_istringstream<wchar_t> wistringstream; + typedef basic_ostringstream<wchar_t> wostringstream; + typedef basic_stringstream<wchar_t> wstringstream; + + typedef basic_filebuf<wchar_t> wfilebuf; + typedef basic_ifstream<wchar_t> wifstream; + typedef basic_ofstream<wchar_t> wofstream; + typedef basic_fstream<wchar_t> wfstream; +#endif + + template <class state> class fpos; + typedef fpos<char_traits<char>::state_type> streampos; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef fpos<char_traits<wchar_t>::state_type> wstreampos; +#endif +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/iostream.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/iostream.svn-base new file mode 100644 index 0000000..46b85e1 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/iostream.svn-base @@ -0,0 +1,97 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef __HEADER_STD_IOSTREAM +#define __HEADER_STD_IOSTREAM 1 + +#include <iosfwd> +#include <ios> +#include <istream> +#include <ostream> +#include <fstream> +#include <string_iostream> + +namespace std{ +#ifdef __UCLIBCXX_SUPPORT_CIN__ + extern istream cin; +#endif +#ifdef __UCLIBCXX_SUPPORT_COUT__ + extern ostream cout; +#endif +#ifdef __UCLIBCXX_SUPPORT_CERR__ + extern ostream cerr; +#endif +#ifdef __UCLIBCXX_SUPPORT_CLOG__ + extern ostream clog; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + extern wistream wcin; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + extern wostream wcout; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + extern wostream wcerr; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + extern wostream wclog; +#endif + + + template <class charT, class traits> class _UCXXEXPORT basic_iostream : + public basic_istream<charT,traits>, public basic_ostream<charT,traits> + { + public: + // constructor/destructor + explicit _UCXXEXPORT basic_iostream(basic_streambuf<charT,traits>* sb); + virtual _UCXXEXPORT ~basic_iostream(); //Below + }; + + template <class charT, class traits> _UCXXEXPORT + basic_iostream<charT, traits>:: basic_iostream(basic_streambuf<charT,traits>* sb) + : basic_ios<charT, traits>(sb), basic_istream<charT,traits>(sb), basic_ostream<charT,traits>(sb) + { + return; + } + + + template <class charT, class traits> _UCXXEXPORT basic_iostream<charT, traits>::~basic_iostream(){ + return; + } + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_IOSTREAM__ + + template <> _UCXXEXPORT basic_iostream<char, char_traits<char> >:: + basic_iostream(basic_streambuf<char, char_traits<char> >* sb); + template <> _UCXXEXPORT basic_iostream<char, char_traits<char> >::~basic_iostream(); + +#endif +#endif +#endif + + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/istream.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/istream.svn-base new file mode 100644 index 0000000..eac6e15 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/istream.svn-base @@ -0,0 +1,597 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc C++ Library. This library is free + software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) + any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this library; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. +*/ + +#include <ios> +#include <cctype> +#include <streambuf> +#include <istream_helpers> +#include <ostream> + +#ifndef __STD_HEADER_ISTREAM +#define __STD_HEADER_ISTREAM 1 + +namespace std{ + + typedef basic_istream<char> istream; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_istream<wchar_t> wistream; +#endif + + template <class charT, class traits> basic_istream<charT,traits>& ws(basic_istream<charT,traits>& is); + + template <class charT, class traits> class _UCXXEXPORT basic_istream : + virtual public basic_ios<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef basic_streambuf<charT,traits> streambuf_type; + typedef traits traits_type; + + explicit basic_istream(basic_streambuf<charT,traits>* sb) + : basic_ios<charT, traits>(sb), count_last_ufmt_input(0) + { + basic_ios<charT, traits>::init(sb); + } + virtual ~basic_istream() { } + + class sentry; + + basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>& (*pf)(basic_istream<charT,traits>&)); + basic_istream<charT,traits>& operator>>(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)); + basic_istream<charT,traits>& operator>>(ios_base& (*pf)(ios_base&)); + basic_istream<charT,traits>& operator>>(bool& n); + basic_istream<charT,traits>& operator>>(short& n); + basic_istream<charT,traits>& operator>>(unsigned short& n); + basic_istream<charT,traits>& operator>>(int& n); + basic_istream<charT,traits>& operator>>(unsigned int& n); + basic_istream<charT,traits>& operator>>(long& n); + basic_istream<charT,traits>& operator>>(unsigned long& n); + basic_istream<charT,traits>& operator>>(void*& p); + basic_istream<charT,traits>& operator>>(basic_streambuf<char_type,traits>* sb); + +#ifdef __UCLIBCXX_HAS_FLOATS__ + basic_istream<charT,traits>& operator>>(float& f); + basic_istream<charT,traits>& operator>>(double& f); + basic_istream<charT,traits>& operator>>(long double& f); +#endif + + _UCXXEXPORT streamsize gcount() const{ + return count_last_ufmt_input; + } + + _UCXXEXPORT int_type get(); //below + _UCXXEXPORT basic_istream<charT,traits>& get(char_type& c); //Below + + _UCXXEXPORT basic_istream<charT,traits>& get(char_type* s, streamsize n){ + return get(s, n, basic_ios<charT,traits>::widen('\n')); + } + + _UCXXEXPORT basic_istream<charT,traits>& get(char_type* s, streamsize n, char_type delim){ + sentry(*this, true); + streamsize i = 0; + int_type c; + for(i=0;i<n-1;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + basic_ios<charT, traits>::mstreambuf->sbumpc(); + if(c == traits::eof() ){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + break; + } + if(c == delim){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + } + basic_ios<charT, traits>::mstreambuf->sputbackc(c); + break; + } + s[i] = c; + } + s[i] = traits::eos(); + count_last_ufmt_input = i; + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>& sb){ + return get(sb, basic_ios<charT,traits>::widen('\n')); + } + + _UCXXEXPORT basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>& sb, char_type delim){ + sentry(*this, true); + streamsize i = 0; + int_type c; + while(1){ //We will exit internally based upon error conditions + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof()){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + count_last_ufmt_input = i; + return *this; + } + if(c == delim){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + } + count_last_ufmt_input = i; + return *this; + } + if(sb.sputc(c) != c){ //Error doing output + count_last_ufmt_input = i; + return *this; + } + ++i; + basic_ios<charT, traits>::mstreambuf->sbumpc(); + } + } + + _UCXXEXPORT basic_istream<charT,traits>& getline(char_type* s, streamsize n){ + return getline(s, n, basic_ios<charT,traits>::widen('\n')); + } + + _UCXXEXPORT basic_istream<charT,traits>& getline(char_type* s, streamsize n, char_type delim){ + sentry(*this, true); + streamsize i = 0; + int_type c; + for(i=0;i<n-1;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof() ){ + if( basic_ios<charT,traits>::eof() ){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + count_last_ufmt_input = i; + s[i] = traits::eos(); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf->sbumpc()==traits::eof() ){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + if(c == delim){ + count_last_ufmt_input = i+1; + s[i] = traits::eos(); + return *this; + } + s[i] = c; + } + s[n-1] = traits::eos(); + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& ignore (streamsize n = 1, int_type delim = traits::eof()){ + sentry(*this, true); + streamsize i; + int_type c; + for(i=0;i<n;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + return *this; + } + basic_ios<charT, traits>::mstreambuf->sbumpc(); + if(c == delim){ + return *this; + } + } + return *this; + } + + _UCXXEXPORT int_type peek(){ + if(basic_ios<charT,traits>::good() == false){ + return traits::eof(); + }else{ + int_type c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + return basic_ios<charT, traits>::mstreambuf->sgetc(); + } + } + + _UCXXEXPORT basic_istream<charT,traits>& read (char_type* s, streamsize n){ + sentry(*this, true); + streamsize i; + int_type c; + for(i=0;i<n;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + + if(c == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + count_last_ufmt_input = i; + return *this; + } + basic_ios<charT, traits>::mstreambuf->sbumpc(); + s[i] = c; + } + count_last_ufmt_input = n; + return *this; + } + + _UCXXEXPORT streamsize readsome(char_type* s, streamsize n){ + sentry(*this, true); + if(!basic_ios<charT,traits>::good()){ + count_last_ufmt_input = 0; + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return 0; + } + + if( basic_ios<charT, traits>::mstreambuf->in_avail() == -1){ + count_last_ufmt_input=0; + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + return 0; + } + + if(n > basic_ios<charT, traits>::mstreambuf->in_avail() ){ + n = basic_ios<charT, traits>::mstreambuf->in_avail(); + } + + streamsize i; + int_type c; + + for(i=0;i<n;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + basic_ios<charT, traits>::mstreambuf->sbumpc(); + s[i] = c; + } + count_last_ufmt_input = n; + return n; + } + + _UCXXEXPORT basic_istream<charT,traits>& putback(char_type c){ + sentry(*this, true); + if(!basic_ios<charT,traits>::good()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf == 0){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf->sputbackc(c) == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return *this; + } + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& unget(){ + sentry(*this, true); + if(!basic_ios<charT,traits>::good()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf == 0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf->sungetc() == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + } + return *this; + } + + _UCXXEXPORT int sync(){ + sentry(*this, true); + if(basic_ios<charT, traits>::mstreambuf == 0){ + return -1; + } + if(basic_ios<charT, traits>::mstreambuf->pubsync() == -1){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return traits::eof(); + } + return 0; + } + + _UCXXEXPORT pos_type tellg(){ + if(basic_ios<charT,traits>::fail() !=false){ + return pos_type(-1); + } + return basic_ios<charT, traits>::mstreambuf->pubseekoff(0, ios_base::cur, ios_base::in); + } + + _UCXXEXPORT basic_istream<charT,traits>& seekg(pos_type pos){ + if(basic_ios<charT,traits>::fail() !=true){ + basic_ios<charT, traits>::mstreambuf->pubseekpos(pos); + } + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& seekg(off_type off, ios_base::seekdir dir){ + if(basic_ios<charT,traits>::fail() !=true){ + basic_ios<charT, traits>::mstreambuf->pubseekoff(off, dir); + } + return *this; + } + + protected: + _UCXXEXPORT basic_istream(const basic_istream<charT,traits> &): basic_ios<charT, traits>() { } + _UCXXEXPORT basic_istream<charT,traits> & operator=(const basic_istream<charT,traits> &){ return *this; } + streamsize count_last_ufmt_input; + + }; + + template <class charT,class traits /*= char_traits<charT>*/ > class _UCXXEXPORT basic_istream<charT,traits>::sentry { + bool ok; + public: + explicit _UCXXEXPORT sentry(basic_istream<charT,traits>& os, bool noskipws = false){ + if(os.good() !=0){ //Prepare for output + } + + //Flush any tied buffer + if(os.tie() != 0){ + os.tie()->flush(); + } + if(!noskipws){ + __skipws(os); + } + + ok = true; + } + _UCXXEXPORT ~sentry() { } + _UCXXEXPORT operator bool() { + return ok; + } + }; + + //Template implementations of basic_istream functions which may be partially specialized + //For code reduction + + template <class charT, class traits> + _UCXXEXPORT typename basic_istream<charT,traits>::int_type basic_istream<charT,traits>::get(){ + sentry(*this, true); + int_type retval = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(retval == traits::eof()){ + count_last_ufmt_input = 0; + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + }else{ + count_last_ufmt_input = 1; + basic_ios<charT, traits>::mstreambuf->sbumpc(); + } + return retval; + } + + template <class charT, class traits> + _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::get(char_type& c){ + sentry(*this, true); + int_type retval = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(retval == traits::eof()){ + count_last_ufmt_input = 0; + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + count_last_ufmt_input = 1; + c = traits::to_char_type(retval); + basic_ios<charT, traits>::mstreambuf->sbumpc(); + } + return *this; + } + + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(bool& n) + { + sentry(*this); + __istream_readin<traits, charT, bool>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(short& n) + { + sentry(*this); + __istream_readin<traits, charT, short>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(unsigned short& n) + { + sentry(*this); + __istream_readin<traits, charT, unsigned short>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::operator>>(int& n){ + sentry(*this); + __istream_readin<traits, charT, int>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::operator>>(unsigned int& n){ + sentry(*this); + __istream_readin<traits, charT, unsigned int>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::operator>>(long int& n){ + sentry(*this); + __istream_readin<traits, charT, long int>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(unsigned long int& n) + { + sentry(*this); + __istream_readin<traits, charT, unsigned long int>::readin(*this, n); + return *this; + } + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(float& n) + { + sentry(*this); + __istream_readin<traits, charT, float>::readin(*this, n); + return *this; + } + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(double& n) + { + sentry(*this); + __istream_readin<traits, charT, double>::readin(*this, n); + return *this; + } + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(long double& n) + { + sentry(*this); + __istream_readin<traits, charT, long double>::readin(*this, n); + return *this; + } +#endif + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(void *& n) + { + sentry(*this); + __istream_readin<traits, charT, void*>::readin(*this, n); + return *this; + } + + template<class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + operator>>(basic_istream<charT,traits>& is, charT& c) + { + typename basic_istream<charT,traits>::sentry s(is); + is.get(c); + return is; + } + + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, unsigned char& c) + { + typename basic_istream<char,traits>::sentry s(is); + char b; + is.get(b); + c = b; + return is; + } + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, signed char& c) + { + typename basic_istream<char,traits>::sentry s(is); + is.get(c); + return is; + } + + template<class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + operator>>(basic_istream<charT,traits>& is, charT* c) + { + typename basic_istream<charT,traits>::sentry s(is); + int n = is.width(); + if(n == 0){ + n = __STRING_MAX_UNITS; + } + is.get(c, n); + return is; + + } + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, unsigned char* c) + { + typename basic_istream<char,traits>::sentry s(is); + int n = is.width(); + if(n == 0){ + n = __STRING_MAX_UNITS; + } + is.get(c, n); + return is; + } + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, signed char* c) + { + typename basic_istream<char,traits>::sentry s(is); + int n = is.width(); + if(n == 0){ + n = __STRING_MAX_UNITS; + } + is.get(c, n); + return is; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(basic_istream<charT,traits>& (*pf)(basic_istream<charT,traits>&)) + { + sentry(*this); + pf(*this); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)) + { + sentry(*this); + pf(*this); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + ws(basic_istream<charT,traits>& is) + { + __skipws(is); + return is; + } + + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_ISTREAM__ + + + template <> _UCXXEXPORT istream & basic_istream<char, char_traits<char> >::get(char & c); + template <> _UCXXEXPORT istream::int_type basic_istream<char, char_traits<char> >::get(); + + template <> _UCXXEXPORT istream & istream::operator>>(bool &n); + template <> _UCXXEXPORT istream & istream::operator>>(short &n); + template <> _UCXXEXPORT istream & istream::operator>>(unsigned short &n); + template <> _UCXXEXPORT istream & istream::operator>>(int &n); + template <> _UCXXEXPORT istream & istream::operator>>(unsigned int &n); + template <> _UCXXEXPORT istream & istream::operator>>(long unsigned &n); + template <> _UCXXEXPORT istream & istream::operator>>(long int &n); + template <> _UCXXEXPORT istream & istream::operator>>(void *& p); + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template <> _UCXXEXPORT istream & istream::operator>>(float &f); + template <> _UCXXEXPORT istream & istream::operator>>(double &f); + template <> _UCXXEXPORT istream & istream::operator>>(long double &f); +#endif + + template <> _UCXXEXPORT istream & operator>>(istream & is, char & c); + + template <> _UCXXEXPORT void __skipws(basic_istream<char,char_traits<char> >& is); + +#endif +#endif + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/istream_helpers.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/istream_helpers.svn-base new file mode 100644 index 0000000..78dbc85 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/istream_helpers.svn-base @@ -0,0 +1,340 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <ios> +#include <cctype> + +#include <string> + +#ifndef __STD_HEADER_ISTREAM_HELPERS +#define __STD_HEADER_ISTREAM_HELPERS 1 + +namespace std{ + + + /* We are making the following template class for serveral reasons. Firstly, + * we want to keep the main istream code neat and tidy. Secondly, we want it + * to be easy to do partial specialization of the istream code so that it can + * be expanded and put into the library. This will allow us to make application + * code smaller at the expense of increased library size. This is a fair + * trade-off when there are multiple applications being compiled. Also, this + * feature will be used optionally via configuration options. It will also + * allow us to keep the code bases in sync, dramatically simplifying the + * maintenance required. We specialized for char because wchar and others + * require different scanf functions + */ + + template <class C, class traits> _UCXXEXPORT + basic_string<C, traits> _readToken(basic_istream<C, traits>& stream) + { + basic_string<C, traits> temp; + typename traits::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != traits::eof() && isspace(c) == false){ + stream.rdbuf()->sbumpc(); + temp.append(1, traits::to_char_type(c)); + }else{ + break; + } + } + //if (temp.size() == 0) + //stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + + template <class C, class traits> _UCXXEXPORT + basic_string<C, traits> _readTokenDecimal(basic_istream<C, traits>& stream) + { + basic_string<C, traits> temp; + typename traits::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != traits::eof() && isspace(c) == false && (isdigit(c) || c == '.' || c == ',' )){ + stream.rdbuf()->sbumpc(); + temp.append(1, traits::to_char_type(c)); + }else{ + break; + } + } + //if (temp.size() == 0) + //stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template <> _UCXXEXPORT string _readToken<char, char_traits<char> >(istream & stream); + +#endif + + + template <class traits, class charT, class dataType> class _UCXXEXPORT __istream_readin{ + public: + static void readin(basic_istream<charT,traits>& stream, dataType & var); + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, bool>{ + public: + inline static void readin(basic_istream<char, traits >& stream, bool & var) + { + basic_string<char, traits > temp; + temp = _readToken( stream); + if(temp == "true" || temp == "True" || temp == "TRUE" || temp == "1"){ + var = true; + }else{ + var = false; + } + } + }; + + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, short>{ + public: + inline static void readin(basic_istream<char, traits >& stream, short & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%hd", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%ho", (unsigned short int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%hX", (unsigned short int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%hx", (unsigned short int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%hi", &var); + + } + } + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, unsigned short>{ + public: + inline static void readin(basic_istream<char, traits >& stream, unsigned short & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%hu", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%ho", &var); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%hX", &var ); + }else{ + sscanf(temp.c_str(), "%hx", &var); + } + }else{ + sscanf(temp.c_str(), "%hi", (signed short int*)(&var) ); + } + } + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%d", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%o", (unsigned int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%X", (unsigned int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%x", (unsigned int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%i", &var); + } + } + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, unsigned int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, unsigned int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%u", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%o", (unsigned int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%X", (unsigned int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%x", (unsigned int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%i", (int *)(&var) ); + } + } + + } + }; + + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, long int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%ld", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%lo", (unsigned long int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%lX", (unsigned long int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%lx", (unsigned long int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%li", (long int *)(&var) ); + } + } + + } + }; + + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, unsigned long int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, unsigned long int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%lu", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%lo", &var ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%lX", &var ); + }else{ + sscanf(temp.c_str(), "%lx", &var); + } + }else{ + sscanf(temp.c_str(), "%li", (long int *)(&var) ); + } + } + } + }; + + +#ifdef __UCLIBCXX_HAS_FLOATS__ + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, float>{ + public: + inline static void readin(basic_istream<char, traits >& stream, float & var) + { + basic_string<char, traits > temp; + temp = _readTokenDecimal( stream); + + sscanf(temp.c_str(), "%g", &var); + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, double>{ + public: + inline static void readin(basic_istream<char, traits >& stream, double & var) + { + basic_string<char, traits > temp; + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%lg", &var); + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long double>{ + public: + inline static void readin(basic_istream<char, traits >& stream, long double & var) + { + basic_string<char, traits > temp; + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%Lg", &var); + } + }; + +#endif // ifdef __UCLIBCXX_HAS_FLOATS__ + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, void*>{ + public: + inline static void readin(basic_istream<char, traits >& stream, void* & var) + { + basic_string<char, traits > temp; + temp = _readToken( stream); + sscanf(temp.c_str(), "%p", &var); + } + }; + + + template<class charT, class traits> void __skipws(basic_istream<charT,traits>& is){ + const typename basic_istream<charT,traits>::int_type eof = traits::eof(); + typename basic_istream<charT,traits>::int_type c; + //While the next character normally read doesn't equal eof + //and that character is a space, advance to the next read position + //Thus itterating through all whitespace until we get to the meaty stuff + while ( + !traits::eq_int_type((c = is.rdbuf()->sgetc()), eof) + && isspace(c) + ) + { + is.rdbuf()->sbumpc(); + } + if(traits::eq_int_type(c, eof)){ + //is.setstate(ios_base::eofbit); + } + } +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/iterator.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/iterator.svn-base new file mode 100644 index 0000000..d960652 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/iterator.svn-base @@ -0,0 +1,225 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <iosfwd> +#include <cstddef> +#include <char_traits> +#include <iterator_base> + + + +#ifndef __STD_HEADER_ITERATOR +#define __STD_HEADER_ITERATOR 1 + +namespace std{ + + // subclause _lib.stream.iterators_, stream iterators: + template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t> class istream_iterator; + template <class T, class charT, class traits, class Distance> bool + operator==(const istream_iterator<T,charT,traits,Distance>& x, const istream_iterator<T,charT,traits,Distance>& y); + template <class T, class charT, class traits, class Distance> bool + operator!=(const istream_iterator<T,charT,traits,Distance>& x, const istream_iterator<T,charT,traits,Distance>& y); + template <class T, class charT = char, class traits = char_traits<charT> > class ostream_iterator; + template<class charT, class traits = char_traits<charT> > class istreambuf_iterator; + template <class charT, class traits> bool + operator==(const istreambuf_iterator<charT,traits>& a, const istreambuf_iterator<charT,traits>& b); + template <class charT, class traits> bool + operator!=(const istreambuf_iterator<charT,traits>& a, const istreambuf_iterator<charT,traits>& b); + template <class charT, class traits = char_traits<charT> > class ostreambuf_iterator; + + + template < class T, class charT, class traits, class Distance > class _UCXXEXPORT istream_iterator + : public iterator<input_iterator_tag,T,Distance,const T*, const T&> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef basic_istream<charT,traits> istream_type; + istream_iterator() : in_stream(0), value(0) {} + istream_iterator(istream_type& s) : in_stream(&s), value() { + *in_stream >> value; + } + istream_iterator(const istream_iterator<T,charT,traits,Distance>& x) + : in_stream(x.in_stream), value(x.value) + { } + ~istream_iterator() { } + const T& operator*() const{ + return value; + } + const T* operator->() const{ + return &value; + } + istream_iterator<T,charT,traits,Distance>& operator++() { + *in_stream >> value; + return *this; + } + istream_iterator<T,charT,traits,Distance> operator++(int){ + istream_iterator<T,charT,traits,Distance> tmp = *this; + *in_stream >> value; + return (tmp); + } + bool m_equal(const istream_iterator<T,charT,traits,Distance>& x) const{ + return (in_stream == x.in_stream); + } + private: + basic_istream<charT,traits>* in_stream; + T value; + }; + + template <class T, class charT, class traits, class Distance> _UCXXEXPORT + bool operator==(const istream_iterator<T,charT,traits,Distance>& x, + const istream_iterator<T,charT,traits,Distance>& y) + { + return x.m_equal(y); + } + + template <class T, class charT, class traits, class Distance> _UCXXEXPORT + bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, + const istream_iterator<T,charT,traits,Distance>& y) + { + return !(x == y); + } + + template <class T, class charT, class traits> class _UCXXEXPORT ostream_iterator + : public iterator<output_iterator_tag,void,void,void,void> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef basic_ostream<charT,traits> ostream_type; + + ostream_iterator(ostream_type& s) : out_stream(&s), delim(0) { } + ostream_iterator(ostream_type& s, const charT* delimiter) : out_stream(&s), delim(delimiter) { } + ostream_iterator(const ostream_iterator<T,charT,traits>& x) : out_stream(x.out_stream), delim(x.delim) { } + ~ostream_iterator() { } + ostream_iterator<T,charT,traits>& operator=(const T& value){ + *out_stream << value; + if(delim != 0){ + *out_stream << delim; + } + return (*this); + } + ostream_iterator<T,charT,traits>& operator*(){ return *this; } + ostream_iterator<T,charT,traits>& operator++() { return *this; } + ostream_iterator<T,charT,traits> operator++(int) { return *this; } + private: + basic_ostream<charT,traits>* out_stream; + const char* delim; + }; + + template<class charT, class traits > class _UCXXEXPORT istreambuf_iterator : + public iterator<input_iterator_tag, charT, typename traits::off_type, charT*, charT&> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef typename traits::int_type int_type; + typedef basic_streambuf<charT,traits> streambuf_type; + typedef basic_istream<charT,traits> istream_type; + + class _UCXXEXPORT proxy{ + charT val; + basic_streambuf<charT, traits> * buf; + + proxy(charT v, basic_streambuf<charT, traits> * b) : val(v), buf(b) { } + public: + charT operator*() { return val; } + }; + + istreambuf_iterator() throw() : sbuf(0) { } + istreambuf_iterator(istream_type& s) throw() : sbuf(s.rdbuf()) { } + istreambuf_iterator(streambuf_type* s) throw() : sbuf(s) { } + istreambuf_iterator(const proxy& p) throw() : sbuf(&p.buf) { } + + charT operator*() const{ + return sbuf->sgetc(); + } + istreambuf_iterator<charT,traits>& operator++(){ + sbuf->sbumpc(); + return *this; + } + proxy operator++(int){ + istreambuf_iterator<charT,traits> tmp = *this; + sbuf->sbumpc(); + return(tmp); + } + + bool equal(const istreambuf_iterator& b) const{ + return sbuf == b.sbuf || (is_eof() && b.is_eof()); + } + private: + streambuf_type* sbuf; + inline bool is_eof() const{ + return sbuf == 0 || sbuf->sgetc() == traits_type::eof(); + } + }; + + template <class charT, class traits> _UCXXEXPORT bool + operator==(const istreambuf_iterator<charT,traits>& a, + const istreambuf_iterator<charT,traits>& b) + { + return a.equal(b); + } + + template <class charT, class traits> bool _UCXXEXPORT + operator!=(const istreambuf_iterator<charT,traits>& a, + const istreambuf_iterator<charT,traits>& b) + { + return !a.equal(b); + } + + template <class charT, class traits> class _UCXXEXPORT ostreambuf_iterator + : iterator<output_iterator_tag,void,void,void,void> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef basic_streambuf<charT,traits> streambuf_type; + typedef basic_ostream<charT,traits> ostream_type; + public: + ostreambuf_iterator(ostream_type& s) throw() : sbuf(s.rdbuf()), f(false) { } + ostreambuf_iterator(streambuf_type* s) throw() : sbuf(s), f(false) { } + ostreambuf_iterator& operator=(charT c){ + if(failed() == false){ + if(sbuf->sputc(c) == traits::eof()){ + f = true; + } + } + return *this; + } + ostreambuf_iterator& operator*(){ + return *this; + } + ostreambuf_iterator& operator++() { return *this; } + ostreambuf_iterator operator++(int) { return *this; } + bool failed() const throw(){ + return f; + } + + private: + streambuf_type* sbuf; + bool f; + }; + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/iterator_base.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/iterator_base.svn-base new file mode 100644 index 0000000..606f24e --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/iterator_base.svn-base @@ -0,0 +1,301 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef __STD_HEADER_ITERATOR_BASE +#define __STD_HEADER_ITERATOR_BASE 1 + +namespace std{ + template<class Iterator> struct iterator_traits; + template<class T> struct iterator_traits<T*>; + + template<class Category, class T, class Distance = ptrdiff_t, class Pointer = T*, class Reference = T&> struct iterator; + + struct _UCXXEXPORT input_iterator_tag {}; + struct _UCXXEXPORT output_iterator_tag {}; + struct _UCXXEXPORT forward_iterator_tag: public input_iterator_tag {}; + struct _UCXXEXPORT bidirectional_iterator_tag: public forward_iterator_tag {}; + struct _UCXXEXPORT random_access_iterator_tag: public bidirectional_iterator_tag {}; + + template <class InputIterator, class Distance> _UCXXEXPORT void advance(InputIterator& i, Distance n){ + while(n > 0){ + --n; + ++i; + } + } + + template <class InputIterator> _UCXXEXPORT typename iterator_traits<InputIterator>::difference_type + distance(InputIterator first, InputIterator last) + { + typename iterator_traits<InputIterator>::difference_type d = 0; + while(first++ !=last){ + d++; + } + return d; + } + + // subclause _lib.predef.iterators_, predefined iterators: + template <class Iterator> class reverse_iterator; + template <class Iterator> bool operator==(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator<(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator!=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator>=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator<=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> typename reverse_iterator<Iterator>::difference_type + operator-( const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> reverse_iterator<Iterator> + operator+( typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& x); + template <class Container> class back_insert_iterator; + template <class Container> back_insert_iterator<Container> back_inserter(Container& x); + template <class Container> class front_insert_iterator; + template <class Container> front_insert_iterator<Container> front_inserter(Container& x); + template <class Container> class insert_iterator; + template <class Container, class Iterator> + insert_iterator<Container> inserter(Container& x, Iterator i); + + //Actual Template definitions + + template<class Iterator> struct _UCXXEXPORT iterator_traits { + typedef typename Iterator::difference_type difference_type; + typedef typename Iterator::value_type value_type; + typedef typename Iterator::pointer pointer; + typedef typename Iterator::reference reference; + typedef typename Iterator::iterator_category iterator_category; + }; + + //Pointer specialization - required by standard + template<class T> struct _UCXXEXPORT iterator_traits<T*> { + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef T* pointer; + typedef T& reference; + typedef random_access_iterator_tag iterator_category; + }; + + //Specialization recomended by standard +/* template<class T> struct _UCXXEXPORT iterator_traits<T __far*> { + typedef long difference_type; + typedef T value_type; + typedef T __far* pointer; + typedef T __far& reference; + typedef random_access_iterator_tag iterator_category; + };*/ + +/* template <class BidirectionalIterator> _UCXXEXPORT void + reverse(BidirectionalIterator first, BidirectionalIterator last) + { + typename iterator_traits<BidirectionalIterator>::difference_type n = distance(first, last); + --n; + while(n > 0){ + typename iterator_traits<BidirectionalIterator>::value_type tmp = *first; + *first++ = * --last; + *last = tmp; + n -= 2; + } + };*/ + + + template <class Category, class T, class Distance, class Pointer, class Reference> + struct _UCXXEXPORT iterator + { + typedef T value_type; + typedef Distance difference_type; + typedef Pointer pointer; + typedef Reference reference; + typedef Category iterator_category; + }; + + + template <class Iterator> class _UCXXEXPORT reverse_iterator + : public iterator<typename iterator_traits<Iterator>::iterator_category, + typename iterator_traits<Iterator>::value_type, typename iterator_traits<Iterator>::difference_type, + typename iterator_traits<Iterator>::pointer, typename iterator_traits<Iterator>::reference> + { + protected: + Iterator current; + friend bool operator== <Iterator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + friend bool operator< <Iterator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + + public: + typedef Iterator iterator_type; + + reverse_iterator() : current(){}; + explicit reverse_iterator(Iterator x) : current(x) { } + template<class U> reverse_iterator(const reverse_iterator<U> &x) : current(x.base()){} + + Iterator base() const { return current; } // explicit + + typename iterator_traits<Iterator>::reference operator*() const { Iterator tmp = current; return *--tmp; } + typename iterator_traits<Iterator>::pointer operator->() const { return &(operator*()); } + typename iterator_traits<Iterator>::reference operator[](typename iterator_traits<Iterator>::difference_type n) const{ + return current[-n-1]; + } + + reverse_iterator& operator++(){ --current; return *this; } + reverse_iterator operator++(int) {reverse_iterator tmp = *this; --current; return tmp; } + reverse_iterator& operator--() { ++ current; return *this; } + reverse_iterator operator--(int) {reverse_iterator tmp = *this; ++current; return tmp; } + + reverse_iterator operator+ (typename iterator_traits<Iterator>::difference_type n) const{ + reverse_iterator retval( *this ); + retval+=n; + return retval; + } + reverse_iterator& operator+=(typename iterator_traits<Iterator>::difference_type n){ + current -= n; + return *this; + } + reverse_iterator operator- (typename iterator_traits<Iterator>::difference_type n) const{ + reverse_iterator retval( *this ); + retval-=n; + return retval; + } + reverse_iterator& operator-=(typename iterator_traits<Iterator>::difference_type n){ + current += n; + return *this; + } + }; + + + template <class Iterator> _UCXXEXPORT bool + operator==(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() == y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator<(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() < y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator!=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() != y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() > y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator>=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() >= y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator<=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() <= y.base(); + } + template <class Iterator> _UCXXEXPORT typename reverse_iterator<Iterator>::difference_type + operator-( const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return y.base() - x.base(); + } + template <class Iterator> _UCXXEXPORT reverse_iterator<Iterator> + operator+(typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& x) + { + return reverse_iterator<Iterator> (x.base() - n); + } + + template <class Container> class _UCXXEXPORT back_insert_iterator : + public iterator<output_iterator_tag,void,void,void,void> + { + protected: + Container& container; + public: + typedef Container container_type; + explicit back_insert_iterator(Container& x):container(x) {}; + back_insert_iterator<Container>& operator=(const typename Container::value_type& value){ + container.push_back(value); + return *this; + } + back_insert_iterator<Container>& operator*(){ + return *this; + } + back_insert_iterator<Container>& operator++(){ + return *this; + } + back_insert_iterator<Container> operator++(int){ + return *this; + } + }; + + template <class Container> _UCXXEXPORT back_insert_iterator<Container> + back_inserter(Container& x) + { + return back_insert_iterator<Container>(x); + } + + template <class Container> class _UCXXEXPORT front_insert_iterator + : public iterator<output_iterator_tag,void,void,void,void> + { + protected: + Container& container; + public: + typedef Container container_type; + explicit front_insert_iterator(Container& x): container(x) {} + front_insert_iterator<Container>& operator=(const typename Container::value_type& value){ + container.push_front(value); + return *this; + } + + front_insert_iterator<Container>& operator*() { return *this; } + front_insert_iterator<Container>& operator++() { return *this; } + front_insert_iterator<Container> operator++(int) { return *this; } + }; + + template <class Container> _UCXXEXPORT front_insert_iterator<Container> + front_inserter(Container& x) + { + return front_insert_iterator<Container>(x); + } + + template <class Container> class _UCXXEXPORT insert_iterator + : public iterator<output_iterator_tag,void,void,void,void> + { + protected: + Container& container; + typename Container::iterator iter; + public: + typedef Container container_type; + insert_iterator(Container& x, typename Container::iterator i) : container(x), iter(i) {} + insert_iterator<Container>& operator=(const typename Container::value_type& value){ + iter = container.insert(iter, value); + ++iter; + return *this; + } + insert_iterator<Container>& operator*() { return *this; } + insert_iterator<Container>& operator++() { return *this; } + insert_iterator<Container> operator++(int) { return *this; } + }; + + template <class Container, class Iterator> _UCXXEXPORT insert_iterator<Container> + inserter(Container& x, Iterator i) + { + return insert_iterator<Container>(x,typename Container::iterator(i)); + } + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/limits.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/limits.svn-base new file mode 100644 index 0000000..2aa1d04 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/limits.svn-base @@ -0,0 +1,611 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <climits> + +#ifndef __STD_HEADER_LIMITS +#define __STD_HEADER_LIMITS 1 + +//#warning limits header is nowhere complete or accurate + +namespace std{ + +enum float_round_style{ + round_indeterminate =-1, + round_toward_zero = 0, + round_to_nearest = 1, + round_toward_infinity = 2, + round_toward_neg_infinity = 3 +}; + +template <int bitsize> struct __bits_to_base_10{ + static const int size = -1; +}; +template <> struct __bits_to_base_10<7>{ + static const int size = 2; +}; +template <> struct __bits_to_base_10<8>{ + static const int size = 2; +}; +template <> struct __bits_to_base_10<9>{ + static const int size = 2; +}; +template <> struct __bits_to_base_10<10>{ + static const int size = 3; +}; +template <> struct __bits_to_base_10<15>{ + static const int size = 4; +}; +template <> struct __bits_to_base_10<16>{ + static const int size = 4; +}; +template <> struct __bits_to_base_10<17>{ + static const int size = 5; +}; +template <> struct __bits_to_base_10<18>{ + static const int size = 5; +}; +template <> struct __bits_to_base_10<31>{ + static const int size = 9; +}; +template <> struct __bits_to_base_10<32>{ + static const int size = 9; +}; +template <> struct __bits_to_base_10<35>{ + static const int size = 10; +}; +template <> struct __bits_to_base_10<36>{ + static const int size = 10; +}; +template <> struct __bits_to_base_10<63>{ + static const int size = 18; +}; +template <> struct __bits_to_base_10<64>{ + static const int size = 19; +}; +template <> struct __bits_to_base_10<71>{ + static const int size = 21; +}; +template <> struct __bits_to_base_10<72>{ + static const int size = 21; +}; +template <> struct __bits_to_base_10<79>{ + static const int size = 23; +}; +template <> struct __bits_to_base_10<80>{ + static const int size = 24; +}; +template <> struct __bits_to_base_10<127>{ + static const int size = 38; +}; +template <> struct __bits_to_base_10<128>{ + static const int size = 38; +}; + + + + + + +template <class T> class numeric_limits { +public: + // General -- meaningful for all specializations. + + static const bool is_specialized = false; + static T min(); + static T max(); + static const int radix; + static const int digits; + static const int digits10; + static const bool is_signed; + static const bool is_integer; + static const bool is_exact; + static const bool traps; + static const bool is_modulo; + static const bool is_bounded; + + // Floating point specific. + + static T epsilon(); + static T round_error(); + static const int min_exponent10; + static const int max_exponent10; + static const int min_exponent; + + static const int max_exponent; + static const bool has_infinity; + static const bool has_quiet_NaN; + static const bool has_signaling_NaN; + static const bool is_iec559; + static const bool has_denorm; + static const bool tinyness_before; + static const float_round_style round_style; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned char> { +public: + typedef unsigned char T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return UCHAR_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT; + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed char> { +public: + typedef signed char T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return SCHAR_MIN; + } + static T max(){ + return SCHAR_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT - 1; + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<char> { +public: + typedef char T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return CHAR_MIN; + } + static T max(){ + return CHAR_MAX; + } + static const int radix = 2; + static const int digits = (CHAR_MIN != 0) ? CHAR_BIT - 1 : CHAR_BIT; + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = (CHAR_MIN != 0); + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned short> { +public: + typedef unsigned short T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return USHRT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed short> { +public: + typedef signed short T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return SHRT_MIN; + } + static T max(){ + return SHRT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned int> { +public: + typedef unsigned int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return UINT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed int> { +public: + typedef signed int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return INT_MIN; + } + static T max(){ + return INT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned long int> { +public: + typedef unsigned long int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return ULONG_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed long int> { +public: + typedef signed long int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return LONG_MIN; + } + static T max(){ + return LONG_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<double> { + typedef double numeric_type; + + static const bool is_specialized = true; + static numeric_type min () { return __DBL_MIN__; } + static numeric_type max () { return __DBL_MAX__; } + static const int radix = __FLT_RADIX__; + static const int digits = __DBL_MANT_DIG__; + static const int digits10 = __DBL_DIG__; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const bool traps = false; // this is a guess + static const bool is_modulo = false; + static const bool is_bounded = true; + + // Floating point specific. + + static numeric_type epsilon () { return __DBL_EPSILON__; } + static numeric_type round_error () { return 0.5; } + static const int min_exponent10 = -1; //How do I properly get this? + static const int max_exponent10 = -1; //How do I properly get this? + static const int min_exponent = -1; //How do I properly get this? + static const int max_exponent = -1; //How do I properly get this? + static const bool has_infinity = false; //I don't know, so until I can find out, I'm saying no + static const bool has_quiet_NaN = false; //I don't know, so until I can find out, I'm saying no + static const bool has_signaling_NaN = false; //I don't know, so until I can find out, I'm saying no + static const bool has_denorm = false; //I don't know, so until I can find out, I'm saying no + + static const bool is_iec559 = false; //I don't know, so until I can find out, I'm saying no + static const bool tinyness_before = false; // more questions + static const float_round_style round_style = round_to_nearest; // more questions + static numeric_type denorm_min () { return -1; } //How do I properly get this? + static numeric_type infinity () { return -1; } //How do I properly get this? + static numeric_type quiet_NaN () { return -1; } //How do I properly get this? + static numeric_type signaling_NaN () { return -1; } //How do I properly get this? +}; + + + + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/list.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/list.svn-base new file mode 100644 index 0000000..e817057 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/list.svn-base @@ -0,0 +1,926 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <memory> +#include <iterator> +#include <algorithm> + +#ifndef __STD_HEADER_LIST +#define __STD_HEADER_LIST 1 + +namespace std{ + + template <class T, class Allocator = allocator<T> > class _UCXXEXPORT list { + public: + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef T value_type; + typedef Allocator allocator_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + + protected: + class node; + class iter_list; + + node * list_start; + node * list_end; + size_type elements; + Allocator a; + + public: + + typedef iter_list iterator; + typedef iter_list const_iterator; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + + explicit list(const Allocator& = Allocator()); + explicit list(size_type n, const T& value = T(), const Allocator& = Allocator()); + template <class InputIterator> list(InputIterator first, InputIterator last, + const Allocator& al= Allocator()); + list(const list<T,Allocator>& x); + ~list(); + + list<T,Allocator>& operator=(const list<T,Allocator>& x); + + template <class InputIterator> void assign(InputIterator first, InputIterator last); + template <class Size, class U> void assign(Size n, const U& u = U()); + allocator_type get_allocator() const; + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + bool empty() const; + size_type size() const; + size_type max_size() const; + void resize(size_type sz, T c = T()); + + reference front(); + const_reference front() const; + reference back(); + const_reference back() const; + + void push_front(const T& x); + void pop_front(); + void push_back(const T& x); + void pop_back(); + iterator insert(iterator position, const T& x = T()); + void insert(iterator position, size_type n, const T& x); + template <class InputIterator> void insert(iterator position, InputIterator first, InputIterator last); + iterator erase(iterator position); + iterator erase(iterator position, iterator last); + void swap(list<T,Allocator>&); + void clear(); + + void splice(iterator position, list<T,Allocator>& x); + void splice(iterator position, list<T,Allocator>& x, iterator i); + void splice(iterator position, list<T,Allocator>& x, iterator first, iterator last); + void remove(const T& value); + template <class Predicate> void remove_if(Predicate pred); + void unique(); + template <class BinaryPredicate> void unique(BinaryPredicate binary_pred); + void merge(list<T,Allocator>& x); + template <class Compare> void merge(list<T,Allocator>& x, Compare comp); + void sort(); + template <class Compare> void sort(Compare comp); + void reverse(); + protected: + void swap_nodes(node * x, node * y); + }; + + + //Implementations of List + + //List node + template <class T, class Allocator> class _UCXXEXPORT list<T, Allocator>::node{ + public: + node * previous; + node * next; + T * val; + + node(): previous(0), next(0), val(0){ } + node(const T & t ): previous(0), next(0), val(0) { + val = new T(t); + //FIXME use allocator somehow but only call constructor once + } + node(const T & t, node * p, node * n): previous(p), next(n), val(0) { + val = new T(t); + } + ~node(){ } + }; + + //List iterator + template <class T, class Allocator> class _UCXXEXPORT list<T, Allocator>::iter_list + : public std::iterator< + bidirectional_iterator_tag, + T, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + private: + node * current; + public: + iter_list():current(0) { } + iter_list( typename list<T, Allocator>::node * n): current(n) { } + iter_list(const list<T, Allocator>::iter_list & l): current(l.current) { } + ~iter_list(){ } + + iter_list & operator=(const list<T, Allocator>::iter_list & right ){ + current = right.current; + return *this; + } + + T & operator*(){ + return *(current->val); + } + T * operator->(){ + return current->val; + } + const T & operator*() const{ + return *current->val; + } + const T * operator->() const{ + return current->val; + } + + bool operator==(const list<T, Allocator>::iter_list & right) const { + return (current == right.current); + } + + bool operator!=(const list<T, Allocator>::iter_list & right) const { + return (current != right.current); + } + + iter_list & operator++(){ + current = current->next; + return *this; + } + + iter_list operator++(int){ + iter_list temp(current); + current = current->next; + return temp; + } + iter_list & operator--(){ + current = current->previous; + return *this; + } + + iter_list operator--(int){ + iter_list temp(current); + current = current->previous; + return temp; + } + node * link_struct(){ + return current; + } + iter_list & operator+=(unsigned int n){ + for(unsigned int i = 0; i < n; ++i){ + current = current->next; + } + return *this; + } + iter_list & operator-=(unsigned int n){ + for(unsigned int i = 0; i < n; ++i){ + current = current->previous; + } + return *this; + } + }; + + + template<class T, class Allocator> list<T, Allocator>::list(const Allocator& al) + :list_start(0), list_end(0), elements(0), a(al) + { + //End node + list_start = new node(); + list_end = list_start; + return; + } + + template<class T, class Allocator> list<T, Allocator>::list + (typename Allocator::size_type n, const T& value, const Allocator& al) + :list_start(0), list_end(0), elements(0), a(al) + { + //End node + list_start = new node(); + list_end = list_start; + + for(typename Allocator::size_type i = 0; i < n ; ++i){ + push_back(value); + } + } + + template<class T, class Allocator> template <class InputIterator> + list<T, Allocator>::list + (InputIterator first, InputIterator last, const Allocator& al) + : list_start(0), list_end(0), elements(0), a(al) + { + list_start = new node(); + list_end = list_start; + while(first != last){ + push_back(*first); + ++first; + } + } + + template<class T, class Allocator> list<T, Allocator>::list(const list<T,Allocator>& x) + : list_start(0), list_end(0), elements(0), a(x.a) + { + list_start = new node(); + list_end = list_start; + + iterator i = x.begin(); + while(i != x.end()){ + push_back( *i); + ++i; + } + } + + template<class T, class Allocator> list<T, Allocator>::~list(){ + while(elements > 0){ + pop_front(); + } + delete list_start->val; +#if UCLIBCXX_DEBUG + list_start->val = 0; +#endif + delete list_start; +#if UCLIBCXX_DEBUG + list_start = 0; + list_end = 0; +#endif + } + + + template<class T, class Allocator> void list<T, Allocator>::swap_nodes(node * x, node * y){ + T * v = x->val; + x->val = y->val; + y->val = v; + } + + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::begin() + { + return iterator(list_start); + } + + + template<class T, class Allocator> typename list<T, Allocator>::const_iterator + list<T, Allocator>::begin() const + { + return const_iterator(list_start); + } + + + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::end() + { + return iterator(list_end); + } + + template<class T, class Allocator> typename list<T, Allocator>::const_iterator + list<T, Allocator>::end() const + { + return const_iterator(list_end); + } + + template<class T, class Allocator> typename list<T, Allocator>::reverse_iterator + list<T, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template<class T, class Allocator> typename list<T, Allocator>::const_reverse_iterator + list<T, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template<class T, class Allocator> typename list<T, Allocator>::reverse_iterator + list<T, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template<class T, class Allocator> typename list<T, Allocator>::const_reverse_iterator + list<T, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template<class T, class Allocator> bool list<T, Allocator>::empty() const{ + return (elements == 0); + } + template<class T, class Allocator> typename list<T, Allocator>::size_type list<T, Allocator>::size() const{ + return elements; + } + template<class T, class Allocator> typename list<T, Allocator>::size_type list<T, Allocator>::max_size() const{ + return ((size_type)(-1)) / (sizeof(T) + sizeof(node)); + } + template<class T, class Allocator> void list<T, Allocator>::resize(typename Allocator::size_type sz, T c){ +// if(sz > elements){ + for(typename Allocator::size_type i = elements; i < sz; ++i){ + push_back(c); + } +// } +// if(sz < elements){ + for(typename Allocator::size_type i = elements; i > sz; --i){ + pop_back(); + } +// } + } + + template<class T, class Allocator> typename list<T, Allocator>::reference list<T, Allocator>::front(){ + return *(list_start->val); + } + template<class T, class Allocator> typename list<T, Allocator>::const_reference list<T, Allocator>::front() const{ + return *(list_start->val); + } + template<class T, class Allocator> typename list<T, Allocator>::reference list<T, Allocator>::back(){ + return *(list_end->previous->val); + } + template<class T, class Allocator> typename list<T, Allocator>::const_reference list<T, Allocator>::back() const{ + return *(list_end->previous->val); + } + + + template<class T, class Allocator> void list<T, Allocator>::push_front(const T& x){ + node * temp = new node(x); + list_start->previous = temp; + temp->previous = 0; + temp->next = list_start; + list_start = temp; + ++elements; + } + + template<class T, class Allocator> void list<T, Allocator>::pop_front(){ + if(elements > 0){ + list_start = list_start->next; + delete list_start->previous->val; +#if UCLIBCXX_DEBUG + list_start->previous->val = 0; + list_start->previous->next = 0; + list_start->previous->previous = 0; +#endif + delete list_start->previous; + list_start->previous = 0; + --elements; + } + } + + template<class T, class Allocator> void list<T, Allocator>::push_back(const T& x){ + if(elements == 0){ + //The list is completely empty + list_start = new node(x); + list_end->previous = list_start; + list_start->previous = 0; + list_start->next = list_end; + elements = 1; + }else{ + node * temp = new node(x); + temp->previous = list_end->previous; + temp->next = list_end; + list_end->previous->next = temp; + list_end->previous = temp; + ++elements; + } + } + + template<class T, class Allocator> void list<T, Allocator>::pop_back(){ + if(elements > 0){ + node * temp = list_end->previous; + if(temp == list_start){ + list_end->previous = 0; + list_start = list_end; + }else{ + temp->previous->next = temp->next; + list_end->previous = temp->previous; + } + delete temp->val; +#if UCLIBCXX_DEBUG + temp->val = 0; + temp->next = 0; + temp->previous = 0; +#endif + delete temp; +#if UCLIBCXX_DEBUG + temp = 0; +#endif + --elements; + } + } + + + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::insert(iterator position, const T& x) + { + node * temp = new node(x); + + temp->previous = position.link_struct()->previous; + temp->next = position.link_struct(); + + if(temp->previous == 0){ + list_start = temp; + }else{ + position.link_struct()->previous->next = temp; + } + + position.link_struct()->previous = temp; + + ++elements; + --position; + return position; + } + + template<class T, class Allocator> void list<T, Allocator>::insert(iterator position, size_type n, const T& x){ + for(typename list<T, Allocator>::size_type i = 0; i < n; ++i){ + position = insert(position, x); + } + } + + template<class T, class Allocator> template <class InputIterator> void + list<T, Allocator>::insert(iterator position, InputIterator first, InputIterator last) + { + while(first !=last){ + insert(position, *first); + ++first; + } + } + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::erase(iterator position) + { + if(position != end() ){ + node * temp = position.link_struct(); + if(temp == list_start){ + ++position; + temp->next->previous = 0; + list_start = temp->next; + }else{ + --position; + temp->next->previous = temp->previous; + temp->previous->next = temp->next; + ++position; + } + delete temp->val; +#if UCLIBCXX_DEBUG + temp->next = 0; + temp->previous = 0; + temp->val = 0; +#endif + delete temp; +#if UCLIBCXX_DEBUG + temp = 0; +#endif + --elements; + } + return position; + } + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::erase(iterator position, iterator last) + { + iterator temp = position; + while(position !=last){ + position = erase(position); + } + return position; + } + template<class T, class Allocator> void list<T, Allocator>::swap(list<T,Allocator>& l){ + node * temp; + size_type tempel; + + temp = list_start; + list_start = l.list_start; + l.list_start = temp; + + temp = list_end; + list_end = l.list_end; + l.list_end = temp; + + tempel = elements; + elements = l.elements; + l.elements = tempel; + } + template<class T, class Allocator> void list<T, Allocator>::clear(){ + while(elements > 0){ + pop_front(); + } + } + + template<class T, class Allocator> list<T,Allocator>& list<T, Allocator>:: operator=(const list<T,Allocator>& x){ + if(&x == this){ + return *this; + } + clear(); + iterator i = x.begin(); + while(i != x.end()){ + push_back(*i); + ++i; + } + return *this; + } + + + template<class T, class Allocator> + void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x) + { + + //Can't add non-existant elements + if(x.elements == 0){ + return; + } + + elements += x.elements; + x.elements = 0; + + + //Chaining to the begining + if(position == begin()){ + x.list_end->previous->next = list_start; + list_start->previous = x.list_end->previous; + + list_start = x.list_start; + + x.list_start = x.list_end; + x.list_end->previous = 0; + + return; + } + + //Link everything we need + x.list_start->previous = position.link_struct()->previous; + position.link_struct()->previous->next = x.list_start; + + position.link_struct()->previous = x.list_end->previous; + x.list_end->previous->next = position.link_struct(); + + //Clean up the other list + + x.list_start = x.list_end; + x.list_end->previous=0; + + } + + template<class T, class Allocator> + void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x, iterator i) + { + //Invalid conditions + if( x.elements == 0 || i == position || position.link_struct() == i.link_struct()->next ){ + return; + } + + + //Do we need to adjust the begining pointer? + if(i == x.begin()){ + x.list_start = x.list_start->next; + x.list_start->previous = 0; + } + + + //Insert at begining special case + if(position == begin()){ + + i.link_struct()->previous->next = i.link_struct()->next; + i.link_struct()->next->previous = i.link_struct()->previous; + + i.link_struct()->previous = 0; + i.link_struct()->next = position.link_struct(); + position.link_struct()->previous = i.link_struct(); + + list_start = i.link_struct(); + + --x.elements; + ++elements; + return; + } + + if( i.link_struct()->previous != 0){ + i.link_struct()->previous->next = i.link_struct()->next; + i.link_struct()->next->previous = i.link_struct()->previous; + }else{ + i.link_struct()->next->previous = 0; + x.list_start = i.link_struct()->next; + } + + i.link_struct()->previous = position.link_struct()->previous; + position.link_struct()->previous->next = i.link_struct(); + + i.link_struct()->next = position.link_struct(); + position.link_struct()->previous = i.link_struct(); + + --x.elements; + ++elements; + } + + template<class T, class Allocator> + void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x, + iterator first, iterator last) + { + if(x.elements == 0){ + return; + } + + iterator temp; + while(first != last){ + temp = first; + ++first; + splice(position, x, temp); + } + } + + + template<class T, class Allocator> void list<T, Allocator>::remove(const T& value){ + iterator temp = begin(); + while( temp != end() ){ + if(*temp == value){ + temp = erase(temp); + }else{ + ++temp; + } + } + } + + + template<class T, class Allocator> template <class Predicate> void list<T, Allocator>::remove_if(Predicate pred){ + iterator temp = begin(); + while( temp != end() ){ + if( pred(*temp) ){ + temp = erase(temp); + }else{ + ++temp; + } + } + } + + + template<class T, class Allocator> void list<T, Allocator>::unique(){ + equal_to<typename iterator_traits<iterator>::value_type> p; + unique(p); + } + + template<class T, class Allocator> template <class BinaryPredicate> + void list<T, Allocator>::unique(BinaryPredicate binary_pred) + { + iterator temp1 = begin(); + iterator temp2; + ++temp1; + while( temp1 != end() ){ + temp2 = temp1; + --temp2; + if( binary_pred(*temp1, *temp2) ){ + erase(temp1); + temp1 = temp2; + } + ++temp1; + } + } + + template<class T, class Allocator> void list<T, Allocator>::merge(list<T,Allocator>& x){ + less<typename iterator_traits<typename list<T, Allocator>::iterator>::value_type> c; + merge(x, c); + } + + template<class T, class Allocator> template <class Compare> + void list<T, Allocator>::merge(list<T,Allocator>& x, Compare comp) + { + iterator source = x.begin(); + iterator temp; + iterator dest = begin(); + + while(source != x.end()){ + while( dest != end() && comp (*dest, *source) ){ + ++dest; + } + ++elements; + --x.elements; + + temp = source; + ++temp; + + if(dest == begin()){ + dest.link_struct()->previous = source.link_struct(); + source.link_struct()->next = dest.link_struct(); + source.link_struct()->previous = 0; + list_start = source.link_struct(); + }else{ + source.link_struct()->previous = dest.link_struct()->previous; + dest.link_struct()->previous->next = source.link_struct(); + source.link_struct()->next = dest.link_struct(); + dest.link_struct()->previous = source.link_struct(); + } + source = temp; + } + + //Fix up x; + x.list_start = x.list_end; + x.list_start->previous = 0; + } + + template<class T, class Allocator> void list<T, Allocator>::sort(){ + less<typename iterator_traits<typename list<T, Allocator>::iterator>::value_type> c; + sort(c); + } + + template<class T, class Allocator> template <class Compare> + void list<T, Allocator>::sort(Compare comp) + { + typename list<T, Allocator>::iterator i, j, k; + + //FIXME - bubble sort + + if(elements == 0){ + return; + } + + i = end(); + --i; + while(i != begin()){ + j = begin(); + k = j; + ++k; + while(j != i){ + if( comp(*k, *j) ){ + swap_nodes(k.link_struct(), j.link_struct()); + } + ++j; + ++k; + } + --i; + } + } + + + template<class T, class Allocator> void list<T, Allocator>::reverse(){ + if(elements == 0){ + return; + } + + node * current; + node * following; + node * temp; + + //Need to move the list_end element to the begining + + temp = list_end; + list_end = temp->previous; + list_end->next = 0; + + list_start->previous = temp; + temp->previous = 0; + temp->next = list_start; + list_start = temp; + + current = list_start; + + while( current != list_end ){ + following = current->next; + + //Swap the values pointed to/at with the current node + temp = current->next; + current->next = current->previous; + current->previous = temp; + + current = following; + } + + //Swap pointers on the end node + temp = list_end->next; + list_end->next = list_end->previous; + list_end->previous = temp; + + + //Swap the fixed pointers + temp = list_start; + list_start = list_end; + list_end = temp; + + } + + template <class T, class Allocator> + bool operator==(const list<T,Allocator>& x, const list<T,Allocator>& y){ + if(x.size() != y.size()){ + return false; + } + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + + while(i != x.end()){ + if( *i != *j){ + return false; + } + ++i; + ++j; + } + return true; + } + + template <class T, class Allocator> + bool operator< (const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i < *j){ + return true; + } + if(*j < *i){ + return false; + } + ++i; + ++j; + } + return (i == x.end() && j != y.end()); + } + + template <class T, class Allocator> + bool operator!=(const list<T,Allocator>& x, const list<T,Allocator>& y){ + return !(x == y); + } + + template <class T, class Allocator> + bool operator> (const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i > *j){ + return true; + } + if( *j > *i){ + return false; + } + ++i; + ++j; + } + return (i != x.end() && j == y.end()); + } + + template <class T, class Allocator> + bool operator>=(const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i >= *j){ + return true; + } + if(*j >= *i){ + return false; + } + ++i; + ++j; + } + return (i != x.end() && j == y.end()); + } + + template <class T, class Allocator> + bool operator<=(const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i <= *j){ + return true; + } + if(*j <= *i){ + return false; + } + ++i; + ++j; + } + return (i == x.end()); + } + + template <class T, class Allocator> + void swap(list<T,Allocator>& x, list<T,Allocator>& y){ + x.swap(y); + } + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/locale.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/locale.svn-base new file mode 100644 index 0000000..e3ace7b --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/locale.svn-base @@ -0,0 +1,79 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <string> + +#ifndef __HEADER_STD_LOCALE +#define __HEADER_STD_LOCALE 1 + +namespace std{ + class _UCXXEXPORT locale { + public: + // types: + class facet; + class id; + typedef unsigned char category; + + static const category + none = 0, + collate = 0x01, ctype = 0x02, + monetary = 0x04, numeric = 0x08, + time = 0x10, messages = 0x20, + all = collate | ctype | monetary | numeric | time | messages; + + // construct/copy/destroy: + locale() throw(){ + return; + } + locale(const locale& other) throw(){ + (void)other; + return; + } + locale(const char *) throw(){ + return; + } + ~locale() throw(){ + return; + } + + const locale& operator=(const locale&) throw(){ + return *this; + } + std::string name() const { return "C"; } + }; + + class _UCXXEXPORT locale::facet { + friend class locale; + explicit facet(size_t = 0){ + return; + } + virtual ~facet(){ + return; + } + }; + + class _UCXXEXPORT locale::id { + id(){ } + }; + +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/map.old.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/map.old.svn-base new file mode 100644 index 0000000..c77e056 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/map.old.svn-base @@ -0,0 +1,1163 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include <deque> +#include<functional> + + +#ifndef __STD_HEADER_MAP +#define __STD_HEADER_MAP + +#pragma GCC visibility push(default) + +namespace std{ + + +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class __base_map; +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class map; +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class multimap; + +template<class Key, class T, class Compare, class Allocator> class __map_iter; +template<class Key, class T, class Compare, class Allocator> class __map_citer; + +/* The code for the map containers is split up into two classes. + * The first class, __base_map holds all of the data and does much of the iterator-based + * work. Then the classes map and multimap inherit from there. This was done to reduce + * the redundancy of code (And thus errors which might crop up), as well as possibly + * reducing the size of binaries if both map and multimap are used, along with the same + * template parameters. + */ + + + +//All base classes first (__base_map, iterators, value_compare) and it's associated code + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __base_map{ + +protected: + friend class __map_iter<Key, T, Compare, Allocator>; + friend class __map_citer<Key, T, Compare, Allocator>; + +public: + typedef __base_map<Key,T,Compare,Allocator> map_type; + typedef Key key_type; + typedef T mapped_type; + typedef pair<Key, T> value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef __map_iter<Key, T, Compare, Allocator> iterator; + typedef __map_citer<Key, T, Compare, Allocator> const_iterator; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename std::reverse_iterator<iterator> reverse_iterator; + typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator; + + class value_compare; + + explicit __base_map(const Compare& comp = Compare(), const Allocator& al = Allocator()); + __base_map(const map_type& x); + ~__base_map(); + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + bool empty() const; + size_type size() const; + size_type max_size() const; + + iterator lower_bound(const key_type& x); + const_iterator lower_bound(const key_type& x) const; + + void swap(map_type & x); + void clear(); + + key_compare key_comp() const; +// value_compare value_comp() const; + +protected: + + deque<pair<Key, T>, allocator<pair<Key, T> > > data; + Compare c; + +}; + + + //Implementations + + template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __map_citer + : public std::iterator< + bidirectional_iterator_tag, + std::pair<Key, T>, + typename Allocator::difference_type, + std::pair<Key, T>*, + std::pair<Key, T>& + > + { + protected: + typedef __base_map<Key, T, Compare, Allocator> Map; + + friend class __base_map<Key, T, Compare, Allocator>; + friend class __base_map<Key, T, Compare, Allocator>::iterator; + + friend class map<Key, T, Compare, Allocator>; + friend class multimap<Key, T, Compare, Allocator>; + + typename Map::size_type element; + const Map * container; + public: + __map_citer() : element(0), container(0) { } + __map_citer(const typename Map::const_iterator & m) + : element(m.element), container(m.container) { } + __map_citer(typename Map::size_type e, const Map * const c) + : element(e), container(c) { } + ~__map_citer() { } + + typename Map::value_type operator*() const{ + return container->data[element]; + } + const typename Map::value_type * operator->() const{ + return &(container->data[element]); + } + __map_citer & operator=(const typename Map::const_iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Map::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Map::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __map_citer & operator++(){ + ++element; + return *this; + } + __map_citer operator++(int){ + __map_citer temp(*this); + ++element; + return temp; + } + __map_citer & operator--(){ + --element; + return *this; + } + __map_citer operator--(int){ + __map_citer temp(*this); + --element; + return temp; + } + + }; + + + template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __map_iter + : public std::iterator< + bidirectional_iterator_tag, + std::pair<Key, T>, + typename Allocator::difference_type, + std::pair<Key, T>*, + std::pair<Key, T>& + > + { + protected: + typedef class __base_map<Key, T, Compare, Allocator> Map; + + //FIXME - Find a way to use template parameters or something. This will do for now + friend class __base_map<Key, T, Compare, Allocator>; + friend class __base_map<Key, T, Compare, Allocator>::const_iterator; + + friend class map<Key, T, Compare, Allocator>; + friend class multimap<Key, T, Compare, Allocator>; + + typename Map::size_type element; + Map * container; + public: + __map_iter() : element(0), container(0) { } + __map_iter(const typename Map::iterator & m) + : element(m.element), container(m.container) { } + __map_iter(typename Map::size_type e, Map * c) + : element(e), container(c) { } + ~__map_iter() { } + + typename Map::value_type & operator*(){ + return container->data[element]; + } + const typename Map::value_type & operator*() const{ + return container->data[element]; + } + typename Map::value_type * operator->(){ + return &(container->data[element]); + } + __map_iter & operator=(const typename Map::iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Map::iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Map::iterator & m) const { + return (m.element != element || m.container != container); + } + bool operator==(const typename Map::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Map::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __map_iter & operator++(){ + ++element; + return *this; + } + __map_iter operator++(int){ + __map_iter temp(*this); + ++element; + return temp; + } + __map_iter & operator--(){ + --element; + return *this; + } + __map_iter operator--(int){ + __map_iter temp(*this); + --element; + return temp; + } + + operator typename Map::const_iterator() const{ + return typename Map::const_iterator(element, container); + } + + }; + + + //Compare the keys of the two items + template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT + __base_map<Key, T, Compare, Allocator>::value_compare : public binary_function< + typename map<Key, T, Compare, Allocator>::value_type, + typename map<Key, T, Compare, Allocator>::value_type, + bool> + { + friend class __base_map<Key, T, Compare, Allocator>; + protected: + Compare comp; + value_compare(Compare c) : comp(c) { } + ~value_compare() { } + public: + bool operator()(const value_type& x, const value_type& y) const { + return comp(x.first, y.first); + } + }; + + template <class Key, class T, class Compare, class Allocator> + __base_map<Key, T, Compare, Allocator>::__base_map(const Compare& comp, const Allocator&) + : data(), c(comp) + { + + } + + template <class Key, class T, class Compare, class Allocator> + __base_map<Key, T, Compare, Allocator>::__base_map(const __base_map<Key,T,Compare,Allocator>& x) + : data(x.data), c(x.c) + { + + } + + template <class Key, class T, class Compare, class Allocator> + __base_map<Key, T, Compare, Allocator>::~__base_map() + { + + } + + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::iterator + __base_map<Key, T, Compare, Allocator>::begin() + { + return iterator(0, this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_iterator + __base_map<Key, T, Compare, Allocator>::begin() const + { + return const_iterator(0, this); + + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::iterator + __base_map<Key, T, Compare, Allocator>::end() + { + return iterator(data.size(), this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_iterator + __base_map<Key, T, Compare, Allocator>::end() const + { + return const_iterator(data.size(), this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::reverse_iterator + __base_map<Key, T, Compare, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_reverse_iterator + __base_map<Key, T, Compare, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::reverse_iterator + __base_map<Key, T, Compare, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_reverse_iterator + __base_map<Key, T, Compare, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template <class Key, class T, class Compare, class Allocator> + bool __base_map<Key, T, Compare, Allocator>::empty() const + { + return (data.size() == 0); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::size_type + __base_map<Key, T, Compare, Allocator>::size() const + { + return data.size(); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::size_type + __base_map<Key, T, Compare, Allocator>::max_size() const + { + return data.max_size(); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::iterator + __base_map<Key, T, Compare, Allocator>::lower_bound(const key_type &x) + { + size_type low = 0; + size_type high = data.size(); + + while (low < high) { + size_type i = (low + high) / 2; + if( c(data[i].first, x) ){ + low = i + 1; + }else{ + high = i; + } + } + + return iterator(low, this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_iterator + __base_map<Key, T, Compare, Allocator>::lower_bound(const key_type &x) const + { + size_type low = 0; + size_type high = data.size(); + + while (low < high) { + size_type i = (low + high) / 2; + if( c(data[i].first, x) ){ + low = i + 1; + }else{ + high = i; + } + } + + return const_iterator(low, this); + } + + template <class Key, class T, class Compare, class Allocator> + void __base_map<Key, T, Compare, Allocator>::swap(__base_map<Key,T,Compare,Allocator>& m) + { + Compare n = c; + c = m.c; + m.c = n; + + data.swap(m.data); + } + + + template <class Key, class T, class Compare, class Allocator> + void __base_map<Key, T, Compare, Allocator>::clear() + { + data.clear(); + } + + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::key_compare + __base_map<Key, T, Compare, Allocator>::key_comp() const + { + return c; + } + +// value_compare value_comp() const; + + + + + +/* This is the implementation for the map container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + + + + +//Implementation of map + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT map + : public __base_map<Key, T, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_map<Key, T, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::mapped_type mapped_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::value_compare; + + explicit map(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> map(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + map(const map<Key,T,Compare,Allocator>& x) : base(x) { } + ~map() { } + + map<Key,T,Compare,Allocator>& operator=(const map<Key,T,Compare,Allocator>& x); + + reference operator[](const key_type& k); + + pair<iterator, bool> insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + + template <class InputIterator> void insert(InputIterator first, InputIterator last); + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + friend bool operator==(const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + + using base::data; + using base::c; + +}; + + + template <class Key, class T, class Compare, class Allocator> template <class InputIterator> + map<Key, T, Compare, Allocator>:: + map(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class T, class Compare, class Allocator> + map<Key, T, Compare, Allocator>::map<Key,T,Compare,Allocator>& + map<Key, T, Compare, Allocator>::operator=(const map<Key,T,Compare,Allocator>& x) + { + if( &x == this){ + return *this; + } + c = x.c; + data = x.data; + return *this; + } + + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::reference + map<Key, T, Compare, Allocator>::operator[](const key_type & k) + { +/* iterator i = lower_bound(k); + if( !c( i->first, k) && !c(k, i->first) ){ + return i->second; + } + pair<Key, T> t; + t.first = k; + t.second = T(); + return insert(t).first->second; +*/ + //This is from the spec and is quite ugly. + return (*((insert(make_pair(k, T()))).first)).second; + } + + template <class Key, class T, class Compare, class Allocator> + pair<typename map<Key, T, Compare, Allocator>::iterator, bool> + map<Key, T, Compare, Allocator>::insert(const value_type& x) + { + pair<typename map<Key, T, Compare, Allocator>::iterator, bool> retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x.first, data[0].first) ){ + data.push_front(x); + retval.first = begin(); + retval.second = true; + return retval; + } + + //Element to insert goes at the end + if( c(data[data.size() - 1].first, x.first) ){ + data.push_back(x); + retval.first = end(); + --retval.first; + retval.second = true; + return retval; + } + + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x.first); + + //No match - this should never happen + if(retval.first == end()){ + retval.second = false; + return retval; + } + + //If we have an exact match + if( !c( retval.first->first, x.first) && !c(x.first, retval.first->first ) ){ + retval.second = false; + return retval; + } + + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator q(&data, retval.first.element); + data.insert(q, x); + + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x.first); //Need to refind because insert can move data around + retval.second = true; + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::iterator + map<Key, T, Compare, Allocator>::insert(iterator, const value_type& x) + { + //Just reusing code. It's hard to make improvements over existing algo. + //We aren't using the iterator parameter, but it's only a hint and not required to be used. + insert(x); + return find(x.first); + } + + template <class Key, class T, class Compare, class Allocator> + template <class InputIterator> void + map<Key, T, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class T, class Compare, class Allocator> void + map<Key, T, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator pos(&data, position.element); + data.erase(pos); + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::size_type + map<Key, T, Compare, Allocator>::erase(const key_type& x) + { + typename map<Key, T, Compare, Allocator>::iterator i = find(x); + if(i!=end()){ + erase(i); + return 1; + } + return 0; + } + + template <class Key, class T, class Compare, class Allocator> + void map<Key, T, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator f(&data, first.element); + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator l(&data, last.element); + data.erase(f, l); + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::iterator + map<Key, T, Compare, Allocator>:: + find(const typename map<Key, T, Compare, Allocator>::key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( retval->first, x) && !c(x, retval->first )){ + return retval; + } + return end(); + + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::const_iterator + map<Key, T, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + + const_iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( retval->first, x) && !c(x, retval->first )){ + return retval; + } + return end(); + + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::size_type + map<Key, T, Compare, Allocator>::count(const typename map<Key, T, Compare, Allocator>::key_type& x) const + { + if( find(x) == end()){ + return 0; + } + return 1; + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::iterator + map<Key, T, Compare, Allocator>::upper_bound(const key_type& x) + { + typename map<Key, T, Compare, Allocator>::iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + if( i != end() && !c(x, i->first) ){ + ++i; + } + return i; + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::const_iterator + map<Key, T, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename map<Key, T, Compare, Allocator>::const_iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + if(i != end() && !c(x, i->first)){ + ++i; + } + return i; + } + + + template <class Key, class T, class Compare, class Allocator> + pair< typename map<Key, T, Compare, Allocator>::iterator, + typename map<Key, T, Compare, Allocator>::iterator + > map<Key, T, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename map<Key, T, Compare, Allocator>::iterator, + typename map<Key, T, Compare, Allocator>::iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class T, class Compare, class Allocator> + pair< typename map<Key, T, Compare, Allocator>::const_iterator, + typename map<Key, T, Compare, Allocator>::const_iterator + > map<Key, T, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename map<Key, T, Compare, Allocator>::const_iterator, + typename map<Key, T, Compare, Allocator>::const_iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class T, class Compare, class Allocator> bool operator== + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y) + { + if(x.c == y.c && x.data == y.data){ + return true; + } + return false; + } + + + +//Implementation of multimap + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT multimap + : public __base_map<Key, T, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_map<Key, T, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::mapped_type mapped_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + explicit multimap(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> multimap(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + multimap(const multimap<Key,T,Compare,Allocator>& x) : base(x) { } + ~multimap() { } + + multimap<Key,T,Compare,Allocator>& operator=(const multimap<Key,T,Compare,Allocator>& x); + + iterator insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + template <class InputIterator> void insert(InputIterator first, InputIterator last); + + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + using base::data; + using base::c; + +}; + + + + template <class Key, class T, class Compare, class Allocator> template <class InputIterator> + multimap<Key, T, Compare, Allocator>:: + multimap(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class T, class Compare, class Allocator> + multimap<Key, T, Compare, Allocator>::multimap<Key,T,Compare,Allocator>& + multimap<Key, T, Compare, Allocator>::operator=(const multimap<Key,T,Compare,Allocator>& x) + { + if( &x == this){ + return *this; + } + c = x.c; + data = x.data; + return *this; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::insert(const value_type &x) + { + iterator retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x.first, data[0].first) ){ + data.push_front(x); + return begin(); + } + + //Element to insert goes at the end + if( c(data[data.size() - 1].first, x.first) ){ + data.push_back(x); + return end(); + } + + retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x.first); + + //No match - this should never happen + if(retval == end()){ + return retval; + } + + if( !c(x.first, retval->first) ){ + ++retval; + } + + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator q(&data, retval.element); + data.insert(q, x); + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::insert(iterator position, const value_type& x) + { + + //Inserting at begining + if(position == begin() && !c(position->first, x.first) ){ + data.push_front(x); + return position; + } + //Inserting at end + if(position == end() && !c(x.first, data[data.size() - 1].first) ){ + data.push_back(x); + return position; + } + + //Inserting in middle + iterator temp = position; + --temp; + if( !c(position->first, x.first) && !c(x.first, temp->first) ){ + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator q(&data, position.element); + data.insert(q, x); + return position; + } + + return insert(x); + } + + template <class Key, class T, class Compare, class Allocator> + template <class InputIterator> void + multimap<Key, T, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + + + template <class Key, class T, class Compare, class Allocator> void + multimap<Key, T, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator pos(&data, position.element); + data.erase(pos); + } + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::size_type + multimap<Key, T, Compare, Allocator>::erase(const key_type& x) + { + typename multimap<Key, T, Compare, Allocator>::iterator f = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + typename multimap<Key, T, Compare, Allocator>::iterator l = upper_bound(x); + size_type t = l.element - f.element; + erase(f, l); + return t; + } + + + + template <class Key, class T, class Compare, class Allocator> + void multimap<Key, T, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator f(&data, first.element); + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator l(&data, last.element); + data.erase(f, l); + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::find(const key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + if( c(x, retval->first) || c(retval->first, x) ){ + return end(); + } + + while( retval.element > 0 && !c(retval->first, x) && !c(x, retval->first) ){ + --retval; + } + if( c(retval->first, x)){ + ++retval; + } + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::const_iterator + multimap<Key, T, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + const_iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + if( c(x, retval->first) || c(retval->first, x) ){ + return end(); + } + + while( retval.element > 0 && !c(retval->first, x) && !c(x, retval->first) ){ + --retval; + } + if( c(retval->first, x)){ + ++retval; + } + + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::size_type + multimap<Key, T, Compare, Allocator>:: + count(const typename multimap<Key, T, Compare, Allocator>::key_type& x) const + { + pair< typename multimap<Key, T, Compare, Allocator>::const_iterator, + typename multimap<Key, T, Compare, Allocator>::const_iterator + > temp = equal_range(x); + + return temp.second.element - temp.first.element; + } + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::upper_bound(const key_type& x) + { + typename multimap<Key, T, Compare, Allocator>::iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + while(i != end() && !c(x, i->first)){ + ++i; + } + return i; + } + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::const_iterator + multimap<Key, T, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename multimap<Key, T, Compare, Allocator>::const_iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + while(i != end() && !c(x, i->first)){ + ++i; + } + return i; + } + + + template <class Key, class T, class Compare, class Allocator> + pair< typename multimap<Key, T, Compare, Allocator>::iterator, + typename multimap<Key, T, Compare, Allocator>::iterator + > multimap<Key, T, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename multimap<Key, T, Compare, Allocator>::iterator, + typename multimap<Key, T, Compare, Allocator>::iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class T, class Compare, class Allocator> + pair< typename multimap<Key, T, Compare, Allocator>::const_iterator, + typename multimap<Key, T, Compare, Allocator>::const_iterator + > multimap<Key, T, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename multimap<Key, T, Compare, Allocator>::const_iterator, + typename multimap<Key, T, Compare, Allocator>::const_iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + + + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y); + + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y); + +} + +#pragma GCC visibility pop + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/map.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/map.svn-base new file mode 100644 index 0000000..8478f61 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/map.svn-base @@ -0,0 +1,257 @@ +/* Copyright (C) 2004-2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include <memory> +#include <utility> +#include <iterator> +#include <deque> +#include <functional> +#include <associative_base> + + +#ifndef __STD_HEADER_MAP +#define __STD_HEADER_MAP + +namespace std{ + + +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class map; +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class multimap; + + + //Compare the keys of the two items +/* template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT + __base_map<Key, T, Compare, Allocator>::value_compare : public binary_function< + typename map<Key, T, Compare, Allocator>::value_type, + typename map<Key, T, Compare, Allocator>::value_type, + bool> + { + friend class __base_map<Key, T, Compare, Allocator>; + protected: + Compare comp; + value_compare(Compare c) : comp(c) { } + ~value_compare() { } + public: + bool operator()(const value_type& x, const value_type& y) const { + return comp(x.first, y.first); + } + }; +*/ + +// value_compare value_comp() const; + + + +/* This is the implementation for the map container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + + +//Implementation of map + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT map + : public __single_associative<Key, pair<Key, T>, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it + +public: + + typedef __single_associative<Key, pair<Key, T>, Compare, Allocator> base; + typedef T mapped_type; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + static const key_type v_t_k(const value_type v){ + return v.first; + } + +// using base::value_compare; + + explicit map(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> map(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + map(const map<Key,T,Compare,Allocator>& x) : base(x) { } + ~map() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + reference operator[](const key_type& k){ + //This is from the spec and is quite ugly. + return (*((insert(make_pair(k, T()))).first)).second; + } + +protected: + using base::backing; +}; + + +//Implementation of multimap + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT multimap + : public __multi_associative<Key, pair<Key, T>, Compare, Allocator> + +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __multi_associative<Key, pair<Key, T>, Compare, Allocator> base; + typedef T mapped_type; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + static const key_type v_t_k(const value_type v){ + return v.first; + } + + explicit multimap(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> multimap(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + + multimap(const multimap<Key,T,Compare,Allocator>& x) : base(x) { } + ~multimap() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + +protected: + + using base::c; + +}; + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y); + + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y); + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/memory.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/memory.svn-base new file mode 100644 index 0000000..aea62ad --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/memory.svn-base @@ -0,0 +1,192 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstddef> +#include <cstdlib> +#include <iterator_base> +#include <utility> +#include <cstdio> + +#ifndef HEADER_STD_MEMORY +#define HEADER_STD_MEMORY 1 + +namespace std{ + +template <class T> class allocator; + // Specialize for void: + +template <> class _UCXXEXPORT allocator<void> { +public: + typedef void* pointer; + typedef const void* const_pointer; + typedef void value_type; + template <class U> struct rebind { typedef allocator<U> other; }; +}; + +template <class T> class _UCXXEXPORT allocator{ +public: + typedef T value_type; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + + typedef T* pointer; + typedef const T* const_pointer; + + typedef T& reference; + typedef const T& const_reference; + + pointer address(reference r) const { return &r; } + const_pointer address(const_reference r) const { return &r; } + + allocator() throw(){} + template <class U> allocator(const allocator<U>& ) throw(); + ~allocator() throw(){} + + //Space for n Ts + pointer allocate(size_type n, typename allocator<void>::const_pointer = 0){ + return (T*)(::operator new( n * sizeof(T) )); + } + void deallocate(pointer p, size_type){ + ::operator delete(p); + } + + //Use placement new to engage the constructor + void construct(pointer p, const T& val) { new((void*)p) T(val); } + void destroy(pointer p){ ((T*)p)->~T(); } //Call destructor + + size_type max_size() const throw(); + template<class U> struct rebind { typedef allocator<U> other; }; + +}; + +template <class Out, class T> class _UCXXEXPORT raw_storage_iterator + : public iterator<output_iterator_tag, void, void, void, void> +{ + Out p; + +public: + explicit raw_storage_iterator(Out pp) : p (pp) { } + raw_storage_iterator & operator*() { return *this; } + raw_storage_iterator & operator=(const T& val) { + T* pp = &*p; + new(pp) T(val); + return *this; + } + + raw_storage_iterator & operator++() { ++p; return *this; } + raw_storage_iterator operator++(int) { + raw_storage_iterator t = *this; + ++p; + return t; + } +}; + +template <class T> _UCXXEXPORT pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t n){ + pair<T*, ptrdiff_t> retval; + retval.first = static_cast<T*>(malloc(n * sizeof(T))); + if(retval.first == 0){ + retval.second = 0; + }else{ + retval.second = n; + } + return retval; +} + +template <class T> _UCXXEXPORT void return_temporary_buffer(T* p){ + free(p); +} + + +template <class T> class _UCXXEXPORT auto_ptr{ + +private: + T * object; + template <class Y> struct auto_ptr_ref{ + Y * p; + }; + +public: + + typedef T element_type; + + explicit auto_ptr(T* p =0) throw() : object(p){ } + auto_ptr(auto_ptr& p) throw() : object(p.release()){ } + auto_ptr(auto_ptr_ref<T> r) throw() : object(r.p){ + r.p = 0; + } + template<class Y> auto_ptr(auto_ptr<Y>& p) throw() : object(p.release()){ } + auto_ptr& operator=(auto_ptr& p) throw(){ + if(&p == this){ + return *this; + } + delete object; + object = p.release(); + return *this; + } + template<class Y> auto_ptr& operator=(auto_ptr<Y>& p) throw(){ + if(&p == this){ + return *this; + } + delete object; + object = p.release(); + return *this; + } + ~auto_ptr(){ + delete object; + } + + T& operator*() const throw(){ + return *object; + } + T* operator->() const throw(){ + return object; + } + T* get() const throw(){ + return object; + } + T* release() throw(){ + T * temp(object); + object = 0; + return temp; + } + void reset(T * p=0) throw(){ + if(p != object){ + delete object; + object = p; + } + } + template<class Y> operator auto_ptr_ref<Y>() throw(){ + auto_ptr_ref<Y> retval; + retval.p = object; + object = 0; + return retval; + } + template<class Y> operator auto_ptr<Y>() throw(){ + auto_ptr<Y> retval(object); + object = 0; + return retval; + } + +}; + +} //namespace std + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/new.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/new.svn-base new file mode 100644 index 0000000..f657ac5 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/new.svn-base @@ -0,0 +1,60 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> +#include <cstddef> + +#ifndef __STD_NEW_OPERATOR +#define __STD_NEW_OPERATOR 1 + +namespace std{ + class _UCXXEXPORT bad_alloc : public exception {}; + + struct _UCXXEXPORT nothrow_t {}; + extern const nothrow_t nothrow; + + typedef void (*new_handler)(); + _UCXXEXPORT new_handler set_new_handler(new_handler new_p) throw(); +} + + +_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc); +_UCXXEXPORT void operator delete(void* ptr) throw(); + +_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc); +_UCXXEXPORT void operator delete[](void * ptr) throw(); + +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(); +_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw(); + +_UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(); +_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(); +#endif + + /* Placement operators */ +inline void* operator new(std::size_t, void* ptr) throw() {return ptr; } +inline void operator delete(void* , void *) throw() { } + +inline void* operator new[](std::size_t, void *p) throw() { return p; } +inline void operator delete[](void* , void *) throw() {} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/numeric.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/numeric.svn-base new file mode 100644 index 0000000..2a95491 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/numeric.svn-base @@ -0,0 +1,157 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> + +#ifndef __STD_NUMERIC_HEADER +#define __STD_NUMERIC_HEADER 1 + +namespace std{ + template <class InputIterator, class T> _UCXXEXPORT + T accumulate(InputIterator first, InputIterator last, T init) + { + while(first != last){ + init = init + *first; + ++first; + } + return init; + } + + template <class InputIterator, class T, class BinaryOperation> _UCXXEXPORT + T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op) + { + while(first != last){ + init = binary_op(init, *first); + ++first; + } + return init; + } + + + template <class InputIterator1, class InputIterator2, class T> _UCXXEXPORT + T inner_product(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init) + { + while(first1 != last1){ + init = init + *first1 * *first2; + ++first1; + ++first2; + } + return init; + } + + template <class InputIterator1, class InputIterator2, class T, + class BinaryOperation1, class BinaryOperation2> _UCXXEXPORT + T inner_product(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init, + BinaryOperation1 binary_op1, + BinaryOperation2 binary_op2) + { + while(first1 != last1){ + init = binary_op1(init, binary_op2(*first1, *first2)); + ++first1; + ++first2; + } + return init; + } + + template <class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator partial_sum(InputIterator first, InputIterator last, + OutputIterator result) + { + OutputIterator temp(result); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = *first + *temp; + temp = result; + ++first; + ++result; + } + return result; + } + + + template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT + OutputIterator partial_sum(InputIterator first, InputIterator last, + OutputIterator result, BinaryOperation binary_op) + { + OutputIterator temp(result); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = binary_op(*first, *temp); + temp = result; + ++first; + ++result; + } + return result; + } + + + template <class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + adjacent_difference(InputIterator first, InputIterator last, + OutputIterator result) + { + OutputIterator temp(first); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = *first - *temp; + temp = first; + ++first; + ++result; + } + + return result; + } + + + template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT + OutputIterator + adjacent_difference(InputIterator first, InputIterator last, + OutputIterator result, BinaryOperation binary_op) + { + OutputIterator temp(first); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = binary_op(*first, *temp); + temp = first; + ++first; + ++result; + } + + return result; + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/ostream.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/ostream.svn-base new file mode 100644 index 0000000..07d3eaf --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/ostream.svn-base @@ -0,0 +1,479 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef STD_HEADER_OSTREAM +#define STD_HEADER_OSTREAM 1 + +#include <iosfwd> +#include <streambuf> +#include <cstdio> +#include <ostream_helpers> + +namespace std { + template <class charT, class traits > class basic_ostream; + typedef basic_ostream<char> ostream; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_ostream<wchar_t> wostream; +#endif + + template <class charT, class traits> basic_ostream<charT,traits>& endl(basic_ostream<charT,traits>& os); + template <class charT, class traits> basic_ostream<charT,traits>& ends(basic_ostream<charT,traits>& os); + template <class charT, class traits> basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os); + + template <class charT, class traits > class _UCXXEXPORT basic_ostream + : virtual public basic_ios<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef traits traits_type; + + + _UCXXEXPORT basic_ostream(basic_streambuf<charT,traits>* sb) + : basic_ios<charT, traits>(sb) + { + basic_ios<charT,traits>::init(sb); + } + virtual _UCXXEXPORT ~basic_ostream(); + + class sentry; + + _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& (*pf)(basic_ostream<charT,traits>&)){ + return pf(*this); + } + _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)){ + pf(*this); + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& operator<<(ios_base& (*pf)(ios_base&)){ + pf(*this); + return *this; + } + basic_ostream<charT,traits>& operator<<(bool n); + basic_ostream<charT,traits>& operator<<(short n); + basic_ostream<charT,traits>& operator<<(unsigned short n); + basic_ostream<charT,traits>& operator<<(int n); + basic_ostream<charT,traits>& operator<<(unsigned int n); + basic_ostream<charT,traits>& operator<<(long n); + basic_ostream<charT,traits>& operator<<(unsigned long n); + basic_ostream<charT,traits>& operator<<(float f); + basic_ostream<charT,traits>& operator<<(double f); + basic_ostream<charT,traits>& operator<<(long double f); + basic_ostream<charT,traits>& operator<<(void* p); + basic_ostream<charT,traits>& operator<<(basic_streambuf<char_type,traits>* sb); + + _UCXXEXPORT basic_ostream<charT,traits>& put(char_type c){ + if(basic_ostream<charT,traits>::traits_type::eq_int_type( + basic_ios<charT, traits>::mstreambuf->sputc(c), + basic_ostream<charT,traits>::traits_type::eof())) + { + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& write(const char_type* s, streamsize n){ + if(basic_ostream<charT,traits>::traits_type::eq_int_type( + basic_ios<charT, traits>::mstreambuf->sputn(s, n), + basic_ostream<charT,traits>::traits_type::eof()) + ){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& flush(){ + if(basic_ios<charT, traits>::mstreambuf->pubsync() == -1){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + } + return *this; + } + _UCXXEXPORT pos_type tellp(){ + if(basic_ios<charT,traits>::fail() != false){ + return pos_type(-1); + } + return basic_ios<charT,traits>::rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); + } + _UCXXEXPORT basic_ostream<charT,traits>& seekp(pos_type pos){ + if( basic_ios<charT,traits>::fail() != true ){ + basic_ios<charT,traits>::rdbuf()->pubseekpos(pos); + } + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& seekp(off_type off, ios_base::seekdir dir){ + if( basic_ios<charT,traits>::fail() != true){ + basic_ios<charT,traits>::rdbuf()->pubseekoff(off, dir); + } + return *this; + } + + protected: + basic_ostream(const basic_ostream<charT,traits> &){ } + basic_ostream<charT,traits> & operator=(const basic_ostream<charT,traits> &){ return *this; } + }; + + //Implementations of template functions. To allow for partial specialization + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>::~basic_ostream(){ } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(bool n){ + sentry s(*this); + if( basic_ios<charT,traits>::flags() & ios_base::boolalpha){ + if(n){ + write("true", 4); + }else{ + write("false", 5); + } + }else{ + if(n){ + write("1", 1); + }else{ + write("0", 1); + } + } + if(basic_ios<charT,traits>::flags() & ios_base::unitbuf){ + flush(); + } + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + basic_ostream<charT, traits>::operator<<(unsigned short n){ + sentry s(*this); + __ostream_printout<traits, charT, unsigned long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(short n){ + sentry s(*this); + __ostream_printout<traits, charT, long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(int n){ + sentry s(*this); + __ostream_printout<traits, charT, long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(unsigned int n){ + sentry s(*this); + __ostream_printout<traits, charT, unsigned long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long n){ + sentry s(*this); + __ostream_printout<traits, charT, long >::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + basic_ostream<charT, traits>::operator<<(unsigned long n) + { + sentry s(*this); + __ostream_printout<traits, charT, unsigned long >::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(float f){ + sentry s(*this); + __ostream_printout<traits, charT, double >::printout(*this, f); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(double f){ + sentry s(*this); + __ostream_printout<traits, charT, double >::printout(*this, f); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long double f){ + sentry s(*this); + __ostream_printout<traits, charT, long double >::printout(*this, f); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(void* p){ + sentry s(*this); + char buffer[20]; + write(buffer, snprintf(buffer, 20, "%p", p) ); + if(basic_ios<charT,traits>::flags() & ios_base::unitbuf){ + flush(); + } + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + basic_ostream<charT, traits>::operator<<(basic_streambuf<charT,traits>* sb) + { + sentry s(*this); + if(sb == 0){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return *this; + } + + typename traits::int_type c; + + while(basic_ios<charT,traits>::good() && (c = sb->sbumpc()) != traits::eof() ){ + put(c); + } + + if(basic_ios<charT,traits>::flags() & ios_base::unitbuf){ + flush(); + } + return *this; + } + + /*Template Specializations*/ + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_OSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT ostream::~basic_ostream(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT ostream & ostream::flush(); + + template <> _UCXXEXPORT ostream & ostream::operator<<(bool n); + template <> _UCXXEXPORT ostream & ostream::operator<<(short int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(unsigned short int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(unsigned int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(long n); + template <> _UCXXEXPORT ostream & ostream::operator<<(unsigned long n); + template <> _UCXXEXPORT ostream & ostream::operator<<(float f); + template <> _UCXXEXPORT ostream & ostream::operator<<(double f); + template <> _UCXXEXPORT ostream & ostream::operator<<(long double f); + template <> _UCXXEXPORT ostream & ostream::operator<<(void* p); + template <> _UCXXEXPORT ostream & ostream::operator<<(basic_streambuf<char, char_traits<char> >* sb); +#endif +#endif + + template <class charT,class traits/* = char_traits<charT>*/ > + class _UCXXEXPORT basic_ostream<charT,traits>::sentry + { + bool ok; + public: + explicit _UCXXEXPORT sentry(basic_ostream<charT,traits>& os): ok(true){ + if(os.good() !=0){ //Prepare for output + } + + //Flush any tied buffer + if(os.tie() !=0 ){ + os.tie()->flush(); + } + } + _UCXXEXPORT ~sentry() { } + _UCXXEXPORT operator bool() { + return ok; + } + }; + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_OSTREAM__ +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT ostream::sentry::sentry(ostream & os); + template <> _UCXXEXPORT ostream::sentry::~sentry(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ +#endif +#endif + + + //Non - class functions + + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, charT c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, char c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, char c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.put(c); + return out; + } + + // signed and unsigned + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, signed char c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, unsigned char c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, const charT* c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.write(c, traits::length(c) ); + return out; + } + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, const char* c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.write(c, char_traits<char>::length(c) ); + return out; + } + + // partial specializations + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, const char* c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.write(c, traits::length(c)); + return out; + } + +#ifdef __UCLIBCXX_HAS_WCHAR__ + template<class traits> _UCXXEXPORT basic_ostream<wchar_t,traits>& + operator<<(basic_ostream<wchar_t,traits>& out, const char* c) + { + typename basic_ostream<wchar_t, traits>::sentry s(out); + size_t numChars = char_traits<char>::length(c); + wchar_t * temp = new wchar_t[numChars]; + + for(size_t i=0; i < numChars; ++i){ + temp[i] = out.widen(c[i]); + } + + out.write(temp, numChars); + return out; + } +#endif + + // signed and unsigned + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, const signed char* c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.write(reinterpret_cast<const char *>(c), traits::length( reinterpret_cast<const char *>(c))); + return out; + } + + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, const unsigned char* c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.write(reinterpret_cast<const char *>(c), traits::length( reinterpret_cast<const char *>(c))); + return out; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + endl(basic_ostream<charT,traits>& os) + { + typename basic_ostream<charT,traits>::sentry s(os); + os.put('\n'); + os.flush(); + return os; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + ends(basic_ostream<charT,traits>& os) + { + typename basic_ostream<charT,traits>::sentry s(os); + os.put(traits::eos()); + return os; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os){ + typename basic_ostream<charT,traits>::sentry s(os); + os.flush(); + return os; + } + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_OSTREAM__ + template <> _UCXXEXPORT ostream & endl(ostream & os); + template <> _UCXXEXPORT ostream & flush(ostream & os); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, char c); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, const char* c); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, unsigned char c); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, unsigned const char* c); + +#endif +#endif + + +#ifndef __STRICT_ANSI__ + +//Support for output of long long data types + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, signed long long int i) +{ + typename basic_ostream<Ch, Tr>::sentry s(os); + __ostream_printout<Tr, Ch, signed long long int>::printout(os, i); + return os; +} + + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, unsigned long long int i) +{ + typename basic_ostream<Ch, Tr>::sentry s(os); + __ostream_printout<Tr, Ch, unsigned long long int>::printout(os, i); + return os; +} + + +#endif //__STRICT_ANSI__ + + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/ostream_helpers.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/ostream_helpers.svn-base new file mode 100644 index 0000000..7cdf0fa --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/ostream_helpers.svn-base @@ -0,0 +1,487 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <ios> +#include <cctype> +#include <cstdio> +#include <string> + +#ifndef __STD_HEADER_OSTREAM_HELPERS +#define __STD_HEADER_OSTREAM_HELPERS 1 + +namespace std{ + + /* We are making the following template class for serveral reasons. Firstly, + * we want to keep the main ostream code neat and tidy. Secondly, we want it + * to be easy to do partial specialization of the ostream code so that it can + * be expanded and put into the library. This will allow us to make application + * code smaller at the expense of increased library size. This is a fair + * trade-off when there are multiple applications being compiled. Also, this + * feature will be used optionally via configuration options. It will also + * allow us to keep the code bases in sync, dramatically simplifying the + * maintenance required. We specialized for char because wchar and others + * require different scanf functions + */ + + + + template <class traits, class charT, class dataType> class _UCXXEXPORT __ostream_printout{ + public: + static void printout(basic_ostream<charT,traits>& stream, const dataType n); + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const signed long int n) + { + char buffer[20]; + const char * c_ld = "%ld"; + const char * c_lo = "%lo"; + const char * c_lX = "%lX"; + const char * c_lx = "%lx"; + const char * c_hashlo = "%#lo"; + const char * c_hashlX = "%#lX"; + const char * c_hashlx = "%#lx"; + + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = c_ld; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = c_hashlo; + }else{ + formatString = c_lo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = c_hashlX; + }else{ + formatString = c_hashlx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = c_lX; + }else{ + formatString = c_lx; + } + } + } + + stream.write(buffer, snprintf(buffer, 20, formatString, n) ); + + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, unsigned long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const unsigned long int n) + { + char buffer[20]; + const char * c_lo = "%lo"; + const char * c_lu = "%lu"; + const char * c_lX = "%lX"; + const char * c_lx = "%lx"; + const char * c_hashlo = "%#lo"; + const char * c_hashlX = "%#lX"; + const char * c_hashlx = "%#lx"; + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = c_lu; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = c_hashlo; + }else{ + formatString = c_lo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = c_hashlX; + }else{ + formatString = c_hashlx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = c_lX; + }else{ + formatString = c_lx; + } + } + } + + stream.write(buffer, snprintf(buffer, 20, formatString, n)); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + +#ifndef __STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const signed long long int n) + { + char buffer[28]; + const char * lld = "%lld"; + const char * llo = "%llo"; + const char * llX = "%llX"; + const char * llx = "%llx"; + const char * hashllo = "%#llo"; + const char * hashllX = "%#llX"; + const char * hashllx = "%#llx"; + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = lld; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = hashllo; + }else{ + formatString = llo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = hashllX; + }else{ + formatString = hashllx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = llX; + }else{ + formatString = llx; + } + } + } + + stream.write(buffer, snprintf(buffer, 27, formatString, n) ); + + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, unsigned long long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const unsigned long long int n) + { + char buffer[28]; + const char * llo = "%llo"; + const char * llu = "%llu"; + const char * llX = "%llX"; + const char * llx = "%llx"; + const char * hashllo = "%#llo"; + const char * hashllX = "%#llX"; + const char * hashllx = "%#llx"; + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = llu; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = hashllo; + }else{ + formatString = llo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = hashllX; + }else{ + formatString = hashllx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = llX; + }else{ + formatString = llx; + } + } + } + + stream.write(buffer, snprintf(buffer, 27, formatString, n) ); + + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + +#endif //__STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, double>{ + public: + static void printout(basic_ostream<char, traits >& stream, const double f) + { + char buffer[32]; + int length; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + length = snprintf(buffer, 32, "%*.*E", static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + }else{ + length = snprintf(buffer, 32, "%*.*e", static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + } + } else if(stream.flags() & ios_base::fixed){ + length = snprintf(buffer, 32, "%*.*f",static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + } else { + length = snprintf(buffer, 32, "%*.*g",static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + } + stream.write(buffer, length); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, long double>{ + public: + static void printout(basic_ostream<char, traits >& stream, const long double f) + { + char buffer[32]; + int length; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + length = snprintf(buffer, 32, "%*.*LE", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + }else{ + length = snprintf(buffer, 32, "%*.*Le", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + } + } else if(stream.flags() & ios_base::fixed){ + length = snprintf(buffer, 32, "%*.*Lf", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + } else { + length = snprintf(buffer, 32, "%*.*Lg", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + } + stream.write(buffer, length); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + + } + }; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const signed long int n) + { + wchar_t buffer[20]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 20, L"%ld", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%#lx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, unsigned long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const unsigned long int n) + { + wchar_t buffer[20]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 20, L"%lu", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%#lx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + +#ifndef __STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const signed long long int n) + { + wchar_t buffer[28]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 27, L"%lld", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%#llx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, unsigned long long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const unsigned long long int n) + { + wchar_t buffer[28]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 27, L"%llu", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%#llx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + +#endif //__STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, double>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const double f) + { + wchar_t buffer[32]; + wchar_t format_string[32]; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + swprintf(format_string, 32, L"%%%u.%uE", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + }else{ + swprintf(format_string, 32, L"%%%u.%ue", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + } else if(stream.flags() & ios_base::fixed){ + swprintf(format_string, 32, L"%%%u.%uf", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } else { + swprintf(format_string, 32, L"%%%u.%ug", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + stream.write(buffer, swprintf(buffer, 32, format_string, f) ); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, long double>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const long double f) + { + wchar_t buffer[32]; + wchar_t format_string[32]; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + swprintf(format_string, 32, L"%%%u.%uLE", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + }else{ + swprintf(format_string, 32, L"%%%u.%uLe", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + } else if(stream.flags() & ios_base::fixed){ + swprintf(format_string, 32, L"%%%u.%uLf", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } else { + swprintf(format_string, 32, L"%%%u.%uLg", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + stream.write(buffer, swprintf(buffer, 32, format_string, f) ); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + +#endif //__UCLIBCXX_HAS_WCHAR__ + +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/queue.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/queue.svn-base new file mode 100644 index 0000000..53b3931 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/queue.svn-base @@ -0,0 +1,122 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <deque> +#include <vector> +#include <functional> + +#ifndef __HEADER_STD_QUEUE +#define __HEADER_STD_QUEUE 1 + +namespace std{ + + template <class T, class Container = deque<T> > class _UCXXEXPORT queue{ + protected: + Container c; + public: + typedef typename Container::value_type value_type; + typedef typename Container::size_type size_type; + typedef Container container_type; + + explicit queue(const Container& a = Container()) : c(a) { } + + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + value_type& front() { return c.front(); } + const value_type& front() const { return c.front(); } + value_type& back() { return c.back(); } + const value_type& back() const { return c.back(); } + void push(const value_type& x) { c.push_back(x); } + void pop() { c.pop_front(); } + }; + + + template <class T, class Container> _UCXXEXPORT bool + operator==(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c == y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator< (const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c < y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator!=(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c != y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator> (const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c > y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator>=(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c >= y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator<=(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c <= y.c); + } + + + template <class T, + class Container = vector<T>, + class Compare = less<typename Container::value_type> + > class _UCXXEXPORT priority_queue { + protected: + Container c; + Compare comp; + public: + typedef typename Container::value_type value_type; + typedef typename Container::size_type size_type; + typedef Container container_type; + + explicit priority_queue(const Compare& x = Compare(), const Container& a = Container()) + : c(a), comp(x) { make_heap(c.begin(), c.end(), comp) ; } + template <class InputIterator> priority_queue(InputIterator first, + InputIterator last, + const Compare& x = Compare(), + const Container& y= Container()) + : c(y), comp(c) + { + c.insert(c.end(), first, last); + make_heap(c.begin(), c.end(), comp); + } + + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + const value_type& top() const { return c.front(); } + void push(const value_type& x){ + c.push_back(x); + push_heap(c.begin(), c.end(), comp); + } + void pop(){ + pop_heap(c.begin(), c.end(), comp); + c.pop_back(); + } + }; + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/set.old.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/set.old.svn-base new file mode 100644 index 0000000..b9c4481 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/set.old.svn-base @@ -0,0 +1,1535 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include <deque> +#include<functional> + + +#ifndef __STD_HEADER_SET +#define __STD_HEADER_SET + +#pragma GCC visibility push(default) + +namespace std{ + + +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class __base_set; +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class set; +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class multiset; + +template<class Key, class Compare, class Allocator> class __set_iter; +template<class Key, class Compare, class Allocator> class __set_citer; + +template <class Key, class Compare, class Allocator> bool operator== + (const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y); + +template <class Key, class Compare, class Allocator> bool operator== + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y); + + + +/* The code for the set containers is split up into two classes. + * The first class, __base_set holds all of the data and does much of the iterator-based + * work. Then the classes set and multiset inherit from there. This was done to reduce + * the redundancy of code (And thus errors which might crop up), as well as possibly + * reducing the size of binaries if both set and multiset are used, along with the same + * template parameters. + */ + + + +//All base classes first (__base_set, iterators, value_compare) and it's associated code + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT __base_set{ + +protected: + friend class __set_iter<Key, Compare, Allocator>; + friend class __set_citer<Key, Compare, Allocator>; + friend bool operator==<>(const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y); + friend bool operator==<>(const multiset<Key, Compare, Allocator>& x, const multiset<Key, Compare, Allocator>& y); + +public: + typedef __base_set<Key, Compare, Allocator> set_type; + typedef Key key_type; + typedef Key value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef __set_iter<Key, Compare, Allocator> iterator; + typedef __set_citer<Key, Compare, Allocator> const_iterator; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename std::reverse_iterator<iterator> reverse_iterator; + typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator; + + class value_compare; + + explicit __base_set(const Compare& comp = Compare(), const Allocator& al = Allocator()); + __base_set(const set_type& x); + ~__base_set(); + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + bool empty() const; + size_type size() const; + size_type max_size() const; + + void swap(set_type & x); + void clear(); + + key_compare key_comp() const; + +protected: + + deque<Key, allocator<Key> > data; + Compare c; + +}; + + + //Implementations + + template<class Key, class Compare, class Allocator> class _UCXXEXPORT __set_citer + : public std::iterator< + bidirectional_iterator_tag, + Key, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + protected: + typedef class __base_set<Key, Compare, Allocator> Set; + + friend class __base_set<Key, Compare, Allocator>; + friend class __base_set<Key, Compare, Allocator>::iterator; + + friend class set<Key, Compare, Allocator>; + friend class multiset<Key, Compare, Allocator>; + + typename Set::size_type element; + const Set * container; + public: + __set_citer() : element(0), container(0) { } + __set_citer(const typename Set::const_iterator & m) + : element(m.element), container(m.container) { } + __set_citer(typename Set::size_type e, const Set * const c) + : element(e), container(c) { } + ~__set_citer() { } + + typename Set::value_type operator*(){ + return container->data[element]; + } + const typename Set::value_type * operator->() const{ + return &(container->data[element]); + } + __set_citer & operator=(const typename Set::const_iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Set::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Set::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __set_citer & operator++(){ + ++element; + return *this; + } + __set_citer operator++(int){ + __set_citer temp(*this); + ++element; + return temp; + } + __set_citer & operator--(){ + --element; + return *this; + } + __set_citer operator--(int){ + __set_citer temp(*this); + --element; + return temp; + } + + }; + + template<class Key, class Compare, class Allocator> class _UCXXEXPORT __set_iter + : public std::iterator< + bidirectional_iterator_tag, + Key, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + protected: + typedef __base_set<Key, Compare, Allocator> Set; + + //FIXME - Find a way to use template parameters or something. This will do for now + friend class __base_set<Key, Compare, Allocator>; + friend class __base_set<Key, Compare, Allocator>::const_iterator; + + friend class set<Key, Compare, Allocator>; + friend class multiset<Key, Compare, Allocator>; + + typename Set::size_type element; + Set * container; + public: + __set_iter() : element(0), container(0) { } + __set_iter(const typename Set::iterator & m) + : element(m.element), container(m.container) { } + __set_iter(typename Set::size_type e, Set * c) + : element(e), container(c) { } + ~__set_iter() { } + + typename Set::value_type & operator*(){ + return container->data[element]; + } + const typename Set::value_type & operator*() const{ + return container->data[element]; + } + typename Set::value_type * operator->(){ + return &(container->data[element]); + } + __set_iter & operator=(const typename Set::iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Set::iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Set::iterator & m) const { + return (m.element != element || m.container != container); + } + bool operator==(const typename Set::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Set::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __set_iter & operator++(){ + ++element; + return *this; + } + __set_iter operator++(int){ + __set_iter temp(*this); + ++element; + return temp; + } + __set_iter & operator--(){ + --element; + return *this; + } + __set_iter operator--(int){ + __set_iter temp(*this); + --element; + return temp; + } + + //Conversion operator + operator typename Set::const_iterator () const + { + typename Set::const_iterator retval(element, container); +// return typename Set::const_iterator(element, container); + return retval; + } + }; + + + + //Compare the keys of the two items + template<class Key, class Compare, class Allocator> class _UCXXEXPORT + __base_set<Key, Compare, Allocator>::value_compare : public binary_function< + typename set<Key, Compare, Allocator>::value_type, + typename set<Key, Compare, Allocator>::value_type, + bool> + { + friend class __base_set<Key, Compare, Allocator>; + protected: + Compare comp; + value_compare(Compare c) : comp(c) { } + ~value_compare() { } + public: + bool operator()(const value_type& x, const value_type& y) const { + return comp(x, y); + } + }; + + template <class Key, class Compare, class Allocator> + __base_set<Key, Compare, Allocator>::__base_set(const Compare& comp, const Allocator&) + : data(), c(comp) + { + + } + + template <class Key, class Compare, class Allocator> + __base_set<Key, Compare, Allocator>::__base_set(const __base_set<Key, Compare, Allocator>& x) + : data(x.data), c(x.c) + { + + } + + template <class Key, class Compare, class Allocator> + __base_set<Key, Compare, Allocator>::~__base_set() + { + + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::iterator + __base_set<Key, Compare, Allocator>::begin() + { + return iterator(0, this); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_iterator + __base_set<Key, Compare, Allocator>::begin() const + { + return const_iterator(0, this); + + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::iterator + __base_set<Key, Compare, Allocator>::end() + { + return iterator(data.size(), this); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_iterator + __base_set<Key, Compare, Allocator>::end() const + { + return const_iterator(data.size(), this); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::reverse_iterator + __base_set<Key, Compare, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_reverse_iterator + __base_set<Key, Compare, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::reverse_iterator + __base_set<Key, Compare, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_reverse_iterator + __base_set<Key, Compare, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template <class Key, class Compare, class Allocator> + bool __base_set<Key, Compare, Allocator>::empty() const + { + return (data.size() == 0); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::size_type + __base_set<Key, Compare, Allocator>::size() const + { + return data.size(); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::size_type + __base_set<Key, Compare, Allocator>::max_size() const + { + return data.max_size(); + } + + + template <class Key, class Compare, class Allocator> + void __base_set<Key, Compare, Allocator>::swap(__base_set<Key, Compare, Allocator>& m) + { + Compare n = c; + c = m.c; + m.c = n; + + data.swap(m.data); + } + + + template <class Key, class Compare, class Allocator> + void __base_set<Key, Compare, Allocator>::clear() + { + data.clear(); + } + + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::key_compare + __base_set<Key, Compare, Allocator>::key_comp() const + { + return c; + } + +// value_compare value_comp() const; + + + +/* This is the implementation for the set container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + + + + +//Implementation of set + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT set + : public __base_set<Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_set<Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::value_compare; + + explicit set(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> set(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + set(const set<Key, Compare,Allocator>& x) : base(x) { } + ~set() { } + + set<Key, Compare, Allocator>& operator=(const set<Key, Compare, Allocator>& x); + + pair<iterator, bool> insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + + template <class InputIterator> void insert(InputIterator first, InputIterator last); + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator lower_bound(const key_type& x); + const_iterator lower_bound(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + iterator ifind(const key_type& x); //Core find functionality + const_iterator ifind(const key_type& x) const; //Core find functionality + + using base::data; + using base::c; + +}; + + + template <class Key, class Compare, class Allocator> template <class InputIterator> + set<Key, Compare, Allocator>:: + set(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::ifind(const key_type &x) + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. Will not indicate if the + *insert should be performed before the first element + */ + + if(data.size() == 0){ + return end(); + } + + if(data.size() == 1){ + if( c(data[0], x) ){ + return end(); + } + return begin(); + } + + size_type low; + size_type high; + size_type i; + + low = 0; + high = data.size() - 1; + + //This algorithm assumes no duplicates in stored information + while(( high - low) > 1){ + i = low + ((high - low) /2); + if( c(x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[low], x) ){ // k >=high + i = high; + }else{ + i = low; + } + + return iterator(i, this); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::ifind(const key_type &x) const + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. Will not indicate if the + *insert should be performed before the first element + */ + + if(data.size() == 0){ + return end(); + } + + if(data.size() == 1){ + if( c(data[0], x) ){ + return end(); + } + return begin(); + } + + size_type low; + size_type high; + size_type i; + + low = 0; + high = data.size() - 1; + + //This algorithm assumes no duplicates in stored information + while(( high - low) > 1){ + i = low + ((high - low) /2); + if( c(x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[low], x) ){ // k >=high + i = high; + }else{ + i = low; + } + + return const_iterator(i, this); + } + + + template <class Key, class Compare, class Allocator> + set<Key, Compare, Allocator>::set<Key, Compare, Allocator>& + set<Key, Compare, Allocator>::operator=(const set<Key, Compare, Allocator>& x) + { + if( &x == this){ + return *this; + } + c = x.c; + data = x.data; + return *this; + } + + + template <class Key, class Compare, class Allocator> + pair<typename set<Key, Compare, Allocator>::iterator, bool> + set<Key, Compare, Allocator>::insert(const value_type& x) + { + pair<typename set<Key, Compare, Allocator>::iterator, bool> retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x, data[0]) ){ + data.push_front(x); + retval.first = begin(); + retval.second = true; + return retval; + } + + //Element to insert goes at the end + if( c(data[data.size() - 1], x) ){ + data.push_back(x); + retval.first = end(); + --retval.first; + retval.second = true; + return retval; + } + + retval.first = ifind(x); + + //No match - this should never happen + if(retval.first == end()){ + retval.second = false; + return retval; + } + + //If we have an exact match + if( !c( *(retval.first), x) && !c(x, *(retval.first) ) ){ + retval.second = false; + return retval; + } + + typename deque<Key, allocator<Key > >::iterator q(&data, retval.first.element); + data.insert(q, x); + + retval.first = ifind(x); //Need to refind because insert can move data around + retval.second = true; + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::insert(iterator position, const value_type& x) + { + //Just reusing code. It's hard to make improvements over existing algo. + insert(x); + return find(x); + } + + template <class Key, class Compare, class Allocator> + template <class InputIterator> void + set<Key, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class Compare, class Allocator> void + set<Key, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<Key, allocator<Key> >::iterator pos(&data, position.element); + data.erase(pos); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::size_type + set<Key, Compare, Allocator>::erase(const key_type& x) + { + typename set<Key, Compare, Allocator>::iterator i = find(x); + if(i!=end()){ + erase(i); + return 1; + } + return 0; + } + + template <class Key, class Compare, class Allocator> + void set<Key, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<Key, allocator<Key> >::iterator f(&data, first.element); + typename deque<Key, allocator<Key> >::iterator l(&data, last.element); + data.erase(f, l); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>:: + find(const typename set<Key, Compare, Allocator>::key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = ifind(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( *retval, x) && !c(x, *retval )){ + return retval; + } + return end(); + + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + + const_iterator retval = ifind(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( *retval, x) && !c(x, *retval )){ + return retval; + } + return end(); + + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::size_type + set<Key, Compare, Allocator>::count(const typename set<Key, Compare, Allocator>::key_type& x) const + { + if( find(x) == end()){ + return 0; + } + return 1; + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::lower_bound(const key_type& x) + { + return find(x); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::lower_bound(const key_type& x) const + { + return find(x); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::upper_bound(const key_type& x) + { + typename set<Key, Compare, Allocator>::iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename set<Key, Compare, Allocator>::const_iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + + template <class Key, class Compare, class Allocator> + pair< typename set<Key, Compare, Allocator>::iterator, + typename set<Key, Compare, Allocator>::iterator + > set<Key, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename set<Key, Compare, Allocator>::iterator, + typename set<Key, Compare, Allocator>::iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class Compare, class Allocator> + pair< typename set<Key, Compare, Allocator>::const_iterator, + typename set<Key, Compare, Allocator>::const_iterator + > set<Key, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename set<Key, Compare, Allocator>::const_iterator, + typename set<Key, Compare, Allocator>::const_iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class Compare, class Allocator> bool operator== + (const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y) + { + if(x.data == y.data){ + return true; + } + return false; + } + + + +//Implementation of multiset + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT multiset + : public __base_set<Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_set<Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + explicit multiset(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> multiset(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + multiset(const multiset<Key, Compare, Allocator>& x) : base(x) { } + ~multiset() { } + + multiset<Key, Compare, Allocator>& operator=(const multiset<Key, Compare, Allocator>& x); + + iterator insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + template <class InputIterator> void insert(InputIterator first, InputIterator last); + + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator lower_bound(const key_type& x); + const_iterator lower_bound(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + iterator ifind(const key_type& x); //Core find functionality + const_iterator ifind(const key_type& x) const; //Core find functionality + + using base::data; + using base::c; + +}; + + + + template <class Key, class Compare, class Allocator> template <class InputIterator> + multiset<Key, Compare, Allocator>:: + multiset(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::ifind(const key_type &x) + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. end() for error. + */ + + if(data.size() == 0){ + return end(); + } + + //Before the first element + if( c(x, data[0]) ){ + return begin(); + } + + + //Element is larger than all known elemenst + if( c( data[data.size()-1], x) ){ + return end(); + } + + //Or if it is the last element + if( !c(x, data[size()-1]) ){ + return iterator(data.size()-1, this); + } + + size_type low; + size_type high; + size_type i=0; + + low = 0; + high = data.size() - 1; + + //This algorithm will accept duplicates in keys + + while( c(data[i+1], x) || c(x, data[i]) || !c(x, data[i+1]) ){ + i = low + ((high - low) /2); + if( c( x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[i], x) ){ // k >=high + ++i; + } + + return iterator(i, this); + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::ifind(const key_type &x) const + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. end() for error. + */ + + if(data.size() == 0){ + return end(); + } + + //Before the first element + if( c(x, data[0]) ){ + return begin(); + } + + + //Element is larger than all known elemenst + if( c( data[data.size()-1], x) ){ + return end(); + } + + //Or if it is the last element + if( !c(x, data[size()-1]) ){ + return const_iterator(data.size()-1, this); + } + + size_type low; + size_type high; + size_type i=0; + + low = 0; + high = data.size() - 1; + + //This algorithm will accept duplicates in keys + + while( c(data[i+1], x) || c(x, data[i]) || !c(x, data[i+1]) ){ + i = low + ((high - low) /2); + if( c( x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[i], x) ){ // k >=high + ++i; + } + + return const_iterator(i, this); + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::insert(const value_type &x) + { + iterator retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x, data[0]) ){ + data.push_front(x); + return begin(); + } + + //Element to insert goes at the end + if( c(data[data.size() - 1], x) ){ + data.push_back(x); + return end(); + } + + retval = ifind(x); + + //No match - this should never happen + if(retval == end()){ + return retval; + } + + if( !c(x, *retval) ){ + ++retval; + } + + typename deque<Key, allocator<Key> >::iterator q(&data, retval.element); + data.insert(q, x); + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::insert(iterator position, const value_type& x) + { + + //Inserting at begining + if(position == begin() && !c(*position, x) ){ + data.push_front(x); + return position; + } + //Inserting at end + if(position == end() && !c(x, data[data.size() - 1]) ){ + data.push_back(x); + return position; + } + + //Inserting in middle + iterator temp = position; + --temp; + if( !c( *position, x) && !c(x, *temp) ){ + typename deque<Key, allocator<Key> >::iterator q(&data, position.element); + data.insert(q, x); + return position; + } + + return insert(x); + } + + template <class Key, class Compare, class Allocator> + template <class InputIterator> void + multiset<Key, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + + template <class Key, class Compare, class Allocator> void + multiset<Key, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<Key, allocator<Key> >::iterator pos(&data, position.element); + data.erase(pos); + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::size_type + multiset<Key, Compare, Allocator>::erase(const key_type& x) + { + typename multiset<Key, Compare, Allocator>::iterator f = lower_bound(x); + typename multiset<Key, Compare, Allocator>::iterator l = upper_bound(x); + size_type t = l.element - f.element; + erase(f, l); + return t; + } + + + template <class Key, class Compare, class Allocator> + void multiset<Key, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<Key, allocator<Key> >::iterator f(&data, first.element); + typename deque<Key, allocator<Key> >::iterator l(&data, last.element); + data.erase(f, l); + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::find(const key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = ifind(x); + + if( c(x, *retval) || c(*retval, x) ){ + return end(); + } + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + const_iterator retval = ifind(x); + + if( c(x, *retval) || c(*retval, x) ){ + return end(); + } + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::size_type + multiset<Key, Compare, Allocator>:: + count(const typename multiset<Key, Compare, Allocator>::key_type& x) const + { + pair< typename multiset<Key, Compare, Allocator>::const_iterator, + typename multiset<Key, Compare, Allocator>::const_iterator + > temp = equal_range(x); + + return temp.second.element - temp.first.element; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::lower_bound(const key_type& x) + { + //FIXME - linear search - can we do any better? + typename multiset<Key, Compare, Allocator>::iterator i = find(x); + if(i == end()){ + return i; + } + while( i.element > 0 && !c( *i, x) && !c(x, *i) ){ + --i; + } + if( c(*i, x)){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::lower_bound(const key_type& x) const + { + //FIXME - linear search - can we do any better? + typename multiset<Key, Compare, Allocator>::const_iterator i = find(x); + if(i == end()){ + return i; + } + while( i.element >0 && !c( *i, x) && !c(x, *i) ){ + --i; + } + if( c( *i, x)){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::upper_bound(const key_type& x) + { + typename multiset<Key, Compare, Allocator>::iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename multiset<Key, Compare, Allocator>::const_iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + + template <class Key, class Compare, class Allocator> + pair< typename multiset<Key, Compare, Allocator>::iterator, + typename multiset<Key, Compare, Allocator>::iterator + > multiset<Key, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename multiset<Key, Compare, Allocator>::iterator, + typename multiset<Key, Compare, Allocator>::iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class Compare, class Allocator> + pair< typename multiset<Key, Compare, Allocator>::const_iterator, + typename multiset<Key, Compare, Allocator>::const_iterator + > multiset<Key, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename multiset<Key, Compare, Allocator>::const_iterator, + typename multiset<Key, Compare, Allocator>::const_iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 != *first2 ){ + return true; + } + ++first1; + ++first2; + } + return first1!=last1 || first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (set<Key,Compare,Allocator>& x, set<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + if(x.data == y.data){ + return true; + } + return false; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 != *first2 ){ + return true; + } + ++first1; + ++first2; + } + return first1!=last1 || first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + +} + +#pragma GCC visibility pop + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/set.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/set.svn-base new file mode 100644 index 0000000..93d62b5 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/set.svn-base @@ -0,0 +1,403 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include <deque> +#include<functional> +#include <associative_base> + +#ifndef __STD_HEADER_SET +#define __STD_HEADER_SET + +namespace std{ + + +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class set; +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class multiset; + + +/* This is the implementation for the set container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + +//Implementation of set + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT set + : public __single_associative<Key, Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __single_associative<Key, Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + +// using base::value_compare; + + static const key_type v_t_k(const value_type v){ + return v; + } + + explicit set(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> set(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + set(const set<Key, Compare,Allocator>& x) : base(x) { } + ~set() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + +protected: + +}; + + +//Implementation of multiset + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT multiset + : public __multi_associative<Key, Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __multi_associative<Key, Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + static const key_type v_t_k(const value_type v){ + return v; + } + + explicit multiset(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> multiset(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + + multiset(const multiset<Key, Compare, Allocator>& x) : base(x) { } + ~multiset() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + +protected: + +}; + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (set<Key,Compare,Allocator>& x, set<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + if(x.data == y.data){ + return true; + } + return false; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 != *first2 ){ + return true; + } + ++first1; + ++first2; + } + return first1!=last1 || first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/sstream.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/sstream.svn-base new file mode 100644 index 0000000..5a3ca6e --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/sstream.svn-base @@ -0,0 +1,380 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef HEADER_STD_SSTREAM +#define HEADER_STD_SSTREAM 1 + +#include <iosfwd> +#include <ios> +#include <istream> +#include <ostream> +#include <iostream> +#include <string> + +namespace std{ + + template <class charT, class traits, class Allocator> + class _UCXXEXPORT basic_stringbuf : public basic_streambuf<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef typename Allocator::size_type size_type; + + explicit _UCXXEXPORT basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out) + : data(), ielement(0), oelement(0) + { + basic_streambuf<charT,traits>::openedFor = which; + } + + explicit _UCXXEXPORT basic_stringbuf(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::in | ios_base::out) + : data(str), ielement(0), oelement(0) + { + if(which & ios_base::ate){ + oelement = data.length(); + } + basic_streambuf<charT,traits>::openedFor = which; + } + + virtual _UCXXEXPORT ~basic_stringbuf() { } + + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return data; + } + + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + data = s; + ielement = 0; + if(basic_streambuf<charT,traits>::openedFor & ios_base::ate){ + oelement = data.length(); + }else{ + oelement = 0; + } + } + + protected: + virtual _UCXXEXPORT int sync(){ + return 0; + } + virtual _UCXXEXPORT int_type underflow(){ + if(ielement >= data.length()){ + return traits::eof(); + } + return traits::to_int_type(data[ielement]); + } + + virtual _UCXXEXPORT int_type uflow(){ + int_type retval = underflow(); + if(retval != traits::eof()){ + ++ielement; + } + return retval; + } + + virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()){ + //Error possibilities + if(ielement == 0){ + return traits::eof(); + } + if(ielement > data.length()){ + ielement = data.length(); + return traits::eof(); + } + //eof passed in + if(traits::eq_int_type(c,traits::eof())==true){ + --ielement; + return traits::not_eof(c); + } + if(traits::eq(traits::to_char_type(c),data[ielement-1]) == true){ + --ielement; + return c; + } + if(basic_streambuf<charT,traits>::openedFor & ios_base::out){ + --ielement; + data[ielement] = c; + return c; + } + return traits::eof(); + } + + virtual _UCXXEXPORT int showmanyc(){ + return data.length() - ielement; + } + virtual _UCXXEXPORT streamsize xsgetn(char_type* c, streamsize n){ + streamsize i = 0; + while(ielement < data.length() && i < n ){ + c[i] = data[ielement]; + ++i; + ++ielement; + } + return i; + } + + virtual _UCXXEXPORT int_type overflow (int_type c = traits::eof()){ + //Nothing to do + if(traits::eq_int_type(c,traits::eof())){ + return traits::not_eof(c); + } + + //Actually add character, if possible + if(basic_streambuf<charT,traits>::openedFor & ios_base::out){ + if(oelement >= data.length()){ + data.push_back(c); + }else{ + data[oelement] = c; + } + ++oelement; + return c; + } + //Not possible + return traits::eof(); + } + + virtual _UCXXEXPORT basic_streambuf<charT,traits>* setbuf(charT*, streamsize){ + //This function does nothing + return this; + } + + virtual _UCXXEXPORT streamsize xsputn(const char_type* s, streamsize n){ + data.replace(oelement, n, s, n); + oelement += n; + return n; + } + + virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way, + ios_base::openmode which = ios_base::in | ios_base::out) + { + //Test for invalid option + if( (which & ios_base::in) && (which & ios_base::out) && (way == ios_base::cur)){ + return -1; + } + + //Calculate new location + size_type newpos = 0; + + if(way == ios_base::beg){ + newpos = off; + }else if(way == ios_base::cur){ + if(which & ios_base::out){ + newpos = data.length() + off; + } + if(which & ios_base::in){ + newpos = ielement + off; + } + + }else{ + newpos = data.length() + off; + } + + //Test for error conditions + if(newpos > data.length()){ + return -1; + } + + //Shuffle pointers + + if(which & ios_base::in){ + ielement = newpos; + } + if(which & ios_base::out){ + data.resize(newpos); + if(ielement > data.length()){ + ielement = data.length(); + } + } + + return newpos; + } + + virtual _UCXXEXPORT pos_type seekpos(pos_type sp, + ios_base::openmode which = ios_base::in | ios_base::out) + { + return seekoff(sp, ios_base::beg, which); + } + + basic_string<charT,traits,Allocator> data; + size_type ielement; + size_type oelement; + }; + + + template <class charT, class traits, class Allocator> class _UCXXEXPORT basic_istringstream + : public basic_istream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + + explicit _UCXXEXPORT basic_istringstream(ios_base::openmode m = ios_base::in) + : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb), sb(m) + { + } + explicit _UCXXEXPORT basic_istringstream( const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::in) + : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb), sb(str, which) + { + } + virtual _UCXXEXPORT ~basic_istringstream() { } + _UCXXEXPORT basic_stringbuf<charT,traits,Allocator>* rdbuf() const{ + return &sb; + } + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return sb.str(); + } + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + sb.str(s); + basic_istream<charT,traits>::clear(); + } + private: + basic_stringbuf<charT,traits,Allocator> sb; + }; + + + template <class charT, class traits, class Allocator> class _UCXXEXPORT basic_ostringstream + : public basic_ostream<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + explicit _UCXXEXPORT basic_ostringstream(ios_base::openmode m = ios_base::out) + : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb), sb(m) + { + } + explicit _UCXXEXPORT basic_ostringstream(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::out) + : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb), sb(str, which) + { + } + virtual _UCXXEXPORT ~basic_ostringstream() { } + + _UCXXEXPORT basic_stringbuf<charT,traits,Allocator>* rdbuf() const{ + return &sb; + } + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return sb.str(); + } + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + sb.str(s); + basic_ostream<charT,traits>::clear(); + } + private: + basic_stringbuf<charT,traits,Allocator> sb; + }; + + + template <class charT, class traits, class Allocator> class _UCXXEXPORT basic_stringstream + : public basic_iostream<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + explicit _UCXXEXPORT basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in) + : basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb), sb(which) + { + } + + explicit _UCXXEXPORT basic_stringstream(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::out|ios_base::in) + : basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb), sb(str, which) + { + } + virtual _UCXXEXPORT ~basic_stringstream(){ } + + _UCXXEXPORT basic_stringbuf<charT,traits,Allocator>* rdbuf(){ + return &sb; + } + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return sb.str(); + } + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + sb.str(s); + basic_iostream<charT,traits>::clear(); + } + private: + basic_stringbuf<charT, traits> sb; + }; + +#ifdef __UCLIBCXX_EXPAND_SSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_SSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >:: + basic_stringbuf(ios_base::openmode which); + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::~basic_stringbuf(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_string<char, char_traits<char>, allocator<char> > + basic_stringbuf<char, char_traits<char>, allocator<char> >::str() const; + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type + basic_stringbuf<char, char_traits<char>, allocator<char> >:: + pbackfail(basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type c); + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::pos_type + basic_stringbuf<char, char_traits<char>, allocator<char> >:: + seekoff (basic_stringbuf<char, char_traits<char>, allocator<char> >::off_type off, + ios_base::seekdir way, + ios_base::openmode which + ); + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type + basic_stringbuf<char, char_traits<char>, allocator<char> >:: + overflow (basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type c); + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type + basic_stringbuf<char, char_traits<char>, allocator<char> >::underflow (); + + template <> _UCXXEXPORT streamsize basic_stringbuf<char, char_traits<char>, allocator<char> >:: + xsputn(const char* s, streamsize n); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_stringstream<char, char_traits<char>, allocator<char> >:: + basic_stringstream(ios_base::openmode which); + template <> _UCXXEXPORT basic_stringstream<char, char_traits<char>, allocator<char> >::~basic_stringstream(); + template <> _UCXXEXPORT basic_istringstream<char, char_traits<char>, allocator<char> >::~basic_istringstream(); + template <> _UCXXEXPORT basic_ostringstream<char, char_traits<char>, allocator<char> >::~basic_ostringstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif +#endif + +} + + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/stack.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/stack.svn-base new file mode 100644 index 0000000..07bd19a --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/stack.svn-base @@ -0,0 +1,80 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <deque> + +#ifndef __HEADER_STD_STACK +#define __HEADER_STD_STACK 1 + +namespace std{ + + template <class T, class Container = deque<T> > class _UCXXEXPORT stack{ + protected: + Container c; + + public: + typedef typename Container::value_type value_type; + typedef typename Container::size_type size_type; + typedef Container container_type; + + explicit stack(const Container& a = Container()) : c(a) { }; + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + value_type& top() { return c.back(); } + const value_type& top() const { return c.back(); } + void push(const value_type& x) { c.push_back(x); } + void pop() { c.pop_back(); } + + bool operator==(const stack<T, Container> &x) const{ + return x.c == c; + } + + }; + + + template <class T, class Container> _UCXXEXPORT bool + operator< (const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c < y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator!=(const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c != y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator> (const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c > y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator>=(const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c >= y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator<=(const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c <= y.c); + } + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/stdexcept.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/stdexcept.svn-base new file mode 100644 index 0000000..ad28684 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/stdexcept.svn-base @@ -0,0 +1,113 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> +#include <string> + +#ifndef HEADER_STD_EXCEPTIONS +#define HEADER_STD_EXCEPTIONS 1 + +//Don't include support if not needed +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + +//typedef basic_string<char> string; + +class _UCXXEXPORT logic_error : public exception { +protected: + string mstring; +public: + logic_error() throw(); + logic_error(const string& what_arg); + + virtual ~logic_error() throw() {} + virtual const char * what() const throw(); + +}; + +class _UCXXEXPORT domain_error : public logic_error { +public: + domain_error() : logic_error() {} + domain_error(const string& what_arg) : logic_error(what_arg) {} + virtual ~domain_error() throw() {} +}; + +class _UCXXEXPORT invalid_argument : public logic_error { +public: + invalid_argument() : logic_error(){} + invalid_argument(const string& what_arg) : logic_error(what_arg){} + virtual ~invalid_argument() throw() {} +}; + +class _UCXXEXPORT length_error : public logic_error { +public: + length_error() : logic_error(){} + length_error(const string& what_arg) : logic_error(what_arg){} + virtual ~length_error() throw() {} +}; + +class _UCXXEXPORT out_of_range : public logic_error{ +public: + out_of_range(); + out_of_range(const string & what_arg); + virtual ~out_of_range() throw() {} + +}; + +class _UCXXEXPORT runtime_error : public exception{ +protected: + string mstring; +public: + runtime_error(); + runtime_error(const string& what_arg); + + virtual ~runtime_error() throw() {} + virtual const char * what() const throw(); +}; + +class _UCXXEXPORT range_error : public runtime_error{ +public: + range_error() : runtime_error(){} + range_error(const string& what_arg) : runtime_error(what_arg) {} + virtual ~range_error() throw(){ } +}; + + +class _UCXXEXPORT overflow_error : public runtime_error{ +public: + overflow_error() : runtime_error(){} + overflow_error(const string& what_arg) : runtime_error(what_arg) {} + virtual ~overflow_error() throw(){} +}; + +class _UCXXEXPORT underflow_error : public runtime_error{ +public: + underflow_error() : runtime_error(){} + underflow_error(const string& what_arg) : runtime_error(what_arg) {} + virtual ~underflow_error() throw(){} +}; + + + +} + +#endif +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/streambuf.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/streambuf.svn-base new file mode 100644 index 0000000..7bfc3ab --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/streambuf.svn-base @@ -0,0 +1,325 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <locale> +#include <string> +#include <iosfwd> + +#ifndef HEADER_STD_STREAMBUF +#define HEADER_STD_STREAMBUF 1 + +#include <ios> + +namespace std{ + + template <class charT, class traits> class _UCXXEXPORT basic_streambuf{ + public: +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + friend ios_base::Init::Init(); +#endif + // Types: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef traits traits_type; + + virtual ~basic_streambuf(); + + locale pubimbue(const locale &loc); + + locale getloc() const{ + return myLocale; + } + + basic_streambuf<char_type,traits>* pubsetbuf(char_type* s, streamsize n){ + return setbuf(s,n); + } + pos_type pubseekoff(off_type off, + typename ios_base::seekdir way, + ios_base::openmode which = ios_base::in | + ios_base::out + ) + { + return seekoff(off,way,which); + } + pos_type pubseekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out){ + return seekpos(sp,which); + } + int pubsync(){ + return sync(); + } + + streamsize in_avail(); + + int_type snextc(); + + int_type sbumpc(); + + int_type sgetc(); + + streamsize sgetn(char_type* s, streamsize n){ + return xsgetn(s,n); + } + + int_type sputbackc(char_type c); + + int_type sungetc(); + + int_type sputc(char_type c); + + streamsize sputn(const char_type* s, streamsize n){ + if(openedFor & ios_base::app){ + seekoff(0, ios_base::end, ios_base::out); + } + return xsputn(s, n); + } + + protected: + locale myLocale; + //Pointers for the "get" buffers + charT * mgbeg; + charT * mgnext; + charT * mgend; + + //Pointers for the "put" buffers + charT * mpbeg; + charT * mpnext; + charT * mpend; + + //In the event of null buffers Lets us know what the buffer is opened for + ios_base::openmode openedFor; + + basic_streambuf(); + + basic_streambuf(const basic_streambuf<char, char_traits<char> > &) + : myLocale(), + mgbeg(0), mgnext(0), mgend(0), mpbeg(0), mpnext(0), mpend(0), + openedFor(0) + { } + basic_streambuf<char, char_traits<char> > & operator=(const basic_streambuf<char, char_traits<char> > &){ + return *this; + } + + char_type* eback() const{ + return mgbeg; + } + char_type* gptr() const{ + return mgnext; + } + char_type* egptr() const{ + return mgend; + } + void gbump(int n){ + mgnext+=n; + } + void setg(char_type* gbeg, char_type* gnext, char_type* gend){ + mgbeg = gbeg; + mgnext = gnext; + mgend = gend; + } + + char_type* pbase() const{ + return mpbeg; + } + char_type* pptr() const{ + return mpnext; + } + char_type* epptr() const{ + return mpend; + } + void pbump(int n){ + mpnext+=n; + } + void setp(char_type* pbeg, char_type* pend){ + mpbeg = pbeg; + mpnext = pbeg; + mpend = pend; + } + + virtual void imbue(const locale &loc){ + myLocale = loc; + } + + //Virtual functions which we will not implement + + virtual basic_streambuf<char_type,traits>* setbuf(char_type* , streamsize){ + return 0; + } + virtual pos_type seekoff(off_type , ios_base::seekdir, + ios_base::openmode = ios_base::in | ios_base::out) + { + return 0; + } + virtual pos_type seekpos(pos_type , ios_base::openmode = ios_base::in | ios_base::out){ + return 0; + } + virtual int sync(){ + return 0; + } + + virtual int showmanyc(){ + return 0; + } + virtual streamsize xsgetn(char_type* , streamsize ){ + return 0; + } + virtual int_type underflow(){ + return traits_type::eof(); + } + virtual int_type uflow(){ + int_type ret = underflow(); + if (!traits_type::eq_int_type(ret, traits_type::eof())) + gbump(1); + return ret; + } + + virtual int_type pbackfail(int_type c = traits::eof()){ + return c; + } + virtual streamsize xsputn(const char_type* c, streamsize n){ + //This function is designed to be replaced by subclasses + for(streamsize i = 0; i< n; ++i){ + if(sputc(c[i]) == traits::eof()){ + return i; + } + } + return n; + } + virtual int_type overflow (int_type c = traits::eof()){ + return c; + } + }; + + typedef basic_streambuf<char> streambuf; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_streambuf<wchar_t> wstreambuf; +#endif + + +//Definitions put below to allow for easy expansion of code + + template <class C, class T> basic_streambuf<C, T>::~basic_streambuf(){ } + + template <class C, class T> locale basic_streambuf<C, T>::pubimbue(const locale &loc){ + locale temp = myLocale; + myLocale = loc; + return temp; + } + + template <class C, class T> streamsize basic_streambuf<C, T>::in_avail(){ + if(mgend !=0 && mgnext !=0){ + return mgend - mgnext; + } + return showmanyc(); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sbumpc(){ + if(mgbeg == 0 || mgnext == mgend){ + return uflow(); + } + int_type retval = T::to_int_type(*gptr()); + gbump(1); + return retval; + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::snextc(){ + if(sbumpc() == T::eof() ){ + return T::eof() ; + } + return sgetc(); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sgetc(){ + if(mgbeg == 0 || mgnext == mgend){ + return underflow(); + } + return T::to_int_type(*gptr()); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sputbackc(char_type c){ + if(mgbeg == 0 || mgnext == mgbeg || !T::eq(c, gptr()[-1] )){ + return pbackfail(T::to_int_type(c)); + } + gbump(-1); + return T::to_int_type(*gptr()); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sungetc(){ + if(mgbeg == 0 || mgnext == mgbeg){ + return ios_base::failbit; + } + gbump(-1); + return T::to_int_type(*gptr()); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sputc(char_type c){ + if(openedFor & ios_base::app){ + seekoff(0, ios_base::end, ios_base::out); + } + if(mpnext < mpend){ + *mpnext = c; + ++mpnext; + }else{ + return overflow( T::to_int_type(c) ); + } + return T::to_int_type(c); + } + + template <class C, class T> basic_streambuf<C, T>::basic_streambuf() + : myLocale(), + mgbeg(0), mgnext(0), mgend(0), mpbeg(0), mpnext(0), mpend(0), + openedFor(0) + { } + + + + + + +#ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STREAMBUF__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT streambuf::basic_streambuf(); + template <> _UCXXEXPORT streambuf::~basic_streambuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); + template <> _UCXXEXPORT streamsize streambuf::in_avail(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::snextc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sgetc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); + template <> _UCXXEXPORT streambuf::int_type streambuf::sungetc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); + +#endif +#endif + + + + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/string.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/string.svn-base new file mode 100644 index 0000000..bd349d7 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/string.svn-base @@ -0,0 +1,1038 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <char_traits> +#include <string.h> +#include <func_exception> +#include <memory> +#include <vector> + + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <cwchar> +#include <cwctype> +#endif + +#ifndef __HEADER_STD_STRING +#define __HEADER_STD_STRING 1 + +namespace std{ + + //Basic basic_string + + template<class Ch, class Tr = char_traits<Ch>, class A = allocator<Ch> > class basic_string; + + typedef basic_string<char> string; + #ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_string<wchar_t> wstring; + #endif + + + +//template<class Ch, class Tr = char_traits<Ch>, class A = allocator<Ch> > class _UCXXEXPORT basic_string +template<class Ch, class Tr, class A> class basic_string + : public std::vector<Ch, A> +{ +public: + typedef Tr traits_type; + typedef typename Tr::char_type value_type; + typedef A allocator_type; + typedef typename A::size_type size_type; + typedef typename A::difference_type difference_type; + + typedef typename A::reference reference; + typedef typename A::const_reference const_reference; + typedef typename A::pointer pointer; + typedef typename A::const_pointer const_pointer; + + typedef typename vector<Ch, A>::iterator iterator; + typedef typename vector<Ch, A>::const_iterator const_iterator; + + typedef typename vector<Ch, A>::reverse_iterator reverse_iterator; + typedef typename vector<Ch, A>::const_reverse_iterator const_reverse_iterator; + + static const size_type npos = (size_type)-1; + + explicit _UCXXEXPORT basic_string(const A& al = A()) : vector<Ch, A>(al){ return; } + + _UCXXEXPORT basic_string(const basic_string& str, size_type pos = 0, size_type n = npos, const A& al = A()); //Below + + _UCXXEXPORT basic_string(const Ch* s, size_type n, const A& al = A()) + : vector<Ch, A>(al) + { + if(n == npos){ + __throw_out_of_range(); + } + if(s > 0){ + resize(n); + Tr::copy(vector<Ch, A>::data, s, vector<Ch, A>::elements); + } + } + + _UCXXEXPORT basic_string(const Ch* s, const A& al = A()); //Below + + _UCXXEXPORT basic_string(size_type n, Ch c, const A& al = A()) + : vector<Ch, A>(n, c, al) + { + } + + template<class InputIterator> _UCXXEXPORT basic_string(InputIterator begin, InputIterator end, const A& a = A()) + :vector<Ch, A>(begin, end) + { + + } + + _UCXXEXPORT ~basic_string() { + return; + } + + _UCXXEXPORT basic_string& operator=(const basic_string& str); //Below + + _UCXXEXPORT basic_string& operator=(const Ch* s){ + vector<Ch, A>::clear(); + if(s!=0){ + size_type len = Tr::length(s); + resize(len); + Tr::copy( vector<Ch, A>::data, s, len); + } + return *this; + } + + _UCXXEXPORT basic_string& operator=(Ch c){ + vector<Ch, A>::clear(); + vector<Ch, A>::push_back(c); + return *this; + } + + inline _UCXXEXPORT size_type length() const { return vector<Ch, A>::size(); } + + void _UCXXEXPORT resize(size_type n, Ch c = Ch()){ + vector<Ch, A>::resize(n, c); + } + + _UCXXEXPORT basic_string& operator+=(const basic_string& str){ + return append(str); + } + + _UCXXEXPORT basic_string& operator+=(const Ch * s){ + return append(s); + } + + _UCXXEXPORT basic_string& operator+=(Ch c){ + vector<Ch, A>::push_back(c); + return *this; + } + + _UCXXEXPORT basic_string& append(const basic_string& str){ + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + str.elements); + Tr::copy( vector<Ch, A>::data + temp, str.vector<Ch, A>::data, str.elements); + + return *this; + } + + _UCXXEXPORT basic_string& append(const basic_string& str, size_type pos, size_type n){ + if(pos > str.size()){ + __throw_out_of_range(); + } + + size_type rlen = str.elements - pos; + if(rlen > n){ + rlen = n; + } + if(vector<Ch, A>::elements > npos - rlen){ + __throw_length_error(); + } + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + rlen); + Tr::copy( vector<Ch, A>::data + temp, str.vector<Ch, A>::data + pos, rlen); + return *this; + } + + _UCXXEXPORT basic_string& append(const Ch* s, size_type n){ + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + n); + Tr::copy( vector<Ch, A>::data + temp, s, n); + return *this; + } + + _UCXXEXPORT basic_string& append(const Ch* s){ + size_type strLen = Tr::length(s); + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + strLen); + Tr::copy( vector<Ch, A>::data + temp, s, strLen); + return *this; + } + + _UCXXEXPORT basic_string& append(size_type n, Ch c){ + vector<Ch, A>::resize(vector<Ch, A>::elements + n, c); + return *this; + } + + _UCXXEXPORT basic_string& assign(const basic_string& str){ + operator=(str); + return *this; + } + + _UCXXEXPORT basic_string& assign(const basic_string& str, size_type pos, size_type n){ + if(pos > str.elements){ + __throw_out_of_range(); + } + size_type r = str.elements - pos; + if(r > n){ + r = n; + } + resize(r); + Tr::copy(vector<Ch, A>::data, str.vector<Ch, A>::data + pos, r); + return *this; + } + + _UCXXEXPORT basic_string& assign(const Ch* s, size_type n){ + resize(n); + Tr::copy(vector<Ch, A>::data, s, n); + return *this; + } + + _UCXXEXPORT basic_string& assign(const Ch* s){ + size_type len = Tr::length(s); + return assign(s, len); + } + + _UCXXEXPORT basic_string& assign(size_type n, Ch c){ + vector<Ch, A>::clear(); + vector<Ch, A>::resize(n, Ch() ); + return *this; + } + + template<class InputIterator> _UCXXEXPORT basic_string& assign(InputIterator first, InputIterator last){ + vector<Ch, A>::resize(0, Ch()); + while (first != last){ + append(*first); + ++first; + } + return *this; + } + + _UCXXEXPORT basic_string& insert(size_type pos1, const basic_string& str, size_type pos2=0, size_type n=npos){ + if(pos1 > vector<Ch, A>::elements || pos2 > str.elements){ + __throw_out_of_range(); + } + size_type r = str.elements - pos2; + if( r > n){ + r = n; + } + if(vector<Ch, A>::elements > npos - r){ + __throw_length_error(); + } + size_type temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + r); + Tr::move(vector<Ch, A>::data + pos1 + r, vector<Ch, A>::data + pos1, temp - pos1); + Tr::copy(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, r); + return *this; + } + + _UCXXEXPORT basic_string& insert(size_type pos, const Ch* s, size_type n){ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + if(vector<Ch, A>::elements > npos - n){ + __throw_length_error(); + } + size_type temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + n); + Tr::move(vector<Ch, A>::data + pos + n, vector<Ch, A>::data + pos, temp - pos); + Tr::copy(vector<Ch, A>::data + pos, s, n); + return *this; + } + + inline _UCXXEXPORT basic_string& insert(size_type pos, const Ch* s){ + size_type len = Tr::length(s); + return insert(pos, s, len); + } + + _UCXXEXPORT basic_string& insert(size_type pos, size_type n, Ch c){ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + if(vector<Ch, A>::elements > npos - n){ + __throw_length_error(); + } + size_type temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + n); + Tr::move(vector<Ch, A>::data + pos + n, vector<Ch, A>::data + pos, temp - pos); + Tr::assign(vector<Ch, A>::data + pos, n, c); + return *this; + } + +// iterator insert(iterator p, charT c = charT()); +// void insert(iterator p, size_type n, charT c); +// template<class InputIterator> void insert(iterator p, InputIterator first, InputIterator last); + + _UCXXEXPORT basic_string& erase(size_type pos = 0, size_type n = npos){ + size_type xlen = vector<Ch, A>::elements - pos; + + if(xlen > n){ + xlen = n; + } + size_type temp = vector<Ch, A>::elements; + + Tr::move(vector<Ch, A>::data + pos, vector<Ch, A>::data + pos + xlen, temp - pos - xlen); + resize(temp - xlen); + return *this; + } + + _UCXXEXPORT iterator erase(iterator position){ + if(position == vector<Ch, A>::end()){ + return position; + } + + ++position; + + iterator temp = position; + + while(position != vector<Ch, A>::end()){ + *(position-1) = *position; + ++position; + } + vector<Ch, A>::pop_back(); + return temp; + } + + _UCXXEXPORT iterator erase(iterator first, iterator last){ + size_t count = last - first; + + iterator temp = last; + + while(last != vector<Ch, A>::end()){ + *(last - count) = *last; + ++last; + } + + resize( vector<Ch, A>::elements-count); + + return temp; + } + + _UCXXEXPORT basic_string& + replace(size_type pos1, size_type n1, const basic_string& str, size_type pos2=0, size_type n2=npos) + { + if(pos1 > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + size_type xlen = vector<Ch, A>::elements - pos1; + if(xlen > n1){ + xlen = n1; + } + size_type rlen = str.elements - pos2; + if(rlen > n2){ + rlen = n2; + } + if((vector<Ch, A>::elements - xlen) >= (npos - rlen)){ + __throw_length_error(); + } + + size_t temp = vector<Ch, A>::elements; + + if(rlen > xlen){ //Only if making larger + resize(temp - xlen + rlen); + } + + //Final length = vector<Ch, A>::elements - xlen + rlen + //Initial block is of size pos1 + //Block 2 is of size len + + Tr::move(vector<Ch, A>::data + pos1 + rlen, vector<Ch, A>::data + pos1 + xlen, temp - pos1 - xlen); + Tr::copy(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, rlen); + resize(temp - xlen + rlen); + return *this; + } + + _UCXXEXPORT basic_string& replace(size_type pos, size_type n1, const Ch* s, size_type n2){ + return replace(pos,n1,basic_string<Ch,Tr,A>(s,n2)); + + } + + inline _UCXXEXPORT basic_string& replace(size_type pos, size_type n1, const Ch* s){ + return replace(pos,n1,basic_string<Ch,Tr,A>(s)); + } + + _UCXXEXPORT basic_string& replace(size_type pos, size_type n1, size_type n2, Ch c){ + return replace(pos,n1,basic_string<Ch, Tr, A>(n2,c)); + } +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, const basic_string& str); +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, const Ch* s, size_type n); +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, const Ch* s); +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, size_type n, Ch c); +/* template<class InputIterator> _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, + InputIterator j1, InputIterator j2);*/ + + size_type _UCXXEXPORT copy(Ch* s, size_type n, size_type pos = 0) const{ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + size_type r = vector<Ch, A>::elements - pos; + if(r > n){ + r = n; + } + Tr::copy(s, vector<Ch, A>::data + pos, r); + return r; + } + + _UCXXEXPORT void swap(basic_string<Ch,Tr,A>& s){ + //Data pointers + + vector<Ch, A>::swap(s); + } + + _UCXXEXPORT const Ch* c_str() const{ + const_cast<basic_string<Ch,Tr,A> *>(this)->reserve(vector<Ch, A>::elements+1); + vector<Ch, A>::data[vector<Ch, A>::elements] = 0; //Add 0 at the end + return vector<Ch, A>::data; + } + + _UCXXEXPORT const Ch* data() const{ + return vector<Ch, A>::data; + } + _UCXXEXPORT allocator_type get_allocator() const{ + return vector<Ch, A>::a; + } + + _UCXXEXPORT size_type find (const basic_string& str, size_type pos = 0) const; //Below + + _UCXXEXPORT size_type find (const Ch* s, size_type pos, size_type n) const{ + return find(basic_string<Ch, Tr, A>(s,n), pos); + } + _UCXXEXPORT size_type find (const Ch* s, size_type pos = 0) const{ + return find(basic_string<Ch, Tr, A>(s), pos); + } + _UCXXEXPORT size_type find (Ch c, size_type pos = 0) const{ + for(size_type i = pos; i < length(); ++i){ + if(this->operator[](i) == c){ + return i; + } + } + return npos; + } + _UCXXEXPORT size_type rfind(const basic_string& str, size_type pos = npos) const{ + if(pos >= length()){ + pos = length(); + } + for(size_type i = pos; i > 0; --i){ + if(str == substr(i-1, str.length())){ + return i-1; + } + } + return npos; + } + _UCXXEXPORT size_type rfind(const Ch* s, size_type pos, size_type n) const{ + return rfind(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type rfind(const Ch* s, size_type pos = npos) const{ + return rfind(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type rfind(Ch c, size_type pos = npos) const{ + return rfind(basic_string<Ch, Tr, A>(1,c),pos); + } + + _UCXXEXPORT size_type find_first_of(const basic_string& str, size_type pos = 0) const{ + for(size_type i = pos; i < length(); ++i){ + for(size_type j = 0; j < str.length() ; ++j){ + if( Tr::eq(str[j], this->operator[](i)) ){ + return i; + } + } + } + return npos; + } + + _UCXXEXPORT size_type find_first_of(const Ch* s, size_type pos, size_type n) const{ + return find_first_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_first_of(const Ch* s, size_type pos = 0) const{ + return find_first_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_first_of(Ch c, size_type pos = 0) const{ + for(size_type i = pos; i< length(); ++i){ + if( Tr::eq(this->operator[](i), c) ){ + return i; + } + } + return npos; + } + + _UCXXEXPORT size_type find_last_of (const basic_string& str, size_type pos = npos) const{ + if(pos > length()){ + pos = length(); + } + for(size_type i = pos; i >0 ; --i){ + for(size_type j = 0 ; j < str.length(); ++j){ + if( Tr::eq(this->operator[](i-1), str[j]) ){ + return i-1; + } + } + } + return npos; + } + _UCXXEXPORT size_type find_last_of (const Ch* s, size_type pos, size_type n) const{ + return find_last_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_last_of (const Ch* s, size_type pos = npos) const{ + return find_last_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_last_of (Ch c, size_type pos = npos) const{ + if(pos > length()){ + pos = length(); + } + for(size_type i = pos; i >0 ; --i){ + if( Tr::eq(this->operator[](i-1), c) ){ + return i-1; + } + } + return npos; + } + + _UCXXEXPORT size_type find_first_not_of(const basic_string& str, size_type pos = 0) const{ + bool foundCharacter; + for(size_type i = pos; i < length(); ++i){ + foundCharacter = false; + for(size_type j = 0; j < str.length() ; ++j){ + if( Tr::eq(str[j], this->operator[](i)) ){ + foundCharacter = true; + } + } + if(foundCharacter == false){ + return i; + } + } + return npos; + } + + _UCXXEXPORT size_type find_first_not_of(const Ch* s, size_type pos, size_type n) const{ + return find_first_not_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_first_not_of(const Ch* s, size_type pos = 0) const{ + return find_first_not_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_first_not_of(Ch c, size_type pos = 0) const{ + for(size_type i = pos; i < length() ; ++i){ + if(this->operator[](i) != c){ + return i; + } + } + return npos; + } + _UCXXEXPORT size_type find_last_not_of (const basic_string& str, size_type pos = npos) const{ + size_type xpos(length() - 1); + if(xpos > pos){ + xpos = pos; + } + + while(xpos != npos && npos != str.find_first_of(at(xpos))){ + --xpos; + } + + return xpos; + } + + _UCXXEXPORT size_type find_last_not_of (const Ch* s, size_type pos, size_type n) const{ + return find_last_not_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_last_not_of (const Ch* s, size_type pos = npos) const{ + return find_last_not_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_last_not_of (Ch c, size_type pos = npos) const{ + size_type xpos(length() - 1); + if(xpos > pos){ + xpos = pos; + } + while(xpos != npos && Tr::eq(at(xpos), c)){ + --xpos; + } + return xpos; + + } + + _UCXXEXPORT basic_string substr(size_type pos = 0, size_type n = npos) const; + + _UCXXEXPORT int compare(const basic_string& str) const{ + size_type rlen = vector<Ch, A>::elements; + if(rlen > str.elements){ + rlen = str.elements; + } + int retval = Tr::compare(vector<Ch, A>::data, str.vector<Ch, A>::data, rlen); + if(retval == 0){ + if(vector<Ch, A>::elements < str.elements){ + retval = -1; + } + if(vector<Ch, A>::elements > str.elements){ + retval = 1; + } + } + return retval; + } + + _UCXXEXPORT int compare(size_type pos1, size_type n1, const basic_string& str, + size_type pos2=0, size_type n2=npos) const{ + size_type len1 = vector<Ch, A>::elements - pos1; + if(len1 > n1){ + len1 = n1; + } + size_type len2 = str.vector<Ch, A>::elements - pos2; + if(len2 > n2){ + len2 = n2; + } + size_type rlen = len1; + if(rlen > len2){ + rlen = len2; + } + int retval = Tr::compare(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, rlen); + if(retval == 0){ + if(len1 < len2){ + retval = -1; + } + if(len1 > len2){ + retval = 1; + } + } + return retval; + } + + _UCXXEXPORT int compare(const Ch* s) const{ + size_type slen = Tr::length(s); + size_type rlen = slen; + if(rlen > vector<Ch, A>::elements){ + rlen=vector<Ch, A>::elements; + } + int retval = Tr::compare(vector<Ch, A>::data, s, rlen); + if(retval==0){ + if(vector<Ch, A>::elements < slen){ + retval = -1; + } + if(vector<Ch, A>::elements > slen){ + retval = 1; + } + } + return retval; + } + + _UCXXEXPORT int compare(size_type pos1, size_type n1, const Ch* s, size_type n2 = npos) const{ + size_type len1 = vector<Ch, A>::elements - pos1; + if(len1 > n1){ + len1 = n1; + } + size_type slen = Tr::length(s); + size_type len2 = slen; + if(len2 > n2){ + len2 = n2; + } + size_type rlen = len1; + if(rlen > len2){ + rlen = len2; + } + int retval = Tr::compare(vector<Ch, A>::data + pos1, s, rlen); + if(retval == 0){ + if(len1 < len2){ + retval = -1; + } + if(len1 > len2){ + retval = 1; + } + } + return retval; + } + +}; + + +//Functions + +template<class Ch,class Tr,class A> _UCXXEXPORT basic_string<Ch,Tr,A>::basic_string(const Ch* s, const A& al) + : vector<Ch, A>(al) +{ + if(s!=0){ + size_type temp = Tr::length(s); + append(s, temp); + } +} + +template<class Ch,class Tr,class A> _UCXXEXPORT basic_string<Ch,Tr,A>:: + basic_string(const basic_string& str, size_type pos, size_type n, const A& al) + : vector<Ch, A>(al) +{ + if(pos>str.size()){ + __throw_out_of_range(); + } + size_type rlen = str.size() - pos; + if( rlen > n){ + rlen = n; + } + resize(rlen); + Tr::copy(vector<Ch, A>::data, str.vector<Ch, A>::data + pos, vector<Ch, A>::elements); +} + +template<class Ch,class Tr,class A> _UCXXEXPORT basic_string<Ch,Tr,A>& + basic_string<Ch,Tr,A>::operator=(const basic_string<Ch,Tr,A> & str) +{ + if(&str == this){ //Check if we are doing a=a + return *this; + } + vector<Ch, A>::clear(); + resize(str.elements); + Tr::copy( vector<Ch, A>::data, str.vector<Ch, A>::data, str.elements); + return *this; +} + + +template<class Ch,class Tr,class A> _UCXXEXPORT typename basic_string<Ch,Tr,A>::size_type + basic_string<Ch,Tr,A>::find (const basic_string<Ch,Tr,A>& str, size_type pos) const +{ + if(str.length() > length()){ + return npos; + } + size_type max_string_start = 1 + length() - str.length(); + for(size_type i = pos; i < max_string_start; ++i){ + if(str == substr(i, str.length())){ + return i; + } + } + return npos; +} + + +template<class Ch,class Tr,class A> + _UCXXEXPORT basic_string<Ch, Tr, A> basic_string<Ch,Tr,A>::substr(size_type pos, size_type n) const +{ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + size_type rlen = vector<Ch, A>::elements - pos; + if(rlen > n){ + rlen = n; + } + return basic_string<Ch,Tr,A>(vector<Ch, A>::data + pos,rlen); +} + + + + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STRING__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT string::basic_string(const allocator<char> &); + template <> _UCXXEXPORT string::basic_string(size_type n, char c, const allocator<char> & ); + template <> _UCXXEXPORT string::basic_string(const char* s, const allocator<char>& al); + template <> _UCXXEXPORT string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator<char>& al); + template <> _UCXXEXPORT string::~basic_string(); + +#endif + + template <> _UCXXEXPORT string & string::append(const char * s, size_type n); + + + template <> _UCXXEXPORT string::size_type string::find(const string & str, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find(const char* s, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find (char c, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::rfind(const string & str, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::rfind(char c, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::rfind(const char* s, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::find_first_of(const string &, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_of(const char *, size_type pos, size_type n) const; + template <> _UCXXEXPORT string::size_type string::find_first_of(const char*, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find_first_of(char c, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::find_last_of (const string & , size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos, size_type n) const; + template <> _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find_last_of (char c, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::find_first_not_of(const string &, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_not_of(char c, size_type) const; + + template <> _UCXXEXPORT int string::compare(const string & str) const; + template <> _UCXXEXPORT int string::compare( + size_type pos1, size_type n1, const string & str, size_type pos2, size_type n2) const; + + template <> _UCXXEXPORT string string::substr(size_type pos, size_type n) const; + + template <> _UCXXEXPORT string & string::operator=(const string & str); + template <> _UCXXEXPORT string & string::operator=(const char * s); + +#endif +#endif + + + + +//typedef basic_string<char> string; + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp.append(rhs); + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp.append(rhs); + return temp; +} + + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(1, lhs); + temp.append(rhs); + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp.append(rhs); + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp+=rhs; + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator==(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) == 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator==(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(rhs.compare(lhs) == 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator==(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + if(lhs.compare(rhs)==0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator!=(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) !=0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator!=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + return (temp != rhs); +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator!=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + return (lhs != temp); +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator< (const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) < 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator< (const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(rhs) < 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator< (const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) < 0){ + return true; + } + return false; +} + + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator> (const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) > 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator> (const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(rhs) > 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator> (const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) > 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator<=(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) <=0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator<=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(temp) <=0 ){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator<=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) <= 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator>=(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) >=0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator>=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(temp) >=0 ){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator>=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) >=0 ){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT void + swap(basic_string<charT,traits,Allocator>& lhs, basic_string<charT,traits,Allocator>& rhs) +{ + lhs.swap(rhs); +} + +/*template<class charT, class traits, class Allocator> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const basic_string<charT,traits,Allocator>& str) +{ + return os.write(str.data(), str.length()); +}*/ + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STRING__ + +//Operators we can avoid duplication of + +template <> _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); +template <> _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); +template <> _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); + +template <> _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); +template <> _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); +template <> _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); + +template <> _UCXXEXPORT string operator+(const string & lhs, const char* rhs); +template <> _UCXXEXPORT string operator+(const char* lhs, const string & rhs); +template <> _UCXXEXPORT string operator+(const string & lhs, const string & rhs); + +template <> _UCXXEXPORT bool operator> (const string & lhs, const string & rhs); +template <> _UCXXEXPORT bool operator< (const string & lhs, const string & rhs); + + +#endif +#endif + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/string_iostream.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/string_iostream.svn-base new file mode 100644 index 0000000..d50333c --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/string_iostream.svn-base @@ -0,0 +1,142 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <istream> +#include <ostream> +#include <string> + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <cwchar> +#include <cwctype> +#endif + +#ifndef __HEADER_STD_STRING_IOSTREAM +#define __HEADER_STD_STRING_IOSTREAM 1 + +namespace std{ + + + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const basic_string<charT,traits,Allocator>& str) +{ + return os.write(str.data(), str.length()); +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& + operator>>(basic_istream<charT,traits>& is, basic_string<charT,traits,Allocator>& str) +{ + + typename basic_istream<charT, traits>::sentry s(is); + if(s == false){ + return is; + } + + str.clear(); + + typename basic_istream<charT, traits>::int_type c; + typename Allocator::size_type n = is.width(); + bool exitnow = false; + if(n == 0){ + n = str.max_size(); + } + +// //Clear out preliminary spaces first +// c = is.get(); +// while(isspace(c)){ +// c = is.get(); +// } +// +// is.putback(c); + + do{ + c = is.get(); + if(c == traits::eof() || isspace(c) || n == 0){ + is.putback(c); + exitnow = true; + }else{ + str.append(1, traits::to_char_type(c) ); + --n; + } + }while(exitnow == false); + return is; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& + getline(basic_istream<charT,traits>& is, basic_string<charT,traits,Allocator>& str, charT delim) +{ + typename basic_istream<charT,traits>::sentry s(is); + if(s == false){ + return is; + } + + str.erase(); + + streamsize i = 0; + typename basic_istream<charT,traits>::int_type c_i; + charT c; + unsigned int n = str.max_size(); + for(i=0;i<n;++i){ + c_i=is.get(); + if(c_i == traits::eof() ){ + return is; + } + c = traits::to_char_type(c_i); + if(c == delim){ + return is; + } + str.append(1, c); + } + return is; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& + getline(basic_istream<charT,traits>& is, basic_string<charT,traits,Allocator>& str) +{ + return getline(is, str, '\n'); +} + + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STRING__ + + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ +template<> _UCXXEXPORT basic_istream<char, char_traits<char> >& operator>>( + basic_istream<char,char_traits<char> >& is, + basic_string<char, char_traits<char>, allocator<char> >& str); +#endif + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +template<> _UCXXEXPORT basic_ostream<char, char_traits<char> >& + operator<<(basic_ostream<char, char_traits<char> >& os, + const basic_string<char,char_traits<char>, std::allocator<char> >& str); + +#endif + + +#endif +#endif + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/support.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/support.svn-base new file mode 100644 index 0000000..ed0c7ca --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/support.svn-base @@ -0,0 +1,167 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <cstdlib> +#include <typeinfo> + +#ifndef HEADER_ULC_SUPPORT +#define HEADER_ULC_SUPPORT 1 + +using namespace std; + +//From C++ ABI spec +typedef enum { + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 +} _Unwind_Reason_Code; + + +typedef void (*_Unwind_Exception_Cleanup_Fn) + (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc); + +//The following definitions were grabbed from the gcc implementation +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); +typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); +typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); +typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, struct _Unwind_Exception *); + +typedef int _Unwind_Action; +static const _Unwind_Action _UA_SEARCH_PHASE = 1; +static const _Unwind_Action _UA_CLEANUP_PHASE = 2; +static const _Unwind_Action _UA_HANDLER_FRAME = 4; +static const _Unwind_Action _UA_FORCE_UNWIND = 8; + +const _Unwind_Exception_Class __uclibcxx_exception_class = (((((((( + _Unwind_Exception_Class) 'u' << 8 | (_Unwind_Exception_Class) 'l') << 8 + | (_Unwind_Exception_Class) 'i') << 8 | (_Unwind_Exception_Class) 'b') << 8 + | (_Unwind_Exception_Class) 'C')<< 8 | (_Unwind_Exception_Class) '+') << 8 + | (_Unwind_Exception_Class) '+') << 8 | (_Unwind_Exception_Class) '\0'); + + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 + +struct _Unwind_Exception{ + _Unwind_Exception_Class exception_class; //Type of exception, eg ulibC++\0 + _Unwind_Exception_Cleanup_Fn exception_cleanup; //Destructor if from diff runtime + _Unwind_Word private_1; //Don't touch at all! + _Unwind_Word private_2; //Don't touch at all! +} __attribute__((__aligned__)); + + +//The following structure is system-dependent and defined by the compiler +//Thus it's definition was copied from the gcc 3.4.0 header files +struct _Unwind_Context; +//{ +// void *reg[DWARF_FRAME_REGISTERS+1]; +// void *cfa; +// void *ra; +// void *lsda; +// struct dwarf_eh_bases bases; +// _Unwind_Word args_size; +//}; + + + +_Unwind_Reason_Code _Unwind_RaiseException ( struct _Unwind_Exception *exception_object ); + +//_Unwind_ForcedUnwind + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int version, _Unwind_Action actions, _Unwind_Exception_Class exceptionClass, + struct _Unwind_Exception *exceptionObject, + struct _Unwind_Context *context, void *stop_parameter ); + +_Unwind_Reason_Code _Unwind_ForcedUnwind ( + struct _Unwind_Exception *exception_object, _Unwind_Stop_Fn stop, + void *stop_parameter ); + +void _Unwind_Resume (struct _Unwind_Exception *exception_object); +void _Unwind_DeleteException (struct _Unwind_Exception *exception_object); + +_Unwind_Word _Unwind_GetGR (struct _Unwind_Context *context, int index); +void _Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word); + +_Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *context); +void _Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr new_value); + +_Unwind_Ptr _Unwind_GetLanguageSpecificData (struct _Unwind_Context *context); +_Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *context); + +_Unwind_Reason_Code (*__personality_routine) + (int version, //Should be 1 + _Unwind_Action actions, //Actions the routine will perform (bitmask) + _Unwind_Exception_Class exceptionClass, //Type of exception - vendor is high 4 bytes + struct _Unwind_Exception *exceptionObject, //Points to exception header + struct _Unwind_Context *context); //Unwinder state information + + +/*The following part is the Level II ABI which is required for compatability*/ +//This might be the only stuff that *I* need to implement + +struct __cxa_exception { + std::type_info *exceptionType; //Type of thrown exception + void (*exceptionDestructor) (void *); //Pointer to the destructor + unexpected_handler unexpectedHandler; //Unexpected handler to use + terminate_handler terminateHandler; //Terminate handle to use + __cxa_exception *nextException; //per thread linked list + + int handlerCount; //How many handlers have caught this + int handlerSwitchValue; + const char *actionRecord; + const char *languageSpecificData; + void *catchTemp; + void *adjustedPtr; + + _Unwind_Exception unwindHeader; +}; + +struct __cxa_eh_globals { + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; + +extern "C" __cxa_eh_globals *__cxa_get_globals(void); //Return ptr to the eh_globals object for current thread +extern "C" __cxa_eh_globals *__cxa_get_globals_fast(void); //Same as above, assumes that above called at least once + +extern "C" void *__cxa_allocate_exception(size_t thrown_size); //Allocate space for exception plus header +extern "C" void __cxa_free_exception(void *thrown_exception); //Free space allocated from the above + +extern "C" void __cxa_throw (void *thrown_exception, //This is the actual throw call +// std::type_info *tinfo, //Type of object + void * tinfo, //Type of object + void (*dest) (void *) ); //Pointer to destructor destroy object + + +#endif + + + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/system_configuration.h.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/system_configuration.h.svn-base new file mode 100644 index 0000000..c13bc4d --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/system_configuration.h.svn-base @@ -0,0 +1,59 @@ +/* + * Automatically generated C config: don't edit + */ +/* + * Version Number + */ +#define __UCLIBCXX_MAJOR__ 0 +#define __UCLIBCXX_MINOR__ 2 +#define __UCLIBCXX_SUBLEVEL__ 2 + +/* + * Target Features and Options + */ +#define __UCLIBCXX_HAS_FLOATS__ 1 +#undef __UCLIBCXX_HAS_LONG_DOUBLE__ +#undef __UCLIBCXX_HAS_TLS__ +#define __WARNINGS__ "-Wall" +#define __BUILD_EXTRA_LIBRARIES__ "" +#define __HAVE_DOT_CONFIG__ 1 + +/* + * String and I/O Stream Support + */ +#undef __UCLIBCXX_HAS_WCHAR__ +#define __UCLIBCXX_IOSTREAM_BUFSIZE__ 32 +#define __UCLIBCXX_HAS_LFS__ 1 +#define __UCLIBCXX_SUPPORT_CDIR__ 0 +#define __UCLIBCXX_SUPPORT_CIN__ 0 +#define __UCLIBCXX_SUPPORT_COUT__ 0 +#define __UCLIBCXX_SUPPORT_CERR__ 0 +#undef __UCLIBCXX_SUPPORT_CLOG__ + +/* + * STL and Code Expansion + */ +#define __UCLIBCXX_STL_BUFFER_SIZE__ 32 +#define __UCLIBCXX_CODE_EXPANSION__ 1 +#undef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ +#define __UCLIBCXX_EXPAND_STRING_CHAR__ 1 +#define __UCLIBCXX_EXPAND_VECTOR_BASIC__ 1 +#define __UCLIBCXX_EXPAND_IOS_CHAR__ 1 +#define __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ 1 +#define __UCLIBCXX_EXPAND_ISTREAM_CHAR__ 1 +#define __UCLIBCXX_EXPAND_OSTREAM_CHAR__ 1 +#define __UCLIBCXX_EXPAND_FSTREAM_CHAR__ 1 +#define __UCLIBCXX_EXPAND_SSTREAM_CHAR__ 1 + +/* + * Library Installation Options + */ +#define __UCLIBCXX_RUNTIME_PREFIX__ "." +#define __UCLIBCXX_RUNTIME_INCLUDE_SUBDIR__ "/include" +#define __UCLIBCXX_RUNTIME_LIB_SUBDIR__ "/lib" +#define __UCLIBCXX_RUNTIME_BIN_SUBDIR__ "/bin" +#undef __UCLIBCXX_EXCEPTION_SUPPORT__ +#define __BUILD_STATIC_LIB__ 1 +#define __BUILD_ONLY_STATIC_LIB__ 1 +#undef __DODEBUG__ + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/type_traits.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/type_traits.svn-base new file mode 100644 index 0000000..9c9b1d4 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/type_traits.svn-base @@ -0,0 +1,88 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <string.h> +#include <exception> +#include <memory> +#include <char_traits> + +#ifndef __HEADER_TYPE_TRAITS +#define __HEADER_TYPE_TRAITS 1 + +namespace std{ + + struct _UCXXEXPORT __true_type{}; + struct _UCXXEXPORT __false_type{}; + + template <class I> class _UCXXEXPORT __is_integer{ + public: + typedef __false_type value; + }; + + template <> class _UCXXEXPORT __is_integer <unsigned int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <signed int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <short unsigned int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <short signed int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <char>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <signed char>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <unsigned char>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <long unsigned int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <long signed int>{ + public: + typedef __true_type value; + }; + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/.svn/text-base/typeinfo.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/typeinfo.svn-base new file mode 100644 index 0000000..88a2639 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/typeinfo.svn-base @@ -0,0 +1,156 @@ +// RTTI support for -*- C++ -*- +// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 +// Free Software Foundation +// +// This file is part of GNU CC. +// +// GNU CC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GNU CC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU CC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +/** @file typeinfo + * This header provides RTTI support. + */ + +#ifndef __TYPEINFO__ +#define __TYPEINFO__ + +#include <exception> + +extern "C++" { + +namespace __cxxabiv1 +{ + class __class_type_info; +} // namespace __cxxabiv1 + +#if !__GXX_WEAK__ + // If weak symbols are not supported, typeinfo names are not merged. + #define __GXX_MERGED_TYPEINFO_NAMES 0 +#else + // On platforms that support weak symbols, typeinfo names are merged. + #define __GXX_MERGED_TYPEINFO_NAMES 1 +#endif + +namespace std +{ + /** + * @brief Part of RTTI. + * + * The @c type_info class describes type information generated by + * an implementation. + */ + class type_info + { + public: + /** Destructor. Being the first non-inline virtual function, this + * controls in which translation unit the vtable is emitted. The + * compiler makes use of that information to know where to emit + * the runtime-mandated type_info structures in the new-abi. */ + virtual ~type_info(); + + private: + /// Assigning type_info is not supported. Made private. + type_info& operator=(const type_info&); + type_info(const type_info&); + + protected: + const char *__name; + + protected: + explicit type_info(const char *__n): __name(__n) { } + + public: + // the public interface + /** Returns an @e implementation-defined byte string; this is not + * portable between compilers! */ + const char* name() const + { return __name; } + +#if !__GXX_MERGED_TYPEINFO_NAMES + bool before(const type_info& __arg) const; + // In old abi, or when weak symbols are not supported, there can + // be multiple instances of a type_info object for one + // type. Uniqueness must use the _name value, not object address. + bool operator==(const type_info& __arg) const; +#else + /** Returns true if @c *this precedes @c __arg in the implementation's + * collation order. */ + // In new abi we can rely on type_info's NTBS being unique, + // and therefore address comparisons are sufficient. + bool before(const type_info& __arg) const + { return __name < __arg.__name; } + bool operator==(const type_info& __arg) const + { return __name == __arg.__name; } +#endif + bool operator!=(const type_info& __arg) const + { return !operator==(__arg); } + + // the internal interface + public: + // return true if this is a pointer type of some kind + virtual bool __is_pointer_p() const; + // return true if this is a function type + virtual bool __is_function_p() const; + + // Try and catch a thrown type. Store an adjusted pointer to the + // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then + // THR_OBJ points to the thrown object. If THR_TYPE is a pointer + // type, then THR_OBJ is the pointer itself. OUTER indicates the + // number of outer pointers, and whether they were const + // qualified. + virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj, + unsigned __outer) const; + + // internally used during catch matching + virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, + void **__obj_ptr) const; + }; + + /** + * @brief Thrown during incorrect typecasting. + * + * If you attempt an invalid @c dynamic_cast expression, an instance of + * this class (or something derived from this class) is thrown. */ + class bad_cast : public exception + { + public: + bad_cast() throw() { } + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_cast() throw(); + }; + + /** If you use a NULL pointer in a @c typeid expression, this is thrown. */ + class bad_typeid : public exception + { + public: + bad_typeid () throw() { } + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_typeid() throw(); + }; +} // namespace std + +} // extern "C++" +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/types.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/types.svn-base new file mode 100644 index 0000000..b4bec8f --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/types.svn-base @@ -0,0 +1,3 @@ +extern "C" { + #include "types.h" +} \ No newline at end of file diff --git a/i386/modules/uClibcxx/include/.svn/text-base/unwind-cxx.h.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/unwind-cxx.h.svn-base new file mode 100644 index 0000000..c27aaac --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/unwind-cxx.h.svn-base @@ -0,0 +1,154 @@ +// -*- C++ -*- Exception handling and frame unwind runtime interface routines. +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GCC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GCC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This is derived from the C++ ABI for IA-64. Where we diverge +// for cross-architecture compatibility are noted with "@@@". + +#ifndef _UNWIND_CXX_H +#define _UNWIND_CXX_H 1 + +// Level 2: C++ ABI + +#include <typeinfo> +#include <exception> +#include <cstddef> +//#include <unwind.h> + +namespace __cxxabiv1 +{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +// A C++ exception object consists of a header, which is a wrapper around +// an unwind object header with additional C++ specific information, +// followed by the exception object itself. + +struct __cxa_exception +{ + // Manage the exception object itself. + std::type_info *exceptionType; + void (*exceptionDestructor)(void *); + + // The C++ standard has entertaining rules wrt calling set_terminate + // and set_unexpected in the middle of the exception cleanup process. + std::unexpected_handler unexpectedHandler; + std::terminate_handler terminateHandler; + + // The caught exception stack threads through here. + __cxa_exception *nextException; + + // How many nested handlers have caught this exception. A negated + // value is a signal that this object has been rethrown. + int handlerCount; + + // Cache parsed handler data from the personality routine Phase 1 + // for Phase 2 and __cxa_call_unexpected. + int handlerSwitchValue; + const unsigned char *actionRecord; + const unsigned char *languageSpecificData; + _Unwind_Ptr catchTemp; + void *adjustedPtr; + + // The generic exception header. Must be last. + _Unwind_Exception unwindHeader; +}; + + // Each thread in a C++ program has access to a __cxa_eh_globals object. +struct __cxa_eh_globals +{ + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; + + +// The __cxa_eh_globals for the current thread can be obtained by using +// either of the following functions. The "fast" version assumes at least +// one prior call of __cxa_get_globals has been made from the current +// thread, so no initialization is necessary. +extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); +extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw(); +#endif + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +// Allocate memory for the exception plus the thown object. +extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw(); + +// Free the space allocated for the exception. +extern "C" void __cxa_free_exception(void *thrown_exception) throw(); + +// Throw the exception. +extern "C" void __cxa_throw (void *thrown_exception, + std::type_info *tinfo, + void (*dest) (void *)) + __attribute__((noreturn)); + +// Used to implement exception handlers. +extern "C" void *__cxa_begin_catch (void *) throw(); +extern "C" void __cxa_end_catch (); +extern "C" void __cxa_rethrow () __attribute__((noreturn)); +#endif + +// These facilitate code generation for recurring situations. +extern "C" void __cxa_bad_cast (); +extern "C" void __cxa_bad_typeid (); + +// @@@ These are not directly specified by the IA-64 C++ ABI. + +// Handles re-checking the exception specification if unexpectedHandler +// throws, and if bad_exception needs to be thrown. Called from the +// compiler. +extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); + +// Invokes given handler, dying appropriately if the user handler was +// so inconsiderate as to return. +extern void __terminate(std::terminate_handler) __attribute__((noreturn)); +extern void __unexpected(std::unexpected_handler) __attribute__((noreturn)); + +// The current installed user handlers. +extern std::terminate_handler __terminate_handler; +extern std::unexpected_handler __unexpected_handler; + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +// Acquire the C++ exception header from the C++ object. +static inline __cxa_exception * +__get_exception_header_from_obj (void *ptr) +{ + return reinterpret_cast<__cxa_exception *>(ptr) - 1; +} + +// Acquire the C++ exception header from the generic exception header. +static inline __cxa_exception * +__get_exception_header_from_ue (_Unwind_Exception *exc) +{ + return reinterpret_cast<__cxa_exception *>(exc + 1) - 1; +} +#endif +} /* namespace __cxxabiv1 */ + +#endif // _UNWIND_CXX_H diff --git a/i386/modules/uClibcxx/include/.svn/text-base/utility.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/utility.svn-base new file mode 100644 index 0000000..070f34f --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/utility.svn-base @@ -0,0 +1,84 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <basic_definitions> + + +#ifndef __STD_HEADER_UTILITY +#define __STD_HEADER_UTILITY 1 + +namespace std{ + + namespace rel_ops { + template<class T> inline bool operator!=(const T& x, const T& y){ + return !(x == y); + } + + template<class T> inline bool operator> (const T& x, const T& y){ + return ( y < x); + } + + template<class T> inline bool operator<=(const T& x, const T& y){ + return !( y < x ); + } + + template<class T> inline bool operator>=(const T& x, const T& y){ + return !(x < y); + } + } + + template <class T1, class T2> struct _UCXXEXPORT pair { + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + pair() : first(), second() { } + pair(const T1& x, const T2& y) : first(x), second(y) { } + template<class U, class V> pair(const pair<U, V> &p) : first(p.first), second(p.second) { } + }; + + template <class T1, class T2> bool operator==(const pair<T1,T2>& x, const pair<T1,T2>& y){ + using namespace rel_ops; + return (x.first == y.first && x.second==y.second); + } + template <class T1, class T2> bool operator< (const pair<T1,T2>& x, const pair<T1,T2>& y){ + return x.first < y.first || (!(y.first < x.first) && x.second < y.second); + } + template <class T1, class T2> bool operator!=(const pair<T1,T2>& x, const pair<T1,T2>& y){ + return !(x == y); + } + template <class T1, class T2> bool operator> (const pair<T1,T2>& x, const pair<T1,T2>& y){ + return y < x; + } + template <class T1, class T2> bool operator>=(const pair<T1,T2>& x, const pair<T1,T2>& y){ + return !(x < y); + } + template <class T1, class T2> bool operator<=(const pair<T1,T2>& x, const pair<T1,T2>& y){ + return !(y < x); + } + template <class T1, class T2> pair<T1,T2> make_pair(const T1& x, const T2& y){ + return pair<T1,T2>(x, y); + } + + +} + +#endif //__STD_HEADER_UTILITY diff --git a/i386/modules/uClibcxx/include/.svn/text-base/valarray.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/valarray.svn-base new file mode 100644 index 0000000..42448ad --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/valarray.svn-base @@ -0,0 +1,992 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef __HEADER_STD_VALARRAY +#define __HEADER_STD_VALARRAY 1 + +#include <cstddef> +#include <cmath> + +namespace std{ + + template<class T> class valarray; + class slice; + template<class T> class slice_array; + class gslice; + template<class T> class gslice_array; + template<class T> class mask_array; + template<class T> class indirect_array; + + //Actual class definitions + + + class _UCXXEXPORT slice { + protected: + size_t sta; + size_t siz; + size_t str; + + public: + slice() : sta(0), siz(0), str(0){ } + slice(size_t a, size_t b, size_t c) : sta(a), siz(b), str(c) { } + slice(const slice& s) : sta(s.sta), siz(s.siz), str(s.str) { } + ~slice() { } + size_t start() const{ + return sta; + } + size_t size() const{ + return siz; + } + size_t stride() const{ + return str; + } + }; + + + + template<class T> class _UCXXEXPORT valarray { + friend class slice_array<T>; + protected: + T * data; + size_t length; + + public: + typedef T value_type; + + valarray() : data(0), length(0) { } + + explicit valarray(size_t t) : data(0), length(t){ + data = new T[length]; + } + + valarray(const T& v, size_t t) : data(0), length(t){ + data = new T[length]; + for(size_t i = 0; i < length; ++i){ + data[i] = v; + } + } + valarray(const T* p, size_t t) : data(0), length(t) { + data = new T[length]; + for(size_t i = 0; i < length; ++i){ + data[i] = p[i]; + } + } + valarray(const valarray& v) : data(0), length(v.length){ + data = new T[length]; + for(size_t i = 0; i < length; ++i){ + data[i] = v.data[i]; + } + } + valarray(const slice_array<T> & sa) : data(0), length(sa.s.size()){ + data = new T[length]; + for(unsigned int i = 0; i < length; ++i){ + data[i] = sa.array->data[sa.s.start() + i * sa.s.stride()]; + } + } + valarray(const gslice_array<T>&); + valarray(const mask_array<T>&); + valarray(const indirect_array<T>&); + ~valarray(){ + delete [] data; + data = 0; + length = 0; + } + + valarray<T>& operator=(const valarray<T>& v){ + for(size_t i =0; i< length; ++i){ + data[i] = v.data[i]; + } + return *this; + } + valarray<T>& operator=(const T& t){ + for(size_t i = 0; i < length; ++i){ + data[i] = t; + } + return *this; + } + valarray<T>& operator=(const slice_array<T>& sa){ + for(size_t i =0; i < length; ++i){ + data[i] = sa.data[sa.s.start() + i * sa.s.stride()]; + } + return *this; + } + valarray<T>& operator=(const gslice_array<T>&); + valarray<T>& operator=(const mask_array<T>&); + valarray<T>& operator=(const indirect_array<T>&); + + T operator[](size_t t) const{ + return data[t]; + } + T& operator[](size_t t){ + return data[t]; + } + + valarray<T> operator[](slice s) const{ + valarray<T> retval(s.size()); + for(unsigned int i = 0; i< s.size(); ++i){ + retval.data[i] = data[s.start() + i * s.stride()]; + } + return retval; + } + + slice_array<T> operator[](slice sl){ + slice_array<T> retval; + retval.s = sl; + retval.array = this; + return retval; + } + + valarray<T> operator[](const gslice&) const; + gslice_array<T> operator[](const gslice&); + valarray<T> operator[](const valarray<bool>&) const; + mask_array<T> operator[](const valarray<bool>&); + valarray<T> operator[](const valarray<size_t>&) const; + indirect_array<T> operator[](const valarray<size_t>&); + + valarray<T> operator+() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length ; ++i){ + retval.data[i] = +data[i]; + } + return retval; + } + valarray<T> operator-() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length; ++i){ + retval.data[i] = -data[i]; + } + return retval; + } + valarray<T> operator~() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length ; ++i){ + retval.data[i] = ~data[i]; + } + return retval; + } + valarray<T> operator!() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length ; ++i){ + retval.data[i] = !data[i]; + } + return retval; + } + valarray<T>& operator*= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] *= t; + } + return *this; + } + valarray<T>& operator/= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] /= t; + } + return *this; + } + valarray<T>& operator%= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] %= t; + } + return *this; + } + valarray<T>& operator+= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] += t; + } + return *this; + } + valarray<T>& operator-= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] -= t; + } + return *this; + } + valarray<T>& operator^= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] ^= t; + } + return *this; + } + valarray<T>& operator&= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] &= t; + } + return *this; + } + valarray<T>& operator|= (const T& t){ + for(size_t i=0;i<length; ++i){ + data[i] != t; + } + return *this; + } + valarray<T>& operator<<=(const T& t){ + for(size_t i=0;i<length;++i){ + data[i] <<= t; + } + return *this; + } + valarray<T>& operator>>=(const T& t){ + for(size_t i=0;i<length;++i){ + data[i] >>= t; + } + return *this; + } + valarray<T>& operator*= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] *= a.data[i]; + } + return *this; + } + valarray<T>& operator/= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] /= a.data[i]; + } + return *this; + } + valarray<T>& operator%= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] %= a.data[i]; + } + return *this; + } + valarray<T>& operator+= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] += a.data[i]; + } + return *this; + } + valarray<T>& operator-= (const valarray<T>& a){ + for(size_t i=0;i<length ;++i){ + data[i] -= a.data[i]; + } + return *this; + } + valarray<T>& operator^= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] ^= a.data[i]; + } + return *this; + } + valarray<T>& operator|= (const valarray<T>& a){ + for(size_t i=0;i<length ;++i){ + data[i] |= a.data[i]; + } + return *this; + } + valarray<T>& operator&= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] &= a.data[i]; + } + return *this; + } + valarray<T>& operator<<=(const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] <<= a.data[i]; + } + return *this; + } + valarray<T>& operator>>=(const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] >>= a.data[i]; + } + return *this; + } + + size_t size() const{ + return length; + } + + T sum() const{ + T retval(data[0]); + for(size_t i = 1; i< length; ++i){ + retval += data[i]; + } + return retval; + } + + T min() const{ + T retval(data[0]); + for(size_t i = 1; i< length; ++i){ + if(data[i] < retval){ + retval = data[i]; + } + } + return retval; + } + + T max() const{ + T retval(data[0]); + for(size_t i = 1; i< length; ++i){ + if(retval < data[i]){ + retval = data[i]; + } + } + return retval; + } + + valarray<T> shift (int n) const{ + valarray<T> retval(length); + for(size_t i = 0; i < length ; ++i){ + if(i + n > 0 && i + n < length){ + retval.data[i] = data[i + n]; + } + } + return retval; + } + valarray<T> cshift(int n) const{ + valarray<T> retval(length); + for(size_t i = 0; i < length ; ++i){ + retval.data[i] = data[ (i + n) % length ]; + } + return retval; + } + valarray<T> apply(T func(T) ) const{ + valarray<T> retval(length); + for(size_t i = 0; i< length; ++i){ + retval.data[i] = func(data[i]); + } + return retval; + } + valarray<T> apply(T func(const T&)) const{ + valarray<T> retval(length); + for(size_t i = 0; i< length; ++i){ + retval.data[i] = func(data[i]); + } + return retval; + } + void resize(size_t sz, T c = T()){ + delete [] data; + data = 0; + if(sz > 0){ + data = new T[sz]; + for(size_t i = 0; i < sz; ++i){ + data[i] = c; + } + } + length = sz; + } + }; + + + + template <class T> class _UCXXEXPORT slice_array { + friend class valarray<T>; + public: + typedef T value_type; + + void operator= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] = v[i]; + } + } + void operator= (const T & v){ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] = v; + } + } + void fill(const T & v){ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] = v; + } + } + void operator*= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] *= v[i]; + } + } + void operator/= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] /= v[i]; + } + } + void operator%= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] %= v[i]; + } + } + void operator+= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] += v[i]; + } + } + void operator-= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] -= v[i]; + } + } + void operator^= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] ^= v[i]; + } + } + void operator&= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] &= v[i]; + } + } + void operator|= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] |= v[i]; + } + } + void operator<<=(const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] <<= v[i]; + } + } + void operator>>=(const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] >>= v[i]; + } + } + ~slice_array(){ + array = 0; + } + + private: + slice_array() : array(0){ } + + public: + slice_array(const slice_array& sa) : array(sa.array), s(sa.s){ } + slice_array& operator=(const slice_array& sa){ + array = sa.array; + s = sa.s; + } + + private: + valarray<T> * array; + slice s; + }; + + + class _UCXXEXPORT gslice { + private: + size_t sta; + valarray<size_t> siz; + valarray<size_t> str; + + public: + gslice() : sta(0) { } + gslice(size_t s, const valarray<size_t>& l, const valarray<size_t>& d) + : sta(s), siz(l), str(d) { } + + size_t start() const{ + return sta; + } + valarray<size_t> size() const{ + return siz; + } + valarray<size_t> stride() const{ + return str; + } + }; + + template <class T> class gslice_array { + private: + friend class valarray<T>; + + public: + ~gslice_array(); + + void operator=(const valarray<T>& array) const; + void operator*=(const valarray<T>& array) const; + void operator/=(const valarray<T>& array) const; + void operator%=(const valarray<T>& array) const; + void operator+=(const valarray<T>& array) const; + void operator-=(const valarray<T>& array) const; + void operator^=(const valarray<T>& array) const; + void operator&=(const valarray<T>& array) const; + void operator|=(const valarray<T>& array) const; + void operator<<=(const valarray<T>& array) const; + void operator>>=(const valarray<T>& array) const; + + void operator=(const T&); + + private: + gslice_array(); + gslice_array(const gslice_array<T>&); + gslice_array<T>& operator= (const gslice_array<T>& array); + }; + + + + template<class T> valarray<T> operator* (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval *= rhs; + return retval; + } + + template<class T> valarray<T> operator* (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval *= rhs; + return retval; + } + template<class T> valarray<T> operator* (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(rhs); + retval *= lhs; + return retval; + } + template<class T> valarray<T> operator/ (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval /= rhs; + return retval; + } + template<class T> valarray<T> operator/ (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval /= rhs; + return retval; + } + template<class T> valarray<T> operator/ (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval /= rhs; + return retval; + } + template<class T> valarray<T> operator% (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval %= rhs; + return retval; + } + template<class T> valarray<T> operator% (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval %= rhs; + return retval; + } + template<class T> valarray<T> operator% (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval %= rhs; + return retval; + } + template<class T> valarray<T> operator+ (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval += rhs; + return retval; + } + template<class T> valarray<T> operator+ (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval += rhs; + return retval; + } + template<class T> valarray<T> operator+ (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval += rhs; + return retval; + } + template<class T> valarray<T> operator- (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval -= rhs; + return retval; + } + template<class T> valarray<T> operator- (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval-= rhs; + return retval; + } + template<class T> valarray<T> operator- (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval -= rhs; + return retval; + } + template<class T> valarray<T> operator^ (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval ^= rhs; + return retval; + } + template<class T> valarray<T> operator^ (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval ^= rhs; + return retval; + } + template<class T> valarray<T> operator^ (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval ^= rhs; + return retval; + } + template<class T> valarray<T> operator& (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval &= rhs; + return retval; + } + template<class T> valarray<T> operator& (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval &= rhs; + return retval; + } + template<class T> valarray<T> operator& (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval &= rhs; + return retval; + } + template<class T> valarray<T> operator| (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval |= rhs; + return retval; + } + template<class T> valarray<T> operator| (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval |= rhs; + return retval; + } + template<class T> valarray<T> operator| (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval |= rhs; + return retval; + } + template<class T> valarray<T> operator<<(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval <<= rhs; + return retval; + } + template<class T> valarray<T> operator<<(const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval <<= rhs; + return retval; + } + template<class T> valarray<T> operator<<(const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval <<= rhs; + return retval; + } + template<class T> valarray<T> operator>>(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval >>= rhs; + return retval; + } + template<class T> valarray<T> operator>>(const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval >>= rhs; + return retval; + } + template<class T> valarray<T> operator>>(const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval >>= rhs; + return retval; + } + + template<class T> valarray<bool> operator&&(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs[i] && rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator&&(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] && rhs; + } + return retval; + } + template<class T> valarray<bool> operator&&(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs && rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator||(const valarray<T>&lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] || rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator||(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] || rhs; + } + return retval; + } + template<class T> valarray<bool> operator||(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs || rhs[i]; + } + return retval; + } + + template<class T> valarray<bool> operator==(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] == rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator==(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs[i] == rhs; + } + return retval; + } + template<class T> valarray<bool> operator==(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs == rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator!=(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] != rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator!=(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] != rhs; + } + return retval; + } + template<class T> valarray<bool> operator!=(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs != rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator< (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] < rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator< (const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] < rhs; + } + return retval; + } + template<class T> valarray<bool> operator< (const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs < rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator> (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] > rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator> (const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] > rhs; + } + return retval; + } + template<class T> valarray<bool> operator> (const T& rhs, const valarray<T>& lhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs > rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator<=(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] <= rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator<=(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] <= rhs; + } + return retval; + } + template<class T> valarray<bool> operator<=(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs <= rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator>=(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] >= rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator>=(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] >= rhs; + } + return retval; + } + template<class T> valarray<bool> operator>=(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs >= rhs[i]; + } + return retval; + } + template<class T> T min(const valarray<T>& x){ + T retval(x[0]); + for(size_t i = 1; i < x.size(); ++i){ + if(x[i] < retval){ + retval = x[i]; + } + } + } + template<class T> T max(const valarray<T>& x){ + T retval(x[0]); + for(size_t i = 1; i < x.size(); ++i){ + if(x[i] > retval){ + retval = x[i]; + } + } + } + + template<class T> valarray<T> abs (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = abs(x[i]); + } + } + template<class T> valarray<T> acos (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = acos(x[i]); + } + } + template<class T> valarray<T> asin (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = asin(x[i]); + } + } + template<class T> valarray<T> atan (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = atan(x[i]); + } + } + template<class T> valarray<T> atan2(const valarray<T>& y, const valarray<T>& x){ + valarray<T> retval(y.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = atan2(y[i], x[i]); + } + } + template<class T> valarray<T> atan2(const valarray<T>& y, const T& x){ + valarray<T> retval(y.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = atan2(y[i], x); + } + } + template<class T> valarray<T> atan2(const T& y, const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = abs(y, x[i]); + } + } + template<class T> valarray<T> cos (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = cos(x[i]); + } + } + template<class T> valarray<T> cosh (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = cosh(x[i]); + } + } + template<class T> valarray<T> exp (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = exp(x[i]); + } + } + template<class T> valarray<T> log (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = log(x[i]); + } + } + template<class T> valarray<T> log10(const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = log10(x[i]); + } + } + template<class T> valarray<T> pow (const valarray<T>& x, const valarray<T>& y){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = pow(x[i], y[i]); + } + } + template<class T> valarray<T> pow (const valarray<T>& x, const T& y){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = pow(x[i], y); + } + } + template<class T> valarray<T> pow (const T& x, const valarray<T>& y){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = pow(x, y[i]); + } + } + template<class T> valarray<T> sin (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = sin(x[i]); + } + } + template<class T> valarray<T> sinh (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = sinh(x[i]); + } + } + template<class T> valarray<T> sqrt (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = sqrt(x[i]); + } + } + template<class T> valarray<T> tan (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = tan(x[i]); + } + } + template<class T> valarray<T> tanh (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = tanh(x[i]); + } + } + +} + +#endif diff --git a/i386/modules/uClibcxx/include/.svn/text-base/vector.svn-base b/i386/modules/uClibcxx/include/.svn/text-base/vector.svn-base new file mode 100644 index 0000000..195ba96 --- /dev/null +++ b/i386/modules/uClibcxx/include/.svn/text-base/vector.svn-base @@ -0,0 +1,513 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <basic_definitions> +#include <memory> +#include <iterator> +#include <func_exception> +#include <algorithm> +#include <type_traits> + + +#ifndef __STD_HEADER_VECTOR +#define __STD_HEADER_VECTOR + +namespace std{ + + template <class T, class Allocator = allocator<T> > class vector; + template <class T, class Allocator> bool operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator< (const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator!=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator> (const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> void swap(vector<T,Allocator>& x, vector<T,Allocator>& y); + + template <class T, class Allocator> class _UCXXEXPORT vector { + public: + + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + + typedef T* iterator; + typedef const T* const_iterator; + typedef T value_type; + typedef Allocator allocator_type; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + + explicit _UCXXEXPORT vector(const Allocator& al= Allocator()): data(0), //defaultValue(T()), + data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al) + { + data = a.allocate(data_size); + } + + explicit _UCXXEXPORT vector(size_type n, const T& value = T(), const Allocator& al= Allocator()) : + data(0), data_size(0), elements(0), a(al) + { + data_size = n + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + + resize(n, value); + } + + template <class InputIterator> _UCXXEXPORT + vector(InputIterator first, InputIterator last, const Allocator& al = Allocator()): + data(0), data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al) + { + data = a.allocate(data_size); + assign(first, last); + } + + _UCXXEXPORT vector(const vector<T,Allocator>& x){ + a = x.a; + + elements = x.elements; + data_size = elements + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + + for(size_type i = 0; i < elements; i++){ + a.construct(data+i, x.data[i]); + } + } + + _UCXXEXPORT ~vector(); //Below + + _UCXXEXPORT vector<T,Allocator>& operator=(const vector<T,Allocator>& x){ + if(&x == this){ + return *this; + } + + reserve(x.elements); //Make sure that we have enough actual memory + + + //Copy as many elements as possible + + size_t minElements = elements; + if(minElements > x.elements){ + minElements = x.elements; + } + for(size_t i = 0; i < minElements; ++i){ + data[i] = x.data[i]; + } + + //If we need to add new elements + if(elements < x.elements){ + for(size_t i = elements; i< x.elements; ++i){ + a.construct(data+i, x.data[i]); + ++elements; + } + } + + if(elements > x.elements){ + downsize(x.elements); + } + + return *this; + } + + template <class InputIterator> _UCXXEXPORT void assign(InputIterator first, InputIterator last){ + clear(); + insert(begin(), first, last); + } + + template <class Size, class U> _UCXXEXPORT void assign(Size n, const U& u = U()){ + clear(); + resize(n, u); + } + + inline allocator_type get_allocator() const{ + return a; + } + + inline iterator begin(){ + return data; + } + + inline const_iterator begin() const{ + return data; + } + + inline iterator end(){ + return (data + elements); + } + + inline const_iterator end() const{ + return (data + elements); + } + + inline reverse_iterator rbegin(){ + return reverse_iterator(end()); + } + + inline const_reverse_iterator rbegin() const{ + return const_reverse_iterator(end()); + } + + inline reverse_iterator rend(){ + return reverse_iterator(begin()); + } + + inline const_reverse_iterator rend() const{ + return const_reverse_iterator(begin()); + } + + inline size_type size() const{ + return elements; + } + + _UCXXEXPORT size_type max_size() const{ + return ((size_type)(-1)) / sizeof(T); + } + + void downsize(size_type sz); + void resize(size_type sz, const T & c = T()); + + inline size_type capacity() const{ + return data_size; + } + + inline bool empty() const{ + return (size() == 0); + } + + void reserve(size_type n); + + inline reference operator[](size_type n){ + return data[n]; + } + + inline const_reference operator[](size_type n) const{ + return data[n]; + } + + _UCXXEXPORT const_reference at(size_type n) const{ + if(n >= elements){ + __throw_out_of_range("Invalid subscript"); + } + return data[n]; + } + + _UCXXEXPORT reference at(size_type n){ + if(n >= elements){ + __throw_out_of_range("Invalid subscript"); + } + return data[n]; + } + + inline reference front(){ + return data[0]; + } + + inline const_reference front() const{ + return data[0]; + } + + inline reference back(){ + return data[ size() - 1]; + } + + inline const_reference back() const{ + return data[ size() - 1 ]; + } + + inline void push_back(const T& x){ + resize( size() + 1, x); + } + + inline void pop_back(){ + downsize(size() - 1); + } + + _UCXXEXPORT iterator insert(iterator position, const T& x = T()){ + size_type index = position - data; + resize(size() + 1, x); + for(size_type i = elements - 1; i > index; --i){ + data[i] = data[i-1]; + } + data[index] = x; + return (data + index); + } + + _UCXXEXPORT void _insert_fill(iterator position, size_type n, const T & x){ + size_type index = position - data; + resize(size() + n, x); + + for(size_type i = elements -1; (i > (index+n-1)); --i){ + data[i] = data[i-n]; + } + for(size_type i = 0; i < n; i++){ + data[i + index] = x; + } + } + + template <class InputIterator> _UCXXEXPORT + void _insert_from_iterator(iterator position, InputIterator first, InputIterator last) + { + T temp; + while(first !=last){ + temp = *first; + position = insert(position, temp); + ++position; + ++first; + } + } + + template <class InputIterator> + inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, __true_type) + { + _insert_fill(position, first, last); + } + + template <class InputIterator> + inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, __false_type) + { + _insert_from_iterator(position, first, last); + } + + inline void insert(iterator position, size_type n, const T& x ){ + _insert_fill(position, n, x); + } + + template <class InputIterator> inline void insert(iterator position, InputIterator first, InputIterator last){ + typedef typename __is_integer<InputIterator>::value __some_type; + _dispatch_insert(position, first, last, __some_type()); + } + + _UCXXEXPORT iterator erase(iterator position){ + size_type index = position - data; + for(size_type i = index; i < (elements - 1); ++i){ + data[i] = data[i+1]; + } + downsize(size() - 1); + return (data + index); + } + + _UCXXEXPORT iterator erase(iterator first, iterator last){ + size_type index = first - data; + size_type width = last - first; + for(size_type i = index; i < (elements - width) ;++i){ + data[i] = data[i+width]; + } + downsize(size() - width); + return (data + index); + } + + _UCXXEXPORT void swap(vector<T,Allocator>& v){ + if(this == &v){ //Avoid dv.swap(v) + return; + } + T* ptr; + size_type temp; + + //Swap pointers first + ptr = data; + data = v.data; + v.data = ptr; + + //Swap element counts + temp = elements; + elements = v.elements; + v.elements = temp; + + //Swap data size + temp = data_size; + data_size = v.data_size; + v.data_size = temp; + } + + _UCXXEXPORT void clear(){ + downsize(0); + } + + protected: + T* data; + size_type data_size; + size_type elements; + Allocator a; + }; + + + + //Here go template instantiations + + template<class T, class Allocator> _UCXXEXPORT vector<T, Allocator>::~vector(){ + for(size_t i = 0; i < elements; ++i){ + a.destroy(data + i); + } + a.deallocate(data, data_size); + } + + + template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::reserve(size_type n){ + if(n > data_size){ //We never shrink... + T * temp_ptr = data; + size_type temp_size = data_size; + + data_size = n; + data = a.allocate(data_size); + + for(size_type i = 0; i<elements; ++i){ + a.construct(data+i, temp_ptr[i]); + a.destroy(temp_ptr+i); + } + a.deallocate(temp_ptr, temp_size); + } + } + + template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::resize(size_type sz, const T & c){ + if(sz > elements){ //Need to actually call constructor + if(sz > data_size){ + reserve(sz + __UCLIBCXX_STL_BUFFER_SIZE__); + } + + for(size_type i = elements; i<sz ; ++i){ + a.construct(data+i, c); + } + elements = sz; + }else{ + downsize(sz); + } + } + + template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::downsize(size_type sz){ + if(sz < elements){ //Actually are downsizing + for(size_t i = sz; i< elements; ++i){ + a.destroy(data+i); + } + elements = sz; + } + } + + +#ifndef __UCLIBCXX_COMPILE_VECTOR__ +#ifdef __UCLIBCXX_EXPAND_VECTOR_BASIC__ + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + + template<> _UCXXEXPORT vector<char, allocator<char> >::~vector(); + template<> _UCXXEXPORT vector<unsigned char, allocator<unsigned char> >::~vector(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template<> _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned char, allocator<unsigned char> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<short int, allocator<short int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned short int, allocator<unsigned short int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<int, allocator<int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<long int, allocator<long int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned long int, allocator<unsigned long int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<float, allocator<float> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<double, allocator<double> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<bool, allocator<bool> >::reserve(size_type n); + + template<> _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + template<> _UCXXEXPORT void + vector<unsigned char, allocator<unsigned char> >::resize(size_type sz, const unsigned char & c); + template<> _UCXXEXPORT void vector<short int, allocator<short int> >::resize(size_type sz, const short & c); + template<> _UCXXEXPORT void + vector<unsigned short int, allocator<unsigned short int> >::resize(size_type sz, const unsigned short int & c); + template<> _UCXXEXPORT void vector<int, allocator<int> >::resize(size_type sz, const int & c); + template<> _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::resize(size_type sz, const unsigned int & c); + template<> _UCXXEXPORT void vector<long int, allocator<long int> >::resize(size_type sz, const long int & c); + template<> _UCXXEXPORT void + vector<unsigned long int, allocator<unsigned long int> >::resize(size_type sz, const unsigned long int & c); + template<> _UCXXEXPORT void vector<float, allocator<float> >::resize(size_type sz, const float & c); + template<> _UCXXEXPORT void vector<double, allocator<double> >::resize(size_type sz, const double & c); + template<> _UCXXEXPORT void vector<bool, allocator<bool> >::resize(size_type sz, const bool & c); + +#elif defined __UCLIBCXX_EXPAND_STRING_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + template<> _UCXXEXPORT vector<char, allocator<char> >::~vector(); + +#endif + + template<> _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + +#endif +#endif + + + + template <class T, class Allocator> _UCXXEXPORT bool + operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + if(x.size() !=y.size() ){ + return false; + } + for(size_t i = 0; i < x.size(); ++i){ + if(x[i] != y[i]){ + return false; + } + } + return true; + } + + template <class T, class Allocator> _UCXXEXPORT bool + operator< (const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + less<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator!=(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + return !(x == y); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator> (const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + greater<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + greater_equal<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + less_equal<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + + template <class T, class Allocator> _UCXXEXPORT void swap(vector<T,Allocator>& x, vector<T,Allocator>& y){ + x.swap(y); + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/Makefile b/i386/modules/uClibcxx/include/Makefile new file mode 100644 index 0000000..b5c2694 --- /dev/null +++ b/i386/modules/uClibcxx/include/Makefile @@ -0,0 +1,13 @@ +TOPDIR=../ +include $(TOPDIR)Rules.mak + +all: + +clean: + +distclean: + +HEADERS = $(filter-out .svn CVS Makefile,$(wildcard *)) +install: + $(INSTALL) -d $(PREFIX)$(UCLIBCXX_RUNTIME_INCLUDEDIR) + $(INSTALL) -m 644 $(HEADERS) $(PREFIX)$(UCLIBCXX_RUNTIME_INCLUDEDIR) diff --git a/i386/modules/uClibcxx/include/algorithm b/i386/modules/uClibcxx/include/algorithm new file mode 100644 index 0000000..f6b8856 --- /dev/null +++ b/i386/modules/uClibcxx/include/algorithm @@ -0,0 +1,1691 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstdlib> +#include <iterator> +#include <utility> +#include <functional> + +#ifndef __STD_HEADER_ALGORITHM +#define __STD_HEADER_ALGORITHM 1 + +//Elliminate any previously defined macro +#undef min +#undef max + +namespace std{ + + // subclause _lib.alg.nonmodifying_, non-modifying sequence operations: + template<class InputIterator, class Function> _UCXXEXPORT + Function for_each(InputIterator first, InputIterator last, Function f) + { + while(first !=last){ + f(*first); + ++first; + } + return f; + } + + + template<class InputIterator, class T> _UCXXEXPORT + InputIterator find(InputIterator first, InputIterator last, const T& value) + { + while(first !=last && *first != value){ + ++first; + } + return first; + } + + template<class InputIterator, class Predicate> _UCXXEXPORT + InputIterator find_if(InputIterator first, InputIterator last, Predicate pred) + { + while(first !=last && !pred(*first)){ + ++first; + } + return first; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT ForwardIterator1 + find_end(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2) + { + ForwardIterator1 retval = last1; + while(first1 !=last1){ + ForwardIterator1 temp1(first1); + ForwardIterator2 temp2(first2); + while(temp2!=last2 && temp1!= last1){ + if(*temp1 != *temp2){ + break; //Exit while loop + } + ++temp1; + ++temp2; + if(temp2 == last2){ //Have successfully checked the whole sequence + retval = first1; + } + } + } + return retval; + } + + template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> _UCXXEXPORT + ForwardIterator1 + find_end(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + BinaryPredicate pred) + { + ForwardIterator1 retval = last1; + while(first1 !=last1){ + ForwardIterator1 temp1(first1); + ForwardIterator2 temp2(first2); + while(temp2!=last2 && temp1!= last1){ + if( ! pred(*temp1, *temp2)){ + break; //Exit while loop + } + ++temp1; + ++temp2; + if(temp2 == last2){ //Have successfully checked the whole sequence + retval = first1; + } + } + } + return retval; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + ForwardIterator1 + find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2) + { + while(first1 != last1){ + ForwardIterator2 temp2(first2); + while(temp2 != last2 ){ + if(*temp2 == first1){ + return first1; + } + ++temp2; + } + + } + return last1; + } + + template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> _UCXXEXPORT + ForwardIterator1 + find_first_of(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + BinaryPredicate pred) + { + while(first1 != last1){ + ForwardIterator2 temp2(first2); + while(temp2 != last2 ){ + if(*temp2 == first1){ + return first1; + } + ++temp2; + } + + } + return last1; + } + + template<class ForwardIterator> _UCXXEXPORT ForwardIterator + adjacent_find(ForwardIterator first, ForwardIterator last) + { + ForwardIterator temp; + while(first != last){ + temp = first; + ++temp; + if(*temp == *first){ + return first; + } + ++first; + } + return first; + } + + template<class ForwardIterator, class BinaryPredicate> _UCXXEXPORT + ForwardIterator + adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred) + { + ForwardIterator temp; + while(first != last){ + temp = first; + ++temp; + if( pred(*temp, *first)){ + return first; + } + ++first; + } + return first; + } + + template<class InputIterator, class T> _UCXXEXPORT + typename iterator_traits<InputIterator>::difference_type + count(InputIterator first, InputIterator last, const T& value) + { + typename iterator_traits<InputIterator>::difference_type i = 0; + while(first!=last){ + if(*first == value){ + ++i; + } + ++first; + } + return i; + } + + template<class InputIterator, class Predicate> _UCXXEXPORT + typename iterator_traits<InputIterator>::difference_type + count_if(InputIterator first, InputIterator last, Predicate pred) + { + typename iterator_traits<InputIterator>::difference_type i = 0; + while(first!=last){ + if( pred(*first) ){ + ++i; + } + ++first; + } + return i; + } + + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + pair<InputIterator1, InputIterator2> + mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) + { + while(first1 != last1){ + if(*first1 != *first2){ + break; + } + ++first1; + ++first2; + } + + pair<InputIterator1, InputIterator2> retval; + retval.first = first1; + retval.second = first2; + return retval; + } + + template<class InputIterator1, class InputIterator2, class BinaryPredicate> _UCXXEXPORT + pair<InputIterator1, InputIterator2> + mismatch(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, BinaryPredicate pred) + { + while(first1 != last1){ + if( !pred(*first1, *first2) ){ + break; + } + ++first1; + ++first2; + } + + pair<InputIterator1, InputIterator2> retval; + retval.first = first1; + retval.second = first2; + return retval; + } + + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + bool + equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) + { + while(first1 !=last1){ + if(*first1 != *first2){ + return false; + } + ++first1; + ++first2; + } + return true; + } + + template<class InputIterator1, class InputIterator2, class BinaryPredicate> _UCXXEXPORT + bool + equal(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, BinaryPredicate pred) + { + while(first1 !=last1){ + if( !pred(*first1, *first2) ){ + return false; + } + ++first1; + ++first2; + } + return true; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2) + { + equal_to<typename iterator_traits<ForwardIterator1>::value_type> c; + return search(first1, last1, first2, last2, c); + } + + + template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> _UCXXEXPORT + ForwardIterator1 + search(ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + BinaryPredicate pred) + { + while(first1 != last1){ + ForwardIterator1 temp1(first1); + ForwardIterator2 temp2(first2); + while(temp2 != last2 && temp1 != last1){ + if( !pred(*temp2, *temp1) ){ + break; + } + ++temp1; + ++temp2; + if(temp2 == last2){ + return first1; + } + } + ++first1; + } + return last1; + } + + + template<class ForwardIterator, class Size, class T> _UCXXEXPORT + ForwardIterator + search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value) + { + while( first != last ){ + if(*first == value){ + ForwardIterator temp(first); + Size i = 1; + ++first; //Avoid doing the same comparison over again + while(i < count && *temp == value){ + ++first; + ++i; + } + if(i == count){ + return first; + } + } + ++first; + } + return first; + } + + + template<class ForwardIterator, class Size, class T, class BinaryPredicate> _UCXXEXPORT + ForwardIterator + search_n(ForwardIterator first, ForwardIterator last, + Size count, const T& value, BinaryPredicate pred) + { + while( first != last ){ + if( pred(*first, value) ){ + ForwardIterator temp(first); + Size i = 1; + ++first; //Avoid doing the same comparison over again + while(i < count && pred(*temp, value) ){ + ++first; + ++i; + } + if(i == count){ + return first; + } + } + ++first; + } + return first; + + } + + // subclause _lib.alg.modifying.operations_, modifying sequence operations: + + template<class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + copy(InputIterator first, InputIterator last, OutputIterator result) + { + while(first != last){ + *result = *first; + ++first; + ++result; + } + return result; + } + + template<class BidirectionalIterator1, class BidirectionalIterator2> _UCXXEXPORT + BidirectionalIterator2 + copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, + BidirectionalIterator2 result) + { + while(first !=last ){ + --result; + --last; + *result = *last; + } + return result; + } + + template<class T> _UCXXEXPORT void swap(T& a, T& b){ + T temp(a); + a = b; + b = temp; + } + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + ForwardIterator2 + swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2) + { + while(first1 != last1){ + iter_swap(first1, first2); + ++first1; + ++first2; + } + return first2; + } + + + template<class ForwardIterator1, class ForwardIterator2> _UCXXEXPORT + void + iter_swap(ForwardIterator1 a, ForwardIterator2 b) + { + typename iterator_traits<ForwardIterator1>::value_type temp(*a); + *a = *b; + *b = temp; + } + + + template<class InputIterator, class OutputIterator, class UnaryOperation> _UCXXEXPORT + OutputIterator + transform(InputIterator first, InputIterator last, + OutputIterator result, UnaryOperation op) + { + while(first != last){ + *result = op(*first); + ++first; + ++result; + } + return result; + } + + + template<class InputIterator1, class InputIterator2, class OutputIterator, class BinaryOperation> _UCXXEXPORT + OutputIterator transform(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, OutputIterator result, + BinaryOperation binary_op) + { + while(first1 != last1){ + *result = binary_op(*first1, *first2); + ++first1; + ++first2; + ++result; + } + return result; + } + + + template<class ForwardIterator, class T> _UCXXEXPORT + void + replace(ForwardIterator first, ForwardIterator last, + const T& old_value, const T& new_value) + { + while(first != last){ + if(*first == old_value){ + *first = new_value; + } + ++first; + } + } + + template<class ForwardIterator, class Predicate, class T> _UCXXEXPORT + void + replace_if(ForwardIterator first, ForwardIterator last, + Predicate pred, const T& new_value) + { + while(first != last){ + if( pred(*first) ){ + *first = new_value; + } + ++first; + } + } + + + template<class InputIterator, class OutputIterator, class T> _UCXXEXPORT + OutputIterator + replace_copy(InputIterator first, InputIterator last, + OutputIterator result, const T& old_value, const T& new_value) + { + while(first != last){ + if(*first == old_value){ + *result = new_value; + }else{ + *result = *first; + } + ++first; + ++result; + } + return result; + } + + template<class Iterator, class OutputIterator, class Predicate, class T> _UCXXEXPORT + OutputIterator + replace_copy_if(Iterator first, Iterator last, + OutputIterator result, Predicate pred, const T& new_value) + { + while(first != last){ + if( pred(*first) ){ + *result = new_value; + }else{ + *result = *first; + } + ++first; + ++result; + } + return result; + } + + template<class ForwardIterator, class T> _UCXXEXPORT + void + fill(ForwardIterator first, ForwardIterator last, const T& value) + { + while(first != last){ + *first = value; + ++first; + } + } + + template<class OutputIterator, class Size, class T> _UCXXEXPORT + void + fill_n(OutputIterator first, Size n, const T& value) + { + while(n != 0){ + *first = value; + --n; + ++first; + } + } + + template<class ForwardIterator, class Generator> _UCXXEXPORT + void + generate(ForwardIterator first, ForwardIterator last, Generator gen) + { + while(first != last){ + *first = gen(); + ++first; + } + } + + template<class OutputIterator, class Size, class Generator> _UCXXEXPORT + void + generate_n(OutputIterator first, Size n, Generator gen) + { + while(n !=0){ + *first = gen(); + --n; + ++first; + } + } + + template<class ForwardIterator, class T> _UCXXEXPORT + ForwardIterator + remove(ForwardIterator first, ForwardIterator last, const T& value) + { + ForwardIterator temp(first); + while(temp !=last){ + if(*temp == value){ + + }else{ + *first = *temp; + ++first; + } + ++temp; + } + return first; + } + + template<class ForwardIterator, class Predicate> _UCXXEXPORT + ForwardIterator + remove_if(ForwardIterator first, ForwardIterator last, Predicate pred) + { + ForwardIterator temp(first); + while(temp !=last){ + if( pred(*temp) ){ + + }else{ + *first = *temp; + ++first; + } + ++temp; + } + return first; + } + + + template<class InputIterator, class OutputIterator, class T> _UCXXEXPORT + OutputIterator + remove_copy(InputIterator first, InputIterator last, + OutputIterator result, const T& value) + { + while(first !=last){ + if(*first != value){ + *result = *first; + ++result; + } + ++first; + } + return result; + } + + template<class InputIterator, class OutputIterator, class Predicate> _UCXXEXPORT + OutputIterator + remove_copy_if(InputIterator first, InputIterator last, + OutputIterator result, Predicate pred) + { + while(first !=last){ + if( !pred(*first) ){ + *result = *first; + ++result; + } + ++first; + } + return result; + } + + template<class ForwardIterator> _UCXXEXPORT + ForwardIterator + unique(ForwardIterator first, ForwardIterator last) + { + ForwardIterator new_val(first); + ForwardIterator old_val(first); + + while(new_val !=last){ + if(*new_val == *old_val && new_val != old_val){ + + }else{ + *first = *new_val; + old_val = new_val; + ++first; + } + ++new_val; + } + return first; + } + + template<class ForwardIterator, class BinaryPredicate> _UCXXEXPORT + ForwardIterator + unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred) + { + ForwardIterator new_val(first); + ForwardIterator old_val(first); + + while(new_val !=last){ + if( pred(*new_val, *old_val) && new_val != old_val){ + + }else{ + *first = *new_val; + old_val = new_val; + ++first; + } + ++new_val; + } + return first; + } + + template<class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + unique_copy(InputIterator first, InputIterator last, OutputIterator result) + { + InputIterator temp(first); + while(first !=last ){ + if(*first == *temp && first != temp){ + + }else{ + *result = *first; + temp = first; + ++result; + } + ++first; + } + return result; + } + + template<class InputIterator, class OutputIterator, class BinaryPredicate> _UCXXEXPORT + OutputIterator + unique_copy(InputIterator first, InputIterator last, + OutputIterator result, BinaryPredicate pred) + { + InputIterator temp(first); + while(first !=last ){ + if( pred(*first, *temp) && first != temp){ + + }else{ + *result = *first; + temp = first; + ++result; + } + ++first; + } + return result; + } + + template<class BidirectionalIterator> _UCXXEXPORT + void + reverse(BidirectionalIterator first, BidirectionalIterator last) + { + --last; //Don't work with one past the end element + while(first < last){ + iter_swap(first, last); + ++first; + --last; + } + } + + template<class BidirectionalIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + reverse_copy(BidirectionalIterator first, BidirectionalIterator last, + OutputIterator result) + { + while(last > first){ + --last; + *result = *last; + ++result; + } + return result; + } + + template<class ForwardIterator> _UCXXEXPORT + void + rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last) + { + if ((first == middle) || (last == middle)){ + return; + } + + ForwardIterator first2 = middle; + + do { + swap(*first, *first2); + first++; + first2++; + if(first == middle){ + middle = first2; + } + } while(first2 != last); + + first2 = middle; + + while (first2 != last) { + swap(*first, *first2); + first++; + first2++; + if (first == middle){ + middle = first2; + }else if (first2 == last){ + first2 = middle; + } + } + } + + template<class ForwardIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + rotate_copy(ForwardIterator first, ForwardIterator middle, + ForwardIterator last, OutputIterator result) + { + ForwardIterator temp(middle); + while(temp !=last){ + *result = *temp; + ++temp; + ++result; + } + while(first != middle){ + *result = *first; + ++first; + ++result; + } + return result; + } + + + template<class RandomAccessIterator> _UCXXEXPORT + void + random_shuffle(RandomAccessIterator first, RandomAccessIterator last) + { + --last; + while(first != last){ + iter_swap(first, (first + (rand() % (last - first) ) ) ); + ++first; + } + } + + template<class RandomAccessIterator, class RandomNumberGenerator> _UCXXEXPORT + void + random_shuffle(RandomAccessIterator first, RandomAccessIterator last, + RandomNumberGenerator& rand) + { + --last; + while(first != last){ + iter_swap(first, (first + (rand(last - first) ) ) ); + ++first; + } + } + + // _lib.alg.partitions_, partitions: + template<class BidirectionalIterator, class Predicate> _UCXXEXPORT BidirectionalIterator + partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred) + { + return stable_partition(first, last, pred); + } + + template<class BidirectionalIterator, class Predicate> _UCXXEXPORT BidirectionalIterator + stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred) + { + //first now points to the first non-desired element + while( first != last && pred(*first) ){ + ++first; + } + + BidirectionalIterator tempb; + BidirectionalIterator tempe = first; + + while( tempe != last ){ + //Find the next desired element + while( !pred(*tempe) ){ + ++tempe; + + //See if we should exit + if(tempe == last){ + return first; + } + } + + //Rotate the element back to the begining + tempb = tempe; + while(tempb != first){ + iter_swap(tempb, tempb-1 ); + --tempb; + } + //First now has a desired element + ++first; + } + + return first; + } + + template<class RandomAccessIterator> _UCXXEXPORT + void sort(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + sort(first, last, c ); + } + + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + stable_sort(first, last, comp); + } + + template<class RandomAccessIterator> _UCXXEXPORT + void stable_sort(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + stable_sort(first, last, c); + } + + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + //FIXME - bubble sort + RandomAccessIterator temp; + --last; + while(last - first > 0){ + temp = last; + while(temp != first){ + if( comp( *temp, *(temp-1) ) ){ + iter_swap( temp-1, temp); + } + --temp; + } + ++first; + } + } + + template<class RandomAccessIterator> _UCXXEXPORT + void partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + partial_sort(first, middle, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void partial_sort(RandomAccessIterator first, RandomAccessIterator middle, + RandomAccessIterator last, Compare comp) + { + //Fixme - partial bubble sort + RandomAccessIterator temp; + --last; + while(first < middle){ + temp = last; + while(temp != first){ + if( comp(*temp, *(temp -1 ) ) ) { + iter_swap( temp-1, temp); + } + --temp; + } + ++first; + } + } + template<class InputIterator, class RandomAccessIterator> _UCXXEXPORT + RandomAccessIterator + partial_sort_copy(InputIterator first, InputIterator last, + RandomAccessIterator result_first, RandomAccessIterator result_last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + return partial_sort_copy(first, last, result_first, result_last, c); + } + template<class InputIterator, class RandomAccessIterator, class Compare> _UCXXEXPORT + RandomAccessIterator + partial_sort_copy(InputIterator first, InputIterator last, + RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp) + { + size_t output_size = last-first; + size_t temp_size = result_last - result_first; + if(temp_size < output_size){ + output_size = temp_size; + } + + RandomAccessIterator middle = result_first + output_size; + RandomAccessIterator temp = result_first; + + while(temp != middle){ + *temp = *first; + ++temp; + ++first; + } + sort(result_first, middle, comp); + + while( first != last){ + if( comp( *first, *(middle-1) ) ){ + *(middle-1) = *first; + sort(result_first, middle, comp); + } + ++first; + } + + return middle; + } + template<class RandomAccessIterator> _UCXXEXPORT + void nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + nth_element(first, nth, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void nth_element(RandomAccessIterator first, RandomAccessIterator nth, + RandomAccessIterator last, Compare comp) + { + partial_sort(first, nth, last, comp); + } + + template<class ForwardIterator, class T> _UCXXEXPORT + ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, + const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return lower_bound(first, last, value, c); + } + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, + const T& value, Compare comp) + { + if(first == last){ + return last; + } + //If below or equal to the first element + if( comp(*first, value) == false){ + return first; + } + ForwardIterator middle; + + //If greater than the top element + middle = first; + advance(middle, distance(first, last) - 1); + if( comp(*middle, value) ){ + return last; + } + + //Now begin the actual search for the begining + while( distance(first, last) > 1 ){ + //Find middle + middle = first; + advance(middle, (distance(first, last)/2) ); + if( !comp(*middle, value) ){ + last = middle; + }else{ + first = middle; + } + } + + if( !comp(*first, value) ){ + return first; + } + return last; + } + + template<class ForwardIterator, class T> _UCXXEXPORT + ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, + const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return upper_bound(first, last, value, c); + } + + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, + const T& value, Compare comp) + { + if(first == last){ + return last; + } + //If below the first element + if( comp(value, *first) == true){ + return first; + } + + ForwardIterator middle; + + //If greater than the top element + middle = first; + advance(middle, distance(first, last) - 1); + if( comp(*middle, value) ){ + return last; + } + + //Now begin the actual search for the end + while( distance(first, last) > 1 ){ + //Find middle + middle = first; + advance(middle, (distance(first, last)/2) ); + if( comp(value, *middle) ){ + last = middle; + }else{ + first = middle; + } + } + + if( comp(value, *first) ){ + return first; + } + return last; + } + + + template<class ForwardIterator, class T> _UCXXEXPORT + pair<ForwardIterator, ForwardIterator> + equal_range(ForwardIterator first, ForwardIterator last, const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return equal_range(first, last, value, c); + } + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + pair<ForwardIterator, ForwardIterator> + equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp) + { + pair<ForwardIterator, ForwardIterator> retval; + retval.first = lower_bound(first, last, value, comp); + //Reuse retval.first in order to (possibly) save a few comparisons + retval.second = upper_bound(retval.first, last, value, comp); + return retval; + + } + + template<class ForwardIterator, class T> _UCXXEXPORT + bool binary_search(ForwardIterator first, ForwardIterator last, + const T& value) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return binary_search(first, last, value, c); + } + + template<class ForwardIterator, class T, class Compare> _UCXXEXPORT + bool binary_search(ForwardIterator first, ForwardIterator last, + const T& value, Compare comp) + { + if( distance(first, last) == 0){ + return false; + } + + ForwardIterator middle; + + while( distance(first, last) > 1 ){ + //Set middle between first and last + middle = first; + advance(middle, distance(first, last)/2 ); + + if( comp(*middle, value ) == true){ + first = middle; + }else{ + last = middle; + } + } + + if( !comp(*first, value) && !comp(value, *first) ){ + return true; + } + if( !comp(*last, value) && !comp(value, *last) ){ + return true; + } + + return false; + } + + // _lib.alg.merge_, merge: + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator + merge(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return merge(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator + merge(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + //If in this order so first1 elements which are equal come first + if( comp(*first2, *first1) ){ + *result = *first2; + ++first2; + }else{ + *result = *first1; + ++first1; + } + ++result; + } + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++first1; + ++result; + } + while(first2 != last2){ + *result = *first2; + ++first2; + ++result; + } + return result; + } + template<class BidirectionalIterator> _UCXXEXPORT + void inplace_merge(BidirectionalIterator first, + BidirectionalIterator middle, BidirectionalIterator last) + { + less<typename iterator_traits<BidirectionalIterator>::value_type> c; + inplace_merge(first, middle, last, c); + } + template<class BidirectionalIterator, class Compare> _UCXXEXPORT + void inplace_merge(BidirectionalIterator first, + BidirectionalIterator middle, BidirectionalIterator last, Compare comp) + { + //FIXME - using a bubble exchange method + while(first != middle && middle !=last){ + if( comp(*middle, *first) ){ + BidirectionalIterator temp(middle); + while( temp != first){ + iter_swap(temp, temp-1); + --temp; + } + ++middle; + } + ++first; + } + } + + // _lib.alg.set.operations_, set operations: + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + bool includes(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return includes(first1, last1, first2, last2, c ); + } + + template<class InputIterator1, class InputIterator2, class Compare> _UCXXEXPORT + bool includes(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, Compare comp) + { + while(first2 != last2){ + //Advance the large set until no longer smaller than the element we are looking for + while( comp(*first1, *first2) ){ + ++first1; + //If we are at the end of the list, we don't have the desired element + if(first1 == last1){ + return false; + } + } + //If we are past the element we want, it isn't here + if( comp(*first2, *first1) ){ + return false; + } + ++first2; //Move to next element + } + return true; + } + + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_union(first1, last1, first2, last2, result, c); + } + + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first2, *first1) ){ + *result = *first2; + + //Elliminate duplicates + InputIterator2 temp = first2; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + }else{ + *result = *first1; + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + ++result; + } + + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + } + + while(first2 != last2){ + *result = *first2; + ++result; + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + return result; + } + + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_intersection(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_intersection(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first2, *first1) ){ + ++first2; + }else if( comp(*first1, *first2) ) { + ++first1; + }else{ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + ++first2; + } + } + return result; + } + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_difference(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first1, *first2) ){ + *result = *first1; + ++result; + + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + }else if( comp(*first2, *first1) ){ + + //Elliminate duplicates + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + + }else{ //They are identical - skip + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + } + + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + } + + return result; + } + template<class InputIterator1, class InputIterator2, class OutputIterator> _UCXXEXPORT + OutputIterator set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return set_symmetric_difference(first1, last1, first2, last2, result, c); + } + template<class InputIterator1, class InputIterator2, class OutputIterator, class Compare> _UCXXEXPORT + OutputIterator set_symmetric_difference(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp) + { + while( first1 != last1 && first2 != last2){ + if( comp(*first1, *first2) ){ + *result = *first1; + ++result; + + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + }else if( comp(*first2, *first1) ){ + *result = *first2; + ++result; + + //Elliminate duplicates + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + + }else{ //They are identical - skip + //Elliminate duplicates + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + } + + //Clean up remaining elements + while(first1 != last1){ + *result = *first1; + ++result; + InputIterator1 temp = first1; + while( first1 != last1 && !comp( *temp, *first1) ){ + ++first1; + } + } + + while(first2 != last2){ + *result = *first2; + ++result; + InputIterator2 temp = first2; + while( first2 != last2 && !comp( *temp, *first2) ){ + ++first2; + } + } + + return result; + } + + // _lib.alg.heap.operations_, heap operations: + + template<class RandomAccessIterator> _UCXXEXPORT + void push_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + push_heap(first, last, c); + } + + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + // *(last - 1) is the last element + RandomAccessIterator begin, middle, end; + begin = first; + end = last - 2; + if(last - first < 2){ //Empty heap + return; + } + if ( comp(*(last-1), *end) ){ //Belongs past the end - already in place + return; + } + while(end - begin > 1){ + middle = begin + ((end - begin)/2); + if( comp(*middle, *(last-1) ) ){ + end = middle; + }else{ + begin = middle; + } + } + + if( comp(*begin, *(last-1)) ){ + middle = begin; + }else{ + middle = end; + } + + //Now all we do is swap the elements up to the begining + --last; + + while(last > middle){ + iter_swap(last, last-1); + --last; + } + } + + template<class RandomAccessIterator> _UCXXEXPORT + void pop_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + pop_heap(first, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare) + { + --last; + while(first < last){ + iter_swap( first, first+1); + ++first; + } + } + + template<class RandomAccessIterator> _UCXXEXPORT + void make_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + make_heap(first, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + sort( reverse_iterator<RandomAccessIterator>(last), reverse_iterator<RandomAccessIterator>(first), comp); + } + template<class RandomAccessIterator> _UCXXEXPORT + void sort_heap(RandomAccessIterator first, RandomAccessIterator last) + { + less<typename iterator_traits<RandomAccessIterator>::value_type> c; + sort_heap(first, last, c); + } + template<class RandomAccessIterator, class Compare> _UCXXEXPORT + void sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) + { + sort( first, last, comp); + } + + + // _lib.alg.min.max_, minimum and maximum: + template<class T> _UCXXEXPORT + const T& min(const T& a, const T& b) + { + if(b < a){ + return b; + } + return a; + } + + template<class T, class Compare> _UCXXEXPORT + const T& min(const T& a, const T& b, Compare comp) + { + if( comp(b, a) == true){ + return b; + } + return a; + } + + template<class T> _UCXXEXPORT + const T& max(const T& a, const T& b) + { + if( a < b){ + return b; + } + return a; + } + + template<class T, class Compare> _UCXXEXPORT + const T& max(const T& a, const T& b, Compare comp) + { + if( comp(a, b) ){ + return b; + } + return a; + } + + template<class ForwardIterator> _UCXXEXPORT + ForwardIterator min_element(ForwardIterator first, ForwardIterator last) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return min_element(first, last, c); + } + + template<class ForwardIterator, class Compare> _UCXXEXPORT + ForwardIterator min_element(ForwardIterator first, ForwardIterator last, Compare comp) + { + ForwardIterator retval = first; + ++first; + while(first != last){ + if( comp( *first, *retval) ){ + retval = first; + } + ++first; + } + return retval; + } + + template<class ForwardIterator> _UCXXEXPORT + ForwardIterator max_element(ForwardIterator first, ForwardIterator last) + { + less<typename iterator_traits<ForwardIterator>::value_type> c; + return max_element(first, last, c); + } + + template<class ForwardIterator, class Compare> _UCXXEXPORT + ForwardIterator max_element(ForwardIterator first, ForwardIterator last, Compare comp) + { + ForwardIterator retval = first; + ++first; + while(first != last){ + if( comp( *retval, *first ) ){ + retval = first; + } + ++first; + } + return retval; + } + + template<class InputIterator1, class InputIterator2> _UCXXEXPORT + bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2) + { + less<typename iterator_traits<InputIterator1>::value_type> c; + return lexicographical_compare(first1, last1, first2, last2, c); + } + + template<class InputIterator1, class InputIterator2, class Compare> _UCXXEXPORT + bool lexicographical_compare(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, Compare comp) + { + while(first1 != last1 && first2 != last2){ + if( comp(*first1, *first2) ){ + return true; + } + if( comp(*first2, *first1) ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + // _lib.alg.permutation.generators_, permutations + template<class BidirectionalIterator> _UCXXEXPORT + bool next_permutation(BidirectionalIterator first, BidirectionalIterator last) + { + less<typename iterator_traits<BidirectionalIterator>::value_type> c; + return next_permutation(first, last, c); + } + + template<class BidirectionalIterator, class Compare> _UCXXEXPORT + bool next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp) + { + if(first == last){ + return false; // No data + } + BidirectionalIterator i = last; + --i; + if(i == first){ + return false; //Only one element + } + BidirectionalIterator ii = i; + --ii; + //If the last two items are in order, swap them and call it done + if( comp(*ii, *i) ){ + iter_swap(ii, i); + return true; + } + + + //This part of the algorithm copied from G++ header files ver. 3.4.2 + i = last; + --i; + for(;;){ + ii = i; + --i; + if ( comp(*i, *ii) ){ + BidirectionalIterator j = last; + --j; + while ( !comp(*i, *j)){ + --j; + } + iter_swap(i, j); + reverse(ii, last); + return true; + } + if (i == first){ + reverse(first, last); + return false; + } + } + + + } + + template<class BidirectionalIterator> _UCXXEXPORT + bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last) + { + less<typename iterator_traits<BidirectionalIterator>::value_type> c; + return prev_permutation(first, last, c); + } + + template<class BidirectionalIterator, class Compare> _UCXXEXPORT + bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp) + { + if(first == last){ + return false; // No data + } + BidirectionalIterator i = last; + --i; + if(i == first){ + return false; //Only one element + } + BidirectionalIterator ii = i; + --ii; + //If the last two items are in reverse order, swap them and call it done + if( comp(*i, *ii) ){ + iter_swap(ii, i); + return true; + } + + //Copied from GNU GCC header files version 3.4.2 + i = last; + --i; + + for(;;){ + ii = i; + --i; + if ( comp(*ii, *i)){ + BidirectionalIterator j = last; + --j; + while ( !comp(*j, *i)){ + --j; + } + iter_swap(i, j); + reverse(ii, last); + return true; + } + if (i == first){ + reverse(first, last); + return false; + } + } + + } + +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/associative_base b/i386/modules/uClibcxx/include/associative_base new file mode 100644 index 0000000..93d545a --- /dev/null +++ b/i386/modules/uClibcxx/include/associative_base @@ -0,0 +1,639 @@ +/* Copyright (C) 2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include<functional> +#include<list> + + +#ifndef __STD_HEADER_ASSOCIATIVE_BASE +#define __STD_HEADER_ASSOCIATIVE_BASE + +namespace std{ + + +/* + * The basic premis here is that most of the code used by map, multimap, set and + * multiset is really common. There are a number of interface additions, and + * considerations about how to address multiple enteries with the same key. + * The goal is that the code tree/storage code should be here, and managing + * single or moultiple counts will be loeft to subclasses. + * Yes, inheritence for the purpose of code sharing is usually a bad idea. However, + * since our goal is to reduce tht total amount of code written and the overall binary + * size, this seems to be the best approach possible. + */ + +template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __base_associative; +template<class ValueType, class Compare, class Allocator> class _associative_iter; +template<class ValueType, class Compare, class Allocator> class _associative_citer; + +template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __single_associative; +template<class Key, class ValueType, class Compare = less<Key>, class Allocator = allocator<ValueType> > class __multi_associative; + +template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __base_associative{ + +protected: + +public: + typedef Key key_type; + typedef ValueType value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef __base_associative<Key, ValueType, Compare, Allocator> associative_type; + + typedef _associative_iter<value_type, Compare, Allocator> iterator; + typedef _associative_citer<value_type, Compare, Allocator> const_iterator; + typedef typename std::reverse_iterator<iterator> reverse_iterator; + typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator; + + + explicit __base_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type)) + : c(comp), value_to_key(v_to_k) { } +protected: + __base_associative(const associative_type& x) + : c(x.c), backing(x.backing), value_to_key(x.value_to_key) { } + +public: + ~__base_associative(){ + } + + bool empty() const{ + return backing.empty(); + } + size_type size() const{ + return backing.size(); + } + size_type max_size() const{ + return backing.max_size(); + } + + iterator begin(){ + return iterator(backing.begin()); + } + + const_iterator begin() const{ + return const_iterator(backing.begin()); + } + + iterator end() { + return iterator(backing.end()); + } + + const_iterator end() const{ + return const_iterator(backing.end()); + } + + reverse_iterator rbegin(){ + return reverse_iterator(end()); + } + + const_reverse_iterator rbegin() const{ + return const_reverse_iterator(end()); + } + + reverse_iterator rend(){ + return reverse_iterator(begin()); + } + + const_reverse_iterator rend() const{ + return const_reverse_iterator(begin()); + } + + + iterator lower_bound(const key_type &x); + const_iterator lower_bound(const key_type &x) const; + iterator upper_bound(const key_type &x); + const_iterator upper_bound(const key_type &x) const; + + pair<iterator,iterator> equal_range(const key_type& x){ + pair<iterator, iterator> retval; + retval.first = lower_bound(x); + retval.second = retval.first; + while(retval.second != end() && !c(x, value_to_key(*retval.second))){ + ++retval.second; + } + return retval; + } + pair<const_iterator,const_iterator> equal_range(const key_type& x) const{ + pair<const_iterator, const_iterator> retval; + retval.first = lower_bound(x); + retval.second = retval.first; + while(retval.second != end() && !c(x, value_to_key(*retval.second))){ + ++retval.second; + } + return retval; + } + + iterator find(const key_type& x){ + iterator retval = lower_bound(x); + if(retval == end()){ + return retval; + } + if(c(x, value_to_key(*retval))){ + return end(); + } + return retval; + } + const_iterator find(const key_type& x) const{ + const_iterator retval = lower_bound(x); + if(retval == end()){ + return retval; + } + if(c(x, value_to_key(*retval))){ + return end(); + } + return retval; + } + size_type count(const key_type& x) const{ + size_type retval(0); + const_iterator first = lower_bound(x); + while(first != end() && !c(x, value_to_key(*first))){ + ++retval; + ++first; + } + return retval; + } + + void clear(){ + backing.clear(); + } + + void erase(iterator pos){ + backing.erase(pos.base_iterator()); + } + size_type erase(const key_type& x){ + size_type count(0); + iterator start = lower_bound(x); + iterator end = upper_bound(x); + while(start != end){ + start = backing.erase(start.base_iterator()); + ++count; + } + return count; + } + void erase(iterator first, iterator last){ + while(first != last){ + backing.erase(first.base_iterator()); + ++first; + } + } + + key_compare key_comp() const{ + return c; + } + + __base_associative &operator=(const __base_associative & x){ + c = x.c; + backing = x.backing; + value_to_key = x.value_to_key; + return *this; + } + bool operator==(const __base_associative & x){ + return x.backing == backing; + } + bool operator!=(const __base_associative & x){ + return !(x.backing == backing); + } + +protected: + void swap(__base_associative & x); + + Compare c; + std::list<value_type> backing; + + const key_type (*value_to_key)(const value_type); + +}; + + +/* + * Tree interators for the base associative class + */ + +template<class ValueType, class Compare, class Allocator> class _associative_citer + : public std::iterator< + bidirectional_iterator_tag, + ValueType, + typename Allocator::difference_type, + ValueType*, + ValueType& + > +{ +protected: + typedef std::list<ValueType> listtype; + + typename listtype::const_iterator base_iter; + friend class _associative_iter<ValueType, Compare, Allocator>; +public: + _associative_citer() { } + _associative_citer(const _associative_citer & m) + : base_iter(m.base_iter) { } + _associative_citer(const typename listtype::const_iterator & m) + : base_iter(m) { } + ~_associative_citer() { } + ValueType operator*() const{ + return *base_iter; + } + const ValueType * operator->() const{ + return &(*base_iter); + } + _associative_citer & operator=(const _associative_citer & m){ + base_iter = m.base_iter; + return *this; + } + bool operator==(const _associative_citer & m) const{ + return m.base_iter == base_iter; + } + bool operator!=(const _associative_citer & m) const{ + return m.base_iter != base_iter; + } + _associative_citer & operator++(){ + ++base_iter; + return *this; + } + _associative_citer operator++(int){ + //The following approach ensures that we only need to + //provide code for ++ in one place (above) + _associative_citer temp(base_iter); + ++base_iter; + return temp; + } + _associative_citer & operator--(){ + --base_iter; + return *this; + } + _associative_citer operator--(int){ + //The following approach ensures that we only need to + //provide code for -- in one place (above) + _associative_citer temp(base_iter); + --base_iter; + return temp; + } + + //This is an implementation-defined function designed to make internals work correctly + typename listtype::const_iterator base_iterator(){ + return base_iter; + } + +}; + + +template<class ValueType, class Compare, class Allocator> class _associative_iter + : public std::iterator< + bidirectional_iterator_tag, + ValueType, + typename Allocator::difference_type, + ValueType*, + ValueType& + > +{ +protected: + typedef std::list<ValueType> listtype; + + typename listtype::iterator base_iter; + typedef _associative_citer<ValueType, Compare, Allocator> _associative_citer; + + +public: + _associative_iter() { } + _associative_iter(const _associative_iter & m) + : base_iter(m.base_iter) { } + _associative_iter(const typename listtype::iterator & m) + : base_iter(m) { } + ~_associative_iter() { } + const ValueType & operator*() const{ + return *base_iter; + } + ValueType & operator*(){ + return *base_iter; + } + ValueType * operator->(){ + return &(*base_iter); + } + const ValueType * operator->() const{ + return &(*base_iter); + } + _associative_iter & operator=(const _associative_iter & m){ + base_iter = m.base_iter; + return *this; + } + bool operator==(const _associative_iter & m) const{ + return m.base_iter == base_iter; + } + bool operator==(const _associative_citer & m) const{ + return m.base_iter == base_iter; + } + bool operator!=(const _associative_iter & m) const{ + return m.base_iter != base_iter; + } + bool operator!=(const _associative_citer & m) const{ + return m.base_iter != base_iter; + } + _associative_iter & operator++(){ + ++base_iter; + return *this; + } + _associative_iter operator++(int){ + //The following approach ensures that we only need to + //provide code for ++ in one place (above) + _associative_iter temp(base_iter); + ++base_iter; + return temp; + } + _associative_iter & operator--(){ + --base_iter; + return *this; + } + _associative_iter operator--(int){ + //The following approach ensures that we only need to + //provide code for -- in one place (above) + _associative_iter temp(base_iter); + --base_iter; + return temp; + } + operator _associative_citer() const{ + return _associative_citer(base_iter); + } + typename listtype::iterator base_iterator(){ + return base_iter; + } + const typename listtype::iterator base_iterator() const{ + return base_iter; + } + +}; + + + // The lower_bound code is really crappy linear search. However, it is a dead + // simple implimentation (easy to audit). It can also be easily replaced. + + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::iterator + __base_associative<Key, ValueType, Compare, Allocator>::lower_bound(const key_type &x) + { + iterator retval = begin(); + while(retval != end() && c(value_to_key(*retval), x)){ + ++retval; + } + return retval; + } + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::const_iterator + __base_associative<Key, ValueType, Compare, Allocator>::lower_bound(const key_type &x) const + { + const_iterator retval = begin(); + while(retval != end() && c(value_to_key(*retval), x)){ + ++retval; + } + return retval; + } + + // Upper bound search is linear from the point of lower_bound. This is likely the best solution + // in all but the most pathalogical of cases. + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::iterator + __base_associative<Key, ValueType, Compare, Allocator>::upper_bound(const key_type &x) + { + iterator retval = lower_bound(x); + while(retval != end() && !c(x, value_to_key(*retval))){ + ++retval; + } + return retval; + } + + template <class Key, class ValueType, class Compare, class Allocator> + typename __base_associative<Key, ValueType, Compare, Allocator>::const_iterator + __base_associative<Key, ValueType, Compare, Allocator>::upper_bound(const key_type &x) const + { + const_iterator retval = begin(); + while(retval != end() && !c(x, value_to_key(*retval))){ + ++retval; + } + return retval; + } + + + template <class Key, class ValueType, class Compare, class Allocator> + void __base_associative<Key, ValueType, Compare, Allocator>::swap(__base_associative<Key, ValueType, Compare, Allocator>& m) + { + Compare n = c; + c = m.c; + m.c = n; + + m.backing.swap(backing); + } + + +template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __single_associative : + public __base_associative<Key, ValueType, Compare, Allocator> +{ +protected: + typedef __base_associative<Key, ValueType, Compare, Allocator> base; + using base::backing; + + using base::c; + +public: + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + using base::operator=; + using base::operator==; + using base::operator!=; + + explicit __single_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type)) + : base(comp, A, v_to_k) { } + + template <class InputIterator> __single_associative( + InputIterator first, + InputIterator last, + const Compare& comp, + const Allocator& A, + const key_type (*v_to_k)(const value_type) + ) : base(comp, A, v_to_k) { + insert(first, last); + } + + pair<iterator, bool> insert(const value_type& x){ + pair<iterator, bool> retval; + iterator location = lower_bound(this->value_to_key(x)); + retval.second = true; + //Empty list or need to insert at end + if(end() == location){ + backing.push_back(x); + retval.first = --(end()); + return retval; + } + //Something in the list + if(c(this->value_to_key(x), this->value_to_key(*location))){ + location = backing.insert(location.base_iterator(), x); + retval.first = location; + }else{ + retval.second = false; + retval.first = location; + } + return retval; + } + + iterator insert(iterator position, const value_type& x){ + // FIXME - this is cheeting and probably should be more efficient since we are + // now log(n) to find for inserts + return insert(x).first; + } + + template <class InputIterator> void insert(InputIterator first, InputIterator last){ + while(first != last){ + insert(*first); + ++first; + } + } + +}; + + +template<class Key, class ValueType, class Compare, class Allocator> class _UCXXEXPORT __multi_associative : + public __base_associative<Key, ValueType, Compare, Allocator> +{ +protected: + typedef __base_associative<Key, ValueType, Compare, Allocator> base; + using base::backing; + + using base::c; + +public: + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + using base::operator=; + using base::operator==; + + + explicit __multi_associative(const Compare& comp, const Allocator& A, const key_type (*v_to_k)(const value_type)) + : base(comp, A, v_to_k) { } + + template <class InputIterator> __multi_associative( + InputIterator first, + InputIterator last, + const Compare& comp, + const Allocator& A, + const key_type (*v_to_k)(const value_type) + ) : base(comp, A, v_to_k) { + insert(first, last); + } + + iterator insert(const value_type& x){ + iterator location = lower_bound(value_to_key(x)); + + if(location == begin()){ + backing.push_front(x); + location = begin(); + }else{ + location = backing.insert(location.base_iterator(), x); + } + return location; + } + + iterator insert(iterator position, const value_type& x){ + // FIXME - this is cheeting and probably should be more efficient since we are + // now log(n) to find for inserts + return insert(x); + } + + template <class InputIterator> void insert(InputIterator first, InputIterator last){ + while(first != last){ + insert(*first); + ++first; + } + } +}; + + + + +} + +#endif //__STD_HEADER_ASSOCIATIVE_BASE + + diff --git a/i386/modules/uClibcxx/include/basic_definitions b/i386/modules/uClibcxx/include/basic_definitions new file mode 100644 index 0000000..dd8adad --- /dev/null +++ b/i386/modules/uClibcxx/include/basic_definitions @@ -0,0 +1,62 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __BASIC_DEFINITIONS +#define __BASIC_DEFINITIONS 1 + +#include <system_configuration.h> + +//The following is used to support GCC symbol visibility patch + +#ifdef GCC_HASCLASSVISIBILITY + #define _UCXXEXPORT __attribute__ ((visibility("default"))) + #define _UCXXLOCAL __attribute__ ((visibility("hidden"))) +#else + #define _UCXXEXPORT + #define _UCXXLOCAL + +#endif + +#ifdef __GCC__ +#define __UCLIBCXX_NORETURN __attribute__ ((__noreturn__)) +#else +#define __UCLIBCXX_NORETURN +#endif + +#ifdef __UCLIBCXX_HAS_TLS__ + #define __UCLIBCXX_TLS __thread +#else + #define __UCLIBCXX_TLS +#endif + + + +//Testing purposes +#define __STRING_MAX_UNITS 65535 + +namespace std{ + typedef signed long int streamsize; +} + +#endif + + +#ifdef __DODEBUG__ + #define UCLIBCXX_DEBUG 1 +#else + #define UCLIBCXX_DEBUG 0 +#endif diff --git a/i386/modules/uClibcxx/include/bitset b/i386/modules/uClibcxx/include/bitset new file mode 100644 index 0000000..192ed81 --- /dev/null +++ b/i386/modules/uClibcxx/include/bitset @@ -0,0 +1,419 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <climits> +#include <func_exception> +#include <string> +#include <iosfwd> + +#ifndef __STD_BITSET_HEADER +#define __STD_BITSET_HEADER 1 + +namespace std{ + template <size_t N> class bitset; + + + template <size_t N> bitset<N> operator&(const bitset<N>&, const bitset<N>&); + template <size_t N> bitset<N> operator|(const bitset<N>&, const bitset<N>&); + template <size_t N> bitset<N> operator^(const bitset<N>&, const bitset<N>&); + template <class charT, class traits, size_t N> basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, bitset<N>& x); + + template <class charT, class traits, size_t N> basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x); + + //Actual Code + + + template<size_t N> class _UCXXEXPORT bitset { + private: + //Number of characters allocated to hold the bits + static const size_t WORD_SIZE = CHAR_BIT; //Use int maybe? + static const size_t num_bytes = (N + WORD_SIZE - 1) / WORD_SIZE; + + //From the bit number, figure out which byte we are working with + size_t byte_num(size_t bit_num) const{ + if(WORD_SIZE == 8){ + return (bit_num >> 3); + } + if(WORD_SIZE == 16){ + return (bit_num >> 4); + } + if(WORD_SIZE == 32){ + return (bit_num >> 5); + } + if(WORD_SIZE == 64){ + return (bit_num >> 6); + } + return bit_num / WORD_SIZE; + } + //From the bit number, figure out which bit inside the byte we need + size_t bit_num(const size_t bit_num) const{ + return bit_num % WORD_SIZE; + } + + + //Point to the actual data + char data[num_bytes]; + public: + + class _UCXXEXPORT reference { + friend class bitset; + reference() : bit_num(0), parent(0) { } + size_t bit_num; + bitset * parent; + public: + ~reference() { } + reference& operator=(bool x){ // for b[i] = x; + parent->set(bit_num, x); + return *this; + } + reference& operator=(const reference& x){ // for b[i] = b[j]; + parent->set(bit_num, x); + return *this; + } + bool operator~() const{ // flips the bit + return !parent->test(bit_num); + } + operator bool() const{ // for x = b[i]; + return parent->test(bit_num); + } + reference& flip(){ // for b[i].flip(); + parent->flip(bit_num); + return *this; + } + }; + + bitset(){ + reset(); + } + bitset(unsigned long val){ + reset(); + size_t count = sizeof(val) * CHAR_BIT; + if(count > N){ + count = N; + } + for(size_t i = 0; i < count; ++i){ + set(i, ((val >> i) & 1)); + } + } + + bitset(const bitset & val){ + for(size_t i = 0; i < num_bytes; ++i){ + data[i] = val.data[i]; + } + } + + template<class charT, class traits, class Allocator> _UCXXEXPORT + explicit bitset( + const basic_string<charT,traits,Allocator>& str, + typename basic_string<charT,traits,Allocator>::size_type pos = 0, + typename basic_string<charT,traits,Allocator>::size_type n = + basic_string<charT>::npos + + ){ + reset(); + if(n > str.length()){ + n = str.length(); + } + size_t width = n; + if (width + pos > str.length()){ + width = str.length() - pos; + } + + for(size_t i = 0; i < width; ++i){ + switch(str[pos + width - i - 1]){ + case '0': + break; + case '1': + set(i); + break; + default: + __throw_invalid_argument(); + } + } + } + + bitset<N>& operator&=(const bitset<N>& rhs){ + for(size_t i =0; i < num_bytes; ++i){ + data[i] &= rhs.data[i]; + } + return *this; + } + + bitset<N>& operator|=(const bitset<N>& rhs){ + for(size_t i =0; i < num_bytes; ++i){ + data[i] |= rhs.data[i]; + } + return *this; + } + bitset<N>& operator^=(const bitset<N>& rhs){ + for(size_t i=0; i < num_bytes; ++i){ + data[i] ^= rhs.data[i]; + } + return *this; + } + + bitset<N>& operator<<=(size_t pos){ + for(size_t i = N-1; i >=pos; --i){ + set(i, test(i - pos)); + } + for(size_t i = 0; i < pos; ++i){ + reset(i); + } + return *this; + } + + bitset<N>& operator>>=(size_t pos){ + for(size_t i = 0; i < (N - pos); ++i){ + set(i, test(i + pos)); + } + for(size_t i = pos; i > 0; --i){ + reset(N - i); + } + return *this; + } + + bitset<N>& set(){ + size_t i; + for(i = 0; i < N ; ++i){ + data[byte_num(i)] |= (1<<bit_num(i)); + } + return *this; + } + bitset<N>& set(size_t pos, int val = true){ + if(val == true){ + data[byte_num(pos)] |= (1<<bit_num(pos)); + }else{ + data[byte_num(pos)] &= ~(1<<bit_num(pos)); + } + return *this; + } + bitset<N>& reset(){ + for(size_t i = 0; i <= num_bytes; ++i){ + data[i] = 0; + } + return *this; + } + bitset<N>& reset(size_t pos){ + data[byte_num(pos)] &= ~(1<<bit_num(pos)); + return *this; + } + bitset<N> operator~() const{ + bitset<N> retval(*this); + retval.flip(); + return retval; + } + + bitset<N>& flip(){ + for(size_t i = 0; i <= num_bytes; ++i){ + data[i] = ~data[i]; + } + return *this; + } + bitset<N>& flip(size_t pos){ + char temp = data[byte_num(pos)] & (1 << bit_num(pos)); + if(temp == 0){ //Bit was 0 + data[byte_num(pos)] |= (1 << bit_num(pos)); + }else{ //Bit was 1 + data[byte_num(pos)] &= ~(1<<bit_num(pos)); + } + return *this; + } + + reference operator[](size_t pos){ // for b[i]; + reference retval; + retval.parent = this; + retval.bit_num = pos; + return retval; + } + + unsigned long to_ulong() const{ + if(N > sizeof(unsigned long) * CHAR_BIT){ + __throw_overflow_error(); + } + unsigned long retval = 0; + size_t count = N; + for(size_t i = count; i > 0; --i){ + if(test(i)){ + retval +=1; + } + retval<<=1; + } + if(test(0)){ + retval +=1; + } + return retval; + } + + template <class charT, class traits, class Allocator> + basic_string<charT, traits, Allocator> to_string() const + { + basic_string<charT, traits, Allocator> retval; + retval.reserve(N); + for(size_t i = N ; i > 0; --i){ + if(test(i-1) == true){ + retval.append("1"); + }else{ + retval.append("0"); + } + } + return retval; + } + + + size_t count() const{ + size_t retval = 0; + for(size_t i =0; i < N; ++i){ + if(test(i)){ + ++retval; + } + } + return retval; + } + size_t size() const{ + return N; + } + + bitset<N>& operator=(const bitset<N> & rhs){ + if(&rhs == this){ + return *this; + } + for(size_t i = 0; i <= byte_num(N); ++i){ + data[i] = rhs.data[i]; + } + return *this; + } + + + bool operator==(const bitset<N>& rhs) const{ + for(size_t i =0; i< N; ++i){ + if(test(i) != rhs.test(i)){ + return false; + } + } + return true; + } + + bool operator!=(const bitset<N>& rhs) const{ + for(size_t i =0; i< N; ++i){ + if(test(i) != rhs.test(i)){ + return true; + } + } + return false; + } + + bool test(size_t pos) const{ + return (data[byte_num(pos)] & (1<<bit_num(pos)) ) != 0; + } + + bool any() const{ + for(size_t i = 0; i< N; ++i){ + if(test(i)==true){ + return true; + } + } + return false; + } + + bool none() const{ + if(any() == true){ + return false; + } + return true; + } + + bitset<N> operator<<(size_t pos) const{ + bitset retval(*this); + retval<<=pos; + return retval; + } + bitset<N> operator>>(size_t pos) const{ + bitset retval(*this); + retval>>=pos; + return retval; + } + }; + + //Non-member functions + + + template <size_t N> _UCXXEXPORT bitset<N> operator&(const bitset<N>& lhs, const bitset<N>& rhs){ + bitset<N> retval(lhs); + retval &= rhs; + return retval; + } + + template <size_t N> _UCXXEXPORT bitset<N> operator|(const bitset<N>& lhs, const bitset<N>& rhs){ + bitset<N> retval(lhs); + retval |= rhs; + return retval; + } + + template <size_t N> _UCXXEXPORT bitset<N> operator^(const bitset<N>& lhs, const bitset<N>& rhs){ + bitset<N> retval(lhs); + retval ^= rhs; + return retval; + } + + template <class charT, class traits, size_t N> _UCXXEXPORT basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, bitset<N>& x) + { + string s; + charT c; + for(size_t i = 0; i < N; ++i){ + is.get(c); + if(!is.good()){ + break; + } + if(c != '1' && c !='0'){ + is.putback(c); + break; + } + s+=c; + } + bitset<N> temp(s); + x = temp; + + return is; + } + + template <class charT, class traits, size_t N> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x) + { + for(size_t i = N ; i > 0; --i){ + if(x.test(i-1) == true){ + os << "1"; + }else{ + os << "0"; + } + } + return os; + } + + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/cassert b/i386/modules/uClibcxx/include/cassert new file mode 100644 index 0000000..dc590dd --- /dev/null +++ b/i386/modules/uClibcxx/include/cassert @@ -0,0 +1,19 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <assert.h> diff --git a/i386/modules/uClibcxx/include/cctype b/i386/modules/uClibcxx/include/cctype new file mode 100644 index 0000000..ef12b1f --- /dev/null +++ b/i386/modules/uClibcxx/include/cctype @@ -0,0 +1,37 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <ctype.h> + +namespace std{ + + using ::isalnum; + using ::isalpha; + using ::iscntrl; + using ::isdigit; + using ::isgraph; + using ::islower; + using ::isprint; + using ::ispunct; + using ::isspace; + using ::isupper; + using ::isxdigit; + using ::tolower; + using ::toupper; + +} diff --git a/i386/modules/uClibcxx/include/cerrno b/i386/modules/uClibcxx/include/cerrno new file mode 100644 index 0000000..b779c5c --- /dev/null +++ b/i386/modules/uClibcxx/include/cerrno @@ -0,0 +1,19 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <errno.h> diff --git a/i386/modules/uClibcxx/include/cfloat b/i386/modules/uClibcxx/include/cfloat new file mode 100644 index 0000000..d2ab703 --- /dev/null +++ b/i386/modules/uClibcxx/include/cfloat @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <setjmp.h> + +#ifndef __STD_HEADER_CFLOAT +#define __STD_HEADER_CFLOAT 1 + + +#include <float.h> + + +#endif + diff --git a/i386/modules/uClibcxx/include/char_traits b/i386/modules/uClibcxx/include/char_traits new file mode 100644 index 0000000..57bde4f --- /dev/null +++ b/i386/modules/uClibcxx/include/char_traits @@ -0,0 +1,112 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <string.h> +#include <exception> +#include <memory> + + +#ifndef __HEADER_CHAR_TRAITS +#define __HEADER_CHAR_TRAITS 1 + +namespace std{ + /* Inlining all wrapped function calls to shrink the amount of code generated*/ + //Typedefs to use for stuff + typedef signed int char_traits_off_type; + + //Generic char_traits + template<class charT> struct _UCXXEXPORT char_traits { }; + + //Specialize for char + template<> struct _UCXXEXPORT char_traits<char> { + typedef char char_type; + typedef short int int_type; + typedef char_traits_off_type off_type; + typedef char_traits_off_type pos_type; + typedef char state_type; + + inline static void assign(char_type & c, const char_type & d) { c = d; } + + static bool eq(const char_type& c1, const char_type& c2); + + static char_type to_char_type(const int_type & i); + + inline static int_type to_int_type(const char_type & c){ + return (short int)(unsigned char)c; + } + + inline static bool eq_int_type(const int_type & a, const int_type & b){ + if(a==b){ + return true; + } + return false; + } + + + inline static bool lt(const char_type& c1, const char_type& c2){ + if(strncmp(&c1, &c2, 1) < 0){ + return true; + } + return false; + } + + inline static char_type* move(char_type* s1, const char_type* s2, size_t n){ + return (char*) memmove(s1, s2, n); + } + + inline static char_type* copy(char_type* s1, const char_type* s2, size_t n){ + for(unsigned long int i=0; i< n; ++i){ + assign(s1[i], s2[i]); + } + return s1 + n; + } + + inline static char_type* assign(char_type* s, size_t n, char_type a){ + return (char *)memset(s, a, n); + } + + inline static int compare(const char_type* s1, const char_type* s2, size_t n){ + return strncmp(s1, s2, n); + } + + inline static size_t length(const char_type* s){ + return strlen(s); + } + + static const char_type* find(const char_type* s, int n, const char_type& a); + + inline static char_type eos() { return 0; } + inline static int_type eof() { return -1; } + inline static int_type not_eof(const int_type & i) { + if(i == -1){ + return 0; + } else { + return i; + } + } + static state_type get_state(pos_type p){ + //p = p; + state_type a = 0; + return a; + } + }; +} + +#endif + diff --git a/i386/modules/uClibcxx/include/climits b/i386/modules/uClibcxx/include/climits new file mode 100644 index 0000000..7d39780 --- /dev/null +++ b/i386/modules/uClibcxx/include/climits @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __STD_HEADER_CLIMITS +#define __STD_HEADER_CLIMITS 1 + + +#include <limits.h> + + +#endif + diff --git a/i386/modules/uClibcxx/include/clocale b/i386/modules/uClibcxx/include/clocale new file mode 100644 index 0000000..4f3cd69 --- /dev/null +++ b/i386/modules/uClibcxx/include/clocale @@ -0,0 +1,30 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __STD_HEADER_CLOCALE +#define __STD_HEADER_CLOCALE 1 + +#include <locale.h> + +namespace std { + using ::lconv; + using ::setlocale; + using ::localeconv; +} + +#endif // __STD_HEADER_CLOCALE diff --git a/i386/modules/uClibcxx/include/cmath b/i386/modules/uClibcxx/include/cmath new file mode 100644 index 0000000..29def58 --- /dev/null +++ b/i386/modules/uClibcxx/include/cmath @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <math.h> + +#ifndef __STD_HEADER_CMATH +#define __STD_HEADER_CMATH 1 + +namespace std{ + using ::acos; + using ::asin; + using ::atan; + using ::atan2; + using ::ceil; + using ::cos; + using ::cosh; + using ::exp; + using ::fabs; + using ::floor; + using ::fmod; + using ::frexp; + using ::ldexp; + using ::log; + using ::log10; + using ::modf; + using ::pow; + using ::sin; + using ::sinh; + using ::sqrt; + using ::tan; + using ::tanh; + + inline float abs (float x){ + return fabsf(x); + } + inline float acos (float x){ + return acosf(x); + } + inline float asin (float x){ + return asinf(x); + } + inline float atan (float x){ + return atanf(x); + } + inline float atan2(float y, float x){ + return atan2f(y, x); + } + inline float ceil (float x){ + return ceilf(x); + } + inline float cos (float x){ + return cosf(x); + } + inline float cosh (float x){ + return coshf(x); + } + inline float exp (float x){ + return expf(x); + } + inline float fabs (float x){ + return fabsf(x); + } + inline float floor(float x){ + return floorf(x); + } + inline float fmod (float x, float y){ + return fmodf(x, y); + } + inline float frexp(float x, int* exp){ + return frexpf(x, exp); + } + inline float ldexp(float x, int exp){ + return ldexpf(x, exp); + } + inline float log (float x){ + return logf(x); + } + inline float log10(float x){ + return log10f(x); + } + inline float modf (float x, float* inptr){ + return modff(x, inptr); + } + inline float pow (float x, float y){ + return powf(x, y); + } + inline float pow (float x, int y){ + return pow((double)x, (double)y); + } + inline float sin (float x){ + return sinf(x); + } + inline float sinh (float x){ + return sinhf(x); + } + inline float sqrt (float x){ + return sqrtf(x); + } + inline float tan (float x){ + return tanf(x); + } + inline float tanh (float x){ + return tanhf(x); + } + inline double abs(double x){ + return fabs(x); + } + inline double pow(double x, int y){ + return pow((double)x, (double)y); + } + +#ifdef __UCLIBCXX_HAS_LONG_DOUBLE__ + inline long double abs (long double x){ + return fabsl(x); + } + inline long double acos (long double x){ + return acosl(x); + } + inline long double asin (long double x){ + return asinl(x); + } + inline long double atan (long double x){ + return atanl(x); + } + inline long double atan2(long double y, long double x){ + return atan2l(y, x); + } + inline long double ceil (long double x){ + return ceill(x); + } + inline long double cos (long double x){ + return cosl(x); + } + inline long double cosh (long double x){ + return coshl(x); + } + inline long double exp (long double x){ + return expl(x); + } + inline long double fabs (long double x){ + return fabsl(x); + } + inline long double floor(long double x){ + return floorl(x); + } + inline long double frexp(long double x, int* exp){ + return frexpl(x, exp); + } + inline long double fmod (long double x, long double y){ + return fmodl(x, y); + } + inline long double ldexp(long double x, int y){ + return ldexpl(x, y); + } + inline long double log (long double x){ + return logl(x); + } + inline long double log10(long double x){ + return log10l(x); + } + inline long double modf (long double x, long double* iptr){ + return modfl(x, iptr); + } + inline long double pow (long double x, long double y){ + return powl(x, y); + } + inline long double pow (long double x, int y){ + return powl(x, (long double)y ); + } + inline long double sin (long double x){ + return sinl(x); + } + inline long double sinh (long double x){ + return sinhl(x); + } + inline long double sqrt (long double x){ + return sqrtl(x); + } + inline long double tan (long double x){ + return tanl(x); + } + inline long double tanh (long double x){ + return tanhl(x); + } +#endif // __UCLIBCXX_HAS_LONG_DOUBLE__ +} + +#endif //__STD_HEADER_CMATH + diff --git a/i386/modules/uClibcxx/include/complex b/i386/modules/uClibcxx/include/complex new file mode 100644 index 0000000..2c3c82b --- /dev/null +++ b/i386/modules/uClibcxx/include/complex @@ -0,0 +1,327 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <istream> +#include <ostream> + +#ifndef __STD_HEADER_COMPLEX +#define __STD_HEADER_COMPLEX 1 + + +namespace std { +// class complex<float>; +// class complex<double>; +// class complex<long double>; + + template<class T> class _UCXXEXPORT complex{ + public: + typedef T value_type; + + complex(const T& re = T(), const T& im = T()) : r(re), i(im) { } + complex(const complex& c): r(c.r), i(c.i){ } + template<class X> complex(const complex<X>& c): r(c.r), i(c.i){ } + + inline T real() const{ + return r; + } + inline T imag() const{ + return i; + } + + complex<T>& operator= (const T& v){ + r = v; + i = 0; + return *this; + } + complex<T>& operator+=(const T& v){ + r +=v; + return *this; + } + complex<T>& operator-=(const T& v){ + r -=v; + return *this; + } + complex<T>& operator*=(const T& v){ + r*=v; + i*=v; + return *this; + } + complex<T>& operator/=(const T& v){ + r/=v; + i/=v; + return *this; + } + complex& operator=(const complex& v){ + if(&v != this){ + r = v.r; + i = v.i; + } + return *this; + } + template<class X> complex<T>& operator= (const complex<X>& v){ + r = v.r; + i = v.i; + return *this; + } + template<class X> complex<T>& operator+=(const complex<X>& v){ + r+=v.r; + i+=v.i; + return *this; + } + template<class X> complex<T>& operator-=(const complex<X>& v){ + r-=v.r; + i-=v.i; + return *this; + } + template<class X> complex<T>& operator*=(const complex<X>& v){ + T tempr = r*v.r - i*v.i; + T tempi = r*v.i + i*v.r; + r = tempr; + i = tempi; + return *this; + } + template<class X> complex<T>& operator/=(const complex<X>& v){ + T tempr = (r*v.r + i*v.i) / (v.r*v.r + v.i*v.i); + T tempi = (i*v.r - r*v.i) / (v.r*v.r + v.i*v.i); + r = tempr; + i = tempi; + return *this; + } + private: + T r; + T i; + }; + + template<class T> _UCXXEXPORT complex<T> operator+(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval += rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator+(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + ls += rs; + return retval; + } + template<class T> _UCXXEXPORT inline complex<T> operator+(const T& ls, const complex<T>& rs){ + return rs + ls; + } + template<class T> _UCXXEXPORT complex<T> operator-(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval -= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator-(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + retval -= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator-(const T& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval -= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator*(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval *= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator*(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + retval *= rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator*(const T& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval *=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator/(const complex<T>& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval/=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator/(const complex<T>& ls, const T& rs){ + complex<T> retval(ls); + retval/=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator/(const T& ls, const complex<T>& rs){ + complex<T> retval(ls); + retval/=rs; + return retval; + } + template<class T> _UCXXEXPORT complex<T> operator+(const complex<T>& v){ + return v; + } + template<class T> _UCXXEXPORT complex<T> operator-(const complex<T>& v){ + return complex<T> (-v.real(), -v.imag()); + } + template<class T> _UCXXEXPORT bool operator==(const complex<T>& ls, const complex<T>& rs){ + if( ls.real() == rs.real() && ls.imag() == rs.image()){ + return true; + } + return false; + } + template<class T> _UCXXEXPORT bool operator==(const complex<T>& ls, const T& rs){ + if(ls.real() == rs && ls.imag() == T()){ + return true; + } + return false; + } + template<class T> _UCXXEXPORT bool operator==(const T& ls, const complex<T>& rs){ + if(ls == rs.real() && rs.imag() == T()){ + return true; + } + return false; + } + template<class T> _UCXXEXPORT bool operator!=(const complex<T>& ls, const complex<T>& rs){ + if(ls == rs){ + return false; + } + return true; + } + template<class T> _UCXXEXPORT bool operator!=(const complex<T>& ls, const T& rs){ + if(ls == rs){ + return false; + } + return true; + } + template<class T> _UCXXEXPORT bool operator!=(const T& ls, const complex<T>& rs){ + if(ls == rs){ + return false; + } + return true; + } + template<class T, class charT, class traits> _UCXXEXPORT basic_istream<charT, traits>& + operator>>(basic_istream<charT, traits>& is, complex<T>& v) + { + T tempr; + T tempi; + is >> tempr; + is.get(); + is >> tempi; + v = complex<T>(tempr, tempi); + return is; + } + + template<class T, class charT, class traits> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const complex<T>&v) + { + os << v.real() << ", " << v.imag(); + return os; + } + + template<class T> _UCXXEXPORT T real(const complex<T>& v){ + return v.real(); + } + + template<class T> _UCXXEXPORT T imag(const complex<T>& v){ + return v.imag(); + } + + template<class T> _UCXXEXPORT T norm(const complex<T>& v){ + return (v.real() * v.real() + v.imag() * v.imag()); + } + + template<class T> _UCXXEXPORT complex<T> conj(const complex<T>& v){ + return complex<T>(v.real(), -v.imag()); + } + +#ifdef __UCLIBCXX_SUPPORT_MATH__ //Can we link with libm? + + template<class T> _UCXXEXPORT T abs(const complex<T>& v){ + return sqrt(v.real() * v.real() + v.imag() * v.imag()); + } + + template<class T> _UCXXEXPORT T arg(const complex<T>& v){ + return atan2(v.imag(), v.real()); + } + + template<class T> _UCXXEXPORT complex<T> polar(const T& rho, const T& theta){ + return complex<T>(rho * cos(theta), rho * sin(theta)); + } + + template<class T> _UCXXEXPORT complex<T> cos (const complex<T>& v){ + return complex<T>(cos(v.real()) * cosh(v.imag()), -sin(v.real()) * sinh(v.imag())); + } + + template<class T> _UCXXEXPORT complex<T> cosh (const complex<T>& v){ + return complex<T>(cosh(v.real()) * cos(v.imag()), sinh(v.real()) * sin(v.imag())); + } + + template<class T> _UCXXEXPORT complex<T> exp (const complex<T>& v){ + return polar(exp(v.real()), v.imag()); + } + + template<class T> _UCXXEXPORT complex<T> log (const complex<T>& v){ + return complex<T>(log(abs(v)), arg(v)); + } + + template<class T> _UCXXEXPORT complex<T> log10(const complex<T>& v){ + return (log(v) / log(T(10.0))); + } + + template<class T> _UCXXEXPORT complex<T> pow(const complex<T>& v, int p){ + T rho = pow(abs(v), p); + T theta = arg(v); + return complex<T>(rho * cos(p * theta), rho * sin(p * theta) ); + } + + template<class T> _UCXXEXPORT complex<T> pow(const complex<T>& v, const T& p){ + return polar( pow(abs(v),p), arg(v)*p ); + } + + template<class T> _UCXXEXPORT complex<T> pow(const complex<T>& v, const complex<T>& p){ + if(v == T()){ + //We are using "0" as the value + return T(); + } + return exp(p * log(v)); + } + + template<class T> _UCXXEXPORT complex<T> pow(const T& v, const complex<T>& p){ + if(v == T()){ + return T(); + } + return polar(pow(v,p.real()), y.imag() * log(x) ); + } + + template<class T> _UCXXEXPORT complex<T> sin (const complex<T>& v){ + return complex<T>(sin(v.real()) * cosh(v.imag()), cosh(v.real()) * sin(v.imag())); + } + + template<class T> _UCXXEXPORT complex<T> sinh (const complex<T>& v){ + return complext<T>(sinh(v.real()) * cos(v.imag()), cosh(v.real()) * sin(v.imag()) ); + } + + template<class T> _UCXXEXPORT complex<T> sqrt (const complex<T>&); + template<class T> _UCXXEXPORT complex<T> tan (const complex<T>& v){ + return sin(v) / cos(v); + } + + template<class T> _UCXXEXPORT complex<T> tanh (const complex<T>& v){ + return sinh(v) / cosh(v); + } + +#endif + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/csetjmp b/i386/modules/uClibcxx/include/csetjmp new file mode 100644 index 0000000..a11f932 --- /dev/null +++ b/i386/modules/uClibcxx/include/csetjmp @@ -0,0 +1,44 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <setjmp.h> + +#ifndef __STD_HEADER_CSETJMP +#define __STD_HEADER_CSETJMP 1 + + +//From GCC Header files +#undef longjmp + +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef setjmp +#define setjmp(env) setjmp (env) +#endif + +//Mine again + + +namespace std{ + using ::longjmp; + using ::jmp_buf; +} + + +#endif + diff --git a/i386/modules/uClibcxx/include/csignal b/i386/modules/uClibcxx/include/csignal new file mode 100644 index 0000000..eeec6e1 --- /dev/null +++ b/i386/modules/uClibcxx/include/csignal @@ -0,0 +1,59 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 20.4.6 C library +// + +/** @file csignal + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c signal.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CSIGNAL +#define _CPP_CSIGNAL 1 + +#include <signal.h> + +// Get rid of those macros defined in <signal.h> in lieu of real functions. +#undef raise + +namespace std +{ + using ::sig_atomic_t; + using ::signal; + using ::raise; +} + +#endif diff --git a/i386/modules/uClibcxx/include/cstdarg b/i386/modules/uClibcxx/include/cstdarg new file mode 100644 index 0000000..1bd83d7 --- /dev/null +++ b/i386/modules/uClibcxx/include/cstdarg @@ -0,0 +1,58 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 20.4.6 C library +// + +/** @file cstdarg + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c stdarg.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CSTDARG +#define _CPP_CSTDARG 1 + +#include <stdarg.h> + +// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998 +#ifndef va_end +#define va_end(ap) va_end (ap) +#endif + +namespace std +{ + using ::va_list; +} + +#endif diff --git a/i386/modules/uClibcxx/include/cstddef b/i386/modules/uClibcxx/include/cstddef new file mode 100644 index 0000000..5d99d7a --- /dev/null +++ b/i386/modules/uClibcxx/include/cstddef @@ -0,0 +1,54 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 18.1 Types +// + +/** @file cstddef + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c stddef.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CSTDDEF +#define _CPP_CSTDDEF 1 + +#include <stddef.h> + +namespace std +{ + using ::ptrdiff_t; + using ::size_t; +} + +#endif diff --git a/i386/modules/uClibcxx/include/cstdio b/i386/modules/uClibcxx/include/cstdio new file mode 100644 index 0000000..aab1283 --- /dev/null +++ b/i386/modules/uClibcxx/include/cstdio @@ -0,0 +1,75 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation version 2.1 + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <stdio.h> +#include <basic_definitions> + +#ifndef __HEADER_CSTDIO +#define __HEADER_CSTDIO 1 + + +namespace std{ + using ::FILE; + using ::fpos_t; + + using ::clearerr; + using ::fclose; + using ::feof; + using ::ferror; + using ::fflush; + using ::fgetc; + using ::fgetpos; + using ::fgets; + using ::fopen; + using ::fprintf; + using ::fputc; + using ::fputs; + using ::fread; + using ::freopen; + using ::fscanf; + using ::fseek; + using ::fsetpos; + using ::ftell; + using ::fwrite; + using ::getc; + using ::getchar; + using ::gets; + using ::perror; + using ::printf; + using ::putc; + using ::putchar; + using ::puts; + using ::remove; + using ::rename; + using ::rewind; + using ::scanf; + using ::setbuf; + using ::setvbuf; + using ::sprintf; + using ::sscanf; + using ::tmpfile; + using ::tmpnam; + using ::ungetc; + using ::vfprintf; + using ::vprintf; + using ::vsprintf; +} + + + +#endif + diff --git a/i386/modules/uClibcxx/include/cstdlib b/i386/modules/uClibcxx/include/cstdlib new file mode 100644 index 0000000..b85ed36 --- /dev/null +++ b/i386/modules/uClibcxx/include/cstdlib @@ -0,0 +1,71 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <stdlib.h> +#include <basic_definitions> + +#ifndef __HEADER_CSTDLIB +#define __HEADER_CSTDLIB 1 + + +namespace std{ + using ::abort; + using ::abs; + using ::atexit; + using ::atol; + using ::atof; + using ::atoi; + using ::bsearch; + using ::calloc; + using ::div; + using ::exit; + using ::free; + using ::getenv; + using ::labs; + using ::ldiv; + using ::malloc; + using ::qsort; + using ::rand; + using ::realloc; + using ::srand; + using ::strtod; + using ::strtol; + using ::strtoul; + using ::system; +#ifdef __UCLIBCXX_HAS_WCHAR__ + using ::mblen; + using ::mbstowcs; + using ::mbtowc; + using ::wctomb; + using ::wcstombs; +#endif + + inline long abs(long i){ + return labs(i); + } + + inline ldiv_t div(long i, long j){ + return ldiv(i, j); + } + +} + + + +#endif + diff --git a/i386/modules/uClibcxx/include/cstring b/i386/modules/uClibcxx/include/cstring new file mode 100644 index 0000000..d7bf7e1 --- /dev/null +++ b/i386/modules/uClibcxx/include/cstring @@ -0,0 +1,78 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <cstddef> +#include <string.h> + +#ifndef __HEADER_CSTRING +#define __HEADER_CSTRING 1 + + +namespace std{ + + using ::memchr; + using ::memcmp; + using ::memcpy; + using ::memmove; + using ::memset; + using ::strcat; + using ::strchr; + using ::strcmp; + using ::strcoll; + using ::strcpy; + using ::strcspn; + using ::strerror; + using ::strlen; + using ::strncat; + using ::strncmp; + using ::strncpy; + using ::strpbrk; + using ::strrchr; + using ::strspn; + using ::strstr; + using ::strtok; + using ::strxfrm; + + + //Extra definitions required in c++ spec + + + inline void* memchr(void* s, int c, size_t n){ + return memchr(const_cast<const void *>(s), c, n); + } + + inline char* strchr(char* s, int c){ + return strchr(const_cast<const char *>(s), c); + } + + inline char* strpbrk(char* s1, const char* s2){ + return strpbrk(const_cast<const char *>(s1), s2); + } + + inline char* strrchr(char* s, int c){ + return strrchr(const_cast<const char *>(s), c); + } + + inline char* strstr(char* s1, const char* s2){ + return strstr(const_cast<const char *>(s1), s2); + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/ctime b/i386/modules/uClibcxx/include/ctime new file mode 100644 index 0000000..731fff3 --- /dev/null +++ b/i386/modules/uClibcxx/include/ctime @@ -0,0 +1,79 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 20.5 Date and time +// + +/** @file ctime + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c time.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CTIME +#define _CPP_CTIME 1 + +#include <cstddef> + +#include <time.h> + +// Get rid of those macros defined in <time.h> in lieu of real functions. +#undef clock +#undef difftime +#undef mktime +#undef time +#undef asctime +#undef ctime +#undef gmtime +#undef localtime +#undef strftime + +namespace std +{ + using ::clock_t; + using ::time_t; + using ::tm; + + using ::clock; + using ::difftime; + using ::mktime; + using ::time; + using ::asctime; + using ::ctime; + using ::gmtime; + using ::localtime; + using ::strftime; +} + +#endif diff --git a/i386/modules/uClibcxx/include/cwchar b/i386/modules/uClibcxx/include/cwchar new file mode 100644 index 0000000..03fae09 --- /dev/null +++ b/i386/modules/uClibcxx/include/cwchar @@ -0,0 +1,86 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation version 2.1 + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <wchar.h> +#include <basic_definitions> + +#ifndef __HEADER_CWCHAR +#define __HEADER_CWCHAR 1 + + +namespace std{ + using ::mbstate_t; + using ::wint_t; + + using ::btowc; + using ::fgetwc; + using ::fgetws; + using ::fputwc; + using ::fputws; + using ::fwide; + using ::fwprintf; + using ::fwscanf; + using ::getwc; + using ::getwchar; + using ::mbrlen; + using ::mbrtowc; + using ::mbsinit; + using ::mbsrtowcs; + using ::putwc; + using ::putwchar; + using ::swprintf; + using ::swscanf; + using ::ungetwc; + using ::vfwprintf; + using ::vswprintf; + using ::vwprintf; + using ::wcrtomb; + using ::wcscat; + using ::wcschr; + using ::wcscmp; + using ::wcscoll; + using ::wcscpy; + using ::wcscspn; + using ::wcsftime; + using ::wcslen; + using ::wcsncat; + using ::wcsncmp; + using ::wcsncpy; + using ::wcspbrk; + using ::wcsrchr; + using ::wcsrtombs; + using ::wcsspn; + using ::wcsstr; + using ::wcstod; + using ::wcstok; + using ::wcstol; + using ::wcstoul; + using ::wcsxfrm; + using ::wctob; + using ::wmemchr; + using ::wmemcmp; + using ::wmemcpy; + using ::wmemmove; + using ::wmemset; + using ::wprintf; + using ::wscanf; +} + + + +#endif + diff --git a/i386/modules/uClibcxx/include/cwctype b/i386/modules/uClibcxx/include/cwctype new file mode 100644 index 0000000..fc05f01 --- /dev/null +++ b/i386/modules/uClibcxx/include/cwctype @@ -0,0 +1,104 @@ +// -*- C++ -*- forwarding header. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 +// Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: <cwctype> +// + +/** @file cwctype + * This is a Standard C++ Library file. You should @c #include this file + * in your programs, rather than any of the "*.h" implementation files. + * + * This is the C++ version of the Standard C Library header @c wctype.h, + * and its contents are (mostly) the same as that header, but are all + * contained in the namespace @c std. + */ + +#ifndef _CPP_CWCTYPE +#define _CPP_CWCTYPE 1 + +//#include <bits/c++config.h> + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <wctype.h> +#endif + +// Get rid of those macros defined in <wctype.h> in lieu of real functions. +#undef iswalnum +#undef iswalpha +#undef iswblank +#undef iswcntrl +#undef iswdigit +#undef iswgraph +#undef iswlower +#undef iswprint +#undef iswprint +#undef iswpunct +#undef iswspace +#undef iswupper +#undef iswxdigit +#undef iswctype +#undef towlower +#undef towupper +#undef towctrans +#undef wctrans +#undef wctype + +#if __UCLIBCXX_HAS_WCHAR__ +namespace std +{ + using ::wint_t; // cwchar + + using ::wctype_t; + using ::wctrans_t; + + using ::iswalnum; + using ::iswalpha; + using ::iswblank; + using ::iswcntrl; + using ::iswdigit; + using ::iswgraph; + using ::iswlower; + using ::iswprint; + using ::iswprint; + using ::iswpunct; + using ::iswspace; + using ::iswupper; + using ::iswxdigit; + using ::iswctype; + using ::towlower; + using ::towupper; + using ::towctrans; + using ::wctrans; + using ::wctype; +} +#endif //__ULIBCXX_HAS_WCHAR__ + +#endif diff --git a/i386/modules/uClibcxx/include/deque b/i386/modules/uClibcxx/include/deque new file mode 100644 index 0000000..c866eec --- /dev/null +++ b/i386/modules/uClibcxx/include/deque @@ -0,0 +1,807 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <memory> +#include <iterator> +#include <stdexcept> + +#ifndef __STD_HEADER_DEQUE +#define __STD_HEADER_DEQUE + + +namespace std{ + template <class T, class Allocator = allocator<T> > class deque; + template <class T, class Allocator> bool operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> void swap(deque<T,Allocator>& x, deque<T,Allocator>& y); + + template <class T, class Allocator> class _UCXXEXPORT deque { + public: + friend bool operator==<>(const deque<T, Allocator>& x, const deque<T, Allocator>& y); + friend class deque_iter; + friend class deque_citer; + class deque_iter; + class deque_citer; + + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef deque_iter iterator; + typedef deque_citer const_iterator; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef T value_type; + typedef Allocator allocator_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + + explicit deque(const Allocator& al = Allocator()); + explicit deque(size_type n, const T& value = T(), const Allocator& al = Allocator()); + template <class InputIterator> deque(InputIterator first, InputIterator last, const Allocator& = Allocator()); + deque(const deque<T,Allocator>& x); + ~deque(); + + deque<T,Allocator>& operator=(const deque<T,Allocator>& x); + template <class InputIterator> void assign(InputIterator first, InputIterator last); + template <class Size, class U> void assign(Size n, const U& u = U()); + allocator_type get_allocator() const; + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + size_type size() const; + size_type max_size() const; + void resize(size_type sz, T c = T()); + bool empty() const; + + reference operator[](size_type n); + const_reference operator[](size_type n) const; + reference at(size_type n); + const_reference at(size_type n) const; + reference front(); + const_reference front() const; + reference back(); + const_reference back() const; + + void push_front(const T& x); + void push_back(const T& x); + iterator insert(iterator position, const T& x = T()); + void insert(iterator position, size_type n, const T& x); + template <class InputIterator> void insert (iterator position, InputIterator first, InputIterator last); + void pop_front(); + void pop_back(); + + iterator erase(iterator position); + iterator erase(iterator first, iterator last); + void swap(deque<T,Allocator>&); + void clear(); + + protected: + void reserve(size_type n); + inline size_type array_element(size_type deque_element) const{ + if(deque_element < (data_size - first_element)){ + return first_element + deque_element; + } + return deque_element - (data_size - first_element); + } + inline size_type first_subtract(size_type sub_size) const{ + if(sub_size > first_element){ + return (data_size - first_element) - sub_size; + } + return first_element - sub_size; + } + + T * data; + size_type data_size; //Physical size of array + size_type elements; //Elements in array + size_type first_element; //Element number of array 0..n + size_type last_element; //Element number of array 0..n + Allocator a; + + }; + + + template<class T, class Allocator> class _UCXXEXPORT deque<T, Allocator>::deque_iter + : public std::iterator< + random_access_iterator_tag, + T, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + friend class deque<T, Allocator>; + protected: + deque<T, Allocator> * container; + typename Allocator::size_type element; + + public: + deque_iter() : container(0), element(0) { } + deque_iter(const deque_iter & d) : container (d.container), element(d.element) { } + deque_iter(deque<T, Allocator> * c, typename Allocator::size_type e) + : container(c), element(e) + { + return; + } + ~deque_iter() { } + deque_iter & operator=(const deque_iter & d){ + container = d.container; + element = d.element; + return *this; + } + T & operator*(){ + return container->data[container->array_element(element)]; + } + T * operator->(){ + return container->data + container->array_element(element); + } + const T & operator*() const{ + return container->data[container->array_element(element)]; + } + const T * operator->() const{ + return container->data + container->array_element(element); + } + bool operator==(const deque_iter & d) const{ + if(container == d.container && element == d.element){ + return true; + } + return false; + } + bool operator!=(const deque_iter & d) const{ + if(container != d.container || element != d.element){ + return true; + } + return false; + } + bool operator<(const deque_iter & d) const{ + if(element < d.element){ + return true; + } + return false; + } + bool operator<=(const deque_iter & d) const{ + if(element <= d.element){ + return true; + } + return false; + } + bool operator>(const deque_iter & d) const{ + if(element > d.element){ + return true; + } + return false; + } + bool operator>=(const deque_iter & d) const{ + if(element >= d.element){ + return true; + } + return false; + } + deque_iter & operator++(){ + ++element; + return *this; + } + deque_iter operator++(int){ + deque_iter temp(container, element); + ++element; + return temp; + } + deque_iter operator+(typename Allocator::size_type n){ + deque_iter temp(container, element + n); + return temp; + } + deque_iter & operator+=(typename Allocator::size_type n){ + element += n; + return *this; + } + deque_iter & operator--(){ + --element; + return *this; + } + deque_iter operator--(int){ + deque_iter temp(container, element); + --element; + return temp; + } + deque_iter operator-(typename Allocator::size_type n){ + deque_iter temp(container, element - n); + return temp; + } + deque_iter & operator-=(typename Allocator::size_type n){ + element -= n; + return *this; + } + typename Allocator::size_type operator-(const deque_iter & d){ + return element - d.element; + } + + }; + + template<class T, class Allocator> class _UCXXEXPORT deque<T, Allocator>::deque_citer + : public std::iterator< + random_access_iterator_tag, + T, + typename Allocator::difference_type, + typename Allocator::const_pointer, + typename Allocator::const_reference + > + { + friend class deque<T, Allocator>; + protected: + const deque<T, Allocator> * container; + typename Allocator::size_type element; + + public: + deque_citer() : container(0), element(0) { } + deque_citer(const deque_citer & d) : container (d.container), element(d.element) { } + deque_citer(const deque<T, Allocator> * c, typename Allocator::size_type e) + : container(c), element(e) + { + return; + } + ~deque_citer() { } + deque_citer & operator=(const deque_iter & d){ + container = d.container; + element = d.element; + return *this; + } + const T & operator*() const{ + return container->data[container->array_element(element)]; + } + const T * operator->() const{ + return container->data + container->array_element(element); + } + bool operator==(const deque_citer & d) const{ + if(container == d.container && element == d.element){ + return true; + } + return false; + } + bool operator!=(const deque_citer & d) const{ + if(container != d.container || element != d.element){ + return true; + } + return false; + } + bool operator<(const deque_citer & d) const{ + if(element < d.element){ + return true; + } + return false; + } + bool operator<=(const deque_citer & d) const{ + if(element <= d.element){ + return true; + } + return false; + } + bool operator>(const deque_citer & d) const{ + if(element > d.element){ + return true; + } + return false; + } + bool operator>=(const deque_citer & d){ + if(element >= d.element){ + return true; + } + return false; + } + deque_citer & operator++(){ + ++element; + return *this; + } + deque_citer operator++(int){ + deque_citer temp(container, element); + ++element; + return temp; + } + deque_citer operator+(typename Allocator::size_type n){ + deque_citer temp(container, element + n); + return temp; + } + deque_citer & operator+=(typename Allocator::size_type n){ + element += n; + return *this; + } + deque_citer & operator--(){ + --element; + return *this; + } + deque_citer operator--(int){ + deque_citer temp(container, element); + --element; + return temp; + } + deque_citer operator-(typename Allocator::size_type n){ + deque_citer temp(container, element - n); + return temp; + } + deque_citer & operator-=(typename Allocator::size_type n){ + element -= n; + return *this; + } + typename Allocator::size_type operator-(const deque_citer & d){ + return element - d.element; + } + + }; + + template<class T, class Allocator> deque<T, Allocator>::deque(const Allocator& al) + : data(0), + data_size(0), elements(0), first_element(0), last_element(0), a(al) + { + data_size = __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = data_size /2; + last_element = first_element; + } + + + template<class T, class Allocator> deque<T, Allocator>::deque( + size_type n, const T& value, const Allocator& al) + : data(0), + elements(n), first_element(0), last_element(0), a(al) + { + data_size = elements + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = (data_size - elements) / 2; + last_element = first_element; + + for(n=first_element ; n < last_element; ++n ){ + a.construct(data+n, value); + } + } + + + template<class T, class Allocator> template <class InputIterator> + deque<T, Allocator>::deque(InputIterator first, InputIterator last, const Allocator& al) + : data(0), + data_size(0), elements(0), first_element(0), last_element(0), a(al) + { + data_size = __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = data_size / 4; //Note sure how big, but let's add a little space... + last_element = first_element; + while(first != last){ + push_back(*first); + ++first; + } + } + + + template<class T, class Allocator> deque<T, Allocator>::deque(const deque<T,Allocator>& x) + : data(0), + elements(0), first_element(0), last_element(0), a(x.a) + { + data_size = x.elements + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + first_element = (data_size - x.elements) / 2; + last_element = first_element; + for(size_type i=0; i < x.elements; ++i){ + push_back(x[i]); + } + } + + + template<class T, class Allocator> deque<T, Allocator>::~deque(){ + clear(); + a.deallocate(data, data_size); + } + + template<class T, class Allocator> deque<T,Allocator>& deque<T, Allocator>:: + operator=(const deque<T,Allocator>& x) + { + if(&x == this){ + return *this; + } + resize(x.elements); + for(size_t i = 0; i < elements; ++i){ + data[array_element(i)] = x[i]; + } + return *this; + } + + + template<class T, class Allocator> template <class InputIterator> void + deque<T, Allocator>::assign(InputIterator first, InputIterator last) + { + clear(); + while(first !=last){ + push_back(*first); + ++first; + } + } + + + template<class T, class Allocator> template <class Size, class U> void + deque<T, Allocator>::assign(Size n, const U& u) + { + if(&u == this){ + return; + } + clear(); + for(size_type i = 0; i < n; ++i){ + push_back(u); + } + } + + + template<class T, class Allocator> typename deque<T, Allocator>::allocator_type + deque<T, Allocator>::get_allocator() const + { + return a; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::begin() + { + return deque_iter(this, 0); + } + + + template<class T, class Allocator> typename deque<T, Allocator>::const_iterator + deque<T, Allocator>::begin() const + { + return deque_citer(this, 0); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::end() + { + return deque_iter(this, elements); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_iterator deque<T, Allocator>::end() const + { + return deque_citer(this, elements); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reverse_iterator deque<T, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reverse_iterator deque<T, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reverse_iterator deque<T, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reverse_iterator deque<T, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::size_type deque<T, Allocator>::size() const + { + return elements; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::size_type deque<T, Allocator>::max_size() const + { + return ((size_type)(-1)) / sizeof(T); + } + + template<class T, class Allocator> void deque<T, Allocator>::resize(size_type sz, T c){ + reserve(sz); + while(sz > size()){ + push_back(c); + } + while(sz < size()){ + pop_back(); + } + } + + template<class T, class Allocator> bool deque<T, Allocator>::empty() const{ + return (elements == 0); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::operator[](size_type n) + { + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::operator[](size_type n) const + { + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::at(size_type n) + { + if(n > elements){ + __throw_out_of_range("Out of deque range"); + } + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::at(size_type n) const + { + if(n > elements){ + __throw_out_of_range("Out of deque range"); + } + return data[array_element(n)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::front() + { + return data[first_element]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::front() const + { + return data[first_element]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::reference deque<T, Allocator>::back() + { + return data[array_element(elements-1)]; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::const_reference deque<T, Allocator>::back() const + { + return data[array_element(elements-1)]; + } + + template<class T, class Allocator> void deque<T, Allocator>::push_front(const T& x){ + reserve(elements + 1); + first_element = first_subtract(1); + a.construct(data + first_element, x); + ++elements; + } + + template<class T, class Allocator> void deque<T, Allocator>::push_back(const T& x){ + reserve(elements + 1); + a.construct(data + last_element, x); + ++elements; + last_element = array_element(elements); + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::insert(iterator position, const T& x) + { + reserve(elements+1); + if(position.element > (elements/2)){ + //Push all elements back 1 + push_back(x); + for(size_type i = elements-1; i > position.element; --i){ + at(i) = at(i-1); + } + }else{ + //Push all elements forward 1 + push_front(x); + for(size_type i = 0; i < position.element; ++i){ + at(i) = at(i+1); + } + } + at(position.element) = x; + return deque_iter(this, position.element); + } + + template<class T, class Allocator> void deque<T, Allocator>:: + insert(typename deque<T, Allocator>::iterator position, size_type n, const T& x) + { + reserve(elements + n); + for(size_t i =0; i < n; ++i){ + position = insert(position, x); + } + } + + template<class T, class Allocator> template <class InputIterator> + void deque<T, Allocator>::insert (iterator position, InputIterator first, InputIterator last) + { + while(first != last){ + position = insert(position, *first); + ++first; + } + } + + template<class T, class Allocator> void deque<T, Allocator>::pop_front(){ + if(elements == 0){ + __throw_out_of_range("deque pop_front"); + } + a.destroy(data + first_element); + first_element = array_element(1); + --elements; + } + + template<class T, class Allocator> void deque<T, Allocator>::pop_back(){ + last_element = array_element(elements - 1); + a.destroy(data + last_element); + --elements; + } + + template<class T, class Allocator> typename + deque<T, Allocator>::iterator deque<T, Allocator>::erase(typename deque<T, Allocator>::iterator position) + { + if(position.element > (elements /2)){ + for(size_type i = position.element; i < elements - 1; ++i){ + at(i) = at(i+1); + } + pop_back(); + }else{ + for(size_type i = position.element; i > 0; --i){ + at(i) = at(i-1); + } + pop_front(); + } + return deque_iter(this, position.element); + } + + template<class T, class Allocator> typename deque<T, Allocator>::iterator + deque<T, Allocator>:: + erase(typename deque<T, Allocator>::iterator first, typename deque<T, Allocator>::iterator last) + { + //Shift backwards + size_type num_move = last.element - first.element; + if( first.element > (elements - last.element) ){ + for(size_type i = last.element; i < elements ; ++i){ + at(i-num_move) = at(i); + } + for(size_type i = 0; i < num_move ; ++i){ + pop_back(); + } + }else{ + for(size_type i = 0; i < first.element ; ++i){ + at(last.element - i - 1) = at(first.element - i - 1); + } + for(size_type i = 0; i < num_move ; ++i){ + pop_front(); + } + } + return deque_iter(this, first.element); + } + + template<class T, class Allocator> void deque<T, Allocator>::swap(deque<T,Allocator>& x) + { + T * temp_data; + typename deque<T,Allocator>::size_type temp_size; + + //Swap data pointers + temp_data = x.data; + x.data = data; + data = temp_data; + + //Swap array sizes + temp_size = x.data_size; + x.data_size = data_size; + data_size = temp_size; + + //Swap num array elements + temp_size = x.elements; + x.elements = elements; + elements = temp_size; + + //Swap first_pointer + temp_size = x.first_element; + x.first_element = first_element; + first_element = temp_size; + + //Swap last_pointer + temp_size = x.last_element; + x.last_element = last_element; + last_element = temp_size; + } + + template<class T, class Allocator> void deque<T, Allocator>::clear() + { + while(elements > 0 ){ + pop_back(); + } + } + + + template<class T, class Allocator> void deque<T, Allocator>::reserve(typename deque<T, Allocator>::size_type n) + { + if(data_size >= n){ + return; + } + + size_type size_temp; + size_type first_temp; + T * data_temp; + size_temp = n + __UCLIBCXX_STL_BUFFER_SIZE__; //Reserve extra 'cause we can + data_temp = a.allocate(size_temp); + + first_temp = (size_temp - elements) / 2; + for(size_type i = 0; i < elements; ++i){ + a.construct(data_temp + first_temp + i, data[array_element(i)]); + a.destroy(data + array_element(i)); + } + + //Now shuffle pointers + a.deallocate(data, data_size); + data = data_temp; + data_size = size_temp; + first_element = first_temp; + last_element = first_element + elements; + } + + + template <class T, class Allocator> _UCXXEXPORT + bool + operator==(const deque<T,Allocator>& x, const deque<T,Allocator>& y) + { + if(x.elements != y.elements){ + return false; + } + for(typename deque<T,Allocator>::size_type i = 0; i < x.elements; ++i){ + if(x[i] < y[i] || y[i] < x[i]){ + return false; + } + } + return true; + } + + template <class T, class Allocator> bool operator< (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> _UCXXEXPORT + bool + operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y) + { + if(x == y){ + return false; + } + return true; + } + template <class T, class Allocator> bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y); + template <class T, class Allocator> _UCXXEXPORT void swap(deque<T,Allocator>& x, deque<T,Allocator>& y){ + x.swap(y); + } + + + +} + +#endif + + + + diff --git a/i386/modules/uClibcxx/include/exception b/i386/modules/uClibcxx/include/exception new file mode 100644 index 0000000..87cb103 --- /dev/null +++ b/i386/modules/uClibcxx/include/exception @@ -0,0 +1,120 @@ +// Exception Handling support header for -*- C++ -*- + +// Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002 +// Free Software Foundation +// +// This file is part of GNU CC. +// +// GNU CC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GNU CC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU CC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +/** @file exception + * This header defines several types and functions relating to the + * handling of exceptions in a C++ program. + */ + +#ifndef __EXCEPTION__ +#define __EXCEPTION__ + +#include <basic_definitions> + +extern "C++" { + +namespace std +{ + /** + * @brief Base class for all library exceptions. + * + * This is the base class for all exceptions thrown by the standard + * library, and by certain language expressions. You are free to derive + * your own %exception classes, or use a different hierarchy, or to + * throw non-class data (e.g., fundamental types). + */ + class exception + { + public: + exception() throw() { } + virtual ~exception() throw(); + /** Returns a C-style character string describing the general cause + * of the current error. */ + virtual const char* what() const throw(); + }; + + /** If an %exception is thrown which is not listed in a function's + * %exception specification, one of these may be thrown. */ + class bad_exception : public exception + { + public: + bad_exception() throw() { } + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_exception() throw(); + }; + + /// If you write a replacement %terminate handler, it must be of this type. + typedef void (*terminate_handler) (); + /// If you write a replacement %unexpected handler, it must be of this type. + typedef void (*unexpected_handler) (); + + /// Takes a new handler function as an argument, returns the old function. + terminate_handler set_terminate(terminate_handler) throw(); + /** The runtime will call this function if %exception handling must be + * abandoned for any reason. */ + void terminate() __UCLIBCXX_NORETURN; + + /// Takes a new handler function as an argument, returns the old function. + unexpected_handler set_unexpected(unexpected_handler) throw(); + /** The runtime will call this function if an %exception is thrown which + * violates the function's %exception specification. */ + void unexpected() __UCLIBCXX_NORETURN; + + /** [18.6.4]/1: "Returns true after completing evaluation of a + * throw-expression until either completing initialization of the + * exception-declaration in the matching handler or entering @c unexpected() + * due to the throw; or after entering @c terminate() for any reason + * other than an explicit call to @c terminate(). [Note: This includes + * stack unwinding [15.2]. end note]" + * + * 2: "When @c uncaught_exception() is true, throwing an %exception can + * result in a call of @c terminate() (15.5.1)." + */ + bool uncaught_exception() throw(); +} // namespace std + +namespace __gnu_cxx +{ + /** A replacement for the standard terminate_handler which prints more + information about the terminating exception (if any) on stderr. Call + @code + std::set_terminate (__gnu_cxx::__verbose_terminate_handler) + @endcode + to use. For more info, see + http://gcc.gnu.org/onlinedocs/libstdc++/19_diagnostics/howto.html#4 + */ + void __verbose_terminate_handler (); +} // namespace __gnu_cxx + +} // extern "C++" + +#endif diff --git a/i386/modules/uClibcxx/include/fstream b/i386/modules/uClibcxx/include/fstream new file mode 100644 index 0000000..dce4dda --- /dev/null +++ b/i386/modules/uClibcxx/include/fstream @@ -0,0 +1,674 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#if 0 +#ifndef __STD_HEADER_FSTREAM +#define __STD_HEADER_FSTREAM 1 + +//#if __UCLIBCXX_SUPPORT_FILEIO__ + +#include<basic_definitions> + +#include <cstdio> +#include <cstdlib> +#include <streambuf> +#include <istream> +#include <ostream> +#include <char_traits> + +#include <unistd.h> +#include <fcntl.h> +#include <errno.h> + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <cwchar> +#include <cwctype> +#endif //__UCLIBCXX_HAS_WCHAR__ + +namespace std{ + + template <class C, class T> class basic_filebuf; + + typedef basic_filebuf<char> filebuf; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_filebuf<wchar_t> wfilebuf; +#endif + + + template <class charT, class traits> class _UCXXEXPORT basic_filebuf + : public basic_streambuf<charT,traits> + { +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + friend ios_base::Init::Init(); //Needed for cout/cin stuff +#endif + public: + // Types (inherited from basic_streambuf: + typedef typename basic_streambuf<charT, traits>::char_type char_type; + typedef typename basic_streambuf<charT, traits>::int_type int_type; + typedef typename basic_streambuf<charT, traits>::pos_type pos_type; + typedef typename basic_streambuf<charT, traits>::off_type off_type; + typedef traits traits_type; + + //Constructors/destructor: + + _UCXXEXPORT basic_filebuf() : basic_streambuf<charT, traits>(), fp(0), pbuffer(0), gbuffer(0) + { + append=false; + pbuffer = new char_type[__UCLIBCXX_IOSTREAM_BUFSIZE__]; + gbuffer = new char_type[__UCLIBCXX_IOSTREAM_BUFSIZE__]; + + setp(pbuffer, pbuffer + __UCLIBCXX_IOSTREAM_BUFSIZE__); + //Position get buffer so that there is no data available + setg(gbuffer, gbuffer + __UCLIBCXX_IOSTREAM_BUFSIZE__, + gbuffer + __UCLIBCXX_IOSTREAM_BUFSIZE__); + } + + + _UCXXEXPORT virtual ~basic_filebuf(){ + sync(); + close(); + delete [] pbuffer; + delete [] gbuffer; + pbuffer = 0; + gbuffer = 0; + } + + + //Members: + + _UCXXEXPORT bool is_open() const{ + if(fp == 0){ + return false; + } + return true; + } + + _UCXXEXPORT basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode){ + bool move_end = (mode & ios_base::ate) != 0; + if(is_open() !=false){ //Must call close() first + return 0; + } + basic_streambuf<charT,traits>::openedFor = mode; + mode = mode & ~ios_base::ate; + + if(mode == ios_base::out || mode == (ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w" ); + }else if((mode & ios_base::app) && ! (mode & ios_base::trunc)){ + if(mode & ios_base::binary){ + if(mode & ios_base::in){ + fp = fopen(s, "a+b"); + }else{ + fp = fopen(s, "ab"); + } + }else{ + if(mode & ios_base::in){ + fp = fopen(s, "a+"); + }else{ + fp = fopen(s, "a"); + } + } + }else if(mode == ios_base::in){ + fp = fopen(s, "r"); + }else if(mode == (ios_base::in | ios_base::out)){ + fp = fopen(s, "r+"); + }else if(mode == (ios_base::in | ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w+"); + }else if(mode == (ios_base::binary | ios_base::out)){ + fp = fopen(s, "wb"); + }else if(mode == (ios_base::in | ios_base::binary)){ + fp = fopen(s, "rb"); + }else if(mode == (ios_base::in | ios_base::binary | ios_base::out)){ + fp = fopen(s, "r+b"); + }else if(mode==(ios_base::binary | ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w+b"); + }else if(mode == (ios_base::in | ios_base::binary | ios_base::out | ios_base::trunc)){ + fp = fopen(s, "w+b"); + } + + if(fp == 0){ + return 0; + } + if(ferror(fp)){ + fclose(fp); + fp=0; + return 0; + } + int retval = 0; + + //Check to make sure the stream is good + if(move_end == true){ + retval = fseek(fp, 0, SEEK_END); + }else{ + retval = fseek(fp, 0, SEEK_SET); + } + if(retval!=0){ //Seek error + fclose(fp); + fp=0; + return 0; + } + + basic_streambuf<charT,traits>::mgnext = basic_streambuf<charT,traits>::mgend; + + return this; + } + _UCXXEXPORT basic_filebuf<charT,traits>* close(){ + if(fp != 0 && fp != stdin && fp != stdout && fp !=stderr ){ + overflow(); + sync(); + int retval = fclose(fp); + if(retval !=0){ //Error of some sort + return 0; + } + fp=0; + } + return this; + } + protected: + _UCXXEXPORT basic_filebuf(const basic_filebuf<charT,traits> &){ } + _UCXXEXPORT basic_filebuf<charT,traits> & operator=(const basic_filebuf<charT,traits> &){ return *this; } + + //Overridden virtual functions: + + virtual _UCXXEXPORT int showmanyc(){ + return basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr(); + } + virtual _UCXXEXPORT int_type underflow(){ + /* Some variables used internally: + Buffer pointers: + charT * mgbeg; + charT * mgnext; + charT * mgend; + + eback() returns mgbeg + gptr() returns mgnext + egptr() returns mgend + + gbump(int n) mgnext+=n + + */ + + if(!is_open()){ + return traits::eof(); + } + + if(basic_streambuf<charT,traits>::eback() == 0){ + //No buffer, so... + charT c; + int retval; + retval = fread(&c, sizeof(charT), 1, fp); + + if(retval == 0 || feof(fp) || ferror(fp) ){ + return traits::eof(); + } + return traits::to_int_type(c); + } + + if(basic_streambuf<charT,traits>::eback() == basic_streambuf<charT,traits>::gptr()){ //Buffer is full + return traits::to_int_type(*basic_streambuf<charT,traits>::gptr()); + } + //Shift entire buffer back to the begining + size_t offset = basic_streambuf<charT,traits>::gptr() - basic_streambuf<charT,traits>::eback(); + size_t amountData = basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr(); + + for(charT * i = basic_streambuf<charT,traits>::gptr(); i < basic_streambuf<charT,traits>::egptr(); ++i){ + *(i-offset) = *i; + } + + size_t retval = 0; + //Save operating flags from file descriptor + int fcntl_flags = fcntl(fileno(fp), F_GETFL); + retval = 0; + + //Set to non_blocking mode + fcntl(fileno(fp), F_SETFL, fcntl_flags | O_NONBLOCK); + + //Fill rest of buffer + retval = fread(basic_streambuf<charT,traits>::egptr() - + basic_streambuf<charT,traits>::gptr() + basic_streambuf<charT,traits>::eback(), + sizeof(charT), + offset, + fp + ); + + //Clear problems where we didn't read in enough characters + if(EAGAIN == errno){ + clearerr(fp); + } + + //Restore file descriptor clase + fcntl(fileno(fp), F_SETFL, fcntl_flags); + + //Now we are going to make sure that we read in at least one character. The hard way. + if(retval == 0){ + fcntl_flags = fcntl(fileno(fp), F_GETFL); + //Set to blocking mode + fcntl(fileno(fp), F_SETFL, fcntl_flags & ~O_NONBLOCK); + + retval = fread(basic_streambuf<charT,traits>::egptr() - + basic_streambuf<charT,traits>::gptr() + basic_streambuf<charT,traits>::eback(), + sizeof(charT), + 1, + fp + ); + + //Restore file descriptor clase + fcntl(fileno(fp), F_SETFL, fcntl_flags); + + } + + if(retval !=offset){ //Slide buffer forward again + for(size_t i = 0; i < amountData + retval; ++i){ + *(basic_streambuf<charT,traits>::egptr() - i - 1) = + *(basic_streambuf<charT,traits>::eback() + amountData + retval - i - 1); + } + } + + basic_streambuf<charT,traits>::mgnext -= retval; + + if( (retval <= 0 && feof(fp)) || ferror(fp) ){ + return traits::eof(); + } + + return traits::to_int_type(*basic_streambuf<charT,traits>::gptr()); + } + virtual _UCXXEXPORT int_type uflow(){ + bool dobump = (basic_streambuf<charT,traits>::gptr() != 0); + int_type retval = underflow(); + if(dobump){ + basic_streambuf<charT,traits>::gbump(1); + } + return retval; + } + virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()){ + if(is_open() == false || + basic_streambuf<charT,traits>::gptr() == basic_streambuf<charT,traits>::eback()) + { + return traits::eof(); + } + if(traits::eq_int_type(c,traits::eof()) == false){ + if(traits::eq(traits::to_char_type(c), basic_streambuf<charT,traits>::gptr()[-1]) == true){ + basic_streambuf<charT,traits>::gbump(-1); + }else{ + basic_streambuf<charT,traits>::gbump(-1); + basic_streambuf<charT,traits>::gptr()[0] = c; + } + return c; + }else{ + basic_streambuf<charT,traits>::gbump(-1); + return traits::not_eof(c); + } + } + + virtual _UCXXEXPORT int_type overflow(int_type c = traits::eof()){ + if(is_open() == false){ + //Can't do much + return traits::eof(); + } + if(basic_streambuf<charT,traits>::pbase() == 0){ //Unbuffered - elliminate dupe code below + if(fputc(c, fp) == EOF){ + return traits::eof(); + } + return c; + } + if(basic_streambuf<charT,traits>::pbase() == 0 && traits::eq_int_type(c,traits::eof()) ){ + //Nothing to flush + return traits::not_eof(c); + } + size_t r = basic_streambuf<charT,traits>::pptr() - basic_streambuf<charT,traits>::pbase(); + + if( r == 0 && traits::eq_int_type(c,traits::eof()) ){ + return traits::not_eof(c); + }else if (r == 0 ){ + if(fputc(c, fp) == EOF){ + return traits::eof(); + } + return c; + } + + size_t totalChars = r; + + char_type *buffer = 0; + if(traits::eq_int_type(c,traits::eof())){ + buffer = new char_type[r]; + }else{ + buffer = new char_type[r+1]; + buffer[r] = c; + totalChars++; + } + + traits::copy(buffer, basic_streambuf<charT,traits>::pbase(), r); +// memcpy(buffer, basic_streambuf<charT,traits>::pbase(), r); + + size_t retval = fwrite(buffer, sizeof(charT), totalChars, fp); + if(retval !=totalChars){ + if(retval == 0){ + delete [] buffer; + return traits::eof(); + } + basic_streambuf<charT,traits>::pbump(-retval); + fprintf(stderr, "***** Did not write the full buffer out. Should be: %d, actually: %d\n", + totalChars, retval); + }else{ + basic_streambuf<charT,traits>::pbump(-r); + } + + delete [] buffer; + return traits::not_eof(c); + } + + virtual _UCXXEXPORT basic_streambuf<charT,traits>* setbuf(char_type* s, streamsize n){ + if(s == 0 && n == 0){ //Unbuffered + if(pbuffer !=0){ + delete [] pbuffer; + } + if(gbuffer !=0){ + delete [] gbuffer; + } + pbuffer = 0; + gbuffer = 0; + }else if(basic_streambuf<charT,traits>::gptr() !=0 && + basic_streambuf<charT,traits>::gptr()==basic_streambuf<charT,traits>::egptr()) + { + delete [] pbuffer; + pbuffer = s; + } + return this; + } + virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way, + ios_base::openmode = ios_base::in | ios_base::out) + { + if(is_open() == false){ + return -1; + } + int whence = SEEK_SET; // if(way == basic_ios<charT>::beg) + off_type position = off; + + if(way == basic_ios<charT>::cur){ + whence = SEEK_CUR; + position -= (basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr()); + }else if(way == basic_ios<charT>::end){ + whence = SEEK_END; + } + + sync(); + + int retval = fseek( + fp, + sizeof(charT)*(position), + whence + ); + + //Invalidate read buffer + basic_streambuf<charT,traits>::gbump( + basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr() + ); + + if(-1 != retval){ + retval = ftell(fp); + } + + return retval; + } + virtual _UCXXEXPORT pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | ios_base::out){ + if(is_open() == false){ + return -1; + } + sync(); + + int retval = fseek(fp,sizeof(charT)* sp, SEEK_SET); + + //Invalidate read buffer + basic_streambuf<charT,traits>::gbump(basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr()); + if(retval > -1){ + return sp; + } + return -1; + } + virtual _UCXXEXPORT int sync(){ + if(pbuffer !=0){ + if(overflow() == traits::eof()){ + return -1; + } + } + if(0 != fp && 0 != fflush(fp)){ + return -1; + } + return 0; + } + virtual _UCXXEXPORT void imbue(const locale&){ + return; + } + + + virtual _UCXXEXPORT streamsize xsputn(const char_type* s, streamsize n){ + if(is_open() == false){ + return 0; + } + //Check to see if buffered + + //Check to see if we can buffer the data + streamsize buffer_avail = basic_streambuf<charT,traits>::epptr() - basic_streambuf<charT,traits>::pptr(); + + if(n > buffer_avail){ //Flush buffer and write directly + overflow(); //Flush the buffer + return fwrite(s, sizeof(charT), n, fp); + } + + //Add to buffer to be written later + + traits::copy(basic_streambuf<charT,traits>::pptr(), s, n); + basic_streambuf<charT,traits>::pbump(n); + + return n; + } + + FILE * fp; + char_type * pbuffer; + char_type * gbuffer; + bool append; + }; + + +#ifdef __UCLIBCXX_HAS_WCHAR__ + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::overflow(int_type c); + +template <> _UCXXEXPORT basic_filebuf<wchar_t, char_traits<wchar_t> >::int_type + basic_filebuf<wchar_t, char_traits<wchar_t> >::underflow(); + +#endif //__UCLIBCXX_HAS_WCHAR__ + + + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_FSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT filebuf::basic_filebuf(); + template <> _UCXXEXPORT filebuf::~basic_filebuf(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT filebuf::int_type filebuf::pbackfail(filebuf::int_type c); + template <> _UCXXEXPORT filebuf * filebuf::open(const char* s, ios_base::openmode mode); + template <> _UCXXEXPORT filebuf * filebuf::close(); + template <> _UCXXEXPORT filebuf::int_type filebuf::overflow(filebuf::int_type c); + template <> _UCXXEXPORT filebuf::int_type filebuf::underflow (); + + template <> _UCXXEXPORT basic_streambuf<char, char_traits<char> > * filebuf::setbuf(char * s, streamsize n); + template <> _UCXXEXPORT streamsize filebuf::xsputn(const char* s, streamsize n); + +#endif +#endif + + + template <class charT, class traits> class _UCXXEXPORT basic_ifstream + : public basic_istream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + _UCXXEXPORT basic_ifstream(): basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb){ + //Passing the address of sb + } + explicit _UCXXEXPORT basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in) + : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb) + { + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + + virtual _UCXXEXPORT ~basic_ifstream(){ + + } + + _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{ + return (basic_filebuf<charT,traits>*)&sb; + } + _UCXXEXPORT bool is_open() const{ + return sb.is_open(); + } + _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::in){ + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + _UCXXEXPORT void close(){ + sb.close(); + } + private: + basic_filebuf<charT,traits> sb; + }; + + + template <class charT, class traits> class _UCXXEXPORT basic_ofstream + : public basic_ostream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + _UCXXEXPORT basic_ofstream() : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb){ + + } + + virtual _UCXXEXPORT ~basic_ofstream(); + + explicit _UCXXEXPORT basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc) : + basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb) + { + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + + _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{ + return (basic_filebuf<charT,traits>*)&sb; + } + + _UCXXEXPORT bool is_open() const{ + return sb.is_open(); + } + _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc){ + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + _UCXXEXPORT void close(){ + sb.close(); + } + private: + basic_filebuf<charT,traits> sb; + }; + + template <class charT, class traits> _UCXXEXPORT basic_ofstream<charT, traits>::~basic_ofstream(){ + basic_ostream<charT, traits>::flush(); + } + + + template <class charT, class traits> class _UCXXEXPORT basic_fstream + : public basic_iostream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type ins_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + _UCXXEXPORT basic_fstream(): basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb){ } + + explicit _UCXXEXPORT basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out): + basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb) + { + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + + _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{ + return (basic_filebuf<charT,traits>*)&sb; + } + _UCXXEXPORT bool is_open() const{ + return sb.is_open(); + } + _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out){ + if(sb.open(s, mode) == 0){ + basic_ios<charT,traits>::setstate(ios_base::failbit); + } + } + _UCXXEXPORT void close(){ + sb.close(); + } + private: + basic_filebuf<charT,traits> sb; + }; + + + +#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_FSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(); + template <> _UCXXEXPORT basic_ofstream<char, char_traits<char> >::basic_ofstream(const char* s, ios_base::openmode mode); + template <> _UCXXEXPORT basic_ofstream<char, char_traits<char> >::~basic_ofstream(); + + template <> _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(); + template <> _UCXXEXPORT basic_ifstream<char, char_traits<char> >::basic_ifstream(const char* s, ios_base::openmode mode); + template <> _UCXXEXPORT basic_ifstream<char, char_traits<char> >::~basic_ifstream(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif +#endif + + + +} + +#endif + +#endif \ No newline at end of file diff --git a/i386/modules/uClibcxx/include/func_exception b/i386/modules/uClibcxx/include/func_exception new file mode 100644 index 0000000..e0374dd --- /dev/null +++ b/i386/modules/uClibcxx/include/func_exception @@ -0,0 +1,37 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> + + +#ifndef HEADER_IMPLEMENTATION_FUNC_EXCEPTION +#define HEADER_IMPLEMENTATION_FUNC_EXCEPTION + +namespace std{ + + _UCXXEXPORT void __throw_bad_alloc(); + _UCXXEXPORT void __throw_out_of_range(const char * message = 0); + _UCXXEXPORT void __throw_overflow_error(const char * message = 0); + _UCXXEXPORT void __throw_length_error(const char * message = 0); + _UCXXEXPORT void __throw_invalid_argument(const char * message = 0); +} + +#endif + diff --git a/i386/modules/uClibcxx/include/functional b/i386/modules/uClibcxx/include/functional new file mode 100644 index 0000000..beb6eeb --- /dev/null +++ b/i386/modules/uClibcxx/include/functional @@ -0,0 +1,435 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#ifndef __STD_HEADER_FUNCTIONAL +#define __STD_HEADER_FUNCTIONAL 1 + +#include <basic_definitions> + +namespace std{ + + template <class Arg, class Result> struct unary_function; + template <class Arg1, class Arg2, class Result> struct binary_function; + + template <class T> struct plus; + template <class T> struct minus; + template <class T> struct multiplies; + template <class T> struct divides; + template <class T> struct modulus; + template <class T> struct negate; + + template <class T> struct equal_to; + template <class T> struct not_equal_to; + template <class T> struct greater; + template <class T> struct less; + template <class T> struct greater_equal; + template <class T> struct less_equal; + + template <class T> struct logical_and; + template <class T> struct logical_or; + template <class T> struct logical_not; + + template <class Predicate> class unary_negate; + template <class Predicate> unary_negate<Predicate> not1(const Predicate&); + template <class Predicate> class binary_negate; + template <class Predicate> binary_negate<Predicate> not2(const Predicate&); + + + template <class Operation> class binder1st; + template <class Operation, class T> binder1st<Operation> bind1st(const Operation&, const T&); + template <class Operation> class binder2nd; + template <class Operation, class T> binder2nd<Operation> bind2nd(const Operation&, const T&); + + template <class Arg, class Result> class pointer_to_unary_function; + template <class Arg, class Result> pointer_to_unary_function<Arg,Result> ptr_fun(Result (*)(Arg)); + template <class Arg1, class Arg2, class Result> class pointer_to_binary_function; + template <class Arg1, class Arg2, class Result> + pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*)(Arg1,Arg2)); + + template<class S, class T> class mem_fun_t; + template<class S, class T, class A> class mem_fun1_t; + template<class S, class T> class const_mem_fun_t; + template<class S, class T, class A> class const_mem_fun1_t; + template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); + template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); + template<class S, class T> class mem_fun_ref_t; + template<class S, class T, class A> class mem_fun1_ref_t; + template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); + template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun1_ref(S (T::*f)(A)); + + //Implementation + + template <class Arg, class Result> struct _UCXXEXPORT unary_function{ + typedef Arg argument_type; + typedef Result result_type; + }; + + + template <class Arg1, class Arg2, class Result> struct _UCXXEXPORT binary_function{ + typedef Arg1 first_argument_type; + typedef Arg2 second_argument_type; + typedef Result result_type; + }; + + template <class T> struct _UCXXEXPORT plus : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x + y; + } + }; + + template <class T> struct _UCXXEXPORT minus : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x - y; + } + }; + + template <class T> struct _UCXXEXPORT multiplies : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x * y; + } + }; + + template <class T> struct _UCXXEXPORT divides : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x / y; + } + }; + + template <class T> struct _UCXXEXPORT modulus : binary_function<T,T,T>{ + T operator()(const T& x, const T& y) const{ + return x % y; + } + }; + + template <class T> struct _UCXXEXPORT negate : unary_function<T,T>{ + T operator()(const T& x) const{ + return -x; + } + }; + + template <class T> struct _UCXXEXPORT equal_to : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x == y); + } + }; + + template <class T> struct _UCXXEXPORT not_equal_to : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x != y); + } + }; + + template <class T> struct _UCXXEXPORT greater : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x > y); + } + }; + + template <class T> struct _UCXXEXPORT less : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x < y); + } + }; + + template <class T> struct _UCXXEXPORT greater_equal : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x >= y); + } + }; + + template <class T> struct _UCXXEXPORT less_equal : binary_function<T,T,bool>{ + bool operator()(const T& x, const T& y) const{ + return (x <= y); + } + }; + + template <class T> struct _UCXXEXPORT logical_and : binary_function<T,T,bool> { + bool operator()(const T& x, const T& y) const{ + return (x && y); + } + }; + + template <class T> struct _UCXXEXPORT logical_or : binary_function<T,T,bool> { + bool operator()(const T& x, const T& y) const{ + return (x || y); + } + }; + + template <class T> struct _UCXXEXPORT logical_not : unary_function<T,bool> { + bool operator()(const T& x) const{ + return !x; + } + }; + + template <class Predicate> class _UCXXEXPORT unary_negate + : public unary_function<typename Predicate::argument_type,bool> + { + public: + explicit unary_negate(const Predicate& pred) : p(pred) { } + bool operator()(const typename Predicate::argument_type& x) const{ + return !p(x); + } + private: + Predicate p; + }; + + + template <class Predicate> _UCXXEXPORT unary_negate<Predicate> not1(const Predicate& pred){ + return unary_negate<Predicate>(pred); + } + + + template <class Predicate> class _UCXXEXPORT binary_negate : public + binary_function<typename Predicate::first_argument_type, + typename Predicate::second_argument_type, bool> + { + public: + explicit binary_negate(const Predicate& pred) : p(pred) { } + bool operator()(const typename Predicate::first_argument_type& x, + const typename Predicate::second_argument_type& y) const + { + return !p(x, y); + } + private: + Predicate p; + }; + + + template <class Predicate> _UCXXEXPORT binary_negate<Predicate> not2(const Predicate& pred){ + return binary_negate<Predicate>(pred); + } + + + template <class Operation> class _UCXXEXPORT binder1st + : public unary_function<typename Operation::second_argument_type, + typename Operation::result_type> + { + protected: + Operation op; + typename Operation::first_argument_type value; + public: + binder1st(const Operation& x, const typename Operation::first_argument_type& y) : op(x), value(y){ } + typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const{ + return op(value,x); + } + }; + + + template <class Operation, class T> _UCXXEXPORT binder1st<Operation> bind1st(const Operation& op, const T& x){ + return binder1st<Operation>(op, typename Operation::first_argument_type(x)); + } + + + template <class Operation> class _UCXXEXPORT binder2nd + : public unary_function<typename Operation::first_argument_type, + typename Operation::result_type> + { + protected: + Operation op; + typename Operation::second_argument_type value; + public: + binder2nd(const Operation& x, const typename Operation::second_argument_type& y) : op(x), value(y) { } + typename Operation::result_type operator()(const typename Operation::first_argument_type& x) const{ + return op(x,value); + } + }; + + + template <class Operation, class T> _UCXXEXPORT + binder2nd<Operation> bind2nd(const Operation& op, const T& x) + { + return binder2nd<Operation>(op, typename Operation::second_argument_type(x)); + } + + + template <class Arg, class Result> class _UCXXEXPORT + pointer_to_unary_function : public unary_function<Arg, Result> + { + protected: + Result (*func)(Arg); + public: + explicit pointer_to_unary_function(Result (*f)(Arg)) : func(f) { } + Result operator()(Arg x) const{ + return func(x); + } + }; + + + template <class Arg, class Result> _UCXXEXPORT pointer_to_unary_function<Arg, Result> ptr_fun(Result (*f)(Arg)){ + return pointer_to_unary_function<Arg, Result>(f); + } + + + template <class Arg1, class Arg2, class Result> class _UCXXEXPORT + pointer_to_binary_function : public binary_function<Arg1,Arg2,Result> + { + protected: + Result (*func)(Arg1, Arg2); + public: + explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)) : func(f) { } + Result operator()(Arg1 x, Arg2 y) const{ + return func(x, y); + } + }; + + template <class Arg1, class Arg2, class Result> _UCXXEXPORT + pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1, Arg2)) + { + return pointer_to_binary_function<Arg1,Arg2,Result>(f); + } + + + template <class S, class T> class _UCXXEXPORT mem_fun_t + : public unary_function<T*, S> + { + public: + explicit mem_fun_t(S (T::*p)()) : m(p) { } + S operator()(T* p) const { return (p->*m)(); } + private: + S (T::*m)(); + }; + + + template <class S, class T, class A> class _UCXXEXPORT mem_fun1_t + : public binary_function<T*, A, S> + { + public: + explicit mem_fun1_t(S (T::*p)(A)) : m(p) { } + S operator()(T* p, A x) const { return (p->*m)(x); } + private: + S (T::*m)(A); + }; + + + template <class S, class T> class _UCXXEXPORT const_mem_fun_t + : public unary_function<const T*, S> + { + public: + explicit const_mem_fun_t(S (T::*p)() const) : m(p) { } + S operator()(const T* p) const { return (p->*m)(); } + private: + S (T::*m)() const; + }; + + + template <class S, class T, class A> class _UCXXEXPORT const_mem_fun1_t + : public binary_function<T*, A, S> + { + public: + explicit const_mem_fun1_t(S (T::*p)(A) const) : m(p) { } + S operator()(const T* p, A x) const { return (p->*m)(x); } + private: + S (T::*m)(A) const; + }; + + + template<class S, class T> _UCXXEXPORT mem_fun_t<S,T> mem_fun(S (T::*f)()){ + return mem_fun_t<S, T>(f); + } + + template<class S, class T> _UCXXEXPORT const_mem_fun_t<S,T> mem_fun(S (T::*f)() const){ + return const_mem_fun_t<S, T>(f); + } + + template<class S, class T, class A> _UCXXEXPORT mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)){ + return mem_fun1_t<S, T, A>(f); + } + + template<class S, class T, class A> _UCXXEXPORT const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const){ + return const_mem_fun1_t<S, T, A>(f); + } + + template <class S, class T> class _UCXXEXPORT mem_fun_ref_t + : public unary_function<T, S> + { + public: + explicit mem_fun_ref_t(S (T::*p)()) : mf(p) { } + S operator()(T& p) { return (p.*mf)(); } + private: + S (T::*mf)(); + }; + + template <class S, class T, class A> class _UCXXEXPORT mem_fun1_ref_t + : public binary_function<T, A, S> + { + public: + explicit mem_fun1_ref_t(S (T::*p)(A)) : mf(p) { } + S operator()(T& p, A x) { return (p.*mf)(x); } + private: + S (T::*mf)(A); + }; + + template<class S, class T> _UCXXEXPORT mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()){ + return mem_fun_ref_t<S,T>(f); + } + + template<class S, class T, class A> _UCXXEXPORT mem_fun1_ref_t<S,T,A> mem_fun1_ref(S (T::*f)(A)){ + return mem_fun1_ref_t<S,T,A>(f); + } + + +} + + +//These are SGI extensions which are checked for by some conformance checks. They +// are *NOT* part of the C++ standard, however + +template <class Op1, class Op2> class _UCXXEXPORT unary_compose : + public std::unary_function<typename Op2::argument_type, + typename Op1::result_type> +{ +protected: + Op1 mf1; + Op2 mf2; +public: + unary_compose(const Op1& x, const Op2& y) : mf1(x), mf2(y) { } + typename Op1::result_type operator()(const typename Op2::argument_type& x) const { + return mf1(mf2(x)); + } +}; + +template <class Op1, class Op2> _UCXXEXPORT +inline unary_compose<Op1, Op2> +compose1(const Op1& fn1, const Op2& fn2){ + return unary_compose<Op1, Op2>(fn1, fn2); +} + +template <class Op1, class Op2, class Op3> class _UCXXEXPORT binary_compose : + public std::unary_function<typename Op2::argument_type, typename Op1::result_type> +{ +protected: + Op1 mf1; + Op2 mf2; + Op3 mf3; +public: + binary_compose(const Op1 & x, const Op2 & y, const Op3 & z) + : mf1(x), mf2(y), mf3(z){ } + typename Op1::result_type operator()(const typename Op2::argument_type & x) const { + return mf1(mf2(x), mf3(x)); + } +}; + +template <class Op1, class Op2, class Op3> inline _UCXXEXPORT binary_compose<Op1, Op2, Op3> +compose2(const Op1 & fn1, const Op2 & fn2, const Op3 & fn3){ + return binary_compose<Op1, Op2, Op3>(fn1, fn2, fn3); +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/iomanip b/i386/modules/uClibcxx/include/iomanip new file mode 100644 index 0000000..e547587 --- /dev/null +++ b/i386/modules/uClibcxx/include/iomanip @@ -0,0 +1,166 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <ios> + +#ifndef __STD_IOMANIP +#define __STD_IOMANIP 1 + +namespace std{ + +// These are the helper classes which we are going to be using to +// hold the required data + +class _UCXXEXPORT __resetiosflags{ +public: + ios_base::fmtflags m; + _UCXXEXPORT __resetiosflags(ios_base::fmtflags mask) : m(mask){ } +}; + +class _UCXXEXPORT __setiosflags{ +public: + ios_base::fmtflags m; + _UCXXEXPORT __setiosflags(ios_base::fmtflags mask) : m(mask){ } +}; + +class _UCXXEXPORT __setbase{ +public: + int base; + _UCXXEXPORT __setbase(int b) : base(b){ } +}; + +class _UCXXEXPORT __setfill{ +public: + int character; + _UCXXEXPORT __setfill(int c): character(c){ } +}; + +class _UCXXEXPORT __setprecision{ +public: + int digits; + _UCXXEXPORT __setprecision(int n): digits(n) { } +}; + +class _UCXXEXPORT __setw{ +public: + int width; + _UCXXEXPORT __setw(int n): width(n) { } +}; + + +//Actual manipulator functions + +inline __resetiosflags resetiosflags(ios_base::fmtflags mask){ + return __resetiosflags(mask); +} + +inline __setiosflags setiosflags(ios_base::fmtflags mask){ + return __setiosflags(mask); +} + +inline __setbase setbase(int b){ + return __setbase(b); +} + +inline __setfill setfill(int c){ + return __setfill(c); +} + +inline __setprecision setprecision(int n){ + return __setprecision(n); +} + +inline __setw setw(int n){ + return __setw(n); +} + + +//How to handle interaction with [i|o]stream classes + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __resetiosflags s) +{ + os.setf(ios_base::fmtflags(0),s.m); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_istream<Ch, Tr>& + operator>>(basic_istream<Ch, Tr>& is, const __resetiosflags s) +{ + is.setf(ios_base::fmtflags(0),s.m); + return is; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setiosflags s) +{ + os.setf(s.m); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setbase s) +{ + ios_base::fmtflags f(0); + switch(s.base){ + case 8: + f = ios_base::oct; + break; + case 10: + f = ios_base::dec; + break; + case 16: + f = ios_base::hex; + break; + default: + break; + + } + os.setf(f, ios_base::basefield); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setfill s) +{ + os.fill(s.character); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setprecision s) +{ + os.precision(s.digits); + return os; +} + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, const __setw s) +{ + os.width(s.width); + return os; +} + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/ios b/i386/modules/uClibcxx/include/ios new file mode 100644 index 0000000..ded00e4 --- /dev/null +++ b/i386/modules/uClibcxx/include/ios @@ -0,0 +1,497 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <locale> +#include <iosfwd> + +#ifndef __HEADER_STD_IOS +#define __HEADER_STD_IOS 1 + +namespace std{ + typedef signed long int streamoff; + + template <class stateT> class fpos; + + class _UCXXEXPORT ios_base { + public: + class failure; +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + class failure : public exception { + public: + explicit failure(const std::string& msg) { } + explicit failure() { } + virtual const char* what() const throw() { + return "std::ios_base failure exception"; + } + }; +#endif +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + class _UCXXLOCAL Init{ + public: + _UCXXEXPORT Init(); + _UCXXEXPORT ~Init(); + private: + static int init_cnt; + }; +#endif + + public: + + typedef unsigned short int fmtflags; + + static const fmtflags skipws = 0x0001; + + static const fmtflags left = 0x0002; + static const fmtflags right = 0x0004; + static const fmtflags internal = 0x0008; + + static const fmtflags boolalpha = 0x0010; + + static const fmtflags dec = 0x0020; + static const fmtflags oct = 0x0040; + static const fmtflags hex = 0x0080; + + static const fmtflags scientific = 0x0100; + static const fmtflags fixed = 0x0200; + + static const fmtflags showbase = 0x0400; + static const fmtflags showpoint = 0x0800; + static const fmtflags showpos = 0x1000; + static const fmtflags uppercase = 0x2000; + + static const fmtflags adjustfield = left | right | internal; + static const fmtflags basefield = dec | oct | hex; + static const fmtflags floatfield = fixed | scientific; + + static const fmtflags unitbuf = 0x4000; + + typedef unsigned char iostate; + static const iostate goodbit = 0x00; + static const iostate badbit = 0x01; + static const iostate eofbit = 0x02; + static const iostate failbit = 0x04; + + typedef unsigned char openmode; + static const openmode app = 0x01; + static const openmode ate = 0x02; + static const openmode binary = 0x04; + static const openmode in = 0x08; + static const openmode out = 0x10; + static const openmode trunc = 0x20; + + typedef unsigned char seekdir; + static const seekdir beg = 0x01; + static const seekdir cur = 0x02; + static const seekdir end = 0x04; + + _UCXXEXPORT fmtflags flags() const{ + return mformat; + } + _UCXXEXPORT fmtflags flags(fmtflags fmtfl); + + fmtflags setf(fmtflags fmtfl); + fmtflags setf(fmtflags fmtfl, fmtflags mask ); + + _UCXXEXPORT void unsetf(fmtflags mask){ + mformat&= ~mask; + } + + _UCXXEXPORT streamsize precision() const{ + return mprecision; + } + + _UCXXEXPORT streamsize precision(streamsize prec); + + _UCXXEXPORT streamsize width() const{ + return mwidth; + } + + _UCXXEXPORT streamsize width(streamsize wide); + + _UCXXEXPORT locale imbue(const locale& loc); + + _UCXXEXPORT locale getloc() const{ + return mLocale; + } + +// FIXME - These need to be implemented +// static int xalloc(); +// long& iword(int index); +// void*& pword(int index); + + _UCXXEXPORT ~ios_base() { } + + enum event { erase_event, imbue_event, copyfmt_event }; + + typedef void (*event_callback)(event, ios_base&, int index); +// void register_callback(event_call_back fn, int index); + + //We are going to wrap stdio so we don't need implementation of the following: + inline static bool sync_with_stdio(bool = true) { return true; } + + protected: + _UCXXEXPORT ios_base() : mLocale(), mformat(dec | skipws ), mstate(goodbit), + mmode(), mdir(), mprecision(6), mwidth(0) +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + ,mInit() +#endif + { + + } + locale mLocale; + fmtflags mformat; + iostate mstate; + openmode mmode; + seekdir mdir; + streamsize mprecision; + streamsize mwidth; +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + Init mInit; +#endif + }; + + + //ios_base manipulators + + + inline ios_base& boolalpha (ios_base& str){ + str.setf(ios_base::boolalpha); + return str; + } + inline ios_base& noboolalpha(ios_base& str){ + str.unsetf(ios_base::boolalpha); + return str; + } + inline ios_base& showbase (ios_base& str){ + str.setf(ios_base::showbase); + return str; + } + inline ios_base& noshowbase (ios_base& str){ + str.unsetf(ios_base::showbase); + return str; + } + inline ios_base& showpoint (ios_base& str){ + str.setf(ios_base::showpoint); + return str; + } + inline ios_base& noshowpoint(ios_base& str){ + str.unsetf(ios_base::showpoint); + return str; + } + inline ios_base& showpos (ios_base& str){ + str.setf(ios_base::showpos); + return str; + } + inline ios_base& noshowpos (ios_base& str){ + str.unsetf(ios_base::showpos); + return str; + } + inline ios_base& skipws (ios_base& str){ + str.setf(ios_base::skipws); + return str; + } + inline ios_base& noskipws (ios_base& str){ + str.unsetf(ios_base::skipws); + return str; + } + inline ios_base& uppercase (ios_base& str){ + str.setf(ios_base::uppercase); + return str; + } + inline ios_base& nouppercase(ios_base& str){ + str.unsetf(ios_base::uppercase); + return str; + } + + inline ios_base& unitbuf (ios_base& str){ + str.setf(ios_base::unitbuf); + return str; + } + inline ios_base& nounitbuf (ios_base& str){ + str.unsetf(ios_base::unitbuf); + return str; + } + inline ios_base& internal (ios_base& str){ + str.setf(ios_base::internal, ios_base::adjustfield); + return str; + } + inline ios_base& left (ios_base& str){ + str.setf(ios_base::left, ios_base::adjustfield); + return str; + } + inline ios_base& right (ios_base& str){ + str.setf(ios_base::right, ios_base::adjustfield); + return str; + } + + inline ios_base& dec (ios_base& str){ + str.setf(ios_base::dec, ios_base::basefield); + return str; + } + inline ios_base& hex (ios_base& str){ + str.setf(ios_base::hex, ios_base::basefield); + return str; + } + inline ios_base& oct (ios_base& str){ + str.setf(ios_base::oct, ios_base::basefield); + return str; + } + + inline ios_base& fixed (ios_base& str){ + str.setf(ios_base::fixed, ios_base::floatfield); + return str; + } + inline ios_base& scientific (ios_base& str){ + str.setf(ios_base::scientific, ios_base::floatfield); + return str; + } + + + //basic_ios class definition + + + template <class charT, class traits > class _UCXXEXPORT basic_ios + : public ios_base + { + public: + // Types: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef traits traits_type; + + _UCXXEXPORT operator void*() const{ + if(fail() ){ + return 0; + } + return (void *)(1); //Must return a non-NULL pointer (though it can be *any* pointer) + } + + _UCXXEXPORT bool operator!() const{ + return fail(); + } + _UCXXEXPORT iostate rdstate() const{ + return mstate; + } + _UCXXEXPORT void clear(iostate state = goodbit){ + if(rdbuf()!=0){ + mstate = state; + }else{ + mstate = state|ios_base::badbit; + } + } + _UCXXEXPORT void setstate(iostate state) { + clear(rdstate() | state); +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + if(rdstate() & throw_mask){ + throw failure(); + } +#endif + } + + _UCXXEXPORT bool good() const{ + return (rdstate() == 0); + } + _UCXXEXPORT bool eof() const{ + if(rdstate() & eofbit){ + return true; + } + return false; + } + _UCXXEXPORT bool fail() const{ + if( mstate & (failbit | badbit) ){ + return true; + } + return false; + } + + _UCXXEXPORT bool bad() const{ + if(mstate & badbit){ + return true; + } + return false; + } + + _UCXXEXPORT iostate exceptions() const{ + return throw_mask; + } + _UCXXEXPORT void exceptions(iostate except){ + throw_mask = except; + } + + explicit _UCXXEXPORT basic_ios(basic_streambuf<charT,traits>* sb) : fill_char(' '), mtied(0), mstreambuf(0){ + init(sb); + } + + basic_ios() : mtied(0), mstreambuf(0){ } + + virtual _UCXXEXPORT ~basic_ios(){ + } + + _UCXXEXPORT basic_ostream<charT,traits>* tie() const{ + return mtied; + } + _UCXXEXPORT basic_ostream<charT,traits>* tie(basic_ostream<charT,traits>* tiestr){ + basic_ostream<charT,traits>* retval= mtied; + mtied = tiestr; + return retval; + } + _UCXXEXPORT basic_streambuf<charT,traits>* rdbuf() const{ + return mstreambuf; + } + _UCXXEXPORT basic_streambuf<charT,traits>* rdbuf(basic_streambuf<charT,traits>* sb){ + basic_streambuf<charT,traits>* retval = mstreambuf; + mstreambuf = sb; + return retval; + } + _UCXXEXPORT basic_ios& copyfmt(const basic_ios& rhs); + _UCXXEXPORT char_type fill() const{ + return fill_char; + } + _UCXXEXPORT char_type fill(char_type ch){ + char_type temp = fill_char; + fill_char = ch; + return temp; + } + + _UCXXEXPORT locale imbue(const locale& loc){ + return ios_base::imbue(loc); + } + _UCXXEXPORT char narrow(char_type c, char dfault) const; + _UCXXEXPORT char_type widen(char c) const; + + protected: + char_type fill_char; + basic_ostream<charT,traits>* mtied; + basic_streambuf<charT,traits>* mstreambuf; + iostate throw_mask; + _UCXXEXPORT basic_ios(const basic_ios<charT,traits> &){ } + _UCXXEXPORT basic_ios<charT,traits> & operator=(const basic_ios<charT,traits> &){ return *this; } + _UCXXEXPORT void init(basic_streambuf<charT,traits>* sb){ + ios_base::mformat = skipws|dec; + mstreambuf = sb; + mstate = goodbit; + throw_mask = goodbit; + } + }; + +#ifdef __UCLIBCXX_EXPAND_IOS_CHAR__ +#ifndef __UCLIBCXX_COMPILE_IOS__ + + template <> _UCXXEXPORT void basic_ios<char, char_traits<char> >::clear(iostate state); + template <> _UCXXEXPORT void basic_ios<char, char_traits<char> >::setstate(iostate state); + +#endif +#endif + + + template <class charT, class traits> + inline char basic_ios<charT, traits>::narrow(char_type c, char dfault) const + { + return dfault; + } + + template <> + inline char basic_ios<char, char_traits<char> >::narrow(char_type c, char) const + { + return c; + } + +#ifdef __UCLIBCXX_HAS_WCHAR__ + + template <> + inline char basic_ios<wchar_t, char_traits<wchar_t> >::narrow(char_type c, char dfault) const + { + char retval = wctob (c); + if(retval == EOF){ + retval = dfault; + } + return retval; + } + +#endif //__UCLIBCXX_HAS_WCHAR__ + + template <class charT, class traits> + inline typename basic_ios<charT, traits>::char_type + basic_ios<charT, traits>::widen(char c) const + { + return c; + } + + template <> + inline basic_ios<char, char_traits<char> >::char_type + basic_ios<char, char_traits<char> >::widen(char c) const + { + return c; + } + +#ifdef __UCLIBCXX_HAS_WCHAR__ + + template <> + inline basic_ios<wchar_t, char_traits<wchar_t> >::char_type + basic_ios<wchar_t, char_traits<wchar_t> >::widen(char c) const + { + return btowc(c); + } + +#endif //__UCLIBCXX_HAS_WCHAR__ + + + template <class stateT> class _UCXXEXPORT fpos{ + public: + _UCXXEXPORT fpos(stateT s){ + st = s; + } + _UCXXEXPORT stateT state() const{ + return st; + } + _UCXXEXPORT void state(stateT s){ + st = s; + } + _UCXXEXPORT bool operator==(const fpos &rhs){ + return st == rhs.st; + } + _UCXXEXPORT bool operator!=(const fpos &rhs){ + return st == rhs.st; + } + _UCXXEXPORT fpos & operator+(const streamoff & o){ + st += o; + return *this; + } + _UCXXEXPORT fpos & operator-(const streamoff & o){ + st -= o; + return *this; + } + _UCXXEXPORT streamoff operator-(const fpos & rhs){ + return st - rhs.st; + } + + + private: + stateT st; + }; + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/iosfwd b/i386/modules/uClibcxx/include/iosfwd new file mode 100644 index 0000000..dc5dc11 --- /dev/null +++ b/i386/modules/uClibcxx/include/iosfwd @@ -0,0 +1,110 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <char_traits> +#include <memory> + + +#ifndef __HEADER_STD_IOSFWD +#define __HEADER_STD_IOSFWD 1 + +namespace std { + class ios_base; + template<> struct char_traits<char>; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + template<> class char_traits<wchar_t>; +#endif + + template <class charT, class traits = char_traits<charT> > class basic_ios; + + template <class charT, class traits = char_traits<charT> > class basic_streambuf; + template <class charT, class traits = char_traits<charT> > class basic_istream; + template <class charT, class traits = char_traits<charT> > class basic_ostream; + template <class charT, class traits = char_traits<charT> > class basic_iostream; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_stringbuf; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_istringstream; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_ostringstream; + + template <class charT, class traits = char_traits<charT>, + class Allocator = allocator<charT> > class basic_stringstream; + + template <class charT, class traits = char_traits<charT> > class basic_filebuf; + + template <class charT, class traits = char_traits<charT> > class basic_ifstream; + + template <class charT, class traits = char_traits<charT> > class basic_ofstream; + + template <class charT, class traits = char_traits<charT> > class basic_fstream; + + template <class charT, class traits = char_traits<charT> > class basic_istreambuf_iterator; + + template <class charT, class traits = char_traits<charT> > class basic_ostreambuf_iterator; + + typedef basic_ios<char> ios; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_ios<wchar_t> wios; +#endif + + typedef basic_streambuf<char> streambuf; + typedef basic_istream<char> istream; + typedef basic_ostream<char> ostream; + typedef basic_iostream<char> iostream; + + typedef basic_stringbuf<char> stringbuf; + typedef basic_istringstream<char> istringstream; + typedef basic_ostringstream<char> ostringstream; + typedef basic_stringstream<char> stringstream; + + typedef basic_filebuf<char> filebuf; + typedef basic_ifstream<char> ifstream; + typedef basic_ofstream<char> ofstream; + typedef basic_fstream<char> fstream; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_streambuf<wchar_t> wstreambuf; + typedef basic_istream<wchar_t> wistream; + typedef basic_ostream<wchar_t> wostream; + typedef basic_iostream<wchar_t> wiostream; + + typedef basic_stringbuf<wchar_t> wstringbuf; + typedef basic_istringstream<wchar_t> wistringstream; + typedef basic_ostringstream<wchar_t> wostringstream; + typedef basic_stringstream<wchar_t> wstringstream; + + typedef basic_filebuf<wchar_t> wfilebuf; + typedef basic_ifstream<wchar_t> wifstream; + typedef basic_ofstream<wchar_t> wofstream; + typedef basic_fstream<wchar_t> wfstream; +#endif + + template <class state> class fpos; + typedef fpos<char_traits<char>::state_type> streampos; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef fpos<char_traits<wchar_t>::state_type> wstreampos; +#endif +} + +#endif diff --git a/i386/modules/uClibcxx/include/iostream b/i386/modules/uClibcxx/include/iostream new file mode 100644 index 0000000..46b85e1 --- /dev/null +++ b/i386/modules/uClibcxx/include/iostream @@ -0,0 +1,97 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef __HEADER_STD_IOSTREAM +#define __HEADER_STD_IOSTREAM 1 + +#include <iosfwd> +#include <ios> +#include <istream> +#include <ostream> +#include <fstream> +#include <string_iostream> + +namespace std{ +#ifdef __UCLIBCXX_SUPPORT_CIN__ + extern istream cin; +#endif +#ifdef __UCLIBCXX_SUPPORT_COUT__ + extern ostream cout; +#endif +#ifdef __UCLIBCXX_SUPPORT_CERR__ + extern ostream cerr; +#endif +#ifdef __UCLIBCXX_SUPPORT_CLOG__ + extern ostream clog; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + extern wistream wcin; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + extern wostream wcout; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + extern wostream wcerr; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + extern wostream wclog; +#endif + + + template <class charT, class traits> class _UCXXEXPORT basic_iostream : + public basic_istream<charT,traits>, public basic_ostream<charT,traits> + { + public: + // constructor/destructor + explicit _UCXXEXPORT basic_iostream(basic_streambuf<charT,traits>* sb); + virtual _UCXXEXPORT ~basic_iostream(); //Below + }; + + template <class charT, class traits> _UCXXEXPORT + basic_iostream<charT, traits>:: basic_iostream(basic_streambuf<charT,traits>* sb) + : basic_ios<charT, traits>(sb), basic_istream<charT,traits>(sb), basic_ostream<charT,traits>(sb) + { + return; + } + + + template <class charT, class traits> _UCXXEXPORT basic_iostream<charT, traits>::~basic_iostream(){ + return; + } + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_IOSTREAM__ + + template <> _UCXXEXPORT basic_iostream<char, char_traits<char> >:: + basic_iostream(basic_streambuf<char, char_traits<char> >* sb); + template <> _UCXXEXPORT basic_iostream<char, char_traits<char> >::~basic_iostream(); + +#endif +#endif +#endif + + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/istream b/i386/modules/uClibcxx/include/istream new file mode 100644 index 0000000..eac6e15 --- /dev/null +++ b/i386/modules/uClibcxx/include/istream @@ -0,0 +1,597 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc C++ Library. This library is free + software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) + any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this library; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. +*/ + +#include <ios> +#include <cctype> +#include <streambuf> +#include <istream_helpers> +#include <ostream> + +#ifndef __STD_HEADER_ISTREAM +#define __STD_HEADER_ISTREAM 1 + +namespace std{ + + typedef basic_istream<char> istream; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_istream<wchar_t> wistream; +#endif + + template <class charT, class traits> basic_istream<charT,traits>& ws(basic_istream<charT,traits>& is); + + template <class charT, class traits> class _UCXXEXPORT basic_istream : + virtual public basic_ios<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef basic_streambuf<charT,traits> streambuf_type; + typedef traits traits_type; + + explicit basic_istream(basic_streambuf<charT,traits>* sb) + : basic_ios<charT, traits>(sb), count_last_ufmt_input(0) + { + basic_ios<charT, traits>::init(sb); + } + virtual ~basic_istream() { } + + class sentry; + + basic_istream<charT,traits>& operator>>(basic_istream<charT,traits>& (*pf)(basic_istream<charT,traits>&)); + basic_istream<charT,traits>& operator>>(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)); + basic_istream<charT,traits>& operator>>(ios_base& (*pf)(ios_base&)); + basic_istream<charT,traits>& operator>>(bool& n); + basic_istream<charT,traits>& operator>>(short& n); + basic_istream<charT,traits>& operator>>(unsigned short& n); + basic_istream<charT,traits>& operator>>(int& n); + basic_istream<charT,traits>& operator>>(unsigned int& n); + basic_istream<charT,traits>& operator>>(long& n); + basic_istream<charT,traits>& operator>>(unsigned long& n); + basic_istream<charT,traits>& operator>>(void*& p); + basic_istream<charT,traits>& operator>>(basic_streambuf<char_type,traits>* sb); + +#ifdef __UCLIBCXX_HAS_FLOATS__ + basic_istream<charT,traits>& operator>>(float& f); + basic_istream<charT,traits>& operator>>(double& f); + basic_istream<charT,traits>& operator>>(long double& f); +#endif + + _UCXXEXPORT streamsize gcount() const{ + return count_last_ufmt_input; + } + + _UCXXEXPORT int_type get(); //below + _UCXXEXPORT basic_istream<charT,traits>& get(char_type& c); //Below + + _UCXXEXPORT basic_istream<charT,traits>& get(char_type* s, streamsize n){ + return get(s, n, basic_ios<charT,traits>::widen('\n')); + } + + _UCXXEXPORT basic_istream<charT,traits>& get(char_type* s, streamsize n, char_type delim){ + sentry(*this, true); + streamsize i = 0; + int_type c; + for(i=0;i<n-1;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + basic_ios<charT, traits>::mstreambuf->sbumpc(); + if(c == traits::eof() ){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + break; + } + if(c == delim){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + } + basic_ios<charT, traits>::mstreambuf->sputbackc(c); + break; + } + s[i] = c; + } + s[i] = traits::eos(); + count_last_ufmt_input = i; + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>& sb){ + return get(sb, basic_ios<charT,traits>::widen('\n')); + } + + _UCXXEXPORT basic_istream<charT,traits>& get(basic_streambuf<char_type,traits>& sb, char_type delim){ + sentry(*this, true); + streamsize i = 0; + int_type c; + while(1){ //We will exit internally based upon error conditions + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof()){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + count_last_ufmt_input = i; + return *this; + } + if(c == delim){ + if(i==0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + } + count_last_ufmt_input = i; + return *this; + } + if(sb.sputc(c) != c){ //Error doing output + count_last_ufmt_input = i; + return *this; + } + ++i; + basic_ios<charT, traits>::mstreambuf->sbumpc(); + } + } + + _UCXXEXPORT basic_istream<charT,traits>& getline(char_type* s, streamsize n){ + return getline(s, n, basic_ios<charT,traits>::widen('\n')); + } + + _UCXXEXPORT basic_istream<charT,traits>& getline(char_type* s, streamsize n, char_type delim){ + sentry(*this, true); + streamsize i = 0; + int_type c; + for(i=0;i<n-1;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof() ){ + if( basic_ios<charT,traits>::eof() ){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + count_last_ufmt_input = i; + s[i] = traits::eos(); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf->sbumpc()==traits::eof() ){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + if(c == delim){ + count_last_ufmt_input = i+1; + s[i] = traits::eos(); + return *this; + } + s[i] = c; + } + s[n-1] = traits::eos(); + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& ignore (streamsize n = 1, int_type delim = traits::eof()){ + sentry(*this, true); + streamsize i; + int_type c; + for(i=0;i<n;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + return *this; + } + basic_ios<charT, traits>::mstreambuf->sbumpc(); + if(c == delim){ + return *this; + } + } + return *this; + } + + _UCXXEXPORT int_type peek(){ + if(basic_ios<charT,traits>::good() == false){ + return traits::eof(); + }else{ + int_type c = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(c == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + return basic_ios<charT, traits>::mstreambuf->sgetc(); + } + } + + _UCXXEXPORT basic_istream<charT,traits>& read (char_type* s, streamsize n){ + sentry(*this, true); + streamsize i; + int_type c; + for(i=0;i<n;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + + if(c == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + count_last_ufmt_input = i; + return *this; + } + basic_ios<charT, traits>::mstreambuf->sbumpc(); + s[i] = c; + } + count_last_ufmt_input = n; + return *this; + } + + _UCXXEXPORT streamsize readsome(char_type* s, streamsize n){ + sentry(*this, true); + if(!basic_ios<charT,traits>::good()){ + count_last_ufmt_input = 0; + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return 0; + } + + if( basic_ios<charT, traits>::mstreambuf->in_avail() == -1){ + count_last_ufmt_input=0; + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + return 0; + } + + if(n > basic_ios<charT, traits>::mstreambuf->in_avail() ){ + n = basic_ios<charT, traits>::mstreambuf->in_avail(); + } + + streamsize i; + int_type c; + + for(i=0;i<n;++i){ + c = basic_ios<charT, traits>::mstreambuf->sgetc(); + basic_ios<charT, traits>::mstreambuf->sbumpc(); + s[i] = c; + } + count_last_ufmt_input = n; + return n; + } + + _UCXXEXPORT basic_istream<charT,traits>& putback(char_type c){ + sentry(*this, true); + if(!basic_ios<charT,traits>::good()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf == 0){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf->sputbackc(c) == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return *this; + } + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& unget(){ + sentry(*this, true); + if(!basic_ios<charT,traits>::good()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf == 0){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + return *this; + } + if(basic_ios<charT, traits>::mstreambuf->sungetc() == traits::eof()){ + //basic_ios<charT,traits>::setstate(ios_base::failbit); + } + return *this; + } + + _UCXXEXPORT int sync(){ + sentry(*this, true); + if(basic_ios<charT, traits>::mstreambuf == 0){ + return -1; + } + if(basic_ios<charT, traits>::mstreambuf->pubsync() == -1){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return traits::eof(); + } + return 0; + } + + _UCXXEXPORT pos_type tellg(){ + if(basic_ios<charT,traits>::fail() !=false){ + return pos_type(-1); + } + return basic_ios<charT, traits>::mstreambuf->pubseekoff(0, ios_base::cur, ios_base::in); + } + + _UCXXEXPORT basic_istream<charT,traits>& seekg(pos_type pos){ + if(basic_ios<charT,traits>::fail() !=true){ + basic_ios<charT, traits>::mstreambuf->pubseekpos(pos); + } + return *this; + } + + _UCXXEXPORT basic_istream<charT,traits>& seekg(off_type off, ios_base::seekdir dir){ + if(basic_ios<charT,traits>::fail() !=true){ + basic_ios<charT, traits>::mstreambuf->pubseekoff(off, dir); + } + return *this; + } + + protected: + _UCXXEXPORT basic_istream(const basic_istream<charT,traits> &): basic_ios<charT, traits>() { } + _UCXXEXPORT basic_istream<charT,traits> & operator=(const basic_istream<charT,traits> &){ return *this; } + streamsize count_last_ufmt_input; + + }; + + template <class charT,class traits /*= char_traits<charT>*/ > class _UCXXEXPORT basic_istream<charT,traits>::sentry { + bool ok; + public: + explicit _UCXXEXPORT sentry(basic_istream<charT,traits>& os, bool noskipws = false){ + if(os.good() !=0){ //Prepare for output + } + + //Flush any tied buffer + if(os.tie() != 0){ + os.tie()->flush(); + } + if(!noskipws){ + __skipws(os); + } + + ok = true; + } + _UCXXEXPORT ~sentry() { } + _UCXXEXPORT operator bool() { + return ok; + } + }; + + //Template implementations of basic_istream functions which may be partially specialized + //For code reduction + + template <class charT, class traits> + _UCXXEXPORT typename basic_istream<charT,traits>::int_type basic_istream<charT,traits>::get(){ + sentry(*this, true); + int_type retval = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(retval == traits::eof()){ + count_last_ufmt_input = 0; + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + }else{ + count_last_ufmt_input = 1; + basic_ios<charT, traits>::mstreambuf->sbumpc(); + } + return retval; + } + + template <class charT, class traits> + _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::get(char_type& c){ + sentry(*this, true); + int_type retval = basic_ios<charT, traits>::mstreambuf->sgetc(); + if(retval == traits::eof()){ + count_last_ufmt_input = 0; + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + //basic_ios<charT,traits>::setstate(ios_base::failbit); + }else{ + count_last_ufmt_input = 1; + c = traits::to_char_type(retval); + basic_ios<charT, traits>::mstreambuf->sbumpc(); + } + return *this; + } + + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(bool& n) + { + sentry(*this); + __istream_readin<traits, charT, bool>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(short& n) + { + sentry(*this); + __istream_readin<traits, charT, short>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(unsigned short& n) + { + sentry(*this); + __istream_readin<traits, charT, unsigned short>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::operator>>(int& n){ + sentry(*this); + __istream_readin<traits, charT, int>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::operator>>(unsigned int& n){ + sentry(*this); + __istream_readin<traits, charT, unsigned int>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& basic_istream<charT,traits>::operator>>(long int& n){ + sentry(*this); + __istream_readin<traits, charT, long int>::readin(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(unsigned long int& n) + { + sentry(*this); + __istream_readin<traits, charT, unsigned long int>::readin(*this, n); + return *this; + } + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(float& n) + { + sentry(*this); + __istream_readin<traits, charT, float>::readin(*this, n); + return *this; + } + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(double& n) + { + sentry(*this); + __istream_readin<traits, charT, double>::readin(*this, n); + return *this; + } + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(long double& n) + { + sentry(*this); + __istream_readin<traits, charT, long double>::readin(*this, n); + return *this; + } +#endif + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(void *& n) + { + sentry(*this); + __istream_readin<traits, charT, void*>::readin(*this, n); + return *this; + } + + template<class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + operator>>(basic_istream<charT,traits>& is, charT& c) + { + typename basic_istream<charT,traits>::sentry s(is); + is.get(c); + return is; + } + + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, unsigned char& c) + { + typename basic_istream<char,traits>::sentry s(is); + char b; + is.get(b); + c = b; + return is; + } + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, signed char& c) + { + typename basic_istream<char,traits>::sentry s(is); + is.get(c); + return is; + } + + template<class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + operator>>(basic_istream<charT,traits>& is, charT* c) + { + typename basic_istream<charT,traits>::sentry s(is); + int n = is.width(); + if(n == 0){ + n = __STRING_MAX_UNITS; + } + is.get(c, n); + return is; + + } + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, unsigned char* c) + { + typename basic_istream<char,traits>::sentry s(is); + int n = is.width(); + if(n == 0){ + n = __STRING_MAX_UNITS; + } + is.get(c, n); + return is; + } + template<class traits> _UCXXEXPORT basic_istream<char,traits>& + operator>>(basic_istream<char,traits>& is, signed char* c) + { + typename basic_istream<char,traits>::sentry s(is); + int n = is.width(); + if(n == 0){ + n = __STRING_MAX_UNITS; + } + is.get(c, n); + return is; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(basic_istream<charT,traits>& (*pf)(basic_istream<charT,traits>&)) + { + sentry(*this); + pf(*this); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + basic_istream<charT,traits>::operator>>(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)) + { + sentry(*this); + pf(*this); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_istream<charT,traits>& + ws(basic_istream<charT,traits>& is) + { + __skipws(is); + return is; + } + + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_ISTREAM__ + + + template <> _UCXXEXPORT istream & basic_istream<char, char_traits<char> >::get(char & c); + template <> _UCXXEXPORT istream::int_type basic_istream<char, char_traits<char> >::get(); + + template <> _UCXXEXPORT istream & istream::operator>>(bool &n); + template <> _UCXXEXPORT istream & istream::operator>>(short &n); + template <> _UCXXEXPORT istream & istream::operator>>(unsigned short &n); + template <> _UCXXEXPORT istream & istream::operator>>(int &n); + template <> _UCXXEXPORT istream & istream::operator>>(unsigned int &n); + template <> _UCXXEXPORT istream & istream::operator>>(long unsigned &n); + template <> _UCXXEXPORT istream & istream::operator>>(long int &n); + template <> _UCXXEXPORT istream & istream::operator>>(void *& p); + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template <> _UCXXEXPORT istream & istream::operator>>(float &f); + template <> _UCXXEXPORT istream & istream::operator>>(double &f); + template <> _UCXXEXPORT istream & istream::operator>>(long double &f); +#endif + + template <> _UCXXEXPORT istream & operator>>(istream & is, char & c); + + template <> _UCXXEXPORT void __skipws(basic_istream<char,char_traits<char> >& is); + +#endif +#endif + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/istream_helpers b/i386/modules/uClibcxx/include/istream_helpers new file mode 100644 index 0000000..78dbc85 --- /dev/null +++ b/i386/modules/uClibcxx/include/istream_helpers @@ -0,0 +1,340 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <ios> +#include <cctype> + +#include <string> + +#ifndef __STD_HEADER_ISTREAM_HELPERS +#define __STD_HEADER_ISTREAM_HELPERS 1 + +namespace std{ + + + /* We are making the following template class for serveral reasons. Firstly, + * we want to keep the main istream code neat and tidy. Secondly, we want it + * to be easy to do partial specialization of the istream code so that it can + * be expanded and put into the library. This will allow us to make application + * code smaller at the expense of increased library size. This is a fair + * trade-off when there are multiple applications being compiled. Also, this + * feature will be used optionally via configuration options. It will also + * allow us to keep the code bases in sync, dramatically simplifying the + * maintenance required. We specialized for char because wchar and others + * require different scanf functions + */ + + template <class C, class traits> _UCXXEXPORT + basic_string<C, traits> _readToken(basic_istream<C, traits>& stream) + { + basic_string<C, traits> temp; + typename traits::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != traits::eof() && isspace(c) == false){ + stream.rdbuf()->sbumpc(); + temp.append(1, traits::to_char_type(c)); + }else{ + break; + } + } + //if (temp.size() == 0) + //stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + + template <class C, class traits> _UCXXEXPORT + basic_string<C, traits> _readTokenDecimal(basic_istream<C, traits>& stream) + { + basic_string<C, traits> temp; + typename traits::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != traits::eof() && isspace(c) == false && (isdigit(c) || c == '.' || c == ',' )){ + stream.rdbuf()->sbumpc(); + temp.append(1, traits::to_char_type(c)); + }else{ + break; + } + } + //if (temp.size() == 0) + //stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template <> _UCXXEXPORT string _readToken<char, char_traits<char> >(istream & stream); + +#endif + + + template <class traits, class charT, class dataType> class _UCXXEXPORT __istream_readin{ + public: + static void readin(basic_istream<charT,traits>& stream, dataType & var); + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, bool>{ + public: + inline static void readin(basic_istream<char, traits >& stream, bool & var) + { + basic_string<char, traits > temp; + temp = _readToken( stream); + if(temp == "true" || temp == "True" || temp == "TRUE" || temp == "1"){ + var = true; + }else{ + var = false; + } + } + }; + + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, short>{ + public: + inline static void readin(basic_istream<char, traits >& stream, short & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%hd", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%ho", (unsigned short int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%hX", (unsigned short int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%hx", (unsigned short int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%hi", &var); + + } + } + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, unsigned short>{ + public: + inline static void readin(basic_istream<char, traits >& stream, unsigned short & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%hu", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%ho", &var); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%hX", &var ); + }else{ + sscanf(temp.c_str(), "%hx", &var); + } + }else{ + sscanf(temp.c_str(), "%hi", (signed short int*)(&var) ); + } + } + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%d", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%o", (unsigned int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%X", (unsigned int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%x", (unsigned int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%i", &var); + } + } + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, unsigned int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, unsigned int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%u", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%o", (unsigned int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%X", (unsigned int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%x", (unsigned int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%i", (int *)(&var) ); + } + } + + } + }; + + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, long int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%ld", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%lo", (unsigned long int *)(&var) ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%lX", (unsigned long int *)(&var) ); + }else{ + sscanf(temp.c_str(), "%lx", (unsigned long int *)(&var) ); + } + }else{ + sscanf(temp.c_str(), "%li", (long int *)(&var) ); + } + } + + } + }; + + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, unsigned long int>{ + public: + inline static void readin(basic_istream<char, traits >& stream, unsigned long int & var) + { + basic_string<char, traits > temp; + + if(stream.flags() & ios_base::dec){ + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%lu", &var ); + }else{ + temp = _readToken( stream); + if( stream.flags() & ios_base::oct){ + sscanf(temp.c_str(), "%lo", &var ); + }else if(stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::uppercase){ + sscanf(temp.c_str(), "%lX", &var ); + }else{ + sscanf(temp.c_str(), "%lx", &var); + } + }else{ + sscanf(temp.c_str(), "%li", (long int *)(&var) ); + } + } + } + }; + + +#ifdef __UCLIBCXX_HAS_FLOATS__ + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, float>{ + public: + inline static void readin(basic_istream<char, traits >& stream, float & var) + { + basic_string<char, traits > temp; + temp = _readTokenDecimal( stream); + + sscanf(temp.c_str(), "%g", &var); + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, double>{ + public: + inline static void readin(basic_istream<char, traits >& stream, double & var) + { + basic_string<char, traits > temp; + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%lg", &var); + } + }; + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, long double>{ + public: + inline static void readin(basic_istream<char, traits >& stream, long double & var) + { + basic_string<char, traits > temp; + temp = _readTokenDecimal( stream); + sscanf(temp.c_str(), "%Lg", &var); + } + }; + +#endif // ifdef __UCLIBCXX_HAS_FLOATS__ + + template <class traits> class _UCXXEXPORT __istream_readin<traits, char, void*>{ + public: + inline static void readin(basic_istream<char, traits >& stream, void* & var) + { + basic_string<char, traits > temp; + temp = _readToken( stream); + sscanf(temp.c_str(), "%p", &var); + } + }; + + + template<class charT, class traits> void __skipws(basic_istream<charT,traits>& is){ + const typename basic_istream<charT,traits>::int_type eof = traits::eof(); + typename basic_istream<charT,traits>::int_type c; + //While the next character normally read doesn't equal eof + //and that character is a space, advance to the next read position + //Thus itterating through all whitespace until we get to the meaty stuff + while ( + !traits::eq_int_type((c = is.rdbuf()->sgetc()), eof) + && isspace(c) + ) + { + is.rdbuf()->sbumpc(); + } + if(traits::eq_int_type(c, eof)){ + //is.setstate(ios_base::eofbit); + } + } +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/iterator b/i386/modules/uClibcxx/include/iterator new file mode 100644 index 0000000..d960652 --- /dev/null +++ b/i386/modules/uClibcxx/include/iterator @@ -0,0 +1,225 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <iosfwd> +#include <cstddef> +#include <char_traits> +#include <iterator_base> + + + +#ifndef __STD_HEADER_ITERATOR +#define __STD_HEADER_ITERATOR 1 + +namespace std{ + + // subclause _lib.stream.iterators_, stream iterators: + template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t> class istream_iterator; + template <class T, class charT, class traits, class Distance> bool + operator==(const istream_iterator<T,charT,traits,Distance>& x, const istream_iterator<T,charT,traits,Distance>& y); + template <class T, class charT, class traits, class Distance> bool + operator!=(const istream_iterator<T,charT,traits,Distance>& x, const istream_iterator<T,charT,traits,Distance>& y); + template <class T, class charT = char, class traits = char_traits<charT> > class ostream_iterator; + template<class charT, class traits = char_traits<charT> > class istreambuf_iterator; + template <class charT, class traits> bool + operator==(const istreambuf_iterator<charT,traits>& a, const istreambuf_iterator<charT,traits>& b); + template <class charT, class traits> bool + operator!=(const istreambuf_iterator<charT,traits>& a, const istreambuf_iterator<charT,traits>& b); + template <class charT, class traits = char_traits<charT> > class ostreambuf_iterator; + + + template < class T, class charT, class traits, class Distance > class _UCXXEXPORT istream_iterator + : public iterator<input_iterator_tag,T,Distance,const T*, const T&> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef basic_istream<charT,traits> istream_type; + istream_iterator() : in_stream(0), value(0) {} + istream_iterator(istream_type& s) : in_stream(&s), value() { + *in_stream >> value; + } + istream_iterator(const istream_iterator<T,charT,traits,Distance>& x) + : in_stream(x.in_stream), value(x.value) + { } + ~istream_iterator() { } + const T& operator*() const{ + return value; + } + const T* operator->() const{ + return &value; + } + istream_iterator<T,charT,traits,Distance>& operator++() { + *in_stream >> value; + return *this; + } + istream_iterator<T,charT,traits,Distance> operator++(int){ + istream_iterator<T,charT,traits,Distance> tmp = *this; + *in_stream >> value; + return (tmp); + } + bool m_equal(const istream_iterator<T,charT,traits,Distance>& x) const{ + return (in_stream == x.in_stream); + } + private: + basic_istream<charT,traits>* in_stream; + T value; + }; + + template <class T, class charT, class traits, class Distance> _UCXXEXPORT + bool operator==(const istream_iterator<T,charT,traits,Distance>& x, + const istream_iterator<T,charT,traits,Distance>& y) + { + return x.m_equal(y); + } + + template <class T, class charT, class traits, class Distance> _UCXXEXPORT + bool operator!=(const istream_iterator<T,charT,traits,Distance>& x, + const istream_iterator<T,charT,traits,Distance>& y) + { + return !(x == y); + } + + template <class T, class charT, class traits> class _UCXXEXPORT ostream_iterator + : public iterator<output_iterator_tag,void,void,void,void> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef basic_ostream<charT,traits> ostream_type; + + ostream_iterator(ostream_type& s) : out_stream(&s), delim(0) { } + ostream_iterator(ostream_type& s, const charT* delimiter) : out_stream(&s), delim(delimiter) { } + ostream_iterator(const ostream_iterator<T,charT,traits>& x) : out_stream(x.out_stream), delim(x.delim) { } + ~ostream_iterator() { } + ostream_iterator<T,charT,traits>& operator=(const T& value){ + *out_stream << value; + if(delim != 0){ + *out_stream << delim; + } + return (*this); + } + ostream_iterator<T,charT,traits>& operator*(){ return *this; } + ostream_iterator<T,charT,traits>& operator++() { return *this; } + ostream_iterator<T,charT,traits> operator++(int) { return *this; } + private: + basic_ostream<charT,traits>* out_stream; + const char* delim; + }; + + template<class charT, class traits > class _UCXXEXPORT istreambuf_iterator : + public iterator<input_iterator_tag, charT, typename traits::off_type, charT*, charT&> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef typename traits::int_type int_type; + typedef basic_streambuf<charT,traits> streambuf_type; + typedef basic_istream<charT,traits> istream_type; + + class _UCXXEXPORT proxy{ + charT val; + basic_streambuf<charT, traits> * buf; + + proxy(charT v, basic_streambuf<charT, traits> * b) : val(v), buf(b) { } + public: + charT operator*() { return val; } + }; + + istreambuf_iterator() throw() : sbuf(0) { } + istreambuf_iterator(istream_type& s) throw() : sbuf(s.rdbuf()) { } + istreambuf_iterator(streambuf_type* s) throw() : sbuf(s) { } + istreambuf_iterator(const proxy& p) throw() : sbuf(&p.buf) { } + + charT operator*() const{ + return sbuf->sgetc(); + } + istreambuf_iterator<charT,traits>& operator++(){ + sbuf->sbumpc(); + return *this; + } + proxy operator++(int){ + istreambuf_iterator<charT,traits> tmp = *this; + sbuf->sbumpc(); + return(tmp); + } + + bool equal(const istreambuf_iterator& b) const{ + return sbuf == b.sbuf || (is_eof() && b.is_eof()); + } + private: + streambuf_type* sbuf; + inline bool is_eof() const{ + return sbuf == 0 || sbuf->sgetc() == traits_type::eof(); + } + }; + + template <class charT, class traits> _UCXXEXPORT bool + operator==(const istreambuf_iterator<charT,traits>& a, + const istreambuf_iterator<charT,traits>& b) + { + return a.equal(b); + } + + template <class charT, class traits> bool _UCXXEXPORT + operator!=(const istreambuf_iterator<charT,traits>& a, + const istreambuf_iterator<charT,traits>& b) + { + return !a.equal(b); + } + + template <class charT, class traits> class _UCXXEXPORT ostreambuf_iterator + : iterator<output_iterator_tag,void,void,void,void> + { + public: + typedef charT char_type; + typedef traits traits_type; + typedef basic_streambuf<charT,traits> streambuf_type; + typedef basic_ostream<charT,traits> ostream_type; + public: + ostreambuf_iterator(ostream_type& s) throw() : sbuf(s.rdbuf()), f(false) { } + ostreambuf_iterator(streambuf_type* s) throw() : sbuf(s), f(false) { } + ostreambuf_iterator& operator=(charT c){ + if(failed() == false){ + if(sbuf->sputc(c) == traits::eof()){ + f = true; + } + } + return *this; + } + ostreambuf_iterator& operator*(){ + return *this; + } + ostreambuf_iterator& operator++() { return *this; } + ostreambuf_iterator operator++(int) { return *this; } + bool failed() const throw(){ + return f; + } + + private: + streambuf_type* sbuf; + bool f; + }; + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/iterator_base b/i386/modules/uClibcxx/include/iterator_base new file mode 100644 index 0000000..606f24e --- /dev/null +++ b/i386/modules/uClibcxx/include/iterator_base @@ -0,0 +1,301 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef __STD_HEADER_ITERATOR_BASE +#define __STD_HEADER_ITERATOR_BASE 1 + +namespace std{ + template<class Iterator> struct iterator_traits; + template<class T> struct iterator_traits<T*>; + + template<class Category, class T, class Distance = ptrdiff_t, class Pointer = T*, class Reference = T&> struct iterator; + + struct _UCXXEXPORT input_iterator_tag {}; + struct _UCXXEXPORT output_iterator_tag {}; + struct _UCXXEXPORT forward_iterator_tag: public input_iterator_tag {}; + struct _UCXXEXPORT bidirectional_iterator_tag: public forward_iterator_tag {}; + struct _UCXXEXPORT random_access_iterator_tag: public bidirectional_iterator_tag {}; + + template <class InputIterator, class Distance> _UCXXEXPORT void advance(InputIterator& i, Distance n){ + while(n > 0){ + --n; + ++i; + } + } + + template <class InputIterator> _UCXXEXPORT typename iterator_traits<InputIterator>::difference_type + distance(InputIterator first, InputIterator last) + { + typename iterator_traits<InputIterator>::difference_type d = 0; + while(first++ !=last){ + d++; + } + return d; + } + + // subclause _lib.predef.iterators_, predefined iterators: + template <class Iterator> class reverse_iterator; + template <class Iterator> bool operator==(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator<(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator!=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator>=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> bool operator<=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> typename reverse_iterator<Iterator>::difference_type + operator-( const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + template <class Iterator> reverse_iterator<Iterator> + operator+( typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& x); + template <class Container> class back_insert_iterator; + template <class Container> back_insert_iterator<Container> back_inserter(Container& x); + template <class Container> class front_insert_iterator; + template <class Container> front_insert_iterator<Container> front_inserter(Container& x); + template <class Container> class insert_iterator; + template <class Container, class Iterator> + insert_iterator<Container> inserter(Container& x, Iterator i); + + //Actual Template definitions + + template<class Iterator> struct _UCXXEXPORT iterator_traits { + typedef typename Iterator::difference_type difference_type; + typedef typename Iterator::value_type value_type; + typedef typename Iterator::pointer pointer; + typedef typename Iterator::reference reference; + typedef typename Iterator::iterator_category iterator_category; + }; + + //Pointer specialization - required by standard + template<class T> struct _UCXXEXPORT iterator_traits<T*> { + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef T* pointer; + typedef T& reference; + typedef random_access_iterator_tag iterator_category; + }; + + //Specialization recomended by standard +/* template<class T> struct _UCXXEXPORT iterator_traits<T __far*> { + typedef long difference_type; + typedef T value_type; + typedef T __far* pointer; + typedef T __far& reference; + typedef random_access_iterator_tag iterator_category; + };*/ + +/* template <class BidirectionalIterator> _UCXXEXPORT void + reverse(BidirectionalIterator first, BidirectionalIterator last) + { + typename iterator_traits<BidirectionalIterator>::difference_type n = distance(first, last); + --n; + while(n > 0){ + typename iterator_traits<BidirectionalIterator>::value_type tmp = *first; + *first++ = * --last; + *last = tmp; + n -= 2; + } + };*/ + + + template <class Category, class T, class Distance, class Pointer, class Reference> + struct _UCXXEXPORT iterator + { + typedef T value_type; + typedef Distance difference_type; + typedef Pointer pointer; + typedef Reference reference; + typedef Category iterator_category; + }; + + + template <class Iterator> class _UCXXEXPORT reverse_iterator + : public iterator<typename iterator_traits<Iterator>::iterator_category, + typename iterator_traits<Iterator>::value_type, typename iterator_traits<Iterator>::difference_type, + typename iterator_traits<Iterator>::pointer, typename iterator_traits<Iterator>::reference> + { + protected: + Iterator current; + friend bool operator== <Iterator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + friend bool operator< <Iterator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y); + + public: + typedef Iterator iterator_type; + + reverse_iterator() : current(){}; + explicit reverse_iterator(Iterator x) : current(x) { } + template<class U> reverse_iterator(const reverse_iterator<U> &x) : current(x.base()){} + + Iterator base() const { return current; } // explicit + + typename iterator_traits<Iterator>::reference operator*() const { Iterator tmp = current; return *--tmp; } + typename iterator_traits<Iterator>::pointer operator->() const { return &(operator*()); } + typename iterator_traits<Iterator>::reference operator[](typename iterator_traits<Iterator>::difference_type n) const{ + return current[-n-1]; + } + + reverse_iterator& operator++(){ --current; return *this; } + reverse_iterator operator++(int) {reverse_iterator tmp = *this; --current; return tmp; } + reverse_iterator& operator--() { ++ current; return *this; } + reverse_iterator operator--(int) {reverse_iterator tmp = *this; ++current; return tmp; } + + reverse_iterator operator+ (typename iterator_traits<Iterator>::difference_type n) const{ + reverse_iterator retval( *this ); + retval+=n; + return retval; + } + reverse_iterator& operator+=(typename iterator_traits<Iterator>::difference_type n){ + current -= n; + return *this; + } + reverse_iterator operator- (typename iterator_traits<Iterator>::difference_type n) const{ + reverse_iterator retval( *this ); + retval-=n; + return retval; + } + reverse_iterator& operator-=(typename iterator_traits<Iterator>::difference_type n){ + current += n; + return *this; + } + }; + + + template <class Iterator> _UCXXEXPORT bool + operator==(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() == y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator<(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() < y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator!=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() != y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator>(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() > y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator>=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() >= y.base(); + } + template <class Iterator> _UCXXEXPORT bool + operator<=(const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return x.base() <= y.base(); + } + template <class Iterator> _UCXXEXPORT typename reverse_iterator<Iterator>::difference_type + operator-( const reverse_iterator<Iterator>& x, const reverse_iterator<Iterator>& y) + { + return y.base() - x.base(); + } + template <class Iterator> _UCXXEXPORT reverse_iterator<Iterator> + operator+(typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& x) + { + return reverse_iterator<Iterator> (x.base() - n); + } + + template <class Container> class _UCXXEXPORT back_insert_iterator : + public iterator<output_iterator_tag,void,void,void,void> + { + protected: + Container& container; + public: + typedef Container container_type; + explicit back_insert_iterator(Container& x):container(x) {}; + back_insert_iterator<Container>& operator=(const typename Container::value_type& value){ + container.push_back(value); + return *this; + } + back_insert_iterator<Container>& operator*(){ + return *this; + } + back_insert_iterator<Container>& operator++(){ + return *this; + } + back_insert_iterator<Container> operator++(int){ + return *this; + } + }; + + template <class Container> _UCXXEXPORT back_insert_iterator<Container> + back_inserter(Container& x) + { + return back_insert_iterator<Container>(x); + } + + template <class Container> class _UCXXEXPORT front_insert_iterator + : public iterator<output_iterator_tag,void,void,void,void> + { + protected: + Container& container; + public: + typedef Container container_type; + explicit front_insert_iterator(Container& x): container(x) {} + front_insert_iterator<Container>& operator=(const typename Container::value_type& value){ + container.push_front(value); + return *this; + } + + front_insert_iterator<Container>& operator*() { return *this; } + front_insert_iterator<Container>& operator++() { return *this; } + front_insert_iterator<Container> operator++(int) { return *this; } + }; + + template <class Container> _UCXXEXPORT front_insert_iterator<Container> + front_inserter(Container& x) + { + return front_insert_iterator<Container>(x); + } + + template <class Container> class _UCXXEXPORT insert_iterator + : public iterator<output_iterator_tag,void,void,void,void> + { + protected: + Container& container; + typename Container::iterator iter; + public: + typedef Container container_type; + insert_iterator(Container& x, typename Container::iterator i) : container(x), iter(i) {} + insert_iterator<Container>& operator=(const typename Container::value_type& value){ + iter = container.insert(iter, value); + ++iter; + return *this; + } + insert_iterator<Container>& operator*() { return *this; } + insert_iterator<Container>& operator++() { return *this; } + insert_iterator<Container> operator++(int) { return *this; } + }; + + template <class Container, class Iterator> _UCXXEXPORT insert_iterator<Container> + inserter(Container& x, Iterator i) + { + return insert_iterator<Container>(x,typename Container::iterator(i)); + } + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/limits b/i386/modules/uClibcxx/include/limits new file mode 100644 index 0000000..2aa1d04 --- /dev/null +++ b/i386/modules/uClibcxx/include/limits @@ -0,0 +1,611 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <climits> + +#ifndef __STD_HEADER_LIMITS +#define __STD_HEADER_LIMITS 1 + +//#warning limits header is nowhere complete or accurate + +namespace std{ + +enum float_round_style{ + round_indeterminate =-1, + round_toward_zero = 0, + round_to_nearest = 1, + round_toward_infinity = 2, + round_toward_neg_infinity = 3 +}; + +template <int bitsize> struct __bits_to_base_10{ + static const int size = -1; +}; +template <> struct __bits_to_base_10<7>{ + static const int size = 2; +}; +template <> struct __bits_to_base_10<8>{ + static const int size = 2; +}; +template <> struct __bits_to_base_10<9>{ + static const int size = 2; +}; +template <> struct __bits_to_base_10<10>{ + static const int size = 3; +}; +template <> struct __bits_to_base_10<15>{ + static const int size = 4; +}; +template <> struct __bits_to_base_10<16>{ + static const int size = 4; +}; +template <> struct __bits_to_base_10<17>{ + static const int size = 5; +}; +template <> struct __bits_to_base_10<18>{ + static const int size = 5; +}; +template <> struct __bits_to_base_10<31>{ + static const int size = 9; +}; +template <> struct __bits_to_base_10<32>{ + static const int size = 9; +}; +template <> struct __bits_to_base_10<35>{ + static const int size = 10; +}; +template <> struct __bits_to_base_10<36>{ + static const int size = 10; +}; +template <> struct __bits_to_base_10<63>{ + static const int size = 18; +}; +template <> struct __bits_to_base_10<64>{ + static const int size = 19; +}; +template <> struct __bits_to_base_10<71>{ + static const int size = 21; +}; +template <> struct __bits_to_base_10<72>{ + static const int size = 21; +}; +template <> struct __bits_to_base_10<79>{ + static const int size = 23; +}; +template <> struct __bits_to_base_10<80>{ + static const int size = 24; +}; +template <> struct __bits_to_base_10<127>{ + static const int size = 38; +}; +template <> struct __bits_to_base_10<128>{ + static const int size = 38; +}; + + + + + + +template <class T> class numeric_limits { +public: + // General -- meaningful for all specializations. + + static const bool is_specialized = false; + static T min(); + static T max(); + static const int radix; + static const int digits; + static const int digits10; + static const bool is_signed; + static const bool is_integer; + static const bool is_exact; + static const bool traps; + static const bool is_modulo; + static const bool is_bounded; + + // Floating point specific. + + static T epsilon(); + static T round_error(); + static const int min_exponent10; + static const int max_exponent10; + static const int min_exponent; + + static const int max_exponent; + static const bool has_infinity; + static const bool has_quiet_NaN; + static const bool has_signaling_NaN; + static const bool is_iec559; + static const bool has_denorm; + static const bool tinyness_before; + static const float_round_style round_style; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned char> { +public: + typedef unsigned char T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return UCHAR_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT; + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed char> { +public: + typedef signed char T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return SCHAR_MIN; + } + static T max(){ + return SCHAR_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT - 1; + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<char> { +public: + typedef char T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return CHAR_MIN; + } + static T max(){ + return CHAR_MAX; + } + static const int radix = 2; + static const int digits = (CHAR_MIN != 0) ? CHAR_BIT - 1 : CHAR_BIT; + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = (CHAR_MIN != 0); + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned short> { +public: + typedef unsigned short T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return USHRT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed short> { +public: + typedef signed short T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return SHRT_MIN; + } + static T max(){ + return SHRT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned int> { +public: + typedef unsigned int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return UINT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed int> { +public: + typedef signed int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return INT_MIN; + } + static T max(){ + return INT_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<unsigned long int> { +public: + typedef unsigned long int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return 0; + } + static T max(){ + return ULONG_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = false; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<signed long int> { +public: + typedef signed long int T; + // General -- meaningful for all specializations. + static const bool is_specialized = true; + static T min(){ + return LONG_MIN; + } + static T max(){ + return LONG_MAX; + } + static const int radix = 2; + static const int digits = CHAR_BIT * sizeof(T); + static const int digits10 = __bits_to_base_10<digits>::size; + static const bool is_signed = true; + static const bool is_integer = true; + static const bool is_exact = true; + static const bool traps = false; + static const bool is_modulo = true; + static const bool is_bounded = true; + + // Floating point specific. + + static T epsilon(){ + return 0; + } + static T round_error(){ + return 0; + } + static const int min_exponent10 = 0; + static const int max_exponent10 = 0; + static const int min_exponent = 0; + + static const int max_exponent = 0; + static const bool has_infinity = false; + static const bool has_quiet_NaN = false; + static const bool has_signaling_NaN = false; + static const bool is_iec559 = false; + static const bool has_denorm = false; + static const bool tinyness_before = false; + static const float_round_style round_style = round_indeterminate; + static T denorm_min(); + static T infinity(); + static T quiet_NaN(); + static T signaling_NaN(); +}; + +template <> class numeric_limits<double> { + typedef double numeric_type; + + static const bool is_specialized = true; + static numeric_type min () { return __DBL_MIN__; } + static numeric_type max () { return __DBL_MAX__; } + static const int radix = __FLT_RADIX__; + static const int digits = __DBL_MANT_DIG__; + static const int digits10 = __DBL_DIG__; + static const bool is_signed = true; + static const bool is_integer = false; + static const bool is_exact = false; + static const bool traps = false; // this is a guess + static const bool is_modulo = false; + static const bool is_bounded = true; + + // Floating point specific. + + static numeric_type epsilon () { return __DBL_EPSILON__; } + static numeric_type round_error () { return 0.5; } + static const int min_exponent10 = -1; //How do I properly get this? + static const int max_exponent10 = -1; //How do I properly get this? + static const int min_exponent = -1; //How do I properly get this? + static const int max_exponent = -1; //How do I properly get this? + static const bool has_infinity = false; //I don't know, so until I can find out, I'm saying no + static const bool has_quiet_NaN = false; //I don't know, so until I can find out, I'm saying no + static const bool has_signaling_NaN = false; //I don't know, so until I can find out, I'm saying no + static const bool has_denorm = false; //I don't know, so until I can find out, I'm saying no + + static const bool is_iec559 = false; //I don't know, so until I can find out, I'm saying no + static const bool tinyness_before = false; // more questions + static const float_round_style round_style = round_to_nearest; // more questions + static numeric_type denorm_min () { return -1; } //How do I properly get this? + static numeric_type infinity () { return -1; } //How do I properly get this? + static numeric_type quiet_NaN () { return -1; } //How do I properly get this? + static numeric_type signaling_NaN () { return -1; } //How do I properly get this? +}; + + + + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/list b/i386/modules/uClibcxx/include/list new file mode 100644 index 0000000..e817057 --- /dev/null +++ b/i386/modules/uClibcxx/include/list @@ -0,0 +1,926 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <memory> +#include <iterator> +#include <algorithm> + +#ifndef __STD_HEADER_LIST +#define __STD_HEADER_LIST 1 + +namespace std{ + + template <class T, class Allocator = allocator<T> > class _UCXXEXPORT list { + public: + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef T value_type; + typedef Allocator allocator_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + + protected: + class node; + class iter_list; + + node * list_start; + node * list_end; + size_type elements; + Allocator a; + + public: + + typedef iter_list iterator; + typedef iter_list const_iterator; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + + explicit list(const Allocator& = Allocator()); + explicit list(size_type n, const T& value = T(), const Allocator& = Allocator()); + template <class InputIterator> list(InputIterator first, InputIterator last, + const Allocator& al= Allocator()); + list(const list<T,Allocator>& x); + ~list(); + + list<T,Allocator>& operator=(const list<T,Allocator>& x); + + template <class InputIterator> void assign(InputIterator first, InputIterator last); + template <class Size, class U> void assign(Size n, const U& u = U()); + allocator_type get_allocator() const; + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + bool empty() const; + size_type size() const; + size_type max_size() const; + void resize(size_type sz, T c = T()); + + reference front(); + const_reference front() const; + reference back(); + const_reference back() const; + + void push_front(const T& x); + void pop_front(); + void push_back(const T& x); + void pop_back(); + iterator insert(iterator position, const T& x = T()); + void insert(iterator position, size_type n, const T& x); + template <class InputIterator> void insert(iterator position, InputIterator first, InputIterator last); + iterator erase(iterator position); + iterator erase(iterator position, iterator last); + void swap(list<T,Allocator>&); + void clear(); + + void splice(iterator position, list<T,Allocator>& x); + void splice(iterator position, list<T,Allocator>& x, iterator i); + void splice(iterator position, list<T,Allocator>& x, iterator first, iterator last); + void remove(const T& value); + template <class Predicate> void remove_if(Predicate pred); + void unique(); + template <class BinaryPredicate> void unique(BinaryPredicate binary_pred); + void merge(list<T,Allocator>& x); + template <class Compare> void merge(list<T,Allocator>& x, Compare comp); + void sort(); + template <class Compare> void sort(Compare comp); + void reverse(); + protected: + void swap_nodes(node * x, node * y); + }; + + + //Implementations of List + + //List node + template <class T, class Allocator> class _UCXXEXPORT list<T, Allocator>::node{ + public: + node * previous; + node * next; + T * val; + + node(): previous(0), next(0), val(0){ } + node(const T & t ): previous(0), next(0), val(0) { + val = new T(t); + //FIXME use allocator somehow but only call constructor once + } + node(const T & t, node * p, node * n): previous(p), next(n), val(0) { + val = new T(t); + } + ~node(){ } + }; + + //List iterator + template <class T, class Allocator> class _UCXXEXPORT list<T, Allocator>::iter_list + : public std::iterator< + bidirectional_iterator_tag, + T, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + private: + node * current; + public: + iter_list():current(0) { } + iter_list( typename list<T, Allocator>::node * n): current(n) { } + iter_list(const list<T, Allocator>::iter_list & l): current(l.current) { } + ~iter_list(){ } + + iter_list & operator=(const list<T, Allocator>::iter_list & right ){ + current = right.current; + return *this; + } + + T & operator*(){ + return *(current->val); + } + T * operator->(){ + return current->val; + } + const T & operator*() const{ + return *current->val; + } + const T * operator->() const{ + return current->val; + } + + bool operator==(const list<T, Allocator>::iter_list & right) const { + return (current == right.current); + } + + bool operator!=(const list<T, Allocator>::iter_list & right) const { + return (current != right.current); + } + + iter_list & operator++(){ + current = current->next; + return *this; + } + + iter_list operator++(int){ + iter_list temp(current); + current = current->next; + return temp; + } + iter_list & operator--(){ + current = current->previous; + return *this; + } + + iter_list operator--(int){ + iter_list temp(current); + current = current->previous; + return temp; + } + node * link_struct(){ + return current; + } + iter_list & operator+=(unsigned int n){ + for(unsigned int i = 0; i < n; ++i){ + current = current->next; + } + return *this; + } + iter_list & operator-=(unsigned int n){ + for(unsigned int i = 0; i < n; ++i){ + current = current->previous; + } + return *this; + } + }; + + + template<class T, class Allocator> list<T, Allocator>::list(const Allocator& al) + :list_start(0), list_end(0), elements(0), a(al) + { + //End node + list_start = new node(); + list_end = list_start; + return; + } + + template<class T, class Allocator> list<T, Allocator>::list + (typename Allocator::size_type n, const T& value, const Allocator& al) + :list_start(0), list_end(0), elements(0), a(al) + { + //End node + list_start = new node(); + list_end = list_start; + + for(typename Allocator::size_type i = 0; i < n ; ++i){ + push_back(value); + } + } + + template<class T, class Allocator> template <class InputIterator> + list<T, Allocator>::list + (InputIterator first, InputIterator last, const Allocator& al) + : list_start(0), list_end(0), elements(0), a(al) + { + list_start = new node(); + list_end = list_start; + while(first != last){ + push_back(*first); + ++first; + } + } + + template<class T, class Allocator> list<T, Allocator>::list(const list<T,Allocator>& x) + : list_start(0), list_end(0), elements(0), a(x.a) + { + list_start = new node(); + list_end = list_start; + + iterator i = x.begin(); + while(i != x.end()){ + push_back( *i); + ++i; + } + } + + template<class T, class Allocator> list<T, Allocator>::~list(){ + while(elements > 0){ + pop_front(); + } + delete list_start->val; +#if UCLIBCXX_DEBUG + list_start->val = 0; +#endif + delete list_start; +#if UCLIBCXX_DEBUG + list_start = 0; + list_end = 0; +#endif + } + + + template<class T, class Allocator> void list<T, Allocator>::swap_nodes(node * x, node * y){ + T * v = x->val; + x->val = y->val; + y->val = v; + } + + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::begin() + { + return iterator(list_start); + } + + + template<class T, class Allocator> typename list<T, Allocator>::const_iterator + list<T, Allocator>::begin() const + { + return const_iterator(list_start); + } + + + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::end() + { + return iterator(list_end); + } + + template<class T, class Allocator> typename list<T, Allocator>::const_iterator + list<T, Allocator>::end() const + { + return const_iterator(list_end); + } + + template<class T, class Allocator> typename list<T, Allocator>::reverse_iterator + list<T, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template<class T, class Allocator> typename list<T, Allocator>::const_reverse_iterator + list<T, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template<class T, class Allocator> typename list<T, Allocator>::reverse_iterator + list<T, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template<class T, class Allocator> typename list<T, Allocator>::const_reverse_iterator + list<T, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template<class T, class Allocator> bool list<T, Allocator>::empty() const{ + return (elements == 0); + } + template<class T, class Allocator> typename list<T, Allocator>::size_type list<T, Allocator>::size() const{ + return elements; + } + template<class T, class Allocator> typename list<T, Allocator>::size_type list<T, Allocator>::max_size() const{ + return ((size_type)(-1)) / (sizeof(T) + sizeof(node)); + } + template<class T, class Allocator> void list<T, Allocator>::resize(typename Allocator::size_type sz, T c){ +// if(sz > elements){ + for(typename Allocator::size_type i = elements; i < sz; ++i){ + push_back(c); + } +// } +// if(sz < elements){ + for(typename Allocator::size_type i = elements; i > sz; --i){ + pop_back(); + } +// } + } + + template<class T, class Allocator> typename list<T, Allocator>::reference list<T, Allocator>::front(){ + return *(list_start->val); + } + template<class T, class Allocator> typename list<T, Allocator>::const_reference list<T, Allocator>::front() const{ + return *(list_start->val); + } + template<class T, class Allocator> typename list<T, Allocator>::reference list<T, Allocator>::back(){ + return *(list_end->previous->val); + } + template<class T, class Allocator> typename list<T, Allocator>::const_reference list<T, Allocator>::back() const{ + return *(list_end->previous->val); + } + + + template<class T, class Allocator> void list<T, Allocator>::push_front(const T& x){ + node * temp = new node(x); + list_start->previous = temp; + temp->previous = 0; + temp->next = list_start; + list_start = temp; + ++elements; + } + + template<class T, class Allocator> void list<T, Allocator>::pop_front(){ + if(elements > 0){ + list_start = list_start->next; + delete list_start->previous->val; +#if UCLIBCXX_DEBUG + list_start->previous->val = 0; + list_start->previous->next = 0; + list_start->previous->previous = 0; +#endif + delete list_start->previous; + list_start->previous = 0; + --elements; + } + } + + template<class T, class Allocator> void list<T, Allocator>::push_back(const T& x){ + if(elements == 0){ + //The list is completely empty + list_start = new node(x); + list_end->previous = list_start; + list_start->previous = 0; + list_start->next = list_end; + elements = 1; + }else{ + node * temp = new node(x); + temp->previous = list_end->previous; + temp->next = list_end; + list_end->previous->next = temp; + list_end->previous = temp; + ++elements; + } + } + + template<class T, class Allocator> void list<T, Allocator>::pop_back(){ + if(elements > 0){ + node * temp = list_end->previous; + if(temp == list_start){ + list_end->previous = 0; + list_start = list_end; + }else{ + temp->previous->next = temp->next; + list_end->previous = temp->previous; + } + delete temp->val; +#if UCLIBCXX_DEBUG + temp->val = 0; + temp->next = 0; + temp->previous = 0; +#endif + delete temp; +#if UCLIBCXX_DEBUG + temp = 0; +#endif + --elements; + } + } + + + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::insert(iterator position, const T& x) + { + node * temp = new node(x); + + temp->previous = position.link_struct()->previous; + temp->next = position.link_struct(); + + if(temp->previous == 0){ + list_start = temp; + }else{ + position.link_struct()->previous->next = temp; + } + + position.link_struct()->previous = temp; + + ++elements; + --position; + return position; + } + + template<class T, class Allocator> void list<T, Allocator>::insert(iterator position, size_type n, const T& x){ + for(typename list<T, Allocator>::size_type i = 0; i < n; ++i){ + position = insert(position, x); + } + } + + template<class T, class Allocator> template <class InputIterator> void + list<T, Allocator>::insert(iterator position, InputIterator first, InputIterator last) + { + while(first !=last){ + insert(position, *first); + ++first; + } + } + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::erase(iterator position) + { + if(position != end() ){ + node * temp = position.link_struct(); + if(temp == list_start){ + ++position; + temp->next->previous = 0; + list_start = temp->next; + }else{ + --position; + temp->next->previous = temp->previous; + temp->previous->next = temp->next; + ++position; + } + delete temp->val; +#if UCLIBCXX_DEBUG + temp->next = 0; + temp->previous = 0; + temp->val = 0; +#endif + delete temp; +#if UCLIBCXX_DEBUG + temp = 0; +#endif + --elements; + } + return position; + } + template<class T, class Allocator> typename list<T, Allocator>::iterator + list<T, Allocator>::erase(iterator position, iterator last) + { + iterator temp = position; + while(position !=last){ + position = erase(position); + } + return position; + } + template<class T, class Allocator> void list<T, Allocator>::swap(list<T,Allocator>& l){ + node * temp; + size_type tempel; + + temp = list_start; + list_start = l.list_start; + l.list_start = temp; + + temp = list_end; + list_end = l.list_end; + l.list_end = temp; + + tempel = elements; + elements = l.elements; + l.elements = tempel; + } + template<class T, class Allocator> void list<T, Allocator>::clear(){ + while(elements > 0){ + pop_front(); + } + } + + template<class T, class Allocator> list<T,Allocator>& list<T, Allocator>:: operator=(const list<T,Allocator>& x){ + if(&x == this){ + return *this; + } + clear(); + iterator i = x.begin(); + while(i != x.end()){ + push_back(*i); + ++i; + } + return *this; + } + + + template<class T, class Allocator> + void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x) + { + + //Can't add non-existant elements + if(x.elements == 0){ + return; + } + + elements += x.elements; + x.elements = 0; + + + //Chaining to the begining + if(position == begin()){ + x.list_end->previous->next = list_start; + list_start->previous = x.list_end->previous; + + list_start = x.list_start; + + x.list_start = x.list_end; + x.list_end->previous = 0; + + return; + } + + //Link everything we need + x.list_start->previous = position.link_struct()->previous; + position.link_struct()->previous->next = x.list_start; + + position.link_struct()->previous = x.list_end->previous; + x.list_end->previous->next = position.link_struct(); + + //Clean up the other list + + x.list_start = x.list_end; + x.list_end->previous=0; + + } + + template<class T, class Allocator> + void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x, iterator i) + { + //Invalid conditions + if( x.elements == 0 || i == position || position.link_struct() == i.link_struct()->next ){ + return; + } + + + //Do we need to adjust the begining pointer? + if(i == x.begin()){ + x.list_start = x.list_start->next; + x.list_start->previous = 0; + } + + + //Insert at begining special case + if(position == begin()){ + + i.link_struct()->previous->next = i.link_struct()->next; + i.link_struct()->next->previous = i.link_struct()->previous; + + i.link_struct()->previous = 0; + i.link_struct()->next = position.link_struct(); + position.link_struct()->previous = i.link_struct(); + + list_start = i.link_struct(); + + --x.elements; + ++elements; + return; + } + + if( i.link_struct()->previous != 0){ + i.link_struct()->previous->next = i.link_struct()->next; + i.link_struct()->next->previous = i.link_struct()->previous; + }else{ + i.link_struct()->next->previous = 0; + x.list_start = i.link_struct()->next; + } + + i.link_struct()->previous = position.link_struct()->previous; + position.link_struct()->previous->next = i.link_struct(); + + i.link_struct()->next = position.link_struct(); + position.link_struct()->previous = i.link_struct(); + + --x.elements; + ++elements; + } + + template<class T, class Allocator> + void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x, + iterator first, iterator last) + { + if(x.elements == 0){ + return; + } + + iterator temp; + while(first != last){ + temp = first; + ++first; + splice(position, x, temp); + } + } + + + template<class T, class Allocator> void list<T, Allocator>::remove(const T& value){ + iterator temp = begin(); + while( temp != end() ){ + if(*temp == value){ + temp = erase(temp); + }else{ + ++temp; + } + } + } + + + template<class T, class Allocator> template <class Predicate> void list<T, Allocator>::remove_if(Predicate pred){ + iterator temp = begin(); + while( temp != end() ){ + if( pred(*temp) ){ + temp = erase(temp); + }else{ + ++temp; + } + } + } + + + template<class T, class Allocator> void list<T, Allocator>::unique(){ + equal_to<typename iterator_traits<iterator>::value_type> p; + unique(p); + } + + template<class T, class Allocator> template <class BinaryPredicate> + void list<T, Allocator>::unique(BinaryPredicate binary_pred) + { + iterator temp1 = begin(); + iterator temp2; + ++temp1; + while( temp1 != end() ){ + temp2 = temp1; + --temp2; + if( binary_pred(*temp1, *temp2) ){ + erase(temp1); + temp1 = temp2; + } + ++temp1; + } + } + + template<class T, class Allocator> void list<T, Allocator>::merge(list<T,Allocator>& x){ + less<typename iterator_traits<typename list<T, Allocator>::iterator>::value_type> c; + merge(x, c); + } + + template<class T, class Allocator> template <class Compare> + void list<T, Allocator>::merge(list<T,Allocator>& x, Compare comp) + { + iterator source = x.begin(); + iterator temp; + iterator dest = begin(); + + while(source != x.end()){ + while( dest != end() && comp (*dest, *source) ){ + ++dest; + } + ++elements; + --x.elements; + + temp = source; + ++temp; + + if(dest == begin()){ + dest.link_struct()->previous = source.link_struct(); + source.link_struct()->next = dest.link_struct(); + source.link_struct()->previous = 0; + list_start = source.link_struct(); + }else{ + source.link_struct()->previous = dest.link_struct()->previous; + dest.link_struct()->previous->next = source.link_struct(); + source.link_struct()->next = dest.link_struct(); + dest.link_struct()->previous = source.link_struct(); + } + source = temp; + } + + //Fix up x; + x.list_start = x.list_end; + x.list_start->previous = 0; + } + + template<class T, class Allocator> void list<T, Allocator>::sort(){ + less<typename iterator_traits<typename list<T, Allocator>::iterator>::value_type> c; + sort(c); + } + + template<class T, class Allocator> template <class Compare> + void list<T, Allocator>::sort(Compare comp) + { + typename list<T, Allocator>::iterator i, j, k; + + //FIXME - bubble sort + + if(elements == 0){ + return; + } + + i = end(); + --i; + while(i != begin()){ + j = begin(); + k = j; + ++k; + while(j != i){ + if( comp(*k, *j) ){ + swap_nodes(k.link_struct(), j.link_struct()); + } + ++j; + ++k; + } + --i; + } + } + + + template<class T, class Allocator> void list<T, Allocator>::reverse(){ + if(elements == 0){ + return; + } + + node * current; + node * following; + node * temp; + + //Need to move the list_end element to the begining + + temp = list_end; + list_end = temp->previous; + list_end->next = 0; + + list_start->previous = temp; + temp->previous = 0; + temp->next = list_start; + list_start = temp; + + current = list_start; + + while( current != list_end ){ + following = current->next; + + //Swap the values pointed to/at with the current node + temp = current->next; + current->next = current->previous; + current->previous = temp; + + current = following; + } + + //Swap pointers on the end node + temp = list_end->next; + list_end->next = list_end->previous; + list_end->previous = temp; + + + //Swap the fixed pointers + temp = list_start; + list_start = list_end; + list_end = temp; + + } + + template <class T, class Allocator> + bool operator==(const list<T,Allocator>& x, const list<T,Allocator>& y){ + if(x.size() != y.size()){ + return false; + } + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + + while(i != x.end()){ + if( *i != *j){ + return false; + } + ++i; + ++j; + } + return true; + } + + template <class T, class Allocator> + bool operator< (const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i < *j){ + return true; + } + if(*j < *i){ + return false; + } + ++i; + ++j; + } + return (i == x.end() && j != y.end()); + } + + template <class T, class Allocator> + bool operator!=(const list<T,Allocator>& x, const list<T,Allocator>& y){ + return !(x == y); + } + + template <class T, class Allocator> + bool operator> (const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i > *j){ + return true; + } + if( *j > *i){ + return false; + } + ++i; + ++j; + } + return (i != x.end() && j == y.end()); + } + + template <class T, class Allocator> + bool operator>=(const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i >= *j){ + return true; + } + if(*j >= *i){ + return false; + } + ++i; + ++j; + } + return (i != x.end() && j == y.end()); + } + + template <class T, class Allocator> + bool operator<=(const list<T,Allocator>& x, const list<T,Allocator>& y){ + typename list<T,Allocator>::const_iterator i = x.begin(); + typename list<T,Allocator>::const_iterator j = y.begin(); + while(i != x.end() && j != y.end()){ + if( *i <= *j){ + return true; + } + if(*j <= *i){ + return false; + } + ++i; + ++j; + } + return (i == x.end()); + } + + template <class T, class Allocator> + void swap(list<T,Allocator>& x, list<T,Allocator>& y){ + x.swap(y); + } + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/locale b/i386/modules/uClibcxx/include/locale new file mode 100644 index 0000000..e3ace7b --- /dev/null +++ b/i386/modules/uClibcxx/include/locale @@ -0,0 +1,79 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <string> + +#ifndef __HEADER_STD_LOCALE +#define __HEADER_STD_LOCALE 1 + +namespace std{ + class _UCXXEXPORT locale { + public: + // types: + class facet; + class id; + typedef unsigned char category; + + static const category + none = 0, + collate = 0x01, ctype = 0x02, + monetary = 0x04, numeric = 0x08, + time = 0x10, messages = 0x20, + all = collate | ctype | monetary | numeric | time | messages; + + // construct/copy/destroy: + locale() throw(){ + return; + } + locale(const locale& other) throw(){ + (void)other; + return; + } + locale(const char *) throw(){ + return; + } + ~locale() throw(){ + return; + } + + const locale& operator=(const locale&) throw(){ + return *this; + } + std::string name() const { return "C"; } + }; + + class _UCXXEXPORT locale::facet { + friend class locale; + explicit facet(size_t = 0){ + return; + } + virtual ~facet(){ + return; + } + }; + + class _UCXXEXPORT locale::id { + id(){ } + }; + +} + +#endif diff --git a/i386/modules/uClibcxx/include/map b/i386/modules/uClibcxx/include/map new file mode 100644 index 0000000..8478f61 --- /dev/null +++ b/i386/modules/uClibcxx/include/map @@ -0,0 +1,257 @@ +/* Copyright (C) 2004-2007 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include <memory> +#include <utility> +#include <iterator> +#include <deque> +#include <functional> +#include <associative_base> + + +#ifndef __STD_HEADER_MAP +#define __STD_HEADER_MAP + +namespace std{ + + +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class map; +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class multimap; + + + //Compare the keys of the two items +/* template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT + __base_map<Key, T, Compare, Allocator>::value_compare : public binary_function< + typename map<Key, T, Compare, Allocator>::value_type, + typename map<Key, T, Compare, Allocator>::value_type, + bool> + { + friend class __base_map<Key, T, Compare, Allocator>; + protected: + Compare comp; + value_compare(Compare c) : comp(c) { } + ~value_compare() { } + public: + bool operator()(const value_type& x, const value_type& y) const { + return comp(x.first, y.first); + } + }; +*/ + +// value_compare value_comp() const; + + + +/* This is the implementation for the map container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + + +//Implementation of map + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT map + : public __single_associative<Key, pair<Key, T>, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it + +public: + + typedef __single_associative<Key, pair<Key, T>, Compare, Allocator> base; + typedef T mapped_type; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + static const key_type v_t_k(const value_type v){ + return v.first; + } + +// using base::value_compare; + + explicit map(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> map(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + map(const map<Key,T,Compare,Allocator>& x) : base(x) { } + ~map() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + reference operator[](const key_type& k){ + //This is from the spec and is quite ugly. + return (*((insert(make_pair(k, T()))).first)).second; + } + +protected: + using base::backing; +}; + + +//Implementation of multimap + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT multimap + : public __multi_associative<Key, pair<Key, T>, Compare, Allocator> + +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __multi_associative<Key, pair<Key, T>, Compare, Allocator> base; + typedef T mapped_type; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + static const key_type v_t_k(const value_type v){ + return v.first; + } + + explicit multimap(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> multimap(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + + multimap(const multimap<Key,T,Compare,Allocator>& x) : base(x) { } + ~multimap() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + +protected: + + using base::c; + +}; + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y); + + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y); + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/map.old b/i386/modules/uClibcxx/include/map.old new file mode 100644 index 0000000..c77e056 --- /dev/null +++ b/i386/modules/uClibcxx/include/map.old @@ -0,0 +1,1163 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include <deque> +#include<functional> + + +#ifndef __STD_HEADER_MAP +#define __STD_HEADER_MAP + +#pragma GCC visibility push(default) + +namespace std{ + + +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class __base_map; +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class map; +template<class Key, class T, class Compare = less<Key>, class Allocator = allocator<T> > class multimap; + +template<class Key, class T, class Compare, class Allocator> class __map_iter; +template<class Key, class T, class Compare, class Allocator> class __map_citer; + +/* The code for the map containers is split up into two classes. + * The first class, __base_map holds all of the data and does much of the iterator-based + * work. Then the classes map and multimap inherit from there. This was done to reduce + * the redundancy of code (And thus errors which might crop up), as well as possibly + * reducing the size of binaries if both map and multimap are used, along with the same + * template parameters. + */ + + + +//All base classes first (__base_map, iterators, value_compare) and it's associated code + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __base_map{ + +protected: + friend class __map_iter<Key, T, Compare, Allocator>; + friend class __map_citer<Key, T, Compare, Allocator>; + +public: + typedef __base_map<Key,T,Compare,Allocator> map_type; + typedef Key key_type; + typedef T mapped_type; + typedef pair<Key, T> value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef __map_iter<Key, T, Compare, Allocator> iterator; + typedef __map_citer<Key, T, Compare, Allocator> const_iterator; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename std::reverse_iterator<iterator> reverse_iterator; + typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator; + + class value_compare; + + explicit __base_map(const Compare& comp = Compare(), const Allocator& al = Allocator()); + __base_map(const map_type& x); + ~__base_map(); + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + bool empty() const; + size_type size() const; + size_type max_size() const; + + iterator lower_bound(const key_type& x); + const_iterator lower_bound(const key_type& x) const; + + void swap(map_type & x); + void clear(); + + key_compare key_comp() const; +// value_compare value_comp() const; + +protected: + + deque<pair<Key, T>, allocator<pair<Key, T> > > data; + Compare c; + +}; + + + //Implementations + + template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __map_citer + : public std::iterator< + bidirectional_iterator_tag, + std::pair<Key, T>, + typename Allocator::difference_type, + std::pair<Key, T>*, + std::pair<Key, T>& + > + { + protected: + typedef __base_map<Key, T, Compare, Allocator> Map; + + friend class __base_map<Key, T, Compare, Allocator>; + friend class __base_map<Key, T, Compare, Allocator>::iterator; + + friend class map<Key, T, Compare, Allocator>; + friend class multimap<Key, T, Compare, Allocator>; + + typename Map::size_type element; + const Map * container; + public: + __map_citer() : element(0), container(0) { } + __map_citer(const typename Map::const_iterator & m) + : element(m.element), container(m.container) { } + __map_citer(typename Map::size_type e, const Map * const c) + : element(e), container(c) { } + ~__map_citer() { } + + typename Map::value_type operator*() const{ + return container->data[element]; + } + const typename Map::value_type * operator->() const{ + return &(container->data[element]); + } + __map_citer & operator=(const typename Map::const_iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Map::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Map::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __map_citer & operator++(){ + ++element; + return *this; + } + __map_citer operator++(int){ + __map_citer temp(*this); + ++element; + return temp; + } + __map_citer & operator--(){ + --element; + return *this; + } + __map_citer operator--(int){ + __map_citer temp(*this); + --element; + return temp; + } + + }; + + + template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT __map_iter + : public std::iterator< + bidirectional_iterator_tag, + std::pair<Key, T>, + typename Allocator::difference_type, + std::pair<Key, T>*, + std::pair<Key, T>& + > + { + protected: + typedef class __base_map<Key, T, Compare, Allocator> Map; + + //FIXME - Find a way to use template parameters or something. This will do for now + friend class __base_map<Key, T, Compare, Allocator>; + friend class __base_map<Key, T, Compare, Allocator>::const_iterator; + + friend class map<Key, T, Compare, Allocator>; + friend class multimap<Key, T, Compare, Allocator>; + + typename Map::size_type element; + Map * container; + public: + __map_iter() : element(0), container(0) { } + __map_iter(const typename Map::iterator & m) + : element(m.element), container(m.container) { } + __map_iter(typename Map::size_type e, Map * c) + : element(e), container(c) { } + ~__map_iter() { } + + typename Map::value_type & operator*(){ + return container->data[element]; + } + const typename Map::value_type & operator*() const{ + return container->data[element]; + } + typename Map::value_type * operator->(){ + return &(container->data[element]); + } + __map_iter & operator=(const typename Map::iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Map::iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Map::iterator & m) const { + return (m.element != element || m.container != container); + } + bool operator==(const typename Map::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Map::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __map_iter & operator++(){ + ++element; + return *this; + } + __map_iter operator++(int){ + __map_iter temp(*this); + ++element; + return temp; + } + __map_iter & operator--(){ + --element; + return *this; + } + __map_iter operator--(int){ + __map_iter temp(*this); + --element; + return temp; + } + + operator typename Map::const_iterator() const{ + return typename Map::const_iterator(element, container); + } + + }; + + + //Compare the keys of the two items + template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT + __base_map<Key, T, Compare, Allocator>::value_compare : public binary_function< + typename map<Key, T, Compare, Allocator>::value_type, + typename map<Key, T, Compare, Allocator>::value_type, + bool> + { + friend class __base_map<Key, T, Compare, Allocator>; + protected: + Compare comp; + value_compare(Compare c) : comp(c) { } + ~value_compare() { } + public: + bool operator()(const value_type& x, const value_type& y) const { + return comp(x.first, y.first); + } + }; + + template <class Key, class T, class Compare, class Allocator> + __base_map<Key, T, Compare, Allocator>::__base_map(const Compare& comp, const Allocator&) + : data(), c(comp) + { + + } + + template <class Key, class T, class Compare, class Allocator> + __base_map<Key, T, Compare, Allocator>::__base_map(const __base_map<Key,T,Compare,Allocator>& x) + : data(x.data), c(x.c) + { + + } + + template <class Key, class T, class Compare, class Allocator> + __base_map<Key, T, Compare, Allocator>::~__base_map() + { + + } + + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::iterator + __base_map<Key, T, Compare, Allocator>::begin() + { + return iterator(0, this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_iterator + __base_map<Key, T, Compare, Allocator>::begin() const + { + return const_iterator(0, this); + + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::iterator + __base_map<Key, T, Compare, Allocator>::end() + { + return iterator(data.size(), this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_iterator + __base_map<Key, T, Compare, Allocator>::end() const + { + return const_iterator(data.size(), this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::reverse_iterator + __base_map<Key, T, Compare, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_reverse_iterator + __base_map<Key, T, Compare, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::reverse_iterator + __base_map<Key, T, Compare, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_reverse_iterator + __base_map<Key, T, Compare, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template <class Key, class T, class Compare, class Allocator> + bool __base_map<Key, T, Compare, Allocator>::empty() const + { + return (data.size() == 0); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::size_type + __base_map<Key, T, Compare, Allocator>::size() const + { + return data.size(); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::size_type + __base_map<Key, T, Compare, Allocator>::max_size() const + { + return data.max_size(); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::iterator + __base_map<Key, T, Compare, Allocator>::lower_bound(const key_type &x) + { + size_type low = 0; + size_type high = data.size(); + + while (low < high) { + size_type i = (low + high) / 2; + if( c(data[i].first, x) ){ + low = i + 1; + }else{ + high = i; + } + } + + return iterator(low, this); + } + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::const_iterator + __base_map<Key, T, Compare, Allocator>::lower_bound(const key_type &x) const + { + size_type low = 0; + size_type high = data.size(); + + while (low < high) { + size_type i = (low + high) / 2; + if( c(data[i].first, x) ){ + low = i + 1; + }else{ + high = i; + } + } + + return const_iterator(low, this); + } + + template <class Key, class T, class Compare, class Allocator> + void __base_map<Key, T, Compare, Allocator>::swap(__base_map<Key,T,Compare,Allocator>& m) + { + Compare n = c; + c = m.c; + m.c = n; + + data.swap(m.data); + } + + + template <class Key, class T, class Compare, class Allocator> + void __base_map<Key, T, Compare, Allocator>::clear() + { + data.clear(); + } + + + template <class Key, class T, class Compare, class Allocator> + typename __base_map<Key, T, Compare, Allocator>::key_compare + __base_map<Key, T, Compare, Allocator>::key_comp() const + { + return c; + } + +// value_compare value_comp() const; + + + + + +/* This is the implementation for the map container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + + + + +//Implementation of map + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT map + : public __base_map<Key, T, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_map<Key, T, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::mapped_type mapped_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::value_compare; + + explicit map(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> map(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + map(const map<Key,T,Compare,Allocator>& x) : base(x) { } + ~map() { } + + map<Key,T,Compare,Allocator>& operator=(const map<Key,T,Compare,Allocator>& x); + + reference operator[](const key_type& k); + + pair<iterator, bool> insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + + template <class InputIterator> void insert(InputIterator first, InputIterator last); + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + friend bool operator==(const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + + using base::data; + using base::c; + +}; + + + template <class Key, class T, class Compare, class Allocator> template <class InputIterator> + map<Key, T, Compare, Allocator>:: + map(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class T, class Compare, class Allocator> + map<Key, T, Compare, Allocator>::map<Key,T,Compare,Allocator>& + map<Key, T, Compare, Allocator>::operator=(const map<Key,T,Compare,Allocator>& x) + { + if( &x == this){ + return *this; + } + c = x.c; + data = x.data; + return *this; + } + + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::reference + map<Key, T, Compare, Allocator>::operator[](const key_type & k) + { +/* iterator i = lower_bound(k); + if( !c( i->first, k) && !c(k, i->first) ){ + return i->second; + } + pair<Key, T> t; + t.first = k; + t.second = T(); + return insert(t).first->second; +*/ + //This is from the spec and is quite ugly. + return (*((insert(make_pair(k, T()))).first)).second; + } + + template <class Key, class T, class Compare, class Allocator> + pair<typename map<Key, T, Compare, Allocator>::iterator, bool> + map<Key, T, Compare, Allocator>::insert(const value_type& x) + { + pair<typename map<Key, T, Compare, Allocator>::iterator, bool> retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x.first, data[0].first) ){ + data.push_front(x); + retval.first = begin(); + retval.second = true; + return retval; + } + + //Element to insert goes at the end + if( c(data[data.size() - 1].first, x.first) ){ + data.push_back(x); + retval.first = end(); + --retval.first; + retval.second = true; + return retval; + } + + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x.first); + + //No match - this should never happen + if(retval.first == end()){ + retval.second = false; + return retval; + } + + //If we have an exact match + if( !c( retval.first->first, x.first) && !c(x.first, retval.first->first ) ){ + retval.second = false; + return retval; + } + + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator q(&data, retval.first.element); + data.insert(q, x); + + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x.first); //Need to refind because insert can move data around + retval.second = true; + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::iterator + map<Key, T, Compare, Allocator>::insert(iterator, const value_type& x) + { + //Just reusing code. It's hard to make improvements over existing algo. + //We aren't using the iterator parameter, but it's only a hint and not required to be used. + insert(x); + return find(x.first); + } + + template <class Key, class T, class Compare, class Allocator> + template <class InputIterator> void + map<Key, T, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class T, class Compare, class Allocator> void + map<Key, T, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator pos(&data, position.element); + data.erase(pos); + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::size_type + map<Key, T, Compare, Allocator>::erase(const key_type& x) + { + typename map<Key, T, Compare, Allocator>::iterator i = find(x); + if(i!=end()){ + erase(i); + return 1; + } + return 0; + } + + template <class Key, class T, class Compare, class Allocator> + void map<Key, T, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator f(&data, first.element); + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator l(&data, last.element); + data.erase(f, l); + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::iterator + map<Key, T, Compare, Allocator>:: + find(const typename map<Key, T, Compare, Allocator>::key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( retval->first, x) && !c(x, retval->first )){ + return retval; + } + return end(); + + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::const_iterator + map<Key, T, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + + const_iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( retval->first, x) && !c(x, retval->first )){ + return retval; + } + return end(); + + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::size_type + map<Key, T, Compare, Allocator>::count(const typename map<Key, T, Compare, Allocator>::key_type& x) const + { + if( find(x) == end()){ + return 0; + } + return 1; + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::iterator + map<Key, T, Compare, Allocator>::upper_bound(const key_type& x) + { + typename map<Key, T, Compare, Allocator>::iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + if( i != end() && !c(x, i->first) ){ + ++i; + } + return i; + } + + template <class Key, class T, class Compare, class Allocator> + typename map<Key, T, Compare, Allocator>::const_iterator + map<Key, T, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename map<Key, T, Compare, Allocator>::const_iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + if(i != end() && !c(x, i->first)){ + ++i; + } + return i; + } + + + template <class Key, class T, class Compare, class Allocator> + pair< typename map<Key, T, Compare, Allocator>::iterator, + typename map<Key, T, Compare, Allocator>::iterator + > map<Key, T, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename map<Key, T, Compare, Allocator>::iterator, + typename map<Key, T, Compare, Allocator>::iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class T, class Compare, class Allocator> + pair< typename map<Key, T, Compare, Allocator>::const_iterator, + typename map<Key, T, Compare, Allocator>::const_iterator + > map<Key, T, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename map<Key, T, Compare, Allocator>::const_iterator, + typename map<Key, T, Compare, Allocator>::const_iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class T, class Compare, class Allocator> bool operator== + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y) + { + if(x.c == y.c && x.data == y.data){ + return true; + } + return false; + } + + + +//Implementation of multimap + + +template<class Key, class T, class Compare, class Allocator> class _UCXXEXPORT multimap + : public __base_map<Key, T, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_map<Key, T, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::mapped_type mapped_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + explicit multimap(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> multimap(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + multimap(const multimap<Key,T,Compare,Allocator>& x) : base(x) { } + ~multimap() { } + + multimap<Key,T,Compare,Allocator>& operator=(const multimap<Key,T,Compare,Allocator>& x); + + iterator insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + template <class InputIterator> void insert(InputIterator first, InputIterator last); + + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + using base::data; + using base::c; + +}; + + + + template <class Key, class T, class Compare, class Allocator> template <class InputIterator> + multimap<Key, T, Compare, Allocator>:: + multimap(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class T, class Compare, class Allocator> + multimap<Key, T, Compare, Allocator>::multimap<Key,T,Compare,Allocator>& + multimap<Key, T, Compare, Allocator>::operator=(const multimap<Key,T,Compare,Allocator>& x) + { + if( &x == this){ + return *this; + } + c = x.c; + data = x.data; + return *this; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::insert(const value_type &x) + { + iterator retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x.first, data[0].first) ){ + data.push_front(x); + return begin(); + } + + //Element to insert goes at the end + if( c(data[data.size() - 1].first, x.first) ){ + data.push_back(x); + return end(); + } + + retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x.first); + + //No match - this should never happen + if(retval == end()){ + return retval; + } + + if( !c(x.first, retval->first) ){ + ++retval; + } + + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator q(&data, retval.element); + data.insert(q, x); + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::insert(iterator position, const value_type& x) + { + + //Inserting at begining + if(position == begin() && !c(position->first, x.first) ){ + data.push_front(x); + return position; + } + //Inserting at end + if(position == end() && !c(x.first, data[data.size() - 1].first) ){ + data.push_back(x); + return position; + } + + //Inserting in middle + iterator temp = position; + --temp; + if( !c(position->first, x.first) && !c(x.first, temp->first) ){ + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator q(&data, position.element); + data.insert(q, x); + return position; + } + + return insert(x); + } + + template <class Key, class T, class Compare, class Allocator> + template <class InputIterator> void + multimap<Key, T, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + + + template <class Key, class T, class Compare, class Allocator> void + multimap<Key, T, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator pos(&data, position.element); + data.erase(pos); + } + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::size_type + multimap<Key, T, Compare, Allocator>::erase(const key_type& x) + { + typename multimap<Key, T, Compare, Allocator>::iterator f = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + typename multimap<Key, T, Compare, Allocator>::iterator l = upper_bound(x); + size_type t = l.element - f.element; + erase(f, l); + return t; + } + + + + template <class Key, class T, class Compare, class Allocator> + void multimap<Key, T, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator f(&data, first.element); + typename deque<pair<Key, T>, allocator<pair<Key, T> > >::iterator l(&data, last.element); + data.erase(f, l); + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::find(const key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + if( c(x, retval->first) || c(retval->first, x) ){ + return end(); + } + + while( retval.element > 0 && !c(retval->first, x) && !c(x, retval->first) ){ + --retval; + } + if( c(retval->first, x)){ + ++retval; + } + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::const_iterator + multimap<Key, T, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + const_iterator retval = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + if(retval == end()){ + return retval; + } + + if( c(x, retval->first) || c(retval->first, x) ){ + return end(); + } + + while( retval.element > 0 && !c(retval->first, x) && !c(x, retval->first) ){ + --retval; + } + if( c(retval->first, x)){ + ++retval; + } + + + return retval; + } + + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::size_type + multimap<Key, T, Compare, Allocator>:: + count(const typename multimap<Key, T, Compare, Allocator>::key_type& x) const + { + pair< typename multimap<Key, T, Compare, Allocator>::const_iterator, + typename multimap<Key, T, Compare, Allocator>::const_iterator + > temp = equal_range(x); + + return temp.second.element - temp.first.element; + } + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::iterator + multimap<Key, T, Compare, Allocator>::upper_bound(const key_type& x) + { + typename multimap<Key, T, Compare, Allocator>::iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + while(i != end() && !c(x, i->first)){ + ++i; + } + return i; + } + + template <class Key, class T, class Compare, class Allocator> + typename multimap<Key, T, Compare, Allocator>::const_iterator + multimap<Key, T, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename multimap<Key, T, Compare, Allocator>::const_iterator i = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + + while(i != end() && !c(x, i->first)){ + ++i; + } + return i; + } + + + template <class Key, class T, class Compare, class Allocator> + pair< typename multimap<Key, T, Compare, Allocator>::iterator, + typename multimap<Key, T, Compare, Allocator>::iterator + > multimap<Key, T, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename multimap<Key, T, Compare, Allocator>::iterator, + typename multimap<Key, T, Compare, Allocator>::iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class T, class Compare, class Allocator> + pair< typename multimap<Key, T, Compare, Allocator>::const_iterator, + typename multimap<Key, T, Compare, Allocator>::const_iterator + > multimap<Key, T, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename multimap<Key, T, Compare, Allocator>::const_iterator, + typename multimap<Key, T, Compare, Allocator>::const_iterator + > retval; + retval.first = __base_map<Key, T, Compare, Allocator>::lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + + + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (map<Key,T,Compare,Allocator>& x, map<Key,T,Compare,Allocator>& y); + + + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multimap<Key,T,Compare,Allocator>& x, const multimap<Key,T,Compare,Allocator>& y); + template <class Key, class T, class Compare, class Allocator> _UCXXEXPORT void swap + (multimap<Key,T,Compare,Allocator>& x, multimap<Key,T,Compare,Allocator>& y); + +} + +#pragma GCC visibility pop + +#endif + + diff --git a/i386/modules/uClibcxx/include/memory b/i386/modules/uClibcxx/include/memory new file mode 100644 index 0000000..aea62ad --- /dev/null +++ b/i386/modules/uClibcxx/include/memory @@ -0,0 +1,192 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> +#include <cstddef> +#include <cstdlib> +#include <iterator_base> +#include <utility> +#include <cstdio> + +#ifndef HEADER_STD_MEMORY +#define HEADER_STD_MEMORY 1 + +namespace std{ + +template <class T> class allocator; + // Specialize for void: + +template <> class _UCXXEXPORT allocator<void> { +public: + typedef void* pointer; + typedef const void* const_pointer; + typedef void value_type; + template <class U> struct rebind { typedef allocator<U> other; }; +}; + +template <class T> class _UCXXEXPORT allocator{ +public: + typedef T value_type; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + + typedef T* pointer; + typedef const T* const_pointer; + + typedef T& reference; + typedef const T& const_reference; + + pointer address(reference r) const { return &r; } + const_pointer address(const_reference r) const { return &r; } + + allocator() throw(){} + template <class U> allocator(const allocator<U>& ) throw(); + ~allocator() throw(){} + + //Space for n Ts + pointer allocate(size_type n, typename allocator<void>::const_pointer = 0){ + return (T*)(::operator new( n * sizeof(T) )); + } + void deallocate(pointer p, size_type){ + ::operator delete(p); + } + + //Use placement new to engage the constructor + void construct(pointer p, const T& val) { new((void*)p) T(val); } + void destroy(pointer p){ ((T*)p)->~T(); } //Call destructor + + size_type max_size() const throw(); + template<class U> struct rebind { typedef allocator<U> other; }; + +}; + +template <class Out, class T> class _UCXXEXPORT raw_storage_iterator + : public iterator<output_iterator_tag, void, void, void, void> +{ + Out p; + +public: + explicit raw_storage_iterator(Out pp) : p (pp) { } + raw_storage_iterator & operator*() { return *this; } + raw_storage_iterator & operator=(const T& val) { + T* pp = &*p; + new(pp) T(val); + return *this; + } + + raw_storage_iterator & operator++() { ++p; return *this; } + raw_storage_iterator operator++(int) { + raw_storage_iterator t = *this; + ++p; + return t; + } +}; + +template <class T> _UCXXEXPORT pair<T*, ptrdiff_t> get_temporary_buffer(ptrdiff_t n){ + pair<T*, ptrdiff_t> retval; + retval.first = static_cast<T*>(malloc(n * sizeof(T))); + if(retval.first == 0){ + retval.second = 0; + }else{ + retval.second = n; + } + return retval; +} + +template <class T> _UCXXEXPORT void return_temporary_buffer(T* p){ + free(p); +} + + +template <class T> class _UCXXEXPORT auto_ptr{ + +private: + T * object; + template <class Y> struct auto_ptr_ref{ + Y * p; + }; + +public: + + typedef T element_type; + + explicit auto_ptr(T* p =0) throw() : object(p){ } + auto_ptr(auto_ptr& p) throw() : object(p.release()){ } + auto_ptr(auto_ptr_ref<T> r) throw() : object(r.p){ + r.p = 0; + } + template<class Y> auto_ptr(auto_ptr<Y>& p) throw() : object(p.release()){ } + auto_ptr& operator=(auto_ptr& p) throw(){ + if(&p == this){ + return *this; + } + delete object; + object = p.release(); + return *this; + } + template<class Y> auto_ptr& operator=(auto_ptr<Y>& p) throw(){ + if(&p == this){ + return *this; + } + delete object; + object = p.release(); + return *this; + } + ~auto_ptr(){ + delete object; + } + + T& operator*() const throw(){ + return *object; + } + T* operator->() const throw(){ + return object; + } + T* get() const throw(){ + return object; + } + T* release() throw(){ + T * temp(object); + object = 0; + return temp; + } + void reset(T * p=0) throw(){ + if(p != object){ + delete object; + object = p; + } + } + template<class Y> operator auto_ptr_ref<Y>() throw(){ + auto_ptr_ref<Y> retval; + retval.p = object; + object = 0; + return retval; + } + template<class Y> operator auto_ptr<Y>() throw(){ + auto_ptr<Y> retval(object); + object = 0; + return retval; + } + +}; + +} //namespace std + +#endif + diff --git a/i386/modules/uClibcxx/include/new b/i386/modules/uClibcxx/include/new new file mode 100644 index 0000000..f657ac5 --- /dev/null +++ b/i386/modules/uClibcxx/include/new @@ -0,0 +1,60 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> +#include <cstddef> + +#ifndef __STD_NEW_OPERATOR +#define __STD_NEW_OPERATOR 1 + +namespace std{ + class _UCXXEXPORT bad_alloc : public exception {}; + + struct _UCXXEXPORT nothrow_t {}; + extern const nothrow_t nothrow; + + typedef void (*new_handler)(); + _UCXXEXPORT new_handler set_new_handler(new_handler new_p) throw(); +} + + +_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc); +_UCXXEXPORT void operator delete(void* ptr) throw(); + +_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc); +_UCXXEXPORT void operator delete[](void * ptr) throw(); + +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(); +_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) throw(); + +_UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(); +_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) throw(); +#endif + + /* Placement operators */ +inline void* operator new(std::size_t, void* ptr) throw() {return ptr; } +inline void operator delete(void* , void *) throw() { } + +inline void* operator new[](std::size_t, void *p) throw() { return p; } +inline void operator delete[](void* , void *) throw() {} + +#endif + diff --git a/i386/modules/uClibcxx/include/numeric b/i386/modules/uClibcxx/include/numeric new file mode 100644 index 0000000..2a95491 --- /dev/null +++ b/i386/modules/uClibcxx/include/numeric @@ -0,0 +1,157 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> + +#ifndef __STD_NUMERIC_HEADER +#define __STD_NUMERIC_HEADER 1 + +namespace std{ + template <class InputIterator, class T> _UCXXEXPORT + T accumulate(InputIterator first, InputIterator last, T init) + { + while(first != last){ + init = init + *first; + ++first; + } + return init; + } + + template <class InputIterator, class T, class BinaryOperation> _UCXXEXPORT + T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op) + { + while(first != last){ + init = binary_op(init, *first); + ++first; + } + return init; + } + + + template <class InputIterator1, class InputIterator2, class T> _UCXXEXPORT + T inner_product(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init) + { + while(first1 != last1){ + init = init + *first1 * *first2; + ++first1; + ++first2; + } + return init; + } + + template <class InputIterator1, class InputIterator2, class T, + class BinaryOperation1, class BinaryOperation2> _UCXXEXPORT + T inner_product(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init, + BinaryOperation1 binary_op1, + BinaryOperation2 binary_op2) + { + while(first1 != last1){ + init = binary_op1(init, binary_op2(*first1, *first2)); + ++first1; + ++first2; + } + return init; + } + + template <class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator partial_sum(InputIterator first, InputIterator last, + OutputIterator result) + { + OutputIterator temp(result); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = *first + *temp; + temp = result; + ++first; + ++result; + } + return result; + } + + + template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT + OutputIterator partial_sum(InputIterator first, InputIterator last, + OutputIterator result, BinaryOperation binary_op) + { + OutputIterator temp(result); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = binary_op(*first, *temp); + temp = result; + ++first; + ++result; + } + return result; + } + + + template <class InputIterator, class OutputIterator> _UCXXEXPORT + OutputIterator + adjacent_difference(InputIterator first, InputIterator last, + OutputIterator result) + { + OutputIterator temp(first); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = *first - *temp; + temp = first; + ++first; + ++result; + } + + return result; + } + + + template <class InputIterator, class OutputIterator, class BinaryOperation> _UCXXEXPORT + OutputIterator + adjacent_difference(InputIterator first, InputIterator last, + OutputIterator result, BinaryOperation binary_op) + { + OutputIterator temp(first); + *result = *first; + ++first; + ++result; + + while(first != last){ + *result = binary_op(*first, *temp); + temp = first; + ++first; + ++result; + } + + return result; + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/ostream b/i386/modules/uClibcxx/include/ostream new file mode 100644 index 0000000..07d3eaf --- /dev/null +++ b/i386/modules/uClibcxx/include/ostream @@ -0,0 +1,479 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef STD_HEADER_OSTREAM +#define STD_HEADER_OSTREAM 1 + +#include <iosfwd> +#include <streambuf> +#include <cstdio> +#include <ostream_helpers> + +namespace std { + template <class charT, class traits > class basic_ostream; + typedef basic_ostream<char> ostream; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_ostream<wchar_t> wostream; +#endif + + template <class charT, class traits> basic_ostream<charT,traits>& endl(basic_ostream<charT,traits>& os); + template <class charT, class traits> basic_ostream<charT,traits>& ends(basic_ostream<charT,traits>& os); + template <class charT, class traits> basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os); + + template <class charT, class traits > class _UCXXEXPORT basic_ostream + : virtual public basic_ios<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef traits traits_type; + + + _UCXXEXPORT basic_ostream(basic_streambuf<charT,traits>* sb) + : basic_ios<charT, traits>(sb) + { + basic_ios<charT,traits>::init(sb); + } + virtual _UCXXEXPORT ~basic_ostream(); + + class sentry; + + _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& (*pf)(basic_ostream<charT,traits>&)){ + return pf(*this); + } + _UCXXEXPORT basic_ostream<charT,traits>& operator<<(basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&)){ + pf(*this); + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& operator<<(ios_base& (*pf)(ios_base&)){ + pf(*this); + return *this; + } + basic_ostream<charT,traits>& operator<<(bool n); + basic_ostream<charT,traits>& operator<<(short n); + basic_ostream<charT,traits>& operator<<(unsigned short n); + basic_ostream<charT,traits>& operator<<(int n); + basic_ostream<charT,traits>& operator<<(unsigned int n); + basic_ostream<charT,traits>& operator<<(long n); + basic_ostream<charT,traits>& operator<<(unsigned long n); + basic_ostream<charT,traits>& operator<<(float f); + basic_ostream<charT,traits>& operator<<(double f); + basic_ostream<charT,traits>& operator<<(long double f); + basic_ostream<charT,traits>& operator<<(void* p); + basic_ostream<charT,traits>& operator<<(basic_streambuf<char_type,traits>* sb); + + _UCXXEXPORT basic_ostream<charT,traits>& put(char_type c){ + if(basic_ostream<charT,traits>::traits_type::eq_int_type( + basic_ios<charT, traits>::mstreambuf->sputc(c), + basic_ostream<charT,traits>::traits_type::eof())) + { + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& write(const char_type* s, streamsize n){ + if(basic_ostream<charT,traits>::traits_type::eq_int_type( + basic_ios<charT, traits>::mstreambuf->sputn(s, n), + basic_ostream<charT,traits>::traits_type::eof()) + ){ + //basic_ios<charT,traits>::setstate(ios_base::eofbit); + } + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& flush(){ + if(basic_ios<charT, traits>::mstreambuf->pubsync() == -1){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + } + return *this; + } + _UCXXEXPORT pos_type tellp(){ + if(basic_ios<charT,traits>::fail() != false){ + return pos_type(-1); + } + return basic_ios<charT,traits>::rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out); + } + _UCXXEXPORT basic_ostream<charT,traits>& seekp(pos_type pos){ + if( basic_ios<charT,traits>::fail() != true ){ + basic_ios<charT,traits>::rdbuf()->pubseekpos(pos); + } + return *this; + } + _UCXXEXPORT basic_ostream<charT,traits>& seekp(off_type off, ios_base::seekdir dir){ + if( basic_ios<charT,traits>::fail() != true){ + basic_ios<charT,traits>::rdbuf()->pubseekoff(off, dir); + } + return *this; + } + + protected: + basic_ostream(const basic_ostream<charT,traits> &){ } + basic_ostream<charT,traits> & operator=(const basic_ostream<charT,traits> &){ return *this; } + }; + + //Implementations of template functions. To allow for partial specialization + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>::~basic_ostream(){ } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(bool n){ + sentry s(*this); + if( basic_ios<charT,traits>::flags() & ios_base::boolalpha){ + if(n){ + write("true", 4); + }else{ + write("false", 5); + } + }else{ + if(n){ + write("1", 1); + }else{ + write("0", 1); + } + } + if(basic_ios<charT,traits>::flags() & ios_base::unitbuf){ + flush(); + } + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + basic_ostream<charT, traits>::operator<<(unsigned short n){ + sentry s(*this); + __ostream_printout<traits, charT, unsigned long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(short n){ + sentry s(*this); + __ostream_printout<traits, charT, long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(int n){ + sentry s(*this); + __ostream_printout<traits, charT, long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(unsigned int n){ + sentry s(*this); + __ostream_printout<traits, charT, unsigned long int>::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long n){ + sentry s(*this); + __ostream_printout<traits, charT, long >::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + basic_ostream<charT, traits>::operator<<(unsigned long n) + { + sentry s(*this); + __ostream_printout<traits, charT, unsigned long >::printout(*this, n); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(float f){ + sentry s(*this); + __ostream_printout<traits, charT, double >::printout(*this, f); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(double f){ + sentry s(*this); + __ostream_printout<traits, charT, double >::printout(*this, f); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(long double f){ + sentry s(*this); + __ostream_printout<traits, charT, long double >::printout(*this, f); + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& basic_ostream<charT, traits>::operator<<(void* p){ + sentry s(*this); + char buffer[20]; + write(buffer, snprintf(buffer, 20, "%p", p) ); + if(basic_ios<charT,traits>::flags() & ios_base::unitbuf){ + flush(); + } + return *this; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + basic_ostream<charT, traits>::operator<<(basic_streambuf<charT,traits>* sb) + { + sentry s(*this); + if(sb == 0){ + //basic_ios<charT,traits>::setstate(ios_base::badbit); + return *this; + } + + typename traits::int_type c; + + while(basic_ios<charT,traits>::good() && (c = sb->sbumpc()) != traits::eof() ){ + put(c); + } + + if(basic_ios<charT,traits>::flags() & ios_base::unitbuf){ + flush(); + } + return *this; + } + + /*Template Specializations*/ + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_OSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT ostream::~basic_ostream(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT ostream & ostream::flush(); + + template <> _UCXXEXPORT ostream & ostream::operator<<(bool n); + template <> _UCXXEXPORT ostream & ostream::operator<<(short int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(unsigned short int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(unsigned int n); + template <> _UCXXEXPORT ostream & ostream::operator<<(long n); + template <> _UCXXEXPORT ostream & ostream::operator<<(unsigned long n); + template <> _UCXXEXPORT ostream & ostream::operator<<(float f); + template <> _UCXXEXPORT ostream & ostream::operator<<(double f); + template <> _UCXXEXPORT ostream & ostream::operator<<(long double f); + template <> _UCXXEXPORT ostream & ostream::operator<<(void* p); + template <> _UCXXEXPORT ostream & ostream::operator<<(basic_streambuf<char, char_traits<char> >* sb); +#endif +#endif + + template <class charT,class traits/* = char_traits<charT>*/ > + class _UCXXEXPORT basic_ostream<charT,traits>::sentry + { + bool ok; + public: + explicit _UCXXEXPORT sentry(basic_ostream<charT,traits>& os): ok(true){ + if(os.good() !=0){ //Prepare for output + } + + //Flush any tied buffer + if(os.tie() !=0 ){ + os.tie()->flush(); + } + } + _UCXXEXPORT ~sentry() { } + _UCXXEXPORT operator bool() { + return ok; + } + }; + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_OSTREAM__ +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT ostream::sentry::sentry(ostream & os); + template <> _UCXXEXPORT ostream::sentry::~sentry(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ +#endif +#endif + + + //Non - class functions + + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, charT c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, char c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, char c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.put(c); + return out; + } + + // signed and unsigned + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, signed char c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, unsigned char c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.put(c); + return out; + } + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, const charT* c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.write(c, traits::length(c) ); + return out; + } + + template<class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + operator<<(basic_ostream<charT,traits>& out, const char* c) + { + typename basic_ostream<charT,traits>::sentry s(out); + out.write(c, char_traits<char>::length(c) ); + return out; + } + + // partial specializations + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, const char* c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.write(c, traits::length(c)); + return out; + } + +#ifdef __UCLIBCXX_HAS_WCHAR__ + template<class traits> _UCXXEXPORT basic_ostream<wchar_t,traits>& + operator<<(basic_ostream<wchar_t,traits>& out, const char* c) + { + typename basic_ostream<wchar_t, traits>::sentry s(out); + size_t numChars = char_traits<char>::length(c); + wchar_t * temp = new wchar_t[numChars]; + + for(size_t i=0; i < numChars; ++i){ + temp[i] = out.widen(c[i]); + } + + out.write(temp, numChars); + return out; + } +#endif + + // signed and unsigned + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, const signed char* c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.write(reinterpret_cast<const char *>(c), traits::length( reinterpret_cast<const char *>(c))); + return out; + } + + template<class traits> _UCXXEXPORT basic_ostream<char,traits>& + operator<<(basic_ostream<char,traits>& out, const unsigned char* c) + { + typename basic_ostream<char,traits>::sentry s(out); + out.write(reinterpret_cast<const char *>(c), traits::length( reinterpret_cast<const char *>(c))); + return out; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + endl(basic_ostream<charT,traits>& os) + { + typename basic_ostream<charT,traits>::sentry s(os); + os.put('\n'); + os.flush(); + return os; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& + ends(basic_ostream<charT,traits>& os) + { + typename basic_ostream<charT,traits>::sentry s(os); + os.put(traits::eos()); + return os; + } + + template <class charT, class traits> _UCXXEXPORT basic_ostream<charT,traits>& flush(basic_ostream<charT,traits>& os){ + typename basic_ostream<charT,traits>::sentry s(os); + os.flush(); + return os; + } + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_OSTREAM__ + template <> _UCXXEXPORT ostream & endl(ostream & os); + template <> _UCXXEXPORT ostream & flush(ostream & os); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, char c); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, const char* c); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, unsigned char c); + template <> _UCXXEXPORT ostream & operator<<(ostream & out, unsigned const char* c); + +#endif +#endif + + +#ifndef __STRICT_ANSI__ + +//Support for output of long long data types + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, signed long long int i) +{ + typename basic_ostream<Ch, Tr>::sentry s(os); + __ostream_printout<Tr, Ch, signed long long int>::printout(os, i); + return os; +} + + +template<class Ch, class Tr> _UCXXEXPORT basic_ostream<Ch, Tr>& + operator<<(basic_ostream<Ch, Tr>& os, unsigned long long int i) +{ + typename basic_ostream<Ch, Tr>::sentry s(os); + __ostream_printout<Tr, Ch, unsigned long long int>::printout(os, i); + return os; +} + + +#endif //__STRICT_ANSI__ + + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/ostream_helpers b/i386/modules/uClibcxx/include/ostream_helpers new file mode 100644 index 0000000..7cdf0fa --- /dev/null +++ b/i386/modules/uClibcxx/include/ostream_helpers @@ -0,0 +1,487 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <cstddef> +#include <ios> +#include <cctype> +#include <cstdio> +#include <string> + +#ifndef __STD_HEADER_OSTREAM_HELPERS +#define __STD_HEADER_OSTREAM_HELPERS 1 + +namespace std{ + + /* We are making the following template class for serveral reasons. Firstly, + * we want to keep the main ostream code neat and tidy. Secondly, we want it + * to be easy to do partial specialization of the ostream code so that it can + * be expanded and put into the library. This will allow us to make application + * code smaller at the expense of increased library size. This is a fair + * trade-off when there are multiple applications being compiled. Also, this + * feature will be used optionally via configuration options. It will also + * allow us to keep the code bases in sync, dramatically simplifying the + * maintenance required. We specialized for char because wchar and others + * require different scanf functions + */ + + + + template <class traits, class charT, class dataType> class _UCXXEXPORT __ostream_printout{ + public: + static void printout(basic_ostream<charT,traits>& stream, const dataType n); + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const signed long int n) + { + char buffer[20]; + const char * c_ld = "%ld"; + const char * c_lo = "%lo"; + const char * c_lX = "%lX"; + const char * c_lx = "%lx"; + const char * c_hashlo = "%#lo"; + const char * c_hashlX = "%#lX"; + const char * c_hashlx = "%#lx"; + + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = c_ld; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = c_hashlo; + }else{ + formatString = c_lo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = c_hashlX; + }else{ + formatString = c_hashlx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = c_lX; + }else{ + formatString = c_lx; + } + } + } + + stream.write(buffer, snprintf(buffer, 20, formatString, n) ); + + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, unsigned long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const unsigned long int n) + { + char buffer[20]; + const char * c_lo = "%lo"; + const char * c_lu = "%lu"; + const char * c_lX = "%lX"; + const char * c_lx = "%lx"; + const char * c_hashlo = "%#lo"; + const char * c_hashlX = "%#lX"; + const char * c_hashlx = "%#lx"; + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = c_lu; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = c_hashlo; + }else{ + formatString = c_lo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = c_hashlX; + }else{ + formatString = c_hashlx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = c_lX; + }else{ + formatString = c_lx; + } + } + } + + stream.write(buffer, snprintf(buffer, 20, formatString, n)); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + +#ifndef __STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, signed long long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const signed long long int n) + { + char buffer[28]; + const char * lld = "%lld"; + const char * llo = "%llo"; + const char * llX = "%llX"; + const char * llx = "%llx"; + const char * hashllo = "%#llo"; + const char * hashllX = "%#llX"; + const char * hashllx = "%#llx"; + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = lld; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = hashllo; + }else{ + formatString = llo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = hashllX; + }else{ + formatString = hashllx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = llX; + }else{ + formatString = llx; + } + } + } + + stream.write(buffer, snprintf(buffer, 27, formatString, n) ); + + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, unsigned long long int>{ + public: + static void printout(basic_ostream<char, traits >& stream, const unsigned long long int n) + { + char buffer[28]; + const char * llo = "%llo"; + const char * llu = "%llu"; + const char * llX = "%llX"; + const char * llx = "%llx"; + const char * hashllo = "%#llo"; + const char * hashllX = "%#llX"; + const char * hashllx = "%#llx"; + const char * formatString=0; + + if( stream.flags() & ios_base::dec){ + formatString = llu; + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + formatString = hashllo; + }else{ + formatString = llo; + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + formatString = hashllX; + }else{ + formatString = hashllx; + } + }else{ + if(stream.flags() & ios_base::uppercase){ + formatString = llX; + }else{ + formatString = llx; + } + } + } + + stream.write(buffer, snprintf(buffer, 27, formatString, n) ); + + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + +#endif //__STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, double>{ + public: + static void printout(basic_ostream<char, traits >& stream, const double f) + { + char buffer[32]; + int length; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + length = snprintf(buffer, 32, "%*.*E", static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + }else{ + length = snprintf(buffer, 32, "%*.*e", static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + } + } else if(stream.flags() & ios_base::fixed){ + length = snprintf(buffer, 32, "%*.*f",static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + } else { + length = snprintf(buffer, 32, "%*.*g",static_cast<int>(stream.width()),static_cast<int>(stream.precision()), f); + } + stream.write(buffer, length); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, char, long double>{ + public: + static void printout(basic_ostream<char, traits >& stream, const long double f) + { + char buffer[32]; + int length; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + length = snprintf(buffer, 32, "%*.*LE", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + }else{ + length = snprintf(buffer, 32, "%*.*Le", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + } + } else if(stream.flags() & ios_base::fixed){ + length = snprintf(buffer, 32, "%*.*Lf", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + } else { + length = snprintf(buffer, 32, "%*.*Lg", static_cast<int>(stream.width()), static_cast<int>(stream.precision()), f); + } + stream.write(buffer, length); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + + } + }; + +#ifdef __UCLIBCXX_HAS_WCHAR__ + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const signed long int n) + { + wchar_t buffer[20]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 20, L"%ld", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%#lx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, unsigned long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const unsigned long int n) + { + wchar_t buffer[20]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 20, L"%lu", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%#lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%#lx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 20, L"%lX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 20, L"%lx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + +#ifndef __STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, signed long long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const signed long long int n) + { + wchar_t buffer[28]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 27, L"%lld", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%#llx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, unsigned long long int>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const unsigned long long int n) + { + wchar_t buffer[28]; + if( stream.flags() & ios_base::dec){ + stream.write(buffer, swprintf(buffer, 27, L"%llu", n)); + }else if( stream.flags() & ios_base::oct){ + if( stream.flags() & ios_base::showbase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llo", n)); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llo", n) ); + } + }else if (stream.flags() & ios_base::hex){ + if(stream.flags() & ios_base::showbase){ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%#llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%#llx", n) ); + } + }else{ + if(stream.flags() & ios_base::uppercase){ + stream.write(buffer, swprintf(buffer, 27, L"%llX", n) ); + }else{ + stream.write(buffer, swprintf(buffer, 27, L"%llx", n) ); + } + } + } + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + +#endif //__STRICT_ANSI__ + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, double>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const double f) + { + wchar_t buffer[32]; + wchar_t format_string[32]; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + swprintf(format_string, 32, L"%%%u.%uE", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + }else{ + swprintf(format_string, 32, L"%%%u.%ue", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + } else if(stream.flags() & ios_base::fixed){ + swprintf(format_string, 32, L"%%%u.%uf", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } else { + swprintf(format_string, 32, L"%%%u.%ug", static_cast<int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + stream.write(buffer, swprintf(buffer, 32, format_string, f) ); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + + template <class traits> class _UCXXEXPORT __ostream_printout<traits, wchar_t, long double>{ + public: + static void printout(basic_ostream<wchar_t, traits >& stream, const long double f) + { + wchar_t buffer[32]; + wchar_t format_string[32]; + if(stream.flags() & ios_base::scientific){ + if(stream.flags() & ios_base::uppercase){ + swprintf(format_string, 32, L"%%%u.%uLE", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + }else{ + swprintf(format_string, 32, L"%%%u.%uLe", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + } else if(stream.flags() & ios_base::fixed){ + swprintf(format_string, 32, L"%%%u.%uLf", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } else { + swprintf(format_string, 32, L"%%%u.%uLg", static_cast<unsigned int>(stream.width()), static_cast<unsigned int>(stream.precision())); + } + stream.write(buffer, swprintf(buffer, 32, format_string, f) ); + if(stream.flags() & ios_base::unitbuf){ + stream.flush(); + } + } + }; + +#endif //__UCLIBCXX_HAS_WCHAR__ + +} + +#endif + + + diff --git a/i386/modules/uClibcxx/include/queue b/i386/modules/uClibcxx/include/queue new file mode 100644 index 0000000..53b3931 --- /dev/null +++ b/i386/modules/uClibcxx/include/queue @@ -0,0 +1,122 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <deque> +#include <vector> +#include <functional> + +#ifndef __HEADER_STD_QUEUE +#define __HEADER_STD_QUEUE 1 + +namespace std{ + + template <class T, class Container = deque<T> > class _UCXXEXPORT queue{ + protected: + Container c; + public: + typedef typename Container::value_type value_type; + typedef typename Container::size_type size_type; + typedef Container container_type; + + explicit queue(const Container& a = Container()) : c(a) { } + + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + value_type& front() { return c.front(); } + const value_type& front() const { return c.front(); } + value_type& back() { return c.back(); } + const value_type& back() const { return c.back(); } + void push(const value_type& x) { c.push_back(x); } + void pop() { c.pop_front(); } + }; + + + template <class T, class Container> _UCXXEXPORT bool + operator==(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c == y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator< (const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c < y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator!=(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c != y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator> (const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c > y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator>=(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c >= y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator<=(const queue<T, Container>& x, const queue<T, Container>& y) + { + return (x.c <= y.c); + } + + + template <class T, + class Container = vector<T>, + class Compare = less<typename Container::value_type> + > class _UCXXEXPORT priority_queue { + protected: + Container c; + Compare comp; + public: + typedef typename Container::value_type value_type; + typedef typename Container::size_type size_type; + typedef Container container_type; + + explicit priority_queue(const Compare& x = Compare(), const Container& a = Container()) + : c(a), comp(x) { make_heap(c.begin(), c.end(), comp) ; } + template <class InputIterator> priority_queue(InputIterator first, + InputIterator last, + const Compare& x = Compare(), + const Container& y= Container()) + : c(y), comp(c) + { + c.insert(c.end(), first, last); + make_heap(c.begin(), c.end(), comp); + } + + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + const value_type& top() const { return c.front(); } + void push(const value_type& x){ + c.push_back(x); + push_heap(c.begin(), c.end(), comp); + } + void pop(){ + pop_heap(c.begin(), c.end(), comp); + c.pop_back(); + } + }; + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/set b/i386/modules/uClibcxx/include/set new file mode 100644 index 0000000..93d62b5 --- /dev/null +++ b/i386/modules/uClibcxx/include/set @@ -0,0 +1,403 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include <deque> +#include<functional> +#include <associative_base> + +#ifndef __STD_HEADER_SET +#define __STD_HEADER_SET + +namespace std{ + + +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class set; +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class multiset; + + +/* This is the implementation for the set container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + +//Implementation of set + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT set + : public __single_associative<Key, Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __single_associative<Key, Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + +// using base::value_compare; + + static const key_type v_t_k(const value_type v){ + return v; + } + + explicit set(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> set(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + set(const set<Key, Compare,Allocator>& x) : base(x) { } + ~set() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + +protected: + +}; + + +//Implementation of multiset + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT multiset + : public __multi_associative<Key, Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __multi_associative<Key, Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + static const key_type v_t_k(const value_type v){ + return v; + } + + explicit multiset(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al, v_t_k) { } + + template <class InputIterator> multiset(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(first, last, comp, al, v_t_k) { } + + + multiset(const multiset<Key, Compare, Allocator>& x) : base(x) { } + ~multiset() { } + + using base::operator=; + using base::operator==; + using base::operator!=; + + using base::insert; + using base::erase; + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + using base::find; + using base::count; + using base::lower_bound; + using base::upper_bound; + using base::equal_range; + + +protected: + +}; + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (set<Key,Compare,Allocator>& x, set<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + if(x.data == y.data){ + return true; + } + return false; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 != *first2 ){ + return true; + } + ++first1; + ++first2; + } + return first1!=last1 || first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/set.old b/i386/modules/uClibcxx/include/set.old new file mode 100644 index 0000000..b9c4481 --- /dev/null +++ b/i386/modules/uClibcxx/include/set.old @@ -0,0 +1,1535 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#include<memory> +#include<utility> +#include<iterator> +#include <deque> +#include<functional> + + +#ifndef __STD_HEADER_SET +#define __STD_HEADER_SET + +#pragma GCC visibility push(default) + +namespace std{ + + +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class __base_set; +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class set; +template<class Key, class Compare = less<Key>, class Allocator = allocator<Key> > class multiset; + +template<class Key, class Compare, class Allocator> class __set_iter; +template<class Key, class Compare, class Allocator> class __set_citer; + +template <class Key, class Compare, class Allocator> bool operator== + (const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y); + +template <class Key, class Compare, class Allocator> bool operator== + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y); + + + +/* The code for the set containers is split up into two classes. + * The first class, __base_set holds all of the data and does much of the iterator-based + * work. Then the classes set and multiset inherit from there. This was done to reduce + * the redundancy of code (And thus errors which might crop up), as well as possibly + * reducing the size of binaries if both set and multiset are used, along with the same + * template parameters. + */ + + + +//All base classes first (__base_set, iterators, value_compare) and it's associated code + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT __base_set{ + +protected: + friend class __set_iter<Key, Compare, Allocator>; + friend class __set_citer<Key, Compare, Allocator>; + friend bool operator==<>(const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y); + friend bool operator==<>(const multiset<Key, Compare, Allocator>& x, const multiset<Key, Compare, Allocator>& y); + +public: + typedef __base_set<Key, Compare, Allocator> set_type; + typedef Key key_type; + typedef Key value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef __set_iter<Key, Compare, Allocator> iterator; + typedef __set_citer<Key, Compare, Allocator> const_iterator; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename std::reverse_iterator<iterator> reverse_iterator; + typedef typename std::reverse_iterator<const_iterator> const_reverse_iterator; + + class value_compare; + + explicit __base_set(const Compare& comp = Compare(), const Allocator& al = Allocator()); + __base_set(const set_type& x); + ~__base_set(); + + iterator begin(); + const_iterator begin() const; + iterator end(); + const_iterator end() const; + reverse_iterator rbegin(); + const_reverse_iterator rbegin() const; + reverse_iterator rend(); + const_reverse_iterator rend() const; + + bool empty() const; + size_type size() const; + size_type max_size() const; + + void swap(set_type & x); + void clear(); + + key_compare key_comp() const; + +protected: + + deque<Key, allocator<Key> > data; + Compare c; + +}; + + + //Implementations + + template<class Key, class Compare, class Allocator> class _UCXXEXPORT __set_citer + : public std::iterator< + bidirectional_iterator_tag, + Key, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + protected: + typedef class __base_set<Key, Compare, Allocator> Set; + + friend class __base_set<Key, Compare, Allocator>; + friend class __base_set<Key, Compare, Allocator>::iterator; + + friend class set<Key, Compare, Allocator>; + friend class multiset<Key, Compare, Allocator>; + + typename Set::size_type element; + const Set * container; + public: + __set_citer() : element(0), container(0) { } + __set_citer(const typename Set::const_iterator & m) + : element(m.element), container(m.container) { } + __set_citer(typename Set::size_type e, const Set * const c) + : element(e), container(c) { } + ~__set_citer() { } + + typename Set::value_type operator*(){ + return container->data[element]; + } + const typename Set::value_type * operator->() const{ + return &(container->data[element]); + } + __set_citer & operator=(const typename Set::const_iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Set::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Set::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __set_citer & operator++(){ + ++element; + return *this; + } + __set_citer operator++(int){ + __set_citer temp(*this); + ++element; + return temp; + } + __set_citer & operator--(){ + --element; + return *this; + } + __set_citer operator--(int){ + __set_citer temp(*this); + --element; + return temp; + } + + }; + + template<class Key, class Compare, class Allocator> class _UCXXEXPORT __set_iter + : public std::iterator< + bidirectional_iterator_tag, + Key, + typename Allocator::difference_type, + typename Allocator::pointer, + typename Allocator::reference + > + { + protected: + typedef __base_set<Key, Compare, Allocator> Set; + + //FIXME - Find a way to use template parameters or something. This will do for now + friend class __base_set<Key, Compare, Allocator>; + friend class __base_set<Key, Compare, Allocator>::const_iterator; + + friend class set<Key, Compare, Allocator>; + friend class multiset<Key, Compare, Allocator>; + + typename Set::size_type element; + Set * container; + public: + __set_iter() : element(0), container(0) { } + __set_iter(const typename Set::iterator & m) + : element(m.element), container(m.container) { } + __set_iter(typename Set::size_type e, Set * c) + : element(e), container(c) { } + ~__set_iter() { } + + typename Set::value_type & operator*(){ + return container->data[element]; + } + const typename Set::value_type & operator*() const{ + return container->data[element]; + } + typename Set::value_type * operator->(){ + return &(container->data[element]); + } + __set_iter & operator=(const typename Set::iterator & m){ + element = m.element; + container = m.container; + return *this; + } + bool operator==(const typename Set::iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Set::iterator & m) const { + return (m.element != element || m.container != container); + } + bool operator==(const typename Set::const_iterator & m) const { + return (m.element == element && m.container == container); + } + bool operator!=(const typename Set::const_iterator & m) const { + return (m.element != element || m.container != container); + } + __set_iter & operator++(){ + ++element; + return *this; + } + __set_iter operator++(int){ + __set_iter temp(*this); + ++element; + return temp; + } + __set_iter & operator--(){ + --element; + return *this; + } + __set_iter operator--(int){ + __set_iter temp(*this); + --element; + return temp; + } + + //Conversion operator + operator typename Set::const_iterator () const + { + typename Set::const_iterator retval(element, container); +// return typename Set::const_iterator(element, container); + return retval; + } + }; + + + + //Compare the keys of the two items + template<class Key, class Compare, class Allocator> class _UCXXEXPORT + __base_set<Key, Compare, Allocator>::value_compare : public binary_function< + typename set<Key, Compare, Allocator>::value_type, + typename set<Key, Compare, Allocator>::value_type, + bool> + { + friend class __base_set<Key, Compare, Allocator>; + protected: + Compare comp; + value_compare(Compare c) : comp(c) { } + ~value_compare() { } + public: + bool operator()(const value_type& x, const value_type& y) const { + return comp(x, y); + } + }; + + template <class Key, class Compare, class Allocator> + __base_set<Key, Compare, Allocator>::__base_set(const Compare& comp, const Allocator&) + : data(), c(comp) + { + + } + + template <class Key, class Compare, class Allocator> + __base_set<Key, Compare, Allocator>::__base_set(const __base_set<Key, Compare, Allocator>& x) + : data(x.data), c(x.c) + { + + } + + template <class Key, class Compare, class Allocator> + __base_set<Key, Compare, Allocator>::~__base_set() + { + + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::iterator + __base_set<Key, Compare, Allocator>::begin() + { + return iterator(0, this); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_iterator + __base_set<Key, Compare, Allocator>::begin() const + { + return const_iterator(0, this); + + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::iterator + __base_set<Key, Compare, Allocator>::end() + { + return iterator(data.size(), this); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_iterator + __base_set<Key, Compare, Allocator>::end() const + { + return const_iterator(data.size(), this); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::reverse_iterator + __base_set<Key, Compare, Allocator>::rbegin() + { + return reverse_iterator(end()); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_reverse_iterator + __base_set<Key, Compare, Allocator>::rbegin() const + { + return const_reverse_iterator(end()); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::reverse_iterator + __base_set<Key, Compare, Allocator>::rend() + { + return reverse_iterator(begin()); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::const_reverse_iterator + __base_set<Key, Compare, Allocator>::rend() const + { + return const_reverse_iterator(begin()); + } + + template <class Key, class Compare, class Allocator> + bool __base_set<Key, Compare, Allocator>::empty() const + { + return (data.size() == 0); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::size_type + __base_set<Key, Compare, Allocator>::size() const + { + return data.size(); + } + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::size_type + __base_set<Key, Compare, Allocator>::max_size() const + { + return data.max_size(); + } + + + template <class Key, class Compare, class Allocator> + void __base_set<Key, Compare, Allocator>::swap(__base_set<Key, Compare, Allocator>& m) + { + Compare n = c; + c = m.c; + m.c = n; + + data.swap(m.data); + } + + + template <class Key, class Compare, class Allocator> + void __base_set<Key, Compare, Allocator>::clear() + { + data.clear(); + } + + + template <class Key, class Compare, class Allocator> + typename __base_set<Key, Compare, Allocator>::key_compare + __base_set<Key, Compare, Allocator>::key_comp() const + { + return c; + } + +// value_compare value_comp() const; + + + +/* This is the implementation for the set container. As noted above, it deviates + * from ISO spec by deriving from a base class in order to reduce code redundancy. + * More code could be reduced by convirting to virtual functions (thus allowing + * much of the erase and insert code to be duplicated), but that would deviate from + * the specifications too much to be worth the risk. + */ + + + + + +//Implementation of set + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT set + : public __base_set<Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_set<Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + using base::value_compare; + + explicit set(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> set(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + set(const set<Key, Compare,Allocator>& x) : base(x) { } + ~set() { } + + set<Key, Compare, Allocator>& operator=(const set<Key, Compare, Allocator>& x); + + pair<iterator, bool> insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + + template <class InputIterator> void insert(InputIterator first, InputIterator last); + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator lower_bound(const key_type& x); + const_iterator lower_bound(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + iterator ifind(const key_type& x); //Core find functionality + const_iterator ifind(const key_type& x) const; //Core find functionality + + using base::data; + using base::c; + +}; + + + template <class Key, class Compare, class Allocator> template <class InputIterator> + set<Key, Compare, Allocator>:: + set(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::ifind(const key_type &x) + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. Will not indicate if the + *insert should be performed before the first element + */ + + if(data.size() == 0){ + return end(); + } + + if(data.size() == 1){ + if( c(data[0], x) ){ + return end(); + } + return begin(); + } + + size_type low; + size_type high; + size_type i; + + low = 0; + high = data.size() - 1; + + //This algorithm assumes no duplicates in stored information + while(( high - low) > 1){ + i = low + ((high - low) /2); + if( c(x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[low], x) ){ // k >=high + i = high; + }else{ + i = low; + } + + return iterator(i, this); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::ifind(const key_type &x) const + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. Will not indicate if the + *insert should be performed before the first element + */ + + if(data.size() == 0){ + return end(); + } + + if(data.size() == 1){ + if( c(data[0], x) ){ + return end(); + } + return begin(); + } + + size_type low; + size_type high; + size_type i; + + low = 0; + high = data.size() - 1; + + //This algorithm assumes no duplicates in stored information + while(( high - low) > 1){ + i = low + ((high - low) /2); + if( c(x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[low], x) ){ // k >=high + i = high; + }else{ + i = low; + } + + return const_iterator(i, this); + } + + + template <class Key, class Compare, class Allocator> + set<Key, Compare, Allocator>::set<Key, Compare, Allocator>& + set<Key, Compare, Allocator>::operator=(const set<Key, Compare, Allocator>& x) + { + if( &x == this){ + return *this; + } + c = x.c; + data = x.data; + return *this; + } + + + template <class Key, class Compare, class Allocator> + pair<typename set<Key, Compare, Allocator>::iterator, bool> + set<Key, Compare, Allocator>::insert(const value_type& x) + { + pair<typename set<Key, Compare, Allocator>::iterator, bool> retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x, data[0]) ){ + data.push_front(x); + retval.first = begin(); + retval.second = true; + return retval; + } + + //Element to insert goes at the end + if( c(data[data.size() - 1], x) ){ + data.push_back(x); + retval.first = end(); + --retval.first; + retval.second = true; + return retval; + } + + retval.first = ifind(x); + + //No match - this should never happen + if(retval.first == end()){ + retval.second = false; + return retval; + } + + //If we have an exact match + if( !c( *(retval.first), x) && !c(x, *(retval.first) ) ){ + retval.second = false; + return retval; + } + + typename deque<Key, allocator<Key > >::iterator q(&data, retval.first.element); + data.insert(q, x); + + retval.first = ifind(x); //Need to refind because insert can move data around + retval.second = true; + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::insert(iterator position, const value_type& x) + { + //Just reusing code. It's hard to make improvements over existing algo. + insert(x); + return find(x); + } + + template <class Key, class Compare, class Allocator> + template <class InputIterator> void + set<Key, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + template <class Key, class Compare, class Allocator> void + set<Key, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<Key, allocator<Key> >::iterator pos(&data, position.element); + data.erase(pos); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::size_type + set<Key, Compare, Allocator>::erase(const key_type& x) + { + typename set<Key, Compare, Allocator>::iterator i = find(x); + if(i!=end()){ + erase(i); + return 1; + } + return 0; + } + + template <class Key, class Compare, class Allocator> + void set<Key, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<Key, allocator<Key> >::iterator f(&data, first.element); + typename deque<Key, allocator<Key> >::iterator l(&data, last.element); + data.erase(f, l); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>:: + find(const typename set<Key, Compare, Allocator>::key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = ifind(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( *retval, x) && !c(x, *retval )){ + return retval; + } + return end(); + + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + + const_iterator retval = ifind(x); + + if(retval == end()){ + return retval; + } + + //Make sure we have an exact match.... + if(!c( *retval, x) && !c(x, *retval )){ + return retval; + } + return end(); + + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::size_type + set<Key, Compare, Allocator>::count(const typename set<Key, Compare, Allocator>::key_type& x) const + { + if( find(x) == end()){ + return 0; + } + return 1; + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::lower_bound(const key_type& x) + { + return find(x); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::lower_bound(const key_type& x) const + { + return find(x); + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::iterator + set<Key, Compare, Allocator>::upper_bound(const key_type& x) + { + typename set<Key, Compare, Allocator>::iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename set<Key, Compare, Allocator>::const_iterator + set<Key, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename set<Key, Compare, Allocator>::const_iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + + template <class Key, class Compare, class Allocator> + pair< typename set<Key, Compare, Allocator>::iterator, + typename set<Key, Compare, Allocator>::iterator + > set<Key, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename set<Key, Compare, Allocator>::iterator, + typename set<Key, Compare, Allocator>::iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class Compare, class Allocator> + pair< typename set<Key, Compare, Allocator>::const_iterator, + typename set<Key, Compare, Allocator>::const_iterator + > set<Key, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename set<Key, Compare, Allocator>::const_iterator, + typename set<Key, Compare, Allocator>::const_iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class Compare, class Allocator> bool operator== + (const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y) + { + if(x.data == y.data){ + return true; + } + return false; + } + + + +//Implementation of multiset + + +template<class Key, class Compare, class Allocator> class _UCXXEXPORT multiset + : public __base_set<Key, Compare, Allocator> +{ + //Default value of allocator does not meet C++ standard specs, but it works for this library + //Deal with it +public: + + typedef __base_set<Key, Compare, Allocator> base; + typedef typename base::key_type key_type; + typedef typename base::value_type value_type; + typedef typename base::key_compare key_compare; + typedef typename base::allocator_type allocator_type; + typedef typename base::reference reference; + typedef typename base::const_reference const_reference; + typedef typename base::iterator iterator; + typedef typename base::const_iterator const_iterator; + typedef typename base::size_type size_type; + typedef typename base::difference_type difference_type; + typedef typename base::pointer pointer; + typedef typename base::const_pointer const_pointer; + typedef typename base::reverse_iterator reverse_iterator; + typedef typename base::const_reverse_iterator const_reverse_iterator; + + explicit multiset(const Compare& comp = Compare(), const Allocator& al = Allocator()) + : base(comp, al) { } + + template <class InputIterator> multiset(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); + + multiset(const multiset<Key, Compare, Allocator>& x) : base(x) { } + ~multiset() { } + + multiset<Key, Compare, Allocator>& operator=(const multiset<Key, Compare, Allocator>& x); + + iterator insert(const value_type& x); + iterator insert(iterator position, const value_type& x); + template <class InputIterator> void insert(InputIterator first, InputIterator last); + + void erase(iterator position); + size_type erase(const key_type& x); + void erase(iterator first, iterator last); + + using base::begin; + using base::end; + using base::rbegin; + using base::rend; + + using base::empty; + using base::size; + using base::max_size; + + iterator find(const key_type& x); + const_iterator find(const key_type& x) const; + size_type count(const key_type& x) const; + iterator lower_bound(const key_type& x); + const_iterator lower_bound(const key_type& x) const; + iterator upper_bound(const key_type& x); + const_iterator upper_bound(const key_type& x) const; + pair<iterator,iterator> equal_range(const key_type& x); + pair<const_iterator,const_iterator> equal_range(const key_type& x) const; + +protected: + friend class base::iterator; + friend class base::const_iterator; + + iterator ifind(const key_type& x); //Core find functionality + const_iterator ifind(const key_type& x) const; //Core find functionality + + using base::data; + using base::c; + +}; + + + + template <class Key, class Compare, class Allocator> template <class InputIterator> + multiset<Key, Compare, Allocator>:: + multiset(InputIterator first, InputIterator last, const Compare& comp, const Allocator& al) + : base(comp, al) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::ifind(const key_type &x) + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. end() for error. + */ + + if(data.size() == 0){ + return end(); + } + + //Before the first element + if( c(x, data[0]) ){ + return begin(); + } + + + //Element is larger than all known elemenst + if( c( data[data.size()-1], x) ){ + return end(); + } + + //Or if it is the last element + if( !c(x, data[size()-1]) ){ + return iterator(data.size()-1, this); + } + + size_type low; + size_type high; + size_type i=0; + + low = 0; + high = data.size() - 1; + + //This algorithm will accept duplicates in keys + + while( c(data[i+1], x) || c(x, data[i]) || !c(x, data[i+1]) ){ + i = low + ((high - low) /2); + if( c( x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[i], x) ){ // k >=high + ++i; + } + + return iterator(i, this); + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::ifind(const key_type &x) const + { + /* This function is not from the standard. It is an internal + * utility function which returns an iterator to either the + * first matching element, or to the element before which + * an insert should be performed. end() for error. + */ + + if(data.size() == 0){ + return end(); + } + + //Before the first element + if( c(x, data[0]) ){ + return begin(); + } + + + //Element is larger than all known elemenst + if( c( data[data.size()-1], x) ){ + return end(); + } + + //Or if it is the last element + if( !c(x, data[size()-1]) ){ + return const_iterator(data.size()-1, this); + } + + size_type low; + size_type high; + size_type i=0; + + low = 0; + high = data.size() - 1; + + //This algorithm will accept duplicates in keys + + while( c(data[i+1], x) || c(x, data[i]) || !c(x, data[i+1]) ){ + i = low + ((high - low) /2); + if( c( x, data[i]) ){ + high = i; + }else{ + low = i; + } + } + + if( c(data[i], x) ){ // k >=high + ++i; + } + + return const_iterator(i, this); + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::insert(const value_type &x) + { + iterator retval; + + //Either set is empty or element to insert goes at the begining + if(data.size() == 0 || c(x, data[0]) ){ + data.push_front(x); + return begin(); + } + + //Element to insert goes at the end + if( c(data[data.size() - 1], x) ){ + data.push_back(x); + return end(); + } + + retval = ifind(x); + + //No match - this should never happen + if(retval == end()){ + return retval; + } + + if( !c(x, *retval) ){ + ++retval; + } + + typename deque<Key, allocator<Key> >::iterator q(&data, retval.element); + data.insert(q, x); + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::insert(iterator position, const value_type& x) + { + + //Inserting at begining + if(position == begin() && !c(*position, x) ){ + data.push_front(x); + return position; + } + //Inserting at end + if(position == end() && !c(x, data[data.size() - 1]) ){ + data.push_back(x); + return position; + } + + //Inserting in middle + iterator temp = position; + --temp; + if( !c( *position, x) && !c(x, *temp) ){ + typename deque<Key, allocator<Key> >::iterator q(&data, position.element); + data.insert(q, x); + return position; + } + + return insert(x); + } + + template <class Key, class Compare, class Allocator> + template <class InputIterator> void + multiset<Key, Compare, Allocator>::insert(InputIterator first, InputIterator last) + { + while(first !=last){ + insert(*first); + ++first; + } + } + + + template <class Key, class Compare, class Allocator> void + multiset<Key, Compare, Allocator>::erase(iterator position) + { + //Create a deque iterator from position information and then + //Use built in erase feature because it is handy. + typename deque<Key, allocator<Key> >::iterator pos(&data, position.element); + data.erase(pos); + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::size_type + multiset<Key, Compare, Allocator>::erase(const key_type& x) + { + typename multiset<Key, Compare, Allocator>::iterator f = lower_bound(x); + typename multiset<Key, Compare, Allocator>::iterator l = upper_bound(x); + size_type t = l.element - f.element; + erase(f, l); + return t; + } + + + template <class Key, class Compare, class Allocator> + void multiset<Key, Compare, Allocator>::erase(iterator first, iterator last) + { + typename deque<Key, allocator<Key> >::iterator f(&data, first.element); + typename deque<Key, allocator<Key> >::iterator l(&data, last.element); + data.erase(f, l); + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::find(const key_type& x) + { + if(data.size() == 0){ + return end(); + } + + iterator retval = ifind(x); + + if( c(x, *retval) || c(*retval, x) ){ + return end(); + } + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::find(const key_type& x) const + { + if(data.size() == 0){ + return end(); + } + const_iterator retval = ifind(x); + + if( c(x, *retval) || c(*retval, x) ){ + return end(); + } + + return retval; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::size_type + multiset<Key, Compare, Allocator>:: + count(const typename multiset<Key, Compare, Allocator>::key_type& x) const + { + pair< typename multiset<Key, Compare, Allocator>::const_iterator, + typename multiset<Key, Compare, Allocator>::const_iterator + > temp = equal_range(x); + + return temp.second.element - temp.first.element; + } + + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::lower_bound(const key_type& x) + { + //FIXME - linear search - can we do any better? + typename multiset<Key, Compare, Allocator>::iterator i = find(x); + if(i == end()){ + return i; + } + while( i.element > 0 && !c( *i, x) && !c(x, *i) ){ + --i; + } + if( c(*i, x)){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::lower_bound(const key_type& x) const + { + //FIXME - linear search - can we do any better? + typename multiset<Key, Compare, Allocator>::const_iterator i = find(x); + if(i == end()){ + return i; + } + while( i.element >0 && !c( *i, x) && !c(x, *i) ){ + --i; + } + if( c( *i, x)){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::iterator + multiset<Key, Compare, Allocator>::upper_bound(const key_type& x) + { + typename multiset<Key, Compare, Allocator>::iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + template <class Key, class Compare, class Allocator> + typename multiset<Key, Compare, Allocator>::const_iterator + multiset<Key, Compare, Allocator>::upper_bound(const key_type& x) const + { + typename multiset<Key, Compare, Allocator>::const_iterator i = find(x); + if(i != end()){ + ++i; + } + return i; + } + + + template <class Key, class Compare, class Allocator> + pair< typename multiset<Key, Compare, Allocator>::iterator, + typename multiset<Key, Compare, Allocator>::iterator + > multiset<Key, Compare, Allocator>::equal_range(const key_type& x) + { + pair< typename multiset<Key, Compare, Allocator>::iterator, + typename multiset<Key, Compare, Allocator>::iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + template <class Key, class Compare, class Allocator> + pair< typename multiset<Key, Compare, Allocator>::const_iterator, + typename multiset<Key, Compare, Allocator>::const_iterator + > multiset<Key, Compare, Allocator>::equal_range(const key_type& x) const + { + pair< typename multiset<Key, Compare, Allocator>::const_iterator, + typename multiset<Key, Compare, Allocator>::const_iterator + > retval; + retval.first = lower_bound(x); + retval.second = upper_bound(x); + return retval; + } + + + + +/* Non-member functions. These are at the end because they are not associated with any + particular class. These will be implemented as I figure out exactly what all of + them are supposed to do, and I have time. + */ + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 != *first2 ){ + return true; + } + ++first1; + ++first2; + } + return first1!=last1 || first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const set<Key,Compare,Allocator>& x, const set<Key,Compare,Allocator>& y) + { + typename set<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename set<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename set<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename set<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (set<Key,Compare,Allocator>& x, set<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator== + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + if(x.data == y.data){ + return true; + } + return false; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator< + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1==last1 && first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator!= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 != *first2 ){ + return true; + } + ++first1; + ++first2; + } + return first1!=last1 || first2 != last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator> + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1 && first2 == last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator>= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 > *first2 ){ + return true; + } + if( *first2 > *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first1!=last1; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT bool operator<= + (const multiset<Key,Compare,Allocator>& x, const multiset<Key,Compare,Allocator>& y) + { + typename multiset<Key,Compare,Allocator>::const_iterator first1 = x.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator first2 = y.begin(); + typename multiset<Key,Compare,Allocator>::const_iterator last1 = x.end(); + typename multiset<Key,Compare,Allocator>::const_iterator last2 = y.end(); + + while(first1 != last1 && first2 != last2){ + if( *first1 < *first2 ){ + return true; + } + if( *first2 < *first1 ){ + return false; + } + ++first1; + ++first2; + } + return first2!=last2; + } + + template <class Key, class Compare, class Allocator> _UCXXEXPORT void swap + (multiset<Key,Compare,Allocator>& x, multiset<Key,Compare,Allocator>& y) + { + x.swap(y); + } + + + +} + +#pragma GCC visibility pop + +#endif + + diff --git a/i386/modules/uClibcxx/include/sstream b/i386/modules/uClibcxx/include/sstream new file mode 100644 index 0000000..5a3ca6e --- /dev/null +++ b/i386/modules/uClibcxx/include/sstream @@ -0,0 +1,380 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef HEADER_STD_SSTREAM +#define HEADER_STD_SSTREAM 1 + +#include <iosfwd> +#include <ios> +#include <istream> +#include <ostream> +#include <iostream> +#include <string> + +namespace std{ + + template <class charT, class traits, class Allocator> + class _UCXXEXPORT basic_stringbuf : public basic_streambuf<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef typename Allocator::size_type size_type; + + explicit _UCXXEXPORT basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out) + : data(), ielement(0), oelement(0) + { + basic_streambuf<charT,traits>::openedFor = which; + } + + explicit _UCXXEXPORT basic_stringbuf(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::in | ios_base::out) + : data(str), ielement(0), oelement(0) + { + if(which & ios_base::ate){ + oelement = data.length(); + } + basic_streambuf<charT,traits>::openedFor = which; + } + + virtual _UCXXEXPORT ~basic_stringbuf() { } + + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return data; + } + + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + data = s; + ielement = 0; + if(basic_streambuf<charT,traits>::openedFor & ios_base::ate){ + oelement = data.length(); + }else{ + oelement = 0; + } + } + + protected: + virtual _UCXXEXPORT int sync(){ + return 0; + } + virtual _UCXXEXPORT int_type underflow(){ + if(ielement >= data.length()){ + return traits::eof(); + } + return traits::to_int_type(data[ielement]); + } + + virtual _UCXXEXPORT int_type uflow(){ + int_type retval = underflow(); + if(retval != traits::eof()){ + ++ielement; + } + return retval; + } + + virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()){ + //Error possibilities + if(ielement == 0){ + return traits::eof(); + } + if(ielement > data.length()){ + ielement = data.length(); + return traits::eof(); + } + //eof passed in + if(traits::eq_int_type(c,traits::eof())==true){ + --ielement; + return traits::not_eof(c); + } + if(traits::eq(traits::to_char_type(c),data[ielement-1]) == true){ + --ielement; + return c; + } + if(basic_streambuf<charT,traits>::openedFor & ios_base::out){ + --ielement; + data[ielement] = c; + return c; + } + return traits::eof(); + } + + virtual _UCXXEXPORT int showmanyc(){ + return data.length() - ielement; + } + virtual _UCXXEXPORT streamsize xsgetn(char_type* c, streamsize n){ + streamsize i = 0; + while(ielement < data.length() && i < n ){ + c[i] = data[ielement]; + ++i; + ++ielement; + } + return i; + } + + virtual _UCXXEXPORT int_type overflow (int_type c = traits::eof()){ + //Nothing to do + if(traits::eq_int_type(c,traits::eof())){ + return traits::not_eof(c); + } + + //Actually add character, if possible + if(basic_streambuf<charT,traits>::openedFor & ios_base::out){ + if(oelement >= data.length()){ + data.push_back(c); + }else{ + data[oelement] = c; + } + ++oelement; + return c; + } + //Not possible + return traits::eof(); + } + + virtual _UCXXEXPORT basic_streambuf<charT,traits>* setbuf(charT*, streamsize){ + //This function does nothing + return this; + } + + virtual _UCXXEXPORT streamsize xsputn(const char_type* s, streamsize n){ + data.replace(oelement, n, s, n); + oelement += n; + return n; + } + + virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way, + ios_base::openmode which = ios_base::in | ios_base::out) + { + //Test for invalid option + if( (which & ios_base::in) && (which & ios_base::out) && (way == ios_base::cur)){ + return -1; + } + + //Calculate new location + size_type newpos = 0; + + if(way == ios_base::beg){ + newpos = off; + }else if(way == ios_base::cur){ + if(which & ios_base::out){ + newpos = data.length() + off; + } + if(which & ios_base::in){ + newpos = ielement + off; + } + + }else{ + newpos = data.length() + off; + } + + //Test for error conditions + if(newpos > data.length()){ + return -1; + } + + //Shuffle pointers + + if(which & ios_base::in){ + ielement = newpos; + } + if(which & ios_base::out){ + data.resize(newpos); + if(ielement > data.length()){ + ielement = data.length(); + } + } + + return newpos; + } + + virtual _UCXXEXPORT pos_type seekpos(pos_type sp, + ios_base::openmode which = ios_base::in | ios_base::out) + { + return seekoff(sp, ios_base::beg, which); + } + + basic_string<charT,traits,Allocator> data; + size_type ielement; + size_type oelement; + }; + + + template <class charT, class traits, class Allocator> class _UCXXEXPORT basic_istringstream + : public basic_istream<charT,traits> + { + public: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + + explicit _UCXXEXPORT basic_istringstream(ios_base::openmode m = ios_base::in) + : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb), sb(m) + { + } + explicit _UCXXEXPORT basic_istringstream( const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::in) + : basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb), sb(str, which) + { + } + virtual _UCXXEXPORT ~basic_istringstream() { } + _UCXXEXPORT basic_stringbuf<charT,traits,Allocator>* rdbuf() const{ + return &sb; + } + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return sb.str(); + } + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + sb.str(s); + basic_istream<charT,traits>::clear(); + } + private: + basic_stringbuf<charT,traits,Allocator> sb; + }; + + + template <class charT, class traits, class Allocator> class _UCXXEXPORT basic_ostringstream + : public basic_ostream<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + explicit _UCXXEXPORT basic_ostringstream(ios_base::openmode m = ios_base::out) + : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb), sb(m) + { + } + explicit _UCXXEXPORT basic_ostringstream(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::out) + : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb), sb(str, which) + { + } + virtual _UCXXEXPORT ~basic_ostringstream() { } + + _UCXXEXPORT basic_stringbuf<charT,traits,Allocator>* rdbuf() const{ + return &sb; + } + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return sb.str(); + } + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + sb.str(s); + basic_ostream<charT,traits>::clear(); + } + private: + basic_stringbuf<charT,traits,Allocator> sb; + }; + + + template <class charT, class traits, class Allocator> class _UCXXEXPORT basic_stringstream + : public basic_iostream<charT,traits> + { + public: + + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + + explicit _UCXXEXPORT basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in) + : basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb), sb(which) + { + } + + explicit _UCXXEXPORT basic_stringstream(const basic_string<charT,traits,Allocator>& str, + ios_base::openmode which = ios_base::out|ios_base::in) + : basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb), sb(str, which) + { + } + virtual _UCXXEXPORT ~basic_stringstream(){ } + + _UCXXEXPORT basic_stringbuf<charT,traits,Allocator>* rdbuf(){ + return &sb; + } + _UCXXEXPORT basic_string<charT,traits,Allocator> str() const{ + return sb.str(); + } + _UCXXEXPORT void str(const basic_string<charT,traits,Allocator>& s){ + sb.str(s); + basic_iostream<charT,traits>::clear(); + } + private: + basic_stringbuf<charT, traits> sb; + }; + +#ifdef __UCLIBCXX_EXPAND_SSTREAM_CHAR__ +#ifndef __UCLIBCXX_COMPILE_SSTREAM__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >:: + basic_stringbuf(ios_base::openmode which); + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::~basic_stringbuf(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_string<char, char_traits<char>, allocator<char> > + basic_stringbuf<char, char_traits<char>, allocator<char> >::str() const; + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type + basic_stringbuf<char, char_traits<char>, allocator<char> >:: + pbackfail(basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type c); + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::pos_type + basic_stringbuf<char, char_traits<char>, allocator<char> >:: + seekoff (basic_stringbuf<char, char_traits<char>, allocator<char> >::off_type off, + ios_base::seekdir way, + ios_base::openmode which + ); + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type + basic_stringbuf<char, char_traits<char>, allocator<char> >:: + overflow (basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type c); + + template <> _UCXXEXPORT basic_stringbuf<char, char_traits<char>, allocator<char> >::int_type + basic_stringbuf<char, char_traits<char>, allocator<char> >::underflow (); + + template <> _UCXXEXPORT streamsize basic_stringbuf<char, char_traits<char>, allocator<char> >:: + xsputn(const char* s, streamsize n); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT basic_stringstream<char, char_traits<char>, allocator<char> >:: + basic_stringstream(ios_base::openmode which); + template <> _UCXXEXPORT basic_stringstream<char, char_traits<char>, allocator<char> >::~basic_stringstream(); + template <> _UCXXEXPORT basic_istringstream<char, char_traits<char>, allocator<char> >::~basic_istringstream(); + template <> _UCXXEXPORT basic_ostringstream<char, char_traits<char>, allocator<char> >::~basic_ostringstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif +#endif + +} + + +#endif diff --git a/i386/modules/uClibcxx/include/stack b/i386/modules/uClibcxx/include/stack new file mode 100644 index 0000000..07bd19a --- /dev/null +++ b/i386/modules/uClibcxx/include/stack @@ -0,0 +1,80 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <deque> + +#ifndef __HEADER_STD_STACK +#define __HEADER_STD_STACK 1 + +namespace std{ + + template <class T, class Container = deque<T> > class _UCXXEXPORT stack{ + protected: + Container c; + + public: + typedef typename Container::value_type value_type; + typedef typename Container::size_type size_type; + typedef Container container_type; + + explicit stack(const Container& a = Container()) : c(a) { }; + bool empty() const { return c.empty(); } + size_type size() const { return c.size(); } + value_type& top() { return c.back(); } + const value_type& top() const { return c.back(); } + void push(const value_type& x) { c.push_back(x); } + void pop() { c.pop_back(); } + + bool operator==(const stack<T, Container> &x) const{ + return x.c == c; + } + + }; + + + template <class T, class Container> _UCXXEXPORT bool + operator< (const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c < y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator!=(const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c != y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator> (const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c > y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator>=(const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c >= y.c); + } + template <class T, class Container> _UCXXEXPORT bool + operator<=(const stack<T, Container>& x, const stack<T, Container>& y) + { + return (x.c <= y.c); + } + +} + +#endif + + diff --git a/i386/modules/uClibcxx/include/stdexcept b/i386/modules/uClibcxx/include/stdexcept new file mode 100644 index 0000000..ad28684 --- /dev/null +++ b/i386/modules/uClibcxx/include/stdexcept @@ -0,0 +1,113 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <exception> +#include <string> + +#ifndef HEADER_STD_EXCEPTIONS +#define HEADER_STD_EXCEPTIONS 1 + +//Don't include support if not needed +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + +//typedef basic_string<char> string; + +class _UCXXEXPORT logic_error : public exception { +protected: + string mstring; +public: + logic_error() throw(); + logic_error(const string& what_arg); + + virtual ~logic_error() throw() {} + virtual const char * what() const throw(); + +}; + +class _UCXXEXPORT domain_error : public logic_error { +public: + domain_error() : logic_error() {} + domain_error(const string& what_arg) : logic_error(what_arg) {} + virtual ~domain_error() throw() {} +}; + +class _UCXXEXPORT invalid_argument : public logic_error { +public: + invalid_argument() : logic_error(){} + invalid_argument(const string& what_arg) : logic_error(what_arg){} + virtual ~invalid_argument() throw() {} +}; + +class _UCXXEXPORT length_error : public logic_error { +public: + length_error() : logic_error(){} + length_error(const string& what_arg) : logic_error(what_arg){} + virtual ~length_error() throw() {} +}; + +class _UCXXEXPORT out_of_range : public logic_error{ +public: + out_of_range(); + out_of_range(const string & what_arg); + virtual ~out_of_range() throw() {} + +}; + +class _UCXXEXPORT runtime_error : public exception{ +protected: + string mstring; +public: + runtime_error(); + runtime_error(const string& what_arg); + + virtual ~runtime_error() throw() {} + virtual const char * what() const throw(); +}; + +class _UCXXEXPORT range_error : public runtime_error{ +public: + range_error() : runtime_error(){} + range_error(const string& what_arg) : runtime_error(what_arg) {} + virtual ~range_error() throw(){ } +}; + + +class _UCXXEXPORT overflow_error : public runtime_error{ +public: + overflow_error() : runtime_error(){} + overflow_error(const string& what_arg) : runtime_error(what_arg) {} + virtual ~overflow_error() throw(){} +}; + +class _UCXXEXPORT underflow_error : public runtime_error{ +public: + underflow_error() : runtime_error(){} + underflow_error(const string& what_arg) : runtime_error(what_arg) {} + virtual ~underflow_error() throw(){} +}; + + + +} + +#endif +#endif diff --git a/i386/modules/uClibcxx/include/streambuf b/i386/modules/uClibcxx/include/streambuf new file mode 100644 index 0000000..7bfc3ab --- /dev/null +++ b/i386/modules/uClibcxx/include/streambuf @@ -0,0 +1,325 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <locale> +#include <string> +#include <iosfwd> + +#ifndef HEADER_STD_STREAMBUF +#define HEADER_STD_STREAMBUF 1 + +#include <ios> + +namespace std{ + + template <class charT, class traits> class _UCXXEXPORT basic_streambuf{ + public: +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + friend ios_base::Init::Init(); +#endif + // Types: + typedef charT char_type; + typedef typename traits::int_type int_type; + typedef typename traits::pos_type pos_type; + typedef typename traits::off_type off_type; + typedef traits traits_type; + + virtual ~basic_streambuf(); + + locale pubimbue(const locale &loc); + + locale getloc() const{ + return myLocale; + } + + basic_streambuf<char_type,traits>* pubsetbuf(char_type* s, streamsize n){ + return setbuf(s,n); + } + pos_type pubseekoff(off_type off, + typename ios_base::seekdir way, + ios_base::openmode which = ios_base::in | + ios_base::out + ) + { + return seekoff(off,way,which); + } + pos_type pubseekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out){ + return seekpos(sp,which); + } + int pubsync(){ + return sync(); + } + + streamsize in_avail(); + + int_type snextc(); + + int_type sbumpc(); + + int_type sgetc(); + + streamsize sgetn(char_type* s, streamsize n){ + return xsgetn(s,n); + } + + int_type sputbackc(char_type c); + + int_type sungetc(); + + int_type sputc(char_type c); + + streamsize sputn(const char_type* s, streamsize n){ + if(openedFor & ios_base::app){ + seekoff(0, ios_base::end, ios_base::out); + } + return xsputn(s, n); + } + + protected: + locale myLocale; + //Pointers for the "get" buffers + charT * mgbeg; + charT * mgnext; + charT * mgend; + + //Pointers for the "put" buffers + charT * mpbeg; + charT * mpnext; + charT * mpend; + + //In the event of null buffers Lets us know what the buffer is opened for + ios_base::openmode openedFor; + + basic_streambuf(); + + basic_streambuf(const basic_streambuf<char, char_traits<char> > &) + : myLocale(), + mgbeg(0), mgnext(0), mgend(0), mpbeg(0), mpnext(0), mpend(0), + openedFor(0) + { } + basic_streambuf<char, char_traits<char> > & operator=(const basic_streambuf<char, char_traits<char> > &){ + return *this; + } + + char_type* eback() const{ + return mgbeg; + } + char_type* gptr() const{ + return mgnext; + } + char_type* egptr() const{ + return mgend; + } + void gbump(int n){ + mgnext+=n; + } + void setg(char_type* gbeg, char_type* gnext, char_type* gend){ + mgbeg = gbeg; + mgnext = gnext; + mgend = gend; + } + + char_type* pbase() const{ + return mpbeg; + } + char_type* pptr() const{ + return mpnext; + } + char_type* epptr() const{ + return mpend; + } + void pbump(int n){ + mpnext+=n; + } + void setp(char_type* pbeg, char_type* pend){ + mpbeg = pbeg; + mpnext = pbeg; + mpend = pend; + } + + virtual void imbue(const locale &loc){ + myLocale = loc; + } + + //Virtual functions which we will not implement + + virtual basic_streambuf<char_type,traits>* setbuf(char_type* , streamsize){ + return 0; + } + virtual pos_type seekoff(off_type , ios_base::seekdir, + ios_base::openmode = ios_base::in | ios_base::out) + { + return 0; + } + virtual pos_type seekpos(pos_type , ios_base::openmode = ios_base::in | ios_base::out){ + return 0; + } + virtual int sync(){ + return 0; + } + + virtual int showmanyc(){ + return 0; + } + virtual streamsize xsgetn(char_type* , streamsize ){ + return 0; + } + virtual int_type underflow(){ + return traits_type::eof(); + } + virtual int_type uflow(){ + int_type ret = underflow(); + if (!traits_type::eq_int_type(ret, traits_type::eof())) + gbump(1); + return ret; + } + + virtual int_type pbackfail(int_type c = traits::eof()){ + return c; + } + virtual streamsize xsputn(const char_type* c, streamsize n){ + //This function is designed to be replaced by subclasses + for(streamsize i = 0; i< n; ++i){ + if(sputc(c[i]) == traits::eof()){ + return i; + } + } + return n; + } + virtual int_type overflow (int_type c = traits::eof()){ + return c; + } + }; + + typedef basic_streambuf<char> streambuf; +#ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_streambuf<wchar_t> wstreambuf; +#endif + + +//Definitions put below to allow for easy expansion of code + + template <class C, class T> basic_streambuf<C, T>::~basic_streambuf(){ } + + template <class C, class T> locale basic_streambuf<C, T>::pubimbue(const locale &loc){ + locale temp = myLocale; + myLocale = loc; + return temp; + } + + template <class C, class T> streamsize basic_streambuf<C, T>::in_avail(){ + if(mgend !=0 && mgnext !=0){ + return mgend - mgnext; + } + return showmanyc(); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sbumpc(){ + if(mgbeg == 0 || mgnext == mgend){ + return uflow(); + } + int_type retval = T::to_int_type(*gptr()); + gbump(1); + return retval; + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::snextc(){ + if(sbumpc() == T::eof() ){ + return T::eof() ; + } + return sgetc(); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sgetc(){ + if(mgbeg == 0 || mgnext == mgend){ + return underflow(); + } + return T::to_int_type(*gptr()); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sputbackc(char_type c){ + if(mgbeg == 0 || mgnext == mgbeg || !T::eq(c, gptr()[-1] )){ + return pbackfail(T::to_int_type(c)); + } + gbump(-1); + return T::to_int_type(*gptr()); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sungetc(){ + if(mgbeg == 0 || mgnext == mgbeg){ + return ios_base::failbit; + } + gbump(-1); + return T::to_int_type(*gptr()); + } + + template <class C, class T> typename basic_streambuf<C, T>::int_type basic_streambuf<C, T>::sputc(char_type c){ + if(openedFor & ios_base::app){ + seekoff(0, ios_base::end, ios_base::out); + } + if(mpnext < mpend){ + *mpnext = c; + ++mpnext; + }else{ + return overflow( T::to_int_type(c) ); + } + return T::to_int_type(c); + } + + template <class C, class T> basic_streambuf<C, T>::basic_streambuf() + : myLocale(), + mgbeg(0), mgnext(0), mgend(0), mpbeg(0), mpnext(0), mpend(0), + openedFor(0) + { } + + + + + + +#ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STREAMBUF__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT streambuf::basic_streambuf(); + template <> _UCXXEXPORT streambuf::~basic_streambuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); + template <> _UCXXEXPORT streamsize streambuf::in_avail(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::snextc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sgetc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); + template <> _UCXXEXPORT streambuf::int_type streambuf::sungetc(); + template <> _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); + +#endif +#endif + + + + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/string b/i386/modules/uClibcxx/include/string new file mode 100644 index 0000000..bd349d7 --- /dev/null +++ b/i386/modules/uClibcxx/include/string @@ -0,0 +1,1038 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <char_traits> +#include <string.h> +#include <func_exception> +#include <memory> +#include <vector> + + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <cwchar> +#include <cwctype> +#endif + +#ifndef __HEADER_STD_STRING +#define __HEADER_STD_STRING 1 + +namespace std{ + + //Basic basic_string + + template<class Ch, class Tr = char_traits<Ch>, class A = allocator<Ch> > class basic_string; + + typedef basic_string<char> string; + #ifdef __UCLIBCXX_HAS_WCHAR__ + typedef basic_string<wchar_t> wstring; + #endif + + + +//template<class Ch, class Tr = char_traits<Ch>, class A = allocator<Ch> > class _UCXXEXPORT basic_string +template<class Ch, class Tr, class A> class basic_string + : public std::vector<Ch, A> +{ +public: + typedef Tr traits_type; + typedef typename Tr::char_type value_type; + typedef A allocator_type; + typedef typename A::size_type size_type; + typedef typename A::difference_type difference_type; + + typedef typename A::reference reference; + typedef typename A::const_reference const_reference; + typedef typename A::pointer pointer; + typedef typename A::const_pointer const_pointer; + + typedef typename vector<Ch, A>::iterator iterator; + typedef typename vector<Ch, A>::const_iterator const_iterator; + + typedef typename vector<Ch, A>::reverse_iterator reverse_iterator; + typedef typename vector<Ch, A>::const_reverse_iterator const_reverse_iterator; + + static const size_type npos = (size_type)-1; + + explicit _UCXXEXPORT basic_string(const A& al = A()) : vector<Ch, A>(al){ return; } + + _UCXXEXPORT basic_string(const basic_string& str, size_type pos = 0, size_type n = npos, const A& al = A()); //Below + + _UCXXEXPORT basic_string(const Ch* s, size_type n, const A& al = A()) + : vector<Ch, A>(al) + { + if(n == npos){ + __throw_out_of_range(); + } + if(s > 0){ + resize(n); + Tr::copy(vector<Ch, A>::data, s, vector<Ch, A>::elements); + } + } + + _UCXXEXPORT basic_string(const Ch* s, const A& al = A()); //Below + + _UCXXEXPORT basic_string(size_type n, Ch c, const A& al = A()) + : vector<Ch, A>(n, c, al) + { + } + + template<class InputIterator> _UCXXEXPORT basic_string(InputIterator begin, InputIterator end, const A& a = A()) + :vector<Ch, A>(begin, end) + { + + } + + _UCXXEXPORT ~basic_string() { + return; + } + + _UCXXEXPORT basic_string& operator=(const basic_string& str); //Below + + _UCXXEXPORT basic_string& operator=(const Ch* s){ + vector<Ch, A>::clear(); + if(s!=0){ + size_type len = Tr::length(s); + resize(len); + Tr::copy( vector<Ch, A>::data, s, len); + } + return *this; + } + + _UCXXEXPORT basic_string& operator=(Ch c){ + vector<Ch, A>::clear(); + vector<Ch, A>::push_back(c); + return *this; + } + + inline _UCXXEXPORT size_type length() const { return vector<Ch, A>::size(); } + + void _UCXXEXPORT resize(size_type n, Ch c = Ch()){ + vector<Ch, A>::resize(n, c); + } + + _UCXXEXPORT basic_string& operator+=(const basic_string& str){ + return append(str); + } + + _UCXXEXPORT basic_string& operator+=(const Ch * s){ + return append(s); + } + + _UCXXEXPORT basic_string& operator+=(Ch c){ + vector<Ch, A>::push_back(c); + return *this; + } + + _UCXXEXPORT basic_string& append(const basic_string& str){ + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + str.elements); + Tr::copy( vector<Ch, A>::data + temp, str.vector<Ch, A>::data, str.elements); + + return *this; + } + + _UCXXEXPORT basic_string& append(const basic_string& str, size_type pos, size_type n){ + if(pos > str.size()){ + __throw_out_of_range(); + } + + size_type rlen = str.elements - pos; + if(rlen > n){ + rlen = n; + } + if(vector<Ch, A>::elements > npos - rlen){ + __throw_length_error(); + } + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + rlen); + Tr::copy( vector<Ch, A>::data + temp, str.vector<Ch, A>::data + pos, rlen); + return *this; + } + + _UCXXEXPORT basic_string& append(const Ch* s, size_type n){ + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + n); + Tr::copy( vector<Ch, A>::data + temp, s, n); + return *this; + } + + _UCXXEXPORT basic_string& append(const Ch* s){ + size_type strLen = Tr::length(s); + size_t temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + strLen); + Tr::copy( vector<Ch, A>::data + temp, s, strLen); + return *this; + } + + _UCXXEXPORT basic_string& append(size_type n, Ch c){ + vector<Ch, A>::resize(vector<Ch, A>::elements + n, c); + return *this; + } + + _UCXXEXPORT basic_string& assign(const basic_string& str){ + operator=(str); + return *this; + } + + _UCXXEXPORT basic_string& assign(const basic_string& str, size_type pos, size_type n){ + if(pos > str.elements){ + __throw_out_of_range(); + } + size_type r = str.elements - pos; + if(r > n){ + r = n; + } + resize(r); + Tr::copy(vector<Ch, A>::data, str.vector<Ch, A>::data + pos, r); + return *this; + } + + _UCXXEXPORT basic_string& assign(const Ch* s, size_type n){ + resize(n); + Tr::copy(vector<Ch, A>::data, s, n); + return *this; + } + + _UCXXEXPORT basic_string& assign(const Ch* s){ + size_type len = Tr::length(s); + return assign(s, len); + } + + _UCXXEXPORT basic_string& assign(size_type n, Ch c){ + vector<Ch, A>::clear(); + vector<Ch, A>::resize(n, Ch() ); + return *this; + } + + template<class InputIterator> _UCXXEXPORT basic_string& assign(InputIterator first, InputIterator last){ + vector<Ch, A>::resize(0, Ch()); + while (first != last){ + append(*first); + ++first; + } + return *this; + } + + _UCXXEXPORT basic_string& insert(size_type pos1, const basic_string& str, size_type pos2=0, size_type n=npos){ + if(pos1 > vector<Ch, A>::elements || pos2 > str.elements){ + __throw_out_of_range(); + } + size_type r = str.elements - pos2; + if( r > n){ + r = n; + } + if(vector<Ch, A>::elements > npos - r){ + __throw_length_error(); + } + size_type temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + r); + Tr::move(vector<Ch, A>::data + pos1 + r, vector<Ch, A>::data + pos1, temp - pos1); + Tr::copy(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, r); + return *this; + } + + _UCXXEXPORT basic_string& insert(size_type pos, const Ch* s, size_type n){ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + if(vector<Ch, A>::elements > npos - n){ + __throw_length_error(); + } + size_type temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + n); + Tr::move(vector<Ch, A>::data + pos + n, vector<Ch, A>::data + pos, temp - pos); + Tr::copy(vector<Ch, A>::data + pos, s, n); + return *this; + } + + inline _UCXXEXPORT basic_string& insert(size_type pos, const Ch* s){ + size_type len = Tr::length(s); + return insert(pos, s, len); + } + + _UCXXEXPORT basic_string& insert(size_type pos, size_type n, Ch c){ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + if(vector<Ch, A>::elements > npos - n){ + __throw_length_error(); + } + size_type temp = vector<Ch, A>::elements; + resize(vector<Ch, A>::elements + n); + Tr::move(vector<Ch, A>::data + pos + n, vector<Ch, A>::data + pos, temp - pos); + Tr::assign(vector<Ch, A>::data + pos, n, c); + return *this; + } + +// iterator insert(iterator p, charT c = charT()); +// void insert(iterator p, size_type n, charT c); +// template<class InputIterator> void insert(iterator p, InputIterator first, InputIterator last); + + _UCXXEXPORT basic_string& erase(size_type pos = 0, size_type n = npos){ + size_type xlen = vector<Ch, A>::elements - pos; + + if(xlen > n){ + xlen = n; + } + size_type temp = vector<Ch, A>::elements; + + Tr::move(vector<Ch, A>::data + pos, vector<Ch, A>::data + pos + xlen, temp - pos - xlen); + resize(temp - xlen); + return *this; + } + + _UCXXEXPORT iterator erase(iterator position){ + if(position == vector<Ch, A>::end()){ + return position; + } + + ++position; + + iterator temp = position; + + while(position != vector<Ch, A>::end()){ + *(position-1) = *position; + ++position; + } + vector<Ch, A>::pop_back(); + return temp; + } + + _UCXXEXPORT iterator erase(iterator first, iterator last){ + size_t count = last - first; + + iterator temp = last; + + while(last != vector<Ch, A>::end()){ + *(last - count) = *last; + ++last; + } + + resize( vector<Ch, A>::elements-count); + + return temp; + } + + _UCXXEXPORT basic_string& + replace(size_type pos1, size_type n1, const basic_string& str, size_type pos2=0, size_type n2=npos) + { + if(pos1 > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + size_type xlen = vector<Ch, A>::elements - pos1; + if(xlen > n1){ + xlen = n1; + } + size_type rlen = str.elements - pos2; + if(rlen > n2){ + rlen = n2; + } + if((vector<Ch, A>::elements - xlen) >= (npos - rlen)){ + __throw_length_error(); + } + + size_t temp = vector<Ch, A>::elements; + + if(rlen > xlen){ //Only if making larger + resize(temp - xlen + rlen); + } + + //Final length = vector<Ch, A>::elements - xlen + rlen + //Initial block is of size pos1 + //Block 2 is of size len + + Tr::move(vector<Ch, A>::data + pos1 + rlen, vector<Ch, A>::data + pos1 + xlen, temp - pos1 - xlen); + Tr::copy(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, rlen); + resize(temp - xlen + rlen); + return *this; + } + + _UCXXEXPORT basic_string& replace(size_type pos, size_type n1, const Ch* s, size_type n2){ + return replace(pos,n1,basic_string<Ch,Tr,A>(s,n2)); + + } + + inline _UCXXEXPORT basic_string& replace(size_type pos, size_type n1, const Ch* s){ + return replace(pos,n1,basic_string<Ch,Tr,A>(s)); + } + + _UCXXEXPORT basic_string& replace(size_type pos, size_type n1, size_type n2, Ch c){ + return replace(pos,n1,basic_string<Ch, Tr, A>(n2,c)); + } +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, const basic_string& str); +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, const Ch* s, size_type n); +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, const Ch* s); +// _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, size_type n, Ch c); +/* template<class InputIterator> _UCXXEXPORT basic_string& replace(iterator i1, iterator i2, + InputIterator j1, InputIterator j2);*/ + + size_type _UCXXEXPORT copy(Ch* s, size_type n, size_type pos = 0) const{ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + size_type r = vector<Ch, A>::elements - pos; + if(r > n){ + r = n; + } + Tr::copy(s, vector<Ch, A>::data + pos, r); + return r; + } + + _UCXXEXPORT void swap(basic_string<Ch,Tr,A>& s){ + //Data pointers + + vector<Ch, A>::swap(s); + } + + _UCXXEXPORT const Ch* c_str() const{ + const_cast<basic_string<Ch,Tr,A> *>(this)->reserve(vector<Ch, A>::elements+1); + vector<Ch, A>::data[vector<Ch, A>::elements] = 0; //Add 0 at the end + return vector<Ch, A>::data; + } + + _UCXXEXPORT const Ch* data() const{ + return vector<Ch, A>::data; + } + _UCXXEXPORT allocator_type get_allocator() const{ + return vector<Ch, A>::a; + } + + _UCXXEXPORT size_type find (const basic_string& str, size_type pos = 0) const; //Below + + _UCXXEXPORT size_type find (const Ch* s, size_type pos, size_type n) const{ + return find(basic_string<Ch, Tr, A>(s,n), pos); + } + _UCXXEXPORT size_type find (const Ch* s, size_type pos = 0) const{ + return find(basic_string<Ch, Tr, A>(s), pos); + } + _UCXXEXPORT size_type find (Ch c, size_type pos = 0) const{ + for(size_type i = pos; i < length(); ++i){ + if(this->operator[](i) == c){ + return i; + } + } + return npos; + } + _UCXXEXPORT size_type rfind(const basic_string& str, size_type pos = npos) const{ + if(pos >= length()){ + pos = length(); + } + for(size_type i = pos; i > 0; --i){ + if(str == substr(i-1, str.length())){ + return i-1; + } + } + return npos; + } + _UCXXEXPORT size_type rfind(const Ch* s, size_type pos, size_type n) const{ + return rfind(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type rfind(const Ch* s, size_type pos = npos) const{ + return rfind(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type rfind(Ch c, size_type pos = npos) const{ + return rfind(basic_string<Ch, Tr, A>(1,c),pos); + } + + _UCXXEXPORT size_type find_first_of(const basic_string& str, size_type pos = 0) const{ + for(size_type i = pos; i < length(); ++i){ + for(size_type j = 0; j < str.length() ; ++j){ + if( Tr::eq(str[j], this->operator[](i)) ){ + return i; + } + } + } + return npos; + } + + _UCXXEXPORT size_type find_first_of(const Ch* s, size_type pos, size_type n) const{ + return find_first_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_first_of(const Ch* s, size_type pos = 0) const{ + return find_first_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_first_of(Ch c, size_type pos = 0) const{ + for(size_type i = pos; i< length(); ++i){ + if( Tr::eq(this->operator[](i), c) ){ + return i; + } + } + return npos; + } + + _UCXXEXPORT size_type find_last_of (const basic_string& str, size_type pos = npos) const{ + if(pos > length()){ + pos = length(); + } + for(size_type i = pos; i >0 ; --i){ + for(size_type j = 0 ; j < str.length(); ++j){ + if( Tr::eq(this->operator[](i-1), str[j]) ){ + return i-1; + } + } + } + return npos; + } + _UCXXEXPORT size_type find_last_of (const Ch* s, size_type pos, size_type n) const{ + return find_last_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_last_of (const Ch* s, size_type pos = npos) const{ + return find_last_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_last_of (Ch c, size_type pos = npos) const{ + if(pos > length()){ + pos = length(); + } + for(size_type i = pos; i >0 ; --i){ + if( Tr::eq(this->operator[](i-1), c) ){ + return i-1; + } + } + return npos; + } + + _UCXXEXPORT size_type find_first_not_of(const basic_string& str, size_type pos = 0) const{ + bool foundCharacter; + for(size_type i = pos; i < length(); ++i){ + foundCharacter = false; + for(size_type j = 0; j < str.length() ; ++j){ + if( Tr::eq(str[j], this->operator[](i)) ){ + foundCharacter = true; + } + } + if(foundCharacter == false){ + return i; + } + } + return npos; + } + + _UCXXEXPORT size_type find_first_not_of(const Ch* s, size_type pos, size_type n) const{ + return find_first_not_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_first_not_of(const Ch* s, size_type pos = 0) const{ + return find_first_not_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_first_not_of(Ch c, size_type pos = 0) const{ + for(size_type i = pos; i < length() ; ++i){ + if(this->operator[](i) != c){ + return i; + } + } + return npos; + } + _UCXXEXPORT size_type find_last_not_of (const basic_string& str, size_type pos = npos) const{ + size_type xpos(length() - 1); + if(xpos > pos){ + xpos = pos; + } + + while(xpos != npos && npos != str.find_first_of(at(xpos))){ + --xpos; + } + + return xpos; + } + + _UCXXEXPORT size_type find_last_not_of (const Ch* s, size_type pos, size_type n) const{ + return find_last_not_of(basic_string<Ch, Tr, A>(s,n),pos); + } + _UCXXEXPORT size_type find_last_not_of (const Ch* s, size_type pos = npos) const{ + return find_last_not_of(basic_string<Ch, Tr, A>(s),pos); + } + _UCXXEXPORT size_type find_last_not_of (Ch c, size_type pos = npos) const{ + size_type xpos(length() - 1); + if(xpos > pos){ + xpos = pos; + } + while(xpos != npos && Tr::eq(at(xpos), c)){ + --xpos; + } + return xpos; + + } + + _UCXXEXPORT basic_string substr(size_type pos = 0, size_type n = npos) const; + + _UCXXEXPORT int compare(const basic_string& str) const{ + size_type rlen = vector<Ch, A>::elements; + if(rlen > str.elements){ + rlen = str.elements; + } + int retval = Tr::compare(vector<Ch, A>::data, str.vector<Ch, A>::data, rlen); + if(retval == 0){ + if(vector<Ch, A>::elements < str.elements){ + retval = -1; + } + if(vector<Ch, A>::elements > str.elements){ + retval = 1; + } + } + return retval; + } + + _UCXXEXPORT int compare(size_type pos1, size_type n1, const basic_string& str, + size_type pos2=0, size_type n2=npos) const{ + size_type len1 = vector<Ch, A>::elements - pos1; + if(len1 > n1){ + len1 = n1; + } + size_type len2 = str.vector<Ch, A>::elements - pos2; + if(len2 > n2){ + len2 = n2; + } + size_type rlen = len1; + if(rlen > len2){ + rlen = len2; + } + int retval = Tr::compare(vector<Ch, A>::data + pos1, str.vector<Ch, A>::data + pos2, rlen); + if(retval == 0){ + if(len1 < len2){ + retval = -1; + } + if(len1 > len2){ + retval = 1; + } + } + return retval; + } + + _UCXXEXPORT int compare(const Ch* s) const{ + size_type slen = Tr::length(s); + size_type rlen = slen; + if(rlen > vector<Ch, A>::elements){ + rlen=vector<Ch, A>::elements; + } + int retval = Tr::compare(vector<Ch, A>::data, s, rlen); + if(retval==0){ + if(vector<Ch, A>::elements < slen){ + retval = -1; + } + if(vector<Ch, A>::elements > slen){ + retval = 1; + } + } + return retval; + } + + _UCXXEXPORT int compare(size_type pos1, size_type n1, const Ch* s, size_type n2 = npos) const{ + size_type len1 = vector<Ch, A>::elements - pos1; + if(len1 > n1){ + len1 = n1; + } + size_type slen = Tr::length(s); + size_type len2 = slen; + if(len2 > n2){ + len2 = n2; + } + size_type rlen = len1; + if(rlen > len2){ + rlen = len2; + } + int retval = Tr::compare(vector<Ch, A>::data + pos1, s, rlen); + if(retval == 0){ + if(len1 < len2){ + retval = -1; + } + if(len1 > len2){ + retval = 1; + } + } + return retval; + } + +}; + + +//Functions + +template<class Ch,class Tr,class A> _UCXXEXPORT basic_string<Ch,Tr,A>::basic_string(const Ch* s, const A& al) + : vector<Ch, A>(al) +{ + if(s!=0){ + size_type temp = Tr::length(s); + append(s, temp); + } +} + +template<class Ch,class Tr,class A> _UCXXEXPORT basic_string<Ch,Tr,A>:: + basic_string(const basic_string& str, size_type pos, size_type n, const A& al) + : vector<Ch, A>(al) +{ + if(pos>str.size()){ + __throw_out_of_range(); + } + size_type rlen = str.size() - pos; + if( rlen > n){ + rlen = n; + } + resize(rlen); + Tr::copy(vector<Ch, A>::data, str.vector<Ch, A>::data + pos, vector<Ch, A>::elements); +} + +template<class Ch,class Tr,class A> _UCXXEXPORT basic_string<Ch,Tr,A>& + basic_string<Ch,Tr,A>::operator=(const basic_string<Ch,Tr,A> & str) +{ + if(&str == this){ //Check if we are doing a=a + return *this; + } + vector<Ch, A>::clear(); + resize(str.elements); + Tr::copy( vector<Ch, A>::data, str.vector<Ch, A>::data, str.elements); + return *this; +} + + +template<class Ch,class Tr,class A> _UCXXEXPORT typename basic_string<Ch,Tr,A>::size_type + basic_string<Ch,Tr,A>::find (const basic_string<Ch,Tr,A>& str, size_type pos) const +{ + if(str.length() > length()){ + return npos; + } + size_type max_string_start = 1 + length() - str.length(); + for(size_type i = pos; i < max_string_start; ++i){ + if(str == substr(i, str.length())){ + return i; + } + } + return npos; +} + + +template<class Ch,class Tr,class A> + _UCXXEXPORT basic_string<Ch, Tr, A> basic_string<Ch,Tr,A>::substr(size_type pos, size_type n) const +{ + if(pos > vector<Ch, A>::elements){ + __throw_out_of_range(); + } + size_type rlen = vector<Ch, A>::elements - pos; + if(rlen > n){ + rlen = n; + } + return basic_string<Ch,Tr,A>(vector<Ch, A>::data + pos,rlen); +} + + + + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STRING__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template <> _UCXXEXPORT string::basic_string(const allocator<char> &); + template <> _UCXXEXPORT string::basic_string(size_type n, char c, const allocator<char> & ); + template <> _UCXXEXPORT string::basic_string(const char* s, const allocator<char>& al); + template <> _UCXXEXPORT string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator<char>& al); + template <> _UCXXEXPORT string::~basic_string(); + +#endif + + template <> _UCXXEXPORT string & string::append(const char * s, size_type n); + + + template <> _UCXXEXPORT string::size_type string::find(const string & str, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find(const char* s, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find (char c, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::rfind(const string & str, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::rfind(char c, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::rfind(const char* s, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::find_first_of(const string &, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_of(const char *, size_type pos, size_type n) const; + template <> _UCXXEXPORT string::size_type string::find_first_of(const char*, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find_first_of(char c, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::find_last_of (const string & , size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos, size_type n) const; + template <> _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos) const; + template <> _UCXXEXPORT string::size_type string::find_last_of (char c, size_type pos) const; + + template <> _UCXXEXPORT string::size_type string::find_first_not_of(const string &, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type) const; + template <> _UCXXEXPORT string::size_type string::find_first_not_of(char c, size_type) const; + + template <> _UCXXEXPORT int string::compare(const string & str) const; + template <> _UCXXEXPORT int string::compare( + size_type pos1, size_type n1, const string & str, size_type pos2, size_type n2) const; + + template <> _UCXXEXPORT string string::substr(size_type pos, size_type n) const; + + template <> _UCXXEXPORT string & string::operator=(const string & str); + template <> _UCXXEXPORT string & string::operator=(const char * s); + +#endif +#endif + + + + +//typedef basic_string<char> string; + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp.append(rhs); + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp.append(rhs); + return temp; +} + + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(1, lhs); + temp.append(rhs); + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp.append(rhs); + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_string<charT,traits,Allocator> + operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + temp+=rhs; + return temp; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator==(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) == 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator==(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(rhs.compare(lhs) == 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator==(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + if(lhs.compare(rhs)==0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator!=(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) !=0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator!=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + return (temp != rhs); +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator!=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + return (lhs != temp); +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator< (const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) < 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator< (const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(rhs) < 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator< (const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) < 0){ + return true; + } + return false; +} + + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator> (const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) > 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator> (const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(rhs) > 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator> (const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) > 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator<=(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) <=0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator<=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(temp) <=0 ){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator<=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) <= 0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator>=(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + if(lhs.compare(rhs) >=0){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator>=(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs) +{ + basic_string<charT,traits,Allocator> temp(rhs); + if(lhs.compare(temp) >=0 ){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT bool + operator>=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs) +{ + basic_string<charT,traits,Allocator> temp(lhs); + if(temp.compare(rhs) >=0 ){ + return true; + } + return false; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT void + swap(basic_string<charT,traits,Allocator>& lhs, basic_string<charT,traits,Allocator>& rhs) +{ + lhs.swap(rhs); +} + +/*template<class charT, class traits, class Allocator> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const basic_string<charT,traits,Allocator>& str) +{ + return os.write(str.data(), str.length()); +}*/ + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STRING__ + +//Operators we can avoid duplication of + +template <> _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); +template <> _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); +template <> _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); + +template <> _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); +template <> _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); +template <> _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); + +template <> _UCXXEXPORT string operator+(const string & lhs, const char* rhs); +template <> _UCXXEXPORT string operator+(const char* lhs, const string & rhs); +template <> _UCXXEXPORT string operator+(const string & lhs, const string & rhs); + +template <> _UCXXEXPORT bool operator> (const string & lhs, const string & rhs); +template <> _UCXXEXPORT bool operator< (const string & lhs, const string & rhs); + + +#endif +#endif + + +} + +#endif diff --git a/i386/modules/uClibcxx/include/string_iostream b/i386/modules/uClibcxx/include/string_iostream new file mode 100644 index 0000000..d50333c --- /dev/null +++ b/i386/modules/uClibcxx/include/string_iostream @@ -0,0 +1,142 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <istream> +#include <ostream> +#include <string> + +#ifdef __UCLIBCXX_HAS_WCHAR__ +#include <cwchar> +#include <cwctype> +#endif + +#ifndef __HEADER_STD_STRING_IOSTREAM +#define __HEADER_STD_STRING_IOSTREAM 1 + +namespace std{ + + + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_ostream<charT, traits>& + operator<<(basic_ostream<charT, traits>& os, const basic_string<charT,traits,Allocator>& str) +{ + return os.write(str.data(), str.length()); +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& + operator>>(basic_istream<charT,traits>& is, basic_string<charT,traits,Allocator>& str) +{ + + typename basic_istream<charT, traits>::sentry s(is); + if(s == false){ + return is; + } + + str.clear(); + + typename basic_istream<charT, traits>::int_type c; + typename Allocator::size_type n = is.width(); + bool exitnow = false; + if(n == 0){ + n = str.max_size(); + } + +// //Clear out preliminary spaces first +// c = is.get(); +// while(isspace(c)){ +// c = is.get(); +// } +// +// is.putback(c); + + do{ + c = is.get(); + if(c == traits::eof() || isspace(c) || n == 0){ + is.putback(c); + exitnow = true; + }else{ + str.append(1, traits::to_char_type(c) ); + --n; + } + }while(exitnow == false); + return is; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& + getline(basic_istream<charT,traits>& is, basic_string<charT,traits,Allocator>& str, charT delim) +{ + typename basic_istream<charT,traits>::sentry s(is); + if(s == false){ + return is; + } + + str.erase(); + + streamsize i = 0; + typename basic_istream<charT,traits>::int_type c_i; + charT c; + unsigned int n = str.max_size(); + for(i=0;i<n;++i){ + c_i=is.get(); + if(c_i == traits::eof() ){ + return is; + } + c = traits::to_char_type(c_i); + if(c == delim){ + return is; + } + str.append(1, c); + } + return is; +} + +template<class charT, class traits, class Allocator> _UCXXEXPORT basic_istream<charT,traits>& + getline(basic_istream<charT,traits>& is, basic_string<charT,traits,Allocator>& str) +{ + return getline(is, str, '\n'); +} + + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ +#ifndef __UCLIBCXX_COMPILE_STRING__ + + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ +template<> _UCXXEXPORT basic_istream<char, char_traits<char> >& operator>>( + basic_istream<char,char_traits<char> >& is, + basic_string<char, char_traits<char>, allocator<char> >& str); +#endif + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +template<> _UCXXEXPORT basic_ostream<char, char_traits<char> >& + operator<<(basic_ostream<char, char_traits<char> >& os, + const basic_string<char,char_traits<char>, std::allocator<char> >& str); + +#endif + + +#endif +#endif + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/support b/i386/modules/uClibcxx/include/support new file mode 100644 index 0000000..ed0c7ca --- /dev/null +++ b/i386/modules/uClibcxx/include/support @@ -0,0 +1,167 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <cstdlib> +#include <typeinfo> + +#ifndef HEADER_ULC_SUPPORT +#define HEADER_ULC_SUPPORT 1 + +using namespace std; + +//From C++ ABI spec +typedef enum { + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 +} _Unwind_Reason_Code; + + +typedef void (*_Unwind_Exception_Cleanup_Fn) + (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc); + +//The following definitions were grabbed from the gcc implementation +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); +typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); +typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); +typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, struct _Unwind_Exception *); + +typedef int _Unwind_Action; +static const _Unwind_Action _UA_SEARCH_PHASE = 1; +static const _Unwind_Action _UA_CLEANUP_PHASE = 2; +static const _Unwind_Action _UA_HANDLER_FRAME = 4; +static const _Unwind_Action _UA_FORCE_UNWIND = 8; + +const _Unwind_Exception_Class __uclibcxx_exception_class = (((((((( + _Unwind_Exception_Class) 'u' << 8 | (_Unwind_Exception_Class) 'l') << 8 + | (_Unwind_Exception_Class) 'i') << 8 | (_Unwind_Exception_Class) 'b') << 8 + | (_Unwind_Exception_Class) 'C')<< 8 | (_Unwind_Exception_Class) '+') << 8 + | (_Unwind_Exception_Class) '+') << 8 | (_Unwind_Exception_Class) '\0'); + + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 + +struct _Unwind_Exception{ + _Unwind_Exception_Class exception_class; //Type of exception, eg ulibC++\0 + _Unwind_Exception_Cleanup_Fn exception_cleanup; //Destructor if from diff runtime + _Unwind_Word private_1; //Don't touch at all! + _Unwind_Word private_2; //Don't touch at all! +} __attribute__((__aligned__)); + + +//The following structure is system-dependent and defined by the compiler +//Thus it's definition was copied from the gcc 3.4.0 header files +struct _Unwind_Context; +//{ +// void *reg[DWARF_FRAME_REGISTERS+1]; +// void *cfa; +// void *ra; +// void *lsda; +// struct dwarf_eh_bases bases; +// _Unwind_Word args_size; +//}; + + + +_Unwind_Reason_Code _Unwind_RaiseException ( struct _Unwind_Exception *exception_object ); + +//_Unwind_ForcedUnwind + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int version, _Unwind_Action actions, _Unwind_Exception_Class exceptionClass, + struct _Unwind_Exception *exceptionObject, + struct _Unwind_Context *context, void *stop_parameter ); + +_Unwind_Reason_Code _Unwind_ForcedUnwind ( + struct _Unwind_Exception *exception_object, _Unwind_Stop_Fn stop, + void *stop_parameter ); + +void _Unwind_Resume (struct _Unwind_Exception *exception_object); +void _Unwind_DeleteException (struct _Unwind_Exception *exception_object); + +_Unwind_Word _Unwind_GetGR (struct _Unwind_Context *context, int index); +void _Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word); + +_Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *context); +void _Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr new_value); + +_Unwind_Ptr _Unwind_GetLanguageSpecificData (struct _Unwind_Context *context); +_Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *context); + +_Unwind_Reason_Code (*__personality_routine) + (int version, //Should be 1 + _Unwind_Action actions, //Actions the routine will perform (bitmask) + _Unwind_Exception_Class exceptionClass, //Type of exception - vendor is high 4 bytes + struct _Unwind_Exception *exceptionObject, //Points to exception header + struct _Unwind_Context *context); //Unwinder state information + + +/*The following part is the Level II ABI which is required for compatability*/ +//This might be the only stuff that *I* need to implement + +struct __cxa_exception { + std::type_info *exceptionType; //Type of thrown exception + void (*exceptionDestructor) (void *); //Pointer to the destructor + unexpected_handler unexpectedHandler; //Unexpected handler to use + terminate_handler terminateHandler; //Terminate handle to use + __cxa_exception *nextException; //per thread linked list + + int handlerCount; //How many handlers have caught this + int handlerSwitchValue; + const char *actionRecord; + const char *languageSpecificData; + void *catchTemp; + void *adjustedPtr; + + _Unwind_Exception unwindHeader; +}; + +struct __cxa_eh_globals { + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; + +extern "C" __cxa_eh_globals *__cxa_get_globals(void); //Return ptr to the eh_globals object for current thread +extern "C" __cxa_eh_globals *__cxa_get_globals_fast(void); //Same as above, assumes that above called at least once + +extern "C" void *__cxa_allocate_exception(size_t thrown_size); //Allocate space for exception plus header +extern "C" void __cxa_free_exception(void *thrown_exception); //Free space allocated from the above + +extern "C" void __cxa_throw (void *thrown_exception, //This is the actual throw call +// std::type_info *tinfo, //Type of object + void * tinfo, //Type of object + void (*dest) (void *) ); //Pointer to destructor destroy object + + +#endif + + + diff --git a/i386/modules/uClibcxx/include/system_configuration.h b/i386/modules/uClibcxx/include/system_configuration.h new file mode 100644 index 0000000..c13bc4d --- /dev/null +++ b/i386/modules/uClibcxx/include/system_configuration.h @@ -0,0 +1,59 @@ +/* + * Automatically generated C config: don't edit + */ +/* + * Version Number + */ +#define __UCLIBCXX_MAJOR__ 0 +#define __UCLIBCXX_MINOR__ 2 +#define __UCLIBCXX_SUBLEVEL__ 2 + +/* + * Target Features and Options + */ +#define __UCLIBCXX_HAS_FLOATS__ 1 +#undef __UCLIBCXX_HAS_LONG_DOUBLE__ +#undef __UCLIBCXX_HAS_TLS__ +#define __WARNINGS__ "-Wall" +#define __BUILD_EXTRA_LIBRARIES__ "" +#define __HAVE_DOT_CONFIG__ 1 + +/* + * String and I/O Stream Support + */ +#undef __UCLIBCXX_HAS_WCHAR__ +#define __UCLIBCXX_IOSTREAM_BUFSIZE__ 32 +#define __UCLIBCXX_HAS_LFS__ 1 +#define __UCLIBCXX_SUPPORT_CDIR__ 0 +#define __UCLIBCXX_SUPPORT_CIN__ 0 +#define __UCLIBCXX_SUPPORT_COUT__ 0 +#define __UCLIBCXX_SUPPORT_CERR__ 0 +#undef __UCLIBCXX_SUPPORT_CLOG__ + +/* + * STL and Code Expansion + */ +#define __UCLIBCXX_STL_BUFFER_SIZE__ 32 +#define __UCLIBCXX_CODE_EXPANSION__ 1 +#undef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ +#define __UCLIBCXX_EXPAND_STRING_CHAR__ 1 +#define __UCLIBCXX_EXPAND_VECTOR_BASIC__ 1 +#define __UCLIBCXX_EXPAND_IOS_CHAR__ 1 +#define __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ 1 +#define __UCLIBCXX_EXPAND_ISTREAM_CHAR__ 1 +#define __UCLIBCXX_EXPAND_OSTREAM_CHAR__ 1 +#define __UCLIBCXX_EXPAND_FSTREAM_CHAR__ 1 +#define __UCLIBCXX_EXPAND_SSTREAM_CHAR__ 1 + +/* + * Library Installation Options + */ +#define __UCLIBCXX_RUNTIME_PREFIX__ "." +#define __UCLIBCXX_RUNTIME_INCLUDE_SUBDIR__ "/include" +#define __UCLIBCXX_RUNTIME_LIB_SUBDIR__ "/lib" +#define __UCLIBCXX_RUNTIME_BIN_SUBDIR__ "/bin" +#undef __UCLIBCXX_EXCEPTION_SUPPORT__ +#define __BUILD_STATIC_LIB__ 1 +#define __BUILD_ONLY_STATIC_LIB__ 1 +#undef __DODEBUG__ + diff --git a/i386/modules/uClibcxx/include/type_traits b/i386/modules/uClibcxx/include/type_traits new file mode 100644 index 0000000..9c9b1d4 --- /dev/null +++ b/i386/modules/uClibcxx/include/type_traits @@ -0,0 +1,88 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> +#include <string.h> +#include <exception> +#include <memory> +#include <char_traits> + +#ifndef __HEADER_TYPE_TRAITS +#define __HEADER_TYPE_TRAITS 1 + +namespace std{ + + struct _UCXXEXPORT __true_type{}; + struct _UCXXEXPORT __false_type{}; + + template <class I> class _UCXXEXPORT __is_integer{ + public: + typedef __false_type value; + }; + + template <> class _UCXXEXPORT __is_integer <unsigned int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <signed int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <short unsigned int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <short signed int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <char>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <signed char>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <unsigned char>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <long unsigned int>{ + public: + typedef __true_type value; + }; + + template <> class _UCXXEXPORT __is_integer <long signed int>{ + public: + typedef __true_type value; + }; + + + +} + +#endif + diff --git a/i386/modules/uClibcxx/include/typeinfo b/i386/modules/uClibcxx/include/typeinfo new file mode 100644 index 0000000..88a2639 --- /dev/null +++ b/i386/modules/uClibcxx/include/typeinfo @@ -0,0 +1,156 @@ +// RTTI support for -*- C++ -*- +// Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 +// Free Software Foundation +// +// This file is part of GNU CC. +// +// GNU CC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GNU CC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GNU CC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +/** @file typeinfo + * This header provides RTTI support. + */ + +#ifndef __TYPEINFO__ +#define __TYPEINFO__ + +#include <exception> + +extern "C++" { + +namespace __cxxabiv1 +{ + class __class_type_info; +} // namespace __cxxabiv1 + +#if !__GXX_WEAK__ + // If weak symbols are not supported, typeinfo names are not merged. + #define __GXX_MERGED_TYPEINFO_NAMES 0 +#else + // On platforms that support weak symbols, typeinfo names are merged. + #define __GXX_MERGED_TYPEINFO_NAMES 1 +#endif + +namespace std +{ + /** + * @brief Part of RTTI. + * + * The @c type_info class describes type information generated by + * an implementation. + */ + class type_info + { + public: + /** Destructor. Being the first non-inline virtual function, this + * controls in which translation unit the vtable is emitted. The + * compiler makes use of that information to know where to emit + * the runtime-mandated type_info structures in the new-abi. */ + virtual ~type_info(); + + private: + /// Assigning type_info is not supported. Made private. + type_info& operator=(const type_info&); + type_info(const type_info&); + + protected: + const char *__name; + + protected: + explicit type_info(const char *__n): __name(__n) { } + + public: + // the public interface + /** Returns an @e implementation-defined byte string; this is not + * portable between compilers! */ + const char* name() const + { return __name; } + +#if !__GXX_MERGED_TYPEINFO_NAMES + bool before(const type_info& __arg) const; + // In old abi, or when weak symbols are not supported, there can + // be multiple instances of a type_info object for one + // type. Uniqueness must use the _name value, not object address. + bool operator==(const type_info& __arg) const; +#else + /** Returns true if @c *this precedes @c __arg in the implementation's + * collation order. */ + // In new abi we can rely on type_info's NTBS being unique, + // and therefore address comparisons are sufficient. + bool before(const type_info& __arg) const + { return __name < __arg.__name; } + bool operator==(const type_info& __arg) const + { return __name == __arg.__name; } +#endif + bool operator!=(const type_info& __arg) const + { return !operator==(__arg); } + + // the internal interface + public: + // return true if this is a pointer type of some kind + virtual bool __is_pointer_p() const; + // return true if this is a function type + virtual bool __is_function_p() const; + + // Try and catch a thrown type. Store an adjusted pointer to the + // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then + // THR_OBJ points to the thrown object. If THR_TYPE is a pointer + // type, then THR_OBJ is the pointer itself. OUTER indicates the + // number of outer pointers, and whether they were const + // qualified. + virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj, + unsigned __outer) const; + + // internally used during catch matching + virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, + void **__obj_ptr) const; + }; + + /** + * @brief Thrown during incorrect typecasting. + * + * If you attempt an invalid @c dynamic_cast expression, an instance of + * this class (or something derived from this class) is thrown. */ + class bad_cast : public exception + { + public: + bad_cast() throw() { } + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_cast() throw(); + }; + + /** If you use a NULL pointer in a @c typeid expression, this is thrown. */ + class bad_typeid : public exception + { + public: + bad_typeid () throw() { } + // This declaration is not useless: + // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 + virtual ~bad_typeid() throw(); + }; +} // namespace std + +} // extern "C++" +#endif diff --git a/i386/modules/uClibcxx/include/types b/i386/modules/uClibcxx/include/types new file mode 100644 index 0000000..b4bec8f --- /dev/null +++ b/i386/modules/uClibcxx/include/types @@ -0,0 +1,3 @@ +extern "C" { + #include "types.h" +} \ No newline at end of file diff --git a/i386/modules/uClibcxx/include/unwind-cxx.h b/i386/modules/uClibcxx/include/unwind-cxx.h new file mode 100644 index 0000000..c27aaac --- /dev/null +++ b/i386/modules/uClibcxx/include/unwind-cxx.h @@ -0,0 +1,154 @@ +// -*- C++ -*- Exception handling and frame unwind runtime interface routines. +// Copyright (C) 2001 Free Software Foundation, Inc. +// +// This file is part of GCC. +// +// GCC is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// GCC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with GCC; see the file COPYING. If not, write to +// the Free Software Foundation, 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// This is derived from the C++ ABI for IA-64. Where we diverge +// for cross-architecture compatibility are noted with "@@@". + +#ifndef _UNWIND_CXX_H +#define _UNWIND_CXX_H 1 + +// Level 2: C++ ABI + +#include <typeinfo> +#include <exception> +#include <cstddef> +//#include <unwind.h> + +namespace __cxxabiv1 +{ + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +// A C++ exception object consists of a header, which is a wrapper around +// an unwind object header with additional C++ specific information, +// followed by the exception object itself. + +struct __cxa_exception +{ + // Manage the exception object itself. + std::type_info *exceptionType; + void (*exceptionDestructor)(void *); + + // The C++ standard has entertaining rules wrt calling set_terminate + // and set_unexpected in the middle of the exception cleanup process. + std::unexpected_handler unexpectedHandler; + std::terminate_handler terminateHandler; + + // The caught exception stack threads through here. + __cxa_exception *nextException; + + // How many nested handlers have caught this exception. A negated + // value is a signal that this object has been rethrown. + int handlerCount; + + // Cache parsed handler data from the personality routine Phase 1 + // for Phase 2 and __cxa_call_unexpected. + int handlerSwitchValue; + const unsigned char *actionRecord; + const unsigned char *languageSpecificData; + _Unwind_Ptr catchTemp; + void *adjustedPtr; + + // The generic exception header. Must be last. + _Unwind_Exception unwindHeader; +}; + + // Each thread in a C++ program has access to a __cxa_eh_globals object. +struct __cxa_eh_globals +{ + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; + + +// The __cxa_eh_globals for the current thread can be obtained by using +// either of the following functions. The "fast" version assumes at least +// one prior call of __cxa_get_globals has been made from the current +// thread, so no initialization is necessary. +extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); +extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw(); +#endif + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +// Allocate memory for the exception plus the thown object. +extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw(); + +// Free the space allocated for the exception. +extern "C" void __cxa_free_exception(void *thrown_exception) throw(); + +// Throw the exception. +extern "C" void __cxa_throw (void *thrown_exception, + std::type_info *tinfo, + void (*dest) (void *)) + __attribute__((noreturn)); + +// Used to implement exception handlers. +extern "C" void *__cxa_begin_catch (void *) throw(); +extern "C" void __cxa_end_catch (); +extern "C" void __cxa_rethrow () __attribute__((noreturn)); +#endif + +// These facilitate code generation for recurring situations. +extern "C" void __cxa_bad_cast (); +extern "C" void __cxa_bad_typeid (); + +// @@@ These are not directly specified by the IA-64 C++ ABI. + +// Handles re-checking the exception specification if unexpectedHandler +// throws, and if bad_exception needs to be thrown. Called from the +// compiler. +extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); + +// Invokes given handler, dying appropriately if the user handler was +// so inconsiderate as to return. +extern void __terminate(std::terminate_handler) __attribute__((noreturn)); +extern void __unexpected(std::unexpected_handler) __attribute__((noreturn)); + +// The current installed user handlers. +extern std::terminate_handler __terminate_handler; +extern std::unexpected_handler __unexpected_handler; + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +// Acquire the C++ exception header from the C++ object. +static inline __cxa_exception * +__get_exception_header_from_obj (void *ptr) +{ + return reinterpret_cast<__cxa_exception *>(ptr) - 1; +} + +// Acquire the C++ exception header from the generic exception header. +static inline __cxa_exception * +__get_exception_header_from_ue (_Unwind_Exception *exc) +{ + return reinterpret_cast<__cxa_exception *>(exc + 1) - 1; +} +#endif +} /* namespace __cxxabiv1 */ + +#endif // _UNWIND_CXX_H diff --git a/i386/modules/uClibcxx/include/utility b/i386/modules/uClibcxx/include/utility new file mode 100644 index 0000000..070f34f --- /dev/null +++ b/i386/modules/uClibcxx/include/utility @@ -0,0 +1,84 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <basic_definitions> + + +#ifndef __STD_HEADER_UTILITY +#define __STD_HEADER_UTILITY 1 + +namespace std{ + + namespace rel_ops { + template<class T> inline bool operator!=(const T& x, const T& y){ + return !(x == y); + } + + template<class T> inline bool operator> (const T& x, const T& y){ + return ( y < x); + } + + template<class T> inline bool operator<=(const T& x, const T& y){ + return !( y < x ); + } + + template<class T> inline bool operator>=(const T& x, const T& y){ + return !(x < y); + } + } + + template <class T1, class T2> struct _UCXXEXPORT pair { + typedef T1 first_type; + typedef T2 second_type; + + T1 first; + T2 second; + pair() : first(), second() { } + pair(const T1& x, const T2& y) : first(x), second(y) { } + template<class U, class V> pair(const pair<U, V> &p) : first(p.first), second(p.second) { } + }; + + template <class T1, class T2> bool operator==(const pair<T1,T2>& x, const pair<T1,T2>& y){ + using namespace rel_ops; + return (x.first == y.first && x.second==y.second); + } + template <class T1, class T2> bool operator< (const pair<T1,T2>& x, const pair<T1,T2>& y){ + return x.first < y.first || (!(y.first < x.first) && x.second < y.second); + } + template <class T1, class T2> bool operator!=(const pair<T1,T2>& x, const pair<T1,T2>& y){ + return !(x == y); + } + template <class T1, class T2> bool operator> (const pair<T1,T2>& x, const pair<T1,T2>& y){ + return y < x; + } + template <class T1, class T2> bool operator>=(const pair<T1,T2>& x, const pair<T1,T2>& y){ + return !(x < y); + } + template <class T1, class T2> bool operator<=(const pair<T1,T2>& x, const pair<T1,T2>& y){ + return !(y < x); + } + template <class T1, class T2> pair<T1,T2> make_pair(const T1& x, const T2& y){ + return pair<T1,T2>(x, y); + } + + +} + +#endif //__STD_HEADER_UTILITY diff --git a/i386/modules/uClibcxx/include/valarray b/i386/modules/uClibcxx/include/valarray new file mode 100644 index 0000000..42448ad --- /dev/null +++ b/i386/modules/uClibcxx/include/valarray @@ -0,0 +1,992 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <basic_definitions> + +#ifndef __HEADER_STD_VALARRAY +#define __HEADER_STD_VALARRAY 1 + +#include <cstddef> +#include <cmath> + +namespace std{ + + template<class T> class valarray; + class slice; + template<class T> class slice_array; + class gslice; + template<class T> class gslice_array; + template<class T> class mask_array; + template<class T> class indirect_array; + + //Actual class definitions + + + class _UCXXEXPORT slice { + protected: + size_t sta; + size_t siz; + size_t str; + + public: + slice() : sta(0), siz(0), str(0){ } + slice(size_t a, size_t b, size_t c) : sta(a), siz(b), str(c) { } + slice(const slice& s) : sta(s.sta), siz(s.siz), str(s.str) { } + ~slice() { } + size_t start() const{ + return sta; + } + size_t size() const{ + return siz; + } + size_t stride() const{ + return str; + } + }; + + + + template<class T> class _UCXXEXPORT valarray { + friend class slice_array<T>; + protected: + T * data; + size_t length; + + public: + typedef T value_type; + + valarray() : data(0), length(0) { } + + explicit valarray(size_t t) : data(0), length(t){ + data = new T[length]; + } + + valarray(const T& v, size_t t) : data(0), length(t){ + data = new T[length]; + for(size_t i = 0; i < length; ++i){ + data[i] = v; + } + } + valarray(const T* p, size_t t) : data(0), length(t) { + data = new T[length]; + for(size_t i = 0; i < length; ++i){ + data[i] = p[i]; + } + } + valarray(const valarray& v) : data(0), length(v.length){ + data = new T[length]; + for(size_t i = 0; i < length; ++i){ + data[i] = v.data[i]; + } + } + valarray(const slice_array<T> & sa) : data(0), length(sa.s.size()){ + data = new T[length]; + for(unsigned int i = 0; i < length; ++i){ + data[i] = sa.array->data[sa.s.start() + i * sa.s.stride()]; + } + } + valarray(const gslice_array<T>&); + valarray(const mask_array<T>&); + valarray(const indirect_array<T>&); + ~valarray(){ + delete [] data; + data = 0; + length = 0; + } + + valarray<T>& operator=(const valarray<T>& v){ + for(size_t i =0; i< length; ++i){ + data[i] = v.data[i]; + } + return *this; + } + valarray<T>& operator=(const T& t){ + for(size_t i = 0; i < length; ++i){ + data[i] = t; + } + return *this; + } + valarray<T>& operator=(const slice_array<T>& sa){ + for(size_t i =0; i < length; ++i){ + data[i] = sa.data[sa.s.start() + i * sa.s.stride()]; + } + return *this; + } + valarray<T>& operator=(const gslice_array<T>&); + valarray<T>& operator=(const mask_array<T>&); + valarray<T>& operator=(const indirect_array<T>&); + + T operator[](size_t t) const{ + return data[t]; + } + T& operator[](size_t t){ + return data[t]; + } + + valarray<T> operator[](slice s) const{ + valarray<T> retval(s.size()); + for(unsigned int i = 0; i< s.size(); ++i){ + retval.data[i] = data[s.start() + i * s.stride()]; + } + return retval; + } + + slice_array<T> operator[](slice sl){ + slice_array<T> retval; + retval.s = sl; + retval.array = this; + return retval; + } + + valarray<T> operator[](const gslice&) const; + gslice_array<T> operator[](const gslice&); + valarray<T> operator[](const valarray<bool>&) const; + mask_array<T> operator[](const valarray<bool>&); + valarray<T> operator[](const valarray<size_t>&) const; + indirect_array<T> operator[](const valarray<size_t>&); + + valarray<T> operator+() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length ; ++i){ + retval.data[i] = +data[i]; + } + return retval; + } + valarray<T> operator-() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length; ++i){ + retval.data[i] = -data[i]; + } + return retval; + } + valarray<T> operator~() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length ; ++i){ + retval.data[i] = ~data[i]; + } + return retval; + } + valarray<T> operator!() const{ + valarray<T> retval(length); + for(size_t i = 0; i< length ; ++i){ + retval.data[i] = !data[i]; + } + return retval; + } + valarray<T>& operator*= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] *= t; + } + return *this; + } + valarray<T>& operator/= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] /= t; + } + return *this; + } + valarray<T>& operator%= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] %= t; + } + return *this; + } + valarray<T>& operator+= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] += t; + } + return *this; + } + valarray<T>& operator-= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] -= t; + } + return *this; + } + valarray<T>& operator^= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] ^= t; + } + return *this; + } + valarray<T>& operator&= (const T& t){ + for(size_t i=0;i<length;++i){ + data[i] &= t; + } + return *this; + } + valarray<T>& operator|= (const T& t){ + for(size_t i=0;i<length; ++i){ + data[i] != t; + } + return *this; + } + valarray<T>& operator<<=(const T& t){ + for(size_t i=0;i<length;++i){ + data[i] <<= t; + } + return *this; + } + valarray<T>& operator>>=(const T& t){ + for(size_t i=0;i<length;++i){ + data[i] >>= t; + } + return *this; + } + valarray<T>& operator*= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] *= a.data[i]; + } + return *this; + } + valarray<T>& operator/= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] /= a.data[i]; + } + return *this; + } + valarray<T>& operator%= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] %= a.data[i]; + } + return *this; + } + valarray<T>& operator+= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] += a.data[i]; + } + return *this; + } + valarray<T>& operator-= (const valarray<T>& a){ + for(size_t i=0;i<length ;++i){ + data[i] -= a.data[i]; + } + return *this; + } + valarray<T>& operator^= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] ^= a.data[i]; + } + return *this; + } + valarray<T>& operator|= (const valarray<T>& a){ + for(size_t i=0;i<length ;++i){ + data[i] |= a.data[i]; + } + return *this; + } + valarray<T>& operator&= (const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] &= a.data[i]; + } + return *this; + } + valarray<T>& operator<<=(const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] <<= a.data[i]; + } + return *this; + } + valarray<T>& operator>>=(const valarray<T>& a){ + for(size_t i=0;i<length;++i){ + data[i] >>= a.data[i]; + } + return *this; + } + + size_t size() const{ + return length; + } + + T sum() const{ + T retval(data[0]); + for(size_t i = 1; i< length; ++i){ + retval += data[i]; + } + return retval; + } + + T min() const{ + T retval(data[0]); + for(size_t i = 1; i< length; ++i){ + if(data[i] < retval){ + retval = data[i]; + } + } + return retval; + } + + T max() const{ + T retval(data[0]); + for(size_t i = 1; i< length; ++i){ + if(retval < data[i]){ + retval = data[i]; + } + } + return retval; + } + + valarray<T> shift (int n) const{ + valarray<T> retval(length); + for(size_t i = 0; i < length ; ++i){ + if(i + n > 0 && i + n < length){ + retval.data[i] = data[i + n]; + } + } + return retval; + } + valarray<T> cshift(int n) const{ + valarray<T> retval(length); + for(size_t i = 0; i < length ; ++i){ + retval.data[i] = data[ (i + n) % length ]; + } + return retval; + } + valarray<T> apply(T func(T) ) const{ + valarray<T> retval(length); + for(size_t i = 0; i< length; ++i){ + retval.data[i] = func(data[i]); + } + return retval; + } + valarray<T> apply(T func(const T&)) const{ + valarray<T> retval(length); + for(size_t i = 0; i< length; ++i){ + retval.data[i] = func(data[i]); + } + return retval; + } + void resize(size_t sz, T c = T()){ + delete [] data; + data = 0; + if(sz > 0){ + data = new T[sz]; + for(size_t i = 0; i < sz; ++i){ + data[i] = c; + } + } + length = sz; + } + }; + + + + template <class T> class _UCXXEXPORT slice_array { + friend class valarray<T>; + public: + typedef T value_type; + + void operator= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] = v[i]; + } + } + void operator= (const T & v){ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] = v; + } + } + void fill(const T & v){ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] = v; + } + } + void operator*= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] *= v[i]; + } + } + void operator/= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] /= v[i]; + } + } + void operator%= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] %= v[i]; + } + } + void operator+= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] += v[i]; + } + } + void operator-= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] -= v[i]; + } + } + void operator^= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] ^= v[i]; + } + } + void operator&= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] &= v[i]; + } + } + void operator|= (const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] |= v[i]; + } + } + void operator<<=(const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] <<= v[i]; + } + } + void operator>>=(const valarray<T>& v) const{ + for(unsigned int i = 0; i < s.size(); ++i){ + array->data[s.start() + i * s.stride()] >>= v[i]; + } + } + ~slice_array(){ + array = 0; + } + + private: + slice_array() : array(0){ } + + public: + slice_array(const slice_array& sa) : array(sa.array), s(sa.s){ } + slice_array& operator=(const slice_array& sa){ + array = sa.array; + s = sa.s; + } + + private: + valarray<T> * array; + slice s; + }; + + + class _UCXXEXPORT gslice { + private: + size_t sta; + valarray<size_t> siz; + valarray<size_t> str; + + public: + gslice() : sta(0) { } + gslice(size_t s, const valarray<size_t>& l, const valarray<size_t>& d) + : sta(s), siz(l), str(d) { } + + size_t start() const{ + return sta; + } + valarray<size_t> size() const{ + return siz; + } + valarray<size_t> stride() const{ + return str; + } + }; + + template <class T> class gslice_array { + private: + friend class valarray<T>; + + public: + ~gslice_array(); + + void operator=(const valarray<T>& array) const; + void operator*=(const valarray<T>& array) const; + void operator/=(const valarray<T>& array) const; + void operator%=(const valarray<T>& array) const; + void operator+=(const valarray<T>& array) const; + void operator-=(const valarray<T>& array) const; + void operator^=(const valarray<T>& array) const; + void operator&=(const valarray<T>& array) const; + void operator|=(const valarray<T>& array) const; + void operator<<=(const valarray<T>& array) const; + void operator>>=(const valarray<T>& array) const; + + void operator=(const T&); + + private: + gslice_array(); + gslice_array(const gslice_array<T>&); + gslice_array<T>& operator= (const gslice_array<T>& array); + }; + + + + template<class T> valarray<T> operator* (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval *= rhs; + return retval; + } + + template<class T> valarray<T> operator* (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval *= rhs; + return retval; + } + template<class T> valarray<T> operator* (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(rhs); + retval *= lhs; + return retval; + } + template<class T> valarray<T> operator/ (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval /= rhs; + return retval; + } + template<class T> valarray<T> operator/ (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval /= rhs; + return retval; + } + template<class T> valarray<T> operator/ (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval /= rhs; + return retval; + } + template<class T> valarray<T> operator% (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval %= rhs; + return retval; + } + template<class T> valarray<T> operator% (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval %= rhs; + return retval; + } + template<class T> valarray<T> operator% (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval %= rhs; + return retval; + } + template<class T> valarray<T> operator+ (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval += rhs; + return retval; + } + template<class T> valarray<T> operator+ (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval += rhs; + return retval; + } + template<class T> valarray<T> operator+ (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval += rhs; + return retval; + } + template<class T> valarray<T> operator- (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval -= rhs; + return retval; + } + template<class T> valarray<T> operator- (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval-= rhs; + return retval; + } + template<class T> valarray<T> operator- (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval -= rhs; + return retval; + } + template<class T> valarray<T> operator^ (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval ^= rhs; + return retval; + } + template<class T> valarray<T> operator^ (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval ^= rhs; + return retval; + } + template<class T> valarray<T> operator^ (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval ^= rhs; + return retval; + } + template<class T> valarray<T> operator& (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval &= rhs; + return retval; + } + template<class T> valarray<T> operator& (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval &= rhs; + return retval; + } + template<class T> valarray<T> operator& (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval &= rhs; + return retval; + } + template<class T> valarray<T> operator| (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval |= rhs; + return retval; + } + template<class T> valarray<T> operator| (const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval |= rhs; + return retval; + } + template<class T> valarray<T> operator| (const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval |= rhs; + return retval; + } + template<class T> valarray<T> operator<<(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval <<= rhs; + return retval; + } + template<class T> valarray<T> operator<<(const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval <<= rhs; + return retval; + } + template<class T> valarray<T> operator<<(const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval <<= rhs; + return retval; + } + template<class T> valarray<T> operator>>(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs); + retval >>= rhs; + return retval; + } + template<class T> valarray<T> operator>>(const valarray<T>& lhs, const T& rhs){ + valarray<T> retval(lhs); + retval >>= rhs; + return retval; + } + template<class T> valarray<T> operator>>(const T& lhs, const valarray<T>& rhs){ + valarray<T> retval(lhs, rhs.size()); + retval >>= rhs; + return retval; + } + + template<class T> valarray<bool> operator&&(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs[i] && rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator&&(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] && rhs; + } + return retval; + } + template<class T> valarray<bool> operator&&(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs && rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator||(const valarray<T>&lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] || rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator||(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] || rhs; + } + return retval; + } + template<class T> valarray<bool> operator||(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs || rhs[i]; + } + return retval; + } + + template<class T> valarray<bool> operator==(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] == rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator==(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs[i] == rhs; + } + return retval; + } + template<class T> valarray<bool> operator==(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = lhs == rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator!=(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] != rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator!=(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] != rhs; + } + return retval; + } + template<class T> valarray<bool> operator!=(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs != rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator< (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] < rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator< (const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] < rhs; + } + return retval; + } + template<class T> valarray<bool> operator< (const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs < rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator> (const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] > rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator> (const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] > rhs; + } + return retval; + } + template<class T> valarray<bool> operator> (const T& rhs, const valarray<T>& lhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs > rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator<=(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] <= rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator<=(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] <= rhs; + } + return retval; + } + template<class T> valarray<bool> operator<=(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs <= rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator>=(const valarray<T>& lhs, const valarray<T>& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] >= rhs[i]; + } + return retval; + } + template<class T> valarray<bool> operator>=(const valarray<T>& lhs, const T& rhs){ + valarray<bool> retval(lhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs[i] >= rhs; + } + return retval; + } + template<class T> valarray<bool> operator>=(const T& lhs, const valarray<T>& rhs){ + valarray<bool> retval(rhs.size()); + for(size_t i = 0; i <retval.size(); ++i){ + retval[i] = lhs >= rhs[i]; + } + return retval; + } + template<class T> T min(const valarray<T>& x){ + T retval(x[0]); + for(size_t i = 1; i < x.size(); ++i){ + if(x[i] < retval){ + retval = x[i]; + } + } + } + template<class T> T max(const valarray<T>& x){ + T retval(x[0]); + for(size_t i = 1; i < x.size(); ++i){ + if(x[i] > retval){ + retval = x[i]; + } + } + } + + template<class T> valarray<T> abs (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = abs(x[i]); + } + } + template<class T> valarray<T> acos (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = acos(x[i]); + } + } + template<class T> valarray<T> asin (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = asin(x[i]); + } + } + template<class T> valarray<T> atan (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = atan(x[i]); + } + } + template<class T> valarray<T> atan2(const valarray<T>& y, const valarray<T>& x){ + valarray<T> retval(y.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = atan2(y[i], x[i]); + } + } + template<class T> valarray<T> atan2(const valarray<T>& y, const T& x){ + valarray<T> retval(y.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = atan2(y[i], x); + } + } + template<class T> valarray<T> atan2(const T& y, const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = abs(y, x[i]); + } + } + template<class T> valarray<T> cos (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = cos(x[i]); + } + } + template<class T> valarray<T> cosh (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = cosh(x[i]); + } + } + template<class T> valarray<T> exp (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = exp(x[i]); + } + } + template<class T> valarray<T> log (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = log(x[i]); + } + } + template<class T> valarray<T> log10(const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = log10(x[i]); + } + } + template<class T> valarray<T> pow (const valarray<T>& x, const valarray<T>& y){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = pow(x[i], y[i]); + } + } + template<class T> valarray<T> pow (const valarray<T>& x, const T& y){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = pow(x[i], y); + } + } + template<class T> valarray<T> pow (const T& x, const valarray<T>& y){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = pow(x, y[i]); + } + } + template<class T> valarray<T> sin (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = sin(x[i]); + } + } + template<class T> valarray<T> sinh (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = sinh(x[i]); + } + } + template<class T> valarray<T> sqrt (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = sqrt(x[i]); + } + } + template<class T> valarray<T> tan (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = tan(x[i]); + } + } + template<class T> valarray<T> tanh (const valarray<T>& x){ + valarray<T> retval(x.size()); + for(size_t i = 0; i < retval.size(); ++i){ + retval[i] = tanh(x[i]); + } + } + +} + +#endif diff --git a/i386/modules/uClibcxx/include/vector b/i386/modules/uClibcxx/include/vector new file mode 100644 index 0000000..195ba96 --- /dev/null +++ b/i386/modules/uClibcxx/include/vector @@ -0,0 +1,513 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <basic_definitions> +#include <memory> +#include <iterator> +#include <func_exception> +#include <algorithm> +#include <type_traits> + + +#ifndef __STD_HEADER_VECTOR +#define __STD_HEADER_VECTOR + +namespace std{ + + template <class T, class Allocator = allocator<T> > class vector; + template <class T, class Allocator> bool operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator< (const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator!=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator> (const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> bool operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y); + template <class T, class Allocator> void swap(vector<T,Allocator>& x, vector<T,Allocator>& y); + + template <class T, class Allocator> class _UCXXEXPORT vector { + public: + + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + + typedef T* iterator; + typedef const T* const_iterator; + typedef T value_type; + typedef Allocator allocator_type; + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; + + explicit _UCXXEXPORT vector(const Allocator& al= Allocator()): data(0), //defaultValue(T()), + data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al) + { + data = a.allocate(data_size); + } + + explicit _UCXXEXPORT vector(size_type n, const T& value = T(), const Allocator& al= Allocator()) : + data(0), data_size(0), elements(0), a(al) + { + data_size = n + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + + resize(n, value); + } + + template <class InputIterator> _UCXXEXPORT + vector(InputIterator first, InputIterator last, const Allocator& al = Allocator()): + data(0), data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al) + { + data = a.allocate(data_size); + assign(first, last); + } + + _UCXXEXPORT vector(const vector<T,Allocator>& x){ + a = x.a; + + elements = x.elements; + data_size = elements + __UCLIBCXX_STL_BUFFER_SIZE__; + data = a.allocate(data_size); + + for(size_type i = 0; i < elements; i++){ + a.construct(data+i, x.data[i]); + } + } + + _UCXXEXPORT ~vector(); //Below + + _UCXXEXPORT vector<T,Allocator>& operator=(const vector<T,Allocator>& x){ + if(&x == this){ + return *this; + } + + reserve(x.elements); //Make sure that we have enough actual memory + + + //Copy as many elements as possible + + size_t minElements = elements; + if(minElements > x.elements){ + minElements = x.elements; + } + for(size_t i = 0; i < minElements; ++i){ + data[i] = x.data[i]; + } + + //If we need to add new elements + if(elements < x.elements){ + for(size_t i = elements; i< x.elements; ++i){ + a.construct(data+i, x.data[i]); + ++elements; + } + } + + if(elements > x.elements){ + downsize(x.elements); + } + + return *this; + } + + template <class InputIterator> _UCXXEXPORT void assign(InputIterator first, InputIterator last){ + clear(); + insert(begin(), first, last); + } + + template <class Size, class U> _UCXXEXPORT void assign(Size n, const U& u = U()){ + clear(); + resize(n, u); + } + + inline allocator_type get_allocator() const{ + return a; + } + + inline iterator begin(){ + return data; + } + + inline const_iterator begin() const{ + return data; + } + + inline iterator end(){ + return (data + elements); + } + + inline const_iterator end() const{ + return (data + elements); + } + + inline reverse_iterator rbegin(){ + return reverse_iterator(end()); + } + + inline const_reverse_iterator rbegin() const{ + return const_reverse_iterator(end()); + } + + inline reverse_iterator rend(){ + return reverse_iterator(begin()); + } + + inline const_reverse_iterator rend() const{ + return const_reverse_iterator(begin()); + } + + inline size_type size() const{ + return elements; + } + + _UCXXEXPORT size_type max_size() const{ + return ((size_type)(-1)) / sizeof(T); + } + + void downsize(size_type sz); + void resize(size_type sz, const T & c = T()); + + inline size_type capacity() const{ + return data_size; + } + + inline bool empty() const{ + return (size() == 0); + } + + void reserve(size_type n); + + inline reference operator[](size_type n){ + return data[n]; + } + + inline const_reference operator[](size_type n) const{ + return data[n]; + } + + _UCXXEXPORT const_reference at(size_type n) const{ + if(n >= elements){ + __throw_out_of_range("Invalid subscript"); + } + return data[n]; + } + + _UCXXEXPORT reference at(size_type n){ + if(n >= elements){ + __throw_out_of_range("Invalid subscript"); + } + return data[n]; + } + + inline reference front(){ + return data[0]; + } + + inline const_reference front() const{ + return data[0]; + } + + inline reference back(){ + return data[ size() - 1]; + } + + inline const_reference back() const{ + return data[ size() - 1 ]; + } + + inline void push_back(const T& x){ + resize( size() + 1, x); + } + + inline void pop_back(){ + downsize(size() - 1); + } + + _UCXXEXPORT iterator insert(iterator position, const T& x = T()){ + size_type index = position - data; + resize(size() + 1, x); + for(size_type i = elements - 1; i > index; --i){ + data[i] = data[i-1]; + } + data[index] = x; + return (data + index); + } + + _UCXXEXPORT void _insert_fill(iterator position, size_type n, const T & x){ + size_type index = position - data; + resize(size() + n, x); + + for(size_type i = elements -1; (i > (index+n-1)); --i){ + data[i] = data[i-n]; + } + for(size_type i = 0; i < n; i++){ + data[i + index] = x; + } + } + + template <class InputIterator> _UCXXEXPORT + void _insert_from_iterator(iterator position, InputIterator first, InputIterator last) + { + T temp; + while(first !=last){ + temp = *first; + position = insert(position, temp); + ++position; + ++first; + } + } + + template <class InputIterator> + inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, __true_type) + { + _insert_fill(position, first, last); + } + + template <class InputIterator> + inline void _dispatch_insert(iterator position, InputIterator first, InputIterator last, __false_type) + { + _insert_from_iterator(position, first, last); + } + + inline void insert(iterator position, size_type n, const T& x ){ + _insert_fill(position, n, x); + } + + template <class InputIterator> inline void insert(iterator position, InputIterator first, InputIterator last){ + typedef typename __is_integer<InputIterator>::value __some_type; + _dispatch_insert(position, first, last, __some_type()); + } + + _UCXXEXPORT iterator erase(iterator position){ + size_type index = position - data; + for(size_type i = index; i < (elements - 1); ++i){ + data[i] = data[i+1]; + } + downsize(size() - 1); + return (data + index); + } + + _UCXXEXPORT iterator erase(iterator first, iterator last){ + size_type index = first - data; + size_type width = last - first; + for(size_type i = index; i < (elements - width) ;++i){ + data[i] = data[i+width]; + } + downsize(size() - width); + return (data + index); + } + + _UCXXEXPORT void swap(vector<T,Allocator>& v){ + if(this == &v){ //Avoid dv.swap(v) + return; + } + T* ptr; + size_type temp; + + //Swap pointers first + ptr = data; + data = v.data; + v.data = ptr; + + //Swap element counts + temp = elements; + elements = v.elements; + v.elements = temp; + + //Swap data size + temp = data_size; + data_size = v.data_size; + v.data_size = temp; + } + + _UCXXEXPORT void clear(){ + downsize(0); + } + + protected: + T* data; + size_type data_size; + size_type elements; + Allocator a; + }; + + + + //Here go template instantiations + + template<class T, class Allocator> _UCXXEXPORT vector<T, Allocator>::~vector(){ + for(size_t i = 0; i < elements; ++i){ + a.destroy(data + i); + } + a.deallocate(data, data_size); + } + + + template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::reserve(size_type n){ + if(n > data_size){ //We never shrink... + T * temp_ptr = data; + size_type temp_size = data_size; + + data_size = n; + data = a.allocate(data_size); + + for(size_type i = 0; i<elements; ++i){ + a.construct(data+i, temp_ptr[i]); + a.destroy(temp_ptr+i); + } + a.deallocate(temp_ptr, temp_size); + } + } + + template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::resize(size_type sz, const T & c){ + if(sz > elements){ //Need to actually call constructor + if(sz > data_size){ + reserve(sz + __UCLIBCXX_STL_BUFFER_SIZE__); + } + + for(size_type i = elements; i<sz ; ++i){ + a.construct(data+i, c); + } + elements = sz; + }else{ + downsize(sz); + } + } + + template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::downsize(size_type sz){ + if(sz < elements){ //Actually are downsizing + for(size_t i = sz; i< elements; ++i){ + a.destroy(data+i); + } + elements = sz; + } + } + + +#ifndef __UCLIBCXX_COMPILE_VECTOR__ +#ifdef __UCLIBCXX_EXPAND_VECTOR_BASIC__ + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + + template<> _UCXXEXPORT vector<char, allocator<char> >::~vector(); + template<> _UCXXEXPORT vector<unsigned char, allocator<unsigned char> >::~vector(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template<> _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned char, allocator<unsigned char> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<short int, allocator<short int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned short int, allocator<unsigned short int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<int, allocator<int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<long int, allocator<long int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<unsigned long int, allocator<unsigned long int> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<float, allocator<float> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<double, allocator<double> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<bool, allocator<bool> >::reserve(size_type n); + + template<> _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + template<> _UCXXEXPORT void + vector<unsigned char, allocator<unsigned char> >::resize(size_type sz, const unsigned char & c); + template<> _UCXXEXPORT void vector<short int, allocator<short int> >::resize(size_type sz, const short & c); + template<> _UCXXEXPORT void + vector<unsigned short int, allocator<unsigned short int> >::resize(size_type sz, const unsigned short int & c); + template<> _UCXXEXPORT void vector<int, allocator<int> >::resize(size_type sz, const int & c); + template<> _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::resize(size_type sz, const unsigned int & c); + template<> _UCXXEXPORT void vector<long int, allocator<long int> >::resize(size_type sz, const long int & c); + template<> _UCXXEXPORT void + vector<unsigned long int, allocator<unsigned long int> >::resize(size_type sz, const unsigned long int & c); + template<> _UCXXEXPORT void vector<float, allocator<float> >::resize(size_type sz, const float & c); + template<> _UCXXEXPORT void vector<double, allocator<double> >::resize(size_type sz, const double & c); + template<> _UCXXEXPORT void vector<bool, allocator<bool> >::resize(size_type sz, const bool & c); + +#elif defined __UCLIBCXX_EXPAND_STRING_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template<> _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + template<> _UCXXEXPORT vector<char, allocator<char> >::~vector(); + +#endif + + template<> _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template<> _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + +#endif +#endif + + + + template <class T, class Allocator> _UCXXEXPORT bool + operator==(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + if(x.size() !=y.size() ){ + return false; + } + for(size_t i = 0; i < x.size(); ++i){ + if(x[i] != y[i]){ + return false; + } + } + return true; + } + + template <class T, class Allocator> _UCXXEXPORT bool + operator< (const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + less<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator!=(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + return !(x == y); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator> (const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + greater<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator>=(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + greater_equal<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + template <class T, class Allocator> _UCXXEXPORT bool + operator<=(const vector<T,Allocator>& x, const vector<T,Allocator>& y) + { + less_equal<typename iterator_traits<typename vector<T,Allocator>::iterator >::value_type> c; + return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), c); + } + + template <class T, class Allocator> _UCXXEXPORT void swap(vector<T,Allocator>& x, vector<T,Allocator>& y){ + x.swap(y); + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/iomanip.cpp b/i386/modules/uClibcxx/iomanip.cpp new file mode 100644 index 0000000..c5e60cc --- /dev/null +++ b/i386/modules/uClibcxx/iomanip.cpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <iomanip> + +namespace std{ + + + + +} + + diff --git a/i386/modules/uClibcxx/ios.cpp b/i386/modules/uClibcxx/ios.cpp new file mode 100644 index 0000000..cf55fa3 --- /dev/null +++ b/i386/modules/uClibcxx/ios.cpp @@ -0,0 +1,189 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_IOS__ 1 + +#include <ios> +#include <ostream> +#include <istream> +#include <cstdio> +#include <fstream> + +namespace std{ + + +#ifdef __UCLIBCXX_SUPPORT_CDIR__ + _UCXXLOCAL int ios_base::Init::init_cnt = 0; //Needed to ensure the static value is created + +//Create buffers first +#if __UCLIBCXX_SUPPORT_COUT__ + _UCXXEXPORT filebuf _cout_filebuf; +#endif +#if __UCLIBCXX_SUPPORT_CIN__ + _UCXXEXPORT filebuf _cin_filebuf; +#endif +#if __UCLIBCXX_SUPPORT_CERR__ + _UCXXEXPORT filebuf _cerr_filebuf; +#endif +#if __UCLIBCXX_SUPPORT_CLOG__ + _UCXXEXPORT filebuf _clog_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _UCXXEXPORT wfilebuf _wcout_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _UCXXEXPORT wfilebuf _wcin_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _UCXXEXPORT wfilebuf _wcerr_filebuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _UCXXEXPORT wfilebuf _wclog_filebuf; +#endif + +//Then create streams +#if __UCLIBCXX_SUPPORT_COUT__ + _UCXXEXPORT ostream cout(&_cout_filebuf); +#endif +#if __UCLIBCXX_SUPPORT_CIN__ + _UCXXEXPORT istream cin(&_cin_filebuf); +#endif +#if __UCLIBCXX_SUPPORT_CERR__ + _UCXXEXPORT ostream cerr(&_cerr_filebuf); +#endif +#if __UCLIBCXX_SUPPORT_CLOG__ + _UCXXEXPORT ostream clog(&_clog_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _UCXXEXPORT wostream wcout(&_wcout_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _UCXXEXPORT wistream wcin(&_wcin_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _UCXXEXPORT wostream wcerr(&_wcerr_filebuf); +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _UCXXEXPORT wostream wclog(&_wclog_filebuf); +#endif + + + _UCXXEXPORT ios_base::Init::Init(){ + if(init_cnt == 0){ //Need to construct cout et al +#if __UCLIBCXX_SUPPORT_COUT__ + _cout_filebuf.fp = stdout; + _cout_filebuf.openedFor = ios_base::out; +#endif +#if __UCLIBCXX_SUPPORT_CERR__ + _cerr_filebuf.fp = stderr; + _cerr_filebuf.openedFor = ios_base::out; + cerr.mformat |= ios_base::unitbuf; +#endif +#if __UCLIBCXX_SUPPORT_CLOG__ + _clog_filebuf.fp = stderr; + _clog_filebuf.openedFor = ios_base::out; +#endif +#if __UCLIBCXX_SUPPORT_CIN__ + _cin_filebuf.fp = stdin; + _cin_filebuf.openedFor = ios_base::in; + +#if __UCLIBCXX_SUPPORT_COUT__ + cin.tie(&cout); +#endif + +#endif +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + _wcout_filebuf.fp = stdout; + _wcout_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCERR__ + _wcerr_filebuf.fp = stderr; + _wcerr_filebuf.openedFor = ios_base::out; + wcerr.mformat |= ios_base::unitbuf; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCLOG__ + _wclog_filebuf.fp = stderr; + _wclog_filebuf.openedFor = ios_base::out; +#endif +#ifdef __UCLIBCXX_SUPPORT_WCIN__ + _wcin_filebuf.fp = stdin; + _wcin_filebuf.openedFor = ios_base::in; + +#ifdef __UCLIBCXX_SUPPORT_WCOUT__ + wcin.tie(&wcout); +#endif + +#endif + } + init_cnt++; + } + + _UCXXEXPORT ios_base::Init::~Init(){ + --init_cnt; + if(init_cnt==0){ + + } + } +#endif + + +#ifdef __UCLIBCXX_EXPAND_IOS_CHAR__ + + template _UCXXEXPORT void basic_ios<char, char_traits<char> >::clear(iostate state); + template _UCXXEXPORT void basic_ios<char, char_traits<char> >::setstate(iostate state); + +#endif + + + _UCXXEXPORT ios_base::fmtflags ios_base::flags(fmtflags fmtfl){ + fmtflags temp = mformat; + mformat = fmtfl; + return temp; + } + + _UCXXEXPORT ios_base::fmtflags ios_base::setf(fmtflags fmtfl){ + return flags(flags() | fmtfl); + } + + _UCXXEXPORT ios_base::fmtflags ios_base::setf(fmtflags fmtfl, fmtflags mask ){ + return flags( (flags()& ~mask) | (fmtfl & mask)); + } + + _UCXXEXPORT streamsize ios_base::precision(streamsize prec){ + streamsize temp = mprecision; + mprecision = prec; + return temp; + } + + _UCXXEXPORT streamsize ios_base::width(streamsize wide){ + streamsize temp = mwidth; + mwidth = wide; + return temp; + } + + _UCXXEXPORT locale ios_base::imbue(const locale& loc){ + locale retval = mLocale; + mLocale = loc; + return retval; + } + +} + + + diff --git a/i386/modules/uClibcxx/iostream.cpp b/i386/modules/uClibcxx/iostream.cpp new file mode 100644 index 0000000..7a190a2 --- /dev/null +++ b/i386/modules/uClibcxx/iostream.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_IOSTREAM__ 1 + +#include <iostream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template _UCXXEXPORT basic_iostream<char, char_traits<char> >:: + basic_iostream(basic_streambuf<char, char_traits<char> >* sb); + template _UCXXEXPORT basic_iostream<char, char_traits<char> >::~basic_iostream(); + +#endif +#endif + +} + + diff --git a/i386/modules/uClibcxx/istream.cpp b/i386/modules/uClibcxx/istream.cpp new file mode 100644 index 0000000..9e96139 --- /dev/null +++ b/i386/modules/uClibcxx/istream.cpp @@ -0,0 +1,75 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#define __UCLIBCXX_COMPILE_ISTREAM__ 1 + +#include <istream> + + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + + template <> _UCXXEXPORT string _readToken<char, char_traits<char> >(istream & stream) + { + string temp; + char_traits<char>::int_type c; + while(true){ + c = stream.rdbuf()->sgetc(); + if(c != char_traits<char>::eof() && isspace(c) == false){ + stream.rdbuf()->sbumpc(); + temp.append(1, char_traits<char>::to_char_type(c)); + }else{ + break; + } + } + if (temp.size() == 0) + stream.setstate(ios_base::eofbit|ios_base::failbit); + + return temp; + } + + template _UCXXEXPORT istream::int_type istream::get(); + template _UCXXEXPORT istream & istream::get(char &c); + + template _UCXXEXPORT istream & istream::operator>>(bool &n); + template _UCXXEXPORT istream & istream::operator>>(short &n); + template _UCXXEXPORT istream & istream::operator>>(unsigned short &n); + template _UCXXEXPORT istream & istream::operator>>(int &n); + template _UCXXEXPORT istream & istream::operator>>(unsigned int &n); + template _UCXXEXPORT istream & istream::operator>>(long unsigned &n); + template _UCXXEXPORT istream & istream::operator>>(long int &n); + template _UCXXEXPORT istream & istream::operator>>(void *& p); + template _UCXXEXPORT istream & operator>>(istream & is, char & c); + + +#ifdef __UCLIBCXX_HAS_FLOATS__ + template _UCXXEXPORT istream & istream::operator>>(float &f); + template _UCXXEXPORT istream & istream::operator>>(double &f); + template _UCXXEXPORT istream & istream::operator>>(long double &f); +#endif + + template _UCXXEXPORT void __skipws(basic_istream<char, char_traits<char> >& is); + +#endif + + +} + diff --git a/i386/modules/uClibcxx/iterator.cpp b/i386/modules/uClibcxx/iterator.cpp new file mode 100644 index 0000000..2e21517 --- /dev/null +++ b/i386/modules/uClibcxx/iterator.cpp @@ -0,0 +1,28 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <iterator> + +namespace std{ + + + +} + + diff --git a/i386/modules/uClibcxx/limits.cpp b/i386/modules/uClibcxx/limits.cpp new file mode 100644 index 0000000..0fd42d5 --- /dev/null +++ b/i386/modules/uClibcxx/limits.cpp @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <limits> + +namespace std{ + + +} diff --git a/i386/modules/uClibcxx/list.cpp b/i386/modules/uClibcxx/list.cpp new file mode 100644 index 0000000..cfc44e0 --- /dev/null +++ b/i386/modules/uClibcxx/list.cpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <list> + +namespace std{ + + + + +} + + diff --git a/i386/modules/uClibcxx/locale.cpp b/i386/modules/uClibcxx/locale.cpp new file mode 100644 index 0000000..bc41792 --- /dev/null +++ b/i386/modules/uClibcxx/locale.cpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <locale> +#include <cstring> +#include <string> +#include <stdexcept> +#include <cctype> + +namespace std{ + +} + diff --git a/i386/modules/uClibcxx/map.cpp b/i386/modules/uClibcxx/map.cpp new file mode 100644 index 0000000..06e56a0 --- /dev/null +++ b/i386/modules/uClibcxx/map.cpp @@ -0,0 +1,33 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <map> + +namespace std{ + + + + + + + + + + +} diff --git a/i386/modules/uClibcxx/new_handler.cpp b/i386/modules/uClibcxx/new_handler.cpp new file mode 100644 index 0000000..1d85ee3 --- /dev/null +++ b/i386/modules/uClibcxx/new_handler.cpp @@ -0,0 +1,31 @@ +/* Copyright (C) 2005 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <new> + +const std::nothrow_t std::nothrow = { }; + +//Name selected to be compatable with g++ code +std::new_handler __new_handler; + +_UCXXEXPORT std::new_handler std::set_new_handler(std::new_handler new_p) throw(){ + std::new_handler retval = __new_handler; + __new_handler = new_p; + return retval; +} diff --git a/i386/modules/uClibcxx/new_op.cpp b/i386/modules/uClibcxx/new_op.cpp new file mode 100644 index 0000000..7fc7b1b --- /dev/null +++ b/i386/modules/uClibcxx/new_op.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include <new> +#include <cstdlib> +#include <func_exception> + +extern "C" { +#include "libsaio.h" +}; + +_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc){ + //C++ stardard 5.3.4.8 requires that a valid pointer be returned for + //a call to new(0). Thus: + if(numBytes == 0){ + numBytes = 1; + } + void * p = malloc(numBytes); + if(p == 0){ + std::__throw_bad_alloc(); + } + return p; +} diff --git a/i386/modules/uClibcxx/new_opnt.cpp b/i386/modules/uClibcxx/new_opnt.cpp new file mode 100644 index 0000000..68a2571 --- /dev/null +++ b/i386/modules/uClibcxx/new_opnt.cpp @@ -0,0 +1,31 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <new> +#include <cstdlib> +#include <func_exception> +extern "C" { +#include "libsaio.h" +}; +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new(std::size_t numBytes, const std::nothrow_t& ) throw(){ + return malloc(numBytes); +} +#endif diff --git a/i386/modules/uClibcxx/new_opv.cpp b/i386/modules/uClibcxx/new_opv.cpp new file mode 100644 index 0000000..d156bdf --- /dev/null +++ b/i386/modules/uClibcxx/new_opv.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <new> +#include <cstdlib> +#include <func_exception> +extern "C" { +#include "libsaio.h" +}; +_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc){ + //C++ stardard 5.3.4.8 requires that a valid pointer be returned for + //a call to new(0). Thus: + if(numBytes == 0){ + numBytes = 1; + } + void * p = malloc(numBytes); + if(p == 0){ + std::__throw_bad_alloc(); + } + return p; +} diff --git a/i386/modules/uClibcxx/new_opvnt.cpp b/i386/modules/uClibcxx/new_opvnt.cpp new file mode 100644 index 0000000..57ccce8 --- /dev/null +++ b/i386/modules/uClibcxx/new_opvnt.cpp @@ -0,0 +1,31 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <new> +#include <cstdlib> +#include <func_exception> +extern "C" { +#include "libsaio.h" +}; +#ifndef NO_NOTHROW +_UCXXEXPORT void* operator new[](std::size_t numBytes, const std::nothrow_t& ) throw(){ + return malloc(numBytes); +} +#endif diff --git a/i386/modules/uClibcxx/numeric.cpp b/i386/modules/uClibcxx/numeric.cpp new file mode 100644 index 0000000..eb93f2e --- /dev/null +++ b/i386/modules/uClibcxx/numeric.cpp @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <numeric> + +namespace std{ + + +} + + diff --git a/i386/modules/uClibcxx/ostream.cpp b/i386/modules/uClibcxx/ostream.cpp new file mode 100644 index 0000000..0973871 --- /dev/null +++ b/i386/modules/uClibcxx/ostream.cpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_OSTREAM__ 1 + +#include <ostream> + +namespace std{ + + +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template _UCXXEXPORT ostream::~basic_ostream(); +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream & ostream::flush(); + + template _UCXXEXPORT ostream & ostream::operator<<(bool n); + template _UCXXEXPORT ostream & ostream::operator<<(short int n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned short int n); + template _UCXXEXPORT ostream & ostream::operator<<(int n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned int n); + template _UCXXEXPORT ostream & ostream::operator<<(long n); + template _UCXXEXPORT ostream & ostream::operator<<(unsigned long n); + template _UCXXEXPORT ostream & ostream::operator<<(float f); + template _UCXXEXPORT ostream & ostream::operator<<(double f); + template _UCXXEXPORT ostream & ostream::operator<<(long double f); + template _UCXXEXPORT ostream & ostream::operator<<(void* p); + template _UCXXEXPORT ostream & ostream::operator<<(basic_streambuf<char, char_traits<char> >* sb); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream::sentry::sentry(ostream & os); + template _UCXXEXPORT ostream::sentry::~sentry(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT ostream & endl(ostream & os); + template _UCXXEXPORT ostream & flush(ostream & os); + template _UCXXEXPORT ostream & operator<<(ostream & out, char c); + template _UCXXEXPORT ostream & operator<<(ostream & out, const char* c); + template _UCXXEXPORT ostream & operator<<(ostream & out, unsigned char c); + template _UCXXEXPORT ostream & operator<<(ostream & out, const unsigned char* c); + +#endif + + +} diff --git a/i386/modules/uClibcxx/queue.cpp b/i386/modules/uClibcxx/queue.cpp new file mode 100644 index 0000000..356efeb --- /dev/null +++ b/i386/modules/uClibcxx/queue.cpp @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <queue> + + +namespace std{ + + + + +} diff --git a/i386/modules/uClibcxx/set.cpp b/i386/modules/uClibcxx/set.cpp new file mode 100644 index 0000000..61ec56a --- /dev/null +++ b/i386/modules/uClibcxx/set.cpp @@ -0,0 +1,33 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + +#include <set> + +namespace std{ + + + + + + + + + + +} diff --git a/i386/modules/uClibcxx/sstream.cpp b/i386/modules/uClibcxx/sstream.cpp new file mode 100644 index 0000000..e712b67 --- /dev/null +++ b/i386/modules/uClibcxx/sstream.cpp @@ -0,0 +1,59 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_SSTREAM__ 1 + +#include <sstream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_SSTREAM_CHAR__ + + typedef char_traits<char> tr_ch; + typedef basic_stringbuf<char, tr_ch, allocator<char> > char_stringbuf; + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT char_stringbuf::basic_stringbuf(ios_base::openmode which); + template _UCXXEXPORT char_stringbuf::~basic_stringbuf(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_string<char, char_traits<char>, allocator<char> > char_stringbuf::str() const; + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::pbackfail(char_stringbuf::int_type c); + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::overflow(char_stringbuf::int_type c); + template _UCXXEXPORT char_stringbuf::pos_type + char_stringbuf::seekoff(char_stringbuf::off_type, ios_base::seekdir, ios_base::openmode); + template _UCXXEXPORT char_stringbuf::int_type char_stringbuf::underflow (); + template _UCXXEXPORT streamsize char_stringbuf::xsputn(const char* s, streamsize n); + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT basic_stringstream<char, tr_ch, allocator<char> >::basic_stringstream(ios_base::openmode which); + template _UCXXEXPORT basic_istringstream<char, tr_ch, allocator<char> >::~basic_istringstream(); + template _UCXXEXPORT basic_ostringstream<char, tr_ch, allocator<char> >::~basic_ostringstream(); + template _UCXXEXPORT basic_stringstream<char, tr_ch, allocator<char> >::~basic_stringstream(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + +#endif + +} + + diff --git a/i386/modules/uClibcxx/stack.cpp b/i386/modules/uClibcxx/stack.cpp new file mode 100644 index 0000000..53a21bb --- /dev/null +++ b/i386/modules/uClibcxx/stack.cpp @@ -0,0 +1,27 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <stack> + + +namespace std{ + + + + +} diff --git a/i386/modules/uClibcxx/stdexcept.cpp b/i386/modules/uClibcxx/stdexcept.cpp new file mode 100644 index 0000000..90dccc7 --- /dev/null +++ b/i386/modules/uClibcxx/stdexcept.cpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <exception> +#include <stdexcept> + +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ + +namespace std{ + + _UCXXEXPORT logic_error::logic_error() throw() : mstring(){ + + } + + _UCXXEXPORT logic_error::logic_error(const string& what_arg) : mstring(what_arg){ + + } + + _UCXXEXPORT const char * logic_error::what() const throw(){ + return mstring.c_str(); + } + + + _UCXXEXPORT out_of_range::out_of_range() : logic_error(){ + + } + + _UCXXEXPORT out_of_range::out_of_range(const string & what_arg) : logic_error(what_arg) { + + } + + _UCXXEXPORT runtime_error::runtime_error() : mstring(){ + + } + + _UCXXEXPORT runtime_error::runtime_error(const string& what_arg) : mstring(what_arg){ + + } + + _UCXXEXPORT const char * runtime_error::what() const throw(){ + return mstring.c_str(); + } + +} + +#endif + diff --git a/i386/modules/uClibcxx/streambuf.cpp b/i386/modules/uClibcxx/streambuf.cpp new file mode 100644 index 0000000..5417324 --- /dev/null +++ b/i386/modules/uClibcxx/streambuf.cpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_STREAMBUF__ 1 + +#include <streambuf> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_STREAMBUF_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT streambuf::basic_streambuf(); + template _UCXXEXPORT streambuf::~basic_streambuf(); + +#endif + + template _UCXXEXPORT locale streambuf::pubimbue(const locale &loc); + template _UCXXEXPORT streamsize streambuf::in_avail(); + template _UCXXEXPORT streambuf::int_type streambuf::sbumpc(); + template _UCXXEXPORT streambuf::int_type streambuf::snextc(); + template _UCXXEXPORT streambuf::int_type streambuf::sgetc(); + template _UCXXEXPORT streambuf::int_type streambuf::sputbackc(char_type c); + template _UCXXEXPORT streambuf::int_type streambuf::sungetc(); + template _UCXXEXPORT streambuf::int_type streambuf::sputc(char_type c); + +#endif + + +} + + diff --git a/i386/modules/uClibcxx/string.cpp b/i386/modules/uClibcxx/string.cpp new file mode 100644 index 0000000..1edf69b --- /dev/null +++ b/i386/modules/uClibcxx/string.cpp @@ -0,0 +1,112 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_STRING__ 1 + +#include <basic_definitions> +#include <char_traits> +#include <string> +#include <string_iostream> +#include <string.h> +#include <ostream> + +namespace std{ + +#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT string::basic_string(const allocator<char> &); + template _UCXXEXPORT string::basic_string(size_type n, char c, const allocator<char> & ); + template _UCXXEXPORT string::basic_string(const char* s, const allocator<char>& al); + template _UCXXEXPORT string::basic_string(const basic_string& str, size_type pos, size_type n, const allocator<char>& al); + template _UCXXEXPORT string::~basic_string(); + +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT string & string::append(const char * s, size_type n); + + template _UCXXEXPORT string::size_type string::find(const string & str, size_type pos) const; + template _UCXXEXPORT string::size_type string::find(const char* s, size_type pos) const; + template _UCXXEXPORT string::size_type string::find (char c, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(const string & str, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(char c, size_type pos) const; + template _UCXXEXPORT string::size_type string::rfind(const char* s, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_first_of(const string &, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_of(const char *, size_type pos, size_type n) const; + template _UCXXEXPORT string::size_type string::find_first_of(const char*, size_type pos) const; + template _UCXXEXPORT string::size_type string::find_first_of(char c, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_last_of (const string & , size_type pos) const; + template _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos, size_type n) const; + template _UCXXEXPORT string::size_type string::find_last_of (const char* s, size_type pos) const; + template _UCXXEXPORT string::size_type string::find_last_of (char c, size_type pos) const; + + template _UCXXEXPORT string::size_type string::find_first_not_of(const string &, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(const char*, size_type) const; + template _UCXXEXPORT string::size_type string::find_first_not_of(char c, size_type) const; + + template _UCXXEXPORT int string::compare(const string & str) const; +// template _UCXXEXPORT int string::compare(size_type pos1, size_type n1, const string & str) const; + template _UCXXEXPORT int string::compare( + size_type pos1, size_type n1, const string & str, size_type pos2, size_type n2) const; + + template _UCXXEXPORT string string::substr(size_type pos, size_type n) const; + + template _UCXXEXPORT string & string::operator=(const string & str); + template _UCXXEXPORT string & string::operator=(const char * s); + + template _UCXXEXPORT bool operator==(const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator==(const char * lhs, const string & rhs); + template _UCXXEXPORT bool operator==(const string & lhs, const char * rhs); + + template _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs); + template _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs); + + template _UCXXEXPORT string operator+(const string & lhs, const char* rhs); + template _UCXXEXPORT string operator+(const char* lhs, const string & rhs); + template _UCXXEXPORT string operator+(const string & lhs, const string & rhs); + + template _UCXXEXPORT bool operator> (const string & lhs, const string & rhs); + template _UCXXEXPORT bool operator< (const string & lhs, const string & rhs); + + +//Functions dependent upon OSTREAM +#ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__ + +template _UCXXEXPORT ostream & operator<<(ostream & os, const string & str); + +#endif + + +//Functions dependent upon ISTREAM +#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__ + +template _UCXXEXPORT istream & operator>>(istream & is, string & str); + + +#endif + + +#endif + +} diff --git a/i386/modules/uClibcxx/support.cpp b/i386/modules/uClibcxx/support.cpp new file mode 100644 index 0000000..afae7ac --- /dev/null +++ b/i386/modules/uClibcxx/support.cpp @@ -0,0 +1,54 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <support> +#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__ +extern "C" void *__cxa_allocate_exception(size_t thrown_size) +{ + void * retval; + + /*The amount of data needed is the size of the object *PLUS* + the size of the header. The header is of struct __cxa_exception + The address needs to be adjusted because the pointer we return + should not point to the start of the memory, but to the point + where the object being thrown actually starts*/ + + retval = malloc(thrown_size + sizeof(__cxa_exception)); + +// Check to see that we actuall allocated memory + if(retval == 0){ + std::terminate(); + } + + //Need to do a typecast to char* otherwize we are doing math with + //a void* which makes the compiler cranky (Like me) + return ((char *)retval + sizeof(__cxa_exception)); +} + +extern "C" void __cxa_free_exception(void *thrown_exception){ + + + +} + +extern "C" void __cxa_throw (void *thrown_exception, std::type_info *tinfo,void (*dest) (void *) ){ + +} +#endif + diff --git a/i386/modules/uClibcxx/typeinfo.cpp b/i386/modules/uClibcxx/typeinfo.cpp new file mode 100644 index 0000000..b8ea301 --- /dev/null +++ b/i386/modules/uClibcxx/typeinfo.cpp @@ -0,0 +1,34 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <typeinfo> + +namespace std{ + + _UCXXEXPORT bad_cast::~bad_cast() throw(){ + + } + + _UCXXEXPORT bad_typeid::~bad_typeid() throw(){ + + } + +} + + diff --git a/i386/modules/uClibcxx/uClibc++.c b/i386/modules/uClibcxx/uClibc++.c new file mode 100644 index 0000000..cdc6993 --- /dev/null +++ b/i386/modules/uClibcxx/uClibc++.c @@ -0,0 +1,12 @@ +#include "libsaio.h" + +void uClibcxx_start() +{ +} + +void abort() +{ + stop("uClibc+: abort()\n"); +} + + diff --git a/i386/modules/uClibcxx/utility.cpp b/i386/modules/uClibcxx/utility.cpp new file mode 100644 index 0000000..b2f8995 --- /dev/null +++ b/i386/modules/uClibcxx/utility.cpp @@ -0,0 +1,30 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*/ + + +#include <utility> + + +namespace std{ + + + +} + + diff --git a/i386/modules/uClibcxx/valarray.cpp b/i386/modules/uClibcxx/valarray.cpp new file mode 100644 index 0000000..e4bd504 --- /dev/null +++ b/i386/modules/uClibcxx/valarray.cpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include <valarray> + +namespace std{ + + + + +} + + diff --git a/i386/modules/uClibcxx/vector.cpp b/i386/modules/uClibcxx/vector.cpp new file mode 100644 index 0000000..5ee0de1 --- /dev/null +++ b/i386/modules/uClibcxx/vector.cpp @@ -0,0 +1,83 @@ +/* Copyright (C) 2004 Garrett A. Kajmowicz + + This file is part of the uClibc++ Library. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define __UCLIBCXX_COMPILE_VECTOR__ 1 + + +#include <vector> + +namespace std{ + + +#ifdef __UCLIBCXX_EXPAND_VECTOR_BASIC__ + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + + template _UCXXEXPORT vector<char, allocator<char> >::~vector(); + template _UCXXEXPORT vector<unsigned char, allocator<unsigned char> >::~vector(); + +#endif //__UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned char, allocator<unsigned char> >::reserve(size_type n); + template _UCXXEXPORT void vector<short int, allocator<short int> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned short int, allocator<unsigned short int> >::reserve(size_type n); + template _UCXXEXPORT void vector<int, allocator<int> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::reserve(size_type n); + template _UCXXEXPORT void vector<long int, allocator<long int> >::reserve(size_type n); + template _UCXXEXPORT void vector<unsigned long int, allocator<unsigned long int> >::reserve(size_type n); + template _UCXXEXPORT void vector<float, allocator<float> >::reserve(size_type n); + template _UCXXEXPORT void vector<double, allocator<double> >::reserve(size_type n); + template _UCXXEXPORT void vector<bool, allocator<bool> >::reserve(size_type n); + + template _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + template _UCXXEXPORT void vector<unsigned char, allocator<unsigned char> >::resize(size_type sz, const unsigned char & c); + template _UCXXEXPORT void vector<short int, allocator<short int> >::resize(size_type sz, const short & c); + template _UCXXEXPORT void vector<unsigned short int, allocator<unsigned short int> > + ::resize(size_type sz, const unsigned short int & c); + template _UCXXEXPORT void vector<int, allocator<int> >::resize(size_type sz, const int & c); + template _UCXXEXPORT void vector<unsigned int, allocator<unsigned int> >::resize(size_type sz, const unsigned int & c); + template _UCXXEXPORT void vector<long int, allocator<long int> >::resize(size_type sz, const long int & c); + template _UCXXEXPORT void vector<unsigned long int, allocator<unsigned long int> >:: + resize(size_type sz, const unsigned long int & c); + template _UCXXEXPORT void vector<float, allocator<float> >::resize(size_type sz, const float & c); + template _UCXXEXPORT void vector<double, allocator<double> >::resize(size_type sz, const double & c); + template _UCXXEXPORT void vector<bool, allocator<bool> >::resize(size_type sz, const bool & c); + +#elif defined __UCLIBCXX_EXPAND_STRING_CHAR__ + + +#ifdef __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + template _UCXXEXPORT vector<char, allocator<char> >::vector(const allocator<char>& al); + template _UCXXEXPORT vector<char, allocator<char> >::vector(size_type n, const char & value, const allocator<char> & al); + template _UCXXEXPORT vector<char, allocator<char> >::~vector(); +#endif // __UCLIBCXX_EXPAND_CONSTRUCTORS_DESTRUCTORS__ + + template _UCXXEXPORT void vector<char, allocator<char> >::reserve(size_type n); + template _UCXXEXPORT void vector<char, allocator<char> >::resize(size_type sz, const char & c); + +#endif + + + + +} diff --git a/i386/util/.svn/all-wcprops b/i386/util/.svn/all-wcprops new file mode 100644 index 0000000..44a182f --- /dev/null +++ b/i386/util/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 55 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util +END +dyldsymboltool.c +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/dyldsymboltool.c +END +bdmesg.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/bdmesg.c +END +openUp.c +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/openUp.c +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/Cconfig +END +segsize.c +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/segsize.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/Makefile +END +machOconv.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/machOconv.c +END diff --git a/i386/util/.svn/entries b/i386/util/.svn/entries new file mode 100644 index 0000000..910e843 --- /dev/null +++ b/i386/util/.svn/entries @@ -0,0 +1,269 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/util +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +fdisk +dir + +dyldsymboltool.c +file + + + + +2013-08-27T23:55:06.000000Z +5303a8a0c61327baab05bf8a4f1469d2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5777 + +bdmesg.c +file + + + + +2013-08-27T23:55:06.000000Z +4345891b98c2452bf27b3203e8db069e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +826 + +openUp.c +file + + + + +2013-08-27T23:55:06.000000Z +0cbbae29fee0ff5451f38541323caa55 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2387 + +Cconfig +file + + + + +2013-08-27T23:55:06.000000Z +71b485882a9f5402456e4e57a10d22e9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +464 + +segsize.c +file + + + + +2013-08-27T23:55:06.000000Z +7459088806363d7bbb97a1167144a76b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3077 + +Makefile +file + + + + +2013-08-27T23:55:06.000000Z +fdfd4bea9f0644791c8c5171ad1ecda0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1761 + +machOconv.c +file + + + + +2013-08-27T23:55:06.000000Z +f44a7cbccfd771668dcbfd0c50b87084 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4508 + diff --git a/i386/util/.svn/text-base/Cconfig.svn-base b/i386/util/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..8454f1d --- /dev/null +++ b/i386/util/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,18 @@ +config BDMESG + bool "bdmesg utility" + default y + help + Say Y here if you want to compile the bdmesg utility. + bdmesg is used to dump any messages thrown during the + chameleon boot sequence. + When in doubt, say "Y". + +source "i386/util/fdisk/Cconfig" + +config OPENUP + bool "openUp utility" + default n + help + Say Y here if you want to compile the openUp utility. + openUp is used to set the "first-open-window" field of a volume. + When in doubt, say "N". diff --git a/i386/util/.svn/text-base/Makefile.svn-base b/i386/util/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..d89873a --- /dev/null +++ b/i386/util/.svn/text-base/Makefile.svn-base @@ -0,0 +1,60 @@ +# +# Until I can remove the dependency on the appkit, +# we'll just keep the generated files in this directory +# and install them directly, rather than generating them again. +# +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/util +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + + +DIR = util +include ${SRCROOT}/Make.rules + +PROGRAMS = machOconv dyldsymboltool segsize +OBJS = dyldsymboltool.o32 dyldsymboltool.o64 machOconv.o32 machOconv.o64 segsize.o32 segsize.o64 + + +ifeq (${CONFIG_BDMESG}, y) +PROGRAMS += bdmesg +OBJS += bdmesg.o32 bdmesg.o64 +endif + +ifeq (${CONFIG_OPENUP}, y) +PROGRAMS += openUp +OBJS += openUp.o64 openUp.o32 +endif + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +LDFLAGS := $(LDFALGS) -framework IOKit -framework CoreFoundation -mmacosx-version-min=10.5 + +SYMPROG = $(addprefix $(SYMROOT)/, $(PROGRAMS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +SUBDIRS = fdisk + +all: $(DIRS_NEEDED) $(SYMPROG) all-recursive + +$(SYMPROG): $(OBJS) + @echo "\t[LD32] $(@F)_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32 + @echo "\t[LD64] $(@F)_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64 + @echo "\t[LIPO] $(@F)" + @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 -output $(SYMROOT)/$(@F) + @$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64 + +#dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for p in $(SYMPROG); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @rm -f $(SYMPROG) $(OBJS) diff --git a/i386/util/.svn/text-base/bdmesg.c.svn-base b/i386/util/.svn/text-base/bdmesg.c.svn-base new file mode 100644 index 0000000..6ce5b48 --- /dev/null +++ b/i386/util/.svn/text-base/bdmesg.c.svn-base @@ -0,0 +1,38 @@ +/* + * BooterLog Dump Tool, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include <stdio.h> +#include <stdint.h> +#include <string.h> +#include <stdlib.h> + +#include "IOKit/IOKitLib.h" + + +int main(int argc, char *argv[]) +{ + io_registry_entry_t root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/"); + if (!root) + { + printf("IORegistryEntry \"IOIOService:/\" not found.\n"); + return 0; + } + + CFTypeRef bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0); + if (!bootLog) + { + printf("\"boot-log\" property not found.\n"); + return 0; + } + //CFShow(bootLog); + const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog); + if (msglog) + printf("%s\n", msglog); + + return 0; +} + diff --git a/i386/util/.svn/text-base/dyldsymboltool.c.svn-base b/i386/util/.svn/text-base/dyldsymboltool.c.svn-base new file mode 100644 index 0000000..b7a706c --- /dev/null +++ b/i386/util/.svn/text-base/dyldsymboltool.c.svn-base @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010 Evan Lojewski. All rights reserved. + * + * dyldsymboltool + * + * Generates a dylib file for the dyld implimentation in chameleon + * to load and link. This is used to import the boot symbols into the + * module system. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <mach/mach.h> +#include <sys/file.h> +#include <mach-o/loader.h> +#include <mach-o/nlist.h> + + +#define DYLIB_NAME "Symbols" +#define VOID_SYMBOL "_load_all_modules" +#define START_SYMBOL "start" + +typedef struct symbols_dylib +{ + struct mach_header header; + struct dylib_command dylib_info; + char module_name[sizeof(DYLIB_NAME)]; + struct symtab_command symtab; +} symbols_dylib_t; + + +typedef struct symbolList_t +{ + char* name; + uint32_t addr; + int pos; + struct symbolList_t* next; +} symbolList_t; + + +int num_symbols(symbolList_t* list); +int string_size(symbolList_t* list); +void add_symbol(symbolList_t** list, char* name, uint32_t addr); + + +int main(int argc, char *argv[]) +{ + if(argc < 3) + { + fprintf(stderr, "usage: dyldsymboltool obj1 [obj2 ...] outfile\n"); + + exit(-1); + } + + + + symbols_dylib_t dylib; + symbolList_t* symbols = NULL; + + uint32_t start_addr = 0; + + + + + int i; + for(i = 1; i < argc-1; i++) + { + char line[256]; + char* command = malloc(strlen(argv[1]) + sizeof("nm -g ")); + FILE *fpipe; + + // Parse boot.sys (arg1) to get symtab + sprintf(command, "nm -g %s", argv[i]); // TODO: read boot.sym directly, no need for nm + + if ( !(fpipe = (FILE*)popen(command,"r")) ) + { // If fpipe is NULL + perror("Problems with pipe"); + exit(1); + } + + + while ( fgets( line, sizeof line, fpipe)) + { + if((strlen(line) < strlen(argv[i]) || + strncmp(line, argv[i], strlen(argv[i])) != 0) + && line[0] != ' ') + { + uint32_t address = 0; + char* addr = strtok(line, " "); + strtok(NULL, " "); + char* name = strtok(NULL, " "); + name[strlen(name)-1] = 0; // remove newline + sscanf(addr, "%x", &address); + if(strcmp(name, VOID_SYMBOL) == 0) + { + start_addr = address; + } + if(strcmp(name, START_SYMBOL) == 0) + { + if(!start_addr) start_addr = address; + } + else add_symbol(&symbols, name, address); + } + } + + pclose(fpipe); + + free(command); + } + + + + if(start_addr == 0) + { + fprintf(stderr, "Unable to locate Symbol.dylib start function\n"); + + //exit(1); + } + else + { + add_symbol(&symbols, START_SYMBOL, start_addr); + } + + /* Header command info */ + dylib.header.ncmds = 2; + dylib.header.sizeofcmds = sizeof(dylib) - sizeof(struct mach_header);// + dylib.symtab.nsyms * sizeof(struct nlist) + dylib.symtab.strsize; + + dylib.header.magic = MH_MAGIC; + dylib.header.cputype = CPU_TYPE_X86; + dylib.header.cpusubtype = /*CPUSUBTYPE_I386*/ 3; + dylib.header.filetype = MH_DYLIB; + dylib.header.flags = MH_NOUNDEFS | MH_DYLDLINK | MH_NO_REEXPORTED_DYLIBS; + + /* Load Commands - dylib id */ + dylib.dylib_info.cmd = LC_ID_DYLIB; + dylib.dylib_info.cmdsize = sizeof(struct dylib_command) + sizeof(dylib.module_name); // todo: verify + dylib.dylib_info.dylib.name.offset = sizeof(struct dylib_command); + dylib.dylib_info.dylib.timestamp = 0; // TODO: populate with time + dylib.dylib_info.dylib.current_version = 0; // TODO + dylib.dylib_info.dylib.compatibility_version = 0; // TODO + + + //int offset = dylib.dylib_info.cmdsize%4 ? 4 - (dylib.dylib_info.cmdsize % 4) : 0; + //dylib.dylib_info.cmdsize += offset; + //dylib.header.sizeofcmds += offset; + + sprintf(dylib.module_name, "%s", DYLIB_NAME); + + /* Load Commands - Symtable */ + dylib.symtab.cmd = LC_SYMTAB; + dylib.symtab.symoff = sizeof(dylib); + dylib.symtab.nsyms = num_symbols(symbols); + dylib.symtab.stroff = sizeof(dylib) + dylib.symtab.nsyms * sizeof(struct nlist); + dylib.symtab.strsize = string_size(symbols); + dylib.symtab.cmdsize = sizeof(struct symtab_command); + + + + FILE* outfile = fopen(argv[argc-1], "w"); + fwrite(&dylib, sizeof(dylib) /* Sizeof header + module name */ + , 1, outfile); + + char* symtab = malloc(dylib.symtab.stroff + dylib.symtab.strsize - sizeof(dylib) + 1); // Add extra 1 for last symbol + bzero(symtab, dylib.symtab.nsyms * sizeof(struct nlist) + dylib.symtab.strsize + 1); + char* orig = symtab; + + //symtab += offset; + + + while(symbols) + { + + ((struct nlist*)symtab)->n_un.n_strx = symbols->pos; + ((struct nlist*)symtab)->n_type = 0xF; // TODO: read from boot.sys + ((struct nlist*)symtab)->n_sect = 0; + ((struct nlist*)symtab)->n_desc = REFERENCE_FLAG_DEFINED; + ((struct nlist*)symtab)->n_value = (uint32_t)symbols->addr; + symtab+= sizeof(struct nlist); + + strcpy(orig + dylib.symtab.stroff - sizeof(dylib) + symbols->pos, symbols->name); + + symbols = symbols->next; + } + + fwrite(orig, + dylib.symtab.stroff + // Sizeof symbol nlists + dylib.symtab.strsize - sizeof(dylib) + 1 // sizeof symbol strings + , 1, outfile); + + + fclose(outfile); + + exit(0); +} + +int num_symbols(symbolList_t* list) +{ + int retVal = 0; + while(list) + { + retVal++; + list = list->next; + } + return retVal; +} + +int string_size(symbolList_t* list) +{ + int retVal = 0; + while(list) + { + retVal += strlen(list->name)+1; + list = list->next; + } + return retVal; + +} + +void add_symbol(symbolList_t** list, char* name, uint32_t addr) +{ + symbolList_t* entry = malloc(sizeof(symbolList_t)); + entry->next = (*list); + + if(*list) entry->pos = (*list)->pos + strlen((*list)->name) + 1; + else entry->pos = 1; + *list = entry; + + entry->addr = addr; + entry->name = malloc(strlen(name)+1); + strcpy(entry->name, name); +} diff --git a/i386/util/.svn/text-base/machOconv.c.svn-base b/i386/util/.svn/text-base/machOconv.c.svn-base new file mode 100644 index 0000000..540efe3 --- /dev/null +++ b/i386/util/.svn/text-base/machOconv.c.svn-base @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <sys/file.h> +#include <mach-o/loader.h> +#include <libkern/OSByteOrder.h> +#include <unistd.h> + +int infile, outfile; + +struct mach_header mh; +void * cmds; + +static bool swap_ends; + +static unsigned long swap(unsigned long x) +{ + if (swap_ends) return OSSwapInt32(x); + else return x; +} + +int +main(int argc, char *argv[]) +{ + kern_return_t result; + vm_address_t data; + int nc, ncmds; + char * cp; + + if (argc == 2) + { + infile = open(argv[1], O_RDONLY); + if (infile < 0) goto usage; + outfile = fileno(stdout); + } + else if (argc == 3) + { + infile = open(argv[1], O_RDONLY); + if (infile < 0) goto usage; + outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (outfile < 0) goto usage; + } + else + { + usage: + fprintf(stderr, "usage: machOconv inputfile [outputfile]\n"); + exit(1); + } + + nc = read(infile, &mh, sizeof (mh)); + if (nc < 0) + { + perror("read mach header"); + exit(1); + } + + if (nc < (int)sizeof (mh)) + { + fprintf(stderr, "read mach header: premature EOF %d\n", nc); + exit(1); + } + + + if (mh.magic == MH_MAGIC) swap_ends = false; + else if (mh.magic == MH_CIGAM) swap_ends = true; + else + { + fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); + exit(1); + } + + cmds = calloc(swap(mh.sizeofcmds), sizeof (char)); + if (cmds == 0) + { + fprintf(stderr, "alloc load commands: no memory\n"); + exit(1); + } + nc = read(infile, cmds, swap(mh.sizeofcmds)); + if (nc < 0) + { + perror("read load commands"); + exit(1); + } + if (nc < (int)swap(mh.sizeofcmds)) + { + fprintf(stderr, "read load commands: premature EOF %d\n", nc); + exit(1); + } + + unsigned long vmstart = (unsigned long)-1; + + // First pass: determine actual load address + for (ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) + { +#define lcp ((struct load_command *)cp) +#define scp ((struct segment_command *)cp) + + switch(swap(lcp->cmd)) + { + case LC_SEGMENT: + if(vmstart > swap(scp->vmaddr)) + { + vmstart = swap(scp->vmaddr); + } + } + cp += swap(lcp->cmdsize); + + } + + // Second pass: output to file. + for (ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) + { +#define lcp ((struct load_command *)cp) +#define scp ((struct segment_command *)cp) + + bool isDATA; + unsigned vmsize; + + switch(swap(lcp->cmd)) + { + case LC_SEGMENT: + isDATA = (strcmp(scp->segname, "__DATA") == 0); + if (isDATA) + { + vmsize = swap(scp->filesize); + } + else + { + vmsize = swap(scp->vmsize); + } + + result = vm_allocate(mach_task_self(), &data, vmsize, true); + if (result != KERN_SUCCESS) { + mach_error("vm_allocate segment data", result); + exit(1); + } + + lseek(infile, swap(scp->fileoff), L_SET); + nc = read(infile, (void *)data, swap(scp->filesize)); + if (nc < 0) { + perror("read segment data"); + exit(1); + } + if (nc < (int)swap(scp->filesize)) { + fprintf(stderr, "read segment data: premature EOF %d\n", nc); + exit(1); + } + + lseek(outfile, swap(scp->vmaddr) - vmstart, L_SET); + nc = write(outfile, (void *)data, vmsize); + if (nc < (int)vmsize) { + perror("write segment data"); + exit(1); + } + + vm_deallocate(mach_task_self(), data, vmsize); + break; + } + + cp += swap(lcp->cmdsize); + } + + exit(0); +} diff --git a/i386/util/.svn/text-base/openUp.c.svn-base b/i386/util/.svn/text-base/openUp.c.svn-base new file mode 100644 index 0000000..a95e0a6 --- /dev/null +++ b/i386/util/.svn/text-base/openUp.c.svn-base @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Shantonu Sen <<EMAIL REMOVED>> + * openUp.c - program to set the "first-open-window" field of a volume + * + * Get the directory ID for the first argument, and set it as word 2 + * of the Finder Info fields for the volume it lives on + * + * cc -o openUp openUp.c + * Usage: openUp /Volumes/Foo/OpenMe/ + * + */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/attr.h> +#include <sys/stat.h> +#include <sys/mount.h> +#include <memory.h> + +struct directoryinfo { + long unsigned length; + uintptr_t dirid; // changed from: u_int32_t dirid; +}; + +struct volumeinfo { + long unsigned length; + uintptr_t finderinfo[8]; // changed from: u_int32_t finderinfo[8]; +}; + + +int main(int argc, char *argv[]) { + char *path = NULL; + struct attrlist alist; + struct directoryinfo dirinfo; + struct volumeinfo volinfo; + struct statfs sfs; + + path = argv[1]; + + bzero(&alist, sizeof(alist)); + alist.bitmapcount = 5; + alist.commonattr = ATTR_CMN_OBJID; + + getattrlist(path, &alist, &dirinfo, sizeof(dirinfo), 0); + + printf("directory id: %lu\n", dirinfo.dirid); + + statfs(path, &sfs); + + printf("mountpoint: %s\n", sfs.f_mntonname); + + alist.commonattr = ATTR_CMN_FNDRINFO; + alist.volattr = ATTR_VOL_INFO; + + getattrlist(sfs.f_mntonname, &alist, &volinfo, sizeof(volinfo), 0); + volinfo.finderinfo[2] = dirinfo.dirid; + setattrlist(sfs.f_mntonname, &alist, volinfo.finderinfo, sizeof(volinfo.finderinfo), 0); + + return EXIT_SUCCESS; +} diff --git a/i386/util/.svn/text-base/segsize.c.svn-base b/i386/util/.svn/text-base/segsize.c.svn-base new file mode 100644 index 0000000..592878a --- /dev/null +++ b/i386/util/.svn/text-base/segsize.c.svn-base @@ -0,0 +1,128 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <sys/file.h> +#include <mach-o/loader.h> +#include <libkern/OSByteOrder.h> +#include <unistd.h> + +int infile; + +struct mach_header mh; +void * cmds; + +static bool swap_ends; + +static unsigned long swap( + unsigned long x + ) +{ + if (swap_ends) + return OSSwapInt32(x); + else + return x; +} + +int +main(int argc, char *argv[]) +{ + int nc, ncmds; + char * cp; + + if (argc == 3) { + infile = open(argv[1], O_RDONLY); + if (infile < 0) + goto usage; + } + else { + usage: + fprintf(stderr, "usage: segsize segment\n"); + exit(1); + } + + nc = read(infile, &mh, sizeof (mh)); + if (nc < 0) { + perror("read mach header"); + exit(1); + } + if (nc < (int)sizeof (mh)) { + fprintf(stderr, "read mach header: premature EOF %d\n", nc); + exit(1); + } + if (mh.magic == MH_MAGIC) + swap_ends = false; + else if (mh.magic == MH_CIGAM) + swap_ends = true; + else { + fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); + exit(1); + } + + cmds = calloc(swap(mh.sizeofcmds), sizeof (char)); + if (cmds == 0) { + fprintf(stderr, "alloc load commands: no memory\n"); + exit(1); + } + nc = read(infile, cmds, swap(mh.sizeofcmds)); + if (nc < 0) { + perror("read load commands"); + exit(1); + } + if (nc < (int)swap(mh.sizeofcmds)) { + fprintf(stderr, "read load commands: premature EOF %d\n", nc); + exit(1); + } + + for ( ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) { +// bool isDATA; +// unsigned vmsize; + +#define lcp ((struct load_command *)cp) + switch(swap(lcp->cmd)) { + + case LC_SEGMENT: +#define scp ((struct segment_command *)cp) + if(strcmp(scp->segname, argv[2]) == 0) + { + printf("%ld\n", swap(scp->vmsize)); +#if 0 + if (isDATA) + vmsize = swap(scp->filesize); + else + vmsize = swap(scp->vmsize); +#endif + } + break; + } + + cp += swap(lcp->cmdsize); + } + + exit(0); +} diff --git a/i386/util/Cconfig b/i386/util/Cconfig new file mode 100644 index 0000000..8454f1d --- /dev/null +++ b/i386/util/Cconfig @@ -0,0 +1,18 @@ +config BDMESG + bool "bdmesg utility" + default y + help + Say Y here if you want to compile the bdmesg utility. + bdmesg is used to dump any messages thrown during the + chameleon boot sequence. + When in doubt, say "Y". + +source "i386/util/fdisk/Cconfig" + +config OPENUP + bool "openUp utility" + default n + help + Say Y here if you want to compile the openUp utility. + openUp is used to set the "first-open-window" field of a volume. + When in doubt, say "N". diff --git a/i386/util/Makefile b/i386/util/Makefile new file mode 100644 index 0000000..d89873a --- /dev/null +++ b/i386/util/Makefile @@ -0,0 +1,60 @@ +# +# Until I can remove the dependency on the appkit, +# we'll just keep the generated files in this directory +# and install them directly, rather than generating them again. +# +SRCROOT = $(abspath $(CURDIR)/../..) +OBJROOT = $(SRCROOT)/obj/i386/util +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + + +DIR = util +include ${SRCROOT}/Make.rules + +PROGRAMS = machOconv dyldsymboltool segsize +OBJS = dyldsymboltool.o32 dyldsymboltool.o64 machOconv.o32 machOconv.o64 segsize.o32 segsize.o64 + + +ifeq (${CONFIG_BDMESG}, y) +PROGRAMS += bdmesg +OBJS += bdmesg.o32 bdmesg.o64 +endif + +ifeq (${CONFIG_OPENUP}, y) +PROGRAMS += openUp +OBJS += openUp.o64 openUp.o32 +endif + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +LDFLAGS := $(LDFALGS) -framework IOKit -framework CoreFoundation -mmacosx-version-min=10.5 + +SYMPROG = $(addprefix $(SYMROOT)/, $(PROGRAMS)) + +DIRS_NEEDED = $(OBJROOT) $(SYMROOT) + +SUBDIRS = fdisk + +all: $(DIRS_NEEDED) $(SYMPROG) all-recursive + +$(SYMPROG): $(OBJS) + @echo "\t[LD32] $(@F)_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32 + @echo "\t[LD64] $(@F)_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64 + @echo "\t[LIPO] $(@F)" + @lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 -output $(SYMROOT)/$(@F) + @$(RM) $(SYMROOT)/$(@F)_32 $(SYMROOT)/$(@F)_64 + +#dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @for p in $(SYMPROG); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @rm -f $(SYMPROG) $(OBJS) diff --git a/i386/util/bdmesg.c b/i386/util/bdmesg.c new file mode 100644 index 0000000..6ce5b48 --- /dev/null +++ b/i386/util/bdmesg.c @@ -0,0 +1,38 @@ +/* + * BooterLog Dump Tool, part of the Chameleon Boot Loader Project + * + * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved. + * + */ + +#include <stdio.h> +#include <stdint.h> +#include <string.h> +#include <stdlib.h> + +#include "IOKit/IOKitLib.h" + + +int main(int argc, char *argv[]) +{ + io_registry_entry_t root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/"); + if (!root) + { + printf("IORegistryEntry \"IOIOService:/\" not found.\n"); + return 0; + } + + CFTypeRef bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0); + if (!bootLog) + { + printf("\"boot-log\" property not found.\n"); + return 0; + } + //CFShow(bootLog); + const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog); + if (msglog) + printf("%s\n", msglog); + + return 0; +} + diff --git a/i386/util/dyldsymboltool.c b/i386/util/dyldsymboltool.c new file mode 100644 index 0000000..b7a706c --- /dev/null +++ b/i386/util/dyldsymboltool.c @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2010 Evan Lojewski. All rights reserved. + * + * dyldsymboltool + * + * Generates a dylib file for the dyld implimentation in chameleon + * to load and link. This is used to import the boot symbols into the + * module system. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <mach/mach.h> +#include <sys/file.h> +#include <mach-o/loader.h> +#include <mach-o/nlist.h> + + +#define DYLIB_NAME "Symbols" +#define VOID_SYMBOL "_load_all_modules" +#define START_SYMBOL "start" + +typedef struct symbols_dylib +{ + struct mach_header header; + struct dylib_command dylib_info; + char module_name[sizeof(DYLIB_NAME)]; + struct symtab_command symtab; +} symbols_dylib_t; + + +typedef struct symbolList_t +{ + char* name; + uint32_t addr; + int pos; + struct symbolList_t* next; +} symbolList_t; + + +int num_symbols(symbolList_t* list); +int string_size(symbolList_t* list); +void add_symbol(symbolList_t** list, char* name, uint32_t addr); + + +int main(int argc, char *argv[]) +{ + if(argc < 3) + { + fprintf(stderr, "usage: dyldsymboltool obj1 [obj2 ...] outfile\n"); + + exit(-1); + } + + + + symbols_dylib_t dylib; + symbolList_t* symbols = NULL; + + uint32_t start_addr = 0; + + + + + int i; + for(i = 1; i < argc-1; i++) + { + char line[256]; + char* command = malloc(strlen(argv[1]) + sizeof("nm -g ")); + FILE *fpipe; + + // Parse boot.sys (arg1) to get symtab + sprintf(command, "nm -g %s", argv[i]); // TODO: read boot.sym directly, no need for nm + + if ( !(fpipe = (FILE*)popen(command,"r")) ) + { // If fpipe is NULL + perror("Problems with pipe"); + exit(1); + } + + + while ( fgets( line, sizeof line, fpipe)) + { + if((strlen(line) < strlen(argv[i]) || + strncmp(line, argv[i], strlen(argv[i])) != 0) + && line[0] != ' ') + { + uint32_t address = 0; + char* addr = strtok(line, " "); + strtok(NULL, " "); + char* name = strtok(NULL, " "); + name[strlen(name)-1] = 0; // remove newline + sscanf(addr, "%x", &address); + if(strcmp(name, VOID_SYMBOL) == 0) + { + start_addr = address; + } + if(strcmp(name, START_SYMBOL) == 0) + { + if(!start_addr) start_addr = address; + } + else add_symbol(&symbols, name, address); + } + } + + pclose(fpipe); + + free(command); + } + + + + if(start_addr == 0) + { + fprintf(stderr, "Unable to locate Symbol.dylib start function\n"); + + //exit(1); + } + else + { + add_symbol(&symbols, START_SYMBOL, start_addr); + } + + /* Header command info */ + dylib.header.ncmds = 2; + dylib.header.sizeofcmds = sizeof(dylib) - sizeof(struct mach_header);// + dylib.symtab.nsyms * sizeof(struct nlist) + dylib.symtab.strsize; + + dylib.header.magic = MH_MAGIC; + dylib.header.cputype = CPU_TYPE_X86; + dylib.header.cpusubtype = /*CPUSUBTYPE_I386*/ 3; + dylib.header.filetype = MH_DYLIB; + dylib.header.flags = MH_NOUNDEFS | MH_DYLDLINK | MH_NO_REEXPORTED_DYLIBS; + + /* Load Commands - dylib id */ + dylib.dylib_info.cmd = LC_ID_DYLIB; + dylib.dylib_info.cmdsize = sizeof(struct dylib_command) + sizeof(dylib.module_name); // todo: verify + dylib.dylib_info.dylib.name.offset = sizeof(struct dylib_command); + dylib.dylib_info.dylib.timestamp = 0; // TODO: populate with time + dylib.dylib_info.dylib.current_version = 0; // TODO + dylib.dylib_info.dylib.compatibility_version = 0; // TODO + + + //int offset = dylib.dylib_info.cmdsize%4 ? 4 - (dylib.dylib_info.cmdsize % 4) : 0; + //dylib.dylib_info.cmdsize += offset; + //dylib.header.sizeofcmds += offset; + + sprintf(dylib.module_name, "%s", DYLIB_NAME); + + /* Load Commands - Symtable */ + dylib.symtab.cmd = LC_SYMTAB; + dylib.symtab.symoff = sizeof(dylib); + dylib.symtab.nsyms = num_symbols(symbols); + dylib.symtab.stroff = sizeof(dylib) + dylib.symtab.nsyms * sizeof(struct nlist); + dylib.symtab.strsize = string_size(symbols); + dylib.symtab.cmdsize = sizeof(struct symtab_command); + + + + FILE* outfile = fopen(argv[argc-1], "w"); + fwrite(&dylib, sizeof(dylib) /* Sizeof header + module name */ + , 1, outfile); + + char* symtab = malloc(dylib.symtab.stroff + dylib.symtab.strsize - sizeof(dylib) + 1); // Add extra 1 for last symbol + bzero(symtab, dylib.symtab.nsyms * sizeof(struct nlist) + dylib.symtab.strsize + 1); + char* orig = symtab; + + //symtab += offset; + + + while(symbols) + { + + ((struct nlist*)symtab)->n_un.n_strx = symbols->pos; + ((struct nlist*)symtab)->n_type = 0xF; // TODO: read from boot.sys + ((struct nlist*)symtab)->n_sect = 0; + ((struct nlist*)symtab)->n_desc = REFERENCE_FLAG_DEFINED; + ((struct nlist*)symtab)->n_value = (uint32_t)symbols->addr; + symtab+= sizeof(struct nlist); + + strcpy(orig + dylib.symtab.stroff - sizeof(dylib) + symbols->pos, symbols->name); + + symbols = symbols->next; + } + + fwrite(orig, + dylib.symtab.stroff + // Sizeof symbol nlists + dylib.symtab.strsize - sizeof(dylib) + 1 // sizeof symbol strings + , 1, outfile); + + + fclose(outfile); + + exit(0); +} + +int num_symbols(symbolList_t* list) +{ + int retVal = 0; + while(list) + { + retVal++; + list = list->next; + } + return retVal; +} + +int string_size(symbolList_t* list) +{ + int retVal = 0; + while(list) + { + retVal += strlen(list->name)+1; + list = list->next; + } + return retVal; + +} + +void add_symbol(symbolList_t** list, char* name, uint32_t addr) +{ + symbolList_t* entry = malloc(sizeof(symbolList_t)); + entry->next = (*list); + + if(*list) entry->pos = (*list)->pos + strlen((*list)->name) + 1; + else entry->pos = 1; + *list = entry; + + entry->addr = addr; + entry->name = malloc(strlen(name)+1); + strcpy(entry->name, name); +} diff --git a/i386/util/fdisk/.svn/all-wcprops b/i386/util/fdisk/.svn/all-wcprops new file mode 100644 index 0000000..7dfa59c --- /dev/null +++ b/i386/util/fdisk/.svn/all-wcprops @@ -0,0 +1,137 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk +END +disk.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/disk.h +END +misc.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/misc.h +END +fdisk.c +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/fdisk.c +END +opendev.c +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/opendev.c +END +cmd.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/cmd.c +END +part.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/part.c +END +cmd.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/cmd.h +END +auto.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/auto.c +END +part.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/part.h +END +auto.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/auto.h +END +user.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/user.c +END +mbrcode.h +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/mbrcode.h +END +mbr.c +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/mbr.c +END +util.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/util.h +END +getrawpartition.c +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/getrawpartition.c +END +user.h +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/user.h +END +mbr.h +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/mbr.h +END +fdisk.8 +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/fdisk.8 +END +Cconfig +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/Cconfig +END +disk.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/disk.c +END +misc.c +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/misc.c +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/i386/util/fdisk/Makefile +END diff --git a/i386/util/fdisk/.svn/entries b/i386/util/fdisk/.svn/entries new file mode 100644 index 0000000..3dfa518 --- /dev/null +++ b/i386/util/fdisk/.svn/entries @@ -0,0 +1,776 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/i386/util/fdisk +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +disk.h +file + + + + +2013-08-27T23:55:06.000000Z +5782b00372d0836f46d6a08ab825012f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3468 + +misc.h +file + + + + +2013-08-27T23:55:06.000000Z +01d069ed478af4e88aad747f08b0f02a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3114 + +fdisk.c +file + + + + +2013-08-27T23:55:06.000000Z +c32a03c91a675d75b87a7263dd156ea3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8239 + +opendev.c +file + + + + +2013-08-27T23:55:06.000000Z +2c3a9be68a3bf1e74340dba24ebce1bd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3639 + +cmd.c +file + + + + +2013-08-27T23:55:06.000000Z +b3ec8978861a9c85eea9452041c8d89b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +11344 + +part.c +file + + + + +2013-08-27T23:55:06.000000Z +84c89fadeaf7798960e14fd9178d1707 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +13258 + +cmd.h +file + + + + +2013-08-27T23:55:06.000000Z +6be8b4b84e98d0311bd8474423a52a30 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4155 + +auto.c +file + + + + +2013-08-27T23:55:06.000000Z +1ad7c722c4d8fca9301d4651aceb4612 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5042 + +part.h +file + + + + +2013-08-27T23:55:06.000000Z +4bc3fcac0982c2160b2635e850376eb7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3265 + +auto.h +file + + + + +2013-08-27T23:55:06.000000Z +101a61694405149ccae255a321579828 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1144 + +user.c +file + + + + +2013-08-27T23:55:06.000000Z +a4290ec7dd447a004b0cfee1765c89c1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +7856 + +mbrcode.h +file + + + + +2013-08-27T23:55:06.000000Z +d06c7d7de71e5d5b97b97862ac81eba7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5802 + +mbr.c +file + + + + +2013-08-27T23:55:06.000000Z +b26159c0ff7a4e3eb75086daaf8e2a73 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12929 + +util.h +file + + + + +2013-08-27T23:55:06.000000Z +6d3c189df55daabdb7b692582b370fcc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5300 + +user.h +file + + + + +2013-08-27T23:55:06.000000Z +09f8ad47cce699e14968a0a4c02508ea +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2908 + +getrawpartition.c +file + + + + +2013-08-27T23:55:06.000000Z +1324d9439f6bb95d0ee624800cd98b0e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3401 + +mbr.h +file + + + + +2013-08-27T23:55:06.000000Z +0001276e3131371e3abb68074196ca84 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4584 + +fdisk.8 +file + + + + +2013-08-27T23:55:06.000000Z +7d171d444f25c4ed5ead82ec629fc9c0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +12571 + +Cconfig +file + + + + +2013-08-27T23:55:06.000000Z +8684eec1c12893214756c9ac3d576b3b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +286 + +disk.c +file + + + + +2013-08-27T23:55:06.000000Z +d0be9bec178ccd4a1b913de8d970206d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +8093 + +misc.c +file + + + + +2013-08-27T23:55:06.000000Z +cba9310221e90bac4e87c5678d4d3e1c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4924 + +Makefile +file + + + + +2013-08-27T23:55:06.000000Z +c20c8ba039e47703531a566ee6ccfa92 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1359 + diff --git a/i386/util/fdisk/.svn/text-base/Cconfig.svn-base b/i386/util/fdisk/.svn/text-base/Cconfig.svn-base new file mode 100644 index 0000000..bd9129f --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/Cconfig.svn-base @@ -0,0 +1,7 @@ +config FDISK440 + bool "fdisk440 utility" + default y + help + Say Y here if you want to compile the fdisk440 utility. + fdisk440 is used to update the boot0 file on the partition by replacing the first 440 bytes, instead of the first 446 bytes as with fdisk. + When in doubt, say "Y". diff --git a/i386/util/fdisk/.svn/text-base/Makefile.svn-base b/i386/util/fdisk/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..5d0a4a2 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/Makefile.svn-base @@ -0,0 +1,53 @@ +SRCROOT = $(abspath $(CURDIR)/../../..) +OBJROOT = $(SRCROOT)/obj/i386/util/fdisk +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + + +DIR = fdisk + +include ${SRCROOT}/Make.rules + + +LDFLAGS := $(LDFALGS) -mmacosx-version-min=10.5 + + +OBJS = cmd.o32 disk.o32 fdisk.o32 getrawpartition.o32 mbr.o32 misc.o32 opendev.o32 part.o32 user.o32 auto.o32 \ + cmd.o64 disk.o64 fdisk.o64 getrawpartition.o64 mbr.o64 misc.o64 opendev.o64 part.o64 user.o64 auto.o64 + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +PROGRAM = fdisk440 +PROGRAM:= $(addprefix $(SYMROOT)/, $(PROGRAM)) + +ifeq ($(CONFIG_FDISK440),y) + +all: $(SYMROOT) $(OBJROOT) $(PROGRAM) + +$(PROGRAM): $(OBJS) + @echo "\t[LD32] $@_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $@_32 $(filter %.o32,$^) + @echo "\t[LD64] $@_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $@_64 $(filter %.o64,$^) + @echo "\t[LIPO] $@" + @lipo -create -arch i386 $@_32 -arch x86_64 $@_64 -output $@ + @rm $@_32 $@_64 + +else + +all: + +endif + + +#dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(PROGRAM) $(OBJS) diff --git a/i386/util/fdisk/.svn/text-base/auto.c.svn-base b/i386/util/fdisk/.svn/text-base/auto.c.svn-base new file mode 100644 index 0000000..c641c55 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/auto.c.svn-base @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Auto partitioning code. + */ + +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <err.h> +#include "disk.h" +#include "mbr.h" +#include "auto.h" + +int AUTO_boothfs __P((disk_t *, mbr_t *)); +int AUTO_bootufs __P((disk_t *, mbr_t *)); +int AUTO_hfs __P((disk_t *, mbr_t *)); +int AUTO_ufs __P((disk_t *, mbr_t *)); +int AUTO_dos __P((disk_t *, mbr_t *)); +int AUTO_raid __P((disk_t *, mbr_t *)); + +/* The default style is the first one in the list */ +struct _auto_style { + char *style_name; + int (*style_fn)(disk_t *, mbr_t *); + char *description; +} style_fns[] = { + {"boothfs", AUTO_boothfs, "8Mb boot plus HFS+ root partition"}, + {"bootufs", AUTO_bootufs, "8Mb boot plus UFS root partition"}, + {"hfs", AUTO_hfs, "Entire disk as one HFS+ partition"}, + {"ufs", AUTO_ufs, "Entire disk as one UFS partition"}, + {"dos", AUTO_dos, "Entire disk as one DOS partition"}, + {"raid", AUTO_raid, "Entire disk as one 0xAC partition"}, + {0,0} +}; + +void +AUTO_print_styles(FILE *f) +{ + struct _auto_style *fp; + int i; + + for (i=0, fp = &style_fns[0]; fp->style_name != NULL; i++, fp++) { + fprintf(f, " %-10s %s%s\n", fp->style_name, fp->description, (i==0) ? " (default)" : ""); + } +} + + +int +AUTO_init(disk_t *disk, char *style, mbr_t *mbr) +{ + struct _auto_style *fp; + + for (fp = &style_fns[0]; fp->style_name != NULL; fp++) { + /* If style is NULL, use the first (default) style */ + if (style == NULL || strcasecmp(style, fp->style_name) == 0) { + return (*fp->style_fn)(disk, mbr); + } + } + warnx("No such auto-partition style %s", style); + return AUTO_ERR; +} + + +static int +use_whole_disk(disk_t *disk, unsigned char id, mbr_t *mbr) +{ + MBR_clear(mbr); + mbr->part[0].id = id; + mbr->part[0].bs = 63; + mbr->part[0].ns = disk->real->size - 63; + PRT_fix_CHS(disk, &mbr->part[0], 0); + return AUTO_OK; +} + +/* DOS style: one partition for the whole disk */ +int +AUTO_dos(disk_t *disk, mbr_t *mbr) +{ + int cc; + cc = use_whole_disk(disk, 0x0C, mbr); + if (cc == AUTO_OK) { + mbr->part[0].flag = DOSACTIVE; + } + return cc; +} + +/* HFS style: one partition for the whole disk */ +int +AUTO_hfs(disk_t *disk, mbr_t *mbr) +{ + int cc; + cc = use_whole_disk(disk, 0xAF, mbr); + if (cc == AUTO_OK) { + mbr->part[0].flag = DOSACTIVE; + } + return cc; +} + +/* UFS style: one partition for the whole disk */ +int +AUTO_ufs(disk_t *disk, mbr_t *mbr) +{ + int cc; + cc = use_whole_disk(disk, 0xA8, mbr); + if (cc == AUTO_OK) { + mbr->part[0].flag = DOSACTIVE; + } + return cc; +} + +/* One boot partition, one HFS+ root partition */ +int +AUTO_boothfs (disk_t *disk, mbr_t *mbr) +{ + /* Check disk size. */ + if (disk->real->size < 16 * 2048) { + errx(1, "Disk size must be greater than 16Mb"); + return AUTO_ERR; + } + + MBR_clear(mbr); + + /* 8MB boot partition */ + mbr->part[0].id = 0xAB; + mbr->part[0].bs = 63; + mbr->part[0].ns = 8 * 1024 * 2; + mbr->part[0].flag = DOSACTIVE; + PRT_fix_CHS(disk, &mbr->part[0], 0); + + /* Rest of the disk for rooting */ + mbr->part[1].id = 0xAF; + mbr->part[1].bs = (mbr->part[0].bs + mbr->part[0].ns); + mbr->part[1].ns = disk->real->size - mbr->part[0].ns - 63; + PRT_fix_CHS(disk, &mbr->part[1], 1); + + return AUTO_OK; +} + +/* One boot partition, one UFS root partition */ +int +AUTO_bootufs(disk_t *disk, mbr_t *mbr) +{ + /* Check disk size. */ + if (disk->real->size < 16 * 2048) { + errx(1, "Disk size must be greater than 16Mb"); + return AUTO_ERR; + } + + MBR_clear(mbr); + + /* 8MB boot partition */ + mbr->part[0].id = 0xAB; + mbr->part[0].bs = 63; + mbr->part[0].ns = 8 * 1024 * 2; + mbr->part[0].flag = DOSACTIVE; + PRT_fix_CHS(disk, &mbr->part[0], 0); + + /* Rest of the disk for rooting */ + mbr->part[1].id = 0xA8; + mbr->part[1].bs = (mbr->part[0].bs + mbr->part[0].ns); + mbr->part[1].ns = disk->real->size - mbr->part[0].ns - 63; + PRT_fix_CHS(disk, &mbr->part[1], 1); + + return AUTO_OK; +} + +/* RAID style: one 0xAC partition for the whole disk */ +int +AUTO_raid(disk_t *disk, mbr_t *mbr) +{ + return use_whole_disk(disk, 0xAC, mbr); +} + diff --git a/i386/util/fdisk/.svn/text-base/auto.h.svn-base b/i386/util/fdisk/.svn/text-base/auto.h.svn-base new file mode 100644 index 0000000..c9259d4 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/auto.h.svn-base @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "mbr.h" + +/* Prototypes */ +void AUTO_print_styles __P((FILE *)); +int AUTO_init __P((disk_t *, char *, mbr_t *)); + +#define AUTO_OK 0 +#define AUTO_ERR -1 diff --git a/i386/util/fdisk/.svn/text-base/cmd.c.svn-base b/i386/util/fdisk/.svn/text-base/cmd.c.svn-base new file mode 100644 index 0000000..cbcca5e --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/cmd.c.svn-base @@ -0,0 +1,508 @@ +/* + * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdio.h> +#include <ctype.h> +#include <memory.h> +#include <stdlib.h> +#include <unistd.h> +#include <signal.h> +#include <sys/fcntl.h> +#include "disk.h" +#include "misc.h" +#include "user.h" +#include "part.h" +#include "cmd.h" +#include "auto.h" + +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) + +int +Xerase(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + bzero(mbr->part, sizeof(mbr->part)); + mbr->signature = MBR_SIGNATURE; + return (CMD_DIRTY); +} + +int +Xreinit(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + /* Copy template MBR */ + MBR_make(tt); + MBR_parse(disk, offset, 0, mbr); + + MBR_init(disk, mbr); + + /* Tell em we did something */ + printf("In memory copy is initialized to:\n"); + printf("Offset: %d\t", offset); + MBR_print(mbr); + printf("Use 'write' to update disk.\n"); + + return (CMD_DIRTY); +} + +int +Xauto(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + if (cmd->args[0] == '\0') { + printf("usage: auto <style>\n"); + printf(" where style is one of:\n"); + AUTO_print_styles(stdout); + return (CMD_CONT); + } + + if (AUTO_init(disk, cmd->args, mbr) != AUTO_OK) { + return (CMD_CONT); + } + MBR_make(mbr); + return (CMD_DIRTY); +} + +int +Xdisk(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int maxcyl = 1024; + int maxhead = 256; + int maxsec = 63; + + /* Print out disk info */ + DISK_printmetrics(disk); + +#if defined (__powerpc__) || defined (__mips__) + maxcyl = 9999999; + maxhead = 9999999; + maxsec = 9999999; +#endif + + /* Ask for new info */ + if (ask_yn("Change disk geometry?", 0)) { + disk->real->cylinders = ask_num("BIOS Cylinders", ASK_DEC, + disk->real->cylinders, 1, maxcyl, NULL); + disk->real->heads = ask_num("BIOS Heads", ASK_DEC, + disk->real->heads, 1, maxhead, NULL); + disk->real->sectors = ask_num("BIOS Sectors", ASK_DEC, + disk->real->sectors, 1, maxsec, NULL); + + disk->real->size = disk->real->cylinders * disk->real->heads + * disk->real->sectors; + } + + return (CMD_CONT); +} + +int +Xedit(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int pn, num, ret; + prt_t *pp; + + ret = CMD_CONT; + + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (ret); + } + pn = atoi(cmd->args) - 1; + + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (ret); + } + + /* Print out current table entry */ + pp = &mbr->part[pn]; + PRT_print(0, NULL); + PRT_print(pn, pp); + +#define EDIT(p, f, v, n, m, h) \ + if ((num = ask_num(p, f, v, n, m, h)) != v) \ + ret = CMD_DIRTY; \ + v = num; + + /* Ask for partition type */ + EDIT("Partition id ('0' to disable) ", ASK_HEX, pp->id, 0, 0xFF, PRT_printall); + + /* Unused, so just zero out */ + if (pp->id == DOSPTYP_UNUSED) { + memset(pp, 0, sizeof(*pp)); + printf("Partition %d is disabled.\n", pn + 1); + return (ret); + } + + /* Change table entry */ + if (ask_yn("Do you wish to edit in CHS mode?", 0)) { + int maxcyl, maxhead, maxsect; + + /* Shorter */ + maxcyl = disk->real->cylinders - 1; + maxhead = disk->real->heads - 1; + maxsect = disk->real->sectors; + + /* Get data */ + EDIT("BIOS Starting cylinder", ASK_DEC, pp->scyl, 0, maxcyl, NULL); + EDIT("BIOS Starting head", ASK_DEC, pp->shead, 0, maxhead, NULL); + EDIT("BIOS Starting sector", ASK_DEC, pp->ssect, 1, maxsect, NULL); + EDIT("BIOS Ending cylinder", ASK_DEC, pp->ecyl, 0, maxcyl, NULL); + EDIT("BIOS Ending head", ASK_DEC, pp->ehead, 0, maxhead, NULL); + EDIT("BIOS Ending sector", ASK_DEC, pp->esect, 1, maxsect, NULL); + /* Fix up off/size values */ + PRT_fix_BN(disk, pp, pn); + /* Fix up CHS values for LBA */ + PRT_fix_CHS(disk, pp, pn); + } else { + u_int m; + + if (pn == 0) { + pp->bs = 63 + offset; + } else { + if (mbr->part[pn-1].id != 0) { + pp->bs = mbr->part[pn-1].bs + mbr->part[pn-1].ns; + } + } + /* Get data */ + EDIT("Partition offset", ASK_DEC, pp->bs, 0, + disk->real->size, NULL); + m = MAX(pp->ns, disk->real->size - pp->bs); + if ( m > disk->real->size - pp->bs) { + /* dont have default value extend beyond end of disk */ + m = disk->real->size - pp->bs; + } + pp->ns = m; + EDIT("Partition size", ASK_DEC, pp->ns, 1, + m, NULL); + + /* Fix up CHS values */ + PRT_fix_CHS(disk, pp, pn); + } +#undef EDIT + return (ret); +} + +int +Xsetpid(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int pn, num, ret; + prt_t *pp; + + ret = CMD_CONT; + + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (ret); + } + pn = atoi(cmd->args) - 1; + + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (ret); + } + + /* Print out current table entry */ + pp = &mbr->part[pn]; + PRT_print(0, NULL); + PRT_print(pn, pp); + +#define EDIT(p, f, v, n, m, h) \ + if ((num = ask_num(p, f, v, n, m, h)) != v) \ + ret = CMD_DIRTY; \ + v = num; + + /* Ask for partition type */ + EDIT("Partition id ('0' to disable) ", ASK_HEX, pp->id, 0, 0xFF, PRT_printall); + +#undef EDIT + return (ret); +} +int +Xselect(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + static int firstoff = 0; + int off; + int pn; + + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (CMD_CONT); + } + + pn = atoi(cmd->args) - 1; + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (CMD_CONT); + } + + off = mbr->part[pn].bs; + + /* Sanity checks */ + if ((mbr->part[pn].id != DOSPTYP_EXTEND) && + (mbr->part[pn].id != DOSPTYP_EXTENDL)) { + printf("Partition %d is not an extended partition.\n", pn + 1); + return (CMD_CONT); + } + + if (firstoff == 0) + firstoff = off; + + if (!off) { + printf("Loop to offset 0! Not selected.\n"); + return (CMD_CONT); + } else { + printf("Selected extended partition %d\n", pn + 1); + printf("New MBR at offset %d.\n", off); + } + + /* Recursion is beautifull! */ + USER_modify(disk, tt, off, firstoff); + return (CMD_CONT); +} + +int +Xprint(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + + DISK_printmetrics(disk); + printf("Offset: %d\t", offset); + MBR_print(mbr); + + return (CMD_CONT); +} + +int +Xwrite(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int fd; + int shared = 0; + + fd = DISK_openshared(disk->name, O_RDWR, &shared); + if(shared) { + if(!ask_yn("Device could not be accessed exclusively.\nA reboot will be needed for changes to take effect. OK?", 0)) { + close(fd); + printf("MBR unchanged\n"); + return (CMD_CONT); + } + } + + printf("Writing MBR at offset %d.\n", offset); + + MBR_make(mbr); + MBR_write(disk, fd, mbr); + close(fd); + return (CMD_CLEAN); +} + +int +Xquit(cmd, disk, r, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *r; + mbr_t *tt; + int offset; +{ + + /* Nothing to do here */ + return (CMD_SAVE); +} + +int +Xabort(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + exit(0); + + /* NOTREACHED */ + return (CMD_CONT); +} + + +int +Xexit(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + + /* Nothing to do here */ + return (CMD_EXIT); +} + +int +Xhelp(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + cmd_table_t *cmd_table = cmd->table; + int i; + + /* Hmm, print out cmd_table here... */ + for (i = 0; cmd_table[i].cmd != NULL; i++) + printf("\t%s\t\t%s\n", cmd_table[i].cmd, cmd_table[i].help); + return (CMD_CONT); +} + +int +Xupdate(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + extern char *mbr_binary; + /* Update code */ + memcpy(mbr->code, mbr_binary, MBR_CODE_SIZE); + printf("Machine code updated.\n"); + return (CMD_DIRTY); +} + +int +Xflag(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int i, pn = -1; + + /* Parse partition table entry number */ + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (CMD_CONT); + } + pn = atoi(cmd->args) - 1; + + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (CMD_CONT); + } + + /* Set active flag */ + for (i = 0; i < 4; i++) { + if (i == pn) + mbr->part[i].flag = DOSACTIVE; + else + mbr->part[i].flag = 0x00; + } + + printf("Partition %d marked active.\n", pn + 1); + return (CMD_DIRTY); +} + +int +Xmanual(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + system("man 8 fdisk"); + return (CMD_CONT); +} diff --git a/i386/util/fdisk/.svn/text-base/cmd.h.svn-base b/i386/util/fdisk/.svn/text-base/cmd.h.svn-base new file mode 100644 index 0000000..0c2b727 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/cmd.h.svn-base @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _CMD_H +#define _CMD_H + +/* Includes */ +#include "disk.h" +#include "mbr.h" + + +/* Constants (returned by cmd funs) */ +#define CMD_EXIT 0x0000 +#define CMD_SAVE 0x0001 +#define CMD_CONT 0x0002 +#define CMD_CLEAN 0x0003 +#define CMD_DIRTY 0x0004 + + +/* Data types */ +struct _cmd_table_t; +typedef struct _cmd_t { + struct _cmd_table_t *table; + char cmd[10]; + char args[100]; +} cmd_t; + +typedef struct _cmd_table_t { + char *cmd; + int (*fcn)(cmd_t *, disk_t *, mbr_t *, mbr_t *, int); + char *help; +} cmd_table_t; + + +/* Prototypes */ +int Xerase __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xreinit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xauto __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xdisk __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xmanual __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xedit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xsetpid __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xselect __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xprint __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xwrite __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xexit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xquit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xabort __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xhelp __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xflag __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xupdate __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); + +#endif /* _CMD_H */ + + diff --git a/i386/util/fdisk/.svn/text-base/disk.c.svn-base b/i386/util/fdisk/.svn/text-base/disk.c.svn-base new file mode 100644 index 0000000..eb7c706 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/disk.c.svn-base @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997, 2001 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/fcntl.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/reboot.h> +#include <sys/disk.h> +#include <sys/param.h> +#include <sys/sysctl.h> +#ifdef __i386__ +#include <pexpert/i386/boot.h> +#endif +#include "disk.h" + +int +DISK_open(disk, mode) + char *disk; + int mode; +{ + int fd; + struct stat st; + + fd = open(disk, mode); + if (fd == -1) + err(1, "%s", disk); + if (fstat(fd, &st) == -1) + err(1, "%s", disk); + /* Don't be so picky about needing a character device */ + if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode)) + errx(1, "%s is not a character device or a regular file", disk); + return (fd); +} + +int +DISK_openshared(disk, mode, shared) + char *disk; + int mode; + int *shared; +{ + int fd; + struct stat st; + *shared = 0; + + fd = open(disk, mode|O_EXLOCK); + if (fd == -1) { + // if we can't have exclusive access, attempt + // to gracefully degrade to shared access + fd = open(disk, mode|O_SHLOCK); + if(fd == -1) + err(1, "%s", disk); + + *shared = 1; + } + + if (fstat(fd, &st) == -1) + err(1, "%s", disk); + /* Don't be so picky about needing a character device */ + if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode)) + errx(1, "%s is not a character device or a regular file", disk); + return (fd); +} + +int +DISK_close(fd) + int fd; +{ + + return (close(fd)); +} + +/* Given a size in the metrics, + * fake up a CHS geometry. + */ +void +DISK_fake_CHS(DISK_metrics *lm) +{ + int heads = 4; + int spt = 63; + int cylinders = (lm->size / heads / spt); + + while (cylinders > 1024 && heads < 256) { + heads *= 2; + cylinders /= 2; + } + if (heads == 256) { + heads = 255; + cylinders = (lm->size / heads / spt); + } + lm->cylinders = cylinders; + lm->heads = heads; + lm->sectors = spt; +} + +/* Routine to go after the disklabel for geometry + * information. This should work everywhere, but + * in the land of PC, things are not always what + * they seem. + */ +DISK_metrics * +DISK_getlabelmetrics(name) + char *name; +{ + DISK_metrics *lm = NULL; + long long size; + uint32_t sector_size; + int fd; + struct stat st; + + /* Get label metrics */ + if ((fd = DISK_open(name, O_RDONLY)) != -1) { + lm = malloc(sizeof(DISK_metrics)); + + if (fstat(fd, &st) == -1) + err(1, "%s", name); + if (!S_ISREG(st.st_mode) || S_ISBLK(st.st_mode)) { + if (ioctl(fd, DKIOCGETBLOCKCOUNT, &size) == -1) { + err(1, "Could not get disk block count"); + free(lm); + return NULL; + } + if (ioctl(fd, DKIOCGETBLOCKSIZE, §or_size) == -1) { + err(1, "Could not get disk block size"); + free(lm); + return NULL; + } + } else { + sector_size = 512; + size = st.st_size / sector_size; + } + + lm->sector_size = sector_size; + lm->size = size; + DISK_fake_CHS(lm); + DISK_close(fd); + } + + return (lm); +} + +/* + * Don't try to get BIOS disk metrics. + */ +DISK_metrics * +DISK_getbiosmetrics(name) + char *name; +{ + return (NULL); +} + +/* This is ugly, and convoluted. All the magic + * for disk geo/size happens here. Basically, + * the real size is the one we will use in the + * rest of the program, the label size is what we + * got from the disklabel. If the disklabel fails, + * we assume we are working with a normal file, + * and should request the user to specify the + * geometry he/she wishes to use. + */ +int +DISK_getmetrics(disk, user) + disk_t *disk; + DISK_metrics *user; +{ + + disk->label = DISK_getlabelmetrics(disk->name); + disk->bios = DISK_getbiosmetrics(disk->name); + + /* If user supplied, use that */ + if (user) { + disk->real = user; + return (0); + } + + /* Fixup bios metrics to include cylinders past 1023 boundary */ + if(disk->label && disk->bios){ + int cyls, secs; + + cyls = disk->label->size / (disk->bios->heads * disk->bios->sectors); + secs = cyls * (disk->bios->heads * disk->bios->sectors); + if ((disk->label->size - secs) < 0) + errx(1, "BIOS fixup botch (%d sectors)", disk->label->size - secs); + disk->bios->cylinders = cyls; + disk->bios->size = secs; + } + + /* If we have a (fixed) BIOS geometry, use that */ + if (disk->bios) { + disk->real = disk->bios; + return (0); + } + + /* If we have a label, use that */ + if (disk->label) { + disk->real = disk->label; + return (0); + } + + /* Can not get geometry, punt */ + disk->real = NULL; + return (1); +} + +/* Get the disk's native sector size, updating the metrics' sector_size field. + */ + int +DISK_get_sector_size(disk, user) + disk_t *disk; + DISK_metrics *user; +{ + int ret; + int fd; + uint32_t sector_size; + + /* Default to 512 bytes per sector, in case of failure. */ + user->sector_size = 512; + ret = 1; + + fd = DISK_open(disk->name, O_RDONLY); + if (fd == -1) { + err(1, "Could not open %s", disk->name); + } else { + if (ioctl(fd, DKIOCGETBLOCKSIZE, §or_size) == -1) { + err(1, "Could not get disk block size"); + } else { + user->sector_size = sector_size; + ret = 0; + } + } + + return ret; +} + +int +DISK_printmetrics(disk) + disk_t *disk; +{ + + printf("Disk: %s\t", disk->name); + if (disk->real) { + printf("geometry: %d/%d/%d [%d sectors]\n", disk->real->cylinders, + disk->real->heads, disk->real->sectors, disk->real->size); + if (disk->real->sector_size != 512) + printf("Sector size: %d bytes\n", disk->real->sector_size); + } else { + printf("geometry: <none>\n"); + } + + return (0); +} + diff --git a/i386/util/fdisk/.svn/text-base/disk.h.svn-base b/i386/util/fdisk/.svn/text-base/disk.h.svn-base new file mode 100644 index 0000000..c28c999 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/disk.h.svn-base @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _DISK_H +#define _DISK_H + +/* Data types */ +typedef struct _DISK_metrics { + int cylinders; + int heads; + int sectors; + int size; /* Number of sectors in disk */ + int sector_size; /* Bytes per sector */ +} DISK_metrics; + +typedef struct _disk_t { + char *name; + DISK_metrics *bios; /* Metrics as reported by BIOS (always NULL) */ + DISK_metrics *label; /* As reported by device ioctls */ + DISK_metrics *real; /* Metrics we're using (BIOS, ioctls, user-supplied) */ +} disk_t; + +/* Prototypes */ +int DISK_open __P((char *, int)); +int DISK_openshared __P((char *, int, int *)); +int DISK_close __P((int)); +int DISK_getmetrics __P((disk_t *, DISK_metrics *)); +int DISK_get_sector_size __P((disk_t *, DISK_metrics *)); +int DISK_printmetrics __P((disk_t *)); +void DISK_fake_CHS __P((DISK_metrics *)); + +#endif /* _DISK_H */ + diff --git a/i386/util/fdisk/.svn/text-base/fdisk.8.svn-base b/i386/util/fdisk/.svn/text-base/fdisk.8.svn-base new file mode 100644 index 0000000..ab8ffb6 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/fdisk.8.svn-base @@ -0,0 +1,383 @@ +.\" $OpenBSD: fdisk.8,v 1.38 2002/01/04 21:20:56 kjell Exp $ +.\" +.\" Copyright (c) 2002 Apple Computer, Inc. All rights reserved. +.\" +.\" "Portions Copyright (c) 2002 Apple Computer, Inc. All Rights +.\" Reserved. This file contains Original Code and/or Modifications of +.\" Original Code as defined in and that are subject to the Apple Public +.\" Source License Version 1.2 (the 'License'). You may not use this file +.\" except in compliance with the License. Please obtain a copy of the +.\" License at http://www.apple.com/publicsource and read it before using +.\" this file. +.\" +.\" The Original Code and all software distributed under the License are +.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +.\" License for the specific language governing rights and limitations +.\" under the License." +.\" +.\" Copyright (c) 1997 Tobias Weingartner +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Tobias Weingartner. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd January 3, 2002 +.Dt FDISK 8 +.Os +.Sh NAME +.Nm fdisk +.Nd DOS partition maintenance program +.Sh SYNOPSIS +.Nm fdisk +.Op Fl ieu +.Op Fl f Ar mbrname +.Op Fl c Ar cylinders +.Op Fl h Ar heads +.Op Fl s Ar sectors +.Op Fl S Ar size +.Op Fl b Ar size +.Ar device +.Sh DESCRIPTION +In order for the BIOS to boot the kernel, certain conventions must be +adhered to. +Sector 0 of a bootable hard disk must contain boot code, +an MBR partition table, and a magic number (0xAA55). +These MBR partitions (also +known as BIOS partitions) can be used to break the disk up into several +pieces. +.Pp +The BIOS loads sector 0 of the boot disk into memory, verifies +the magic number, and begins executing the code at the first byte. +The normal DOS MBR boot code searches the MBR partition table for an +.Dq active +partition (indicated by a +.Ql \&* +in the first column), and if one +is found, the boot block from that partition is loaded and executed in +place of the original (MBR) boot block. +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl i +Initialize the MBR sector. +.It Fl a Ar style +Specify an automatic partitioning style. +.It Fl e +Edit existing MBR sectors. +.It Fl f Ar mbrname +Specifies an alternate MBR template file. +.It Fl u +Update MBR code, preserving existing partition table. +.It Fl y +Do not ask for confirmation before writing. +.It Fl d +Dump partition table in a format readable by the -r option. +.It Fl r +Read a partition table from the standard input. +.It Fl t +Test if the disk is partitioned. +.It Xo Fl c Ar cylinders , +.Fl h Ar heads , +.Fl s Ar sectors +.Xc +Specifies an alternate BIOS geometry for +.Nm +to use. +.It Fl S Ar size +Specify the disk size in blocks. +.It Fl b Ar size +Specify the number of bytes per disk block. +.El +.Pp +The DOS +.Nm +program can be used to divide space on the disk into partitions and set +one active. +This +.Nm +program serves a similar purpose to the DOS program. +When called with no special flags, it prints the MBR partition +table of the specified device, i.e., +.Bd -literal + # fdisk fd0 + Disk: fd0 geometry: 80/2/18 [2880 sectors] + Offset: 0 Signature: 0xAA55 + Starting Ending + #: id cyl hd sec - cyl hd sec [ start - size] + ---------------------------------------------------------------------- + *1: A6 0 0 1 - 79 1 18 [ 0 - 2880] OpenBSD + 2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused + 3: A7 0 0 2 - 79 1 18 [ 1 - 2879] NEXTSTEP + 4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused +.Ed +.Pp +The geometry displayed is a synthetic geometry unless another geometry +has been selected using the +.Fl c , +.Fl h , +.Fl s , +.Fl S , +and +.Fl b +options. +In the future, +.Nm +will read the BIOS geometry from the IOKit registry. +.Pp +In this example, +the disk is divided into two partitions that happen to fill the disk. +The first partition overlaps the third partition. +(Used for debugging purposes.) +.Bl -tag -width "start/size" +.It Em "#" +Number of partition table entry. +A +.Dq \&* +denotes the bootable partition. +.It Em "id" +System identifier. +.Ox +reserves the +magic number 166 decimal (A6 in hex). +If no 166 partition is found, it will use an older +.Fx +partition (with a magic number of 165 or A5 in hex). +.It Em "cyl/hd/sec" +These fields provide the starting and ending address of the partition +in BIOS geometry +.It Em "start/size" +These fields provide the starting sector and size in sectors of the +partition in linear block addresses. +.El +.Pp +.Em NOTE : +The sectors field is +.Dq 1 based , +and the start field is +.Dq 0 based . +The CHS values may need to be in the BIOS's geometry +for older systems to be able to boot and use the drive correctly; +most modern systems prefer the starting sector and size +in preference to the CHS values. +.Pp +The +.Fl i +flag is used to indicate that the partition data is to be initialized. +In this mode, +.Nm +will completely overwrite the primary MBR and partition table, either +using the default MBR template, or the one specified by the +.Fl f +flag. +.Pp +In the default template, partition number 1 will be configured as a +Darwin boot +partition spanning from cylinder 0, head 1, sector 1, and extending +for 8 megabytes. +Partition number 2 will be configured as a +Darwin HFS +partition spanning the rest of the disk. +This mode is designed to initialize an MBR the very first time, +or when it has been corrupted beyond repair. +.Pp +You can specify other default partition styles with the +.Fl a +flag. The available styles are: +.Bl -tag -width "start/size" +.It Em "boothfs" +Creates an 8Mb boot partition (type AB hex) +and makes the rest of the disk +a Darwin HFS partition (type AF hex). +.It Em "bootufs" +Creates an 8Mb boot partition (type AB hex) +and makes the rest of the disk +a Darwin UFS partition (type A8 hex). +.It Em "ufs" +Makes the entire disk one Darwin UFS partition (type A8 hex). +.It Em "hfs" +Makes the entire disk one HFS+ partition (type AF hex). +.It Em "dos" +Makes the entire disk one DOS partition (type 0C hex). +.It Em "raid" +Makes the entire disk one type AC hex partition. +.El +.Pp +The +.Fl u +flag is used to update the MBR code on a given drive. +The MBR code extends from offset 0x000 to the start of the partition table +at offset 0x1BE. +It is similar to the +.Fl i +flag, except the existing partition table is preserved. This +is useful for writing new MBR code onto an existing drive, and is +equivalent to the DOS command +.Dq FDISK /MBR . +Note that this option will overwrite the NT disk signature, if present. +The +.Fl u +and +.Fl i +flags may not be specified together. +.Pp +The flag +.Fl e +is used to modify a partition table using a interactive edit mode of the +.Nm +program. +This mode is designed to allow you to change any partition on the +drive you choose, including extended partitions. +It is a very powerful mode, +but is safe as long as you do not execute the +.Em write +command, or answer in the negative (the default) when +.Nm +asks you about writing out changes. +.Sh COMMAND MODE +When you first enter this mode, you are presented with a prompt, that looks +like so: +.Em "fdisk: 0>" . +This prompt has two important pieces of information for you. +It will tell +you if the in-memory copy of the boot block has been modified or not. +If it has been modified, the prompt will change to look like: +.Em "fdisk:*0>" . +The second piece of information pertains to the number given in the prompt. +This number specifies the disk offset of the currently selected boot block +you are editing. +This number could be something different that zero when +you are editing extended partitions. +The list of commands and their explanations are given below. +.Bl -tag -width "update" +.It Em help +Display a list of commands that +.Nm +understands in the interactive edit mode. +.It Em manual +Display this manual page. +.It Em reinit +Initialize the currently selected, in-memory copy of the +boot block. +.It Em auto +Partition the disk with one of the automatic partition styles. +.It Em disk +Display the current drive geometry that +.Nm +has +probed. +You are given a chance to edit it if you wish. +.It Em edit +Edit a given table entry in the memory copy of +the current boot block. +You may edit either in BIOS geometry mode, +or in sector offsets and sizes. +.It Em setpid +Change the partition +identifier of the given partition table entry. +This command is particularly useful for reassigning +an existing partition to OpenBSD. +.It Em flag +Make the given partition table entry bootable. +Only one entry can be marked bootable. +If you wish to boot from an extended +partition, you will need to mark the partition table entry for the +extended partition as bootable. +.It Em update +Update the machine code in the memory copy of the currently selected +boot block. +Note that this option will overwrite the NT disk +signature, if present. +.It Em select +Select and load into memory the boot block pointed +to by the extended partition table entry in the current boot block. +.It Em print +Print the currently selected in-memory copy of the boot +block and its MBR table to the terminal. +.It Em write +Write the in-memory copy of the boot block to disk. +You will be asked to confirm this operation. +.It Em exit +Exit the current level of +.Nm fdisk , +either returning to the +previously selected in-memory copy of a boot block, or exiting the +program if there is none. +.It Em quit +Exit the current level of +.Nm fdisk , +either returning to the +previously selected in-memory copy of a boot block, or exiting the +program if there is none. +Unlike +.Em exit +it does write the modified block out. +.It Em abort +Quit program without saving current changes. +.El +.Sh NOTES +The automatic calculation of starting cylinder etc. uses +a set of figures that represent what the BIOS thinks is the +geometry of the drive. +These figures are by default taken from the in-core disklabel, or +values that +.Em /boot +has passed to the kernel, but +.Nm +gives you an opportunity to change them if there is a need to. +This allows the user to create a bootblock that can work with drives +that use geometry translation under a potentially different BIOS. +.Pp +If you hand craft your disk layout, +please make sure that the +.Ox +partition starts on a cylinder boundary. +(This restriction may be changed in the future.) +.Pp +Editing an existing partition is risky, and may cause you to +lose all the data in that partition. +.Pp +You should run this program interactively once or twice to see how it works. +This is completely safe as long as you answer the +.Dq write +questions in the +negative. +.Sh FILES +.Bl -tag -width /usr/mdec/mbr -compact +.It Pa /usr/mdec/mbr +default MBR template +.El +.Sh SEE ALSO +.Xr gpt 8 , +.Xr pdisk 8 +.Sh BUGS +There are subtleties +.Nm +detects that are not explained in this manual page. +As well, chances are that some of the subtleties it should detect are being +steamrolled. +Caveat Emptor. diff --git a/i386/util/fdisk/.svn/text-base/fdisk.c.svn-base b/i386/util/fdisk/.svn/text-base/fdisk.c.svn-base new file mode 100644 index 0000000..e7b45cb --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/fdisk.c.svn-base @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <paths.h> +#include <sys/types.h> +#include <sys/fcntl.h> +#include "disk.h" +#include "user.h" +#include "auto.h" + +#define _PATH_MBR "/usr/standalone/i386/boot0" + +void +usage() +{ + extern char * __progname; + fprintf(stderr, "usage: %s " + "[-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk\n" + "\t-i: initialize disk with new MBR\n" + "\t-u: update MBR code, preserve partition table\n" + "\t-e: edit MBRs on disk interactively\n" + "\t-f: specify non-standard MBR template\n" + "\t-chs: specify disk geometry\n" + "\t-S: specify disk size\n" + "\t-r: read partition specs from stdin (implies -i)\n" + "\t-a: auto-partition with the given style\n" + "\t-d: dump partition table\n" + "\t-y: don't ask any questions\n" + "\t-t: test if disk is partitioned\n" + "`disk' is of the form /dev/rdisk0.\n", + __progname); + fprintf(stderr, "auto-partition styles:\n"); + AUTO_print_styles(stderr); + exit(1); +} + +char *mbr_binary = NULL; +int +main(argc, argv) + int argc; + char **argv; +{ + int ch, fd; + int i_flag = 0, m_flag = 0, u_flag = 0, r_flag = 0, d_flag = 0, y_flag = 0, t_flag = 0; + int c_arg = 0, h_arg = 0, s_arg = 0; + int size_arg = 0; + int block_size_arg = 0; + disk_t disk; + DISK_metrics *usermetrics; + char *mbrfile = _PATH_MBR; + mbr_t *mp; + char *auto_style = NULL; + + while ((ch = getopt(argc, argv, "ieuf:c:h:s:b:S:ra:dyt")) != -1) { + switch(ch) { + case 'i': + i_flag = 1; + break; + case 'u': + u_flag = 1; + break; + case 'e': + m_flag = 1; + break; + case 'f': + mbrfile = optarg; + break; + case 'c': + c_arg = atoi(optarg); + if (c_arg < 1 || c_arg > 262144) + errx(1, "Cylinder argument out of range."); + break; + case 'h': + h_arg = atoi(optarg); + if (h_arg < 1 || h_arg > 256) + errx(1, "Head argument out of range."); + break; + case 's': + s_arg = atoi(optarg); + if (s_arg < 1 || s_arg > 63) + errx(1, "Sector argument out of range."); + break; + case 'b': + block_size_arg = atoi(optarg); + if (block_size_arg & (block_size_arg - 1)) + errx(1, "Block size argument not a power of two."); + if (block_size_arg < 512 || block_size_arg > 4096) + errx(1, "Block size argument out of range 512..4096."); + break; + case 'S': + size_arg = atoi(optarg); + break; + case 'r': + r_flag = 1; + break; + case 'a': + auto_style = optarg; + break; + case 'd': + d_flag = 1; + break; + case 'y': + y_flag = 1; + break; + case 't': + t_flag = 1; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + /* Argument checking */ + if (argc != 1) + usage(); + else + disk.name = argv[0]; + + if (i_flag && u_flag) errx(1, "-i and -u cannot be specified simultaneously"); + + /* Put in supplied geometry if there */ + if (c_arg | h_arg | s_arg | size_arg | block_size_arg) { + usermetrics = malloc(sizeof(DISK_metrics)); + if (usermetrics != NULL) { + if (c_arg && h_arg && s_arg) { + usermetrics->cylinders = c_arg; + usermetrics->heads = h_arg; + usermetrics->sectors = s_arg; + if (size_arg) { + usermetrics->size = size_arg; + } else { + usermetrics->size = c_arg * h_arg * s_arg; + } + } else { + if (size_arg) { + usermetrics->size = size_arg; + DISK_fake_CHS(usermetrics); + } else { + errx(1, "Please specify a full geometry with [-chs]."); + } + } + if (block_size_arg) { + usermetrics->sector_size = block_size_arg; + } else { + DISK_get_sector_size(&disk, usermetrics); + } + } + } else { + usermetrics = NULL; + } + + /* Get the geometry */ + disk.real = NULL; + if (DISK_getmetrics(&disk, usermetrics)) + errx(1, "Can't get disk geometry, please use [-chs] to specify."); + + /* If only testing, read MBR and silently exit */ + if (t_flag) { + mbr_t *mbr; + + mp = mbr = MBR_read_all(&disk); + while (mp) { + if (mp->signature != MBR_SIGNATURE) { + MBR_free(mbr); + exit(1); + } + mp = mp->next; + } + MBR_free(mbr); + exit(0); + } + + /* If not editing the disk, print out current MBRs on disk */ + if ((i_flag + r_flag + u_flag + m_flag) == 0) { + exit(USER_print_disk(&disk, d_flag)); + } + + /* Parse mbr template or read partition specs, to pass on later */ + if (auto_style && r_flag) { + errx(1, "Can't specify both -r and -a"); + } + + mbr_binary = (char *)malloc(MBR_CODE_SIZE); + if ((fd = open(mbrfile, O_RDONLY)) == -1) { + warn("could not open MBR file %s", mbrfile); + bzero(mbr_binary, MBR_CODE_SIZE); + } else { + int cc; + cc = read(fd, mbr_binary, MBR_CODE_SIZE); + if (cc < MBR_CODE_SIZE) { + err(1, "could not read MBR code"); + } + close(fd); + } + + if (u_flag) { + /* Don't hose the partition table; just write the boot code */ + mp = MBR_read_all(&disk); + bcopy(mbr_binary, mp->code, MBR_CODE_SIZE); + MBR_make(mp); + } else if (i_flag) { + /* If they didn't specify -a, they'll get the default auto style */ + mp = MBR_alloc(NULL); + if (AUTO_init(&disk, auto_style, mp) != AUTO_OK) { + errx(1, "error initializing disk"); + } + bcopy(mbr_binary, mp->code, MBR_CODE_SIZE); + MBR_make(mp); + } else if (r_flag) { + mp = MBR_parse_spec(stdin, &disk); + bcopy(mbr_binary, mp->code, MBR_CODE_SIZE); + MBR_make(mp); + } else { + /* Use what's on the disk. */ + mp = MBR_read_all(&disk); + } + + /* Now do what we are supposed to */ + if (i_flag || r_flag || u_flag) { + USER_write(&disk, mp, u_flag, y_flag); + } + + if (m_flag) { + USER_modify(&disk, mp, 0, 0); + } + + if (mbr_binary) + free(mbr_binary); + + return (0); +} diff --git a/i386/util/fdisk/.svn/text-base/getrawpartition.c.svn-base b/i386/util/fdisk/.svn/text-base/getrawpartition.c.svn-base new file mode 100644 index 0000000..9cfcb35 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/getrawpartition.c.svn-base @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/*- + * Copyright (c) 1996 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: getrawpartition.c,v 1.4 1999/07/02 15:49:12 simonb Exp $"); +#endif + +#include <sys/param.h> +#include <sys/sysctl.h> +#include <util.h> + +int +getrawpartition() +{ +#if 0 + int rawpart, mib[2]; + size_t varlen; + + mib[0] = CTL_KERN; + mib[1] = KERN_RAWPARTITION; + varlen = sizeof(rawpart); + if (sysctl(mib, 2, &rawpart, &varlen, NULL, 0) < 0) + return (-1); + + return (rawpart); +#else + return 0 - 'a'; +#endif +} diff --git a/i386/util/fdisk/.svn/text-base/mbr.c.svn-base b/i386/util/fdisk/.svn/text-base/mbr.c.svn-base new file mode 100644 index 0000000..1f56f05 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/mbr.c.svn-base @@ -0,0 +1,553 @@ +/* + * Copyright (c) 2002, 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <ctype.h> +#include <memory.h> +#include <sys/fcntl.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#if 0 +#include <sys/dkio.h> +#endif +#include <machine/param.h> +#include "disk.h" +#include "misc.h" +#include "mbr.h" +#include "part.h" + + +void +MBR_init(disk, mbr) + disk_t *disk; + mbr_t *mbr; +{ + /* Fix up given mbr for this disk */ + mbr->part[0].flag = 0; + mbr->part[1].flag = 0; + mbr->part[2].flag = 0; +#if !defined(DOSPTYP_OPENBSD) + mbr->part[3].flag = 0; + mbr->signature = MBR_SIGNATURE; +#else + + mbr->part[3].flag = DOSACTIVE; + mbr->signature = DOSMBR_SIGNATURE; + + /* Use whole disk, save for first head, on first cyl. */ + mbr->part[3].id = DOSPTYP_OPENBSD; + mbr->part[3].scyl = 0; + mbr->part[3].shead = 1; + mbr->part[3].ssect = 1; + + /* Go right to the end */ + mbr->part[3].ecyl = disk->real->cylinders - 1; + mbr->part[3].ehead = disk->real->heads - 1; + mbr->part[3].esect = disk->real->sectors; + + /* Fix up start/length fields */ + PRT_fix_BN(disk, &mbr->part[3], 3); + +#if defined(__powerpc__) || defined(__mips__) + /* Now fix up for the MS-DOS boot partition on PowerPC. */ + mbr->part[0].flag = DOSACTIVE; /* Boot from dos part */ + mbr->part[3].flag = 0; + mbr->part[3].ns += mbr->part[3].bs; + mbr->part[3].bs = mbr->part[0].bs + mbr->part[0].ns; + mbr->part[3].ns -= mbr->part[3].bs; + PRT_fix_CHS(disk, &mbr->part[3], 3); + if ((mbr->part[3].shead != 1) || (mbr->part[3].ssect != 1)) { + /* align the partition on a cylinder boundary */ + mbr->part[3].shead = 0; + mbr->part[3].ssect = 1; + mbr->part[3].scyl += 1; + } + /* Fix up start/length fields */ + PRT_fix_BN(disk, &mbr->part[3], 3); +#endif +#endif +} + +void +MBR_parse(disk, offset, reloff, mbr) + disk_t *disk; + off_t offset; + off_t reloff; + mbr_t *mbr; +{ + int i; + unsigned char *mbr_buf = mbr->buf; + + memcpy(mbr->code, mbr_buf, MBR_CODE_SIZE); + mbr->offset = offset; + mbr->reloffset = reloff; + mbr->signature = getshort(&mbr_buf[MBR_SIG_OFF]); + + for (i = 0; i < NDOSPART; i++) + PRT_parse(disk, &mbr_buf[MBR_PART_OFF + MBR_PART_SIZE * i], + offset, reloff, &mbr->part[i], i); +} + +void +MBR_make(mbr) + mbr_t *mbr; +{ + int i; + unsigned char *mbr_buf = mbr->buf; + + memcpy(mbr_buf, mbr->code, MBR_CODE_SIZE); + putshort(&mbr_buf[MBR_SIG_OFF], mbr->signature); + + for (i = 0; i < NDOSPART; i++) + PRT_make(&mbr->part[i], mbr->offset, mbr->reloffset, + &mbr_buf[MBR_PART_OFF + MBR_PART_SIZE * i]); +} + +void +MBR_print(mbr) + mbr_t *mbr; +{ + int i; + + /* Header */ + printf("Signature: 0x%X\n", + (int)mbr->signature); + PRT_print(0, NULL); + + /* Entries */ + for (i = 0; i < NDOSPART; i++) + PRT_print(i, &mbr->part[i]); +} + +int +MBR_read(disk, fd, where, mbr) + disk_t *disk; + int fd; + off_t where; + mbr_t *mbr; +{ + off_t off; + int len; + int size; + unsigned char *buf = mbr->buf; + + size = disk->real->sector_size; + where *= size; + off = lseek(fd, where, SEEK_SET); + if (off != where) + return (off); + len = read(fd, buf, size); + if (len != size) + return (len); + return (0); +} + +int +MBR_write(disk, fd, mbr) + disk_t *disk; + int fd; + mbr_t *mbr; +{ + off_t off; + int len; + int size; + unsigned char *buf = mbr->buf; + off_t where; + + size = disk->real->sector_size; + where = mbr->offset * size; + off = lseek(fd, where, SEEK_SET); + if (off != where) + return (off); + len = write(fd, buf, size); + if (len != size) + return (len); +#if defined(DIOCRLDINFO) + (void) ioctl(fd, DIOCRLDINFO, 0); +#endif + return (0); +} + +void +MBR_pcopy(disk, mbr) + disk_t *disk; + mbr_t *mbr; +{ + /* + * Copy partition table from the disk indicated + * to the supplied mbr structure + */ + + int i, fd, offset = 0, reloff = 0; + mbr_t *mbrd; + + mbrd = MBR_alloc(NULL); + fd = DISK_open(disk->name, O_RDONLY); + MBR_read(disk, fd, offset, mbrd); + DISK_close(fd); + MBR_parse(disk, offset, reloff, mbrd); + for (i = 0; i < NDOSPART; i++) { + PRT_parse(disk, &mbrd->buf[MBR_PART_OFF + + MBR_PART_SIZE * i], + offset, reloff, &mbr->part[i], i); + PRT_print(i, &mbr->part[i]); + } + MBR_free(mbrd); +} + + +static int +parse_number(char *str, int default_val, int base) { + if (str != NULL && *str != '\0') { + default_val = strtol(str, NULL, base); + } + return default_val; +} + +static inline int +null_arg(char *arg) { + if (arg == NULL || *arg == 0) + return 1; + else + return 0; +} + +/* Parse a partition spec into a partition structure. + * Spec is of the form: + * <start>,<size>,<id>,<bootable>[,<c,h,s>,<c,h,s>] + * We require passing in the disk and mbr so we can + * set reasonable defaults for values, e.g. "the whole disk" + * or "starting after the last partition." + */ +#define N_ARGS 10 +static int +MBR_parse_one_spec(char *line, disk_t *disk, mbr_t *mbr, int pn) +{ + int i; + char *args[N_ARGS]; + prt_t *part = &mbr->part[pn]; + int next_start, next_size; + + /* There are up to 10 arguments. */ + for (i=0; i<N_ARGS; i++) { + char *arg; + while (isspace(*line)) + line++; + arg = strsep(&line, ",\n"); + if (arg == NULL || line == NULL) { + break; + } + args[i] = arg; + } + for (; i<N_ARGS; i++) { + args[i] = NULL; + } + /* Set reasonable defaults. */ + if (pn == 0) { + next_start = 0; + } else { + next_start = mbr->part[pn-1].bs + mbr->part[pn-1].ns; + } + next_size = disk->real->size; + for(i=0; i<pn; i++) { + next_size -= mbr->part[i].ns; + } + + part->id = parse_number(args[2], 0xA8, 16); + if (!null_arg(args[3]) && *args[3] == '*') { + part->flag = 0x80; + } else { + part->flag = 0; + } + /* If you specify the start or end sector, + you have to give both. */ + if ((null_arg(args[0]) && !null_arg(args[1])) || + (!null_arg(args[0]) && null_arg(args[1]))) { + errx(1, "You must specify both start and size, or neither"); + return -1; + } + + /* If you specify one of the CHS args, + you have to give them all. */ + if (!null_arg(args[4])) { + for (i=5; i<10; i++) { + if (null_arg(args[i])) { + errx(1, "Either all CHS arguments must be specified, or none"); + return -1; + } + } + + part->scyl = parse_number(args[4], 0, 10); + part->shead = parse_number(args[5], 0, 10); + part->ssect = parse_number(args[6], 0, 10); + part->scyl = parse_number(args[7], 0, 10); + part->shead = parse_number(args[8], 0, 10); + part->ssect = parse_number(args[9], 0, 10); + if (null_arg(args[0])) { + PRT_fix_BN(disk, part, pn); + } + } else { + /* See if they gave no CHS and no start/end */ + if (null_arg(args[0])) { + errx(1, "You must specify either start sector and size or CHS"); + return -1; + } + } + if (!null_arg(args[0])) { + part->bs = parse_number(args[0], next_start, 10); + part->ns = parse_number(args[1], next_size, 10); + PRT_fix_CHS(disk, part, pn); + } + return 0; +} + + +typedef struct _mbr_chain { + mbr_t mbr; + struct _mbr_chain *next; +} mbr_chain_t; + +/* Parse some number of MBR spec lines. + * Spec is of the form: + * <start>,<size>,<id>,<bootable>[,<c,h,s>,<c,h,s>] + * + */ +mbr_t * +MBR_parse_spec(FILE *f, disk_t *disk) +{ + int lineno; + int offset, firstoffset; + mbr_t *mbr, *head, *prev_mbr; + + head = mbr = prev_mbr = NULL; + firstoffset = 0; + do { + + offset = 0; + for (lineno = 0; lineno < NDOSPART && !feof(f); lineno++) { + char line[256]; + char *str; + prt_t *part; + + do { + str = fgets(line, 256, f); + } while ((str != NULL) && (*str == '\0')); + if (str == NULL) { + break; + } + + if (mbr == NULL) { + mbr = MBR_alloc(prev_mbr); + if (head == NULL) + head = mbr; + } + + if (MBR_parse_one_spec(line, disk, mbr, lineno)) { + /* MBR_parse_one_spec printed the error message. */ + return NULL; + } + part = &mbr->part[lineno]; + if ((part->id == DOSPTYP_EXTEND) || (part->id == DOSPTYP_EXTENDL)) { + offset = part->bs; + if (firstoffset == 0) firstoffset = offset; + } + } + /* If fewer lines than partitions, zero out the rest of the partitions */ + if (mbr != NULL) { + for (; lineno < NDOSPART; lineno++) { + bzero(&mbr->part[lineno], sizeof(prt_t)); + } + } + prev_mbr = mbr; + mbr = NULL; + } while (offset >= 0 && !feof(f)); + + return head; +} + +void +MBR_dump(mbr_t *mbr) +{ + int i; + prt_t *part; + + for (i=0; i<NDOSPART; i++) { + part = &mbr->part[i]; + printf("%d,%d,0x%02X,%c,%d,%d,%d,%d,%d,%d\n", + part->bs, + part->ns, + part->id, + (part->flag == 0x80) ? '*' : '-', + part->scyl, + part->shead, + part->ssect, + part->ecyl, + part->ehead, + part->esect); + } +} + +mbr_t * +MBR_alloc(mbr_t *parent) +{ + mbr_t *mbr = (mbr_t *)malloc(sizeof(mbr_t)); + bzero(mbr, sizeof(mbr_t)); + if (parent) { + parent->next = mbr; + } + mbr->signature = MBR_SIGNATURE; + return mbr; +} + +void +MBR_free(mbr_t *mbr) +{ + mbr_t *tmp; + while (mbr) { + tmp = mbr->next; + free(mbr); + mbr = tmp; + } +} + +/* Read and parse all the partition tables on the disk, + * including extended partitions. + */ +mbr_t * +MBR_read_all(disk_t *disk) +{ + mbr_t *mbr = NULL, *head = NULL; + int i, fd, offset, firstoff; + + fd = DISK_open(disk->name, O_RDONLY); + firstoff = offset = 0; + do { + mbr = MBR_alloc(mbr); + if (head == NULL) { + head = mbr; + } + MBR_read(disk, fd, offset, mbr); + MBR_parse(disk, offset, firstoff, mbr); + if (mbr->signature != MBR_SIGNATURE) { + /* The MBR signature is invalid. */ + break; + } + offset = 0; + for (i=0; i<NDOSPART; i++) { + prt_t *part = &mbr->part[i]; + if ((part->id == DOSPTYP_EXTEND) || (part->id == DOSPTYP_EXTENDL)) { + offset = part->bs; + if (firstoff == 0) { + firstoff = offset; + } + } + } + } while (offset > 0); + DISK_close(fd); + + return head; +} + + +int +MBR_write_all(disk_t *disk, mbr_t *mbr) +{ + int result = 0; + int fd; + + fd = DISK_open(disk->name, O_RDWR); + while (mbr) { + MBR_make(mbr); + result = MBR_write(disk, fd, mbr); + if (result) + break; + mbr = mbr->next; + } + DISK_close(fd); + return result; +} + +void +MBR_print_all(mbr_t *mbr) { + while (mbr) { + MBR_print(mbr); + mbr = mbr->next; + } +} + +void +MBR_dump_all(mbr_t *mbr) { + while (mbr) { + MBR_dump(mbr); + mbr = mbr->next; + } +} + +void +MBR_clear(mbr_t *mbr) { + int i; + if (mbr->next) { + MBR_free(mbr->next); + mbr->next = NULL; + } + for (i=0; i<4; i++) { + bzero(&mbr->part[i], sizeof(mbr->part[i])); + } + bzero(&mbr->buf, sizeof(mbr->buf)); +} + diff --git a/i386/util/fdisk/.svn/text-base/mbr.h.svn-base b/i386/util/fdisk/.svn/text-base/mbr.h.svn-base new file mode 100644 index 0000000..48da747 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/mbr.h.svn-base @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * 2008-05-24: + * Tamas Kosarszky: changed MBR_CODE_SIZE to 0x1B8 to make fdisk + * compatible with Vista and GPT specifications. + * + * Credits goes to Dense for the idea of this modification and + * Kabyl for findig this piece of source. + */ +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MBR_H +#define _MBR_H + +#include "part.h" + +#ifndef NDOSPART +#define NDOSPART 4 +#define DOSPTYP_UNUSED 0 +#define DOSPTYP_EXTEND 5 +#define DOSPTYP_EXTENDL 15 +#define DOSACTIVE 128 +#endif + +/* Various constants */ +#define MBR_CODE_SIZE 0x1B8 +#define MBR_PART_SIZE 0x10 +#define MBR_PART_OFF 0x1BE +#define MBR_SIG_OFF 0x1FE +/* MBR_BUF_SIZE is the largest sector size we support */ +#define MBR_BUF_SIZE 4096 + +#define MBR_SIGNATURE 0xAA55 + +/* MBR type */ +typedef struct _mbr_t { + off_t reloffset; /* the offset of the first extended partition that contains all the rest */ + off_t offset; /* the absolute offset of this partition */ + struct _mbr_t *next; /* pointer to the next MBR in an extended partition chain */ + unsigned char code[MBR_CODE_SIZE]; + unsigned short signature; + prt_t part[NDOSPART]; + unsigned char buf[MBR_BUF_SIZE]; +} mbr_t; + +/* Prototypes */ +void MBR_print_disk __P((char *)); +void MBR_print __P((mbr_t *)); +void MBR_print_all __P((mbr_t *)); +void MBR_parse __P((disk_t *, off_t, off_t, mbr_t *)); +void MBR_make __P((mbr_t *)); +void MBR_init __P((disk_t *, mbr_t *)); +int MBR_read __P((disk_t *,int, off_t, mbr_t *)); +int MBR_write __P((disk_t *,int, mbr_t *)); +void MBR_pcopy __P((disk_t *, mbr_t *)); +mbr_t * MBR_parse_spec __P((FILE *, disk_t *)); +void MBR_dump __P((mbr_t *)); +void MBR_dump_all __P((mbr_t *)); +mbr_t *MBR_alloc __P((mbr_t *)); +void MBR_free __P((mbr_t *)); +mbr_t * MBR_read_all __P((disk_t *)); +int MBR_write_all __P((disk_t *, mbr_t *)); +void MBR_clear __P((mbr_t *)); + +/* Sanity check */ +#include <machine/param.h> +#if (DEV_BSIZE != 512) +#error "DEV_BSIZE != 512, somebody better fix me!" +#endif + +#endif /* _MBR_H */ + diff --git a/i386/util/fdisk/.svn/text-base/mbrcode.h.svn-base b/i386/util/fdisk/.svn/text-base/mbrcode.h.svn-base new file mode 100644 index 0000000..2b8182e --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/mbrcode.h.svn-base @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 2000 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* Largely generated by: + * hexdump -ve '8/1 "0x%02x, " "\n"' /usr/mdec/mbr + */ +0xfa, 0xea, 0x06, 0x00, 0xc0, 0x07, 0x8c, 0xc8, +0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0xfc, 0xff, 0xfb, +0xb0, 0x53, 0xe8, 0xe2, 0x00, 0xb8, 0xa0, 0x07, +0x8e, 0xc0, 0x31, 0xf6, 0x31, 0xff, 0xb9, 0x00, +0x02, 0xfc, 0xf2, 0xa4, 0xea, 0x29, 0x00, 0xa0, +0x07, 0xb0, 0x52, 0xe8, 0xc9, 0x00, 0x1e, 0x07, +0x0e, 0x1f, 0xf6, 0xc2, 0x80, 0x75, 0x0b, 0x66, +0xbe, 0x13, 0x01, 0x00, 0x00, 0xe8, 0xab, 0x00, +0xb2, 0x80, 0x66, 0xbe, 0xbe, 0x01, 0x00, 0x00, +0x66, 0xb9, 0x04, 0x00, 0x00, 0x00, 0xb0, 0x4c, +0xe8, 0xa4, 0x00, 0x8a, 0x44, 0x00, 0x3c, 0x80, +0x74, 0x18, 0x66, 0x83, 0xc6, 0x10, 0xe2, 0xee, +0x66, 0xbe, 0x3c, 0x01, 0x00, 0x00, 0xe8, 0x82, +0x00, 0xfa, 0xf4, 0xb0, 0x2e, 0xe8, 0x87, 0x00, +0xeb, 0xf7, 0xb0, 0x42, 0xe8, 0x80, 0x00, 0x8b, +0x14, 0x8b, 0x4c, 0x02, 0x66, 0xb8, 0x01, 0x02, +0x00, 0x00, 0x31, 0xdb, 0xcd, 0x13, 0x73, 0x13, +0x80, 0xfa, 0x80, 0x75, 0xaa, 0x66, 0xbe, 0x2f, +0x01, 0x00, 0x00, 0xe8, 0x55, 0x00, 0xe8, 0x33, +0x00, 0xeb, 0xce, 0xb0, 0x43, 0xe8, 0x57, 0x00, +0x66, 0x31, 0xc0, 0x66, 0xbb, 0xfe, 0x01, 0x00, +0x00, 0x67, 0x8b, 0x03, 0x66, 0x3d, 0x55, 0xaa, +0x00, 0x00, 0x74, 0x0b, 0x66, 0xbe, 0x52, 0x01, +0x00, 0x00, 0xe8, 0x2e, 0x00, 0xeb, 0xaa, 0xb0, +0x47, 0xe8, 0x33, 0x00, 0x66, 0xea, 0x00, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x50, 0x53, 0x66, 0xbb, +0x03, 0x01, 0x00, 0x00, 0x50, 0x88, 0xe0, 0x66, +0x83, 0xe0, 0x0f, 0xd7, 0xe8, 0x18, 0x00, 0x58, +0x66, 0x83, 0xe0, 0x0f, 0xd7, 0xe8, 0x0f, 0x00, +0x5b, 0x58, 0xc3, 0x50, 0xfc, 0xac, 0x84, 0xc0, +0x74, 0x0f, 0xe8, 0x02, 0x00, 0xeb, 0xf6, 0x50, +0x53, 0xb4, 0x0e, 0x31, 0xdb, 0x43, 0xcd, 0x10, +0x5b, 0x58, 0xc3, 0x30, 0x31, 0x32, 0x33, 0x34, +0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, +0x44, 0x45, 0x46, 0x4d, 0x42, 0x52, 0x20, 0x6f, +0x6e, 0x20, 0x66, 0x6c, 0x6f, 0x70, 0x70, 0x79, +0x20, 0x6f, 0x72, 0x20, 0x6f, 0x6c, 0x64, 0x20, +0x42, 0x49, 0x4f, 0x53, 0x0d, 0x0a, 0x00, 0x52, +0x65, 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, +0x72, 0x0d, 0x0a, 0x00, 0x4e, 0x6f, 0x20, 0x61, +0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, +0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x0d, +0x0a, 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, +0x64, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, +0x75, 0x72, 0x65, 0x0d, 0x0a, 0x00, 0x90, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x01, 0x00, 0xa6, 0xff, 0xff, 0xff, 0x00, 0x00, +0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x55, 0xaa, diff --git a/i386/util/fdisk/.svn/text-base/misc.c.svn-base b/i386/util/fdisk/.svn/text-base/misc.c.svn-base new file mode 100644 index 0000000..0598b4c --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/misc.c.svn-base @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include "misc.h" + + +int +ask_cmd(cmd) + cmd_t *cmd; +{ + char lbuf[100], *cp, *buf; + + /* Get input */ + if (fgets(lbuf, sizeof lbuf, stdin) == NULL) + errx(1, "eof"); + lbuf[strlen(lbuf)-1] = '\0'; + + /* Parse input */ + buf = lbuf; + buf = &buf[strspn(buf, " \t")]; + cp = &buf[strcspn(buf, " \t")]; + *cp++ = '\0'; + strncpy(cmd->cmd, buf, 10); + buf = &cp[strspn(cp, " \t")]; + strncpy(cmd->args, buf, 100); + + return (0); +} + +int +ask_num(str, flags, dflt, low, high, help) + const char *str; + int flags; + int dflt; + int low; + int high; + void (*help) __P((void)); +{ + char lbuf[100], *cp; + int num; + + do { +again: + num = dflt; + if (flags == ASK_HEX) + printf("%s [%X - %X]: [%X] ", str, low, high, num); + else + printf("%s [%d - %d]: [%d] ", str, low, high, num); + if (help) + printf("(? for help) "); + + if (fgets(lbuf, sizeof lbuf, stdin) == NULL) + errx(1, "eof"); + lbuf[strlen(lbuf)-1] = '\0'; + + if (help && lbuf[0] == '?') { + (*help)(); + goto again; + } + + /* Convert */ + cp = lbuf; + num = strtol(lbuf, &cp, ((flags==ASK_HEX)?16:10)); + + /* Make sure only number present */ + if (cp == lbuf) + num = dflt; + if (*cp != '\0') { + printf("'%s' is not a valid number.\n", lbuf); + num = low - 1; + } else if (num < low || num > high) { + printf("'%d' is out of range.\n", num); + } + } while (num < low || num > high); + + return (num); +} + +int +ask_yn(str, default_answer) + const char *str; + int default_answer; +{ + int ch, first; + + printf("%s [%c] ", str, default_answer ? 'y' : 'n'); + fflush(stdout); + + first = ch = getchar(); + while (ch != '\n' && ch != EOF) + ch = getchar(); + + if (ch == EOF || first == EOF) + errx(1, "eof"); + + if (first == '\n') + return default_answer; + + return (first == 'y' || first == 'Y'); +} + +u_int16_t +getshort(p) + void *p; +{ + unsigned char *cp = p; + + return (cp[0] | (cp[1] << 8)); +} + +void +putshort( + void *p, + u_int16_t l) +{ + unsigned char *cp = p; + + *cp++ = l; + *cp++ = l >> 8; +} + +u_int32_t +getlong(p) + void *p; +{ + unsigned char *cp = p; + + return (cp[0] | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24)); +} + +void +putlong(p, l) + void *p; + u_int32_t l; +{ + unsigned char *cp = p; + + *cp++ = l; + *cp++ = l >> 8; + *cp++ = l >> 16; + *cp++ = l >> 24; +} diff --git a/i386/util/fdisk/.svn/text-base/misc.h.svn-base b/i386/util/fdisk/.svn/text-base/misc.h.svn-base new file mode 100644 index 0000000..cc8e2b8 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/misc.h.svn-base @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MISC_H +#define _MISC_H + +#include <sys/types.h> +#include "cmd.h" + +/* Constants */ +#define ASK_HEX 0x01 +#define ASK_DEC 0x02 + +/* Prototypes */ +int ask_cmd __P((cmd_t *)); +int ask_num __P((const char *, int, int, int, int, void (*help) __P((void)))); +int ask_yn __P((const char *, int)); +u_int16_t getshort __P((void *)); +u_int32_t getlong __P((void *)); +void putshort __P((void *, u_int16_t)); +void putlong __P((void *, u_int32_t)); + +#endif /* _MISC_H */ + diff --git a/i386/util/fdisk/.svn/text-base/opendev.c.svn-base b/i386/util/fdisk/.svn/text-base/opendev.c.svn-base new file mode 100644 index 0000000..538e4e6 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/opendev.c.svn-base @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 2000, Todd C. Miller. All rights reserved. + * Copyright (c) 1996, Jason Downs. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <errno.h> +#include <fcntl.h> +#include <limits.h> +#include <paths.h> +#include <stdio.h> +#include <string.h> + +#include "util.h" +/* + * This routine is a generic rewrite of the original code found in + * disklabel(8). + */ + +int +opendev(path, oflags, dflags, realpath) + char *path; + int oflags; + int dflags; + char **realpath; +{ + int fd; + char *slash, *prefix; + static char namebuf[PATH_MAX]; + + /* Initial state */ + if (realpath) + *realpath = path; + fd = -1; + errno = ENOENT; + + if (dflags & OPENDEV_BLCK) + prefix = ""; /* block device */ + else + prefix = "r"; /* character device */ + + if ((slash = strchr(path, '/'))) + fd = open(path, oflags); + else if (dflags & OPENDEV_PART) { + /* + * First try raw partition (for removable drives) + */ + if (snprintf(namebuf, sizeof(namebuf), "%s%s%s%c", + _PATH_DEV, prefix, path, 'a' + getrawpartition()) + < sizeof(namebuf)) { + fd = open(namebuf, oflags); + if (realpath) + *realpath = namebuf; + } else + errno = ENAMETOOLONG; + } + if (!slash && fd == -1 && errno == ENOENT) { + if (snprintf(namebuf, sizeof(namebuf), "%s%s%s", + _PATH_DEV, prefix, path) < sizeof(namebuf)) { + fd = open(namebuf, oflags); + if (realpath) + *realpath = namebuf; + } else + errno = ENAMETOOLONG; + } + return (fd); +} diff --git a/i386/util/fdisk/.svn/text-base/part.c.svn-base b/i386/util/fdisk/.svn/text-base/part.c.svn-base new file mode 100644 index 0000000..1f5fa6a --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/part.c.svn-base @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * 2008-05-24: + * Tamas Kosarszky: changed caption for partition type 0x07 + * and added caption for type 0xEE. + */ +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <machine/param.h> +#include "disk.h" +#include "misc.h" +#include "mbr.h" + + +static const struct part_type { + int type; + char sname[14]; + char *lname; +} part_types[] = { + { 0x00, "unused ", "unused"}, + { 0x01, "DOS FAT-12 ", "Primary DOS with 12 bit FAT"}, + { 0x02, "XENIX / ", "XENIX / filesystem"}, + { 0x03, "XENIX /usr ", "XENIX /usr filesystem"}, + { 0x04, "DOS FAT-16 ", "Primary DOS with 16 bit FAT"}, + { 0x05, "Extended DOS", "Extended DOS"}, + { 0x06, "DOS > 32MB ", "Primary 'big' DOS (> 32MB)"}, + { 0x07, "NTFS ", "Windows NT NTFS"}, + { 0x08, "AIX fs ", "AIX filesystem"}, + { 0x09, "AIX/Coherent", "AIX boot partition or Coherent"}, + { 0x0A, "OS/2 Bootmgr", "OS/2 Boot Manager or OPUS"}, + { 0x0B, "Win95 FAT-32", "Primary Win95 w/ 32-bit FAT"}, + { 0x0C, "Win95 FAT32L", "Primary Win95 w/ 32-bit FAT LBA-mapped"}, + { 0x0E, "DOS FAT-16 ", "Primary DOS w/ 16-bit FAT, CHS-mapped"}, + { 0x0F, "Extended LBA", "Extended DOS LBA-mapped"}, + { 0x10, "OPUS ", "OPUS"}, + { 0x11, "OS/2 hidden ", "OS/2 BM: hidden DOS 12-bit FAT"}, + { 0x12, "Compaq Diag.", "Compaq Diagnostics"}, + { 0x14, "OS/2 hidden ", "OS/2 BM: hidden DOS 16-bit FAT <32M or Novell DOS 7.0 bug"}, + { 0x16, "OS/2 hidden ", "OS/2 BM: hidden DOS 16-bit FAT >=32M"}, + { 0x17, "OS/2 hidden ", "OS/2 BM: hidden IFS"}, + { 0x18, "AST swap ", "AST Windows swapfile"}, + { 0x19, "Willowtech ", "Willowtech Photon coS"}, + { 0x20, "Willowsoft ", "Willowsoft OFS1"}, + { 0x24, "NEC DOS ", "NEC DOS"}, + { 0x38, "Theos ", "Theos"}, + { 0x39, "Plan 9 ", "Plan 9"}, + { 0x40, "VENIX 286 ", "VENIX 286 or LynxOS"}, + { 0x41, "Lin/Minux DR", "Linux/MINIX (sharing disk with DRDOS) or Personal RISC boot"}, + { 0x42, "LinuxSwap DR", "SFS or Linux swap (sharing disk with DRDOS)"}, + { 0x43, "Linux DR ", "Linux native (sharing disk with DRDOS)"}, + { 0x4D, "QNX 4.2 Pri ", "QNX 4.2 Primary"}, + { 0x4E, "QNX 4.2 Sec ", "QNX 4.2 Secondary"}, + { 0x4F, "QNX 4.2 Ter ", "QNX 4.2 Tertiary"}, + { 0x50, "DM ", "DM (disk manager)"}, + { 0x51, "DM ", "DM6 Aux1 (or Novell)"}, + { 0x52, "CP/M or SysV", "CP/M or Microport SysV/AT"}, + { 0x53, "DM ", "DM6 Aux3"}, + { 0x54, "Ontrack ", "Ontrack"}, + { 0x55, "EZ-Drive ", "EZ-Drive (disk manager)"}, + { 0x56, "Golden Bow ", "Golden Bow (disk manager)"}, + { 0x5C, "Priam ", "Priam Edisk (disk manager)"}, + { 0x61, "SpeedStor ", "SpeedStor"}, + { 0x63, "ISC, HURD, *", "ISC, System V/386, GNU HURD or Mach"}, + { 0x64, "Netware 2.xx", "Novell Netware 2.xx"}, + { 0x65, "Netware 3.xx", "Novell Netware 3.xx"}, + { 0x66, "Netware 386 ", "Novell 386 Netware"}, + { 0x67, "Novell ", "Novell"}, + { 0x68, "Novell ", "Novell"}, + { 0x69, "Novell ", "Novell"}, + { 0x70, "DiskSecure ", "DiskSecure Multi-Boot"}, + { 0x75, "PCIX ", "PCIX"}, + { 0x80, "Minix (old) ", "Minix 1.1 ... 1.4a"}, + { 0x81, "Minix (new) ", "Minix 1.4b ... 1.5.10"}, + { 0x82, "Linux swap ", "Linux swap"}, + { 0x83, "Linux files*", "Linux filesystem"}, + { 0x93, "Amoeba file*", "Amoeba filesystem"}, + { 0x94, "Amoeba BBT ", "Amoeba bad block table"}, + { 0x84, "OS/2 hidden ", "OS/2 hidden C: drive"}, + { 0x85, "Linux ext. ", "Linux extended"}, + { 0x86, "NT FAT VS ", "NT FAT volume set"}, + { 0x87, "NTFS VS ", "NTFS volume set or HPFS mirrored"}, + { 0x93, "Amoeba FS ", "Amoeba filesystem"}, + { 0x94, "Amoeba BBT ", "Amoeba bad block table"}, + { 0x99, "Mylex ", "Mylex EISA SCSI"}, + { 0x9F, "BSDI ", "BSDI BSD/OS"}, + { 0xA0, "NotebookSave", "Phoenix NoteBIOS save-to-disk"}, + { 0xA5, "FreeBSD ", "FreeBSD"}, + { 0xA6, "OpenBSD ", "OpenBSD"}, + { 0xA7, "NEXTSTEP ", "NEXTSTEP"}, + { 0xA8, "Darwin UFS ", "Darwin UFS partition"}, + { 0xA9, "NetBSD ", "NetBSD"}, + { 0xAB, "Darwin Boot ", "Darwin boot partition"}, + { 0xAF, "HFS+ ", "Darwin HFS+ partition"}, + { 0xB7, "BSDI filesy*", "BSDI BSD/386 filesystem"}, + { 0xB8, "BSDI swap ", "BSDI BSD/386 swap"}, + { 0xC0, "CTOS ", "CTOS"}, + { 0xC1, "DRDOSs FAT12", "DRDOS/sec (FAT-12)"}, + { 0xC4, "DRDOSs < 32M", "DRDOS/sec (FAT-16, < 32M)"}, + { 0xC6, "DRDOSs >=32M", "DRDOS/sec (FAT-16, >= 32M)"}, + { 0xC7, "HPFS Disbled", "Syrinx (Cyrnix?) or HPFS disabled"}, + { 0xDB, "CPM/C.DOS/C*", "Concurrent CPM or C.DOS or CTOS"}, + { 0xE1, "SpeedStor ", "DOS access or SpeedStor 12-bit FAT extended partition"}, + { 0xE3, "SpeedStor ", "DOS R/O or SpeedStor or Storage Dimensions"}, + { 0xE4, "SpeedStor ", "SpeedStor 16-bit FAT extended partition < 1024 cyl."}, + { 0xEB, "BeOS/i386 ", "BeOS for Intel"}, + { 0xEE, "GPT ", "GPT protective partition"}, + { 0xF1, "SpeedStor ", "SpeedStor or Storage Dimensions"}, + { 0xF2, "DOS 3.3+ Sec", "DOS 3.3+ Secondary"}, + { 0xF4, "SpeedStor ", "SpeedStor >1024 cyl. or LANstep or IBM PS/2 IML"}, + { 0xFF, "Xenix BBT ", "Xenix Bad Block Table"}, +}; + +void +PRT_printall() +{ + int i, idrows; + + idrows = ((sizeof(part_types)/sizeof(struct part_type))+3)/4; + + printf("Choose from the following Partition id values:\n"); + for (i = 0; i < idrows; i++) { + printf("%02X %s %02X %s %02X %s" + , part_types[i ].type, part_types[i ].sname + , part_types[i+idrows ].type, part_types[i+idrows ].sname + , part_types[i+idrows*2].type, part_types[i+idrows*2].sname + ); + if ((i+idrows*3) < (sizeof(part_types)/sizeof(struct part_type))) { + printf(" %02X %s\n" + , part_types[i+idrows*3].type, part_types[i+idrows*3].sname ); + } + else + printf( "\n" ); + } +} + +const char * +PRT_ascii_id(id) + int id; +{ + static char unknown[] = "<Unknown ID>"; + int i; + + for (i = 0; i < sizeof(part_types)/sizeof(struct part_type); i++) { + if (part_types[i].type == id) + return (part_types[i].sname); + } + + return (unknown); +} + +void +PRT_parse(disk, prt, offset, reloff, partn, pn) + disk_t *disk; + void *prt; + off_t offset; + off_t reloff; + prt_t *partn; + int pn; +{ + unsigned char *p = prt; + off_t off; + + partn->flag = *p++; + partn->shead = *p++; + + partn->ssect = (*p) & 0x3F; + partn->scyl = ((*p << 2) & 0xFF00) | (*(p+1)); + p += 2; + + partn->id = *p++; + partn->ehead = *p++; + partn->esect = (*p) & 0x3F; + partn->ecyl = ((*p << 2) & 0xFF00) | (*(p+1)); + p += 2; + + if ((partn->id == DOSPTYP_EXTEND) || (partn->id == DOSPTYP_EXTENDL)) + off = reloff; + else + off = offset; + + partn->bs = getlong(p) + off; + partn->ns = getlong(p+4); + + + /* Zero out entry if not used */ + if (partn->id == DOSPTYP_UNUSED ) { + memset(partn, 0, sizeof(*partn)); + } +} + +int +PRT_check_chs(partn) + prt_t *partn; +{ + if ( (partn->shead > 255) || + (partn->ssect >63) || + (partn->scyl > 1023) || + (partn->ehead >255) || + (partn->esect >63) || + (partn->ecyl > 1023) ) + { + return 0; + } + return 1; +} +void +PRT_make(partn, offset, reloff, prt) + prt_t *partn; + off_t offset; + off_t reloff; + void *prt; +{ + unsigned char *p = prt; + prt_t tmp; + off_t off; + + tmp.shead = partn->shead; + tmp.ssect = partn->ssect; + tmp.scyl = (partn->scyl > 1023)? 1023: partn->scyl; + tmp.ehead = partn->ehead; + tmp.esect = partn->esect; + tmp.ecyl = (partn->ecyl > 1023)? 1023: partn->ecyl; + if (!PRT_check_chs(partn) && PRT_check_chs(&tmp)) { + partn->shead = tmp.shead; + partn->ssect = tmp.ssect; + partn->scyl = tmp.scyl; + partn->ehead = tmp.ehead; + partn->esect = tmp.esect; + partn->ecyl = tmp.ecyl; + printf("Cylinder values are modified to fit in CHS.\n"); + } + if ((partn->id == DOSPTYP_EXTEND) || (partn->id == DOSPTYP_EXTENDL)) + off = reloff; + else + off = offset; + + if (PRT_check_chs(partn)) { + *p++ = partn->flag & 0xFF; + + *p++ = partn->shead & 0xFF; + *p++ = (partn->ssect & 0x3F) | ((partn->scyl & 0x300) >> 2); + *p++ = partn->scyl & 0xFF; + + *p++ = partn->id & 0xFF; + + *p++ = partn->ehead & 0xFF; + *p++ = (partn->esect & 0x3F) | ((partn->ecyl & 0x300) >> 2); + *p++ = partn->ecyl & 0xFF; + } else { + /* should this really keep flag, id and set others to 0xff? */ + *p++ = partn->flag & 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + *p++ = partn->id & 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + printf("Warning CHS values out of bounds only saving LBA values\n"); + } + + putlong(p, partn->bs - off); + putlong(p+4, partn->ns); +} + +void +PRT_print(num, partn) + int num; + prt_t *partn; +{ + + if (partn == NULL) { + printf(" Starting Ending\n"); + printf(" #: id cyl hd sec - cyl hd sec [ start - size]\n"); + printf("------------------------------------------------------------------------\n"); + } else { + printf("%c%1d: %.2X %4d %3d %3d - %4d %3d %3d [%10d - %10d] %s\n", + (partn->flag == 0x80)?'*':' ', + num + 1, partn->id, + partn->scyl, partn->shead, partn->ssect, + partn->ecyl, partn->ehead, partn->esect, + partn->bs, partn->ns, + PRT_ascii_id(partn->id)); + } +} + +void +PRT_fix_BN(disk, part, pn) + disk_t *disk; + prt_t *part; + int pn; +{ + int spt, tpc, spc; + int start = 0; + int end = 0; + + /* Zero out entry if not used */ + if (part->id == DOSPTYP_UNUSED ) { + memset(part, 0, sizeof(*part)); + return; + } + + /* Disk metrics */ + spt = disk->real->sectors; + tpc = disk->real->heads; + spc = spt * tpc; + + start += part->scyl * spc; + start += part->shead * spt; + start += part->ssect - 1; + + end += part->ecyl * spc; + end += part->ehead * spt; + end += part->esect - 1; + + /* XXX - Should handle this... */ + if (start > end) + warn("Start of partition #%d after end!", pn); + + part->bs = start; + part->ns = (end - start) + 1; +} + +void +PRT_fix_CHS(disk, part, pn) + disk_t *disk; + prt_t *part; + int pn; +{ + int spt, tpc, spc; + int start; + int cyl, head, sect; + + /* Zero out entry if not used */ + if (part->id == DOSPTYP_UNUSED ) { + memset(part, 0, sizeof(*part)); + return; + } + + /* Disk metrics */ + spt = disk->real->sectors; + tpc = disk->real->heads; + spc = spt * tpc; + + start = part->bs; + + if(start <= spt) { + /* Figure out "real" starting CHS values */ + cyl = (start / spc); start -= (cyl * spc); + head = (start / spt); start -= (head * spt); + sect = (start + 1); + } else { + cyl = 1023; + head = 254; + sect = 63; + } + + part->scyl = cyl; + part->shead = head; + part->ssect = sect; + + /* use fake geometry to trigger LBA mode */ + + cyl = 1023; + head = 254; + sect = 63; + + part->ecyl = cyl; + part->ehead = head; + part->esect = sect; +} + diff --git a/i386/util/fdisk/.svn/text-base/part.h.svn-base b/i386/util/fdisk/.svn/text-base/part.h.svn-base new file mode 100644 index 0000000..049cf2c --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/part.h.svn-base @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _PART_H +#define _PART_H + +/* Partition type */ +typedef struct _prt_t { + int shead, scyl, ssect; + int ehead, ecyl, esect; + int bs; + int ns; + unsigned char flag; + unsigned char id; +} prt_t; + +/* Prototypes */ +void PRT_printall __P((void)); +const char *PRT_ascii_id __P((int)); +void PRT_parse __P((disk_t *, void *, off_t, off_t, prt_t *, int)); +void PRT_make __P((prt_t *, off_t, off_t, void *)); +void PRT_print __P((int, prt_t *)); + +/* This does CHS -> bs/ns */ +void PRT_fix_BN __P((disk_t *, prt_t *, int)); + +/* This does bs/ns -> CHS */ +void PRT_fix_CHS __P((disk_t *, prt_t *, int)); +#endif /* _PART_H */ + diff --git a/i386/util/fdisk/.svn/text-base/user.c.svn-base b/i386/util/fdisk/.svn/text-base/user.c.svn-base new file mode 100644 index 0000000..cfd745f --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/user.c.svn-base @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <sys/fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <machine/param.h> +#include "user.h" +#include "disk.h" +#include "misc.h" +#include "mbr.h" +#include "cmd.h" + + +/* Our command table */ +static cmd_table_t cmd_table[] = { + {"help", Xhelp, "Command help list"}, + {"manual", Xmanual, "Show entire man page for fdisk"}, + {"reinit", Xreinit, "Re-initialize loaded MBR (to defaults)"}, + {"auto", Xauto, "Auto-partition the disk with a partition style"}, + {"setpid", Xsetpid, "Set the identifier of a given table entry"}, + {"disk", Xdisk, "Edit current drive stats"}, + {"edit", Xedit, "Edit given table entry"}, + {"erase", Xerase, "Erase current MBR"}, + {"flag", Xflag, "Flag given table entry as bootable"}, + {"update", Xupdate, "Update machine code in loaded MBR"}, + {"select", Xselect, "Select extended partition table entry MBR"}, + {"print", Xprint, "Print loaded MBR partition table"}, + {"write", Xwrite, "Write loaded MBR to disk"}, + {"exit", Xexit, "Exit edit of current MBR, without saving changes"}, + {"quit", Xquit, "Quit edit of current MBR, saving current changes"}, + {"abort", Xabort, "Abort program without saving current changes"}, + {NULL, NULL, NULL} +}; + + +int +USER_write(disk, tt, preserve, force) + disk_t *disk; + mbr_t *tt; /* Template MBR to write */ + int preserve; /* Preserve partition table and just write boot code */ + int force; /* Don't ask any questions */ +{ + int fd, yn; + char *msgp = "\nDo you wish to write new MBR?"; + char *msgk = "\nDo you wish to write new MBR and partition table?"; + + /* Write sector 0 */ + if (force) { + yn = 1; + } else { + printf("\a\n" + "\t-----------------------------------------------------\n" + "\t------ ATTENTION - UPDATING MASTER BOOT RECORD ------\n" + "\t-----------------------------------------------------\n"); + if (preserve) + yn = ask_yn(msgp, 0); + else + yn = ask_yn(msgk, 0); + } + + if (yn) { + if (preserve) { + int shared; + /* Only write the first one, if there's more than one in an extended partition chain */ + /* Since we're updating boot code, we don't require exclusive access */ + fd = DISK_openshared(disk->name, O_RDWR, &shared); + MBR_make(tt); + MBR_write(disk, fd, tt); + DISK_close(fd); + } else { + MBR_write_all(disk, tt); + } + } else { + printf("MBR is unchanged\n"); + } + + return (0); +} + + +int +USER_modify(disk, tt, offset, reloff) + disk_t *disk; + mbr_t *tt; + off_t offset; + off_t reloff; +{ + static int editlevel; + mbr_t *mbr; + cmd_t cmd; + int i, st, fd; + int modified = 0; + + /* One level deeper */ + editlevel += 1; + + /* Set up command table pointer */ + cmd.table = cmd_table; + + /* Read MBR & partition */ + mbr = MBR_alloc(NULL); + fd = DISK_open(disk->name, O_RDONLY); + MBR_read(disk, fd, offset, mbr); + DISK_close(fd); + + /* Parse the sucker */ + MBR_parse(disk, offset, reloff, mbr); + + if (mbr->signature != MBR_SIGNATURE) { + int yn = ask_yn("The signature for this MBR is invalid.\nWould you like to initialize the partition table?", 1); + if (yn) { + strcpy(cmd.cmd, "erase"); + cmd.args[0] = '\0'; + st = Xerase(&cmd, disk, mbr, tt, offset); + modified = 1; + } + } + + printf("Enter 'help' for information\n"); + + /* Edit cycle */ + do { +again: + printf("fdisk:%c%d> ", (modified)?'*':' ', editlevel); + fflush(stdout); + ask_cmd(&cmd); + + if (cmd.cmd[0] == '\0') + goto again; + for (i = 0; cmd_table[i].cmd != NULL; i++) + if (strstr(cmd_table[i].cmd, cmd.cmd)==cmd_table[i].cmd) + break; + + /* Quick hack to put in '?' == 'help' */ + if (!strcmp(cmd.cmd, "?")) + i = 0; + + /* Check for valid command */ + if (cmd_table[i].cmd == NULL) { + printf("Invalid command '%s'. Try 'help'.\n", cmd.cmd); + continue; + } else + strcpy(cmd.cmd, cmd_table[i].cmd); + + /* Call function */ + st = cmd_table[i].fcn(&cmd, disk, mbr, tt, offset); + + /* Update status */ + if (st == CMD_EXIT) + break; + if (st == CMD_SAVE) + break; + if (st == CMD_CLEAN) + modified = 0; + if (st == CMD_DIRTY) + modified = 1; + } while (1); + + /* Write out MBR */ + if (modified) { + if (st == CMD_SAVE) { + int shared = 0; + printf("Writing current MBR to disk.\n"); + fd = DISK_openshared(disk->name, O_RDWR, &shared); + if(shared) { + if(!ask_yn("Device could not be accessed exclusively.\nA reboot will be needed for changes to take effect. OK?", 0)) { + close(fd); + goto again; + } + } + + MBR_make(mbr); + MBR_write(disk, fd, mbr); + close(fd); + } else { + int yn = ask_yn("MBR was modified; really quit without saving?", 0); + if (yn) { + printf("Aborting changes to current MBR.\n"); + } else { + goto again; + } + } + } + + /* One level less */ + editlevel -= 1; + + MBR_free(mbr); + + return (0); +} + +int +USER_print_disk(disk, do_dump) + disk_t *disk; + int do_dump; +{ + int fd, offset, firstoff; + mbr_t *mbr; + + fd = DISK_open(disk->name, O_RDONLY); + offset = firstoff = 0; + + if (!do_dump) + DISK_printmetrics(disk); + + mbr = MBR_read_all(disk); + if (do_dump) + MBR_dump_all(mbr); + else + MBR_print_all(mbr); + MBR_free(mbr); + + return (DISK_close(fd)); +} + + + diff --git a/i386/util/fdisk/.svn/text-base/user.h.svn-base b/i386/util/fdisk/.svn/text-base/user.h.svn-base new file mode 100644 index 0000000..7234c98 --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/user.h.svn-base @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _USER_H +#define _USER_H + +#include "disk.h" +#include "mbr.h" + +/* Prototypes */ +int USER_write __P((disk_t *, mbr_t *, int, int)); +int USER_modify __P((disk_t *, mbr_t *, off_t, off_t)); +int USER_print_disk __P((disk_t *, int)); +#endif /* _USER_H */ + diff --git a/i386/util/fdisk/.svn/text-base/util.h.svn-base b/i386/util/fdisk/.svn/text-base/util.h.svn-base new file mode 100644 index 0000000..4e1600d --- /dev/null +++ b/i386/util/fdisk/.svn/text-base/util.h.svn-base @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*- + * Copyright (c) 1995 + * The Regents of the University of California. All rights reserved. + * Portions Copyright (c) 1996, Jason Downs. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +/* + * fparseln() specific operation flags. + */ +#define FPARSELN_UNESCESC 0x01 +#define FPARSELN_UNESCCONT 0x02 +#define FPARSELN_UNESCCOMM 0x04 +#define FPARSELN_UNESCREST 0x08 +#define FPARSELN_UNESCALL 0x0f + +/* + * opendev() specific operation flags. + */ +#define OPENDEV_PART 0x01 /* Try to open the raw partition. */ +#define OPENDEV_DRCT 0x02 /* Obsolete (now default behavior). */ +#define OPENDEV_BLCK 0x04 /* Open block, not character device. */ + +/* + * uucplock(3) specific flags. + */ +#define UU_LOCK_INUSE (1) +#define UU_LOCK_OK (0) +#define UU_LOCK_OPEN_ERR (-1) +#define UU_LOCK_READ_ERR (-2) +#define UU_LOCK_CREAT_ERR (-3) +#define UU_LOCK_WRITE_ERR (-4) +#define UU_LOCK_LINK_ERR (-5) +#define UU_LOCK_TRY_ERR (-6) +#define UU_LOCK_OWNER_ERR (-7) + +/* + * stub struct definitions. + */ +struct __sFILE; +struct login_cap; +struct passwd; +struct termios; +struct winsize; + +__BEGIN_DECLS +char *fparseln __P((struct __sFILE *, size_t *, size_t *, const char[3], int)); +int login_tty __P((int)); +int logout __P((const char *)); +void logwtmp __P((const char *, const char *, const char *)); +int opendev __P((char *, int, int, char **)); +int pidfile __P((const char *)); +void pw_setdir __P((const char *)); +char *pw_file __P((const char *)); +int pw_lock __P((int retries)); +int pw_mkdb __P((char *, int)); +int pw_abort __P((void)); +void pw_init __P((void)); +void pw_edit __P((int, const char *)); +void pw_prompt __P((void)); +void pw_copy __P((int, int, struct passwd *)); +void pw_getconf __P((char *, size_t, const char *, const char *)); +int pw_scan __P((char *, struct passwd *, int *)); +void pw_error __P((const char *, int, int)); +int openpty __P((int *, int *, char *, struct termios *, + struct winsize *)); +int opendisk __P((const char *path, int flags, char *buf, size_t buflen, + int iscooked)); +pid_t forkpty __P((int *, char *, struct termios *, struct winsize *)); +int getmaxpartitions __P((void)); +int getrawpartition __P((void)); +void login_fbtab __P((char *, uid_t, gid_t)); +int login_check_expire __P((struct __sFILE *, struct passwd *, char *, int)); +char *readlabelfs __P((char *, int)); +const char *uu_lockerr __P((int _uu_lockresult)); +int uu_lock __P((const char *_ttyname)); +int uu_lock_txfr __P((const char *_ttyname, pid_t _pid)); +int uu_unlock __P((const char *_ttyname)); +__END_DECLS + +#endif /* !_UTIL_H_ */ diff --git a/i386/util/fdisk/Cconfig b/i386/util/fdisk/Cconfig new file mode 100644 index 0000000..bd9129f --- /dev/null +++ b/i386/util/fdisk/Cconfig @@ -0,0 +1,7 @@ +config FDISK440 + bool "fdisk440 utility" + default y + help + Say Y here if you want to compile the fdisk440 utility. + fdisk440 is used to update the boot0 file on the partition by replacing the first 440 bytes, instead of the first 446 bytes as with fdisk. + When in doubt, say "Y". diff --git a/i386/util/fdisk/Makefile b/i386/util/fdisk/Makefile new file mode 100644 index 0000000..5d0a4a2 --- /dev/null +++ b/i386/util/fdisk/Makefile @@ -0,0 +1,53 @@ +SRCROOT = $(abspath $(CURDIR)/../../..) +OBJROOT = $(SRCROOT)/obj/i386/util/fdisk +SYMROOT = $(SRCROOT)/sym/i386 +DSTROOT = $(SRCROOT)/dst/i386 +DOCROOT = $(SRCROOT)/doc +IMGROOT = $(SRCROOT)/sym/cache +IMGSKELROOT = $(SRCROOT)/imgskel +CDBOOT = ${IMGROOT}/usr/standalone/i386/cdboot + + +DIR = fdisk + +include ${SRCROOT}/Make.rules + + +LDFLAGS := $(LDFALGS) -mmacosx-version-min=10.5 + + +OBJS = cmd.o32 disk.o32 fdisk.o32 getrawpartition.o32 mbr.o32 misc.o32 opendev.o32 part.o32 user.o32 auto.o32 \ + cmd.o64 disk.o64 fdisk.o64 getrawpartition.o64 mbr.o64 misc.o64 opendev.o64 part.o64 user.o64 auto.o64 + +OBJS := $(addprefix $(OBJROOT)/, $(OBJS)) + +PROGRAM = fdisk440 +PROGRAM:= $(addprefix $(SYMROOT)/, $(PROGRAM)) + +ifeq ($(CONFIG_FDISK440),y) + +all: $(SYMROOT) $(OBJROOT) $(PROGRAM) + +$(PROGRAM): $(OBJS) + @echo "\t[LD32] $@_32" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $@_32 $(filter %.o32,$^) + @echo "\t[LD64] $@_64" + @$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $@_64 $(filter %.o64,$^) + @echo "\t[LIPO] $@" + @lipo -create -arch i386 $@_32 -arch x86_64 $@_64 -output $@ + @rm $@_32 $@_64 + +else + +all: + +endif + + +#dependencies +-include $(OBJROOT)/Makedep + +clean-local: + @for p in $(PROGRAMS); do if [ -f "$${p}" ];then echo "\t[RM] $${p}"; fi; done + @for o in $(OBJS); do if [ -f "$${o}" ];then echo "\t[RM] $${o}"; fi; done + @rm -f $(PROGRAM) $(OBJS) diff --git a/i386/util/fdisk/auto.c b/i386/util/fdisk/auto.c new file mode 100644 index 0000000..c641c55 --- /dev/null +++ b/i386/util/fdisk/auto.c @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Auto partitioning code. + */ + +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <err.h> +#include "disk.h" +#include "mbr.h" +#include "auto.h" + +int AUTO_boothfs __P((disk_t *, mbr_t *)); +int AUTO_bootufs __P((disk_t *, mbr_t *)); +int AUTO_hfs __P((disk_t *, mbr_t *)); +int AUTO_ufs __P((disk_t *, mbr_t *)); +int AUTO_dos __P((disk_t *, mbr_t *)); +int AUTO_raid __P((disk_t *, mbr_t *)); + +/* The default style is the first one in the list */ +struct _auto_style { + char *style_name; + int (*style_fn)(disk_t *, mbr_t *); + char *description; +} style_fns[] = { + {"boothfs", AUTO_boothfs, "8Mb boot plus HFS+ root partition"}, + {"bootufs", AUTO_bootufs, "8Mb boot plus UFS root partition"}, + {"hfs", AUTO_hfs, "Entire disk as one HFS+ partition"}, + {"ufs", AUTO_ufs, "Entire disk as one UFS partition"}, + {"dos", AUTO_dos, "Entire disk as one DOS partition"}, + {"raid", AUTO_raid, "Entire disk as one 0xAC partition"}, + {0,0} +}; + +void +AUTO_print_styles(FILE *f) +{ + struct _auto_style *fp; + int i; + + for (i=0, fp = &style_fns[0]; fp->style_name != NULL; i++, fp++) { + fprintf(f, " %-10s %s%s\n", fp->style_name, fp->description, (i==0) ? " (default)" : ""); + } +} + + +int +AUTO_init(disk_t *disk, char *style, mbr_t *mbr) +{ + struct _auto_style *fp; + + for (fp = &style_fns[0]; fp->style_name != NULL; fp++) { + /* If style is NULL, use the first (default) style */ + if (style == NULL || strcasecmp(style, fp->style_name) == 0) { + return (*fp->style_fn)(disk, mbr); + } + } + warnx("No such auto-partition style %s", style); + return AUTO_ERR; +} + + +static int +use_whole_disk(disk_t *disk, unsigned char id, mbr_t *mbr) +{ + MBR_clear(mbr); + mbr->part[0].id = id; + mbr->part[0].bs = 63; + mbr->part[0].ns = disk->real->size - 63; + PRT_fix_CHS(disk, &mbr->part[0], 0); + return AUTO_OK; +} + +/* DOS style: one partition for the whole disk */ +int +AUTO_dos(disk_t *disk, mbr_t *mbr) +{ + int cc; + cc = use_whole_disk(disk, 0x0C, mbr); + if (cc == AUTO_OK) { + mbr->part[0].flag = DOSACTIVE; + } + return cc; +} + +/* HFS style: one partition for the whole disk */ +int +AUTO_hfs(disk_t *disk, mbr_t *mbr) +{ + int cc; + cc = use_whole_disk(disk, 0xAF, mbr); + if (cc == AUTO_OK) { + mbr->part[0].flag = DOSACTIVE; + } + return cc; +} + +/* UFS style: one partition for the whole disk */ +int +AUTO_ufs(disk_t *disk, mbr_t *mbr) +{ + int cc; + cc = use_whole_disk(disk, 0xA8, mbr); + if (cc == AUTO_OK) { + mbr->part[0].flag = DOSACTIVE; + } + return cc; +} + +/* One boot partition, one HFS+ root partition */ +int +AUTO_boothfs (disk_t *disk, mbr_t *mbr) +{ + /* Check disk size. */ + if (disk->real->size < 16 * 2048) { + errx(1, "Disk size must be greater than 16Mb"); + return AUTO_ERR; + } + + MBR_clear(mbr); + + /* 8MB boot partition */ + mbr->part[0].id = 0xAB; + mbr->part[0].bs = 63; + mbr->part[0].ns = 8 * 1024 * 2; + mbr->part[0].flag = DOSACTIVE; + PRT_fix_CHS(disk, &mbr->part[0], 0); + + /* Rest of the disk for rooting */ + mbr->part[1].id = 0xAF; + mbr->part[1].bs = (mbr->part[0].bs + mbr->part[0].ns); + mbr->part[1].ns = disk->real->size - mbr->part[0].ns - 63; + PRT_fix_CHS(disk, &mbr->part[1], 1); + + return AUTO_OK; +} + +/* One boot partition, one UFS root partition */ +int +AUTO_bootufs(disk_t *disk, mbr_t *mbr) +{ + /* Check disk size. */ + if (disk->real->size < 16 * 2048) { + errx(1, "Disk size must be greater than 16Mb"); + return AUTO_ERR; + } + + MBR_clear(mbr); + + /* 8MB boot partition */ + mbr->part[0].id = 0xAB; + mbr->part[0].bs = 63; + mbr->part[0].ns = 8 * 1024 * 2; + mbr->part[0].flag = DOSACTIVE; + PRT_fix_CHS(disk, &mbr->part[0], 0); + + /* Rest of the disk for rooting */ + mbr->part[1].id = 0xA8; + mbr->part[1].bs = (mbr->part[0].bs + mbr->part[0].ns); + mbr->part[1].ns = disk->real->size - mbr->part[0].ns - 63; + PRT_fix_CHS(disk, &mbr->part[1], 1); + + return AUTO_OK; +} + +/* RAID style: one 0xAC partition for the whole disk */ +int +AUTO_raid(disk_t *disk, mbr_t *mbr) +{ + return use_whole_disk(disk, 0xAC, mbr); +} + diff --git a/i386/util/fdisk/auto.h b/i386/util/fdisk/auto.h new file mode 100644 index 0000000..c9259d4 --- /dev/null +++ b/i386/util/fdisk/auto.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include "mbr.h" + +/* Prototypes */ +void AUTO_print_styles __P((FILE *)); +int AUTO_init __P((disk_t *, char *, mbr_t *)); + +#define AUTO_OK 0 +#define AUTO_ERR -1 diff --git a/i386/util/fdisk/cmd.c b/i386/util/fdisk/cmd.c new file mode 100644 index 0000000..cbcca5e --- /dev/null +++ b/i386/util/fdisk/cmd.c @@ -0,0 +1,508 @@ +/* + * Copyright (c) 2002-2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <stdio.h> +#include <ctype.h> +#include <memory.h> +#include <stdlib.h> +#include <unistd.h> +#include <signal.h> +#include <sys/fcntl.h> +#include "disk.h" +#include "misc.h" +#include "user.h" +#include "part.h" +#include "cmd.h" +#include "auto.h" + +#define MAX(a, b) ((a) >= (b) ? (a) : (b)) + +int +Xerase(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + bzero(mbr->part, sizeof(mbr->part)); + mbr->signature = MBR_SIGNATURE; + return (CMD_DIRTY); +} + +int +Xreinit(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + /* Copy template MBR */ + MBR_make(tt); + MBR_parse(disk, offset, 0, mbr); + + MBR_init(disk, mbr); + + /* Tell em we did something */ + printf("In memory copy is initialized to:\n"); + printf("Offset: %d\t", offset); + MBR_print(mbr); + printf("Use 'write' to update disk.\n"); + + return (CMD_DIRTY); +} + +int +Xauto(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + if (cmd->args[0] == '\0') { + printf("usage: auto <style>\n"); + printf(" where style is one of:\n"); + AUTO_print_styles(stdout); + return (CMD_CONT); + } + + if (AUTO_init(disk, cmd->args, mbr) != AUTO_OK) { + return (CMD_CONT); + } + MBR_make(mbr); + return (CMD_DIRTY); +} + +int +Xdisk(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int maxcyl = 1024; + int maxhead = 256; + int maxsec = 63; + + /* Print out disk info */ + DISK_printmetrics(disk); + +#if defined (__powerpc__) || defined (__mips__) + maxcyl = 9999999; + maxhead = 9999999; + maxsec = 9999999; +#endif + + /* Ask for new info */ + if (ask_yn("Change disk geometry?", 0)) { + disk->real->cylinders = ask_num("BIOS Cylinders", ASK_DEC, + disk->real->cylinders, 1, maxcyl, NULL); + disk->real->heads = ask_num("BIOS Heads", ASK_DEC, + disk->real->heads, 1, maxhead, NULL); + disk->real->sectors = ask_num("BIOS Sectors", ASK_DEC, + disk->real->sectors, 1, maxsec, NULL); + + disk->real->size = disk->real->cylinders * disk->real->heads + * disk->real->sectors; + } + + return (CMD_CONT); +} + +int +Xedit(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int pn, num, ret; + prt_t *pp; + + ret = CMD_CONT; + + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (ret); + } + pn = atoi(cmd->args) - 1; + + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (ret); + } + + /* Print out current table entry */ + pp = &mbr->part[pn]; + PRT_print(0, NULL); + PRT_print(pn, pp); + +#define EDIT(p, f, v, n, m, h) \ + if ((num = ask_num(p, f, v, n, m, h)) != v) \ + ret = CMD_DIRTY; \ + v = num; + + /* Ask for partition type */ + EDIT("Partition id ('0' to disable) ", ASK_HEX, pp->id, 0, 0xFF, PRT_printall); + + /* Unused, so just zero out */ + if (pp->id == DOSPTYP_UNUSED) { + memset(pp, 0, sizeof(*pp)); + printf("Partition %d is disabled.\n", pn + 1); + return (ret); + } + + /* Change table entry */ + if (ask_yn("Do you wish to edit in CHS mode?", 0)) { + int maxcyl, maxhead, maxsect; + + /* Shorter */ + maxcyl = disk->real->cylinders - 1; + maxhead = disk->real->heads - 1; + maxsect = disk->real->sectors; + + /* Get data */ + EDIT("BIOS Starting cylinder", ASK_DEC, pp->scyl, 0, maxcyl, NULL); + EDIT("BIOS Starting head", ASK_DEC, pp->shead, 0, maxhead, NULL); + EDIT("BIOS Starting sector", ASK_DEC, pp->ssect, 1, maxsect, NULL); + EDIT("BIOS Ending cylinder", ASK_DEC, pp->ecyl, 0, maxcyl, NULL); + EDIT("BIOS Ending head", ASK_DEC, pp->ehead, 0, maxhead, NULL); + EDIT("BIOS Ending sector", ASK_DEC, pp->esect, 1, maxsect, NULL); + /* Fix up off/size values */ + PRT_fix_BN(disk, pp, pn); + /* Fix up CHS values for LBA */ + PRT_fix_CHS(disk, pp, pn); + } else { + u_int m; + + if (pn == 0) { + pp->bs = 63 + offset; + } else { + if (mbr->part[pn-1].id != 0) { + pp->bs = mbr->part[pn-1].bs + mbr->part[pn-1].ns; + } + } + /* Get data */ + EDIT("Partition offset", ASK_DEC, pp->bs, 0, + disk->real->size, NULL); + m = MAX(pp->ns, disk->real->size - pp->bs); + if ( m > disk->real->size - pp->bs) { + /* dont have default value extend beyond end of disk */ + m = disk->real->size - pp->bs; + } + pp->ns = m; + EDIT("Partition size", ASK_DEC, pp->ns, 1, + m, NULL); + + /* Fix up CHS values */ + PRT_fix_CHS(disk, pp, pn); + } +#undef EDIT + return (ret); +} + +int +Xsetpid(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int pn, num, ret; + prt_t *pp; + + ret = CMD_CONT; + + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (ret); + } + pn = atoi(cmd->args) - 1; + + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (ret); + } + + /* Print out current table entry */ + pp = &mbr->part[pn]; + PRT_print(0, NULL); + PRT_print(pn, pp); + +#define EDIT(p, f, v, n, m, h) \ + if ((num = ask_num(p, f, v, n, m, h)) != v) \ + ret = CMD_DIRTY; \ + v = num; + + /* Ask for partition type */ + EDIT("Partition id ('0' to disable) ", ASK_HEX, pp->id, 0, 0xFF, PRT_printall); + +#undef EDIT + return (ret); +} +int +Xselect(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + static int firstoff = 0; + int off; + int pn; + + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (CMD_CONT); + } + + pn = atoi(cmd->args) - 1; + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (CMD_CONT); + } + + off = mbr->part[pn].bs; + + /* Sanity checks */ + if ((mbr->part[pn].id != DOSPTYP_EXTEND) && + (mbr->part[pn].id != DOSPTYP_EXTENDL)) { + printf("Partition %d is not an extended partition.\n", pn + 1); + return (CMD_CONT); + } + + if (firstoff == 0) + firstoff = off; + + if (!off) { + printf("Loop to offset 0! Not selected.\n"); + return (CMD_CONT); + } else { + printf("Selected extended partition %d\n", pn + 1); + printf("New MBR at offset %d.\n", off); + } + + /* Recursion is beautifull! */ + USER_modify(disk, tt, off, firstoff); + return (CMD_CONT); +} + +int +Xprint(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + + DISK_printmetrics(disk); + printf("Offset: %d\t", offset); + MBR_print(mbr); + + return (CMD_CONT); +} + +int +Xwrite(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int fd; + int shared = 0; + + fd = DISK_openshared(disk->name, O_RDWR, &shared); + if(shared) { + if(!ask_yn("Device could not be accessed exclusively.\nA reboot will be needed for changes to take effect. OK?", 0)) { + close(fd); + printf("MBR unchanged\n"); + return (CMD_CONT); + } + } + + printf("Writing MBR at offset %d.\n", offset); + + MBR_make(mbr); + MBR_write(disk, fd, mbr); + close(fd); + return (CMD_CLEAN); +} + +int +Xquit(cmd, disk, r, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *r; + mbr_t *tt; + int offset; +{ + + /* Nothing to do here */ + return (CMD_SAVE); +} + +int +Xabort(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + exit(0); + + /* NOTREACHED */ + return (CMD_CONT); +} + + +int +Xexit(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + + /* Nothing to do here */ + return (CMD_EXIT); +} + +int +Xhelp(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + cmd_table_t *cmd_table = cmd->table; + int i; + + /* Hmm, print out cmd_table here... */ + for (i = 0; cmd_table[i].cmd != NULL; i++) + printf("\t%s\t\t%s\n", cmd_table[i].cmd, cmd_table[i].help); + return (CMD_CONT); +} + +int +Xupdate(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + extern char *mbr_binary; + /* Update code */ + memcpy(mbr->code, mbr_binary, MBR_CODE_SIZE); + printf("Machine code updated.\n"); + return (CMD_DIRTY); +} + +int +Xflag(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + int i, pn = -1; + + /* Parse partition table entry number */ + if (!isdigit(cmd->args[0])) { + printf("Invalid argument: %s <partition number>\n", cmd->cmd); + return (CMD_CONT); + } + pn = atoi(cmd->args) - 1; + + if (pn < 0 || pn > 3) { + printf("Invalid partition number.\n"); + return (CMD_CONT); + } + + /* Set active flag */ + for (i = 0; i < 4; i++) { + if (i == pn) + mbr->part[i].flag = DOSACTIVE; + else + mbr->part[i].flag = 0x00; + } + + printf("Partition %d marked active.\n", pn + 1); + return (CMD_DIRTY); +} + +int +Xmanual(cmd, disk, mbr, tt, offset) + cmd_t *cmd; + disk_t *disk; + mbr_t *mbr; + mbr_t *tt; + int offset; +{ + system("man 8 fdisk"); + return (CMD_CONT); +} diff --git a/i386/util/fdisk/cmd.h b/i386/util/fdisk/cmd.h new file mode 100644 index 0000000..0c2b727 --- /dev/null +++ b/i386/util/fdisk/cmd.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _CMD_H +#define _CMD_H + +/* Includes */ +#include "disk.h" +#include "mbr.h" + + +/* Constants (returned by cmd funs) */ +#define CMD_EXIT 0x0000 +#define CMD_SAVE 0x0001 +#define CMD_CONT 0x0002 +#define CMD_CLEAN 0x0003 +#define CMD_DIRTY 0x0004 + + +/* Data types */ +struct _cmd_table_t; +typedef struct _cmd_t { + struct _cmd_table_t *table; + char cmd[10]; + char args[100]; +} cmd_t; + +typedef struct _cmd_table_t { + char *cmd; + int (*fcn)(cmd_t *, disk_t *, mbr_t *, mbr_t *, int); + char *help; +} cmd_table_t; + + +/* Prototypes */ +int Xerase __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xreinit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xauto __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xdisk __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xmanual __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xedit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xsetpid __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xselect __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xprint __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xwrite __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xexit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xquit __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xabort __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xhelp __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xflag __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); +int Xupdate __P((cmd_t *, disk_t *, mbr_t *, mbr_t *, int)); + +#endif /* _CMD_H */ + + diff --git a/i386/util/fdisk/disk.c b/i386/util/fdisk/disk.c new file mode 100644 index 0000000..eb7c706 --- /dev/null +++ b/i386/util/fdisk/disk.c @@ -0,0 +1,308 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997, 2001 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/fcntl.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/reboot.h> +#include <sys/disk.h> +#include <sys/param.h> +#include <sys/sysctl.h> +#ifdef __i386__ +#include <pexpert/i386/boot.h> +#endif +#include "disk.h" + +int +DISK_open(disk, mode) + char *disk; + int mode; +{ + int fd; + struct stat st; + + fd = open(disk, mode); + if (fd == -1) + err(1, "%s", disk); + if (fstat(fd, &st) == -1) + err(1, "%s", disk); + /* Don't be so picky about needing a character device */ + if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode)) + errx(1, "%s is not a character device or a regular file", disk); + return (fd); +} + +int +DISK_openshared(disk, mode, shared) + char *disk; + int mode; + int *shared; +{ + int fd; + struct stat st; + *shared = 0; + + fd = open(disk, mode|O_EXLOCK); + if (fd == -1) { + // if we can't have exclusive access, attempt + // to gracefully degrade to shared access + fd = open(disk, mode|O_SHLOCK); + if(fd == -1) + err(1, "%s", disk); + + *shared = 1; + } + + if (fstat(fd, &st) == -1) + err(1, "%s", disk); + /* Don't be so picky about needing a character device */ + if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode) && !S_ISREG(st.st_mode)) + errx(1, "%s is not a character device or a regular file", disk); + return (fd); +} + +int +DISK_close(fd) + int fd; +{ + + return (close(fd)); +} + +/* Given a size in the metrics, + * fake up a CHS geometry. + */ +void +DISK_fake_CHS(DISK_metrics *lm) +{ + int heads = 4; + int spt = 63; + int cylinders = (lm->size / heads / spt); + + while (cylinders > 1024 && heads < 256) { + heads *= 2; + cylinders /= 2; + } + if (heads == 256) { + heads = 255; + cylinders = (lm->size / heads / spt); + } + lm->cylinders = cylinders; + lm->heads = heads; + lm->sectors = spt; +} + +/* Routine to go after the disklabel for geometry + * information. This should work everywhere, but + * in the land of PC, things are not always what + * they seem. + */ +DISK_metrics * +DISK_getlabelmetrics(name) + char *name; +{ + DISK_metrics *lm = NULL; + long long size; + uint32_t sector_size; + int fd; + struct stat st; + + /* Get label metrics */ + if ((fd = DISK_open(name, O_RDONLY)) != -1) { + lm = malloc(sizeof(DISK_metrics)); + + if (fstat(fd, &st) == -1) + err(1, "%s", name); + if (!S_ISREG(st.st_mode) || S_ISBLK(st.st_mode)) { + if (ioctl(fd, DKIOCGETBLOCKCOUNT, &size) == -1) { + err(1, "Could not get disk block count"); + free(lm); + return NULL; + } + if (ioctl(fd, DKIOCGETBLOCKSIZE, §or_size) == -1) { + err(1, "Could not get disk block size"); + free(lm); + return NULL; + } + } else { + sector_size = 512; + size = st.st_size / sector_size; + } + + lm->sector_size = sector_size; + lm->size = size; + DISK_fake_CHS(lm); + DISK_close(fd); + } + + return (lm); +} + +/* + * Don't try to get BIOS disk metrics. + */ +DISK_metrics * +DISK_getbiosmetrics(name) + char *name; +{ + return (NULL); +} + +/* This is ugly, and convoluted. All the magic + * for disk geo/size happens here. Basically, + * the real size is the one we will use in the + * rest of the program, the label size is what we + * got from the disklabel. If the disklabel fails, + * we assume we are working with a normal file, + * and should request the user to specify the + * geometry he/she wishes to use. + */ +int +DISK_getmetrics(disk, user) + disk_t *disk; + DISK_metrics *user; +{ + + disk->label = DISK_getlabelmetrics(disk->name); + disk->bios = DISK_getbiosmetrics(disk->name); + + /* If user supplied, use that */ + if (user) { + disk->real = user; + return (0); + } + + /* Fixup bios metrics to include cylinders past 1023 boundary */ + if(disk->label && disk->bios){ + int cyls, secs; + + cyls = disk->label->size / (disk->bios->heads * disk->bios->sectors); + secs = cyls * (disk->bios->heads * disk->bios->sectors); + if ((disk->label->size - secs) < 0) + errx(1, "BIOS fixup botch (%d sectors)", disk->label->size - secs); + disk->bios->cylinders = cyls; + disk->bios->size = secs; + } + + /* If we have a (fixed) BIOS geometry, use that */ + if (disk->bios) { + disk->real = disk->bios; + return (0); + } + + /* If we have a label, use that */ + if (disk->label) { + disk->real = disk->label; + return (0); + } + + /* Can not get geometry, punt */ + disk->real = NULL; + return (1); +} + +/* Get the disk's native sector size, updating the metrics' sector_size field. + */ + int +DISK_get_sector_size(disk, user) + disk_t *disk; + DISK_metrics *user; +{ + int ret; + int fd; + uint32_t sector_size; + + /* Default to 512 bytes per sector, in case of failure. */ + user->sector_size = 512; + ret = 1; + + fd = DISK_open(disk->name, O_RDONLY); + if (fd == -1) { + err(1, "Could not open %s", disk->name); + } else { + if (ioctl(fd, DKIOCGETBLOCKSIZE, §or_size) == -1) { + err(1, "Could not get disk block size"); + } else { + user->sector_size = sector_size; + ret = 0; + } + } + + return ret; +} + +int +DISK_printmetrics(disk) + disk_t *disk; +{ + + printf("Disk: %s\t", disk->name); + if (disk->real) { + printf("geometry: %d/%d/%d [%d sectors]\n", disk->real->cylinders, + disk->real->heads, disk->real->sectors, disk->real->size); + if (disk->real->sector_size != 512) + printf("Sector size: %d bytes\n", disk->real->sector_size); + } else { + printf("geometry: <none>\n"); + } + + return (0); +} + diff --git a/i386/util/fdisk/disk.h b/i386/util/fdisk/disk.h new file mode 100644 index 0000000..c28c999 --- /dev/null +++ b/i386/util/fdisk/disk.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _DISK_H +#define _DISK_H + +/* Data types */ +typedef struct _DISK_metrics { + int cylinders; + int heads; + int sectors; + int size; /* Number of sectors in disk */ + int sector_size; /* Bytes per sector */ +} DISK_metrics; + +typedef struct _disk_t { + char *name; + DISK_metrics *bios; /* Metrics as reported by BIOS (always NULL) */ + DISK_metrics *label; /* As reported by device ioctls */ + DISK_metrics *real; /* Metrics we're using (BIOS, ioctls, user-supplied) */ +} disk_t; + +/* Prototypes */ +int DISK_open __P((char *, int)); +int DISK_openshared __P((char *, int, int *)); +int DISK_close __P((int)); +int DISK_getmetrics __P((disk_t *, DISK_metrics *)); +int DISK_get_sector_size __P((disk_t *, DISK_metrics *)); +int DISK_printmetrics __P((disk_t *)); +void DISK_fake_CHS __P((DISK_metrics *)); + +#endif /* _DISK_H */ + diff --git a/i386/util/fdisk/fdisk.8 b/i386/util/fdisk/fdisk.8 new file mode 100644 index 0000000..ab8ffb6 --- /dev/null +++ b/i386/util/fdisk/fdisk.8 @@ -0,0 +1,383 @@ +.\" $OpenBSD: fdisk.8,v 1.38 2002/01/04 21:20:56 kjell Exp $ +.\" +.\" Copyright (c) 2002 Apple Computer, Inc. All rights reserved. +.\" +.\" "Portions Copyright (c) 2002 Apple Computer, Inc. All Rights +.\" Reserved. This file contains Original Code and/or Modifications of +.\" Original Code as defined in and that are subject to the Apple Public +.\" Source License Version 1.2 (the 'License'). You may not use this file +.\" except in compliance with the License. Please obtain a copy of the +.\" License at http://www.apple.com/publicsource and read it before using +.\" this file. +.\" +.\" The Original Code and all software distributed under the License are +.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the +.\" License for the specific language governing rights and limitations +.\" under the License." +.\" +.\" Copyright (c) 1997 Tobias Weingartner +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by Tobias Weingartner. +.\" 4. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd January 3, 2002 +.Dt FDISK 8 +.Os +.Sh NAME +.Nm fdisk +.Nd DOS partition maintenance program +.Sh SYNOPSIS +.Nm fdisk +.Op Fl ieu +.Op Fl f Ar mbrname +.Op Fl c Ar cylinders +.Op Fl h Ar heads +.Op Fl s Ar sectors +.Op Fl S Ar size +.Op Fl b Ar size +.Ar device +.Sh DESCRIPTION +In order for the BIOS to boot the kernel, certain conventions must be +adhered to. +Sector 0 of a bootable hard disk must contain boot code, +an MBR partition table, and a magic number (0xAA55). +These MBR partitions (also +known as BIOS partitions) can be used to break the disk up into several +pieces. +.Pp +The BIOS loads sector 0 of the boot disk into memory, verifies +the magic number, and begins executing the code at the first byte. +The normal DOS MBR boot code searches the MBR partition table for an +.Dq active +partition (indicated by a +.Ql \&* +in the first column), and if one +is found, the boot block from that partition is loaded and executed in +place of the original (MBR) boot block. +.Pp +The options are as follows: +.Bl -tag -width Ds +.It Fl i +Initialize the MBR sector. +.It Fl a Ar style +Specify an automatic partitioning style. +.It Fl e +Edit existing MBR sectors. +.It Fl f Ar mbrname +Specifies an alternate MBR template file. +.It Fl u +Update MBR code, preserving existing partition table. +.It Fl y +Do not ask for confirmation before writing. +.It Fl d +Dump partition table in a format readable by the -r option. +.It Fl r +Read a partition table from the standard input. +.It Fl t +Test if the disk is partitioned. +.It Xo Fl c Ar cylinders , +.Fl h Ar heads , +.Fl s Ar sectors +.Xc +Specifies an alternate BIOS geometry for +.Nm +to use. +.It Fl S Ar size +Specify the disk size in blocks. +.It Fl b Ar size +Specify the number of bytes per disk block. +.El +.Pp +The DOS +.Nm +program can be used to divide space on the disk into partitions and set +one active. +This +.Nm +program serves a similar purpose to the DOS program. +When called with no special flags, it prints the MBR partition +table of the specified device, i.e., +.Bd -literal + # fdisk fd0 + Disk: fd0 geometry: 80/2/18 [2880 sectors] + Offset: 0 Signature: 0xAA55 + Starting Ending + #: id cyl hd sec - cyl hd sec [ start - size] + ---------------------------------------------------------------------- + *1: A6 0 0 1 - 79 1 18 [ 0 - 2880] OpenBSD + 2: 00 0 0 0 - 0 0 0 [ 0 - 0] unused + 3: A7 0 0 2 - 79 1 18 [ 1 - 2879] NEXTSTEP + 4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused +.Ed +.Pp +The geometry displayed is a synthetic geometry unless another geometry +has been selected using the +.Fl c , +.Fl h , +.Fl s , +.Fl S , +and +.Fl b +options. +In the future, +.Nm +will read the BIOS geometry from the IOKit registry. +.Pp +In this example, +the disk is divided into two partitions that happen to fill the disk. +The first partition overlaps the third partition. +(Used for debugging purposes.) +.Bl -tag -width "start/size" +.It Em "#" +Number of partition table entry. +A +.Dq \&* +denotes the bootable partition. +.It Em "id" +System identifier. +.Ox +reserves the +magic number 166 decimal (A6 in hex). +If no 166 partition is found, it will use an older +.Fx +partition (with a magic number of 165 or A5 in hex). +.It Em "cyl/hd/sec" +These fields provide the starting and ending address of the partition +in BIOS geometry +.It Em "start/size" +These fields provide the starting sector and size in sectors of the +partition in linear block addresses. +.El +.Pp +.Em NOTE : +The sectors field is +.Dq 1 based , +and the start field is +.Dq 0 based . +The CHS values may need to be in the BIOS's geometry +for older systems to be able to boot and use the drive correctly; +most modern systems prefer the starting sector and size +in preference to the CHS values. +.Pp +The +.Fl i +flag is used to indicate that the partition data is to be initialized. +In this mode, +.Nm +will completely overwrite the primary MBR and partition table, either +using the default MBR template, or the one specified by the +.Fl f +flag. +.Pp +In the default template, partition number 1 will be configured as a +Darwin boot +partition spanning from cylinder 0, head 1, sector 1, and extending +for 8 megabytes. +Partition number 2 will be configured as a +Darwin HFS +partition spanning the rest of the disk. +This mode is designed to initialize an MBR the very first time, +or when it has been corrupted beyond repair. +.Pp +You can specify other default partition styles with the +.Fl a +flag. The available styles are: +.Bl -tag -width "start/size" +.It Em "boothfs" +Creates an 8Mb boot partition (type AB hex) +and makes the rest of the disk +a Darwin HFS partition (type AF hex). +.It Em "bootufs" +Creates an 8Mb boot partition (type AB hex) +and makes the rest of the disk +a Darwin UFS partition (type A8 hex). +.It Em "ufs" +Makes the entire disk one Darwin UFS partition (type A8 hex). +.It Em "hfs" +Makes the entire disk one HFS+ partition (type AF hex). +.It Em "dos" +Makes the entire disk one DOS partition (type 0C hex). +.It Em "raid" +Makes the entire disk one type AC hex partition. +.El +.Pp +The +.Fl u +flag is used to update the MBR code on a given drive. +The MBR code extends from offset 0x000 to the start of the partition table +at offset 0x1BE. +It is similar to the +.Fl i +flag, except the existing partition table is preserved. This +is useful for writing new MBR code onto an existing drive, and is +equivalent to the DOS command +.Dq FDISK /MBR . +Note that this option will overwrite the NT disk signature, if present. +The +.Fl u +and +.Fl i +flags may not be specified together. +.Pp +The flag +.Fl e +is used to modify a partition table using a interactive edit mode of the +.Nm +program. +This mode is designed to allow you to change any partition on the +drive you choose, including extended partitions. +It is a very powerful mode, +but is safe as long as you do not execute the +.Em write +command, or answer in the negative (the default) when +.Nm +asks you about writing out changes. +.Sh COMMAND MODE +When you first enter this mode, you are presented with a prompt, that looks +like so: +.Em "fdisk: 0>" . +This prompt has two important pieces of information for you. +It will tell +you if the in-memory copy of the boot block has been modified or not. +If it has been modified, the prompt will change to look like: +.Em "fdisk:*0>" . +The second piece of information pertains to the number given in the prompt. +This number specifies the disk offset of the currently selected boot block +you are editing. +This number could be something different that zero when +you are editing extended partitions. +The list of commands and their explanations are given below. +.Bl -tag -width "update" +.It Em help +Display a list of commands that +.Nm +understands in the interactive edit mode. +.It Em manual +Display this manual page. +.It Em reinit +Initialize the currently selected, in-memory copy of the +boot block. +.It Em auto +Partition the disk with one of the automatic partition styles. +.It Em disk +Display the current drive geometry that +.Nm +has +probed. +You are given a chance to edit it if you wish. +.It Em edit +Edit a given table entry in the memory copy of +the current boot block. +You may edit either in BIOS geometry mode, +or in sector offsets and sizes. +.It Em setpid +Change the partition +identifier of the given partition table entry. +This command is particularly useful for reassigning +an existing partition to OpenBSD. +.It Em flag +Make the given partition table entry bootable. +Only one entry can be marked bootable. +If you wish to boot from an extended +partition, you will need to mark the partition table entry for the +extended partition as bootable. +.It Em update +Update the machine code in the memory copy of the currently selected +boot block. +Note that this option will overwrite the NT disk +signature, if present. +.It Em select +Select and load into memory the boot block pointed +to by the extended partition table entry in the current boot block. +.It Em print +Print the currently selected in-memory copy of the boot +block and its MBR table to the terminal. +.It Em write +Write the in-memory copy of the boot block to disk. +You will be asked to confirm this operation. +.It Em exit +Exit the current level of +.Nm fdisk , +either returning to the +previously selected in-memory copy of a boot block, or exiting the +program if there is none. +.It Em quit +Exit the current level of +.Nm fdisk , +either returning to the +previously selected in-memory copy of a boot block, or exiting the +program if there is none. +Unlike +.Em exit +it does write the modified block out. +.It Em abort +Quit program without saving current changes. +.El +.Sh NOTES +The automatic calculation of starting cylinder etc. uses +a set of figures that represent what the BIOS thinks is the +geometry of the drive. +These figures are by default taken from the in-core disklabel, or +values that +.Em /boot +has passed to the kernel, but +.Nm +gives you an opportunity to change them if there is a need to. +This allows the user to create a bootblock that can work with drives +that use geometry translation under a potentially different BIOS. +.Pp +If you hand craft your disk layout, +please make sure that the +.Ox +partition starts on a cylinder boundary. +(This restriction may be changed in the future.) +.Pp +Editing an existing partition is risky, and may cause you to +lose all the data in that partition. +.Pp +You should run this program interactively once or twice to see how it works. +This is completely safe as long as you answer the +.Dq write +questions in the +negative. +.Sh FILES +.Bl -tag -width /usr/mdec/mbr -compact +.It Pa /usr/mdec/mbr +default MBR template +.El +.Sh SEE ALSO +.Xr gpt 8 , +.Xr pdisk 8 +.Sh BUGS +There are subtleties +.Nm +detects that are not explained in this manual page. +As well, chances are that some of the subtleties it should detect are being +steamrolled. +Caveat Emptor. diff --git a/i386/util/fdisk/fdisk.c b/i386/util/fdisk/fdisk.c new file mode 100644 index 0000000..e7b45cb --- /dev/null +++ b/i386/util/fdisk/fdisk.c @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <paths.h> +#include <sys/types.h> +#include <sys/fcntl.h> +#include "disk.h" +#include "user.h" +#include "auto.h" + +#define _PATH_MBR "/usr/standalone/i386/boot0" + +void +usage() +{ + extern char * __progname; + fprintf(stderr, "usage: %s " + "[-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size] [-r] [-a style] disk\n" + "\t-i: initialize disk with new MBR\n" + "\t-u: update MBR code, preserve partition table\n" + "\t-e: edit MBRs on disk interactively\n" + "\t-f: specify non-standard MBR template\n" + "\t-chs: specify disk geometry\n" + "\t-S: specify disk size\n" + "\t-r: read partition specs from stdin (implies -i)\n" + "\t-a: auto-partition with the given style\n" + "\t-d: dump partition table\n" + "\t-y: don't ask any questions\n" + "\t-t: test if disk is partitioned\n" + "`disk' is of the form /dev/rdisk0.\n", + __progname); + fprintf(stderr, "auto-partition styles:\n"); + AUTO_print_styles(stderr); + exit(1); +} + +char *mbr_binary = NULL; +int +main(argc, argv) + int argc; + char **argv; +{ + int ch, fd; + int i_flag = 0, m_flag = 0, u_flag = 0, r_flag = 0, d_flag = 0, y_flag = 0, t_flag = 0; + int c_arg = 0, h_arg = 0, s_arg = 0; + int size_arg = 0; + int block_size_arg = 0; + disk_t disk; + DISK_metrics *usermetrics; + char *mbrfile = _PATH_MBR; + mbr_t *mp; + char *auto_style = NULL; + + while ((ch = getopt(argc, argv, "ieuf:c:h:s:b:S:ra:dyt")) != -1) { + switch(ch) { + case 'i': + i_flag = 1; + break; + case 'u': + u_flag = 1; + break; + case 'e': + m_flag = 1; + break; + case 'f': + mbrfile = optarg; + break; + case 'c': + c_arg = atoi(optarg); + if (c_arg < 1 || c_arg > 262144) + errx(1, "Cylinder argument out of range."); + break; + case 'h': + h_arg = atoi(optarg); + if (h_arg < 1 || h_arg > 256) + errx(1, "Head argument out of range."); + break; + case 's': + s_arg = atoi(optarg); + if (s_arg < 1 || s_arg > 63) + errx(1, "Sector argument out of range."); + break; + case 'b': + block_size_arg = atoi(optarg); + if (block_size_arg & (block_size_arg - 1)) + errx(1, "Block size argument not a power of two."); + if (block_size_arg < 512 || block_size_arg > 4096) + errx(1, "Block size argument out of range 512..4096."); + break; + case 'S': + size_arg = atoi(optarg); + break; + case 'r': + r_flag = 1; + break; + case 'a': + auto_style = optarg; + break; + case 'd': + d_flag = 1; + break; + case 'y': + y_flag = 1; + break; + case 't': + t_flag = 1; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + /* Argument checking */ + if (argc != 1) + usage(); + else + disk.name = argv[0]; + + if (i_flag && u_flag) errx(1, "-i and -u cannot be specified simultaneously"); + + /* Put in supplied geometry if there */ + if (c_arg | h_arg | s_arg | size_arg | block_size_arg) { + usermetrics = malloc(sizeof(DISK_metrics)); + if (usermetrics != NULL) { + if (c_arg && h_arg && s_arg) { + usermetrics->cylinders = c_arg; + usermetrics->heads = h_arg; + usermetrics->sectors = s_arg; + if (size_arg) { + usermetrics->size = size_arg; + } else { + usermetrics->size = c_arg * h_arg * s_arg; + } + } else { + if (size_arg) { + usermetrics->size = size_arg; + DISK_fake_CHS(usermetrics); + } else { + errx(1, "Please specify a full geometry with [-chs]."); + } + } + if (block_size_arg) { + usermetrics->sector_size = block_size_arg; + } else { + DISK_get_sector_size(&disk, usermetrics); + } + } + } else { + usermetrics = NULL; + } + + /* Get the geometry */ + disk.real = NULL; + if (DISK_getmetrics(&disk, usermetrics)) + errx(1, "Can't get disk geometry, please use [-chs] to specify."); + + /* If only testing, read MBR and silently exit */ + if (t_flag) { + mbr_t *mbr; + + mp = mbr = MBR_read_all(&disk); + while (mp) { + if (mp->signature != MBR_SIGNATURE) { + MBR_free(mbr); + exit(1); + } + mp = mp->next; + } + MBR_free(mbr); + exit(0); + } + + /* If not editing the disk, print out current MBRs on disk */ + if ((i_flag + r_flag + u_flag + m_flag) == 0) { + exit(USER_print_disk(&disk, d_flag)); + } + + /* Parse mbr template or read partition specs, to pass on later */ + if (auto_style && r_flag) { + errx(1, "Can't specify both -r and -a"); + } + + mbr_binary = (char *)malloc(MBR_CODE_SIZE); + if ((fd = open(mbrfile, O_RDONLY)) == -1) { + warn("could not open MBR file %s", mbrfile); + bzero(mbr_binary, MBR_CODE_SIZE); + } else { + int cc; + cc = read(fd, mbr_binary, MBR_CODE_SIZE); + if (cc < MBR_CODE_SIZE) { + err(1, "could not read MBR code"); + } + close(fd); + } + + if (u_flag) { + /* Don't hose the partition table; just write the boot code */ + mp = MBR_read_all(&disk); + bcopy(mbr_binary, mp->code, MBR_CODE_SIZE); + MBR_make(mp); + } else if (i_flag) { + /* If they didn't specify -a, they'll get the default auto style */ + mp = MBR_alloc(NULL); + if (AUTO_init(&disk, auto_style, mp) != AUTO_OK) { + errx(1, "error initializing disk"); + } + bcopy(mbr_binary, mp->code, MBR_CODE_SIZE); + MBR_make(mp); + } else if (r_flag) { + mp = MBR_parse_spec(stdin, &disk); + bcopy(mbr_binary, mp->code, MBR_CODE_SIZE); + MBR_make(mp); + } else { + /* Use what's on the disk. */ + mp = MBR_read_all(&disk); + } + + /* Now do what we are supposed to */ + if (i_flag || r_flag || u_flag) { + USER_write(&disk, mp, u_flag, y_flag); + } + + if (m_flag) { + USER_modify(&disk, mp, 0, 0); + } + + if (mbr_binary) + free(mbr_binary); + + return (0); +} diff --git a/i386/util/fdisk/getrawpartition.c b/i386/util/fdisk/getrawpartition.c new file mode 100644 index 0000000..9cfcb35 --- /dev/null +++ b/i386/util/fdisk/getrawpartition.c @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/*- + * Copyright (c) 1996 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: getrawpartition.c,v 1.4 1999/07/02 15:49:12 simonb Exp $"); +#endif + +#include <sys/param.h> +#include <sys/sysctl.h> +#include <util.h> + +int +getrawpartition() +{ +#if 0 + int rawpart, mib[2]; + size_t varlen; + + mib[0] = CTL_KERN; + mib[1] = KERN_RAWPARTITION; + varlen = sizeof(rawpart); + if (sysctl(mib, 2, &rawpart, &varlen, NULL, 0) < 0) + return (-1); + + return (rawpart); +#else + return 0 - 'a'; +#endif +} diff --git a/i386/util/fdisk/mbr.c b/i386/util/fdisk/mbr.c new file mode 100644 index 0000000..1f56f05 --- /dev/null +++ b/i386/util/fdisk/mbr.c @@ -0,0 +1,553 @@ +/* + * Copyright (c) 2002, 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <ctype.h> +#include <memory.h> +#include <sys/fcntl.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#if 0 +#include <sys/dkio.h> +#endif +#include <machine/param.h> +#include "disk.h" +#include "misc.h" +#include "mbr.h" +#include "part.h" + + +void +MBR_init(disk, mbr) + disk_t *disk; + mbr_t *mbr; +{ + /* Fix up given mbr for this disk */ + mbr->part[0].flag = 0; + mbr->part[1].flag = 0; + mbr->part[2].flag = 0; +#if !defined(DOSPTYP_OPENBSD) + mbr->part[3].flag = 0; + mbr->signature = MBR_SIGNATURE; +#else + + mbr->part[3].flag = DOSACTIVE; + mbr->signature = DOSMBR_SIGNATURE; + + /* Use whole disk, save for first head, on first cyl. */ + mbr->part[3].id = DOSPTYP_OPENBSD; + mbr->part[3].scyl = 0; + mbr->part[3].shead = 1; + mbr->part[3].ssect = 1; + + /* Go right to the end */ + mbr->part[3].ecyl = disk->real->cylinders - 1; + mbr->part[3].ehead = disk->real->heads - 1; + mbr->part[3].esect = disk->real->sectors; + + /* Fix up start/length fields */ + PRT_fix_BN(disk, &mbr->part[3], 3); + +#if defined(__powerpc__) || defined(__mips__) + /* Now fix up for the MS-DOS boot partition on PowerPC. */ + mbr->part[0].flag = DOSACTIVE; /* Boot from dos part */ + mbr->part[3].flag = 0; + mbr->part[3].ns += mbr->part[3].bs; + mbr->part[3].bs = mbr->part[0].bs + mbr->part[0].ns; + mbr->part[3].ns -= mbr->part[3].bs; + PRT_fix_CHS(disk, &mbr->part[3], 3); + if ((mbr->part[3].shead != 1) || (mbr->part[3].ssect != 1)) { + /* align the partition on a cylinder boundary */ + mbr->part[3].shead = 0; + mbr->part[3].ssect = 1; + mbr->part[3].scyl += 1; + } + /* Fix up start/length fields */ + PRT_fix_BN(disk, &mbr->part[3], 3); +#endif +#endif +} + +void +MBR_parse(disk, offset, reloff, mbr) + disk_t *disk; + off_t offset; + off_t reloff; + mbr_t *mbr; +{ + int i; + unsigned char *mbr_buf = mbr->buf; + + memcpy(mbr->code, mbr_buf, MBR_CODE_SIZE); + mbr->offset = offset; + mbr->reloffset = reloff; + mbr->signature = getshort(&mbr_buf[MBR_SIG_OFF]); + + for (i = 0; i < NDOSPART; i++) + PRT_parse(disk, &mbr_buf[MBR_PART_OFF + MBR_PART_SIZE * i], + offset, reloff, &mbr->part[i], i); +} + +void +MBR_make(mbr) + mbr_t *mbr; +{ + int i; + unsigned char *mbr_buf = mbr->buf; + + memcpy(mbr_buf, mbr->code, MBR_CODE_SIZE); + putshort(&mbr_buf[MBR_SIG_OFF], mbr->signature); + + for (i = 0; i < NDOSPART; i++) + PRT_make(&mbr->part[i], mbr->offset, mbr->reloffset, + &mbr_buf[MBR_PART_OFF + MBR_PART_SIZE * i]); +} + +void +MBR_print(mbr) + mbr_t *mbr; +{ + int i; + + /* Header */ + printf("Signature: 0x%X\n", + (int)mbr->signature); + PRT_print(0, NULL); + + /* Entries */ + for (i = 0; i < NDOSPART; i++) + PRT_print(i, &mbr->part[i]); +} + +int +MBR_read(disk, fd, where, mbr) + disk_t *disk; + int fd; + off_t where; + mbr_t *mbr; +{ + off_t off; + int len; + int size; + unsigned char *buf = mbr->buf; + + size = disk->real->sector_size; + where *= size; + off = lseek(fd, where, SEEK_SET); + if (off != where) + return (off); + len = read(fd, buf, size); + if (len != size) + return (len); + return (0); +} + +int +MBR_write(disk, fd, mbr) + disk_t *disk; + int fd; + mbr_t *mbr; +{ + off_t off; + int len; + int size; + unsigned char *buf = mbr->buf; + off_t where; + + size = disk->real->sector_size; + where = mbr->offset * size; + off = lseek(fd, where, SEEK_SET); + if (off != where) + return (off); + len = write(fd, buf, size); + if (len != size) + return (len); +#if defined(DIOCRLDINFO) + (void) ioctl(fd, DIOCRLDINFO, 0); +#endif + return (0); +} + +void +MBR_pcopy(disk, mbr) + disk_t *disk; + mbr_t *mbr; +{ + /* + * Copy partition table from the disk indicated + * to the supplied mbr structure + */ + + int i, fd, offset = 0, reloff = 0; + mbr_t *mbrd; + + mbrd = MBR_alloc(NULL); + fd = DISK_open(disk->name, O_RDONLY); + MBR_read(disk, fd, offset, mbrd); + DISK_close(fd); + MBR_parse(disk, offset, reloff, mbrd); + for (i = 0; i < NDOSPART; i++) { + PRT_parse(disk, &mbrd->buf[MBR_PART_OFF + + MBR_PART_SIZE * i], + offset, reloff, &mbr->part[i], i); + PRT_print(i, &mbr->part[i]); + } + MBR_free(mbrd); +} + + +static int +parse_number(char *str, int default_val, int base) { + if (str != NULL && *str != '\0') { + default_val = strtol(str, NULL, base); + } + return default_val; +} + +static inline int +null_arg(char *arg) { + if (arg == NULL || *arg == 0) + return 1; + else + return 0; +} + +/* Parse a partition spec into a partition structure. + * Spec is of the form: + * <start>,<size>,<id>,<bootable>[,<c,h,s>,<c,h,s>] + * We require passing in the disk and mbr so we can + * set reasonable defaults for values, e.g. "the whole disk" + * or "starting after the last partition." + */ +#define N_ARGS 10 +static int +MBR_parse_one_spec(char *line, disk_t *disk, mbr_t *mbr, int pn) +{ + int i; + char *args[N_ARGS]; + prt_t *part = &mbr->part[pn]; + int next_start, next_size; + + /* There are up to 10 arguments. */ + for (i=0; i<N_ARGS; i++) { + char *arg; + while (isspace(*line)) + line++; + arg = strsep(&line, ",\n"); + if (arg == NULL || line == NULL) { + break; + } + args[i] = arg; + } + for (; i<N_ARGS; i++) { + args[i] = NULL; + } + /* Set reasonable defaults. */ + if (pn == 0) { + next_start = 0; + } else { + next_start = mbr->part[pn-1].bs + mbr->part[pn-1].ns; + } + next_size = disk->real->size; + for(i=0; i<pn; i++) { + next_size -= mbr->part[i].ns; + } + + part->id = parse_number(args[2], 0xA8, 16); + if (!null_arg(args[3]) && *args[3] == '*') { + part->flag = 0x80; + } else { + part->flag = 0; + } + /* If you specify the start or end sector, + you have to give both. */ + if ((null_arg(args[0]) && !null_arg(args[1])) || + (!null_arg(args[0]) && null_arg(args[1]))) { + errx(1, "You must specify both start and size, or neither"); + return -1; + } + + /* If you specify one of the CHS args, + you have to give them all. */ + if (!null_arg(args[4])) { + for (i=5; i<10; i++) { + if (null_arg(args[i])) { + errx(1, "Either all CHS arguments must be specified, or none"); + return -1; + } + } + + part->scyl = parse_number(args[4], 0, 10); + part->shead = parse_number(args[5], 0, 10); + part->ssect = parse_number(args[6], 0, 10); + part->scyl = parse_number(args[7], 0, 10); + part->shead = parse_number(args[8], 0, 10); + part->ssect = parse_number(args[9], 0, 10); + if (null_arg(args[0])) { + PRT_fix_BN(disk, part, pn); + } + } else { + /* See if they gave no CHS and no start/end */ + if (null_arg(args[0])) { + errx(1, "You must specify either start sector and size or CHS"); + return -1; + } + } + if (!null_arg(args[0])) { + part->bs = parse_number(args[0], next_start, 10); + part->ns = parse_number(args[1], next_size, 10); + PRT_fix_CHS(disk, part, pn); + } + return 0; +} + + +typedef struct _mbr_chain { + mbr_t mbr; + struct _mbr_chain *next; +} mbr_chain_t; + +/* Parse some number of MBR spec lines. + * Spec is of the form: + * <start>,<size>,<id>,<bootable>[,<c,h,s>,<c,h,s>] + * + */ +mbr_t * +MBR_parse_spec(FILE *f, disk_t *disk) +{ + int lineno; + int offset, firstoffset; + mbr_t *mbr, *head, *prev_mbr; + + head = mbr = prev_mbr = NULL; + firstoffset = 0; + do { + + offset = 0; + for (lineno = 0; lineno < NDOSPART && !feof(f); lineno++) { + char line[256]; + char *str; + prt_t *part; + + do { + str = fgets(line, 256, f); + } while ((str != NULL) && (*str == '\0')); + if (str == NULL) { + break; + } + + if (mbr == NULL) { + mbr = MBR_alloc(prev_mbr); + if (head == NULL) + head = mbr; + } + + if (MBR_parse_one_spec(line, disk, mbr, lineno)) { + /* MBR_parse_one_spec printed the error message. */ + return NULL; + } + part = &mbr->part[lineno]; + if ((part->id == DOSPTYP_EXTEND) || (part->id == DOSPTYP_EXTENDL)) { + offset = part->bs; + if (firstoffset == 0) firstoffset = offset; + } + } + /* If fewer lines than partitions, zero out the rest of the partitions */ + if (mbr != NULL) { + for (; lineno < NDOSPART; lineno++) { + bzero(&mbr->part[lineno], sizeof(prt_t)); + } + } + prev_mbr = mbr; + mbr = NULL; + } while (offset >= 0 && !feof(f)); + + return head; +} + +void +MBR_dump(mbr_t *mbr) +{ + int i; + prt_t *part; + + for (i=0; i<NDOSPART; i++) { + part = &mbr->part[i]; + printf("%d,%d,0x%02X,%c,%d,%d,%d,%d,%d,%d\n", + part->bs, + part->ns, + part->id, + (part->flag == 0x80) ? '*' : '-', + part->scyl, + part->shead, + part->ssect, + part->ecyl, + part->ehead, + part->esect); + } +} + +mbr_t * +MBR_alloc(mbr_t *parent) +{ + mbr_t *mbr = (mbr_t *)malloc(sizeof(mbr_t)); + bzero(mbr, sizeof(mbr_t)); + if (parent) { + parent->next = mbr; + } + mbr->signature = MBR_SIGNATURE; + return mbr; +} + +void +MBR_free(mbr_t *mbr) +{ + mbr_t *tmp; + while (mbr) { + tmp = mbr->next; + free(mbr); + mbr = tmp; + } +} + +/* Read and parse all the partition tables on the disk, + * including extended partitions. + */ +mbr_t * +MBR_read_all(disk_t *disk) +{ + mbr_t *mbr = NULL, *head = NULL; + int i, fd, offset, firstoff; + + fd = DISK_open(disk->name, O_RDONLY); + firstoff = offset = 0; + do { + mbr = MBR_alloc(mbr); + if (head == NULL) { + head = mbr; + } + MBR_read(disk, fd, offset, mbr); + MBR_parse(disk, offset, firstoff, mbr); + if (mbr->signature != MBR_SIGNATURE) { + /* The MBR signature is invalid. */ + break; + } + offset = 0; + for (i=0; i<NDOSPART; i++) { + prt_t *part = &mbr->part[i]; + if ((part->id == DOSPTYP_EXTEND) || (part->id == DOSPTYP_EXTENDL)) { + offset = part->bs; + if (firstoff == 0) { + firstoff = offset; + } + } + } + } while (offset > 0); + DISK_close(fd); + + return head; +} + + +int +MBR_write_all(disk_t *disk, mbr_t *mbr) +{ + int result = 0; + int fd; + + fd = DISK_open(disk->name, O_RDWR); + while (mbr) { + MBR_make(mbr); + result = MBR_write(disk, fd, mbr); + if (result) + break; + mbr = mbr->next; + } + DISK_close(fd); + return result; +} + +void +MBR_print_all(mbr_t *mbr) { + while (mbr) { + MBR_print(mbr); + mbr = mbr->next; + } +} + +void +MBR_dump_all(mbr_t *mbr) { + while (mbr) { + MBR_dump(mbr); + mbr = mbr->next; + } +} + +void +MBR_clear(mbr_t *mbr) { + int i; + if (mbr->next) { + MBR_free(mbr->next); + mbr->next = NULL; + } + for (i=0; i<4; i++) { + bzero(&mbr->part[i], sizeof(mbr->part[i])); + } + bzero(&mbr->buf, sizeof(mbr->buf)); +} + diff --git a/i386/util/fdisk/mbr.h b/i386/util/fdisk/mbr.h new file mode 100644 index 0000000..48da747 --- /dev/null +++ b/i386/util/fdisk/mbr.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * 2008-05-24: + * Tamas Kosarszky: changed MBR_CODE_SIZE to 0x1B8 to make fdisk + * compatible with Vista and GPT specifications. + * + * Credits goes to Dense for the idea of this modification and + * Kabyl for findig this piece of source. + */ +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MBR_H +#define _MBR_H + +#include "part.h" + +#ifndef NDOSPART +#define NDOSPART 4 +#define DOSPTYP_UNUSED 0 +#define DOSPTYP_EXTEND 5 +#define DOSPTYP_EXTENDL 15 +#define DOSACTIVE 128 +#endif + +/* Various constants */ +#define MBR_CODE_SIZE 0x1B8 +#define MBR_PART_SIZE 0x10 +#define MBR_PART_OFF 0x1BE +#define MBR_SIG_OFF 0x1FE +/* MBR_BUF_SIZE is the largest sector size we support */ +#define MBR_BUF_SIZE 4096 + +#define MBR_SIGNATURE 0xAA55 + +/* MBR type */ +typedef struct _mbr_t { + off_t reloffset; /* the offset of the first extended partition that contains all the rest */ + off_t offset; /* the absolute offset of this partition */ + struct _mbr_t *next; /* pointer to the next MBR in an extended partition chain */ + unsigned char code[MBR_CODE_SIZE]; + unsigned short signature; + prt_t part[NDOSPART]; + unsigned char buf[MBR_BUF_SIZE]; +} mbr_t; + +/* Prototypes */ +void MBR_print_disk __P((char *)); +void MBR_print __P((mbr_t *)); +void MBR_print_all __P((mbr_t *)); +void MBR_parse __P((disk_t *, off_t, off_t, mbr_t *)); +void MBR_make __P((mbr_t *)); +void MBR_init __P((disk_t *, mbr_t *)); +int MBR_read __P((disk_t *,int, off_t, mbr_t *)); +int MBR_write __P((disk_t *,int, mbr_t *)); +void MBR_pcopy __P((disk_t *, mbr_t *)); +mbr_t * MBR_parse_spec __P((FILE *, disk_t *)); +void MBR_dump __P((mbr_t *)); +void MBR_dump_all __P((mbr_t *)); +mbr_t *MBR_alloc __P((mbr_t *)); +void MBR_free __P((mbr_t *)); +mbr_t * MBR_read_all __P((disk_t *)); +int MBR_write_all __P((disk_t *, mbr_t *)); +void MBR_clear __P((mbr_t *)); + +/* Sanity check */ +#include <machine/param.h> +#if (DEV_BSIZE != 512) +#error "DEV_BSIZE != 512, somebody better fix me!" +#endif + +#endif /* _MBR_H */ + diff --git a/i386/util/fdisk/mbrcode.h b/i386/util/fdisk/mbrcode.h new file mode 100644 index 0000000..2b8182e --- /dev/null +++ b/i386/util/fdisk/mbrcode.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 2000 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* Largely generated by: + * hexdump -ve '8/1 "0x%02x, " "\n"' /usr/mdec/mbr + */ +0xfa, 0xea, 0x06, 0x00, 0xc0, 0x07, 0x8c, 0xc8, +0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0xfc, 0xff, 0xfb, +0xb0, 0x53, 0xe8, 0xe2, 0x00, 0xb8, 0xa0, 0x07, +0x8e, 0xc0, 0x31, 0xf6, 0x31, 0xff, 0xb9, 0x00, +0x02, 0xfc, 0xf2, 0xa4, 0xea, 0x29, 0x00, 0xa0, +0x07, 0xb0, 0x52, 0xe8, 0xc9, 0x00, 0x1e, 0x07, +0x0e, 0x1f, 0xf6, 0xc2, 0x80, 0x75, 0x0b, 0x66, +0xbe, 0x13, 0x01, 0x00, 0x00, 0xe8, 0xab, 0x00, +0xb2, 0x80, 0x66, 0xbe, 0xbe, 0x01, 0x00, 0x00, +0x66, 0xb9, 0x04, 0x00, 0x00, 0x00, 0xb0, 0x4c, +0xe8, 0xa4, 0x00, 0x8a, 0x44, 0x00, 0x3c, 0x80, +0x74, 0x18, 0x66, 0x83, 0xc6, 0x10, 0xe2, 0xee, +0x66, 0xbe, 0x3c, 0x01, 0x00, 0x00, 0xe8, 0x82, +0x00, 0xfa, 0xf4, 0xb0, 0x2e, 0xe8, 0x87, 0x00, +0xeb, 0xf7, 0xb0, 0x42, 0xe8, 0x80, 0x00, 0x8b, +0x14, 0x8b, 0x4c, 0x02, 0x66, 0xb8, 0x01, 0x02, +0x00, 0x00, 0x31, 0xdb, 0xcd, 0x13, 0x73, 0x13, +0x80, 0xfa, 0x80, 0x75, 0xaa, 0x66, 0xbe, 0x2f, +0x01, 0x00, 0x00, 0xe8, 0x55, 0x00, 0xe8, 0x33, +0x00, 0xeb, 0xce, 0xb0, 0x43, 0xe8, 0x57, 0x00, +0x66, 0x31, 0xc0, 0x66, 0xbb, 0xfe, 0x01, 0x00, +0x00, 0x67, 0x8b, 0x03, 0x66, 0x3d, 0x55, 0xaa, +0x00, 0x00, 0x74, 0x0b, 0x66, 0xbe, 0x52, 0x01, +0x00, 0x00, 0xe8, 0x2e, 0x00, 0xeb, 0xaa, 0xb0, +0x47, 0xe8, 0x33, 0x00, 0x66, 0xea, 0x00, 0x7c, +0x00, 0x00, 0x00, 0x00, 0x50, 0x53, 0x66, 0xbb, +0x03, 0x01, 0x00, 0x00, 0x50, 0x88, 0xe0, 0x66, +0x83, 0xe0, 0x0f, 0xd7, 0xe8, 0x18, 0x00, 0x58, +0x66, 0x83, 0xe0, 0x0f, 0xd7, 0xe8, 0x0f, 0x00, +0x5b, 0x58, 0xc3, 0x50, 0xfc, 0xac, 0x84, 0xc0, +0x74, 0x0f, 0xe8, 0x02, 0x00, 0xeb, 0xf6, 0x50, +0x53, 0xb4, 0x0e, 0x31, 0xdb, 0x43, 0xcd, 0x10, +0x5b, 0x58, 0xc3, 0x30, 0x31, 0x32, 0x33, 0x34, +0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, +0x44, 0x45, 0x46, 0x4d, 0x42, 0x52, 0x20, 0x6f, +0x6e, 0x20, 0x66, 0x6c, 0x6f, 0x70, 0x70, 0x79, +0x20, 0x6f, 0x72, 0x20, 0x6f, 0x6c, 0x64, 0x20, +0x42, 0x49, 0x4f, 0x53, 0x0d, 0x0a, 0x00, 0x52, +0x65, 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, +0x72, 0x0d, 0x0a, 0x00, 0x4e, 0x6f, 0x20, 0x61, +0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, +0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x0d, +0x0a, 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, +0x64, 0x20, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, +0x75, 0x72, 0x65, 0x0d, 0x0a, 0x00, 0x90, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +0x01, 0x00, 0xa6, 0xff, 0xff, 0xff, 0x00, 0x00, +0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x55, 0xaa, diff --git a/i386/util/fdisk/misc.c b/i386/util/fdisk/misc.c new file mode 100644 index 0000000..0598b4c --- /dev/null +++ b/i386/util/fdisk/misc.c @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <string.h> +#include "misc.h" + + +int +ask_cmd(cmd) + cmd_t *cmd; +{ + char lbuf[100], *cp, *buf; + + /* Get input */ + if (fgets(lbuf, sizeof lbuf, stdin) == NULL) + errx(1, "eof"); + lbuf[strlen(lbuf)-1] = '\0'; + + /* Parse input */ + buf = lbuf; + buf = &buf[strspn(buf, " \t")]; + cp = &buf[strcspn(buf, " \t")]; + *cp++ = '\0'; + strncpy(cmd->cmd, buf, 10); + buf = &cp[strspn(cp, " \t")]; + strncpy(cmd->args, buf, 100); + + return (0); +} + +int +ask_num(str, flags, dflt, low, high, help) + const char *str; + int flags; + int dflt; + int low; + int high; + void (*help) __P((void)); +{ + char lbuf[100], *cp; + int num; + + do { +again: + num = dflt; + if (flags == ASK_HEX) + printf("%s [%X - %X]: [%X] ", str, low, high, num); + else + printf("%s [%d - %d]: [%d] ", str, low, high, num); + if (help) + printf("(? for help) "); + + if (fgets(lbuf, sizeof lbuf, stdin) == NULL) + errx(1, "eof"); + lbuf[strlen(lbuf)-1] = '\0'; + + if (help && lbuf[0] == '?') { + (*help)(); + goto again; + } + + /* Convert */ + cp = lbuf; + num = strtol(lbuf, &cp, ((flags==ASK_HEX)?16:10)); + + /* Make sure only number present */ + if (cp == lbuf) + num = dflt; + if (*cp != '\0') { + printf("'%s' is not a valid number.\n", lbuf); + num = low - 1; + } else if (num < low || num > high) { + printf("'%d' is out of range.\n", num); + } + } while (num < low || num > high); + + return (num); +} + +int +ask_yn(str, default_answer) + const char *str; + int default_answer; +{ + int ch, first; + + printf("%s [%c] ", str, default_answer ? 'y' : 'n'); + fflush(stdout); + + first = ch = getchar(); + while (ch != '\n' && ch != EOF) + ch = getchar(); + + if (ch == EOF || first == EOF) + errx(1, "eof"); + + if (first == '\n') + return default_answer; + + return (first == 'y' || first == 'Y'); +} + +u_int16_t +getshort(p) + void *p; +{ + unsigned char *cp = p; + + return (cp[0] | (cp[1] << 8)); +} + +void +putshort( + void *p, + u_int16_t l) +{ + unsigned char *cp = p; + + *cp++ = l; + *cp++ = l >> 8; +} + +u_int32_t +getlong(p) + void *p; +{ + unsigned char *cp = p; + + return (cp[0] | (cp[1] << 8) | (cp[2] << 16) | (cp[3] << 24)); +} + +void +putlong(p, l) + void *p; + u_int32_t l; +{ + unsigned char *cp = p; + + *cp++ = l; + *cp++ = l >> 8; + *cp++ = l >> 16; + *cp++ = l >> 24; +} diff --git a/i386/util/fdisk/misc.h b/i386/util/fdisk/misc.h new file mode 100644 index 0000000..cc8e2b8 --- /dev/null +++ b/i386/util/fdisk/misc.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MISC_H +#define _MISC_H + +#include <sys/types.h> +#include "cmd.h" + +/* Constants */ +#define ASK_HEX 0x01 +#define ASK_DEC 0x02 + +/* Prototypes */ +int ask_cmd __P((cmd_t *)); +int ask_num __P((const char *, int, int, int, int, void (*help) __P((void)))); +int ask_yn __P((const char *, int)); +u_int16_t getshort __P((void *)); +u_int32_t getlong __P((void *)); +void putshort __P((void *, u_int16_t)); +void putlong __P((void *, u_int32_t)); + +#endif /* _MISC_H */ + diff --git a/i386/util/fdisk/opendev.c b/i386/util/fdisk/opendev.c new file mode 100644 index 0000000..538e4e6 --- /dev/null +++ b/i386/util/fdisk/opendev.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 2000, Todd C. Miller. All rights reserved. + * Copyright (c) 1996, Jason Downs. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <errno.h> +#include <fcntl.h> +#include <limits.h> +#include <paths.h> +#include <stdio.h> +#include <string.h> + +#include "util.h" +/* + * This routine is a generic rewrite of the original code found in + * disklabel(8). + */ + +int +opendev(path, oflags, dflags, realpath) + char *path; + int oflags; + int dflags; + char **realpath; +{ + int fd; + char *slash, *prefix; + static char namebuf[PATH_MAX]; + + /* Initial state */ + if (realpath) + *realpath = path; + fd = -1; + errno = ENOENT; + + if (dflags & OPENDEV_BLCK) + prefix = ""; /* block device */ + else + prefix = "r"; /* character device */ + + if ((slash = strchr(path, '/'))) + fd = open(path, oflags); + else if (dflags & OPENDEV_PART) { + /* + * First try raw partition (for removable drives) + */ + if (snprintf(namebuf, sizeof(namebuf), "%s%s%s%c", + _PATH_DEV, prefix, path, 'a' + getrawpartition()) + < sizeof(namebuf)) { + fd = open(namebuf, oflags); + if (realpath) + *realpath = namebuf; + } else + errno = ENAMETOOLONG; + } + if (!slash && fd == -1 && errno == ENOENT) { + if (snprintf(namebuf, sizeof(namebuf), "%s%s%s", + _PATH_DEV, prefix, path) < sizeof(namebuf)) { + fd = open(namebuf, oflags); + if (realpath) + *realpath = namebuf; + } else + errno = ENAMETOOLONG; + } + return (fd); +} diff --git a/i386/util/fdisk/part.c b/i386/util/fdisk/part.c new file mode 100644 index 0000000..1f5fa6a --- /dev/null +++ b/i386/util/fdisk/part.c @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * 2008-05-24: + * Tamas Kosarszky: changed caption for partition type 0x07 + * and added caption for type 0xEE. + */ +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <sys/fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <machine/param.h> +#include "disk.h" +#include "misc.h" +#include "mbr.h" + + +static const struct part_type { + int type; + char sname[14]; + char *lname; +} part_types[] = { + { 0x00, "unused ", "unused"}, + { 0x01, "DOS FAT-12 ", "Primary DOS with 12 bit FAT"}, + { 0x02, "XENIX / ", "XENIX / filesystem"}, + { 0x03, "XENIX /usr ", "XENIX /usr filesystem"}, + { 0x04, "DOS FAT-16 ", "Primary DOS with 16 bit FAT"}, + { 0x05, "Extended DOS", "Extended DOS"}, + { 0x06, "DOS > 32MB ", "Primary 'big' DOS (> 32MB)"}, + { 0x07, "NTFS ", "Windows NT NTFS"}, + { 0x08, "AIX fs ", "AIX filesystem"}, + { 0x09, "AIX/Coherent", "AIX boot partition or Coherent"}, + { 0x0A, "OS/2 Bootmgr", "OS/2 Boot Manager or OPUS"}, + { 0x0B, "Win95 FAT-32", "Primary Win95 w/ 32-bit FAT"}, + { 0x0C, "Win95 FAT32L", "Primary Win95 w/ 32-bit FAT LBA-mapped"}, + { 0x0E, "DOS FAT-16 ", "Primary DOS w/ 16-bit FAT, CHS-mapped"}, + { 0x0F, "Extended LBA", "Extended DOS LBA-mapped"}, + { 0x10, "OPUS ", "OPUS"}, + { 0x11, "OS/2 hidden ", "OS/2 BM: hidden DOS 12-bit FAT"}, + { 0x12, "Compaq Diag.", "Compaq Diagnostics"}, + { 0x14, "OS/2 hidden ", "OS/2 BM: hidden DOS 16-bit FAT <32M or Novell DOS 7.0 bug"}, + { 0x16, "OS/2 hidden ", "OS/2 BM: hidden DOS 16-bit FAT >=32M"}, + { 0x17, "OS/2 hidden ", "OS/2 BM: hidden IFS"}, + { 0x18, "AST swap ", "AST Windows swapfile"}, + { 0x19, "Willowtech ", "Willowtech Photon coS"}, + { 0x20, "Willowsoft ", "Willowsoft OFS1"}, + { 0x24, "NEC DOS ", "NEC DOS"}, + { 0x38, "Theos ", "Theos"}, + { 0x39, "Plan 9 ", "Plan 9"}, + { 0x40, "VENIX 286 ", "VENIX 286 or LynxOS"}, + { 0x41, "Lin/Minux DR", "Linux/MINIX (sharing disk with DRDOS) or Personal RISC boot"}, + { 0x42, "LinuxSwap DR", "SFS or Linux swap (sharing disk with DRDOS)"}, + { 0x43, "Linux DR ", "Linux native (sharing disk with DRDOS)"}, + { 0x4D, "QNX 4.2 Pri ", "QNX 4.2 Primary"}, + { 0x4E, "QNX 4.2 Sec ", "QNX 4.2 Secondary"}, + { 0x4F, "QNX 4.2 Ter ", "QNX 4.2 Tertiary"}, + { 0x50, "DM ", "DM (disk manager)"}, + { 0x51, "DM ", "DM6 Aux1 (or Novell)"}, + { 0x52, "CP/M or SysV", "CP/M or Microport SysV/AT"}, + { 0x53, "DM ", "DM6 Aux3"}, + { 0x54, "Ontrack ", "Ontrack"}, + { 0x55, "EZ-Drive ", "EZ-Drive (disk manager)"}, + { 0x56, "Golden Bow ", "Golden Bow (disk manager)"}, + { 0x5C, "Priam ", "Priam Edisk (disk manager)"}, + { 0x61, "SpeedStor ", "SpeedStor"}, + { 0x63, "ISC, HURD, *", "ISC, System V/386, GNU HURD or Mach"}, + { 0x64, "Netware 2.xx", "Novell Netware 2.xx"}, + { 0x65, "Netware 3.xx", "Novell Netware 3.xx"}, + { 0x66, "Netware 386 ", "Novell 386 Netware"}, + { 0x67, "Novell ", "Novell"}, + { 0x68, "Novell ", "Novell"}, + { 0x69, "Novell ", "Novell"}, + { 0x70, "DiskSecure ", "DiskSecure Multi-Boot"}, + { 0x75, "PCIX ", "PCIX"}, + { 0x80, "Minix (old) ", "Minix 1.1 ... 1.4a"}, + { 0x81, "Minix (new) ", "Minix 1.4b ... 1.5.10"}, + { 0x82, "Linux swap ", "Linux swap"}, + { 0x83, "Linux files*", "Linux filesystem"}, + { 0x93, "Amoeba file*", "Amoeba filesystem"}, + { 0x94, "Amoeba BBT ", "Amoeba bad block table"}, + { 0x84, "OS/2 hidden ", "OS/2 hidden C: drive"}, + { 0x85, "Linux ext. ", "Linux extended"}, + { 0x86, "NT FAT VS ", "NT FAT volume set"}, + { 0x87, "NTFS VS ", "NTFS volume set or HPFS mirrored"}, + { 0x93, "Amoeba FS ", "Amoeba filesystem"}, + { 0x94, "Amoeba BBT ", "Amoeba bad block table"}, + { 0x99, "Mylex ", "Mylex EISA SCSI"}, + { 0x9F, "BSDI ", "BSDI BSD/OS"}, + { 0xA0, "NotebookSave", "Phoenix NoteBIOS save-to-disk"}, + { 0xA5, "FreeBSD ", "FreeBSD"}, + { 0xA6, "OpenBSD ", "OpenBSD"}, + { 0xA7, "NEXTSTEP ", "NEXTSTEP"}, + { 0xA8, "Darwin UFS ", "Darwin UFS partition"}, + { 0xA9, "NetBSD ", "NetBSD"}, + { 0xAB, "Darwin Boot ", "Darwin boot partition"}, + { 0xAF, "HFS+ ", "Darwin HFS+ partition"}, + { 0xB7, "BSDI filesy*", "BSDI BSD/386 filesystem"}, + { 0xB8, "BSDI swap ", "BSDI BSD/386 swap"}, + { 0xC0, "CTOS ", "CTOS"}, + { 0xC1, "DRDOSs FAT12", "DRDOS/sec (FAT-12)"}, + { 0xC4, "DRDOSs < 32M", "DRDOS/sec (FAT-16, < 32M)"}, + { 0xC6, "DRDOSs >=32M", "DRDOS/sec (FAT-16, >= 32M)"}, + { 0xC7, "HPFS Disbled", "Syrinx (Cyrnix?) or HPFS disabled"}, + { 0xDB, "CPM/C.DOS/C*", "Concurrent CPM or C.DOS or CTOS"}, + { 0xE1, "SpeedStor ", "DOS access or SpeedStor 12-bit FAT extended partition"}, + { 0xE3, "SpeedStor ", "DOS R/O or SpeedStor or Storage Dimensions"}, + { 0xE4, "SpeedStor ", "SpeedStor 16-bit FAT extended partition < 1024 cyl."}, + { 0xEB, "BeOS/i386 ", "BeOS for Intel"}, + { 0xEE, "GPT ", "GPT protective partition"}, + { 0xF1, "SpeedStor ", "SpeedStor or Storage Dimensions"}, + { 0xF2, "DOS 3.3+ Sec", "DOS 3.3+ Secondary"}, + { 0xF4, "SpeedStor ", "SpeedStor >1024 cyl. or LANstep or IBM PS/2 IML"}, + { 0xFF, "Xenix BBT ", "Xenix Bad Block Table"}, +}; + +void +PRT_printall() +{ + int i, idrows; + + idrows = ((sizeof(part_types)/sizeof(struct part_type))+3)/4; + + printf("Choose from the following Partition id values:\n"); + for (i = 0; i < idrows; i++) { + printf("%02X %s %02X %s %02X %s" + , part_types[i ].type, part_types[i ].sname + , part_types[i+idrows ].type, part_types[i+idrows ].sname + , part_types[i+idrows*2].type, part_types[i+idrows*2].sname + ); + if ((i+idrows*3) < (sizeof(part_types)/sizeof(struct part_type))) { + printf(" %02X %s\n" + , part_types[i+idrows*3].type, part_types[i+idrows*3].sname ); + } + else + printf( "\n" ); + } +} + +const char * +PRT_ascii_id(id) + int id; +{ + static char unknown[] = "<Unknown ID>"; + int i; + + for (i = 0; i < sizeof(part_types)/sizeof(struct part_type); i++) { + if (part_types[i].type == id) + return (part_types[i].sname); + } + + return (unknown); +} + +void +PRT_parse(disk, prt, offset, reloff, partn, pn) + disk_t *disk; + void *prt; + off_t offset; + off_t reloff; + prt_t *partn; + int pn; +{ + unsigned char *p = prt; + off_t off; + + partn->flag = *p++; + partn->shead = *p++; + + partn->ssect = (*p) & 0x3F; + partn->scyl = ((*p << 2) & 0xFF00) | (*(p+1)); + p += 2; + + partn->id = *p++; + partn->ehead = *p++; + partn->esect = (*p) & 0x3F; + partn->ecyl = ((*p << 2) & 0xFF00) | (*(p+1)); + p += 2; + + if ((partn->id == DOSPTYP_EXTEND) || (partn->id == DOSPTYP_EXTENDL)) + off = reloff; + else + off = offset; + + partn->bs = getlong(p) + off; + partn->ns = getlong(p+4); + + + /* Zero out entry if not used */ + if (partn->id == DOSPTYP_UNUSED ) { + memset(partn, 0, sizeof(*partn)); + } +} + +int +PRT_check_chs(partn) + prt_t *partn; +{ + if ( (partn->shead > 255) || + (partn->ssect >63) || + (partn->scyl > 1023) || + (partn->ehead >255) || + (partn->esect >63) || + (partn->ecyl > 1023) ) + { + return 0; + } + return 1; +} +void +PRT_make(partn, offset, reloff, prt) + prt_t *partn; + off_t offset; + off_t reloff; + void *prt; +{ + unsigned char *p = prt; + prt_t tmp; + off_t off; + + tmp.shead = partn->shead; + tmp.ssect = partn->ssect; + tmp.scyl = (partn->scyl > 1023)? 1023: partn->scyl; + tmp.ehead = partn->ehead; + tmp.esect = partn->esect; + tmp.ecyl = (partn->ecyl > 1023)? 1023: partn->ecyl; + if (!PRT_check_chs(partn) && PRT_check_chs(&tmp)) { + partn->shead = tmp.shead; + partn->ssect = tmp.ssect; + partn->scyl = tmp.scyl; + partn->ehead = tmp.ehead; + partn->esect = tmp.esect; + partn->ecyl = tmp.ecyl; + printf("Cylinder values are modified to fit in CHS.\n"); + } + if ((partn->id == DOSPTYP_EXTEND) || (partn->id == DOSPTYP_EXTENDL)) + off = reloff; + else + off = offset; + + if (PRT_check_chs(partn)) { + *p++ = partn->flag & 0xFF; + + *p++ = partn->shead & 0xFF; + *p++ = (partn->ssect & 0x3F) | ((partn->scyl & 0x300) >> 2); + *p++ = partn->scyl & 0xFF; + + *p++ = partn->id & 0xFF; + + *p++ = partn->ehead & 0xFF; + *p++ = (partn->esect & 0x3F) | ((partn->ecyl & 0x300) >> 2); + *p++ = partn->ecyl & 0xFF; + } else { + /* should this really keep flag, id and set others to 0xff? */ + *p++ = partn->flag & 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + *p++ = partn->id & 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + *p++ = 0xFF; + printf("Warning CHS values out of bounds only saving LBA values\n"); + } + + putlong(p, partn->bs - off); + putlong(p+4, partn->ns); +} + +void +PRT_print(num, partn) + int num; + prt_t *partn; +{ + + if (partn == NULL) { + printf(" Starting Ending\n"); + printf(" #: id cyl hd sec - cyl hd sec [ start - size]\n"); + printf("------------------------------------------------------------------------\n"); + } else { + printf("%c%1d: %.2X %4d %3d %3d - %4d %3d %3d [%10d - %10d] %s\n", + (partn->flag == 0x80)?'*':' ', + num + 1, partn->id, + partn->scyl, partn->shead, partn->ssect, + partn->ecyl, partn->ehead, partn->esect, + partn->bs, partn->ns, + PRT_ascii_id(partn->id)); + } +} + +void +PRT_fix_BN(disk, part, pn) + disk_t *disk; + prt_t *part; + int pn; +{ + int spt, tpc, spc; + int start = 0; + int end = 0; + + /* Zero out entry if not used */ + if (part->id == DOSPTYP_UNUSED ) { + memset(part, 0, sizeof(*part)); + return; + } + + /* Disk metrics */ + spt = disk->real->sectors; + tpc = disk->real->heads; + spc = spt * tpc; + + start += part->scyl * spc; + start += part->shead * spt; + start += part->ssect - 1; + + end += part->ecyl * spc; + end += part->ehead * spt; + end += part->esect - 1; + + /* XXX - Should handle this... */ + if (start > end) + warn("Start of partition #%d after end!", pn); + + part->bs = start; + part->ns = (end - start) + 1; +} + +void +PRT_fix_CHS(disk, part, pn) + disk_t *disk; + prt_t *part; + int pn; +{ + int spt, tpc, spc; + int start; + int cyl, head, sect; + + /* Zero out entry if not used */ + if (part->id == DOSPTYP_UNUSED ) { + memset(part, 0, sizeof(*part)); + return; + } + + /* Disk metrics */ + spt = disk->real->sectors; + tpc = disk->real->heads; + spc = spt * tpc; + + start = part->bs; + + if(start <= spt) { + /* Figure out "real" starting CHS values */ + cyl = (start / spc); start -= (cyl * spc); + head = (start / spt); start -= (head * spt); + sect = (start + 1); + } else { + cyl = 1023; + head = 254; + sect = 63; + } + + part->scyl = cyl; + part->shead = head; + part->ssect = sect; + + /* use fake geometry to trigger LBA mode */ + + cyl = 1023; + head = 254; + sect = 63; + + part->ecyl = cyl; + part->ehead = head; + part->esect = sect; +} + diff --git a/i386/util/fdisk/part.h b/i386/util/fdisk/part.h new file mode 100644 index 0000000..049cf2c --- /dev/null +++ b/i386/util/fdisk/part.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _PART_H +#define _PART_H + +/* Partition type */ +typedef struct _prt_t { + int shead, scyl, ssect; + int ehead, ecyl, esect; + int bs; + int ns; + unsigned char flag; + unsigned char id; +} prt_t; + +/* Prototypes */ +void PRT_printall __P((void)); +const char *PRT_ascii_id __P((int)); +void PRT_parse __P((disk_t *, void *, off_t, off_t, prt_t *, int)); +void PRT_make __P((prt_t *, off_t, off_t, void *)); +void PRT_print __P((int, prt_t *)); + +/* This does CHS -> bs/ns */ +void PRT_fix_BN __P((disk_t *, prt_t *, int)); + +/* This does bs/ns -> CHS */ +void PRT_fix_CHS __P((disk_t *, prt_t *, int)); +#endif /* _PART_H */ + diff --git a/i386/util/fdisk/user.c b/i386/util/fdisk/user.c new file mode 100644 index 0000000..cfd745f --- /dev/null +++ b/i386/util/fdisk/user.c @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <err.h> +#include <util.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#include <sys/fcntl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <machine/param.h> +#include "user.h" +#include "disk.h" +#include "misc.h" +#include "mbr.h" +#include "cmd.h" + + +/* Our command table */ +static cmd_table_t cmd_table[] = { + {"help", Xhelp, "Command help list"}, + {"manual", Xmanual, "Show entire man page for fdisk"}, + {"reinit", Xreinit, "Re-initialize loaded MBR (to defaults)"}, + {"auto", Xauto, "Auto-partition the disk with a partition style"}, + {"setpid", Xsetpid, "Set the identifier of a given table entry"}, + {"disk", Xdisk, "Edit current drive stats"}, + {"edit", Xedit, "Edit given table entry"}, + {"erase", Xerase, "Erase current MBR"}, + {"flag", Xflag, "Flag given table entry as bootable"}, + {"update", Xupdate, "Update machine code in loaded MBR"}, + {"select", Xselect, "Select extended partition table entry MBR"}, + {"print", Xprint, "Print loaded MBR partition table"}, + {"write", Xwrite, "Write loaded MBR to disk"}, + {"exit", Xexit, "Exit edit of current MBR, without saving changes"}, + {"quit", Xquit, "Quit edit of current MBR, saving current changes"}, + {"abort", Xabort, "Abort program without saving current changes"}, + {NULL, NULL, NULL} +}; + + +int +USER_write(disk, tt, preserve, force) + disk_t *disk; + mbr_t *tt; /* Template MBR to write */ + int preserve; /* Preserve partition table and just write boot code */ + int force; /* Don't ask any questions */ +{ + int fd, yn; + char *msgp = "\nDo you wish to write new MBR?"; + char *msgk = "\nDo you wish to write new MBR and partition table?"; + + /* Write sector 0 */ + if (force) { + yn = 1; + } else { + printf("\a\n" + "\t-----------------------------------------------------\n" + "\t------ ATTENTION - UPDATING MASTER BOOT RECORD ------\n" + "\t-----------------------------------------------------\n"); + if (preserve) + yn = ask_yn(msgp, 0); + else + yn = ask_yn(msgk, 0); + } + + if (yn) { + if (preserve) { + int shared; + /* Only write the first one, if there's more than one in an extended partition chain */ + /* Since we're updating boot code, we don't require exclusive access */ + fd = DISK_openshared(disk->name, O_RDWR, &shared); + MBR_make(tt); + MBR_write(disk, fd, tt); + DISK_close(fd); + } else { + MBR_write_all(disk, tt); + } + } else { + printf("MBR is unchanged\n"); + } + + return (0); +} + + +int +USER_modify(disk, tt, offset, reloff) + disk_t *disk; + mbr_t *tt; + off_t offset; + off_t reloff; +{ + static int editlevel; + mbr_t *mbr; + cmd_t cmd; + int i, st, fd; + int modified = 0; + + /* One level deeper */ + editlevel += 1; + + /* Set up command table pointer */ + cmd.table = cmd_table; + + /* Read MBR & partition */ + mbr = MBR_alloc(NULL); + fd = DISK_open(disk->name, O_RDONLY); + MBR_read(disk, fd, offset, mbr); + DISK_close(fd); + + /* Parse the sucker */ + MBR_parse(disk, offset, reloff, mbr); + + if (mbr->signature != MBR_SIGNATURE) { + int yn = ask_yn("The signature for this MBR is invalid.\nWould you like to initialize the partition table?", 1); + if (yn) { + strcpy(cmd.cmd, "erase"); + cmd.args[0] = '\0'; + st = Xerase(&cmd, disk, mbr, tt, offset); + modified = 1; + } + } + + printf("Enter 'help' for information\n"); + + /* Edit cycle */ + do { +again: + printf("fdisk:%c%d> ", (modified)?'*':' ', editlevel); + fflush(stdout); + ask_cmd(&cmd); + + if (cmd.cmd[0] == '\0') + goto again; + for (i = 0; cmd_table[i].cmd != NULL; i++) + if (strstr(cmd_table[i].cmd, cmd.cmd)==cmd_table[i].cmd) + break; + + /* Quick hack to put in '?' == 'help' */ + if (!strcmp(cmd.cmd, "?")) + i = 0; + + /* Check for valid command */ + if (cmd_table[i].cmd == NULL) { + printf("Invalid command '%s'. Try 'help'.\n", cmd.cmd); + continue; + } else + strcpy(cmd.cmd, cmd_table[i].cmd); + + /* Call function */ + st = cmd_table[i].fcn(&cmd, disk, mbr, tt, offset); + + /* Update status */ + if (st == CMD_EXIT) + break; + if (st == CMD_SAVE) + break; + if (st == CMD_CLEAN) + modified = 0; + if (st == CMD_DIRTY) + modified = 1; + } while (1); + + /* Write out MBR */ + if (modified) { + if (st == CMD_SAVE) { + int shared = 0; + printf("Writing current MBR to disk.\n"); + fd = DISK_openshared(disk->name, O_RDWR, &shared); + if(shared) { + if(!ask_yn("Device could not be accessed exclusively.\nA reboot will be needed for changes to take effect. OK?", 0)) { + close(fd); + goto again; + } + } + + MBR_make(mbr); + MBR_write(disk, fd, mbr); + close(fd); + } else { + int yn = ask_yn("MBR was modified; really quit without saving?", 0); + if (yn) { + printf("Aborting changes to current MBR.\n"); + } else { + goto again; + } + } + } + + /* One level less */ + editlevel -= 1; + + MBR_free(mbr); + + return (0); +} + +int +USER_print_disk(disk, do_dump) + disk_t *disk; + int do_dump; +{ + int fd, offset, firstoff; + mbr_t *mbr; + + fd = DISK_open(disk->name, O_RDONLY); + offset = firstoff = 0; + + if (!do_dump) + DISK_printmetrics(disk); + + mbr = MBR_read_all(disk); + if (do_dump) + MBR_dump_all(mbr); + else + MBR_print_all(mbr); + MBR_free(mbr); + + return (DISK_close(fd)); +} + + + diff --git a/i386/util/fdisk/user.h b/i386/util/fdisk/user.h new file mode 100644 index 0000000..7234c98 --- /dev/null +++ b/i386/util/fdisk/user.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/* + * Copyright (c) 1997 Tobias Weingartner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Tobias Weingartner. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _USER_H +#define _USER_H + +#include "disk.h" +#include "mbr.h" + +/* Prototypes */ +int USER_write __P((disk_t *, mbr_t *, int, int)); +int USER_modify __P((disk_t *, mbr_t *, off_t, off_t)); +int USER_print_disk __P((disk_t *, int)); +#endif /* _USER_H */ + diff --git a/i386/util/fdisk/util.h b/i386/util/fdisk/util.h new file mode 100644 index 0000000..4e1600d --- /dev/null +++ b/i386/util/fdisk/util.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +/*- + * Copyright (c) 1995 + * The Regents of the University of California. All rights reserved. + * Portions Copyright (c) 1996, Jason Downs. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#include <sys/cdefs.h> +#include <sys/types.h> + +/* + * fparseln() specific operation flags. + */ +#define FPARSELN_UNESCESC 0x01 +#define FPARSELN_UNESCCONT 0x02 +#define FPARSELN_UNESCCOMM 0x04 +#define FPARSELN_UNESCREST 0x08 +#define FPARSELN_UNESCALL 0x0f + +/* + * opendev() specific operation flags. + */ +#define OPENDEV_PART 0x01 /* Try to open the raw partition. */ +#define OPENDEV_DRCT 0x02 /* Obsolete (now default behavior). */ +#define OPENDEV_BLCK 0x04 /* Open block, not character device. */ + +/* + * uucplock(3) specific flags. + */ +#define UU_LOCK_INUSE (1) +#define UU_LOCK_OK (0) +#define UU_LOCK_OPEN_ERR (-1) +#define UU_LOCK_READ_ERR (-2) +#define UU_LOCK_CREAT_ERR (-3) +#define UU_LOCK_WRITE_ERR (-4) +#define UU_LOCK_LINK_ERR (-5) +#define UU_LOCK_TRY_ERR (-6) +#define UU_LOCK_OWNER_ERR (-7) + +/* + * stub struct definitions. + */ +struct __sFILE; +struct login_cap; +struct passwd; +struct termios; +struct winsize; + +__BEGIN_DECLS +char *fparseln __P((struct __sFILE *, size_t *, size_t *, const char[3], int)); +int login_tty __P((int)); +int logout __P((const char *)); +void logwtmp __P((const char *, const char *, const char *)); +int opendev __P((char *, int, int, char **)); +int pidfile __P((const char *)); +void pw_setdir __P((const char *)); +char *pw_file __P((const char *)); +int pw_lock __P((int retries)); +int pw_mkdb __P((char *, int)); +int pw_abort __P((void)); +void pw_init __P((void)); +void pw_edit __P((int, const char *)); +void pw_prompt __P((void)); +void pw_copy __P((int, int, struct passwd *)); +void pw_getconf __P((char *, size_t, const char *, const char *)); +int pw_scan __P((char *, struct passwd *, int *)); +void pw_error __P((const char *, int, int)); +int openpty __P((int *, int *, char *, struct termios *, + struct winsize *)); +int opendisk __P((const char *path, int flags, char *buf, size_t buflen, + int iscooked)); +pid_t forkpty __P((int *, char *, struct termios *, struct winsize *)); +int getmaxpartitions __P((void)); +int getrawpartition __P((void)); +void login_fbtab __P((char *, uid_t, gid_t)); +int login_check_expire __P((struct __sFILE *, struct passwd *, char *, int)); +char *readlabelfs __P((char *, int)); +const char *uu_lockerr __P((int _uu_lockresult)); +int uu_lock __P((const char *_ttyname)); +int uu_lock_txfr __P((const char *_ttyname, pid_t _pid)); +int uu_unlock __P((const char *_ttyname)); +__END_DECLS + +#endif /* !_UTIL_H_ */ diff --git a/i386/util/machOconv.c b/i386/util/machOconv.c new file mode 100644 index 0000000..540efe3 --- /dev/null +++ b/i386/util/machOconv.c @@ -0,0 +1,191 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <sys/file.h> +#include <mach-o/loader.h> +#include <libkern/OSByteOrder.h> +#include <unistd.h> + +int infile, outfile; + +struct mach_header mh; +void * cmds; + +static bool swap_ends; + +static unsigned long swap(unsigned long x) +{ + if (swap_ends) return OSSwapInt32(x); + else return x; +} + +int +main(int argc, char *argv[]) +{ + kern_return_t result; + vm_address_t data; + int nc, ncmds; + char * cp; + + if (argc == 2) + { + infile = open(argv[1], O_RDONLY); + if (infile < 0) goto usage; + outfile = fileno(stdout); + } + else if (argc == 3) + { + infile = open(argv[1], O_RDONLY); + if (infile < 0) goto usage; + outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (outfile < 0) goto usage; + } + else + { + usage: + fprintf(stderr, "usage: machOconv inputfile [outputfile]\n"); + exit(1); + } + + nc = read(infile, &mh, sizeof (mh)); + if (nc < 0) + { + perror("read mach header"); + exit(1); + } + + if (nc < (int)sizeof (mh)) + { + fprintf(stderr, "read mach header: premature EOF %d\n", nc); + exit(1); + } + + + if (mh.magic == MH_MAGIC) swap_ends = false; + else if (mh.magic == MH_CIGAM) swap_ends = true; + else + { + fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); + exit(1); + } + + cmds = calloc(swap(mh.sizeofcmds), sizeof (char)); + if (cmds == 0) + { + fprintf(stderr, "alloc load commands: no memory\n"); + exit(1); + } + nc = read(infile, cmds, swap(mh.sizeofcmds)); + if (nc < 0) + { + perror("read load commands"); + exit(1); + } + if (nc < (int)swap(mh.sizeofcmds)) + { + fprintf(stderr, "read load commands: premature EOF %d\n", nc); + exit(1); + } + + unsigned long vmstart = (unsigned long)-1; + + // First pass: determine actual load address + for (ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) + { +#define lcp ((struct load_command *)cp) +#define scp ((struct segment_command *)cp) + + switch(swap(lcp->cmd)) + { + case LC_SEGMENT: + if(vmstart > swap(scp->vmaddr)) + { + vmstart = swap(scp->vmaddr); + } + } + cp += swap(lcp->cmdsize); + + } + + // Second pass: output to file. + for (ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) + { +#define lcp ((struct load_command *)cp) +#define scp ((struct segment_command *)cp) + + bool isDATA; + unsigned vmsize; + + switch(swap(lcp->cmd)) + { + case LC_SEGMENT: + isDATA = (strcmp(scp->segname, "__DATA") == 0); + if (isDATA) + { + vmsize = swap(scp->filesize); + } + else + { + vmsize = swap(scp->vmsize); + } + + result = vm_allocate(mach_task_self(), &data, vmsize, true); + if (result != KERN_SUCCESS) { + mach_error("vm_allocate segment data", result); + exit(1); + } + + lseek(infile, swap(scp->fileoff), L_SET); + nc = read(infile, (void *)data, swap(scp->filesize)); + if (nc < 0) { + perror("read segment data"); + exit(1); + } + if (nc < (int)swap(scp->filesize)) { + fprintf(stderr, "read segment data: premature EOF %d\n", nc); + exit(1); + } + + lseek(outfile, swap(scp->vmaddr) - vmstart, L_SET); + nc = write(outfile, (void *)data, vmsize); + if (nc < (int)vmsize) { + perror("write segment data"); + exit(1); + } + + vm_deallocate(mach_task_self(), data, vmsize); + break; + } + + cp += swap(lcp->cmdsize); + } + + exit(0); +} diff --git a/i386/util/openUp.c b/i386/util/openUp.c new file mode 100644 index 0000000..a95e0a6 --- /dev/null +++ b/i386/util/openUp.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. + * + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +/* + * Shantonu Sen <<EMAIL REMOVED>> + * openUp.c - program to set the "first-open-window" field of a volume + * + * Get the directory ID for the first argument, and set it as word 2 + * of the Finder Info fields for the volume it lives on + * + * cc -o openUp openUp.c + * Usage: openUp /Volumes/Foo/OpenMe/ + * + */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/attr.h> +#include <sys/stat.h> +#include <sys/mount.h> +#include <memory.h> + +struct directoryinfo { + long unsigned length; + uintptr_t dirid; // changed from: u_int32_t dirid; +}; + +struct volumeinfo { + long unsigned length; + uintptr_t finderinfo[8]; // changed from: u_int32_t finderinfo[8]; +}; + + +int main(int argc, char *argv[]) { + char *path = NULL; + struct attrlist alist; + struct directoryinfo dirinfo; + struct volumeinfo volinfo; + struct statfs sfs; + + path = argv[1]; + + bzero(&alist, sizeof(alist)); + alist.bitmapcount = 5; + alist.commonattr = ATTR_CMN_OBJID; + + getattrlist(path, &alist, &dirinfo, sizeof(dirinfo), 0); + + printf("directory id: %lu\n", dirinfo.dirid); + + statfs(path, &sfs); + + printf("mountpoint: %s\n", sfs.f_mntonname); + + alist.commonattr = ATTR_CMN_FNDRINFO; + alist.volattr = ATTR_VOL_INFO; + + getattrlist(sfs.f_mntonname, &alist, &volinfo, sizeof(volinfo), 0); + volinfo.finderinfo[2] = dirinfo.dirid; + setattrlist(sfs.f_mntonname, &alist, volinfo.finderinfo, sizeof(volinfo.finderinfo), 0); + + return EXIT_SUCCESS; +} diff --git a/i386/util/segsize.c b/i386/util/segsize.c new file mode 100644 index 0000000..592878a --- /dev/null +++ b/i386/util/segsize.c @@ -0,0 +1,128 @@ +/* + * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 2.0 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. + * + * The Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <mach/mach.h> +#include <mach/mach_error.h> +#include <sys/file.h> +#include <mach-o/loader.h> +#include <libkern/OSByteOrder.h> +#include <unistd.h> + +int infile; + +struct mach_header mh; +void * cmds; + +static bool swap_ends; + +static unsigned long swap( + unsigned long x + ) +{ + if (swap_ends) + return OSSwapInt32(x); + else + return x; +} + +int +main(int argc, char *argv[]) +{ + int nc, ncmds; + char * cp; + + if (argc == 3) { + infile = open(argv[1], O_RDONLY); + if (infile < 0) + goto usage; + } + else { + usage: + fprintf(stderr, "usage: segsize segment\n"); + exit(1); + } + + nc = read(infile, &mh, sizeof (mh)); + if (nc < 0) { + perror("read mach header"); + exit(1); + } + if (nc < (int)sizeof (mh)) { + fprintf(stderr, "read mach header: premature EOF %d\n", nc); + exit(1); + } + if (mh.magic == MH_MAGIC) + swap_ends = false; + else if (mh.magic == MH_CIGAM) + swap_ends = true; + else { + fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic); + exit(1); + } + + cmds = calloc(swap(mh.sizeofcmds), sizeof (char)); + if (cmds == 0) { + fprintf(stderr, "alloc load commands: no memory\n"); + exit(1); + } + nc = read(infile, cmds, swap(mh.sizeofcmds)); + if (nc < 0) { + perror("read load commands"); + exit(1); + } + if (nc < (int)swap(mh.sizeofcmds)) { + fprintf(stderr, "read load commands: premature EOF %d\n", nc); + exit(1); + } + + for ( ncmds = swap(mh.ncmds), cp = cmds; + ncmds > 0; ncmds--) { +// bool isDATA; +// unsigned vmsize; + +#define lcp ((struct load_command *)cp) + switch(swap(lcp->cmd)) { + + case LC_SEGMENT: +#define scp ((struct segment_command *)cp) + if(strcmp(scp->segname, argv[2]) == 0) + { + printf("%ld\n", swap(scp->vmsize)); +#if 0 + if (isDATA) + vmsize = swap(scp->filesize); + else + vmsize = swap(scp->vmsize); +#endif + } + break; + } + + cp += swap(lcp->cmdsize); + } + + exit(0); +} diff --git a/package/.svn/all-wcprops b/package/.svn/all-wcprops new file mode 100644 index 0000000..d9c23b9 --- /dev/null +++ b/package/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/chameleon/!svn/ver/2249/branches/Chimera/package +END +Distribution +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Distribution +END +slimpkg.sh +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/slimpkg.sh +END +builddmg.sh +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/builddmg.sh +END +Changes.txt +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Changes.txt +END +smbios.plist +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/smbios.plist +END +buildpkg.sh +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/buildpkg.sh +END +po4a-chameleon.cfg +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/po4a-chameleon.cfg +END diff --git a/package/.svn/entries b/package/.svn/entries new file mode 100644 index 0000000..1dad4c8 --- /dev/null +++ b/package/.svn/entries @@ -0,0 +1,290 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +slimpkg.sh +file + + + + +2013-08-27T23:56:41.000000Z +380b34f68e2f9ca64ccd553d29af1f89 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +14669 + +Distribution +file + + + + +2013-08-27T23:56:41.000000Z +3fe4a8ad104731a35cd700f8d5a2d096 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2518 + +Scripts.templates +dir + +smbios.plist +file + + + + +2013-08-27T23:56:41.000000Z +42cf3c2e764f56517c1c7df128f6807f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1937 + +Changes.txt +file + + + + +2013-08-27T23:56:41.000000Z +853f57b424ac2dfcf35b1e2d97878b7e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3801 + +Scripts +dir + +Resources.old +dir + +po4a-chameleon.cfg +file + + + + +2013-08-27T23:56:41.000000Z +5d7cd8ba7db3b9391dbfe9cfadd08a0f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +668 + +builddmg.sh +file + + + + +2013-08-27T23:56:41.000000Z +e57415d433d804df9564bfa31a077bbf +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7235 + +OptionalSettings +dir + +bin +dir + +buildpkg.sh +file + + + + +2013-08-27T23:56:41.000000Z +66e7836946548f040895baddb5c9222d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +44619 + +Resources +dir + +Icons +dir + +po +dir + diff --git a/package/.svn/prop-base/builddmg.sh.svn-base b/package/.svn/prop-base/builddmg.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/.svn/prop-base/builddmg.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/.svn/prop-base/buildpkg.sh.svn-base b/package/.svn/prop-base/buildpkg.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/.svn/prop-base/buildpkg.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/.svn/prop-base/slimpkg.sh.svn-base b/package/.svn/prop-base/slimpkg.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/.svn/prop-base/slimpkg.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/.svn/text-base/Changes.txt.svn-base b/package/.svn/text-base/Changes.txt.svn-base new file mode 100644 index 0000000..f6bb95c --- /dev/null +++ b/package/.svn/text-base/Changes.txt.svn-base @@ -0,0 +1,77 @@ +- JrCs - Add translation to the project. + +- ErmaC - Update Language for whobuild resources. + +- JrCs - Improved Installer - Start using template scripts + +- JrCs - Look for a com.apple.Boot.plist file for users upgrading from legacy installations + +- Only create Chameleon.Backups and write to the install log, if required. + +- JrCs - Improved backup of chameleon files + +- JrCs - Automaticaly select previous options + +- JrCs - Improved buildpkg script - Simplify the construction of options menu - Add a lot of checks to avoid the construction of a bad XML file + +- Change Localizable.strings to match the recent changes to the install process. + +- Improve messages written to the installation log. + +- Change upgrade install to only backup /Extra folder if necessary. + +- JrCs - Enhanced installer - We can add an option without an associated package - We can have an option that install +multiple packages - No more "fake" option (none) - The package that is build is already compressed (no need to +compress it again) + +- JrCs - Update postinstall script - Fix a bug where kernel flags are not set properly - Fix indent - Add some comments. + +- JrCs - Automaticaly select upgrade option if /Extra/org.chameleon.Boot.plist file exists on the target volume. + +- JrCs - Keylayout / Keymaps fixed and made a mandatory install when a keymap is chosen. + +- Add option to upgrade an existing install - or more exactly, merge newly selected options with an existing /Extra folder. Also, rename an existing /Extra/com.apple.Boot.plist to /Extra/org.chameleon.Boot.plist. + +- Change the layout/wording displayed in the installer (English only) and give it a facelift. Adjust background image to scale to fit in the window. + +- Set exclusive 'None' option to default choice. + +- Add code to detect and make necessary changes to avoid possibility of a b1f:error or boot1:error should the user decide to install a secondary boot partition. + +- Fix bug installing to /Volumes/EFI + +- Add crazybirdy's Chinese translation to zh-CN and zh-TW resources. + +- Add dmaazar's boot0workV2 changes to ../i386/boot0/boot0md.s. + +- Added check for an existing Chameleon installation on a different partition of same target disk to help stop new +users from confusing themselves. If found, the install process will exit and write the reason to the install log. + +- Re-organised Scripts folder in to Main and Sub scripts. The main scripts for the standard and EFI system partition +installation options have been changed to used the code that I'd previously re-structured. The Sub scripts are the +original chameleon installer scripts with maybe some tweaks/additions, split in to separate scripts. These scripts +include the previous additions I'd made including checking for FAT16 partitions, installing boot0md or boot0 depending +on whether or not a Windows installation is found and writing boot1h or boot1f32 depending on installing to HFS or +FAT32 format partitions. + +- All references of Boot0hfs removed and now replaced with Boot0md. + +- Installer log added to now dump a log of useful info about the install process to the root of the selected target. + +- Boot options re-thought and are now automatically created at compile time from simple lists, rather than manage a +separate file of code of each option. + +- Added missing useKernelCache boot option. + +- Easily enable a list to be exclusive or not. + +- The main Post script now creates the org.chameleon.Boot.plist based on the modules / options / key layouts / themes +selected by the user. + +- Only create and /Extra folder if there's something to go in it. + +- Backup an existing /Extra folder to /Extra-OLD(date & time). + +- slimpkg.sh changed to match the revised code in buildpkg.sh where applicable. + +- English Localizable.strings revised to match latest additions and some texts updated. diff --git a/package/.svn/text-base/Distribution.svn-base b/package/.svn/text-base/Distribution.svn-base new file mode 100644 index 0000000..9c2ed38 --- /dev/null +++ b/package/.svn/text-base/Distribution.svn-base @@ -0,0 +1,80 @@ +<?xml version="1.0"?> + +<installer-gui-script minSpecVersion='1'> + + <options hostArchitectures='i386' allow-external-scripts="no"/> + <domains enable_anywhere="true"/> + + <welcome file='Welcome.html'/> + <license file="License.rtf" sla="EA0401"/> + <readme file='Description.html'/> + <conclusion file="Conclusion.html"/> + <background file='background.tiff' alignment='topleft' scaling='tofit'/> + + <title>Chameleon_Package_Title + + diff --git a/package/.svn/text-base/builddmg.sh.svn-base b/package/.svn/text-base/builddmg.sh.svn-base new file mode 100644 index 0000000..2d335f4 --- /dev/null +++ b/package/.svn/text-base/builddmg.sh.svn-base @@ -0,0 +1,235 @@ +#!/bin/bash + +# $1 Path to store built dmg + +pkgroot="${0%/*}" +SYM_ROOT="${1%/*}" +DMG_ROOT=$SYM_ROOT + +OPENUP_TOOL=${1%/*}/i386/openUp + +SRC_FOLDER=${1%/*}/source +VOLUME_NAME="Chameleon" +TEMP_NAME="rw.dmg" +DMG_TEMP_NAME=${DMG_ROOT}/${TEMP_NAME} +TEMPLATE_DMG=${pkgroot}/dmg/ro.dmg +EULA_RSRC=${pkgroot}/dmg/SLAResources + + +# ============================= +# Setting color for text output +# ============================= + +COL_BLACK="\x1b[30;01m" +COL_RED="\x1b[31;01m" +COL_GREEN="\x1b[32;01m" +COL_YELLOW="\x1b[33;01m" +COL_MAGENTA="\x1b[35;01m" +COL_CYAN="\x1b[36;01m" +COL_WHITE="\x1b[37;01m" +COL_BLUE="\x1b[34;01m" +COL_RESET="\x1b[39;49;00m" + +# ====================== +# Setting Chameleon info +# ====================== + +version=$( cat version ) +stage=${version##*-} +revision=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' ) +builddate=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) +timestamp=$( date -j -f "%Y-%m-%d %H:%M:%S" "${builddate}" "+%s" ) +CHAMELEON_PACKAGE_NAME=${VOLUME_NAME}-${version}-r${revision} + +# ========================= +# Start of building process +# ========================= + +echo "" +echo -e $COL_BLACK" ----------------------"$COL_RESET +echo -e $COL_BLACK" Building $VOLUME_NAME DMG"$COL_RESET +echo -e $COL_BLACK" ----------------------"$COL_RESET +echo "" + +# ================================= +# 1) Clean previous builded contents +# ================================= + + if [ -x ${SRC_FOLDER} ]; then + echo " Deleting previous existing source folder/content " + rm -R ${SRC_FOLDER} + rm -f ${DMG_TEMP_NAME} + fi + +# =========================== +# 2) Create the source folder +# =========================== + + echo " [mkdir] Creating source folder " + mkdir "${SRC_FOLDER}" + +# ================================== +# 3) Copy content into source folder +# ================================== + + ditto -xk "${pkgroot}/Icons/i386.zip" "${SRC_FOLDER}/" + ditto -xk "${pkgroot}/Icons/doc.zip" "${SRC_FOLDER}/" + ditto -xk "${pkgroot}/Icons/pan.zip" "${SRC_FOLDER}/" + ditto -xk "${pkgroot}/Icons/tm.zip" "${SRC_FOLDER}/" + + #mv ${SYM_ROOT}/${VOLUME_NAME}.pkg ${SRC_FOLDER}/${VOLUME_NAME}.pkg + cp -r ${SYM_ROOT}/${CHAMELEON_PACKAGE_NAME}.pkg ${SRC_FOLDER}/${CHAMELEON_PACKAGE_NAME}.pkg + #cp -r ${pkgroot}/doc/* ${SRC_FOLDER}/Documentation/ + cp -r ${SYM_ROOT%/*}/doc/BootHelp.txt ${SRC_FOLDER}/Documentation/ + cp -r ${SYM_ROOT%/*}/doc/Users_Guide0.5.pdf ${SRC_FOLDER}/Documentation/ + cp -r ${pkgroot}/Configuration/PrefPanel/* ${SRC_FOLDER}/PrefPanel/ + cp -r ${SYM_ROOT}/i386/* ${SRC_FOLDER}/i386/ + cp -r ${SYM_ROOT%/*}/artwork/themes/* ${SRC_FOLDER}/Themes/ + #rm -rf ${SRC_FOLDER}`find . -type d -name .svn` + + # The above line caused problems with svn reporting changes to all + # directories in the Chameleon source folder that exist before compiling + # svn status would show the following: + # ~ Chameleon.xcodeproj + # ~ artwork + # ~ i386 + # ~ package + # ~ doc + # I've changed the code to this for now to get round the problem. + # Hopefully someone else can find out why it was happenening. + svnFilesToRemove=($( find "${SRC_FOLDER}" -type d -name '.svn')) + for (( i = 0 ; i < ${#svnFilesToRemove[@]} ; i++ )) + do + rm -rf ${svnFilesToRemove[$i]} + done + +# ======================================= +# 4) Find the size of the folder contents +# ======================================= + + FOLDER_SIZE=`/usr/bin/du -s "${SRC_FOLDER}" | sed s/[^0-9].*//` + +# ===================================================== +# 4) Allow for partition table and other overhead (10%) +# ===================================================== + + IMAGE_SIZE=$(($FOLDER_SIZE * 110/100)) + +# ============================================ +# 5) Minimum size for an HFS+ partition is 4Mb +# ============================================ + + [ $IMAGE_SIZE -lt 19960 ] && IMAGE_SIZE=19960 # [ $IMAGE_SIZE -lt 8300 ] && IMAGE_SIZE=8300 + +# ================================================================= +# 6) Make sure NEXT_ROOT is not set (if we're building with an SDK) +# ================================================================= + + unset NEXT_ROOT + echo " Source folder size = $FOLDER_SIZE" + echo " DMG image size (+10%) = $IMAGE_SIZE" + echo " " + +# ======================================= +# 7) Convert the DMG template into RW-DMG +# ======================================= + + echo " [hdutil] Creating disk image " + test -f "${DMG_TEMP_NAME}" && rm -f "${DMG_TEMP_NAME}" + + hdiutil convert $TEMPLATE_DMG -format UDRW -o "${DMG_TEMP_NAME}" >/dev/null 2>&1 + hdiutil resize -limits "${DMG_TEMP_NAME}" >/dev/null 2>&1 + hdiutil resize -size 15m "${DMG_TEMP_NAME}" >/dev/null 2>&1 + echo " " + +# =========== +# 8) Mount it +# =========== + + echo " [hdutil] Mounting disk image " + MOUNT_DIR=/Volumes/$VOLUME_NAME + DEV_NAME=$(hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | egrep '^/dev/' | sed 1q | awk '{print $1}') >/dev/null 2>&1 + + echo " Device name: $DEV_NAME" + echo " Mount directory: $MOUNT_DIR" + echo " " + +# ===================================== +# 9) Make sure it's not world writeable +# ===================================== + + mv ${SRC_FOLDER}/${CHAMELEON_PACKAGE_NAME}.pkg ${MOUNT_DIR}/${VOLUME_NAME}.pkg + cp -R ${SRC_FOLDER}/Documentation ${MOUNT_DIR}/ + cp -R ${SRC_FOLDER}/PrefPanel ${MOUNT_DIR}/ + cp -R ${SRC_FOLDER}/i386 ${MOUNT_DIR}/ + cp -R ${SRC_FOLDER}/Themes ${MOUNT_DIR}/ + + echo " [chmod] Fixing permission for \"${MOUNT_DIR}\"" + chmod -Rf go-w "${MOUNT_DIR}" || true + chmod -f a-w "${MOUNT_DIR}"/.DS_Store || true + echo " Done fixing permissions." + echo " " + +# ============================================= +# 10) Make the top window open itself on mount: +# ============================================= + + echo " [openUp] Setting auto open flag" + if [ -x ${OPENUP_TOOL} ]; then + echo " Applying openUp..." + ${OPENUP_TOOL} "${MOUNT_DIR}" >/dev/null 2>&1 + fi + echo " " + +# =========== +# 11) Unmount +# =========== + + echo " [hdutil] Unmounting disk image" + hdiutil detach "${DEV_NAME}" >/dev/null 2>&1 + echo " " + +# ================== +# 12) Compress image +# ================== + + test -f "${DMG_ROOT}/${VOLUME_NAME}.dmg" && rm -f "${DMG_ROOT}/${VOLUME_NAME}.dmg" + echo " [hdutil] Compressing disk image" + hdiutil convert ${DMG_TEMP_NAME} -format UDZO -imagekey zlib-level=9 -o ${DMG_ROOT}/${VOLUME_NAME} >/dev/null 2>&1 + rm -f "${DMG_TEMP_NAME}" + echo " " + +# ========================= +# 13) Adding EULA resources +# ========================= + +if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then + echo " [ResMerger] Adding EULA resources" + hdiutil unflatten ${DMG_ROOT}/${VOLUME_NAME}.dmg >/dev/null 2>&1 + ResMerger -a ${EULA_RSRC} -o ${DMG_ROOT}/${VOLUME_NAME}.dmg + hdiutil flatten ${DMG_ROOT}/${VOLUME_NAME}.dmg >/dev/null 2>&1 +fi + +# ======================= +# 14) Adding Icon to .dmg +# ======================= + + ditto -xk ${pkgroot}/Icons/dmg.zip "${pkgroot}/Icons" + DeRez -only icns ${pkgroot}/Icons/Icons/dmg.icns > tempicns.rsrc + Rez -append tempicns.rsrc -o ${DMG_ROOT}/${VOLUME_NAME}.dmg + SetFile -a C ${DMG_ROOT}/${VOLUME_NAME}.dmg + rm -f tempicns.rsrc + rm -rf "${pkgroot}/Icons/Icons" + rm -R ${SRC_FOLDER} + +# === +# END +# === + + echo " ====================" + echo " Finish $VOLUME_NAME.dmg" + echo " ====================" + echo "" +#----- + +exit 0 diff --git a/package/.svn/text-base/buildpkg.sh.svn-base b/package/.svn/text-base/buildpkg.sh.svn-base new file mode 100644 index 0000000..46221e2 --- /dev/null +++ b/package/.svn/text-base/buildpkg.sh.svn-base @@ -0,0 +1,1094 @@ +#!/bin/bash + +# $0 SRCROOT directory +# $1 SYMROOT directory +# $2 directory where pkgs will be created + +# Directory paths +declare -r PKGROOT="${0%/*}" +declare -r SRCROOT="$1" +declare -r SYMROOT="$2" +declare -r PKG_BUILD_DIR="$3" +declare -r SCPT_TPL_DIR="${PKGROOT}/Scripts.templates" + +if [[ $# -lt 3 ]];then + echo "Too few arguments. Aborting..." >&2 && exit 1 +fi + +if [[ ! -d "$SYMROOT" ]];then + echo "Directory ${SYMROOT} doesn't exit. Aborting..." >&2 && exit 1 +fi + +# Prevent the script from doing bad things +set -u # Abort with unset variables +#set -e # Abort with any error can be suppressed locally using EITHER cmd||true OR set -e;cmd;set +e + +# ====== CONFIGURATION ====== +CONFIG_MODULES="" +CONFIG_KLIBC_MODULE="" +CONFIG_UCLIBCXX_MODULE="" +CONFIG_SATA_MODULE="" +CONFIG_ACPICODEC_MODULE="" +CONFIG_RESOLUTION_MODULE="" +CONFIG_KEYLAYOUT_MODULE="" +source "${SRCROOT}/auto.conf" + +# ====== COLORS ====== +declare -r COL_BLACK="\x1b[30;01m" +declare -r COL_RED="\x1b[31;01m" +declare -r COL_GREEN="\x1b[32;01m" +declare -r COL_YELLOW="\x1b[33;01m" +declare -r COL_MAGENTA="\x1b[35;01m" +declare -r COL_CYAN="\x1b[36;01m" +declare -r COL_WHITE="\x1b[37;01m" +declare -r COL_BLUE="\x1b[34;01m" +declare -r COL_RESET="\x1b[39;49;00m" + +# ====== REVISION/VERSION ====== +declare -r CHAMELEON_VERSION=$( cat version ) + +# stage +CHAMELEON_STAGE=${CHAMELEON_VERSION##*-} +CHAMELEON_STAGE=${CHAMELEON_STAGE/RC/Release Candidate } +CHAMELEON_STAGE=${CHAMELEON_STAGE/FINAL/2.1 Final} +declare -r CHAMELEON_STAGE + +declare -r CHAMELEON_REVISION=$( grep I386BOOT_CHAMELEONREVISION vers.h | awk '{ print $3 }' | tr -d '\"' ) +declare -r CHAMELEON_BUILDDATE=$( grep I386BOOT_BUILDDATE vers.h | awk '{ print $3,$4 }' | tr -d '\"' ) +declare -r CHAMELEON_TIMESTAMP=$( date -j -f "%Y-%m-%d %H:%M:%S" "${CHAMELEON_BUILDDATE}" "+%s" ) + +# ====== CREDITS ====== +declare -r CHAMELEON_DEVELOP=$(awk "NR==6{print;exit}" ${PKGROOT}/../CREDITS) +declare -r CHAMELEON_CREDITS=$(awk "NR==10{print;exit}" ${PKGROOT}/../CREDITS) +declare -r CHAMELEON_PKGDEV=$(awk "NR==14{print;exit}" ${PKGROOT}/../CREDITS) +declare -r CHAMELEON_CPRYEAR=$(awk "NR==18{print;exit}" ${PKGROOT}/../CREDITS) +if [[ $(whoami | awk '{print $1}' | cut -d ":" -f3) == "admin" ]];then + declare -r CHAMELEON_WHOBUILD="VoodooLabs BuildBot" +else + declare -r CHAMELEON_WHOBUILD=$(whoami | awk '{print $1}' | cut -d ":" -f3) +fi + +# ====== GLOBAL VARIABLES ====== +declare -r LOG_FILENAME="Chameleon_Installer_Log.txt" + +declare -a chameleonOptionType +declare -a chameleonOptionKey +declare -a chameleonOptionValues + +declare -a pkgrefs +declare -a choice_key +declare -a choice_options +declare -a choice_pkgrefs +declare -a choice_parent_group_index +declare -a choice_group_items +declare -a choice_group_exclusive + +# Init Main Group +choice_key[0]="" +choice_options[0]="" +choices_pkgrefs[0]="" +choice_group_items[0]="" +choice_group_exclusive[0]="" + +# Package name +declare -r packagename="Chameleon" + +# Package identifiers +declare -r chameleon_package_identity="org.chameleon" +declare -r modules_packages_identity="${chameleon_package_identity}.modules" + +# ====== FUNCTIONS ====== +trim () { + local result="${1#"${1%%[![:space:]]*}"}" # remove leading whitespace characters + echo "${result%"${result##*[![:space:]]}"}" # remove trailing whitespace characters +} + +function makeSubstitutions () { + # Substition is like: Key=Value + # + # Optional arguments: + # --subst= : add a new substitution + # + # Last argument(s) is/are file(s) where substitutions must be made + + local ownSubst="" + + function addSubst () { + local mySubst="$1" + case "$mySubst" in + *=*) keySubst=${mySubst%%=*} + valSubst=${mySubst#*=} + ownSubst=$(printf "%s\n%s" "$ownSubst" "s&@$keySubst@&$valSubst&g;t t") + ;; + *) echo "Invalid substitution $mySubst" >&2 + exit 1 + ;; + esac + } + + # Check the arguments. + while [[ $# -gt 0 ]];do + local option="$1" + case "$option" in + --subst=*) shift; addSubst "${option#*=}" ;; + -*) + echo "Unrecognized makeSubstitutions option '$option'" >&2 + exit 1 + ;; + *) break ;; + esac + done + + if [[ $# -lt 1 ]];then + echo "makeSubstitutions invalid number of arguments: at least one file needed" >&2 + exit 1 + fi + + local chameleonSubsts=" +s&%CHAMELEONVERSION%&${CHAMELEON_VERSION%%-*}&g +s&%CHAMELEONREVISION%&${CHAMELEON_REVISION}&g +s&%CHAMELEONSTAGE%&${CHAMELEON_STAGE}&g +s&%DEVELOP%&${CHAMELEON_DEVELOP}&g +s&%CREDITS%&${CHAMELEON_CREDITS}&g +s&%PKGDEV%&${CHAMELEON_PKGDEV}&g +s&%CPRYEAR%&${CHAMELEON_CPRYEAR}&g +s&%WHOBUILD%&${CHAMELEON_WHOBUILD}&g +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@LOG_FILENAME@&${LOG_FILENAME}&g;t t" + + local allSubst=" +$chameleonSubsts +$ownSubst" + + for file in "$@";do + cp -pf "$file" "${file}.in" + sed "$allSubst" "${file}.in" > "${file}" + rm -f "${file}.in" + done +} + +addTemplateScripts () { + # Arguments: + # --pkg-rootdir= : path of the pkg root dir + # + # Optional arguments: + # --subst= : add a new substitution + # + # Substition is like: Key=Value + # + # $n : Name of template(s) (templates are in package/Scripts.templates + + local pkgRootDir="" + declare -a allSubst + + # Check the arguments. + while [[ $# -gt 0 ]];do + local option="$1" + case "$option" in + --pkg-rootdir=*) shift; pkgRootDir="${option#*=}" ;; + --subst=*) shift; allSubst[${#allSubst[*]}]="${option}" ;; + -*) + echo "Unrecognized addTemplateScripts option '$option'" >&2 + exit 1 + ;; + *) break ;; + esac + done + if [[ $# -lt 1 ]];then + echo "addTemplateScripts invalid number of arguments: you must specify a template name" >&2 + exit 1 + fi + [[ -z "$pkgRootDir" ]] && { echo "Error addTemplateScripts: --pkg-rootdir option is needed" >&2 ; exit 1; } + [[ ! -d "$pkgRootDir" ]] && { echo "Error addTemplateScripts: directory '$pkgRootDir' doesn't exists" >&2 ; exit 1; } + + for templateName in "$@";do + local templateRootDir="${SCPT_TPL_DIR}/${templateName}" + [[ ! -d "$templateRootDir" ]] && { + echo "Error addTemplateScripts: template '$templateName' doesn't exists" >&2; exit 1; } + + # Copy files to destination + rsync -pr --exclude=.svn --exclude="*~" "$templateRootDir/" "$pkgRootDir/Scripts/" + done + + files=$( find "$pkgRootDir/Scripts/" -type f ) + if [[ ${#allSubst[*]} -gt 0 ]];then + makeSubstitutions "${allSubst[@]}" $files + else + makeSubstitutions $files + fi +} + +getPackageRefId () { + echo ${1//_/.}.${2//_/.} | tr [:upper:] [:lower:] +} + +# Return index of a choice +getChoiceIndex () { + # $1 Choice Id + local found=0 + for (( idx=0 ; idx < ${#choice_key[*]}; idx++ ));do + if [[ "${1}" == "${choice_key[$idx]}" ]];then + found=1 + break + fi + done + echo "$idx" + return $found +} + +# Add a new choice +addChoice () { + # Optional arguments: + # --group= : Group Choice Id + # --start-selected= : Specifies whether this choice is initially selected or unselected + # --start-enabled= : Specifies the initial enabled state of this choice + # --start-visible= : Specifies whether this choice is initially visible + # --pkg-refs= : List of package reference(s) id (separate by spaces) + # + # $1 Choice Id + + local option + local groupChoice="" + local choiceOptions="" + local pkgrefs="" + + # Check the arguments. + for option in "${@}";do + case "$option" in + --group=*) + shift; groupChoice=${option#*=} ;; + --start-selected=*) + shift; choiceOptions="$choiceOptions start_selected=\"${option#*=}\"" ;; + --start-enabled=*) + shift; choiceOptions="$choiceOptions start_enabled=\"${option#*=}\"" ;; + --start-visible=*) + shift; choiceOptions="$choiceOptions start_visible=\"${option#*=}\"" ;; + --pkg-refs=*) + shift; pkgrefs=${option#*=} ;; + -*) + echo "Unrecognized addChoice option '$option'" >&2 + exit 1 + ;; + *) break ;; + esac + done + + if [[ $# -ne 1 ]];then + echo "addChoice invalid number of arguments: ${@}" >&2 + exit 1 + fi + + local choiceId="${1}" + + # Add choice in the group + idx_group=$(getChoiceIndex "$groupChoice") + found_group=$? + if [[ $found_group -ne 1 ]];then + # No group exist + echo "Error can't add choice '$choiceId' to group '$groupChoice': group choice '$groupChoice' doesn't exists." >&2 + exit 1 + else + set +u; oldItems=${choice_group_items[$idx_group]}; set -u + choice_group_items[$idx_group]="$oldItems $choiceId" + fi + + # Check that the choice doesn't already exists + idx=$(getChoiceIndex "$choiceId") + found=$? + if [[ $found -ne 0 ]];then + # Choice already exists + echo "Error can't add choice '$choiceId': a choice with same name already exists." >&2 + exit 1 + fi + + # Record new node + choice_key[$idx]="$choiceId" + choice_options[$idx]=$(trim "${choiceOptions}") # Removing leading and trailing whitespace(s) + choice_parent_group_index[$idx]=$idx_group + choice_pkgrefs[$idx]="$pkgrefs" + + return $idx +} + +# Add a group choice +addGroupChoices() { + # Optional arguments: + # --parent= : parent group choice id + # --exclusive_zero_or_one_choice : only zero or one choice can be selected in the group + # --exclusive_one_choice : only one choice can be selected in the group + # + # $1 Choice Id + + local option + local groupChoice="" + local exclusive_function="" + + for option in "${@}";do + case "$option" in + --exclusive_zero_or_one_choice) + shift; exclusive_function="exclusive_zero_or_one_choice" ;; + --exclusive_one_choice) + shift; exclusive_function="exclusive_one_choice" ;; + --parent=*) + shift; groupChoice=${option#*=} ;; + -*) + echo "Unrecognized addGroupChoices option '$option'" >&2 + exit 1 + ;; + *) break ;; + esac + done + + if [[ $# -ne 1 ]];then + echo "addGroupChoices invalid number of arguments: ${@}" >&2 + exit 1 + fi + + addChoice --group="$groupChoice" "${1}" + local idx=$? # index of the new created choice + + choice_group_exclusive[$idx]="$exclusive_function" +} + +exclusive_one_choice () { + # $1 Current choice (ie: test1) + # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices + local myChoice="${1}" + local result=""; + local separator=' || '; + for choice in ${@:2};do + if [[ "$choice" != "$myChoice" ]];then + result="${result}choices['$choice'].selected${separator}"; + fi + done + if [[ -n "$result" ]];then + echo "!(${result%$separator})" + fi +} + +exclusive_zero_or_one_choice () { + # $1 Current choice (ie: test1) + # $2..$n Others choice(s) (ie: "test2" "test3"). Current can or can't be in the others choices + local myChoice="${1}" + local result; + echo "(my.choice.selected && $(exclusive_one_choice ${@}))" +} + +recordChameleonOption () { + local type="$1" + local key="$2" + local value="$3" + + # Search for an existing key + local found=0 + for (( idx=0 ; idx < ${#chameleonOptionKey[@]}; idx++ ));do + if [[ "$key" == "${chameleonOptionKey[$idx]}" ]];then + found=1 + break + fi + done + + # idx contain the index of a new key or an existing one + if [[ $found -eq 0 ]]; then + # Create a new one + chameleonOptionKey[$idx]="$key" + chameleonOptionType[$idx]="$type" + chameleonOptionValues[$idx]="" + fi + + case "$type" in + bool) ;; + text|list) chameleonOptionValues[$idx]="${chameleonOptionValues[$idx]} $value" ;; + *) echo "Error unknown type '$type' for '$key'" >&2 + exit 1 + ;; + esac +} + +generate_options_yaml_file () { + local yamlFile="$1" + echo "---" > $yamlFile + for (( idx=0; idx < ${#chameleonOptionKey[@]}; idx++ ));do + printf "%s:\n type: %s\n" "${chameleonOptionKey[$idx]}" "${chameleonOptionType[$idx]}" >> $yamlFile + case ${chameleonOptionType[$idx]} in + text|list) + printf " values:\n" >> $yamlFile + for value in ${chameleonOptionValues[$idx]};do + printf " - %s\n" "$value" >> $yamlFile + done + ;; + esac + done +} + +main () +{ + +# clean up the destination path + + rm -R -f "${PKG_BUILD_DIR}" + echo "" + echo -e $COL_CYAN" ----------------------------------"$COL_RESET + echo -e $COL_CYAN" Building $packagename Install Package"$COL_RESET + echo -e $COL_CYAN" ----------------------------------"$COL_RESET + echo "" + +# Add pre install choice + echo "================= Preinstall =================" + packagesidentity="${chameleon_package_identity}" + choiceId="Pre" + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + addChoice --start-visible="false" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}" + + # Package will be built at the end +# End pre install choice + +# build core package + echo "================= Core =================" + packagesidentity="${chameleon_package_identity}" + choiceId="Core" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot0md ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1f32 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1h ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1he ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/boot1hp ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/cdboot ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/chain0 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/standalone/i386 + ditto --noextattr --noqtn ${SYMROOT}/i386/fdisk440 ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + ditto --noextattr --noqtn ${SYMROOT}/i386/bdmesg ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + addChoice --start-visible="false" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}" +# End build core package + +# build Chameleon package + echo "================= Chameleon =================" + addGroupChoices --exclusive_one_choice "Chameleon" + + # build standard package + choiceId="Standard" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" InstallerLog + cp -f ${PKGROOT}/Scripts/Main/${choiceId}postinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall + cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + addChoice --group="Chameleon" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}" + # End build standard package + + # build efi package +if [[ 1 -eq 0 ]];then + # Only standard installation is currently supported + # We need to update the script to be able to install + # Chameleon on EFI partition + choiceId="EFI" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" InstallerLog + cp -f ${PKGROOT}/Scripts/Main/ESPpostinstall ${PKG_BUILD_DIR}/${choiceId}/Scripts/postinstall + cp -f ${PKGROOT}/Scripts/Sub/* ${PKG_BUILD_DIR}/${choiceId}/Scripts + ditto --arch i386 `which SetFile` ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources/SetFile + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + addChoice --group="Chameleon" --start-visible="systemHasGPT()" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build efi package +fi + # build no bootloader choice package + choiceId="noboot" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + addChoice --group="Chameleon" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build no bootloader choice package + +# End build Chameleon package + +if [[ "${CONFIG_MODULES}" == 'y' ]];then +# build Modules package + echo "================= Modules =================" + ############################### + # Supported Modules # + ############################### + # klibc.dylib # + # Resolution.dylib # + # uClibcxx.dylib # + # Sata.dylib # + # ACPICodec.dylib # + # Keylayout.dylib # + ############################### + if [ "$(ls -A "${SYMROOT}/i386/modules")" ]; then + { + addGroupChoices "Module" + +# - + if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then + { + # Start build Resolution package module + choiceId="AutoReso" + moduleFile="Resolution.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build Resolution package module + } + fi + +# - + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then + { + # Start build klibc package module + choiceId="klibc" + moduleFile="${choiceId}.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" ${PKG_BUILD_DIR}/${choiceId}/Root + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build klibc package module + } + fi + +# - + if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \ + -f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then + { + klibcPackageRefId="" + if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then + klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc") + fi + # Start build uClibc package module + choiceId="uClibc" + moduleFile="uClibcxx.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + # Add the klibc package because the uClibc module is dependent of klibc module + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId $klibcPackageRefId" "${choiceId}" + # End build uClibc package module + } + fi +# - + if [[ "${CONFIG_SATA_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Sata.dylib" ]]; then + { + # Start build Sata package module + choiceId="Sata" + moduleFile="Sata.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build Sata package module + } + fi + +# - + if [[ "${CONFIG_ACPICODEC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/ACPICodec.dylib" ]]; then + { + # Start build ACPICodec package module + choiceId="ACPICodec" + moduleFile="ACPICodec.dylib" + mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root" + ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules" + addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}" + # End build ACPICodec package module + } + fi + +# - # Warning Keylayout module need additional files + if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then + { + # Start build Keylayout package module + choiceId="Keylayout" + moduleFile="${choiceId}.dylib" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps} + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src" + if [ -d "$layout_src_dir" ];then + # Create a tar.gz from layout sources + (cd "$layout_src_dir"; \ + tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt) + fi + # Adding module + ditto --noextattr --noqtn ${SYMROOT}/i386/modules/$moduleFile ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules + # Adding Keymaps + ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps + # Adding tools + ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin + # Adding scripts + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="moduleName=$choiceId" \ + --subst="moduleFile=$moduleFile" \ + InstallModule + + packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + + # Don't add a choice for Keylayout module + # addChoice "${choiceId}" "Module" --start-selected="false" "$packageRefId" + # End build Keylayout package module + } + fi + + } + else + { + echo " -= no modules to include =-" + } + fi +# End build Modules packages +fi + +# build Options packages + + addGroupChoices "Options" + + # ------------------------------------------------------ + # parse OptionalSettings folder to find files of boot options. + # ------------------------------------------------------ + OptionalSettingsFolder="${PKGROOT}/OptionalSettings" + + while IFS= read -r -d '' OptionsFile; do + + # Take filename and strip .txt from end and path from front + builtOptionsList=${OptionsFile%.txt} + builtOptionsList=${builtOptionsList##*/} + packagesidentity="${chameleon_package_identity}.options.$builtOptionsList" + + echo "================= $builtOptionsList =================" + + # ------------------------------------------------------ + # Read boot option file into an array. + # ------------------------------------------------------ + availableOptions=() # array to hold the list of boot options, per 'section'. + exclusiveFlag="" # used to indicate list has exclusive options + while read textLine; do + # ignore lines in the file beginning with a # + [[ $textLine = \#* ]] && continue + local optionName="" key="" value="" + case "$textLine" in + Exclusive=[Tt][Rr][Uu][Ee]) exclusiveFlag="--exclusive_zero_or_one_choice" ;; + Exclusive=*) continue ;; + *@*:*=*) + availableOptions[${#availableOptions[*]}]="$textLine" ;; + *) echo "Error: invalid line '$textLine' in file '$OptionsFile'" >&2 + exit 1 + ;; + esac + done < "$OptionsFile" + + addGroupChoices --parent="Options" $exclusiveFlag "${builtOptionsList}" + + # ------------------------------------------------------ + # Loop through options in array and process each in turn + # ------------------------------------------------------ + for textLine in "${availableOptions[@]}"; do + # split line - taking all before ':' as option name + # and all after ':' as key/value + type=$( echo "${textLine%%@*}" | tr '[:upper:]' '[:lower:]' ) + tmp=${textLine#*@} + optionName=${tmp%%:*} + keyValue=${tmp##*:} + key=${keyValue%%=*} + value=${keyValue#*=} + + # create folders required for each boot option + mkdir -p "${PKG_BUILD_DIR}/$optionName/Root/" + + case "$type" in + bool) startSelected="check_chameleon_bool_option('$key','$value')" ;; + text) startSelected="check_chameleon_text_option('$key','$value')" ;; + list) startSelected="check_chameleon_list_option('$key','$value')" ;; + *) echo "Error: invalid type '$type' in line '$textLine' in '$OptionsFile'" >&2 + exit 1 + ;; + esac + recordChameleonOption "$type" "$key" "$value" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/$optionName" \ + --subst="optionType=$type" \ + --subst="optionKey=$key" \ + --subst="optionValue=$value" \ + AddOption + packageRefId=$(getPackageRefId "${packagesidentity}" "${optionName}") + buildpackage "$packageRefId" "${optionName}" "${PKG_BUILD_DIR}/${optionName}" "/" + addChoice --group="${builtOptionsList}" \ + --start-selected="$startSelected" \ + --pkg-refs="$packageRefId" "${optionName}" + done + + done < <( find "${OptionalSettingsFolder}" -depth 1 -type f -name '*.txt' -print0 ) + +# End build options packages + +if [[ -n "${CONFIG_KEYLAYOUT_MODULE}" ]];then +# build Keymaps options packages + echo "================= Keymaps Options =================" + addGroupChoices --exclusive_zero_or_one_choice "Keymaps" + packagesidentity="${chameleon_package_identity}.options.keymaps" + keylayoutPackageRefId="" + if [[ "${CONFIG_MODULES}" == 'y' && "${CONFIG_KEYLAYOUT_MODULE}" = 'm' ]];then + keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout") + fi + + chameleon_keylayout_key="KeyLayout" + # ------------------------------------------------------ + # Available Keylayout boot options are discovered by + # reading contents of /Keymaps folder after compilation + # ------------------------------------------------------ + availableOptions=($( find "${SRCROOT}/Keymaps" -type f -depth 1 -name '*.lyt' | sed 's|.*/||;s|\.lyt||' )) + # Adjust array contents to match expected format + # for boot options which is: name:key=value + for (( i = 0 ; i < ${#availableOptions[@]} ; i++ )); do + # Start build of a keymap package module + choiceId="${availableOptions[i]}" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + + recordChameleonOption "text" "$chameleon_keylayout_key" "$choiceId" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="optionType=text" \ + --subst="optionKey=$chameleon_keylayout_key" \ + --subst="optionValue=$choiceId" \ + AddOption + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + # Add the Keylayout package because the Keylayout module is needed + addChoice --group="Keymaps" \ + --start-selected="check_chameleon_text_option('${chameleon_keylayout_key}','${choiceId}')" \ + --pkg-refs="$packageRefId $keylayoutPackageRefId" "${choiceId}" + done + +# End build Keymaps options packages +fi + +# build theme packages + echo "================= Themes =================" + addGroupChoices "Themes" + + # Using themes section from Azi's/package branch. + packagesidentity="${chameleon_package_identity}.themes" + artwork="${SRCROOT}/artwork/themes" + themes=($( find "${artwork}" -type d -depth 1 -not -name '.svn' )) + for (( i = 0 ; i < ${#themes[@]} ; i++ )); do + themeName=$( echo ${themes[$i]##*/} | awk 'BEGIN{OFS=FS=""}{$1=toupper($1);print}' ) + themeDir="$themeName" + mkdir -p "${PKG_BUILD_DIR}/${themeName}/Root/" + rsync -r --exclude=.svn --exclude="*~" "${themes[$i]}/" "${PKG_BUILD_DIR}/${themeName}/Root/${themeName}" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${themeName}" \ + --subst="themeName=$themeName" \ + --subst="themeDir=$themeDir" \ + InstallTheme + + packageRefId=$(getPackageRefId "${packagesidentity}" "${themeName}") + buildpackage "$packageRefId" "${themeName}" "${PKG_BUILD_DIR}/${themeName}" "/Extra/Themes" + addChoice --group="Themes" --start-selected="false" --pkg-refs="$packageRefId" "${themeName}" + done +# End build theme packages# End build Extras package + +# build pre install package + echo "================= Pre =================" + packagesidentity="${chameleon_package_identity}" + choiceId="Pre" + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Scripts/Resources + local yamlFile="Resources/chameleon_options.yaml" + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \ + --subst="YAML_FILE=${yamlFile}" ${choiceId} + generate_options_yaml_file "${PKG_BUILD_DIR}/${choiceId}/Scripts/$yamlFile" + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" +# End build pre install package + +# build post install package + echo "================= Post =================" + packagesidentity="${chameleon_package_identity}" + choiceId="Post" + mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root + addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" ${choiceId} + cp -f ${PKGROOT}/Scripts/Sub/UnMountEFIvolumes.sh ${PKG_BUILD_DIR}/${choiceId}/Scripts + + packageRefId=$(getPackageRefId "${packagesidentity}" "${choiceId}") + buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/" + addChoice --start-visible="false" --start-selected="true" --pkg-refs="$packageRefId" "${choiceId}" +# End build post install package + +} + +buildpackage () +{ + # $1 Package Reference Id (ie: org.chameleon.themes.default) + # $2 Package Name (ie: Default) + # $3 Path to package to build containing Root and/or Scripts + # $4 Target install location + # $5 Size (optional) + if [[ -d "${3}/Root" ]]; then + local packageRefId="$1" + local packageName="$2" + local packagePath="$3" + local targetPath="$4" + set +u # packageSize is optional + local packageSize="$5" + set -u + + echo -e "\t[BUILD] ${packageName}" + + find "${packagePath}" -name '.DS_Store' -delete + local filecount=$( find "${packagePath}/Root" | wc -l ) + if [ "${packageSize}" ]; then + local installedsize="${packageSize}" + else + local installedsize=$( du -hkc "${packagePath}/Root" | tail -n1 | awk {'print $1'} ) + fi + local header="\n\n" + header+="\t\n" + rm -R -f "${packagePath}/Temp" + + [ -d "${packagePath}/Temp" ] || mkdir -m 777 "${packagePath}/Temp" + [ -d "${packagePath}/Root" ] && mkbom "${packagePath}/Root" "${packagePath}/Temp/Bom" + + if [ -d "${packagePath}/Scripts" ]; then + header+="\t\n" + for script in $( find "${packagePath}/Scripts" -type f \( -name 'pre*' -or -name 'post*' \) ); do + header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n" + done + header+="\t\n" + # Create the Script archive file (cpio format) + (cd "${packagePath}/Scripts" && find . -print | \ + cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \ + grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages + fi + + header+="" + echo -e "${header}" > "${packagePath}/Temp/PackageInfo" + + # Create the Payload file (cpio format) + (cd "${packagePath}/Root" && find . -print | \ + cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Payload") 2>&1 | \ + grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages + + # Create the package + (cd "${packagePath}/Temp" && xar -c -f "${packagePath}/../${packageName}.pkg" --compression none .) + + # Add the package to the list of build packages + pkgrefs[${#pkgrefs[*]}]="\t#${packageName}.pkg" + + rm -rf "${packagePath}" + fi +} + +generateOutlineChoices() { + # $1 Main Choice + # $2 indent level + local idx=$(getChoiceIndex "$1") + local indentLevel="$2" + local indentString="" + for ((level=1; level <= $indentLevel ; level++)); do + indentString="\t$indentString" + done + set +u; subChoices="${choice_group_items[$idx]}"; set -u + if [[ -n "${subChoices}" ]]; then + # Sub choices exists + echo -e "$indentString" + for subChoice in $subChoices;do + generateOutlineChoices $subChoice $(($indentLevel+1)) + done + echo -e "$indentString" + else + echo -e "$indentString" + fi +} + +generateChoices() { + for (( idx=1; idx < ${#choice_key[*]} ; idx++)); do + local choiceId=${choice_key[$idx]} + local choiceOptions=${choice_options[$idx]} + local choiceParentGroupIndex=${choice_parent_group_index[$idx]} + set +u; local group_exclusive=${choice_group_exclusive[$choiceParentGroupIndex]}; set -u + + # Create the node and standard attributes + local choiceNode="\t&2 + exit 1 + ;; + esac + choiceNode="${choiceNode}\n\t\tselected=\"$selected_option\"" + fi + + choiceNode="${choiceNode}>" + + # Add the package references + for pkgRefId in ${choice_pkgrefs[$idx]};do + choiceNode="${choiceNode}\n\t\t" + done + + # Close the node + choiceNode="${choiceNode}\n\t
\n" + + echo -e "$choiceNode" + done +} + +makedistribution () +{ + declare -r distributionDestDir="${SYMROOT}" + declare -r distributionFilename="${packagename// /}-${CHAMELEON_VERSION}-r${CHAMELEON_REVISION}.pkg" + declare -r distributionFilePath="${distributionDestDir}/${distributionFilename}" + + rm -f "${distributionDestDir}/${packagename// /}"*.pkg + + mkdir -p "${PKG_BUILD_DIR}/${packagename}" + + find "${PKG_BUILD_DIR}" -type f -name '*.pkg' -depth 1 | while read component + do + pkg="${component##*/}" # ie: EFI.pkg + pkgdir="${PKG_BUILD_DIR}/${packagename}/${pkg}" + # expand individual packages + pkgutil --expand "${PKG_BUILD_DIR}/${pkg}" "$pkgdir" + rm -f "${PKG_BUILD_DIR}/${pkg}" + done + +# Create the Distribution file + ditto --noextattr --noqtn "${PKGROOT}/Distribution" "${PKG_BUILD_DIR}/${packagename}/Distribution" + + local start_indent_level=2 + echo -e "\n\t" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" + for main_choice in ${choice_group_items[0]};do + generateOutlineChoices $main_choice $start_indent_level >> "${PKG_BUILD_DIR}/${packagename}/Distribution" + done + echo -e "\t\n" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" + + generateChoices >> "${PKG_BUILD_DIR}/${packagename}/Distribution" + + for (( i=0; i < ${#pkgrefs[*]} ; i++)); do + echo -e "${pkgrefs[$i]}" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" + done + + echo -e "\n" >> "${PKG_BUILD_DIR}/${packagename}/Distribution" + +# Create the Resources directory + ditto --noextattr --noqtn "${PKGROOT}/Resources/distribution" "${PKG_BUILD_DIR}/${packagename}/Resources" + +# Make the translation + echo "" + echo "========= Translating Resources ========" + (cd "${PKGROOT}" && PERLLIB=${PKGROOT}/bin/po4a/lib \ + bin/po4a/po4a \ + --package-name 'Chameleon' \ + --package-version "${CHAMELEON_VERSION}-r${CHAMELEON_REVISION}" \ + --msgmerge-opt '--lang=$lang' \ + --variable PODIR="po" \ + --variable TEMPLATES_DIR="Resources/templates" \ + --variable OUTPUT_DIR="${PKG_BUILD_DIR}/${packagename}/Resources" \ + ${PKGROOT}/po4a-chameleon.cfg) + + # Copy common files in english localisation directory + ditto --noextattr --noqtn "${PKGROOT}/Resources/common" "${PKG_BUILD_DIR}/${packagename}/Resources/en.lproj" + + # CleanUp the directory + find "${PKG_BUILD_DIR}/${packagename}" \( -type d -name '.svn' \) -o -name '.DS_Store' -depth -exec rm -rf {} \; + find "${PKG_BUILD_DIR}/${packagename}" -type d -depth -empty -exec rmdir {} \; # Remove empty directories + + # Make substitutions for version, revision, stage, developers, credits, etc.. + makeSubstitutions $( find "${PKG_BUILD_DIR}/${packagename}/Resources" -type f ) + +# Create the final package + pkgutil --flatten "${PKG_BUILD_DIR}/${packagename}" "${distributionFilePath}" + +# Here is the place to assign an icon to the pkg + ditto -xk "${PKGROOT}/Icons/pkg.zip" "${PKG_BUILD_DIR}/Icons/" + DeRez -only icns "${PKG_BUILD_DIR}/Icons/Icons/pkg.icns" > "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" + Rez -append "${PKG_BUILD_DIR}/Icons/tempicns.rsrc" -o "${distributionFilePath}" + SetFile -a C "${distributionFilePath}" + rm -rf "${PKG_BUILD_DIR}/Icons" + +# End + + md5=$( md5 "${distributionFilePath}" | awk {'print $4'} ) + echo "MD5 (${distributionFilePath}) = ${md5}" > "${distributionFilePath}.md5" + echo "" + + echo -e $COL_GREEN" --------------------------"$COL_RESET + echo -e $COL_GREEN" Building process complete!"$COL_RESET + echo -e $COL_GREEN" --------------------------"$COL_RESET + echo "" + echo -e $COL_GREEN" Build info." + echo -e $COL_GREEN" ===========" + echo -e $COL_BLUE" Package name: "$COL_RESET"${distributionFilename}" + echo -e $COL_BLUE" MD5: "$COL_RESET"$md5" + echo -e $COL_BLUE" Version: "$COL_RESET"$CHAMELEON_VERSION" + echo -e $COL_BLUE" Stage: "$COL_RESET"$CHAMELEON_STAGE" + echo -e $COL_BLUE" Date/Time: "$COL_RESET"$CHAMELEON_BUILDDATE" + echo -e $COL_BLUE" Built by: "$COL_RESET"$CHAMELEON_WHOBUILD" + echo -e $COL_BLUE" Copyright $CHAMELEON_CPRYEAR ""$COL_RESET" + echo "" + +} + +# build packages +main + +# build meta package +makedistribution diff --git a/package/.svn/text-base/po4a-chameleon.cfg.svn-base b/package/.svn/text-base/po4a-chameleon.cfg.svn-base new file mode 100644 index 0000000..4f65ded --- /dev/null +++ b/package/.svn/text-base/po4a-chameleon.cfg.svn-base @@ -0,0 +1,11 @@ +[po_directory] $(PODIR) + +# Don't translate + + +

‎‎الشامليون عباره عن مزيج من مختلف مكونات محمل الاقلاع٫
بنى عل ىالتطبيق Fake EFI لصاحبه David Elliott واضيف الى مشروع Apple's boot-132 ٫
‎تم تطوير الشامليون ليضم المميزات التالية

+


+

‎المميزات الجديده فى الشامليون ٢٫٠ +


+

- واجهه قابله للتخصيص الكامل لاضافه بعض الالوان لمحمل الاقلاع Darwin ٫

+

- اقلاع الاقراص الاصلية عن طريق تحميل صوره ل ramdisk مباشرة دون الحاجه لبرامج اضافية

+

- السبات Hibernation ٫ استمتع باستئناف الماكنتوش من الحالة السابقه ٫

+

- ‎امكانيه تعديل القيم المصنعيه ل SMBIOS باستخادم SMBIOS.plist ٫

+

- ‎امكانيه استخدام DSDT.aml ‎المصححة التى تسطيع حل الكثير من العيوب

+

- ‎امكانيه حقن بعض المكونات لكى تعمل عن الطريق device-properties string ٫

+

- ‎تحتوى على هجين من boot0 / boot1h ‎من اجل الاقراص المقسمة بنظامى MBR . GPT ٫

+

- ‎تحديد كود الناقل الامامى اوتوماتيكيا حتى مع اخر المعالجات لشركه AMD ٫

+

- ‎دعم ل Apple Software RAID

+

- دعم تشغيل كروت الشاشة من nvidia , Ati/AMD .

+

- دعم Module

+

- الكشف عن الذاكرة مقتبس من memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation لادارة الطاقة كما يجب ان يكون .

+

- Message logging.

+


+

هذا البرنامج صدر تحت رخضة الاصدار الثانى الهام ل Gnu .

+

http://forge.voodooprojects.org/p/chameleon

+


+

‎ لمزيد من المعلومات قم بزيارة موقعناhttp://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ar.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/ar.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ar.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ar.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/ar.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..61bcf7c Binary files /dev/null and b/package/Resources.old/ar.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..fb6f3b5 --- /dev/null +++ b/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ar.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ar.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..9fd59e0 --- /dev/null +++ b/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ar.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:04.000000Z +f877ac5431a49743497798d366289367 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1336 + diff --git a/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..bfb6d26 --- /dev/null +++ b/package/Resources.old/ar.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,63 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset178 GeezaPro;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +\f1 \'c7\'e1\'e3\'ce\'d8\'e6\'d8\'c7\'ca \'ca\'e3\'ca +\f0 \uc0\u8235 , +\f1 \uc0\u8236 \'e6 \'e3\'e1\'dd +\f0 \ + +\f1 \'de\'cf +\f0 \cf2 @LOG_FILENAME@\cf3 +\f1 \'ed\'d3\'e3\'ec +\f0 \ + +\f1 \'df\'f1\'ca\'c8 \'e1\'cc\'d0\'d1 \'c7\'e1\'c8\'c7\'d1\'ca\'d4\'e4 \'c7\'e1\'e3\'ce\'ca\'c7\'d1\uc0\u8235 . +\f0 \uc0\u8236 \ +\ +\f1 \cf0 \'e3\'e4 +\f0 +\f1 \'dd\'d6\'e1\'df +\f0 +\f1 \cf4 \'c3\'de\'d1\'c3\'e5 +\f0 \cf0 +\f1 \'e1\'df\'ec +\f0 +\f1 \'ca\'da\'d1\'dd +\f0 +\f1 \'c7\'d0\'c7 +\f0 +\f1 \'df\'c7\'e4 +\f0 +\f1 \'c7\'e1\'ca\'cb\'c8\'ed\'ca +\f0 +\f1 \'ca\'e3 +\f0 +\f1 \'c8\'e4\'cc\'c7\'cd +\f0 \ + +\f1 \'e6\'c7\'cd\'ca\'dd\'d9 +\f0 +\f1 \'c8\'e5 +\f0 +\f1 \'df\'ca\'d3\'cc\'ed\'e1 \'e1\'e3\'c7 \'ca\'e3 \uc0\u8235 . +\f0 \uc0\u8236 \ +\cf5 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ar.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/ar.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..bfb6d26 --- /dev/null +++ b/package/Resources.old/ar.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,63 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset178 GeezaPro;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +\f1 \'c7\'e1\'e3\'ce\'d8\'e6\'d8\'c7\'ca \'ca\'e3\'ca +\f0 \uc0\u8235 , +\f1 \uc0\u8236 \'e6 \'e3\'e1\'dd +\f0 \ + +\f1 \'de\'cf +\f0 \cf2 @LOG_FILENAME@\cf3 +\f1 \'ed\'d3\'e3\'ec +\f0 \ + +\f1 \'df\'f1\'ca\'c8 \'e1\'cc\'d0\'d1 \'c7\'e1\'c8\'c7\'d1\'ca\'d4\'e4 \'c7\'e1\'e3\'ce\'ca\'c7\'d1\uc0\u8235 . +\f0 \uc0\u8236 \ +\ +\f1 \cf0 \'e3\'e4 +\f0 +\f1 \'dd\'d6\'e1\'df +\f0 +\f1 \cf4 \'c3\'de\'d1\'c3\'e5 +\f0 \cf0 +\f1 \'e1\'df\'ec +\f0 +\f1 \'ca\'da\'d1\'dd +\f0 +\f1 \'c7\'d0\'c7 +\f0 +\f1 \'df\'c7\'e4 +\f0 +\f1 \'c7\'e1\'ca\'cb\'c8\'ed\'ca +\f0 +\f1 \'ca\'e3 +\f0 +\f1 \'c8\'e4\'cc\'c7\'cd +\f0 \ + +\f1 \'e6\'c7\'cd\'ca\'dd\'d9 +\f0 +\f1 \'c8\'e5 +\f0 +\f1 \'df\'ca\'d3\'cc\'ed\'e1 \'e1\'e3\'c7 \'ca\'e3 \uc0\u8235 . +\f0 \uc0\u8236 \ +\cf5 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ar.lproj/Description.html b/package/Resources.old/ar.lproj/Description.html new file mode 100644 index 0000000..551d0b8 --- /dev/null +++ b/package/Resources.old/ar.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

‎‎الشامليون عباره عن مزيج من مختلف مكونات محمل الاقلاع٫
بنى عل ىالتطبيق Fake EFI لصاحبه David Elliott واضيف الى مشروع Apple's boot-132 ٫
‎تم تطوير الشامليون ليضم المميزات التالية

+


+

‎المميزات الجديده فى الشامليون ٢٫٠ +


+

- واجهه قابله للتخصيص الكامل لاضافه بعض الالوان لمحمل الاقلاع Darwin ٫

+

- اقلاع الاقراص الاصلية عن طريق تحميل صوره ل ramdisk مباشرة دون الحاجه لبرامج اضافية

+

- السبات Hibernation ٫ استمتع باستئناف الماكنتوش من الحالة السابقه ٫

+

- ‎امكانيه تعديل القيم المصنعيه ل SMBIOS باستخادم SMBIOS.plist ٫

+

- ‎امكانيه استخدام DSDT.aml ‎المصححة التى تسطيع حل الكثير من العيوب

+

- ‎امكانيه حقن بعض المكونات لكى تعمل عن الطريق device-properties string ٫

+

- ‎تحتوى على هجين من boot0 / boot1h ‎من اجل الاقراص المقسمة بنظامى MBR . GPT ٫

+

- ‎تحديد كود الناقل الامامى اوتوماتيكيا حتى مع اخر المعالجات لشركه AMD ٫

+

- ‎دعم ل Apple Software RAID

+

- دعم تشغيل كروت الشاشة من nvidia , Ati/AMD .

+

- دعم Module

+

- الكشف عن الذاكرة مقتبس من memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation لادارة الطاقة كما يجب ان يكون .

+

- Message logging.

+


+

هذا البرنامج صدر تحت رخضة الاصدار الثانى الهام ل Gnu .

+

http://forge.voodooprojects.org/p/chameleon

+


+

‎ لمزيد من المعلومات قم بزيارة موقعناhttp://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ar.lproj/License.rtf b/package/Resources.old/ar.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ar.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ar.lproj/Localizable.strings b/package/Resources.old/ar.lproj/Localizable.strings new file mode 100644 index 0000000..61bcf7c Binary files /dev/null and b/package/Resources.old/ar.lproj/Localizable.strings differ diff --git a/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..d77759a --- /dev/null +++ b/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ar.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ar.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..7811f9b --- /dev/null +++ b/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ar.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:04.000000Z +b1a21eb0a04a8988240ecdfee581f4fb +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1074 + diff --git a/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..ccf7823 --- /dev/null +++ b/package/Resources.old/ar.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,69 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset178 GeezaPro;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10600\viewh10600\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1 \cf2 \'e1\'c7 +\f0 \cf2 +\f1 \cf2 \'ca\'cb\'c8\'ca\'e5 +\f0 \cf2 +\f1 \cf2 \'da\'e1\'ec +\f0 \cf2 +\f1 \cf2 \'c7\'cc\'e5\'d2\'c9 +\f0 \cf2 +\f1 \cf2 \'c7\'e1\'c3\'c8\'e1 +\f0 \cf2 +\f1 \cf2 \'c7\'e1\'c7\'d5\'e1\'ed\'c9 +\f0 \cf2 \cf2 \uc0\u8235 .\cf2 \uc0\u8236 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\fs20 \cf0 : +\f1 \'c7\'e1\'e3\'d8\'e6\'d1\'ed\'e4 +\f0\fs22 \ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\fs20 \cf0 : +\f1 \'d4\'df\'d1\'c7 +\f0 +\f1 \'e1 +\f0 +\fs22 \ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b\fs20 \cf0 : +\f1 \'c7\'e1\'cd\'d2\'e3\'c9 +\f0\fs22 \ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: Mohamed Khairy\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ar.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/ar.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..ccf7823 --- /dev/null +++ b/package/Resources.old/ar.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,69 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset178 GeezaPro;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10600\viewh10600\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1 \cf2 \'e1\'c7 +\f0 \cf2 +\f1 \cf2 \'ca\'cb\'c8\'ca\'e5 +\f0 \cf2 +\f1 \cf2 \'da\'e1\'ec +\f0 \cf2 +\f1 \cf2 \'c7\'cc\'e5\'d2\'c9 +\f0 \cf2 +\f1 \cf2 \'c7\'e1\'c3\'c8\'e1 +\f0 \cf2 +\f1 \cf2 \'c7\'e1\'c7\'d5\'e1\'ed\'c9 +\f0 \cf2 \cf2 \uc0\u8235 .\cf2 \uc0\u8236 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\fs20 \cf0 : +\f1 \'c7\'e1\'e3\'d8\'e6\'d1\'ed\'e4 +\f0\fs22 \ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\fs20 \cf0 : +\f1 \'d4\'df\'d1\'c7 +\f0 +\f1 \'e1 +\f0 +\fs22 \ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b\fs20 \cf0 : +\f1 \'c7\'e1\'cd\'d2\'e3\'c9 +\f0\fs22 \ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: Mohamed Khairy\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/background.tiff b/package/Resources.old/background.tiff new file mode 100644 index 0000000..7e1c34e Binary files /dev/null and b/package/Resources.old/background.tiff differ diff --git a/package/Resources.old/bg.lproj/.svn/all-wcprops b/package/Resources.old/bg.lproj/.svn/all-wcprops new file mode 100644 index 0000000..4018e10 --- /dev/null +++ b/package/Resources.old/bg.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/License.rtf +END diff --git a/package/Resources.old/bg.lproj/.svn/entries b/package/Resources.old/bg.lproj/.svn/entries new file mode 100644 index 0000000..b4b9645 --- /dev/null +++ b/package/Resources.old/bg.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/bg.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:15.000000Z +c3d477066ab1c029bcc856e03ec7b1c3 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3366 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:15.000000Z +ae11731137a8c4d24debc931193d9f6f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33514 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:15.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/bg.lproj/.svn/prop-base/Description.html.svn-base b/package/Resources.old/bg.lproj/.svn/prop-base/Description.html.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Resources.old/bg.lproj/.svn/prop-base/Description.html.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Resources.old/bg.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/bg.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/package/Resources.old/bg.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/bg.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/bg.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..0aae46c --- /dev/null +++ b/package/Resources.old/bg.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon е комбинация от разбични boot loader компоненти.
Базиран е на fake EFI изпълнението на Дейвид Ейлиът добавено към проекта boot-132 на Apple.
Chameleon е разширен със следните ключови функции:

+


+

Нови функции в Chameleon 2.0

+


+

- Напълно управляем графичен интерфейс за добавяне на живи цветове към Darwin Bootloader.

+

- Boot-ва retail DVD-та чрез директно зареждане на ramdisk image без помоща на допълнителни програми.

+

- Хибернация.

+

- SMBIOS заместване, за да бъдат модифицирани оригиналните SMBIOS стойности.

+

- DSDT заместване, за да бъде използвано модифицирано DSDT, което решава множество проблеми.

+

- Вграждане на особеностите на различни хардуерни устройства посредством device-properties стрингове.

+

- Хибридни boot0 / boot1h за MBR и GPT разделени дискове..

+

- Автоматично разпознаване на FSB за новите AMD процесори.

+

- Поддръжка на Apple Software RAID..

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

За повече информация посетете: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/bg.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/bg.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/bg.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/bg.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/bg.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..1b631e1 Binary files /dev/null and b/package/Resources.old/bg.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..6d6e0e7 --- /dev/null +++ b/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..ccd52e9 --- /dev/null +++ b/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/bg.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +0d080022200ced0bb9336201a5f4ce4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +854 + diff --git a/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/bg.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/bg.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/bg.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/bg.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/bg.lproj/Description.html b/package/Resources.old/bg.lproj/Description.html new file mode 100755 index 0000000..0aae46c --- /dev/null +++ b/package/Resources.old/bg.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon е комбинация от разбични boot loader компоненти.
Базиран е на fake EFI изпълнението на Дейвид Ейлиът добавено към проекта boot-132 на Apple.
Chameleon е разширен със следните ключови функции:

+


+

Нови функции в Chameleon 2.0

+


+

- Напълно управляем графичен интерфейс за добавяне на живи цветове към Darwin Bootloader.

+

- Boot-ва retail DVD-та чрез директно зареждане на ramdisk image без помоща на допълнителни програми.

+

- Хибернация.

+

- SMBIOS заместване, за да бъдат модифицирани оригиналните SMBIOS стойности.

+

- DSDT заместване, за да бъде използвано модифицирано DSDT, което решава множество проблеми.

+

- Вграждане на особеностите на различни хардуерни устройства посредством device-properties стрингове.

+

- Хибридни boot0 / boot1h за MBR и GPT разделени дискове..

+

- Автоматично разпознаване на FSB за новите AMD процесори.

+

- Поддръжка на Apple Software RAID..

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

За повече информация посетете: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/bg.lproj/License.rtf b/package/Resources.old/bg.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/bg.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/bg.lproj/Localizable.strings b/package/Resources.old/bg.lproj/Localizable.strings new file mode 100755 index 0000000..1b631e1 Binary files /dev/null and b/package/Resources.old/bg.lproj/Localizable.strings differ diff --git a/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..1a4ff59 --- /dev/null +++ b/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bg.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..4fda63d --- /dev/null +++ b/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/bg.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +d267bdaaee1faf8e17cfe138cbb03e66 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +865 + diff --git a/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..17315db --- /dev/null +++ b/package/Resources.old/bg.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,44 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +\pard\ri0\qc +\cf0 \uc0\u1056 \u1072 \u1079 \u1088 \u1072 \u1073 \u1086 \u1090 \u1077 \u1085 \u1086 \u1090 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\ri0\qc +\cf0 \uc0\u1041 \u1083 \u1072 \u1075 \u1086 \u1076 \u1072 \u1088 \u1085 \u1086 \u1089 \u1090 \u1080 \u1085 \u1072 :\ +\pard\qc + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/bg.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/bg.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..17315db --- /dev/null +++ b/package/Resources.old/bg.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,44 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +\pard\ri0\qc +\cf0 \uc0\u1056 \u1072 \u1079 \u1088 \u1072 \u1073 \u1086 \u1090 \u1077 \u1085 \u1086 \u1090 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\ri0\qc +\cf0 \uc0\u1041 \u1083 \u1072 \u1075 \u1086 \u1076 \u1072 \u1088 \u1085 \u1086 \u1089 \u1090 \u1080 \u1085 \u1072 :\ +\pard\qc + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/bs.lproj/.svn/all-wcprops b/package/Resources.old/bs.lproj/.svn/all-wcprops new file mode 100644 index 0000000..c147c9d --- /dev/null +++ b/package/Resources.old/bs.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/License.rtf +END diff --git a/package/Resources.old/bs.lproj/.svn/entries b/package/Resources.old/bs.lproj/.svn/entries new file mode 100644 index 0000000..db6ae70 --- /dev/null +++ b/package/Resources.old/bs.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/bs.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:05.000000Z +4c7fc261f2400be45cb76b655ff3ff0d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2826 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:05.000000Z +5da8a05ab42770f1330219e279a61e13 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31950 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:05.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/bs.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/bs.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/bs.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/bs.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/bs.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..0bd171b --- /dev/null +++ b/package/Resources.old/bs.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon je kombinacija različitih komponenata bootloadera. On se zasniva na David Elliottovoj lažnoj EFI implementaciji dodanoj u Apple boot-132 projekt.

+


+

Nove funkcije u Chameleon 2.0

+


+

- Potpuno prilagođen grafički korisinički interfejs donosi vizuelna poboljšanja u Darwin Bootloaderu.

+

- Start sa retail DVD-om direktno učitava ramdisk slike bez pomoći dodatnih programa.

+

- Hibernacija. Uživajte u nastavaku rada vašeg Mac OS X-a sa pregledom slike.

+

- SMBIOS zamijena tvorničkih za modificiranu SMBIOS vrijednost.

+

- DSDT zamijena za korištenje modificiranog, ispravljenog DSDT-a koji može riješiti nekoliko problema.

+

- Implementacija svojstva uređaja putem svojstva niza.

+

- hibridni boot0 / boot1h za MBR i GPT particijske diskove.

+

- automatsko FSB kodno otkrivanje čak i za posljednje AMD procesore. 

+

- Apple softver RAID podrška.

+

- Nvidia & ATI/AMD Grafički Aktivator.

+

- Modul podrška

+

- Detekcija memorije prilagođena iz memtest86: http://www.memtest.org

+

- Automatsko generisanje P-State i C-State za izvorno upravljanje energijom.

+

- Prijava porukama.

+


+

Kod je objavljen pod verzijom 2 GNU javna licenca.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Za detaljne informacije posjetite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/bs.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/bs.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/bs.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/bs.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/bs.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..b7b03c8 Binary files /dev/null and b/package/Resources.old/bs.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..6cd97da --- /dev/null +++ b/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..baa0a28 --- /dev/null +++ b/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/bs.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +ebff7f07b51e614a88b2a1aa5f2bd0fe +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +910 + diff --git a/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..d0f22bc --- /dev/null +++ b/package/Resources.old/bs.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skripte su zavr\'9aile i datoteka pod\ + nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\ +na root particije diska koje ste odabrali.\ +\ +\cf0 Molimo \cf4 pro\uc0\u269 itajte ga\cf0 kako biste saznali da li je instalacija bila\ +uspije\'9ana i \uc0\u269 uvajte ga radi evidencije o tome \'9ata je u\u269 injeno\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/bs.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/bs.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..d0f22bc --- /dev/null +++ b/package/Resources.old/bs.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skripte su zavr\'9aile i datoteka pod\ + nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\ +na root particije diska koje ste odabrali.\ +\ +\cf0 Molimo \cf4 pro\uc0\u269 itajte ga\cf0 kako biste saznali da li je instalacija bila\ +uspije\'9ana i \uc0\u269 uvajte ga radi evidencije o tome \'9ata je u\u269 injeno\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/bs.lproj/Description.html b/package/Resources.old/bs.lproj/Description.html new file mode 100644 index 0000000..0bd171b --- /dev/null +++ b/package/Resources.old/bs.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon je kombinacija različitih komponenata bootloadera. On se zasniva na David Elliottovoj lažnoj EFI implementaciji dodanoj u Apple boot-132 projekt.

+


+

Nove funkcije u Chameleon 2.0

+


+

- Potpuno prilagođen grafički korisinički interfejs donosi vizuelna poboljšanja u Darwin Bootloaderu.

+

- Start sa retail DVD-om direktno učitava ramdisk slike bez pomoći dodatnih programa.

+

- Hibernacija. Uživajte u nastavaku rada vašeg Mac OS X-a sa pregledom slike.

+

- SMBIOS zamijena tvorničkih za modificiranu SMBIOS vrijednost.

+

- DSDT zamijena za korištenje modificiranog, ispravljenog DSDT-a koji može riješiti nekoliko problema.

+

- Implementacija svojstva uređaja putem svojstva niza.

+

- hibridni boot0 / boot1h za MBR i GPT particijske diskove.

+

- automatsko FSB kodno otkrivanje čak i za posljednje AMD procesore. 

+

- Apple softver RAID podrška.

+

- Nvidia & ATI/AMD Grafički Aktivator.

+

- Modul podrška

+

- Detekcija memorije prilagođena iz memtest86: http://www.memtest.org

+

- Automatsko generisanje P-State i C-State za izvorno upravljanje energijom.

+

- Prijava porukama.

+


+

Kod je objavljen pod verzijom 2 GNU javna licenca.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Za detaljne informacije posjetite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/bs.lproj/License.rtf b/package/Resources.old/bs.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/bs.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/bs.lproj/Localizable.strings b/package/Resources.old/bs.lproj/Localizable.strings new file mode 100644 index 0000000..b7b03c8 Binary files /dev/null and b/package/Resources.old/bs.lproj/Localizable.strings differ diff --git a/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..39e73ff --- /dev/null +++ b/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/bs.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..c082eae --- /dev/null +++ b/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/bs.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +39b0f15afc663a4c411b600431d049de +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +662 + diff --git a/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..a5fe0ab --- /dev/null +++ b/package/Resources.old/bs.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Instalacija nije prilago\uc0\u273 ena za Apple Macintosh kompjutere\ + +\fs22 \cf0 \ +\ +Programeri :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Hvala :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paket :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: mistudio\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/bs.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/bs.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..a5fe0ab --- /dev/null +++ b/package/Resources.old/bs.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Instalacija nije prilago\uc0\u273 ena za Apple Macintosh kompjutere\ + +\fs22 \cf0 \ +\ +Programeri :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Hvala :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paket :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: mistudio\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ca.lproj/.svn/all-wcprops b/package/Resources.old/ca.lproj/.svn/all-wcprops new file mode 100644 index 0000000..b596029 --- /dev/null +++ b/package/Resources.old/ca.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/License.rtf +END diff --git a/package/Resources.old/ca.lproj/.svn/entries b/package/Resources.old/ca.lproj/.svn/entries new file mode 100644 index 0000000..fe43860 --- /dev/null +++ b/package/Resources.old/ca.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ca.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:14.000000Z +3c94be7591b545d9201b7095639803c4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2969 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:14.000000Z +d7b182c59aef376b8162f7cff3b3ffc4 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33838 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:14.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/ca.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/ca.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/ca.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/ca.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/ca.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..f1f2636 --- /dev/null +++ b/package/Resources.old/ca.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon és un gestor d'arrencada basat en una combinació de components desenvolupats a partir de la implementació de la Fake EFI de David Elliott afegida al mètode boot-132 d'Apple

+


+

Chameleon v2 ha estat ampliat amb noves funcions. Per exemple:

+


+

- Interfície gràfica totalment personalizable per donar-li una mica de color al gestor d'arrencada Darwin.

+

- Carrega de RAMdisk per arrencar directament el DVD retail, sense programes addicionals.

+

- Hibernació. Gaudeix de la represa de Mac OS X amb una imatge de mostra.

+

- Override de SMBIOS per modificar els valors SMBIOS per defecte.

+

- Override de DSDT per utilitzar un DSDT editat, que pot resoldre molts problemes.

+

- Injecció de propietats de dispositiu mitjançant EFI Strings.

+

- Sistema híbrid d'arrencada boot0/boot1h per a discos amb taula de particions MBR i GPT.

+

- Detecció automàtica de freqüència FSB fins i tot per les CPUs AMD mes recents.

+

- Suport per RAID software d'Apple.

+

- Enabler per a gràfiques Nvidia i ATI.

+

- Suport de càrrega per mòduls

+

- Detecció automàtic de memòria adaptat de memtest86: http://www.memtest.org

+

- Generació automàtica de P-States i C-States per a la gestió d'energia nativa.

+

- Generació d'informe d'accions en txt.

+


+

El codi està alliberat sota la versió 2 de la Llicència Pública GNU.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Més informació i Preguntes i respostes habituals: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ca.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/ca.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ca.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ca.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/ca.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..26e2a52 Binary files /dev/null and b/package/Resources.old/ca.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..cd4cda2 --- /dev/null +++ b/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..e1f636f --- /dev/null +++ b/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ca.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:14.000000Z +c6a08bf51dfbb41f268bd1b8c25dd199 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +884 + diff --git a/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..f2f55ad --- /dev/null +++ b/package/Resources.old/ca.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Els Scripts s'han completat i un arxiu\ + amb el nom \cf2 @LOG_FILENAME@\cf3 ha estat\ +escrit en l'arrel de la partici\'f3 seleccionada.\ +\ +\cf0 Si us plan, \cf4 llegeix-ho\cf0 per saber si la instalaci\'f3 ha\ +tingut \'e8xit i mantenir un registre de les accions dutes a terme.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ca.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/ca.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..f2f55ad --- /dev/null +++ b/package/Resources.old/ca.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Els Scripts s'han completat i un arxiu\ + amb el nom \cf2 @LOG_FILENAME@\cf3 ha estat\ +escrit en l'arrel de la partici\'f3 seleccionada.\ +\ +\cf0 Si us plan, \cf4 llegeix-ho\cf0 per saber si la instalaci\'f3 ha\ +tingut \'e8xit i mantenir un registre de les accions dutes a terme.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ca.lproj/Description.html b/package/Resources.old/ca.lproj/Description.html new file mode 100644 index 0000000..f1f2636 --- /dev/null +++ b/package/Resources.old/ca.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon és un gestor d'arrencada basat en una combinació de components desenvolupats a partir de la implementació de la Fake EFI de David Elliott afegida al mètode boot-132 d'Apple

+


+

Chameleon v2 ha estat ampliat amb noves funcions. Per exemple:

+


+

- Interfície gràfica totalment personalizable per donar-li una mica de color al gestor d'arrencada Darwin.

+

- Carrega de RAMdisk per arrencar directament el DVD retail, sense programes addicionals.

+

- Hibernació. Gaudeix de la represa de Mac OS X amb una imatge de mostra.

+

- Override de SMBIOS per modificar els valors SMBIOS per defecte.

+

- Override de DSDT per utilitzar un DSDT editat, que pot resoldre molts problemes.

+

- Injecció de propietats de dispositiu mitjançant EFI Strings.

+

- Sistema híbrid d'arrencada boot0/boot1h per a discos amb taula de particions MBR i GPT.

+

- Detecció automàtica de freqüència FSB fins i tot per les CPUs AMD mes recents.

+

- Suport per RAID software d'Apple.

+

- Enabler per a gràfiques Nvidia i ATI.

+

- Suport de càrrega per mòduls

+

- Detecció automàtic de memòria adaptat de memtest86: http://www.memtest.org

+

- Generació automàtica de P-States i C-States per a la gestió d'energia nativa.

+

- Generació d'informe d'accions en txt.

+


+

El codi està alliberat sota la versió 2 de la Llicència Pública GNU.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Més informació i Preguntes i respostes habituals: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ca.lproj/License.rtf b/package/Resources.old/ca.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ca.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ca.lproj/Localizable.strings b/package/Resources.old/ca.lproj/Localizable.strings new file mode 100644 index 0000000..26e2a52 Binary files /dev/null and b/package/Resources.old/ca.lproj/Localizable.strings differ diff --git a/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..42fbaa2 --- /dev/null +++ b/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ca.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..e716b3f --- /dev/null +++ b/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ca.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:14.000000Z +0c4bed4718a7765c09b7a9af7d874daa +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +657 + diff --git a/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..aa278b0 --- /dev/null +++ b/package/Resources.old/ca.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 No instal\'b7lar en un ordinador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Programadors :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Agra\'efments :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Instal\'b7lador :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, Tradu\'eft per : Ed_Saxman\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ca.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/ca.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..aa278b0 --- /dev/null +++ b/package/Resources.old/ca.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 No instal\'b7lar en un ordinador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Programadors :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Agra\'efments :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Instal\'b7lador :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, Tradu\'eft per : Ed_Saxman\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/de.lproj/.svn/all-wcprops b/package/Resources.old/de.lproj/.svn/all-wcprops new file mode 100644 index 0000000..71e3f8a --- /dev/null +++ b/package/Resources.old/de.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/License.rtf +END diff --git a/package/Resources.old/de.lproj/.svn/entries b/package/Resources.old/de.lproj/.svn/entries new file mode 100644 index 0000000..9cc3ba1 --- /dev/null +++ b/package/Resources.old/de.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/de.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:15.000000Z +3885f90f93013c5aff43a66ac3081a2c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2918 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:15.000000Z +294a591d8a64374b248464646c031e07 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31454 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:15.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/de.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/de.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/de.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/de.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/de.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..9e07c16 --- /dev/null +++ b/package/Resources.old/de.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon ist eine Kombination verschiedener Bootloader Komponenten.
Als Basis diente David Elliott's fake EFI Implementierung die zu Apple's boot-132 Projekt hinzugefügt wurde.
Chameleon wurde mit folgenden Hauptmerkmalen erweitert:

+


+

Neue Funktionen in Chameleon 2.0 :

+


+

- Vollständig anpassbare GUI um etwas Farbe in den Darwin Bootloader zu bringen.

+

- Starten von retail DVDs durch direktes Laden eines RAM-Disk Images, ohne zusätzliche Programme zu benötigen .

+

- Ruhezustand. Genießt Mac OS X mit einem Vorschau-Bild aufzuwecken.

+

- SMBIOS Override um vorgegebene SMBIOS Werte anzupassen.

+

- DSDT Override um eine angepasste DSDT, die verschiedene Probleme beheben kann, zu laden.

+

- Device Property Injection über device-properties string.

+

- hybrider boot0 / boot1h für MBR und GPT partitionierte Festplatten.

+

- Code zur automatischen FSB Erkennung, selbst für AMD CPUs.

+

- Apple Software RAID Unterstützung.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Speicher Erkennung angepasst von memtest86: http://www.memtest.org

+

- Automatische P-State & C-State generation für native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Für weitere Informationen besuche: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/de.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/de.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/de.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/de.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/de.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..eb3bb5f Binary files /dev/null and b/package/Resources.old/de.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..25500af --- /dev/null +++ b/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..089c790 --- /dev/null +++ b/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/de.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +85b5cd31bb9ec434a6f230382bc8ec35 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +914 + diff --git a/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..c78184b --- /dev/null +++ b/package/Resources.old/de.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Die Scripts wurden ausgef\'fchrt und eine Datei\ + genannt \cf2 @LOG_FILENAME@\cf3 wurde ins\ +Rootverzeichnis deiner ausgesuchten Partition geschrieben. \ +\ +\cf0 Bitte \cf4 lese\cf5 die Datei\cf0 \cf3 um herauszufinden ob \ +die Installation erfolgreich war. Behalte die Datei\ +um nachzuschauen was getan wurde.\cf5 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/de.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/de.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..c78184b --- /dev/null +++ b/package/Resources.old/de.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Die Scripts wurden ausgef\'fchrt und eine Datei\ + genannt \cf2 @LOG_FILENAME@\cf3 wurde ins\ +Rootverzeichnis deiner ausgesuchten Partition geschrieben. \ +\ +\cf0 Bitte \cf4 lese\cf5 die Datei\cf0 \cf3 um herauszufinden ob \ +die Installation erfolgreich war. Behalte die Datei\ +um nachzuschauen was getan wurde.\cf5 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/de.lproj/Description.html b/package/Resources.old/de.lproj/Description.html new file mode 100644 index 0000000..9e07c16 --- /dev/null +++ b/package/Resources.old/de.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon ist eine Kombination verschiedener Bootloader Komponenten.
Als Basis diente David Elliott's fake EFI Implementierung die zu Apple's boot-132 Projekt hinzugefügt wurde.
Chameleon wurde mit folgenden Hauptmerkmalen erweitert:

+


+

Neue Funktionen in Chameleon 2.0 :

+


+

- Vollständig anpassbare GUI um etwas Farbe in den Darwin Bootloader zu bringen.

+

- Starten von retail DVDs durch direktes Laden eines RAM-Disk Images, ohne zusätzliche Programme zu benötigen .

+

- Ruhezustand. Genießt Mac OS X mit einem Vorschau-Bild aufzuwecken.

+

- SMBIOS Override um vorgegebene SMBIOS Werte anzupassen.

+

- DSDT Override um eine angepasste DSDT, die verschiedene Probleme beheben kann, zu laden.

+

- Device Property Injection über device-properties string.

+

- hybrider boot0 / boot1h für MBR und GPT partitionierte Festplatten.

+

- Code zur automatischen FSB Erkennung, selbst für AMD CPUs.

+

- Apple Software RAID Unterstützung.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Speicher Erkennung angepasst von memtest86: http://www.memtest.org

+

- Automatische P-State & C-State generation für native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Für weitere Informationen besuche: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/de.lproj/License.rtf b/package/Resources.old/de.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/de.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/de.lproj/Localizable.strings b/package/Resources.old/de.lproj/Localizable.strings new file mode 100644 index 0000000..eb3bb5f Binary files /dev/null and b/package/Resources.old/de.lproj/Localizable.strings differ diff --git a/package/Resources.old/de.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/de.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..b03bdf7 --- /dev/null +++ b/package/Resources.old/de.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/de.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/de.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/de.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..d0f9974 --- /dev/null +++ b/package/Resources.old/de.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/de.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +170195025299709e6d3c7963c2b2ca1c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +682 + diff --git a/package/Resources.old/de.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/de.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..12a580e --- /dev/null +++ b/package/Resources.old/de.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Achtung ! Nicht auf einem Apple Macintosh Computer Installieren\ + +\fs22 \cf0 \ +\ +Entwickler :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Dank :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: iXabbu, olegischinski & NextMac\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/de.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/de.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..12a580e --- /dev/null +++ b/package/Resources.old/de.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Achtung ! Nicht auf einem Apple Macintosh Computer Installieren\ + +\fs22 \cf0 \ +\ +Entwickler :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Dank :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: iXabbu, olegischinski & NextMac\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/el.lproj/.svn/all-wcprops b/package/Resources.old/el.lproj/.svn/all-wcprops new file mode 100644 index 0000000..97cf706 --- /dev/null +++ b/package/Resources.old/el.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/License.rtf +END diff --git a/package/Resources.old/el.lproj/.svn/entries b/package/Resources.old/el.lproj/.svn/entries new file mode 100644 index 0000000..fe24faf --- /dev/null +++ b/package/Resources.old/el.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/el.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:04.000000Z +ca750d16544c83e41178e70b4c7acc89 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2696 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:04.000000Z +04d5bcaffeca37860c9e901605be893c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33784 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:04.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/el.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/el.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/el.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/el.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/el.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..d8d37ab --- /dev/null +++ b/package/Resources.old/el.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/el.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/el.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/el.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/el.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/el.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..d385c0c Binary files /dev/null and b/package/Resources.old/el.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..609cae8 --- /dev/null +++ b/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..92491c2 --- /dev/null +++ b/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/el.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:04.000000Z +0d080022200ced0bb9336201a5f4ce4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +854 + diff --git a/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/el.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/el.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/el.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/el.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/el.lproj/Description.html b/package/Resources.old/el.lproj/Description.html new file mode 100644 index 0000000..d8d37ab --- /dev/null +++ b/package/Resources.old/el.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/el.lproj/License.rtf b/package/Resources.old/el.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/el.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/el.lproj/Localizable.strings b/package/Resources.old/el.lproj/Localizable.strings new file mode 100644 index 0000000..d385c0c Binary files /dev/null and b/package/Resources.old/el.lproj/Localizable.strings differ diff --git a/package/Resources.old/el.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/el.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..7fe10a2 --- /dev/null +++ b/package/Resources.old/el.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/el.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/el.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/el.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..807e9b3 --- /dev/null +++ b/package/Resources.old/el.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/el.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:03.000000Z +3bac0fb02eb7a3e40049404e0d9448e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +641 + diff --git a/package/Resources.old/el.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/el.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/el.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/el.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/el.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/el.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/en.lproj/.svn/all-wcprops b/package/Resources.old/en.lproj/.svn/all-wcprops new file mode 100644 index 0000000..98df5b9 --- /dev/null +++ b/package/Resources.old/en.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/License.rtf +END diff --git a/package/Resources.old/en.lproj/.svn/entries b/package/Resources.old/en.lproj/.svn/entries new file mode 100644 index 0000000..34e1e9f --- /dev/null +++ b/package/Resources.old/en.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/en.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:05.000000Z +ca750d16544c83e41178e70b4c7acc89 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2696 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:05.000000Z +c6bacbbf68c229e8765cda8795faab1b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32960 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:05.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/en.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/en.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/en.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/en.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/en.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..d8d37ab --- /dev/null +++ b/package/Resources.old/en.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/en.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/en.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/en.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/en.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/en.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..d762a7e Binary files /dev/null and b/package/Resources.old/en.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..c6b9f7e --- /dev/null +++ b/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..76dc7fc --- /dev/null +++ b/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/en.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +0d080022200ced0bb9336201a5f4ce4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +854 + diff --git a/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/en.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/en.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/en.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/en.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/en.lproj/Description.html b/package/Resources.old/en.lproj/Description.html new file mode 100644 index 0000000..d8d37ab --- /dev/null +++ b/package/Resources.old/en.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/en.lproj/License.rtf b/package/Resources.old/en.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/en.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/en.lproj/Localizable.strings b/package/Resources.old/en.lproj/Localizable.strings new file mode 100644 index 0000000..d762a7e Binary files /dev/null and b/package/Resources.old/en.lproj/Localizable.strings differ diff --git a/package/Resources.old/en.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/en.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..6c60646 --- /dev/null +++ b/package/Resources.old/en.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/en.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/en.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/en.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..c5b3b80 --- /dev/null +++ b/package/Resources.old/en.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/en.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +b886ae9352f8571deb8e8b7cd5627c25 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +646 + diff --git a/package/Resources.old/en.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/en.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..2d4f0f8 --- /dev/null +++ b/package/Resources.old/en.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: blackosx\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/en.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/en.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..2d4f0f8 --- /dev/null +++ b/package/Resources.old/en.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: blackosx\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/es.lproj/.svn/all-wcprops b/package/Resources.old/es.lproj/.svn/all-wcprops new file mode 100644 index 0000000..63a6b26 --- /dev/null +++ b/package/Resources.old/es.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/License.rtf +END diff --git a/package/Resources.old/es.lproj/.svn/entries b/package/Resources.old/es.lproj/.svn/entries new file mode 100644 index 0000000..578690a --- /dev/null +++ b/package/Resources.old/es.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/es.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:05.000000Z +a7a2f54f8e681edd4389a26d2e93dc5d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3060 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:05.000000Z +f4bbb6934fc57537b33be934ef66836c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +34782 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:05.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/es.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/es.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/es.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/es.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/es.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..dbacfd9 --- /dev/null +++ b/package/Resources.old/es.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

El Bootloader Chameleon es la combinación de varios componentes. Esta basado en la implementación EFI falsa de David Elliott, incorporada al método Boot-132, a partir del proyecto de código abierto Darwin de Apple

+


+

Entre las Novedades en Chameleon v2 se encuentran muchas funciones extendidas, por ejemplo:

+


+

- Interfaz GUI totalmente personalizada para brindarle más colorido al Dawin Bootloader.

+

- Booteo de DVDs con simplemente cargar una imagen ramdisk sin la ayuda de programas adicionales.

+

- Hibernación. Disfrute reanudar su MAC OS X con una imagen de muestra.

+

- Anulación de SMBIOS, para modificar los valores de fábrica SMBIOS.

+

- Anulación de DSDT, para usar un DSDT modificado y arreglado capaz de resolver varios inconvenientes.

+

- Inyección de Propiedades de Dispositivos a través de EFI strings.

+

- Permite el arranque de esquemas híbridos boot0 / boot1h, para discos particionados en MBR y GPT.

+

- Detección automática de frecuencia FSB para CPUs AMD recientes.

+

- Soporte para Software RAID de Apple.

+

- Habilitación de soporte para Gráficas Nvidia & ATI/AMD.

+

- Soporte de carga por Módulos.

+

- Detección de Memoria adaptada desde memtest86: http://www.memtest.org

+

- Generación automática de P-States & C-States para gestión de energía nativa.

+

- Registro de Mensajes.

+


+

El código está liberado bajo la versión 2 de la Licencia Pública GNU.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Para información más detallada, preguntas y respuestas visitar: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/es.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/es.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/es.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/es.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/es.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..b281c76 Binary files /dev/null and b/package/Resources.old/es.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..f20b7f5 --- /dev/null +++ b/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..c4a600e --- /dev/null +++ b/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/es.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +adf84918b3b93a46ab0e2bd33c69b738 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +871 + diff --git a/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..d5a26a7 --- /dev/null +++ b/package/Resources.old/es.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Los scripts se han completado y un archivo\ + de nombre \cf2 @LOG_FILENAME@\cf3 ha sido\ +escrito en la ra\'edz de la partici\'f3n seleccionada.\ +\ +\cf0 Por favor \cf4 l\'e9alo\cf0 para saber si la instalaci\'f3n fue\ +exitosa y mantener un registro de lo que se hizo.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/es.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/es.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..d5a26a7 --- /dev/null +++ b/package/Resources.old/es.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Los scripts se han completado y un archivo\ + de nombre \cf2 @LOG_FILENAME@\cf3 ha sido\ +escrito en la ra\'edz de la partici\'f3n seleccionada.\ +\ +\cf0 Por favor \cf4 l\'e9alo\cf0 para saber si la instalaci\'f3n fue\ +exitosa y mantener un registro de lo que se hizo.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/es.lproj/Description.html b/package/Resources.old/es.lproj/Description.html new file mode 100644 index 0000000..dbacfd9 --- /dev/null +++ b/package/Resources.old/es.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

El Bootloader Chameleon es la combinación de varios componentes. Esta basado en la implementación EFI falsa de David Elliott, incorporada al método Boot-132, a partir del proyecto de código abierto Darwin de Apple

+


+

Entre las Novedades en Chameleon v2 se encuentran muchas funciones extendidas, por ejemplo:

+


+

- Interfaz GUI totalmente personalizada para brindarle más colorido al Dawin Bootloader.

+

- Booteo de DVDs con simplemente cargar una imagen ramdisk sin la ayuda de programas adicionales.

+

- Hibernación. Disfrute reanudar su MAC OS X con una imagen de muestra.

+

- Anulación de SMBIOS, para modificar los valores de fábrica SMBIOS.

+

- Anulación de DSDT, para usar un DSDT modificado y arreglado capaz de resolver varios inconvenientes.

+

- Inyección de Propiedades de Dispositivos a través de EFI strings.

+

- Permite el arranque de esquemas híbridos boot0 / boot1h, para discos particionados en MBR y GPT.

+

- Detección automática de frecuencia FSB para CPUs AMD recientes.

+

- Soporte para Software RAID de Apple.

+

- Habilitación de soporte para Gráficas Nvidia & ATI/AMD.

+

- Soporte de carga por Módulos.

+

- Detección de Memoria adaptada desde memtest86: http://www.memtest.org

+

- Generación automática de P-States & C-States para gestión de energía nativa.

+

- Registro de Mensajes.

+


+

El código está liberado bajo la versión 2 de la Licencia Pública GNU.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Para información más detallada, preguntas y respuestas visitar: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/es.lproj/License.rtf b/package/Resources.old/es.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/es.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/es.lproj/Localizable.strings b/package/Resources.old/es.lproj/Localizable.strings new file mode 100644 index 0000000..b281c76 Binary files /dev/null and b/package/Resources.old/es.lproj/Localizable.strings differ diff --git a/package/Resources.old/es.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/es.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..8a000d6 --- /dev/null +++ b/package/Resources.old/es.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/es.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/es.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/es.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..d1c5366 --- /dev/null +++ b/package/Resources.old/es.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/es.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +32d24ee25768af06ec34314a1670d434 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +650 + diff --git a/package/Resources.old/es.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/es.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..9a82ed1 --- /dev/null +++ b/package/Resources.old/es.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 No lo instale en un ordenador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Programadores :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Gracias a :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paquete :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language traducido por: juanerson\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/es.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/es.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..9a82ed1 --- /dev/null +++ b/package/Resources.old/es.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 No lo instale en un ordenador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Programadores :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Gracias a :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paquete :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language traducido por: juanerson\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/fr.lproj/.svn/all-wcprops b/package/Resources.old/fr.lproj/.svn/all-wcprops new file mode 100644 index 0000000..c390a1d --- /dev/null +++ b/package/Resources.old/fr.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/License.rtf +END diff --git a/package/Resources.old/fr.lproj/.svn/entries b/package/Resources.old/fr.lproj/.svn/entries new file mode 100644 index 0000000..febe649 --- /dev/null +++ b/package/Resources.old/fr.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/fr.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:06.000000Z +cbf0eec9ca8ba0de505c067a5f43ffab +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3206 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:06.000000Z +94bb6b1db9f62524c5f9104c3d168c8a +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +34530 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:06.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/fr.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/fr.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/fr.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/fr.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/fr.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..08e9ac3 --- /dev/null +++ b/package/Resources.old/fr.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon est un chargeur d'amorçage construit en utilisant une combinaison de composants qui a elle même évoluée à partir du développement de l'implémentation "fake EFI" de David Elliott, qui a été ajoutée au projet boot-132 d'Apple.

+


+

Chameleon v2 a été, au fur et à mesure, mis à jour avec nombre de fonctions :

+


+

- Interface utilisateur customisable, pour donner un peu de piment au chargeur d'amorçage Darwin.

+

- Chargement possible d'un "RAMDisk" pour pouvoir démarrer un DVD officiel de Mac OS X sans logiciels tiers.

+

- Mise en veille prolongée. Permet de reprendre votre session de travail instantanément via une image d'hibernation.

+

- Prise en charge d'un SMBIOS modifié. Permet d'outrepasser le SMBIOS d'origine de votre machine.

+

- Prise en charge d'un DSDT modifié. Permet d'appliquer un DSDT patché et résoudre beaucoup de problèmes.

+

- Injection des propriétés de périphériques via une chaîne de caractère "device-properties".

+

- Fichiers boot0 et boot1h hybrides. Permet l'utilisation de disques partitionés en MBR ou GPT.

+

- Detection automatique du FSB, même pour les processeurs AMD récents.

+

- Support du RAID Logiciel d'Apple.

+

- Activateur graphique Nvidia & ATI/AMD intégré.

+

- Support de modules (extensions de Chameleon).

+

- Détection mémoire adaptée de memtest86 : http://www.memtest.org

+

- Génération automatique des P-State & C-State pour une gestion de l'alimentation native.

+

- Journalisation des messages console.

+


+

Le code est publié sous la version 2 de la licence GPL (Gnu Public License).

+

http://forge.voodooprojects.org/p/chameleon

+


+

Questions fréquentes (en anglais): http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/fr.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/fr.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/fr.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/fr.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/fr.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..bb889c3 Binary files /dev/null and b/package/Resources.old/fr.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..e952c34 --- /dev/null +++ b/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..222b1ee --- /dev/null +++ b/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/fr.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +10870c2d06e0e582c5841f65af8c779e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +899 + diff --git a/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..fa7c818 --- /dev/null +++ b/package/Resources.old/fr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Les scripts sont termin\'e9s et un fichier\ + nomm\'e9 \cf2 @LOG_FILENAME@\cf3 a \cf0 \'e9\cf3 t\cf0 \'e9\cf3 \ + \'e9\cf3 crit \'e0\'a0la racine de la partition choisie.\ +\ +\cf0 SVP \cf4 lisez le\cf0 pour savoir si l'installation est un\ +succes et garder un rapport de ce qui a \'e9t\'e9 fait..\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/fr.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/fr.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..fa7c818 --- /dev/null +++ b/package/Resources.old/fr.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Les scripts sont termin\'e9s et un fichier\ + nomm\'e9 \cf2 @LOG_FILENAME@\cf3 a \cf0 \'e9\cf3 t\cf0 \'e9\cf3 \ + \'e9\cf3 crit \'e0\'a0la racine de la partition choisie.\ +\ +\cf0 SVP \cf4 lisez le\cf0 pour savoir si l'installation est un\ +succes et garder un rapport de ce qui a \'e9t\'e9 fait..\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/fr.lproj/Description.html b/package/Resources.old/fr.lproj/Description.html new file mode 100644 index 0000000..08e9ac3 --- /dev/null +++ b/package/Resources.old/fr.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon est un chargeur d'amorçage construit en utilisant une combinaison de composants qui a elle même évoluée à partir du développement de l'implémentation "fake EFI" de David Elliott, qui a été ajoutée au projet boot-132 d'Apple.

+


+

Chameleon v2 a été, au fur et à mesure, mis à jour avec nombre de fonctions :

+


+

- Interface utilisateur customisable, pour donner un peu de piment au chargeur d'amorçage Darwin.

+

- Chargement possible d'un "RAMDisk" pour pouvoir démarrer un DVD officiel de Mac OS X sans logiciels tiers.

+

- Mise en veille prolongée. Permet de reprendre votre session de travail instantanément via une image d'hibernation.

+

- Prise en charge d'un SMBIOS modifié. Permet d'outrepasser le SMBIOS d'origine de votre machine.

+

- Prise en charge d'un DSDT modifié. Permet d'appliquer un DSDT patché et résoudre beaucoup de problèmes.

+

- Injection des propriétés de périphériques via une chaîne de caractère "device-properties".

+

- Fichiers boot0 et boot1h hybrides. Permet l'utilisation de disques partitionés en MBR ou GPT.

+

- Detection automatique du FSB, même pour les processeurs AMD récents.

+

- Support du RAID Logiciel d'Apple.

+

- Activateur graphique Nvidia & ATI/AMD intégré.

+

- Support de modules (extensions de Chameleon).

+

- Détection mémoire adaptée de memtest86 : http://www.memtest.org

+

- Génération automatique des P-State & C-State pour une gestion de l'alimentation native.

+

- Journalisation des messages console.

+


+

Le code est publié sous la version 2 de la licence GPL (Gnu Public License).

+

http://forge.voodooprojects.org/p/chameleon

+


+

Questions fréquentes (en anglais): http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/fr.lproj/License.rtf b/package/Resources.old/fr.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/fr.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/fr.lproj/Localizable.strings b/package/Resources.old/fr.lproj/Localizable.strings new file mode 100644 index 0000000..bb889c3 Binary files /dev/null and b/package/Resources.old/fr.lproj/Localizable.strings differ diff --git a/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..13b86dc --- /dev/null +++ b/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/fr.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..cca6934 --- /dev/null +++ b/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/fr.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +79bced3fbe5a1acb38b314c9aa391b0b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +615 + diff --git a/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..83993c0 --- /dev/null +++ b/package/Resources.old/fr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,40 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Ne pas installer sur un ordinateur Apple Macintosh\ + +\fs22 \cf0 \ +\ +D\'e9veloppeurs :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Merci \'e0 :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package d'installation :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language traduit par: Tenval\ +Copyright \'a9 %CPRYEAR%} \ No newline at end of file diff --git a/package/Resources.old/fr.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/fr.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..83993c0 --- /dev/null +++ b/package/Resources.old/fr.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,40 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Ne pas installer sur un ordinateur Apple Macintosh\ + +\fs22 \cf0 \ +\ +D\'e9veloppeurs :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Merci \'e0 :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package d'installation :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language traduit par: Tenval\ +Copyright \'a9 %CPRYEAR%} \ No newline at end of file diff --git a/package/Resources.old/he.lproj/.svn/all-wcprops b/package/Resources.old/he.lproj/.svn/all-wcprops new file mode 100644 index 0000000..12b2269 --- /dev/null +++ b/package/Resources.old/he.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/License.rtf +END diff --git a/package/Resources.old/he.lproj/.svn/entries b/package/Resources.old/he.lproj/.svn/entries new file mode 100644 index 0000000..3c6a00a --- /dev/null +++ b/package/Resources.old/he.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/he.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:03.000000Z +d9201bdd1ed852344f27c7d2df82996d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3131 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:03.000000Z +148bcce6c7c974ed1a4175ed889f54a1 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32730 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:03.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/he.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/he.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/he.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/he.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/he.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..b1eecb9 --- /dev/null +++ b/package/Resources.old/he.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

חמליאון זה שילוב של רכיבי בוטלודרים שונים.
הוא מבוסס על יישום fake EFI של David Elliott לפרויקט boot-132 של אפל.
חמליאון מגיע עם תכונות עיקריות הבאות:

+


+

תכונות חדשות בחמליאון גרסה 2.0

+


+

- ממשק משתמש בעל התאמה אישית מלאה שמביאה צבעים לDarwin Bootloader.

+

- התחול דיסק התקנת OSX ריטייל על ידי העלאת ramdisk בלי להיעזר בתכנות נוספות.

+

- היברנציה. ליהנות מחזרת המערכת שלך ממצב היברנציה בעזרת preview image.

+

- עקיפת SMBIOS לשינוי ערכי מפעל של נתוני SMBIOS.

+

- עקיפת DSDT לשימוש בDSDT בהתאמה אישית אשר יכול לפתור מספר בעיות.

+

- אינג'קשן של Device Property באמצעות device-properties string.

+

- היבריד של boot0/boot1h לכוננים המחולקים בשיטות MBR ו GPT.

+

- קוד זיהוי אוטומטי של FSB אפילו למעבדי AMD החדשים.

+

- תמיכה בApple Software RAID.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

לקבלת מידע נוסף, אנא בקרו ב: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/he.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/he.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/he.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/he.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/he.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..382aec2 Binary files /dev/null and b/package/Resources.old/he.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..056d1b6 --- /dev/null +++ b/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..15995bf --- /dev/null +++ b/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/he.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:03.000000Z +0d080022200ced0bb9336201a5f4ce4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +854 + diff --git a/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/he.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/he.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/he.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/he.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/he.lproj/Description.html b/package/Resources.old/he.lproj/Description.html new file mode 100644 index 0000000..b1eecb9 --- /dev/null +++ b/package/Resources.old/he.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

חמליאון זה שילוב של רכיבי בוטלודרים שונים.
הוא מבוסס על יישום fake EFI של David Elliott לפרויקט boot-132 של אפל.
חמליאון מגיע עם תכונות עיקריות הבאות:

+


+

תכונות חדשות בחמליאון גרסה 2.0

+


+

- ממשק משתמש בעל התאמה אישית מלאה שמביאה צבעים לDarwin Bootloader.

+

- התחול דיסק התקנת OSX ריטייל על ידי העלאת ramdisk בלי להיעזר בתכנות נוספות.

+

- היברנציה. ליהנות מחזרת המערכת שלך ממצב היברנציה בעזרת preview image.

+

- עקיפת SMBIOS לשינוי ערכי מפעל של נתוני SMBIOS.

+

- עקיפת DSDT לשימוש בDSDT בהתאמה אישית אשר יכול לפתור מספר בעיות.

+

- אינג'קשן של Device Property באמצעות device-properties string.

+

- היבריד של boot0/boot1h לכוננים המחולקים בשיטות MBR ו GPT.

+

- קוד זיהוי אוטומטי של FSB אפילו למעבדי AMD החדשים.

+

- תמיכה בApple Software RAID.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

לקבלת מידע נוסף, אנא בקרו ב: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/he.lproj/License.rtf b/package/Resources.old/he.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/he.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/he.lproj/Localizable.strings b/package/Resources.old/he.lproj/Localizable.strings new file mode 100644 index 0000000..382aec2 Binary files /dev/null and b/package/Resources.old/he.lproj/Localizable.strings differ diff --git a/package/Resources.old/he.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/he.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..459a84c --- /dev/null +++ b/package/Resources.old/he.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/he.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/he.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/he.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..1815207 --- /dev/null +++ b/package/Resources.old/he.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/he.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:01.000000Z +3bac0fb02eb7a3e40049404e0d9448e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +641 + diff --git a/package/Resources.old/he.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/he.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/he.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/he.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/he.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/he.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/hr.lproj/.svn/all-wcprops b/package/Resources.old/hr.lproj/.svn/all-wcprops new file mode 100644 index 0000000..6c8941e --- /dev/null +++ b/package/Resources.old/hr.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/License.rtf +END diff --git a/package/Resources.old/hr.lproj/.svn/entries b/package/Resources.old/hr.lproj/.svn/entries new file mode 100644 index 0000000..dea4c11 --- /dev/null +++ b/package/Resources.old/hr.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/hr.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:06.000000Z +d3af180dcb37461202c193d2fb539731 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2825 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:06.000000Z +34dc768c736096034f97c11103b412de +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32104 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:06.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/hr.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/hr.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/hr.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/hr.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/hr.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..6074bd2 --- /dev/null +++ b/package/Resources.old/hr.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon je kombinacija različitih komponenti bootloadera. On je zasnovan na David Elliottovoj lažnoj EFI implementaciji dodanoj u Apple boot-132 projekt.

+


+

Nove funkcije u Chameleon 2.0

+


+

- Potpuno prilagođen grafičko korisiničko sučelje donosi vizuelna poboljšanja u Darwin Bootloaderu.

+

- Start sa retail DVD-om direktno učitava ramdisk slike bez pomoći dodatnih programa.

+

- Hibernacija. Uživajte u nastavaku rada vašeg Mac OS X-a sa pregledom slike.

+

- SMBIOS zamijena tvorničkih za modifikovanu SMBIOS vrijednost.

+

- DSDT zamijena za korištenje modifikovanog, ispravljenog DSDT-a koji može riješiti nekoliko problema.

+

- Implementacija svojstva uređaja putem svojstva niza.

+

- hibridni boot0 / boot1h za MBR i GPT particijske diskove.

+

- automatsko FSB kodno otkrivanje čak i za posljednje AMD procesore. 

+

- Apple softver RAID podrška.

+

- Nvidia & ATI/AMD Grafički Aktivator.

+

- Modul podrška

+

- Detekcija memorije prilagođena iz memtest86: http://www.memtest.org

+

- Automatsko generiranje P-State i C-State za izvorno upravljanje energijom.

+

- Prijava porukama.

+


+

Kod je objavljen pod verzijom 2 GNU javna licenca.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Za detaljne informacije posjetite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/hr.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/hr.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/hr.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/hr.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/hr.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..b4dd4f5 Binary files /dev/null and b/package/Resources.old/hr.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..e0ac26b --- /dev/null +++ b/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..822b715 --- /dev/null +++ b/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/hr.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +4066dd153c45c20b30a0a19d6765656d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +907 + diff --git a/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..12f5ca6 --- /dev/null +++ b/package/Resources.old/hr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skripte su zavr\'9aene i mapa pod\ + nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\ +u korijen particije diska koje ste odabrali.\ +\ +\cf0 Molimo \cf4 pro\uc0\u269 itajte\cf0 kako biste saznali da li je instalacija\ +bila uspije\'9ana i \uc0\u269 uvajte log radi evidencije o tome \'9ata je u\u269 injeno.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/hr.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/hr.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..12f5ca6 --- /dev/null +++ b/package/Resources.old/hr.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skripte su zavr\'9aene i mapa pod\ + nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\ +u korijen particije diska koje ste odabrali.\ +\ +\cf0 Molimo \cf4 pro\uc0\u269 itajte\cf0 kako biste saznali da li je instalacija\ +bila uspije\'9ana i \uc0\u269 uvajte log radi evidencije o tome \'9ata je u\u269 injeno.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/hr.lproj/Description.html b/package/Resources.old/hr.lproj/Description.html new file mode 100644 index 0000000..6074bd2 --- /dev/null +++ b/package/Resources.old/hr.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon je kombinacija različitih komponenti bootloadera. On je zasnovan na David Elliottovoj lažnoj EFI implementaciji dodanoj u Apple boot-132 projekt.

+


+

Nove funkcije u Chameleon 2.0

+


+

- Potpuno prilagođen grafičko korisiničko sučelje donosi vizuelna poboljšanja u Darwin Bootloaderu.

+

- Start sa retail DVD-om direktno učitava ramdisk slike bez pomoći dodatnih programa.

+

- Hibernacija. Uživajte u nastavaku rada vašeg Mac OS X-a sa pregledom slike.

+

- SMBIOS zamijena tvorničkih za modifikovanu SMBIOS vrijednost.

+

- DSDT zamijena za korištenje modifikovanog, ispravljenog DSDT-a koji može riješiti nekoliko problema.

+

- Implementacija svojstva uređaja putem svojstva niza.

+

- hibridni boot0 / boot1h za MBR i GPT particijske diskove.

+

- automatsko FSB kodno otkrivanje čak i za posljednje AMD procesore. 

+

- Apple softver RAID podrška.

+

- Nvidia & ATI/AMD Grafički Aktivator.

+

- Modul podrška

+

- Detekcija memorije prilagođena iz memtest86: http://www.memtest.org

+

- Automatsko generiranje P-State i C-State za izvorno upravljanje energijom.

+

- Prijava porukama.

+


+

Kod je objavljen pod verzijom 2 GNU javna licenca.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Za detaljne informacije posjetite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/hr.lproj/License.rtf b/package/Resources.old/hr.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/hr.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/hr.lproj/Localizable.strings b/package/Resources.old/hr.lproj/Localizable.strings new file mode 100644 index 0000000..b4dd4f5 Binary files /dev/null and b/package/Resources.old/hr.lproj/Localizable.strings differ diff --git a/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..eacd103 --- /dev/null +++ b/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/hr.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..075e030 --- /dev/null +++ b/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/hr.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +2120bfa3d34b155d3d6d3310973be323 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +665 + diff --git a/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..92bbc9a --- /dev/null +++ b/package/Resources.old/hr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Instalacija nije prilago\uc0\u273 ena za Apple Macintosh ra\u269 unala\ + +\fs22 \cf0 \ +\ +Programeri :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Hvala :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paket :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: mistudio\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/hr.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/hr.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..92bbc9a --- /dev/null +++ b/package/Resources.old/hr.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Instalacija nije prilago\uc0\u273 ena za Apple Macintosh ra\u269 unala\ + +\fs22 \cf0 \ +\ +Programeri :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Hvala :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paket :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: mistudio\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/id.lproj/.svn/all-wcprops b/package/Resources.old/id.lproj/.svn/all-wcprops new file mode 100644 index 0000000..c3c3dc6 --- /dev/null +++ b/package/Resources.old/id.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/License.rtf +END diff --git a/package/Resources.old/id.lproj/.svn/entries b/package/Resources.old/id.lproj/.svn/entries new file mode 100644 index 0000000..df24718 --- /dev/null +++ b/package/Resources.old/id.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/id.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:03.000000Z +608251b2af58f2318d08494d7f7bd38d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2786 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:03.000000Z +e3b46d40d0b031f3579402497012cfef +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32100 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:03.000000Z +1c44a195e2034bb3869c685294fc3aba +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +25124 + diff --git a/package/Resources.old/id.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/id.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/id.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/id.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/id.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..e43fb8c --- /dev/null +++ b/package/Resources.old/id.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon adalah kombinasi dari berbagai macam komponen boot loader. Berbasiskan implementasi EFI palsu oleh David Elliott yang ditambahkan pada proyek Apple’s Boot-132

+


+

Fitur terbaru di Chameleon 2.0

+


+

- GUI yang dapat diubah-suaikan dengan bebas untuk mewarnai Bootloader Darwin.

+

- Jalankan DVD retail secara langsung dengan memuat sebuah image ramdisk tanpa bantuan program lain.

+

- Hibernasi. Nikmati melanjutkan pekerjaan pada Mac OS X anda dengan “pratinjau image”.

+

- SMBIOS override unutk memodifikasi SMBIOS bawaan.

+

- DSDT override unutk menggunakan modifikasi tertentu dari DSDT yang dapat menyelesaikan isu-isu tertentu.

+

- Device Property Injection melalui string device-properties.

+

- hybrid boot0 / boot1h for MBR dan Media partisi GPT.

+

- Pendeteksian kode FSB Secara otomatis walaupun pada PC AMD.

+

- Dukungan Apple Software RAID.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Untuk informasi lebih lanjut, kunjungi: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/id.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/id.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..90f6841 --- /dev/null +++ b/package/Resources.old/id.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,446 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138 +{\fonttbl\f0\froman\fcharset0 Times-Roman;} +{\colortbl;\red255\green255\blue255;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww25400\viewh19520\viewkind0 +\deftab720 +\pard\pardeftab720 + +\f0\fs24 \cf0 \cb2 APPLE LISENSI PUBLIK SUMBER \ +Versi 2.0 - 6 Agustus 2003 \ +\ +Silakan baca Lisensi ini dengan seksama sebelum men-download software ini. Dengan men-download atau menggunakan software ini, Anda setuju untuk terikat oleh syarat-syarat Lisensi ini. Jika Anda tidak atau tidak dapat setuju dengan persyaratan Lisensi ini, jangan mengunduh atau menggunakan perangkat lunak. \ +\ +\pard\pardeftab720 +\cf0 \cb1 1. Umum; Definisi. \cb2 Lisensi ini berlaku untuk setiap program atau pekerjaan lain yang Apple Computer, Inc ("Apple") membuat tersedia untuk umum dan yang memuat pemberitahuan yang ditempatkan oleh Apple mengidentifikasi program seperti atau bekerja sebagai "Kode Asli" dan menyatakan bahwa itu adalah tunduk pada syarat \cb1 ini Sumber Lisensi Apple Publik versi 2.0 ("Lisensi"). Sebagaimana digunakan dalam Perjanjian Lisensi ini: \ +\ +\pard\pardeftab720 +\cf0 \cb2 1.1 "Hak Paten Berlaku" berarti: (a) dalam kasus di mana Apple adalah pemberi hak, (i) klaim paten yang sekarang atau selanjutnya diakuisisi, dimiliki oleh atau ditugaskan untuk Apple dan (ii) bahwa subjek penutup yang terkandung dalam Kode Asli, tetapi hanya sejauh yang diperlukan untuk menggunakan, mereproduksi dan / atau mendistribusikan Kode Asli tanpa pelanggaran; dan (b) dalam kasus di mana Anda adalah pemberi hak, (i) klaim paten yang sekarang atau selanjutnya diakuisisi, dimiliki oleh atau ditugaskan untuk Anda dan (ii) bahwa subjek meliputi materi di modifikasi Anda, dilakukan sendiri atau dalam kombinasi dengan Kode Asli. \ +\ +\pard\pardeftab720 +\cf0 \cb1 1.2 "Kontributor" berarti setiap orang atau entitas yang menciptakan atau memberikan kontribusi terhadap penciptaan Modifikasi. \ +\ +\pard\pardeftab720 +\cf0 \cb2 1,3 "Kode Covered" berarti Kode Asli, Modifikasi, kombinasi Kode Asli dan setiap Modifikasi, dan / atau bagian masing-masing daripadanya. \ +\ +1,4 "eksternal Menyebarkan" berarti: (a) untuk mensublisensikan, mendistribusikan atau sebaliknya membuat Kode Covered tersedia, secara langsung atau tidak langsung, kepada siapa pun selain Engkau; dan / atau (b) untuk menggunakan Kode Covered, sendirian atau sebagai bagian dari pekerjaan yang lebih besar , dengan cara apapun untuk memberikan layanan, termasuk tetapi tidak terbatas pada pengiriman konten, melalui komunikasi elektronik dengan klien lain selain Anda. \ +\ +1,5 "Larger Work" berarti sebuah karya yang menggabungkan Kode Covered atau bagian-bagiannya dengan kode tidak diatur oleh ketentuan Lisensi ini. \ +\ +\pard\pardeftab720 +\cf0 \cb1 1,6 "Modifikasi" berarti setiap tambahan, penghapusan dari, dan / atau mengubah \ +untuk, substansi dan / atau struktur dari Kode Asli, apapun sebelumnya \ +\pard\pardeftab720 +\cf0 \cb2 Modifikasi, kombinasi Kode Asli dan apapun sebelumnya \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi, dan / atau bagian masing-masing daripadanya. Bila kode \ +dirilis sebagai serangkaian file, Modifikasi adalah: (a) setiap tambahan \ +\pard\pardeftab720 +\cf0 \cb2 atau penghapusan dari isi file yang berisi Kode Covered; \ +\pard\pardeftab720 +\cf0 \cb1 dan / atau (b) setiap file baru atau representasi lain dari program komputer \ +pernyataan yang mengandung bagian dari Kode Covered. \ +\ +1,7 "Kode Asli" berarti (a) Source Code program atau lainnya \ +bekerja sebagai awalnya dibuat tersedia oleh Apple di bawah Lisensi ini, \ +termasuk Source Code dari setiap update atau upgrade untuk program seperti \ +\pard\pardeftab720 +\cf0 \cb2 atau karya yang dibuat tersedia oleh Apple di bawah Lisensi ini, dan yang telah \ +\pard\pardeftab720 +\cf0 \cb1 tegas diidentifikasi oleh Apple seperti itu dalam header file (s) seperti \ +\pard\pardeftab720 +\cf0 \cb2 pekerjaan, dan (b) kode objek dikompilasi dari Source Code tersebut dan \ +\pard\pardeftab720 +\cf0 \cb1 awalnya disediakan oleh Apple di bawah Lisensi ini. \ +\ +1,8 "Kode Sumber" berarti bentuk yang dapat dibaca manusia dari sebuah program atau \ +pekerjaan yang cocok untuk membuat modifikasi untuk itu, termasuk semua \ +modul yang dikandungnya, ditambah berkas-berkas definisi antarmuka yang terkait, \ +\pard\pardeftab720 +\cf0 \cb2 script yang digunakan untuk mengendalikan kompilasi dan instalasi dieksekusi \ +\pard\pardeftab720 +\cf0 \cb1 (Kode objek). \ +\ +1,9 "Anda" atau "Anda" berarti seorang individu atau badan hukum berolahraga \ +hak di bawah Lisensi ini. Untuk badan hukum, "Anda" atau "Anda" \ +termasuk setiap entitas yang mengendalikan, dikendalikan oleh, atau berada di bawah \ +\pard\pardeftab720 +\cf0 \cb2 pengendalian bersama dengan, Anda, dimana "kontrol" berarti (a) kekuasaan, langsung \ +atau tidak langsung, menyebabkan arah atau manajemen entitas tersebut, \ +apakah dengan kontrak atau sebaliknya, atau (b) kepemilikan lima puluh persen \ +(50%) atau lebih dari saham yang beredar atau kepemilikan menguntungkan \ +\pard\pardeftab720 +\cf0 \cb1 seperti entitas. \ +\ +2. \cb2 Menggunakan diizinkan; Kondisi & Pembatasan. \cb1 Tunduk pada ketentuan \ +dan ketentuan dari Lisensi ini, Apple dengan ini memberikan Anda, efektif pada \ +tanggal Anda menerima Lisensi ini dan download Kode Asli, sebuah \ +\pard\pardeftab720 +\cf0 \cb2 seluruh dunia, bebas royalti, lisensi non-eksklusif, dengan tingkat \ +Hak Paten Apple dan hak cipta meliputi Berlaku Asli \ +\pard\pardeftab720 +\cf0 \cb1 Kode, untuk melakukan hal berikut: \ +\ +2.1 Kode tidak dirubah. Anda dapat menggunakan, mereproduksi, menampilkan, \ +\pard\pardeftab720 +\cf0 \cb2 internal mendistribusikan dalam organisasi Anda, dan Eksternal Deploy \ +\pard\pardeftab720 +\cf0 \cb1 verbatim, dimodifikasi salinan Kode Asli, untuk komersial atau \ +tujuan non-komersial, asalkan dalam setiap contoh: \ +\ +(A) Anda harus mempertahankan dan mereproduksi dalam semua salinan Kode Asli yang \ +\pard\pardeftab720 +\cf0 \cb2 hak cipta dan pemberitahuan hak kepemilikan lainnya dan penolakan dari Apple sebagai \ +mereka muncul dalam Kode Asli, dan tetap utuh semua pemberitahuan yang dibuat dalam \ +\pard\pardeftab720 +\cf0 \cb1 Asli Kode yang mengacu kepada Lisensi ini; dan \ +\ +(B) Anda harus menyertakan sebuah salinan dari Lisensi ini dengan setiap salinan Source \ +Kode Kode Tercakup dan dokumentasi Anda mendistribusikan atau eksternal \ +\pard\pardeftab720 +\cf0 \cb2 Menyebarkan, dan Anda mungkin tidak menawarkan atau memaksakan syarat pada Kode Sumber tersebut \ +yang mengubah atau membatasi Lisensi atau hak penerima ' \ +\pard\pardeftab720 +\cf0 \cb1 bawah ini, kecuali sebagaimana diizinkan dalam Bagian 6. \ +\ +2.2 Modifikasi Kode. Anda dapat memodifikasi Kode Covered dan menggunakan, mereproduksi, \ +menampilkan, melakukan, internal mendistribusikan dalam organisasi Anda, dan \ +Menyebarkan Modifikasi eksternal Anda dan Kode Covered, untuk komersial \ +atau non-komersial, asalkan dalam setiap contoh Anda juga \ +memenuhi semua persyaratan ini: \ +\ +(A) Anda harus memenuhi semua kondisi dari Bagian 2.1 sehubungan dengan \ +Kode Sumber Kode Covered; \ +\ +(B) Anda harus menduplikasi, sejauh itu belum ada, \ +\pard\pardeftab720 +\cf0 \cb2 perhatikan pada Lampiran A di setiap file dari Source Code dari semua Anda \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi, dan menyebabkan file dimodifikasi untuk membawa pemberitahuan menyolok yang \ +menyatakan bahwa Anda mengubah file dan tanggal perubahan tersebut, dan \ +\ +(C) Jika Anda eksternal Menyebarkan modifikasi Anda, Anda harus membuat \ +Kode Sumber dari semua Modifikasi Anda eksternal dikerahkan baik \ +\pard\pardeftab720 +\cf0 \cb2 tersedia untuk mereka kepada siapa Anda harus dikerahkan eksternal Anda \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi, atau tersedia untuk umum. Kode Sumber dari eksternal Anda \ +Modifikasi digunakan harus dirilis dibawah ketentuan yang ditetapkan dalam \ +Lisensi ini, termasuk lisensi hibah diatur dalam Bagian 3 \ +di bawah ini, selama Anda eksternal Menyebarkan Kode Covered atau dua belas \ +(12) bulan dari tanggal Deployment Eksternal awal, mana yang \ +lagi. \cb2 Anda sebaiknya mendistribusikan Kode Sumber Anda \ +\cb1 Eksternal dikerahkan Modifikasi elektronik (download misalnya dari \ +situs web). \ +\ +2.3 Distribusi Versi executable. Selain itu, jika Anda \ +Menyebarkan eksternal Kode Covered (Kode Asli dan / atau Modifikasi) di \ +kode objek, bentuk dieksekusi saja, Anda harus menyertakan menonjol \ +\pard\pardeftab720 +\cf0 \cb2 pemberitahuan, dalam kode itu sendiri serta dalam dokumentasi terkait, \ +\pard\pardeftab720 +\cf0 \cb1 menyatakan bahwa Kode Sumber dari Kode Tercakup tersedia di bawah \ +\pard\pardeftab720 +\cf0 \cb2 Lisensi ini dengan informasi tentang bagaimana dan di mana untuk mendapatkan seperti \ +\pard\pardeftab720 +\cf0 \cb1 Kode Sumber. \ +\ +2.4 Hak Pihak Ketiga. Anda secara tegas mengakui dan menyetujui bahwa \ +\pard\pardeftab720 +\cf0 \cb2 meskipun Apple dan setiap Contributor hibah lisensi untuk mereka \ +\pard\pardeftab720 +\cf0 \cb1 bagian masing-masing Kode Tercakup diuraikan di sini, tidak ada \ +jaminan yang disediakan oleh Apple atau Contributor bahwa Covered \ +Kode tidak melanggar paten atau kekayaan intelektual lain \ +hak dari entitas lain. Apple dan setiap Kontributor melepaskan setiap \ +\pard\pardeftab720 +\cf0 \cb2 kewajiban kepada Anda untuk klaim dibawa oleh setiap entitas lain berdasarkan \ +\pard\pardeftab720 +\cf0 \cb1 pelanggaran hak kekayaan intelektual atau sebaliknya. Sebagai \ +\pard\pardeftab720 +\cf0 \cb2 kondisi untuk melaksanakan hak dan lisensi yang diberikan di bawah ini, Anda \ +\pard\pardeftab720 +\cf0 \cb1 dengan ini mengasumsikan tanggung jawab untuk mengamankan setiap intelektual lainnya \ +hak milik yang dibutuhkan, jika ada. Misalnya, jika paten pihak ketiga \ +lisensi yang diperlukan untuk memungkinkan Anda untuk mendistribusikan Kode Covered, itu \ +Anda bertanggung jawab untuk memperoleh lisensi bahwa sebelum mendistribusikan \ +Kode Covered. \ +\ +3. Hibah Anda. \cb2 Dalam pertimbangan, dan sebagai kondisi untuk, yang \ +\cb1 lisensi yang diberikan kepada Anda di bawah Lisensi ini, Anda dengan ini memberikan kepada \ +orang atau badan yang menerima atau mendistribusikan Kode Covered dibawah ini \ +Lisensi non-eksklusif, bebas royalti, terus-menerus, lisensi tidak dapat dibatalkan, \ +Berlaku Anda di bawah Hak Paten dan kekayaan intelektual lainnya \ +\pard\pardeftab720 +\cf0 \cb2 hak (selain paten) yang dimiliki atau dikendalikan oleh Anda, untuk menggunakan, \ +\pard\pardeftab720 +\cf0 \cb1 mereproduksi, menampilkan, mengubah, mensublisensikan, mendistribusikan dan \ +Menyebarkan Modifikasi eksternal Anda dari lingkup yang sama dan luasnya sebagai \ +Apple lisensi dalam Bagian 2.1 dan 2.2 di atas. \ +\ +4. Pekerjaan lebih besar. Anda dapat membuat pekerjaan yang lebih besar dengan menggabungkan Covered \ +\pard\pardeftab720 +\cf0 \cb2 Kode dengan kode lain tidak diatur oleh ketentuan dari Lisensi ini dan \ +\pard\pardeftab720 +\cf0 \cb1 mendistribusikan Larger Work sebagai produk tunggal. Dalam setiap contoh tersebut, \ +Anda harus memastikan persyaratan Lisensi ini dipenuhi untuk \ +Kode Covered atau bagiannya. \ +\ +5. Keterbatasan pada Lisensi Paten. Kecuali secara tegas dinyatakan dalam \ +Bagian 2, tidak ada hak paten lainnya, tersurat maupun tersirat, yang diberikan oleh \ +Apel di sini. Modifikasi dan / atau lebih besar mungkin memerlukan tambahan Pekerjaan \ +lisensi paten dari Apple Apple yang dapat memberikan dalam sendiri \ +kebijaksanaan. \ +\ +6. Ketentuan Tambahan. \cb2 Anda dapat memilih untuk menawarkan, dan mengenakan biaya untuk, \ +\cb1 garansi, dukungan, ganti rugi atau kewajiban kewajiban dan / atau \ +hak sesuai dengan lingkup lisensi yang diberikan di sini \ +("Ketentuan Tambahan") ke satu atau lebih penerima Kode Covered. \ +Namun, Anda dapat melakukannya hanya atas nama Anda sendiri dan sebagai satu-satunya Anda \ +\pard\pardeftab720 +\cf0 \cb2 tanggung jawab, dan bukan atas nama Apple atau Contributor manapun. \cb1 Anda \ +harus mendapatkan persetujuan penerima bahwa Ketentuan Tambahan tersebut \ +yang ditawarkan oleh Anda sendiri, dan Anda setuju untuk mengganti kerugian, membela, \ +dan tahan Apple dan setiap Kontributor tidak berbahaya untuk segala kewajiban \ +\cb2 dikeluarkan oleh atau klaim menegaskan terhadap Apple atau Contributor tersebut dengan \ +\pard\pardeftab720 +\cf0 \cb1 alasan apapun Ketentuan Tambahan tersebut. \ +\ +7. Versi Lisensi. \cb2 Apple dapat mempublikasikan direvisi dan / atau baru \ +versi dari Lisensi ini dari waktu ke waktu. \cb1 Setiap versi akan diberikan \ +nomor membedakan versi. Setelah Kode asli telah diterbitkan \ +\pard\pardeftab720 +\cf0 \cb2 bawah versi tertentu dari Lisensi ini, Anda dapat terus menggunakannya \ +\pard\pardeftab720 +\cf0 \cb1 di bawah persyaratan versi itu. Anda juga dapat memilih untuk menggunakan seperti \ +\pard\pardeftab720 +\cf0 \cb2 Asli Kode di bawah persyaratan dari setiap versi berikutnya ini \ +\pard\pardeftab720 +\cf0 \cb1 Lisensi diterbitkan oleh Apple. \cb2 Tidak ada yang lain selain Apple memiliki hak untuk \ +\cb1 memodifikasi istilah yang berlaku untuk Kode Covered dibuat di bawah ini \ +Lisensi. \ +\ +8. \cb2 TIDAK ADA JAMINAN ATAU DUKUNGAN. \cb1 Kode Covered mungkin berisi secara keseluruhan atau \ +bagian pra-rilis, belum teruji, atau tidak sepenuhnya diuji bekerja. Para Covered \ +Kode dapat mengandung kesalahan yang dapat menyebabkan kegagalan atau kehilangan data, dan \ +mungkin tidak lengkap atau mengandung ketidakakuratan. Anda secara tegas mengakui \ +\pard\pardeftab720 +\cf0 \cb2 dan setuju bahwa penggunaan Kode Covered, atau bagiannya, adalah di \ +\pard\pardeftab720 +\cf0 \cb1 Anda tunggal dan seluruh risiko. KODE DICAKUP INI DISEDIAKAN "SEBAGAIMANA ADANYA" DAN \ +TANPA JAMINAN, ATAU UPGRADE DUKUNGAN DARI APAPUN DAN APPLE DAN \ +APPLE'S PEMBERI LISENSI (S) (SECARA KOLEKTIF DISEBUT SEBAGAI "APPLE" UNTUK \ +\pard\pardeftab720 +\cf0 \cb2 MAKSUD DARI BAGIAN 8 DAN 9) DAN SEMUA KONTRIBUTOR TEGAS MENOLAK \ +\pard\pardeftab720 +\cf0 \cb1 SEMUA JAMINAN DAN / ATAU KONDISI, TERSURAT MAUPUN TERSIRAT, TERMASUK, NAMUN \ +TIDAK TERBATAS PADA, JAMINAN TERSIRAT DAN / ATAU KETENTUAN \ +DIPERDAGANGKAN, KUALITAS YANG MEMUASKAN, KELAYAKAN UNTUK TUJUAN TERTENTU \ +\pard\pardeftab720 +\cf0 \cb2 TUJUAN, DARI KEAKURATAN, kenikmatan QUIET, DAN NONPELANGGARAN DARI KETIGA \ +\pard\pardeftab720 +\cf0 \cb1 HAK PIHAK. APPLE DAN KONTRIBUTOR SETIAP TIDAK MENJAMIN TERHADAP \ +\pard\pardeftab720 +\cf0 \cb2 GANGGUAN dengan kenikmatan ANDA KODE DICAKUP, BAHWA \ +\pard\pardeftab720 +\cf0 \cb1 FUNGSI YANG TERDAPAT DALAM KODE DICAKUP AKAN MEMENUHI PERSYARATAN ANDA, \ +BAHWA PENGOPERASIAN DARI KODE DICAKUP AKAN TERGANGGU ATAU \ +BEBAS KESALAHAN, ATAU BAHWA CACAT PADA KODE DICAKUP AKAN DIPERBAIKI. NO \ +INFORMASI LISAN MAUPUN TERTULIS ATAU NASIHAT YANG DIBERIKAN OLEH APPLE, AN APPLE \ +PERWAKILAN RESMI ATAU KONTRIBUTOR APAPUN AKAN MENCIPTAKAN JAMINAN. \ +\pard\pardeftab720 +\cf0 \cb2 Anda mengakui bahwa Kode Covered tidak dimaksudkan untuk digunakan dalam \ +\pard\pardeftab720 +\cf0 \cb1 pengoperasian fasilitas nuklir, navigasi pesawat terbang, komunikasi \ +sistem, atau mesin kontrol lalu lintas udara dalam hal kegagalan \ +Kode Covered bisa mengakibatkan kematian, cedera pribadi, atau berat \ +fisik atau kerusakan lingkungan. \ +\ +9. BATASAN TANGGUNG JAWAB. SEPANJANG TIDAK DILARANG OLEH HUKUM, TIDAK DI \ +\pard\pardeftab720 +\cf0 \cb2 KEADAAN APAPUN APPLE ATAU KONTRIBUTOR TIDAK BERTANGGUNG JAWAB UNTUK SETIAP APAPUN INSIDENTAL, \ +\pard\pardeftab720 +\cf0 \cb1 KHUSUS, TIDAK LANGSUNG ATAU KERUSAKAN AKIBAT YANG TIMBUL DARI ATAU BERKAITAN \ +\pard\pardeftab720 +\cf0 \cb2 UNTUK LISENSI INI ATAU PENGGUNAAN ANDA ATAU KETIDAKMAMPUAN UNTUK MENGGUNAKAN KODE DICAKUP, ATAU \ +BAGIAN DARINYA, BAIK BERDASARKAN TEORI KONTRAK, JAMINAN, \ +\pard\pardeftab720 +\cf0 \cb1 KESALAHAN (TERMASUK KELALAIAN), TANGGUNG JAWAB PRODUK ATAU LAINNYA, BAHKAN JIKA \ +APPLE ATAU KONTRIBUTOR TERSEBUT TELAH DIBERITAHUKAN TENTANG KEMUNGKINAN TERSEBUT \ +KERUSAKAN DAN MESKIPUN KEGAGALAN DARI TUJUAN PENTING DARI APAPUN \ +PERBAIKAN. \cb2 BEBERAPA WILAYAH HUKUM TIDAK MENGIZINKAN PEMBATASAN KEWAJIBAN \ +\cb1 KERUSAKAN INSIDENTAL ATAU AKIBAT, SEHINGGA PEMBATASAN INI MUNGKIN TIDAK BERLAKU \ +UNTUK ANDA. Dalam total kewajiban akan ada acara Apple untuk Anda untuk semua \ +kerusakan (selain mungkin diperlukan oleh hukum yang berlaku) di bawah ini \ +\pard\pardeftab720 +\cf0 \cb2 Lisensi melebihi jumlah lima puluh dolar ($ 50.00). \ +\ +\pard\pardeftab720 +\cf0 \cb1 10. Merek Dagang. \cb2 Lisensi ini tidak memberikan hak untuk menggunakan \ +\cb1 merek dagang atau nama dagang "Apple", "Apple Computer", "Mac", "Mac OS", \ +"QuickTime", "QuickTime Streaming Server" atau merek dagang lainnya, \ +\pard\pardeftab720 +\cf0 \cb2 merek layanan, logo atau nama dagang milik Apple (secara kolektif \ +\pard\pardeftab720 +\cf0 \cb1 "Apple Marks") atau merek dagang apapun, merek layanan, logo atau nama dagang \ +milik Contributor manapun. Anda setuju untuk tidak menggunakan Merek Apple di \ +atau sebagai bagian dari nama produk yang berasal dari Kode Asli atau \ +\pard\pardeftab720 +\cf0 \cb2 untuk mendukung atau mempromosikan produk yang berasal dari Kode Asli lainnya \ +dibandingkan secara tegas diizinkan oleh dan sesuai yang ketat setiap saat \ +\pard\pardeftab720 +\cf0 \cb1 dengan merek dagang Apple pedoman ketiga pihak penggunaan yang diposting \ +di http://www.apple.com/legal/guidelinesfor3rdparties.html. \ +\ +11. Kepemilikan. Sesuai dengan lisensi yang diberikan di bawah Lisensi ini, \ +\pard\pardeftab720 +\cf0 \cb2 Kontributor masing mempertahankan semua hak, kepemilikan dan kepentingan dalam dan terhadap setiap \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi yang dilakukan oleh Contributor tersebut. Apel mempertahankan semua hak, \ +judul dan kepentingan dalam dan Kode Asli dan setiap Modifikasi \ +\pard\pardeftab720 +\cf0 \cb2 dilakukan oleh atau atas nama dari Apple ("Apple Modifikasi"), dan Apple seperti \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi tidak akan secara otomatis tunduk kepada Lisensi ini. Apel \ +dapat, atas kebijakannya sendiri, memilih untuk Lisensi Apple seperti \ +Modifikasi di bawah Lisensi ini, atau pada istilah yang berbeda dari yang \ +terkandung dalam Lisensi ini atau mungkin memilih untuk tidak lisensi mereka sama sekali. \ +\ +12. Pemutusan. \ +\ +12.1 Pemutusan. Lisensi ini dan hak yang diberikan berdasarkan perjanjian ini akan \ +mengakhiri: \ +\ +(A) secara otomatis tanpa pemberitahuan dari Apple jika Anda gagal mematuhi \ +\pard\pardeftab720 +\cf0 \cb2 setiap istilah (s) dari Lisensi ini dan gagal untuk menyembuhkan pelanggaran tersebut dalam waktu 30 \ +\pard\pardeftab720 +\cf0 \cb1 hari menyadari pelanggaran tersebut; \ +\ +(B) langsung dalam hal keadaan yang dijelaskan dalam Bagian \ +13.5 (b), atau \ +\ +\pard\pardeftab720 +\cf0 \cb2 (C) secara otomatis tanpa pemberitahuan dari Apple jika Anda, setiap saat selama \ +\pard\pardeftab720 +\cf0 \cb1 istilah dari Lisensi ini, dimulai suatu tindakan atas pelanggaran paten \ +terhadap Apple, dengan ketentuan bahwa Apple tidak pertama dimulai \ +action untuk pelanggaran paten terhadap Anda dalam hal itu. \ +\ +12,2 Efek Penghentian. Setelah pengakhiran, Anda setuju untuk segera \ +menghentikan penggunaan lebih lanjut, reproduksi, modifikasi, sublicensing dan \ +distribusi Kode Covered. \cb2 Semua sublisensi ke Kode Covered \ +\cb1 yang telah benar diberikan sebelum pengakhiran akan bertahan \ +pemutusan Lisensi ini. Ketentuan yang, menurut sifatnya, \ +harus tetap berlaku melampaui penghentian Lisensi ini akan \ +bertahan hidup, termasuk namun tidak terbatas pada Bagian 3, 5, 8, 9, 10, 11, \ +12,2 dan 13. Tidak ada pihak yang akan bertanggung jawab untuk lainnya kompensasi, \ +ganti rugi atau kerusakan apapun semata-mata sebagai akibat penghentian \ +Lisensi ini sesuai dengan ketentuan-ketentuannya, dan pemutusan ini \ +Lisensi akan tanpa mengurangi hak-hak lainnya atau obat dari \ +pihak manapun. \ +\ +13. Miscellaneous. \ +\ +Pengguna-Akhir Pemerintahan 13.1. Kode Covered adalah "barang komersial" sebagaimana \ +ditentukan dalam FAR 2.101. \cb2 Pemerintah perangkat lunak dan data teknis hak-hak \ +\cb1 Kode Covered hanya menyertakan hak-hak yang lazim diberikan kepada \ +umum sebagaimana dimaksud dalam Lisensi ini. Ini lisensi komersial adat \ +\pard\pardeftab720 +\cf0 \cb2 dalam data teknis dan perangkat lunak disediakan sesuai dengan FAR \ +12,211 (Data Teknis) dan 12.212 (Perangkat Lunak Komputer) dan, untuk \ +\pard\pardeftab720 +\cf0 \cb1 Departemen Pertahanan pembelian, DFAR 252.227-7015 (Data Teknis - \ +Produk Komersial) dan 227,7202-3 (Hak di Komputer Komersial \ +Perangkat Lunak atau Dokumentasi Perangkat Lunak Komputer). Oleh karena itu, semua US \ +\pard\pardeftab720 +\cf0 \cb2 Pengguna Akhir Pemerintah memperoleh Kode Ditutupi dengan hanya hak-hak yang \ +\pard\pardeftab720 +\cf0 \cb1 sebagainya di sini. \ +\ +13.2 Hubungan Para Pihak. \cb2 Lisensi ini tidak akan ditafsirkan sebagai \ +\cb1 menciptakan agen, kemitraan, joint venture atau bentuk lainnya \ +\pard\pardeftab720 +\cf0 \cb2 hukum hubungan antara atau di antara Anda, Apple atau Contributor manapun, dan \ +Anda tidak akan mewakili sebaliknya, apakah tegas, oleh \ +Implikasinya, penampilan atau sebaliknya. \ +\ +\pard\pardeftab720 +\cf0 \cb1 13,3 Independen Pembangunan. \cb2 Tidak ada dalam Lisensi ini akan mengganggu \ +Hak Apple untuk memperoleh, lisensi, mengembangkan, memiliki orang lain mengembangkan untuk \ +itu, pasar dan / atau mendistribusikan teknologi atau produk yang melakukan \ +\cb1 fungsi yang sama atau mirip sebagai, atau bersaing dengan, \ +Modifikasi, Pekerjaan yang lebih besar, teknologi atau produk yang Anda mungkin \ +mengembangkan, memproduksi, memasarkan atau mendistribusikan. \ +\ +Pelepasan 13,4; Konstruksi. Kegagalan oleh Apple atau Contributor untuk \ +melaksanakan setiap ketentuan dari Lisensi ini tidak akan dianggap sebagai pengabaian \ +masa depan penegakan itu atau ketentuan lainnya. Setiap hukum atau \ +\pard\pardeftab720 +\cf0 \cb2 regulasi yang mengatur bahwa bahasa kontrak harus \ +\pard\pardeftab720 +\cf0 \cb1 ditafsirkan terhadap drafter tidak akan berlaku untuk Lisensi ini. \ +\ +13.5 Pemutusan. (A) Jika karena alasan apapun pengadilan yang kompeten \ +yurisdiksi menemukan ada ketentuan dari Lisensi ini, atau bagian daripadanya, \ +tidak dapat ditegakkan, bahwa ketentuan dari Lisensi akan ditegakkan untuk \ +maksimum yang diizinkan sejauh sehingga efek manfaat ekonomi \ +\pard\pardeftab720 +\cf0 \cb2 dan maksud dari para pihak, dan sisanya dari Lisensi ini akan \ +\pard\pardeftab720 +\cf0 \cb1 terus berlaku sepenuhnya. (B) Sekalipun demikian, \ +jika hukum yang berlaku melarang atau membatasi Anda dari sepenuhnya dan / atau \ +khusus sesuai dengan Bagian 2 dan / atau 3 atau mencegah \ +terlaksananya salah satu dari mereka Bagian, Lisensi ini akan \ +segera mengakhiri dan Anda harus segera menghentikan setiap penggunaan \ +yang Covered Kode dan menghancurkan semua salinan itu yang dalam Anda \ +kepemilikan atau kontrol. \ +\ +13,6 Penyelesaian Sengketa. Setiap litigasi atau penyelesaian sengketa lainnya \ +antara Anda dan Apple yang berkaitan dengan Lisensi ini akan berlangsung di \ +Distrik Utara California, dan Anda dan Apple dengan ini setuju \ +yurisdiksi pribadi, dan tempat di, negara bagian dan federal \ +pengadilan dalam Distrik yang sehubungan dengan Lisensi ini. Para \ +penerapan Konvensi PBB tentang Kontrak \ +Barang Internasional secara tegas dikecualikan. \ +\ +13,7 Seluruh Perjanjian; Hukum. Lisensi ini merupakan \ +seluruh kesepakatan antara para pihak sehubungan dengan subjek \ +materi perjanjian ini. Lisensi ini diatur oleh hukum \ +Amerika Serikat dan Negara Bagian California, kecuali bahwa tubuh \ +Hukum California mengenai konflik hukum. \ +\ +\pard\pardeftab720 +\cf0 \cb2 Dimana Anda berada di provinsi Quebec, Kanada, berikut \ +klausul berlaku: Para pihak dengan ini mengkonfirmasi bahwa mereka telah meminta \ +\pard\pardeftab720 +\cf0 \cb1 bahwa Lisensi ini dan semua dokumen terkait disusun dalam bahasa Inggris. Les \ +\pard\pardeftab720 +\cf0 \cb2 pihak ONT Exige que le contrat et tous hadir les dokumen \ +\pard\pardeftab720 +\cf0 \cb1 connexes soient en Anglais rediges. \ +\ +Bukti A. \ +\ +\pard\pardeftab720 +\cf0 \cb2 "Bagian Copyright (c) 1999-2003 Apple Computer, Inc Semua Hak \ +\pard\pardeftab720 +\cf0 \cb1 Dilindungi. \ +\ +File ini berisi Kode Asli dan / atau Modifikasi Kode Asli \ +sebagaimana didefinisikan dalam dan yang tunduk kepada Lisensi Publik Sumber Apple \ +Versi 2.0 ('Lisensi'). \cb2 Anda tidak dapat menggunakan file ini kecuali dalam \ +\cb1 sesuai dengan Lisensi. Silahkan memperoleh salinan Lisensi di \ +http://www.opensource.apple.com/apsl/ dan membacanya sebelum menggunakan \ +file. \ +\ +Kode asli dan semua perangkat lunak didistribusikan di bawah Lisensi ini \ +didistribusikan pada 'SEBAGAIMANA ADANYA' dasar, TANPA JAMINAN APAPUN, BAIK \ +\pard\pardeftab720 +\cf0 \cb2 TERSURAT MAUPUN TERSIRAT, DAN APPLE DENGAN INI MENYANGKAL SEMUA JAMINAN TERSEBUT, \ +\pard\pardeftab720 +\cf0 \cb1 TERMASUK TANPA TERBATAS, SEGALA GARANSI PENJUALAN, \ +KESESUAIAN UNTUK TUJUAN TERTENTU, kenikmatan QUIET ATAU NON-PELANGGARAN. \ +\pard\pardeftab720 +\cf0 \cb2 Silahkan lihat Lisensi untuk bahasa tertentu yang mengatur hak dan \ +\pard\pardeftab720 +\cf0 \cb1 keterbatasan di bawah Lisensi. "} diff --git a/package/Resources.old/id.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/id.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..8d034a4 Binary files /dev/null and b/package/Resources.old/id.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..c18d235 --- /dev/null +++ b/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..2a2a37c --- /dev/null +++ b/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/id.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:03.000000Z +146242d9aeb493a0dcc72382d0bc9059 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +880 + diff --git a/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..cbbee16 --- /dev/null +++ b/package/Resources.old/id.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skrip ini telah selesai dan telah disematkan pada\ + berkas \cf2 @LOG_FILENAME@\cf3 yang ditaruh di\ +direktori utama dari partisi yang terinstall.\ +\ +\cf0 Silahkan \cf4 baca\cf0 berkas itu dan perhatikan apakah instalasi telah\ +sukses, dan simpan berkas tersebut jika selesai.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Hak kopi \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/id.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/id.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..cbbee16 --- /dev/null +++ b/package/Resources.old/id.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skrip ini telah selesai dan telah disematkan pada\ + berkas \cf2 @LOG_FILENAME@\cf3 yang ditaruh di\ +direktori utama dari partisi yang terinstall.\ +\ +\cf0 Silahkan \cf4 baca\cf0 berkas itu dan perhatikan apakah instalasi telah\ +sukses, dan simpan berkas tersebut jika selesai.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Hak kopi \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/id.lproj/Description.html b/package/Resources.old/id.lproj/Description.html new file mode 100644 index 0000000..e43fb8c --- /dev/null +++ b/package/Resources.old/id.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon adalah kombinasi dari berbagai macam komponen boot loader. Berbasiskan implementasi EFI palsu oleh David Elliott yang ditambahkan pada proyek Apple’s Boot-132

+


+

Fitur terbaru di Chameleon 2.0

+


+

- GUI yang dapat diubah-suaikan dengan bebas untuk mewarnai Bootloader Darwin.

+

- Jalankan DVD retail secara langsung dengan memuat sebuah image ramdisk tanpa bantuan program lain.

+

- Hibernasi. Nikmati melanjutkan pekerjaan pada Mac OS X anda dengan “pratinjau image”.

+

- SMBIOS override unutk memodifikasi SMBIOS bawaan.

+

- DSDT override unutk menggunakan modifikasi tertentu dari DSDT yang dapat menyelesaikan isu-isu tertentu.

+

- Device Property Injection melalui string device-properties.

+

- hybrid boot0 / boot1h for MBR dan Media partisi GPT.

+

- Pendeteksian kode FSB Secara otomatis walaupun pada PC AMD.

+

- Dukungan Apple Software RAID.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Untuk informasi lebih lanjut, kunjungi: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/id.lproj/License.rtf b/package/Resources.old/id.lproj/License.rtf new file mode 100644 index 0000000..90f6841 --- /dev/null +++ b/package/Resources.old/id.lproj/License.rtf @@ -0,0 +1,446 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138 +{\fonttbl\f0\froman\fcharset0 Times-Roman;} +{\colortbl;\red255\green255\blue255;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww25400\viewh19520\viewkind0 +\deftab720 +\pard\pardeftab720 + +\f0\fs24 \cf0 \cb2 APPLE LISENSI PUBLIK SUMBER \ +Versi 2.0 - 6 Agustus 2003 \ +\ +Silakan baca Lisensi ini dengan seksama sebelum men-download software ini. Dengan men-download atau menggunakan software ini, Anda setuju untuk terikat oleh syarat-syarat Lisensi ini. Jika Anda tidak atau tidak dapat setuju dengan persyaratan Lisensi ini, jangan mengunduh atau menggunakan perangkat lunak. \ +\ +\pard\pardeftab720 +\cf0 \cb1 1. Umum; Definisi. \cb2 Lisensi ini berlaku untuk setiap program atau pekerjaan lain yang Apple Computer, Inc ("Apple") membuat tersedia untuk umum dan yang memuat pemberitahuan yang ditempatkan oleh Apple mengidentifikasi program seperti atau bekerja sebagai "Kode Asli" dan menyatakan bahwa itu adalah tunduk pada syarat \cb1 ini Sumber Lisensi Apple Publik versi 2.0 ("Lisensi"). Sebagaimana digunakan dalam Perjanjian Lisensi ini: \ +\ +\pard\pardeftab720 +\cf0 \cb2 1.1 "Hak Paten Berlaku" berarti: (a) dalam kasus di mana Apple adalah pemberi hak, (i) klaim paten yang sekarang atau selanjutnya diakuisisi, dimiliki oleh atau ditugaskan untuk Apple dan (ii) bahwa subjek penutup yang terkandung dalam Kode Asli, tetapi hanya sejauh yang diperlukan untuk menggunakan, mereproduksi dan / atau mendistribusikan Kode Asli tanpa pelanggaran; dan (b) dalam kasus di mana Anda adalah pemberi hak, (i) klaim paten yang sekarang atau selanjutnya diakuisisi, dimiliki oleh atau ditugaskan untuk Anda dan (ii) bahwa subjek meliputi materi di modifikasi Anda, dilakukan sendiri atau dalam kombinasi dengan Kode Asli. \ +\ +\pard\pardeftab720 +\cf0 \cb1 1.2 "Kontributor" berarti setiap orang atau entitas yang menciptakan atau memberikan kontribusi terhadap penciptaan Modifikasi. \ +\ +\pard\pardeftab720 +\cf0 \cb2 1,3 "Kode Covered" berarti Kode Asli, Modifikasi, kombinasi Kode Asli dan setiap Modifikasi, dan / atau bagian masing-masing daripadanya. \ +\ +1,4 "eksternal Menyebarkan" berarti: (a) untuk mensublisensikan, mendistribusikan atau sebaliknya membuat Kode Covered tersedia, secara langsung atau tidak langsung, kepada siapa pun selain Engkau; dan / atau (b) untuk menggunakan Kode Covered, sendirian atau sebagai bagian dari pekerjaan yang lebih besar , dengan cara apapun untuk memberikan layanan, termasuk tetapi tidak terbatas pada pengiriman konten, melalui komunikasi elektronik dengan klien lain selain Anda. \ +\ +1,5 "Larger Work" berarti sebuah karya yang menggabungkan Kode Covered atau bagian-bagiannya dengan kode tidak diatur oleh ketentuan Lisensi ini. \ +\ +\pard\pardeftab720 +\cf0 \cb1 1,6 "Modifikasi" berarti setiap tambahan, penghapusan dari, dan / atau mengubah \ +untuk, substansi dan / atau struktur dari Kode Asli, apapun sebelumnya \ +\pard\pardeftab720 +\cf0 \cb2 Modifikasi, kombinasi Kode Asli dan apapun sebelumnya \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi, dan / atau bagian masing-masing daripadanya. Bila kode \ +dirilis sebagai serangkaian file, Modifikasi adalah: (a) setiap tambahan \ +\pard\pardeftab720 +\cf0 \cb2 atau penghapusan dari isi file yang berisi Kode Covered; \ +\pard\pardeftab720 +\cf0 \cb1 dan / atau (b) setiap file baru atau representasi lain dari program komputer \ +pernyataan yang mengandung bagian dari Kode Covered. \ +\ +1,7 "Kode Asli" berarti (a) Source Code program atau lainnya \ +bekerja sebagai awalnya dibuat tersedia oleh Apple di bawah Lisensi ini, \ +termasuk Source Code dari setiap update atau upgrade untuk program seperti \ +\pard\pardeftab720 +\cf0 \cb2 atau karya yang dibuat tersedia oleh Apple di bawah Lisensi ini, dan yang telah \ +\pard\pardeftab720 +\cf0 \cb1 tegas diidentifikasi oleh Apple seperti itu dalam header file (s) seperti \ +\pard\pardeftab720 +\cf0 \cb2 pekerjaan, dan (b) kode objek dikompilasi dari Source Code tersebut dan \ +\pard\pardeftab720 +\cf0 \cb1 awalnya disediakan oleh Apple di bawah Lisensi ini. \ +\ +1,8 "Kode Sumber" berarti bentuk yang dapat dibaca manusia dari sebuah program atau \ +pekerjaan yang cocok untuk membuat modifikasi untuk itu, termasuk semua \ +modul yang dikandungnya, ditambah berkas-berkas definisi antarmuka yang terkait, \ +\pard\pardeftab720 +\cf0 \cb2 script yang digunakan untuk mengendalikan kompilasi dan instalasi dieksekusi \ +\pard\pardeftab720 +\cf0 \cb1 (Kode objek). \ +\ +1,9 "Anda" atau "Anda" berarti seorang individu atau badan hukum berolahraga \ +hak di bawah Lisensi ini. Untuk badan hukum, "Anda" atau "Anda" \ +termasuk setiap entitas yang mengendalikan, dikendalikan oleh, atau berada di bawah \ +\pard\pardeftab720 +\cf0 \cb2 pengendalian bersama dengan, Anda, dimana "kontrol" berarti (a) kekuasaan, langsung \ +atau tidak langsung, menyebabkan arah atau manajemen entitas tersebut, \ +apakah dengan kontrak atau sebaliknya, atau (b) kepemilikan lima puluh persen \ +(50%) atau lebih dari saham yang beredar atau kepemilikan menguntungkan \ +\pard\pardeftab720 +\cf0 \cb1 seperti entitas. \ +\ +2. \cb2 Menggunakan diizinkan; Kondisi & Pembatasan. \cb1 Tunduk pada ketentuan \ +dan ketentuan dari Lisensi ini, Apple dengan ini memberikan Anda, efektif pada \ +tanggal Anda menerima Lisensi ini dan download Kode Asli, sebuah \ +\pard\pardeftab720 +\cf0 \cb2 seluruh dunia, bebas royalti, lisensi non-eksklusif, dengan tingkat \ +Hak Paten Apple dan hak cipta meliputi Berlaku Asli \ +\pard\pardeftab720 +\cf0 \cb1 Kode, untuk melakukan hal berikut: \ +\ +2.1 Kode tidak dirubah. Anda dapat menggunakan, mereproduksi, menampilkan, \ +\pard\pardeftab720 +\cf0 \cb2 internal mendistribusikan dalam organisasi Anda, dan Eksternal Deploy \ +\pard\pardeftab720 +\cf0 \cb1 verbatim, dimodifikasi salinan Kode Asli, untuk komersial atau \ +tujuan non-komersial, asalkan dalam setiap contoh: \ +\ +(A) Anda harus mempertahankan dan mereproduksi dalam semua salinan Kode Asli yang \ +\pard\pardeftab720 +\cf0 \cb2 hak cipta dan pemberitahuan hak kepemilikan lainnya dan penolakan dari Apple sebagai \ +mereka muncul dalam Kode Asli, dan tetap utuh semua pemberitahuan yang dibuat dalam \ +\pard\pardeftab720 +\cf0 \cb1 Asli Kode yang mengacu kepada Lisensi ini; dan \ +\ +(B) Anda harus menyertakan sebuah salinan dari Lisensi ini dengan setiap salinan Source \ +Kode Kode Tercakup dan dokumentasi Anda mendistribusikan atau eksternal \ +\pard\pardeftab720 +\cf0 \cb2 Menyebarkan, dan Anda mungkin tidak menawarkan atau memaksakan syarat pada Kode Sumber tersebut \ +yang mengubah atau membatasi Lisensi atau hak penerima ' \ +\pard\pardeftab720 +\cf0 \cb1 bawah ini, kecuali sebagaimana diizinkan dalam Bagian 6. \ +\ +2.2 Modifikasi Kode. Anda dapat memodifikasi Kode Covered dan menggunakan, mereproduksi, \ +menampilkan, melakukan, internal mendistribusikan dalam organisasi Anda, dan \ +Menyebarkan Modifikasi eksternal Anda dan Kode Covered, untuk komersial \ +atau non-komersial, asalkan dalam setiap contoh Anda juga \ +memenuhi semua persyaratan ini: \ +\ +(A) Anda harus memenuhi semua kondisi dari Bagian 2.1 sehubungan dengan \ +Kode Sumber Kode Covered; \ +\ +(B) Anda harus menduplikasi, sejauh itu belum ada, \ +\pard\pardeftab720 +\cf0 \cb2 perhatikan pada Lampiran A di setiap file dari Source Code dari semua Anda \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi, dan menyebabkan file dimodifikasi untuk membawa pemberitahuan menyolok yang \ +menyatakan bahwa Anda mengubah file dan tanggal perubahan tersebut, dan \ +\ +(C) Jika Anda eksternal Menyebarkan modifikasi Anda, Anda harus membuat \ +Kode Sumber dari semua Modifikasi Anda eksternal dikerahkan baik \ +\pard\pardeftab720 +\cf0 \cb2 tersedia untuk mereka kepada siapa Anda harus dikerahkan eksternal Anda \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi, atau tersedia untuk umum. Kode Sumber dari eksternal Anda \ +Modifikasi digunakan harus dirilis dibawah ketentuan yang ditetapkan dalam \ +Lisensi ini, termasuk lisensi hibah diatur dalam Bagian 3 \ +di bawah ini, selama Anda eksternal Menyebarkan Kode Covered atau dua belas \ +(12) bulan dari tanggal Deployment Eksternal awal, mana yang \ +lagi. \cb2 Anda sebaiknya mendistribusikan Kode Sumber Anda \ +\cb1 Eksternal dikerahkan Modifikasi elektronik (download misalnya dari \ +situs web). \ +\ +2.3 Distribusi Versi executable. Selain itu, jika Anda \ +Menyebarkan eksternal Kode Covered (Kode Asli dan / atau Modifikasi) di \ +kode objek, bentuk dieksekusi saja, Anda harus menyertakan menonjol \ +\pard\pardeftab720 +\cf0 \cb2 pemberitahuan, dalam kode itu sendiri serta dalam dokumentasi terkait, \ +\pard\pardeftab720 +\cf0 \cb1 menyatakan bahwa Kode Sumber dari Kode Tercakup tersedia di bawah \ +\pard\pardeftab720 +\cf0 \cb2 Lisensi ini dengan informasi tentang bagaimana dan di mana untuk mendapatkan seperti \ +\pard\pardeftab720 +\cf0 \cb1 Kode Sumber. \ +\ +2.4 Hak Pihak Ketiga. Anda secara tegas mengakui dan menyetujui bahwa \ +\pard\pardeftab720 +\cf0 \cb2 meskipun Apple dan setiap Contributor hibah lisensi untuk mereka \ +\pard\pardeftab720 +\cf0 \cb1 bagian masing-masing Kode Tercakup diuraikan di sini, tidak ada \ +jaminan yang disediakan oleh Apple atau Contributor bahwa Covered \ +Kode tidak melanggar paten atau kekayaan intelektual lain \ +hak dari entitas lain. Apple dan setiap Kontributor melepaskan setiap \ +\pard\pardeftab720 +\cf0 \cb2 kewajiban kepada Anda untuk klaim dibawa oleh setiap entitas lain berdasarkan \ +\pard\pardeftab720 +\cf0 \cb1 pelanggaran hak kekayaan intelektual atau sebaliknya. Sebagai \ +\pard\pardeftab720 +\cf0 \cb2 kondisi untuk melaksanakan hak dan lisensi yang diberikan di bawah ini, Anda \ +\pard\pardeftab720 +\cf0 \cb1 dengan ini mengasumsikan tanggung jawab untuk mengamankan setiap intelektual lainnya \ +hak milik yang dibutuhkan, jika ada. Misalnya, jika paten pihak ketiga \ +lisensi yang diperlukan untuk memungkinkan Anda untuk mendistribusikan Kode Covered, itu \ +Anda bertanggung jawab untuk memperoleh lisensi bahwa sebelum mendistribusikan \ +Kode Covered. \ +\ +3. Hibah Anda. \cb2 Dalam pertimbangan, dan sebagai kondisi untuk, yang \ +\cb1 lisensi yang diberikan kepada Anda di bawah Lisensi ini, Anda dengan ini memberikan kepada \ +orang atau badan yang menerima atau mendistribusikan Kode Covered dibawah ini \ +Lisensi non-eksklusif, bebas royalti, terus-menerus, lisensi tidak dapat dibatalkan, \ +Berlaku Anda di bawah Hak Paten dan kekayaan intelektual lainnya \ +\pard\pardeftab720 +\cf0 \cb2 hak (selain paten) yang dimiliki atau dikendalikan oleh Anda, untuk menggunakan, \ +\pard\pardeftab720 +\cf0 \cb1 mereproduksi, menampilkan, mengubah, mensublisensikan, mendistribusikan dan \ +Menyebarkan Modifikasi eksternal Anda dari lingkup yang sama dan luasnya sebagai \ +Apple lisensi dalam Bagian 2.1 dan 2.2 di atas. \ +\ +4. Pekerjaan lebih besar. Anda dapat membuat pekerjaan yang lebih besar dengan menggabungkan Covered \ +\pard\pardeftab720 +\cf0 \cb2 Kode dengan kode lain tidak diatur oleh ketentuan dari Lisensi ini dan \ +\pard\pardeftab720 +\cf0 \cb1 mendistribusikan Larger Work sebagai produk tunggal. Dalam setiap contoh tersebut, \ +Anda harus memastikan persyaratan Lisensi ini dipenuhi untuk \ +Kode Covered atau bagiannya. \ +\ +5. Keterbatasan pada Lisensi Paten. Kecuali secara tegas dinyatakan dalam \ +Bagian 2, tidak ada hak paten lainnya, tersurat maupun tersirat, yang diberikan oleh \ +Apel di sini. Modifikasi dan / atau lebih besar mungkin memerlukan tambahan Pekerjaan \ +lisensi paten dari Apple Apple yang dapat memberikan dalam sendiri \ +kebijaksanaan. \ +\ +6. Ketentuan Tambahan. \cb2 Anda dapat memilih untuk menawarkan, dan mengenakan biaya untuk, \ +\cb1 garansi, dukungan, ganti rugi atau kewajiban kewajiban dan / atau \ +hak sesuai dengan lingkup lisensi yang diberikan di sini \ +("Ketentuan Tambahan") ke satu atau lebih penerima Kode Covered. \ +Namun, Anda dapat melakukannya hanya atas nama Anda sendiri dan sebagai satu-satunya Anda \ +\pard\pardeftab720 +\cf0 \cb2 tanggung jawab, dan bukan atas nama Apple atau Contributor manapun. \cb1 Anda \ +harus mendapatkan persetujuan penerima bahwa Ketentuan Tambahan tersebut \ +yang ditawarkan oleh Anda sendiri, dan Anda setuju untuk mengganti kerugian, membela, \ +dan tahan Apple dan setiap Kontributor tidak berbahaya untuk segala kewajiban \ +\cb2 dikeluarkan oleh atau klaim menegaskan terhadap Apple atau Contributor tersebut dengan \ +\pard\pardeftab720 +\cf0 \cb1 alasan apapun Ketentuan Tambahan tersebut. \ +\ +7. Versi Lisensi. \cb2 Apple dapat mempublikasikan direvisi dan / atau baru \ +versi dari Lisensi ini dari waktu ke waktu. \cb1 Setiap versi akan diberikan \ +nomor membedakan versi. Setelah Kode asli telah diterbitkan \ +\pard\pardeftab720 +\cf0 \cb2 bawah versi tertentu dari Lisensi ini, Anda dapat terus menggunakannya \ +\pard\pardeftab720 +\cf0 \cb1 di bawah persyaratan versi itu. Anda juga dapat memilih untuk menggunakan seperti \ +\pard\pardeftab720 +\cf0 \cb2 Asli Kode di bawah persyaratan dari setiap versi berikutnya ini \ +\pard\pardeftab720 +\cf0 \cb1 Lisensi diterbitkan oleh Apple. \cb2 Tidak ada yang lain selain Apple memiliki hak untuk \ +\cb1 memodifikasi istilah yang berlaku untuk Kode Covered dibuat di bawah ini \ +Lisensi. \ +\ +8. \cb2 TIDAK ADA JAMINAN ATAU DUKUNGAN. \cb1 Kode Covered mungkin berisi secara keseluruhan atau \ +bagian pra-rilis, belum teruji, atau tidak sepenuhnya diuji bekerja. Para Covered \ +Kode dapat mengandung kesalahan yang dapat menyebabkan kegagalan atau kehilangan data, dan \ +mungkin tidak lengkap atau mengandung ketidakakuratan. Anda secara tegas mengakui \ +\pard\pardeftab720 +\cf0 \cb2 dan setuju bahwa penggunaan Kode Covered, atau bagiannya, adalah di \ +\pard\pardeftab720 +\cf0 \cb1 Anda tunggal dan seluruh risiko. KODE DICAKUP INI DISEDIAKAN "SEBAGAIMANA ADANYA" DAN \ +TANPA JAMINAN, ATAU UPGRADE DUKUNGAN DARI APAPUN DAN APPLE DAN \ +APPLE'S PEMBERI LISENSI (S) (SECARA KOLEKTIF DISEBUT SEBAGAI "APPLE" UNTUK \ +\pard\pardeftab720 +\cf0 \cb2 MAKSUD DARI BAGIAN 8 DAN 9) DAN SEMUA KONTRIBUTOR TEGAS MENOLAK \ +\pard\pardeftab720 +\cf0 \cb1 SEMUA JAMINAN DAN / ATAU KONDISI, TERSURAT MAUPUN TERSIRAT, TERMASUK, NAMUN \ +TIDAK TERBATAS PADA, JAMINAN TERSIRAT DAN / ATAU KETENTUAN \ +DIPERDAGANGKAN, KUALITAS YANG MEMUASKAN, KELAYAKAN UNTUK TUJUAN TERTENTU \ +\pard\pardeftab720 +\cf0 \cb2 TUJUAN, DARI KEAKURATAN, kenikmatan QUIET, DAN NONPELANGGARAN DARI KETIGA \ +\pard\pardeftab720 +\cf0 \cb1 HAK PIHAK. APPLE DAN KONTRIBUTOR SETIAP TIDAK MENJAMIN TERHADAP \ +\pard\pardeftab720 +\cf0 \cb2 GANGGUAN dengan kenikmatan ANDA KODE DICAKUP, BAHWA \ +\pard\pardeftab720 +\cf0 \cb1 FUNGSI YANG TERDAPAT DALAM KODE DICAKUP AKAN MEMENUHI PERSYARATAN ANDA, \ +BAHWA PENGOPERASIAN DARI KODE DICAKUP AKAN TERGANGGU ATAU \ +BEBAS KESALAHAN, ATAU BAHWA CACAT PADA KODE DICAKUP AKAN DIPERBAIKI. NO \ +INFORMASI LISAN MAUPUN TERTULIS ATAU NASIHAT YANG DIBERIKAN OLEH APPLE, AN APPLE \ +PERWAKILAN RESMI ATAU KONTRIBUTOR APAPUN AKAN MENCIPTAKAN JAMINAN. \ +\pard\pardeftab720 +\cf0 \cb2 Anda mengakui bahwa Kode Covered tidak dimaksudkan untuk digunakan dalam \ +\pard\pardeftab720 +\cf0 \cb1 pengoperasian fasilitas nuklir, navigasi pesawat terbang, komunikasi \ +sistem, atau mesin kontrol lalu lintas udara dalam hal kegagalan \ +Kode Covered bisa mengakibatkan kematian, cedera pribadi, atau berat \ +fisik atau kerusakan lingkungan. \ +\ +9. BATASAN TANGGUNG JAWAB. SEPANJANG TIDAK DILARANG OLEH HUKUM, TIDAK DI \ +\pard\pardeftab720 +\cf0 \cb2 KEADAAN APAPUN APPLE ATAU KONTRIBUTOR TIDAK BERTANGGUNG JAWAB UNTUK SETIAP APAPUN INSIDENTAL, \ +\pard\pardeftab720 +\cf0 \cb1 KHUSUS, TIDAK LANGSUNG ATAU KERUSAKAN AKIBAT YANG TIMBUL DARI ATAU BERKAITAN \ +\pard\pardeftab720 +\cf0 \cb2 UNTUK LISENSI INI ATAU PENGGUNAAN ANDA ATAU KETIDAKMAMPUAN UNTUK MENGGUNAKAN KODE DICAKUP, ATAU \ +BAGIAN DARINYA, BAIK BERDASARKAN TEORI KONTRAK, JAMINAN, \ +\pard\pardeftab720 +\cf0 \cb1 KESALAHAN (TERMASUK KELALAIAN), TANGGUNG JAWAB PRODUK ATAU LAINNYA, BAHKAN JIKA \ +APPLE ATAU KONTRIBUTOR TERSEBUT TELAH DIBERITAHUKAN TENTANG KEMUNGKINAN TERSEBUT \ +KERUSAKAN DAN MESKIPUN KEGAGALAN DARI TUJUAN PENTING DARI APAPUN \ +PERBAIKAN. \cb2 BEBERAPA WILAYAH HUKUM TIDAK MENGIZINKAN PEMBATASAN KEWAJIBAN \ +\cb1 KERUSAKAN INSIDENTAL ATAU AKIBAT, SEHINGGA PEMBATASAN INI MUNGKIN TIDAK BERLAKU \ +UNTUK ANDA. Dalam total kewajiban akan ada acara Apple untuk Anda untuk semua \ +kerusakan (selain mungkin diperlukan oleh hukum yang berlaku) di bawah ini \ +\pard\pardeftab720 +\cf0 \cb2 Lisensi melebihi jumlah lima puluh dolar ($ 50.00). \ +\ +\pard\pardeftab720 +\cf0 \cb1 10. Merek Dagang. \cb2 Lisensi ini tidak memberikan hak untuk menggunakan \ +\cb1 merek dagang atau nama dagang "Apple", "Apple Computer", "Mac", "Mac OS", \ +"QuickTime", "QuickTime Streaming Server" atau merek dagang lainnya, \ +\pard\pardeftab720 +\cf0 \cb2 merek layanan, logo atau nama dagang milik Apple (secara kolektif \ +\pard\pardeftab720 +\cf0 \cb1 "Apple Marks") atau merek dagang apapun, merek layanan, logo atau nama dagang \ +milik Contributor manapun. Anda setuju untuk tidak menggunakan Merek Apple di \ +atau sebagai bagian dari nama produk yang berasal dari Kode Asli atau \ +\pard\pardeftab720 +\cf0 \cb2 untuk mendukung atau mempromosikan produk yang berasal dari Kode Asli lainnya \ +dibandingkan secara tegas diizinkan oleh dan sesuai yang ketat setiap saat \ +\pard\pardeftab720 +\cf0 \cb1 dengan merek dagang Apple pedoman ketiga pihak penggunaan yang diposting \ +di http://www.apple.com/legal/guidelinesfor3rdparties.html. \ +\ +11. Kepemilikan. Sesuai dengan lisensi yang diberikan di bawah Lisensi ini, \ +\pard\pardeftab720 +\cf0 \cb2 Kontributor masing mempertahankan semua hak, kepemilikan dan kepentingan dalam dan terhadap setiap \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi yang dilakukan oleh Contributor tersebut. Apel mempertahankan semua hak, \ +judul dan kepentingan dalam dan Kode Asli dan setiap Modifikasi \ +\pard\pardeftab720 +\cf0 \cb2 dilakukan oleh atau atas nama dari Apple ("Apple Modifikasi"), dan Apple seperti \ +\pard\pardeftab720 +\cf0 \cb1 Modifikasi tidak akan secara otomatis tunduk kepada Lisensi ini. Apel \ +dapat, atas kebijakannya sendiri, memilih untuk Lisensi Apple seperti \ +Modifikasi di bawah Lisensi ini, atau pada istilah yang berbeda dari yang \ +terkandung dalam Lisensi ini atau mungkin memilih untuk tidak lisensi mereka sama sekali. \ +\ +12. Pemutusan. \ +\ +12.1 Pemutusan. Lisensi ini dan hak yang diberikan berdasarkan perjanjian ini akan \ +mengakhiri: \ +\ +(A) secara otomatis tanpa pemberitahuan dari Apple jika Anda gagal mematuhi \ +\pard\pardeftab720 +\cf0 \cb2 setiap istilah (s) dari Lisensi ini dan gagal untuk menyembuhkan pelanggaran tersebut dalam waktu 30 \ +\pard\pardeftab720 +\cf0 \cb1 hari menyadari pelanggaran tersebut; \ +\ +(B) langsung dalam hal keadaan yang dijelaskan dalam Bagian \ +13.5 (b), atau \ +\ +\pard\pardeftab720 +\cf0 \cb2 (C) secara otomatis tanpa pemberitahuan dari Apple jika Anda, setiap saat selama \ +\pard\pardeftab720 +\cf0 \cb1 istilah dari Lisensi ini, dimulai suatu tindakan atas pelanggaran paten \ +terhadap Apple, dengan ketentuan bahwa Apple tidak pertama dimulai \ +action untuk pelanggaran paten terhadap Anda dalam hal itu. \ +\ +12,2 Efek Penghentian. Setelah pengakhiran, Anda setuju untuk segera \ +menghentikan penggunaan lebih lanjut, reproduksi, modifikasi, sublicensing dan \ +distribusi Kode Covered. \cb2 Semua sublisensi ke Kode Covered \ +\cb1 yang telah benar diberikan sebelum pengakhiran akan bertahan \ +pemutusan Lisensi ini. Ketentuan yang, menurut sifatnya, \ +harus tetap berlaku melampaui penghentian Lisensi ini akan \ +bertahan hidup, termasuk namun tidak terbatas pada Bagian 3, 5, 8, 9, 10, 11, \ +12,2 dan 13. Tidak ada pihak yang akan bertanggung jawab untuk lainnya kompensasi, \ +ganti rugi atau kerusakan apapun semata-mata sebagai akibat penghentian \ +Lisensi ini sesuai dengan ketentuan-ketentuannya, dan pemutusan ini \ +Lisensi akan tanpa mengurangi hak-hak lainnya atau obat dari \ +pihak manapun. \ +\ +13. Miscellaneous. \ +\ +Pengguna-Akhir Pemerintahan 13.1. Kode Covered adalah "barang komersial" sebagaimana \ +ditentukan dalam FAR 2.101. \cb2 Pemerintah perangkat lunak dan data teknis hak-hak \ +\cb1 Kode Covered hanya menyertakan hak-hak yang lazim diberikan kepada \ +umum sebagaimana dimaksud dalam Lisensi ini. Ini lisensi komersial adat \ +\pard\pardeftab720 +\cf0 \cb2 dalam data teknis dan perangkat lunak disediakan sesuai dengan FAR \ +12,211 (Data Teknis) dan 12.212 (Perangkat Lunak Komputer) dan, untuk \ +\pard\pardeftab720 +\cf0 \cb1 Departemen Pertahanan pembelian, DFAR 252.227-7015 (Data Teknis - \ +Produk Komersial) dan 227,7202-3 (Hak di Komputer Komersial \ +Perangkat Lunak atau Dokumentasi Perangkat Lunak Komputer). Oleh karena itu, semua US \ +\pard\pardeftab720 +\cf0 \cb2 Pengguna Akhir Pemerintah memperoleh Kode Ditutupi dengan hanya hak-hak yang \ +\pard\pardeftab720 +\cf0 \cb1 sebagainya di sini. \ +\ +13.2 Hubungan Para Pihak. \cb2 Lisensi ini tidak akan ditafsirkan sebagai \ +\cb1 menciptakan agen, kemitraan, joint venture atau bentuk lainnya \ +\pard\pardeftab720 +\cf0 \cb2 hukum hubungan antara atau di antara Anda, Apple atau Contributor manapun, dan \ +Anda tidak akan mewakili sebaliknya, apakah tegas, oleh \ +Implikasinya, penampilan atau sebaliknya. \ +\ +\pard\pardeftab720 +\cf0 \cb1 13,3 Independen Pembangunan. \cb2 Tidak ada dalam Lisensi ini akan mengganggu \ +Hak Apple untuk memperoleh, lisensi, mengembangkan, memiliki orang lain mengembangkan untuk \ +itu, pasar dan / atau mendistribusikan teknologi atau produk yang melakukan \ +\cb1 fungsi yang sama atau mirip sebagai, atau bersaing dengan, \ +Modifikasi, Pekerjaan yang lebih besar, teknologi atau produk yang Anda mungkin \ +mengembangkan, memproduksi, memasarkan atau mendistribusikan. \ +\ +Pelepasan 13,4; Konstruksi. Kegagalan oleh Apple atau Contributor untuk \ +melaksanakan setiap ketentuan dari Lisensi ini tidak akan dianggap sebagai pengabaian \ +masa depan penegakan itu atau ketentuan lainnya. Setiap hukum atau \ +\pard\pardeftab720 +\cf0 \cb2 regulasi yang mengatur bahwa bahasa kontrak harus \ +\pard\pardeftab720 +\cf0 \cb1 ditafsirkan terhadap drafter tidak akan berlaku untuk Lisensi ini. \ +\ +13.5 Pemutusan. (A) Jika karena alasan apapun pengadilan yang kompeten \ +yurisdiksi menemukan ada ketentuan dari Lisensi ini, atau bagian daripadanya, \ +tidak dapat ditegakkan, bahwa ketentuan dari Lisensi akan ditegakkan untuk \ +maksimum yang diizinkan sejauh sehingga efek manfaat ekonomi \ +\pard\pardeftab720 +\cf0 \cb2 dan maksud dari para pihak, dan sisanya dari Lisensi ini akan \ +\pard\pardeftab720 +\cf0 \cb1 terus berlaku sepenuhnya. (B) Sekalipun demikian, \ +jika hukum yang berlaku melarang atau membatasi Anda dari sepenuhnya dan / atau \ +khusus sesuai dengan Bagian 2 dan / atau 3 atau mencegah \ +terlaksananya salah satu dari mereka Bagian, Lisensi ini akan \ +segera mengakhiri dan Anda harus segera menghentikan setiap penggunaan \ +yang Covered Kode dan menghancurkan semua salinan itu yang dalam Anda \ +kepemilikan atau kontrol. \ +\ +13,6 Penyelesaian Sengketa. Setiap litigasi atau penyelesaian sengketa lainnya \ +antara Anda dan Apple yang berkaitan dengan Lisensi ini akan berlangsung di \ +Distrik Utara California, dan Anda dan Apple dengan ini setuju \ +yurisdiksi pribadi, dan tempat di, negara bagian dan federal \ +pengadilan dalam Distrik yang sehubungan dengan Lisensi ini. Para \ +penerapan Konvensi PBB tentang Kontrak \ +Barang Internasional secara tegas dikecualikan. \ +\ +13,7 Seluruh Perjanjian; Hukum. Lisensi ini merupakan \ +seluruh kesepakatan antara para pihak sehubungan dengan subjek \ +materi perjanjian ini. Lisensi ini diatur oleh hukum \ +Amerika Serikat dan Negara Bagian California, kecuali bahwa tubuh \ +Hukum California mengenai konflik hukum. \ +\ +\pard\pardeftab720 +\cf0 \cb2 Dimana Anda berada di provinsi Quebec, Kanada, berikut \ +klausul berlaku: Para pihak dengan ini mengkonfirmasi bahwa mereka telah meminta \ +\pard\pardeftab720 +\cf0 \cb1 bahwa Lisensi ini dan semua dokumen terkait disusun dalam bahasa Inggris. Les \ +\pard\pardeftab720 +\cf0 \cb2 pihak ONT Exige que le contrat et tous hadir les dokumen \ +\pard\pardeftab720 +\cf0 \cb1 connexes soient en Anglais rediges. \ +\ +Bukti A. \ +\ +\pard\pardeftab720 +\cf0 \cb2 "Bagian Copyright (c) 1999-2003 Apple Computer, Inc Semua Hak \ +\pard\pardeftab720 +\cf0 \cb1 Dilindungi. \ +\ +File ini berisi Kode Asli dan / atau Modifikasi Kode Asli \ +sebagaimana didefinisikan dalam dan yang tunduk kepada Lisensi Publik Sumber Apple \ +Versi 2.0 ('Lisensi'). \cb2 Anda tidak dapat menggunakan file ini kecuali dalam \ +\cb1 sesuai dengan Lisensi. Silahkan memperoleh salinan Lisensi di \ +http://www.opensource.apple.com/apsl/ dan membacanya sebelum menggunakan \ +file. \ +\ +Kode asli dan semua perangkat lunak didistribusikan di bawah Lisensi ini \ +didistribusikan pada 'SEBAGAIMANA ADANYA' dasar, TANPA JAMINAN APAPUN, BAIK \ +\pard\pardeftab720 +\cf0 \cb2 TERSURAT MAUPUN TERSIRAT, DAN APPLE DENGAN INI MENYANGKAL SEMUA JAMINAN TERSEBUT, \ +\pard\pardeftab720 +\cf0 \cb1 TERMASUK TANPA TERBATAS, SEGALA GARANSI PENJUALAN, \ +KESESUAIAN UNTUK TUJUAN TERTENTU, kenikmatan QUIET ATAU NON-PELANGGARAN. \ +\pard\pardeftab720 +\cf0 \cb2 Silahkan lihat Lisensi untuk bahasa tertentu yang mengatur hak dan \ +\pard\pardeftab720 +\cf0 \cb1 keterbatasan di bawah Lisensi. "} diff --git a/package/Resources.old/id.lproj/Localizable.strings b/package/Resources.old/id.lproj/Localizable.strings new file mode 100644 index 0000000..8d034a4 Binary files /dev/null and b/package/Resources.old/id.lproj/Localizable.strings differ diff --git a/package/Resources.old/id.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/id.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..df3d92f --- /dev/null +++ b/package/Resources.old/id.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/id.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/id.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/id.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..e1f71d0 --- /dev/null +++ b/package/Resources.old/id.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/id.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:03.000000Z +fe64cd964a23e1505d2762ccc7bf6a09 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +672 + diff --git a/package/Resources.old/id.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/id.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..65c6474 --- /dev/null +++ b/package/Resources.old/id.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Jangan dinstall Apple Macintosh ASLI\ + +\fs22 \cf0 \ +\ +Tim pengembang :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Berterima kasih kepada :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Pakete :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: Rudolf Tingginehe & Babiloe\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/id.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/id.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..65c6474 --- /dev/null +++ b/package/Resources.old/id.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Jangan dinstall Apple Macintosh ASLI\ + +\fs22 \cf0 \ +\ +Tim pengembang :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Berterima kasih kepada :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Pakete :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: Rudolf Tingginehe & Babiloe\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/it.lproj/.svn/all-wcprops b/package/Resources.old/it.lproj/.svn/all-wcprops new file mode 100644 index 0000000..a247d3d --- /dev/null +++ b/package/Resources.old/it.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/License.rtf +END diff --git a/package/Resources.old/it.lproj/.svn/entries b/package/Resources.old/it.lproj/.svn/entries new file mode 100644 index 0000000..862fceb --- /dev/null +++ b/package/Resources.old/it.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/it.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:07.000000Z +2ba3b76c3714fa7c39732e335c1d2802 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2968 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:07.000000Z +6fba06d8139b124453190464b90141d8 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31902 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:07.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/it.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/it.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/it.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/it.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/it.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..cd54e68 --- /dev/null +++ b/package/Resources.old/it.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon è la combinazione di diverse parti del boot loader.
È basato sulle modifiche di David Elliott sull'implementazione "EFI" al progetto della Apple sul boot-132.
Chameleon presenta le seguenti caratteristiche principali:

+


+

Nuove caratteristiche di Chameleon versione 2:

+


+

- Interfaccia grafica completamente personalizzabile per dare maggiori colori al Darwin Bootloader.

+

- Avviare DVD retail semplicemente caricando una immagine ramdisk senza l'utilizzo di programmi aggiuntivi.

+

- Ibernazione. Godetevi nel risvegliare il vostro Mac OS X con un'immagine di anteprima.

+

- Sovrascrittura del SMBIOS per personalizzare i valori dell'SMBIOS.

+

- Sovrascrittura della tabella DSDT, potendo selezionare una ottimizzata che risolve svariate problematiche.

+

- Iniezione delle Proprità delle Periferiche con stringhe EFI in device-properties.

+

- boot0 / boot1h ibrido per dischi partizionati in MBR e GPT.

+

- Riconoscimento automatico della frequenza anche sui recenti processori AMD.

+

- Supporta il RAID software di Apple.

+

- Abilitazione grafica per schede Nvidia & ATI/AMD.

+

- Supporto Moduli.

+

- Rivelamento memoria adattato da memtest86: http://www.memtest.org

+

- Generazione automatica dei P-State e C-State.

+

- Log dei messaggi.

+


+

Il codice è rilasciato sotto licenza GPL v.2 (Gnu Public License).

+

http://forge.voodooprojects.org/p/chameleon

+


+

Per maggiori informazioni, visita (In Inglese): http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/it.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/it.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/it.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/it.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/it.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..1d8a23e Binary files /dev/null and b/package/Resources.old/it.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..ca92fa1 --- /dev/null +++ b/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..0b0050e --- /dev/null +++ b/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/it.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:07.000000Z +30a80b230e8b5bdf60679e86c4861cc9 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +903 + diff --git a/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..5357587 --- /dev/null +++ b/package/Resources.old/it.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Le operazioni sono state completate ed un file\ + chiamato \cf2 @LOG_FILENAME@\cf3 \'e9 stato\ +scritto nella root della partizione scelta.\ +\ +\cf0 Per favore \cf4 leggilo\cf0 per vedere se l'installazione \'e9\ +avvenuta con successo e vedere le operazioni che sono state eseguite.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Questo pkg \'e8 stato compilato da: %WHOBUILD%} diff --git a/package/Resources.old/it.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/it.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..5357587 --- /dev/null +++ b/package/Resources.old/it.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Le operazioni sono state completate ed un file\ + chiamato \cf2 @LOG_FILENAME@\cf3 \'e9 stato\ +scritto nella root della partizione scelta.\ +\ +\cf0 Per favore \cf4 leggilo\cf0 per vedere se l'installazione \'e9\ +avvenuta con successo e vedere le operazioni che sono state eseguite.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Questo pkg \'e8 stato compilato da: %WHOBUILD%} diff --git a/package/Resources.old/it.lproj/Description.html b/package/Resources.old/it.lproj/Description.html new file mode 100644 index 0000000..cd54e68 --- /dev/null +++ b/package/Resources.old/it.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon è la combinazione di diverse parti del boot loader.
È basato sulle modifiche di David Elliott sull'implementazione "EFI" al progetto della Apple sul boot-132.
Chameleon presenta le seguenti caratteristiche principali:

+


+

Nuove caratteristiche di Chameleon versione 2:

+


+

- Interfaccia grafica completamente personalizzabile per dare maggiori colori al Darwin Bootloader.

+

- Avviare DVD retail semplicemente caricando una immagine ramdisk senza l'utilizzo di programmi aggiuntivi.

+

- Ibernazione. Godetevi nel risvegliare il vostro Mac OS X con un'immagine di anteprima.

+

- Sovrascrittura del SMBIOS per personalizzare i valori dell'SMBIOS.

+

- Sovrascrittura della tabella DSDT, potendo selezionare una ottimizzata che risolve svariate problematiche.

+

- Iniezione delle Proprità delle Periferiche con stringhe EFI in device-properties.

+

- boot0 / boot1h ibrido per dischi partizionati in MBR e GPT.

+

- Riconoscimento automatico della frequenza anche sui recenti processori AMD.

+

- Supporta il RAID software di Apple.

+

- Abilitazione grafica per schede Nvidia & ATI/AMD.

+

- Supporto Moduli.

+

- Rivelamento memoria adattato da memtest86: http://www.memtest.org

+

- Generazione automatica dei P-State e C-State.

+

- Log dei messaggi.

+


+

Il codice è rilasciato sotto licenza GPL v.2 (Gnu Public License).

+

http://forge.voodooprojects.org/p/chameleon

+


+

Per maggiori informazioni, visita (In Inglese): http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/it.lproj/License.rtf b/package/Resources.old/it.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/it.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/it.lproj/Localizable.strings b/package/Resources.old/it.lproj/Localizable.strings new file mode 100644 index 0000000..1d8a23e Binary files /dev/null and b/package/Resources.old/it.lproj/Localizable.strings differ diff --git a/package/Resources.old/it.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/it.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..351943f --- /dev/null +++ b/package/Resources.old/it.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/it.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/it.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/it.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..ef63e39 --- /dev/null +++ b/package/Resources.old/it.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/it.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:07.000000Z +e1f44b9d678a816a86e0bae0deb824b3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +672 + diff --git a/package/Resources.old/it.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/it.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..b0af1b9 --- /dev/null +++ b/package/Resources.old/it.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Non installare su computer Apple Macintosh\ + +\fs22 \cf0 \ +\ +Sviluppatori :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Grazie a :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Pacchetto realizzato da :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Pacchetto compilato da: %WHOBUILD%, tradotto in Italiano da: ErmaC e scrax\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/it.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/it.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..b0af1b9 --- /dev/null +++ b/package/Resources.old/it.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Non installare su computer Apple Macintosh\ + +\fs22 \cf0 \ +\ +Sviluppatori :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Grazie a :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Pacchetto realizzato da :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Pacchetto compilato da: %WHOBUILD%, tradotto in Italiano da: ErmaC e scrax\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ja.lproj/.svn/all-wcprops b/package/Resources.old/ja.lproj/.svn/all-wcprops new file mode 100644 index 0000000..6265682 --- /dev/null +++ b/package/Resources.old/ja.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/License.rtf +END diff --git a/package/Resources.old/ja.lproj/.svn/entries b/package/Resources.old/ja.lproj/.svn/entries new file mode 100644 index 0000000..98a7772 --- /dev/null +++ b/package/Resources.old/ja.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ja.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:01.000000Z +ca750d16544c83e41178e70b4c7acc89 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2696 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:01.000000Z +c6bacbbf68c229e8765cda8795faab1b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32960 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:01.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/ja.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/ja.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/ja.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/ja.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/ja.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..d8d37ab --- /dev/null +++ b/package/Resources.old/ja.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ja.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/ja.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ja.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ja.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/ja.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..d762a7e Binary files /dev/null and b/package/Resources.old/ja.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..c003e3a --- /dev/null +++ b/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..bec2c3c --- /dev/null +++ b/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ja.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:55:59.000000Z +0d080022200ced0bb9336201a5f4ce4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +854 + diff --git a/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/ja.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ja.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/ja.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/ja.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ja.lproj/Description.html b/package/Resources.old/ja.lproj/Description.html new file mode 100644 index 0000000..d8d37ab --- /dev/null +++ b/package/Resources.old/ja.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ja.lproj/License.rtf b/package/Resources.old/ja.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ja.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ja.lproj/Localizable.strings b/package/Resources.old/ja.lproj/Localizable.strings new file mode 100644 index 0000000..d762a7e Binary files /dev/null and b/package/Resources.old/ja.lproj/Localizable.strings differ diff --git a/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..4ed72df --- /dev/null +++ b/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ja.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..74ae945 --- /dev/null +++ b/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ja.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:55:59.000000Z +3bac0fb02eb7a3e40049404e0d9448e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +641 + diff --git a/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/ja.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ja.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/ja.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/ja.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ko.lproj/.svn/all-wcprops b/package/Resources.old/ko.lproj/.svn/all-wcprops new file mode 100644 index 0000000..a147ebd --- /dev/null +++ b/package/Resources.old/ko.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/License.rtf +END diff --git a/package/Resources.old/ko.lproj/.svn/entries b/package/Resources.old/ko.lproj/.svn/entries new file mode 100644 index 0000000..97420db --- /dev/null +++ b/package/Resources.old/ko.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ko.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:06.000000Z +d07637ebd34622c253361ac921539693 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +5590 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:06.000000Z +1ede6535f483d0bff772d5131372b161 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +28102 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:06.000000Z +090f88c95e4362d795ea5aeb70ee89c1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +82425 + diff --git a/package/Resources.old/ko.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/ko.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/ko.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/ko.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/ko.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..24fc3b9 --- /dev/null +++ b/package/Resources.old/ko.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,47 @@ + + + + + + + + + +

카멜레온은 David Elliott fake EFI 구현 기술의 개발이 애플의 boot-132 프로젝트와 만나 생긴 요소들로 만들어진 부트로더입니다.

+


+

카멜레온 버전 2 많은 기능들이 추가되었습니다. 예를 들어:

+


+

- Darwin 부트로더에 완벽한 커스터마이징이 가능한 컬러 GUI.

+

- 외부 프로그램 없이 자체적으로 램디스크에 리테일 DVD 로딩하여 부팅.

+

- 최대 절전 모드 지원. OS X 썸네일로부터 깨어나는 모습을 즐기세요.

+

- SMBIOS 오버라이드로 공장 SMBIOS 기초 설정들을 변경.

+

- DSDT 오버라이드로 고쳐진 DSDT 사용하므로써 많은 문제들을 해결.

+

- device-properties string으로 디바이스 속성을 주입.

+

- 하이브리드 boot0 / boot1h MBR GPT 파티션된 디스크들을 허용.

+

- 최신 AMD CPU들까지도 자동 FSB 인식 코드로 지원.

+

- 애플 소프트웨어 RAID 지원.

+

- Nvidia ATI/AMD 그래픽 카드 활성화.

+

- 모듈 지원

+

- memtest86으로부터 기반된 RAM 메모리 인식 : (영문) http://www.memtest.org

+

- 자동 P-State & C-State 생성기능으로 자연적인 전원 관리.

+

- 메세지 로깅.

+


+

이 코드는 GNU 일반 공중 사용 허가서(GPL) 버전 2 아래 공개 되었습니다.

+

(영문) http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: (영문) http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ko.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/ko.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..f23d8b2 --- /dev/null +++ b/package/Resources.old/ko.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,544 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset129 AppleGothic;\f1\fmodern\fcharset0 Courier-Bold;\f2\fmodern\fcharset0 Courier; +} +{\colortbl;\red255\green255\blue255;\red54\green54\blue54;} +\vieww13560\viewh18360\viewkind0 +\deftab720 +\pard\pardeftab720 + +\f0\fs42 \cf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\'a1 \'b4\'eb\'c7\'d1 \'c4\'b6\'b8\'ae\'c6\'f7\'b4\'cf\'be\'c6 \'b9\'fd\'b7\'fc\'c0\'c7 \'c1\'b6\'c7\'d7\'c0\'bb \'c1\'a6\'bf\'dc\'c7\'cf\'b0\'ed, \'b9\'cc\'c7\'d5\'c1\'df\'b1\'b9\'b0\'fa \'c4\'b6\'b8\'ae\'c6\'f7\'b4\'cf\'be\'c6 \'c1\'d6\'c0\'c7 \'b9\'fd\'b7\'fc\'bf\'a1 \'c0\'c7\'c7\'d8 \'b1\'b8\'bc\'d3\'b5\'c8\'b4\'d9.\uc0\u160 \cf2 \ +\cf0 \uc0\u160 \cf2 \ +\cf0 \'b4\'e7\'bd\'c5\'c0\'cc \'c4\'b3\'b3\'aa\'b4\'d9 \'c4\'f9\'ba\'a4 \'c1\'d6\'bf\'a1 \'b0\'c5\'c1\'d6\'c7\'cf\'b4\'c2 \'b0\'e6\'bf\'ec, \'b4\'d9\'c0\'bd\'b0\'fa \'b0\'b0\'c0\'ba \'bb\'e7\'c7\'d7\'c0\'cc \'c0\'fb\'bf\'eb\'b5\'c8\'b4\'d9: \'b4\'e7\'bb\'e7\'c0\'da\'b5\'e9\'c0\'ba \'ba\'bb \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'bf\'cd \'b8\'f0\'b5\'e7 \'b0\'fc\'b7\'c3 \'b9\'ae\'bc\'ad\'b0\'a1 \'bf\'b5\'be\'ee\'b7\'ce \'c0\'db\'bc\'ba\'b5\'c7\'b5\'b5\'b7\'cf \'bf\'e4\'b1\'b8\'c7\'df\'b4\'d9\'b4\'c2 \'b5\'a5 \'b5\'bf\'c0\'c7\'c7\'d1\'b4\'d9. Les parties ont exige que le present contrat et tous les documents connexes soient rediges en anglais.\cf2 \ +\cf0 \uc0\u160 \cf2 \ +\pard\pardeftab720 + +\fs32 \cf0 EXHIBIT A. +\fs36 \cf2 \ +\pard\pardeftab720 + +\fs24 \cf0 \uc0\u160 \cf2 \ +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'c0\'bb \'b1\'d4\'c1\'a4\'c7\'cf\'b4\'c2 \'b1\'b8\'c3\'bc\'c0\'fb\'c0\'ce \'be\'f0\'be\'ee\'bf\'a1 \'b4\'eb\'c7\'d8\'bc\'ad\'b4\'c2 \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'b8\'a6 \'c2\'fc\'b0\'ed\'c7\'cf\'b6\'f3.\'a1\'b1\ + +\f1\b\fs40 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 +\cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f2\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } diff --git a/package/Resources.old/ko.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/ko.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..56c7dbf Binary files /dev/null and b/package/Resources.old/ko.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0262d21 --- /dev/null +++ b/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..0f05469 --- /dev/null +++ b/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ko.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +34eb732bd940e52b3cca0dfd2e2f1378 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1461 + diff --git a/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..00d94c4 --- /dev/null +++ b/package/Resources.old/ko.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,36 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset129 AppleGothic;\f2\fnil\fcharset129 NanumGothic;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +\f1\b0 \'bd\'ba\'c5\'a9\'b8\'b3\'c6\'ae(\'bc\'b3\'c4\'a1)\'b0\'a1 \'bf\'cf\'b7\'e1\'b5\'c7\'be\'fa\'bd\'c0\'b4\'cf\'b4\'d9. \ +\'bc\'b1\'c5\'c3\'b5\'c8 \'c6\'c4\'c6\'bc\'bc\'c7\'c0\'c7 \'b7\'e7\'c6\'ae \'b5\'f0\'b7\'ba\'c5\'e4\'b8\'ae\'bf\'a1 +\f2\b \ + +\f0 \cf2 @LOG_FILENAME@ +\f1\b0 \cf3 \'b8\'a6 \'bb\'fd\'bc\'ba\'c7\'cf\'bf\'b4\'bd\'c0\'b4\'cf\'b4\'d9. +\f0\b \ +\ + +\f1\b0 \cf0 \'c0\'a7 \cf4 \'b7\'ce\'b1\'d7\cf0 \'b8\'a6 \'b2\'c0 \cf4 \'c0\'d0\'be\'ee\'ba\'b8\'bd\'c3\'b0\'ed\cf0 \'bc\'b3\'c4\'a1\'b0\'a1 \'c1\'a4\'bb\'f3\'c0\'fb\'c0\'b8\'b7\'ce \'b5\'c7\'be\'fa\'b4\'c2\'c1\'f6\ +\'be\'cb\'be\'c6\'ba\'b8\'bd\'c5 \'c8\'c4\'bf\'a1 \'b1\'e2\'b7\'cf\'c0\'b8\'b7\'ce \'c0\'df \'ba\'b8\'b0\'fc\'c7\'cf\'bd\'c3\'b1\'e2 \'b9\'d9\'b6\'f8\'b4\'cf\'b4\'d9. \ + +\f0\b \cf4 \ +\ +\ + +\f1\b0\fs26 \cf0 \'c4\'ab\'b8\'e1\'b7\'b9\'bf\'c2 +\f0\b v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ko.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/ko.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..00d94c4 --- /dev/null +++ b/package/Resources.old/ko.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,36 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset129 AppleGothic;\f2\fnil\fcharset129 NanumGothic;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +\f1\b0 \'bd\'ba\'c5\'a9\'b8\'b3\'c6\'ae(\'bc\'b3\'c4\'a1)\'b0\'a1 \'bf\'cf\'b7\'e1\'b5\'c7\'be\'fa\'bd\'c0\'b4\'cf\'b4\'d9. \ +\'bc\'b1\'c5\'c3\'b5\'c8 \'c6\'c4\'c6\'bc\'bc\'c7\'c0\'c7 \'b7\'e7\'c6\'ae \'b5\'f0\'b7\'ba\'c5\'e4\'b8\'ae\'bf\'a1 +\f2\b \ + +\f0 \cf2 @LOG_FILENAME@ +\f1\b0 \cf3 \'b8\'a6 \'bb\'fd\'bc\'ba\'c7\'cf\'bf\'b4\'bd\'c0\'b4\'cf\'b4\'d9. +\f0\b \ +\ + +\f1\b0 \cf0 \'c0\'a7 \cf4 \'b7\'ce\'b1\'d7\cf0 \'b8\'a6 \'b2\'c0 \cf4 \'c0\'d0\'be\'ee\'ba\'b8\'bd\'c3\'b0\'ed\cf0 \'bc\'b3\'c4\'a1\'b0\'a1 \'c1\'a4\'bb\'f3\'c0\'fb\'c0\'b8\'b7\'ce \'b5\'c7\'be\'fa\'b4\'c2\'c1\'f6\ +\'be\'cb\'be\'c6\'ba\'b8\'bd\'c5 \'c8\'c4\'bf\'a1 \'b1\'e2\'b7\'cf\'c0\'b8\'b7\'ce \'c0\'df \'ba\'b8\'b0\'fc\'c7\'cf\'bd\'c3\'b1\'e2 \'b9\'d9\'b6\'f8\'b4\'cf\'b4\'d9. \ + +\f0\b \cf4 \ +\ +\ + +\f1\b0\fs26 \cf0 \'c4\'ab\'b8\'e1\'b7\'b9\'bf\'c2 +\f0\b v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ko.lproj/Description.html b/package/Resources.old/ko.lproj/Description.html new file mode 100644 index 0000000..24fc3b9 --- /dev/null +++ b/package/Resources.old/ko.lproj/Description.html @@ -0,0 +1,47 @@ + + + + + + + + + +

카멜레온은 David Elliott fake EFI 구현 기술의 개발이 애플의 boot-132 프로젝트와 만나 생긴 요소들로 만들어진 부트로더입니다.

+


+

카멜레온 버전 2 많은 기능들이 추가되었습니다. 예를 들어:

+


+

- Darwin 부트로더에 완벽한 커스터마이징이 가능한 컬러 GUI.

+

- 외부 프로그램 없이 자체적으로 램디스크에 리테일 DVD 로딩하여 부팅.

+

- 최대 절전 모드 지원. OS X 썸네일로부터 깨어나는 모습을 즐기세요.

+

- SMBIOS 오버라이드로 공장 SMBIOS 기초 설정들을 변경.

+

- DSDT 오버라이드로 고쳐진 DSDT 사용하므로써 많은 문제들을 해결.

+

- device-properties string으로 디바이스 속성을 주입.

+

- 하이브리드 boot0 / boot1h MBR GPT 파티션된 디스크들을 허용.

+

- 최신 AMD CPU들까지도 자동 FSB 인식 코드로 지원.

+

- 애플 소프트웨어 RAID 지원.

+

- Nvidia ATI/AMD 그래픽 카드 활성화.

+

- 모듈 지원

+

- memtest86으로부터 기반된 RAM 메모리 인식 : (영문) http://www.memtest.org

+

- 자동 P-State & C-State 생성기능으로 자연적인 전원 관리.

+

- 메세지 로깅.

+


+

이 코드는 GNU 일반 공중 사용 허가서(GPL) 버전 2 아래 공개 되었습니다.

+

(영문) http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: (영문) http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ko.lproj/License.rtf b/package/Resources.old/ko.lproj/License.rtf new file mode 100644 index 0000000..f23d8b2 --- /dev/null +++ b/package/Resources.old/ko.lproj/License.rtf @@ -0,0 +1,544 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset129 AppleGothic;\f1\fmodern\fcharset0 Courier-Bold;\f2\fmodern\fcharset0 Courier; +} +{\colortbl;\red255\green255\blue255;\red54\green54\blue54;} +\vieww13560\viewh18360\viewkind0 +\deftab720 +\pard\pardeftab720 + +\f0\fs42 \cf0 \'be\'d6\'c7\'c3 \'b0\'f8\'c1\'df \'bc\'d2\'bd\'ba \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba +\fs24 \cf2 \ +\pard\pardeftab720 +\cf0 \'b9\'f6\'c0\'fc 2.0 - 2003\'b3\'e2 8\'bf\'f9 6\'c0\'cf\cf2 \ +\cf0 \uc0\u160 \cf2 \ +\cf0 \'c0\'cc \'bc\'d2\'c7\'c1\'c6\'ae\'bf\'fe\'be\'ee\'b8\'a6 \'b4\'d9\'bf\'ee\'b9\'de\'b1\'e2 \'c0\'fc\'bf\'a1 \'ba\'bb \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'b8\'a6 \'c0\'da\'bc\'bc\'c8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5\'c0\'cc \'c4\'b3\'b3\'aa\'b4\'d9 \'c4\'f9\'ba\'a4 \'c1\'d6\'bf\'a1 \'b0\'c5\'c1\'d6\'c7\'cf\'b4\'c2 \'b0\'e6\'bf\'ec, \'b4\'d9\'c0\'bd\'b0\'fa \'b0\'b0\'c0\'ba \'bb\'e7\'c7\'d7\'c0\'cc \'c0\'fb\'bf\'eb\'b5\'c8\'b4\'d9: \'b4\'e7\'bb\'e7\'c0\'da\'b5\'e9\'c0\'ba \'ba\'bb \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'bf\'cd \'b8\'f0\'b5\'e7 \'b0\'fc\'b7\'c3 \'b9\'ae\'bc\'ad\'b0\'a1 \'bf\'b5\'be\'ee\'b7\'ce \'c0\'db\'bc\'ba\'b5\'c7\'b5\'b5\'b7\'cf \'bf\'e4\'b1\'b8\'c7\'df\'b4\'d9\'b4\'c2 \'b5\'a5 \'b5\'bf\'c0\'c7\'c7\'d1\'b4\'d9. Les parties ont exige que le present contrat et tous les documents connexes soient rediges en anglais.\cf2 \ +\cf0 \uc0\u160 \cf2 \ +\pard\pardeftab720 + +\fs32 \cf0 EXHIBIT A. +\fs36 \cf2 \ +\pard\pardeftab720 + +\fs24 \cf0 \uc0\u160 \cf2 \ +\cf0 \'a1\'b0Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.\cf2 \ +\cf0 \'c0\'cc \'c6\'c4\'c0\'cf\'c0\'ba \'be\'d6\'c7\'c3 \'b0\'f8\'c1\'df \'bc\'d2\'bd\'ba \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba \'b9\'f6\'c0\'fc 2.0(\'a1\'ae\'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'a1\'af)\'bf\'a1 \'c0\'c7\'c7\'d8 \'b1\'b8\'bc\'d3\'b5\'c7\'b0\'ed, \'c1\'a4\'c0\'c7\'b5\'c8 \'b9\'d9\'bf\'a1 \'b5\'fb\'b6\'f3 \'bf\'f8\'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\'b8\'c1\'f5\'b5\'b5 \'c1\'a6\'b0\'f8\'c7\'cf\'c1\'f6 \'be\'ca\'b4\'c2 \'a1\'b0\'c0\'d6\'b4\'c2 \'b1\'d7\'b4\'eb\'b7\'ce\'a1\'b1\'c0\'c7 \'bb\'f3\'c5\'c2\'b7\'ce \'c1\'a6\'b0\'f8\'b5\'c7\'b8\'e7, \'be\'d6\'c7\'c3\'c0\'ba \'bb\'f3\'c7\'b0\'bc\'ba, \'c6\'af\'c1\'a4 \'b8\'f1\'c0\'fb\'bf\'a1 \'b4\'eb\'c7\'d1 \'c0\'fb\'c7\'d5\'bc\'ba, \'c6\'f2\'bf\'c2\'c7\'e2\'c0\'af \'b6\'c7\'b4\'c2 \'ba\'f1\'c4\'a7\'c7\'d8\'bf\'a1 \'b4\'eb\'c7\'d1 \'ba\'b8\'c1\'f5\'c0\'bb \'c6\'f7\'c7\'d4\'c7\'d1 \'b8\'f0\'b5\'e7 \'ba\'b8\'c1\'f5\'c0\'bb \'ba\'ce\'c0\'ce\'c7\'d1\'b4\'d9. \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'bf\'a1 \'c0\'c7\'c7\'d1 \'b1\'c7\'b8\'ae\'bf\'cd \'c1\'a6\'c7\'d1\'b5\'e9\'c0\'bb \'b1\'d4\'c1\'a4\'c7\'cf\'b4\'c2 \'b1\'b8\'c3\'bc\'c0\'fb\'c0\'ce \'be\'f0\'be\'ee\'bf\'a1 \'b4\'eb\'c7\'d8\'bc\'ad\'b4\'c2 \'b6\'f3\'c0\'cc\'bc\'b1\'bd\'ba\'b8\'a6 \'c2\'fc\'b0\'ed\'c7\'cf\'b6\'f3.\'a1\'b1\ + +\f1\b\fs40 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 +\cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f2\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } diff --git a/package/Resources.old/ko.lproj/Localizable.strings b/package/Resources.old/ko.lproj/Localizable.strings new file mode 100644 index 0000000..56c7dbf Binary files /dev/null and b/package/Resources.old/ko.lproj/Localizable.strings differ diff --git a/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..40e2f31 --- /dev/null +++ b/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ko.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..865be2b --- /dev/null +++ b/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ko.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +b1165504623bc0239cf5816dbd73249e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1118 + diff --git a/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..bc79332 --- /dev/null +++ b/package/Resources.old/ko.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,59 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset129 AppleGothic;\f2\fnil\fcharset129 NanumGothic; +} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ +\pard\qc + +\f1\b0\fs48 \cf0 \'c4\'ab\'b8\'e1\'b7\'b9\'bf\'c2 +\f0\b\fs50 \ +\pard\qc + +\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1\b0 \cf2 \'be\'d6\'c7\'c3 \'b8\'c5\'c5\'b2\'c5\'e4\'bd\'c3 \'c4\'c4\'c7\'bb\'c5\'cd\'bf\'a1 \'bc\'b3\'c4\'a1\'c7\'cf\'c1\'f6 \'b8\'b6\'bd\'c3\'bf\'c0. +\f0\b \cf2 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\f1\b0 \cf0 \'b0\'b3\'b9\'df\'c0\'da\'b5\'e9 +\f0\b :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\f1\b0 \cf0 \'b5\'b5\'bf\'f2 \'c1\'d6\'bd\'c5\'ba\'d0\'b5\'e9 +\f0\b :\ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\f1 \cf0 \'c6\'d0\'c5\'b0\'c1\'f6 \'b0\'b3\'b9\'df +\f0\b :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language +\f1\fs20 \'b9\'f8\'bf\'aa +\f2\b +\f0\b0\fs18 by: drew_afx\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ko.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/ko.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..bc79332 --- /dev/null +++ b/package/Resources.old/ko.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,59 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset129 AppleGothic;\f2\fnil\fcharset129 NanumGothic; +} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ +\pard\qc + +\f1\b0\fs48 \cf0 \'c4\'ab\'b8\'e1\'b7\'b9\'bf\'c2 +\f0\b\fs50 \ +\pard\qc + +\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1\b0 \cf2 \'be\'d6\'c7\'c3 \'b8\'c5\'c5\'b2\'c5\'e4\'bd\'c3 \'c4\'c4\'c7\'bb\'c5\'cd\'bf\'a1 \'bc\'b3\'c4\'a1\'c7\'cf\'c1\'f6 \'b8\'b6\'bd\'c3\'bf\'c0. +\f0\b \cf2 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\f1\b0 \cf0 \'b0\'b3\'b9\'df\'c0\'da\'b5\'e9 +\f0\b :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\f1\b0 \cf0 \'b5\'b5\'bf\'f2 \'c1\'d6\'bd\'c5\'ba\'d0\'b5\'e9 +\f0\b :\ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\f1 \cf0 \'c6\'d0\'c5\'b0\'c1\'f6 \'b0\'b3\'b9\'df +\f0\b :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language +\f1\fs20 \'b9\'f8\'bf\'aa +\f2\b +\f0\b0\fs18 by: drew_afx\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/mk.lproj/.svn/all-wcprops b/package/Resources.old/mk.lproj/.svn/all-wcprops new file mode 100644 index 0000000..4244b85 --- /dev/null +++ b/package/Resources.old/mk.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/License.rtf +END diff --git a/package/Resources.old/mk.lproj/.svn/entries b/package/Resources.old/mk.lproj/.svn/entries new file mode 100644 index 0000000..65272cc --- /dev/null +++ b/package/Resources.old/mk.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/mk.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:05.000000Z +cf670c5925bddb8a0ef94332defcc227 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3567 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:05.000000Z +b61839f2dca7fafcb3d941237d1a5342 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33382 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:05.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/mk.lproj/.svn/prop-base/Description.html.svn-base b/package/Resources.old/mk.lproj/.svn/prop-base/Description.html.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Resources.old/mk.lproj/.svn/prop-base/Description.html.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Resources.old/mk.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/mk.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..dbc918b --- /dev/null +++ b/package/Resources.old/mk.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,9 @@ +K 14 +svn:executable +V 1 +* +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/mk.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/mk.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..4fc3462 --- /dev/null +++ b/package/Resources.old/mk.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon е комбинација од различни boot-loader компоненти. Базиран е на лажна EFI имплементација на David Elliott додадено на проектот boot-132 на Apple.

+


+

Нови функции во Chameleon 2.0

+


+

- Потполно прилагодлив графички интерфејс кои придонесува за визуелни подобрувања на Darwin Bootloader-от.

+

- Стартувањето на оригинални DVD-а дирекнто ја вчитува ramdisk сликата без помош од дополнителни програми.

+

- Хибернација. Ужувајте во продолжувањето на работата на вашиот Mac OS X.

+

- SMBIOS замена, за модифицирање на оригиналните SMBIOS вредности.

+

- DSDT замена, за да користите модифициран DSDT, кој што решава повеќе проблеми.

+

- Имплементирање на својства на уредите со посредство на device-properties стрингови.

+

- Хибридни boot0 / boot1h за MBR и GPT партиционирани дискови.

+

- Автоматско препознавање на FSB и за новите AMD процесори.

+

- Поддршка на Apple Software RAID.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Поддршка за модули.

+

- Детекција на меморијата адаптирано од memtest86: http://www.memtest.org

+

- Автоматско генерирање на P-State & C-State за природна контрола на процесорот.

+

- Логирање на пораки.

+


+

Овој код е објавен под верзијата 2 од Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

За повеќе информации посетете ја веб страницата : http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/mk.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/mk.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/mk.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/mk.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/mk.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..27feff8 Binary files /dev/null and b/package/Resources.old/mk.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..bf05504 --- /dev/null +++ b/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..db1e655 --- /dev/null +++ b/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/mk.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +bfc3853bbfdbb0e5f80e07f4a264d7fd +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1778 + diff --git a/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..9d58894 --- /dev/null +++ b/package/Resources.old/mk.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +\uc0\u1057 \u1082 \u1088 \u1080 \u1087 \u1090 \u1072 \u1090 \u1072 \u1077 \u1079 \u1072 \u1074 \u1088 \u1096 \u1077 \u1085 \u1072 \u1080 \u1076 \u1072 \u1090 \u1086 \u1090 \u1077 \u1082 \u1072 \ + \uc0\u1089 \u1086 \u1080 \u1084 \u1077 \cf2 @LOG_FILENAME@\cf3 \uc0\u1077 \ +\uc0\u1079 \u1072 \u1087 \u1080 \u1096 \u1072 \u1085 \u1072 \u1074 \u1086 root \u1085 \u1072 \u1080 \u1079 \u1073 \u1088 \u1072 \u1085 \u1072 \u1090 \u1072 \u1087 \u1072 \u1088 \u1090 \u1080 \u1094 \u1080 \u1112 \u1072 .\ +\ +\cf0 \uc0\u1042 \u1077 \u1084 \u1086 \u1083 \u1080 \u1084 \u1077 \cf4 \uc0\u1087 \u1088 \u1086 \u1095 \u1080 \u1090 \u1072 \u1112 \u1090 \u1077 \u1112 \u1072 \cf0 \uc0\u1076 \u1072 \u1076 \u1086 \u1079 \u1085 \u1072 \u1077 \u1090 \u1077 \u1076 \u1072 \u1083 \u1080 \u1080 \u1085 \u1089 \u1090 \u1072 \u1083 \u1072 \u1094 \u1080 \u1112 \u1072 \u1090 \u1072 \ + \uc0\u1077 \u1091 \u1089 \u1087 \u1077 \u1096 \u1085 \u1072 \u1080 \u1076 \u1072 \u1080 \u1084 \u1072 \u1090 \u1077 \u1077 \u1074 \u1080 \u1076 \u1077 \u1085 \u1094 \u1080 \u1112 \u1072 \u1079 \u1072 \u1096 \u1090 \u1086 \u1077 \u1085 \u1072 \u1087 \u1088 \u1072 \u1074 \u1077 \u1085 \u1086 .\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/mk.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/mk.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..9d58894 --- /dev/null +++ b/package/Resources.old/mk.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +\uc0\u1057 \u1082 \u1088 \u1080 \u1087 \u1090 \u1072 \u1090 \u1072 \u1077 \u1079 \u1072 \u1074 \u1088 \u1096 \u1077 \u1085 \u1072 \u1080 \u1076 \u1072 \u1090 \u1086 \u1090 \u1077 \u1082 \u1072 \ + \uc0\u1089 \u1086 \u1080 \u1084 \u1077 \cf2 @LOG_FILENAME@\cf3 \uc0\u1077 \ +\uc0\u1079 \u1072 \u1087 \u1080 \u1096 \u1072 \u1085 \u1072 \u1074 \u1086 root \u1085 \u1072 \u1080 \u1079 \u1073 \u1088 \u1072 \u1085 \u1072 \u1090 \u1072 \u1087 \u1072 \u1088 \u1090 \u1080 \u1094 \u1080 \u1112 \u1072 .\ +\ +\cf0 \uc0\u1042 \u1077 \u1084 \u1086 \u1083 \u1080 \u1084 \u1077 \cf4 \uc0\u1087 \u1088 \u1086 \u1095 \u1080 \u1090 \u1072 \u1112 \u1090 \u1077 \u1112 \u1072 \cf0 \uc0\u1076 \u1072 \u1076 \u1086 \u1079 \u1085 \u1072 \u1077 \u1090 \u1077 \u1076 \u1072 \u1083 \u1080 \u1080 \u1085 \u1089 \u1090 \u1072 \u1083 \u1072 \u1094 \u1080 \u1112 \u1072 \u1090 \u1072 \ + \uc0\u1077 \u1091 \u1089 \u1087 \u1077 \u1096 \u1085 \u1072 \u1080 \u1076 \u1072 \u1080 \u1084 \u1072 \u1090 \u1077 \u1077 \u1074 \u1080 \u1076 \u1077 \u1085 \u1094 \u1080 \u1112 \u1072 \u1079 \u1072 \u1096 \u1090 \u1086 \u1077 \u1085 \u1072 \u1087 \u1088 \u1072 \u1074 \u1077 \u1085 \u1086 .\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/mk.lproj/Description.html b/package/Resources.old/mk.lproj/Description.html new file mode 100755 index 0000000..4fc3462 --- /dev/null +++ b/package/Resources.old/mk.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon е комбинација од различни boot-loader компоненти. Базиран е на лажна EFI имплементација на David Elliott додадено на проектот boot-132 на Apple.

+


+

Нови функции во Chameleon 2.0

+


+

- Потполно прилагодлив графички интерфејс кои придонесува за визуелни подобрувања на Darwin Bootloader-от.

+

- Стартувањето на оригинални DVD-а дирекнто ја вчитува ramdisk сликата без помош од дополнителни програми.

+

- Хибернација. Ужувајте во продолжувањето на работата на вашиот Mac OS X.

+

- SMBIOS замена, за модифицирање на оригиналните SMBIOS вредности.

+

- DSDT замена, за да користите модифициран DSDT, кој што решава повеќе проблеми.

+

- Имплементирање на својства на уредите со посредство на device-properties стрингови.

+

- Хибридни boot0 / boot1h за MBR и GPT партиционирани дискови.

+

- Автоматско препознавање на FSB и за новите AMD процесори.

+

- Поддршка на Apple Software RAID.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Поддршка за модули.

+

- Детекција на меморијата адаптирано од memtest86: http://www.memtest.org

+

- Автоматско генерирање на P-State & C-State за природна контрола на процесорот.

+

- Логирање на пораки.

+


+

Овој код е објавен под верзијата 2 од Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

За повеќе информации посетете ја веб страницата : http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/mk.lproj/License.rtf b/package/Resources.old/mk.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/mk.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/mk.lproj/Localizable.strings b/package/Resources.old/mk.lproj/Localizable.strings new file mode 100755 index 0000000..27feff8 Binary files /dev/null and b/package/Resources.old/mk.lproj/Localizable.strings differ diff --git a/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..06ca546 --- /dev/null +++ b/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/mk.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..32f6140 --- /dev/null +++ b/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/mk.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +ebafbc4c866e80f2905ea5f8df341bd4 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1114 + diff --git a/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..6e15b41 --- /dev/null +++ b/package/Resources.old/mk.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 \uc0\u1053 \u1077 \u1080 \u1085 \u1089 \u1090 \u1072 \u1083 \u1080 \u1088 \u1072 \u1112 \u1090 \u1077 \u1085 \u1072 Apple Macintosh \u1082 \u1086 \u1084 \u1087 \u1112 \u1091 \u1090 \u1077 \u1088 \ + +\fs22 \cf0 \ +\ +\uc0\u1044 \u1077 \u1074 \u1077 \u1083 \u1086 \u1087 \u1077 \u1088 \u1080 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\uc0\u1041 \u1083 \u1072 \u1075 \u1086 \u1076 \u1072 \u1088 \u1085 \u1086 \u1089 \u1090 \u1076 \u1086 :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 \uc0\u1055 \u1072 \u1082 \u1077 \u1090 :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language \uc0\u1087 \u1088 \u1077 \u1074 \u1077 \u1076 \u1077 \u1085 \u1080 \u1086 \u1076 \u1089 \u1090 \u1088 \u1072 \u1085 \u1072 \u1085 \u1072 : kn6600\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/mk.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/mk.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..6e15b41 --- /dev/null +++ b/package/Resources.old/mk.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 \uc0\u1053 \u1077 \u1080 \u1085 \u1089 \u1090 \u1072 \u1083 \u1080 \u1088 \u1072 \u1112 \u1090 \u1077 \u1085 \u1072 Apple Macintosh \u1082 \u1086 \u1084 \u1087 \u1112 \u1091 \u1090 \u1077 \u1088 \ + +\fs22 \cf0 \ +\ +\uc0\u1044 \u1077 \u1074 \u1077 \u1083 \u1086 \u1087 \u1077 \u1088 \u1080 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\uc0\u1041 \u1083 \u1072 \u1075 \u1086 \u1076 \u1072 \u1088 \u1085 \u1086 \u1089 \u1090 \u1076 \u1086 :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 \uc0\u1055 \u1072 \u1082 \u1077 \u1090 :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language \uc0\u1087 \u1088 \u1077 \u1074 \u1077 \u1076 \u1077 \u1085 \u1080 \u1086 \u1076 \u1089 \u1090 \u1088 \u1072 \u1085 \u1072 \u1085 \u1072 : kn6600\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/nl.lproj/.svn/all-wcprops b/package/Resources.old/nl.lproj/.svn/all-wcprops new file mode 100644 index 0000000..ebfbbde --- /dev/null +++ b/package/Resources.old/nl.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/License.rtf +END diff --git a/package/Resources.old/nl.lproj/.svn/entries b/package/Resources.old/nl.lproj/.svn/entries new file mode 100644 index 0000000..22d6f1f --- /dev/null +++ b/package/Resources.old/nl.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/nl.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:06.000000Z +50c510a283bc252882018c7e99c1de35 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2876 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:06.000000Z +ed5f95e79fc134cbd836074a2274fb9d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +33842 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:06.000000Z +0436a206ddce5cba528a3ad96cdde605 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20529 + diff --git a/package/Resources.old/nl.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/nl.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/nl.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/nl.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/nl.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..575a54d --- /dev/null +++ b/package/Resources.old/nl.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is een combinatie van verschillende bootloader componenten. Het is gebaseerd op de fake EFI implementatie van David Elliott die toegevoegd is aan Apple's boot-123 project.

+


+

Nieuwe functies in Chameleon 2.0.

+


+

- Volledig aanpasbare GUI, zodat de Darwin Bootloader een ander uiterlijk krijgt.

+

- Het booten van retail DVD's door direct een image te laden zonder hulp van externe programma's.

+

- Slaapstand. Geniet van het hervatten van Mac OS X met een preview image.

+

- Het passeren van de SMBIOS zodat de standaard SMBIOS waarden aangepast kunnen worden.

+

- Het passeren van de DSDT zodat er een aangepaste verbeterde DSDT kan worden gebruikt om bepaalde problemen op te lossen.

+

- Device Property Injectie via device-properties string.

+

- Hybride boot0 / boot1h voor MBR en GPT gepartitioneerde schijven.

+

- Automatische FSB detectie code, zelfs voor recente AMD processors.

+

- Apple Software RAID ondersteuning.

+

- Nvidia & ATI/AMD grafische kaart autodetectie.

+

- Module ondersteuning

+

- Geheugen detectie overgenomen van memtest86: http://www.memtest.org

+

- Automatisch P-State's & C-State's aangemaakt voor zelf aangestuurd stroombeheer.

+

- Bericht logboek.

+


+

De code is vrijgegeven onder versie 2 van de Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Voor meer informatie, bezoek: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/nl.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/nl.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..61296ee --- /dev/null +++ b/package/Resources.old/nl.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } diff --git a/package/Resources.old/nl.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/nl.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..3fbb1a8 Binary files /dev/null and b/package/Resources.old/nl.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..8c85706 --- /dev/null +++ b/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..e4a267a --- /dev/null +++ b/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/nl.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +a0ddf6ddc5794d1e7eed4d483d2d438c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +855 + diff --git a/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..6eb72b6 --- /dev/null +++ b/package/Resources.old/nl.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +De installatie is klaar en het bestand\ + \cf2 @LOG_FILENAME@\cf3 is geschreven\ +naar de root van de door u gekozen partitie.\ +\ +\cf0 Alstublieft \cf4 raadpleeg\cf0 het document om te zien of\ +de installatie goed verlopen is en bewaar het ter naslag.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/nl.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/nl.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..6eb72b6 --- /dev/null +++ b/package/Resources.old/nl.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +De installatie is klaar en het bestand\ + \cf2 @LOG_FILENAME@\cf3 is geschreven\ +naar de root van de door u gekozen partitie.\ +\ +\cf0 Alstublieft \cf4 raadpleeg\cf0 het document om te zien of\ +de installatie goed verlopen is en bewaar het ter naslag.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/nl.lproj/Description.html b/package/Resources.old/nl.lproj/Description.html new file mode 100644 index 0000000..575a54d --- /dev/null +++ b/package/Resources.old/nl.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is een combinatie van verschillende bootloader componenten. Het is gebaseerd op de fake EFI implementatie van David Elliott die toegevoegd is aan Apple's boot-123 project.

+


+

Nieuwe functies in Chameleon 2.0.

+


+

- Volledig aanpasbare GUI, zodat de Darwin Bootloader een ander uiterlijk krijgt.

+

- Het booten van retail DVD's door direct een image te laden zonder hulp van externe programma's.

+

- Slaapstand. Geniet van het hervatten van Mac OS X met een preview image.

+

- Het passeren van de SMBIOS zodat de standaard SMBIOS waarden aangepast kunnen worden.

+

- Het passeren van de DSDT zodat er een aangepaste verbeterde DSDT kan worden gebruikt om bepaalde problemen op te lossen.

+

- Device Property Injectie via device-properties string.

+

- Hybride boot0 / boot1h voor MBR en GPT gepartitioneerde schijven.

+

- Automatische FSB detectie code, zelfs voor recente AMD processors.

+

- Apple Software RAID ondersteuning.

+

- Nvidia & ATI/AMD grafische kaart autodetectie.

+

- Module ondersteuning

+

- Geheugen detectie overgenomen van memtest86: http://www.memtest.org

+

- Automatisch P-State's & C-State's aangemaakt voor zelf aangestuurd stroombeheer.

+

- Bericht logboek.

+


+

De code is vrijgegeven onder versie 2 van de Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Voor meer informatie, bezoek: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/nl.lproj/License.rtf b/package/Resources.old/nl.lproj/License.rtf new file mode 100644 index 0000000..61296ee --- /dev/null +++ b/package/Resources.old/nl.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } diff --git a/package/Resources.old/nl.lproj/Localizable.strings b/package/Resources.old/nl.lproj/Localizable.strings new file mode 100644 index 0000000..3fbb1a8 Binary files /dev/null and b/package/Resources.old/nl.lproj/Localizable.strings differ diff --git a/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..a581559 --- /dev/null +++ b/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/nl.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..e0b5cf3 --- /dev/null +++ b/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/nl.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +6b0d184fd6820df16b1624a3958c482a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +680 + diff --git a/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..eb34c13 --- /dev/null +++ b/package/Resources.old/nl.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Installeer niet op een echte Apple Macintosh computer!\ + +\fs22 \cf0 \ +\ +Ontwikkelaars :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Dank gaat uit naar :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language Vertaald door: yeehaw123 & Badeendje\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/nl.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/nl.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..eb34c13 --- /dev/null +++ b/package/Resources.old/nl.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Installeer niet op een echte Apple Macintosh computer!\ + +\fs22 \cf0 \ +\ +Ontwikkelaars :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Dank gaat uit naar :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language Vertaald door: yeehaw123 & Badeendje\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/pl.lproj/.svn/all-wcprops b/package/Resources.old/pl.lproj/.svn/all-wcprops new file mode 100644 index 0000000..48770bf --- /dev/null +++ b/package/Resources.old/pl.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/License.rtf +END diff --git a/package/Resources.old/pl.lproj/.svn/entries b/package/Resources.old/pl.lproj/.svn/entries new file mode 100644 index 0000000..b3b3d8f --- /dev/null +++ b/package/Resources.old/pl.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pl.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:07.000000Z +52766ae036f6cfadbb6a8dcc06ef47e7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2997 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:07.000000Z +1b4e873060327b88f251049a5e3510b5 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31436 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:07.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/pl.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/pl.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/pl.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/pl.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/pl.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..8cef5a4 --- /dev/null +++ b/package/Resources.old/pl.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon jest połączeniem różnych komponentów boot loadera.
Jest oparty na implementacji fake EFI Davida Elliotta dodanej do projektu boot-132 Apple'a.
Chameleon jest rozszerzony o następujące funkcje:

+


+

Nowe funkcje w Chameleonie 2.0

+


+

- Całkowicie konfigurowalne GUI by dodać trochę koloru do Bootloadera Darwin.

+

- Uruchamianie płyt Retail DVD przez bezpośrednie ładowanie obrazu ramdisk bez pomocy dodatkowych programów.

+

- Hibernacja. Ciesz się przywracaniem Twojego systemu Mac OS X z obrazu pamięci.

+

- Zastąpienie SMBIOS by zmodyfikować jego fabryczne wartości.

+

- Zastąpienie DSDT by móc używać zmodyfikowanego, poprawionego DSDT, który może rozwiązać parę problemów.

+

- Wstrzykiwanie ustawień urządzeń (Device Property Injection) przez łańcuch device-properties.

+

- Hybrydowe boot0 / boot1h dla dysków w układzie partycji MBR i GPT.

+

- Automatyczne wykrywanie FSB nawet dla najnowszych procesorów AMD.

+

- Obsługa Apple Software RAID.

+

- Automatyczne uruchamianie kart NVIDII oraz ATI/AMD.

+

- Wsparcie dla modułów.

+

- Wykrywanie pamięci dostosowane z memtest86: http://www.memtest.org

+

- Automatyczne generowanie stanów P-State & C-State w celu uzyskania natywnego zarządzania energią.

+

- Logownie komunikatów.

+


+

Kod jest publikowany z licencją Gnu Public License w wersji 2.

+

http://forge.voodooprojects.org/p/chameleon

+


+

By uzyskać bardziej dokładne informacje, odwiedź: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/pl.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/pl.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/pl.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/pl.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/pl.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..fb85d66 Binary files /dev/null and b/package/Resources.old/pl.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..16fdf0a --- /dev/null +++ b/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..e40bd8d --- /dev/null +++ b/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pl.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +96dc2464379407a853b477541056be9e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +952 + diff --git a/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..7309450 --- /dev/null +++ b/package/Resources.old/pl.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Zako\uc0\u324 czono wykonywanie skrypt\'f3w i plik logu \cf2 @LOG_FILENAME@\cf3 zosta\uc0\u322 zapisany \ +na g\uc0\u322 \'f3wnym katalogu wybranej partycji.\ +\ +\cf0 Prosz\uc0\u281 \cf4 przeczytaj go\cf0 by dowiedzie\uc0\u263 si\u281 ,\ +czy instalacja przebieg\uc0\u322 a pomy\u347 lnie i zachowaj go \ +jako zapis, co zosta\uc0\u322 o wykonane.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/pl.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/pl.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..7309450 --- /dev/null +++ b/package/Resources.old/pl.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Zako\uc0\u324 czono wykonywanie skrypt\'f3w i plik logu \cf2 @LOG_FILENAME@\cf3 zosta\uc0\u322 zapisany \ +na g\uc0\u322 \'f3wnym katalogu wybranej partycji.\ +\ +\cf0 Prosz\uc0\u281 \cf4 przeczytaj go\cf0 by dowiedzie\uc0\u263 si\u281 ,\ +czy instalacja przebieg\uc0\u322 a pomy\u347 lnie i zachowaj go \ +jako zapis, co zosta\uc0\u322 o wykonane.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/pl.lproj/Description.html b/package/Resources.old/pl.lproj/Description.html new file mode 100644 index 0000000..8cef5a4 --- /dev/null +++ b/package/Resources.old/pl.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon jest połączeniem różnych komponentów boot loadera.
Jest oparty na implementacji fake EFI Davida Elliotta dodanej do projektu boot-132 Apple'a.
Chameleon jest rozszerzony o następujące funkcje:

+


+

Nowe funkcje w Chameleonie 2.0

+


+

- Całkowicie konfigurowalne GUI by dodać trochę koloru do Bootloadera Darwin.

+

- Uruchamianie płyt Retail DVD przez bezpośrednie ładowanie obrazu ramdisk bez pomocy dodatkowych programów.

+

- Hibernacja. Ciesz się przywracaniem Twojego systemu Mac OS X z obrazu pamięci.

+

- Zastąpienie SMBIOS by zmodyfikować jego fabryczne wartości.

+

- Zastąpienie DSDT by móc używać zmodyfikowanego, poprawionego DSDT, który może rozwiązać parę problemów.

+

- Wstrzykiwanie ustawień urządzeń (Device Property Injection) przez łańcuch device-properties.

+

- Hybrydowe boot0 / boot1h dla dysków w układzie partycji MBR i GPT.

+

- Automatyczne wykrywanie FSB nawet dla najnowszych procesorów AMD.

+

- Obsługa Apple Software RAID.

+

- Automatyczne uruchamianie kart NVIDII oraz ATI/AMD.

+

- Wsparcie dla modułów.

+

- Wykrywanie pamięci dostosowane z memtest86: http://www.memtest.org

+

- Automatyczne generowanie stanów P-State & C-State w celu uzyskania natywnego zarządzania energią.

+

- Logownie komunikatów.

+


+

Kod jest publikowany z licencją Gnu Public License w wersji 2.

+

http://forge.voodooprojects.org/p/chameleon

+


+

By uzyskać bardziej dokładne informacje, odwiedź: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/pl.lproj/License.rtf b/package/Resources.old/pl.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/pl.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/pl.lproj/Localizable.strings b/package/Resources.old/pl.lproj/Localizable.strings new file mode 100644 index 0000000..fb85d66 Binary files /dev/null and b/package/Resources.old/pl.lproj/Localizable.strings differ diff --git a/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..05d7a57 --- /dev/null +++ b/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pl.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..25deea6 --- /dev/null +++ b/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pl.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:06.000000Z +5f65827cacd23855dad69d449f92999c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +660 + diff --git a/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..92f2aa8 --- /dev/null +++ b/package/Resources.old/pl.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Nie instaluj na komputerze Apple Macintosh\ + +\fs22 \cf0 \ +\ +Developerzy :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Podzi\uc0\u281 kowania dla :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Pakiet :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: janek202\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/pl.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/pl.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..92f2aa8 --- /dev/null +++ b/package/Resources.old/pl.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Nie instaluj na komputerze Apple Macintosh\ + +\fs22 \cf0 \ +\ +Developerzy :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Podzi\uc0\u281 kowania dla :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Pakiet :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: janek202\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/pt-BR.lproj/.svn/all-wcprops b/package/Resources.old/pt-BR.lproj/.svn/all-wcprops new file mode 100644 index 0000000..47dc9a2 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/License.rtf +END diff --git a/package/Resources.old/pt-BR.lproj/.svn/entries b/package/Resources.old/pt-BR.lproj/.svn/entries new file mode 100644 index 0000000..13f80a3 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pt-BR.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:15.000000Z +d007bffdf95b6885fd12ce28f811b354 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2964 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:15.000000Z +8a8b21bd15fb1cee0dba5fb51d18e709 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31032 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:15.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/pt-BR.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/pt-BR.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/pt-BR.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/pt-BR.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..67010c8 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

O Chameleon é um boot loader que combina vários componentes.
Ele é baseado na implementação de fake EFI feita por David Elliott, adicionada ao projeto boot-132 da Apple.
O Chameleon é extendido com as seguintes características chave:

+


+

Novos recursos no Chameleon 2.0

+


+

- Interface gráfica (GUI) totalmente personalizável para trazer algumas cores ao Bootloader Darwin.

+

- Inicializa DVDs retail lendo uma imagem ramdisk diretamente, sem ajuda de nenhum programa adicional.

+

- Hibernação. Aproveite continuar o seu Mac OS X com uma amostra de imagem da tela.

+

- Substituição de SMBIOS para modificar os valores de fábrica.

+

- Substituição de DSDT para usar uma tabela modificada que pode resolver diversos problemas.

+

- Injeção de propriedades de dispositivo através do string device-properties.

+

- boot0 / boot1h híbridos para discos particionados em MBR e GPT.

+

- Detecção automática de FSB mesmo para processadores AMD recentes.

+

- Suporte a Software RAID da Apple.

+

- Ativação Placas Gráficas Nvidia & ATI/AMD.

+

- Suporte de Modulos

+

- Deteção Memoria adaptada de memtest86: http://www.memtest.org

+

- P-State automático & Geração C-State para gestão de energia nativa.

+

- Protocolo Mensagens.

+


+

Este código é distribuido sobre os termos da versão 2 da Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Para informações detalhadas visite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/pt-BR.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/pt-BR.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/pt-BR.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/pt-BR.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..c1a67d8 Binary files /dev/null and b/package/Resources.old/pt-BR.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..97c0cbd --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..414d3d1 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pt-BR.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +b6ce927fc2a17c36de8e986bbb1c37a7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +891 + diff --git a/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..b394710 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Os scripts est\'e3o finalizados e foi gerado um\ + ficheiro \cf2 @LOG_FILENAME@\cf3 que se\ +encontra na raiz da parti\'e7\'e3o selecionada.\ +\ +\cf0 Por Favor \cf4 leia-o\cf0 para verificar se a instala\'e7\'e3o foi realizada\ +com sucesso e guarde como relat\'f3rio do que foi realizado.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..b394710 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Os scripts est\'e3o finalizados e foi gerado um\ + ficheiro \cf2 @LOG_FILENAME@\cf3 que se\ +encontra na raiz da parti\'e7\'e3o selecionada.\ +\ +\cf0 Por Favor \cf4 leia-o\cf0 para verificar se a instala\'e7\'e3o foi realizada\ +com sucesso e guarde como relat\'f3rio do que foi realizado.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/pt-BR.lproj/Description.html b/package/Resources.old/pt-BR.lproj/Description.html new file mode 100644 index 0000000..67010c8 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

O Chameleon é um boot loader que combina vários componentes.
Ele é baseado na implementação de fake EFI feita por David Elliott, adicionada ao projeto boot-132 da Apple.
O Chameleon é extendido com as seguintes características chave:

+


+

Novos recursos no Chameleon 2.0

+


+

- Interface gráfica (GUI) totalmente personalizável para trazer algumas cores ao Bootloader Darwin.

+

- Inicializa DVDs retail lendo uma imagem ramdisk diretamente, sem ajuda de nenhum programa adicional.

+

- Hibernação. Aproveite continuar o seu Mac OS X com uma amostra de imagem da tela.

+

- Substituição de SMBIOS para modificar os valores de fábrica.

+

- Substituição de DSDT para usar uma tabela modificada que pode resolver diversos problemas.

+

- Injeção de propriedades de dispositivo através do string device-properties.

+

- boot0 / boot1h híbridos para discos particionados em MBR e GPT.

+

- Detecção automática de FSB mesmo para processadores AMD recentes.

+

- Suporte a Software RAID da Apple.

+

- Ativação Placas Gráficas Nvidia & ATI/AMD.

+

- Suporte de Modulos

+

- Deteção Memoria adaptada de memtest86: http://www.memtest.org

+

- P-State automático & Geração C-State para gestão de energia nativa.

+

- Protocolo Mensagens.

+


+

Este código é distribuido sobre os termos da versão 2 da Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Para informações detalhadas visite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/pt-BR.lproj/License.rtf b/package/Resources.old/pt-BR.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/pt-BR.lproj/Localizable.strings b/package/Resources.old/pt-BR.lproj/Localizable.strings new file mode 100644 index 0000000..c1a67d8 Binary files /dev/null and b/package/Resources.old/pt-BR.lproj/Localizable.strings differ diff --git a/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..eace8da --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-BR.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..6e385ee --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pt-BR.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +1c0c498707357b9394445888d2c1c448 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +675 + diff --git a/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..c7ef138 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 N\'e3o instale num computador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Desenvolvedores :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Agradecimentos :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Cr\'e9ditos pelos pacotes :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: oldnapalm\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/pt-BR.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..c7ef138 --- /dev/null +++ b/package/Resources.old/pt-BR.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 N\'e3o instale num computador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Desenvolvedores :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Agradecimentos :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Cr\'e9ditos pelos pacotes :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: oldnapalm\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/pt-PT.lproj/.svn/all-wcprops b/package/Resources.old/pt-PT.lproj/.svn/all-wcprops new file mode 100644 index 0000000..bbded02 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/License.rtf +END diff --git a/package/Resources.old/pt-PT.lproj/.svn/entries b/package/Resources.old/pt-PT.lproj/.svn/entries new file mode 100644 index 0000000..d3fd237 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pt-PT.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:05.000000Z +4c304051f311cc609a809966ed2a1af0 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2969 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:05.000000Z +7f137df5c13536bf8daa4b3e6221b4ce +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +31032 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:05.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/pt-PT.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/pt-PT.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/pt-PT.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/pt-PT.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..223800f --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

O Chameleon é um boot loader que combina vários componentes.
Ele é baseado na implementação de fake EFI feita por David Elliott, adicionada ao projeto boot-132 da Apple.
O Chameleon é extendido com as seguintes características chave:

+


+

Novos recursos no Chameleon 2.0

+


+

- Interface gráfica (GUI) totalmente personalizável para trazer algumas cores ao Bootloader Darwin.

+

- Inicializa DVDs retail lendo uma imagem ramdisk directamente, sem ajuda de nenhum programa adicional.

+

- Hibernação. Desfrute de continuar o seu Mac OS X com uma amostra de imagem da tela.

+

- Substituição de SMBIOS para modificar os valores de fábrica.

+

- Substituicção de DSDT para usar uma tabela modificada que pode resolver diversos problemas.

+

- Injecção de propriedades de dispositivo através do string device-properties.

+

- boot0 / boot1h híbridos para discos particionados em MBR e GPT.

+

- Detecção automática de FSB mesmo para processadores AMD recentes.

+

- Suporte a Software RAID da Apple.

+

- Ativação Placas Gráficas Nvidia & ATI/AMD.

+

- Suporte de Modulos

+

- Deteção Memoria adaptada de memtest86: http://www.memtest.org

+

- P-State automático & Geração C-State para gestão de energia nativa.

+

- Protocolo Mensagens.

+


+

Este código é distribuido sobre os termos da versão 2 da Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Para informações detalhadas visite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/pt-PT.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/pt-PT.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/pt-PT.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/pt-PT.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..39f313c Binary files /dev/null and b/package/Resources.old/pt-PT.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..d5abc0d --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..3b131ac --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pt-PT.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +b6ce927fc2a17c36de8e986bbb1c37a7 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +891 + diff --git a/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..b394710 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Os scripts est\'e3o finalizados e foi gerado um\ + ficheiro \cf2 @LOG_FILENAME@\cf3 que se\ +encontra na raiz da parti\'e7\'e3o selecionada.\ +\ +\cf0 Por Favor \cf4 leia-o\cf0 para verificar se a instala\'e7\'e3o foi realizada\ +com sucesso e guarde como relat\'f3rio do que foi realizado.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..b394710 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Os scripts est\'e3o finalizados e foi gerado um\ + ficheiro \cf2 @LOG_FILENAME@\cf3 que se\ +encontra na raiz da parti\'e7\'e3o selecionada.\ +\ +\cf0 Por Favor \cf4 leia-o\cf0 para verificar se a instala\'e7\'e3o foi realizada\ +com sucesso e guarde como relat\'f3rio do que foi realizado.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/pt-PT.lproj/Description.html b/package/Resources.old/pt-PT.lproj/Description.html new file mode 100644 index 0000000..223800f --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

O Chameleon é um boot loader que combina vários componentes.
Ele é baseado na implementação de fake EFI feita por David Elliott, adicionada ao projeto boot-132 da Apple.
O Chameleon é extendido com as seguintes características chave:

+


+

Novos recursos no Chameleon 2.0

+


+

- Interface gráfica (GUI) totalmente personalizável para trazer algumas cores ao Bootloader Darwin.

+

- Inicializa DVDs retail lendo uma imagem ramdisk directamente, sem ajuda de nenhum programa adicional.

+

- Hibernação. Desfrute de continuar o seu Mac OS X com uma amostra de imagem da tela.

+

- Substituição de SMBIOS para modificar os valores de fábrica.

+

- Substituicção de DSDT para usar uma tabela modificada que pode resolver diversos problemas.

+

- Injecção de propriedades de dispositivo através do string device-properties.

+

- boot0 / boot1h híbridos para discos particionados em MBR e GPT.

+

- Detecção automática de FSB mesmo para processadores AMD recentes.

+

- Suporte a Software RAID da Apple.

+

- Ativação Placas Gráficas Nvidia & ATI/AMD.

+

- Suporte de Modulos

+

- Deteção Memoria adaptada de memtest86: http://www.memtest.org

+

- P-State automático & Geração C-State para gestão de energia nativa.

+

- Protocolo Mensagens.

+


+

Este código é distribuido sobre os termos da versão 2 da Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Para informações detalhadas visite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/pt-PT.lproj/License.rtf b/package/Resources.old/pt-PT.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/pt-PT.lproj/Localizable.strings b/package/Resources.old/pt-PT.lproj/Localizable.strings new file mode 100644 index 0000000..39f313c Binary files /dev/null and b/package/Resources.old/pt-PT.lproj/Localizable.strings differ diff --git a/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..e928ded --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/pt-PT.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..5d75188 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/pt-PT.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:05.000000Z +7f68102b7426aba633dfed4758769108 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +674 + diff --git a/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..cb87243 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 N\'e3o instale num computador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Desenvolvedores :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Agradecimentos :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Cr\'e9ditos pelos pacotes :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: artur-pt\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/pt-PT.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..cb87243 --- /dev/null +++ b/package/Resources.old/pt-PT.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 N\'e3o instale num computador Apple Macintosh\ + +\fs22 \cf0 \ +\ +Desenvolvedores :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Agradecimentos :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Cr\'e9ditos pelos pacotes :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: artur-pt\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ro.lproj/.svn/all-wcprops b/package/Resources.old/ro.lproj/.svn/all-wcprops new file mode 100644 index 0000000..fd92a99 --- /dev/null +++ b/package/Resources.old/ro.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/License.rtf +END diff --git a/package/Resources.old/ro.lproj/.svn/entries b/package/Resources.old/ro.lproj/.svn/entries new file mode 100644 index 0000000..c2312a0 --- /dev/null +++ b/package/Resources.old/ro.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ro.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:07.000000Z +784ac07a115704f49be8449718f2157f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2650 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:07.000000Z +40b6f98085993ffa0cd95a1cf2913301 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32658 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:07.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/ro.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/ro.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/ro.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/ro.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/ro.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..e473b05 --- /dev/null +++ b/package/Resources.old/ro.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon este un bootloader cu elemente combinate, derivat din implementarea fake EFI a lui David Elliott si proiectul Apple's boot-132.

+


+

Chameleon v2 ofera un numar de facilitati, cum ar fi:

+


+

- Interfata grafica complet modificabila dupa preferintele userului.

+

- RamDisk pentru boot cu versiuni retail Mac OS X.

+

- Hibernare folosind imaginea de hibernare.

+

- SMBIOS modificabil pentru a extinde compatibilitatea cu diferite computere.

+

- DSDT modificabil, oferind avantajul de a corecta posibilele incompatibilitati hardware.

+

- Injectare de proprietati pentru diferite hardware-uri.

+

- boot0 / boot1h hibrid, pentru partiti MBR precum si GPT.

+

- FSB detectabil automat, chiar si pentru procesoare AMD noi.

+

- Suport nativ RAID in OS X.

+

- Activare mod video pentru nVidia si ATI/AMD.

+

- Suport pentru module

+

- Detectare automata a memoriei bazata pe memtest86: http://www.memtest.org

+

- Generare automata P-states si C-states pentru management al energiei.

+

- Logare mesaje.

+


+

Acest cod este acoperit de versiunea 2 a Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ro.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/ro.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ro.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ro.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/ro.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..ba39ce5 Binary files /dev/null and b/package/Resources.old/ro.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0311212 --- /dev/null +++ b/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..82e58b6 --- /dev/null +++ b/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ro.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:07.000000Z +ed560f87118c38bdc75e6b2b53b54f03 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +890 + diff --git a/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..e92f8ba --- /dev/null +++ b/package/Resources.old/ro.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Scripturiile au fost executate iar un fisier\ + numit \cf2 @LOG_FILENAME@\cf3 a fost salvat in\ +directorul principal al partitiei selectate.\ +\ +\cf0 Va rugam \cf4 sa il cititi\cf0 pentru a afla daca instalarea a fost\ +facuta cu succes si pentru a tine evidenta modificariilor facute.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 2011-2012\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Pachet compilat de: %WHOBUILD%} diff --git a/package/Resources.old/ro.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/ro.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..e92f8ba --- /dev/null +++ b/package/Resources.old/ro.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Scripturiile au fost executate iar un fisier\ + numit \cf2 @LOG_FILENAME@\cf3 a fost salvat in\ +directorul principal al partitiei selectate.\ +\ +\cf0 Va rugam \cf4 sa il cititi\cf0 pentru a afla daca instalarea a fost\ +facuta cu succes si pentru a tine evidenta modificariilor facute.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 2011-2012\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Pachet compilat de: %WHOBUILD%} diff --git a/package/Resources.old/ro.lproj/Description.html b/package/Resources.old/ro.lproj/Description.html new file mode 100644 index 0000000..e473b05 --- /dev/null +++ b/package/Resources.old/ro.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon este un bootloader cu elemente combinate, derivat din implementarea fake EFI a lui David Elliott si proiectul Apple's boot-132.

+


+

Chameleon v2 ofera un numar de facilitati, cum ar fi:

+


+

- Interfata grafica complet modificabila dupa preferintele userului.

+

- RamDisk pentru boot cu versiuni retail Mac OS X.

+

- Hibernare folosind imaginea de hibernare.

+

- SMBIOS modificabil pentru a extinde compatibilitatea cu diferite computere.

+

- DSDT modificabil, oferind avantajul de a corecta posibilele incompatibilitati hardware.

+

- Injectare de proprietati pentru diferite hardware-uri.

+

- boot0 / boot1h hibrid, pentru partiti MBR precum si GPT.

+

- FSB detectabil automat, chiar si pentru procesoare AMD noi.

+

- Suport nativ RAID in OS X.

+

- Activare mod video pentru nVidia si ATI/AMD.

+

- Suport pentru module

+

- Detectare automata a memoriei bazata pe memtest86: http://www.memtest.org

+

- Generare automata P-states si C-states pentru management al energiei.

+

- Logare mesaje.

+


+

Acest cod este acoperit de versiunea 2 a Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ro.lproj/License.rtf b/package/Resources.old/ro.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ro.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ro.lproj/Localizable.strings b/package/Resources.old/ro.lproj/Localizable.strings new file mode 100644 index 0000000..ba39ce5 Binary files /dev/null and b/package/Resources.old/ro.lproj/Localizable.strings differ diff --git a/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..8f5f6df --- /dev/null +++ b/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ro.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..1403e92 --- /dev/null +++ b/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ro.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:07.000000Z +b7ea923904ef8765dad623d281576e40 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1404 + diff --git a/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..8d134cf --- /dev/null +++ b/package/Resources.old/ro.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,53 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;\red0\green0\blue255;\red153\green153\blue153; +} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri0\qc + +\f0\b\fs28 \cf0 \ +\pard\ri0\qc + +\fs48 \cf0 Chameleon +\fs50 \ +\pard\ri0\qc + +\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ +\pard\ri0\qc + +\fs28 \cf0 \ +\pard\ri0\qc +\cf2 Nu instalati acest software pe un computer Apple Macintosh\ +\pard\ri0\qc +\cf0 \ +\pard\ri0\ql\qnatural + +\fs24 \cf0 Developeri : +\fs20 %DEVELOP% +\fs24 \ + +\fs18 \ + +\fs24 Multumiri : +\fs20 %CREDITS% +\fs24 \ +\pard\tx360\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural + +\b0\fs18 \cf0 \ +\pard\ri0\ql\qnatural + +\b\fs24 \cf0 Pachet : +\fs20 %PKGDEV% +\b0\fs30 \ +\pard\tx360\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural +\cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\fs20 \cf0 Copyright \'a9 2011-2012 +\b \cf3 Tradus de : RvXtm\ +\pard\tx360\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural + +\b0\fs18 \cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b\fs20 \cf4 Pachet compilat de: %WHOBUILD%} diff --git a/package/Resources.old/ro.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/ro.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..8d134cf --- /dev/null +++ b/package/Resources.old/ro.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,53 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;\red0\green0\blue255;\red153\green153\blue153; +} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri0\qc + +\f0\b\fs28 \cf0 \ +\pard\ri0\qc + +\fs48 \cf0 Chameleon +\fs50 \ +\pard\ri0\qc + +\fs26 \cf0 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ +\pard\ri0\qc + +\fs28 \cf0 \ +\pard\ri0\qc +\cf2 Nu instalati acest software pe un computer Apple Macintosh\ +\pard\ri0\qc +\cf0 \ +\pard\ri0\ql\qnatural + +\fs24 \cf0 Developeri : +\fs20 %DEVELOP% +\fs24 \ + +\fs18 \ + +\fs24 Multumiri : +\fs20 %CREDITS% +\fs24 \ +\pard\tx360\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural + +\b0\fs18 \cf0 \ +\pard\ri0\ql\qnatural + +\b\fs24 \cf0 Pachet : +\fs20 %PKGDEV% +\b0\fs30 \ +\pard\tx360\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural +\cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\fs20 \cf0 Copyright \'a9 2011-2012 +\b \cf3 Tradus de : RvXtm\ +\pard\tx360\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural + +\b0\fs18 \cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b\fs20 \cf4 Pachet compilat de: %WHOBUILD%} diff --git a/package/Resources.old/ru.lproj/.svn/all-wcprops b/package/Resources.old/ru.lproj/.svn/all-wcprops new file mode 100644 index 0000000..caf397c --- /dev/null +++ b/package/Resources.old/ru.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/License.rtf +END diff --git a/package/Resources.old/ru.lproj/.svn/entries b/package/Resources.old/ru.lproj/.svn/entries new file mode 100644 index 0000000..706138d --- /dev/null +++ b/package/Resources.old/ru.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ru.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:15.000000Z +15ce6bca2671f9ddcb994cb07a318739 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +3352 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:15.000000Z +087ea180bd0ae6271b6ba4da6a704c44 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32782 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:15.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/ru.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/ru.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/ru.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/ru.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/ru.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..b862adb --- /dev/null +++ b/package/Resources.old/ru.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon представляет собой комбинацию различных компонентов и основывается на эмуляции EFI реализованной Дэвидом Элиотом (David Elliott) интегрированной в оригинальный проект boot-132 от Apple.
Chameleon включает в себя следующие улучшения:

+


+

Новые возможности Chameleon 2.0

+


+

- Полностью изменяемый интерфейс пользователя для улучшения внешнего вида загрузчика Darwin.

+

- Загрузка оригинального установочного диска Mac OS X без помощи посторонних программ.

+

- Поддержка гибернации.

+

- Переопределение фабричных параметров SMBIOS.

+

- Возможность использования модифицированного DSDT для решения некоторых специфических проблем.

+

- Инжекция Device Property Strings.

+

- Гибридный boot0 / boot1h для разметок MBR и GPT.

+

- Автоматическое определение FSB даже для процессоров AMD.

+

- Поддержка программных RAID массивов Apple.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Более подробная информация по загрузчику: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ru.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/ru.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ru.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ru.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/ru.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..58af2e0 Binary files /dev/null and b/package/Resources.old/ru.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..b7d6a3d --- /dev/null +++ b/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..9de6129 --- /dev/null +++ b/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ru.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +0d080022200ced0bb9336201a5f4ce4a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +854 + diff --git a/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/ru.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ru.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/ru.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..0d30878 --- /dev/null +++ b/package/Resources.old/ru.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +The scripts have completed and a file\ + named \cf2 @LOG_FILENAME@\cf3 has been\ +written to the root of your chosen partition.\ +\ +\cf0 Please \cf4 read it\cf0 to find out if the installation was\ +successful and keep it for a record of what was done.\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/ru.lproj/Description.html b/package/Resources.old/ru.lproj/Description.html new file mode 100644 index 0000000..b862adb --- /dev/null +++ b/package/Resources.old/ru.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon представляет собой комбинацию различных компонентов и основывается на эмуляции EFI реализованной Дэвидом Элиотом (David Elliott) интегрированной в оригинальный проект boot-132 от Apple.
Chameleon включает в себя следующие улучшения:

+


+

Новые возможности Chameleon 2.0

+


+

- Полностью изменяемый интерфейс пользователя для улучшения внешнего вида загрузчика Darwin.

+

- Загрузка оригинального установочного диска Mac OS X без помощи посторонних программ.

+

- Поддержка гибернации.

+

- Переопределение фабричных параметров SMBIOS.

+

- Возможность использования модифицированного DSDT для решения некоторых специфических проблем.

+

- Инжекция Device Property Strings.

+

- Гибридный boot0 / boot1h для разметок MBR и GPT.

+

- Автоматическое определение FSB даже для процессоров AMD.

+

- Поддержка программных RAID массивов Apple.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Более подробная информация по загрузчику: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/ru.lproj/License.rtf b/package/Resources.old/ru.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/ru.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/ru.lproj/Localizable.strings b/package/Resources.old/ru.lproj/Localizable.strings new file mode 100644 index 0000000..58af2e0 Binary files /dev/null and b/package/Resources.old/ru.lproj/Localizable.strings differ diff --git a/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..4891990 --- /dev/null +++ b/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/ru.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..40fd677 --- /dev/null +++ b/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/ru.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +3bac0fb02eb7a3e40049404e0d9448e2 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +641 + diff --git a/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/ru.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/ru.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/ru.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..2e17b1b --- /dev/null +++ b/package/Resources.old/ru.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Do not install to an Apple Macintosh computer\ + +\fs22 \cf0 \ +\ +Developers :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Thanks to :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Package :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: ???\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/sr.lproj/.svn/all-wcprops b/package/Resources.old/sr.lproj/.svn/all-wcprops new file mode 100644 index 0000000..446537a --- /dev/null +++ b/package/Resources.old/sr.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/License.rtf +END diff --git a/package/Resources.old/sr.lproj/.svn/entries b/package/Resources.old/sr.lproj/.svn/entries new file mode 100644 index 0000000..54140ec --- /dev/null +++ b/package/Resources.old/sr.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/sr.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:15.000000Z +6a0eaab05f0eca4e40c4333b38a0f9e1 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2818 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:15.000000Z +f25babb8e5e612ca5d7e140746b4dd4c +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +32074 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:15.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/sr.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/sr.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/sr.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/sr.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/sr.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..7d3f67c --- /dev/null +++ b/package/Resources.old/sr.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon je kombinacija različitih komponenti bootloadera. On je zasnovan na David Elliottovoj lažnoj EFI implementaciji dodanoj u Apple boot-132 projekat.

+


+

Nove funkcije u Chameleon 2.0

+


+

- Potpuno prilagođen grafički korisinički interfejs donosi vizuelna poboljšanja u Darwin Bootloaderu.

+

- Start sa retail DVD-om direktno učitava ramdisk slike bez pomoći dodatnih programa.

+

- Hibernacija. Uživajte u nastavaku rada vašeg Mac OS X-a sa pregledom slike.

+

- SMBIOS zamena tvorničkih za modifikovanu SMBIOS vrednost.

+

- DSDT zamena za korišćenje modifikovanog, ispravljenog DSDT-a koji može rešiti nekoliko problema.

+

- Implementacija svojstva uređaja putem svojstva niza.

+

- hibridni boot0 / boot1h za MBR i GPT particijske diskove.

+

- automatsko FSB kodno otkrivanje čak i za poslednje AMD procesore. 

+

- Apple softver RAID podrška.

+

- Nvidia & ATI/AMD Grafički Aktivator.

+

- Modul podrška

+

- Detekcija memorije prilagođena iz memtest86: http://www.memtest.org

+

- Automatsko generisanje P-State i C-State za izvorno upravljanje energijom.

+

- Prijava porukama.

+


+

Kod je objavljen pod verzijom 2 GNU javna licenca.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Za detaljne informacije posetite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/sr.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/sr.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/sr.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/sr.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/sr.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..3d836a7 Binary files /dev/null and b/package/Resources.old/sr.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..856d664 --- /dev/null +++ b/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..fc75d1f --- /dev/null +++ b/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/sr.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +f6ce430b5c8dc7a2a874b574bc7c917b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +904 + diff --git a/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..88239ed --- /dev/null +++ b/package/Resources.old/sr.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skripte su zavr\'9aene i mapa pod\ + nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\ + u koren particije diska koje ste odabrali.\ +\ +\cf0 Molimo \cf4 pro\uc0\u269 itajte\cf0 kako biste saznali da li je instalacija bila\ + uspe\'9ana i \uc0\u269 uvajte log radi evidencije o tome \'9ata je u\u269 injeno\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/sr.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/sr.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..88239ed --- /dev/null +++ b/package/Resources.old/sr.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,29 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ +Skripte su zavr\'9aene i mapa pod\ + nazivom \cf2 @LOG_FILENAME@\cf3 je snimljena\ + u koren particije diska koje ste odabrali.\ +\ +\cf0 Molimo \cf4 pro\uc0\u269 itajte\cf0 kako biste saznali da li je instalacija bila\ + uspe\'9ana i \uc0\u269 uvajte log radi evidencije o tome \'9ata je u\u269 injeno\ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/sr.lproj/Description.html b/package/Resources.old/sr.lproj/Description.html new file mode 100644 index 0000000..7d3f67c --- /dev/null +++ b/package/Resources.old/sr.lproj/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon je kombinacija različitih komponenti bootloadera. On je zasnovan na David Elliottovoj lažnoj EFI implementaciji dodanoj u Apple boot-132 projekat.

+


+

Nove funkcije u Chameleon 2.0

+


+

- Potpuno prilagođen grafički korisinički interfejs donosi vizuelna poboljšanja u Darwin Bootloaderu.

+

- Start sa retail DVD-om direktno učitava ramdisk slike bez pomoći dodatnih programa.

+

- Hibernacija. Uživajte u nastavaku rada vašeg Mac OS X-a sa pregledom slike.

+

- SMBIOS zamena tvorničkih za modifikovanu SMBIOS vrednost.

+

- DSDT zamena za korišćenje modifikovanog, ispravljenog DSDT-a koji može rešiti nekoliko problema.

+

- Implementacija svojstva uređaja putem svojstva niza.

+

- hibridni boot0 / boot1h za MBR i GPT particijske diskove.

+

- automatsko FSB kodno otkrivanje čak i za poslednje AMD procesore. 

+

- Apple softver RAID podrška.

+

- Nvidia & ATI/AMD Grafički Aktivator.

+

- Modul podrška

+

- Detekcija memorije prilagođena iz memtest86: http://www.memtest.org

+

- Automatsko generisanje P-State i C-State za izvorno upravljanje energijom.

+

- Prijava porukama.

+


+

Kod je objavljen pod verzijom 2 GNU javna licenca.

+

http://forge.voodooprojects.org/p/chameleon

+


+

Za detaljne informacije posetite: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/sr.lproj/License.rtf b/package/Resources.old/sr.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/sr.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/sr.lproj/Localizable.strings b/package/Resources.old/sr.lproj/Localizable.strings new file mode 100644 index 0000000..3d836a7 Binary files /dev/null and b/package/Resources.old/sr.lproj/Localizable.strings differ diff --git a/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..b3a4946 --- /dev/null +++ b/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/sr.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..3d84f95 --- /dev/null +++ b/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/sr.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:15.000000Z +33aca8376137383f63fcfd3dc1105c3a +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +665 + diff --git a/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..909a242 --- /dev/null +++ b/package/Resources.old/sr.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Instalacija nije prilago\uc0\u273 ena za Apple Macintosh ra\u269 unare\ + +\fs22 \cf0 \ +\ +Programeri :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Hvala :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paket :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: mistudio\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/sr.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/sr.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..909a242 --- /dev/null +++ b/package/Resources.old/sr.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\cf2 Instalacija nije prilago\uc0\u273 ena za Apple Macintosh ra\u269 unare\ + +\fs22 \cf0 \ +\ +Programeri :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +Hvala :\ + +\b0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\b \cf0 Paket :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language translated by: mistudio\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/zh_CN.lproj/.svn/all-wcprops b/package/Resources.old/zh_CN.lproj/.svn/all-wcprops new file mode 100644 index 0000000..7729574 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/License.rtf +END diff --git a/package/Resources.old/zh_CN.lproj/.svn/entries b/package/Resources.old/zh_CN.lproj/.svn/entries new file mode 100644 index 0000000..7cf1a4a --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/zh_CN.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:04.000000Z +577af809a9c69f2d0f004d4f70718a4b +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4049 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:04.000000Z +fdd77777b01dab6a810c9ff1c79c1387 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +27372 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:04.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/zh_CN.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/zh_CN.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/zh_CN.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/zh_CN.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..ffec0f0 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,46 @@ + + + + + + + + + +

Chameleon 是一个结合许多组件的开机引导器。这些组件的演变来自于 David Elliott 加入 Apple boot-132 程序项目的 fake EFI 安装工具。

+


+

Chameleon v2 现在已经扩充了许多功能。例如:

+


+

- 客制化的图形用户介面,为 Darwin Bootloader 带来更多的色彩。

+

- 无须其他程序,即可载入 ramdisk 来直接启动 零售版 DVD

+

- 支持睡眠。 可使用睡眠映像恢复继续使用 Mac OS X

+

- 可使用修改过的 SMBIOS 覆盖 SMBIOS 之出厂设定值。

+

- 可使用修正过的 DSDT 覆盖原始 DSDT,并可解决许多问题。

+

- 可透过 device-properties string 自动注入设备属性。

+

- 支持 MBR GPT 分区磁盘的  boot0 / boot1h 多重开机功能。

+

- 具有自动侦测 FSB 码功能,并可用于新式的 AMD CPU

+

- 支持 Apple Software RAID 功能。

+

- 支持 Nvidia & ATI/AMD 显示卡启用功能。

+

- 支持模组功能。

+

- 支持改编自 memtest86: http://www.memtest.org 的内存侦测功能。

+

- 具有自动生成 P-State C-State 的原生电源管理之功能。

+

- 具有信息纪录之功能。

+


+

源代码依照 Gnu Public License v2 的原则释放于以下网站上。

+

http://forge.voodooprojects.org/p/chameleon

+


+

常见问题: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/zh_CN.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/zh_CN.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/zh_CN.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/zh_CN.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..32e2da7 Binary files /dev/null and b/package/Resources.old/zh_CN.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..a5bf2be --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..7b2bd50 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/zh_CN.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:04.000000Z +9aea1d2d18daf80c3ef6ff3785b94b55 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1174 + diff --git a/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..891329d --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset134 STHeitiSC-Light;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ + +\f1 \'b0\'b2\'d7\'b0\'b3\'cc\'d0\'f2\'d2\'d1\'be\'ad\'cd\'ea\'b3\'c9 +\f0 \ + +\f1 \'b2\'a2\'d4\'da\'d1\'a1\'d4\'f1\'b0\'b2\'d7\'b0\'b5\'c4\'b7\'d6\'c7\'f8\'bd\'a8\'c1\'a2 +\f0 \cf2 \ +@LOG_FILENAME@\cf3 +\f1 \cf0 \'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe\'a1\'a3 +\f0 \cf2 \ +\ + +\f1 \cf0 \'c7\'eb +\f0 +\f1 \cf4 \'cf\'ea\'d4\'c4\'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe +\f0 \cf0 \ + +\f1 \'c8\'b7\'c8\'cf\'b0\'b2\'d7\'b0\'ca\'c7\'b7\'f1\'b3\'c9\'b9\'a6\'a3\'ac\'b2\'a2\'b1\'a3\'c1\'f4\'b0\'b2\'d7\'b0\'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe\'b1\'b8\'b2\'e9\'a1\'a3 +\f0 \ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..891329d --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset134 STHeitiSC-Light;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ + +\f1 \'b0\'b2\'d7\'b0\'b3\'cc\'d0\'f2\'d2\'d1\'be\'ad\'cd\'ea\'b3\'c9 +\f0 \ + +\f1 \'b2\'a2\'d4\'da\'d1\'a1\'d4\'f1\'b0\'b2\'d7\'b0\'b5\'c4\'b7\'d6\'c7\'f8\'bd\'a8\'c1\'a2 +\f0 \cf2 \ +@LOG_FILENAME@\cf3 +\f1 \cf0 \'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe\'a1\'a3 +\f0 \cf2 \ +\ + +\f1 \cf0 \'c7\'eb +\f0 +\f1 \cf4 \'cf\'ea\'d4\'c4\'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe +\f0 \cf0 \ + +\f1 \'c8\'b7\'c8\'cf\'b0\'b2\'d7\'b0\'ca\'c7\'b7\'f1\'b3\'c9\'b9\'a6\'a3\'ac\'b2\'a2\'b1\'a3\'c1\'f4\'b0\'b2\'d7\'b0\'bc\'cd\'c2\'bc\'ce\'c4\'bc\'fe\'b1\'b8\'b2\'e9\'a1\'a3 +\f0 \ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/zh_CN.lproj/Description.html b/package/Resources.old/zh_CN.lproj/Description.html new file mode 100644 index 0000000..ffec0f0 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Description.html @@ -0,0 +1,46 @@ + + + + + + + + + +

Chameleon 是一个结合许多组件的开机引导器。这些组件的演变来自于 David Elliott 加入 Apple boot-132 程序项目的 fake EFI 安装工具。

+


+

Chameleon v2 现在已经扩充了许多功能。例如:

+


+

- 客制化的图形用户介面,为 Darwin Bootloader 带来更多的色彩。

+

- 无须其他程序,即可载入 ramdisk 来直接启动 零售版 DVD

+

- 支持睡眠。 可使用睡眠映像恢复继续使用 Mac OS X

+

- 可使用修改过的 SMBIOS 覆盖 SMBIOS 之出厂设定值。

+

- 可使用修正过的 DSDT 覆盖原始 DSDT,并可解决许多问题。

+

- 可透过 device-properties string 自动注入设备属性。

+

- 支持 MBR GPT 分区磁盘的  boot0 / boot1h 多重开机功能。

+

- 具有自动侦测 FSB 码功能,并可用于新式的 AMD CPU

+

- 支持 Apple Software RAID 功能。

+

- 支持 Nvidia & ATI/AMD 显示卡启用功能。

+

- 支持模组功能。

+

- 支持改编自 memtest86: http://www.memtest.org 的内存侦测功能。

+

- 具有自动生成 P-State C-State 的原生电源管理之功能。

+

- 具有信息纪录之功能。

+


+

源代码依照 Gnu Public License v2 的原则释放于以下网站上。

+

http://forge.voodooprojects.org/p/chameleon

+


+

常见问题: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/zh_CN.lproj/License.rtf b/package/Resources.old/zh_CN.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/zh_CN.lproj/Localizable.strings b/package/Resources.old/zh_CN.lproj/Localizable.strings new file mode 100644 index 0000000..32e2da7 Binary files /dev/null and b/package/Resources.old/zh_CN.lproj/Localizable.strings differ diff --git a/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..265f879 --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_CN.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..a3e28cb --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/zh_CN.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:04.000000Z +c1e6e2b7a4e9be3dd5894e74735bbba6 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +980 + diff --git a/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..cbf052d --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,60 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset136 STHeitiTC-Light;\f2\fnil\fcharset134 STHeitiSC-Light; +} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1 \cf2 \uc0\u35831 \'a4\'c5\'a6\'77\u35013 \'a8\'ec +\f0 \cf2 Apple +\f1 \cf2 \'aa\'ba +\f0 \cf2 Macintosh +\f1 \cf2 \uc0\u30005 \u33041 +\f0 \cf2 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\f2 \cf0 \'bf\'aa\'b7\'a2\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\f2 \cf0 \'b8\'d0\'d0\'bb +\f0 :\ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\f2\b \cf0 \'b7\'e2\'d7\'b0\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language +\f1\fs20 \'c2\'bd\uc0\u35793 +\f0\fs18 : crazybirdy, Ulimate\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/zh_CN.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..cbf052d --- /dev/null +++ b/package/Resources.old/zh_CN.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,60 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset136 STHeitiTC-Light;\f2\fnil\fcharset134 STHeitiSC-Light; +} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1 \cf2 \uc0\u35831 \'a4\'c5\'a6\'77\u35013 \'a8\'ec +\f0 \cf2 Apple +\f1 \cf2 \'aa\'ba +\f0 \cf2 Macintosh +\f1 \cf2 \uc0\u30005 \u33041 +\f0 \cf2 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\f2 \cf0 \'bf\'aa\'b7\'a2\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\f2 \cf0 \'b8\'d0\'d0\'bb +\f0 :\ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\f2\b \cf0 \'b7\'e2\'d7\'b0\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language +\f1\fs20 \'c2\'bd\uc0\u35793 +\f0\fs18 : crazybirdy, Ulimate\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/zh_TW.lproj/.svn/all-wcprops b/package/Resources.old/zh_TW.lproj/.svn/all-wcprops new file mode 100644 index 0000000..5d54a72 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/Localizable.strings +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/License.rtf +END diff --git a/package/Resources.old/zh_TW.lproj/.svn/entries b/package/Resources.old/zh_TW.lproj/.svn/entries new file mode 100644 index 0000000..9e16141 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/.svn/entries @@ -0,0 +1,136 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/zh_TW.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Description.html +file + + + + +2013-08-27T23:56:01.000000Z +cb7d74fadc783a2df8c212ece152a83d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4442 + +Welcome.rtfd +dir + +Localizable.strings +file + + + + +2013-08-27T23:56:01.000000Z +024d156709e493af1486831be3a50cbf +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +27372 + +Conclusion.rtfd +dir + +License.rtf +file + + + + +2013-08-27T23:56:01.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources.old/zh_TW.lproj/.svn/prop-base/Localizable.strings.svn-base b/package/Resources.old/zh_TW.lproj/.svn/prop-base/Localizable.strings.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/.svn/prop-base/Localizable.strings.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources.old/zh_TW.lproj/.svn/text-base/Description.html.svn-base b/package/Resources.old/zh_TW.lproj/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..4cd9682 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/.svn/text-base/Description.html.svn-base @@ -0,0 +1,47 @@ + + + + + + + + + +

Chameleon 是一個結合許多組件的開機引導器。這些組件的演變來自於 David Elliott 加入 Apple boot-132 程式項目的 fake EFI 安裝工具。

+


+

Chameleon v2 現在已經擴充了許多功能。例如:

+


+

- 客製化的圖形使用者介面,為 Darwin Bootloader 帶來更多的色彩。

+

- 無須其他程式,即可載入 ramdisk 來直接啓動 零售版 DVD

+

- 支持睡眠。 可使用睡眠映像恢復繼續使用 Mac OS X

+

- 可使用修改過的 SMBIOS 覆蓋 SMBIOS 之出廠設定值。

+

- 可使用修正過的 DSDT 覆蓋原始 DSDT,並可解決許多問題。

+

- 可透過 device-properties string 自動注入設備屬性。

+

- 支持 MBR GPT 分割區磁盤的  boot0 / boot1h 多重開機功能。

+

- 具有自動偵測 FSB 碼功能,並可用於新式的 AMD CPU

+

- 支持 Apple Software RAID 功能。

+

- 支持 Nvidia & ATI/AMD 顯示卡啓用功能。

+

- 支持模組功能。

+

- 支持改編自 memtest86: http://www.memtest.org 的記憶體偵測功能。

+

- 具有自動生成 P-State C-State 的原生電源管理之功能。

+

- 具有訊息紀錄之功能。

+


+

源代碼依照 Gnu Public License v2 的原則釋放於以下網站上。

+

http://forge.voodooprojects.org/p/chameleon

+


+

常見問題: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/zh_TW.lproj/.svn/text-base/License.rtf.svn-base b/package/Resources.old/zh_TW.lproj/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/zh_TW.lproj/.svn/text-base/Localizable.strings.svn-base b/package/Resources.old/zh_TW.lproj/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..ed7f143 Binary files /dev/null and b/package/Resources.old/zh_TW.lproj/.svn/text-base/Localizable.strings.svn-base differ diff --git a/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..f8ea2b2 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/Conclusion.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/TXT.rtf +END diff --git a/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/entries b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..c50d787 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/zh_TW.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:01.000000Z +aaa7cf77b8bbb5fd706c9e535aefc37d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1182 + diff --git a/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..1b0c388 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset134 STHeitiSC-Light;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ + +\f1 \'b0\'b2\'d1\'62\'b3\'cc\'d0\'f2\'d2\'d1\'bd\'9b\'cd\'ea\'b3\'c9 +\f0 \ + +\f1 \'81\'4b\'d4\'da\'df\'78\'93\'f1\'b0\'b2\'d1\'62\'b5\'c4\'b7\'d6\'b8\'ee\'85\'5e\'bd\'a8\'c1\'a2 +\f0 \cf2 \ +@LOG_FILENAME@\cf3 +\f1 \cf0 \'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe\'a1\'a3 +\f0 \cf2 \ +\ + +\f1 \cf0 \'d5\'88 +\f0 +\f1 \cf4 \'d4\'94\'e9\'86\'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe +\f0 \cf0 \ + +\f1 \'b4\'5f\'d5\'4a\'b0\'b2\'d1\'62\'ca\'c7\'b7\'f1\'b3\'c9\'b9\'a6\'a3\'ac\'81\'4b\'b1\'a3\'c1\'f4\'b0\'b2\'d1\'62\'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe\'82\'e4\'b2\'e9\'a1\'a3 +\f0 \ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/TXT.rtf b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/TXT.rtf new file mode 100644 index 0000000..1b0c388 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Conclusion.rtfd/TXT.rtf @@ -0,0 +1,41 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset134 STHeitiSC-Light;} +{\colortbl;\red255\green255\blue255;\red0\green0\blue255;\red14\green0\blue45;\red255\green0\blue0; +\red255\green0\blue9;\red153\green153\blue153;} +\margl1440\margr1440\vieww11660\viewh12980\viewkind0 +\pard\ri-20\qc + +\f0\b\fs28 \cf0 \ +\ + +\f1 \'b0\'b2\'d1\'62\'b3\'cc\'d0\'f2\'d2\'d1\'bd\'9b\'cd\'ea\'b3\'c9 +\f0 \ + +\f1 \'81\'4b\'d4\'da\'df\'78\'93\'f1\'b0\'b2\'d1\'62\'b5\'c4\'b7\'d6\'b8\'ee\'85\'5e\'bd\'a8\'c1\'a2 +\f0 \cf2 \ +@LOG_FILENAME@\cf3 +\f1 \cf0 \'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe\'a1\'a3 +\f0 \cf2 \ +\ + +\f1 \cf0 \'d5\'88 +\f0 +\f1 \cf4 \'d4\'94\'e9\'86\'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe +\f0 \cf0 \ + +\f1 \'b4\'5f\'d5\'4a\'b0\'b2\'d1\'62\'ca\'c7\'b7\'f1\'b3\'c9\'b9\'a6\'a3\'ac\'81\'4b\'b1\'a3\'c1\'f4\'b0\'b2\'d1\'62\'bc\'6f\'e4\'9b\'ce\'c4\'bc\'fe\'82\'e4\'b2\'e9\'a1\'a3 +\f0 \ +\cf4 \ +\ +\ + +\fs26 \cf0 Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION% +\fs24 \cf5 \ + +\b0\fs30 \cf0 \ + +\fs20 Copyright \'a9 %CPRYEAR%\ +\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\b \cf6 Package built by: %WHOBUILD%} diff --git a/package/Resources.old/zh_TW.lproj/Description.html b/package/Resources.old/zh_TW.lproj/Description.html new file mode 100644 index 0000000..4cd9682 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Description.html @@ -0,0 +1,47 @@ + + + + + + + + + +

Chameleon 是一個結合許多組件的開機引導器。這些組件的演變來自於 David Elliott 加入 Apple boot-132 程式項目的 fake EFI 安裝工具。

+


+

Chameleon v2 現在已經擴充了許多功能。例如:

+


+

- 客製化的圖形使用者介面,為 Darwin Bootloader 帶來更多的色彩。

+

- 無須其他程式,即可載入 ramdisk 來直接啓動 零售版 DVD

+

- 支持睡眠。 可使用睡眠映像恢復繼續使用 Mac OS X

+

- 可使用修改過的 SMBIOS 覆蓋 SMBIOS 之出廠設定值。

+

- 可使用修正過的 DSDT 覆蓋原始 DSDT,並可解決許多問題。

+

- 可透過 device-properties string 自動注入設備屬性。

+

- 支持 MBR GPT 分割區磁盤的  boot0 / boot1h 多重開機功能。

+

- 具有自動偵測 FSB 碼功能,並可用於新式的 AMD CPU

+

- 支持 Apple Software RAID 功能。

+

- 支持 Nvidia & ATI/AMD 顯示卡啓用功能。

+

- 支持模組功能。

+

- 支持改編自 memtest86: http://www.memtest.org 的記憶體偵測功能。

+

- 具有自動生成 P-State C-State 的原生電源管理之功能。

+

- 具有訊息紀錄之功能。

+


+

源代碼依照 Gnu Public License v2 的原則釋放於以下網站上。

+

http://forge.voodooprojects.org/p/chameleon

+


+

常見問題: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources.old/zh_TW.lproj/License.rtf b/package/Resources.old/zh_TW.lproj/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources.old/zh_TW.lproj/Localizable.strings b/package/Resources.old/zh_TW.lproj/Localizable.strings new file mode 100644 index 0000000..ed7f143 Binary files /dev/null and b/package/Resources.old/zh_TW.lproj/Localizable.strings differ diff --git a/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..2d5fd31 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/Welcome.rtfd +END +TXT.rtf +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources.old/zh_TW.lproj/Welcome.rtfd/TXT.rtf +END diff --git a/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/entries b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..8dc6075 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources.old/zh_TW.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +TXT.rtf +file + + + + +2013-08-27T23:56:01.000000Z +97611afc2f7d845223fe60ba97ee0ead +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +960 + diff --git a/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base new file mode 100644 index 0000000..f275a48 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/.svn/text-base/TXT.rtf.svn-base @@ -0,0 +1,60 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset136 STHeitiTC-Light;\f2\fnil\fcharset134 STHeitiSC-Light; +} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1 \cf2 \'bd\'d0\'a4\'c5\'a6\'77\'b8\'cb\'a8\'ec +\f0 \cf2 Apple +\f1 \cf2 \'aa\'ba +\f0 \cf2 Macintosh +\f1 \cf2 \'b9\'71\'b8\'a3 +\f0 \cf2 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\f2 \cf0 \'e9\'5f\'b0\'6c\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\f2 \cf0 \'b8\'d0\'d6\'78 +\f0 :\ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\f2\b \cf0 \'b7\'e2\'d1\'62\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language +\f1 \'c2\'bd\'c4\'b6 +\f0 : crazybirdy, Ulimate\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources.old/zh_TW.lproj/Welcome.rtfd/TXT.rtf b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/TXT.rtf new file mode 100644 index 0000000..f275a48 --- /dev/null +++ b/package/Resources.old/zh_TW.lproj/Welcome.rtfd/TXT.rtf @@ -0,0 +1,60 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 +{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset136 STHeitiTC-Light;\f2\fnil\fcharset134 STHeitiSC-Light; +} +{\colortbl;\red255\green255\blue255;\red255\green0\blue9;} +\margl1440\margr1440\vieww10460\viewh7440\viewkind0 +\pard\qc + +\f0\b\fs28 \cf0 \ + +\fs48 Chameleon +\fs50 \ + +\fs26 v%CHAMELEONVERSION% r%CHAMELEONREVISION%\ + +\fs28 \ +\pard\qc + +\f1 \cf2 \'bd\'d0\'a4\'c5\'a6\'77\'b8\'cb\'a8\'ec +\f0 \cf2 Apple +\f1 \cf2 \'aa\'ba +\f0 \cf2 Macintosh +\f1 \cf2 \'b9\'71\'b8\'a3 +\f0 \cf2 \ +\pard\qc + +\fs22 \cf0 \ +\ +\pard\qc + +\f2 \cf0 \'e9\'5f\'b0\'6c\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %DEVELOP% +\b \ +\ +\pard\qc + +\f2 \cf0 \'b8\'d0\'d6\'78 +\f0 :\ +\pard\qc + +\b0 \cf0 %CREDITS% +\b \ + +\b0 \ +\pard\qc + +\f2\b \cf0 \'b7\'e2\'d1\'62\'d5\'df +\f0 :\ +\pard\qc + +\b0 \cf0 %PKGDEV%\ +\ +\pard\qc + +\fs18 \cf0 Package built by: %WHOBUILD%, language +\f1 \'c2\'bd\'c4\'b6 +\f0 : crazybirdy, Ulimate\ +Copyright \'a9 %CPRYEAR%} diff --git a/package/Resources/.svn/all-wcprops b/package/Resources/.svn/all-wcprops new file mode 100644 index 0000000..fedf6e4 --- /dev/null +++ b/package/Resources/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources +END diff --git a/package/Resources/.svn/entries b/package/Resources/.svn/entries new file mode 100644 index 0000000..71c43e0 --- /dev/null +++ b/package/Resources/.svn/entries @@ -0,0 +1,121 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ja.lproj +dir + +he.lproj +dir + +bs.lproj +dir + +fr.lproj +dir + +nl.lproj +dir + +hr.lproj +dir + +pl.lproj +dir + +hu.lproj +dir + +ro.lproj +dir + +ca.lproj +dir + +pt-BR.lproj +dir + +ru.lproj +dir + +distribution +dir + +zh_TW.lproj +dir + +id.lproj +dir + +el.lproj +dir + +zh_CN.lproj +dir + +ar.lproj +dir + +en.lproj +dir + +common +dir + +pt-PT.lproj +dir + +cs.lproj +dir + +mk.lproj +dir + +es.lproj +dir + +templates +dir + +ko.lproj +dir + +it.lproj +dir + +sr.lproj +dir + +fa.lproj +dir + +bg.lproj +dir + +de.lproj +dir + diff --git a/package/Resources/ar.lproj/.svn/all-wcprops b/package/Resources/ar.lproj/.svn/all-wcprops new file mode 100644 index 0000000..de8aa94 --- /dev/null +++ b/package/Resources/ar.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ar.lproj +END diff --git a/package/Resources/ar.lproj/.svn/entries b/package/Resources/ar.lproj/.svn/entries new file mode 100644 index 0000000..9c35be3 --- /dev/null +++ b/package/Resources/ar.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ar.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/ar.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/ar.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..feb9140 --- /dev/null +++ b/package/Resources/ar.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ar.lproj/Conclusion.rtfd +END diff --git a/package/Resources/ar.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/ar.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..dcc368b --- /dev/null +++ b/package/Resources/ar.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ar.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ar.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/ar.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..1e696a3 --- /dev/null +++ b/package/Resources/ar.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ar.lproj/Welcome.rtfd +END diff --git a/package/Resources/ar.lproj/Welcome.rtfd/.svn/entries b/package/Resources/ar.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..7784bab --- /dev/null +++ b/package/Resources/ar.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ar.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/bg.lproj/.svn/all-wcprops b/package/Resources/bg.lproj/.svn/all-wcprops new file mode 100644 index 0000000..3a05878 --- /dev/null +++ b/package/Resources/bg.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/bg.lproj +END diff --git a/package/Resources/bg.lproj/.svn/entries b/package/Resources/bg.lproj/.svn/entries new file mode 100644 index 0000000..5b6cf0a --- /dev/null +++ b/package/Resources/bg.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/bg.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/bg.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/bg.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..280655e --- /dev/null +++ b/package/Resources/bg.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/bg.lproj/Conclusion.rtfd +END diff --git a/package/Resources/bg.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/bg.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..0489015 --- /dev/null +++ b/package/Resources/bg.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/bg.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/bg.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/bg.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..1641feb --- /dev/null +++ b/package/Resources/bg.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/bg.lproj/Welcome.rtfd +END diff --git a/package/Resources/bg.lproj/Welcome.rtfd/.svn/entries b/package/Resources/bg.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..8e28ce4 --- /dev/null +++ b/package/Resources/bg.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/bg.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/bs.lproj/.svn/all-wcprops b/package/Resources/bs.lproj/.svn/all-wcprops new file mode 100644 index 0000000..6b11109 --- /dev/null +++ b/package/Resources/bs.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/bs.lproj +END diff --git a/package/Resources/bs.lproj/.svn/entries b/package/Resources/bs.lproj/.svn/entries new file mode 100644 index 0000000..e1681a5 --- /dev/null +++ b/package/Resources/bs.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/bs.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/bs.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/bs.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..932de54 --- /dev/null +++ b/package/Resources/bs.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/bs.lproj/Conclusion.rtfd +END diff --git a/package/Resources/bs.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/bs.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..aa049aa --- /dev/null +++ b/package/Resources/bs.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/bs.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/bs.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/bs.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..bbf48b9 --- /dev/null +++ b/package/Resources/bs.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/bs.lproj/Welcome.rtfd +END diff --git a/package/Resources/bs.lproj/Welcome.rtfd/.svn/entries b/package/Resources/bs.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..a983805 --- /dev/null +++ b/package/Resources/bs.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/bs.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ca.lproj/.svn/all-wcprops b/package/Resources/ca.lproj/.svn/all-wcprops new file mode 100644 index 0000000..8762317 --- /dev/null +++ b/package/Resources/ca.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ca.lproj +END diff --git a/package/Resources/ca.lproj/.svn/entries b/package/Resources/ca.lproj/.svn/entries new file mode 100644 index 0000000..eef464d --- /dev/null +++ b/package/Resources/ca.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ca.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/ca.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/ca.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..1bf82f3 --- /dev/null +++ b/package/Resources/ca.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ca.lproj/Conclusion.rtfd +END diff --git a/package/Resources/ca.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/ca.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..c95e065 --- /dev/null +++ b/package/Resources/ca.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ca.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ca.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/ca.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..1d9e0f4 --- /dev/null +++ b/package/Resources/ca.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ca.lproj/Welcome.rtfd +END diff --git a/package/Resources/ca.lproj/Welcome.rtfd/.svn/entries b/package/Resources/ca.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..1fcc1fa --- /dev/null +++ b/package/Resources/ca.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ca.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/common/.svn/all-wcprops b/package/Resources/common/.svn/all-wcprops new file mode 100644 index 0000000..a84ddd2 --- /dev/null +++ b/package/Resources/common/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/common +END +License.rtf +K 25 +svn:wc:ra_dav:version-url +V 82 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/common/License.rtf +END diff --git a/package/Resources/common/.svn/entries b/package/Resources/common/.svn/entries new file mode 100644 index 0000000..ac4a401 --- /dev/null +++ b/package/Resources/common/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/common +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +License.rtf +file + + + + +2013-08-27T23:56:28.000000Z +e9df5aa89175152942a6385d1c0bd32f +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +20528 + diff --git a/package/Resources/common/.svn/text-base/License.rtf.svn-base b/package/Resources/common/.svn/text-base/License.rtf.svn-base new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources/common/.svn/text-base/License.rtf.svn-base @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources/common/License.rtf b/package/Resources/common/License.rtf new file mode 100644 index 0000000..bc755f2 --- /dev/null +++ b/package/Resources/common/License.rtf @@ -0,0 +1,350 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl\f0\fmodern\fcharset0 Courier-Bold;\f1\fmodern\fcharset0 Courier;} +{\colortbl;\red255\green255\blue255;} +\paperw12240\paperh15840\vieww22060\viewh18360\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs40 \cf0 APPLE PUBLIC SOURCE LICENSE \ + +\fs26 Version 2.0 - August 6, 2003\ +\ + +\f1\b0 Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.\ +\ +1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:\ +\ +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.\ +\ +1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.\ +\ +1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.\ +\ +1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.\ +\ +1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.\ +\ +1.6 "Modifications" mean any addition to, deletion from, and/or change\ +to, the substance and/or structure of the Original Code, any previous\ +Modifications, the combination of Original Code and any previous\ +Modifications, and/or any respective portions thereof. When code is\ +released as a series of files, a Modification is: (a) any addition to\ +or deletion from the contents of a file containing Covered Code;\ +and/or (b) any new file or other representation of computer program\ +statements that contains any part of Covered Code.\ +\ +1.7 "Original Code" means (a) the Source Code of a program or other\ +work as originally made available by Apple under this License,\ +including the Source Code of any updates or upgrades to such programs\ +or works made available by Apple under this License, and that has been\ +expressly identified by Apple as such in the header file(s) of such\ +work; and (b) the object code compiled from such Source Code and\ +originally made available by Apple under this License.\ +\ +1.8 "Source Code" means the human readable form of a program or other\ +work that is suitable for making modifications to it, including all\ +modules it contains, plus any associated interface definition files,\ +scripts used to control compilation and installation of an executable\ +(object code).\ +\ +1.9 "You" or "Your" means an individual or a legal entity exercising\ +rights under this License. For legal entities, "You" or "Your"\ +includes any entity which controls, is controlled by, or is under\ +common control with, You, where "control" means (a) the power, direct\ +or indirect, to cause the direction or management of such entity,\ +whether by contract or otherwise, or (b) ownership of fifty percent\ +(50%) or more of the outstanding shares or beneficial ownership of\ +such entity.\ +\ +2. Permitted Uses; Conditions & Restrictions. Subject to the terms\ +and conditions of this License, Apple hereby grants You, effective on\ +the date You accept this License and download the Original Code, a\ +world-wide, royalty-free, non-exclusive license, to the extent of\ +Apple's Applicable Patent Rights and copyrights covering the Original\ +Code, to do the following:\ +\ +2.1 Unmodified Code. You may use, reproduce, display, perform,\ +internally distribute within Your organization, and Externally Deploy\ +verbatim, unmodified copies of the Original Code, for commercial or\ +non-commercial purposes, provided that in each instance:\ +\ +(a) You must retain and reproduce in all copies of Original Code the\ +copyright and other proprietary notices and disclaimers of Apple as\ +they appear in the Original Code, and keep intact all notices in the\ +Original Code that refer to this License; and\ +\ +(b) You must include a copy of this License with every copy of Source\ +Code of Covered Code and documentation You distribute or Externally\ +Deploy, and You may not offer or impose any terms on such Source Code\ +that alter or restrict this License or the recipients' rights\ +hereunder, except as permitted under Section 6.\ +\ +2.2 Modified Code. You may modify Covered Code and use, reproduce,\ +display, perform, internally distribute within Your organization, and\ +Externally Deploy Your Modifications and Covered Code, for commercial\ +or non-commercial purposes, provided that in each instance You also\ +meet all of these conditions:\ +\ +(a) You must satisfy all the conditions of Section 2.1 with respect to\ +the Source Code of the Covered Code;\ +\ +(b) You must duplicate, to the extent it does not already exist, the\ +notice in Exhibit A in each file of the Source Code of all Your\ +Modifications, and cause the modified files to carry prominent notices\ +stating that You changed the files and the date of any change; and\ +\ +(c) If You Externally Deploy Your Modifications, You must make\ +Source Code of all Your Externally Deployed Modifications either\ +available to those to whom You have Externally Deployed Your\ +Modifications, or publicly available. Source Code of Your Externally\ +Deployed Modifications must be released under the terms set forth in\ +this License, including the license grants set forth in Section 3\ +below, for as long as you Externally Deploy the Covered Code or twelve\ +(12) months from the date of initial External Deployment, whichever is\ +longer. You should preferably distribute the Source Code of Your\ +Externally Deployed Modifications electronically (e.g. download from a\ +web site).\ +\ +2.3 Distribution of Executable Versions. In addition, if You\ +Externally Deploy Covered Code (Original Code and/or Modifications) in\ +object code, executable form only, You must include a prominent\ +notice, in the code itself as well as in related documentation,\ +stating that Source Code of the Covered Code is available under the\ +terms of this License with information on how and where to obtain such\ +Source Code.\ +\ +2.4 Third Party Rights. You expressly acknowledge and agree that\ +although Apple and each Contributor grants the licenses to their\ +respective portions of the Covered Code set forth herein, no\ +assurances are provided by Apple or any Contributor that the Covered\ +Code does not infringe the patent or other intellectual property\ +rights of any other entity. Apple and each Contributor disclaim any\ +liability to You for claims brought by any other entity based on\ +infringement of intellectual property rights or otherwise. As a\ +condition to exercising the rights and licenses granted hereunder, You\ +hereby assume sole responsibility to secure any other intellectual\ +property rights needed, if any. For example, if a third party patent\ +license is required to allow You to distribute the Covered Code, it is\ +Your responsibility to acquire that license before distributing the\ +Covered Code.\ +\ +3. Your Grants. In consideration of, and as a condition to, the\ +licenses granted to You under this License, You hereby grant to any\ +person or entity receiving or distributing Covered Code under this\ +License a non-exclusive, royalty-free, perpetual, irrevocable license,\ +under Your Applicable Patent Rights and other intellectual property\ +rights (other than patent) owned or controlled by You, to use,\ +reproduce, display, perform, modify, sublicense, distribute and\ +Externally Deploy Your Modifications of the same scope and extent as\ +Apple's licenses under Sections 2.1 and 2.2 above.\ +\ +4. Larger Works. You may create a Larger Work by combining Covered\ +Code with other code not governed by the terms of this License and\ +distribute the Larger Work as a single product. In each such instance,\ +You must make sure the requirements of this License are fulfilled for\ +the Covered Code or any portion thereof.\ +\ +5. Limitations on Patent License. Except as expressly stated in\ +Section 2, no other patent rights, express or implied, are granted by\ +Apple herein. Modifications and/or Larger Works may require additional\ +patent licenses from Apple which Apple may grant in its sole\ +discretion.\ +\ +6. Additional Terms. You may choose to offer, and to charge a fee for,\ +warranty, support, indemnity or liability obligations and/or other\ +rights consistent with the scope of the license granted herein\ +("Additional Terms") to one or more recipients of Covered Code.\ +However, You may do so only on Your own behalf and as Your sole\ +responsibility, and not on behalf of Apple or any Contributor. You\ +must obtain the recipient's agreement that any such Additional Terms\ +are offered by You alone, and You hereby agree to indemnify, defend\ +and hold Apple and every Contributor harmless for any liability\ +incurred by or claims asserted against Apple or such Contributor by\ +reason of any such Additional Terms.\ +\ +7. Versions of the License. Apple may publish revised and/or new\ +versions of this License from time to time. Each version will be given\ +a distinguishing version number. Once Original Code has been published\ +under a particular version of this License, You may continue to use it\ +under the terms of that version. You may also choose to use such\ +Original Code under the terms of any subsequent version of this\ +License published by Apple. No one other than Apple has the right to\ +modify the terms applicable to Covered Code created under this\ +License.\ +\ +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in\ +part pre-release, untested, or not fully tested works. The Covered\ +Code may contain errors that could cause failures or loss of data, and\ +may be incomplete or contain inaccuracies. You expressly acknowledge\ +and agree that use of the Covered Code, or any portion thereof, is at\ +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND\ +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND\ +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE\ +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM\ +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT\ +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF\ +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR\ +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD\ +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST\ +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE\ +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS,\ +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR\ +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO\ +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE\ +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.\ +You acknowledge that the Covered Code is not intended for use in the\ +operation of nuclear facilities, aircraft navigation, communication\ +systems, or air traffic control machines in which case the failure of\ +the Covered Code could lead to death, personal injury, or severe\ +physical or environmental damage.\ +\ +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO\ +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL,\ +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING\ +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR\ +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY,\ +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF\ +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\ +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY\ +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF\ +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY\ +TO YOU. In no event shall Apple's total liability to You for all\ +damages (other than as may be required by applicable law) under this\ +License exceed the amount of fifty dollars ($50.00).\ +\ +10. Trademarks. This License does not grant any rights to use the\ +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS",\ +"QuickTime", "QuickTime Streaming Server" or any other trademarks,\ +service marks, logos or trade names belonging to Apple (collectively\ +"Apple Marks") or to any trademark, service mark, logo or trade name\ +belonging to any Contributor. You agree not to use any Apple Marks in\ +or as part of the name of products derived from the Original Code or\ +to endorse or promote products derived from the Original Code other\ +than as expressly permitted by and in strict compliance at all times\ +with Apple's third party trademark usage guidelines which are posted\ +at http://www.apple.com/legal/guidelinesfor3rdparties.html.\ +\ +11. Ownership. Subject to the licenses granted under this License,\ +each Contributor retains all rights, title and interest in and to any\ +Modifications made by such Contributor. Apple retains all rights,\ +title and interest in and to the Original Code and any Modifications\ +made by or on behalf of Apple ("Apple Modifications"), and such Apple\ +Modifications will not be automatically subject to this License. Apple\ +may, at its sole discretion, choose to license such Apple\ +Modifications under this License, or on different terms from those\ +contained in this License or may choose not to license them at all.\ +\ +12. Termination.\ +\ +12.1 Termination. This License and the rights granted hereunder will\ +terminate:\ +\ +(a) automatically without notice from Apple if You fail to comply with\ +any term(s) of this License and fail to cure such breach within 30\ +days of becoming aware of such breach;\ +\ +(b) immediately in the event of the circumstances described in Section\ +13.5(b); or\ +\ +(c) automatically without notice from Apple if You, at any time during\ +the term of this License, commence an action for patent infringement\ +against Apple; provided that Apple did not first commence\ +an action for patent infringement against You in that instance.\ +\ +12.2 Effect of Termination. Upon termination, You agree to immediately\ +stop any further use, reproduction, modification, sublicensing and\ +distribution of the Covered Code. All sublicenses to the Covered Code\ +which have been properly granted prior to termination shall survive\ +any termination of this License. Provisions which, by their nature,\ +should remain in effect beyond the termination of this License shall\ +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11,\ +12.2 and 13. No party will be liable to any other for compensation,\ +indemnity or damages of any sort solely as a result of terminating\ +this License in accordance with its terms, and termination of this\ +License will be without prejudice to any other right or remedy of\ +any party.\ +\ +13. Miscellaneous.\ +\ +13.1 Government End Users. The Covered Code is a "commercial item" as\ +defined in FAR 2.101. Government software and technical data rights in\ +the Covered Code include only those rights customarily provided to the\ +public as defined in this License. This customary commercial license\ +in technical data and software is provided in accordance with FAR\ +12.211 (Technical Data) and 12.212 (Computer Software) and, for\ +Department of Defense purchases, DFAR 252.227-7015 (Technical Data --\ +Commercial Items) and 227.7202-3 (Rights in Commercial Computer\ +Software or Computer Software Documentation). Accordingly, all U.S.\ +Government End Users acquire Covered Code with only those rights set\ +forth herein.\ +\ +13.2 Relationship of Parties. This License will not be construed as\ +creating an agency, partnership, joint venture or any other form of\ +legal association between or among You, Apple or any Contributor, and\ +You will not represent to the contrary, whether expressly, by\ +implication, appearance or otherwise.\ +\ +13.3 Independent Development. Nothing in this License will impair\ +Apple's right to acquire, license, develop, have others develop for\ +it, market and/or distribute technology or products that perform the\ +same or similar functions as, or otherwise compete with,\ +Modifications, Larger Works, technology or products that You may\ +develop, produce, market or distribute.\ +\ +13.4 Waiver; Construction. Failure by Apple or any Contributor to\ +enforce any provision of this License will not be deemed a waiver of\ +future enforcement of that or any other provision. Any law or\ +regulation which provides that the language of a contract shall be\ +construed against the drafter will not apply to this License.\ +\ +13.5 Severability. (a) If for any reason a court of competent\ +jurisdiction finds any provision of this License, or portion thereof,\ +to be unenforceable, that provision of the License will be enforced to\ +the maximum extent permissible so as to effect the economic benefits\ +and intent of the parties, and the remainder of this License will\ +continue in full force and effect. (b) Notwithstanding the foregoing,\ +if applicable law prohibits or restricts You from fully and/or\ +specifically complying with Sections 2 and/or 3 or prevents the\ +enforceability of either of those Sections, this License will\ +immediately terminate and You must immediately discontinue any use of\ +the Covered Code and destroy all copies of it that are in your\ +possession or control.\ +\ +13.6 Dispute Resolution. Any litigation or other dispute resolution\ +between You and Apple relating to this License shall take place in the\ +Northern District of California, and You and Apple hereby consent to\ +the personal jurisdiction of, and venue in, the state and federal\ +courts within that District with respect to this License. The\ +application of the United Nations Convention on Contracts for the\ +International Sale of Goods is expressly excluded.\ +\ +13.7 Entire Agreement; Governing Law. This License constitutes the\ +entire agreement between the parties with respect to the subject\ +matter hereof. This License shall be governed by the laws of the\ +United States and the State of California, except that body of\ +California law concerning conflicts of law.\ +\ +Where You are located in the province of Quebec, Canada, the following\ +clause applies: The parties hereby confirm that they have requested\ +that this License and all related documents be drafted in English. Les\ +parties ont exige que le present contrat et tous les documents\ +connexes soient rediges en anglais.\ +\ +EXHIBIT A.\ +\ +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights\ +Reserved.\ +\ +This file contains Original Code and/or Modifications of Original Code\ +as defined in and that are subject to the Apple Public Source License\ +Version 2.0 (the 'License'). You may not use this file except in\ +compliance with the License. Please obtain a copy of the License at\ +http://www.opensource.apple.com/apsl/ and read it before using this\ +file.\ +\ +The Original Code and all software distributed under the License are\ +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER\ +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,\ +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,\ +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.\ +Please see the License for the specific language governing rights and\ +limitations under the License." } \ No newline at end of file diff --git a/package/Resources/cs.lproj/.svn/all-wcprops b/package/Resources/cs.lproj/.svn/all-wcprops new file mode 100644 index 0000000..6a4416b --- /dev/null +++ b/package/Resources/cs.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/cs.lproj +END diff --git a/package/Resources/cs.lproj/.svn/entries b/package/Resources/cs.lproj/.svn/entries new file mode 100644 index 0000000..1ceca74 --- /dev/null +++ b/package/Resources/cs.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/cs.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/cs.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/cs.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..642b745 --- /dev/null +++ b/package/Resources/cs.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/cs.lproj/Conclusion.rtfd +END diff --git a/package/Resources/cs.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/cs.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..b18104a --- /dev/null +++ b/package/Resources/cs.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/cs.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/cs.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/cs.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..585b408 --- /dev/null +++ b/package/Resources/cs.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/cs.lproj/Welcome.rtfd +END diff --git a/package/Resources/cs.lproj/Welcome.rtfd/.svn/entries b/package/Resources/cs.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..8fdbb82 --- /dev/null +++ b/package/Resources/cs.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/cs.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/de.lproj/.svn/all-wcprops b/package/Resources/de.lproj/.svn/all-wcprops new file mode 100644 index 0000000..df966e8 --- /dev/null +++ b/package/Resources/de.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/de.lproj +END diff --git a/package/Resources/de.lproj/.svn/entries b/package/Resources/de.lproj/.svn/entries new file mode 100644 index 0000000..51eb458 --- /dev/null +++ b/package/Resources/de.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/de.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/de.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/de.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..fc5f8ce --- /dev/null +++ b/package/Resources/de.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/de.lproj/Conclusion.rtfd +END diff --git a/package/Resources/de.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/de.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..6c45112 --- /dev/null +++ b/package/Resources/de.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/de.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/de.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/de.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..7269e85 --- /dev/null +++ b/package/Resources/de.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/de.lproj/Welcome.rtfd +END diff --git a/package/Resources/de.lproj/Welcome.rtfd/.svn/entries b/package/Resources/de.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..4534870 --- /dev/null +++ b/package/Resources/de.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/de.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/distribution/.svn/all-wcprops b/package/Resources/distribution/.svn/all-wcprops new file mode 100644 index 0000000..5cfabf3 --- /dev/null +++ b/package/Resources/distribution/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/distribution +END +background.tiff +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/distribution/background.tiff +END diff --git a/package/Resources/distribution/.svn/entries b/package/Resources/distribution/.svn/entries new file mode 100644 index 0000000..8b6f3b4 --- /dev/null +++ b/package/Resources/distribution/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/distribution +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +background.tiff +file + + + + +2013-08-27T23:56:28.000000Z +c19131ccf4e30bd5b5a01a5f100d7d38 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +419804 + diff --git a/package/Resources/distribution/.svn/prop-base/background.tiff.svn-base b/package/Resources/distribution/.svn/prop-base/background.tiff.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Resources/distribution/.svn/prop-base/background.tiff.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Resources/distribution/.svn/text-base/background.tiff.svn-base b/package/Resources/distribution/.svn/text-base/background.tiff.svn-base new file mode 100644 index 0000000..7e1c34e Binary files /dev/null and b/package/Resources/distribution/.svn/text-base/background.tiff.svn-base differ diff --git a/package/Resources/distribution/background.tiff b/package/Resources/distribution/background.tiff new file mode 100644 index 0000000..7e1c34e Binary files /dev/null and b/package/Resources/distribution/background.tiff differ diff --git a/package/Resources/el.lproj/.svn/all-wcprops b/package/Resources/el.lproj/.svn/all-wcprops new file mode 100644 index 0000000..127af9a --- /dev/null +++ b/package/Resources/el.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/el.lproj +END diff --git a/package/Resources/el.lproj/.svn/entries b/package/Resources/el.lproj/.svn/entries new file mode 100644 index 0000000..13638fd --- /dev/null +++ b/package/Resources/el.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/el.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/el.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/el.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..9621d38 --- /dev/null +++ b/package/Resources/el.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/el.lproj/Conclusion.rtfd +END diff --git a/package/Resources/el.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/el.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..b45aec4 --- /dev/null +++ b/package/Resources/el.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/el.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/el.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/el.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..81a2cb2 --- /dev/null +++ b/package/Resources/el.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/el.lproj/Welcome.rtfd +END diff --git a/package/Resources/el.lproj/Welcome.rtfd/.svn/entries b/package/Resources/el.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..b52fc9c --- /dev/null +++ b/package/Resources/el.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/el.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/en.lproj/.svn/all-wcprops b/package/Resources/en.lproj/.svn/all-wcprops new file mode 100644 index 0000000..352d4a4 --- /dev/null +++ b/package/Resources/en.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/en.lproj +END diff --git a/package/Resources/en.lproj/.svn/entries b/package/Resources/en.lproj/.svn/entries new file mode 100644 index 0000000..bbd4d2e --- /dev/null +++ b/package/Resources/en.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/en.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/en.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/en.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..9d1d927 --- /dev/null +++ b/package/Resources/en.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/en.lproj/Conclusion.rtfd +END diff --git a/package/Resources/en.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/en.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..9dbfce9 --- /dev/null +++ b/package/Resources/en.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/en.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/en.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/en.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..c3df42f --- /dev/null +++ b/package/Resources/en.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/en.lproj/Welcome.rtfd +END diff --git a/package/Resources/en.lproj/Welcome.rtfd/.svn/entries b/package/Resources/en.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..411164c --- /dev/null +++ b/package/Resources/en.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/en.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/es.lproj/.svn/all-wcprops b/package/Resources/es.lproj/.svn/all-wcprops new file mode 100644 index 0000000..5d028f6 --- /dev/null +++ b/package/Resources/es.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/es.lproj +END diff --git a/package/Resources/es.lproj/.svn/entries b/package/Resources/es.lproj/.svn/entries new file mode 100644 index 0000000..6b7ee01 --- /dev/null +++ b/package/Resources/es.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/es.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/es.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/es.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..a1b533e --- /dev/null +++ b/package/Resources/es.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/es.lproj/Conclusion.rtfd +END diff --git a/package/Resources/es.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/es.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..94b7ae9 --- /dev/null +++ b/package/Resources/es.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/es.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/es.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/es.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..6b48e20 --- /dev/null +++ b/package/Resources/es.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/es.lproj/Welcome.rtfd +END diff --git a/package/Resources/es.lproj/Welcome.rtfd/.svn/entries b/package/Resources/es.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..65960b8 --- /dev/null +++ b/package/Resources/es.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/es.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/fa.lproj/.svn/all-wcprops b/package/Resources/fa.lproj/.svn/all-wcprops new file mode 100644 index 0000000..0d7094c --- /dev/null +++ b/package/Resources/fa.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/fa.lproj +END diff --git a/package/Resources/fa.lproj/.svn/entries b/package/Resources/fa.lproj/.svn/entries new file mode 100644 index 0000000..edb551c --- /dev/null +++ b/package/Resources/fa.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/fa.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/fa.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/fa.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0ececb8 --- /dev/null +++ b/package/Resources/fa.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/fa.lproj/Conclusion.rtfd +END diff --git a/package/Resources/fa.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/fa.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..d9d3383 --- /dev/null +++ b/package/Resources/fa.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/fa.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/fa.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/fa.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..b104c22 --- /dev/null +++ b/package/Resources/fa.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/fa.lproj/Welcome.rtfd +END diff --git a/package/Resources/fa.lproj/Welcome.rtfd/.svn/entries b/package/Resources/fa.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..56fa200 --- /dev/null +++ b/package/Resources/fa.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/fa.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/fr.lproj/.svn/all-wcprops b/package/Resources/fr.lproj/.svn/all-wcprops new file mode 100644 index 0000000..da63696 --- /dev/null +++ b/package/Resources/fr.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/fr.lproj +END diff --git a/package/Resources/fr.lproj/.svn/entries b/package/Resources/fr.lproj/.svn/entries new file mode 100644 index 0000000..bd8fc31 --- /dev/null +++ b/package/Resources/fr.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/fr.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/fr.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/fr.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..26d47a4 --- /dev/null +++ b/package/Resources/fr.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/fr.lproj/Conclusion.rtfd +END diff --git a/package/Resources/fr.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/fr.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..2bf0a1b --- /dev/null +++ b/package/Resources/fr.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/fr.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/fr.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/fr.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..e18e4d0 --- /dev/null +++ b/package/Resources/fr.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/fr.lproj/Welcome.rtfd +END diff --git a/package/Resources/fr.lproj/Welcome.rtfd/.svn/entries b/package/Resources/fr.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..97c7bdf --- /dev/null +++ b/package/Resources/fr.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/fr.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/he.lproj/.svn/all-wcprops b/package/Resources/he.lproj/.svn/all-wcprops new file mode 100644 index 0000000..3efe7bc --- /dev/null +++ b/package/Resources/he.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/he.lproj +END diff --git a/package/Resources/he.lproj/.svn/entries b/package/Resources/he.lproj/.svn/entries new file mode 100644 index 0000000..cf6e2e1 --- /dev/null +++ b/package/Resources/he.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/he.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/he.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/he.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..371ffd1 --- /dev/null +++ b/package/Resources/he.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/he.lproj/Conclusion.rtfd +END diff --git a/package/Resources/he.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/he.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..a330289 --- /dev/null +++ b/package/Resources/he.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/he.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/he.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/he.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..5a5f7c4 --- /dev/null +++ b/package/Resources/he.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/he.lproj/Welcome.rtfd +END diff --git a/package/Resources/he.lproj/Welcome.rtfd/.svn/entries b/package/Resources/he.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..fbf9437 --- /dev/null +++ b/package/Resources/he.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/he.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/hr.lproj/.svn/all-wcprops b/package/Resources/hr.lproj/.svn/all-wcprops new file mode 100644 index 0000000..54feaa3 --- /dev/null +++ b/package/Resources/hr.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/hr.lproj +END diff --git a/package/Resources/hr.lproj/.svn/entries b/package/Resources/hr.lproj/.svn/entries new file mode 100644 index 0000000..a547969 --- /dev/null +++ b/package/Resources/hr.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/hr.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/hr.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/hr.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..70a1481 --- /dev/null +++ b/package/Resources/hr.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/hr.lproj/Conclusion.rtfd +END diff --git a/package/Resources/hr.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/hr.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..b527e78 --- /dev/null +++ b/package/Resources/hr.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/hr.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/hr.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/hr.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..766c7de --- /dev/null +++ b/package/Resources/hr.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/hr.lproj/Welcome.rtfd +END diff --git a/package/Resources/hr.lproj/Welcome.rtfd/.svn/entries b/package/Resources/hr.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..f54a42d --- /dev/null +++ b/package/Resources/hr.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/hr.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/hu.lproj/.svn/all-wcprops b/package/Resources/hu.lproj/.svn/all-wcprops new file mode 100644 index 0000000..3900813 --- /dev/null +++ b/package/Resources/hu.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/hu.lproj +END diff --git a/package/Resources/hu.lproj/.svn/entries b/package/Resources/hu.lproj/.svn/entries new file mode 100644 index 0000000..431aee3 --- /dev/null +++ b/package/Resources/hu.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/hu.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/hu.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/hu.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..86ab205 --- /dev/null +++ b/package/Resources/hu.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/hu.lproj/Conclusion.rtfd +END diff --git a/package/Resources/hu.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/hu.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..e074c5d --- /dev/null +++ b/package/Resources/hu.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/hu.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/hu.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/hu.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0b86410 --- /dev/null +++ b/package/Resources/hu.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/hu.lproj/Welcome.rtfd +END diff --git a/package/Resources/hu.lproj/Welcome.rtfd/.svn/entries b/package/Resources/hu.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..070703f --- /dev/null +++ b/package/Resources/hu.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/hu.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/id.lproj/.svn/all-wcprops b/package/Resources/id.lproj/.svn/all-wcprops new file mode 100644 index 0000000..1ee9d22 --- /dev/null +++ b/package/Resources/id.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/id.lproj +END diff --git a/package/Resources/id.lproj/.svn/entries b/package/Resources/id.lproj/.svn/entries new file mode 100644 index 0000000..34d3465 --- /dev/null +++ b/package/Resources/id.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/id.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/id.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/id.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..dcab747 --- /dev/null +++ b/package/Resources/id.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/id.lproj/Conclusion.rtfd +END diff --git a/package/Resources/id.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/id.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..df60f17 --- /dev/null +++ b/package/Resources/id.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/id.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/id.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/id.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..295af37 --- /dev/null +++ b/package/Resources/id.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/id.lproj/Welcome.rtfd +END diff --git a/package/Resources/id.lproj/Welcome.rtfd/.svn/entries b/package/Resources/id.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..97f1ea6 --- /dev/null +++ b/package/Resources/id.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/id.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/it.lproj/.svn/all-wcprops b/package/Resources/it.lproj/.svn/all-wcprops new file mode 100644 index 0000000..a70a823 --- /dev/null +++ b/package/Resources/it.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/it.lproj +END diff --git a/package/Resources/it.lproj/.svn/entries b/package/Resources/it.lproj/.svn/entries new file mode 100644 index 0000000..3c9b67a --- /dev/null +++ b/package/Resources/it.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/it.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/it.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/it.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0e76122 --- /dev/null +++ b/package/Resources/it.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/it.lproj/Conclusion.rtfd +END diff --git a/package/Resources/it.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/it.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..700ac4a --- /dev/null +++ b/package/Resources/it.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/it.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/it.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/it.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..ee42a2e --- /dev/null +++ b/package/Resources/it.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/it.lproj/Welcome.rtfd +END diff --git a/package/Resources/it.lproj/Welcome.rtfd/.svn/entries b/package/Resources/it.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..8f313e4 --- /dev/null +++ b/package/Resources/it.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/it.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ja.lproj/.svn/all-wcprops b/package/Resources/ja.lproj/.svn/all-wcprops new file mode 100644 index 0000000..da823a2 --- /dev/null +++ b/package/Resources/ja.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ja.lproj +END diff --git a/package/Resources/ja.lproj/.svn/entries b/package/Resources/ja.lproj/.svn/entries new file mode 100644 index 0000000..88661e1 --- /dev/null +++ b/package/Resources/ja.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ja.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/ja.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/ja.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..926d2ba --- /dev/null +++ b/package/Resources/ja.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ja.lproj/Conclusion.rtfd +END diff --git a/package/Resources/ja.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/ja.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..3a871d9 --- /dev/null +++ b/package/Resources/ja.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ja.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ja.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/ja.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..2fe2466 --- /dev/null +++ b/package/Resources/ja.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ja.lproj/Welcome.rtfd +END diff --git a/package/Resources/ja.lproj/Welcome.rtfd/.svn/entries b/package/Resources/ja.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..f8afff2 --- /dev/null +++ b/package/Resources/ja.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ja.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ko.lproj/.svn/all-wcprops b/package/Resources/ko.lproj/.svn/all-wcprops new file mode 100644 index 0000000..5729db4 --- /dev/null +++ b/package/Resources/ko.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ko.lproj +END diff --git a/package/Resources/ko.lproj/.svn/entries b/package/Resources/ko.lproj/.svn/entries new file mode 100644 index 0000000..d2d58c6 --- /dev/null +++ b/package/Resources/ko.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ko.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/ko.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/ko.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..cbbcffe --- /dev/null +++ b/package/Resources/ko.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ko.lproj/Conclusion.rtfd +END diff --git a/package/Resources/ko.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/ko.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..40a861c --- /dev/null +++ b/package/Resources/ko.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ko.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ko.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/ko.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..7b67faa --- /dev/null +++ b/package/Resources/ko.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ko.lproj/Welcome.rtfd +END diff --git a/package/Resources/ko.lproj/Welcome.rtfd/.svn/entries b/package/Resources/ko.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..94f69e9 --- /dev/null +++ b/package/Resources/ko.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ko.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/mk.lproj/.svn/all-wcprops b/package/Resources/mk.lproj/.svn/all-wcprops new file mode 100644 index 0000000..105974f --- /dev/null +++ b/package/Resources/mk.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/mk.lproj +END diff --git a/package/Resources/mk.lproj/.svn/entries b/package/Resources/mk.lproj/.svn/entries new file mode 100644 index 0000000..caa1a9a --- /dev/null +++ b/package/Resources/mk.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/mk.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/mk.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/mk.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..821f31a --- /dev/null +++ b/package/Resources/mk.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/mk.lproj/Conclusion.rtfd +END diff --git a/package/Resources/mk.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/mk.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..0d3ae4c --- /dev/null +++ b/package/Resources/mk.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/mk.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/mk.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/mk.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..d87af6f --- /dev/null +++ b/package/Resources/mk.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/mk.lproj/Welcome.rtfd +END diff --git a/package/Resources/mk.lproj/Welcome.rtfd/.svn/entries b/package/Resources/mk.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..d4a8d98 --- /dev/null +++ b/package/Resources/mk.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/mk.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/nl.lproj/.svn/all-wcprops b/package/Resources/nl.lproj/.svn/all-wcprops new file mode 100644 index 0000000..07aa8d2 --- /dev/null +++ b/package/Resources/nl.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/nl.lproj +END diff --git a/package/Resources/nl.lproj/.svn/entries b/package/Resources/nl.lproj/.svn/entries new file mode 100644 index 0000000..fe4b55e --- /dev/null +++ b/package/Resources/nl.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/nl.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/nl.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/nl.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..a531407 --- /dev/null +++ b/package/Resources/nl.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/nl.lproj/Conclusion.rtfd +END diff --git a/package/Resources/nl.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/nl.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..c77e4fd --- /dev/null +++ b/package/Resources/nl.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/nl.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/nl.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/nl.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..743da90 --- /dev/null +++ b/package/Resources/nl.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/nl.lproj/Welcome.rtfd +END diff --git a/package/Resources/nl.lproj/Welcome.rtfd/.svn/entries b/package/Resources/nl.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..d567186 --- /dev/null +++ b/package/Resources/nl.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/nl.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/pl.lproj/.svn/all-wcprops b/package/Resources/pl.lproj/.svn/all-wcprops new file mode 100644 index 0000000..2ffbd1a --- /dev/null +++ b/package/Resources/pl.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pl.lproj +END diff --git a/package/Resources/pl.lproj/.svn/entries b/package/Resources/pl.lproj/.svn/entries new file mode 100644 index 0000000..f5c34ff --- /dev/null +++ b/package/Resources/pl.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pl.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/pl.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/pl.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..5a33382 --- /dev/null +++ b/package/Resources/pl.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pl.lproj/Conclusion.rtfd +END diff --git a/package/Resources/pl.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/pl.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..028eb1f --- /dev/null +++ b/package/Resources/pl.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pl.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/pl.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/pl.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..af05f2e --- /dev/null +++ b/package/Resources/pl.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pl.lproj/Welcome.rtfd +END diff --git a/package/Resources/pl.lproj/Welcome.rtfd/.svn/entries b/package/Resources/pl.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..b3b28e5 --- /dev/null +++ b/package/Resources/pl.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pl.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/pt-BR.lproj/.svn/all-wcprops b/package/Resources/pt-BR.lproj/.svn/all-wcprops new file mode 100644 index 0000000..194d129 --- /dev/null +++ b/package/Resources/pt-BR.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pt-BR.lproj +END diff --git a/package/Resources/pt-BR.lproj/.svn/entries b/package/Resources/pt-BR.lproj/.svn/entries new file mode 100644 index 0000000..511c70b --- /dev/null +++ b/package/Resources/pt-BR.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pt-BR.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/pt-BR.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/pt-BR.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..8d23237 --- /dev/null +++ b/package/Resources/pt-BR.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pt-BR.lproj/Conclusion.rtfd +END diff --git a/package/Resources/pt-BR.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/pt-BR.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..792d984 --- /dev/null +++ b/package/Resources/pt-BR.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pt-BR.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/pt-BR.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/pt-BR.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..6e828df --- /dev/null +++ b/package/Resources/pt-BR.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pt-BR.lproj/Welcome.rtfd +END diff --git a/package/Resources/pt-BR.lproj/Welcome.rtfd/.svn/entries b/package/Resources/pt-BR.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..229e5c5 --- /dev/null +++ b/package/Resources/pt-BR.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pt-BR.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/pt-PT.lproj/.svn/all-wcprops b/package/Resources/pt-PT.lproj/.svn/all-wcprops new file mode 100644 index 0000000..4d64803 --- /dev/null +++ b/package/Resources/pt-PT.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pt-PT.lproj +END diff --git a/package/Resources/pt-PT.lproj/.svn/entries b/package/Resources/pt-PT.lproj/.svn/entries new file mode 100644 index 0000000..12bf5a9 --- /dev/null +++ b/package/Resources/pt-PT.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pt-PT.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/pt-PT.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/pt-PT.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0b702f9 --- /dev/null +++ b/package/Resources/pt-PT.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pt-PT.lproj/Conclusion.rtfd +END diff --git a/package/Resources/pt-PT.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/pt-PT.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..09c197d --- /dev/null +++ b/package/Resources/pt-PT.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pt-PT.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/pt-PT.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/pt-PT.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..2e2cc56 --- /dev/null +++ b/package/Resources/pt-PT.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/pt-PT.lproj/Welcome.rtfd +END diff --git a/package/Resources/pt-PT.lproj/Welcome.rtfd/.svn/entries b/package/Resources/pt-PT.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..09c3056 --- /dev/null +++ b/package/Resources/pt-PT.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/pt-PT.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ro.lproj/.svn/all-wcprops b/package/Resources/ro.lproj/.svn/all-wcprops new file mode 100644 index 0000000..044659d --- /dev/null +++ b/package/Resources/ro.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ro.lproj +END diff --git a/package/Resources/ro.lproj/.svn/entries b/package/Resources/ro.lproj/.svn/entries new file mode 100644 index 0000000..112db49 --- /dev/null +++ b/package/Resources/ro.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ro.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/ro.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/ro.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..8b63148 --- /dev/null +++ b/package/Resources/ro.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ro.lproj/Conclusion.rtfd +END diff --git a/package/Resources/ro.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/ro.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..371af92 --- /dev/null +++ b/package/Resources/ro.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ro.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ro.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/ro.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..0671f5c --- /dev/null +++ b/package/Resources/ro.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ro.lproj/Welcome.rtfd +END diff --git a/package/Resources/ro.lproj/Welcome.rtfd/.svn/entries b/package/Resources/ro.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..67c9071 --- /dev/null +++ b/package/Resources/ro.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ro.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ru.lproj/.svn/all-wcprops b/package/Resources/ru.lproj/.svn/all-wcprops new file mode 100644 index 0000000..a2c23fc --- /dev/null +++ b/package/Resources/ru.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ru.lproj +END diff --git a/package/Resources/ru.lproj/.svn/entries b/package/Resources/ru.lproj/.svn/entries new file mode 100644 index 0000000..8f61aff --- /dev/null +++ b/package/Resources/ru.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ru.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/ru.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/ru.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..43b0b2a --- /dev/null +++ b/package/Resources/ru.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ru.lproj/Conclusion.rtfd +END diff --git a/package/Resources/ru.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/ru.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..bbaa934 --- /dev/null +++ b/package/Resources/ru.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ru.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/ru.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/ru.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..f0f9c3e --- /dev/null +++ b/package/Resources/ru.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/ru.lproj/Welcome.rtfd +END diff --git a/package/Resources/ru.lproj/Welcome.rtfd/.svn/entries b/package/Resources/ru.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..107b1cc --- /dev/null +++ b/package/Resources/ru.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/ru.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/sr.lproj/.svn/all-wcprops b/package/Resources/sr.lproj/.svn/all-wcprops new file mode 100644 index 0000000..7f78e13 --- /dev/null +++ b/package/Resources/sr.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/sr.lproj +END diff --git a/package/Resources/sr.lproj/.svn/entries b/package/Resources/sr.lproj/.svn/entries new file mode 100644 index 0000000..01bfd1c --- /dev/null +++ b/package/Resources/sr.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/sr.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/sr.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/sr.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..f238c18 --- /dev/null +++ b/package/Resources/sr.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/sr.lproj/Conclusion.rtfd +END diff --git a/package/Resources/sr.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/sr.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..5fb1da2 --- /dev/null +++ b/package/Resources/sr.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/sr.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/sr.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/sr.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..a9d65e4 --- /dev/null +++ b/package/Resources/sr.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/sr.lproj/Welcome.rtfd +END diff --git a/package/Resources/sr.lproj/Welcome.rtfd/.svn/entries b/package/Resources/sr.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..7304359 --- /dev/null +++ b/package/Resources/sr.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/sr.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/templates/.svn/all-wcprops b/package/Resources/templates/.svn/all-wcprops new file mode 100644 index 0000000..f05b92f --- /dev/null +++ b/package/Resources/templates/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/templates +END +Conclusion.html +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/templates/Conclusion.html +END +Description.html +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/templates/Description.html +END +Localizable.strings +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/templates/Localizable.strings +END +Welcome.html +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/templates/Welcome.html +END diff --git a/package/Resources/templates/.svn/entries b/package/Resources/templates/.svn/entries new file mode 100644 index 0000000..72b9a5e --- /dev/null +++ b/package/Resources/templates/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/templates +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Conclusion.html +file + + + + +2013-08-27T23:56:28.000000Z +53c06750e5774988b0d435a6fd04d1bc +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1477 + +Description.html +file + + + + +2013-08-27T23:56:28.000000Z +497ed0494051a603fbca0a64cef45cb5 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2712 + +Localizable.strings +file + + + + +2013-08-27T23:56:28.000000Z +fa412785b625a56321c30ef45b34e65c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +14193 + +Welcome.html +file + + + + +2013-08-27T23:56:28.000000Z +5cf01c1ce9b14fafba3f4aea62aff7c3 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +1502 + diff --git a/package/Resources/templates/.svn/text-base/Conclusion.html.svn-base b/package/Resources/templates/.svn/text-base/Conclusion.html.svn-base new file mode 100644 index 0000000..87e88c7 --- /dev/null +++ b/package/Resources/templates/.svn/text-base/Conclusion.html.svn-base @@ -0,0 +1,34 @@ + + + + + + + + + +
+


+

+The scripts have completed and a file named @LOG_FILENAME@ + has been written to the root of your chosen partition.

+


+

Please read it + to find out if the installation was successful and keep it for a record of what was done.

+


+

Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION%

+


+

Package built by: %WHOBUILD%, language translated by: blackosx

+

Copyright © %CPRYEAR%

+
+ + \ No newline at end of file diff --git a/package/Resources/templates/.svn/text-base/Description.html.svn-base b/package/Resources/templates/.svn/text-base/Description.html.svn-base new file mode 100644 index 0000000..12d2bf5 --- /dev/null +++ b/package/Resources/templates/.svn/text-base/Description.html.svn-base @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources/templates/.svn/text-base/Localizable.strings.svn-base b/package/Resources/templates/.svn/text-base/Localizable.strings.svn-base new file mode 100644 index 0000000..2398ee6 --- /dev/null +++ b/package/Resources/templates/.svn/text-base/Localizable.strings.svn-base @@ -0,0 +1,296 @@ +// ============================================================================ +// Package +// ---------------------------------------------------------------------------- +"Chameleon_Package_Title" = "Chameleon Bootloader Package"; + +// ============================================================================ +// Error strings +// ---------------------------------------------------------------------------- +"ERROR_BOOTVOL" = "This software must be installed on the startup volume."; +"ERROR_INSTALL" = "This volume does not meet the requirements for this update."; + +"Newer_Package_Installed_message" = "A newer version of Chameleon is already installed"; +"Intel_Mac_message" = "This software cannot be installed on this computer."; + + +// ============================================================================ +// Bootloader +// ---------------------------------------------------------------------------- +"Chameleon_title" = "Chameleon Bootloader"; +"Chameleon_description" = "Chameleon requires three essential files. (in simple terms) +boot0 (On the drive's MBR) responsible for loading boot1. +boot1 (On the partition's boot-sector) to finding boot2. +boot2 (On the partition's root directory) for loading kernel etc."; + +"Standard_title" = "Standard"; +"Standard_description" = "Install Chameleon's files to the root of the selected partition using either boot0 or boot0md depending on your system without destroying any existing Windows installation if you have one."; + +"noboot_title" = "Don't install the Bootloader"; +"noboot_description" = "Useful if you only want to install the extra's."; + + +// ============================================================================ +// Modules +// ---------------------------------------------------------------------------- +"Module_title" = "Modules"; +"Module_description" = "The modules system incorporated in chameleon allows for a user or developer to extend the core functionality of chameleon without replacing the main boot file."; + +"klibc_title" = "klibc"; +"klibc_description" = "This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. +This is currently only used by the uClibc++ library. +Source: http://www.kernel.org/pub/linux/libs/klibc/"; + +"ACPICodec_title" = "ACPICodec"; +"ACPICodec_description" = "This module provides a substitute for the internal acpi patcher. +Dependencies: none"; + +"Sata_title" = "Sata"; +"Sata_description" = "Sata module, known as YellowIconFixer in cparm's branch. +Useful to fix yellow icon issue (can also fix an issue with the Apple's dvd player application in Mountain lion). +Dependencies: none"; + +"AutoReso_title" = "Resolution"; +"AutoReso_description" = "This module reads the edid information from the monitor attached to the main display. +The module is currently not integrated into trunk and has minimal uses as it stands. +Additionally, the module will patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting."; + +"uClibc_title" = "uClibc++"; +"uClibc_description" = "This module provides a minimalistic c++ runtime library for use in other modules. This does not provide functionality by itself, instead it is used to allow for the c++ language to be used in other modules. +*Please note that rtti and exceptions has both been disabled. +Source: http://cxx.uclibc.org/ +Dependencies: klibc"; + +// ============================================================================ +// Boot Options - The follow options are split to match the layout OptionalSettings text files. +// but they can be changed to suit however anyone wants to do it. +// ---------------------------------------------------------------------------- +"Options_title" = "Settings"; +"Options_description" = "Create an /Extra/org.chameleon.Boot.plist by selecting any of these boot options and kernel flags."; + +"BootBanner_title" = "BootBanner=No"; +"BootBanner_description" = "Hides Chameleon's boot banner in GUI. This is the text that is drawn at the top left corner of the screen displaying the release version etc."; + +"GUI_title" = "GUI=No"; +"GUI_description" = "Disables the default enabled graphic user interface."; + +"LegacyLogo_title" = "LegacyLogo=Yes"; +"LegacyLogo_description" = "Use the legacy 'dark grey' apple logo on the light grey screen for the boot process rather than the boot.png in the theme."; + +"InstantMenu_title" = "InstantMenu=Yes"; +"InstantMenu_description" = "By default, when Chameleon loads you'll see the icon for the current default partition, along with a timeout progress bar which left alone will count down before Chameleon automatically boots that partition. This options skips that and takes you directly to the device selection screen."; + +"QuietBoot_title" = "QuietBoot=Yes"; +"QuietBoot_description" = "Enable quiet boot mode (no messages or prompt)."; + +"ShowInfo_title" = "ShowInfo=Yes"; +"ShowInfo_description" = "Enables display of partition and resolution details shown on the left side of the GUI under the boot banner. This is useful information for troubleshooting, though can clash with certain themes."; + +"Wait_title" = "Wait=Yes"; +"Wait_description" = "Pauses the boot process after Chameleon has finished it's setup then waits for a key press before it starts the mach kernel. Useful when combined with verbose boot for troubleshooting."; + +// ---------------------------------------------------------------------------- + +"arch_title" = "arch=i386"; +"arch_description" = "Boots the kernel in 32bit mode rather than the default 64bit mode."; + +"EHCIacquire_title" = "EHCIacquire=Yes"; +"EHCIacquire_description" = "Enables the option to fix any EHCI ownership issues due to bad bioses."; + +"EthernetBuiltIn_title" = "EthernetBuiltIn=Yes"; +"EthernetBuiltIn_description" = "Enables the option of adding 'built-in' to your ethernet devices."; + +"ForceHPET_title" = "ForceHPET=Yes"; +"ForceHPET_description" = "Enables HPET on intel chipsets, for bioses that dont include the option."; + +"ForceWake_title" = "ForceWake=Yes"; +"ForceWake_description" = "This option enables you to bypass bad sleep images."; + +"RestartFix_title" = "RestartFix=No"; +"RestartFix_description" = "Disables the automatically enabled restart fix."; + +"UHCIreset_title" = "UHCIreset=Yes"; +"UHCIreset_description" = "Enables the option to reset UHCI controllers before starting OS X."; + +"UseMemDetect_title" = "UseMemDetect=No"; +"UseMemDetect_description" = "Disables the automatically enabled RAM recognition."; + +"UseKernelCache_title" = "UseKernelCache=Yes"; +"UseKernelCache_description" = "For Lion only. Enables loading of the pre-linked kernel. This will ignore /E/E and /S/L/E. ONLY use this is you have know it contains everything you need."; + +"Wake_title" = "Wake=Yes"; +"Wake_description" = "Attempts to load the sleep image saved from last hibernation."; + +// ---------------------------------------------------------------------------- + +"CSTUsingSystemIO_title" = "CSTUsingSystemIO=Yes"; +"CSTUsingSystemIO_description" = "New C-State _CST generation method using SystemIO registers instead of FixedHW."; + +"DropSSDT_title" = "DropSSDT=Yes"; +"DropSSDT_description" = "Discard the motherboard's built-in SSDT tables."; + +"EnableC2State_title" = "EnableC2State=Yes"; +"EnableC2State_description" = "Enable specific Processor power state, C2."; + +"EnableC3State_title" = "EnableC3State=Yes"; +"EnableC3State_description" = "Enable specific Processor power state, C3."; + +"EnableC4State_title" = "EnableC4State=Yes"; +"EnableC4State_description" = "Enable specific Processor power state, C4."; + +"GenerateCStates_title" = "GenerateCStates=Yes"; +"GenerateCStates_description" = "Enable auto generation of processor idle sleep states (C-States)."; + +"GeneratePStates_title" = "GeneratePStates=Yes"; +"GeneratePStates_description" = "Enable auto generation of processor power performance states (P-States)."; + +// ---------------------------------------------------------------------------- + +"1024x600x32_title" = "1024x600x32"; +"1024x600x32_description" = "Set Graphics Mode to 1024x600x32"; + +"1024x768x32_title" = "1024x768x32"; +"1024x768x32_description" = "Set Graphics Mode to 1024x768x32"; + +"1280x768x32_title" = "1280x768x32"; +"1280x768x32_description" = "Set Graphics Mode to 1280x768x32"; + +"1280x800x32_title" = "1280x800x32"; +"1280x800x32_description" = "Set Graphics Mode to 1280x800x32"; + +"1280x1024x32_title" = "1280x1024x32"; +"1280x1024x32_description" = "Set Graphics Mode to 1280x1024x32"; + +"1280x960x32_title" = "1280x960x32"; +"1280x960x32_description" = "Set Graphics Mode to 1280x960x32"; + +"1440x900x32_title" = "1440x900x32"; +"1440x900x32_description" = "Set Graphics Mode to 1440x900x32"; + +"1600x900x32_title" = "1600x900x32"; +"1600x900x32_description" = "Set Graphics Mode to 1600x900x32"; + +"1600x1200x32_title" = "1600x1200x32"; +"1600x1200x32_description" = "Set Graphics Mode to 1600x1200x32"; + +"1680x1050x32_title" = "1680x1050x32"; +"1680x1050x32_description" = "Set Graphics Mode to 1680x1050x32"; + +"1920x1080x32_title" = "1920x1080x32"; +"1920x1080x32_description" = "Set Graphics Mode to 1920x1080x32"; + +"1920x1200x32_title" = "1920x1200x32"; +"1920x1200x32_description" = "Set Graphics Mode to 1920x1200x32"; + +// ---------------------------------------------------------------------------- + +"GraphicsEnabler_title" = "GraphicsEnabler=Yes"; +"GraphicsEnabler_description" = "Enables the option to autodetect NVIDIA based GPUs and inject the correct info."; + +"EnableHDMIAudio_title" = "EnableHDMIAudio=Yes"; +"EnableHDMIAudio_description" = "Inject HDMi audio for NVIDIA or AMD/ATI."; + +"UseAtiROM_title" = "UseAtiROM=Yes"; +"UseAtiROM_description" = "Enables UseAtiROM options."; + +"UseNvidiaROM_title" = "UseNvidiaROM=Yes"; +"UseNvidiaROM_description" = "Enables UseNvidiaROM options."; + +"VBIOS_title" = "VBIOS=Yes"; +"VBIOS_description" = "Enables VBIOS option"; + +// ---------------------------------------------------------------------------- +// Boot options - KERNEL FLAGS +// ---------------------------------------------------------------------------- +"Verbose_title" = "Verbose Mode"; +"Verbose_description" = "Turns on verbose logging and allows you to see messages from both Chameleon and the OS X kernel at boot time. Essential for troubleshooting."; + +"Singleusermode_title" = "Single User Mode"; +"Singleusermode_description" = "A troubleshooting option used for booting into OS X's BSD/Unix command line."; + +"Ignorecaches_title" = "Ignore Caches"; +"Ignorecaches_description" = "Not an option that's needed for everyday booting, but it can be useful if you want OS X to load all files from it's system folders, rather than relying on it's pre-built caches."; + +"Npci_title" = "npci=0x2000"; +"Npci_description" = "For overcoming a hang at 'PCI configuration begin' on some systems. 0x2000 is the kIOPCIConfiguratorPFM64 flag, as seen in the IOPCIFamily source code."; + +"Npci3_title" = "npci=0x3000"; +"Npci3_description" = "For overcoming a hang at 'PCI configuration begin' on some systems. 0x3000 is the kIOPCIConfiguratorPFM64 flag, as seen in the IOPCIFamily source code."; + +"Darkwake_title" = "darkwake=0"; +"Darkwake_description" = "Lion only. Disables the 'low power wake' feature which can sometimes leave the screen black after wake from sleep."; + + +// ---------------------------------------------------------------------------- +// Boot options - KEYMAPS +// ---------------------------------------------------------------------------- +"mac-de_title" = "German Mac Keyboard"; +"mac-de_description" = "Use the keyboard layout for a German Mac keyboard"; + +"mac-es_title" = "Spanish Mac Keyboard"; +"mac-es_description" = "Use the keyboard layout for a Spanish Mac keyboard"; + +"mac-fr_title" = "French Mac Keyboard"; +"mac-fr_description" = "Use the keyboard layout for a French Mac keyboard"; + +"mac-it_title" = "Italian Mac Keyboard"; +"mac-it_description" = "Use the keyboard layout for an Italian Mac keyboard"; + +"mac-se_title" = "Swedish Mac Keyboard"; +"mac-se_description" = "Use the keyboard layout for a Swedish Mac keyboard"; + +"pc-fr_title" = "French PC Keyboard"; +"pc-fr_description" = "Use the keyboard layout for a French PC keyboard"; + + +// ---------------------------------------------------------------------------- +// Boot options - THEMES +// ---------------------------------------------------------------------------- +"Embed_title" = "Embed"; +"Embed_description" = "A smaller simple version of the new default theme used when building a version of Chameleon which requires an embedded theme."; + +"Legacy_title" = "Legacy"; +"Legacy_description" = "Chameleon's original default theme introduced for v2.0 RC1"; + +"Default_title" = "Standard"; +"Default_description" = "Chameleon default theme introduced for v2.0 RC5"; + +"Bullet_title" = "Bullet"; +"Bullet_description" = "A lovely simple theme by NoSmokingBandit from April 2009."; + + +// ============================================================================ +// The filenames from OptionalSettings text files' become sub menu headings. +// These sub menu headings need titles and descriptions. +// ---------------------------------------------------------------------------- +// Control +"Control_title" = "Control Options"; +"Control_description" = "Settings to control how Chameleon works."; + +// General +"General_title" = "General Options"; +"General_description" = "Choose from a selection of base options."; + +// KernelFlags +"KernelFlags_title" = "Kernel Flags"; +"KernelFlags_description" = "Choose from a selection of kernel flags."; + +// PowerManagement +"PowerManagement_title" = "Power Management"; +"PowerManagement_description" = "A selection of options that deal with power management and speedstep."; + +// Resolution +"Resolution_title" = "Resolution"; +"Resolution_description" = "Set one resolution to use."; + +// Video +"Video_title" = "Video"; +"Video_description" = "A selection of options that deal with video."; + +// Keymaps +"Keymaps_title" = "KeyLayout"; +"Keymaps_description" = "Select one keylayout to use. This will also install the Keylayout module and keymaps."; + +// Themes +"Themes_title" = "Themes"; +"Themes_description" = "A collection of sample themes +More themes can be found at http://forum.voodooprojects.org/index.php/board,7.0.html"; diff --git a/package/Resources/templates/.svn/text-base/Welcome.html.svn-base b/package/Resources/templates/.svn/text-base/Welcome.html.svn-base new file mode 100644 index 0000000..1c9244d --- /dev/null +++ b/package/Resources/templates/.svn/text-base/Welcome.html.svn-base @@ -0,0 +1,40 @@ + + + + + + + + + +
+


+

Chameleon

+

v%CHAMELEONVERSION% r%CHAMELEONREVISION%

+


+

Do not install to an Apple Macintosh computer

+


+

Developers :

+

%DEVELOP%

+


+

Thanks to :

+

%CREDITS%

+


+

Package :

+

%PKGDEV%

+


+

Package built by: %WHOBUILD%, language translated by: blackosx

+

Copyright © %CPRYEAR%

+
+ + \ No newline at end of file diff --git a/package/Resources/templates/Conclusion.html b/package/Resources/templates/Conclusion.html new file mode 100644 index 0000000..87e88c7 --- /dev/null +++ b/package/Resources/templates/Conclusion.html @@ -0,0 +1,34 @@ + + + + + + + + + +
+


+

+The scripts have completed and a file named @LOG_FILENAME@ + has been written to the root of your chosen partition.

+


+

Please read it + to find out if the installation was successful and keep it for a record of what was done.

+


+

Chameleon v%CHAMELEONVERSION% r%CHAMELEONREVISION%

+


+

Package built by: %WHOBUILD%, language translated by: blackosx

+

Copyright © %CPRYEAR%

+
+ + \ No newline at end of file diff --git a/package/Resources/templates/Description.html b/package/Resources/templates/Description.html new file mode 100644 index 0000000..12d2bf5 --- /dev/null +++ b/package/Resources/templates/Description.html @@ -0,0 +1,42 @@ + + + + + + + + + +

Chameleon is a boot loader built using a combination of components which evolved from the development of David Elliott's fake EFI implementation added to Apple's boot-132 project.

+


+

Chameleon v2 is extended with many features. For example:

+


+

- Fully customizable GUI to bring some color to the Darwin Bootloader.

+

- Load a ramdisk to directly boot retail DVDs without additional programs.

+

- Hibernation. Enjoy resuming your Mac OS X with a preview image.

+

- SMBIOS override to modify the factory SMBIOS values.

+

- DSDT override to use a modified fixed DSDT which can solve several issues.

+

- Device Property Injection via device-properties string.

+

- hybrid boot0 / boot1h for MBR and GPT partitioned disks.

+

- Automatic FSB detection code even for recent AMD CPUs.

+

- Apple Software RAID support.

+

- Nvidia & ATI/AMD Graphics Card Enabler.

+

- Module support

+

- Memory detection adapted from memtest86: http://www.memtest.org

+

- Automatic P-State & C-State generation for native power management.

+

- Message logging.

+


+

The code is released under version 2 of the Gnu Public License.

+

http://forge.voodooprojects.org/p/chameleon

+


+

FAQ's: http://forum.voodooprojects.org/index.php/topic,754.0.html

+ + diff --git a/package/Resources/templates/Localizable.strings b/package/Resources/templates/Localizable.strings new file mode 100644 index 0000000..2398ee6 --- /dev/null +++ b/package/Resources/templates/Localizable.strings @@ -0,0 +1,296 @@ +// ============================================================================ +// Package +// ---------------------------------------------------------------------------- +"Chameleon_Package_Title" = "Chameleon Bootloader Package"; + +// ============================================================================ +// Error strings +// ---------------------------------------------------------------------------- +"ERROR_BOOTVOL" = "This software must be installed on the startup volume."; +"ERROR_INSTALL" = "This volume does not meet the requirements for this update."; + +"Newer_Package_Installed_message" = "A newer version of Chameleon is already installed"; +"Intel_Mac_message" = "This software cannot be installed on this computer."; + + +// ============================================================================ +// Bootloader +// ---------------------------------------------------------------------------- +"Chameleon_title" = "Chameleon Bootloader"; +"Chameleon_description" = "Chameleon requires three essential files. (in simple terms) +boot0 (On the drive's MBR) responsible for loading boot1. +boot1 (On the partition's boot-sector) to finding boot2. +boot2 (On the partition's root directory) for loading kernel etc."; + +"Standard_title" = "Standard"; +"Standard_description" = "Install Chameleon's files to the root of the selected partition using either boot0 or boot0md depending on your system without destroying any existing Windows installation if you have one."; + +"noboot_title" = "Don't install the Bootloader"; +"noboot_description" = "Useful if you only want to install the extra's."; + + +// ============================================================================ +// Modules +// ---------------------------------------------------------------------------- +"Module_title" = "Modules"; +"Module_description" = "The modules system incorporated in chameleon allows for a user or developer to extend the core functionality of chameleon without replacing the main boot file."; + +"klibc_title" = "klibc"; +"klibc_description" = "This module provides a standard c library for modules to link to if the library provided by chameleon is insufficient. +This is currently only used by the uClibc++ library. +Source: http://www.kernel.org/pub/linux/libs/klibc/"; + +"ACPICodec_title" = "ACPICodec"; +"ACPICodec_description" = "This module provides a substitute for the internal acpi patcher. +Dependencies: none"; + +"Sata_title" = "Sata"; +"Sata_description" = "Sata module, known as YellowIconFixer in cparm's branch. +Useful to fix yellow icon issue (can also fix an issue with the Apple's dvd player application in Mountain lion). +Dependencies: none"; + +"AutoReso_title" = "Resolution"; +"AutoReso_description" = "This module reads the edid information from the monitor attached to the main display. +The module is currently not integrated into trunk and has minimal uses as it stands. +Additionally, the module will patch the vesa modes available in pre intel hd graphics cards to provide proper resolution while booting."; + +"uClibc_title" = "uClibc++"; +"uClibc_description" = "This module provides a minimalistic c++ runtime library for use in other modules. This does not provide functionality by itself, instead it is used to allow for the c++ language to be used in other modules. +*Please note that rtti and exceptions has both been disabled. +Source: http://cxx.uclibc.org/ +Dependencies: klibc"; + +// ============================================================================ +// Boot Options - The follow options are split to match the layout OptionalSettings text files. +// but they can be changed to suit however anyone wants to do it. +// ---------------------------------------------------------------------------- +"Options_title" = "Settings"; +"Options_description" = "Create an /Extra/org.chameleon.Boot.plist by selecting any of these boot options and kernel flags."; + +"BootBanner_title" = "BootBanner=No"; +"BootBanner_description" = "Hides Chameleon's boot banner in GUI. This is the text that is drawn at the top left corner of the screen displaying the release version etc."; + +"GUI_title" = "GUI=No"; +"GUI_description" = "Disables the default enabled graphic user interface."; + +"LegacyLogo_title" = "LegacyLogo=Yes"; +"LegacyLogo_description" = "Use the legacy 'dark grey' apple logo on the light grey screen for the boot process rather than the boot.png in the theme."; + +"InstantMenu_title" = "InstantMenu=Yes"; +"InstantMenu_description" = "By default, when Chameleon loads you'll see the icon for the current default partition, along with a timeout progress bar which left alone will count down before Chameleon automatically boots that partition. This options skips that and takes you directly to the device selection screen."; + +"QuietBoot_title" = "QuietBoot=Yes"; +"QuietBoot_description" = "Enable quiet boot mode (no messages or prompt)."; + +"ShowInfo_title" = "ShowInfo=Yes"; +"ShowInfo_description" = "Enables display of partition and resolution details shown on the left side of the GUI under the boot banner. This is useful information for troubleshooting, though can clash with certain themes."; + +"Wait_title" = "Wait=Yes"; +"Wait_description" = "Pauses the boot process after Chameleon has finished it's setup then waits for a key press before it starts the mach kernel. Useful when combined with verbose boot for troubleshooting."; + +// ---------------------------------------------------------------------------- + +"arch_title" = "arch=i386"; +"arch_description" = "Boots the kernel in 32bit mode rather than the default 64bit mode."; + +"EHCIacquire_title" = "EHCIacquire=Yes"; +"EHCIacquire_description" = "Enables the option to fix any EHCI ownership issues due to bad bioses."; + +"EthernetBuiltIn_title" = "EthernetBuiltIn=Yes"; +"EthernetBuiltIn_description" = "Enables the option of adding 'built-in' to your ethernet devices."; + +"ForceHPET_title" = "ForceHPET=Yes"; +"ForceHPET_description" = "Enables HPET on intel chipsets, for bioses that dont include the option."; + +"ForceWake_title" = "ForceWake=Yes"; +"ForceWake_description" = "This option enables you to bypass bad sleep images."; + +"RestartFix_title" = "RestartFix=No"; +"RestartFix_description" = "Disables the automatically enabled restart fix."; + +"UHCIreset_title" = "UHCIreset=Yes"; +"UHCIreset_description" = "Enables the option to reset UHCI controllers before starting OS X."; + +"UseMemDetect_title" = "UseMemDetect=No"; +"UseMemDetect_description" = "Disables the automatically enabled RAM recognition."; + +"UseKernelCache_title" = "UseKernelCache=Yes"; +"UseKernelCache_description" = "For Lion only. Enables loading of the pre-linked kernel. This will ignore /E/E and /S/L/E. ONLY use this is you have know it contains everything you need."; + +"Wake_title" = "Wake=Yes"; +"Wake_description" = "Attempts to load the sleep image saved from last hibernation."; + +// ---------------------------------------------------------------------------- + +"CSTUsingSystemIO_title" = "CSTUsingSystemIO=Yes"; +"CSTUsingSystemIO_description" = "New C-State _CST generation method using SystemIO registers instead of FixedHW."; + +"DropSSDT_title" = "DropSSDT=Yes"; +"DropSSDT_description" = "Discard the motherboard's built-in SSDT tables."; + +"EnableC2State_title" = "EnableC2State=Yes"; +"EnableC2State_description" = "Enable specific Processor power state, C2."; + +"EnableC3State_title" = "EnableC3State=Yes"; +"EnableC3State_description" = "Enable specific Processor power state, C3."; + +"EnableC4State_title" = "EnableC4State=Yes"; +"EnableC4State_description" = "Enable specific Processor power state, C4."; + +"GenerateCStates_title" = "GenerateCStates=Yes"; +"GenerateCStates_description" = "Enable auto generation of processor idle sleep states (C-States)."; + +"GeneratePStates_title" = "GeneratePStates=Yes"; +"GeneratePStates_description" = "Enable auto generation of processor power performance states (P-States)."; + +// ---------------------------------------------------------------------------- + +"1024x600x32_title" = "1024x600x32"; +"1024x600x32_description" = "Set Graphics Mode to 1024x600x32"; + +"1024x768x32_title" = "1024x768x32"; +"1024x768x32_description" = "Set Graphics Mode to 1024x768x32"; + +"1280x768x32_title" = "1280x768x32"; +"1280x768x32_description" = "Set Graphics Mode to 1280x768x32"; + +"1280x800x32_title" = "1280x800x32"; +"1280x800x32_description" = "Set Graphics Mode to 1280x800x32"; + +"1280x1024x32_title" = "1280x1024x32"; +"1280x1024x32_description" = "Set Graphics Mode to 1280x1024x32"; + +"1280x960x32_title" = "1280x960x32"; +"1280x960x32_description" = "Set Graphics Mode to 1280x960x32"; + +"1440x900x32_title" = "1440x900x32"; +"1440x900x32_description" = "Set Graphics Mode to 1440x900x32"; + +"1600x900x32_title" = "1600x900x32"; +"1600x900x32_description" = "Set Graphics Mode to 1600x900x32"; + +"1600x1200x32_title" = "1600x1200x32"; +"1600x1200x32_description" = "Set Graphics Mode to 1600x1200x32"; + +"1680x1050x32_title" = "1680x1050x32"; +"1680x1050x32_description" = "Set Graphics Mode to 1680x1050x32"; + +"1920x1080x32_title" = "1920x1080x32"; +"1920x1080x32_description" = "Set Graphics Mode to 1920x1080x32"; + +"1920x1200x32_title" = "1920x1200x32"; +"1920x1200x32_description" = "Set Graphics Mode to 1920x1200x32"; + +// ---------------------------------------------------------------------------- + +"GraphicsEnabler_title" = "GraphicsEnabler=Yes"; +"GraphicsEnabler_description" = "Enables the option to autodetect NVIDIA based GPUs and inject the correct info."; + +"EnableHDMIAudio_title" = "EnableHDMIAudio=Yes"; +"EnableHDMIAudio_description" = "Inject HDMi audio for NVIDIA or AMD/ATI."; + +"UseAtiROM_title" = "UseAtiROM=Yes"; +"UseAtiROM_description" = "Enables UseAtiROM options."; + +"UseNvidiaROM_title" = "UseNvidiaROM=Yes"; +"UseNvidiaROM_description" = "Enables UseNvidiaROM options."; + +"VBIOS_title" = "VBIOS=Yes"; +"VBIOS_description" = "Enables VBIOS option"; + +// ---------------------------------------------------------------------------- +// Boot options - KERNEL FLAGS +// ---------------------------------------------------------------------------- +"Verbose_title" = "Verbose Mode"; +"Verbose_description" = "Turns on verbose logging and allows you to see messages from both Chameleon and the OS X kernel at boot time. Essential for troubleshooting."; + +"Singleusermode_title" = "Single User Mode"; +"Singleusermode_description" = "A troubleshooting option used for booting into OS X's BSD/Unix command line."; + +"Ignorecaches_title" = "Ignore Caches"; +"Ignorecaches_description" = "Not an option that's needed for everyday booting, but it can be useful if you want OS X to load all files from it's system folders, rather than relying on it's pre-built caches."; + +"Npci_title" = "npci=0x2000"; +"Npci_description" = "For overcoming a hang at 'PCI configuration begin' on some systems. 0x2000 is the kIOPCIConfiguratorPFM64 flag, as seen in the IOPCIFamily source code."; + +"Npci3_title" = "npci=0x3000"; +"Npci3_description" = "For overcoming a hang at 'PCI configuration begin' on some systems. 0x3000 is the kIOPCIConfiguratorPFM64 flag, as seen in the IOPCIFamily source code."; + +"Darkwake_title" = "darkwake=0"; +"Darkwake_description" = "Lion only. Disables the 'low power wake' feature which can sometimes leave the screen black after wake from sleep."; + + +// ---------------------------------------------------------------------------- +// Boot options - KEYMAPS +// ---------------------------------------------------------------------------- +"mac-de_title" = "German Mac Keyboard"; +"mac-de_description" = "Use the keyboard layout for a German Mac keyboard"; + +"mac-es_title" = "Spanish Mac Keyboard"; +"mac-es_description" = "Use the keyboard layout for a Spanish Mac keyboard"; + +"mac-fr_title" = "French Mac Keyboard"; +"mac-fr_description" = "Use the keyboard layout for a French Mac keyboard"; + +"mac-it_title" = "Italian Mac Keyboard"; +"mac-it_description" = "Use the keyboard layout for an Italian Mac keyboard"; + +"mac-se_title" = "Swedish Mac Keyboard"; +"mac-se_description" = "Use the keyboard layout for a Swedish Mac keyboard"; + +"pc-fr_title" = "French PC Keyboard"; +"pc-fr_description" = "Use the keyboard layout for a French PC keyboard"; + + +// ---------------------------------------------------------------------------- +// Boot options - THEMES +// ---------------------------------------------------------------------------- +"Embed_title" = "Embed"; +"Embed_description" = "A smaller simple version of the new default theme used when building a version of Chameleon which requires an embedded theme."; + +"Legacy_title" = "Legacy"; +"Legacy_description" = "Chameleon's original default theme introduced for v2.0 RC1"; + +"Default_title" = "Standard"; +"Default_description" = "Chameleon default theme introduced for v2.0 RC5"; + +"Bullet_title" = "Bullet"; +"Bullet_description" = "A lovely simple theme by NoSmokingBandit from April 2009."; + + +// ============================================================================ +// The filenames from OptionalSettings text files' become sub menu headings. +// These sub menu headings need titles and descriptions. +// ---------------------------------------------------------------------------- +// Control +"Control_title" = "Control Options"; +"Control_description" = "Settings to control how Chameleon works."; + +// General +"General_title" = "General Options"; +"General_description" = "Choose from a selection of base options."; + +// KernelFlags +"KernelFlags_title" = "Kernel Flags"; +"KernelFlags_description" = "Choose from a selection of kernel flags."; + +// PowerManagement +"PowerManagement_title" = "Power Management"; +"PowerManagement_description" = "A selection of options that deal with power management and speedstep."; + +// Resolution +"Resolution_title" = "Resolution"; +"Resolution_description" = "Set one resolution to use."; + +// Video +"Video_title" = "Video"; +"Video_description" = "A selection of options that deal with video."; + +// Keymaps +"Keymaps_title" = "KeyLayout"; +"Keymaps_description" = "Select one keylayout to use. This will also install the Keylayout module and keymaps."; + +// Themes +"Themes_title" = "Themes"; +"Themes_description" = "A collection of sample themes +More themes can be found at http://forum.voodooprojects.org/index.php/board,7.0.html"; diff --git a/package/Resources/templates/Welcome.html b/package/Resources/templates/Welcome.html new file mode 100644 index 0000000..1c9244d --- /dev/null +++ b/package/Resources/templates/Welcome.html @@ -0,0 +1,40 @@ + + + + + + + + + +
+


+

Chameleon

+

v%CHAMELEONVERSION% r%CHAMELEONREVISION%

+


+

Do not install to an Apple Macintosh computer

+


+

Developers :

+

%DEVELOP%

+


+

Thanks to :

+

%CREDITS%

+


+

Package :

+

%PKGDEV%

+


+

Package built by: %WHOBUILD%, language translated by: blackosx

+

Copyright © %CPRYEAR%

+
+ + \ No newline at end of file diff --git a/package/Resources/zh_CN.lproj/.svn/all-wcprops b/package/Resources/zh_CN.lproj/.svn/all-wcprops new file mode 100644 index 0000000..9288349 --- /dev/null +++ b/package/Resources/zh_CN.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/zh_CN.lproj +END diff --git a/package/Resources/zh_CN.lproj/.svn/entries b/package/Resources/zh_CN.lproj/.svn/entries new file mode 100644 index 0000000..656de45 --- /dev/null +++ b/package/Resources/zh_CN.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/zh_CN.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/zh_CN.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/zh_CN.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..6b9cff3 --- /dev/null +++ b/package/Resources/zh_CN.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/zh_CN.lproj/Conclusion.rtfd +END diff --git a/package/Resources/zh_CN.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/zh_CN.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..68ad438 --- /dev/null +++ b/package/Resources/zh_CN.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/zh_CN.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/zh_CN.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/zh_CN.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..66c2c65 --- /dev/null +++ b/package/Resources/zh_CN.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/zh_CN.lproj/Welcome.rtfd +END diff --git a/package/Resources/zh_CN.lproj/Welcome.rtfd/.svn/entries b/package/Resources/zh_CN.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..835ca2b --- /dev/null +++ b/package/Resources/zh_CN.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/zh_CN.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/zh_TW.lproj/.svn/all-wcprops b/package/Resources/zh_TW.lproj/.svn/all-wcprops new file mode 100644 index 0000000..4d0baf9 --- /dev/null +++ b/package/Resources/zh_TW.lproj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/zh_TW.lproj +END diff --git a/package/Resources/zh_TW.lproj/.svn/entries b/package/Resources/zh_TW.lproj/.svn/entries new file mode 100644 index 0000000..6760f1b --- /dev/null +++ b/package/Resources/zh_TW.lproj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/zh_TW.lproj +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Welcome.rtfd +dir + +Conclusion.rtfd +dir + diff --git a/package/Resources/zh_TW.lproj/Conclusion.rtfd/.svn/all-wcprops b/package/Resources/zh_TW.lproj/Conclusion.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..f40a584 --- /dev/null +++ b/package/Resources/zh_TW.lproj/Conclusion.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/zh_TW.lproj/Conclusion.rtfd +END diff --git a/package/Resources/zh_TW.lproj/Conclusion.rtfd/.svn/entries b/package/Resources/zh_TW.lproj/Conclusion.rtfd/.svn/entries new file mode 100644 index 0000000..ae87638 --- /dev/null +++ b/package/Resources/zh_TW.lproj/Conclusion.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/zh_TW.lproj/Conclusion.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Resources/zh_TW.lproj/Welcome.rtfd/.svn/all-wcprops b/package/Resources/zh_TW.lproj/Welcome.rtfd/.svn/all-wcprops new file mode 100644 index 0000000..3db7b88 --- /dev/null +++ b/package/Resources/zh_TW.lproj/Welcome.rtfd/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Resources/zh_TW.lproj/Welcome.rtfd +END diff --git a/package/Resources/zh_TW.lproj/Welcome.rtfd/.svn/entries b/package/Resources/zh_TW.lproj/Welcome.rtfd/.svn/entries new file mode 100644 index 0000000..7e86767 --- /dev/null +++ b/package/Resources/zh_TW.lproj/Welcome.rtfd/.svn/entries @@ -0,0 +1,28 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Resources/zh_TW.lproj/Welcome.rtfd +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + diff --git a/package/Scripts.templates/.svn/all-wcprops b/package/Scripts.templates/.svn/all-wcprops new file mode 100644 index 0000000..e7acace --- /dev/null +++ b/package/Scripts.templates/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates +END diff --git a/package/Scripts.templates/.svn/entries b/package/Scripts.templates/.svn/entries new file mode 100644 index 0000000..7bfd3ee --- /dev/null +++ b/package/Scripts.templates/.svn/entries @@ -0,0 +1,46 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +InstallerLog +dir + +AddOption +dir + +Post +dir + +Pre +dir + +InstallTheme +dir + +InstallModule +dir + diff --git a/package/Scripts.templates/AddOption/.svn/all-wcprops b/package/Scripts.templates/AddOption/.svn/all-wcprops new file mode 100644 index 0000000..7e41d43 --- /dev/null +++ b/package/Scripts.templates/AddOption/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/AddOption +END +postinstall +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/AddOption/postinstall +END diff --git a/package/Scripts.templates/AddOption/.svn/entries b/package/Scripts.templates/AddOption/.svn/entries new file mode 100644 index 0000000..0fe274a --- /dev/null +++ b/package/Scripts.templates/AddOption/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates/AddOption +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +postinstall +file + + + + +2013-08-27T23:55:57.000000Z +51cbf2a926126818dd85ffd7cbbba2e7 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1536 + diff --git a/package/Scripts.templates/AddOption/.svn/prop-base/postinstall.svn-base b/package/Scripts.templates/AddOption/.svn/prop-base/postinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/AddOption/.svn/prop-base/postinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/AddOption/.svn/text-base/postinstall.svn-base b/package/Scripts.templates/AddOption/.svn/text-base/postinstall.svn-base new file mode 100644 index 0000000..78e7598 --- /dev/null +++ b/package/Scripts.templates/AddOption/.svn/text-base/postinstall.svn-base @@ -0,0 +1,57 @@ +#!/bin/bash + +set -u + +targetVolume="$3" + +key="@optionKey@" +value="@optionValue@" +type="@optionType@" +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# Check if target volume exists +if [[ ! -d "$targetVolume" ]]; then + echo "$targetVolume volume does not exist!" >&2 + exit 1 +fi + +exec >>"${logFile}" 2>&1 + +echo "Added boot option: ${key}=${value}" + +key="${key// /\\ }" # Escape spaces +value="${value// /\\ }" # Escape spaces + +bootPListFile="${targetVolume}/Extra/org.chameleon.Boot.plist" + +case "$type" in + bool|text) + /usr/libexec/plistbuddy -c "Add :${key} string ${value}" "$bootPListFile" + ;; + list) + current_values=$( /usr/libexec/plistbuddy -c "Print :${key}" \ + "$bootPListFile" 2>/dev/null ) + result=$? + current_values="${current_values// /\\ }" # Escape spaces + current_values="${current_values//\"/\\\"}" # Escape double quotes + + if [[ $result -eq 0 ]]; then + # Append our new values + if [[ "$current_values" = "" ]]; then + new_values="${value}" + else + new_values="${current_values}\ ${value}" + fi + /usr/libexec/plistbuddy -c "Set :${key} ${new_values}" \ + "$bootPListFile" + else + # Create a new option + new_values="${value}" + /usr/libexec/plistbuddy -c "Add :${key} string ${new_values}" \ + "$bootPListFile" + fi + ;; +esac + +exit 0 diff --git a/package/Scripts.templates/AddOption/postinstall b/package/Scripts.templates/AddOption/postinstall new file mode 100755 index 0000000..78e7598 --- /dev/null +++ b/package/Scripts.templates/AddOption/postinstall @@ -0,0 +1,57 @@ +#!/bin/bash + +set -u + +targetVolume="$3" + +key="@optionKey@" +value="@optionValue@" +type="@optionType@" +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# Check if target volume exists +if [[ ! -d "$targetVolume" ]]; then + echo "$targetVolume volume does not exist!" >&2 + exit 1 +fi + +exec >>"${logFile}" 2>&1 + +echo "Added boot option: ${key}=${value}" + +key="${key// /\\ }" # Escape spaces +value="${value// /\\ }" # Escape spaces + +bootPListFile="${targetVolume}/Extra/org.chameleon.Boot.plist" + +case "$type" in + bool|text) + /usr/libexec/plistbuddy -c "Add :${key} string ${value}" "$bootPListFile" + ;; + list) + current_values=$( /usr/libexec/plistbuddy -c "Print :${key}" \ + "$bootPListFile" 2>/dev/null ) + result=$? + current_values="${current_values// /\\ }" # Escape spaces + current_values="${current_values//\"/\\\"}" # Escape double quotes + + if [[ $result -eq 0 ]]; then + # Append our new values + if [[ "$current_values" = "" ]]; then + new_values="${value}" + else + new_values="${current_values}\ ${value}" + fi + /usr/libexec/plistbuddy -c "Set :${key} ${new_values}" \ + "$bootPListFile" + else + # Create a new option + new_values="${value}" + /usr/libexec/plistbuddy -c "Add :${key} string ${new_values}" \ + "$bootPListFile" + fi + ;; +esac + +exit 0 diff --git a/package/Scripts.templates/InstallModule/.svn/all-wcprops b/package/Scripts.templates/InstallModule/.svn/all-wcprops new file mode 100644 index 0000000..13daf36 --- /dev/null +++ b/package/Scripts.templates/InstallModule/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/InstallModule +END +postinstall +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/InstallModule/postinstall +END diff --git a/package/Scripts.templates/InstallModule/.svn/entries b/package/Scripts.templates/InstallModule/.svn/entries new file mode 100644 index 0000000..e1684eb --- /dev/null +++ b/package/Scripts.templates/InstallModule/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates/InstallModule +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +postinstall +file + + + + +2013-08-27T23:55:57.000000Z +320f5aec53a4135a388443c27cf6bb9b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +414 + diff --git a/package/Scripts.templates/InstallModule/.svn/prop-base/postinstall.svn-base b/package/Scripts.templates/InstallModule/.svn/prop-base/postinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/InstallModule/.svn/prop-base/postinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/InstallModule/.svn/text-base/postinstall.svn-base b/package/Scripts.templates/InstallModule/.svn/text-base/postinstall.svn-base new file mode 100644 index 0000000..f509c86 --- /dev/null +++ b/package/Scripts.templates/InstallModule/.svn/text-base/postinstall.svn-base @@ -0,0 +1,22 @@ +#!/bin/bash + +set -u + +targetVolume="$3" + +moduleName="@moduleName@" +moduleFile="@moduleFile@" +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# Check if target volume exists +if [[ ! -d "$targetVolume" ]]; then + echo "$targetVolume volume does not exist!" >&2 + exit 1 +fi + +exec >>"${logFile}" 2>&1 + +[[ -f "${targetVolume}/Extra/modules/$moduleFile" ]] && echo "Module $moduleName installed" + +exit 0 diff --git a/package/Scripts.templates/InstallModule/postinstall b/package/Scripts.templates/InstallModule/postinstall new file mode 100755 index 0000000..f509c86 --- /dev/null +++ b/package/Scripts.templates/InstallModule/postinstall @@ -0,0 +1,22 @@ +#!/bin/bash + +set -u + +targetVolume="$3" + +moduleName="@moduleName@" +moduleFile="@moduleFile@" +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# Check if target volume exists +if [[ ! -d "$targetVolume" ]]; then + echo "$targetVolume volume does not exist!" >&2 + exit 1 +fi + +exec >>"${logFile}" 2>&1 + +[[ -f "${targetVolume}/Extra/modules/$moduleFile" ]] && echo "Module $moduleName installed" + +exit 0 diff --git a/package/Scripts.templates/InstallTheme/.svn/all-wcprops b/package/Scripts.templates/InstallTheme/.svn/all-wcprops new file mode 100644 index 0000000..cff4916 --- /dev/null +++ b/package/Scripts.templates/InstallTheme/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/InstallTheme +END +postinstall +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/InstallTheme/postinstall +END diff --git a/package/Scripts.templates/InstallTheme/.svn/entries b/package/Scripts.templates/InstallTheme/.svn/entries new file mode 100644 index 0000000..6d3c64c --- /dev/null +++ b/package/Scripts.templates/InstallTheme/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates/InstallTheme +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +postinstall +file + + + + +2013-08-27T23:55:57.000000Z +9d3ff8c6dbcff4575d3c315f5b4c16ea +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +403 + diff --git a/package/Scripts.templates/InstallTheme/.svn/prop-base/postinstall.svn-base b/package/Scripts.templates/InstallTheme/.svn/prop-base/postinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/InstallTheme/.svn/prop-base/postinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/InstallTheme/.svn/text-base/postinstall.svn-base b/package/Scripts.templates/InstallTheme/.svn/text-base/postinstall.svn-base new file mode 100644 index 0000000..eec3676 --- /dev/null +++ b/package/Scripts.templates/InstallTheme/.svn/text-base/postinstall.svn-base @@ -0,0 +1,22 @@ +#!/bin/bash + +set -u + +targetVolume="$3" + +themeName="@themeName@" +themeDir="@themeDir@" +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# Check if target volume exists +if [[ ! -d "$targetVolume" ]]; then + echo "$targetVolume volume does not exist!" >&2 + exit 1 +fi + +exec >>"${logFile}" 2>&1 + +[[ -d "${targetVolume}/Extra/Themes/$themeDir" ]] && echo "Theme $themeName installed" + +exit 0 diff --git a/package/Scripts.templates/InstallTheme/postinstall b/package/Scripts.templates/InstallTheme/postinstall new file mode 100755 index 0000000..eec3676 --- /dev/null +++ b/package/Scripts.templates/InstallTheme/postinstall @@ -0,0 +1,22 @@ +#!/bin/bash + +set -u + +targetVolume="$3" + +themeName="@themeName@" +themeDir="@themeDir@" +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# Check if target volume exists +if [[ ! -d "$targetVolume" ]]; then + echo "$targetVolume volume does not exist!" >&2 + exit 1 +fi + +exec >>"${logFile}" 2>&1 + +[[ -d "${targetVolume}/Extra/Themes/$themeDir" ]] && echo "Theme $themeName installed" + +exit 0 diff --git a/package/Scripts.templates/InstallerLog/.svn/all-wcprops b/package/Scripts.templates/InstallerLog/.svn/all-wcprops new file mode 100644 index 0000000..f77b7b6 --- /dev/null +++ b/package/Scripts.templates/InstallerLog/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/InstallerLog +END +InstallLog.sh +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/InstallerLog/InstallLog.sh +END diff --git a/package/Scripts.templates/InstallerLog/.svn/entries b/package/Scripts.templates/InstallerLog/.svn/entries new file mode 100644 index 0000000..bda41f5 --- /dev/null +++ b/package/Scripts.templates/InstallerLog/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates/InstallerLog +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +InstallLog.sh +file + + + + +2013-08-27T23:55:57.000000Z +5b1c58f640756e6545e4b3b8857d26a0 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1402 + diff --git a/package/Scripts.templates/InstallerLog/.svn/prop-base/InstallLog.sh.svn-base b/package/Scripts.templates/InstallerLog/.svn/prop-base/InstallLog.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/InstallerLog/.svn/prop-base/InstallLog.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/InstallerLog/.svn/text-base/InstallLog.sh.svn-base b/package/Scripts.templates/InstallerLog/.svn/text-base/InstallLog.sh.svn-base new file mode 100644 index 0000000..028fa81 --- /dev/null +++ b/package/Scripts.templates/InstallerLog/.svn/text-base/InstallLog.sh.svn-base @@ -0,0 +1,50 @@ +#!/bin/bash + +#echo "===============================================" +#echo "InstallLog: Create/Append installation log" +#echo "**********************************************" + +# Writes to the @LOG_FILENAME@ file created +# by the preinstall script at the start of installation. + +# Receives two parameters +# $1 = selected volume for location of the install log +# $2 = text to write to the installer log + +if [ "$#" -eq 2 ]; then + logLocation="$1" + verboseText="$2" + #echo "DEBUG: passed argument = ${logLocation}" + #echo "DEBUG: passed argument = ${verboseText}" +else + echo "InstallLog: Error - wrong number of values passed" + exit 9 +fi + +logName="@LOG_FILENAME@" +logFile="${logLocation}"/$logName + +if [ -f "${logFile}" ]; then + + # Append messages to the log as passed by other scripts. + if [ "${verboseText}" = "Diskutil" ]; then + diskutil list >>"${logFile}" + echo "======================================================" >>"${logFile}" + fi + + if [ "${verboseText}" = "LineBreak" ]; then + echo "======================================================" >>"${logFile}" + fi + + if [[ "${verboseText}" == *fdisk* ]]; then + targetDiskRaw="${verboseText#fdisk *}" + fdisk $targetDiskRaw >>"${logFile}" + echo " " >>"${logFile}" + fi + + if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]] && [[ "${verboseText}" != "Diskutil" ]]; then + echo "${verboseText}" >> "${logFile}" + fi +fi + +exit 0 diff --git a/package/Scripts.templates/InstallerLog/InstallLog.sh b/package/Scripts.templates/InstallerLog/InstallLog.sh new file mode 100755 index 0000000..028fa81 --- /dev/null +++ b/package/Scripts.templates/InstallerLog/InstallLog.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +#echo "===============================================" +#echo "InstallLog: Create/Append installation log" +#echo "**********************************************" + +# Writes to the @LOG_FILENAME@ file created +# by the preinstall script at the start of installation. + +# Receives two parameters +# $1 = selected volume for location of the install log +# $2 = text to write to the installer log + +if [ "$#" -eq 2 ]; then + logLocation="$1" + verboseText="$2" + #echo "DEBUG: passed argument = ${logLocation}" + #echo "DEBUG: passed argument = ${verboseText}" +else + echo "InstallLog: Error - wrong number of values passed" + exit 9 +fi + +logName="@LOG_FILENAME@" +logFile="${logLocation}"/$logName + +if [ -f "${logFile}" ]; then + + # Append messages to the log as passed by other scripts. + if [ "${verboseText}" = "Diskutil" ]; then + diskutil list >>"${logFile}" + echo "======================================================" >>"${logFile}" + fi + + if [ "${verboseText}" = "LineBreak" ]; then + echo "======================================================" >>"${logFile}" + fi + + if [[ "${verboseText}" == *fdisk* ]]; then + targetDiskRaw="${verboseText#fdisk *}" + fdisk $targetDiskRaw >>"${logFile}" + echo " " >>"${logFile}" + fi + + if [ "${verboseText}" != "LineBreak" ] && [[ "${verboseText}" != *fdisk* ]] && [[ "${verboseText}" != "Diskutil" ]]; then + echo "${verboseText}" >> "${logFile}" + fi +fi + +exit 0 diff --git a/package/Scripts.templates/Post/.svn/all-wcprops b/package/Scripts.templates/Post/.svn/all-wcprops new file mode 100644 index 0000000..bf33a3f --- /dev/null +++ b/package/Scripts.templates/Post/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/Post +END +postinstall +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/Post/postinstall +END diff --git a/package/Scripts.templates/Post/.svn/entries b/package/Scripts.templates/Post/.svn/entries new file mode 100644 index 0000000..97768f9 --- /dev/null +++ b/package/Scripts.templates/Post/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates/Post +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +postinstall +file + + + + +2013-08-27T23:55:57.000000Z +9e23561d2552fb2ff5e86d127cc09f50 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1666 + diff --git a/package/Scripts.templates/Post/.svn/prop-base/postinstall.svn-base b/package/Scripts.templates/Post/.svn/prop-base/postinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/Post/.svn/prop-base/postinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/Post/.svn/text-base/postinstall.svn-base b/package/Scripts.templates/Post/.svn/text-base/postinstall.svn-base new file mode 100644 index 0000000..e0bc312 --- /dev/null +++ b/package/Scripts.templates/Post/.svn/text-base/postinstall.svn-base @@ -0,0 +1,57 @@ +#!/bin/bash + +# $1 = Full path to the installation package the installer app is processing +# $2 = Full path to the installation destination +# $3 = Installation volume (mountpoint) to receive the payload +# $4 = Root directory for the system + +# Check target exists +if [ ! -d "$3" ]; then + echo "$3 volume does not exist !" >&2 + exit 1 +fi + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ]; then + dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + dest_vol="$3" +fi + +logName="@LOG_FILENAME@" +logFile="${dest_vol}/$logName" + +exec >>"${logFile}" 2>&1 + +# Find script location so to find the Install Log script. +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + +# Write some information to the Install Log +echo "======================================================" +echo "Running Post postinstall script" +echo "Target volume = ${dest_vol}" + +# --------------------------------------------- +# Update Rights +# --------------------------------------------- +chmod 777 ${dest_vol}/Extra 2>/dev/null +chmod 666 ${dest_vol}/Extra/*.plist 2>/dev/null + +# --------------------------------------------- +# Cleanup +# --------------------------------------------- + +# Unmount ALL mounted volumes named EFI +"$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}" + +# remove any temporary boot sector files if they exist +rm -f /tmp/newbs /tmp/origbs /tmp/originalBootSector /tmp/newBootSector + +# Remove /.ChameleonEFI file +rm -f "${dest_vol}/.ChameleonEFI" + +echo "======================================================" +echo "Post postinstall script complete" diff --git a/package/Scripts.templates/Post/postinstall b/package/Scripts.templates/Post/postinstall new file mode 100755 index 0000000..e0bc312 --- /dev/null +++ b/package/Scripts.templates/Post/postinstall @@ -0,0 +1,57 @@ +#!/bin/bash + +# $1 = Full path to the installation package the installer app is processing +# $2 = Full path to the installation destination +# $3 = Installation volume (mountpoint) to receive the payload +# $4 = Root directory for the system + +# Check target exists +if [ ! -d "$3" ]; then + echo "$3 volume does not exist !" >&2 + exit 1 +fi + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ]; then + dest_vol="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + dest_vol="$3" +fi + +logName="@LOG_FILENAME@" +logFile="${dest_vol}/$logName" + +exec >>"${logFile}" 2>&1 + +# Find script location so to find the Install Log script. +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + +# Write some information to the Install Log +echo "======================================================" +echo "Running Post postinstall script" +echo "Target volume = ${dest_vol}" + +# --------------------------------------------- +# Update Rights +# --------------------------------------------- +chmod 777 ${dest_vol}/Extra 2>/dev/null +chmod 666 ${dest_vol}/Extra/*.plist 2>/dev/null + +# --------------------------------------------- +# Cleanup +# --------------------------------------------- + +# Unmount ALL mounted volumes named EFI +"$scriptDir"UnMountEFIvolumes.sh "${dest_vol}" "${scriptDir}" + +# remove any temporary boot sector files if they exist +rm -f /tmp/newbs /tmp/origbs /tmp/originalBootSector /tmp/newBootSector + +# Remove /.ChameleonEFI file +rm -f "${dest_vol}/.ChameleonEFI" + +echo "======================================================" +echo "Post postinstall script complete" diff --git a/package/Scripts.templates/Pre/.svn/all-wcprops b/package/Scripts.templates/Pre/.svn/all-wcprops new file mode 100644 index 0000000..628ea96 --- /dev/null +++ b/package/Scripts.templates/Pre/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/Pre +END +clean_bootplist.pl +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/Pre/clean_bootplist.pl +END +preinstall +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts.templates/Pre/preinstall +END diff --git a/package/Scripts.templates/Pre/.svn/entries b/package/Scripts.templates/Pre/.svn/entries new file mode 100644 index 0000000..7782fb9 --- /dev/null +++ b/package/Scripts.templates/Pre/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts.templates/Pre +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +clean_bootplist.pl +file + + + + +2013-08-27T23:55:57.000000Z +4e42c46ea1b9af657f077ecd1d1ab19b +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2605 + +preinstall +file + + + + +2013-08-27T23:55:57.000000Z +9415e2bfe44337926853578b81be351d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3545 + diff --git a/package/Scripts.templates/Pre/.svn/prop-base/clean_bootplist.pl.svn-base b/package/Scripts.templates/Pre/.svn/prop-base/clean_bootplist.pl.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/Pre/.svn/prop-base/clean_bootplist.pl.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/Pre/.svn/prop-base/preinstall.svn-base b/package/Scripts.templates/Pre/.svn/prop-base/preinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts.templates/Pre/.svn/prop-base/preinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts.templates/Pre/.svn/text-base/clean_bootplist.pl.svn-base b/package/Scripts.templates/Pre/.svn/text-base/clean_bootplist.pl.svn-base new file mode 100644 index 0000000..ebd8232 --- /dev/null +++ b/package/Scripts.templates/Pre/.svn/text-base/clean_bootplist.pl.svn-base @@ -0,0 +1,95 @@ +#!/usr/bin/perl + +use strict; +use YAML::Syck; + +our $target_volume; +our $boot_plist_filepath; + +our $yaml_file="@YAML_FILE@"; + +if ($#ARGV < 0) { + print stderr "A target volume is needed\n"; +} else { + $target_volume=$ARGV[0]; +} + +$boot_plist_filepath = "${target_volume}/Extra/org.chameleon.Boot.plist"; +if ( -f "$boot_plist_filepath" ) { + main("$yaml_file"); +} + +sub _do_cmd { + my ($cmd, $key, $value) = @_; + my $out; + + $key =~ s/([\s])/\\$1/g; # Escape characters in key + $value =~ s/([\s"])/\\$1/g; # Escape characters in value (space & ") + my $plistbuddy_command="$cmd :$key $value"; + + open ( OUTPUT, "-|", '/usr/libexec/plistbuddy', "-c", "$plistbuddy_command", "$boot_plist_filepath" ); + my $exit_code = $?; + chomp($out = ); + close OUTPUT; + return $out; +} + +sub get_boot_plist_option { + my ($option) = @_; + return _do_cmd( "Print", "$option"); +} + +sub delete_boot_plist_option { + my ($option) = @_; + return _do_cmd( "Delete", "$option"); +} + +sub delete_boot_plist_text_option { + my ($option, $values) = @_; + my $current_value = get_boot_plist_option "$option"; + if ( $current_value ne "") { + foreach my $recognized_value (@{$values}) { + if ($recognized_value eq $current_value) { + return _do_cmd( "Delete", "$option"); + } + } + } + return ""; +} + +sub delete_boot_plist_list_option { + my ($option, $values) = @_; + my $current_value = get_boot_plist_option "$option"; + if ( $current_value ne "") { + my %count; + my @new_list; + foreach my $value (@{$values}) { + $count{$value} = 1; + } + foreach my $value (split(/\s+/,$current_value)) { + if ( not exists $count{$value} ) { + push @new_list, $value; + } + } + return _do_cmd( "Set", $option, join(' ',@new_list) ); + } + return ""; +} + +sub main() { + # Remove all options that installer can managed + my ($yaml_file) = @_; + my $hash_ref = LoadFile($yaml_file) or die "Can't open yaml file\n"; + foreach my $option ( keys %{$hash_ref} ) { + my $type = $hash_ref->{$option}->{type}; + if ( $type =~ /^bool$/i ) { + delete_boot_plist_option($option); + } elsif ( $type =~ /^text$/i ) { + delete_boot_plist_text_option( $option, + $hash_ref->{$option}->{values} ); + } elsif ( $type =~ /^list$/i ) { + delete_boot_plist_list_option( $option, + $hash_ref->{$option}->{values} ); + } + } +} diff --git a/package/Scripts.templates/Pre/.svn/text-base/preinstall.svn-base b/package/Scripts.templates/Pre/.svn/text-base/preinstall.svn-base new file mode 100644 index 0000000..f93817c --- /dev/null +++ b/package/Scripts.templates/Pre/.svn/text-base/preinstall.svn-base @@ -0,0 +1,99 @@ +#!/bin/bash + +echo "===============================================" +echo "Pre-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +# Creates text file named '@LOG_FILENAME@' +# at the root of the target volume. This is to give the user +# a record of the installation process and also to show why +# possibly the installation process failed (even though the +# package installer ends reading 'Installation Successful'). + +# This script also prepares, then backs up any previous +# stage2 boot file, /Extra folder and install log if they exist. + +# Find location of this script in the package installer +# so we know where all the other scripts are located. + +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolume="$3" +fi + +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# --------------------------------------------- +# Preparing Backing up of Chameleon files +# --------------------------------------------- +backupRootDir="${targetVolume}/Chameleon.Backups" +backupDir="${backupRootDir}/"$( date -j "+%F-%Hh%M" ) + +# Create the backup dirextory +mkdir -p "$backupDir" + +[[ -f "$logFile" ]] && mv "$logFile" "${backupDir}/${logName}" # Backup old log file + +# Setup Chameleon Log file +# by writing header and diskutil list + +echo "Chameleon installer log - $( date ) +Installer version: %CHAMELEONVERSION% %CHAMELEONREVISION% +======================================================" >"${logFile}" + +diskutil list >>"${logFile}" +echo "======================================================" >>"${logFile}" + +# --------------------------------------------- +# Backing up Chameleon files +# --------------------------------------------- +echo "Backing up Chameleon files" >>"${logFile}" +# Backup stage2 +if [[ -f "${targetVolume}/boot" ]];then + echo "Backing up stage2 file ${targetVolume}/boot to ${backupDir}/boot" >>"${logFile}" + cp -p "${targetVolume}/boot" "${backupDir}/boot" +fi +# Backup /Extra directory +if [[ -d "${targetVolume}/Extra" ]];then + echo "Backing up ${targetVolume}/Extra folder to ${backupDir}/Extra" >>"${logFile}" + cp -pR "${targetVolume}/Extra" "${backupDir}/Extra" +fi + +chflags -R nohidden "$backupDir" # Remove the invisible flag of files in the backups + +find "${backupRootDir}" -type d -depth -empty -exec rmdir {} \; # Remove empty directories + +echo "======================================================" >>"${logFile}" + +# Check existing plist name for old naming convention and change to new convention. +if [[ -f "${targetVolume}/Extra/com.apple.Boot.plist" ]]; then + echo "Renaming existing com.apple.Boot.plist to org.chameleon.Boot.plist" >>"${logFile}" + mv "${targetVolume}/Extra/com.apple.Boot.plist" "${targetVolume}/Extra/org.chameleon.Boot.plist" +fi + +# --------------------------------------------- +# Clearing options that Chameleon can managed +# --------------------------------------------- +echo "Clearing options..." >>"${logFile}" +"${PWD}/clean_bootplist.pl" "${targetVolume}" 2>&1 | grep -v 'Does Not Exist' >>"${logFile}" +echo "======================================================" >>"${logFile}" + +echo "===============================================" +echo "END - Pre-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts.templates/Pre/clean_bootplist.pl b/package/Scripts.templates/Pre/clean_bootplist.pl new file mode 100755 index 0000000..ebd8232 --- /dev/null +++ b/package/Scripts.templates/Pre/clean_bootplist.pl @@ -0,0 +1,95 @@ +#!/usr/bin/perl + +use strict; +use YAML::Syck; + +our $target_volume; +our $boot_plist_filepath; + +our $yaml_file="@YAML_FILE@"; + +if ($#ARGV < 0) { + print stderr "A target volume is needed\n"; +} else { + $target_volume=$ARGV[0]; +} + +$boot_plist_filepath = "${target_volume}/Extra/org.chameleon.Boot.plist"; +if ( -f "$boot_plist_filepath" ) { + main("$yaml_file"); +} + +sub _do_cmd { + my ($cmd, $key, $value) = @_; + my $out; + + $key =~ s/([\s])/\\$1/g; # Escape characters in key + $value =~ s/([\s"])/\\$1/g; # Escape characters in value (space & ") + my $plistbuddy_command="$cmd :$key $value"; + + open ( OUTPUT, "-|", '/usr/libexec/plistbuddy', "-c", "$plistbuddy_command", "$boot_plist_filepath" ); + my $exit_code = $?; + chomp($out = ); + close OUTPUT; + return $out; +} + +sub get_boot_plist_option { + my ($option) = @_; + return _do_cmd( "Print", "$option"); +} + +sub delete_boot_plist_option { + my ($option) = @_; + return _do_cmd( "Delete", "$option"); +} + +sub delete_boot_plist_text_option { + my ($option, $values) = @_; + my $current_value = get_boot_plist_option "$option"; + if ( $current_value ne "") { + foreach my $recognized_value (@{$values}) { + if ($recognized_value eq $current_value) { + return _do_cmd( "Delete", "$option"); + } + } + } + return ""; +} + +sub delete_boot_plist_list_option { + my ($option, $values) = @_; + my $current_value = get_boot_plist_option "$option"; + if ( $current_value ne "") { + my %count; + my @new_list; + foreach my $value (@{$values}) { + $count{$value} = 1; + } + foreach my $value (split(/\s+/,$current_value)) { + if ( not exists $count{$value} ) { + push @new_list, $value; + } + } + return _do_cmd( "Set", $option, join(' ',@new_list) ); + } + return ""; +} + +sub main() { + # Remove all options that installer can managed + my ($yaml_file) = @_; + my $hash_ref = LoadFile($yaml_file) or die "Can't open yaml file\n"; + foreach my $option ( keys %{$hash_ref} ) { + my $type = $hash_ref->{$option}->{type}; + if ( $type =~ /^bool$/i ) { + delete_boot_plist_option($option); + } elsif ( $type =~ /^text$/i ) { + delete_boot_plist_text_option( $option, + $hash_ref->{$option}->{values} ); + } elsif ( $type =~ /^list$/i ) { + delete_boot_plist_list_option( $option, + $hash_ref->{$option}->{values} ); + } + } +} diff --git a/package/Scripts.templates/Pre/preinstall b/package/Scripts.templates/Pre/preinstall new file mode 100755 index 0000000..f93817c --- /dev/null +++ b/package/Scripts.templates/Pre/preinstall @@ -0,0 +1,99 @@ +#!/bin/bash + +echo "===============================================" +echo "Pre-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +# Creates text file named '@LOG_FILENAME@' +# at the root of the target volume. This is to give the user +# a record of the installation process and also to show why +# possibly the installation process failed (even though the +# package installer ends reading 'Installation Successful'). + +# This script also prepares, then backs up any previous +# stage2 boot file, /Extra folder and install log if they exist. + +# Find location of this script in the package installer +# so we know where all the other scripts are located. + +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolume="$3" +fi + +logName="@LOG_FILENAME@" +logFile="${targetVolume}/$logName" + +# --------------------------------------------- +# Preparing Backing up of Chameleon files +# --------------------------------------------- +backupRootDir="${targetVolume}/Chameleon.Backups" +backupDir="${backupRootDir}/"$( date -j "+%F-%Hh%M" ) + +# Create the backup dirextory +mkdir -p "$backupDir" + +[[ -f "$logFile" ]] && mv "$logFile" "${backupDir}/${logName}" # Backup old log file + +# Setup Chameleon Log file +# by writing header and diskutil list + +echo "Chameleon installer log - $( date ) +Installer version: %CHAMELEONVERSION% %CHAMELEONREVISION% +======================================================" >"${logFile}" + +diskutil list >>"${logFile}" +echo "======================================================" >>"${logFile}" + +# --------------------------------------------- +# Backing up Chameleon files +# --------------------------------------------- +echo "Backing up Chameleon files" >>"${logFile}" +# Backup stage2 +if [[ -f "${targetVolume}/boot" ]];then + echo "Backing up stage2 file ${targetVolume}/boot to ${backupDir}/boot" >>"${logFile}" + cp -p "${targetVolume}/boot" "${backupDir}/boot" +fi +# Backup /Extra directory +if [[ -d "${targetVolume}/Extra" ]];then + echo "Backing up ${targetVolume}/Extra folder to ${backupDir}/Extra" >>"${logFile}" + cp -pR "${targetVolume}/Extra" "${backupDir}/Extra" +fi + +chflags -R nohidden "$backupDir" # Remove the invisible flag of files in the backups + +find "${backupRootDir}" -type d -depth -empty -exec rmdir {} \; # Remove empty directories + +echo "======================================================" >>"${logFile}" + +# Check existing plist name for old naming convention and change to new convention. +if [[ -f "${targetVolume}/Extra/com.apple.Boot.plist" ]]; then + echo "Renaming existing com.apple.Boot.plist to org.chameleon.Boot.plist" >>"${logFile}" + mv "${targetVolume}/Extra/com.apple.Boot.plist" "${targetVolume}/Extra/org.chameleon.Boot.plist" +fi + +# --------------------------------------------- +# Clearing options that Chameleon can managed +# --------------------------------------------- +echo "Clearing options..." >>"${logFile}" +"${PWD}/clean_bootplist.pl" "${targetVolume}" 2>&1 | grep -v 'Does Not Exist' >>"${logFile}" +echo "======================================================" >>"${logFile}" + +echo "===============================================" +echo "END - Pre-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/.svn/all-wcprops b/package/Scripts/.svn/all-wcprops new file mode 100644 index 0000000..df2f19d --- /dev/null +++ b/package/Scripts/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts +END diff --git a/package/Scripts/.svn/entries b/package/Scripts/.svn/entries new file mode 100644 index 0000000..d3f2894 --- /dev/null +++ b/package/Scripts/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +Main +dir + +Sub +dir + diff --git a/package/Scripts/Main/.svn/all-wcprops b/package/Scripts/Main/.svn/all-wcprops new file mode 100644 index 0000000..3219096 --- /dev/null +++ b/package/Scripts/Main/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Main +END +ESPpostinstall +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Main/ESPpostinstall +END +Standardpostinstall +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Main/Standardpostinstall +END diff --git a/package/Scripts/Main/.svn/entries b/package/Scripts/Main/.svn/entries new file mode 100644 index 0000000..5a9c306 --- /dev/null +++ b/package/Scripts/Main/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts/Main +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +ESPpostinstall +file + + + + +2013-08-27T23:56:15.000000Z +b5103fb3b80839550f6545fc609f45d6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8271 + +Standardpostinstall +file + + + + +2013-08-27T23:56:15.000000Z +1ccf9c82a63eb8fc532c003eefd0e15d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +8368 + diff --git a/package/Scripts/Main/.svn/prop-base/ESPpostinstall.svn-base b/package/Scripts/Main/.svn/prop-base/ESPpostinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Main/.svn/prop-base/ESPpostinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Main/.svn/prop-base/Standardpostinstall.svn-base b/package/Scripts/Main/.svn/prop-base/Standardpostinstall.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Main/.svn/prop-base/Standardpostinstall.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Main/.svn/text-base/ESPpostinstall.svn-base b/package/Scripts/Main/.svn/text-base/ESPpostinstall.svn-base new file mode 100644 index 0000000..7e05764 --- /dev/null +++ b/package/Scripts/Main/.svn/text-base/ESPpostinstall.svn-base @@ -0,0 +1,203 @@ +#!/bin/bash + +echo "===============================================" +echo "Main EFI System Partition Post-Install Script" +echo "*********************************************" +echo "-----------------------------------------------" +echo "" + +# Find location of this script in the package installer +# so we know where all the other scripts are located. + +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + + +#echo "===============================================" +#echo "Apple Installer Package Variables" +#echo "*********************************" +#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1 +#echo "DEBUG: $ 2 = Full path to the installation destination: " $2 +#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3 +#echo "DEBUG: $ 4 = Root directory for the system: " $4 +#echo "DEBUG: Script Name: " $SCRIPT_NAME +#echo "DEBUG: Package Path: " $PACKAGE_PATH +#echo "DEBUG: Installer Temp: " $INSTALLER_TEMP +#echo "DEBUG: Full path to the temp directory containing the operation executable: " $RECEIPT_PATH +#echo "-----------------------------------------------" +#echo "" + +# Initialise Script Globals + +stage0Loader="boot0" +stage0LoaderDualBoot="boot0md" +stage1LoaderHFS="boot1h" +stage1LoaderFAT="boot1f32" +stage2Loader="boot" + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolumeChosenByUser="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolumeChosenByUser="$3" +fi + +targetDeviceChosenByUser=$( df "${targetVolumeChosenByUser}" | sed -n '2p' | awk '{print $1}' ) + +targetVolume="/Volumes/EFI" +targetDevice=${targetDeviceChosenByUser%s*}s1 +targetDeviceRaw=${targetDevice/disk/rdisk} +targetDisk=${targetDevice%s*} +targetDiskRaw=${targetDisk/disk/rdisk} +targetSlice=${targetDevice#*disk*s} + +targetResources="${targetVolumeChosenByUser}/usr/local/bin/" + +efiPartitionExist=0 # target volume does not have EFI system partition. + +echo "===============================================" +echo "DEBUG: display script variables" +echo "***************************" + +echo "DEBUG: stage0Loader: Disk loader is ${stage0Loader}" +echo "DEBUG: stage0LoaderDualBoot: Disk loader is ${stage0LoaderDualBoot}" +echo "DEBUG: stage1LoaderHFS: Partition loader is ${stage1LoaderHFS}" +echo "DEBUG: stage1LoaderFat: Partition loader is ${stage1LoaderFAT}" +echo "DEBUG: stage2Loader: Filesystem loader is ${stage2Loader}" +echo "DEBUG: targetVolumeChosenByUser: Volume is ${targetVolumeChosenByUser}" +echo "DEBUG: targetDeviceChosenByUser: Volume device is ${targetDeviceChosenByUser}" +echo "DEBUG: targetVolume: Volume is ${targetVolume}" +echo "DEBUG: targetDevice: Volume device is ${targetDevice}" +echo "DEBUG: targetDeviceRaw: Volume raw device is ${targetDeviceRaw}" +echo "DEBUG: targetDisk: Disk device is ${targetDisk}" +echo "DEBUG: targetDiskRaw: Disk raw device is ${targetDiskRaw}" +echo "DEBUG: targetSlice: Volume slice is ${targetSlice}" +echo "DEBUG: targetResources: Boot Resources is ${targetResources}" +echo "-----------------------------------------------" +echo "" + + +# Write some information to the Install Log +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetVolumeChosenByUser} on ${targetDeviceChosenByUser}" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume} on ${targetDevice}" + +# Check to see if the selected disk uses a GPT + +bootuuid=$( diskutil info "$targetDeviceChosenByUser" | grep Volume\ UUID | awk {'print $3'} ) +partitiontable=$( diskutil list ${targetDeviceChosenByUser%s*} | sed -n '3p' | awk '{print $2}' ) + +if [ ${partitiontable} = "GUID_partition_scheme" ]; then + echo "Confirm this is a GPT partitioned disk." + + # Double check we can see the selected partition and it's of the right type. + # The following script returns either 0 or 1 to proceed, or 2 to indicate failure. + + + "$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDeviceChosenByUser}" "${targetVolumeChosenByUser}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} -ne 2 ]; then + # OK to proceed + + # Remember if the target volume has an EFI system partition. + if [ ${returnValue} -ne 1 ]; then + efiPartitionExist=1 + fi + + # Does a GRUB or Linux loader already exist in the disk's MBR? + # The script returns 1 if yes, 0 if no. + + "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then + # OK to proceed + + + # check for a 4-byte Windows disk signature in the disk's MBR. + # the following script returns 1 if a Windows disk signature exists, and 0 if not. + + "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}" + diskSigCheck=$? + + + # check for existing bootloaders in the disk's MBR + # and find out if we can write the Chameleon boot files. + # the following script returns 0 if we can proceed + # with writing the boot files, and 1 for not. + + "$scriptDir"CheckDiskMicrocode.sh "${targetDisk}" "${diskSigCheck}" "${targetVolumeChosenByUser}" "${scriptDir}" + diskupdate=$? + + + # check the format of the selected partition. + # result should be either hfs or msdos + # Should really check to make sure! + + targetFormat=$( fstyp "$targetDevice" ) + + + # Append a LineBreak to the installer log + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" + + if [ ${diskupdate} = "0" ]; then + + # Write the stage 0 loader to the MBR + "$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolumeChosenByUser}" "${scriptDir}" + else + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Stage 0 loader not written to ${targetDisk}." + fi + + # Write the stage 1 loader to the partition boot sector + "$scriptDir"WriteChameleonStage1.sh "${targetFormat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${targetVolumeChosenByUser}" "${targetDeviceRaw}" "${targetVolumeChosenByUser}" "${scriptDir}" + + + # Unmount ALL mounted volumes named EFI. + # Returns 0=success, 1=fail + + "$scriptDir"UnMountEFIvolumes.sh "${targetVolumeChosenByUser}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then + # OK to proceed + + # Mount the EFI system partition + "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${efiPartitionExist}" "${scriptDir}" + + # Write the stage 2 loader to the root of the selected partition + "$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${targetVolume}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" + + # Check for another existing Chameleon installation on the same disk + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + "$scriptDir"InstallLog.sh "${targetVolume}" "Preparing to check target disk for previous installations." + "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" + fi + + # Append a LineBreak to the installer log + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" + + # Set the active partition ONLY if Windows is not installed + "$scriptDir"SetActivePartition.sh "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolumeChosenByUser}" "${scriptDir}" + + fi + fi +else + #echo "ERROR Volume is not on a GPT partitioned disc." + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "ERROR Volume is not on a GPT partitioned disc." +fi + +# Create temporary file on target volume to notify Postinstall +# script, boot option code, that EFI (ESP) option was chosen +echo "EFI" >"${targetVolumeChosenByUser}"/.ChameleonEFI + +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "EFI script complete" + +echo "===============================================" +echo "END - Main EFI System Partition Post-Install Script" +echo "*********************************************" +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/Main/.svn/text-base/Standardpostinstall.svn-base b/package/Scripts/Main/.svn/text-base/Standardpostinstall.svn-base new file mode 100644 index 0000000..182e9dc --- /dev/null +++ b/package/Scripts/Main/.svn/text-base/Standardpostinstall.svn-base @@ -0,0 +1,205 @@ +#!/bin/bash + +echo "===============================================" +echo "Main Standard Post-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +# Find location of this script in the package installer +# so we know where all the other scripts are located. + +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + + +#echo "===============================================" +#echo "Apple Installer Package Variables" +#echo "*********************************" +#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1 +#echo "DEBUG: $ 2 = Full path to the installation destination: " $2 +#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3 +#echo "DEBUG: $ 4 = Root directory for the system: " $4 +#echo "DEBUG: Script Name: " $SCRIPT_NAME +#echo "DEBUG: Package Path: " $PACKAGE_PATH +#echo "DEBUG: Installer Temp: " $INSTALLER_TEMP +#echo "DEBUG: Full path to the temp directory containing the operation executable: " $RECEIPT_PATH +#echo "-----------------------------------------------" +#echo "" + + +# Initialise Script Globals + +stage0Loader="boot0" +stage0LoaderDualBoot="boot0md" +stage1LoaderHFS="boot1h" +stage1LoaderFAT="boot1f32" +stage2Loader="boot" + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolume="$3" +fi + + +targetDevice=$( df "${targetVolume}" | sed -n '2p' | awk '{print $1}' ) +targetDeviceRaw=${targetDevice/disk/rdisk} +targetDisk=${targetDevice%s*} +targetDiskRaw=${targetDisk/disk/rdisk} +targetSlice=${targetDevice#*disk*s} + +targetResources="${targetVolume}/usr/local/bin/" + +updateStage1=1 # by default update partition boot sector +efiPartitionExist=0 # target volume does not have EFI system partition. + +echo "===============================================" +echo "DEBUG: display script variables" +echo "*******************************" + +echo "DEBUG: stage0Loader: Disk loader is ${stage0Loader}" +echo "DEBUG: stage0LoaderDualBoot: Disk loader is ${stage0LoaderDualBoot}" +echo "DEBUG: stage1LoaderHFS: Partition loader is ${stage1LoaderHFS}" +echo "DEBUG: stage1LoaderFat: Partition loader is ${stage1LoaderFAT}" +echo "DEBUG: stage2Loader: Filesystem loader is ${stage2Loader}" +echo "DEBUG: targetVolume: Volume is ${targetVolume}" +echo "DEBUG: targetDevice: Volume device is ${targetDevice}" +echo "DEBUG: targetDeviceRaw: Volume raw device is ${targetDeviceRaw}" +echo "DEBUG: targetDisk: Disk device is ${targetDisk}" +echo "DEBUG: targetDiskRaw: Disk raw device is ${targetDiskRaw}" +echo "DEBUG: targetSlice: Volume slice is ${targetSlice}" +echo "DEBUG: targetResources: Boot Resources is ${targetResources}" +echo "-----------------------------------------------" +echo "" + + +# Write some information to the Install Log +"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script" +"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume} on ${targetDevice}" + +# Double check we can see the selected partition and it's of the right type. +# The following script returns either 0 or 1 to proceed, or 2 to indicate failure. + +"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDevice}" "${targetVolume}" "${scriptDir}" +returnValue=$? +if [ ${returnValue} -ne 2 ]; then + # OK to proceed + + # Remember if the target volume has an EFI system partition. + if [ ${returnValue} -ne 1 ]; then + efiPartitionExist=1 + fi + + # Does a GRUB or Linux loader already exist in the disk's MBR? + # The script returns 1 if yes, 0 if no. + "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" + diskupdate=$? + if [ ${diskupdate} -ne 0 ]; then + "$scriptDir"InstallLog.sh "${targetVolume}" "Found an existing GRUB/LILO bootloader in the MBR." + "$scriptDir"InstallLog.sh "${targetVolume}" "MBR and partition boot sector will not be modified." + updateStage1=0 + else + # check for existing bootloaders in the disk's MBR + # and find out if we can write the Chameleon boot files. + # the following script returns 0 if we can proceed + # with writing the boot files, and 1 for not. + "$scriptDir"CheckDiskMicrocode.sh "${targetDisk}" "${diskSigCheck}" "${targetVolume}" "${scriptDir}" + diskupdate=$? + fi + + + # check for a 4-byte Windows disk signature in the disk's MBR. + # the following script returns 1 if a Windows disk signature exists, and 0 if not. + "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" + diskSigCheck=$? + + + # check the format of the selected partition. + # result should be either hfs or msdos + # Should really check to make sure! + targetFormat=$( fstyp "$targetDevice" ) + + + # check the partition scheme used for the selected disk. + # the following script returns 1 if GPT + # the following script returns 2 if GPT/MBR + # the following script returns 3 if MBR + # the following script returns 0 if nothing + "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" + partitionScheme=$? + if [ ${partitionScheme} = 3 ]; then + # If MBR partition scheme then check for FAT16 or FAT32 + + # the following script returns 1 if FAT16 + # the following script returns 2 if FAT32 + # the following script returns 0 if nothing + "$scriptDir"CheckFatType.sh "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}" + fatType=$? + fi + + if [ "${fatType}" = 1 ] && [ "${partitionScheme}" = 3 ]; then + # Write error to Chameleon_Error_Log file + "$scriptDir"InstallLog.sh "${targetVolume}" "FAIL: Cannot install to a device using FAT16" + else + # Continue if the selected device is not a FAT16 format device + + # Append a line break to the installer log + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + + if [ ${diskupdate} -eq 0 ]; then + # Write the stage 0 loader to the MBR + "$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolume}" "${scriptDir}" + else + "$scriptDir"InstallLog.sh "${targetVolume}" "Stage 0 loader not written to ${targetDisk}." + fi + + if [ ${updateStage1} -eq 1 ]; then + # Write the stage 1 loader to the partition boot sector + "$scriptDir"WriteChameleonStage1.sh "${targetFormat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${3}" "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}" + else + "$scriptDir"InstallLog.sh "${targetVolume}" "Partition boot sector not written to ${targetDevice}." + fi + + # Write the stage 2 loader to the root of the selected partition + "$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}" "${scriptDir}" + + # Next we look to check for existing Chameleon installations. + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + "$scriptDir"InstallLog.sh "${targetVolume}" "Preparing to check target disk for previous installations." + if [ ${efiPartitionExist} -ne 0 ]; then # volume has an EFI system partition + "$scriptDir"InstallLog.sh "${targetVolume}" "Going to check the EFI system partition also." + # Unmount ALL mounted volumes named EFI. Returns 0=success, 1=fail + "$scriptDir"UnMountEFIvolumes.sh "${targetVolume}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then + # Mount the EFI system partition + "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolume}" "${efiPartitionExist}" "${scriptDir}" + fi + fi + # Check for another existing Chameleon installation on the same disk + "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}" + + # Append a line break to the installer log + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + + # Set the active partition ONLY if Windows is not installed + "$scriptDir"SetActivePartition.sh "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}" "${scriptDir}" + fi +fi + +"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" +"$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete" +"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + +echo "===============================================" +echo "END - Standard Post-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/Main/ESPpostinstall b/package/Scripts/Main/ESPpostinstall new file mode 100755 index 0000000..7e05764 --- /dev/null +++ b/package/Scripts/Main/ESPpostinstall @@ -0,0 +1,203 @@ +#!/bin/bash + +echo "===============================================" +echo "Main EFI System Partition Post-Install Script" +echo "*********************************************" +echo "-----------------------------------------------" +echo "" + +# Find location of this script in the package installer +# so we know where all the other scripts are located. + +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + + +#echo "===============================================" +#echo "Apple Installer Package Variables" +#echo "*********************************" +#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1 +#echo "DEBUG: $ 2 = Full path to the installation destination: " $2 +#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3 +#echo "DEBUG: $ 4 = Root directory for the system: " $4 +#echo "DEBUG: Script Name: " $SCRIPT_NAME +#echo "DEBUG: Package Path: " $PACKAGE_PATH +#echo "DEBUG: Installer Temp: " $INSTALLER_TEMP +#echo "DEBUG: Full path to the temp directory containing the operation executable: " $RECEIPT_PATH +#echo "-----------------------------------------------" +#echo "" + +# Initialise Script Globals + +stage0Loader="boot0" +stage0LoaderDualBoot="boot0md" +stage1LoaderHFS="boot1h" +stage1LoaderFAT="boot1f32" +stage2Loader="boot" + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolumeChosenByUser="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolumeChosenByUser="$3" +fi + +targetDeviceChosenByUser=$( df "${targetVolumeChosenByUser}" | sed -n '2p' | awk '{print $1}' ) + +targetVolume="/Volumes/EFI" +targetDevice=${targetDeviceChosenByUser%s*}s1 +targetDeviceRaw=${targetDevice/disk/rdisk} +targetDisk=${targetDevice%s*} +targetDiskRaw=${targetDisk/disk/rdisk} +targetSlice=${targetDevice#*disk*s} + +targetResources="${targetVolumeChosenByUser}/usr/local/bin/" + +efiPartitionExist=0 # target volume does not have EFI system partition. + +echo "===============================================" +echo "DEBUG: display script variables" +echo "***************************" + +echo "DEBUG: stage0Loader: Disk loader is ${stage0Loader}" +echo "DEBUG: stage0LoaderDualBoot: Disk loader is ${stage0LoaderDualBoot}" +echo "DEBUG: stage1LoaderHFS: Partition loader is ${stage1LoaderHFS}" +echo "DEBUG: stage1LoaderFat: Partition loader is ${stage1LoaderFAT}" +echo "DEBUG: stage2Loader: Filesystem loader is ${stage2Loader}" +echo "DEBUG: targetVolumeChosenByUser: Volume is ${targetVolumeChosenByUser}" +echo "DEBUG: targetDeviceChosenByUser: Volume device is ${targetDeviceChosenByUser}" +echo "DEBUG: targetVolume: Volume is ${targetVolume}" +echo "DEBUG: targetDevice: Volume device is ${targetDevice}" +echo "DEBUG: targetDeviceRaw: Volume raw device is ${targetDeviceRaw}" +echo "DEBUG: targetDisk: Disk device is ${targetDisk}" +echo "DEBUG: targetDiskRaw: Disk raw device is ${targetDiskRaw}" +echo "DEBUG: targetSlice: Volume slice is ${targetSlice}" +echo "DEBUG: targetResources: Boot Resources is ${targetResources}" +echo "-----------------------------------------------" +echo "" + + +# Write some information to the Install Log +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Running EFI postinstall script" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target selected by user = ${targetVolumeChosenByUser} on ${targetDeviceChosenByUser}" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Target volume = ${targetVolume} on ${targetDevice}" + +# Check to see if the selected disk uses a GPT + +bootuuid=$( diskutil info "$targetDeviceChosenByUser" | grep Volume\ UUID | awk {'print $3'} ) +partitiontable=$( diskutil list ${targetDeviceChosenByUser%s*} | sed -n '3p' | awk '{print $2}' ) + +if [ ${partitiontable} = "GUID_partition_scheme" ]; then + echo "Confirm this is a GPT partitioned disk." + + # Double check we can see the selected partition and it's of the right type. + # The following script returns either 0 or 1 to proceed, or 2 to indicate failure. + + + "$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDeviceChosenByUser}" "${targetVolumeChosenByUser}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} -ne 2 ]; then + # OK to proceed + + # Remember if the target volume has an EFI system partition. + if [ ${returnValue} -ne 1 ]; then + efiPartitionExist=1 + fi + + # Does a GRUB or Linux loader already exist in the disk's MBR? + # The script returns 1 if yes, 0 if no. + + "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then + # OK to proceed + + + # check for a 4-byte Windows disk signature in the disk's MBR. + # the following script returns 1 if a Windows disk signature exists, and 0 if not. + + "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${scriptDir}" + diskSigCheck=$? + + + # check for existing bootloaders in the disk's MBR + # and find out if we can write the Chameleon boot files. + # the following script returns 0 if we can proceed + # with writing the boot files, and 1 for not. + + "$scriptDir"CheckDiskMicrocode.sh "${targetDisk}" "${diskSigCheck}" "${targetVolumeChosenByUser}" "${scriptDir}" + diskupdate=$? + + + # check the format of the selected partition. + # result should be either hfs or msdos + # Should really check to make sure! + + targetFormat=$( fstyp "$targetDevice" ) + + + # Append a LineBreak to the installer log + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" + + if [ ${diskupdate} = "0" ]; then + + # Write the stage 0 loader to the MBR + "$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolumeChosenByUser}" "${scriptDir}" + else + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Stage 0 loader not written to ${targetDisk}." + fi + + # Write the stage 1 loader to the partition boot sector + "$scriptDir"WriteChameleonStage1.sh "${targetFormat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${targetVolumeChosenByUser}" "${targetDeviceRaw}" "${targetVolumeChosenByUser}" "${scriptDir}" + + + # Unmount ALL mounted volumes named EFI. + # Returns 0=success, 1=fail + + "$scriptDir"UnMountEFIvolumes.sh "${targetVolumeChosenByUser}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then + # OK to proceed + + # Mount the EFI system partition + "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolumeChosenByUser}" "${efiPartitionExist}" "${scriptDir}" + + # Write the stage 2 loader to the root of the selected partition + "$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${targetVolume}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" + + # Check for another existing Chameleon installation on the same disk + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + "$scriptDir"InstallLog.sh "${targetVolume}" "Preparing to check target disk for previous installations." + "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolumeChosenByUser}" "${scriptDir}" + fi + + # Append a LineBreak to the installer log + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" + + # Set the active partition ONLY if Windows is not installed + "$scriptDir"SetActivePartition.sh "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolumeChosenByUser}" "${scriptDir}" + + fi + fi +else + #echo "ERROR Volume is not on a GPT partitioned disc." + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "ERROR Volume is not on a GPT partitioned disc." +fi + +# Create temporary file on target volume to notify Postinstall +# script, boot option code, that EFI (ESP) option was chosen +echo "EFI" >"${targetVolumeChosenByUser}"/.ChameleonEFI + +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "LineBreak" +"$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "EFI script complete" + +echo "===============================================" +echo "END - Main EFI System Partition Post-Install Script" +echo "*********************************************" +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/Main/Standardpostinstall b/package/Scripts/Main/Standardpostinstall new file mode 100755 index 0000000..182e9dc --- /dev/null +++ b/package/Scripts/Main/Standardpostinstall @@ -0,0 +1,205 @@ +#!/bin/bash + +echo "===============================================" +echo "Main Standard Post-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +# Find location of this script in the package installer +# so we know where all the other scripts are located. + +MYLOCATION="${PWD}/${BASH_ARGV[0]}" +export MYLOCATION="${MYLOCATION%/*}" +scriptDir=$MYLOCATION + + +#echo "===============================================" +#echo "Apple Installer Package Variables" +#echo "*********************************" +#echo "DEBUG: $ 1 = Full path to the installation package the installer app is processing: " $1 +#echo "DEBUG: $ 2 = Full path to the installation destination: " $2 +#echo "DEBUG: $ 3 = Installation volume (mountpoint) to receive the payload: " $3 +#echo "DEBUG: $ 4 = Root directory for the system: " $4 +#echo "DEBUG: Script Name: " $SCRIPT_NAME +#echo "DEBUG: Package Path: " $PACKAGE_PATH +#echo "DEBUG: Installer Temp: " $INSTALLER_TEMP +#echo "DEBUG: Full path to the temp directory containing the operation executable: " $RECEIPT_PATH +#echo "-----------------------------------------------" +#echo "" + + +# Initialise Script Globals + +stage0Loader="boot0" +stage0LoaderDualBoot="boot0md" +stage1LoaderHFS="boot1h" +stage1LoaderFAT="boot1f32" +stage2Loader="boot" + +# If target volume root of current system then replace +# / with volume name. +if [ "$3" == "/" ] +then + targetVolume="/Volumes/"$( ls -1F /Volumes | sed -n 's:@$::p' ) +else + targetVolume="$3" +fi + + +targetDevice=$( df "${targetVolume}" | sed -n '2p' | awk '{print $1}' ) +targetDeviceRaw=${targetDevice/disk/rdisk} +targetDisk=${targetDevice%s*} +targetDiskRaw=${targetDisk/disk/rdisk} +targetSlice=${targetDevice#*disk*s} + +targetResources="${targetVolume}/usr/local/bin/" + +updateStage1=1 # by default update partition boot sector +efiPartitionExist=0 # target volume does not have EFI system partition. + +echo "===============================================" +echo "DEBUG: display script variables" +echo "*******************************" + +echo "DEBUG: stage0Loader: Disk loader is ${stage0Loader}" +echo "DEBUG: stage0LoaderDualBoot: Disk loader is ${stage0LoaderDualBoot}" +echo "DEBUG: stage1LoaderHFS: Partition loader is ${stage1LoaderHFS}" +echo "DEBUG: stage1LoaderFat: Partition loader is ${stage1LoaderFAT}" +echo "DEBUG: stage2Loader: Filesystem loader is ${stage2Loader}" +echo "DEBUG: targetVolume: Volume is ${targetVolume}" +echo "DEBUG: targetDevice: Volume device is ${targetDevice}" +echo "DEBUG: targetDeviceRaw: Volume raw device is ${targetDeviceRaw}" +echo "DEBUG: targetDisk: Disk device is ${targetDisk}" +echo "DEBUG: targetDiskRaw: Disk raw device is ${targetDiskRaw}" +echo "DEBUG: targetSlice: Volume slice is ${targetSlice}" +echo "DEBUG: targetResources: Boot Resources is ${targetResources}" +echo "-----------------------------------------------" +echo "" + + +# Write some information to the Install Log +"$scriptDir"InstallLog.sh "${targetVolume}" "Running Standard postinstall script" +"$scriptDir"InstallLog.sh "${targetVolume}" "Target volume = ${targetVolume} on ${targetDevice}" + +# Double check we can see the selected partition and it's of the right type. +# The following script returns either 0 or 1 to proceed, or 2 to indicate failure. + +"$scriptDir"CheckProceed.sh "${targetVolume}" "${targetDevice}" "${targetVolume}" "${scriptDir}" +returnValue=$? +if [ ${returnValue} -ne 2 ]; then + # OK to proceed + + # Remember if the target volume has an EFI system partition. + if [ ${returnValue} -ne 1 ]; then + efiPartitionExist=1 + fi + + # Does a GRUB or Linux loader already exist in the disk's MBR? + # The script returns 1 if yes, 0 if no. + "$scriptDir"CheckGRUBLinuxLoader.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" + diskupdate=$? + if [ ${diskupdate} -ne 0 ]; then + "$scriptDir"InstallLog.sh "${targetVolume}" "Found an existing GRUB/LILO bootloader in the MBR." + "$scriptDir"InstallLog.sh "${targetVolume}" "MBR and partition boot sector will not be modified." + updateStage1=0 + else + # check for existing bootloaders in the disk's MBR + # and find out if we can write the Chameleon boot files. + # the following script returns 0 if we can proceed + # with writing the boot files, and 1 for not. + "$scriptDir"CheckDiskMicrocode.sh "${targetDisk}" "${diskSigCheck}" "${targetVolume}" "${scriptDir}" + diskupdate=$? + fi + + + # check for a 4-byte Windows disk signature in the disk's MBR. + # the following script returns 1 if a Windows disk signature exists, and 0 if not. + "$scriptDir"CheckWindowsDiskSignature.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" + diskSigCheck=$? + + + # check the format of the selected partition. + # result should be either hfs or msdos + # Should really check to make sure! + targetFormat=$( fstyp "$targetDevice" ) + + + # check the partition scheme used for the selected disk. + # the following script returns 1 if GPT + # the following script returns 2 if GPT/MBR + # the following script returns 3 if MBR + # the following script returns 0 if nothing + "$scriptDir"CheckPartitionScheme.sh "${targetDisk}" "${targetVolume}" "${scriptDir}" + partitionScheme=$? + if [ ${partitionScheme} = 3 ]; then + # If MBR partition scheme then check for FAT16 or FAT32 + + # the following script returns 1 if FAT16 + # the following script returns 2 if FAT32 + # the following script returns 0 if nothing + "$scriptDir"CheckFatType.sh "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}" + fatType=$? + fi + + if [ "${fatType}" = 1 ] && [ "${partitionScheme}" = 3 ]; then + # Write error to Chameleon_Error_Log file + "$scriptDir"InstallLog.sh "${targetVolume}" "FAIL: Cannot install to a device using FAT16" + else + # Continue if the selected device is not a FAT16 format device + + # Append a line break to the installer log + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + + if [ ${diskupdate} -eq 0 ]; then + # Write the stage 0 loader to the MBR + "$scriptDir"WriteChameleonStage0.sh "${diskSigCheck}" "${stage0Loader}" "${stage0LoaderDualBoot}" "${targetDisk}" "${targetResources}" "${targetVolume}" "${scriptDir}" + else + "$scriptDir"InstallLog.sh "${targetVolume}" "Stage 0 loader not written to ${targetDisk}." + fi + + if [ ${updateStage1} -eq 1 ]; then + # Write the stage 1 loader to the partition boot sector + "$scriptDir"WriteChameleonStage1.sh "${targetFormat}" "${stage1LoaderHFS}" "${stage1LoaderFAT}" "${3}" "${targetDeviceRaw}" "${targetVolume}" "${scriptDir}" + else + "$scriptDir"InstallLog.sh "${targetVolume}" "Partition boot sector not written to ${targetDevice}." + fi + + # Write the stage 2 loader to the root of the selected partition + "$scriptDir"WriteChameleonStage2.sh "${stage2Loader}" "${3}" "${targetDevice}" "${targetVolume}" "${scriptDir}" + + # Next we look to check for existing Chameleon installations. + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + "$scriptDir"InstallLog.sh "${targetVolume}" "Preparing to check target disk for previous installations." + if [ ${efiPartitionExist} -ne 0 ]; then # volume has an EFI system partition + "$scriptDir"InstallLog.sh "${targetVolume}" "Going to check the EFI system partition also." + # Unmount ALL mounted volumes named EFI. Returns 0=success, 1=fail + "$scriptDir"UnMountEFIvolumes.sh "${targetVolume}" "${scriptDir}" + returnValue=$? + if [ ${returnValue} = 0 ]; then + # Mount the EFI system partition + "$scriptDir"MountESP.sh "${targetDisk}" "${targetVolume}" "${efiPartitionExist}" "${scriptDir}" + fi + fi + # Check for another existing Chameleon installation on the same disk + "$scriptDir"CheckPreviousChameleon.sh "${targetDisk}" "${targetDeviceRaw}" "${targetDevice}" "${targetVolume}" "${scriptDir}" + + # Append a line break to the installer log + "$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + + # Set the active partition ONLY if Windows is not installed + "$scriptDir"SetActivePartition.sh "${diskSigCheck}" "${targetDiskRaw}" "${targetSlice}" "${targetVolume}" "${scriptDir}" + fi +fi + +"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" +"$scriptDir"InstallLog.sh "${targetVolume}" "Standard script complete" +"$scriptDir"InstallLog.sh "${targetVolume}" "LineBreak" + +echo "===============================================" +echo "END - Standard Post-Install Script" +echo "*********************************" +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/Sub/.svn/all-wcprops b/package/Scripts/Sub/.svn/all-wcprops new file mode 100644 index 0000000..e197e3b --- /dev/null +++ b/package/Scripts/Sub/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub +END +CheckPreviousChameleon.sh +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckPreviousChameleon.sh +END +patch +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/patch +END +CheckFatType.sh +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckFatType.sh +END +MountESP.sh +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/MountESP.sh +END +WriteChameleonStage0.sh +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/WriteChameleonStage0.sh +END +WriteChameleonStage1.sh +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/WriteChameleonStage1.sh +END +CheckPartitionScheme.sh +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckPartitionScheme.sh +END +WriteChameleonStage2.sh +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/WriteChameleonStage2.sh +END +CheckDiskMicrocode.sh +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckDiskMicrocode.sh +END +CheckProceed.sh +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckProceed.sh +END +SetActivePartition.sh +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/SetActivePartition.sh +END +CheckGRUBLinuxLoader.sh +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckGRUBLinuxLoader.sh +END +UnMountEFIvolumes.sh +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/UnMountEFIvolumes.sh +END +CheckWindowsDiskSignature.sh +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/Scripts/Sub/CheckWindowsDiskSignature.sh +END diff --git a/package/Scripts/Sub/.svn/entries b/package/Scripts/Sub/.svn/entries new file mode 100644 index 0000000..8a36d4d --- /dev/null +++ b/package/Scripts/Sub/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/Scripts/Sub +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +CheckPreviousChameleon.sh +file + + + + +2013-08-27T23:56:15.000000Z +129e1f0bc0320330d08d4b3e09537705 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7945 + +patch +file + + + + +2013-08-27T23:56:15.000000Z +93b885adfe0da089cdf634904fd59f71 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1 + +CheckFatType.sh +file + + + + +2013-08-27T23:56:15.000000Z +1c69f174047fc5edaa3e0f22bfb6c791 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +3181 + +MountESP.sh +file + + + + +2013-08-27T23:56:15.000000Z +ca183ecc9c4d1544f1a5bf8356529620 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1752 + +WriteChameleonStage0.sh +file + + + + +2013-08-27T23:56:15.000000Z +80e04d1465708ccd47432a18b76c2937 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2096 + +WriteChameleonStage1.sh +file + + + + +2013-08-27T23:56:15.000000Z +d0bf0355fa6fb5c42ce73748a44dbd38 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2435 + +CheckPartitionScheme.sh +file + + + + +2013-08-27T23:56:15.000000Z +5480a44679398db3120f49ad452715a6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2349 + +WriteChameleonStage2.sh +file + + + + +2013-08-27T23:56:15.000000Z +db305d79858d0d4f6fd2e71ca3619bb9 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1988 + +CheckDiskMicrocode.sh +file + + + + +2013-08-27T23:56:15.000000Z +f484a4b036d02e8731470cba60f64b72 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +5227 + +CheckProceed.sh +file + + + + +2013-08-27T23:56:15.000000Z +3765c4e8f021d11c9b040ed9c5eabd9f +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2468 + +SetActivePartition.sh +file + + + + +2013-08-27T23:56:15.000000Z +b0f3e1dab2ee6853e9b655054ada7bab +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +2200 + +CheckGRUBLinuxLoader.sh +file + + + + +2013-08-27T23:56:15.000000Z +f469e3d7ba61509785b9e308a578d16e +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1634 + +UnMountEFIvolumes.sh +file + + + + +2013-08-27T23:56:15.000000Z +d080b99c41799a54007294e71c38106d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1204 + +CheckWindowsDiskSignature.sh +file + + + + +2013-08-27T23:56:15.000000Z +2db75399fbf9850d9554bcae40d72064 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +1255 + diff --git a/package/Scripts/Sub/.svn/prop-base/CheckDiskMicrocode.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckDiskMicrocode.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckDiskMicrocode.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/CheckFatType.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckFatType.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckFatType.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/CheckGRUBLinuxLoader.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckGRUBLinuxLoader.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckGRUBLinuxLoader.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/CheckPartitionScheme.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckPartitionScheme.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckPartitionScheme.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/CheckPreviousChameleon.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckPreviousChameleon.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckPreviousChameleon.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/CheckProceed.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckProceed.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckProceed.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/CheckWindowsDiskSignature.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/CheckWindowsDiskSignature.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/CheckWindowsDiskSignature.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/MountESP.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/MountESP.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/MountESP.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/SetActivePartition.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/SetActivePartition.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/SetActivePartition.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/UnMountEFIvolumes.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/UnMountEFIvolumes.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/UnMountEFIvolumes.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage0.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage0.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage0.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage1.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage1.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage1.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage2.sh.svn-base b/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage2.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/WriteChameleonStage2.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/Scripts/Sub/.svn/prop-base/patch.svn-base b/package/Scripts/Sub/.svn/prop-base/patch.svn-base new file mode 100644 index 0000000..5e9587e --- /dev/null +++ b/package/Scripts/Sub/.svn/prop-base/patch.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mime-type +V 24 +application/octet-stream +END diff --git a/package/Scripts/Sub/.svn/text-base/CheckDiskMicrocode.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckDiskMicrocode.sh.svn-base new file mode 100644 index 0000000..cb27bcb --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckDiskMicrocode.sh.svn-base @@ -0,0 +1,116 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckDiskMicrocode: Any existing bootloaders?" +echo "*********************************************" + +# Reads the GPTdiskProtectiveMBR and searches for an existing +# Windows bootloader and also for an existing Chameleon stage 0 loader +# which might be better changed depending on whether or not a Windows +# signature is found or not. +# The script then exits with the value 0 to indicate that Chameleon stage0 +# loader can be written, or 1 to indicate not to write the stage0 loader. + +# Receives targetDisk: for example, /dev/disk2. +# Receives diskSigCheck: 0 = Windows not installed / 1 = Windows installed. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 4 ]; then + targetDisk="$1" + diskSigCheck="$2" + targetVolume="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for diskSigCheck = $diskSigCheck" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed - Exiting" + exit 9 +fi + + +# read the first 437 bytes of the MBR + +mbr437=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +#mbr437md5=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | md5 ) + +if [ $( echo "${mbr437}" | awk -F0 '{print NF-1}' ) != 874 ]; then + # There is already something on the MBR + + # See if a Windows bootloader already exists + # Check bytes 440-443 of the GPTdiskProtectiveMBR for a Windows Disk Signature + windowsloader=$( dd 2>/dev/null if="$targetDisk" count=4 bs=1 | xxd | awk '{print $2$3}' ) + if [ "${windowsloader}" == "33c08ed0" ] ; then + #echo "DEBUG: Found existing Windows Boot Loader so will replace with Chameleon boot0md" + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk has existing Windows boot loader - Will replace with boot0md (boot0workV2)." + fi + + # See if a Chameleon stage0 boot file already exists + + # Note: The checks for Boot0, Boot0hfs, Boot0md and Boot0md (dmazar's Boot0workV2) assume the code stays the same. + # if the code changes then the hex values 0b807c, 0a803c, ee7505 and 742b80 used for matching + # need to be checked to see if they are the same or not. + + stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' ) + if [ "${stage0type}" == "0b807c" ]; then + #echo "DEBUG: Target has existing Chameleon stage 0 loader - Boot0hfs" + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0hfs" + + # Script CheckDiskSignature.sh returned 0 if a Windows installation was NOT found + if [ "$diskSigCheck" == "0" ]; then + #echo "DEBUG: Found no existing Windows installation so will replace stage 0 loader with Boot0" + "$scriptDir"InstallLog.sh "${targetVolume}" "Will replace boot0hfs with boot0 as Windows is not on target disk." + exit 0 + fi + exit 1 + fi + + if [ "${stage0type}" == "0a803c" ]; then + #echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0" + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0" + + # Script CheckDiskSignature.sh returned 1 if a Windows installation was found + if [ "$diskSigCheck" = "1" ]; then + #echo "DEBUG: Found existing Windows installation so will replace stage 0 loader with boot0md" + "$scriptDir"InstallLog.sh "${targetVolume}" "Will replace boot0 with boot0md (boot0workV2) as Windows is on target disk." + exit 0 + fi + exit 1 + fi + + if [ "${stage0type}" == "ee7505" ]; then + #echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0md" + #echo "DEBUG: And will leave boot0md installed." + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0md (v1)." + exit 1 + fi + + if [ "${stage0type}" == "742b80" ]; then + #echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0workV2" + #echo "DEBUG: And will leave Boot0workV2 installed." + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0md (boot0workV2)." + exit 1 + fi + + if [ "${stage0type}" != "0b807c" ] && [ "${stage0type}" != "0a803c" ] && [ "${stage0type}" != "ee7505" ] && [ "${stage0type}" != "742b80" ] && [ "${windowsloader}" != "33c08ed0" ] ; then + #echo "DEBUG: Something other than Chameleon or a Windows bootloader was found" + test=$(echo "${mbr437}" | awk -F0 '{print NF-1}' ) + #echo "DEBUG: Disk microcode found: ${test} - Preserving." + #echo "DEBUG: diskupdate is set to false" + #echo "DEBUG: -----------------------------------------------" + "$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Target has existing unrecognised bootcode in the MBR. Leaving as is." + exit 1 + fi +#else + #echo "DEBUG: The first 437 bytes of the MBR Disk Sector is blank - Updating" + #"$scriptDir"InstallLog.sh "${targetVolume}" "Target has no bootcode in the MBR disk sector." +fi + +echo "diskupdate is now set to true." +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/Sub/.svn/text-base/CheckFatType.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckFatType.sh.svn-base new file mode 100644 index 0000000..05737fc --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckFatType.sh.svn-base @@ -0,0 +1,65 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckFatType: Do we have FAT16 or FAT32?" +echo "****************************************" + +# Looks for the following in the partition boot sector +# Byte number 19 to see if it's either 00 or 02 +# Byte number 22 to see if it's either F8 or F0 +# Byte number 25 to see if it's either 3F or 20 +# +# Exit with value 1 for FAT16, 2 for FAT32 +# Exit with value 0 if nothing is found - this shouldn't happen.? + +# Receives targetDeviceRaw: for example, /dev/rdisk0s2. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then + targetDeviceRaw="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument = $targetDeviceRaw" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +partitionBootSector=$( dd 2>/dev/null if="$targetDeviceRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then + #echo "DEBUG: Found a FAT32 device formatted by Windows Explorer" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by Windows Explorer" + exit 2 +fi +if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then + #echo "DEBUG: Found a FAT16 device formatted by Windows Explorer" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by Windows Explorer" + exit 1 +fi +if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT32 device formatted by OS X Snow Leopard Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Snow Leopard Disk Utility" + exit 2 +fi +if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT16 device formatted by OS X Snow Leopard Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Snow Leopard Disk Utility" + exit 1 +fi +if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT32 device formatted by OS X Lion Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Lion Disk Utility" + exit 2 +fi +if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT16 device formatted by OS X Lion Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Lion Disk Utility" + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/CheckGRUBLinuxLoader.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckGRUBLinuxLoader.sh.svn-base new file mode 100644 index 0000000..aeeff26 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckGRUBLinuxLoader.sh.svn-base @@ -0,0 +1,45 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckGRUBLinuxLoader: Does GRUB or LILO exist?" +echo "**********************************************" + +# This reads the MBR of the disk in the attempt to find the +# signature for either the GRUB or Linux bootloaders. +# The script returns 1 if either is found, or 0 if none found. + +# Receives targetdisk: for example, /dev/disk2. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 3 ]; then + targetDisk="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +diskmicrocodetype[1]="GRUB,47525542" +diskmicrocodetype[2]="LILO,4c494c4f" + +diskmicrocode=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +#echo "DEBUG: ${diskmicrocode}" +diskmicrocodetypecounter=0 + +while [ ${diskmicrocodetypecounter} -lt ${#diskmicrocodetype[@]} ]; do + diskmicrocodetypecounter=$(( ${diskmicrocodetypecounter} + 1 )) + diskmicrocodetypeid=${diskmicrocodetype[${diskmicrocodetypecounter}]#*,} + if [ ! "${diskmicrocode}" = "${diskmicrocode/${diskmicrocodetypeid}/}" ]; then + echo "${diskmicrocodetype[${diskmicrocodetypecounter}]%,*} found." + exit 1 + #else + #echo "DEBUG: Didn't find a match for ${diskmicrocodetype[${diskmicrocodetypecounter}]%,*}" + fi +done + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/CheckPartitionScheme.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckPartitionScheme.sh.svn-base new file mode 100644 index 0000000..4bae281 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckPartitionScheme.sh.svn-base @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "===============================================" +echo "Check the Partition Scheme: GPT, GPT/MBR or MBR?" +echo "************************************************" + +# Looks for the first 8 bytes of the GPTdiskGPTHeader to identify a GUID partition table. +# Byte number 450 of the GPTdiskProtectiveMBR to identify ID of 'EE' to identify a GPT partition. +# Byte numbers 466, 482 & 498 of the GPTdiskProtectiveMBR to identify further partitions. +# +# Exit with value 1 for GPT, 2 for GPT/MBR and 3 for MBR. +# Exit with value 0 if nothing is found - this shouldn't happen.? + +# Receives targetDisk: for example, /dev/disk0s2 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then + targetDisk="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +partitiontable=$( dd 2>/dev/null if="$targetDisk" count=1 skip=1 | dd 2>/dev/null count=8 bs=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +if [ "${partitiontable:0:16}" == "4546492050415254" ]; then + partitiontable=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=64 bs=1 skip=446 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) + + if [ "${partitiontable:8:2}" == "ee" ]; then + #echo "DEBUG: Found System ID 'EE' to identify GPT Partition" + + if [ "${partitiontable:40:2}" == "00" ] && [ "${partitiontable:72:2}" == "00" ] && [ "${partitiontable:104:2}" == "00" ]; then + #echo "DEBUG: Found System ID '00' for each remaining possible partition" + partitiontable="GPT" + #echo "DEBUG: ${partitiontable} found." + #"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT." + exit 1 + else + partitiontable="GPT/MBR" + #echo "DEBUG: ${partitiontable} found." + #"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT/MBR." + exit 2 + fi + fi +else + partitiontable="MBR" + #echo "DEBUG: ${partitiontable} found." + #"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using MBR." + exit 3 +fi + +#echo "DEBUG: No partition table found." +"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: No partition table found." + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/CheckPreviousChameleon.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckPreviousChameleon.sh.svn-base new file mode 100644 index 0000000..ca6aa88 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckPreviousChameleon.sh.svn-base @@ -0,0 +1,187 @@ +#!/bin/bash + +echo "===============================================" +echo "Check Previous Chameleon: Will there be problems?" +echo "***********************************************" + +# Checks for another existing Chameleon installation on the same disk +# and tries to make sure the user doesn't end up with an un-bootable +# system due to having installed Chameleon previously elsewhere. + +# Called from the Standard/postinstall and EFI/postinstall scripts +# /Volumes/EFI should already be mounted before this is called. + +# Receives targetDisk: for example, /dev/disk3. +# Receives targetDeviceRaw: for example, /dev/rdisk3s1. +# Receives targetDevice: Stores device number, for example /dev/disk2s1. +# Receives installerVolume: Volume to write the installer log to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 5 ]; then + targetDisk="$1" + targetDeviceRaw="$2" + targetDevice="$3" + installerVolume="$4" + scriptDir="$5" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetDeviceRaw = $targetDeviceRaw" + echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for installerVolume = $installerVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +# =============================================== +# Prepare some vars +# =============================================== +sliceNumber=$( echo ${targetDeviceRaw#*disk*s} ) + +# strip slice from end +targetDiskRawNoSlice=$( echo ${targetDeviceRaw%$sliceNumber} ) + +# Are there any other partitions on the disk? +# How many actual partitions are there? +numSlices=$(( $( diskutil list | grep $( echo ${targetDisk#/dev/} ) | sed -n '$=' ) -2 )) + + +# =============================================== +# Checking the disk for existing Chameleon installations +# if there is more than one partition on the disk. +# =============================================== +if [ $numSlices -gt 1 ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Checking ${targetDisk#/dev/}." + + # Check the disk's MBR for existing stage 0 boot code (code from CheckDiskMicrocode.sh script) + stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' ) + if [ "${stage0type}" == "0a803c" ] || [ "${stage0type}" == "ee7505" ] || [ "${stage0type}" == "742b80" ]; then + stage0type=2 + elif [ "${stage0type}" == "0b807c" ]; then + stage0type=1 + fi + + #Scan all partitions for Chameleon code + cleanRun=1 + for (( i=1; i <= $numSlices; i++ )); + do + if [ $stage0type == 1 ] || [ $stage0type == 2 ]; then + stagesFound=1 + else + stagesFound=0 + fi + stage1Existence="NONE" + stage2Existence=0 + targetDiskRaw=$targetDiskRawNoSlice$i + + # Check for existence of a bootable partition boot sector containing either boot1h or boot1f32 + boot1Search=$( dd 2>/dev/null if="$targetDiskRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) + if [ "${boot1Search:0:16}" == "fa31c08ed0bcf0ff" ] && [ "${boot1Search:1020:2}" == "55" ]; then + (( stagesFound++ )) + stage1Existence="boot1h" + elif [ "${boot1Search:0:4}" == "e962" ] && [ "${boot1Search:180:12}" == "424f4f542020" ] && [ "${boot1Search:1020:2}" == "55" ]; then + (( stagesFound++ )) + stage1Existence="boot1f32" + fi + + # Check for existing stage 2 boot file. + # Include checking the EFI system partition if it exists and is mounted. + if [ -e "$( df | grep ${targetDisk}s${i} | awk '{ print $6 }' )"/boot ]; then + (( stagesFound++ )) + stage2Existence=1 + fi + + if [ $stagesFound -ge 2 ] && [ "$stage1Existence" != "NONE" ] && [ $i -ne $sliceNumber ]; then + # There is previous Chameleon stage 1 code on a partition boot sector, + # and either a complete or incomplete installation (ie. boot0 or boot are missing). + + if [ $stagesFound == 3 ] && [ $i -lt $sliceNumber ]; then + # Exisitng installation found which will still be default. + message="************************** TAKE NOTE ***************************** +**** There is an existing Chameleon installation on $targetDiskRaw +**** and that installation will still be the default loader as it's +**** on an earlier partition. If you want this new installation on +**** $installerVolume to be default then you will need to remove the +**** boot file from $targetDiskRaw and re-run this installer. +**************************************************************" + "$scriptDir"InstallLog.sh "${installerVolume}" "${message}" + fi + if [ $stagesFound == 3 ] && [ $i -gt $sliceNumber ]; then + # Existing installation found which will no longer be default. + message="NOTE: There is an existing Chameleon installation on $targetDiskRaw +NOTE: but this installation on $targetDevice will be the default loader +NOTE: because you're installing to an earlier partition on the disk." + "$scriptDir"InstallLog.sh "${installerVolume}" "${message}" + fi + + + # User could see a b1f:error or boot0:error if the following conditions are true: + # A) Boot0hfs, Boot0md or Boot0md (dmazar's Boot0workV2) is being used. + # B) The previous stage 1 code is on a lower partiton than the one being installed to now. + # C) boot is missing from that partition. + + if [ $stagesFound == 2 ] && [ $stage2Existence == 0 ]; then + # Exisitng boot0 and boot1 only found - missing boot + "$scriptDir"InstallLog.sh "${installerVolume}" "INFO: Found $stage1Existence installed to ${targetDisk}s${i}" + + # stage0type=2 is used to know if 'A' is true. + if [ $stage0type == 2 ]; then + # i = current slice we're checking, slicenumber = slice trying to install to. + if [ $i -lt $sliceNumber ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "WARN: Conditions point to the possibility of a boot failure" + + # Fix by making previous parition bootsector un-bootable + message="--- +FIX: Make ${targetDisk}s${i} boot sector un-bootable by changing byte 1FEh to 00. +NOTE: Any Extra folder you had there will still be there. If you want to use +NOTE: ${targetDisk}s${i} again as your boot partition then re-run this installer +NOTE: selecting it as the target, ONLY choosing the 'Chameleon Bootloader' option +NOTE: and NONE of the other options. +---" + "$scriptDir"InstallLog.sh "${installerVolume}" "${message}" + + # /Volumes/EFI needs unmounting before changing partition boot sector + if [ $i == 1 ]; then + umount /Volumes/EFI + else + diskutil unmount "${targetDisk}"s${i} + fi + + # Change Byte 01FExh to 00 (510 decimal) + # Same code can be used for HFS or FAT32 + dd if=${targetDisk}s${i} count=1 bs=512 of=/tmp/originalBootSector + cp /tmp/originalBootSector /tmp/newBootSector + dd if="$scriptDir/patch" of=/tmp/newBootSector bs=1 count=1 seek=510 conv=notrunc + dd if=/tmp/newBootSector of=${targetDisk}s${i} count=1 bs=512 + + # /Volumes/EFI needs re-mounting so EFI/postinstall script can use it. + # Don't check for a GPT as wouldn't have got here if it wasn't + if [ $i == 1 ]; then + "$scriptDir"MountESP.sh "${targetDisk}" "${installerVolume}" "${scriptDir}" + else + diskutil mount "${targetDisk}"s${i} + fi + + else + "$scriptDir"InstallLog.sh "${installerVolume}" "INFO: but won't interfere as you're installing to an earlier partition." + fi + elif [ $stage0type == 1 ]; then + # boot0 was found which looks for boot1 on the first active partition. + "$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: so select to boot that partition (if used) with active flag." + #else + #echo "DEBUG: Boot0 not found" + fi + fi + else + (( cleanRun++ )) + fi + done + if [[ $cleanRun == $i ]]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing found that could cause any problems." + fi +else + "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing to check as there's only one partition." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/CheckProceed.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckProceed.sh.svn-base new file mode 100644 index 0000000..902db56 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckProceed.sh.svn-base @@ -0,0 +1,65 @@ +#!/bin/bash + +echo "===============================================" +echo "Check Proceed: Can the installation continue?" +echo "***********************************************" + +# Checks the selected volume is present and the disk is partitioned +# Now also check for another existing Chameleon installation on the same disk. +# Exit with 0 to indicate okay to proceed, no problems. +# Exit with 1 to indicate okay to proceed, but target disk doesn't have EFI system partition. +# Exit with 2 to indicate not to proceed. + +# Receives targetVolume: Volume to install to (will be '/Volumes/EFI' if EFI install) +# Receives targetDevice: Stores device number, for example /dev/disk2s1. +# Receives installerVolume: Volume to write the installer log to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 4 ]; then + targetVolume="$1" + targetDevice="$2" + installerVolume="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for installerVolume = $installerVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# Does target volume exist? +if [ -z "$targetVolume" ]; then + echo "*** Cannot find the volume. Exiting." + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Cannot file the volume: $targetVolume." + exit 2 +fi + +# Does target volume use slices? +if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then + echo "*** ERROR Volume does not use slices. Exiting." + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $targetVolume doesn't use slices." + exit 2 +fi + +# Check to find if an EFI system partition exists on the disk. +# This is used in two cases: +# A) When checking for existing Chameleon installations. +# B) When the user chooses the EFI system partition install option, +# and installing to a 'small' HFS device like a 1GB USB flash +# drive which won't have an EFI System Partition. + +# Take target device and check if slice 1 is not named "EFI" +stripped=$( echo ${targetDevice#/dev/} ) +if [ ! $(echo ${stripped#*disk*s}) = 1 ]; then + stripped=$( echo ${stripped%s*})"s1" +fi +if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then + if [ "$targetVolume" = "/Volumes/EFI" ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Selected disk does not have an EFI System Partition." + fi + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/CheckWindowsDiskSignature.sh.svn-base b/package/Scripts/Sub/.svn/text-base/CheckWindowsDiskSignature.sh.svn-base new file mode 100644 index 0000000..14a1fd5 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/CheckWindowsDiskSignature.sh.svn-base @@ -0,0 +1,39 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckWindowsDiskSignature: Is Windows installed?" +echo "************************************************" + +# Checks the disk sector for a 4-byte Windows disk signature +# if one is found then it exits with 1, otherwise it exits with 0 + +# Receives targetdisk: for example, /dev/disk0 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 3 ]; then + targetDisk="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed - Exiting" + exit 9 +fi + +disksignature=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=4 bs=1 skip=440 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) + +#echo "DEBUG: ${disksignature}" + +if [ "${disksignature}" = "00000000" ]; then + #echo "DEBUG: No Windows installation detected." + exit 0 +else + #echo "DEBUG: Detected an existing Windows installation" + "$scriptDir"InstallLog.sh "${targetVolume}" "Detected a Windows installation on this volume." + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/MountESP.sh.svn-base b/package/Scripts/Sub/.svn/text-base/MountESP.sh.svn-base new file mode 100644 index 0000000..aea6db1 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/MountESP.sh.svn-base @@ -0,0 +1,51 @@ +#!/bin/bash + +echo "===============================================" +echo "MountESP: Mount the EFI system partition" +echo "***********************************************" + +# Creates a mountpoint and mounts /Volumes/EFI of the +# supplied disk which would have been pre-checked as using a GPT + +# Receives targetDisk: for example /dev/disk2. +# Receives installerVolume: Volume to write the installer log to. +# Receives efiPartitionExist: either 0 or 1 +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 4 ]; then + targetDisk="$1" + installerVolume="$2" + efiPartitionExist="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for installerVolume = $installerVolume" + echo "DEBUG: passed argument for efiPartitionExist = $efiPartitionExist" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# Check the first partition is actually type 'EFI' +# as we could be checking a USB flash drive <4GB +if [ ${efiPartitionExist} = 1 ]; then + + # Does the mountpoint exist? + if [ ! -e "/Volumes/EFI" ]; then + mkdir -p "/Volumes/EFI" + fi + + # Mount '/Volumes/EFI' using the correct format type + if [ "$( fstyp "${targetDisk}"s1 | grep hfs )" ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI." + mount_hfs "${targetDisk}"s1 "/Volumes/EFI" + fi + if [ "$( fstyp "${targetDisk}"s1 | grep msdos )" ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI." + mount_msdos -u 0 -g 0 "${targetDisk}"s1 "/Volumes/EFI" + fi +else + "$scriptDir"InstallLog.sh "${installerVolume}" "Target volume doesn't have an EFI system partition." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/SetActivePartition.sh.svn-base b/package/Scripts/Sub/.svn/text-base/SetActivePartition.sh.svn-base new file mode 100644 index 0000000..15f7a2f --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/SetActivePartition.sh.svn-base @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "===============================================" +echo "Set Active Partition ONLY if Windows is not installed" +echo "*****************************************************" + +# Sets partition active if Windows is not installed. + +# Receives diskSigCheck: code is 1 for a Windows install, 0 for no Windows install +# Receives targetDiskRaw: for example, /dev/rdisk1 +# Receives targetSlice: for example, 1 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 5 ]; then + diskSigCheck="$1" + targetDiskRaw="$2" + targetSlice="$3" + targetVolume="$4" + scriptDir="$5" + + echo "DEBUG: passed argument for diskSigCheck = $diskSigCheck" + echo "DEBUG: passed argument for targetDiskRaw = $targetDiskRaw" + echo "DEBUG: passed argument for targetSlice = $targetSlice" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# Append fdisk output to the installer log +"$scriptDir"InstallLog.sh "${targetVolume}" "fdisk ${targetDiskRaw}" + +if [ ${diskSigCheck} == "0" ]; then + #Windows is not installed so let's change the active partition" + + partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}') + if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it." + else + "$scriptDir"InstallLog.sh "${targetVolume}" "Setting ${targetVolume} partition active." + # BadAxe requires EFI partition to be flagged active. + # but it doesn't' hurt to do it for any non-windows partition. + + fdisk -e ${targetDiskRaw} <<-MAKEACTIVE + print + flag ${targetSlice} + write + y + quit + MAKEACTIVE + fi +else + # TO DO + # Add check to make sure that the active partition is actually the Windows partition + # before printing next statement. + #echo "DEBUG: Windows is installed so we let that remain the active partition" + "$scriptDir"InstallLog.sh "${targetVolume}" "Windows is installed so that can remain the active partition" +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/UnMountEFIvolumes.sh.svn-base b/package/Scripts/Sub/.svn/text-base/UnMountEFIvolumes.sh.svn-base new file mode 100644 index 0000000..db10f64 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/UnMountEFIvolumes.sh.svn-base @@ -0,0 +1,35 @@ +#!/bin/bash + +echo "===============================================" +echo "Unmount all volumes named EFI" + +# loop through and un-mount ALL mounted 'EFI' system partitions - Thanks kizwan + +# Receives targetVolumeChosenByUser: To write install log to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 2 ]; then + targetVolumeChosenByUser="$1" + scriptDir="$2" + # echo "DEBUG: passed argument for targetVolumeChosenByUser = $targetVolumeChosenByUser" + # echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" >&2 + exit 9 +fi + +# Count of 5 exists incase for some reason /Volumes/EFI fails +# be unmounted in which case the loop would run forever. +attempts=1 +while [ "$( df | grep EFI )" ] && [ $attempts -lt 5 ]; do + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Volume named 'EFI' is mounted..." + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Unmounting $( df | grep EFI | awk '{print $1}' )" + umount -f $( df | grep EFI | awk '{print $1}' ) + (( attempts++ )) +done +if [ $attempts = 5 ]; then + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Failed to unmount 'EFI' System Partition." + exit 1 +fi + +exit 0 diff --git a/package/Scripts/Sub/.svn/text-base/WriteChameleonStage0.sh.svn-base b/package/Scripts/Sub/.svn/text-base/WriteChameleonStage0.sh.svn-base new file mode 100644 index 0000000..456d23c --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/WriteChameleonStage0.sh.svn-base @@ -0,0 +1,53 @@ +#!/bin/bash + +echo "===============================================" +echo "Write Chameleon Stage 0 Loader:" +echo "*******************************" + +# Writes Chameleon stage 0 loader. + +# Receives disksignature: 0 = Windows not found, 1 = Windows Found +# Receives stage0Loader: for example, boot0 +# Receives stage0Loaderdualboot: for example, boot0md +# Receives targetDisk: for example, /dev/disk3 +# Receives targetResources: location of fdisk440 +# Receives targetVolume: for example, /Volumes/USB +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 7 ]; then + disksignature="$1" + stage0Loader="$2" + stage0Loaderdualboot="$3" + targetDisk="$4" + targetResources="$5" + targetVolume="$6" + scriptDir="$7" + echo "DEBUG: passed argument for disksignature = $disksignature" + echo "DEBUG: passed argument for stage0Loader = $stage0Loader" + echo "DEBUG: passed argument for stage0Loaderdualboot = $stage0Loaderdualboot" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetResources = $targetResources" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +if [ ${disksignature} = "0" ]; then + # Theres no Windows disk signature so we can write boot0 + + #echo "DEBUG: Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}" + "${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loader} -y ${targetDisk} + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loader} to ${targetDisk}." +else + # Windows is also installed on the HDD so we need to write boot0md + + #echo "DEBUG: Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}" + "${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk} + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loaderdualboot} to ${targetDisk}." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/WriteChameleonStage1.sh.svn-base b/package/Scripts/Sub/.svn/text-base/WriteChameleonStage1.sh.svn-base new file mode 100644 index 0000000..cd84459 --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/WriteChameleonStage1.sh.svn-base @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "===============================================" +echo "Write Chameleon Stage 1 Loader:" +echo "*******************************" + +# Writes Chameleon stage 1 loader. + +# Receives targetFormat: either hfs or msdos +# Receives stage1LoaderHFS: Name of file - boot1h +# Receives stage1LoaderFAT: Name of file - boot1f32 +# Receives selectedDestination: for example, /Volumes/USB +# Receives targetDeviceRaw: for example, /dev/disk3s1 +# Receives targetVolume: for example, /Volumes/USB +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 7 ]; then + targetFormat="$1" + stage1LoaderHFS="$2" + stage1LoaderFAT="$3" + selectedDestination="$4" + targetDeviceRaw="$5" + targetVolume="$6" + scriptDir="$7" + echo "DEBUG: passed argument for targetFormat = $targetFormat" + echo "DEBUG: passed argument for stage1LoaderHFS = $stage1LoaderHFS" + echo "DEBUG: passed argument for stage1LoaderFAT = $stage1LoaderFAT" + echo "DEBUG: passed argument for selectedDestination = $selectedDestination" + echo "DEBUG: passed argument for targetDeviceRaw = $targetDeviceRaw" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +if [ ${targetFormat} = "hfs" ]; then + + #echo "DEBUG: Executing command: dd if=${selectedDestination}/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw}" + dd if="${selectedDestination}"/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw} + + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage1LoaderHFS} to ${targetDeviceRaw}." +fi + +if [ ${targetFormat} = "msdos" ]; then + + #echo "DEBUG: Executing command: dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs" + dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs + + #echo "DEBUG: Executing command: cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs" + cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs + + #echo "DEBUG: Executing command: dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc" + dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc + + #echo "DEBUG: Executing command: dd of=${targetDeviceRaw} count=1 bs=512 if=/tmp/newbs" + dd if=/tmp/newbs of="${targetDeviceRaw}" count=1 bs=512 + + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage1LoaderFAT} to ${targetDeviceRaw}." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/WriteChameleonStage2.sh.svn-base b/package/Scripts/Sub/.svn/text-base/WriteChameleonStage2.sh.svn-base new file mode 100644 index 0000000..eda6a9f --- /dev/null +++ b/package/Scripts/Sub/.svn/text-base/WriteChameleonStage2.sh.svn-base @@ -0,0 +1,47 @@ +#!/bin/bash + +echo "===============================================" +echo "Write Chameleon Stage 2 Loader:" +echo "*******************************" + +# Receives stage2Loader: Name of file - boot +# Receives selectedDestination: for example, /Volumes/ChameleonBootUSB (or /Volumes/EFI if ESP install). +# Receives targetDevice: for example, /dev/disk3s1 +# Receives targetVolume: for example, /Volumes/ChameleonBootUSB +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 5 ]; then + stage2Loader="$1" + selectedDestination="$2" + targetDevice="$3" + targetVolume="$4" + scriptDir="$5" + echo "DEBUG: passed argument for stage2Loader = $stage2Loader" + echo "DEBUG: passed argument for selectedDestination = $selectedDestination" + echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# check to see if install to EFI system partition was selected +if [ "${selectedDestination}" = "/Volumes/EFI" ]; then + #echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${selectedDestination}" + cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${selectedDestination}" + "$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${selectedDestination}." +else + #echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${targetVolume}" + cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${targetVolume}" + "$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${targetVolume} on ${targetDevice}." +fi + +#Check to see if the user wants to hide the boot file +#if [ -f "${selectedDestination}"/.Chameleon/nullhideboot ]; then +# echo "Executing command: SetFile -a V ${targetVolume}/${stage2Loader}" +# "${selectedDestination}"/.Chameleon/Resources/SetFile -a V "${targetVolume}"/"${stage2Loader}" +#fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/.svn/text-base/patch.svn-base b/package/Scripts/Sub/.svn/text-base/patch.svn-base new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/package/Scripts/Sub/.svn/text-base/patch.svn-base differ diff --git a/package/Scripts/Sub/CheckDiskMicrocode.sh b/package/Scripts/Sub/CheckDiskMicrocode.sh new file mode 100755 index 0000000..cb27bcb --- /dev/null +++ b/package/Scripts/Sub/CheckDiskMicrocode.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckDiskMicrocode: Any existing bootloaders?" +echo "*********************************************" + +# Reads the GPTdiskProtectiveMBR and searches for an existing +# Windows bootloader and also for an existing Chameleon stage 0 loader +# which might be better changed depending on whether or not a Windows +# signature is found or not. +# The script then exits with the value 0 to indicate that Chameleon stage0 +# loader can be written, or 1 to indicate not to write the stage0 loader. + +# Receives targetDisk: for example, /dev/disk2. +# Receives diskSigCheck: 0 = Windows not installed / 1 = Windows installed. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 4 ]; then + targetDisk="$1" + diskSigCheck="$2" + targetVolume="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for diskSigCheck = $diskSigCheck" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed - Exiting" + exit 9 +fi + + +# read the first 437 bytes of the MBR + +mbr437=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +#mbr437md5=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | md5 ) + +if [ $( echo "${mbr437}" | awk -F0 '{print NF-1}' ) != 874 ]; then + # There is already something on the MBR + + # See if a Windows bootloader already exists + # Check bytes 440-443 of the GPTdiskProtectiveMBR for a Windows Disk Signature + windowsloader=$( dd 2>/dev/null if="$targetDisk" count=4 bs=1 | xxd | awk '{print $2$3}' ) + if [ "${windowsloader}" == "33c08ed0" ] ; then + #echo "DEBUG: Found existing Windows Boot Loader so will replace with Chameleon boot0md" + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk has existing Windows boot loader - Will replace with boot0md (boot0workV2)." + fi + + # See if a Chameleon stage0 boot file already exists + + # Note: The checks for Boot0, Boot0hfs, Boot0md and Boot0md (dmazar's Boot0workV2) assume the code stays the same. + # if the code changes then the hex values 0b807c, 0a803c, ee7505 and 742b80 used for matching + # need to be checked to see if they are the same or not. + + stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' ) + if [ "${stage0type}" == "0b807c" ]; then + #echo "DEBUG: Target has existing Chameleon stage 0 loader - Boot0hfs" + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0hfs" + + # Script CheckDiskSignature.sh returned 0 if a Windows installation was NOT found + if [ "$diskSigCheck" == "0" ]; then + #echo "DEBUG: Found no existing Windows installation so will replace stage 0 loader with Boot0" + "$scriptDir"InstallLog.sh "${targetVolume}" "Will replace boot0hfs with boot0 as Windows is not on target disk." + exit 0 + fi + exit 1 + fi + + if [ "${stage0type}" == "0a803c" ]; then + #echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0" + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0" + + # Script CheckDiskSignature.sh returned 1 if a Windows installation was found + if [ "$diskSigCheck" = "1" ]; then + #echo "DEBUG: Found existing Windows installation so will replace stage 0 loader with boot0md" + "$scriptDir"InstallLog.sh "${targetVolume}" "Will replace boot0 with boot0md (boot0workV2) as Windows is on target disk." + exit 0 + fi + exit 1 + fi + + if [ "${stage0type}" == "ee7505" ]; then + #echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0md" + #echo "DEBUG: And will leave boot0md installed." + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0md (v1)." + exit 1 + fi + + if [ "${stage0type}" == "742b80" ]; then + #echo "DEBUG: Found existing Chameleon stage 0 loader - Boot0workV2" + #echo "DEBUG: And will leave Boot0workV2 installed." + "$scriptDir"InstallLog.sh "${targetVolume}" "Target disk already has existing Chameleon stage 0 loader - boot0md (boot0workV2)." + exit 1 + fi + + if [ "${stage0type}" != "0b807c" ] && [ "${stage0type}" != "0a803c" ] && [ "${stage0type}" != "ee7505" ] && [ "${stage0type}" != "742b80" ] && [ "${windowsloader}" != "33c08ed0" ] ; then + #echo "DEBUG: Something other than Chameleon or a Windows bootloader was found" + test=$(echo "${mbr437}" | awk -F0 '{print NF-1}' ) + #echo "DEBUG: Disk microcode found: ${test} - Preserving." + #echo "DEBUG: diskupdate is set to false" + #echo "DEBUG: -----------------------------------------------" + "$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: Target has existing unrecognised bootcode in the MBR. Leaving as is." + exit 1 + fi +#else + #echo "DEBUG: The first 437 bytes of the MBR Disk Sector is blank - Updating" + #"$scriptDir"InstallLog.sh "${targetVolume}" "Target has no bootcode in the MBR disk sector." +fi + +echo "diskupdate is now set to true." +echo "-----------------------------------------------" +echo "" + +exit 0 diff --git a/package/Scripts/Sub/CheckFatType.sh b/package/Scripts/Sub/CheckFatType.sh new file mode 100755 index 0000000..05737fc --- /dev/null +++ b/package/Scripts/Sub/CheckFatType.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckFatType: Do we have FAT16 or FAT32?" +echo "****************************************" + +# Looks for the following in the partition boot sector +# Byte number 19 to see if it's either 00 or 02 +# Byte number 22 to see if it's either F8 or F0 +# Byte number 25 to see if it's either 3F or 20 +# +# Exit with value 1 for FAT16, 2 for FAT32 +# Exit with value 0 if nothing is found - this shouldn't happen.? + +# Receives targetDeviceRaw: for example, /dev/rdisk0s2. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then + targetDeviceRaw="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument = $targetDeviceRaw" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +partitionBootSector=$( dd 2>/dev/null if="$targetDeviceRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then + #echo "DEBUG: Found a FAT32 device formatted by Windows Explorer" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by Windows Explorer" + exit 2 +fi +if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "3f" ]; then + #echo "DEBUG: Found a FAT16 device formatted by Windows Explorer" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by Windows Explorer" + exit 1 +fi +if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT32 device formatted by OS X Snow Leopard Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Snow Leopard Disk Utility" + exit 2 +fi +if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f0" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT16 device formatted by OS X Snow Leopard Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Snow Leopard Disk Utility" + exit 1 +fi +if [ "${partitionBootSector:36:2}" == "00" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT32 device formatted by OS X Lion Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT32 volume formatted by OS X Lion Disk Utility" + exit 2 +fi +if [ "${partitionBootSector:36:2}" == "02" ] && [ "${partitionBootSector:42:2}" == "f8" ] && [ "${partitionBootSector:48:2}" == "20" ]; then + #echo "DEBUG: Found a FAT16 device formatted by OS X Lion Disk Utility" + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDeviceRaw} is on a FAT16 volume formatted by OS X Lion Disk Utility" + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/CheckGRUBLinuxLoader.sh b/package/Scripts/Sub/CheckGRUBLinuxLoader.sh new file mode 100755 index 0000000..aeeff26 --- /dev/null +++ b/package/Scripts/Sub/CheckGRUBLinuxLoader.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckGRUBLinuxLoader: Does GRUB or LILO exist?" +echo "**********************************************" + +# This reads the MBR of the disk in the attempt to find the +# signature for either the GRUB or Linux bootloaders. +# The script returns 1 if either is found, or 0 if none found. + +# Receives targetdisk: for example, /dev/disk2. +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 3 ]; then + targetDisk="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +diskmicrocodetype[1]="GRUB,47525542" +diskmicrocodetype[2]="LILO,4c494c4f" + +diskmicrocode=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=1 bs=437 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +#echo "DEBUG: ${diskmicrocode}" +diskmicrocodetypecounter=0 + +while [ ${diskmicrocodetypecounter} -lt ${#diskmicrocodetype[@]} ]; do + diskmicrocodetypecounter=$(( ${diskmicrocodetypecounter} + 1 )) + diskmicrocodetypeid=${diskmicrocodetype[${diskmicrocodetypecounter}]#*,} + if [ ! "${diskmicrocode}" = "${diskmicrocode/${diskmicrocodetypeid}/}" ]; then + echo "${diskmicrocodetype[${diskmicrocodetypecounter}]%,*} found." + exit 1 + #else + #echo "DEBUG: Didn't find a match for ${diskmicrocodetype[${diskmicrocodetypecounter}]%,*}" + fi +done + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/CheckPartitionScheme.sh b/package/Scripts/Sub/CheckPartitionScheme.sh new file mode 100755 index 0000000..4bae281 --- /dev/null +++ b/package/Scripts/Sub/CheckPartitionScheme.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "===============================================" +echo "Check the Partition Scheme: GPT, GPT/MBR or MBR?" +echo "************************************************" + +# Looks for the first 8 bytes of the GPTdiskGPTHeader to identify a GUID partition table. +# Byte number 450 of the GPTdiskProtectiveMBR to identify ID of 'EE' to identify a GPT partition. +# Byte numbers 466, 482 & 498 of the GPTdiskProtectiveMBR to identify further partitions. +# +# Exit with value 1 for GPT, 2 for GPT/MBR and 3 for MBR. +# Exit with value 0 if nothing is found - this shouldn't happen.? + +# Receives targetDisk: for example, /dev/disk0s2 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 3 ]; then + targetDisk="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +partitiontable=$( dd 2>/dev/null if="$targetDisk" count=1 skip=1 | dd 2>/dev/null count=8 bs=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) +if [ "${partitiontable:0:16}" == "4546492050415254" ]; then + partitiontable=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=64 bs=1 skip=446 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) + + if [ "${partitiontable:8:2}" == "ee" ]; then + #echo "DEBUG: Found System ID 'EE' to identify GPT Partition" + + if [ "${partitiontable:40:2}" == "00" ] && [ "${partitiontable:72:2}" == "00" ] && [ "${partitiontable:104:2}" == "00" ]; then + #echo "DEBUG: Found System ID '00' for each remaining possible partition" + partitiontable="GPT" + #echo "DEBUG: ${partitiontable} found." + #"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT." + exit 1 + else + partitiontable="GPT/MBR" + #echo "DEBUG: ${partitiontable} found." + #"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using a GPT/MBR." + exit 2 + fi + fi +else + partitiontable="MBR" + #echo "DEBUG: ${partitiontable} found." + #"$scriptDir"InstallLog.sh "${targetVolume}" "${targetDisk} is using MBR." + exit 3 +fi + +#echo "DEBUG: No partition table found." +"$scriptDir"InstallLog.sh "${targetVolume}" "NOTE: No partition table found." + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/CheckPreviousChameleon.sh b/package/Scripts/Sub/CheckPreviousChameleon.sh new file mode 100755 index 0000000..ca6aa88 --- /dev/null +++ b/package/Scripts/Sub/CheckPreviousChameleon.sh @@ -0,0 +1,187 @@ +#!/bin/bash + +echo "===============================================" +echo "Check Previous Chameleon: Will there be problems?" +echo "***********************************************" + +# Checks for another existing Chameleon installation on the same disk +# and tries to make sure the user doesn't end up with an un-bootable +# system due to having installed Chameleon previously elsewhere. + +# Called from the Standard/postinstall and EFI/postinstall scripts +# /Volumes/EFI should already be mounted before this is called. + +# Receives targetDisk: for example, /dev/disk3. +# Receives targetDeviceRaw: for example, /dev/rdisk3s1. +# Receives targetDevice: Stores device number, for example /dev/disk2s1. +# Receives installerVolume: Volume to write the installer log to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 5 ]; then + targetDisk="$1" + targetDeviceRaw="$2" + targetDevice="$3" + installerVolume="$4" + scriptDir="$5" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetDeviceRaw = $targetDeviceRaw" + echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for installerVolume = $installerVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +# =============================================== +# Prepare some vars +# =============================================== +sliceNumber=$( echo ${targetDeviceRaw#*disk*s} ) + +# strip slice from end +targetDiskRawNoSlice=$( echo ${targetDeviceRaw%$sliceNumber} ) + +# Are there any other partitions on the disk? +# How many actual partitions are there? +numSlices=$(( $( diskutil list | grep $( echo ${targetDisk#/dev/} ) | sed -n '$=' ) -2 )) + + +# =============================================== +# Checking the disk for existing Chameleon installations +# if there is more than one partition on the disk. +# =============================================== +if [ $numSlices -gt 1 ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Checking ${targetDisk#/dev/}." + + # Check the disk's MBR for existing stage 0 boot code (code from CheckDiskMicrocode.sh script) + stage0type=$( dd 2>/dev/null if="$targetDisk" count=3 bs=1 skip=105 | xxd | awk '{print $2$3}' ) + if [ "${stage0type}" == "0a803c" ] || [ "${stage0type}" == "ee7505" ] || [ "${stage0type}" == "742b80" ]; then + stage0type=2 + elif [ "${stage0type}" == "0b807c" ]; then + stage0type=1 + fi + + #Scan all partitions for Chameleon code + cleanRun=1 + for (( i=1; i <= $numSlices; i++ )); + do + if [ $stage0type == 1 ] || [ $stage0type == 2 ]; then + stagesFound=1 + else + stagesFound=0 + fi + stage1Existence="NONE" + stage2Existence=0 + targetDiskRaw=$targetDiskRawNoSlice$i + + # Check for existence of a bootable partition boot sector containing either boot1h or boot1f32 + boot1Search=$( dd 2>/dev/null if="$targetDiskRaw" count=1 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) + if [ "${boot1Search:0:16}" == "fa31c08ed0bcf0ff" ] && [ "${boot1Search:1020:2}" == "55" ]; then + (( stagesFound++ )) + stage1Existence="boot1h" + elif [ "${boot1Search:0:4}" == "e962" ] && [ "${boot1Search:180:12}" == "424f4f542020" ] && [ "${boot1Search:1020:2}" == "55" ]; then + (( stagesFound++ )) + stage1Existence="boot1f32" + fi + + # Check for existing stage 2 boot file. + # Include checking the EFI system partition if it exists and is mounted. + if [ -e "$( df | grep ${targetDisk}s${i} | awk '{ print $6 }' )"/boot ]; then + (( stagesFound++ )) + stage2Existence=1 + fi + + if [ $stagesFound -ge 2 ] && [ "$stage1Existence" != "NONE" ] && [ $i -ne $sliceNumber ]; then + # There is previous Chameleon stage 1 code on a partition boot sector, + # and either a complete or incomplete installation (ie. boot0 or boot are missing). + + if [ $stagesFound == 3 ] && [ $i -lt $sliceNumber ]; then + # Exisitng installation found which will still be default. + message="************************** TAKE NOTE ***************************** +**** There is an existing Chameleon installation on $targetDiskRaw +**** and that installation will still be the default loader as it's +**** on an earlier partition. If you want this new installation on +**** $installerVolume to be default then you will need to remove the +**** boot file from $targetDiskRaw and re-run this installer. +**************************************************************" + "$scriptDir"InstallLog.sh "${installerVolume}" "${message}" + fi + if [ $stagesFound == 3 ] && [ $i -gt $sliceNumber ]; then + # Existing installation found which will no longer be default. + message="NOTE: There is an existing Chameleon installation on $targetDiskRaw +NOTE: but this installation on $targetDevice will be the default loader +NOTE: because you're installing to an earlier partition on the disk." + "$scriptDir"InstallLog.sh "${installerVolume}" "${message}" + fi + + + # User could see a b1f:error or boot0:error if the following conditions are true: + # A) Boot0hfs, Boot0md or Boot0md (dmazar's Boot0workV2) is being used. + # B) The previous stage 1 code is on a lower partiton than the one being installed to now. + # C) boot is missing from that partition. + + if [ $stagesFound == 2 ] && [ $stage2Existence == 0 ]; then + # Exisitng boot0 and boot1 only found - missing boot + "$scriptDir"InstallLog.sh "${installerVolume}" "INFO: Found $stage1Existence installed to ${targetDisk}s${i}" + + # stage0type=2 is used to know if 'A' is true. + if [ $stage0type == 2 ]; then + # i = current slice we're checking, slicenumber = slice trying to install to. + if [ $i -lt $sliceNumber ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "WARN: Conditions point to the possibility of a boot failure" + + # Fix by making previous parition bootsector un-bootable + message="--- +FIX: Make ${targetDisk}s${i} boot sector un-bootable by changing byte 1FEh to 00. +NOTE: Any Extra folder you had there will still be there. If you want to use +NOTE: ${targetDisk}s${i} again as your boot partition then re-run this installer +NOTE: selecting it as the target, ONLY choosing the 'Chameleon Bootloader' option +NOTE: and NONE of the other options. +---" + "$scriptDir"InstallLog.sh "${installerVolume}" "${message}" + + # /Volumes/EFI needs unmounting before changing partition boot sector + if [ $i == 1 ]; then + umount /Volumes/EFI + else + diskutil unmount "${targetDisk}"s${i} + fi + + # Change Byte 01FExh to 00 (510 decimal) + # Same code can be used for HFS or FAT32 + dd if=${targetDisk}s${i} count=1 bs=512 of=/tmp/originalBootSector + cp /tmp/originalBootSector /tmp/newBootSector + dd if="$scriptDir/patch" of=/tmp/newBootSector bs=1 count=1 seek=510 conv=notrunc + dd if=/tmp/newBootSector of=${targetDisk}s${i} count=1 bs=512 + + # /Volumes/EFI needs re-mounting so EFI/postinstall script can use it. + # Don't check for a GPT as wouldn't have got here if it wasn't + if [ $i == 1 ]; then + "$scriptDir"MountESP.sh "${targetDisk}" "${installerVolume}" "${scriptDir}" + else + diskutil mount "${targetDisk}"s${i} + fi + + else + "$scriptDir"InstallLog.sh "${installerVolume}" "INFO: but won't interfere as you're installing to an earlier partition." + fi + elif [ $stage0type == 1 ]; then + # boot0 was found which looks for boot1 on the first active partition. + "$scriptDir"InstallLog.sh "${installerVolume}" "NOTE: so select to boot that partition (if used) with active flag." + #else + #echo "DEBUG: Boot0 not found" + fi + fi + else + (( cleanRun++ )) + fi + done + if [[ $cleanRun == $i ]]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing found that could cause any problems." + fi +else + "$scriptDir"InstallLog.sh "${installerVolume}" "Nothing to check as there's only one partition." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/CheckProceed.sh b/package/Scripts/Sub/CheckProceed.sh new file mode 100755 index 0000000..902db56 --- /dev/null +++ b/package/Scripts/Sub/CheckProceed.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +echo "===============================================" +echo "Check Proceed: Can the installation continue?" +echo "***********************************************" + +# Checks the selected volume is present and the disk is partitioned +# Now also check for another existing Chameleon installation on the same disk. +# Exit with 0 to indicate okay to proceed, no problems. +# Exit with 1 to indicate okay to proceed, but target disk doesn't have EFI system partition. +# Exit with 2 to indicate not to proceed. + +# Receives targetVolume: Volume to install to (will be '/Volumes/EFI' if EFI install) +# Receives targetDevice: Stores device number, for example /dev/disk2s1. +# Receives installerVolume: Volume to write the installer log to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 4 ]; then + targetVolume="$1" + targetDevice="$2" + installerVolume="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for installerVolume = $installerVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# Does target volume exist? +if [ -z "$targetVolume" ]; then + echo "*** Cannot find the volume. Exiting." + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Cannot file the volume: $targetVolume." + exit 2 +fi + +# Does target volume use slices? +if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then + echo "*** ERROR Volume does not use slices. Exiting." + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: $targetVolume doesn't use slices." + exit 2 +fi + +# Check to find if an EFI system partition exists on the disk. +# This is used in two cases: +# A) When checking for existing Chameleon installations. +# B) When the user chooses the EFI system partition install option, +# and installing to a 'small' HFS device like a 1GB USB flash +# drive which won't have an EFI System Partition. + +# Take target device and check if slice 1 is not named "EFI" +stripped=$( echo ${targetDevice#/dev/} ) +if [ ! $(echo ${stripped#*disk*s}) = 1 ]; then + stripped=$( echo ${stripped%s*})"s1" +fi +if [ ! $( diskutil list | grep ${stripped} | awk {'print $2'} ) = "EFI" ]; then + if [ "$targetVolume" = "/Volumes/EFI" ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "FAIL: Selected disk does not have an EFI System Partition." + fi + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/CheckWindowsDiskSignature.sh b/package/Scripts/Sub/CheckWindowsDiskSignature.sh new file mode 100755 index 0000000..14a1fd5 --- /dev/null +++ b/package/Scripts/Sub/CheckWindowsDiskSignature.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +echo "===============================================" +echo "CheckWindowsDiskSignature: Is Windows installed?" +echo "************************************************" + +# Checks the disk sector for a 4-byte Windows disk signature +# if one is found then it exits with 1, otherwise it exits with 0 + +# Receives targetdisk: for example, /dev/disk0 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 3 ]; then + targetDisk="$1" + targetVolume="$2" + scriptDir="$3" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed - Exiting" + exit 9 +fi + +disksignature=$( dd 2>/dev/null if="$targetDisk" count=1 | dd 2>/dev/null count=4 bs=1 skip=440 | perl -ne '@a=split"";for(@a){printf"%02x",ord}' ) + +#echo "DEBUG: ${disksignature}" + +if [ "${disksignature}" = "00000000" ]; then + #echo "DEBUG: No Windows installation detected." + exit 0 +else + #echo "DEBUG: Detected an existing Windows installation" + "$scriptDir"InstallLog.sh "${targetVolume}" "Detected a Windows installation on this volume." + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/MountESP.sh b/package/Scripts/Sub/MountESP.sh new file mode 100755 index 0000000..aea6db1 --- /dev/null +++ b/package/Scripts/Sub/MountESP.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +echo "===============================================" +echo "MountESP: Mount the EFI system partition" +echo "***********************************************" + +# Creates a mountpoint and mounts /Volumes/EFI of the +# supplied disk which would have been pre-checked as using a GPT + +# Receives targetDisk: for example /dev/disk2. +# Receives installerVolume: Volume to write the installer log to. +# Receives efiPartitionExist: either 0 or 1 +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 4 ]; then + targetDisk="$1" + installerVolume="$2" + efiPartitionExist="$3" + scriptDir="$4" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for installerVolume = $installerVolume" + echo "DEBUG: passed argument for efiPartitionExist = $efiPartitionExist" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# Check the first partition is actually type 'EFI' +# as we could be checking a USB flash drive <4GB +if [ ${efiPartitionExist} = 1 ]; then + + # Does the mountpoint exist? + if [ ! -e "/Volumes/EFI" ]; then + mkdir -p "/Volumes/EFI" + fi + + # Mount '/Volumes/EFI' using the correct format type + if [ "$( fstyp "${targetDisk}"s1 | grep hfs )" ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI." + mount_hfs "${targetDisk}"s1 "/Volumes/EFI" + fi + if [ "$( fstyp "${targetDisk}"s1 | grep msdos )" ]; then + "$scriptDir"InstallLog.sh "${installerVolume}" "Mounting ${targetDisk}s1 as /Volumes/EFI." + mount_msdos -u 0 -g 0 "${targetDisk}"s1 "/Volumes/EFI" + fi +else + "$scriptDir"InstallLog.sh "${installerVolume}" "Target volume doesn't have an EFI system partition." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/SetActivePartition.sh b/package/Scripts/Sub/SetActivePartition.sh new file mode 100755 index 0000000..15f7a2f --- /dev/null +++ b/package/Scripts/Sub/SetActivePartition.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "===============================================" +echo "Set Active Partition ONLY if Windows is not installed" +echo "*****************************************************" + +# Sets partition active if Windows is not installed. + +# Receives diskSigCheck: code is 1 for a Windows install, 0 for no Windows install +# Receives targetDiskRaw: for example, /dev/rdisk1 +# Receives targetSlice: for example, 1 +# Receives targetVolume: Volume to install to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 5 ]; then + diskSigCheck="$1" + targetDiskRaw="$2" + targetSlice="$3" + targetVolume="$4" + scriptDir="$5" + + echo "DEBUG: passed argument for diskSigCheck = $diskSigCheck" + echo "DEBUG: passed argument for targetDiskRaw = $targetDiskRaw" + echo "DEBUG: passed argument for targetSlice = $targetSlice" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# Append fdisk output to the installer log +"$scriptDir"InstallLog.sh "${targetVolume}" "fdisk ${targetDiskRaw}" + +if [ ${diskSigCheck} == "0" ]; then + #Windows is not installed so let's change the active partition" + + partitionactive=$( fdisk -d ${targetDiskRaw} | grep -n "*" | awk -F: '{print $1}') + if [ "${partitionactive}" ] && [ "${partitionactive}" = "${targetSlice}" ]; then + "$scriptDir"InstallLog.sh "${targetVolume}" "${targetDiskRaw#/dev/r}, slice "${targetSlice}" is already set active. No need to change it." + else + "$scriptDir"InstallLog.sh "${targetVolume}" "Setting ${targetVolume} partition active." + # BadAxe requires EFI partition to be flagged active. + # but it doesn't' hurt to do it for any non-windows partition. + + fdisk -e ${targetDiskRaw} <<-MAKEACTIVE + print + flag ${targetSlice} + write + y + quit + MAKEACTIVE + fi +else + # TO DO + # Add check to make sure that the active partition is actually the Windows partition + # before printing next statement. + #echo "DEBUG: Windows is installed so we let that remain the active partition" + "$scriptDir"InstallLog.sh "${targetVolume}" "Windows is installed so that can remain the active partition" +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/UnMountEFIvolumes.sh b/package/Scripts/Sub/UnMountEFIvolumes.sh new file mode 100755 index 0000000..db10f64 --- /dev/null +++ b/package/Scripts/Sub/UnMountEFIvolumes.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +echo "===============================================" +echo "Unmount all volumes named EFI" + +# loop through and un-mount ALL mounted 'EFI' system partitions - Thanks kizwan + +# Receives targetVolumeChosenByUser: To write install log to. +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 2 ]; then + targetVolumeChosenByUser="$1" + scriptDir="$2" + # echo "DEBUG: passed argument for targetVolumeChosenByUser = $targetVolumeChosenByUser" + # echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" >&2 + exit 9 +fi + +# Count of 5 exists incase for some reason /Volumes/EFI fails +# be unmounted in which case the loop would run forever. +attempts=1 +while [ "$( df | grep EFI )" ] && [ $attempts -lt 5 ]; do + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Volume named 'EFI' is mounted..." + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Unmounting $( df | grep EFI | awk '{print $1}' )" + umount -f $( df | grep EFI | awk '{print $1}' ) + (( attempts++ )) +done +if [ $attempts = 5 ]; then + "$scriptDir"InstallLog.sh "${targetVolumeChosenByUser}" "Failed to unmount 'EFI' System Partition." + exit 1 +fi + +exit 0 diff --git a/package/Scripts/Sub/WriteChameleonStage0.sh b/package/Scripts/Sub/WriteChameleonStage0.sh new file mode 100755 index 0000000..456d23c --- /dev/null +++ b/package/Scripts/Sub/WriteChameleonStage0.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +echo "===============================================" +echo "Write Chameleon Stage 0 Loader:" +echo "*******************************" + +# Writes Chameleon stage 0 loader. + +# Receives disksignature: 0 = Windows not found, 1 = Windows Found +# Receives stage0Loader: for example, boot0 +# Receives stage0Loaderdualboot: for example, boot0md +# Receives targetDisk: for example, /dev/disk3 +# Receives targetResources: location of fdisk440 +# Receives targetVolume: for example, /Volumes/USB +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 7 ]; then + disksignature="$1" + stage0Loader="$2" + stage0Loaderdualboot="$3" + targetDisk="$4" + targetResources="$5" + targetVolume="$6" + scriptDir="$7" + echo "DEBUG: passed argument for disksignature = $disksignature" + echo "DEBUG: passed argument for stage0Loader = $stage0Loader" + echo "DEBUG: passed argument for stage0Loaderdualboot = $stage0Loaderdualboot" + echo "DEBUG: passed argument for targetDisk = $targetDisk" + echo "DEBUG: passed argument for targetResources = $targetResources" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + + +if [ ${disksignature} = "0" ]; then + # Theres no Windows disk signature so we can write boot0 + + #echo "DEBUG: Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loader} -y ${targetDisk}" + "${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loader} -y ${targetDisk} + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loader} to ${targetDisk}." +else + # Windows is also installed on the HDD so we need to write boot0md + + #echo "DEBUG: Executing command: ${targetResources}fdisk440 -u -f /usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk}" + "${targetResources}"fdisk440 -u -f "${targetVolume}"/usr/standalone/i386/${stage0Loaderdualboot} -y ${targetDisk} + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage0Loaderdualboot} to ${targetDisk}." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/WriteChameleonStage1.sh b/package/Scripts/Sub/WriteChameleonStage1.sh new file mode 100755 index 0000000..cd84459 --- /dev/null +++ b/package/Scripts/Sub/WriteChameleonStage1.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +echo "===============================================" +echo "Write Chameleon Stage 1 Loader:" +echo "*******************************" + +# Writes Chameleon stage 1 loader. + +# Receives targetFormat: either hfs or msdos +# Receives stage1LoaderHFS: Name of file - boot1h +# Receives stage1LoaderFAT: Name of file - boot1f32 +# Receives selectedDestination: for example, /Volumes/USB +# Receives targetDeviceRaw: for example, /dev/disk3s1 +# Receives targetVolume: for example, /Volumes/USB +# Receives scriptDir: The location of the main script dir. + +if [ "$#" -eq 7 ]; then + targetFormat="$1" + stage1LoaderHFS="$2" + stage1LoaderFAT="$3" + selectedDestination="$4" + targetDeviceRaw="$5" + targetVolume="$6" + scriptDir="$7" + echo "DEBUG: passed argument for targetFormat = $targetFormat" + echo "DEBUG: passed argument for stage1LoaderHFS = $stage1LoaderHFS" + echo "DEBUG: passed argument for stage1LoaderFAT = $stage1LoaderFAT" + echo "DEBUG: passed argument for selectedDestination = $selectedDestination" + echo "DEBUG: passed argument for targetDeviceRaw = $targetDeviceRaw" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +if [ ${targetFormat} = "hfs" ]; then + + #echo "DEBUG: Executing command: dd if=${selectedDestination}/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw}" + dd if="${selectedDestination}"/usr/standalone/i386/${stage1LoaderHFS} of=${targetDeviceRaw} + + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage1LoaderHFS} to ${targetDeviceRaw}." +fi + +if [ ${targetFormat} = "msdos" ]; then + + #echo "DEBUG: Executing command: dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs" + dd if=${targetDeviceRaw} count=1 bs=512 of=/tmp/origbs + + #echo "DEBUG: Executing command: cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs" + cp "${selectedDestination}"/usr/standalone/i386/${stage1LoaderFAT} /tmp/newbs + + #echo "DEBUG: Executing command: dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc" + dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc + + #echo "DEBUG: Executing command: dd of=${targetDeviceRaw} count=1 bs=512 if=/tmp/newbs" + dd if=/tmp/newbs of="${targetDeviceRaw}" count=1 bs=512 + + "$scriptDir"InstallLog.sh "${targetVolume}" "Written ${stage1LoaderFAT} to ${targetDeviceRaw}." +fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/WriteChameleonStage2.sh b/package/Scripts/Sub/WriteChameleonStage2.sh new file mode 100755 index 0000000..eda6a9f --- /dev/null +++ b/package/Scripts/Sub/WriteChameleonStage2.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +echo "===============================================" +echo "Write Chameleon Stage 2 Loader:" +echo "*******************************" + +# Receives stage2Loader: Name of file - boot +# Receives selectedDestination: for example, /Volumes/ChameleonBootUSB (or /Volumes/EFI if ESP install). +# Receives targetDevice: for example, /dev/disk3s1 +# Receives targetVolume: for example, /Volumes/ChameleonBootUSB +# Receives scriptDir: The location of the main script dir. + + +if [ "$#" -eq 5 ]; then + stage2Loader="$1" + selectedDestination="$2" + targetDevice="$3" + targetVolume="$4" + scriptDir="$5" + echo "DEBUG: passed argument for stage2Loader = $stage2Loader" + echo "DEBUG: passed argument for selectedDestination = $selectedDestination" + echo "DEBUG: passed argument for targetDevice = $targetDevice" + echo "DEBUG: passed argument for targetVolume = $targetVolume" + echo "DEBUG: passed argument for scriptDir = $scriptDir" +else + echo "Error - wrong number of values passed" + exit 9 +fi + +# check to see if install to EFI system partition was selected +if [ "${selectedDestination}" = "/Volumes/EFI" ]; then + #echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${selectedDestination}" + cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${selectedDestination}" + "$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${selectedDestination}." +else + #echo "DEBUG: Executing command: cp "${targetVolume}"/usr/standalone/i386/${stage2Loader} ${targetVolume}" + cp "${targetVolume}"/usr/standalone/i386/"${stage2Loader}" "${targetVolume}" + "$scriptDir"InstallLog.sh "${targetVolume}" "Written boot to ${targetVolume} on ${targetDevice}." +fi + +#Check to see if the user wants to hide the boot file +#if [ -f "${selectedDestination}"/.Chameleon/nullhideboot ]; then +# echo "Executing command: SetFile -a V ${targetVolume}/${stage2Loader}" +# "${selectedDestination}"/.Chameleon/Resources/SetFile -a V "${targetVolume}"/"${stage2Loader}" +#fi + +exit 0 \ No newline at end of file diff --git a/package/Scripts/Sub/patch b/package/Scripts/Sub/patch new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/package/Scripts/Sub/patch differ diff --git a/package/bin/.svn/all-wcprops b/package/bin/.svn/all-wcprops new file mode 100644 index 0000000..7a79327 --- /dev/null +++ b/package/bin/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/svn/chameleon/!svn/ver/2249/branches/Chimera/package/bin +END +clean_po_headers.sh +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2249/branches/Chimera/package/bin/clean_po_headers.sh +END diff --git a/package/bin/.svn/entries b/package/bin/.svn/entries new file mode 100644 index 0000000..e0d75f7 --- /dev/null +++ b/package/bin/.svn/entries @@ -0,0 +1,65 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/bin +http://forge.voodooprojects.org/svn/chameleon + + + +2013-06-21T15:31:19.754265Z +2249 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +po4a +dir + +clean_po_headers.sh +file + + + + +2013-08-27T23:56:19.000000Z +f10fe7a33856daa0b21a6128405558ed +2013-06-21T15:31:19.754265Z +2249 +macman +has-props + + + + + + + + + + + + + + + + + + + + +523 + diff --git a/package/bin/.svn/prop-base/clean_po_headers.sh.svn-base b/package/bin/.svn/prop-base/clean_po_headers.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/bin/.svn/prop-base/clean_po_headers.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/bin/.svn/text-base/clean_po_headers.sh.svn-base b/package/bin/.svn/text-base/clean_po_headers.sh.svn-base new file mode 100644 index 0000000..f724149 --- /dev/null +++ b/package/bin/.svn/text-base/clean_po_headers.sh.svn-base @@ -0,0 +1,16 @@ +#!/bin/bash + +if [[ ! -d "po" ]];then + echo "There no 'po' directory in the current directory !" >&2 + exit 1 +fi + +for pofile in po/*.po; do + echo $pofile + lang=${pofile##*/} + lang=${lang%.*} + gsed -i 's/; charset=CHARSET/; charset=UTF-8/g' $pofile + gsed -i 's/^\"Project-Id-Version: PACKAGE VERSION/\"Project-Id-Version: Chameleon 2.2/' $pofile + gsed -i "s/^\"Language:.*\"/\"Language: $lang\\\n\"/" $pofile + gsed -i "s/^\"Language-Team:.*\"/\"Language-Team: $lang <$lang@li.org>\\\n\"/" $pofile +done diff --git a/package/bin/clean_po_headers.sh b/package/bin/clean_po_headers.sh new file mode 100755 index 0000000..f724149 --- /dev/null +++ b/package/bin/clean_po_headers.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [[ ! -d "po" ]];then + echo "There no 'po' directory in the current directory !" >&2 + exit 1 +fi + +for pofile in po/*.po; do + echo $pofile + lang=${pofile##*/} + lang=${lang%.*} + gsed -i 's/; charset=CHARSET/; charset=UTF-8/g' $pofile + gsed -i 's/^\"Project-Id-Version: PACKAGE VERSION/\"Project-Id-Version: Chameleon 2.2/' $pofile + gsed -i "s/^\"Language:.*\"/\"Language: $lang\\\n\"/" $pofile + gsed -i "s/^\"Language-Team:.*\"/\"Language-Team: $lang <$lang@li.org>\\\n\"/" $pofile +done diff --git a/package/bin/po4a/.svn/all-wcprops b/package/bin/po4a/.svn/all-wcprops new file mode 100644 index 0000000..8fb588f --- /dev/null +++ b/package/bin/po4a/.svn/all-wcprops @@ -0,0 +1,77 @@ +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a +END +po4a-normalize +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/po4a-normalize +END +po4a-updatepo +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/po4a-updatepo +END +po4a +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/po4a +END +MANIFEST +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/MANIFEST +END +README.maintainers +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/README.maintainers +END +COPYING +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/COPYING +END +README.translators +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/README.translators +END +NEWS +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/NEWS +END +README +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/README +END +po4a-gettextize +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/po4a-gettextize +END +README.tests +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/README.tests +END +po4a-translate +K 25 +svn:wc:ra_dav:version-url +V 77 +/svn/chameleon/!svn/ver/2225/branches/Chimera/package/bin/po4a/po4a-translate +END diff --git a/package/bin/po4a/.svn/entries b/package/bin/po4a/.svn/entries new file mode 100644 index 0000000..3de786d --- /dev/null +++ b/package/bin/po4a/.svn/entries @@ -0,0 +1,439 @@ +10 + +dir +2258 +http://forge.voodooprojects.org/svn/chameleon/branches/Chimera/package/bin/po4a +http://forge.voodooprojects.org/svn/chameleon + + + +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + +b5af796a-00a8-11df-919b-ffff7a100b7d + +po4a-normalize +file + + + + +2013-08-27T23:56:19.000000Z +055bfbf24f6abcf33d37aeafa21254ec +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +4420 + +po4a-updatepo +file + + + + +2013-08-27T23:56:19.000000Z +352896bac1876ec25b0413ac19589a46 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7354 + +po4a +file + + + + +2013-08-27T23:56:19.000000Z +51f8315851d89a1def23b7621045cf9d +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +53007 + +lib +dir + +MANIFEST +file + + + + +2013-08-27T23:56:19.000000Z +1fb28cd121ce9184002fa9237709a56c +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +6371 + +README.maintainers +file + + + + +2013-08-27T23:56:19.000000Z +f040e3a087597696f8679dcb589b177d +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +4216 + +COPYING +file + + + + +2013-08-27T23:56:19.000000Z +a96fc9b4cc36d80659e694ea109f0325 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +17995 + +README.translators +file + + + + +2013-08-27T23:56:19.000000Z +8f40bfd19462e0ce5836713f80379799 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +283 + +NEWS +file + + + + +2013-08-27T23:56:19.000000Z +5802e4db1cd2df90436ace0e5d6e7206 +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +18655 + +README +file + + + + +2013-08-27T23:56:19.000000Z +a289e86a419ef1b6f727d50dca2085ce +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +2333 + +po4a-gettextize +file + + + + +2013-08-27T23:56:19.000000Z +a878f40373a278cdbefed9355b0fbd28 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7614 + +README.tests +file + + + + +2013-08-27T23:56:19.000000Z +ff7223a9fbc5a4d340c098de1c925c6e +2013-05-13T17:58:08.168855Z +2225 +macman + + + + + + + + + + + + + + + + + + + + + +618 + +po4a-translate +file + + + + +2013-08-27T23:56:19.000000Z +98279ce6eeb9b2ee204d3dec1de900b6 +2013-05-13T17:58:08.168855Z +2225 +macman +has-props + + + + + + + + + + + + + + + + + + + + +7816 + diff --git a/package/bin/po4a/.svn/prop-base/po4a-gettextize.svn-base b/package/bin/po4a/.svn/prop-base/po4a-gettextize.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/bin/po4a/.svn/prop-base/po4a-gettextize.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/bin/po4a/.svn/prop-base/po4a-normalize.svn-base b/package/bin/po4a/.svn/prop-base/po4a-normalize.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/bin/po4a/.svn/prop-base/po4a-normalize.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/bin/po4a/.svn/prop-base/po4a-translate.svn-base b/package/bin/po4a/.svn/prop-base/po4a-translate.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/bin/po4a/.svn/prop-base/po4a-translate.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/bin/po4a/.svn/prop-base/po4a-updatepo.svn-base b/package/bin/po4a/.svn/prop-base/po4a-updatepo.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/bin/po4a/.svn/prop-base/po4a-updatepo.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/bin/po4a/.svn/prop-base/po4a.svn-base b/package/bin/po4a/.svn/prop-base/po4a.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/package/bin/po4a/.svn/prop-base/po4a.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/package/bin/po4a/.svn/text-base/COPYING.svn-base b/package/bin/po4a/.svn/text-base/COPYING.svn-base new file mode 100644 index 0000000..a989284 --- /dev/null +++ b/package/bin/po4a/.svn/text-base/COPYING.svn-base @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/package/bin/po4a/.svn/text-base/MANIFEST.svn-base b/package/bin/po4a/.svn/text-base/MANIFEST.svn-base new file mode 100644 index 0000000..f7da58c --- /dev/null +++ b/package/bin/po4a/.svn/text-base/MANIFEST.svn-base @@ -0,0 +1,333 @@ +MANIFEST This list of files (needed by ModuleBuild) +META.yml Module meta-data (added by ModuleBuild) +COPYING +changelog +Build.PL File processed to create the Build script +Po4aBuilder.pm The rules to build this module (for ModuleBuild) +README +README.maintainers +README.tests +README.translators +TODO +NEWS + +doc/addendum.ca +doc/addendum.es +doc/addendum.fr +doc/addendum.it +doc/addendum.ja +doc/addendum.pl +doc/addendum_man.es +doc/addendum_man.fr +doc/addendum_man.ja +doc/addendum_man.pl +doc/po4a.7.pod +doc/po4a-build.conf.5.pod +doc/po4a-runtime.7.pod +lib/Locale/Po4a/BibTeX.pm +lib/Locale/Po4a/Chooser.pm +lib/Locale/Po4a/Common.pm +lib/Locale/Po4a/Dia.pm +lib/Locale/Po4a/Docbook.pm +lib/Locale/Po4a/Guide.pm +lib/Locale/Po4a/Halibut.pm +lib/Locale/Po4a/Ini.pm +lib/Locale/Po4a/KernelHelp.pm +lib/Locale/Po4a/LaTeX.pm +lib/Locale/Po4a/Man.pm +lib/Locale/Po4a/Po.pm +lib/Locale/Po4a/Pod.pm +lib/Locale/Po4a/Sgml.pm +lib/Locale/Po4a/TeX.pm +lib/Locale/Po4a/Texinfo.pm +lib/Locale/Po4a/Text.pm +lib/Locale/Po4a/TransTractor.pm +lib/Locale/Po4a/Xhtml.pm +lib/Locale/Po4a/Xml.pm +lib/Locale/Po4a/Wml.pm + +po/bin/af.po +po/bin/bn.po +po/bin/ca.po +po/bin/cs.po +po/bin/da.po +po/bin/de.po +po/bin/eo.po +po/bin/es.po +po/bin/et.po +po/bin/eu.po +po/bin/fr.po +po/bin/he.po +po/bin/hr.po +po/bin/id.po +po/bin/ja.po +po/bin/it.po +po/bin/kn.po +po/bin/ko.po +po/bin/ku.po +po/bin/nb.po +po/bin/nl.po +po/bin/oc.po +po/bin/pl.po +po/bin/po4a.pot +po/bin/pt_BR.po +po/bin/pt.po +po/bin/ru.po +po/bin/sl.po +po/bin/sv.po +po/bin/uk.po +po/bin/uz.po +po/bin/vi.po +po/bin/zh_CN.po +po/bin/zh_HK.po +po/bin/POTFILES.in +po/bin/Makevars +po/bin/Makefile +po/bin/LINGUAS +po/pod/ca.po +po/pod/de.po +po/pod/es.po +po/pod/fr.po +po/pod/it.po +po/pod/ja.po +po/pod/pl.po +po/pod/po4a-pod.pot +po/pod/ru.po +po/pod.cfg + +# the binaries +po4a +po4a-gettextize +po4a-normalize +po4a-translate +po4a-updatepo +po4a-build.conf +share/po4a-build + +# support files +share/Makefile +share/Makevars-perl.example +share/Makevars-shell.example +share/po4a-build.make +share/README +share/po4a-build.conf.example +share/doc/po4a-build.xml +share/doc/po4aman-display-po.xml +share/doc/po4apod-display-po.xml + +# the random additional cool scripts +scripts/msguntypot +scripts/po4aman-display-po +scripts/po4apod-display-po + +# The tests +t/compare-po.pl + +t/01-classes.t + +t/02-TransTractors.t +t/data-02/man +t/data-02/man.fr +t/data-02/man.fr-normalized +t/data-02/man.po +t/data-02/man.po-empty +t/data-02/man.po-ok +t/data-02/pod +t/data-02/pod.fr +t/data-02/pod.fr-normalized +t/data-02/pod.po +t/data-02/pod.po-empty +t/data-02/pod.po-ok + +t/03-addendums.t +t/data-03/man +t/data-03/man.addendum1 +t/data-03/man.addendum2 +t/data-03/man.addendum3 +t/data-03/man.addendum4 +t/data-03/man.fr +t/data-03/man.fr.add1 +t/data-03/man.fr.add2 +t/data-03/man.fr.add3 +t/data-03/man.fr.add4 +t/data-03/man.po-ok + +t/04-charsets.t +t/data-04/ascii.po-ok +t/data-04/ascii-iso8859.po-ok +t/data-04/iso8859.po-ok +t/data-04/text-ascii.pod +t/data-04/text-iso8859.pod +t/data-04/text-iso8859_.pod +t/data-04/text-iso8859.pod-ok +t/data-04/trans.po +t/data-04/utf.po +t/data-04/utf.po-ok +t/data-04/utf.pod-ok + +t/10-discard-fuzzy.t +t/data-10/pod +t/data-10/pod.fr +t/data-10/pod.po + +t/11-plural.t +t/data-11/err1 +t/data-11/pod1 +t/data-11/pod1.fr +t/data-11/pod1.po +t/data-11/pod2 +t/data-11/pod2.fr +t/data-11/pod2.po +t/data-11/pod3 +t/data-11/pod3.fr +t/data-11/pod4 +t/data-11/pod4.fr + +t/20-sgml.t +t/data-20/text.xml +t/data-20/xml.po +t/data-20/test2-normalized.sgml +t/data-20/test2.pot +t/data-20/test2.sgml + +t/21-dia.t +t/data-21/extract.dia +t/data-21/extract.po-ok +t/data-21/transl.dia +t/data-21/transl.dia-ok +t/data-21/transl.po + +t/23-man.t +t/data-23/dot1 +t/data-23/dot1.fr +t/data-23/dot1.fr.po +t/data-23/dot1.pot +t/data-23/dot2 +t/data-23/dot2.err +t/data-23/dot3 +t/data-23/dot3.err +t/data-23/dot4 +t/data-23/dot4.err +t/data-23/dot5 +t/data-23/dot5.it +t/data-23/dot5.it.po +t/data-23/dot5.pot +t/data-23/escapes1 +t/data-23/escapes1.it +t/data-23/escapes1.it.po +t/data-23/escapes1.pot +t/data-23/fonts +t/data-23/fonts.en +t/data-23/fonts.en.po +t/data-23/fonts.pot +t/data-23/hyphens.1 +t/data-23/hyphens.translate.fr +t/data-23/hyphens.translate.fr.po +t/data-23/hyphens.translate.pot +t/data-23/hyphens.verbatim.fr +t/data-23/hyphens.verbatim.fr.po +t/data-23/hyphens.verbatim.pot +t/data-23/mdoc.1 +t/data-23/mdoc.fr +t/data-23/mdoc.fr.po +t/data-23/mdoc.pot +t/data-23/mixed1 +t/data-23/mixed1.fr +t/data-23/mixed2 +t/data-23/mixed2.fr +t/data-23/mixed3 +t/data-23/mixed3.fr +t/data-23/mixed4 +t/data-23/mixed4.fr +t/data-23/mixed.cfg +t/data-23/mixed.fr.po +t/data-23/mixed.pot +t/data-23/null +t/data-23/null.fr +t/data-23/null.fr.po +t/data-23/null.pot +t/data-23/quotes +t/data-23/quotes.fr +t/data-23/quotes.fr.po +t/data-23/quotes.pot +t/data-23/spaces +t/data-23/spaces.fr_latin1 +t/data-23/spaces.fr_latin1.po +t/data-23/spaces.fr_utf8 +t/data-23/spaces.fr_utf8.po +t/data-23/spaces.ja +t/data-23/spaces.ja.po +t/data-23/spaces.pot + +t/24-tex.t +t/data-24/simple-translate.out +t/data-24/simple.fr.po +t/data-24/simple-updatepo.out +t/data-24/simple.fr.tex +t/data-24/simple-gettextize.out +t/data-24/simple.pot +t/data-24/simple.tex + +t/25-xhtml.t +t/data-25/includessi.html +t/data-25/includessi_normalized.html +t/data-25/includessi.po +t/data-25/xhtml.html +t/data-25/xhtml_normalized.html +t/data-25/xhtml.po + +t/26-ini.t +t/data-26/test1.po +t/data-26/test1.ini + +t/27-xml.t +t/data-27/cdata.xml +t/data-27/cdata.po +t/data-27/general.xml +t/data-27/general.po +t/data-27/general-normalized.xml +t/data-27/comments.xml +t/data-27/comments.po +t/data-27/comments-normalized.xml +t/data-27/options.xml +t/data-27/options.po +t/data-27/options-normalized.xml + +t/28-msguntypot.t +t/data-28/test1.new.po +t/data-28/test1.new.pot +t/data-28/test1.old.pot +t/data-28/test1.po +t/data-28/test2.new.po +t/data-28/test2.new.pot +t/data-28/test2.old.pot +t/data-28/test2.po +t/data-28/test3.new.po +t/data-28/test3.new.pot +t/data-28/test3.old.pot +t/data-28/test3.po +t/data-28/test4.new.po +t/data-28/test4.new.pot +t/data-28/test4.old.pot +t/data-28/test4.po +t/data-28/test5.new.po +t/data-28/test5.new.pot +t/data-28/test5.old.pot +t/data-28/test5.po +t/data-28/test6.new.po +t/data-28/test6.new.pot +t/data-28/test6.old.pot +t/data-28/test6.po +t/data-28/test7.new.po +t/data-28/test7.new.pot +t/data-28/test7.old.pot +t/data-28/test7.po +t/data-28/test8.new.po +t/data-28/test8.new.pot +t/data-28/test8.old.pot +t/data-28/test8.po + +t/29-wml.t +t/data-29/general-normalized.wml +t/data-29/general.po +t/data-29/general.wml diff --git a/package/bin/po4a/.svn/text-base/NEWS.svn-base b/package/bin/po4a/.svn/text-base/NEWS.svn-base new file mode 100644 index 0000000..f44e6b8 --- /dev/null +++ b/package/bin/po4a/.svn/text-base/NEWS.svn-base @@ -0,0 +1,571 @@ +po4a NEWS + +======================================================================= + +* Major changes in release 0.42 (UNRELEASED) + +Text: + * Add support for control files. + +======================================================================= + +* Major changes in release 0.41 (2010-12-01) + +po4a-updatepo: + * --previous flag was not passed to msgmerge + +po4a: + * Do no more generate backups for PO files. + * Fix the --srcdir option, master file was not found. + * Expand variables when reading @-prefixed addenda files. + +Text: + * Remove trailing newline in titles from PO files + +Packaging: + * Remove Makefile, all processing is performed by Build.PL + +======================================================================= + +* Major changes in release 0.40.2 (2010-11-30) + +documentation: + * Improve English style (following recommendations from man(7)) + +translations: + * Start of Danish translation + * Removal of Arabic translation, only one string was translated + * Updated Vietnamese translation + * Updated Slovenian translation + * Updated Basque translation + * Updated French translation + * Updated Japanese translation + * Updated Czech translation + * Updated German translation + * Updated Ukrainian translation + * Updated Esperanto translation + * Updated Estonian translation + * Updated Russian translation + +documentation translations: + * Updated Spanish translations + * Updated French translations + * Updated Japanese translations + * Updated Polish translations + +======================================================================= + +* Major changes in release 0.40.1 (2010-08-25) + +Po: + * Change header entry to be consistent with xgettext when creating + POT files: replace Content-Transfer-Encoding: ENCODING" by + "Content-Transfer-Encoding: 8bit\n" and add a Language field. + +documentation: + * Improve English style (proper casing, replace cvs by VCS, etc). + +translations: + * Updated French translations + * Updated Spanish translations + * Updated Japanese translations + * Updated Esperanto translations + * Updated Swedish translations + * Updated Russian translations + * Updated Estonian translations + * Updated Ukrainian translations + * Updated Czech translations + * Updated Portuguese translations + * Updated German translations + +Project resources: + * We migrated from CVS to SVN. All CVS history has been converted. + See http://svn.debian.org/viewsvn/po4a/ + The standard SVN layout is used (with top-level /trunk, /branches + and /tags directories), and the files to generate the website + (html/, po/html.cfg and po/www) are moved into a new /web + top-level directory. + +======================================================================= + +* Major changes in release 0.40 (2010-07-27) + +po4a-gettextize: + * When it fails, recode msgstr into current charset before + printing it. + +Text: + * Fix failures "Unknown option: copyright-holder" + +Man: + * Support font modifiers in the form \f(XX and \f[FONT-NAME] + +======================================================================= + +* Major changes in release 0.39 (2010-02-02) + +po4a + * New syntax for addenda, path may be preceded by modifiers. + +======================================================================= + +* Major changes in release 0.38 (2010-01-14) + +po4a + * Exit with an error if master file specified in a po4a configuration + file does not exist. + +po4a, po4a-updatepo: + * --previous is activated by default. + * Use --no-previous to support versions of gettext earlier than 0.16. + +Xml: + * Fix handling of multi-lines placeholder tags. + * New option addlang. + +Pod: + * Detect the encoding based on the input's =encoding line. + +======================================================================= + +* Major changes in release 0.37.1 (2009-11-22) + +po4a-build: + * Fix UTF8 handling and names of perl modules for section 3. + * Fix bug that caused translated manpages to be overwritten. + +======================================================================= + +* Major changes in release 0.37.0 (2009-11-20) + +po4a-build: + * New script for one-stop generation of untranslated and translated + documentation from DocBook XML and POD sources. + +translations: + * Updated Spanish translations. + +=============================================================================== +* Major changes in release 0.36.6 (2009-11-07) + +Text: + * Added options breaks and tabs. + +po4aman-display-po + * Fixed bashism. + +translations: + * Added Vietnamese translation + * Updated Czech translation + * Updated Spanish translation of the documentation + +=============================================================================== +* Major changes in release 0.36.5 (2009-09-10) + +Sgml: + * Fix detection of entities in the prolog. + +translations: + * Updated German translation + * Updated Portuguese translation + +=============================================================================== +* Major changes in release 0.36.4 (2009-08-30) + +po4a + * Added options --srcdir and --destdir. They permit to strip the base + directory for the input and output documents (in the config file and in + the references generated in the PO files). + +po4a-updatepo + * Added options --msgid-bugs-address, --copyright-holder, --package-name, + --package-version to control the generation of the PO header. + +translations: + * Updated Basque translation + * Updated Czech translation + * Updated Esperanto translation + * Improved Estonian translation. + * Updated French translation + * Updated Russian translation + * Updated Spanish translation. + * Updated Swedish translation. + +=============================================================================== +* Major changes in release 0.36.3 (2009-07-22) + +Bug fix release. +po4a-gettextize's new options were rejected by the modules. + +=============================================================================== +* Major changes in release 0.36.2 (2009-07-21) + +po4apod-display-po + * New script to display previews of POD translations. +po4a-gettextize + * Added options --msgid-bugs-address, --copyright-holder, --package-name, + --package-version to control the generation of the PO header. + +Text: + * Avoid the translation of some markups: title and horizontal rules. + * Improved Markdown support. +Xml: + * New option customtag for inline tags that should not be treated as a + tag (e.g. they do not need to be closed). +Wml: + * Fix handling of non ASCII input documents. + +=============================================================================== +* Major changes in release 0.36.1 (2009-04-05) + +TeX: + * Fix support for inline customization of separators. + * Fix support for double escapes, which should not introduce commands. +LaTeX: + * Added support for the tabularx environment. +Xml: + * Do not include commented out external entities (when includeexternal is + used). +Pod: + * Do not add an =encoding header if the encoding is empty. + +=============================================================================== +* Major changes in release 0.36 (2009-03-15) + +general: + * The "type:" comments in the PO files are now tagged as extracted + comments (starting with #.). This changes all the PO files generated by + po4a. Maintainers should just let these changes pass through. + Translator may want to remove the comment lines starting with '# type:' + as they will be duplicates with the '#. type:' comments. + +Xml: + * Placeholders are presented with a type and have a more valid XML + representation. This changes the PO files, but translations could be + updated automatically. + * Do not fail when the doctype does not match the expected one. Only + issue a warning. + * The tags and tagsonly options are deprecated. Use the + translated/untranslated and break/inline/placeholder options instead. + * Added foldattributes option. Useful to simplify strings and avoid typos + when attributes shall not be translated. +Man: + * Better handling of spaces in command arguments. +TeX: + * Included files are searched with kpsewhich instead of using TEXINPUTS + directly. + +=============================================================================== +* Major changes in release 0.35 (2009-02-10) + +po4a + * Added support for the [po_directory] command in the configuration file. + It permits to avoid listing the supported languages. Simply dropping a + new PO file should be sufficient. It should be preferred over the + po4a_langs and po4a_paths commands. +po4a-normalize: + * Added option -b, --blank to check which parts of a document are not + translated. +po4a-gettextize: + * Improved conflict handling: indicate the reference of the alternatives + when the same string has different translations. + +general: + * Added support for a nowrapi18n option in Locale::Po4a::Common in + order to use Locale::Po4a programatically. + +packaging: + * Manpages are generated in utf-8. This requires a recent Pod::Man with + support for the utf8 option. + +Docbook: + * Improved support for Docbook 5 and Docbook 4, based on the official + documentation of the Docbook tags. +Pod: + * Announce the encoding in the POD header. +Sgml: + * Add support for recursive inclusion. +Text: + * Added option asciidoc +Xhtml: + * Improvements for the tag. +xml: + * Fix the nodefault option. Derivative modules should use _default_tags + and _default_inline to define the default behavior of their + module-specific tags (instead of tags and inline). + * Speed improvements. + * Added support for placeholders. + +=============================================================================== +* Major changes in release 0.34 (2008-07-20) + +** New features +general: + * Do not end re-wrapped lines with a space. +halibut: + * Added support for the Halibut format. +sgml: + * Fix failures with big sgml documents ("broken pipe" received from + nsgmls -p). +text: + * Added support for the Markdown format, as used with Ikiwiki. + * Make sure files are not mixed together when gettextized at the same + time. +packaging: + * Fix build failures with old versions of Module::Build. + +=============================================================================== +* Major changes in release 0.33.3 (2008-04-02) + +po4a: + * Add options --package-name and --package-version (similar to xgettext's + options). + +translations: + * Actually ship Japanese translations. + +=============================================================================== +* Major changes in release 0.33.2 (2008-04-01) + +text: + * Added support for the fortunes format. + +translations: + * New Japanese translation. + * The manpages are generated in UTF-8. + +=============================================================================== +* Major changes in release 0.33.1 (2008-03-16) + +This is a bug fix release. + +man: + * Do not translate - to \- inside \*[...], \(.., \H'...', or \Z'...'. + +xml: + * Do not translate SSI comments by default. + +packaging: + * Fix the installation path of manpages and .mo files. + +=============================================================================== +* Major changes in release 0.33 (2008-03-03) + +Notes to packagers: Since 0.31, some tests in the sgml testsuite require +the docbook sgml DTD. If you run the testsuite at build time you must have +these DTD in your build dependencies or you must disable these tests +cases in the testsuite. + +** New features + general: Support for PO files with plural forms. + Po4a does not generate such PO files, but it can receive one in + input. In such case, po4a cannot choose between the (singular + and) plural forms. It will consider that msgstr[0] is the + translation of msgid and msgstr[1] is the translation of + msgid_plural, which may be wrong. Thus, a warning will be + issued if po4a is asked to translate the singular or plural + form of a message with plural forms. + + texinfo: Major changes. Tested on the elisp documentation. + + sgml: Fail if nsgmls cannot validate the input file. This can be turned + off with the "force" option. + + xml: New option "cpp" to support C preprocessor directives (this avoids + re-wrapping lines with preprocessor directives). + xml: New options "translated" and "untranslated" that should allow an + easier configuration of Xml (and derivative module) + xml: Avoid duplicated newlines at the end of lines of multi-lines + comments. + xml: Paragraphs which only consist in an inline tag are now extracted. + This makes a lot of string to available for translation in the PO + file. + docbook: Tested on the Docbook testsuite. Lots of tag added. + + po4a: Fix failures with perl 5.10. Thanks to Roderich Schupp + + + msguntypot: Fix handling of the comment of the PO header. + +=============================================================================== +* Major changes in release 0.32 (2007-08-15) + +** Security fix + Fix a symlink attack caused by the /tmp/gettextization.failed.po + temporary file. + (CVE-2007-4462) + +** Bug fixes + + sgml: The handling of newlines was broken in no-wrap sections in 0.31 + + xhtml: The module is now distributed as the other modules. + + texinfo: Fix infinite loop when a command parameter ends with \ + (as in @samp{\}) + +** New features + + xml: New option includeexternal to support external entities. + + texinfo: Added support for many commands and environment (see + changelog). + + xhtml: New option includessi, which adds supports for Server Side + Includes include element (). + + xml: New option ontagerror to control the behavior of the module in case + of error. This permits to support files that the module would + consider invalid otherwise. + +** Translations + + New translations (Bengali, Estonian, Croatian, Indonesian, Kannada, + Korean, Occitan, Uzbek, Simplified Chinese, Chinese from Hong Kong) and + many updates. + +=============================================================================== +* Major changes in release 0.31 (2007-05-07) + +** Dependencies + + po4a, + po4a-updatepo: New option --previous requires gettext 0.16. + +** Bug fixes + + general: Don't hang when running in background with redirected stdout. + Thanks to Jim Meyering. + +** New features + + general: po4a now uses timestamps to avoid re-generating a translation + if no changes are expected: if a translation is more recent + than its associated PO, master document, addenda or + configuration file, then there is no need to update it. For the + documents which do not pass the translation threshold, a + --stamp option was added to tell po4a to create files with a + .po4a-stamp extension (you can also create them manually). + This can save a lot of time when po4a knows that the + translation will not be generated because there were no changes + since the last po4a run. + + general: Beginning of a C extension. This provides speedup. Testers are + welcomed. + + po4a: New options: --msgid-bugs-address and --copyright-holder. + + po4a: Add new tag: [options] to set global options (i.e. for every + documents in the configuration file). + + po4a: Update translations based on modification times. Use timestamp to + avoid retrying generate uncompleted translations. + + man: New 'unknown_macros' option to specify the behavior of po4a with + unknown groff macros. + + man: Reset the configuration between two runs. This permits to define + different options for different files in a config file with the + opt:"..." parameters. + +=============================================================================== +* Major changes in release 0.30 (2007-01-05) + +** Bug fixes + + man: Recode the text which is skipped, like comments. + This kind of issue may also appear on other modules. + A better solution would be to always use UTF-8 internally. + + distribution: Some unit tests were missing. + Also, the dependencies have been simplified. + Locale::gettext, Text::WrapI18N, Term::ReadKey and SGMLS + are still recommended, but no more required. + The BibTex module is now distributed. + + sgml: The module should be more friendly with XML files. + + po4a: When po4a creates a new PO file, it now uses msginit. This may + change the header of created PO files. + + guide: Major update of the tag definitions. Thanks to Azamat H. + Hackimov. + + Po: use strftime instead of date because date is not available on + every platform. + + tests: rename the XML testsuite to SGML, since it was testing the Sgml + module, and add a new testsuite for the Xml module (it currently + tests the Guide module). + +** Translations + + Updated Russian translation. + +=============================================================================== +* Major changes in release 0.29 (2006-10-15) + +** New features + +** Bug fixes + + sgml: Remove the tags from the default categories when they are defined + by the user. This changes the behavior of the Sgml module's options. + + sgml: Better line references in the generated PO. + + sgml: Support for '/>' (empty XML tag closure) when an xml prologue is + found (). + + po4a: When po4a create new PO files, it now uses msginit instead of + copying the POT file. + +=============================================================================== +* Major changes in release 0.29 (2006-10-15) + +** New features + + New module for .INI files. Thanks to Costin Stroie. + + New module for BibTeX bibliographies. + + man: New mdoc option for stricter support of mdoc pages (NAME section + not translated). + + text: Support for underlined text. + + text: Support for bulleted paragraphs (can be deactivated with + -o nobullets). + +** Bug fixes + + man: Keep empty commented lines. + + man: Do not add spaces at the end of lines. + + man: Languages without non breaking space could not use question marks. + + sgml: Better support for verbatim sections, and consider + as verbatim. and